summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/dktools/Bmpp4App.cpp1134
-rw-r--r--support/dktools/Bmpp4App.cpt1166
-rw-r--r--support/dktools/Bmpp4App.h159
-rw-r--r--support/dktools/Bmpp4Frame.cpp2127
-rw-r--r--support/dktools/Bmpp4Frame.h531
-rw-r--r--support/dktools/Bmpp4Frame.wxc1764
-rw-r--r--support/dktools/Bmpp4Progress.cpp1270
-rw-r--r--support/dktools/Bmpp4Progress.h333
-rw-r--r--support/dktools/Bmpp4Progress.wxc1326
-rw-r--r--support/dktools/Dk4Comparable.cpp71
-rw-r--r--support/dktools/Dk4Comparable.cpt142
-rw-r--r--support/dktools/Dk4Comparable.h139
-rw-r--r--support/dktools/Dk4Container.cpt554
-rw-r--r--support/dktools/Dk4Container.h592
-rw-r--r--support/dktools/Dk4FcsApp.cpp105
-rw-r--r--support/dktools/Dk4FcsApp.cpt48
-rw-r--r--support/dktools/Dk4FcsApp.h41
-rw-r--r--support/dktools/Dk4FcsFrame.cpp255
-rw-r--r--support/dktools/Dk4FcsFrame.h44
-rw-r--r--support/dktools/Dk4FcsFrame.wxc41
-rw-r--r--support/dktools/Dk4FcsThread.h11
-rw-r--r--support/dktools/Dk4WxApplicationHelper.cpp730
-rw-r--r--support/dktools/Dk4WxApplicationHelper.cpt610
-rw-r--r--support/dktools/Dk4WxApplicationHelper.h267
-rw-r--r--support/dktools/Dk4WxAutostartController.cpp99
-rw-r--r--support/dktools/Dk4WxAutostartController.cpt160
-rw-r--r--support/dktools/Dk4WxAutostartController.h135
-rw-r--r--support/dktools/Dk4WxColourPalette.cpp1905
-rw-r--r--support/dktools/Dk4WxColourPalette.h868
-rw-r--r--support/dktools/Dk4WxColourPalette.wxc1847
-rw-r--r--support/dktools/Dk4WxColourView.cpp497
-rw-r--r--support/dktools/Dk4WxColourView.cpt781
-rw-r--r--support/dktools/Dk4WxColourView.h339
-rw-r--r--support/dktools/Dk4WxControl.cpp94
-rw-r--r--support/dktools/Dk4WxControl.cpt44
-rw-r--r--support/dktools/Dk4WxControl.h56
-rw-r--r--support/dktools/Dk4WxFrame.cpp488
-rw-r--r--support/dktools/Dk4WxFrame.cpt321
-rw-r--r--support/dktools/Dk4WxFrame.h66
-rw-r--r--support/dktools/Dk4WxHelpController.cpp76
-rw-r--r--support/dktools/Dk4WxHelpController.cpt48
-rw-r--r--support/dktools/Dk4WxHelpController.h48
-rw-r--r--support/dktools/Dk4WxProcessingController.cpp69
-rw-r--r--support/dktools/Dk4WxProcessingController.cpt145
-rw-r--r--support/dktools/Dk4WxProcessingController.h107
-rw-r--r--support/dktools/Dk4WxProgressControllerBase.h13
-rw-r--r--support/dktools/Dk4WxProgressDialog.cpp31
-rw-r--r--support/dktools/Dk4WxProgressDialog.h50
-rw-r--r--support/dktools/Dk4WxProgressDialog.wxc35
-rw-r--r--support/dktools/Dk4WxYesNoDialog.cpp207
-rw-r--r--support/dktools/Dk4WxYesNoDialog.h165
-rw-r--r--support/dktools/Dk4WxYesNoDialog.wxc224
-rw-r--r--support/dktools/DkClockApp.cpp107
-rw-r--r--support/dktools/DkClockApp.cpt56
-rw-r--r--support/dktools/DkClockApp.h41
-rw-r--r--support/dktools/DkClockData.cpp51
-rw-r--r--support/dktools/DkClockData.cpt4
-rw-r--r--support/dktools/DkClockData.h10
-rw-r--r--support/dktools/DkClockFrame.cpp164
-rw-r--r--support/dktools/DkClockFrame.h44
-rw-r--r--support/dktools/DkClockFrame.wxc48
-rw-r--r--support/dktools/DkClockOptionsDialog.cpp91
-rw-r--r--support/dktools/DkClockOptionsDialog.h48
-rw-r--r--support/dktools/DkClockOptionsDialog.wxc27
-rw-r--r--support/dktools/DkClockTaskbarIcon.cpp78
-rw-r--r--support/dktools/DkClockTaskbarIcon.cpt24
-rw-r--r--support/dktools/DkClockTaskbarIcon.h40
-rw-r--r--support/dktools/DkClockView.cpp76
-rw-r--r--support/dktools/DkClockView.cpt34
-rw-r--r--support/dktools/DkClockView.h44
-rw-r--r--support/dktools/DkWxAppHelper.cpp307
-rw-r--r--support/dktools/DkWxAppHelper.cpt40
-rw-r--r--support/dktools/DkWxAppHelper.h47
-rw-r--r--support/dktools/DkWxBmepsApp.cpp104
-rw-r--r--support/dktools/DkWxBmepsApp.cpt54
-rw-r--r--support/dktools/DkWxBmepsApp.h40
-rw-r--r--support/dktools/DkWxBmepsFrame.cpp233
-rw-r--r--support/dktools/DkWxBmepsFrame.h44
-rw-r--r--support/dktools/DkWxBmepsFrame.wxc49
-rw-r--r--support/dktools/DkWxBmepsOptionsDialog.cpp118
-rw-r--r--support/dktools/DkWxBmepsOptionsDialog.h50
-rw-r--r--support/dktools/DkWxBmepsOptionsDialog.wxc44
-rw-r--r--support/dktools/DkWxBmepsThread.cpp88
-rw-r--r--support/dktools/DkWxBmepsThread.cpt8
-rw-r--r--support/dktools/DkWxBmepsThread.h36
-rw-r--r--support/dktools/DkWxBufferedControl.cpp124
-rw-r--r--support/dktools/DkWxBufferedControl.cpt42
-rw-r--r--support/dktools/DkWxBufferedControl.h48
-rw-r--r--support/dktools/DkWxColorView.cpp70
-rw-r--r--support/dktools/DkWxColorView.cpt36
-rw-r--r--support/dktools/DkWxColorView.h46
-rw-r--r--support/dktools/DkWxCommunicator.cpp102
-rw-r--r--support/dktools/DkWxCommunicator.cpt14
-rw-r--r--support/dktools/DkWxCommunicator.h46
-rw-r--r--support/dktools/DkWxDialog.cpp14
-rw-r--r--support/dktools/DkWxDialog.cpt5
-rw-r--r--support/dktools/DkWxDialog.h10
-rw-r--r--support/dktools/DkWxFrame.cpp186
-rw-r--r--support/dktools/DkWxFrame.cpt40
-rw-r--r--support/dktools/DkWxFrame.h36
-rw-r--r--support/dktools/DkWxHelpController.cpp74
-rw-r--r--support/dktools/DkWxHelpController.cpt20
-rw-r--r--support/dktools/DkWxHelpController.h36
-rw-r--r--support/dktools/DkWxHtbApp.cpp95
-rw-r--r--support/dktools/DkWxHtbApp.cpt56
-rw-r--r--support/dktools/DkWxHtbApp.h41
-rw-r--r--support/dktools/DkWxHtbFrame.cpp74
-rw-r--r--support/dktools/DkWxHtbFrame.h44
-rw-r--r--support/dktools/DkWxHtbFrame.wxc34
-rw-r--r--support/dktools/DkWxImgszApp.cpp404
-rw-r--r--support/dktools/DkWxImgszApp.cpt452
-rw-r--r--support/dktools/DkWxImgszFrame.cpp1075
-rw-r--r--support/dktools/DkWxImgszFrame.h404
-rw-r--r--support/dktools/DkWxImgszFrame.wxc960
-rw-r--r--support/dktools/DkWxImgszOptionsDialog.cpp219
-rw-r--r--support/dktools/DkWxImgszOptionsDialog.h158
-rw-r--r--support/dktools/DkWxImgszOptionsDialog.wxc206
-rw-r--r--support/dktools/DkWxPathApp.cpp64
-rw-r--r--support/dktools/DkWxPathApp.cpt14
-rw-r--r--support/dktools/DkWxPathApp.h40
-rw-r--r--support/dktools/DkWxPathFrame.cpp175
-rw-r--r--support/dktools/DkWxPathFrame.h44
-rw-r--r--support/dktools/DkWxPathFrame.wxc29
-rw-r--r--support/dktools/DkWxProcessingController.cpp39
-rw-r--r--support/dktools/DkWxProcessingController.cpt3
-rw-r--r--support/dktools/DkWxProcessingController.h36
-rw-r--r--support/dktools/DkWxProcessingIdleController.cpp41
-rw-r--r--support/dktools/DkWxProcessingIdleController.cpt10
-rw-r--r--support/dktools/DkWxProcessingIdleController.h43
-rw-r--r--support/dktools/DkWxProgressDialog.cpp102
-rw-r--r--support/dktools/DkWxProgressDialog.h46
-rw-r--r--support/dktools/DkWxProgressDialog.wxc18
-rw-r--r--support/dktools/DkWxTraceApp.cpp91
-rw-r--r--support/dktools/DkWxTraceApp.cpt53
-rw-r--r--support/dktools/DkWxTraceApp.h40
-rw-r--r--support/dktools/DkWxTraceFrame.cpp140
-rw-r--r--support/dktools/DkWxTraceFrame.h54
-rw-r--r--support/dktools/DkWxTraceFrame.wxc56
-rw-r--r--support/dktools/DkWxTraceOptionsDialog.cpp70
-rw-r--r--support/dktools/DkWxTraceOptionsDialog.h52
-rw-r--r--support/dktools/DkWxTraceOptionsDialog.wxc34
-rw-r--r--support/dktools/DkWxTraceThread.cpp112
-rw-r--r--support/dktools/DkWxTraceThread.cpt21
-rw-r--r--support/dktools/DkWxTraceThread.h45
-rw-r--r--support/dktools/Doxyfile9
-rw-r--r--support/dktools/INSTALL53
-rw-r--r--support/dktools/LICENSE6
-rw-r--r--support/dktools/LICENSE.spdx6
-rw-r--r--support/dktools/Makefile4638
-rw-r--r--support/dktools/Makefile.in4419
-rw-r--r--support/dktools/PKGBUILD.in61
-rw-r--r--support/dktools/README21
-rw-r--r--support/dktools/ScreenSizeApp.cpp55
-rw-r--r--support/dktools/ScreenSizeApp.cpt18
-rw-r--r--support/dktools/ScreenSizeApp.h41
-rw-r--r--support/dktools/ScreenSizeFrame.cpp83
-rw-r--r--support/dktools/ScreenSizeFrame.h79
-rw-r--r--support/dktools/ScreenSizeFrame.wxc68
-rw-r--r--support/dktools/TODO34
-rw-r--r--support/dktools/WinprintApp.cpp73
-rw-r--r--support/dktools/WinprintApp.cpt24
-rw-r--r--support/dktools/WinprintApp.h41
-rw-r--r--support/dktools/WinprintChooserDialog.cpp59
-rw-r--r--support/dktools/WinprintChooserDialog.h44
-rw-r--r--support/dktools/WinprintChooserDialog.wxc19
-rw-r--r--support/dktools/WinprintFrame.cpp321
-rw-r--r--support/dktools/WinprintFrame.h50
-rw-r--r--support/dktools/WinprintFrame.wxc135
-rw-r--r--support/dktools/WinprintThread.cpp36
-rw-r--r--support/dktools/WinprintThread.cpt2
-rw-r--r--support/dktools/WinprintThread.h36
-rw-r--r--support/dktools/WxdkdrawApp.cpp2299
-rw-r--r--support/dktools/WxdkdrawApp.cpt1591
-rw-r--r--support/dktools/WxdkdrawApp.h83
-rw-r--r--support/dktools/WxdkdrawComp.cpp282
-rw-r--r--support/dktools/WxdkdrawComp.cpt345
-rw-r--r--support/dktools/WxdkdrawComp.h104
-rw-r--r--support/dktools/WxdkdrawControl.cpp179
-rw-r--r--support/dktools/WxdkdrawControl.cpt148
-rw-r--r--support/dktools/WxdkdrawControlArrows.cpp753
-rw-r--r--support/dktools/WxdkdrawControlArrows.cpt718
-rw-r--r--support/dktools/WxdkdrawControlDraw.cpp3554
-rw-r--r--support/dktools/WxdkdrawControlDraw.cpt3195
-rw-r--r--support/dktools/WxdkdrawControlEvents.cpp410
-rw-r--r--support/dktools/WxdkdrawControlEvents.cpt351
-rw-r--r--support/dktools/WxdkdrawControlTools.cpp476
-rw-r--r--support/dktools/WxdkdrawControlTools.cpt403
-rw-r--r--support/dktools/WxdkdrawDlgArrowSize.cpp461
-rw-r--r--support/dktools/WxdkdrawDlgArrowSize.h220
-rw-r--r--support/dktools/WxdkdrawDlgArrowSize.wxc475
-rw-r--r--support/dktools/WxdkdrawDlgArrowType.cpp861
-rw-r--r--support/dktools/WxdkdrawDlgArrowType.h337
-rw-r--r--support/dktools/WxdkdrawDlgArrowType.wxc654
-rw-r--r--support/dktools/WxdkdrawDlgBoxRadius.cpp359
-rw-r--r--support/dktools/WxdkdrawDlgBoxRadius.h206
-rw-r--r--support/dktools/WxdkdrawDlgBoxRadius.wxc367
-rw-r--r--support/dktools/WxdkdrawDlgDotFilled.cpp362
-rw-r--r--support/dktools/WxdkdrawDlgDotFilled.h192
-rw-r--r--support/dktools/WxdkdrawDlgDotFilled.wxc365
-rw-r--r--support/dktools/WxdkdrawDlgFillStyle.cpp687
-rw-r--r--support/dktools/WxdkdrawDlgFillStyle.h284
-rw-r--r--support/dktools/WxdkdrawDlgFillStyle.wxc515
-rw-r--r--support/dktools/WxdkdrawDlgFontName.cpp709
-rw-r--r--support/dktools/WxdkdrawDlgFontName.h288
-rw-r--r--support/dktools/WxdkdrawDlgFontName.wxc605
-rw-r--r--support/dktools/WxdkdrawDlgImageOptions.cpp450
-rw-r--r--support/dktools/WxdkdrawDlgImageOptions.h205
-rw-r--r--support/dktools/WxdkdrawDlgImageOptions.wxc395
-rw-r--r--support/dktools/WxdkdrawDlgLayerManager.cpp338
-rw-r--r--support/dktools/WxdkdrawDlgLayerManager.cpt468
-rw-r--r--support/dktools/WxdkdrawDlgLayerManager.h177
-rw-r--r--support/dktools/WxdkdrawDlgLayers.cpp244
-rw-r--r--support/dktools/WxdkdrawDlgLayers.h162
-rw-r--r--support/dktools/WxdkdrawDlgLayers.wxc245
-rw-r--r--support/dktools/WxdkdrawDlgLineCap.cpp255
-rw-r--r--support/dktools/WxdkdrawDlgLineCap.h156
-rw-r--r--support/dktools/WxdkdrawDlgLineCap.wxc273
-rw-r--r--support/dktools/WxdkdrawDlgLineJoin.cpp256
-rw-r--r--support/dktools/WxdkdrawDlgLineJoin.h166
-rw-r--r--support/dktools/WxdkdrawDlgLineJoin.wxc289
-rw-r--r--support/dktools/WxdkdrawDlgLineStyle.cpp342
-rw-r--r--support/dktools/WxdkdrawDlgLineStyle.h193
-rw-r--r--support/dktools/WxdkdrawDlgLineStyle.wxc356
-rw-r--r--support/dktools/WxdkdrawDlgMiterLimit.cpp279
-rw-r--r--support/dktools/WxdkdrawDlgMiterLimit.h162
-rw-r--r--support/dktools/WxdkdrawDlgMiterLimit.wxc285
-rw-r--r--support/dktools/WxdkdrawDlgOptionsNewObjects.cpp338
-rw-r--r--support/dktools/WxdkdrawDlgOptionsNewObjects.h191
-rw-r--r--support/dktools/WxdkdrawDlgOptionsNewObjects.wxc305
-rw-r--r--support/dktools/WxdkdrawDlgOptionsScreen.cpp416
-rw-r--r--support/dktools/WxdkdrawDlgOptionsScreen.h234
-rw-r--r--support/dktools/WxdkdrawDlgOptionsScreen.wxc405
-rw-r--r--support/dktools/WxdkdrawDlgSplineValue.cpp280
-rw-r--r--support/dktools/WxdkdrawDlgSplineValue.h165
-rw-r--r--support/dktools/WxdkdrawDlgSplineValue.wxc286
-rw-r--r--support/dktools/WxdkdrawDlgStyleLength.cpp297
-rw-r--r--support/dktools/WxdkdrawDlgStyleLength.h165
-rw-r--r--support/dktools/WxdkdrawDlgStyleLength.wxc299
-rw-r--r--support/dktools/WxdkdrawDlgTextAlign.cpp261
-rw-r--r--support/dktools/WxdkdrawDlgTextAlign.h165
-rw-r--r--support/dktools/WxdkdrawDlgTextAlign.wxc289
-rw-r--r--support/dktools/WxdkdrawDlgTextInput.cpp495
-rw-r--r--support/dktools/WxdkdrawDlgTextInput.h210
-rw-r--r--support/dktools/WxdkdrawDlgTextInput.wxc524
-rw-r--r--support/dktools/WxdkdrawFont.cpp782
-rw-r--r--support/dktools/WxdkdrawFont.cpt650
-rw-r--r--support/dktools/WxdkdrawFont.h87
-rw-r--r--support/dktools/WxdkdrawFrame.cpp2726
-rw-r--r--support/dktools/WxdkdrawFrame.h4200
-rw-r--r--support/dktools/WxdkdrawFrame.wxc4858
-rw-r--r--support/dktools/WxdkdrawFrameEvents.cpp4310
-rw-r--r--support/dktools/WxdkdrawFrameEvents.cpt3874
-rw-r--r--support/dktools/WxdkdrawFrameStipples.cpp1415
-rw-r--r--support/dktools/WxdkdrawFrameStipples.cpt1287
-rw-r--r--support/dktools/WxdkdrawFrameTools.cpp2775
-rw-r--r--support/dktools/WxdkdrawFrameTools.cpt2440
-rw-r--r--support/dktools/WxdkdrawMouse.cpp5944
-rw-r--r--support/dktools/WxdkdrawMouse.cpt5235
-rw-r--r--support/dktools/WxdkdrawMouseMove.cpp (renamed from support/dktools/DkWxImgszApp.h)58
-rw-r--r--support/dktools/WxdkdrawObj.cpp8226
-rw-r--r--support/dktools/WxdkdrawObj.cpt8407
-rw-r--r--support/dktools/WxdkdrawObj.h1270
-rw-r--r--support/dktools/WxdkdrawRead.cpp2776
-rw-r--r--support/dktools/WxdkdrawRead.cpt2310
-rw-r--r--support/dktools/WxdkdrawRead.h67
-rw-r--r--support/dktools/WxdkdrawTypes.cpt448
-rw-r--r--support/dktools/WxdkdrawTypes.h462
-rw-r--r--support/dktools/WxdkdrawWrite.cpp1299
-rw-r--r--support/dktools/WxdkdrawWrite.cpt1307
-rw-r--r--support/dktools/WxdkdrawWrite.h46
-rw-r--r--support/dktools/WximgszApp.cpp569
-rw-r--r--support/dktools/WximgszApp.cpt598
-rw-r--r--support/dktools/WximgszApp.h77
-rw-r--r--support/dktools/WximgszFrame.cpp1471
-rw-r--r--support/dktools/WximgszFrame.h378
-rw-r--r--support/dktools/WximgszFrame.wxc1321
-rw-r--r--support/dktools/WxpqdicApp.cpp104
-rw-r--r--support/dktools/WxpqdicApp.cpt47
-rw-r--r--support/dktools/WxpqdicApp.h41
-rw-r--r--support/dktools/WxpqdicFrame.cpp235
-rw-r--r--support/dktools/WxpqdicFrame.h44
-rw-r--r--support/dktools/WxpqdicFrame.wxc71
-rw-r--r--support/dktools/addctrld.c58
-rw-r--r--support/dktools/addctrld.ctr54
-rw-r--r--support/dktools/addctrld.rc8
-rw-r--r--support/dktools/autom4te.cache/output.013814
-rw-r--r--support/dktools/autom4te.cache/requests90
-rw-r--r--support/dktools/autom4te.cache/traces.05031
-rw-r--r--support/dktools/bif.h714
-rw-r--r--support/dktools/bild-neu.pdfbin0 -> 7937 bytes
-rw-r--r--support/dktools/bild-neu.tex25
-rw-r--r--support/dktools/blubb.wxd18
-rw-r--r--support/dktools/bmeps3.c158
-rw-r--r--support/dktools/bmeps3.ctr24
-rw-r--r--support/dktools/bmeps3.h36
-rw-r--r--support/dktools/bmpp.c2493
-rw-r--r--support/dktools/bmpp.ctr2383
-rw-r--r--support/dktools/bmpp.h93
-rw-r--r--support/dktools/bmpp.rc12
-rw-r--r--support/dktools/bsdlic.txt52
-rw-r--r--support/dktools/choose-dir.xpm38
-rw-r--r--support/dktools/conf.vc6
-rw-r--r--support/dktools/config.h.in88
-rwxr-xr-xsupport/dktools/configure13726
-rw-r--r--support/dktools/configure.ac5957
-rw-r--r--support/dktools/configure.out.mingw762
-rwxr-xr-xsupport/dktools/debian-build-deb.sh (renamed from support/dktools/debian-jessie-build-deb.sh)34
-rwxr-xr-xsupport/dktools/debian-build-dktoolian.sh2
-rwxr-xr-xsupport/dktools/debian-jessie-build-live.sh2037
-rwxr-xr-xsupport/dktools/debian-prepare.sh (renamed from support/dktools/debian-jessie-prepare.sh)41
-rw-r--r--support/dktools/debian/README.source51
-rw-r--r--support/dktools/debian/changelog487
-rw-r--r--support/dktools/debian/control59
-rw-r--r--support/dktools/debian/control.in55
-rw-r--r--support/dktools/debian/control869
-rw-r--r--support/dktools/debian/control8.in69
-rw-r--r--support/dktools/debian/control969
-rw-r--r--support/dktools/debian/control9.in69
-rw-r--r--support/dktools/debian/copyright60
-rw-r--r--support/dktools/debian/dktools-data.install5
-rw-r--r--support/dktools/debian/dktools-lib-4.26-dev.install (renamed from support/dktools/debian/dktools-lib-4.8-dev.install)2
-rw-r--r--support/dktools/debian/dktools-lib-4.26.install (renamed from support/dktools/debian/dktools-lib-4.8.install)0
-rw-r--r--support/dktools/debian/dktools-lib-4.26.lintian-overrides (renamed from support/dktools/debian/dktools-lib-4.8.lintian-overrides)0
-rw-r--r--support/dktools/debian/dktools-lib-4.27-dev.install3
-rw-r--r--support/dktools/debian/dktools-lib-4.27.install1
-rw-r--r--support/dktools/debian/dktools-lib-4.27.lintian-overrides1
-rw-r--r--support/dktools/debian/dktools-lib-4.28-dev.install3
-rw-r--r--support/dktools/debian/dktools-lib-4.28.install1
-rw-r--r--support/dktools/debian/dktools-lib-4.28.lintian-overrides1
-rw-r--r--support/dktools/debian/dktools-lib-4.29-dev.install3
-rw-r--r--support/dktools/debian/dktools-lib-4.29.install1
-rw-r--r--support/dktools/debian/dktools-lib-4.29.lintian-overrides1
-rw-r--r--support/dktools/debian/dktools-lib-4.30-dev.install3
-rw-r--r--support/dktools/debian/dktools-lib-4.30.install1
-rw-r--r--support/dktools/debian/dktools-lib-4.30.lintian-overrides1
-rw-r--r--support/dktools/debian/dktools-lib-data.install2
-rw-r--r--support/dktools/debian/dktools-lib-dev.install.in2
-rw-r--r--support/dktools/debian/dktools.install5
-rw-r--r--support/dktools/debian/dktools.manpages12
-rw-r--r--support/dktools/debian/postinst (renamed from support/dktools/debian/dktools-lib.postinst.in)20
-rw-r--r--support/dktools/debian/prerm42
-rw-r--r--support/dktools/debian/printqd.install4
-rw-r--r--support/dktools/debian/printqd.lintian-overrides1
-rw-r--r--support/dktools/debian/printqd.manpages4
-rw-r--r--support/dktools/debian/printqd.postinst64
-rw-r--r--support/dktools/debian/printqd.postinst.in64
-rw-r--r--support/dktools/debian/printqd.postrm62
-rw-r--r--support/dktools/debian/printqd.postrm.in62
-rw-r--r--support/dktools/debian/printqd.preinst35
-rw-r--r--support/dktools/debian/printqd.prerm38
-rw-r--r--support/dktools/debian/printqd.printqd.service15
-rw-r--r--support/dktools/debian/rshdown.install5
-rw-r--r--support/dktools/debian/rshdown.lintian-overrides1
-rw-r--r--support/dktools/debian/rshdown.manpages2
-rw-r--r--support/dktools/debian/rshdown.postinst (renamed from support/dktools/debian/dktools-lib-4.8.postinst)16
-rw-r--r--support/dktools/debian/rshdown.postrm (renamed from support/dktools/debian/dktools-lib.postrm.in)29
-rw-r--r--support/dktools/debian/rshdown.postrm.in (renamed from support/dktools/debian/dktools-lib-4.8.postrm)29
-rw-r--r--support/dktools/debian/rshdown.preinst35
-rw-r--r--support/dktools/debian/rshdown.prerm38
-rw-r--r--support/dktools/debian/rshdown.rshdown.service16
-rwxr-xr-x[-rw-r--r--]support/dktools/debian/rules13
-rw-r--r--support/dktools/debian/upstream/metadata6
-rw-r--r--support/dktools/dk-bin2c.c1208
-rw-r--r--support/dktools/dk-bin2c.ctr1178
-rw-r--r--support/dktools/dk-bin2c.rc37
-rw-r--r--support/dktools/dk-blks.c147
-rw-r--r--support/dktools/dk-blks.ctr79
-rw-r--r--support/dktools/dk-blks.rc8
-rw-r--r--support/dktools/dk-bmm.c279
-rw-r--r--support/dktools/dk-bmm.ctr85
-rw-r--r--support/dktools/dk-bmm.rc8
-rw-r--r--support/dktools/dk-cat.c471
-rw-r--r--support/dktools/dk-cat.ctr281
-rw-r--r--support/dktools/dk-cat.rc8
-rw-r--r--support/dktools/dk-db2t.c152
-rw-r--r--support/dktools/dk-db2t.ctr86
-rw-r--r--support/dktools/dk-db2t.rc8
-rw-r--r--support/dktools/dk-dbco.c141
-rw-r--r--support/dktools/dk-dbco.ctr57
-rw-r--r--support/dktools/dk-dbco.rc8
-rw-r--r--support/dktools/dk-eradisk.c130
-rw-r--r--support/dktools/dk-eradisk.ctr78
-rw-r--r--support/dktools/dk-eradisk.rc8
-rw-r--r--support/dktools/dk-fic.c278
-rw-r--r--support/dktools/dk-fic.ctr110
-rw-r--r--support/dktools/dk-fic.rc8
-rw-r--r--support/dktools/dk-hex.c130
-rw-r--r--support/dktools/dk-hex.ctr74
-rw-r--r--support/dktools/dk-hex.rc8
-rw-r--r--support/dktools/dk-lines.c2769
-rw-r--r--support/dktools/dk-lines.ctr2493
-rw-r--r--support/dktools/dk-lines.rc37
-rw-r--r--support/dktools/dk-ls-to.c36
-rw-r--r--support/dktools/dk-ls-to.ctr2
-rw-r--r--support/dktools/dk-ls.c364
-rw-r--r--support/dktools/dk-ls.ctr118
-rw-r--r--support/dktools/dk-ls.h46
-rw-r--r--support/dktools/dk-ls.rc8
-rw-r--r--support/dktools/dk-pwd.c94
-rw-r--r--support/dktools/dk-pwd.ctr50
-rw-r--r--support/dktools/dk-pwd.rc37
-rw-r--r--support/dktools/dk-pwg-rnd.c36
-rw-r--r--support/dktools/dk-pwg-rnd.ctr2
-rw-r--r--support/dktools/dk-pwg-rnd.h36
-rw-r--r--support/dktools/dk-pwgen.c230
-rw-r--r--support/dktools/dk-pwgen.ctr88
-rw-r--r--support/dktools/dk-pwgen.rc8
-rw-r--r--support/dktools/dk-rand.c125
-rw-r--r--support/dktools/dk-rand.ctr81
-rw-r--r--support/dktools/dk-rand.rc8
-rw-r--r--support/dktools/dk-recv.c330
-rw-r--r--support/dktools/dk-recv.ctr207
-rw-r--r--support/dktools/dk-recv.rc8
-rw-r--r--support/dktools/dk-send.c340
-rw-r--r--support/dktools/dk-send.ctr227
-rw-r--r--support/dktools/dk-send.rc8
-rw-r--r--support/dktools/dk-sort.c218
-rw-r--r--support/dktools/dk-sort.ctr94
-rw-r--r--support/dktools/dk-sort.rc8
-rw-r--r--support/dktools/dk-sqlsplit.c395
-rw-r--r--support/dktools/dk-sqlsplit.ctr52
-rw-r--r--support/dktools/dk-sqlsplit.rc8
-rw-r--r--support/dktools/dk-t2db.c171
-rw-r--r--support/dktools/dk-t2db.ctr93
-rw-r--r--support/dktools/dk-t2db.rc8
-rw-r--r--support/dktools/dk-t2h.c234
-rw-r--r--support/dktools/dk-t2h.ctr136
-rw-r--r--support/dktools/dk-t2h.rc8
-rw-r--r--support/dktools/dk-t2l.c286
-rw-r--r--support/dktools/dk-t2l.ctr231
-rw-r--r--support/dktools/dk-t2l.rc8
-rw-r--r--support/dktools/dk-uid.c126
-rw-r--r--support/dktools/dk-uid.ctr62
-rw-r--r--support/dktools/dk3.h4
-rw-r--r--support/dktools/dk3all.h4
-rw-r--r--support/dktools/dk3app.c626
-rw-r--r--support/dktools/dk3app.ctr62
-rw-r--r--support/dktools/dk3app.h36
-rw-r--r--support/dktools/dk3appr.c65
-rw-r--r--support/dktools/dk3appr.ctr21
-rw-r--r--support/dktools/dk3bb.c36
-rw-r--r--support/dktools/dk3bb.ctr2
-rw-r--r--support/dktools/dk3bb.h36
-rw-r--r--support/dktools/dk3bezcu.c259
-rw-r--r--support/dktools/dk3bezcu.ctr143
-rw-r--r--support/dktools/dk3bezcu.h36
-rw-r--r--support/dktools/dk3bf.c36
-rw-r--r--support/dktools/dk3bf.ctr2
-rw-r--r--support/dktools/dk3bf.h36
-rw-r--r--support/dktools/dk3bif.c851
-rw-r--r--support/dktools/dk3bif.ctr417
-rw-r--r--support/dktools/dk3bif.h38
-rw-r--r--support/dktools/dk3bifa.c64
-rw-r--r--support/dktools/dk3bifa.ctr22
-rw-r--r--support/dktools/dk3bifa.h36
-rw-r--r--support/dktools/dk3bits.c36
-rw-r--r--support/dktools/dk3bits.ctr2
-rw-r--r--support/dktools/dk3bits.h36
-rw-r--r--support/dktools/dk3bm.c476
-rw-r--r--support/dktools/dk3bm.ctr20
-rw-r--r--support/dktools/dk3bm.h36
-rw-r--r--support/dktools/dk3bmeo.c417
-rw-r--r--support/dktools/dk3bmeo.ctr5
-rw-r--r--support/dktools/dk3bmeo.h38
-rw-r--r--support/dktools/dk3bmep.c36
-rw-r--r--support/dktools/dk3bmep.ctr2
-rw-r--r--support/dktools/dk3bmep.h36
-rw-r--r--support/dktools/dk3bmeps.c36
-rw-r--r--support/dktools/dk3bmeps.ctr2
-rw-r--r--support/dktools/dk3bmeps.h36
-rw-r--r--support/dktools/dk3bmj.c212
-rw-r--r--support/dktools/dk3bmj.ctr114
-rw-r--r--support/dktools/dk3bmj.h36
-rw-r--r--support/dktools/dk3bom.c37
-rw-r--r--support/dktools/dk3bom.ctr3
-rw-r--r--support/dktools/dk3bom.h36
-rw-r--r--support/dktools/dk3chks.c44
-rw-r--r--support/dktools/dk3chks.ctr10
-rw-r--r--support/dktools/dk3chks.h36
-rw-r--r--support/dktools/dk3conf.cross2
-rw-r--r--support/dktools/dk3conf.cross.in2
-rw-r--r--support/dktools/dk3conf.h124
-rw-r--r--support/dktools/dk3conf.h.end4
-rw-r--r--support/dktools/dk3conf.h.large9
-rw-r--r--support/dktools/dk3conf.h.start21
-rw-r--r--support/dktools/dk3conf.new4248
-rw-r--r--support/dktools/dk3confd.h6
-rw-r--r--support/dktools/dk3config.c193
-rw-r--r--support/dktools/dk3const.h4
-rw-r--r--support/dktools/dk3cores.c93
-rw-r--r--support/dktools/dk3cores.ctr8
-rw-r--r--support/dktools/dk3cores.h10
-rw-r--r--support/dktools/dk3ct.c36
-rw-r--r--support/dktools/dk3ct.ctr2
-rw-r--r--support/dktools/dk3ct.h36
-rw-r--r--support/dktools/dk3dbi.c36
-rw-r--r--support/dktools/dk3dbi.ctr2
-rw-r--r--support/dktools/dk3dbi.h36
-rw-r--r--support/dktools/dk3dir.c215
-rw-r--r--support/dktools/dk3dir.ctr7
-rw-r--r--support/dktools/dk3dir.h36
-rw-r--r--support/dktools/dk3echo.c44
-rw-r--r--support/dktools/dk3echo.ctr8
-rw-r--r--support/dktools/dk3echo.h36
-rw-r--r--support/dktools/dk3enc.c224
-rw-r--r--support/dktools/dk3enc.ctr90
-rw-r--r--support/dktools/dk3enc.h50
-rw-r--r--support/dktools/dk3fig.c211
-rw-r--r--support/dktools/dk3fig.ctr27
-rw-r--r--support/dktools/dk3fig.h44
-rw-r--r--support/dktools/dk3figah.c1790
-rw-r--r--support/dktools/dk3figah.ctr939
-rw-r--r--support/dktools/dk3figah.h39
-rw-r--r--support/dktools/dk3figbb.c36
-rw-r--r--support/dktools/dk3figbb.ctr2
-rw-r--r--support/dktools/dk3figbb.h36
-rw-r--r--support/dktools/dk3figpr.c164
-rw-r--r--support/dktools/dk3figpr.ctr30
-rw-r--r--support/dktools/dk3figpr.h36
-rw-r--r--support/dktools/dk3figrd.c382
-rw-r--r--support/dktools/dk3figrd.ctr20
-rw-r--r--support/dktools/dk3figrd.h36
-rw-r--r--support/dktools/dk3figto.c144
-rw-r--r--support/dktools/dk3figto.ctr12
-rw-r--r--support/dktools/dk3figto.h36
-rw-r--r--support/dktools/dk3font.c36
-rw-r--r--support/dktools/dk3font.ctr2
-rw-r--r--support/dktools/dk3font.h36
-rw-r--r--support/dktools/dk3info.c27
-rw-r--r--support/dktools/dk3info.ctr18
-rw-r--r--support/dktools/dk3info.rc8
-rw-r--r--support/dktools/dk3info1.c5
-rw-r--r--support/dktools/dk3inst.c2
-rw-r--r--support/dktools/dk3inst.h7
-rw-r--r--support/dktools/dk3kv.c38
-rw-r--r--support/dktools/dk3kv.ctr4
-rw-r--r--support/dktools/dk3kv.h36
-rw-r--r--support/dktools/dk3ma.h6
-rw-r--r--support/dktools/dk3mad.c97
-rw-r--r--support/dktools/dk3mad.ctr3
-rw-r--r--support/dktools/dk3mad.h36
-rw-r--r--support/dktools/dk3madfo.c47
-rw-r--r--support/dktools/dk3madfo.ctr3
-rw-r--r--support/dktools/dk3madfo.h36
-rw-r--r--support/dktools/dk3madic.c36
-rw-r--r--support/dktools/dk3madic.ctr2
-rw-r--r--support/dktools/dk3madic.h36
-rw-r--r--support/dktools/dk3madlc.c36
-rw-r--r--support/dktools/dk3madlc.ctr2
-rw-r--r--support/dktools/dk3madlc.h36
-rw-r--r--support/dktools/dk3madsc.c36
-rw-r--r--support/dktools/dk3madsc.ctr2
-rw-r--r--support/dktools/dk3madsc.h36
-rw-r--r--support/dktools/dk3madsi.c36
-rw-r--r--support/dktools/dk3madsi.ctr2
-rw-r--r--support/dktools/dk3madsi.h36
-rw-r--r--support/dktools/dk3madso.c36
-rw-r--r--support/dktools/dk3madso.ctr2
-rw-r--r--support/dktools/dk3madso.h36
-rw-r--r--support/dktools/dk3mafpe.c36
-rw-r--r--support/dktools/dk3mafpe.ctr2
-rw-r--r--support/dktools/dk3mafpe.h36
-rw-r--r--support/dktools/dk3mai.c36
-rw-r--r--support/dktools/dk3mai.ctr2
-rw-r--r--support/dktools/dk3mai.h36
-rw-r--r--support/dktools/dk3maid8.c36
-rw-r--r--support/dktools/dk3maid8.ctr2
-rw-r--r--support/dktools/dk3maid8.h36
-rw-r--r--support/dktools/dk3maidd.c60
-rw-r--r--support/dktools/dk3maidd.ctr8
-rw-r--r--support/dktools/dk3maidd.h36
-rw-r--r--support/dktools/dk3maih8.c36
-rw-r--r--support/dktools/dk3maih8.ctr2
-rw-r--r--support/dktools/dk3maih8.h36
-rw-r--r--support/dktools/dk3maihd.c59
-rw-r--r--support/dktools/dk3maihd.ctr7
-rw-r--r--support/dktools/dk3maihd.h36
-rw-r--r--support/dktools/dk3mal.c36
-rw-r--r--support/dktools/dk3mal.ctr2
-rw-r--r--support/dktools/dk3mal.h36
-rw-r--r--support/dktools/dk3maod8.c36
-rw-r--r--support/dktools/dk3maod8.ctr2
-rw-r--r--support/dktools/dk3maod8.h36
-rw-r--r--support/dktools/dk3maodd.c36
-rw-r--r--support/dktools/dk3maodd.ctr2
-rw-r--r--support/dktools/dk3maodd.h36
-rw-r--r--support/dktools/dk3maoh8.c36
-rw-r--r--support/dktools/dk3maoh8.ctr2
-rw-r--r--support/dktools/dk3maoh8.h36
-rw-r--r--support/dktools/dk3maohd.c36
-rw-r--r--support/dktools/dk3maohd.ctr2
-rw-r--r--support/dktools/dk3maohd.h36
-rw-r--r--support/dktools/dk3mas.c36
-rw-r--r--support/dktools/dk3mas.ctr2
-rw-r--r--support/dktools/dk3mas.h36
-rw-r--r--support/dktools/dk3masts.c77
-rw-r--r--support/dktools/dk3masts.ctr3
-rw-r--r--support/dktools/dk3masts.h36
-rw-r--r--support/dktools/dk3maui.c36
-rw-r--r--support/dktools/dk3maui.ctr2
-rw-r--r--support/dktools/dk3maui.h36
-rw-r--r--support/dktools/dk3maul.c167
-rw-r--r--support/dktools/dk3maul.ctr9
-rw-r--r--support/dktools/dk3maul.h36
-rw-r--r--support/dktools/dk3maus.c36
-rw-r--r--support/dktools/dk3maus.ctr2
-rw-r--r--support/dktools/dk3maus.h36
-rw-r--r--support/dktools/dk3md.c36
-rw-r--r--support/dktools/dk3md.ctr2
-rw-r--r--support/dktools/dk3md.h36
-rw-r--r--support/dktools/dk3mem.c42
-rw-r--r--support/dktools/dk3mem.ctr26
-rw-r--r--support/dktools/dk3mem.h54
-rw-r--r--support/dktools/dk3nettp.h7
-rw-r--r--support/dktools/dk3numco.h4
-rw-r--r--support/dktools/dk3of.c181
-rw-r--r--support/dktools/dk3of.ctr39
-rw-r--r--support/dktools/dk3of.h36
-rw-r--r--support/dktools/dk3opt.c36
-rw-r--r--support/dktools/dk3opt.ctr2
-rw-r--r--support/dktools/dk3opt.h36
-rw-r--r--support/dktools/dk3paper.c36
-rw-r--r--support/dktools/dk3paper.ctr2
-rw-r--r--support/dktools/dk3paper.h36
-rw-r--r--support/dktools/dk3pdf.c594
-rw-r--r--support/dktools/dk3pdf.ctr146
-rw-r--r--support/dktools/dk3pdf.h36
-rw-r--r--support/dktools/dk3pixre.c36
-rw-r--r--support/dktools/dk3pixre.ctr2
-rw-r--r--support/dktools/dk3pixre.h36
-rw-r--r--support/dktools/dk3prcfg.c148
-rw-r--r--support/dktools/dk3prcfg.ctr16
-rw-r--r--support/dktools/dk3prcfg.h36
-rw-r--r--support/dktools/dk3print.c124
-rw-r--r--support/dktools/dk3print.ctr12
-rw-r--r--support/dktools/dk3print.h36
-rw-r--r--support/dktools/dk3prreq.c14
-rw-r--r--support/dktools/dk3prreq.ctr7
-rw-r--r--support/dktools/dk3prreq.h10
-rw-r--r--support/dktools/dk3range.h5
-rw-r--r--support/dktools/dk3se.c159
-rw-r--r--support/dktools/dk3se.ctr87
-rw-r--r--support/dktools/dk3se.h36
-rw-r--r--support/dktools/dk3sf.c471
-rw-r--r--support/dktools/dk3sf.ctr103
-rw-r--r--support/dktools/dk3sf.h36
-rw-r--r--support/dktools/dk3signl.c48
-rw-r--r--support/dktools/dk3signl.ctr12
-rw-r--r--support/dktools/dk3signl.h36
-rw-r--r--support/dktools/dk3srch.c36
-rw-r--r--support/dktools/dk3srch.ctr2
-rw-r--r--support/dktools/dk3srch.h36
-rw-r--r--support/dktools/dk3stm.h4
-rw-r--r--support/dktools/dk3sto.c283
-rw-r--r--support/dktools/dk3sto.ctr31
-rw-r--r--support/dktools/dk3sto.h36
-rw-r--r--support/dktools/dk3str.c214
-rw-r--r--support/dktools/dk3str.ctr62
-rw-r--r--support/dktools/dk3str.h36
-rw-r--r--support/dktools/dk3strkv.c361
-rw-r--r--support/dktools/dk3strkv.ctr3
-rw-r--r--support/dktools/dk3strkv.h10
-rw-r--r--support/dktools/dk3strm.c62
-rw-r--r--support/dktools/dk3strm.ctr32
-rw-r--r--support/dktools/dk3strm.h36
-rw-r--r--support/dktools/dk3strmb.c36
-rw-r--r--support/dktools/dk3strmb.ctr2
-rw-r--r--support/dktools/dk3strmg.c36
-rw-r--r--support/dktools/dk3strmg.ctr2
-rw-r--r--support/dktools/dk3trace.c48
-rw-r--r--support/dktools/dk3trace.ctr18
-rw-r--r--support/dktools/dk3trace.h42
-rw-r--r--support/dktools/dk3types.h18
-rw-r--r--support/dktools/dk3uc2l.c296
-rw-r--r--support/dktools/dk3uc2l.ctr123
-rw-r--r--support/dktools/dk3uc2l.h45
-rw-r--r--support/dktools/dk3ufi.c97
-rw-r--r--support/dktools/dk3ufi.ctr7
-rw-r--r--support/dktools/dk3ufi.h36
-rw-r--r--support/dktools/dk3unused.h116
-rw-r--r--support/dktools/dk3use.ctr46
-rw-r--r--support/dktools/dk3use.h60
-rw-r--r--support/dktools/dk3usewx.c4
-rw-r--r--support/dktools/dk3wreg.c60
-rw-r--r--support/dktools/dk3wreg.ctr10
-rw-r--r--support/dktools/dk3wreg.h36
-rw-r--r--support/dktools/dk3wxcs.h19
-rw-r--r--support/dktools/dk3wxs.cpp118
-rw-r--r--support/dktools/dk3wxs.cpt58
-rw-r--r--support/dktools/dk3wxs.h48
-rw-r--r--support/dktools/dk3xsp.c536
-rw-r--r--support/dktools/dk3xsp.ctr207
-rw-r--r--support/dktools/dk3xsp.h61
-rw-r--r--support/dktools/dk4.dox65
-rw-r--r--support/dktools/dk4.h17
-rw-r--r--support/dktools/dk4a85d.c90
-rw-r--r--support/dktools/dk4a85d.ctr50
-rw-r--r--support/dktools/dk4a85d.h56
-rw-r--r--support/dktools/dk4a85e.c116
-rw-r--r--support/dktools/dk4a85e.ctr55
-rw-r--r--support/dktools/dk4a85e.h61
-rw-r--r--support/dktools/dk4ahd.c62
-rw-r--r--support/dktools/dk4ahd.ctr42
-rw-r--r--support/dktools/dk4ahd.h54
-rw-r--r--support/dktools/dk4align.h114
-rw-r--r--support/dktools/dk4ansi.c121
-rw-r--r--support/dktools/dk4ansi.ctr97
-rw-r--r--support/dktools/dk4ansi.h48
-rw-r--r--support/dktools/dk4aopt.h27
-rw-r--r--support/dktools/dk4aopt01.c45
-rw-r--r--support/dktools/dk4aopt01.ctr11
-rw-r--r--support/dktools/dk4aopt02.c46
-rw-r--r--support/dktools/dk4aopt02.ctr12
-rw-r--r--support/dktools/dk4aopt03.c47
-rw-r--r--support/dktools/dk4aopt03.ctr13
-rw-r--r--support/dktools/dk4aopt04.c70
-rw-r--r--support/dktools/dk4aopt04.ctr14
-rw-r--r--support/dktools/dk4aopt05.c46
-rw-r--r--support/dktools/dk4aopt05.ctr12
-rw-r--r--support/dktools/dk4aopt06.c47
-rw-r--r--support/dktools/dk4aopt06.ctr13
-rw-r--r--support/dktools/dk4aopt07.c46
-rw-r--r--support/dktools/dk4aopt07.ctr12
-rw-r--r--support/dktools/dk4aopt08.c47
-rw-r--r--support/dktools/dk4aopt08.ctr13
-rw-r--r--support/dktools/dk4aopt09.c46
-rw-r--r--support/dktools/dk4aopt09.ctr12
-rw-r--r--support/dktools/dk4aopt10.c47
-rw-r--r--support/dktools/dk4aopt10.ctr13
-rw-r--r--support/dktools/dk4aopt11.c46
-rw-r--r--support/dktools/dk4aopt11.ctr12
-rw-r--r--support/dktools/dk4aopt12.c47
-rw-r--r--support/dktools/dk4aopt12.ctr13
-rw-r--r--support/dktools/dk4aopt13.c46
-rw-r--r--support/dktools/dk4aopt13.ctr12
-rw-r--r--support/dktools/dk4aopt14.c47
-rw-r--r--support/dktools/dk4aopt14.ctr13
-rw-r--r--support/dktools/dk4aopt15.c51
-rw-r--r--support/dktools/dk4aopt15.ctr11
-rw-r--r--support/dktools/dk4aopt16.c52
-rw-r--r--support/dktools/dk4aopt16.ctr12
-rw-r--r--support/dktools/dk4app.h202
-rw-r--r--support/dktools/dk4app/de/dk4base.str2
-rw-r--r--support/dktools/dk4app/de/dk4bif.str42
-rw-r--r--support/dktools/dk4app/de/dk4colpal.str70
-rw-r--r--support/dktools/dk4app/de/dk4dbia.str (renamed from support/dktools/dktools/de/dk4dbia.str)2
-rw-r--r--support/dktools/dk4app/de/dk4debug.str2
-rw-r--r--support/dktools/dk4app/de/dk4gra.str215
-rw-r--r--support/dktools/dk4app/de/dk4sock.str2
-rw-r--r--support/dktools/dk4app/de/dk4uc2l.str (renamed from support/dktools/dktools/de/dk4uc2l.str)20
-rw-r--r--support/dktools/dk4app/de/dk4wxbase.str18
-rw-r--r--support/dktools/dk4appargs.c52
-rw-r--r--support/dktools/dk4appargs.ctr18
-rw-r--r--support/dktools/dk4appdeldir.c57
-rw-r--r--support/dktools/dk4appdeldir.ctr11
-rw-r--r--support/dktools/dk4appdelfile.c45
-rw-r--r--support/dktools/dk4appdelfile.ctr11
-rw-r--r--support/dktools/dk4appdeltree.c150
-rw-r--r--support/dktools/dk4appdeltree.ctr12
-rw-r--r--support/dktools/dk4appenc.c76
-rw-r--r--support/dktools/dk4appenc.ctr42
-rw-r--r--support/dktools/dk4appfne.c52
-rw-r--r--support/dktools/dk4appfne.ctr18
-rw-r--r--support/dktools/dk4appfs01.c56
-rw-r--r--support/dktools/dk4appfs01.ctr22
-rw-r--r--support/dktools/dk4appfs02.c74
-rw-r--r--support/dktools/dk4appfs02.ctr22
-rw-r--r--support/dktools/dk4appfs03.c72
-rw-r--r--support/dktools/dk4appfs03.ctr20
-rw-r--r--support/dktools/dk4appfs04.c49
-rw-r--r--support/dktools/dk4appfs04.ctr15
-rw-r--r--support/dktools/dk4apphlv.c71
-rw-r--r--support/dktools/dk4apphlv.ctr35
-rw-r--r--support/dktools/dk4appi.c4
-rw-r--r--support/dktools/dk4applog.c226
-rw-r--r--support/dktools/dk4applog.ctr90
-rw-r--r--support/dktools/dk4appmkdh.c55
-rw-r--r--support/dktools/dk4appmkdh.ctr27
-rw-r--r--support/dktools/dk4appmkdh.h52
-rw-r--r--support/dktools/dk4appop.c513
-rw-r--r--support/dktools/dk4appop.ctr91
-rw-r--r--support/dktools/dk4appstt.c89
-rw-r--r--support/dktools/dk4appstt.ctr15
-rw-r--r--support/dktools/dk4apref.c140
-rw-r--r--support/dktools/dk4apref.ctr76
-rw-r--r--support/dktools/dk4aprgs.c124
-rw-r--r--support/dktools/dk4aprgs.ctr56
-rw-r--r--support/dktools/dk4bb.c879
-rw-r--r--support/dktools/dk4bb.ctr971
-rw-r--r--support/dktools/dk4bb.h252
-rw-r--r--support/dktools/dk4bb32.c190
-rw-r--r--support/dktools/dk4bb32.ctr317
-rw-r--r--support/dktools/dk4bb32.h157
-rw-r--r--support/dktools/dk4bf.c63
-rw-r--r--support/dktools/dk4bf.ctr39
-rw-r--r--support/dktools/dk4bf.h50
-rw-r--r--support/dktools/dk4bif.c1315
-rw-r--r--support/dktools/dk4bif.ctr1488
-rw-r--r--support/dktools/dk4bif.h384
-rw-r--r--support/dktools/dk4bifa.c514
-rw-r--r--support/dktools/dk4bifa.ctr567
-rw-r--r--support/dktools/dk4bifa.h97
-rw-r--r--support/dktools/dk4bifap.c493
-rw-r--r--support/dktools/dk4bifap.ctr561
-rw-r--r--support/dktools/dk4bifap.h143
-rw-r--r--support/dktools/dk4bifj.c540
-rw-r--r--support/dktools/dk4bifj.ctr432
-rw-r--r--support/dktools/dk4bifn.c2169
-rw-r--r--support/dktools/dk4bifn.ctr1902
-rw-r--r--support/dktools/dk4bifp.c631
-rw-r--r--support/dktools/dk4bifp.ctr578
-rw-r--r--support/dktools/dk4bifpb.c166
-rw-r--r--support/dktools/dk4bifpb.ctr149
-rw-r--r--support/dktools/dk4bift.c371
-rw-r--r--support/dktools/dk4bift.ctr300
-rw-r--r--support/dktools/dk4bifto.c321
-rw-r--r--support/dktools/dk4bifto.ctr280
-rw-r--r--support/dktools/dk4bifty.h147
-rw-r--r--support/dktools/dk4binenc.c58
-rw-r--r--support/dktools/dk4binenc.ctr33
-rw-r--r--support/dktools/dk4binenc.h51
-rw-r--r--support/dktools/dk4bitsh.c94
-rw-r--r--support/dktools/dk4bitsh.ctr55
-rw-r--r--support/dktools/dk4bitsh.h53
-rw-r--r--support/dktools/dk4bm.c451
-rw-r--r--support/dktools/dk4bm.ctr570
-rw-r--r--support/dktools/dk4bm.h213
-rw-r--r--support/dktools/dk4bml.c540
-rw-r--r--support/dktools/dk4bml.ctr585
-rw-r--r--support/dktools/dk4bml.h129
-rw-r--r--support/dktools/dk4bom.c77
-rw-r--r--support/dktools/dk4bom.ctr65
-rw-r--r--support/dktools/dk4bom.h62
-rw-r--r--support/dktools/dk4c32.c69
-rw-r--r--support/dktools/dk4c32.ctr45
-rw-r--r--support/dktools/dk4c32.h48
-rw-r--r--support/dktools/dk4c8dbl.c105
-rw-r--r--support/dktools/dk4c8dbl.ctr95
-rw-r--r--support/dktools/dk4c8dbl.h92
-rw-r--r--support/dktools/dk4chdir8.c134
-rw-r--r--support/dktools/dk4chdir8.ctr164
-rw-r--r--support/dktools/dk4chdir8.h73
-rw-r--r--support/dktools/dk4chdird.c52
-rw-r--r--support/dktools/dk4chdird.ctr96
-rw-r--r--support/dktools/dk4chdird.h74
-rw-r--r--support/dktools/dk4chdirw.c125
-rw-r--r--support/dktools/dk4chdirw.ctr157
-rw-r--r--support/dktools/dk4chdirw.h76
-rw-r--r--support/dktools/dk4conf.cross224
-rw-r--r--support/dktools/dk4conf.h120
-rw-r--r--support/dktools/dk4conf.h.end4
-rw-r--r--support/dktools/dk4conf.h.large9
-rw-r--r--support/dktools/dk4conf.h.start25
-rw-r--r--support/dktools/dk4config.c2540
-rw-r--r--support/dktools/dk4config.cpp236
-rw-r--r--support/dktools/dk4const.h9
-rw-r--r--support/dktools/dk4cp850.c133
-rw-r--r--support/dktools/dk4cp850.ctr183
-rw-r--r--support/dktools/dk4cp850.h79
-rw-r--r--support/dktools/dk4cs.c2386
-rw-r--r--support/dktools/dk4cs.ctr2460
-rw-r--r--support/dktools/dk4cs.h713
-rw-r--r--support/dktools/dk4ctime.c58
-rw-r--r--support/dktools/dk4ctime.ctr38
-rw-r--r--support/dktools/dk4ctime.h52
-rw-r--r--support/dktools/dk4dbi.c392
-rw-r--r--support/dktools/dk4dbi.ctr168
-rw-r--r--support/dktools/dk4dbi.h56
-rw-r--r--support/dktools/dk4dbia.c61
-rw-r--r--support/dktools/dk4dbia.ctr44
-rw-r--r--support/dktools/dk4dbia.h63
-rw-r--r--support/dktools/dk4dbit.c40
-rw-r--r--support/dktools/dk4dbit.ctr28
-rw-r--r--support/dktools/dk4dbit.h62
-rw-r--r--support/dktools/dk4dbit8.c101
-rw-r--r--support/dktools/dk4dbit8.ctr23
-rw-r--r--support/dktools/dk4dbit8.h50
-rw-r--r--support/dktools/dk4dbitw.c40
-rw-r--r--support/dktools/dk4dbitw.ctr16
-rw-r--r--support/dktools/dk4dbitw.h50
-rw-r--r--support/dktools/dk4dblc8.c39
-rw-r--r--support/dktools/dk4dblc8.ctr15
-rw-r--r--support/dktools/dk4dblc8.h48
-rw-r--r--support/dktools/dk4dbldk.c39
-rw-r--r--support/dktools/dk4dbldk.ctr15
-rw-r--r--support/dktools/dk4dbldk.h48
-rw-r--r--support/dktools/dk4dblwc.c38
-rw-r--r--support/dktools/dk4dblwc.ctr14
-rw-r--r--support/dktools/dk4dblwc.h48
-rw-r--r--support/dktools/dk4dec.h5
-rw-r--r--support/dktools/dk4deldir.c49
-rw-r--r--support/dktools/dk4deldir.ctr25
-rw-r--r--support/dktools/dk4deldir.h48
-rw-r--r--support/dktools/dk4deldir08.c57
-rw-r--r--support/dktools/dk4deldir08.ctr23
-rw-r--r--support/dktools/dk4deldir08.h48
-rw-r--r--support/dktools/dk4deldirwc.c47
-rw-r--r--support/dktools/dk4deldirwc.ctr23
-rw-r--r--support/dktools/dk4deldirwc.h48
-rw-r--r--support/dktools/dk4delfile.c48
-rw-r--r--support/dktools/dk4delfile.ctr24
-rw-r--r--support/dktools/dk4delfile.h48
-rw-r--r--support/dktools/dk4delfile08.c48
-rw-r--r--support/dktools/dk4delfile08.ctr24
-rw-r--r--support/dktools/dk4delfile08.h48
-rw-r--r--support/dktools/dk4delfilewc.c48
-rw-r--r--support/dktools/dk4delfilewc.ctr24
-rw-r--r--support/dktools/dk4delfilewc.h48
-rw-r--r--support/dktools/dk4dir.c127
-rw-r--r--support/dktools/dk4dir.ctr164
-rw-r--r--support/dktools/dk4dir.h109
-rw-r--r--support/dktools/dk4dir08.c201
-rw-r--r--support/dktools/dk4dir08.ctr172
-rw-r--r--support/dktools/dk4dir08.h105
-rw-r--r--support/dktools/dk4dira.c50
-rw-r--r--support/dktools/dk4dira.ctr34
-rw-r--r--support/dktools/dk4dira.h58
-rw-r--r--support/dktools/dk4dirwc.c163
-rw-r--r--support/dktools/dk4dirwc.ctr188
-rw-r--r--support/dktools/dk4dirwc.h105
-rw-r--r--support/dktools/dk4dmt.c1212
-rw-r--r--support/dktools/dk4dmt.ctr1623
-rw-r--r--support/dktools/dk4dmt.h450
-rw-r--r--support/dktools/dk4edstm.h5
-rw-r--r--support/dktools/dk4enc.c66
-rw-r--r--support/dktools/dk4enc.ctr65
-rw-r--r--support/dktools/dk4enc.h73
-rw-r--r--support/dktools/dk4error.c52
-rw-r--r--support/dktools/dk4error.ctr29
-rw-r--r--support/dktools/dk4error.h63
-rw-r--r--support/dktools/dk4exep.c7
-rw-r--r--support/dktools/dk4exep8.c127
-rw-r--r--support/dktools/dk4exep8.ctr67
-rw-r--r--support/dktools/dk4exep8.h48
-rw-r--r--support/dktools/dk4exepd.c53
-rw-r--r--support/dktools/dk4exepd.ctr29
-rw-r--r--support/dktools/dk4exepd.h48
-rw-r--r--support/dktools/dk4exepw.c101
-rw-r--r--support/dktools/dk4exepw.ctr61
-rw-r--r--support/dktools/dk4exepw.h48
-rw-r--r--support/dktools/dk4fd.c93
-rw-r--r--support/dktools/dk4fd.ctr67
-rw-r--r--support/dktools/dk4fd.h48
-rw-r--r--support/dktools/dk4fdrda.c55
-rw-r--r--support/dktools/dk4fdrda.ctr18
-rw-r--r--support/dktools/dk4fdrda.h51
-rw-r--r--support/dktools/dk4fdrde.c41
-rw-r--r--support/dktools/dk4fdrde.ctr19
-rw-r--r--support/dktools/dk4fdrde.h50
-rw-r--r--support/dktools/dk4fdwre.c43
-rw-r--r--support/dktools/dk4fdwre.ctr19
-rw-r--r--support/dktools/dk4fdwre.h50
-rw-r--r--support/dktools/dk4file8.c100
-rw-r--r--support/dktools/dk4file8.ctr52
-rw-r--r--support/dktools/dk4file8.h48
-rw-r--r--support/dktools/dk4filed.c60
-rw-r--r--support/dktools/dk4filed.ctr34
-rw-r--r--support/dktools/dk4filed.h48
-rw-r--r--support/dktools/dk4filei.c109
-rw-r--r--support/dktools/dk4filei.ctr67
-rw-r--r--support/dktools/dk4filei.h62
-rw-r--r--support/dktools/dk4filei8.c51
-rw-r--r--support/dktools/dk4filei8.ctr59
-rw-r--r--support/dktools/dk4filei8.h47
-rw-r--r--support/dktools/dk4fileia.c54
-rw-r--r--support/dktools/dk4fileia.ctr34
-rw-r--r--support/dktools/dk4fileia.h58
-rw-r--r--support/dktools/dk4fileid.c52
-rw-r--r--support/dktools/dk4fileid.ctr62
-rw-r--r--support/dktools/dk4fileid.h55
-rw-r--r--support/dktools/dk4fileig8.c82
-rw-r--r--support/dktools/dk4fileig8.ctr95
-rw-r--r--support/dktools/dk4fileig8.h47
-rw-r--r--support/dktools/dk4fileigd.c58
-rw-r--r--support/dktools/dk4fileigd.ctr24
-rw-r--r--support/dktools/dk4fileigw.c57
-rw-r--r--support/dktools/dk4fileigw.ctr23
-rw-r--r--support/dktools/dk4fileit.h19
-rw-r--r--support/dktools/dk4fileiu.c52
-rw-r--r--support/dktools/dk4fileiu.ctr68
-rw-r--r--support/dktools/dk4fileiu.h52
-rw-r--r--support/dktools/dk4fileiw.c94
-rw-r--r--support/dktools/dk4fileiw.ctr50
-rw-r--r--support/dktools/dk4fileiw.h46
-rw-r--r--support/dktools/dk4filew.c92
-rw-r--r--support/dktools/dk4filew.ctr66
-rw-r--r--support/dktools/dk4filew.h48
-rw-r--r--support/dktools/dk4fne.c48
-rw-r--r--support/dktools/dk4fne.ctr20
-rw-r--r--support/dktools/dk4fne.h44
-rw-r--r--support/dktools/dk4fne08.c73
-rw-r--r--support/dktools/dk4fne08.ctr45
-rw-r--r--support/dktools/dk4fne08.h48
-rw-r--r--support/dktools/dk4fnewc.c107
-rw-r--r--support/dktools/dk4fnewc.ctr51
-rw-r--r--support/dktools/dk4fnewc.h48
-rw-r--r--support/dktools/dk4font.c68
-rw-r--r--support/dktools/dk4font.ctr72
-rw-r--r--support/dktools/dk4font.h84
-rw-r--r--support/dktools/dk4fontc.c440
-rw-r--r--support/dktools/dk4fontc.ctr562
-rw-r--r--support/dktools/dk4fontc.h181
-rw-r--r--support/dktools/dk4fopc8.c107
-rw-r--r--support/dktools/dk4fopc8.ctr59
-rw-r--r--support/dktools/dk4fopc8.h56
-rw-r--r--support/dktools/dk4fopd.c54
-rw-r--r--support/dktools/dk4fopd.ctr37
-rw-r--r--support/dktools/dk4fopd.h55
-rw-r--r--support/dktools/dk4fopda.c49
-rw-r--r--support/dktools/dk4fopda.ctr38
-rw-r--r--support/dktools/dk4fopda.h61
-rw-r--r--support/dktools/dk4fopt.h16
-rw-r--r--support/dktools/dk4fopwc.c100
-rw-r--r--support/dktools/dk4fopwc.ctr56
-rw-r--r--support/dktools/dk4fopwc.h56
-rw-r--r--support/dktools/dk4fpe.c102
-rw-r--r--support/dktools/dk4fpe.ctr160
-rw-r--r--support/dktools/dk4fpe.h130
-rw-r--r--support/dktools/dk4fput.c115
-rw-r--r--support/dktools/dk4fput.ctr87
-rw-r--r--support/dktools/dk4fput.h48
-rw-r--r--support/dktools/dk4fs.c524
-rw-r--r--support/dktools/dk4fs.ctr593
-rw-r--r--support/dktools/dk4fs.h230
-rw-r--r--support/dktools/dk4ft.h4
-rw-r--r--support/dktools/dk4ftime.c39
-rw-r--r--support/dktools/dk4ftime.ctr23
-rw-r--r--support/dktools/dk4ftime.h56
-rw-r--r--support/dktools/dk4ftime08.c55
-rw-r--r--support/dktools/dk4ftime08.ctr21
-rw-r--r--support/dktools/dk4ftimedk.c50
-rw-r--r--support/dktools/dk4ftimedk.ctr16
-rw-r--r--support/dktools/dk4ftimewc.c55
-rw-r--r--support/dktools/dk4ftimewc.ctr21
-rw-r--r--support/dktools/dk4fwra.c41
-rw-r--r--support/dktools/dk4fwra.ctr16
-rw-r--r--support/dktools/dk4fwra.h49
-rw-r--r--support/dktools/dk4getcwd8.c93
-rw-r--r--support/dktools/dk4getcwd8.ctr96
-rw-r--r--support/dktools/dk4getcwd8.h77
-rw-r--r--support/dktools/dk4getcwdd.c67
-rw-r--r--support/dktools/dk4getcwdd.ctr63
-rw-r--r--support/dktools/dk4getcwdd.h70
-rw-r--r--support/dktools/dk4getcwdw.c85
-rw-r--r--support/dktools/dk4getcwdw.ctr94
-rw-r--r--support/dktools/dk4getcwdw.h83
-rw-r--r--support/dktools/dk4getpid.c40
-rw-r--r--support/dktools/dk4getpid.ctr16
-rw-r--r--support/dktools/dk4getpid.h48
-rw-r--r--support/dktools/dk4gra.c3793
-rw-r--r--support/dktools/dk4gra.ctr5529
-rw-r--r--support/dktools/dk4gra.h2190
-rw-r--r--support/dktools/dk4graa.c2229
-rw-r--r--support/dktools/dk4graa.ctr2866
-rw-r--r--support/dktools/dk4graa.h1063
-rw-r--r--support/dktools/dk4gralo.c359
-rw-r--r--support/dktools/dk4gralo.ctr437
-rw-r--r--support/dktools/dk4gralo.h119
-rw-r--r--support/dktools/dk4grat.c1891
-rw-r--r--support/dktools/dk4grat.ctr1866
-rw-r--r--support/dktools/dk4grat.h179
-rw-r--r--support/dktools/dk4grco.c180
-rw-r--r--support/dktools/dk4grco.ctr323
-rw-r--r--support/dktools/dk4grco.h174
-rw-r--r--support/dktools/dk4grcoa.c2504
-rw-r--r--support/dktools/dk4grcoa.ctr2364
-rw-r--r--support/dktools/dk4grcoa.h80
-rw-r--r--support/dktools/dk4grepi.c1273
-rw-r--r--support/dktools/dk4grepi.ctr1124
-rw-r--r--support/dktools/dk4grepp.c2168
-rw-r--r--support/dktools/dk4grepp.ctr888
-rw-r--r--support/dktools/dk4greps.c2656
-rw-r--r--support/dktools/dk4greps.ctr2507
-rw-r--r--support/dktools/dk4grpat.c530
-rw-r--r--support/dktools/dk4grpat.ctr519
-rw-r--r--support/dktools/dk4grpdf.c3040
-rw-r--r--support/dktools/dk4grpdf.ctr2840
-rw-r--r--support/dktools/dk4grpdi.c1309
-rw-r--r--support/dktools/dk4grpdi.ctr1072
-rw-r--r--support/dktools/dk4grpdt.c184
-rw-r--r--support/dktools/dk4grpdt.ctr174
-rw-r--r--support/dktools/dk4grpgf.c3205
-rw-r--r--support/dktools/dk4grpgf.ctr2942
-rw-r--r--support/dktools/dk4grpgi.c239
-rw-r--r--support/dktools/dk4grpgi.ctr223
-rw-r--r--support/dktools/dk4hname8.c50
-rw-r--r--support/dktools/dk4hname8.ctr26
-rw-r--r--support/dktools/dk4hname8.h48
-rw-r--r--support/dktools/dk4hnamed.c51
-rw-r--r--support/dktools/dk4hnamed.ctr35
-rw-r--r--support/dktools/dk4hnamed.h56
-rw-r--r--support/dktools/dk4hnamew.c49
-rw-r--r--support/dktools/dk4hnamew.ctr25
-rw-r--r--support/dktools/dk4hnamew.h48
-rw-r--r--support/dktools/dk4info.c109
-rw-r--r--support/dktools/dk4info.ctr51
-rw-r--r--support/dktools/dk4info.rc8
-rw-r--r--support/dktools/dk4info1.c132
-rw-r--r--support/dktools/dk4inst.c23
-rw-r--r--support/dktools/dk4inst.h24
-rw-r--r--support/dktools/dk4isadm.c47
-rw-r--r--support/dktools/dk4isadm.ctr11
-rw-r--r--support/dktools/dk4isadm.h36
-rw-r--r--support/dktools/dk4istty.c69
-rw-r--r--support/dktools/dk4istty.ctr43
-rw-r--r--support/dktools/dk4istty.h48
-rw-r--r--support/dktools/dk4iter.c1226
-rw-r--r--support/dktools/dk4iter.ctr1456
-rw-r--r--support/dktools/dk4iter.h413
-rw-r--r--support/dktools/dk4itmin.c434
-rw-r--r--support/dktools/dk4itmin.ctr399
-rw-r--r--support/dktools/dk4itmin.h78
-rw-r--r--support/dktools/dk4loc.c108
-rw-r--r--support/dktools/dk4loc.ctr40
-rw-r--r--support/dktools/dk4loc.h48
-rw-r--r--support/dktools/dk4lprng.h5
-rw-r--r--support/dktools/dk4lzwe.c173
-rw-r--r--support/dktools/dk4lzwe.ctr54
-rw-r--r--support/dktools/dk4lzwe.h57
-rw-r--r--support/dktools/dk4ma.h503
-rw-r--r--support/dktools/dk4maac.c77
-rw-r--r--support/dktools/dk4maac.ctr67
-rw-r--r--support/dktools/dk4maac.h68
-rw-r--r--support/dktools/dk4maadi.c76
-rw-r--r--support/dktools/dk4maadi.ctr74
-rw-r--r--support/dktools/dk4maadi.h70
-rw-r--r--support/dktools/dk4maadu.c97
-rw-r--r--support/dktools/dk4maadu.ctr102
-rw-r--r--support/dktools/dk4maadu.h83
-rw-r--r--support/dktools/dk4maai.c71
-rw-r--r--support/dktools/dk4maai.ctr67
-rw-r--r--support/dktools/dk4maai.h68
-rw-r--r--support/dktools/dk4maai16.c117
-rw-r--r--support/dktools/dk4maai16.ctr119
-rw-r--r--support/dktools/dk4maai16.h76
-rw-r--r--support/dktools/dk4maai32.c146
-rw-r--r--support/dktools/dk4maai32.ctr165
-rw-r--r--support/dktools/dk4maai32.h97
-rw-r--r--support/dktools/dk4maal.c69
-rw-r--r--support/dktools/dk4maal.ctr65
-rw-r--r--support/dktools/dk4maal.h68
-rw-r--r--support/dktools/dk4maall.c72
-rw-r--r--support/dktools/dk4maall.ctr68
-rw-r--r--support/dktools/dk4maall.h68
-rw-r--r--support/dktools/dk4maalu.c80
-rw-r--r--support/dktools/dk4maalu.ctr68
-rw-r--r--support/dktools/dk4maalu.h68
-rw-r--r--support/dktools/dk4maami.c38
-rw-r--r--support/dktools/dk4maami.ctr14
-rw-r--r--support/dktools/dk4maami.h48
-rw-r--r--support/dktools/dk4maamu.c38
-rw-r--r--support/dktools/dk4maamu.ctr14
-rw-r--r--support/dktools/dk4maamu.h48
-rw-r--r--support/dktools/dk4maas.c77
-rw-r--r--support/dktools/dk4maas.ctr73
-rw-r--r--support/dktools/dk4maas.h68
-rw-r--r--support/dktools/dk4maasz.c72
-rw-r--r--support/dktools/dk4maasz.ctr68
-rw-r--r--support/dktools/dk4maasz.h68
-rw-r--r--support/dktools/dk4maau16.c108
-rw-r--r--support/dktools/dk4maau16.ctr108
-rw-r--r--support/dktools/dk4maau16.h74
-rw-r--r--support/dktools/dk4maau32.c72
-rw-r--r--support/dktools/dk4maau32.ctr72
-rw-r--r--support/dktools/dk4maau32.h74
-rw-r--r--support/dktools/dk4maauc.c71
-rw-r--r--support/dktools/dk4maauc.ctr69
-rw-r--r--support/dktools/dk4maauc.h70
-rw-r--r--support/dktools/dk4maaui.c71
-rw-r--r--support/dktools/dk4maaui.ctr70
-rw-r--r--support/dktools/dk4maaui.h71
-rw-r--r--support/dktools/dk4maaul.c93
-rw-r--r--support/dktools/dk4maaul.ctr77
-rw-r--r--support/dktools/dk4maaul.h70
-rw-r--r--support/dktools/dk4maaus.c70
-rw-r--r--support/dktools/dk4maaus.ctr68
-rw-r--r--support/dktools/dk4maaus.h70
-rw-r--r--support/dktools/dk4macc.c37
-rw-r--r--support/dktools/dk4macc.ctr3
-rw-r--r--support/dktools/dk4macc.h36
-rw-r--r--support/dktools/dk4macd.c38
-rw-r--r--support/dktools/dk4macd.ctr10
-rw-r--r--support/dktools/dk4macd.h44
-rw-r--r--support/dktools/dk4maci.c37
-rw-r--r--support/dktools/dk4maci.ctr3
-rw-r--r--support/dktools/dk4maci.h36
-rw-r--r--support/dktools/dk4maci16.c39
-rw-r--r--support/dktools/dk4maci16.ctr15
-rw-r--r--support/dktools/dk4maci16.h48
-rw-r--r--support/dktools/dk4maci32.c39
-rw-r--r--support/dktools/dk4maci32.ctr15
-rw-r--r--support/dktools/dk4maci32.h48
-rw-r--r--support/dktools/dk4macl.c37
-rw-r--r--support/dktools/dk4macl.ctr3
-rw-r--r--support/dktools/dk4macl.h36
-rw-r--r--support/dktools/dk4macll.c39
-rw-r--r--support/dktools/dk4macll.ctr11
-rw-r--r--support/dktools/dk4macll.h44
-rw-r--r--support/dktools/dk4macm.c39
-rw-r--r--support/dktools/dk4macm.ctr11
-rw-r--r--support/dktools/dk4macm.h44
-rw-r--r--support/dktools/dk4macs.c37
-rw-r--r--support/dktools/dk4macs.ctr3
-rw-r--r--support/dktools/dk4macs.h36
-rw-r--r--support/dktools/dk4mai8dbl.c67
-rw-r--r--support/dktools/dk4mai8dbl.ctr45
-rw-r--r--support/dktools/dk4mai8dbl.h50
-rw-r--r--support/dktools/dk4mai8ddi.c75
-rw-r--r--support/dktools/dk4mai8ddi.ctr27
-rw-r--r--support/dktools/dk4mai8ddi.h48
-rw-r--r--support/dktools/dk4mai8ddu.c81
-rw-r--r--support/dktools/dk4mai8ddu.ctr27
-rw-r--r--support/dktools/dk4mai8ddu.h48
-rw-r--r--support/dktools/dk4mai8di16.c60
-rw-r--r--support/dktools/dk4mai8di16.ctr123
-rw-r--r--support/dktools/dk4mai8di16.h92
-rw-r--r--support/dktools/dk4mai8di32.c69
-rw-r--r--support/dktools/dk4mai8di32.ctr132
-rw-r--r--support/dktools/dk4mai8di32.h92
-rw-r--r--support/dktools/dk4mai8di8.c61
-rw-r--r--support/dktools/dk4mai8di8.ctr124
-rw-r--r--support/dktools/dk4mai8di8.h93
-rw-r--r--support/dktools/dk4mai8dic.c51
-rw-r--r--support/dktools/dk4mai8dic.ctr27
-rw-r--r--support/dktools/dk4mai8dic.h48
-rw-r--r--support/dktools/dk4mai8dii.c50
-rw-r--r--support/dktools/dk4mai8dii.ctr28
-rw-r--r--support/dktools/dk4mai8dii.h48
-rw-r--r--support/dktools/dk4mai8dil.c51
-rw-r--r--support/dktools/dk4mai8dil.ctr27
-rw-r--r--support/dktools/dk4mai8dil.h48
-rw-r--r--support/dktools/dk4mai8dis.c51
-rw-r--r--support/dktools/dk4mai8dis.ctr27
-rw-r--r--support/dktools/dk4mai8dis.h48
-rw-r--r--support/dktools/dk4mai8dli.c50
-rw-r--r--support/dktools/dk4mai8dli.ctr26
-rw-r--r--support/dktools/dk4mai8dli.h48
-rw-r--r--support/dktools/dk4mai8dlu.c49
-rw-r--r--support/dktools/dk4mai8dlu.ctr25
-rw-r--r--support/dktools/dk4mai8dlu.h48
-rw-r--r--support/dktools/dk4mai8dmi.c56
-rw-r--r--support/dktools/dk4mai8dmi.ctr32
-rw-r--r--support/dktools/dk4mai8dmi.h48
-rw-r--r--support/dktools/dk4mai8dmu.c55
-rw-r--r--support/dktools/dk4mai8dmu.ctr31
-rw-r--r--support/dktools/dk4mai8dmu.h48
-rw-r--r--support/dktools/dk4mai8dsz.c229
-rw-r--r--support/dktools/dk4mai8dsz.ctr242
-rw-r--r--support/dktools/dk4mai8dsz.h91
-rw-r--r--support/dktools/dk4mai8du16.c60
-rw-r--r--support/dktools/dk4mai8du16.ctr123
-rw-r--r--support/dktools/dk4mai8du16.h92
-rw-r--r--support/dktools/dk4mai8du32.c65
-rw-r--r--support/dktools/dk4mai8du32.ctr128
-rw-r--r--support/dktools/dk4mai8du32.h92
-rw-r--r--support/dktools/dk4mai8du8.c60
-rw-r--r--support/dktools/dk4mai8du8.ctr123
-rw-r--r--support/dktools/dk4mai8du8.h92
-rw-r--r--support/dktools/dk4mai8duc.c51
-rw-r--r--support/dktools/dk4mai8duc.ctr27
-rw-r--r--support/dktools/dk4mai8duc.h48
-rw-r--r--support/dktools/dk4mai8dui.c51
-rw-r--r--support/dktools/dk4mai8dui.ctr27
-rw-r--r--support/dktools/dk4mai8dui.h48
-rw-r--r--support/dktools/dk4mai8dul.c51
-rw-r--r--support/dktools/dk4mai8dul.ctr27
-rw-r--r--support/dktools/dk4mai8dul.h48
-rw-r--r--support/dktools/dk4mai8dus.c51
-rw-r--r--support/dktools/dk4mai8dus.ctr27
-rw-r--r--support/dktools/dk4mai8dus.h48
-rw-r--r--support/dktools/dk4mai8hdi.c71
-rw-r--r--support/dktools/dk4mai8hdi.ctr27
-rw-r--r--support/dktools/dk4mai8hdi.h48
-rw-r--r--support/dktools/dk4mai8hdu.c65
-rw-r--r--support/dktools/dk4mai8hdu.ctr27
-rw-r--r--support/dktools/dk4mai8hdu.h48
-rw-r--r--support/dktools/dk4mai8hic.c51
-rw-r--r--support/dktools/dk4mai8hic.ctr27
-rw-r--r--support/dktools/dk4mai8hic.h48
-rw-r--r--support/dktools/dk4mai8hii.c51
-rw-r--r--support/dktools/dk4mai8hii.ctr27
-rw-r--r--support/dktools/dk4mai8hii.h48
-rw-r--r--support/dktools/dk4mai8hil.c55
-rw-r--r--support/dktools/dk4mai8hil.ctr31
-rw-r--r--support/dktools/dk4mai8hil.h48
-rw-r--r--support/dktools/dk4mai8his.c51
-rw-r--r--support/dktools/dk4mai8his.ctr27
-rw-r--r--support/dktools/dk4mai8his.h48
-rw-r--r--support/dktools/dk4mai8hli.c53
-rw-r--r--support/dktools/dk4mai8hli.ctr29
-rw-r--r--support/dktools/dk4mai8hli.h48
-rw-r--r--support/dktools/dk4mai8hlu.c49
-rw-r--r--support/dktools/dk4mai8hlu.ctr25
-rw-r--r--support/dktools/dk4mai8hlu.h48
-rw-r--r--support/dktools/dk4mai8hmi.c55
-rw-r--r--support/dktools/dk4mai8hmi.ctr31
-rw-r--r--support/dktools/dk4mai8hmi.h48
-rw-r--r--support/dktools/dk4mai8hmu.c55
-rw-r--r--support/dktools/dk4mai8hmu.ctr31
-rw-r--r--support/dktools/dk4mai8hmu.h48
-rw-r--r--support/dktools/dk4mai8huc.c51
-rw-r--r--support/dktools/dk4mai8huc.ctr27
-rw-r--r--support/dktools/dk4mai8huc.h48
-rw-r--r--support/dktools/dk4mai8hui.c51
-rw-r--r--support/dktools/dk4mai8hui.ctr27
-rw-r--r--support/dktools/dk4mai8hui.h48
-rw-r--r--support/dktools/dk4mai8hul.c51
-rw-r--r--support/dktools/dk4mai8hul.ctr27
-rw-r--r--support/dktools/dk4mai8hul.h48
-rw-r--r--support/dktools/dk4mai8hus.c51
-rw-r--r--support/dktools/dk4mai8hus.ctr27
-rw-r--r--support/dktools/dk4mai8hus.h48
-rw-r--r--support/dktools/dk4maiddbl.c50
-rw-r--r--support/dktools/dk4maiddbl.ctr28
-rw-r--r--support/dktools/dk4maiddbl.h50
-rw-r--r--support/dktools/dk4maidddi.c49
-rw-r--r--support/dktools/dk4maidddi.ctr25
-rw-r--r--support/dktools/dk4maidddi.h48
-rw-r--r--support/dktools/dk4maidddu.c49
-rw-r--r--support/dktools/dk4maidddu.ctr25
-rw-r--r--support/dktools/dk4maidddu.h48
-rw-r--r--support/dktools/dk4maiddic.c49
-rw-r--r--support/dktools/dk4maiddic.ctr25
-rw-r--r--support/dktools/dk4maiddic.h48
-rw-r--r--support/dktools/dk4maiddii.c49
-rw-r--r--support/dktools/dk4maiddii.ctr25
-rw-r--r--support/dktools/dk4maiddii.h48
-rw-r--r--support/dktools/dk4maiddil.c49
-rw-r--r--support/dktools/dk4maiddil.ctr25
-rw-r--r--support/dktools/dk4maiddil.h48
-rw-r--r--support/dktools/dk4maiddis.c49
-rw-r--r--support/dktools/dk4maiddis.ctr25
-rw-r--r--support/dktools/dk4maiddis.h48
-rw-r--r--support/dktools/dk4maiddli.c49
-rw-r--r--support/dktools/dk4maiddli.ctr25
-rw-r--r--support/dktools/dk4maiddli.h48
-rw-r--r--support/dktools/dk4maiddlu.c49
-rw-r--r--support/dktools/dk4maiddlu.ctr25
-rw-r--r--support/dktools/dk4maiddlu.h48
-rw-r--r--support/dktools/dk4maiddmi.c58
-rw-r--r--support/dktools/dk4maiddmi.ctr34
-rw-r--r--support/dktools/dk4maiddmi.h48
-rw-r--r--support/dktools/dk4maiddmu.c58
-rw-r--r--support/dktools/dk4maiddmu.ctr34
-rw-r--r--support/dktools/dk4maiddmu.h48
-rw-r--r--support/dktools/dk4maiddsz.c70
-rw-r--r--support/dktools/dk4maiddsz.ctr83
-rw-r--r--support/dktools/dk4maiddsz.h85
-rw-r--r--support/dktools/dk4maidduc.c49
-rw-r--r--support/dktools/dk4maidduc.ctr25
-rw-r--r--support/dktools/dk4maidduc.h48
-rw-r--r--support/dktools/dk4maiddui.c49
-rw-r--r--support/dktools/dk4maiddui.ctr25
-rw-r--r--support/dktools/dk4maiddui.h48
-rw-r--r--support/dktools/dk4maiddul.c51
-rw-r--r--support/dktools/dk4maiddul.ctr27
-rw-r--r--support/dktools/dk4maiddul.h48
-rw-r--r--support/dktools/dk4maiddus.c49
-rw-r--r--support/dktools/dk4maiddus.ctr25
-rw-r--r--support/dktools/dk4maiddus.h48
-rw-r--r--support/dktools/dk4maidhdi.c49
-rw-r--r--support/dktools/dk4maidhdi.ctr25
-rw-r--r--support/dktools/dk4maidhdi.h48
-rw-r--r--support/dktools/dk4maidhdu.c49
-rw-r--r--support/dktools/dk4maidhdu.ctr25
-rw-r--r--support/dktools/dk4maidhdu.h48
-rw-r--r--support/dktools/dk4maidhic.c49
-rw-r--r--support/dktools/dk4maidhic.ctr25
-rw-r--r--support/dktools/dk4maidhic.h48
-rw-r--r--support/dktools/dk4maidhii.c49
-rw-r--r--support/dktools/dk4maidhii.ctr25
-rw-r--r--support/dktools/dk4maidhii.h48
-rw-r--r--support/dktools/dk4maidhil.c49
-rw-r--r--support/dktools/dk4maidhil.ctr25
-rw-r--r--support/dktools/dk4maidhil.h48
-rw-r--r--support/dktools/dk4maidhis.c49
-rw-r--r--support/dktools/dk4maidhis.ctr25
-rw-r--r--support/dktools/dk4maidhis.h48
-rw-r--r--support/dktools/dk4maidhli.c49
-rw-r--r--support/dktools/dk4maidhli.ctr25
-rw-r--r--support/dktools/dk4maidhli.h48
-rw-r--r--support/dktools/dk4maidhlu.c49
-rw-r--r--support/dktools/dk4maidhlu.ctr25
-rw-r--r--support/dktools/dk4maidhlu.h48
-rw-r--r--support/dktools/dk4maidhmi.c58
-rw-r--r--support/dktools/dk4maidhmi.ctr34
-rw-r--r--support/dktools/dk4maidhmi.h48
-rw-r--r--support/dktools/dk4maidhmu.c58
-rw-r--r--support/dktools/dk4maidhmu.ctr34
-rw-r--r--support/dktools/dk4maidhmu.h48
-rw-r--r--support/dktools/dk4maidhsz.c39
-rw-r--r--support/dktools/dk4maidhsz.ctr15
-rw-r--r--support/dktools/dk4maidhsz.h48
-rw-r--r--support/dktools/dk4maidhuc.c49
-rw-r--r--support/dktools/dk4maidhuc.ctr25
-rw-r--r--support/dktools/dk4maidhuc.h48
-rw-r--r--support/dktools/dk4maidhui.c49
-rw-r--r--support/dktools/dk4maidhui.ctr25
-rw-r--r--support/dktools/dk4maidhui.h48
-rw-r--r--support/dktools/dk4maidhul.c49
-rw-r--r--support/dktools/dk4maidhul.ctr25
-rw-r--r--support/dktools/dk4maidhul.h48
-rw-r--r--support/dktools/dk4maidhus.c49
-rw-r--r--support/dktools/dk4maidhus.ctr25
-rw-r--r--support/dktools/dk4maidhus.h48
-rw-r--r--support/dktools/dk4maiwdbl.c69
-rw-r--r--support/dktools/dk4maiwdbl.ctr49
-rw-r--r--support/dktools/dk4maiwdbl.h52
-rw-r--r--support/dktools/dk4maiwddi.c53
-rw-r--r--support/dktools/dk4maiwddi.ctr29
-rw-r--r--support/dktools/dk4maiwddi.h48
-rw-r--r--support/dktools/dk4maiwddu.c75
-rw-r--r--support/dktools/dk4maiwddu.ctr27
-rw-r--r--support/dktools/dk4maiwddu.h48
-rw-r--r--support/dktools/dk4maiwdic.c51
-rw-r--r--support/dktools/dk4maiwdic.ctr27
-rw-r--r--support/dktools/dk4maiwdic.h48
-rw-r--r--support/dktools/dk4maiwdii.c51
-rw-r--r--support/dktools/dk4maiwdii.ctr27
-rw-r--r--support/dktools/dk4maiwdii.h48
-rw-r--r--support/dktools/dk4maiwdil.c51
-rw-r--r--support/dktools/dk4maiwdil.ctr27
-rw-r--r--support/dktools/dk4maiwdil.h48
-rw-r--r--support/dktools/dk4maiwdis.c51
-rw-r--r--support/dktools/dk4maiwdis.ctr27
-rw-r--r--support/dktools/dk4maiwdis.h48
-rw-r--r--support/dktools/dk4maiwdli.c49
-rw-r--r--support/dktools/dk4maiwdli.ctr25
-rw-r--r--support/dktools/dk4maiwdli.h48
-rw-r--r--support/dktools/dk4maiwdlu.c49
-rw-r--r--support/dktools/dk4maiwdlu.ctr25
-rw-r--r--support/dktools/dk4maiwdlu.h48
-rw-r--r--support/dktools/dk4maiwdmi.c64
-rw-r--r--support/dktools/dk4maiwdmi.ctr40
-rw-r--r--support/dktools/dk4maiwdmi.h48
-rw-r--r--support/dktools/dk4maiwdmu.c62
-rw-r--r--support/dktools/dk4maiwdmu.ctr38
-rw-r--r--support/dktools/dk4maiwdmu.h48
-rw-r--r--support/dktools/dk4maiwdsz.c142
-rw-r--r--support/dktools/dk4maiwdsz.ctr160
-rw-r--r--support/dktools/dk4maiwdsz.h90
-rw-r--r--support/dktools/dk4maiwduc.c52
-rw-r--r--support/dktools/dk4maiwduc.ctr28
-rw-r--r--support/dktools/dk4maiwduc.h48
-rw-r--r--support/dktools/dk4maiwdui.c51
-rw-r--r--support/dktools/dk4maiwdui.ctr27
-rw-r--r--support/dktools/dk4maiwdui.h48
-rw-r--r--support/dktools/dk4maiwdul.c51
-rw-r--r--support/dktools/dk4maiwdul.ctr27
-rw-r--r--support/dktools/dk4maiwdul.h48
-rw-r--r--support/dktools/dk4maiwdus.c51
-rw-r--r--support/dktools/dk4maiwdus.ctr27
-rw-r--r--support/dktools/dk4maiwdus.h48
-rw-r--r--support/dktools/dk4maiwhdi.c71
-rw-r--r--support/dktools/dk4maiwhdi.ctr27
-rw-r--r--support/dktools/dk4maiwhdi.h48
-rw-r--r--support/dktools/dk4maiwhdu.c63
-rw-r--r--support/dktools/dk4maiwhdu.ctr28
-rw-r--r--support/dktools/dk4maiwhdu.h50
-rw-r--r--support/dktools/dk4maiwhic.c51
-rw-r--r--support/dktools/dk4maiwhic.ctr27
-rw-r--r--support/dktools/dk4maiwhic.h48
-rw-r--r--support/dktools/dk4maiwhii.c51
-rw-r--r--support/dktools/dk4maiwhii.ctr27
-rw-r--r--support/dktools/dk4maiwhii.h48
-rw-r--r--support/dktools/dk4maiwhil.c51
-rw-r--r--support/dktools/dk4maiwhil.ctr27
-rw-r--r--support/dktools/dk4maiwhil.h48
-rw-r--r--support/dktools/dk4maiwhis.c51
-rw-r--r--support/dktools/dk4maiwhis.ctr27
-rw-r--r--support/dktools/dk4maiwhis.h48
-rw-r--r--support/dktools/dk4maiwhli.c49
-rw-r--r--support/dktools/dk4maiwhli.ctr25
-rw-r--r--support/dktools/dk4maiwhli.h48
-rw-r--r--support/dktools/dk4maiwhlu.c49
-rw-r--r--support/dktools/dk4maiwhlu.ctr25
-rw-r--r--support/dktools/dk4maiwhlu.h48
-rw-r--r--support/dktools/dk4maiwhmi.c62
-rw-r--r--support/dktools/dk4maiwhmi.ctr38
-rw-r--r--support/dktools/dk4maiwhmi.h48
-rw-r--r--support/dktools/dk4maiwhmu.c62
-rw-r--r--support/dktools/dk4maiwhmu.ctr38
-rw-r--r--support/dktools/dk4maiwhmu.h48
-rw-r--r--support/dktools/dk4maiwhuc.c52
-rw-r--r--support/dktools/dk4maiwhuc.ctr28
-rw-r--r--support/dktools/dk4maiwhuc.h48
-rw-r--r--support/dktools/dk4maiwhui.c51
-rw-r--r--support/dktools/dk4maiwhui.ctr27
-rw-r--r--support/dktools/dk4maiwhui.h48
-rw-r--r--support/dktools/dk4maiwhul.c51
-rw-r--r--support/dktools/dk4maiwhul.ctr27
-rw-r--r--support/dktools/dk4maiwhul.h48
-rw-r--r--support/dktools/dk4maiwhus.c51
-rw-r--r--support/dktools/dk4maiwhus.ctr27
-rw-r--r--support/dktools/dk4maiwhus.h48
-rw-r--r--support/dktools/dk4maixdbl.cpp53
-rw-r--r--support/dktools/dk4maixdbl.cpt29
-rw-r--r--support/dktools/dk4maixdbl.h48
-rw-r--r--support/dktools/dk4maixddi.cpp53
-rw-r--r--support/dktools/dk4maixddi.cpt29
-rw-r--r--support/dktools/dk4maixddi.h48
-rw-r--r--support/dktools/dk4maixddu.cpp53
-rw-r--r--support/dktools/dk4maixddu.cpt29
-rw-r--r--support/dktools/dk4maixddu.h48
-rw-r--r--support/dktools/dk4maixdic.cpp53
-rw-r--r--support/dktools/dk4maixdic.cpt29
-rw-r--r--support/dktools/dk4maixdic.h48
-rw-r--r--support/dktools/dk4maixdii.cpp53
-rw-r--r--support/dktools/dk4maixdii.cpt29
-rw-r--r--support/dktools/dk4maixdii.h48
-rw-r--r--support/dktools/dk4maixdil.cpp53
-rw-r--r--support/dktools/dk4maixdil.cpt29
-rw-r--r--support/dktools/dk4maixdil.h48
-rw-r--r--support/dktools/dk4maixdis.cpp53
-rw-r--r--support/dktools/dk4maixdis.cpt29
-rw-r--r--support/dktools/dk4maixdis.h48
-rw-r--r--support/dktools/dk4maixdli.cpp53
-rw-r--r--support/dktools/dk4maixdli.cpt29
-rw-r--r--support/dktools/dk4maixdli.h48
-rw-r--r--support/dktools/dk4maixdlu.cpp53
-rw-r--r--support/dktools/dk4maixdlu.cpt29
-rw-r--r--support/dktools/dk4maixdlu.h48
-rw-r--r--support/dktools/dk4maixdmi.cpp59
-rw-r--r--support/dktools/dk4maixdmi.cpt35
-rw-r--r--support/dktools/dk4maixdmi.h48
-rw-r--r--support/dktools/dk4maixdmu.cpp59
-rw-r--r--support/dktools/dk4maixdmu.cpt35
-rw-r--r--support/dktools/dk4maixdmu.h48
-rw-r--r--support/dktools/dk4maixdsz.cpp53
-rw-r--r--support/dktools/dk4maixdsz.cpt29
-rw-r--r--support/dktools/dk4maixdsz.h48
-rw-r--r--support/dktools/dk4maixduc.cpp53
-rw-r--r--support/dktools/dk4maixduc.cpt29
-rw-r--r--support/dktools/dk4maixduc.h48
-rw-r--r--support/dktools/dk4maixdui.cpp53
-rw-r--r--support/dktools/dk4maixdui.cpt29
-rw-r--r--support/dktools/dk4maixdui.h48
-rw-r--r--support/dktools/dk4maixdul.cpp53
-rw-r--r--support/dktools/dk4maixdul.cpt29
-rw-r--r--support/dktools/dk4maixdul.h48
-rw-r--r--support/dktools/dk4maixdus.cpp53
-rw-r--r--support/dktools/dk4maixdus.cpt29
-rw-r--r--support/dktools/dk4maixdus.h48
-rw-r--r--support/dktools/dk4mao8d.c58
-rw-r--r--support/dktools/dk4mao8d.ctr52
-rw-r--r--support/dktools/dk4mao8d.h68
-rw-r--r--support/dktools/dk4mao8dbl.c115
-rw-r--r--support/dktools/dk4mao8dbl.ctr62
-rw-r--r--support/dktools/dk4mao8dbl.h51
-rw-r--r--support/dktools/dk4mao8dns.c299
-rw-r--r--support/dktools/dk4mao8dns.ctr352
-rw-r--r--support/dktools/dk4mao8dns.h144
-rw-r--r--support/dktools/dk4mao8h.c107
-rw-r--r--support/dktools/dk4mao8h.ctr31
-rw-r--r--support/dktools/dk4mao8h.h52
-rw-r--r--support/dktools/dk4maodd.c52
-rw-r--r--support/dktools/dk4maodd.ctr32
-rw-r--r--support/dktools/dk4maodd.h52
-rw-r--r--support/dktools/dk4maoddbl.c50
-rw-r--r--support/dktools/dk4maoddbl.ctr26
-rw-r--r--support/dktools/dk4maoddbl.h48
-rw-r--r--support/dktools/dk4maodh.c50
-rw-r--r--support/dktools/dk4maodh.ctr32
-rw-r--r--support/dktools/dk4maodh.h52
-rw-r--r--support/dktools/dk4maodo.c53
-rw-r--r--support/dktools/dk4maodo.ctr27
-rw-r--r--support/dktools/dk4maodo.h50
-rw-r--r--support/dktools/dk4maowd.c58
-rw-r--r--support/dktools/dk4maowd.ctr36
-rw-r--r--support/dktools/dk4maowd.h52
-rw-r--r--support/dktools/dk4maowdbl.c136
-rw-r--r--support/dktools/dk4maowdbl.ctr72
-rw-r--r--support/dktools/dk4maowdbl.h50
-rw-r--r--support/dktools/dk4maowh.c56
-rw-r--r--support/dktools/dk4maowh.ctr32
-rw-r--r--support/dktools/dk4maowh.h48
-rw-r--r--support/dktools/dk4maoxd.cpp57
-rw-r--r--support/dktools/dk4maoxd.cpt33
-rw-r--r--support/dktools/dk4maoxd.h48
-rw-r--r--support/dktools/dk4maoxdbl.cpp54
-rw-r--r--support/dktools/dk4maoxdbl.cpt30
-rw-r--r--support/dktools/dk4maoxdbl.h48
-rw-r--r--support/dktools/dk4masz.c38
-rw-r--r--support/dktools/dk4masz.ctr14
-rw-r--r--support/dktools/dk4masz.h48
-rw-r--r--support/dktools/dk4math.c181
-rw-r--r--support/dktools/dk4math.ctr405
-rw-r--r--support/dktools/dk4math.h255
-rw-r--r--support/dktools/dk4mbstrm.c67
-rw-r--r--support/dktools/dk4mbstrm.ctr56
-rw-r--r--support/dktools/dk4mbstrm.h61
-rw-r--r--support/dktools/dk4md.c78
-rw-r--r--support/dktools/dk4md.ctr42
-rw-r--r--support/dktools/dk4md.h56
-rw-r--r--support/dktools/dk4mdch.c24
-rw-r--r--support/dktools/dk4mdch.ctr14
-rw-r--r--support/dktools/dk4mem.c130
-rw-r--r--support/dktools/dk4mem.ctr306
-rw-r--r--support/dktools/dk4mem.h254
-rw-r--r--support/dktools/dk4mema.c50
-rw-r--r--support/dktools/dk4mema.ctr26
-rw-r--r--support/dktools/dk4mema.h48
-rw-r--r--support/dktools/dk4membf.c52
-rw-r--r--support/dktools/dk4membf.ctr38
-rw-r--r--support/dktools/dk4membf.h58
-rw-r--r--support/dktools/dk4membs.c55
-rw-r--r--support/dktools/dk4membs.ctr55
-rw-r--r--support/dktools/dk4membs.h72
-rw-r--r--support/dktools/dk4membuf.c93
-rw-r--r--support/dktools/dk4membuf.ctr65
-rw-r--r--support/dktools/dk4membuf.h58
-rw-r--r--support/dktools/dk4memcpl.c52
-rw-r--r--support/dktools/dk4memcpl.ctr34
-rw-r--r--support/dktools/dk4memcpl.h54
-rw-r--r--support/dktools/dk4memrs.c90
-rw-r--r--support/dktools/dk4memrs.ctr96
-rw-r--r--support/dktools/dk4memrs.h80
-rw-r--r--support/dktools/dk4mkdh.c48
-rw-r--r--support/dktools/dk4mkdh.ctr24
-rw-r--r--support/dktools/dk4mkdh.h48
-rw-r--r--support/dktools/dk4mkdh8.c118
-rw-r--r--support/dktools/dk4mkdh8.ctr56
-rw-r--r--support/dktools/dk4mkdh8.h48
-rw-r--r--support/dktools/dk4mkdhw.c105
-rw-r--r--support/dktools/dk4mkdhw.ctr53
-rw-r--r--support/dktools/dk4mkdhw.h48
-rw-r--r--support/dktools/dk4mm.c50
-rw-r--r--support/dktools/dk4mm.ctr26
-rw-r--r--support/dktools/dk4mm.h48
-rw-r--r--support/dktools/dk4mpl.h9
-rw-r--r--support/dktools/dk4numco.h9
-rw-r--r--support/dktools/dk4numl.c38
-rw-r--r--support/dktools/dk4numl.ctr10
-rw-r--r--support/dktools/dk4numl.h44
-rw-r--r--support/dktools/dk4opt.c59
-rw-r--r--support/dktools/dk4opt.ctr39
-rw-r--r--support/dktools/dk4opt.h60
-rw-r--r--support/dktools/dk4opt01.c51
-rw-r--r--support/dktools/dk4opt01.ctr15
-rw-r--r--support/dktools/dk4opt02.c51
-rw-r--r--support/dktools/dk4opt02.ctr15
-rw-r--r--support/dktools/dk4opt03.c51
-rw-r--r--support/dktools/dk4opt03.ctr15
-rw-r--r--support/dktools/dk4opt04.c51
-rw-r--r--support/dktools/dk4opt04.ctr15
-rw-r--r--support/dktools/dk4opt05.c49
-rw-r--r--support/dktools/dk4opt05.ctr15
-rw-r--r--support/dktools/dk4opt06.c52
-rw-r--r--support/dktools/dk4opt06.ctr16
-rw-r--r--support/dktools/dk4opt07.c61
-rw-r--r--support/dktools/dk4opt07.ctr23
-rw-r--r--support/dktools/dk4papea.c146
-rw-r--r--support/dktools/dk4papea.ctr40
-rw-r--r--support/dktools/dk4papea.h52
-rw-r--r--support/dktools/dk4paper.c382
-rw-r--r--support/dktools/dk4paper.ctr293
-rw-r--r--support/dktools/dk4paper.h121
-rw-r--r--support/dktools/dk4path8.c329
-rw-r--r--support/dktools/dk4path8.ctr416
-rw-r--r--support/dktools/dk4path8.h175
-rw-r--r--support/dktools/dk4pathd.c199
-rw-r--r--support/dktools/dk4pathd.ctr286
-rw-r--r--support/dktools/dk4pathd.h175
-rw-r--r--support/dktools/dk4pathw.c310
-rw-r--r--support/dktools/dk4pathw.ctr411
-rw-r--r--support/dktools/dk4pathw.h175
-rw-r--r--support/dktools/dk4pathx.cpp328
-rw-r--r--support/dktools/dk4pathx.cpt409
-rw-r--r--support/dktools/dk4pathx.h114
-rw-r--r--support/dktools/dk4pppt.c3018
-rw-r--r--support/dktools/dk4pppt.ctr4108
-rw-r--r--support/dktools/dk4pppt.h1434
-rw-r--r--support/dktools/dk4pppta.c747
-rw-r--r--support/dktools/dk4pppta.ctr1591
-rw-r--r--support/dktools/dk4pppta.h877
-rw-r--r--support/dktools/dk4pref.c68
-rw-r--r--support/dktools/dk4pref.ctr40
-rw-r--r--support/dktools/dk4pref.h60
-rw-r--r--support/dktools/dk4px.h41
-rw-r--r--support/dktools/dk4pxbit.c100
-rw-r--r--support/dktools/dk4pxbit.ctr152
-rw-r--r--support/dktools/dk4pxbit.h89
-rw-r--r--support/dktools/dk4pxres.c337
-rw-r--r--support/dktools/dk4pxres.ctr430
-rw-r--r--support/dktools/dk4pxres.h159
-rw-r--r--support/dktools/dk4rec.h121
-rw-r--r--support/dktools/dk4rec01.c50
-rw-r--r--support/dktools/dk4rec01.ctr26
-rw-r--r--support/dktools/dk4rec01.h48
-rw-r--r--support/dktools/dk4rec02.c52
-rw-r--r--support/dktools/dk4rec02.ctr28
-rw-r--r--support/dktools/dk4rec02.h48
-rw-r--r--support/dktools/dk4rec03.c56
-rw-r--r--support/dktools/dk4rec03.ctr32
-rw-r--r--support/dktools/dk4rec03.h48
-rw-r--r--support/dktools/dk4rec04.c55
-rw-r--r--support/dktools/dk4rec04.ctr31
-rw-r--r--support/dktools/dk4rec04.h48
-rw-r--r--support/dktools/dk4rec05.c53
-rw-r--r--support/dktools/dk4rec05.ctr29
-rw-r--r--support/dktools/dk4rec05.h48
-rw-r--r--support/dktools/dk4rec06.c55
-rw-r--r--support/dktools/dk4rec06.ctr31
-rw-r--r--support/dktools/dk4rec06.h48
-rw-r--r--support/dktools/dk4rec07.c52
-rw-r--r--support/dktools/dk4rec07.ctr28
-rw-r--r--support/dktools/dk4rec07.h48
-rw-r--r--support/dktools/dk4rec08.c50
-rw-r--r--support/dktools/dk4rec08.ctr26
-rw-r--r--support/dktools/dk4rec08.h48
-rw-r--r--support/dktools/dk4rec09.c50
-rw-r--r--support/dktools/dk4rec09.ctr26
-rw-r--r--support/dktools/dk4rec09.h48
-rw-r--r--support/dktools/dk4rec10.c50
-rw-r--r--support/dktools/dk4rec10.ctr26
-rw-r--r--support/dktools/dk4rec10.h48
-rw-r--r--support/dktools/dk4rec11.c56
-rw-r--r--support/dktools/dk4rec11.ctr30
-rw-r--r--support/dktools/dk4rec11.h48
-rw-r--r--support/dktools/dk4rec12.c53
-rw-r--r--support/dktools/dk4rec12.ctr29
-rw-r--r--support/dktools/dk4rec12.h48
-rw-r--r--support/dktools/dk4rec13.c51
-rw-r--r--support/dktools/dk4rec13.ctr27
-rw-r--r--support/dktools/dk4rec13.h48
-rw-r--r--support/dktools/dk4rec14.c53
-rw-r--r--support/dktools/dk4rec14.ctr29
-rw-r--r--support/dktools/dk4rec14.h48
-rw-r--r--support/dktools/dk4rec15.c51
-rw-r--r--support/dktools/dk4rec15.ctr27
-rw-r--r--support/dktools/dk4rec15.h48
-rw-r--r--support/dktools/dk4rec16.c52
-rw-r--r--support/dktools/dk4rec16.ctr28
-rw-r--r--support/dktools/dk4rec16.h48
-rw-r--r--support/dktools/dk4rec17.c58
-rw-r--r--support/dktools/dk4rec17.ctr32
-rw-r--r--support/dktools/dk4rec17.h48
-rw-r--r--support/dktools/dk4rec18.c57
-rw-r--r--support/dktools/dk4rec18.ctr31
-rw-r--r--support/dktools/dk4rec18.h48
-rw-r--r--support/dktools/dk4rec19.c50
-rw-r--r--support/dktools/dk4rec19.ctr26
-rw-r--r--support/dktools/dk4rec19.h48
-rw-r--r--support/dktools/dk4rec20.c52
-rw-r--r--support/dktools/dk4rec20.ctr28
-rw-r--r--support/dktools/dk4rec20.h48
-rw-r--r--support/dktools/dk4rec21.c77
-rw-r--r--support/dktools/dk4rec21.ctr53
-rw-r--r--support/dktools/dk4rec21.h48
-rw-r--r--support/dktools/dk4rec22.c52
-rw-r--r--support/dktools/dk4rec22.ctr26
-rw-r--r--support/dktools/dk4rec22.h48
-rw-r--r--support/dktools/dk4rec23.c52
-rw-r--r--support/dktools/dk4rec23.ctr26
-rw-r--r--support/dktools/dk4rec23.h48
-rw-r--r--support/dktools/dk4rec24.c56
-rw-r--r--support/dktools/dk4rec24.ctr32
-rw-r--r--support/dktools/dk4rec24.h48
-rw-r--r--support/dktools/dk4rec25.c147
-rw-r--r--support/dktools/dk4rec25.ctr111
-rw-r--r--support/dktools/dk4rec25.h36
-rw-r--r--support/dktools/dk4rec26.c107
-rw-r--r--support/dktools/dk4rec26.ctr184
-rw-r--r--support/dktools/dk4rec26.h108
-rw-r--r--support/dktools/dk4rec27.c175
-rw-r--r--support/dktools/dk4rec27.ctr233
-rw-r--r--support/dktools/dk4rec27.h89
-rw-r--r--support/dktools/dk4recwx.cpp182
-rw-r--r--support/dktools/dk4recwx.cpt172
-rw-r--r--support/dktools/dk4recwx.h112
-rw-r--r--support/dktools/dk4rld.c88
-rw-r--r--support/dktools/dk4rld.ctr54
-rw-r--r--support/dktools/dk4rld.h56
-rw-r--r--support/dktools/dk4rle.c176
-rw-r--r--support/dktools/dk4rle.ctr74
-rw-r--r--support/dktools/dk4rle.h56
-rw-r--r--support/dktools/dk4serf.c81
-rw-r--r--support/dktools/dk4serf.ctr55
-rw-r--r--support/dktools/dk4serf.h48
-rw-r--r--support/dktools/dk4sock.h20
-rw-r--r--support/dktools/dk4sock01.c61
-rw-r--r--support/dktools/dk4sock01.ctr21
-rw-r--r--support/dktools/dk4sock02.c65
-rw-r--r--support/dktools/dk4sock02.ctr31
-rw-r--r--support/dktools/dk4sock03.c103
-rw-r--r--support/dktools/dk4sock03.ctr47
-rw-r--r--support/dktools/dk4sock04.c84
-rw-r--r--support/dktools/dk4sock04.ctr76
-rw-r--r--support/dktools/dk4sock05.c62
-rw-r--r--support/dktools/dk4sock05.ctr28
-rw-r--r--support/dktools/dk4sock06.c80
-rw-r--r--support/dktools/dk4sock06.ctr36
-rw-r--r--support/dktools/dk4sock07.c55
-rw-r--r--support/dktools/dk4sock07.ctr19
-rw-r--r--support/dktools/dk4sock08.c48
-rw-r--r--support/dktools/dk4sock08.ctr14
-rw-r--r--support/dktools/dk4sock09.c76
-rw-r--r--support/dktools/dk4sock09.ctr24
-rw-r--r--support/dktools/dk4sock10.c62
-rw-r--r--support/dktools/dk4sock10.ctr18
-rw-r--r--support/dktools/dk4sock11.c52
-rw-r--r--support/dktools/dk4sock11.ctr16
-rw-r--r--support/dktools/dk4sock12.c71
-rw-r--r--support/dktools/dk4sock12.ctr19
-rw-r--r--support/dktools/dk4sock13.c97
-rw-r--r--support/dktools/dk4sock13.ctr39
-rw-r--r--support/dktools/dk4sock14.c75
-rw-r--r--support/dktools/dk4sock14.ctr17
-rw-r--r--support/dktools/dk4sock15.c53
-rw-r--r--support/dktools/dk4sock15.ctr17
-rw-r--r--support/dktools/dk4sock16.c160
-rw-r--r--support/dktools/dk4sock16.ctr62
-rw-r--r--support/dktools/dk4sock17.c125
-rw-r--r--support/dktools/dk4sock17.ctr31
-rw-r--r--support/dktools/dk4sock18.c149
-rw-r--r--support/dktools/dk4sock18.ctr63
-rw-r--r--support/dktools/dk4sock19.c13
-rw-r--r--support/dktools/dk4sock19.ctr5
-rw-r--r--support/dktools/dk4sock20.c58
-rw-r--r--support/dktools/dk4sock20.ctr22
-rw-r--r--support/dktools/dk4sock21.c63
-rw-r--r--support/dktools/dk4sock21.ctr27
-rw-r--r--support/dktools/dk4sock22.c56
-rw-r--r--support/dktools/dk4sock22.ctr20
-rw-r--r--support/dktools/dk4sock23.c65
-rw-r--r--support/dktools/dk4sock23.ctr13
-rw-r--r--support/dktools/dk4sock24.c91
-rw-r--r--support/dktools/dk4sock24.ctr25
-rw-r--r--support/dktools/dk4sock25.c65
-rw-r--r--support/dktools/dk4sock25.ctr19
-rw-r--r--support/dktools/dk4sock26.c74
-rw-r--r--support/dktools/dk4sock26.ctr12
-rw-r--r--support/dktools/dk4sock27.c53
-rw-r--r--support/dktools/dk4sock27.ctr17
-rw-r--r--support/dktools/dk4sock28.c36
-rw-r--r--support/dktools/dk4sock28.ctr2
-rw-r--r--support/dktools/dk4sock29.c77
-rw-r--r--support/dktools/dk4sock29.ctr13
-rw-r--r--support/dktools/dk4sock30.c91
-rw-r--r--support/dktools/dk4sock30.ctr21
-rw-r--r--support/dktools/dk4sock31.c82
-rw-r--r--support/dktools/dk4sock31.ctr30
-rw-r--r--support/dktools/dk4sock32.c62
-rw-r--r--support/dktools/dk4sock32.ctr18
-rw-r--r--support/dktools/dk4sock33.c156
-rw-r--r--support/dktools/dk4sock33.ctr28
-rw-r--r--support/dktools/dk4sock34.c169
-rw-r--r--support/dktools/dk4sock34.ctr51
-rw-r--r--support/dktools/dk4sock35.c67
-rw-r--r--support/dktools/dk4sock35.ctr13
-rw-r--r--support/dktools/dk4sock36.c65
-rw-r--r--support/dktools/dk4sock36.ctr15
-rw-r--r--support/dktools/dk4sock37.c71
-rw-r--r--support/dktools/dk4sock37.ctr21
-rw-r--r--support/dktools/dk4socka.h47
-rw-r--r--support/dktools/dk4socka01.c45
-rw-r--r--support/dktools/dk4socka01.ctr3
-rw-r--r--support/dktools/dk4socka02.c62
-rw-r--r--support/dktools/dk4socka02.ctr26
-rw-r--r--support/dktools/dk4socka03.c37
-rw-r--r--support/dktools/dk4socka03.ctr3
-rw-r--r--support/dktools/dk4socka04.c39
-rw-r--r--support/dktools/dk4socka04.ctr3
-rw-r--r--support/dktools/dk4socka05.c37
-rw-r--r--support/dktools/dk4socka05.ctr3
-rw-r--r--support/dktools/dk4socka06.c39
-rw-r--r--support/dktools/dk4socka06.ctr3
-rw-r--r--support/dktools/dk4socka07.c231
-rw-r--r--support/dktools/dk4socka07.ctr77
-rw-r--r--support/dktools/dk4socka08.c39
-rw-r--r--support/dktools/dk4socka08.ctr3
-rw-r--r--support/dktools/dk4socka09.c39
-rw-r--r--support/dktools/dk4socka09.ctr3
-rw-r--r--support/dktools/dk4stat.c62
-rw-r--r--support/dktools/dk4stat.ctr42
-rw-r--r--support/dktools/dk4stat.h54
-rw-r--r--support/dktools/dk4stat8.c89
-rw-r--r--support/dktools/dk4stat8.ctr52
-rw-r--r--support/dktools/dk4stat8.h55
-rw-r--r--support/dktools/dk4statd.c53
-rw-r--r--support/dktools/dk4statd.ctr35
-rw-r--r--support/dktools/dk4statd.h54
-rw-r--r--support/dktools/dk4statt.h13
-rw-r--r--support/dktools/dk4statw.c58
-rw-r--r--support/dktools/dk4statw.ctr38
-rw-r--r--support/dktools/dk4statw.h54
-rw-r--r--support/dktools/dk4sto.c620
-rw-r--r--support/dktools/dk4sto.ctr307
-rw-r--r--support/dktools/dk4sto.h63
-rw-r--r--support/dktools/dk4str.c5
-rw-r--r--support/dktools/dk4str8.c149
-rw-r--r--support/dktools/dk4str8.ctr144
-rw-r--r--support/dktools/dk4str8.h89
-rw-r--r--support/dktools/dk4strd.c39
-rw-r--r--support/dktools/dk4strd.ctr75
-rw-r--r--support/dktools/dk4strd.h108
-rw-r--r--support/dktools/dk4strda.c50
-rw-r--r--support/dktools/dk4strda.ctr24
-rw-r--r--support/dktools/dk4strda.h48
-rw-r--r--support/dktools/dk4strm.c256
-rw-r--r--support/dktools/dk4strm.ctr120
-rw-r--r--support/dktools/dk4strm.h58
-rw-r--r--support/dktools/dk4strmb.c70
-rw-r--r--support/dktools/dk4strmb.ctr42
-rw-r--r--support/dktools/dk4strmb.h44
-rw-r--r--support/dktools/dk4strmco.c467
-rw-r--r--support/dktools/dk4strmco.ctr308
-rw-r--r--support/dktools/dk4strmco.h57
-rw-r--r--support/dktools/dk4strmf.c68
-rw-r--r--support/dktools/dk4strmf.ctr42
-rw-r--r--support/dktools/dk4strmf.h46
-rw-r--r--support/dktools/dk4strmg.c69
-rw-r--r--support/dktools/dk4strmg.ctr41
-rw-r--r--support/dktools/dk4strmg.h44
-rw-r--r--support/dktools/dk4strmh.c58
-rw-r--r--support/dktools/dk4strmh.ctr38
-rw-r--r--support/dktools/dk4strmh.h52
-rw-r--r--support/dktools/dk4strmo08.c66
-rw-r--r--support/dktools/dk4strmo08.ctr42
-rw-r--r--support/dktools/dk4strmo08.h50
-rw-r--r--support/dktools/dk4strmo16.c51
-rw-r--r--support/dktools/dk4strmo16.ctr36
-rw-r--r--support/dktools/dk4strmo16.h57
-rw-r--r--support/dktools/dk4strmo32.c123
-rw-r--r--support/dktools/dk4strmo32.ctr48
-rw-r--r--support/dktools/dk4strmo32.h51
-rw-r--r--support/dktools/dk4strmodk.c67
-rw-r--r--support/dktools/dk4strmodk.ctr52
-rw-r--r--support/dktools/dk4strmodk.h57
-rw-r--r--support/dktools/dk4strmr.c84
-rw-r--r--support/dktools/dk4strmr.ctr40
-rw-r--r--support/dktools/dk4strmr.h64
-rw-r--r--support/dktools/dk4strms.c82
-rw-r--r--support/dktools/dk4strms.ctr64
-rw-r--r--support/dktools/dk4strms.h54
-rw-r--r--support/dktools/dk4strmu.c78
-rw-r--r--support/dktools/dk4strmu.ctr60
-rw-r--r--support/dktools/dk4strmu.h54
-rw-r--r--support/dktools/dk4strmw.c122
-rw-r--r--support/dktools/dk4strmw.ctr40
-rw-r--r--support/dktools/dk4strmw.h64
-rw-r--r--support/dktools/dk4strw.c151
-rw-r--r--support/dktools/dk4strw.ctr128
-rw-r--r--support/dktools/dk4strw.h77
-rw-r--r--support/dktools/dk4strx.cpp287
-rw-r--r--support/dktools/dk4strx.cpt495
-rw-r--r--support/dktools/dk4strx.h296
-rw-r--r--support/dktools/dk4stt.c129
-rw-r--r--support/dktools/dk4stt.ctr47
-rw-r--r--support/dktools/dk4stt.h54
-rw-r--r--support/dktools/dk4svbuf.c60
-rw-r--r--support/dktools/dk4svbuf.ctr39
-rw-r--r--support/dktools/dk4svbuf.h53
-rw-r--r--support/dktools/dk4svbufa.c70
-rw-r--r--support/dktools/dk4svbufa.ctr46
-rw-r--r--support/dktools/dk4svbufa.h50
-rw-r--r--support/dktools/dk4symlink.c86
-rw-r--r--support/dktools/dk4symlink.ctr34
-rw-r--r--support/dktools/dk4symlink.h48
-rw-r--r--support/dktools/dk4time.c52
-rw-r--r--support/dktools/dk4time.ctr28
-rw-r--r--support/dktools/dk4time.h48
-rw-r--r--support/dktools/dk4time08.c83
-rw-r--r--support/dktools/dk4time08.ctr63
-rw-r--r--support/dktools/dk4time08.h56
-rw-r--r--support/dktools/dk4timec.h5
-rw-r--r--support/dktools/dk4timedk.c61
-rw-r--r--support/dktools/dk4timedk.ctr45
-rw-r--r--support/dktools/dk4timedk.h56
-rw-r--r--support/dktools/dk4timewc.c79
-rw-r--r--support/dktools/dk4timewc.ctr63
-rw-r--r--support/dktools/dk4timewc.h56
-rw-r--r--support/dktools/dk4tsp.h13
-rw-r--r--support/dktools/dk4tsp08.c274
-rw-r--r--support/dktools/dk4tsp08.ctr120
-rw-r--r--support/dktools/dk4tsp08.h70
-rw-r--r--support/dktools/dk4tsp16.c118
-rw-r--r--support/dktools/dk4tsp16.ctr90
-rw-r--r--support/dktools/dk4tsp16.h70
-rw-r--r--support/dktools/dk4tsp32.c118
-rw-r--r--support/dktools/dk4tsp32.ctr86
-rw-r--r--support/dktools/dk4tsp32.h70
-rw-r--r--support/dktools/dk4tspdk.c101
-rw-r--r--support/dktools/dk4tspdk.ctr91
-rw-r--r--support/dktools/dk4tspdk.h62
-rw-r--r--support/dktools/dk4tspwx.cpp60
-rw-r--r--support/dktools/dk4tspwx.cpt68
-rw-r--r--support/dktools/dk4tspwx.h86
-rw-r--r--support/dktools/dk4types.h103
-rw-r--r--support/dktools/dk4uc2l.c4643
-rw-r--r--support/dktools/dk4uc2l.ctr4477
-rw-r--r--support/dktools/dk4uc2l.h408
-rw-r--r--support/dktools/dk4uc2la.c2445
-rw-r--r--support/dktools/dk4uc2la.ctr2489
-rw-r--r--support/dktools/dk4uc2la.h260
-rw-r--r--support/dktools/dk4ufi.c52
-rw-r--r--support/dktools/dk4ufi.ctr32
-rw-r--r--support/dktools/dk4ufi.h52
-rw-r--r--support/dktools/dk4ufi08.c95
-rw-r--r--support/dktools/dk4ufi08.ctr57
-rw-r--r--support/dktools/dk4ufi08.h52
-rw-r--r--support/dktools/dk4ufic.c74
-rw-r--r--support/dktools/dk4ufic.ctr34
-rw-r--r--support/dktools/dk4ufic.h48
-rw-r--r--support/dktools/dk4ufit.h17
-rw-r--r--support/dktools/dk4ufiwc.c81
-rw-r--r--support/dktools/dk4ufiwc.ctr61
-rw-r--r--support/dktools/dk4ufiwc.h52
-rw-r--r--support/dktools/dk4unused.h104
-rw-r--r--support/dktools/dk4use.ctr87
-rw-r--r--support/dktools/dk4use.h101
-rw-r--r--support/dktools/dk4user.c200
-rw-r--r--support/dktools/dk4user.ctr70
-rw-r--r--support/dktools/dk4user.h48
-rw-r--r--support/dktools/dk4userf.c99
-rw-r--r--support/dktools/dk4userf.ctr61
-rw-r--r--support/dktools/dk4userf.h48
-rw-r--r--support/dktools/dk4utf16.c118
-rw-r--r--support/dktools/dk4utf16.ctr97
-rw-r--r--support/dktools/dk4utf16.h81
-rw-r--r--support/dktools/dk4utf8.c75
-rw-r--r--support/dktools/dk4utf8.ctr55
-rw-r--r--support/dktools/dk4utf8.h56
-rw-r--r--support/dktools/dk4vers.h9
-rw-r--r--support/dktools/dk4verswx.h7
-rw-r--r--support/dktools/dk4wmain.h15
-rw-r--r--support/dktools/dk4wreg.c5
-rw-r--r--support/dktools/dk4wreg8.c206
-rw-r--r--support/dktools/dk4wreg8.ctr148
-rw-r--r--support/dktools/dk4wreg8.h52
-rw-r--r--support/dktools/dk4wregc.c49
-rw-r--r--support/dktools/dk4wregc.ctr27
-rw-r--r--support/dktools/dk4wregc.h52
-rw-r--r--support/dktools/dk4wregd.c79
-rw-r--r--support/dktools/dk4wregd.ctr57
-rw-r--r--support/dktools/dk4wregd.h52
-rw-r--r--support/dktools/dk4wregk.h5
-rw-r--r--support/dktools/dk4wregt.h13
-rw-r--r--support/dktools/dk4wregw.c204
-rw-r--r--support/dktools/dk4wregw.ctr152
-rw-r--r--support/dktools/dk4wregw.h52
-rw-r--r--support/dktools/dk4wxcs.cpp101
-rw-r--r--support/dktools/dk4wxcs.cross11
-rw-r--r--support/dktools/dk4wxcs.h19
-rw-r--r--support/dktools/dk4wxpref.cpp59
-rw-r--r--support/dktools/dk4wxpref.cpt37
-rw-r--r--support/dktools/dk4wxpref.h64
-rw-r--r--support/dktools/dk4wxstt.cpp142
-rw-r--r--support/dktools/dk4wxstt.cpt54
-rw-r--r--support/dktools/dk4wxstt.h56
-rw-r--r--support/dktools/dk4wxtypes.h13
-rw-r--r--support/dktools/dk4xsp.c1301
-rw-r--r--support/dktools/dk4xsp.ctr1478
-rw-r--r--support/dktools/dk4xsp.h447
-rw-r--r--support/dktools/dkclock.icobin20454 -> 21542 bytes
-rw-r--r--support/dktools/dkclock.xpm40
-rw-r--r--support/dktools/dkct-au.c497
-rw-r--r--support/dktools/dkct-au.ctr347
-rw-r--r--support/dktools/dkct-gui.c1512
-rw-r--r--support/dktools/dkct-gui.ctr602
-rw-r--r--support/dktools/dkct-gui.h36
-rw-r--r--support/dktools/dkct-str.c87
-rw-r--r--support/dktools/dkct-str.ctr43
-rw-r--r--support/dktools/dkct-str.h36
-rw-r--r--support/dktools/dkct-to.c38
-rw-r--r--support/dktools/dkct-to.ctr4
-rw-r--r--support/dktools/dkct-to.h36
-rw-r--r--support/dktools/dkct-tr.c925
-rw-r--r--support/dktools/dkct-tr.ctr629
-rw-r--r--support/dktools/dkct-tr.h42
-rw-r--r--support/dktools/dkct.c142
-rw-r--r--support/dktools/dkct.ctr52
-rw-r--r--support/dktools/dkct.h5
-rw-r--r--support/dktools/dkct.rc8
-rw-r--r--support/dktools/dkctinst.icobin21542 -> 21542 bytes
-rw-r--r--support/dktools/dkctunin.icobin21542 -> 21542 bytes
-rw-r--r--support/dktools/dkdbt.c345
-rw-r--r--support/dktools/dkdbt.ctr4
-rw-r--r--support/dktools/dkdbt.rc8
-rw-r--r--support/dktools/dkdbt2.c120
-rw-r--r--support/dktools/dkdbt2.ctr66
-rw-r--r--support/dktools/dkicon.icobin21542 -> 21542 bytes
-rw-r--r--support/dktools/dkicon.xpm40
-rw-r--r--support/dktools/dkt-version.h8
-rw-r--r--support/dktools/dkt.h10
-rw-r--r--support/dktools/dktools-el.spec2
-rw-r--r--support/dktools/dktools-el6.spec467
-rw-r--r--support/dktools/dktools-el6.spec.in486
-rw-r--r--support/dktools/dktools-el7.spec557
-rw-r--r--support/dktools/dktools-fedora-27.spec276
-rw-r--r--support/dktools/dktools-fedora-28.spec329
-rw-r--r--support/dktools/dktools-fedora-29.spec358
-rw-r--r--support/dktools/dktools-fedora.spec882
-rw-r--r--support/dktools/dktools.pc.in7
-rw-r--r--support/dktools/dktools/charmap/currency-europe.t2l3
-rw-r--r--support/dktools/dktools/charmap/dingbats.t2l3
-rw-r--r--support/dktools/dktools/charmap/iso-latin-1.t2l116
-rw-r--r--support/dktools/dktools/charmap/latin-extended-a.t2l5
-rw-r--r--support/dktools/dktools/charmap/latin-extended-additional.t2l259
-rw-r--r--support/dktools/dktools/charmap/latin-extended-b-phonetic-historic.t2l73
-rw-r--r--support/dktools/dktools/charmap/latin-extended-b-pinyin-diacritic-vowel.t2l19
-rw-r--r--support/dktools/dktools/charmap/latin-extended-b-vietnamese.t2l8
-rw-r--r--support/dktools/dktools/charmap/ligatures.t2l10
-rw-r--r--support/dktools/dktools/charmap/nicefrac.t2l25
-rw-r--r--support/dktools/dktools/charmap/textsym.t2l3
-rw-r--r--support/dktools/dktools/de/bmpp.str97
-rw-r--r--support/dktools/dktools/de/bmpp.txt688
-rw-r--r--support/dktools/dktools/de/bmpp3.txt243
-rw-r--r--support/dktools/dktools/de/dk-bin2c.str38
-rw-r--r--support/dktools/dktools/de/dk-bin2c.txt71
-rw-r--r--support/dktools/dktools/de/dk-blks.str2
-rw-r--r--support/dktools/dktools/de/dk-blks.txt2
-rw-r--r--support/dktools/dktools/de/dk-bmm.str2
-rw-r--r--support/dktools/dktools/de/dk-bmm.txt2
-rw-r--r--support/dktools/dktools/de/dk-cat.str2
-rw-r--r--support/dktools/dktools/de/dk-cat.txt2
-rw-r--r--support/dktools/dktools/de/dk-db2t.str2
-rw-r--r--support/dktools/dktools/de/dk-db2t.txt2
-rw-r--r--support/dktools/dktools/de/dk-dbco.str2
-rw-r--r--support/dktools/dktools/de/dk-dbco.txt2
-rw-r--r--support/dktools/dktools/de/dk-fic.str2
-rw-r--r--support/dktools/dktools/de/dk-fic.txt2
-rw-r--r--support/dktools/dktools/de/dk-hex.str2
-rw-r--r--support/dktools/dktools/de/dk-hex.txt2
-rw-r--r--support/dktools/dktools/de/dk-lines.str132
-rw-r--r--support/dktools/dktools/de/dk-lines.txt141
-rw-r--r--support/dktools/dktools/de/dk-ls.str2
-rw-r--r--support/dktools/dktools/de/dk-ls.txt2
-rw-r--r--support/dktools/dktools/de/dk-pwd.str5
-rw-r--r--support/dktools/dktools/de/dk-pwd.txt2
-rw-r--r--support/dktools/dktools/de/dk-pwgen.str2
-rw-r--r--support/dktools/dktools/de/dk-pwgen.txt2
-rw-r--r--support/dktools/dktools/de/dk-recv.str16
-rw-r--r--support/dktools/dktools/de/dk-recv.txt2
-rw-r--r--support/dktools/dktools/de/dk-send.str16
-rw-r--r--support/dktools/dktools/de/dk-send.txt2
-rw-r--r--support/dktools/dktools/de/dk-sort.str2
-rw-r--r--support/dktools/dktools/de/dk-sort.txt4
-rw-r--r--support/dktools/dktools/de/dk-sqlsplit.txt2
-rw-r--r--support/dktools/dktools/de/dk-t2db.str2
-rw-r--r--support/dktools/dktools/de/dk-t2db.txt2
-rw-r--r--support/dktools/dktools/de/dk-t2h.str2
-rw-r--r--support/dktools/dktools/de/dk-t2h.txt2
-rw-r--r--support/dktools/dktools/de/dk-t2l.str2
-rw-r--r--support/dktools/dktools/de/dk-t2l.txt9
-rw-r--r--support/dktools/dktools/de/dk-uid.str2
-rw-r--r--support/dktools/dktools/de/dk-uid.txt2
-rw-r--r--support/dktools/dktools/de/dk3app.str11
-rw-r--r--support/dktools/dktools/de/dk3bifa.str2
-rw-r--r--support/dktools/dktools/de/dk3bmeps.str2
-rw-r--r--support/dktools/dktools/de/dk3fig.str2
-rw-r--r--support/dktools/dktools/de/dk3print.str2
-rw-r--r--support/dktools/dktools/de/dk3wreg.str2
-rw-r--r--support/dktools/dktools/de/dk4info.str2
-rw-r--r--support/dktools/dktools/de/dk4info.txt2
-rw-r--r--support/dktools/dktools/de/dkct.txt15
-rw-r--r--support/dktools/dktools/de/dkct3.str39
-rw-r--r--support/dktools/dktools/de/dkdbtool.str2
-rw-r--r--support/dktools/dktools/de/dkdbtool.txt2
-rw-r--r--support/dktools/dktools/de/dknet4.str2
-rw-r--r--support/dktools/dktools/de/dknet4.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-boot.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-clp.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-env.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-groups.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-help.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-keep.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-login.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-logout.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-print.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-printers.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-shutdown.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-unkeep.txt2
-rw-r--r--support/dktools/dktools/de/dkwt-users.txt2
-rw-r--r--support/dktools/dktools/de/dkwt.str2
-rw-r--r--support/dktools/dktools/de/dkwx.str7
-rw-r--r--support/dktools/dktools/de/dkwxpath.str2
-rw-r--r--support/dktools/dktools/de/dkwxwiz.str2
-rw-r--r--support/dktools/dktools/de/dkwxwiz.txt2
-rw-r--r--support/dktools/dktools/de/fig2lat.str2
-rw-r--r--support/dktools/dktools/de/fig2lat.txt2
-rw-r--r--support/dktools/dktools/de/htmlbook.str32
-rw-r--r--support/dktools/dktools/de/htmlbook.txt2
-rw-r--r--support/dktools/dktools/de/itadmin.str49
-rw-r--r--support/dktools/dktools/de/lprngcl.str2
-rw-r--r--support/dktools/dktools/de/lprngcl.txt2
-rw-r--r--support/dktools/dktools/de/pjsnmp.str2
-rw-r--r--support/dktools/dktools/de/plpdftex.str2
-rw-r--r--support/dktools/dktools/de/plpdftex.txt214
-rw-r--r--support/dktools/dktools/de/printqd.str2
-rw-r--r--support/dktools/dktools/de/printqda.str2
-rw-r--r--support/dktools/dktools/de/printqdc.str2
-rw-r--r--support/dktools/dktools/de/printqdi.str2
-rw-r--r--support/dktools/dktools/de/winprint.str2
-rw-r--r--support/dktools/dktools/de/wprclean.str2
-rw-r--r--support/dktools/dktools/de/wprclean.txt2
-rw-r--r--support/dktools/dktools/de/wxbmpp.str2
-rw-r--r--support/dktools/dktools/de/wxbmpp4.str341
-rw-r--r--support/dktools/dktools/de/wxd2lat.str487
-rw-r--r--support/dktools/dktools/de/wxd2lat.txt194
-rw-r--r--support/dktools/dktools/de/wxdkclock.str2
-rw-r--r--support/dktools/dktools/de/wxdkct.str333
-rw-r--r--support/dktools/dktools/de/wxdkdraw.str1191
-rw-r--r--support/dktools/dktools/de/wxdkfcs.str2
-rw-r--r--support/dktools/dktools/de/wxdkhtb.str2
-rw-r--r--support/dktools/dktools/de/wxdkscrsz.str2
-rw-r--r--support/dktools/dktools/de/wximgsz.str237
-rw-r--r--support/dktools/dktools/de/wxpqdc.str2
-rw-r--r--support/dktools/dktools/de/x.txt2
-rw-r--r--support/dktools/dktools/dkwxwiza.txt6
-rw-r--r--support/dktools/dktools/dkwxwizc.txt20
-rw-r--r--support/dktools/dktools/dkwxwizf.txt85
-rw-r--r--support/dktools/dktools/dkwxwizh.txt44
-rw-r--r--support/dktools/dktools/dkwxwizm.txt9
-rw-r--r--support/dktools/dktools/dkwxwizv.txt4
-rw-r--r--support/dktools/dktools/en/bmpp.txt590
-rw-r--r--support/dktools/dktools/en/dk-bin2c.txt71
-rw-r--r--support/dktools/dktools/en/dk-blks.txt2
-rw-r--r--support/dktools/dktools/en/dk-bmm.txt2
-rw-r--r--support/dktools/dktools/en/dk-cat.txt2
-rw-r--r--support/dktools/dktools/en/dk-db2t.txt2
-rw-r--r--support/dktools/dktools/en/dk-dbco.txt2
-rw-r--r--support/dktools/dktools/en/dk-fic.txt2
-rw-r--r--support/dktools/dktools/en/dk-hex.txt2
-rw-r--r--support/dktools/dktools/en/dk-lines.txt121
-rw-r--r--support/dktools/dktools/en/dk-ls.txt2
-rw-r--r--support/dktools/dktools/en/dk-pwd.txt2
-rw-r--r--support/dktools/dktools/en/dk-pwgen.txt2
-rw-r--r--support/dktools/dktools/en/dk-recv.txt2
-rw-r--r--support/dktools/dktools/en/dk-send.txt2
-rw-r--r--support/dktools/dktools/en/dk-sort.txt2
-rw-r--r--support/dktools/dktools/en/dk-sqlsplit.txt2
-rw-r--r--support/dktools/dktools/en/dk-t2db.txt2
-rw-r--r--support/dktools/dktools/en/dk-t2h.txt2
-rw-r--r--support/dktools/dktools/en/dk-t2l.txt8
-rw-r--r--support/dktools/dktools/en/dk-uid.txt2
-rw-r--r--support/dktools/dktools/en/dk4info.txt2
-rw-r--r--support/dktools/dktools/en/lprngcl.txt2
-rw-r--r--support/dktools/dktools/en/plpdftex.txt199
-rw-r--r--support/dktools/dktools/en/wxd2lat.txt180
-rw-r--r--support/dktools/dktools/en/x.txt2
-rw-r--r--support/dktools/dktools/help/de/winprint.chmbin0 -> 159909 bytes
-rw-r--r--support/dktools/dktools/help/de/winprint.htb (renamed from support/dktools/help-htb/de/winprint.htb)bin161462 -> 161945 bytes
-rw-r--r--support/dktools/dktools/help/de/wxbmpp.chmbin0 -> 461057 bytes
-rw-r--r--support/dktools/dktools/help/de/wxbmpp.htbbin0 -> 465368 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkclock.chmbin0 -> 85638 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkclock.htb (renamed from support/dktools/help-htb/de/wxdkclock.htb)bin87549 -> 88474 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkct.chmbin0 -> 102105 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkct.htb (renamed from support/dktools/help-htb/de/wxdkct.htb)bin101343 -> 102120 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkdraw.chmbin0 -> 375061 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkdraw.htbbin0 -> 395028 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkfcs.chmbin0 -> 32460 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkfcs.htbbin0 -> 34257 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkscrsz.chmbin0 -> 30931 bytes
-rw-r--r--support/dktools/dktools/help/de/wxdkscrsz.htbbin0 -> 31023 bytes
-rw-r--r--support/dktools/dktools/help/de/wximgsz.chmbin0 -> 60202 bytes
-rw-r--r--support/dktools/dktools/help/de/wximgsz.htbbin0 -> 59974 bytes
-rw-r--r--support/dktools/dktools/help/de/wxpqdic.chmbin0 -> 32734 bytes
-rw-r--r--support/dktools/dktools/help/de/wxpqdic.htbbin0 -> 33740 bytes
-rw-r--r--support/dktools/dktools/help/en/winprint.chmbin0 -> 141551 bytes
-rw-r--r--support/dktools/dktools/help/en/winprint.htb (renamed from support/dktools/help-htb/en/winprint.htb)bin142007 -> 142514 bytes
-rw-r--r--support/dktools/dktools/help/en/wxbmpp.chmbin0 -> 479379 bytes
-rw-r--r--support/dktools/dktools/help/en/wxbmpp.htbbin0 -> 483200 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkclock.chmbin0 -> 84184 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkclock.htb (renamed from support/dktools/help-htb/en/wxdkclock.htb)bin85707 -> 86628 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkct.chmbin0 -> 91053 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkct.htb (renamed from support/dktools/help-htb/en/wxdkct.htb)bin90608 -> 91387 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkdraw.chmbin0 -> 358182 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkdraw.htbbin0 -> 380297 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkfcs.chmbin0 -> 32282 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkfcs.htbbin0 -> 34586 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkscrsz.chmbin0 -> 30697 bytes
-rw-r--r--support/dktools/dktools/help/en/wxdkscrsz.htbbin0 -> 30679 bytes
-rw-r--r--support/dktools/dktools/help/en/wximgsz.chmbin0 -> 61730 bytes
-rw-r--r--support/dktools/dktools/help/en/wximgsz.htbbin0 -> 61134 bytes
-rw-r--r--support/dktools/dktools/help/en/wxpqdic.chmbin0 -> 32124 bytes
-rw-r--r--support/dktools/dktools/help/en/wxpqdic.htbbin0 -> 33054 bytes
-rw-r--r--support/dktools/dktools/htmlbook/GNUmakefile48
-rw-r--r--support/dktools/dktools/htmlbook/chm.css20
-rw-r--r--support/dktools/dktools/htmlbook/chm.hbt2
-rw-r--r--support/dktools/dktools/htmlbook/home-i.pdfbin0 -> 1118 bytes
-rw-r--r--support/dktools/dktools/htmlbook/home.fig22
-rw-r--r--support/dktools/dktools/htmlbook/home.pdfbin0 -> 1698 bytes
-rw-r--r--support/dktools/dktools/htmlbook/home.pngbin1145 -> 1221 bytes
-rw-r--r--support/dktools/dktools/htmlbook/home.svg10
-rw-r--r--support/dktools/dktools/htmlbook/home.tex40
-rw-r--r--support/dktools/dktools/htmlbook/home.wxd11
-rwxr-xr-xsupport/dktools/dktools/htmlbook/htmlbook.sh157
-rw-r--r--support/dktools/dktools/htmlbook/index.fig24
-rw-r--r--support/dktools/dktools/htmlbook/index.html58
-rw-r--r--support/dktools/dktools/htmlbook/index.pdfbin0 -> 1854 bytes
-rw-r--r--support/dktools/dktools/htmlbook/index.pngbin1474 -> 1420 bytes
-rw-r--r--support/dktools/dktools/htmlbook/index.prj110
-rw-r--r--support/dktools/dktools/htmlbook/index.svg12
-rw-r--r--support/dktools/dktools/htmlbook/index.wxd12
-rw-r--r--support/dktools/dktools/htmlbook/installu.txt3
-rw-r--r--support/dktools/dktools/htmlbook/installw.txt3
-rw-r--r--support/dktools/dktools/htmlbook/instalus.txt4
-rw-r--r--support/dktools/dktools/htmlbook/instalux.txt4
-rw-r--r--support/dktools/dktools/htmlbook/math-img.pdfbin0 -> 15197 bytes
-rw-r--r--support/dktools/dktools/htmlbook/math-img.pngbin0 -> 1168 bytes
-rw-r--r--support/dktools/dktools/htmlbook/math-img.svg60
-rw-r--r--support/dktools/dktools/htmlbook/math-img.tex2
-rw-r--r--support/dktools/dktools/htmlbook/next.fig22
-rw-r--r--support/dktools/dktools/htmlbook/next.pdfbin0 -> 1699 bytes
-rw-r--r--support/dktools/dktools/htmlbook/next.pngbin1155 -> 1241 bytes
-rw-r--r--support/dktools/dktools/htmlbook/next.svg10
-rw-r--r--support/dktools/dktools/htmlbook/next.wxd11
-rw-r--r--support/dktools/dktools/htmlbook/old/GNUmakefile148
-rw-r--r--support/dktools/dktools/htmlbook/old/chm.hbt1
-rw-r--r--support/dktools/dktools/htmlbook/old/home-i.pdfbin0 -> 1118 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/home.pdfbin0 -> 1698 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/home.pngbin0 -> 1247 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/home.svg10
-rw-r--r--support/dktools/dktools/htmlbook/old/home.tex40
-rw-r--r--support/dktools/dktools/htmlbook/old/home.wxd11
-rwxr-xr-xsupport/dktools/dktools/htmlbook/old/htmlbook.sh154
-rw-r--r--support/dktools/dktools/htmlbook/old/index.html58
-rw-r--r--support/dktools/dktools/htmlbook/old/index.pdfbin0 -> 1854 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/index.pngbin0 -> 1591 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/index.prj192
-rw-r--r--support/dktools/dktools/htmlbook/old/index.svg12
-rw-r--r--support/dktools/dktools/htmlbook/old/index.wxd12
-rw-r--r--support/dktools/dktools/htmlbook/old/installu.txt3
-rw-r--r--support/dktools/dktools/htmlbook/old/installw.txt3
-rw-r--r--support/dktools/dktools/htmlbook/old/instalus.txt4
-rw-r--r--support/dktools/dktools/htmlbook/old/instalux.txt4
-rw-r--r--support/dktools/dktools/htmlbook/old/math-img.pdfbin0 -> 15197 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/math-img.pngbin0 -> 1168 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/math-img.svg60
-rw-r--r--support/dktools/dktools/htmlbook/old/math-img.tex34
-rw-r--r--support/dktools/dktools/htmlbook/old/next.pdfbin0 -> 1699 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/next.pngbin0 -> 1212 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/next.svg10
-rw-r--r--support/dktools/dktools/htmlbook/old/next.wxd11
-rw-r--r--support/dktools/dktools/htmlbook/old/prev.pdfbin0 -> 1696 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/prev.pngbin0 -> 1235 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/prev.svg10
-rw-r--r--support/dktools/dktools/htmlbook/old/prev.wxd11
-rw-r--r--support/dktools/dktools/htmlbook/old/startu.txt3
-rw-r--r--support/dktools/dktools/htmlbook/old/startw.txt3
-rw-r--r--support/dktools/dktools/htmlbook/old/style.css1271
-rw-r--r--support/dktools/dktools/htmlbook/old/toc.pdfbin0 -> 1753 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/toc.pngbin0 -> 1091 bytes
-rw-r--r--support/dktools/dktools/htmlbook/old/toc.svg17
-rw-r--r--support/dktools/dktools/htmlbook/old/toc.wxd31
-rw-r--r--support/dktools/dktools/htmlbook/old/web.hbt24
-rw-r--r--support/dktools/dktools/htmlbook/prev.fig22
-rw-r--r--support/dktools/dktools/htmlbook/prev.pdfbin0 -> 1696 bytes
-rw-r--r--support/dktools/dktools/htmlbook/prev.pngbin1150 -> 1227 bytes
-rw-r--r--support/dktools/dktools/htmlbook/prev.svg10
-rw-r--r--support/dktools/dktools/htmlbook/prev.wxd11
-rw-r--r--support/dktools/dktools/htmlbook/ptoc.js46
-rw-r--r--support/dktools/dktools/htmlbook/results.txt47
-rw-r--r--support/dktools/dktools/htmlbook/startu.txt3
-rw-r--r--support/dktools/dktools/htmlbook/startw.txt3
-rw-r--r--support/dktools/dktools/htmlbook/style.css1944
-rw-r--r--support/dktools/dktools/htmlbook/toc.fig36
-rw-r--r--support/dktools/dktools/htmlbook/toc.pdfbin0 -> 1753 bytes
-rw-r--r--support/dktools/dktools/htmlbook/toc.pngbin1091 -> 1267 bytes
-rw-r--r--support/dktools/dktools/htmlbook/toc.svg17
-rw-r--r--support/dktools/dktools/htmlbook/toc.wxd31
-rw-r--r--support/dktools/dktools/htmlbook/web.hbt51
-rw-r--r--support/dktools/dktools/itadmin/it-de.sql20
-rw-r--r--support/dktools/dktools/itadmin/it-latin1.sql22
-rw-r--r--support/dktools/dktools/itadmin/it-utf8.sql22
-rw-r--r--support/dktools/dktools/mime/dkrause-wxdkdraw.xml7
-rw-r--r--support/dktools/dktools/mime/wxdkdraw1
-rw-r--r--support/dktools/dktools/mime/wxdkdraw_64.pngbin0 -> 1722 bytes
-rw-r--r--support/dktools/dktools/print-snmp.conf3
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/c.wxd15
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-el-old.wxd12
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-el.wxd21
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-horiz.wxd14
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-variable-trim.wxd21
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-variable.wxd18
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/ANSI/diode.wxd15
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/diode.wxd13
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-backward.wxd18
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-breakdown.wxd18
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-capacitive.wxd19
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-diac.wxd14
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-led.wxd18
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-photo.wxd18
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-schottky.wxd14
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-shockley.wxd12
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-temparature-dependend.wxd30
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-tunnel.wxd14
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-zener.wxd13
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-depletion.wxd19
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement-source-on-substrate.wxd25
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement-substrate.wxd24
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement.wxd24
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-jfet.wxd16
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-depletion.wxd19
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-enhancement-substrate.wxd27
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-enhancement.wxd24
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-jfet.wxd16
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/ANSI/l.wxd30
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/l-coil.wxd19
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/l.wxd16
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/old/l-coil.wxd12
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/old/l.wxd9
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/OpAmp/old/opamp-old.wxd27
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/OpAmp/opamp.wxd29
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/ANSI/r-horiz.wxd13
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/ANSI/r.wxd13
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/r.wxd10
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-horiz.wxd10
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-photo.wxd16
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-poti-horiz.wxd13
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-poti-trim-horiz.wxd19
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-variable.wxd13
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/C/csrc-horiz.wxd17
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/C/csrc.wxd17
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/GND/gnd.wxd8
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/ANSI/v.wxd20
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/vsrc-horiz.wxd10
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/vsrc.wxd10
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/npn-discrete.wxd22
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/npn.wxd20
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/pnp-discrete.wxd22
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/pnp.wxd20
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and2.wxd17
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and3.wxd25
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and4.wxd28
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and5.wxd31
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and2.wxd18
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and3.wxd21
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and4.wxd24
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and5.wxd27
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand2.wxd20
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand3.wxd27
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand4.wxd30
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand5.wxd33
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand2.wxd19
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand3.wxd22
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand4.wxd26
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand5.wxd28
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor2.wxd24
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor3.wxd26
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor4.wxd29
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor5.wxd30
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor2.wxd19
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor3.wxd22
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor4.wxd25
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor5.wxd28
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOT/ANSI/not.wxd14
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOT/not.wxd16
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or2.wxd21
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or3.wxd24
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or4.wxd27
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or5.wxd28
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or2.wxd17
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or3.wxd20
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or4.wxd24
-rw-r--r--support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or5.wxd26
-rw-r--r--support/dktools/dktools/wxdkdraw/library/readme.txt9
-rw-r--r--support/dktools/dkwt-ac.c36
-rw-r--r--support/dktools/dkwt-ac.ctr2
-rw-r--r--support/dktools/dkwt-cp.c134
-rw-r--r--support/dktools/dkwt-cp.ctr54
-rw-r--r--support/dktools/dkwt-env.c58
-rw-r--r--support/dktools/dkwt-env.ctr20
-rw-r--r--support/dktools/dkwt-ev.c338
-rw-r--r--support/dktools/dkwt-ev.ctr74
-rw-r--r--support/dktools/dkwt-gr.c36
-rw-r--r--support/dktools/dkwt-gr.ctr2
-rw-r--r--support/dktools/dkwt-pr.c152
-rw-r--r--support/dktools/dkwt-pr.ctr42
-rw-r--r--support/dktools/dkwt-to.c198
-rw-r--r--support/dktools/dkwt-to.ctr76
-rw-r--r--support/dktools/dkwt.c86
-rw-r--r--support/dktools/dkwt.ctr34
-rw-r--r--support/dktools/dkwt.h13
-rw-r--r--support/dktools/dkwt.rc8
-rw-r--r--support/dktools/dkwtadm.rc8
-rw-r--r--support/dktools/dkwxpath.h6
-rw-r--r--support/dktools/dkwxpath.rc8
-rw-r--r--support/dktools/dkwxpqdc.h8
-rw-r--r--support/dktools/dkwxtrace.h7
-rw-r--r--support/dktools/dkwxwiz.c226
-rw-r--r--support/dktools/dkwxwiz.ctr86
-rw-r--r--support/dktools/dkwxwiz.icobin0 -> 4806 bytes
-rw-r--r--support/dktools/dkwxwiz.rc8
-rw-r--r--support/dktools/etc-dk3app/dk3paper.conf30
-rw-r--r--support/dktools/etc-dk4app/dk4gra.conf211
-rw-r--r--support/dktools/ex-sto.c36
-rw-r--r--support/dktools/ex-sto.ctr2
-rw-r--r--support/dktools/exit-program.xpm39
-rw-r--r--support/dktools/f2leps.c334
-rw-r--r--support/dktools/f2leps.ctr212
-rw-r--r--support/dktools/f2leps.h36
-rw-r--r--support/dktools/f2ll2l.c36
-rw-r--r--support/dktools/f2ll2l.ctr2
-rw-r--r--support/dktools/f2ll2l.h36
-rw-r--r--support/dktools/f2lopt.c150
-rw-r--r--support/dktools/f2lopt.ctr23
-rw-r--r--support/dktools/f2lopt.h36
-rw-r--r--support/dktools/f2lpara.c48
-rw-r--r--support/dktools/f2lpara.ctr12
-rw-r--r--support/dktools/f2lpara.h36
-rw-r--r--support/dktools/f2lpdf.c259
-rw-r--r--support/dktools/f2lpdf.ctr85
-rw-r--r--support/dktools/f2lpdf.h48
-rw-r--r--support/dktools/f2lpgf.c328
-rw-r--r--support/dktools/f2lpgf.ctr140
-rw-r--r--support/dktools/f2lpgf.h36
-rw-r--r--support/dktools/f2lsvg.c358
-rw-r--r--support/dktools/f2lsvg.ctr50
-rw-r--r--support/dktools/f2lsvg.h36
-rw-r--r--support/dktools/f2lsvgst.c710
-rw-r--r--support/dktools/f2lsvgst.ctr512
-rw-r--r--support/dktools/f2lsvgst.h86
-rw-r--r--support/dktools/f2lto.c173
-rw-r--r--support/dktools/f2lto.ctr113
-rw-r--r--support/dktools/f2lto.h88
-rw-r--r--support/dktools/f2lud.c439
-rw-r--r--support/dktools/f2lud.ctr23
-rw-r--r--support/dktools/f2lud.h36
-rw-r--r--support/dktools/f2ludpat.c36
-rw-r--r--support/dktools/f2ludpat.ctr2
-rw-r--r--support/dktools/f2ludpat.h36
-rw-r--r--support/dktools/fat-spline.wxd9
-rw-r--r--support/dktools/favicon.icobin21542 -> 0 bytes
-rwxr-xr-xsupport/dktools/fc27-build-rpm.sh76
-rwxr-xr-xsupport/dktools/fc27-prepare.sh29
-rwxr-xr-xsupport/dktools/fc28-prepare.sh29
-rw-r--r--support/dktools/fig2lat.c230
-rw-r--r--support/dktools/fig2lat.ctr31
-rw-r--r--support/dktools/fig2lat.h37
-rw-r--r--support/dktools/fig2lat.rc8
-rw-r--r--support/dktools/filelist.txt191
-rw-r--r--support/dktools/gra.h3228
-rw-r--r--support/dktools/gui-img/icons/GNUmakefile20
-rw-r--r--support/dktools/gui-img/icons/dkclock.icobin0 -> 21542 bytes
-rwxr-xr-xsupport/dktools/gui-img/icons/dkclock.pl70
-rw-r--r--support/dktools/gui-img/icons/dkclock.wxd36
-rw-r--r--support/dktools/gui-img/icons/dkclock.xpm55
-rw-r--r--support/dktools/gui-img/icons/dkctinst.icobin0 -> 21542 bytes
-rw-r--r--support/dktools/gui-img/icons/dkctinst.wxd12
-rw-r--r--support/dktools/gui-img/icons/dkctinst.xpm55
-rw-r--r--support/dktools/gui-img/icons/dkctunin.icobin0 -> 21542 bytes
-rw-r--r--support/dktools/gui-img/icons/dkctunin.wxd12
-rw-r--r--support/dktools/gui-img/icons/dkctunin.xpm55
-rw-r--r--support/dktools/gui-img/icons/dkicon.icobin0 -> 21542 bytes
-rw-r--r--support/dktools/gui-img/icons/dkicon.wxd12
-rw-r--r--support/dktools/gui-img/icons/dkicon.xpm55
-rw-r--r--support/dktools/gui-img/icons/dkwxwiz.icobin0 -> 4806 bytes
-rw-r--r--support/dktools/gui-img/icons/dkwxwiz.pdfbin0 -> 1410 bytes
-rw-r--r--support/dktools/gui-img/icons/dkwxwiz.wxd6
-rw-r--r--support/dktools/gui-img/icons/dkwxwiz.xpm41
-rw-r--r--support/dktools/gui-img/icons/wxdkdraw.icobin0 -> 21542 bytes
-rw-r--r--support/dktools/gui-img/icons/wxdkdraw.pdfbin0 -> 1532 bytes
-rw-r--r--support/dktools/gui-img/icons/wxdkdraw.wxd18
-rw-r--r--support/dktools/gui-img/icons/wxdkdraw.xpm55
-rw-r--r--support/dktools/gui-img/icons/wxdkdraw_64.pngbin0 -> 1722 bytes
-rw-r--r--support/dktools/gui-img/icons/wxdkscrsz.icobin0 -> 21542 bytes
-rw-r--r--support/dktools/gui-img/icons/wxdkscrsz.wxd19
-rw-r--r--support/dktools/gui-img/icons/wxdkscrsz.xpm55
-rw-r--r--support/dktools/gui-img/shared/dlg/GNUmakefile13
-rw-r--r--support/dktools/gui-img/shared/dlg/question.icobin0 -> 21542 bytes
-rw-r--r--support/dktools/gui-img/shared/dlg/question.wxd9
-rw-r--r--support/dktools/gui-img/shared/dlg/question.xpm54
-rw-r--r--support/dktools/gui-img/shared/toolbar/GNUmakefile13
-rw-r--r--support/dktools/gui-img/shared/toolbar/choose-dir.wxd17
-rw-r--r--support/dktools/gui-img/shared/toolbar/choose-dir.xpm36
-rw-r--r--support/dktools/gui-img/shared/toolbar/exit-program.wxd10
-rw-r--r--support/dktools/gui-img/shared/toolbar/exit-program.xpm33
-rw-r--r--support/dktools/gui-img/shared/toolbar/run-conversion.wxd7
-rw-r--r--support/dktools/gui-img/shared/toolbar/run-conversion.xpm33
-rw-r--r--support/dktools/gui-img/shared/toolbar/run2.wxd7
-rw-r--r--support/dktools/gui-img/shared/toolbar/run2.xpm33
-rw-r--r--support/dktools/gui-img/shared/toolbar/set-options-i.pdfbin0 -> 830 bytes
-rw-r--r--support/dktools/gui-img/shared/toolbar/set-options.tex50
-rw-r--r--support/dktools/gui-img/shared/toolbar/set-options.wxd9
-rw-r--r--support/dktools/gui-img/shared/toolbar/set-options.xpm32
-rw-r--r--support/dktools/gui-img/shared/toolbar/toolbase.wxd3
-rw-r--r--support/dktools/gui-img/shared/toolbar/toolbase.xpm23
-rw-r--r--support/dktools/gui-img/splash/GNUmakefile15
-rw-r--r--support/dktools/gui-img/splash/splash-disklessian.pngbin0 -> 9057 bytes
-rw-r--r--support/dktools/gui-img/splash/splash-disklessian.wxd33
-rw-r--r--support/dktools/gui-img/splash/splash-dktoolian.pngbin0 -> 14207 bytes
-rw-r--r--support/dktools/gui-img/splash/splash-dktoolian.wxd33
-rw-r--r--support/dktools/gui-img/splash/splash-surfian.pngbin0 -> 11481 bytes
-rw-r--r--support/dktools/gui-img/splash/splash-surfian.wxd36
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/GNUmakefile13
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/errors43
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-baddpoint.wxd16
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-baddpoint.xpm40
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bbox.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bbox.xpm36
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bbullet.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bbullet.xpm38
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bbulletf.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bbulletf.xpm43
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bcarc.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bcarc.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bcircle.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bcircle.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bcopy.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bcopy.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bdel.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bdel.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bdelpoint.wxd13
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bdelpoint.xpm40
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bdetails.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bdetails.xpm43
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bellipse.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bellipse.xpm38
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bfliph.wxd14
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bfliph.xpm36
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bflipv.wxd14
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bflipv.xpm35
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup.wxd13
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup.xpm42
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup2.wxd19
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup2.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup3.wxd19
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup3.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bimg.wxd27
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bimg.xpm39
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-blib.wxd19
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-blib.xpm38
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bmodifys.wxd30
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bmodifys.xpm42
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bmove.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bmove.xpm40
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bmvpoint.wxd17
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bmvpoint.xpm40
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-boarc.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-boarc.xpm39
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolygon.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolygon.xpm38
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolyline.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolyline.xpm38
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-brectangle.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-brectangle.xpm33
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-brotleft.wxd23
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-brotleft.xpm40
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-brotright.wxd23
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-brotright.xpm39
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineca.wxd26
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineca.xpm42
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineci.wxd26
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineci.xpm40
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoa.wxd19
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoa.xpm40
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoi.wxd19
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoi.xpm42
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-btext.wxd18
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-btext.xpm39
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bungroup.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-bungroup.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-borders.wxd25
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-borders.xpm39
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-open.wxd13
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-open.xpm37
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-save.wxd13
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-save.xpm36
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.wxd12
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.wxd14
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.xpm46
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.xpm45
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/GNUmakefile12
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/texput.log20
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn00.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn00.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn01.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn01.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn02.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn02.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn03.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn03.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn04.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn04.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn05.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn05.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn06.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn06.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn07.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn07.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn08.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn08.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn09.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn09.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn10.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn10.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn11.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn11.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn12.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn12.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn13.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn13.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn14.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn14.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn15.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn15.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn16.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn16.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn17.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn17.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn18.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn18.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn19.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn19.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn20.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn20.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn21.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn21.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn22.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn22.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn23.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn23.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn24.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn24.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn25.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn25.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn26.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn26.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn27.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn27.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn28.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn28.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn29.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn29.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn30.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn30.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.aux1
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn32.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn32.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn33.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn33.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn34.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/font-names/wxd-fn34.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/GNUmakefile10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as00.wxd6
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as00.xpm42
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as01.wxd10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as01.xpm49
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as02.wxd10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as02.xpm52
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as03.wxd10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as03.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as04.wxd14
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as04.xpm51
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as05.wxd14
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as05.xpm52
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as06.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as06.xpm54
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as07.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as07.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as08.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as08.xpm53
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as09.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as09.xpm53
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as10.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as10.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as11.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as11.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as12.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as12.xpm56
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as13.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as13.xpm56
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as14.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as14.xpm53
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as15.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as15.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as16.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as16.xpm56
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as17.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as17.xpm56
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as18.wxd8
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as18.xpm44
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as19.wxd8
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as19.xpm43
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as20.wxd10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as20.xpm44
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as21.wxd10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as21.xpm44
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as22.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as22.xpm45
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as23.wxd10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as23.xpm52
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as24.wxd10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as24.xpm47
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as25.wxd14
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as25.xpm52
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as26.wxd14
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as26.xpm53
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as27.wxd8
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as27.xpm52
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as28.wxd8
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as28.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as29.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-as29.xpm45
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs00.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs00.xpm42
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs01.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs01.xpm42
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs02.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs02.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs03.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs03.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs04.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs04.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs05.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs05.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs06.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs06.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs07.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs07.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs08.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs08.xpm54
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs09.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs09.xpm54
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs10.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs10.xpm45
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs11.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs11.xpm45
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs12.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs12.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs13.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs13.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs14.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs14.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs15.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs15.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs16.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs16.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs17.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs17.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs18.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs18.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs19.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs19.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs20.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs20.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs21.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs21.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs22.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs22.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs23.wxd5
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-fs23.xpm55
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-js1.wxd7
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-js1.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-js2.wxd7
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-js2.xpm49
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-js3.wxd7
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-js3.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-lc1.wxd22
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-lc1.xpm43
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-lc2.wxd22
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-lc2.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-lc3.wxd22
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-lc3.xpm43
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls1.wxd6
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls1.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls2.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls2.xpm42
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls3.wxd9
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls3.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls4.wxd11
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls4.xpm51
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls5.wxd10
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls5.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls6.wxd12
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ls6.xpm48
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ts00.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ts00.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ts01.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ts01.xpm41
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ts02.wxd15
-rw-r--r--support/dktools/gui-img/wxdkdraw/styles/wxd-ts02.xpm41
-rw-r--r--support/dktools/hbchm.c59
-rw-r--r--support/dktools/hbchm.ctr9
-rw-r--r--support/dktools/hbchm.h36
-rw-r--r--support/dktools/hbconf.c598
-rw-r--r--support/dktools/hbconf.ctr422
-rw-r--r--support/dktools/hbconf.h45
-rw-r--r--support/dktools/hbcont.c427
-rw-r--r--support/dktools/hbcont.ctr228
-rw-r--r--support/dktools/hbcont.h36
-rw-r--r--support/dktools/hbhtml.c1690
-rw-r--r--support/dktools/hbhtml.ctr519
-rw-r--r--support/dktools/hbhtml.h47
-rw-r--r--support/dktools/hbimgdim.c123
-rw-r--r--support/dktools/hbimgdim.ctr69
-rw-r--r--support/dktools/hbimgdim.h36
-rw-r--r--support/dktools/hbindex.c36
-rw-r--r--support/dktools/hbindex.ctr3
-rw-r--r--support/dktools/hbindex.h10
-rw-r--r--support/dktools/hbnode.c134
-rw-r--r--support/dktools/hbnode.ctr20
-rw-r--r--support/dktools/hbnode.h36
-rw-r--r--support/dktools/hbtool.c105
-rw-r--r--support/dktools/hbtool.ctr31
-rw-r--r--support/dktools/hbtool.h36
-rw-r--r--support/dktools/help-chm/de/winprint.chmbin159810 -> 0 bytes
-rw-r--r--support/dktools/help-chm/de/wxbmpp.chmbin213128 -> 0 bytes
-rw-r--r--support/dktools/help-chm/de/wxdkclock.chmbin85271 -> 0 bytes
-rw-r--r--support/dktools/help-chm/de/wxdkct.chmbin102122 -> 0 bytes
-rw-r--r--support/dktools/help-chm/de/wxdkfcs.chmbin32411 -> 0 bytes
-rw-r--r--support/dktools/help-chm/de/wxdkscrsz.chmbin30744 -> 0 bytes
-rw-r--r--support/dktools/help-chm/de/wximgsz.chmbin110141 -> 0 bytes
-rw-r--r--support/dktools/help-chm/de/wxpqdic.chmbin32521 -> 0 bytes
-rw-r--r--support/dktools/help-chm/en/winprint.chmbin141564 -> 0 bytes
-rw-r--r--support/dktools/help-chm/en/wxbmpp.chmbin201960 -> 0 bytes
-rw-r--r--support/dktools/help-chm/en/wxdkclock.chmbin83859 -> 0 bytes
-rw-r--r--support/dktools/help-chm/en/wxdkct.chmbin91148 -> 0 bytes
-rw-r--r--support/dktools/help-chm/en/wxdkfcs.chmbin32131 -> 0 bytes
-rw-r--r--support/dktools/help-chm/en/wxdkscrsz.chmbin30488 -> 0 bytes
-rw-r--r--support/dktools/help-chm/en/wximgsz.chmbin108103 -> 0 bytes
-rw-r--r--support/dktools/help-chm/en/wxpqdic.chmbin31873 -> 0 bytes
-rw-r--r--support/dktools/help-htb/de/wxbmpp.htbbin216533 -> 0 bytes
-rw-r--r--support/dktools/help-htb/de/wxdkfcs.htbbin34013 -> 0 bytes
-rw-r--r--support/dktools/help-htb/de/wxdkscrsz.htbbin30353 -> 0 bytes
-rw-r--r--support/dktools/help-htb/de/wximgsz.htbbin108978 -> 0 bytes
-rw-r--r--support/dktools/help-htb/de/wxpqdic.htbbin32950 -> 0 bytes
-rw-r--r--support/dktools/help-htb/en/wxbmpp.htbbin206219 -> 0 bytes
-rw-r--r--support/dktools/help-htb/en/wxdkfcs.htbbin33615 -> 0 bytes
-rw-r--r--support/dktools/help-htb/en/wxdkscrsz.htbbin30005 -> 0 bytes
-rw-r--r--support/dktools/help-htb/en/wximgsz.htbbin107354 -> 0 bytes
-rw-r--r--support/dktools/help-htb/en/wxpqdic.htbbin32252 -> 0 bytes
-rw-r--r--support/dktools/home.wxd11
-rw-r--r--support/dktools/htmlbook.c264
-rw-r--r--support/dktools/htmlbook.ctr127
-rw-r--r--support/dktools/htmlbook.h84
-rw-r--r--support/dktools/htmlbook.rc8
-rw-r--r--support/dktools/initd-printqd.in143
-rw-r--r--support/dktools/initd-rshdown.in78
-rwxr-xr-xsupport/dktools/instdir.sh26
-rw-r--r--support/dktools/itacomp.c43
-rw-r--r--support/dktools/itacomp.ctr7
-rw-r--r--support/dktools/itaconf.c192
-rw-r--r--support/dktools/itaconf.ctr37
-rw-r--r--support/dktools/itadata.c36
-rw-r--r--support/dktools/itadata.ctr2
-rw-r--r--support/dktools/itadhcp.c443
-rw-r--r--support/dktools/itadhcp.ctr254
-rw-r--r--support/dktools/itadmin.c278
-rw-r--r--support/dktools/itadmin.ctr107
-rw-r--r--support/dktools/itadmin.h66
-rw-r--r--support/dktools/itadmin.rc8
-rw-r--r--support/dktools/itaether.c36
-rw-r--r--support/dktools/itaether.ctr2
-rw-r--r--support/dktools/itahosts.c36
-rw-r--r--support/dktools/itahosts.ctr2
-rw-r--r--support/dktools/italic.c106
-rw-r--r--support/dktools/italic.ctr56
-rw-r--r--support/dktools/itamem.c47
-rw-r--r--support/dktools/itamem.ctr7
-rw-r--r--support/dktools/itamysql.c355
-rw-r--r--support/dktools/itamysql.ctr119
-rw-r--r--support/dktools/itanetd.c192
-rw-r--r--support/dktools/itanetd.ctr98
-rw-r--r--support/dktools/itange.c36
-rw-r--r--support/dktools/itange.ctr2
-rw-r--r--support/dktools/itareg.c47
-rw-r--r--support/dktools/itareg.ctr13
-rw-r--r--support/dktools/itatool.c43
-rw-r--r--support/dktools/itatool.ctr9
-rw-r--r--support/dktools/libdk4base.dox1
-rw-r--r--support/dktools/libdk4bif.dox17
-rw-r--r--support/dktools/libdk4bifap.dox7
-rw-r--r--support/dktools/libdk4c.dox14
-rw-r--r--support/dktools/libdk4gra.dox19
-rw-r--r--support/dktools/libdk4graa.dox15
-rw-r--r--support/dktools/libdk4ma.dox12
-rw-r--r--support/dktools/libdk4maioxd.dox39
-rw-r--r--support/dktools/libdk4pppt.dox7
-rw-r--r--support/dktools/libdk4wx.dox5
-rw-r--r--support/dktools/livesys-data/apt-disklessian-buster.txt2
-rw-r--r--support/dktools/livesys-data/apt-disklessian-jessie.txt2
-rw-r--r--support/dktools/livesys-data/apt-disklessian-stretch.txt2
-rw-r--r--support/dktools/livesys-data/apt-no-lo-recommended.txt (renamed from support/dktools/livesys-data/apt-pinning.txt)3
-rw-r--r--support/dktools/livesys-data/apt-pin-kernel.txt8
-rw-r--r--support/dktools/livesys-data/apt_pinning.txt2
-rw-r--r--support/dktools/livesys-data/conf-gnome-dconf-profile-user.txt3
-rw-r--r--support/dktools/livesys-data/conf-gnome-defaults.txt18
-rwxr-xr-xsupport/dktools/livesys-data/hook_autologin.txt18
-rw-r--r--support/dktools/livesys-data/hook_bootbeep.txt5
-rwxr-xr-xsupport/dktools/livesys-data/hook_etcfiles.txt18
-rwxr-xr-xsupport/dktools/livesys-data/livesys-build-kernel.sh13
-rwxr-xr-xsupport/dktools/livesys-data/livesys-repository.sh75
-rw-r--r--support/dktools/livesys-data/msg-nonfree.txt (renamed from support/dktools/livesys-data/msg_nonfree.txt)1
-rw-r--r--support/dktools/livesys-data/msg-wifi.txt4
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-base.txt73
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-cinnamon.txt31
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-firmware-gr.txt1
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-firmware.txt25
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-gnome.txt67
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-kde.txt31
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-lang-base.txt (renamed from support/dktools/livesys-data/pkg_lang_base.txt)0
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-libreoffice.txt31
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-lxde.txt21
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-lxqt.txt40
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-mate.txt32
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-buster-xfce.txt37
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-base.txt74
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-cinnamon.txt31
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-firmware.txt (renamed from support/dktools/livesys-data/pkg_firmware.txt)0
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-gnome.txt65
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-host.txt (renamed from support/dktools/livesys-data/pkg_local.txt)0
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-kde.txt29
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-lang-base.txt62
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-lang-desktop.txt (renamed from support/dktools/livesys-data/pkg_lang_desktop.txt)0
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-libreoffice.txt30
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-lxde.txt21
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-mate.txt31
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-jessie-xfce.txt39
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-base.txt74
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-cinnamon.txt31
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-firmware-gr.txt2
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-firmware.txt25
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-gnome.txt68
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-kde.txt31
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-lang-base.txt62
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-libreoffice.txt32
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-lxde.txt21
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-lxqt.txt40
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-mate.txt32
-rw-r--r--support/dktools/livesys-data/pkg-disklessian-stretch-xfce.txt37
-rw-r--r--support/dktools/livesys-data/pkg-dislessian-buster-host.txt24
-rw-r--r--support/dktools/livesys-data/pkg-dislessian-stretch-host.txt24
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-base.txt96
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-cinnamon.txt31
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-firmware-gr.txt1
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-firmware.txt25
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-gnome.txt67
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-host.txt24
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-kde.txt31
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-lang-base.txt62
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-lang-desktop.txt72
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-lxde.txt20
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-lxqt.txt40
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-mate.txt32
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-buster-xfce.txt38
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-base.txt (renamed from support/dktools/livesys-data/pkg_base.txt)11
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-cinnamon.txt31
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-firmware.txt24
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-gnome.txt65
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-host.txt23
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-kde.txt28
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-lang-base.txt62
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-lang-desktop.txt72
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-lxde.txt20
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-mate.txt31
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-jessie-xfce.txt (renamed from support/dktools/livesys-data/pkg_xfce.txt)0
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-base.txt98
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-cinnamon.txt31
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-firmware-gr.txt2
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-firmware.txt25
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-gnome.txt68
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-host.txt24
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-kde.txt31
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-lang-base.txt62
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-lang-desktop.txt72
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-lxde.txt20
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-lxqt.txt40
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-mate.txt32
-rw-r--r--support/dktools/livesys-data/pkg-dktoolian-stretch-xfce.txt38
-rw-r--r--support/dktools/livesys-data/pkg_disklessian-buster-lang-desktop.txt72
-rw-r--r--support/dktools/livesys-data/pkg_disklessian-stretch-lang-desktop.txt72
-rw-r--r--support/dktools/livesys-data/root-cli/usr/share/dktoolian/getty.sed1
-rwxr-xr-xsupport/dktools/livesys-data/root-create-repodir.sh3
-rwxr-xr-xsupport/dktools/livesys-data/root-install-packages.sh77
-rwxr-xr-xsupport/dktools/livesys-data/root/usr/local/bin/dktoolian-etc19
-rwxr-xr-xsupport/dktools/livesys-data/root/usr/local/bin/dktoolian-ntp2
-rw-r--r--support/dktools/livesys-data/root/usr/share/dklivesys/templates/ntp.conf (renamed from support/dktools/livesys-data/root/usr/share/dktoolian/ntp.conf.template)0
-rw-r--r--support/dktools/livesys-data/root/usr/share/dktoolian/etc-files.sed2
-rw-r--r--support/dktools/livesys-data/sed-buster-login-grub.txt2
-rw-r--r--support/dktools/livesys-data/sed-buster-login-iso.txt2
-rw-r--r--support/dktools/livesys-data/sed-isolinux-menu.txt1
-rw-r--r--support/dktools/livesys-data/sed-isolinux.txt (renamed from support/dktools/livesys-data/sed_isolinux.txt)0
-rw-r--r--support/dktools/livesys-data/sed-menu.txt (renamed from support/dktools/livesys-data/sed_menu.txt)0
-rw-r--r--support/dktools/livesys-data/sed-stretch-login-grub.txt2
-rw-r--r--support/dktools/livesys-data/sed-stretch-login-iso.txt2
-rw-r--r--support/dktools/livesys-data/sed_nobeep.txt1
-rw-r--r--support/dktools/lprngcl.c364
-rw-r--r--support/dktools/lprngcl.ctr100
-rw-r--r--support/dktools/lprngcl.rc8
-rw-r--r--support/dktools/makefile.vc376
-rw-r--r--support/dktools/man/man1/addctrld.18
-rw-r--r--support/dktools/man/man1/bmpp.1948
-rw-r--r--support/dktools/man/man1/dk-bin2c.1 (renamed from support/dktools/man/man1/wxdkct.1)119
-rw-r--r--support/dktools/man/man1/dk-blks.18
-rw-r--r--support/dktools/man/man1/dk-bmm.110
-rw-r--r--support/dktools/man/man1/dk-cat.18
-rw-r--r--support/dktools/man/man1/dk-db2t.18
-rw-r--r--support/dktools/man/man1/dk-dbco.18
-rw-r--r--support/dktools/man/man1/dk-eradisk.110
-rw-r--r--support/dktools/man/man1/dk-fic.18
-rw-r--r--support/dktools/man/man1/dk-hex.18
-rw-r--r--support/dktools/man/man1/dk-lines.1292
-rw-r--r--support/dktools/man/man1/dk-ls.112
-rw-r--r--support/dktools/man/man1/dk-pwd.18
-rw-r--r--support/dktools/man/man1/dk-pwgen.18
-rw-r--r--support/dktools/man/man1/dk-rand.18
-rw-r--r--support/dktools/man/man1/dk-recv.18
-rw-r--r--support/dktools/man/man1/dk-send.18
-rw-r--r--support/dktools/man/man1/dk-sort.18
-rw-r--r--support/dktools/man/man1/dk-sqlsplit.18
-rw-r--r--support/dktools/man/man1/dk-t2db.110
-rw-r--r--support/dktools/man/man1/dk-t2h.18
-rw-r--r--support/dktools/man/man1/dk-t2l.194
-rw-r--r--support/dktools/man/man1/dk-uid.18
-rw-r--r--support/dktools/man/man1/dk3info.18
-rw-r--r--support/dktools/man/man1/dk4info.18
-rw-r--r--support/dktools/man/man1/dkct.123
-rw-r--r--support/dktools/man/man1/dkdbt.110
-rw-r--r--support/dktools/man/man1/dktools.18
-rw-r--r--support/dktools/man/man1/dkwxwiz.110
-rw-r--r--support/dktools/man/man1/fig2lat.115
-rw-r--r--support/dktools/man/man1/htmlbook.18
-rw-r--r--support/dktools/man/man1/itaclean.16
-rw-r--r--support/dktools/man/man1/itadmin.138
-rw-r--r--support/dktools/man/man1/lprngcl.18
-rw-r--r--support/dktools/man/man1/pjsnmp.120
-rw-r--r--support/dktools/man/man1/plpdftex.1202
-rw-r--r--support/dktools/man/man1/printqd.110
-rw-r--r--support/dktools/man/man1/printqda.18
-rw-r--r--support/dktools/man/man1/printqdc.18
-rw-r--r--support/dktools/man/man1/printqdi.18
-rw-r--r--support/dktools/man/man1/prmonsnmp.18
-rw-r--r--support/dktools/man/man1/rshdown-init.1107
-rw-r--r--support/dktools/man/man1/rshdown.18
-rw-r--r--support/dktools/man/man1/wxbmpp.132
-rw-r--r--support/dktools/man/man1/wxd2lat.1232
-rw-r--r--support/dktools/man/man1/wxdkclock.18
-rw-r--r--support/dktools/man/man1/wxdkdraw.1107
-rw-r--r--support/dktools/man/man1/wxdkfcs.18
-rw-r--r--support/dktools/man/man1/wxdkhtb.18
-rw-r--r--support/dktools/man/man1/wximgsz.18
-rw-r--r--support/dktools/man/man1/wxpqdic.18
-rw-r--r--support/dktools/man/man5/dk3paper.conf.5754
-rw-r--r--support/dktools/man/man5/dk4gra.conf.5647
-rw-r--r--support/dktools/man/man5/dkct-wxgui.512
-rw-r--r--support/dktools/man/man5/dkct.571
-rw-r--r--support/dktools/man/man5/htmlbook-project.563
-rw-r--r--support/dktools/man/man5/htmlbook-template.58
-rw-r--r--support/dktools/man/man5/htmlbook-text.58
-rw-r--r--support/dktools/man/man5/printqd.conf.58
-rw-r--r--support/dktools/man/man5/printqd.db.58
-rw-r--r--support/dktools/man/man5/printqd.protocol.58
-rw-r--r--support/dktools/md-ls.txt143
-rwxr-xr-xsupport/dktools/mklivesys.sh4876
-rw-r--r--support/dktools/modsnmp.sed1
-rw-r--r--support/dktools/pjsnmp.c946
-rw-r--r--support/dktools/pjsnmp.ctr70
-rw-r--r--support/dktools/pjsnmp.h5
-rw-r--r--support/dktools/pkginfo2
-rw-r--r--support/dktools/plpdftex.c4407
-rw-r--r--support/dktools/plpdftex.ctr4031
-rw-r--r--support/dktools/plpdftex.h7
-rw-r--r--support/dktools/plpdftex.rc8
-rw-r--r--support/dktools/plptcol.c36
-rw-r--r--support/dktools/plptcol.ctr2
-rw-r--r--support/dktools/plptcol.h36
-rw-r--r--support/dktools/printqd.c1183
-rw-r--r--support/dktools/printqd.conf59
-rw-r--r--support/dktools/printqd.conf.sample9
-rw-r--r--support/dktools/printqd.ctr167
-rw-r--r--support/dktools/printqd.h36
-rw-r--r--support/dktools/printqd.service15
-rw-r--r--support/dktools/printqda.c36
-rw-r--r--support/dktools/printqda.ctr2
-rw-r--r--support/dktools/printqda.h36
-rw-r--r--support/dktools/printqdc.c234
-rw-r--r--support/dktools/printqdc.ctr68
-rw-r--r--support/dktools/printqds.h4
-rw-r--r--support/dktools/prmonsnmp.c192
-rw-r--r--support/dktools/prmonsnmp.ctr102
-rw-r--r--support/dktools/resources/GNUmakefile60
-rw-r--r--support/dktools/resources/choose-dir.fig20
-rw-r--r--support/dktools/resources/dkclock.fig27
-rw-r--r--support/dktools/resources/dkctinst.fig13
-rw-r--r--support/dktools/resources/dkctunin.fig13
-rw-r--r--support/dktools/resources/dkicon.fig13
-rw-r--r--support/dktools/resources/exit-program.fig18
-rw-r--r--support/dktools/resources/favicon.fig13
-rw-r--r--support/dktools/resources/run-conversion.fig13
-rw-r--r--support/dktools/resources/run2.fig13
-rw-r--r--support/dktools/resources/set-options.fig15
-rw-r--r--support/dktools/resources/splash-dktoolian.fig20
-rw-r--r--support/dktools/resources/toolbase.fig14
-rw-r--r--support/dktools/resources/wxdkscrsz.fig25
-rw-r--r--support/dktools/results.txt79
-rwxr-xr-xsupport/dktools/rshdown-init16
-rwxr-xr-xsupport/dktools/rshdown-rand7
-rw-r--r--support/dktools/rshdown.c429
-rw-r--r--support/dktools/rshdown.conf48
-rw-r--r--support/dktools/rshdown.conf.sample20
-rw-r--r--support/dktools/rshdown.ctr147
-rw-r--r--support/dktools/rshdown.service16
-rw-r--r--support/dktools/run-conversion.xpm39
-rw-r--r--support/dktools/run2.xpm31
-rwxr-xr-xsupport/dktools/scripts/build-debian-changelog.pl (renamed from support/dktools/scripts/create-debian-changelog.pl)36
-rwxr-xr-xsupport/dktools/scripts/build-distribution.sh (renamed from support/dktools/scripts/create-distribution.sh)138
-rwxr-xr-xsupport/dktools/scripts/build-doc.sh47
-rwxr-xr-xsupport/dktools/scripts/build-help.sh101
-rwxr-xr-x[-rw-r--r--]support/dktools/scripts/build-help.sh.in101
-rwxr-xr-x[-rw-r--r--]support/dktools/scripts/build-iss.sed (renamed from support/dktools/scripts/create-iss.sed)0
-rwxr-xr-xsupport/dktools/scripts/build-man.sh21
-rwxr-xr-xsupport/dktools/scripts/build-rc.pl (renamed from support/dktools/scripts/mkrc.pl)100
-rwxr-xr-xsupport/dktools/scripts/build-resources.sh61
-rwxr-xr-xsupport/dktools/scripts/build-spec-iss.sh82
-rwxr-xr-xsupport/dktools/scripts/build-version.sh71
-rwxr-xr-xsupport/dktools/scripts/check-config-have.pl66
-rwxr-xr-xsupport/dktools/scripts/check-filelist.pl56
-rwxr-xr-xsupport/dktools/scripts/check-headers-without-modules.sh29
-rwxr-xr-xsupport/dktools/scripts/check_config_have.pl98
-rwxr-xr-xsupport/dktools/scripts/clean-for-fig.sh43
-rwxr-xr-xsupport/dktools/scripts/clean-for-tex.sh40
-rwxr-xr-xsupport/dktools/scripts/clean-help-doc.sh40
-rwxr-xr-xsupport/dktools/scripts/clean-resources.sh40
-rwxr-xr-xsupport/dktools/scripts/clean-src.sh56
-rwxr-xr-xsupport/dktools/scripts/clean.sh88
-rw-r--r--support/dktools/scripts/create-desktop-files.sh.in133
-rwxr-xr-xsupport/dktools/scripts/create-spec-iss.sh78
-rwxr-xr-xsupport/dktools/scripts/distrenew.sh69
-rwxr-xr-xsupport/dktools/scripts/dkmkproto.pl36
-rwxr-xr-xsupport/dktools/scripts/doc-install.sh44
-rwxr-xr-xsupport/dktools/scripts/filechk.pl80
-rwxr-xr-xsupport/dktools/scripts/find-headers-without-modules.sh61
-rwxr-xr-xsupport/dktools/scripts/git-add.sh66
-rwxr-xr-xsupport/dktools/scripts/make-resources.sh44
-rwxr-xr-xsupport/dktools/scripts/man-install.sh44
-rwxr-xr-xsupport/dktools/scripts/show-dependencies.pl36
-rwxr-xr-xsupport/dktools/scripts/touch-files.sh15
-rwxr-xr-xsupport/dktools/scripts/transform-config.pl247
-rwxr-xr-xsupport/dktools/scripts/update-doxyfile.sh36
-rw-r--r--support/dktools/scripts/wr-dk3inst.sh.in106
-rw-r--r--support/dktools/scripts/wr-dk4inst.sh.in274
-rwxr-xr-xsupport/dktools/scripts/write-files.sh735
-rwxr-xr-xsupport/dktools/scripts/write-files.sh.in735
-rw-r--r--support/dktools/sddm.conf.example123
-rw-r--r--support/dktools/set-options.xpm38
-rw-r--r--support/dktools/sf-readme/readme.md115
-rwxr-xr-xsupport/dktools/sl7-prepare.sh28
-rw-r--r--support/dktools/splash-dktoolian.eps945
-rw-r--r--support/dktools/splash-dktoolian.pngbin6839 -> 6852 bytes
-rw-r--r--support/dktools/test-a85d.c148
-rw-r--r--support/dktools/test-a85d.ctr129
-rw-r--r--support/dktools/test-a85e.c134
-rw-r--r--support/dktools/test-a85e.ctr115
-rw-r--r--support/dktools/test-binenc.c45
-rw-r--r--support/dktools/test-binenc.ctr33
-rw-r--r--support/dktools/test-bool.c210
-rw-r--r--support/dktools/test-bool.ctr86
-rw-r--r--support/dktools/test-container.cpp142
-rw-r--r--support/dktools/test-container.cpt136
-rw-r--r--support/dktools/test-deldir.c132
-rw-r--r--support/dktools/test-deldir.ctr106
-rw-r--r--support/dktools/test-deldirwc.c29
-rw-r--r--support/dktools/test-deldirwc.ctr17
-rw-r--r--support/dktools/test-deltree.c132
-rw-r--r--support/dktools/test-deltree.ctr106
-rw-r--r--support/dktools/test-dk4c8dbl.c260
-rw-r--r--support/dktools/test-dk4c8dbl.ctr102
-rw-r--r--support/dktools/test-dk4dir.c141
-rw-r--r--support/dktools/test-dk4dir.ctr115
-rw-r--r--support/dktools/test-dk4dir08.c54
-rw-r--r--support/dktools/test-dk4dir08.ctr34
-rw-r--r--support/dktools/test-dk4enc.c41
-rw-r--r--support/dktools/test-dk4enc.ctr29
-rw-r--r--support/dktools/test-dk4exep8.c48
-rw-r--r--support/dktools/test-dk4exep8.ctr26
-rw-r--r--support/dktools/test-dk4loc.c86
-rw-r--r--support/dktools/test-dk4loc.ctr56
-rw-r--r--support/dktools/test-dk4maac.c110
-rw-r--r--support/dktools/test-dk4maac.ctr88
-rw-r--r--support/dktools/test-dk4maai.c109
-rw-r--r--support/dktools/test-dk4maai.ctr87
-rw-r--r--support/dktools/test-dk4maal.c109
-rw-r--r--support/dktools/test-dk4maal.ctr87
-rw-r--r--support/dktools/test-dk4maall.c109
-rw-r--r--support/dktools/test-dk4maall.ctr87
-rw-r--r--support/dktools/test-dk4maami.c109
-rw-r--r--support/dktools/test-dk4maami.ctr87
-rw-r--r--support/dktools/test-dk4maamu.c109
-rw-r--r--support/dktools/test-dk4maamu.ctr87
-rw-r--r--support/dktools/test-dk4maas.c109
-rw-r--r--support/dktools/test-dk4maas.ctr87
-rw-r--r--support/dktools/test-dk4maauc.c110
-rw-r--r--support/dktools/test-dk4maauc.ctr88
-rw-r--r--support/dktools/test-dk4maaui.c110
-rw-r--r--support/dktools/test-dk4maaui.ctr88
-rw-r--r--support/dktools/test-dk4maaul.c109
-rw-r--r--support/dktools/test-dk4maaul.ctr87
-rw-r--r--support/dktools/test-dk4maaull.c109
-rw-r--r--support/dktools/test-dk4maaull.ctr87
-rw-r--r--support/dktools/test-dk4maaus.c110
-rw-r--r--support/dktools/test-dk4maaus.ctr88
-rw-r--r--support/dktools/test-dk4mai8dbl.c35
-rw-r--r--support/dktools/test-dk4mai8dbl.ctr23
-rw-r--r--support/dktools/test-dk4mai8ddi.c52
-rw-r--r--support/dktools/test-dk4mai8ddi.ctr40
-rw-r--r--support/dktools/test-dk4mai8ddu.c52
-rw-r--r--support/dktools/test-dk4mai8ddu.ctr40
-rw-r--r--support/dktools/test-dk4mai8dsz.c52
-rw-r--r--support/dktools/test-dk4mai8dsz.ctr40
-rw-r--r--support/dktools/test-dk4mai8sz.c52
-rw-r--r--support/dktools/test-dk4numl.c36
-rw-r--r--support/dktools/test-dk4numl.ctr24
-rw-r--r--support/dktools/test-dk4path8.c54
-rw-r--r--support/dktools/test-dk4path8.ctr42
-rw-r--r--support/dktools/test-dk4str8.c60
-rw-r--r--support/dktools/test-dk4str8.ctr40
-rw-r--r--support/dktools/test-dk4strm.c89
-rw-r--r--support/dktools/test-dk4strm.ctr63
-rw-r--r--support/dktools/test-dk4strmco.c101
-rw-r--r--support/dktools/test-dk4strmco.ctr79
-rw-r--r--support/dktools/test-dk4time.c32
-rw-r--r--support/dktools/test-dk4time.ctr20
-rw-r--r--support/dktools/test-dk4time08.c32
-rw-r--r--support/dktools/test-dk4time08.ctr20
-rw-r--r--support/dktools/test-dk4tsp08.c191
-rw-r--r--support/dktools/test-dk4tsp08.ctr157
-rw-r--r--support/dktools/test-dk4user.c75
-rw-r--r--support/dktools/test-dk4user.ctr53
-rw-r--r--support/dktools/test-dk4wxah.cpp3
-rw-r--r--support/dktools/test-eradisk.c48
-rw-r--r--support/dktools/test-eradisk.ctr36
-rw-r--r--support/dktools/test-filei.c86
-rw-r--r--support/dktools/test-filei.ctr52
-rw-r--r--support/dktools/test-fne.c42
-rw-r--r--support/dktools/test-fne.ctr30
-rw-r--r--support/dktools/test-home.c58
-rw-r--r--support/dktools/test-home.ctr40
-rw-r--r--support/dktools/test-inet-pton.c133
-rw-r--r--support/dktools/test-inet-pton.ctr91
-rw-r--r--support/dktools/test-mbstr.c51
-rw-r--r--support/dktools/test-mbstr.ctr39
-rw-r--r--support/dktools/test-membuf.c60
-rw-r--r--support/dktools/test-membuf.ctr48
-rw-r--r--support/dktools/test-mkdir.c132
-rw-r--r--support/dktools/test-mkdir.ctr106
-rw-r--r--support/dktools/test-opt.c102
-rw-r--r--support/dktools/test-opt.ctr80
-rw-r--r--support/dktools/test-paper.c132
-rw-r--r--support/dktools/test-paper.ctr106
-rw-r--r--support/dktools/test-peer.c160
-rw-r--r--support/dktools/test-peer.ctr115
-rw-r--r--support/dktools/test-rld.c124
-rw-r--r--support/dktools/test-rld.ctr112
-rw-r--r--support/dktools/test-rle.c181
-rw-r--r--support/dktools/test-rle.ctr123
-rw-r--r--support/dktools/test-ser.c162
-rw-r--r--support/dktools/test-ser.ctr146
-rw-r--r--support/dktools/test-skip.c31
-rw-r--r--support/dktools/test-skip.ctr19
-rw-r--r--support/dktools/test-sock.c253
-rw-r--r--support/dktools/test-sock.ctr173
-rw-r--r--support/dktools/test-sqdbl.c51
-rw-r--r--support/dktools/test-sqdbl.ctr37
-rw-r--r--support/dktools/test-strms.c48
-rw-r--r--support/dktools/test-strms.ctr36
-rw-r--r--support/dktools/test-strmu.c116
-rw-r--r--support/dktools/test-strmu.ctr104
-rw-r--r--support/dktools/test-strmw.c360
-rw-r--r--support/dktools/test-strmw.ctr336
-rw-r--r--support/dktools/test-strt.str8
-rw-r--r--support/dktools/test-udpa.c99
-rw-r--r--support/dktools/test-udpa.ctr87
-rw-r--r--support/dktools/test-unser.c164
-rw-r--r--support/dktools/test-unser.ctr146
-rw-r--r--support/dktools/testlzw.c109
-rw-r--r--support/dktools/testlzw.ctr75
-rw-r--r--support/dktools/testlzws.c73
-rw-r--r--support/dktools/testlzws.ctr51
-rw-r--r--support/dktools/testread.cpp72
-rw-r--r--support/dktools/testread.cpt59
-rw-r--r--support/dktools/translate.vc7
-rw-r--r--support/dktools/uc2l.h162
-rw-r--r--support/dktools/version.txt2
-rw-r--r--support/dktools/w2llic.c379
-rw-r--r--support/dktools/w2llic.ctr392
-rw-r--r--support/dktools/w2llic.h50
-rw-r--r--support/dktools/win32/dk3conf.h160
-rw-r--r--support/dktools/win32/dk4conf.h757
-rw-r--r--support/dktools/win32/user32.iss31
-rw-r--r--support/dktools/win32/user64.iss31
-rw-r--r--support/dktools/win32/user64.iss.in21
-rw-r--r--support/dktools/winprint.h7
-rw-r--r--support/dktools/winprint.rc8
-rw-r--r--support/dktools/wprclean.c104
-rw-r--r--support/dktools/wprclean.ctr8
-rw-r--r--support/dktools/wprclean.h5
-rw-r--r--support/dktools/wprclean.rc8
-rw-r--r--support/dktools/wprclean2.c191
-rw-r--r--support/dktools/wprclean2.ctr53
-rw-r--r--support/dktools/wxbmeps.h7
-rw-r--r--support/dktools/wxbmpp.desktop2
-rw-r--r--support/dktools/wxbmpp.h241
-rw-r--r--support/dktools/wxbmpp.rc12
-rw-r--r--support/dktools/wxcs.cpp43
-rw-r--r--support/dktools/wxd-bgroup2.wxd18
-rw-r--r--support/dktools/wxd2lah.c3779
-rw-r--r--support/dktools/wxd2lah.ctr3599
-rw-r--r--support/dktools/wxd2lah.h87
-rw-r--r--support/dktools/wxd2lat.c1888
-rw-r--r--support/dktools/wxd2lat.ctr2142
-rw-r--r--support/dktools/wxd2lat.h299
-rw-r--r--support/dktools/wxd2lat.rc37
-rw-r--r--support/dktools/wxd2lout.c4092
-rw-r--r--support/dktools/wxd2lout.ctr3591
-rw-r--r--support/dktools/wxd2lout.h79
-rw-r--r--support/dktools/wxd2lxs.c615
-rw-r--r--support/dktools/wxd2lxs.ctr657
-rw-r--r--support/dktools/wxd2lxs.h138
-rw-r--r--support/dktools/wxdarc.c385
-rw-r--r--support/dktools/wxdarc.ctr393
-rw-r--r--support/dktools/wxdarc.h73
-rw-r--r--support/dktools/wxdcomp.c198
-rw-r--r--support/dktools/wxdcomp.ctr219
-rw-r--r--support/dktools/wxdcomp.h62
-rw-r--r--support/dktools/wxdenum.ctr423
-rw-r--r--support/dktools/wxdenum.h437
-rw-r--r--support/dktools/wxdkclock.desktop2
-rw-r--r--support/dktools/wxdkclock.h6
-rw-r--r--support/dktools/wxdkclock.rc8
-rw-r--r--support/dktools/wxdkct.desktop2
-rw-r--r--support/dktools/wxdkct.rc8
-rw-r--r--support/dktools/wxdkdraw.desktop10
-rw-r--r--support/dktools/wxdkdraw.h424
-rw-r--r--support/dktools/wxdkdraw.icobin0 -> 21542 bytes
-rw-r--r--support/dktools/wxdkdraw.rc37
-rw-r--r--support/dktools/wxdkfcs.desktop2
-rw-r--r--support/dktools/wxdkfcs.h17
-rw-r--r--support/dktools/wxdkfcs.rc8
-rw-r--r--support/dktools/wxdkhtb.h7
-rw-r--r--support/dktools/wxdkhtb.rc8
-rw-r--r--support/dktools/wxdkscrsz.h17
-rw-r--r--support/dktools/wxdkscrsz.icobin21542 -> 21542 bytes
-rw-r--r--support/dktools/wxdkscrsz.rc8
-rw-r--r--support/dktools/wxdkscrsz.xpm38
-rw-r--r--support/dktools/wxdobj.c469
-rw-r--r--support/dktools/wxdobj.ctr371
-rw-r--r--support/dktools/wxdobj.h83
-rw-r--r--support/dktools/wxdrd.c2827
-rw-r--r--support/dktools/wxdrd.ctr2691
-rw-r--r--support/dktools/wxdrd.h87
-rw-r--r--support/dktools/wxdstr.c67
-rw-r--r--support/dktools/wxdstr.ctr83
-rw-r--r--support/dktools/wxdstr.h50
-rw-r--r--support/dktools/wxdtypes.ctr304
-rw-r--r--support/dktools/wxdtypes.h318
-rw-r--r--support/dktools/wximgsz.desktop2
-rw-r--r--support/dktools/wximgsz.h239
-rw-r--r--support/dktools/wximgsz.rc8
-rw-r--r--support/dktools/wxpqdic.h5
-rw-r--r--support/dktools/wxpqdic.rc8
-rw-r--r--support/dktools/wxrdstr.str4
-rw-r--r--support/dktools/x.sed3
3459 files changed, 453112 insertions, 110728 deletions
diff --git a/support/dktools/Bmpp4App.cpp b/support/dktools/Bmpp4App.cpp
new file mode 100644
index 0000000000..822300d851
--- /dev/null
+++ b/support/dktools/Bmpp4App.cpp
@@ -0,0 +1,1134 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Bmpp4App.cpt
+*/
+
+/** @file Bmpp4App.cpp The Bmpp4App module.
+*/
+
+
+#line 151 "Bmpp4App.cpt"
+
+#include "wxbmpp.h"
+
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4PAPEA_H_INCLUDED
+#include "dk4papea.h"
+#endif
+
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#include "dk4strx.h"
+#endif
+
+
+
+
+
+#line 185 "Bmpp4App.cpt"
+
+
+
+/** Localized wxChar texts.
+*/
+static wxChar const * const wxbmpp_texts[] = {
+/* 0 */
+wxT("File"),
+
+/* 1 */
+wxT("Quit"),
+
+/* 2 */
+wxT("Exit the application"),
+
+/* 3 */
+wxT("Help"),
+
+/* 4 */
+wxT("About"),
+
+/* 5 */
+wxT("Show version information"),
+
+/* 6 */
+wxT("Contents"),
+
+/* 7 */
+wxT("Open table of contents"),
+
+/* 8 */
+wxT("Ready"),
+
+/* 9 */
+wxT("Copyright (c) "),
+
+/* 10 */
+wxT("About "),
+
+/* 11 */
+wxT("This program uses the following libraries:"),
+
+/* 12 */
+wxT("See:"),
+
+/* 13 */
+wxT("Make"),
+
+/* 14 */
+wxT("Avoid unnecessary conversions"),
+
+/* 15 */
+wxT("Color"),
+
+/* 16 */
+wxT("Produce colored output"),
+
+/* 17 */
+wxT("Output:"),
+
+/* 18 */
+wxT("PDF object"),
+
+/* 19 */
+wxT("PDF image"),
+
+/* 20 */
+wxT("PDF document"),
+
+/* 21 */
+wxT("EPS image"),
+
+/* 22 */
+wxT("PS image"),
+
+/* 23 */
+wxT("PS document"),
+
+/* 24 */
+wxT("Set output file type and intended purpose"),
+
+/* 25 */
+wxT("Interpolation"),
+
+/* 26 */
+wxT("Set image interpolation flag"),
+
+/* 27 */
+wxT("PS level:"),
+
+/* 28 */
+wxT("2"),
+
+/* 29 */
+wxT("3"),
+
+/* 30 */
+wxT("Choose the PS language level"),
+
+/* 31 */
+wxT("DSC"),
+
+/* 32 */
+wxT("Write DSC comments to PS output"),
+
+/* 33 */
+wxT("LZW"),
+
+/* 34 */
+wxT("Allow LZW compression in PS level 2 output"),
+
+/* 35 */
+wxT("JPEG DCT data"),
+
+/* 36 */
+wxT("Directly re-use DCT encoded data from JPEG files"),
+
+/* 37 */
+wxT("Paper size:"),
+
+/* 38 */
+wxT("Specify paper size"),
+
+/* 39 */
+wxT("Rotation"),
+
+/* 40 */
+wxT("Allow image rotation for better page fitting"),
+
+/* 41 */
+wxT("DCT interpolation"),
+
+/* 42 */
+wxT("Allow image interpolation for directly re-used DCT data from JPEG files"),
+
+/* 43 */
+wxT("Finishing:"),
+
+/* 44 */
+wxT("Single side"),
+
+/* 45 */
+wxT("Duplex"),
+
+/* 46 */
+wxT("Duplex+Tumble"),
+
+/* 47 */
+wxT("Choose single side printing or duplex printing like a book or calendar"),
+
+/* 48 */
+wxT("Analyze bit depth"),
+
+/* 49 */
+wxT("Attempt to reduce the number of bits per component"),
+
+/* 50 */
+wxT("Resolution:"),
+
+/* 51 */
+wxT("How to handle image resolution (use information from file, ignore or specify)"),
+
+/* 52 */
+wxT("from file"),
+
+/* 53 */
+wxT("ignore"),
+
+/* 54 */
+wxT("specify"),
+
+/* 55 */
+wxT("72.0"),
+
+/* 56 */
+wxT(""),
+
+/* 57 */
+wxT("Analyze color use"),
+
+/* 58 */
+wxT("Analyze use of colors, switch output to gray if no colors used"),
+
+/* 59 */
+wxT("Background:"),
+
+/* 60 */
+wxT("Choose a background color"),
+
+/* 61 */
+wxT("Enforce background"),
+
+/* 62 */
+wxT("Use specified background color even if the input file provides a background"),
+
+/* 63 */
+wxT("Analyze alpha"),
+
+/* 64 */
+wxT("Analyze alpha channel data"),
+
+/* 65 */
+wxT("Choose directory"),
+
+/* 66 */
+wxT("Choose directory containing the images to convert"),
+
+/* 67 */
+wxT("Conversion"),
+
+/* 68 */
+wxT("Run"),
+
+/* 69 */
+wxT("Run conversion"),
+
+/* 70 */
+wxT("No directory specified yet!"),
+
+/* 71 */
+wxT("Choose directory"),
+
+/* 72 */
+wxT("Extras"),
+
+/* 73 */
+wxT("Reset options"),
+
+/* 74 */
+wxT("Reset options - are you sure?"),
+
+/* 75 */
+wxT("Do you really want to reset all options to default values?"),
+
+/* 76 */
+wxT("Luma BT.601"),
+
+/* 77 */
+wxT("Luma short"),
+
+/* 78 */
+wxT("Luma BT.709"),
+
+/* 79 */
+wxT("fast"),
+
+/* 80 */
+wxT("faster"),
+
+/* 81 */
+wxT("average"),
+
+/* 82 */
+wxT("desaturation"),
+
+/* 83 */
+wxT("decomposition (min)"),
+
+/* 84 */
+wxT("decomposition (med)"),
+
+/* 85 */
+wxT("decomposition (max)"),
+
+/* 86 */
+wxT("red"),
+
+/* 87 */
+wxT("green"),
+
+/* 88 */
+wxT("blue"),
+
+/* 89 */
+wxT("RGB to gray:"),
+
+/* 90 */
+wxT("Choose method for RGB to gray conversions"),
+
+/* 91 */
+wxT("Success, application will exit."),
+
+/* 92 */
+wxT("Error, application will exit."),
+
+/* 93 */
+wxT("Reading image from file."),
+
+/* 94 */
+wxT("Generating output."),
+
+/* 95 */
+wxT("Writing output file."),
+
+/* 96 */
+wxT("Cancel"),
+
+/* 97 */
+wxT("Abort processing"),
+
+/* 98 */
+wxT("Conversion progress"),
+
+/* 99 */
+wxT("Not enough memory!\n"),
+
+/* 100 */
+wxT("No files found in directory!\n"),
+
+/* 101 */
+wxT("Finished."),
+
+/* 102 */
+wxT("Error"),
+
+/* 103 */
+wxT("Internal error (bug): No argv[0] argument found!"),
+
+/* 104 */
+wxT("Internal error (bug): Application group name not found!"),
+
+/* 105 */
+wxT("Illegal characters in language/options string!"),
+
+/* 106 */
+wxT("Failed to parse command line options!"),
+
+/* 107 */
+wxT("Too many paper sizes configured!"),
+
+/* 108 */
+wxT("Illegal character(s) in paper size names!"),
+
+/* 109 */
+wxT("Internal error (bug): Paper size without a name!"),
+
+/* 110 */
+wxT("Failed to obtain paper size information!"),
+
+/* 111 */
+wxT("Paper size not correctly configured!"),
+
+/* 112 */
+wxT("Not enough memory (RAM)!\n"),
+
+/* 113 */
+wxT(":\nERROR: Illegal character(s) in file name!\n"),
+
+/* 114 */
+wxT(":\nERROR: File name too long!\n"),
+
+/* 115 */
+wxT(":\nERROR: Empty directory\n"),
+
+/* 116 */
+wxT(":\nERROR: Not enough memory!\n"),
+
+/* 117 */
+wxT(":\nERROR: Failed to read image from file!\n"),
+
+/* 118 */
+wxT(":\nERROR: Failed to open graphics output!\n"),
+
+/* 119 */
+wxT(":\nERROR: Failed to select frame!\n"),
+
+/* 120 */
+wxT(":\nERROR: Failed to write graphics output to file!\n"),
+
+/* 121 */
+wxT("Aborted by user."),
+
+/* 122 */
+wxT("Reset all options to default values"),
+
+NULL
+
+
+#line 532 "Bmpp4App.cpt"
+};
+
+
+
+/** Non-localized wxChar texts.
+*/
+static wxChar const * const wxbmpp_nl_wx[] = {
+/* 0 */
+wxT("wxbmpp"),
+
+/* 1 */
+wxT("1.0.0"),
+
+/* 2 */
+wxT("Dirk Krause"),
+
+/* 3 */
+wxT("DKrause"),
+
+/* 4 */
+wxT("aaaaa"),
+
+/* 5 */
+wxT(""),
+
+/* 6 */
+wxT(""),
+
+/* 7 */
+wxT(" "),
+
+/* 8 */
+wxT("\n"),
+
+/* 9 */
+wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."),
+
+/* 10 */
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
+
+/* 11 */
+wxT("http://www.wxwidgets.org"),
+
+/* 12 */
+wxT("http://www.libpng.org/pub/png/libpng.html"),
+
+/* 13 */
+wxT("http://www.ijg.org"),
+
+/* 14 */
+wxT("http://www.remotesensing.org/libtiff"),
+
+/* 15 */
+wxT("http://www.zlib.net"),
+
+/* 16 */
+wxT("Error"),
+
+/* 17 */
+wxT("Not enough memory (RAM)!"),
+
+NULL
+
+
+#line 592 "Bmpp4App.cpt"
+};
+
+
+
+/** Non-localized dkChar texts.
+*/
+static dkChar const * const wxbmpp_nl_dk[] = {
+/* 0 */
+dkT("dktools"),
+
+/* 1 */
+dkT("wxbmpp4.str"),
+
+/* 2 */
+dkT("wxbmpp.chm"),
+
+/* 3 */
+dkT("wxbmpp.htb"),
+
+/* 4 */
+dkT("dummy.txt"),
+
+NULL
+
+
+#line 621 "Bmpp4App.cpt"
+};
+
+
+
+/** Empty dummy text for help text and license file for application.
+*/
+static dkChar const * dummy_text[] = {
+NULL
+
+
+#line 630 "Bmpp4App.cpt"
+};
+
+
+static dkChar const versno_dk[] = { DKT_VERSION_DK };
+
+
+/** Implementation of the wxApp functionality.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(Bmpp4App);
+#else
+IMPLEMENT_APP(Bmpp4App)
+#endif
+
+
+bool
+Bmpp4App::OnInit()
+{
+ Bmpp4Frame *frame = NULL;
+ wxChar const * const *localizedTexts = NULL;
+ wxPNGHandler *phPng = NULL;
+ wxXPMHandler *phXpm = NULL;
+ wxICOHandler *phIco = NULL;
+ wxArchiveFSHandler *phArchiveFS = NULL;
+ bool back = false;
+
+
+
+#line 658 "Bmpp4App.cpt"
+
+ /* Initialize members.
+ */
+ pAh = NULL;
+ pHc = NULL;
+ bRestoreGx = true;
+ bRestoreMake = true;
+ bRestoreLocation = true;
+ bMakeMode = false;
+ bAutorun = false;
+ pPaperSizes = NULL;
+ pasPaperSizes = NULL;
+ pDirname = NULL;
+ szPaperSizes = 0;
+ dk4gra_conf_init(&graconf);
+
+ /* __CHANGE__ 009: Initialize further members here.
+ */
+
+ /* Set up helper object.
+ */
+ pAh = new Dk4WxApplicationHelper();
+ if (NULL == pAh) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pAh->Initialize(argv[0], wxbmpp_nl_wx[3], wxbmpp_nl_dk[0]))) {
+ goto finished;
+ }
+
+ /* Add image and file system handlers for online help.
+ */
+ phPng = new wxPNGHandler();
+ if (NULL != phPng) {
+ wxImage::AddHandler(phPng);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phXpm = new wxXPMHandler();
+ if (NULL != phXpm) {
+ wxImage::AddHandler(phXpm);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phIco = new wxICOHandler();
+ if (NULL != phIco) {
+ wxImage::AddHandler(phIco);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phArchiveFS = new wxArchiveFSHandler();
+ if (NULL != phArchiveFS) {
+ wxFileSystem::AddHandler(phArchiveFS);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Set up help controller.
+ */
+ pHc = new Dk4WxHelpController();
+ if (NULL == pHc) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pHc->Initialize(pAh, wxbmpp_nl_dk[2], wxbmpp_nl_dk[3]))) {
+ goto finished;
+ }
+
+ /* Attempt to obtain localized texts in users preferred language.
+ */
+ localizedTexts = pAh->GetStringTable(wxbmpp_nl_dk[1], wxbmpp_texts);
+ if(!(localizedTexts)) {
+ localizedTexts = wxbmpp_texts;
+ }
+
+ /* Find list of paper sizes and process options.
+ */
+
+#line 746 "Bmpp4App.cpt"
+ pasPaperSizes = new wxArrayString();
+ if (NULL == pasPaperSizes) {
+
+#line 748 "Bmpp4App.cpt"
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+#line 751 "Bmpp4App.cpt"
+ if (!ProcessOptionsAndInitializeComponents(localizedTexts)) {
+
+
+#line 753 "Bmpp4App.cpt"
+ goto finished;
+ }
+
+#line 755 "Bmpp4App.cpt"
+
+ /* Create and show frame.
+ */
+ frame = new Bmpp4Frame(
+ Bmpp4Frame_MainWindow,
+ pAh,
+ pHc,
+ localizedTexts,
+ wxbmpp_nl_wx,
+ wxbmpp_nl_dk,
+ &graconf,
+ pasPaperSizes,
+ pDirname,
+ szPaperSizes,
+ bRestoreGx,
+ bRestoreMake,
+ bRestoreLocation,
+ bMakeMode,
+ bAutorun,
+ pPaperSizes
+ );
+ if(!(frame)) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Show frame, restore position and indicate success.
+ */
+ frame->RestoreSettings();
+ frame->CorrectGUI();
+ frame->RestorePosition();
+ frame->Show();
+ back = true;
+
+ /* Release resources if initialization failed.
+ */
+ finished:
+ if(!(back)) {
+ if (NULL != pPaperSizes) {
+ dk4mem_free(pPaperSizes);
+ pPaperSizes = NULL;
+ }
+ if (NULL != pDirname) {
+
+#line 798 "Bmpp4App.cpt"
+ dk4mem_free(pDirname);
+ pDirname = NULL;
+ }
+ if (NULL != pasPaperSizes) {
+
+#line 802 "Bmpp4App.cpt"
+ delete(pasPaperSizes);
+ pasPaperSizes = NULL;
+
+#line 804 "Bmpp4App.cpt"
+ }
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+ }
+
+
+#line 813 "Bmpp4App.cpt"
+ return back;
+}
+
+
+
+int
+Bmpp4App::OnExit()
+{
+ int back = 0;
+
+
+
+#line 824 "Bmpp4App.cpt"
+
+ /* __CHANGE__ 009: Release resources allocated by further members.
+ */
+
+ /* Release resources.
+ */
+ if (NULL != pPaperSizes) {
+
+#line 831 "Bmpp4App.cpt"
+ dk4mem_free(pPaperSizes);
+ }
+ if (NULL != pDirname) {
+
+#line 834 "Bmpp4App.cpt"
+ dk4mem_free(pDirname);
+
+#line 835 "Bmpp4App.cpt"
+ }
+ if (NULL != pasPaperSizes) {
+
+#line 837 "Bmpp4App.cpt"
+ delete(pasPaperSizes);
+ pasPaperSizes = NULL;
+
+#line 839 "Bmpp4App.cpt"
+ }
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+
+ /* __CHANGE__ 010: Set exit status code.
+ */
+
+
+#line 850 "Bmpp4App.cpt"
+ return back;
+}
+
+
+
+void
+Bmpp4App::ShowMemoryErrorMessage(void)
+{
+ const wxChar *s_title = NULL;
+ const wxChar *s_text = NULL;
+
+ if (NULL != pAh) {
+ s_title = pAh->GetBasicString(6);
+ s_text = pAh->GetBasicString(7);
+ }
+ if (NULL == s_title) {
+ s_title = wxbmpp_nl_wx[16];
+ }
+ if (NULL == s_text) {
+ s_text = wxbmpp_nl_wx[17];
+ }
+ wxMessageBox(s_text, s_title, (wxOK | wxCENTRE | wxICON_ERROR));
+}
+
+
+
+bool
+Bmpp4App::ProcessOptionsAndInitializeComponents(
+ wxChar const * const *localizedTexts
+)
+{
+ dkChar *margv[4];
+ dk4_app_t *app = NULL;
+ dkChar *argv0 = NULL;
+ dkChar const *pahargv0 = NULL;
+ dkChar const *grname = NULL;
+ bool back = false;
+
+
+#line 888 "Bmpp4App.cpt"
+ pahargv0 = pAh->GetDkArgv0();
+ if (NULL == pahargv0) {
+
+#line 890 "Bmpp4App.cpt"
+ /* ERROR: No argv[0] */
+ wxMessageBox(
+ localizedTexts[103], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ goto finished;
+ }
+
+#line 897 "Bmpp4App.cpt"
+ argv0 = dk4str_dup(pahargv0, NULL);
+ if (NULL == argv0) {
+
+#line 899 "Bmpp4App.cpt"
+ /* ERROR: Memory */
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+#line 903 "Bmpp4App.cpt"
+ grname = pAh->GetDkGroupName();
+ if (NULL == grname) {
+
+#line 905 "Bmpp4App.cpt"
+ /* ERROR: No group name */
+ wxMessageBox(
+ localizedTexts[104], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ goto finished;
+ }
+
+#line 912 "Bmpp4App.cpt"
+ margv[0] = argv0;
+ margv[1] = NULL;
+ app = dk4app_open_silent(
+ 1, margv, NULL, 0, grname, versno_dk, wxbmpp_nl_dk[4],
+ dummy_text, dummy_text
+ );
+ if (NULL == app) {
+
+#line 919 "Bmpp4App.cpt"
+ /* ERROR: No app */
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+#line 923 "Bmpp4App.cpt"
+ back = ProcessOptions(app, localizedTexts);
+
+ finished:
+ if (NULL != app) {
+ dk4app_close(app);
+ }
+ if (NULL != argv0) {
+ dk4mem_free(argv0);
+ }
+
+
+#line 933 "Bmpp4App.cpt"
+ return back;
+}
+
+
+
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
+static const wxCmdLineEntryDesc wxbmpp_cmd_line_desc[] = {
+ {
+ wxCMD_LINE_OPTION,
+ wxT_2("l"),
+ wxT_2("language"),
+ wxT_2("Choose output language"),
+ wxCMD_LINE_VAL_STRING
+ },
+ {
+ wxCMD_LINE_SWITCH,
+ wxT_2("m"),
+ wxT_2("make"),
+ wxT_2("Run in make mode")
+ },
+ {
+ wxCMD_LINE_PARAM,
+ NULL,
+ NULL,
+ wxT_2("input file"),
+ wxCMD_LINE_VAL_STRING,
+ wxCMD_LINE_PARAM_OPTIONAL
+ },
+ { wxCMD_LINE_NONE }
+};
+
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
+
+
+bool
+Bmpp4App::ProcessOptions(dk4_app_t *app, wxChar const * const *localizedTexts)
+{
+ dkChar cobu[DK4_MAX_PATH];
+ wxChar buf[256];
+ wxString sLanguage(wxT(""));
+ dk4_paper_size_collection_t *pscoll = NULL;
+ dk4_paper_size_t const *paps = NULL;
+ wxChar const *ptr = NULL;
+ size_t i;
+ int res = -1;
+ bool back = false;
+
+
+#line 987 "Bmpp4App.cpt"
+ {
+ wxCmdLineParser parser(wxbmpp_cmd_line_desc, argc, argv);
+ {
+ wxLogNull log;
+ res = parser.Parse(false);
+ }
+ if (0 == res) {
+ back = true;
+ if(parser.Found(wxT("l"), &sLanguage)) {
+ bRestoreGx = false;
+ bRestoreMake = false;
+ bAutorun = true;
+ wxCStrData sLanguageData = sLanguage.c_str();
+ ptr = (wxChar const *)sLanguageData;
+ if (NULL != ptr) {
+ if (pAh->StringToDk(cobu, DK4_MAX_PATH, ptr, NULL)) {
+ (void)dk4gra_conf_setup(
+ &graconf, cobu, 1, DK4_GRA_CONF_SCOPE_BMPP, app
+ );
+ }
+ else {
+ /* ERROR: Conversion to dkChar string failed */
+ wxMessageBox(
+ localizedTexts[105], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ back = false;
+ goto finished;
+ }
+ }
+ else {
+ /* ERROR: No c_str (can not happen) */
+ back = false;
+ goto finished;
+ }
+ }
+ if(parser.Found(wxT("m"))) {
+ bMakeMode = true;
+ }
+ if(parser.GetParamCount() > 0) {
+ wxString cmdfn = parser.GetParam(0);
+ wxFileName fn(cmdfn);
+ fn.Normalize(
+ wxPATH_NORM_LONG | wxPATH_NORM_DOTS
+ | wxPATH_NORM_TILDE | wxPATH_NORM_ABSOLUTE
+ );
+#if 0
+ /* 2018-04-04 Change
+ Whenever wxbmpp is called with -l option the program
+ starts a conversion automatically, now for both
+ directories and single files.
+ */
+ if (!(fn.FileExists())) {
+ bAutorun = false;
+ }
+#endif
+ cmdfn = fn.GetFullPath();
+ wxCStrData fnstrdata = cmdfn.c_str();
+ ptr = (wxChar const *)fnstrdata;
+ if (NULL != ptr) {
+ pDirname = dk4strx_dup(ptr, NULL);
+ if (NULL != pDirname) {
+ bRestoreLocation = false;
+ }
+ else {
+ /* ERROR: Memory */
+ ShowMemoryErrorMessage();
+ back = false;
+ goto finished;
+ }
+ }
+ }
+ else {
+ bAutorun = false;
+ }
+ }
+ else {
+ /* ERROR: In command line options */
+ wxMessageBox(
+ localizedTexts[106], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ goto finished;
+ }
+ }
+ pscoll = dk4app_get_paper_sizes(app);
+ if (NULL != pscoll) {
+ dk4papersize_coll_reset(pscoll);
+ do {
+ paps = dk4papersize_coll_next(pscoll);
+ if (NULL != paps) {
+ if (NULL != paps->name) {
+
+#line 1079 "Bmpp4App.cpt"
+ if (
+ pAh->StringToWx(
+ buf, DK4_SIZEOF(buf,wxChar), paps->name, NULL
+ )
+ ) {
+ if (SIZE_MAX > szPaperSizes) {
+ pasPaperSizes->Add(buf);
+ szPaperSizes += 1;
+ }
+ else {
+ /* ERROR: Too many paper sizes */
+ wxMessageBox(
+ localizedTexts[107], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ back = false;
+ }
+ }
+ else {
+ /* ERROR: Failed to convert to wx */
+ wxMessageBox(
+ localizedTexts[108], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ back = false;
+ }
+ }
+ else {
+ /* ERROR: Paper size with no name (bug) */
+ wxMessageBox(
+ localizedTexts[109], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ } while((NULL != paps) && (back));
+ if ((0 < szPaperSizes) && (back)) {
+ pPaperSizes = dk4mem_new(dk4_paper_size_t,szPaperSizes,NULL);
+ for (i = 0; i < szPaperSizes; i++) {
+ pPaperSizes[i].name = NULL;
+ pPaperSizes[i].name = NULL;
+ pPaperSizes[i].w = 595.0;
+ pPaperSizes[i].h = 842.0;
+ pPaperSizes[i].i = 56.0;
+ pPaperSizes[i].o = 28.0;
+ pPaperSizes[i].b = 14.0;
+ pPaperSizes[i].t = 14.0;
+ }
+ if (NULL != pPaperSizes) {
+ dk4papersize_coll_reset(pscoll);
+ i = 0;
+ do {
+ paps = dk4papersize_coll_next(pscoll);
+ if (NULL != paps) {
+ DK4_MEMCPY(&(pPaperSizes[i]),paps,sizeof(dk4_paper_size_t));
+ pPaperSizes[i].name = NULL;
+ }
+ i++;
+ } while((NULL != paps) && (i < szPaperSizes));
+ }
+ else {
+ /* ERROR: Memory */
+ ShowMemoryErrorMessage();
+ back = false;
+ }
+ }
+ dk4papersize_coll_close(pscoll);
+
+
+#line 1147 "Bmpp4App.cpt"
+ }
+ else {
+ /* ERROR: Failed to obtain paper sizes collection */
+ wxMessageBox(
+ localizedTexts[110], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ back = false;
+ }
+
+ finished:
+
+
+#line 1159 "Bmpp4App.cpt"
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Bmpp4App.cpt b/support/dktools/Bmpp4App.cpt
new file mode 100644
index 0000000000..30b1792401
--- /dev/null
+++ b/support/dktools/Bmpp4App.cpt
@@ -0,0 +1,1166 @@
+%% options
+
+copyright owner = Dirk Krause
+
+copyright year = 2018-xxxx
+
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file Bmpp4App.h The Bmpp4App class.
+*/
+
+/* The program may be invoked in 2 variants
+
+ wxbmpp [<directory>]
+ * NO -l OPTION SPECIFIED, RUN AS NORMAL GUI APPLICATION
+ * Restore all settings made in the GUI previously
+ * Restore directory if not specified on command line
+ * Do not run automatically
+ * Save directory if not specified on command line
+ * Save all settings made in the GUI
+ * When running retrieve current settings from GUI
+
+ wxbmpp -l<driver>[.language],... [<file>]
+ * WITH -l OPTION AUTOMATICALLY START CONVERSION FOR SPECIFIED FILE
+ * Do not restore settings
+ * Apply settings in the -l option
+ * Run automatically, exit after running
+ * Do not save settings
+ * Do not save file
+ * Use settings from the -l option
+
+*/
+
+
+/** Application class, derived from wxApp, one instance per program.
+*/
+class Bmpp4App : public wxApp
+{
+ protected:
+
+ /** Helper object.
+ */
+ Dk4WxApplicationHelper *pAh;
+
+ /** Controller fr online help.
+ */
+ Dk4WxHelpController *pHc;
+
+ /* __CHANGE__ 009: Add further members here.
+ */
+
+ /** Graphics output configuration.
+ */
+ dk4_gra_conf_t graconf;
+
+ /** Array of known paper sizes.
+ */
+ dk4_paper_size_t *pPaperSizes;
+
+ /** Paper size names correspondig to the pPaperSizes items.
+ */
+ wxArrayString *pasPaperSizes;
+
+ /** Directory name, allocated.
+ */
+ wxChar *pDirname;
+
+ /** Number of paper sizes in pasPaperSizes.
+ */
+ size_t szPaperSizes;
+
+ /** Restore and save graphics conversion settings.
+ */
+ bool bRestoreGx;
+
+ /** Restore and save Make mode setting.
+ */
+ bool bRestoreMake;
+
+ /** Restore and save location to process.
+ */
+ bool bRestoreLocation;
+
+ /** Make mode setting from options, if not restored.
+ */
+ bool bMakeMode;
+
+ /** Automatically start.
+ */
+ bool bAutorun;
+
+ protected:
+
+ /** Show error message if there is not enough memory available.
+ */
+ void
+ ShowMemoryErrorMessage(void);
+
+ /** Process command line arguments and initialize components.
+ @return True on success (can continue), false on error (abort).
+ */
+ bool
+ ProcessOptionsAndInitializeComponents(
+ wxChar const * const *localizedTexts
+ );
+
+ /** Process command line arguments.
+ @return True on success (can continue), false on error (abort).
+ */
+ bool
+ ProcessOptions(
+ dk4_app_t *app,
+ wxChar const * const *localizedTexts
+ );
+
+ public:
+
+ /** Application initialization.
+ @return true on success, false on error.
+ */
+ virtual
+ bool
+ OnInit();
+
+ /** Application shutdown.
+ @return 0 on success, any other value indicates an error.
+ */
+ virtual
+ int
+ OnExit();
+};
+
+
+
+/** Declaration as the wxApp object.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(Bmpp4App);
+#else
+DECLARE_APP(Bmpp4App)
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#include "wxbmpp.h"
+
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4PAPEA_H_INCLUDED
+#include "dk4papea.h"
+#endif
+
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#include "dk4strx.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Localized wxChar texts.
+*/
+static wxChar const * const wxbmpp_texts[] = {
+$!string-table macro=wxT
+#
+# 0: Menu "File"
+#
+File
+#
+# 1: Menu item "File/Quit"
+#
+Quit
+#
+# 2: Tool tip text for menu item "File/Exit"
+#
+Exit the application
+#
+# 3: Menu "Help"
+#
+Help
+#
+# 4: Menu item "Help/About"
+#
+About
+#
+# 5: Tooltip text for menu item "Help/About"
+#
+Show version information
+#
+# 6: Menu item "Help/Contents"
+#
+Contents
+#
+# 7: Tooltip text for menu item "Help/Contents"
+#
+Open table of contents
+#
+# 8: Initial status text
+#
+Ready
+#
+# 9: Copyright notice.
+#
+Copyright (c)
+#
+# 10: Dialog box title "About ..."
+#
+About
+#
+# 11: This program uses the following libraries
+#
+This program uses the following libraries:
+#
+# 12: See
+#
+See:
+#
+# 13-14 Make mode
+#
+Make
+Avoid unnecessary conversions
+#
+# 15-16 Label and tip for checkbox color
+#
+Color
+Produce colored output
+#
+# 17 Label for output type
+#
+Output:
+#
+# 18-23 Output type choices
+#
+PDF object
+PDF image
+PDF document
+EPS image
+PS image
+PS document
+#
+# 24 Tip for output type choice
+#
+Set output file type and intended purpose
+#
+# 25-26 Label and tip for image interpolation checkbox
+#
+Interpolation
+Set image interpolation flag
+#
+# 27 Label for PS level
+#
+PS level:
+#
+# 28-30 PS level choices and tip
+#
+2
+3
+Choose the PS language level
+#
+# 31-32 Label and tip for DSC checkbox
+#
+DSC
+Write DSC comments to PS output
+#
+# 33-34 Label and tip for LZW compression
+#
+LZW
+Allow LZW compression in PS level 2 output
+#
+# 35-36 Label and tip for DCT data checkbox
+#
+JPEG DCT data
+Directly re-use DCT encoded data from JPEG files
+#
+# 37-38 Label and tip for paper size choice
+#
+Paper size:
+Specify paper size
+#
+# 39-40 Label and tip for rotation checkbox
+#
+Rotation
+Allow image rotation for better page fitting
+#
+# 41-42 Label and tip for DCT data interpolation checkbox
+#
+DCT interpolation
+Allow image interpolation for directly re-used DCT data from JPEG files
+#
+# 43-47 Choices and tip for finishing choice
+#
+Finishing:
+Single side
+Duplex
+Duplex+Tumble
+Choose single side printing or duplex printing like a book or calendar
+#
+# 48-49 Label and tip for analyze bit depth checkbox
+#
+Analyze bit depth
+Attempt to reduce the number of bits per component
+#
+# 50-54 Label, tip and choices for resolution handling checkbox
+#
+Resolution:
+How to handle image resolution (use information from file, ignore or specify)
+from file
+ignore
+specify
+#
+# 55 Initial resolution value
+#
+72.0
+#
+# 56 Empty line
+#
+
+#
+# 57-58 Label and tip for analyze colors checkbox
+#
+Analyze color use
+Analyze use of colors, switch output to gray if no colors used
+#
+# 59-62 Label and tip for bg color selector and bg enforce checkbox
+#
+Background:
+Choose a background color
+Enforce background
+Use specified background color even if the input file provides a background
+#
+# 63-64 Label and tip for analyze alpha checkbox
+#
+Analyze alpha
+Analyze alpha channel data
+#
+# 65-66 Label and tip for choose directory menu item and button
+#
+Choose directory
+Choose directory containing the images to convert
+#
+# 67-69 Label and tip for conversion menu and menu item
+#
+Conversion
+Run
+Run conversion
+#
+# 70 Text for directory label
+#
+No directory specified yet!
+#
+# 71 Title for directory selection box
+#
+Choose directory
+#
+# 72 Text for menu extras
+#
+Extras
+#
+# 73 Label for menu item
+#
+Reset options
+#
+# 74-75 Message box texts for "are you sure" dialog box
+#
+Reset options - are you sure?
+Do you really want to reset all options to default values?
+#
+# 76-88 Color to grayscale method names
+#
+Luma BT.601
+Luma short
+Luma BT.709
+fast
+faster
+average
+desaturation
+decomposition (min)
+decomposition (med)
+decomposition (max)
+red
+green
+blue
+#
+# 89-90 Label and tip for rgb to gray conversion choice
+#
+RGB to gray:
+Choose method for RGB to gray conversions
+#
+# 91-92 Texts for summary label
+#
+Success, application will exit.
+Error, application will exit.
+#
+# 93-95 Processing stages
+#
+Reading image from file.
+Generating output.
+Writing output file.
+#
+# 96-97 Label and tip for cancel button in progress dialog
+#
+Cancel
+Abort processing
+#
+# 98 Title for progress dialog
+#
+Conversion progress
+#
+# 99 ERROR: Memory
+#
+Not enough memory!\n
+#
+# 100 ERROR: No files found in directory
+#
+No files found in directory!\n
+#
+# 101 File processing stage: Finished processing.
+#
+Finished.
+#
+# 102 Title for error message boxes
+#
+Error
+#
+# 103 Error message
+#
+Internal error (bug): No argv[0] argument found!
+#
+# 104 Error message
+#
+Internal error (bug): Application group name not found!
+#
+# 105 Error message
+#
+Illegal characters in language/options string!
+#
+# 106 Error message
+#
+Failed to parse command line options!
+#
+# 107 Error message
+#
+Too many paper sizes configured!
+#
+# 108 Error message
+#
+Illegal character(s) in paper size names!
+#
+# 109 Error message
+#
+Internal error (bug): Paper size without a name!
+#
+# 110 Error message
+#
+Failed to obtain paper size information!
+#
+# 111 Error message
+#
+Paper size not correctly configured!
+#
+# 112 Error message
+#
+Not enough memory (RAM)!\n
+#
+# 113 Error message
+#
+:\nERROR: Illegal character(s) in file name!\n
+#
+# 114 Error message
+#
+:\nERROR: File name too long!\n
+#
+# 115 Error message
+#
+:\nERROR: Empty directory\n
+#
+# 116 Error message
+#
+:\nERROR: Not enough memory!\n
+#
+# 117 Error message
+#
+:\nERROR: Failed to read image from file!\n
+#
+# 118 Error message
+#
+:\nERROR: Failed to open graphics output!\n
+#
+# 119 Error message
+#
+:\nERROR: Failed to select frame!\n
+#
+# 120 Error message
+#
+:\nERROR: Failed to write graphics output to file!\n
+#
+# 121 Error message
+#
+Aborted by user.
+#
+# 122 Tip for menu item
+#
+Reset all options to default values
+$!end
+};
+
+
+
+/** Non-localized wxChar texts.
+*/
+static wxChar const * const wxbmpp_nl_wx[] = {
+$!string-table macro=wxT
+#
+# 0: Program name.
+#
+wxbmpp
+#
+# 1: Program version.
+#
+1.0.0
+#
+# 2: Copyright owner name.
+#
+Dirk Krause
+#
+# 3: Software vendor name.
+#
+DKrause
+#
+# 4: Resource name of Windows icon
+#
+aaaaa
+#
+# 5: UNUSED (previously Windows chm help file name)
+#
+
+#
+# 6: UNUSED (previously non-Windows htb help file name)
+#
+
+#
+# 7: Space
+#
+
+#
+# 8: Newline
+#
+\n
+#
+# 9 10 11 12 13 14 15: List of libraries used.
+#
+DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
+http://sourceforge.net/p/dktools/wiki/Home/
+http://www.wxwidgets.org
+http://www.libpng.org/pub/png/libpng.html
+http://www.ijg.org
+http://www.remotesensing.org/libtiff
+http://www.zlib.net
+#
+# 16 17
+#
+Error
+Not enough memory (RAM)!
+$!end
+};
+
+
+
+/** Non-localized dkChar texts.
+*/
+static dkChar const * const wxbmpp_nl_dk[] = {
+$!string-table macro=dkT
+#
+# 0: Program group name.
+#
+dktools
+#
+# 1: String table name.
+#
+wxbmpp4.str
+#
+# 2: CHM help file name
+#
+wxbmpp.chm
+#
+# 3: HTB help file name
+#
+wxbmpp.htb
+#
+# 4 Dummy file name for application
+#
+dummy.txt
+$!end
+};
+
+
+
+/** Empty dummy text for help text and license file for application.
+*/
+static dkChar const * dummy_text[] = {
+$!string-table macro=dkT
+$!end
+};
+
+
+static dkChar const versno_dk[] = { DKT_VERSION_DK };
+
+
+/** Implementation of the wxApp functionality.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(Bmpp4App);
+#else
+IMPLEMENT_APP(Bmpp4App)
+#endif
+
+
+bool
+Bmpp4App::OnInit()
+{
+ Bmpp4Frame *frame = NULL;
+ wxChar const * const *localizedTexts = NULL;
+ wxPNGHandler *phPng = NULL;
+ wxXPMHandler *phXpm = NULL;
+ wxICOHandler *phIco = NULL;
+ wxArchiveFSHandler *phArchiveFS = NULL;
+ bool back = false;
+
+ $? "+ Bmpp4App::OnInit"
+
+ /* Initialize members.
+ */
+ pAh = NULL;
+ pHc = NULL;
+ bRestoreGx = true;
+ bRestoreMake = true;
+ bRestoreLocation = true;
+ bMakeMode = false;
+ bAutorun = false;
+ pPaperSizes = NULL;
+ pasPaperSizes = NULL;
+ pDirname = NULL;
+ szPaperSizes = 0;
+ dk4gra_conf_init(&graconf);
+
+ /* __CHANGE__ 009: Initialize further members here.
+ */
+
+ /* Set up helper object.
+ */
+ pAh = new Dk4WxApplicationHelper();
+ if (NULL == pAh) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pAh->Initialize(argv[0], wxbmpp_nl_wx[3], wxbmpp_nl_dk[0]))) {
+ goto finished;
+ }
+
+ /* Add image and file system handlers for online help.
+ */
+ phPng = new wxPNGHandler();
+ if (NULL != phPng) {
+ wxImage::AddHandler(phPng);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phXpm = new wxXPMHandler();
+ if (NULL != phXpm) {
+ wxImage::AddHandler(phXpm);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phIco = new wxICOHandler();
+ if (NULL != phIco) {
+ wxImage::AddHandler(phIco);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phArchiveFS = new wxArchiveFSHandler();
+ if (NULL != phArchiveFS) {
+ wxFileSystem::AddHandler(phArchiveFS);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Set up help controller.
+ */
+ pHc = new Dk4WxHelpController();
+ if (NULL == pHc) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pHc->Initialize(pAh, wxbmpp_nl_dk[2], wxbmpp_nl_dk[3]))) {
+ goto finished;
+ }
+
+ /* Attempt to obtain localized texts in users preferred language.
+ */
+ localizedTexts = pAh->GetStringTable(wxbmpp_nl_dk[1], wxbmpp_texts);
+ if(!(localizedTexts)) {
+ localizedTexts = wxbmpp_texts;
+ }
+
+ /* Find list of paper sizes and process options.
+ */ $? ". before new ..."
+ pasPaperSizes = new wxArrayString();
+ if (NULL == pasPaperSizes) { $? "! pasPaperSizes"
+ ShowMemoryErrorMessage();
+ goto finished;
+ } $? ". pasPaperSizes"
+ if (!ProcessOptionsAndInitializeComponents(localizedTexts)) {
+ $? "! Process..."
+ goto finished;
+ } $? ". Process..."
+
+ /* Create and show frame.
+ */
+ frame = new Bmpp4Frame(
+ Bmpp4Frame_MainWindow,
+ pAh,
+ pHc,
+ localizedTexts,
+ wxbmpp_nl_wx,
+ wxbmpp_nl_dk,
+ &graconf,
+ pasPaperSizes,
+ pDirname,
+ szPaperSizes,
+ bRestoreGx,
+ bRestoreMake,
+ bRestoreLocation,
+ bMakeMode,
+ bAutorun,
+ pPaperSizes
+ );
+ if(!(frame)) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Show frame, restore position and indicate success.
+ */
+ frame->RestoreSettings();
+ frame->CorrectGUI();
+ frame->RestorePosition();
+ frame->Show();
+ back = true;
+
+ /* Release resources if initialization failed.
+ */
+ finished:
+ if(!(back)) {
+ if (NULL != pPaperSizes) {
+ dk4mem_free(pPaperSizes);
+ pPaperSizes = NULL;
+ }
+ if (NULL != pDirname) { $? ". delete pDirname"
+ dk4mem_free(pDirname);
+ pDirname = NULL;
+ }
+ if (NULL != pasPaperSizes) { $? ". delete pasPaperSizes"
+ delete(pasPaperSizes);
+ pasPaperSizes = NULL; $? ". deleted pasPaperSizes"
+ }
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+ }
+ $? "- Bmpp4App::OnInit %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+int
+Bmpp4App::OnExit()
+{
+ int back = 0;
+
+ $? "+ Bmpp4App::OnExit"
+
+ /* __CHANGE__ 009: Release resources allocated by further members.
+ */
+
+ /* Release resources.
+ */
+ if (NULL != pPaperSizes) { $? ". delete pPaperSizes"
+ dk4mem_free(pPaperSizes);
+ }
+ if (NULL != pDirname) { $? ". delete pDirname"
+ dk4mem_free(pDirname); $? ". deleted pDirname"
+ }
+ if (NULL != pasPaperSizes) { $? ". delete pasPaperSizes"
+ delete(pasPaperSizes);
+ pasPaperSizes = NULL; $? ". deleted pasPaperSizes"
+ }
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+
+ /* __CHANGE__ 010: Set exit status code.
+ */
+ $? "- Bmpp4App::OnExit %d", back
+ return back;
+}
+
+
+
+void
+Bmpp4App::ShowMemoryErrorMessage(void)
+{
+ const wxChar *s_title = NULL;
+ const wxChar *s_text = NULL;
+
+ if (NULL != pAh) {
+ s_title = pAh->GetBasicString(6);
+ s_text = pAh->GetBasicString(7);
+ }
+ if (NULL == s_title) {
+ s_title = wxbmpp_nl_wx[16];
+ }
+ if (NULL == s_text) {
+ s_text = wxbmpp_nl_wx[17];
+ }
+ wxMessageBox(s_text, s_title, (wxOK | wxCENTRE | wxICON_ERROR));
+}
+
+
+
+bool
+Bmpp4App::ProcessOptionsAndInitializeComponents(
+ wxChar const * const *localizedTexts
+)
+{
+ dkChar *margv[4];
+ dk4_app_t *app = NULL;
+ dkChar *argv0 = NULL;
+ dkChar const *pahargv0 = NULL;
+ dkChar const *grname = NULL;
+ bool back = false;
+ $? "+ ProcessOptionsAndInitializeComponents"
+ pahargv0 = pAh->GetDkArgv0();
+ if (NULL == pahargv0) { $? "! pahargv0"
+ /* ERROR: No argv[0] */
+ wxMessageBox(
+ localizedTexts[103], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ goto finished;
+ } $? ". pahargv0"
+ argv0 = dk4str_dup(pahargv0, NULL);
+ if (NULL == argv0) { $? "! argv0"
+ /* ERROR: Memory */
+ ShowMemoryErrorMessage();
+ goto finished;
+ } $? ". argv0"
+ grname = pAh->GetDkGroupName();
+ if (NULL == grname) { $? "! grname"
+ /* ERROR: No group name */
+ wxMessageBox(
+ localizedTexts[104], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ goto finished;
+ } $? ". grname"
+ margv[0] = argv0;
+ margv[1] = NULL;
+ app = dk4app_open_silent(
+ 1, margv, NULL, 0, grname, versno_dk, wxbmpp_nl_dk[4],
+ dummy_text, dummy_text
+ );
+ if (NULL == app) { $? "! app"
+ /* ERROR: No app */
+ ShowMemoryErrorMessage();
+ goto finished;
+ } $? ". app"
+ back = ProcessOptions(app, localizedTexts);
+
+ finished:
+ if (NULL != app) {
+ dk4app_close(app);
+ }
+ if (NULL != argv0) {
+ dk4mem_free(argv0);
+ }
+ $? "- ProcessOptionsAndInitializeComponents %d", ((back) ? 1 : 0)
+ return back;
+}
+
+
+
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
+static const wxCmdLineEntryDesc wxbmpp_cmd_line_desc[] = {
+ {
+ wxCMD_LINE_OPTION,
+ wxT_2("l"),
+ wxT_2("language"),
+ wxT_2("Choose output language"),
+ wxCMD_LINE_VAL_STRING
+ },
+ {
+ wxCMD_LINE_SWITCH,
+ wxT_2("m"),
+ wxT_2("make"),
+ wxT_2("Run in make mode")
+ },
+ {
+ wxCMD_LINE_PARAM,
+ NULL,
+ NULL,
+ wxT_2("input file"),
+ wxCMD_LINE_VAL_STRING,
+ wxCMD_LINE_PARAM_OPTIONAL
+ },
+ { wxCMD_LINE_NONE }
+};
+
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
+
+
+bool
+Bmpp4App::ProcessOptions(dk4_app_t *app, wxChar const * const *localizedTexts)
+{
+ dkChar cobu[DK4_MAX_PATH];
+ wxChar buf[256];
+ wxString sLanguage(wxT(""));
+ dk4_paper_size_collection_t *pscoll = NULL;
+ dk4_paper_size_t const *paps = NULL;
+ wxChar const *ptr = NULL;
+ size_t i;
+ int res = -1;
+ bool back = false;
+ $? "+ ProcessOptions"
+ {
+ wxCmdLineParser parser(wxbmpp_cmd_line_desc, argc, argv);
+ {
+ wxLogNull log;
+ res = parser.Parse(false);
+ }
+ if (0 == res) {
+ back = true;
+ if(parser.Found(wxT("l"), &sLanguage)) {
+ bRestoreGx = false;
+ bRestoreMake = false;
+ bAutorun = true;
+ wxCStrData sLanguageData = sLanguage.c_str();
+ ptr = (wxChar const *)sLanguageData;
+ if (NULL != ptr) {
+ if (pAh->StringToDk(cobu, DK4_MAX_PATH, ptr, NULL)) {
+ (void)dk4gra_conf_setup(
+ &graconf, cobu, 1, DK4_GRA_CONF_SCOPE_BMPP, app
+ );
+ }
+ else {
+ /* ERROR: Conversion to dkChar string failed */
+ wxMessageBox(
+ localizedTexts[105], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ back = false;
+ goto finished;
+ }
+ }
+ else {
+ /* ERROR: No c_str (can not happen) */
+ back = false;
+ goto finished;
+ }
+ }
+ if(parser.Found(wxT("m"))) {
+ bMakeMode = true;
+ }
+ if(parser.GetParamCount() > 0) {
+ wxString cmdfn = parser.GetParam(0);
+ wxFileName fn(cmdfn);
+ fn.Normalize(
+ wxPATH_NORM_LONG | wxPATH_NORM_DOTS
+ | wxPATH_NORM_TILDE | wxPATH_NORM_ABSOLUTE
+ );
+#if 0
+ /* 2018-04-04 Change
+ Whenever wxbmpp is called with -l option the program
+ starts a conversion automatically, now for both
+ directories and single files.
+ */
+ if (!(fn.FileExists())) {
+ bAutorun = false;
+ }
+#endif
+ cmdfn = fn.GetFullPath();
+ wxCStrData fnstrdata = cmdfn.c_str();
+ ptr = (wxChar const *)fnstrdata;
+ if (NULL != ptr) {
+ pDirname = dk4strx_dup(ptr, NULL);
+ if (NULL != pDirname) {
+ bRestoreLocation = false;
+ }
+ else {
+ /* ERROR: Memory */
+ ShowMemoryErrorMessage();
+ back = false;
+ goto finished;
+ }
+ }
+ }
+ else {
+ bAutorun = false;
+ }
+ }
+ else {
+ /* ERROR: In command line options */
+ wxMessageBox(
+ localizedTexts[106], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ goto finished;
+ }
+ }
+ pscoll = dk4app_get_paper_sizes(app);
+ if (NULL != pscoll) {
+ dk4papersize_coll_reset(pscoll);
+ do {
+ paps = dk4papersize_coll_next(pscoll);
+ if (NULL != paps) {
+ if (NULL != paps->name) { $? ". paper size \"%!ds\"", paps->name
+ if (
+ pAh->StringToWx(
+ buf, DK4_SIZEOF(buf,wxChar), paps->name, NULL
+ )
+ ) {
+ if (SIZE_MAX > szPaperSizes) {
+ pasPaperSizes->Add(buf);
+ szPaperSizes += 1;
+ }
+ else {
+ /* ERROR: Too many paper sizes */
+ wxMessageBox(
+ localizedTexts[107], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ back = false;
+ }
+ }
+ else {
+ /* ERROR: Failed to convert to wx */
+ wxMessageBox(
+ localizedTexts[108], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ back = false;
+ }
+ }
+ else {
+ /* ERROR: Paper size with no name (bug) */
+ wxMessageBox(
+ localizedTexts[109], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ } while((NULL != paps) && (back));
+ if ((0 < szPaperSizes) && (back)) {
+ pPaperSizes = dk4mem_new(dk4_paper_size_t,szPaperSizes,NULL);
+ for (i = 0; i < szPaperSizes; i++) {
+ pPaperSizes[i].name = NULL;
+ pPaperSizes[i].name = NULL;
+ pPaperSizes[i].w = 595.0;
+ pPaperSizes[i].h = 842.0;
+ pPaperSizes[i].i = 56.0;
+ pPaperSizes[i].o = 28.0;
+ pPaperSizes[i].b = 14.0;
+ pPaperSizes[i].t = 14.0;
+ }
+ if (NULL != pPaperSizes) {
+ dk4papersize_coll_reset(pscoll);
+ i = 0;
+ do {
+ paps = dk4papersize_coll_next(pscoll);
+ if (NULL != paps) {
+ DK4_MEMCPY(&(pPaperSizes[i]),paps,sizeof(dk4_paper_size_t));
+ pPaperSizes[i].name = NULL;
+ }
+ i++;
+ } while((NULL != paps) && (i < szPaperSizes));
+ }
+ else {
+ /* ERROR: Memory */
+ ShowMemoryErrorMessage();
+ back = false;
+ }
+ }
+ dk4papersize_coll_close(pscoll);
+ $? ". paper sizes found = %u", (unsigned)szPaperSizes
+ }
+ else {
+ /* ERROR: Failed to obtain paper sizes collection */
+ wxMessageBox(
+ localizedTexts[110], localizedTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ back = false;
+ }
+
+ finished:
+ $? "- ProcessOptions %d", ((back) ? 1 : 0)
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Bmpp4App.h b/support/dktools/Bmpp4App.h
new file mode 100644
index 0000000000..b37fa2a50d
--- /dev/null
+++ b/support/dktools/Bmpp4App.h
@@ -0,0 +1,159 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Bmpp4App.cpt
+*/
+
+#ifndef BMPP4APP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define BMPP4APP_H_INCLUDED 1
+
+
+#line 12 "Bmpp4App.cpt"
+
+/** @file Bmpp4App.h The Bmpp4App class.
+*/
+
+/* The program may be invoked in 2 variants
+
+ wxbmpp [<directory>]
+ * NO -l OPTION SPECIFIED, RUN AS NORMAL GUI APPLICATION
+ * Restore all settings made in the GUI previously
+ * Restore directory if not specified on command line
+ * Do not run automatically
+ * Save directory if not specified on command line
+ * Save all settings made in the GUI
+ * When running retrieve current settings from GUI
+
+ wxbmpp -l<driver>[.language],... [<file>]
+ * WITH -l OPTION AUTOMATICALLY START CONVERSION FOR SPECIFIED FILE
+ * Do not restore settings
+ * Apply settings in the -l option
+ * Run automatically, exit after running
+ * Do not save settings
+ * Do not save file
+ * Use settings from the -l option
+
+*/
+
+
+/** Application class, derived from wxApp, one instance per program.
+*/
+class Bmpp4App : public wxApp
+{
+ protected:
+
+ /** Helper object.
+ */
+ Dk4WxApplicationHelper *pAh;
+
+ /** Controller fr online help.
+ */
+ Dk4WxHelpController *pHc;
+
+ /* __CHANGE__ 009: Add further members here.
+ */
+
+ /** Graphics output configuration.
+ */
+ dk4_gra_conf_t graconf;
+
+ /** Array of known paper sizes.
+ */
+ dk4_paper_size_t *pPaperSizes;
+
+ /** Paper size names correspondig to the pPaperSizes items.
+ */
+ wxArrayString *pasPaperSizes;
+
+ /** Directory name, allocated.
+ */
+ wxChar *pDirname;
+
+ /** Number of paper sizes in pasPaperSizes.
+ */
+ size_t szPaperSizes;
+
+ /** Restore and save graphics conversion settings.
+ */
+ bool bRestoreGx;
+
+ /** Restore and save Make mode setting.
+ */
+ bool bRestoreMake;
+
+ /** Restore and save location to process.
+ */
+ bool bRestoreLocation;
+
+ /** Make mode setting from options, if not restored.
+ */
+ bool bMakeMode;
+
+ /** Automatically start.
+ */
+ bool bAutorun;
+
+ protected:
+
+ /** Show error message if there is not enough memory available.
+ */
+ void
+ ShowMemoryErrorMessage(void);
+
+ /** Process command line arguments and initialize components.
+ @return True on success (can continue), false on error (abort).
+ */
+ bool
+ ProcessOptionsAndInitializeComponents(
+ wxChar const * const *localizedTexts
+ );
+
+ /** Process command line arguments.
+ @return True on success (can continue), false on error (abort).
+ */
+ bool
+ ProcessOptions(
+ dk4_app_t *app,
+ wxChar const * const *localizedTexts
+ );
+
+ public:
+
+ /** Application initialization.
+ @return true on success, false on error.
+ */
+ virtual
+ bool
+ OnInit();
+
+ /** Application shutdown.
+ @return 0 on success, any other value indicates an error.
+ */
+ virtual
+ int
+ OnExit();
+};
+
+
+
+/** Declaration as the wxApp object.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(Bmpp4App);
+#else
+DECLARE_APP(Bmpp4App)
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/Bmpp4Frame.cpp b/support/dktools/Bmpp4Frame.cpp
new file mode 100644
index 0000000000..c59db5c136
--- /dev/null
+++ b/support/dktools/Bmpp4Frame.cpp
@@ -0,0 +1,2127 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Bmpp4Frame.wxc
+*/
+
+/** @file Bmpp4Frame.cpp The Bmpp4Frame module.
+*/
+
+
+#line 535 "Bmpp4Frame.wxc"
+
+#include "wxbmpp.h"
+
+#if !defined(__WXMSW__)
+#include "gui-img/icons/dkicon.xpm"
+#endif
+
+#include "gui-img/shared/toolbar/choose-dir.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+
+#ifndef DK4MAIXDBL_H_INCLUDED
+#include "dk4maixdbl.h"
+#endif
+
+#ifndef DK4MAOXDBL_H_INCLUDED
+#include "dk4maoxdbl.h"
+#endif
+
+
+
+#line 554 "Bmpp4Frame.wxc"
+
+
+
+/* __CHANGE__ 017: Add further events. */
+/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Bmpp4Frame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(Bmpp4Frame,wxFrame)
+#endif
+ EVT_MENU(Bmpp4Frame_Quit, Bmpp4Frame::OnQuit)
+ EVT_MENU(Bmpp4Frame_Help_About, Bmpp4Frame::OnAbout)
+ EVT_MENU(Bmpp4Frame_Help_Contents, Bmpp4Frame::OnHelpContents)
+ EVT_MENU(Bmpp4Frame_Choose_Directory, Bmpp4Frame::OnChooseDirectory)
+ EVT_MENU(Bmpp4Frame_Run_Conversion, Bmpp4Frame::OnRunConversion)
+ EVT_MENU(Bmpp4Frame_Reset_Options, Bmpp4Frame::OnResetOptions)
+ EVT_CHOICE(Bmpp4Frame_Output_Type, Bmpp4Frame::OnOutputType)
+ EVT_CHOICE(Bmpp4Frame_PS_Level, Bmpp4Frame::OnPSLevel)
+ EVT_CHOICE(Bmpp4Frame_Resolution, Bmpp4Frame::OnResolution)
+ EVT_CHECKBOX(Bmpp4Frame_Color_Output, Bmpp4Frame::OnColorOutput)
+ EVT_CHECKBOX(Bmpp4Frame_Change_Interpolation, Bmpp4Frame::OnInterpolationChange)
+ EVT_IDLE(Bmpp4Frame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+/** Option name to restore make setting.
+*/
+static const wxChar * const i_dir_names[] = {
+/* 0 */
+wxT("wxbmpp.location"),
+
+NULL
+
+
+#line 589 "Bmpp4Frame.wxc"
+};
+
+
+/** Option name to restore make setting.
+*/
+static const wxChar * const i_make_names[] = {
+/* 0 */
+wxT("wxbmpp.make"),
+
+NULL
+
+
+#line 598 "Bmpp4Frame.wxc"
+};
+
+
+/** Names for saving and restoring options.
+*/
+static const wxChar * const i_option_names[] = {
+/* 0 */
+wxT("wxbmpp.paper.choice"),
+
+/* 1 */
+wxT("wxbmpp.output.type"),
+
+/* 2 */
+wxT("wxbmpp.output.color"),
+
+/* 3 */
+wxT("wxbmpp.ps.level"),
+
+/* 4 */
+wxT("wxbmpp.ps.dsc"),
+
+/* 5 */
+wxT("wxbmpp.ps.lzw"),
+
+/* 6 */
+wxT("wxbmpp.paper.rotate"),
+
+/* 7 */
+wxT("wxbmpp.paper.duplex"),
+
+/* 8 */
+wxT("wxbmpp.resolution.type"),
+
+/* 9 */
+wxT("wxbmpp.image.background.red"),
+
+/* 10 */
+wxT("wxbmpp.image.background.green"),
+
+/* 11 */
+wxT("wxbmpp.image.background.blue"),
+
+/* 12 */
+wxT("wxbmpp.image.bg.enforce"),
+
+/* 13 */
+wxT("wxbmpp.image.interpolation"),
+
+/* 14 */
+wxT("wxbmpp.image.dct"),
+
+/* 15 */
+wxT("wxbmpp.image.dct-interpolation"),
+
+/* 16 */
+wxT("wxbmpp.image.analysis.bpc"),
+
+/* 17 */
+wxT("wxbmpp.image.analysis.color"),
+
+/* 18 */
+wxT("wxbmpp.image.analysis.alpha"),
+
+/* 19 */
+wxT("wxbmpp.image.rgb-to-gray"),
+
+NULL
+
+
+#line 626 "Bmpp4Frame.wxc"
+};
+
+
+#if 0
+/** Names for saving and restoring options.
+*/
+static const wxChar * const s_option_names[] = {
+/* 0 */
+wxT("wxbmpp.paper.name"),
+
+NULL
+
+
+#line 636 "Bmpp4Frame.wxc"
+};
+#endif
+
+
+#if 0
+/** Names for saving and restoring options.
+*/
+static const wxChar * const d_option_names[] = {
+/* 0 */
+wxT("wxbmpp.resolution.value"),
+
+NULL
+
+
+#line 647 "Bmpp4Frame.wxc"
+};
+#endif
+
+
+
+
+#line 653 "Bmpp4Frame.wxc"
+Bmpp4Frame::Bmpp4Frame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk,
+ dk4_gra_conf_t *pgc,
+ wxArrayString *pPapSiz,
+ wxChar *pDir,
+ size_t szPap,
+ bool bRGx,
+ bool bRMa,
+ bool bRLo,
+ bool bMak,
+ bool bRun,
+ dk4_paper_size_t *pSizes
+) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid),
+ cRed(127, 0, 0),
+ cGreen(0, 127, 0),
+ cBlack(0, 0, 0),
+ asPaperSizes(*pPapSiz)
+{
+ wxString saOutputMode[] = {
+ wxString(localizedTexts[18]),
+ wxString(localizedTexts[19]),
+ wxString(localizedTexts[20]),
+ wxString(localizedTexts[21]),
+ wxString(localizedTexts[22]),
+ wxString(localizedTexts[23])
+ };
+ wxString saPsLevel[] = {
+ wxString(localizedTexts[28]),
+ wxString(localizedTexts[29])
+ };
+ wxString saFinishing[] = {
+ wxString(localizedTexts[44]),
+ wxString(localizedTexts[45]),
+ wxString(localizedTexts[46])
+ };
+ wxString saResolution[] = {
+ wxString(localizedTexts[52]),
+ wxString(localizedTexts[53]),
+ wxString(localizedTexts[54])
+ };
+ wxString saRgbToGray[] = {
+ wxString(localizedTexts[76]),
+ wxString(localizedTexts[77]),
+ wxString(localizedTexts[78]),
+ wxString(localizedTexts[79]),
+ wxString(localizedTexts[80]),
+ wxString(localizedTexts[81]),
+ wxString(localizedTexts[82]),
+ wxString(localizedTexts[83]),
+ wxString(localizedTexts[84]),
+ wxString(localizedTexts[85]),
+ wxString(localizedTexts[86]),
+ wxString(localizedTexts[87]),
+ wxString(localizedTexts[88])
+ };
+ wxString slDirname(localizedTexts[70]);
+
+
+#line 715 "Bmpp4Frame.wxc"
+ /* __CHANGE__ 012: Add further local variables.
+ */
+
+ /* __CHANGE__ 012: Initialize further local variables.
+ */
+ bIsCorrecting = false;
+
+ sTexts = localizedTexts;
+ sNlWx = nlWx;
+ sNlDk = nlDk;
+#if defined(__WXMSW__)
+ wxIcon wxbmpp_icon(sNlWx[4]);
+#else
+ wxIcon wxbmpp_icon(xpm_dkicon);
+#endif
+
+ /* __CHANGE__ 011: Initialize further class members.
+ */
+ pPaperSizes = pSizes;
+ DK4_MEMCPY(&graconf,pgc,sizeof(dk4_gra_conf_t));
+ if (NULL != pDir) {
+ sDirname = wxString(pDir);
+ slDirname = sDirname;
+ }
+ szPaperSizes = szPap;
+ bRestoreGx = bRGx;
+ bRestoreMake = bRMa;
+ bRestoreLocation = bRLo;
+ bMakeMode = bMak;
+ bAutorun = bRun;
+ if (bAutorun) {
+ oAsc.SetAutoStart(true);
+ oAsc.SetAutoExit(true);
+ }
+ else {
+ oAsc.SetAutoStart(false);
+ oAsc.SetAutoExit(false);
+ }
+ bActive = true;
+ dk4time_get(&firsttime);
+
+ dkctGUILayoutOK = false;
+ dkctGUIContentsPanel = NULL;
+ mainSizer = NULL;
+ mbMain = NULL;
+ tbMain = NULL;
+ menuFile = NULL;
+ menuConversion = NULL;
+ menuExtras = NULL;
+ menuHelp = NULL;
+ miFileDirectory = NULL;
+ miFileExit = NULL;
+ miConversionRun = NULL;
+ miExtrasOptionReset = NULL;
+ miHelpAbout = NULL;
+ miHelpContents = NULL;
+ bChooseDir = NULL;
+ bRunConversion = NULL;
+ verticalSizer = NULL;
+ contentsSizer = NULL;
+ staticline0 = NULL;
+ lDirectoryName = NULL;
+ staticline1 = NULL;
+ cbMakeMode = NULL;
+ cbColorOutput = NULL;
+ lRgbToGray = NULL;
+ chRgbToGray = NULL;
+ lOutputMode = NULL;
+ chOutputMode = NULL;
+ cbImgInterpolation = NULL;
+ lPsLevel = NULL;
+ chPsLevel = NULL;
+ cbDsc = NULL;
+ cbLzw = NULL;
+ cbDct = NULL;
+ lPaperSize = NULL;
+ chPaperSizes = NULL;
+ cbRotation = NULL;
+ cbDctInterpolation = NULL;
+ lFinishing = NULL;
+ chFinishing = NULL;
+ cbAnBpc = NULL;
+ lResolution = NULL;
+ chResolution = NULL;
+ tfResolution = NULL;
+ cbAnColor = NULL;
+ lBackground = NULL;
+ ccBackground = NULL;
+ cbBackground = NULL;
+ cbAnAlpha = NULL;
+ dkctGUIContentsPanel = new wxPanel(this);
+ if(!(dkctGUIContentsPanel)) {
+ goto dkctGUILayoutFinished;
+ }
+#if wxUSE_MENUS
+ mbMain = new wxMenuBar(
+ );
+ if(!(mbMain)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuFile = new wxMenu(
+ );
+ if(!(menuFile)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileDirectory = menuFile->Append(
+ Bmpp4Frame_Choose_Directory,
+ sTexts[65],
+ sTexts[66]
+ );
+ if(!(miFileDirectory)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileExit = menuFile->Append(
+ Bmpp4Frame_Quit,
+ sTexts[1],
+ sTexts[2]
+ );
+ if(!(miFileExit)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuFile, sTexts[0]);
+ menuConversion = new wxMenu(
+ );
+ if(!(menuConversion)) {
+ goto dkctGUILayoutFinished;
+ }
+ miConversionRun = menuConversion->Append(
+ Bmpp4Frame_Run_Conversion,
+ sTexts[68],
+ sTexts[69]
+ );
+ if(!(miConversionRun)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuConversion, sTexts[67]);
+ menuExtras = new wxMenu(
+ );
+ if(!(menuExtras)) {
+ goto dkctGUILayoutFinished;
+ }
+ miExtrasOptionReset = menuExtras->Append(
+ Bmpp4Frame_Reset_Options,
+ sTexts[73],
+ sTexts[122]
+ );
+ if(!(miExtrasOptionReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuExtras, sTexts[72]);
+ menuHelp = new wxMenu(
+ );
+ if(!(menuHelp)) {
+ goto dkctGUILayoutFinished;
+ }
+ miHelpAbout = menuHelp->Append(
+ Bmpp4Frame_Help_About,
+ sTexts[4],
+ sTexts[5]
+ );
+ if(!(miHelpAbout)) {
+ goto dkctGUILayoutFinished;
+ }
+ miHelpContents = menuHelp->Append(
+ Bmpp4Frame_Help_Contents,
+ sTexts[6],
+ sTexts[7]
+ );
+ if(!(miHelpContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuHelp, sTexts[3]);
+ SetMenuBar(mbMain);
+#endif
+#if wxUSE_TOOLBAR
+ tbMain = new wxToolBar(
+ this,
+ wxID_ANY
+ );
+ if(!(tbMain)) {
+ goto dkctGUILayoutFinished;
+ }
+ bChooseDir = tbMain->AddTool(
+ Bmpp4Frame_Choose_Directory,
+ sTexts[65],
+ xpm_choose_dir,
+ wxNullBitmap,
+ wxITEM_NORMAL,
+ sTexts[66]
+ );
+ if(!(bChooseDir)) {
+ goto dkctGUILayoutFinished;
+ }
+ bRunConversion = tbMain->AddTool(
+ Bmpp4Frame_Run_Conversion,
+ sTexts[68],
+ xpm_run_conversion,
+ wxNullBitmap,
+ wxITEM_NORMAL,
+ sTexts[69]
+ );
+ if(!(bRunConversion)) {
+ goto dkctGUILayoutFinished;
+ }
+ tbMain->Realize();
+ SetToolBar(tbMain);
+#endif
+ mainSizer = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(mainSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ mainSizer->Add(10, 10, 0);
+ verticalSizer = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(verticalSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ verticalSizer->Add(10, 10, 0);
+ contentsSizer = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(contentsSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ staticline0 = new wxStaticLine(
+ dkctGUIContentsPanel,
+ wxID_ANY
+ );
+ if(!(staticline0)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ staticline0,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 11),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ lDirectoryName = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ slDirname,
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_LEFT
+ );
+ if(!(lDirectoryName)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ lDirectoryName,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 11),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ staticline1 = new wxStaticLine(
+ dkctGUIContentsPanel,
+ wxID_ANY
+ );
+ if(!(staticline1)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ staticline1,
+ wxGBPosition(2, 0),
+ wxGBSpan(1, 11),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ cbMakeMode = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[13]
+ );
+ if(!(cbMakeMode)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbMakeMode->SetToolTip(sTexts[14]);
+ contentsSizer->Add(
+ cbMakeMode,
+ wxGBPosition(3, 0),
+ wxGBSpan(1, 7),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbColorOutput = new wxCheckBox(
+ dkctGUIContentsPanel,
+ Bmpp4Frame_Color_Output,
+ sTexts[15]
+ );
+ if(!(cbColorOutput)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbColorOutput->SetToolTip(sTexts[16]);
+ contentsSizer->Add(
+ cbColorOutput,
+ wxGBPosition(3, 7),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ contentsSizer->Add(10, 1, wxGBPosition(3, 8), wxGBSpan(1, 1));
+ lRgbToGray = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[89]
+ );
+ if(!(lRgbToGray)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ lRgbToGray,
+ wxGBPosition(3, 9),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ chRgbToGray = new wxChoice(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 13,
+ saRgbToGray
+ );
+ if(!(chRgbToGray)) {
+ goto dkctGUILayoutFinished;
+ }
+ chRgbToGray->SetToolTip(sTexts[90]);
+ contentsSizer->Add(
+ chRgbToGray,
+ wxGBPosition(3, 10),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lOutputMode = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[17]
+ );
+ if(!(lOutputMode)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ lOutputMode,
+ wxGBPosition(4, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ chOutputMode = new wxChoice(
+ dkctGUIContentsPanel,
+ Bmpp4Frame_Output_Type,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 6,
+ saOutputMode
+ );
+ if(!(chOutputMode)) {
+ goto dkctGUILayoutFinished;
+ }
+ chOutputMode->SetToolTip(sTexts[24]);
+ contentsSizer->Add(
+ chOutputMode,
+ wxGBPosition(4, 1),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ cbImgInterpolation = new wxCheckBox(
+ dkctGUIContentsPanel,
+ Bmpp4Frame_Change_Interpolation,
+ sTexts[25]
+ );
+ if(!(cbImgInterpolation)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbImgInterpolation->SetToolTip(sTexts[26]);
+ contentsSizer->Add(
+ cbImgInterpolation,
+ wxGBPosition(4, 7),
+ wxGBSpan(1, 4),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lPsLevel = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[27]
+ );
+ if(!(lPsLevel)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ lPsLevel,
+ wxGBPosition(5, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ chPsLevel = new wxChoice(
+ dkctGUIContentsPanel,
+ Bmpp4Frame_PS_Level,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 2,
+ saPsLevel
+ );
+ if(!(chPsLevel)) {
+ goto dkctGUILayoutFinished;
+ }
+ chPsLevel->SetToolTip(sTexts[30]);
+ contentsSizer->Add(
+ chPsLevel,
+ wxGBPosition(5, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbDsc = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[31]
+ );
+ if(!(cbDsc)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbDsc->SetToolTip(sTexts[32]);
+ contentsSizer->Add(
+ cbDsc,
+ wxGBPosition(5, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbLzw = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[33]
+ );
+ if(!(cbLzw)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbLzw->SetToolTip(sTexts[34]);
+ contentsSizer->Add(
+ cbLzw,
+ wxGBPosition(5, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbDct = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[35]
+ );
+ if(!(cbDct)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbDct->SetToolTip(sTexts[36]);
+ contentsSizer->Add(
+ cbDct,
+ wxGBPosition(5, 7),
+ wxGBSpan(1, 4),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lPaperSize = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[37]
+ );
+ if(!(lPaperSize)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ lPaperSize,
+ wxGBPosition(6, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ chPaperSizes = new wxChoice(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ wxDefaultPosition,
+ wxDefaultSize,
+ asPaperSizes
+ );
+ if(!(chPaperSizes)) {
+ goto dkctGUILayoutFinished;
+ }
+ chPaperSizes->SetToolTip(sTexts[38]);
+ contentsSizer->Add(
+ chPaperSizes,
+ wxGBPosition(6, 1),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ cbRotation = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[39]
+ );
+ if(!(cbRotation)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbRotation->SetToolTip(sTexts[40]);
+ contentsSizer->Add(
+ cbRotation,
+ wxGBPosition(6, 3),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbDctInterpolation = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[41]
+ );
+ if(!(cbDctInterpolation)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbDctInterpolation->SetToolTip(sTexts[42]);
+ contentsSizer->Add(
+ cbDctInterpolation,
+ wxGBPosition(6, 7),
+ wxGBSpan(1, 4),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lFinishing = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[43]
+ );
+ if(!(lFinishing)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ lFinishing,
+ wxGBPosition(7, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ chFinishing = new wxChoice(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 3,
+ saFinishing
+ );
+ if(!(chFinishing)) {
+ goto dkctGUILayoutFinished;
+ }
+ chFinishing->SetToolTip(sTexts[47]);
+ contentsSizer->Add(
+ chFinishing,
+ wxGBPosition(7, 1),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ cbAnBpc = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[48]
+ );
+ if(!(cbAnBpc)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbAnBpc->SetToolTip(sTexts[49]);
+ contentsSizer->Add(
+ cbAnBpc,
+ wxGBPosition(7, 7),
+ wxGBSpan(1, 4),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lResolution = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[50]
+ );
+ if(!(lResolution)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ lResolution,
+ wxGBPosition(8, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ chResolution = new wxChoice(
+ dkctGUIContentsPanel,
+ Bmpp4Frame_Resolution,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 3,
+ saResolution
+ );
+ if(!(chResolution)) {
+ goto dkctGUILayoutFinished;
+ }
+ chResolution->SetToolTip(sTexts[51]);
+ contentsSizer->Add(
+ chResolution,
+ wxGBPosition(8, 1),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ tfResolution = new wxTextCtrl(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[55]
+ );
+ if(!(tfResolution)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ tfResolution,
+ wxGBPosition(8, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ cbAnColor = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[57]
+ );
+ if(!(cbAnColor)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbAnColor->SetToolTip(sTexts[58]);
+ contentsSizer->Add(
+ cbAnColor,
+ wxGBPosition(8, 7),
+ wxGBSpan(1, 4),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lBackground = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[59]
+ );
+ if(!(lBackground)) {
+ goto dkctGUILayoutFinished;
+ }
+ contentsSizer->Add(
+ lBackground,
+ wxGBPosition(9, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ ccBackground = new Dk4WxColourView(
+ dkctGUIContentsPanel,wxID_ANY,applicationHelper, 255, 255, 255
+ );
+ if(!(ccBackground)) {
+ goto dkctGUILayoutFinished;
+ }
+ ccBackground->SetToolTip(sTexts[60]);
+ contentsSizer->Add(
+ ccBackground,
+ wxGBPosition(9, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbBackground = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[61]
+ );
+ if(!(cbBackground)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbBackground->SetToolTip(sTexts[62]);
+ contentsSizer->Add(
+ cbBackground,
+ wxGBPosition(9, 2),
+ wxGBSpan(1, 3),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbAnAlpha = new wxCheckBox(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[63]
+ );
+ if(!(cbAnAlpha)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbAnAlpha->SetToolTip(sTexts[64]);
+ contentsSizer->Add(
+ cbAnAlpha,
+ wxGBPosition(9, 7),
+ wxGBSpan(1, 4),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ verticalSizer->Add(
+ contentsSizer
+ );
+ verticalSizer->Add(10, 10, 0);
+ mainSizer->Add(
+ verticalSizer,
+ 1,
+ wxGROW
+ );
+ mainSizer->Add(10, 10, 0);
+ dkctGUIContentsPanel->SetSizer(mainSizer);
+ SetIcon(wxbmpp_icon);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+#if wxUSE_STATUSBAR
+ if(dkctGUILayoutOK) {
+ CreateStatusBar(1);
+ SetStatusText(sTexts[8]);
+ }
+#endif
+ if(dkctGUILayoutOK) {
+ mainSizer->Fit(this);
+ mainSizer->SetSizeHints(this);
+ }
+
+#line 757 "Bmpp4Frame.wxc"
+ if(dkctGUILayoutOK) {
+ chOutputMode->SetSelection(0);
+ chPsLevel->SetSelection(0);
+ chFinishing->SetSelection(0);
+ chResolution->SetSelection(0);
+ chPaperSizes->SetSelection(0);
+ chRgbToGray->SetSelection(0);
+ CorrectGUI();
+ SetTitle(nlWx[0]);
+#if 0
+ /* 2018-05-27 Test for setActive() method.
+ This line was added temporarily just to test the
+ new setActive() method.
+ */
+ ccBackground->SetActive(false);
+
+
+#line 773 "Bmpp4Frame.wxc"
+#endif
+ ccBackground->SetPlaceColourChooser();
+ }
+
+ /* __CHANGE__ 012: Release resources allocated by local variables.
+ */
+
+
+
+#line 781 "Bmpp4Frame.wxc"
+}
+
+
+#line 784 "Bmpp4Frame.wxc"
+
+
+
+Bmpp4Frame::~Bmpp4Frame()
+{
+
+
+#line 790 "Bmpp4Frame.wxc"
+
+ /* __CHANGE__ 011: Release resources allocated by further class members.
+ */
+
+
+
+#line 795 "Bmpp4Frame.wxc"
+}
+
+
+
+bool
+Bmpp4Frame::CanClose(bool isLast)
+{
+ bool back = true;
+
+
+#line 804 "Bmpp4Frame.wxc"
+
+ /* __CHANGE__ 013: Check for unsaved data.
+ */
+ if (isLast) {
+ SaveSettings();
+ }
+
+
+
+#line 812 "Bmpp4Frame.wxc"
+ return back;
+}
+
+
+void
+Bmpp4Frame::OnQuit(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 820 "Bmpp4Frame.wxc"
+
+
+#line 821 "Bmpp4Frame.wxc"
+ Close();
+}
+
+
+
+void
+Bmpp4Frame::OnAbout(wxCommandEvent & WXUNUSED(event))
+{
+ wxString text(wxT(""));
+ wxString title(wxT(""));
+
+
+#line 832 "Bmpp4Frame.wxc"
+ /* Construct message text. */
+ text.Append(sNlWx[0]);
+ text.Append(sNlWx[7]);
+#if 0
+ text.Append(sNlWx[1]);
+#else
+ text.Append(DKT_VERSION_WX);
+#endif
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[9]);
+ text.Append(sNlWx[2]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[9]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[10]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[13]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[14]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[15]);
+ text.Append(sNlWx[8]);
+
+ /* Construct dialog box title. */
+ title.Append(sTexts[10]);
+ title.Append(sNlWx[0]);
+
+ /* Show dialog box. */
+ wxMessageBox(text, title);
+
+ /* __CHANGE__ 019: Create better about box.
+ */
+
+
+#line 875 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 883 "Bmpp4Frame.wxc"
+ DisplayContents();
+
+
+#line 885 "Bmpp4Frame.wxc"
+}
+
+
+/* __CHANGE__ 017: Event handlers for further events.
+*/
+
+
+void
+Bmpp4Frame::OnChooseDirectory(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 896 "Bmpp4Frame.wxc"
+ wxDirDialog dd(
+ this, sTexts[71], sDirname, (wxDD_DIR_MUST_EXIST | wxDD_CHANGE_DIR)
+ );
+ pAppHelp->ChooseChildPosition(*this, dd, false);
+ if(dd.ShowModal() == wxID_OK) {
+ sDirname = dd.GetPath();
+ lDirectoryName->SetLabel(sDirname);
+#if 0
+ lDirectoryName->(wxALIGN_CENTRE_HORIZONTAL);
+#endif
+ Refresh();
+ Update();
+ }
+ else {
+ }
+
+
+#line 912 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::OnResetOptions(wxCommandEvent & WXUNUSED(event))
+{
+ wxString sA4(wxT("a4"));
+ int res;
+
+
+#line 922 "Bmpp4Frame.wxc"
+ res = wxMessageBox(
+ sTexts[75], sTexts[74], (wxNO_DEFAULT | wxYES_NO | wxICON_QUESTION)
+ );
+ if (wxYES == res) {
+ dk4gra_conf_init(&graconf);
+ res = asPaperSizes.Index(sA4);
+ if (wxNOT_FOUND != res) {
+ chPaperSizes->SetSelection(res);
+ dk4mem_cpy(
+ &(graconf.media),
+ &(pPaperSizes[res]),
+ sizeof(dk4_paper_size_t),
+ NULL
+ );
+ graconf.media.name = NULL;
+ graconf.psi = (size_t)res;
+ graconf.have_psi = 1;
+ }
+ ConfigurationToGUI();
+ CorrectGUI();
+ }
+
+
+#line 944 "Bmpp4Frame.wxc"
+}
+
+
+
+bool
+Bmpp4Frame::CheckPaperSizeForDocuments(void)
+{
+ bool back = true;
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ if (graconf.media.w < (graconf.media.i + graconf.media.o)) {
+ back = false;
+ }
+ if (graconf.media.h < (graconf.media.b + graconf.media.t)) {
+ back = false;
+ }
+ }
+ return back;
+}
+
+
+
+bool
+Bmpp4Frame::RunConversion(void)
+{
+ wxString errorString(wxT(""));
+ bool back = false;
+
+
+#line 971 "Bmpp4Frame.wxc"
+
+ /* Transfer GUI state to grahpics output configuration
+ if not specified on the command line.
+ */
+ if (bRestoreGx) {
+ ConfigurationFromGUI();
+ }
+ if (!(bAutorun)) {
+ bMakeMode = ((0 != cbMakeMode->GetValue()) ? (true) : (false));
+ }
+ /*
+ Check for usable paper size
+ */
+ if (CheckPaperSizeForDocuments()) {
+ /*
+ Do conversion operations in idle events or modal dialog.
+ */
+ Bmpp4Progress dPro(
+ this, pAppHelp, sTexts, sDirname, &graconf, bMakeMode, &errorString
+ );
+ if (dPro.PrepareProcessing()) {
+
+
+#line 993 "Bmpp4Frame.wxc"
+ pAppHelp->ChooseChildPosition(*this, dPro);
+ if (wxID_OK == dPro.ShowModal()) {
+ back = true;
+ }
+ else {
+
+#line 998 "Bmpp4Frame.wxc"
+ /* ERRROR: Aborted or errors */
+ wxMessageBox(
+ errorString, sTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR),
+ this
+ );
+ }
+
+
+#line 1006 "Bmpp4Frame.wxc"
+ }
+ else {
+
+#line 1008 "Bmpp4Frame.wxc"
+ /* ERROR: Failed to prepare processing */
+ wxMessageBox(
+ errorString, sTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR),
+ this
+ );
+ }
+
+
+#line 1016 "Bmpp4Frame.wxc"
+ dPro.Cleanup();
+
+
+#line 1018 "Bmpp4Frame.wxc"
+ }
+ else {
+
+#line 1020 "Bmpp4Frame.wxc"
+ /* ERROR: Unusable paper size */
+ wxMessageBox(
+ sTexts[111], sTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR),
+ this
+ );
+ }
+
+
+
+#line 1029 "Bmpp4Frame.wxc"
+ return back;
+}
+
+
+
+void
+Bmpp4Frame::OnRunConversion(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1038 "Bmpp4Frame.wxc"
+ (void)RunConversion();
+
+
+#line 1040 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::OnOutputType(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1048 "Bmpp4Frame.wxc"
+ CorrectGUI();
+
+
+#line 1050 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::OnPSLevel(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1058 "Bmpp4Frame.wxc"
+ CorrectGUI();
+
+
+#line 1060 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::OnResolution(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1068 "Bmpp4Frame.wxc"
+ CorrectGUI();
+
+
+#line 1070 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::OnInterpolationChange(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1078 "Bmpp4Frame.wxc"
+ CorrectGUI();
+
+
+#line 1080 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::OnColorOutput(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1088 "Bmpp4Frame.wxc"
+ CorrectGUI();
+
+
+#line 1090 "Bmpp4Frame.wxc"
+}
+
+
+
+/* __CHANGE__ 014: Implementation of further methods.
+*/
+
+
+void
+Bmpp4Frame::SaveSettings(void)
+{
+ int ival[20];
+ size_t i;
+
+
+#line 1104 "Bmpp4Frame.wxc"
+ if (bRestoreGx) {
+
+#line 1105 "Bmpp4Frame.wxc"
+ for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; }
+ ival[ 0] = chPaperSizes->GetSelection();
+ ival[ 1] = chOutputMode->GetSelection();
+ ival[ 2] = cbColorOutput->GetValue();
+ ival[ 3] = chPsLevel->GetSelection();
+ ival[ 4] = cbDsc->GetValue();
+ ival[ 5] = cbLzw->GetValue();
+ ival[ 6] = cbRotation->GetValue();
+ ival[ 7] = chFinishing->GetSelection();
+ ival[ 8] = chResolution->GetSelection();
+ ival[ 9] = ccBackground->Red();
+ ival[10] = ccBackground->Green();
+ ival[11] = ccBackground->Blue();
+ ival[12] = cbBackground->GetValue();
+ ival[13] = cbImgInterpolation->GetValue();
+ ival[14] = cbDct->GetValue();
+ ival[15] = cbDctInterpolation->GetValue();
+ ival[16] = cbAnBpc->GetValue();
+ ival[17] = cbAnColor->GetValue();
+ ival[18] = cbAnAlpha->GetValue();
+ ival[19] = chRgbToGray->GetSelection();
+ pAppHelp->SetMultiple(i_option_names, ival, 20);
+ }
+ if (bRestoreMake) {
+
+#line 1129 "Bmpp4Frame.wxc"
+ ival[0] = cbMakeMode->GetValue();
+ pAppHelp->SetMultiple(i_make_names, ival, 1);
+ }
+ if (bRestoreLocation) {
+
+#line 1133 "Bmpp4Frame.wxc"
+ pAppHelp->SetString(i_dir_names[0], sDirname);
+ }
+
+
+#line 1136 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::RestoreSettings(void)
+{
+ int ival[20];
+ size_t i;
+
+
+#line 1146 "Bmpp4Frame.wxc"
+ if (bRestoreGx) {
+
+#line 1147 "Bmpp4Frame.wxc"
+ for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; }
+ ival[ 0] = 0;
+ ival[ 1] = 0;
+ ival[ 2] = 1;
+ ival[ 3] = 1;
+ ival[ 4] = 1;
+ ival[ 5] = 0;
+ ival[ 6] = 1;
+ ival[ 7] = 1;
+ ival[ 8] = 0;
+ ival[ 9] = 255;
+ ival[10] = 255;
+ ival[11] = 255;
+ ival[12] = 0;
+ ival[13] = 1;
+ ival[14] = 1;
+ ival[15] = 0;
+ ival[16] = 1;
+ ival[17] = 1;
+ ival[18] = 1;
+ ival[19] = 0;
+ pAppHelp->GetMultiple(i_option_names, ival, 20);
+ if ((0 <= ival[0]) && ((int)szPaperSizes > ival[0])) {
+ chPaperSizes->SetSelection(ival[0]);
+ }
+ if (0 <= ival[1]) { chOutputMode->SetSelection(ival[1]); }
+ cbColorOutput->SetValue((0 != ival[2]) ? (true) : (false));
+ if (0 <= ival[3]) { chPsLevel->SetSelection(ival[3]); }
+ cbDsc->SetValue((0 != ival[4]) ? (true) : (false));
+ cbLzw->SetValue((0 != ival[5]) ? (true) : (false));
+ cbRotation->SetValue((0 != ival[6]) ? (true) : (false));
+ if (0 <= ival[7]) { chFinishing->SetSelection(ival[7]); }
+ if (0 <= ival[8]) { chResolution->SetSelection(ival[8]); }
+ ccBackground->SetRGB(ival[9], ival[10], ival[11]);
+ cbBackground->SetValue((0 != ival[12]) ? (true) : (false));
+ cbImgInterpolation->SetValue((0 != ival[13]) ? (true) : (false));
+ cbDct->SetValue((0 != ival[14]) ? (true) : (false));
+ cbDctInterpolation->SetValue((0 != ival[15]) ? (true) : (false));
+ cbAnBpc->SetValue((0 != ival[16]) ? (true) : (false));
+ cbAnColor->SetValue((0 != ival[17]) ? (true) : (false));
+ cbAnAlpha->SetValue((0 != ival[18]) ? (true) : (false));
+ if (0 <= ival[19]) { chRgbToGray->SetSelection(ival[19]); }
+ }
+ else {
+
+#line 1191 "Bmpp4Frame.wxc"
+ ConfigurationToGUI();
+ }
+ if (bRestoreMake) {
+
+#line 1194 "Bmpp4Frame.wxc"
+ for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; }
+ ival[ 0] = 0;
+ pAppHelp->GetMultiple(i_make_names, ival, 1);
+ cbMakeMode->SetValue((0 != ival[0]) ? (true) : (false));
+ bMakeMode = ((0 != ival[0]) ? true : false);
+ }
+ else {
+ cbMakeMode->SetValue(bMakeMode ? (1) : (0));
+ }
+ if (bRestoreLocation) {
+
+#line 1204 "Bmpp4Frame.wxc"
+ if (pAppHelp->GetString(i_dir_names[0], &sDirname)) {
+ lDirectoryName->SetLabel(sDirname);
+ Refresh();
+ Update();
+ }
+ }
+
+
+#line 1211 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::CorrectGUI(void)
+{
+
+
+#line 1219 "Bmpp4Frame.wxc"
+ if (!bIsCorrecting) {
+
+#line 1220 "Bmpp4Frame.wxc"
+ /*
+ Avoid recursive calls
+ */
+ bIsCorrecting = true;
+
+ /*
+ Enable or disable PS specific components
+ */
+ switch (chOutputMode->GetSelection()) {
+ case 0 : case 1 : case 2 : { /* PDF */
+ chPsLevel->Enable(false);
+ cbDsc->Enable(false);
+ cbLzw->Enable(false);
+ } break;
+ default : { /* PS or EPS */
+ chPsLevel->Enable(true);
+ cbDsc->Enable(true);
+ if (0 == chPsLevel->GetSelection()) { /* PS 2 */
+ cbLzw->Enable(true);
+ }
+ else { /* PS 3 */
+ cbLzw->Enable(false);
+ }
+ } break;
+ }
+
+ /*
+ Enable or disable job specific components
+ */
+ switch (chOutputMode->GetSelection()) {
+ case 2: case 5: { /* document */
+ chFinishing->Enable(true);
+ cbRotation->Enable(true);
+ chPaperSizes->Enable(true);
+ } break;
+ default: { /* not a document */
+ chFinishing->Enable(false);
+ cbRotation->Enable(false);
+ chPaperSizes->Enable(false);
+ } break;
+ }
+
+ /*
+ Enable or disable resolution text input field
+ */
+ switch(chResolution->GetSelection()) {
+ case 2: {
+ tfResolution->Enable(true);
+ } break;
+ default: {
+ tfResolution->Enable(false);
+ } break;
+ }
+
+ /*
+ Enable or disable Interpolation DCT
+ */
+ if (0 != cbImgInterpolation->GetValue()) {
+ cbDctInterpolation->Enable(true);
+ }
+ else {
+ cbDctInterpolation->Enable(false);
+ }
+
+ /*
+ Enable or disable RGB to gray method selection
+ */
+ if (0 != cbColorOutput->GetValue()) {
+ chRgbToGray->Enable(false);
+ }
+ else {
+ chRgbToGray->Enable(true);
+ }
+
+ /*
+ Mark as done
+ */
+ bIsCorrecting = false;
+ /*
+ Update GUI
+ */
+ Refresh();
+ Update();
+ }
+
+
+#line 1305 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::ConfigurationToGUI(void)
+{
+ wxChar b1[64]; /* Conversion buffer */
+ wxChar b2[DK4_SIZEOF(b1,wxChar)]; /* Conversion buffer */
+ size_t szb = DK4_SIZEOF(b1,wxChar); /* Size of b1 and b2 (elems) */
+ size_t papi = 0; /* Paper size index */
+ int res = 0; /* Operation result */
+
+
+#line 1318 "Bmpp4Frame.wxc"
+ /* Output mode
+ */
+ switch (graconf.driver) {
+ case DK4_GRA_DRIVER_PS : {
+ switch (graconf.purpose) {
+ case DK4_GRA_PURPOSE_DOCUMENT : {
+ chOutputMode->SetSelection(5);
+ } break;
+ default : {
+ chOutputMode->SetSelection(4);
+ } break;
+ }
+ } break;
+ case DK4_GRA_DRIVER_EPS : {
+ chOutputMode->SetSelection(3);
+ } break;
+ default : {
+ switch (graconf.purpose) {
+ case DK4_GRA_PURPOSE_DOCUMENT : {
+ chOutputMode->SetSelection(2);
+ } break;
+ case DK4_GRA_PURPOSE_IMAGE : {
+ chOutputMode->SetSelection(1);
+ } break;
+ default : { /* DK4_GRA_PURPOSE_OBJECT */
+ chOutputMode->SetSelection(0);
+ } break;
+ }
+ } break;
+ }
+ /* PS level
+ */
+ chPsLevel->SetSelection((3 == graconf.ps_level) ? (1) : (0));
+ /* DSC
+ */
+ cbDsc->SetValue((0 != graconf.ps_dsc) ? (1) : (0));
+ /* LZW
+ */
+ cbLzw->SetValue((0 != graconf.ps_lzw) ? (1) : (0));
+ /* Paper size
+ */
+ if ((0 != graconf.have_psi) && (szPaperSizes > graconf.psi)) {
+ chPaperSizes->SetSelection((int)(graconf.psi));
+ }
+ else {
+ if (0 != graconf.have_psi) {
+ chPaperSizes->SetSelection(graconf.psi);
+ }
+ else {
+ res = dk4paper_find_nearest(
+ &papi, pPaperSizes, szPaperSizes, &(graconf.media), NULL
+ );
+ if (0 != res) {
+ chPaperSizes->SetSelection(papi);
+ }
+ else {
+ chPaperSizes->SetSelection(0);
+ }
+ }
+ }
+ /* Rotate
+ */
+ cbRotation->SetValue((0 != graconf.img_rot) ? 1 : 0);
+ /* Finishing
+ */
+ if (0 != graconf.doc_tumble) {
+ chFinishing->SetSelection(2);
+ }
+ else {
+ chFinishing->SetSelection((0 != graconf.doc_duplex) ? (1) : (0));
+ }
+ /* Resolution
+ */
+ if ((0.0 < graconf.xres) && (0.0 < graconf.yres)) {
+ chResolution->SetSelection(2);
+ /* 2018-03-28
+ The buffer overflow reported from wxWidgets libraries
+ magically disappeared after rebuilding the entire project
+ with debug messages.
+ May be rebuilding one module was missing before.
+ */
+
+
+#line 1400 "Bmpp4Frame.wxc"
+ if (0 != dk4ma_write_wx_double(b1,szb,graconf.xres,0,1,NULL)) {
+
+
+#line 1402 "Bmpp4Frame.wxc"
+ if (0 != dk4ma_write_wx_double(b2,szb,graconf.yres,0,1,NULL)) {
+
+
+#line 1404 "Bmpp4Frame.wxc"
+ tfResolution->SetValue(wxString(b1) + wxT(" ") + wxString(b2));
+
+
+#line 1406 "Bmpp4Frame.wxc"
+ }
+ else {
+
+#line 1408 "Bmpp4Frame.wxc"
+ }
+ }
+ else {
+
+#line 1411 "Bmpp4Frame.wxc"
+ }
+
+
+#line 1413 "Bmpp4Frame.wxc"
+ }
+ else {
+ chResolution->SetSelection((graconf.img_ign_res) ? (1) : (0));
+ }
+ /* Background
+ */
+ if ((0 <= graconf.img_bg_r) && (256 > graconf.img_bg_r)) {
+ if ((0 <= graconf.img_bg_g) && (256 > graconf.img_bg_g)) {
+ if ((0 <= graconf.img_bg_b) && (256 > graconf.img_bg_b)) {
+ ccBackground->SetRGB(
+ graconf.img_bg_r, graconf.img_bg_g, graconf.img_bg_b
+ );
+ }
+ }
+ }
+ /*
+ Enforce background
+ */
+ cbBackground->SetValue((0 != graconf.img_bg_f) ? (1) : (0));
+ /*
+ Color
+ */
+ cbColorOutput->SetValue((0 != graconf.color) ? (1) : (0));
+ /*
+ Interpolation
+ */
+ cbImgInterpolation->SetValue((0 != graconf.img_int) ? (1) : (0));
+ /*
+ DCT
+ */
+ cbDct->SetValue((0 != graconf.img_dct) ? (1) : (0));
+ /*
+ DCT interpolation
+ */
+ cbDctInterpolation->SetValue((0 != graconf.img_dct_int) ? (1) : (0));
+ /*
+ Analzse bpc
+ */
+ cbAnBpc->SetValue((0 != graconf.img_an_bpc) ? (1) : (0));
+ /*
+ Analzse color
+ */
+ cbAnColor->SetValue((0 != graconf.img_an_color) ? (1) : (0));
+ /*
+ Analyze alpha
+ */
+ cbAnAlpha->SetValue((0 != graconf.img_an_alpha) ? (1) : (0));
+ /*
+ RGB to gray method
+ */
+ if (0 <= graconf.ctx.rgb_to_gray) {
+ chRgbToGray->SetSelection(graconf.ctx.rgb_to_gray);
+ }
+
+
+#line 1467 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::ConfigurationFromGUI(void)
+{
+ wxChar buffer[128];
+ wxChar const *ep;
+ wxChar *p1 = NULL;
+ wxChar *p2 = NULL;
+ double xres = -1.0;
+ double yres = -1.0;
+ size_t szbu = DK4_SIZEOF(buffer,wxChar);
+ int choiceindex;
+ int ok = 0;
+
+
+#line 1484 "Bmpp4Frame.wxc"
+ /* Output mode
+ */
+ switch (chOutputMode->GetSelection()) {
+ case 0 : {
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_OBJECT;
+ } break;
+ case 1 : {
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_IMAGE;
+ } break;
+ case 2 : {
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ } break;
+ case 3 : {
+ graconf.driver = DK4_GRA_DRIVER_EPS;
+ graconf.purpose = DK4_GRA_PURPOSE_IMAGE;
+ } break;
+ case 4 : {
+ graconf.driver = DK4_GRA_DRIVER_PS;
+ graconf.purpose = DK4_GRA_PURPOSE_IMAGE;
+ } break;
+ case 5 : {
+ graconf.driver = DK4_GRA_DRIVER_PS;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ } break;
+ default : {
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_OBJECT;
+ } break;
+ }
+ /* PS level
+ */
+ switch (chPsLevel->GetSelection()) {
+ case 0 : {
+ graconf.ps_level = 2;
+ } break;
+ default : {
+ graconf.ps_level = 3;
+ } break;
+ }
+ /* DSC
+ */
+ graconf.ps_dsc = ((0 != cbDsc->GetValue()) ? 1 : 0);
+ /*
+ LZW
+ */
+ graconf.ps_lzw = ((0 != cbLzw->GetValue()) ? 1 : 0);
+ /*
+ Paper size
+ */
+ choiceindex = chPaperSizes->GetSelection();
+ if ((0 <= choiceindex) && (szPaperSizes > (size_t)choiceindex)) {
+ dk4mem_cpy(
+ &(graconf.media),
+ &(pPaperSizes[choiceindex]),
+ sizeof(dk4_paper_size_t),
+ NULL
+ );
+ }
+ /*
+ Rotate
+ */
+ graconf.img_rot = ((0 != cbRotation->GetValue()) ? 1 : 0);
+ /*
+ Finishing
+ */
+ switch (chFinishing->GetSelection()) {
+ case 2 : {
+ graconf.doc_duplex = 1;
+ graconf.doc_tumble = 1;
+ } break;
+ case 1 : {
+ graconf.doc_duplex = 1;
+ graconf.doc_tumble = 0;
+ } break;
+ default : {
+ graconf.doc_duplex = 0;
+ graconf.doc_tumble = 0;
+ } break;
+ }
+ /* Resolution
+ */
+ switch (chResolution->GetSelection()) {
+ case 2 : { /* specify */
+ /* ##### TODO: Implementation: Retrieve values from text field */
+ wxCStrData valuestrdata = tfResolution->GetValue().c_str();
+ if (
+ 0 != dk4strx_cpy_s(
+ buffer, szbu, (wxChar const *)valuestrdata, NULL
+ )
+ ) {
+ p1 = dk4strx_start(buffer, NULL);
+ if (NULL != p1) {
+ p2 = dk4strx_next(p1, NULL);
+ ep = NULL;
+ if (0 != dk4ma_input_wx_double(&xres, p1, &ep, 1, NULL)) {
+ ok = 1;
+ yres = xres;
+ }
+ if (NULL != p2) {
+ ep = NULL;
+ if (0 == dk4ma_input_wx_double(&yres,p2,&ep,1,NULL)) {
+ ok = 0;
+ }
+ }
+ if (1 == ok) {
+ if ((0.0 < xres) && (0.0 < yres)) {
+ graconf.xres = xres;
+ graconf.yres = yres;
+ }
+ }
+ }
+ }
+ graconf.img_ign_res = 0;
+ } break;
+ case 1 : { /* ignore */
+ graconf.img_ign_res = 1;
+ graconf.xres = graconf.yres = 72.0;
+ } break;
+ default : { /* chunk */
+ graconf.img_ign_res = 0;
+ graconf.xres = graconf.yres = -1.0;
+ } break;
+ }
+ /* Background
+ */
+ graconf.img_bg_r = ccBackground->Red();
+ graconf.img_bg_g = ccBackground->Green();
+ graconf.img_bg_b = ccBackground->Blue();
+ /*
+ Enforce background
+ */
+ graconf.img_bg_f = ((0 != cbBackground->GetValue()) ? 1 : 0);
+ /*
+ Color
+ */
+ graconf.color = ((0 != cbColorOutput->GetValue()) ? 1 : 0);
+ /*
+ Interpolation
+ */
+ graconf.img_int = ((0 != cbImgInterpolation->GetValue()) ? 1 : 0);
+ /*
+ DCT
+ */
+ graconf.img_dct = ((0 != cbDct->GetValue()) ? 1 : 0);
+ /*
+ DCT interpolation
+ */
+ graconf.img_dct_int = ((0 != cbDctInterpolation->GetValue()) ? 1 : 0);
+ /*
+ Analzse bpc
+ */
+ graconf.img_an_bpc = ((0 != cbAnBpc->GetValue()) ? 1 : 0);
+ /*
+ Analzse color
+ */
+ graconf.img_an_color = ((0 != cbAnColor->GetValue()) ? 1 : 0);
+ /*
+ Analyze alpha
+ */
+ graconf.img_an_alpha = ((0 != cbAnAlpha->GetValue()) ? 1 : 0);
+ /*
+ RGB to gray method
+ */
+ switch (chRgbToGray->GetSelection()) {
+ case 12 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE;
+ } break;
+ case 11 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN;
+ } break;
+ case 10 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED;
+ } break;
+ case 9 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION;
+ } break;
+ case 8 : {
+ graconf.ctx.rgb_to_gray =
+ DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION;
+ } break;
+ case 7 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION;
+ } break;
+ case 6 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_DESATURATION;
+ } break;
+ case 5 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_AVERAGE;
+ } break;
+ case 4 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST;
+ } break;
+ case 3 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_FAST;
+ } break;
+ case 2 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709;
+ } break;
+ case 1 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_LUMA;
+ } break;
+ default : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601;
+ } break;
+ }
+
+
+#line 1693 "Bmpp4Frame.wxc"
+}
+
+
+
+void
+Bmpp4Frame::OnIdle(wxIdleEvent & event)
+{
+#if TRACE_DEBUG
+ static unsigned long number = 0UL;
+ dk4_time_t timer;
+#endif
+ bool rqm = false;
+ bool success;
+
+
+#line 1707 "Bmpp4Frame.wxc"
+#if TRACE_DEBUG
+ dk4time_get(&timer);
+#endif
+
+
+#line 1711 "Bmpp4Frame.wxc"
+ if (bActive) {
+
+#line 1712 "Bmpp4Frame.wxc"
+ if (bAutorun) {
+
+#line 1713 "Bmpp4Frame.wxc"
+ switch (oAsc.GetReaction()) {
+ case Dk4WxAutostartController::REACTION_START : {
+
+#line 1715 "Bmpp4Frame.wxc"
+ oAsc.StartProcessing();
+ success = RunConversion();
+ rqm = true;
+ if (success) {
+ lDirectoryName->SetLabel(sTexts[91]);
+ lDirectoryName->SetForegroundColour(cGreen);
+ }
+ else {
+#if 0
+ oAsc.SetAutoExit(false);
+ rqm = false;
+#endif
+ lDirectoryName->SetLabel(sTexts[92]);
+ lDirectoryName->SetForegroundColour(cRed);
+ }
+ lDirectoryName->Refresh();
+ lDirectoryName->Update();
+ oAsc.EndProcessing();
+
+#line 1733 "Bmpp4Frame.wxc"
+ } break;
+ case Dk4WxAutostartController::REACTION_MORE : {
+
+#line 1735 "Bmpp4Frame.wxc"
+ rqm = true;
+ } break;
+ case Dk4WxAutostartController::REACTION_EXIT : {
+
+#line 1738 "Bmpp4Frame.wxc"
+ bActive = false;
+ Show(false);
+ Close();
+ rqm = false;
+ } break;
+ default : { /* includes DK4WX_AUTOSTART_REACTION_IGNORE */
+
+
+#line 1745 "Bmpp4Frame.wxc"
+ } break;
+ }
+ }
+ else {
+
+#line 1749 "Bmpp4Frame.wxc"
+ }
+ }
+ else {
+
+#line 1752 "Bmpp4Frame.wxc"
+ }
+#if TRACE_DEBUG
+ dk4time_get(&timer);
+#endif
+
+
+#line 1757 "Bmpp4Frame.wxc"
+ if (rqm) {
+ event.RequestMore();
+ }
+ event.Skip();
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/Bmpp4Frame.h b/support/dktools/Bmpp4Frame.h
new file mode 100644
index 0000000000..a590fbf486
--- /dev/null
+++ b/support/dktools/Bmpp4Frame.h
@@ -0,0 +1,531 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Bmpp4Frame.wxc
+*/
+
+/** @file Bmpp4Frame.h Header file for the Bmpp4Frame module.
+*/
+
+#ifndef BMPP4FRAME_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define BMPP4FRAME_H_INCLUDED 1
+
+
+#line 273 "Bmpp4Frame.wxc"
+
+
+
+
+#line 277 "Bmpp4Frame.wxc"
+class Bmpp4Frame : public Dk4WxFrame
+{
+ private:
+
+ /** Event table for frame.
+ */
+
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ private:
+
+ /** Start time.
+ */
+ dk4_time_t firsttime;
+
+ /** We are already correcting GUI, no recursive attempt.
+ */
+ bool bIsCorrecting;
+
+ protected:
+
+ /** Auto start controller.
+ */
+ Dk4WxAutostartController oAsc;
+
+ /** Text color for status text on error.
+ */
+ wxColour cRed;
+
+ /** Text color for status text on success.
+ */
+ wxColour cGreen;
+
+ /** Normal text color.
+ */
+ wxColour cBlack;
+
+ /** Localized texts.
+ */
+ wxChar const * const *sTexts;
+
+ /** Non-localized texts.
+ */
+ wxChar const * const *sNlWx;
+
+ /** Non-localized texts.
+ */
+ dkChar const * const *sNlDk;
+
+ /* __CHANGE__ 011: Add further member variables.
+ */
+
+ /** Graphics output configuration.
+ */
+ dk4_gra_conf_t graconf;
+
+ /** Known paper sizes.
+ */
+ dk4_paper_size_t *pPaperSizes;
+
+ /** Paper sizes.
+ */
+ wxArrayString asPaperSizes;
+
+ /** Directory name.
+ */
+ wxString sDirname;
+
+ /** Number of paper sizes in asPaperSizes.
+ */
+ size_t szPaperSizes;
+
+ /** Restore and save graphics conversion settings.
+ */
+ bool bRestoreGx;
+
+ /** Restore and save Make mode setting.
+ */
+ bool bRestoreMake;
+
+ /** Restore and save location to process.
+ */
+ bool bRestoreLocation;
+
+ /** Make mode setting from options, if not restored.
+ */
+ bool bMakeMode;
+
+ /** Automatically start.
+ */
+ bool bAutorun;
+
+ /** Flag: Processing idle events.
+ */
+ bool bActive;
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** Contents panel.
+ */
+ wxPanel *dkctGUIContentsPanel;
+
+ /** GUI element mainSizer.
+ */
+#line 90 "Bmpp4Frame.wxc"
+ wxBoxSizer *mainSizer;
+
+ /** GUI element mbMain.
+ */
+#line 20 "Bmpp4Frame.wxc"
+ wxMenuBar *mbMain;
+
+ /** GUI element tbMain.
+ */
+#line 74 "Bmpp4Frame.wxc"
+ wxToolBar *tbMain;
+
+ /** GUI element menuFile.
+ */
+#line 26 "Bmpp4Frame.wxc"
+ wxMenu *menuFile;
+
+ /** GUI element menuConversion.
+ */
+#line 31 "Bmpp4Frame.wxc"
+ wxMenu *menuConversion;
+
+ /** GUI element menuExtras.
+ */
+#line 50 "Bmpp4Frame.wxc"
+ wxMenu *menuExtras;
+
+ /** GUI element menuHelp.
+ */
+#line 59 "Bmpp4Frame.wxc"
+ wxMenu *menuHelp;
+
+ /** GUI element miFileDirectory.
+ */
+#line 35 "Bmpp4Frame.wxc"
+ wxMenuItem *miFileDirectory;
+
+ /** GUI element miFileExit.
+ */
+#line 40 "Bmpp4Frame.wxc"
+ wxMenuItem *miFileExit;
+
+ /** GUI element miConversionRun.
+ */
+#line 45 "Bmpp4Frame.wxc"
+ wxMenuItem *miConversionRun;
+
+ /** GUI element miExtrasOptionReset.
+ */
+#line 54 "Bmpp4Frame.wxc"
+ wxMenuItem *miExtrasOptionReset;
+
+ /** GUI element miHelpAbout.
+ */
+#line 64 "Bmpp4Frame.wxc"
+ wxMenuItem *miHelpAbout;
+
+ /** GUI element miHelpContents.
+ */
+#line 69 "Bmpp4Frame.wxc"
+ wxMenuItem *miHelpContents;
+
+ /** GUI element bChooseDir.
+ */
+#line 78 "Bmpp4Frame.wxc"
+ wxToolBarToolBase *bChooseDir;
+
+ /** GUI element bRunConversion.
+ */
+#line 84 "Bmpp4Frame.wxc"
+ wxToolBarToolBase *bRunConversion;
+
+ /** GUI element verticalSizer.
+ */
+#line 96 "Bmpp4Frame.wxc"
+ wxBoxSizer *verticalSizer;
+
+ /** GUI element contentsSizer.
+ */
+#line 104 "Bmpp4Frame.wxc"
+ wxGridBagSizer *contentsSizer;
+
+ /** GUI element staticline0.
+ */
+#line 148 "Bmpp4Frame.wxc"
+ wxStaticLine *staticline0;
+
+ /** GUI element lDirectoryName.
+ */
+#line 151 "Bmpp4Frame.wxc"
+ wxStaticText *lDirectoryName;
+
+ /** GUI element staticline1.
+ */
+#line 156 "Bmpp4Frame.wxc"
+ wxStaticLine *staticline1;
+
+ /** GUI element cbMakeMode.
+ */
+#line 159 "Bmpp4Frame.wxc"
+ wxCheckBox *cbMakeMode;
+
+ /** GUI element cbColorOutput.
+ */
+#line 163 "Bmpp4Frame.wxc"
+ wxCheckBox *cbColorOutput;
+
+ /** GUI element lRgbToGray.
+ */
+#line 168 "Bmpp4Frame.wxc"
+ wxStaticText *lRgbToGray;
+
+ /** GUI element chRgbToGray.
+ */
+#line 171 "Bmpp4Frame.wxc"
+ wxChoice *chRgbToGray;
+
+ /** GUI element lOutputMode.
+ */
+#line 175 "Bmpp4Frame.wxc"
+ wxStaticText *lOutputMode;
+
+ /** GUI element chOutputMode.
+ */
+#line 178 "Bmpp4Frame.wxc"
+ wxChoice *chOutputMode;
+
+ /** GUI element cbImgInterpolation.
+ */
+#line 184 "Bmpp4Frame.wxc"
+ wxCheckBox *cbImgInterpolation;
+
+ /** GUI element lPsLevel.
+ */
+#line 189 "Bmpp4Frame.wxc"
+ wxStaticText *lPsLevel;
+
+ /** GUI element chPsLevel.
+ */
+#line 192 "Bmpp4Frame.wxc"
+ wxChoice *chPsLevel;
+
+ /** GUI element cbDsc.
+ */
+#line 197 "Bmpp4Frame.wxc"
+ wxCheckBox *cbDsc;
+
+ /** GUI element cbLzw.
+ */
+#line 201 "Bmpp4Frame.wxc"
+ wxCheckBox *cbLzw;
+
+ /** GUI element cbDct.
+ */
+#line 205 "Bmpp4Frame.wxc"
+ wxCheckBox *cbDct;
+
+ /** GUI element lPaperSize.
+ */
+#line 209 "Bmpp4Frame.wxc"
+ wxStaticText *lPaperSize;
+
+ /** GUI element chPaperSizes.
+ */
+#line 212 "Bmpp4Frame.wxc"
+ wxChoice *chPaperSizes;
+
+ /** GUI element cbRotation.
+ */
+#line 217 "Bmpp4Frame.wxc"
+ wxCheckBox *cbRotation;
+
+ /** GUI element cbDctInterpolation.
+ */
+#line 221 "Bmpp4Frame.wxc"
+ wxCheckBox *cbDctInterpolation;
+
+ /** GUI element lFinishing.
+ */
+#line 225 "Bmpp4Frame.wxc"
+ wxStaticText *lFinishing;
+
+ /** GUI element chFinishing.
+ */
+#line 228 "Bmpp4Frame.wxc"
+ wxChoice *chFinishing;
+
+ /** GUI element cbAnBpc.
+ */
+#line 233 "Bmpp4Frame.wxc"
+ wxCheckBox *cbAnBpc;
+
+ /** GUI element lResolution.
+ */
+#line 237 "Bmpp4Frame.wxc"
+ wxStaticText *lResolution;
+
+ /** GUI element chResolution.
+ */
+#line 240 "Bmpp4Frame.wxc"
+ wxChoice *chResolution;
+
+ /** GUI element tfResolution.
+ */
+#line 246 "Bmpp4Frame.wxc"
+ wxTextCtrl *tfResolution;
+
+ /** GUI element cbAnColor.
+ */
+#line 250 "Bmpp4Frame.wxc"
+ wxCheckBox *cbAnColor;
+
+ /** GUI element lBackground.
+ */
+#line 254 "Bmpp4Frame.wxc"
+ wxStaticText *lBackground;
+
+ /** GUI element ccBackground.
+ */
+#line 257 "Bmpp4Frame.wxc"
+ Dk4WxColourView *ccBackground;
+
+ /** GUI element cbBackground.
+ */
+#line 261 "Bmpp4Frame.wxc"
+ wxCheckBox *cbBackground;
+
+ /** GUI element cbAnAlpha.
+ */
+#line 265 "Bmpp4Frame.wxc"
+ wxCheckBox *cbAnAlpha;
+
+
+#line 378 "Bmpp4Frame.wxc"
+
+ public:
+
+ /** Constructor.
+ @param wxid Window ID.
+ @param applicationHelper Application helper object.
+ @param hc Help controller for online help.
+ @param localizedTexts Localized wxChar texts.
+ @param nlWx Non-localized wxChar texts.
+ @param nlDk Non-localized dkChar texts.
+ */
+ Bmpp4Frame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk,
+ dk4_gra_conf_t *pgc,
+ wxArrayString *pPapSiz,
+ wxChar *pDir,
+ size_t szPap,
+ bool bRGx,
+ bool bRMa,
+ bool bRLo,
+ bool bMak,
+ bool bRun,
+ dk4_paper_size_t *pSizes
+ );
+
+ /** Destructor.
+ */
+ ~Bmpp4Frame();
+
+ /** Check whether we can close the window.
+ @param isLast Flag: Last main window to close.
+ */
+ bool
+ CanClose(bool isFinal);
+
+ /** Save current settings.
+ */
+ void
+ SaveSettings(void);
+
+ /** Restore settings from previous session.
+ */
+ void
+ RestoreSettings(void);
+
+
+ /** Modify enabled or disabled state of GUI components.
+ */
+ void
+ CorrectGUI(void);
+
+ /** Check for documents whether paper size is usable.
+ @return True on success, false on error.
+ */
+ bool
+ CheckPaperSizeForDocuments(void);
+
+ /** Run Conversion.
+ @return True on success, false on error.
+ */
+ bool
+ RunConversion(void);
+
+ /** Handler for File/Exit.
+ @param event Event to process.
+ */
+ void
+ OnQuit(wxCommandEvent & event);
+
+ /** Handler for Help/About.
+ @param event Event to process.
+ */
+ void
+ OnAbout(wxCommandEvent & event);
+
+ /** Handler for Help/Contents.
+ @param event Event to process.
+ */
+ void
+ OnHelpContents(wxCommandEvent & event);
+
+ /* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+ */
+ /** Handler for idle events.
+ */
+ void
+ OnIdle(wxIdleEvent & event);
+
+ /* __CHANGE__ 017: Event handlers for further events.
+ */
+
+ /** Handler for choose directory command.
+ */
+ void
+ OnChooseDirectory(wxCommandEvent & event);
+
+ /** Handler for reset options command.
+ */
+ void
+ OnResetOptions(wxCommandEvent & event);
+
+
+ /** Handler for run conversion command.
+ */
+ void
+ OnRunConversion(wxCommandEvent & event);
+
+ /** Handler for output type change.
+ */
+ void
+ OnOutputType(wxCommandEvent & event);
+
+ /** Handler for PS level change.
+ */
+ void
+ OnPSLevel(wxCommandEvent & event);
+
+ /** Handler for resolution setting change.
+ */
+ void
+ OnResolution(wxCommandEvent & event);
+
+ /** Handler for interpolation checkbox change.
+ */
+ void
+ OnInterpolationChange(wxCommandEvent & event);
+
+ /** Handler for color output checkbox change.
+ */
+ void
+ OnColorOutput(wxCommandEvent & event);
+
+ /* __CHANGE__ 014: Add further methods.
+ */
+
+ /** Place configuration settings from graconf to GUI.
+ */
+ void
+ ConfigurationToGUI(void);
+
+ /** Fill graconf from GUI.
+ */
+ void
+ ConfigurationFromGUI(void);
+
+};
+
+
+#line 531 "Bmpp4Frame.wxc"
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/Bmpp4Frame.wxc b/support/dktools/Bmpp4Frame.wxc
new file mode 100644
index 0000000000..c99adfc66b
--- /dev/null
+++ b/support/dktools/Bmpp4Frame.wxc
@@ -0,0 +1,1764 @@
+%% options
+
+copyright owner = Dirk Krause
+
+copyright year = 2018-xxxx
+
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% wx-gui
+
+type = frame
+contents = mainSizer
+icon = wxbmpp_icon
+status bar = 1 sTexts[8]
+menu bar = mbMain
+tool bar = tbMain
+
+[wxMenuBar mbMain]
+contents = menuFile
+contents = menuConversion
+contents = menuExtras
+contents = menuHelp
+
+[wxMenu menuFile]
+text = sTexts[0]
+contents = miFileDirectory
+contents = miFileExit
+
+[wxMenu menuConversion]
+text = sTexts[67]
+contents = miConversionRun
+
+[wxMenuItem miFileDirectory]
+id = Bmpp4Frame_Choose_Directory
+text = sTexts[65]
+tip = sTexts[66]
+
+[wxMenuItem miFileExit]
+id = Bmpp4Frame_Quit
+text = sTexts[1]
+tip = sTexts[2]
+
+[wxMenuItem miConversionRun]
+id = Bmpp4Frame_Run_Conversion
+text = sTexts[68]
+tip = sTexts[69]
+
+[wxMenu menuExtras]
+text = sTexts[72]
+contents = miExtrasOptionReset
+
+[wxMenuItem miExtrasOptionReset]
+text = sTexts[73]
+id = Bmpp4Frame_Reset_Options
+tip = sTexts[122]
+
+[wxMenu menuHelp]
+text = sTexts[3]
+contents = miHelpAbout
+contents = miHelpContents
+
+[wxMenuItem miHelpAbout]
+id = Bmpp4Frame_Help_About
+text = sTexts[4]
+tip = sTexts[5]
+
+[wxMenuItem miHelpContents]
+id = Bmpp4Frame_Help_Contents
+text = sTexts[6]
+tip = sTexts[7]
+
+[wxToolBar tbMain]
+contents = bChooseDir
+contents = bRunConversion
+
+[wxToolBarToolBase bChooseDir]
+bitmap = xpm_choose_dir
+text = sTexts[65]
+tip = sTexts[66]
+id = Bmpp4Frame_Choose_Directory
+
+[wxToolBarToolBase bRunConversion]
+bitmap = xpm_run_conversion
+text = sTexts[68]
+tip = sTexts[69]
+id = Bmpp4Frame_Run_Conversion
+
+[wxBoxSizer mainSizer]
+direction = horizontal
+contents = $space(10)
+contents = verticalSizer
+contents = $space(10)
+
+[wxBoxSizer verticalSizer]
+direction = vertical
+grow = yes
+proportion = 1
+contents = $space(10)
+contents = contentsSizer
+contents = $space(10)
+
+[wxGridBagSizer contentsSizer]
+grid = 5 5
+
+# __CHANGE__ 015: The dummy label was added to have at least
+# one GUI element in the sizer.
+# Remove lDummy (next 4 lines) and add the real
+# window contents here.
+
+contents = staticline0 0 0 1 11 centered-x centered-y
+contents = lDirectoryName +1 0 1 11 centered-x centered-y
+contents = staticline1 +1 0 1 11 centered-x centered-y
+contents = cbMakeMode +1 0 1 7 left centered-y
+contents = cbColorOutput . 7 1 1 left centered-y
+contents = $space(10,1) . +1 1 1 left centered-y
+contents = lRgbToGray . +1 1 1 left centered-y
+contents = chRgbToGray . +1 1 1 left centered-y
+contents = lOutputMode +1 0 1 1 right centered-y
+contents = chOutputMode . +1 1 2 left centered-y
+contents = cbImgInterpolation . 7 1 4 left centered-y
+contents = lPsLevel +1 0 1 1 right centered-y
+contents = chPsLevel . +1 1 1 left centered-y
+# contents = $space(10,1) . +1 1 1 left centered-y
+contents = cbDsc . +1 1 1 left centered-y
+# contents = $space(10,1) . +1 1 1 left centered-y
+contents = cbLzw . +1 1 1 left centered-y
+# contents = $space(10,1) . +1 1 1 left centered-y
+contents = cbDct . 7 1 4 left centered-y
+contents = lPaperSize +1 0 1 1 right centered-y
+# Choice box for Paper sizes here
+contents = chPaperSizes . +1 1 2 left centered-y
+contents = cbRotation . 3 1 2 left centered-y
+contents = cbDctInterpolation . 7 1 4 left centered-y
+contents = lFinishing +1 0 1 1 right centered-y
+contents = chFinishing . +1 1 2 left centered-y
+contents = cbAnBpc . 7 1 4 left centered-y
+contents = lResolution +1 0 1 1 right centered-y
+contents = chResolution . +1 1 2 left centered-y
+contents = tfResolution . 3 1 1 left centered-y
+contents = cbAnColor . 7 1 4 left centered-y
+contents = lBackground +1 0 1 1 right centered-y
+contents = ccBackground . +1 1 1 left centered-y
+contents = cbBackground . 2 1 3 left centered-y
+contents = cbAnAlpha . 7 1 4 left centered-y
+
+[wxStaticLine staticline0]
+grow = yes
+
+[wxStaticText lDirectoryName]
+text = slDirname
+text style = left
+grow = yes
+
+[wxStaticLine staticline1]
+grow = yes
+
+[wxCheckBox cbMakeMode]
+text = sTexts[13]
+tip = sTexts[14]
+
+[wxCheckBox cbColorOutput]
+text = sTexts[15]
+tip = sTexts[16]
+id = Bmpp4Frame_Color_Output
+
+[wxStaticText lRgbToGray]
+text = sTexts[89]
+
+[wxChoice chRgbToGray]
+choices = 13 saRgbToGray
+tip = sTexts[90]
+
+[wxStaticText lOutputMode]
+text = sTexts[17]
+
+[wxChoice chOutputMode]
+choices = 6 saOutputMode
+tip = sTexts[24]
+grow = yes
+id = Bmpp4Frame_Output_Type
+
+[wxCheckBox cbImgInterpolation]
+text = sTexts[25]
+tip = sTexts[26]
+id = Bmpp4Frame_Change_Interpolation
+
+[wxStaticText lPsLevel]
+text = sTexts[27]
+
+[wxChoice chPsLevel]
+choices = 2 saPsLevel
+tip = sTexts[30]
+id = Bmpp4Frame_PS_Level
+
+[wxCheckBox cbDsc]
+text = sTexts[31]
+tip = sTexts[32]
+
+[wxCheckBox cbLzw]
+text = sTexts[33]
+tip = sTexts[34]
+
+[wxCheckBox cbDct]
+text = sTexts[35]
+tip = sTexts[36]
+
+[wxStaticText lPaperSize]
+text = sTexts[37]
+
+[wxChoice chPaperSizes]
+choices = asPaperSizes
+tip = sTexts[38]
+grow = yes
+
+[wxCheckBox cbRotation]
+text = sTexts[39]
+tip = sTexts[40]
+
+[wxCheckBox cbDctInterpolation]
+text = sTexts[41]
+tip = sTexts[42]
+
+[wxStaticText lFinishing]
+text = sTexts[43]
+
+[wxChoice chFinishing]
+choices = 3 saFinishing
+tip = sTexts[47]
+grow = yes
+
+[wxCheckBox cbAnBpc]
+text = sTexts[48]
+tip = sTexts[49]
+
+[wxStaticText lResolution]
+text = sTexts[50]
+
+[wxChoice chResolution]
+choices = 3 saResolution
+tip = sTexts[51]
+grow = yes
+id = Bmpp4Frame_Resolution
+
+[wxTextCtrl tfResolution]
+text = sTexts[55]
+grow = yes
+
+[wxCheckBox cbAnColor]
+text = sTexts[57]
+tip = sTexts[58]
+
+[wxStaticText lBackground]
+text = sTexts[59]
+
+[Dk4WxColourView ccBackground]
+constructor = applicationHelper, 255, 255, 255
+tip = sTexts[60]
+
+[wxCheckBox cbBackground]
+text = sTexts[61]
+tip = sTexts[62]
+
+[wxCheckBox cbAnAlpha]
+text = sTexts[63]
+tip = sTexts[64]
+
+
+
+
+%% header start
+
+
+
+%% class start
+class Bmpp4Frame : public Dk4WxFrame
+{
+ private:
+
+ /** Event table for frame.
+ */
+
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ private:
+
+ /** Start time.
+ */
+ dk4_time_t firsttime;
+
+ /** We are already correcting GUI, no recursive attempt.
+ */
+ bool bIsCorrecting;
+
+ protected:
+
+ /** Auto start controller.
+ */
+ Dk4WxAutostartController oAsc;
+
+ /** Text color for status text on error.
+ */
+ wxColour cRed;
+
+ /** Text color for status text on success.
+ */
+ wxColour cGreen;
+
+ /** Normal text color.
+ */
+ wxColour cBlack;
+
+ /** Localized texts.
+ */
+ wxChar const * const *sTexts;
+
+ /** Non-localized texts.
+ */
+ wxChar const * const *sNlWx;
+
+ /** Non-localized texts.
+ */
+ dkChar const * const *sNlDk;
+
+ /* __CHANGE__ 011: Add further member variables.
+ */
+
+ /** Graphics output configuration.
+ */
+ dk4_gra_conf_t graconf;
+
+ /** Known paper sizes.
+ */
+ dk4_paper_size_t *pPaperSizes;
+
+ /** Paper sizes.
+ */
+ wxArrayString asPaperSizes;
+
+ /** Directory name.
+ */
+ wxString sDirname;
+
+ /** Number of paper sizes in asPaperSizes.
+ */
+ size_t szPaperSizes;
+
+ /** Restore and save graphics conversion settings.
+ */
+ bool bRestoreGx;
+
+ /** Restore and save Make mode setting.
+ */
+ bool bRestoreMake;
+
+ /** Restore and save location to process.
+ */
+ bool bRestoreLocation;
+
+ /** Make mode setting from options, if not restored.
+ */
+ bool bMakeMode;
+
+ /** Automatically start.
+ */
+ bool bAutorun;
+
+ /** Flag: Processing idle events.
+ */
+ bool bActive;
+
+%% class end
+
+ public:
+
+ /** Constructor.
+ @param wxid Window ID.
+ @param applicationHelper Application helper object.
+ @param hc Help controller for online help.
+ @param localizedTexts Localized wxChar texts.
+ @param nlWx Non-localized wxChar texts.
+ @param nlDk Non-localized dkChar texts.
+ */
+ Bmpp4Frame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk,
+ dk4_gra_conf_t *pgc,
+ wxArrayString *pPapSiz,
+ wxChar *pDir,
+ size_t szPap,
+ bool bRGx,
+ bool bRMa,
+ bool bRLo,
+ bool bMak,
+ bool bRun,
+ dk4_paper_size_t *pSizes
+ );
+
+ /** Destructor.
+ */
+ ~Bmpp4Frame();
+
+ /** Check whether we can close the window.
+ @param isLast Flag: Last main window to close.
+ */
+ bool
+ CanClose(bool isFinal);
+
+ /** Save current settings.
+ */
+ void
+ SaveSettings(void);
+
+ /** Restore settings from previous session.
+ */
+ void
+ RestoreSettings(void);
+
+
+ /** Modify enabled or disabled state of GUI components.
+ */
+ void
+ CorrectGUI(void);
+
+ /** Check for documents whether paper size is usable.
+ @return True on success, false on error.
+ */
+ bool
+ CheckPaperSizeForDocuments(void);
+
+ /** Run Conversion.
+ @return True on success, false on error.
+ */
+ bool
+ RunConversion(void);
+
+ /** Handler for File/Exit.
+ @param event Event to process.
+ */
+ void
+ OnQuit(wxCommandEvent & event);
+
+ /** Handler for Help/About.
+ @param event Event to process.
+ */
+ void
+ OnAbout(wxCommandEvent & event);
+
+ /** Handler for Help/Contents.
+ @param event Event to process.
+ */
+ void
+ OnHelpContents(wxCommandEvent & event);
+
+ /* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+ */
+ /** Handler for idle events.
+ */
+ void
+ OnIdle(wxIdleEvent & event);
+
+ /* __CHANGE__ 017: Event handlers for further events.
+ */
+
+ /** Handler for choose directory command.
+ */
+ void
+ OnChooseDirectory(wxCommandEvent & event);
+
+ /** Handler for reset options command.
+ */
+ void
+ OnResetOptions(wxCommandEvent & event);
+
+
+ /** Handler for run conversion command.
+ */
+ void
+ OnRunConversion(wxCommandEvent & event);
+
+ /** Handler for output type change.
+ */
+ void
+ OnOutputType(wxCommandEvent & event);
+
+ /** Handler for PS level change.
+ */
+ void
+ OnPSLevel(wxCommandEvent & event);
+
+ /** Handler for resolution setting change.
+ */
+ void
+ OnResolution(wxCommandEvent & event);
+
+ /** Handler for interpolation checkbox change.
+ */
+ void
+ OnInterpolationChange(wxCommandEvent & event);
+
+ /** Handler for color output checkbox change.
+ */
+ void
+ OnColorOutput(wxCommandEvent & event);
+
+ /* __CHANGE__ 014: Add further methods.
+ */
+
+ /** Place configuration settings from graconf to GUI.
+ */
+ void
+ ConfigurationToGUI(void);
+
+ /** Fill graconf from GUI.
+ */
+ void
+ ConfigurationFromGUI(void);
+
+};
+
+%% header end
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module start
+
+#include "wxbmpp.h"
+
+#if !defined(__WXMSW__)
+#include "gui-img/icons/dkicon.xpm"
+#endif
+
+#include "gui-img/shared/toolbar/choose-dir.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+
+#ifndef DK4MAIXDBL_H_INCLUDED
+#include "dk4maixdbl.h"
+#endif
+
+#ifndef DK4MAOXDBL_H_INCLUDED
+#include "dk4maoxdbl.h"
+#endif
+
+$!trace-include
+
+
+
+/* __CHANGE__ 017: Add further events. */
+/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Bmpp4Frame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(Bmpp4Frame,wxFrame)
+#endif
+ EVT_MENU(Bmpp4Frame_Quit, Bmpp4Frame::OnQuit)
+ EVT_MENU(Bmpp4Frame_Help_About, Bmpp4Frame::OnAbout)
+ EVT_MENU(Bmpp4Frame_Help_Contents, Bmpp4Frame::OnHelpContents)
+ EVT_MENU(Bmpp4Frame_Choose_Directory, Bmpp4Frame::OnChooseDirectory)
+ EVT_MENU(Bmpp4Frame_Run_Conversion, Bmpp4Frame::OnRunConversion)
+ EVT_MENU(Bmpp4Frame_Reset_Options, Bmpp4Frame::OnResetOptions)
+ EVT_CHOICE(Bmpp4Frame_Output_Type, Bmpp4Frame::OnOutputType)
+ EVT_CHOICE(Bmpp4Frame_PS_Level, Bmpp4Frame::OnPSLevel)
+ EVT_CHOICE(Bmpp4Frame_Resolution, Bmpp4Frame::OnResolution)
+ EVT_CHECKBOX(Bmpp4Frame_Color_Output, Bmpp4Frame::OnColorOutput)
+ EVT_CHECKBOX(Bmpp4Frame_Change_Interpolation, Bmpp4Frame::OnInterpolationChange)
+ EVT_IDLE(Bmpp4Frame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+/** Option name to restore make setting.
+*/
+static const wxChar * const i_dir_names[] = {
+$!string-table macro=wxT
+wxbmpp.location
+$!end
+};
+
+
+/** Option name to restore make setting.
+*/
+static const wxChar * const i_make_names[] = {
+$!string-table macro=wxT
+wxbmpp.make
+$!end
+};
+
+
+/** Names for saving and restoring options.
+*/
+static const wxChar * const i_option_names[] = {
+$!string-table macro=wxT
+wxbmpp.paper.choice
+wxbmpp.output.type
+wxbmpp.output.color
+wxbmpp.ps.level
+wxbmpp.ps.dsc
+wxbmpp.ps.lzw
+wxbmpp.paper.rotate
+wxbmpp.paper.duplex
+wxbmpp.resolution.type
+wxbmpp.image.background.red
+wxbmpp.image.background.green
+wxbmpp.image.background.blue
+wxbmpp.image.bg.enforce
+wxbmpp.image.interpolation
+wxbmpp.image.dct
+wxbmpp.image.dct-interpolation
+wxbmpp.image.analysis.bpc
+wxbmpp.image.analysis.color
+wxbmpp.image.analysis.alpha
+wxbmpp.image.rgb-to-gray
+$!end
+};
+
+
+#if 0
+/** Names for saving and restoring options.
+*/
+static const wxChar * const s_option_names[] = {
+$!string-table macro=wxT
+wxbmpp.paper.name
+$!end
+};
+#endif
+
+
+#if 0
+/** Names for saving and restoring options.
+*/
+static const wxChar * const d_option_names[] = {
+$!string-table macro=wxT
+wxbmpp.resolution.value
+$!end
+};
+#endif
+
+
+
+%% constructor start
+Bmpp4Frame::Bmpp4Frame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk,
+ dk4_gra_conf_t *pgc,
+ wxArrayString *pPapSiz,
+ wxChar *pDir,
+ size_t szPap,
+ bool bRGx,
+ bool bRMa,
+ bool bRLo,
+ bool bMak,
+ bool bRun,
+ dk4_paper_size_t *pSizes
+) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid),
+ cRed(127, 0, 0),
+ cGreen(0, 127, 0),
+ cBlack(0, 0, 0),
+ asPaperSizes(*pPapSiz)
+{
+ wxString saOutputMode[] = {
+ wxString(localizedTexts[18]),
+ wxString(localizedTexts[19]),
+ wxString(localizedTexts[20]),
+ wxString(localizedTexts[21]),
+ wxString(localizedTexts[22]),
+ wxString(localizedTexts[23])
+ };
+ wxString saPsLevel[] = {
+ wxString(localizedTexts[28]),
+ wxString(localizedTexts[29])
+ };
+ wxString saFinishing[] = {
+ wxString(localizedTexts[44]),
+ wxString(localizedTexts[45]),
+ wxString(localizedTexts[46])
+ };
+ wxString saResolution[] = {
+ wxString(localizedTexts[52]),
+ wxString(localizedTexts[53]),
+ wxString(localizedTexts[54])
+ };
+ wxString saRgbToGray[] = {
+ wxString(localizedTexts[76]),
+ wxString(localizedTexts[77]),
+ wxString(localizedTexts[78]),
+ wxString(localizedTexts[79]),
+ wxString(localizedTexts[80]),
+ wxString(localizedTexts[81]),
+ wxString(localizedTexts[82]),
+ wxString(localizedTexts[83]),
+ wxString(localizedTexts[84]),
+ wxString(localizedTexts[85]),
+ wxString(localizedTexts[86]),
+ wxString(localizedTexts[87]),
+ wxString(localizedTexts[88])
+ };
+ wxString slDirname(localizedTexts[70]);
+ $? "+ Bmpp4Frame::Bmpp4Frame"
+ /* __CHANGE__ 012: Add further local variables.
+ */
+
+ /* __CHANGE__ 012: Initialize further local variables.
+ */
+ bIsCorrecting = false;
+
+ sTexts = localizedTexts;
+ sNlWx = nlWx;
+ sNlDk = nlDk;
+#if defined(__WXMSW__)
+ wxIcon wxbmpp_icon(sNlWx[4]);
+#else
+ wxIcon wxbmpp_icon(xpm_dkicon);
+#endif
+
+ /* __CHANGE__ 011: Initialize further class members.
+ */
+ pPaperSizes = pSizes;
+ DK4_MEMCPY(&graconf,pgc,sizeof(dk4_gra_conf_t));
+ if (NULL != pDir) {
+ sDirname = wxString(pDir);
+ slDirname = sDirname;
+ }
+ szPaperSizes = szPap;
+ bRestoreGx = bRGx;
+ bRestoreMake = bRMa;
+ bRestoreLocation = bRLo;
+ bMakeMode = bMak;
+ bAutorun = bRun;
+ if (bAutorun) {
+ oAsc.SetAutoStart(true);
+ oAsc.SetAutoExit(true);
+ }
+ else {
+ oAsc.SetAutoStart(false);
+ oAsc.SetAutoExit(false);
+ }
+ bActive = true;
+ dk4time_get(&firsttime);
+
+%% constructor end
+ if(dkctGUILayoutOK) {
+ chOutputMode->SetSelection(0);
+ chPsLevel->SetSelection(0);
+ chFinishing->SetSelection(0);
+ chResolution->SetSelection(0);
+ chPaperSizes->SetSelection(0);
+ chRgbToGray->SetSelection(0);
+ CorrectGUI();
+ SetTitle(nlWx[0]);
+#if 0
+ /* 2018-05-27 Test for setActive() method.
+ This line was added temporarily just to test the
+ new setActive() method.
+ */
+ ccBackground->SetActive(false);
+ $? ". ccBackground inactive"
+#endif
+ ccBackground->SetPlaceColourChooser();
+ }
+
+ /* __CHANGE__ 012: Release resources allocated by local variables.
+ */
+
+ $? "- Bmpp4Frame::Bmpp4Frame"
+}
+
+%% module end
+
+
+
+Bmpp4Frame::~Bmpp4Frame()
+{
+ $? "+ Bmpp4Frame::~Bmpp4Frame"
+
+ /* __CHANGE__ 011: Release resources allocated by further class members.
+ */
+
+ $? "- Bmpp4Frame::~Bmpp4Frame"
+}
+
+
+
+bool
+Bmpp4Frame::CanClose(bool isLast)
+{
+ bool back = true;
+ $? "+ Bmpp4Frame::CanClose isLast=%d", (isLast ? 1 : 0)
+
+ /* __CHANGE__ 013: Check for unsaved data.
+ */
+ if (isLast) {
+ SaveSettings();
+ }
+
+ $? "- Bmpp4Frame::CanClose %d", (back ? 1 : 0)
+ return back;
+}
+
+
+void
+Bmpp4Frame::OnQuit(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ Bmpp4Frame::OnQuit"
+ $? "- Bmpp4Frame::OnQuit"
+ Close();
+}
+
+
+
+void
+Bmpp4Frame::OnAbout(wxCommandEvent & WXUNUSED(event))
+{
+ wxString text(wxT(""));
+ wxString title(wxT(""));
+ $? "+ Bmpp4Frame::OnAbout"
+ /* Construct message text. */
+ text.Append(sNlWx[0]);
+ text.Append(sNlWx[7]);
+#if 0
+ text.Append(sNlWx[1]);
+#else
+ text.Append(DKT_VERSION_WX);
+#endif
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[9]);
+ text.Append(sNlWx[2]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[9]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[10]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[13]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[14]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[15]);
+ text.Append(sNlWx[8]);
+
+ /* Construct dialog box title. */
+ title.Append(sTexts[10]);
+ title.Append(sNlWx[0]);
+
+ /* Show dialog box. */
+ wxMessageBox(text, title);
+
+ /* __CHANGE__ 019: Create better about box.
+ */
+ $? "- Bmpp4Frame::OnAbout"
+}
+
+
+
+void
+Bmpp4Frame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ Bmpp4Frame::OnHelpContents"
+ DisplayContents();
+ $? "- Bmpp4Frame::OnHelpContents"
+}
+
+
+/* __CHANGE__ 017: Event handlers for further events.
+*/
+
+
+void
+Bmpp4Frame::OnChooseDirectory(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ Bmpp4Frame::OnChooseDirectory"
+ wxDirDialog dd(
+ this, sTexts[71], sDirname, (wxDD_DIR_MUST_EXIST | wxDD_CHANGE_DIR)
+ );
+ pAppHelp->ChooseChildPosition(*this, dd, false);
+ if(dd.ShowModal() == wxID_OK) {
+ sDirname = dd.GetPath();
+ lDirectoryName->SetLabel(sDirname);
+#if 0
+ lDirectoryName->(wxALIGN_CENTRE_HORIZONTAL);
+#endif
+ Refresh();
+ Update();
+ }
+ else {
+ }
+ $? "- Bmpp4Frame::OnChooseDirectory"
+}
+
+
+
+void
+Bmpp4Frame::OnResetOptions(wxCommandEvent & WXUNUSED(event))
+{
+ wxString sA4(wxT("a4"));
+ int res;
+ $? "+ OnResetOptions"
+ res = wxMessageBox(
+ sTexts[75], sTexts[74], (wxNO_DEFAULT | wxYES_NO | wxICON_QUESTION)
+ );
+ if (wxYES == res) {
+ dk4gra_conf_init(&graconf);
+ res = asPaperSizes.Index(sA4);
+ if (wxNOT_FOUND != res) {
+ chPaperSizes->SetSelection(res);
+ dk4mem_cpy(
+ &(graconf.media),
+ &(pPaperSizes[res]),
+ sizeof(dk4_paper_size_t),
+ NULL
+ );
+ graconf.media.name = NULL;
+ graconf.psi = (size_t)res;
+ graconf.have_psi = 1;
+ }
+ ConfigurationToGUI();
+ CorrectGUI();
+ }
+ $? "- OnResetOptions"
+}
+
+
+
+bool
+Bmpp4Frame::CheckPaperSizeForDocuments(void)
+{
+ bool back = true;
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ if (graconf.media.w < (graconf.media.i + graconf.media.o)) {
+ back = false;
+ }
+ if (graconf.media.h < (graconf.media.b + graconf.media.t)) {
+ back = false;
+ }
+ }
+ return back;
+}
+
+
+
+bool
+Bmpp4Frame::RunConversion(void)
+{
+ wxString errorString(wxT(""));
+ bool back = false;
+ $? "+ RunConversion"
+
+ /* Transfer GUI state to grahpics output configuration
+ if not specified on the command line.
+ */
+ if (bRestoreGx) {
+ ConfigurationFromGUI();
+ }
+ if (!(bAutorun)) {
+ bMakeMode = ((0 != cbMakeMode->GetValue()) ? (true) : (false));
+ }
+ /*
+ Check for usable paper size
+ */
+ if (CheckPaperSizeForDocuments()) {
+ /*
+ Do conversion operations in idle events or modal dialog.
+ */
+ Bmpp4Progress dPro(
+ this, pAppHelp, sTexts, sDirname, &graconf, bMakeMode, &errorString
+ );
+ if (dPro.PrepareProcessing()) {
+ $? ". show windows and run processing"
+ pAppHelp->ChooseChildPosition(*this, dPro);
+ if (wxID_OK == dPro.ShowModal()) {
+ back = true;
+ }
+ else { $? "! aborted or errors"
+ /* ERRROR: Aborted or errors */
+ wxMessageBox(
+ errorString, sTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR),
+ this
+ );
+ }
+ $? ". processing done"
+ }
+ else { $? "! failed to prepare processing"
+ /* ERROR: Failed to prepare processing */
+ wxMessageBox(
+ errorString, sTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR),
+ this
+ );
+ }
+ $? ". going to clean up"
+ dPro.Cleanup();
+ $? ". clean up done"
+ }
+ else { $? "! unusable paper size"
+ /* ERROR: Unusable paper size */
+ wxMessageBox(
+ sTexts[111], sTexts[102],
+ (wxOK | wxCENTRE | wxICON_ERROR),
+ this
+ );
+ }
+
+ $? "- RunConversion %d", ((back) ? (1) : (0))
+ return back;
+}
+
+
+
+void
+Bmpp4Frame::OnRunConversion(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ Bmpp4Frame::OnRunConversion"
+ (void)RunConversion();
+ $? "- Bmpp4Frame::OnRunConversion"
+}
+
+
+
+void
+Bmpp4Frame::OnOutputType(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnOutputType"
+ CorrectGUI();
+ $? "- OnOutputType"
+}
+
+
+
+void
+Bmpp4Frame::OnPSLevel(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnPSLevel"
+ CorrectGUI();
+ $? "- OnPSLevel"
+}
+
+
+
+void
+Bmpp4Frame::OnResolution(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnResolution"
+ CorrectGUI();
+ $? "- OnResolution"
+}
+
+
+
+void
+Bmpp4Frame::OnInterpolationChange(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnInterpolationChange"
+ CorrectGUI();
+ $? "- OnInterpolationChange"
+}
+
+
+
+void
+Bmpp4Frame::OnColorOutput(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnColorOutput"
+ CorrectGUI();
+ $? "- OnColorOutput"
+}
+
+
+
+/* __CHANGE__ 014: Implementation of further methods.
+*/
+
+
+void
+Bmpp4Frame::SaveSettings(void)
+{
+ int ival[20];
+ size_t i;
+ $? "+ SaveSettings"
+ if (bRestoreGx) { $? ". save conversion settings"
+ for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; }
+ ival[ 0] = chPaperSizes->GetSelection();
+ ival[ 1] = chOutputMode->GetSelection();
+ ival[ 2] = cbColorOutput->GetValue();
+ ival[ 3] = chPsLevel->GetSelection();
+ ival[ 4] = cbDsc->GetValue();
+ ival[ 5] = cbLzw->GetValue();
+ ival[ 6] = cbRotation->GetValue();
+ ival[ 7] = chFinishing->GetSelection();
+ ival[ 8] = chResolution->GetSelection();
+ ival[ 9] = ccBackground->Red();
+ ival[10] = ccBackground->Green();
+ ival[11] = ccBackground->Blue();
+ ival[12] = cbBackground->GetValue();
+ ival[13] = cbImgInterpolation->GetValue();
+ ival[14] = cbDct->GetValue();
+ ival[15] = cbDctInterpolation->GetValue();
+ ival[16] = cbAnBpc->GetValue();
+ ival[17] = cbAnColor->GetValue();
+ ival[18] = cbAnAlpha->GetValue();
+ ival[19] = chRgbToGray->GetSelection();
+ pAppHelp->SetMultiple(i_option_names, ival, 20);
+ }
+ if (bRestoreMake) { $? ". save make mode settings"
+ ival[0] = cbMakeMode->GetValue();
+ pAppHelp->SetMultiple(i_make_names, ival, 1);
+ }
+ if (bRestoreLocation) { $? ". save location"
+ pAppHelp->SetString(i_dir_names[0], sDirname);
+ }
+ $? "- SaveSettings"
+}
+
+
+
+void
+Bmpp4Frame::RestoreSettings(void)
+{
+ int ival[20];
+ size_t i;
+ $? "+ RestoreSettings"
+ if (bRestoreGx) { $? ". restore graphics settings"
+ for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; }
+ ival[ 0] = 0;
+ ival[ 1] = 0;
+ ival[ 2] = 1;
+ ival[ 3] = 1;
+ ival[ 4] = 1;
+ ival[ 5] = 0;
+ ival[ 6] = 1;
+ ival[ 7] = 1;
+ ival[ 8] = 0;
+ ival[ 9] = 255;
+ ival[10] = 255;
+ ival[11] = 255;
+ ival[12] = 0;
+ ival[13] = 1;
+ ival[14] = 1;
+ ival[15] = 0;
+ ival[16] = 1;
+ ival[17] = 1;
+ ival[18] = 1;
+ ival[19] = 0;
+ pAppHelp->GetMultiple(i_option_names, ival, 20);
+ if ((0 <= ival[0]) && ((int)szPaperSizes > ival[0])) {
+ chPaperSizes->SetSelection(ival[0]);
+ }
+ if (0 <= ival[1]) { chOutputMode->SetSelection(ival[1]); }
+ cbColorOutput->SetValue((0 != ival[2]) ? (true) : (false));
+ if (0 <= ival[3]) { chPsLevel->SetSelection(ival[3]); }
+ cbDsc->SetValue((0 != ival[4]) ? (true) : (false));
+ cbLzw->SetValue((0 != ival[5]) ? (true) : (false));
+ cbRotation->SetValue((0 != ival[6]) ? (true) : (false));
+ if (0 <= ival[7]) { chFinishing->SetSelection(ival[7]); }
+ if (0 <= ival[8]) { chResolution->SetSelection(ival[8]); }
+ ccBackground->SetRGB(ival[9], ival[10], ival[11]);
+ cbBackground->SetValue((0 != ival[12]) ? (true) : (false));
+ cbImgInterpolation->SetValue((0 != ival[13]) ? (true) : (false));
+ cbDct->SetValue((0 != ival[14]) ? (true) : (false));
+ cbDctInterpolation->SetValue((0 != ival[15]) ? (true) : (false));
+ cbAnBpc->SetValue((0 != ival[16]) ? (true) : (false));
+ cbAnColor->SetValue((0 != ival[17]) ? (true) : (false));
+ cbAnAlpha->SetValue((0 != ival[18]) ? (true) : (false));
+ if (0 <= ival[19]) { chRgbToGray->SetSelection(ival[19]); }
+ }
+ else { $? ". using graphics conversion options"
+ ConfigurationToGUI();
+ }
+ if (bRestoreMake) { $? ". restoring make mode"
+ for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; }
+ ival[ 0] = 0;
+ pAppHelp->GetMultiple(i_make_names, ival, 1);
+ cbMakeMode->SetValue((0 != ival[0]) ? (true) : (false));
+ bMakeMode = ((0 != ival[0]) ? true : false);
+ }
+ else {
+ cbMakeMode->SetValue(bMakeMode ? (1) : (0));
+ }
+ if (bRestoreLocation) { $? ". restore location"
+ if (pAppHelp->GetString(i_dir_names[0], &sDirname)) {
+ lDirectoryName->SetLabel(sDirname);
+ Refresh();
+ Update();
+ }
+ }
+ $? "- RestoreSettings"
+}
+
+
+
+void
+Bmpp4Frame::CorrectGUI(void)
+{
+ $? "+ CorrectGUI"
+ if (!bIsCorrecting) { $? ". must correct"
+ /*
+ Avoid recursive calls
+ */
+ bIsCorrecting = true;
+
+ /*
+ Enable or disable PS specific components
+ */
+ switch (chOutputMode->GetSelection()) {
+ case 0 : case 1 : case 2 : { /* PDF */
+ chPsLevel->Enable(false);
+ cbDsc->Enable(false);
+ cbLzw->Enable(false);
+ } break;
+ default : { /* PS or EPS */
+ chPsLevel->Enable(true);
+ cbDsc->Enable(true);
+ if (0 == chPsLevel->GetSelection()) { /* PS 2 */
+ cbLzw->Enable(true);
+ }
+ else { /* PS 3 */
+ cbLzw->Enable(false);
+ }
+ } break;
+ }
+
+ /*
+ Enable or disable job specific components
+ */
+ switch (chOutputMode->GetSelection()) {
+ case 2: case 5: { /* document */
+ chFinishing->Enable(true);
+ cbRotation->Enable(true);
+ chPaperSizes->Enable(true);
+ } break;
+ default: { /* not a document */
+ chFinishing->Enable(false);
+ cbRotation->Enable(false);
+ chPaperSizes->Enable(false);
+ } break;
+ }
+
+ /*
+ Enable or disable resolution text input field
+ */
+ switch(chResolution->GetSelection()) {
+ case 2: {
+ tfResolution->Enable(true);
+ } break;
+ default: {
+ tfResolution->Enable(false);
+ } break;
+ }
+
+ /*
+ Enable or disable Interpolation DCT
+ */
+ if (0 != cbImgInterpolation->GetValue()) {
+ cbDctInterpolation->Enable(true);
+ }
+ else {
+ cbDctInterpolation->Enable(false);
+ }
+
+ /*
+ Enable or disable RGB to gray method selection
+ */
+ if (0 != cbColorOutput->GetValue()) {
+ chRgbToGray->Enable(false);
+ }
+ else {
+ chRgbToGray->Enable(true);
+ }
+
+ /*
+ Mark as done
+ */
+ bIsCorrecting = false;
+ /*
+ Update GUI
+ */
+ Refresh();
+ Update();
+ }
+ $? "- CorrectGUI"
+}
+
+
+
+void
+Bmpp4Frame::ConfigurationToGUI(void)
+{
+ wxChar b1[64]; /* Conversion buffer */
+ wxChar b2[DK4_SIZEOF(b1,wxChar)]; /* Conversion buffer */
+ size_t szb = DK4_SIZEOF(b1,wxChar); /* Size of b1 and b2 (elems) */
+ size_t papi = 0; /* Paper size index */
+ int res = 0; /* Operation result */
+ $? "+ ConfigurationToGUI"
+ /* Output mode
+ */
+ switch (graconf.driver) {
+ case DK4_GRA_DRIVER_PS : {
+ switch (graconf.purpose) {
+ case DK4_GRA_PURPOSE_DOCUMENT : {
+ chOutputMode->SetSelection(5);
+ } break;
+ default : {
+ chOutputMode->SetSelection(4);
+ } break;
+ }
+ } break;
+ case DK4_GRA_DRIVER_EPS : {
+ chOutputMode->SetSelection(3);
+ } break;
+ default : {
+ switch (graconf.purpose) {
+ case DK4_GRA_PURPOSE_DOCUMENT : {
+ chOutputMode->SetSelection(2);
+ } break;
+ case DK4_GRA_PURPOSE_IMAGE : {
+ chOutputMode->SetSelection(1);
+ } break;
+ default : { /* DK4_GRA_PURPOSE_OBJECT */
+ chOutputMode->SetSelection(0);
+ } break;
+ }
+ } break;
+ }
+ /* PS level
+ */
+ chPsLevel->SetSelection((3 == graconf.ps_level) ? (1) : (0));
+ /* DSC
+ */
+ cbDsc->SetValue((0 != graconf.ps_dsc) ? (1) : (0));
+ /* LZW
+ */
+ cbLzw->SetValue((0 != graconf.ps_lzw) ? (1) : (0));
+ /* Paper size
+ */
+ if ((0 != graconf.have_psi) && (szPaperSizes > graconf.psi)) {
+ chPaperSizes->SetSelection((int)(graconf.psi));
+ }
+ else {
+ if (0 != graconf.have_psi) {
+ chPaperSizes->SetSelection(graconf.psi);
+ }
+ else {
+ res = dk4paper_find_nearest(
+ &papi, pPaperSizes, szPaperSizes, &(graconf.media), NULL
+ );
+ if (0 != res) {
+ chPaperSizes->SetSelection(papi);
+ }
+ else {
+ chPaperSizes->SetSelection(0);
+ }
+ }
+ }
+ /* Rotate
+ */
+ cbRotation->SetValue((0 != graconf.img_rot) ? 1 : 0);
+ /* Finishing
+ */
+ if (0 != graconf.doc_tumble) {
+ chFinishing->SetSelection(2);
+ }
+ else {
+ chFinishing->SetSelection((0 != graconf.doc_duplex) ? (1) : (0));
+ }
+ /* Resolution
+ */
+ if ((0.0 < graconf.xres) && (0.0 < graconf.yres)) {
+ chResolution->SetSelection(2);
+ /* 2018-03-28
+ The buffer overflow reported from wxWidgets libraries
+ magically disappeared after rebuilding the entire project
+ with debug messages.
+ May be rebuilding one module was missing before.
+ */
+ $? ". writing double to buffer"
+ if (0 != dk4ma_write_wx_double(b1,szb,graconf.xres,0,1,NULL)) {
+ $? ". b1 written"
+ if (0 != dk4ma_write_wx_double(b2,szb,graconf.yres,0,1,NULL)) {
+ $? ". b2 written"
+ tfResolution->SetValue(wxString(b1) + wxT(" ") + wxString(b2));
+ $? ". text field replaced"
+ }
+ else { $? "! failed to write b2"
+ }
+ }
+ else { $? "! failed to write b1"
+ }
+ $? ". doubles written to buffer"
+ }
+ else {
+ chResolution->SetSelection((graconf.img_ign_res) ? (1) : (0));
+ }
+ /* Background
+ */
+ if ((0 <= graconf.img_bg_r) && (256 > graconf.img_bg_r)) {
+ if ((0 <= graconf.img_bg_g) && (256 > graconf.img_bg_g)) {
+ if ((0 <= graconf.img_bg_b) && (256 > graconf.img_bg_b)) {
+ ccBackground->SetRGB(
+ graconf.img_bg_r, graconf.img_bg_g, graconf.img_bg_b
+ );
+ }
+ }
+ }
+ /*
+ Enforce background
+ */
+ cbBackground->SetValue((0 != graconf.img_bg_f) ? (1) : (0));
+ /*
+ Color
+ */
+ cbColorOutput->SetValue((0 != graconf.color) ? (1) : (0));
+ /*
+ Interpolation
+ */
+ cbImgInterpolation->SetValue((0 != graconf.img_int) ? (1) : (0));
+ /*
+ DCT
+ */
+ cbDct->SetValue((0 != graconf.img_dct) ? (1) : (0));
+ /*
+ DCT interpolation
+ */
+ cbDctInterpolation->SetValue((0 != graconf.img_dct_int) ? (1) : (0));
+ /*
+ Analzse bpc
+ */
+ cbAnBpc->SetValue((0 != graconf.img_an_bpc) ? (1) : (0));
+ /*
+ Analzse color
+ */
+ cbAnColor->SetValue((0 != graconf.img_an_color) ? (1) : (0));
+ /*
+ Analyze alpha
+ */
+ cbAnAlpha->SetValue((0 != graconf.img_an_alpha) ? (1) : (0));
+ /*
+ RGB to gray method
+ */
+ if (0 <= graconf.ctx.rgb_to_gray) {
+ chRgbToGray->SetSelection(graconf.ctx.rgb_to_gray);
+ }
+ $? "- ConfigurationToGUI"
+}
+
+
+
+void
+Bmpp4Frame::ConfigurationFromGUI(void)
+{
+ wxChar buffer[128];
+ wxChar const *ep;
+ wxChar *p1 = NULL;
+ wxChar *p2 = NULL;
+ double xres = -1.0;
+ double yres = -1.0;
+ size_t szbu = DK4_SIZEOF(buffer,wxChar);
+ int choiceindex;
+ int ok = 0;
+ $? "+ ConfigurationFromGUI"
+ /* Output mode
+ */
+ switch (chOutputMode->GetSelection()) {
+ case 0 : {
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_OBJECT;
+ } break;
+ case 1 : {
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_IMAGE;
+ } break;
+ case 2 : {
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ } break;
+ case 3 : {
+ graconf.driver = DK4_GRA_DRIVER_EPS;
+ graconf.purpose = DK4_GRA_PURPOSE_IMAGE;
+ } break;
+ case 4 : {
+ graconf.driver = DK4_GRA_DRIVER_PS;
+ graconf.purpose = DK4_GRA_PURPOSE_IMAGE;
+ } break;
+ case 5 : {
+ graconf.driver = DK4_GRA_DRIVER_PS;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ } break;
+ default : {
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_OBJECT;
+ } break;
+ }
+ /* PS level
+ */
+ switch (chPsLevel->GetSelection()) {
+ case 0 : {
+ graconf.ps_level = 2;
+ } break;
+ default : {
+ graconf.ps_level = 3;
+ } break;
+ }
+ /* DSC
+ */
+ graconf.ps_dsc = ((0 != cbDsc->GetValue()) ? 1 : 0);
+ /*
+ LZW
+ */
+ graconf.ps_lzw = ((0 != cbLzw->GetValue()) ? 1 : 0);
+ /*
+ Paper size
+ */
+ choiceindex = chPaperSizes->GetSelection();
+ if ((0 <= choiceindex) && (szPaperSizes > (size_t)choiceindex)) {
+ dk4mem_cpy(
+ &(graconf.media),
+ &(pPaperSizes[choiceindex]),
+ sizeof(dk4_paper_size_t),
+ NULL
+ );
+ }
+ /*
+ Rotate
+ */
+ graconf.img_rot = ((0 != cbRotation->GetValue()) ? 1 : 0);
+ /*
+ Finishing
+ */
+ switch (chFinishing->GetSelection()) {
+ case 2 : {
+ graconf.doc_duplex = 1;
+ graconf.doc_tumble = 1;
+ } break;
+ case 1 : {
+ graconf.doc_duplex = 1;
+ graconf.doc_tumble = 0;
+ } break;
+ default : {
+ graconf.doc_duplex = 0;
+ graconf.doc_tumble = 0;
+ } break;
+ }
+ /* Resolution
+ */
+ switch (chResolution->GetSelection()) {
+ case 2 : { /* specify */
+ /* ##### TODO: Implementation: Retrieve values from text field */
+ wxCStrData valuestrdata = tfResolution->GetValue().c_str();
+ if (
+ 0 != dk4strx_cpy_s(
+ buffer, szbu, (wxChar const *)valuestrdata, NULL
+ )
+ ) {
+ p1 = dk4strx_start(buffer, NULL);
+ if (NULL != p1) {
+ p2 = dk4strx_next(p1, NULL);
+ ep = NULL;
+ if (0 != dk4ma_input_wx_double(&xres, p1, &ep, 1, NULL)) {
+ ok = 1;
+ yres = xres;
+ }
+ if (NULL != p2) {
+ ep = NULL;
+ if (0 == dk4ma_input_wx_double(&yres,p2,&ep,1,NULL)) {
+ ok = 0;
+ }
+ }
+ if (1 == ok) {
+ if ((0.0 < xres) && (0.0 < yres)) {
+ graconf.xres = xres;
+ graconf.yres = yres;
+ }
+ }
+ }
+ }
+ graconf.img_ign_res = 0;
+ } break;
+ case 1 : { /* ignore */
+ graconf.img_ign_res = 1;
+ graconf.xres = graconf.yres = 72.0;
+ } break;
+ default : { /* chunk */
+ graconf.img_ign_res = 0;
+ graconf.xres = graconf.yres = -1.0;
+ } break;
+ }
+ /* Background
+ */
+ graconf.img_bg_r = ccBackground->Red();
+ graconf.img_bg_g = ccBackground->Green();
+ graconf.img_bg_b = ccBackground->Blue();
+ /*
+ Enforce background
+ */
+ graconf.img_bg_f = ((0 != cbBackground->GetValue()) ? 1 : 0);
+ /*
+ Color
+ */
+ graconf.color = ((0 != cbColorOutput->GetValue()) ? 1 : 0);
+ /*
+ Interpolation
+ */
+ graconf.img_int = ((0 != cbImgInterpolation->GetValue()) ? 1 : 0);
+ /*
+ DCT
+ */
+ graconf.img_dct = ((0 != cbDct->GetValue()) ? 1 : 0);
+ /*
+ DCT interpolation
+ */
+ graconf.img_dct_int = ((0 != cbDctInterpolation->GetValue()) ? 1 : 0);
+ /*
+ Analzse bpc
+ */
+ graconf.img_an_bpc = ((0 != cbAnBpc->GetValue()) ? 1 : 0);
+ /*
+ Analzse color
+ */
+ graconf.img_an_color = ((0 != cbAnColor->GetValue()) ? 1 : 0);
+ /*
+ Analyze alpha
+ */
+ graconf.img_an_alpha = ((0 != cbAnAlpha->GetValue()) ? 1 : 0);
+ /*
+ RGB to gray method
+ */
+ switch (chRgbToGray->GetSelection()) {
+ case 12 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE;
+ } break;
+ case 11 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN;
+ } break;
+ case 10 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED;
+ } break;
+ case 9 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION;
+ } break;
+ case 8 : {
+ graconf.ctx.rgb_to_gray =
+ DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION;
+ } break;
+ case 7 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION;
+ } break;
+ case 6 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_DESATURATION;
+ } break;
+ case 5 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_AVERAGE;
+ } break;
+ case 4 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST;
+ } break;
+ case 3 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_FAST;
+ } break;
+ case 2 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709;
+ } break;
+ case 1 : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_LUMA;
+ } break;
+ default : {
+ graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601;
+ } break;
+ }
+ $? "- ConfigurationFromGUI"
+}
+
+
+
+void
+Bmpp4Frame::OnIdle(wxIdleEvent & event)
+{
+#if TRACE_DEBUG
+ static unsigned long number = 0UL;
+ dk4_time_t timer;
+#endif
+ bool rqm = false;
+ bool success;
+ $? "+ Bmpp4Frame::OnIdle"
+#if TRACE_DEBUG
+ dk4time_get(&timer);
+#endif
+ $? "+ OnIdle %lu %lu", number, (unsigned long)(timer - firsttime)
+ if (bActive) { $? ". active"
+ if (bAutorun) { $? ". autorun"
+ switch (oAsc.GetReaction()) {
+ case Dk4WxAutostartController::REACTION_START : { $? ". start"
+ oAsc.StartProcessing();
+ success = RunConversion();
+ rqm = true;
+ if (success) {
+ lDirectoryName->SetLabel(sTexts[91]);
+ lDirectoryName->SetForegroundColour(cGreen);
+ }
+ else {
+#if 0
+ oAsc.SetAutoExit(false);
+ rqm = false;
+#endif
+ lDirectoryName->SetLabel(sTexts[92]);
+ lDirectoryName->SetForegroundColour(cRed);
+ }
+ lDirectoryName->Refresh();
+ lDirectoryName->Update();
+ oAsc.EndProcessing(); $? ". finished, request more"
+ } break;
+ case Dk4WxAutostartController::REACTION_MORE : { $? ". more"
+ rqm = true;
+ } break;
+ case Dk4WxAutostartController::REACTION_EXIT : { $? ". exit"
+ bActive = false;
+ Show(false);
+ Close();
+ rqm = false;
+ } break;
+ default : { /* includes DK4WX_AUTOSTART_REACTION_IGNORE */
+ $? ". ignore"
+ } break;
+ }
+ }
+ else { $? ". no autorun"
+ }
+ }
+ else { $? ". not active"
+ }
+#if TRACE_DEBUG
+ dk4time_get(&timer);
+#endif
+ $? "- OnIdle %lu %d %lu", number++, (rqm ? 1 : 0), (unsigned long)(timer - firsttime)
+ if (rqm) {
+ event.RequestMore();
+ }
+ event.Skip();
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/Bmpp4Progress.cpp b/support/dktools/Bmpp4Progress.cpp
new file mode 100644
index 0000000000..8282482af7
--- /dev/null
+++ b/support/dktools/Bmpp4Progress.cpp
@@ -0,0 +1,1270 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Bmpp4Progress.wxc
+*/
+
+/** @file Bmpp4Progress.cpp The Bmpp4Progress module.
+*/
+
+
+#line 325 "Bmpp4Progress.wxc"
+
+#include "wxbmpp.h"
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4MM_H_INCLUDED
+#include "dk4mm.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+
+
+#line 353 "Bmpp4Progress.wxc"
+
+
+
+/** Event handler table.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Bmpp4Progress,wxDialog)
+#else
+BEGIN_EVENT_TABLE(Bmpp4Progress,wxDialog)
+#endif
+ EVT_IDLE(Bmpp4Progress::OnIdle)
+ EVT_BUTTON(wxID_CANCEL,Bmpp4Progress::OnCancel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+/** List of suffixes for input file names.
+*/
+static wxChar const * const input_suffixes[] = {
+/* 0 */
+wxT(".png"),
+
+/* 1 */
+wxT(".jpg"),
+
+/* 2 */
+wxT(".jpeg"),
+
+/* 3 */
+wxT(".tif"),
+
+/* 4 */
+wxT(".tiff"),
+
+/* 5 */
+wxT(".pbm"),
+
+/* 6 */
+wxT(".pgm"),
+
+/* 7 */
+wxT(".ppm"),
+
+/* 8 */
+wxT(".pnm"),
+
+/* 9 */
+wxT(".pam"),
+
+NULL
+
+
+#line 387 "Bmpp4Progress.wxc"
+};
+
+
+
+/** Output file name suffixes.
+*/
+dkChar const * const output_suffixes[] = {
+/* 0 */
+dkT(".pdf"),
+
+/* 1 */
+dkT(".eps"),
+
+/* 2 */
+dkT(".ps"),
+
+NULL
+
+
+#line 399 "Bmpp4Progress.wxc"
+};
+
+
+/** Release memory for one one_file_t structure.
+ @param ptr Structure to release.
+*/
+static
+void
+one_file_free(one_file_t *ptr)
+{
+
+
+#line 410 "Bmpp4Progress.wxc"
+ if (NULL != ptr) {
+#if TRACE_DEBUG
+ if (NULL != ptr->infilename) {
+
+
+#line 414 "Bmpp4Progress.wxc"
+ }
+ if (NULL != ptr->shortifn) {
+
+
+#line 417 "Bmpp4Progress.wxc"
+ }
+ if (NULL != ptr->dkifn) {
+
+
+#line 420 "Bmpp4Progress.wxc"
+ }
+ if (NULL != ptr->dkofn) {
+
+
+#line 423 "Bmpp4Progress.wxc"
+ }
+
+
+#line 425 "Bmpp4Progress.wxc"
+#endif
+ dk4mem_release(ptr->infilename);
+ dk4mem_release(ptr->dkifn);
+ dk4mem_release(ptr->dkofn);
+ ptr->shortifn = NULL;
+ dk4mem_free(ptr);
+ }
+
+
+#line 433 "Bmpp4Progress.wxc"
+}
+
+
+
+/** Create structure for one file to process.
+ @param wxifn Input file name as wxChar string.
+ @param dkifn Input file name as dkChar string.
+ @param dkosu Output file name suffix as dkChar string.
+ @param mcheck Flag: Use make-mode check.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+static
+one_file_t *
+one_file_new(
+ wxChar const *wxifn,
+ dkChar const *dkifn,
+ dkChar const *dkosu,
+ unsigned char mcheck
+)
+{
+ one_file_t *back = NULL;
+ wxChar *p1;
+ wxChar *p2;
+ int ok = 0;
+
+
+#line 458 "Bmpp4Progress.wxc"
+
+
+#line 459 "Bmpp4Progress.wxc"
+
+
+#line 460 "Bmpp4Progress.wxc"
+
+
+#line 461 "Bmpp4Progress.wxc"
+
+
+#line 462 "Bmpp4Progress.wxc"
+ back = dk4mem_new(one_file_t,1,NULL);
+ if (NULL != back) {
+ back->infilename = NULL;
+ back->shortifn = NULL;
+ back->dkifn = NULL;
+ back->dkofn = NULL;
+ back->mcheck = mcheck;
+ back->infilename = dk4strx_dup(wxifn, NULL);
+ if (NULL != back->infilename) {
+ back->dkifn = dk4str_dup(dkifn, NULL);
+ if (NULL != back->dkifn) {
+ back->dkofn = dk4path_dup_change_suffix(dkifn, dkosu, NULL);
+ if (NULL != back->dkofn) {
+
+#line 475 "Bmpp4Progress.wxc"
+ /*
+ All allocations succeeded
+ */
+ ok = 1;
+ /*
+ Set pointer to short file name
+ */
+ back->shortifn = back->infilename;
+ p1 = back->infilename; p2 = NULL;
+ while (wxT('\0') != *p1) {
+#if DK4_HAVE_BACKSLASH_AS_SEP
+ if (wxT('\\') == *p1) { p2 = p1; }
+#else
+ if (wxT('/') == *p1) { p2 = p1; }
+#endif
+ p1++;
+ }
+ if (NULL != p2) {
+ p2++;
+ back->shortifn = p2;
+ }
+
+#line 496 "Bmpp4Progress.wxc"
+ }
+ }
+ }
+ /* Destroy structure and return NULL if one of the allocations failed
+ */
+ if (0 == ok) {
+ one_file_free(back);
+ back = NULL;
+ }
+ }
+
+
+#line 507 "Bmpp4Progress.wxc"
+ return back;
+}
+
+
+
+/** Compare two one_file_t structures by infilename component.
+ @param l Left structure.
+ @param r Right structure.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result: 1 for l>r, 0 for l=r, -1 for l<r.
+*/
+static
+int
+one_file_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ one_file_t const *pl; /* Left structure */
+ one_file_t const *pr; /* Right structure */
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (one_file_t const *)l;
+ pr = (one_file_t const *)r;
+ if (NULL != pl->infilename) {
+ if (NULL != pr->infilename) {
+ back = dk4strx_pathcmp(pl->infilename, pr->infilename);
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != pr->infilename) {
+ back = -1;
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+bool
+Bmpp4Progress::CheckNameSuffix(wxChar const *infilename)
+{
+ wxChar const *fns;
+ bool back = false;
+
+
+#line 565 "Bmpp4Progress.wxc"
+ fns = dk4strx_get_path_suffix(infilename, NULL);
+ if (NULL != fns) {
+ switch ( dk4strx_array_index(input_suffixes, fns, 0) ) {
+ case 0 : {
+#if DK4_HAVE_PNG_H
+ back = true;
+#endif
+ } break;
+ case 1 : case 2 : {
+#if DK4_HAVE_JPEGLIB_H
+ back = true;
+#endif
+ } break;
+ case 3 : case 4 : {
+#if DK4_HAVE_TIFF_H
+ back = true;
+#endif
+ } break;
+ case 5 : case 6 : case 7 : case 8 : case 9 : {
+ back = true;
+ } break;
+ }
+ }
+
+
+#line 589 "Bmpp4Progress.wxc"
+ return back;
+}
+
+
+
+void
+Bmpp4Progress::AddNameToStorage(
+ wxString & infilename,
+ bool checkmake,
+ bool & ok
+)
+{
+ dkChar dkifn[DK4_MAX_PATH];
+ dk4_er_t er;
+ dkChar const *osu;
+ one_file_t *onefile;
+ size_t szdkifn = DK4_SIZEOF(dkifn,dkChar);
+
+
+#line 607 "Bmpp4Progress.wxc"
+#if 0
+
+
+#line 609 "Bmpp4Progress.wxc"
+#endif
+ wxCStrData infnamestrdata = infilename.c_str();
+ if (CheckNameSuffix((wxChar const *)infnamestrdata)) {
+ dk4error_init(&er);
+ if (
+ pAppHelp->StringToDk(
+ dkifn, szdkifn, (wxChar const *)infnamestrdata, &er
+ )
+ ) {
+ if (SIZE_MAX > szFiles) {
+ osu = output_suffixes[0];
+ switch (graconf.driver) {
+ case DK4_GRA_DRIVER_EPS : {
+ osu = output_suffixes[1];
+ } break;
+ case DK4_GRA_DRIVER_PS : {
+ osu = output_suffixes[2];
+ } break;
+ }
+ onefile = one_file_new(
+ (wxChar const *)infnamestrdata, dkifn, osu,
+ ((bMakeMode && checkmake) ? (0x01) : (0x00))
+ );
+ if (NULL != onefile) {
+ if (0 != dk4sto_add(sFiles, onefile, NULL)) {
+ szFiles++;
+ }
+ else {
+ one_file_free(onefile);
+ /* ERROR: Memory */
+ if (!(bRepMem)) {
+ pErrors->Append(sTexts[112]);
+ bRepMem = true;
+ }
+ ok = false;
+ bSuccess = false;
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ if (!(bRepMem)) {
+ pErrors->Append(sTexts[112]);
+ bRepMem = true;
+ }
+ ok = false;
+ bSuccess = false;
+ }
+ }
+ }
+ else {
+ switch (er.ec) {
+ case DK4_E_SYNTAX : {
+ /* ERROR: Unconvertable character */
+ pErrors->Append(infilename);
+ pErrors->Append(sTexts[113]);
+ } break;
+ default : {
+ /* ERROR: Name too long */
+ pErrors->Append(infilename);
+ pErrors->Append(sTexts[114]);
+ } break;
+ }
+ ok = false;
+ bSuccess = false;
+ }
+ }
+
+
+#line 676 "Bmpp4Progress.wxc"
+}
+
+
+
+
+#line 681 "Bmpp4Progress.wxc"
+Bmpp4Progress::Bmpp4Progress(
+ wxFrame *parent,
+ Dk4WxApplicationHelper *pAH,
+ wxChar const * const *localizedTexts,
+ wxString dirname,
+ dk4_gra_conf_t const *grco,
+ bool makemode,
+ wxString *errStr
+) : wxDialog(
+ parent,
+ wxID_ANY,
+ localizedTexts[98],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxDEFAULT_DIALOG_STYLE
+)
+{
+
+
+#line 699 "Bmpp4Progress.wxc"
+ pAppHelp = pAH;
+ sTexts = localizedTexts;
+ bSuccess = true;
+ bInUse = false;
+ sDirname = dirname;
+ DK4_MEMCPY(&graconf,grco,sizeof(dk4_gra_conf_t));
+ bMakeMode = makemode;
+ sFiles = NULL;
+ iFiles = NULL;
+ pBif = NULL;
+ pGra = NULL;
+ szFiles = 0;
+ usedFiles = 0;
+ currentFile = NULL;
+ pErrors = errStr;
+ nst = STEP_REPORT_ERROR;
+ gaugeValue = 0;
+ docfl = 0;
+ pagefl = 0;
+ w = 0;
+ h = 0;
+ curof = NULL;
+ bRepMem = false;
+ for (size_t i = 0; i < 8; i++) { cotra[i] = 0.0; }
+ dkctGUILayoutOK = false;
+ sDialog = NULL;
+ verticalSizer = NULL;
+ lFilename = NULL;
+ lProcessingStep = NULL;
+ gProgress = NULL;
+ bCancel = NULL;
+ sDialog = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sDialog)) {
+ goto dkctGUILayoutFinished;
+ }
+ sDialog->Add(10, 10, 0);
+ verticalSizer = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(verticalSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ verticalSizer->Add(10, 10, 0);
+ lFilename = new wxStaticText(
+ this,
+ wxID_ANY,
+ sTexts[56]
+ );
+ if(!(lFilename)) {
+ goto dkctGUILayoutFinished;
+ }
+ verticalSizer->Add(
+ lFilename,
+ 0,
+ wxALIGN_LEFT
+ );
+ verticalSizer->Add(10, 10, 0);
+ lProcessingStep = new wxStaticText(
+ this,
+ wxID_ANY,
+ sTexts[93]
+ );
+ if(!(lProcessingStep)) {
+ goto dkctGUILayoutFinished;
+ }
+ verticalSizer->Add(
+ lProcessingStep,
+ 0,
+ wxALIGN_LEFT
+ );
+ verticalSizer->Add(10, 10, 0);
+ gProgress = new wxGauge(
+ this,
+ wxID_ANY,
+ 1000
+ );
+ if(!(gProgress)) {
+ goto dkctGUILayoutFinished;
+ }
+ verticalSizer->Add(
+ gProgress,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ verticalSizer->Add(10, 10, 0);
+ bCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ sTexts[96]
+ );
+ if(!(bCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ bCancel->SetToolTip(sTexts[97]);
+ verticalSizer->Add(
+ bCancel,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ verticalSizer->Add(10, 10, 0);
+ sDialog->Add(
+ verticalSizer,
+ 0,
+ wxGROW
+ );
+ sDialog->Add(10, 10, 0);
+ SetSizer(sDialog);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sDialog->Fit(this);
+ sDialog->SetSizeHints(this);
+ }
+
+#line 724 "Bmpp4Progress.wxc"
+
+
+#line 725 "Bmpp4Progress.wxc"
+}
+
+
+#line 728 "Bmpp4Progress.wxc"
+
+Bmpp4Progress::~Bmpp4Progress()
+{
+
+
+#line 732 "Bmpp4Progress.wxc"
+
+
+
+#line 734 "Bmpp4Progress.wxc"
+}
+
+
+
+bool
+Bmpp4Progress::PrepareProcessing(void)
+{
+ wxArrayString allfilenames; /* All files in sDirname directory */
+ size_t numfiles; /* Number of files in allfilenames */
+ size_t i; /* Traverse all files */
+ bool back = false;
+
+
+#line 746 "Bmpp4Progress.wxc"
+ sFiles = dk4sto_open(NULL);
+ if (NULL != sFiles) {
+ dk4sto_set_comp(sFiles, one_file_compare, 0);
+ iFiles = dk4sto_it_open(sFiles, NULL);
+ if (NULL != iFiles) {
+ if (wxDir::Exists(sDirname)) {
+
+#line 752 "Bmpp4Progress.wxc"
+ numfiles = wxDir::GetAllFiles(
+ sDirname, &allfilenames, wxEmptyString,
+ (wxDIR_FILES | wxDIR_HIDDEN)
+ );
+ if (0 < numfiles) {
+
+#line 757 "Bmpp4Progress.wxc"
+ back = true;
+ for (i = 0; ((back) && (i < numfiles)); i++) {
+ AddNameToStorage(allfilenames.Item(i), true, back);
+ }
+ }
+ else {
+ bSuccess = false;
+ /* ERROR: No file found */
+ pErrors->Append(sDirname);
+ pErrors->Append(sTexts[115]);
+ }
+ }
+ else {
+
+#line 770 "Bmpp4Progress.wxc"
+ back = true;
+ AddNameToStorage(sDirname, false, back);
+ }
+ }
+ else {
+ bSuccess = false;
+ /* ERROR: Memory */
+ pErrors->Append(sDirname);
+ pErrors->Append(sTexts[116]);
+ }
+ }
+ else {
+ bSuccess = false;
+ /* ERROR: Memory */
+ pErrors->Append(sDirname);
+ pErrors->Append(sTexts[116]);
+ }
+ if (back) {
+ nst = STEP_START_NEW_FILE;
+ }
+
+
+#line 791 "Bmpp4Progress.wxc"
+
+
+#line 792 "Bmpp4Progress.wxc"
+ return back;
+}
+
+
+
+void
+Bmpp4Progress::Cleanup(void)
+{
+ one_file_t *ptr;
+
+
+#line 802 "Bmpp4Progress.wxc"
+ /*
+ Close input bitmap and output graphics
+ */
+ if (NULL != pBif) {
+ dk4bif_close(pBif); pBif = NULL;
+ }
+ if (NULL != pGra) {
+ dk4gra_close(pGra); pGra = NULL;
+ }
+ /*
+ Release collection of files to process
+ */
+ if (NULL != sFiles) {
+ if (NULL != iFiles) {
+ dk4sto_it_reset(iFiles);
+ do {
+ ptr = (one_file_t *)dk4sto_it_next(iFiles);
+ if (NULL != ptr) {
+ one_file_free(ptr);
+ }
+ } while(NULL != ptr);
+ dk4sto_it_close(iFiles);
+ }
+ dk4sto_close(sFiles);
+ }
+ sFiles = NULL; iFiles = NULL; szFiles = 0; usedFiles = 0;
+ currentFile = NULL;
+
+
+#line 830 "Bmpp4Progress.wxc"
+}
+
+
+
+void
+Bmpp4Progress::ProcessingNewFile(bool & cc, bool & rqm, bool & upd)
+{
+ one_file_t *onefile;
+ double xres;
+ double yres;
+ int res;
+ int ngv;
+ bool mustProcess;
+
+
+
+#line 845 "Bmpp4Progress.wxc"
+ /* Remove artefacts from previous files, if any
+ */
+ if (NULL != pGra) { dk4gra_close(pGra); pGra = NULL; }
+ if (NULL != pBif) { dk4bif_close(pBif); pBif = NULL; }
+ /*
+ Get and process next file
+ */
+ if (NULL != iFiles) {
+
+#line 853 "Bmpp4Progress.wxc"
+ onefile = (one_file_t *)dk4sto_it_next(iFiles);
+ if (NULL != onefile) {
+
+#line 855 "Bmpp4Progress.wxc"
+ curof = onefile;
+ /*
+ Set file name.
+ */
+ lFilename->SetLabel(onefile->shortifn);
+ lProcessingStep->SetLabel(sTexts[93]);
+ upd = true;
+ /*
+ Check whether processing is necessary
+ */
+ mustProcess = true;
+ if (0x00 != onefile->mcheck) {
+
+#line 867 "Bmpp4Progress.wxc"
+ res = dk4makemode_must_rebuild(
+ onefile->dkofn, onefile->dkifn
+ );
+ if (0 == res) {
+
+#line 871 "Bmpp4Progress.wxc"
+ mustProcess = false;
+ }
+ }
+ /*
+ Start processing
+ */
+ if (mustProcess) {
+
+#line 878 "Bmpp4Progress.wxc"
+ /*
+ Create data structures to process file.
+ */
+ Refresh();
+ Update();
+ graOkForFile = 1;
+ pBif = dk4bif_open(onefile->dkifn, 0, &(graconf.ctx), NULL);
+ if (NULL != pBif) {
+
+#line 886 "Bmpp4Progress.wxc"
+ currentFrame = 0;
+ docfl = dk4gra_conf_flags_document(&graconf);
+ pagefl = dk4gra_conf_flags_image(&graconf);
+ pagefl |= DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS;
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ /*
+ Document
+ */
+
+
+#line 895 "Bmpp4Progress.wxc"
+ pagefl &= (~(DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO));
+#if 0
+ pagefl &= (~(DK4_GRA_IMG_FLAG_ALLOW_ROTATION));
+#endif
+ if (DK4_GRA_DRIVER_PDF == graconf.driver) {
+ pagefl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+ }
+ w = (size_t)ceil(graconf.media.w);
+ h = (size_t)ceil(graconf.media.h);
+ }
+ else {
+ /*
+ Object or image
+ */
+
+
+#line 910 "Bmpp4Progress.wxc"
+ docfl |= DK4_GRA_PAGE_FLAG_NO_BG;
+ if (DK4_GRA_PURPOSE_OBJECT == graconf.purpose) {
+ pagefl &= (~(DK4_GRA_IMG_FLAG_FILL_BACKGROUND));
+ }
+ else {
+ pagefl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+ }
+ if ((0.0 < graconf.xres) && (0.0 < graconf.yres)) {
+ dk4bif_set_res(
+ pBif, graconf.xres, graconf.yres, NULL
+ );
+ }
+ w = (size_t)dk4bif_get_width(pBif);
+ h = (size_t)dk4bif_get_height(pBif);
+ cotra[3] = (double)w;
+ cotra[4] = (double)h;
+ if (0 == graconf.img_ign_res) {
+ xres = dk4bif_get_xres(pBif);
+ yres = dk4bif_get_yres(pBif);
+ if ((0.0 < xres) && (0.0 < yres)) {
+ if (
+ (1.0e-5 < fabs(xres - 72.0))
+ || (1.0e-5 < fabs(yres - 72.0))
+ ) {
+ xres = (72.0 * (double)w) / xres;
+ yres = (72.0 * (double)h) / yres;
+ if (0 != dk4ma_is_finite(xres)) {
+ if (0 != dk4ma_is_finite(yres)) {
+ if ((double)(SIZE_MAX) > xres) {
+ if((double)(SIZE_MAX) > yres) {
+ w = (size_t)ceil(xres);
+ h = (size_t)ceil(yres);
+ cotra[0] =
+ ((double)w - xres) / 2.0;
+ cotra[1] =
+ ((double)h - yres) / 2.0;
+ cotra[3] = xres;
+ cotra[4] = yres;
+ if (0.0 > cotra[0]) {
+ cotra[0] = 0.0;
+ }
+ if (0.0 > cotra[1]) {
+ cotra[1] = 0.0;
+ }
+ if (
+ 1.0e-5 > fabs(cotra[0])
+ ) {
+ cotra[0] = 0.0;
+ }
+ if (
+ 1.0e-5 > fabs(cotra[1])
+ ) {
+ cotra[1] = 0.0;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ /* Dimensions and transformations calculated
+ */
+ }
+
+
+#line 975 "Bmpp4Progress.wxc"
+
+
+#line 976 "Bmpp4Progress.wxc"
+ switch (graconf.driver) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ pGra = dk4gra_open_ps(onefile->dkofn, w, h, docfl, NULL);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ pGra = dk4gra_open_pgf(onefile->dkofn, w, h, docfl, 1, NULL);
+ } break;
+ default : { /* PDF */
+ pGra = dk4gra_open_pdf(onefile->dkofn, w, h, docfl, NULL);
+ } break;
+ }
+ if (NULL != pGra) {
+ graOkForFile = 1;
+ nst = STEP_GENERATE_OUTPUT;
+ lProcessingStep->SetLabel(sTexts[94]);
+ }
+ else {
+ /* ERROR: Failed to open graphics output */
+ pErrors->Append(onefile->infilename);
+ pErrors->Append(sTexts[118]);
+ bSuccess = false;
+ usedFiles++;
+ lProcessingStep->SetLabel(sTexts[101]);
+ if (0 < szFiles) {
+ ngv = ((size_t)1000 * usedFiles) / szFiles;
+ if (1000 < ngv) { ngv = 1000; }
+ if (ngv != gaugeValue) {
+ gaugeValue = ngv;
+ gProgress->SetValue(ngv);
+ }
+ }
+ }
+ }
+ else {
+
+#line 1010 "Bmpp4Progress.wxc"
+ /* ERROR: Failed to read input file */
+ pErrors->Append(onefile->infilename);
+ pErrors->Append(sTexts[117]);
+ bSuccess = false;
+ usedFiles++;
+ lProcessingStep->SetLabel(sTexts[101]);
+ if (0 < szFiles) {
+ ngv = ((size_t)1000 * usedFiles) / szFiles;
+ if (1000 < ngv) { ngv = 1000; }
+ if (ngv != gaugeValue) {
+ gaugeValue = ngv;
+ gProgress->SetValue(ngv);
+ }
+ }
+ }
+ }
+ else {
+
+#line 1027 "Bmpp4Progress.wxc"
+ /*
+ No need to process file, destination file up to date
+ */
+ usedFiles++;
+ lProcessingStep->SetLabel(sTexts[101]);
+ if (0 < szFiles) {
+ ngv = ((size_t)1000 * usedFiles) / szFiles;
+ if (1000 < ngv) { ngv = 1000; }
+ if (ngv != gaugeValue) {
+ gaugeValue = ngv;
+ gProgress->SetValue(ngv);
+ }
+ }
+ }
+ }
+ else {
+ /*
+ No more files, finished successfully
+ */
+ cc = rqm = false;
+ }
+ }
+ else {
+ cc = rqm = false;
+ }
+
+
+#line 1053 "Bmpp4Progress.wxc"
+}
+
+
+
+void
+Bmpp4Progress::ProcessingGenerateOutput(bool & cc, bool & rqm, bool & upd)
+{
+ double xl; /* Left y position */
+ double xr; /* Right x position */
+ double yb; /* Bottom y position */
+ double yt; /* Top y position */
+
+
+#line 1065 "Bmpp4Progress.wxc"
+ if ((NULL != pGra) && (NULL != pBif)) {
+ if (
+ (
+ (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose)
+ && (dk4bif_get_number_of_frames(pBif) > currentFrame)
+ )
+ || (0 == currentFrame)
+ ) {
+ if (0 != dk4bif_set_current_frame(pBif, currentFrame)) {
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ /*
+ Produce page in a document
+ */
+ if ((0.0 < graconf.xres) && (0.0 < graconf.yres)) {
+ dk4bif_set_res(pBif, graconf.xres, graconf.yres, NULL);
+ }
+ xl = graconf.media.i;
+ xr = graconf.media.w - graconf.media.o;
+ yb = graconf.media.b;
+ yt = graconf.media.h - graconf.media.t;
+ if ((size_t)0U != (currentFrame % (size_t)2U)) {
+
+
+#line 1087 "Bmpp4Progress.wxc"
+ if (0 != graconf.doc_tumble) {
+ yb = graconf.media.t;
+ yt = graconf.media.h - graconf.media.b;
+ }
+ else {
+ if (0 != graconf.doc_duplex) {
+ xl = graconf.media.o;
+ xr = graconf.media.w - graconf.media.i;
+ }
+ }
+ }
+ dk4gra_page(pGra, &graOkForFile, NULL);
+ dk4gra_bif_image(
+ pGra, xl, xr, yb, yt, pBif, curof->dkifn, currentFrame,
+ pagefl, NULL, &graOkForFile, NULL
+ );
+ }
+ else {
+ /*
+ Produce object or image
+ */
+ dk4gra_page(pGra, &graOkForFile, NULL);
+ dk4gra_bif_cotra_image(
+ pGra,cotra,pBif,curof->dkifn,0,pagefl,&graOkForFile,NULL
+ );
+ }
+ }
+ else {
+ /* ERROR: Failed to set frame */
+ pErrors->Append(curof->infilename);
+ pErrors->Append(sTexts[119]);
+ bSuccess = false;
+ }
+ currentFrame++;
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ if (dk4bif_get_number_of_frames(pBif) <= currentFrame) {
+ nst = STEP_WRITE_FILE;
+ dk4bif_close(pBif);
+ pBif = NULL;
+ lProcessingStep->SetLabel(sTexts[95]);
+ upd = true;
+ }
+ }
+ else {
+ nst = STEP_WRITE_FILE;
+ dk4bif_close(pBif);
+ pBif = NULL;
+ }
+ }
+ else {
+ nst = STEP_WRITE_FILE;
+ dk4bif_close(pBif);
+ pBif = NULL;
+ }
+ }
+ else {
+ /* ##### BUG */
+ cc = rqm = false;
+ }
+
+
+#line 1147 "Bmpp4Progress.wxc"
+}
+
+
+
+void
+Bmpp4Progress::ProcessingWriteOutput(bool & upd)
+{
+ int ngv; /* New value for gauge */
+
+
+#line 1156 "Bmpp4Progress.wxc"
+ if (NULL != pGra) {
+
+#line 1157 "Bmpp4Progress.wxc"
+ if (0 != graOkForFile) {
+
+#line 1158 "Bmpp4Progress.wxc"
+ dk4gra_write_and_close(pGra, &graOkForFile, NULL);
+ if (0 == graOkForFile) {
+
+#line 1160 "Bmpp4Progress.wxc"
+ /* ERROR: Failed to write */
+ pErrors->Append(curof->infilename);
+ pErrors->Append(sTexts[120]);
+ bSuccess = false;
+ }
+ }
+ else {
+
+#line 1167 "Bmpp4Progress.wxc"
+ dk4gra_close(pGra);
+ }
+ pGra = NULL;
+ usedFiles++;
+ if (0 < szFiles) {
+ ngv = ((size_t)1000 * usedFiles) / szFiles;
+ if (1000 < ngv) { ngv = 1000; }
+ if (ngv != gaugeValue) {
+ gaugeValue = ngv;
+ gProgress->SetValue(ngv);
+ lProcessingStep->SetLabel(sTexts[93]);
+ upd = true;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1184 "Bmpp4Progress.wxc"
+ /* ##### BUG */
+#if 0
+ cc = rqm = false;
+#endif
+ }
+#endif
+ nst = STEP_START_NEW_FILE;
+
+
+#line 1192 "Bmpp4Progress.wxc"
+}
+
+
+
+void
+Bmpp4Progress::ProcessingStep(bool & cc, bool & rqm, bool & upd)
+{
+
+
+#line 1200 "Bmpp4Progress.wxc"
+
+ switch (nst) {
+ case STEP_START_NEW_FILE : {
+ /*
+ Start processing for next input file candidate
+ */
+ ProcessingNewFile(cc, rqm, upd);
+ } break;
+ case STEP_GENERATE_OUTPUT : {
+ /*
+ Prepare output for next frame
+ */
+ ProcessingGenerateOutput(cc, rqm, upd);
+ } break;
+ case STEP_WRITE_FILE : {
+ /*
+ Write output to file
+ */
+ ProcessingWriteOutput(upd);
+ } break;
+ case STEP_REPORT_ERROR : {
+ /*
+ Report error and skip processing
+ */
+ cc = rqm = false;
+ } break;
+ }
+
+
+#line 1228 "Bmpp4Progress.wxc"
+}
+
+
+
+void
+Bmpp4Progress::OnIdle(wxIdleEvent & event)
+{
+ bool rqm = true; /* Request more idle events */
+ bool cc = true; /* Can continue */
+ bool upd = true; /* Must update window */
+
+
+#line 1239 "Bmpp4Progress.wxc"
+ if (CanEnterCriticalSection()) {
+ ProcessingStep(cc, rqm, upd);
+ if (cc) {
+ LeaveCriticalSection();
+ if (upd) {
+ Refresh();
+ Update();
+ }
+ }
+ else {
+ if(IsModal()) {
+ EndModal((bSuccess) ? wxID_OK : wxID_CANCEL);
+ }
+ else {
+ SetReturnCode((bSuccess) ? wxID_OK : wxID_CANCEL);
+ Show(false);
+ }
+ }
+ if (rqm) {
+ event.RequestMore();
+ }
+ }
+ else {
+ }
+
+
+#line 1264 "Bmpp4Progress.wxc"
+ event.Skip();
+}
+
+
+
+void
+Bmpp4Progress::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool done = false;
+
+
+#line 1274 "Bmpp4Progress.wxc"
+ /* First wait until other code sections accessing critical variables
+ are done, deny other code to enter critical sections
+ */
+ do {
+ wxCriticalSectionLocker lock(csProtect);
+ if (!(bInUse)) {
+ bInUse = true;
+ done = true;
+ bSuccess = false;
+ }
+ } while (!(done));
+
+ pErrors->Append(sTexts[121]);
+ /* Now close the dialog
+ */
+ if(IsModal()) {
+ EndModal((bSuccess) ? wxID_OK : wxID_CANCEL);
+ }
+ else {
+ SetReturnCode((bSuccess) ? wxID_OK : wxID_CANCEL);
+ Show(false);
+ }
+
+
+#line 1297 "Bmpp4Progress.wxc"
+}
+
+
+
+bool
+Bmpp4Progress::CanEnterCriticalSection(void)
+{
+ bool back = false;
+ {
+ wxCriticalSectionLocker lock(csProtect);
+ if (!(bInUse)) {
+ bInUse = true;
+ back = true;
+ }
+ }
+ return back;
+}
+
+
+
+void
+Bmpp4Progress::LeaveCriticalSection(void)
+{
+ wxCriticalSectionLocker lock(csProtect);
+ bInUse = false;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Bmpp4Progress.h b/support/dktools/Bmpp4Progress.h
new file mode 100644
index 0000000000..01ce6b78a6
--- /dev/null
+++ b/support/dktools/Bmpp4Progress.h
@@ -0,0 +1,333 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Bmpp4Progress.wxc
+*/
+
+#ifndef BMPP4PROGRESS_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define BMPP4PROGRESS_H_INCLUDED 1
+
+
+#line 49 "Bmpp4Progress.wxc"
+
+/** @file Bmpp4Progress.h Progress dialog shown while processing.
+*/
+
+#ifndef DK4GRCO_H_INCLUDED
+#include <dk4grco.h>
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#include <dk4sto.h>
+#endif
+
+
+
+/** One input file to process.
+*/
+typedef struct {
+ wxChar *infilename; /**< Input file name, allocated. */
+ wxChar *shortifn; /**< Short file name, in filename. */
+ dkChar *dkifn; /**< Input file name allocated. */
+ dkChar *dkofn; /**< Output file name, allocated. */
+ unsigned char mcheck; /**< Flag: Do make-operation check. */
+} one_file_t;
+
+
+
+
+#line 76 "Bmpp4Progress.wxc"
+class Bmpp4Progress : public wxDialog
+{
+ private:
+
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+
+ /** Decision for next step to execute.
+ */
+ enum {
+ STEP_REPORT_ERROR = -1 , /**< Error occured initialization. */
+ STEP_START_NEW_FILE = 0 , /**< Retrieve next file name. */
+ STEP_GENERATE_OUTPUT , /**< Generate output for one frame. */
+ STEP_WRITE_FILE , /**< Write output to file. */
+ };
+
+
+ /** Protect variables against concurrent access.
+ */
+ wxCriticalSection csProtect;
+
+ /** Graphics output configuration.
+ */
+ dk4_gra_conf_t graconf;
+
+ /** Coordinates transformation.
+ */
+ double cotra[8];
+
+ /** Directory name to process.
+ */
+ wxString sDirname;
+
+ /** Current file processed.
+ */
+ one_file_t *curof;
+
+ /** Bitmap image to read from.
+ */
+ dk4_bif_t *pBif;
+
+ /** Graphics object to create.
+ */
+ dk4_gra_t *pGra;
+
+ /** Application helper for encoding changes.
+ */
+ Dk4WxApplicationHelper *pAppHelp;
+
+ /** Localized texts for wxbmpp application.
+ */
+ wxChar const * const *sTexts;
+
+ /** String containing all the error messages.
+ */
+ wxString *pErrors;
+
+ /** Collection of file names to process.
+ */
+ dk4_sto_t *sFiles;
+
+ /** Iterator through file name collection.
+ */
+ dk4_sto_it_t *iFiles;
+
+ /** Current file to process.
+ */
+ one_file_t *currentFile;
+
+ /** Number of files in sFiles.
+ */
+ size_t szFiles;
+
+ /** Number of files already processed from sFiles.
+ */
+ size_t usedFiles;
+
+ /** Current frame number to process next.
+ */
+ size_t currentFrame;
+
+ /** Image width.
+ */
+ size_t w;
+
+ /** Image height.
+ */
+ size_t h;
+
+ /** Flags to use for document when opening graphics output.
+ */
+ int docfl;
+
+ /** Flags to use for pages when opening graphics output.
+ */
+ int pagefl;
+
+ /** Value to show in progress bar.
+ */
+ int gaugeValue;
+
+ /** Next step type, one from enumeration.
+ */
+ int nst;
+
+ /** No errors occured for current file.
+ */
+ int graOkForFile;
+
+ /** Flag: Critical variables are currently in use.
+ */
+ bool bInUse;
+
+ /** Indicate successful processing without errors.
+ */
+ bool bSuccess;
+
+ /** Run in make operating mode on directories.
+ */
+ bool bMakeMode;
+
+ /** Flag: Memory error already reported.
+ */
+ bool bRepMem;
+
+ protected:
+
+ /** Execute one processing step.
+ @param cc Flag: Can continue.
+ @param rqm Flag: Require more idle events.
+ @param upd Flag: Update dialog after step.
+ */
+ void
+ ProcessingStep(bool & cc, bool & rqm, bool & upd);
+
+ /** Execute one processing step.
+ @param cc Flag: Can continue.
+ @param rqm Flag: Require more idle events.
+ @param upd Flag: Update dialog after step.
+ */
+ void
+ ProcessingNewFile(bool & cc, bool & rqm, bool & upd);
+
+ /** Execute one processing step.
+ @param cc Flag: Can continue.
+ @param rqm Flag: Require more idle events.
+ @param upd Flag: Update dialog after step.
+ */
+ void
+ ProcessingGenerateOutput(bool & cc, bool & rqm, bool & upd);
+
+ /** Execute one processing step.
+ @param cc Flag: Can continue.
+ @param rqm Flag: Require more idle events.
+ @param upd Flag: Update dialog after step.
+ */
+ void
+ ProcessingWriteOutput(bool & upd);
+
+ /** Add one input file name to storage.
+ @param infilename Input candidate file.
+ @param checkmake Flag: Check whether output file exists.
+ @param ok Success variable to reset on errors.
+ */
+ void
+ AddNameToStorage(
+ wxString & infilename,
+ bool checkmake,
+ bool & ok
+ );
+
+ /** Check whether a file name is suitable as input file.
+ @param infilename Input file name to check.
+ @return True if the file can be used, false otherwise.
+ */
+ bool
+ CheckNameSuffix(wxChar const *infilename);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sDialog.
+ */
+#line 12 "Bmpp4Progress.wxc"
+ wxBoxSizer *sDialog;
+
+ /** GUI element verticalSizer.
+ */
+#line 18 "Bmpp4Progress.wxc"
+ wxBoxSizer *verticalSizer;
+
+ /** GUI element lFilename.
+ */
+#line 31 "Bmpp4Progress.wxc"
+ wxStaticText *lFilename;
+
+ /** GUI element lProcessingStep.
+ */
+#line 34 "Bmpp4Progress.wxc"
+ wxStaticText *lProcessingStep;
+
+ /** GUI element gProgress.
+ */
+#line 37 "Bmpp4Progress.wxc"
+ wxGauge *gProgress;
+
+ /** GUI element bCancel.
+ */
+#line 42 "Bmpp4Progress.wxc"
+ wxButton *bCancel;
+
+
+#line 261 "Bmpp4Progress.wxc"
+
+ public:
+
+ /** Constructor.
+ @param parent Parent window.
+ @param pAH Application helper.
+ @param localizedTexts Localized texts in users language.
+ @param dirname Directory or file to process.
+ @param grco Graphics configuration.
+ @param makemode Bool: Operate like "make".
+ @param errStr Error string to store error messages.
+ */
+ Bmpp4Progress(
+ wxFrame *parent,
+ Dk4WxApplicationHelper *pAH,
+ wxChar const * const *localizedTexts,
+ wxString dirname,
+ dk4_gra_conf_t const *grco,
+ bool makemode,
+ wxString *errStr
+ );
+
+ /** Destructor.
+ */
+ ~Bmpp4Progress();
+
+ /** Prepare data structures for processing.
+ @return True on success, false on error.
+ */
+ bool
+ PrepareProcessing(void);
+
+ /** Clean up data structures after processing.
+ */
+ void
+ Cleanup(void);
+
+ /** Idle event handler, do processing step.
+ @param event Event to process.
+ */
+ void
+ OnIdle(wxIdleEvent & event);
+
+ /** Cancel button handler, abort processing.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ bool
+ CanEnterCriticalSection(void);
+
+ void
+ LeaveCriticalSection(void);
+
+};
+
+
+
+
+#line 321 "Bmpp4Progress.wxc"
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/Bmpp4Progress.wxc b/support/dktools/Bmpp4Progress.wxc
new file mode 100644
index 0000000000..576f263669
--- /dev/null
+++ b/support/dktools/Bmpp4Progress.wxc
@@ -0,0 +1,1326 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sDialog
+
+[wxBoxSizer sDialog]
+direction = horizontal
+contents = $space(10)
+contents = verticalSizer
+contents = $space(10)
+
+[wxBoxSizer verticalSizer]
+direction = vertical
+grow = yes
+contents = $space(10)
+contents = lFilename left
+contents = $space(10)
+contents = lProcessingStep left
+contents = $space(10)
+contents = gProgress centered-x
+contents = $space(10)
+contents = bCancel centered-x
+contents = $space(10)
+
+[wxStaticText lFilename]
+text = sTexts[56]
+
+[wxStaticText lProcessingStep]
+text = sTexts[93]
+
+[wxGauge gProgress]
+range = 1000
+value = 0
+grow = yes
+
+[wxButton bCancel]
+id = wxID_CANCEL
+text = sTexts[96]
+tip = sTexts[97]
+
+
+%% header start
+
+/** @file Bmpp4Progress.h Progress dialog shown while processing.
+*/
+
+#ifndef DK4GRCO_H_INCLUDED
+#include <dk4grco.h>
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#include <dk4sto.h>
+#endif
+
+
+
+/** One input file to process.
+*/
+typedef struct {
+ wxChar *infilename; /**< Input file name, allocated. */
+ wxChar *shortifn; /**< Short file name, in filename. */
+ dkChar *dkifn; /**< Input file name allocated. */
+ dkChar *dkofn; /**< Output file name, allocated. */
+ unsigned char mcheck; /**< Flag: Do make-operation check. */
+} one_file_t;
+
+
+
+%% class start
+class Bmpp4Progress : public wxDialog
+{
+ private:
+
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+
+ /** Decision for next step to execute.
+ */
+ enum {
+ STEP_REPORT_ERROR = -1 , /**< Error occured initialization. */
+ STEP_START_NEW_FILE = 0 , /**< Retrieve next file name. */
+ STEP_GENERATE_OUTPUT , /**< Generate output for one frame. */
+ STEP_WRITE_FILE , /**< Write output to file. */
+ };
+
+
+ /** Protect variables against concurrent access.
+ */
+ wxCriticalSection csProtect;
+
+ /** Graphics output configuration.
+ */
+ dk4_gra_conf_t graconf;
+
+ /** Coordinates transformation.
+ */
+ double cotra[8];
+
+ /** Directory name to process.
+ */
+ wxString sDirname;
+
+ /** Current file processed.
+ */
+ one_file_t *curof;
+
+ /** Bitmap image to read from.
+ */
+ dk4_bif_t *pBif;
+
+ /** Graphics object to create.
+ */
+ dk4_gra_t *pGra;
+
+ /** Application helper for encoding changes.
+ */
+ Dk4WxApplicationHelper *pAppHelp;
+
+ /** Localized texts for wxbmpp application.
+ */
+ wxChar const * const *sTexts;
+
+ /** String containing all the error messages.
+ */
+ wxString *pErrors;
+
+ /** Collection of file names to process.
+ */
+ dk4_sto_t *sFiles;
+
+ /** Iterator through file name collection.
+ */
+ dk4_sto_it_t *iFiles;
+
+ /** Current file to process.
+ */
+ one_file_t *currentFile;
+
+ /** Number of files in sFiles.
+ */
+ size_t szFiles;
+
+ /** Number of files already processed from sFiles.
+ */
+ size_t usedFiles;
+
+ /** Current frame number to process next.
+ */
+ size_t currentFrame;
+
+ /** Image width.
+ */
+ size_t w;
+
+ /** Image height.
+ */
+ size_t h;
+
+ /** Flags to use for document when opening graphics output.
+ */
+ int docfl;
+
+ /** Flags to use for pages when opening graphics output.
+ */
+ int pagefl;
+
+ /** Value to show in progress bar.
+ */
+ int gaugeValue;
+
+ /** Next step type, one from enumeration.
+ */
+ int nst;
+
+ /** No errors occured for current file.
+ */
+ int graOkForFile;
+
+ /** Flag: Critical variables are currently in use.
+ */
+ bool bInUse;
+
+ /** Indicate successful processing without errors.
+ */
+ bool bSuccess;
+
+ /** Run in make operating mode on directories.
+ */
+ bool bMakeMode;
+
+ /** Flag: Memory error already reported.
+ */
+ bool bRepMem;
+
+ protected:
+
+ /** Execute one processing step.
+ @param cc Flag: Can continue.
+ @param rqm Flag: Require more idle events.
+ @param upd Flag: Update dialog after step.
+ */
+ void
+ ProcessingStep(bool & cc, bool & rqm, bool & upd);
+
+ /** Execute one processing step.
+ @param cc Flag: Can continue.
+ @param rqm Flag: Require more idle events.
+ @param upd Flag: Update dialog after step.
+ */
+ void
+ ProcessingNewFile(bool & cc, bool & rqm, bool & upd);
+
+ /** Execute one processing step.
+ @param cc Flag: Can continue.
+ @param rqm Flag: Require more idle events.
+ @param upd Flag: Update dialog after step.
+ */
+ void
+ ProcessingGenerateOutput(bool & cc, bool & rqm, bool & upd);
+
+ /** Execute one processing step.
+ @param cc Flag: Can continue.
+ @param rqm Flag: Require more idle events.
+ @param upd Flag: Update dialog after step.
+ */
+ void
+ ProcessingWriteOutput(bool & upd);
+
+ /** Add one input file name to storage.
+ @param infilename Input candidate file.
+ @param checkmake Flag: Check whether output file exists.
+ @param ok Success variable to reset on errors.
+ */
+ void
+ AddNameToStorage(
+ wxString & infilename,
+ bool checkmake,
+ bool & ok
+ );
+
+ /** Check whether a file name is suitable as input file.
+ @param infilename Input file name to check.
+ @return True if the file can be used, false otherwise.
+ */
+ bool
+ CheckNameSuffix(wxChar const *infilename);
+
+%% class end
+
+ public:
+
+ /** Constructor.
+ @param parent Parent window.
+ @param pAH Application helper.
+ @param localizedTexts Localized texts in users language.
+ @param dirname Directory or file to process.
+ @param grco Graphics configuration.
+ @param makemode Bool: Operate like "make".
+ @param errStr Error string to store error messages.
+ */
+ Bmpp4Progress(
+ wxFrame *parent,
+ Dk4WxApplicationHelper *pAH,
+ wxChar const * const *localizedTexts,
+ wxString dirname,
+ dk4_gra_conf_t const *grco,
+ bool makemode,
+ wxString *errStr
+ );
+
+ /** Destructor.
+ */
+ ~Bmpp4Progress();
+
+ /** Prepare data structures for processing.
+ @return True on success, false on error.
+ */
+ bool
+ PrepareProcessing(void);
+
+ /** Clean up data structures after processing.
+ */
+ void
+ Cleanup(void);
+
+ /** Idle event handler, do processing step.
+ @param event Event to process.
+ */
+ void
+ OnIdle(wxIdleEvent & event);
+
+ /** Cancel button handler, abort processing.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ bool
+ CanEnterCriticalSection(void);
+
+ void
+ LeaveCriticalSection(void);
+
+};
+
+
+
+%% header end
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module start
+
+#include "wxbmpp.h"
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4MM_H_INCLUDED
+#include "dk4mm.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+$!trace-include
+
+
+
+/** Event handler table.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Bmpp4Progress,wxDialog)
+#else
+BEGIN_EVENT_TABLE(Bmpp4Progress,wxDialog)
+#endif
+ EVT_IDLE(Bmpp4Progress::OnIdle)
+ EVT_BUTTON(wxID_CANCEL,Bmpp4Progress::OnCancel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+/** List of suffixes for input file names.
+*/
+static wxChar const * const input_suffixes[] = {
+$!string-table macro=wxT
+.png
+.jpg
+.jpeg
+.tif
+.tiff
+.pbm
+.pgm
+.ppm
+.pnm
+.pam
+$!end
+};
+
+
+
+/** Output file name suffixes.
+*/
+dkChar const * const output_suffixes[] = {
+$!string-table macro=dkT
+.pdf
+.eps
+.ps
+$!end
+};
+
+
+/** Release memory for one one_file_t structure.
+ @param ptr Structure to release.
+*/
+static
+void
+one_file_free(one_file_t *ptr)
+{
+ $? "+ one_file_free"
+ if (NULL != ptr) {
+#if TRACE_DEBUG
+ if (NULL != ptr->infilename) {
+ $? ". wx ifn = \"%!ws\"", ptr->infilename
+ }
+ if (NULL != ptr->shortifn) {
+ $? ". wx short = \"%!ws\"", ptr->shortifn
+ }
+ if (NULL != ptr->dkifn) {
+ $? ". dk ifn = \"%!ds\"", ptr->dkifn
+ }
+ if (NULL != ptr->dkofn) {
+ $? ". dk ofn = \"%!ds\"", ptr->dkofn
+ }
+ $? ". mcheck = %u", (unsigned)(ptr->mcheck)
+#endif
+ dk4mem_release(ptr->infilename);
+ dk4mem_release(ptr->dkifn);
+ dk4mem_release(ptr->dkofn);
+ ptr->shortifn = NULL;
+ dk4mem_free(ptr);
+ }
+ $? "- one_file_free"
+}
+
+
+
+/** Create structure for one file to process.
+ @param wxifn Input file name as wxChar string.
+ @param dkifn Input file name as dkChar string.
+ @param dkosu Output file name suffix as dkChar string.
+ @param mcheck Flag: Use make-mode check.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+static
+one_file_t *
+one_file_new(
+ wxChar const *wxifn,
+ dkChar const *dkifn,
+ dkChar const *dkosu,
+ unsigned char mcheck
+)
+{
+ one_file_t *back = NULL;
+ wxChar *p1;
+ wxChar *p2;
+ int ok = 0;
+ $? "+ one_file_new"
+ $? ". wx ifn = \"%!ws\"", wxifn
+ $? ". dk ifn = \"%!ds\"", dkifn
+ $? ". suffix = \"%!ds\"", dkosu
+ $? ". mcheck = %u", (unsigned)mcheck
+ back = dk4mem_new(one_file_t,1,NULL);
+ if (NULL != back) {
+ back->infilename = NULL;
+ back->shortifn = NULL;
+ back->dkifn = NULL;
+ back->dkofn = NULL;
+ back->mcheck = mcheck;
+ back->infilename = dk4strx_dup(wxifn, NULL);
+ if (NULL != back->infilename) {
+ back->dkifn = dk4str_dup(dkifn, NULL);
+ if (NULL != back->dkifn) {
+ back->dkofn = dk4path_dup_change_suffix(dkifn, dkosu, NULL);
+ if (NULL != back->dkofn) { $? ". dk ofn = \"%!ds\"", back->dkofn
+ /*
+ All allocations succeeded
+ */
+ ok = 1;
+ /*
+ Set pointer to short file name
+ */
+ back->shortifn = back->infilename;
+ p1 = back->infilename; p2 = NULL;
+ while (wxT('\0') != *p1) {
+#if DK4_HAVE_BACKSLASH_AS_SEP
+ if (wxT('\\') == *p1) { p2 = p1; }
+#else
+ if (wxT('/') == *p1) { p2 = p1; }
+#endif
+ p1++;
+ }
+ if (NULL != p2) {
+ p2++;
+ back->shortifn = p2;
+ } $? ". wx shortifn = \"%!ws\"", back->shortifn
+ }
+ }
+ }
+ /* Destroy structure and return NULL if one of the allocations failed
+ */
+ if (0 == ok) {
+ one_file_free(back);
+ back = NULL;
+ }
+ }
+ $? "- one_file_new %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Compare two one_file_t structures by infilename component.
+ @param l Left structure.
+ @param r Right structure.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result: 1 for l>r, 0 for l=r, -1 for l<r.
+*/
+static
+int
+one_file_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ one_file_t const *pl; /* Left structure */
+ one_file_t const *pr; /* Right structure */
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (one_file_t const *)l;
+ pr = (one_file_t const *)r;
+ if (NULL != pl->infilename) {
+ if (NULL != pr->infilename) {
+ back = dk4strx_pathcmp(pl->infilename, pr->infilename);
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != pr->infilename) {
+ back = -1;
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+bool
+Bmpp4Progress::CheckNameSuffix(wxChar const *infilename)
+{
+ wxChar const *fns;
+ bool back = false;
+ $? "+ CheckNameSuffix \"%!ws\"", infilename
+ fns = dk4strx_get_path_suffix(infilename, NULL);
+ if (NULL != fns) {
+ switch ( dk4strx_array_index(input_suffixes, fns, 0) ) {
+ case 0 : {
+#if DK4_HAVE_PNG_H
+ back = true;
+#endif
+ } break;
+ case 1 : case 2 : {
+#if DK4_HAVE_JPEGLIB_H
+ back = true;
+#endif
+ } break;
+ case 3 : case 4 : {
+#if DK4_HAVE_TIFF_H
+ back = true;
+#endif
+ } break;
+ case 5 : case 6 : case 7 : case 8 : case 9 : {
+ back = true;
+ } break;
+ }
+ }
+ $? "- CheckNameSuffix %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+void
+Bmpp4Progress::AddNameToStorage(
+ wxString & infilename,
+ bool checkmake,
+ bool & ok
+)
+{
+ dkChar dkifn[DK4_MAX_PATH];
+ dk4_er_t er;
+ dkChar const *osu;
+ one_file_t *onefile;
+ size_t szdkifn = DK4_SIZEOF(dkifn,dkChar);
+ $? "+ AddNameToStorage"
+#if 0
+ $? ". wx infilename = \"%!ws\"", (const wxChar *)(infilename.c_str())
+#endif
+ wxCStrData infnamestrdata = infilename.c_str();
+ if (CheckNameSuffix((wxChar const *)infnamestrdata)) {
+ dk4error_init(&er);
+ if (
+ pAppHelp->StringToDk(
+ dkifn, szdkifn, (wxChar const *)infnamestrdata, &er
+ )
+ ) {
+ if (SIZE_MAX > szFiles) {
+ osu = output_suffixes[0];
+ switch (graconf.driver) {
+ case DK4_GRA_DRIVER_EPS : {
+ osu = output_suffixes[1];
+ } break;
+ case DK4_GRA_DRIVER_PS : {
+ osu = output_suffixes[2];
+ } break;
+ }
+ onefile = one_file_new(
+ (wxChar const *)infnamestrdata, dkifn, osu,
+ ((bMakeMode && checkmake) ? (0x01) : (0x00))
+ );
+ if (NULL != onefile) {
+ if (0 != dk4sto_add(sFiles, onefile, NULL)) {
+ szFiles++;
+ }
+ else {
+ one_file_free(onefile);
+ /* ERROR: Memory */
+ if (!(bRepMem)) {
+ pErrors->Append(sTexts[112]);
+ bRepMem = true;
+ }
+ ok = false;
+ bSuccess = false;
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ if (!(bRepMem)) {
+ pErrors->Append(sTexts[112]);
+ bRepMem = true;
+ }
+ ok = false;
+ bSuccess = false;
+ }
+ }
+ }
+ else {
+ switch (er.ec) {
+ case DK4_E_SYNTAX : {
+ /* ERROR: Unconvertable character */
+ pErrors->Append(infilename);
+ pErrors->Append(sTexts[113]);
+ } break;
+ default : {
+ /* ERROR: Name too long */
+ pErrors->Append(infilename);
+ pErrors->Append(sTexts[114]);
+ } break;
+ }
+ ok = false;
+ bSuccess = false;
+ }
+ }
+ $? "- AddNameToStorage"
+}
+
+
+
+%% constructor start
+Bmpp4Progress::Bmpp4Progress(
+ wxFrame *parent,
+ Dk4WxApplicationHelper *pAH,
+ wxChar const * const *localizedTexts,
+ wxString dirname,
+ dk4_gra_conf_t const *grco,
+ bool makemode,
+ wxString *errStr
+) : wxDialog(
+ parent,
+ wxID_ANY,
+ localizedTexts[98],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxDEFAULT_DIALOG_STYLE
+)
+{
+ $? "+ Bmpp4Progress"
+ pAppHelp = pAH;
+ sTexts = localizedTexts;
+ bSuccess = true;
+ bInUse = false;
+ sDirname = dirname;
+ DK4_MEMCPY(&graconf,grco,sizeof(dk4_gra_conf_t));
+ bMakeMode = makemode;
+ sFiles = NULL;
+ iFiles = NULL;
+ pBif = NULL;
+ pGra = NULL;
+ szFiles = 0;
+ usedFiles = 0;
+ currentFile = NULL;
+ pErrors = errStr;
+ nst = STEP_REPORT_ERROR;
+ gaugeValue = 0;
+ docfl = 0;
+ pagefl = 0;
+ w = 0;
+ h = 0;
+ curof = NULL;
+ bRepMem = false;
+ for (size_t i = 0; i < 8; i++) { cotra[i] = 0.0; }
+%% constructor end
+ $? "- Bmpp4Progress"
+}
+
+%% module end
+
+Bmpp4Progress::~Bmpp4Progress()
+{
+ $? "+ ~Bmpp4Progress"
+
+ $? "- ~Bmpp4Progress"
+}
+
+
+
+bool
+Bmpp4Progress::PrepareProcessing(void)
+{
+ wxArrayString allfilenames; /* All files in sDirname directory */
+ size_t numfiles; /* Number of files in allfilenames */
+ size_t i; /* Traverse all files */
+ bool back = false;
+ $? "+ PrepareProcessing"
+ sFiles = dk4sto_open(NULL);
+ if (NULL != sFiles) {
+ dk4sto_set_comp(sFiles, one_file_compare, 0);
+ iFiles = dk4sto_it_open(sFiles, NULL);
+ if (NULL != iFiles) {
+ if (wxDir::Exists(sDirname)) { $? ". directory"
+ numfiles = wxDir::GetAllFiles(
+ sDirname, &allfilenames, wxEmptyString,
+ (wxDIR_FILES | wxDIR_HIDDEN)
+ );
+ if (0 < numfiles) { $? ". numfiles = %u", (unsigned)numfiles
+ back = true;
+ for (i = 0; ((back) && (i < numfiles)); i++) {
+ AddNameToStorage(allfilenames.Item(i), true, back);
+ }
+ }
+ else {
+ bSuccess = false;
+ /* ERROR: No file found */
+ pErrors->Append(sDirname);
+ pErrors->Append(sTexts[115]);
+ }
+ }
+ else { $? ". single file"
+ back = true;
+ AddNameToStorage(sDirname, false, back);
+ }
+ }
+ else {
+ bSuccess = false;
+ /* ERROR: Memory */
+ pErrors->Append(sDirname);
+ pErrors->Append(sTexts[116]);
+ }
+ }
+ else {
+ bSuccess = false;
+ /* ERROR: Memory */
+ pErrors->Append(sDirname);
+ pErrors->Append(sTexts[116]);
+ }
+ if (back) {
+ nst = STEP_START_NEW_FILE;
+ }
+ $? ". number of files %u", (unsigned)szFiles
+ $? "- PrepareProcessing %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+void
+Bmpp4Progress::Cleanup(void)
+{
+ one_file_t *ptr;
+ $? "+ Cleanup"
+ /*
+ Close input bitmap and output graphics
+ */
+ if (NULL != pBif) {
+ dk4bif_close(pBif); pBif = NULL;
+ }
+ if (NULL != pGra) {
+ dk4gra_close(pGra); pGra = NULL;
+ }
+ /*
+ Release collection of files to process
+ */
+ if (NULL != sFiles) {
+ if (NULL != iFiles) {
+ dk4sto_it_reset(iFiles);
+ do {
+ ptr = (one_file_t *)dk4sto_it_next(iFiles);
+ if (NULL != ptr) {
+ one_file_free(ptr);
+ }
+ } while(NULL != ptr);
+ dk4sto_it_close(iFiles);
+ }
+ dk4sto_close(sFiles);
+ }
+ sFiles = NULL; iFiles = NULL; szFiles = 0; usedFiles = 0;
+ currentFile = NULL;
+ $? "- Cleanup"
+}
+
+
+
+void
+Bmpp4Progress::ProcessingNewFile(bool & cc, bool & rqm, bool & upd)
+{
+ one_file_t *onefile;
+ double xres;
+ double yres;
+ int res;
+ int ngv;
+ bool mustProcess;
+
+ $? "+ ProcessingNewFile"
+ /* Remove artefacts from previous files, if any
+ */
+ if (NULL != pGra) { dk4gra_close(pGra); pGra = NULL; }
+ if (NULL != pBif) { dk4bif_close(pBif); pBif = NULL; }
+ /*
+ Get and process next file
+ */
+ if (NULL != iFiles) { $? ". iFiles"
+ onefile = (one_file_t *)dk4sto_it_next(iFiles);
+ if (NULL != onefile) { $? ". onefile"
+ curof = onefile;
+ /*
+ Set file name.
+ */
+ lFilename->SetLabel(onefile->shortifn);
+ lProcessingStep->SetLabel(sTexts[93]);
+ upd = true;
+ /*
+ Check whether processing is necessary
+ */
+ mustProcess = true;
+ if (0x00 != onefile->mcheck) { $? ". make mode, check"
+ res = dk4makemode_must_rebuild(
+ onefile->dkofn, onefile->dkifn
+ );
+ if (0 == res) { $? ". output file exists"
+ mustProcess = false;
+ }
+ }
+ /*
+ Start processing
+ */
+ if (mustProcess) { $? ". must process"
+ /*
+ Create data structures to process file.
+ */
+ Refresh();
+ Update();
+ graOkForFile = 1;
+ pBif = dk4bif_open(onefile->dkifn, 0, &(graconf.ctx), NULL);
+ if (NULL != pBif) { $? ". pBif"
+ currentFrame = 0;
+ docfl = dk4gra_conf_flags_document(&graconf);
+ pagefl = dk4gra_conf_flags_image(&graconf);
+ pagefl |= DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS;
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ /*
+ Document
+ */
+ $? ". produce document"
+ pagefl &= (~(DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO));
+#if 0
+ pagefl &= (~(DK4_GRA_IMG_FLAG_ALLOW_ROTATION));
+#endif
+ if (DK4_GRA_DRIVER_PDF == graconf.driver) {
+ pagefl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+ }
+ w = (size_t)ceil(graconf.media.w);
+ h = (size_t)ceil(graconf.media.h);
+ }
+ else {
+ /*
+ Object or image
+ */
+ $? ". produce image"
+ docfl |= DK4_GRA_PAGE_FLAG_NO_BG;
+ if (DK4_GRA_PURPOSE_OBJECT == graconf.purpose) {
+ pagefl &= (~(DK4_GRA_IMG_FLAG_FILL_BACKGROUND));
+ }
+ else {
+ pagefl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+ }
+ if ((0.0 < graconf.xres) && (0.0 < graconf.yres)) {
+ dk4bif_set_res(
+ pBif, graconf.xres, graconf.yres, NULL
+ );
+ }
+ w = (size_t)dk4bif_get_width(pBif);
+ h = (size_t)dk4bif_get_height(pBif);
+ cotra[3] = (double)w;
+ cotra[4] = (double)h;
+ if (0 == graconf.img_ign_res) {
+ xres = dk4bif_get_xres(pBif);
+ yres = dk4bif_get_yres(pBif);
+ if ((0.0 < xres) && (0.0 < yres)) {
+ if (
+ (1.0e-5 < fabs(xres - 72.0))
+ || (1.0e-5 < fabs(yres - 72.0))
+ ) {
+ xres = (72.0 * (double)w) / xres;
+ yres = (72.0 * (double)h) / yres;
+ if (0 != dk4ma_is_finite(xres)) {
+ if (0 != dk4ma_is_finite(yres)) {
+ if ((double)(SIZE_MAX) > xres) {
+ if((double)(SIZE_MAX) > yres) {
+ w = (size_t)ceil(xres);
+ h = (size_t)ceil(yres);
+ cotra[0] =
+ ((double)w - xres) / 2.0;
+ cotra[1] =
+ ((double)h - yres) / 2.0;
+ cotra[3] = xres;
+ cotra[4] = yres;
+ if (0.0 > cotra[0]) {
+ cotra[0] = 0.0;
+ }
+ if (0.0 > cotra[1]) {
+ cotra[1] = 0.0;
+ }
+ if (
+ 1.0e-5 > fabs(cotra[0])
+ ) {
+ cotra[0] = 0.0;
+ }
+ if (
+ 1.0e-5 > fabs(cotra[1])
+ ) {
+ cotra[1] = 0.0;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ /* Dimensions and transformations calculated
+ */
+ }
+ $? ". w = %lu", (unsigned long)w
+ $? ". h = %lu", (unsigned long)h
+ switch (graconf.driver) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ pGra = dk4gra_open_ps(onefile->dkofn, w, h, docfl, NULL);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ pGra = dk4gra_open_pgf(onefile->dkofn, w, h, docfl, 1, NULL);
+ } break;
+ default : { /* PDF */
+ pGra = dk4gra_open_pdf(onefile->dkofn, w, h, docfl, NULL);
+ } break;
+ }
+ if (NULL != pGra) {
+ graOkForFile = 1;
+ nst = STEP_GENERATE_OUTPUT;
+ lProcessingStep->SetLabel(sTexts[94]);
+ }
+ else {
+ /* ERROR: Failed to open graphics output */
+ pErrors->Append(onefile->infilename);
+ pErrors->Append(sTexts[118]);
+ bSuccess = false;
+ usedFiles++;
+ lProcessingStep->SetLabel(sTexts[101]);
+ if (0 < szFiles) {
+ ngv = ((size_t)1000 * usedFiles) / szFiles;
+ if (1000 < ngv) { ngv = 1000; }
+ if (ngv != gaugeValue) {
+ gaugeValue = ngv;
+ gProgress->SetValue(ngv);
+ }
+ }
+ }
+ }
+ else { $? "! failed to read input image file"
+ /* ERROR: Failed to read input file */
+ pErrors->Append(onefile->infilename);
+ pErrors->Append(sTexts[117]);
+ bSuccess = false;
+ usedFiles++;
+ lProcessingStep->SetLabel(sTexts[101]);
+ if (0 < szFiles) {
+ ngv = ((size_t)1000 * usedFiles) / szFiles;
+ if (1000 < ngv) { ngv = 1000; }
+ if (ngv != gaugeValue) {
+ gaugeValue = ngv;
+ gProgress->SetValue(ngv);
+ }
+ }
+ }
+ }
+ else { $? ". no need to process"
+ /*
+ No need to process file, destination file up to date
+ */
+ usedFiles++;
+ lProcessingStep->SetLabel(sTexts[101]);
+ if (0 < szFiles) {
+ ngv = ((size_t)1000 * usedFiles) / szFiles;
+ if (1000 < ngv) { ngv = 1000; }
+ if (ngv != gaugeValue) {
+ gaugeValue = ngv;
+ gProgress->SetValue(ngv);
+ }
+ }
+ }
+ }
+ else {
+ /*
+ No more files, finished successfully
+ */
+ cc = rqm = false;
+ }
+ }
+ else {
+ cc = rqm = false;
+ }
+ $? "- ProcessingNewFile"
+}
+
+
+
+void
+Bmpp4Progress::ProcessingGenerateOutput(bool & cc, bool & rqm, bool & upd)
+{
+ double xl; /* Left y position */
+ double xr; /* Right x position */
+ double yb; /* Bottom y position */
+ double yt; /* Top y position */
+ $? "+ ProcessingGenerateOutput"
+ if ((NULL != pGra) && (NULL != pBif)) {
+ if (
+ (
+ (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose)
+ && (dk4bif_get_number_of_frames(pBif) > currentFrame)
+ )
+ || (0 == currentFrame)
+ ) {
+ if (0 != dk4bif_set_current_frame(pBif, currentFrame)) {
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ /*
+ Produce page in a document
+ */
+ if ((0.0 < graconf.xres) && (0.0 < graconf.yres)) {
+ dk4bif_set_res(pBif, graconf.xres, graconf.yres, NULL);
+ }
+ xl = graconf.media.i;
+ xr = graconf.media.w - graconf.media.o;
+ yb = graconf.media.b;
+ yt = graconf.media.h - graconf.media.t;
+ if ((size_t)0U != (currentFrame % (size_t)2U)) {
+ $? ". even page tumble/duplex"
+ if (0 != graconf.doc_tumble) {
+ yb = graconf.media.t;
+ yt = graconf.media.h - graconf.media.b;
+ }
+ else {
+ if (0 != graconf.doc_duplex) {
+ xl = graconf.media.o;
+ xr = graconf.media.w - graconf.media.i;
+ }
+ }
+ }
+ dk4gra_page(pGra, &graOkForFile, NULL);
+ dk4gra_bif_image(
+ pGra, xl, xr, yb, yt, pBif, curof->dkifn, currentFrame,
+ pagefl, NULL, &graOkForFile, NULL
+ );
+ }
+ else {
+ /*
+ Produce object or image
+ */
+ dk4gra_page(pGra, &graOkForFile, NULL);
+ dk4gra_bif_cotra_image(
+ pGra,cotra,pBif,curof->dkifn,0,pagefl,&graOkForFile,NULL
+ );
+ }
+ }
+ else {
+ /* ERROR: Failed to set frame */
+ pErrors->Append(curof->infilename);
+ pErrors->Append(sTexts[119]);
+ bSuccess = false;
+ }
+ currentFrame++;
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ if (dk4bif_get_number_of_frames(pBif) <= currentFrame) {
+ nst = STEP_WRITE_FILE;
+ dk4bif_close(pBif);
+ pBif = NULL;
+ lProcessingStep->SetLabel(sTexts[95]);
+ upd = true;
+ }
+ }
+ else {
+ nst = STEP_WRITE_FILE;
+ dk4bif_close(pBif);
+ pBif = NULL;
+ }
+ }
+ else {
+ nst = STEP_WRITE_FILE;
+ dk4bif_close(pBif);
+ pBif = NULL;
+ }
+ }
+ else {
+ /* ##### BUG */
+ cc = rqm = false;
+ }
+ $? "- ProcessingGenerateOutput"
+}
+
+
+
+void
+Bmpp4Progress::ProcessingWriteOutput(bool & upd)
+{
+ int ngv; /* New value for gauge */
+ $? "+ ProcessingWriteOutput"
+ if (NULL != pGra) { $? ". pGra"
+ if (0 != graOkForFile) { $? ". graOkForFile"
+ dk4gra_write_and_close(pGra, &graOkForFile, NULL);
+ if (0 == graOkForFile) { $? "! error wile writing"
+ /* ERROR: Failed to write */
+ pErrors->Append(curof->infilename);
+ pErrors->Append(sTexts[120]);
+ bSuccess = false;
+ }
+ }
+ else { $? "! graOkForFile"
+ dk4gra_close(pGra);
+ }
+ pGra = NULL;
+ usedFiles++;
+ if (0 < szFiles) {
+ ngv = ((size_t)1000 * usedFiles) / szFiles;
+ if (1000 < ngv) { ngv = 1000; }
+ if (ngv != gaugeValue) {
+ gaugeValue = ngv;
+ gProgress->SetValue(ngv);
+ lProcessingStep->SetLabel(sTexts[93]);
+ upd = true;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! pGra"
+ /* ##### BUG */
+#if 0
+ cc = rqm = false;
+#endif
+ }
+#endif
+ nst = STEP_START_NEW_FILE;
+ $? "- ProcessingWriteOutput"
+}
+
+
+
+void
+Bmpp4Progress::ProcessingStep(bool & cc, bool & rqm, bool & upd)
+{
+ $? "+ ProcessingStep"
+
+ switch (nst) {
+ case STEP_START_NEW_FILE : {
+ /*
+ Start processing for next input file candidate
+ */
+ ProcessingNewFile(cc, rqm, upd);
+ } break;
+ case STEP_GENERATE_OUTPUT : {
+ /*
+ Prepare output for next frame
+ */
+ ProcessingGenerateOutput(cc, rqm, upd);
+ } break;
+ case STEP_WRITE_FILE : {
+ /*
+ Write output to file
+ */
+ ProcessingWriteOutput(upd);
+ } break;
+ case STEP_REPORT_ERROR : {
+ /*
+ Report error and skip processing
+ */
+ cc = rqm = false;
+ } break;
+ }
+ $? "- ProcessingStep"
+}
+
+
+
+void
+Bmpp4Progress::OnIdle(wxIdleEvent & event)
+{
+ bool rqm = true; /* Request more idle events */
+ bool cc = true; /* Can continue */
+ bool upd = true; /* Must update window */
+ $? "+ OnIdle"
+ if (CanEnterCriticalSection()) {
+ ProcessingStep(cc, rqm, upd);
+ if (cc) {
+ LeaveCriticalSection();
+ if (upd) {
+ Refresh();
+ Update();
+ }
+ }
+ else {
+ if(IsModal()) {
+ EndModal((bSuccess) ? wxID_OK : wxID_CANCEL);
+ }
+ else {
+ SetReturnCode((bSuccess) ? wxID_OK : wxID_CANCEL);
+ Show(false);
+ }
+ }
+ if (rqm) {
+ event.RequestMore();
+ }
+ }
+ else {
+ }
+ $? "- OnIdle"
+ event.Skip();
+}
+
+
+
+void
+Bmpp4Progress::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool done = false;
+ $? "+ OnCancel"
+ /* First wait until other code sections accessing critical variables
+ are done, deny other code to enter critical sections
+ */
+ do {
+ wxCriticalSectionLocker lock(csProtect);
+ if (!(bInUse)) {
+ bInUse = true;
+ done = true;
+ bSuccess = false;
+ }
+ } while (!(done));
+
+ pErrors->Append(sTexts[121]);
+ /* Now close the dialog
+ */
+ if(IsModal()) {
+ EndModal((bSuccess) ? wxID_OK : wxID_CANCEL);
+ }
+ else {
+ SetReturnCode((bSuccess) ? wxID_OK : wxID_CANCEL);
+ Show(false);
+ }
+ $? "- OnCancel"
+}
+
+
+
+bool
+Bmpp4Progress::CanEnterCriticalSection(void)
+{
+ bool back = false;
+ {
+ wxCriticalSectionLocker lock(csProtect);
+ if (!(bInUse)) {
+ bInUse = true;
+ back = true;
+ }
+ }
+ return back;
+}
+
+
+
+void
+Bmpp4Progress::LeaveCriticalSection(void)
+{
+ wxCriticalSectionLocker lock(csProtect);
+ bInUse = false;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Dk4Comparable.cpp b/support/dktools/Dk4Comparable.cpp
index a712e3d8ee..0c600ae58f 100644
--- a/support/dktools/Dk4Comparable.cpp
+++ b/support/dktools/Dk4Comparable.cpp
@@ -1,58 +1,49 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4Comparable.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4Comparable.cpt
*/
/** @file Dk4Comparable.cpp The Dk4Comparable module.
*/
-#line 50 "Dk4Comparable.cpt"
+#line 85 "Dk4Comparable.cpt"
#include "Dk4Comparable.h"
int
DkTools4::Comparable::compareTwoPointers(void const *l, void const *r, int cr)
{
- int back = 0;
- if(l) {
- if(r) {
- DkTools4::Comparable const *pl = (DkTools4::Comparable const *)l;
- back = pl->compareAgainst(r, cr);
- } else back = 1;
- } else {
- if(r) back = -1;
- }
- return back;
+ int back = 0;
+ if(NULL != l) {
+ if(NULL != r) {
+ DkTools4::Comparable const *pl = (DkTools4::Comparable const *)l;
+ back = pl->compareAgainst(r, cr);
+ }
+ else {
+ back = 1;
+ }
+ } else {
+ if(r) back = -1;
+ }
+ return back;
+}
+
+
+
+DkTools4::Comparable::~Comparable()
+{
}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Dk4Comparable.cpt b/support/dktools/Dk4Comparable.cpt
index 17158666b7..68c6653816 100644
--- a/support/dktools/Dk4Comparable.cpt
+++ b/support/dktools/Dk4Comparable.cpt
@@ -1,47 +1,82 @@
%% options
-copyright owner = Dirk Krause
-copyright year = 2013-xxxx
-license = bsd
+copyright owner = Dirk Krause
+copyright year = 2013-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% header
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if DK4_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+
+/** Namespace to protect Container and Iterator from name collisions.
+*/
namespace DkTools4 {
- /** Comparable is a general base class for the library.
- */
- class Comparable
- {
- public:
- /** Compare object against another object or some data.
- This comparison is used by sorted containers.
- Example: When storing persons (name and age) we can use
- crit=0 as comparison criteria in the container to compare
- person object against person object. When searching the container
- for an object with a specific name we can use crit=1 for comparisons
- of the object against a string.
- @param ptr Address of other object or data.
- @param crit Comparison criteria, see documentation of
- derived classes for class-specific numbers.
- @return Positive number if larger than ptr, 0 if evaluates
- equal to ptr, negative number if smaller than ptr.
- */
- virtual
- int
- compareAgainst(void const *ptr, int crit) const = 0;
-
- /** Compare two pointers
- @param l Left pointer.
- @param r Right pointer.
- @param cr Comparison criteria.
- @return 1 for left object is large, 0 for right object
- is large, 0 for objects evaluating equally.
- */
- static
- int
- compareTwoPointers(void const *l, void const *r, int cr);
-
- }; /* End of class Comparable. */
+ /** Comparable is a general base class for objects we want to compare,
+ for example for sorted storage.
+
+ Derived classes must implement the compareAgainst() method.
+ */
+ class Comparable
+ {
+ public:
+
+ /** Compare object against another object or some data.
+ Derived classes must implement this method.
+ The comparison is used by sorted containers.
+ Example: When storing persons (name and age) we can use
+ crit=0 as comparison criteria in the container to compare
+ person object against person object.
+ When searching the container for an object with a specific name
+ we can use crit=1 for comparisons of the object against a
+ string.
+ @param pt Address of other object or data.
+ @param crit Comparison criteria, see documentation of
+ derived classes for class-specific numbers.
+ @return Positive number if larger than ptr, 0 if
+ evaluates equal to ptr, negative number if
+ smaller than ptr.
+ */
+
+ virtual
+ int
+ compareAgainst(void const *ptr, int crit) const = 0;
+
+
+ /** Compare two pointers
+ @param l Left pointer.
+ @param r Right pointer.
+ @param cr Comparison criteria.
+ @return 1 for left object is large, 0 for right object
+ is large, 0 for objects evaluating equally.
+ */
+
+ static
+ int
+ compareTwoPointers(void const *l, void const *r, int cr);
+
+
+ /** Virtual destructor required by compiler.
+ */
+
+ virtual
+ ~Comparable();
+
+ }; /* End of class Comparable. */
} /* End of namespace DkTools4 */
@@ -53,15 +88,28 @@ namespace DkTools4 {
int
DkTools4::Comparable::compareTwoPointers(void const *l, void const *r, int cr)
{
- int back = 0;
- if(l) {
- if(r) {
- DkTools4::Comparable const *pl = (DkTools4::Comparable const *)l;
- back = pl->compareAgainst(r, cr);
- } else back = 1;
- } else {
- if(r) back = -1;
- }
- return back;
+ int back = 0;
+ if(NULL != l) {
+ if(NULL != r) {
+ DkTools4::Comparable const *pl = (DkTools4::Comparable const *)l;
+ back = pl->compareAgainst(r, cr);
+ }
+ else {
+ back = 1;
+ }
+ } else {
+ if(r) back = -1;
+ }
+ return back;
+}
+
+
+
+DkTools4::Comparable::~Comparable()
+{
}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Dk4Comparable.h b/support/dktools/Dk4Comparable.h
index 36f5335181..4e7d7856f0 100644
--- a/support/dktools/Dk4Comparable.h
+++ b/support/dktools/Dk4Comparable.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4Comparable.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4Comparable.cpt
*/
/** @file Dk4Comparable.h Header file for the Dk4Comparable module.
@@ -43,42 +21,77 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 8 "Dk4Comparable.cpt"
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if DK4_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+
+/** Namespace to protect Container and Iterator from name collisions.
+*/
namespace DkTools4 {
- /** Comparable is a general base class for the library.
- */
- class Comparable
- {
- public:
- /** Compare object against another object or some data.
- This comparison is used by sorted containers.
- Example: When storing persons (name and age) we can use
- crit=0 as comparison criteria in the container to compare
- person object against person object. When searching the container
- for an object with a specific name we can use crit=1 for comparisons
- of the object against a string.
- @param ptr Address of other object or data.
- @param crit Comparison criteria, see documentation of
- derived classes for class-specific numbers.
- @return Positive number if larger than ptr, 0 if evaluates
- equal to ptr, negative number if smaller than ptr.
- */
- virtual
- int
- compareAgainst(void const *ptr, int crit) const = 0;
-
- /** Compare two pointers
- @param l Left pointer.
- @param r Right pointer.
- @param cr Comparison criteria.
- @return 1 for left object is large, 0 for right object
- is large, 0 for objects evaluating equally.
- */
- static
- int
- compareTwoPointers(void const *l, void const *r, int cr);
-
- }; /* End of class Comparable. */
+ /** Comparable is a general base class for objects we want to compare,
+ for example for sorted storage.
+
+ Derived classes must implement the compareAgainst() method.
+ */
+ class Comparable
+ {
+ public:
+
+ /** Compare object against another object or some data.
+ Derived classes must implement this method.
+ The comparison is used by sorted containers.
+ Example: When storing persons (name and age) we can use
+ crit=0 as comparison criteria in the container to compare
+ person object against person object.
+ When searching the container for an object with a specific name
+ we can use crit=1 for comparisons of the object against a
+ string.
+ @param pt Address of other object or data.
+ @param crit Comparison criteria, see documentation of
+ derived classes for class-specific numbers.
+ @return Positive number if larger than ptr, 0 if
+ evaluates equal to ptr, negative number if
+ smaller than ptr.
+ */
+
+ virtual
+ int
+ compareAgainst(void const *ptr, int crit) const = 0;
+
+
+ /** Compare two pointers
+ @param l Left pointer.
+ @param r Right pointer.
+ @param cr Comparison criteria.
+ @return 1 for left object is large, 0 for right object
+ is large, 0 for objects evaluating equally.
+ */
+
+ static
+ int
+ compareTwoPointers(void const *l, void const *r, int cr);
+
+
+ /** Virtual destructor required by compiler.
+ */
+
+ virtual
+ ~Comparable();
+
+ }; /* End of class Comparable. */
} /* End of namespace DkTools4 */
diff --git a/support/dktools/Dk4Container.cpt b/support/dktools/Dk4Container.cpt
index be082f5619..cd01807f8f 100644
--- a/support/dktools/Dk4Container.cpt
+++ b/support/dktools/Dk4Container.cpt
@@ -2,166 +2,243 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
-#include <dk4error.h>
-#include <dk4sto.h>
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
+#endif
#include <stdexcept>
#include <new>
+#ifndef DK4COMPARABLE_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4Comparable.h"
+#else
+#include <dktools-4/Dk4Comparable.h>
+#endif
+#endif
+/** Namespace to protect Container and Iterator from name collisions.
+*/
namespace DkTools4 {
- template<class T> class Container;
- template<class T> class Iterator;
-
- /** A container class for sorted storage.
- The objects must be derived from the Comparable class.
- */
- template<class T>
- class Container
- {
- friend class Iterator<T>;
-
- private:
-
- /** Storage to store elements.
- */
- dk4_sto_t *sto;
-
- /** Iterator, used in destructor.
- */
- dk4_sto_it_t *it;
-
- /** Comparison criteria for ordering elements.
- */
- int cr;
-
- /** Flag: Container is owner of the objects and in charge
- for destruction.
- */
- bool bOwner;
-
- public:
- /** Create container.
- @param crit Sort criteria for objects in container.
- @param owner Owner flag value. If a container is the
- owner of the objects stored in it, the objects are deleted
- in the containers destructor.
- */
- Container<T>(int crit, bool owner = false) throw (std::bad_alloc);
-
- /** Destructor.
- */
- ~Container<T>();
-
- /** Add an object to the container.
- @param ptr Pointer to add.
- @return True on success, false on error (object not added).
- */
- bool
- add(T *ptr);
-
- /** Remove object from container.
- @param ptr Pointer to remove.
- @return True on success, false on error.
- */
- bool
- remove(T *ptr);
-
- /** Check owner flag.
- @return Owner flag value.
- */
- void
- isOwner(void) const;
-
- /** Reset iterator.
- */
- void
- reset(void);
-
- /** Set iterator to exact position.
- @param data
- @param crit
- @return Pointer to found object on success, NULL otherwise.
- */
- T *
- findExact(void const *data, int crit);
-
- /** Set iterator to object evaluating equally.
- @param data
- @param crit
- @return Pointer to found object on success, NULL otherwise.
- */
- T *
- findLike(void const *data, int crit);
-
- /** Step to next element.
- @return Pointe to next object (if there is one), NULL
- if there is no next object.
- */
- T *
- next(void);
-
-
-
- }; /* End of class Container */
-
- /** An iterator class to traverse a Containter.
- */
- template<class T>
- class Iterator
- {
- private:
- /** Low-level iterator.
- */
- dk4_sto_it_t *it;
-
- public:
- /** Constructor.
- @param cont Container for which the iterator is for.
- */
- Iterator<T>(Container<T>& cont) throw (std::bad_alloc);
-
- /** Destructor.
- */
- ~Iterator<T>();
-
- /** Reset iterator.
- */
- void
- reset(void);
-
- /** Set iterator to exact position.
- @param data
- @param crit
- @return Pointer to found object on success, NULL otherwise.
- */
- T *
- findExact(void const *data, int crit);
-
- /** Set iterator to object evaluating equally.
- @param data
- @param crit
- @return Pointer to found object on success, NULL otherwise.
- */
- T *
- findLike(void const *data, int crit);
-
- /** Step to next element.
- @return Pointe to next object (if there is one), NULL
- if there is no next object.
- */
- T *
- next(void);
-
- }; /* End of class Iterator */
+ /** Container class for sorted storage.
+ */
+ template<class T> class Container;
+
+ /** Iterator class to traverse a Container.
+ */
+ template<class T> class Iterator;
+
+ /** A container class for sorted storage.
+ The objects saved in the storage must be derived from the Comparable
+ class.
+ */
+ template<class T>
+ class Container
+ {
+ /** Iterator is allowed to access Containers internals.
+ */
+ friend class Iterator<T>;
+
+ private:
+
+ /** Storage to store elements.
+ */
+ dk4_sto_t *sto;
+
+ /** Iterator, used in destructor.
+ */
+ dk4_sto_it_t *it;
+
+ /** Comparison criteria for ordering elements.
+ */
+ int cr;
+
+ /** Flag: Container is owner of the objects and in charge
+ for destruction.
+ */
+ bool bOwner;
+
+ public:
+
+ /** Constructor.
+ @param crit Sort criteria for objects in container.
+ @param owner Owner flag value. If a container is the owner
+ of the objects stored in it, the objects are
+ deleted in the containers destructor.
+ Exceptions:
+ - std::bad_alloc<br>
+ if there is not enough memory available.
+ */
+
+ Container<T>(int crit, bool owner = false)
+ /* throws(std::bad_alloc) */
+ ;
+
+
+ /** Destructor.
+ */
+
+ ~Container<T>();
+
+
+ /** Add an object to the container.
+ @param ptr Pointer to add.
+ @return True on success, false on error (object not added).
+ */
+
+ bool
+ add(T *ptr);
+
+
+ /** Remove object from container.
+ @param ptr Pointer to remove.
+ @return True on success, false on error (element not found).
+ */
+
+ bool
+ remove(T *ptr);
+
+
+ /** Check owner flag.
+ @return Owner flag value.
+ */
+
+ bool
+ isOwner(void) const;
+
+
+ /** Reset iterator.
+ */
+
+ void
+ reset(void);
+
+
+ /** Set iterator to exact position.
+ @param data Object to search for.
+ @param crit Comparison criteria.
+ @return Pointer to found object on success, NULL otherwise.
+ */
+
+ T *
+ findExact(void const *data, int crit);
+
+
+ /** Set iterator to object evaluating equally.
+ @param data Object to search for.
+ @param crit Comparison criteria.
+ @return Pointer to found object on success, NULL otherwise.
+ */
+
+ T *
+ findLike(void const *data, int crit);
+
+
+ /** Step to next element.
+ @return Pointer to next object (if there is one), NULL
+ if there is no next object.
+ */
+ T *
+ next(void);
+
+ }; /* End of class Container */
+
+
+
+ /** Iterator class to traverse a Container.
+ */
+ template<class T>
+ class Iterator
+ {
+ private:
+ /** Low-level iterator.
+ */
+ dk4_sto_it_t *it;
+
+ public:
+
+ /** Constructor.
+ @param cont Container for which the iterator is for.
+
+ Exceptions:
+ - std::bad_alloc<br>
+ if there is not enough memory available.
+ */
+
+ Iterator<T>(Container<T> & cont)
+ /* throws(std::bad_alloc) */
+ ;
+
+
+ /** Destructor.
+ */
+
+ ~Iterator<T>();
+
+
+ /** Reset iterator.
+ */
+
+ void
+ reset(void);
+
+
+ /** Set iterator to exact position.
+ @param data Object to search for.
+ @param crit Comparison criteria.
+ @return Pointer to found object on success, NULL otherwise.
+ */
+
+ T *
+ findExact(void const *data, int crit);
+
+
+ /** Set iterator to object evaluating equally.
+ @param data Object to search for.
+ @param crit Comparison criteria.
+ @return Pointer to found object on success, NULL otherwise.
+ */
+
+ T *
+ findLike(void const *data, int crit);
+
+
+ /** Step to next element.
+ @return Pointe to next object (if there is one), NULL
+ if there is no next object.
+ */
+
+ T *
+ next(void);
+
+ }; /* End of class Iterator */
} /* End of namespace DkTools4 */
@@ -172,27 +249,34 @@ $*
$*
template<class T>
-DkTools4::Container<T>::Container(int crit, bool owner) throw (std::bad_alloc)
+DkTools4::Container<T>::Container(int crit, bool owner)
{
- bool mustThrow = true;
-
- bOwner = owner;
- cr = crit;
- it = NULL;
- sto = dk4sto_open(NULL);
- if(NULL != sto) {
- dk4sto_set_comp(sto,DkTools4::Comparable::compareTwoPointers,crit);
- it = dk4sto_it_open(sto, NULL);
- if (NULL != it) {
- mustThrow = false;
- } else {
- dk4sto_close(sto);
- sto = NULL;
- }
- }
- if (mustThrow) {
- throw(std::bad_alloc());
- }
+ bool mustThrow = true; /* Flag: Must throw exception. */
+
+ /* Initialize members.
+ */
+ bOwner = owner;
+ cr = crit;
+ sto = NULL;
+ it = NULL;
+
+ /* Allocate memory.
+ */
+ sto = dk4sto_open(NULL);
+ if(NULL != sto) {
+ dk4sto_set_comp(sto, DkTools4::Comparable::compareTwoPointers, crit);
+ it = dk4sto_it_open(sto, NULL);
+ if (NULL != it) {
+ mustThrow = false; /* All memory allocations succeeded. */
+ }
+ else {
+ dk4sto_close(sto);
+ sto = NULL;
+ }
+ }
+ if (mustThrow) {
+ throw(std::bad_alloc());
+ }
}
@@ -205,24 +289,30 @@ DkTools4::Container<T>::Container(int crit, bool owner) throw (std::bad_alloc)
template<class T>
DkTools4::Container<T>::~Container<T>()
{
- T *ptr;
-
- if (NULL != it) {
- if (bOwner) {
- dk4sto_it_reset(it);
- while(NULL != (ptr = (T *)dk4sto_it_next(it))) {
- delete ptr;
- }
- }
- dk4sto_it_close(it);
- }
- if (NULL != sto) {
- dk4sto_close(sto);
- }
- sto = NULL;
- it = NULL;
- cr = 0;
- bOwner = false;
+ T *ptr;
+
+ /* Close storage and iterator.
+ If we are the owner of the objects stored, delete the objects too.
+ */
+ if (NULL != it) {
+ if (bOwner) {
+ dk4sto_it_reset(it);
+ while(NULL != (ptr = (T *)dk4sto_it_next(it))) {
+ delete ptr;
+ }
+ }
+ dk4sto_it_close(it);
+ }
+ if (NULL != sto) {
+ dk4sto_close(sto);
+ }
+
+ /* Mark all components as not allocated.
+ */
+ sto = NULL;
+ it = NULL;
+ cr = 0;
+ bOwner = false;
}
@@ -237,11 +327,12 @@ template<class T>
bool
DkTools4::Container<T>::add(T *ptr)
{
- bool back = false;
- if(0 != dk4sto_add(sto, (void *)ptr, NULL)) {
- back = true;
- }
- return back;
+ bool back = false;
+
+ if(0 != dk4sto_add(sto, (void *)ptr, NULL)) {
+ back = true;
+ }
+ return back;
}
@@ -250,20 +341,21 @@ template<class T>
bool
DkTools4::Container<T>::remove(T *ptr)
{
- bool back = false;
- if(0 != dk4sto_remove(sto, (void *)ptr, NULL)) {
- back = true;
- }
- return back;
+ bool back = false;
+
+ if(0 != dk4sto_remove(sto, (void *)ptr, NULL)) {
+ back = true;
+ }
+ return back;
}
template<class T>
-void
+bool
DkTools4::Container<T>::isOwner(void) const
{
- return bOwner;
+ return bOwner;
}
@@ -276,7 +368,7 @@ template<class T>
void
DkTools4::Container<T>::reset(void)
{
- dk4sto_it_reset(it);
+ dk4sto_it_reset(it);
}
@@ -285,9 +377,10 @@ template<class T>
T *
DkTools4::Container<T>::findExact(void const *data, int crit)
{
- T *back = NULL;
- back = (T *)dk4sto_it_find_exact(it, data);
- return back;
+ T *back = NULL;
+
+ back = (T *)dk4sto_it_find_exact(it, data);
+ return back;
}
@@ -296,9 +389,10 @@ template<class T>
T *
DkTools4::Container<T>::findLike(void const *data, int crit)
{
- T *back;
- back = (T *)dk4sto_it_find_like(it, data, crit);
- return back;
+ T *back;
+
+ back = (T *)dk4sto_it_find_like(it, data, crit);
+ return back;
}
@@ -307,9 +401,10 @@ template<class T>
T *
DkTools4::Container<T>::next(void)
{
- T *back = NULL;
- back = (T *)dk4sto_it_next(it);
- return back;
+ T *back = NULL;
+
+ back = (T *)dk4sto_it_next(it);
+ return back;
}
@@ -319,14 +414,15 @@ $*
$*
template<class T>
-DkTools4::Iterator<T>::Iterator(Container<T>& cont) throw (std::bad_alloc)
+DkTools4::Iterator<T>::Iterator(Container<T> & cont)
{
- it = dk4sto_it_open(cont.sto, NULL);
- if(NULL != it) {
- dk4sto_it_reset(it);
- } else {
- throw(std::bad_alloc());
- }
+ it = dk4sto_it_open(cont.sto, NULL);
+ if(NULL != it) {
+ dk4sto_it_reset(it);
+ }
+ else {
+ throw(std::bad_alloc());
+ }
}
@@ -338,9 +434,9 @@ DkTools4::Iterator<T>::Iterator(Container<T>& cont) throw (std::bad_alloc)
template<class T>
DkTools4::Iterator<T>::~Iterator<T>()
{
- if (NULL != it) {
- dk4sto_it_close(it); it = NULL;
- }
+ if (NULL != it) {
+ dk4sto_it_close(it); it = NULL;
+ }
}
@@ -353,7 +449,7 @@ template<class T>
void
DkTools4::Iterator<T>::reset(void)
{
- dk4sto_it_reset(it);
+ dk4sto_it_reset(it);
}
@@ -362,9 +458,9 @@ template<class T>
T *
DkTools4::Iterator<T>::findExact(void const *data, int crit)
{
- T *back = NULL;
- back = (T *)dk4sto_it_find_exact(it, data);
- return back;
+ T *back = NULL;
+ back = (T *)dk4sto_it_find_exact(it, data);
+ return back;
}
@@ -373,9 +469,9 @@ template<class T>
T *
DkTools4::Iterator<T>::findLike(void const *data, int crit)
{
- T *back;
- back = (T *)dk4sto_it_find_like(it, data, crit);
- return back;
+ T *back;
+ back = (T *)dk4sto_it_find_like(it, data, crit);
+ return back;
}
@@ -384,8 +480,12 @@ template<class T>
T *
DkTools4::Iterator<T>::next(void)
{
- T *back = NULL;
- back = (T *)dk4sto_it_next(it);
- return back;
+ T *back = NULL;
+ back = (T *)dk4sto_it_next(it);
+ return back;
}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Dk4Container.h b/support/dktools/Dk4Container.h
index 4a616209a8..2f0b8b9055 100644
--- a/support/dktools/Dk4Container.h
+++ b/support/dktools/Dk4Container.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4Container.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4Container.cpt
*/
/** @file Dk4Container.h Header file for the Dk4Container module.
@@ -43,163 +21,240 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 8 "Dk4Container.cpt"
-#include <dk4error.h>
-#include <dk4sto.h>
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
+#endif
#include <stdexcept>
#include <new>
+#ifndef DK4COMPARABLE_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4Comparable.h"
+#else
+#include <dktools-4/Dk4Comparable.h>
+#endif
+#endif
+/** Namespace to protect Container and Iterator from name collisions.
+*/
namespace DkTools4 {
- template<class T> class Container;
- template<class T> class Iterator;
-
- /** A container class for sorted storage.
- The objects must be derived from the Comparable class.
- */
- template<class T>
- class Container
- {
- friend class Iterator<T>;
-
- private:
-
- /** Storage to store elements.
- */
- dk4_sto_t *sto;
-
- /** Iterator, used in destructor.
- */
- dk4_sto_it_t *it;
-
- /** Comparison criteria for ordering elements.
- */
- int cr;
-
- /** Flag: Container is owner of the objects and in charge
- for destruction.
- */
- bool bOwner;
-
- public:
- /** Create container.
- @param crit Sort criteria for objects in container.
- @param owner Owner flag value. If a container is the
- owner of the objects stored in it, the objects are deleted
- in the containers destructor.
- */
- Container<T>(int crit, bool owner = false) throw (std::bad_alloc);
-
- /** Destructor.
- */
- ~Container<T>();
-
- /** Add an object to the container.
- @param ptr Pointer to add.
- @return True on success, false on error (object not added).
- */
- bool
- add(T *ptr);
-
- /** Remove object from container.
- @param ptr Pointer to remove.
- @return True on success, false on error.
- */
- bool
- remove(T *ptr);
-
- /** Check owner flag.
- @return Owner flag value.
- */
- void
- isOwner(void) const;
-
- /** Reset iterator.
- */
- void
- reset(void);
-
- /** Set iterator to exact position.
- @param data
- @param crit
- @return Pointer to found object on success, NULL otherwise.
- */
- T *
- findExact(void const *data, int crit);
-
- /** Set iterator to object evaluating equally.
- @param data
- @param crit
- @return Pointer to found object on success, NULL otherwise.
- */
- T *
- findLike(void const *data, int crit);
-
- /** Step to next element.
- @return Pointe to next object (if there is one), NULL
- if there is no next object.
- */
- T *
- next(void);
-
-
-
- }; /* End of class Container */
-
- /** An iterator class to traverse a Containter.
- */
- template<class T>
- class Iterator
- {
- private:
- /** Low-level iterator.
- */
- dk4_sto_it_t *it;
-
- public:
- /** Constructor.
- @param cont Container for which the iterator is for.
- */
- Iterator<T>(Container<T>& cont) throw (std::bad_alloc);
-
- /** Destructor.
- */
- ~Iterator<T>();
-
- /** Reset iterator.
- */
- void
- reset(void);
-
- /** Set iterator to exact position.
- @param data
- @param crit
- @return Pointer to found object on success, NULL otherwise.
- */
- T *
- findExact(void const *data, int crit);
-
- /** Set iterator to object evaluating equally.
- @param data
- @param crit
- @return Pointer to found object on success, NULL otherwise.
- */
- T *
- findLike(void const *data, int crit);
-
- /** Step to next element.
- @return Pointe to next object (if there is one), NULL
- if there is no next object.
- */
- T *
- next(void);
-
- }; /* End of class Iterator */
+ /** Container class for sorted storage.
+ */
+ template<class T> class Container;
+
+ /** Iterator class to traverse a Container.
+ */
+ template<class T> class Iterator;
+
+ /** A container class for sorted storage.
+ The objects saved in the storage must be derived from the Comparable
+ class.
+ */
+ template<class T>
+ class Container
+ {
+ /** Iterator is allowed to access Containers internals.
+ */
+ friend class Iterator<T>;
+
+ private:
+
+ /** Storage to store elements.
+ */
+ dk4_sto_t *sto;
+
+ /** Iterator, used in destructor.
+ */
+ dk4_sto_it_t *it;
+
+ /** Comparison criteria for ordering elements.
+ */
+ int cr;
+
+ /** Flag: Container is owner of the objects and in charge
+ for destruction.
+ */
+ bool bOwner;
+
+ public:
+
+ /** Constructor.
+ @param crit Sort criteria for objects in container.
+ @param owner Owner flag value. If a container is the owner
+ of the objects stored in it, the objects are
+ deleted in the containers destructor.
+ Exceptions:
+ - std::bad_alloc<br>
+ if there is not enough memory available.
+ */
+
+ Container<T>(int crit, bool owner = false)
+ /* throws(std::bad_alloc) */
+ ;
+
+
+ /** Destructor.
+ */
+
+ ~Container<T>();
+
+
+ /** Add an object to the container.
+ @param ptr Pointer to add.
+ @return True on success, false on error (object not added).
+ */
+
+ bool
+ add(T *ptr);
+
+
+ /** Remove object from container.
+ @param ptr Pointer to remove.
+ @return True on success, false on error (element not found).
+ */
+
+ bool
+ remove(T *ptr);
+
+
+ /** Check owner flag.
+ @return Owner flag value.
+ */
+
+ bool
+ isOwner(void) const;
+
+
+ /** Reset iterator.
+ */
+
+ void
+ reset(void);
+ /** Set iterator to exact position.
+ @param data Object to search for.
+ @param crit Comparison criteria.
+ @return Pointer to found object on success, NULL otherwise.
+ */
+
+ T *
+ findExact(void const *data, int crit);
+
+
+ /** Set iterator to object evaluating equally.
+ @param data Object to search for.
+ @param crit Comparison criteria.
+ @return Pointer to found object on success, NULL otherwise.
+ */
+
+ T *
+ findLike(void const *data, int crit);
+
+
+ /** Step to next element.
+ @return Pointer to next object (if there is one), NULL
+ if there is no next object.
+ */
+
+ T *
+ next(void);
+
+ }; /* End of class Container */
+
+
+
+ /** Iterator class to traverse a Container.
+ */
+ template<class T>
+ class Iterator
+ {
+ private:
+ /** Low-level iterator.
+ */
+ dk4_sto_it_t *it;
+
+ public:
+
+ /** Constructor.
+ @param cont Container for which the iterator is for.
+
+ Exceptions:
+ - std::bad_alloc<br>
+ if there is not enough memory available.
+ */
+
+ Iterator<T>(Container<T> & cont)
+ /* throws(std::bad_alloc) */
+ ;
+
+
+ /** Destructor.
+ */
+
+ ~Iterator<T>();
+
+
+ /** Reset iterator.
+ */
+
+ void
+ reset(void);
+
+
+ /** Set iterator to exact position.
+ @param data Object to search for.
+ @param crit Comparison criteria.
+ @return Pointer to found object on success, NULL otherwise.
+ */
+
+ T *
+ findExact(void const *data, int crit);
+
+
+ /** Set iterator to object evaluating equally.
+ @param data Object to search for.
+ @param crit Comparison criteria.
+ @return Pointer to found object on success, NULL otherwise.
+ */
+
+ T *
+ findLike(void const *data, int crit);
+
+
+ /** Step to next element.
+ @return Pointe to next object (if there is one), NULL
+ if there is no next object.
+ */
+
+ T *
+ next(void);
+
+ }; /* End of class Iterator */
+
} /* End of namespace DkTools4 */
@@ -211,30 +266,37 @@ namespace DkTools4 {
/* ************************************************************************ */
-#line 173 "Dk4Container.cpt"
+#line 250 "Dk4Container.cpt"
template<class T>
-DkTools4::Container<T>::Container(int crit, bool owner) throw (std::bad_alloc)
+DkTools4::Container<T>::Container(int crit, bool owner)
{
- bool mustThrow = true;
-
- bOwner = owner;
- cr = crit;
- it = NULL;
- sto = dk4sto_open(NULL);
- if(NULL != sto) {
- dk4sto_set_comp(sto,DkTools4::Comparable::compareTwoPointers,crit);
- it = dk4sto_it_open(sto, NULL);
- if (NULL != it) {
- mustThrow = false;
- } else {
- dk4sto_close(sto);
- sto = NULL;
- }
- }
- if (mustThrow) {
- throw(std::bad_alloc());
- }
+ bool mustThrow = true; /* Flag: Must throw exception. */
+
+ /* Initialize members.
+ */
+ bOwner = owner;
+ cr = crit;
+ sto = NULL;
+ it = NULL;
+
+ /* Allocate memory.
+ */
+ sto = dk4sto_open(NULL);
+ if(NULL != sto) {
+ dk4sto_set_comp(sto, DkTools4::Comparable::compareTwoPointers, crit);
+ it = dk4sto_it_open(sto, NULL);
+ if (NULL != it) {
+ mustThrow = false; /* All memory allocations succeeded. */
+ }
+ else {
+ dk4sto_close(sto);
+ sto = NULL;
+ }
+ }
+ if (mustThrow) {
+ throw(std::bad_alloc());
+ }
}
@@ -247,24 +309,30 @@ DkTools4::Container<T>::Container(int crit, bool owner) throw (std::bad_alloc)
template<class T>
DkTools4::Container<T>::~Container<T>()
{
- T *ptr;
-
- if (NULL != it) {
- if (bOwner) {
- dk4sto_it_reset(it);
- while(NULL != (ptr = (T *)dk4sto_it_next(it))) {
- delete ptr;
- }
- }
- dk4sto_it_close(it);
- }
- if (NULL != sto) {
- dk4sto_close(sto);
- }
- sto = NULL;
- it = NULL;
- cr = 0;
- bOwner = false;
+ T *ptr;
+
+ /* Close storage and iterator.
+ If we are the owner of the objects stored, delete the objects too.
+ */
+ if (NULL != it) {
+ if (bOwner) {
+ dk4sto_it_reset(it);
+ while(NULL != (ptr = (T *)dk4sto_it_next(it))) {
+ delete ptr;
+ }
+ }
+ dk4sto_it_close(it);
+ }
+ if (NULL != sto) {
+ dk4sto_close(sto);
+ }
+
+ /* Mark all components as not allocated.
+ */
+ sto = NULL;
+ it = NULL;
+ cr = 0;
+ bOwner = false;
}
@@ -279,11 +347,12 @@ template<class T>
bool
DkTools4::Container<T>::add(T *ptr)
{
- bool back = false;
- if(0 != dk4sto_add(sto, (void *)ptr, NULL)) {
- back = true;
- }
- return back;
+ bool back = false;
+
+ if(0 != dk4sto_add(sto, (void *)ptr, NULL)) {
+ back = true;
+ }
+ return back;
}
@@ -292,20 +361,21 @@ template<class T>
bool
DkTools4::Container<T>::remove(T *ptr)
{
- bool back = false;
- if(0 != dk4sto_remove(sto, (void *)ptr, NULL)) {
- back = true;
- }
- return back;
+ bool back = false;
+
+ if(0 != dk4sto_remove(sto, (void *)ptr, NULL)) {
+ back = true;
+ }
+ return back;
}
template<class T>
-void
+bool
DkTools4::Container<T>::isOwner(void) const
{
- return bOwner;
+ return bOwner;
}
@@ -318,7 +388,7 @@ template<class T>
void
DkTools4::Container<T>::reset(void)
{
- dk4sto_it_reset(it);
+ dk4sto_it_reset(it);
}
@@ -327,9 +397,10 @@ template<class T>
T *
DkTools4::Container<T>::findExact(void const *data, int crit)
{
- T *back = NULL;
- back = (T *)dk4sto_it_find_exact(it, data);
- return back;
+ T *back = NULL;
+
+ back = (T *)dk4sto_it_find_exact(it, data);
+ return back;
}
@@ -338,9 +409,10 @@ template<class T>
T *
DkTools4::Container<T>::findLike(void const *data, int crit)
{
- T *back;
- back = (T *)dk4sto_it_find_like(it, data, crit);
- return back;
+ T *back;
+
+ back = (T *)dk4sto_it_find_like(it, data, crit);
+ return back;
}
@@ -349,9 +421,10 @@ template<class T>
T *
DkTools4::Container<T>::next(void)
{
- T *back = NULL;
- back = (T *)dk4sto_it_next(it);
- return back;
+ T *back = NULL;
+
+ back = (T *)dk4sto_it_next(it);
+ return back;
}
@@ -363,17 +436,18 @@ DkTools4::Container<T>::next(void)
/* ************************************************************************ */
-#line 320 "Dk4Container.cpt"
+#line 415 "Dk4Container.cpt"
template<class T>
-DkTools4::Iterator<T>::Iterator(Container<T>& cont) throw (std::bad_alloc)
+DkTools4::Iterator<T>::Iterator(Container<T> & cont)
{
- it = dk4sto_it_open(cont.sto, NULL);
- if(NULL != it) {
- dk4sto_it_reset(it);
- } else {
- throw(std::bad_alloc());
- }
+ it = dk4sto_it_open(cont.sto, NULL);
+ if(NULL != it) {
+ dk4sto_it_reset(it);
+ }
+ else {
+ throw(std::bad_alloc());
+ }
}
@@ -385,9 +459,9 @@ DkTools4::Iterator<T>::Iterator(Container<T>& cont) throw (std::bad_alloc)
template<class T>
DkTools4::Iterator<T>::~Iterator<T>()
{
- if (NULL != it) {
- dk4sto_it_close(it); it = NULL;
- }
+ if (NULL != it) {
+ dk4sto_it_close(it); it = NULL;
+ }
}
@@ -400,7 +474,7 @@ template<class T>
void
DkTools4::Iterator<T>::reset(void)
{
- dk4sto_it_reset(it);
+ dk4sto_it_reset(it);
}
@@ -409,9 +483,9 @@ template<class T>
T *
DkTools4::Iterator<T>::findExact(void const *data, int crit)
{
- T *back = NULL;
- back = (T *)dk4sto_it_find_exact(it, data);
- return back;
+ T *back = NULL;
+ back = (T *)dk4sto_it_find_exact(it, data);
+ return back;
}
@@ -420,9 +494,9 @@ template<class T>
T *
DkTools4::Iterator<T>::findLike(void const *data, int crit)
{
- T *back;
- back = (T *)dk4sto_it_find_like(it, data, crit);
- return back;
+ T *back;
+ back = (T *)dk4sto_it_find_like(it, data, crit);
+ return back;
}
@@ -431,10 +505,14 @@ template<class T>
T *
DkTools4::Iterator<T>::next(void)
{
- T *back = NULL;
- back = (T *)dk4sto_it_next(it);
- return back;
+ T *back = NULL;
+ back = (T *)dk4sto_it_next(it);
+ return back;
}
+
+/* vim: set ai sw=4 ts=4 : */
+
+
#endif
diff --git a/support/dktools/Dk4FcsApp.cpp b/support/dktools/Dk4FcsApp.cpp
index b92af6f0a3..5d34bb31ca 100644
--- a/support/dktools/Dk4FcsApp.cpp
+++ b/support/dktools/Dk4FcsApp.cpp
@@ -1,51 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4FcsApp.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4FcsApp.cpt
*/
/** @file Dk4FcsApp.cpp The Dk4FcsApp module.
*/
-#line 63 "Dk4FcsApp.cpt"
+#line 68 "Dk4FcsApp.cpt"
+#include "dk4conf.h"
#include "wxdkfcs.h"
-#line 69 "Dk4FcsApp.cpt"
+#line 75 "Dk4FcsApp.cpt"
@@ -130,7 +109,7 @@ wxT("Open a file"),
NULL
-#line 156 "Dk4FcsApp.cpt"
+#line 162 "Dk4FcsApp.cpt"
};
@@ -169,7 +148,7 @@ wxT("\n"),
wxT("DK tools, wxWidgets, OpenSSL, libpng, libjpeg, libtiff, zlib."),
/* 10 */
-wxT("http://dktools.sourceforge.net"),
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
/* 11 */
wxT("http://www.wxwidgets.org"),
@@ -216,7 +195,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 229 "Dk4FcsApp.cpt"
+#line 235 "Dk4FcsApp.cpt"
};
@@ -239,14 +218,19 @@ dkT("wxdkfcs.htb"),
NULL
-#line 254 "Dk4FcsApp.cpt"
+#line 260 "Dk4FcsApp.cpt"
};
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(Dk4FcsApp);
+#else
IMPLEMENT_APP(Dk4FcsApp)
+#endif
bool
@@ -262,7 +246,7 @@ Dk4FcsApp::OnInit()
-#line 275 "Dk4FcsApp.cpt"
+#line 286 "Dk4FcsApp.cpt"
/* Initialize members. */
pAh = NULL;
pHc = NULL;
@@ -282,7 +266,7 @@ Dk4FcsApp::OnInit()
}
-#line 293 "Dk4FcsApp.cpt"
+#line 304 "Dk4FcsApp.cpt"
/* Add image and file system handlers for online help. */
phPng = new wxPNGHandler();
@@ -292,6 +276,14 @@ Dk4FcsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -299,6 +291,14 @@ Dk4FcsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -306,9 +306,17 @@ Dk4FcsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
-#line 317 "Dk4FcsApp.cpt"
+#line 352 "Dk4FcsApp.cpt"
phArchiveFs = new wxArchiveFSHandler();
if (NULL != phArchiveFs) {
wxFileSystem::AddHandler(phArchiveFs);
@@ -317,6 +325,13 @@ Dk4FcsApp::OnInit()
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
pHc = new Dk4WxHelpController();
if (NULL == pHc) {
ShowMemoryErrorMessage();
@@ -328,14 +343,14 @@ Dk4FcsApp::OnInit()
}
-#line 335 "Dk4FcsApp.cpt"
+#line 377 "Dk4FcsApp.cpt"
localizedTexts = pAh->GetStringTable(wxdkfcs_nl_dk[1], wxdkfcs_texts);
if(!(localizedTexts)) { localizedTexts = wxdkfcs_texts; }
-#line 340 "Dk4FcsApp.cpt"
+#line 382 "Dk4FcsApp.cpt"
/* Create and show frame. */
frame = new Dk4FcsFrame(
Dk4FcsFrame_MainWindow,
@@ -354,19 +369,19 @@ Dk4FcsApp::OnInit()
-#line 357 "Dk4FcsApp.cpt"
- frame->Show();
+#line 399 "Dk4FcsApp.cpt"
frame->RestorePosition();
+ frame->Show();
-#line 360 "Dk4FcsApp.cpt"
+#line 402 "Dk4FcsApp.cpt"
back = true;
/* Release resources if initialization failed. */
finished:
if(!(back)) {
-#line 365 "Dk4FcsApp.cpt"
+#line 407 "Dk4FcsApp.cpt"
if (NULL != pHc) {
pHc->Cleanup(); delete(pHc); pHc = NULL;
}
@@ -376,7 +391,7 @@ Dk4FcsApp::OnInit()
}
-#line 373 "Dk4FcsApp.cpt"
+#line 415 "Dk4FcsApp.cpt"
return back;
}
diff --git a/support/dktools/Dk4FcsApp.cpt b/support/dktools/Dk4FcsApp.cpt
index a1fc98f48e..03fc73b380 100644
--- a/support/dktools/Dk4FcsApp.cpt
+++ b/support/dktools/Dk4FcsApp.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -55,12 +55,18 @@ class Dk4FcsApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(Dk4FcsApp);
+#else
DECLARE_APP(Dk4FcsApp)
+#endif
%% module
+#include "dk4conf.h"
#include "wxdkfcs.h"
@@ -201,7 +207,7 @@ aaaaa
# 9 10 11 12 13 14 15 16: List of libraries used.
#
DK tools, wxWidgets, OpenSSL, libpng, libjpeg, libtiff, zlib.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
http://www.wxwidgets.org
http://www.openssl.org
http://www.libpng.org/pub/png/libpng.html
@@ -257,7 +263,12 @@ $!end
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(Dk4FcsApp);
+#else
IMPLEMENT_APP(Dk4FcsApp)
+#endif
bool
@@ -299,6 +310,14 @@ Dk4FcsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -306,6 +325,14 @@ Dk4FcsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -313,6 +340,14 @@ Dk4FcsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
$? ". image handlers ok"
phArchiveFs = new wxArchiveFSHandler();
if (NULL != phArchiveFs) {
@@ -322,6 +357,13 @@ Dk4FcsApp::OnInit()
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
pHc = new Dk4WxHelpController();
if (NULL == pHc) {
ShowMemoryErrorMessage();
@@ -354,8 +396,8 @@ Dk4FcsApp::OnInit()
}
$? ". frame created"
- frame->Show();
frame->RestorePosition();
+ frame->Show();
$? ". frame shown"
back = true;
diff --git a/support/dktools/Dk4FcsApp.h b/support/dktools/Dk4FcsApp.h
index f3b83d9f7f..3a2bb11329 100644
--- a/support/dktools/Dk4FcsApp.h
+++ b/support/dktools/Dk4FcsApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4FcsApp.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4FcsApp.cpt
*/
#ifndef DK4FCSAPP_H_INCLUDED
@@ -87,7 +65,12 @@ class Dk4FcsApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(Dk4FcsApp);
+#else
DECLARE_APP(Dk4FcsApp)
+#endif
diff --git a/support/dktools/Dk4FcsFrame.cpp b/support/dktools/Dk4FcsFrame.cpp
index 9ece3feffb..5e2512ecd1 100644
--- a/support/dktools/Dk4FcsFrame.cpp
+++ b/support/dktools/Dk4FcsFrame.cpp
@@ -1,43 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4FcsFrame.wxc
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4FcsFrame.wxc
*/
/** @file Dk4FcsFrame.cpp The Dk4FcsFrame module.
*/
-#line 246 "Dk4FcsFrame.wxc"
+#line 250 "Dk4FcsFrame.wxc"
+
+#include "dk4conf.h"
#include "wxdkfcs.h"
@@ -66,24 +46,32 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#if !defined(__WXMSW__)
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
#endif
-#line 280 "Dk4FcsFrame.wxc"
+#line 286 "Dk4FcsFrame.wxc"
-BEGIN_EVENT_TABLE(Dk4FcsFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4FcsFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(Dk4FcsFrame,wxFrame)
+#endif
EVT_MENU(Dk4FcsFrame_Quit, Dk4FcsFrame::OnQuit)
EVT_MENU(Dk4FcsFrame_Open, Dk4FcsFrame::OnOpen)
EVT_MENU(Dk4FcsFrame_Help_About, Dk4FcsFrame::OnAbout)
EVT_MENU(Dk4FcsFrame_Help_Contents, Dk4FcsFrame::OnHelpContents)
EVT_IDLE(Dk4FcsFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -133,60 +121,60 @@ multi_ctx_init(MULTI_CTX *mptr)
{
-#line 338 "Dk4FcsFrame.wxc"
+#line 352 "Dk4FcsFrame.wxc"
DK4_MEMRES(mptr, sizeof(MULTI_CTX));
#if DK4_HAVE_OPENSSL_MD5_H
if (1 == MD5_Init(&(mptr->md5))) {
mptr->iMd5 = 1;
-#line 342 "Dk4FcsFrame.wxc"
+#line 356 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_OPENSSL_RIPEMD_H
if (1 == RIPEMD160_Init(&(mptr->ripemd160))) {
mptr->iRipemd160 = 1;
-#line 347 "Dk4FcsFrame.wxc"
+#line 361 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_OPENSSL_SHA_H
if (1 == SHA1_Init(&(mptr->sha))) {
mptr->iSha1 = 1;
-#line 352 "Dk4FcsFrame.wxc"
+#line 366 "Dk4FcsFrame.wxc"
}
#if DK4_HAVE_SHA224
if (1 == SHA224_Init(&(mptr->sha224))) {
mptr->iSha224 = 1;
-#line 356 "Dk4FcsFrame.wxc"
+#line 370 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_SHA256
if (1 == SHA256_Init(&(mptr->sha256))) {
mptr->iSha256 = 1;
-#line 361 "Dk4FcsFrame.wxc"
+#line 375 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_SHA384
if (1 == SHA384_Init(&(mptr->sha384))) {
mptr->iSha384 = 1;
-#line 366 "Dk4FcsFrame.wxc"
+#line 380 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_SHA512
if (1 == SHA512_Init(&(mptr->sha512))) {
mptr->iSha512 = 1;
-#line 371 "Dk4FcsFrame.wxc"
+#line 385 "Dk4FcsFrame.wxc"
}
#endif
#endif
-#line 375 "Dk4FcsFrame.wxc"
+#line 389 "Dk4FcsFrame.wxc"
}
@@ -197,59 +185,59 @@ multi_ctx_add(MULTI_CTX *mptr, void *buffer, size_t sz)
{
-#line 384 "Dk4FcsFrame.wxc"
+#line 398 "Dk4FcsFrame.wxc"
#if DK4_HAVE_OPENSSL_MD5_H
if (1 != MD5_Update(&(mptr->md5), buffer, (unsigned long)sz)) {
mptr->iMd5 = 0;
-#line 387 "Dk4FcsFrame.wxc"
+#line 401 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_OPENSSL_RIPEMD_H
if (1 != RIPEMD160_Update(&(mptr->ripemd160), buffer, (unsigned long)sz)) {
mptr->iRipemd160 = 0;
-#line 392 "Dk4FcsFrame.wxc"
+#line 406 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_OPENSSL_SHA_H
if (1 != SHA1_Update(&(mptr->sha), buffer, (unsigned long)sz)) {
mptr->iSha1 = 0;
-#line 397 "Dk4FcsFrame.wxc"
+#line 411 "Dk4FcsFrame.wxc"
}
#if DK4_HAVE_SHA224
if (1 != SHA224_Update(&(mptr->sha224), buffer, (unsigned long)sz)) {
mptr->iSha224 = 0;
-#line 401 "Dk4FcsFrame.wxc"
+#line 415 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_SHA256
if (1 != SHA256_Update(&(mptr->sha256), buffer, (unsigned long)sz)) {
mptr->iSha256 = 0;
-#line 406 "Dk4FcsFrame.wxc"
+#line 420 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_SHA384
if (1 != SHA384_Update(&(mptr->sha384), buffer, (unsigned long)sz)) {
mptr->iSha384 = 0;
-#line 411 "Dk4FcsFrame.wxc"
+#line 425 "Dk4FcsFrame.wxc"
}
#endif
#if DK4_HAVE_SHA512
if (1 != SHA512_Update(&(mptr->sha512), buffer, (unsigned long)sz)) {
mptr->iSha512 = 0;
-#line 416 "Dk4FcsFrame.wxc"
+#line 430 "Dk4FcsFrame.wxc"
}
#endif
#endif
-#line 420 "Dk4FcsFrame.wxc"
+#line 434 "Dk4FcsFrame.wxc"
}
@@ -314,13 +302,13 @@ Dk4FcsThread::Dk4FcsThread(
{
-#line 483 "Dk4FcsFrame.wxc"
+#line 497 "Dk4FcsFrame.wxc"
pPd = pd;
pCtx = ctx;
pWxf = wxf;
-#line 487 "Dk4FcsFrame.wxc"
+#line 501 "Dk4FcsFrame.wxc"
}
@@ -337,71 +325,71 @@ Dk4FcsThread::Entry()
bool success = true;
-#line 502 "Dk4FcsFrame.wxc"
+#line 516 "Dk4FcsFrame.wxc"
fileSize = pWxf->Length();
while(canContinue) {
-#line 504 "Dk4FcsFrame.wxc"
+#line 518 "Dk4FcsFrame.wxc"
if (pPd->CanContinue()) {
-#line 505 "Dk4FcsFrame.wxc"
+#line 519 "Dk4FcsFrame.wxc"
bytes = pWxf->Read(buf, sizeof(buf));
-#line 507 "Dk4FcsFrame.wxc"
+#line 521 "Dk4FcsFrame.wxc"
if (0 < bytes) {
-#line 508 "Dk4FcsFrame.wxc"
+#line 522 "Dk4FcsFrame.wxc"
if ((size_t)(wxInvalidOffset) != bytes) {
-#line 509 "Dk4FcsFrame.wxc"
+#line 523 "Dk4FcsFrame.wxc"
multi_ctx_add(pCtx, buf, bytes);
bytesRead += (wxFileOffset)bytes;
if (bytesRead >= fileSize) {
gauge = 1000;
-#line 513 "Dk4FcsFrame.wxc"
+#line 527 "Dk4FcsFrame.wxc"
} else {
gauge = (int)((1000.0 * (double)bytesRead) / ((double)fileSize));
if (1000 < gauge) {
gauge = 1000;
-#line 517 "Dk4FcsFrame.wxc"
+#line 531 "Dk4FcsFrame.wxc"
}
}
if (gauge != ogauge) {
-#line 520 "Dk4FcsFrame.wxc"
+#line 534 "Dk4FcsFrame.wxc"
pPd->SetGauge(gauge);
ogauge = gauge;
}
} else {
-#line 524 "Dk4FcsFrame.wxc"
+#line 538 "Dk4FcsFrame.wxc"
canContinue = false;
success = false;
}
} else {
-#line 528 "Dk4FcsFrame.wxc"
+#line 542 "Dk4FcsFrame.wxc"
canContinue = false;
}
} else {
-#line 531 "Dk4FcsFrame.wxc"
+#line 545 "Dk4FcsFrame.wxc"
canContinue = false;
success = false;
}
-#line 534 "Dk4FcsFrame.wxc"
+#line 548 "Dk4FcsFrame.wxc"
}
-#line 536 "Dk4FcsFrame.wxc"
+#line 550 "Dk4FcsFrame.wxc"
pPd->EndProcessing(success);
-#line 538 "Dk4FcsFrame.wxc"
+#line 552 "Dk4FcsFrame.wxc"
return NULL;
}
@@ -412,16 +400,16 @@ Dk4FcsThread::OnExit()
{
-#line 547 "Dk4FcsFrame.wxc"
+#line 561 "Dk4FcsFrame.wxc"
-#line 548 "Dk4FcsFrame.wxc"
+#line 562 "Dk4FcsFrame.wxc"
}
-#line 553 "Dk4FcsFrame.wxc"
+#line 567 "Dk4FcsFrame.wxc"
Dk4FcsFrame::Dk4FcsFrame(
int wxid,
Dk4WxApplicationHelper *applicationHelper,
@@ -435,7 +423,7 @@ Dk4FcsFrame::Dk4FcsFrame(
{
-#line 565 "Dk4FcsFrame.wxc"
+#line 579 "Dk4FcsFrame.wxc"
/* Further local variables.
*/
@@ -650,15 +638,12 @@ Dk4FcsFrame::Dk4FcsFrame(
mainSizer->SetSizeHints(this);
}
-#line 598 "Dk4FcsFrame.wxc"
+#line 612 "Dk4FcsFrame.wxc"
if(dkctGUILayoutOK) {
SetTitle(nlWx[0]);
if (1 < argc) {
tFile->SetLabel(sFileName);
}
-#if 0
- RestorePosition();
-#endif
gResults->SetCellValue(0, 0, sNlWx[5]);
gResults->SetCellValue(1, 0, sNlWx[5]);
gResults->SetCellValue(2, 0, sNlWx[5]);
@@ -672,11 +657,11 @@ Dk4FcsFrame::Dk4FcsFrame(
*/
-#line 618 "Dk4FcsFrame.wxc"
+#line 629 "Dk4FcsFrame.wxc"
}
-#line 621 "Dk4FcsFrame.wxc"
+#line 632 "Dk4FcsFrame.wxc"
@@ -684,53 +669,53 @@ Dk4FcsFrame::~Dk4FcsFrame()
{
-#line 627 "Dk4FcsFrame.wxc"
+#line 638 "Dk4FcsFrame.wxc"
/* Release resources allocated by further class members.
*/
-#line 630 "Dk4FcsFrame.wxc"
+#line 641 "Dk4FcsFrame.wxc"
}
bool
-Dk4FcsFrame::CanClose(bool isFinal)
+Dk4FcsFrame::CanClose(bool WXUNUSED(isFinal))
{
bool back = true;
-#line 639 "Dk4FcsFrame.wxc"
+#line 650 "Dk4FcsFrame.wxc"
-#line 640 "Dk4FcsFrame.wxc"
+#line 651 "Dk4FcsFrame.wxc"
return back;
}
void
-Dk4FcsFrame::OnQuit(wxCommandEvent & event)
+Dk4FcsFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
-#line 649 "Dk4FcsFrame.wxc"
+#line 660 "Dk4FcsFrame.wxc"
Close();
-#line 651 "Dk4FcsFrame.wxc"
+#line 662 "Dk4FcsFrame.wxc"
}
void
-Dk4FcsFrame::OnAbout(wxCommandEvent & event)
+Dk4FcsFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
-#line 661 "Dk4FcsFrame.wxc"
+#line 672 "Dk4FcsFrame.wxc"
/* Construct message text. */
text.Append(sNlWx[0]);
text.Append(sNlWx[7]);
@@ -783,21 +768,21 @@ Dk4FcsFrame::OnAbout(wxCommandEvent & event)
wxMessageBox(text, title);
-#line 712 "Dk4FcsFrame.wxc"
+#line 723 "Dk4FcsFrame.wxc"
}
void
-Dk4FcsFrame::OnHelpContents(wxCommandEvent & event)
+Dk4FcsFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
-#line 720 "Dk4FcsFrame.wxc"
+#line 731 "Dk4FcsFrame.wxc"
DisplayContents();
-#line 722 "Dk4FcsFrame.wxc"
+#line 733 "Dk4FcsFrame.wxc"
}
@@ -825,7 +810,7 @@ Dk4FcsFrame::SetCellValueBinary(
unsigned short u;
-#line 748 "Dk4FcsFrame.wxc"
+#line 759 "Dk4FcsFrame.wxc"
if (64 >= bytes) {
obptr = obuf;
while(bytes--) {
@@ -834,12 +819,12 @@ Dk4FcsFrame::SetCellValueBinary(
u &= 15;
*(obptr++) = hexdig[u];
-#line 755 "Dk4FcsFrame.wxc"
+#line 766 "Dk4FcsFrame.wxc"
u = (unsigned short)(*buf);
u &= 15;
*(obptr++) = hexdig[u];
-#line 758 "Dk4FcsFrame.wxc"
+#line 769 "Dk4FcsFrame.wxc"
buf++;
}
*obptr = wxT('\0');
@@ -852,7 +837,7 @@ Dk4FcsFrame::SetCellValueBinary(
}
-#line 769 "Dk4FcsFrame.wxc"
+#line 780 "Dk4FcsFrame.wxc"
}
@@ -868,7 +853,7 @@ Dk4FcsFrame::RunChecksumming(void)
bool updateTable = false; // Flag: Update the table
-#line 783 "Dk4FcsFrame.wxc"
+#line 794 "Dk4FcsFrame.wxc"
/* Reset all values.
*/
gResults->BeginBatch();
@@ -888,71 +873,71 @@ Dk4FcsFrame::RunChecksumming(void)
*/
if (wxFile::Exists(sFileName)) {
-#line 801 "Dk4FcsFrame.wxc"
+#line 812 "Dk4FcsFrame.wxc"
{
wxFile wxf(sFileName);
if (wxf.IsOpened()) {
-#line 804 "Dk4FcsFrame.wxc"
+#line 815 "Dk4FcsFrame.wxc"
pd = new Dk4WxProgressDialog(this, pAppHelp);
if (NULL != pd) {
-#line 806 "Dk4FcsFrame.wxc"
+#line 817 "Dk4FcsFrame.wxc"
pt = new Dk4FcsThread(pd, &ctx, &wxf);
if (NULL != pt) {
-#line 808 "Dk4FcsFrame.wxc"
+#line 819 "Dk4FcsFrame.wxc"
multi_ctx_init(&ctx);
if(wxTHREAD_NO_ERROR == pt->Create()) {
-#line 810 "Dk4FcsFrame.wxc"
+#line 821 "Dk4FcsFrame.wxc"
pt->SetPriority(WXTHREAD_DEFAULT_PRIORITY);
pt->Run();
res = pd->ShowModal();
if (wxID_OK == res) {
-#line 814 "Dk4FcsFrame.wxc"
+#line 825 "Dk4FcsFrame.wxc"
updateTable = true;
} else {
-#line 816 "Dk4FcsFrame.wxc"
+#line 827 "Dk4FcsFrame.wxc"
/* !!!!! ERROR: Aborted by user */
}
} else {
-#line 819 "Dk4FcsFrame.wxc"
+#line 830 "Dk4FcsFrame.wxc"
delete(pt);
pt = NULL;
/* !!!!! ERROR: Failed to create thread */
}
} else {
-#line 824 "Dk4FcsFrame.wxc"
+#line 835 "Dk4FcsFrame.wxc"
/* !!!!! ERROR: No thread */
}
pd->Destroy();
} else {
-#line 828 "Dk4FcsFrame.wxc"
+#line 839 "Dk4FcsFrame.wxc"
/* !!!!! ERROR: No progress dialog */
}
} else {
-#line 831 "Dk4FcsFrame.wxc"
+#line 842 "Dk4FcsFrame.wxc"
/* !!!!! ERROR: Failed to open file */
}
}
if (updateTable) {
-#line 835 "Dk4FcsFrame.wxc"
+#line 846 "Dk4FcsFrame.wxc"
gResults->BeginBatch();
#if DK4_HAVE_OPENSSL_MD5_H
if (0 != ctx.iMd5) {
-#line 838 "Dk4FcsFrame.wxc"
+#line 849 "Dk4FcsFrame.wxc"
if (1 == MD5_Final(obuf, &(ctx.md5))) {
-#line 839 "Dk4FcsFrame.wxc"
+#line 850 "Dk4FcsFrame.wxc"
SetCellValueBinary(0, obuf, 16);
}
}
@@ -960,31 +945,31 @@ Dk4FcsFrame::RunChecksumming(void)
#if DK4_HAVE_OPENSSL_RIPEMD_H
if (0 != ctx.iRipemd160) {
-#line 845 "Dk4FcsFrame.wxc"
+#line 856 "Dk4FcsFrame.wxc"
if (1 == RIPEMD160_Final(obuf, &(ctx.ripemd160))) {
SetCellValueBinary(1, obuf, 20);
-#line 847 "Dk4FcsFrame.wxc"
+#line 858 "Dk4FcsFrame.wxc"
}
}
#endif
#if DK4_HAVE_OPENSSL_SHA_H
if (0 != ctx.iSha1) {
-#line 852 "Dk4FcsFrame.wxc"
+#line 863 "Dk4FcsFrame.wxc"
if (1 == SHA1_Final(obuf, &(ctx.sha))) {
-#line 853 "Dk4FcsFrame.wxc"
+#line 864 "Dk4FcsFrame.wxc"
SetCellValueBinary(2, obuf, 20);
}
}
#if DK4_HAVE_SHA224
if (0 != ctx.iSha224) {
-#line 858 "Dk4FcsFrame.wxc"
+#line 869 "Dk4FcsFrame.wxc"
if (1 == SHA224_Final(obuf, &(ctx.sha224))) {
-#line 859 "Dk4FcsFrame.wxc"
+#line 870 "Dk4FcsFrame.wxc"
SetCellValueBinary(3, obuf, 28);
}
}
@@ -992,10 +977,10 @@ Dk4FcsFrame::RunChecksumming(void)
#if DK4_HAVE_SHA256
if (0 != ctx.iSha256) {
-#line 865 "Dk4FcsFrame.wxc"
+#line 876 "Dk4FcsFrame.wxc"
if (1 == SHA256_Final(obuf, &(ctx.sha256))) {
-#line 866 "Dk4FcsFrame.wxc"
+#line 877 "Dk4FcsFrame.wxc"
SetCellValueBinary(4, obuf, 32);
}
}
@@ -1003,10 +988,10 @@ Dk4FcsFrame::RunChecksumming(void)
#if DK4_HAVE_SHA384
if (0 != ctx.iSha384) {
-#line 872 "Dk4FcsFrame.wxc"
+#line 883 "Dk4FcsFrame.wxc"
if (1 == SHA384_Final(obuf, &(ctx.sha384))) {
-#line 873 "Dk4FcsFrame.wxc"
+#line 884 "Dk4FcsFrame.wxc"
SetCellValueBinary(5, obuf, 48);
}
}
@@ -1014,10 +999,10 @@ Dk4FcsFrame::RunChecksumming(void)
#if DK4_HAVE_SHA512
if (0 != ctx.iSha512) {
-#line 879 "Dk4FcsFrame.wxc"
+#line 890 "Dk4FcsFrame.wxc"
if (1 == SHA512_Final(obuf, &(ctx.sha512))) {
-#line 880 "Dk4FcsFrame.wxc"
+#line 891 "Dk4FcsFrame.wxc"
SetCellValueBinary(6, obuf, 64);
}
}
@@ -1037,29 +1022,29 @@ Dk4FcsFrame::RunChecksumming(void)
Update();
} else {
-#line 898 "Dk4FcsFrame.wxc"
+#line 909 "Dk4FcsFrame.wxc"
}
} else {
-#line 900 "Dk4FcsFrame.wxc"
+#line 911 "Dk4FcsFrame.wxc"
/* !!!!! ERROR: File does not exist */
}
-#line 903 "Dk4FcsFrame.wxc"
+#line 914 "Dk4FcsFrame.wxc"
return updateTable;
}
void
-Dk4FcsFrame::OnOpen(wxCommandEvent & event)
+Dk4FcsFrame::OnOpen(wxCommandEvent & WXUNUSED(event))
{
bool canRun = true;
int res = 0;
-#line 914 "Dk4FcsFrame.wxc"
+#line 925 "Dk4FcsFrame.wxc"
{
wxFileDialog dlg(this, sTexts[22], sDirectory);
res = dlg.ShowModal();
@@ -1080,7 +1065,7 @@ Dk4FcsFrame::OnOpen(wxCommandEvent & event)
}
-#line 933 "Dk4FcsFrame.wxc"
+#line 944 "Dk4FcsFrame.wxc"
}
@@ -1091,23 +1076,23 @@ Dk4FcsFrame::OnIdle(wxIdleEvent & event)
bool success = false;
-#line 942 "Dk4FcsFrame.wxc"
+#line 953 "Dk4FcsFrame.wxc"
if (bActive) {
/* event.RequestMore(); */
switch (oAsc.GetReaction()) {
#if 0
- case DK4WX_AUTOSTART_REACTION_IGNORE : {
+ case Dk4WxAutostartController::REACTION_IGNORE : {
} break;
#endif
- case DK4WX_AUTOSTART_REACTION_START : {
+ case Dk4WxAutostartController::REACTION_START : {
oAsc.StartProcessing();
success = RunChecksumming();
oAsc.EndProcessing(success);
} break;
- case DK4WX_AUTOSTART_REACTION_MORE : {
+ case Dk4WxAutostartController::REACTION_MORE : {
event.RequestMore();
} break;
- case DK4WX_AUTOSTART_REACTION_EXIT : {
+ case Dk4WxAutostartController::REACTION_EXIT : {
bActive = false;
Close();
} break;
@@ -1116,7 +1101,7 @@ Dk4FcsFrame::OnIdle(wxIdleEvent & event)
event.Skip();
-#line 965 "Dk4FcsFrame.wxc"
+#line 976 "Dk4FcsFrame.wxc"
}
diff --git a/support/dktools/Dk4FcsFrame.h b/support/dktools/Dk4FcsFrame.h
index 4ccc581993..6c3f391e9a 100644
--- a/support/dktools/Dk4FcsFrame.h
+++ b/support/dktools/Dk4FcsFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4FcsFrame.wxc
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4FcsFrame.wxc
*/
/** @file Dk4FcsFrame.h Header file for the Dk4FcsFrame module.
@@ -53,7 +31,11 @@ class Dk4FcsFrame : public Dk4WxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -159,7 +141,7 @@ class Dk4FcsFrame : public Dk4WxFrame
wxGrid *gResults;
-#line 155 "Dk4FcsFrame.wxc"
+#line 159 "Dk4FcsFrame.wxc"
public:
@@ -249,7 +231,7 @@ class Dk4FcsFrame : public Dk4WxFrame
};
-#line 244 "Dk4FcsFrame.wxc"
+#line 248 "Dk4FcsFrame.wxc"
#endif
diff --git a/support/dktools/Dk4FcsFrame.wxc b/support/dktools/Dk4FcsFrame.wxc
index 63f1ff147f..2d80557cf5 100644
--- a/support/dktools/Dk4FcsFrame.wxc
+++ b/support/dktools/Dk4FcsFrame.wxc
@@ -8,7 +8,7 @@ copyright year = 2015-xxxx
# __CHANGE__ 002: Correct license type if necessary.
# Use "bsd", "gpl", "lgpl", or "commercial".
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -119,7 +119,11 @@ class Dk4FcsFrame : public Dk4WxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -244,6 +248,8 @@ class Dk4FcsFrame : public Dk4WxFrame
%% module start
+#include "dk4conf.h"
+
#include "wxdkfcs.h"
#include "dk4mem.h"
@@ -271,7 +277,7 @@ class Dk4FcsFrame : public Dk4WxFrame
#endif
#if !defined(__WXMSW__)
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
#endif
@@ -280,13 +286,21 @@ $!trace-include
-BEGIN_EVENT_TABLE(Dk4FcsFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4FcsFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(Dk4FcsFrame,wxFrame)
+#endif
EVT_MENU(Dk4FcsFrame_Quit, Dk4FcsFrame::OnQuit)
EVT_MENU(Dk4FcsFrame_Open, Dk4FcsFrame::OnOpen)
EVT_MENU(Dk4FcsFrame_Help_About, Dk4FcsFrame::OnAbout)
EVT_MENU(Dk4FcsFrame_Help_Contents, Dk4FcsFrame::OnHelpContents)
EVT_IDLE(Dk4FcsFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -600,9 +614,6 @@ Dk4FcsFrame::Dk4FcsFrame(
if (1 < argc) {
tFile->SetLabel(sFileName);
}
-#if 0
- RestorePosition();
-#endif
gResults->SetCellValue(0, 0, sNlWx[5]);
gResults->SetCellValue(1, 0, sNlWx[5]);
gResults->SetCellValue(2, 0, sNlWx[5]);
@@ -632,7 +643,7 @@ Dk4FcsFrame::~Dk4FcsFrame()
bool
-Dk4FcsFrame::CanClose(bool isFinal)
+Dk4FcsFrame::CanClose(bool WXUNUSED(isFinal))
{
bool back = true;
$? "+ CanClose"
@@ -643,7 +654,7 @@ Dk4FcsFrame::CanClose(bool isFinal)
void
-Dk4FcsFrame::OnQuit(wxCommandEvent & event)
+Dk4FcsFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
$? "+ OnQuit"
Close();
@@ -653,7 +664,7 @@ Dk4FcsFrame::OnQuit(wxCommandEvent & event)
void
-Dk4FcsFrame::OnAbout(wxCommandEvent & event)
+Dk4FcsFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
@@ -714,7 +725,7 @@ Dk4FcsFrame::OnAbout(wxCommandEvent & event)
void
-Dk4FcsFrame::OnHelpContents(wxCommandEvent & event)
+Dk4FcsFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
$? "+ OnHelpContents"
DisplayContents();
@@ -906,7 +917,7 @@ Dk4FcsFrame::RunChecksumming(void)
void
-Dk4FcsFrame::OnOpen(wxCommandEvent & event)
+Dk4FcsFrame::OnOpen(wxCommandEvent & WXUNUSED(event))
{
bool canRun = true;
int res = 0;
@@ -943,18 +954,18 @@ Dk4FcsFrame::OnIdle(wxIdleEvent & event)
/* event.RequestMore(); */
switch (oAsc.GetReaction()) {
#if 0
- case DK4WX_AUTOSTART_REACTION_IGNORE : {
+ case Dk4WxAutostartController::REACTION_IGNORE : {
} break;
#endif
- case DK4WX_AUTOSTART_REACTION_START : {
+ case Dk4WxAutostartController::REACTION_START : {
oAsc.StartProcessing();
success = RunChecksumming();
oAsc.EndProcessing(success);
} break;
- case DK4WX_AUTOSTART_REACTION_MORE : {
+ case Dk4WxAutostartController::REACTION_MORE : {
event.RequestMore();
} break;
- case DK4WX_AUTOSTART_REACTION_EXIT : {
+ case Dk4WxAutostartController::REACTION_EXIT : {
bActive = false;
Close();
} break;
diff --git a/support/dktools/Dk4FcsThread.h b/support/dktools/Dk4FcsThread.h
index a2297f9210..acfea61855 100644
--- a/support/dktools/Dk4FcsThread.h
+++ b/support/dktools/Dk4FcsThread.h
@@ -1,4 +1,9 @@
/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
@@ -43,7 +48,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Dk4FcsThread.h Thread for the wxdkfcs program.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
#if DK4_HAVE_OPENSSL_MD5_H
#ifndef OPENSSL_MD5_H_INCLUDED
diff --git a/support/dktools/Dk4WxApplicationHelper.cpp b/support/dktools/Dk4WxApplicationHelper.cpp
index ded5250739..4959db750e 100644
--- a/support/dktools/Dk4WxApplicationHelper.cpp
+++ b/support/dktools/Dk4WxApplicationHelper.cpp
@@ -1,43 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxApplicationHelper.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxApplicationHelper.cpt
*/
/** @file Dk4WxApplicationHelper.cpp The Dk4WxApplicationHelper module.
*/
-#line 721 "Dk4WxApplicationHelper.cpt"
+#line 948 "Dk4WxApplicationHelper.cpt"
+
+#include "dk4conf.h"
#include "Dk4WxApplicationHelper.h"
@@ -70,7 +50,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 752 "Dk4WxApplicationHelper.cpt"
+#line 981 "Dk4WxApplicationHelper.cpt"
@@ -81,7 +61,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* ************************************************************************ */
-#line 758 "Dk4WxApplicationHelper.cpt"
+#line 987 "Dk4WxApplicationHelper.cpt"
@@ -91,45 +71,6 @@ typedef const wxChar *PCWXCHAR;
-/** Error codes in Initialize().
-*/
-enum {
- /** No error occured.
- */
- ERROR_NONE = 0,
-
- /** Not enough memory.
- */
- ERROR_MEMORY ,
-
- /** Failed to find host name.
- */
- ERROR_HOSTNAME ,
-
- /** Failed to find localization settings.
- */
- ERROR_LANG_REG_ENC ,
-
- /** Failed to find login name.
- */
- ERROR_LOGNAME ,
-
- /** Failed to find home directory.
- */
- ERROR_HOMEDIR ,
-
- /** Failed to find path name of executable.
- */
- ERROR_EXECUTABLE ,
-
- /** Executable file name too long.
- */
- ERROR_EXEC_TOO_LONG ,
-
- /** Invalid arguments were passed to Initialize().
- */
- ERROR_ARGUMENTS ,
-};
@@ -140,7 +81,7 @@ enum {
/* ************************************************************************ */
-#line 812 "Dk4WxApplicationHelper.cpt"
+#line 1002 "Dk4WxApplicationHelper.cpt"
@@ -195,7 +136,7 @@ wxT("Illegal arguments (NULL pointers) to Initialize() function!"),
NULL
-#line 874 "Dk4WxApplicationHelper.cpt"
+#line 1064 "Dk4WxApplicationHelper.cpt"
};
@@ -209,7 +150,7 @@ dkT("dk4wxbase.str"),
NULL
-#line 887 "Dk4WxApplicationHelper.cpt"
+#line 1077 "Dk4WxApplicationHelper.cpt"
};
@@ -223,7 +164,7 @@ static const char * const dk4wxah_kwnl_c8[] = {
NULL
-#line 897 "Dk4WxApplicationHelper.cpt"
+#line 1087 "Dk4WxApplicationHelper.cpt"
};
@@ -246,7 +187,7 @@ dkT("lib"),
NULL
-#line 910 "Dk4WxApplicationHelper.cpt"
+#line 1100 "Dk4WxApplicationHelper.cpt"
};
@@ -263,7 +204,7 @@ dkT("share"),
NULL
-#line 921 "Dk4WxApplicationHelper.cpt"
+#line 1111 "Dk4WxApplicationHelper.cpt"
};
@@ -298,10 +239,31 @@ wxT("Not enough memory (RAM)!"),
/* 8 */
wxT("Illegal arguments in Dk4WxHelpController constructor (bug)!"),
+/* 9 */
+wxT("File not found"),
+
+/* 10 */
+wxT("The file to display was not found!"),
+
+/* 11 */
+wxT("Error"),
+
+/* 12 */
+wxT("Failed to start browser or application for file\n\""),
+
+/* 13 */
+wxT("\"."),
+
+/* 14 */
+wxT("Yes"),
+
+/* 15 */
+wxT("No"),
+
NULL
-#line 954 "Dk4WxApplicationHelper.cpt"
+#line 1160 "Dk4WxApplicationHelper.cpt"
};
@@ -313,7 +275,7 @@ NULL
/* ************************************************************************ */
-#line 961 "Dk4WxApplicationHelper.cpt"
+#line 1167 "Dk4WxApplicationHelper.cpt"
@@ -333,7 +295,7 @@ dk4wxapplicationhelper_isinsub(dkChar *dirname, const dkChar * const *array)
int back = 0; /* Function result */
-#line 979 "Dk4WxApplicationHelper.cpt"
+#line 1185 "Dk4WxApplicationHelper.cpt"
do {
cc = 0;
p1 = dirname; p2 = NULL;
@@ -358,7 +320,7 @@ dk4wxapplicationhelper_isinsub(dkChar *dirname, const dkChar * const *array)
} while ((1 == cc) && (0 == back));
-#line 1002 "Dk4WxApplicationHelper.cpt"
+#line 1208 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -371,7 +333,7 @@ dk4wxapplicationhelper_isinsub(dkChar *dirname, const dkChar * const *array)
/* ************************************************************************ */
-#line 1010 "Dk4WxApplicationHelper.cpt"
+#line 1216 "Dk4WxApplicationHelper.cpt"
@@ -382,18 +344,20 @@ Dk4WxApplicationHelper::Dk4WxApplicationHelper()
*/
-#line 1019 "Dk4WxApplicationHelper.cpt"
+#line 1225 "Dk4WxApplicationHelper.cpt"
ppBasicStrings = NULL;
pcwxsArgv0 = NULL;
pcwxsVendor = NULL;
pcdksGroup = NULL;
pwxsApp = NULL;
+ pcdksArgv0 = NULL;
pdksHost = NULL;
pdksLogname = NULL;
pdksHome = NULL;
pdksApp = NULL;
pdksSysconf = NULL;
pdksShare = NULL;
+ pwxsShare = NULL;
pdksLanguage = NULL;
pdksRegion = NULL;
sStt = NULL;
@@ -403,13 +367,19 @@ Dk4WxApplicationHelper::Dk4WxApplicationHelper()
sPrUser = NULL;
iPrUser = NULL;
nBasicStrings = 0;
- iDkEncoding = DK4_ENCODING_ASCII;
- iWxEncoding = DK4_ENCODING_ASCII;
- iFiEncoding = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ iDkEncoding = DK4_ENCODING_WIN1252;
+ iWxEncoding = DK4_ENCODING_WIN1252;
+ iFiEncoding = DK4_FILE_ENCODING_WIN1252;
+#else
+ iDkEncoding = DK4_ENCODING_PLAIN;
+ iWxEncoding = DK4_ENCODING_PLAIN;
+ iFiEncoding = DK4_FILE_ENCODING_PLAIN;
+#endif
bActive = false;
-#line 1044 "Dk4WxApplicationHelper.cpt"
+#line 1258 "Dk4WxApplicationHelper.cpt"
}
@@ -445,7 +415,7 @@ Dk4WxApplicationHelper::Initialize(
bool back = false;
-#line 1078 "Dk4WxApplicationHelper.cpt"
+#line 1292 "Dk4WxApplicationHelper.cpt"
/* Keep some of the arguments.
*/
if ((NULL == argv0) || (NULL == vendorName) || (NULL == groupName)) {
@@ -457,7 +427,7 @@ Dk4WxApplicationHelper::Initialize(
pcdksGroup = groupName;
-#line 1088 "Dk4WxApplicationHelper.cpt"
+#line 1302 "Dk4WxApplicationHelper.cpt"
/* Some default values.
*/
@@ -465,7 +435,7 @@ Dk4WxApplicationHelper::Initialize(
nBasicStrings = DK4_SIZEOF(dk4wxah_basic_strings,PCWXCHAR) - 1;
-#line 1094 "Dk4WxApplicationHelper.cpt"
+#line 1308 "Dk4WxApplicationHelper.cpt"
/* Host name.
*/
@@ -483,7 +453,7 @@ Dk4WxApplicationHelper::Initialize(
}
-#line 1110 "Dk4WxApplicationHelper.cpt"
+#line 1324 "Dk4WxApplicationHelper.cpt"
/* Language and encoding.
*/
@@ -500,26 +470,34 @@ Dk4WxApplicationHelper::Initialize(
#endif
#else
switch (iDkEncoding) {
- case DK4_ENCODING_ANSI : {
- iWxEncoding = DK4_ENCODING_ANSI;
+ case DK4_ENCODING_WIN1252 : {
+ iWxEncoding = DK4_ENCODING_WIN1252;
} break;
case DK4_ENCODING_UTF8 : {
iWxEncoding = DK4_ENCODING_UTF8;
} break;
default : {
- iWxEncoding = DK4_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ iWxEncoding = DK4_ENCODING_WIN1252;
+#else
+ iWxEncoding = DK4_ENCODING_PLAIN;
+#endif
} break;
}
#endif
switch (iDkEncoding) {
- case DK4_ENCODING_ANSI : {
- iFiEncoding = DK4_ENCODING_ANSI;
+ case DK4_ENCODING_WIN1252 : {
+ iFiEncoding = DK4_ENCODING_WIN1252;
} break;
case DK4_ENCODING_UTF8 : {
iFiEncoding = DK4_ENCODING_UTF8;
} break;
default : {
- iFiEncoding = DK4_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ iFiEncoding = DK4_ENCODING_WIN1252;
+#else
+ iFiEncoding = DK4_ENCODING_PLAIN;
+#endif
} break;
}
if (0 < dk4str_len(labuf)) {
@@ -538,7 +516,7 @@ Dk4WxApplicationHelper::Initialize(
}
-#line 1163 "Dk4WxApplicationHelper.cpt"
+#line 1385 "Dk4WxApplicationHelper.cpt"
/* Login name and home directory.
*/
@@ -555,20 +533,20 @@ Dk4WxApplicationHelper::Initialize(
res = dk4user_get_homedir(labuf, szlabuf, 0, erp);
if (0 == res) {
-#line 1178 "Dk4WxApplicationHelper.cpt"
+#line 1400 "Dk4WxApplicationHelper.cpt"
errc = ERROR_HOMEDIR;
goto finished;
}
pdksHome = dk4str_dup(labuf, erp);
if (NULL == pdksHome) {
-#line 1183 "Dk4WxApplicationHelper.cpt"
+#line 1405 "Dk4WxApplicationHelper.cpt"
errc = ERROR_MEMORY;
goto finished;
}
-#line 1187 "Dk4WxApplicationHelper.cpt"
+#line 1409 "Dk4WxApplicationHelper.cpt"
/* System configuration and data directory.
*/
@@ -576,18 +554,31 @@ Dk4WxApplicationHelper::Initialize(
labuf, szlabuf, iDkEncoding, argv0, iWxEncoding, erp
);
-#line 1193 "Dk4WxApplicationHelper.cpt"
+#line 1415 "Dk4WxApplicationHelper.cpt"
+ if (0 == res) {
+
+#line 1416 "Dk4WxApplicationHelper.cpt"
+ errc = ERROR_EXECUTABLE;
+ goto finished;
+ }
+ pcdksArgv0 = dk4str_dup(labuf, erp);
+ if (NULL == pcdksArgv0) {
+
+#line 1421 "Dk4WxApplicationHelper.cpt"
+ errc = ERROR_MEMORY;
+ goto finished;
+ }
res = dk4execpath(
rebuf, szrebuf, ((0 != res) ? labuf : NULL), erp
);
if (0 == res) {
-#line 1197 "Dk4WxApplicationHelper.cpt"
+#line 1428 "Dk4WxApplicationHelper.cpt"
errc = ERROR_EXECUTABLE;
goto finished;
}
-#line 1200 "Dk4WxApplicationHelper.cpt"
+#line 1431 "Dk4WxApplicationHelper.cpt"
p1 = rebuf;
p2 = NULL;
while (dkT('\0') != *p1) {
@@ -598,7 +589,7 @@ Dk4WxApplicationHelper::Initialize(
}
if (NULL == p2) {
-#line 1209 "Dk4WxApplicationHelper.cpt"
+#line 1440 "Dk4WxApplicationHelper.cpt"
errc = ERROR_EXECUTABLE;
goto finished;
}
@@ -620,7 +611,7 @@ Dk4WxApplicationHelper::Initialize(
);
if (0 == res) {
-#line 1229 "Dk4WxApplicationHelper.cpt"
+#line 1460 "Dk4WxApplicationHelper.cpt"
errc = ERROR_EXECUTABLE;
goto finished;
}
@@ -652,6 +643,7 @@ Dk4WxApplicationHelper::Initialize(
if (0 != res) {
pdksSysconf = dk4str_dup(dk4inst_get_directory(1), NULL);
pdksShare = dk4str_dup(dk4inst_get_directory(2), NULL);
+ UpdateWxsShare();
if ((NULL == pdksSysconf) || (NULL == pdksShare)) {
errc = ERROR_MEMORY;
goto finished;
@@ -689,6 +681,7 @@ Dk4WxApplicationHelper::Initialize(
}
if (0 != res) {
pdksShare = dk4str_dup(rebuf, NULL);
+ UpdateWxsShare();
if (NULL == pdksShare) {
errc = ERROR_MEMORY;
goto finished;
@@ -700,6 +693,7 @@ Dk4WxApplicationHelper::Initialize(
} else {
pdksSysconf = dk4str_dup(rebuf, NULL);
pdksShare = dk4str_dup(rebuf, NULL);
+ UpdateWxsShare();
if ((NULL == pdksSysconf) || (NULL == pdksShare)) {
errc = ERROR_MEMORY;
goto finished;
@@ -708,7 +702,7 @@ Dk4WxApplicationHelper::Initialize(
}
-#line 1315 "Dk4WxApplicationHelper.cpt"
+#line 1549 "Dk4WxApplicationHelper.cpt"
/* Containers and iterators for string tables and preferences.
*/
@@ -747,7 +741,7 @@ Dk4WxApplicationHelper::Initialize(
}
-#line 1352 "Dk4WxApplicationHelper.cpt"
+#line 1586 "Dk4WxApplicationHelper.cpt"
/* Read preference files.
*/
@@ -768,14 +762,19 @@ Dk4WxApplicationHelper::Initialize(
iDkEncoding,
(
(DK4_ENCODING_UTF8 == iDkEncoding)
- ? DK4_FILE_ENCODING_UTF8 : DK4_FILE_ENCODING_ASCII
+ ? DK4_FILE_ENCODING_UTF8 :
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
),
pn
);
}
-#line 1378 "Dk4WxApplicationHelper.cpt"
+#line 1617 "Dk4WxApplicationHelper.cpt"
/* Localized basic strings.
*/
@@ -786,7 +785,7 @@ Dk4WxApplicationHelper::Initialize(
nBasicStrings = Dk4WxApplicationHelper::StringTableSize(ppBasicStrings);
-#line 1387 "Dk4WxApplicationHelper.cpt"
+#line 1626 "Dk4WxApplicationHelper.cpt"
/* Finally mark success.
*/
@@ -797,53 +796,53 @@ Dk4WxApplicationHelper::Initialize(
finished:
if (!(back)) {
-#line 1396 "Dk4WxApplicationHelper.cpt"
+#line 1635 "Dk4WxApplicationHelper.cpt"
switch (errc) {
case ERROR_MEMORY : {
-#line 1398 "Dk4WxApplicationHelper.cpt"
+#line 1637 "Dk4WxApplicationHelper.cpt"
msgbtext = dkwxah_msgb_texts[1];
msgbtitle = dkwxah_msgb_texts[0];
} break;
case ERROR_HOSTNAME : {
-#line 1402 "Dk4WxApplicationHelper.cpt"
+#line 1641 "Dk4WxApplicationHelper.cpt"
msgbtext = dkwxah_msgb_texts[2];
msgbtitle = dkwxah_msgb_texts[0];
} break;
case ERROR_LANG_REG_ENC : {
-#line 1406 "Dk4WxApplicationHelper.cpt"
+#line 1645 "Dk4WxApplicationHelper.cpt"
msgbtext = dkwxah_msgb_texts[3];
msgbtitle = dkwxah_msgb_texts[0];
} break;
case ERROR_LOGNAME : {
-#line 1410 "Dk4WxApplicationHelper.cpt"
+#line 1649 "Dk4WxApplicationHelper.cpt"
msgbtext = dkwxah_msgb_texts[4];
msgbtitle = dkwxah_msgb_texts[0];
} break;
case ERROR_HOMEDIR : {
-#line 1414 "Dk4WxApplicationHelper.cpt"
+#line 1653 "Dk4WxApplicationHelper.cpt"
msgbtext = dkwxah_msgb_texts[5];
msgbtitle = dkwxah_msgb_texts[0];
} break;
case ERROR_EXECUTABLE : {
-#line 1418 "Dk4WxApplicationHelper.cpt"
+#line 1657 "Dk4WxApplicationHelper.cpt"
msgbtext = dkwxah_msgb_texts[6];
msgbtitle = dkwxah_msgb_texts[0];
} break;
case ERROR_EXEC_TOO_LONG : {
-#line 1422 "Dk4WxApplicationHelper.cpt"
+#line 1661 "Dk4WxApplicationHelper.cpt"
msgbtext = dkwxah_msgb_texts[7];
msgbtitle = dkwxah_msgb_texts[0];
} break;
case ERROR_ARGUMENTS : {
-#line 1426 "Dk4WxApplicationHelper.cpt"
+#line 1665 "Dk4WxApplicationHelper.cpt"
msgbtext = dkwxah_msgb_texts[8];
msgbtitle = dkwxah_msgb_texts[0];
} break;
@@ -857,7 +856,7 @@ Dk4WxApplicationHelper::Initialize(
}
-#line 1438 "Dk4WxApplicationHelper.cpt"
+#line 1677 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -870,7 +869,7 @@ Dk4WxApplicationHelper::InternalCleanup(void)
dk4_wx_pref_t *pptr;
-#line 1449 "Dk4WxApplicationHelper.cpt"
+#line 1688 "Dk4WxApplicationHelper.cpt"
bActive = false; // Object can not longer be used.
ppBasicStrings = NULL;
pcwxsArgv0 = NULL;
@@ -919,22 +918,24 @@ Dk4WxApplicationHelper::InternalCleanup(void)
#if 0
/* Leave these integer variables as is.
*/
- iDkEncoding = DK4_ENCODING_ASCII;
- iWxEncoding = DK4_ENCODING_ASCII;
- iFiEncoding = DK4_FILE_ENCODING_ASCII;
+ iDkEncoding = DK4_ENCODING_PLAIN;
+ iWxEncoding = DK4_ENCODING_PLAIN;
+ iFiEncoding = DK4_FILE_ENCODING_PLAIN;
#endif
dk4mem_release(pdksRegion);
dk4mem_release(pdksLanguage);
dk4mem_release(pdksShare);
+ dk4mem_release(pwxsShare);
dk4mem_release(pdksSysconf);
dk4mem_release(pdksApp);
dk4mem_release(pdksHost);
+ dk4mem_release(pcdksArgv0);
dk4mem_release(pwxsApp);
dk4mem_release(pdksLogname);
dk4mem_release(pdksHome);
-#line 1511 "Dk4WxApplicationHelper.cpt"
+#line 1752 "Dk4WxApplicationHelper.cpt"
}
@@ -944,14 +945,14 @@ Dk4WxApplicationHelper::Cleanup(void)
{
-#line 1519 "Dk4WxApplicationHelper.cpt"
+#line 1760 "Dk4WxApplicationHelper.cpt"
{
wxCriticalSectionLocker lock(csProtect);
InternalCleanup();
}
-#line 1524 "Dk4WxApplicationHelper.cpt"
+#line 1765 "Dk4WxApplicationHelper.cpt"
}
@@ -965,11 +966,11 @@ Dk4WxApplicationHelper::~Dk4WxApplicationHelper()
{
-#line 1536 "Dk4WxApplicationHelper.cpt"
+#line 1777 "Dk4WxApplicationHelper.cpt"
InternalCleanup();
-#line 1538 "Dk4WxApplicationHelper.cpt"
+#line 1779 "Dk4WxApplicationHelper.cpt"
}
@@ -982,7 +983,7 @@ Dk4WxApplicationHelper::~Dk4WxApplicationHelper()
/* ************************************************************************ */
-#line 1546 "Dk4WxApplicationHelper.cpt"
+#line 1787 "Dk4WxApplicationHelper.cpt"
bool
@@ -994,12 +995,12 @@ Dk4WxApplicationHelper::InternalStringToWx(
bool back = false;
-#line 1556 "Dk4WxApplicationHelper.cpt"
+#line 1797 "Dk4WxApplicationHelper.cpt"
res = dk4recwx_dkchar_to_wxchar(dptr,dsz,iWxEncoding,sptr,iDkEncoding,erp);
if (0 != res) { back = true; }
-#line 1559 "Dk4WxApplicationHelper.cpt"
+#line 1800 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1014,12 +1015,12 @@ Dk4WxApplicationHelper::InternalStringToDk(
bool back = false;
-#line 1572 "Dk4WxApplicationHelper.cpt"
+#line 1813 "Dk4WxApplicationHelper.cpt"
res = dk4recwx_wxchar_to_dkchar(dptr,dsz,iDkEncoding,sptr,iWxEncoding,erp);
if (0 != res) { back = true; }
-#line 1575 "Dk4WxApplicationHelper.cpt"
+#line 1816 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1039,8 +1040,8 @@ Dk4WxApplicationHelper::InternalFindDataFile(
bool back = false;
-#line 1593 "Dk4WxApplicationHelper.cpt"
- for (passno = 0; ((passno < maxpass) && (!(back))); passno++) {
+#line 1834 "Dk4WxApplicationHelper.cpt"
+ for (passno = 0; ((passno <= maxpass) && (!(back))); passno++) {
res = dk4fs_data_one(
fnb, szfnb, sfn,
pdksShare, pdksHome, pdksApp, pcdksGroup,
@@ -1050,7 +1051,7 @@ Dk4WxApplicationHelper::InternalFindDataFile(
if (0 != res) { back = true; }
}
-#line 1602 "Dk4WxApplicationHelper.cpt"
+#line 1843 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1073,13 +1074,13 @@ Dk4WxApplicationHelper::InternalFindDataFile(
bool back = false;
-#line 1623 "Dk4WxApplicationHelper.cpt"
+#line 1864 "Dk4WxApplicationHelper.cpt"
back = InternalFindDataFile(buf, szbuf, sfn, maxpass, aco);
if (back) {
back = InternalStringToWx(fnb, szfnb, buf, NULL);
}
-#line 1627 "Dk4WxApplicationHelper.cpt"
+#line 1868 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1102,7 +1103,7 @@ Dk4WxApplicationHelper::InternalGetStringTable(
size_t szfnb = DK4_SIZEOF(fnb,dkChar);
-#line 1648 "Dk4WxApplicationHelper.cpt"
+#line 1889 "Dk4WxApplicationHelper.cpt"
tabptr = (dk4_wx_string_table_t *)dk4sto_it_find_like(iStt, tableName, 1);
if (NULL == tabptr) {
if (InternalFindDataFile(fnb, szfnb, tableName, DK4_FS_DATA_MAX_SYS, 1)) {
@@ -1131,7 +1132,7 @@ Dk4WxApplicationHelper::InternalGetStringTable(
}
}
-#line 1675 "Dk4WxApplicationHelper.cpt"
+#line 1916 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1147,7 +1148,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
bool back = false;
-#line 1689 "Dk4WxApplicationHelper.cpt"
+#line 1930 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
back = true;
for (i = 0; i < sz; i++) {
@@ -1157,7 +1158,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
}
}
-#line 1697 "Dk4WxApplicationHelper.cpt"
+#line 1938 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1173,7 +1174,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
bool back = false;
-#line 1711 "Dk4WxApplicationHelper.cpt"
+#line 1952 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
back = true;
for (i = 0; i < sz; i++) {
@@ -1183,7 +1184,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
}
}
-#line 1719 "Dk4WxApplicationHelper.cpt"
+#line 1960 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1199,7 +1200,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
bool back = false;
-#line 1733 "Dk4WxApplicationHelper.cpt"
+#line 1974 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
back = true;
for (i = 0; i < sz; i++) {
@@ -1209,7 +1210,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
}
}
-#line 1741 "Dk4WxApplicationHelper.cpt"
+#line 1982 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1225,7 +1226,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
bool back = false;
-#line 1755 "Dk4WxApplicationHelper.cpt"
+#line 1996 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
back = true;
for (i = 0; i < sz; i++) {
@@ -1235,7 +1236,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
}
}
-#line 1763 "Dk4WxApplicationHelper.cpt"
+#line 2004 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1251,7 +1252,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
bool back = false;
-#line 1777 "Dk4WxApplicationHelper.cpt"
+#line 2018 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
back = true;
for (i = 0; i < sz; i++) {
@@ -1261,7 +1262,7 @@ Dk4WxApplicationHelper::InternalSetMultiple(
}
}
-#line 1785 "Dk4WxApplicationHelper.cpt"
+#line 2026 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1285,7 +1286,7 @@ Dk4WxApplicationHelper::InternalGetMultiple(
bool back = false;
-#line 1807 "Dk4WxApplicationHelper.cpt"
+#line 2048 "Dk4WxApplicationHelper.cpt"
back = true;
for (i = 0; i < sz; i++) {
l = 0L;
@@ -1312,7 +1313,7 @@ Dk4WxApplicationHelper::InternalGetMultiple(
}
-#line 1832 "Dk4WxApplicationHelper.cpt"
+#line 2073 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1336,7 +1337,7 @@ Dk4WxApplicationHelper::InternalGetMultiple(
bool back = false;
-#line 1854 "Dk4WxApplicationHelper.cpt"
+#line 2095 "Dk4WxApplicationHelper.cpt"
back = true;
for (i = 0; i < sz; i++) {
l = 0L;
@@ -1371,7 +1372,7 @@ Dk4WxApplicationHelper::InternalGetMultiple(
}
-#line 1887 "Dk4WxApplicationHelper.cpt"
+#line 2128 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1389,13 +1390,13 @@ Dk4WxApplicationHelper::InternalGetMultiple(
bool back = false;
-#line 1903 "Dk4WxApplicationHelper.cpt"
+#line 2144 "Dk4WxApplicationHelper.cpt"
back = true;
for (i = 0; i < sz; i++) {
l = 0L;
-#line 1907 "Dk4WxApplicationHelper.cpt"
+#line 2148 "Dk4WxApplicationHelper.cpt"
if (conf.Read(names[i], &l)) {
array[i] = l;
} else {
@@ -1405,61 +1406,61 @@ Dk4WxApplicationHelper::InternalGetMultiple(
}
if (NULL != pptr) {
-#line 1915 "Dk4WxApplicationHelper.cpt"
+#line 2156 "Dk4WxApplicationHelper.cpt"
-#line 1916 "Dk4WxApplicationHelper.cpt"
+#line 2157 "Dk4WxApplicationHelper.cpt"
-#line 1917 "Dk4WxApplicationHelper.cpt"
+#line 2158 "Dk4WxApplicationHelper.cpt"
#if DK4_SIZEOF_WXCHAR > 1
-#line 1919 "Dk4WxApplicationHelper.cpt"
+#line 2160 "Dk4WxApplicationHelper.cpt"
if (0 != dk4strw_is_bool(pptr->value)) {
if (0 != dk4strw_is_on(pptr->value)) {
array[i] = true;
-#line 1922 "Dk4WxApplicationHelper.cpt"
+#line 2163 "Dk4WxApplicationHelper.cpt"
} else {
array[i] = false;
-#line 1924 "Dk4WxApplicationHelper.cpt"
+#line 2165 "Dk4WxApplicationHelper.cpt"
}
} else {
-#line 1926 "Dk4WxApplicationHelper.cpt"
+#line 2167 "Dk4WxApplicationHelper.cpt"
back = false;
}
#else
-#line 1930 "Dk4WxApplicationHelper.cpt"
+#line 2171 "Dk4WxApplicationHelper.cpt"
if (0 != dk4str8_is_bool(pptr->value)) {
if (0 != dk4str8_is_on(pptr->value)) {
array[i] = true;
-#line 1933 "Dk4WxApplicationHelper.cpt"
+#line 2174 "Dk4WxApplicationHelper.cpt"
} else {
array[i] = false;
-#line 1935 "Dk4WxApplicationHelper.cpt"
+#line 2176 "Dk4WxApplicationHelper.cpt"
}
} else {
back = false;
-#line 1938 "Dk4WxApplicationHelper.cpt"
+#line 2179 "Dk4WxApplicationHelper.cpt"
}
#endif
} else {
-#line 1941 "Dk4WxApplicationHelper.cpt"
+#line 2182 "Dk4WxApplicationHelper.cpt"
}
}
}
-#line 1945 "Dk4WxApplicationHelper.cpt"
+#line 2186 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1486,7 +1487,7 @@ Dk4WxApplicationHelper::InternalGetMultiple(
bool back = false;
-#line 1970 "Dk4WxApplicationHelper.cpt"
+#line 2211 "Dk4WxApplicationHelper.cpt"
back = true;
for (i = 0; i < sz; i++) {
l = 0.0;
@@ -1519,7 +1520,7 @@ Dk4WxApplicationHelper::InternalGetMultiple(
}
-#line 2001 "Dk4WxApplicationHelper.cpt"
+#line 2242 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1538,21 +1539,22 @@ Dk4WxApplicationHelper::InternalGetMultiple(
bool back = false;
-#line 2018 "Dk4WxApplicationHelper.cpt"
+#line 2259 "Dk4WxApplicationHelper.cpt"
back = true;
for (i = 0; i < sz; i++) {
if ((NULL == array[i]) || (ov)) {
wxString value = wxEmptyString;
if (conf.Read(names[i], &value)) {
- vptr = value.c_str();
+ wxCStrData valuestrdata = value.c_str();
+ vptr = (wxChar const *)valuestrdata;
if (NULL != vptr) {
- nptr = dk4strx_dup(vptr, NULL);
- if (NULL != nptr) {
- if (NULL != array[i]) { dk4mem_free(array[i]); }
- array[i] = nptr;
- } else {
- back = false;
- }
+ nptr = dk4strx_dup(vptr, NULL);
+ if (NULL != nptr) {
+ if (NULL != array[i]) { dk4mem_free(array[i]); }
+ array[i] = nptr;
+ } else {
+ back = false;
+ }
} else {
back = false;
}
@@ -1575,7 +1577,7 @@ Dk4WxApplicationHelper::InternalGetMultiple(
}
-#line 2053 "Dk4WxApplicationHelper.cpt"
+#line 2295 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1591,7 +1593,7 @@ Dk4WxApplicationHelper::InternalGetMultiple(
/* ************************************************************************ */
-#line 2064 "Dk4WxApplicationHelper.cpt"
+#line 2306 "Dk4WxApplicationHelper.cpt"
bool
@@ -1606,7 +1608,7 @@ Dk4WxApplicationHelper::FindDataFile(
bool back = false;
-#line 2077 "Dk4WxApplicationHelper.cpt"
+#line 2319 "Dk4WxApplicationHelper.cpt"
if ((NULL != fnb) && (NULL != sfn) && (0 < szfnb)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1614,7 +1616,7 @@ Dk4WxApplicationHelper::FindDataFile(
}
}
-#line 2083 "Dk4WxApplicationHelper.cpt"
+#line 2325 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1635,7 +1637,7 @@ Dk4WxApplicationHelper::FindDataFile(
bool back = false;
-#line 2102 "Dk4WxApplicationHelper.cpt"
+#line 2344 "Dk4WxApplicationHelper.cpt"
if ((NULL != fnb) && (NULL != sfn) && (0 < szfnb)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1643,7 +1645,7 @@ Dk4WxApplicationHelper::FindDataFile(
}
}
-#line 2108 "Dk4WxApplicationHelper.cpt"
+#line 2350 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1654,16 +1656,19 @@ Dk4WxApplicationHelper::FindDataFile(
int
Dk4WxApplicationHelper::GetDkEncoding(void)
{
- int back = DK4_ENCODING_ASCII;
+ int back = DK4_ENCODING_PLAIN;
-#line 2120 "Dk4WxApplicationHelper.cpt"
+#line 2362 "Dk4WxApplicationHelper.cpt"
+#if DK4_ON_WINDOWS
+ back = DK4_ENCODING_WIN1252;
+#endif
{
wxCriticalSectionLocker lock(csProtect);
back = iDkEncoding;
}
-#line 2124 "Dk4WxApplicationHelper.cpt"
+#line 2369 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1672,16 +1677,19 @@ Dk4WxApplicationHelper::GetDkEncoding(void)
int
Dk4WxApplicationHelper::GetWxEncoding(void)
{
- int back = DK4_ENCODING_ASCII;
+ int back = DK4_ENCODING_PLAIN;
-#line 2134 "Dk4WxApplicationHelper.cpt"
+#line 2379 "Dk4WxApplicationHelper.cpt"
+#if DK4_ON_WINDOWS
+ back = DK4_ENCODING_WIN1252;
+#endif
{
wxCriticalSectionLocker lock(csProtect);
back = iWxEncoding;
}
-#line 2138 "Dk4WxApplicationHelper.cpt"
+#line 2386 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1690,16 +1698,19 @@ Dk4WxApplicationHelper::GetWxEncoding(void)
int
Dk4WxApplicationHelper::GetFiEncoding(void)
{
- int back = DK4_ENCODING_ASCII;
+ int back = DK4_FILE_ENCODING_PLAIN;
-#line 2148 "Dk4WxApplicationHelper.cpt"
+#line 2396 "Dk4WxApplicationHelper.cpt"
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#endif
{
wxCriticalSectionLocker lock(csProtect);
back = iFiEncoding;
}
-#line 2152 "Dk4WxApplicationHelper.cpt"
+#line 2403 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1715,7 +1726,7 @@ Dk4WxApplicationHelper::GetStringTable(
size_t sz = 0;
-#line 2166 "Dk4WxApplicationHelper.cpt"
+#line 2417 "Dk4WxApplicationHelper.cpt"
if ((NULL != tableName) && (NULL != defaultTable)) {
sz = Dk4WxApplicationHelper::StringTableSize(defaultTable);
if (0 < sz) {
@@ -1728,7 +1739,7 @@ Dk4WxApplicationHelper::GetStringTable(
if (NULL == back) { back = defaultTable; }
-#line 2177 "Dk4WxApplicationHelper.cpt"
+#line 2428 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1742,7 +1753,7 @@ Dk4WxApplicationHelper::GetBasicString(
const wxChar *back = NULL;
-#line 2189 "Dk4WxApplicationHelper.cpt"
+#line 2440 "Dk4WxApplicationHelper.cpt"
{
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1761,7 +1772,7 @@ Dk4WxApplicationHelper::GetBasicString(
}
}
-#line 2206 "Dk4WxApplicationHelper.cpt"
+#line 2457 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1775,7 +1786,7 @@ Dk4WxApplicationHelper::GetBasicStrings(
const wxChar * const *back = NULL;
-#line 2218 "Dk4WxApplicationHelper.cpt"
+#line 2469 "Dk4WxApplicationHelper.cpt"
{
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1790,7 +1801,7 @@ Dk4WxApplicationHelper::GetBasicStrings(
}
}
-#line 2231 "Dk4WxApplicationHelper.cpt"
+#line 2482 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1802,12 +1813,15 @@ Dk4WxApplicationHelper::StringToWx(
)
{
int res = 0;
- int wxe = DK4_ENCODING_ASCII;
- int dke = DK4_ENCODING_ASCII;
+ int wxe = DK4_ENCODING_PLAIN;
+ int dke = DK4_ENCODING_PLAIN;
bool back = false;
-#line 2246 "Dk4WxApplicationHelper.cpt"
+#line 2497 "Dk4WxApplicationHelper.cpt"
+#if DK4_ON_WINDOWS
+ wxe = dke = DK4_ENCODING_WIN1252;
+#endif
if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
{
wxCriticalSectionLocker lock(csProtect);
@@ -1818,7 +1832,7 @@ Dk4WxApplicationHelper::StringToWx(
if (0 != res) { back = true; }
}
-#line 2255 "Dk4WxApplicationHelper.cpt"
+#line 2509 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1830,12 +1844,15 @@ Dk4WxApplicationHelper::StringToDk(
)
{
int res = 0;
- int wxe = DK4_ENCODING_ASCII;
- int dke = DK4_ENCODING_ASCII;
+ int wxe = DK4_ENCODING_PLAIN;
+ int dke = DK4_ENCODING_PLAIN;
bool back = false;
-#line 2270 "Dk4WxApplicationHelper.cpt"
+#line 2524 "Dk4WxApplicationHelper.cpt"
+#if DK4_ON_WINDOWS
+ wxe = dke = DK4_ENCODING_WIN1252;
+#endif
if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
{
wxCriticalSectionLocker lock(csProtect);
@@ -1846,7 +1863,7 @@ Dk4WxApplicationHelper::StringToDk(
if (0 != res) { back = true; }
}
-#line 2279 "Dk4WxApplicationHelper.cpt"
+#line 2536 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1858,9 +1875,12 @@ Dk4WxApplicationHelper::StringToChar(
)
{
int res = 0;
- int wxe = DK4_ENCODING_ASCII;
- int dke = DK4_ENCODING_ASCII;
+ int wxe = DK4_ENCODING_PLAIN;
+ int dke = DK4_ENCODING_PLAIN;
bool back = false;
+#if DK4_ON_WINDOWS
+ wxe = dke = DK4_ENCODING_WIN1252;
+#endif
if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
{
wxCriticalSectionLocker lock(csProtect);
@@ -1868,8 +1888,8 @@ Dk4WxApplicationHelper::StringToChar(
dke = iDkEncoding;
}
if (DK4_ENCODING_UTF8 != dke) {
- if (DK4_ENCODING_ANSI != dke) {
- dke = DK4_ENCODING_ASCII;
+ if (DK4_ENCODING_WIN1252 != dke) {
+ dke = DK4_ENCODING_PLAIN;
}
}
res = dk4recwx_wxchar_to_char(dptr, dsz, dke, sptr, wxe, erp);
@@ -1888,7 +1908,7 @@ Dk4WxApplicationHelper::SetMultiple(
bool back = false;
-#line 2319 "Dk4WxApplicationHelper.cpt"
+#line 2579 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1898,7 +1918,7 @@ Dk4WxApplicationHelper::SetMultiple(
}
}
-#line 2327 "Dk4WxApplicationHelper.cpt"
+#line 2587 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1912,7 +1932,7 @@ Dk4WxApplicationHelper::SetMultiple(
bool back = false;
-#line 2339 "Dk4WxApplicationHelper.cpt"
+#line 2599 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1922,7 +1942,7 @@ Dk4WxApplicationHelper::SetMultiple(
}
}
-#line 2347 "Dk4WxApplicationHelper.cpt"
+#line 2607 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1936,7 +1956,7 @@ Dk4WxApplicationHelper::SetMultiple(
bool back = false;
-#line 2359 "Dk4WxApplicationHelper.cpt"
+#line 2619 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1946,7 +1966,7 @@ Dk4WxApplicationHelper::SetMultiple(
}
}
-#line 2367 "Dk4WxApplicationHelper.cpt"
+#line 2627 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1960,7 +1980,7 @@ Dk4WxApplicationHelper::SetMultiple(
bool back = false;
-#line 2379 "Dk4WxApplicationHelper.cpt"
+#line 2639 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1970,7 +1990,7 @@ Dk4WxApplicationHelper::SetMultiple(
}
}
-#line 2387 "Dk4WxApplicationHelper.cpt"
+#line 2647 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -1984,7 +2004,7 @@ Dk4WxApplicationHelper::SetMultiple(
bool back = false;
-#line 2399 "Dk4WxApplicationHelper.cpt"
+#line 2659 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -1994,7 +2014,7 @@ Dk4WxApplicationHelper::SetMultiple(
}
}
-#line 2407 "Dk4WxApplicationHelper.cpt"
+#line 2667 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -2008,7 +2028,7 @@ Dk4WxApplicationHelper::GetMultiple(
bool back = false;
-#line 2419 "Dk4WxApplicationHelper.cpt"
+#line 2679 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -2018,7 +2038,7 @@ Dk4WxApplicationHelper::GetMultiple(
}
}
-#line 2427 "Dk4WxApplicationHelper.cpt"
+#line 2687 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -2032,7 +2052,7 @@ Dk4WxApplicationHelper::GetMultiple(
bool back = false;
-#line 2439 "Dk4WxApplicationHelper.cpt"
+#line 2699 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -2042,7 +2062,7 @@ Dk4WxApplicationHelper::GetMultiple(
}
}
-#line 2447 "Dk4WxApplicationHelper.cpt"
+#line 2707 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -2056,7 +2076,7 @@ Dk4WxApplicationHelper::GetMultiple(
bool back = false;
-#line 2459 "Dk4WxApplicationHelper.cpt"
+#line 2719 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -2066,7 +2086,7 @@ Dk4WxApplicationHelper::GetMultiple(
}
}
-#line 2467 "Dk4WxApplicationHelper.cpt"
+#line 2727 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -2080,7 +2100,7 @@ Dk4WxApplicationHelper::GetMultiple(
bool back = false;
-#line 2479 "Dk4WxApplicationHelper.cpt"
+#line 2739 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -2090,7 +2110,7 @@ Dk4WxApplicationHelper::GetMultiple(
}
}
-#line 2487 "Dk4WxApplicationHelper.cpt"
+#line 2747 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -2104,7 +2124,7 @@ Dk4WxApplicationHelper::GetMultiple(
bool back = false;
-#line 2499 "Dk4WxApplicationHelper.cpt"
+#line 2759 "Dk4WxApplicationHelper.cpt"
if ((NULL != names) && (NULL != array) && (0 < sz)) {
wxCriticalSectionLocker lock(csProtect);
if (bActive) {
@@ -2114,7 +2134,51 @@ Dk4WxApplicationHelper::GetMultiple(
}
}
-#line 2507 "Dk4WxApplicationHelper.cpt"
+#line 2767 "Dk4WxApplicationHelper.cpt"
+ return back;
+}
+
+
+
+bool
+Dk4WxApplicationHelper::SetString(const wxString & key, const wxString & value)
+{
+ bool back = false;
+
+
+#line 2777 "Dk4WxApplicationHelper.cpt"
+ {
+ wxCriticalSectionLocker lock(csProtect);
+ if (bActive) {
+ wxConfig conf(pwxsApp, pcwxsVendor);
+ back = conf.Write(key, value);
+ }
+ }
+
+
+#line 2785 "Dk4WxApplicationHelper.cpt"
+ return back;
+}
+
+
+
+bool
+Dk4WxApplicationHelper::GetString(const wxString & key, wxString *pvalue)
+{
+ bool back = false;
+
+
+#line 2795 "Dk4WxApplicationHelper.cpt"
+ if (NULL != pvalue) {
+ wxCriticalSectionLocker lock(csProtect);
+ if (bActive) {
+ wxConfig conf(pwxsApp, pcwxsVendor);
+ back = conf.Read(key, pvalue);
+ }
+ }
+
+
+#line 2803 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -2127,48 +2191,53 @@ Dk4WxApplicationHelper::GetMultiple(
/* ************************************************************************ */
-#line 2515 "Dk4WxApplicationHelper.cpt"
+#line 2811 "Dk4WxApplicationHelper.cpt"
void
Dk4WxApplicationHelper::CorrectPosition(
- int & x, int & y, int & w, int & h
+ int & x, int & y, int & w, int & h, bool cn
)
{
wxSize scsz;
-#line 2524 "Dk4WxApplicationHelper.cpt"
+#line 2820 "Dk4WxApplicationHelper.cpt"
scsz = wxGetDisplaySize();
- if (0 > x) { x = (scsz.x - w) / 2; }
- if (0 > y) { y = (scsz.y - h) / 2; }
+ if (cn) {
+ /*
+ Negative coordinates mean x and y not defined, center window.
+ */
+ if (0 > x) { x = (scsz.x - w) / 2; }
+ if (0 > y) { y = (scsz.y - h) / 2; }
+ }
if (scsz.x < (x + w)) { x = scsz.x - w; }
if (scsz.y < (y + h)) { y = scsz.y - h; }
if (0 > x) { x = 0; }
if (0 > y) { y = 0; }
-#line 2532 "Dk4WxApplicationHelper.cpt"
+#line 2833 "Dk4WxApplicationHelper.cpt"
}
void
Dk4WxApplicationHelper::CorrectPosition(
- wxWindow & wnd
+ wxWindow & wnd, bool cn
)
{
int x, y, w, h;
-#line 2543 "Dk4WxApplicationHelper.cpt"
+#line 2844 "Dk4WxApplicationHelper.cpt"
wnd.GetPosition(&x, &y);
wnd.GetSize(&w, &h);
- Dk4WxApplicationHelper::CorrectPosition(x, y, w, h);
+ Dk4WxApplicationHelper::CorrectPosition(x, y, w, h, cn);
wnd.SetSize(x, y, w, h);
-#line 2548 "Dk4WxApplicationHelper.cpt"
+#line 2849 "Dk4WxApplicationHelper.cpt"
}
@@ -2191,9 +2260,17 @@ Dk4WxApplicationHelper::ChooseChildPosition(
bool findy = false;
-#line 2569 "Dk4WxApplicationHelper.cpt"
+#line 2870 "Dk4WxApplicationHelper.cpt"
+#if 0
p.GetPosition(&px, &py);
p.GetSize(&pw, &ph);
+#else
+ wxRect re = p.GetScreenRect();
+ px = re.GetX();
+ py = re.GetY();
+ pw = re.GetWidth();
+ ph = re.GetHeight();
+#endif
c.GetSize(&cw, &ch);
if (beside) {
/* Attempt right side */
@@ -2264,12 +2341,12 @@ Dk4WxApplicationHelper::ChooseChildPosition(
if (!done) {
cx = px + (pw - cw) / 2;
cy = py + (ph - ch) / 2;
- Dk4WxApplicationHelper::CorrectPosition(cx, cy, cw, ch);
+ Dk4WxApplicationHelper::CorrectPosition(cx, cy, cw, ch, false);
c.SetSize(cx, cy, cw, ch);
}
-#line 2645 "Dk4WxApplicationHelper.cpt"
+#line 2954 "Dk4WxApplicationHelper.cpt"
}
@@ -2280,12 +2357,12 @@ Dk4WxApplicationHelper::StringTableSize(const wxChar * const *sttptr)
size_t back = 0;
-#line 2654 "Dk4WxApplicationHelper.cpt"
+#line 2963 "Dk4WxApplicationHelper.cpt"
if (NULL != sttptr) {
while (NULL != *(sttptr++)) { back++; }
}
-#line 2657 "Dk4WxApplicationHelper.cpt"
+#line 2966 "Dk4WxApplicationHelper.cpt"
return back;
}
@@ -2297,6 +2374,9 @@ Dk4WxApplicationHelper::ReleaseWxcharStringArray(
)
{
wxChar **ap;
+
+
+#line 2978 "Dk4WxApplicationHelper.cpt"
if ((NULL != array) && (0 < sz)) {
ap = array;
while (0 < sz--) {
@@ -2305,5 +2385,155 @@ Dk4WxApplicationHelper::ReleaseWxcharStringArray(
}
if (ea) { dk4mem_free(ap); }
}
+
+
+#line 2987 "Dk4WxApplicationHelper.cpt"
+}
+
+
+
+const
+dkChar *
+Dk4WxApplicationHelper::GetDkArgv0(void)
+{
+ return ((const dkChar *)pcdksArgv0);
}
+
+
+const
+dkChar *
+Dk4WxApplicationHelper::GetDkGroupName(void)
+{
+ return(pcdksGroup);
+}
+
+
+
+void
+Dk4WxApplicationHelper::UpdateWxsShare(void)
+{
+ wxChar buf[DK4_MAX_PATH];
+ wxChar *np;
+ bool res;
+ if (NULL != pdksShare) {
+ res = InternalStringToWx(buf, DK4_SIZEOF(buf,wxChar), pdksShare, NULL);
+ if (res) {
+ np = dk4strx_dup(buf, NULL);
+ if (NULL != np) {
+ dk4mem_release(pwxsShare);
+ pwxsShare = np;
+ }
+ }
+ }
+}
+
+
+
+const
+wxChar *
+Dk4WxApplicationHelper::GetWxsShare(void) const
+{
+ return ((wxChar const *)pwxsShare);
+}
+
+
+
+bool
+Dk4WxApplicationHelper::InternalFindHelpFile(
+ dkChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+)
+{
+ int passno = 0;
+ int res = 0;
+ bool back = false;
+
+
+#line 3049 "Dk4WxApplicationHelper.cpt"
+ for (passno = 0; ((passno <= DK4_FS_DOC_MAX) && (!(back))); passno++) {
+ res = dk4fs_doc_one(
+ fnb, szfnb, sfn, pdksShare, pdksApp, pcdksGroup,
+ pdksLanguage, pdksRegion, passno, NULL
+ );
+ if (0 != res) {
+
+#line 3055 "Dk4WxApplicationHelper.cpt"
+ back = true;
+ }
+ }
+
+
+#line 3059 "Dk4WxApplicationHelper.cpt"
+ return back;
+}
+
+
+#if DK4_SIZEOF_WXCHAR != DK4_CHAR_SIZE
+
+bool
+Dk4WxApplicationHelper::InternalFindHelpFile(
+ wxChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+)
+{
+ dkChar buf[DK4_MAX_PATH];
+ size_t szbuf = DK4_SIZEOF(buf,dkChar);
+ bool back = false;
+
+
+#line 3076 "Dk4WxApplicationHelper.cpt"
+ back = InternalFindHelpFile(buf, szbuf, sfn);
+ if (back) {
+ back = InternalStringToWx(fnb, szfnb, buf, NULL);
+ }
+
+
+#line 3081 "Dk4WxApplicationHelper.cpt"
+ return back;
+}
+
+#endif
+
+bool
+Dk4WxApplicationHelper::FindHelpFile(
+ dkChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+)
+{
+ bool back = false;
+ if ((NULL != fnb) && (NULL != sfn) && (0 < szfnb)) {
+ wxCriticalSectionLocker lock(csProtect);
+ if (bActive) {
+ back = InternalFindHelpFile(fnb, szfnb, sfn);
+ }
+ }
+ return back;
+}
+
+#if DK4_SIZEOF_WXCHAR != DK4_CHAR_SIZE
+
+bool
+Dk4WxApplicationHelper::FindHelpFile(
+ wxChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+)
+{
+ bool back = false;
+ if ((NULL != fnb) && (NULL != sfn) && (0 < szfnb)) {
+ wxCriticalSectionLocker lock(csProtect);
+ if (bActive) {
+ back = InternalFindHelpFile(fnb, szfnb, sfn);
+ }
+ }
+ return back;
+}
+
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/Dk4WxApplicationHelper.cpt b/support/dktools/Dk4WxApplicationHelper.cpt
index f81e068a47..75c83657a5 100644
--- a/support/dktools/Dk4WxApplicationHelper.cpt
+++ b/support/dktools/Dk4WxApplicationHelper.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -12,31 +12,69 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
#ifndef DK4FSH_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fs.h"
+#else
+#include <dktools-4/dk4fs.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -71,7 +109,11 @@ license = bsd
#endif
#ifndef DK4WXSTT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxstt.h"
+#else
+#include <dktools-4/dk4wxstt.h>
+#endif
#endif
@@ -108,6 +150,14 @@ class Dk4WxApplicationHelper
*/
wxChar *pwxsApp;
+ /** The /usr/share equivalent directory.
+ */
+ wxChar *pwxsShare;
+
+ /** First command line argument (allocated).
+ */
+ dkChar *pcdksArgv0;
+
/** Host name.
*/
dkChar *pdksHost;
@@ -230,6 +280,50 @@ class Dk4WxApplicationHelper
#endif
+ /** Search for documentation or help file.
+ @param fnb File name buffer.
+ @param szfnb Buffer size (number of dkChar).
+ @param sfn Short file name.
+
+ The method searches for the file <i>sfn</i> in the
+ following directories, first file found is returned:
+ - /usr/share/<i>group</i>/help/<i>program</i>/<i>language</i>/<i>region</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/<i>language</i>/<i>region</i>
+ - /usr/share/<i>group</i>/help/<i>program</i>/<i>language</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/<i>language</i>
+ - /usr/share/<i>group</i>/help/<i>program</i>/en
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/en
+ - /usr/share/<i>group</i>/help/<i>program</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>
+
+ For a relocated installation replace /usr/share by ${datadir}.
+
+ @return True if the file was found (name in fnb), false otherwise.
+ */
+ bool
+ InternalFindHelpFile(
+ dkChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+ );
+
+#if DK4_SIZEOF_WXCHAR != DK4_CHAR_SIZE
+
+ /** Search for documentation or help file.
+ @param fnb File name buffer.
+ @param szfnb Buffer size (number of dkChar).
+ @param sfn Short file name.
+ @return True if the file was found (name in fnb), false otherwise.
+ */
+ bool
+ InternalFindHelpFile(
+ wxChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+ );
+
+#endif
+
/** Convert dkChar string to wxChar string.
@param dptr Result buffer.
@param dsz Buffer size (number of wxChar).
@@ -377,8 +471,53 @@ class Dk4WxApplicationHelper
const wxChar * const *names, wxChar **array, size_t sz, bool ov = true
);
+ /** Create copy of pdksShare to pwxsShare.
+ */
+ void
+ UpdateWxsShare(void);
+
public:
+ /** Error codes in Initialize().
+ */
+ enum {
+ /** No error occured.
+ */
+ ERROR_NONE = 0,
+
+ /** Not enough memory.
+ */
+ ERROR_MEMORY ,
+
+ /** Failed to find host name.
+ */
+ ERROR_HOSTNAME ,
+
+ /** Failed to find localization settings.
+ */
+ ERROR_LANG_REG_ENC ,
+
+ /** Failed to find login name.
+ */
+ ERROR_LOGNAME ,
+
+ /** Failed to find home directory.
+ */
+ ERROR_HOMEDIR ,
+
+ /** Failed to find path name of executable.
+ */
+ ERROR_EXECUTABLE ,
+
+ /** Executable file name too long.
+ */
+ ERROR_EXEC_TOO_LONG ,
+
+ /** Invalid arguments were passed to Initialize().
+ */
+ ERROR_ARGUMENTS ,
+ };
+
/** Default constructor.
*/
Dk4WxApplicationHelper();
@@ -470,6 +609,36 @@ class Dk4WxApplicationHelper
#endif
+ /** Search for documentation or help file.
+ @param fnb File name buffer.
+ @param szfnb Buffer size (number of dkChar).
+ @param sfn Short file name.
+ @return True if the file was found (name in fnb), false otherwise.
+ */
+ bool
+ FindHelpFile(
+ dkChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+ );
+
+#if DK4_SIZEOF_WXCHAR != DK4_CHAR_SIZE
+
+ /** Search for documentation or help file.
+ @param fnb File name buffer.
+ @param szfnb Buffer size (number of dkChar).
+ @param sfn Short file name.
+ @return True if the file was found (name in fnb), false otherwise.
+ */
+ bool
+ FindHelpFile(
+ wxChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+ );
+
+#endif
+
/** Retrieve dkChar encoding.
@return Encoding.
*/
@@ -669,22 +838,77 @@ class Dk4WxApplicationHelper
const wxChar * const *names, wxChar **array, size_t sz, bool ov = true
);
+ /** Save one key value pair of strings.
+ @param key Key string.
+ @param value Value string.
+ @return True on success, false on error.
+ */
+ bool
+ SetString(const wxString & key, const wxString & value);
+
+ /** Retrieve one string value.
+ @param key Key string.
+ @param pvalue Address of value string.
+ @return True on success, false on error.
+ */
+ bool
+ GetString(const wxString & key, wxString *pvalue);
+
+ /** Get argv[0] command line argument as dkChar string.
+ @return Valid pointer on success, NULL on error.
+ */
+ const
+ dkChar *
+ GetDkArgv0(void);
+
+ /** Get group name.
+ @return Valid pointer on success, NULL on error.
+ */
+ const
+ dkChar *
+ GetDkGroupName(void);
+
+ /** Get /usr/share equivalent directory.
+ @return Valid pointer on success, NULL on error.
+ */
+ const
+ wxChar *
+ GetWxsShare(void) const ;
+
/** Correct top level frame position.
+ Negative x or y values can occur for two purposes:
+ * When restoring saved positions negative values indicate
+ that no position was saved yet. The window should be centered.
+ Set cn=true for this interpretation.
+ * If the position was calculated relatively to another window
+ or frame the window should not exceed the screen. The negative
+ value should be corrected to 0.
+ Set cn=false for this interpretation.
@param x Window x position.
@param y Window y position.
@param w Window width.
@param h Window height.
+ @param cn Flag: Center window on screen for negative x or y.
*/
static
void
- CorrectPosition(int & x, int & y, int & w, int & h);
+ CorrectPosition(int & x, int & y, int & w, int & h, bool cn = true);
/** Correct position of a top level window (frame or dialog).
+ Negative x or y values can occur for two purposes:
+ * When restoring saved positions negative values indicate
+ that no position was saved yet. The window should be centered.
+ Set cn=true for this interpretation.
+ * If the position was calculated relatively to another window
+ or frame the window should not exceed the screen. The negative
+ value should be corrected to 0.
+ Set cn=false for this interpretation.
@param w Window to correct.
+ @param cn Flag: Center window on screen for negative x or y.
*/
static
void
- CorrectPosition(wxWindow & w);
+ CorrectPosition(wxWindow & w, bool cn = true);
/** Choose position for a child top level window (frame or dialog).
@param p Parent window, unchanged.
@@ -717,8 +941,13 @@ class Dk4WxApplicationHelper
};
+
+/* vim: set ai sw=4 ts=4 : */
+
%% module
+#include "dk4conf.h"
+
#include "Dk4WxApplicationHelper.h"
#include "dk4mem.h"
@@ -764,45 +993,6 @@ typedef const wxChar *PCWXCHAR;
-/** Error codes in Initialize().
-*/
-enum {
- /** No error occured.
- */
- ERROR_NONE = 0,
-
- /** Not enough memory.
- */
- ERROR_MEMORY ,
-
- /** Failed to find host name.
- */
- ERROR_HOSTNAME ,
-
- /** Failed to find localization settings.
- */
- ERROR_LANG_REG_ENC ,
-
- /** Failed to find login name.
- */
- ERROR_LOGNAME ,
-
- /** Failed to find home directory.
- */
- ERROR_HOMEDIR ,
-
- /** Failed to find path name of executable.
- */
- ERROR_EXECUTABLE ,
-
- /** Executable file name too long.
- */
- ERROR_EXEC_TOO_LONG ,
-
- /** Invalid arguments were passed to Initialize().
- */
- ERROR_ARGUMENTS ,
-};
@@ -950,6 +1140,22 @@ Abortion scheduled, wait please!
Error
Not enough memory (RAM)!
Illegal arguments in Dk4WxHelpController constructor (bug)!
+#
+# 9-10 Error message "File not found"
+#
+File not found
+The file to display was not found!
+#
+# 11-13 Error message "Failed to start browser or application"
+#
+Error
+Failed to start browser or application for file\n"
+".
+#
+# 14-15 Texts to show in yes-no decision dialog.
+#
+Yes
+No
$!end
};
@@ -1021,12 +1227,14 @@ Dk4WxApplicationHelper::Dk4WxApplicationHelper()
pcwxsVendor = NULL;
pcdksGroup = NULL;
pwxsApp = NULL;
+ pcdksArgv0 = NULL;
pdksHost = NULL;
pdksLogname = NULL;
pdksHome = NULL;
pdksApp = NULL;
pdksSysconf = NULL;
pdksShare = NULL;
+ pwxsShare = NULL;
pdksLanguage = NULL;
pdksRegion = NULL;
sStt = NULL;
@@ -1036,9 +1244,15 @@ Dk4WxApplicationHelper::Dk4WxApplicationHelper()
sPrUser = NULL;
iPrUser = NULL;
nBasicStrings = 0;
- iDkEncoding = DK4_ENCODING_ASCII;
- iWxEncoding = DK4_ENCODING_ASCII;
- iFiEncoding = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ iDkEncoding = DK4_ENCODING_WIN1252;
+ iWxEncoding = DK4_ENCODING_WIN1252;
+ iFiEncoding = DK4_FILE_ENCODING_WIN1252;
+#else
+ iDkEncoding = DK4_ENCODING_PLAIN;
+ iWxEncoding = DK4_ENCODING_PLAIN;
+ iFiEncoding = DK4_FILE_ENCODING_PLAIN;
+#endif
bActive = false;
$? "- Dk4WxApplicationHelper"
}
@@ -1123,26 +1337,34 @@ Dk4WxApplicationHelper::Initialize(
#endif
#else
switch (iDkEncoding) {
- case DK4_ENCODING_ANSI : {
- iWxEncoding = DK4_ENCODING_ANSI;
+ case DK4_ENCODING_WIN1252 : {
+ iWxEncoding = DK4_ENCODING_WIN1252;
} break;
case DK4_ENCODING_UTF8 : {
iWxEncoding = DK4_ENCODING_UTF8;
} break;
default : {
- iWxEncoding = DK4_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ iWxEncoding = DK4_ENCODING_WIN1252;
+#else
+ iWxEncoding = DK4_ENCODING_PLAIN;
+#endif
} break;
}
#endif
switch (iDkEncoding) {
- case DK4_ENCODING_ANSI : {
- iFiEncoding = DK4_ENCODING_ANSI;
+ case DK4_ENCODING_WIN1252 : {
+ iFiEncoding = DK4_ENCODING_WIN1252;
} break;
case DK4_ENCODING_UTF8 : {
iFiEncoding = DK4_ENCODING_UTF8;
} break;
default : {
- iFiEncoding = DK4_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ iFiEncoding = DK4_ENCODING_WIN1252;
+#else
+ iFiEncoding = DK4_ENCODING_PLAIN;
+#endif
} break;
}
if (0 < dk4str_len(labuf)) {
@@ -1190,6 +1412,15 @@ Dk4WxApplicationHelper::Initialize(
res = dk4recwx_wxchar_to_dkchar(
labuf, szlabuf, iDkEncoding, argv0, iWxEncoding, erp
); $? ". dk4recwx_wxchar_to_dkchar=%d", res
+ if (0 == res) { $? "! Failed to convert first cmd line arg"
+ errc = ERROR_EXECUTABLE;
+ goto finished;
+ }
+ pcdksArgv0 = dk4str_dup(labuf, erp);
+ if (NULL == pcdksArgv0) { $? "! Failed to allocate copy of cmd line arg"
+ errc = ERROR_MEMORY;
+ goto finished;
+ }
res = dk4execpath(
rebuf, szrebuf, ((0 != res) ? labuf : NULL), erp
);
@@ -1257,6 +1488,7 @@ Dk4WxApplicationHelper::Initialize(
if (0 != res) {
pdksSysconf = dk4str_dup(dk4inst_get_directory(1), NULL);
pdksShare = dk4str_dup(dk4inst_get_directory(2), NULL);
+ UpdateWxsShare();
if ((NULL == pdksSysconf) || (NULL == pdksShare)) {
errc = ERROR_MEMORY;
goto finished;
@@ -1294,6 +1526,7 @@ Dk4WxApplicationHelper::Initialize(
}
if (0 != res) {
pdksShare = dk4str_dup(rebuf, NULL);
+ UpdateWxsShare();
if (NULL == pdksShare) {
errc = ERROR_MEMORY;
goto finished;
@@ -1305,6 +1538,7 @@ Dk4WxApplicationHelper::Initialize(
} else {
pdksSysconf = dk4str_dup(rebuf, NULL);
pdksShare = dk4str_dup(rebuf, NULL);
+ UpdateWxsShare();
if ((NULL == pdksSysconf) || (NULL == pdksShare)) {
errc = ERROR_MEMORY;
goto finished;
@@ -1369,7 +1603,12 @@ Dk4WxApplicationHelper::Initialize(
iDkEncoding,
(
(DK4_ENCODING_UTF8 == iDkEncoding)
- ? DK4_FILE_ENCODING_UTF8 : DK4_FILE_ENCODING_ASCII
+ ? DK4_FILE_ENCODING_UTF8 :
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
),
pn
);
@@ -1494,16 +1733,18 @@ Dk4WxApplicationHelper::InternalCleanup(void)
#if 0
/* Leave these integer variables as is.
*/
- iDkEncoding = DK4_ENCODING_ASCII;
- iWxEncoding = DK4_ENCODING_ASCII;
- iFiEncoding = DK4_FILE_ENCODING_ASCII;
+ iDkEncoding = DK4_ENCODING_PLAIN;
+ iWxEncoding = DK4_ENCODING_PLAIN;
+ iFiEncoding = DK4_FILE_ENCODING_PLAIN;
#endif
dk4mem_release(pdksRegion);
dk4mem_release(pdksLanguage);
dk4mem_release(pdksShare);
+ dk4mem_release(pwxsShare);
dk4mem_release(pdksSysconf);
dk4mem_release(pdksApp);
dk4mem_release(pdksHost);
+ dk4mem_release(pcdksArgv0);
dk4mem_release(pwxsApp);
dk4mem_release(pdksLogname);
dk4mem_release(pdksHome);
@@ -1590,7 +1831,7 @@ Dk4WxApplicationHelper::InternalFindDataFile(
int res = 0;
bool back = false;
$? "+ InternalFindDataFile dkChar"
- for (passno = 0; ((passno < maxpass) && (!(back))); passno++) {
+ for (passno = 0; ((passno <= maxpass) && (!(back))); passno++) {
res = dk4fs_data_one(
fnb, szfnb, sfn,
pdksShare, pdksHome, pdksApp, pcdksGroup,
@@ -2020,15 +2261,16 @@ Dk4WxApplicationHelper::InternalGetMultiple(
if ((NULL == array[i]) || (ov)) {
wxString value = wxEmptyString;
if (conf.Read(names[i], &value)) {
- vptr = value.c_str();
+ wxCStrData valuestrdata = value.c_str();
+ vptr = (wxChar const *)valuestrdata;
if (NULL != vptr) {
- nptr = dk4strx_dup(vptr, NULL);
- if (NULL != nptr) {
- if (NULL != array[i]) { dk4mem_free(array[i]); }
- array[i] = nptr;
- } else {
- back = false;
- }
+ nptr = dk4strx_dup(vptr, NULL);
+ if (NULL != nptr) {
+ if (NULL != array[i]) { dk4mem_free(array[i]); }
+ array[i] = nptr;
+ } else {
+ back = false;
+ }
} else {
back = false;
}
@@ -2115,8 +2357,11 @@ Dk4WxApplicationHelper::FindDataFile(
int
Dk4WxApplicationHelper::GetDkEncoding(void)
{
- int back = DK4_ENCODING_ASCII;
+ int back = DK4_ENCODING_PLAIN;
$? "+ GetDkEncoding"
+#if DK4_ON_WINDOWS
+ back = DK4_ENCODING_WIN1252;
+#endif
{
wxCriticalSectionLocker lock(csProtect);
back = iDkEncoding;
@@ -2129,8 +2374,11 @@ Dk4WxApplicationHelper::GetDkEncoding(void)
int
Dk4WxApplicationHelper::GetWxEncoding(void)
{
- int back = DK4_ENCODING_ASCII;
+ int back = DK4_ENCODING_PLAIN;
$? "+ GetWxEncoding"
+#if DK4_ON_WINDOWS
+ back = DK4_ENCODING_WIN1252;
+#endif
{
wxCriticalSectionLocker lock(csProtect);
back = iWxEncoding;
@@ -2143,8 +2391,11 @@ Dk4WxApplicationHelper::GetWxEncoding(void)
int
Dk4WxApplicationHelper::GetFiEncoding(void)
{
- int back = DK4_ENCODING_ASCII;
+ int back = DK4_FILE_ENCODING_PLAIN;
$? "+ GetFiEncoding"
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#endif
{
wxCriticalSectionLocker lock(csProtect);
back = iFiEncoding;
@@ -2239,10 +2490,13 @@ Dk4WxApplicationHelper::StringToWx(
)
{
int res = 0;
- int wxe = DK4_ENCODING_ASCII;
- int dke = DK4_ENCODING_ASCII;
+ int wxe = DK4_ENCODING_PLAIN;
+ int dke = DK4_ENCODING_PLAIN;
bool back = false;
$? "+ StringToWx"
+#if DK4_ON_WINDOWS
+ wxe = dke = DK4_ENCODING_WIN1252;
+#endif
if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
{
wxCriticalSectionLocker lock(csProtect);
@@ -2263,10 +2517,13 @@ Dk4WxApplicationHelper::StringToDk(
)
{
int res = 0;
- int wxe = DK4_ENCODING_ASCII;
- int dke = DK4_ENCODING_ASCII;
+ int wxe = DK4_ENCODING_PLAIN;
+ int dke = DK4_ENCODING_PLAIN;
bool back = false;
$? "+ StringToDk"
+#if DK4_ON_WINDOWS
+ wxe = dke = DK4_ENCODING_WIN1252;
+#endif
if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
{
wxCriticalSectionLocker lock(csProtect);
@@ -2287,9 +2544,12 @@ Dk4WxApplicationHelper::StringToChar(
)
{
int res = 0;
- int wxe = DK4_ENCODING_ASCII;
- int dke = DK4_ENCODING_ASCII;
+ int wxe = DK4_ENCODING_PLAIN;
+ int dke = DK4_ENCODING_PLAIN;
bool back = false;
+#if DK4_ON_WINDOWS
+ wxe = dke = DK4_ENCODING_WIN1252;
+#endif
if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
{
wxCriticalSectionLocker lock(csProtect);
@@ -2297,8 +2557,8 @@ Dk4WxApplicationHelper::StringToChar(
dke = iDkEncoding;
}
if (DK4_ENCODING_UTF8 != dke) {
- if (DK4_ENCODING_ANSI != dke) {
- dke = DK4_ENCODING_ASCII;
+ if (DK4_ENCODING_WIN1252 != dke) {
+ dke = DK4_ENCODING_PLAIN;
}
}
res = dk4recwx_wxchar_to_char(dptr, dsz, dke, sptr, wxe, erp);
@@ -2509,6 +2769,42 @@ Dk4WxApplicationHelper::GetMultiple(
+bool
+Dk4WxApplicationHelper::SetString(const wxString & key, const wxString & value)
+{
+ bool back = false;
+ $? "+ SetString"
+ {
+ wxCriticalSectionLocker lock(csProtect);
+ if (bActive) {
+ wxConfig conf(pwxsApp, pcwxsVendor);
+ back = conf.Write(key, value);
+ }
+ }
+ $? "- SetString %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+Dk4WxApplicationHelper::GetString(const wxString & key, wxString *pvalue)
+{
+ bool back = false;
+ $? "+ GetString"
+ if (NULL != pvalue) {
+ wxCriticalSectionLocker lock(csProtect);
+ if (bActive) {
+ wxConfig conf(pwxsApp, pcwxsVendor);
+ back = conf.Read(key, pvalue);
+ }
+ }
+ $? "- GetString %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
$*
Static class functions.
$*
@@ -2516,14 +2812,19 @@ $*
void
Dk4WxApplicationHelper::CorrectPosition(
- int & x, int & y, int & w, int & h
+ int & x, int & y, int & w, int & h, bool cn
)
{
wxSize scsz;
$? "+ CorrectPosition %d %d %d %d", x, y, w, h
scsz = wxGetDisplaySize();
- if (0 > x) { x = (scsz.x - w) / 2; }
- if (0 > y) { y = (scsz.y - h) / 2; }
+ if (cn) {
+ /*
+ Negative coordinates mean x and y not defined, center window.
+ */
+ if (0 > x) { x = (scsz.x - w) / 2; }
+ if (0 > y) { y = (scsz.y - h) / 2; }
+ }
if (scsz.x < (x + w)) { x = scsz.x - w; }
if (scsz.y < (y + h)) { y = scsz.y - h; }
if (0 > x) { x = 0; }
@@ -2535,14 +2836,14 @@ Dk4WxApplicationHelper::CorrectPosition(
void
Dk4WxApplicationHelper::CorrectPosition(
- wxWindow & wnd
+ wxWindow & wnd, bool cn
)
{
int x, y, w, h;
$? "+ CorrectPosition window"
wnd.GetPosition(&x, &y);
wnd.GetSize(&w, &h);
- Dk4WxApplicationHelper::CorrectPosition(x, y, w, h);
+ Dk4WxApplicationHelper::CorrectPosition(x, y, w, h, cn);
wnd.SetSize(x, y, w, h);
$? "- CorrectPosition"
}
@@ -2566,8 +2867,16 @@ Dk4WxApplicationHelper::ChooseChildPosition(
bool done = false;
bool findy = false;
$? "+ ChooseChildPosition"
+#if 0
p.GetPosition(&px, &py);
p.GetSize(&pw, &ph);
+#else
+ wxRect re = p.GetScreenRect();
+ px = re.GetX();
+ py = re.GetY();
+ pw = re.GetWidth();
+ ph = re.GetHeight();
+#endif
c.GetSize(&cw, &ch);
if (beside) {
/* Attempt right side */
@@ -2638,7 +2947,7 @@ Dk4WxApplicationHelper::ChooseChildPosition(
if (!done) {
cx = px + (pw - cw) / 2;
cy = py + (ph - ch) / 2;
- Dk4WxApplicationHelper::CorrectPosition(cx, cy, cw, ch);
+ Dk4WxApplicationHelper::CorrectPosition(cx, cy, cw, ch, false);
c.SetSize(cx, cy, cw, ch);
}
$? "- ChooseChildPosition"
@@ -2665,6 +2974,7 @@ Dk4WxApplicationHelper::ReleaseWxcharStringArray(
)
{
wxChar **ap;
+ $? "+ ReleaseWxcharStringArray"
if ((NULL != array) && (0 < sz)) {
ap = array;
while (0 < sz--) {
@@ -2673,5 +2983,143 @@ Dk4WxApplicationHelper::ReleaseWxcharStringArray(
}
if (ea) { dk4mem_free(ap); }
}
+ $? "- ReleaseWxcharStringArray"
+}
+
+
+
+const
+dkChar *
+Dk4WxApplicationHelper::GetDkArgv0(void)
+{
+ return ((const dkChar *)pcdksArgv0);
+}
+
+
+
+const
+dkChar *
+Dk4WxApplicationHelper::GetDkGroupName(void)
+{
+ return(pcdksGroup);
+}
+
+
+
+void
+Dk4WxApplicationHelper::UpdateWxsShare(void)
+{
+ wxChar buf[DK4_MAX_PATH];
+ wxChar *np;
+ bool res;
+ if (NULL != pdksShare) {
+ res = InternalStringToWx(buf, DK4_SIZEOF(buf,wxChar), pdksShare, NULL);
+ if (res) {
+ np = dk4strx_dup(buf, NULL);
+ if (NULL != np) {
+ dk4mem_release(pwxsShare);
+ pwxsShare = np;
+ }
+ }
+ }
+}
+
+
+
+const
+wxChar *
+Dk4WxApplicationHelper::GetWxsShare(void) const
+{
+ return ((wxChar const *)pwxsShare);
+}
+
+
+
+bool
+Dk4WxApplicationHelper::InternalFindHelpFile(
+ dkChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+)
+{
+ int passno = 0;
+ int res = 0;
+ bool back = false;
+ $? "+ InternalFindHelpFile"
+ for (passno = 0; ((passno <= DK4_FS_DOC_MAX) && (!(back))); passno++) {
+ res = dk4fs_doc_one(
+ fnb, szfnb, sfn, pdksShare, pdksApp, pcdksGroup,
+ pdksLanguage, pdksRegion, passno, NULL
+ );
+ if (0 != res) { $? ". found \"%!ds\"", fnb
+ back = true;
+ }
+ }
+ $? "- InternalFindHelpFile %d", (back ? 1 : 0)
+ return back;
+}
+
+
+#if DK4_SIZEOF_WXCHAR != DK4_CHAR_SIZE
+
+bool
+Dk4WxApplicationHelper::InternalFindHelpFile(
+ wxChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+)
+{
+ dkChar buf[DK4_MAX_PATH];
+ size_t szbuf = DK4_SIZEOF(buf,dkChar);
+ bool back = false;
+ $? "+ InternalFindHelpFile"
+ back = InternalFindHelpFile(buf, szbuf, sfn);
+ if (back) {
+ back = InternalStringToWx(fnb, szfnb, buf, NULL);
+ }
+ $? "- InternalFindHelpFile %d", (back ? 1 : 0)
+ return back;
+}
+
+#endif
+
+bool
+Dk4WxApplicationHelper::FindHelpFile(
+ dkChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+)
+{
+ bool back = false;
+ if ((NULL != fnb) && (NULL != sfn) && (0 < szfnb)) {
+ wxCriticalSectionLocker lock(csProtect);
+ if (bActive) {
+ back = InternalFindHelpFile(fnb, szfnb, sfn);
+ }
+ }
+ return back;
+}
+
+#if DK4_SIZEOF_WXCHAR != DK4_CHAR_SIZE
+
+bool
+Dk4WxApplicationHelper::FindHelpFile(
+ wxChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+)
+{
+ bool back = false;
+ if ((NULL != fnb) && (NULL != sfn) && (0 < szfnb)) {
+ wxCriticalSectionLocker lock(csProtect);
+ if (bActive) {
+ back = InternalFindHelpFile(fnb, szfnb, sfn);
+ }
+ }
+ return back;
}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/Dk4WxApplicationHelper.h b/support/dktools/Dk4WxApplicationHelper.h
index e84a29d0b2..e583c86e53 100644
--- a/support/dktools/Dk4WxApplicationHelper.h
+++ b/support/dktools/Dk4WxApplicationHelper.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxApplicationHelper.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxApplicationHelper.cpt
*/
#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
@@ -45,31 +23,69 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
#ifndef DK4FSH_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fs.h"
+#else
+#include <dktools-4/dk4fs.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -104,7 +120,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef DK4WXSTT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxstt.h"
+#else
+#include <dktools-4/dk4wxstt.h>
+#endif
#endif
@@ -141,6 +161,14 @@ class Dk4WxApplicationHelper
*/
wxChar *pwxsApp;
+ /** The /usr/share equivalent directory.
+ */
+ wxChar *pwxsShare;
+
+ /** First command line argument (allocated).
+ */
+ dkChar *pcdksArgv0;
+
/** Host name.
*/
dkChar *pdksHost;
@@ -263,6 +291,50 @@ class Dk4WxApplicationHelper
#endif
+ /** Search for documentation or help file.
+ @param fnb File name buffer.
+ @param szfnb Buffer size (number of dkChar).
+ @param sfn Short file name.
+
+ The method searches for the file <i>sfn</i> in the
+ following directories, first file found is returned:
+ - /usr/share/<i>group</i>/help/<i>program</i>/<i>language</i>/<i>region</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/<i>language</i>/<i>region</i>
+ - /usr/share/<i>group</i>/help/<i>program</i>/<i>language</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/<i>language</i>
+ - /usr/share/<i>group</i>/help/<i>program</i>/en
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/en
+ - /usr/share/<i>group</i>/help/<i>program</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>
+
+ For a relocated installation replace /usr/share by ${datadir}.
+
+ @return True if the file was found (name in fnb), false otherwise.
+ */
+ bool
+ InternalFindHelpFile(
+ dkChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+ );
+
+#if DK4_SIZEOF_WXCHAR != DK4_CHAR_SIZE
+
+ /** Search for documentation or help file.
+ @param fnb File name buffer.
+ @param szfnb Buffer size (number of dkChar).
+ @param sfn Short file name.
+ @return True if the file was found (name in fnb), false otherwise.
+ */
+ bool
+ InternalFindHelpFile(
+ wxChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+ );
+
+#endif
+
/** Convert dkChar string to wxChar string.
@param dptr Result buffer.
@param dsz Buffer size (number of wxChar).
@@ -410,8 +482,53 @@ class Dk4WxApplicationHelper
const wxChar * const *names, wxChar **array, size_t sz, bool ov = true
);
+ /** Create copy of pdksShare to pwxsShare.
+ */
+ void
+ UpdateWxsShare(void);
+
public:
+ /** Error codes in Initialize().
+ */
+ enum {
+ /** No error occured.
+ */
+ ERROR_NONE = 0,
+
+ /** Not enough memory.
+ */
+ ERROR_MEMORY ,
+
+ /** Failed to find host name.
+ */
+ ERROR_HOSTNAME ,
+
+ /** Failed to find localization settings.
+ */
+ ERROR_LANG_REG_ENC ,
+
+ /** Failed to find login name.
+ */
+ ERROR_LOGNAME ,
+
+ /** Failed to find home directory.
+ */
+ ERROR_HOMEDIR ,
+
+ /** Failed to find path name of executable.
+ */
+ ERROR_EXECUTABLE ,
+
+ /** Executable file name too long.
+ */
+ ERROR_EXEC_TOO_LONG ,
+
+ /** Invalid arguments were passed to Initialize().
+ */
+ ERROR_ARGUMENTS ,
+ };
+
/** Default constructor.
*/
Dk4WxApplicationHelper();
@@ -503,6 +620,36 @@ class Dk4WxApplicationHelper
#endif
+ /** Search for documentation or help file.
+ @param fnb File name buffer.
+ @param szfnb Buffer size (number of dkChar).
+ @param sfn Short file name.
+ @return True if the file was found (name in fnb), false otherwise.
+ */
+ bool
+ FindHelpFile(
+ dkChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+ );
+
+#if DK4_SIZEOF_WXCHAR != DK4_CHAR_SIZE
+
+ /** Search for documentation or help file.
+ @param fnb File name buffer.
+ @param szfnb Buffer size (number of dkChar).
+ @param sfn Short file name.
+ @return True if the file was found (name in fnb), false otherwise.
+ */
+ bool
+ FindHelpFile(
+ wxChar *fnb,
+ size_t szfnb,
+ dkChar const *sfn
+ );
+
+#endif
+
/** Retrieve dkChar encoding.
@return Encoding.
*/
@@ -702,22 +849,77 @@ class Dk4WxApplicationHelper
const wxChar * const *names, wxChar **array, size_t sz, bool ov = true
);
+ /** Save one key value pair of strings.
+ @param key Key string.
+ @param value Value string.
+ @return True on success, false on error.
+ */
+ bool
+ SetString(const wxString & key, const wxString & value);
+
+ /** Retrieve one string value.
+ @param key Key string.
+ @param pvalue Address of value string.
+ @return True on success, false on error.
+ */
+ bool
+ GetString(const wxString & key, wxString *pvalue);
+
+ /** Get argv[0] command line argument as dkChar string.
+ @return Valid pointer on success, NULL on error.
+ */
+ const
+ dkChar *
+ GetDkArgv0(void);
+
+ /** Get group name.
+ @return Valid pointer on success, NULL on error.
+ */
+ const
+ dkChar *
+ GetDkGroupName(void);
+
+ /** Get /usr/share equivalent directory.
+ @return Valid pointer on success, NULL on error.
+ */
+ const
+ wxChar *
+ GetWxsShare(void) const ;
+
/** Correct top level frame position.
+ Negative x or y values can occur for two purposes:
+ * When restoring saved positions negative values indicate
+ that no position was saved yet. The window should be centered.
+ Set cn=true for this interpretation.
+ * If the position was calculated relatively to another window
+ or frame the window should not exceed the screen. The negative
+ value should be corrected to 0.
+ Set cn=false for this interpretation.
@param x Window x position.
@param y Window y position.
@param w Window width.
@param h Window height.
+ @param cn Flag: Center window on screen for negative x or y.
*/
static
void
- CorrectPosition(int & x, int & y, int & w, int & h);
+ CorrectPosition(int & x, int & y, int & w, int & h, bool cn = true);
/** Correct position of a top level window (frame or dialog).
+ Negative x or y values can occur for two purposes:
+ * When restoring saved positions negative values indicate
+ that no position was saved yet. The window should be centered.
+ Set cn=true for this interpretation.
+ * If the position was calculated relatively to another window
+ or frame the window should not exceed the screen. The negative
+ value should be corrected to 0.
+ Set cn=false for this interpretation.
@param w Window to correct.
+ @param cn Flag: Center window on screen for negative x or y.
*/
static
void
- CorrectPosition(wxWindow & w);
+ CorrectPosition(wxWindow & w, bool cn = true);
/** Choose position for a child top level window (frame or dialog).
@param p Parent window, unchanged.
@@ -751,4 +953,7 @@ class Dk4WxApplicationHelper
+/* vim: set ai sw=4 ts=4 : */
+
+
#endif
diff --git a/support/dktools/Dk4WxAutostartController.cpp b/support/dktools/Dk4WxAutostartController.cpp
index 81522bc2ee..113573c145 100644
--- a/support/dktools/Dk4WxAutostartController.cpp
+++ b/support/dktools/Dk4WxAutostartController.cpp
@@ -1,87 +1,38 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxAutostartController.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxAutostartController.cpt
*/
/** @file Dk4WxAutostartController.cpp The Dk4WxAutostartController module.
*/
-#line 166 "Dk4WxAutostartController.cpt"
+#line 211 "Dk4WxAutostartController.cpt"
+#include "dk4conf.h"
#include "Dk4WxAutostartController.h"
-#line 173 "Dk4WxAutostartController.cpt"
-
-
-
-/** Internal controller state.
-*/
-enum {
-
- /** No idle event received yet.
- */
- DK4WX_AUTOSTART_STATE_NONE = 0 ,
-
- /** Expecting start processing.
- */
- DK4WX_AUTOSTART_STATE_EXPECT_START ,
-
- /** In processing.
- */
- DK4WX_AUTOSTART_STATE_PROCESSING ,
-
- /** Processing finished,
- expecting application end.
- */
- DK4WX_AUTOSTART_STATE_EXPECT_EXIT ,
-
- /** Processing finished.
- */
- DK4WX_AUTOSTART_STATE_FINISHED
-};
+#line 219 "Dk4WxAutostartController.cpt"
Dk4WxAutostartController::Dk4WxAutostartController()
{
iExitTime = (dk4_time_t)0UL;
- iState = DK4WX_AUTOSTART_STATE_NONE;
+ iState = STATE_NONE;
bAutostart = false;
bAutoexit = false;
}
@@ -114,33 +65,33 @@ int
Dk4WxAutostartController::GetReaction(void)
{
dk4_time_t timer = (dk4_time_t)0UL;
- int back = DK4WX_AUTOSTART_REACTION_IGNORE;
+ int back = REACTION_IGNORE;
{
wxCriticalSectionLocker lock(csProtect);
switch (iState) {
- case DK4WX_AUTOSTART_STATE_NONE : {
+ case STATE_NONE : {
if (bAutostart) {
- back = DK4WX_AUTOSTART_REACTION_START;
- iState = DK4WX_AUTOSTART_STATE_EXPECT_START;
+ back = REACTION_START;
+ iState = STATE_EXPECT_START;
}
} break;
#if 0
- case DK4WX_AUTOSTART_STATE_EXPECT_START : {
+ case STATE_EXPECT_START : {
} break;
- case DK4WX_AUTOSTART_STATE_PROCESSING : {
+ case STATE_PROCESSING : {
} break;
#endif
- case DK4WX_AUTOSTART_STATE_EXPECT_EXIT : {
- back = DK4WX_AUTOSTART_REACTION_MORE;
+ case STATE_EXPECT_EXIT : {
+ back = REACTION_MORE;
dk4time_get(&timer);
if (timer >= iExitTime) {
- iState = DK4WX_AUTOSTART_STATE_FINISHED;
- back = DK4WX_AUTOSTART_REACTION_EXIT;
+ iState = STATE_FINISHED;
+ back = REACTION_EXIT;
}
} break;
#if 0
- case DK4WX_AUTOSTART_STATE_FINISHED : {
+ case STATE_FINISHED : {
} break;
#endif
}
@@ -154,7 +105,7 @@ void
Dk4WxAutostartController::StartProcessing(void)
{
wxCriticalSectionLocker lock(csProtect);
- iState = DK4WX_AUTOSTART_STATE_PROCESSING;
+ iState = STATE_PROCESSING;
}
@@ -168,9 +119,9 @@ Dk4WxAutostartController::EndProcessing(bool success)
wxCriticalSectionLocker lock(csProtect);
if ((bAutostart) && (bAutoexit) && (success)) {
iExitTime = timer + (dk4_time_t)2UL;
- iState = DK4WX_AUTOSTART_STATE_EXPECT_EXIT;
+ iState = STATE_EXPECT_EXIT;
} else {
- iState = DK4WX_AUTOSTART_STATE_FINISHED;
+ iState = STATE_FINISHED;
}
}
}
diff --git a/support/dktools/Dk4WxAutostartController.cpt b/support/dktools/Dk4WxAutostartController.cpt
index d18022d60b..8b3dd3953c 100644
--- a/support/dktools/Dk4WxAutostartController.cpt
+++ b/support/dktools/Dk4WxAutostartController.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,23 +11,43 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -52,27 +72,6 @@ license = bsd
#endif
-/** Reactions on idle events.
-*/
-enum {
-
- /** Ignore the event, we are done.
- */
- DK4WX_AUTOSTART_REACTION_IGNORE = 0 ,
-
- /** Start autorun.
- */
- DK4WX_AUTOSTART_REACTION_START ,
-
- /** Request more idle events.
- */
- DK4WX_AUTOSTART_REACTION_MORE ,
-
- /** Exit the application.
- */
- DK4WX_AUTOSTART_REACTION_EXIT
-};
-
/** Controller to check whether or not to start an autostart run
on idle events.
@@ -81,6 +80,31 @@ class Dk4WxAutostartController
{
protected:
+ /** Internal controller state.
+ */
+ enum {
+ /** No idle event received yet.
+ */
+ STATE_NONE = 0 ,
+
+ /** Expecting start processing.
+ */
+ STATE_EXPECT_START ,
+
+ /** In processing.
+ */
+ STATE_PROCESSING ,
+
+ /** Processing finished,
+ expecting application end.
+ */
+ STATE_EXPECT_EXIT ,
+
+ /** Processing finished.
+ */
+ STATE_FINISHED
+ };
+
/** Synchronize access from multiple threads or events.
*/
wxCriticalSection csProtect;
@@ -103,6 +127,27 @@ class Dk4WxAutostartController
public:
+ /** Reactions on idle events.
+ */
+ enum {
+ /** Ignore the event, we are done.
+ */
+ REACTION_IGNORE = 0 ,
+
+ /** Start autorun.
+ */
+ REACTION_START ,
+
+ /** Request more idle events.
+ */
+ REACTION_MORE ,
+
+ /** Exit the application.
+ */
+ REACTION_EXIT
+ };
+
+
/** Default controller.
*/
Dk4WxAutostartController();
@@ -112,7 +157,7 @@ class Dk4WxAutostartController
@param fl Flag to enable/disable auto start.
*/
void
- SetAutoStart(bool fl);
+ SetAutoStart(bool fl = true);
/** Enable auto exit.
An application can exit automatically if no feedback is required
@@ -125,19 +170,19 @@ class Dk4WxAutostartController
@param fl Flag to enable/disable auto exit.
*/
void
- SetAutoExit(bool fl);
+ SetAutoExit(bool fl = true);
/** Get reaction for one idle event.
This function is typically called from the frames idle event
handler to decide what to do.
@return One from:
- - DK4WX_AUTOSTART_REACTION_IGNORE<br>
+ - REACTION_IGNORE<br>
to ignore the idle event,
- - DK4WX_AUTOSTART_REACTION_START<br>
+ - REACTION_START<br>
to start an automatic run,
- - DK4WX_AUTOSTART_REACTION_MORE<br>
+ - REACTION_MORE<br>
to request more idle events, or
- - DK4WX_AUTOSTART_REACTION_EXIT<br>
+ - REACTION_EXIT<br>
to exit the application.
*/
int
@@ -165,6 +210,7 @@ class Dk4WxAutostartController
%% module
+#include "dk4conf.h"
#include "Dk4WxAutostartController.h"
@@ -173,38 +219,10 @@ $!trace-include
-/** Internal controller state.
-*/
-enum {
-
- /** No idle event received yet.
- */
- DK4WX_AUTOSTART_STATE_NONE = 0 ,
-
- /** Expecting start processing.
- */
- DK4WX_AUTOSTART_STATE_EXPECT_START ,
-
- /** In processing.
- */
- DK4WX_AUTOSTART_STATE_PROCESSING ,
-
- /** Processing finished,
- expecting application end.
- */
- DK4WX_AUTOSTART_STATE_EXPECT_EXIT ,
-
- /** Processing finished.
- */
- DK4WX_AUTOSTART_STATE_FINISHED
-};
-
-
-
Dk4WxAutostartController::Dk4WxAutostartController()
{
iExitTime = (dk4_time_t)0UL;
- iState = DK4WX_AUTOSTART_STATE_NONE;
+ iState = STATE_NONE;
bAutostart = false;
bAutoexit = false;
}
@@ -237,33 +255,33 @@ int
Dk4WxAutostartController::GetReaction(void)
{
dk4_time_t timer = (dk4_time_t)0UL;
- int back = DK4WX_AUTOSTART_REACTION_IGNORE;
+ int back = REACTION_IGNORE;
{
wxCriticalSectionLocker lock(csProtect);
switch (iState) {
- case DK4WX_AUTOSTART_STATE_NONE : {
+ case STATE_NONE : {
if (bAutostart) {
- back = DK4WX_AUTOSTART_REACTION_START;
- iState = DK4WX_AUTOSTART_STATE_EXPECT_START;
+ back = REACTION_START;
+ iState = STATE_EXPECT_START;
}
} break;
#if 0
- case DK4WX_AUTOSTART_STATE_EXPECT_START : {
+ case STATE_EXPECT_START : {
} break;
- case DK4WX_AUTOSTART_STATE_PROCESSING : {
+ case STATE_PROCESSING : {
} break;
#endif
- case DK4WX_AUTOSTART_STATE_EXPECT_EXIT : {
- back = DK4WX_AUTOSTART_REACTION_MORE;
+ case STATE_EXPECT_EXIT : {
+ back = REACTION_MORE;
dk4time_get(&timer);
if (timer >= iExitTime) {
- iState = DK4WX_AUTOSTART_STATE_FINISHED;
- back = DK4WX_AUTOSTART_REACTION_EXIT;
+ iState = STATE_FINISHED;
+ back = REACTION_EXIT;
}
} break;
#if 0
- case DK4WX_AUTOSTART_STATE_FINISHED : {
+ case STATE_FINISHED : {
} break;
#endif
}
@@ -277,7 +295,7 @@ void
Dk4WxAutostartController::StartProcessing(void)
{
wxCriticalSectionLocker lock(csProtect);
- iState = DK4WX_AUTOSTART_STATE_PROCESSING;
+ iState = STATE_PROCESSING;
}
@@ -291,9 +309,9 @@ Dk4WxAutostartController::EndProcessing(bool success)
wxCriticalSectionLocker lock(csProtect);
if ((bAutostart) && (bAutoexit) && (success)) {
iExitTime = timer + (dk4_time_t)2UL;
- iState = DK4WX_AUTOSTART_STATE_EXPECT_EXIT;
+ iState = STATE_EXPECT_EXIT;
} else {
- iState = DK4WX_AUTOSTART_STATE_FINISHED;
+ iState = STATE_FINISHED;
}
}
}
diff --git a/support/dktools/Dk4WxAutostartController.h b/support/dktools/Dk4WxAutostartController.h
index edcc68791b..3dbb4d599d 100644
--- a/support/dktools/Dk4WxAutostartController.h
+++ b/support/dktools/Dk4WxAutostartController.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxAutostartController.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxAutostartController.cpt
*/
#ifndef DK4WXAUTOSTARTCONTROLLER_H_INCLUDED
@@ -44,23 +22,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -85,27 +83,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
-/** Reactions on idle events.
-*/
-enum {
-
- /** Ignore the event, we are done.
- */
- DK4WX_AUTOSTART_REACTION_IGNORE = 0 ,
-
- /** Start autorun.
- */
- DK4WX_AUTOSTART_REACTION_START ,
-
- /** Request more idle events.
- */
- DK4WX_AUTOSTART_REACTION_MORE ,
-
- /** Exit the application.
- */
- DK4WX_AUTOSTART_REACTION_EXIT
-};
-
/** Controller to check whether or not to start an autostart run
on idle events.
@@ -114,6 +91,31 @@ class Dk4WxAutostartController
{
protected:
+ /** Internal controller state.
+ */
+ enum {
+ /** No idle event received yet.
+ */
+ STATE_NONE = 0 ,
+
+ /** Expecting start processing.
+ */
+ STATE_EXPECT_START ,
+
+ /** In processing.
+ */
+ STATE_PROCESSING ,
+
+ /** Processing finished,
+ expecting application end.
+ */
+ STATE_EXPECT_EXIT ,
+
+ /** Processing finished.
+ */
+ STATE_FINISHED
+ };
+
/** Synchronize access from multiple threads or events.
*/
wxCriticalSection csProtect;
@@ -136,6 +138,27 @@ class Dk4WxAutostartController
public:
+ /** Reactions on idle events.
+ */
+ enum {
+ /** Ignore the event, we are done.
+ */
+ REACTION_IGNORE = 0 ,
+
+ /** Start autorun.
+ */
+ REACTION_START ,
+
+ /** Request more idle events.
+ */
+ REACTION_MORE ,
+
+ /** Exit the application.
+ */
+ REACTION_EXIT
+ };
+
+
/** Default controller.
*/
Dk4WxAutostartController();
@@ -145,7 +168,7 @@ class Dk4WxAutostartController
@param fl Flag to enable/disable auto start.
*/
void
- SetAutoStart(bool fl);
+ SetAutoStart(bool fl = true);
/** Enable auto exit.
An application can exit automatically if no feedback is required
@@ -158,19 +181,19 @@ class Dk4WxAutostartController
@param fl Flag to enable/disable auto exit.
*/
void
- SetAutoExit(bool fl);
+ SetAutoExit(bool fl = true);
/** Get reaction for one idle event.
This function is typically called from the frames idle event
handler to decide what to do.
@return One from:
- - DK4WX_AUTOSTART_REACTION_IGNORE<br>
+ - REACTION_IGNORE<br>
to ignore the idle event,
- - DK4WX_AUTOSTART_REACTION_START<br>
+ - REACTION_START<br>
to start an automatic run,
- - DK4WX_AUTOSTART_REACTION_MORE<br>
+ - REACTION_MORE<br>
to request more idle events, or
- - DK4WX_AUTOSTART_REACTION_EXIT<br>
+ - REACTION_EXIT<br>
to exit the application.
*/
int
diff --git a/support/dktools/Dk4WxColourPalette.cpp b/support/dktools/Dk4WxColourPalette.cpp
new file mode 100644
index 0000000000..07c23fc99f
--- /dev/null
+++ b/support/dktools/Dk4WxColourPalette.cpp
@@ -0,0 +1,1905 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxColourPalette.wxc
+*/
+
+/** @file Dk4WxColourPalette.cpp The Dk4WxColourPalette module.
+*/
+
+
+#line 918 "Dk4WxColourPalette.wxc"
+
+#include "Dk4WxColourPalette.h"
+
+#ifndef WX_CONFIG_H_INCLUDED
+#include <wx/config.h>
+#define WX_CONFIG_H_INCLUDED 1
+#endif
+
+#ifndef WX_ARRSTR_H_INCLUDED
+#include <wx/arrstr.h>
+#define WX_ARRSTR_H_INCLUDED 1
+#endif
+
+#ifndef WX_DCBUFFER_H_INCLUDED
+#include <wx/dcbuffer.h>
+#define WX_DCBUFFER_H_INCLUDED 1
+#endif
+
+
+
+
+
+#line 939 "Dk4WxColourPalette.wxc"
+
+
+
+/** HTML named color type.
+*/
+typedef struct {
+ const wxChar *name; /**< Color name. */
+ unsigned long rgb; /**< 16*R+8*G+B. */
+} html_color_t;
+
+
+
+/** The named HTML colors.
+*/
+static const html_color_t html_colors[] = {
+ { wxT("AliceBlue"), 0xF0F8FFUL },
+ { wxT("AntiqueWhite"), 0xFAEBD7UL },
+ { wxT("Aqua"), 0x00FFFFUL },
+ { wxT("Aquamarine"), 0x7FFFD4UL },
+ { wxT("Azure"), 0xF0FFFFUL },
+ { wxT("Beige"), 0xF5F5DCUL },
+ { wxT("Bisque"), 0xFFE4C4UL },
+ { wxT("Black"), 0x000000UL },
+ { wxT("BlanchedAlmond"), 0xFFEBCDUL },
+ { wxT("Blue"), 0x0000FFUL },
+ { wxT("BlueViolet"), 0x8A2BE2UL },
+ { wxT("Brown"), 0xA52A2AUL },
+ { wxT("BurlyWood"), 0xDEB887UL },
+ { wxT("CadetBlue"), 0x5F9EA0UL },
+ { wxT("Chartreuse"), 0x7FFF00UL },
+ { wxT("Chocolate"), 0xD2691EUL },
+ { wxT("Coral"), 0xFF7F50UL },
+ { wxT("CornflowerBlue"), 0x6495EDUL },
+ { wxT("Cornsilk"), 0xFFF8DCUL },
+ { wxT("Crimson"), 0xDC143CUL },
+ { wxT("Cyan"), 0x00FFFFUL },
+ { wxT("DarkBlue"), 0x00008BUL },
+ { wxT("DarkCyan"), 0x008B8BUL },
+ { wxT("DarkGoldenRod"), 0xB8860BUL },
+ { wxT("DarkGray"), 0xA9A9A9UL },
+ { wxT("DarkGrey"), 0xA9A9A9UL },
+ { wxT("DarkGreen"), 0x006400UL },
+ { wxT("DarkKhaki"), 0xBDB76BUL },
+ { wxT("DarkMagenta"), 0x8B008BUL },
+ { wxT("DarkOliveGreen"), 0x556B2FUL },
+ { wxT("DarkOrange"), 0xFF8C00UL },
+ { wxT("DarkOrchid"), 0x9932CCUL },
+ { wxT("DarkRed"), 0x8B0000UL },
+ { wxT("DarkSalmon"), 0xE9967AUL },
+ { wxT("DarkSeaGreen"), 0x8FBC8FUL },
+ { wxT("DarkSlateBlue"), 0x483D8BUL },
+ { wxT("DarkSlateGray"), 0x2F4F4FUL },
+ { wxT("DarkSlateGrey"), 0x2F4F4FUL },
+ { wxT("DarkTurquoise"), 0x00CED1UL },
+ { wxT("DarkViolet"), 0x9400D3UL },
+ { wxT("DeepPink"), 0xFF1493UL },
+ { wxT("DeepSkyBlue"), 0x00BFFFUL },
+ { wxT("DimGray"), 0x696969UL },
+ { wxT("DimGrey"), 0x696969UL },
+ { wxT("DodgerBlue"), 0x1E90FFUL },
+ { wxT("FireBrick"), 0xB22222UL },
+ { wxT("FloralWhite"), 0xFFFAF0UL },
+ { wxT("ForestGreen"), 0x228B22UL },
+ { wxT("Fuchsia"), 0xFF00FFUL },
+ { wxT("Gainsboro"), 0xDCDCDCUL },
+ { wxT("GhostWhite"), 0xF8F8FFUL },
+ { wxT("Gold"), 0xFFD700UL },
+ { wxT("GoldenRod"), 0xDAA520UL },
+ { wxT("Gray"), 0x808080UL },
+ { wxT("Grey"), 0x808080UL },
+ { wxT("Green"), 0x008000UL },
+ { wxT("GreenYellow"), 0xADFF2FUL },
+ { wxT("HoneyDew"), 0xF0FFF0UL },
+ { wxT("HotPink"), 0xFF69B4UL },
+ { wxT("IndianRed"), 0xCD5C5CUL },
+ { wxT("Indigo"), 0x4B0082UL },
+ { wxT("Ivory"), 0xFFFFF0UL },
+ { wxT("Khaki"), 0xF0E68CUL },
+ { wxT("Lavender"), 0xE6E6FAUL },
+ { wxT("LavenderBlush"), 0xFFF0F5UL },
+ { wxT("LawnGreen"), 0x7CFC00UL },
+ { wxT("LemonChiffon"), 0xFFFACDUL },
+ { wxT("LightBlue"), 0xADD8E6UL },
+ { wxT("LightCoral"), 0xF08080UL },
+ { wxT("LightCyan"), 0xE0FFFFUL },
+ { wxT("LightGoldenRodYellow"), 0xFAFAD2UL },
+ { wxT("LightGray"), 0xD3D3D3UL },
+ { wxT("LightGrey"), 0xD3D3D3UL },
+ { wxT("LightGreen"), 0x90EE90UL },
+ { wxT("LightPink"), 0xFFB6C1UL },
+ { wxT("LightSalmon"), 0xFFA07AUL },
+ { wxT("LightSeaGreen"), 0x20B2AAUL },
+ { wxT("LightSkyBlue"), 0x87CEFAUL },
+ { wxT("LightSlateGray"), 0x778899UL },
+ { wxT("LightSlateGrey"), 0x778899UL },
+ { wxT("LightSteelBlue"), 0xB0C4DEUL },
+ { wxT("LightYellow"), 0xFFFFE0UL },
+ { wxT("Lime"), 0x00FF00UL },
+ { wxT("LimeGreen"), 0x32CD32UL },
+ { wxT("Linen"), 0xFAF0E6UL },
+ { wxT("Magenta"), 0xFF00FFUL },
+ { wxT("Maroon"), 0x800000UL },
+ { wxT("MediumAquaMarine"), 0x66CDAAUL },
+ { wxT("MediumBlue"), 0x0000CDUL },
+ { wxT("MediumOrchid"), 0xBA55D3UL },
+ { wxT("MediumPurple"), 0x9370DBUL },
+ { wxT("MediumSeaGreen"), 0x3CB371UL },
+ { wxT("MediumSlateBlue"), 0x7B68EEUL },
+ { wxT("MediumSpringGreen"), 0x00FA9AUL },
+ { wxT("MediumTurquoise"), 0x48D1CCUL },
+ { wxT("MediumVioletRed"), 0xC71585UL },
+ { wxT("MidnightBlue"), 0x191970UL },
+ { wxT("MintCream"), 0xF5FFFAUL },
+ { wxT("MistyRose"), 0xFFE4E1UL },
+ { wxT("Moccasin"), 0xFFE4B5UL },
+ { wxT("NavajoWhite"), 0xFFDEADUL },
+ { wxT("Navy"), 0x000080UL },
+ { wxT("OldLace"), 0xFDF5E6UL },
+ { wxT("Olive"), 0x808000UL },
+ { wxT("OliveDrab"), 0x6B8E23UL },
+ { wxT("Orange"), 0xFFA500UL },
+ { wxT("OrangeRed"), 0xFF4500UL },
+ { wxT("Orchid"), 0xDA70D6UL },
+ { wxT("PaleGoldenRod"), 0xEEE8AAUL },
+ { wxT("PaleGreen"), 0x98FB98UL },
+ { wxT("PaleTurquoise"), 0xAFEEEEUL },
+ { wxT("PaleVioletRed"), 0xDB7093UL },
+ { wxT("PapayaWhip"), 0xFFEFD5UL },
+ { wxT("PeachPuff"), 0xFFDAB9UL },
+ { wxT("Peru"), 0xCD853FUL },
+ { wxT("Pink"), 0xFFC0CBUL },
+ { wxT("Plum"), 0xDDA0DDUL },
+ { wxT("PowderBlue"), 0xB0E0E6UL },
+ { wxT("Purple"), 0x800080UL },
+ { wxT("RebeccaPurple"), 0x663399UL },
+ { wxT("Red"), 0xFF0000UL },
+ { wxT("RosyBrown"), 0xBC8F8FUL },
+ { wxT("RoyalBlue"), 0x4169E1UL },
+ { wxT("SaddleBrown"), 0x8B4513UL },
+ { wxT("Salmon"), 0xFA8072UL },
+ { wxT("SandyBrown"), 0xF4A460UL },
+ { wxT("SeaGreen"), 0x2E8B57UL },
+ { wxT("SeaShell"), 0xFFF5EEUL },
+ { wxT("Sienna"), 0xA0522DUL },
+ { wxT("Silver"), 0xC0C0C0UL },
+ { wxT("SkyBlue"), 0x87CEEBUL },
+ { wxT("SlateBlue"), 0x6A5ACDUL },
+ { wxT("SlateGray"), 0x708090UL },
+ { wxT("SlateGrey"), 0x708090UL },
+ { wxT("Snow"), 0xFFFAFAUL },
+ { wxT("SpringGreen"), 0x00FF7FUL },
+ { wxT("SteelBlue"), 0x4682B4UL },
+ { wxT("Tan"), 0xD2B48CUL },
+ { wxT("Teal"), 0x008080UL },
+ { wxT("Thistle"), 0xD8BFD8UL },
+ { wxT("Tomato"), 0xFF6347UL },
+ { wxT("Turquoise"), 0x40E0D0UL },
+ { wxT("Violet"), 0xEE82EEUL },
+ { wxT("Wheat"), 0xF5DEB3UL },
+ { wxT("White"), 0xFFFFFFUL },
+ { wxT("WhiteSmoke"), 0xF5F5F5UL },
+ { wxT("Yellow"), 0xFFFF00UL },
+ { wxT("YellowGreen"), 0x9ACD32UL }
+};
+
+
+
+/** Number of elements in the html_colors array.
+*/
+static const size_t sz_html_colors =
+sizeof(html_colors)/sizeof(html_color_t);
+
+
+
+/** Window type name.
+*/
+wxChar const
+Dk4WxColourPalette::Dk4WxColourPaletteItem::Dk4WxColourPaletteItemName[] = {
+ wxT("Dk4WxColourPaletteItem")
+} ;
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxColourPalette::Dk4WxColourPaletteItem,wxControl)
+#else
+BEGIN_EVENT_TABLE(Dk4WxColourPalette::Dk4WxColourPaletteItem,wxControl)
+#endif
+ EVT_ERASE_BACKGROUND(Dk4WxColourPalette::Dk4WxColourPaletteItem::OnErase)
+ EVT_PAINT(Dk4WxColourPalette::Dk4WxColourPaletteItem::OnPaint)
+ EVT_LEFT_DOWN(Dk4WxColourPalette::Dk4WxColourPaletteItem::OnLeftMouseButtonDown)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(Dk4WxColourPalette::Dk4WxColourPaletteItem,wxControl);
+#else
+IMPLEMENT_DYNAMIC_CLASS(Dk4WxColourPalette::Dk4WxColourPaletteItem,wxControl)
+#endif
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxColourPalette,wxDialog)
+#else
+BEGIN_EVENT_TABLE(Dk4WxColourPalette,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ Dk4WxColourPalette::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ Dk4WxColourPalette::OnCancel\
+ )
+ EVT_SLIDER(\
+ Dk4WxColourPalette::ID_SLIDER_SHADE,\
+ Dk4WxColourPalette::OnShadeSlider\
+ )
+ EVT_SLIDER(\
+ Dk4WxColourPalette::ID_SLIDER_RED,\
+ Dk4WxColourPalette::OnRgbSlider\
+ )
+ EVT_SLIDER(\
+ Dk4WxColourPalette::ID_SLIDER_GREEN,\
+ Dk4WxColourPalette::OnRgbSlider\
+ )
+ EVT_SLIDER(\
+ Dk4WxColourPalette::ID_SLIDER_BLUE,\
+ Dk4WxColourPalette::OnRgbSlider\
+ )
+ EVT_CHOICEBOOK_PAGE_CHANGED(\
+ Dk4WxColourPalette::ID_CHOICEBOOK,\
+ Dk4WxColourPalette::OnChoicebookChanged\
+ )
+ EVT_LISTBOX(\
+ Dk4WxColourPalette::ID_HTML_NAMED_LIST,\
+ Dk4WxColourPalette::OnListBoxChanged\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+/** Text fragments, replaced by localized versions if found.
+*/
+static const wxChar * const message_texts[] = {
+/* 0 */
+wxT("Colour palettes"),
+
+/* 1 */
+wxT("Choose palette type"),
+
+/* 2 */
+wxT("Click palette item to choose color"),
+
+/* 3 */
+wxT("black"),
+
+/* 4 */
+wxT("pure"),
+
+/* 5 */
+wxT("white"),
+
+/* 6 */
+wxT("Shading level"),
+
+/* 7 */
+wxT("Modify shading (mix towards black or white)"),
+
+/* 8 */
+wxT("Select item to choose color"),
+
+/* 9 */
+wxT("Red"),
+
+/* 10 */
+wxT("Green"),
+
+/* 11 */
+wxT("Blue"),
+
+/* 12 */
+wxT("Modify red color component"),
+
+/* 13 */
+wxT("Modify green color component"),
+
+/* 14 */
+wxT("Modify blue color component"),
+
+/* 15 */
+wxT("Cancel"),
+
+/* 16 */
+wxT("Leave dialog, skip settings"),
+
+/* 17 */
+wxT("Red color component value, hexadecimal 00...FF"),
+
+/* 18 */
+wxT("Green color component value, hexadecimal 00...FF"),
+
+/* 19 */
+wxT("Blue color component value, hexadecimal 00...FF"),
+
+/* 20 */
+wxT("Red color component value, decimal 0...255"),
+
+/* 21 */
+wxT("Green color component value, decimal 0...255"),
+
+/* 22 */
+wxT("Blue color component value, decimal 0...255"),
+
+/* 23 */
+wxT("Result color"),
+
+/* 24 */
+wxT("OK"),
+
+/* 25 */
+wxT("Apply settings"),
+
+/* 26 */
+wxT("XFig"),
+
+/* 27 */
+wxT("HTML"),
+
+/* 28 */
+wxT("WEB 216"),
+
+NULL
+
+
+#line 1266 "Dk4WxColourPalette.wxc"
+};
+
+
+static const wxChar * const not_localized_texts[] = {
+/* 0 */
+wxT("FF"),
+
+/* 1 */
+wxT("255"),
+
+/* 2 */
+wxT("%+02d %%"),
+
+/* 3 */
+wxT("%03d"),
+
+/* 4 */
+wxT("%02X"),
+
+NULL
+
+
+#line 1283 "Dk4WxColourPalette.wxc"
+};
+
+
+
+/** String table file name.
+*/
+static const dkChar sttfilename[] = { dkT("dk4colpal.str") };
+
+
+
+/** Color component values corresponding to the RGB slider settings.
+*/
+static const int rgbSliderValues[] = {
+ 0, 0x0033, 0x0066, 0x0099, 0x00CC, 0x00FF
+};
+
+
+
+Dk4WxColourPalette::Dk4WxColourPalette()
+{
+ pAppHelp = NULL;
+ slvshade = 0;
+ rb = gb = bb = r = g = b = 255;
+ slvred = slvgreen = slvblue = 5;
+ listSelection = 0;
+ bIsCorrecting = false;
+}
+
+
+
+
+#line 1314 "Dk4WxColourPalette.wxc"
+
+Dk4WxColourPalette::Dk4WxColourPalette(
+ wxWindow *pParent,
+ Dk4WxApplicationHelper *pAppHelper,
+ int red,
+ int green,
+ int blue,
+ bool withborder
+)
+: wxDialog(
+ pParent, wxID_ANY,
+ wxT("Colour palette"),
+ wxDefaultPosition, wxDefaultSize,
+ Dk4WxColourPalette::GetDialogStyle(false, withborder)
+),
+colourRed(127, 0, 0),
+colourGreen(0, 127, 0),
+colourBlue(0, 0, 127)
+{
+ wxArrayString saHtmlNames;
+ wxChar const * const *lTexts;
+ size_t i;
+
+
+#line 1337 "Dk4WxColourPalette.wxc"
+
+
+#line 1338 "Dk4WxColourPalette.wxc"
+
+
+#line 1339 "Dk4WxColourPalette.wxc"
+
+
+#line 1340 "Dk4WxColourPalette.wxc"
+
+ localizedTexts = lTexts =
+ pAppHelper->GetStringTable(sttfilename, message_texts);
+ if (NULL == localizedTexts) {
+ localizedTexts = lTexts = message_texts;
+ }
+ pAppHelp = pAppHelper;
+ slvshade = 0;
+ rb = r = red;
+ gb = g = green;
+ bb = b = blue;
+ slvred = slvgreen = slvblue = 5;
+ listSelection = 0;
+ bIsCorrecting = false;
+ for (i = 0; i < sz_html_colors; i++) {
+ saHtmlNames.Add(html_colors[i].name);
+ }
+ dkctGUILayoutOK = false;
+ mainSizerHorizontal = NULL;
+ mainSizerVertical = NULL;
+ choiceBookInput = NULL;
+ resultSizerHexadecimal = NULL;
+ resultSizerDecimal = NULL;
+ colourViewResult = NULL;
+ buttonsDialog = NULL;
+ panelFig = NULL;
+ panelHtmlNamed = NULL;
+ panelHtml216 = NULL;
+ figSizerHorizontal = NULL;
+ figSizerVertical = NULL;
+ figButtonRow0 = NULL;
+ figButtonRow1 = NULL;
+ figButtonRow2 = NULL;
+ figButtonRow3 = NULL;
+ figShaderLabelSizer = NULL;
+ figShaderSlider = NULL;
+ b00 = NULL;
+ b01 = NULL;
+ b02 = NULL;
+ b03 = NULL;
+ b04 = NULL;
+ b05 = NULL;
+ b06 = NULL;
+ b07 = NULL;
+ b08 = NULL;
+ b09 = NULL;
+ b10 = NULL;
+ b11 = NULL;
+ b12 = NULL;
+ b13 = NULL;
+ b14 = NULL;
+ b15 = NULL;
+ b16 = NULL;
+ b17 = NULL;
+ b18 = NULL;
+ b19 = NULL;
+ b20 = NULL;
+ b21 = NULL;
+ b22 = NULL;
+ b23 = NULL;
+ b24 = NULL;
+ b25 = NULL;
+ b26 = NULL;
+ b27 = NULL;
+ b28 = NULL;
+ b29 = NULL;
+ b30 = NULL;
+ b31 = NULL;
+ figShaderLabelText = NULL;
+ htmlNamedSizerHorizontal = NULL;
+ htmlNamedSizerVertical = NULL;
+ listHtmlNames = NULL;
+ html216SizerHorizontal = NULL;
+ html216SizerVertical = NULL;
+ labelHtml216Red = NULL;
+ sliderHtml216Red = NULL;
+ labelHtml216Green = NULL;
+ sliderHtml216Green = NULL;
+ labelHtml216Blue = NULL;
+ sliderHtml216Blue = NULL;
+ hexRed = NULL;
+ hexGreen = NULL;
+ hexBlue = NULL;
+ decRed = NULL;
+ decGreen = NULL;
+ decBlue = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ mainSizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(mainSizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ mainSizerHorizontal->Add(10, 10, 0);
+ mainSizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(mainSizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ mainSizerVertical->Add(10, 10, 0);
+ choiceBookInput = new wxChoicebook(
+ this,
+ ID_CHOICEBOOK
+ );
+ if(!(choiceBookInput)) {
+ goto dkctGUILayoutFinished;
+ }
+ panelFig = new wxPanel(
+ choiceBookInput,
+ wxID_ANY
+ );
+ if(!(panelFig)) {
+ goto dkctGUILayoutFinished;
+ }
+ figSizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(figSizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ figSizerHorizontal->Add(5, 5, 1);
+ figSizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(figSizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ figSizerVertical->Add(5, 5, 1);
+ figButtonRow0 = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(figButtonRow0)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 0, 0
+ );
+ if(!(b00)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00->SetToolTip(lTexts[2]);
+ figButtonRow0->Add(
+ b00
+ );
+ figButtonRow0->Add(5, 5, 0);
+ b01 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 0, 255
+ );
+ if(!(b01)) {
+ goto dkctGUILayoutFinished;
+ }
+ b01->SetToolTip(lTexts[2]);
+ figButtonRow0->Add(
+ b01
+ );
+ figButtonRow0->Add(5, 5, 0);
+ b02 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 255, 0
+ );
+ if(!(b02)) {
+ goto dkctGUILayoutFinished;
+ }
+ b02->SetToolTip(lTexts[2]);
+ figButtonRow0->Add(
+ b02
+ );
+ figButtonRow0->Add(5, 5, 0);
+ b03 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 255, 255
+ );
+ if(!(b03)) {
+ goto dkctGUILayoutFinished;
+ }
+ b03->SetToolTip(lTexts[2]);
+ figButtonRow0->Add(
+ b03
+ );
+ figButtonRow0->Add(5, 5, 0);
+ b04 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 0, 0
+ );
+ if(!(b04)) {
+ goto dkctGUILayoutFinished;
+ }
+ b04->SetToolTip(lTexts[2]);
+ figButtonRow0->Add(
+ b04
+ );
+ figButtonRow0->Add(5, 5, 0);
+ b05 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 0, 255
+ );
+ if(!(b05)) {
+ goto dkctGUILayoutFinished;
+ }
+ b05->SetToolTip(lTexts[2]);
+ figButtonRow0->Add(
+ b05
+ );
+ figButtonRow0->Add(5, 5, 0);
+ b06 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 255, 0
+ );
+ if(!(b06)) {
+ goto dkctGUILayoutFinished;
+ }
+ b06->SetToolTip(lTexts[2]);
+ figButtonRow0->Add(
+ b06
+ );
+ figButtonRow0->Add(5, 5, 0);
+ b07 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 255, 255
+ );
+ if(!(b07)) {
+ goto dkctGUILayoutFinished;
+ }
+ b07->SetToolTip(lTexts[2]);
+ figButtonRow0->Add(
+ b07
+ );
+ figSizerVertical->Add(
+ figButtonRow0
+ );
+ figSizerVertical->Add(5, 5, 0);
+ figButtonRow1 = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(figButtonRow1)) {
+ goto dkctGUILayoutFinished;
+ }
+ b08 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 0, 143
+ );
+ if(!(b08)) {
+ goto dkctGUILayoutFinished;
+ }
+ b08->SetToolTip(lTexts[2]);
+ figButtonRow1->Add(
+ b08
+ );
+ figButtonRow1->Add(5, 5, 0);
+ b09 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 0, 176
+ );
+ if(!(b09)) {
+ goto dkctGUILayoutFinished;
+ }
+ b09->SetToolTip(lTexts[2]);
+ figButtonRow1->Add(
+ b09
+ );
+ figButtonRow1->Add(5, 5, 0);
+ b10 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 0, 209
+ );
+ if(!(b10)) {
+ goto dkctGUILayoutFinished;
+ }
+ b10->SetToolTip(lTexts[2]);
+ figButtonRow1->Add(
+ b10
+ );
+ figButtonRow1->Add(5, 5, 0);
+ b11 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 135, 207, 255
+ );
+ if(!(b11)) {
+ goto dkctGUILayoutFinished;
+ }
+ b11->SetToolTip(lTexts[2]);
+ figButtonRow1->Add(
+ b11
+ );
+ figButtonRow1->Add(5, 5, 0);
+ b12 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 143, 0
+ );
+ if(!(b12)) {
+ goto dkctGUILayoutFinished;
+ }
+ b12->SetToolTip(lTexts[2]);
+ figButtonRow1->Add(
+ b12
+ );
+ figButtonRow1->Add(5, 5, 0);
+ b13 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 176, 0
+ );
+ if(!(b13)) {
+ goto dkctGUILayoutFinished;
+ }
+ b13->SetToolTip(lTexts[2]);
+ figButtonRow1->Add(
+ b13
+ );
+ figButtonRow1->Add(5, 5, 0);
+ b14 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 209, 0
+ );
+ if(!(b14)) {
+ goto dkctGUILayoutFinished;
+ }
+ b14->SetToolTip(lTexts[2]);
+ figButtonRow1->Add(
+ b14
+ );
+ figButtonRow1->Add(5, 5, 0);
+ b15 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 143, 143
+ );
+ if(!(b15)) {
+ goto dkctGUILayoutFinished;
+ }
+ b15->SetToolTip(lTexts[2]);
+ figButtonRow1->Add(
+ b15
+ );
+ figSizerVertical->Add(
+ figButtonRow1
+ );
+ figSizerVertical->Add(5, 5, 0);
+ figButtonRow2 = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(figButtonRow2)) {
+ goto dkctGUILayoutFinished;
+ }
+ b16 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 176, 176
+ );
+ if(!(b16)) {
+ goto dkctGUILayoutFinished;
+ }
+ b16->SetToolTip(lTexts[2]);
+ figButtonRow2->Add(
+ b16
+ );
+ figButtonRow2->Add(5, 5, 0);
+ b17 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 0, 209, 209
+ );
+ if(!(b17)) {
+ goto dkctGUILayoutFinished;
+ }
+ b17->SetToolTip(lTexts[2]);
+ figButtonRow2->Add(
+ b17
+ );
+ figButtonRow2->Add(5, 5, 0);
+ b18 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 143, 0, 0
+ );
+ if(!(b18)) {
+ goto dkctGUILayoutFinished;
+ }
+ b18->SetToolTip(lTexts[2]);
+ figButtonRow2->Add(
+ b18
+ );
+ figButtonRow2->Add(5, 5, 0);
+ b19 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 176, 0, 0
+ );
+ if(!(b19)) {
+ goto dkctGUILayoutFinished;
+ }
+ b19->SetToolTip(lTexts[2]);
+ figButtonRow2->Add(
+ b19
+ );
+ figButtonRow2->Add(5, 5, 0);
+ b20 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 209, 0, 0
+ );
+ if(!(b20)) {
+ goto dkctGUILayoutFinished;
+ }
+ b20->SetToolTip(lTexts[2]);
+ figButtonRow2->Add(
+ b20
+ );
+ figButtonRow2->Add(5, 5, 0);
+ b21 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 143, 0, 143
+ );
+ if(!(b21)) {
+ goto dkctGUILayoutFinished;
+ }
+ b21->SetToolTip(lTexts[2]);
+ figButtonRow2->Add(
+ b21
+ );
+ figButtonRow2->Add(5, 5, 0);
+ b22 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 176, 0, 176
+ );
+ if(!(b22)) {
+ goto dkctGUILayoutFinished;
+ }
+ b22->SetToolTip(lTexts[2]);
+ figButtonRow2->Add(
+ b22
+ );
+ figButtonRow2->Add(5, 5, 0);
+ b23 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 209, 0, 209
+ );
+ if(!(b23)) {
+ goto dkctGUILayoutFinished;
+ }
+ b23->SetToolTip(lTexts[2]);
+ figButtonRow2->Add(
+ b23
+ );
+ figSizerVertical->Add(
+ figButtonRow2
+ );
+ figSizerVertical->Add(5, 5, 0);
+ figButtonRow3 = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(figButtonRow3)) {
+ goto dkctGUILayoutFinished;
+ }
+ b24 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 127, 48, 0
+ );
+ if(!(b24)) {
+ goto dkctGUILayoutFinished;
+ }
+ b24->SetToolTip(lTexts[2]);
+ figButtonRow3->Add(
+ b24
+ );
+ figButtonRow3->Add(5, 5, 0);
+ b25 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 160, 63, 0
+ );
+ if(!(b25)) {
+ goto dkctGUILayoutFinished;
+ }
+ b25->SetToolTip(lTexts[2]);
+ figButtonRow3->Add(
+ b25
+ );
+ figButtonRow3->Add(5, 5, 0);
+ b26 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 191, 97, 0
+ );
+ if(!(b26)) {
+ goto dkctGUILayoutFinished;
+ }
+ b26->SetToolTip(lTexts[2]);
+ figButtonRow3->Add(
+ b26
+ );
+ figButtonRow3->Add(5, 5, 0);
+ b27 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 127, 127
+ );
+ if(!(b27)) {
+ goto dkctGUILayoutFinished;
+ }
+ b27->SetToolTip(lTexts[2]);
+ figButtonRow3->Add(
+ b27
+ );
+ figButtonRow3->Add(5, 5, 0);
+ b28 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 160, 160
+ );
+ if(!(b28)) {
+ goto dkctGUILayoutFinished;
+ }
+ b28->SetToolTip(lTexts[2]);
+ figButtonRow3->Add(
+ b28
+ );
+ figButtonRow3->Add(5, 5, 0);
+ b29 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 191, 191
+ );
+ if(!(b29)) {
+ goto dkctGUILayoutFinished;
+ }
+ b29->SetToolTip(lTexts[2]);
+ figButtonRow3->Add(
+ b29
+ );
+ figButtonRow3->Add(5, 5, 0);
+ b30 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 224, 224
+ );
+ if(!(b30)) {
+ goto dkctGUILayoutFinished;
+ }
+ b30->SetToolTip(lTexts[2]);
+ figButtonRow3->Add(
+ b30
+ );
+ figButtonRow3->Add(5, 5, 0);
+ b31 = new Dk4WxColourPaletteItem(
+ panelFig,wxID_ANY,this, pAppHelper, 255, 214, 0
+ );
+ if(!(b31)) {
+ goto dkctGUILayoutFinished;
+ }
+ b31->SetToolTip(lTexts[2]);
+ figButtonRow3->Add(
+ b31
+ );
+ figSizerVertical->Add(
+ figButtonRow3
+ );
+ figSizerVertical->Add(10, 10, 0);
+ figShaderLabelSizer = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(figShaderLabelSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ figShaderLabelSizer->Add(10, 10, 1);
+ figShaderLabelText = new wxStaticText(
+ panelFig,
+ wxID_ANY,
+ lTexts[4],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTRE
+ );
+ if(!(figShaderLabelText)) {
+ goto dkctGUILayoutFinished;
+ }
+ figShaderLabelText->SetToolTip(lTexts[6]);
+ figShaderLabelSizer->Add(
+ figShaderLabelText
+ );
+ figShaderLabelSizer->Add(10, 10, 1);
+ figSizerVertical->Add(
+ figShaderLabelSizer,
+ 0,
+ wxGROW
+ );
+ figSizerVertical->Add(5, 5, 0);
+ figShaderSlider = new wxSlider(
+ panelFig,
+ ID_SLIDER_SHADE,
+ 0,
+ -20,
+ 20
+ );
+ if(!(figShaderSlider)) {
+ goto dkctGUILayoutFinished;
+ }
+ figShaderSlider->SetToolTip(lTexts[7]);
+ figSizerVertical->Add(
+ figShaderSlider,
+ 0,
+ wxGROW
+ );
+ figSizerVertical->Add(5, 5, 1);
+ figSizerHorizontal->Add(
+ figSizerVertical
+ );
+ figSizerHorizontal->Add(5, 5, 1);
+ panelFig->SetSizer(figSizerHorizontal);
+ choiceBookInput->AddPage(panelFig, lTexts[26]);
+ panelHtmlNamed = new wxPanel(
+ choiceBookInput,
+ wxID_ANY
+ );
+ if(!(panelHtmlNamed)) {
+ goto dkctGUILayoutFinished;
+ }
+ htmlNamedSizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(htmlNamedSizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ htmlNamedSizerHorizontal->Add(5, 5, 0);
+ htmlNamedSizerVertical = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(htmlNamedSizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ htmlNamedSizerVertical->Add(5, 5, 0);
+ listHtmlNames = new wxListBox(
+ panelHtmlNamed,
+ ID_HTML_NAMED_LIST,
+ wxDefaultPosition,
+ wxSize(200, 200),
+ saHtmlNames,
+ wxLB_SINGLE|wxLB_HSCROLL|wxLB_NEEDED_SB
+ );
+ if(!(listHtmlNames)) {
+ goto dkctGUILayoutFinished;
+ }
+ listHtmlNames->SetToolTip(lTexts[8]);
+ htmlNamedSizerVertical->Add(
+ listHtmlNames
+ );
+ htmlNamedSizerVertical->Add(5, 5, 0);
+ htmlNamedSizerHorizontal->Add(
+ htmlNamedSizerVertical
+ );
+ htmlNamedSizerHorizontal->Add(5, 5, 0);
+ panelHtmlNamed->SetSizer(htmlNamedSizerHorizontal);
+ choiceBookInput->AddPage(panelHtmlNamed, lTexts[27]);
+ panelHtml216 = new wxPanel(
+ choiceBookInput,
+ wxID_ANY
+ );
+ if(!(panelHtml216)) {
+ goto dkctGUILayoutFinished;
+ }
+ html216SizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(html216SizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ html216SizerHorizontal->Add(5, 5, 0);
+ html216SizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(html216SizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ html216SizerVertical->Add(250, 5, 0);
+ labelHtml216Red = new wxStaticText(
+ panelHtml216,
+ wxID_ANY,
+ lTexts[9]
+ );
+ if(!(labelHtml216Red)) {
+ goto dkctGUILayoutFinished;
+ }
+ html216SizerVertical->Add(
+ labelHtml216Red
+ );
+ sliderHtml216Red = new wxSlider(
+ panelHtml216,
+ ID_SLIDER_RED,
+ 0,
+ 0,
+ 5
+ );
+ if(!(sliderHtml216Red)) {
+ goto dkctGUILayoutFinished;
+ }
+ sliderHtml216Red->SetToolTip(lTexts[12]);
+ html216SizerVertical->Add(
+ sliderHtml216Red,
+ 0,
+ wxGROW
+ );
+ html216SizerVertical->Add(5, 5, 0);
+ labelHtml216Green = new wxStaticText(
+ panelHtml216,
+ wxID_ANY,
+ lTexts[10]
+ );
+ if(!(labelHtml216Green)) {
+ goto dkctGUILayoutFinished;
+ }
+ html216SizerVertical->Add(
+ labelHtml216Green
+ );
+ sliderHtml216Green = new wxSlider(
+ panelHtml216,
+ ID_SLIDER_GREEN,
+ 0,
+ 0,
+ 5
+ );
+ if(!(sliderHtml216Green)) {
+ goto dkctGUILayoutFinished;
+ }
+ sliderHtml216Green->SetToolTip(lTexts[13]);
+ html216SizerVertical->Add(
+ sliderHtml216Green,
+ 0,
+ wxGROW
+ );
+ html216SizerVertical->Add(5, 5, 0);
+ labelHtml216Blue = new wxStaticText(
+ panelHtml216,
+ wxID_ANY,
+ lTexts[11]
+ );
+ if(!(labelHtml216Blue)) {
+ goto dkctGUILayoutFinished;
+ }
+ html216SizerVertical->Add(
+ labelHtml216Blue
+ );
+ sliderHtml216Blue = new wxSlider(
+ panelHtml216,
+ ID_SLIDER_BLUE,
+ 0,
+ 0,
+ 5
+ );
+ if(!(sliderHtml216Blue)) {
+ goto dkctGUILayoutFinished;
+ }
+ sliderHtml216Blue->SetToolTip(lTexts[14]);
+ html216SizerVertical->Add(
+ sliderHtml216Blue,
+ 0,
+ wxGROW
+ );
+ html216SizerVertical->Add(5, 5, 0);
+ html216SizerHorizontal->Add(
+ html216SizerVertical
+ );
+ html216SizerHorizontal->Add(5, 5, 0);
+ panelHtml216->SetSizer(html216SizerHorizontal);
+ choiceBookInput->AddPage(panelHtml216, lTexts[28]);
+ choiceBookInput->SetToolTip(lTexts[1]);
+ mainSizerVertical->Add(
+ choiceBookInput
+ );
+ mainSizerVertical->Add(10, 10, 0);
+ resultSizerHexadecimal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(resultSizerHexadecimal)) {
+ goto dkctGUILayoutFinished;
+ }
+ hexRed = new wxStaticText(
+ this,
+ wxID_ANY,
+ not_localized_texts[0]
+ );
+ if(!(hexRed)) {
+ goto dkctGUILayoutFinished;
+ }
+ hexRed->SetToolTip(lTexts[17]);
+ resultSizerHexadecimal->Add(
+ hexRed
+ );
+ resultSizerHexadecimal->Add(10, 10, 1);
+ hexGreen = new wxStaticText(
+ this,
+ wxID_ANY,
+ not_localized_texts[0],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTRE
+ );
+ if(!(hexGreen)) {
+ goto dkctGUILayoutFinished;
+ }
+ hexGreen->SetToolTip(lTexts[18]);
+ resultSizerHexadecimal->Add(
+ hexGreen
+ );
+ resultSizerHexadecimal->Add(10, 10, 1);
+ hexBlue = new wxStaticText(
+ this,
+ wxID_ANY,
+ not_localized_texts[0],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_RIGHT
+ );
+ if(!(hexBlue)) {
+ goto dkctGUILayoutFinished;
+ }
+ hexBlue->SetToolTip(lTexts[19]);
+ resultSizerHexadecimal->Add(
+ hexBlue
+ );
+ mainSizerVertical->Add(
+ resultSizerHexadecimal,
+ 0,
+ wxGROW
+ );
+ resultSizerDecimal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(resultSizerDecimal)) {
+ goto dkctGUILayoutFinished;
+ }
+ decRed = new wxStaticText(
+ this,
+ wxID_ANY,
+ not_localized_texts[1]
+ );
+ if(!(decRed)) {
+ goto dkctGUILayoutFinished;
+ }
+ decRed->SetToolTip(lTexts[20]);
+ resultSizerDecimal->Add(
+ decRed
+ );
+ resultSizerDecimal->Add(10, 10, 1);
+ decGreen = new wxStaticText(
+ this,
+ wxID_ANY,
+ not_localized_texts[1],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTRE
+ );
+ if(!(decGreen)) {
+ goto dkctGUILayoutFinished;
+ }
+ decGreen->SetToolTip(lTexts[21]);
+ resultSizerDecimal->Add(
+ decGreen
+ );
+ resultSizerDecimal->Add(10, 10, 1);
+ decBlue = new wxStaticText(
+ this,
+ wxID_ANY,
+ not_localized_texts[1],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_RIGHT
+ );
+ if(!(decBlue)) {
+ goto dkctGUILayoutFinished;
+ }
+ decBlue->SetToolTip(lTexts[22]);
+ resultSizerDecimal->Add(
+ decBlue
+ );
+ mainSizerVertical->Add(
+ resultSizerDecimal,
+ 0,
+ wxGROW
+ );
+ mainSizerVertical->Add(5, 5, 0);
+ colourViewResult = new Dk4WxColourView(
+ this,wxID_ANY,pAppHelp, r, g, b
+ );
+ if(!(colourViewResult)) {
+ goto dkctGUILayoutFinished;
+ }
+ colourViewResult->SetMinSize(wxSize(50, 50));
+ colourViewResult->SetToolTip(lTexts[23]);
+ mainSizerVertical->Add(
+ colourViewResult,
+ 0,
+ wxGROW
+ );
+ mainSizerVertical->Add(10, 10, 0);
+ buttonsDialog = new wxStdDialogButtonSizer(
+ );
+ if(!(buttonsDialog)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ lTexts[24]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(lTexts[25]);
+ buttonsDialog->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ lTexts[15]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(lTexts[16]);
+ buttonsDialog->AddButton(
+ buttonCancel
+ );
+ buttonsDialog->Realize();
+ mainSizerVertical->Add(
+ buttonsDialog,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ mainSizerVertical->Add(10, 10, 0);
+ mainSizerHorizontal->Add(
+ mainSizerVertical
+ );
+ mainSizerHorizontal->Add(10, 10, 0);
+ SetSizer(mainSizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ mainSizerHorizontal->Fit(this);
+ mainSizerHorizontal->SetSizeHints(this);
+ }
+
+#line 1358 "Dk4WxColourPalette.wxc"
+ if (dkctGUILayoutOK) {
+ colourViewResult->SetActive(false);
+ colourViewResult->SetMarkActiveInactive(false);
+ decRed->SetForegroundColour(colourRed);
+ decGreen->SetForegroundColour(colourGreen);
+ decBlue->SetForegroundColour(colourBlue);
+ hexRed->SetForegroundColour(colourRed);
+ hexGreen->SetForegroundColour(colourGreen);
+ hexBlue->SetForegroundColour(colourBlue);
+ SetRgbTextLabels();
+ FindRgbSliderValues();
+ FindListBoxEntry();
+ SetTitle(lTexts[0]);
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+
+
+#line 1375 "Dk4WxColourPalette.wxc"
+}
+
+
+#line 1378 "Dk4WxColourPalette.wxc"
+
+
+void
+Dk4WxColourPalette::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+Dk4WxColourPalette::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+void
+Dk4WxColourPalette::OnChoicebookChanged(wxBookCtrlEvent & event)
+#else
+void
+Dk4WxColourPalette::OnChoicebookChanged(wxChoicebookEvent & event)
+#endif
+{
+ int pn;
+
+
+#line 1418 "Dk4WxColourPalette.wxc"
+ pn = event.GetSelection();
+ if (1 == pn) {
+ if (wxNOT_FOUND != listSelection) {
+ listHtmlNames->SetSelection(listSelection);
+ }
+ }
+
+
+#line 1425 "Dk4WxColourPalette.wxc"
+}
+
+
+
+int
+Dk4WxColourPalette::ShadeColour(int val)
+{
+ int back;
+
+ back = val;
+ if (0 < slvshade) {
+ back = (((20 - slvshade) * val) + (slvshade * 255)) / 20;
+ }
+ else {
+ if (0 > slvshade) {
+ back = (val * (20 + slvshade)) / 20;
+ }
+ }
+ return back;
+}
+
+
+
+void
+Dk4WxColourPalette::CorrectShadeLabel(void)
+{
+ wxString lstr;
+
+ switch (slvshade) {
+ case -20 : {
+ figShaderLabelText->SetLabel(localizedTexts[3]);
+ } break;
+ case 0 : {
+ figShaderLabelText->SetLabel(localizedTexts[4]);
+ } break;
+ case 20 : {
+ figShaderLabelText->SetLabel(localizedTexts[5]);
+ } break;
+ default : {
+ lstr.Printf(not_localized_texts[2], (5*slvshade));
+ figShaderLabelText->SetLabel(lstr);
+ } break;
+ }
+}
+
+
+
+void
+Dk4WxColourPalette::SetBaseRGB(int red, int green, int blue)
+{
+
+
+#line 1476 "Dk4WxColourPalette.wxc"
+ rb = red; gb = green; bb = blue;
+ CorrectGui(REASON_BASE_COLOR);
+
+
+#line 1479 "Dk4WxColourPalette.wxc"
+}
+
+
+
+void
+Dk4WxColourPalette::OnShadeSlider(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1487 "Dk4WxColourPalette.wxc"
+ if (!(bIsCorrecting)) {
+ slvshade = figShaderSlider->GetValue();
+ CorrectGui(REASON_SHADE_SLIDER);
+ }
+
+
+#line 1492 "Dk4WxColourPalette.wxc"
+}
+
+
+
+void
+Dk4WxColourPalette::OnListBoxChanged(wxCommandEvent & WXUNUSED(event))
+{
+ int in;
+ unsigned long ul;
+
+
+#line 1502 "Dk4WxColourPalette.wxc"
+ if (!(bIsCorrecting)) {
+ listSelection = in = listHtmlNames->GetSelection();
+ if ((0 <= in) && (wxNOT_FOUND != in)) {
+ ul = html_colors[in].rgb;
+ r = rb = (int)((ul >> 16) & 0x000000FFUL);
+ g = gb = (int)((ul >> 8) & 0x000000FFUL);
+ b = bb = (int)( ul & 0x000000FFUL);
+ CorrectGui(REASON_LIST_SELECT);
+ }
+ }
+
+
+#line 1513 "Dk4WxColourPalette.wxc"
+}
+
+
+
+void
+Dk4WxColourPalette::OnRgbSlider(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1521 "Dk4WxColourPalette.wxc"
+ if (!(bIsCorrecting)) {
+ rb = r = rgbSliderValues[sliderHtml216Red->GetValue()];
+ gb = g = rgbSliderValues[sliderHtml216Green->GetValue()];
+ bb = b = rgbSliderValues[sliderHtml216Blue->GetValue()];
+ CorrectGui(REASON_RGB_SLIDER);
+ }
+
+
+#line 1528 "Dk4WxColourPalette.wxc"
+}
+
+
+
+int
+Dk4WxColourPalette::FindSliderValue(int colval)
+{
+ long mindiff = 0L;
+ long curdiff;
+ int back = 0;
+ int i;
+ for (i = 0; i < 6; i++) {
+ curdiff = labs(colval - rgbSliderValues[i]);
+ if ((0 == i) || (curdiff < mindiff)) {
+ back = i;
+ mindiff = curdiff;
+ }
+ }
+ return back;
+}
+
+
+
+void
+Dk4WxColourPalette::FindRgbSliderValues(void)
+{
+ int sl;
+ sl = FindSliderValue(r);
+ slvred = sl;
+ sliderHtml216Red->SetValue(sl);
+ sl = FindSliderValue(g);
+ slvgreen = sl;
+ sliderHtml216Green->SetValue(sl);
+ sl = FindSliderValue(b);
+ slvblue = sl;
+ sliderHtml216Blue->SetValue(sl);
+}
+
+
+
+void
+Dk4WxColourPalette::FindListBoxEntry(void)
+{
+ size_t i;
+ size_t mini;
+ unsigned long ul;
+ unsigned long curdiff;
+ unsigned long mindiff;
+ unsigned long r0;
+ unsigned long g0;
+ unsigned long b0;
+
+ mindiff = 0UL; mini = 0;
+ for (i = 0; i < sz_html_colors; i++) {
+ ul = html_colors[i].rgb;
+ r0 = (ul >> 16) & 0x000000FFUL;
+ g0 = (ul >> 8) & 0x000000FFUL;
+ b0 = ul & 0x000000FFUL;
+ r0 = labs((long)r0 - (long)r);
+ g0 = labs((long)g0 - (long)g);
+ b0 = labs((long)b0 - (long)b);
+ r0 = r0 * r0;
+ g0 = g0 * g0;
+ b0 = b0 * b0;
+ curdiff = r0 + g0 + b0;
+ if ((0 == i) || (curdiff < mindiff)) {
+ mindiff = curdiff;
+ mini = i;
+ }
+ }
+ listSelection = mini;
+ listHtmlNames->SetSelection((int)mini);
+}
+
+
+
+void
+Dk4WxColourPalette::SetRgbTextLabels(void)
+{
+ wxString valstr;
+
+ valstr.Printf(not_localized_texts[3], r);
+ decRed->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[3], g);
+ decGreen->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[3], b);
+ decBlue->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[4], r);
+ hexRed->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[4], g);
+ hexGreen->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[4], b);
+ hexBlue->SetLabel(valstr);
+}
+
+
+
+void
+Dk4WxColourPalette::CorrectGui(int reason)
+{
+
+
+#line 1629 "Dk4WxColourPalette.wxc"
+ if(!(bIsCorrecting)) {
+
+#line 1630 "Dk4WxColourPalette.wxc"
+ /*
+ Mark correction in progress
+ */
+ bIsCorrecting = true;
+ /*
+ Apply the changes
+ */
+ switch (reason) {
+ case REASON_CHOICEBOOK : {
+ } break;
+ case REASON_BASE_COLOR : {
+
+#line 1641 "Dk4WxColourPalette.wxc"
+ r = ShadeColour(rb);
+ g = ShadeColour(gb);
+ b = ShadeColour(bb);
+ FindListBoxEntry();
+ FindRgbSliderValues();
+ } break;
+ case REASON_SHADE_SLIDER : {
+
+#line 1648 "Dk4WxColourPalette.wxc"
+ r = ShadeColour(rb);
+ g = ShadeColour(gb);
+ b = ShadeColour(bb);
+ FindListBoxEntry();
+ FindRgbSliderValues();
+ CorrectShadeLabel();
+ } break;
+ case REASON_LIST_SELECT : {
+
+#line 1656 "Dk4WxColourPalette.wxc"
+ FindRgbSliderValues();
+ slvshade = 0;
+ figShaderSlider->SetValue(0);
+ CorrectShadeLabel();
+ } break;
+ case REASON_RGB_SLIDER : {
+
+#line 1662 "Dk4WxColourPalette.wxc"
+ FindListBoxEntry();
+ slvshade = 0;
+ figShaderSlider->SetValue(0);
+ CorrectShadeLabel();
+ } break;
+ }
+ /*
+ Mark correction as done
+ */
+ bIsCorrecting = false;
+ /*
+ Update result color viewer and dialog window
+ */
+ SetRgbTextLabels();
+ colourViewResult->SetRGB(r, g, b);
+ Refresh();
+ Update();
+ }
+
+
+#line 1681 "Dk4WxColourPalette.wxc"
+}
+
+
+
+int
+Dk4WxColourPalette::Red(void) const
+{
+ return r;
+}
+
+
+
+int
+Dk4WxColourPalette::Green(void) const
+{
+ return g;
+}
+
+
+
+int
+Dk4WxColourPalette::Blue(void) const
+{
+ return b;
+}
+
+
+
+Dk4WxColourPalette::Dk4WxColourPaletteItem::Dk4WxColourPaletteItem()
+{
+ pParentWindow = NULL;
+ pAppHelp = NULL;
+ w = h = -1;
+ r = g = b = 255;
+}
+
+
+
+Dk4WxColourPalette::Dk4WxColourPaletteItem::Dk4WxColourPaletteItem(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxColourPalette *pal,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos,
+ wxSize const & size,
+ long style,
+ wxChar const *name
+)
+: wxControl(
+ pParent, wxid, pos, size, style, wxDefaultValidator,
+ wxString(name)
+)
+{
+
+ pParentWindow = pal;
+ pAppHelp = appHelper;
+ w = h = -1;
+ r = red;
+ g = green;
+ b = blue;
+}
+
+
+
+bool
+Dk4WxColourPalette::Dk4WxColourPaletteItem::Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxColourPalette *pal,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos,
+ wxSize const & size,
+ long style,
+ wxChar const *name
+)
+{
+ bool back = wxControl::Create(
+ pParent, wxid, pos, size, style, wxDefaultValidator,
+ wxString(name)
+ );
+ pParentWindow = pal;
+ pAppHelp = appHelper;
+ w = h = -1;
+ r = red;
+ g = green;
+ b = blue;
+ return back;
+}
+
+
+
+wxSize
+Dk4WxColourPalette::Dk4WxColourPaletteItem::DoGetBestSize() const
+{
+ wxSize back(((-1 < w) ? w : 25), ((-1 < h) ? h : 25));
+ return back;
+}
+
+
+
+void
+Dk4WxColourPalette::Dk4WxColourPaletteItem::OnErase(wxEraseEvent & WXUNUSED(event))
+{
+
+}
+
+
+
+void
+Dk4WxColourPalette::Dk4WxColourPaletteItem::OnPaint(wxPaintEvent & WXUNUSED(event))
+{
+ wxBufferedPaintDC useDC(this);
+ wxSize sz = GetClientSize();
+ wxColour mycolor(r, g, b);
+#if wxCHECK_VERSION(3,0,0)
+ wxBrush myBrush(mycolor, wxBRUSHSTYLE_SOLID);
+#else
+ wxBrush myBrush(mycolor, wxSOLID);
+#endif
+ const wxBrush oldBrus = useDC.GetBrush();
+ useDC.SetBrush(myBrush);
+ useDC.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight());
+ useDC.SetBrush(wxNullBrush);
+}
+
+
+
+void
+Dk4WxColourPalette::Dk4WxColourPaletteItem::OnLeftMouseButtonDown(
+ wxMouseEvent & WXUNUSED(event)
+)
+{
+ if (NULL != pParentWindow) {
+ pParentWindow->SetBaseRGB(r, g, b);
+ }
+}
+
+
+
+int
+Dk4WxColourPalette::GetDialogStyle(bool bBorder, bool bTitle)
+{
+ int back = wxDEFAULT_DIALOG_STYLE;
+
+ back &= (~(wxCLOSE_BOX));
+ back &= (~(wxSYSTEM_MENU));
+ if (!(bBorder)) {
+ back &= (~(wxRESIZE_BORDER));
+ }
+ if (!(bTitle)) {
+ back &= (~(wxCAPTION));
+ }
+ return back;
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Dk4WxColourPalette.h b/support/dktools/Dk4WxColourPalette.h
new file mode 100644
index 0000000000..f494b916e7
--- /dev/null
+++ b/support/dktools/Dk4WxColourPalette.h
@@ -0,0 +1,868 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxColourPalette.wxc
+*/
+
+/** @file Dk4WxColourPalette.h Header file for the Dk4WxColourPalette module.
+*/
+
+#ifndef DK4WXCOLOURPALETTE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4WXCOLOURPALETTE_H_INCLUDED 1
+
+
+#line 430 "Dk4WxColourPalette.wxc"
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef WX_GBSIZER_H_INCLUDED
+#include <wx/gbsizer.h>
+#define WX_GBSIZER_H_INCLUDED 1
+#endif
+
+#ifndef WX_BOOKCTRL_H_INCLUDED
+#include <wx/bookctrl.h>
+#define WX_BOOKCTRL_H_INCLUDED 1
+#endif
+
+#ifndef WX_CHOICEBK_H_INCLUDED
+#include <wx/choicebk.h>
+#define WX_CHOICEBK_H_INCLUDED 1
+#endif
+
+#ifndef WX_STATBOX_H_INCLUDED
+#include <wx/statbox.h>
+#define WX_STATBOX_H_INCLUDED 1
+#endif
+
+#ifndef DK4WXAPPLICTIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
+#endif
+
+#ifndef DK4WXCOLOURVIEW_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxColourView.h"
+#else
+#include <dktools-4/Dk4WxColourView.h>
+#endif
+#endif
+
+
+#line 492 "Dk4WxColourPalette.wxc"
+
+/** Color palette allowing to choose between predefined colours.
+*/
+class Dk4WxColourPalette : public wxDialog
+{
+ /** Item in a colour palette.
+ */
+ class Dk4WxColourPaletteItem : public wxControl
+ {
+ /** Class is dynamic.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(Dk4WxColourPaletteItem);
+#else
+ DECLARE_DYNAMIC_CLASS(Dk4WxColourPaletteItem)
+#endif
+
+ /** Event table for control.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent dialog we have to notify about color change.
+ */
+ Dk4WxColourPalette *pParentWindow;
+
+ /** Application helper.
+ */
+ Dk4WxApplicationHelper *pAppHelp;
+
+ /** Class name, used in constructor and Create().
+ */
+ static wxChar const Dk4WxColourPaletteItemName[];
+
+ /** Height.
+ */
+ int w;
+
+ /** Width.
+ */
+ int h;
+
+ /** Red component of color to show.
+ */
+ int r;
+
+ /** Green component of color to show.
+ */
+ int g;
+
+ /** Blue component of color to show.
+ */
+ int b;
+
+ public:
+
+ /** Default constructor.
+ */
+ Dk4WxColourPaletteItem();
+
+ /** Constructor.
+ @param pParent Parent window.
+ @param wxid Window ID.
+ @param appHelper Application helper.
+ @param red Red component of color to show.
+ @param green Green component of color to show.
+ @param blue Blue component of color to show.
+ @param pos Object position.
+ @param size Object minimum size.
+ @param style Style for control.
+ @param name Class name.
+ */
+ Dk4WxColourPaletteItem(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxColourPalette *pal,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & size = wxDefaultSize,
+ long style = wxBORDER_NONE,
+ wxChar const *name = Dk4WxColourPaletteItemName
+ );
+
+ /** Create object after using default constructor.
+ @param pParent Parent window.
+ @param wxid Window ID.
+ @param appHelper Application helper.
+ @param red Red component of color to show.
+ @param green Green component of color to show.
+ @param blue Blue component of color to show.
+ @param pos Object position.
+ @param size Object minimum size.
+ @param style Style for control.
+ @param name Class name.
+ @return true on success, false on error.
+ */
+ bool
+ Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxColourPalette *pal,
+ Dk4WxApplicationHelper *appHelper,
+ int red = 255,
+ int green = 255,
+ int blue = 255,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & size = wxDefaultSize,
+ long style = wxBORDER_NONE,
+ wxChar const *name = Dk4WxColourPaletteItemName
+ );
+
+ /** Find minimum size.
+ */
+ wxSize
+ DoGetBestSize() const;
+
+ /** Handler for erase event.
+ @param event Event to process.
+ */
+ void
+ OnErase(wxEraseEvent & event);
+
+ /** Handler for paint event.
+ @param event Event to process.
+ */
+ void
+ OnPaint(wxPaintEvent & event);
+
+ /** Handler for mouse click event.
+ @param event Event to process.
+ */
+ void
+ OnLeftMouseButtonDown(wxMouseEvent & event);
+
+ };
+
+private:
+
+ /** Events we have to respond to.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+protected:
+
+ /** Red colour for text labels.
+ */
+ wxColour colourRed;
+
+ /** Green colour for text labels.
+ */
+ wxColour colourGreen;
+
+ /** Blue colour for text labels.
+ */
+ wxColour colourBlue;
+
+ /** Application helper.
+ */
+ Dk4WxApplicationHelper *pAppHelp;
+
+ /** Localized texts.
+ */
+ wxChar const * const *localizedTexts;
+
+ /** Shade slider value -20 to 20.
+ */
+ int slvshade;
+
+ /** Red slider value 0 to 5.
+ */
+ int slvred;
+
+ /** Green slider value 0 to 5.
+ */
+ int slvgreen;
+
+ /** Blue slider value 0 to 5.
+ */
+ int slvblue;
+
+ /** Index of selected list item.
+ */
+ int listSelection;
+
+ /** Base red component, not shaded.
+ */
+ int rb;
+
+ /** Base green component, not shaded.
+ */
+ int gb;
+
+ /** Base blue component, not shaded.
+ */
+ int bb;
+
+ /** Result red component.
+ */
+ int r;
+
+ /** Result green component.
+ */
+ int g;
+
+ /** Result blue component.
+ */
+ int b;
+
+ /** Flag: Already in correction process.
+ */
+ bool bIsCorrecting;
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element mainSizerHorizontal.
+ */
+#line 12 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *mainSizerHorizontal;
+
+ /** GUI element mainSizerVertical.
+ */
+#line 18 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *mainSizerVertical;
+
+ /** GUI element choiceBookInput.
+ */
+#line 31 "Dk4WxColourPalette.wxc"
+ wxChoicebook *choiceBookInput;
+
+ /** GUI element resultSizerHexadecimal.
+ */
+#line 362 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *resultSizerHexadecimal;
+
+ /** GUI element resultSizerDecimal.
+ */
+#line 371 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *resultSizerDecimal;
+
+ /** GUI element colourViewResult.
+ */
+#line 408 "Dk4WxColourPalette.wxc"
+ Dk4WxColourView *colourViewResult;
+
+ /** GUI element buttonsDialog.
+ */
+#line 414 "Dk4WxColourPalette.wxc"
+ wxStdDialogButtonSizer *buttonsDialog;
+
+ /** GUI element panelFig.
+ */
+#line 38 "Dk4WxColourPalette.wxc"
+ wxPanel *panelFig;
+
+ /** GUI element panelHtmlNamed.
+ */
+#line 284 "Dk4WxColourPalette.wxc"
+ wxPanel *panelHtmlNamed;
+
+ /** GUI element panelHtml216.
+ */
+#line 306 "Dk4WxColourPalette.wxc"
+ wxPanel *panelHtml216;
+
+ /** GUI element figSizerHorizontal.
+ */
+#line 42 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *figSizerHorizontal;
+
+ /** GUI element figSizerVertical.
+ */
+#line 48 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *figSizerVertical;
+
+ /** GUI element figButtonRow0.
+ */
+#line 64 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *figButtonRow0;
+
+ /** GUI element figButtonRow1.
+ */
+#line 82 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *figButtonRow1;
+
+ /** GUI element figButtonRow2.
+ */
+#line 100 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *figButtonRow2;
+
+ /** GUI element figButtonRow3.
+ */
+#line 118 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *figButtonRow3;
+
+ /** GUI element figShaderLabelSizer.
+ */
+#line 264 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *figShaderLabelSizer;
+
+ /** GUI element figShaderSlider.
+ */
+#line 276 "Dk4WxColourPalette.wxc"
+ wxSlider *figShaderSlider;
+
+ /** GUI element b00.
+ */
+#line 136 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b00;
+
+ /** GUI element b01.
+ */
+#line 140 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b01;
+
+ /** GUI element b02.
+ */
+#line 144 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b02;
+
+ /** GUI element b03.
+ */
+#line 148 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b03;
+
+ /** GUI element b04.
+ */
+#line 152 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b04;
+
+ /** GUI element b05.
+ */
+#line 156 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b05;
+
+ /** GUI element b06.
+ */
+#line 160 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b06;
+
+ /** GUI element b07.
+ */
+#line 164 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b07;
+
+ /** GUI element b08.
+ */
+#line 168 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b08;
+
+ /** GUI element b09.
+ */
+#line 172 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b09;
+
+ /** GUI element b10.
+ */
+#line 176 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b10;
+
+ /** GUI element b11.
+ */
+#line 180 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b11;
+
+ /** GUI element b12.
+ */
+#line 184 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b12;
+
+ /** GUI element b13.
+ */
+#line 188 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b13;
+
+ /** GUI element b14.
+ */
+#line 192 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b14;
+
+ /** GUI element b15.
+ */
+#line 196 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b15;
+
+ /** GUI element b16.
+ */
+#line 200 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b16;
+
+ /** GUI element b17.
+ */
+#line 204 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b17;
+
+ /** GUI element b18.
+ */
+#line 208 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b18;
+
+ /** GUI element b19.
+ */
+#line 212 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b19;
+
+ /** GUI element b20.
+ */
+#line 216 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b20;
+
+ /** GUI element b21.
+ */
+#line 220 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b21;
+
+ /** GUI element b22.
+ */
+#line 224 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b22;
+
+ /** GUI element b23.
+ */
+#line 228 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b23;
+
+ /** GUI element b24.
+ */
+#line 232 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b24;
+
+ /** GUI element b25.
+ */
+#line 236 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b25;
+
+ /** GUI element b26.
+ */
+#line 240 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b26;
+
+ /** GUI element b27.
+ */
+#line 244 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b27;
+
+ /** GUI element b28.
+ */
+#line 248 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b28;
+
+ /** GUI element b29.
+ */
+#line 252 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b29;
+
+ /** GUI element b30.
+ */
+#line 256 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b30;
+
+ /** GUI element b31.
+ */
+#line 260 "Dk4WxColourPalette.wxc"
+ Dk4WxColourPaletteItem *b31;
+
+ /** GUI element figShaderLabelText.
+ */
+#line 271 "Dk4WxColourPalette.wxc"
+ wxStaticText *figShaderLabelText;
+
+ /** GUI element htmlNamedSizerHorizontal.
+ */
+#line 288 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *htmlNamedSizerHorizontal;
+
+ /** GUI element htmlNamedSizerVertical.
+ */
+#line 294 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *htmlNamedSizerVertical;
+
+ /** GUI element listHtmlNames.
+ */
+#line 299 "Dk4WxColourPalette.wxc"
+ wxListBox *listHtmlNames;
+
+ /** GUI element html216SizerHorizontal.
+ */
+#line 310 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *html216SizerHorizontal;
+
+ /** GUI element html216SizerVertical.
+ */
+#line 316 "Dk4WxColourPalette.wxc"
+ wxBoxSizer *html216SizerVertical;
+
+ /** GUI element labelHtml216Red.
+ */
+#line 329 "Dk4WxColourPalette.wxc"
+ wxStaticText *labelHtml216Red;
+
+ /** GUI element sliderHtml216Red.
+ */
+#line 332 "Dk4WxColourPalette.wxc"
+ wxSlider *sliderHtml216Red;
+
+ /** GUI element labelHtml216Green.
+ */
+#line 340 "Dk4WxColourPalette.wxc"
+ wxStaticText *labelHtml216Green;
+
+ /** GUI element sliderHtml216Green.
+ */
+#line 343 "Dk4WxColourPalette.wxc"
+ wxSlider *sliderHtml216Green;
+
+ /** GUI element labelHtml216Blue.
+ */
+#line 351 "Dk4WxColourPalette.wxc"
+ wxStaticText *labelHtml216Blue;
+
+ /** GUI element sliderHtml216Blue.
+ */
+#line 354 "Dk4WxColourPalette.wxc"
+ wxSlider *sliderHtml216Blue;
+
+ /** GUI element hexRed.
+ */
+#line 380 "Dk4WxColourPalette.wxc"
+ wxStaticText *hexRed;
+
+ /** GUI element hexGreen.
+ */
+#line 384 "Dk4WxColourPalette.wxc"
+ wxStaticText *hexGreen;
+
+ /** GUI element hexBlue.
+ */
+#line 389 "Dk4WxColourPalette.wxc"
+ wxStaticText *hexBlue;
+
+ /** GUI element decRed.
+ */
+#line 394 "Dk4WxColourPalette.wxc"
+ wxStaticText *decRed;
+
+ /** GUI element decGreen.
+ */
+#line 398 "Dk4WxColourPalette.wxc"
+ wxStaticText *decGreen;
+
+ /** GUI element decBlue.
+ */
+#line 403 "Dk4WxColourPalette.wxc"
+ wxStaticText *decBlue;
+
+ /** GUI element buttonOK.
+ */
+#line 418 "Dk4WxColourPalette.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 423 "Dk4WxColourPalette.wxc"
+ wxButton *buttonCancel;
+
+
+#line 717 "Dk4WxColourPalette.wxc"
+
+protected:
+
+ /** Correct shade label.
+ */
+ void
+ CorrectShadeLabel(void);
+
+ /** Shade a color.
+ @param val Original value.
+ @return Shaded color value.
+ */
+ int
+ ShadeColour(int val);
+
+ /** Correct appearance after using controls.
+ @param reason Which control was used.
+ */
+ void
+ CorrectGui(int reason);
+
+ /** Set the R, G, B text labels for the r, g, b variables.
+ */
+ void
+ SetRgbTextLabels(void);
+
+ /** Find RGB slider value next to a given color value.
+ */
+ int
+ FindSliderValue(int colval);
+
+ /** Find slider values next to the r, g, b variables.
+ */
+ void
+ FindRgbSliderValues(void);
+
+ /** Find list box entry next to the r, g, b variables.
+ */
+ void
+ FindListBoxEntry(void);
+
+public:
+
+ /** Our IDs.
+ */
+ enum {
+
+ /** ID of choicebook change.
+ */
+ ID_CHOICEBOOK = ((wxID_HIGHEST) + 1) ,
+
+ /** ID of XFig shade slider.
+ */
+ ID_SLIDER_SHADE ,
+
+ /** ID of HTML named colors list control.
+ */
+ ID_HTML_NAMED_LIST ,
+
+ /** ID of HTML 216 red slider.
+ */
+ ID_SLIDER_RED ,
+
+ /** ID of HTML 216 green slider.
+ */
+ ID_SLIDER_GREEN ,
+
+ /** ID of HTML 216 blue slider.
+ */
+ ID_SLIDER_BLUE
+ };
+
+ /** Reasons for GUI corrections.
+ */
+ enum {
+ /** New page selected in choice book.
+ */
+ REASON_CHOICEBOOK = 0 ,
+
+ /** Base colors changed.
+ */
+ REASON_BASE_COLOR ,
+
+ /** Shade slider changed.
+ */
+ REASON_SHADE_SLIDER ,
+
+ /** List selection changed.
+ */
+ REASON_LIST_SELECT ,
+
+ /** RGB slider changed.
+ */
+ REASON_RGB_SLIDER
+ };
+
+ /** Default constructor.
+ */
+ Dk4WxColourPalette();
+
+ /** Real constructor.
+ @param pParent Parent window.
+ @param pAppHelper Application helper.
+ @param red Initial red component.
+ @param green Initial green component.
+ @param blue Initial blue component.
+ @param withborder Flag: Show border around dialog box.
+ */
+ Dk4WxColourPalette(
+ wxWindow *pParent,
+ Dk4WxApplicationHelper *pAppHelper,
+ int red,
+ int green,
+ int blue,
+ bool withborder = true
+ );
+
+ /** Handler for OK button.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Handler for shade slider events.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnShadeSlider(wxCommandEvent & event);
+
+ /** Handler for RGB slider events.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnRgbSlider(wxCommandEvent & event);
+
+#if wxCHECK_VERSION(3,0,0)
+ /** Handler for changed choicebook page.
+ @param event Event to respond to, unused
+ */
+ void
+ OnChoicebookChanged(wxBookCtrlEvent & event);
+#else
+ /** Handler for changed choicebook page.
+ @param event Event to respond to, unused
+ */
+ void
+ OnChoicebookChanged(wxChoicebookEvent & event);
+#endif
+
+ /** Handler for changed selection on list box.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnListBoxChanged(wxCommandEvent & event);
+
+ /** Retrieve red component.
+ @return Red value.
+ */
+ int
+ Red(void) const;
+
+ /** Retrieve green component.
+ @return Green value.
+ */
+ int
+ Green(void) const;
+
+ /** Retrieve blue component.
+ @return Blue value.
+ */
+ int
+ Blue(void) const;
+
+ /** React on Dk4WxColourPaletteItem click.
+ @param red New base red component.
+ @param green New base green component.
+ @param blue New base blue component.
+ */
+ void
+ SetBaseRGB(int red, int green, int blue);
+
+ /** Construct a dialog style value.
+ @param bBorder Flag: Draw border.
+ @param bTitle Flag: Title bar on dialog.
+ */
+ static
+ int
+ GetDialogStyle(bool bBorder = true, bool bTitle = true);
+
+};
+
+
+
+#line 916 "Dk4WxColourPalette.wxc"
+
+
+#endif
diff --git a/support/dktools/Dk4WxColourPalette.wxc b/support/dktools/Dk4WxColourPalette.wxc
new file mode 100644
index 0000000000..d8488251e2
--- /dev/null
+++ b/support/dktools/Dk4WxColourPalette.wxc
@@ -0,0 +1,1847 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = mainSizerHorizontal
+
+[wxBoxSizer mainSizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = mainSizerVertical
+contents = $space(10)
+
+[wxBoxSizer mainSizerVertical]
+direction = vertical
+contents = $space(10)
+contents = choiceBookInput
+contents = $space(10)
+contents = resultSizerHexadecimal
+contents = resultSizerDecimal
+contents = $space(5)
+contents = colourViewResult
+contents = $space(10)
+contents = buttonsDialog centered-x
+contents = $space(10)
+
+[wxChoicebook choiceBookInput]
+id = ID_CHOICEBOOK
+contents = panelFig
+contents = panelHtmlNamed
+contents = panelHtml216
+tip = lTexts[1]
+
+[wxPanel panelFig]
+text = lTexts[26]
+contents = figSizerHorizontal
+
+[wxBoxSizer figSizerHorizontal]
+direction = horizontal
+contents = $stretch(5)
+contents = figSizerVertical
+contents = $stretch(5)
+
+[wxBoxSizer figSizerVertical]
+direction = vertical
+contents = $stretch(5)
+contents = figButtonRow0
+contents = $space(5)
+contents = figButtonRow1
+contents = $space(5)
+contents = figButtonRow2
+contents = $space(5)
+contents = figButtonRow3
+contents = $space(10)
+contents = figShaderLabelSizer
+contents = $space(5)
+contents = figShaderSlider
+contents = $stretch(5)
+
+[wxBoxSizer figButtonRow0]
+direction = horizontal
+contents = b00
+contents = $space(5)
+contents = b01
+contents = $space(5)
+contents = b02
+contents = $space(5)
+contents = b03
+contents = $space(5)
+contents = b04
+contents = $space(5)
+contents = b05
+contents = $space(5)
+contents = b06
+contents = $space(5)
+contents = b07
+
+[wxBoxSizer figButtonRow1]
+direction = horizontal
+contents = b08
+contents = $space(5)
+contents = b09
+contents = $space(5)
+contents = b10
+contents = $space(5)
+contents = b11
+contents = $space(5)
+contents = b12
+contents = $space(5)
+contents = b13
+contents = $space(5)
+contents = b14
+contents = $space(5)
+contents = b15
+
+[wxBoxSizer figButtonRow2]
+direction = horizontal
+contents = b16
+contents = $space(5)
+contents = b17
+contents = $space(5)
+contents = b18
+contents = $space(5)
+contents = b19
+contents = $space(5)
+contents = b20
+contents = $space(5)
+contents = b21
+contents = $space(5)
+contents = b22
+contents = $space(5)
+contents = b23
+
+[wxBoxSizer figButtonRow3]
+direction = horizontal
+contents = b24
+contents = $space(5)
+contents = b25
+contents = $space(5)
+contents = b26
+contents = $space(5)
+contents = b27
+contents = $space(5)
+contents = b28
+contents = $space(5)
+contents = b29
+contents = $space(5)
+contents = b30
+contents = $space(5)
+contents = b31
+
+[Dk4WxColourPaletteItem b00]
+constructor = this, pAppHelper, 0, 0, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b01]
+constructor = this, pAppHelper, 0, 0, 255
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b02]
+constructor = this, pAppHelper, 0, 255, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b03]
+constructor = this, pAppHelper, 0, 255, 255
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b04]
+constructor = this, pAppHelper, 255, 0, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b05]
+constructor = this, pAppHelper, 255, 0, 255
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b06]
+constructor = this, pAppHelper, 255, 255, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b07]
+constructor = this, pAppHelper, 255, 255, 255
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b08]
+constructor = this, pAppHelper, 0, 0, 143
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b09]
+constructor = this, pAppHelper, 0, 0, 176
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b10]
+constructor = this, pAppHelper, 0, 0, 209
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b11]
+constructor = this, pAppHelper, 135, 207, 255
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b12]
+constructor = this, pAppHelper, 0, 143, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b13]
+constructor = this, pAppHelper, 0, 176, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b14]
+constructor = this, pAppHelper, 0, 209, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b15]
+constructor = this, pAppHelper, 0, 143, 143
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b16]
+constructor = this, pAppHelper, 0, 176, 176
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b17]
+constructor = this, pAppHelper, 0, 209, 209
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b18]
+constructor = this, pAppHelper, 143, 0, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b19]
+constructor = this, pAppHelper, 176, 0, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b20]
+constructor = this, pAppHelper, 209, 0, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b21]
+constructor = this, pAppHelper, 143, 0, 143
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b22]
+constructor = this, pAppHelper, 176, 0, 176
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b23]
+constructor = this, pAppHelper, 209, 0, 209
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b24]
+constructor = this, pAppHelper, 127, 48, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b25]
+constructor = this, pAppHelper, 160, 63, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b26]
+constructor = this, pAppHelper, 191, 97, 0
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b27]
+constructor = this, pAppHelper, 255, 127, 127
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b28]
+constructor = this, pAppHelper, 255, 160, 160
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b29]
+constructor = this, pAppHelper, 255, 191, 191
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b30]
+constructor = this, pAppHelper, 255, 224, 224
+tip = lTexts[2]
+
+[Dk4WxColourPaletteItem b31]
+constructor = this, pAppHelper, 255, 214, 0
+tip = lTexts[2]
+
+[wxBoxSizer figShaderLabelSizer]
+direction = horizontal
+contents = $stretch(10)
+contents = figShaderLabelText
+contents = $stretch(10)
+grow = yes
+
+[wxStaticText figShaderLabelText]
+text = lTexts[4]
+text style = centered
+tip = lTexts[6]
+
+[wxSlider figShaderSlider]
+id = ID_SLIDER_SHADE
+direction = horizontal
+range = -20 20
+value = 0
+grow = yes
+tip = lTexts[7]
+
+[wxPanel panelHtmlNamed]
+text = lTexts[27]
+contents = htmlNamedSizerHorizontal
+
+[wxBoxSizer htmlNamedSizerHorizontal]
+direction = horizontal
+contents = $space(5)
+contents = htmlNamedSizerVertical
+contents = $space(5)
+
+[wxBoxSizer htmlNamedSizerVertical]
+contents = $space(5)
+contents = listHtmlNames
+contents = $space(5)
+
+[wxListBox listHtmlNames]
+# constructor = wxDefaultPosition, wxDefaultSize, saHtmlNames, wxLB_SINGLE
+id = ID_HTML_NAMED_LIST
+choices = saHtmlNames
+size = 200 200
+tip = lTexts[8]
+
+[wxPanel panelHtml216]
+text = lTexts[28]
+contents = html216SizerHorizontal
+
+[wxBoxSizer html216SizerHorizontal]
+direction = horizontal
+contents = $space(5)
+contents = html216SizerVertical
+contents = $space(5)
+
+[wxBoxSizer html216SizerVertical]
+direction = vertical
+contents = $space(250,5)
+contents = labelHtml216Red
+contents = sliderHtml216Red
+contents = $space(5)
+contents = labelHtml216Green
+contents = sliderHtml216Green
+contents = $space(5)
+contents = labelHtml216Blue
+contents = sliderHtml216Blue
+contents = $space(5)
+
+[wxStaticText labelHtml216Red]
+text = lTexts[9]
+
+[wxSlider sliderHtml216Red]
+id = ID_SLIDER_RED
+range = 0 5
+value = 0
+direction = horizontal
+grow = yes
+tip = lTexts[12]
+
+[wxStaticText labelHtml216Green]
+text = lTexts[10]
+
+[wxSlider sliderHtml216Green]
+id = ID_SLIDER_GREEN
+range = 0 5
+value = 0
+direction = horizontal
+grow = yes
+tip = lTexts[13]
+
+[wxStaticText labelHtml216Blue]
+text = lTexts[11]
+
+[wxSlider sliderHtml216Blue]
+id = ID_SLIDER_BLUE
+range = 0 5
+value = 0
+direction = horizontal
+grow = yes
+tip = lTexts[14]
+
+[wxBoxSizer resultSizerHexadecimal]
+direction = horizontal
+grow = yes
+contents = hexRed
+contents = $stretch(10)
+contents = hexGreen
+contents = $stretch(10)
+contents = hexBlue
+
+[wxBoxSizer resultSizerDecimal]
+direction = horizontal
+grow = yes
+contents = decRed
+contents = $stretch(10)
+contents = decGreen
+contents = $stretch(10)
+contents = decBlue
+
+[wxStaticText hexRed]
+text = not_localized_texts[0]
+tip = lTexts[17]
+
+[wxStaticText hexGreen]
+text = not_localized_texts[0]
+text style = centered
+tip = lTexts[18]
+
+[wxStaticText hexBlue]
+text = not_localized_texts[0]
+text style = right
+tip = lTexts[19]
+
+[wxStaticText decRed]
+text = not_localized_texts[1]
+tip = lTexts[20]
+
+[wxStaticText decGreen]
+text = not_localized_texts[1]
+text style = centered
+tip = lTexts[21]
+
+[wxStaticText decBlue]
+text = not_localized_texts[1]
+text style = right
+tip = lTexts[22]
+
+[Dk4WxColourView colourViewResult]
+constructor = pAppHelp, r, g, b
+tip = lTexts[23]
+grow = yes
+minimum size = 50 50
+
+[wxStdDialogButtonSizer buttonsDialog]
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = lTexts[24]
+tip = lTexts[25]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = lTexts[15]
+tip = lTexts[16]
+
+
+%% header start
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef WX_GBSIZER_H_INCLUDED
+#include <wx/gbsizer.h>
+#define WX_GBSIZER_H_INCLUDED 1
+#endif
+
+#ifndef WX_BOOKCTRL_H_INCLUDED
+#include <wx/bookctrl.h>
+#define WX_BOOKCTRL_H_INCLUDED 1
+#endif
+
+#ifndef WX_CHOICEBK_H_INCLUDED
+#include <wx/choicebk.h>
+#define WX_CHOICEBK_H_INCLUDED 1
+#endif
+
+#ifndef WX_STATBOX_H_INCLUDED
+#include <wx/statbox.h>
+#define WX_STATBOX_H_INCLUDED 1
+#endif
+
+#ifndef DK4WXAPPLICTIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
+#endif
+
+#ifndef DK4WXCOLOURVIEW_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxColourView.h"
+#else
+#include <dktools-4/Dk4WxColourView.h>
+#endif
+#endif
+
+%% class start
+
+/** Color palette allowing to choose between predefined colours.
+*/
+class Dk4WxColourPalette : public wxDialog
+{
+ /** Item in a colour palette.
+ */
+ class Dk4WxColourPaletteItem : public wxControl
+ {
+ /** Class is dynamic.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(Dk4WxColourPaletteItem);
+#else
+ DECLARE_DYNAMIC_CLASS(Dk4WxColourPaletteItem)
+#endif
+
+ /** Event table for control.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent dialog we have to notify about color change.
+ */
+ Dk4WxColourPalette *pParentWindow;
+
+ /** Application helper.
+ */
+ Dk4WxApplicationHelper *pAppHelp;
+
+ /** Class name, used in constructor and Create().
+ */
+ static wxChar const Dk4WxColourPaletteItemName[];
+
+ /** Height.
+ */
+ int w;
+
+ /** Width.
+ */
+ int h;
+
+ /** Red component of color to show.
+ */
+ int r;
+
+ /** Green component of color to show.
+ */
+ int g;
+
+ /** Blue component of color to show.
+ */
+ int b;
+
+ public:
+
+ /** Default constructor.
+ */
+ Dk4WxColourPaletteItem();
+
+ /** Constructor.
+ @param pParent Parent window.
+ @param wxid Window ID.
+ @param appHelper Application helper.
+ @param red Red component of color to show.
+ @param green Green component of color to show.
+ @param blue Blue component of color to show.
+ @param pos Object position.
+ @param size Object minimum size.
+ @param style Style for control.
+ @param name Class name.
+ */
+ Dk4WxColourPaletteItem(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxColourPalette *pal,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & size = wxDefaultSize,
+ long style = wxBORDER_NONE,
+ wxChar const *name = Dk4WxColourPaletteItemName
+ );
+
+ /** Create object after using default constructor.
+ @param pParent Parent window.
+ @param wxid Window ID.
+ @param appHelper Application helper.
+ @param red Red component of color to show.
+ @param green Green component of color to show.
+ @param blue Blue component of color to show.
+ @param pos Object position.
+ @param size Object minimum size.
+ @param style Style for control.
+ @param name Class name.
+ @return true on success, false on error.
+ */
+ bool
+ Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxColourPalette *pal,
+ Dk4WxApplicationHelper *appHelper,
+ int red = 255,
+ int green = 255,
+ int blue = 255,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & size = wxDefaultSize,
+ long style = wxBORDER_NONE,
+ wxChar const *name = Dk4WxColourPaletteItemName
+ );
+
+ /** Find minimum size.
+ */
+ wxSize
+ DoGetBestSize() const;
+
+ /** Handler for erase event.
+ @param event Event to process.
+ */
+ void
+ OnErase(wxEraseEvent & event);
+
+ /** Handler for paint event.
+ @param event Event to process.
+ */
+ void
+ OnPaint(wxPaintEvent & event);
+
+ /** Handler for mouse click event.
+ @param event Event to process.
+ */
+ void
+ OnLeftMouseButtonDown(wxMouseEvent & event);
+
+ };
+
+private:
+
+ /** Events we have to respond to.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+protected:
+
+ /** Red colour for text labels.
+ */
+ wxColour colourRed;
+
+ /** Green colour for text labels.
+ */
+ wxColour colourGreen;
+
+ /** Blue colour for text labels.
+ */
+ wxColour colourBlue;
+
+ /** Application helper.
+ */
+ Dk4WxApplicationHelper *pAppHelp;
+
+ /** Localized texts.
+ */
+ wxChar const * const *localizedTexts;
+
+ /** Shade slider value -20 to 20.
+ */
+ int slvshade;
+
+ /** Red slider value 0 to 5.
+ */
+ int slvred;
+
+ /** Green slider value 0 to 5.
+ */
+ int slvgreen;
+
+ /** Blue slider value 0 to 5.
+ */
+ int slvblue;
+
+ /** Index of selected list item.
+ */
+ int listSelection;
+
+ /** Base red component, not shaded.
+ */
+ int rb;
+
+ /** Base green component, not shaded.
+ */
+ int gb;
+
+ /** Base blue component, not shaded.
+ */
+ int bb;
+
+ /** Result red component.
+ */
+ int r;
+
+ /** Result green component.
+ */
+ int g;
+
+ /** Result blue component.
+ */
+ int b;
+
+ /** Flag: Already in correction process.
+ */
+ bool bIsCorrecting;
+
+%% class end
+
+protected:
+
+ /** Correct shade label.
+ */
+ void
+ CorrectShadeLabel(void);
+
+ /** Shade a color.
+ @param val Original value.
+ @return Shaded color value.
+ */
+ int
+ ShadeColour(int val);
+
+ /** Correct appearance after using controls.
+ @param reason Which control was used.
+ */
+ void
+ CorrectGui(int reason);
+
+ /** Set the R, G, B text labels for the r, g, b variables.
+ */
+ void
+ SetRgbTextLabels(void);
+
+ /** Find RGB slider value next to a given color value.
+ */
+ int
+ FindSliderValue(int colval);
+
+ /** Find slider values next to the r, g, b variables.
+ */
+ void
+ FindRgbSliderValues(void);
+
+ /** Find list box entry next to the r, g, b variables.
+ */
+ void
+ FindListBoxEntry(void);
+
+public:
+
+ /** Our IDs.
+ */
+ enum {
+
+ /** ID of choicebook change.
+ */
+ ID_CHOICEBOOK = ((wxID_HIGHEST) + 1) ,
+
+ /** ID of XFig shade slider.
+ */
+ ID_SLIDER_SHADE ,
+
+ /** ID of HTML named colors list control.
+ */
+ ID_HTML_NAMED_LIST ,
+
+ /** ID of HTML 216 red slider.
+ */
+ ID_SLIDER_RED ,
+
+ /** ID of HTML 216 green slider.
+ */
+ ID_SLIDER_GREEN ,
+
+ /** ID of HTML 216 blue slider.
+ */
+ ID_SLIDER_BLUE
+ };
+
+ /** Reasons for GUI corrections.
+ */
+ enum {
+ /** New page selected in choice book.
+ */
+ REASON_CHOICEBOOK = 0 ,
+
+ /** Base colors changed.
+ */
+ REASON_BASE_COLOR ,
+
+ /** Shade slider changed.
+ */
+ REASON_SHADE_SLIDER ,
+
+ /** List selection changed.
+ */
+ REASON_LIST_SELECT ,
+
+ /** RGB slider changed.
+ */
+ REASON_RGB_SLIDER
+ };
+
+ /** Default constructor.
+ */
+ Dk4WxColourPalette();
+
+ /** Real constructor.
+ @param pParent Parent window.
+ @param pAppHelper Application helper.
+ @param red Initial red component.
+ @param green Initial green component.
+ @param blue Initial blue component.
+ @param withborder Flag: Show border around dialog box.
+ */
+ Dk4WxColourPalette(
+ wxWindow *pParent,
+ Dk4WxApplicationHelper *pAppHelper,
+ int red,
+ int green,
+ int blue,
+ bool withborder = true
+ );
+
+ /** Handler for OK button.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Handler for shade slider events.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnShadeSlider(wxCommandEvent & event);
+
+ /** Handler for RGB slider events.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnRgbSlider(wxCommandEvent & event);
+
+#if wxCHECK_VERSION(3,0,0)
+ /** Handler for changed choicebook page.
+ @param event Event to respond to, unused
+ */
+ void
+ OnChoicebookChanged(wxBookCtrlEvent & event);
+#else
+ /** Handler for changed choicebook page.
+ @param event Event to respond to, unused
+ */
+ void
+ OnChoicebookChanged(wxChoicebookEvent & event);
+#endif
+
+ /** Handler for changed selection on list box.
+ @param event Event to respond to, unused.
+ */
+ void
+ OnListBoxChanged(wxCommandEvent & event);
+
+ /** Retrieve red component.
+ @return Red value.
+ */
+ int
+ Red(void) const;
+
+ /** Retrieve green component.
+ @return Green value.
+ */
+ int
+ Green(void) const;
+
+ /** Retrieve blue component.
+ @return Blue value.
+ */
+ int
+ Blue(void) const;
+
+ /** React on Dk4WxColourPaletteItem click.
+ @param red New base red component.
+ @param green New base green component.
+ @param blue New base blue component.
+ */
+ void
+ SetBaseRGB(int red, int green, int blue);
+
+ /** Construct a dialog style value.
+ @param bBorder Flag: Draw border.
+ @param bTitle Flag: Title bar on dialog.
+ */
+ static
+ int
+ GetDialogStyle(bool bBorder = true, bool bTitle = true);
+
+};
+
+
+%% header end
+
+%% module start
+
+#include "Dk4WxColourPalette.h"
+
+#ifndef WX_CONFIG_H_INCLUDED
+#include <wx/config.h>
+#define WX_CONFIG_H_INCLUDED 1
+#endif
+
+#ifndef WX_ARRSTR_H_INCLUDED
+#include <wx/arrstr.h>
+#define WX_ARRSTR_H_INCLUDED 1
+#endif
+
+#ifndef WX_DCBUFFER_H_INCLUDED
+#include <wx/dcbuffer.h>
+#define WX_DCBUFFER_H_INCLUDED 1
+#endif
+
+
+
+$!trace-include
+
+
+
+/** HTML named color type.
+*/
+typedef struct {
+ const wxChar *name; /**< Color name. */
+ unsigned long rgb; /**< 16*R+8*G+B. */
+} html_color_t;
+
+
+
+/** The named HTML colors.
+*/
+static const html_color_t html_colors[] = {
+ { wxT("AliceBlue"), 0xF0F8FFUL },
+ { wxT("AntiqueWhite"), 0xFAEBD7UL },
+ { wxT("Aqua"), 0x00FFFFUL },
+ { wxT("Aquamarine"), 0x7FFFD4UL },
+ { wxT("Azure"), 0xF0FFFFUL },
+ { wxT("Beige"), 0xF5F5DCUL },
+ { wxT("Bisque"), 0xFFE4C4UL },
+ { wxT("Black"), 0x000000UL },
+ { wxT("BlanchedAlmond"), 0xFFEBCDUL },
+ { wxT("Blue"), 0x0000FFUL },
+ { wxT("BlueViolet"), 0x8A2BE2UL },
+ { wxT("Brown"), 0xA52A2AUL },
+ { wxT("BurlyWood"), 0xDEB887UL },
+ { wxT("CadetBlue"), 0x5F9EA0UL },
+ { wxT("Chartreuse"), 0x7FFF00UL },
+ { wxT("Chocolate"), 0xD2691EUL },
+ { wxT("Coral"), 0xFF7F50UL },
+ { wxT("CornflowerBlue"), 0x6495EDUL },
+ { wxT("Cornsilk"), 0xFFF8DCUL },
+ { wxT("Crimson"), 0xDC143CUL },
+ { wxT("Cyan"), 0x00FFFFUL },
+ { wxT("DarkBlue"), 0x00008BUL },
+ { wxT("DarkCyan"), 0x008B8BUL },
+ { wxT("DarkGoldenRod"), 0xB8860BUL },
+ { wxT("DarkGray"), 0xA9A9A9UL },
+ { wxT("DarkGrey"), 0xA9A9A9UL },
+ { wxT("DarkGreen"), 0x006400UL },
+ { wxT("DarkKhaki"), 0xBDB76BUL },
+ { wxT("DarkMagenta"), 0x8B008BUL },
+ { wxT("DarkOliveGreen"), 0x556B2FUL },
+ { wxT("DarkOrange"), 0xFF8C00UL },
+ { wxT("DarkOrchid"), 0x9932CCUL },
+ { wxT("DarkRed"), 0x8B0000UL },
+ { wxT("DarkSalmon"), 0xE9967AUL },
+ { wxT("DarkSeaGreen"), 0x8FBC8FUL },
+ { wxT("DarkSlateBlue"), 0x483D8BUL },
+ { wxT("DarkSlateGray"), 0x2F4F4FUL },
+ { wxT("DarkSlateGrey"), 0x2F4F4FUL },
+ { wxT("DarkTurquoise"), 0x00CED1UL },
+ { wxT("DarkViolet"), 0x9400D3UL },
+ { wxT("DeepPink"), 0xFF1493UL },
+ { wxT("DeepSkyBlue"), 0x00BFFFUL },
+ { wxT("DimGray"), 0x696969UL },
+ { wxT("DimGrey"), 0x696969UL },
+ { wxT("DodgerBlue"), 0x1E90FFUL },
+ { wxT("FireBrick"), 0xB22222UL },
+ { wxT("FloralWhite"), 0xFFFAF0UL },
+ { wxT("ForestGreen"), 0x228B22UL },
+ { wxT("Fuchsia"), 0xFF00FFUL },
+ { wxT("Gainsboro"), 0xDCDCDCUL },
+ { wxT("GhostWhite"), 0xF8F8FFUL },
+ { wxT("Gold"), 0xFFD700UL },
+ { wxT("GoldenRod"), 0xDAA520UL },
+ { wxT("Gray"), 0x808080UL },
+ { wxT("Grey"), 0x808080UL },
+ { wxT("Green"), 0x008000UL },
+ { wxT("GreenYellow"), 0xADFF2FUL },
+ { wxT("HoneyDew"), 0xF0FFF0UL },
+ { wxT("HotPink"), 0xFF69B4UL },
+ { wxT("IndianRed"), 0xCD5C5CUL },
+ { wxT("Indigo"), 0x4B0082UL },
+ { wxT("Ivory"), 0xFFFFF0UL },
+ { wxT("Khaki"), 0xF0E68CUL },
+ { wxT("Lavender"), 0xE6E6FAUL },
+ { wxT("LavenderBlush"), 0xFFF0F5UL },
+ { wxT("LawnGreen"), 0x7CFC00UL },
+ { wxT("LemonChiffon"), 0xFFFACDUL },
+ { wxT("LightBlue"), 0xADD8E6UL },
+ { wxT("LightCoral"), 0xF08080UL },
+ { wxT("LightCyan"), 0xE0FFFFUL },
+ { wxT("LightGoldenRodYellow"), 0xFAFAD2UL },
+ { wxT("LightGray"), 0xD3D3D3UL },
+ { wxT("LightGrey"), 0xD3D3D3UL },
+ { wxT("LightGreen"), 0x90EE90UL },
+ { wxT("LightPink"), 0xFFB6C1UL },
+ { wxT("LightSalmon"), 0xFFA07AUL },
+ { wxT("LightSeaGreen"), 0x20B2AAUL },
+ { wxT("LightSkyBlue"), 0x87CEFAUL },
+ { wxT("LightSlateGray"), 0x778899UL },
+ { wxT("LightSlateGrey"), 0x778899UL },
+ { wxT("LightSteelBlue"), 0xB0C4DEUL },
+ { wxT("LightYellow"), 0xFFFFE0UL },
+ { wxT("Lime"), 0x00FF00UL },
+ { wxT("LimeGreen"), 0x32CD32UL },
+ { wxT("Linen"), 0xFAF0E6UL },
+ { wxT("Magenta"), 0xFF00FFUL },
+ { wxT("Maroon"), 0x800000UL },
+ { wxT("MediumAquaMarine"), 0x66CDAAUL },
+ { wxT("MediumBlue"), 0x0000CDUL },
+ { wxT("MediumOrchid"), 0xBA55D3UL },
+ { wxT("MediumPurple"), 0x9370DBUL },
+ { wxT("MediumSeaGreen"), 0x3CB371UL },
+ { wxT("MediumSlateBlue"), 0x7B68EEUL },
+ { wxT("MediumSpringGreen"), 0x00FA9AUL },
+ { wxT("MediumTurquoise"), 0x48D1CCUL },
+ { wxT("MediumVioletRed"), 0xC71585UL },
+ { wxT("MidnightBlue"), 0x191970UL },
+ { wxT("MintCream"), 0xF5FFFAUL },
+ { wxT("MistyRose"), 0xFFE4E1UL },
+ { wxT("Moccasin"), 0xFFE4B5UL },
+ { wxT("NavajoWhite"), 0xFFDEADUL },
+ { wxT("Navy"), 0x000080UL },
+ { wxT("OldLace"), 0xFDF5E6UL },
+ { wxT("Olive"), 0x808000UL },
+ { wxT("OliveDrab"), 0x6B8E23UL },
+ { wxT("Orange"), 0xFFA500UL },
+ { wxT("OrangeRed"), 0xFF4500UL },
+ { wxT("Orchid"), 0xDA70D6UL },
+ { wxT("PaleGoldenRod"), 0xEEE8AAUL },
+ { wxT("PaleGreen"), 0x98FB98UL },
+ { wxT("PaleTurquoise"), 0xAFEEEEUL },
+ { wxT("PaleVioletRed"), 0xDB7093UL },
+ { wxT("PapayaWhip"), 0xFFEFD5UL },
+ { wxT("PeachPuff"), 0xFFDAB9UL },
+ { wxT("Peru"), 0xCD853FUL },
+ { wxT("Pink"), 0xFFC0CBUL },
+ { wxT("Plum"), 0xDDA0DDUL },
+ { wxT("PowderBlue"), 0xB0E0E6UL },
+ { wxT("Purple"), 0x800080UL },
+ { wxT("RebeccaPurple"), 0x663399UL },
+ { wxT("Red"), 0xFF0000UL },
+ { wxT("RosyBrown"), 0xBC8F8FUL },
+ { wxT("RoyalBlue"), 0x4169E1UL },
+ { wxT("SaddleBrown"), 0x8B4513UL },
+ { wxT("Salmon"), 0xFA8072UL },
+ { wxT("SandyBrown"), 0xF4A460UL },
+ { wxT("SeaGreen"), 0x2E8B57UL },
+ { wxT("SeaShell"), 0xFFF5EEUL },
+ { wxT("Sienna"), 0xA0522DUL },
+ { wxT("Silver"), 0xC0C0C0UL },
+ { wxT("SkyBlue"), 0x87CEEBUL },
+ { wxT("SlateBlue"), 0x6A5ACDUL },
+ { wxT("SlateGray"), 0x708090UL },
+ { wxT("SlateGrey"), 0x708090UL },
+ { wxT("Snow"), 0xFFFAFAUL },
+ { wxT("SpringGreen"), 0x00FF7FUL },
+ { wxT("SteelBlue"), 0x4682B4UL },
+ { wxT("Tan"), 0xD2B48CUL },
+ { wxT("Teal"), 0x008080UL },
+ { wxT("Thistle"), 0xD8BFD8UL },
+ { wxT("Tomato"), 0xFF6347UL },
+ { wxT("Turquoise"), 0x40E0D0UL },
+ { wxT("Violet"), 0xEE82EEUL },
+ { wxT("Wheat"), 0xF5DEB3UL },
+ { wxT("White"), 0xFFFFFFUL },
+ { wxT("WhiteSmoke"), 0xF5F5F5UL },
+ { wxT("Yellow"), 0xFFFF00UL },
+ { wxT("YellowGreen"), 0x9ACD32UL }
+};
+
+
+
+/** Number of elements in the html_colors array.
+*/
+static const size_t sz_html_colors =
+sizeof(html_colors)/sizeof(html_color_t);
+
+
+
+/** Window type name.
+*/
+wxChar const
+Dk4WxColourPalette::Dk4WxColourPaletteItem::Dk4WxColourPaletteItemName[] = {
+ wxT("Dk4WxColourPaletteItem")
+} ;
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxColourPalette::Dk4WxColourPaletteItem,wxControl)
+#else
+BEGIN_EVENT_TABLE(Dk4WxColourPalette::Dk4WxColourPaletteItem,wxControl)
+#endif
+ EVT_ERASE_BACKGROUND(Dk4WxColourPalette::Dk4WxColourPaletteItem::OnErase)
+ EVT_PAINT(Dk4WxColourPalette::Dk4WxColourPaletteItem::OnPaint)
+ EVT_LEFT_DOWN(Dk4WxColourPalette::Dk4WxColourPaletteItem::OnLeftMouseButtonDown)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(Dk4WxColourPalette::Dk4WxColourPaletteItem,wxControl);
+#else
+IMPLEMENT_DYNAMIC_CLASS(Dk4WxColourPalette::Dk4WxColourPaletteItem,wxControl)
+#endif
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxColourPalette,wxDialog)
+#else
+BEGIN_EVENT_TABLE(Dk4WxColourPalette,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ Dk4WxColourPalette::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ Dk4WxColourPalette::OnCancel\
+ )
+ EVT_SLIDER(\
+ Dk4WxColourPalette::ID_SLIDER_SHADE,\
+ Dk4WxColourPalette::OnShadeSlider\
+ )
+ EVT_SLIDER(\
+ Dk4WxColourPalette::ID_SLIDER_RED,\
+ Dk4WxColourPalette::OnRgbSlider\
+ )
+ EVT_SLIDER(\
+ Dk4WxColourPalette::ID_SLIDER_GREEN,\
+ Dk4WxColourPalette::OnRgbSlider\
+ )
+ EVT_SLIDER(\
+ Dk4WxColourPalette::ID_SLIDER_BLUE,\
+ Dk4WxColourPalette::OnRgbSlider\
+ )
+ EVT_CHOICEBOOK_PAGE_CHANGED(\
+ Dk4WxColourPalette::ID_CHOICEBOOK,\
+ Dk4WxColourPalette::OnChoicebookChanged\
+ )
+ EVT_LISTBOX(\
+ Dk4WxColourPalette::ID_HTML_NAMED_LIST,\
+ Dk4WxColourPalette::OnListBoxChanged\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+/** Text fragments, replaced by localized versions if found.
+*/
+static const wxChar * const message_texts[] = {
+$!string-table macro=wxT
+#
+# 0 Window title
+#
+Colour palettes
+#
+# 1 Tip for choice book
+#
+Choose palette type
+#
+# 2 Tip for palette item
+#
+Click palette item to choose color
+#
+# 3-7 Special shading levels
+#
+black
+pure
+white
+Shading level
+Modify shading (mix towards black or white)
+#
+# 8 Tip for list
+#
+Select item to choose color
+#
+# 9-11 Labels for RGB sliders
+#
+Red
+Green
+Blue
+#
+# 12-14 Tips for RGB sliders
+#
+Modify red color component
+Modify green color component
+Modify blue color component
+#
+# 15-16 Initial label value
+#
+Cancel
+Leave dialog, skip settings
+#
+# 17-19 Tips for labels
+#
+Red color component value, hexadecimal 00...FF
+Green color component value, hexadecimal 00...FF
+Blue color component value, hexadecimal 00...FF
+#
+# 20-22 Tips for labels
+#
+Red color component value, decimal 0...255
+Green color component value, decimal 0...255
+Blue color component value, decimal 0...255
+#
+# 23 Tip for result colour view
+#
+Result color
+#
+# 24-25 Button texts and tips
+#
+OK
+Apply settings
+#
+# 26-28 Palette types
+#
+XFig
+HTML
+WEB 216
+#
+#
+#
+$!end
+};
+
+
+static const wxChar * const not_localized_texts[] = {
+$!string-table macro=wxT
+#
+# 0-1 Initial label texts for numeric fields
+#
+FF
+255
+#
+# 2-4 Format strings
+#
+%+02d %%
+%03d
+%02X
+$!end
+};
+
+
+
+/** String table file name.
+*/
+static const dkChar sttfilename[] = { dkT("dk4colpal.str") };
+
+
+
+/** Color component values corresponding to the RGB slider settings.
+*/
+static const int rgbSliderValues[] = {
+ 0, 0x0033, 0x0066, 0x0099, 0x00CC, 0x00FF
+};
+
+
+
+Dk4WxColourPalette::Dk4WxColourPalette()
+{
+ pAppHelp = NULL;
+ slvshade = 0;
+ rb = gb = bb = r = g = b = 255;
+ slvred = slvgreen = slvblue = 5;
+ listSelection = 0;
+ bIsCorrecting = false;
+}
+
+
+
+%% constructor start
+
+Dk4WxColourPalette::Dk4WxColourPalette(
+ wxWindow *pParent,
+ Dk4WxApplicationHelper *pAppHelper,
+ int red,
+ int green,
+ int blue,
+ bool withborder
+)
+: wxDialog(
+ pParent, wxID_ANY,
+ wxT("Colour palette"),
+ wxDefaultPosition, wxDefaultSize,
+ Dk4WxColourPalette::GetDialogStyle(false, withborder)
+),
+colourRed(127, 0, 0),
+colourGreen(0, 127, 0),
+colourBlue(0, 0, 127)
+{
+ wxArrayString saHtmlNames;
+ wxChar const * const *lTexts;
+ size_t i;
+ $? "+ Dk4WxColourPalette::Dk4WxColourPalette"
+ $? ". red = %d", red
+ $? ". green = %d", green
+ $? ". blue = %d", blue
+
+ localizedTexts = lTexts =
+ pAppHelper->GetStringTable(sttfilename, message_texts);
+ if (NULL == localizedTexts) {
+ localizedTexts = lTexts = message_texts;
+ }
+ pAppHelp = pAppHelper;
+ slvshade = 0;
+ rb = r = red;
+ gb = g = green;
+ bb = b = blue;
+ slvred = slvgreen = slvblue = 5;
+ listSelection = 0;
+ bIsCorrecting = false;
+ for (i = 0; i < sz_html_colors; i++) {
+ saHtmlNames.Add(html_colors[i].name);
+ }
+%% constructor end
+ if (dkctGUILayoutOK) {
+ colourViewResult->SetActive(false);
+ colourViewResult->SetMarkActiveInactive(false);
+ decRed->SetForegroundColour(colourRed);
+ decGreen->SetForegroundColour(colourGreen);
+ decBlue->SetForegroundColour(colourBlue);
+ hexRed->SetForegroundColour(colourRed);
+ hexGreen->SetForegroundColour(colourGreen);
+ hexBlue->SetForegroundColour(colourBlue);
+ SetRgbTextLabels();
+ FindRgbSliderValues();
+ FindListBoxEntry();
+ SetTitle(lTexts[0]);
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+ $? "- Dk4WxColourPalette::Dk4WxColourPalette"
+}
+
+%% module end
+
+
+void
+Dk4WxColourPalette::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+Dk4WxColourPalette::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+void
+Dk4WxColourPalette::OnChoicebookChanged(wxBookCtrlEvent & event)
+#else
+void
+Dk4WxColourPalette::OnChoicebookChanged(wxChoicebookEvent & event)
+#endif
+{
+ int pn;
+ $? "+ Dk4WxColourPalette::OnChoicebookChanged"
+ pn = event.GetSelection();
+ if (1 == pn) {
+ if (wxNOT_FOUND != listSelection) {
+ listHtmlNames->SetSelection(listSelection);
+ }
+ }
+ $? "- Dk4WxColourPalette::OnChoicebookChanged"
+}
+
+
+
+int
+Dk4WxColourPalette::ShadeColour(int val)
+{
+ int back;
+
+ back = val;
+ if (0 < slvshade) {
+ back = (((20 - slvshade) * val) + (slvshade * 255)) / 20;
+ }
+ else {
+ if (0 > slvshade) {
+ back = (val * (20 + slvshade)) / 20;
+ }
+ }
+ return back;
+}
+
+
+
+void
+Dk4WxColourPalette::CorrectShadeLabel(void)
+{
+ wxString lstr;
+
+ switch (slvshade) {
+ case -20 : {
+ figShaderLabelText->SetLabel(localizedTexts[3]);
+ } break;
+ case 0 : {
+ figShaderLabelText->SetLabel(localizedTexts[4]);
+ } break;
+ case 20 : {
+ figShaderLabelText->SetLabel(localizedTexts[5]);
+ } break;
+ default : {
+ lstr.Printf(not_localized_texts[2], (5*slvshade));
+ figShaderLabelText->SetLabel(lstr);
+ } break;
+ }
+}
+
+
+
+void
+Dk4WxColourPalette::SetBaseRGB(int red, int green, int blue)
+{
+ $? "+ Dk4WxColourPalette::SetBaseRGB"
+ rb = red; gb = green; bb = blue;
+ CorrectGui(REASON_BASE_COLOR);
+ $? "- Dk4WxColourPalette::SetBaseRGB"
+}
+
+
+
+void
+Dk4WxColourPalette::OnShadeSlider(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ Dk4WxColourPalette::OnShadeSlider"
+ if (!(bIsCorrecting)) {
+ slvshade = figShaderSlider->GetValue();
+ CorrectGui(REASON_SHADE_SLIDER);
+ }
+ $? "- Dk4WxColourPalette::OnShadeSlider"
+}
+
+
+
+void
+Dk4WxColourPalette::OnListBoxChanged(wxCommandEvent & WXUNUSED(event))
+{
+ int in;
+ unsigned long ul;
+ $? "+ Dk4WxColourPalette::OnListBoxChanged"
+ if (!(bIsCorrecting)) {
+ listSelection = in = listHtmlNames->GetSelection();
+ if ((0 <= in) && (wxNOT_FOUND != in)) {
+ ul = html_colors[in].rgb;
+ r = rb = (int)((ul >> 16) & 0x000000FFUL);
+ g = gb = (int)((ul >> 8) & 0x000000FFUL);
+ b = bb = (int)( ul & 0x000000FFUL);
+ CorrectGui(REASON_LIST_SELECT);
+ }
+ }
+ $? "- Dk4WxColourPalette::OnListBoxChanged"
+}
+
+
+
+void
+Dk4WxColourPalette::OnRgbSlider(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ Dk4WxColourPalette::OnRgbSlider"
+ if (!(bIsCorrecting)) {
+ rb = r = rgbSliderValues[sliderHtml216Red->GetValue()];
+ gb = g = rgbSliderValues[sliderHtml216Green->GetValue()];
+ bb = b = rgbSliderValues[sliderHtml216Blue->GetValue()];
+ CorrectGui(REASON_RGB_SLIDER);
+ }
+ $? "- Dk4WxColourPalette::OnRgbSlider"
+}
+
+
+
+int
+Dk4WxColourPalette::FindSliderValue(int colval)
+{
+ long mindiff = 0L;
+ long curdiff;
+ int back = 0;
+ int i;
+ for (i = 0; i < 6; i++) {
+ curdiff = labs(colval - rgbSliderValues[i]);
+ if ((0 == i) || (curdiff < mindiff)) {
+ back = i;
+ mindiff = curdiff;
+ }
+ }
+ return back;
+}
+
+
+
+void
+Dk4WxColourPalette::FindRgbSliderValues(void)
+{
+ int sl;
+ sl = FindSliderValue(r);
+ slvred = sl;
+ sliderHtml216Red->SetValue(sl);
+ sl = FindSliderValue(g);
+ slvgreen = sl;
+ sliderHtml216Green->SetValue(sl);
+ sl = FindSliderValue(b);
+ slvblue = sl;
+ sliderHtml216Blue->SetValue(sl);
+}
+
+
+
+void
+Dk4WxColourPalette::FindListBoxEntry(void)
+{
+ size_t i;
+ size_t mini;
+ unsigned long ul;
+ unsigned long curdiff;
+ unsigned long mindiff;
+ unsigned long r0;
+ unsigned long g0;
+ unsigned long b0;
+
+ mindiff = 0UL; mini = 0;
+ for (i = 0; i < sz_html_colors; i++) {
+ ul = html_colors[i].rgb;
+ r0 = (ul >> 16) & 0x000000FFUL;
+ g0 = (ul >> 8) & 0x000000FFUL;
+ b0 = ul & 0x000000FFUL;
+ r0 = labs((long)r0 - (long)r);
+ g0 = labs((long)g0 - (long)g);
+ b0 = labs((long)b0 - (long)b);
+ r0 = r0 * r0;
+ g0 = g0 * g0;
+ b0 = b0 * b0;
+ curdiff = r0 + g0 + b0;
+ if ((0 == i) || (curdiff < mindiff)) {
+ mindiff = curdiff;
+ mini = i;
+ }
+ }
+ listSelection = mini;
+ listHtmlNames->SetSelection((int)mini);
+}
+
+
+
+void
+Dk4WxColourPalette::SetRgbTextLabels(void)
+{
+ wxString valstr;
+
+ valstr.Printf(not_localized_texts[3], r);
+ decRed->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[3], g);
+ decGreen->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[3], b);
+ decBlue->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[4], r);
+ hexRed->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[4], g);
+ hexGreen->SetLabel(valstr);
+ valstr.Printf(not_localized_texts[4], b);
+ hexBlue->SetLabel(valstr);
+}
+
+
+
+void
+Dk4WxColourPalette::CorrectGui(int reason)
+{
+ $? "+ Dk4WxColourPalette::CorrectGui"
+ if(!(bIsCorrecting)) { $? ". not yet correcting"
+ /*
+ Mark correction in progress
+ */
+ bIsCorrecting = true;
+ /*
+ Apply the changes
+ */
+ switch (reason) {
+ case REASON_CHOICEBOOK : {
+ } break;
+ case REASON_BASE_COLOR : { $? ". base color"
+ r = ShadeColour(rb);
+ g = ShadeColour(gb);
+ b = ShadeColour(bb);
+ FindListBoxEntry();
+ FindRgbSliderValues();
+ } break;
+ case REASON_SHADE_SLIDER : { $? ". shade slider"
+ r = ShadeColour(rb);
+ g = ShadeColour(gb);
+ b = ShadeColour(bb);
+ FindListBoxEntry();
+ FindRgbSliderValues();
+ CorrectShadeLabel();
+ } break;
+ case REASON_LIST_SELECT : { $? ". list selection"
+ FindRgbSliderValues();
+ slvshade = 0;
+ figShaderSlider->SetValue(0);
+ CorrectShadeLabel();
+ } break;
+ case REASON_RGB_SLIDER : { $? ". rgb slider"
+ FindListBoxEntry();
+ slvshade = 0;
+ figShaderSlider->SetValue(0);
+ CorrectShadeLabel();
+ } break;
+ }
+ /*
+ Mark correction as done
+ */
+ bIsCorrecting = false;
+ /*
+ Update result color viewer and dialog window
+ */
+ SetRgbTextLabels();
+ colourViewResult->SetRGB(r, g, b);
+ Refresh();
+ Update();
+ }
+ $? "- Dk4WxColourPalette::CorrectGui"
+}
+
+
+
+int
+Dk4WxColourPalette::Red(void) const
+{
+ return r;
+}
+
+
+
+int
+Dk4WxColourPalette::Green(void) const
+{
+ return g;
+}
+
+
+
+int
+Dk4WxColourPalette::Blue(void) const
+{
+ return b;
+}
+
+
+
+Dk4WxColourPalette::Dk4WxColourPaletteItem::Dk4WxColourPaletteItem()
+{
+ pParentWindow = NULL;
+ pAppHelp = NULL;
+ w = h = -1;
+ r = g = b = 255;
+}
+
+
+
+Dk4WxColourPalette::Dk4WxColourPaletteItem::Dk4WxColourPaletteItem(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxColourPalette *pal,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos,
+ wxSize const & size,
+ long style,
+ wxChar const *name
+)
+: wxControl(
+ pParent, wxid, pos, size, style, wxDefaultValidator,
+ wxString(name)
+)
+{
+
+ pParentWindow = pal;
+ pAppHelp = appHelper;
+ w = h = -1;
+ r = red;
+ g = green;
+ b = blue;
+}
+
+
+
+bool
+Dk4WxColourPalette::Dk4WxColourPaletteItem::Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxColourPalette *pal,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos,
+ wxSize const & size,
+ long style,
+ wxChar const *name
+)
+{
+ bool back = wxControl::Create(
+ pParent, wxid, pos, size, style, wxDefaultValidator,
+ wxString(name)
+ );
+ pParentWindow = pal;
+ pAppHelp = appHelper;
+ w = h = -1;
+ r = red;
+ g = green;
+ b = blue;
+ return back;
+}
+
+
+
+wxSize
+Dk4WxColourPalette::Dk4WxColourPaletteItem::DoGetBestSize() const
+{
+ wxSize back(((-1 < w) ? w : 25), ((-1 < h) ? h : 25));
+ return back;
+}
+
+
+
+void
+Dk4WxColourPalette::Dk4WxColourPaletteItem::OnErase(wxEraseEvent & WXUNUSED(event))
+{
+
+}
+
+
+
+void
+Dk4WxColourPalette::Dk4WxColourPaletteItem::OnPaint(wxPaintEvent & WXUNUSED(event))
+{
+ wxBufferedPaintDC useDC(this);
+ wxSize sz = GetClientSize();
+ wxColour mycolor(r, g, b);
+#if wxCHECK_VERSION(3,0,0)
+ wxBrush myBrush(mycolor, wxBRUSHSTYLE_SOLID);
+#else
+ wxBrush myBrush(mycolor, wxSOLID);
+#endif
+ const wxBrush oldBrus = useDC.GetBrush();
+ useDC.SetBrush(myBrush);
+ useDC.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight());
+ useDC.SetBrush(wxNullBrush);
+}
+
+
+
+void
+Dk4WxColourPalette::Dk4WxColourPaletteItem::OnLeftMouseButtonDown(
+ wxMouseEvent & WXUNUSED(event)
+)
+{
+ if (NULL != pParentWindow) {
+ pParentWindow->SetBaseRGB(r, g, b);
+ }
+}
+
+
+
+int
+Dk4WxColourPalette::GetDialogStyle(bool bBorder, bool bTitle)
+{
+ int back = wxDEFAULT_DIALOG_STYLE;
+
+ back &= (~(wxCLOSE_BOX));
+ back &= (~(wxSYSTEM_MENU));
+ if (!(bBorder)) {
+ back &= (~(wxRESIZE_BORDER));
+ }
+ if (!(bTitle)) {
+ back &= (~(wxCAPTION));
+ }
+ return back;
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Dk4WxColourView.cpp b/support/dktools/Dk4WxColourView.cpp
new file mode 100644
index 0000000000..a56a402e8c
--- /dev/null
+++ b/support/dktools/Dk4WxColourView.cpp
@@ -0,0 +1,497 @@
+/*
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxColourView.cpt
+*/
+
+/** @file Dk4WxColourView.cpp The Dk4WxColourView module.
+*/
+
+
+#line 325 "Dk4WxColourView.cpt"
+
+#include "dk4conf.h"
+#include "Dk4WxColourView.h"
+
+#include <wx/dcbuffer.h>
+#include <wx/colordlg.h>
+
+#include "Dk4WxColourPalette.h"
+
+
+
+
+
+#line 337 "Dk4WxColourView.cpt"
+
+
+
+/** Handlers for events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxColourView,wxControl)
+#else
+BEGIN_EVENT_TABLE(Dk4WxColourView,wxControl)
+#endif
+ EVT_ERASE_BACKGROUND(Dk4WxColourView::OnErase)
+ EVT_PAINT(Dk4WxColourView::OnPaint)
+ EVT_LEFT_DOWN(Dk4WxColourView::OnLeftMouseButtonDown)
+ EVT_RIGHT_DOWN(Dk4WxColourView::OnRightMouseButtonDown)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+/** Implementation of dynamic class.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(Dk4WxColourView, wxControl);
+#else
+IMPLEMENT_DYNAMIC_CLASS(Dk4WxColourView, wxControl)
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+/** Event generated if the colour was changed.
+*/
+wxDEFINE_EVENT(wxEVT_DK4_COLOUR_VIEW_EVENT, wxCommandEvent);
+#else
+/** Event generated if the colour was changed.
+*/
+DEFINE_EVENT_TYPE(wxEVT_DK4_COLOUR_VIEW_EVENT)
+#endif
+
+
+
+/** Name of the control.
+*/
+wxChar const Dk4WxColourView::Dk4WxColourViewName[] =
+{ wxT("Dk4WxColourView") } ;
+
+
+static int const default_palette_components[] = {
+ 0, 0, 0,
+ 0, 0, 255,
+ 0, 255, 0,
+ 0, 255, 255,
+ 255, 0, 0,
+ 255, 0, 255,
+ 255, 255, 0,
+ 255, 255, 255,
+
+ 192, 192, 192,
+ 54, 78, 109,
+ 0, 143, 0,
+ 0, 209, 209,
+ 209, 0, 0,
+ 255, 224, 224,
+ 255, 214, 0,
+ 127, 48, 0,
+};
+
+
+Dk4WxColourView::Dk4WxColourView()
+{
+ pParentWindow = NULL;
+ pHelper = NULL;
+ w = -1;
+ h = -1;
+ r = 255;
+ g = 255;
+ b = 255;
+ ccdx = -1;
+ ccdy = -1;
+ cpdx = -1;
+ cpdy = -1;
+ bActive = true;
+ bPalettePreferred = false;
+ bPlaceColourChooser = false;
+ bMarkActiveInactive = true;
+
+#line 424 "Dk4WxColourView.cpt"
+ bWithBorder = true;
+ m_wxid = wxID_ANY;
+}
+
+
+
+Dk4WxColourView::Dk4WxColourView(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos,
+ wxSize const & size,
+ long style,
+ wxChar const *name
+)
+: wxControl(
+ pParent, wxid, pos, size, style, wxDefaultValidator,
+ wxString(name)
+)
+{
+ pParentWindow = pParent;
+ pHelper = appHelper;
+ w = size.x;
+ h = size.y;
+ r = red;
+ g = green;
+ b = blue;
+ ccdx = -1;
+ ccdy = -1;
+ cpdx = -1;
+ cpdy = -1;
+ bActive = true;
+ bPalettePreferred = false;
+ bPlaceColourChooser = false;
+ bMarkActiveInactive = true;
+
+#line 462 "Dk4WxColourView.cpt"
+ bWithBorder = true;
+ m_wxid = wxid;
+}
+
+
+
+bool
+Dk4WxColourView::Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos,
+ wxSize const & size,
+ long style,
+ wxChar const *name
+)
+{
+ bool back;
+ back = wxControl::Create(
+ pParent, wxid, pos, size, style, wxDefaultValidator,
+ wxString(name)
+ );
+ pParentWindow = pParent;
+ pHelper = appHelper;
+ w = size.x;
+ h = size.y;
+ r = red;
+ g = green;
+ b = blue;
+ ccdx = -1;
+ ccdy = -1;
+ cpdx = -1;
+ cpdy = -1;
+ bActive = true;
+ bPalettePreferred = false;
+ bPlaceColourChooser = false;
+ bMarkActiveInactive = true;
+
+#line 502 "Dk4WxColourView.cpt"
+ bWithBorder = true;
+ m_wxid = wxid;
+ return back;
+}
+
+
+
+wxSize
+Dk4WxColourView::DoGetBestSize() const
+{
+ wxSize back(((-1 < w) ? w : 20), ((-1 < h) ? h : 20));
+ return back;
+}
+
+
+
+void
+Dk4WxColourView::OnErase(wxEraseEvent & WXUNUSED(event))
+{
+}
+
+
+
+void
+Dk4WxColourView::OnPaint(wxPaintEvent & WXUNUSED(event))
+{
+ wxBufferedPaintDC useDC(this);
+ wxSize sz = GetClientSize();
+ wxColour mycolor(r, g, b);
+#if wxCHECK_VERSION(3,0,0)
+ wxBrush myBrush(mycolor, wxBRUSHSTYLE_SOLID);
+#else
+ wxBrush myBrush(mycolor, wxSOLID);
+#endif
+ wxPen myPen(mycolor);
+ int b = 2;
+
+
+#line 539 "Dk4WxColourView.cpt"
+ if (bActive || (!(bMarkActiveInactive))) {
+ useDC.SetBrush(myBrush);
+ useDC.SetPen(myPen);
+ useDC.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight());
+ }
+ else {
+ wxColour iac = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWFRAME);
+ int w = sz.GetWidth();
+ int h = sz.GetHeight();
+ if (w < h) { b = w / 4; } else { b = h / 4; }
+ wxPen blackPen(wxColour(127, 0, 0));
+#if wxCHECK_VERSION(3,0,0)
+ wxBrush grayBrush(iac, wxBRUSHSTYLE_SOLID);
+#else
+ wxBrush grayBrush(iac, wxSOLID);
+#endif
+ useDC.SetBrush(grayBrush);
+ useDC.SetPen(blackPen);
+ useDC.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight());
+ useDC.SetBrush(myBrush);
+ useDC.SetPen(myPen);
+ useDC.DrawRectangle(b, b, (sz.GetWidth() - 2*b), (sz.GetHeight() - 2*b));
+ useDC.SetPen(blackPen);
+ useDC.DrawLine(0, sz.GetHeight(), sz.GetWidth(), 0);
+ }
+ useDC.SetBrush(wxNullBrush);
+ useDC.SetPen(wxNullPen);
+
+
+#line 567 "Dk4WxColourView.cpt"
+}
+
+
+
+void
+Dk4WxColourView::PlaceColourChooser(wxWindow & dlg, int x, int y)
+{
+ if (bPlaceColourChooser) {
+ Dk4WxApplicationHelper::ChooseChildPosition(*this, dlg);
+ }
+ else {
+ if ((-1 < x) && (-1 < y)) {
+ dlg.SetPosition( wxPoint(x,y) );
+ }
+ else {
+ if (NULL != pParentWindow) {
+ Dk4WxApplicationHelper::ChooseChildPosition(*pParentWindow, dlg);
+ }
+ }
+ }
+}
+
+
+
+void
+Dk4WxColourView::RunSystemColourChooser(void)
+{
+ wxColour curcol(r, g, b);
+ wxColourData wxcd;
+ for (int i = 0; i < 16; i++) {
+ wxColour col(
+ default_palette_components[3*i],
+ default_palette_components[3*i+1],
+ default_palette_components[3*i+2]
+ );
+ wxcd.SetCustomColour(i, col);
+ }
+ wxcd.SetColour(curcol);
+ wxColourDialog dlg(this, &wxcd);
+ PlaceColourChooser(dlg, ccdx, ccdy);
+ if(dlg.ShowModal() == wxID_OK) {
+ wxColour col = dlg.GetColourData().GetColour();
+ r = col.Red();
+ g = col.Green();
+ b = col.Blue();
+ dlg.GetPosition(&ccdx, &ccdy);
+ Refresh();
+ Update();
+ SendColourViewEvent();
+ } else {
+ dlg.GetPosition(&ccdx, &ccdy);
+ }
+}
+
+
+
+void
+Dk4WxColourView::RunPaletteColourChooser(void)
+{
+ Dk4WxColourPalette dlg(
+ ((pParentWindow) ? (pParentWindow) : (this)),
+ pHelper, r, g, b, bWithBorder
+ );
+ PlaceColourChooser(dlg, cpdx, cpdy);
+ if(dlg.ShowModal() == wxID_OK) {
+ r = dlg.Red();
+ g = dlg.Green();
+ b = dlg.Blue();
+ dlg.GetPosition(&cpdx, &cpdy);
+ Refresh();
+ Update();
+ SendColourViewEvent();
+ }
+ else {
+ dlg.GetPosition(&cpdx, &cpdy);
+ }
+}
+
+
+
+void
+Dk4WxColourView::OnLeftMouseButtonDown(wxMouseEvent & WXUNUSED(event))
+{
+
+
+#line 651 "Dk4WxColourView.cpt"
+ if (bActive) {
+ if (bPalettePreferred) {
+ RunPaletteColourChooser();
+ }
+ else {
+ RunSystemColourChooser();
+ }
+ }
+
+
+#line 660 "Dk4WxColourView.cpt"
+}
+
+
+
+void
+Dk4WxColourView::OnRightMouseButtonDown(wxMouseEvent & WXUNUSED(event))
+{
+
+
+#line 668 "Dk4WxColourView.cpt"
+ if (bActive) {
+ if (bPalettePreferred) {
+ RunSystemColourChooser();
+ }
+ else {
+ RunPaletteColourChooser();
+ }
+ }
+
+
+#line 677 "Dk4WxColourView.cpt"
+}
+
+
+
+int
+Dk4WxColourView::Red() const
+{
+ return r;
+}
+
+
+
+int
+Dk4WxColourView::Green() const
+{
+ return g;
+}
+
+
+
+int
+Dk4WxColourView::Blue() const
+{
+ return b;
+}
+
+
+
+void
+Dk4WxColourView::SetRGB(int red, int green, int blue)
+{
+ r = red;
+ g = green;
+ b = blue;
+ if(r < 0) r = 0;
+ if(g < 0) g = 0;
+ if(b < 0) b = 0;
+ if(r > 255) r = 255;
+ if(g > 255) g = 255;
+ if(b > 255) b = 255;
+}
+
+
+
+void
+Dk4WxColourView::SetActive(bool b)
+{
+ bool bMustUpdate;
+
+ bMustUpdate = (bActive == b);
+ bActive = b;
+ if (bMustUpdate) {
+ Refresh();
+ }
+#if 0
+ wxControl::Enable(b);
+#endif
+}
+
+
+
+void
+Dk4WxColourView::SetPalettePreferred(bool b)
+{
+ bPalettePreferred = b;
+}
+
+
+
+void
+Dk4WxColourView::SetPlaceColourChooser(bool b)
+{
+ bPlaceColourChooser = b;
+}
+
+
+
+void
+Dk4WxColourView::SetMarkActiveInactive(bool b)
+{
+ bMarkActiveInactive = b;
+
+#line 758 "Dk4WxColourView.cpt"
+}
+
+
+
+void
+Dk4WxColourView::SetColourChooserWithBorder(bool b)
+{
+ bWithBorder = b;
+}
+
+
+
+void
+Dk4WxColourView::SendColourViewEvent(void)
+{
+ if ((NULL != pParentWindow) && (wxID_ANY != m_wxid)) {
+ wxCommandEvent ev(wxEVT_DK4_COLOUR_VIEW_EVENT, m_wxid);
+ wxPostEvent(pParentWindow, ev);
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/Dk4WxColourView.cpt b/support/dktools/Dk4WxColourView.cpt
new file mode 100644
index 0000000000..a357bd109c
--- /dev/null
+++ b/support/dktools/Dk4WxColourView.cpt
@@ -0,0 +1,781 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2011-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#include <wx/wxprec.h>
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#include <wx/wx.h>
+#endif
+
+#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
+#endif
+
+#if wxCHECK_VERSION(3,0,0)
+
+/** Event generated if the colour was changed.
+*/
+wxDECLARE_EVENT(wxEVT_DK4_COLOUR_VIEW_EVENT, wxCommandEvent);
+
+#else
+
+/** Event generated if the colour was changed.
+*/
+BEGIN_DECLARE_EVENT_TYPES()
+DECLARE_EVENT_TYPE(wxEVT_DK4_COLOUR_VIEW_EVENT, -1)
+END_DECLARE_EVENT_TYPES()
+
+#endif
+
+/** Show color setting, show colour chooser on mouse click.
+*/
+class Dk4WxColourView : public wxControl
+{
+
+ /** Declare class as dynamic.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(Dk4WxColourView);
+#else
+ DECLARE_DYNAMIC_CLASS(Dk4WxColourView)
+#endif
+
+ /** Event table for control.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent window.
+ */
+ wxWindow *pParentWindow;
+
+ /** Application helper, used to position color chooser dialog.
+ */
+ Dk4WxApplicationHelper *pHelper;
+
+ /** Class name, used in constructor and Create().
+ */
+ static wxChar const Dk4WxColourViewName[];
+
+ /** ID to use in generated events.
+ */
+ wxWindowID m_wxid;
+
+ /** Height.
+ */
+ int w;
+
+ /** Width.
+ */
+ int h;
+
+ /** Red component of color to show.
+ */
+ int r;
+
+ /** Green component of color to show.
+ */
+ int g;
+
+ /** Blue component of color to show.
+ */
+ int b;
+
+ /** Previous x position of color chooser dialog.
+ */
+ int ccdx;
+
+ /** Previous y position of color chooser dialog.
+ */
+ int ccdy;
+
+ /** Previous x position of color palette dialog.
+ */
+ int cpdx;
+
+ /** Previous x position of color palette dialog.
+ */
+ int cpdy;
+
+ /** Activity flag, allow to choose a color.
+ */
+ bool bActive;
+
+ /** Flag: Prefer platte over normal view.
+ */
+ bool bPalettePreferred;
+
+ /** Flag: Set position for colour chooser.
+ */
+ bool bPlaceColourChooser;
+
+ /** Flag: Show active/inactive state.
+ */
+ bool bMarkActiveInactive;
+
+ /** Flag: Show colour chooser with a border.
+ */
+ bool bWithBorder;
+
+ protected:
+
+ /** Send event for changed colour.
+ */
+ void
+ SendColourViewEvent(void);
+
+ /** Place colour chooser dialog.
+ @param dlg Dialog to place.
+ @param x Saved x coordinate or -1.
+ @param y Saved y coordinate or -1.
+ */
+ void
+ PlaceColourChooser(wxWindow & dlg, int x, int y);
+
+ /** Run the system colour chooser.
+ */
+ void
+ RunSystemColourChooser(void);
+
+ /** Run the palette based colour chooser.
+ */
+ void
+ RunPaletteColourChooser(void);
+
+ public:
+
+ /** Default constructor.
+ */
+ Dk4WxColourView();
+
+ /** Constructor.
+ @param pParent Parent window.
+ @param wxid Window ID.
+ @param appHelper Application helper.
+ @param red Red component of color to show.
+ @param green Green component of color to show.
+ @param blue Blue component of color to show.
+ @param pos Object position.
+ @param size Object minimum size.
+ @param style Style for control.
+ @param name Class name.
+ */
+ Dk4WxColourView(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & size = wxDefaultSize,
+ long style = wxBORDER_NONE,
+ wxChar const *name = Dk4WxColourViewName
+ );
+
+ /** Create object after using default constructor.
+ @param pParent Parent window.
+ @param wxid Window ID.
+ @param appHelper Application helper.
+ @param red Red component of color to show.
+ @param green Green component of color to show.
+ @param blue Blue component of color to show.
+ @param pos Object position.
+ @param size Object minimum size.
+ @param style Style for control.
+ @param name Class name.
+ @return true on success, false on error.
+ */
+ bool
+ Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxApplicationHelper *appHelper,
+ int red = 255,
+ int green = 255,
+ int blue = 255,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & size = wxDefaultSize,
+ long style = wxBORDER_NONE,
+ wxChar const *name = Dk4WxColourViewName
+ );
+
+ /** Find minimum size.
+ */
+ wxSize DoGetBestSize() const;
+
+ /** Get red component of current color.
+ @return Red.
+ */
+ int
+ Red() const;
+
+ /** Get green component of current color.
+ @return Green.
+ */
+ int
+ Green() const;
+
+ /** Get blue component of current color.
+ @return Blue.
+ */
+ int
+ Blue() const;
+
+ /** Set new current color.
+ @param red Red.
+ @param green Green.
+ @param blue Blue.
+ */
+ void
+ SetRGB(int red, int green, int blue);
+
+ /** Set activity flag.
+ */
+ void
+ SetActive(bool b);
+
+ /** Set palette as preferred method to choose a color.
+ */
+ void
+ SetPalettePreferred(bool b = true);
+
+ /** Set whether to place the colour chooser near the colour view.
+ @param b New flag value.
+ */
+ void
+ SetPlaceColourChooser(bool b = true);
+
+ /** Set whether to indicate active/inactive state.
+ @param b new flag value.
+ */
+ void
+ SetMarkActiveInactive(bool b = true);
+
+ /** Set up border for colour chooser.
+ @param b Flag for border.
+ */
+ void
+ SetColourChooserWithBorder(bool b = true);
+
+ /** Handler for erase event.
+ @param event Event to process.
+ */
+ void
+ OnErase(wxEraseEvent & event);
+
+ /** Handler for paint event.
+ @param event Event to process.
+ */
+ void
+ OnPaint(wxPaintEvent & event);
+
+ /** Handler for mouse click event.
+ @param event Event to process.
+ */
+ void
+ OnLeftMouseButtonDown(wxMouseEvent & event);
+
+ /** Handler for right mouse click event.
+ @param event Event to process.
+ */
+ void
+ OnRightMouseButtonDown(wxMouseEvent & event);
+
+};
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#include "dk4conf.h"
+#include "Dk4WxColourView.h"
+
+#include <wx/dcbuffer.h>
+#include <wx/colordlg.h>
+
+#include "Dk4WxColourPalette.h"
+
+
+
+$!trace-include
+
+
+
+/** Handlers for events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxColourView,wxControl)
+#else
+BEGIN_EVENT_TABLE(Dk4WxColourView,wxControl)
+#endif
+ EVT_ERASE_BACKGROUND(Dk4WxColourView::OnErase)
+ EVT_PAINT(Dk4WxColourView::OnPaint)
+ EVT_LEFT_DOWN(Dk4WxColourView::OnLeftMouseButtonDown)
+ EVT_RIGHT_DOWN(Dk4WxColourView::OnRightMouseButtonDown)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+/** Implementation of dynamic class.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(Dk4WxColourView, wxControl);
+#else
+IMPLEMENT_DYNAMIC_CLASS(Dk4WxColourView, wxControl)
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+/** Event generated if the colour was changed.
+*/
+wxDEFINE_EVENT(wxEVT_DK4_COLOUR_VIEW_EVENT, wxCommandEvent);
+#else
+/** Event generated if the colour was changed.
+*/
+DEFINE_EVENT_TYPE(wxEVT_DK4_COLOUR_VIEW_EVENT)
+#endif
+
+
+
+/** Name of the control.
+*/
+wxChar const Dk4WxColourView::Dk4WxColourViewName[] =
+{ wxT("Dk4WxColourView") } ;
+
+
+static int const default_palette_components[] = {
+ 0, 0, 0,
+ 0, 0, 255,
+ 0, 255, 0,
+ 0, 255, 255,
+ 255, 0, 0,
+ 255, 0, 255,
+ 255, 255, 0,
+ 255, 255, 255,
+
+ 192, 192, 192,
+ 54, 78, 109,
+ 0, 143, 0,
+ 0, 209, 209,
+ 209, 0, 0,
+ 255, 224, 224,
+ 255, 214, 0,
+ 127, 48, 0,
+};
+
+
+Dk4WxColourView::Dk4WxColourView()
+{
+ pParentWindow = NULL;
+ pHelper = NULL;
+ w = -1;
+ h = -1;
+ r = 255;
+ g = 255;
+ b = 255;
+ ccdx = -1;
+ ccdy = -1;
+ cpdx = -1;
+ cpdy = -1;
+ bActive = true;
+ bPalettePreferred = false;
+ bPlaceColourChooser = false;
+ bMarkActiveInactive = true; $? ". bMarkActiveInactive = true"
+ bWithBorder = true;
+ m_wxid = wxID_ANY;
+}
+
+
+
+Dk4WxColourView::Dk4WxColourView(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos,
+ wxSize const & size,
+ long style,
+ wxChar const *name
+)
+: wxControl(
+ pParent, wxid, pos, size, style, wxDefaultValidator,
+ wxString(name)
+)
+{
+ pParentWindow = pParent;
+ pHelper = appHelper;
+ w = size.x;
+ h = size.y;
+ r = red;
+ g = green;
+ b = blue;
+ ccdx = -1;
+ ccdy = -1;
+ cpdx = -1;
+ cpdy = -1;
+ bActive = true;
+ bPalettePreferred = false;
+ bPlaceColourChooser = false;
+ bMarkActiveInactive = true; $? ". bMarkActiveInactive = true"
+ bWithBorder = true;
+ m_wxid = wxid;
+}
+
+
+
+bool
+Dk4WxColourView::Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos,
+ wxSize const & size,
+ long style,
+ wxChar const *name
+)
+{
+ bool back;
+ back = wxControl::Create(
+ pParent, wxid, pos, size, style, wxDefaultValidator,
+ wxString(name)
+ );
+ pParentWindow = pParent;
+ pHelper = appHelper;
+ w = size.x;
+ h = size.y;
+ r = red;
+ g = green;
+ b = blue;
+ ccdx = -1;
+ ccdy = -1;
+ cpdx = -1;
+ cpdy = -1;
+ bActive = true;
+ bPalettePreferred = false;
+ bPlaceColourChooser = false;
+ bMarkActiveInactive = true; $? ". bMarkActiveInactive = true"
+ bWithBorder = true;
+ m_wxid = wxid;
+ return back;
+}
+
+
+
+wxSize
+Dk4WxColourView::DoGetBestSize() const
+{
+ wxSize back(((-1 < w) ? w : 20), ((-1 < h) ? h : 20));
+ return back;
+}
+
+
+
+void
+Dk4WxColourView::OnErase(wxEraseEvent & WXUNUSED(event))
+{
+}
+
+
+
+void
+Dk4WxColourView::OnPaint(wxPaintEvent & WXUNUSED(event))
+{
+ wxBufferedPaintDC useDC(this);
+ wxSize sz = GetClientSize();
+ wxColour mycolor(r, g, b);
+#if wxCHECK_VERSION(3,0,0)
+ wxBrush myBrush(mycolor, wxBRUSHSTYLE_SOLID);
+#else
+ wxBrush myBrush(mycolor, wxSOLID);
+#endif
+ wxPen myPen(mycolor);
+ int b = 2;
+ $? "+ OnPaint"
+ if (bActive || (!(bMarkActiveInactive))) {
+ useDC.SetBrush(myBrush);
+ useDC.SetPen(myPen);
+ useDC.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight());
+ }
+ else {
+ wxColour iac = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWFRAME);
+ int w = sz.GetWidth();
+ int h = sz.GetHeight();
+ if (w < h) { b = w / 4; } else { b = h / 4; }
+ wxPen blackPen(wxColour(127, 0, 0));
+#if wxCHECK_VERSION(3,0,0)
+ wxBrush grayBrush(iac, wxBRUSHSTYLE_SOLID);
+#else
+ wxBrush grayBrush(iac, wxSOLID);
+#endif
+ useDC.SetBrush(grayBrush);
+ useDC.SetPen(blackPen);
+ useDC.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight());
+ useDC.SetBrush(myBrush);
+ useDC.SetPen(myPen);
+ useDC.DrawRectangle(b, b, (sz.GetWidth() - 2*b), (sz.GetHeight() - 2*b));
+ useDC.SetPen(blackPen);
+ useDC.DrawLine(0, sz.GetHeight(), sz.GetWidth(), 0);
+ }
+ useDC.SetBrush(wxNullBrush);
+ useDC.SetPen(wxNullPen);
+ $? "- OnPaint"
+}
+
+
+
+void
+Dk4WxColourView::PlaceColourChooser(wxWindow & dlg, int x, int y)
+{
+ if (bPlaceColourChooser) {
+ Dk4WxApplicationHelper::ChooseChildPosition(*this, dlg);
+ }
+ else {
+ if ((-1 < x) && (-1 < y)) {
+ dlg.SetPosition( wxPoint(x,y) );
+ }
+ else {
+ if (NULL != pParentWindow) {
+ Dk4WxApplicationHelper::ChooseChildPosition(*pParentWindow, dlg);
+ }
+ }
+ }
+}
+
+
+
+void
+Dk4WxColourView::RunSystemColourChooser(void)
+{
+ wxColour curcol(r, g, b);
+ wxColourData wxcd;
+ for (int i = 0; i < 16; i++) {
+ wxColour col(
+ default_palette_components[3*i],
+ default_palette_components[3*i+1],
+ default_palette_components[3*i+2]
+ );
+ wxcd.SetCustomColour(i, col);
+ }
+ wxcd.SetColour(curcol);
+ wxColourDialog dlg(this, &wxcd);
+ PlaceColourChooser(dlg, ccdx, ccdy);
+ if(dlg.ShowModal() == wxID_OK) {
+ wxColour col = dlg.GetColourData().GetColour();
+ r = col.Red();
+ g = col.Green();
+ b = col.Blue();
+ dlg.GetPosition(&ccdx, &ccdy);
+ Refresh();
+ Update();
+ SendColourViewEvent();
+ } else {
+ dlg.GetPosition(&ccdx, &ccdy);
+ }
+}
+
+
+
+void
+Dk4WxColourView::RunPaletteColourChooser(void)
+{
+ Dk4WxColourPalette dlg(
+ ((pParentWindow) ? (pParentWindow) : (this)),
+ pHelper, r, g, b, bWithBorder
+ );
+ PlaceColourChooser(dlg, cpdx, cpdy);
+ if(dlg.ShowModal() == wxID_OK) {
+ r = dlg.Red();
+ g = dlg.Green();
+ b = dlg.Blue();
+ dlg.GetPosition(&cpdx, &cpdy);
+ Refresh();
+ Update();
+ SendColourViewEvent();
+ }
+ else {
+ dlg.GetPosition(&cpdx, &cpdy);
+ }
+}
+
+
+
+void
+Dk4WxColourView::OnLeftMouseButtonDown(wxMouseEvent & WXUNUSED(event))
+{
+ $? "+ Dk4WxColourView::OnLeftMouseButtonDown"
+ if (bActive) {
+ if (bPalettePreferred) {
+ RunPaletteColourChooser();
+ }
+ else {
+ RunSystemColourChooser();
+ }
+ }
+ $? "- Dk4WxColourView::OnLeftMouseButtonDown"
+}
+
+
+
+void
+Dk4WxColourView::OnRightMouseButtonDown(wxMouseEvent & WXUNUSED(event))
+{
+ $? "+ Dk4WxColourView::OnRightMouseButtonDown"
+ if (bActive) {
+ if (bPalettePreferred) {
+ RunSystemColourChooser();
+ }
+ else {
+ RunPaletteColourChooser();
+ }
+ }
+ $? "- Dk4WxColourView::OnRightMouseButtonDown"
+}
+
+
+
+int
+Dk4WxColourView::Red() const
+{
+ return r;
+}
+
+
+
+int
+Dk4WxColourView::Green() const
+{
+ return g;
+}
+
+
+
+int
+Dk4WxColourView::Blue() const
+{
+ return b;
+}
+
+
+
+void
+Dk4WxColourView::SetRGB(int red, int green, int blue)
+{
+ r = red;
+ g = green;
+ b = blue;
+ if(r < 0) r = 0;
+ if(g < 0) g = 0;
+ if(b < 0) b = 0;
+ if(r > 255) r = 255;
+ if(g > 255) g = 255;
+ if(b > 255) b = 255;
+}
+
+
+
+void
+Dk4WxColourView::SetActive(bool b)
+{
+ bool bMustUpdate;
+
+ bMustUpdate = (bActive == b);
+ bActive = b;
+ if (bMustUpdate) {
+ Refresh();
+ }
+#if 0
+ wxControl::Enable(b);
+#endif
+}
+
+
+
+void
+Dk4WxColourView::SetPalettePreferred(bool b)
+{
+ bPalettePreferred = b;
+}
+
+
+
+void
+Dk4WxColourView::SetPlaceColourChooser(bool b)
+{
+ bPlaceColourChooser = b;
+}
+
+
+
+void
+Dk4WxColourView::SetMarkActiveInactive(bool b)
+{
+ bMarkActiveInactive = b; $? ". bMarkActiveInactive = %d", ((b) ? 1 : 0)
+}
+
+
+
+void
+Dk4WxColourView::SetColourChooserWithBorder(bool b)
+{
+ bWithBorder = b;
+}
+
+
+
+void
+Dk4WxColourView::SendColourViewEvent(void)
+{
+ if ((NULL != pParentWindow) && (wxID_ANY != m_wxid)) {
+ wxCommandEvent ev(wxEVT_DK4_COLOUR_VIEW_EVENT, m_wxid);
+ wxPostEvent(pParentWindow, ev);
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/Dk4WxColourView.h b/support/dktools/Dk4WxColourView.h
new file mode 100644
index 0000000000..8cf52f50fd
--- /dev/null
+++ b/support/dktools/Dk4WxColourView.h
@@ -0,0 +1,339 @@
+/*
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxColourView.cpt
+*/
+
+/** @file Dk4WxColourView.h Header file for the Dk4WxColourView module.
+*/
+
+#ifndef DK4WXCOLOURVIEW_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4WXCOLOURVIEW_H_INCLUDED 1
+
+
+#line 9 "Dk4WxColourView.cpt"
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#include <wx/wxprec.h>
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#include <wx/wx.h>
+#endif
+
+#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
+#endif
+
+#if wxCHECK_VERSION(3,0,0)
+
+/** Event generated if the colour was changed.
+*/
+wxDECLARE_EVENT(wxEVT_DK4_COLOUR_VIEW_EVENT, wxCommandEvent);
+
+#else
+
+/** Event generated if the colour was changed.
+*/
+BEGIN_DECLARE_EVENT_TYPES()
+DECLARE_EVENT_TYPE(wxEVT_DK4_COLOUR_VIEW_EVENT, -1)
+END_DECLARE_EVENT_TYPES()
+
+#endif
+
+/** Show color setting, show colour chooser on mouse click.
+*/
+class Dk4WxColourView : public wxControl
+{
+
+ /** Declare class as dynamic.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(Dk4WxColourView);
+#else
+ DECLARE_DYNAMIC_CLASS(Dk4WxColourView)
+#endif
+
+ /** Event table for control.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent window.
+ */
+ wxWindow *pParentWindow;
+
+ /** Application helper, used to position color chooser dialog.
+ */
+ Dk4WxApplicationHelper *pHelper;
+
+ /** Class name, used in constructor and Create().
+ */
+ static wxChar const Dk4WxColourViewName[];
+
+ /** ID to use in generated events.
+ */
+ wxWindowID m_wxid;
+
+ /** Height.
+ */
+ int w;
+
+ /** Width.
+ */
+ int h;
+
+ /** Red component of color to show.
+ */
+ int r;
+
+ /** Green component of color to show.
+ */
+ int g;
+
+ /** Blue component of color to show.
+ */
+ int b;
+
+ /** Previous x position of color chooser dialog.
+ */
+ int ccdx;
+
+ /** Previous y position of color chooser dialog.
+ */
+ int ccdy;
+
+ /** Previous x position of color palette dialog.
+ */
+ int cpdx;
+
+ /** Previous x position of color palette dialog.
+ */
+ int cpdy;
+
+ /** Activity flag, allow to choose a color.
+ */
+ bool bActive;
+
+ /** Flag: Prefer platte over normal view.
+ */
+ bool bPalettePreferred;
+
+ /** Flag: Set position for colour chooser.
+ */
+ bool bPlaceColourChooser;
+
+ /** Flag: Show active/inactive state.
+ */
+ bool bMarkActiveInactive;
+
+ /** Flag: Show colour chooser with a border.
+ */
+ bool bWithBorder;
+
+ protected:
+
+ /** Send event for changed colour.
+ */
+ void
+ SendColourViewEvent(void);
+
+ /** Place colour chooser dialog.
+ @param dlg Dialog to place.
+ @param x Saved x coordinate or -1.
+ @param y Saved y coordinate or -1.
+ */
+ void
+ PlaceColourChooser(wxWindow & dlg, int x, int y);
+
+ /** Run the system colour chooser.
+ */
+ void
+ RunSystemColourChooser(void);
+
+ /** Run the palette based colour chooser.
+ */
+ void
+ RunPaletteColourChooser(void);
+
+ public:
+
+ /** Default constructor.
+ */
+ Dk4WxColourView();
+
+ /** Constructor.
+ @param pParent Parent window.
+ @param wxid Window ID.
+ @param appHelper Application helper.
+ @param red Red component of color to show.
+ @param green Green component of color to show.
+ @param blue Blue component of color to show.
+ @param pos Object position.
+ @param size Object minimum size.
+ @param style Style for control.
+ @param name Class name.
+ */
+ Dk4WxColourView(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxApplicationHelper *appHelper,
+ int red,
+ int green,
+ int blue,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & size = wxDefaultSize,
+ long style = wxBORDER_NONE,
+ wxChar const *name = Dk4WxColourViewName
+ );
+
+ /** Create object after using default constructor.
+ @param pParent Parent window.
+ @param wxid Window ID.
+ @param appHelper Application helper.
+ @param red Red component of color to show.
+ @param green Green component of color to show.
+ @param blue Blue component of color to show.
+ @param pos Object position.
+ @param size Object minimum size.
+ @param style Style for control.
+ @param name Class name.
+ @return true on success, false on error.
+ */
+ bool
+ Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ Dk4WxApplicationHelper *appHelper,
+ int red = 255,
+ int green = 255,
+ int blue = 255,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & size = wxDefaultSize,
+ long style = wxBORDER_NONE,
+ wxChar const *name = Dk4WxColourViewName
+ );
+
+ /** Find minimum size.
+ */
+ wxSize DoGetBestSize() const;
+
+ /** Get red component of current color.
+ @return Red.
+ */
+ int
+ Red() const;
+
+ /** Get green component of current color.
+ @return Green.
+ */
+ int
+ Green() const;
+
+ /** Get blue component of current color.
+ @return Blue.
+ */
+ int
+ Blue() const;
+
+ /** Set new current color.
+ @param red Red.
+ @param green Green.
+ @param blue Blue.
+ */
+ void
+ SetRGB(int red, int green, int blue);
+
+ /** Set activity flag.
+ */
+ void
+ SetActive(bool b);
+
+ /** Set palette as preferred method to choose a color.
+ */
+ void
+ SetPalettePreferred(bool b = true);
+
+ /** Set whether to place the colour chooser near the colour view.
+ @param b New flag value.
+ */
+ void
+ SetPlaceColourChooser(bool b = true);
+
+ /** Set whether to indicate active/inactive state.
+ @param b new flag value.
+ */
+ void
+ SetMarkActiveInactive(bool b = true);
+
+ /** Set up border for colour chooser.
+ @param b Flag for border.
+ */
+ void
+ SetColourChooserWithBorder(bool b = true);
+
+ /** Handler for erase event.
+ @param event Event to process.
+ */
+ void
+ OnErase(wxEraseEvent & event);
+
+ /** Handler for paint event.
+ @param event Event to process.
+ */
+ void
+ OnPaint(wxPaintEvent & event);
+
+ /** Handler for mouse click event.
+ @param event Event to process.
+ */
+ void
+ OnLeftMouseButtonDown(wxMouseEvent & event);
+
+ /** Handler for right mouse click event.
+ @param event Event to process.
+ */
+ void
+ OnRightMouseButtonDown(wxMouseEvent & event);
+
+};
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/Dk4WxControl.cpp b/support/dktools/Dk4WxControl.cpp
index 49fc86e6ff..3db728b074 100644
--- a/support/dktools/Dk4WxControl.cpp
+++ b/support/dktools/Dk4WxControl.cpp
@@ -1,63 +1,55 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxControl.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxControl.cpt
*/
/** @file Dk4WxControl.cpp The Dk4WxControl module.
*/
-#line 205 "Dk4WxControl.cpt"
+#line 221 "Dk4WxControl.cpt"
+#include "dk4conf.h"
#include "Dk4WxControl.h"
-#line 211 "Dk4WxControl.cpt"
+#line 228 "Dk4WxControl.cpt"
const wxChar Dk4WxControl::Dk4WxControlName[] = { wxT("Dk4WxControl") };
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(Dk4WxControl, wxControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(Dk4WxControl, wxControl)
+#endif
+
-BEGIN_EVENT_TABLE(Dk4WxControl, wxControl)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxControl,wxControl)
+#else
+BEGIN_EVENT_TABLE(Dk4WxControl,wxControl)
+#endif
EVT_ERASE_BACKGROUND(Dk4WxControl::OnErase)
EVT_PAINT(Dk4WxControl::OnPaint)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -66,14 +58,14 @@ Dk4WxControl::Dk4WxControl()
{
-#line 230 "Dk4WxControl.cpt"
+#line 260 "Dk4WxControl.cpt"
pBitmap = NULL;
iBmWidth = -1;
iBmHeight = -1;
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-#line 235 "Dk4WxControl.cpt"
+#line 265 "Dk4WxControl.cpt"
}
@@ -92,7 +84,7 @@ Dk4WxControl::Create(
bool back;
-#line 252 "Dk4WxControl.cpt"
+#line 282 "Dk4WxControl.cpt"
back = wxControl::Create(
parent, wid, pos, size, style, validator, name
);
@@ -102,7 +94,7 @@ Dk4WxControl::Create(
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-#line 260 "Dk4WxControl.cpt"
+#line 290 "Dk4WxControl.cpt"
return back;
}
@@ -121,14 +113,14 @@ Dk4WxControl::Dk4WxControl(
{
-#line 277 "Dk4WxControl.cpt"
+#line 307 "Dk4WxControl.cpt"
pBitmap = NULL;
iBmWidth = -1;
iBmHeight = -1;
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-#line 282 "Dk4WxControl.cpt"
+#line 312 "Dk4WxControl.cpt"
}
@@ -137,7 +129,7 @@ Dk4WxControl::~Dk4WxControl()
{
-#line 289 "Dk4WxControl.cpt"
+#line 319 "Dk4WxControl.cpt"
{
wxCriticalSectionLocker lock(csProtect);
if (NULL != pBitmap) { delete(pBitmap); }
@@ -147,20 +139,20 @@ Dk4WxControl::~Dk4WxControl()
}
-#line 297 "Dk4WxControl.cpt"
+#line 327 "Dk4WxControl.cpt"
}
void
-Dk4WxControl::OnErase(wxEraseEvent & event)
+Dk4WxControl::OnErase(wxEraseEvent & WXUNUSED(event))
{
-#line 305 "Dk4WxControl.cpt"
+#line 335 "Dk4WxControl.cpt"
-#line 306 "Dk4WxControl.cpt"
+#line 336 "Dk4WxControl.cpt"
}
@@ -168,8 +160,8 @@ Dk4WxControl::OnErase(wxEraseEvent & event)
void
Dk4WxControl::PaintOperation(
wxDC & pdc,
- wxPaintEvent & event,
- bool buffered,
+ wxPaintEvent & WXUNUSED(event),
+ bool WXUNUSED(buffered),
int clWidth,
int clHeight
)
@@ -200,7 +192,7 @@ Dk4WxControl::InternalPaint(
int bgm = pdc.GetBackgroundMode();
-#line 344 "Dk4WxControl.cpt"
+#line 374 "Dk4WxControl.cpt"
/* Do the real pain operation.
*/
PaintOperation(pdc, event, buffered, clWidth, clHeight);
@@ -215,7 +207,7 @@ Dk4WxControl::InternalPaint(
pdc.SetBrush(br);
-#line 357 "Dk4WxControl.cpt"
+#line 387 "Dk4WxControl.cpt"
}
@@ -230,7 +222,7 @@ Dk4WxControl::OnPaint(wxPaintEvent & event)
bool done = false;
-#line 370 "Dk4WxControl.cpt"
+#line 400 "Dk4WxControl.cpt"
{
wxCriticalSectionLocker lock(csProtect);
wxSize sz = GetClientSize();
@@ -268,7 +260,7 @@ Dk4WxControl::OnPaint(wxPaintEvent & event)
}
-#line 406 "Dk4WxControl.cpt"
+#line 436 "Dk4WxControl.cpt"
}
@@ -278,14 +270,14 @@ Dk4WxControl::SetUpdate(bool flag)
{
-#line 414 "Dk4WxControl.cpt"
+#line 444 "Dk4WxControl.cpt"
if (flag) {
wxCriticalSectionLocker lock(csProtect);
bUpdate = true;
}
-#line 419 "Dk4WxControl.cpt"
+#line 449 "Dk4WxControl.cpt"
}
diff --git a/support/dktools/Dk4WxControl.cpt b/support/dktools/Dk4WxControl.cpt
index 76a0ffc8c7..7d53467e5a 100644
--- a/support/dktools/Dk4WxControl.cpt
+++ b/support/dktools/Dk4WxControl.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,11 +12,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -51,8 +59,8 @@ license = bsd
the constructors.
From Create() call Dk4WxControl::Create().
- You should also use DECLARE_DYNAMIC_CLASS() and
- IMPLEMENT_DYNAMIC_CLASS().
+ You should also use wxDECLARE_DYNAMIC_CLASS() and;
+ wxIMPLEMENT_DYNAMIC_CLASS().
*/
class Dk4WxControl : public wxControl
{
@@ -60,11 +68,19 @@ class Dk4WxControl : public wxControl
/** For RTTI.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(Dk4WxControl);
+#else
DECLARE_DYNAMIC_CLASS(Dk4WxControl)
+#endif
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -203,6 +219,7 @@ class Dk4WxControl : public wxControl
%% module
+#include "dk4conf.h"
#include "Dk4WxControl.h"
@@ -214,12 +231,25 @@ $!trace-include
const wxChar Dk4WxControl::Dk4WxControlName[] = { wxT("Dk4WxControl") };
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(Dk4WxControl, wxControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(Dk4WxControl, wxControl)
+#endif
-BEGIN_EVENT_TABLE(Dk4WxControl, wxControl)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxControl,wxControl)
+#else
+BEGIN_EVENT_TABLE(Dk4WxControl,wxControl)
+#endif
EVT_ERASE_BACKGROUND(Dk4WxControl::OnErase)
EVT_PAINT(Dk4WxControl::OnPaint)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -299,7 +329,7 @@ Dk4WxControl::~Dk4WxControl()
void
-Dk4WxControl::OnErase(wxEraseEvent & event)
+Dk4WxControl::OnErase(wxEraseEvent & WXUNUSED(event))
{
$? "+ OnErase"
$? "- OnErase"
@@ -310,8 +340,8 @@ Dk4WxControl::OnErase(wxEraseEvent & event)
void
Dk4WxControl::PaintOperation(
wxDC & pdc,
- wxPaintEvent & event,
- bool buffered,
+ wxPaintEvent & WXUNUSED(event),
+ bool WXUNUSED(buffered),
int clWidth,
int clHeight
)
diff --git a/support/dktools/Dk4WxControl.h b/support/dktools/Dk4WxControl.h
index 26ec3a9934..500e47b304 100644
--- a/support/dktools/Dk4WxControl.h
+++ b/support/dktools/Dk4WxControl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxControl.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxControl.cpt
*/
#ifndef DK4WXCONTROL_H_INCLUDED
@@ -44,11 +22,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -83,8 +69,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
the constructors.
From Create() call Dk4WxControl::Create().
- You should also use DECLARE_DYNAMIC_CLASS() and
- IMPLEMENT_DYNAMIC_CLASS().
+ You should also use wxDECLARE_DYNAMIC_CLASS() and;
+ wxIMPLEMENT_DYNAMIC_CLASS().
*/
class Dk4WxControl : public wxControl
{
@@ -92,11 +78,19 @@ class Dk4WxControl : public wxControl
/** For RTTI.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(Dk4WxControl);
+#else
DECLARE_DYNAMIC_CLASS(Dk4WxControl)
+#endif
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
diff --git a/support/dktools/Dk4WxFrame.cpp b/support/dktools/Dk4WxFrame.cpp
index ead3817166..4d684ace05 100644
--- a/support/dktools/Dk4WxFrame.cpp
+++ b/support/dktools/Dk4WxFrame.cpp
@@ -1,52 +1,59 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxFrame.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxFrame.cpt
*/
/** @file Dk4WxFrame.cpp The Dk4WxFrame module.
*/
-#line 136 "Dk4WxFrame.cpt"
+#line 166 "Dk4WxFrame.cpt"
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+#ifndef DK4WXFRAME_H_INCLUDED
#include "Dk4WxFrame.h"
+#endif
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#include "dk4strx.h"
+#endif
+
+#ifndef DK4RECWX_H_INCLUDED
+#include "dk4recwx.h"
+#endif
-#line 143 "Dk4WxFrame.cpt"
+
+
+#line 202 "Dk4WxFrame.cpt"
@@ -87,7 +94,7 @@ wxT("window.iconized"),
NULL
-#line 170 "Dk4WxFrame.cpt"
+#line 229 "Dk4WxFrame.cpt"
};
@@ -107,7 +114,38 @@ wxT("window.restore-size"),
NULL
-#line 182 "Dk4WxFrame.cpt"
+#line 241 "Dk4WxFrame.cpt"
+};
+
+
+
+/** File name suffixes indicating to open file in web browser.
+*/
+static const wxChar * const dk4wxframe_suffix_web[] = {
+/* 0 */
+wxT(".html"),
+
+/* 1 */
+wxT(".htm"),
+
+NULL
+
+
+#line 252 "Dk4WxFrame.cpt"
+};
+
+
+
+/** Static text fragments, not localized.
+*/
+static const wxChar * const dk4wxframe_kwnl_wx[] = {
+/* 0 */
+wxT("file://"),
+
+NULL
+
+
+#line 265 "Dk4WxFrame.cpt"
};
@@ -167,7 +205,7 @@ Dk4WxFrame::OnClose(wxCloseEvent & event)
bool
-Dk4WxFrame::CanClose(bool isFinal)
+Dk4WxFrame::CanClose(bool WXUNUSED(isFinal))
{
return true;
}
@@ -177,6 +215,9 @@ void
Dk4WxFrame::SavePosition(void)
{
int iv[6];
+
+
+#line 335 "Dk4WxFrame.cpt"
if (NULL != pAppHelp) {
iv[4] = iv[5] = 0;
if (IsIconized()) {
@@ -191,21 +232,24 @@ Dk4WxFrame::SavePosition(void)
GetSize(&(iv[2]), &(iv[3]));
-#line 264 "Dk4WxFrame.cpt"
+#line 348 "Dk4WxFrame.cpt"
-#line 265 "Dk4WxFrame.cpt"
+#line 349 "Dk4WxFrame.cpt"
-#line 266 "Dk4WxFrame.cpt"
+#line 350 "Dk4WxFrame.cpt"
-#line 267 "Dk4WxFrame.cpt"
+#line 351 "Dk4WxFrame.cpt"
-#line 268 "Dk4WxFrame.cpt"
+#line 352 "Dk4WxFrame.cpt"
pAppHelp->SetMultiple(dk4wxframe_kw_size, iv, 6);
}
+
+
+#line 355 "Dk4WxFrame.cpt"
}
@@ -214,7 +258,7 @@ void
Dk4WxFrame::RestorePosition(void)
{
int iv[6]; /* Values stored in config */
- bool bv[3]; /* Feature restore */
+ bool bv[3]; /* Feature restore: maximized, iconized, position */
int x; /* X position */
int y; /* Y position */
int w; /* Width */
@@ -222,13 +266,11 @@ Dk4WxFrame::RestorePosition(void)
-#line 285 "Dk4WxFrame.cpt"
+#line 370 "Dk4WxFrame.cpt"
-#if wxCHECK_VERSION(3,0,0)
- bv[2] = false;
-#else
+ /* Restore position by default.
+ */
bv[2] = true;
-#endif
/* Initialize variables.
*/
@@ -240,7 +282,34 @@ Dk4WxFrame::RestorePosition(void)
*/
if (NULL != pAppHelp) {
pAppHelp->GetMultiple(dk4wxframe_kw_size, iv, 6);
+
+
+#line 386 "Dk4WxFrame.cpt"
+
+
+#line 387 "Dk4WxFrame.cpt"
+
+
+#line 388 "Dk4WxFrame.cpt"
+
+
+#line 389 "Dk4WxFrame.cpt"
+
+
+#line 390 "Dk4WxFrame.cpt"
+
+
+#line 391 "Dk4WxFrame.cpt"
pAppHelp->GetMultiple(dk4wxframe_kw_restore, bv, 3);
+
+
+#line 393 "Dk4WxFrame.cpt"
+
+
+#line 394 "Dk4WxFrame.cpt"
+
+
+#line 395 "Dk4WxFrame.cpt"
}
/* Find size if not stored.
@@ -248,27 +317,92 @@ Dk4WxFrame::RestorePosition(void)
GetSize(&w, &h);
x = iv[0];
y = iv[1];
+
+
+#line 403 "Dk4WxFrame.cpt"
+
+
+#line 404 "Dk4WxFrame.cpt"
+
+
+#line 405 "Dk4WxFrame.cpt"
+
+
+#line 406 "Dk4WxFrame.cpt"
/* Correct size if size restoration wanted, increase if necessary.
*/
if (bv[2]) {
-#line 314 "Dk4WxFrame.cpt"
- if (iv[2] > w) { w = iv[2]; }
- if (iv[3] > h) { h = iv[3]; }
+#line 410 "Dk4WxFrame.cpt"
+ if (iv[2] > w) {
+ w = iv[2];
+
+#line 412 "Dk4WxFrame.cpt"
+ }
+ if (iv[3] > h) {
+ h = iv[3];
+
+#line 415 "Dk4WxFrame.cpt"
+ }
}
/* Correct values, no parts of window should be outside screen.
*/
Dk4WxApplicationHelper::CorrectPosition(x, y, w, h);
+
+
+#line 422 "Dk4WxFrame.cpt"
+
+
+#line 423 "Dk4WxFrame.cpt"
+
+
+#line 424 "Dk4WxFrame.cpt"
+
+
+#line 425 "Dk4WxFrame.cpt"
/* Set position and optionally size.
*/
if (bv[2]) {
-#line 325 "Dk4WxFrame.cpt"
+#line 429 "Dk4WxFrame.cpt"
SetSize(x, y, w, h);
- } else {
+#if wxCHECK_VERSION(3,0,0)
+ {
+ int t1 = 0;
+ int t2 = 0;
+ GetSize(&t1, &t2);
+ if ((t1 > w) || (t2 > h)) {
+
+#line 436 "Dk4WxFrame.cpt"
+ if (t1 > w) {
+ w = w - (t1 - w);
+
+#line 438 "Dk4WxFrame.cpt"
+ }
+ if (t2 > h) {
+ h = h - (t2 - h);
+
+#line 441 "Dk4WxFrame.cpt"
+ }
+
+#line 442 "Dk4WxFrame.cpt"
+ SetSize(x, y, w, h);
+ GetSize(&t1, &t2);
+
+
+#line 445 "Dk4WxFrame.cpt"
+
+
+#line 446 "Dk4WxFrame.cpt"
+ }
+ }
+#endif
+ } else {
+
+#line 450 "Dk4WxFrame.cpt"
SetPosition( wxPoint(x,y) );
}
@@ -276,18 +410,30 @@ Dk4WxFrame::RestorePosition(void)
*/
if (bv[0]) {
-#line 333 "Dk4WxFrame.cpt"
+#line 456 "Dk4WxFrame.cpt"
Maximize(0 != iv[4]);
}
+#if TRACE_DEBUG
+ else {
+
+#line 460 "Dk4WxFrame.cpt"
+ }
+#endif
if (bv[1]) {
-#line 336 "Dk4WxFrame.cpt"
+#line 463 "Dk4WxFrame.cpt"
Iconize(0 != iv[5]);
}
+#if TRACE_DEBUG
+ else {
+
+#line 467 "Dk4WxFrame.cpt"
+ }
+#endif
-#line 340 "Dk4WxFrame.cpt"
+#line 471 "Dk4WxFrame.cpt"
}
@@ -321,3 +467,239 @@ Dk4WxFrame::DisplaySection(int number)
}
+
+bool
+Dk4WxFrame::FindFileAndLaunch(dkChar const *fn, bool bIsHelp, bool bVerbose)
+{
+ wxChar bw[2 * DK4_MAX_PATH]; /* Full path in wxChar */
+ wxChar b2[2 * DK4_MAX_PATH];
+ dkChar b1[DK4_MAX_PATH]; /* Search result (full path) */
+ wxChar const *psuffix; /* File name suffix */
+ wxChar *pmod;
+ size_t szb1 = DK4_SIZEOF(b1,dkChar); /* Size of b1 (num of dkChar) */
+ size_t szb2 = DK4_SIZEOF(b2,wxChar); /* Size of b2 (num of wxChar) */
+ size_t szbw = DK4_SIZEOF(bw,wxChar); /* Size of bw (num of wxChar) */
+ int res; /* Operation result */
+ int de; /* Destination encoding */
+ int se; /* Source encoding */
+ bool isweb; /* Use web browser */
+ bool done; /* Successfully done */
+ bool back; /* Result */
+
+
+#line 523 "Dk4WxFrame.cpt"
+ back = false;
+ if ((NULL != fn) && (NULL != pAppHelp)) {
+ done = false;
+ /*
+ Check for absolute path.
+ Use absolute path unchanged.
+ For a relative path do file search.
+ */
+ if (0 != dk4path_is_absolute(fn)) {
+
+#line 532 "Dk4WxFrame.cpt"
+ if (0 != dk4str_cpy_s(b1, szb1, fn, NULL)) {
+
+#line 533 "Dk4WxFrame.cpt"
+ done = true;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 537 "Dk4WxFrame.cpt"
+ }
+#endif
+ }
+ else {
+
+#line 541 "Dk4WxFrame.cpt"
+ if (bIsHelp) {
+ if (pAppHelp->FindHelpFile(b1, szb1, fn)) {
+
+#line 543 "Dk4WxFrame.cpt"
+ done = true;
+
+#line 544 "Dk4WxFrame.cpt"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 547 "Dk4WxFrame.cpt"
+ }
+#endif
+ }
+ else {
+ if (pAppHelp->FindDataFile(b1, szb1, fn)) {
+
+#line 552 "Dk4WxFrame.cpt"
+ done = true;
+
+#line 553 "Dk4WxFrame.cpt"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 556 "Dk4WxFrame.cpt"
+ }
+#endif
+ }
+ }
+ if (done) {
+ done = false;
+ de = pAppHelp->GetWxEncoding();
+ se = pAppHelp->GetDkEncoding();
+ res = dk4recwx_dkchar_to_wxchar(bw, szbw, de, b1, se, NULL);
+ if (0 != res) {
+
+#line 566 "Dk4WxFrame.cpt"
+ isweb = false;
+
+#line 567 "Dk4WxFrame.cpt"
+ psuffix = dk4strx_get_path_suffix(bw, NULL);
+ if (NULL != psuffix) {
+
+#line 569 "Dk4WxFrame.cpt"
+ if (0 <= dk4strx_array_index(dk4wxframe_suffix_web, psuffix, 0)) {
+ isweb = true;
+
+#line 571 "Dk4WxFrame.cpt"
+ }
+ }
+ if (isweb) {
+
+#line 574 "Dk4WxFrame.cpt"
+ if (::wxLaunchDefaultBrowser(bw)) {
+ done = true;
+
+#line 576 "Dk4WxFrame.cpt"
+ back = true;
+ }
+ else {
+
+#line 579 "Dk4WxFrame.cpt"
+ if (0 != dk4strx_cpy_s(b2, szb2, dk4wxframe_kwnl_wx[0], NULL)) {
+
+
+#line 581 "Dk4WxFrame.cpt"
+ if (0 != dk4strx_cat_s(b2, szb2, bw, NULL)) {
+
+#line 582 "Dk4WxFrame.cpt"
+
+
+#line 583 "Dk4WxFrame.cpt"
+ if (::wxLaunchDefaultBrowser(bw)) {
+
+#line 584 "Dk4WxFrame.cpt"
+ done = true;
+ back = true;
+ }
+ else {
+
+#line 588 "Dk4WxFrame.cpt"
+ pmod = &(b2[dk4strx_len(dk4wxframe_kwnl_wx[0])]);
+ while (wxT('\0') != *pmod) {
+ if (wxT('\\') == *pmod) { *pmod = wxT('/'); }
+ pmod++;
+ }
+
+#line 593 "Dk4WxFrame.cpt"
+
+
+#line 594 "Dk4WxFrame.cpt"
+ if (::wxLaunchDefaultBrowser(bw)) {
+ done = true;
+
+#line 596 "Dk4WxFrame.cpt"
+ back = true;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 600 "Dk4WxFrame.cpt"
+ }
+#endif
+ }
+ }
+ else {
+
+#line 605 "Dk4WxFrame.cpt"
+ /* ##### ERROR: BUG */
+ }
+ }
+ else {
+
+#line 609 "Dk4WxFrame.cpt"
+ /* ##### ERROR: BUG */
+ }
+ }
+ }
+ if (!(done)) {
+
+#line 614 "Dk4WxFrame.cpt"
+#if wxCHECK_VERSION(3,0,0)
+ if (::wxLaunchDefaultApplication(bw)) {
+
+#line 616 "Dk4WxFrame.cpt"
+ done = true;
+ back = true;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 621 "Dk4WxFrame.cpt"
+ }
+#endif
+#endif
+ }
+ if (!(done)) {
+ /* ERROR: Failed to start application */
+ if (bVerbose) {
+ wxString t;
+ t.Append(pAppHelp->GetBasicString(12));
+ t.Append(bw);
+ t.Append(pAppHelp->GetBasicString(13));
+ ::wxMessageBox(
+ t, pAppHelp->GetBasicString(11), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ }
+ else {
+
+#line 639 "Dk4WxFrame.cpt"
+ /* ERROR: Recoding failed */
+ if (bVerbose) {
+ ::wxMessageBox(
+ pAppHelp->GetBasicString(10), pAppHelp->GetBasicString(9),
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ }
+ else {
+
+#line 649 "Dk4WxFrame.cpt"
+ /* ERROR: File not found */
+ if (bVerbose) {
+ ::wxMessageBox(
+ pAppHelp->GetBasicString(10), pAppHelp->GetBasicString(9),
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 660 "Dk4WxFrame.cpt"
+ }
+#endif
+
+
+#line 663 "Dk4WxFrame.cpt"
+ return back;
+}
+
+
+
diff --git a/support/dktools/Dk4WxFrame.cpt b/support/dktools/Dk4WxFrame.cpt
index ad5ed4e6d8..32daba6bf9 100644
--- a/support/dktools/Dk4WxFrame.cpt
+++ b/support/dktools/Dk4WxFrame.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,11 +11,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -33,11 +41,19 @@ license = bsd
#endif
#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
#endif
#ifndef DK4WXHELPCONTROLLER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxHelpController.h"
+#else
+#include <dktools-4/Dk4WxHelpController.h>
+#endif
#endif
@@ -121,6 +137,20 @@ class Dk4WxFrame : public wxFrame
void
DisplaySection(int number);
+ /** Find data file and launch default application
+ or web browser on it.
+ @param fn File name to search for and use.
+ @param bIsHelp Flag: File is a help file.
+ @param bVerbose Flag: Show diagnostics on errors.
+ @return Success indicator.
+ */
+ bool
+ FindFileAndLaunch(
+ dkChar const *fn,
+ bool bIsHelp = false,
+ bool bVerbose = false
+ );
+
protected:
/** Save current window position.
@@ -135,8 +165,37 @@ class Dk4WxFrame : public wxFrame
%% module
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4WXFRAME_H_INCLUDED
#include "Dk4WxFrame.h"
+#endif
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#include "dk4strx.h"
+#endif
+
+#ifndef DK4RECWX_H_INCLUDED
+#include "dk4recwx.h"
+#endif
$!trace-include
@@ -183,6 +242,30 @@ $!end
+/** File name suffixes indicating to open file in web browser.
+*/
+static const wxChar * const dk4wxframe_suffix_web[] = {
+$!string-table macro=wxT
+.html
+.htm
+$!end
+};
+
+
+
+/** Static text fragments, not localized.
+*/
+static const wxChar * const dk4wxframe_kwnl_wx[] = {
+$!string-table macro=wxT
+#
+# 0 URL suffix for local files.
+#
+file://
+$!end
+};
+
+
+
Dk4WxFrame::Dk4WxFrame(
const wxString & appName,
Dk4WxApplicationHelper *appHelper,
@@ -238,7 +321,7 @@ Dk4WxFrame::OnClose(wxCloseEvent & event)
bool
-Dk4WxFrame::CanClose(bool isFinal)
+Dk4WxFrame::CanClose(bool WXUNUSED(isFinal))
{
return true;
}
@@ -248,6 +331,7 @@ void
Dk4WxFrame::SavePosition(void)
{
int iv[6];
+ $? "+ Dk4WxFrame::SavePosition"
if (NULL != pAppHelp) {
iv[4] = iv[5] = 0;
if (IsIconized()) {
@@ -267,6 +351,7 @@ Dk4WxFrame::SavePosition(void)
$? ". h = %d", iv[3]
pAppHelp->SetMultiple(dk4wxframe_kw_size, iv, 6);
}
+ $? "- Dk4WxFrame::SavePosition"
}
@@ -275,7 +360,7 @@ void
Dk4WxFrame::RestorePosition(void)
{
int iv[6]; /* Values stored in config */
- bool bv[3]; /* Feature restore */
+ bool bv[3]; /* Feature restore: maximized, iconized, position */
int x; /* X position */
int y; /* Y position */
int w; /* Width */
@@ -283,11 +368,9 @@ Dk4WxFrame::RestorePosition(void)
$? "+ Dk4WxFrame::RestorePosition"
-#if wxCHECK_VERSION(3,0,0)
- bv[2] = false;
-#else
+ /* Restore position by default.
+ */
bv[2] = true;
-#endif
/* Initialize variables.
*/
@@ -299,7 +382,16 @@ Dk4WxFrame::RestorePosition(void)
*/
if (NULL != pAppHelp) {
pAppHelp->GetMultiple(dk4wxframe_kw_size, iv, 6);
+ $? ". iv[0] = %d", iv[0]
+ $? ". iv[1] = %d", iv[1]
+ $? ". iv[2] = %d", iv[2]
+ $? ". iv[3] = %d", iv[3]
+ $? ". iv[4] = %d", iv[4]
+ $? ". iv[5] = %d", iv[5]
pAppHelp->GetMultiple(dk4wxframe_kw_restore, bv, 3);
+ $? ". bv[0] = %d", (bv[0] ? 1 : 0)
+ $? ". bv[1] = %d", (bv[1] ? 1 : 0)
+ $? ". bv[2] = %d", (bv[2] ? 1 : 0)
}
/* Find size if not stored.
@@ -307,34 +399,73 @@ Dk4WxFrame::RestorePosition(void)
GetSize(&w, &h);
x = iv[0];
y = iv[1];
+ $? ". x = %d", x
+ $? ". y = %d", y
+ $? ". w = %d", w
+ $? ". h = %d", h
/* Correct size if size restoration wanted, increase if necessary.
*/
if (bv[2]) { $? ". bv[2]"
- if (iv[2] > w) { w = iv[2]; }
- if (iv[3] > h) { h = iv[3]; }
+ if (iv[2] > w) {
+ w = iv[2]; $? ". w = %d", w
+ }
+ if (iv[3] > h) {
+ h = iv[3]; $? ". h = %d", h
+ }
}
/* Correct values, no parts of window should be outside screen.
*/
Dk4WxApplicationHelper::CorrectPosition(x, y, w, h);
+ $? ". x = %d", x
+ $? ". y = %d", y
+ $? ". w = %d", w
+ $? ". h = %d", h
/* Set position and optionally size.
*/
- if (bv[2]) { $? ". bv[2]"
+ if (bv[2]) { $? ". bv[2] active -> restore position and size"
SetSize(x, y, w, h);
- } else {
+#if wxCHECK_VERSION(3,0,0)
+ {
+ int t1 = 0;
+ int t2 = 0;
+ GetSize(&t1, &t2);
+ if ((t1 > w) || (t2 > h)) { $? ". correction required"
+ if (t1 > w) {
+ w = w - (t1 - w); $? ". width correction required"
+ }
+ if (t2 > h) {
+ h = h - (t2 - h); $? ". height correction required"
+ } $? ". doing correction"
+ SetSize(x, y, w, h);
+ GetSize(&t1, &t2);
+ $? ". width now %d", t1
+ $? ". height now %d", t2
+ }
+ }
+#endif
+ } else { $? ". bv[2] not active -> restore position only"
SetPosition( wxPoint(x,y) );
}
/* Restore maximized or iconized state if required.
*/
- if (bv[0]) { $? ". bv[0]"
+ if (bv[0]) { $? ". bv[0] active -> maximize window"
Maximize(0 != iv[4]);
}
- if (bv[1]) { $? ". bv[1]"
+#if TRACE_DEBUG
+ else { $? ". bv[0] not active"
+ }
+#endif
+ if (bv[1]) { $? ". bv[1] active -> iconize"
Iconize(0 != iv[5]);
}
+#if TRACE_DEBUG
+ else { $? ". bv[1] not active"
+ }
+#endif
$? "- Dk4WxFrame::RestorePosition"
}
@@ -370,3 +501,167 @@ Dk4WxFrame::DisplaySection(int number)
}
+
+bool
+Dk4WxFrame::FindFileAndLaunch(dkChar const *fn, bool bIsHelp, bool bVerbose)
+{
+ wxChar bw[2 * DK4_MAX_PATH]; /* Full path in wxChar */
+ wxChar b2[2 * DK4_MAX_PATH];
+ dkChar b1[DK4_MAX_PATH]; /* Search result (full path) */
+ wxChar const *psuffix; /* File name suffix */
+ wxChar *pmod;
+ size_t szb1 = DK4_SIZEOF(b1,dkChar); /* Size of b1 (num of dkChar) */
+ size_t szb2 = DK4_SIZEOF(b2,wxChar); /* Size of b2 (num of wxChar) */
+ size_t szbw = DK4_SIZEOF(bw,wxChar); /* Size of bw (num of wxChar) */
+ int res; /* Operation result */
+ int de; /* Destination encoding */
+ int se; /* Source encoding */
+ bool isweb; /* Use web browser */
+ bool done; /* Successfully done */
+ bool back; /* Result */
+ $? "+ FindFileAndLaunch \"%!ds\"", fn
+ back = false;
+ if ((NULL != fn) && (NULL != pAppHelp)) {
+ done = false;
+ /*
+ Check for absolute path.
+ Use absolute path unchanged.
+ For a relative path do file search.
+ */
+ if (0 != dk4path_is_absolute(fn)) { $? ". absolute path"
+ if (0 != dk4str_cpy_s(b1, szb1, fn, NULL)) { $? ". found"
+ done = true;
+ }
+#if TRACE_DEBUG
+ else { $? "! buffer too small"
+ }
+#endif
+ }
+ else { $? ". relative path"
+ if (bIsHelp) {
+ if (pAppHelp->FindHelpFile(b1, szb1, fn)) { $? ". found"
+ done = true; $? ". file name \"%!ds\"", b1
+ }
+#if TRACE_DEBUG
+ else { $? "! not found"
+ }
+#endif
+ }
+ else {
+ if (pAppHelp->FindDataFile(b1, szb1, fn)) { $? ". found"
+ done = true; $? ". file name \"%!ds\"", b1
+ }
+#if TRACE_DEBUG
+ else { $? "! not found"
+ }
+#endif
+ }
+ }
+ if (done) {
+ done = false;
+ de = pAppHelp->GetWxEncoding();
+ se = pAppHelp->GetDkEncoding();
+ res = dk4recwx_dkchar_to_wxchar(bw, szbw, de, b1, se, NULL);
+ if (0 != res) { $? ". recoding ok"
+ isweb = false; $? ". file name \"%!ws\"", bw
+ psuffix = dk4strx_get_path_suffix(bw, NULL);
+ if (NULL != psuffix) { $? ". suffix found"
+ if (0 <= dk4strx_array_index(dk4wxframe_suffix_web, psuffix, 0)) {
+ isweb = true; $? ". is web"
+ }
+ }
+ if (isweb) { $? ". is web"
+ if (::wxLaunchDefaultBrowser(bw)) {
+ done = true; $? ". launched (1)"
+ back = true;
+ }
+ else { $? "! not launched (1)"
+ if (0 != dk4strx_cpy_s(b2, szb2, dk4wxframe_kwnl_wx[0], NULL)) {
+ $? ". url prefix"
+ if (0 != dk4strx_cat_s(b2, szb2, bw, NULL)) { $? ". url constr"
+ $? ". file name \"%!ws\"", b2
+ if (::wxLaunchDefaultBrowser(bw)) { $? ". launched (2)"
+ done = true;
+ back = true;
+ }
+ else { $? "! not launched (2)"
+ pmod = &(b2[dk4strx_len(dk4wxframe_kwnl_wx[0])]);
+ while (wxT('\0') != *pmod) {
+ if (wxT('\\') == *pmod) { *pmod = wxT('/'); }
+ pmod++;
+ } $? ". url corrected \"%!ws\"", b2
+ $? ". file name \"%!ws\"", b2
+ if (::wxLaunchDefaultBrowser(bw)) {
+ done = true; $? ". launched (3)"
+ back = true;
+ }
+#if TRACE_DEBUG
+ else { $? "! no launched (3)"
+ }
+#endif
+ }
+ }
+ else { $? "! url construction"
+ /* ##### ERROR: BUG */
+ }
+ }
+ else { $? "! url prefix"
+ /* ##### ERROR: BUG */
+ }
+ }
+ }
+ if (!(done)) { $? ". try application"
+#if wxCHECK_VERSION(3,0,0)
+ if (::wxLaunchDefaultApplication(bw)) { $? ". launched (4)"
+ done = true;
+ back = true;
+ }
+#if TRACE_DEBUG
+ else { $? "! not launched (4)"
+ }
+#endif
+#endif
+ }
+ if (!(done)) {
+ /* ERROR: Failed to start application */
+ if (bVerbose) {
+ wxString t;
+ t.Append(pAppHelp->GetBasicString(12));
+ t.Append(bw);
+ t.Append(pAppHelp->GetBasicString(13));
+ ::wxMessageBox(
+ t, pAppHelp->GetBasicString(11), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ }
+ else { $? "! recoding"
+ /* ERROR: Recoding failed */
+ if (bVerbose) {
+ ::wxMessageBox(
+ pAppHelp->GetBasicString(10), pAppHelp->GetBasicString(9),
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ }
+ else { $? "! not found"
+ /* ERROR: File not found */
+ if (bVerbose) {
+ ::wxMessageBox(
+ pAppHelp->GetBasicString(10), pAppHelp->GetBasicString(9),
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! args"
+ }
+#endif
+ $? "- FindFileAndLaunch"
+ return back;
+}
+
+
+
diff --git a/support/dktools/Dk4WxFrame.h b/support/dktools/Dk4WxFrame.h
index fd23b89d09..1c68b6f882 100644
--- a/support/dktools/Dk4WxFrame.h
+++ b/support/dktools/Dk4WxFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxFrame.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxFrame.cpt
*/
#ifndef DK4WXFRAME_H_INCLUDED
@@ -44,11 +22,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -66,11 +52,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
#endif
#ifndef DK4WXHELPCONTROLLER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxHelpController.h"
+#else
+#include <dktools-4/Dk4WxHelpController.h>
+#endif
#endif
@@ -154,6 +148,20 @@ class Dk4WxFrame : public wxFrame
void
DisplaySection(int number);
+ /** Find data file and launch default application
+ or web browser on it.
+ @param fn File name to search for and use.
+ @param bIsHelp Flag: File is a help file.
+ @param bVerbose Flag: Show diagnostics on errors.
+ @return Success indicator.
+ */
+ bool
+ FindFileAndLaunch(
+ dkChar const *fn,
+ bool bIsHelp = false,
+ bool bVerbose = false
+ );
+
protected:
/** Save current window position.
diff --git a/support/dktools/Dk4WxHelpController.cpp b/support/dktools/Dk4WxHelpController.cpp
index c30bb46d3b..6de68ee44d 100644
--- a/support/dktools/Dk4WxHelpController.cpp
+++ b/support/dktools/Dk4WxHelpController.cpp
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxHelpController.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxHelpController.cpt
*/
/** @file Dk4WxHelpController.cpp The Dk4WxHelpController module.
*/
-#line 158 "Dk4WxHelpController.cpt"
+#line 170 "Dk4WxHelpController.cpt"
+#include "dk4conf.h"
#include "dk4strd.h"
#include "dk4strx.h"
#include "dk4fs.h"
@@ -50,10 +29,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 169 "Dk4WxHelpController.cpt"
+#line 182 "Dk4WxHelpController.cpt"
+/** Constant text fragments used by module.
+*/
static const wxChar * const dk4wxhc_kw_def[] = {
/* 0 */
wxT("Help file not found"),
@@ -64,11 +45,24 @@ wxT("The file containing online help text was not found on your computer!"),
NULL
-#line 177 "Dk4WxHelpController.cpt"
+#line 192 "Dk4WxHelpController.cpt"
};
+/** Pointer type, defined to calculate dk4wxhc_kw_def array size.
+*/
+typedef const wxChar *PTR_CWXC;
+
+
+
+/** Number of array elements in dk4wxhc_kw_def.
+*/
+static const size_t sz_dk4wxhc_kw_def =
+sizeof(dk4wxhc_kw_def) / sizeof(PTR_CWXC);
+
+
+
Dk4WxHelpController::Dk4WxHelpController()
#ifdef __WXMSW__
@@ -97,8 +91,16 @@ Dk4WxHelpController::~Dk4WxHelpController()
bool
Dk4WxHelpController::Initialize(
Dk4WxApplicationHelper *ahptr,
+#ifdef __WXMSW__
const dkChar *chmName,
+#else
+ const dkChar * WXUNUSED(chmName),
+#endif
+#ifdef __WXMSW__
+ const dkChar * WXUNUSED(htbName)
+#else
const dkChar *htbName
+#endif
)
{
const dkChar *fn = NULL;
@@ -151,7 +153,7 @@ Dk4WxHelpController::AttemptToLoadFile(void)
if (!bLoaded) {
bLoaded = true;
if ((NULL != pAppHelp) && (NULL != pdksShortFileName)) {
- if (pAppHelp->FindDataFile(fnb, szfnb, pdksShortFileName)) {
+ if (pAppHelp->FindHelpFile(fnb, szfnb, pdksShortFileName)) {
bFileFound = true;
#ifdef __WXMSW__
oHelpController.Initialize(fnb);
@@ -178,10 +180,14 @@ Dk4WxHelpController::ShowErrorMessage(size_t i_title, size_t i_text)
}
}
if (NULL == strTitle) {
- strTitle = dk4wxhc_kw_def[i_title];
+ if (i_title < sz_dk4wxhc_kw_def) {
+ strTitle = dk4wxhc_kw_def[i_title];
+ }
}
if (NULL == strText) {
- strText = dk4wxhc_kw_def[i_text];
+ if (i_text < sz_dk4wxhc_kw_def) {
+ strText = dk4wxhc_kw_def[i_text];
+ }
}
wxMessageBox(strText, strTitle, (wxOK | wxCENTRE | wxICON_ERROR));
}
diff --git a/support/dktools/Dk4WxHelpController.cpt b/support/dktools/Dk4WxHelpController.cpt
index 431202061f..9bddc56c0b 100644
--- a/support/dktools/Dk4WxHelpController.cpt
+++ b/support/dktools/Dk4WxHelpController.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,11 +11,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -54,7 +62,11 @@ license = bsd
#endif
#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
#endif
@@ -156,6 +168,7 @@ class Dk4WxHelpController
%% module
+#include "dk4conf.h"
#include "dk4strd.h"
#include "dk4strx.h"
#include "dk4fs.h"
@@ -169,6 +182,8 @@ $!trace-include
+/** Constant text fragments used by module.
+*/
static const wxChar * const dk4wxhc_kw_def[] = {
$!string-table macro=wxT
Help file not found
@@ -178,6 +193,19 @@ $!end
+/** Pointer type, defined to calculate dk4wxhc_kw_def array size.
+*/
+typedef const wxChar *PTR_CWXC;
+
+
+
+/** Number of array elements in dk4wxhc_kw_def.
+*/
+static const size_t sz_dk4wxhc_kw_def =
+sizeof(dk4wxhc_kw_def) / sizeof(PTR_CWXC);
+
+
+
Dk4WxHelpController::Dk4WxHelpController()
#ifdef __WXMSW__
@@ -206,8 +234,16 @@ Dk4WxHelpController::~Dk4WxHelpController()
bool
Dk4WxHelpController::Initialize(
Dk4WxApplicationHelper *ahptr,
+#ifdef __WXMSW__
const dkChar *chmName,
+#else
+ const dkChar * WXUNUSED(chmName),
+#endif
+#ifdef __WXMSW__
+ const dkChar * WXUNUSED(htbName)
+#else
const dkChar *htbName
+#endif
)
{
const dkChar *fn = NULL;
@@ -260,7 +296,7 @@ Dk4WxHelpController::AttemptToLoadFile(void)
if (!bLoaded) {
bLoaded = true;
if ((NULL != pAppHelp) && (NULL != pdksShortFileName)) {
- if (pAppHelp->FindDataFile(fnb, szfnb, pdksShortFileName)) {
+ if (pAppHelp->FindHelpFile(fnb, szfnb, pdksShortFileName)) {
bFileFound = true;
#ifdef __WXMSW__
oHelpController.Initialize(fnb);
@@ -287,10 +323,14 @@ Dk4WxHelpController::ShowErrorMessage(size_t i_title, size_t i_text)
}
}
if (NULL == strTitle) {
- strTitle = dk4wxhc_kw_def[i_title];
+ if (i_title < sz_dk4wxhc_kw_def) {
+ strTitle = dk4wxhc_kw_def[i_title];
+ }
}
if (NULL == strText) {
- strText = dk4wxhc_kw_def[i_text];
+ if (i_text < sz_dk4wxhc_kw_def) {
+ strText = dk4wxhc_kw_def[i_text];
+ }
}
wxMessageBox(strText, strTitle, (wxOK | wxCENTRE | wxICON_ERROR));
}
diff --git a/support/dktools/Dk4WxHelpController.h b/support/dktools/Dk4WxHelpController.h
index 8a6615aaa8..cf7c86c74b 100644
--- a/support/dktools/Dk4WxHelpController.h
+++ b/support/dktools/Dk4WxHelpController.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: Dk4WxHelpController.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxHelpController.cpt
*/
#ifndef DK4WXHELPCONTROLLER_H_INCLUDED
@@ -44,11 +22,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -87,7 +73,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
#endif
diff --git a/support/dktools/Dk4WxProcessingController.cpp b/support/dktools/Dk4WxProcessingController.cpp
new file mode 100644
index 0000000000..09e9738f5f
--- /dev/null
+++ b/support/dktools/Dk4WxProcessingController.cpp
@@ -0,0 +1,69 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxProcessingController.cpt
+*/
+
+/** @file Dk4WxProcessingController.cpp The Dk4WxProcessingController module.
+*/
+
+
+#line 95 "Dk4WxProcessingController.cpt"
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4WXCRITICALSECTION_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxProcessingController.h"
+#else
+#include <dktools-4/Dk4WxProcessingController.h>
+#endif
+#endif
+
+
+Dk4WxProcessingController::Dk4WxProcessingController(void)
+{
+ bInUse = false;
+}
+
+
+
+bool
+Dk4WxProcessingController::CanEnterCriticalSection(void)
+{
+ bool back = false;
+
+ {
+ wxCriticalSectionLocker lock(csProtect);
+
+ if (!(bInUse)) {
+ bInUse = true;
+ back = true;
+ }
+ }
+ return back;
+}
+
+
+void
+Dk4WxProcessingController::LeaveCriticalSection(void)
+{
+ wxCriticalSectionLocker lock(csProtect);
+ bInUse = false;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/Dk4WxProcessingController.cpt b/support/dktools/Dk4WxProcessingController.cpt
new file mode 100644
index 0000000000..9e03ed13c5
--- /dev/null
+++ b/support/dktools/Dk4WxProcessingController.cpt
@@ -0,0 +1,145 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file Dk4WxProcessingController.h Processing controller to skip
+ concurrent execution of code accessing the same variables.
+
+ @code
+ class AnyClass {
+ protected:
+ Dk4WxProcessingController procon;
+ ...
+ };
+
+ AnyClass::SomeMethod(void)
+ {
+ if (procon.CanEnterCriticalSection()) {
+ ... Yes, we are allowed to execute code accessing variable ...
+ ...
+ ... Notify the controller that we are done ...
+ procon.LeaveCriticalSection();
+ }
+ else {
+ ... No, we are not allowed to access the variables ...
+ }
+ }
+ @endcode
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include <dk4conf.h>
+#endif
+
+#include <wx/wxprec.h>
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#include <wx/wx.h>
+#endif
+
+#ifndef WX_THREAD_H_INCLUDED
+#include <wx/thread.h>
+#define WX_THREAD_H_INCLUDED 1
+#endif
+
+
+
+/** Protect code from concurrent execution, mainly for timer handlers.
+ In contrast to a critical section which delays execution of
+ code to avoid concurrent access to data this class skips
+ the execution of concurrent code.
+*/
+class Dk4WxProcessingController
+{
+ protected:
+
+ /** Critical section to protect the "in use" flag.
+ */
+ wxCriticalSection csProtect;
+
+ /** Flag to mark section as currently in use.
+ */
+ bool bInUse;
+
+ public:
+
+ /** Constructor
+ */
+ Dk4WxProcessingController(void);
+
+ /** Check whether the critical code section can be entered.
+ @return True if the section can be entered, false otherwise.
+ If the method returns true, the bInUse flag is set, you must
+ call LeaveCriticalSection() to reset it.
+ */
+ bool
+ CanEnterCriticalSection(void);
+
+ /** LeaveCriticalSection the critical section.
+ */
+ void
+ LeaveCriticalSection(void);
+
+};
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4WXCRITICALSECTION_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxProcessingController.h"
+#else
+#include <dktools-4/Dk4WxProcessingController.h>
+#endif
+#endif
+
+
+Dk4WxProcessingController::Dk4WxProcessingController(void)
+{
+ bInUse = false;
+}
+
+
+
+bool
+Dk4WxProcessingController::CanEnterCriticalSection(void)
+{
+ bool back = false;
+
+ {
+ wxCriticalSectionLocker lock(csProtect);
+
+ if (!(bInUse)) {
+ bInUse = true;
+ back = true;
+ }
+ }
+ return back;
+}
+
+
+void
+Dk4WxProcessingController::LeaveCriticalSection(void)
+{
+ wxCriticalSectionLocker lock(csProtect);
+ bInUse = false;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/Dk4WxProcessingController.h b/support/dktools/Dk4WxProcessingController.h
new file mode 100644
index 0000000000..0be738f135
--- /dev/null
+++ b/support/dktools/Dk4WxProcessingController.h
@@ -0,0 +1,107 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxProcessingController.cpt
+*/
+
+#ifndef DK4WXPROCESSINGCONTROLLER_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4WXPROCESSINGCONTROLLER_H_INCLUDED 1
+
+
+#line 8 "Dk4WxProcessingController.cpt"
+
+/** @file Dk4WxProcessingController.h Processing controller to skip
+ concurrent execution of code accessing the same variables.
+
+ @code
+ class AnyClass {
+ protected:
+ Dk4WxProcessingController procon;
+ ...
+ };
+
+ AnyClass::SomeMethod(void)
+ {
+ if (procon.CanEnterCriticalSection()) {
+ ... Yes, we are allowed to execute code accessing variable ...
+ ...
+ ... Notify the controller that we are done ...
+ procon.LeaveCriticalSection();
+ }
+ else {
+ ... No, we are not allowed to access the variables ...
+ }
+ }
+ @endcode
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include <dk4conf.h>
+#endif
+
+#include <wx/wxprec.h>
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#include <wx/wx.h>
+#endif
+
+#ifndef WX_THREAD_H_INCLUDED
+#include <wx/thread.h>
+#define WX_THREAD_H_INCLUDED 1
+#endif
+
+
+
+/** Protect code from concurrent execution, mainly for timer handlers.
+ In contrast to a critical section which delays execution of
+ code to avoid concurrent access to data this class skips
+ the execution of concurrent code.
+*/
+class Dk4WxProcessingController
+{
+ protected:
+
+ /** Critical section to protect the "in use" flag.
+ */
+ wxCriticalSection csProtect;
+
+ /** Flag to mark section as currently in use.
+ */
+ bool bInUse;
+
+ public:
+
+ /** Constructor
+ */
+ Dk4WxProcessingController(void);
+
+ /** Check whether the critical code section can be entered.
+ @return True if the section can be entered, false otherwise.
+ If the method returns true, the bInUse flag is set, you must
+ call LeaveCriticalSection() to reset it.
+ */
+ bool
+ CanEnterCriticalSection(void);
+
+ /** LeaveCriticalSection the critical section.
+ */
+ void
+ LeaveCriticalSection(void);
+
+};
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/Dk4WxProgressControllerBase.h b/support/dktools/Dk4WxProgressControllerBase.h
index f73165ff42..39ef984553 100644
--- a/support/dktools/Dk4WxProgressControllerBase.h
+++ b/support/dktools/Dk4WxProgressControllerBase.h
@@ -1,8 +1,21 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file Dk4WxProgressControllerBase.h Progress controller base class.
*/
#ifndef DK4WXPROGRESSCONTROLLERBASE_H_INCLUDED
#define DK4WXPROGRESSCONTROLLERBASE_H_INCLUDED 1
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
/** Base class for progress controllers interface to worker thread.
*/
class Dk4WxProgressControllerWorkerBase
diff --git a/support/dktools/Dk4WxProgressDialog.cpp b/support/dktools/Dk4WxProgressDialog.cpp
index a4a1b85cc0..3a2546c262 100644
--- a/support/dktools/Dk4WxProgressDialog.cpp
+++ b/support/dktools/Dk4WxProgressDialog.cpp
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: Dk4WxProgressDialog.wxc
@@ -9,22 +15,31 @@
*/
-#line 249 "Dk4WxProgressDialog.wxc"
+#line 271 "Dk4WxProgressDialog.wxc"
+#include "dk4conf.h"
#include "Dk4WxProgressDialog.h"
-#line 255 "Dk4WxProgressDialog.wxc"
+#line 278 "Dk4WxProgressDialog.wxc"
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxProgressDialog,wxDialog)
+#else
BEGIN_EVENT_TABLE(Dk4WxProgressDialog,wxDialog)
+#endif
EVT_IDLE( Dk4WxProgressDialog::OnIdle)
EVT_BUTTON(wxID_CANCEL, Dk4WxProgressDialog::OnCancel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
static const wxChar * dk4wx_progress_kw_wx[] = {
@@ -43,7 +58,7 @@ wxT("Abortion scheduled, please wait."),
NULL
-#line 274 "Dk4WxProgressDialog.wxc"
+#line 305 "Dk4WxProgressDialog.wxc"
};
@@ -57,12 +72,12 @@ wxT("progress.min-width"),
NULL
-#line 284 "Dk4WxProgressDialog.wxc"
+#line 315 "Dk4WxProgressDialog.wxc"
};
-#line 288 "Dk4WxProgressDialog.wxc"
+#line 319 "Dk4WxProgressDialog.wxc"
Dk4WxProgressDialog::Dk4WxProgressDialog(
wxFrame *parent,
Dk4WxApplicationHelper *pAppHelp
@@ -204,7 +219,7 @@ Dk4WxProgressDialog::Dk4WxProgressDialog(
sDialog->SetSizeHints(this);
}
-#line 334 "Dk4WxProgressDialog.wxc"
+#line 365 "Dk4WxProgressDialog.wxc"
if (dkctGUILayoutOK) {
wxSize gaugeSize = gaugeProgress->GetMinSize();
if (300 > gaugeSize.GetWidth()) {
@@ -217,7 +232,7 @@ Dk4WxProgressDialog::Dk4WxProgressDialog(
}
-#line 346 "Dk4WxProgressDialog.wxc"
+#line 377 "Dk4WxProgressDialog.wxc"
diff --git a/support/dktools/Dk4WxProgressDialog.h b/support/dktools/Dk4WxProgressDialog.h
index 8906e768ab..263f338df2 100644
--- a/support/dktools/Dk4WxProgressDialog.h
+++ b/support/dktools/Dk4WxProgressDialog.h
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: Dk4WxProgressDialog.wxc
@@ -10,17 +16,25 @@
#define DK4WXPROGRESSDIALOG_H_INCLUDED 1
-#line 54 "Dk4WxProgressDialog.wxc"
+#line 56 "Dk4WxProgressDialog.wxc"
/** @file Dk4WxProgressDialog.h Progress dialog.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -38,16 +52,24 @@
#endif
#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
#endif
#ifndef DK4WXPROGRESSCONTROLLERBASE_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxProgressControllerBase.h"
+#else
+#include <dktools-4/Dk4WxProgressControllerBase.h>
+#endif
#endif
-#line 90 "Dk4WxProgressDialog.wxc"
+#line 108 "Dk4WxProgressDialog.wxc"
/** Progress dialog (progress bar and cancel button).
*/
@@ -60,7 +82,11 @@ class Dk4WxProgressDialog :
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -131,7 +157,7 @@ class Dk4WxProgressDialog :
@param event Event to process.
*/
void
- OnCancel(wxCommandEvent & WXUNUSED(event));
+ OnCancel(wxCommandEvent & event);
/** Set new gauge value, called from worker thread.
*/
@@ -206,40 +232,40 @@ class Dk4WxProgressDialog :
/** GUI element sDialog.
*/
-#line 9 "Dk4WxProgressDialog.wxc"
+#line 11 "Dk4WxProgressDialog.wxc"
wxBoxSizer *sDialog;
/** GUI element verticalSizer.
*/
-#line 17 "Dk4WxProgressDialog.wxc"
+#line 19 "Dk4WxProgressDialog.wxc"
wxBoxSizer *verticalSizer;
/** GUI element sttInProgress.
*/
-#line 37 "Dk4WxProgressDialog.wxc"
+#line 39 "Dk4WxProgressDialog.wxc"
wxStaticText *sttInProgress;
/** GUI element gaugeProgress.
*/
-#line 31 "Dk4WxProgressDialog.wxc"
+#line 33 "Dk4WxProgressDialog.wxc"
wxGauge *gaugeProgress;
/** GUI element sttWait.
*/
-#line 41 "Dk4WxProgressDialog.wxc"
+#line 43 "Dk4WxProgressDialog.wxc"
wxStaticText *sttWait;
/** GUI element bCancel.
*/
-#line 47 "Dk4WxProgressDialog.wxc"
+#line 49 "Dk4WxProgressDialog.wxc"
wxButton *bCancel;
-#line 243 "Dk4WxProgressDialog.wxc"
+#line 265 "Dk4WxProgressDialog.wxc"
};
-#line 246 "Dk4WxProgressDialog.wxc"
+#line 268 "Dk4WxProgressDialog.wxc"
diff --git a/support/dktools/Dk4WxProgressDialog.wxc b/support/dktools/Dk4WxProgressDialog.wxc
index 0e4173d14e..a3bdaf2c97 100644
--- a/support/dktools/Dk4WxProgressDialog.wxc
+++ b/support/dktools/Dk4WxProgressDialog.wxc
@@ -1,5 +1,7 @@
%% options
-
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% wx-gui
@@ -56,11 +58,19 @@ id = wxID_CANCEL
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -78,11 +88,19 @@ id = wxID_CANCEL
#endif
#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
#endif
#ifndef DK4WXPROGRESSCONTROLLERBASE_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "Dk4WxProgressControllerBase.h"
+#else
+#include <dktools-4/Dk4WxProgressControllerBase.h>
+#endif
#endif
@@ -99,7 +117,11 @@ class Dk4WxProgressDialog :
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -170,7 +192,7 @@ class Dk4WxProgressDialog :
@param event Event to process.
*/
void
- OnCancel(wxCommandEvent & WXUNUSED(event));
+ OnCancel(wxCommandEvent & event);
/** Set new gauge value, called from worker thread.
*/
@@ -247,6 +269,7 @@ class Dk4WxProgressDialog :
%% module start
+#include "dk4conf.h"
#include "Dk4WxProgressDialog.h"
@@ -255,10 +278,18 @@ $!trace-include
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxProgressDialog,wxDialog)
+#else
BEGIN_EVENT_TABLE(Dk4WxProgressDialog,wxDialog)
+#endif
EVT_IDLE( Dk4WxProgressDialog::OnIdle)
EVT_BUTTON(wxID_CANCEL, Dk4WxProgressDialog::OnCancel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
static const wxChar * dk4wx_progress_kw_wx[] = {
diff --git a/support/dktools/Dk4WxYesNoDialog.cpp b/support/dktools/Dk4WxYesNoDialog.cpp
new file mode 100644
index 0000000000..93b1f09651
--- /dev/null
+++ b/support/dktools/Dk4WxYesNoDialog.cpp
@@ -0,0 +1,207 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxYesNoDialog.wxc
+*/
+
+/** @file Dk4WxYesNoDialog.cpp The Dk4WxYesNoDialog module.
+*/
+
+
+#line 148 "Dk4WxYesNoDialog.wxc"
+
+#include "dk4conf.h"
+#include "Dk4WxYesNoDialog.h"
+
+#include "gui-img/shared/dlg/question.xpm"
+
+
+
+#line 155 "Dk4WxYesNoDialog.wxc"
+
+/** Event table for wxWidgets.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxYesNoDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(Dk4WxYesNoDialog,wxDialog)
+#endif
+ EVT_BUTTON(wxID_YES, Dk4WxYesNoDialog::OnYes)
+ EVT_BUTTON(wxID_NO, Dk4WxYesNoDialog::OnNo)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+#line 172 "Dk4WxYesNoDialog.wxc"
+
+Dk4WxYesNoDialog::Dk4WxYesNoDialog(
+ wxFrame *parent,
+ Dk4WxApplicationHelper *pAppHelp,
+ wxChar const *tMessage,
+ wxChar const *tTitle
+) : wxDialog(
+ parent, wxID_ANY, tTitle,
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+) , bm_question((const char * const *)xpm_question)
+{
+
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerContents = NULL;
+ sizerButtons = NULL;
+ bitmapIcon = NULL;
+ lText = NULL;
+ bYes = NULL;
+ bNo = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerContents = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ bitmapIcon = new wxStaticBitmap(
+ this,
+ wxID_ANY,
+ bm_question
+ );
+ if(!(bitmapIcon)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ bitmapIcon,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerContents->Add(10, 10, 0);
+ lText = new wxStaticText(
+ this,
+ wxID_ANY,
+ tMessage
+ );
+ if(!(lText)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lText,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerContents,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ bYes = new wxButton(
+ this,
+ wxID_YES,
+ pAppHelp->GetBasicString(14)
+ );
+ if(!(bYes)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->AddButton(
+ bYes
+ );
+ bNo = new wxButton(
+ this,
+ wxID_NO,
+ pAppHelp->GetBasicString(15)
+ );
+ if(!(bNo)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->AddButton(
+ bNo
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_RIGHT
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 191 "Dk4WxYesNoDialog.wxc"
+}
+
+
+
+#line 195 "Dk4WxYesNoDialog.wxc"
+
+void
+Dk4WxYesNoDialog::OnYes(wxCommandEvent & event)
+{
+ if(IsModal()) {
+ EndModal(wxID_YES);
+ }
+ else {
+ SetReturnCode(wxID_YES);
+ Show(false);
+ }
+}
+
+
+
+void
+Dk4WxYesNoDialog::OnNo(wxCommandEvent & event)
+{
+ if(IsModal()) {
+ EndModal(wxID_NO);
+ }
+ else {
+ SetReturnCode(wxID_NO);
+ Show(false);
+ }
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/Dk4WxYesNoDialog.h b/support/dktools/Dk4WxYesNoDialog.h
new file mode 100644
index 0000000000..40bc472cf4
--- /dev/null
+++ b/support/dktools/Dk4WxYesNoDialog.h
@@ -0,0 +1,165 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: Dk4WxYesNoDialog.wxc
+*/
+
+#ifndef DK4WXYESNODIALOG_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4WXYESNODIALOG_H_INCLUDED 1
+
+
+#line 50 "Dk4WxYesNoDialog.wxc"
+
+/** @file Dk4WxYesNoDialog.h Message box dialog for yes/no decisions.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
+#endif
+
+
+#line 93 "Dk4WxYesNoDialog.wxc"
+
+/** Message box dialog for simples yes or no decisions.
+*/
+class Dk4WxYesNoDialog : public wxDialog
+{
+
+ private:
+
+ /** Event table.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Bitmap containing the question mark.
+ */
+ wxBitmap bm_question;
+
+ public:
+
+ /** Constructor.
+ @param parent Parent frame.
+ @param pAppHelp Application helper for localized texts.
+ @param tMessage Message to show.
+ @param tTitle Dialog box title.
+ */
+ Dk4WxYesNoDialog(
+ wxFrame *parent,
+ Dk4WxApplicationHelper *pAppHelp,
+ wxChar const *tMessage,
+ wxChar const *tTitle
+ );
+
+ /** Event handler for Yes button.
+ @param event Event to process (ignored).
+ */
+ void
+ OnYes(wxCommandEvent & event);
+
+ /** Event handler for No button.
+ @param event Event to process (ignored).
+ */
+ void
+ OnNo(wxCommandEvent & event);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 11 "Dk4WxYesNoDialog.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 17 "Dk4WxYesNoDialog.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerContents.
+ */
+#line 25 "Dk4WxYesNoDialog.wxc"
+ wxBoxSizer *sizerContents;
+
+ /** GUI element sizerButtons.
+ */
+#line 37 "Dk4WxYesNoDialog.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element bitmapIcon.
+ */
+#line 31 "Dk4WxYesNoDialog.wxc"
+ wxStaticBitmap *bitmapIcon;
+
+ /** GUI element lText.
+ */
+#line 34 "Dk4WxYesNoDialog.wxc"
+ wxStaticText *lText;
+
+ /** GUI element bYes.
+ */
+#line 41 "Dk4WxYesNoDialog.wxc"
+ wxButton *bYes;
+
+ /** GUI element bNo.
+ */
+#line 45 "Dk4WxYesNoDialog.wxc"
+ wxButton *bNo;
+
+
+#line 143 "Dk4WxYesNoDialog.wxc"
+};
+
+
+#line 146 "Dk4WxYesNoDialog.wxc"
+
+
+#endif
diff --git a/support/dktools/Dk4WxYesNoDialog.wxc b/support/dktools/Dk4WxYesNoDialog.wxc
new file mode 100644
index 0000000000..bb7ab43de5
--- /dev/null
+++ b/support/dktools/Dk4WxYesNoDialog.wxc
@@ -0,0 +1,224 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2020-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerContents centered-x
+contents = $space(10)
+contents = sizerButtons right
+contents = $space(10)
+
+[wxBoxSizer sizerContents]
+direction = horizontal
+contents = bitmapIcon centered-y
+contents = $space(10)
+contents = lText centered-y
+
+[wxStaticBitmap bitmapIcon]
+bitmap = bm_question
+
+[wxStaticText lText]
+text = tMessage
+
+[wxStdDialogButtonSizer sizerButtons]
+contents = bYes
+contents = bNo
+
+[wxButton bYes]
+id = wxID_YES
+text = pAppHelp->GetBasicString(14)
+
+[wxButton bNo]
+id = wxID_NO
+text = pAppHelp->GetBasicString(15)
+
+%% header start
+
+/** @file Dk4WxYesNoDialog.h Message box dialog for yes/no decisions.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4WXAPPLICATIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "Dk4WxApplicationHelper.h"
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
+#endif
+
+%% class start
+
+/** Message box dialog for simples yes or no decisions.
+*/
+class Dk4WxYesNoDialog : public wxDialog
+{
+
+ private:
+
+ /** Event table.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Bitmap containing the question mark.
+ */
+ wxBitmap bm_question;
+
+ public:
+
+ /** Constructor.
+ @param parent Parent frame.
+ @param pAppHelp Application helper for localized texts.
+ @param tMessage Message to show.
+ @param tTitle Dialog box title.
+ */
+ Dk4WxYesNoDialog(
+ wxFrame *parent,
+ Dk4WxApplicationHelper *pAppHelp,
+ wxChar const *tMessage,
+ wxChar const *tTitle
+ );
+
+ /** Event handler for Yes button.
+ @param event Event to process (ignored).
+ */
+ void
+ OnYes(wxCommandEvent & event);
+
+ /** Event handler for No button.
+ @param event Event to process (ignored).
+ */
+ void
+ OnNo(wxCommandEvent & event);
+
+%% class end
+};
+
+%% header end
+
+%% module start
+
+#include "dk4conf.h"
+#include "Dk4WxYesNoDialog.h"
+
+#include "gui-img/shared/dlg/question.xpm"
+
+$!trace-include
+
+/** Event table for wxWidgets.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(Dk4WxYesNoDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(Dk4WxYesNoDialog,wxDialog)
+#endif
+ EVT_BUTTON(wxID_YES, Dk4WxYesNoDialog::OnYes)
+ EVT_BUTTON(wxID_NO, Dk4WxYesNoDialog::OnNo)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+%% constructor start
+
+Dk4WxYesNoDialog::Dk4WxYesNoDialog(
+ wxFrame *parent,
+ Dk4WxApplicationHelper *pAppHelp,
+ wxChar const *tMessage,
+ wxChar const *tTitle
+) : wxDialog(
+ parent, wxID_ANY, tTitle,
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+) , bm_question((const char * const *)xpm_question)
+{
+
+%% constructor end
+}
+
+
+%% module end
+
+void
+Dk4WxYesNoDialog::OnYes(wxCommandEvent & event)
+{
+ if(IsModal()) {
+ EndModal(wxID_YES);
+ }
+ else {
+ SetReturnCode(wxID_YES);
+ Show(false);
+ }
+}
+
+
+
+void
+Dk4WxYesNoDialog::OnNo(wxCommandEvent & event)
+{
+ if(IsModal()) {
+ EndModal(wxID_NO);
+ }
+ else {
+ SetReturnCode(wxID_NO);
+ Show(false);
+ }
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/DkClockApp.cpp b/support/dktools/DkClockApp.cpp
index da18278fea..faadccc335 100644
--- a/support/dktools/DkClockApp.cpp
+++ b/support/dktools/DkClockApp.cpp
@@ -1,50 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockApp.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockApp.cpt
*/
/** @file DkClockApp.cpp The DkClockApp module.
*/
-#line 59 "DkClockApp.cpt"
+#line 64 "DkClockApp.cpt"
+#include "dk3conf.h"
#include "wxdkclock.h"
-#line 64 "DkClockApp.cpt"
+#line 70 "DkClockApp.cpt"
@@ -159,7 +138,7 @@ wxT("Clock colour in alert state"),
NULL
-#line 188 "DkClockApp.cpt"
+#line 194 "DkClockApp.cpt"
};
@@ -198,7 +177,7 @@ wxT("\n"),
wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."),
/* 10 */
-wxT("http://dktools.sourceforge.net"),
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
/* 11 */
wxT("http://www.wxwidgets.org"),
@@ -224,7 +203,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 248 "DkClockApp.cpt"
+#line 254 "DkClockApp.cpt"
};
@@ -241,14 +220,19 @@ dkT("wxdkclock.str"),
NULL
-#line 265 "DkClockApp.cpt"
+#line 271 "DkClockApp.cpt"
};
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkClockApp);
+#else
IMPLEMENT_APP(DkClockApp)
+#endif
bool
@@ -259,7 +243,7 @@ DkClockApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchiveFs = NULL;
bool back = false;
#if USE_WXAPP_ONINIT
@@ -267,10 +251,10 @@ DkClockApp::OnInit()
#endif
-#line 289 "DkClockApp.cpt"
+#line 300 "DkClockApp.cpt"
-#line 290 "DkClockApp.cpt"
+#line 301 "DkClockApp.cpt"
/* Initialize members. */
pHelper = NULL;
helpController = NULL;
@@ -292,6 +276,14 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -299,6 +291,14 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -306,14 +306,29 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchiveFs = new wxArchiveFSHandler();
+ if (NULL != phArchiveFs) {
+ wxFileSystem::AddHandler(phArchiveFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
localizedTexts = pHelper->getStringTable(
wxdkclock_texts, wxdkclock_nl_dk[1]
);
@@ -339,8 +354,8 @@ DkClockApp::OnInit()
wxdkclock_nl_dk
);
if(!(frame)) { ShowMemoryErrorMessage(); goto finished; }
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed. */
@@ -356,7 +371,7 @@ DkClockApp::OnInit()
}
}
-#line 374 "DkClockApp.cpt"
+#line 416 "DkClockApp.cpt"
#if USE_WXAPP_ONINIT
}
#endif
@@ -371,7 +386,7 @@ DkClockApp::OnExit()
int back = 0;
-#line 387 "DkClockApp.cpt"
+#line 429 "DkClockApp.cpt"
/* Release resources. */
if(helpController) {
delete(helpController);
@@ -383,10 +398,10 @@ DkClockApp::OnExit()
}
-#line 397 "DkClockApp.cpt"
+#line 439 "DkClockApp.cpt"
-#line 398 "DkClockApp.cpt"
+#line 440 "DkClockApp.cpt"
return back;
}
diff --git a/support/dktools/DkClockApp.cpt b/support/dktools/DkClockApp.cpt
index 307d8e776e..7051c5cfb0 100644
--- a/support/dktools/DkClockApp.cpt
+++ b/support/dktools/DkClockApp.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -51,12 +51,18 @@ class DkClockApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkClockApp);
+#else
DECLARE_APP(DkClockApp)
+#endif
%% module
+#include "dk3conf.h"
#include "wxdkclock.h"
@@ -233,7 +239,7 @@ wxdkclock.htb
# 9 10 11 12 13 14 15: List of libraries used.
#
DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
http://www.wxwidgets.org
http://www.libpng.org/pub/png/libpng.html
http://www.ijg.org
@@ -268,7 +274,12 @@ $!end
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkClockApp);
+#else
IMPLEMENT_APP(DkClockApp)
+#endif
bool
@@ -279,7 +290,7 @@ DkClockApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchiveFs = NULL;
bool back = false;
#if USE_WXAPP_ONINIT
@@ -308,6 +319,14 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -315,6 +334,14 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -322,14 +349,29 @@ DkClockApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchiveFs = new wxArchiveFSHandler();
+ if (NULL != phArchiveFs) {
+ wxFileSystem::AddHandler(phArchiveFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
localizedTexts = pHelper->getStringTable(
wxdkclock_texts, wxdkclock_nl_dk[1]
);
@@ -355,8 +397,8 @@ DkClockApp::OnInit()
wxdkclock_nl_dk
);
if(!(frame)) { ShowMemoryErrorMessage(); goto finished; }
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed. */
diff --git a/support/dktools/DkClockApp.h b/support/dktools/DkClockApp.h
index 58b794419d..733b2919bd 100644
--- a/support/dktools/DkClockApp.h
+++ b/support/dktools/DkClockApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockApp.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockApp.cpt
*/
/** @file DkClockApp.h Header file for the DkClockApp module.
@@ -86,7 +64,12 @@ class DkClockApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkClockApp);
+#else
DECLARE_APP(DkClockApp)
+#endif
diff --git a/support/dktools/DkClockData.cpp b/support/dktools/DkClockData.cpp
index e9c407dd42..53d10c12d3 100644
--- a/support/dktools/DkClockData.cpp
+++ b/support/dktools/DkClockData.cpp
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: DkClockData.cpt
@@ -9,21 +15,22 @@
*/
-#line 85 "DkClockData.cpt"
+#line 88 "DkClockData.cpt"
+#include "dk3conf.h"
#include "wxdkclock.h"
-#line 90 "DkClockData.cpt"
+#line 94 "DkClockData.cpt"
DkClockData::DkClockData()
{
-#line 95 "DkClockData.cpt"
+#line 99 "DkClockData.cpt"
clvd.h = 0;
clvd.m = 0;
clvd.s = 0;
@@ -40,7 +47,7 @@ DkClockData::DkClockData()
tmCurrent.s = 0;
-#line 110 "DkClockData.cpt"
+#line 114 "DkClockData.cpt"
}
@@ -50,14 +57,14 @@ DkClockData::getData(clockview_data_t *dptr)
{
-#line 118 "DkClockData.cpt"
+#line 122 "DkClockData.cpt"
if(dptr) {
wxMutexLocker lock(mxProtectData);
dk3mem_cpy((void *)dptr, (void *)(&clvd), sizeof(clockview_data_t));
}
-#line 123 "DkClockData.cpt"
+#line 127 "DkClockData.cpt"
}
@@ -69,7 +76,7 @@ DkClockData::setTime(dk3_time_t *ct)
int back = 0;
-#line 133 "DkClockData.cpt"
+#line 137 "DkClockData.cpt"
if(dk3sf_localtime_app(&lct, ct, NULL)) {
wxMutexLocker lock(mxProtectData);
/*
@@ -115,7 +122,7 @@ DkClockData::setTime(dk3_time_t *ct)
clvd.a = ((1 == iAlertState) ? 1 : 0);
}
-#line 177 "DkClockData.cpt"
+#line 181 "DkClockData.cpt"
return back;
}
@@ -126,17 +133,17 @@ DkClockData::setAlert(bool flag, int hour, int min)
{
-#line 186 "DkClockData.cpt"
+#line 190 "DkClockData.cpt"
iAlertState = 0;
{
wxMutexLocker lock(mxProtectData);
if(flag) {
-#line 190 "DkClockData.cpt"
+#line 194 "DkClockData.cpt"
if((0 <= hour) && (23 >= hour) && (0 <= min) && (59 >= min)) {
iAlertEnabled = 1;
-#line 192 "DkClockData.cpt"
+#line 196 "DkClockData.cpt"
iAlertHour = hour;
iAlertMinute = min;
if(tmCurrent.h > hour) {
@@ -150,21 +157,21 @@ DkClockData::setAlert(bool flag, int hour, int min)
}
} else {
-#line 204 "DkClockData.cpt"
+#line 208 "DkClockData.cpt"
iAlertEnabled = 0;
iAlertHour = 0;
iAlertMinute = 0;
}
} else {
-#line 209 "DkClockData.cpt"
+#line 213 "DkClockData.cpt"
iAlertEnabled = 0;
iAlertHour = 0;
iAlertMinute = 0;
}
}
-#line 214 "DkClockData.cpt"
+#line 218 "DkClockData.cpt"
}
@@ -174,7 +181,7 @@ DkClockData::endAlert(void)
{
-#line 222 "DkClockData.cpt"
+#line 226 "DkClockData.cpt"
{
wxMutexLocker lock(mxProtectData);
if(1 == iAlertState) {
@@ -182,7 +189,7 @@ DkClockData::endAlert(void)
}
}
-#line 228 "DkClockData.cpt"
+#line 232 "DkClockData.cpt"
}
@@ -192,19 +199,19 @@ DkClockData::getAlertData(int *en, int *h, int *m)
{
-#line 236 "DkClockData.cpt"
+#line 240 "DkClockData.cpt"
if((en) && (h) && (m)) {
wxMutexLocker lock(mxProtectData);
*en = iAlertEnabled;
-#line 239 "DkClockData.cpt"
+#line 243 "DkClockData.cpt"
*h = iAlertHour;
-#line 240 "DkClockData.cpt"
+#line 244 "DkClockData.cpt"
*m = iAlertMinute;
-#line 241 "DkClockData.cpt"
+#line 245 "DkClockData.cpt"
}
-#line 242 "DkClockData.cpt"
+#line 246 "DkClockData.cpt"
}
diff --git a/support/dktools/DkClockData.cpt b/support/dktools/DkClockData.cpt
index 6005298186..b000956ad1 100644
--- a/support/dktools/DkClockData.cpt
+++ b/support/dktools/DkClockData.cpt
@@ -1,4 +1,7 @@
%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -83,6 +86,7 @@ class DkClockData
%% module
+#include "dk3conf.h"
#include "wxdkclock.h"
diff --git a/support/dktools/DkClockData.h b/support/dktools/DkClockData.h
index 2a8c8152fb..38bfd0b13a 100644
--- a/support/dktools/DkClockData.h
+++ b/support/dktools/DkClockData.h
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: DkClockData.cpt
@@ -13,7 +19,7 @@
#define DKCLOCKDATA_H_INCLUDED 1
-#line 4 "DkClockData.cpt"
+#line 7 "DkClockData.cpt"
/** Data of interest for the DkClockView class.
*/
diff --git a/support/dktools/DkClockFrame.cpp b/support/dktools/DkClockFrame.cpp
index 84adb6f1b1..db1b844d9d 100644
--- a/support/dktools/DkClockFrame.cpp
+++ b/support/dktools/DkClockFrame.cpp
@@ -1,61 +1,44 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockFrame.wxc
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockFrame.wxc
*/
/** @file DkClockFrame.cpp The DkClockFrame module.
*/
-#line 305 "DkClockFrame.wxc"
+#line 309 "DkClockFrame.wxc"
+#include "dk3conf.h"
#include "wxdkclock.h"
#include "dk4verswx.h"
#if !defined(__WXMSW__)
-#include "dkclock.xpm"
+#include "gui-img/icons/dkclock.xpm"
#endif
-#line 317 "DkClockFrame.wxc"
+#line 322 "DkClockFrame.wxc"
-BEGIN_EVENT_TABLE(DkClockFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkClockFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkClockFrame,wxFrame)
+#endif
EVT_MENU(DkClockFrame_Quit, DkClockFrame::OnQuit)
EVT_MENU(DkClockFrame_Help_About, DkClockFrame::OnAbout)
EVT_MENU(DkClockFrame_Help_Contents, DkClockFrame::OnHelpContents)
@@ -66,7 +49,11 @@ BEGIN_EVENT_TABLE(DkClockFrame, wxFrame)
EVT_TIMER(DkClockFrame_Timer, DkClockFrame::OnTimer)
EVT_IDLE(DkClockFrame::OnIdle)
EVT_ICONIZE(DkClockFrame::OnIconize)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -97,6 +84,11 @@ NULL
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
/** Allowed command line arguments.
*/
static const wxCmdLineEntryDesc dkclock_cmd_line_desc[] = {
@@ -109,10 +101,13 @@ static const wxCmdLineEntryDesc dkclock_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
-#line 377 "DkClockFrame.wxc"
+#line 398 "DkClockFrame.wxc"
DkClockFrame::DkClockFrame(
int wxid,
DkWxAppHelper *applicationHelper,
@@ -134,7 +129,7 @@ DkClockFrame::DkClockFrame(
int res = -1;
-#line 397 "DkClockFrame.wxc"
+#line 418 "DkClockFrame.wxc"
iconTb = NULL;
#if defined(__WXCOCOA__)
iconDock = NULL;
@@ -305,13 +300,10 @@ DkClockFrame::DkClockFrame(
mainSizer->SetSizeHints(this);
}
-#line 417 "DkClockFrame.wxc"
+#line 438 "DkClockFrame.wxc"
if(dkctGUILayoutOK) {
miOptionsHide->Enable(false);
SetTitle(nlWx[0]);
-#if 0
- restorePosition();
-#endif
dk3sf_time(&ct);
alval[0] = 0; alval[1] = 0; alval[2] = 0;
/* When running for the first time, use defaults set by the system
@@ -330,26 +322,26 @@ DkClockFrame::DkClockFrame(
szres = pHelper->retrieveMultipleInts(kwConfInt, alval);
if(3 <= szres) {
-#line 440 "DkClockFrame.wxc"
+#line 458 "DkClockFrame.wxc"
if(0 != alval[0]) {
-#line 441 "DkClockFrame.wxc"
+#line 459 "DkClockFrame.wxc"
if((0 <= alval[1]) && (23 >= alval[1])) {
-#line 442 "DkClockFrame.wxc"
+#line 460 "DkClockFrame.wxc"
if((0 <= alval[2]) && (59 >= alval[2])) {
-#line 443 "DkClockFrame.wxc"
+#line 461 "DkClockFrame.wxc"
clockData.setAlert(true, alval[1], alval[2]);
}
}
} else {
-#line 447 "DkClockFrame.wxc"
+#line 465 "DkClockFrame.wxc"
}
} else {
-#line 449 "DkClockFrame.wxc"
+#line 467 "DkClockFrame.wxc"
}
clv->setNormal(alval[3], alval[4], alval[5]);
clv->setAlert(alval[6], alval[7], alval[8]);
@@ -394,11 +386,11 @@ DkClockFrame::DkClockFrame(
}
-#line 492 "DkClockFrame.wxc"
+#line 510 "DkClockFrame.wxc"
}
-#line 495 "DkClockFrame.wxc"
+#line 513 "DkClockFrame.wxc"
@@ -406,7 +398,7 @@ DkClockFrame::~DkClockFrame()
{
-#line 501 "DkClockFrame.wxc"
+#line 519 "DkClockFrame.wxc"
if(iconTb) {
delete iconTb;
iconTb = NULL;
@@ -419,7 +411,7 @@ DkClockFrame::~DkClockFrame()
#endif
-#line 512 "DkClockFrame.wxc"
+#line 530 "DkClockFrame.wxc"
}
@@ -430,7 +422,7 @@ DkClockFrame::saveSettings(void)
int alval[9];
-#line 521 "DkClockFrame.wxc"
+#line 539 "DkClockFrame.wxc"
alval[0] = alval[1] = alval[2] = 0;
alval[3] = clv->getNormalRed();
alval[4] = clv->getNormalGreen();
@@ -442,12 +434,12 @@ DkClockFrame::saveSettings(void)
pHelper->saveMultipleInts(kwConfInt, alval);
-#line 531 "DkClockFrame.wxc"
+#line 549 "DkClockFrame.wxc"
}
bool
-DkClockFrame::canClose(bool isLast)
+DkClockFrame::canClose(bool WXUNUSED(isLast))
{
#if VERSION_BEFORE_20140410
int alval[9];
@@ -455,7 +447,7 @@ DkClockFrame::canClose(bool isLast)
bool back = true;
-#line 542 "DkClockFrame.wxc"
+#line 560 "DkClockFrame.wxc"
tiTenPerSecond.Stop();
#if VERSION_BEFORE_20140410
alval[0] = alval[1] = alval[2] = 0;
@@ -472,30 +464,30 @@ DkClockFrame::canClose(bool isLast)
#endif
-#line 557 "DkClockFrame.wxc"
+#line 575 "DkClockFrame.wxc"
return back;
}
void
-DkClockFrame::OnQuit(wxCommandEvent & event)
+DkClockFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
-#line 565 "DkClockFrame.wxc"
+#line 583 "DkClockFrame.wxc"
Close();
}
void
-DkClockFrame::OnAbout(wxCommandEvent & event)
+DkClockFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
-#line 576 "DkClockFrame.wxc"
+#line 594 "DkClockFrame.wxc"
/* Construct message text. */
text.Append(sNlWx[0]);
text.Append(sNlWx[7]);
@@ -537,31 +529,31 @@ DkClockFrame::OnAbout(wxCommandEvent & event)
wxMessageBox(text, title);
-#line 616 "DkClockFrame.wxc"
+#line 634 "DkClockFrame.wxc"
}
void
-DkClockFrame::OnHelpContents(wxCommandEvent & event)
+DkClockFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
-#line 624 "DkClockFrame.wxc"
+#line 642 "DkClockFrame.wxc"
openHelp();
-#line 626 "DkClockFrame.wxc"
+#line 644 "DkClockFrame.wxc"
}
void
-DkClockFrame::OnEditOptions(wxCommandEvent & event)
+DkClockFrame::OnEditOptions(wxCommandEvent & WXUNUSED(event))
{
-#line 634 "DkClockFrame.wxc"
+#line 652 "DkClockFrame.wxc"
DkClockOptionsDialog dlg((DkWxFrame *)this, sTexts[16], sTexts, &clockData);
pHelper->setRelatedPosition(this, &dlg, &odx, &ody);
if(wxID_OK == dlg.ShowModal()) {
@@ -570,7 +562,7 @@ DkClockFrame::OnEditOptions(wxCommandEvent & event)
dlg.GetPosition(&odx, &ody);
-#line 641 "DkClockFrame.wxc"
+#line 659 "DkClockFrame.wxc"
}
@@ -579,7 +571,7 @@ DkClockFrame::OnIdle(wxIdleEvent & event)
{
-#line 648 "DkClockFrame.wxc"
+#line 666 "DkClockFrame.wxc"
if(pcIdle.canBeginProcessing()) {
if(bIsFirstIdleEvent) {
bIsFirstIdleEvent = false;
@@ -594,33 +586,33 @@ DkClockFrame::OnIdle(wxIdleEvent & event)
event.Skip();
-#line 661 "DkClockFrame.wxc"
+#line 679 "DkClockFrame.wxc"
}
void
-DkClockFrame::OnTimer(wxTimerEvent & event)
+DkClockFrame::OnTimer(wxTimerEvent & WXUNUSED(event))
{
dk3_time_t newTime;
int res;
-#line 671 "DkClockFrame.wxc"
+#line 689 "DkClockFrame.wxc"
if(pcTimer.canBeginProcessing()) {
-#line 672 "DkClockFrame.wxc"
+#line 690 "DkClockFrame.wxc"
if(dk3sf_time(&newTime)) {
-#line 673 "DkClockFrame.wxc"
+#line 691 "DkClockFrame.wxc"
if(newTime > currentTime) {
-#line 674 "DkClockFrame.wxc"
+#line 692 "DkClockFrame.wxc"
currentTime = newTime;
res = clockData.setTime(&currentTime);
if(1 == res) {
-#line 677 "DkClockFrame.wxc"
+#line 695 "DkClockFrame.wxc"
bHaveBuffer = true;
bIsHidden = false;
Show(true);
@@ -632,22 +624,22 @@ DkClockFrame::OnTimer(wxTimerEvent & event)
clv->Update();
} else {
-#line 687 "DkClockFrame.wxc"
+#line 705 "DkClockFrame.wxc"
if((IsIconized()) || (bIsHidden)) {
-#line 688 "DkClockFrame.wxc"
+#line 706 "DkClockFrame.wxc"
if(bHaveBuffer) {
-#line 689 "DkClockFrame.wxc"
+#line 707 "DkClockFrame.wxc"
bHaveBuffer = false;
clv->releaseBuffer();
}
} else {
-#line 693 "DkClockFrame.wxc"
+#line 711 "DkClockFrame.wxc"
bHaveBuffer = true;
-#line 694 "DkClockFrame.wxc"
+#line 712 "DkClockFrame.wxc"
clv->SetMustUpdate();
clv->Refresh();
clv->Update();
@@ -658,17 +650,17 @@ DkClockFrame::OnTimer(wxTimerEvent & event)
pcTimer.endProcessing();
}
-#line 703 "DkClockFrame.wxc"
+#line 721 "DkClockFrame.wxc"
}
void
-DkClockFrame::OnHide(wxCommandEvent & event)
+DkClockFrame::OnHide(wxCommandEvent & WXUNUSED(event))
{
-#line 711 "DkClockFrame.wxc"
+#line 729 "DkClockFrame.wxc"
if(miOptionsHide->IsChecked()) {
bShouldHide = true;
bIsHidden = true;
@@ -678,13 +670,13 @@ DkClockFrame::OnHide(wxCommandEvent & event)
}
-#line 719 "DkClockFrame.wxc"
+#line 737 "DkClockFrame.wxc"
}
void
-DkClockFrame::OnColourNormal(wxCommandEvent & event)
+DkClockFrame::OnColourNormal(wxCommandEvent & WXUNUSED(event))
{
wxColourData wxcd;
wxcd.SetColour(
@@ -707,7 +699,7 @@ DkClockFrame::OnColourNormal(wxCommandEvent & event)
void
-DkClockFrame::OnColourAlert(wxCommandEvent & event)
+DkClockFrame::OnColourAlert(wxCommandEvent & WXUNUSED(event))
{
wxColourData wxcd;
wxcd.SetColour(
@@ -734,11 +726,11 @@ DkClockFrame::SetHidden(bool b)
{
-#line 773 "DkClockFrame.wxc"
+#line 791 "DkClockFrame.wxc"
bIsHidden = b;
-#line 775 "DkClockFrame.wxc"
+#line 793 "DkClockFrame.wxc"
}
diff --git a/support/dktools/DkClockFrame.h b/support/dktools/DkClockFrame.h
index 948a8a0cf0..abe6f23bb1 100644
--- a/support/dktools/DkClockFrame.h
+++ b/support/dktools/DkClockFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockFrame.wxc
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockFrame.wxc
*/
/** @file DkClockFrame.h Header file for the DkClockFrame module.
@@ -51,7 +29,11 @@ class DkClockFrame : public DkWxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -221,7 +203,7 @@ class DkClockFrame : public DkWxFrame
DkClockView *clv;
-#line 194 "DkClockFrame.wxc"
+#line 198 "DkClockFrame.wxc"
protected:
@@ -331,7 +313,7 @@ class DkClockFrame : public DkWxFrame
};
-#line 303 "DkClockFrame.wxc"
+#line 307 "DkClockFrame.wxc"
#endif
diff --git a/support/dktools/DkClockFrame.wxc b/support/dktools/DkClockFrame.wxc
index 61ef19ed9a..754ec60725 100644
--- a/support/dktools/DkClockFrame.wxc
+++ b/support/dktools/DkClockFrame.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -104,7 +104,11 @@ class DkClockFrame : public DkWxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -303,12 +307,13 @@ class DkClockFrame : public DkWxFrame
%% module start
+#include "dk3conf.h"
#include "wxdkclock.h"
#include "dk4verswx.h"
#if !defined(__WXMSW__)
-#include "dkclock.xpm"
+#include "gui-img/icons/dkclock.xpm"
#endif
@@ -317,7 +322,11 @@ $!trace-include
-BEGIN_EVENT_TABLE(DkClockFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkClockFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkClockFrame,wxFrame)
+#endif
EVT_MENU(DkClockFrame_Quit, DkClockFrame::OnQuit)
EVT_MENU(DkClockFrame_Help_About, DkClockFrame::OnAbout)
EVT_MENU(DkClockFrame_Help_Contents, DkClockFrame::OnHelpContents)
@@ -328,7 +337,11 @@ BEGIN_EVENT_TABLE(DkClockFrame, wxFrame)
EVT_TIMER(DkClockFrame_Timer, DkClockFrame::OnTimer)
EVT_IDLE(DkClockFrame::OnIdle)
EVT_ICONIZE(DkClockFrame::OnIconize)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -359,6 +372,11 @@ NULL
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
/** Allowed command line arguments.
*/
static const wxCmdLineEntryDesc dkclock_cmd_line_desc[] = {
@@ -371,6 +389,9 @@ static const wxCmdLineEntryDesc dkclock_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
%% constructor start
@@ -417,9 +438,6 @@ DkClockFrame::DkClockFrame(
if(dkctGUILayoutOK) {
miOptionsHide->Enable(false);
SetTitle(nlWx[0]);
-#if 0
- restorePosition();
-#endif
dk3sf_time(&ct);
alval[0] = 0; alval[1] = 0; alval[2] = 0;
/* When running for the first time, use defaults set by the system
@@ -532,7 +550,7 @@ DkClockFrame::saveSettings(void)
bool
-DkClockFrame::canClose(bool isLast)
+DkClockFrame::canClose(bool WXUNUSED(isLast))
{
#if VERSION_BEFORE_20140410
int alval[9];
@@ -559,7 +577,7 @@ DkClockFrame::canClose(bool isLast)
void
-DkClockFrame::OnQuit(wxCommandEvent & event)
+DkClockFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
$? "= DkClockFrame::OnQuit"
Close();
@@ -568,7 +586,7 @@ DkClockFrame::OnQuit(wxCommandEvent & event)
void
-DkClockFrame::OnAbout(wxCommandEvent & event)
+DkClockFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
@@ -618,7 +636,7 @@ DkClockFrame::OnAbout(wxCommandEvent & event)
void
-DkClockFrame::OnHelpContents(wxCommandEvent & event)
+DkClockFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
$? "+ DkClockFrame::OnHelpContents"
openHelp();
@@ -628,7 +646,7 @@ DkClockFrame::OnHelpContents(wxCommandEvent & event)
void
-DkClockFrame::OnEditOptions(wxCommandEvent & event)
+DkClockFrame::OnEditOptions(wxCommandEvent & WXUNUSED(event))
{
$? "+ DkClockFrame::OnEditOptions"
DkClockOptionsDialog dlg((DkWxFrame *)this, sTexts[16], sTexts, &clockData);
@@ -663,7 +681,7 @@ DkClockFrame::OnIdle(wxIdleEvent & event)
void
-DkClockFrame::OnTimer(wxTimerEvent & event)
+DkClockFrame::OnTimer(wxTimerEvent & WXUNUSED(event))
{
dk3_time_t newTime;
int res;
@@ -705,7 +723,7 @@ DkClockFrame::OnTimer(wxTimerEvent & event)
void
-DkClockFrame::OnHide(wxCommandEvent & event)
+DkClockFrame::OnHide(wxCommandEvent & WXUNUSED(event))
{
$? "+ DkClockFrame::OnHide"
if(miOptionsHide->IsChecked()) {
@@ -721,7 +739,7 @@ DkClockFrame::OnHide(wxCommandEvent & event)
void
-DkClockFrame::OnColourNormal(wxCommandEvent & event)
+DkClockFrame::OnColourNormal(wxCommandEvent & WXUNUSED(event))
{
wxColourData wxcd;
wxcd.SetColour(
@@ -744,7 +762,7 @@ DkClockFrame::OnColourNormal(wxCommandEvent & event)
void
-DkClockFrame::OnColourAlert(wxCommandEvent & event)
+DkClockFrame::OnColourAlert(wxCommandEvent & WXUNUSED(event))
{
wxColourData wxcd;
wxcd.SetColour(
diff --git a/support/dktools/DkClockOptionsDialog.cpp b/support/dktools/DkClockOptionsDialog.cpp
index c26ee021ea..7bb86f2600 100644
--- a/support/dktools/DkClockOptionsDialog.cpp
+++ b/support/dktools/DkClockOptionsDialog.cpp
@@ -1,62 +1,49 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockOptionsDialog.wxc
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockOptionsDialog.wxc
*/
/** @file DkClockOptionsDialog.cpp The DkClockOptionsDialog module.
*/
-#line 124 "DkClockOptionsDialog.wxc"
+#line 128 "DkClockOptionsDialog.wxc"
+#include "dk3conf.h"
#include "wxdkclock.h"
-#line 129 "DkClockOptionsDialog.wxc"
+#line 134 "DkClockOptionsDialog.wxc"
-BEGIN_EVENT_TABLE(DkClockOptionsDialog, wxDialog)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkClockOptionsDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(DkClockOptionsDialog,wxDialog)
+#endif
EVT_BUTTON(wxID_OK, DkClockOptionsDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, DkClockOptionsDialog::OnCancel)
EVT_CHECKBOX(DkClockOptions_Enable, DkClockOptionsDialog::OnCheckbox)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
-#line 140 "DkClockOptionsDialog.wxc"
+#line 153 "DkClockOptionsDialog.wxc"
DkClockOptionsDialog::DkClockOptionsDialog(
DkWxFrame *parent,
wxChar const *title,
@@ -76,7 +63,7 @@ DkClockOptionsDialog::DkClockOptionsDialog(
int m = 0;
-#line 158 "DkClockOptionsDialog.wxc"
+#line 171 "DkClockOptionsDialog.wxc"
sTexts = messageTexts;
cld = clockData;
dkctGUILayoutOK = false;
@@ -247,48 +234,48 @@ DkClockOptionsDialog::DkClockOptionsDialog(
sDialog->SetSizeHints(this);
}
-#line 161 "DkClockOptionsDialog.wxc"
+#line 174 "DkClockOptionsDialog.wxc"
if(dkctGUILayoutOK) {
-#line 162 "DkClockOptionsDialog.wxc"
+#line 175 "DkClockOptionsDialog.wxc"
cld->getAlertData(&en, &h, &m);
-#line 164 "DkClockOptionsDialog.wxc"
+#line 177 "DkClockOptionsDialog.wxc"
scHour->SetValue(h);
scMinute->SetValue(m);
if(en) {
-#line 167 "DkClockOptionsDialog.wxc"
+#line 180 "DkClockOptionsDialog.wxc"
cbAlert->SetValue(true);
scHour->Enable(true);
scMinute->Enable(true);
} else {
-#line 171 "DkClockOptionsDialog.wxc"
+#line 184 "DkClockOptionsDialog.wxc"
cbAlert->SetValue(false);
scHour->Enable(false);
scMinute->Enable(false);
}
}
-#line 176 "DkClockOptionsDialog.wxc"
+#line 189 "DkClockOptionsDialog.wxc"
}
-#line 180 "DkClockOptionsDialog.wxc"
+#line 193 "DkClockOptionsDialog.wxc"
void
-DkClockOptionsDialog::OnOk(wxCommandEvent & event)
+DkClockOptionsDialog::OnOk(wxCommandEvent & WXUNUSED(event))
{
bool en = false;
int h = 0;
int m = 0;
-#line 189 "DkClockOptionsDialog.wxc"
+#line 202 "DkClockOptionsDialog.wxc"
if(cbAlert->GetValue()) {
en = true;
h = scHour->GetValue();
@@ -303,17 +290,17 @@ DkClockOptionsDialog::OnOk(wxCommandEvent & event)
Show(false);
}
-#line 202 "DkClockOptionsDialog.wxc"
+#line 215 "DkClockOptionsDialog.wxc"
}
void
-DkClockOptionsDialog::OnCancel(wxCommandEvent & event)
+DkClockOptionsDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
{
-#line 210 "DkClockOptionsDialog.wxc"
+#line 223 "DkClockOptionsDialog.wxc"
if(IsModal()) {
EndModal(wxID_CANCEL);
} else {
@@ -321,25 +308,25 @@ DkClockOptionsDialog::OnCancel(wxCommandEvent & event)
Show(false);
}
-#line 216 "DkClockOptionsDialog.wxc"
+#line 229 "DkClockOptionsDialog.wxc"
}
void
-DkClockOptionsDialog::OnCheckbox(wxCommandEvent & event)
+DkClockOptionsDialog::OnCheckbox(wxCommandEvent & WXUNUSED(event))
{
-#line 224 "DkClockOptionsDialog.wxc"
+#line 237 "DkClockOptionsDialog.wxc"
if(cbAlert->GetValue()) {
-#line 225 "DkClockOptionsDialog.wxc"
+#line 238 "DkClockOptionsDialog.wxc"
scHour->Enable(true);
scMinute->Enable(true);
} else {
-#line 228 "DkClockOptionsDialog.wxc"
+#line 241 "DkClockOptionsDialog.wxc"
scHour->Enable(false);
scMinute->Enable(false);
}
@@ -347,7 +334,7 @@ DkClockOptionsDialog::OnCheckbox(wxCommandEvent & event)
Update();
-#line 234 "DkClockOptionsDialog.wxc"
+#line 247 "DkClockOptionsDialog.wxc"
}
diff --git a/support/dktools/DkClockOptionsDialog.h b/support/dktools/DkClockOptionsDialog.h
index 8df1dc5aba..c7cc134561 100644
--- a/support/dktools/DkClockOptionsDialog.h
+++ b/support/dktools/DkClockOptionsDialog.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockOptionsDialog.wxc
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockOptionsDialog.wxc
*/
/** @file DkClockOptionsDialog.h Header file for the DkClockOptionsDialog module.
@@ -51,7 +29,11 @@ class DkClockOptionsDialog : public wxDialog
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -123,7 +105,7 @@ class DkClockOptionsDialog : public wxDialog
wxButton *bCancel;
-#line 94 "DkClockOptionsDialog.wxc"
+#line 98 "DkClockOptionsDialog.wxc"
public:
@@ -138,13 +120,13 @@ class DkClockOptionsDialog : public wxDialog
@param event Event to process.
*/
void
- OnOk(wxCommandEvent & WXUNUSED(event));
+ OnOk(wxCommandEvent & event);
/** Handler for Cancel button.
@param event Event to process.
*/
void
- OnCancel(wxCommandEvent & WXUNUSED(event));
+ OnCancel(wxCommandEvent & event);
void
OnCheckbox(wxCommandEvent & event);
@@ -152,7 +134,7 @@ class DkClockOptionsDialog : public wxDialog
};
-#line 122 "DkClockOptionsDialog.wxc"
+#line 126 "DkClockOptionsDialog.wxc"
#endif
diff --git a/support/dktools/DkClockOptionsDialog.wxc b/support/dktools/DkClockOptionsDialog.wxc
index c27b44feab..65c8ecd87c 100644
--- a/support/dktools/DkClockOptionsDialog.wxc
+++ b/support/dktools/DkClockOptionsDialog.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% wx-gui
@@ -78,7 +78,11 @@ class DkClockOptionsDialog : public wxDialog
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -105,13 +109,13 @@ class DkClockOptionsDialog : public wxDialog
@param event Event to process.
*/
void
- OnOk(wxCommandEvent & WXUNUSED(event));
+ OnOk(wxCommandEvent & event);
/** Handler for Cancel button.
@param event Event to process.
*/
void
- OnCancel(wxCommandEvent & WXUNUSED(event));
+ OnCancel(wxCommandEvent & event);
void
OnCheckbox(wxCommandEvent & event);
@@ -122,17 +126,26 @@ class DkClockOptionsDialog : public wxDialog
%% module start
+#include "dk3conf.h"
#include "wxdkclock.h"
$!trace-include
-BEGIN_EVENT_TABLE(DkClockOptionsDialog, wxDialog)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkClockOptionsDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(DkClockOptionsDialog,wxDialog)
+#endif
EVT_BUTTON(wxID_OK, DkClockOptionsDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, DkClockOptionsDialog::OnCancel)
EVT_CHECKBOX(DkClockOptions_Enable, DkClockOptionsDialog::OnCheckbox)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -180,7 +193,7 @@ DkClockOptionsDialog::DkClockOptionsDialog(
void
-DkClockOptionsDialog::OnOk(wxCommandEvent & event)
+DkClockOptionsDialog::OnOk(wxCommandEvent & WXUNUSED(event))
{
bool en = false;
int h = 0;
@@ -204,7 +217,7 @@ DkClockOptionsDialog::OnOk(wxCommandEvent & event)
void
-DkClockOptionsDialog::OnCancel(wxCommandEvent & event)
+DkClockOptionsDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
{
$? "+ DkClockOptionsDialog::OnCancel"
if(IsModal()) {
@@ -218,7 +231,7 @@ DkClockOptionsDialog::OnCancel(wxCommandEvent & event)
void
-DkClockOptionsDialog::OnCheckbox(wxCommandEvent & event)
+DkClockOptionsDialog::OnCheckbox(wxCommandEvent & WXUNUSED(event))
{
$? "+ DkClockOptionsDialog::OnCheckbox"
if(cbAlert->GetValue()) { $? ". checkbox enabled"
diff --git a/support/dktools/DkClockTaskbarIcon.cpp b/support/dktools/DkClockTaskbarIcon.cpp
index 4f94fc00b1..aa6b12e19c 100644
--- a/support/dktools/DkClockTaskbarIcon.cpp
+++ b/support/dktools/DkClockTaskbarIcon.cpp
@@ -1,60 +1,46 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockTaskbarIcon.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockTaskbarIcon.cpt
*/
/** @file DkClockTaskbarIcon.cpp The DkClockTaskbarIcon module.
*/
-#line 65 "DkClockTaskbarIcon.cpt"
-
+#line 69 "DkClockTaskbarIcon.cpt"
+#include "dk3conf.h"
#include "wxdkclock.h"
-#line 72 "DkClockTaskbarIcon.cpt"
+#line 76 "DkClockTaskbarIcon.cpt"
-BEGIN_EVENT_TABLE(DkClockTaskbarIcon, wxTaskBarIcon)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkClockTaskbarIcon,wxTaskBarIcon)
+#else
+BEGIN_EVENT_TABLE(DkClockTaskbarIcon,wxTaskBarIcon)
+#endif
EVT_TASKBAR_LEFT_DCLICK(DkClockTaskbarIcon::OnLeftButtonDoubleClick)
EVT_MENU(DkClockTaskBar_Restore, DkClockTaskbarIcon::OnMenuRestore)
EVT_MENU(DkClockTaskBar_Exit, DkClockTaskbarIcon::OnMenuExit)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -71,61 +57,61 @@ DkClockTaskbarIcon::DkClockTaskbarIcon(
{
-#line 95 "DkClockTaskbarIcon.cpt"
+#line 107 "DkClockTaskbarIcon.cpt"
wParent = pParent;
sTexts = localizedTexts;
-#line 98 "DkClockTaskbarIcon.cpt"
+#line 110 "DkClockTaskbarIcon.cpt"
}
void
-DkClockTaskbarIcon::OnLeftButtonDoubleClick(wxTaskBarIconEvent & event)
+DkClockTaskbarIcon::OnLeftButtonDoubleClick(wxTaskBarIconEvent & WXUNUSED(event))
{
-#line 106 "DkClockTaskbarIcon.cpt"
+#line 118 "DkClockTaskbarIcon.cpt"
if(wParent) {
((DkClockFrame *)wParent)->SetHidden(false);
wParent->Iconize(false);
wParent->Show(true);
}
-#line 111 "DkClockTaskbarIcon.cpt"
+#line 123 "DkClockTaskbarIcon.cpt"
}
void
-DkClockTaskbarIcon::OnMenuRestore(wxCommandEvent & event)
+DkClockTaskbarIcon::OnMenuRestore(wxCommandEvent & WXUNUSED(event))
{
-#line 119 "DkClockTaskbarIcon.cpt"
+#line 131 "DkClockTaskbarIcon.cpt"
if(wParent) {
((DkClockFrame *)wParent)->SetHidden(false);
wParent->Iconize(false);
wParent->Show(true);
}
-#line 124 "DkClockTaskbarIcon.cpt"
+#line 136 "DkClockTaskbarIcon.cpt"
}
void
-DkClockTaskbarIcon::OnMenuExit(wxCommandEvent & event)
+DkClockTaskbarIcon::OnMenuExit(wxCommandEvent & WXUNUSED(event))
{
-#line 132 "DkClockTaskbarIcon.cpt"
+#line 144 "DkClockTaskbarIcon.cpt"
if(wParent) {
wParent->Close(true);
}
-#line 135 "DkClockTaskbarIcon.cpt"
+#line 147 "DkClockTaskbarIcon.cpt"
}
@@ -136,13 +122,13 @@ DkClockTaskbarIcon::CreatePopupMenu()
wxMenu *back = new wxMenu;
-#line 144 "DkClockTaskbarIcon.cpt"
+#line 156 "DkClockTaskbarIcon.cpt"
if(back) {
back->Append(DkClockTaskBar_Restore, sTexts[26]);
back->Append(DkClockTaskBar_Exit, sTexts[27]);
}
-#line 148 "DkClockTaskbarIcon.cpt"
+#line 160 "DkClockTaskbarIcon.cpt"
return back;
}
diff --git a/support/dktools/DkClockTaskbarIcon.cpt b/support/dktools/DkClockTaskbarIcon.cpt
index fba2474ddc..1c9a24197b 100644
--- a/support/dktools/DkClockTaskbarIcon.cpt
+++ b/support/dktools/DkClockTaskbarIcon.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -58,12 +58,16 @@ class DkClockTaskbarIcon : public wxTaskBarIcon
/** Event table for task bar icon.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
};
%% module
-
+#include "dk3conf.h"
#include "wxdkclock.h"
@@ -72,11 +76,19 @@ $!trace-include
-BEGIN_EVENT_TABLE(DkClockTaskbarIcon, wxTaskBarIcon)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkClockTaskbarIcon,wxTaskBarIcon)
+#else
+BEGIN_EVENT_TABLE(DkClockTaskbarIcon,wxTaskBarIcon)
+#endif
EVT_TASKBAR_LEFT_DCLICK(DkClockTaskbarIcon::OnLeftButtonDoubleClick)
EVT_MENU(DkClockTaskBar_Restore, DkClockTaskbarIcon::OnMenuRestore)
EVT_MENU(DkClockTaskBar_Exit, DkClockTaskbarIcon::OnMenuExit)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -100,7 +112,7 @@ DkClockTaskbarIcon::DkClockTaskbarIcon(
void
-DkClockTaskbarIcon::OnLeftButtonDoubleClick(wxTaskBarIconEvent & event)
+DkClockTaskbarIcon::OnLeftButtonDoubleClick(wxTaskBarIconEvent & WXUNUSED(event))
{
$? "+ DkClockTaskbarIcon::OnLeftButtonDoubleClick"
if(wParent) {
@@ -113,7 +125,7 @@ DkClockTaskbarIcon::OnLeftButtonDoubleClick(wxTaskBarIconEvent & event)
void
-DkClockTaskbarIcon::OnMenuRestore(wxCommandEvent & event)
+DkClockTaskbarIcon::OnMenuRestore(wxCommandEvent & WXUNUSED(event))
{
$? "+ DkClockTaskbarIcon::OnMenuRestore"
if(wParent) {
@@ -126,7 +138,7 @@ DkClockTaskbarIcon::OnMenuRestore(wxCommandEvent & event)
void
-DkClockTaskbarIcon::OnMenuExit(wxCommandEvent & event)
+DkClockTaskbarIcon::OnMenuExit(wxCommandEvent & WXUNUSED(event))
{
$? "+ DkClockTaskbarIcon::OnMenuExit"
if(wParent) {
diff --git a/support/dktools/DkClockTaskbarIcon.h b/support/dktools/DkClockTaskbarIcon.h
index 24c3bbcc8e..34f963c291 100644
--- a/support/dktools/DkClockTaskbarIcon.h
+++ b/support/dktools/DkClockTaskbarIcon.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockTaskbarIcon.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockTaskbarIcon.cpt
*/
/** @file DkClockTaskbarIcon.h Header file for the DkClockTaskbarIcon module.
@@ -93,7 +71,11 @@ class DkClockTaskbarIcon : public wxTaskBarIcon
/** Event table for task bar icon.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
};
diff --git a/support/dktools/DkClockView.cpp b/support/dktools/DkClockView.cpp
index 9c694cc37f..f973fe81a7 100644
--- a/support/dktools/DkClockView.cpp
+++ b/support/dktools/DkClockView.cpp
@@ -1,60 +1,51 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockView.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockView.cpt
*/
/** @file DkClockView.cpp The DkClockView module.
*/
-#line 161 "DkClockView.cpt"
-
+#line 169 "DkClockView.cpt"
+#include "dk3conf.h"
#include "wxdkclock.h"
-#line 167 "DkClockView.cpt"
+#line 175 "DkClockView.cpt"
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(DkClockView, DkWxBufferedControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(DkClockView, DkWxBufferedControl)
+#endif
+
/** Event handler table.
*/
-BEGIN_EVENT_TABLE(DkClockView, DkWxBufferedControl)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkClockView,DkWxBufferedControl)
+#else
+BEGIN_EVENT_TABLE(DkClockView,DkWxBufferedControl)
+#endif
EVT_LEFT_DOWN(DkClockView::OnLeftDown)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
-
+#endif
wxChar const DkClockView::windowtypename[] = { wxT("DkClockView") };
@@ -101,12 +92,12 @@ cRed(191, 0, 0)
{
-#line 221 "DkClockView.cpt"
+#line 242 "DkClockView.cpt"
bUseRed = false;
cld = clockData;
-#line 224 "DkClockView.cpt"
+#line 245 "DkClockView.cpt"
}
@@ -135,7 +126,8 @@ DkClockView::Create(
void
DkClockView::PaintOperation(
- wxDC & pdc, wxPaintEvent & event, bool buffered, int clWidth, int clHeight
+ wxDC & pdc, wxPaintEvent & WXUNUSED(event),
+ bool WXUNUSED(buffered), int clWidth, int clHeight
)
{
clockview_data_t clvdata; /* Clock data. */
@@ -158,7 +150,7 @@ DkClockView::PaintOperation(
int y; /* Current y. */
-#line 274 "DkClockView.cpt"
+#line 296 "DkClockView.cpt"
pdc.SetBackground(*wxWHITE_BRUSH);
pdc.Clear();
cld->getData(&clvdata);
@@ -271,17 +263,17 @@ DkClockView::PaintOperation(
pdc.SetPen(wxNullPen);
-#line 385 "DkClockView.cpt"
+#line 407 "DkClockView.cpt"
}
void
-DkClockView::OnLeftDown(wxMouseEvent & event)
+DkClockView::OnLeftDown(wxMouseEvent & WXUNUSED(event))
{
-#line 393 "DkClockView.cpt"
+#line 415 "DkClockView.cpt"
if(cld) {
cld->endAlert();
SetMustUpdate();
@@ -289,7 +281,7 @@ DkClockView::OnLeftDown(wxMouseEvent & event)
Update();
}
-#line 399 "DkClockView.cpt"
+#line 421 "DkClockView.cpt"
}
diff --git a/support/dktools/DkClockView.cpt b/support/dktools/DkClockView.cpt
index 8513233719..329c64a253 100644
--- a/support/dktools/DkClockView.cpt
+++ b/support/dktools/DkClockView.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,11 +12,19 @@ class DkClockView : public DkWxBufferedControl
{
private:
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(DkClockView);
+#else
DECLARE_DYNAMIC_CLASS(DkClockView)
+#endif
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -159,20 +167,33 @@ class DkClockView : public DkWxBufferedControl
%% module
-
+#include "dk3conf.h"
#include "wxdkclock.h"
$!trace-include
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(DkClockView, DkWxBufferedControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(DkClockView, DkWxBufferedControl)
+#endif
+
/** Event handler table.
*/
-BEGIN_EVENT_TABLE(DkClockView, DkWxBufferedControl)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkClockView,DkWxBufferedControl)
+#else
+BEGIN_EVENT_TABLE(DkClockView,DkWxBufferedControl)
+#endif
EVT_LEFT_DOWN(DkClockView::OnLeftDown)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
-
+#endif
wxChar const DkClockView::windowtypename[] = { wxT("DkClockView") };
@@ -249,7 +270,8 @@ DkClockView::Create(
void
DkClockView::PaintOperation(
- wxDC & pdc, wxPaintEvent & event, bool buffered, int clWidth, int clHeight
+ wxDC & pdc, wxPaintEvent & WXUNUSED(event),
+ bool WXUNUSED(buffered), int clWidth, int clHeight
)
{
clockview_data_t clvdata; /* Clock data. */
@@ -387,7 +409,7 @@ DkClockView::PaintOperation(
void
-DkClockView::OnLeftDown(wxMouseEvent & event)
+DkClockView::OnLeftDown(wxMouseEvent & WXUNUSED(event))
{
$? "+ DkClockView::OnLeftDown"
if(cld) {
diff --git a/support/dktools/DkClockView.h b/support/dktools/DkClockView.h
index 4f503e0ca0..68c2c789e6 100644
--- a/support/dktools/DkClockView.h
+++ b/support/dktools/DkClockView.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkClockView.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkClockView.cpt
*/
/** @file DkClockView.h Header file for the DkClockView module.
@@ -47,11 +25,19 @@ class DkClockView : public DkWxBufferedControl
{
private:
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(DkClockView);
+#else
DECLARE_DYNAMIC_CLASS(DkClockView)
+#endif
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
diff --git a/support/dktools/DkWxAppHelper.cpp b/support/dktools/DkWxAppHelper.cpp
index 46e65d4b04..a3d694fc6b 100644
--- a/support/dktools/DkWxAppHelper.cpp
+++ b/support/dktools/DkWxAppHelper.cpp
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxAppHelper.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxAppHelper.cpt
*/
/** @file DkWxAppHelper.cpp The DkWxAppHelper module.
*/
-#line 334 "DkWxAppHelper.cpt"
+#line 345 "DkWxAppHelper.cpt"
#include <dk3all.h>
@@ -50,7 +28,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 345 "DkWxAppHelper.cpt"
+#line 356 "DkWxAppHelper.cpt"
@@ -69,21 +47,6 @@ typedef struct {
typedef wxChar const *wxConstPtr;
-
-/** Error codes.
-*/
-enum {
- /** No error occured.
- */
- ERROR_NONE = 0,
-
- /** Failed to encode arg0 to dkChar.
- */
- ERROR_ENCODE_ARG0 ,
-};
-
-
-
/** Basic texts issued by wxWidgets applications.
*/
static wxChar const * const dkwxapphelper_defwxappstr[] = {
@@ -129,7 +92,7 @@ wxT("Failed to recode command line!"),
NULL
-#line 435 "DkWxAppHelper.cpt"
+#line 431 "DkWxAppHelper.cpt"
};
@@ -196,17 +159,17 @@ dkwxah_string_table_close(DkAppHelperWxStringTable *p)
size_t i;
-#line 500 "DkWxAppHelper.cpt"
+#line 496 "DkWxAppHelper.cpt"
if(p) {
if(p->array) {
if(p->nelem) {
-#line 503 "DkWxAppHelper.cpt"
+#line 499 "DkWxAppHelper.cpt"
ptr = p->array;
for(i = 0; i < p->nelem; i++) {
if(*ptr) {
-#line 506 "DkWxAppHelper.cpt"
+#line 502 "DkWxAppHelper.cpt"
}
dk3_release(*ptr);
ptr++;
@@ -218,7 +181,7 @@ dkwxah_string_table_close(DkAppHelperWxStringTable *p)
dk3_delete(p);
}
-#line 516 "DkWxAppHelper.cpt"
+#line 512 "DkWxAppHelper.cpt"
}
@@ -259,7 +222,7 @@ DkWxAppHelper::DkWxAppHelper(
wxChar const * const *ptrGetNumBasicStrings;
-#line 555 "DkWxAppHelper.cpt"
+#line 551 "DkWxAppHelper.cpt"
newargv[0] = NULL;
app = NULL;
sStringTables = NULL;
@@ -371,7 +334,7 @@ DkWxAppHelper::DkWxAppHelper(
reportProblemsIfAny();
-#line 665 "DkWxAppHelper.cpt"
+#line 661 "DkWxAppHelper.cpt"
}
@@ -380,7 +343,7 @@ DkWxAppHelper::~DkWxAppHelper()
{
-#line 672 "DkWxAppHelper.cpt"
+#line 668 "DkWxAppHelper.cpt"
DkAppHelperWxStringTable *e;
basicStrings = NULL;
if(sStringTables) {
@@ -404,7 +367,7 @@ DkWxAppHelper::~DkWxAppHelper()
dk3_release(vendorName);
-#line 694 "DkWxAppHelper.cpt"
+#line 690 "DkWxAppHelper.cpt"
}
@@ -415,52 +378,52 @@ DkWxAppHelper::checkSetup() const
int back = 0;
-#line 703 "DkWxAppHelper.cpt"
+#line 699 "DkWxAppHelper.cpt"
if(app) {
-#line 704 "DkWxAppHelper.cpt"
+#line 700 "DkWxAppHelper.cpt"
if(sStringTables) {
-#line 705 "DkWxAppHelper.cpt"
+#line 701 "DkWxAppHelper.cpt"
if(iStringTables) {
-#line 706 "DkWxAppHelper.cpt"
+#line 702 "DkWxAppHelper.cpt"
if(cmdName) {
-#line 707 "DkWxAppHelper.cpt"
+#line 703 "DkWxAppHelper.cpt"
if(appName) {
-#line 708 "DkWxAppHelper.cpt"
+#line 704 "DkWxAppHelper.cpt"
if(vendorName) {
-#line 709 "DkWxAppHelper.cpt"
+#line 705 "DkWxAppHelper.cpt"
back = 1;
} else {
-#line 711 "DkWxAppHelper.cpt"
+#line 707 "DkWxAppHelper.cpt"
}
} else {
-#line 713 "DkWxAppHelper.cpt"
+#line 709 "DkWxAppHelper.cpt"
}
} else {
-#line 715 "DkWxAppHelper.cpt"
+#line 711 "DkWxAppHelper.cpt"
}
} else {
-#line 717 "DkWxAppHelper.cpt"
+#line 713 "DkWxAppHelper.cpt"
}
} else {
-#line 719 "DkWxAppHelper.cpt"
+#line 715 "DkWxAppHelper.cpt"
}
} else {
-#line 721 "DkWxAppHelper.cpt"
+#line 717 "DkWxAppHelper.cpt"
}
-#line 722 "DkWxAppHelper.cpt"
+#line 718 "DkWxAppHelper.cpt"
return back;
}
@@ -493,52 +456,52 @@ DkWxAppHelper::getStringTable(
-#line 753 "DkWxAppHelper.cpt"
+#line 749 "DkWxAppHelper.cpt"
if((dt) && (tn)) {
-#line 754 "DkWxAppHelper.cpt"
+#line 750 "DkWxAppHelper.cpt"
if(checkSetup()) {
-#line 755 "DkWxAppHelper.cpt"
+#line 751 "DkWxAppHelper.cpt"
tp = (DkAppHelperWxStringTable *)dk3sto_it_find_like(
iStringTables, (void *)tn, 1
);
if(!(tp)) {
-#line 759 "DkWxAppHelper.cpt"
+#line 755 "DkWxAppHelper.cpt"
if(dk3app_find_data_file(app, tn, fnb, DK3_SIZEOF(fnb,dkChar))) {
-#line 760 "DkWxAppHelper.cpt"
+#line 756 "DkWxAppHelper.cpt"
fipo = dk3sf_fopen_app(fnb, dk3app_not_localized(22), app);
if(fipo) {
-#line 762 "DkWxAppHelper.cpt"
+#line 758 "DkWxAppHelper.cpt"
wxptr = (wxChar const **)dt; nelem = 0;
while(*(wxptr++)) { nelem++; }
if(nelem) {
-#line 765 "DkWxAppHelper.cpt"
+#line 761 "DkWxAppHelper.cpt"
tp = dk3_new_app(DkAppHelperWxStringTable,1,app);
if(tp) {
-#line 767 "DkWxAppHelper.cpt"
+#line 763 "DkWxAppHelper.cpt"
ok = 0;
tp->array = NULL;
tp->nelem = nelem;
tp->name = dk3str_dup_app(tn, app);
if(tp->name) {
-#line 772 "DkWxAppHelper.cpt"
+#line 768 "DkWxAppHelper.cpt"
tp->array = dk3_new_app(wxConstPtr,nelem,app);
if(tp->array) {
-#line 774 "DkWxAppHelper.cpt"
+#line 770 "DkWxAppHelper.cpt"
wxptr = tp->array;
tp->nelem = nelem;
for(i = 0; i < nelem; i++) { *(wxptr++) = NULL; }
if(dk3sto_add(sStringTables, (void *)tp)) {
-#line 778 "DkWxAppHelper.cpt"
+#line 774 "DkWxAppHelper.cpt"
ok = 1;
oldsource = dk3app_get_source_file(app);
oldline = dk3app_get_source_line(app);
@@ -548,23 +511,23 @@ DkWxAppHelper::getStringTable(
wxptr = tp->array; nelem = 0;
do {
-#line 786 "DkWxAppHelper.cpt"
+#line 782 "DkWxAppHelper.cpt"
cc = 0;
if(fgets(il, sizeof(il), fipo)) {
-#line 788 "DkWxAppHelper.cpt"
+#line 784 "DkWxAppHelper.cpt"
dk3app_set_source_line(app, ++lineno);
cc = 1;
if(il[0] != '#') {
-#line 791 "DkWxAppHelper.cpt"
+#line 787 "DkWxAppHelper.cpt"
dk3app_squeeze_line(il);
if(dk3wxs_from_utf8(wxb,DK3_SIZEOF(wxb,wxChar),il))
{
*wxptr = dk3wxs_dup_app(wxb, app);
if(!(*wxptr)) {
-#line 796 "DkWxAppHelper.cpt"
+#line 792 "DkWxAppHelper.cpt"
ok = 0;
}
wxptr++;
@@ -573,16 +536,16 @@ DkWxAppHelper::getStringTable(
{
ok = 0;
-#line 803 "DkWxAppHelper.cpt"
+#line 799 "DkWxAppHelper.cpt"
}
} else {
-#line 805 "DkWxAppHelper.cpt"
+#line 801 "DkWxAppHelper.cpt"
}
if(nelem >= tp->nelem) { cc = 0; }
} else {
-#line 808 "DkWxAppHelper.cpt"
+#line 804 "DkWxAppHelper.cpt"
}
} while((cc) && (ok));
if(nelem < tp->nelem) {
@@ -592,15 +555,15 @@ DkWxAppHelper::getStringTable(
dk3app_set_source_line(app, oldline);
} else {
-#line 816 "DkWxAppHelper.cpt"
+#line 812 "DkWxAppHelper.cpt"
}
} else {
-#line 818 "DkWxAppHelper.cpt"
+#line 814 "DkWxAppHelper.cpt"
}
} else {
-#line 820 "DkWxAppHelper.cpt"
+#line 816 "DkWxAppHelper.cpt"
}
if(ok) {
back = (wxChar const * const *)(tp->array);
@@ -609,43 +572,43 @@ DkWxAppHelper::getStringTable(
}
} else {
-#line 827 "DkWxAppHelper.cpt"
+#line 823 "DkWxAppHelper.cpt"
}
} else {
-#line 829 "DkWxAppHelper.cpt"
+#line 825 "DkWxAppHelper.cpt"
}
fclose(fipo);
} else {
-#line 832 "DkWxAppHelper.cpt"
+#line 828 "DkWxAppHelper.cpt"
}
} else {
-#line 834 "DkWxAppHelper.cpt"
+#line 830 "DkWxAppHelper.cpt"
}
} else {
-#line 836 "DkWxAppHelper.cpt"
+#line 832 "DkWxAppHelper.cpt"
}
if(tp) {
-#line 838 "DkWxAppHelper.cpt"
+#line 834 "DkWxAppHelper.cpt"
back = (wxChar const * const *)(tp->array);
}
} else {
-#line 841 "DkWxAppHelper.cpt"
+#line 837 "DkWxAppHelper.cpt"
}
} else {
-#line 843 "DkWxAppHelper.cpt"
+#line 839 "DkWxAppHelper.cpt"
}
if(!(back)) {
back = dt;
}
-#line 847 "DkWxAppHelper.cpt"
+#line 843 "DkWxAppHelper.cpt"
#else
dkChar fnb[DK3_MAX_PATH]; /* Full file name. */
char il[4096]; /* Input line */
@@ -664,30 +627,30 @@ DkWxAppHelper::getStringTable(
int ok; /* Flag: All strings read succes. */
-#line 864 "DkWxAppHelper.cpt"
+#line 860 "DkWxAppHelper.cpt"
if((dt) && (tn)) {
-#line 865 "DkWxAppHelper.cpt"
+#line 861 "DkWxAppHelper.cpt"
if(checkSetup()) {
-#line 866 "DkWxAppHelper.cpt"
+#line 862 "DkWxAppHelper.cpt"
tp = (DkAppHelperWxStringTable *)dk3sto_it_find_like(
iStringTables, (void *)tn, 1
);
if(!(tp)) {
-#line 870 "DkWxAppHelper.cpt"
+#line 866 "DkWxAppHelper.cpt"
res = dk3app_find_data_file(app,tn,fnb,DK3_SIZEOF(fnb,dkChar));
-#line 872 "DkWxAppHelper.cpt"
+#line 868 "DkWxAppHelper.cpt"
if(res) {
-#line 873 "DkWxAppHelper.cpt"
+#line 869 "DkWxAppHelper.cpt"
fipo = dk3sf_fopen_app(fnb, dk3app_not_localized(22), app);
if(fipo) {
-#line 875 "DkWxAppHelper.cpt"
+#line 871 "DkWxAppHelper.cpt"
wxptr = (wxChar const **)dt; nelem = 0;
while(*(wxptr++)) { nelem++; }
if(nelem) {
@@ -716,10 +679,10 @@ DkWxAppHelper::getStringTable(
if(fgets(il, sizeof(il), fipo)) {
cc = 1;
-#line 902 "DkWxAppHelper.cpt"
+#line 898 "DkWxAppHelper.cpt"
if(il[0] != '#') {
-#line 903 "DkWxAppHelper.cpt"
+#line 899 "DkWxAppHelper.cpt"
dk3app_squeeze_line(il);
if(dk3wxs_from_utf8(wxb,DK3_SIZEOF(wxb,wxChar),il)) {
*wxptr = dk3wxs_dup_app(wxb, app);
@@ -734,32 +697,35 @@ DkWxAppHelper::getStringTable(
wxptr++;
} else {
-#line 916 "DkWxAppHelper.cpt"
+#line 912 "DkWxAppHelper.cpt"
ok = 0; cc = 0;
}
} else {
-#line 919 "DkWxAppHelper.cpt"
+#line 915 "DkWxAppHelper.cpt"
}
}
} while(cc);
if(nelem < tp->nelem) {
ok = 0;
-#line 924 "DkWxAppHelper.cpt"
+#line 920 "DkWxAppHelper.cpt"
+
+
+#line 921 "DkWxAppHelper.cpt"
}
if(ok) {
-#line 926 "DkWxAppHelper.cpt"
+#line 923 "DkWxAppHelper.cpt"
if(!dk3sto_add(sStringTables, (void *)tp)) {
dkwxah_string_table_close(tp);
-#line 928 "DkWxAppHelper.cpt"
+#line 925 "DkWxAppHelper.cpt"
tp = NULL;
}
} else {
-#line 931 "DkWxAppHelper.cpt"
+#line 928 "DkWxAppHelper.cpt"
dkwxah_string_table_close(tp);
tp = NULL;
}
@@ -773,39 +739,39 @@ DkWxAppHelper::getStringTable(
}
} else {
-#line 943 "DkWxAppHelper.cpt"
+#line 940 "DkWxAppHelper.cpt"
}
}
fclose(fipo);
} else {
-#line 947 "DkWxAppHelper.cpt"
+#line 944 "DkWxAppHelper.cpt"
}
} else {
-#line 949 "DkWxAppHelper.cpt"
+#line 946 "DkWxAppHelper.cpt"
}
}
if(tp) {
-#line 952 "DkWxAppHelper.cpt"
+#line 949 "DkWxAppHelper.cpt"
back = (wxChar const * const *)(tp->array);
}
} else {
-#line 955 "DkWxAppHelper.cpt"
+#line 952 "DkWxAppHelper.cpt"
}
} else {
-#line 957 "DkWxAppHelper.cpt"
+#line 954 "DkWxAppHelper.cpt"
}
if(!(back)) {
-#line 959 "DkWxAppHelper.cpt"
+#line 956 "DkWxAppHelper.cpt"
back = dt;
}
-#line 961 "DkWxAppHelper.cpt"
+#line 958 "DkWxAppHelper.cpt"
#endif
return back;
}
@@ -823,7 +789,7 @@ DkWxAppHelper::retrieveMultipleInts(
long l;
-#line 977 "DkWxAppHelper.cpt"
+#line 974 "DkWxAppHelper.cpt"
if((appName) && (vendorName) && (names) && (values)) {
wxConfig *conf = new wxConfig(appName, vendorName);
if(conf) {
@@ -840,7 +806,7 @@ DkWxAppHelper::retrieveMultipleInts(
}
}
-#line 992 "DkWxAppHelper.cpt"
+#line 989 "DkWxAppHelper.cpt"
return back;
}
@@ -858,7 +824,7 @@ DkWxAppHelper::retrieveMultipleLongs(
long l;
-#line 1008 "DkWxAppHelper.cpt"
+#line 1005 "DkWxAppHelper.cpt"
if((appName) && (vendorName) && (names) && (values)) {
wxConfig *conf = new wxConfig(appName, vendorName);
if(conf) {
@@ -876,7 +842,7 @@ DkWxAppHelper::retrieveMultipleLongs(
}
-#line 1024 "DkWxAppHelper.cpt"
+#line 1021 "DkWxAppHelper.cpt"
return back;
}
@@ -893,7 +859,7 @@ DkWxAppHelper::retrieveMultipleDoubles(
double *vptr;
-#line 1039 "DkWxAppHelper.cpt"
+#line 1036 "DkWxAppHelper.cpt"
if((appName) && (vendorName) && (names) && (values)) {
wxConfig *conf = new wxConfig(appName, vendorName);
if(conf) {
@@ -910,7 +876,7 @@ DkWxAppHelper::retrieveMultipleDoubles(
}
}
-#line 1054 "DkWxAppHelper.cpt"
+#line 1051 "DkWxAppHelper.cpt"
return back;
}
@@ -927,16 +893,16 @@ DkWxAppHelper::saveMultipleInts(
long l;
-#line 1069 "DkWxAppHelper.cpt"
+#line 1066 "DkWxAppHelper.cpt"
if((appName) && (vendorName) && (names) && (values)) {
wxConfig *conf = new wxConfig(appName, vendorName);
if(conf) {
-#line 1072 "DkWxAppHelper.cpt"
+#line 1069 "DkWxAppHelper.cpt"
nptr = names; vptr = values;
while(*nptr) {
-#line 1074 "DkWxAppHelper.cpt"
+#line 1071 "DkWxAppHelper.cpt"
l = (long)(*vptr);
if(conf->Write(*nptr, l)) {
back++;
@@ -947,7 +913,7 @@ DkWxAppHelper::saveMultipleInts(
}
}
-#line 1083 "DkWxAppHelper.cpt"
+#line 1080 "DkWxAppHelper.cpt"
return back;
}
@@ -965,7 +931,7 @@ DkWxAppHelper::saveMultipleLongs(
long l;
-#line 1099 "DkWxAppHelper.cpt"
+#line 1096 "DkWxAppHelper.cpt"
if((appName) && (vendorName) && (names) && (values)) {
wxConfig *conf = new wxConfig(appName, vendorName);
if(conf) {
@@ -982,7 +948,7 @@ DkWxAppHelper::saveMultipleLongs(
}
-#line 1114 "DkWxAppHelper.cpt"
+#line 1111 "DkWxAppHelper.cpt"
return back;
}
@@ -1000,7 +966,7 @@ DkWxAppHelper::saveMultipleDoubles(
double *vptr;
-#line 1130 "DkWxAppHelper.cpt"
+#line 1127 "DkWxAppHelper.cpt"
if((appName) && (vendorName) && (names) && (values)) {
wxConfig *conf = new wxConfig(appName, vendorName);
if(conf) {
@@ -1016,7 +982,7 @@ DkWxAppHelper::saveMultipleDoubles(
}
}
-#line 1144 "DkWxAppHelper.cpt"
+#line 1141 "DkWxAppHelper.cpt"
return back;
}
@@ -1031,13 +997,14 @@ DkWxAppHelper::retrieveString(
wxChar const *ptr;
-#line 1157 "DkWxAppHelper.cpt"
+#line 1154 "DkWxAppHelper.cpt"
if((name) && (appName) && (vendorName)) {
wxConfig *conf = new wxConfig(appName, vendorName);
if(conf) {
wxString str;
if(conf->Read(name, &str)) {
- ptr = str.c_str();
+ wxCStrData strdata = str.c_str();
+ ptr = (wxChar const *)strdata;
if(ptr) {
back = dk3wxs_dup_app(ptr, app);
}
@@ -1046,7 +1013,7 @@ DkWxAppHelper::retrieveString(
}
}
-#line 1170 "DkWxAppHelper.cpt"
+#line 1168 "DkWxAppHelper.cpt"
return back;
}
@@ -1061,7 +1028,7 @@ DkWxAppHelper::saveString(
int back = 0;
-#line 1183 "DkWxAppHelper.cpt"
+#line 1181 "DkWxAppHelper.cpt"
if((name) && (value) && (appName) && (vendorName)) {
wxConfig *conf = new wxConfig(appName, vendorName);
if(conf) {
@@ -1070,7 +1037,7 @@ DkWxAppHelper::saveString(
}
}
-#line 1190 "DkWxAppHelper.cpt"
+#line 1188 "DkWxAppHelper.cpt"
return back;
}
@@ -1081,7 +1048,7 @@ DkWxAppHelper::getWxEncoding() const
{
-#line 1199 "DkWxAppHelper.cpt"
+#line 1197 "DkWxAppHelper.cpt"
return wxEncoding;
}
@@ -1092,7 +1059,7 @@ DkWxAppHelper::getDkEncoding() const
{
-#line 1208 "DkWxAppHelper.cpt"
+#line 1206 "DkWxAppHelper.cpt"
return dkEncoding;
}
@@ -1104,13 +1071,13 @@ DkWxAppHelper::getC8Encoding() const
int back;
-#line 1218 "DkWxAppHelper.cpt"
+#line 1216 "DkWxAppHelper.cpt"
back = dkEncoding;
if(DK3_ENCODING_UTF8 != back) {
back = DK3_ENCODING_PLAIN;
}
-#line 1222 "DkWxAppHelper.cpt"
+#line 1220 "DkWxAppHelper.cpt"
return back;
}
@@ -1121,7 +1088,7 @@ DkWxAppHelper::getApp() const
{
-#line 1231 "DkWxAppHelper.cpt"
+#line 1229 "DkWxAppHelper.cpt"
return app;
}
@@ -1135,13 +1102,13 @@ DkWxAppHelper::findDataFile(wxChar const *fn, wxChar *fnb, size_t szfnb)
int back = 0;
-#line 1243 "DkWxAppHelper.cpt"
+#line 1241 "DkWxAppHelper.cpt"
if((fn) && (fnb) && (szfnb)) {
-#line 1244 "DkWxAppHelper.cpt"
+#line 1242 "DkWxAppHelper.cpt"
if(checkSetup()) {
-#line 1245 "DkWxAppHelper.cpt"
+#line 1243 "DkWxAppHelper.cpt"
if(dk3wxs_to_dkstr(
shnDk, DK3_SIZEOF(shnDk,dkChar), dkEncoding, fn, wxEncoding
)
@@ -1149,32 +1116,32 @@ DkWxAppHelper::findDataFile(wxChar const *fn, wxChar *fnb, size_t szfnb)
{
if(app) {
-#line 1251 "DkWxAppHelper.cpt"
+#line 1249 "DkWxAppHelper.cpt"
if(dk3app_find_data_file(app,shnDk,ffnDk,DK3_SIZEOF(ffnDk,dkChar))) {
if(dk3wxs_from_dkstr(fnb, szfnb, wxEncoding, ffnDk, dkEncoding)) {
back = 1;
-#line 1254 "DkWxAppHelper.cpt"
+#line 1252 "DkWxAppHelper.cpt"
} else {
-#line 1255 "DkWxAppHelper.cpt"
+#line 1253 "DkWxAppHelper.cpt"
}
} else {
-#line 1257 "DkWxAppHelper.cpt"
+#line 1255 "DkWxAppHelper.cpt"
}
} else {
-#line 1259 "DkWxAppHelper.cpt"
+#line 1257 "DkWxAppHelper.cpt"
}
} else {
-#line 1261 "DkWxAppHelper.cpt"
+#line 1259 "DkWxAppHelper.cpt"
}
}
}
-#line 1264 "DkWxAppHelper.cpt"
+#line 1262 "DkWxAppHelper.cpt"
return back;
}
@@ -1186,14 +1153,14 @@ DkWxAppHelper::getBasicString(size_t i) const
wxChar const *back = NULL;
-#line 1274 "DkWxAppHelper.cpt"
+#line 1272 "DkWxAppHelper.cpt"
if(basicStrings) {
if(i < nBasicStrings) {
back = basicStrings[i];
}
}
-#line 1279 "DkWxAppHelper.cpt"
+#line 1277 "DkWxAppHelper.cpt"
return back;
}
@@ -1204,7 +1171,7 @@ DkWxAppHelper::getBasicStrings() const
{
-#line 1288 "DkWxAppHelper.cpt"
+#line 1286 "DkWxAppHelper.cpt"
return basicStrings;
}
@@ -1215,7 +1182,7 @@ DkWxAppHelper::getBasicStringNumbers() const
{
-#line 1297 "DkWxAppHelper.cpt"
+#line 1295 "DkWxAppHelper.cpt"
return nBasicStrings;
}
@@ -1227,14 +1194,14 @@ DkWxAppHelper::wxToDk(dkChar *bu, size_t sz, wxChar const *src) const
bool back = false;
-#line 1307 "DkWxAppHelper.cpt"
+#line 1305 "DkWxAppHelper.cpt"
if((bu) && (sz) && (src)) {
if(dk3wxs_to_dkstr(bu, sz, dkEncoding, src, wxEncoding)) {
back = true;
}
}
-#line 1312 "DkWxAppHelper.cpt"
+#line 1310 "DkWxAppHelper.cpt"
return back;
}
@@ -1246,14 +1213,14 @@ DkWxAppHelper::wxToC8(char *bu, size_t sz, wxChar const *src) const
bool back = false;
-#line 1322 "DkWxAppHelper.cpt"
+#line 1320 "DkWxAppHelper.cpt"
if((bu) && (sz) && (src)) {
if(dk3wxs_to_c8(bu, sz, getC8Encoding(), src, wxEncoding)) {
back = true;
}
}
-#line 1327 "DkWxAppHelper.cpt"
+#line 1325 "DkWxAppHelper.cpt"
return back;
}
@@ -1266,15 +1233,16 @@ DkWxAppHelper::wxToC8(char *bu, size_t sz, wxString & str) const
wxChar const *ptr;
-#line 1338 "DkWxAppHelper.cpt"
+#line 1336 "DkWxAppHelper.cpt"
if((bu) && (sz)) {
- ptr = str.c_str();
+ wxCStrData strdata = str.c_str();
+ ptr = (wxChar const *)strdata;
if(ptr) {
back = wxToC8(bu, sz, ptr);
}
}
-#line 1344 "DkWxAppHelper.cpt"
+#line 1343 "DkWxAppHelper.cpt"
return back;
}
@@ -1286,14 +1254,14 @@ DkWxAppHelper::dkToWx(wxChar *bu, size_t sz, dkChar const *src) const
bool back = false;
-#line 1354 "DkWxAppHelper.cpt"
+#line 1353 "DkWxAppHelper.cpt"
if((bu) && (sz) && (src)) {
if(dk3wxs_from_dkstr(bu, sz, wxEncoding, src, dkEncoding)) {
back = true;
}
}
-#line 1359 "DkWxAppHelper.cpt"
+#line 1358 "DkWxAppHelper.cpt"
return back;
}
@@ -1375,7 +1343,6 @@ DkWxAppHelper::reportProblemsIfAny(void)
}
if (!didReport) {
if ((NULL == cmdName) || (NULL == appName) || (NULL == vendorName)) {
- didReport = true;
/* ERROR: Memory */
showErrorMessage(3, 9);
}
diff --git a/support/dktools/DkWxAppHelper.cpt b/support/dktools/DkWxAppHelper.cpt
index c2d4f55ae8..9f568e9c1a 100644
--- a/support/dktools/DkWxAppHelper.cpt
+++ b/support/dktools/DkWxAppHelper.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -35,6 +35,17 @@ class DkWxAppHelper
{
protected:
+ /** Error codes.
+ */
+ enum {
+ /** No error occured.
+ */
+ ERROR_NONE = 0,
+ /** Failed to encode arg0 to dkChar.
+ */
+ ERROR_ENCODE_ARG0 ,
+ };
+
/** Application structure.
*/
dk3_app_t *app;
@@ -360,21 +371,6 @@ typedef struct {
typedef wxChar const *wxConstPtr;
-
-/** Error codes.
-*/
-enum {
- /** No error occured.
- */
- ERROR_NONE = 0,
-
- /** Failed to encode arg0 to dkChar.
- */
- ERROR_ENCODE_ARG0 ,
-};
-
-
-
/** Basic texts issued by wxWidgets applications.
*/
static wxChar const * const dkwxapphelper_defwxappstr[] = {
@@ -860,7 +856,7 @@ DkWxAppHelper::getStringTable(
int res; /* Search result. */
int cc; /* Flag: Can continue. */
int ok; /* Flag: All strings read succes. */
- $? "+ getStringTable"
+ $? "+ getStringTable %!ds", TR_STR(tn)
if((dt) && (tn)) { $? ". args ok"
if(checkSetup()) { $? ". controller setup ok"
tp = (DkAppHelperWxStringTable *)dk3sto_it_find_like(
@@ -921,6 +917,7 @@ DkWxAppHelper::getStringTable(
} while(cc);
if(nelem < tp->nelem) {
ok = 0; $? "! too few elements"
+ $? ". expected %u, found %u", (unsigned)(tp->nelem), (unsigned)nelem
}
if(ok) { $? ". success so far"
if(!dk3sto_add(sStringTables, (void *)tp)) {
@@ -1159,7 +1156,8 @@ DkWxAppHelper::retrieveString(
if(conf) {
wxString str;
if(conf->Read(name, &str)) {
- ptr = str.c_str();
+ wxCStrData strdata = str.c_str();
+ ptr = (wxChar const *)strdata;
if(ptr) {
back = dk3wxs_dup_app(ptr, app);
}
@@ -1239,7 +1237,7 @@ DkWxAppHelper::findDataFile(wxChar const *fn, wxChar *fnb, size_t szfnb)
dkChar shnDk[DK3_MAX_PATH];
dkChar ffnDk[DK3_MAX_PATH];
int back = 0;
- $? "+ findDataFile"
+ $? "+ findDataFile %!ws", TR_WXSTR(fn)
if((fn) && (fnb) && (szfnb)) { $? ". args ok"
if(checkSetup()) { $? ". setup ok"
if(dk3wxs_to_dkstr(
@@ -1336,7 +1334,8 @@ DkWxAppHelper::wxToC8(char *bu, size_t sz, wxString & str) const
wxChar const *ptr;
$? "+ DkWxAppHelper::wxToC8"
if((bu) && (sz)) {
- ptr = str.c_str();
+ wxCStrData strdata = str.c_str();
+ ptr = (wxChar const *)strdata;
if(ptr) {
back = wxToC8(bu, sz, ptr);
}
@@ -1437,7 +1436,6 @@ DkWxAppHelper::reportProblemsIfAny(void)
}
if (!didReport) {
if ((NULL == cmdName) || (NULL == appName) || (NULL == vendorName)) {
- didReport = true;
/* ERROR: Memory */
showErrorMessage(3, 9);
}
diff --git a/support/dktools/DkWxAppHelper.h b/support/dktools/DkWxAppHelper.h
index c4ec96724e..f779f2980f 100644
--- a/support/dktools/DkWxAppHelper.h
+++ b/support/dktools/DkWxAppHelper.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxAppHelper.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxAppHelper.cpt
*/
/** @file DkWxAppHelper.h Header file for the DkWxAppHelper module.
@@ -70,6 +48,17 @@ class DkWxAppHelper
{
protected:
+ /** Error codes.
+ */
+ enum {
+ /** No error occured.
+ */
+ ERROR_NONE = 0,
+ /** Failed to encode arg0 to dkChar.
+ */
+ ERROR_ENCODE_ARG0 ,
+ };
+
/** Application structure.
*/
dk3_app_t *app;
diff --git a/support/dktools/DkWxBmepsApp.cpp b/support/dktools/DkWxBmepsApp.cpp
index 30c27651db..da1eda89cc 100644
--- a/support/dktools/DkWxBmepsApp.cpp
+++ b/support/dktools/DkWxBmepsApp.cpp
@@ -1,56 +1,39 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBmepsApp.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBmepsApp.cpt
*/
/** @file DkWxBmepsApp.cpp The DkWxBmepsApp module.
*/
-#line 47 "DkWxBmepsApp.cpt"
-
+#line 51 "DkWxBmepsApp.cpt"
+#include "dk3conf.h"
#include "wxbmeps.h"
-#line 53 "DkWxBmepsApp.cpt"
+#line 57 "DkWxBmepsApp.cpt"
/** Implementation of DkWxBmepsApp.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkWxBmepsApp);
+#else
IMPLEMENT_APP(DkWxBmepsApp)
+#endif
@@ -435,7 +418,7 @@ wxT("See:"),
NULL
-#line 548 "DkWxBmepsApp.cpt"
+#line 557 "DkWxBmepsApp.cpt"
};
@@ -451,7 +434,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 558 "DkWxBmepsApp.cpt"
+#line 567 "DkWxBmepsApp.cpt"
};
/** Application group name.
@@ -488,14 +471,14 @@ DkWxBmepsApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchFs = NULL;
-#line 597 "DkWxBmepsApp.cpt"
+#line 606 "DkWxBmepsApp.cpt"
-#line 598 "DkWxBmepsApp.cpt"
+#line 607 "DkWxBmepsApp.cpt"
/* Initialize elements.
*/
@@ -537,6 +520,14 @@ DkWxBmepsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -544,6 +535,14 @@ DkWxBmepsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -551,14 +550,29 @@ DkWxBmepsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchFs = new wxArchiveFSHandler();
+ if (NULL != phArchFs) {
+ wxFileSystem::AddHandler(phArchFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
/* Get help controller
*/
helpController =
@@ -581,8 +595,8 @@ DkWxBmepsApp::OnInit()
/* Show frame and inidicate success.
*/
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Clean up on problems.
@@ -601,7 +615,7 @@ DkWxBmepsApp::OnInit()
-#line 702 "DkWxBmepsApp.cpt"
+#line 742 "DkWxBmepsApp.cpt"
return back;
}
@@ -613,7 +627,7 @@ DkWxBmepsApp::OnExit()
int back = 0;
-#line 712 "DkWxBmepsApp.cpt"
+#line 752 "DkWxBmepsApp.cpt"
/*
Release elements.
*/
@@ -625,10 +639,10 @@ DkWxBmepsApp::OnExit()
}
-#line 722 "DkWxBmepsApp.cpt"
+#line 762 "DkWxBmepsApp.cpt"
-#line 723 "DkWxBmepsApp.cpt"
+#line 763 "DkWxBmepsApp.cpt"
return back;
}
diff --git a/support/dktools/DkWxBmepsApp.cpt b/support/dktools/DkWxBmepsApp.cpt
index 2755bcdbd3..2e15fe73d1 100644
--- a/support/dktools/DkWxBmepsApp.cpt
+++ b/support/dktools/DkWxBmepsApp.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -39,13 +39,17 @@ class DkWxBmepsApp : public wxApp
virtual int OnExit();
};
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkWxBmepsApp);
+#else
DECLARE_APP(DkWxBmepsApp)
+#endif
%% module
-
+#include "dk3conf.h"
#include "wxbmeps.h"
@@ -54,7 +58,12 @@ $!trace-include
/** Implementation of DkWxBmepsApp.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkWxBmepsApp);
+#else
IMPLEMENT_APP(DkWxBmepsApp)
+#endif
@@ -591,7 +600,7 @@ DkWxBmepsApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchFs = NULL;
$!trace-init wxbmpp.deb
$? "+ DkWxBmepsApp::OnInit"
@@ -636,6 +645,14 @@ DkWxBmepsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -643,6 +660,14 @@ DkWxBmepsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -650,14 +675,29 @@ DkWxBmepsApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchFs = new wxArchiveFSHandler();
+ if (NULL != phArchFs) {
+ wxFileSystem::AddHandler(phArchFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
/* Get help controller
*/
helpController =
@@ -680,8 +720,8 @@ DkWxBmepsApp::OnInit()
/* Show frame and inidicate success.
*/
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Clean up on problems.
diff --git a/support/dktools/DkWxBmepsApp.h b/support/dktools/DkWxBmepsApp.h
index 2f973cfc1f..d145ce43be 100644
--- a/support/dktools/DkWxBmepsApp.h
+++ b/support/dktools/DkWxBmepsApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBmepsApp.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBmepsApp.cpt
*/
/** @file DkWxBmepsApp.h Header file for the DkWxBmepsApp module.
@@ -74,7 +52,11 @@ class DkWxBmepsApp : public wxApp
virtual int OnExit();
};
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkWxBmepsApp);
+#else
DECLARE_APP(DkWxBmepsApp)
+#endif
diff --git a/support/dktools/DkWxBmepsFrame.cpp b/support/dktools/DkWxBmepsFrame.cpp
index 1cd130f8fb..2b0eed410f 100644
--- a/support/dktools/DkWxBmepsFrame.cpp
+++ b/support/dktools/DkWxBmepsFrame.cpp
@@ -1,63 +1,42 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBmepsFrame.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBmepsFrame.wxc
*/
/** @file DkWxBmepsFrame.cpp The DkWxBmepsFrame module.
*/
-#line 364 "DkWxBmepsFrame.wxc"
+#line 368 "DkWxBmepsFrame.wxc"
+#include "dk3conf.h"
#include "wxbmeps.h"
/*
Icons and bitmaps
*/
-#include "dkicon.xpm"
-#include "choose-dir.xpm"
-#include "exit-program.xpm"
-#include "run-conversion.xpm"
-#include "set-options.xpm"
+#include "gui-img/icons/dkicon.xpm"
+#include "gui-img/shared/toolbar/choose-dir.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+#include "gui-img/shared/toolbar/set-options.xpm"
#include "dk4verswx.h"
-#line 382 "DkWxBmepsFrame.wxc"
+#line 387 "DkWxBmepsFrame.wxc"
@@ -97,7 +76,7 @@ wxT("wxbmeps.paper-size"),
NULL
-#line 422 "DkWxBmepsFrame.wxc"
+#line 427 "DkWxBmepsFrame.wxc"
};
@@ -129,7 +108,7 @@ wxT("wxbmeps.resolution"),
NULL
-#line 438 "DkWxBmepsFrame.wxc"
+#line 443 "DkWxBmepsFrame.wxc"
};
@@ -203,11 +182,16 @@ wxT("wxbmeps.reduce-bits-per-component"),
NULL
-#line 468 "DkWxBmepsFrame.wxc"
+#line 473 "DkWxBmepsFrame.wxc"
};
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc wxbmepsframe_cmd_line_desc[] = {
{
wxCMD_LINE_OPTION,
@@ -239,10 +223,17 @@ static const wxCmdLineEntryDesc wxbmepsframe_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
/** Event table for the DkWxBmepsFrame class.
*/
-BEGIN_EVENT_TABLE(DkWxBmepsFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxBmepsFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkWxBmepsFrame,wxFrame)
+#endif
EVT_MENU(DkWxBmeps_Quit, DkWxBmepsFrame::OnQuit)
EVT_MENU(DkWxBmeps_Help_Contents, DkWxBmepsFrame::OnHelpContents)
EVT_MENU(DkWxBmeps_About, DkWxBmepsFrame::OnAbout)
@@ -251,12 +242,16 @@ BEGIN_EVENT_TABLE(DkWxBmepsFrame, wxFrame)
EVT_MENU(DkWxBmeps_ResetOptions, DkWxBmepsFrame::OnResetOptions)
EVT_MENU(DkWxBmeps_Run, DkWxBmepsFrame::OnRunConversion)
EVT_IDLE(DkWxBmepsFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
-#line 520 "DkWxBmepsFrame.wxc"
+#line 541 "DkWxBmepsFrame.wxc"
DkWxBmepsFrame::DkWxBmepsFrame(
wxChar const *applicationName,
wxChar const * const *messageTexts,
@@ -275,7 +270,7 @@ DkWxBmepsFrame::DkWxBmepsFrame(
#endif
-#line 537 "DkWxBmepsFrame.wxc"
+#line 558 "DkWxBmepsFrame.wxc"
ddx = -1;
ddy = -1;
odx = -1;
@@ -574,7 +569,7 @@ DkWxBmepsFrame::DkWxBmepsFrame(
mainSizer->SetSizeHints(this);
}
-#line 565 "DkWxBmepsFrame.wxc"
+#line 586 "DkWxBmepsFrame.wxc"
pComm = new DkWxCommunicator(
applicationHelper->getWxEncoding(),
applicationHelper->getDkEncoding()
@@ -589,7 +584,7 @@ DkWxBmepsFrame::DkWxBmepsFrame(
bAutostartWanted = true;
if(pComm) {
-#line 578 "DkWxBmepsFrame.wxc"
+#line 599 "DkWxBmepsFrame.wxc"
pComm->autostartEnable(true);
}
#endif
@@ -609,7 +604,7 @@ DkWxBmepsFrame::DkWxBmepsFrame(
bAutostartWanted = true;
if(pComm) {
-#line 596 "DkWxBmepsFrame.wxc"
+#line 617 "DkWxBmepsFrame.wxc"
pComm->autostartEnable(true);
}
}
@@ -617,7 +612,8 @@ DkWxBmepsFrame::DkWxBmepsFrame(
bmeo.make = 1;
}
if(parser.Found(wxT("l"), &sLanguage)) {
- ptr = sLanguage.c_str();
+ wxCStrData slstrdata = sLanguage.c_str();
+ ptr = (wxChar const *)slstrdata;
if(ptr) {
if(applicationHelper->wxToDk(bu, DK3_SIZEOF(bu,dkChar), ptr)) {
(void)dk3bmeo_set_language(
@@ -628,7 +624,7 @@ DkWxBmepsFrame::DkWxBmepsFrame(
}
if(parser.GetParamCount() > 0) {
-#line 613 "DkWxBmepsFrame.wxc"
+#line 635 "DkWxBmepsFrame.wxc"
wxString cmdfn;
wxChar const *newfn;
cmdfn = parser.GetParam(0);
@@ -641,32 +637,33 @@ DkWxBmepsFrame::DkWxBmepsFrame(
bAutostartWanted = true;
if(pComm) {
-#line 624 "DkWxBmepsFrame.wxc"
+#line 646 "DkWxBmepsFrame.wxc"
pComm->autostartEnable(true);
}
}
cmdfn = fn.GetFullPath();
- newfn = cmdfn.c_str();
+ wxCStrData cmdfnstrdata = cmdfn.c_str();
+ newfn = (wxChar const *)cmdfnstrdata;
if(newfn) {
-#line 630 "DkWxBmepsFrame.wxc"
+#line 653 "DkWxBmepsFrame.wxc"
newfn = dk3wxs_dup_app(newfn, applicationHelper->getApp());
if(newfn) {
-#line 632 "DkWxBmepsFrame.wxc"
+#line 655 "DkWxBmepsFrame.wxc"
dk3_release(sDirectory);
sDirectory = newfn;
} else {
-#line 635 "DkWxBmepsFrame.wxc"
+#line 658 "DkWxBmepsFrame.wxc"
}
} else {
-#line 637 "DkWxBmepsFrame.wxc"
+#line 660 "DkWxBmepsFrame.wxc"
}
} else {
-#line 639 "DkWxBmepsFrame.wxc"
+#line 662 "DkWxBmepsFrame.wxc"
}
}
}
@@ -674,75 +671,72 @@ DkWxBmepsFrame::DkWxBmepsFrame(
}
-#line 645 "DkWxBmepsFrame.wxc"
+#line 668 "DkWxBmepsFrame.wxc"
-#line 646 "DkWxBmepsFrame.wxc"
+#line 669 "DkWxBmepsFrame.wxc"
-#line 647 "DkWxBmepsFrame.wxc"
+#line 670 "DkWxBmepsFrame.wxc"
-#line 648 "DkWxBmepsFrame.wxc"
+#line 671 "DkWxBmepsFrame.wxc"
-#line 649 "DkWxBmepsFrame.wxc"
+#line 672 "DkWxBmepsFrame.wxc"
-#line 650 "DkWxBmepsFrame.wxc"
+#line 673 "DkWxBmepsFrame.wxc"
-#line 651 "DkWxBmepsFrame.wxc"
+#line 674 "DkWxBmepsFrame.wxc"
-#line 652 "DkWxBmepsFrame.wxc"
+#line 675 "DkWxBmepsFrame.wxc"
-#line 653 "DkWxBmepsFrame.wxc"
+#line 676 "DkWxBmepsFrame.wxc"
-#line 654 "DkWxBmepsFrame.wxc"
+#line 677 "DkWxBmepsFrame.wxc"
-#line 655 "DkWxBmepsFrame.wxc"
+#line 678 "DkWxBmepsFrame.wxc"
-#line 656 "DkWxBmepsFrame.wxc"
+#line 679 "DkWxBmepsFrame.wxc"
-#line 657 "DkWxBmepsFrame.wxc"
+#line 680 "DkWxBmepsFrame.wxc"
-#line 658 "DkWxBmepsFrame.wxc"
+#line 681 "DkWxBmepsFrame.wxc"
-#line 659 "DkWxBmepsFrame.wxc"
+#line 682 "DkWxBmepsFrame.wxc"
-#line 660 "DkWxBmepsFrame.wxc"
+#line 683 "DkWxBmepsFrame.wxc"
-#line 661 "DkWxBmepsFrame.wxc"
+#line 684 "DkWxBmepsFrame.wxc"
-#line 662 "DkWxBmepsFrame.wxc"
-#if 0
- restorePosition();
-#endif
+#line 685 "DkWxBmepsFrame.wxc"
-#line 666 "DkWxBmepsFrame.wxc"
+#line 686 "DkWxBmepsFrame.wxc"
}
-#line 669 "DkWxBmepsFrame.wxc"
+#line 689 "DkWxBmepsFrame.wxc"
DkWxBmepsFrame::~DkWxBmepsFrame()
{
-#line 674 "DkWxBmepsFrame.wxc"
+#line 694 "DkWxBmepsFrame.wxc"
dk3_release(paperSizes);
dk3_release(sDirectory);
dk3_cpp_release(pComm);
@@ -752,7 +746,7 @@ DkWxBmepsFrame::~DkWxBmepsFrame()
dk3_cpp_release(asPaperSizes);
-#line 682 "DkWxBmepsFrame.wxc"
+#line 702 "DkWxBmepsFrame.wxc"
}
@@ -764,7 +758,7 @@ DkWxBmepsFrame::saveData()
int i[21];
-#line 692 "DkWxBmepsFrame.wxc"
+#line 712 "DkWxBmepsFrame.wxc"
d[0] = bmeo.ima.ps.w;
d[1] = bmeo.ima.ps.h;
d[2] = bmeo.ima.ps.i;
@@ -806,7 +800,7 @@ DkWxBmepsFrame::saveData()
/* ##### */
-#line 732 "DkWxBmepsFrame.wxc"
+#line 752 "DkWxBmepsFrame.wxc"
}
@@ -818,7 +812,7 @@ DkWxBmepsFrame::retrieveData()
int i[21];
-#line 742 "DkWxBmepsFrame.wxc"
+#line 762 "DkWxBmepsFrame.wxc"
d[0] = bmeo.ima.ps.w;
d[1] = bmeo.ima.ps.h;
d[2] = bmeo.ima.ps.i;
@@ -861,7 +855,7 @@ DkWxBmepsFrame::retrieveData()
bmeo.mode = i[1];
bmeo.szmode = i[2];
-#line 783 "DkWxBmepsFrame.wxc"
+#line 803 "DkWxBmepsFrame.wxc"
/* bmeo.color = i[3]; */
bmeo.pred = i[4];
bmeo.io = i[5];
@@ -896,7 +890,7 @@ DkWxBmepsFrame::retrieveData()
}
-#line 816 "DkWxBmepsFrame.wxc"
+#line 836 "DkWxBmepsFrame.wxc"
/* ##### */
}
@@ -909,7 +903,7 @@ DkWxBmepsFrame::runConversion(void)
DkWxBmepsThread *pt = NULL;
-#line 827 "DkWxBmepsFrame.wxc"
+#line 847 "DkWxBmepsFrame.wxc"
if(tStatus) {
tStatus->SetLabel(sTexts[28]);
if(cBlack) {
@@ -951,7 +945,7 @@ DkWxBmepsFrame::runConversion(void)
}
} else {
-#line 867 "DkWxBmepsFrame.wxc"
+#line 887 "DkWxBmepsFrame.wxc"
delete(pt);
/* ##### ERROR: Failed to create new thread! */
}
@@ -961,23 +955,23 @@ DkWxBmepsFrame::runConversion(void)
}
} else {
-#line 875 "DkWxBmepsFrame.wxc"
+#line 895 "DkWxBmepsFrame.wxc"
/* ##### ERROR: Failed to construct new thread! */
}
pd->Destroy();
} else {
-#line 879 "DkWxBmepsFrame.wxc"
+#line 899 "DkWxBmepsFrame.wxc"
/* ##### ERROR: Failed to create progress dialog! */
}
} else {
-#line 882 "DkWxBmepsFrame.wxc"
+#line 902 "DkWxBmepsFrame.wxc"
/* ##### ERROR: Setup incomplete! */
}
-#line 885 "DkWxBmepsFrame.wxc"
+#line 905 "DkWxBmepsFrame.wxc"
}
@@ -988,7 +982,7 @@ DkWxBmepsFrame::OnIdle(wxIdleEvent & event)
dk3_time_t ct; /* Current time. */
-#line 894 "DkWxBmepsFrame.wxc"
+#line 914 "DkWxBmepsFrame.wxc"
if(!bCloseScheduled) {
if(!bSetupChecked) {
bSetupChecked = true;
@@ -1001,17 +995,17 @@ DkWxBmepsFrame::OnIdle(wxIdleEvent & event)
}
if(!bCloseScheduled) {
-#line 905 "DkWxBmepsFrame.wxc"
+#line 925 "DkWxBmepsFrame.wxc"
if(pComm->autostartCanRun()) {
-#line 906 "DkWxBmepsFrame.wxc"
+#line 926 "DkWxBmepsFrame.wxc"
runConversion();
} else {
-#line 908 "DkWxBmepsFrame.wxc"
+#line 928 "DkWxBmepsFrame.wxc"
if(pComm->autostartIsFinished()) {
-#line 909 "DkWxBmepsFrame.wxc"
+#line 929 "DkWxBmepsFrame.wxc"
if(!(timeClose)) {
if(pComm->getLogLevel() > DK3_LL_WARNING) {
dk3sf_time(&timeClose);
@@ -1041,7 +1035,7 @@ DkWxBmepsFrame::OnIdle(wxIdleEvent & event)
}
-#line 937 "DkWxBmepsFrame.wxc"
+#line 957 "DkWxBmepsFrame.wxc"
}
@@ -1053,7 +1047,7 @@ DkWxBmepsFrame::OnChooseDirectory(wxCommandEvent& WXUNUSED(event))
wxChar const *np;
-#line 947 "DkWxBmepsFrame.wxc"
+#line 967 "DkWxBmepsFrame.wxc"
if(isGuiActive()) {
wxDirDialog dd(
this, sTexts[29],
@@ -1063,7 +1057,8 @@ DkWxBmepsFrame::OnChooseDirectory(wxCommandEvent& WXUNUSED(event))
pHelper->setRelatedPosition(this, &dd, &ddx, &ddy);
if(dd.ShowModal() == wxID_OK) {
wxString path = dd.GetPath();
- ptr = path.c_str();
+ wxCStrData pathstrdata = path.c_str();
+ ptr = (wxChar const *)pathstrdata;
if(ptr) {
np = dk3wxs_dup_app(ptr, pHelper->getApp());
if(np) {
@@ -1080,7 +1075,7 @@ DkWxBmepsFrame::OnChooseDirectory(wxCommandEvent& WXUNUSED(event))
dd.GetPosition(&ddx, &ddy);
}
-#line 972 "DkWxBmepsFrame.wxc"
+#line 993 "DkWxBmepsFrame.wxc"
}
@@ -1090,13 +1085,13 @@ DkWxBmepsFrame::OnRunConversion(wxCommandEvent& WXUNUSED(event))
{
-#line 980 "DkWxBmepsFrame.wxc"
+#line 1001 "DkWxBmepsFrame.wxc"
if(isGuiActive()) {
runConversion();
}
-#line 984 "DkWxBmepsFrame.wxc"
+#line 1005 "DkWxBmepsFrame.wxc"
}
@@ -1108,11 +1103,11 @@ DkWxBmepsFrame::isGuiActive()
back = bGuiActive;
-#line 994 "DkWxBmepsFrame.wxc"
+#line 1015 "DkWxBmepsFrame.wxc"
if(bCloseScheduled) { back = false; }
-#line 996 "DkWxBmepsFrame.wxc"
+#line 1017 "DkWxBmepsFrame.wxc"
return back;
}
@@ -1123,14 +1118,14 @@ DkWxBmepsFrame::canClose(bool isLast)
{
-#line 1005 "DkWxBmepsFrame.wxc"
+#line 1026 "DkWxBmepsFrame.wxc"
if(isLast) {
if(bSaveSettings) {
saveData();
}
}
-#line 1010 "DkWxBmepsFrame.wxc"
+#line 1031 "DkWxBmepsFrame.wxc"
return true;
}
@@ -1141,7 +1136,7 @@ DkWxBmepsFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
-#line 1019 "DkWxBmepsFrame.wxc"
+#line 1040 "DkWxBmepsFrame.wxc"
if(isGuiActive()) {
bCloseScheduled = true;
Show(false);
@@ -1149,7 +1144,7 @@ DkWxBmepsFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
}
-#line 1025 "DkWxBmepsFrame.wxc"
+#line 1046 "DkWxBmepsFrame.wxc"
}
@@ -1177,7 +1172,7 @@ DkWxBmepsFrame::OnSetOptions(wxCommandEvent& WXUNUSED(event))
int wxe;
-#line 1051 "DkWxBmepsFrame.wxc"
+#line 1072 "DkWxBmepsFrame.wxc"
dke = pHelper->getDkEncoding();
wxe = pHelper->getWxEncoding();
if(isGuiActive()) {
@@ -1195,13 +1190,13 @@ DkWxBmepsFrame::OnSetOptions(wxCommandEvent& WXUNUSED(event))
);
-#line 1067 "DkWxBmepsFrame.wxc"
+#line 1088 "DkWxBmepsFrame.wxc"
}
dlg.GetPosition(&odx, &ody);
}
-#line 1071 "DkWxBmepsFrame.wxc"
+#line 1092 "DkWxBmepsFrame.wxc"
}
@@ -1232,22 +1227,22 @@ DkWxBmepsFrame::findPaperSizes()
dk3_app_t *app;
-#line 1100 "DkWxBmepsFrame.wxc"
+#line 1121 "DkWxBmepsFrame.wxc"
if(asPaperSizes) {
-#line 1101 "DkWxBmepsFrame.wxc"
+#line 1122 "DkWxBmepsFrame.wxc"
app = pHelper->getApp();
psc = dk3paper_open_app(app);
if(psc) {
-#line 1104 "DkWxBmepsFrame.wxc"
+#line 1125 "DkWxBmepsFrame.wxc"
dk3paper_reset(psc);
while((nsz = dk3paper_next(psc)) != NULL) {
if(nsz->name) {
if(pHelper->dkToWx(bu, DK3_SIZEOF(bu,wxChar), nsz->name)) {
-#line 1109 "DkWxBmepsFrame.wxc"
+#line 1130 "DkWxBmepsFrame.wxc"
asPaperSizes->Add(bu);
nPaperSizes++;
}
@@ -1255,11 +1250,11 @@ DkWxBmepsFrame::findPaperSizes()
}
if(nPaperSizes) {
-#line 1115 "DkWxBmepsFrame.wxc"
+#line 1136 "DkWxBmepsFrame.wxc"
paperSizes = dk3_new_app(dk3_paper_size_t,nPaperSizes,app);
if(paperSizes) {
-#line 1117 "DkWxBmepsFrame.wxc"
+#line 1138 "DkWxBmepsFrame.wxc"
pps = paperSizes;
dk3paper_reset(psc);
while((nsz = dk3paper_next(psc)) != NULL) {
@@ -1267,7 +1262,7 @@ DkWxBmepsFrame::findPaperSizes()
if(pHelper->dkToWx(bu, DK3_SIZEOF(bu,wxChar), nsz->name))
{
-#line 1123 "DkWxBmepsFrame.wxc"
+#line 1144 "DkWxBmepsFrame.wxc"
dk3mem_cpy(
(void *)pps,
(void *)(&(nsz->size)),
@@ -1284,7 +1279,7 @@ DkWxBmepsFrame::findPaperSizes()
}
-#line 1138 "DkWxBmepsFrame.wxc"
+#line 1159 "DkWxBmepsFrame.wxc"
}
@@ -1309,7 +1304,7 @@ DkWxBmepsFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
sVersion.Append(wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."));
sVersion.Append(wxT("\n\n"));
sVersion.Append(sTexts[124]);
- sVersion.Append(wxT("http://dktools.sourceforge.net\n"));
+ sVersion.Append(wxT("http://sourceforge.net/p/dktools/wiki/Home/\n"));
sVersion.Append(wxT("http://www.wxwidgets.org\n"));
sVersion.Append(wxT("http://www.libpng.org/pub/png/libpng.html\n"));
sVersion.Append(wxT("http://www.ijg.org\n"));
diff --git a/support/dktools/DkWxBmepsFrame.h b/support/dktools/DkWxBmepsFrame.h
index 34419dd5ed..3c0a7188a8 100644
--- a/support/dktools/DkWxBmepsFrame.h
+++ b/support/dktools/DkWxBmepsFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBmepsFrame.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBmepsFrame.wxc
*/
/** @file DkWxBmepsFrame.h Header file for the DkWxBmepsFrame module.
@@ -54,7 +32,11 @@ class DkWxBmepsFrame : public DkWxFrame
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
void
findPaperSizes();
@@ -277,7 +259,7 @@ class DkWxBmepsFrame : public DkWxFrame
wxStaticText *tDirectory;
-#line 257 "DkWxBmepsFrame.wxc"
+#line 261 "DkWxBmepsFrame.wxc"
public:
/** Constructor.
@@ -383,7 +365,7 @@ class DkWxBmepsFrame : public DkWxFrame
-#line 362 "DkWxBmepsFrame.wxc"
+#line 366 "DkWxBmepsFrame.wxc"
#endif
diff --git a/support/dktools/DkWxBmepsFrame.wxc b/support/dktools/DkWxBmepsFrame.wxc
index 1d367de58a..3d964e1781 100644
--- a/support/dktools/DkWxBmepsFrame.wxc
+++ b/support/dktools/DkWxBmepsFrame.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% wx-gui
@@ -154,7 +154,11 @@ class DkWxBmepsFrame : public DkWxFrame
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
void
findPaperSizes();
@@ -364,16 +368,17 @@ class DkWxBmepsFrame : public DkWxFrame
+#include "dk3conf.h"
#include "wxbmeps.h"
/*
Icons and bitmaps
*/
-#include "dkicon.xpm"
-#include "choose-dir.xpm"
-#include "exit-program.xpm"
-#include "run-conversion.xpm"
-#include "set-options.xpm"
+#include "gui-img/icons/dkicon.xpm"
+#include "gui-img/shared/toolbar/choose-dir.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+#include "gui-img/shared/toolbar/set-options.xpm"
#include "dk4verswx.h"
@@ -469,6 +474,11 @@ $!end
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc wxbmepsframe_cmd_line_desc[] = {
{
wxCMD_LINE_OPTION,
@@ -500,10 +510,17 @@ static const wxCmdLineEntryDesc wxbmepsframe_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
/** Event table for the DkWxBmepsFrame class.
*/
-BEGIN_EVENT_TABLE(DkWxBmepsFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxBmepsFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkWxBmepsFrame,wxFrame)
+#endif
EVT_MENU(DkWxBmeps_Quit, DkWxBmepsFrame::OnQuit)
EVT_MENU(DkWxBmeps_Help_Contents, DkWxBmepsFrame::OnHelpContents)
EVT_MENU(DkWxBmeps_About, DkWxBmepsFrame::OnAbout)
@@ -512,7 +529,11 @@ BEGIN_EVENT_TABLE(DkWxBmepsFrame, wxFrame)
EVT_MENU(DkWxBmeps_ResetOptions, DkWxBmepsFrame::OnResetOptions)
EVT_MENU(DkWxBmeps_Run, DkWxBmepsFrame::OnRunConversion)
EVT_IDLE(DkWxBmepsFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -600,7 +621,8 @@ DkWxBmepsFrame::DkWxBmepsFrame(
bmeo.make = 1;
}
if(parser.Found(wxT("l"), &sLanguage)) {
- ptr = sLanguage.c_str();
+ wxCStrData slstrdata = sLanguage.c_str();
+ ptr = (wxChar const *)slstrdata;
if(ptr) {
if(applicationHelper->wxToDk(bu, DK3_SIZEOF(bu,dkChar), ptr)) {
(void)dk3bmeo_set_language(
@@ -625,7 +647,8 @@ DkWxBmepsFrame::DkWxBmepsFrame(
}
}
cmdfn = fn.GetFullPath();
- newfn = cmdfn.c_str();
+ wxCStrData cmdfnstrdata = cmdfn.c_str();
+ newfn = (wxChar const *)cmdfnstrdata;
if(newfn) { $? ". newfn (1)"
newfn = dk3wxs_dup_app(newfn, applicationHelper->getApp());
if(newfn) { $? ". newfn (2)"
@@ -659,9 +682,6 @@ DkWxBmepsFrame::DkWxBmepsFrame(
$? ". predicotr = %d", bmeo.pred
$? ". background = %d %d %d %d", bmeo.bgr, bmeo.bgg, bmeo.bgb, bmeo.fbg
$? ". interpolate = %d %d", bmeo.ip, bmeo.jip
-#if 0
- restorePosition();
-#endif
$? "- DkWxBmepsFrame::DkWxBmepsFrame"
}
@@ -953,7 +973,8 @@ DkWxBmepsFrame::OnChooseDirectory(wxCommandEvent& WXUNUSED(event))
pHelper->setRelatedPosition(this, &dd, &ddx, &ddy);
if(dd.ShowModal() == wxID_OK) {
wxString path = dd.GetPath();
- ptr = path.c_str();
+ wxCStrData pathstrdata = path.c_str();
+ ptr = (wxChar const *)pathstrdata;
if(ptr) {
np = dk3wxs_dup_app(ptr, pHelper->getApp());
if(np) {
@@ -1159,7 +1180,7 @@ DkWxBmepsFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
sVersion.Append(wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."));
sVersion.Append(wxT("\n\n"));
sVersion.Append(sTexts[124]);
- sVersion.Append(wxT("http://dktools.sourceforge.net\n"));
+ sVersion.Append(wxT("http://sourceforge.net/p/dktools/wiki/Home/\n"));
sVersion.Append(wxT("http://www.wxwidgets.org\n"));
sVersion.Append(wxT("http://www.libpng.org/pub/png/libpng.html\n"));
sVersion.Append(wxT("http://www.ijg.org\n"));
diff --git a/support/dktools/DkWxBmepsOptionsDialog.cpp b/support/dktools/DkWxBmepsOptionsDialog.cpp
index f81c179881..2754e0f979 100644
--- a/support/dktools/DkWxBmepsOptionsDialog.cpp
+++ b/support/dktools/DkWxBmepsOptionsDialog.cpp
@@ -1,53 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBmepsOptionsDialog.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBmepsOptionsDialog.wxc
*/
/** @file DkWxBmepsOptionsDialog.cpp The DkWxBmepsOptionsDialog module.
*/
-#line 384 "DkWxBmepsOptionsDialog.wxc"
+#line 388 "DkWxBmepsOptionsDialog.wxc"
+#include "dk3conf.h"
#include "wxbmeps.h"
-#line 390 "DkWxBmepsOptionsDialog.wxc"
+#line 395 "DkWxBmepsOptionsDialog.wxc"
-BEGIN_EVENT_TABLE(DkWxBmepsOptionsDialog, wxDialog)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxBmepsOptionsDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(DkWxBmepsOptionsDialog,wxDialog)
+#endif
EVT_BUTTON(wxID_OK, DkWxBmepsOptionsDialog::OnOK)
EVT_BUTTON(wxID_CANCEL, DkWxBmepsOptionsDialog::OnCancel)
EVT_CHOICE(DkWxBmeps_OuputFormat, DkWxBmepsOptionsDialog::OnOutputFormat)
@@ -56,12 +39,16 @@ BEGIN_EVENT_TABLE(DkWxBmepsOptionsDialog, wxDialog)
EVT_CHECKBOX(DkWxBmeps_Draft, DkWxBmepsOptionsDialog::OnDraft)
EVT_CHOICE(DkWxBmeps_PsLevel, DkWxBmepsOptionsDialog::OnPsLevel)
EVT_CHECKBOX(DkWxBmeps_Interpolation, DkWxBmepsOptionsDialog::OnInterpolation)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
-#line 405 "DkWxBmepsOptionsDialog.wxc"
+#line 418 "DkWxBmepsOptionsDialog.wxc"
DkWxBmepsOptionsDialog::DkWxBmepsOptionsDialog(
DkWxBmepsFrame *parent,
wxChar const *title,
@@ -726,7 +713,7 @@ DkWxBmepsOptionsDialog::DkWxBmepsOptionsDialog(
sDialog->SetSizeHints(this);
}
-#line 468 "DkWxBmepsOptionsDialog.wxc"
+#line 481 "DkWxBmepsOptionsDialog.wxc"
cvBackground->SetToolTip(messageTexts[88]);
sttGeneral->SetForegroundColour(cRed);
sttOutput->SetForegroundColour(cRed);
@@ -738,18 +725,18 @@ DkWxBmepsOptionsDialog::DkWxBmepsOptionsDialog(
}
-#line 479 "DkWxBmepsOptionsDialog.wxc"
+#line 492 "DkWxBmepsOptionsDialog.wxc"
void
DkWxBmepsOptionsDialog::OnOK(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
-#line 488 "DkWxBmepsOptionsDialog.wxc"
+#line 501 "DkWxBmepsOptionsDialog.wxc"
dataOut();
if(IsModal()) {
EndModal(wxID_OK);
@@ -759,14 +746,14 @@ DkWxBmepsOptionsDialog::OnOK(
}
-#line 496 "DkWxBmepsOptionsDialog.wxc"
+#line 509 "DkWxBmepsOptionsDialog.wxc"
}
void
DkWxBmepsOptionsDialog::OnCancel(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
if(IsModal()) {
@@ -785,7 +772,7 @@ DkWxBmepsOptionsDialog::dataOut()
int i;
-#line 520 "DkWxBmepsOptionsDialog.wxc"
+#line 533 "DkWxBmepsOptionsDialog.wxc"
/* Make mode cbMakeMode */
bmepsOptions->make = ((cbMakeMode->GetValue()) ? 1 : 0);
/* Output format cobOutputFormat */
@@ -800,14 +787,14 @@ DkWxBmepsOptionsDialog::dataOut()
if((i >= 0) && (i <= DK3_BMEPS_MODE_DOCUMENT)) {
bmepsOptions->mode = i;
-#line 533 "DkWxBmepsOptionsDialog.wxc"
+#line 546 "DkWxBmepsOptionsDialog.wxc"
} else {
bmepsOptions->mode = 0;
}
/* Finishing cobFinishing */
i = cobFinishing->GetSelection();
-#line 538 "DkWxBmepsOptionsDialog.wxc"
+#line 551 "DkWxBmepsOptionsDialog.wxc"
switch(i) {
case 1: {
bmepsOptions->duplex = 1; bmepsOptions->tumble = 0;
@@ -832,13 +819,13 @@ DkWxBmepsOptionsDialog::dataOut()
bmepsOptions->szmode = DK3_BMEPS_SIZE_PAPER;
-#line 561 "DkWxBmepsOptionsDialog.wxc"
+#line 574 "DkWxBmepsOptionsDialog.wxc"
} break;
default: {
bmepsOptions->szmode = cobResolution->GetSelection();
-#line 565 "DkWxBmepsOptionsDialog.wxc"
+#line 578 "DkWxBmepsOptionsDialog.wxc"
} break;
}
#endif
@@ -848,29 +835,30 @@ DkWxBmepsOptionsDialog::dataOut()
dkChar *ptr;
double v = 0.0;
wxString resText = txtResolution->GetValue();
- wxChar const *txt = resText.c_str();
+ wxCStrData txtstrdata = resText.c_str();
+ wxChar const *txt = (wxChar const *)txtstrdata;
-#line 576 "DkWxBmepsOptionsDialog.wxc"
+#line 590 "DkWxBmepsOptionsDialog.wxc"
if(txt) {
-#line 577 "DkWxBmepsOptionsDialog.wxc"
+#line 591 "DkWxBmepsOptionsDialog.wxc"
if(dk3wxs_to_dkstr(bu,DK3_SIZEOF(bu,dkChar),dke,txt,wxe)) {
ptr = bu;
-#line 579 "DkWxBmepsOptionsDialog.wxc"
+#line 593 "DkWxBmepsOptionsDialog.wxc"
while(*ptr) {
if(*ptr == dkT(',')) { *ptr = dkT('.'); }
ptr++;
}
-#line 583 "DkWxBmepsOptionsDialog.wxc"
+#line 597 "DkWxBmepsOptionsDialog.wxc"
if(dk3sf_scan_double_app(bu,&v,NULL)) {
-#line 584 "DkWxBmepsOptionsDialog.wxc"
+#line 598 "DkWxBmepsOptionsDialog.wxc"
bmepsOptions->resolution = v;
-#line 585 "DkWxBmepsOptionsDialog.wxc"
+#line 599 "DkWxBmepsOptionsDialog.wxc"
} else {
bmepsOptions->resolution = 0.0;
}
@@ -882,7 +870,7 @@ DkWxBmepsOptionsDialog::dataOut()
}
} else {
-#line 595 "DkWxBmepsOptionsDialog.wxc"
+#line 609 "DkWxBmepsOptionsDialog.wxc"
bmepsOptions->resolution = 0.0;
}
/* Paper size cobPaperSize */
@@ -890,7 +878,7 @@ DkWxBmepsOptionsDialog::dataOut()
*selectedPaperSize = (size_t)(cobPaperSize->GetSelection());
-#line 601 "DkWxBmepsOptionsDialog.wxc"
+#line 615 "DkWxBmepsOptionsDialog.wxc"
}
/* PS level cobPsLevel */
i = cobPsLevel->GetSelection();
@@ -913,10 +901,10 @@ DkWxBmepsOptionsDialog::dataOut()
bmepsOptions->bgb = cvBackground->getBlue();
/* Force background color cbForceBackground*/
bmepsOptions->fbg = ((cbForceBackground->GetValue()) ? 1 : 0);
- (void)dk3bmeo_check(bmepsOptions, 0, bmepsOptions->app, NULL);
+ (void)dk3bmeo_check(bmepsOptions, 0, NULL);
-#line 625 "DkWxBmepsOptionsDialog.wxc"
+#line 639 "DkWxBmepsOptionsDialog.wxc"
}
@@ -947,12 +935,12 @@ DkWxBmepsOptionsDialog::dataIn()
/* Resolution choice cobResolution */
-#line 654 "DkWxBmepsOptionsDialog.wxc"
+#line 668 "DkWxBmepsOptionsDialog.wxc"
setChoice(cobResolution, bmepsOptions->szmode);
/* Resolution value txtResolution */
if(bmepsOptions->szmode == 2) {
-#line 657 "DkWxBmepsOptionsDialog.wxc"
+#line 671 "DkWxBmepsOptionsDialog.wxc"
txtResolution->ChangeValue(
wxString::Format(wxT("%lg"), bmepsOptions->resolution)
);
@@ -1023,7 +1011,7 @@ DkWxBmepsOptionsDialog::setChoice(wxChoice *ch, int val)
void
-DkWxBmepsOptionsDialog::OnOutputFormat(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnOutputFormat(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -1031,7 +1019,7 @@ DkWxBmepsOptionsDialog::OnOutputFormat(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnOutputType(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnOutputType(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -1039,7 +1027,7 @@ DkWxBmepsOptionsDialog::OnOutputType(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnResolution(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnResolution(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -1047,7 +1035,7 @@ DkWxBmepsOptionsDialog::OnResolution(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnDraft(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnDraft(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -1055,7 +1043,7 @@ DkWxBmepsOptionsDialog::OnDraft(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnPsLevel(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnPsLevel(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -1063,7 +1051,7 @@ DkWxBmepsOptionsDialog::OnPsLevel(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnInterpolation(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnInterpolation(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -1076,7 +1064,7 @@ DkWxBmepsOptionsDialog::correctGUI()
bool doEnable;
-#line 779 "DkWxBmepsOptionsDialog.wxc"
+#line 793 "DkWxBmepsOptionsDialog.wxc"
if(!bIsCorrecting) {
bIsCorrecting = true;
/* Output type */
@@ -1211,6 +1199,6 @@ DkWxBmepsOptionsDialog::correctGUI()
Update();
}
-#line 912 "DkWxBmepsOptionsDialog.wxc"
+#line 926 "DkWxBmepsOptionsDialog.wxc"
}
diff --git a/support/dktools/DkWxBmepsOptionsDialog.h b/support/dktools/DkWxBmepsOptionsDialog.h
index 88b50f3d47..91bc369125 100644
--- a/support/dktools/DkWxBmepsOptionsDialog.h
+++ b/support/dktools/DkWxBmepsOptionsDialog.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBmepsOptionsDialog.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBmepsOptionsDialog.wxc
*/
/** @file DkWxBmepsOptionsDialog.h Header file for the DkWxBmepsOptionsDialog module.
@@ -61,8 +39,12 @@ class DkWxBmepsOptionsDialog : public wxDialog
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
-
+#endif
+
protected:
/** Application helper object.
@@ -101,13 +83,13 @@ class DkWxBmepsOptionsDialog : public wxDialog
@param event Event to process.
*/
void
- OnOK(wxCommandEvent& WXUNUSED(event));
+ OnOK(wxCommandEvent& event);
/** Handler for Cancel button.
@param event Event to process.
*/
void
- OnCancel(wxCommandEvent& WXUNUSED(event));
+ OnCancel(wxCommandEvent& event);
/** Handler for output format change.
@param event Event to process.
@@ -341,7 +323,7 @@ class DkWxBmepsOptionsDialog : public wxDialog
wxButton *bCancel;
-#line 328 "DkWxBmepsOptionsDialog.wxc"
+#line 332 "DkWxBmepsOptionsDialog.wxc"
public:
/** Constructor.
@@ -395,7 +377,7 @@ class DkWxBmepsOptionsDialog : public wxDialog
};
-#line 381 "DkWxBmepsOptionsDialog.wxc"
+#line 385 "DkWxBmepsOptionsDialog.wxc"
diff --git a/support/dktools/DkWxBmepsOptionsDialog.wxc b/support/dktools/DkWxBmepsOptionsDialog.wxc
index a4c58287da..9960a7866f 100644
--- a/support/dktools/DkWxBmepsOptionsDialog.wxc
+++ b/support/dktools/DkWxBmepsOptionsDialog.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% wx-gui
@@ -234,8 +234,12 @@ class DkWxBmepsOptionsDialog : public wxDialog
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
-
+#endif
+
protected:
/** Application helper object.
@@ -274,13 +278,13 @@ class DkWxBmepsOptionsDialog : public wxDialog
@param event Event to process.
*/
void
- OnOK(wxCommandEvent& WXUNUSED(event));
+ OnOK(wxCommandEvent& event);
/** Handler for Cancel button.
@param event Event to process.
*/
void
- OnCancel(wxCommandEvent& WXUNUSED(event));
+ OnCancel(wxCommandEvent& event);
/** Handler for output format change.
@param event Event to process.
@@ -382,13 +386,18 @@ class DkWxBmepsOptionsDialog : public wxDialog
%% module start
+#include "dk3conf.h"
#include "wxbmeps.h"
$!trace-include
-BEGIN_EVENT_TABLE(DkWxBmepsOptionsDialog, wxDialog)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxBmepsOptionsDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(DkWxBmepsOptionsDialog,wxDialog)
+#endif
EVT_BUTTON(wxID_OK, DkWxBmepsOptionsDialog::OnOK)
EVT_BUTTON(wxID_CANCEL, DkWxBmepsOptionsDialog::OnCancel)
EVT_CHOICE(DkWxBmeps_OuputFormat, DkWxBmepsOptionsDialog::OnOutputFormat)
@@ -397,7 +406,11 @@ BEGIN_EVENT_TABLE(DkWxBmepsOptionsDialog, wxDialog)
EVT_CHECKBOX(DkWxBmeps_Draft, DkWxBmepsOptionsDialog::OnDraft)
EVT_CHOICE(DkWxBmeps_PsLevel, DkWxBmepsOptionsDialog::OnPsLevel)
EVT_CHECKBOX(DkWxBmeps_Interpolation, DkWxBmepsOptionsDialog::OnInterpolation)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -481,7 +494,7 @@ DkWxBmepsOptionsDialog::DkWxBmepsOptionsDialog(
void
DkWxBmepsOptionsDialog::OnOK(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
$? "+ DkWxBmepsOptionsDialog::OnOK"
@@ -499,7 +512,7 @@ DkWxBmepsOptionsDialog::OnOK(
void
DkWxBmepsOptionsDialog::OnCancel(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
if(IsModal()) {
@@ -571,7 +584,8 @@ DkWxBmepsOptionsDialog::dataOut()
dkChar *ptr;
double v = 0.0;
wxString resText = txtResolution->GetValue();
- wxChar const *txt = resText.c_str();
+ wxCStrData txtstrdata = resText.c_str();
+ wxChar const *txt = (wxChar const *)txtstrdata;
$? ". szmode: specified"
if(txt) { $? ". have txt"
if(dk3wxs_to_dkstr(bu,DK3_SIZEOF(bu,dkChar),dke,txt,wxe)) {
@@ -620,7 +634,7 @@ DkWxBmepsOptionsDialog::dataOut()
bmepsOptions->bgb = cvBackground->getBlue();
/* Force background color cbForceBackground*/
bmepsOptions->fbg = ((cbForceBackground->GetValue()) ? 1 : 0);
- (void)dk3bmeo_check(bmepsOptions, 0, bmepsOptions->app, NULL);
+ (void)dk3bmeo_check(bmepsOptions, 0, NULL);
$? "- DkWxBmepsOptionsDialog::dataOut"
}
@@ -724,7 +738,7 @@ DkWxBmepsOptionsDialog::setChoice(wxChoice *ch, int val)
void
-DkWxBmepsOptionsDialog::OnOutputFormat(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnOutputFormat(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -732,7 +746,7 @@ DkWxBmepsOptionsDialog::OnOutputFormat(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnOutputType(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnOutputType(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -740,7 +754,7 @@ DkWxBmepsOptionsDialog::OnOutputType(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnResolution(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnResolution(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -748,7 +762,7 @@ DkWxBmepsOptionsDialog::OnResolution(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnDraft(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnDraft(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -756,7 +770,7 @@ DkWxBmepsOptionsDialog::OnDraft(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnPsLevel(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnPsLevel(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
@@ -764,7 +778,7 @@ DkWxBmepsOptionsDialog::OnPsLevel(wxCommandEvent & event)
void
-DkWxBmepsOptionsDialog::OnInterpolation(wxCommandEvent & event)
+DkWxBmepsOptionsDialog::OnInterpolation(wxCommandEvent & WXUNUSED(event))
{
correctGUI();
}
diff --git a/support/dktools/DkWxBmepsThread.cpp b/support/dktools/DkWxBmepsThread.cpp
index f79a017cda..399c520616 100644
--- a/support/dktools/DkWxBmepsThread.cpp
+++ b/support/dktools/DkWxBmepsThread.cpp
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBmepsThread.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBmepsThread.cpt
*/
/** @file DkWxBmepsThread.cpp The DkWxBmepsThread module.
@@ -39,11 +17,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 127 "DkWxBmepsThread.cpt"
+#include "dk3conf.h"
#include "wxbmeps.h"
-#line 131 "DkWxBmepsThread.cpt"
+#line 132 "DkWxBmepsThread.cpt"
@@ -74,7 +53,7 @@ wxT("*.*"),
NULL
-#line 161 "DkWxBmepsThread.cpt"
+#line 162 "DkWxBmepsThread.cpt"
};
@@ -111,7 +90,7 @@ DkWxBmepsThread::DkWxBmepsThread(
{
-#line 196 "DkWxBmepsThread.cpt"
+#line 197 "DkWxBmepsThread.cpt"
pComm = pc;
sTexts = st;
msg = m;
@@ -123,7 +102,7 @@ DkWxBmepsThread::DkWxBmepsThread(
bmeo.to_stdout = 0;
-#line 206 "DkWxBmepsThread.cpt"
+#line 207 "DkWxBmepsThread.cpt"
}
@@ -134,12 +113,12 @@ DkWxBmepsThread::checkSetup()
bool back = false;
-#line 215 "DkWxBmepsThread.cpt"
+#line 216 "DkWxBmepsThread.cpt"
if(sDirectory) {
back = true;
}
-#line 218 "DkWxBmepsThread.cpt"
+#line 219 "DkWxBmepsThread.cpt"
return back;
}
@@ -149,11 +128,11 @@ DkWxBmepsThread::~DkWxBmepsThread()
{
-#line 226 "DkWxBmepsThread.cpt"
+#line 227 "DkWxBmepsThread.cpt"
dk3_release(sDirectory);
-#line 228 "DkWxBmepsThread.cpt"
+#line 229 "DkWxBmepsThread.cpt"
}
@@ -190,27 +169,27 @@ DkWxBmepsThread::Entry()
#else
-#line 263 "DkWxBmepsThread.cpt"
+#line 264 "DkWxBmepsThread.cpt"
if(wxFileName::DirExists(sDirectory)) {
-#line 264 "DkWxBmepsThread.cpt"
+#line 265 "DkWxBmepsThread.cpt"
runForDirectory(sDirectory);
} else {
-#line 266 "DkWxBmepsThread.cpt"
+#line 267 "DkWxBmepsThread.cpt"
if(wxFileName::FileExists(sDirectory)) {
-#line 267 "DkWxBmepsThread.cpt"
+#line 268 "DkWxBmepsThread.cpt"
runForFile(sDirectory, 0, 1000);
} else {
-#line 269 "DkWxBmepsThread.cpt"
+#line 270 "DkWxBmepsThread.cpt"
/* ##### ERROR: No such file or directory! */
}
}
pComm->setRunning(0);
-#line 273 "DkWxBmepsThread.cpt"
+#line 274 "DkWxBmepsThread.cpt"
#endif
return NULL;
}
@@ -223,7 +202,7 @@ DkWxBmepsThread::OnExit()
/* Doing nothing. */
-#line 284 "DkWxBmepsThread.cpt"
+#line 285 "DkWxBmepsThread.cpt"
}
@@ -236,7 +215,7 @@ DkWxBmepsThread::OnExit()
*/
static
int
-dkwxbmeps_compare_filenames(void const *l, void const *r, int cr)
+dkwxbmeps_compare_filenames(void const *l, void const *r, int WXUNUSED(cr))
{
int back = 0;
if(l) {
@@ -268,7 +247,7 @@ DkWxBmepsThread::runForFile(wxChar const *fn, int ming, int maxg)
wxChar const *shortname;
-#line 327 "DkWxBmepsThread.cpt"
+#line 328 "DkWxBmepsThread.cpt"
shortname = shortFileName(fn);
if(dk3wxs_to_dkstr(
sfn,
@@ -302,7 +281,7 @@ DkWxBmepsThread::runForFile(wxChar const *fn, int ming, int maxg)
pComm->addWxText(sTexts[110]);
} else {
-#line 359 "DkWxBmepsThread.cpt"
+#line 360 "DkWxBmepsThread.cpt"
/* ERROR: Failed to convert file name! */
pComm->addWxText(sTexts[118]);
pComm->addWxText(shortname);
@@ -313,7 +292,7 @@ DkWxBmepsThread::runForFile(wxChar const *fn, int ming, int maxg)
pComm->setUpdates(NULL, maxg);
-#line 368 "DkWxBmepsThread.cpt"
+#line 369 "DkWxBmepsThread.cpt"
}
@@ -338,7 +317,7 @@ DkWxBmepsThread::runForDirectory(wxChar const *dn)
-#line 391 "DkWxBmepsThread.cpt"
+#line 392 "DkWxBmepsThread.cpt"
pComm->addWxText(sTexts[106]);
pComm->addWxText(dn);
pComm->addWxText(sTexts[107]);
@@ -363,7 +342,8 @@ DkWxBmepsThread::runForDirectory(wxChar const *dn)
&filename, dkwxbmeps_thread_kw[0], wxDIR_FILES
);
while(canContinue) {
- cfilename = filename.c_str();
+ wxCStrData filenamestrdata = filename.c_str();
+ cfilename = (wxChar const *)filenamestrdata;
if(cfilename) {
if(dk3wxs_len(cfilename) < DK3_SIZEOF(namein,wxChar)) {
dk3wxs_cpy(namein, cfilename);
@@ -378,7 +358,7 @@ DkWxBmepsThread::runForDirectory(wxChar const *dn)
if(dk3sto_add(sFiles, suffix)) {
namesFound++;
-#line 429 "DkWxBmepsThread.cpt"
+#line 431 "DkWxBmepsThread.cpt"
} else {
/* ERROR: Memory */
dk3_release(suffix);
@@ -428,7 +408,7 @@ DkWxBmepsThread::runForDirectory(wxChar const *dn)
pComm->setUpdates(cfilename, promille);
-#line 477 "DkWxBmepsThread.cpt"
+#line 479 "DkWxBmepsThread.cpt"
fnlgt = dk3wxs_len(sDirectory);
fnlgt += dk3wxs_len(cfilename);
fnlgt += 1;
@@ -494,7 +474,7 @@ DkWxBmepsThread::runForDirectory(wxChar const *dn)
pComm->addWxText(sTexts[110]);
-#line 541 "DkWxBmepsThread.cpt"
+#line 543 "DkWxBmepsThread.cpt"
}
@@ -548,7 +528,7 @@ DkWxBmepsThread::checkMustRun(wxChar const *sfn)
}
} else {
-#line 593 "DkWxBmepsThread.cpt"
+#line 595 "DkWxBmepsThread.cpt"
/* BUG: Illegal output driver, should not happen. */
}
}
diff --git a/support/dktools/DkWxBmepsThread.cpt b/support/dktools/DkWxBmepsThread.cpt
index 6e5e44fcbe..2a156112ea 100644
--- a/support/dktools/DkWxBmepsThread.cpt
+++ b/support/dktools/DkWxBmepsThread.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -125,6 +125,7 @@ class DkWxBmepsThread : public wxThread
%% module
+#include "dk3conf.h"
#include "wxbmeps.h"
$!trace-include
@@ -293,7 +294,7 @@ DkWxBmepsThread::OnExit()
*/
static
int
-dkwxbmeps_compare_filenames(void const *l, void const *r, int cr)
+dkwxbmeps_compare_filenames(void const *l, void const *r, int WXUNUSED(cr))
{
int back = 0;
if(l) {
@@ -412,7 +413,8 @@ DkWxBmepsThread::runForDirectory(wxChar const *dn)
&filename, dkwxbmeps_thread_kw[0], wxDIR_FILES
);
while(canContinue) {
- cfilename = filename.c_str();
+ wxCStrData filenamestrdata = filename.c_str();
+ cfilename = (wxChar const *)filenamestrdata;
if(cfilename) {
if(dk3wxs_len(cfilename) < DK3_SIZEOF(namein,wxChar)) {
dk3wxs_cpy(namein, cfilename);
diff --git a/support/dktools/DkWxBmepsThread.h b/support/dktools/DkWxBmepsThread.h
index 19e6e9e27c..34228ede22 100644
--- a/support/dktools/DkWxBmepsThread.h
+++ b/support/dktools/DkWxBmepsThread.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBmepsThread.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBmepsThread.cpt
*/
/** @file DkWxBmepsThread.h Header file for the DkWxBmepsThread module.
diff --git a/support/dktools/DkWxBufferedControl.cpp b/support/dktools/DkWxBufferedControl.cpp
index b13c94bfb9..a478f88ab0 100644
--- a/support/dktools/DkWxBufferedControl.cpp
+++ b/support/dktools/DkWxBufferedControl.cpp
@@ -1,52 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBufferedControl.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBufferedControl.cpt
*/
/** @file DkWxBufferedControl.cpp The DkWxBufferedControl module.
*/
-#line 188 "DkWxBufferedControl.cpt"
-
+#line 196 "DkWxBufferedControl.cpt"
+#include "dk3conf.h"
#include "DkWxBufferedControl.h"
-#line 195 "DkWxBufferedControl.cpt"
+#line 203 "DkWxBufferedControl.cpt"
@@ -55,12 +33,26 @@ wxChar const DkWxBufferedControl::DkWxBufferedControlName[] = {
};
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(DkWxBufferedControl, wxControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(DkWxBufferedControl, wxControl)
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxBufferedControl,wxControl)
+#else
BEGIN_EVENT_TABLE(DkWxBufferedControl,wxControl)
+#endif
EVT_ERASE_BACKGROUND(DkWxBufferedControl::OnErase)
EVT_PAINT(DkWxBufferedControl::OnPaint)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -68,7 +60,7 @@ DkWxBufferedControl::DkWxBufferedControl()
{
-#line 215 "DkWxBufferedControl.cpt"
+#line 237 "DkWxBufferedControl.cpt"
pBitmap = NULL;
iWidth = -1;
iHeight = -1;
@@ -76,7 +68,7 @@ DkWxBufferedControl::DkWxBufferedControl()
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-#line 221 "DkWxBufferedControl.cpt"
+#line 243 "DkWxBufferedControl.cpt"
}
@@ -127,7 +119,7 @@ DkWxBufferedControl::DkWxBufferedControl(
{
-#line 270 "DkWxBufferedControl.cpt"
+#line 292 "DkWxBufferedControl.cpt"
pBitmap = NULL;
iWidth = -1;
iHeight = -1;
@@ -135,7 +127,7 @@ DkWxBufferedControl::DkWxBufferedControl(
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-#line 276 "DkWxBufferedControl.cpt"
+#line 298 "DkWxBufferedControl.cpt"
}
@@ -144,12 +136,12 @@ DkWxBufferedControl::~DkWxBufferedControl()
{
-#line 283 "DkWxBufferedControl.cpt"
+#line 305 "DkWxBufferedControl.cpt"
{
wxMutexLocker lock(mxProtectData);
if(NULL != pBitmap) {
-#line 286 "DkWxBufferedControl.cpt"
+#line 308 "DkWxBufferedControl.cpt"
delete(pBitmap);
pBitmap = NULL;
}
@@ -159,21 +151,21 @@ DkWxBufferedControl::~DkWxBufferedControl()
}
-#line 294 "DkWxBufferedControl.cpt"
+#line 316 "DkWxBufferedControl.cpt"
}
void
-DkWxBufferedControl::OnErase(wxEraseEvent & event)
+DkWxBufferedControl::OnErase(wxEraseEvent & WXUNUSED(event))
{
-#line 302 "DkWxBufferedControl.cpt"
+#line 324 "DkWxBufferedControl.cpt"
/* Do nothing here. */
-#line 304 "DkWxBufferedControl.cpt"
+#line 326 "DkWxBufferedControl.cpt"
}
@@ -187,7 +179,7 @@ DkWxBufferedControl::OnPaint(wxPaintEvent & event)
int h = 0;
-#line 316 "DkWxBufferedControl.cpt"
+#line 338 "DkWxBufferedControl.cpt"
wxPaintDC paintDC(this);
{
wxMutexLocker lock(mxProtectData);
@@ -200,45 +192,45 @@ DkWxBufferedControl::OnPaint(wxPaintEvent & event)
if((iWidth != sz.x) || (iHeight != sz.y)) {
delete(pBitmap);
-#line 327 "DkWxBufferedControl.cpt"
+#line 349 "DkWxBufferedControl.cpt"
pBitmap = NULL;
mustdraw = true;
-#line 329 "DkWxBufferedControl.cpt"
+#line 351 "DkWxBufferedControl.cpt"
}
}
w = iWidth = sz.x; h = iHeight = sz.y;
if(NULL == pBitmap) {
-#line 333 "DkWxBufferedControl.cpt"
+#line 355 "DkWxBufferedControl.cpt"
pBitmap = new wxBitmap(iWidth, iHeight);
mustdraw = true;
-#line 335 "DkWxBufferedControl.cpt"
+#line 357 "DkWxBufferedControl.cpt"
}
if(NULL != pBitmap) {
-#line 337 "DkWxBufferedControl.cpt"
+#line 359 "DkWxBufferedControl.cpt"
if(false == mustdraw) {
if(bMustDraw) {
-#line 339 "DkWxBufferedControl.cpt"
+#line 361 "DkWxBufferedControl.cpt"
mustdraw = true;
}
}
if(mustdraw) {
-#line 343 "DkWxBufferedControl.cpt"
+#line 365 "DkWxBufferedControl.cpt"
wxMemoryDC memDC;
memDC.SelectObject(*pBitmap);
InternalPaint(memDC, event, true, w, h);
memDC.SelectObject(wxNullBitmap);
bMustDraw = false;
-#line 348 "DkWxBufferedControl.cpt"
+#line 370 "DkWxBufferedControl.cpt"
} else {
-#line 349 "DkWxBufferedControl.cpt"
+#line 371 "DkWxBufferedControl.cpt"
}
paintDC.DrawBitmap(*pBitmap, 0, 0, false);
done = true;
@@ -246,22 +238,22 @@ DkWxBufferedControl::OnPaint(wxPaintEvent & event)
}
if(!(done)) {
-#line 355 "DkWxBufferedControl.cpt"
+#line 377 "DkWxBufferedControl.cpt"
InternalPaint(paintDC, event, false, w, h);
}
-#line 357 "DkWxBufferedControl.cpt"
+#line 379 "DkWxBufferedControl.cpt"
}
void
DkWxBufferedControl::PaintOperation(
- wxDC & pdc,
- wxPaintEvent & event,
- bool buffered,
- int clWidth,
- int clHeight
+ wxDC & WXUNUSED(pdc),
+ wxPaintEvent & WXUNUSED(event),
+ bool WXUNUSED(buffered),
+ int WXUNUSED(clWidth),
+ int WXUNUSED(clHeight)
)
{
/* The default implementation intentionally does nothing. */
@@ -287,7 +279,7 @@ DkWxBufferedControl::InternalPaint(
int bgm = pdc.GetBackgroundMode();
-#line 392 "DkWxBufferedControl.cpt"
+#line 414 "DkWxBufferedControl.cpt"
PaintOperation(pdc, event, buffered, clWidth, clHeight);
pdc.SetBackgroundMode(bgm);
@@ -299,7 +291,7 @@ DkWxBufferedControl::InternalPaint(
pdc.SetBrush(br);
-#line 402 "DkWxBufferedControl.cpt"
+#line 424 "DkWxBufferedControl.cpt"
}
@@ -309,14 +301,14 @@ DkWxBufferedControl::SetMustUpdate(bool flag)
{
-#line 410 "DkWxBufferedControl.cpt"
+#line 432 "DkWxBufferedControl.cpt"
{
wxMutexLocker lock(mxProtectData);
bMustDraw = flag;
}
-#line 415 "DkWxBufferedControl.cpt"
+#line 437 "DkWxBufferedControl.cpt"
}
@@ -326,17 +318,17 @@ DkWxBufferedControl::releaseBuffer(void)
{
-#line 423 "DkWxBufferedControl.cpt"
+#line 445 "DkWxBufferedControl.cpt"
{
wxMutexLocker lock(mxProtectData);
if(pBitmap) {
-#line 426 "DkWxBufferedControl.cpt"
+#line 448 "DkWxBufferedControl.cpt"
delete(pBitmap);
pBitmap = NULL;
}
}
-#line 430 "DkWxBufferedControl.cpt"
+#line 452 "DkWxBufferedControl.cpt"
}
diff --git a/support/dktools/DkWxBufferedControl.cpt b/support/dktools/DkWxBufferedControl.cpt
index 3b78151c5b..ca85dc8d35 100644
--- a/support/dktools/DkWxBufferedControl.cpt
+++ b/support/dktools/DkWxBufferedControl.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -32,8 +32,8 @@ license = bsd
the constructors.
From Create() call DkWxBufferedControl::Create().
- You should also use DECLARE_DYNAMIC_CLASS() and
- IMPLEMENT_DYNAMIC_CLASS().
+ You should also use wxDECLARE_DYNAMIC_CLASS() and;
+ wxIMPLEMENT_DYNAMIC_CLASS().
*/
class DkWxBufferedControl : public wxControl
{
@@ -61,11 +61,19 @@ class DkWxBufferedControl : public wxControl
/** For RTTI.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(DkWxBufferedControl);
+#else
DECLARE_DYNAMIC_CLASS(DkWxBufferedControl)
+#endif
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -187,7 +195,7 @@ class DkWxBufferedControl : public wxControl
%% module
-
+#include "dk3conf.h"
#include "DkWxBufferedControl.h"
@@ -200,12 +208,26 @@ wxChar const DkWxBufferedControl::DkWxBufferedControlName[] = {
};
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(DkWxBufferedControl, wxControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(DkWxBufferedControl, wxControl)
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxBufferedControl,wxControl)
+#else
BEGIN_EVENT_TABLE(DkWxBufferedControl,wxControl)
+#endif
EVT_ERASE_BACKGROUND(DkWxBufferedControl::OnErase)
EVT_PAINT(DkWxBufferedControl::OnPaint)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -296,7 +318,7 @@ DkWxBufferedControl::~DkWxBufferedControl()
void
-DkWxBufferedControl::OnErase(wxEraseEvent & event)
+DkWxBufferedControl::OnErase(wxEraseEvent & WXUNUSED(event))
{
$? "+ DkWxBufferedControl::OnErase"
/* Do nothing here. */
@@ -360,11 +382,11 @@ DkWxBufferedControl::OnPaint(wxPaintEvent & event)
void
DkWxBufferedControl::PaintOperation(
- wxDC & pdc,
- wxPaintEvent & event,
- bool buffered,
- int clWidth,
- int clHeight
+ wxDC & WXUNUSED(pdc),
+ wxPaintEvent & WXUNUSED(event),
+ bool WXUNUSED(buffered),
+ int WXUNUSED(clWidth),
+ int WXUNUSED(clHeight)
)
{
/* The default implementation intentionally does nothing. */
diff --git a/support/dktools/DkWxBufferedControl.h b/support/dktools/DkWxBufferedControl.h
index 1886135ac0..d3ddb2c274 100644
--- a/support/dktools/DkWxBufferedControl.h
+++ b/support/dktools/DkWxBufferedControl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBufferedControl.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBufferedControl.cpt
*/
/** @file DkWxBufferedControl.h Header file for the DkWxBufferedControl module.
@@ -69,8 +47,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
the constructors.
From Create() call DkWxBufferedControl::Create().
- You should also use DECLARE_DYNAMIC_CLASS() and
- IMPLEMENT_DYNAMIC_CLASS().
+ You should also use wxDECLARE_DYNAMIC_CLASS() and;
+ wxIMPLEMENT_DYNAMIC_CLASS().
*/
class DkWxBufferedControl : public wxControl
{
@@ -98,11 +76,19 @@ class DkWxBufferedControl : public wxControl
/** For RTTI.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(DkWxBufferedControl);
+#else
DECLARE_DYNAMIC_CLASS(DkWxBufferedControl)
+#endif
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
diff --git a/support/dktools/DkWxColorView.cpp b/support/dktools/DkWxColorView.cpp
index 0d5fd18b6a..4a2ba8b63e 100644
--- a/support/dktools/DkWxColorView.cpp
+++ b/support/dktools/DkWxColorView.cpp
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxColorView.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxColorView.cpt
*/
/** @file DkWxColorView.cpp The DkWxColorView module.
*/
-#line 187 "DkWxColorView.cpt"
+#line 195 "DkWxColorView.cpt"
+#include "dk3conf.h"
#include "DkWxColorView.h"
#include <wx/dcbuffer.h>
@@ -48,17 +27,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 196 "DkWxColorView.cpt"
+#line 205 "DkWxColorView.cpt"
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxColorView, wxControl)
+#else
BEGIN_EVENT_TABLE(DkWxColorView, wxControl)
+#endif
EVT_ERASE_BACKGROUND(DkWxColorView::OnErase)
EVT_PAINT(DkWxColorView::OnPaint)
EVT_LEFT_DOWN(DkWxColorView::OnLeftMouseButtonDown)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(DkWxColorView, wxControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(DkWxColorView, wxControl)
+#endif
@@ -153,19 +145,23 @@ DkWxColorView::DoGetBestSize() const
void
-DkWxColorView::OnErase(wxEraseEvent & event)
+DkWxColorView::OnErase(wxEraseEvent & WXUNUSED(event))
{
}
void
-DkWxColorView::OnPaint(wxPaintEvent & event)
+DkWxColorView::OnPaint(wxPaintEvent & WXUNUSED(event))
{
wxBufferedPaintDC useDC(this);
wxSize sz = GetClientSize();
wxColour mycolor(r, g, b);
+#if wxCHECK_VERSION(3,0,0)
+ wxBrush myBrush(mycolor, wxBRUSHSTYLE_SOLID);
+#else
wxBrush myBrush(mycolor, wxSOLID);
+#endif
const wxBrush oldBrush = useDC.GetBrush();
useDC.SetBrush(myBrush);
useDC.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight());
@@ -175,16 +171,16 @@ DkWxColorView::OnPaint(wxPaintEvent & event)
void
-DkWxColorView::OnLeftMouseButtonDown(wxMouseEvent & event)
+DkWxColorView::OnLeftMouseButtonDown(wxMouseEvent & WXUNUSED(event))
{
-#line 325 "DkWxColorView.cpt"
+#line 351 "DkWxColorView.cpt"
wxColourDialog dlg(this);
if(pParentWindow) {
if(pHelper) {
-#line 328 "DkWxColorView.cpt"
+#line 354 "DkWxColorView.cpt"
pHelper->setRelatedPosition(pParentWindow, &dlg, &ccdx, &ccdy);
}
}
@@ -201,7 +197,7 @@ DkWxColorView::OnLeftMouseButtonDown(wxMouseEvent & event)
}
-#line 343 "DkWxColorView.cpt"
+#line 369 "DkWxColorView.cpt"
}
diff --git a/support/dktools/DkWxColorView.cpt b/support/dktools/DkWxColorView.cpt
index 7f575a4a9d..74b8241355 100644
--- a/support/dktools/DkWxColorView.cpt
+++ b/support/dktools/DkWxColorView.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -27,11 +27,19 @@ class DkWxColorView : public wxControl
/** Declare class as dynamic.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(DkWxColorView);
+#else
DECLARE_DYNAMIC_CLASS(DkWxColorView)
-
+#endif
+
/** Event table for control.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -185,6 +193,7 @@ class DkWxColorView : public wxControl
%% module
+#include "dk3conf.h"
#include "DkWxColorView.h"
#include <wx/dcbuffer.h>
@@ -196,13 +205,26 @@ $!trace-include
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxColorView, wxControl)
+#else
BEGIN_EVENT_TABLE(DkWxColorView, wxControl)
+#endif
EVT_ERASE_BACKGROUND(DkWxColorView::OnErase)
EVT_PAINT(DkWxColorView::OnPaint)
EVT_LEFT_DOWN(DkWxColorView::OnLeftMouseButtonDown)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(DkWxColorView, wxControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(DkWxColorView, wxControl)
+#endif
@@ -297,19 +319,23 @@ DkWxColorView::DoGetBestSize() const
void
-DkWxColorView::OnErase(wxEraseEvent & event)
+DkWxColorView::OnErase(wxEraseEvent & WXUNUSED(event))
{
}
void
-DkWxColorView::OnPaint(wxPaintEvent & event)
+DkWxColorView::OnPaint(wxPaintEvent & WXUNUSED(event))
{
wxBufferedPaintDC useDC(this);
wxSize sz = GetClientSize();
wxColour mycolor(r, g, b);
+#if wxCHECK_VERSION(3,0,0)
+ wxBrush myBrush(mycolor, wxBRUSHSTYLE_SOLID);
+#else
wxBrush myBrush(mycolor, wxSOLID);
+#endif
const wxBrush oldBrush = useDC.GetBrush();
useDC.SetBrush(myBrush);
useDC.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight());
@@ -319,7 +345,7 @@ DkWxColorView::OnPaint(wxPaintEvent & event)
void
-DkWxColorView::OnLeftMouseButtonDown(wxMouseEvent & event)
+DkWxColorView::OnLeftMouseButtonDown(wxMouseEvent & WXUNUSED(event))
{
$? "+ DkWxColorView::OnLeftMouseButtonDown"
wxColourDialog dlg(this);
diff --git a/support/dktools/DkWxColorView.h b/support/dktools/DkWxColorView.h
index 0a8430cc1f..4967107c82 100644
--- a/support/dktools/DkWxColorView.h
+++ b/support/dktools/DkWxColorView.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxColorView.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxColorView.cpt
*/
/** @file DkWxColorView.h Header file for the DkWxColorView module.
@@ -63,11 +41,19 @@ class DkWxColorView : public wxControl
/** Declare class as dynamic.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(DkWxColorView);
+#else
DECLARE_DYNAMIC_CLASS(DkWxColorView)
-
+#endif
+
/** Event table for control.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
diff --git a/support/dktools/DkWxCommunicator.cpp b/support/dktools/DkWxCommunicator.cpp
index 582f9c5bc2..3726f5e851 100644
--- a/support/dktools/DkWxCommunicator.cpp
+++ b/support/dktools/DkWxCommunicator.cpp
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxCommunicator.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxCommunicator.cpt
*/
/** @file DkWxCommunicator.cpp The DkWxCommunicator module.
*/
-#line 271 "DkWxCommunicator.cpt"
+#line 277 "DkWxCommunicator.cpt"
#include "dk3wxs.h"
@@ -47,7 +25,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 279 "DkWxCommunicator.cpt"
+#line 285 "DkWxCommunicator.cpt"
@@ -64,13 +42,13 @@ DkWxCommunicator::DkWxCommunicator(int we, int de)
{
-#line 294 "DkWxCommunicator.cpt"
+#line 300 "DkWxCommunicator.cpt"
wxe = we;
dke = de;
iRunning = 0;
iAutostart = DK3_WX_AUTOSTART_NORMAL;
-#line 298 "DkWxCommunicator.cpt"
+#line 304 "DkWxCommunicator.cpt"
sMessages = NULL;
sFilename = NULL;
iGauge = 0;
@@ -80,7 +58,7 @@ DkWxCommunicator::DkWxCommunicator(int we, int de)
sMessages = new wxString(dkwx_communicator_empty_text);
-#line 306 "DkWxCommunicator.cpt"
+#line 312 "DkWxCommunicator.cpt"
}
@@ -118,7 +96,7 @@ DkWxCommunicator::checkSetup() const
int
DkWxCommunicator::getUpdates(
- wxWindow *wDialog,
+ wxWindow * WXUNUSED(wDialog),
wxStaticText *tFilename,
wxGauge *gProgress
)
@@ -262,7 +240,7 @@ DkWxCommunicator::setRunning(int nv)
{
-#line 486 "DkWxCommunicator.cpt"
+#line 492 "DkWxCommunicator.cpt"
wxCriticalSectionLocker lock(csProtect);
/*
Set new value.
@@ -274,17 +252,17 @@ DkWxCommunicator::setRunning(int nv)
*/
if(nv == 0) {
-#line 496 "DkWxCommunicator.cpt"
+#line 502 "DkWxCommunicator.cpt"
if(iAutostart == DK3_WX_AUTOSTART_RUNNING) {
-#line 497 "DkWxCommunicator.cpt"
+#line 503 "DkWxCommunicator.cpt"
iAutostart = DK3_WX_AUTOSTART_FINISHED;
-#line 498 "DkWxCommunicator.cpt"
+#line 504 "DkWxCommunicator.cpt"
}
}
-#line 500 "DkWxCommunicator.cpt"
+#line 506 "DkWxCommunicator.cpt"
}
@@ -320,25 +298,25 @@ DkWxCommunicator::addWxText(wxChar const *t)
{
-#line 534 "DkWxCommunicator.cpt"
+#line 540 "DkWxCommunicator.cpt"
if(sMessages) {
-#line 535 "DkWxCommunicator.cpt"
+#line 541 "DkWxCommunicator.cpt"
if(t) {
-#line 536 "DkWxCommunicator.cpt"
+#line 542 "DkWxCommunicator.cpt"
wxCriticalSectionLocker lock(csProtect);
-#line 538 "DkWxCommunicator.cpt"
+#line 544 "DkWxCommunicator.cpt"
sMessages->Append(t);
-#line 540 "DkWxCommunicator.cpt"
+#line 546 "DkWxCommunicator.cpt"
}
}
-#line 542 "DkWxCommunicator.cpt"
+#line 548 "DkWxCommunicator.cpt"
}
@@ -393,20 +371,20 @@ DkWxCommunicator::autostartCanRun()
int back = 0;
-#line 595 "DkWxCommunicator.cpt"
+#line 601 "DkWxCommunicator.cpt"
{
wxCriticalSectionLocker lock(csProtect);
if(iAutostart == DK3_WX_AUTOSTART_START) {
-#line 598 "DkWxCommunicator.cpt"
+#line 604 "DkWxCommunicator.cpt"
iAutostart = DK3_WX_AUTOSTART_RUNNING;
-#line 599 "DkWxCommunicator.cpt"
+#line 605 "DkWxCommunicator.cpt"
back = 1;
}
}
-#line 602 "DkWxCommunicator.cpt"
+#line 608 "DkWxCommunicator.cpt"
return back;
}
@@ -417,15 +395,15 @@ DkWxCommunicator::autostartSetFinished()
{
-#line 611 "DkWxCommunicator.cpt"
+#line 617 "DkWxCommunicator.cpt"
wxCriticalSectionLocker lock(csProtect);
if(iAutostart == DK3_WX_AUTOSTART_RUNNING) {
iAutostart = DK3_WX_AUTOSTART_FINISHED;
-#line 614 "DkWxCommunicator.cpt"
+#line 620 "DkWxCommunicator.cpt"
}
-#line 615 "DkWxCommunicator.cpt"
+#line 621 "DkWxCommunicator.cpt"
}
@@ -436,18 +414,18 @@ DkWxCommunicator::autostartIsFinished()
int back = 0;
-#line 624 "DkWxCommunicator.cpt"
+#line 630 "DkWxCommunicator.cpt"
{
wxCriticalSectionLocker lock(csProtect);
if(iAutostart == DK3_WX_AUTOSTART_FINISHED) {
iAutostart = DK3_WX_AUTOSTART_WAIT_FOR_EXIT;
-#line 628 "DkWxCommunicator.cpt"
+#line 634 "DkWxCommunicator.cpt"
back = 1;
}
}
-#line 631 "DkWxCommunicator.cpt"
+#line 637 "DkWxCommunicator.cpt"
return back;
}
@@ -459,13 +437,13 @@ DkWxCommunicator::autostartGet()
int back;
-#line 641 "DkWxCommunicator.cpt"
+#line 647 "DkWxCommunicator.cpt"
{
wxCriticalSectionLocker lock(csProtect);
back = iAutostart;
}
-#line 645 "DkWxCommunicator.cpt"
+#line 651 "DkWxCommunicator.cpt"
return back;
}
@@ -476,19 +454,19 @@ DkWxCommunicator::autostartEnable(bool nv)
{
-#line 654 "DkWxCommunicator.cpt"
+#line 660 "DkWxCommunicator.cpt"
wxCriticalSectionLocker lock(csProtect);
if(nv) {
iAutostart = DK3_WX_AUTOSTART_START;
-#line 657 "DkWxCommunicator.cpt"
+#line 663 "DkWxCommunicator.cpt"
} else {
iAutostart = DK3_WX_AUTOSTART_NORMAL;
-#line 659 "DkWxCommunicator.cpt"
+#line 665 "DkWxCommunicator.cpt"
}
-#line 660 "DkWxCommunicator.cpt"
+#line 666 "DkWxCommunicator.cpt"
}
diff --git a/support/dktools/DkWxCommunicator.cpt b/support/dktools/DkWxCommunicator.cpt
index d5efa83382..032f352f26 100644
--- a/support/dktools/DkWxCommunicator.cpt
+++ b/support/dktools/DkWxCommunicator.cpt
@@ -2,14 +2,20 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
-#ifndef DK4CONF_H_INCLUDED
-#include "dk4conf.h"
+#if 0
+ifndef DK4CONF_H_INCLUDED
+include "dk4conf.h"
+endif
+#endif
+
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -340,7 +346,7 @@ DkWxCommunicator::checkSetup() const
int
DkWxCommunicator::getUpdates(
- wxWindow *wDialog,
+ wxWindow * WXUNUSED(wDialog),
wxStaticText *tFilename,
wxGauge *gProgress
)
diff --git a/support/dktools/DkWxCommunicator.h b/support/dktools/DkWxCommunicator.h
index e21319fc41..591287c17c 100644
--- a/support/dktools/DkWxCommunicator.h
+++ b/support/dktools/DkWxCommunicator.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxCommunicator.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxCommunicator.cpt
*/
/** @file DkWxCommunicator.h Header file for the DkWxCommunicator module.
@@ -43,8 +21,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "DkWxCommunicator.cpt"
-#ifndef DK4CONF_H_INCLUDED
-#include "dk4conf.h"
+#if 0
+ifndef DK4CONF_H_INCLUDED
+include "dk4conf.h"
+endif
+#endif
+
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
#endif
#ifndef WX_WXPREC_H_INCLUDED
diff --git a/support/dktools/DkWxDialog.cpp b/support/dktools/DkWxDialog.cpp
index 84477aef2c..2b69ca9ee7 100644
--- a/support/dktools/DkWxDialog.cpp
+++ b/support/dktools/DkWxDialog.cpp
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: DkWxDialog.cpt
@@ -9,16 +15,16 @@
*/
-#line 33 "DkWxDialog.cpt"
-
+#line 36 "DkWxDialog.cpt"
+#include "dk3conf.h"
#include "DkWxDialog.h"
-#line 40 "DkWxDialog.cpt"
+#line 43 "DkWxDialog.cpt"
diff --git a/support/dktools/DkWxDialog.cpt b/support/dktools/DkWxDialog.cpt
index ac097bc337..139e260864 100644
--- a/support/dktools/DkWxDialog.cpt
+++ b/support/dktools/DkWxDialog.cpt
@@ -1,4 +1,7 @@
%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -31,7 +34,7 @@ class DkWxDialog : public wxDialog
%% module
-
+#include "dk3conf.h"
#include "DkWxDialog.h"
diff --git a/support/dktools/DkWxDialog.h b/support/dktools/DkWxDialog.h
index f26f3fe79d..002963e682 100644
--- a/support/dktools/DkWxDialog.h
+++ b/support/dktools/DkWxDialog.h
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: DkWxDialog.cpt
@@ -13,7 +19,7 @@
#define DKWXDIALOG_H_INCLUDED 1
-#line 4 "DkWxDialog.cpt"
+#line 7 "DkWxDialog.cpt"
#include <dk3all.h>
diff --git a/support/dktools/DkWxFrame.cpp b/support/dktools/DkWxFrame.cpp
index c9f01499c1..9c5540ae6f 100644
--- a/support/dktools/DkWxFrame.cpp
+++ b/support/dktools/DkWxFrame.cpp
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxFrame.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxFrame.cpt
*/
@@ -39,12 +17,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file DkWxFrame.cpp Implementation of DkWxFrame.
*/
+#include "dk3conf.h"
#include "DkWxFrame.h"
-#line 121 "DkWxFrame.cpt"
+#line 122 "DkWxFrame.cpt"
@@ -82,7 +61,7 @@ DkWxFrame::DkWxFrame(
{
-#line 157 "DkWxFrame.cpt"
+#line 158 "DkWxFrame.cpt"
/*
Initialize elements.
*/
@@ -96,7 +75,7 @@ DkWxFrame::DkWxFrame(
Connect(wxid, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(DkWxFrame::OnClose));
-#line 169 "DkWxFrame.cpt"
+#line 170 "DkWxFrame.cpt"
}
@@ -106,7 +85,7 @@ void DkWxFrame::OnClose(wxCloseEvent & event)
bool doClose = true;
-#line 177 "DkWxFrame.cpt"
+#line 178 "DkWxFrame.cpt"
if(event.CanVeto()) {
doClose = canClose(iInstances == 1);
} else {
@@ -114,13 +93,13 @@ void DkWxFrame::OnClose(wxCloseEvent & event)
}
if(doClose) {
-#line 183 "DkWxFrame.cpt"
+#line 184 "DkWxFrame.cpt"
/*
For last instance save position.
*/
if(iInstances-- == 1) {
-#line 187 "DkWxFrame.cpt"
+#line 188 "DkWxFrame.cpt"
savePosition();
}
/*
@@ -129,14 +108,14 @@ void DkWxFrame::OnClose(wxCloseEvent & event)
event.Skip();
} else {
-#line 194 "DkWxFrame.cpt"
+#line 195 "DkWxFrame.cpt"
/*
Do not close the window.
*/
event.Veto();
}
-#line 199 "DkWxFrame.cpt"
+#line 200 "DkWxFrame.cpt"
}
@@ -151,9 +130,30 @@ DkWxFrame::restorePosition()
int w; /* Width */
int h; /* Height */
int rs; /* Flag: Attempt to restore size */
+
+
+#line 215 "DkWxFrame.cpt"
p[0] = p[1] = -1;
p[2] = p[3] = p[4] = w = h = 0;
pHelper->retrieveMultipleInts(kwSizePos, p);
+
+
+#line 219 "DkWxFrame.cpt"
+
+
+#line 220 "DkWxFrame.cpt"
+
+
+#line 221 "DkWxFrame.cpt"
+
+
+#line 222 "DkWxFrame.cpt"
+
+
+#line 223 "DkWxFrame.cpt"
+
+
+#line 224 "DkWxFrame.cpt"
if ((0 > p[0]) || (0 > p[1])) {
CentreOnScreen();
} else {
@@ -161,13 +161,14 @@ DkWxFrame::restorePosition()
x = p[0];
y = p[1];
GetSize(&w, &h);
-#if wxCHECK_VERSION(3,0,0)
- rs = 0;
-#else
rs = 1;
-#endif
rs = dk3app_get_pref_bool(pHelper->getApp(), kwRestoreFeatures[2], rs);
- if (0 != rs) {
+
+
+#line 234 "DkWxFrame.cpt"
+ if (0 != rs) {
+
+#line 235 "DkWxFrame.cpt"
if (p[2] > w) { w = p[2]; }
if (p[3] > h) { h = p[3]; }
}
@@ -175,9 +176,37 @@ DkWxFrame::restorePosition()
if ((y + h) >= scsz.GetHeight()) { y = scsz.GetHeight() - h; }
if (0 > x) { x = 0; }
if (0 > y) { y = 0; }
- if (0 != rs) {
+ if (0 != rs) {
+
+#line 243 "DkWxFrame.cpt"
SetSize(x, y, w, h);
- } else {
+#if wxCHECK_VERSION(3,0,0)
+ {
+
+#line 246 "DkWxFrame.cpt"
+ int t1 = 0;
+ int t2 = 0;
+ GetSize(&t1, &t2);
+ if ((t1 > w) || (t2 > h)) {
+
+#line 250 "DkWxFrame.cpt"
+ if (t1 > w) {
+ w = w - (t1 - w);
+
+#line 252 "DkWxFrame.cpt"
+ }
+ if (t2 > h) {
+ h = h - (t2 - h);
+
+#line 255 "DkWxFrame.cpt"
+ }
+ SetSize(x, y, w, h);
+ }
+ }
+#endif
+ } else {
+
+#line 261 "DkWxFrame.cpt"
SetPosition(wxPoint(x, y));
}
if (0 != dk3app_get_pref_bool(pHelper->getApp(), kwRestoreFeatures[0], 0))
@@ -193,6 +222,9 @@ DkWxFrame::restorePosition()
}
}
}
+
+
+#line 277 "DkWxFrame.cpt"
}
@@ -208,49 +240,49 @@ DkWxFrame::restorePosition()
int restoreFeature;
-#line 269 "DkWxFrame.cpt"
+#line 291 "DkWxFrame.cpt"
p[0] = p[1] = p[2] = p[3] p[4] = p[5] = w = h = 0;
if((num = pHelper->retrieveMultipleInts(kwSizePos, p)) >= 4) {
-#line 272 "DkWxFrame.cpt"
+#line 294 "DkWxFrame.cpt"
-#line 273 "DkWxFrame.cpt"
+#line 295 "DkWxFrame.cpt"
-#line 274 "DkWxFrame.cpt"
+#line 296 "DkWxFrame.cpt"
-#line 275 "DkWxFrame.cpt"
+#line 297 "DkWxFrame.cpt"
-#line 276 "DkWxFrame.cpt"
+#line 298 "DkWxFrame.cpt"
-#line 277 "DkWxFrame.cpt"
+#line 299 "DkWxFrame.cpt"
-#line 278 "DkWxFrame.cpt"
+#line 300 "DkWxFrame.cpt"
wxSize scsz = wxGetDisplaySize();
GetSize(&w, &h);
-#line 281 "DkWxFrame.cpt"
+#line 303 "DkWxFrame.cpt"
-#line 282 "DkWxFrame.cpt"
+#line 304 "DkWxFrame.cpt"
-#line 283 "DkWxFrame.cpt"
+#line 305 "DkWxFrame.cpt"
if(w > p[2]) { p[2] = w; }
if(h > p[3]) { p[3] = h; }
-#line 286 "DkWxFrame.cpt"
+#line 308 "DkWxFrame.cpt"
-#line 287 "DkWxFrame.cpt"
+#line 309 "DkWxFrame.cpt"
#if wxCHECK_VERSION(3,0,0)
{
wxSize minSize = GetMinSize();
@@ -264,19 +296,19 @@ DkWxFrame::restorePosition()
if(p[1] < 0) { p[1] = 0; }
-#line 299 "DkWxFrame.cpt"
+#line 321 "DkWxFrame.cpt"
-#line 300 "DkWxFrame.cpt"
+#line 322 "DkWxFrame.cpt"
-#line 301 "DkWxFrame.cpt"
+#line 323 "DkWxFrame.cpt"
-#line 302 "DkWxFrame.cpt"
+#line 324 "DkWxFrame.cpt"
-#line 303 "DkWxFrame.cpt"
+#line 325 "DkWxFrame.cpt"
/* This variant allows to decrease the frame below the minimum size.
*/
#if wxCHECK_VERSION(3,0,0)
@@ -308,7 +340,7 @@ DkWxFrame::restorePosition()
CentreOnScreen();
}
-#line 333 "DkWxFrame.cpt"
+#line 355 "DkWxFrame.cpt"
#else
int x = 0;
int y = 0;
@@ -330,7 +362,7 @@ DkWxFrame::savePosition()
int p[6];
-#line 353 "DkWxFrame.cpt"
+#line 375 "DkWxFrame.cpt"
p[4] = 0;
p[5] = 0;
if(IsIconized()) {
@@ -346,30 +378,30 @@ DkWxFrame::savePosition()
if(pHelper) {
-#line 367 "DkWxFrame.cpt"
+#line 389 "DkWxFrame.cpt"
-#line 368 "DkWxFrame.cpt"
+#line 390 "DkWxFrame.cpt"
-#line 369 "DkWxFrame.cpt"
+#line 391 "DkWxFrame.cpt"
-#line 370 "DkWxFrame.cpt"
+#line 392 "DkWxFrame.cpt"
pHelper->saveMultipleInts(kwSizePos, p);
}
-#line 372 "DkWxFrame.cpt"
+#line 394 "DkWxFrame.cpt"
}
bool
-DkWxFrame::canClose(bool isLast)
+DkWxFrame::canClose(bool WXUNUSED(isLast))
{
-#line 380 "DkWxFrame.cpt"
+#line 402 "DkWxFrame.cpt"
return true;
}
@@ -380,12 +412,12 @@ DkWxFrame::openHelp()
{
-#line 389 "DkWxFrame.cpt"
+#line 411 "DkWxFrame.cpt"
if(helpController) {
helpController->openHelp((wxFrame *)this);
}
-#line 392 "DkWxFrame.cpt"
+#line 414 "DkWxFrame.cpt"
}
@@ -395,13 +427,13 @@ DkWxFrame::openHelpSectionByName(wxString const & name)
{
-#line 400 "DkWxFrame.cpt"
+#line 422 "DkWxFrame.cpt"
if (helpController) {
helpController->openHelpSectionByName((wxFrame *)this, name);
}
-#line 404 "DkWxFrame.cpt"
+#line 426 "DkWxFrame.cpt"
}
@@ -411,12 +443,12 @@ DkWxFrame::openHelpSectionByNumber(int number)
{
-#line 412 "DkWxFrame.cpt"
+#line 434 "DkWxFrame.cpt"
if (helpController) {
helpController->openHelpSectionByNumber((wxFrame *)this, number);
}
-#line 416 "DkWxFrame.cpt"
+#line 438 "DkWxFrame.cpt"
}
diff --git a/support/dktools/DkWxFrame.cpt b/support/dktools/DkWxFrame.cpt
index 329f2d28e3..402264edc9 100644
--- a/support/dktools/DkWxFrame.cpt
+++ b/support/dktools/DkWxFrame.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -114,6 +114,7 @@ class DkWxFrame : public wxFrame
/** @file DkWxFrame.cpp Implementation of DkWxFrame.
*/
+#include "dk3conf.h"
#include "DkWxFrame.h"
@@ -210,9 +211,16 @@ DkWxFrame::restorePosition()
int w; /* Width */
int h; /* Height */
int rs; /* Flag: Attempt to restore size */
+ $? "+ DkWxFrame::restorePosition"
p[0] = p[1] = -1;
p[2] = p[3] = p[4] = w = h = 0;
pHelper->retrieveMultipleInts(kwSizePos, p);
+ $? ". p[0] = %d", p[0]
+ $? ". p[1] = %d", p[1]
+ $? ". p[2] = %d", p[2]
+ $? ". p[3] = %d", p[3]
+ $? ". p[4] = %d", p[4]
+ $? ". p[5] = %d", p[5]
if ((0 > p[0]) || (0 > p[1])) {
CentreOnScreen();
} else {
@@ -220,13 +228,10 @@ DkWxFrame::restorePosition()
x = p[0];
y = p[1];
GetSize(&w, &h);
-#if wxCHECK_VERSION(3,0,0)
- rs = 0;
-#else
rs = 1;
-#endif
rs = dk3app_get_pref_bool(pHelper->getApp(), kwRestoreFeatures[2], rs);
- if (0 != rs) {
+ $? ". rs = %d", rs
+ if (0 != rs) { $? ". correct size"
if (p[2] > w) { w = p[2]; }
if (p[3] > h) { h = p[3]; }
}
@@ -234,9 +239,25 @@ DkWxFrame::restorePosition()
if ((y + h) >= scsz.GetHeight()) { y = scsz.GetHeight() - h; }
if (0 > x) { x = 0; }
if (0 > y) { y = 0; }
- if (0 != rs) {
+ if (0 != rs) { $? ". restore size"
SetSize(x, y, w, h);
- } else {
+#if wxCHECK_VERSION(3,0,0)
+ { $? ". check whether correction"
+ int t1 = 0;
+ int t2 = 0;
+ GetSize(&t1, &t2);
+ if ((t1 > w) || (t2 > h)) { $? ". correction required"
+ if (t1 > w) {
+ w = w - (t1 - w); $? ". width correction required"
+ }
+ if (t2 > h) {
+ h = h - (t2 - h); $? ". height correction required"
+ }
+ SetSize(x, y, w, h);
+ }
+ }
+#endif
+ } else { $? ". restore position"
SetPosition(wxPoint(x, y));
}
if (0 != dk3app_get_pref_bool(pHelper->getApp(), kwRestoreFeatures[0], 0))
@@ -252,6 +273,7 @@ DkWxFrame::restorePosition()
}
}
}
+ $? "- DkWxFrame::restorePosition"
}
@@ -374,7 +396,7 @@ DkWxFrame::savePosition()
bool
-DkWxFrame::canClose(bool isLast)
+DkWxFrame::canClose(bool WXUNUSED(isLast))
{
$? "= DkWxFrame::canClose 1"
return true;
diff --git a/support/dktools/DkWxFrame.h b/support/dktools/DkWxFrame.h
index cb2ee2787f..8007a5457c 100644
--- a/support/dktools/DkWxFrame.h
+++ b/support/dktools/DkWxFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxFrame.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxFrame.cpt
*/
/** @file DkWxFrame.h Header file for the DkWxFrame module.
diff --git a/support/dktools/DkWxHelpController.cpp b/support/dktools/DkWxHelpController.cpp
index 7acf21d5b2..19173d1460 100644
--- a/support/dktools/DkWxHelpController.cpp
+++ b/support/dktools/DkWxHelpController.cpp
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxHelpController.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxHelpController.cpt
*/
/** @file DkWxHelpController.cpp The DkWxHelpController module.
@@ -56,8 +34,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
DkWxHelpController::DkWxHelpController(
DkWxAppHelper *ah,
+#ifdef __WXMSW__
wxChar const *chmName,
+#else
+ wxChar const * WXUNUSED(chmName),
+#endif
+#ifdef __WXMSW__
+ wxChar const * WXUNUSED(htbName)
+#else
wxChar const *htbName
+#endif
)
#ifdef __WXMSW__
#else
@@ -70,11 +56,11 @@ DkWxHelpController::DkWxHelpController(
bFileFound = false;
-#line 120 "DkWxHelpController.cpt"
+#line 128 "DkWxHelpController.cpt"
#ifdef __WXMSW__
-#line 122 "DkWxHelpController.cpt"
+#line 130 "DkWxHelpController.cpt"
if((appHelper) && (chmName)) {
if(appHelper->findDataFile(chmName, fnb, DK3_SIZEOF(fnb,wxChar))) {
hc.Initialize(fnb);
@@ -82,15 +68,21 @@ DkWxHelpController::DkWxHelpController(
}
}
#else
- wxZipFSHandler *zfsh;
+ wxArchiveFSHandler *zfsh = NULL;
-#line 131 "DkWxHelpController.cpt"
+#line 139 "DkWxHelpController.cpt"
if((ah) && (htbName)) {
if(appHelper->findDataFile(htbName, fnb, DK3_SIZEOF(fnb,wxChar))) {
- zfsh = new wxZipFSHandler();
+ zfsh = new wxArchiveFSHandler();
if(zfsh) {
wxFileSystem::AddHandler(zfsh);
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because zfsh is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem
+ destructor, there is no memory leak.
+ */
hc.AddBook(fnb);
bFileFound = true;
}
@@ -99,7 +91,7 @@ DkWxHelpController::DkWxHelpController(
#endif
-#line 143 "DkWxHelpController.cpt"
+#line 157 "DkWxHelpController.cpt"
}
@@ -111,7 +103,7 @@ DkWxHelpController::openHelp(wxFrame *wxf)
wxChar const *msgString;
-#line 153 "DkWxHelpController.cpt"
+#line 167 "DkWxHelpController.cpt"
if(bFileFound) {
hc.DisplayContents();
} else {
@@ -122,7 +114,7 @@ DkWxHelpController::openHelp(wxFrame *wxf)
}
}
-#line 162 "DkWxHelpController.cpt"
+#line 176 "DkWxHelpController.cpt"
}
@@ -134,7 +126,7 @@ DkWxHelpController::openHelpSectionByName(wxFrame *wxf, wxString const & name)
wxChar const *msgString;
-#line 172 "DkWxHelpController.cpt"
+#line 186 "DkWxHelpController.cpt"
if (bFileFound) {
hc.DisplaySection(name);
} else {
@@ -146,7 +138,7 @@ DkWxHelpController::openHelpSectionByName(wxFrame *wxf, wxString const & name)
}
-#line 182 "DkWxHelpController.cpt"
+#line 196 "DkWxHelpController.cpt"
}
@@ -158,7 +150,7 @@ DkWxHelpController::openHelpSectionByNumber(wxFrame *wxf, int number)
wxChar const *msgString;
-#line 192 "DkWxHelpController.cpt"
+#line 206 "DkWxHelpController.cpt"
if (bFileFound) {
hc.DisplaySection(number);
} else {
@@ -168,5 +160,5 @@ DkWxHelpController::openHelpSectionByNumber(wxFrame *wxf, int number)
}
-#line 200 "DkWxHelpController.cpt"
+#line 214 "DkWxHelpController.cpt"
}
diff --git a/support/dktools/DkWxHelpController.cpt b/support/dktools/DkWxHelpController.cpt
index 9a3954ef6b..0fe6947527 100644
--- a/support/dktools/DkWxHelpController.cpt
+++ b/support/dktools/DkWxHelpController.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -104,8 +104,16 @@ $!trace-include
DkWxHelpController::DkWxHelpController(
DkWxAppHelper *ah,
+#ifdef __WXMSW__
wxChar const *chmName,
+#else
+ wxChar const * WXUNUSED(chmName),
+#endif
+#ifdef __WXMSW__
+ wxChar const * WXUNUSED(htbName)
+#else
wxChar const *htbName
+#endif
)
#ifdef __WXMSW__
#else
@@ -126,13 +134,19 @@ DkWxHelpController::DkWxHelpController(
}
}
#else
- wxZipFSHandler *zfsh;
+ wxArchiveFSHandler *zfsh = NULL;
$? ". UNIX variant"
if((ah) && (htbName)) {
if(appHelper->findDataFile(htbName, fnb, DK3_SIZEOF(fnb,wxChar))) {
- zfsh = new wxZipFSHandler();
+ zfsh = new wxArchiveFSHandler();
if(zfsh) {
wxFileSystem::AddHandler(zfsh);
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because zfsh is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem
+ destructor, there is no memory leak.
+ */
hc.AddBook(fnb);
bFileFound = true;
}
diff --git a/support/dktools/DkWxHelpController.h b/support/dktools/DkWxHelpController.h
index 918b3f17ca..dd43c45fe7 100644
--- a/support/dktools/DkWxHelpController.h
+++ b/support/dktools/DkWxHelpController.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxHelpController.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxHelpController.cpt
*/
/** @file DkWxHelpController.h Header file for the DkWxHelpController module.
diff --git a/support/dktools/DkWxHtbApp.cpp b/support/dktools/DkWxHtbApp.cpp
index 5ec60b4ece..caae0f00d4 100644
--- a/support/dktools/DkWxHtbApp.cpp
+++ b/support/dktools/DkWxHtbApp.cpp
@@ -1,50 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxHtbApp.cpt
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxHtbApp.cpt
*/
/** @file DkWxHtbApp.cpp The DkWxHtbApp module.
*/
-#line 59 "DkWxHtbApp.cpt"
+#line 64 "DkWxHtbApp.cpt"
+#include "dk3conf.h"
#include "wxdkhtb.h"
-#line 64 "DkWxHtbApp.cpt"
+#line 70 "DkWxHtbApp.cpt"
@@ -111,7 +90,7 @@ wxT("Failed to create help controller, resources/memory problem!"),
NULL
-#line 148 "DkWxHtbApp.cpt"
+#line 154 "DkWxHtbApp.cpt"
};
@@ -150,7 +129,7 @@ wxT("\n"),
wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."),
/* 10 */
-wxT("http://dktools.sourceforge.net"),
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
/* 11 */
wxT("http://www.wxwidgets.org"),
@@ -176,7 +155,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 208 "DkWxHtbApp.cpt"
+#line 214 "DkWxHtbApp.cpt"
};
@@ -193,14 +172,19 @@ dkT("wxdkhtb.str"),
NULL
-#line 225 "DkWxHtbApp.cpt"
+#line 231 "DkWxHtbApp.cpt"
};
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkWxHtbApp);
+#else
IMPLEMENT_APP(DkWxHtbApp)
+#endif
bool
@@ -211,7 +195,7 @@ DkWxHtbApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchFs = NULL;
bool back = false;
int iStatus = 0;
/* 0 No file name
@@ -241,6 +225,14 @@ DkWxHtbApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -248,6 +240,14 @@ DkWxHtbApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -255,14 +255,29 @@ DkWxHtbApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchFs = new wxArchiveFSHandler();
+ if (NULL != phArchFs) {
+ wxFileSystem::AddHandler(phArchFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
localizedTexts = pHelper->getStringTable(wxdkhtb_texts, wxdkhtb_nl_dk[1]);
if(!(localizedTexts)) { localizedTexts = wxdkhtb_texts; }
@@ -300,8 +315,8 @@ DkWxHtbApp::OnInit()
iStatus
);
if(!(frame)) { ShowMemoryErrorMessage(); goto finished; }
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed. */
diff --git a/support/dktools/DkWxHtbApp.cpt b/support/dktools/DkWxHtbApp.cpt
index b2356787e3..1cfd607030 100644
--- a/support/dktools/DkWxHtbApp.cpt
+++ b/support/dktools/DkWxHtbApp.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -51,12 +51,18 @@ class DkWxHtbApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkWxHtbApp);
+#else
DECLARE_APP(DkWxHtbApp)
+#endif
%% module
+#include "dk3conf.h"
#include "wxdkhtb.h"
@@ -193,7 +199,7 @@ wxdkhtb.htb
# 9 10 11 12 13 14 15: List of libraries used.
#
DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
http://www.wxwidgets.org
http://www.libpng.org/pub/png/libpng.html
http://www.ijg.org
@@ -228,7 +234,12 @@ $!end
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkWxHtbApp);
+#else
IMPLEMENT_APP(DkWxHtbApp)
+#endif
bool
@@ -239,7 +250,7 @@ DkWxHtbApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchFs = NULL;
bool back = false;
int iStatus = 0;
/* 0 No file name
@@ -269,6 +280,14 @@ DkWxHtbApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -276,6 +295,14 @@ DkWxHtbApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -283,14 +310,29 @@ DkWxHtbApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchFs = new wxArchiveFSHandler();
+ if (NULL != phArchFs) {
+ wxFileSystem::AddHandler(phArchFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
localizedTexts = pHelper->getStringTable(wxdkhtb_texts, wxdkhtb_nl_dk[1]);
if(!(localizedTexts)) { localizedTexts = wxdkhtb_texts; }
@@ -328,8 +370,8 @@ DkWxHtbApp::OnInit()
iStatus
);
if(!(frame)) { ShowMemoryErrorMessage(); goto finished; }
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed. */
diff --git a/support/dktools/DkWxHtbApp.h b/support/dktools/DkWxHtbApp.h
index 12a6314fc3..693fce50e6 100644
--- a/support/dktools/DkWxHtbApp.h
+++ b/support/dktools/DkWxHtbApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxHtbApp.cpt
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxHtbApp.cpt
*/
/** @file DkWxHtbApp.h Header file for the DkWxHtbApp module.
@@ -86,7 +64,12 @@ class DkWxHtbApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkWxHtbApp);
+#else
DECLARE_APP(DkWxHtbApp)
+#endif
diff --git a/support/dktools/DkWxHtbFrame.cpp b/support/dktools/DkWxHtbFrame.cpp
index c641b05b60..c19513fb34 100644
--- a/support/dktools/DkWxHtbFrame.cpp
+++ b/support/dktools/DkWxHtbFrame.cpp
@@ -1,65 +1,52 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxHtbFrame.wxc
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxHtbFrame.wxc
*/
/** @file DkWxHtbFrame.cpp The DkWxHtbFrame module.
*/
-#line 182 "DkWxHtbFrame.wxc"
+#line 186 "DkWxHtbFrame.wxc"
+#include "dk3conf.h"
#include "wxdkhtb.h"
#include "dk4verswx.h"
#if !defined(__WXMSW__)
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
#endif
-#line 193 "DkWxHtbFrame.wxc"
+#line 198 "DkWxHtbFrame.wxc"
-BEGIN_EVENT_TABLE(DkWxHtbFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxHtbFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkWxHtbFrame,wxFrame)
+#endif
EVT_MENU(DkWxHtbFrame_Quit, DkWxHtbFrame::OnQuit)
EVT_MENU(DkWxHtbFrame_Help_About, DkWxHtbFrame::OnAbout)
EVT_MENU(DkWxHtbFrame_Help_Contents, DkWxHtbFrame::OnHelpContents)
EVT_IDLE(DkWxHtbFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -72,13 +59,13 @@ static wxChar const wxdkhtb_versnumber[] = {
-#line 214 "DkWxHtbFrame.wxc"
+#line 227 "DkWxHtbFrame.wxc"
DkWxHtbFrame::DkWxHtbFrame(
int wxid,
DkWxAppHelper *applicationHelper,
wxHtmlHelpController *hc,
- int argc,
- wxChar **argv,
+ int WXUNUSED(argc),
+ wxChar ** WXUNUSED(argv),
wxChar const * const *localizedTexts,
wxChar const * const *nlWx,
dkChar const * const *nlDk,
@@ -215,17 +202,14 @@ DkWxHtbFrame::DkWxHtbFrame(
mainSizer->SetSizeHints(this);
}
-#line 238 "DkWxHtbFrame.wxc"
+#line 251 "DkWxHtbFrame.wxc"
if(dkctGUILayoutOK) {
SetTitle(nlWx[0]);
-#if 0
- restorePosition();
-#endif
}
}
-#line 247 "DkWxHtbFrame.wxc"
+#line 257 "DkWxHtbFrame.wxc"
@@ -236,7 +220,7 @@ DkWxHtbFrame::~DkWxHtbFrame()
bool
-DkWxHtbFrame::canClose(bool isLast)
+DkWxHtbFrame::canClose(bool WXUNUSED(isLast))
{
bool back = true;
return back;
@@ -244,7 +228,7 @@ DkWxHtbFrame::canClose(bool isLast)
void
-DkWxHtbFrame::OnQuit(wxCommandEvent & event)
+DkWxHtbFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
Close();
}
@@ -252,7 +236,7 @@ DkWxHtbFrame::OnQuit(wxCommandEvent & event)
void
-DkWxHtbFrame::OnAbout(wxCommandEvent & event)
+DkWxHtbFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
@@ -304,7 +288,7 @@ DkWxHtbFrame::OnAbout(wxCommandEvent & event)
void
-DkWxHtbFrame::OnHelpContents(wxCommandEvent & event)
+DkWxHtbFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
#if 0
openHelp();
diff --git a/support/dktools/DkWxHtbFrame.h b/support/dktools/DkWxHtbFrame.h
index 090b52f361..6a0f074cac 100644
--- a/support/dktools/DkWxHtbFrame.h
+++ b/support/dktools/DkWxHtbFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxHtbFrame.wxc
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxHtbFrame.wxc
*/
/** @file DkWxHtbFrame.h Header file for the DkWxHtbFrame module.
@@ -51,7 +29,11 @@ class DkWxHtbFrame : public DkWxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -142,7 +124,7 @@ class DkWxHtbFrame : public DkWxFrame
wxStaticText *lDummy;
-#line 115 "DkWxHtbFrame.wxc"
+#line 119 "DkWxHtbFrame.wxc"
public:
@@ -208,7 +190,7 @@ class DkWxHtbFrame : public DkWxFrame
};
-#line 180 "DkWxHtbFrame.wxc"
+#line 184 "DkWxHtbFrame.wxc"
#endif
diff --git a/support/dktools/DkWxHtbFrame.wxc b/support/dktools/DkWxHtbFrame.wxc
index f0a807e233..bcc7f8cb8e 100644
--- a/support/dktools/DkWxHtbFrame.wxc
+++ b/support/dktools/DkWxHtbFrame.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -79,7 +79,11 @@ class DkWxHtbFrame : public DkWxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -180,11 +184,12 @@ class DkWxHtbFrame : public DkWxFrame
%% module start
+#include "dk3conf.h"
#include "wxdkhtb.h"
#include "dk4verswx.h"
#if !defined(__WXMSW__)
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
#endif
@@ -193,12 +198,20 @@ $!trace-include
-BEGIN_EVENT_TABLE(DkWxHtbFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxHtbFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkWxHtbFrame,wxFrame)
+#endif
EVT_MENU(DkWxHtbFrame_Quit, DkWxHtbFrame::OnQuit)
EVT_MENU(DkWxHtbFrame_Help_About, DkWxHtbFrame::OnAbout)
EVT_MENU(DkWxHtbFrame_Help_Contents, DkWxHtbFrame::OnHelpContents)
EVT_IDLE(DkWxHtbFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -215,8 +228,8 @@ DkWxHtbFrame::DkWxHtbFrame(
int wxid,
DkWxAppHelper *applicationHelper,
wxHtmlHelpController *hc,
- int argc,
- wxChar **argv,
+ int WXUNUSED(argc),
+ wxChar ** WXUNUSED(argv),
wxChar const * const *localizedTexts,
wxChar const * const *nlWx,
dkChar const * const *nlDk,
@@ -237,9 +250,6 @@ DkWxHtbFrame::DkWxHtbFrame(
%% constructor end
if(dkctGUILayoutOK) {
SetTitle(nlWx[0]);
-#if 0
- restorePosition();
-#endif
}
}
@@ -254,7 +264,7 @@ DkWxHtbFrame::~DkWxHtbFrame()
bool
-DkWxHtbFrame::canClose(bool isLast)
+DkWxHtbFrame::canClose(bool WXUNUSED(isLast))
{
bool back = true;
return back;
@@ -262,7 +272,7 @@ DkWxHtbFrame::canClose(bool isLast)
void
-DkWxHtbFrame::OnQuit(wxCommandEvent & event)
+DkWxHtbFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
Close();
}
@@ -270,7 +280,7 @@ DkWxHtbFrame::OnQuit(wxCommandEvent & event)
void
-DkWxHtbFrame::OnAbout(wxCommandEvent & event)
+DkWxHtbFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
@@ -322,7 +332,7 @@ DkWxHtbFrame::OnAbout(wxCommandEvent & event)
void
-DkWxHtbFrame::OnHelpContents(wxCommandEvent & event)
+DkWxHtbFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
#if 0
openHelp();
diff --git a/support/dktools/DkWxImgszApp.cpp b/support/dktools/DkWxImgszApp.cpp
deleted file mode 100644
index 4b42f9c4b1..0000000000
--- a/support/dktools/DkWxImgszApp.cpp
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxImgszApp.cpt
-*/
-
-/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file DkWxImgszApp.cpp The DkWxImgszApp module.
-*/
-
-
-#line 47 "DkWxImgszApp.cpt"
-
-
-#include "wximgsz.h"
-
-
-
-
-
-#line 54 "DkWxImgszApp.cpt"
-
-
-
-IMPLEMENT_APP(DkWxImgszApp)
-
-
-
-/** Application group name.
-*/
-static dkChar const wximgsz_group_name[] = { dkT("dktools") };
-
-
-
-/** File name for string table.
-*/
-static dkChar const wximgsz_string_table_name[] = { dkT("wximgsz.str") };
-
-
-
-/** Help file name on Windows.
-*/
-static wxChar const wximgsz_chm_helpfile[] = {
- wxT("wximgsz.chm")
-};
-
-
-
-/** Help file name for other platforms.
-*/
-static wxChar const wximgsz_htb_helpfile[] = {
- wxT("wximgsz.htb")
-};
-
-
-
-/** Default texts to use if no localized texts are found.
-*/
-static wxChar const * const wximgsz_default_texts[] = {
-/* 0 */
-wxT("wximgsz"),
-
-/* 1 */
-wxT("File"),
-
-/* 2 */
-wxT("Exit"),
-
-/* 3 */
-wxT("Width"),
-
-/* 4 */
-wxT("Height"),
-
-/* 5 */
-wxT("Factor"),
-
-/* 6 */
-wxT("Original image"),
-
-/* 7 */
-wxT("Results"),
-
-/* 8 */
-wxT("Width:"),
-
-/* 9 */
-wxT("Height:"),
-
-/* 10 */
-wxT("Intended change"),
-
-/* 11 */
-wxT("Action:"),
-
-/* 12 */
-wxT("Decrease image"),
-
-/* 13 */
-wxT("Width range"),
-
-/* 14 */
-wxT("Height range"),
-
-/* 15 */
-wxT("Minimum:"),
-
-/* 16 */
-wxT("Maximum:"),
-
-/* 17 */
-wxT(">>>"),
-
-/* 18 */
-wxT(""),
-
-/* 19 */
-wxT("Exit the application"),
-
-/* 20 */
-wxT("Enter original image width (positive integer number)."),
-
-/* 21 */
-wxT("Enter original image height (positive integer number)."),
-
-/* 22 */
-wxT("Choose modification action."),
-
-/* 23 */
-wxT("Inter intended minimum for image width or height (positive integer number)."),
-
-/* 24 */
-wxT("Enter intended maximum for image width or height (positive integer number)."),
-
-/* 25 */
-wxT("Calculate new image sizes."),
-
-/* 26 */
-wxT(" "),
-
-/* 27 */
-wxT("Help"),
-
-/* 28 */
-wxT("Contents"),
-
-/* 29 */
-wxT("About..."),
-
-/* 30 */
-wxT("Open table of contents"),
-
-/* 31 */
-wxT("Show version number dialog box"),
-
-/* 32 */
-wxT("Incorrect input"),
-
-/* 33 */
-wxT("Please enter a positive integer number."),
-
-/* 34 */
-wxT("No results found!"),
-
-/* 35 */
-wxT("About wximgsz"),
-
-/* 36 */
-wxT("++"),
-
-/* 37 */
-wxT("+"),
-
-/* 38 */
-wxT("Extras"),
-
-/* 39 */
-wxT("Options"),
-
-/* 40 */
-wxT("Set options"),
-
-/* 41 */
-wxT("Options"),
-
-/* 42 */
-wxT("Background colour for scale factor"),
-
-/* 43 */
-wxT("Indicate scale factor quality by background colour (otherwise in extra column)."),
-
-/* 44 */
-wxT("OK"),
-
-/* 45 */
-wxT("Cancel"),
-
-/* 46 */
-wxT("Apply settings and exit dialog."),
-
-/* 47 */
-wxT("Skip settings and exit dialog."),
-
-/* 48 */
-wxT("Choose input bitmap image to open"),
-
-/* 49 */
-wxT("Open\tAlt-O"),
-
-/* 50 */
-wxT("Retrieve dimensions from bitmap image file."),
-
-/* 51 */
-wxT("Failed to load image file!\nFile probably damaged or not a supported image type."),
-
-/* 52 */
-wxT("Failed to load image!"),
-
-/* 53 */
-wxT("\n"),
-
-/* 54 */
-wxT("This program uses libraries from the following projects:\n"),
-
-/* 55 */
-wxT("See:\n"),
-
-NULL
-
-
-#line 318 "DkWxImgszApp.cpt"
-};
-
-
-
-/** Constant texts, not localized.
-*/
-static wxChar const * const wximgsz_nl_wx[] = {
-/* 0 */
-wxT("Error"),
-
-/* 1 */
-wxT("Not enough memory (RAM)!"),
-
-NULL
-
-
-#line 329 "DkWxImgszApp.cpt"
-};
-
-
-
-bool
-DkWxImgszApp::OnInit()
-{
- wxChar const * const *lt = NULL; /* Localized texts. */
- DkWxImgszFrame *frame = NULL;
- wxZipFSHandler *phZipFs = NULL;
- bool back = false;
-
-
-#line 341 "DkWxImgszApp.cpt"
-
- /* Initialize elements.
- */
- pHelper = NULL;
- pHelpController = NULL;
-
- /* Get elements.
- */
- pHelper =
- new DkWxAppHelper(argv[0], wximgsz_default_texts[0], wximgsz_group_name);
- if (NULL == pHelper) {
- ShowMemoryErrorMessage();
- goto finished;
- }
- if (!(pHelper->checkSetup())) {
- goto finished;
- }
- lt =
- pHelper->getStringTable(wximgsz_default_texts, wximgsz_string_table_name);
- if (NULL == lt) {
- ShowMemoryErrorMessage();
- goto finished;
- }
-
- /* Add image and zip fs handler.
- */
- wxInitAllImageHandlers();
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
- } else {
- ShowMemoryErrorMessage();
- goto finished;
- }
-
- /* Get help controller
- */
- pHelpController =
- new DkWxHelpController(pHelper, wximgsz_chm_helpfile, wximgsz_htb_helpfile);
- if (NULL == pHelpController) {
- ShowMemoryErrorMessage();
- goto finished;
- }
-
- /* Create frame.
- */
- frame = new DkWxImgszFrame(
- wximgsz_default_texts[0], lt, pHelper, pHelpController,
- DkWxImgsz_MainWindow, argc, argv
- );
- if (NULL == frame) {
- ShowMemoryErrorMessage();
- goto finished;
- }
-
- /* Show frame and indicate success.
- */
- frame->Show();
- frame->restorePosition();
- back = true;
-
- finished:
- if (!(back)) {
- if (NULL != pHelpController) {
- delete(pHelpController);
- pHelpController = NULL;
- }
- if (NULL != pHelper) {
- delete(pHelper);
- pHelper = NULL;
- }
- }
- return back;
-}
-
-
-
-int
-DkWxImgszApp::OnExit()
-{
- int back = 0;
- if(pHelpController) {
- delete(pHelpController); pHelpController = NULL;
- }
- if(pHelper) {
- delete(pHelper); pHelper = NULL;
- }
-
-
-#line 429 "DkWxImgszApp.cpt"
- return back;
-}
-
-
-
-void
-DkWxImgszApp::ShowMemoryErrorMessage(void)
-{
- const wxChar *s_title = NULL;
- const wxChar *s_text = NULL;
-
- if (NULL != pHelper) {
- s_title = pHelper->getBasicString(3);
- s_text = pHelper->getBasicString(9);
- }
- if (NULL == s_title) {
- s_title = wximgsz_nl_wx[0];
- }
- if (NULL == s_text) {
- s_text = wximgsz_nl_wx[1];
- }
- wxMessageBox(s_text, s_title, (wxOK | wxCENTRE | wxICON_ERROR));
-}
-
diff --git a/support/dktools/DkWxImgszApp.cpt b/support/dktools/DkWxImgszApp.cpt
deleted file mode 100644
index d950f74fc0..0000000000
--- a/support/dktools/DkWxImgszApp.cpt
+++ /dev/null
@@ -1,452 +0,0 @@
-%% options
-
-copyright owner = Dirk Krause
-copyright year = 2012-xxxx
-license = bsd
-
-%% header
-
-
-
-/** Application class for the wximgsz program.
-*/
-class DkWxImgszApp : public wxApp
-{
- protected:
- /** Application helper.
- */
- DkWxAppHelper *pHelper;
-
- /** Controller for online-help.
- */
- DkWxHelpController *pHelpController;
-
- protected:
-
- /** Show error message if there is not sufficient memory available.
- */
- void
- ShowMemoryErrorMessage(void);
-
- public:
- /** Initialize application.
- @return True on success (can run), false on error (abort).
- */
- virtual bool OnInit();
-
- /** Clean up after running.
- @return Exit status code.
- */
- virtual int OnExit();
-};
-
-DECLARE_APP(DkWxImgszApp)
-
-
-%% module
-
-
-#include "wximgsz.h"
-
-
-
-$!trace-include
-
-
-
-IMPLEMENT_APP(DkWxImgszApp)
-
-
-
-/** Application group name.
-*/
-static dkChar const wximgsz_group_name[] = { dkT("dktools") };
-
-
-
-/** File name for string table.
-*/
-static dkChar const wximgsz_string_table_name[] = { dkT("wximgsz.str") };
-
-
-
-/** Help file name on Windows.
-*/
-static wxChar const wximgsz_chm_helpfile[] = {
- wxT("wximgsz.chm")
-};
-
-
-
-/** Help file name for other platforms.
-*/
-static wxChar const wximgsz_htb_helpfile[] = {
- wxT("wximgsz.htb")
-};
-
-
-
-/** Default texts to use if no localized texts are found.
-*/
-static wxChar const * const wximgsz_default_texts[] = {
-$!string-table macro=wxT
-#
-# 0 Program name.
-#
-wximgsz
-#
-# 1 Menu name: File
-#
-File
-#
-# 2 Menu item: File => Exit
-#
-Exit
-#
-# 3 Data grid column head: Width
-#
-Width
-#
-# 4 Data grid column head: Height
-#
-Height
-#
-# 5 Data grid column head: Factor
-#
-Factor
-#
-# 6 Label text: Original image
-#
-Original image
-#
-# 7 Label text: Results
-#
-Results
-#
-# 8 Label text: Width:
-#
-Width:
-#
-# 9 Label text: Height:
-#
-Height:
-#
-# 10 Label text: Intended change
-#
-Intended change
-#
-# 11 Label text: Action:
-#
-Action:
-#
-# 12 Choice: Decrease image
-#
-Decrease image
-#
-# 13 Choice: Width range
-#
-Width range
-#
-# 14 Choice: Height range
-#
-Height range
-#
-# 15 Label: Minimum:
-#
-Minimum:
-#
-# 16 Label: Maximum:
-#
-Maximum:
-#
-# 17 Button label: Run
-#
->>>
-#
-# 18 Empty text for initial status
-#
-
-#
-# 19 Tooltip: Exit the application
-#
-Exit the application
-#
-# 20 Tooltip: Specify original image width
-#
-Enter original image width (positive integer number).
-#
-# 21 Tooltip: Specify original image height
-#
-Enter original image height (positive integer number).
-#
-# 22 Tooltip: Choose type of modification
-#
-Choose modification action.
-#
-# 23 Tooltip: Specify intended minimum for image width or height
-#
-Inter intended minimum for image width or height (positive integer number).
-#
-# 24 Tooltip: Specify intended maximum for image width or height
-#
-Enter intended maximum for image width or height (positive integer number).
-#
-# 25 Tooltip: Calculate new image sizes
-#
-Calculate new image sizes.
-#
-# 26 Spaces to initialize text fields
-#
-
-#
-# 27 Menu: Help
-#
-Help
-#
-# 28 Menu item: Contents
-#
-Contents
-#
-# 29 Menu item: About
-#
-About...
-#
-# 30 Menu tip: Open table of contents
-#
-Open table of contents
-#
-# 31 Menu tip: Show version number dialog box
-#
-Show version number dialog box
-#
-# 32 Error message title: Incorrect input
-#
-Incorrect input
-#
-# 33 Error message text: Please enter a postivie integer number.
-#
-Please enter a positive integer number.
-#
-# 34 Status message: No results found!
-#
-No results found!
-#
-# 35
-#
-About wximgsz
-#
-# 36 Indicator for best quality
-#
-++
-#
-# 37 Indicator for good quality
-#
-+
-#
-# 38 Menu: Extras
-#
-Extras
-#
-# 39 Menu item: Options
-#
-Options
-#
-# 40 Tip: Set options
-#
-Set options
-#
-# 41 Dialog box title: Options
-#
-Options
-#
-# 42 Checkbox text: Choose background color by scale factor quality
-#
-Background colour for scale factor
-#
-# 43 Tooltip text: Indicate scale factor quality by background colour.
-#
-Indicate scale factor quality by background colour (otherwise in extra column).
-#
-# 44 Button: OK
-#
-OK
-#
-# 45 Button: Cancel
-#
-Cancel
-#
-# 46 Tool tip text: Apply settings and exit dialog.
-#
-Apply settings and exit dialog.
-#
-# 47 Tool tip text: Skip settings and exit dialog.
-#
-Skip settings and exit dialog.
-#
-# 48
-#
-Choose input bitmap image to open
-#
-# 49
-#
-Open Alt-O
-#
-# 50
-#
-Retrieve dimensions from bitmap image file.
-#
-# 51
-#
-Failed to load image file!\nFile probably damaged or not a supported image type.
-#
-# 52
-#
-Failed to load image!
-#
-# 53
-#
-\n
-#
-# 54
-#
-This program uses libraries from the following projects:\n
-#
-# 55
-#
-See:\n
-$!end
-};
-
-
-
-/** Constant texts, not localized.
-*/
-static wxChar const * const wximgsz_nl_wx[] = {
-$!string-table macro=wxT
-Error
-Not enough memory (RAM)!
-$!end
-};
-
-
-
-bool
-DkWxImgszApp::OnInit()
-{
- wxChar const * const *lt = NULL; /* Localized texts. */
- DkWxImgszFrame *frame = NULL;
- wxZipFSHandler *phZipFs = NULL;
- bool back = false;
- $!trace-init wximgsz.deb
-
- /* Initialize elements.
- */
- pHelper = NULL;
- pHelpController = NULL;
-
- /* Get elements.
- */
- pHelper =
- new DkWxAppHelper(argv[0], wximgsz_default_texts[0], wximgsz_group_name);
- if (NULL == pHelper) {
- ShowMemoryErrorMessage();
- goto finished;
- }
- if (!(pHelper->checkSetup())) {
- goto finished;
- }
- lt =
- pHelper->getStringTable(wximgsz_default_texts, wximgsz_string_table_name);
- if (NULL == lt) {
- ShowMemoryErrorMessage();
- goto finished;
- }
-
- /* Add image and zip fs handler.
- */
- wxInitAllImageHandlers();
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
- } else {
- ShowMemoryErrorMessage();
- goto finished;
- }
-
- /* Get help controller
- */
- pHelpController =
- new DkWxHelpController(pHelper, wximgsz_chm_helpfile, wximgsz_htb_helpfile);
- if (NULL == pHelpController) {
- ShowMemoryErrorMessage();
- goto finished;
- }
-
- /* Create frame.
- */
- frame = new DkWxImgszFrame(
- wximgsz_default_texts[0], lt, pHelper, pHelpController,
- DkWxImgsz_MainWindow, argc, argv
- );
- if (NULL == frame) {
- ShowMemoryErrorMessage();
- goto finished;
- }
-
- /* Show frame and indicate success.
- */
- frame->Show();
- frame->restorePosition();
- back = true;
-
- finished:
- if (!(back)) {
- if (NULL != pHelpController) {
- delete(pHelpController);
- pHelpController = NULL;
- }
- if (NULL != pHelper) {
- delete(pHelper);
- pHelper = NULL;
- }
- }
- return back;
-}
-
-
-
-int
-DkWxImgszApp::OnExit()
-{
- int back = 0;
- if(pHelpController) {
- delete(pHelpController); pHelpController = NULL;
- }
- if(pHelper) {
- delete(pHelper); pHelper = NULL;
- }
- $!trace-end
- return back;
-}
-
-
-
-void
-DkWxImgszApp::ShowMemoryErrorMessage(void)
-{
- const wxChar *s_title = NULL;
- const wxChar *s_text = NULL;
-
- if (NULL != pHelper) {
- s_title = pHelper->getBasicString(3);
- s_text = pHelper->getBasicString(9);
- }
- if (NULL == s_title) {
- s_title = wximgsz_nl_wx[0];
- }
- if (NULL == s_text) {
- s_text = wximgsz_nl_wx[1];
- }
- wxMessageBox(s_text, s_title, (wxOK | wxCENTRE | wxICON_ERROR));
-}
-
diff --git a/support/dktools/DkWxImgszFrame.cpp b/support/dktools/DkWxImgszFrame.cpp
deleted file mode 100644
index 07267945fa..0000000000
--- a/support/dktools/DkWxImgszFrame.cpp
+++ /dev/null
@@ -1,1075 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxImgszFrame.wxc
-*/
-
-/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file DkWxImgszFrame.cpp The DkWxImgszFrame module.
-*/
-
-
-#line 374 "DkWxImgszFrame.wxc"
-
-#include "wximgsz.h"
-#include "dkicon.xpm"
-#include "dk4verswx.h"
-#include "run2.xpm"
-
-
-
-#line 381 "DkWxImgszFrame.wxc"
-
-
-
-/** Event table for the DkWxImgszFrame class.
-*/
-BEGIN_EVENT_TABLE(DkWxImgszFrame, wxFrame)
- EVT_MENU(DkWxImgsz_Quit, DkWxImgszFrame::OnQuit)
- EVT_MENU(DkWxImgsz_Help, DkWxImgszFrame::OnHelp)
- EVT_MENU(DkWxImgsz_About, DkWxImgszFrame::OnAbout)
- EVT_MENU(DkWxImgsz_Options, DkWxImgszFrame::OnOptions)
- EVT_MENU(DkWxImgsz_Open, DkWxImgszFrame::OnOpen)
- EVT_BUTTON(DkWxImgsz_Run, DkWxImgszFrame::OnRun)
- EVT_CHOICE(DkWxImgsz_Choice, DkWxImgszFrame::OnChoice)
-END_EVENT_TABLE()
-
-
-
-
-#line 399 "DkWxImgszFrame.wxc"
-
-DkWxImgszFrame::DkWxImgszFrame(
- wxChar const *applicationName,
- wxChar const * const *localizedMessages,
- DkWxAppHelper *applicationHelper,
- DkWxHelpController *helpController,
- int wxid,
- int argc,
- wxChar **argv
-) : DkWxFrame(applicationName, applicationHelper, helpController, wxid),
- cRed(255, 91, 91),
- cNotSoDarkRed(127, 0, 0),
- cGreen(127, 255, 127),
- cBlack(0, 0, 0),
- cDarkRed(63, 0, 0),
- cYellow(255, 255, 0),
- sCurrentDir(wxT(""))
-{
- /*
- Icon for main window.
- */
-#if defined(__WXMSW__)
- wxIcon dkicon_bitmap(wxT("aaaaa"));
-#else
- wxIcon dkicon_bitmap(xpm_dkicon);
-#endif
- wxIcon run2_bitmap(xpm_run2);
- fdx = -1; fdy = -1;
- odx = -1; ody = -1;
- sTexts = localizedMessages;
- wxString saAction[] = {
- wxString(localizedMessages[12]),
- wxString(localizedMessages[13]),
- wxString(localizedMessages[14])
- };
- bUseColour = true;
- dkctGUILayoutOK = false;
- dkctGUIContentsPanel = NULL;
- mbMain = NULL;
- mainSizer = NULL;
- mFile = NULL;
- mExtras = NULL;
- mHelp = NULL;
- miOpen = NULL;
- miExit = NULL;
- miOptions = NULL;
- miHelpContents = NULL;
- miHelpAbout = NULL;
- horizontalSizer = NULL;
- statusSizer = NULL;
- inputDataSizer = NULL;
- bCalculate = NULL;
- outputDataSizer = NULL;
- lOriginalImage = NULL;
- lWidth = NULL;
- tWidth = NULL;
- lHeight = NULL;
- tHeight = NULL;
- lChangeType = NULL;
- lAction = NULL;
- cbAction = NULL;
- lMinimum = NULL;
- tMinimum = NULL;
- lMaximum = NULL;
- tMaximum = NULL;
- lResults = NULL;
- dataGrid = NULL;
- lStatus = NULL;
- dkctGUIContentsPanel = new wxPanel(this);
- if(!(dkctGUIContentsPanel)) {
- goto dkctGUILayoutFinished;
- }
-#if wxUSE_MENUS
- mbMain = new wxMenuBar(
- );
- if(!(mbMain)) {
- goto dkctGUILayoutFinished;
- }
- mFile = new wxMenu(
- );
- if(!(mFile)) {
- goto dkctGUILayoutFinished;
- }
- miOpen = mFile->Append(
- DkWxImgsz_Open,
- sTexts[49],
- sTexts[50]
- );
- if(!(miOpen)) {
- goto dkctGUILayoutFinished;
- }
- miExit = mFile->Append(
- DkWxImgsz_Quit,
- sTexts[2],
- sTexts[19]
- );
- if(!(miExit)) {
- goto dkctGUILayoutFinished;
- }
- mbMain->Append(mFile, sTexts[1]);
- mExtras = new wxMenu(
- );
- if(!(mExtras)) {
- goto dkctGUILayoutFinished;
- }
- miOptions = mExtras->Append(
- DkWxImgsz_Options,
- sTexts[39],
- sTexts[40]
- );
- if(!(miOptions)) {
- goto dkctGUILayoutFinished;
- }
- mbMain->Append(mExtras, sTexts[38]);
- mHelp = new wxMenu(
- );
- if(!(mHelp)) {
- goto dkctGUILayoutFinished;
- }
- miHelpContents = mHelp->Append(
- DkWxImgsz_Help,
- sTexts[28],
- sTexts[30]
- );
- if(!(miHelpContents)) {
- goto dkctGUILayoutFinished;
- }
- miHelpAbout = mHelp->Append(
- DkWxImgsz_About,
- sTexts[29],
- sTexts[31]
- );
- if(!(miHelpAbout)) {
- goto dkctGUILayoutFinished;
- }
- mbMain->Append(mHelp, sTexts[27]);
- SetMenuBar(mbMain);
-#endif
- mainSizer = new wxBoxSizer(
- wxVERTICAL
- );
- if(!(mainSizer)) {
- goto dkctGUILayoutFinished;
- }
- mainSizer->Add(10, 10, 0);
- horizontalSizer = new wxBoxSizer(
- wxHORIZONTAL
- );
- if(!(horizontalSizer)) {
- goto dkctGUILayoutFinished;
- }
- horizontalSizer->Add(10, 10, 0);
- inputDataSizer = new wxGridBagSizer(
- 5, 5
- );
- if(!(inputDataSizer)) {
- goto dkctGUILayoutFinished;
- }
- lOriginalImage = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[6]
- );
- if(!(lOriginalImage)) {
- goto dkctGUILayoutFinished;
- }
- inputDataSizer->Add(
- lOriginalImage,
- wxGBPosition(0, 0),
- wxGBSpan(1, 2),
- wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
- );
- lWidth = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[8]
- );
- if(!(lWidth)) {
- goto dkctGUILayoutFinished;
- }
- inputDataSizer->Add(
- lWidth,
- wxGBPosition(1, 0),
- wxGBSpan(1, 1),
- wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
- );
- tWidth = new wxTextCtrl(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[26]
- );
- if(!(tWidth)) {
- goto dkctGUILayoutFinished;
- }
- tWidth->SetToolTip(sTexts[20]);
- inputDataSizer->Add(
- tWidth,
- wxGBPosition(1, 1),
- wxGBSpan(1, 1),
- wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
- );
- lHeight = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[9]
- );
- if(!(lHeight)) {
- goto dkctGUILayoutFinished;
- }
- inputDataSizer->Add(
- lHeight,
- wxGBPosition(2, 0),
- wxGBSpan(1, 1),
- wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
- );
- tHeight = new wxTextCtrl(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[26]
- );
- if(!(tHeight)) {
- goto dkctGUILayoutFinished;
- }
- tHeight->SetToolTip(sTexts[21]);
- inputDataSizer->Add(
- tHeight,
- wxGBPosition(2, 1),
- wxGBSpan(1, 1),
- wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
- );
- inputDataSizer->Add(10, 10, wxGBPosition(3, 0), wxGBSpan(1, 1));
- lChangeType = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[10]
- );
- if(!(lChangeType)) {
- goto dkctGUILayoutFinished;
- }
- inputDataSizer->Add(
- lChangeType,
- wxGBPosition(4, 0),
- wxGBSpan(1, 2),
- wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
- );
- lAction = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[11]
- );
- if(!(lAction)) {
- goto dkctGUILayoutFinished;
- }
- inputDataSizer->Add(
- lAction,
- wxGBPosition(5, 0),
- wxGBSpan(1, 1),
- wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
- );
- cbAction = new wxChoice(
- dkctGUIContentsPanel,
- DkWxImgsz_Choice,
- wxDefaultPosition,
- wxDefaultSize,
- 3,
- saAction
- );
- if(!(cbAction)) {
- goto dkctGUILayoutFinished;
- }
- cbAction->SetToolTip(sTexts[22]);
- inputDataSizer->Add(
- cbAction,
- wxGBPosition(5, 1),
- wxGBSpan(1, 1),
- wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
- );
- lMinimum = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[15]
- );
- if(!(lMinimum)) {
- goto dkctGUILayoutFinished;
- }
- inputDataSizer->Add(
- lMinimum,
- wxGBPosition(6, 0),
- wxGBSpan(1, 1),
- wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
- );
- tMinimum = new wxTextCtrl(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[26]
- );
- if(!(tMinimum)) {
- goto dkctGUILayoutFinished;
- }
- tMinimum->SetToolTip(sTexts[23]);
- inputDataSizer->Add(
- tMinimum,
- wxGBPosition(6, 1),
- wxGBSpan(1, 1),
- wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
- );
- lMaximum = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[16]
- );
- if(!(lMaximum)) {
- goto dkctGUILayoutFinished;
- }
- inputDataSizer->Add(
- lMaximum,
- wxGBPosition(7, 0),
- wxGBSpan(1, 1),
- wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
- );
- tMaximum = new wxTextCtrl(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[26]
- );
- if(!(tMaximum)) {
- goto dkctGUILayoutFinished;
- }
- tMaximum->SetToolTip(sTexts[24]);
- inputDataSizer->Add(
- tMaximum,
- wxGBPosition(7, 1),
- wxGBSpan(1, 1),
- wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
- );
- horizontalSizer->Add(
- inputDataSizer,
- 0,
- wxALIGN_LEFT|wxALIGN_TOP
- );
- horizontalSizer->Add(10, 10, 0);
- bCalculate = new wxBitmapButton(
- dkctGUIContentsPanel,
- DkWxImgsz_Run,
- run2_bitmap
- );
- if(!(bCalculate)) {
- goto dkctGUILayoutFinished;
- }
- bCalculate->SetToolTip(sTexts[25]);
- horizontalSizer->Add(
- bCalculate,
- 0,
- wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
- );
- horizontalSizer->Add(10, 10, 0);
- outputDataSizer = new wxGridBagSizer(
- 5, 5
- );
- if(!(outputDataSizer)) {
- goto dkctGUILayoutFinished;
- }
- lResults = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[7]
- );
- if(!(lResults)) {
- goto dkctGUILayoutFinished;
- }
- outputDataSizer->Add(
- lResults,
- wxGBPosition(0, 0),
- wxGBSpan(1, 2),
- wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
- );
- dataGrid = new wxGrid(
- dkctGUIContentsPanel,
- wxID_ANY
- );
- if(!(dataGrid)) {
- goto dkctGUILayoutFinished;
- }
- dataGrid->CreateGrid(16, 4);
- dataGrid->SetColLabelValue(0, sTexts[3]);
- dataGrid->SetColLabelValue(1, sTexts[4]);
- dataGrid->SetColLabelValue(2, sTexts[5]);
- dataGrid->SetColLabelValue(3, sTexts[18]);
- dataGrid->EnableEditing(false);
- dataGrid->SetMinSize(wxSize(300, 200));
- outputDataSizer->Add(
- dataGrid,
- wxGBPosition(1, 0),
- wxGBSpan(2, 2),
- wxALIGN_LEFT|wxALIGN_TOP|wxGROW
- );
- outputDataSizer->AddGrowableRow(2);
- outputDataSizer->AddGrowableCol(1);
- horizontalSizer->Add(
- outputDataSizer,
- 1,
- wxALIGN_LEFT|wxALIGN_TOP|wxGROW
- );
- horizontalSizer->Add(10, 10, 0);
- mainSizer->Add(
- horizontalSizer,
- 1,
- wxGROW
- );
- mainSizer->Add(10, 10, 0);
- statusSizer = new wxBoxSizer(
- wxHORIZONTAL
- );
- if(!(statusSizer)) {
- goto dkctGUILayoutFinished;
- }
- statusSizer->Add(10, 10, 0);
- lStatus = new wxStaticText(
- dkctGUIContentsPanel,
- wxID_ANY,
- sTexts[18]
- );
- if(!(lStatus)) {
- goto dkctGUILayoutFinished;
- }
- statusSizer->Add(
- lStatus
- );
- statusSizer->Add(10, 10, 0);
- mainSizer->Add(
- statusSizer
- );
- mainSizer->Add(10, 10, 0);
- dkctGUIContentsPanel->SetSizer(mainSizer);
- SetIcon(dkicon_bitmap);
- dkctGUILayoutOK = true;
- dkctGUILayoutFinished:
- if(dkctGUILayoutOK) {
- mainSizer->Fit(this);
- mainSizer->SetSizeHints(this);
- }
-
-#line 436 "DkWxImgszFrame.wxc"
- if (lOriginalImage) {
- lOriginalImage->SetForegroundColour(cNotSoDarkRed);
- }
- if (lChangeType) {
- lChangeType->SetForegroundColour(cNotSoDarkRed);
- }
- if (lResults) {
- lResults->SetForegroundColour(cNotSoDarkRed);
- }
- SetTitle(localizedMessages[0]);
-#if 0
- restorePosition();
-#endif
- restoreData();
- enableDisableMinimumMaximum();
-}
-
-
-#line 454 "DkWxImgszFrame.wxc"
-
-void
-DkWxImgszFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
-{
- openHelp();
-}
-
-
-static wxChar const wximgsz_version[] = {
- wxT("wximgsz (part of dktools-")
-};
-
-static wxChar const wximgsz_versnumber[] = {
- DKT_VERSION_WX
-};
-
-static wxChar const wximgsz_versend[] = {
- wxT(")")
-};
-void
-DkWxImgszFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
-{
- wxString sVersion(wximgsz_version);
- sVersion.Append(wximgsz_versnumber);
- sVersion.Append(wximgsz_versend);
- sVersion.Append(sTexts[53]);
- sVersion.Append(wxT("Copyright (c) 2013-2016 Dirk Krause"));
- sVersion.Append(sTexts[53]);
- sVersion.Append(sTexts[53]);
- sVersion.Append(sTexts[54]);
- sVersion.Append(wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."));
- sVersion.Append(sTexts[53]);
- sVersion.Append(sTexts[53]);
- sVersion.Append(sTexts[55]);
- sVersion.Append(wxT("http://dktools.sourceforge.net\n"));
- sVersion.Append(wxT("http://www.wxwidgets.org\n"));
- sVersion.Append(wxT("http://www.libpng.org/pub/png/libpng.html\n"));
- sVersion.Append(wxT("http://www.ijg.org\n"));
- sVersion.Append(wxT("http://www.remotesensing.org/libtiff\n"));
- sVersion.Append(wxT("http://www.zlib.org"));
- wxMessageBox(sVersion, sTexts[35]);
-}
-
-
-void
-DkWxImgszFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
-{
-
-
-#line 502 "DkWxImgszFrame.wxc"
- Show(false);
- Close();
-
-
-#line 505 "DkWxImgszFrame.wxc"
-}
-
-
-
-void
-DkWxImgszFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
-{
- wxString s(wxT(""));
-
-
-#line 514 "DkWxImgszFrame.wxc"
- s.Append(wxT("BMP files (*.bmp)|*.bmp"));
- s.Append(wxT("|PNG files (*.png)|*.png"));
- s.Append(wxT("|JPEG files (*.jpg)|*.jpg|JPEG files (*.jpeg)|*.jpeg"));
- s.Append(wxT("|TIFF files (*.tif)|*.tif|TIFF files (*.tiff)|*.tiff"));
- s.Append(wxT("|XPM files (*.xpm)|*.xpm"));
- s.Append(wxT("|All files (*.*)|*.*"));
-#if wxCHECK_VERSION(2, 9, 0)
- wxFileDialog dlg(this, sTexts[48], sCurrentDir, wxT(""), s, wxFD_OPEN);
-#else
- wxFileDialog dlg(this, sTexts[48], sCurrentDir, wxT(""), s, wxOPEN);
-#endif
- pHelper->setRelatedPosition(this, &dlg, &fdx, &fdy);
- if(wxID_OK == dlg.ShowModal()) {
- wxString path = dlg.GetPath();
- wxImage img;
- if(img.LoadFile(path)) {
- int w = img.GetWidth();
- int h = img.GetHeight();
- if((w > 0) && (h > 0)) {
- wxString sWidth;
- wxString sHeight;
- sWidth.Printf(wxT("%d"), w);
- sHeight.Printf(wxT("%d"), h);
- if((tWidth) && (tHeight)) {
- tWidth->SetValue(sWidth);
- tHeight->SetValue(sHeight);
- Refresh();
- Update();
- run(false);
- }
- } else {
- /* ERROR: Illegal image dimensions! */
- wxMessageBox(sTexts[51], sTexts[52], (wxOK | wxICON_ERROR), this);
- }
- } else {
- /* ERROR: Failed to load file! */
- wxMessageBox(sTexts[51], sTexts[52], (wxOK | wxICON_ERROR), this);
- }
- }
- dlg.GetPosition(&fdx, &fdy);
-
-
-#line 555 "DkWxImgszFrame.wxc"
-}
-
-
-
-void
-DkWxImgszFrame::OnOptions(wxCommandEvent& WXUNUSED(event))
-{
-
-
-#line 563 "DkWxImgszFrame.wxc"
- DkWxImgszOptionsDialog dlg(this, sTexts[41], sTexts);
- pHelper->setRelatedPosition(this, &dlg, &odx, &ody);
- dlg.SetValue(bUseColour);
- if(dlg.ShowModal() == wxID_OK) {
- bUseColour = dlg.GetValue();
- }
- dlg.GetPosition(&odx, &ody);
-
-
-#line 571 "DkWxImgszFrame.wxc"
-}
-
-
-void
-DkWxImgszFrame::run(bool bShowErrors)
-{
- long w = 0L;
- long h = 0L;
- long min = 0L;
- long max = 0L;
- int action = 0;
-
-
-#line 583 "DkWxImgszFrame.wxc"
- w = getTextCtrlContents(tWidth, bShowErrors);
- if(w > 0L) {
- h = getTextCtrlContents(tHeight, bShowErrors);
- if(h > 0L) {
- switch((action = cbAction->GetCurrentSelection())) {
- case 2: {
- min = getTextCtrlContents(tMinimum, bShowErrors);
- if(min > 0L) {
- max = getTextCtrlContents(tMaximum, bShowErrors);
- }
- } break;
- case 1: {
- min = getTextCtrlContents(tMinimum, bShowErrors);
- if(min > 0L) {
- max = getTextCtrlContents(tMaximum, bShowErrors);
- }
- } break;
- default: {
- min = 1L; max = w; action = 1;
- } break;
- }
- if((w > 0L) && (h > 0L) && (min > 0L) && (max > 0L)) {
- switch(action) {
- case 2: {
- runForNumbers(h, w, min, max, 1);
- } break;
- default: {
- runForNumbers(w, h, min, max, 0);
- } break;
- }
- }
- }
- }
-
-
-#line 617 "DkWxImgszFrame.wxc"
-}
-
-
-
-void
-DkWxImgszFrame::OnRun(wxCommandEvent& WXUNUSED(event))
-{
-
-
-#line 625 "DkWxImgszFrame.wxc"
- run(true);
-
-
-#line 627 "DkWxImgszFrame.wxc"
-}
-
-
-
-DkWxImgszFrame::~DkWxImgszFrame()
-{
-}
-
-
-
-bool
-DkWxImgszFrame::canClose(bool isLast)
-{
-
-
-#line 641 "DkWxImgszFrame.wxc"
- if(isLast) {
- saveData();
- }
-
-#line 644 "DkWxImgszFrame.wxc"
- return true;
-}
-
-
-
-static wxChar const * const wximgsz_keys[] = {
-/* 0 */
-wxT("wximgsz.width"),
-
-/* 1 */
-wxT("wximgsz.height"),
-
-/* 2 */
-wxT("wximgsz.selection"),
-
-/* 3 */
-wxT("wximgsz.minimum"),
-
-/* 4 */
-wxT("wximgsz.maximum"),
-
-/* 5 */
-wxT("wximgsz.colours"),
-
-NULL
-
-
-#line 658 "DkWxImgszFrame.wxc"
-};
-
-void
-DkWxImgszFrame::saveData()
-{
- long i[] = {
- 0L, // Width
- 0L, // Height
- 0L, // Selection
- 0L, // Minimum
- 0L, // Maximum
- 0L // bUseColour
- };
- long l;
- if((tWidth->GetValue()).ToLong(&l)) {
- i[0] = l;
- }
- if((tHeight->GetValue()).ToLong(&l)) {
- i[1] = l;
- }
- i[2] = (long)(cbAction->GetCurrentSelection());
- if(i[2] < 0L) i[2] = 0L;
- if((tMinimum->GetValue()).ToLong(&l)) {
- i[3] = l;
- }
- if((tMaximum->GetValue()).ToLong(&l)) {
- i[4] = l;
- }
- i[5] = ((bUseColour) ? 1L : 0L);
- if(pHelper) {
- pHelper->saveMultipleLongs(wximgsz_keys, i);
- }
-}
-
-
-void
-DkWxImgszFrame::restoreData()
-{
- wxString sWidth;
- wxString sHeight;
- wxString sMinimum;
- wxString sMaximum;
- long i[] = {
- 1024L, // Width
- 768L, // Height
- 0L, // Selection
- 200L, // Minimum
- 800L, // Maximum
- 1L // bUseColour
- };
- if(pHelper) {
- pHelper->retrieveMultipleLongs(wximgsz_keys, i);
- sWidth.Printf(wxT("%ld"), i[0]);
- sHeight.Printf(wxT("%ld"), i[1]);
- sMinimum.Printf(wxT("%ld"), i[3]);
- sMaximum.Printf(wxT("%ld"), i[4]);
- tWidth->SetValue(sWidth);
- tHeight->SetValue(sHeight);
- tMinimum->SetValue(sMinimum);
- tMaximum->SetValue(sMaximum);
- cbAction->SetSelection((int)(i[2]));
- bUseColour = ((i[5]) ? true : false);
- }
-}
-
-
-
-void
-DkWxImgszFrame::enableDisableMinimumMaximum()
-{
- if(0 == cbAction->GetCurrentSelection()) {
- tMinimum->SetEditable(false);
- tMaximum->SetEditable(false);
- tMinimum->Enable(false);
- tMaximum->Enable(false);
- } else {
- tMinimum->SetEditable(true);
- tMaximum->SetEditable(true);
- tMinimum->Enable(true);
- tMaximum->Enable(true);
- }
-}
-
-
-
-void
-DkWxImgszFrame::OnChoice(wxCommandEvent & event)
-{
- enableDisableMinimumMaximum();
-}
-
-
-
-long
-DkWxImgszFrame::gcd(long aa, long bb)
-{
- long back = 0L;
- long h = 0L;
- long a;
- long b;
-
- a = aa;
- b = bb;
- while(b > 0L) {
- h = a % b;
- a = b;
- b = h;
- }
- back = a;
- return back;
-}
-
-
-long
-DkWxImgszFrame::getTextCtrlContents(wxTextCtrl *tf, bool bShowErrors)
-{
- long back = 0L;
- long l = 0L;
- if((tf->GetValue()).ToLong(&l)) {
- back = l;
- }
- if(0 >= back) {
- if(bShowErrors) {
- tf->SetFocus();
- wxMessageBox(sTexts[33], sTexts[32], (wxOK | wxICON_ERROR), this);
- }
- }
- return back;
-}
-
-
-
-void
-DkWxImgszFrame::runForNumbers(long w, long h, long min, long max, int inverted)
-{
- long gd;
- long w0;
- long h0;
- long nw;
- long nh;
- long i;
- long z;
- long n;
- long g2;
- int lineno;
- int cl;
- int rows;
- int found = 0;
-
- gd = gcd(w, h);
- if(gd > 0L) {
- /*
- Minimum rectangle.
- */
- w0 = w / gd;
- h0 = h / gd;
- /*
- Remove all grid lines.
- */
- rows = dataGrid->GetNumberRows();
- dataGrid->DeleteRows(0, rows);
- /*
- Build and fill new grid.
- */
- lineno = 0;
- i = 1;
- lStatus->SetForegroundColour(cBlack);
- lStatus->SetLabel(sTexts[18]);
- while((i * w0) <= max) {
- if((i * w0) >= min) {
- found = 1;
- nw = i * w0;
- nh = i * h0;
- /* Classify factor. */
- cl = classifyFactor(nw, w);
- g2 = gcd(nw, w);
- z = nw / g2; n = w / g2;
- dataGrid->AppendRows(1);
- dataGrid->SetCellTextColour(lineno, 0, cBlack);
- dataGrid->SetCellTextColour(lineno, 1, cBlack);
- dataGrid->SetCellTextColour(lineno, 2, cBlack);
- switch(cl) {
- case 2: {
- if(bUseColour) {
- dataGrid->SetCellBackgroundColour(lineno, 2, cGreen);
- } else {
- dataGrid->SetCellValue(lineno, 3, sTexts[36]);
- }
- } break;
- case 1: {
- if(bUseColour) {
- dataGrid->SetCellBackgroundColour(lineno, 2, cYellow);
- } else {
- dataGrid->SetCellValue(lineno, 3, sTexts[37]);
- }
- } break;
- default: {
- if(bUseColour) {
- dataGrid->SetCellBackgroundColour(lineno, 2, cRed);
- } else {
- dataGrid->SetCellValue(lineno, 3, wxT(""));
- }
- } break;
- }
- if(bUseColour) {
- dataGrid->SetCellValue(lineno, 3, wxT(""));
- }
- {
- wxString sRowHead;
- wxString sFactor;
- wxString sWidth;
- wxString sHeight;
-
- sRowHead.Printf(wxT("%d"), (lineno + 1));
- if(n > 1L) {
- sFactor.Printf(wxT("%ld / %ld"), z, n);
- } else {
- sFactor.Printf(wxT("%ld"), z);
- }
- if(inverted) {
- sWidth.Printf(wxT("%ld"), nh);
- sHeight.Printf(wxT("%ld"), nw);
- } else {
- sWidth.Printf(wxT("%ld"), nw);
- sHeight.Printf(wxT("%ld"), nh);
- }
- dataGrid->SetRowLabelValue(lineno, sRowHead);
- dataGrid->SetCellValue(lineno, 0, sWidth);
- dataGrid->SetCellValue(lineno, 1, sHeight);
- dataGrid->SetCellValue(lineno, 2, sFactor);
- dataGrid->SetCellAlignment(lineno, 0, wxALIGN_CENTRE, wxALIGN_CENTRE);
- dataGrid->SetCellAlignment(lineno, 1, wxALIGN_CENTRE, wxALIGN_CENTRE);
- dataGrid->SetCellAlignment(lineno, 2, wxALIGN_CENTRE, wxALIGN_CENTRE);
- dataGrid->SetCellAlignment(lineno, 3, wxALIGN_CENTRE, wxALIGN_CENTRE);
- }
- lineno++;
- }
- i++;
- }
- dataGrid->AutoSizeColumns();
- dataGrid->EnableDragColSize(true);
- if(0 == found) {
- lStatus->SetLabel(sTexts[34]);
- lStatus->SetForegroundColour(cDarkRed);
- }
- Refresh();
- Update();
- }
-}
-
-
-
-int
-DkWxImgszFrame::classifyFactor(long n, long o)
-{
- long max;
- long min;
- int back = 0;
- if(n > o) {
- max = n; min = o;
- } else {
- max = o; min = n;
- }
- if(max % min) {
- back = 0;
- } else {
- back = 1;
- max = max / min;
- if(countBits(max) == 1) {
- back = 2;
- }
- }
- return back;
-}
-
-
-int
-DkWxImgszFrame::countBits(long v)
-{
-#if DK3_SIZEOF_LONG > 2
-#if DK3_SIZEOF_LONG > 4
- long bitmask = 0x4000000000000000L;
- int attempts = 63;
-#else
- long bitmask = 0x40000000L;
- int attempts = 31;
-#endif
-#else
- long bitmask = 0x4000L;
- int attempts = 15;
-#endif
- int back = 0;
-
- while(attempts--) {
- if(v & bitmask) {
- back++;
- }
- bitmask = bitmask >> 1;
- }
- return back;
-}
-
-
diff --git a/support/dktools/DkWxImgszFrame.h b/support/dktools/DkWxImgszFrame.h
deleted file mode 100644
index a8bb67de5f..0000000000
--- a/support/dktools/DkWxImgszFrame.h
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxImgszFrame.wxc
-*/
-
-/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file DkWxImgszFrame.h Header file for the DkWxImgszFrame module.
-*/
-
-#ifndef DKWXIMGSZFRAME_H_INCLUDED
-/** Avoid multiple inclusions. */
-#define DKWXIMGSZFRAME_H_INCLUDED 1
-
-
-#line 176 "DkWxImgszFrame.wxc"
-
-
-
-#line 179 "DkWxImgszFrame.wxc"
-
-
-/** Main window class for the wximgsz program.
-*/
-class DkWxImgszFrame : public DkWxFrame
-{
- private:
-
- /** Event table.
- */
- DECLARE_EVENT_TABLE()
-
- protected:
-
- /** Localized message texts.
- */
- wxChar const * const *sTexts;
-
- /** Red (used as background color).
- */
- wxColour cRed;
-
- /** Red 127.
- */
- wxColour cNotSoDarkRed;
-
- /** Green (used as background color).
- */
- wxColour cGreen;
-
- /** Black (used as text color).
- */
- wxColour cBlack;
-
- /** Dark red (used as text color).
- */
- wxColour cDarkRed;
-
- /** Yellow (used as background color).
- */
- wxColour cYellow;
-
- /** File dialog x position.
- */
- int fdx;
-
- /** File dialog y position.
- */
- int fdy;
-
- /** Options dialog x position.
- */
- int odx;
-
- /** Options dialog y position.
- */
- int ody;
-
- /** Flag: Use background colors to indicate scale factor quality.
- */
- bool bUseColour;
-
- /** Current directory.
- */
- wxString sCurrentDir;
-
- /** Flag: GUI ok.
- */
- bool dkctGUILayoutOK;
-
- /** Contents panel.
- */
- wxPanel *dkctGUIContentsPanel;
-
- /** GUI element mbMain.
- */
-#line 15 "DkWxImgszFrame.wxc"
- wxMenuBar *mbMain;
-
- /** GUI element mainSizer.
- */
-#line 59 "DkWxImgszFrame.wxc"
- wxBoxSizer *mainSizer;
-
- /** GUI element mFile.
- */
-#line 20 "DkWxImgszFrame.wxc"
- wxMenu *mFile;
-
- /** GUI element mExtras.
- */
-#line 35 "DkWxImgszFrame.wxc"
- wxMenu *mExtras;
-
- /** GUI element mHelp.
- */
-#line 44 "DkWxImgszFrame.wxc"
- wxMenu *mHelp;
-
- /** GUI element miOpen.
- */
-#line 25 "DkWxImgszFrame.wxc"
- wxMenuItem *miOpen;
-
- /** GUI element miExit.
- */
-#line 30 "DkWxImgszFrame.wxc"
- wxMenuItem *miExit;
-
- /** GUI element miOptions.
- */
-#line 39 "DkWxImgszFrame.wxc"
- wxMenuItem *miOptions;
-
- /** GUI element miHelpContents.
- */
-#line 49 "DkWxImgszFrame.wxc"
- wxMenuItem *miHelpContents;
-
- /** GUI element miHelpAbout.
- */
-#line 54 "DkWxImgszFrame.wxc"
- wxMenuItem *miHelpAbout;
-
- /** GUI element horizontalSizer.
- */
-#line 67 "DkWxImgszFrame.wxc"
- wxBoxSizer *horizontalSizer;
-
- /** GUI element statusSizer.
- */
-#line 166 "DkWxImgszFrame.wxc"
- wxBoxSizer *statusSizer;
-
- /** GUI element inputDataSizer.
- */
-#line 78 "DkWxImgszFrame.wxc"
- wxGridBagSizer *inputDataSizer;
-
- /** GUI element bCalculate.
- */
-#line 137 "DkWxImgszFrame.wxc"
- wxBitmapButton *bCalculate;
-
- /** GUI element outputDataSizer.
- */
-#line 143 "DkWxImgszFrame.wxc"
- wxGridBagSizer *outputDataSizer;
-
- /** GUI element lOriginalImage.
- */
-#line 94 "DkWxImgszFrame.wxc"
- wxStaticText *lOriginalImage;
-
- /** GUI element lWidth.
- */
-#line 97 "DkWxImgszFrame.wxc"
- wxStaticText *lWidth;
-
- /** GUI element tWidth.
- */
-#line 100 "DkWxImgszFrame.wxc"
- wxTextCtrl *tWidth;
-
- /** GUI element lHeight.
- */
-#line 104 "DkWxImgszFrame.wxc"
- wxStaticText *lHeight;
-
- /** GUI element tHeight.
- */
-#line 107 "DkWxImgszFrame.wxc"
- wxTextCtrl *tHeight;
-
- /** GUI element lChangeType.
- */
-#line 111 "DkWxImgszFrame.wxc"
- wxStaticText *lChangeType;
-
- /** GUI element lAction.
- */
-#line 114 "DkWxImgszFrame.wxc"
- wxStaticText *lAction;
-
- /** GUI element cbAction.
- */
-#line 117 "DkWxImgszFrame.wxc"
- wxChoice *cbAction;
-
- /** GUI element lMinimum.
- */
-#line 123 "DkWxImgszFrame.wxc"
- wxStaticText *lMinimum;
-
- /** GUI element tMinimum.
- */
-#line 126 "DkWxImgszFrame.wxc"
- wxTextCtrl *tMinimum;
-
- /** GUI element lMaximum.
- */
-#line 130 "DkWxImgszFrame.wxc"
- wxStaticText *lMaximum;
-
- /** GUI element tMaximum.
- */
-#line 133 "DkWxImgszFrame.wxc"
- wxTextCtrl *tMaximum;
-
- /** GUI element lResults.
- */
-#line 152 "DkWxImgszFrame.wxc"
- wxStaticText *lResults;
-
- /** GUI element dataGrid.
- */
-#line 155 "DkWxImgszFrame.wxc"
- wxGrid *dataGrid;
-
- /** GUI element lStatus.
- */
-#line 171 "DkWxImgszFrame.wxc"
- wxStaticText *lStatus;
-
-
-#line 246 "DkWxImgszFrame.wxc"
- public:
- /** Constructor.
- */
- DkWxImgszFrame(
- wxChar const *applicationName,
- wxChar const * const *localizedMessages,
- DkWxAppHelper *applicationHelper,
- DkWxHelpController *helpController,
- int wxid,
- int argc,
- wxChar **argv
- );
-
- /** Destructor.
- */
- ~DkWxImgszFrame();
-
- /** Check whether we can close the window.
- @param isLast Flag: Last top level window.
- */
- bool
- canClose(bool isLast);
-
- /** Event handler to open a file.
- @param event Event to process.
- */
- void
- OnOpen(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler to quit application.
- @param event Event to process.
- */
- void
- OnQuit(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler to show help contents.
- @param event Event to process.
- */
- void
- OnHelp(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler to show version number.
- @param event Event to process.
- */
- void
- OnAbout(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler: Run calculation.
- @param event Event to process.
- */
- void
- OnRun(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler: Choice made.
- @param event Event to process.
- */
- void
- OnChoice(wxCommandEvent & event);
-
- /** Event handler to set options.
- @param event Event to process.
- */
- void
- OnOptions(wxCommandEvent& WXUNUSED(event));
-
- protected:
-
- /** Save data entered into text fields.
- */
- void saveData();
-
- /** Restore data entered in text fields.
- */
- void restoreData();
-
- /** Enable/disable the lower text fields depending
- on the current choice selection.
- */
- void
- enableDisableMinimumMaximum();
-
- /** Calculate largest common divisor.
- @param aa One number.
- @param bb Other number.
- @return Largest common divisor of aa and bb.
- */
- long gcd(long aa, long bb);
-
- /** Retrieve positive long number from text field.
- @param tf Text field to process.
- @param bShowErrors Flag: Show message boxes for errors.
- @return Positive number on success, 0L on error.
- */
- long getTextCtrlContents(wxTextCtrl *tf, bool bShowErrors);
-
- /** Run calculation.
- */
- void
- run(bool bShowErrors);
-
- /** Run for a set of numbers.
- @param w Width (or height, if inverted).
- @param h Height (or width, if inverted).
- @param min Minimum value.
- @param max maximum value.
- @param inverted Flag: w contains the hight, h the width.
- */
- void
- runForNumbers(long w, long h, long min, long max, int inverted);
-
- /** Classify factor.
- @param n New value.
- @param o Old value.
- @return 2 for powers of 2, 1 for integer factors, 0 otherwise.
- */
- int classifyFactor(long n, long o);
-
- /** Count bit number in a long value.
- @param v Value to check.
- @return Number of bits set.
- */
- int countBits(long v);
-};
-
-
-#line 371 "DkWxImgszFrame.wxc"
-
-
-
-#endif
diff --git a/support/dktools/DkWxImgszFrame.wxc b/support/dktools/DkWxImgszFrame.wxc
deleted file mode 100644
index 40be8be76c..0000000000
--- a/support/dktools/DkWxImgszFrame.wxc
+++ /dev/null
@@ -1,960 +0,0 @@
-%% options
-
-copyright owner = Dirk Krause
-copyright year = 2012-xxxx
-license = bsd
-
-
-%% wx-gui
-
-type = frame
-icon = dkicon_bitmap
-menu bar = mbMain
-contents = mainSizer
-
-[wxMenuBar mbMain]
-contents = mFile
-contents = mExtras
-contents = mHelp
-
-[wxMenu mFile]
-contents = miOpen
-contents = miExit
-text = sTexts[1]
-
-[wxMenuItem miOpen]
-text = sTexts[49]
-id = DkWxImgsz_Open
-tip = sTexts[50]
-
-[wxMenuItem miExit]
-text = sTexts[2]
-id = DkWxImgsz_Quit
-tip = sTexts[19]
-
-[wxMenu mExtras]
-text = sTexts[38]
-contents = miOptions
-
-[wxMenuItem miOptions]
-text = sTexts[39]
-tip = sTexts[40]
-id = DkWxImgsz_Options
-
-[wxMenu mHelp]
-text = sTexts[27]
-contents = miHelpContents
-contents = miHelpAbout
-
-[wxMenuItem miHelpContents]
-text = sTexts[28]
-tip = sTexts[30]
-id = DkWxImgsz_Help
-
-[wxMenuItem miHelpAbout]
-text = sTexts[29]
-tip = sTexts[31]
-id = DkWxImgsz_About
-
-[wxBoxSizer mainSizer]
-direction = vertical
-contents = $space(10)
-contents = horizontalSizer
-contents = $space(10)
-contents = statusSizer
-contents = $space(10)
-
-[wxBoxSizer horizontalSizer]
-grow = yes
-proportion = 1
-contents = $space(10)
-contents = inputDataSizer left top
-contents = $space(10)
-contents = bCalculate centered-x centered-y
-contents = $space(10)
-contents = outputDataSizer left top
-contents = $space(10)
-
-[wxGridBagSizer inputDataSizer]
-grid = 5 5
-contents = lOriginalImage 0 0 1 2 left centered-y
-contents = lWidth +1 0 1 1 right centered-y
-contents = tWidth . +1 1 1 left centered-y
-contents = lHeight +1 0 1 1 right centered-y
-contents = tHeight . +1 1 1 left centered-y
-contents = $space(10) +1 0 1 1 left
-contents = lChangeType +1 0 1 2 left centered-y
-contents = lAction +1 0 1 1 right centered-y
-contents = cbAction . +1 1 1 left centered-y
-contents = lMinimum +1 0 1 1 right centered-y
-contents = tMinimum . +1 1 1 left centered-y
-contents = lMaximum +1 0 1 1 right centered-y
-contents = tMaximum . +1 1 1 left centered-y
-
-[wxStaticText lOriginalImage]
-text = sTexts[6]
-
-[wxStaticText lWidth]
-text = sTexts[8]
-
-[wxTextCtrl tWidth]
-tip = sTexts[20]
-text = sTexts[26]
-
-[wxStaticText lHeight]
-text = sTexts[9]
-
-[wxTextCtrl tHeight]
-tip = sTexts[21]
-text = sTexts[26]
-
-[wxStaticText lChangeType]
-text = sTexts[10]
-
-[wxStaticText lAction]
-text = sTexts[11]
-
-[wxChoice cbAction]
-choices = 3 saAction
-tip = sTexts[22]
-# grow = yes
-id = DkWxImgsz_Choice
-
-[wxStaticText lMinimum]
-text = sTexts[15]
-
-[wxTextCtrl tMinimum]
-tip = sTexts[23]
-text = sTexts[26]
-
-[wxStaticText lMaximum]
-text = sTexts[16]
-
-[wxTextCtrl tMaximum]
-tip = sTexts[24]
-text = sTexts[26]
-
-[wxBitmapButton bCalculate]
-# text = sTexts[17]
-bitmap = run2_bitmap
-tip = sTexts[25]
-id = DkWxImgsz_Run
-
-[wxGridBagSizer outputDataSizer]
-grid = 5 5
-grow = yes
-proportion = 1
-contents = lResults 0 0 1 2 left centered-y
-contents = dataGrid +1 0 2 2 left top
-growable row = 2
-growable column = 1
-
-[wxStaticText lResults]
-text = sTexts[7]
-
-[wxGrid dataGrid]
-text style = readonly
-column head = sTexts[3]
-column head = sTexts[4]
-column head = sTexts[5]
-column head = sTexts[18]
-rows = 16
-minimum size = 300 200
-grow = true
-proportion = 1
-
-[wxBoxSizer statusSizer]
-contents = $space(10)
-contents = lStatus
-contents = $space(10)
-
-[wxStaticText lStatus]
-text = sTexts[18]
-
-
-%% header start
-
-
-%% class start
-
-
-/** Main window class for the wximgsz program.
-*/
-class DkWxImgszFrame : public DkWxFrame
-{
- private:
-
- /** Event table.
- */
- DECLARE_EVENT_TABLE()
-
- protected:
-
- /** Localized message texts.
- */
- wxChar const * const *sTexts;
-
- /** Red (used as background color).
- */
- wxColour cRed;
-
- /** Red 127.
- */
- wxColour cNotSoDarkRed;
-
- /** Green (used as background color).
- */
- wxColour cGreen;
-
- /** Black (used as text color).
- */
- wxColour cBlack;
-
- /** Dark red (used as text color).
- */
- wxColour cDarkRed;
-
- /** Yellow (used as background color).
- */
- wxColour cYellow;
-
- /** File dialog x position.
- */
- int fdx;
-
- /** File dialog y position.
- */
- int fdy;
-
- /** Options dialog x position.
- */
- int odx;
-
- /** Options dialog y position.
- */
- int ody;
-
- /** Flag: Use background colors to indicate scale factor quality.
- */
- bool bUseColour;
-
- /** Current directory.
- */
- wxString sCurrentDir;
-
-%% class end
- public:
- /** Constructor.
- */
- DkWxImgszFrame(
- wxChar const *applicationName,
- wxChar const * const *localizedMessages,
- DkWxAppHelper *applicationHelper,
- DkWxHelpController *helpController,
- int wxid,
- int argc,
- wxChar **argv
- );
-
- /** Destructor.
- */
- ~DkWxImgszFrame();
-
- /** Check whether we can close the window.
- @param isLast Flag: Last top level window.
- */
- bool
- canClose(bool isLast);
-
- /** Event handler to open a file.
- @param event Event to process.
- */
- void
- OnOpen(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler to quit application.
- @param event Event to process.
- */
- void
- OnQuit(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler to show help contents.
- @param event Event to process.
- */
- void
- OnHelp(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler to show version number.
- @param event Event to process.
- */
- void
- OnAbout(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler: Run calculation.
- @param event Event to process.
- */
- void
- OnRun(wxCommandEvent& WXUNUSED(event));
-
- /** Event handler: Choice made.
- @param event Event to process.
- */
- void
- OnChoice(wxCommandEvent & event);
-
- /** Event handler to set options.
- @param event Event to process.
- */
- void
- OnOptions(wxCommandEvent& WXUNUSED(event));
-
- protected:
-
- /** Save data entered into text fields.
- */
- void saveData();
-
- /** Restore data entered in text fields.
- */
- void restoreData();
-
- /** Enable/disable the lower text fields depending
- on the current choice selection.
- */
- void
- enableDisableMinimumMaximum();
-
- /** Calculate largest common divisor.
- @param aa One number.
- @param bb Other number.
- @return Largest common divisor of aa and bb.
- */
- long gcd(long aa, long bb);
-
- /** Retrieve positive long number from text field.
- @param tf Text field to process.
- @param bShowErrors Flag: Show message boxes for errors.
- @return Positive number on success, 0L on error.
- */
- long getTextCtrlContents(wxTextCtrl *tf, bool bShowErrors);
-
- /** Run calculation.
- */
- void
- run(bool bShowErrors);
-
- /** Run for a set of numbers.
- @param w Width (or height, if inverted).
- @param h Height (or width, if inverted).
- @param min Minimum value.
- @param max maximum value.
- @param inverted Flag: w contains the hight, h the width.
- */
- void
- runForNumbers(long w, long h, long min, long max, int inverted);
-
- /** Classify factor.
- @param n New value.
- @param o Old value.
- @return 2 for powers of 2, 1 for integer factors, 0 otherwise.
- */
- int classifyFactor(long n, long o);
-
- /** Count bit number in a long value.
- @param v Value to check.
- @return Number of bits set.
- */
- int countBits(long v);
-};
-
-%% header end
-
-
-%% module start
-
-#include "wximgsz.h"
-#include "dkicon.xpm"
-#include "dk4verswx.h"
-#include "run2.xpm"
-
-$!trace-include
-
-
-
-/** Event table for the DkWxImgszFrame class.
-*/
-BEGIN_EVENT_TABLE(DkWxImgszFrame, wxFrame)
- EVT_MENU(DkWxImgsz_Quit, DkWxImgszFrame::OnQuit)
- EVT_MENU(DkWxImgsz_Help, DkWxImgszFrame::OnHelp)
- EVT_MENU(DkWxImgsz_About, DkWxImgszFrame::OnAbout)
- EVT_MENU(DkWxImgsz_Options, DkWxImgszFrame::OnOptions)
- EVT_MENU(DkWxImgsz_Open, DkWxImgszFrame::OnOpen)
- EVT_BUTTON(DkWxImgsz_Run, DkWxImgszFrame::OnRun)
- EVT_CHOICE(DkWxImgsz_Choice, DkWxImgszFrame::OnChoice)
-END_EVENT_TABLE()
-
-
-
-%% constructor start
-
-DkWxImgszFrame::DkWxImgszFrame(
- wxChar const *applicationName,
- wxChar const * const *localizedMessages,
- DkWxAppHelper *applicationHelper,
- DkWxHelpController *helpController,
- int wxid,
- int argc,
- wxChar **argv
-) : DkWxFrame(applicationName, applicationHelper, helpController, wxid),
- cRed(255, 91, 91),
- cNotSoDarkRed(127, 0, 0),
- cGreen(127, 255, 127),
- cBlack(0, 0, 0),
- cDarkRed(63, 0, 0),
- cYellow(255, 255, 0),
- sCurrentDir(wxT(""))
-{
- /*
- Icon for main window.
- */
-#if defined(__WXMSW__)
- wxIcon dkicon_bitmap(wxT("aaaaa"));
-#else
- wxIcon dkicon_bitmap(xpm_dkicon);
-#endif
- wxIcon run2_bitmap(xpm_run2);
- fdx = -1; fdy = -1;
- odx = -1; ody = -1;
- sTexts = localizedMessages;
- wxString saAction[] = {
- wxString(localizedMessages[12]),
- wxString(localizedMessages[13]),
- wxString(localizedMessages[14])
- };
- bUseColour = true;
-%% constructor end
- if (lOriginalImage) {
- lOriginalImage->SetForegroundColour(cNotSoDarkRed);
- }
- if (lChangeType) {
- lChangeType->SetForegroundColour(cNotSoDarkRed);
- }
- if (lResults) {
- lResults->SetForegroundColour(cNotSoDarkRed);
- }
- SetTitle(localizedMessages[0]);
-#if 0
- restorePosition();
-#endif
- restoreData();
- enableDisableMinimumMaximum();
-}
-
-%% module end
-
-void
-DkWxImgszFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
-{
- openHelp();
-}
-
-
-static wxChar const wximgsz_version[] = {
- wxT("wximgsz (part of dktools-")
-};
-
-static wxChar const wximgsz_versnumber[] = {
- DKT_VERSION_WX
-};
-
-static wxChar const wximgsz_versend[] = {
- wxT(")")
-};
-void
-DkWxImgszFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
-{
- wxString sVersion(wximgsz_version);
- sVersion.Append(wximgsz_versnumber);
- sVersion.Append(wximgsz_versend);
- sVersion.Append(sTexts[53]);
- sVersion.Append(wxT("Copyright (c) 2013-2016 Dirk Krause"));
- sVersion.Append(sTexts[53]);
- sVersion.Append(sTexts[53]);
- sVersion.Append(sTexts[54]);
- sVersion.Append(wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."));
- sVersion.Append(sTexts[53]);
- sVersion.Append(sTexts[53]);
- sVersion.Append(sTexts[55]);
- sVersion.Append(wxT("http://dktools.sourceforge.net\n"));
- sVersion.Append(wxT("http://www.wxwidgets.org\n"));
- sVersion.Append(wxT("http://www.libpng.org/pub/png/libpng.html\n"));
- sVersion.Append(wxT("http://www.ijg.org\n"));
- sVersion.Append(wxT("http://www.remotesensing.org/libtiff\n"));
- sVersion.Append(wxT("http://www.zlib.org"));
- wxMessageBox(sVersion, sTexts[35]);
-}
-
-
-void
-DkWxImgszFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
-{
- $? "+ DkWxImgszFrame::OnQuit"
- Show(false);
- Close();
- $? "- DkWxBmepsFrame::OnQuit"
-}
-
-
-
-void
-DkWxImgszFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
-{
- wxString s(wxT(""));
- $? "+ DkWxImgszFrame::OnOpen"
- s.Append(wxT("BMP files (*.bmp)|*.bmp"));
- s.Append(wxT("|PNG files (*.png)|*.png"));
- s.Append(wxT("|JPEG files (*.jpg)|*.jpg|JPEG files (*.jpeg)|*.jpeg"));
- s.Append(wxT("|TIFF files (*.tif)|*.tif|TIFF files (*.tiff)|*.tiff"));
- s.Append(wxT("|XPM files (*.xpm)|*.xpm"));
- s.Append(wxT("|All files (*.*)|*.*"));
-#if wxCHECK_VERSION(2, 9, 0)
- wxFileDialog dlg(this, sTexts[48], sCurrentDir, wxT(""), s, wxFD_OPEN);
-#else
- wxFileDialog dlg(this, sTexts[48], sCurrentDir, wxT(""), s, wxOPEN);
-#endif
- pHelper->setRelatedPosition(this, &dlg, &fdx, &fdy);
- if(wxID_OK == dlg.ShowModal()) {
- wxString path = dlg.GetPath();
- wxImage img;
- if(img.LoadFile(path)) {
- int w = img.GetWidth();
- int h = img.GetHeight();
- if((w > 0) && (h > 0)) {
- wxString sWidth;
- wxString sHeight;
- sWidth.Printf(wxT("%d"), w);
- sHeight.Printf(wxT("%d"), h);
- if((tWidth) && (tHeight)) {
- tWidth->SetValue(sWidth);
- tHeight->SetValue(sHeight);
- Refresh();
- Update();
- run(false);
- }
- } else {
- /* ERROR: Illegal image dimensions! */
- wxMessageBox(sTexts[51], sTexts[52], (wxOK | wxICON_ERROR), this);
- }
- } else {
- /* ERROR: Failed to load file! */
- wxMessageBox(sTexts[51], sTexts[52], (wxOK | wxICON_ERROR), this);
- }
- }
- dlg.GetPosition(&fdx, &fdy);
- $? "- DkWxBmepsFrame::OnOpen"
-}
-
-
-
-void
-DkWxImgszFrame::OnOptions(wxCommandEvent& WXUNUSED(event))
-{
- $? "+ DkWxImgszFrame::OnOptions"
- DkWxImgszOptionsDialog dlg(this, sTexts[41], sTexts);
- pHelper->setRelatedPosition(this, &dlg, &odx, &ody);
- dlg.SetValue(bUseColour);
- if(dlg.ShowModal() == wxID_OK) {
- bUseColour = dlg.GetValue();
- }
- dlg.GetPosition(&odx, &ody);
- $? "- DkWxBmepsFrame::OnOptions"
-}
-
-
-void
-DkWxImgszFrame::run(bool bShowErrors)
-{
- long w = 0L;
- long h = 0L;
- long min = 0L;
- long max = 0L;
- int action = 0;
- $? "+ DkWxImgszFrame::run"
- w = getTextCtrlContents(tWidth, bShowErrors);
- if(w > 0L) {
- h = getTextCtrlContents(tHeight, bShowErrors);
- if(h > 0L) {
- switch((action = cbAction->GetCurrentSelection())) {
- case 2: {
- min = getTextCtrlContents(tMinimum, bShowErrors);
- if(min > 0L) {
- max = getTextCtrlContents(tMaximum, bShowErrors);
- }
- } break;
- case 1: {
- min = getTextCtrlContents(tMinimum, bShowErrors);
- if(min > 0L) {
- max = getTextCtrlContents(tMaximum, bShowErrors);
- }
- } break;
- default: {
- min = 1L; max = w; action = 1;
- } break;
- }
- if((w > 0L) && (h > 0L) && (min > 0L) && (max > 0L)) {
- switch(action) {
- case 2: {
- runForNumbers(h, w, min, max, 1);
- } break;
- default: {
- runForNumbers(w, h, min, max, 0);
- } break;
- }
- }
- }
- }
- $? "- DkWxImgszFrame::run"
-}
-
-
-
-void
-DkWxImgszFrame::OnRun(wxCommandEvent& WXUNUSED(event))
-{
- $? "+ DkWxImgszFrame::OnRun"
- run(true);
- $? "- DkWxImgszFrame::OnRun"
-}
-
-
-
-DkWxImgszFrame::~DkWxImgszFrame()
-{
-}
-
-
-
-bool
-DkWxImgszFrame::canClose(bool isLast)
-{
- $? "+ DkWxBmepsFrame::canClose %d", (isLast ? 1 : 0)
- if(isLast) {
- saveData();
- } $? "- DkWxBmepsFrame::canClose 1"
- return true;
-}
-
-
-
-static wxChar const * const wximgsz_keys[] = {
-$!string-table macro=wxT
-wximgsz.width
-wximgsz.height
-wximgsz.selection
-wximgsz.minimum
-wximgsz.maximum
-wximgsz.colours
-$!end
-};
-
-void
-DkWxImgszFrame::saveData()
-{
- long i[] = {
- 0L, // Width
- 0L, // Height
- 0L, // Selection
- 0L, // Minimum
- 0L, // Maximum
- 0L // bUseColour
- };
- long l;
- if((tWidth->GetValue()).ToLong(&l)) {
- i[0] = l;
- }
- if((tHeight->GetValue()).ToLong(&l)) {
- i[1] = l;
- }
- i[2] = (long)(cbAction->GetCurrentSelection());
- if(i[2] < 0L) i[2] = 0L;
- if((tMinimum->GetValue()).ToLong(&l)) {
- i[3] = l;
- }
- if((tMaximum->GetValue()).ToLong(&l)) {
- i[4] = l;
- }
- i[5] = ((bUseColour) ? 1L : 0L);
- if(pHelper) {
- pHelper->saveMultipleLongs(wximgsz_keys, i);
- }
-}
-
-
-void
-DkWxImgszFrame::restoreData()
-{
- wxString sWidth;
- wxString sHeight;
- wxString sMinimum;
- wxString sMaximum;
- long i[] = {
- 1024L, // Width
- 768L, // Height
- 0L, // Selection
- 200L, // Minimum
- 800L, // Maximum
- 1L // bUseColour
- };
- if(pHelper) {
- pHelper->retrieveMultipleLongs(wximgsz_keys, i);
- sWidth.Printf(wxT("%ld"), i[0]);
- sHeight.Printf(wxT("%ld"), i[1]);
- sMinimum.Printf(wxT("%ld"), i[3]);
- sMaximum.Printf(wxT("%ld"), i[4]);
- tWidth->SetValue(sWidth);
- tHeight->SetValue(sHeight);
- tMinimum->SetValue(sMinimum);
- tMaximum->SetValue(sMaximum);
- cbAction->SetSelection((int)(i[2]));
- bUseColour = ((i[5]) ? true : false);
- }
-}
-
-
-
-void
-DkWxImgszFrame::enableDisableMinimumMaximum()
-{
- if(0 == cbAction->GetCurrentSelection()) {
- tMinimum->SetEditable(false);
- tMaximum->SetEditable(false);
- tMinimum->Enable(false);
- tMaximum->Enable(false);
- } else {
- tMinimum->SetEditable(true);
- tMaximum->SetEditable(true);
- tMinimum->Enable(true);
- tMaximum->Enable(true);
- }
-}
-
-
-
-void
-DkWxImgszFrame::OnChoice(wxCommandEvent & event)
-{
- enableDisableMinimumMaximum();
-}
-
-
-
-long
-DkWxImgszFrame::gcd(long aa, long bb)
-{
- long back = 0L;
- long h = 0L;
- long a;
- long b;
-
- a = aa;
- b = bb;
- while(b > 0L) {
- h = a % b;
- a = b;
- b = h;
- }
- back = a;
- return back;
-}
-
-
-long
-DkWxImgszFrame::getTextCtrlContents(wxTextCtrl *tf, bool bShowErrors)
-{
- long back = 0L;
- long l = 0L;
- if((tf->GetValue()).ToLong(&l)) {
- back = l;
- }
- if(0 >= back) {
- if(bShowErrors) {
- tf->SetFocus();
- wxMessageBox(sTexts[33], sTexts[32], (wxOK | wxICON_ERROR), this);
- }
- }
- return back;
-}
-
-
-
-void
-DkWxImgszFrame::runForNumbers(long w, long h, long min, long max, int inverted)
-{
- long gd;
- long w0;
- long h0;
- long nw;
- long nh;
- long i;
- long z;
- long n;
- long g2;
- int lineno;
- int cl;
- int rows;
- int found = 0;
-
- gd = gcd(w, h);
- if(gd > 0L) {
- /*
- Minimum rectangle.
- */
- w0 = w / gd;
- h0 = h / gd;
- /*
- Remove all grid lines.
- */
- rows = dataGrid->GetNumberRows();
- dataGrid->DeleteRows(0, rows);
- /*
- Build and fill new grid.
- */
- lineno = 0;
- i = 1;
- lStatus->SetForegroundColour(cBlack);
- lStatus->SetLabel(sTexts[18]);
- while((i * w0) <= max) {
- if((i * w0) >= min) {
- found = 1;
- nw = i * w0;
- nh = i * h0;
- /* Classify factor. */
- cl = classifyFactor(nw, w);
- g2 = gcd(nw, w);
- z = nw / g2; n = w / g2;
- dataGrid->AppendRows(1);
- dataGrid->SetCellTextColour(lineno, 0, cBlack);
- dataGrid->SetCellTextColour(lineno, 1, cBlack);
- dataGrid->SetCellTextColour(lineno, 2, cBlack);
- switch(cl) {
- case 2: {
- if(bUseColour) {
- dataGrid->SetCellBackgroundColour(lineno, 2, cGreen);
- } else {
- dataGrid->SetCellValue(lineno, 3, sTexts[36]);
- }
- } break;
- case 1: {
- if(bUseColour) {
- dataGrid->SetCellBackgroundColour(lineno, 2, cYellow);
- } else {
- dataGrid->SetCellValue(lineno, 3, sTexts[37]);
- }
- } break;
- default: {
- if(bUseColour) {
- dataGrid->SetCellBackgroundColour(lineno, 2, cRed);
- } else {
- dataGrid->SetCellValue(lineno, 3, wxT(""));
- }
- } break;
- }
- if(bUseColour) {
- dataGrid->SetCellValue(lineno, 3, wxT(""));
- }
- {
- wxString sRowHead;
- wxString sFactor;
- wxString sWidth;
- wxString sHeight;
-
- sRowHead.Printf(wxT("%d"), (lineno + 1));
- if(n > 1L) {
- sFactor.Printf(wxT("%ld / %ld"), z, n);
- } else {
- sFactor.Printf(wxT("%ld"), z);
- }
- if(inverted) {
- sWidth.Printf(wxT("%ld"), nh);
- sHeight.Printf(wxT("%ld"), nw);
- } else {
- sWidth.Printf(wxT("%ld"), nw);
- sHeight.Printf(wxT("%ld"), nh);
- }
- dataGrid->SetRowLabelValue(lineno, sRowHead);
- dataGrid->SetCellValue(lineno, 0, sWidth);
- dataGrid->SetCellValue(lineno, 1, sHeight);
- dataGrid->SetCellValue(lineno, 2, sFactor);
- dataGrid->SetCellAlignment(lineno, 0, wxALIGN_CENTRE, wxALIGN_CENTRE);
- dataGrid->SetCellAlignment(lineno, 1, wxALIGN_CENTRE, wxALIGN_CENTRE);
- dataGrid->SetCellAlignment(lineno, 2, wxALIGN_CENTRE, wxALIGN_CENTRE);
- dataGrid->SetCellAlignment(lineno, 3, wxALIGN_CENTRE, wxALIGN_CENTRE);
- }
- lineno++;
- }
- i++;
- }
- dataGrid->AutoSizeColumns();
- dataGrid->EnableDragColSize(true);
- if(0 == found) {
- lStatus->SetLabel(sTexts[34]);
- lStatus->SetForegroundColour(cDarkRed);
- }
- Refresh();
- Update();
- }
-}
-
-
-
-int
-DkWxImgszFrame::classifyFactor(long n, long o)
-{
- long max;
- long min;
- int back = 0;
- if(n > o) {
- max = n; min = o;
- } else {
- max = o; min = n;
- }
- if(max % min) {
- back = 0;
- } else {
- back = 1;
- max = max / min;
- if(countBits(max) == 1) {
- back = 2;
- }
- }
- return back;
-}
-
-
-int
-DkWxImgszFrame::countBits(long v)
-{
-#if DK3_SIZEOF_LONG > 2
-#if DK3_SIZEOF_LONG > 4
- long bitmask = 0x4000000000000000L;
- int attempts = 63;
-#else
- long bitmask = 0x40000000L;
- int attempts = 31;
-#endif
-#else
- long bitmask = 0x4000L;
- int attempts = 15;
-#endif
- int back = 0;
-
- while(attempts--) {
- if(v & bitmask) {
- back++;
- }
- bitmask = bitmask >> 1;
- }
- return back;
-}
-
-
diff --git a/support/dktools/DkWxImgszOptionsDialog.cpp b/support/dktools/DkWxImgszOptionsDialog.cpp
deleted file mode 100644
index 06b6793982..0000000000
--- a/support/dktools/DkWxImgszOptionsDialog.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxImgszOptionsDialog.wxc
-*/
-
-/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file DkWxImgszOptionsDialog.cpp The DkWxImgszOptionsDialog module.
-*/
-
-
-#line 126 "DkWxImgszOptionsDialog.wxc"
-
-#include "wximgsz.h"
-
-
-
-#line 130 "DkWxImgszOptionsDialog.wxc"
-
-BEGIN_EVENT_TABLE(DkWxImgszOptionsDialog, wxDialog)
- EVT_BUTTON(wxID_OK, DkWxImgszOptionsDialog::OnOK)
- EVT_BUTTON(wxID_CANCEL, DkWxImgszOptionsDialog::OnCancel)
-END_EVENT_TABLE()
-
-
-
-#line 138 "DkWxImgszOptionsDialog.wxc"
-DkWxImgszOptionsDialog::DkWxImgszOptionsDialog
-(
- DkWxImgszFrame *parent,
- wxChar const *title,
- wxChar const * const *messageTexts
-) : wxDialog(
- parent,
- wxID_ANY,
- title,
- wxDefaultPosition,
- wxDefaultSize,
- wxDEFAULT_DIALOG_STYLE
-)
-{
- sTexts = messageTexts;
- dkctGUILayoutOK = false;
- sDialog = NULL;
- verticalSizer = NULL;
- cbUseColours = NULL;
- buttonSizer = NULL;
- realButtonSizer = NULL;
- bOK = NULL;
- bCancel = NULL;
- sDialog = new wxBoxSizer(
- wxHORIZONTAL
- );
- if(!(sDialog)) {
- goto dkctGUILayoutFinished;
- }
- sDialog->Add(10, 10, 1);
- verticalSizer = new wxBoxSizer(
- wxVERTICAL
- );
- if(!(verticalSizer)) {
- goto dkctGUILayoutFinished;
- }
- verticalSizer->Add(10, 10, 1);
- cbUseColours = new wxCheckBox(
- this,
- wxID_ANY,
- sTexts[42]
- );
- if(!(cbUseColours)) {
- goto dkctGUILayoutFinished;
- }
- cbUseColours->SetToolTip(sTexts[43]);
- verticalSizer->Add(
- cbUseColours
- );
- verticalSizer->Add(10, 10, 0);
- buttonSizer = new wxBoxSizer(
- wxHORIZONTAL
- );
- if(!(buttonSizer)) {
- goto dkctGUILayoutFinished;
- }
- buttonSizer->Add(1, 1, 1);
- realButtonSizer = new wxStdDialogButtonSizer(
- );
- if(!(realButtonSizer)) {
- goto dkctGUILayoutFinished;
- }
- bOK = new wxButton(
- this,
- wxID_OK,
- sTexts[44]
- );
- if(!(bOK)) {
- goto dkctGUILayoutFinished;
- }
- bOK->SetToolTip(sTexts[46]);
- realButtonSizer->AddButton(
- bOK
- );
- bCancel = new wxButton(
- this,
- wxID_CANCEL,
- sTexts[45]
- );
- if(!(bCancel)) {
- goto dkctGUILayoutFinished;
- }
- bCancel->SetToolTip(sTexts[47]);
- realButtonSizer->AddButton(
- bCancel
- );
- realButtonSizer->Realize();
- buttonSizer->Add(
- realButtonSizer,
- 1,
- wxGROW
- );
- buttonSizer->Add(1, 1, 1);
- verticalSizer->Add(
- buttonSizer
- );
- verticalSizer->Add(10, 10, 1);
- sDialog->Add(
- verticalSizer
- );
- sDialog->Add(10, 10, 1);
- SetSizer(sDialog);
- dkctGUILayoutOK = true;
- dkctGUILayoutFinished:
- if(dkctGUILayoutOK) {
- sDialog->Fit(this);
- sDialog->SetSizeHints(this);
- }
-
-#line 154 "DkWxImgszOptionsDialog.wxc"
-}
-
-
-#line 157 "DkWxImgszOptionsDialog.wxc"
-
-
-void
-DkWxImgszOptionsDialog::OnOK(wxCommandEvent & event)
-{
- if(IsModal()) {
- value = cbUseColours->GetValue();
- EndModal(wxID_OK);
- } else {
- SetReturnCode(wxID_OK);
- Show(false);
- }
-}
-
-
-
-void
-DkWxImgszOptionsDialog::OnCancel(wxCommandEvent & event)
-{
- if(IsModal()) {
- EndModal(wxID_CANCEL);
- } else {
- SetReturnCode(wxID_CANCEL);
- Show(false);
- }
-}
-
-
-void
-DkWxImgszOptionsDialog::SetValue(bool b)
-{
- value = b;
- cbUseColours->SetValue(b);
-}
-
-
-
-bool
-DkWxImgszOptionsDialog::GetValue()
-{
- return value;
-}
-
-
-
-DkWxImgszOptionsDialog::~DkWxImgszOptionsDialog()
-{
-}
-
-
diff --git a/support/dktools/DkWxImgszOptionsDialog.h b/support/dktools/DkWxImgszOptionsDialog.h
deleted file mode 100644
index 2dfeee3ba3..0000000000
--- a/support/dktools/DkWxImgszOptionsDialog.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxImgszOptionsDialog.wxc
-*/
-
-/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file DkWxImgszOptionsDialog.h Header file for the DkWxImgszOptionsDialog module.
-*/
-
-#ifndef DKWXIMGSZOPTIONSDIALOG_H_INCLUDED
-/** Avoid multiple inclusions. */
-#define DKWXIMGSZOPTIONSDIALOG_H_INCLUDED 1
-
-
-#line 55 "DkWxImgszOptionsDialog.wxc"
-
-
-#line 57 "DkWxImgszOptionsDialog.wxc"
-
-/** Options dialog for the wximgsz program.
-*/
-class DkWxImgszOptionsDialog : public wxDialog
-{
- private:
-
- /** Event table.
- */
- DECLARE_EVENT_TABLE()
-
- protected:
-
- /** Localized text messages.
- */
- wxChar const * const *sTexts;
-
- /** Checkbox value.
- */
- bool value;
-
- /** Flag: GUI ok.
- */
- bool dkctGUILayoutOK;
-
- /** GUI element sDialog.
- */
-#line 13 "DkWxImgszOptionsDialog.wxc"
- wxBoxSizer *sDialog;
-
- /** GUI element verticalSizer.
- */
-#line 19 "DkWxImgszOptionsDialog.wxc"
- wxBoxSizer *verticalSizer;
-
- /** GUI element cbUseColours.
- */
-#line 27 "DkWxImgszOptionsDialog.wxc"
- wxCheckBox *cbUseColours;
-
- /** GUI element buttonSizer.
- */
-#line 31 "DkWxImgszOptionsDialog.wxc"
- wxBoxSizer *buttonSizer;
-
- /** GUI element realButtonSizer.
- */
-#line 37 "DkWxImgszOptionsDialog.wxc"
- wxStdDialogButtonSizer *realButtonSizer;
-
- /** GUI element bOK.
- */
-#line 43 "DkWxImgszOptionsDialog.wxc"
- wxButton *bOK;
-
- /** GUI element bCancel.
- */
-#line 48 "DkWxImgszOptionsDialog.wxc"
- wxButton *bCancel;
-
-
-#line 79 "DkWxImgszOptionsDialog.wxc"
-
- public:
-
- /** Constructor.
- @param parent Parent window.
- @param title Window title.
- @param messageTexts Localized message texts.
- */
- DkWxImgszOptionsDialog(
- DkWxImgszFrame *parent,
- wxChar const *title,
- wxChar const * const *messageTexts
- );
-
- /** Destructor.
- */
- ~DkWxImgszOptionsDialog();
-
- /** Event handler: OK button pressed.
- @param event Event to process.
- */
- void
- OnOK(wxCommandEvent & event);
-
- /** Event handler: Cancel button pressed.
- @param event Event to process.
- */
- void
- OnCancel(wxCommandEvent & event);
-
- /** Set new checkbox value.
- @param b New checkbox value.
- */
- void
- SetValue(bool b);
-
- /** Get checkbox value.
- @return Checkbox value.
- */
- bool
- GetValue();
-
-};
-
-
-#line 124 "DkWxImgszOptionsDialog.wxc"
-
-
-#endif
diff --git a/support/dktools/DkWxImgszOptionsDialog.wxc b/support/dktools/DkWxImgszOptionsDialog.wxc
deleted file mode 100644
index 06c65be35d..0000000000
--- a/support/dktools/DkWxImgszOptionsDialog.wxc
+++ /dev/null
@@ -1,206 +0,0 @@
-%% options
-
-copyright owner = Dirk Krause
-copyright year = 2012-xxxx
-license = bsd
-
-
-%% wx-gui
-
-type = dialog
-contents = sDialog
-
-[wxBoxSizer sDialog]
-direction = horizontal
-contents = $stretch(10)
-contents = verticalSizer
-contents = $stretch(10)
-
-[wxBoxSizer verticalSizer]
-direction = vertical
-contents = $stretch(10)
-contents = cbUseColours
-contents = $space(10)
-contents = buttonSizer
-contents = $stretch(10)
-
-[wxCheckBox cbUseColours]
-text = sTexts[42]
-tip = sTexts[43]
-
-[wxBoxSizer buttonSizer]
-direction = horizontal
-contents = $stretch(1)
-contents = realButtonSizer
-contents = $stretch(1)
-
-[wxStdDialogButtonSizer realButtonSizer]
-grow = yes
-proportion = 1
-contents = bOK
-contents = bCancel
-
-[wxButton bOK]
-id = wxID_OK
-text = sTexts[44]
-tip = sTexts[46]
-
-[wxButton bCancel]
-id = wxID_CANCEL
-text = sTexts[45]
-tip = sTexts[47]
-
-
-%% header start
-
-%% class start
-
-/** Options dialog for the wximgsz program.
-*/
-class DkWxImgszOptionsDialog : public wxDialog
-{
- private:
-
- /** Event table.
- */
- DECLARE_EVENT_TABLE()
-
- protected:
-
- /** Localized text messages.
- */
- wxChar const * const *sTexts;
-
- /** Checkbox value.
- */
- bool value;
-
-%% class end
-
- public:
-
- /** Constructor.
- @param parent Parent window.
- @param title Window title.
- @param messageTexts Localized message texts.
- */
- DkWxImgszOptionsDialog(
- DkWxImgszFrame *parent,
- wxChar const *title,
- wxChar const * const *messageTexts
- );
-
- /** Destructor.
- */
- ~DkWxImgszOptionsDialog();
-
- /** Event handler: OK button pressed.
- @param event Event to process.
- */
- void
- OnOK(wxCommandEvent & event);
-
- /** Event handler: Cancel button pressed.
- @param event Event to process.
- */
- void
- OnCancel(wxCommandEvent & event);
-
- /** Set new checkbox value.
- @param b New checkbox value.
- */
- void
- SetValue(bool b);
-
- /** Get checkbox value.
- @return Checkbox value.
- */
- bool
- GetValue();
-
-};
-
-%% header end
-
-%% module start
-
-#include "wximgsz.h"
-
-$!trace-include
-
-BEGIN_EVENT_TABLE(DkWxImgszOptionsDialog, wxDialog)
- EVT_BUTTON(wxID_OK, DkWxImgszOptionsDialog::OnOK)
- EVT_BUTTON(wxID_CANCEL, DkWxImgszOptionsDialog::OnCancel)
-END_EVENT_TABLE()
-
-
-%% constructor start
-DkWxImgszOptionsDialog::DkWxImgszOptionsDialog
-(
- DkWxImgszFrame *parent,
- wxChar const *title,
- wxChar const * const *messageTexts
-) : wxDialog(
- parent,
- wxID_ANY,
- title,
- wxDefaultPosition,
- wxDefaultSize,
- wxDEFAULT_DIALOG_STYLE
-)
-{
- sTexts = messageTexts;
-%% constructor end
-}
-
-%% module end
-
-
-void
-DkWxImgszOptionsDialog::OnOK(wxCommandEvent & event)
-{
- if(IsModal()) {
- value = cbUseColours->GetValue();
- EndModal(wxID_OK);
- } else {
- SetReturnCode(wxID_OK);
- Show(false);
- }
-}
-
-
-
-void
-DkWxImgszOptionsDialog::OnCancel(wxCommandEvent & event)
-{
- if(IsModal()) {
- EndModal(wxID_CANCEL);
- } else {
- SetReturnCode(wxID_CANCEL);
- Show(false);
- }
-}
-
-
-void
-DkWxImgszOptionsDialog::SetValue(bool b)
-{
- value = b;
- cbUseColours->SetValue(b);
-}
-
-
-
-bool
-DkWxImgszOptionsDialog::GetValue()
-{
- return value;
-}
-
-
-
-DkWxImgszOptionsDialog::~DkWxImgszOptionsDialog()
-{
-}
-
-
diff --git a/support/dktools/DkWxPathApp.cpp b/support/dktools/DkWxPathApp.cpp
index a5a83bafbb..3a81dac71d 100644
--- a/support/dktools/DkWxPathApp.cpp
+++ b/support/dktools/DkWxPathApp.cpp
@@ -1,56 +1,40 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxPathApp.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxPathApp.cpt
*/
/** @file DkWxPathApp.cpp The DkWxPathApp module.
*/
-#line 44 "DkWxPathApp.cpt"
+#line 48 "DkWxPathApp.cpt"
+#include "dk3conf.h"
#include "dkwxpath.h"
-#line 49 "DkWxPathApp.cpt"
+#line 54 "DkWxPathApp.cpt"
/** Implementation of application methods.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkWxPathApp);
+#else
IMPLEMENT_APP(DkWxPathApp)
+#endif
/** Default texts used if no localized texts found.
@@ -125,7 +109,7 @@ wxT("Checksums"),
NULL
-#line 150 "DkWxPathApp.cpt"
+#line 160 "DkWxPathApp.cpt"
};
@@ -142,7 +126,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 161 "DkWxPathApp.cpt"
+#line 171 "DkWxPathApp.cpt"
};
@@ -166,10 +150,10 @@ DkWxPathApp::OnInit()
-#line 183 "DkWxPathApp.cpt"
+#line 193 "DkWxPathApp.cpt"
-#line 184 "DkWxPathApp.cpt"
+#line 194 "DkWxPathApp.cpt"
pHelper =
new DkWxAppHelper(argv[0], dkwxpath_default_texts[2], dkwxpath_groupname);
@@ -216,8 +200,8 @@ DkWxPathApp::OnInit()
goto finished;
}
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
finished:
@@ -228,7 +212,7 @@ DkWxPathApp::OnInit()
}
-#line 241 "DkWxPathApp.cpt"
+#line 251 "DkWxPathApp.cpt"
return back;
}
@@ -240,16 +224,16 @@ DkWxPathApp::OnExit()
int back = 0;
-#line 251 "DkWxPathApp.cpt"
+#line 261 "DkWxPathApp.cpt"
if(pHelper) {
delete(pHelper); pHelper = NULL;
}
-#line 255 "DkWxPathApp.cpt"
+#line 265 "DkWxPathApp.cpt"
-#line 256 "DkWxPathApp.cpt"
+#line 266 "DkWxPathApp.cpt"
return back;
}
diff --git a/support/dktools/DkWxPathApp.cpt b/support/dktools/DkWxPathApp.cpt
index 333d187f79..449c31dd42 100644
--- a/support/dktools/DkWxPathApp.cpt
+++ b/support/dktools/DkWxPathApp.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -36,12 +36,17 @@ class DkWxPathApp : public wxApp
virtual int OnExit();
};
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkWxPathApp);
+#else
DECLARE_APP(DkWxPathApp)
+#endif
%% module
+#include "dk3conf.h"
#include "dkwxpath.h"
@@ -51,7 +56,12 @@ $!trace-include
/** Implementation of application methods.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkWxPathApp);
+#else
IMPLEMENT_APP(DkWxPathApp)
+#endif
/** Default texts used if no localized texts found.
@@ -227,8 +237,8 @@ DkWxPathApp::OnInit()
goto finished;
}
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
finished:
diff --git a/support/dktools/DkWxPathApp.h b/support/dktools/DkWxPathApp.h
index 1a4a2b4bd2..acc15dee56 100644
--- a/support/dktools/DkWxPathApp.h
+++ b/support/dktools/DkWxPathApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxPathApp.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxPathApp.cpt
*/
/** @file DkWxPathApp.h Header file for the DkWxPathApp module.
@@ -71,7 +49,11 @@ class DkWxPathApp : public wxApp
virtual int OnExit();
};
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkWxPathApp);
+#else
DECLARE_APP(DkWxPathApp)
+#endif
diff --git a/support/dktools/DkWxPathFrame.cpp b/support/dktools/DkWxPathFrame.cpp
index 0e166e3445..f649c02665 100644
--- a/support/dktools/DkWxPathFrame.cpp
+++ b/support/dktools/DkWxPathFrame.cpp
@@ -1,58 +1,44 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxPathFrame.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxPathFrame.wxc
*/
/** @file DkWxPathFrame.cpp The DkWxPathFrame module.
*/
-#line 118 "DkWxPathFrame.wxc"
+#line 122 "DkWxPathFrame.wxc"
#include "dk3conf.h"
#include "dk3types.h"
#include "dk3wreg.h"
#include "dkwxpath.h"
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
-#line 126 "DkWxPathFrame.wxc"
+#line 130 "DkWxPathFrame.wxc"
-BEGIN_EVENT_TABLE(DkWxPathFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxPathFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkWxPathFrame,wxFrame)
+#endif
EVT_IDLE(DkWxPathFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -167,7 +153,7 @@ dkT("*\\shell"),
NULL
-#line 253 "DkWxPathFrame.wxc"
+#line 265 "DkWxPathFrame.wxc"
};
#if DK3_ON_WINDOWS && ((DK3_CHAR_SIZE == 1) || (DK3_CHAR_SIZE == 2))
@@ -210,7 +196,7 @@ dk3_win_check_path(dkChar *bu, dkChar const *dn)
int back = 0;
-#line 294 "DkWxPathFrame.wxc"
+#line 306 "DkWxPathFrame.wxc"
pc = bu;
while((pc) && (0 == back)) {
pn = dk3str_chr(pc, dkT(';'));
@@ -221,7 +207,7 @@ dk3_win_check_path(dkChar *bu, dkChar const *dn)
pc = pn;
}
-#line 303 "DkWxPathFrame.wxc"
+#line 315 "DkWxPathFrame.wxc"
return back;
}
#endif
@@ -249,7 +235,7 @@ dkwxpath_register_context_entries(
HKEY hk;
-#line 329 "DkWxPathFrame.wxc"
+#line 341 "DkWxPathFrame.wxc"
acp = act;
while((acp->menuitem) && (acp->progname) && (acp->arguments)) {
szk = 2 + dk3str_len(cl) + dk3str_len(dkwxpath_noloc[0])
@@ -259,13 +245,13 @@ dkwxpath_register_context_entries(
if((szk < DK3_MAX_PATH) && (szv < DK3_MAX_PATH)) {
dk3str_cpy(kn1, cl);
-#line 337 "DkWxPathFrame.wxc"
+#line 349 "DkWxPathFrame.wxc"
if(dk3wreg_key_create_read(HKEY_CLASSES_ROOT, kn1, &hk, app)) {
dk3wreg_key_close(hk, kn1, app);
dk3str_cpy(kn1, cl);
dk3str_cat(kn1, dkwxpath_noloc[0]);
-#line 341 "DkWxPathFrame.wxc"
+#line 353 "DkWxPathFrame.wxc"
if(dk3wreg_key_create_read(HKEY_CLASSES_ROOT, kn1, &hk, app)) {
dk3wreg_key_close(hk, kn1, app);
dk3str_cpy(kn1, cl);
@@ -273,7 +259,7 @@ dkwxpath_register_context_entries(
dk3str_cat(kn1, dkwxpath_noloc[4]);
dk3str_cat(kn1, acp->menuitem);
-#line 347 "DkWxPathFrame.wxc"
+#line 359 "DkWxPathFrame.wxc"
if(dk3wreg_key_create_read(HKEY_CLASSES_ROOT, kn1, &hk, app)) {
dk3wreg_key_close(hk, kn1, app);
dk3str_cpy(kn1, cl);
@@ -282,7 +268,7 @@ dkwxpath_register_context_entries(
dk3str_cat(kn1, acp->menuitem);
dk3str_cat(kn1, dkwxpath_noloc[1]);
-#line 354 "DkWxPathFrame.wxc"
+#line 366 "DkWxPathFrame.wxc"
dk3str_cpy(kn2, dkwxpath_noloc[2]);
dk3str_cat(kn2, dn);
dk3str_cat(kn2, dkwxpath_noloc[4]);
@@ -291,11 +277,11 @@ dkwxpath_register_context_entries(
dk3str_cat(kn2, dkwxpath_noloc[3]);
dk3str_cat(kn2, acp->arguments);
-#line 361 "DkWxPathFrame.wxc"
+#line 373 "DkWxPathFrame.wxc"
if(dk3wreg_key_create_modify(HKEY_CLASSES_ROOT, kn1, &hk, app)) {
(void)dk3wreg_set_sz(hk, NULL, kn2, app);
-#line 363 "DkWxPathFrame.wxc"
+#line 375 "DkWxPathFrame.wxc"
dk3wreg_key_close(hk, kn1, app);
}
}
@@ -307,7 +293,7 @@ dkwxpath_register_context_entries(
/* Checksums for files */
-#line 373 "DkWxPathFrame.wxc"
+#line 385 "DkWxPathFrame.wxc"
}
@@ -329,7 +315,7 @@ dkwxpath_unregister_context_entries(
size_t szk;
-#line 393 "DkWxPathFrame.wxc"
+#line 405 "DkWxPathFrame.wxc"
acp = act;
while((acp->menuitem) && (acp->progname) && (acp->arguments)) {
szk = 2 + dk3str_len(cl) + dk3str_len(dkwxpath_noloc[0])
@@ -340,14 +326,14 @@ dkwxpath_unregister_context_entries(
dk3str_cat(kn1, dkwxpath_noloc[4]);
dk3str_cat(kn1, acp->menuitem);
-#line 402 "DkWxPathFrame.wxc"
+#line 414 "DkWxPathFrame.wxc"
(void)dk3wreg_key_delete(HKEY_CLASSES_ROOT, kn1, app);
}
acp++;
}
-#line 407 "DkWxPathFrame.wxc"
+#line 419 "DkWxPathFrame.wxc"
}
@@ -372,15 +358,15 @@ dkwxpath_register_context_menus(
HKEY hk;
-#line 430 "DkWxPathFrame.wxc"
+#line 442 "DkWxPathFrame.wxc"
ftp = dkwxpath_filetypes;
while((ftp->suffix) && (ftp->classname) && (ftp->items)) {
-#line 433 "DkWxPathFrame.wxc"
+#line 445 "DkWxPathFrame.wxc"
-#line 434 "DkWxPathFrame.wxc"
+#line 446 "DkWxPathFrame.wxc"
cln[0] = dkT('\0');
hcl = 0;
if(dk3wreg_key_create_modify(HKEY_CLASSES_ROOT, ftp->suffix, &hk, app)) {
@@ -435,7 +421,7 @@ dkwxpath_register_context_menus(
}
-#line 487 "DkWxPathFrame.wxc"
+#line 499 "DkWxPathFrame.wxc"
}
@@ -454,15 +440,15 @@ dkwxpath_unregister_context_menus(
HKEY hk;
-#line 504 "DkWxPathFrame.wxc"
+#line 516 "DkWxPathFrame.wxc"
ftp = dkwxpath_filetypes;
while((ftp->suffix) && (ftp->classname) && (ftp->items)) {
-#line 507 "DkWxPathFrame.wxc"
+#line 519 "DkWxPathFrame.wxc"
-#line 508 "DkWxPathFrame.wxc"
+#line 520 "DkWxPathFrame.wxc"
cln[0] = dkT('\0');
hcl = 0;
if(dk3wreg_key_create_modify(HKEY_CLASSES_ROOT, ftp->suffix, &hk, app)) {
@@ -492,7 +478,7 @@ dkwxpath_unregister_context_menus(
}
-#line 536 "DkWxPathFrame.wxc"
+#line 548 "DkWxPathFrame.wxc"
}
@@ -518,7 +504,7 @@ dkwxpath_set_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
HKEY regkey;
-#line 560 "DkWxPathFrame.wxc"
+#line 572 "DkWxPathFrame.wxc"
regsam = KEY_ALL_ACCESS;
#if DK3_CHAR_SIZE == 2
res = RegOpenKeyExW(
@@ -531,7 +517,7 @@ dkwxpath_set_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
#endif
if(ERROR_SUCCESS == res) {
-#line 571 "DkWxPathFrame.wxc"
+#line 583 "DkWxPathFrame.wxc"
dwType = REG_EXPAND_SZ;
dwSz = (DWORD)sizeof(b1);
#if DK3_CHAR_SIZE == 2
@@ -547,35 +533,35 @@ dkwxpath_set_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
#endif
if(ERROR_SUCCESS == res) {
-#line 585 "DkWxPathFrame.wxc"
+#line 597 "DkWxPathFrame.wxc"
res = 1L;
#if DK3_CHAR_SIZE == 2
if(dwSz % (DWORD)2L) {
-#line 588 "DkWxPathFrame.wxc"
+#line 600 "DkWxPathFrame.wxc"
res = 0L;
} else {
-#line 590 "DkWxPathFrame.wxc"
+#line 602 "DkWxPathFrame.wxc"
dwSz = dwSz / (DWORD)2L;
}
#endif
if(dwType != REG_SZ) {
if(dwType != REG_EXPAND_SZ) {
-#line 595 "DkWxPathFrame.wxc"
+#line 607 "DkWxPathFrame.wxc"
res = 0L;
}
}
if(1L == res) {
-#line 599 "DkWxPathFrame.wxc"
+#line 611 "DkWxPathFrame.wxc"
if((DWORD)0L < dwSz) {
-#line 600 "DkWxPathFrame.wxc"
+#line 612 "DkWxPathFrame.wxc"
if(dwSz < DK3_SIZEOF(b1,dkChar)) {
-#line 601 "DkWxPathFrame.wxc"
+#line 613 "DkWxPathFrame.wxc"
b1[dwSz] = dkT('\0');
dk3str_cpy(b2, b1);
if(dk3_win_check_path(b2, dn)) {
@@ -606,26 +592,26 @@ dkwxpath_set_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
}
} else {
-#line 630 "DkWxPathFrame.wxc"
+#line 642 "DkWxPathFrame.wxc"
}
}
} else {
-#line 633 "DkWxPathFrame.wxc"
+#line 645 "DkWxPathFrame.wxc"
}
} else {
-#line 635 "DkWxPathFrame.wxc"
+#line 647 "DkWxPathFrame.wxc"
}
}
} else {
-#line 638 "DkWxPathFrame.wxc"
+#line 650 "DkWxPathFrame.wxc"
}
RegCloseKey(regkey);
} else {
-#line 641 "DkWxPathFrame.wxc"
+#line 653 "DkWxPathFrame.wxc"
}
dkwxpath_register_context_menus(dn, app, cmn);
#else
@@ -634,7 +620,7 @@ dkwxpath_set_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
/* if DK3_ON_WINDOWS ... */
-#line 648 "DkWxPathFrame.wxc"
+#line 660 "DkWxPathFrame.wxc"
return back;
}
@@ -682,7 +668,7 @@ dkwxpath_unset_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
int back = 0;
-#line 694 "DkWxPathFrame.wxc"
+#line 706 "DkWxPathFrame.wxc"
#if DK3_ON_WINDOWS && ((DK3_CHAR_SIZE == 1) || (DK3_CHAR_SIZE == 2))
dkChar b1[16 * DK3_MAX_PATH];
dkChar b2[16 * DK3_MAX_PATH];
@@ -704,7 +690,7 @@ dkwxpath_unset_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
#endif
if(ERROR_SUCCESS == res) {
-#line 714 "DkWxPathFrame.wxc"
+#line 726 "DkWxPathFrame.wxc"
dwType = REG_EXPAND_SZ;
dwSz = (DWORD)sizeof(b1);
#if DK3_CHAR_SIZE == 2
@@ -720,7 +706,7 @@ dkwxpath_unset_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
#endif
if(ERROR_SUCCESS == res) {
-#line 728 "DkWxPathFrame.wxc"
+#line 740 "DkWxPathFrame.wxc"
res = 1L;
#if DK3_CHAR_SIZE == 2
if(dwSz % (DWORD)2L) {
@@ -736,10 +722,10 @@ dkwxpath_unset_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
}
if(1L == res) {
-#line 742 "DkWxPathFrame.wxc"
+#line 754 "DkWxPathFrame.wxc"
if((DWORD)0L < dwSz) {
-#line 743 "DkWxPathFrame.wxc"
+#line 755 "DkWxPathFrame.wxc"
if(dwSz < DK3_SIZEOF(b1,dkChar)) {
b1[dwSz] = dkT('\0');
dkwxpath_remove(b2, b1, dn);
@@ -758,42 +744,42 @@ dkwxpath_unset_regentry(dkChar const *dn, dk3_app_t *app, const dkChar *cmn)
#endif
if(ERROR_SUCCESS == res) {
-#line 760 "DkWxPathFrame.wxc"
+#line 772 "DkWxPathFrame.wxc"
back = 1;
} else {
-#line 762 "DkWxPathFrame.wxc"
+#line 774 "DkWxPathFrame.wxc"
}
}
} else {
-#line 765 "DkWxPathFrame.wxc"
+#line 777 "DkWxPathFrame.wxc"
}
} else {
-#line 767 "DkWxPathFrame.wxc"
+#line 779 "DkWxPathFrame.wxc"
}
} else {
-#line 769 "DkWxPathFrame.wxc"
+#line 781 "DkWxPathFrame.wxc"
}
RegCloseKey(regkey);
} else {
-#line 772 "DkWxPathFrame.wxc"
+#line 784 "DkWxPathFrame.wxc"
}
dkwxpath_unregister_context_menus(dn, app, cmn);
#endif
-#line 776 "DkWxPathFrame.wxc"
+#line 788 "DkWxPathFrame.wxc"
return back;
}
-#line 782 "DkWxPathFrame.wxc"
+#line 794 "DkWxPathFrame.wxc"
DkWxPathFrame::DkWxPathFrame(
wxChar const *applicationName,
wxChar const * const *localizedTexts,
@@ -862,10 +848,7 @@ DkWxPathFrame::DkWxPathFrame(
mainSizer->SetSizeHints(this);
}
-#line 803 "DkWxPathFrame.wxc"
-#if 0
- restorePosition();
-#endif
+#line 815 "DkWxPathFrame.wxc"
processArguments(argc, argv);
/* Set context menu item texts
*/
@@ -886,7 +869,7 @@ DkWxPathFrame::DkWxPathFrame(
}
-#line 826 "DkWxPathFrame.wxc"
+#line 835 "DkWxPathFrame.wxc"
@@ -1006,6 +989,11 @@ DkWxPathFrame::canClose(bool isLast)
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc dkwxpath_cmd_line_desc[] = {
{
wxCMD_LINE_SWITCH,
@@ -1016,6 +1004,9 @@ static const wxCmdLineEntryDesc dkwxpath_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
void
@@ -1025,20 +1016,20 @@ DkWxPathFrame::processArguments(int argc, wxChar **argv)
int res;
-#line 963 "DkWxPathFrame.wxc"
+#line 980 "DkWxPathFrame.wxc"
wxCmdLineParser parser(dkwxpath_cmd_line_desc, argc, argv);
res = parser.Parse(false);
if(0 == res) {
-#line 966 "DkWxPathFrame.wxc"
+#line 983 "DkWxPathFrame.wxc"
if(parser.Found(wxT("u"))) {
-#line 967 "DkWxPathFrame.wxc"
+#line 984 "DkWxPathFrame.wxc"
bUninstall = true;
}
}
-#line 970 "DkWxPathFrame.wxc"
+#line 987 "DkWxPathFrame.wxc"
}
diff --git a/support/dktools/DkWxPathFrame.h b/support/dktools/DkWxPathFrame.h
index 27ea56f001..77dd3d630f 100644
--- a/support/dktools/DkWxPathFrame.h
+++ b/support/dktools/DkWxPathFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxPathFrame.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxPathFrame.wxc
*/
/** @file DkWxPathFrame.h Header file for the DkWxPathFrame module.
@@ -54,7 +32,11 @@ class DkWxPathFrame : public DkWxFrame
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -101,7 +83,7 @@ class DkWxPathFrame : public DkWxFrame
wxStaticText *lModifying;
-#line 66 "DkWxPathFrame.wxc"
+#line 70 "DkWxPathFrame.wxc"
public:
@@ -151,7 +133,7 @@ class DkWxPathFrame : public DkWxFrame
};
-#line 115 "DkWxPathFrame.wxc"
+#line 119 "DkWxPathFrame.wxc"
diff --git a/support/dktools/DkWxPathFrame.wxc b/support/dktools/DkWxPathFrame.wxc
index ba354defd1..4022e1c0ac 100644
--- a/support/dktools/DkWxPathFrame.wxc
+++ b/support/dktools/DkWxPathFrame.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% wx-gui
@@ -39,7 +39,11 @@ class DkWxPathFrame : public DkWxFrame
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -120,14 +124,22 @@ class DkWxPathFrame : public DkWxFrame
#include "dk3types.h"
#include "dk3wreg.h"
#include "dkwxpath.h"
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
$!trace-include
-BEGIN_EVENT_TABLE(DkWxPathFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxPathFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkWxPathFrame,wxFrame)
+#endif
EVT_IDLE(DkWxPathFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -800,9 +812,6 @@ DkWxPathFrame::DkWxPathFrame(
bRunning = false;
bUninstall = false;
%% constructor end
-#if 0
- restorePosition();
-#endif
processArguments(argc, argv);
/* Set context menu item texts
*/
@@ -942,6 +951,11 @@ DkWxPathFrame::canClose(bool isLast)
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc dkwxpath_cmd_line_desc[] = {
{
wxCMD_LINE_SWITCH,
@@ -952,6 +966,9 @@ static const wxCmdLineEntryDesc dkwxpath_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
void
diff --git a/support/dktools/DkWxProcessingController.cpp b/support/dktools/DkWxProcessingController.cpp
index 2aae78f48e..beb4e8cfd8 100644
--- a/support/dktools/DkWxProcessingController.cpp
+++ b/support/dktools/DkWxProcessingController.cpp
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxProcessingController.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxProcessingController.cpt
*/
/** @file DkWxProcessingController.cpp The DkWxProcessingController module.
@@ -39,11 +17,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 60 "DkWxProcessingController.cpt"
+#include "dk3conf.h"
#include "DkWxProcessingController.h"
-#line 64 "DkWxProcessingController.cpt"
+#line 65 "DkWxProcessingController.cpt"
DkWxProcessingController::DkWxProcessingController()
{
diff --git a/support/dktools/DkWxProcessingController.cpt b/support/dktools/DkWxProcessingController.cpt
index 6bd67dc7b0..50b0f4b5d7 100644
--- a/support/dktools/DkWxProcessingController.cpt
+++ b/support/dktools/DkWxProcessingController.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -58,6 +58,7 @@ class DkWxProcessingController
%% module
+#include "dk3conf.h"
#include "DkWxProcessingController.h"
$!trace-include
diff --git a/support/dktools/DkWxProcessingController.h b/support/dktools/DkWxProcessingController.h
index 222ba9e084..6195961c4c 100644
--- a/support/dktools/DkWxProcessingController.h
+++ b/support/dktools/DkWxProcessingController.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxProcessingController.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxProcessingController.cpt
*/
/** @file DkWxProcessingController.h Header file for the DkWxProcessingController module.
diff --git a/support/dktools/DkWxProcessingIdleController.cpp b/support/dktools/DkWxProcessingIdleController.cpp
index 96eded06bd..daa4f3e1b7 100644
--- a/support/dktools/DkWxProcessingIdleController.cpp
+++ b/support/dktools/DkWxProcessingIdleController.cpp
@@ -1,51 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxProcessingIdleController.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxProcessingIdleController.cpt
*/
/** @file DkWxProcessingIdleController.cpp The DkWxProcessingIdleController module.
*/
-#line 51 "DkWxProcessingIdleController.cpt"
+#line 58 "DkWxProcessingIdleController.cpt"
+#include "dk3conf.h"
#include "DkWxProcessingIdleController.h"
-#line 57 "DkWxProcessingIdleController.cpt"
+#line 65 "DkWxProcessingIdleController.cpt"
diff --git a/support/dktools/DkWxProcessingIdleController.cpt b/support/dktools/DkWxProcessingIdleController.cpt
index 0fb8f45420..c1fde629bf 100644
--- a/support/dktools/DkWxProcessingIdleController.cpt
+++ b/support/dktools/DkWxProcessingIdleController.cpt
@@ -2,11 +2,18 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
+#endif
+
+#ifndef DKWXPROCESSINGCONTROLLER_H_INCLUDED
#include <DkWxProcessingController.h>
+#endif
+
/** Protect idle event handler from concurrent execution.
In contrast to a critical section which delays execution of
@@ -49,6 +56,7 @@ class DkWxProcessingIdleController : public DkWxProcessingController
%% module
+#include "dk3conf.h"
#include "DkWxProcessingIdleController.h"
diff --git a/support/dktools/DkWxProcessingIdleController.h b/support/dktools/DkWxProcessingIdleController.h
index dc1bf8afd2..c09230cf4e 100644
--- a/support/dktools/DkWxProcessingIdleController.h
+++ b/support/dktools/DkWxProcessingIdleController.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxProcessingIdleController.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxProcessingIdleController.cpt
*/
/** @file DkWxProcessingIdleController.h Header file for the DkWxProcessingIdleController module.
@@ -43,7 +21,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 8 "DkWxProcessingIdleController.cpt"
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
+#endif
+
+#ifndef DKWXPROCESSINGCONTROLLER_H_INCLUDED
#include <DkWxProcessingController.h>
+#endif
+
/** Protect idle event handler from concurrent execution.
In contrast to a critical section which delays execution of
diff --git a/support/dktools/DkWxProgressDialog.cpp b/support/dktools/DkWxProgressDialog.cpp
index 70fb55d5c9..7cc9d1f3b5 100644
--- a/support/dktools/DkWxProgressDialog.cpp
+++ b/support/dktools/DkWxProgressDialog.cpp
@@ -1,54 +1,40 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxProgressDialog.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxProgressDialog.wxc
*/
/** @file DkWxProgressDialog.cpp The DkWxProgressDialog module.
*/
-#line 142 "DkWxProgressDialog.wxc"
+#line 146 "DkWxProgressDialog.wxc"
#include "dkwxtrace.h"
-#line 146 "DkWxProgressDialog.wxc"
+#line 150 "DkWxProgressDialog.wxc"
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxProgressDialog,wxDialog)
+#else
BEGIN_EVENT_TABLE(DkWxProgressDialog,wxDialog)
+#endif
EVT_IDLE(DkWxProgressDialog::OnIdle)
EVT_BUTTON(wxID_CANCEL, DkWxProgressDialog::OnCancel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -73,13 +59,13 @@ wxT("Cancel command scheduled... Wait, please!"),
NULL
-#line 179 "DkWxProgressDialog.wxc"
+#line 191 "DkWxProgressDialog.wxc"
};
-#line 184 "DkWxProgressDialog.wxc"
+#line 196 "DkWxProgressDialog.wxc"
DkWxProgressDialog::DkWxProgressDialog(
DkWxFrame *parent,
DkWxCommunicator *comm,
@@ -100,7 +86,7 @@ DkWxProgressDialog::DkWxProgressDialog(
{
-#line 203 "DkWxProgressDialog.wxc"
+#line 215 "DkWxProgressDialog.wxc"
pParent = parent;
pLogTextField = tc;
pComm = comm;
@@ -203,7 +189,7 @@ DkWxProgressDialog::DkWxProgressDialog(
sDialog->SetSizeHints(this);
}
-#line 208 "DkWxProgressDialog.wxc"
+#line 220 "DkWxProgressDialog.wxc"
if(dkctGUILayoutOK) {
if(sttWait) {
sttWait->SetLabel(dkwx_pd_def_texts[0]);
@@ -211,13 +197,13 @@ DkWxProgressDialog::DkWxProgressDialog(
}
-#line 214 "DkWxProgressDialog.wxc"
+#line 226 "DkWxProgressDialog.wxc"
}
-#line 219 "DkWxProgressDialog.wxc"
+#line 231 "DkWxProgressDialog.wxc"
void
@@ -227,86 +213,86 @@ DkWxProgressDialog::OnIdle(wxIdleEvent & event)
int res;
-#line 227 "DkWxProgressDialog.wxc"
+#line 239 "DkWxProgressDialog.wxc"
if(pComm) {
-#line 228 "DkWxProgressDialog.wxc"
+#line 240 "DkWxProgressDialog.wxc"
res = pComm->getUpdates(this, sttFilename, gaugeProgress);
-#line 230 "DkWxProgressDialog.wxc"
+#line 242 "DkWxProgressDialog.wxc"
if(res & DK_WX_COMMUNICATOR_STATUS_UPDATE) {
-#line 231 "DkWxProgressDialog.wxc"
+#line 243 "DkWxProgressDialog.wxc"
Refresh();
Update();
} else {
-#line 234 "DkWxProgressDialog.wxc"
+#line 246 "DkWxProgressDialog.wxc"
}
if(res & DK_WX_COMMUNICATOR_STATUS_RUNNING) {
-#line 236 "DkWxProgressDialog.wxc"
+#line 248 "DkWxProgressDialog.wxc"
canContinue = 1;
} else {
-#line 238 "DkWxProgressDialog.wxc"
+#line 250 "DkWxProgressDialog.wxc"
canContinue = 0;
}
} else {
-#line 241 "DkWxProgressDialog.wxc"
+#line 253 "DkWxProgressDialog.wxc"
canContinue = 0;
}
if(canContinue) {
-#line 244 "DkWxProgressDialog.wxc"
+#line 256 "DkWxProgressDialog.wxc"
event.RequestMore();
} else {
-#line 246 "DkWxProgressDialog.wxc"
+#line 258 "DkWxProgressDialog.wxc"
canContinue = 1;
if(pComm) {
canContinue = pComm->getCanContinue();
if(pLogTextField) {
-#line 250 "DkWxProgressDialog.wxc"
+#line 262 "DkWxProgressDialog.wxc"
pComm->getText(pLogTextField);
if(pParent) {
-#line 252 "DkWxProgressDialog.wxc"
+#line 264 "DkWxProgressDialog.wxc"
pParent->Refresh();
} else {
-#line 254 "DkWxProgressDialog.wxc"
+#line 266 "DkWxProgressDialog.wxc"
pLogTextField->Refresh();
}
}
}
if(IsModal()) {
-#line 259 "DkWxProgressDialog.wxc"
+#line 271 "DkWxProgressDialog.wxc"
EndModal((canContinue) ? wxID_OK : wxID_CANCEL);
} else {
-#line 261 "DkWxProgressDialog.wxc"
+#line 273 "DkWxProgressDialog.wxc"
SetReturnCode((canContinue) ? wxID_OK : wxID_CANCEL);
Show(false);
}
}
event.Skip();
-#line 266 "DkWxProgressDialog.wxc"
+#line 278 "DkWxProgressDialog.wxc"
}
void
-DkWxProgressDialog::OnCancel(wxCommandEvent & event)
+DkWxProgressDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
{
-#line 274 "DkWxProgressDialog.wxc"
+#line 286 "DkWxProgressDialog.wxc"
if(pComm) {
pComm->setCanContinue(0);
}
@@ -321,7 +307,7 @@ DkWxProgressDialog::OnCancel(wxCommandEvent & event)
Update();
-#line 287 "DkWxProgressDialog.wxc"
+#line 299 "DkWxProgressDialog.wxc"
}
@@ -339,7 +325,7 @@ DkWxProgressDialog::chooseModalPosition()
int h = 0; /* Height. */
-#line 303 "DkWxProgressDialog.wxc"
+#line 315 "DkWxProgressDialog.wxc"
/* Sceen size */
wxSize scsz = wxGetDisplaySize();
pParent->GetPosition(&px, &py);
@@ -354,7 +340,7 @@ DkWxProgressDialog::chooseModalPosition()
SetSize(x, y, w, h);
-#line 316 "DkWxProgressDialog.wxc"
+#line 328 "DkWxProgressDialog.wxc"
}
diff --git a/support/dktools/DkWxProgressDialog.h b/support/dktools/DkWxProgressDialog.h
index ccec5bee0c..f206374f2c 100644
--- a/support/dktools/DkWxProgressDialog.h
+++ b/support/dktools/DkWxProgressDialog.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxProgressDialog.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxProgressDialog.wxc
*/
/** @file DkWxProgressDialog.h Header file for the DkWxProgressDialog module.
@@ -58,7 +36,11 @@ class DkWxProgressDialog : public wxDialog
private:
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -114,7 +96,7 @@ class DkWxProgressDialog : public wxDialog
wxButton *bCancel;
-#line 95 "DkWxProgressDialog.wxc"
+#line 99 "DkWxProgressDialog.wxc"
public:
/** Constructor.
@@ -149,7 +131,7 @@ class DkWxProgressDialog : public wxDialog
/** Handler for cancel button.
*/
void
- OnCancel(wxCommandEvent & WXUNUSED(event));
+ OnCancel(wxCommandEvent & event);
/** Choose a modal position centered on the parent.
*/
@@ -160,7 +142,7 @@ class DkWxProgressDialog : public wxDialog
-#line 140 "DkWxProgressDialog.wxc"
+#line 144 "DkWxProgressDialog.wxc"
#endif
diff --git a/support/dktools/DkWxProgressDialog.wxc b/support/dktools/DkWxProgressDialog.wxc
index 942d0d56d3..6bc57abadf 100644
--- a/support/dktools/DkWxProgressDialog.wxc
+++ b/support/dktools/DkWxProgressDialog.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% wx-gui
@@ -70,7 +70,11 @@ class DkWxProgressDialog : public wxDialog
private:
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -126,7 +130,7 @@ class DkWxProgressDialog : public wxDialog
/** Handler for cancel button.
*/
void
- OnCancel(wxCommandEvent & WXUNUSED(event));
+ OnCancel(wxCommandEvent & event);
/** Choose a modal position centered on the parent.
*/
@@ -144,10 +148,18 @@ class DkWxProgressDialog : public wxDialog
$!trace-include
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxProgressDialog,wxDialog)
+#else
BEGIN_EVENT_TABLE(DkWxProgressDialog,wxDialog)
+#endif
EVT_IDLE(DkWxProgressDialog::OnIdle)
EVT_BUTTON(wxID_CANCEL, DkWxProgressDialog::OnCancel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -268,7 +280,7 @@ DkWxProgressDialog::OnIdle(wxIdleEvent & event)
void
-DkWxProgressDialog::OnCancel(wxCommandEvent & event)
+DkWxProgressDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
{
$? "+ DkWxProgressDialog::OnCancel"
if(pComm) {
diff --git a/support/dktools/DkWxTraceApp.cpp b/support/dktools/DkWxTraceApp.cpp
index 66156853eb..3d312eb121 100644
--- a/support/dktools/DkWxTraceApp.cpp
+++ b/support/dktools/DkWxTraceApp.cpp
@@ -1,56 +1,40 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxTraceApp.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxTraceApp.cpt
*/
/** @file DkWxTraceApp.cpp The DkWxTraceApp module.
*/
-#line 47 "DkWxTraceApp.cpt"
+#line 51 "DkWxTraceApp.cpt"
+#include "dk3conf.h"
#include "dkwxtrace.h"
-#line 53 "DkWxTraceApp.cpt"
+#line 58 "DkWxTraceApp.cpt"
/** Implementation of DkWxTraceApp.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkWxTraceApp);
+#else
IMPLEMENT_APP(DkWxTraceApp)
+#endif
@@ -357,7 +341,7 @@ wxT("Produce portable code for trace messages"),
NULL
-#line 399 "DkWxTraceApp.cpt"
+#line 409 "DkWxTraceApp.cpt"
};
@@ -374,7 +358,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 410 "DkWxTraceApp.cpt"
+#line 420 "DkWxTraceApp.cpt"
};
@@ -413,7 +397,7 @@ DkWxTraceApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchFs = NULL;
/* Initialize elements.
*/
@@ -458,6 +442,14 @@ DkWxTraceApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -465,6 +457,14 @@ DkWxTraceApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -472,14 +472,29 @@ DkWxTraceApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchFs = new wxArchiveFSHandler();
+ if (NULL != phArchFs) {
+ wxFileSystem::AddHandler(phArchFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
/* Get help controller.
*/
helpController =
@@ -502,8 +517,8 @@ DkWxTraceApp::OnInit()
/* Show frame and indicate success.
*/
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Clean up on errors.
diff --git a/support/dktools/DkWxTraceApp.cpt b/support/dktools/DkWxTraceApp.cpt
index 76b187339d..0abd1e25c1 100644
--- a/support/dktools/DkWxTraceApp.cpt
+++ b/support/dktools/DkWxTraceApp.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -39,12 +39,17 @@ class DkWxTraceApp : public wxApp
virtual int OnExit();
};
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkWxTraceApp);
+#else
DECLARE_APP(DkWxTraceApp)
+#endif
%% module
+#include "dk3conf.h"
#include "dkwxtrace.h"
@@ -54,7 +59,12 @@ $!trace-include
/** Implementation of DkWxTraceApp.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(DkWxTraceApp);
+#else
IMPLEMENT_APP(DkWxTraceApp)
+#endif
@@ -445,7 +455,7 @@ DkWxTraceApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchFs = NULL;
/* Initialize elements.
*/
@@ -490,6 +500,14 @@ DkWxTraceApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -497,6 +515,14 @@ DkWxTraceApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -504,14 +530,29 @@ DkWxTraceApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
+ phArchFs = new wxArchiveFSHandler();
+ if (NULL != phArchFs) {
+ wxFileSystem::AddHandler(phArchFs);
} else {
ShowMemoryErrorMessage();
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
/* Get help controller.
*/
helpController =
@@ -534,8 +575,8 @@ DkWxTraceApp::OnInit()
/* Show frame and indicate success.
*/
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Clean up on errors.
diff --git a/support/dktools/DkWxTraceApp.h b/support/dktools/DkWxTraceApp.h
index 20a97314f4..2ecde8b202 100644
--- a/support/dktools/DkWxTraceApp.h
+++ b/support/dktools/DkWxTraceApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxTraceApp.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxTraceApp.cpt
*/
/** @file DkWxTraceApp.h Header file for the DkWxTraceApp module.
@@ -74,7 +52,11 @@ class DkWxTraceApp : public wxApp
virtual int OnExit();
};
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(DkWxTraceApp);
+#else
DECLARE_APP(DkWxTraceApp)
+#endif
diff --git a/support/dktools/DkWxTraceFrame.cpp b/support/dktools/DkWxTraceFrame.cpp
index 93f42c669a..2e18f429c7 100644
--- a/support/dktools/DkWxTraceFrame.cpp
+++ b/support/dktools/DkWxTraceFrame.cpp
@@ -1,46 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxTraceFrame.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxTraceFrame.wxc
*/
/** @file DkWxTraceFrame.cpp The DkWxTraceFrame module.
*/
-#line 323 "DkWxTraceFrame.wxc"
-
+#line 333 "DkWxTraceFrame.wxc"
+#include "dk3conf.h"
#include "dkwxtrace.h"
#include "dk4verswx.h"
@@ -49,15 +27,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
Icons and bitmaps
*/
-#include "dkicon.xpm"
-#include "choose-dir.xpm"
-#include "exit-program.xpm"
-#include "run-conversion.xpm"
-#include "set-options.xpm"
+#include "gui-img/icons/dkicon.xpm"
+#include "gui-img/shared/toolbar/choose-dir.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+#include "gui-img/shared/toolbar/set-options.xpm"
-#line 341 "DkWxTraceFrame.wxc"
+#line 351 "DkWxTraceFrame.wxc"
/** Version for the about dialog (program name).
@@ -106,7 +84,7 @@ wxT("wxdkct.splint.selected"),
NULL
-#line 396 "DkWxTraceFrame.wxc"
+#line 406 "DkWxTraceFrame.wxc"
};
@@ -118,13 +96,17 @@ wxT("wxdkct.directory"),
NULL
-#line 407 "DkWxTraceFrame.wxc"
+#line 417 "DkWxTraceFrame.wxc"
};
/** Event table for the DkWxTraceFrame class.
*/
-BEGIN_EVENT_TABLE(DkWxTraceFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxTraceFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkWxTraceFrame,wxFrame)
+#endif
EVT_MENU(DkWxTrace_Quit, DkWxTraceFrame::OnQuit)
EVT_MENU(DkWxTrace_Help_Contents, DkWxTraceFrame::OnHelpContents)
EVT_MENU(DkWxTrace_About, DkWxTraceFrame::OnAbout)
@@ -132,10 +114,19 @@ BEGIN_EVENT_TABLE(DkWxTraceFrame, wxFrame)
EVT_MENU(DkWxTrace_SetOptions, DkWxTraceFrame::OnSetOptions)
EVT_MENU(DkWxTrace_Run, DkWxTraceFrame::OnRunConversion)
EVT_IDLE(DkWxTraceFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc wxdkctframe_cmd_line_desc[] = {
{
wxCMD_LINE_SWITCH,
@@ -210,9 +201,13 @@ static const wxCmdLineEntryDesc wxdkctframe_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
-#line 500 "DkWxTraceFrame.wxc"
+#line 527 "DkWxTraceFrame.wxc"
DkWxTraceFrame::DkWxTraceFrame(
wxChar const *applicationName,
wxChar const * const *messageTexts,
@@ -226,7 +221,7 @@ DkWxTraceFrame::DkWxTraceFrame(
{
-#line 512 "DkWxTraceFrame.wxc"
+#line 539 "DkWxTraceFrame.wxc"
ddx = -1; ddy = -1;
odx = -1; ody = -1;
bAutoStartRequested = false;
@@ -513,10 +508,10 @@ DkWxTraceFrame::DkWxTraceFrame(
mainSizer->SetSizeHints(this);
}
-#line 544 "DkWxTraceFrame.wxc"
+#line 571 "DkWxTraceFrame.wxc"
-#line 545 "DkWxTraceFrame.wxc"
+#line 572 "DkWxTraceFrame.wxc"
pComm = new DkWxCommunicator(
applicationHelper->getWxEncoding(),
applicationHelper->getDkEncoding()
@@ -588,7 +583,7 @@ DkWxTraceFrame::DkWxTraceFrame(
}
if(parser.GetParamCount() > 0) {
-#line 615 "DkWxTraceFrame.wxc"
+#line 642 "DkWxTraceFrame.wxc"
wxChar const *nd;
cmdfn = parser.GetParam(0);
wxFileName fn(cmdfn);
@@ -601,15 +596,16 @@ DkWxTraceFrame::DkWxTraceFrame(
cmdfn = fn.GetFullPath();
if(wxFileName::DirExists(cmdfn)) {
-#line 626 "DkWxTraceFrame.wxc"
- nd = cmdfn.c_str();
+#line 653 "DkWxTraceFrame.wxc"
+ wxCStrData cmdfnstrdata = cmdfn.c_str();
+ nd = (wxChar const *)cmdfnstrdata;
if(nd) {
-#line 628 "DkWxTraceFrame.wxc"
+#line 656 "DkWxTraceFrame.wxc"
nd = dk3wxs_dup_app(nd, applicationHelper->getApp());
if(nd) {
-#line 630 "DkWxTraceFrame.wxc"
+#line 658 "DkWxTraceFrame.wxc"
dk3_release(sDirectory);
sDirectory = nd;
if(tDirectory) {
@@ -617,7 +613,7 @@ DkWxTraceFrame::DkWxTraceFrame(
}
} else {
-#line 636 "DkWxTraceFrame.wxc"
+#line 664 "DkWxTraceFrame.wxc"
pComm->autostartEnable(false);
bGuiActive = true;
if(bAutoStartRequested) {
@@ -628,7 +624,7 @@ DkWxTraceFrame::DkWxTraceFrame(
}
} else {
-#line 645 "DkWxTraceFrame.wxc"
+#line 673 "DkWxTraceFrame.wxc"
pComm->autostartEnable(false);
bGuiActive = true;
if(bAutoStartRequested) {
@@ -639,7 +635,7 @@ DkWxTraceFrame::DkWxTraceFrame(
}
} else {
-#line 654 "DkWxTraceFrame.wxc"
+#line 682 "DkWxTraceFrame.wxc"
pComm->autostartEnable(false);
bGuiActive = true;
if(bAutoStartRequested) {
@@ -658,17 +654,14 @@ DkWxTraceFrame::DkWxTraceFrame(
}
}
}
-#if 0
- restorePosition();
-#endif
-#line 676 "DkWxTraceFrame.wxc"
+#line 701 "DkWxTraceFrame.wxc"
}
-#line 680 "DkWxTraceFrame.wxc"
+#line 705 "DkWxTraceFrame.wxc"
@@ -696,11 +689,11 @@ void DkWxTraceFrame::OnHelpContents(wxCommandEvent& WXUNUSED(event))
{
-#line 706 "DkWxTraceFrame.wxc"
+#line 731 "DkWxTraceFrame.wxc"
openHelp();
-#line 708 "DkWxTraceFrame.wxc"
+#line 733 "DkWxTraceFrame.wxc"
}
@@ -709,7 +702,7 @@ void DkWxTraceFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
-#line 715 "DkWxTraceFrame.wxc"
+#line 740 "DkWxTraceFrame.wxc"
if(isGuiActive()) {
wxString sVersion(dkwxct_version);
sVersion.Append(dkwxct_versnumber);
@@ -723,7 +716,7 @@ void DkWxTraceFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
sVersion.Append(sTexts[73]);
sVersion.Append(sTexts[73]);
sVersion.Append(sTexts[75]);
- sVersion.Append(wxT("http://dktools.sourceforge.net\n"));
+ sVersion.Append(wxT("http://sourceforge.net/p/dktools/wiki/Home/\n"));
sVersion.Append(wxT("http://www.wxwidgets.org\n"));
sVersion.Append(wxT("http://www.libpng.org/pub/png/libpng.html\n"));
sVersion.Append(wxT("http://www.ijg.org\n"));
@@ -733,7 +726,7 @@ void DkWxTraceFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
}
-#line 737 "DkWxTraceFrame.wxc"
+#line 762 "DkWxTraceFrame.wxc"
}
@@ -744,7 +737,7 @@ void DkWxTraceFrame::OnChooseDirectory(wxCommandEvent& WXUNUSED(event))
wxChar const *np;
-#line 746 "DkWxTraceFrame.wxc"
+#line 771 "DkWxTraceFrame.wxc"
if(isGuiActive()) {
wxDirDialog dd(
this,
@@ -755,7 +748,8 @@ void DkWxTraceFrame::OnChooseDirectory(wxCommandEvent& WXUNUSED(event))
pHelper->setRelatedPosition(this, &dd, &ddx, &ddy);
if(dd.ShowModal() == wxID_OK) {
wxString path = dd.GetPath();
- ptr = path.c_str();
+ wxCStrData pathstrdata = path.c_str();
+ ptr = (wxChar const *)pathstrdata;
if(ptr) {
np = dk3wxs_dup_app(ptr, pHelper->getApp());
if(np) {
@@ -773,7 +767,7 @@ void DkWxTraceFrame::OnChooseDirectory(wxCommandEvent& WXUNUSED(event))
}
-#line 773 "DkWxTraceFrame.wxc"
+#line 799 "DkWxTraceFrame.wxc"
}
@@ -782,7 +776,7 @@ void DkWxTraceFrame::OnSetOptions(wxCommandEvent& WXUNUSED(event))
{
-#line 780 "DkWxTraceFrame.wxc"
+#line 806 "DkWxTraceFrame.wxc"
if(isGuiActive()) {
DkWxTraceOptionsDialog dlg(
(DkWxTraceFrame *)this, sTexts[30], sTexts, &options
@@ -794,7 +788,7 @@ void DkWxTraceFrame::OnSetOptions(wxCommandEvent& WXUNUSED(event))
}
-#line 790 "DkWxTraceFrame.wxc"
+#line 816 "DkWxTraceFrame.wxc"
}
@@ -808,7 +802,7 @@ void DkWxTraceFrame::runConversion()
#endif
-#line 802 "DkWxTraceFrame.wxc"
+#line 828 "DkWxTraceFrame.wxc"
/* SetStatusText(sTexts[67]); */
tStatus->SetLabel(sTexts[67]);
if(cBlack) { tStatus->SetForegroundColour(*cBlack); }
@@ -889,7 +883,7 @@ void DkWxTraceFrame::runConversion()
Update();
}
-#line 881 "DkWxTraceFrame.wxc"
+#line 907 "DkWxTraceFrame.wxc"
}
@@ -962,17 +956,17 @@ DkWxTraceFrame::OnIdle(wxIdleEvent & event)
dk3_time_t ct;
-#line 952 "DkWxTraceFrame.wxc"
+#line 978 "DkWxTraceFrame.wxc"
if(!bCloseScheduled) {
if(pComm) {
if(pComm->autostartCanRun()) {
-#line 955 "DkWxTraceFrame.wxc"
+#line 981 "DkWxTraceFrame.wxc"
runConversion();
} else {
if(pComm->autostartIsFinished()) {
-#line 958 "DkWxTraceFrame.wxc"
+#line 984 "DkWxTraceFrame.wxc"
if(!(timeClose)) {
if(pComm->getLogLevel() > DK3_LL_WARNING) {
dk3sf_time(&timeClose);
@@ -1002,7 +996,7 @@ DkWxTraceFrame::OnIdle(wxIdleEvent & event)
}
-#line 986 "DkWxTraceFrame.wxc"
+#line 1012 "DkWxTraceFrame.wxc"
event.Skip();
}
diff --git a/support/dktools/DkWxTraceFrame.h b/support/dktools/DkWxTraceFrame.h
index 0ca825b627..b331a17950 100644
--- a/support/dktools/DkWxTraceFrame.h
+++ b/support/dktools/DkWxTraceFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxTraceFrame.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxTraceFrame.wxc
*/
/** @file DkWxTraceFrame.h Header file for the DkWxTraceFrame module.
@@ -43,11 +21,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 139 "DkWxTraceFrame.wxc"
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
+#endif
+
+#ifndef DKCT_H_INCLUDED
#include "dkct.h"
+#endif
-#line 144 "DkWxTraceFrame.wxc"
+#line 150 "DkWxTraceFrame.wxc"
/** Top level frame of the dkwxtrace program.
*/
@@ -58,7 +42,11 @@ class DkWxTraceFrame : public DkWxFrame
/** Event table.
*/
- DECLARE_EVENT_TABLE()
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -248,7 +236,7 @@ class DkWxTraceFrame : public DkWxFrame
wxStaticText *tDirectory;
-#line 231 "DkWxTraceFrame.wxc"
+#line 241 "DkWxTraceFrame.wxc"
public:
@@ -339,7 +327,7 @@ class DkWxTraceFrame : public DkWxFrame
};
-#line 321 "DkWxTraceFrame.wxc"
+#line 331 "DkWxTraceFrame.wxc"
#endif
diff --git a/support/dktools/DkWxTraceFrame.wxc b/support/dktools/DkWxTraceFrame.wxc
index 1fbc9d2561..1afb095bec 100644
--- a/support/dktools/DkWxTraceFrame.wxc
+++ b/support/dktools/DkWxTraceFrame.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -137,7 +137,13 @@ text = sTexts[67]
%% header start
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
+#endif
+
+#ifndef DKCT_H_INCLUDED
#include "dkct.h"
+#endif
%% class start
@@ -151,7 +157,11 @@ class DkWxTraceFrame : public DkWxFrame
/** Event table.
*/
- DECLARE_EVENT_TABLE()
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -322,7 +332,7 @@ class DkWxTraceFrame : public DkWxFrame
%% module start
-
+#include "dk3conf.h"
#include "dkwxtrace.h"
#include "dk4verswx.h"
@@ -331,11 +341,11 @@ class DkWxTraceFrame : public DkWxFrame
/*
Icons and bitmaps
*/
-#include "dkicon.xpm"
-#include "choose-dir.xpm"
-#include "exit-program.xpm"
-#include "run-conversion.xpm"
-#include "set-options.xpm"
+#include "gui-img/icons/dkicon.xpm"
+#include "gui-img/shared/toolbar/choose-dir.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+#include "gui-img/shared/toolbar/set-options.xpm"
$!trace-include
@@ -409,7 +419,11 @@ $!end
/** Event table for the DkWxTraceFrame class.
*/
-BEGIN_EVENT_TABLE(DkWxTraceFrame, wxFrame)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxTraceFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(DkWxTraceFrame,wxFrame)
+#endif
EVT_MENU(DkWxTrace_Quit, DkWxTraceFrame::OnQuit)
EVT_MENU(DkWxTrace_Help_Contents, DkWxTraceFrame::OnHelpContents)
EVT_MENU(DkWxTrace_About, DkWxTraceFrame::OnAbout)
@@ -417,10 +431,19 @@ BEGIN_EVENT_TABLE(DkWxTraceFrame, wxFrame)
EVT_MENU(DkWxTrace_SetOptions, DkWxTraceFrame::OnSetOptions)
EVT_MENU(DkWxTrace_Run, DkWxTraceFrame::OnRunConversion)
EVT_IDLE(DkWxTraceFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc wxdkctframe_cmd_line_desc[] = {
{
wxCMD_LINE_SWITCH,
@@ -495,6 +518,10 @@ static const wxCmdLineEntryDesc wxdkctframe_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
%% constructor start
DkWxTraceFrame::DkWxTraceFrame(
@@ -623,7 +650,8 @@ DkWxTraceFrame::DkWxTraceFrame(
);
cmdfn = fn.GetFullPath();
if(wxFileName::DirExists(cmdfn)) { $? ". is directory"
- nd = cmdfn.c_str();
+ wxCStrData cmdfnstrdata = cmdfn.c_str();
+ nd = (wxChar const *)cmdfnstrdata;
if(nd) { $? ". text found"
nd = dk3wxs_dup_app(nd, applicationHelper->getApp());
if(nd) { $? ". allocation ok"
@@ -669,9 +697,6 @@ DkWxTraceFrame::DkWxTraceFrame(
}
}
}
-#if 0
- restorePosition();
-#endif
$? "- constructor"
}
@@ -725,7 +750,7 @@ void DkWxTraceFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
sVersion.Append(sTexts[73]);
sVersion.Append(sTexts[73]);
sVersion.Append(sTexts[75]);
- sVersion.Append(wxT("http://dktools.sourceforge.net\n"));
+ sVersion.Append(wxT("http://sourceforge.net/p/dktools/wiki/Home/\n"));
sVersion.Append(wxT("http://www.wxwidgets.org\n"));
sVersion.Append(wxT("http://www.libpng.org/pub/png/libpng.html\n"));
sVersion.Append(wxT("http://www.ijg.org\n"));
@@ -753,7 +778,8 @@ void DkWxTraceFrame::OnChooseDirectory(wxCommandEvent& WXUNUSED(event))
pHelper->setRelatedPosition(this, &dd, &ddx, &ddy);
if(dd.ShowModal() == wxID_OK) {
wxString path = dd.GetPath();
- ptr = path.c_str();
+ wxCStrData pathstrdata = path.c_str();
+ ptr = (wxChar const *)pathstrdata;
if(ptr) {
np = dk3wxs_dup_app(ptr, pHelper->getApp());
if(np) {
diff --git a/support/dktools/DkWxTraceOptionsDialog.cpp b/support/dktools/DkWxTraceOptionsDialog.cpp
index dc17259c9e..a7894c82e8 100644
--- a/support/dktools/DkWxTraceOptionsDialog.cpp
+++ b/support/dktools/DkWxTraceOptionsDialog.cpp
@@ -1,61 +1,49 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxTraceOptionsDialog.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxTraceOptionsDialog.wxc
*/
/** @file DkWxTraceOptionsDialog.cpp The DkWxTraceOptionsDialog module.
*/
-#line 203 "DkWxTraceOptionsDialog.wxc"
+#line 207 "DkWxTraceOptionsDialog.wxc"
+#include "dk3conf.h"
#include "dkwxtrace.h"
-#line 209 "DkWxTraceOptionsDialog.wxc"
+#line 214 "DkWxTraceOptionsDialog.wxc"
+
-BEGIN_EVENT_TABLE(DkWxTraceOptionsDialog, wxDialog)
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxTraceOptionsDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(DkWxTraceOptionsDialog,wxDialog)
+#endif
EVT_BUTTON(wxID_OK, DkWxTraceOptionsDialog::OnOK)
EVT_BUTTON(wxID_CANCEL, DkWxTraceOptionsDialog::OnCancel)
EVT_CHECKBOX(DkWxTrace_Debug, DkWxTraceOptionsDialog::OnChangeDebug)
EVT_CHECKBOX(DkWxTrace_UseSplint, DkWxTraceOptionsDialog::OnChangeUseSplint)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
-#line 218 "DkWxTraceOptionsDialog.wxc"
+#line 232 "DkWxTraceOptionsDialog.wxc"
DkWxTraceOptionsDialog::DkWxTraceOptionsDialog(
DkWxTraceFrame *parent,
wxChar const *title,
@@ -388,7 +376,7 @@ cRed(0x7F, 0x00, 0x00)
sDialog->SetSizeHints(this);
}
-#line 258 "DkWxTraceOptionsDialog.wxc"
+#line 272 "DkWxTraceOptionsDialog.wxc"
if (dkctGUILayoutOK) {
sttGeneral->SetForegroundColour(cRed);
sttOutput->SetForegroundColour(cRed);
@@ -397,11 +385,11 @@ cRed(0x7F, 0x00, 0x00)
}
-#line 266 "DkWxTraceOptionsDialog.wxc"
+#line 280 "DkWxTraceOptionsDialog.wxc"
void
DkWxTraceOptionsDialog::OnOK(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
dataOut();
@@ -416,7 +404,7 @@ DkWxTraceOptionsDialog::OnOK(
void
DkWxTraceOptionsDialog::OnCancel(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
if(IsModal()) {
@@ -431,7 +419,7 @@ DkWxTraceOptionsDialog::OnCancel(
void
DkWxTraceOptionsDialog::OnChangeDebug(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
correctGUI();
@@ -441,7 +429,7 @@ DkWxTraceOptionsDialog::OnChangeDebug(
void
DkWxTraceOptionsDialog::OnChangeUseSplint(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
correctGUI();
@@ -540,11 +528,11 @@ DkWxTraceOptionsDialog::correctGUI()
if (cbUseSplint) {
if (cbUseSplint->GetValue()) {
-#line 407 "DkWxTraceOptionsDialog.wxc"
+#line 421 "DkWxTraceOptionsDialog.wxc"
chSplintChar->Enable(true);
} else {
-#line 409 "DkWxTraceOptionsDialog.wxc"
+#line 423 "DkWxTraceOptionsDialog.wxc"
chSplintChar->Enable(false);
}
}
diff --git a/support/dktools/DkWxTraceOptionsDialog.h b/support/dktools/DkWxTraceOptionsDialog.h
index c19d167bbf..19ceb6d664 100644
--- a/support/dktools/DkWxTraceOptionsDialog.h
+++ b/support/dktools/DkWxTraceOptionsDialog.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxTraceOptionsDialog.wxc
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxTraceOptionsDialog.wxc
*/
/** @file DkWxTraceOptionsDialog.h Header file for the DkWxTraceOptionsDialog module.
@@ -53,7 +31,11 @@ class DkWxTraceOptionsDialog : public wxDialog
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -177,7 +159,7 @@ class DkWxTraceOptionsDialog : public wxDialog
wxButton *bCancel;
-#line 148 "DkWxTraceOptionsDialog.wxc"
+#line 152 "DkWxTraceOptionsDialog.wxc"
public:
/** Constructor.
@@ -198,22 +180,22 @@ class DkWxTraceOptionsDialog : public wxDialog
/** Handler for OK button.
@param event Event to process.
*/
- void OnOK(wxCommandEvent& WXUNUSED(event));
+ void OnOK(wxCommandEvent& event);
/** Handler for Cancel button.
@param event Event to process.
*/
- void OnCancel(wxCommandEvent& WXUNUSED(event));
+ void OnCancel(wxCommandEvent& event);
/** Handler for clicking the debug checkbox.
@param event Event to process.
*/
- void OnChangeDebug(wxCommandEvent & WXUNUSED(event));
+ void OnChangeDebug(wxCommandEvent & event);
/** Handler for changing the use splint option.
@param event Event to process.
*/
- void OnChangeUseSplint(wxCommandEvent & WXUNUSED(event));
+ void OnChangeUseSplint(wxCommandEvent & event);
public:
@@ -231,7 +213,7 @@ class DkWxTraceOptionsDialog : public wxDialog
};
-#line 201 "DkWxTraceOptionsDialog.wxc"
+#line 205 "DkWxTraceOptionsDialog.wxc"
#endif
diff --git a/support/dktools/DkWxTraceOptionsDialog.wxc b/support/dktools/DkWxTraceOptionsDialog.wxc
index 348b9008cb..a79fdfc16d 100644
--- a/support/dktools/DkWxTraceOptionsDialog.wxc
+++ b/support/dktools/DkWxTraceOptionsDialog.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% wx-gui
@@ -120,7 +120,11 @@ class DkWxTraceOptionsDialog : public wxDialog
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -165,22 +169,22 @@ class DkWxTraceOptionsDialog : public wxDialog
/** Handler for OK button.
@param event Event to process.
*/
- void OnOK(wxCommandEvent& WXUNUSED(event));
+ void OnOK(wxCommandEvent& event);
/** Handler for Cancel button.
@param event Event to process.
*/
- void OnCancel(wxCommandEvent& WXUNUSED(event));
+ void OnCancel(wxCommandEvent& event);
/** Handler for clicking the debug checkbox.
@param event Event to process.
*/
- void OnChangeDebug(wxCommandEvent & WXUNUSED(event));
+ void OnChangeDebug(wxCommandEvent & event);
/** Handler for changing the use splint option.
@param event Event to process.
*/
- void OnChangeUseSplint(wxCommandEvent & WXUNUSED(event));
+ void OnChangeUseSplint(wxCommandEvent & event);
public:
@@ -201,18 +205,28 @@ class DkWxTraceOptionsDialog : public wxDialog
%% module start
+#include "dk3conf.h"
#include "dkwxtrace.h"
$!trace-include
-BEGIN_EVENT_TABLE(DkWxTraceOptionsDialog, wxDialog)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxTraceOptionsDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(DkWxTraceOptionsDialog,wxDialog)
+#endif
EVT_BUTTON(wxID_OK, DkWxTraceOptionsDialog::OnOK)
EVT_BUTTON(wxID_CANCEL, DkWxTraceOptionsDialog::OnCancel)
EVT_CHECKBOX(DkWxTrace_Debug, DkWxTraceOptionsDialog::OnChangeDebug)
EVT_CHECKBOX(DkWxTrace_UseSplint, DkWxTraceOptionsDialog::OnChangeUseSplint)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
%% constructor start
DkWxTraceOptionsDialog::DkWxTraceOptionsDialog(
@@ -266,7 +280,7 @@ cRed(0x7F, 0x00, 0x00)
void
DkWxTraceOptionsDialog::OnOK(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
dataOut();
@@ -281,7 +295,7 @@ DkWxTraceOptionsDialog::OnOK(
void
DkWxTraceOptionsDialog::OnCancel(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
if(IsModal()) {
@@ -296,7 +310,7 @@ DkWxTraceOptionsDialog::OnCancel(
void
DkWxTraceOptionsDialog::OnChangeDebug(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
correctGUI();
@@ -306,7 +320,7 @@ DkWxTraceOptionsDialog::OnChangeDebug(
void
DkWxTraceOptionsDialog::OnChangeUseSplint(
- wxCommandEvent & event
+ wxCommandEvent & WXUNUSED(event)
)
{
correctGUI();
diff --git a/support/dktools/DkWxTraceThread.cpp b/support/dktools/DkWxTraceThread.cpp
index d4fa7b6b30..8bb7a5365f 100644
--- a/support/dktools/DkWxTraceThread.cpp
+++ b/support/dktools/DkWxTraceThread.cpp
@@ -1,50 +1,35 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxTraceThread.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxTraceThread.cpt
*/
/** @file DkWxTraceThread.cpp The DkWxTraceThread module.
*/
-#line 115 "DkWxTraceThread.cpt"
+#line 122 "DkWxTraceThread.cpt"
+#include "dk3conf.h"
#include "dkwxtrace.h"
-#line 119 "DkWxTraceThread.cpt"
+#line 127 "DkWxTraceThread.cpt"
+
+/* Add code for a simple test.
+*/
+#ifndef SIMPLE_TEST_THREAD
+#define SIMPLE_TEST_THREAD 0
+#endif
/** wxChar keywords used in this module.
@@ -71,7 +56,7 @@ dkwxtrthr_check_current_directory(DKCT_SRC *psrc, dkChar const *fn)
dkChar *ptr;
-#line 145 "DkWxTraceThread.cpt"
+#line 159 "DkWxTraceThread.cpt"
if(dk3str_len(fn) < DK3_SIZEOF(fndir,dkChar)) {
dk3str_cpy(fndir, fn);
ptr = dk3str_rchr(fndir, DK3_CHAR_SEP);
@@ -87,7 +72,7 @@ dkwxtrthr_check_current_directory(DKCT_SRC *psrc, dkChar const *fn)
}
}
-#line 159 "DkWxTraceThread.cpt"
+#line 173 "DkWxTraceThread.cpt"
}
@@ -105,7 +90,7 @@ DkWxTraceThread::DkWxTraceThread(
{
-#line 175 "DkWxTraceThread.cpt"
+#line 189 "DkWxTraceThread.cpt"
pComm = comm;
wxe = we;
dke = de;
@@ -117,13 +102,14 @@ DkWxTraceThread::DkWxTraceThread(
dk3mem_cpy((void *)(&dkcto),(void *)o,sizeof(DKCT_OPTION_SET));
-#line 185 "DkWxTraceThread.cpt"
+#line 199 "DkWxTraceThread.cpt"
}
+#if SIMPLE_TEST_THREAD
static wxChar const testfilename[] = { wxT("Test") };
-
+#endif
void
@@ -136,33 +122,33 @@ DkWxTraceThread::runForFile(dkChar const *fn, int sufi)
int ok = 0;
-#line 202 "DkWxTraceThread.cpt"
+#line 217 "DkWxTraceThread.cpt"
pstart = dk3str_rchr(fn, DK3_CHAR_SEP);
if(pstart) { pstart++; } else { pstart = fn; }
ie = dk3app_get_encoding(app);
if(dk3str_to_c8p_app(shn, sizeof(shn), pstart, ie, app)) {
-#line 206 "DkWxTraceThread.cpt"
+#line 221 "DkWxTraceThread.cpt"
pComm->addDkText(fn);
pComm->addWxText(wxdkct_trace_thread_string_colon);
pComm->nl();
psrc = dkct_tr_new(&dkcto, shn, sufi, app, fn);
if(psrc) {
-#line 211 "DkWxTraceThread.cpt"
+#line 226 "DkWxTraceThread.cpt"
(psrc->dkcto).deben = 1;
psrc->msg = msg;
psrc->pComm = pComm;
dkwxtrthr_check_current_directory(psrc, fn);
if(dkct_tr_read(psrc, fn, sufi)) {
-#line 216 "DkWxTraceThread.cpt"
+#line 231 "DkWxTraceThread.cpt"
if(dkct_tr_check(psrc, fn, sufi)) {
-#line 217 "DkWxTraceThread.cpt"
+#line 232 "DkWxTraceThread.cpt"
if(dkct_tr_write(psrc, fn, sufi)) {
-#line 218 "DkWxTraceThread.cpt"
+#line 233 "DkWxTraceThread.cpt"
ok = 1;
}
}
@@ -174,15 +160,15 @@ DkWxTraceThread::runForFile(dkChar const *fn, int sufi)
pComm->nl();
}
-#line 228 "DkWxTraceThread.cpt"
+#line 243 "DkWxTraceThread.cpt"
pComm->addWxText(sTexts[(ok) ? 56 : 57]);
-#line 229 "DkWxTraceThread.cpt"
+#line 244 "DkWxTraceThread.cpt"
pComm->nl();
pComm->nl();
} else {
-#line 232 "DkWxTraceThread.cpt"
+#line 247 "DkWxTraceThread.cpt"
/* ERROR: Can not convert file name to 8-bit characters plain! */
pComm->addWxText(sTexts[61]);
pComm->addDkText(fn);
@@ -190,7 +176,7 @@ DkWxTraceThread::runForFile(dkChar const *fn, int sufi)
pComm->nl();
}
-#line 238 "DkWxTraceThread.cpt"
+#line 253 "DkWxTraceThread.cpt"
}
@@ -204,11 +190,11 @@ DkWxTraceThread::checkAndRunFile(dkChar const *fn, int sufi)
dkChar const * const *lfdsu;
-#line 250 "DkWxTraceThread.cpt"
+#line 265 "DkWxTraceThread.cpt"
int must_run = 1;
if(dkcto.mak) {
-#line 252 "DkWxTraceThread.cpt"
+#line 267 "DkWxTraceThread.cpt"
/* Check whether we really need to run */
if(dk3str_len(fn) < DK3_SIZEOF(b1,dkChar)) {
dk3str_cpy(b1, fn);
@@ -233,7 +219,7 @@ DkWxTraceThread::checkAndRunFile(dkChar const *fn, int sufi)
}
if(must_run) {
-#line 275 "DkWxTraceThread.cpt"
+#line 290 "DkWxTraceThread.cpt"
runForFile(fn, sufi);
} else {
/* Up to date. */
@@ -247,7 +233,7 @@ DkWxTraceThread::checkAndRunFile(dkChar const *fn, int sufi)
pComm->nl();
}
-#line 287 "DkWxTraceThread.cpt"
+#line 302 "DkWxTraceThread.cpt"
}
@@ -268,26 +254,26 @@ DkWxTraceThread::runForDirectory(wxChar const *dirname)
int cc;
-#line 306 "DkWxTraceThread.cpt"
+#line 321 "DkWxTraceThread.cpt"
cFile = DK3_UM_0;
cc = 1;
if(dk3wxs_to_dkstr(bu, DK3_SIZEOF(bu,dkChar), dke, dirname, wxe)) {
-#line 310 "DkWxTraceThread.cpt"
+#line 325 "DkWxTraceThread.cpt"
dir = dk3dir_open_app(bu, app);
if(dir) {
-#line 312 "DkWxTraceThread.cpt"
+#line 327 "DkWxTraceThread.cpt"
nFiles = dk3dir_get_number_of_files(dir);
if(!(nFiles)) nFiles++;
while(cc) {
-#line 315 "DkWxTraceThread.cpt"
+#line 330 "DkWxTraceThread.cpt"
cc = 0;
if(dk3dir_get_next_file(dir)) {
-#line 317 "DkWxTraceThread.cpt"
+#line 332 "DkWxTraceThread.cpt"
cc = 1;
if(cFile > nFiles) cFile = nFiles;
promille = ((dk3_um_t)1000UL * cFile) / nFiles;
@@ -295,14 +281,14 @@ DkWxTraceThread::runForDirectory(wxChar const *dirname)
es = dk3dir_get_stat(dir);
if((en) && (es)) {
-#line 323 "DkWxTraceThread.cpt"
+#line 338 "DkWxTraceThread.cpt"
if(dk3wxs_from_dkstr(fnb, DK3_SIZEOF(fnb,wxChar), wxe, en, dke)) {
pComm->setUpdates(fnb, promille);
}
switch((es->ft) & (~(DK3_FT_SYMLINK))) {
case DK3_FT_REGULAR: {
-#line 328 "DkWxTraceThread.cpt"
+#line 343 "DkWxTraceThread.cpt"
su = dk3str_get_suffix(en);
if(su) {
#if DK3_ON_WINDOWS || DK3_HAVE_FNCASEINS
@@ -326,7 +312,7 @@ DkWxTraceThread::runForDirectory(wxChar const *dirname)
dk3dir_close(dir);
} else {
-#line 350 "DkWxTraceThread.cpt"
+#line 365 "DkWxTraceThread.cpt"
/* ERROR: Failed to open directory! */
pComm->addWxText(sTexts[59]);
pComm->addWxText(dirname);
@@ -335,13 +321,13 @@ DkWxTraceThread::runForDirectory(wxChar const *dirname)
}
} else {
-#line 357 "DkWxTraceThread.cpt"
+#line 372 "DkWxTraceThread.cpt"
/* ERROR: Filename conversion failed! */
pComm->addWxText(sTexts[58]);
pComm->nl();
}
-#line 361 "DkWxTraceThread.cpt"
+#line 376 "DkWxTraceThread.cpt"
}
@@ -351,8 +337,8 @@ DkWxTraceThread::Entry()
{
-#line 369 "DkWxTraceThread.cpt"
-#if 0
+#line 384 "DkWxTraceThread.cpt"
+#if SIMPLE_TEST_THREAD
/*
Simple test thread witout practical use.
*/
@@ -397,7 +383,7 @@ DkWxTraceThread::Entry()
#endif
-#line 413 "DkWxTraceThread.cpt"
+#line 428 "DkWxTraceThread.cpt"
return NULL;
}
diff --git a/support/dktools/DkWxTraceThread.cpt b/support/dktools/DkWxTraceThread.cpt
index 5e68832c72..d15b791b12 100644
--- a/support/dktools/DkWxTraceThread.cpt
+++ b/support/dktools/DkWxTraceThread.cpt
@@ -2,13 +2,20 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
+#endif
+
+#ifndef DKWXTRACE_H_INCLUDED
#include "dkwxtrace.h"
+#endif
+
$!trace-include
@@ -113,11 +120,18 @@ class DkWxTraceThread : public wxThread
%% module
+#include "dk3conf.h"
#include "dkwxtrace.h"
$!trace-include
+/* Add code for a simple test.
+*/
+#ifndef SIMPLE_TEST_THREAD
+#define SIMPLE_TEST_THREAD 0
+#endif
+
/** wxChar keywords used in this module.
*/
@@ -186,8 +200,9 @@ DkWxTraceThread::DkWxTraceThread(
+#if SIMPLE_TEST_THREAD
static wxChar const testfilename[] = { wxT("Test") };
-
+#endif
void
@@ -366,7 +381,7 @@ void *
DkWxTraceThread::Entry()
{
$? "+ Entry"
-#if 0
+#if SIMPLE_TEST_THREAD
/*
Simple test thread witout practical use.
*/
diff --git a/support/dktools/DkWxTraceThread.h b/support/dktools/DkWxTraceThread.h
index 9f5d725579..aea942a35f 100644
--- a/support/dktools/DkWxTraceThread.h
+++ b/support/dktools/DkWxTraceThread.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxTraceThread.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxTraceThread.cpt
*/
/** @file DkWxTraceThread.h Header file for the DkWxTraceThread module.
@@ -43,11 +21,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "DkWxTraceThread.cpt"
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
+#endif
+
+#ifndef DKWXTRACE_H_INCLUDED
#include "dkwxtrace.h"
+#endif
+
-#line 14 "DkWxTraceThread.cpt"
+#line 21 "DkWxTraceThread.cpt"
diff --git a/support/dktools/Doxyfile b/support/dktools/Doxyfile
index c694875970..61592737db 100644
--- a/support/dktools/Doxyfile
+++ b/support/dktools/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME = dktools-4
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 4.8.3
+PROJECT_NUMBER = 4.30.2
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -809,7 +809,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
-EXCLUDE_PATTERNS = dk4serf.h
+# EXCLUDE_PATTERNS = dk4serf.h
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -994,7 +994,7 @@ VERBATIM_HEADERS = YES
# compiled with the --with-libclang option.
# The default value is: NO.
-CLANG_ASSISTED_PARSING = NO
+# CLANG_ASSISTED_PARSING = NO
# If clang assisted parsing is enabled you can provide the compiler with command
# line options that you would normally use when invoking the compiler. Note that
@@ -1002,7 +1002,7 @@ CLANG_ASSISTED_PARSING = NO
# specified with INPUT and INCLUDE_PATH.
# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
-CLANG_OPTIONS =
+# CLANG_OPTIONS =
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
@@ -2312,6 +2312,7 @@ PLANTUML_JAR_PATH =
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
+# DOT_GRAPH_MAX_NODES = 200
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
# generated by dot. A depth value of 3 means that only nodes reachable from the
diff --git a/support/dktools/INSTALL b/support/dktools/INSTALL
index 064f245f57..ce0024ed57 100644
--- a/support/dktools/INSTALL
+++ b/support/dktools/INSTALL
@@ -64,8 +64,57 @@ to build the RPM file.
1.3 Installation via DEB
------------------------
+
+1.3.1 Debian Stretch
+....................
+The archive contains a ``debian'' subdirectory and two scripts to create
+a *.deb package. The scripts were created and tested on Debian Stretch.
+
+If you are building a package for an ``official'' Linux distribution:
+If the distribution includes the LPRng software, find user and group name
+used to run the LPRng lpd daemon and activate and correct LPUSER and
+LPGROUP in the debian/postinst file
+in the LINUX DISTRIBUTION PACKAGERS section.
+
+As root run:
+ ./debian-stretch-prepare.sh
+to install required packages (development tools, development packages
+for used libraries).
+
+As non-privileged user run:
+ ./debian-stretch-build-deb.sh
+to build the *.deb files.
+
+You should find several *.deb files in the parent directory:
+(1) dktools-lib-data_x.y.z-1_all.deb
+ Data files for the DK tools shared libraries.
+(2) dktools-data_x.y.z-1_all.deb
+ Data files for the DK tools programs.
+(3) dktools-lib-x.y_x.y.z-1_arch.deb
+ The DK tools shared libraries.
+(4) dktools_x.y.z-1_arch.deb
+ The DK tools programs (requires 1, z, and y).
+(5) dktools-dev_x.y.z-1_arch.deb
+ DK tools developer support (requires 1, 2, and 3).
+(6) dktools-dbgsym_x.y.z-1_arch.deb
+(7) dktools-lib-4.9-dbgsym_x.y.z-1_arch.deb
+On normal systems install (1), (2), (3), and (4). For development install
+(5) too.
+
+
+1.3.2 Debian Jessie
+...................
The archive contains a ``debian'' subdirectory and two scripts to create
a *.deb package. The scripts were created and tested on Debian Jessie.
+The defaults in the ``debian'' subdirectory are set up for Debian Stretch,
+so we must copy some files and repackage the archive.
+As normal user run:
+ gzip -dc dktools-4.9.1.tar.gz | tar xf -
+ cp dktools-4.9.1/debian/control8 dktools-4.9.1/debian/control
+ cp dktools-4.9.1/debian/control8.in dktools-4.9.1/debian/control.in
+ rm -fr dktools-4.9.1.tar.gz
+ tar cf dktools-4.9.1.tar dktools-4.9.1
+ gzip -9 dktools-4.9.1.tar
If you are building a package for an ``official'' Linux distribution:
If the distribution includes the LPRng software, find user and group name
@@ -107,6 +156,6 @@ at SourceForge, see
for the download.
Run the installer and follow the instructions.
-See http://dktools.sourceforge.net/install.html for details about the
-installation process.
+See http://sourceforge.net/p/dktools/wiki/Home/#installation
+for details about the installation process.
diff --git a/support/dktools/LICENSE b/support/dktools/LICENSE
index e3b369c021..5a4353cca3 100644
--- a/support/dktools/LICENSE
+++ b/support/dktools/LICENSE
@@ -4,12 +4,12 @@
1. DK tools and libraries
-------------------------
-A 3 clauses BSD style license is used for the "DK tools and libraries"
+The 3 clauses BSD style license is used for the "DK tools and libraries"
project in this archive, see the "bsdlic.txt" file in this archive.
-2. Live systems created using the scripts from this archive
------------------------------------------------------------
+2. Exception: Live systems created using the scripts from this archive
+----------------------------------------------------------------------
This archive also contains scripts to build live systems based on
Debian GNU/Linux. The live systems are derived from Debian GNU/Linux,
the scripts are just helpers to create them.
diff --git a/support/dktools/LICENSE.spdx b/support/dktools/LICENSE.spdx
new file mode 100644
index 0000000000..274e0f9935
--- /dev/null
+++ b/support/dktools/LICENSE.spdx
@@ -0,0 +1,6 @@
+SPDXVersion: SPDX-2.1
+DataLicense: CC0-1.0
+PackageName: dktools
+PackageOriginator: Dirk Krause
+PackageHomePage: https://sourceforge.net/projects/dktools/
+PackageLicenseDeclared: BSD-3-Clause
diff --git a/support/dktools/Makefile b/support/dktools/Makefile
index 91fff5f4aa..8c0efe263d 100644
--- a/support/dktools/Makefile
+++ b/support/dktools/Makefile
@@ -13,8 +13,7 @@
# ./configure
# make
# make install
-# should be used to install this software.
-#
+# can be used to install this software.
# PACKAGES
# ========
@@ -26,30 +25,50 @@
# ./sl6-prepare.sh
# (2) As unprivileged user run:
# ./sl6-build-rpm.sh
-# (3) Install the RPM:
+# (3) As root install the RPM:
# yum install ~/rpmbuild/RPMS/<arch>/dktools-<version>.rpm
#
-# For Debian Jessie:
-# ------------------
+# For RHEL7 and clones:
+# ---------------------
+# Use ./sl7-prepare.sh and ./sl7-build-rpm.sh instead.
+#
+# For Fedora
+# ----------
+# (1) As root run:
+# ./fc27-prepare.sh
+# (2) As unprivileged user run:
+# ./fc27-build-rpm.sh
+# (3) As root install the RPM
+# yum install ~/rpmbuild/RPMS/<arch>/dktools-<version>.rpm
+#
+# For Debian
+# ----------
# (1) As root run
-# ./debian-jessie-prepare.sh
+# ./debian-prepare.sh
# (2) As unprivileged user run
-# ./debian-jessie-build-deb.sh
-# (3) Install the *.deb package(s):
+# ./debian-build-deb.sh
+# (3) As root install the *.deb package(s):
# dpkg -i ~/.../dktools-<version>.deb
+# Package building
+# ================
+
# Package prefix, used when building packages
# DESTDIR=
# Version number, derived from version.txt contents
-VERSNO=4.8.3
+VERSNO=4.30.2
# Shared library version, first 2 positions of VERSNO
-SOVERS=4.8
+SOVERS=4.30
# Base directory for files on SourceForge
-SFBASE="http://sourceforge.net/projects/dktools/files/dktools"
+SFBASE=http://sourceforge.net/projects/dktools/files/dktools
+
+# Shell used to process commands in this Makefile.
+# Must be Bourne shell or derivative, not C Shell.
+SHELL=/bin/sh
# Path variables set by configure script
prefix=/usr/local
@@ -57,11 +76,16 @@ datarootdir=${prefix}/share
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
sbindir=${exec_prefix}/sbin
-libexecdir=${exec_prefix}/libexec
datadir=${datarootdir}
sysconfdir=${prefix}/etc
scd=${sysconfdir}
+
+# NOTE: libdir is not necessarily /usr/lib, but may be something like
+# /usr/lib/x86_64-linux-gnu on some systems.
+# Use $(prefix)/lib to access /usr/lib and alike
libdir=${exec_prefix}/lib
+
+libexecdir=${exec_prefix}/libexec
sharedlibdir=${libdir}/shared
mandir=${datarootdir}/man
includedir=${prefix}/include
@@ -69,12 +93,32 @@ localstatedir=${prefix}/var
srcdir=.
top_srcdir=.
+runstatedir=${localstatedir}/run
+systemddir=/lib/systemd/system
# Compiler commands and options set by configure script
+TOOLCHAIN=gcc
+CROSSBUILD=no
+BUILDCLASS=posix
+BUILDHOST=x86_64-unknown-linux-gnu
+TARGETCLASS=posix
+TARGETHOST=x86_64-unknown-linux-gnu
# Short OS name as returned by the 'uname -s' command
UNAME=Linux
+# A BSD compatible install program
+INSTALL=/usr/bin/install -c
+
+# Program or script to install executable programs
+INSTALL_PROGRAM=${INSTALL}
+
+# Program or script to install script files
+INSTALL_SCRIPT=${INSTALL}
+
+# Program or script to install data files
+INSTALL_DATA=${INSTALL} -m 644
+
# C compiler
CC=gcc
@@ -84,1270 +128,1154 @@ CPP=gcc -E
# C++ compiler
CXX=g++
-# Linker (we use the C compiler driver here as this adds C runtime
-# libraries automaticlly)
+# Invoke linker via compiler front end, ensures to link C/C++ runtime
LD=$(CC)
+LDCPP=$(CXX)
-# Definitions for C and C++ compilers, set to -DHAVE_CONFIG_H by configure
-DEFS=-DHAVE_CONFIG_H
-
-# Options for C compiler preprocessor
-CPPFLAGS=
+# Compiler and linker flags
+CFLAGS=-g -O2 -fPIC -D_REENTRANT
+CPPFLAGS=
+LDFLAGS=
-# Options for C++ compiler
-CXXFLAGS=-g -O2
+# Resource compiler
+RC=@echo "ERROR: No windows resouce compiler available!"
+RCFLAGS=-I. -D_UNICODE=1 -DUNICODE=1 -Igui-img/icons
-# Options for C compiler
-CFLAGS=-g -O2
+# Archiver
+AR=ar
-# Options for linker
-LDFLAGS=
+# Archive indexer
+RANLIB=ranlib
-# Options for C/C++ compiler preprocessor when compiling modules using
-# wxWidgets
-WXCPPFLAGS=-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__
+# Path for dynamic linking on Solaris
+RPATH=
+RPATHLINK=
+MKSORPATH=
+MKSORPATHLINK=
+MKSOCHECKSYMBOLS=
+# Command to create symbolic links
+LN_S=ln -s
-# C++ compiler options when compiling modules using wxWidgets
-WXCXXFLAGS=-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
+# General C, C++ and LD flags
+# ===========================
-# C compilter options when compiling modules using wxWidgets
-WXCFLAGS=-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
+# Definitions
+DEFS=-DHAVE_CONFIG_H -DDK4_BUILDING_DKTOOLS4=1
-# Linker options when building executables using wxWidgets
-WXLDFLAGS=-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
+# Include directories
+IDIRS=-I. -I$(srcdir) -I$(top_srcdir) -I$(includedir)
-# ?
-LIBS=
+# Program specific flags
+# ======================
-# Relocation path -R... set when compiling using Sun Workshop and
-# LD_LIBRARY_PATH is set
-RPATH=
-RPATHLINK=-Wl,-rpath-link,./
+# Flags for wxWidgets library
+# ---------------------------
+WXCPPFLAGS=-isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__
+WXCFLAGS=-isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
+WXCXXFLAGS=-isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
+WXLDFLAGS=-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
+WXVERSION=3.0.4
-# Set to -Wall when all warnings are required
-CWARN=-Wall
+# LD flags for MySQL
+# ------------------
+MYSQLLDFLAGS=
-# Libraries and features found by configure script
+# Real time library, on some systems required by MySQL
+# ----------------------------------------------------
+RTLIB=-lrt
-# Set to -D_LARGEFILE64_SOURCE=1 if there is 64-bit file support available
-# and needs to be activated explicitly
-FS64=-D_LARGEFILE64_SOURCE=1
+# Socket libraries for network functions
+# --------------------------------------
+SOCKLIB=
+NSLLIB=
-# Linker option to use zlib if available
+# Compression libraries
+# ---------------------
ZLIB=-lz
-
-# Linker option to use bzip2 library if available
BZLIB=-lbz2
-# Linker option to use -lcrypto -lssl if available
-CRYPTO=-lcrypto
+# Image libraries
+# ---------------
+LIBPNG=-lpng
+LIBJPEG=-ljpeg
+LIBTIFF=-ltiff
+IMGLIBS=-ltiff -lpng -ljpeg
-# Linker option to use -lxnet, -lsocket or none for TCP/IP functionality
-SOCKLIB=
+# Compiler flags to support 64 bit file sizes
+# -------------------------------------------
+FS64=-D_LARGEFILE64_SOURCE=1
-# Linker option to use -lxnet, -lnsl, -lsocket or none for name services
-NSLLIB=
+# OpenSSL for message digests and random
+# --------------------------------------
+CRYPTO=-lcrypto
-# Linker options to use tiff, jpeg and png libraries if available
-IMGLIBS=-ltiff -ljpeg -lpng
+# POSIX threads
+# -------------
+PTHREADLIB=
-# Linker options to use Berkeley DB library
+# Berkeley DB library
+# -------------------
DBLIB=-ldb
-
-# Linker options to use socket library required by DBLIB
DBLIBSOCK=-ldb
-# Linker options to use NetSNMP libraries and required libraries if available
+# NetSNMP library
+# ---------------
NETSNMP_LIBS=-Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -lnetsnmp -lcrypto -lm
-# Linker option to use pthread library if available
-PTHREADLIB=-lpthread
+# MySQL / MariaDB library
+# -----------------------
+MYSQLLIB=-lmariadbclient
-# Linker option to set path for MySQL library
-MYSQLLDFLAGS=
+# Libraries to add on Windows
+# ---------------------------
+WINCLILIB=
+WINGUILIB=
+CLILIB=
+GUILIB=
-# Linker option for realtime clock library
-RTLIB=-lrt
+# C compiler flags to build modules
+# =================================
-# AR program to build an archive (a library)
-AR=ar
+# CLI modules using char strings
+CFL_CLI_C8=$(DEFS) $(IDIRS) $(CPPFLAGS) $(CFLAGS) -fPIC -D_REENTRANT
-# NM program to list symbols from a library
-NM=nm
+# CLI modules using dkChar strings
+CFL_CLI_DK=$(DEFS) $(IDIRS) $(CPPFLAGS) $(CFLAGS) -fPIC -D_REENTRANT
-# RANLIB program to create archive (library) index, only required on
-# some platforms
-RANLIB=ranlib
+# CXX compiler flags to build modules
+# ===================================
-# Command to create soft links
-LN_S=ln -s
+# CLI modules using char strings
+CXXFL_CLI_C8=$(DEFS) $(IDIRS) $(CPPFLAGS) $(CXXFLAGS) -fPIC -D_REENTRANT
-# The make program to build projects
-MAKE=make
+# CLI modules using dkChar strings
+CXXFL_CLI_DK=$(DEFS) $(IDIRS) $(CPPFLAGS) $(CXXFLAGS) -fPIC -D_REENTRANT
-# File name extension for executable files
-EXEEXT=
+# CLI modules using wxChar strings
+CXXFL_CLI_WX=$(DEFS) $(IDIRS) $(CPPFLAGS) $(CXXFLAGS) -fPIC -D_REENTRANT $(WXCXXFLAGS)
-# File name extension for object files
-OBJEXT=o
+# CLI modules using wxChar strings
+CXXFL_GUI=$(DEFS) $(IDIRS) $(CPPFLAGS) $(CXXFLAGS) -fPIC -D_REENTRANT $(WXCXXFLAGS)
-# List of CLI programs using the NetSNMP libraries
-CLI_SNMPPROG=pjsnmp$(EXEEXT)
+# Linker flags when using CC as linker
+# ====================================
-# List of CLI programs using the MySQL library
-CLI_MYSQLPROG=itadmin$(EXEEXT)
+# Use CC as linker for CLI program using char
+LDFLC_CLI_C8=$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)
-# C/C++ compiler flags to build modules for shared libraries
-CFPIC=-fPIC -D_REENTRANT
+# Use CC as linker for CLI program using dkChar
+LDFLC_CLI_DK=$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)
-# Script to install shared libraries
-INSTALL_LIBS_SHARED=./scripts/install-libs-shared.sh
+# Linker flags when using C++ as linker
+# =====================================
-# A BSD compatible install program
-INSTALL=/usr/bin/install -c
-
-# Program or script to install executable programs
-INSTALL_PROGRAM=${INSTALL}
+# Use C++ as linker for CLI program using char
+LDFLCXX_CLI_C8=$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)
-# Program or script to install script files
-INSTALL_SCRIPT=${INSTALL}
+# Use C++ as linker for CLI program using dkChar
+LDFLCXX_CLI_DK=$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)
-# Program or script to install data files
-INSTALL_DATA=${INSTALL} -m 644
+# Use C++ as linker for CLI program using wxChar
+LDFLCXX_CLI_WX=$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)
-# Base libraries to build the CLI programs on Windows systems
-WINCLILIB=-lkernel32 -lgdi32 -ladvapi32 -luser32 -lnetapi32
+# Use C++ as linker for GUI program using wxChar
+LDFLCXX_GUI=$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)
-# Additional libraries to build the GUI programs on Windows systems
-WINGUILIB=-lole32 -loleaut32 -lshell32 -lcomctl32 -lcomdlg32 -lwinspool
-# Type of entry point on Windows
-WINENTRY=-municode
+# Compilation rules
+# =================
-# List of additional libraries to include when building CLI programs
-# $(WINCLILIB) on Windows, empty on other systems
-CLILIB=
-
-# List of additional libraries to include when building GUI programs
-# $(WINGUILIB) on Windows, empty on other systems
-GUILIB=
-
-# Entry point options, $(WINENTRY) on Windows, empty on other systems
-ENTRY=
-
-# Include path for C/C++ compiler
-INCLUDES= \
- -I. \
- -I$(srcdir) \
- -I$(top_srcdir) \
- -I$(includedir)
-
-# Options used when compiling *.c modules to *.o
-COPTS= \
- $(DEFS) \
- $(INCLUDES) \
- $(CFPIC) \
- $(CPPFLAGS) \
- $(CFLAGS) \
- $(FS64) \
- $(CWARN)
-
-# Options used when compiling *.cpp or *.cxx modules to *.o
-CCOPTS= \
- $(DEFS) \
- $(INCLUDES) \
- $(CFPIC) \
- $(CPPFLAGS) \
- $(CFLAGS) \
- $(CXXFLAGS) \
- $(WXCPPFLAGS) \
- $(WXCXXFLAGS) \
- $(FS64) \
- $(CWARN)
-
-# C compiler command including options
-COMPILEC= $(CC) $(COPTS)
-
-# C++ compiler command including options
-COMPILECPP= $(CXX) $(CCOPTS) $(WXCXXFLAGS)
-
-# Linker command
-LD=$(CC)
+EXEEXT=
+OBJEXT=o
+RCEXT=rc
+RESEXT=o
-# Linker command including options
-LINK=$(CC) $(CFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK) $(ENTRY)
-
-# Linker command for applications using C++ modules (i.e. wxWidgets libraries)
-LDCPP=$(CXX) $(CFLAGS) $(CXXFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK) $(ENTRY)
-
-# Command to build a shared library
-MKSOLIB=$(COMPILEC) -L. $(RPATHLINK) $(LIBRARIES) $(LDFLAGS) -shared -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)
-
-# Shared libraries needed for linking when building other shared libraries
-
-SOLIBZ=-lz
-SOLIBBZ=-lbz2
-SOLIBMATH=-lm
-SOLIBCRYPTO=-lcrypto
-SOLIBNET=
-SOLIBIMG=
-SOLIBSDBI=
-SOLIBWX=-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
-SOLIBDK3PORT=
-SOLIBDK3C=-ldk3c $(SOLIBBZ) $(SOLIBZ) $(SOLIBMATH)
-SOLIBDK3OF=-ldk3of
-SOLIBDK3CSRND=-ldk3csrnd
-SOLIBDK3BIF=-ldk3bif
-SOLIBDK3DBI=-ldk3dbi
-SOLIBDK3FIG=-ldk3fig
-SOLIBDK3BMEPS=-ldk3bmeps
-SOLIBDK3NET=-ldk3net
-SOLIBDK4BASE=-ldk4base
-SOLIBDK4MA=-ldk4ma
-SOLIBDK4MAIO8H=-ldk4maio8h
-SOLIBDK4MAIOWH=-ldk4maiowh
-SOLIBDK4MAIODH=-ldk4maiodh
-SOLIBDK4MAIO8D=-ldk4maio8d
-SOLIBDK4MAIOWD=-ldk4maiowd
-SOLIBDK4MAIODD=-ldk4maiodd
-SOLIBDK4C=-ldk4c $(SOLIBDK4MAIODD) $(SOLIBDK4MAIO8D) $(SOLIBDK4MA) \
- $(SOLIBDK4BASE) $(SOLIBBZ) $(SOLIBZ) $(SOLIBMATH)
-SOLIBDK4MDRND=-ldk4mdrnd
-SOLIBDK4PPPT=-ldk4pppt
-SOLIBDK4APP=-ldk4app $(SOLIBDK4C)
-SOLIBDK4LAT=-ldk4lat
-SOLIBDK4SOCK=-ldk4sock
-SOLIBDK4SOCKA=-ldk4socka
-SOLIBDK4DBI=-ldk4dbi
-SOLIBDK4DBIA=-ldk4dbia
-
-
-
-
-# Clean suffixes list
.SUFFIXES:
-# Rebuild new suffixes list
-.SUFFIXES: .o .cpp .c
+.SUFFIXES: .o .cpp .c
.c.o:
- @echo '### Compile C ### ' $<
- $(COMPILEC) -o $@ -c $<
+ @echo '### Compile (C) ' $<
+ $(CC) $(CFL_CLI_DK) -o $@ -c $<
.cpp.o:
- @echo '### Compile C++ ### ' $<
- $(COMPILECPP) -o $@ -c $<
+ @echo '### Compile (C++)' $<
+ $(CXX) $(CXXFL_GUI) -o $@ -c $<
-.c:
- @echo '### Link C ### ' $*
- $(COMPILEC) $(LDFLAGS) -o $* $*.c $(LIBS)
- chmod 755 $*
+# Programs, man pages and resource files for different suites
+# ===========================================================
-.cpp:
- @echo '### Link C++ ### ' $*
- $(COMPILECPP) $(LDFLAGS) -o $* $*.cpp $(LIBS)
- chmod 755 $*
+# Suite rescue
+# ------------
+
+# Shared libraries used by network programs in rescue suite
+#
+LIB_SHARED_RES_NET= \
+ libdk4sock.so \
+ libdk4socka.so
-# Programs to build for rescue system when sockets available
-NET_PROG_RES= \
+# Programs in rescue suite accessing network
+#
+PRG_RES_NET= \
dk-recv$(EXEEXT) \
dk-send$(EXEEXT)
-# Programs to build for rescue system
-PROG_RES= $(NET_PROG_RES) \
+# Man pages for programs in rescue suite using network
+#
+MAN_RES_NET= \
+ man/man1/dk-recv.1 \
+ man/man1/dk-send.1
+
+# Resource files for programs in rescue suite using network
+#
+RES_RES_NET= \
+ dktools/en/dk-recv.txt \
+ dktools/en/dk-send.txt \
+ dktools/de/dk-recv.txt \
+ dktools/de/dk-send.txt
+
+# Resource files in English for programs in rescue suite using network
+#
+RES_RES_NET_EN= \
+ dktools/en/dk-recv.txt \
+ dktools/en/dk-send.txt
+
+# Resource files in German for programs in rescue suite using network
+#
+RES_RES_NET_DE= \
+ dktools/de/dk-recv.txt \
+ dktools/de/dk-send.txt
+
+# Shared libraries used by programs in rescue suite
+#
+LIB_SHARED_RES= \
+ libdk4base.so \
+ libdk4c.so \
+ libdk4maio8d.so \
+ libdk4maio8h.so \
+ libdk4maiodd.so \
+ libdk4maiodh.so \
+ libdk4maiowd.so \
+ libdk4maiowh.so \
+ libdk4ma.so \
+ libdk4app.so \
+ libdk4mdrnd.so $(LIB_SHARED_RES_NET)
+
+# Programs in rescue suite
+#
+PRG_RES= $(PRG_RES_NET) \
dk-cat$(EXEEXT) \
dk-blks$(EXEEXT) \
dk-eradisk$(EXEEXT) \
dk-ls$(EXEEXT)
-# Man pages to install on rescue systems
-MAN_RES= \
+# Man pages for programs in rescue suite
+#
+MAN_RES= $(MAN_RES_NET) \
man/man1/dk-blks.1 \
man/man1/dk-cat.1 \
man/man1/dk-eradisk.1 \
- man/man1/dk-ls.1 \
- man/man1/dk-recv.1 \
- man/man1/dk-send.1
+ man/man1/dk-ls.1
-# Resource files to install on rescue systems
-RES_RES_EN= \
+# Resource files for programs in rescue suite
+#
+RES_RES= $(RES_RES_NET) \
dktools/en/dk-blks.txt \
- dktools/en/dk-cat.txt \
- dktools/en/dk-ls.txt \
- dktools/en/dk-recv.txt \
- dktools/en/dk-send.txt
+ dktools/en/dk-cat.txt \
+ dktools/en/dk-ls.txt \
+ dktools/de/dk-blks.txt \
+ dktools/de/dk-cat.txt \
+ dktools/de/dk-ls.txt
-RES_RES_DE= \
+# Resource files in English for programs in rescue suite
+#
+RES_RES_EN= $(RES_RES_NET_EN) \
+ dktools/en/dk-blks.txt \
+ dktools/en/dk-cat.txt \
+ dktools/en/dk-ls.txt
+
+# Resource files in German for programs in rescue suite
+#
+RES_RES_DE= $(RES_RES_NET_EN) \
dktools/de/dk-blks.txt \
- dktools/de/dk-cat.txt \
- dktools/de/dk-ls.txt \
- dktools/de/dk-recv.txt \
- dktools/de/dk-send.txt
+ dktools/de/dk-cat.txt \
+ dktools/de/dk-ls.txt
+
+# Suite cli
+# ---------
-# Command line programs to build when sockets available
-NET_PROG_CLI= \
+PRG_DAEMON_NET_POSIX= \
printqd$(EXEEXT) \
- printqdc$(EXEEXT) \
- lprngcl$(EXEEXT) \
rshdown$(EXEEXT)
-# Command line programs to build when NetSNMP available
-SNMP_PROG_CLI= \
- pjsnmp$(EXEEXT) prmonsnmp$(EXEEXT)
+# Programs in CLI suite accessing network and using POSIX (daemons)
+#
+PRG_CLI_NET_POSIX= \
+ printqdc$(EXEEXT)
+
+# Man pages for programs in CLI suite accessing network and using POSIX
+#
+MAN_CLI_NET_POSIX= \
+ man/man1/printqd.1 \
+ man/man5/printqd.conf.5 \
+ man/man5/printqd.protocol.5 \
+ man/man5/printqd.db.5 \
+ man/man1/rshdown.1
+
+# Resource files for programs in CLI suite accessing network and using POSIX
+#
+RES_CLI_NET_POSIX= \
+ dktools/de/printqd.str \
+
+# Programs in CLI suite accessing network
+#
+PRG_CLI_NET= $(PRG_CLI_NET_POSIX) \
+ lprngcl$(EXEEXT)
+
+# Man pages for programs in CLI suite accessing network
+#
+MAN_CLI_NET= $(MAN_CLI_NET_POSIX) \
+ man/man1/printqdc.1 \
+ man/man1/lprngcl.1
+
+# Resource files for programs in CLI suite accessing network
+#
+RES_CLI_NET= $(RES_CLI_NET_POSIX) \
+ dktools/de/printqdc.str \
+ dktools/de/lprngcl.txt \
+ dktools/de/lprngcl.str \
+ dktools/en/lprngcl.txt
+
+PRG_FILTER_SNMP_POSIX= \
+ pjsnmp$(EXEEXT)
+
+# Programs in CLI suite using the NetSNMP library
+#
+PRG_CLI_SNMP= \
+ prmonsnmp$(EXEEXT)
+
+# Man pages for programs in CLI suite using the NetSNMP library
+#
+MAN_CLI_SNMP= \
+ man/man1/pjsnmp.1 \
+ man/man1/prmonsnmp.1
+
+# Resource files for programs in CLI suite using the NetSNMP library
+#
+RES_CLI_SNMP= \
+ dktools/de/pjsnmp.str
-# Command line programs to build when MySQL available
-MYSQL_PROG_CLI= \
+# Programs in CLI suite using MySQL or MariaDB
+#
+PRG_CLI_MYSQL= \
itadmin$(EXEEXT)
-# Programs to build for CLI suite
-PROG_CLI= $(PROG_RES) \
- dk-sqlsplit$(EXEEXT) $(SNMP_PROG_CLI) \
- dk-sort$(EXEEXT) dk-fic$(EXEEXT) dk-pwgen$(EXEEXT) dk-rand$(EXEEXT) \
- dk-uid$(EXEEXT) $(NET_PROG_CLI) \
- dk-t2h$(EXEEXT) $(MYSQL_PROG_CLI) \
- dk-t2l$(EXEEXT) \
- dk-hex$(EXEEXT) \
- dk-bmm$(EXEEXT) \
- dk-pwd$(EXEEXT) \
- dkct$(EXEEXT) \
- addctrld$(EXEEXT) \
- dk-t2db$(EXEEXT) \
- dk-db2t$(EXEEXT) \
- dk-dbco$(EXEEXT) \
- bmpp$(EXEEXT) \
- fig2lat$(EXEEXT) \
- htmlbook$(EXEEXT) \
- dk3info$(EXEEXT) \
- dk4info$(EXEEXT) \
- plpdftex$(EXEEXT) \
- dkwxwiz$(EXEEXT)
-
-# Programs to build when cross-compiling on Linux for Windows
-PROG_CROSS= $(PROG_RES) \
- dk-sqlsplit$(EXEEXT) $(SNMP_PROG_CLI) \
- dk-sort$(EXEEXT) dk-fic$(EXEEXT) dk-pwgen$(EXEEXT) dk-rand$(EXEEXT) \
- dk-fic$(EXEEXT) $(NET_PROG_CLI) \
- dk-t2h$(EXEEXT) $(MYSQL_PROG_CLI) \
- dk-t2l$(EXEEXT) \
- dk-hex$(EXEEXT) \
- dk-bmm$(EXEEXT) \
- dk-pwd$(EXEEXT) \
- dkct$(EXEEXT) \
- addctrld$(EXEEXT) \
- dk-t2db$(EXEEXT) \
- dk-db2t$(EXEEXT) \
- dk-dbco$(EXEEXT) \
- bmpp$(EXEEXT) \
- fig2lat$(EXEEXT) \
- htmlbook$(EXEEXT) \
- dk3info$(EXEEXT) \
- dk4info$(EXEEXT) \
- plpdftex$(EXEEXT) \
- dkwxwiz$(EXEEXT)
+# Man pages for programs in CLI suite using MySQL or MariaDB
+#
+MAN_CLI_MYSQL= \
+ man/man1/itadmin.1
-# Programs to build for GUI suite
-PROG_GUI= $(PROG_CLI) \
- wxdkfcs$(EXEEXT) \
- wxdkct$(EXEEXT) \
- wxbmpp$(EXEEXT) \
- wxpqdic$(EXEEXT) \
- wximgsz$(EXEEXT) \
- wxdkclock$(EXEEXT) \
- wxdkhtb$(EXEEXT)
+# Resource files for programs in CLI suite using MySQL or MariaDB
+#
+RES_CLI_MYSQL= \
+ dktools/de/itadmin.str \
+ dktools/itadmin/it-de.sql \
+ dktools/itadmin/it-latin1.sql \
+ dktools/itadmin/it-utf8.sql
-# Static libraries to build for rescue system
-LIB_ST_RES=
+# Programs in CLI suite using OpenSSL
+#
+PRG_CLI_SSL= \
+ dk-pwgen$(EXEEXT) \
+ dk-rand$(EXEEXT) \
+ dk-fic$(EXEEXT)
-# Static libraries to build for CLI suite
-LIB_ST_CLI= $(LIB_ST_RES) \
- libdk4base.a \
- libdk4ma.a \
- libdk4maio8h.a \
- libdk4maiowh.a \
- libdk4maiodh.a \
- libdk4maio8d.a \
- libdk4maiowd.a \
- libdk4maiodd.a \
- libdk4c.a \
- libdk4pppt.a \
- libdk4socka.a \
- libdk4sock.a \
- libdk4dbia.a \
- libdk4dbi.a \
- libdk4app.a \
- libdk4pppta.a \
- libdk4lat.a \
- libdk4mdrnd.a \
- libdk3c.a \
- libdk3of.a \
- libdk3csrnd.a \
- libdk3bif.a \
- libdk3dbi.a \
- libdk3bmeps.a \
- libdk3fig.a \
- libdk3trace.a
+# Man pages for programs in CLI suite using OpenSSL
+#
+MAN_CLI_SSL= \
+ man/man1/dk-pwgen.1 \
+ man/man1/dk-rand.1 \
+ man/man1/dk-fic.1
-# Static libraries to build for GUI suite
-LIB_ST_GUI= $(LIB_ST_CLI) \
- libdk4wx.a \
- libdk4maioxd.a
+# Resource files for programs in CLI suite using OpenSSL
+#
+RES_CLI_SSL= \
+ dktools/de/dk-pwgen.txt \
+ dktools/de/dk-pwgen.str \
+ dktools/en/dk-pwgen.txt \
+ dktools/de/dk-fic.txt \
+ dktools/de/dk-fic.str \
+ dktools/en/dk-fic.txt
+
+# Programs in CLI suite using POSIX
+#
+PRG_CLI_POSIX= \
+ dk-uid$(EXEEXT)
-# Shared libraries to build for rescue system when no packaging used
-LIB_SH_RES_NO_PACKAGING=
+# Man pages for programs in CLI suite using POSIX
+#
+MAN_CLI_POSIX= \
+ man/man1/dk-uid.1
-# Shared libraries to build for CLI suite when no packaging used
-LIB_SH_CLI_NO_PACKAGING= $(LIB_SH_RES_NO_PACKAGING) \
- libdk4base.so \
- libdk4ma.so \
- libdk4maio8h.so \
- libdk4maiowh.so \
- libdk4maiodh.so \
- libdk4maio8d.so \
- libdk4maiowd.so \
- libdk4maiodd.so \
- libdk4c.so \
- libdk4pppt.so \
- libdk4socka.so \
- libdk4sock.so \
- libdk4dbia.so \
- libdk4dbi.so \
- libdk4app.so \
- libdk4pppta.so \
- libdk4lat.so \
- libdk4mdrnd.so \
- libdk3c.so \
- libdk3of.so \
- libdk3csrnd.so \
- libdk3bif.so \
- libdk3dbi.so \
- libdk3bmeps.so \
- libdk3fig.so \
- libdk3trace.so
+# Resource files for programs in CLI suite using POSIX
+#
+RES_CLI_POSIX= \
+ dktools/de/dk-uid.str \
+ dktools/de/dk-uid.txt \
+ dktools/en/dk-uid.txt
-# Shared libraries to build for GUI suite when no packaging used
-LIB_SH_GUI_NO_PACKAGING= $(LIB_SH_CLI_NO_PACKAGING) \
- libdk4wx.so \
- libdk4maioxd.so \
- libdk3wx.so
+# Program files in the CLI suite for Windows
+#
+PRG_CLI_WINDOWS= \
+ dkwt$(EXEEXT) \
+ wprclean$(EXEEXT)
-# Shared libraries to build for rescue system when packaging used
-LIB_SH_RES_PACKAGING= \
- libdk4base.so \
- libdk4maio8d.so \
- libdk4maiowd.so \
- libdk4maiodd.so \
- libdk4maio8h.so \
- libdk4maiowh.so \
- libdk4maiodh.so \
- libdk4ma.so \
- libdk4c.so \
- libdk4socka.so \
- libdk4sock.so \
- libdk4app.so \
- libdk4mdrnd.so
+# Man pages for program files in the CLI suite for Windows
+#
+MAN_CLI_WINDOWS=
-# Shared libraries to build for CLI suite when packaging used
-LIB_SH_CLI_PACKAGING= $(LIB_SH_RES_PACKAGING) \
- libdk4lat.so \
- libdk4dbi.so \
- libdk4dbia.so \
- libdk4pppt.so \
- libdk4pppta.so \
- libdk3c.so \
- libdk3of.so \
- libdk3csrnd.so \
+# Resource files for program files in the CLI suite for Windows
+#
+RES_CLI_WINDOWS= \
+ dktools/de/dkwt-boot.txt \
+ dktools/de/dkwt-print.txt \
+ dktools/de/dkwt-env.txt \
+ dktools/de/dkwt-keep.txt \
+ dktools/de/dkwt-printers.txt \
+ dktools/de/dkwt-clp.txt \
+ dktools/de/dkwt-groups.txt \
+ dktools/de/dkwt-login.txt \
+ dktools/de/dkwt-shutdown.txt \
+ dktools/de/dkwt-users.txt \
+ dktools/de/dkwt-unkeep.txt \
+ dktools/de/dkwt-help.txt \
+ dktools/de/dkwt.str \
+ dktools/de/dkwt-logout.txt \
+ dktools/de/wprclean.txt \
+ dktools/de/wprclean.str
+
+# Shared libraries for programs in CLI suite
+#
+LIB_SHARED_CLI= $(LIB_SHARED_RES) \
libdk3bif.so \
- libdk3dbi.so \
libdk3bmeps.so \
+ libdk3c.so \
libdk3fig.so \
- libdk3trace.so
-
-# Shared libraries to build for GUI suite when packaging used
-LIB_SH_GUI_PACKAGING= $(LIB_SH_CLI_PACKAGING) \
- libdk4wx.so \
- libdk4maioxd.so \
- libdk3wx.so
-
-# Shared libraries to build for rescue system when packaging used
-LIB_SH_RES=$(LIB_SH_RES_NO_PACKAGING)
-
-# Shared libraries to build for CLI suite
-LIB_SH_CLI=$(LIB_SH_CLI_NO_PACKAGING)
+ libdk3of.so \
+ libdk3trace.so \
+ libdk4bif.so \
+ libdk4dbi.so \
+ libdk4gra.so \
+ libdk4lat.so \
+ libdk4pppt.so \
+ libdk4bifa.so \
+ libdk4dbia.so \
+ libdk4graa.so \
+ libdk4lata.so
-# Shared libraries to build for GUI suite
-LIB_SH_GUI=$(LIB_SH_GUI_NO_PACKAGING)
+# Static libraries for CLI suite
+#
+LIB_STATIC_CLI= \
+ libdk3bif.a \
+ libdk3bmeps.a \
+ libdk3c.a \
+ libdk3fig.a \
+ libdk3of.a \
+ libdk3trace.a \
+ libdk4app.a \
+ libdk4base.a \
+ libdk4bifa.a \
+ libdk4bif.a \
+ libdk4c.a \
+ libdk4dbia.a \
+ libdk4dbi.a \
+ libdk4graa.a \
+ libdk4gra.a \
+ libdk4lata.a \
+ libdk4lat.a \
+ libdk4maio8d.a \
+ libdk4maio8h.a \
+ libdk4maiodd.a \
+ libdk4maiodh.a \
+ libdk4maiowd.a \
+ libdk4maiowh.a \
+ libdk4ma.a \
+ libdk4mdrnd.a \
+ libdk4pppt.a \
+ libdk4socka.a \
+ libdk4sock.a
-all: # Synonym for build
-all: build
+# Programs in CLI suite
+#
+PRG_CLI= $(PRG_RES) $(PRG_CLI_NET) $(PRG_CLI_SNMP) $(PRG_CLI_MYSQL) \
+ dk4info$(EXEEXT) $(PRG_CLI_SSL) $(PRG_CLI_POSIX) \
+ bmpp$(EXEEXT) \
+ wxd2lat$(EXEEXT) \
+ plpdftex$(EXEEXT) \
+ dk-sort$(EXEEXT) \
+ dk-lines$(EXEEXT) \
+ dk-bin2c$(EXEEXT) \
+ dk-bmm$(EXEEXT) \
+ dk-hex$(EXEEXT) \
+ dk-pwd$(EXEEXT) \
+ dk-t2h$(EXEEXT) \
+ dk-t2l$(EXEEXT) \
+ dk-sqlsplit$(EXEEXT) \
+ dk3info$(EXEEXT) \
+ fig2lat$(EXEEXT) \
+ htmlbook$(EXEEXT) \
+ dkct$(EXEEXT) \
+ dkwxwiz$(EXEEXT) \
+ addctrld$(EXEEXT) \
+ dk-t2db$(EXEEXT) \
+ dk-db2t$(EXEEXT) \
+ dk-dbco$(EXEEXT)
-help: # Show targets in Makefile
- @echo 'Some systems (i.e. Windows) append a special filename extension'
- @echo '(i.e. .exe) to program file names.'
- @echo 'On such systems use "make dk-ls.exe" instead of "make dk-ls"'
- @echo 'to build a program.'
- @echo 'Here is a list of the targets in this Makefile:'
- -@egrep '^[^:;=. ]*::?[ ]*' Makefile|grep '#'|grep -v '^#'
+# Man pages for programs in CLI suite
+#
+MAN_CLI= $(MAN_CLI_NET) $(MAN_CLI_SNMP) $(MAN_CLI_MYSQL) $(MAN_CLI_SSL) \
-build: # Build the software
-build: build-arch build-indep
+# Resource files for programs in CLI suite
+#
+RES_CLI= $(RES_CLI_NET) $(RES_CLI_SNMP) $(RES_CLI_MYSQL) $(RES_CLI_SSL) \
-build-arch: # Build architecture specific files
-build-arch: $(PROG_GUI) $(LIB_SH_GUI)
+# Suite gui
+# ---------
-build-indep: # Build architecture independent files
- find man -type d -exec chmod 755 {} \;
- find man -type f -exec chmod 644 {} \;
+LIB_SHARED_GUI= $(LIB_SHARED_CLI) \
+ libdk3wx.so \
+ libdk4maioxd.so \
+ libdk4wx.so
-install: # Install the software
-install: install-arch install-indep
- [ "X$(DESTDIR)" = "X" -o "X$(UNAME)" != "XSunOS" ] || cp pkginfo $(DESTDIR)/pkginfo
- [ "X$(DESTDIR)" = "X" -o "X$(UNAME)" != "XSunOS" ] || chmod 644 $(DESTDIR)/pkginfo
- @echo Finished installation
- @echo Some directories used by the printqd daemon may need
- @echo ownership and permission corrections. See 'printqd(1)'.
-
-install-arch: # Install architecture specific files
-install-arch: install-programs i-l-sh i-incl i-r-gui
- @echo Finished installation of architecture specific files.
-
-# Shared libraries to build and install
-LIBS_SHARED=$(LIB_SH_GUI)
-
-i-l-sh: # Install shared libraries
-i-l-sh: build-arch install-directories
- $(INSTALL) -c -d "$(DESTDIR)$(libdir)"
- for i in $(LIBS_SHARED) ; do $(INSTALL) -c -m 644 $$i.$(SOVERS) "$(DESTDIR)$(libdir)" ; done
- for i in $(LIBS_SHARED) ; do $(LN_S) $$i.$(SOVERS) "$(DESTDIR)$(libdir)/$$i"; done
- @echo Finished installation of shared libraries.
-
-# Static libraries to build and install
-LIBS_STATIC=$(LIB_ST_GUI)
-
-i-l-st: # Install static libraries
-i-l-st: build-arch install-directories
- $(INSTALL_DATA) $(LIBS_STATIC) "$(DESTDIR)$(libdir)"
- @echo Finished installation of static libraries.
-
-i-incl: # Install include files for libraries
- $(INSTALL_DATA) dk4*.h Dk4*.h dk3trace.h "$(DESTDIR)$(includedir)"
- @echo Finished installation of include files.
-
-i-r-res: # Install resources for rescue programs
-i-r-res:
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools/en"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools/de"
- $(INSTALL_DATA) $(RES_RES_EN) "$(DESTDIR)$(datarootdir)/dktools/en"
- $(INSTALL_DATA) $(RES_RES_DE) "$(DESTDIR)$(datarootdir)/dktools/de"
- @echo Finished resources installation for rescue programs.
-
-i-r-cli: # Install resources for CLI programs
-i-r-cli: install-directories i-r-res
- find ./dktools -type d -exec chmod 755 {} \;
- find ./dktools -type f -exec chmod ugo+r,go-w {} \;
- find ./dk4app -type d -exec chmod 755 {} \;
- find ./dk4app -type f -exec chmod ugo+r,go-w {} \;
- (cd ./dktools ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dktools" ; tar xf -)
- (cd ./dk4app ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dk4app" ; tar xf -)
- find ./help-chm -type d -exec chmod 755 {} \;
- find ./help-chm -type f -exec chmod 644 {} \;
- find ./help-htb -type d -exec chmod 755 {} \;
- find ./help-htb -type f -exec chmod 644 {} \;
- (cd ./help-htb ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dktools" ; tar xf -)
- $(INSTALL_DATA) dktools.pc "$(DESTDIR)$(libdir)/pkgconfig/dktools.pc"
- $(INSTALL_DATA) etc-dk3app/dk3paper.conf "$(DESTDIR)$(sysconfdir)/dk3app"
- $(INSTALL_SCRIPT) itaclean.sh "$(DESTDIR)$(bindir)/itaclean"
- $(INSTALL_DATA) rshdown.conf.sample "$(DESTDIR)$(sysconfdir)/rshdown"
- $(INSTALL_DATA) printqd.conf.sample "$(DESTDIR)$(sysconfdir)/printqd"
- @echo Finished resources installation for CLI programs.
+LIB_STATIC_GUI= $(LIB_STATIC_CLI) \
+ libdk3wx.a \
+ libdk4maioxd.a \
+ libdk4wx.a
-i-r-gui: # Install resources for GUI programs
-i-r-gui: install-directories i-r-cli
- $(INSTALL_DATA) dkicon.ico "$(DESTDIR)$(datarootdir)/dktools"
- $(INSTALL_DATA) dkclock.ico "$(DESTDIR)$(datarootdir)/dktools"
- $(INSTALL_DATA) wxbmpp.desktop "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL_DATA) wxdkclock.desktop "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL_DATA) wxdkct.desktop "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL_DATA) wximgsz.desktop "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL_DATA) wxdkfcs.desktop "$(DESTDIR)$(datarootdir)/applications"
- @echo Finished resources installation for GUI programs.
+# Programs in the GUI suite for Windows
+PRG_GUI_WINDOWS= \
+ dkwxpath$(EXEEXT) \
+ winprint$(EXEEXT) \
+ ChangeScreenSize$(EXEEXT)
+# Man pages for programs in the GUI suite for Windows
+MAN_GUI_WINDOWS=
-install-programs: # Install the executable programs
-install-programs: build-arch install-directories
- $(INSTALL) $(PROG_GUI) "$(DESTDIR)$(bindir)"
- @echo Finished installation of executable files.
+# Resource files for programs in the GUI suite for Windows
+RES_GUI_WINDOWS= \
+ dktools/de/winprint.str \
+ dktools/de/wxdkscrsz.str
-install-indep: # Install architecture independent files
-install-indep: build-indep install-directories
- @echo Finished installation of architecture independent files.
+# Programs in the GUI suite using OpenSSL
+PRG_GUI_SSL= \
+ wxdkfcs$(EXEEXT)
-install-rescue-man: # Install man pages for rescue systems
-install-rescue-man: build-indep
- $(INSTALL) -d "$(DESTDIR)$(mandir)/man1"
- $(INSTALL_DATA) $(MAN_RES) "$(DESTDIR)$(mandir)/man1"
+# Man pages for programs in the GUI suite using OpenSSL
+MAN_GUI_SSL= \
+ man/man1/wxdkfcs.1
-install-manpages: # Install man pages
-install-manpages: build-indep install-directories
- $(INSTALL_DATA) man/man1/* "$(DESTDIR)$(mandir)/man1"
- $(INSTALL_DATA) man/man5/* "$(DESTDIR)$(mandir)/man5"
- @echo Finished installation of manpages.
+# Resource files for programs in the GUI suite using OpenSSL
+RES_GUI_SSL= \
+ dktools/de/wxdkfcs.str
-install-directories: # Create installation directories
- $(INSTALL) -d "$(DESTDIR)$(libdir)"
- $(INSTALL) -d "$(DESTDIR)$(libdir)/pkgconfig"
- $(INSTALL) -d "$(DESTDIR)$(includedir)"
- $(INSTALL) -d "$(DESTDIR)$(bindir)"
- $(INSTALL) -d "$(DESTDIR)$(mandir)"
- $(INSTALL) -d "$(DESTDIR)$(mandir)/man1"
- $(INSTALL) -d "$(DESTDIR)$(mandir)/man5"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dk4app"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/dk3app"
- $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/rshdown"
- $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/printqd"
- $(INSTALL) -d "$(DESTDIR)$(localstatedir)/log"
- $(INSTALL) -d -m 775 "$(DESTDIR)$(localstatedir)/log/printqd"
- $(INSTALL) -d "$(DESTDIR)$(localstatedir)/run"
- $(INSTALL) -d -m 775 "$(DESTDIR)$(localstatedir)/lib/printqd"
- @echo Finished directory creation for installation.
-
-# Test programs for the modules.
-TESTPROGS= \
- test-dk4maac \
- test-dk4maauc \
- test-dk4maas \
- test-dk4maaus \
- test-dk4maai \
- test-dk4maaui \
- test-dk4maal \
- test-dk4maaul \
- test-dk4maall \
- test-dk4maaull \
- test-dk4maami \
- test-dk4maamu \
- test-dk4mai8ddu \
- test-dk4mai8ddi \
- test-dk4mai8dsz \
- test-dk4str8 \
- test-dk4loc \
- test-dk4time \
- test-dk4exep8 \
- test-dk4path8 \
- ex-sto \
- test-dk4strm \
- test-dk4numl \
- test-dk4tsp08 \
- test-bool \
- test-dk4enc \
- test-dk4user \
- test-container \
- test-skip
-
-# All test programs found by the configure script
-TESTPROGRAMS= test-a85d \
- test-a85e \
- test-binenc \
- test-bool \
- test-deldir \
- test-deldirwc \
- test-deltree \
- test-dk4c8dbl \
- test-dk4dir \
- test-dk4dir08 \
- test-dk4enc \
- test-dk4exep8 \
- test-dk4loc \
- test-dk4maac \
- test-dk4maai \
- test-dk4maal \
- test-dk4maall \
- test-dk4maami \
- test-dk4maamu \
- test-dk4maas \
- test-dk4maauc \
- test-dk4maaui \
- test-dk4maaul \
- test-dk4maaull \
- test-dk4maaus \
- test-dk4mai8dbl \
- test-dk4mai8ddi \
- test-dk4mai8ddu \
- test-dk4mai8dsz \
- test-dk4numl \
- test-dk4path8 \
- test-dk4str8 \
- test-dk4strm \
- test-dk4strmco \
- test-dk4time \
- test-dk4time08 \
- test-dk4tsp08 \
- test-dk4user \
- test-eradisk \
- test-filei \
- test-fne \
- test-home \
- test-inet-pton \
- test-mbstr \
- test-membuf \
- test-mkdir \
- test-opt \
- test-paper \
- test-peer \
- test-rld \
- test-rle \
- test-ser \
- test-skip \
- test-sock \
- test-sqdbl \
- test-strms \
- test-strmu \
- test-strmw \
- test-udpa \
- test-unser \
- testlzw \
- testlzws
+# Programs in GUI suite accessing network
+PRG_GUI_NET= \
+ wxpqdic$(EXEEXT)
-clean: # Clean up (remove build results)
- -rm -f errors
- -rm -f *.deb
- -rm -f *.o *.obj *.exe
- -rm -f $(TESTPROGRAMS) $(TESTPROGS) $(PROG_GUI)
- -rm -f *.a
- -rm -f *.so.$(SOVERS) *.so
- -rm -f doxygen.out
- -rm -f dk4config
- -rm -f dk3config
- -rm -f wxcs
- -rm -f doc/src/*.aux doc/src/*.log doc/src/math-img.pdf
- -rm -f doc/src/index.pdf doc/src/index.svg
- -rm -f doc/src/next.pdf doc/src/next.svg
- -rm -f doc/src/prev.pdf doc/src/prev.svg
- -rm -f doc/src/toc.pdf doc/src/toc.svg
- @echo 'Finished cleanup.'
+# Man pages for programs in GUI suite using network
+MAN_GUI_NET= \
+ man/man1/wxpqdic.1
-get-orig-source: # Retrieve original source archive
- wget -O dktools-$(VERSNO) $(SFBASE)/dktools-$(VERSNO).tar.gz/download
+# Resource files for programs in GUI suite using network
+RES_GUI_NET=
-# Complete list of all libraries to build
-# Probably not all of them are installed
-LIBRARIESTOBUILD= libdk4wx.$(LIBEXT) \
- libdk4.a \
- libdk4maio8d.$(LIBEXT) \
- libdk4maiowd.$(LIBEXT) \
- libdk4maiodd.$(LIBEXT) \
- libdk4maio8h.$(LIBEXT) \
- libdk4maiowh.$(LIBEXT) \
- libdk4maiodh.$(LIBEXT) \
- libdk4ma.$(LIBEXT) \
- libdk4base.$(LIBEXT) \
- libdk4c.$(LIBEXT) \
- libdk4pppt.$(LIBEXT) \
- libdk4app.$(LIBEXT) \
- libdk4pppta.$(LIBEXT) \
- libdk4lat.$(LIBEXT) \
- libdk4sock.$(LIBEXT) \
- libdk4socka.$(LIBEXT) \
- libdk4dbi.$(LIBEXT) \
- libdk4dbia.$(LIBEXT)
-
-binary: # Build all binaries
-binary: binary-arch binary-indep
-
-binary-arch: # Build architecture-specific binaries
-binary-arch: build-arch $(LIBRARIESTOBUILD) $(PROG_GUI)
- @echo 'Finished creating the architecture-specific binaries.'
-
-binary-indep: # Build architecture-independent binaries
-binary-indep: build-indep
- @echo 'There are no architecture-independent binaries in this project.'
+# Programs in GUI suite
+PRG_GUI= $(PRG_CLI) $(PRG_GUI_SSL) $(PRG_GUI_NET) \
+ wxdkdraw$(EXEEXT) \
+ wxbmpp$(EXEEXT) \
+ wximgsz$(EXEEXT) \
+ wxdkhtb$(EXEEXT) \
+ wxdkclock$(EXEEXT)
+
+# Man pages for programs in GUI suite
+MAN_GUI= $(MAN_GUI_SSL) $(MAN_GUI_NET) \
+ man/man1/wxdkdraw.1 \
+ man/man1/wxbmpp.1 \
+ man/man1/wximgsz.1 \
+ man/man1/wxdkhtb.1 \
+ man/man1/wxdkclock.1
+
+# Resource files for programs in GUI suite
+RES_GUI= $(RES_GUI_SSL) $(RES_GUI_NET) \
+ dktools/de/wxdkdraw.str \
+ dktools/de/wxbmpp4.str \
+ dktools/de/wxbmpp.str \
+ dktools/de/wximgsz.str \
+ dktools/de/wxdkhtb.str \
+ dktools/de/wxdkclock.str
+
+# List of modules per library
+# ===========================
+
+# DK4 libraries
+# -------------
# Objects for libdk4wx.so or libdk4wx.a library
LIBDK4WXOBJ= \
- Dk4WxControl.o \
- Dk4WxProgressDialog.o \
- Dk4WxFrame.o \
- Dk4WxHelpController.o \
- Dk4WxAutostartController.o \
- Dk4WxApplicationHelper.o \
- dk4wxpref.o \
- dk4wxstt.o \
- dk4recwx.o \
- dk4tspwx.o \
- dk4strx.o
+ Dk4WxControl.$(OBJEXT) \
+ Dk4WxColourView.$(OBJEXT) \
+ Dk4WxColourPalette.$(OBJEXT) \
+ Dk4WxProgressDialog.$(OBJEXT) \
+ Dk4WxYesNoDialog.$(OBJEXT) \
+ Dk4WxFrame.$(OBJEXT) \
+ Dk4WxHelpController.$(OBJEXT) \
+ Dk4WxAutostartController.$(OBJEXT) \
+ Dk4WxApplicationHelper.$(OBJEXT) \
+ Dk4WxProcessingController.$(OBJEXT) \
+ dk4wxpref.$(OBJEXT) \
+ dk4wxstt.$(OBJEXT) \
+ dk4recwx.$(OBJEXT) \
+ dk4tspwx.$(OBJEXT) \
+ dk4strx.$(OBJEXT)
# Objects for libdk4socka.so or libdk4socka.a library
LIBDK4SOCKAOBJ= \
- dk4socka09.o \
- dk4socka08.o \
- dk4socka07.o \
- dk4socka06.o \
- dk4socka05.o \
- dk4socka04.o \
- dk4socka03.o \
- dk4socka02.o \
- dk4socka01.o
+ dk4socka09.$(OBJEXT) \
+ dk4socka08.$(OBJEXT) \
+ dk4socka07.$(OBJEXT) \
+ dk4socka06.$(OBJEXT) \
+ dk4socka05.$(OBJEXT) \
+ dk4socka04.$(OBJEXT) \
+ dk4socka03.$(OBJEXT) \
+ dk4socka02.$(OBJEXT) \
+ dk4socka01.$(OBJEXT)
# Objects for libdk4sock.so or libdk4sock.a library
LIBDK4SOCKOBJ= \
- dk4sock37.o \
- dk4sock36.o \
- dk4sock35.o \
- dk4sock34.o \
- dk4sock33.o \
- dk4sock32.o \
- dk4sock31.o \
- dk4sock30.o \
- dk4sock29.o \
- dk4sock28.o \
- dk4sock27.o \
- dk4sock26.o \
- dk4sock25.o \
- dk4sock24.o \
- dk4sock23.o \
- dk4sock22.o \
- dk4sock21.o \
- dk4sock20.o \
- dk4sock19.o \
- dk4sock18.o \
- dk4sock17.o \
- dk4sock16.o \
- dk4sock15.o \
- dk4sock14.o \
- dk4sock13.o \
- dk4sock12.o \
- dk4sock11.o \
- dk4sock10.o \
- dk4sock09.o \
- dk4sock08.o \
- dk4sock07.o \
- dk4sock06.o \
- dk4sock05.o \
- dk4sock04.o \
- dk4sock03.o \
- dk4sock02.o \
- dk4sock01.o
+ dk4sock37.$(OBJEXT) \
+ dk4sock36.$(OBJEXT) \
+ dk4sock35.$(OBJEXT) \
+ dk4sock34.$(OBJEXT) \
+ dk4sock33.$(OBJEXT) \
+ dk4sock32.$(OBJEXT) \
+ dk4sock31.$(OBJEXT) \
+ dk4sock30.$(OBJEXT) \
+ dk4sock29.$(OBJEXT) \
+ dk4sock28.$(OBJEXT) \
+ dk4sock27.$(OBJEXT) \
+ dk4sock26.$(OBJEXT) \
+ dk4sock25.$(OBJEXT) \
+ dk4sock24.$(OBJEXT) \
+ dk4sock23.$(OBJEXT) \
+ dk4sock22.$(OBJEXT) \
+ dk4sock21.$(OBJEXT) \
+ dk4sock20.$(OBJEXT) \
+ dk4sock19.$(OBJEXT) \
+ dk4sock18.$(OBJEXT) \
+ dk4sock17.$(OBJEXT) \
+ dk4sock16.$(OBJEXT) \
+ dk4sock15.$(OBJEXT) \
+ dk4sock14.$(OBJEXT) \
+ dk4sock13.$(OBJEXT) \
+ dk4sock12.$(OBJEXT) \
+ dk4sock11.$(OBJEXT) \
+ dk4sock10.$(OBJEXT) \
+ dk4sock09.$(OBJEXT) \
+ dk4sock08.$(OBJEXT) \
+ dk4sock07.$(OBJEXT) \
+ dk4sock06.$(OBJEXT) \
+ dk4sock05.$(OBJEXT) \
+ dk4sock04.$(OBJEXT) \
+ dk4sock03.$(OBJEXT) \
+ dk4sock02.$(OBJEXT) \
+ dk4sock01.$(OBJEXT)
# Objects for libdk4lat.so or libdk4lat.a library
LIBDK4LATOBJ= \
- dk4uc2l.o
+ dk4uc2l.$(OBJEXT)
+
+# Objects for libdk4lata.so or libdk4lata.a library
+LIBDK4LATAOBJ= \
+ dk4uc2la.$(OBJEXT)
# Objects for libdk4app.so or libdk4app.a library
LIBDK4APPOBJ= \
- dk4fdrda.o \
- dk4fdrde.o \
- dk4fdwre.o \
- dk4mema.o \
- dk4svbufa.o \
- dk4fopda.o \
- dk4appargs.o \
- dk4appop.o \
- dk4appmkdh.o \
- dk4appstt.o \
- dk4appenc.o \
- dk4aopt01.o \
- dk4aopt02.o \
- dk4aopt03.o \
- dk4aopt04.o \
- dk4aopt05.o \
- dk4aopt06.o \
- dk4aopt07.o \
- dk4aopt08.o \
- dk4aopt09.o \
- dk4aopt10.o \
- dk4aopt11.o \
- dk4aopt12.o \
- dk4aopt13.o \
- dk4aopt14.o \
- dk4aopt15.o \
- dk4aopt16.o \
- dk4appfs03.o \
- dk4appfs04.o \
- dk4appfs01.o \
- dk4appfs02.o \
- dk4appfne.o \
- dk4dira.o \
- dk4fileia.o \
- dk4appdeltree.o \
- dk4appdeldir.o \
- dk4appdelfile.o \
- dk4applog.o \
- dk4apref.o \
- dk4aprgs.o \
- dk4apphlv.o \
- dk4strda.o
+ dk4fdrda.$(OBJEXT) \
+ dk4fdrde.$(OBJEXT) \
+ dk4fdwre.$(OBJEXT) \
+ dk4mema.$(OBJEXT) \
+ dk4svbufa.$(OBJEXT) \
+ dk4fopda.$(OBJEXT) \
+ dk4appargs.$(OBJEXT) \
+ dk4appop.$(OBJEXT) \
+ dk4appmkdh.$(OBJEXT) \
+ dk4appstt.$(OBJEXT) \
+ dk4appenc.$(OBJEXT) \
+ dk4aopt01.$(OBJEXT) \
+ dk4aopt02.$(OBJEXT) \
+ dk4aopt03.$(OBJEXT) \
+ dk4aopt04.$(OBJEXT) \
+ dk4aopt05.$(OBJEXT) \
+ dk4aopt06.$(OBJEXT) \
+ dk4aopt07.$(OBJEXT) \
+ dk4aopt08.$(OBJEXT) \
+ dk4aopt09.$(OBJEXT) \
+ dk4aopt10.$(OBJEXT) \
+ dk4aopt11.$(OBJEXT) \
+ dk4aopt12.$(OBJEXT) \
+ dk4aopt13.$(OBJEXT) \
+ dk4aopt14.$(OBJEXT) \
+ dk4aopt15.$(OBJEXT) \
+ dk4aopt16.$(OBJEXT) \
+ dk4appfs03.$(OBJEXT) \
+ dk4appfs04.$(OBJEXT) \
+ dk4appfs01.$(OBJEXT) \
+ dk4appfs02.$(OBJEXT) \
+ dk4appfne.$(OBJEXT) \
+ dk4dira.$(OBJEXT) \
+ dk4fileia.$(OBJEXT) \
+ dk4appdeltree.$(OBJEXT) \
+ dk4appdeldir.$(OBJEXT) \
+ dk4appdelfile.$(OBJEXT) \
+ dk4applog.$(OBJEXT) \
+ dk4apref.$(OBJEXT) \
+ dk4aprgs.$(OBJEXT) \
+ dk4apphlv.$(OBJEXT) \
+ dk4strda.$(OBJEXT)
# Objects for libdk4mdrnd.so or libdk4mdrnd.a library
LIBDK4MDRNDOBJ= \
- dk4md.o
-
-# Objects for libdk4pppta.so or libdk4pppta.a library
-LIBDK4PPPTAOBJ= \
- dk4papea.o
+ dk4md.$(OBJEXT)
+
+LIBDK4BIFOBJ= \
+ dk4bifa.$(OBJEXT) \
+ dk4bif.$(OBJEXT) \
+ dk4pxres.$(OBJEXT) \
+ dk4pxbit.$(OBJEXT) \
+ dk4cs.$(OBJEXT) \
+ dk4bifp.$(OBJEXT) \
+ dk4bifj.$(OBJEXT) \
+ dk4bift.$(OBJEXT) \
+ dk4bifn.$(OBJEXT) \
+ dk4bifto.$(OBJEXT) \
+ dk4bifpb.$(OBJEXT)
+
+LIBDK4GRAOBJ= \
+ dk4grco.$(OBJEXT) \
+ dk4gra.$(OBJEXT) \
+ dk4grpat.$(OBJEXT) \
+ dk4greps.$(OBJEXT) \
+ dk4grepp.$(OBJEXT) \
+ dk4grpdf.$(OBJEXT) \
+ dk4grpgf.$(OBJEXT) \
+ dk4grepi.$(OBJEXT) \
+ dk4grpdi.$(OBJEXT) \
+ dk4grpgi.$(OBJEXT) \
+ dk4grpdt.$(OBJEXT) \
+ dk4grat.$(OBJEXT) \
+ dk4fontc.$(OBJEXT) \
+ dk4font.$(OBJEXT) \
+ dk4paper.$(OBJEXT) \
+ dk4xsp.$(OBJEXT) \
+ dk4bb.$(OBJEXT) \
+ dk4bb32.$(OBJEXT)
# Objects for libdk4pppt.so or libdk4pppt.a library
LIBDK4PPPTOBJ= \
- dk4font.o \
- dk4paper.o
+ dk4pppt.$(OBJEXT)
+
+LIBDK4BIFAOBJ= \
+ dk4bifap.$(OBJEXT)
+
+LIBDK4GRAAOBJ= \
+ dk4graa.$(OBJEXT) \
+ dk4gralo.$(OBJEXT) \
+ dk4papea.$(OBJEXT) \
+ dk4grcoa.$(OBJEXT)
+
+# Objects for libdk4pppta.so or libdk4pppta.a library
+LIBDK4PPPTAOBJ= \
+ dk4pppta.$(OBJEXT)
# Object for libdk4c.so or libdk4c.a library
-LIBDK4COBJ= \
- dk4dmt.o \
- dk4mdch.o \
- dk4binenc.o \
- dk4stt.o \
- dk4opt.o \
- dk4opt01.o \
- dk4opt02.o \
- dk4opt03.o \
- dk4opt04.o \
- dk4opt05.o \
- dk4opt06.o \
- dk4opt07.o \
- dk4pref.o \
- dk4tspdk.o \
- dk4tsp32.o \
- dk4tsp16.o \
- dk4tsp08.o \
- dk4strmco.o \
- dk4lzwe.o \
- dk4mbstrm.o \
- dk4membs.o \
- dk4membf.o \
- dk4membuf.o \
- dk4strmu.o \
- dk4strms.o \
- dk4strmw.o \
- dk4strmr.o \
- dk4strmf.o \
- dk4strmg.o \
- dk4strmb.o \
- dk4strmodk.o \
- dk4strmo08.o \
- dk4strmo16.o \
- dk4strmo32.o \
- dk4c8dbl.o \
- dk4strm.o \
- dk4fput.o \
- dk4svbuf.o \
- dk4fopd.o \
- dk4fopwc.o \
- dk4fopc8.o \
- dk4exepd.o \
- dk4exepw.o \
- dk4exep8.o \
- dk4mkdh.o \
- dk4mkdh8.o \
- dk4mkdhw.o \
- dk4symlink.o \
- dk4fileiu.o \
- dk4fileigd.o \
- dk4fileigw.o \
- dk4fileig8.o \
- dk4filei.o \
- dk4fileid.o \
- dk4fileiw.o \
- dk4filei8.o \
- dk4filed.o \
- dk4filew.o \
- dk4file8.o \
- dk4fs.o \
- dk4mm.o \
- dk4stat.o \
- dk4statd.o \
- dk4statw.o \
- dk4stat8.o \
- dk4pathd.o \
- dk4pathw.o \
- dk4path8.o \
- dk4userf.o \
- dk4enc.o \
- dk4bom.o \
- dk4rec25.o \
- dk4rec24.o \
- dk4rec23.o \
- dk4rec22.o \
- dk4rec21.o \
- dk4rec20.o \
- dk4rec19.o \
- dk4rec18.o \
- dk4rec17.o \
- dk4rec16.o \
- dk4rec15.o \
- dk4rec14.o \
- dk4rec13.o \
- dk4rec12.o \
- dk4rec11.o \
- dk4rec10.o \
- dk4rec09.o \
- dk4rec08.o \
- dk4rec07.o \
- dk4rec06.o \
- dk4rec05.o \
- dk4rec04.o \
- dk4rec03.o \
- dk4rec02.o \
- dk4rec01.o \
- dk4ansi.o \
- dk4utf8.o \
- dk4utf16.o \
- dk4c32.o \
- dk4loc.o \
- dk4wregd.o \
- dk4wregw.o \
- dk4wreg8.o \
- dk4wregc.o \
- dk4fd.o \
- dk4hnamed.o \
- dk4hnamew.o \
- dk4hname8.o \
- dk4user.o \
- dk4ufi.o \
- dk4ufiwc.o \
- dk4ufi08.o \
- dk4fne.o \
- dk4fnewc.o \
- dk4fne08.o \
- dk4getcwdd.o \
- dk4getcwdw.o \
- dk4getcwd8.o \
- dk4dir.o \
- dk4dirwc.o \
- dk4dir08.o \
- dk4deldir.o \
- dk4deldirwc.o \
- dk4deldir08.o \
- dk4delfile.o \
- dk4delfilewc.o \
- dk4delfile08.o \
- dk4istty.o \
- dk4ftimedk.o \
- dk4ftimewc.o \
- dk4ftime08.o \
- dk4ftime.o \
- dk4ctime.o \
- dk4time.o \
- dk4timedk.o \
- dk4timewc.o \
- dk4time08.o \
- dk4inst.o \
- dk4getpid.o \
- dk4sto.o \
- dk4a85e.o \
- dk4a85d.o \
- dk4ahd.o \
- dk4rle.o \
- dk4rld.o \
- dk4bf.o \
- dk4bitsh.o \
- dk4isadm.o \
- dk4fpe.o \
- dk3trace.o
+LIBDK4COBJ= dk4dmt.$(OBJEXT) \
+ dk4mdch.$(OBJEXT) \
+ dk4binenc.$(OBJEXT) \
+ dk4stt.$(OBJEXT) \
+ dk4opt.$(OBJEXT) \
+ dk4opt01.$(OBJEXT) \
+ dk4opt02.$(OBJEXT) \
+ dk4opt03.$(OBJEXT) \
+ dk4opt04.$(OBJEXT) \
+ dk4opt05.$(OBJEXT) \
+ dk4opt06.$(OBJEXT) \
+ dk4opt07.$(OBJEXT) \
+ dk4pref.$(OBJEXT) \
+ dk4tspdk.$(OBJEXT) \
+ dk4tsp32.$(OBJEXT) \
+ dk4tsp16.$(OBJEXT) \
+ dk4tsp08.$(OBJEXT) \
+ dk4strmco.$(OBJEXT) \
+ dk4lzwe.$(OBJEXT) \
+ dk4mbstrm.$(OBJEXT) \
+ dk4membs.$(OBJEXT) \
+ dk4membf.$(OBJEXT) \
+ dk4membuf.$(OBJEXT) \
+ dk4strmu.$(OBJEXT) \
+ dk4strms.$(OBJEXT) \
+ dk4strmw.$(OBJEXT) \
+ dk4strmr.$(OBJEXT) \
+ dk4strmf.$(OBJEXT) \
+ dk4strmg.$(OBJEXT) \
+ dk4strmb.$(OBJEXT) \
+ dk4strmodk.$(OBJEXT) \
+ dk4strmo08.$(OBJEXT) \
+ dk4strmo16.$(OBJEXT) \
+ dk4strmo32.$(OBJEXT) \
+ dk4mao8dns.$(OBJEXT) \
+ dk4c8dbl.$(OBJEXT) \
+ dk4strm.$(OBJEXT) \
+ dk4fput.$(OBJEXT) \
+ dk4svbuf.$(OBJEXT) \
+ dk4fopd.$(OBJEXT) \
+ dk4fopwc.$(OBJEXT) \
+ dk4fopc8.$(OBJEXT) \
+ dk4exepd.$(OBJEXT) \
+ dk4exepw.$(OBJEXT) \
+ dk4exep8.$(OBJEXT) \
+ dk4mkdh.$(OBJEXT) \
+ dk4mkdh8.$(OBJEXT) \
+ dk4mkdhw.$(OBJEXT) \
+ dk4symlink.$(OBJEXT) \
+ dk4fileiu.$(OBJEXT) \
+ dk4fileigd.$(OBJEXT) \
+ dk4fileigw.$(OBJEXT) \
+ dk4fileig8.$(OBJEXT) \
+ dk4filei.$(OBJEXT) \
+ dk4fileid.$(OBJEXT) \
+ dk4fileiw.$(OBJEXT) \
+ dk4filei8.$(OBJEXT) \
+ dk4filed.$(OBJEXT) \
+ dk4filew.$(OBJEXT) \
+ dk4file8.$(OBJEXT) \
+ dk4fs.$(OBJEXT) \
+ dk4mm.$(OBJEXT) \
+ dk4stat.$(OBJEXT) \
+ dk4statd.$(OBJEXT) \
+ dk4statw.$(OBJEXT) \
+ dk4stat8.$(OBJEXT) \
+ dk4pathd.$(OBJEXT) \
+ dk4pathw.$(OBJEXT) \
+ dk4path8.$(OBJEXT) \
+ dk4serf.$(OBJEXT) \
+ dk4userf.$(OBJEXT) \
+ dk4enc.$(OBJEXT) \
+ dk4bom.$(OBJEXT) \
+ dk4rec27.$(OBJEXT) \
+ dk4rec26.$(OBJEXT) \
+ dk4rec25.$(OBJEXT) \
+ dk4rec24.$(OBJEXT) \
+ dk4rec23.$(OBJEXT) \
+ dk4rec22.$(OBJEXT) \
+ dk4rec21.$(OBJEXT) \
+ dk4rec20.$(OBJEXT) \
+ dk4rec19.$(OBJEXT) \
+ dk4rec18.$(OBJEXT) \
+ dk4rec17.$(OBJEXT) \
+ dk4rec16.$(OBJEXT) \
+ dk4rec15.$(OBJEXT) \
+ dk4rec14.$(OBJEXT) \
+ dk4rec13.$(OBJEXT) \
+ dk4rec12.$(OBJEXT) \
+ dk4rec11.$(OBJEXT) \
+ dk4rec10.$(OBJEXT) \
+ dk4rec09.$(OBJEXT) \
+ dk4rec08.$(OBJEXT) \
+ dk4rec07.$(OBJEXT) \
+ dk4rec06.$(OBJEXT) \
+ dk4rec05.$(OBJEXT) \
+ dk4rec04.$(OBJEXT) \
+ dk4rec03.$(OBJEXT) \
+ dk4rec02.$(OBJEXT) \
+ dk4rec01.$(OBJEXT) \
+ dk4ansi.$(OBJEXT) \
+ dk4utf8.$(OBJEXT) \
+ dk4utf16.$(OBJEXT) \
+ dk4c32.$(OBJEXT) \
+ dk4loc.$(OBJEXT) \
+ dk4wregd.$(OBJEXT) \
+ dk4wregw.$(OBJEXT) \
+ dk4wreg8.$(OBJEXT) \
+ dk4wregc.$(OBJEXT) \
+ dk4fd.$(OBJEXT) \
+ dk4hnamed.$(OBJEXT) \
+ dk4hnamew.$(OBJEXT) \
+ dk4hname8.$(OBJEXT) \
+ dk4user.$(OBJEXT) \
+ dk4ufi.$(OBJEXT) \
+ dk4ufiwc.$(OBJEXT) \
+ dk4ufi08.$(OBJEXT) \
+ dk4ufic.$(OBJEXT) \
+ dk4fne.$(OBJEXT) \
+ dk4fnewc.$(OBJEXT) \
+ dk4fne08.$(OBJEXT) \
+ dk4chdird.$(OBJEXT) \
+ dk4chdirw.$(OBJEXT) \
+ dk4chdir8.$(OBJEXT) \
+ dk4getcwdd.$(OBJEXT) \
+ dk4getcwdw.$(OBJEXT) \
+ dk4getcwd8.$(OBJEXT) \
+ dk4dir.$(OBJEXT) \
+ dk4dirwc.$(OBJEXT) \
+ dk4dir08.$(OBJEXT) \
+ dk4deldir.$(OBJEXT) \
+ dk4deldirwc.$(OBJEXT) \
+ dk4deldir08.$(OBJEXT) \
+ dk4delfile.$(OBJEXT) \
+ dk4delfilewc.$(OBJEXT) \
+ dk4delfile08.$(OBJEXT) \
+ dk4istty.$(OBJEXT) \
+ dk4ftimedk.$(OBJEXT) \
+ dk4ftimewc.$(OBJEXT) \
+ dk4ftime08.$(OBJEXT) \
+ dk4ftime.$(OBJEXT) \
+ dk4ctime.$(OBJEXT) \
+ dk4time.$(OBJEXT) \
+ dk4timedk.$(OBJEXT) \
+ dk4timewc.$(OBJEXT) \
+ dk4time08.$(OBJEXT) \
+ dk4inst.$(OBJEXT) \
+ dk4getpid.$(OBJEXT) \
+ dk4sto.$(OBJEXT) \
+ dk4a85e.$(OBJEXT) \
+ dk4a85d.$(OBJEXT) \
+ dk4ahd.$(OBJEXT) \
+ dk4rle.$(OBJEXT) \
+ dk4rld.$(OBJEXT) \
+ dk4bml.$(OBJEXT) \
+ dk4bm.$(OBJEXT) \
+ dk4bf.$(OBJEXT) \
+ dk4bitsh.$(OBJEXT) \
+ dk4isadm.$(OBJEXT) \
+ dk4itmin.$(OBJEXT) \
+ dk4iter.$(OBJEXT) \
+ dk4math.$(OBJEXT) \
+ dk4fpe.$(OBJEXT) \
+ dk3trace.$(OBJEXT)
# Objects for libdk4maiodd.so or libdk4maiodd.a library
LIBDK4MAIODDOBJ= \
- dk4maoddbl.o \
- dk4maiddbl.o \
- dk4maiddic.o \
- dk4maiddis.o \
- dk4maiddii.o \
- dk4maiddmi.o \
- dk4maiddli.o \
- dk4maiddil.o \
- dk4maidddi.o \
- dk4maidduc.o \
- dk4maiddus.o \
- dk4maiddui.o \
- dk4maiddmu.o \
- dk4maiddlu.o \
- dk4maiddul.o \
- dk4maiddsz.o \
- dk4maidddu.o \
- dk4maodd.o
+ dk4maoddbl.$(OBJEXT) \
+ dk4maiddbl.$(OBJEXT) \
+ dk4maiddic.$(OBJEXT) \
+ dk4maiddis.$(OBJEXT) \
+ dk4maiddii.$(OBJEXT) \
+ dk4maiddmi.$(OBJEXT) \
+ dk4maiddli.$(OBJEXT) \
+ dk4maiddil.$(OBJEXT) \
+ dk4maidddi.$(OBJEXT) \
+ dk4maidduc.$(OBJEXT) \
+ dk4maiddus.$(OBJEXT) \
+ dk4maiddui.$(OBJEXT) \
+ dk4maiddmu.$(OBJEXT) \
+ dk4maiddlu.$(OBJEXT) \
+ dk4maiddul.$(OBJEXT) \
+ dk4maiddsz.$(OBJEXT) \
+ dk4maidddu.$(OBJEXT) \
+ dk4maodd.$(OBJEXT)
# Objects for libdk4maioxd.so or libdk4maioxd.a library
LIBDK4MAIOXDOBJ= \
- dk4maoxdbl.o \
- dk4maixdbl.o \
- dk4maixdic.o \
- dk4maixdis.o \
- dk4maixdii.o \
- dk4maixdmi.o \
- dk4maixdli.o \
- dk4maixdil.o \
- dk4maixddi.o \
- dk4maixduc.o \
- dk4maixdus.o \
- dk4maixdui.o \
- dk4maixdmu.o \
- dk4maixdlu.o \
- dk4maixdul.o \
- dk4maixdsz.o \
- dk4maixddu.o \
- dk4maoxd.o
+ dk4maoxdbl.$(OBJEXT) \
+ dk4maixdbl.$(OBJEXT) \
+ dk4maixdic.$(OBJEXT) \
+ dk4maixdis.$(OBJEXT) \
+ dk4maixdii.$(OBJEXT) \
+ dk4maixdmi.$(OBJEXT) \
+ dk4maixdli.$(OBJEXT) \
+ dk4maixdil.$(OBJEXT) \
+ dk4maixddi.$(OBJEXT) \
+ dk4maixduc.$(OBJEXT) \
+ dk4maixdus.$(OBJEXT) \
+ dk4maixdui.$(OBJEXT) \
+ dk4maixdmu.$(OBJEXT) \
+ dk4maixdlu.$(OBJEXT) \
+ dk4maixdul.$(OBJEXT) \
+ dk4maixdsz.$(OBJEXT) \
+ dk4maixddu.$(OBJEXT) \
+ dk4maoxd.$(OBJEXT)
# Objects for libdk4maiodh.so or libdk4maiodh.a library
LIBDK4MAIODHOBJ= \
- dk4maidhic.o \
- dk4maidhis.o \
- dk4maidhii.o \
- dk4maidhmi.o \
- dk4maidhli.o \
- dk4maidhil.o \
- dk4maidhdi.o \
- dk4maidhuc.o \
- dk4maidhus.o \
- dk4maidhui.o \
- dk4maidhmu.o \
- dk4maidhlu.o \
- dk4maidhul.o \
- dk4maidhdu.o \
- dk4maodh.o \
- dk4maodo.o
+ dk4maidhic.$(OBJEXT) \
+ dk4maidhis.$(OBJEXT) \
+ dk4maidhii.$(OBJEXT) \
+ dk4maidhmi.$(OBJEXT) \
+ dk4maidhli.$(OBJEXT) \
+ dk4maidhil.$(OBJEXT) \
+ dk4maidhdi.$(OBJEXT) \
+ dk4maidhuc.$(OBJEXT) \
+ dk4maidhus.$(OBJEXT) \
+ dk4maidhui.$(OBJEXT) \
+ dk4maidhmu.$(OBJEXT) \
+ dk4maidhlu.$(OBJEXT) \
+ dk4maidhul.$(OBJEXT) \
+ dk4maidhdu.$(OBJEXT) \
+ dk4maodh.$(OBJEXT) \
+ dk4maodo.$(OBJEXT)
# Objects for libdk4maiowd.so or libdk4maiowd.a library
LIBDK4MAIOWDOBJ= \
- dk4maowdbl.o \
- dk4maiwdbl.o \
- dk4maiwdic.o \
- dk4maiwdis.o \
- dk4maiwdii.o \
- dk4maiwdmi.o \
- dk4maiwdli.o \
- dk4maiwdil.o \
- dk4maiwduc.o \
- dk4maiwdus.o \
- dk4maiwdui.o \
- dk4maiwdmu.o \
- dk4maiwdlu.o \
- dk4maiwdul.o \
- dk4maiwdsz.o \
- dk4maiwddi.o \
- dk4maiwddu.o \
- dk4maowd.o
+ dk4maowdbl.$(OBJEXT) \
+ dk4maiwdbl.$(OBJEXT) \
+ dk4maiwdic.$(OBJEXT) \
+ dk4maiwdis.$(OBJEXT) \
+ dk4maiwdii.$(OBJEXT) \
+ dk4maiwdmi.$(OBJEXT) \
+ dk4maiwdli.$(OBJEXT) \
+ dk4maiwdil.$(OBJEXT) \
+ dk4maiwduc.$(OBJEXT) \
+ dk4maiwdus.$(OBJEXT) \
+ dk4maiwdui.$(OBJEXT) \
+ dk4maiwdmu.$(OBJEXT) \
+ dk4maiwdlu.$(OBJEXT) \
+ dk4maiwdul.$(OBJEXT) \
+ dk4maiwdsz.$(OBJEXT) \
+ dk4maiwddi.$(OBJEXT) \
+ dk4maiwddu.$(OBJEXT) \
+ dk4maowd.$(OBJEXT)
# Objects for libdk4maiowh.so or libdk4maiowh.a library
LIBDK4MAIOWHOBJ= \
- dk4maiwhic.o \
- dk4maiwhis.o \
- dk4maiwhii.o \
- dk4maiwhmi.o \
- dk4maiwhli.o \
- dk4maiwhil.o \
- dk4maiwhuc.o \
- dk4maiwhus.o \
- dk4maiwhui.o \
- dk4maiwhmu.o \
- dk4maiwhlu.o \
- dk4maiwhul.o \
- dk4maiwhdi.o \
- dk4maiwhdu.o \
- dk4maowh.o
+ dk4maiwhic.$(OBJEXT) \
+ dk4maiwhis.$(OBJEXT) \
+ dk4maiwhii.$(OBJEXT) \
+ dk4maiwhmi.$(OBJEXT) \
+ dk4maiwhli.$(OBJEXT) \
+ dk4maiwhil.$(OBJEXT) \
+ dk4maiwhuc.$(OBJEXT) \
+ dk4maiwhus.$(OBJEXT) \
+ dk4maiwhui.$(OBJEXT) \
+ dk4maiwhmu.$(OBJEXT) \
+ dk4maiwhlu.$(OBJEXT) \
+ dk4maiwhul.$(OBJEXT) \
+ dk4maiwhdi.$(OBJEXT) \
+ dk4maiwhdu.$(OBJEXT) \
+ dk4maowh.$(OBJEXT)
# Objects for libdk4maio8d.so or libdk4maio8d.a library
LIBDK4MAIO8DOBJ= \
- dk4mao8dbl.o \
- dk4mai8dbl.o \
- dk4mai8dic.o \
- dk4mai8dis.o \
- dk4mai8dii.o \
- dk4mai8dmi.o \
- dk4mai8dli.o \
- dk4mai8dil.o \
- dk4mai8ddi.o \
- dk4mai8duc.o \
- dk4mai8dus.o \
- dk4mai8dui.o \
- dk4mai8dmu.o \
- dk4mai8dlu.o \
- dk4mai8dul.o \
- dk4mai8dsz.o \
- dk4mai8ddu.o \
- dk4mao8d.o
+ dk4mao8dbl.$(OBJEXT) \
+ dk4mai8dbl.$(OBJEXT) \
+ dk4mai8dic.$(OBJEXT) \
+ dk4mai8di8.$(OBJEXT) \
+ dk4mai8dis.$(OBJEXT) \
+ dk4mai8di16.$(OBJEXT) \
+ dk4mai8dii.$(OBJEXT) \
+ dk4mai8dmi.$(OBJEXT) \
+ dk4mai8dli.$(OBJEXT) \
+ dk4mai8dil.$(OBJEXT) \
+ dk4mai8di32.$(OBJEXT) \
+ dk4mai8ddi.$(OBJEXT) \
+ dk4mai8duc.$(OBJEXT) \
+ dk4mai8du8.$(OBJEXT) \
+ dk4mai8dus.$(OBJEXT) \
+ dk4mai8du16.$(OBJEXT) \
+ dk4mai8dui.$(OBJEXT) \
+ dk4mai8dmu.$(OBJEXT) \
+ dk4mai8dlu.$(OBJEXT) \
+ dk4mai8du32.$(OBJEXT) \
+ dk4mai8dul.$(OBJEXT) \
+ dk4mai8dsz.$(OBJEXT) \
+ dk4mai8ddu.$(OBJEXT) \
+ dk4mao8d.$(OBJEXT)
# Objects for libdk4maio8h.so or libdk4maio8h.a library
LIBDK4MAIO8HOBJ= \
- dk4mai8hic.o \
- dk4mai8his.o \
- dk4mai8hii.o \
- dk4mai8hmi.o \
- dk4mai8hli.o \
- dk4mai8hil.o \
- dk4mai8hdi.o \
- dk4mai8huc.o \
- dk4mai8hus.o \
- dk4mai8hui.o \
- dk4mai8hmu.o \
- dk4mai8hlu.o \
- dk4mai8hul.o \
- dk4mai8hdu.o \
- dk4mao8h.o
+ dk4mai8hic.$(OBJEXT) \
+ dk4mai8his.$(OBJEXT) \
+ dk4mai8hii.$(OBJEXT) \
+ dk4mai8hmi.$(OBJEXT) \
+ dk4mai8hli.$(OBJEXT) \
+ dk4mai8hil.$(OBJEXT) \
+ dk4mai8hdi.$(OBJEXT) \
+ dk4mai8huc.$(OBJEXT) \
+ dk4mai8hus.$(OBJEXT) \
+ dk4mai8hui.$(OBJEXT) \
+ dk4mai8hmu.$(OBJEXT) \
+ dk4mai8hlu.$(OBJEXT) \
+ dk4mai8hul.$(OBJEXT) \
+ dk4mai8hdu.$(OBJEXT) \
+ dk4mao8h.$(OBJEXT)
# Objects for libdk4ma.so or libdk4ma.a library
LIBDK4MAOBJ= \
- dk4numl.o \
- dk4macd.o \
- dk4macm.o \
- dk4macll.o \
- dk4macl.o \
- dk4maci.o \
- dk4macs.o \
- dk4macc.o \
- dk4maasz.o \
- dk4maadi.o \
- dk4maadu.o \
- dk4maami.o \
- dk4maamu.o \
- dk4maall.o \
- dk4maalu.o \
- dk4maal.o \
- dk4maaul.o \
- dk4maai.o \
- dk4maaui.o \
- dk4maas.o \
- dk4maaus.o \
- dk4maac.o \
- dk4maauc.o \
- dk4maau16.o \
- dk4maai16.o \
- dk4maau32.o \
- dk4maai32.o \
- dk4maci16.o \
- dk4maci32.o
+ dk4numl.$(OBJEXT) \
+ dk4macd.$(OBJEXT) \
+ dk4macm.$(OBJEXT) \
+ dk4macll.$(OBJEXT) \
+ dk4macl.$(OBJEXT) \
+ dk4maci.$(OBJEXT) \
+ dk4macs.$(OBJEXT) \
+ dk4macc.$(OBJEXT) \
+ dk4maasz.$(OBJEXT) \
+ dk4maadi.$(OBJEXT) \
+ dk4maadu.$(OBJEXT) \
+ dk4maami.$(OBJEXT) \
+ dk4maamu.$(OBJEXT) \
+ dk4maall.$(OBJEXT) \
+ dk4maalu.$(OBJEXT) \
+ dk4maal.$(OBJEXT) \
+ dk4maaul.$(OBJEXT) \
+ dk4maai.$(OBJEXT) \
+ dk4maaui.$(OBJEXT) \
+ dk4maas.$(OBJEXT) \
+ dk4maaus.$(OBJEXT) \
+ dk4maac.$(OBJEXT) \
+ dk4maauc.$(OBJEXT) \
+ dk4maau16.$(OBJEXT) \
+ dk4maai16.$(OBJEXT) \
+ dk4maau32.$(OBJEXT) \
+ dk4maai32.$(OBJEXT) \
+ dk4maci16.$(OBJEXT) \
+ dk4maci32.$(OBJEXT)
# Objects for libdk4dbia.so or libdk4dbia.a library
LIBDK4DBIAOBJ= \
- dk4dbia.o
+ dk4dbia.$(OBJEXT)
# Objects for libdk4dbi.so or libdk4dbi.a library
LIBDK4DBIOBJ= \
- dk4dbit.o \
- dk4dbitw.o \
- dk4dbit8.o \
- dk4dbi.o
+ dk4dbit.$(OBJEXT) \
+ dk4dbitw.$(OBJEXT) \
+ dk4dbit8.$(OBJEXT) \
+ dk4dbi.$(OBJEXT)
# Objects for libdk4base.so or libdk4base.a library
LIBDK4BASEOBJ= \
- dk4strd.o \
- dk4strw.o \
- dk4str8.o \
- dk4memcpl.o \
- dk4memrs.o \
- dk4mem.o \
- dk4error.o
+ dk4strd.$(OBJEXT) \
+ dk4strw.$(OBJEXT) \
+ dk4str8.$(OBJEXT) \
+ dk4memcpl.$(OBJEXT) \
+ dk4memrs.$(OBJEXT) \
+ dk4mem.$(OBJEXT) \
+ dk4error.$(OBJEXT)
# Objects for libdk4.a library
OBJLIBDK4= $(LIBDK4WXOBJ) \
+ $(LIBDK4LATAOBJ) \
$(LIBDK4LATOBJ) \
$(LIBDK4DBIAOBJ) \
$(LIBDK4SOCKAOBJ) \
- $(LIBDK4PPPTAOBJ) \
+ $(LIBDK4GRAAOBJ) \
+ $(LIBDK4BIFAOBJ) \
$(LIBDK4APPOBJ) \
$(LIBDK4MDRNDOBJ) \
$(LIBDK4SOCKOBJ) \
$(LIBDK4PPPTOBJ) \
+ $(LIBDK4GRAOBJ) \
+ $(LIBDK4BIFOBJ) \
$(LIBDK4COBJ) \
$(LIBDK4MAIODDOBJ) \
$(LIBDK4MAIOWDOBJ) \
@@ -1359,903 +1287,1627 @@ OBJLIBDK4= $(LIBDK4WXOBJ) \
$(LIBDK4DBIOBJ) \
$(LIBDK4BASEOBJ)
+# DK3 libraries
+# -------------
+
+# Objects for libdk3c.so or libdk3c.a library
+LIBDK3COBJ= \
+ dk3ufi.$(OBJEXT) \
+ dk3opt.$(OBJEXT) \
+ dk3bf.$(OBJEXT) \
+ dk3se.$(OBJEXT) \
+ dk3app.$(OBJEXT) \
+ dk3strm.$(OBJEXT) \
+ dk3print.$(OBJEXT) \
+ dk3prcfg.$(OBJEXT) \
+ dk3strkv.$(OBJEXT) \
+ dk3sto.$(OBJEXT) \
+ dk3dir.$(OBJEXT) \
+ dk3enc.$(OBJEXT) \
+ dk3str.$(OBJEXT) \
+ dk3cores.$(OBJEXT) \
+ dk3sf.$(OBJEXT) \
+ dk3echo.$(OBJEXT) \
+ dk3signl.$(OBJEXT) \
+ dk3ct.$(OBJEXT) \
+ dk3mas.$(OBJEXT) \
+ dk3maus.$(OBJEXT) \
+ dk3mai.$(OBJEXT) \
+ dk3maui.$(OBJEXT) \
+ dk3mal.$(OBJEXT) \
+ dk3maul.$(OBJEXT) \
+ dk3mad.$(OBJEXT) \
+ dk3madsc.$(OBJEXT) \
+ dk3madic.$(OBJEXT) \
+ dk3madlc.$(OBJEXT) \
+ dk3maidd.$(OBJEXT) \
+ dk3maihd.$(OBJEXT) \
+ dk3maodd.$(OBJEXT) \
+ dk3maohd.$(OBJEXT) \
+ dk3maid8.$(OBJEXT) \
+ dk3maih8.$(OBJEXT) \
+ dk3maod8.$(OBJEXT) \
+ dk3maoh8.$(OBJEXT) \
+ dk3masts.$(OBJEXT) \
+ dk3madfo.$(OBJEXT) \
+ dk3madso.$(OBJEXT) \
+ dk3madsi.$(OBJEXT) \
+ dk3inst.$(OBJEXT) \
+ dk3srch.$(OBJEXT) \
+ dk3bits.$(OBJEXT) \
+ dk3mem.$(OBJEXT) \
+ dk3bb.$(OBJEXT) \
+ dk3bezcu.$(OBJEXT) \
+ dk3xsp.$(OBJEXT) \
+ dk3kv.$(OBJEXT) \
+ dk3trace.$(OBJEXT)
+
+# Objects for libdk3of.so or libdk3of.a library
+LIBDK3OFOBJ= \
+ dk3of.$(OBJEXT) \
+ dk3strmb.$(OBJEXT) \
+ dk3strmg.$(OBJEXT)
+
+# Objects for libdk3csrnd.so or libdk3csrnd.a library
+LIBDK3CSRNDOBJ= \
+ dk3chks.$(OBJEXT) \
+ dk3appr.$(OBJEXT)
+
+# Objects for libdk3bif.so or libdk3bif.a library
+LIBDK3BIFOBJ= \
+ dk3bifa.$(OBJEXT) \
+ dk3bif.$(OBJEXT) \
+ dk3pixre.$(OBJEXT)
+
+# Objects for libdk3dbi.so or libdk3dbi.a library
+LIBDK3DBIOBJ= \
+ dk3dbi.$(OBJEXT)
+
+# Objects for libdk3bmeps.so or libdk3bmeps.a library
+LIBDK3BMEPSOBJ= \
+ dk3bm.$(OBJEXT) \
+ dk3bmeo.$(OBJEXT) \
+ dk3bmep.$(OBJEXT) \
+ dk3bmeps.$(OBJEXT) \
+ dk3bmj.$(OBJEXT) \
+ dk3pdf.$(OBJEXT) \
+ dk3paper.$(OBJEXT)
+
+# Objects for libdk3fig.so or libdk3fig.a library
+LIBDK3FIGOBJ= \
+ dk3figbb.$(OBJEXT) \
+ dk3figpr.$(OBJEXT) \
+ dk3figah.$(OBJEXT) \
+ dk3figrd.$(OBJEXT) \
+ dk3figto.$(OBJEXT) \
+ dk3fig.$(OBJEXT) \
+ dk3font.$(OBJEXT) \
+ dk3ct.$(OBJEXT)
+
+# Objects for libdk3wx.so or libdk3wx.a library
+LIBDK3WXOBJ= \
+ DkWxProgressDialog.$(OBJEXT) \
+ DkWxCommunicator.$(OBJEXT) \
+ DkWxFrame.$(OBJEXT) \
+ DkWxDialog.$(OBJEXT) \
+ DkWxHelpController.$(OBJEXT) \
+ DkWxAppHelper.$(OBJEXT) \
+ DkWxColorView.$(OBJEXT) \
+ DkWxBufferedControl.$(OBJEXT) \
+ DkWxProcessingIdleController.$(OBJEXT) \
+ DkWxProcessingController.$(OBJEXT) \
+ dk3wxs.$(OBJEXT)
+
+# Objects for libdk3.a library
+LIBDK3ALLOBJ= $(LIBDK3WXOBJ) \
+ $(LIBDK3FIGOBJ) \
+ $(LIBDK3BMEPSOBJ) \
+ $(LIBDK3BIFOBJ) \
+ $(LIBDK3DBIOBJ) \
+ $(LIBDK3OFOBJ) \
+ $(LIBDK3COBJ)
+
+
+# Targets
+# =======
+
+# Main targets for building and installing
+# ----------------------------------------
+
+build: # Build the software
+build: build-arch build-indep
+
+all: build
+
+world: build
+
+help: # Show targets in Makefile
+ @echo 'Some systems (i.e. Windows) append a special filename extension'
+ @echo '(i.e. .exe) to program file names.'
+ @echo 'On such systems use "make dk-ls.exe" instead of "make dk-ls"'
+ @echo 'to build a program.'
+ @echo 'Here is a list of the targets in this Makefile:'
+ -@egrep '^[^:;=. ]*::?[ ]*' Makefile|grep '#'|grep -v '^#'
+
+build-arch: $(PRG_GUI) $(LIB_SHARED_GUI) $(PRG_DAEMON_NET_POSIX) $(PRG_FILTER_SNMP_POSIX)
+
+build-indep:
+
+install: # Install the software
+install: install-arch install-indep
+
+# Install architecture-dependant files
+install-arch: install-programs install-libs
+
+# Install architecture-independant files
+install-indep: i-ind-gui i-man-gui i-svc-sysd
+
+# Install architecture-independant files for rescue systems
+i-ind-res: install-dirs
+ @echo '>>> Install resource files (rescue)'
+ $(INSTALL_DATA) $(RES_RES_EN) "$(DESTDIR)$(datarootdir)/dktools/en"
+ $(INSTALL_DATA) $(RES_RES_DE) "$(DESTDIR)$(datarootdir)/dktools/de"
+ @echo '<<< Install resource files (rescue)'
+
+# Install architecture independant files for CLI systems
+i-ind-cli: i-ind-res
+ @echo '>>> Install architecture independent files (cli)'
+ $(INSTALL_DATA) dktools.pc "$(DESTDIR)$(libdir)/pkgconfig/dktools.pc"
+ $(INSTALL_DATA) etc-dk3app/dk3paper.conf "$(DESTDIR)$(sysconfdir)/dk3app"
+ $(INSTALL_DATA) etc-dk4app/dk4gra.conf "$(DESTDIR)$(sysconfdir)/dk4app"
+ $(INSTALL_SCRIPT) itaclean.sh "$(DESTDIR)$(bindir)/itaclean"
+ $(INSTALL_DATA) rshdown.conf.sample "$(DESTDIR)$(sysconfdir)/rshdown"
+ $(INSTALL_DATA) rshdown.conf "$(DESTDIR)$(sysconfdir)/rshdown"
+ $(INSTALL_DATA) printqd.conf.sample "$(DESTDIR)$(sysconfdir)/printqd"
+ $(INSTALL_DATA) printqd.conf "$(DESTDIR)$(sysconfdir)/printqd"
+ find dktools -type d -exec chmod 755 {} \;
+ find dktools -type f -exec chmod 644 {} \;
+ find dk4app -type d -exec chmod 755 {} \;
+ find dk4app -type f -exec chmod 644 {} \;
+ (cd dktools ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dktools" ; umask 0 ; tar xf -)
+ (cd dk4app ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dk4app" ; umask 0 ; tar xf -)
+ chmod 755 "$(DESTDIR)$(datarootdir)/dktools/htmlbook/htmlbook.sh"
+ @echo '<<< Install architecture independent files (cli)'
+
+# Install architecture-independant files for GUI systems
+i-ind-gui: i-ind-cli
+ @echo '>>> Install architecture independent files (gui)'
+ $(INSTALL_DATA) gui-img/icons/dkicon.ico "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL_DATA) gui-img/icons/wxdkdraw.ico "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL_DATA) gui-img/icons/dkclock.ico "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL_DATA) gui-img/icons/dkwxwiz.ico "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL_DATA) wxdkdraw.desktop "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL_DATA) wxbmpp.desktop "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL_DATA) wxdkclock.desktop "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL_DATA) wximgsz.desktop "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL_DATA) wxdkfcs.desktop "$(DESTDIR)$(datarootdir)/applications"
+ @echo '<<< Install architecture independent files (gui)'
+
+# Install man pages for rescue systems
+i-man-res: install-dirs
+ @echo '>>> Install man pages (rescue)'
+ $(INSTALL_DATA) $(MAN_RES) "$(DESTDIR)$(mandir)/man1"
+ @echo '<<< Install man pages (rescue)'
+
+# Install man pages for CLI systems
+i-man-cli: i-man-res
+ @echo '>>> Install man pages (cli)'
+ $(INSTALL_DATA) man/man1/*.1 "$(DESTDIR)$(mandir)/man1"
+ $(INSTALL_DATA) man/man5/*.5 "$(DESTDIR)$(mandir)/man5"
+ @echo '<<< Install man pages (cli)'
+
+# Install man pages for GUI systems
+i-man-gui: i-man-cli
+
+i-svc-sysd: install-dirs
+ @echo '>>> Install systemd service units (cli)'
+ -[ -d "$(DESTDIR)$(libdir)/systemd" ] || $(INSTALL) -d "$(DESTDIR)$(libdir)/systemd"
+ -[ -d "$(DESTDIR)$(libdir)/systemd/system" ] || $(INSTALL) -d "$(DESTDIR)$(libdir)/systemd/system"
+ -[ -d "$(DESTDIR)$(systemddir)" ] || ( mkdir -p "$(DESTDIR)$(systemddir)" ; chmod 755 "$(DESTDIR)$(systemddir)" )
+ $(INSTALL_DATA) printqd.service "$(DESTDIR)$(systemddir)"
+ $(INSTALL_DATA) rshdown.service "$(DESTDIR)$(systemddir)"
+ @echo '<<< Install systemd service units (cli)'
+
+i-svc-init: install-dirs
+ @echo '>>> Install init service scripts (cli)'
+
+ -[ -d "$(DESTDIR)$(sysconfdir)" ] || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)"
+ -[ -d "$(DESTDIR)$(sysconfdir)/init.d" ] || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/init.d"
+ cp -f initd-printqd "$(DESTDIR)$(sysconfdir)/init.d/printqd"
+ chmod 644 "$(DESTDIR)$(sysconfdir)/init.d/printqd"
+ cp -f initd-rshdown "$(DESTDIR)$(sysconfdir)/init.d/rshdown"
+ chmod 644 "$(DESTDIR)$(sysconfdir)/init.d/rshdown"
+ @echo '<<< Install init service scripts (cli)'
+
+# Install executables
+install-programs: i-prg-gui i-prg-dae i-prg-fil
+
+# Install executables for GUI systems
+i-prg-gui: install-dirs build-arch
+ @echo '>>> Install binaries (gui)'
+ $(INSTALL) $(PRG_GUI) "$(DESTDIR)$(bindir)"
+ @echo '<<< Install binaries (gui)'
+
+# Install executable daemons for POSIX systems
+i-prg-dae: install-dirs build-arch
+ @echo '>>> Install daemons for POSIX systems (cli)'
+ $(INSTALL) $(PRG_DAEMON_NET_POSIX) "$(DESTDIR)$(sbindir)"
+ $(INSTALL) rshdown-init "$(DESTDIR)$(sbindir)"
+ @echo '<<< Install daemons for POSIX systems (cli)'
+
+# Install executables for CLI systems
+i-prg-cli: install-dirs build-arch
+ @echo '>>> Install binaries (cli)'
+ $(INSTALL) $(PRG_CLI) "$(DESTDIR)$(bindir)"
+ @echo '<<< Install binaries (cli)'
+
+# Install executables run by other executables, not directly
+i-prg-fil: install-dirs build-arch
+ @echo '>>> Install libexec binaries (cli)'
+ $(INSTALL) $(PRG_FILTER_SNMP_POSIX) "$(DESTDIR)$(libexecdir)/dktools"
+ @echo '<<< Install libexec binaries (cli)'
+
+# Install executables for rescue systems
+i-prg-res: install-dirs build-arch
+ @echo '>>> Install binaries (rescue)'
+ $(INSTALL) $(PRG_RES) "$(DESTDIR)$(bindir)"
+ @echo '<<< Install binaries (rescue)'
+
+# Install libraries
+install-libs: i-lib-dyn-gui i-hdr-gui
+
+# Install shared libraries for rescue system
+i-lib-dyn-res: install-dirs build-arch
+ @echo '>>> Install shared libraries (rescue)'
+ for i in $(LIB_SHARED_RES) ; do $(INSTALL) -c -m 644 $$i.$(SOVERS) "$(DESTDIR)$(libdir)" ; done
+ for i in $(LIB_SHARED_RES) ; do [ ! -e "$(DESTDIR)$(libdir)/$$i" ] || rm -f "$(DESTDIR)$(libdir)/$$i" ; done
+ for i in $(LIB_SHARED_RES) ; do $(LN_S) $$i.$(SOVERS) "$(DESTDIR)$(libdir)/$$i"; done
+ @echo '<<< Install shared libraries (rescue)'
+
+# Install shared libraries for CLI system
+i-lib-dyn-cli: install-dirs build-arch
+ @echo '>>> Install shared libraries (cli)'
+ for i in $(LIB_SHARED_CLI) ; do $(INSTALL) -c -m 644 $$i.$(SOVERS) "$(DESTDIR)$(libdir)" ; done
+ for i in $(LIB_SHARED_CLI) ; do [ ! -e "$(DESTDIR)$(libdir)/$$i" ] || rm -f "$(DESTDIR)$(libdir)/$$i" ; done
+ for i in $(LIB_SHARED_CLI) ; do $(LN_S) $$i.$(SOVERS) "$(DESTDIR)$(libdir)/$$i"; done
+ @echo '<<< Install shared libraries (cli)'
+
+# Install shared libraries for GUI system
+i-lib-dyn-gui: install-dirs build-arch
+ @echo '>>> Install shared libraries (gui)'
+ for i in $(LIB_SHARED_GUI) ; do $(INSTALL) -c -m 644 $$i.$(SOVERS) "$(DESTDIR)$(libdir)" ; done
+ for i in $(LIB_SHARED_GUI) ; do [ ! -e "$(DESTDIR)$(libdir)/$$i" ] || rm -f "$(DESTDIR)$(libdir)/$$i" ; done
+ for i in $(LIB_SHARED_GUI) ; do $(LN_S) $$i.$(SOVERS) "$(DESTDIR)$(libdir)/$$i"; done
+ @echo '<<< Install shared libraries (gui)'
+
+# Install static libraries for CLI system
+i-lib-stt-cli: install-dirs build-arch
+ @echo '>>> Install static libraries (cli)'
+ $(INSTALL_DATA) $(LIB_STATIC_CLI) "$(DESTDIR)$(libdir)"
+ @echo '<<< Install static libraries (cli)'
+
+# Install static libraries for GUI system
+i-lib-stt-gui: install-dirs build-arch
+ @echo '>>> Install static libraries (gui)'
+ $(INSTALL_DATA) $(LIB_STATIC_GUI) "$(DESTDIR)$(libdir)"
+ @echo '<<< Install static libraries (gui)'
+
+# Install header files for CLI suite
+i-hdr-cli: install-dirs build-arch
+ @echo '>>> Install header files (CLI)'
+ $(INSTALL_DATA) dk4*.h dk3trace.h "$(DESTDIR)$(includedir)/dktools-4"
+ @echo '<<< Install header files (CLI)'
+
+# Install header files for GUI suite
+i-hdr-gui: install-dirs build-arch i-hdr-cli
+ @echo '>>> Install header files (GUI)'
+ $(INSTALL_DATA) Dk4*.h "$(DESTDIR)$(includedir)/dktools-4"
+ @echo '<<< Install header files (GUI)'
+
+# Create directory structure for installation
+install-dirs:
+ @echo '>>> Create installation directories'
+ $(INSTALL) -d "$(DESTDIR)$(prefix)"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)"
+ $(INSTALL) -d "$(DESTDIR)$(libdir)"
+ $(INSTALL) -d "$(DESTDIR)$(libdir)/pkgconfig"
+ $(INSTALL) -d "$(DESTDIR)$(libexecdir)"
+ $(INSTALL) -d "$(DESTDIR)$(libexecdir)/dktools"
+ $(INSTALL) -d "$(DESTDIR)$(includedir)"
+ $(INSTALL) -d "$(DESTDIR)$(includedir)/dktools-4"
+ $(INSTALL) -d "$(DESTDIR)$(bindir)"
+ $(INSTALL) -d "$(DESTDIR)$(sbindir)"
+ $(INSTALL) -d "$(DESTDIR)$(mandir)"
+ $(INSTALL) -d "$(DESTDIR)$(mandir)/man1"
+ $(INSTALL) -d "$(DESTDIR)$(mandir)/man5"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dk4app"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools/en"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools/de"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dk4app/de"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/dk3app"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/dk4app"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/rshdown"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/printqd"
+ $(INSTALL) -d "$(DESTDIR)$(localstatedir)/log"
+ $(INSTALL) -d "$(DESTDIR)$(localstatedir)/run"
+ $(INSTALL) -d "$(DESTDIR)$(localstatedir)/lib"
+ @echo '<<< Create installation directories'
+
+get-orig-source: # Get original software source
+ @echo '>>> Retrieve source archive'
+ wget -O dktools-$(VERSNO) $(SFBASE)/dktools-$(VERSNO).tar.gz/download
+ @echo '<<< Retrieve source archive'
+
+libs-shared-gui: # Shared libraries for GUI suite
+libs-shared-gui: $(LIB_SHARED_GUI)
+
+libs-shared-cli: # Shared libraries for CLI suite
+libs-shared-cli: $(LIB_SHARED_CLI)
+
+libs-shared-rescue: # Shared libraries for rescue suite
+libs-shared-rescue: $(LIB_SHARED_RES)
+
+libs-static-cli: # Static libraries for CLI suite
+libs-static-cli: $(LIB_STATIC_CLI)
+
+libs-static-gui: # Static libraries for GUI suite
+libs-static-gui: $(LIB_STATIC_GUI)
+
+clean: # Clean up (remove build results)
+ @echo '>>> Clean up (clean)'
+ -rm -f errors *.deb *.o *.obj *.exe *.a *.so *.so.$(SOVERS)
+ -rm -f $(PRG_GUI) $(PRG_CLI) $(PRG_RES)
+ -rm -f doxygen.out $(PRG_FILTER_SNMP_POSIX) $(PRG_DAEMON_NET_POSIX)
+ -rm -f dk4config$(EXEEXT)
+ -rm -f dk4wxcs$(EXEEXT)
+ -rm -f dk3config$(EXEEXT)
+ -rm -f wxcs$(EXEEXT)
+ -rm -f doc/src/*.aux doc/src/*.log doc/src/math-img.pdf
+ -rm -f doc/src/index.pdf doc/src/index.svg
+ -rm -f doc/src/next.pdf doc/src/next.svg
+ -rm -f doc/src/prev.pdf doc/src/prev.svg
+ -rm -f doc/src/toc.pdf doc/src/toc.svg
+ -rm -f testpppt.aux testpppt-i.pdf testpppt.log testpppt.pdf
+ -rm -f testpppt.tex testpppt.eps testpppt.pgf
+ -rm -f test-gra.aux test-gra.log test-gra.pdf test-gra.tex
+ @echo '<<< Clean up (clean)'
+
+distclean: # Clean up (remove build and configure script results)
+distclean: clean
+ @echo '>>> Clean up (distclean)'
+ -[ ! -f confdefs.h ] || rm -fr confdefs.h
+ -[ ! -f config.h ] || rm -fr config.h
+ -[ ! -f config.log ] || rm -fr config.log
+ -[ ! -f config.status ] || rm -fr config.status
+ -[ ! -f conftest ] || rm -fr conftest
+ -[ ! -f conftest.c ] || rm -fr conftest.c
+ -[ ! -f conftest.er1 ] || rm -fr conftest.er1
+ -[ ! -f config.h ] || rm -f config.h
+ -[ ! -f scripts/wr-dk3inst.sh ] || rm -f scripts/wr-dk3inst.sh
+ -[ ! -f scripts/wr-dk4inst.sh ] || rm -f scripts/wr-dk4inst.sh
+ -[ ! -f scripts/create-desktop-files.sh ] || rm -f scripts/create-desktop-files.sh
+ -[ ! -f initd-printqd ] || rm -f initd-printqd
+ -[ ! -f initd-rshdown ] || rm -f initd-rshdown
+ -[ ! -f dktools.pc ] || rm -f dktools.pc
+ @echo '<<< Clean up (distclean)'
+
+maketest: # Test: Check availability of make programs.
+maketest:
+ @echo OK
+
+# Clean up before building distribution archives
+cleanest: distclean
+ @echo '>>> Clean up (cleanest)'
+ -[ ! -d autom4te.cache ] || rm -fr autom4te.cache
+ scripts/clean-resources.sh
+ find dktools/help -type f -exec rm -f {} \;
+ find help-html -type f -exec rm -f {} \;
+ find doc/html -type f -exec rm -f {} \;
+ -[ ! -d doc/doxygen ] || find doc/doxygen -type f -exec rm -f {} \;
+ -[ ! -f dk4info1.c ] || rm -f dk4info1.c
+ -find help-src -name '*.html' -exec rm -f {} \;
+ -find help-src -name '*.hhc' -exec rm -f {} \;
+ -find help-src -name '*.hhk' -exec rm -f {} \;
+ -find help-src -name '*.hhp' -exec rm -f {} \;
+ -find help-src -name '*.aux' -exec rm -f {} \;
+ -find doc/src -name '*.html' -exec rm -f {} \;
+ -find doc/src -name '*.hhc' -exec rm -f {} \;
+ -find doc/src -name '*.hhk' -exec rm -f {} \;
+ -find doc/src -name '*.hhp' -exec rm -f {} \;
+ -find doc/src -name '*.aux' -exec rm -f {} \;
+ -find dktools -name '*.chm' -exec rm {} \;
+ -find dktools -name '*.htb' -exec rm {} \;
+ -find . -name '*.ico' -exec rm -f {} \;
+ -find . -name '*.xpm' -exec rm -f {} \;
+ -[ ! -x ./scripts/clean-src.sh ] || ./scripts/clean-src.sh
+ -[ ! -x ./scripts/clean-for-fig.sh ] || ./scripts/clean-for-fig.sh
+ -[ ! -x ./scripts/clean-for-tex.sh ] || ./scripts/clean-for-tex.sh
+ -rm -fr *.rc
+ -rm -fr *-gui.cpp
+ @echo '<<< Clean up (cleanest)'
+
+# Clean up before building distribution archives, check files presence
+check-cleanest: cleanest
+ @echo '>>> Check file presence (check-cleanest)'
+ perl scripts/check-filelist.pl
+ @echo '<<< Check file presence (check-cleanest)'
+
+# Clean up and update files before building distribution archives
+# Formerly we had a dependency to check-cleanest
+# Removed: scripts/touch-files.sh
+
+distrenew: cleanest
+ @echo '>>> Clean up before building distribution (distrenew)'
+ dkct -l
+ scripts/update-doxyfile.sh
+ doxygen
+ scripts/build-rc.pl
+ scripts/build-resources.sh
+ scripts/build-help.sh
+ scripts/build-doc.sh
+ scripts/build-man.sh
+ scripts/transform-config.pl
+ autoconf
+ scripts/build-spec-iss.sh
+ scripts/build-debian-changelog.pl > debian/changelog
+ sed -e 's/^dktools/dktools-doc/g' < debian/changelog > doc/debian/changelog
+ sed -e 's/^dktools/dktools-devdoc/g' < debian/changelog > devdoc/debian/changelog
+ @echo '<<< Clean up before building distribution (distrenew)'
+
+# Create distribution archives
+dist: distrenew
+ @echo '>>> Build distribution (dist)'
+ scripts/build-version.sh
+ scripts/build-distribution.sh
+ @echo '<<< Build distribution (dist)'
+
+
+# Individual targets
+# ==================
+
+# Programs run by configure script, build process silenced
+# --------------------------------------------------------
+
+dk3config: # Program: Show configuration for dk3... modules
+dk3config$(EXEEXT): dk3config.c config.h
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @$(CC) $(LDFLC_CLI_C8) $(CFL_CLI_C8) -o $@ dk3config.c -lm
+ @chmod 755 $@
+
+dk4config: # Program: Show configuration for dk4... modules
+dk4config$(EXEEXT): dk4config.c config.h
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @$(CC) $(LDFLC_CLI_C8) $(CFL_CLI_C8) -o $@ dk4config.c
+ @chmod 755 $@
+
+dk4wxcs: # Program: Show configuration wxChar size
+dk4wxcs$(EXEEXT): dk4wxcs.cpp config.h
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @$(CXX) $(LDFLCXX_CLI_C8) $(WXCXXFLAGS) $(CXXFL_CLI_C8) -o $@ dk4wxcs.cpp
+ @chmod 755 $@
+
+confprogs: # Programs to create configuration headers
+confprogs: dk3config$(EXEEXT) dk4config$(EXEEXT) dk4wxcs$(EXEEXT)
+
+
+# DK4 libraries
+# -------------
+
libdk4.a: # Static library containig all modules
libdk4.a: $(OBJLIBDK4)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(OBJLIBDK4)
$(RANLIB) $@
chmod 644 $@
-LIBDK4WXLIBF=libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4app.so
-LIBDK4WXLIBS=-ldk4app -ldk4c -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS)
+
+LIBDK4WXLIBF=
+LIBDK4WXLIBS=
libdk4wx.so: # Support for wxWidgets shared
libdk4wx.so: $(LIBDK4WXLIBF) $(LIBDK4WXOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4WXOBJ) $(LIBDK4WXLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C++)' $@
+ $(CXX) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4WXOBJ) $(LIBDK4WXLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4wx.a: # Support for wxWidgets static
libdk4wx.a: libdk4c.a $(LIBDK4WXOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4WXOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4SOCKALIBF=libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodh.so libdk4maiodd.so libdk4sock.so libdk4app.so
-LIBDK4SOCKALIBS=-ldk4app -ldk4sock -ldk4maiodd -ldk4maiodh -ldk4maio8d -ldk4maio8h -ldk4base $(SOCKLIB) $(NSLLIB)
+
+LIBDK4SOCKALIBF=
+LIBDK4SOCKALIBS=
libdk4socka.so: # Socket library with application support
libdk4socka.so: $(LIBDK4SOCKALIBF) $(LIBDK4SOCKAOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4SOCKAOBJ) $(LIBDK4SOCKALIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4SOCKAOBJ) $(LIBDK4SOCKALIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4socka.a: # Socket library with application support, static
libdk4socka.a: libdk4sock.a libdk4app.a $(LIBDK4SOCKAOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4SOCKAOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4DBIALIBF=libdk4base.so libdk4dbi.so libdk4app.so
-LIBDK4DBIALIBS=-ldk4dbi -ldk4app -ldk4base $(DBLIB)
+
+LIBDK4DBIALIBF=
+LIBDK4DBIALIBS=
libdk4dbia.so: # Simple database interface with app support
libdk4dbia.so: $(LIBDK4DBIALIBF) $(LIBDK4DBIAOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4DBIAOBJ) $(LIBDK4DBIALIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4DBIAOBJ) $(LIBDK4DBIALIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4dbia.a: # Simple database interface with app support, static
libdk4dbia.a: libdk4dbi.a libdk4app.a $(LIBDK4DBIAOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4DBIAOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4SOCKLIBF=libdk4base.so libdk4maio8d.so libdk4c.so
-LIBDK4SOCKLIBS=-ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)
+
+LIBDK4SOCKLIBF=
+LIBDK4SOCKLIBS=
libdk4sock.so: # Socket library without application support
libdk4sock.so: $(LIBDK4SOCKLIBF) $(LIBDK4SOCKOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4SOCKOBJ) $(LIBDK4SOCKLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4SOCKOBJ) $(LIBDK4SOCKLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4sock.a: # Socket library without app support, static version
libdk4sock.a: libdk4c.a $(LIBDK4SOCKOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4SOCKOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4LATLIBF=libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4app.so
-LIBDK4LATLIBS=-ldk4app -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maio8h -ldk4ma -ldk4base
+
+LIBDK4LATALIBF=
+LIBDK4LATALIBS=
+
+libdk4lata.so: # Text to LaTeX conversion library
+libdk4lata.so: $(LIBDK4LATALIBF) $(LIBDK4LATAOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4LATAOBJ) $(LIBDK4LATALIBS)
+ ln -s $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4lata.a: # Text to LaTeX conversion static library
+libdk4lata.a: libdk4c.a $(LIBDK4LATAOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4LATAOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
+LIBDK4LATLIBF=
+LIBDK4LATLIBS=
libdk4lat.so: # Text to LaTeX conversion library
libdk4lat.so: $(LIBDK4LATLIBF) $(LIBDK4LATOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4LATOBJ) $(LIBDK4LATLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4LATOBJ) $(LIBDK4LATLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4lat.a: # Text to LaTeX conversion static library
libdk4lat.a: libdk4c.a $(LIBDK4LATOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4LATOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4PPPTALIBF=libdk4base.so libdk4c.so libdk4pppt.so libdk4app.so
-LIBDK4PPPTALIBS=-ldk4app -ldk4pppt -ldk4c -ldk4base
+
+LIBDK4BIFALIBF=
+LIBDK4BIFALIBS=
+
+libdk4bifa.so: # Bitmap image file reader library, app support
+libdk4bifa.so: $(LIBDK4BIFALIBF) $(LIBDK4BIFAOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4BIFAOBJ) $(LIBDK4BIFALIBS)
+ ln -s $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4bifa.a: # Bitmap image file reader library, app support static
+libdk4bifa.a: $(LIBDK4BIFALIBF) $(LIBDK4BIFAOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4BIFAOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
+LIBDK4GRAALIBF=
+LIBDK4GRAALIBS=
+
+libdk4graa.so: # Graphics output library, app support
+libdk4graa.so: $(LIBDK4GRAALIBF) $(LIBDK4GRAAOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4GRAAOBJ) $(LIBDK4GRAALIBS)
+ ln -s $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4graa.a: # Graphics output library, app support static
+libdk4graa.a: $(LIBDK4GRAALIBF) $(LIBDK4GRAAOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4GRAAOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
+LIBDK4PPPTALIBF=
+LIBDK4PPPTALIBS=
libdk4pppta.so: # PS+TeX,PDF+TeX,PGF creator library
libdk4pppta.so: $(LIBDK4PPPTALIBF) $(LIBDK4PPPTAOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4PPPTAOBJ) $(LIBDK4PPPTALIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4PPPTAOBJ) $(LIBDK4PPPTALIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4pppta.a: # PS+TeX,PDF+TeX,PGF creator library static
libdk4pppta.a: libdk4app.a libdk4pppt.a $(LIBDK4PPPTAOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4PPPTAOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4APPLIBF=libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so
-LIBDK4APPLIBS=-ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base
+
+LIBDK4APPLIBF=
+LIBDK4APPLIBS=
libdk4app.so: # Application support library shared
libdk4app.so: $(LIBDK4APPLIBF) $(LIBDK4APPOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4APPOBJ) $(LIBDK4APPLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @@-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4APPOBJ) $(LIBDK4APPLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4app.a: # Application support library static
libdk4app.a: libdk4c.a $(LIBDK4APPOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4APPOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MDRNDLIBF=libdk4base.so libdk4c.so
-LIBDK4MDRNDLIBS=-ldk4c -ldk4base $(CRYPTO)
+
+LIBDK4MDRNDLIBF=
+LIBDK4MDRNDLIBS=
libdk4mdrnd.so: # Message digest and random library shared
libdk4mdrnd.so: $(LIBDK4MDRNDLIBF) $(LIBDK4MDRNDOBJ)
- -[ ! -f $@ ] || rm -fr $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MDRNDOBJ) $(LIBDK4MDRNDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MDRNDOBJ) $(LIBDK4MDRNDLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4mdrnd.a: # Message digest and random library static
libdk4mdrnd.a: libdk4c.a $(LIBDK4MDRNDOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MDRNDOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4PPPTLIBF=libdk4base.so libdk4maiodd.so libdk4c.so
-LIBDK4PPPTLIBS=-ldk4c -ldk4maiodd -ldk4base
+
+LIBDK4BIFLIBF=
+LIBDK4BIFLIBS=
+
+libdk4bif.so: # Bitmap image file reader library
+libdk4bif.so: $(LIBDK4BIFLIBF) $(LIBDK4BIFOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4BIFOBJ) $(LIBDK4BIFLIBS)
+ ln -s $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4bif.a: # Bitmap image file reader library static
+libdk4bif.a: $(LIBDK4BIFLIBF) $(LIBDK4BIFOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4BIFOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
+
+LIBDK4GRALIBF=
+LIBDK4GRALIBS=
+
+libdk4gra.so: # Graphics output library
+libdk4gra.so: $(LIBDK4GRALIBF) $(LIBDK4GRAOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4GRAOBJ) $(LIBDK4GRALIBS)
+ ln -s $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4gra.a: # Graphics output library static
+libdk4gra.a: $(LIBDK4GRALIBF) $(LIBDK4GRAOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4BIFOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
+
+LIBDK4PPPTLIBF=
+LIBDK4PPPTLIBS=
libdk4pppt.so: # PS+TeX,PDF+TeX,PGF creator library
libdk4pppt.so: $(LIBDK4PPPTLIBF) $(LIBDK4PPPTOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4PPPTOBJ) $(LIBDK4PPPTLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4PPPTOBJ) $(LIBDK4PPPTLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4pppt.a: # PS+TeX,PDF+TeX,PGF creator library static
libdk4pppt.a: libdk4c.a $(LIBDK4PPPTOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4PPPTOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4CLIBF=libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so
-LIBDK4CLIBS=-ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(BZLIB) $(ZLIB) -lm
+
+
+LIBDK4CLIBF=
+LIBDK4CLIBS=
libdk4c.so: # General C library shared
libdk4c.so: $(LIBDK4CLIBF) $(LIBDK4COBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4COBJ) $(LIBDK4CLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4COBJ) $(LIBDK4CLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4c.a: # General C library static
libdk4c.a: libdk4maiodd.a $(LIBDK4COBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4COBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4DBILIBF=libdk4base.so libdk4ma.so libdk4c.so
-LIBDK4DBILIBS=-ldk4c -ldk4ma -ldk4base $(DBLIB)
+
+
+LIBDK4DBILIBF=
+LIBDK4DBILIBS=
libdk4dbi.so: # Simple database interface
libdk4dbi.so: $(LIBDK4DBILIBF) $(LIBDK4DBIOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4DBIOBJ) $(LIBDK4DBILIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4DBIOBJ) $(LIBDK4DBILIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4dbi.a: # Simple database interface static library
libdk4dbi.a: libdk4ma.a $(LIBDK4DBIOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4DBIOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MAIOXDLIBF=libdk4base.so libdk4maio8d.so libdk4maiowd.so
-LIBDK4MAIOXDLIBS=-ldk4maiowd -ldk4maio8d -ldk4base
+
+
+LIBDK4MAIOXDLIBF=
+LIBDK4MAIOXDLIBS=
libdk4maioxd.so: # Numeric values I/O, wxChar, decimal, shared
libdk4maioxd.so: $(LIBDK4MAIOXDLIBF) $(LIBDK4MAIOXDOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIOXDOBJ) $(LIBDK4MAIOXDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MAIOXDOBJ) $(LIBDK4MAIOXDLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maioxd.a: # Numeric values I/O, wxChar, decimal, static
libdk4maioxd.a: libdk4maio8d.a libdk4ma.a $(LIBDK4MAIOXDOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIOXDOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MAIODDLIBF=libdk4base.so libdk4maio8d.so
-LIBDK4MAIODDLIBS=-ldk4maio8d -ldk4base
+
+
+LIBDK4MAIODDLIBF=
+LIBDK4MAIODDLIBS=
libdk4maiodd.so: # Numeric values I/O, dkChar, decimal, shared
libdk4maiodd.so: $(LIBDK4MAIODDLIBF) $(LIBDK4MAIODDOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIODDOBJ) $(LIBDK4MAIODDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MAIODDOBJ) $(LIBDK4MAIODDLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maiodd.a: # Numeric values I/O, dkChar, decimal, static
libdk4maiodd.a: libdk4maio8d.a libdk4ma.a $(LIBDK4MAIODDOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIODDOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MAIOWDLIBF=libdk4base.so libdk4ma.so
-LIBDK4MAIOWDLIBS=-ldk4ma -ldk4base
+
+
+LIBDK4MAIOWDLIBF=
+LIBDK4MAIOWDLIBS=
libdk4maiowd.so: # Numeric values I/O, wchar_t, decimal, shared
libdk4maiowd.so: $(LIBDK4MAIOWDLIBF) $(LIBDK4MAIOWDOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIOWDOBJ) $(LIBDK4MAIOWDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MAIOWDOBJ) $(LIBDK4MAIOWDLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maiowd.a: # Numeric values I/O, wchar_t, decimal, static
libdk4maiowd.a: libdk4ma.a $(LIBDK4MAIOWDOBJ)
- [ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIOWDOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MAIO8DLIBF=libdk4base.so libdk4ma.so
-LIBDK4MAIO8DLIBS=-ldk4ma -ldk4base
+
+
+LIBDK4MAIO8DLIBF=
+LIBDK4MAIO8DLIBS=
libdk4maio8d.so: # Numeric values I/O, char, decimal, shared
libdk4maio8d.so: $(LIBDK4MAIO8DLIBF) $(LIBDK4MAIO8DOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIO8DOBJ) $(LIBDK4MAIO8DLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MAIO8DOBJ) $(LIBDK4MAIO8DLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maio8d.a: # Numeric values I/O, char, decimal, static
libdk4maio8d.a: libdk4ma.a $(LIBDK4MAIO8DOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIO8DOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MAIODHLIBF=libdk4base.so libdk4maio8h.so
-LIBDK4MAIODHLIBS=-ldk4maio8h -ldk4base
+
+
+LIBDK4MAIODHLIBF=
+LIBDK4MAIODHLIBS=
libdk4maiodh.so: # Numeric values I/O, dkChar, hexadecimal, shared
libdk4maiodh.so: $(LIBDK4MAIODHLIBF) $(LIBDK4MAIODHOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIODHOBJ) $(LIBDK4MAIODHLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MAIODHOBJ) $(LIBDK4MAIODHLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maiodh.a: # Numeric values I/O, dkChar, hexadecimal, static
libdk4maiodh.a: libdk4ma.a $(LIBDK4MAIODHOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIODHOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MAIOWHLIBF=libdk4base.so
-LIBDK4MAIOWHLIBS=-ldk4base
+
+
+LIBDK4MAIOWHLIBF=
+LIBDK4MAIOWHLIBS=
libdk4maiowh.so: # Numeric values I/O, wchar_t, hexadecimal, shared
libdk4maiowh.so: $(LIBDK4MAIOWHLIBF) $(LIBDK4MAIOWHOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIOWHOBJ) $(LIBDK4MAIOWHLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MAIOWHOBJ) $(LIBDK4MAIOWHLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maiowh.a: # Numeric values I/O, wchar_t, hexadecimal, static
libdk4maiowh.a: libdk4ma.a $(LIBDK4MAIOWHOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIOWHOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MAIO8HLIBF=libdk4base.so
-LIBDK4MAIO8HLIBS=-ldk4base
+
+
+LIBDK4MAIO8HLIBF=
+LIBDK4MAIO8HLIBS=
libdk4maio8h.so: # Numeric values I/O, char, hexadecimal, shared
libdk4maio8h.so: $(LIBDK4MAIO8HLIBF) $(LIBDK4MAIO8HOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIO8HOBJ) $(LIBDK4MAIO8HLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MAIO8HOBJ) $(LIBDK4MAIO8HLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maio8h.a: # Numeric values I/O, char, hexadecimal, static
libdk4maio8h.a: libdk4ma.a $(LIBDK4MAIO8HOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIO8HOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK4MALIBF=libdk4base.so
-LIBDK4MALIBS=-ldk4base
+
+
+LIBDK4MALIBF=
+LIBDK4MALIBS=
libdk4ma.so: # Mathematics library, shared
libdk4ma.so: $(LIBDK4MALIBF) $(LIBDK4MAOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAOBJ) $(LIBDK4MALIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4MAOBJ) $(LIBDK4MALIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4ma.a: # Mathematics library, static
libdk4ma.a: libdk4base.a $(LIBDK4MAOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4BASELIBF=
LIBDK4BASELIBS=
libdk4base.so: # Base library, shared
libdk4base.so: $(LIBDK4BASELIBF) $(LIBDK4BASEOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4BASEOBJ) $(LIBDK4BASELIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK4BASEOBJ) $(LIBDK4BASELIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4base.a: # Base library, static
libdk4base.a: $(LIBDK4BASEOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4BASEOBJ)
$(RANLIB) $@
chmod 644 $@
-#
-# Programs to fix configure script results to DK4_HAVE_... constants
-#
+# DK4 programs
+# ------------
+
+WXDKDRAWOBJ= \
+ WxdkdrawApp.$(OBJEXT) \
+ WxdkdrawFrame.$(OBJEXT) \
+ WxdkdrawFrameEvents.$(OBJEXT) \
+ WxdkdrawFrameStipples.$(OBJEXT) \
+ WxdkdrawFrameTools.$(OBJEXT) \
+ WxdkdrawDlgLineStyle.$(OBJEXT) \
+ WxdkdrawDlgStyleLength.$(OBJEXT) \
+ WxdkdrawDlgLineJoin.$(OBJEXT) \
+ WxdkdrawDlgMiterLimit.$(OBJEXT) \
+ WxdkdrawDlgLineCap.$(OBJEXT) \
+ WxdkdrawDlgArrowType.$(OBJEXT) \
+ WxdkdrawDlgArrowSize.$(OBJEXT) \
+ WxdkdrawDlgFillStyle.$(OBJEXT) \
+ WxdkdrawDlgTextAlign.$(OBJEXT) \
+ WxdkdrawDlgFontName.$(OBJEXT) \
+ WxdkdrawDlgLayerManager.$(OBJEXT) \
+ WxdkdrawDlgTextInput.$(OBJEXT) \
+ WxdkdrawDlgSplineValue.$(OBJEXT) \
+ WxdkdrawDlgImageOptions.$(OBJEXT) \
+ WxdkdrawDlgDotFilled.$(OBJEXT) \
+ WxdkdrawDlgBoxRadius.$(OBJEXT) \
+ WxdkdrawDlgOptionsNewObjects.$(OBJEXT) \
+ WxdkdrawDlgOptionsScreen.$(OBJEXT) \
+ WxdkdrawMouse.$(OBJEXT) \
+ WxdkdrawControlEvents.$(OBJEXT) \
+ WxdkdrawControlDraw.$(OBJEXT) \
+ WxdkdrawControlArrows.$(OBJEXT) \
+ WxdkdrawControlTools.$(OBJEXT) \
+ WxdkdrawControl.$(OBJEXT) \
+ WxdkdrawWrite.$(OBJEXT) \
+ WxdkdrawRead.$(OBJEXT) \
+ WxdkdrawComp.$(OBJEXT) \
+ WxdkdrawObj.$(OBJEXT) \
+ WxdkdrawFont.$(OBJEXT) \
+ wxdarc.$(OBJEXT)
+
+
+WXDKDRAWLIBF=libdk4.a libdk4maioxd.a libdk4wx.a
+WXDKDRAWLIBS=libdk4wx.a libdk4maioxd.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
+
+wxdkdraw: # Program: Drawing application for use with LaTeX
+wxdkdraw$(EXEEXT): $(WXDKDRAWLIBF) $(WXDKDRAWOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXDKDRAWOBJ) $(WXDKDRAWLIBS)
+ chmod 755 $@
+
+
+
+WXBMPPOBJ= Bmpp4App.$(OBJEXT) \
+ Bmpp4Frame.$(OBJEXT) \
+ Bmpp4Progress.$(OBJEXT)
+
+WXBMPPLIBF=libdk4.a libdk4maioxd.a libdk4wx.a
+WXBMPPLIBS=libdk4wx.a libdk4maioxd.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
-dk3config: # Program: Show configuration for dk3... modules
-dk3config$(EXEEXT): dk3config.c
- @-[ ! -f dk3conig ] || rm -f dk3config
- @$(COMPILEC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dk3config.c -lm
- @chmod 755 dk3config
+wxbmpp: # Program: Bitmap to PS/PDF converter (GUI)
+wxbmpp$(EXEEXT): $(WXBMPPLIBF) $(WXBMPPOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXBMPPOBJ) $(WXBMPPLIBS)
+ chmod 755 $@
-dk4config: # Program: Show configuration for dk4... modules
-dk4config$(EXEEXT): dk4config.cpp
- @-[ ! -f $@ ] || rm -f $@
- @$(COMPILECPP) $(LDFLAGS) $(WXLDFLAGS) -o $@ dk4config.cpp
- @chmod 755 $@
-wxcs: # Program: Show wxChar character size
-wxcs$(EXEEXT): wxcs.cpp
- @-[ ! -f $@ ] || rm -f $@
- @$(COMPILECPP) $(LDFLAGS) $(WXLDFLAGS) -o $@ wxcs.cpp
- @chmod 755 $@
+WXDKFCSOBJ= Dk4FcsApp.$(OBJEXT) \
+ Dk4FcsFrame.$(OBJEXT)
+
+WXDKFCSLIBF=libdk4.a libdk4wx.a
+WXDKFCSLIBS=libdk4wx.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+
+wxdkfcs: # Program: File checksums with GUI
+wxdkfcs$(EXEEXT): $(WXDKFCSLIBF) $(WXDKFCSOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXDKFCSOBJ) $(WXDKFCSLIBS)
+ chmod 755 $@
+
+
+
+WXPQDICOBJ= WxpqdicApp.$(OBJEXT) \
+ WxpqdicFrame.$(OBJEXT)
+
+WXPQDICLIBF=libdk4.a libdk4wx.a
+WXPQDICLIBS=libdk4wx.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
+
+wxpqdic: # Program: Client for printqd queries
+wxpqdic$(EXEEXT): $(WXPQDICLIBF) $(WXPQDICOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXPQDICOBJ) $(WXPQDICLIBS)
+ chmod 755 $@
+
+
+
+CHSCRSZOBJ= ScreenSizeApp.$(OBJEXT) \
+ ScreenSizeFrame.$(OBJEXT)
+
+CHSCRSZLIBF=libdk3.a
+CHSCRSZLIBS=libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
+
+ChangeScreenSize$(EXEEXT): $(CHSCRSZLIBF) $(CHSCRSZOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CXX) $(LDFLCXX_CLI_DK) -o $@ $(CHSCRSZOBJ) $(CHSCRSZLIBS)
+ chmod 755 $@
+
+
+
+BMPPOBJ= bmpp.$(OBJEXT)
+
+BMPPLIBF=libdk4.a
+BMPPLIBS=libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
+
+bmpp: # Program: Bitmap to PS/PDF converter (CLI)
+bmpp$(EXEEXT): $(BMPPLIBF) $(BMPPOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(BMPPOBJ) $(BMPPLIBS)
+ chmod 755 $@
+
+
+
+WXD2LATLIBF=libdk4.a
+WXD2LATLIBS=libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
+
+WXD2LATOBJ= wxd2lat.$(OBJEXT) \
+ wxd2lout.$(OBJEXT) \
+ wxd2lah.$(OBJEXT) \
+ wxd2lxs.$(OBJEXT) \
+ wxdrd.$(OBJEXT) \
+ w2llic.$(OBJEXT) \
+ wxdstr.$(OBJEXT) \
+ wxdobj.$(OBJEXT) \
+ wxdcomp.$(OBJEXT) \
+ wxdarc.$(OBJEXT)
+
+wxd2lat: # Program: WXD to LaTeX converter
+wxd2lat$(EXEEXT): $(WXD2LATOBJ) $(WXD2LATLIBF)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(WXD2LATOBJ) $(WXD2LATLIBS)
+ chmod 755 $@
+
+
+
+PLPDFTEXLIBF=libdk4.a
+PLPDFTEXLIBS=libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
+
+PLPDFTEXOBJ= plpdftex.$(OBJEXT)
+
+plpdftex: # Program: Plot driver for octpgfpl package
+plpdftex$(EXEEXT): $(PLPDFTEXLIBF) $(PLPDFTEXOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(PLPDFTEXOBJ) $(PLPDFTEXLIBS)
+ chmod 755 $@
-# ##### Start of dktools-4 section
DKCATLIBF=libdk4.a
-DKCATLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKCATLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKCATOBJ= dk-cat.$(OBJEXT)
dk-cat: # Program: Show file contents
-dk-cat$(EXEEXT): $(DKCATLIBF) dk-cat.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-cat.o $(DKCATLIBS)
+dk-cat$(EXEEXT): $(DKCATLIBF) $(DKCATOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKCATOBJ) $(DKCATLIBS)
chmod 755 $@
DKBLKSLIBF=libdk4.a
-DKBLKSLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKBLKSLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKBLKSOBJ= dk-blks.$(OBJEXT)
dk-blks: # Program: Adjust block size
-dk-blks$(EXEEXT): $(DKBLKSLIBF) dk-blks.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-blks.o $(DKBLKSLIBS)
+dk-blks$(EXEEXT): $(DKBLKSLIBF) $(DKBLKSOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKBLKSOBJ) $(DKBLKSLIBS)
chmod 755 $@
DKSQLSPLITLIBF=libdk4.a
-DKSQLSPLITLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKSQLSPLITLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKSQLSPLITOBJ= dk-sqlsplit.$(OBJEXT)
dk-sqlsplit: # Program: Split overlong SQL lines
-dk-sqlsplit$(EXEEXT): $(DKSQLSPLITLIBF) dk-sqlsplit.o
+dk-sqlsplit$(EXEEXT): $(DKSQLSPLITLIBF) $(DKSQLSPLITOBJ)
-[ ! -f $@ ] || rm -fr $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-sqlsplit.o $(DKSQLSPLITLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKSQLSPLITOBJ) $(DKSQLSPLITLIBS)
chmod 755 $@
DKERADISKLIBF=libdk4.a
-DKERADISKLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKERADISKLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKERADISKOBJ= dk-eradisk.$(OBJEXT)
dk-eradisk: # Program: Create data stream for disk deletion
-dk-eradisk$(EXEEXT): $(DKERADISKLIBF) dk-eradisk.o
+dk-eradisk$(EXEEXT): $(DKERADISKLIBF) $(DKERADISKOBJ)
-[ ! -f $@ ] || rm -fr $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-eradisk.o $(DKERADISKLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKERADISKOBJ) $(DKERADISKLIBS)
chmod 755 $@
-DKLSOBJ= dk-ls.o dk-ls-to.o
+DKLSOBJ= dk-ls.$(OBJEXT) dk-ls-to.$(OBJEXT)
DKLSLIBF=libdk4.a
-DKLSLIBS=-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+DKLSLIBS=libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
dk-ls: # Program: SHow information about files
dk-ls$(EXEEXT): $(DKLSLIBF) $(DKLSOBJ)
-[ ! -f $@ ] || rm -fr $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(DKLSOBJ) $(DKLSLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKLSOBJ) $(DKLSLIBS)
chmod 755 $@
-DKSORTOBJ= dk-sort.o
+DKSORTOBJ= dk-sort.$(OBJEXT)
DKSORTLIBF=libdk4.a
-DKSORTLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKSORTLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
dk-sort: # Program: Text sorting in different encodings
dk-sort$(EXEEXT): $(DKSORTLIBF) $(DKSORTOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -L. -o $@ $(DKSORTOBJ) $(DKSORTLIBS)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKSORTOBJ) $(DKSORTLIBS)
+ chmod 755 $@
+
+
+
+DKLINESOBJ= dk-lines.$(OBJEXT)
+
+DKLINESLIBF=libdk4.a
+DKLINESLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+dk-lines: # Program: Text linesing in different encodings
+dk-lines$(EXEEXT): $(DKLINESLIBF) $(DKLINESOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKLINESOBJ) $(DKLINESLIBS)
chmod 755 $@
DKFICLIBF=libdk4.a
-DKFICLIBS=-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+DKFICLIBS=libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKFICOBJ= dk-fic.$(OBJEXT)
dk-fic: # Program: File integrity checker (CLI)
-dk-fic$(EXEEXT): $(DKFICLIBF) dk-fic.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-fic.o $(DKFICLIBS)
+dk-fic$(EXEEXT): $(DKFICLIBF) $(DKFICOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKFICOBJ) $(DKFICLIBS)
chmod 755 $@
DKUIDLIBF=libdk4.a
-DKUIDLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKUIDLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
dk-uid: # Program: Find free UID in given range
-dk-uid$(EXEEXT): $(DKUIDLIBF) dk-uid.o
+dk-uid$(EXEEXT): $(DKUIDLIBF) dk-uid.$(OBJEXT)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-uid.o $(DKUIDLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ dk-uid.$(OBJEXT) $(DKUIDLIBS)
chmod 755 $@
DKPWGENLIBF=libdk4.a
-DKPWGENLIBS=-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+DKPWGENLIBS=libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKPWGENOBJ= dk-pwgen.$(OBJEXT)
dk-pwgen: # Program: Passwort/PIN/WiFi key generator
-dk-pwgen$(EXEEXT): $(DKPWGENLIBF) dk-pwgen.o
+dk-pwgen$(EXEEXT): $(DKPWGENLIBF) $(DKPWGENOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-pwgen.o $(DKPWGENLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKPWGENOBJ) $(DKPWGENLIBS)
chmod 755 $@
DKRANDLIBF=libdk4.a
-DKRANDLIBS=-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+DKRANDLIBS=libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKRANDOBJ= dk-rand.$(OBJEXT)
dk-rand: # Program: Random data generator
-dk-rand$(EXEEXT): $(DKRANDLIBF) dk-rand.o
+dk-rand$(EXEEXT): $(DKRANDLIBF) $(DKRANDOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-rand.o $(DKRANDLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKRANDOBJ) $(DKRANDLIBS)
chmod 755 $@
DKT2HLIBF=libdk4.a
-DKT2HLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKT2HLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKT2HOBJ= dk-t2h.$(OBJEXT)
dk-t2h: # Program: Convert text to HTML
-dk-t2h$(EXEEXT): $(DKT2HLIBF) dk-t2h.o
+dk-t2h$(EXEEXT): $(DKT2HLIBF) $(DKT2HOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-t2h.o $(DKT2HLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKT2HOBJ) $(DKT2HLIBS)
chmod 755 $@
DKT2LLIBF=libdk4.a
-DKT2LLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKT2LLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKT2LOBJ= dk-t2l.$(OBJEXT)
dk-t2l: # Program: Convert text to LaTeX
-dk-t2l$(EXEEXT): $(DKT2LLIBF) dk-t2l.o
+dk-t2l$(EXEEXT): $(DKT2LLIBF) $(DKT2LOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-t2l.o $(DKT2LLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKT2LOBJ) $(DKT2LLIBS)
chmod 755 $@
+DKBIN2CLIBF=libdk4.a
+DKBIN2CLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKBIN2COBJ= dk-bin2c.$(OBJEXT)
+
+dk-bin2c: # Program: Convert binary data to C source
+dk-bin2c$(EXEEXT): $(DKBIN2CLIBF) $(DKBIN2COBJ)
+ [ ! -f $@ ] || rm -f $@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKBIN2COBJ) $(DKBIN2CLIBS)
+ chmod 755 $@
+
DKHEXLIBF=libdk4.a
-DKHEXLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKHEXLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKHEXOBJ= dk-hex.$(OBJEXT)
dk-hex: # Program: Show file contents in hexadecimal notation
-dk-hex$(EXEEXT): $(DKHEXLIBF) dk-hex.o
+dk-hex$(EXEEXT): $(DKHEXLIBF) $(DKHEXOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-hex.o $(DKHEXLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKHEXOBJ) $(DKHEXLIBS)
chmod 755 $@
DKBMMLIBF=libdk4.a
-DKBMMLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKBMMLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKBMMOBJ= dk-bmm.$(OBJEXT)
dk-bmm: # Program: Backup media management
-dk-bmm$(EXEEXT): $(DKBMMLIBF) dk-bmm.o
+dk-bmm$(EXEEXT): $(DKBMMLIBF) $(DKBMMOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-bmm.o $(DKBMMLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKBMMOBJ) $(DKBMMLIBS)
chmod 755 $@
DKPWDLIBF=libdk4.a
-DKPWDLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DKPWDLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKPWDOBJ= dk-pwd.$(OBJEXT)
dk-pwd: # Program: Print working directory
-dk-pwd$(EXEEXT): $(DKPWDLIBF) dk-pwd.o
+dk-pwd$(EXEEXT): $(DKPWDLIBF) $(DKPWDOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-pwd.o $(DKPWDLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKPWDOBJ) $(DKPWDLIBS)
chmod 755 $@
DKRECVLIBF=libdk4.a
-DKRECVLIBS=-ldk4 $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
+DKRECVLIBS=libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
+
+DKRECVOBJ= dk-recv.$(OBJEXT)
dk-recv: # Program: Receive data stream from dk-send process
-dk-recv$(EXEEXT): $(DKRECVLIBF) dk-recv.o
+dk-recv$(EXEEXT): $(DKRECVLIBF) $(DKRECVOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-recv.o $(DKRECVLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKRECVOBJ) $(DKRECVLIBS)
chmod 755 $@
DKSENDLIBF=libdk4.a
-DKSENDLIBS=-ldk4 $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
+DKSENDLIBS=libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
+
+DKSENDOBJ= dk-send.$(OBJEXT)
dk-send: # Program: Send data to one or multiple recipients
-dk-send$(EXEEXT): $(DKSENDLIBF) dk-send.o
+dk-send$(EXEEXT): $(DKSENDLIBF) $(DKSENDOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-send.o $(DKSENDLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKSENDOBJ) $(DKSENDLIBS)
chmod 755 $@
-PRINTQDOBJ= printqd.o
+PRINTQDOBJ= printqd.$(OBJEXT)
PRINTQDLIBF=libdk4.a
-PRINTQDLIBS=-ldk4 $(DBLIB) $(SOCKLIB) $(NSLLIB)
+PRINTQDLIBS=libdk4.a $(DBLIB) $(SOCKLIB) $(NSLLIB)
printqd: # Program: Print quota enforcement daemon
printqd$(EXEEXT): $(PRINTQDLIBF) $(PRINTQDOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(PRINTQDOBJ) $(PRINTQDLIBS)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ $(PRINTQDOBJ) $(PRINTQDLIBS)
chmod 755 $@
-PRINTQDCOBJ= printqdc.o
+PRINTQDCOBJ= printqdc.$(OBJEXT)
PRINTQDCLIBF=libdk4.a
-PRINTQDCLIBS=-ldk4 $(SOCKLIB) $(NSLLIB)
+PRINTQDCLIBS=libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)
printqdc: # Program: Print quota client
printqdc$(EXEEXT): $(PRINTQDCLIBF) $(PRINTQDCOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(PRINTQDCOBJ) $(PRINTQDCLIBS)
- chmod 755 $@
-
-
-
-WXPQDICOBJ= WxpqdicApp.o WxpqdicFrame.o
-
-WXPQDICLIBF=libdk4.a
-WXPQDICLIBS=-ldk4 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
-
-wxpqdic: # Program: Client for printqd queries
-wxpqdic$(EXEEXT): $(WXPQDICLIBF) $(WXPQDICOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXPQDICOBJ) $(WXPQDICLIBS)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ $(PRINTQDCOBJ) $(PRINTQDCLIBS)
chmod 755 $@
PJSNMPLIBF=libdk4.a
-PJSNMPLIBS=-ldk4 $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)
+PJSNMPLIBS=libdk4.a $(CLILIB) $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)
pjsnmp: # Program: Print job transfer using TCP and SNMP
-pjsnmp$(EXEEXT): $(PJSNMPLIBF) pjsnmp.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ pjsnmp.o $(PJSNMPLIBS)
+pjsnmp$(EXEEXT): $(PJSNMPLIBF) pjsnmp.$(OBJEXT)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ pjsnmp.$(OBJEXT) $(PJSNMPLIBS)
chmod 755 $@
PRMONSNMPLIBF=libdk4.a
-PRMONSNMPLIBS=-ldk4 $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)
+PRMONSNMPLIBS=libdk4.a $(CLILIB) $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)
prmonsnmp: # Program: Monitor printers using SNMP
-prmonsnmp$(EXEEXT): $(PRMONSNMPLIBF) prmonsnmp.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ prmonsnmp.o $(PRMONSNMPLIBS)
+prmonsnmp$(EXEEXT): $(PRMONSNMPLIBF) prmonsnmp.$(OBJEXT)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ prmonsnmp.$(OBJEXT) $(PRMONSNMPLIBS)
chmod 755 $@
LPRNGCLLIBF=libdk4.a
-LPRNGCLLIBS=-ldk4 $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
+LPRNGCLLIBS=libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
+
+LPRNGCLOBJ= lprngcl.$(OBJEXT)
lprngcl: # Program: LPRng queue cleanup
-lprngcl$(EXEEXT): $(LPRNGCLLIBF) lprngcl.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ lprngcl.o $(LPRNGCLLIBS)
+lprngcl$(EXEEXT): $(LPRNGCLLIBF) $(LPRNGCLOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(LPRNGCLOBJ) $(LPRNGCLLIBS)
chmod 755 $@
+ADDCTRLDLIBF=
+ADDCTRLDLIBS=$(CLILIB)
+
+ADDCTRLDOBJ= addctrld.$(OBJEXT)
+
+addctrld: # Program: Filter to ensure Ctrl-D as final byte
+addctrld$(EXEEXT): $(ADDCTRLDLIBF) $(ADDCTRLDOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ $(ADDCTRLDOBJ) $(ADDCTRLDLIBS)
+ chmod 755 $@
DKDBT2LIBF=libdk4.a
-DKDBT2LIBS=-ldk4 $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)
+DKDBT2LIBS=libdk4.a $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)
+
+DKDB2TOBJ= dk-db2t.$(OBJEXT)
dk-db2t: # Program: Convert database to text
-dk-db2t$(EXEEXT): $(DKDBT2LIBF) dk-db2t.o
+dk-db2t$(EXEEXT): $(DKDBT2LIBF) $(DKDB2TOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-db2t.o $(DKDBT2LIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKDB2TOBJ) $(DKDBT2LIBS)
chmod 755 $@
+DKDBCOOBJ= dk-dbco.$(OBJEXT)
+
dk-dbco: # Program: Copy database
-dk-dbco$(EXEEXT): $(DKDBT2LIBF) dk-dbco.o
+dk-dbco$(EXEEXT): $(DKDBT2LIBF) $(DKDBCOOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-dbco.o $(DKDBT2LIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKDBCOOBJ) $(DKDBT2LIBS)
chmod 755 $@
+DKT2DBOBJ= dk-t2db.$(OBJEXT)
+
dk-t2db: # Program: Convert text to database
-dk-t2db$(EXEEXT): $(DKDBT2LIBF) dk-t2db.o
+dk-t2db$(EXEEXT): $(DKDBT2LIBF) $(DKT2DBOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-t2db.o $(DKDBT2LIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKT2DBOBJ) $(DKDBT2LIBS)
chmod 755 $@
RSHDOWNLIBF=libdk4.a
-RSHDOWNLIBS=-ldk4 $(SOCKLIB) $(NSLLIB)
+RSHDOWNLIBS=libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)
rshdown: # Program: Remote shutdown
-rshdown$(EXEEXT): $(RSHDOWNLIBF) rshdown.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ rshdown.o $(RSHDOWNLIBS)
+rshdown$(EXEEXT): $(RSHDOWNLIBF) rshdown.$(OBJEXT)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ rshdown.$(OBJEXT) $(RSHDOWNLIBS)
chmod 755 $@
DK4INFOLIBF=libdk4.a
-DK4INFOLIBS=-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)
+DK4INFOLIBS=libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)
+
+DK4INFOOBJ= dk4info.$(OBJEXT)
dk4info: # Program: Show information about this build
-dk4info$(EXEEXT): $(DK4INFOLIBF) dk4info.o
+dk4info$(EXEEXT): $(DK4INFOLIBF) $(DK4INFOOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk4info.o $(DK4INFOLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DK4INFOOBJ) $(DK4INFOLIBS)
chmod 755 $@
-# ##### End of dktools-4 section
-
-
-
-# ##### Start of dktools-3 section
-
-# Objects for libdk3c.so or libdk3c.a library
-LIBDK3COBJ= \
- dk3ufi.o \
- dk3opt.o \
- dk3bf.o \
- dk3se.o \
- dk3app.o \
- dk3strm.o \
- dk3print.o \
- dk3prcfg.o \
- dk3strkv.o \
- dk3sto.o \
- dk3dir.o \
- dk3enc.o \
- dk3str.o \
- dk3cores.o \
- dk3sf.o \
- dk3echo.o \
- dk3signl.o \
- dk3ct.o \
- dk3mas.o \
- dk3maus.o \
- dk3mai.o \
- dk3maui.o \
- dk3mal.o \
- dk3maul.o \
- dk3mad.o \
- dk3madsc.o \
- dk3madic.o \
- dk3madlc.o \
- dk3maidd.o \
- dk3maihd.o \
- dk3maodd.o \
- dk3maohd.o \
- dk3maid8.o \
- dk3maih8.o \
- dk3maod8.o \
- dk3maoh8.o \
- dk3masts.o \
- dk3madfo.o \
- dk3madso.o \
- dk3madsi.o \
- dk3inst.o \
- dk3srch.o \
- dk3bits.o \
- dk3mem.o \
- dk3bb.o \
- dk3bezcu.o \
- dk3xsp.o \
- dk3kv.o \
- dk3trace.o
-
-# Objects for libdk3of.so or libdk3of.a library
-LIBDK3OFOBJ= \
- dk3of.o \
- dk3strmb.o \
- dk3strmg.o
-
-# Objects for libdk3csrnd.so or libdk3csrnd.a library
-LIBDK3CSRNDOBJ= \
- dk3chks.o \
- dk3appr.o
-
-# Objects for libdk3bif.so or libdk3bif.a library
-LIBDK3BIFOBJ= \
- dk3bifa.o \
- dk3bif.o \
- dk3pixre.o
-
-# Objects for libdk3dbi.so or libdk3dbi.a library
-LIBDK3DBIOBJ= \
- dk3dbi.o
-
-# Objects for libdk3bmeps.so or libdk3bmeps.a library
-LIBDK3BMEPSOBJ= \
- dk3bm.o \
- dk3bmeo.o \
- dk3bmep.o \
- dk3bmeps.o \
- dk3bmj.o \
- dk3pdf.o \
- dk3paper.o
-
-# Objects for libdk3fig.so or libdk3fig.a library
-LIBDK3FIGOBJ= \
- dk3figbb.o \
- dk3figpr.o \
- dk3figah.o \
- dk3figrd.o \
- dk3figto.o \
- dk3fig.o \
- dk3font.o \
- dk3ct.o
-
-# Objects for libdk3wx.so or libdk3wx.a library
-LIBDK3WXOBJ= \
- DkWxProgressDialog.o \
- DkWxCommunicator.o \
- DkWxFrame.o \
- DkWxDialog.o \
- DkWxHelpController.o \
- DkWxAppHelper.o \
- DkWxColorView.o \
- DkWxBufferedControl.o \
- DkWxProcessingIdleController.o \
- DkWxProcessingController.o \
- dk3wxs.o
-
-# Objects for libdk3.a library
-LIBDK3ALLOBJ= $(LIBDK3WXOBJ) \
- $(LIBDK3FIGOBJ) \
- $(LIBDK3BMEPSOBJ) \
- $(LIBDK3BIFOBJ) \
- $(LIBDK3CSRNDOBJ) \
- $(LIBDK3DBIOBJ) \
- $(LIBDK3OFOBJ) \
- $(LIBDK3COBJ)
+# DK3 libraries
+# -------------
libdk3.a: # Large library containing all dktools-3 modules.
libdk3.a: $(LIBDK3ALLOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3ALLOBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2266,804 +2918,630 @@ LIBDK3TRACELIBF=
LIBDK3TRACELIBS=
libdk3trace.so: # The libdk3trace library (shared)
-libdk3trace.so: $(LIBDK3TRACELIBF) dk3trace.o
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) dk3trace.o $(LIBDK3TRACELIBS)
- $(LN_S) $@.$(SOVERS) $@
+libdk3trace.so: $(LIBDK3TRACELIBF) dk3trace.$(OBJEXT)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) dk3trace.$(OBJEXT) $(LIBDK3TRACELIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3trace.a: # The libdk3trace library (static)
-libdk3trace.a: dk3trace.o
- -[ ! -f $@ ] || rm -f $@
- $(AR) -r $@ dk3trace.o
+libdk3trace.a: dk3trace.$(OBJEXT)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ $(AR) -r $@ dk3trace.$(OBJEXT)
$(RANLIB) $@
chmod 644 $@
LIBDK3CLIBF=
-LIBDK3CLIBS=$(BZLIB) $(ZLIB) -lm
+LIBDK3CLIBS=
libdk3c.so: # The libdk3c library (shared).
libdk3c.so: $(LIBDK3CLIBF) $(LIBDK3COBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3COBJ) $(LIBDK3CLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK3COBJ) $(LIBDK3CLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3c.a: # The libdk3c library (static).
libdk3c.a: $(LIBDK3COBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3COBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK3OFLIBF=libdk3c.so
-LIBDK3OFLIBS=-ldk3c $(BZLIB) $(ZLIB)
+LIBDK3OFLIBF=
+LIBDK3OFLIBS=
libdk3of.so: # The dktools-3 output filter library (shared).
libdk3of.so: $(LIBDK3OFLIBF) $(LIBDK3OFOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3OFOBJ) $(LIBDK3OFLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK3OFOBJ) $(LIBDK3OFLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3of.a: # The dktools-3 output filter library (static).
libdk3of.a: $(LIBDK3OFOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3OFOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK3CSRNDLIBF=libdk3c.so
-LIBDK3CSRNDLIBS=-ldk3c $(CRYPTO)
+LIBDK3CSRNDLIBF=
+LIBDK3CSRNDLIBS=
libdk3csrnd.so: # The dktools-3 checksum and random library (shared).
libdk3csrnd.so: $(LIBDK3CSRNDLIBF) $(LIBDK3CSRNDOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3CSRNDOBJ) $(LIBDK3CSRNDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK3CSRNDOBJ) $(LIBDK3CSRNDLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3csrnd.a: # The dktools-3 checksum and random library (static).
libdk3csrnd.a: $(LIBDK3CSRNDOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3CSRNDOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK3BIFLIBF=libdk3c.so
-LIBDK3BIFLIBS=-ldk3c $(IMGLIBS)
+LIBDK3BIFLIBF=
+LIBDK3BIFLIBS=
libdk3bif.so: # the dktools-3 bitmap image file library (shared).
libdk3bif.so: $(LIBDK3BIFLIBF) $(LIBDK3BIFOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3BIFOBJ) $(LIBDK3BIFLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK3BIFOBJ) $(LIBDK3BIFLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3bif.a: # the dktools-3 bitmap image file library (static).
libdk3bif.a: $(LIBDK3BIFOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3BIFOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK3DBILIBF=libdk3c.so
-LIBDK3DBILIBS=-ldk3c $(DBLIB)
-
+LIBDK3DBILIBF=
+LIBDK3DBILIBS=
libdk3dbi.so: # The dktools-3 data base interface library (shared).
libdk3dbi.so: $(LIBDK3DBILIBF) $(LIBDK3DBIOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3DBIOBJ) $(LIBDK3DBILIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK3DBIOBJ) $(LIBDK3DBILIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3dbi.a: # The dktools-3 data base interface library (static).
libdk3dbi.a: $(LIBDK3DBIOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3DBIOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK3BMEPSLIBF=libdk3c.so libdk3of.so libdk3bif.so
-LIBDK3BMEPSLIBS=-ldk3bif -ldk3of -ldk3c -lm
+LIBDK3BMEPSLIBF=
+LIBDK3BMEPSLIBS=
libdk3bmeps.so: # The dktools-3 bitmap to EPS library (shared).
libdk3bmeps.so: $(LIBDK3BMEPSLIBF) $(LIBDK3BMEPSOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3BMEPSOBJ) $(LIBDK3BMEPSLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK3BMEPSOBJ) $(LIBDK3BMEPSLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3bmeps.a: # The dktools-3 bitmap to EPS library (static).
libdk3bmeps.a: $(LIBDK3BMEPSOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3BMEPSOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK3FIGLIBF=libdk3c.so
-LIBDK3FIGLIBS=-ldk3c -lm
+LIBDK3FIGLIBF=
+LIBDK3FIGLIBS=
libdk3fig.so: # The dktools-3 Fig file library (shared).
libdk3fig.so: $(LIBDK3FIGLIBF) $(LIBDK3FIGOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3FIGOBJ) $(LIBDK3FIGLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK3FIGOBJ) $(LIBDK3FIGLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3fig.a: # The dktools-3 Fig file library (static).
libdk3fig.a: $(LIBDK3FIGOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3FIGOBJ)
$(RANLIB) $@
chmod 644 $@
-LIBDK3WXLIBF=libdk3c.so
-LIBDK3WXLIBS=-ldk3c $(WXLDFLAGS)
+LIBDK3WXLIBF=
+LIBDK3WXLIBS=
libdk3wx.so: # The dktools-3 GUI library (shared).
libdk3wx.so: $(LIBDK3WXLIBF) $(LIBDK3WXOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3WXOBJ) $(LIBDK3WXLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"
+ @echo '### Link so (C) ' $@
+ $(CXX) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS) $(LIBDK3WXOBJ) $(LIBDK3WXLIBS)
+ ln -s $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3wx.a: # The dktools-3 GUI library (static).
libdk3wx.a: $(LIBDK3WXOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @-[ ! -f "$@" ] || rm -f "$@"
$(AR) -r $@ $(LIBDK3WXOBJ)
$(RANLIB) $@
chmod 644 $@
+# DK3 programs
+# ------------
+DKWXTRACEOBJ= DkWxTraceApp.$(OBJEXT) \
+ DkWxTraceFrame.$(OBJEXT) \
+ DkWxTraceThread.$(OBJEXT) \
+ DkWxTraceOptionsDialog.$(OBJEXT) \
+ dkct-str-gui.$(OBJEXT) \
+ dkct-tr-gui.$(OBJEXT) \
+ dkct-au-gui.$(OBJEXT) \
+ dkct-gui-gui.$(OBJEXT) \
+ dkct-to-gui.$(OBJEXT)
-DKCTOBJ= dkct.o dkct-str.o dkct-tr.o dkct-au.o dkct-gui.o dkct-to.o
-
-DKCTLIBF=libdk3.a
-DKCTLIBS=-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)
-
-dkct: # Program: Dirk Krause's C tool (CLI)
-dkct$(EXEEXT): $(DKCTLIBF) $(DKCTOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(DKCTOBJ) $(DKCTLIBS)
- chmod 755 $@
-
-
-
-ADDCTRLDLIBF=libdk3.a
-ADDCTRLDLIBS=-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)
-
-addctrld: # Program: Filter to ensure Ctrl-D as final byte
-addctrld$(EXEEXT): $(ADDCTRLDLIBF) addctrld.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ addctrld.o $(ADDCTRLDLIBS)
- chmod 755 $@
-
-
-
-BMPPOBJ= bmeps3.o
-
-BMPPLIBF=libdk3.a
-BMPPLIBS=-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
+WXDKCTLIBF=libdk3.a
+WXDKCTLIBS=libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
-bmpp: # Program: Bitmap to PS/PDF converter (CLI)
-bmpp$(EXEEXT): $(BMPPLIBF) $(BMPPOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(BMPPOBJ) $(BMPPLIBS)
+wxdkct: # Program: Dirk Krause's C tool (GUI)
+wxdkct$(EXEEXT): $(WXDKCTLIBF) $(DKWXTRACEOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(DKWXTRACEOBJ) $(WXDKCTLIBS)
chmod 755 $@
-FIG2LATOBJ= fig2lat.o f2lopt.o f2lud.o f2ludpat.o f2lpgf.o f2lpdf.o \
- f2leps.o f2lsvg.o f2lsvgst.o f2lto.o f2lpara.o
+WXIMGSZOBJ= DkWxImgszApp.$(OBJEXT) \
+ DkWxImgszFrame.$(OBJEXT) \
+ DkWxImgszOptionsDialog.$(OBJEXT)
-FIG2LATLIBF=libdk3.a
-FIG2LATLIBS=-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
+WXIMGSZOBJ= WximgszApp.$(OBJEXT) \
+ WximgszFrame.$(OBJEXT)
-fig2lat: # Program: Fig to LaTeX converter
-fig2lat$(EXEEXT): $(FIG2LATLIBF) $(FIG2LATOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(FIG2LATOBJ) $(FIG2LATLIBS)
- chmod 755 $@
-
-
-
-HTMLBOOKOBJ= htmlbook.o hbnode.o hbconf.o hbhtml.o hbtool.o hbindex.o \
- hbcont.o hbimgdim.o hbchm.o
-
-HTMLBOOKLIBF=libdk3.a
-HTMLBOOKLIBS=-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
+WXIMGSZLIBF=libdk4.a
+WXIMGSZLIBS=libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
-htmlbook: # Program: HTML book creator
-htmlbook$(EXEEXT): $(HTMLBOOKLIBF) $(HTMLBOOKOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(HTMLBOOKOBJ) $(HTMLBOOKLIBS)
- chmod 755 $@
-
-
-
-DK3INFOLIBF=libdk3.a
-DK3INFOLIBS=-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)
-
-dk3info: # Program: Information about this installation
-dk3info$(EXEEXT): $(DK3INFOLIBF) dk3info.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk3info.o $(DK3INFOLIBS)
+wximgsz: # Program: Image scale suggestions
+wximgsz$(EXEEXT): $(WXIMGSZLIBF) $(WXIMGSZOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXIMGSZOBJ) $(WXIMGSZLIBS)
chmod 755 $@
-PLPDFTEXLIBF=libdk3.a
-PLPDFTEXLIBS=-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
-
-plpdftex: # Program: Plot driver for octpgfpl package
-plpdftex$(EXEEXT): $(PLPDFTEXLIBF) plpdftex.o plptcol.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ plpdftex.o plptcol.o $(PLPDFTEXLIBS)
- chmod 755 $@
-
-
+WXDKCLOCKOBJ= DkClockApp.$(OBJEXT) \
+ DkClockFrame.$(OBJEXT) \
+ DkClockOptionsDialog.$(OBJEXT) \
+ DkClockView.$(OBJEXT) \
+ DkClockData.$(OBJEXT) \
+ DkClockTaskbarIcon.$(OBJEXT)
-DKWXWIZLIBF=libdk3.a
-DKWXWIZLIBS=-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)
+WXDKCLOCKLIBF=libdk3.a
+WXDKCLOCKLIBS=libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
-dkwxwiz: # Program: Create dktools/wxwidgets based projects
-dkwxwiz$(EXEEXT): $(DKWXWIZLIBF) dkwxwiz.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dkwxwiz.o $(DKWXWIZLIBS)
+wxdkclock: # Program: Screen clock with alert
+wxdkclock$(EXEEXT): $(WXDKCLOCKLIBF) $(WXDKCLOCKOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXDKCLOCKOBJ) $(WXDKCLOCKLIBS)
chmod 755 $@
-# Some special modules for GUI programs
-
-dkct-str-gui.cpp: dkct-str.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-str.c > $@
-
-dkct-tr-gui.cpp: dkct-tr.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-tr.c > $@
-
-dkct-au-gui.cpp: dkct-au.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-au.c > $@
-
-dkct-gui-gui.cpp: dkct-gui.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-gui.c > $@
-
-dkct-to-gui.cpp: dkct-to.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-to.c > $@
-
-dk3bm-gui.cpp: dk3bm.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3bm.c > $@
-
-dk3bmj-gui.cpp: dk3bmj.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3bmj.c > $@
-
-dk3pdf-gui.cpp: dk3pdf.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3pdf.c > $@
-
-dk3bifa-gui.cpp: dk3bifa.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3bifa.c > $@
-
-dk3bif-gui.cpp: dk3bif.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3bif.c > $@
-
+WXDKHTBOBJ= DkWxHtbApp.$(OBJEXT) \
+ DkWxHtbFrame.$(OBJEXT)
+WXDKHTBLIBF=libdk3.a
+WXDKHTBLIBS=libdk3.a $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)
-DKWXTRACEOBJ= DkWxTraceApp.o DkWxTraceFrame.o DkWxTraceThread.o \
- DkWxTraceOptionsDialog.o \
- dkct-str-gui.o dkct-tr-gui.o dkct-au-gui.o dkct-gui-gui.o dkct-to-gui.o
-
-WXDKCTLIBF=libdk3.a
-WXDKCTLIBS=-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
-
-wxdkct: # Program: Dirk Krause's C tool (GUI)
-wxdkct$(EXEEXT): $(WXDKCTLIBF) $(DKWXTRACEOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(DKWXTRACEOBJ) $(WXDKCTLIBS)
+wxdkhtb: # Program: Viewer for htb help files
+wxdkhtb$(EXEEXT): $(WXDKHTBLIBF) $(WXDKHTBOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXDKHTBOBJ) $(WXDKHTBLIBS)
chmod 755 $@
-WXBMPPOBJ= DkWxBmepsApp.o DkWxBmepsFrame.o DkWxBmepsThread.o \
- DkWxBmepsOptionsDialog.o \
- dk3bm-gui.o dk3bmj-gui.o dk3bmeo.o dk3bmeps.o dk3pdf-gui.o dk3paper.o \
- dk3bifa-gui.o dk3bif-gui.o dk3pixre.o
-
-WXBMPP2OBJ= \
- DkWxProgressDialog.o DkWxFrame.o DkWxAppHelper.o DkWxHelpController.o \
- DkWxCommunicator.o DkWxColorView.o dk3wxs.o dk3opt.o dk3app.o \
- dk3wreg.o dk3of.o dk3strm.o dk3sto.o dk3dir.o dk3enc.o dk3str.o \
- dk3sf.o dk3maui.o dk3mal.o dk3maul.o dk3mad.o dk3madlc.o \
- dk3maidd.o dk3maodd.o dk3maid8.o dk3maod8.o dk3madfo.o dk3madso.o \
- dk3madsi.o dk3inst.o dk3srch.o dk3bits.o dk3mem.o dk3trace.o
+WINPRINTOBJ= WinprintApp.$(OBJEXT) \
+ WinprintFrame.$(OBJEXT) \
+ WinprintThread.$(OBJEXT) \
+ WinprintChooserDialog.$(OBJEXT) \
+ dk3print.$(OBJEXT) \
+ dk3prcfg.$(OBJEXT) \
+ dk3prreq.$(OBJEXT)
-WXBMPPLIBF=libdk3.a
-WXBMPPLIBS=-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
+WINPRINTLIBF=libdk3.a
+WINPRINTLIBS=libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
-wxbmpp: # Program: Bitmap to PS/PDF converter (GUI)
-wxbmpp$(EXEEXT): $(WXBMPPLIBF) $(WXBMPPOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXBMPPOBJ) $(WXBMPPLIBS)
+winprint$(EXEEXT): $(WINPRINTLIBF) $(WINPRINTOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CXX) $(LDFLCXX_CLI_DK) -o $@ $(WINPRINTOBJ) $(WINPRINTLIBS)
chmod 755 $@
-WXDKFCSOBJ= Dk4FcsApp.o Dk4FcsFrame.o
+DKWXPATHOBJ= DkWxPathApp.$(OBJEXT) \
+ DkWxPathFrame.$(OBJEXT)
-WXDKFCSLIBF=libdk4.a
-WXDKFCSLIBS=-ldk4 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)
+DKWXPATHLIBF=libdk3.a
+DKWXPATHLIBS=libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
-wxdkfcs: # Program: File checksums with GUI
-wxdkfcs$(EXEEXT): $(WXDKFCSLIBF) $(WXDKFCSOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXDKFCSOBJ) $(WXDKFCSLIBS)
+dkwxpath$(EXEEXT): $(DKWXPATHLIBF) $(DKWXPATHOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CXX) $(LDFLCXX_CLI_DK) -o $@ $(DKWXPATHOBJ) $(DKWXPATHLIBS)
chmod 755 $@
-WXIMGSZOBJ= DkWxImgszApp.o DkWxImgszFrame.o DkWxImgszOptionsDialog.o
+DKCTOBJ= dkct.$(OBJEXT) \
+ dkct-str.$(OBJEXT) \
+ dkct-tr.$(OBJEXT) \
+ dkct-au.$(OBJEXT) \
+ dkct-gui.$(OBJEXT) \
+ dkct-to.$(OBJEXT)
-WXIMGSZLIBF=libdk3.a
-WXIMGSZLIBS=-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
+DKCTLIBF=libdk3.a
+DKCTLIBS=libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)
-wximgsz: # Program: Image scale suggestions
-wximgsz$(EXEEXT): $(WXIMGSZLIBF) $(WXIMGSZOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXIMGSZOBJ) $(WXIMGSZLIBS)
+dkct: # Program: Dirk Krause's C tool (CLI)
+dkct$(EXEEXT): $(DKCTLIBF) $(DKCTOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKCTOBJ) $(DKCTLIBS)
chmod 755 $@
-WXDKCLOCKOBJ= DkClockApp.o DkClockFrame.o DkClockOptionsDialog.o \
- DkClockView.o DkClockData.o DkClockTaskbarIcon.o
+HTMLBOOKOBJ= htmlbook.$(OBJEXT) \
+ hbnode.$(OBJEXT) \
+ hbconf.$(OBJEXT) \
+ hbhtml.$(OBJEXT) \
+ hbtool.$(OBJEXT) \
+ hbindex.$(OBJEXT) \
+ hbcont.$(OBJEXT) \
+ hbimgdim.$(OBJEXT) \
+ hbchm.$(OBJEXT)
-WXDKCLOCKLIBF=libdk3.a
-WXDKCLOCKLIBS=-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
+HTMLBOOKLIBF=libdk3.a
+HTMLBOOKLIBS=libdk3.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)
-wxdkclock: # Program: Screen clock with alert
-wxdkclock$(EXEEXT): $(WXDKCLOCKLIBF) $(WXDKCLOCKOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXDKCLOCKOBJ) $(WXDKCLOCKLIBS)
+htmlbook: # Program: HTML book creator
+htmlbook$(EXEEXT): $(HTMLBOOKLIBF) $(HTMLBOOKOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(HTMLBOOKOBJ) $(HTMLBOOKLIBS)
chmod 755 $@
-WXDKHTBOBJ= DkWxHtbApp.o DkWxHtbFrame.o
+FIG2LATOBJ= fig2lat.$(OBJEXT) \
+ f2lopt.$(OBJEXT) \
+ f2lud.$(OBJEXT) \
+ f2ludpat.$(OBJEXT) \
+ f2lpgf.$(OBJEXT) \
+ f2lpdf.$(OBJEXT) \
+ f2leps.$(OBJEXT) \
+ f2lsvg.$(OBJEXT) \
+ f2lsvgst.$(OBJEXT) \
+ f2lto.$(OBJEXT) \
+ f2lpara.$(OBJEXT)
-WXDKHTBLIBF=libdk3.a
-WXDKHTBLIBS=-ldk3 $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)
+FIG2LATLIBF=libdk3.a
+FIG2LATLIBS=libdk3.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm
-wxdkhtb: # Program: Viewer for htb help files
-wxdkhtb$(EXEEXT): $(WXDKHTBLIBF) $(WXDKHTBOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXDKHTBOBJ) $(WXDKHTBLIBS)
+fig2lat: # Program: Fig to LaTeX converter
+fig2lat$(EXEEXT): $(FIG2LATLIBF) $(FIG2LATOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(FIG2LATOBJ) $(FIG2LATLIBS)
chmod 755 $@
-ITADMINOBJ= itadmin.o itaconf.o itadata.o itamysql.o itareg.o itamem.o \
- itacomp.o itange.o itahosts.o itaether.o itadhcp.o itanetd.o italic.o \
- itatool.o dk3uc2l.o
+ITADMINOBJ= itadmin.$(OBJEXT) \
+ itaconf.$(OBJEXT) \
+ itadata.$(OBJEXT) \
+ itamysql.$(OBJEXT) \
+ itareg.$(OBJEXT) \
+ itamem.$(OBJEXT) \
+ itacomp.$(OBJEXT) \
+ itange.$(OBJEXT) \
+ itahosts.$(OBJEXT) \
+ itaether.$(OBJEXT) \
+ itadhcp.$(OBJEXT) \
+ itanetd.$(OBJEXT) \
+ italic.$(OBJEXT) \
+ itatool.$(OBJEXT) \
+ dk3uc2l.$(OBJEXT)
ITADMINLIBF=libdk3.a
-ITADMINLIBS=-ldk3 -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) $(RTLIB)
+ITADMINLIBS=libdk3.a $(MYSQLLIB) $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) $(RTLIB)
itadmin: # Program: IT administration tool
itadmin$(EXEEXT): $(ITADMINLIBF) $(ITADMINOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(MYSQLLDFLAGS) -o $@ $(ITADMINOBJ) $(ITADMINLIBS)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C++)' $@
+ $(CC) $(LDFLC_CLI_DK) $(MYSQLLDFLAGS) -o $@ $(ITADMINOBJ) $(ITADMINLIBS)
chmod 755 $@
-# ##### End of dktols-3 section
+DKWXWIZLIBF=libdk3.a
+DKWXWIZLIBS=libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)
+DKWXWIZOBJ= dkwxwiz.$(OBJEXT)
-tests: testprogs
- ./test-dk4maac < test-data/dk4maac.in > test-data/dk4maac.out
- ./test-dk4maauc < test-data/dk4maauc.in > test-data/dk4maauc.out
+dkwxwiz: # Program: Create dktools/wxwidgets based projects
+dkwxwiz$(EXEEXT): $(DKWXWIZLIBF) $(DKWXWIZOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKWXWIZOBJ) $(DKWXWIZLIBS)
+ chmod 755 $@
-testprogs: $(TESTPROGS)
- @echo 'Finished building test programs.'
-test-dk4maac: test-dk4maac.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L.-o $@ test-dk4maac.o -ldk4
- chmod 755 $@
-test-dk4maauc: test-dk4maauc.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maauc.o -ldk4
- chmod 755 $@
+DKWTOBJ= dkwt.$(OBJEXT) \
+ dkwt-ac.$(OBJEXT) \
+ dkwt-ev.$(OBJEXT) \
+ dkwt-cp.$(OBJEXT) \
+ dkwt-gr.$(OBJEXT) \
+ dkwt-pr.$(OBJEXT) \
+ dkwt-env.$(OBJEXT) \
+ dkwt-to.$(OBJEXT)
-test-dk4maas: test-dk4maas.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maas.o -ldk4
- chmod 755 $@
+DKWTLIBF=libdk3.a
+DKWTLIBS=libdk3.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)
-test-dk4maaus: test-dk4maaus.o
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maaus.o -ldk4
+dkwt$(EXEEXT): $(DKWTLIBF) $(DKWTOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKWTOBJ) $(DKWTLIBS)
chmod 755 $@
-test-dk4maai: test-dk4maai.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maai.o -ldk4
- chmod 755 $@
-test-dk4maaui: test-dk4maaui.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maaui.o -ldk4
- chmod 755 $@
-test-dk4maal: test-dk4maal.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maal.o -ldk4
- chmod 755 $@
+WPRCLEANOBJ= wprclean.$(OBJEXT) \
+ dk3print.$(OBJEXT) \
+ dk3prcfg.$(OBJEXT) \
+ dk3prreq.$(OBJEXT)
-test-dk4maaul: test-dk4maaul.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maaul.o -ldk4
- chmod 755 $@
+WPRCLEANLIBF=libdk3.a
+WPRCLEANLIBS=libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)
-test-dk4maall: test-dk4maall.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maall.o -ldk4
+wprclean$(EXEEXT): $(WPRCLEANLIBF) $(WPRCLEANOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(WPRCLEANOBJ) $(WPRCLEANLIBS)
chmod 755 $@
-test-dk4maaull: test-dk4maaull.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maaull.o -ldk4
- chmod 755 $@
+DK3INFOLIBF=libdk3.a
+DK3INFOLIBS=libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)
-test-dk4maami: test-dk4maami.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maami.o -ldk4
- chmod 755 $@
+DK3INFOOBJ= dk3info.$(OBJEXT)
-test-dk4maamu: test-dk4maamu.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maamu.o -ldk4
+dk3info: # Program: Information about this installation
+dk3info$(EXEEXT): $(DK3INFOLIBF) $(DK3INFOOBJ)
+ @-[ ! -f "$@" ] || rm -f "$@"
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DK3INFOOBJ) $(DK3INFOLIBS)
chmod 755 $@
-test-dk4str8: test-dk4str8.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4str8.o -ldk4
- chmod 755 $@
-test-dk4loc: test-dk4loc.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4loc.o -ldk4
- chmod 755 $@
+# Special dependencies
+# ====================
-test-dk4mai8ddu: test-dk4mai8ddu.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4mai8ddu.o -ldk4
- chmod 755 $@
+# Modules used for both dkct and wxdkct
+# -------------------------------------
-test-dk4mai8ddi: test-dk4mai8ddi.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4mai8ddi.o -ldk4
- chmod 755 $@
+dkct-au-gui.cpp: dkct-au.c
+ cp -f $< $@
-test-dk4mai8dsz: test-dk4mai8dsz.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4mai8dsz.o -ldk4
- chmod 755 $@
+dkct-gui-gui.cpp: dkct-gui.c
+ cp -f $< $@
-test-dk4time: test-dk4time.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4time.o -ldk4
- chmod 755 $@
+dkct-str-gui.cpp: dkct-str.c
+ cp -f $< $@
-test-dk4exep8: test-dk4exep8.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4exep8.o -ldk4
- chmod 755 $@
+dkct-to-gui.cpp: dkct-to.c
+ cp -f $< $@
-test-dk4path8: test-dk4path8.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4path8.o -ldk4
- chmod 755 $@
+dkct-tr-gui.cpp: dkct-tr.c
+ cp -f $< $@
-ex-sto: ex-sto.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ ex-sto.o -ldk4
- chmod 755 $@
-test-dk4strm: test-dk4strm.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4strm.o -ldk4
- chmod 755 $@
+# Resource files
+# --------------
-test-dk4numl: test-dk4numl.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4numl.o -ldk4
- chmod 755 $@
+addctrldres.$(RESEXT): addctrld.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4tsp08: test-dk4tsp08.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4tsp08.o -ldk4
- chmod 755 $@
+bmppres.$(RESEXT): bmpp.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-bool: test-bool.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-bool.o -ldk4
- chmod 755 $@
+dk3infores.$(RESEXT): dk3info.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4enc: test-dk4enc.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4enc.o -ldk4
- chmod 755 $@
+dk4infores.$(RESEXT): dk4info.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4user: test-dk4user.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4user.o -ldk4
- chmod 755 $@
+dk-bin2cres.$(RESEXT): dk-bin2c.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4mai8dbl: test-dk4mai8dbl.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4mai8dbl.o -ldk4
- chmod 755 $@
+dk-blksres.$(RESEXT): dk-blks.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-fne: test-fne.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-fne.o -ldk4
- chmod 755 $@
+dk-bmmres.$(RESEXT): dk-bmm.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-mkdir: test-mkdir.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-mkdir.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-catres.$(RESEXT): dk-cat.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-deldir: test-deldir.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-deldir.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkctres.$(RESEXT): dkct.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4dir08: test-dk4dir08.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4dir08.o -ldk4
- chmod 755 $@
+dk-db2tres.$(RESEXT): dk-db2t.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4dir: test-dk4dir.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4dir.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-dbcores.$(RESEXT): dk-dbco.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-deltree: test-deltree.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-deltree.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkdbtres.$(RESEXT): dkdbt.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-filei: test-filei.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-filei.o -ldk4
- chmod 755 $@
+dk-eradiskres.$(RESEXT): dk-eradisk.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4time08: test-dk4time08.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4time08.o -ldk4
- chmod 755 $@
+dk-ficres.$(RESEXT): dk-fic.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-eradisk: test-eradisk.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-eradisk.o -ldk4
- chmod 755 $@
+dk-hexres.$(RESEXT): dk-hex.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-a85e: test-a85e.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-a85e.o -ldk4
- chmod 755 $@
+dk-linesres.$(RESEXT): dk-lines.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-a85d: test-a85d.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-a85d.o -ldk4
- chmod 755 $@
+dk-lsres.$(RESEXT): dk-ls.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-rle: test-rle.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-rle.o -ldk4
- chmod 755 $@
+dk-pwdres.$(RESEXT): dk-pwd.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-rld: test-rld.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-rld.o -ldk4
- chmod 755 $@
+dk-pwgenres.$(RESEXT): dk-pwgen.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-binenc: test-binenc.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-binenc.o -ldk4
- chmod 755 $@
+dk-randres.$(RESEXT): dk-rand.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-sock: test-sock.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-sock.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-recvres.$(RESEXT): dk-recv.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-inet-pton: test-inet-pton.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-inet-pton.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-sendres.$(RESEXT): dk-send.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-peer: test-peer.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-peer.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-sortres.$(RESEXT): dk-sort.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-membuf: test-membuf.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-membuf.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-sqlsplitres.$(RESEXT): dk-sqlsplit.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4wxah: test-dk4wxah.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4wxah.o -ldk4 $(WXLDFLAGS) $(IMGLIBS) $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-t2dbres.$(RESEXT): dk-t2db.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-TESTCONTAINEROBJ= test-container.o Dk4Comparable.o
+dk-t2hres.$(RESEXT): dk-t2h.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-container: $(TESTCONTAINEROBJ) libdk4.a
- $(LDCPP) -o $@ $(TESTCONTAINEROBJ) libdk4.a $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-t2lres.$(RESEXT): dk-t2l.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-skip: test-skip.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-skip.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkwtadmres.$(RESEXT): dkwtadm.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-opt: test-opt.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-opt.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkwtres.$(RESEXT): dkwt.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-udpa: test-udpa.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-udpa.o -ldk4 $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkwxpathres.$(RESEXT): dkwxpath.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-sqdbl: test-sqdbl.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-sqdbl.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkwxwizres.$(RESEXT): dkwxwiz.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-ser: test-ser.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-ser.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+fig2latres.$(RESEXT): fig2lat.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-unser: test-unser.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-unser.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+htmlbookres.$(RESEXT): htmlbook.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-strmw: test-strmw.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-strmw.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+itadminres.$(RESEXT): itadmin.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-strms: test-strms.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-strms.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+lprngclres.$(RESEXT): lprngcl.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-strmu: test-strmu.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-strmu.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+plpdftexres.$(RESEXT): plpdftex.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-mbstr: test-mbstr.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-mbstr.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+winprintres.$(RESEXT): winprint.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4strmco: test-dk4strmco.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4strmco.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wprcleanres.$(RESEXT): wprclean.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-paper: test-paper.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-paper.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxdkdrawres.$(RESEXT): wxdkdraw.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-testlzw: testlzw.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ testlzw.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxbmppres.$(RESEXT): wxbmpp.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-testlzws: testlzws.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ testlzws.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxdkclockres.$(RESEXT): wxdkclock.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-test-dk4c8dbl: test-dk4c8dbl.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4c8dbl.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxdkctres.$(RESEXT): wxdkct.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-distclean: # Clean up (remove build and configure script results)
-distclean: clean
- -[ ! -f confdefs.h ] || rm -fr confdefs.h
- -[ ! -f config.h ] || rm -fr config.h
- -[ ! -f config.log ] || rm -fr config.log
- -[ ! -f config.status ] || rm -fr config.status
- -[ ! -f conftest ] || rm -fr conftest
- -[ ! -f conftest.c ] || rm -fr conftest.c
- -[ ! -f conftest.er1 ] || rm -fr conftest.er1
- -[ ! -f config.h ] || rm -f config.h
- -[ ! -f scripts/wr-dk3inst.sh ] || rm -f scripts/wr-dk3inst.sh
- -[ ! -f scripts/wr-dk4inst.sh ] || rm -f scripts/wr-dk4inst.sh
- -[ ! -f scripts/create-desktop-files.sh ] || rm -f scripts/create-desktop-files.sh
- -[ ! -f initd-printqd ] || rm -f initd-printqd
- -[ ! -f dktools.pc ] || rm -f dktools.pc
+wxdkfcsres.$(RESEXT): wxdkfcs.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-maketest: # Test: Check availability of make programs.
-maketest:
- @echo OK
+wxdkhtbres.$(RESEXT): wxdkhtb.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-cleanest: # NOT FOR END USER: Clean up completely
-cleanest: distclean
- -[ ! -d autom4te.cache ] || rm -fr autom4te.cache
- scripts/clean-resources.sh
- find help-htb -type f -exec rm -f {} \;
- find help-chm -type f -exec rm -f {} \;
- find help-html -type f -exec rm -f {} \;
- find doc/html -type f -exec rm -f {} \;
- -[ ! -d doc/doxygen ] || find doc/doxygen -type f -exec rm -f {} \;
- -[ ! -f dk4info1.c ] || rm -f dk4info1.c
- -find help-src -name '*.html' -exec rm -f {} \;
- -find help-src -name '*.hhc' -exec rm -f {} \;
- -find help-src -name '*.hhk' -exec rm -f {} \;
- -find help-src -name '*.hhp' -exec rm -f {} \;
- -find help-src -name '*.aux' -exec rm -f {} \;
- -find doc/src -name '*.html' -exec rm -f {} \;
- -find doc/src -name '*.hhc' -exec rm -f {} \;
- -find doc/src -name '*.hhk' -exec rm -f {} \;
- -find doc/src -name '*.hhp' -exec rm -f {} \;
- -find doc/src -name '*.aux' -exec rm -f {} \;
- -find dktools -name '*.chm' -exec rm {} \;
- -find dktools -name '*.htb' -exec rm {} \;
- -find . -name '*.ico' -exec rm -f {} \;
- -find . -name '*.xpm' -exec rm -f {} \;
- -[ ! -x ./scripts/clean.sh ] || ./scripts/clean.sh
- -[ ! -x ./scripts/clean-for-fig.sh ] || ./scripts/clean-for-fig.sh
- -[ ! -x ./scripts/clean-for-tex.sh ] || ./scripts/clean-for-tex.sh
- -rm -fr *.rc
- -rm -fr *-gui.cpp
+wxdkscrszres.$(RESEXT): wxdkscrsz.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
+wximgszres.$(RESEXT): wximgsz.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-check-cleanest: # NOT FOR END USER: Check for unlisted files
-check-cleanest: cleanest
- perl scripts/filechk.pl
+wxpqdicres.$(RESEXT): wxpqdic.$(RCEXT)
+ $(RC) $(RCFLAGS) $< $@
-distrenew: # NOT FOR END USER: Renew files before creating distro
-distrenew: check-cleanest
- dkct -l
- find . -type f -exec touch {} \;
- sleep 2
- find . -name '*.pdf' -exec touch {} \;
- sleep 2
- find . -name '*.svg' -exec touch {} \;
- sleep 2
- find . -name '*.png' -exec touch {} \;
- find . -name '*.ico' -exec touch {} \;
- find . -name '*.xpm' -exec touch {} \;
- scripts/update-doxyfile.sh
- doxygen
- scripts/mkrc.pl
- scripts/make-resources.sh
- scripts/build-help.sh
- scripts/doc-install.sh
- scripts/man-install.sh
- scripts/transform-config.pl
- autoconf
- scripts/create-spec-iss.sh
- scripts/create-debian-changelog.pl > debian/changelog
+# Test programs
+# =============
+# Test programs typically consist of one module.
-dist: # NOT FOR END USER: Create distro archives
-dist: distrenew
- scripts/create-distribution.sh
-
-doxydoc: # NOT FOR END USER: Documentation created by doxygen
- -[ ! -d doc/doxygen ] || rm -fr doc/doxygen
- -[ ! -f doxygen.out ] || rm -fr doxygen.out
- mkdir doc/doxygen
- chmod 755 doc/doxygen
- doxygen Doxyfile > doxygen.out 2>&1
-
-wprclean2: # Temporary: Base for the wprclean rewrite
-wprclean2$(EXEEXT): wprclean2.o libdk4.a
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ wprclean2.o -ldk4 $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
+.c:
+ -[ ! -f "$@" ] || rm -f "$@"
+ $(CC) $(CFL_CLI_DK) $(LDFLC_CLI_DK) -o $@ $< -L. -ldk4 $(ZLIB) $(BZLIB) -lm
+ chmod 755 $@
+
+.cpp:
+ -[ ! -f "$@" ] || rm -f "$@"
+ $(CXX) $(CXXFL_GUI) $(LDFLCXX_GUI) -o $@ $< -L. -ldk4 $(ZLIB) $(BZLIB) -lm
chmod 755 $@
diff --git a/support/dktools/Makefile.in b/support/dktools/Makefile.in
index 1b97dc7f82..14962cf74e 100644
--- a/support/dktools/Makefile.in
+++ b/support/dktools/Makefile.in
@@ -13,8 +13,7 @@
# ./configure
# make
# make install
-# should be used to install this software.
-#
+# can be used to install this software.
# PACKAGES
# ========
@@ -26,19 +25,35 @@
# ./sl6-prepare.sh
# (2) As unprivileged user run:
# ./sl6-build-rpm.sh
-# (3) Install the RPM:
+# (3) As root install the RPM:
# yum install ~/rpmbuild/RPMS/<arch>/dktools-<version>.rpm
#
-# For Debian Jessie:
-# ------------------
+# For RHEL7 and clones:
+# ---------------------
+# Use ./sl7-prepare.sh and ./sl7-build-rpm.sh instead.
+#
+# For Fedora
+# ----------
+# (1) As root run:
+# ./fc27-prepare.sh
+# (2) As unprivileged user run:
+# ./fc27-build-rpm.sh
+# (3) As root install the RPM
+# yum install ~/rpmbuild/RPMS/<arch>/dktools-<version>.rpm
+#
+# For Debian
+# ----------
# (1) As root run
-# ./debian-jessie-prepare.sh
+# ./debian-prepare.sh
# (2) As unprivileged user run
-# ./debian-jessie-build-deb.sh
-# (3) Install the *.deb package(s):
+# ./debian-build-deb.sh
+# (3) As root install the *.deb package(s):
# dpkg -i ~/.../dktools-<version>.deb
+# Package building
+# ================
+
# Package prefix, used when building packages
# DESTDIR=
@@ -49,7 +64,11 @@ VERSNO=@VERSNO@
SOVERS=@SOVERS@
# Base directory for files on SourceForge
-SFBASE="http://sourceforge.net/projects/dktools/files/dktools"
+SFBASE=http://sourceforge.net/projects/dktools/files/dktools
+
+# Shell used to process commands in this Makefile.
+# Must be Bourne shell or derivative, not C Shell.
+SHELL=/bin/sh
# Path variables set by configure script
prefix=@prefix@
@@ -57,11 +76,16 @@ datarootdir=@datarootdir@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
-libexecdir=@libexecdir@
datadir=${datarootdir}
sysconfdir=@sysconfdir@
scd=${sysconfdir}
+
+# NOTE: libdir is not necessarily /usr/lib, but may be something like
+# /usr/lib/x86_64-linux-gnu on some systems.
+# Use $(prefix)/lib to access /usr/lib and alike
libdir=@libdir@
+
+libexecdir=@libexecdir@
sharedlibdir=${libdir}/shared
mandir=@mandir@
includedir=@includedir@
@@ -69,12 +93,32 @@ localstatedir=@localstatedir@
srcdir=@srcdir@
top_srcdir=@top_srcdir@
VPATH=@srcdir@
+runstatedir=@runstatedir@
+systemddir=@systemddir@
# Compiler commands and options set by configure script
+TOOLCHAIN=@TOOLCHAIN@
+CROSSBUILD=@CROSSBUILD@
+BUILDCLASS=@BUILDCLASS@
+BUILDHOST=@BUILDHOST@
+TARGETCLASS=@TARGETCLASS@
+TARGETHOST=@TARGETHOST@
# Short OS name as returned by the 'uname -s' command
UNAME=@UNAME@
+# A BSD compatible install program
+INSTALL=@INSTALL@
+
+# Program or script to install executable programs
+INSTALL_PROGRAM=@INSTALL_PROGRAM@
+
+# Program or script to install script files
+INSTALL_SCRIPT=@INSTALL_SCRIPT@
+
+# Program or script to install data files
+INSTALL_DATA=@INSTALL_DATA@
+
# C compiler
CC=@CC@
@@ -84,1209 +128,1154 @@ CPP=@CPP@
# C++ compiler
CXX=@CXX@
-# Linker (we use the C compiler driver here as this adds C runtime
-# libraries automaticlly)
+# Invoke linker via compiler front end, ensures to link C/C++ runtime
LD=$(CC)
+LDCPP=$(CXX)
-# Definitions for C and C++ compilers, set to -DHAVE_CONFIG_H by configure
-DEFS=@DEFS@
-
-# Options for C compiler preprocessor
-CPPFLAGS=@CPPFLAGS@ @WINUNICODE@
-
-# Options for C++ compiler
-CXXFLAGS=@CXXFLAGS@ @WINUNICODE@
-
-# Options for C compiler
-CFLAGS=@CFLAGS@ @WINUNICODE@
-
-# Options for linker
+# Compiler and linker flags
+CFLAGS=@CFLAGS@
+CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@
-# Options for C/C++ compiler preprocessor when compiling modules using
-# wxWidgets
-WXCPPFLAGS=@WXCPPFLAGS@
+# Resource compiler
+RC=@WINDRES@
+RCFLAGS=@RCFLAGS@
-# C++ compiler options when compiling modules using wxWidgets
-WXCXXFLAGS=@WXCXXFLAGS@
-
-# C compilter options when compiling modules using wxWidgets
-WXCFLAGS=@WXCFLAGS@
-
-# Linker options when building executables using wxWidgets
-WXLDFLAGS=@WXLDFLAGS@
+# Archiver
+AR=@AR@
-# ?
-LIBS=@LIBS@
+# Archive indexer
+RANLIB=@RANLIB@
-# Relocation path -R... set when compiling using Sun Workshop and
-# LD_LIBRARY_PATH is set
+# Path for dynamic linking on Solaris
RPATH=@RPATH@
RPATHLINK=@RPATHLINK@
+MKSORPATH=@MKSORPATH@
+MKSORPATHLINK=@MKSORPATHLINK@
+MKSOCHECKSYMBOLS=@MKSOCHECKSYMBOLS@
+# Command to create symbolic links
+LN_S=@LN_S@
-# Set to -Wall when all warnings are required
-CWARN=@CWARN@
+# General C, C++ and LD flags
+# ===========================
-# Libraries and features found by configure script
+# Definitions
+DEFS=@DEFS@ -DDK4_BUILDING_DKTOOLS4=1
-# Set to -D_LARGEFILE64_SOURCE=1 if there is 64-bit file support available
-# and needs to be activated explicitly
-FS64=@FS64@
+# Include directories
+IDIRS=-I. -I$(srcdir) -I$(top_srcdir) -I$(includedir)
-# Linker option to use zlib if available
-ZLIB=@ZLIB@
+# Program specific flags
+# ======================
-# Linker option to use bzip2 library if available
-BZLIB=@BZLIB@
+# Flags for wxWidgets library
+# ---------------------------
+WXCPPFLAGS=@WXCPPFLAGS@
+WXCFLAGS=@WXCFLAGS@
+WXCXXFLAGS=@WXCXXFLAGS@
+WXLDFLAGS=@WXLDFLAGS@
+WXVERSION=@WXVERSION@
-# Linker option to use -lcrypto -lssl if available
-CRYPTO=@CRYPTO@
+# LD flags for MySQL
+# ------------------
+MYSQLLDFLAGS=@MYSQLLDFLAGS@
-# Linker option to use -lxnet, -lsocket or none for TCP/IP functionality
-SOCKLIB=@SOCKLIB@
+# Real time library, on some systems required by MySQL
+# ----------------------------------------------------
+RTLIB=@RTLIB@
-# Linker option to use -lxnet, -lnsl, -lsocket or none for name services
+# Socket libraries for network functions
+# --------------------------------------
+SOCKLIB=@SOCKLIB@
NSLLIB=@NSLLIB@
-# Linker options to use tiff, jpeg and png libraries if available
-IMGLIBS=@LIBTIFF@ @LIBJPEG@ @LIBPNG@
+# Compression libraries
+# ---------------------
+ZLIB=@ZLIB@
+BZLIB=@BZLIB@
-# Linker options to use Berkeley DB library
-DBLIB=@DBLIB@
+# Image libraries
+# ---------------
+LIBPNG=@LIBPNG@
+LIBJPEG=@LIBJPEG@
+LIBTIFF=@LIBTIFF@
+IMGLIBS=@LIBTIFF@ @LIBPNG@ @LIBJPEG@
-# Linker options to use socket library required by DBLIB
-DBLIBSOCK=@DBLIBSOCK@
+# Compiler flags to support 64 bit file sizes
+# -------------------------------------------
+FS64=@FS64@
-# Linker options to use NetSNMP libraries and required libraries if available
-NETSNMP_LIBS=@NETSNMP_LIBS@
+# OpenSSL for message digests and random
+# --------------------------------------
+CRYPTO=@CRYPTO@
-# Linker option to use pthread library if available
+# POSIX threads
+# -------------
PTHREADLIB=@PTHREADLIB@
-# Linker option to set path for MySQL library
-MYSQLLDFLAGS=@MYSQLLDFLAGS@
+# Berkeley DB library
+# -------------------
+DBLIB=@DBLIB@
+DBLIBSOCK=@DBLIBSOCK@
-# Linker option for realtime clock library
-RTLIB=@RTLIB@
+# NetSNMP library
+# ---------------
+NETSNMP_LIBS=@NETSNMP_LIBS@
-# AR program to build an archive (a library)
-AR=@AR@
+# MySQL / MariaDB library
+# -----------------------
+MYSQLLIB=@MYSQLLIB@
-# NM program to list symbols from a library
-NM=@NM@
+# Libraries to add on Windows
+# ---------------------------
+WINCLILIB=@WINCLILIB@
+WINGUILIB=@WINGUILIB@
+CLILIB=@CLILIB@
+GUILIB=@GUILIB@
-# RANLIB program to create archive (library) index, only required on
-# some platforms
-RANLIB=@RANLIB@
+# C compiler flags to build modules
+# =================================
-# Command to create soft links
-LN_S=@LN_S@
+# CLI modules using char strings
+CFL_CLI_C8=$(DEFS) $(IDIRS) @CFL_CLI_C8@
-# The make program to build projects
-MAKE=@MAKE@
+# CLI modules using dkChar strings
+CFL_CLI_DK=$(DEFS) $(IDIRS) @CFL_CLI_DK@
-# File name extension for executable files
-EXEEXT=@EXEEXT@
+# CXX compiler flags to build modules
+# ===================================
-# File name extension for object files
-OBJEXT=@OBJEXT@
+# CLI modules using char strings
+CXXFL_CLI_C8=$(DEFS) $(IDIRS) @CXXFL_CLI_C8@
-# List of CLI programs using the NetSNMP libraries
-CLI_SNMPPROG=@CLI_SNMPPROG@
+# CLI modules using dkChar strings
+CXXFL_CLI_DK=$(DEFS) $(IDIRS) @CXXFL_CLI_DK@
-# List of CLI programs using the MySQL library
-CLI_MYSQLPROG=@CLI_MYSQLPROG@
+# CLI modules using wxChar strings
+CXXFL_CLI_WX=$(DEFS) $(IDIRS) @CXXFL_CLI_WX@ $(WXCXXFLAGS)
-# C/C++ compiler flags to build modules for shared libraries
-CFPIC=@CFPIC@
+# CLI modules using wxChar strings
+CXXFL_GUI=$(DEFS) $(IDIRS) @CXXFL_GUI@ $(WXCXXFLAGS)
-# Script to install shared libraries
-INSTALL_LIBS_SHARED=./scripts/install-libs-shared.sh
+# Linker flags when using CC as linker
+# ====================================
-# A BSD compatible install program
-INSTALL=@INSTALL@
+# Use CC as linker for CLI program using char
+LDFLC_CLI_C8=@LDFLC_CLI_C8@
-# Program or script to install executable programs
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
+# Use CC as linker for CLI program using dkChar
+LDFLC_CLI_DK=@LDFLC_CLI_DK@
-# Program or script to install script files
-INSTALL_SCRIPT=@INSTALL_SCRIPT@
+# Linker flags when using C++ as linker
+# =====================================
-# Program or script to install data files
-INSTALL_DATA=@INSTALL_DATA@
+# Use C++ as linker for CLI program using char
+LDFLCXX_CLI_C8=@LDFLCXX_CLI_C8@
-# Base libraries to build the CLI programs on Windows systems
-WINCLILIB=-lkernel32 -lgdi32 -ladvapi32 -luser32 -lnetapi32
+# Use C++ as linker for CLI program using dkChar
+LDFLCXX_CLI_DK=@LDFLCXX_CLI_DK@
-# Additional libraries to build the GUI programs on Windows systems
-WINGUILIB=-lole32 -loleaut32 -lshell32 -lcomctl32 -lcomdlg32 -lwinspool
+# Use C++ as linker for CLI program using wxChar
+LDFLCXX_CLI_WX=@LDFLCXX_CLI_WX@
-# Type of entry point on Windows
-WINENTRY=-municode
+# Use C++ as linker for GUI program using wxChar
+LDFLCXX_GUI=@LDFLCXX_GUI@
-# List of additional libraries to include when building CLI programs
-# $(WINCLILIB) on Windows, empty on other systems
-CLILIB=@CLILIB@
-# List of additional libraries to include when building GUI programs
-# $(WINGUILIB) on Windows, empty on other systems
-GUILIB=@GUILIB@
+# Compilation rules
+# =================
-# Entry point options, $(WINENTRY) on Windows, empty on other systems
-ENTRY=@ENTRY@
-
-# Include path for C/C++ compiler
-INCLUDES= \
- -I. \
- -I$(srcdir) \
- -I$(top_srcdir) \
- -I$(includedir)
-
-# Options used when compiling *.c modules to *.o
-COPTS= \
- $(DEFS) \
- $(INCLUDES) \
- $(CFPIC) \
- $(CPPFLAGS) \
- $(CFLAGS) \
- $(FS64) \
- $(CWARN)
-
-# Options used when compiling *.cpp or *.cxx modules to *.o
-CCOPTS= \
- $(DEFS) \
- $(INCLUDES) \
- $(CFPIC) \
- $(CPPFLAGS) \
- $(CFLAGS) \
- $(CXXFLAGS) \
- $(WXCPPFLAGS) \
- $(WXCXXFLAGS) \
- $(FS64) \
- $(CWARN)
-
-# C compiler command including options
-COMPILEC= $(CC) $(COPTS)
-
-# C++ compiler command including options
-COMPILECPP= $(CXX) $(CCOPTS) $(WXCXXFLAGS)
-
-# Linker command
-LD=$(CC)
+EXEEXT=@EXEEXT@
+OBJEXT=@OBJEXT@
+RCEXT=@RCEXT@
+RESEXT=@RESEXT@
-# Linker command including options
-LINK=$(CC) $(CFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK) $(ENTRY)
-
-# Linker command for applications using C++ modules (i.e. wxWidgets libraries)
-LDCPP=$(CXX) $(CFLAGS) $(CXXFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK) $(ENTRY)
-
-# Command to build a shared library
-MKSOLIB=@MKSOLIB@
-
-# Shared libraries needed for linking when building other shared libraries
-
-SOLIBZ=@SOLIBZ@
-SOLIBBZ=@SOLIBBZ@
-SOLIBMATH=@SOLIBMATH@
-SOLIBCRYPTO=@SOLIBCRYPTO@
-SOLIBNET=@SOLIBNET@
-SOLIBIMG=@SOLIBIMG@
-SOLIBSDBI=@SOLIBSDBI@
-SOLIBWX=@SOLIBWX@
-SOLIBDK3PORT=@SOLIBDK3PORT@
-SOLIBDK3C=@SOLIBDK3C@ $(SOLIBBZ) $(SOLIBZ) $(SOLIBMATH)
-SOLIBDK3OF=@SOLIBDK3OF@
-SOLIBDK3CSRND=@SOLIBDK3CSRND@
-SOLIBDK3BIF=@SOLIBDK3BIF@
-SOLIBDK3DBI=@SOLIBDK3DBI@
-SOLIBDK3FIG=@SOLIBDK3FIG@
-SOLIBDK3BMEPS=@SOLIBDK3BMEPS@
-SOLIBDK3NET=@SOLIBDK3NET@
-SOLIBDK4BASE=@SOLIBDK4BASE@
-SOLIBDK4MA=@SOLIBDK4MA@
-SOLIBDK4MAIO8H=@SOLIBDK4MAIO8H@
-SOLIBDK4MAIOWH=@SOLIBDK4MAIOWH@
-SOLIBDK4MAIODH=@SOLIBDK4MAIODH@
-SOLIBDK4MAIO8D=@SOLIBDK4MAIO8D@
-SOLIBDK4MAIOWD=@SOLIBDK4MAIOWD@
-SOLIBDK4MAIODD=@SOLIBDK4MAIODD@
-SOLIBDK4C=@SOLIBDK4C@ $(SOLIBDK4MAIODD) $(SOLIBDK4MAIO8D) $(SOLIBDK4MA) \
- $(SOLIBDK4BASE) $(SOLIBBZ) $(SOLIBZ) $(SOLIBMATH)
-SOLIBDK4MDRND=@SOLIBDK4MDRND@
-SOLIBDK4PPPT=@SOLIBDK4PPPT@
-SOLIBDK4APP=@SOLIBDK4APP@ $(SOLIBDK4C)
-SOLIBDK4LAT=@SOLIBDK4LAT@
-SOLIBDK4SOCK=@SOLIBDK4SOCK@
-SOLIBDK4SOCKA=@SOLIBDK4SOCKA@
-SOLIBDK4DBI=@SOLIBDK4DBI@
-SOLIBDK4DBIA=@SOLIBDK4DBIA@
-
-
-
-
-# Clean suffixes list
.SUFFIXES:
-# Rebuild new suffixes list
-.SUFFIXES: .o .cpp .c
+.SUFFIXES: .@OBJEXT@ .cpp .c
-.c.o:
- @echo '### Compile C ### ' $<
- $(COMPILEC) -o $@ -c $<
+.c.@OBJEXT@:
+ @echo '### Compile (C) ' $<
+ $(CC) $(CFL_CLI_DK) -o $@ -c $<
-.cpp.o:
- @echo '### Compile C++ ### ' $<
- $(COMPILECPP) -o $@ -c $<
+.cpp.@OBJEXT@:
+ @echo '### Compile (C++)' $<
+ $(CXX) $(CXXFL_GUI) -o $@ -c $<
-.c:
- @echo '### Link C ### ' $*
- $(COMPILEC) $(LDFLAGS) -o $* $*.c $(LIBS)
- chmod 755 $*
+# Programs, man pages and resource files for different suites
+# ===========================================================
-.cpp:
- @echo '### Link C++ ### ' $*
- $(COMPILECPP) $(LDFLAGS) -o $* $*.cpp $(LIBS)
- chmod 755 $*
+# Suite rescue
+# ------------
-# Programs to build for rescue system when sockets available
-NET_PROG_RES= \
+# Shared libraries used by network programs in rescue suite
+#
+LIB_SHARED_RES_NET= \
+ libdk4sock.so \
+ libdk4socka.so
+
+# Programs in rescue suite accessing network
+#
+PRG_RES_NET= \
dk-recv$(EXEEXT) \
dk-send$(EXEEXT)
-# Programs to build for rescue system
-PROG_RES= @NET_PROG_RES@ \
+# Man pages for programs in rescue suite using network
+#
+MAN_RES_NET= \
+ man/man1/dk-recv.1 \
+ man/man1/dk-send.1
+
+# Resource files for programs in rescue suite using network
+#
+RES_RES_NET= \
+ dktools/en/dk-recv.txt \
+ dktools/en/dk-send.txt \
+ dktools/de/dk-recv.txt \
+ dktools/de/dk-send.txt
+
+# Resource files in English for programs in rescue suite using network
+#
+RES_RES_NET_EN= \
+ dktools/en/dk-recv.txt \
+ dktools/en/dk-send.txt
+
+# Resource files in German for programs in rescue suite using network
+#
+RES_RES_NET_DE= \
+ dktools/de/dk-recv.txt \
+ dktools/de/dk-send.txt
+
+# Shared libraries used by programs in rescue suite
+#
+LIB_SHARED_RES= \
+ libdk4base.so \
+ libdk4c.so \
+ libdk4maio8d.so \
+ libdk4maio8h.so \
+ libdk4maiodd.so \
+ libdk4maiodh.so \
+ libdk4maiowd.so \
+ libdk4maiowh.so \
+ libdk4ma.so \
+ libdk4app.so \
+ libdk4mdrnd.so @LIB_SHARED_RES_NET@
+
+# Programs in rescue suite
+#
+PRG_RES= @PRG_RES_NET@ \
dk-cat$(EXEEXT) \
dk-blks$(EXEEXT) \
dk-eradisk$(EXEEXT) \
dk-ls$(EXEEXT)
-# Man pages to install on rescue systems
-MAN_RES= \
+# Man pages for programs in rescue suite
+#
+MAN_RES= @MAN_RES_NET@ \
man/man1/dk-blks.1 \
man/man1/dk-cat.1 \
man/man1/dk-eradisk.1 \
- man/man1/dk-ls.1 \
- man/man1/dk-recv.1 \
- man/man1/dk-send.1
+ man/man1/dk-ls.1
-# Resource files to install on rescue systems
-RES_RES_EN= \
+# Resource files for programs in rescue suite
+#
+RES_RES= @RES_RES_NET@ \
dktools/en/dk-blks.txt \
- dktools/en/dk-cat.txt \
- dktools/en/dk-ls.txt \
- dktools/en/dk-recv.txt \
- dktools/en/dk-send.txt
+ dktools/en/dk-cat.txt \
+ dktools/en/dk-ls.txt \
+ dktools/de/dk-blks.txt \
+ dktools/de/dk-cat.txt \
+ dktools/de/dk-ls.txt
+
+# Resource files in English for programs in rescue suite
+#
+RES_RES_EN= @RES_RES_NET_EN@ \
+ dktools/en/dk-blks.txt \
+ dktools/en/dk-cat.txt \
+ dktools/en/dk-ls.txt
-RES_RES_DE= \
+# Resource files in German for programs in rescue suite
+#
+RES_RES_DE= @RES_RES_NET_EN@ \
dktools/de/dk-blks.txt \
- dktools/de/dk-cat.txt \
- dktools/de/dk-ls.txt \
- dktools/de/dk-recv.txt \
- dktools/de/dk-send.txt
+ dktools/de/dk-cat.txt \
+ dktools/de/dk-ls.txt
-# Command line programs to build when sockets available
-NET_PROG_CLI= \
+# Suite cli
+# ---------
+
+PRG_DAEMON_NET_POSIX= \
printqd$(EXEEXT) \
- printqdc$(EXEEXT) \
- lprngcl$(EXEEXT) \
rshdown$(EXEEXT)
-# Command line programs to build when NetSNMP available
-SNMP_PROG_CLI= \
- pjsnmp$(EXEEXT) prmonsnmp$(EXEEXT)
+# Programs in CLI suite accessing network and using POSIX (daemons)
+#
+PRG_CLI_NET_POSIX= \
+ printqdc$(EXEEXT)
+
+# Man pages for programs in CLI suite accessing network and using POSIX
+#
+MAN_CLI_NET_POSIX= \
+ man/man1/printqd.1 \
+ man/man5/printqd.conf.5 \
+ man/man5/printqd.protocol.5 \
+ man/man5/printqd.db.5 \
+ man/man1/rshdown.1
+
+# Resource files for programs in CLI suite accessing network and using POSIX
+#
+RES_CLI_NET_POSIX= \
+ dktools/de/printqd.str \
+
+# Programs in CLI suite accessing network
+#
+PRG_CLI_NET= @PRG_CLI_NET_POSIX@ \
+ lprngcl$(EXEEXT)
+
+# Man pages for programs in CLI suite accessing network
+#
+MAN_CLI_NET= @MAN_CLI_NET_POSIX@ \
+ man/man1/printqdc.1 \
+ man/man1/lprngcl.1
+
+# Resource files for programs in CLI suite accessing network
+#
+RES_CLI_NET= @RES_CLI_NET_POSIX@ \
+ dktools/de/printqdc.str \
+ dktools/de/lprngcl.txt \
+ dktools/de/lprngcl.str \
+ dktools/en/lprngcl.txt
+
+PRG_FILTER_SNMP_POSIX= \
+ pjsnmp$(EXEEXT)
+
+# Programs in CLI suite using the NetSNMP library
+#
+PRG_CLI_SNMP= \
+ prmonsnmp$(EXEEXT)
+
+# Man pages for programs in CLI suite using the NetSNMP library
+#
+MAN_CLI_SNMP= \
+ man/man1/pjsnmp.1 \
+ man/man1/prmonsnmp.1
-# Command line programs to build when MySQL available
-MYSQL_PROG_CLI= \
+# Resource files for programs in CLI suite using the NetSNMP library
+#
+RES_CLI_SNMP= \
+ dktools/de/pjsnmp.str
+
+# Programs in CLI suite using MySQL or MariaDB
+#
+PRG_CLI_MYSQL= \
itadmin$(EXEEXT)
-# Programs to build for CLI suite
-PROG_CLI= $(PROG_RES) \
- dk-sqlsplit$(EXEEXT) @SNMP_PROG_CLI@ \
- dk-sort$(EXEEXT) @PROGSOPENSSL@ \
- dk-uid$(EXEEXT) @NET_PROG_CLI@ \
- dk-t2h$(EXEEXT) @MYSQL_PROG_CLI@ \
- dk-t2l$(EXEEXT) \
- dk-hex$(EXEEXT) \
- dk-bmm$(EXEEXT) \
- dk-pwd$(EXEEXT) \
- dkct$(EXEEXT) \
- addctrld$(EXEEXT) \
- dk-t2db$(EXEEXT) \
- dk-db2t$(EXEEXT) \
- dk-dbco$(EXEEXT) \
- bmpp$(EXEEXT) \
- fig2lat$(EXEEXT) \
- htmlbook$(EXEEXT) \
- dk3info$(EXEEXT) \
- dk4info$(EXEEXT) \
- plpdftex$(EXEEXT) \
- dkwxwiz$(EXEEXT)
-
-# Programs to build when cross-compiling on Linux for Windows
-PROG_CROSS= $(PROG_RES) \
- dk-sqlsplit$(EXEEXT) @SNMP_PROG_CLI@ \
- dk-sort$(EXEEXT) @PROGSOPENSSL@ \
- dk-fic$(EXEEXT) @NET_PROG_CLI@ \
- dk-t2h$(EXEEXT) @MYSQL_PROG_CLI@ \
- dk-t2l$(EXEEXT) \
- dk-hex$(EXEEXT) \
- dk-bmm$(EXEEXT) \
- dk-pwd$(EXEEXT) \
- dkct$(EXEEXT) \
- addctrld$(EXEEXT) \
- dk-t2db$(EXEEXT) \
- dk-db2t$(EXEEXT) \
- dk-dbco$(EXEEXT) \
- bmpp$(EXEEXT) \
- fig2lat$(EXEEXT) \
- htmlbook$(EXEEXT) \
- dk3info$(EXEEXT) \
- dk4info$(EXEEXT) \
- plpdftex$(EXEEXT) \
- dkwxwiz$(EXEEXT)
+# Man pages for programs in CLI suite using MySQL or MariaDB
+#
+MAN_CLI_MYSQL= \
+ man/man1/itadmin.1
-# Programs to build for GUI suite
-PROG_GUI= $(PROG_CLI) \
- wxdkfcs$(EXEEXT) \
- wxdkct$(EXEEXT) \
- wxbmpp$(EXEEXT) \
- wxpqdic$(EXEEXT) \
- wximgsz$(EXEEXT) \
- wxdkclock$(EXEEXT) \
- wxdkhtb$(EXEEXT)
+# Resource files for programs in CLI suite using MySQL or MariaDB
+#
+RES_CLI_MYSQL= \
+ dktools/de/itadmin.str \
+ dktools/itadmin/it-de.sql \
+ dktools/itadmin/it-latin1.sql \
+ dktools/itadmin/it-utf8.sql
-# Static libraries to build for rescue system
-LIB_ST_RES=
+# Programs in CLI suite using OpenSSL
+#
+PRG_CLI_SSL= \
+ dk-pwgen$(EXEEXT) \
+ dk-rand$(EXEEXT) \
+ dk-fic$(EXEEXT)
-# Static libraries to build for CLI suite
-LIB_ST_CLI= $(LIB_ST_RES) \
- libdk4base.a \
- libdk4ma.a \
- libdk4maio8h.a \
- libdk4maiowh.a \
- libdk4maiodh.a \
- libdk4maio8d.a \
- libdk4maiowd.a \
- libdk4maiodd.a \
- libdk4c.a \
- libdk4pppt.a \
- libdk4socka.a \
- libdk4sock.a \
- libdk4dbia.a \
- libdk4dbi.a \
- libdk4app.a \
- libdk4pppta.a \
- libdk4lat.a \
- libdk4mdrnd.a \
- libdk3c.a \
- libdk3of.a \
- libdk3csrnd.a \
- libdk3bif.a \
- libdk3dbi.a \
- libdk3bmeps.a \
- libdk3fig.a \
- libdk3trace.a
+# Man pages for programs in CLI suite using OpenSSL
+#
+MAN_CLI_SSL= \
+ man/man1/dk-pwgen.1 \
+ man/man1/dk-rand.1 \
+ man/man1/dk-fic.1
-# Static libraries to build for GUI suite
-LIB_ST_GUI= $(LIB_ST_CLI) \
- libdk4wx.a \
- libdk4maioxd.a
+# Resource files for programs in CLI suite using OpenSSL
+#
+RES_CLI_SSL= \
+ dktools/de/dk-pwgen.txt \
+ dktools/de/dk-pwgen.str \
+ dktools/en/dk-pwgen.txt \
+ dktools/de/dk-fic.txt \
+ dktools/de/dk-fic.str \
+ dktools/en/dk-fic.txt
+
+# Programs in CLI suite using POSIX
+#
+PRG_CLI_POSIX= \
+ dk-uid$(EXEEXT)
-# Shared libraries to build for rescue system when no packaging used
-LIB_SH_RES_NO_PACKAGING=
+# Man pages for programs in CLI suite using POSIX
+#
+MAN_CLI_POSIX= \
+ man/man1/dk-uid.1
-# Shared libraries to build for CLI suite when no packaging used
-LIB_SH_CLI_NO_PACKAGING= $(LIB_SH_RES_NO_PACKAGING) \
- libdk4base.so \
- libdk4ma.so \
- libdk4maio8h.so \
- libdk4maiowh.so \
- libdk4maiodh.so \
- libdk4maio8d.so \
- libdk4maiowd.so \
- libdk4maiodd.so \
- libdk4c.so \
- libdk4pppt.so \
- libdk4socka.so \
- libdk4sock.so \
- libdk4dbia.so \
- libdk4dbi.so \
- libdk4app.so \
- libdk4pppta.so \
- libdk4lat.so \
- libdk4mdrnd.so \
- libdk3c.so \
- libdk3of.so \
- libdk3csrnd.so \
- libdk3bif.so \
- libdk3dbi.so \
- libdk3bmeps.so \
- libdk3fig.so \
- libdk3trace.so
+# Resource files for programs in CLI suite using POSIX
+#
+RES_CLI_POSIX= \
+ dktools/de/dk-uid.str \
+ dktools/de/dk-uid.txt \
+ dktools/en/dk-uid.txt
-# Shared libraries to build for GUI suite when no packaging used
-LIB_SH_GUI_NO_PACKAGING= $(LIB_SH_CLI_NO_PACKAGING) \
- libdk4wx.so \
- libdk4maioxd.so \
- libdk3wx.so
+# Program files in the CLI suite for Windows
+#
+PRG_CLI_WINDOWS= \
+ dkwt$(EXEEXT) \
+ wprclean$(EXEEXT)
-# Shared libraries to build for rescue system when packaging used
-LIB_SH_RES_PACKAGING= \
- libdk4base.so \
- libdk4maio8d.so \
- libdk4maiowd.so \
- libdk4maiodd.so \
- libdk4maio8h.so \
- libdk4maiowh.so \
- libdk4maiodh.so \
- libdk4ma.so \
- libdk4c.so \
- libdk4socka.so \
- libdk4sock.so \
- libdk4app.so \
- libdk4mdrnd.so
+# Man pages for program files in the CLI suite for Windows
+#
+MAN_CLI_WINDOWS=
-# Shared libraries to build for CLI suite when packaging used
-LIB_SH_CLI_PACKAGING= $(LIB_SH_RES_PACKAGING) \
- libdk4lat.so \
- libdk4dbi.so \
- libdk4dbia.so \
- libdk4pppt.so \
- libdk4pppta.so \
- libdk3c.so \
- libdk3of.so \
- libdk3csrnd.so \
+# Resource files for program files in the CLI suite for Windows
+#
+RES_CLI_WINDOWS= \
+ dktools/de/dkwt-boot.txt \
+ dktools/de/dkwt-print.txt \
+ dktools/de/dkwt-env.txt \
+ dktools/de/dkwt-keep.txt \
+ dktools/de/dkwt-printers.txt \
+ dktools/de/dkwt-clp.txt \
+ dktools/de/dkwt-groups.txt \
+ dktools/de/dkwt-login.txt \
+ dktools/de/dkwt-shutdown.txt \
+ dktools/de/dkwt-users.txt \
+ dktools/de/dkwt-unkeep.txt \
+ dktools/de/dkwt-help.txt \
+ dktools/de/dkwt.str \
+ dktools/de/dkwt-logout.txt \
+ dktools/de/wprclean.txt \
+ dktools/de/wprclean.str
+
+# Shared libraries for programs in CLI suite
+#
+LIB_SHARED_CLI= $(LIB_SHARED_RES) \
libdk3bif.so \
- libdk3dbi.so \
libdk3bmeps.so \
+ libdk3c.so \
libdk3fig.so \
- libdk3trace.so
+ libdk3of.so \
+ libdk3trace.so \
+ libdk4bif.so \
+ libdk4dbi.so \
+ libdk4gra.so \
+ libdk4lat.so \
+ libdk4pppt.so \
+ libdk4bifa.so \
+ libdk4dbia.so \
+ libdk4graa.so \
+ libdk4lata.so
-# Shared libraries to build for GUI suite when packaging used
-LIB_SH_GUI_PACKAGING= $(LIB_SH_CLI_PACKAGING) \
- libdk4wx.so \
- libdk4maioxd.so \
- libdk3wx.so
+# Static libraries for CLI suite
+#
+LIB_STATIC_CLI= \
+ libdk3bif.a \
+ libdk3bmeps.a \
+ libdk3c.a \
+ libdk3fig.a \
+ libdk3of.a \
+ libdk3trace.a \
+ libdk4app.a \
+ libdk4base.a \
+ libdk4bifa.a \
+ libdk4bif.a \
+ libdk4c.a \
+ libdk4dbia.a \
+ libdk4dbi.a \
+ libdk4graa.a \
+ libdk4gra.a \
+ libdk4lata.a \
+ libdk4lat.a \
+ libdk4maio8d.a \
+ libdk4maio8h.a \
+ libdk4maiodd.a \
+ libdk4maiodh.a \
+ libdk4maiowd.a \
+ libdk4maiowh.a \
+ libdk4ma.a \
+ libdk4mdrnd.a \
+ libdk4pppt.a \
+ libdk4socka.a \
+ libdk4sock.a
-# Shared libraries to build for rescue system when packaging used
-LIB_SH_RES=@LIB_SH_RES@
+# Programs in CLI suite
+#
+PRG_CLI= $(PRG_RES) @PRG_CLI_NET@ @PRG_CLI_SNMP@ @PRG_CLI_MYSQL@ \
+ dk4info$(EXEEXT) @PRG_CLI_SSL@ @PRG_CLI_POSIX@ @PRG_CLI_WINDOWS@ \
+ bmpp$(EXEEXT) \
+ wxd2lat$(EXEEXT) \
+ plpdftex$(EXEEXT) \
+ dk-sort$(EXEEXT) \
+ dk-lines$(EXEEXT) \
+ dk-bin2c$(EXEEXT) \
+ dk-bmm$(EXEEXT) \
+ dk-hex$(EXEEXT) \
+ dk-pwd$(EXEEXT) \
+ dk-t2h$(EXEEXT) \
+ dk-t2l$(EXEEXT) \
+ dk-sqlsplit$(EXEEXT) \
+ dk3info$(EXEEXT) \
+ fig2lat$(EXEEXT) \
+ htmlbook$(EXEEXT) \
+ dkct$(EXEEXT) \
+ dkwxwiz$(EXEEXT) \
+ addctrld$(EXEEXT) \
+ dk-t2db$(EXEEXT) \
+ dk-db2t$(EXEEXT) \
+ dk-dbco$(EXEEXT)
-# Shared libraries to build for CLI suite
-LIB_SH_CLI=@LIB_SH_CLI@
+# Man pages for programs in CLI suite
+#
+MAN_CLI= @MAN_CLI_NET@ @MAN_CLI_SNMP@ @MAN_CLI_MYSQL@ @MAN_CLI_SSL@ \
-# Shared libraries to build for GUI suite
-LIB_SH_GUI=@LIB_SH_GUI@
+# Resource files for programs in CLI suite
+#
+RES_CLI= @RES_CLI_NET@ @RES_CLI_SNMP@ @RES_CLI_MYSQL@ @RES_CLI_SSL@ \
-all: # Synonym for build
-all: build
+# Suite gui
+# ---------
-help: # Show targets in Makefile
- @echo 'Some systems (i.e. Windows) append a special filename extension'
- @echo '(i.e. .exe) to program file names.'
- @echo 'On such systems use "make dk-ls.exe" instead of "make dk-ls"'
- @echo 'to build a program.'
- @echo 'Here is a list of the targets in this Makefile:'
- -@egrep '^[^:;=. ]*::?[ ]*' Makefile|grep '#'|grep -v '^#'
+LIB_SHARED_GUI= $(LIB_SHARED_CLI) \
+ libdk3wx.so \
+ libdk4maioxd.so \
+ libdk4wx.so
-build: # Build the software
-build: build-arch build-indep
+LIB_STATIC_GUI= $(LIB_STATIC_CLI) \
+ libdk3wx.a \
+ libdk4maioxd.a \
+ libdk4wx.a
-build-arch: # Build architecture specific files
-build-arch: @PROGRAMS@ @LIBRARIES@
+# Programs in the GUI suite for Windows
+PRG_GUI_WINDOWS= \
+ dkwxpath$(EXEEXT) \
+ winprint$(EXEEXT) \
+ ChangeScreenSize$(EXEEXT)
-build-indep: # Build architecture independent files
- find man -type d -exec chmod 755 {} \;
- find man -type f -exec chmod 644 {} \;
-
-install: # Install the software
-install: install-arch install-indep
- [ "X$(DESTDIR)" = "X" -o "X$(UNAME)" != "XSunOS" ] || cp pkginfo $(DESTDIR)/pkginfo
- [ "X$(DESTDIR)" = "X" -o "X$(UNAME)" != "XSunOS" ] || chmod 644 $(DESTDIR)/pkginfo
- @echo Finished installation
- @echo Some directories used by the printqd daemon may need
- @echo ownership and permission corrections. See 'printqd(1)'.
-
-install-arch: # Install architecture specific files
-install-arch: install-programs @LIBS_INSTALL@ @RES_INSTALL@
- @echo Finished installation of architecture specific files.
-
-# Shared libraries to build and install
-LIBS_SHARED=@LIBS_SHARED@
-
-i-l-sh: # Install shared libraries
-i-l-sh: build-arch install-directories
- $(INSTALL) -c -d "$(DESTDIR)$(libdir)"
- for i in $(LIBS_SHARED) ; do $(INSTALL) -c -m 644 $$i.$(SOVERS) "$(DESTDIR)$(libdir)" ; done
- for i in $(LIBS_SHARED) ; do $(LN_S) $$i.$(SOVERS) "$(DESTDIR)$(libdir)/$$i"; done
- @echo Finished installation of shared libraries.
-
-# Static libraries to build and install
-LIBS_STATIC=@LIBS_STATIC@
-
-i-l-st: # Install static libraries
-i-l-st: build-arch install-directories
- $(INSTALL_DATA) $(LIBS_STATIC) "$(DESTDIR)$(libdir)"
- @echo Finished installation of static libraries.
-
-i-incl: # Install include files for libraries
- $(INSTALL_DATA) dk4*.h Dk4*.h dk3trace.h "$(DESTDIR)$(includedir)"
- @echo Finished installation of include files.
-
-i-r-res: # Install resources for rescue programs
-i-r-res:
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools/en"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools/de"
- $(INSTALL_DATA) $(RES_RES_EN) "$(DESTDIR)$(datarootdir)/dktools/en"
- $(INSTALL_DATA) $(RES_RES_DE) "$(DESTDIR)$(datarootdir)/dktools/de"
- @echo Finished resources installation for rescue programs.
-
-i-r-cli: # Install resources for CLI programs
-i-r-cli: install-directories i-r-res
- find ./dktools -type d -exec chmod 755 {} \;
- find ./dktools -type f -exec chmod ugo+r,go-w {} \;
- find ./dk4app -type d -exec chmod 755 {} \;
- find ./dk4app -type f -exec chmod ugo+r,go-w {} \;
- (cd ./dktools ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dktools" ; tar xf -)
- (cd ./dk4app ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dk4app" ; tar xf -)
- find ./help-chm -type d -exec chmod 755 {} \;
- find ./help-chm -type f -exec chmod 644 {} \;
- find ./help-htb -type d -exec chmod 755 {} \;
- find ./help-htb -type f -exec chmod 644 {} \;
- (cd ./help-htb ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dktools" ; tar xf -)
- $(INSTALL_DATA) dktools.pc "$(DESTDIR)$(libdir)/pkgconfig/dktools.pc"
- $(INSTALL_DATA) etc-dk3app/dk3paper.conf "$(DESTDIR)$(sysconfdir)/dk3app"
- $(INSTALL_SCRIPT) itaclean.sh "$(DESTDIR)$(bindir)/itaclean"
- $(INSTALL_DATA) rshdown.conf.sample "$(DESTDIR)$(sysconfdir)/rshdown"
- $(INSTALL_DATA) printqd.conf.sample "$(DESTDIR)$(sysconfdir)/printqd"
- @echo Finished resources installation for CLI programs.
-
-i-r-gui: # Install resources for GUI programs
-i-r-gui: install-directories i-r-cli
- $(INSTALL_DATA) dkicon.ico "$(DESTDIR)$(datarootdir)/dktools"
- $(INSTALL_DATA) dkclock.ico "$(DESTDIR)$(datarootdir)/dktools"
- $(INSTALL_DATA) wxbmpp.desktop "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL_DATA) wxdkclock.desktop "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL_DATA) wxdkct.desktop "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL_DATA) wximgsz.desktop "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL_DATA) wxdkfcs.desktop "$(DESTDIR)$(datarootdir)/applications"
- @echo Finished resources installation for GUI programs.
+# Man pages for programs in the GUI suite for Windows
+MAN_GUI_WINDOWS=
+# Resource files for programs in the GUI suite for Windows
+RES_GUI_WINDOWS= \
+ dktools/de/winprint.str \
+ dktools/de/wxdkscrsz.str
-install-programs: # Install the executable programs
-install-programs: build-arch install-directories
- $(INSTALL) @PROGRAMS@ "$(DESTDIR)$(bindir)"
- @echo Finished installation of executable files.
+# Programs in the GUI suite using OpenSSL
+PRG_GUI_SSL= \
+ wxdkfcs$(EXEEXT)
-install-indep: # Install architecture independent files
-install-indep: build-indep install-directories @INSTALLMANPAGES@
- @echo Finished installation of architecture independent files.
+# Man pages for programs in the GUI suite using OpenSSL
+MAN_GUI_SSL= \
+ man/man1/wxdkfcs.1
-install-rescue-man: # Install man pages for rescue systems
-install-rescue-man: build-indep
- $(INSTALL) -d "$(DESTDIR)$(mandir)/man1"
- $(INSTALL_DATA) $(MAN_RES) "$(DESTDIR)$(mandir)/man1"
+# Resource files for programs in the GUI suite using OpenSSL
+RES_GUI_SSL= \
+ dktools/de/wxdkfcs.str
-install-manpages: # Install man pages
-install-manpages: build-indep install-directories
- $(INSTALL_DATA) man/man1/* "$(DESTDIR)$(mandir)/man1"
- $(INSTALL_DATA) man/man5/* "$(DESTDIR)$(mandir)/man5"
- @echo Finished installation of manpages.
+# Programs in GUI suite accessing network
+PRG_GUI_NET= \
+ wxpqdic$(EXEEXT)
-install-directories: # Create installation directories
- $(INSTALL) -d "$(DESTDIR)$(libdir)"
- $(INSTALL) -d "$(DESTDIR)$(libdir)/pkgconfig"
- $(INSTALL) -d "$(DESTDIR)$(includedir)"
- $(INSTALL) -d "$(DESTDIR)$(bindir)"
- $(INSTALL) -d "$(DESTDIR)$(mandir)"
- $(INSTALL) -d "$(DESTDIR)$(mandir)/man1"
- $(INSTALL) -d "$(DESTDIR)$(mandir)/man5"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dk4app"
- $(INSTALL) -d "$(DESTDIR)$(datarootdir)/applications"
- $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/dk3app"
- $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/rshdown"
- $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/printqd"
- $(INSTALL) -d "$(DESTDIR)$(localstatedir)/log"
- $(INSTALL) -d -m 775 "$(DESTDIR)$(localstatedir)/log/printqd"
- $(INSTALL) -d "$(DESTDIR)$(localstatedir)/run"
- $(INSTALL) -d -m 775 "$(DESTDIR)$(localstatedir)/lib/printqd"
- @echo Finished directory creation for installation.
-
-# Test programs for the modules.
-TESTPROGS= \
- test-dk4maac \
- test-dk4maauc \
- test-dk4maas \
- test-dk4maaus \
- test-dk4maai \
- test-dk4maaui \
- test-dk4maal \
- test-dk4maaul \
- test-dk4maall \
- test-dk4maaull \
- test-dk4maami \
- test-dk4maamu \
- test-dk4mai8ddu \
- test-dk4mai8ddi \
- test-dk4mai8dsz \
- test-dk4str8 \
- test-dk4loc \
- test-dk4time \
- test-dk4exep8 \
- test-dk4path8 \
- ex-sto \
- test-dk4strm \
- test-dk4numl \
- test-dk4tsp08 \
- test-bool \
- test-dk4enc \
- test-dk4user \
- test-container \
- test-skip
-
-# All test programs found by the configure script
-TESTPROGRAMS= @TESTPROGRAMS@
-
-clean: # Clean up (remove build results)
- -rm -f errors
- -rm -f *.deb
- -rm -f *.o *.obj *.exe
- -rm -f $(TESTPROGRAMS) $(TESTPROGS) @PROGRAMS@
- -rm -f *.a
- -rm -f *.so.$(SOVERS) *.so
- -rm -f doxygen.out
- -rm -f dk4config
- -rm -f dk3config
- -rm -f wxcs
- -rm -f doc/src/*.aux doc/src/*.log doc/src/math-img.pdf
- -rm -f doc/src/index.pdf doc/src/index.svg
- -rm -f doc/src/next.pdf doc/src/next.svg
- -rm -f doc/src/prev.pdf doc/src/prev.svg
- -rm -f doc/src/toc.pdf doc/src/toc.svg
- @echo 'Finished cleanup.'
+# Man pages for programs in GUI suite using network
+MAN_GUI_NET= \
+ man/man1/wxpqdic.1
-get-orig-source: # Retrieve original source archive
- @GETSOURCE@
+# Resource files for programs in GUI suite using network
+RES_GUI_NET=
-# Complete list of all libraries to build
-# Probably not all of them are installed
-LIBRARIESTOBUILD= @LIBDK4WXTOBUILD@ \
- libdk4.a \
- libdk4maio8d.$(LIBEXT) \
- libdk4maiowd.$(LIBEXT) \
- libdk4maiodd.$(LIBEXT) \
- libdk4maio8h.$(LIBEXT) \
- libdk4maiowh.$(LIBEXT) \
- libdk4maiodh.$(LIBEXT) \
- libdk4ma.$(LIBEXT) \
- libdk4base.$(LIBEXT) \
- libdk4c.$(LIBEXT) \
- libdk4pppt.$(LIBEXT) \
- libdk4app.$(LIBEXT) \
- libdk4pppta.$(LIBEXT) \
- libdk4lat.$(LIBEXT) \
- libdk4sock.$(LIBEXT) \
- libdk4socka.$(LIBEXT) \
- libdk4dbi.$(LIBEXT) \
- libdk4dbia.$(LIBEXT)
-
-binary: # Build all binaries
-binary: binary-arch binary-indep
-
-binary-arch: # Build architecture-specific binaries
-binary-arch: build-arch $(LIBRARIESTOBUILD) @PROGRAMS@
- @echo 'Finished creating the architecture-specific binaries.'
-
-binary-indep: # Build architecture-independent binaries
-binary-indep: build-indep
- @echo 'There are no architecture-independent binaries in this project.'
+# Programs in GUI suite
+PRG_GUI= $(PRG_CLI) @PRG_GUI_WINDOWS@ @PRG_GUI_SSL@ @PRG_GUI_NET@ \
+ wxdkdraw$(EXEEXT) \
+ wxbmpp$(EXEEXT) \
+ wximgsz$(EXEEXT) \
+ wxdkhtb$(EXEEXT) \
+ wxdkclock$(EXEEXT)
+
+# Man pages for programs in GUI suite
+MAN_GUI= @MAN_GUI_WINDOWS@ @MAN_GUI_SSL@ @MAN_GUI_NET@ \
+ man/man1/wxdkdraw.1 \
+ man/man1/wxbmpp.1 \
+ man/man1/wximgsz.1 \
+ man/man1/wxdkhtb.1 \
+ man/man1/wxdkclock.1
+
+# Resource files for programs in GUI suite
+RES_GUI= @RES_GUI_WINDOWS@ @RES_GUI_SSL@ @RES_GUI_NET@ \
+ dktools/de/wxdkdraw.str \
+ dktools/de/wxbmpp4.str \
+ dktools/de/wxbmpp.str \
+ dktools/de/wximgsz.str \
+ dktools/de/wxdkhtb.str \
+ dktools/de/wxdkclock.str
+
+# List of modules per library
+# ===========================
+
+# DK4 libraries
+# -------------
# Objects for libdk4wx.so or libdk4wx.a library
LIBDK4WXOBJ= \
- Dk4WxControl.o \
- Dk4WxProgressDialog.o \
- Dk4WxFrame.o \
- Dk4WxHelpController.o \
- Dk4WxAutostartController.o \
- Dk4WxApplicationHelper.o \
- dk4wxpref.o \
- dk4wxstt.o \
- dk4recwx.o \
- dk4tspwx.o \
- dk4strx.o
+ Dk4WxControl.$(OBJEXT) \
+ Dk4WxColourView.$(OBJEXT) \
+ Dk4WxColourPalette.$(OBJEXT) \
+ Dk4WxProgressDialog.$(OBJEXT) \
+ Dk4WxYesNoDialog.$(OBJEXT) \
+ Dk4WxFrame.$(OBJEXT) \
+ Dk4WxHelpController.$(OBJEXT) \
+ Dk4WxAutostartController.$(OBJEXT) \
+ Dk4WxApplicationHelper.$(OBJEXT) \
+ Dk4WxProcessingController.$(OBJEXT) \
+ dk4wxpref.$(OBJEXT) \
+ dk4wxstt.$(OBJEXT) \
+ dk4recwx.$(OBJEXT) \
+ dk4tspwx.$(OBJEXT) \
+ dk4strx.$(OBJEXT)
# Objects for libdk4socka.so or libdk4socka.a library
LIBDK4SOCKAOBJ= \
- dk4socka09.o \
- dk4socka08.o \
- dk4socka07.o \
- dk4socka06.o \
- dk4socka05.o \
- dk4socka04.o \
- dk4socka03.o \
- dk4socka02.o \
- dk4socka01.o
+ dk4socka09.$(OBJEXT) \
+ dk4socka08.$(OBJEXT) \
+ dk4socka07.$(OBJEXT) \
+ dk4socka06.$(OBJEXT) \
+ dk4socka05.$(OBJEXT) \
+ dk4socka04.$(OBJEXT) \
+ dk4socka03.$(OBJEXT) \
+ dk4socka02.$(OBJEXT) \
+ dk4socka01.$(OBJEXT)
# Objects for libdk4sock.so or libdk4sock.a library
LIBDK4SOCKOBJ= \
- dk4sock37.o \
- dk4sock36.o \
- dk4sock35.o \
- dk4sock34.o \
- dk4sock33.o \
- dk4sock32.o \
- dk4sock31.o \
- dk4sock30.o \
- dk4sock29.o \
- dk4sock28.o \
- dk4sock27.o \
- dk4sock26.o \
- dk4sock25.o \
- dk4sock24.o \
- dk4sock23.o \
- dk4sock22.o \
- dk4sock21.o \
- dk4sock20.o \
- dk4sock19.o \
- dk4sock18.o \
- dk4sock17.o \
- dk4sock16.o \
- dk4sock15.o \
- dk4sock14.o \
- dk4sock13.o \
- dk4sock12.o \
- dk4sock11.o \
- dk4sock10.o \
- dk4sock09.o \
- dk4sock08.o \
- dk4sock07.o \
- dk4sock06.o \
- dk4sock05.o \
- dk4sock04.o \
- dk4sock03.o \
- dk4sock02.o \
- dk4sock01.o
+ dk4sock37.$(OBJEXT) \
+ dk4sock36.$(OBJEXT) \
+ dk4sock35.$(OBJEXT) \
+ dk4sock34.$(OBJEXT) \
+ dk4sock33.$(OBJEXT) \
+ dk4sock32.$(OBJEXT) \
+ dk4sock31.$(OBJEXT) \
+ dk4sock30.$(OBJEXT) \
+ dk4sock29.$(OBJEXT) \
+ dk4sock28.$(OBJEXT) \
+ dk4sock27.$(OBJEXT) \
+ dk4sock26.$(OBJEXT) \
+ dk4sock25.$(OBJEXT) \
+ dk4sock24.$(OBJEXT) \
+ dk4sock23.$(OBJEXT) \
+ dk4sock22.$(OBJEXT) \
+ dk4sock21.$(OBJEXT) \
+ dk4sock20.$(OBJEXT) \
+ dk4sock19.$(OBJEXT) \
+ dk4sock18.$(OBJEXT) \
+ dk4sock17.$(OBJEXT) \
+ dk4sock16.$(OBJEXT) \
+ dk4sock15.$(OBJEXT) \
+ dk4sock14.$(OBJEXT) \
+ dk4sock13.$(OBJEXT) \
+ dk4sock12.$(OBJEXT) \
+ dk4sock11.$(OBJEXT) \
+ dk4sock10.$(OBJEXT) \
+ dk4sock09.$(OBJEXT) \
+ dk4sock08.$(OBJEXT) \
+ dk4sock07.$(OBJEXT) \
+ dk4sock06.$(OBJEXT) \
+ dk4sock05.$(OBJEXT) \
+ dk4sock04.$(OBJEXT) \
+ dk4sock03.$(OBJEXT) \
+ dk4sock02.$(OBJEXT) \
+ dk4sock01.$(OBJEXT)
# Objects for libdk4lat.so or libdk4lat.a library
LIBDK4LATOBJ= \
- dk4uc2l.o
+ dk4uc2l.$(OBJEXT)
+
+# Objects for libdk4lata.so or libdk4lata.a library
+LIBDK4LATAOBJ= \
+ dk4uc2la.$(OBJEXT)
# Objects for libdk4app.so or libdk4app.a library
LIBDK4APPOBJ= \
- dk4fdrda.o \
- dk4fdrde.o \
- dk4fdwre.o \
- dk4mema.o \
- dk4svbufa.o \
- dk4fopda.o \
- dk4appargs.o \
- dk4appop.o \
- dk4appmkdh.o \
- dk4appstt.o \
- dk4appenc.o \
- dk4aopt01.o \
- dk4aopt02.o \
- dk4aopt03.o \
- dk4aopt04.o \
- dk4aopt05.o \
- dk4aopt06.o \
- dk4aopt07.o \
- dk4aopt08.o \
- dk4aopt09.o \
- dk4aopt10.o \
- dk4aopt11.o \
- dk4aopt12.o \
- dk4aopt13.o \
- dk4aopt14.o \
- dk4aopt15.o \
- dk4aopt16.o \
- dk4appfs03.o \
- dk4appfs04.o \
- dk4appfs01.o \
- dk4appfs02.o \
- dk4appfne.o \
- dk4dira.o \
- dk4fileia.o \
- dk4appdeltree.o \
- dk4appdeldir.o \
- dk4appdelfile.o \
- dk4applog.o \
- dk4apref.o \
- dk4aprgs.o \
- dk4apphlv.o \
- dk4strda.o
+ dk4fdrda.$(OBJEXT) \
+ dk4fdrde.$(OBJEXT) \
+ dk4fdwre.$(OBJEXT) \
+ dk4mema.$(OBJEXT) \
+ dk4svbufa.$(OBJEXT) \
+ dk4fopda.$(OBJEXT) \
+ dk4appargs.$(OBJEXT) \
+ dk4appop.$(OBJEXT) \
+ dk4appmkdh.$(OBJEXT) \
+ dk4appstt.$(OBJEXT) \
+ dk4appenc.$(OBJEXT) \
+ dk4aopt01.$(OBJEXT) \
+ dk4aopt02.$(OBJEXT) \
+ dk4aopt03.$(OBJEXT) \
+ dk4aopt04.$(OBJEXT) \
+ dk4aopt05.$(OBJEXT) \
+ dk4aopt06.$(OBJEXT) \
+ dk4aopt07.$(OBJEXT) \
+ dk4aopt08.$(OBJEXT) \
+ dk4aopt09.$(OBJEXT) \
+ dk4aopt10.$(OBJEXT) \
+ dk4aopt11.$(OBJEXT) \
+ dk4aopt12.$(OBJEXT) \
+ dk4aopt13.$(OBJEXT) \
+ dk4aopt14.$(OBJEXT) \
+ dk4aopt15.$(OBJEXT) \
+ dk4aopt16.$(OBJEXT) \
+ dk4appfs03.$(OBJEXT) \
+ dk4appfs04.$(OBJEXT) \
+ dk4appfs01.$(OBJEXT) \
+ dk4appfs02.$(OBJEXT) \
+ dk4appfne.$(OBJEXT) \
+ dk4dira.$(OBJEXT) \
+ dk4fileia.$(OBJEXT) \
+ dk4appdeltree.$(OBJEXT) \
+ dk4appdeldir.$(OBJEXT) \
+ dk4appdelfile.$(OBJEXT) \
+ dk4applog.$(OBJEXT) \
+ dk4apref.$(OBJEXT) \
+ dk4aprgs.$(OBJEXT) \
+ dk4apphlv.$(OBJEXT) \
+ dk4strda.$(OBJEXT)
# Objects for libdk4mdrnd.so or libdk4mdrnd.a library
LIBDK4MDRNDOBJ= \
- dk4md.o
-
-# Objects for libdk4pppta.so or libdk4pppta.a library
-LIBDK4PPPTAOBJ= \
- dk4papea.o
+ dk4md.$(OBJEXT)
+
+LIBDK4BIFOBJ= \
+ dk4bifa.$(OBJEXT) \
+ dk4bif.$(OBJEXT) \
+ dk4pxres.$(OBJEXT) \
+ dk4pxbit.$(OBJEXT) \
+ dk4cs.$(OBJEXT) \
+ dk4bifp.$(OBJEXT) \
+ dk4bifj.$(OBJEXT) \
+ dk4bift.$(OBJEXT) \
+ dk4bifn.$(OBJEXT) \
+ dk4bifto.$(OBJEXT) \
+ dk4bifpb.$(OBJEXT)
+
+LIBDK4GRAOBJ= \
+ dk4grco.$(OBJEXT) \
+ dk4gra.$(OBJEXT) \
+ dk4grpat.$(OBJEXT) \
+ dk4greps.$(OBJEXT) \
+ dk4grepp.$(OBJEXT) \
+ dk4grpdf.$(OBJEXT) \
+ dk4grpgf.$(OBJEXT) \
+ dk4grepi.$(OBJEXT) \
+ dk4grpdi.$(OBJEXT) \
+ dk4grpgi.$(OBJEXT) \
+ dk4grpdt.$(OBJEXT) \
+ dk4grat.$(OBJEXT) \
+ dk4fontc.$(OBJEXT) \
+ dk4font.$(OBJEXT) \
+ dk4paper.$(OBJEXT) \
+ dk4xsp.$(OBJEXT) \
+ dk4bb.$(OBJEXT) \
+ dk4bb32.$(OBJEXT)
# Objects for libdk4pppt.so or libdk4pppt.a library
LIBDK4PPPTOBJ= \
- dk4font.o \
- dk4paper.o
+ dk4pppt.$(OBJEXT)
+
+LIBDK4BIFAOBJ= \
+ dk4bifap.$(OBJEXT)
+
+LIBDK4GRAAOBJ= \
+ dk4graa.$(OBJEXT) \
+ dk4gralo.$(OBJEXT) \
+ dk4papea.$(OBJEXT) \
+ dk4grcoa.$(OBJEXT)
+
+# Objects for libdk4pppta.so or libdk4pppta.a library
+LIBDK4PPPTAOBJ= \
+ dk4pppta.$(OBJEXT)
# Object for libdk4c.so or libdk4c.a library
-LIBDK4COBJ= \
- dk4dmt.o \
- dk4mdch.o \
- dk4binenc.o \
- dk4stt.o \
- dk4opt.o \
- dk4opt01.o \
- dk4opt02.o \
- dk4opt03.o \
- dk4opt04.o \
- dk4opt05.o \
- dk4opt06.o \
- dk4opt07.o \
- dk4pref.o \
- dk4tspdk.o \
- dk4tsp32.o \
- dk4tsp16.o \
- dk4tsp08.o \
- dk4strmco.o \
- dk4lzwe.o \
- dk4mbstrm.o \
- dk4membs.o \
- dk4membf.o \
- dk4membuf.o \
- dk4strmu.o \
- dk4strms.o \
- dk4strmw.o \
- dk4strmr.o \
- dk4strmf.o \
- dk4strmg.o \
- dk4strmb.o \
- dk4strmodk.o \
- dk4strmo08.o \
- dk4strmo16.o \
- dk4strmo32.o \
- dk4c8dbl.o \
- dk4strm.o \
- dk4fput.o \
- dk4svbuf.o \
- dk4fopd.o \
- dk4fopwc.o \
- dk4fopc8.o \
- dk4exepd.o \
- dk4exepw.o \
- dk4exep8.o \
- dk4mkdh.o \
- dk4mkdh8.o \
- dk4mkdhw.o \
- dk4symlink.o \
- dk4fileiu.o \
- dk4fileigd.o \
- dk4fileigw.o \
- dk4fileig8.o \
- dk4filei.o \
- dk4fileid.o \
- dk4fileiw.o \
- dk4filei8.o \
- dk4filed.o \
- dk4filew.o \
- dk4file8.o \
- dk4fs.o \
- dk4mm.o \
- dk4stat.o \
- dk4statd.o \
- dk4statw.o \
- dk4stat8.o \
- dk4pathd.o \
- dk4pathw.o \
- dk4path8.o \
- dk4userf.o \
- dk4enc.o \
- dk4bom.o \
- dk4rec25.o \
- dk4rec24.o \
- dk4rec23.o \
- dk4rec22.o \
- dk4rec21.o \
- dk4rec20.o \
- dk4rec19.o \
- dk4rec18.o \
- dk4rec17.o \
- dk4rec16.o \
- dk4rec15.o \
- dk4rec14.o \
- dk4rec13.o \
- dk4rec12.o \
- dk4rec11.o \
- dk4rec10.o \
- dk4rec09.o \
- dk4rec08.o \
- dk4rec07.o \
- dk4rec06.o \
- dk4rec05.o \
- dk4rec04.o \
- dk4rec03.o \
- dk4rec02.o \
- dk4rec01.o \
- dk4ansi.o \
- dk4utf8.o \
- dk4utf16.o \
- dk4c32.o \
- dk4loc.o \
- dk4wregd.o \
- dk4wregw.o \
- dk4wreg8.o \
- dk4wregc.o \
- dk4fd.o \
- dk4hnamed.o \
- dk4hnamew.o \
- dk4hname8.o \
- dk4user.o \
- dk4ufi.o \
- dk4ufiwc.o \
- dk4ufi08.o \
- dk4fne.o \
- dk4fnewc.o \
- dk4fne08.o \
- dk4getcwdd.o \
- dk4getcwdw.o \
- dk4getcwd8.o \
- dk4dir.o \
- dk4dirwc.o \
- dk4dir08.o \
- dk4deldir.o \
- dk4deldirwc.o \
- dk4deldir08.o \
- dk4delfile.o \
- dk4delfilewc.o \
- dk4delfile08.o \
- dk4istty.o \
- dk4ftimedk.o \
- dk4ftimewc.o \
- dk4ftime08.o \
- dk4ftime.o \
- dk4ctime.o \
- dk4time.o \
- dk4timedk.o \
- dk4timewc.o \
- dk4time08.o \
- dk4inst.o \
- dk4getpid.o \
- dk4sto.o \
- dk4a85e.o \
- dk4a85d.o \
- dk4ahd.o \
- dk4rle.o \
- dk4rld.o \
- dk4bf.o \
- dk4bitsh.o \
- dk4isadm.o \
- dk4fpe.o \
- dk3trace.o
+LIBDK4COBJ= @MOD_DK4DMT@ \
+ dk4mdch.$(OBJEXT) \
+ dk4binenc.$(OBJEXT) \
+ dk4stt.$(OBJEXT) \
+ dk4opt.$(OBJEXT) \
+ dk4opt01.$(OBJEXT) \
+ dk4opt02.$(OBJEXT) \
+ dk4opt03.$(OBJEXT) \
+ dk4opt04.$(OBJEXT) \
+ dk4opt05.$(OBJEXT) \
+ dk4opt06.$(OBJEXT) \
+ dk4opt07.$(OBJEXT) \
+ dk4pref.$(OBJEXT) \
+ dk4tspdk.$(OBJEXT) \
+ dk4tsp32.$(OBJEXT) \
+ dk4tsp16.$(OBJEXT) \
+ dk4tsp08.$(OBJEXT) \
+ dk4strmco.$(OBJEXT) \
+ dk4lzwe.$(OBJEXT) \
+ dk4mbstrm.$(OBJEXT) \
+ dk4membs.$(OBJEXT) \
+ dk4membf.$(OBJEXT) \
+ dk4membuf.$(OBJEXT) \
+ dk4strmu.$(OBJEXT) \
+ dk4strms.$(OBJEXT) \
+ dk4strmw.$(OBJEXT) \
+ dk4strmr.$(OBJEXT) \
+ dk4strmf.$(OBJEXT) \
+ dk4strmg.$(OBJEXT) \
+ dk4strmb.$(OBJEXT) \
+ dk4strmodk.$(OBJEXT) \
+ dk4strmo08.$(OBJEXT) \
+ dk4strmo16.$(OBJEXT) \
+ dk4strmo32.$(OBJEXT) \
+ dk4mao8dns.$(OBJEXT) \
+ dk4c8dbl.$(OBJEXT) \
+ dk4strm.$(OBJEXT) \
+ dk4fput.$(OBJEXT) \
+ dk4svbuf.$(OBJEXT) \
+ dk4fopd.$(OBJEXT) \
+ dk4fopwc.$(OBJEXT) \
+ dk4fopc8.$(OBJEXT) \
+ dk4exepd.$(OBJEXT) \
+ dk4exepw.$(OBJEXT) \
+ dk4exep8.$(OBJEXT) \
+ dk4mkdh.$(OBJEXT) \
+ dk4mkdh8.$(OBJEXT) \
+ dk4mkdhw.$(OBJEXT) \
+ dk4symlink.$(OBJEXT) \
+ dk4fileiu.$(OBJEXT) \
+ dk4fileigd.$(OBJEXT) \
+ dk4fileigw.$(OBJEXT) \
+ dk4fileig8.$(OBJEXT) \
+ dk4filei.$(OBJEXT) \
+ dk4fileid.$(OBJEXT) \
+ dk4fileiw.$(OBJEXT) \
+ dk4filei8.$(OBJEXT) \
+ dk4filed.$(OBJEXT) \
+ dk4filew.$(OBJEXT) \
+ dk4file8.$(OBJEXT) \
+ dk4fs.$(OBJEXT) \
+ dk4mm.$(OBJEXT) \
+ dk4stat.$(OBJEXT) \
+ dk4statd.$(OBJEXT) \
+ dk4statw.$(OBJEXT) \
+ dk4stat8.$(OBJEXT) \
+ dk4pathd.$(OBJEXT) \
+ dk4pathw.$(OBJEXT) \
+ dk4path8.$(OBJEXT) \
+ dk4serf.$(OBJEXT) \
+ dk4userf.$(OBJEXT) \
+ dk4enc.$(OBJEXT) \
+ dk4bom.$(OBJEXT) \
+ dk4rec27.$(OBJEXT) \
+ dk4rec26.$(OBJEXT) \
+ dk4rec25.$(OBJEXT) \
+ dk4rec24.$(OBJEXT) \
+ dk4rec23.$(OBJEXT) \
+ dk4rec22.$(OBJEXT) \
+ dk4rec21.$(OBJEXT) \
+ dk4rec20.$(OBJEXT) \
+ dk4rec19.$(OBJEXT) \
+ dk4rec18.$(OBJEXT) \
+ dk4rec17.$(OBJEXT) \
+ dk4rec16.$(OBJEXT) \
+ dk4rec15.$(OBJEXT) \
+ dk4rec14.$(OBJEXT) \
+ dk4rec13.$(OBJEXT) \
+ dk4rec12.$(OBJEXT) \
+ dk4rec11.$(OBJEXT) \
+ dk4rec10.$(OBJEXT) \
+ dk4rec09.$(OBJEXT) \
+ dk4rec08.$(OBJEXT) \
+ dk4rec07.$(OBJEXT) \
+ dk4rec06.$(OBJEXT) \
+ dk4rec05.$(OBJEXT) \
+ dk4rec04.$(OBJEXT) \
+ dk4rec03.$(OBJEXT) \
+ dk4rec02.$(OBJEXT) \
+ dk4rec01.$(OBJEXT) \
+ dk4ansi.$(OBJEXT) \
+ dk4utf8.$(OBJEXT) \
+ dk4utf16.$(OBJEXT) \
+ dk4c32.$(OBJEXT) \
+ dk4loc.$(OBJEXT) \
+ dk4wregd.$(OBJEXT) \
+ dk4wregw.$(OBJEXT) \
+ dk4wreg8.$(OBJEXT) \
+ dk4wregc.$(OBJEXT) \
+ dk4fd.$(OBJEXT) \
+ dk4hnamed.$(OBJEXT) \
+ dk4hnamew.$(OBJEXT) \
+ dk4hname8.$(OBJEXT) \
+ dk4user.$(OBJEXT) \
+ dk4ufi.$(OBJEXT) \
+ dk4ufiwc.$(OBJEXT) \
+ dk4ufi08.$(OBJEXT) \
+ dk4ufic.$(OBJEXT) \
+ dk4fne.$(OBJEXT) \
+ dk4fnewc.$(OBJEXT) \
+ dk4fne08.$(OBJEXT) \
+ dk4chdird.$(OBJEXT) \
+ dk4chdirw.$(OBJEXT) \
+ dk4chdir8.$(OBJEXT) \
+ dk4getcwdd.$(OBJEXT) \
+ dk4getcwdw.$(OBJEXT) \
+ dk4getcwd8.$(OBJEXT) \
+ dk4dir.$(OBJEXT) \
+ dk4dirwc.$(OBJEXT) \
+ dk4dir08.$(OBJEXT) \
+ dk4deldir.$(OBJEXT) \
+ dk4deldirwc.$(OBJEXT) \
+ dk4deldir08.$(OBJEXT) \
+ dk4delfile.$(OBJEXT) \
+ dk4delfilewc.$(OBJEXT) \
+ dk4delfile08.$(OBJEXT) \
+ dk4istty.$(OBJEXT) \
+ dk4ftimedk.$(OBJEXT) \
+ dk4ftimewc.$(OBJEXT) \
+ dk4ftime08.$(OBJEXT) \
+ dk4ftime.$(OBJEXT) \
+ dk4ctime.$(OBJEXT) \
+ dk4time.$(OBJEXT) \
+ dk4timedk.$(OBJEXT) \
+ dk4timewc.$(OBJEXT) \
+ dk4time08.$(OBJEXT) \
+ dk4inst.$(OBJEXT) \
+ dk4getpid.$(OBJEXT) \
+ dk4sto.$(OBJEXT) \
+ dk4a85e.$(OBJEXT) \
+ dk4a85d.$(OBJEXT) \
+ dk4ahd.$(OBJEXT) \
+ dk4rle.$(OBJEXT) \
+ dk4rld.$(OBJEXT) \
+ dk4bml.$(OBJEXT) \
+ dk4bm.$(OBJEXT) \
+ dk4bf.$(OBJEXT) \
+ dk4bitsh.$(OBJEXT) \
+ dk4isadm.$(OBJEXT) \
+ dk4itmin.$(OBJEXT) \
+ dk4iter.$(OBJEXT) \
+ dk4math.$(OBJEXT) \
+ dk4fpe.$(OBJEXT) \
+ dk3trace.$(OBJEXT)
# Objects for libdk4maiodd.so or libdk4maiodd.a library
LIBDK4MAIODDOBJ= \
- dk4maoddbl.o \
- dk4maiddbl.o \
- dk4maiddic.o \
- dk4maiddis.o \
- dk4maiddii.o \
- dk4maiddmi.o \
- dk4maiddli.o \
- dk4maiddil.o \
- dk4maidddi.o \
- dk4maidduc.o \
- dk4maiddus.o \
- dk4maiddui.o \
- dk4maiddmu.o \
- dk4maiddlu.o \
- dk4maiddul.o \
- dk4maiddsz.o \
- dk4maidddu.o \
- dk4maodd.o
+ dk4maoddbl.$(OBJEXT) \
+ dk4maiddbl.$(OBJEXT) \
+ dk4maiddic.$(OBJEXT) \
+ dk4maiddis.$(OBJEXT) \
+ dk4maiddii.$(OBJEXT) \
+ dk4maiddmi.$(OBJEXT) \
+ dk4maiddli.$(OBJEXT) \
+ dk4maiddil.$(OBJEXT) \
+ dk4maidddi.$(OBJEXT) \
+ dk4maidduc.$(OBJEXT) \
+ dk4maiddus.$(OBJEXT) \
+ dk4maiddui.$(OBJEXT) \
+ dk4maiddmu.$(OBJEXT) \
+ dk4maiddlu.$(OBJEXT) \
+ dk4maiddul.$(OBJEXT) \
+ dk4maiddsz.$(OBJEXT) \
+ dk4maidddu.$(OBJEXT) \
+ dk4maodd.$(OBJEXT)
# Objects for libdk4maioxd.so or libdk4maioxd.a library
LIBDK4MAIOXDOBJ= \
- dk4maoxdbl.o \
- dk4maixdbl.o \
- dk4maixdic.o \
- dk4maixdis.o \
- dk4maixdii.o \
- dk4maixdmi.o \
- dk4maixdli.o \
- dk4maixdil.o \
- dk4maixddi.o \
- dk4maixduc.o \
- dk4maixdus.o \
- dk4maixdui.o \
- dk4maixdmu.o \
- dk4maixdlu.o \
- dk4maixdul.o \
- dk4maixdsz.o \
- dk4maixddu.o \
- dk4maoxd.o
+ dk4maoxdbl.$(OBJEXT) \
+ dk4maixdbl.$(OBJEXT) \
+ dk4maixdic.$(OBJEXT) \
+ dk4maixdis.$(OBJEXT) \
+ dk4maixdii.$(OBJEXT) \
+ dk4maixdmi.$(OBJEXT) \
+ dk4maixdli.$(OBJEXT) \
+ dk4maixdil.$(OBJEXT) \
+ dk4maixddi.$(OBJEXT) \
+ dk4maixduc.$(OBJEXT) \
+ dk4maixdus.$(OBJEXT) \
+ dk4maixdui.$(OBJEXT) \
+ dk4maixdmu.$(OBJEXT) \
+ dk4maixdlu.$(OBJEXT) \
+ dk4maixdul.$(OBJEXT) \
+ dk4maixdsz.$(OBJEXT) \
+ dk4maixddu.$(OBJEXT) \
+ dk4maoxd.$(OBJEXT)
# Objects for libdk4maiodh.so or libdk4maiodh.a library
LIBDK4MAIODHOBJ= \
- dk4maidhic.o \
- dk4maidhis.o \
- dk4maidhii.o \
- dk4maidhmi.o \
- dk4maidhli.o \
- dk4maidhil.o \
- dk4maidhdi.o \
- dk4maidhuc.o \
- dk4maidhus.o \
- dk4maidhui.o \
- dk4maidhmu.o \
- dk4maidhlu.o \
- dk4maidhul.o \
- dk4maidhdu.o \
- dk4maodh.o \
- dk4maodo.o
+ dk4maidhic.$(OBJEXT) \
+ dk4maidhis.$(OBJEXT) \
+ dk4maidhii.$(OBJEXT) \
+ dk4maidhmi.$(OBJEXT) \
+ dk4maidhli.$(OBJEXT) \
+ dk4maidhil.$(OBJEXT) \
+ dk4maidhdi.$(OBJEXT) \
+ dk4maidhuc.$(OBJEXT) \
+ dk4maidhus.$(OBJEXT) \
+ dk4maidhui.$(OBJEXT) \
+ dk4maidhmu.$(OBJEXT) \
+ dk4maidhlu.$(OBJEXT) \
+ dk4maidhul.$(OBJEXT) \
+ dk4maidhdu.$(OBJEXT) \
+ dk4maodh.$(OBJEXT) \
+ dk4maodo.$(OBJEXT)
# Objects for libdk4maiowd.so or libdk4maiowd.a library
LIBDK4MAIOWDOBJ= \
- dk4maowdbl.o \
- dk4maiwdbl.o \
- dk4maiwdic.o \
- dk4maiwdis.o \
- dk4maiwdii.o \
- dk4maiwdmi.o \
- dk4maiwdli.o \
- dk4maiwdil.o \
- dk4maiwduc.o \
- dk4maiwdus.o \
- dk4maiwdui.o \
- dk4maiwdmu.o \
- dk4maiwdlu.o \
- dk4maiwdul.o \
- dk4maiwdsz.o \
- dk4maiwddi.o \
- dk4maiwddu.o \
- dk4maowd.o
+ dk4maowdbl.$(OBJEXT) \
+ dk4maiwdbl.$(OBJEXT) \
+ dk4maiwdic.$(OBJEXT) \
+ dk4maiwdis.$(OBJEXT) \
+ dk4maiwdii.$(OBJEXT) \
+ dk4maiwdmi.$(OBJEXT) \
+ dk4maiwdli.$(OBJEXT) \
+ dk4maiwdil.$(OBJEXT) \
+ dk4maiwduc.$(OBJEXT) \
+ dk4maiwdus.$(OBJEXT) \
+ dk4maiwdui.$(OBJEXT) \
+ dk4maiwdmu.$(OBJEXT) \
+ dk4maiwdlu.$(OBJEXT) \
+ dk4maiwdul.$(OBJEXT) \
+ dk4maiwdsz.$(OBJEXT) \
+ dk4maiwddi.$(OBJEXT) \
+ dk4maiwddu.$(OBJEXT) \
+ dk4maowd.$(OBJEXT)
# Objects for libdk4maiowh.so or libdk4maiowh.a library
LIBDK4MAIOWHOBJ= \
- dk4maiwhic.o \
- dk4maiwhis.o \
- dk4maiwhii.o \
- dk4maiwhmi.o \
- dk4maiwhli.o \
- dk4maiwhil.o \
- dk4maiwhuc.o \
- dk4maiwhus.o \
- dk4maiwhui.o \
- dk4maiwhmu.o \
- dk4maiwhlu.o \
- dk4maiwhul.o \
- dk4maiwhdi.o \
- dk4maiwhdu.o \
- dk4maowh.o
+ dk4maiwhic.$(OBJEXT) \
+ dk4maiwhis.$(OBJEXT) \
+ dk4maiwhii.$(OBJEXT) \
+ dk4maiwhmi.$(OBJEXT) \
+ dk4maiwhli.$(OBJEXT) \
+ dk4maiwhil.$(OBJEXT) \
+ dk4maiwhuc.$(OBJEXT) \
+ dk4maiwhus.$(OBJEXT) \
+ dk4maiwhui.$(OBJEXT) \
+ dk4maiwhmu.$(OBJEXT) \
+ dk4maiwhlu.$(OBJEXT) \
+ dk4maiwhul.$(OBJEXT) \
+ dk4maiwhdi.$(OBJEXT) \
+ dk4maiwhdu.$(OBJEXT) \
+ dk4maowh.$(OBJEXT)
# Objects for libdk4maio8d.so or libdk4maio8d.a library
LIBDK4MAIO8DOBJ= \
- dk4mao8dbl.o \
- dk4mai8dbl.o \
- dk4mai8dic.o \
- dk4mai8dis.o \
- dk4mai8dii.o \
- dk4mai8dmi.o \
- dk4mai8dli.o \
- dk4mai8dil.o \
- dk4mai8ddi.o \
- dk4mai8duc.o \
- dk4mai8dus.o \
- dk4mai8dui.o \
- dk4mai8dmu.o \
- dk4mai8dlu.o \
- dk4mai8dul.o \
- dk4mai8dsz.o \
- dk4mai8ddu.o \
- dk4mao8d.o
+ dk4mao8dbl.$(OBJEXT) \
+ dk4mai8dbl.$(OBJEXT) \
+ dk4mai8dic.$(OBJEXT) \
+ dk4mai8di8.$(OBJEXT) \
+ dk4mai8dis.$(OBJEXT) \
+ dk4mai8di16.$(OBJEXT) \
+ dk4mai8dii.$(OBJEXT) \
+ dk4mai8dmi.$(OBJEXT) \
+ dk4mai8dli.$(OBJEXT) \
+ dk4mai8dil.$(OBJEXT) \
+ dk4mai8di32.$(OBJEXT) \
+ dk4mai8ddi.$(OBJEXT) \
+ dk4mai8duc.$(OBJEXT) \
+ dk4mai8du8.$(OBJEXT) \
+ dk4mai8dus.$(OBJEXT) \
+ dk4mai8du16.$(OBJEXT) \
+ dk4mai8dui.$(OBJEXT) \
+ dk4mai8dmu.$(OBJEXT) \
+ dk4mai8dlu.$(OBJEXT) \
+ dk4mai8du32.$(OBJEXT) \
+ dk4mai8dul.$(OBJEXT) \
+ dk4mai8dsz.$(OBJEXT) \
+ dk4mai8ddu.$(OBJEXT) \
+ dk4mao8d.$(OBJEXT)
# Objects for libdk4maio8h.so or libdk4maio8h.a library
LIBDK4MAIO8HOBJ= \
- dk4mai8hic.o \
- dk4mai8his.o \
- dk4mai8hii.o \
- dk4mai8hmi.o \
- dk4mai8hli.o \
- dk4mai8hil.o \
- dk4mai8hdi.o \
- dk4mai8huc.o \
- dk4mai8hus.o \
- dk4mai8hui.o \
- dk4mai8hmu.o \
- dk4mai8hlu.o \
- dk4mai8hul.o \
- dk4mai8hdu.o \
- dk4mao8h.o
+ dk4mai8hic.$(OBJEXT) \
+ dk4mai8his.$(OBJEXT) \
+ dk4mai8hii.$(OBJEXT) \
+ dk4mai8hmi.$(OBJEXT) \
+ dk4mai8hli.$(OBJEXT) \
+ dk4mai8hil.$(OBJEXT) \
+ dk4mai8hdi.$(OBJEXT) \
+ dk4mai8huc.$(OBJEXT) \
+ dk4mai8hus.$(OBJEXT) \
+ dk4mai8hui.$(OBJEXT) \
+ dk4mai8hmu.$(OBJEXT) \
+ dk4mai8hlu.$(OBJEXT) \
+ dk4mai8hul.$(OBJEXT) \
+ dk4mai8hdu.$(OBJEXT) \
+ dk4mao8h.$(OBJEXT)
# Objects for libdk4ma.so or libdk4ma.a library
LIBDK4MAOBJ= \
- dk4numl.o \
- dk4macd.o \
- dk4macm.o \
- dk4macll.o \
- dk4macl.o \
- dk4maci.o \
- dk4macs.o \
- dk4macc.o \
- dk4maasz.o \
- dk4maadi.o \
- dk4maadu.o \
- dk4maami.o \
- dk4maamu.o \
- dk4maall.o \
- dk4maalu.o \
- dk4maal.o \
- dk4maaul.o \
- dk4maai.o \
- dk4maaui.o \
- dk4maas.o \
- dk4maaus.o \
- dk4maac.o \
- dk4maauc.o \
- dk4maau16.o \
- dk4maai16.o \
- dk4maau32.o \
- dk4maai32.o \
- dk4maci16.o \
- dk4maci32.o
+ dk4numl.$(OBJEXT) \
+ dk4macd.$(OBJEXT) \
+ dk4macm.$(OBJEXT) \
+ dk4macll.$(OBJEXT) \
+ dk4macl.$(OBJEXT) \
+ dk4maci.$(OBJEXT) \
+ dk4macs.$(OBJEXT) \
+ dk4macc.$(OBJEXT) \
+ dk4maasz.$(OBJEXT) \
+ dk4maadi.$(OBJEXT) \
+ dk4maadu.$(OBJEXT) \
+ dk4maami.$(OBJEXT) \
+ dk4maamu.$(OBJEXT) \
+ dk4maall.$(OBJEXT) \
+ dk4maalu.$(OBJEXT) \
+ dk4maal.$(OBJEXT) \
+ dk4maaul.$(OBJEXT) \
+ dk4maai.$(OBJEXT) \
+ dk4maaui.$(OBJEXT) \
+ dk4maas.$(OBJEXT) \
+ dk4maaus.$(OBJEXT) \
+ dk4maac.$(OBJEXT) \
+ dk4maauc.$(OBJEXT) \
+ dk4maau16.$(OBJEXT) \
+ dk4maai16.$(OBJEXT) \
+ dk4maau32.$(OBJEXT) \
+ dk4maai32.$(OBJEXT) \
+ dk4maci16.$(OBJEXT) \
+ dk4maci32.$(OBJEXT)
# Objects for libdk4dbia.so or libdk4dbia.a library
LIBDK4DBIAOBJ= \
- dk4dbia.o
+ dk4dbia.$(OBJEXT)
# Objects for libdk4dbi.so or libdk4dbi.a library
LIBDK4DBIOBJ= \
- dk4dbit.o \
- dk4dbitw.o \
- dk4dbit8.o \
- dk4dbi.o
+ dk4dbit.$(OBJEXT) \
+ dk4dbitw.$(OBJEXT) \
+ dk4dbit8.$(OBJEXT) \
+ dk4dbi.$(OBJEXT)
# Objects for libdk4base.so or libdk4base.a library
LIBDK4BASEOBJ= \
- dk4strd.o \
- dk4strw.o \
- dk4str8.o \
- dk4memcpl.o \
- dk4memrs.o \
- dk4mem.o \
- dk4error.o
+ dk4strd.$(OBJEXT) \
+ dk4strw.$(OBJEXT) \
+ dk4str8.$(OBJEXT) \
+ dk4memcpl.$(OBJEXT) \
+ dk4memrs.$(OBJEXT) \
+ dk4mem.$(OBJEXT) \
+ dk4error.$(OBJEXT)
# Objects for libdk4.a library
OBJLIBDK4= @LIBDK4WXOBJ@ \
+ $(LIBDK4LATAOBJ) \
$(LIBDK4LATOBJ) \
$(LIBDK4DBIAOBJ) \
$(LIBDK4SOCKAOBJ) \
- $(LIBDK4PPPTAOBJ) \
+ $(LIBDK4GRAAOBJ) \
+ $(LIBDK4BIFAOBJ) \
$(LIBDK4APPOBJ) \
$(LIBDK4MDRNDOBJ) \
$(LIBDK4SOCKOBJ) \
$(LIBDK4PPPTOBJ) \
+ $(LIBDK4GRAOBJ) \
+ $(LIBDK4BIFOBJ) \
$(LIBDK4COBJ) \
$(LIBDK4MAIODDOBJ) \
$(LIBDK4MAIOWDOBJ) \
@@ -1298,448 +1287,1234 @@ OBJLIBDK4= @LIBDK4WXOBJ@ \
$(LIBDK4DBIOBJ) \
$(LIBDK4BASEOBJ)
+# DK3 libraries
+# -------------
+
+# Objects for libdk3c.so or libdk3c.a library
+LIBDK3COBJ= \
+ dk3ufi.$(OBJEXT) \
+ dk3opt.$(OBJEXT) \
+ dk3bf.$(OBJEXT) \
+ dk3se.$(OBJEXT) \
+ dk3app.$(OBJEXT) \
+ dk3strm.$(OBJEXT) \
+ dk3print.$(OBJEXT) \
+ dk3prcfg.$(OBJEXT) \
+ dk3strkv.$(OBJEXT) \
+ dk3sto.$(OBJEXT) \
+ dk3dir.$(OBJEXT) \
+ dk3enc.$(OBJEXT) \
+ dk3str.$(OBJEXT) \
+ dk3cores.$(OBJEXT) \
+ dk3sf.$(OBJEXT) \
+ dk3echo.$(OBJEXT) \
+ dk3signl.$(OBJEXT) \
+ dk3ct.$(OBJEXT) \
+ dk3mas.$(OBJEXT) \
+ dk3maus.$(OBJEXT) \
+ dk3mai.$(OBJEXT) \
+ dk3maui.$(OBJEXT) \
+ dk3mal.$(OBJEXT) \
+ dk3maul.$(OBJEXT) \
+ dk3mad.$(OBJEXT) \
+ dk3madsc.$(OBJEXT) \
+ dk3madic.$(OBJEXT) \
+ dk3madlc.$(OBJEXT) \
+ dk3maidd.$(OBJEXT) \
+ dk3maihd.$(OBJEXT) \
+ dk3maodd.$(OBJEXT) \
+ dk3maohd.$(OBJEXT) \
+ dk3maid8.$(OBJEXT) \
+ dk3maih8.$(OBJEXT) \
+ dk3maod8.$(OBJEXT) \
+ dk3maoh8.$(OBJEXT) \
+ dk3masts.$(OBJEXT) \
+ dk3madfo.$(OBJEXT) \
+ dk3madso.$(OBJEXT) \
+ dk3madsi.$(OBJEXT) \
+ dk3inst.$(OBJEXT) \
+ dk3srch.$(OBJEXT) \
+ dk3bits.$(OBJEXT) \
+ dk3mem.$(OBJEXT) \
+ dk3bb.$(OBJEXT) \
+ dk3bezcu.$(OBJEXT) \
+ dk3xsp.$(OBJEXT) \
+ dk3kv.$(OBJEXT) @MOD_DK3WREG@ \
+ dk3trace.$(OBJEXT)
+
+# Objects for libdk3of.so or libdk3of.a library
+LIBDK3OFOBJ= \
+ dk3of.$(OBJEXT) \
+ dk3strmb.$(OBJEXT) \
+ dk3strmg.$(OBJEXT)
+
+# Objects for libdk3csrnd.so or libdk3csrnd.a library
+LIBDK3CSRNDOBJ= \
+ dk3chks.$(OBJEXT) \
+ dk3appr.$(OBJEXT)
+
+# Objects for libdk3bif.so or libdk3bif.a library
+LIBDK3BIFOBJ= \
+ dk3bifa.$(OBJEXT) \
+ dk3bif.$(OBJEXT) \
+ dk3pixre.$(OBJEXT)
+
+# Objects for libdk3dbi.so or libdk3dbi.a library
+LIBDK3DBIOBJ= \
+ dk3dbi.$(OBJEXT)
+
+# Objects for libdk3bmeps.so or libdk3bmeps.a library
+LIBDK3BMEPSOBJ= \
+ dk3bm.$(OBJEXT) \
+ dk3bmeo.$(OBJEXT) \
+ dk3bmep.$(OBJEXT) \
+ dk3bmeps.$(OBJEXT) \
+ dk3bmj.$(OBJEXT) \
+ dk3pdf.$(OBJEXT) \
+ dk3paper.$(OBJEXT)
+
+# Objects for libdk3fig.so or libdk3fig.a library
+LIBDK3FIGOBJ= \
+ dk3figbb.$(OBJEXT) \
+ dk3figpr.$(OBJEXT) \
+ dk3figah.$(OBJEXT) \
+ dk3figrd.$(OBJEXT) \
+ dk3figto.$(OBJEXT) \
+ dk3fig.$(OBJEXT) \
+ dk3font.$(OBJEXT) \
+ dk3ct.$(OBJEXT)
+
+# Objects for libdk3wx.so or libdk3wx.a library
+LIBDK3WXOBJ= \
+ DkWxProgressDialog.$(OBJEXT) \
+ DkWxCommunicator.$(OBJEXT) \
+ DkWxFrame.$(OBJEXT) \
+ DkWxDialog.$(OBJEXT) \
+ DkWxHelpController.$(OBJEXT) \
+ DkWxAppHelper.$(OBJEXT) \
+ DkWxColorView.$(OBJEXT) \
+ DkWxBufferedControl.$(OBJEXT) \
+ DkWxProcessingIdleController.$(OBJEXT) \
+ DkWxProcessingController.$(OBJEXT) \
+ dk3wxs.$(OBJEXT)
+
+# Objects for libdk3.a library
+LIBDK3ALLOBJ= @LIBDK3WXOBJ@ \
+ $(LIBDK3FIGOBJ) \
+ $(LIBDK3BMEPSOBJ) \
+ $(LIBDK3BIFOBJ) \
+ $(LIBDK3DBIOBJ) \
+ $(LIBDK3OFOBJ) \
+ $(LIBDK3COBJ)
+
+
+# Targets
+# =======
+
+# Main targets for building and installing
+# ----------------------------------------
+
+build: # Build the software
+build: build-arch build-indep
+
+all: build
+
+world: build
+
+help: # Show targets in Makefile
+ @echo 'Some systems (i.e. Windows) append a special filename extension'
+ @echo '(i.e. .exe) to program file names.'
+ @echo 'On such systems use "make dk-ls.exe" instead of "make dk-ls"'
+ @echo 'to build a program.'
+ @echo 'Here is a list of the targets in this Makefile:'
+ -@egrep '^[^:;=. ]*::?[ ]*' Makefile|grep '#'|grep -v '^#'
+
+build-arch: @BUILD_ARCH@
+
+build-indep:
+
+install: # Install the software
+install: install-arch install-indep
+
+# Install architecture-dependant files
+install-arch: install-programs install-libs
+
+# Install architecture-independant files
+install-indep: @INSTALL_INDEP@
+
+# Install architecture-independant files for rescue systems
+i-ind-res: install-dirs
+ @echo '>>> Install resource files (rescue)'
+ $(INSTALL_DATA) $(RES_RES_EN) "$(DESTDIR)$(datarootdir)/dktools/en"
+ $(INSTALL_DATA) $(RES_RES_DE) "$(DESTDIR)$(datarootdir)/dktools/de"
+ @echo '<<< Install resource files (rescue)'
+
+# Install architecture independant files for CLI systems
+i-ind-cli: i-ind-res
+ @echo '>>> Install architecture independent files (cli)'
+ $(INSTALL_DATA) dktools.pc "$(DESTDIR)$(libdir)/pkgconfig/dktools.pc"
+ $(INSTALL_DATA) etc-dk3app/dk3paper.conf "$(DESTDIR)$(sysconfdir)/dk3app"
+ $(INSTALL_DATA) etc-dk4app/dk4gra.conf "$(DESTDIR)$(sysconfdir)/dk4app"
+ $(INSTALL_SCRIPT) itaclean.sh "$(DESTDIR)$(bindir)/itaclean"
+ $(INSTALL_DATA) rshdown.conf.sample "$(DESTDIR)$(sysconfdir)/rshdown"
+ $(INSTALL_DATA) rshdown.conf "$(DESTDIR)$(sysconfdir)/rshdown"
+ $(INSTALL_DATA) printqd.conf.sample "$(DESTDIR)$(sysconfdir)/printqd"
+ $(INSTALL_DATA) printqd.conf "$(DESTDIR)$(sysconfdir)/printqd"
+ find dktools -type d -exec chmod 755 {} \;
+ find dktools -type f -exec chmod 644 {} \;
+ find dk4app -type d -exec chmod 755 {} \;
+ find dk4app -type f -exec chmod 644 {} \;
+ (cd dktools ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dktools" ; umask 0 ; tar xf -)
+ (cd dk4app ; tar cf - .) | (cd "$(DESTDIR)$(datarootdir)/dk4app" ; umask 0 ; tar xf -)
+ chmod 755 "$(DESTDIR)$(datarootdir)/dktools/htmlbook/htmlbook.sh"
+ @echo '<<< Install architecture independent files (cli)'
+
+# Install architecture-independant files for GUI systems
+i-ind-gui: i-ind-cli
+ @echo '>>> Install architecture independent files (gui)'
+ $(INSTALL_DATA) gui-img/icons/dkicon.ico "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL_DATA) gui-img/icons/wxdkdraw.ico "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL_DATA) gui-img/icons/dkclock.ico "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL_DATA) gui-img/icons/dkwxwiz.ico "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL_DATA) wxdkdraw.desktop "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL_DATA) wxbmpp.desktop "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL_DATA) wxdkclock.desktop "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL_DATA) wximgsz.desktop "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL_DATA) wxdkfcs.desktop "$(DESTDIR)$(datarootdir)/applications"
+ @echo '<<< Install architecture independent files (gui)'
+
+# Install man pages for rescue systems
+i-man-res: install-dirs
+ @echo '>>> Install man pages (rescue)'
+ $(INSTALL_DATA) $(MAN_RES) "$(DESTDIR)$(mandir)/man1"
+ @echo '<<< Install man pages (rescue)'
+
+# Install man pages for CLI systems
+i-man-cli: i-man-res
+ @echo '>>> Install man pages (cli)'
+ $(INSTALL_DATA) man/man1/*.1 "$(DESTDIR)$(mandir)/man1"
+ $(INSTALL_DATA) man/man5/*.5 "$(DESTDIR)$(mandir)/man5"
+ @echo '<<< Install man pages (cli)'
+
+# Install man pages for GUI systems
+i-man-gui: i-man-cli
+
+i-svc-sysd: install-dirs
+ @echo '>>> Install systemd service units (cli)'
+ -[ -d "$(DESTDIR)$(libdir)/systemd" ] || $(INSTALL) -d "$(DESTDIR)$(libdir)/systemd"
+ -[ -d "$(DESTDIR)$(libdir)/systemd/system" ] || $(INSTALL) -d "$(DESTDIR)$(libdir)/systemd/system"
+ -[ -d "$(DESTDIR)$(systemddir)" ] || ( mkdir -p "$(DESTDIR)$(systemddir)" ; chmod 755 "$(DESTDIR)$(systemddir)" )
+ $(INSTALL_DATA) printqd.service "$(DESTDIR)$(systemddir)"
+ $(INSTALL_DATA) rshdown.service "$(DESTDIR)$(systemddir)"
+ @echo '<<< Install systemd service units (cli)'
+
+i-svc-init: install-dirs
+ @echo '>>> Install init service scripts (cli)'
+
+ -[ -d "$(DESTDIR)$(sysconfdir)" ] || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)"
+ -[ -d "$(DESTDIR)$(sysconfdir)/init.d" ] || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/init.d"
+ cp -f initd-printqd "$(DESTDIR)$(sysconfdir)/init.d/printqd"
+ chmod 644 "$(DESTDIR)$(sysconfdir)/init.d/printqd"
+ cp -f initd-rshdown "$(DESTDIR)$(sysconfdir)/init.d/rshdown"
+ chmod 644 "$(DESTDIR)$(sysconfdir)/init.d/rshdown"
+ @echo '<<< Install init service scripts (cli)'
+
+# Install executables
+install-programs: @INSTALL_PROGRAMS@
+
+# Install executables for GUI systems
+i-prg-gui: install-dirs build-arch
+ @echo '>>> Install binaries (gui)'
+ $(INSTALL) $(PRG_GUI) "$(DESTDIR)$(bindir)"
+ @echo '<<< Install binaries (gui)'
+
+# Install executable daemons for POSIX systems
+i-prg-dae: install-dirs build-arch
+ @echo '>>> Install daemons for POSIX systems (cli)'
+ $(INSTALL) $(PRG_DAEMON_NET_POSIX) "$(DESTDIR)$(sbindir)"
+ $(INSTALL) rshdown-init "$(DESTDIR)$(sbindir)"
+ @echo '<<< Install daemons for POSIX systems (cli)'
+
+# Install executables for CLI systems
+i-prg-cli: install-dirs build-arch
+ @echo '>>> Install binaries (cli)'
+ $(INSTALL) $(PRG_CLI) "$(DESTDIR)$(bindir)"
+ @echo '<<< Install binaries (cli)'
+
+# Install executables run by other executables, not directly
+i-prg-fil: install-dirs build-arch
+ @echo '>>> Install libexec binaries (cli)'
+ $(INSTALL) $(PRG_FILTER_SNMP_POSIX) "$(DESTDIR)$(libexecdir)/dktools"
+ @echo '<<< Install libexec binaries (cli)'
+
+# Install executables for rescue systems
+i-prg-res: install-dirs build-arch
+ @echo '>>> Install binaries (rescue)'
+ $(INSTALL) $(PRG_RES) "$(DESTDIR)$(bindir)"
+ @echo '<<< Install binaries (rescue)'
+
+# Install libraries
+install-libs: @INSTALL_LIBS@
+
+# Install shared libraries for rescue system
+i-lib-dyn-res: install-dirs build-arch
+ @echo '>>> Install shared libraries (rescue)'
+ for i in $(LIB_SHARED_RES) ; do $(INSTALL) -c -m 644 $$i.$(SOVERS) "$(DESTDIR)$(libdir)" ; done
+ for i in $(LIB_SHARED_RES) ; do [ ! -e "$(DESTDIR)$(libdir)/$$i" ] || rm -f "$(DESTDIR)$(libdir)/$$i" ; done
+ for i in $(LIB_SHARED_RES) ; do $(LN_S) $$i.$(SOVERS) "$(DESTDIR)$(libdir)/$$i"; done
+ @echo '<<< Install shared libraries (rescue)'
+
+# Install shared libraries for CLI system
+i-lib-dyn-cli: install-dirs build-arch
+ @echo '>>> Install shared libraries (cli)'
+ for i in $(LIB_SHARED_CLI) ; do $(INSTALL) -c -m 644 $$i.$(SOVERS) "$(DESTDIR)$(libdir)" ; done
+ for i in $(LIB_SHARED_CLI) ; do [ ! -e "$(DESTDIR)$(libdir)/$$i" ] || rm -f "$(DESTDIR)$(libdir)/$$i" ; done
+ for i in $(LIB_SHARED_CLI) ; do $(LN_S) $$i.$(SOVERS) "$(DESTDIR)$(libdir)/$$i"; done
+ @echo '<<< Install shared libraries (cli)'
+
+# Install shared libraries for GUI system
+i-lib-dyn-gui: install-dirs build-arch
+ @echo '>>> Install shared libraries (gui)'
+ for i in $(LIB_SHARED_GUI) ; do $(INSTALL) -c -m 644 $$i.$(SOVERS) "$(DESTDIR)$(libdir)" ; done
+ for i in $(LIB_SHARED_GUI) ; do [ ! -e "$(DESTDIR)$(libdir)/$$i" ] || rm -f "$(DESTDIR)$(libdir)/$$i" ; done
+ for i in $(LIB_SHARED_GUI) ; do $(LN_S) $$i.$(SOVERS) "$(DESTDIR)$(libdir)/$$i"; done
+ @echo '<<< Install shared libraries (gui)'
+
+# Install static libraries for CLI system
+i-lib-stt-cli: install-dirs build-arch
+ @echo '>>> Install static libraries (cli)'
+ $(INSTALL_DATA) $(LIB_STATIC_CLI) "$(DESTDIR)$(libdir)"
+ @echo '<<< Install static libraries (cli)'
+
+# Install static libraries for GUI system
+i-lib-stt-gui: install-dirs build-arch
+ @echo '>>> Install static libraries (gui)'
+ $(INSTALL_DATA) $(LIB_STATIC_GUI) "$(DESTDIR)$(libdir)"
+ @echo '<<< Install static libraries (gui)'
+
+# Install header files for CLI suite
+i-hdr-cli: install-dirs build-arch
+ @echo '>>> Install header files (CLI)'
+ $(INSTALL_DATA) dk4*.h dk3trace.h "$(DESTDIR)$(includedir)/dktools-4"
+ @echo '<<< Install header files (CLI)'
+
+# Install header files for GUI suite
+i-hdr-gui: install-dirs build-arch i-hdr-cli
+ @echo '>>> Install header files (GUI)'
+ $(INSTALL_DATA) Dk4*.h "$(DESTDIR)$(includedir)/dktools-4"
+ @echo '<<< Install header files (GUI)'
+
+# Create directory structure for installation
+install-dirs:
+ @echo '>>> Create installation directories'
+ $(INSTALL) -d "$(DESTDIR)$(prefix)"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)"
+ $(INSTALL) -d "$(DESTDIR)$(libdir)"
+ $(INSTALL) -d "$(DESTDIR)$(libdir)/pkgconfig"
+ $(INSTALL) -d "$(DESTDIR)$(libexecdir)"
+ $(INSTALL) -d "$(DESTDIR)$(libexecdir)/dktools"
+ $(INSTALL) -d "$(DESTDIR)$(includedir)"
+ $(INSTALL) -d "$(DESTDIR)$(includedir)/dktools-4"
+ $(INSTALL) -d "$(DESTDIR)$(bindir)"
+ $(INSTALL) -d "$(DESTDIR)$(sbindir)"
+ $(INSTALL) -d "$(DESTDIR)$(mandir)"
+ $(INSTALL) -d "$(DESTDIR)$(mandir)/man1"
+ $(INSTALL) -d "$(DESTDIR)$(mandir)/man5"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dk4app"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools/en"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dktools/de"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/dk4app/de"
+ $(INSTALL) -d "$(DESTDIR)$(datarootdir)/applications"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/dk3app"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/dk4app"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/rshdown"
+ $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/printqd"
+ $(INSTALL) -d "$(DESTDIR)$(localstatedir)/log"
+ $(INSTALL) -d "$(DESTDIR)$(localstatedir)/run"
+ $(INSTALL) -d "$(DESTDIR)$(localstatedir)/lib"
+ @echo '<<< Create installation directories'
+
+get-orig-source: # Get original software source
+ @echo '>>> Retrieve source archive'
+ @GETSOURCE@
+ @echo '<<< Retrieve source archive'
+
+libs-shared-gui: # Shared libraries for GUI suite
+libs-shared-gui: $(LIB_SHARED_GUI)
+
+libs-shared-cli: # Shared libraries for CLI suite
+libs-shared-cli: $(LIB_SHARED_CLI)
+
+libs-shared-rescue: # Shared libraries for rescue suite
+libs-shared-rescue: $(LIB_SHARED_RES)
+
+libs-static-cli: # Static libraries for CLI suite
+libs-static-cli: $(LIB_STATIC_CLI)
+
+libs-static-gui: # Static libraries for GUI suite
+libs-static-gui: $(LIB_STATIC_GUI)
+
+clean: # Clean up (remove build results)
+ @echo '>>> Clean up (clean)'
+ -rm -f errors *.deb *.o *.obj *.exe *.a *.so *.so.$(SOVERS)
+ -rm -f $(PRG_GUI) $(PRG_CLI) $(PRG_RES)
+ -rm -f doxygen.out $(PRG_FILTER_SNMP_POSIX) $(PRG_DAEMON_NET_POSIX)
+ -rm -f dk4config$(EXEEXT)
+ -rm -f dk4wxcs$(EXEEXT)
+ -rm -f dk3config$(EXEEXT)
+ -rm -f wxcs$(EXEEXT)
+ -rm -f doc/src/*.aux doc/src/*.log doc/src/math-img.pdf
+ -rm -f doc/src/index.pdf doc/src/index.svg
+ -rm -f doc/src/next.pdf doc/src/next.svg
+ -rm -f doc/src/prev.pdf doc/src/prev.svg
+ -rm -f doc/src/toc.pdf doc/src/toc.svg
+ -rm -f testpppt.aux testpppt-i.pdf testpppt.log testpppt.pdf
+ -rm -f testpppt.tex testpppt.eps testpppt.pgf
+ -rm -f test-gra.aux test-gra.log test-gra.pdf test-gra.tex
+ @echo '<<< Clean up (clean)'
+
+distclean: # Clean up (remove build and configure script results)
+distclean: clean
+ @echo '>>> Clean up (distclean)'
+ -[ ! -f confdefs.h ] || rm -fr confdefs.h
+ -[ ! -f config.h ] || rm -fr config.h
+ -[ ! -f config.log ] || rm -fr config.log
+ -[ ! -f config.status ] || rm -fr config.status
+ -[ ! -f conftest ] || rm -fr conftest
+ -[ ! -f conftest.c ] || rm -fr conftest.c
+ -[ ! -f conftest.er1 ] || rm -fr conftest.er1
+ -[ ! -f config.h ] || rm -f config.h
+ -[ ! -f scripts/wr-dk3inst.sh ] || rm -f scripts/wr-dk3inst.sh
+ -[ ! -f scripts/wr-dk4inst.sh ] || rm -f scripts/wr-dk4inst.sh
+ -[ ! -f scripts/create-desktop-files.sh ] || rm -f scripts/create-desktop-files.sh
+ -[ ! -f initd-printqd ] || rm -f initd-printqd
+ -[ ! -f initd-rshdown ] || rm -f initd-rshdown
+ -[ ! -f dktools.pc ] || rm -f dktools.pc
+ @echo '<<< Clean up (distclean)'
+
+maketest: # Test: Check availability of make programs.
+maketest:
+ @echo OK
+
+# Clean up before building distribution archives
+cleanest: distclean
+ @echo '>>> Clean up (cleanest)'
+ -[ ! -d autom4te.cache ] || rm -fr autom4te.cache
+ scripts/clean-resources.sh
+ find dktools/help -type f -exec rm -f {} \;
+ find help-html -type f -exec rm -f {} \;
+ find doc/html -type f -exec rm -f {} \;
+ -[ ! -d doc/doxygen ] || find doc/doxygen -type f -exec rm -f {} \;
+ -[ ! -f dk4info1.c ] || rm -f dk4info1.c
+ -find help-src -name '*.html' -exec rm -f {} \;
+ -find help-src -name '*.hhc' -exec rm -f {} \;
+ -find help-src -name '*.hhk' -exec rm -f {} \;
+ -find help-src -name '*.hhp' -exec rm -f {} \;
+ -find help-src -name '*.aux' -exec rm -f {} \;
+ -find doc/src -name '*.html' -exec rm -f {} \;
+ -find doc/src -name '*.hhc' -exec rm -f {} \;
+ -find doc/src -name '*.hhk' -exec rm -f {} \;
+ -find doc/src -name '*.hhp' -exec rm -f {} \;
+ -find doc/src -name '*.aux' -exec rm -f {} \;
+ -find dktools -name '*.chm' -exec rm {} \;
+ -find dktools -name '*.htb' -exec rm {} \;
+ -find . -name '*.ico' -exec rm -f {} \;
+ -find . -name '*.xpm' -exec rm -f {} \;
+ -[ ! -x ./scripts/clean-src.sh ] || ./scripts/clean-src.sh
+ -[ ! -x ./scripts/clean-for-fig.sh ] || ./scripts/clean-for-fig.sh
+ -[ ! -x ./scripts/clean-for-tex.sh ] || ./scripts/clean-for-tex.sh
+ -rm -fr *.rc
+ -rm -fr *-gui.cpp
+ @echo '<<< Clean up (cleanest)'
+
+# Clean up before building distribution archives, check files presence
+check-cleanest: cleanest
+ @echo '>>> Check file presence (check-cleanest)'
+ perl scripts/check-filelist.pl
+ @echo '<<< Check file presence (check-cleanest)'
+
+# Clean up and update files before building distribution archives
+# Formerly we had a dependency to check-cleanest
+# Removed: scripts/touch-files.sh
+
+distrenew: cleanest
+ @echo '>>> Clean up before building distribution (distrenew)'
+ dkct -l
+ scripts/update-doxyfile.sh
+ doxygen
+ scripts/build-rc.pl
+ scripts/build-resources.sh
+ scripts/build-help.sh
+ scripts/build-doc.sh
+ scripts/build-man.sh
+ scripts/transform-config.pl
+ autoconf
+ scripts/build-spec-iss.sh
+ scripts/build-debian-changelog.pl > debian/changelog
+ sed -e 's/^dktools/dktools-doc/g' < debian/changelog > doc/debian/changelog
+ sed -e 's/^dktools/dktools-devdoc/g' < debian/changelog > devdoc/debian/changelog
+ @echo '<<< Clean up before building distribution (distrenew)'
+
+# Create distribution archives
+dist: distrenew
+ @echo '>>> Build distribution (dist)'
+ scripts/build-version.sh
+ scripts/build-distribution.sh
+ @echo '<<< Build distribution (dist)'
+
+
+# Individual targets
+# ==================
+
+# Programs run by configure script, build process silenced
+# --------------------------------------------------------
+
+dk3config: # Program: Show configuration for dk3... modules
+dk3config$(EXEEXT): dk3config.c config.h
+ @DELTARGET@
+ @$(CC) $(LDFLC_CLI_C8) $(CFL_CLI_C8) -o $@ dk3config.c -lm
+ @chmod 755 $@
+
+dk4config: # Program: Show configuration for dk4... modules
+dk4config$(EXEEXT): dk4config.c config.h
+ @DELTARGET@
+ @$(CC) $(LDFLC_CLI_C8) $(CFL_CLI_C8) -o $@ dk4config.c
+ @chmod 755 $@
+
+dk4wxcs: # Program: Show configuration wxChar size
+dk4wxcs$(EXEEXT): dk4wxcs.cpp config.h
+ @DELTARGET@
+ @$(CXX) $(LDFLCXX_CLI_C8) $(WXCXXFLAGS) $(CXXFL_CLI_C8) -o $@ dk4wxcs.cpp
+ @chmod 755 $@
+
+confprogs: # Programs to create configuration headers
+confprogs: dk3config$(EXEEXT) dk4config$(EXEEXT) dk4wxcs$(EXEEXT)
+
+
+# DK4 libraries
+# -------------
+
libdk4.a: # Static library containig all modules
libdk4.a: $(OBJLIBDK4)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(OBJLIBDK4)
$(RANLIB) $@
chmod 644 $@
+
LIBDK4WXLIBF=@LIBDK4WXLIBF@
LIBDK4WXLIBS=@LIBDK4WXLIBS@
libdk4wx.so: # Support for wxWidgets shared
libdk4wx.so: $(LIBDK4WXLIBF) $(LIBDK4WXOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4WXOBJ) $(LIBDK4WXLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C++)' $@
+ @MKSOLIBCPP@ $(LIBDK4WXOBJ) $(LIBDK4WXLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4wx.a: # Support for wxWidgets static
libdk4wx.a: libdk4c.a $(LIBDK4WXOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4WXOBJ)
$(RANLIB) $@
chmod 644 $@
+
LIBDK4SOCKALIBF=@LIBDK4SOCKALIBF@
LIBDK4SOCKALIBS=@LIBDK4SOCKALIBS@
libdk4socka.so: # Socket library with application support
libdk4socka.so: $(LIBDK4SOCKALIBF) $(LIBDK4SOCKAOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4SOCKAOBJ) $(LIBDK4SOCKALIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4SOCKAOBJ) $(LIBDK4SOCKALIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4socka.a: # Socket library with application support, static
libdk4socka.a: libdk4sock.a libdk4app.a $(LIBDK4SOCKAOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4SOCKAOBJ)
$(RANLIB) $@
chmod 644 $@
+
LIBDK4DBIALIBF=@LIBDK4DBIALIBF@
LIBDK4DBIALIBS=@LIBDK4DBIALIBS@
libdk4dbia.so: # Simple database interface with app support
libdk4dbia.so: $(LIBDK4DBIALIBF) $(LIBDK4DBIAOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4DBIAOBJ) $(LIBDK4DBIALIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4DBIAOBJ) $(LIBDK4DBIALIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4dbia.a: # Simple database interface with app support, static
libdk4dbia.a: libdk4dbi.a libdk4app.a $(LIBDK4DBIAOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4DBIAOBJ)
$(RANLIB) $@
chmod 644 $@
+
LIBDK4SOCKLIBF=@LIBDK4SOCKLIBF@
LIBDK4SOCKLIBS=@LIBDK4SOCKLIBS@
libdk4sock.so: # Socket library without application support
libdk4sock.so: $(LIBDK4SOCKLIBF) $(LIBDK4SOCKOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4SOCKOBJ) $(LIBDK4SOCKLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4SOCKOBJ) $(LIBDK4SOCKLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4sock.a: # Socket library without app support, static version
libdk4sock.a: libdk4c.a $(LIBDK4SOCKOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4SOCKOBJ)
$(RANLIB) $@
chmod 644 $@
+
+LIBDK4LATALIBF=@LIBDK4LATALIBF@
+LIBDK4LATALIBS=@LIBDK4LATALIBS@
+
+libdk4lata.so: # Text to LaTeX conversion library
+libdk4lata.so: $(LIBDK4LATALIBF) $(LIBDK4LATAOBJ)
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4LATAOBJ) $(LIBDK4LATALIBS)
+ @LN_S@ $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4lata.a: # Text to LaTeX conversion static library
+libdk4lata.a: libdk4c.a $(LIBDK4LATAOBJ)
+ @DELTARGET@
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4LATAOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
LIBDK4LATLIBF=@LIBDK4LATLIBF@
LIBDK4LATLIBS=@LIBDK4LATLIBS@
libdk4lat.so: # Text to LaTeX conversion library
libdk4lat.so: $(LIBDK4LATLIBF) $(LIBDK4LATOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4LATOBJ) $(LIBDK4LATLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4LATOBJ) $(LIBDK4LATLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4lat.a: # Text to LaTeX conversion static library
libdk4lat.a: libdk4c.a $(LIBDK4LATOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4LATOBJ)
$(RANLIB) $@
chmod 644 $@
+
+LIBDK4BIFALIBF=@LIBDK4BIFALIBF@
+LIBDK4BIFALIBS=@LIBDK4BIFALIBS@
+
+libdk4bifa.so: # Bitmap image file reader library, app support
+libdk4bifa.so: $(LIBDK4BIFALIBF) $(LIBDK4BIFAOBJ)
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4BIFAOBJ) $(LIBDK4BIFALIBS)
+ @LN_S@ $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4bifa.a: # Bitmap image file reader library, app support static
+libdk4bifa.a: $(LIBDK4BIFALIBF) $(LIBDK4BIFAOBJ)
+ @DELTARGET@
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4BIFAOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
+LIBDK4GRAALIBF=@LIBDK4GRAALIBF@
+LIBDK4GRAALIBS=@LIBDK4GRAALIBS@
+
+libdk4graa.so: # Graphics output library, app support
+libdk4graa.so: $(LIBDK4GRAALIBF) $(LIBDK4GRAAOBJ)
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4GRAAOBJ) $(LIBDK4GRAALIBS)
+ @LN_S@ $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4graa.a: # Graphics output library, app support static
+libdk4graa.a: $(LIBDK4GRAALIBF) $(LIBDK4GRAAOBJ)
+ @DELTARGET@
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4GRAAOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
LIBDK4PPPTALIBF=@LIBDK4PPPTALIBF@
LIBDK4PPPTALIBS=@LIBDK4PPPTALIBS@
libdk4pppta.so: # PS+TeX,PDF+TeX,PGF creator library
libdk4pppta.so: $(LIBDK4PPPTALIBF) $(LIBDK4PPPTAOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4PPPTAOBJ) $(LIBDK4PPPTALIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4PPPTAOBJ) $(LIBDK4PPPTALIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4pppta.a: # PS+TeX,PDF+TeX,PGF creator library static
libdk4pppta.a: libdk4app.a libdk4pppt.a $(LIBDK4PPPTAOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4PPPTAOBJ)
$(RANLIB) $@
chmod 644 $@
+
LIBDK4APPLIBF=@LIBDK4APPLIBF@
LIBDK4APPLIBS=@LIBDK4APPLIBS@
libdk4app.so: # Application support library shared
libdk4app.so: $(LIBDK4APPLIBF) $(LIBDK4APPOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4APPOBJ) $(LIBDK4APPLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @@DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4APPOBJ) $(LIBDK4APPLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4app.a: # Application support library static
libdk4app.a: libdk4c.a $(LIBDK4APPOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4APPOBJ)
$(RANLIB) $@
chmod 644 $@
+
LIBDK4MDRNDLIBF=@LIBDK4MDRNDLIBF@
LIBDK4MDRNDLIBS=@LIBDK4MDRNDLIBS@
libdk4mdrnd.so: # Message digest and random library shared
libdk4mdrnd.so: $(LIBDK4MDRNDLIBF) $(LIBDK4MDRNDOBJ)
- -[ ! -f $@ ] || rm -fr $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MDRNDOBJ) $(LIBDK4MDRNDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MDRNDOBJ) $(LIBDK4MDRNDLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4mdrnd.a: # Message digest and random library static
libdk4mdrnd.a: libdk4c.a $(LIBDK4MDRNDOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MDRNDOBJ)
$(RANLIB) $@
chmod 644 $@
+
+LIBDK4BIFLIBF=@LIBDK4BIFLIBF@
+LIBDK4BIFLIBS=@LIBDK4BIFLIBS@
+
+libdk4bif.so: # Bitmap image file reader library
+libdk4bif.so: $(LIBDK4BIFLIBF) $(LIBDK4BIFOBJ)
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4BIFOBJ) $(LIBDK4BIFLIBS)
+ @LN_S@ $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4bif.a: # Bitmap image file reader library static
+libdk4bif.a: $(LIBDK4BIFLIBF) $(LIBDK4BIFOBJ)
+ @DELTARGET@
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4BIFOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
+
+LIBDK4GRALIBF=@LIBDK4GRALIBF@
+LIBDK4GRALIBS=@LIBDK4GRALIBS@
+
+libdk4gra.so: # Graphics output library
+libdk4gra.so: $(LIBDK4GRALIBF) $(LIBDK4GRAOBJ)
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4GRAOBJ) $(LIBDK4GRALIBS)
+ @LN_S@ $@.$(SOVERS) $@
+ chmod 644 $@.$(SOVERS) $@
+
+libdk4gra.a: # Graphics output library static
+libdk4gra.a: $(LIBDK4GRALIBF) $(LIBDK4GRAOBJ)
+ @DELTARGET@
+ @echo '### Static lib ### ' $@
+ $(AR) -r $@ $(LIBDK4BIFOBJ)
+ $(RANLIB) $@
+ chmod 644 $@
+
+
+
LIBDK4PPPTLIBF=@LIBDK4PPPTLIBF@
LIBDK4PPPTLIBS=@LIBDK4PPPTLIBS@
libdk4pppt.so: # PS+TeX,PDF+TeX,PGF creator library
libdk4pppt.so: $(LIBDK4PPPTLIBF) $(LIBDK4PPPTOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4PPPTOBJ) $(LIBDK4PPPTLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4PPPTOBJ) $(LIBDK4PPPTLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4pppt.a: # PS+TeX,PDF+TeX,PGF creator library static
libdk4pppt.a: libdk4c.a $(LIBDK4PPPTOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4PPPTOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4CLIBF=@LIBDK4CLIBF@
LIBDK4CLIBS=@LIBDK4CLIBS@
libdk4c.so: # General C library shared
libdk4c.so: $(LIBDK4CLIBF) $(LIBDK4COBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4COBJ) $(LIBDK4CLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4COBJ) $(LIBDK4CLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4c.a: # General C library static
libdk4c.a: libdk4maiodd.a $(LIBDK4COBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4COBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4DBILIBF=@LIBDK4DBILIBF@
LIBDK4DBILIBS=@LIBDK4DBILIBS@
libdk4dbi.so: # Simple database interface
libdk4dbi.so: $(LIBDK4DBILIBF) $(LIBDK4DBIOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4DBIOBJ) $(LIBDK4DBILIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4DBIOBJ) $(LIBDK4DBILIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4dbi.a: # Simple database interface static library
libdk4dbi.a: libdk4ma.a $(LIBDK4DBIOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4DBIOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4MAIOXDLIBF=@LIBDK4MAIOXDLIBF@
LIBDK4MAIOXDLIBS=@LIBDK4MAIOXDLIBS@
libdk4maioxd.so: # Numeric values I/O, wxChar, decimal, shared
libdk4maioxd.so: $(LIBDK4MAIOXDLIBF) $(LIBDK4MAIOXDOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIOXDOBJ) $(LIBDK4MAIOXDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MAIOXDOBJ) $(LIBDK4MAIOXDLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maioxd.a: # Numeric values I/O, wxChar, decimal, static
libdk4maioxd.a: libdk4maio8d.a libdk4ma.a $(LIBDK4MAIOXDOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIOXDOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4MAIODDLIBF=@LIBDK4MAIODDLIBF@
LIBDK4MAIODDLIBS=@LIBDK4MAIODDLIBS@
libdk4maiodd.so: # Numeric values I/O, dkChar, decimal, shared
libdk4maiodd.so: $(LIBDK4MAIODDLIBF) $(LIBDK4MAIODDOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIODDOBJ) $(LIBDK4MAIODDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MAIODDOBJ) $(LIBDK4MAIODDLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maiodd.a: # Numeric values I/O, dkChar, decimal, static
libdk4maiodd.a: libdk4maio8d.a libdk4ma.a $(LIBDK4MAIODDOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIODDOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4MAIOWDLIBF=@LIBDK4MAIOWDLIBF@
LIBDK4MAIOWDLIBS=@LIBDK4MAIOWDLIBS@
libdk4maiowd.so: # Numeric values I/O, wchar_t, decimal, shared
libdk4maiowd.so: $(LIBDK4MAIOWDLIBF) $(LIBDK4MAIOWDOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIOWDOBJ) $(LIBDK4MAIOWDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MAIOWDOBJ) $(LIBDK4MAIOWDLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maiowd.a: # Numeric values I/O, wchar_t, decimal, static
libdk4maiowd.a: libdk4ma.a $(LIBDK4MAIOWDOBJ)
- [ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIOWDOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4MAIO8DLIBF=@LIBDK4MAIO8DLIBF@
LIBDK4MAIO8DLIBS=@LIBDK4MAIO8DLIBS@
libdk4maio8d.so: # Numeric values I/O, char, decimal, shared
libdk4maio8d.so: $(LIBDK4MAIO8DLIBF) $(LIBDK4MAIO8DOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIO8DOBJ) $(LIBDK4MAIO8DLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MAIO8DOBJ) $(LIBDK4MAIO8DLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maio8d.a: # Numeric values I/O, char, decimal, static
libdk4maio8d.a: libdk4ma.a $(LIBDK4MAIO8DOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIO8DOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4MAIODHLIBF=@LIBDK4MAIODHLIBF@
LIBDK4MAIODHLIBS=@LIBDK4MAIODHLIBS@
libdk4maiodh.so: # Numeric values I/O, dkChar, hexadecimal, shared
libdk4maiodh.so: $(LIBDK4MAIODHLIBF) $(LIBDK4MAIODHOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIODHOBJ) $(LIBDK4MAIODHLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MAIODHOBJ) $(LIBDK4MAIODHLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maiodh.a: # Numeric values I/O, dkChar, hexadecimal, static
libdk4maiodh.a: libdk4ma.a $(LIBDK4MAIODHOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIODHOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4MAIOWHLIBF=@LIBDK4MAIOWHLIBF@
LIBDK4MAIOWHLIBS=@LIBDK4MAIOWHLIBS@
libdk4maiowh.so: # Numeric values I/O, wchar_t, hexadecimal, shared
libdk4maiowh.so: $(LIBDK4MAIOWHLIBF) $(LIBDK4MAIOWHOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIOWHOBJ) $(LIBDK4MAIOWHLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MAIOWHOBJ) $(LIBDK4MAIOWHLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maiowh.a: # Numeric values I/O, wchar_t, hexadecimal, static
libdk4maiowh.a: libdk4ma.a $(LIBDK4MAIOWHOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIOWHOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4MAIO8HLIBF=@LIBDK4MAIO8HLIBF@
LIBDK4MAIO8HLIBS=@LIBDK4MAIO8HLIBS@
libdk4maio8h.so: # Numeric values I/O, char, hexadecimal, shared
libdk4maio8h.so: $(LIBDK4MAIO8HLIBF) $(LIBDK4MAIO8HOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAIO8HOBJ) $(LIBDK4MAIO8HLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MAIO8HOBJ) $(LIBDK4MAIO8HLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4maio8h.a: # Numeric values I/O, char, hexadecimal, static
libdk4maio8h.a: libdk4ma.a $(LIBDK4MAIO8HOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAIO8HOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4MALIBF=@LIBDK4MALIBF@
LIBDK4MALIBS=@LIBDK4MALIBS@
libdk4ma.so: # Mathematics library, shared
libdk4ma.so: $(LIBDK4MALIBF) $(LIBDK4MAOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4MAOBJ) $(LIBDK4MALIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4MAOBJ) $(LIBDK4MALIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4ma.a: # Mathematics library, static
libdk4ma.a: libdk4base.a $(LIBDK4MAOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4MAOBJ)
$(RANLIB) $@
chmod 644 $@
+
+
LIBDK4BASELIBF=@LIBDK4BASELIBF@
LIBDK4BASELIBS=@LIBDK4BASELIBS@
libdk4base.so: # Base library, shared
libdk4base.so: $(LIBDK4BASELIBF) $(LIBDK4BASEOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- @echo '### Shared lib ### ' $@
- $(MKSOLIB) $(LIBDK4BASEOBJ) $(LIBDK4BASELIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK4BASEOBJ) $(LIBDK4BASELIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk4base.a: # Base library, static
libdk4base.a: $(LIBDK4BASEOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
@echo '### Static lib ### ' $@
$(AR) -r $@ $(LIBDK4BASEOBJ)
$(RANLIB) $@
chmod 644 $@
-#
-# Programs to fix configure script results to DK4_HAVE_... constants
-#
+# DK4 programs
+# ------------
+
+WXDKDRAWOBJ= \
+ WxdkdrawApp.$(OBJEXT) \
+ WxdkdrawFrame.$(OBJEXT) \
+ WxdkdrawFrameEvents.$(OBJEXT) \
+ WxdkdrawFrameStipples.$(OBJEXT) \
+ WxdkdrawFrameTools.$(OBJEXT) \
+ WxdkdrawDlgLineStyle.$(OBJEXT) \
+ WxdkdrawDlgStyleLength.$(OBJEXT) \
+ WxdkdrawDlgLineJoin.$(OBJEXT) \
+ WxdkdrawDlgMiterLimit.$(OBJEXT) \
+ WxdkdrawDlgLineCap.$(OBJEXT) \
+ WxdkdrawDlgArrowType.$(OBJEXT) \
+ WxdkdrawDlgArrowSize.$(OBJEXT) \
+ WxdkdrawDlgFillStyle.$(OBJEXT) \
+ WxdkdrawDlgTextAlign.$(OBJEXT) \
+ WxdkdrawDlgFontName.$(OBJEXT) \
+ WxdkdrawDlgLayerManager.$(OBJEXT) \
+ WxdkdrawDlgTextInput.$(OBJEXT) \
+ WxdkdrawDlgSplineValue.$(OBJEXT) \
+ WxdkdrawDlgImageOptions.$(OBJEXT) \
+ WxdkdrawDlgDotFilled.$(OBJEXT) \
+ WxdkdrawDlgBoxRadius.$(OBJEXT) \
+ WxdkdrawDlgOptionsNewObjects.$(OBJEXT) \
+ WxdkdrawDlgOptionsScreen.$(OBJEXT) \
+ WxdkdrawMouse.$(OBJEXT) \
+ WxdkdrawControlEvents.$(OBJEXT) \
+ WxdkdrawControlDraw.$(OBJEXT) \
+ WxdkdrawControlArrows.$(OBJEXT) \
+ WxdkdrawControlTools.$(OBJEXT) \
+ WxdkdrawControl.$(OBJEXT) \
+ WxdkdrawWrite.$(OBJEXT) \
+ WxdkdrawRead.$(OBJEXT) \
+ WxdkdrawComp.$(OBJEXT) \
+ WxdkdrawObj.$(OBJEXT) \
+ WxdkdrawFont.$(OBJEXT) \
+ wxdarc.$(OBJEXT)
+
+
+WXDKDRAWLIBF=@WXDKDRAWLIBF@
+WXDKDRAWLIBS=@WXDKDRAWLIBS@
+
+wxdkdraw: # Program: Drawing application for use with LaTeX
+wxdkdraw$(EXEEXT): $(WXDKDRAWLIBF) $(WXDKDRAWOBJ)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXDKDRAWOBJ) $(WXDKDRAWLIBS)
+ chmod 755 $@
+
+
+
+WXBMPPOBJ= Bmpp4App.$(OBJEXT) \
+ Bmpp4Frame.$(OBJEXT) \
+ Bmpp4Progress.$(OBJEXT) @WXBMPPRES@
-dk3config: # Program: Show configuration for dk3... modules
-dk3config$(EXEEXT): dk3config.c
- @-[ ! -f dk3conig ] || rm -f dk3config
- @$(COMPILEC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dk3config.c -lm
- @chmod 755 dk3config
+WXBMPPLIBF=@WXBMPPLIBF@
+WXBMPPLIBS=@WXBMPPLIBS@
+
+wxbmpp: # Program: Bitmap to PS/PDF converter (GUI)
+wxbmpp$(EXEEXT): $(WXBMPPLIBF) $(WXBMPPOBJ)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXBMPPOBJ) $(WXBMPPLIBS)
+ chmod 755 $@
-dk4config: # Program: Show configuration for dk4... modules
-dk4config$(EXEEXT): dk4config.cpp
- @-[ ! -f $@ ] || rm -f $@
- @$(COMPILECPP) $(LDFLAGS) $(WXLDFLAGS) -o $@ dk4config.cpp
- @chmod 755 $@
-wxcs: # Program: Show wxChar character size
-wxcs$(EXEEXT): wxcs.cpp
- @-[ ! -f $@ ] || rm -f $@
- @$(COMPILECPP) $(LDFLAGS) $(WXLDFLAGS) -o $@ wxcs.cpp
- @chmod 755 $@
+WXDKFCSOBJ= Dk4FcsApp.$(OBJEXT) \
+ Dk4FcsFrame.$(OBJEXT) @WXDKFCSRES@
+
+WXDKFCSLIBF=@WXDKFCSLIBF@
+WXDKFCSLIBS=@WXDKFCSLIBS@
+
+wxdkfcs: # Program: File checksums with GUI
+wxdkfcs$(EXEEXT): $(WXDKFCSLIBF) $(WXDKFCSOBJ)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXDKFCSOBJ) $(WXDKFCSLIBS)
+ chmod 755 $@
+
+
+
+WXPQDICOBJ= WxpqdicApp.$(OBJEXT) \
+ WxpqdicFrame.$(OBJEXT) @WXPQDICRES@
+
+WXPQDICLIBF=@WXPQDICLIBF@
+WXPQDICLIBS=@WXPQDICLIBS@
+
+wxpqdic: # Program: Client for printqd queries
+wxpqdic$(EXEEXT): $(WXPQDICLIBF) $(WXPQDICOBJ)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXPQDICOBJ) $(WXPQDICLIBS)
+ chmod 755 $@
+
+
+
+CHSCRSZOBJ= ScreenSizeApp.$(OBJEXT) \
+ ScreenSizeFrame.$(OBJEXT) @WXDKSCRSZRES@
+
+CHSCRSZLIBF=@CHSCRSZLIBF@
+CHSCRSZLIBS=@CHSCRSZLIBS@
+
+ChangeScreenSize$(EXEEXT): $(CHSCRSZLIBF) $(CHSCRSZOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CXX) $(LDFLCXX_CLI_DK) -o $@ $(CHSCRSZOBJ) $(CHSCRSZLIBS)
+ chmod 755 $@
+
+
+
+BMPPOBJ= bmpp.$(OBJEXT) @BMPPRES@
+
+BMPPLIBF=@BMPPLIBF@
+BMPPLIBS=@BMPPLIBS@
+
+bmpp: # Program: Bitmap to PS/PDF converter (CLI)
+bmpp$(EXEEXT): $(BMPPLIBF) $(BMPPOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(BMPPOBJ) $(BMPPLIBS)
+ chmod 755 $@
+
+
+
+WXD2LATLIBF=@WXD2LATLIBF@
+WXD2LATLIBS=@WXD2LATLIBS@
+
+WXD2LATOBJ= wxd2lat.$(OBJEXT) \
+ wxd2lout.$(OBJEXT) \
+ wxd2lah.$(OBJEXT) \
+ wxd2lxs.$(OBJEXT) \
+ wxdrd.$(OBJEXT) \
+ w2llic.$(OBJEXT) \
+ wxdstr.$(OBJEXT) \
+ wxdobj.$(OBJEXT) \
+ wxdcomp.$(OBJEXT) \
+ wxdarc.$(OBJEXT)
+
+wxd2lat: # Program: WXD to LaTeX converter
+wxd2lat$(EXEEXT): $(WXD2LATOBJ) $(WXD2LATLIBF)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(WXD2LATOBJ) $(WXD2LATLIBS)
+ chmod 755 $@
+
+
+
+PLPDFTEXLIBF=@PLPDFTEXLIBF@
+PLPDFTEXLIBS=@PLPDFTEXLIBS@
+
+PLPDFTEXOBJ= plpdftex.$(OBJEXT) @PLPDFTEXRES@
+
+plpdftex: # Program: Plot driver for octpgfpl package
+plpdftex$(EXEEXT): $(PLPDFTEXLIBF) $(PLPDFTEXOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(PLPDFTEXOBJ) $(PLPDFTEXLIBS)
+ chmod 755 $@
-# ##### Start of dktools-4 section
DKCATLIBF=@DKCATLIBF@
DKCATLIBS=@DKCATLIBS@
+DKCATOBJ= dk-cat.$(OBJEXT) @DKCATRES@
+
dk-cat: # Program: Show file contents
-dk-cat$(EXEEXT): $(DKCATLIBF) dk-cat.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-cat.o $(DKCATLIBS)
+dk-cat$(EXEEXT): $(DKCATLIBF) $(DKCATOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKCATOBJ) $(DKCATLIBS)
chmod 755 $@
@@ -1747,11 +2522,13 @@ dk-cat$(EXEEXT): $(DKCATLIBF) dk-cat.o
DKBLKSLIBF=@DKBLKSLIBF@
DKBLKSLIBS=@DKBLKSLIBS@
+DKBLKSOBJ= dk-blks.$(OBJEXT) @DKBLKSRES@
+
dk-blks: # Program: Adjust block size
-dk-blks$(EXEEXT): $(DKBLKSLIBF) dk-blks.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-blks.o $(DKBLKSLIBS)
+dk-blks$(EXEEXT): $(DKBLKSLIBF) $(DKBLKSOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKBLKSOBJ) $(DKBLKSLIBS)
chmod 755 $@
@@ -1759,11 +2536,13 @@ dk-blks$(EXEEXT): $(DKBLKSLIBF) dk-blks.o
DKSQLSPLITLIBF=@DKSQLSPLITLIBF@
DKSQLSPLITLIBS=@DKSQLSPLITLIBS@
+DKSQLSPLITOBJ= dk-sqlsplit.$(OBJEXT) @DKSQLSPLITRES@
+
dk-sqlsplit: # Program: Split overlong SQL lines
-dk-sqlsplit$(EXEEXT): $(DKSQLSPLITLIBF) dk-sqlsplit.o
+dk-sqlsplit$(EXEEXT): $(DKSQLSPLITLIBF) $(DKSQLSPLITOBJ)
-[ ! -f $@ ] || rm -fr $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-sqlsplit.o $(DKSQLSPLITLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKSQLSPLITOBJ) $(DKSQLSPLITLIBS)
chmod 755 $@
@@ -1771,16 +2550,18 @@ dk-sqlsplit$(EXEEXT): $(DKSQLSPLITLIBF) dk-sqlsplit.o
DKERADISKLIBF=@DKERADISKLIBF@
DKERADISKLIBS=@DKERADISKLIBS@
+DKERADISKOBJ= dk-eradisk.$(OBJEXT) @DKERADISKRES@
+
dk-eradisk: # Program: Create data stream for disk deletion
-dk-eradisk$(EXEEXT): $(DKERADISKLIBF) dk-eradisk.o
+dk-eradisk$(EXEEXT): $(DKERADISKLIBF) $(DKERADISKOBJ)
-[ ! -f $@ ] || rm -fr $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-eradisk.o $(DKERADISKLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKERADISKOBJ) $(DKERADISKLIBS)
chmod 755 $@
-DKLSOBJ= dk-ls.o dk-ls-to.o
+DKLSOBJ= dk-ls.$(OBJEXT) dk-ls-to.$(OBJEXT) @DKLSRES@
DKLSLIBF=@DKLSLIBF@
DKLSLIBS=@DKLSLIBS@
@@ -1788,22 +2569,36 @@ DKLSLIBS=@DKLSLIBS@
dk-ls: # Program: SHow information about files
dk-ls$(EXEEXT): $(DKLSLIBF) $(DKLSOBJ)
-[ ! -f $@ ] || rm -fr $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(DKLSOBJ) $(DKLSLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKLSOBJ) $(DKLSLIBS)
chmod 755 $@
-DKSORTOBJ= dk-sort.o
+DKSORTOBJ= dk-sort.$(OBJEXT) @DKSORTRES@
DKSORTLIBF=@DKSORTLIBF@
DKSORTLIBS=@DKSORTLIBS@
dk-sort: # Program: Text sorting in different encodings
dk-sort$(EXEEXT): $(DKSORTLIBF) $(DKSORTOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -L. -o $@ $(DKSORTOBJ) $(DKSORTLIBS)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKSORTOBJ) $(DKSORTLIBS)
+ chmod 755 $@
+
+
+
+DKLINESOBJ= dk-lines.$(OBJEXT) @DKLINESRES@
+
+DKLINESLIBF=@DKLINESLIBF@
+DKLINESLIBS=@DKLINESLIBS@
+
+dk-lines: # Program: Text linesing in different encodings
+dk-lines$(EXEEXT): $(DKLINESLIBF) $(DKLINESOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKLINESOBJ) $(DKLINESLIBS)
chmod 755 $@
@@ -1811,11 +2606,13 @@ dk-sort$(EXEEXT): $(DKSORTLIBF) $(DKSORTOBJ)
DKFICLIBF=@DKFICLIBF@
DKFICLIBS=@DKFICLIBS@
+DKFICOBJ= dk-fic.$(OBJEXT) @DKFICRES@
+
dk-fic: # Program: File integrity checker (CLI)
-dk-fic$(EXEEXT): $(DKFICLIBF) dk-fic.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-fic.o $(DKFICLIBS)
+dk-fic$(EXEEXT): $(DKFICLIBF) $(DKFICOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKFICOBJ) $(DKFICLIBS)
chmod 755 $@
@@ -1824,10 +2621,10 @@ DKUIDLIBF=@DKUIDLIBF@
DKUIDLIBS=@DKUIDLIBS@
dk-uid: # Program: Find free UID in given range
-dk-uid$(EXEEXT): $(DKUIDLIBF) dk-uid.o
+dk-uid$(EXEEXT): $(DKUIDLIBF) dk-uid.$(OBJEXT)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-uid.o $(DKUIDLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ dk-uid.$(OBJEXT) $(DKUIDLIBS)
chmod 755 $@
@@ -1835,11 +2632,13 @@ dk-uid$(EXEEXT): $(DKUIDLIBF) dk-uid.o
DKPWGENLIBF=@DKPWGENLIBF@
DKPWGENLIBS=@DKPWGENLIBS@
+DKPWGENOBJ= dk-pwgen.$(OBJEXT) @DKPWGENRES@
+
dk-pwgen: # Program: Passwort/PIN/WiFi key generator
-dk-pwgen$(EXEEXT): $(DKPWGENLIBF) dk-pwgen.o
+dk-pwgen$(EXEEXT): $(DKPWGENLIBF) $(DKPWGENOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-pwgen.o $(DKPWGENLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKPWGENOBJ) $(DKPWGENLIBS)
chmod 755 $@
@@ -1847,11 +2646,13 @@ dk-pwgen$(EXEEXT): $(DKPWGENLIBF) dk-pwgen.o
DKRANDLIBF=@DKRANDLIBF@
DKRANDLIBS=@DKRANDLIBS@
+DKRANDOBJ= dk-rand.$(OBJEXT) @DKRANDRES@
+
dk-rand: # Program: Random data generator
-dk-rand$(EXEEXT): $(DKRANDLIBF) dk-rand.o
+dk-rand$(EXEEXT): $(DKRANDLIBF) $(DKRANDOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-rand.o $(DKRANDLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKRANDOBJ) $(DKRANDLIBS)
chmod 755 $@
@@ -1859,11 +2660,13 @@ dk-rand$(EXEEXT): $(DKRANDLIBF) dk-rand.o
DKT2HLIBF=@DKT2HLIBF@
DKT2HLIBS=@DKT2HLIBS@
+DKT2HOBJ= dk-t2h.$(OBJEXT) @DKT2HRES@
+
dk-t2h: # Program: Convert text to HTML
-dk-t2h$(EXEEXT): $(DKT2HLIBF) dk-t2h.o
+dk-t2h$(EXEEXT): $(DKT2HLIBF) $(DKT2HOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-t2h.o $(DKT2HLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKT2HOBJ) $(DKT2HLIBS)
chmod 755 $@
@@ -1871,23 +2674,39 @@ dk-t2h$(EXEEXT): $(DKT2HLIBF) dk-t2h.o
DKT2LLIBF=@DKT2LLIBF@
DKT2LLIBS=@DKT2LLIBS@
+DKT2LOBJ= dk-t2l.$(OBJEXT) @DKT2LRES@
+
dk-t2l: # Program: Convert text to LaTeX
-dk-t2l$(EXEEXT): $(DKT2LLIBF) dk-t2l.o
+dk-t2l$(EXEEXT): $(DKT2LLIBF) $(DKT2LOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-t2l.o $(DKT2LLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKT2LOBJ) $(DKT2LLIBS)
chmod 755 $@
+DKBIN2CLIBF=@DKBIN2CLIBF@
+DKBIN2CLIBS=@DKBIN2CLIBS@
+
+DKBIN2COBJ= dk-bin2c.$(OBJEXT) @DKBIN2CRES@
+
+dk-bin2c: # Program: Convert binary data to C source
+dk-bin2c$(EXEEXT): $(DKBIN2CLIBF) $(DKBIN2COBJ)
+ [ ! -f $@ ] || rm -f $@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKBIN2COBJ) $(DKBIN2CLIBS)
+ chmod 755 $@
+
DKHEXLIBF=@DKHEXLIBF@
DKHEXLIBS=@DKHEXLIBS@
+DKHEXOBJ= dk-hex.$(OBJEXT) @DKHEXRES@
+
dk-hex: # Program: Show file contents in hexadecimal notation
-dk-hex$(EXEEXT): $(DKHEXLIBF) dk-hex.o
+dk-hex$(EXEEXT): $(DKHEXLIBF) $(DKHEXOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-hex.o $(DKHEXLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKHEXOBJ) $(DKHEXLIBS)
chmod 755 $@
@@ -1895,11 +2714,13 @@ dk-hex$(EXEEXT): $(DKHEXLIBF) dk-hex.o
DKBMMLIBF=@DKBMMLIBF@
DKBMMLIBS=@DKBMMLIBS@
+DKBMMOBJ= dk-bmm.$(OBJEXT) @DKBMMRES@
+
dk-bmm: # Program: Backup media management
-dk-bmm$(EXEEXT): $(DKBMMLIBF) dk-bmm.o
+dk-bmm$(EXEEXT): $(DKBMMLIBF) $(DKBMMOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-bmm.o $(DKBMMLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKBMMOBJ) $(DKBMMLIBS)
chmod 755 $@
@@ -1907,11 +2728,13 @@ dk-bmm$(EXEEXT): $(DKBMMLIBF) dk-bmm.o
DKPWDLIBF=@DKPWDLIBF@
DKPWDLIBS=@DKPWDLIBS@
+DKPWDOBJ= dk-pwd.$(OBJEXT) @DKPWDRES@
+
dk-pwd: # Program: Print working directory
-dk-pwd$(EXEEXT): $(DKPWDLIBF) dk-pwd.o
+dk-pwd$(EXEEXT): $(DKPWDLIBF) $(DKPWDOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-pwd.o $(DKPWDLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKPWDOBJ) $(DKPWDLIBS)
chmod 755 $@
@@ -1919,11 +2742,13 @@ dk-pwd$(EXEEXT): $(DKPWDLIBF) dk-pwd.o
DKRECVLIBF=@DKRECVLIBF@
DKRECVLIBS=@DKRECVLIBS@
+DKRECVOBJ= dk-recv.$(OBJEXT) @DKRECVRES@
+
dk-recv: # Program: Receive data stream from dk-send process
-dk-recv$(EXEEXT): $(DKRECVLIBF) dk-recv.o
+dk-recv$(EXEEXT): $(DKRECVLIBF) $(DKRECVOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-recv.o $(DKRECVLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKRECVOBJ) $(DKRECVLIBS)
chmod 755 $@
@@ -1931,53 +2756,41 @@ dk-recv$(EXEEXT): $(DKRECVLIBF) dk-recv.o
DKSENDLIBF=@DKSENDLIBF@
DKSENDLIBS=@DKSENDLIBS@
+DKSENDOBJ= dk-send.$(OBJEXT) @DKSENDRES@
+
dk-send: # Program: Send data to one or multiple recipients
-dk-send$(EXEEXT): $(DKSENDLIBF) dk-send.o
+dk-send$(EXEEXT): $(DKSENDLIBF) $(DKSENDOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-send.o $(DKSENDLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKSENDOBJ) $(DKSENDLIBS)
chmod 755 $@
-PRINTQDOBJ= printqd.o
+PRINTQDOBJ= printqd.$(OBJEXT)
PRINTQDLIBF=@PRINTQDLIBF@
PRINTQDLIBS=@PRINTQDLIBS@
printqd: # Program: Print quota enforcement daemon
printqd$(EXEEXT): $(PRINTQDLIBF) $(PRINTQDOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(PRINTQDOBJ) $(PRINTQDLIBS)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ $(PRINTQDOBJ) $(PRINTQDLIBS)
chmod 755 $@
-PRINTQDCOBJ= printqdc.o
+PRINTQDCOBJ= printqdc.$(OBJEXT)
PRINTQDCLIBF=@PRINTQDCLIBF@
PRINTQDCLIBS=@PRINTQDCLIBS@
printqdc: # Program: Print quota client
printqdc$(EXEEXT): $(PRINTQDCLIBF) $(PRINTQDCOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(PRINTQDCOBJ) $(PRINTQDCLIBS)
- chmod 755 $@
-
-
-
-WXPQDICOBJ= WxpqdicApp.o WxpqdicFrame.o
-
-WXPQDICLIBF=@WXPQDICLIBF@
-WXPQDICLIBS=@WXPQDICLIBS@
-
-wxpqdic: # Program: Client for printqd queries
-wxpqdic$(EXEEXT): $(WXPQDICLIBF) $(WXPQDICOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXPQDICOBJ) $(WXPQDICLIBS)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ $(PRINTQDCOBJ) $(PRINTQDCLIBS)
chmod 755 $@
@@ -1986,10 +2799,10 @@ PJSNMPLIBF=@PJSNMPLIBF@
PJSNMPLIBS=@PJSNMPLIBS@
pjsnmp: # Program: Print job transfer using TCP and SNMP
-pjsnmp$(EXEEXT): $(PJSNMPLIBF) pjsnmp.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ pjsnmp.o $(PJSNMPLIBS)
+pjsnmp$(EXEEXT): $(PJSNMPLIBF) pjsnmp.$(OBJEXT)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ pjsnmp.$(OBJEXT) $(PJSNMPLIBS)
chmod 755 $@
@@ -1998,10 +2811,10 @@ PRMONSNMPLIBF=@PRMONSNMPLIBF@
PRMONSNMPLIBS=@PRMONSNMPLIBS@
prmonsnmp: # Program: Monitor printers using SNMP
-prmonsnmp$(EXEEXT): $(PRMONSNMPLIBF) prmonsnmp.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ prmonsnmp.o $(PRMONSNMPLIBS)
+prmonsnmp$(EXEEXT): $(PRMONSNMPLIBF) prmonsnmp.$(OBJEXT)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ prmonsnmp.$(OBJEXT) $(PRMONSNMPLIBS)
chmod 755 $@
@@ -2009,37 +2822,56 @@ prmonsnmp$(EXEEXT): $(PRMONSNMPLIBF) prmonsnmp.o
LPRNGCLLIBF=@LPRNGCLLIBF@
LPRNGCLLIBS=@LPRNGCLLIBS@
+LPRNGCLOBJ= lprngcl.$(OBJEXT) @LPRNGCLRES@
+
lprngcl: # Program: LPRng queue cleanup
-lprngcl$(EXEEXT): $(LPRNGCLLIBF) lprngcl.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ lprngcl.o $(LPRNGCLLIBS)
+lprngcl$(EXEEXT): $(LPRNGCLLIBF) $(LPRNGCLOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(LPRNGCLOBJ) $(LPRNGCLLIBS)
chmod 755 $@
+ADDCTRLDLIBF=@ADDCTRLDLIBF@
+ADDCTRLDLIBS=@ADDCTRLDLIBS@
+
+ADDCTRLDOBJ= addctrld.$(OBJEXT) @ADDCTRLDRES@
+
+addctrld: # Program: Filter to ensure Ctrl-D as final byte
+addctrld$(EXEEXT): $(ADDCTRLDLIBF) $(ADDCTRLDOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ $(ADDCTRLDOBJ) $(ADDCTRLDLIBS)
+ chmod 755 $@
DKDBT2LIBF=@DKDBT2LIBF@
DKDBT2LIBS=@DKDBT2LIBS@
+DKDB2TOBJ= dk-db2t.$(OBJEXT) @DKDB2TRES@
+
dk-db2t: # Program: Convert database to text
-dk-db2t$(EXEEXT): $(DKDBT2LIBF) dk-db2t.o
+dk-db2t$(EXEEXT): $(DKDBT2LIBF) $(DKDB2TOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-db2t.o $(DKDBT2LIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKDB2TOBJ) $(DKDBT2LIBS)
chmod 755 $@
+DKDBCOOBJ= dk-dbco.$(OBJEXT) @DKDBCORES@
+
dk-dbco: # Program: Copy database
-dk-dbco$(EXEEXT): $(DKDBT2LIBF) dk-dbco.o
+dk-dbco$(EXEEXT): $(DKDBT2LIBF) $(DKDBCOOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-dbco.o $(DKDBT2LIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKDBCOOBJ) $(DKDBT2LIBS)
chmod 755 $@
+DKT2DBOBJ= dk-t2db.$(OBJEXT) @DKDBTRES@
+
dk-t2db: # Program: Convert text to database
-dk-t2db$(EXEEXT): $(DKDBT2LIBF) dk-t2db.o
+dk-t2db$(EXEEXT): $(DKDBT2LIBF) $(DKT2DBOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk-t2db.o $(DKDBT2LIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKT2DBOBJ) $(DKDBT2LIBS)
chmod 755 $@
@@ -2048,10 +2880,10 @@ RSHDOWNLIBF=@RSHDOWNLIBF@
RSHDOWNLIBS=@RSHDOWNLIBS@
rshdown: # Program: Remote shutdown
-rshdown$(EXEEXT): $(RSHDOWNLIBF) rshdown.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ rshdown.o $(RSHDOWNLIBS)
+rshdown$(EXEEXT): $(RSHDOWNLIBF) rshdown.$(OBJEXT)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_C8) -o $@ rshdown.$(OBJEXT) $(RSHDOWNLIBS)
chmod 755 $@
@@ -2059,142 +2891,23 @@ rshdown$(EXEEXT): $(RSHDOWNLIBF) rshdown.o
DK4INFOLIBF=@DK4INFOLIBF@
DK4INFOLIBS=@DK4INFOLIBS@
+DK4INFOOBJ= dk4info.$(OBJEXT) @DK4INFORES@
+
dk4info: # Program: Show information about this build
-dk4info$(EXEEXT): $(DK4INFOLIBF) dk4info.o
+dk4info$(EXEEXT): $(DK4INFOLIBF) $(DK4INFOOBJ)
[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk4info.o $(DK4INFOLIBS)
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DK4INFOOBJ) $(DK4INFOLIBS)
chmod 755 $@
-# ##### End of dktools-4 section
-
-
-
-# ##### Start of dktools-3 section
-
-# Objects for libdk3c.so or libdk3c.a library
-LIBDK3COBJ= \
- dk3ufi.o \
- dk3opt.o \
- dk3bf.o \
- dk3se.o \
- dk3app.o \
- dk3strm.o \
- dk3print.o \
- dk3prcfg.o \
- dk3strkv.o \
- dk3sto.o \
- dk3dir.o \
- dk3enc.o \
- dk3str.o \
- dk3cores.o \
- dk3sf.o \
- dk3echo.o \
- dk3signl.o \
- dk3ct.o \
- dk3mas.o \
- dk3maus.o \
- dk3mai.o \
- dk3maui.o \
- dk3mal.o \
- dk3maul.o \
- dk3mad.o \
- dk3madsc.o \
- dk3madic.o \
- dk3madlc.o \
- dk3maidd.o \
- dk3maihd.o \
- dk3maodd.o \
- dk3maohd.o \
- dk3maid8.o \
- dk3maih8.o \
- dk3maod8.o \
- dk3maoh8.o \
- dk3masts.o \
- dk3madfo.o \
- dk3madso.o \
- dk3madsi.o \
- dk3inst.o \
- dk3srch.o \
- dk3bits.o \
- dk3mem.o \
- dk3bb.o \
- dk3bezcu.o \
- dk3xsp.o \
- dk3kv.o \
- dk3trace.o
-
-# Objects for libdk3of.so or libdk3of.a library
-LIBDK3OFOBJ= \
- dk3of.o \
- dk3strmb.o \
- dk3strmg.o
-
-# Objects for libdk3csrnd.so or libdk3csrnd.a library
-LIBDK3CSRNDOBJ= \
- dk3chks.o \
- dk3appr.o
-
-# Objects for libdk3bif.so or libdk3bif.a library
-LIBDK3BIFOBJ= \
- dk3bifa.o \
- dk3bif.o \
- dk3pixre.o
-
-# Objects for libdk3dbi.so or libdk3dbi.a library
-LIBDK3DBIOBJ= \
- dk3dbi.o
-
-# Objects for libdk3bmeps.so or libdk3bmeps.a library
-LIBDK3BMEPSOBJ= \
- dk3bm.o \
- dk3bmeo.o \
- dk3bmep.o \
- dk3bmeps.o \
- dk3bmj.o \
- dk3pdf.o \
- dk3paper.o
-
-# Objects for libdk3fig.so or libdk3fig.a library
-LIBDK3FIGOBJ= \
- dk3figbb.o \
- dk3figpr.o \
- dk3figah.o \
- dk3figrd.o \
- dk3figto.o \
- dk3fig.o \
- dk3font.o \
- dk3ct.o
-
-# Objects for libdk3wx.so or libdk3wx.a library
-LIBDK3WXOBJ= \
- DkWxProgressDialog.o \
- DkWxCommunicator.o \
- DkWxFrame.o \
- DkWxDialog.o \
- DkWxHelpController.o \
- DkWxAppHelper.o \
- DkWxColorView.o \
- DkWxBufferedControl.o \
- DkWxProcessingIdleController.o \
- DkWxProcessingController.o \
- dk3wxs.o
-
-# Objects for libdk3.a library
-LIBDK3ALLOBJ= @LIBDK3WXOBJ@ \
- $(LIBDK3FIGOBJ) \
- $(LIBDK3BMEPSOBJ) \
- $(LIBDK3BIFOBJ) \
- $(LIBDK3CSRNDOBJ) \
- $(LIBDK3DBIOBJ) \
- $(LIBDK3OFOBJ) \
- $(LIBDK3COBJ)
+# DK3 libraries
+# -------------
libdk3.a: # Large library containing all dktools-3 modules.
libdk3.a: $(LIBDK3ALLOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3ALLOBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2205,17 +2918,18 @@ LIBDK3TRACELIBF=@LIBDK3TRACELIBF@
LIBDK3TRACELIBS=@LIBDK3TRACELIBS@
libdk3trace.so: # The libdk3trace library (shared)
-libdk3trace.so: $(LIBDK3TRACELIBF) dk3trace.o
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) dk3trace.o $(LIBDK3TRACELIBS)
- $(LN_S) $@.$(SOVERS) $@
+libdk3trace.so: $(LIBDK3TRACELIBF) dk3trace.$(OBJEXT)
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ dk3trace.$(OBJEXT) $(LIBDK3TRACELIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3trace.a: # The libdk3trace library (static)
-libdk3trace.a: dk3trace.o
- -[ ! -f $@ ] || rm -f $@
- $(AR) -r $@ dk3trace.o
+libdk3trace.a: dk3trace.$(OBJEXT)
+ @DELTARGET@
+ $(AR) -r $@ dk3trace.$(OBJEXT)
$(RANLIB) $@
chmod 644 $@
@@ -2226,15 +2940,16 @@ LIBDK3CLIBS=@LIBDK3CLIBS@
libdk3c.so: # The libdk3c library (shared).
libdk3c.so: $(LIBDK3CLIBF) $(LIBDK3COBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3COBJ) $(LIBDK3CLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK3COBJ) $(LIBDK3CLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3c.a: # The libdk3c library (static).
libdk3c.a: $(LIBDK3COBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3COBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2246,15 +2961,16 @@ LIBDK3OFLIBS=@LIBDK3OFLIBS@
libdk3of.so: # The dktools-3 output filter library (shared).
libdk3of.so: $(LIBDK3OFLIBF) $(LIBDK3OFOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3OFOBJ) $(LIBDK3OFLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK3OFOBJ) $(LIBDK3OFLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3of.a: # The dktools-3 output filter library (static).
libdk3of.a: $(LIBDK3OFOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3OFOBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2266,15 +2982,16 @@ LIBDK3CSRNDLIBS=@LIBDK3CSRNDLIBS@
libdk3csrnd.so: # The dktools-3 checksum and random library (shared).
libdk3csrnd.so: $(LIBDK3CSRNDLIBF) $(LIBDK3CSRNDOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3CSRNDOBJ) $(LIBDK3CSRNDLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK3CSRNDOBJ) $(LIBDK3CSRNDLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3csrnd.a: # The dktools-3 checksum and random library (static).
libdk3csrnd.a: $(LIBDK3CSRNDOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3CSRNDOBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2286,15 +3003,16 @@ LIBDK3BIFLIBS=@LIBDK3BIFLIBS@
libdk3bif.so: # the dktools-3 bitmap image file library (shared).
libdk3bif.so: $(LIBDK3BIFLIBF) $(LIBDK3BIFOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3BIFOBJ) $(LIBDK3BIFLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK3BIFOBJ) $(LIBDK3BIFLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3bif.a: # the dktools-3 bitmap image file library (static).
libdk3bif.a: $(LIBDK3BIFOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3BIFOBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2303,18 +3021,18 @@ libdk3bif.a: $(LIBDK3BIFOBJ)
LIBDK3DBILIBF=@LIBDK3DBILIBF@
LIBDK3DBILIBS=@LIBDK3DBILIBS@
-
libdk3dbi.so: # The dktools-3 data base interface library (shared).
libdk3dbi.so: $(LIBDK3DBILIBF) $(LIBDK3DBIOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3DBIOBJ) $(LIBDK3DBILIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK3DBIOBJ) $(LIBDK3DBILIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3dbi.a: # The dktools-3 data base interface library (static).
libdk3dbi.a: $(LIBDK3DBIOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3DBIOBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2326,15 +3044,16 @@ LIBDK3BMEPSLIBS=@LIBDK3BMEPSLIBS@
libdk3bmeps.so: # The dktools-3 bitmap to EPS library (shared).
libdk3bmeps.so: $(LIBDK3BMEPSLIBF) $(LIBDK3BMEPSOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3BMEPSOBJ) $(LIBDK3BMEPSLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK3BMEPSOBJ) $(LIBDK3BMEPSLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3bmeps.a: # The dktools-3 bitmap to EPS library (static).
libdk3bmeps.a: $(LIBDK3BMEPSOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3BMEPSOBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2346,15 +3065,16 @@ LIBDK3FIGLIBS=@LIBDK3FIGLIBS@
libdk3fig.so: # The dktools-3 Fig file library (shared).
libdk3fig.so: $(LIBDK3FIGLIBF) $(LIBDK3FIGOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3FIGOBJ) $(LIBDK3FIGLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIB@ $(LIBDK3FIGOBJ) $(LIBDK3FIGLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3fig.a: # The dktools-3 Fig file library (static).
libdk3fig.a: $(LIBDK3FIGOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3FIGOBJ)
$(RANLIB) $@
chmod 644 $@
@@ -2366,643 +3086,462 @@ LIBDK3WXLIBS=@LIBDK3WXLIBS@
libdk3wx.so: # The dktools-3 GUI library (shared).
libdk3wx.so: $(LIBDK3WXLIBF) $(LIBDK3WXOBJ)
- -[ ! -f $@ ] || rm -f $@
- -[ ! -f $@.$(SOVERS) ] || rm -f $@.$(SOVERS)
- $(MKSOLIB) $(LIBDK3WXOBJ) $(LIBDK3WXLIBS)
- $(LN_S) $@.$(SOVERS) $@
+ @DELTARGET@
+ @DELTARGETSO@
+ @echo '### Link so (C) ' $@
+ @MKSOLIBCPP@ $(LIBDK3WXOBJ) $(LIBDK3WXLIBS)
+ @LN_S@ $@.$(SOVERS) $@
chmod 644 $@.$(SOVERS) $@
libdk3wx.a: # The dktools-3 GUI library (static).
libdk3wx.a: $(LIBDK3WXOBJ)
- -[ ! -f $@ ] || rm -f $@
+ @DELTARGET@
$(AR) -r $@ $(LIBDK3WXOBJ)
$(RANLIB) $@
chmod 644 $@
+# DK3 programs
+# ------------
+DKWXTRACEOBJ= DkWxTraceApp.$(OBJEXT) \
+ DkWxTraceFrame.$(OBJEXT) \
+ DkWxTraceThread.$(OBJEXT) \
+ DkWxTraceOptionsDialog.$(OBJEXT) \
+ dkct-str-gui.$(OBJEXT) \
+ dkct-tr-gui.$(OBJEXT) \
+ dkct-au-gui.$(OBJEXT) \
+ dkct-gui-gui.$(OBJEXT) \
+ dkct-to-gui.$(OBJEXT) @WXDKCTRES@
-DKCTOBJ= dkct.o dkct-str.o dkct-tr.o dkct-au.o dkct-gui.o dkct-to.o
-
-DKCTLIBF=@DKCTLIBF@
-DKCTLIBS=@DKCTLIBS@
-
-dkct: # Program: Dirk Krause's C tool (CLI)
-dkct$(EXEEXT): $(DKCTLIBF) $(DKCTOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(DKCTOBJ) $(DKCTLIBS)
- chmod 755 $@
-
-
-
-ADDCTRLDLIBF=@ADDCTRLDLIBF@
-ADDCTRLDLIBS=@ADDCTRLDLIBS@
-
-addctrld: # Program: Filter to ensure Ctrl-D as final byte
-addctrld$(EXEEXT): $(ADDCTRLDLIBF) addctrld.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ addctrld.o $(ADDCTRLDLIBS)
- chmod 755 $@
-
-
-
-BMPPOBJ= bmeps3.o
-
-BMPPLIBF=@BMPPLIBF@
-BMPPLIBS=@BMPPLIBS@
-
-bmpp: # Program: Bitmap to PS/PDF converter (CLI)
-bmpp$(EXEEXT): $(BMPPLIBF) $(BMPPOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(BMPPOBJ) $(BMPPLIBS)
- chmod 755 $@
-
-
-
-FIG2LATOBJ= fig2lat.o f2lopt.o f2lud.o f2ludpat.o f2lpgf.o f2lpdf.o \
- f2leps.o f2lsvg.o f2lsvgst.o f2lto.o f2lpara.o
-
-FIG2LATLIBF=@FIG2LATLIBF@
-FIG2LATLIBS=@FIG2LATLIBS@
+WXDKCTLIBF=@WXDKCTLIBF@
+WXDKCTLIBS=@WXDKCTLIBS@
-fig2lat: # Program: Fig to LaTeX converter
-fig2lat$(EXEEXT): $(FIG2LATLIBF) $(FIG2LATOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(FIG2LATOBJ) $(FIG2LATLIBS)
+wxdkct: # Program: Dirk Krause's C tool (GUI)
+wxdkct$(EXEEXT): $(WXDKCTLIBF) $(DKWXTRACEOBJ)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(DKWXTRACEOBJ) $(WXDKCTLIBS)
chmod 755 $@
-HTMLBOOKOBJ= htmlbook.o hbnode.o hbconf.o hbhtml.o hbtool.o hbindex.o \
- hbcont.o hbimgdim.o hbchm.o
-
-HTMLBOOKLIBF=@HTMLBOOKLIBF@
-HTMLBOOKLIBS=@HTMLBOOKLIBS@
-
-htmlbook: # Program: HTML book creator
-htmlbook$(EXEEXT): $(HTMLBOOKLIBF) $(HTMLBOOKOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ $(HTMLBOOKOBJ) $(HTMLBOOKLIBS)
- chmod 755 $@
-
+WXIMGSZOBJ= DkWxImgszApp.$(OBJEXT) \
+ DkWxImgszFrame.$(OBJEXT) \
+ DkWxImgszOptionsDialog.$(OBJEXT) @WXIMGSZRES@
+WXIMGSZOBJ= WximgszApp.$(OBJEXT) \
+ WximgszFrame.$(OBJEXT) @WXIMGSZRES@
-DK3INFOLIBF=@DK3INFOLIBF@
-DK3INFOLIBS=@DK3INFOLIBS@
+WXIMGSZLIBF=@WXIMGSZLIBF@
+WXIMGSZLIBS=@WXIMGSZLIBS@
-dk3info: # Program: Information about this installation
-dk3info$(EXEEXT): $(DK3INFOLIBF) dk3info.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dk3info.o $(DK3INFOLIBS)
+wximgsz: # Program: Image scale suggestions
+wximgsz$(EXEEXT): $(WXIMGSZLIBF) $(WXIMGSZOBJ)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXIMGSZOBJ) $(WXIMGSZLIBS)
chmod 755 $@
-PLPDFTEXLIBF=@PLPDFTEXLIBF@
-PLPDFTEXLIBS=@PLPDFTEXLIBS@
-
-plpdftex: # Program: Plot driver for octpgfpl package
-plpdftex$(EXEEXT): $(PLPDFTEXLIBF) plpdftex.o plptcol.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ plpdftex.o plptcol.o $(PLPDFTEXLIBS)
- chmod 755 $@
+WXDKCLOCKOBJ= DkClockApp.$(OBJEXT) \
+ DkClockFrame.$(OBJEXT) \
+ DkClockOptionsDialog.$(OBJEXT) \
+ DkClockView.$(OBJEXT) \
+ DkClockData.$(OBJEXT) \
+ DkClockTaskbarIcon.$(OBJEXT) @WXDKCLOCKRES@
+WXDKCLOCKLIBF=@WXDKCLOCKLIBF@
+WXDKCLOCKLIBS=@WXDKCLOCKLIBS@
-
-DKWXWIZLIBF=@DKWXWIZLIBF@
-DKWXWIZLIBS=@DKWXWIZLIBS@
-
-dkwxwiz: # Program: Create dktools/wxwidgets based projects
-dkwxwiz$(EXEEXT): $(DKWXWIZLIBF) dkwxwiz.o
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ dkwxwiz.o $(DKWXWIZLIBS)
+wxdkclock: # Program: Screen clock with alert
+wxdkclock$(EXEEXT): $(WXDKCLOCKLIBF) $(WXDKCLOCKOBJ)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXDKCLOCKOBJ) $(WXDKCLOCKLIBS)
chmod 755 $@
-# Some special modules for GUI programs
-
-dkct-str-gui.cpp: dkct-str.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-str.c > $@
-
-dkct-tr-gui.cpp: dkct-tr.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-tr.c > $@
-
-dkct-au-gui.cpp: dkct-au.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-au.c > $@
-
-dkct-gui-gui.cpp: dkct-gui.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-gui.c > $@
-
-dkct-to-gui.cpp: dkct-to.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dkct-to.c > $@
-
-dk3bm-gui.cpp: dk3bm.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3bm.c > $@
-
-dk3bmj-gui.cpp: dk3bmj.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3bmj.c > $@
-
-dk3pdf-gui.cpp: dk3pdf.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3pdf.c > $@
-
-dk3bifa-gui.cpp: dk3bifa.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3bifa.c > $@
+WXDKHTBOBJ= DkWxHtbApp.$(OBJEXT) \
+ DkWxHtbFrame.$(OBJEXT) @WXDKHTBRES@
-dk3bif-gui.cpp: dk3bif.c
- -[ ! -f $@ ] || rm -f $@
- cat dk3usewx.c dk3bif.c > $@
-
-
-
-DKWXTRACEOBJ= DkWxTraceApp.o DkWxTraceFrame.o DkWxTraceThread.o \
- DkWxTraceOptionsDialog.o \
- dkct-str-gui.o dkct-tr-gui.o dkct-au-gui.o dkct-gui-gui.o dkct-to-gui.o
-
-WXDKCTLIBF=@WXDKCTLIBF@
-WXDKCTLIBS=@WXDKCTLIBS@
+WXDKHTBLIBF=@WXDKHTBLIBF@
+WXDKHTBLIBS=@WXDKHTBLIBS@
-wxdkct: # Program: Dirk Krause's C tool (GUI)
-wxdkct$(EXEEXT): $(WXDKCTLIBF) $(DKWXTRACEOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(DKWXTRACEOBJ) $(WXDKCTLIBS)
+wxdkhtb: # Program: Viewer for htb help files
+wxdkhtb$(EXEEXT): $(WXDKHTBLIBF) $(WXDKHTBOBJ)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CXX) $(LDFLCXX_GUI) -o $@ $(WXDKHTBOBJ) $(WXDKHTBLIBS)
chmod 755 $@
-WXBMPPOBJ= DkWxBmepsApp.o DkWxBmepsFrame.o DkWxBmepsThread.o \
- DkWxBmepsOptionsDialog.o \
- dk3bm-gui.o dk3bmj-gui.o dk3bmeo.o dk3bmeps.o dk3pdf-gui.o dk3paper.o \
- dk3bifa-gui.o dk3bif-gui.o dk3pixre.o
+WINPRINTOBJ= WinprintApp.$(OBJEXT) \
+ WinprintFrame.$(OBJEXT) \
+ WinprintThread.$(OBJEXT) \
+ WinprintChooserDialog.$(OBJEXT) \
+ dk3print.$(OBJEXT) \
+ dk3prcfg.$(OBJEXT) \
+ dk3prreq.$(OBJEXT) @WINPRINTRES@
-WXBMPP2OBJ= \
- DkWxProgressDialog.o DkWxFrame.o DkWxAppHelper.o DkWxHelpController.o \
- DkWxCommunicator.o DkWxColorView.o dk3wxs.o dk3opt.o dk3app.o \
- dk3wreg.o dk3of.o dk3strm.o dk3sto.o dk3dir.o dk3enc.o dk3str.o \
- dk3sf.o dk3maui.o dk3mal.o dk3maul.o dk3mad.o dk3madlc.o \
- dk3maidd.o dk3maodd.o dk3maid8.o dk3maod8.o dk3madfo.o dk3madso.o \
- dk3madsi.o dk3inst.o dk3srch.o dk3bits.o dk3mem.o dk3trace.o
-
-WXBMPPLIBF=@WXBMPPLIBF@
-WXBMPPLIBS=@WXBMPPLIBS@
+WINPRINTLIBF=@WINPRINTLIBF@
+WINPRINTLIBS=@WINPRINTLIBS@
-wxbmpp: # Program: Bitmap to PS/PDF converter (GUI)
-wxbmpp$(EXEEXT): $(WXBMPPLIBF) $(WXBMPPOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXBMPPOBJ) $(WXBMPPLIBS)
+winprint$(EXEEXT): $(WINPRINTLIBF) $(WINPRINTOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CXX) $(LDFLCXX_CLI_DK) -o $@ $(WINPRINTOBJ) $(WINPRINTLIBS)
chmod 755 $@
-WXDKFCSOBJ= Dk4FcsApp.o Dk4FcsFrame.o
+DKWXPATHOBJ= DkWxPathApp.$(OBJEXT) \
+ DkWxPathFrame.$(OBJEXT) @DKWXPATHRES@
-WXDKFCSLIBF=@WXDKFCSLIBF@
-WXDKFCSLIBS=@WXDKFCSLIBS@
+DKWXPATHLIBF=@DKWXPATHLIBF@
+DKWXPATHLIBS=@DKWXPATHLIBS@
-wxdkfcs: # Program: File checksums with GUI
-wxdkfcs$(EXEEXT): $(WXDKFCSLIBF) $(WXDKFCSOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXDKFCSOBJ) $(WXDKFCSLIBS)
+dkwxpath$(EXEEXT): $(DKWXPATHLIBF) $(DKWXPATHOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CXX) $(LDFLCXX_CLI_DK) -o $@ $(DKWXPATHOBJ) $(DKWXPATHLIBS)
chmod 755 $@
-WXIMGSZOBJ= DkWxImgszApp.o DkWxImgszFrame.o DkWxImgszOptionsDialog.o
+DKCTOBJ= dkct.$(OBJEXT) \
+ dkct-str.$(OBJEXT) \
+ dkct-tr.$(OBJEXT) \
+ dkct-au.$(OBJEXT) \
+ dkct-gui.$(OBJEXT) \
+ dkct-to.$(OBJEXT) @DKCTRES@
-WXIMGSZLIBF=@WXIMGSZLIBF@
-WXIMGSZLIBS=@WXIMGSZLIBS@
+DKCTLIBF=@DKCTLIBF@
+DKCTLIBS=@DKCTLIBS@
-wximgsz: # Program: Image scale suggestions
-wximgsz$(EXEEXT): $(WXIMGSZLIBF) $(WXIMGSZOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXIMGSZOBJ) $(WXIMGSZLIBS)
+dkct: # Program: Dirk Krause's C tool (CLI)
+dkct$(EXEEXT): $(DKCTLIBF) $(DKCTOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKCTOBJ) $(DKCTLIBS)
chmod 755 $@
-WXDKCLOCKOBJ= DkClockApp.o DkClockFrame.o DkClockOptionsDialog.o \
- DkClockView.o DkClockData.o DkClockTaskbarIcon.o
+HTMLBOOKOBJ= htmlbook.$(OBJEXT) \
+ hbnode.$(OBJEXT) \
+ hbconf.$(OBJEXT) \
+ hbhtml.$(OBJEXT) \
+ hbtool.$(OBJEXT) \
+ hbindex.$(OBJEXT) \
+ hbcont.$(OBJEXT) \
+ hbimgdim.$(OBJEXT) \
+ hbchm.$(OBJEXT) @HTMLBOOKRES@
-WXDKCLOCKLIBF=@WXDKCLOCKLIBF@
-WXDKCLOCKLIBS=@WXDKCLOCKLIBS@
+HTMLBOOKLIBF=@HTMLBOOKLIBF@
+HTMLBOOKLIBS=@HTMLBOOKLIBS@
-wxdkclock: # Program: Screen clock with alert
-wxdkclock$(EXEEXT): $(WXDKCLOCKLIBF) $(WXDKCLOCKOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXDKCLOCKOBJ) $(WXDKCLOCKLIBS)
+htmlbook: # Program: HTML book creator
+htmlbook$(EXEEXT): $(HTMLBOOKLIBF) $(HTMLBOOKOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(HTMLBOOKOBJ) $(HTMLBOOKLIBS)
chmod 755 $@
-WXDKHTBOBJ= DkWxHtbApp.o DkWxHtbFrame.o
+FIG2LATOBJ= fig2lat.$(OBJEXT) \
+ f2lopt.$(OBJEXT) \
+ f2lud.$(OBJEXT) \
+ f2ludpat.$(OBJEXT) \
+ f2lpgf.$(OBJEXT) \
+ f2lpdf.$(OBJEXT) \
+ f2leps.$(OBJEXT) \
+ f2lsvg.$(OBJEXT) \
+ f2lsvgst.$(OBJEXT) \
+ f2lto.$(OBJEXT) \
+ f2lpara.$(OBJEXT) @FIG2LATRES@
-WXDKHTBLIBF=@WXDKHTBLIBF@
-WXDKHTBLIBS=@WXDKHTBLIBS@
+FIG2LATLIBF=@FIG2LATLIBF@
+FIG2LATLIBS=@FIG2LATLIBS@
-wxdkhtb: # Program: Viewer for htb help files
-wxdkhtb$(EXEEXT): $(WXDKHTBLIBF) $(WXDKHTBOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(ENTRY) -o $@ $(WXDKHTBOBJ) $(WXDKHTBLIBS)
+fig2lat: # Program: Fig to LaTeX converter
+fig2lat$(EXEEXT): $(FIG2LATLIBF) $(FIG2LATOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(FIG2LATOBJ) $(FIG2LATLIBS)
chmod 755 $@
-ITADMINOBJ= itadmin.o itaconf.o itadata.o itamysql.o itareg.o itamem.o \
- itacomp.o itange.o itahosts.o itaether.o itadhcp.o itanetd.o italic.o \
- itatool.o dk3uc2l.o
+ITADMINOBJ= itadmin.$(OBJEXT) \
+ itaconf.$(OBJEXT) \
+ itadata.$(OBJEXT) \
+ itamysql.$(OBJEXT) \
+ itareg.$(OBJEXT) \
+ itamem.$(OBJEXT) \
+ itacomp.$(OBJEXT) \
+ itange.$(OBJEXT) \
+ itahosts.$(OBJEXT) \
+ itaether.$(OBJEXT) \
+ itadhcp.$(OBJEXT) \
+ itanetd.$(OBJEXT) \
+ italic.$(OBJEXT) \
+ itatool.$(OBJEXT) \
+ dk3uc2l.$(OBJEXT) @ITADMINRES@
ITADMINLIBF=@ITADMINLIBF@
ITADMINLIBS=@ITADMINLIBS@
itadmin: # Program: IT administration tool
itadmin$(EXEEXT): $(ITADMINLIBF) $(ITADMINOBJ)
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C++) ' $@
- $(LDCPP) $(MYSQLLDFLAGS) -o $@ $(ITADMINOBJ) $(ITADMINLIBS)
+ @DELTARGET@
+ @echo '### Link (C++)' $@
+ $(CC) $(LDFLC_CLI_DK) $(MYSQLLDFLAGS) -o $@ $(ITADMINOBJ) $(ITADMINLIBS)
chmod 755 $@
-# ##### End of dktols-3 section
+DKWXWIZLIBF=@DKWXWIZLIBF@
+DKWXWIZLIBS=@DKWXWIZLIBS@
+
+DKWXWIZOBJ= dkwxwiz.$(OBJEXT) @DKWXWIZRES@
+dkwxwiz: # Program: Create dktools/wxwidgets based projects
+dkwxwiz$(EXEEXT): $(DKWXWIZLIBF) $(DKWXWIZOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKWXWIZOBJ) $(DKWXWIZLIBS)
+ chmod 755 $@
-tests: testprogs
- ./test-dk4maac < test-data/dk4maac.in > test-data/dk4maac.out
- ./test-dk4maauc < test-data/dk4maauc.in > test-data/dk4maauc.out
-testprogs: $(TESTPROGS)
- @echo 'Finished building test programs.'
-test-dk4maac: test-dk4maac.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L.-o $@ test-dk4maac.o -ldk4
- chmod 755 $@
+DKWTOBJ= dkwt.$(OBJEXT) \
+ dkwt-ac.$(OBJEXT) \
+ dkwt-ev.$(OBJEXT) \
+ dkwt-cp.$(OBJEXT) \
+ dkwt-gr.$(OBJEXT) \
+ dkwt-pr.$(OBJEXT) \
+ dkwt-env.$(OBJEXT) \
+ dkwt-to.$(OBJEXT) @DKWTRES@
-test-dk4maauc: test-dk4maauc.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maauc.o -ldk4
- chmod 755 $@
+DKWTLIBF=@DKWTLIBF@
+DKWTLIBS=@DKWTLIBS@
-test-dk4maas: test-dk4maas.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maas.o -ldk4
+dkwt$(EXEEXT): $(DKWTLIBF) $(DKWTOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DKWTOBJ) $(DKWTLIBS)
chmod 755 $@
-test-dk4maaus: test-dk4maaus.o
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maaus.o -ldk4
- chmod 755 $@
-test-dk4maai: test-dk4maai.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maai.o -ldk4
- chmod 755 $@
-test-dk4maaui: test-dk4maaui.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maaui.o -ldk4
- chmod 755 $@
+WPRCLEANOBJ= wprclean.$(OBJEXT) \
+ dk3print.$(OBJEXT) \
+ dk3prcfg.$(OBJEXT) \
+ dk3prreq.$(OBJEXT) @WPRCLEANRES@
-test-dk4maal: test-dk4maal.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maal.o -ldk4
- chmod 755 $@
+WPRCLEANLIBF=@WPRCLEANLIBF@
+WPRCLEANLIBS=@WPRCLEANLIBS@
-test-dk4maaul: test-dk4maaul.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maaul.o -ldk4
+wprclean$(EXEEXT): $(WPRCLEANLIBF) $(WPRCLEANOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(WPRCLEANOBJ) $(WPRCLEANLIBS)
chmod 755 $@
-test-dk4maall: test-dk4maall.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maall.o -ldk4
- chmod 755 $@
+DK3INFOLIBF=@DK3INFOLIBF@
+DK3INFOLIBS=@DK3INFOLIBS@
-test-dk4maaull: test-dk4maaull.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maaull.o -ldk4
- chmod 755 $@
+DK3INFOOBJ= dk3info.$(OBJEXT) @DK3INFORES@
-test-dk4maami: test-dk4maami.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maami.o -ldk4
+dk3info: # Program: Information about this installation
+dk3info$(EXEEXT): $(DK3INFOLIBF) $(DK3INFOOBJ)
+ @DELTARGET@
+ @echo '### Link (C) ' $@
+ $(CC) $(LDFLC_CLI_DK) -o $@ $(DK3INFOOBJ) $(DK3INFOLIBS)
chmod 755 $@
-test-dk4maamu: test-dk4maamu.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4maamu.o -ldk4
- chmod 755 $@
-test-dk4str8: test-dk4str8.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4str8.o -ldk4
- chmod 755 $@
+# Special dependencies
+# ====================
-test-dk4loc: test-dk4loc.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4loc.o -ldk4
- chmod 755 $@
+# Modules used for both dkct and wxdkct
+# -------------------------------------
-test-dk4mai8ddu: test-dk4mai8ddu.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4mai8ddu.o -ldk4
- chmod 755 $@
+dkct-au-gui.cpp: dkct-au.c
+ cp -f $< $@
-test-dk4mai8ddi: test-dk4mai8ddi.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4mai8ddi.o -ldk4
- chmod 755 $@
+dkct-gui-gui.cpp: dkct-gui.c
+ cp -f $< $@
-test-dk4mai8dsz: test-dk4mai8dsz.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4mai8dsz.o -ldk4
- chmod 755 $@
+dkct-str-gui.cpp: dkct-str.c
+ cp -f $< $@
-test-dk4time: test-dk4time.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4time.o -ldk4
- chmod 755 $@
+dkct-to-gui.cpp: dkct-to.c
+ cp -f $< $@
-test-dk4exep8: test-dk4exep8.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4exep8.o -ldk4
- chmod 755 $@
+dkct-tr-gui.cpp: dkct-tr.c
+ cp -f $< $@
-test-dk4path8: test-dk4path8.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4path8.o -ldk4
- chmod 755 $@
-ex-sto: ex-sto.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ ex-sto.o -ldk4
- chmod 755 $@
+# Resource files
+# --------------
-test-dk4strm: test-dk4strm.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4strm.o -ldk4
- chmod 755 $@
+addctrldres.$(RESEXT): addctrld.$(RCEXT)
+ @RESCRULE@
-test-dk4numl: test-dk4numl.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4numl.o -ldk4
- chmod 755 $@
+bmppres.$(RESEXT): bmpp.$(RCEXT)
+ @RESCRULE@
-test-dk4tsp08: test-dk4tsp08.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4tsp08.o -ldk4
- chmod 755 $@
+dk3infores.$(RESEXT): dk3info.$(RCEXT)
+ @RESCRULE@
-test-bool: test-bool.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-bool.o -ldk4
- chmod 755 $@
+dk4infores.$(RESEXT): dk4info.$(RCEXT)
+ @RESCRULE@
-test-dk4enc: test-dk4enc.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4enc.o -ldk4
- chmod 755 $@
+dk-bin2cres.$(RESEXT): dk-bin2c.$(RCEXT)
+ @RESCRULE@
-test-dk4user: test-dk4user.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4user.o -ldk4
- chmod 755 $@
+dk-blksres.$(RESEXT): dk-blks.$(RCEXT)
+ @RESCRULE@
-test-dk4mai8dbl: test-dk4mai8dbl.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4mai8dbl.o -ldk4
- chmod 755 $@
+dk-bmmres.$(RESEXT): dk-bmm.$(RCEXT)
+ @RESCRULE@
-test-fne: test-fne.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-fne.o -ldk4
- chmod 755 $@
+dk-catres.$(RESEXT): dk-cat.$(RCEXT)
+ @RESCRULE@
-test-mkdir: test-mkdir.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-mkdir.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkctres.$(RESEXT): dkct.$(RCEXT)
+ @RESCRULE@
-test-deldir: test-deldir.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-deldir.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-db2tres.$(RESEXT): dk-db2t.$(RCEXT)
+ @RESCRULE@
-test-dk4dir08: test-dk4dir08.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4dir08.o -ldk4
- chmod 755 $@
+dk-dbcores.$(RESEXT): dk-dbco.$(RCEXT)
+ @RESCRULE@
-test-dk4dir: test-dk4dir.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4dir.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkdbtres.$(RESEXT): dkdbt.$(RCEXT)
+ @RESCRULE@
-test-deltree: test-deltree.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-deltree.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-eradiskres.$(RESEXT): dk-eradisk.$(RCEXT)
+ @RESCRULE@
-test-filei: test-filei.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-filei.o -ldk4
- chmod 755 $@
+dk-ficres.$(RESEXT): dk-fic.$(RCEXT)
+ @RESCRULE@
-test-dk4time08: test-dk4time08.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4time08.o -ldk4
- chmod 755 $@
+dk-hexres.$(RESEXT): dk-hex.$(RCEXT)
+ @RESCRULE@
-test-eradisk: test-eradisk.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-eradisk.o -ldk4
- chmod 755 $@
+dk-linesres.$(RESEXT): dk-lines.$(RCEXT)
+ @RESCRULE@
-test-a85e: test-a85e.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-a85e.o -ldk4
- chmod 755 $@
+dk-lsres.$(RESEXT): dk-ls.$(RCEXT)
+ @RESCRULE@
-test-a85d: test-a85d.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-a85d.o -ldk4
- chmod 755 $@
+dk-pwdres.$(RESEXT): dk-pwd.$(RCEXT)
+ @RESCRULE@
-test-rle: test-rle.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-rle.o -ldk4
- chmod 755 $@
+dk-pwgenres.$(RESEXT): dk-pwgen.$(RCEXT)
+ @RESCRULE@
-test-rld: test-rld.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-rld.o -ldk4
- chmod 755 $@
+dk-randres.$(RESEXT): dk-rand.$(RCEXT)
+ @RESCRULE@
-test-binenc: test-binenc.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-binenc.o -ldk4
- chmod 755 $@
+dk-recvres.$(RESEXT): dk-recv.$(RCEXT)
+ @RESCRULE@
-test-sock: test-sock.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-sock.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-sendres.$(RESEXT): dk-send.$(RCEXT)
+ @RESCRULE@
-test-inet-pton: test-inet-pton.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-inet-pton.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-sortres.$(RESEXT): dk-sort.$(RCEXT)
+ @RESCRULE@
-test-peer: test-peer.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-peer.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-sqlsplitres.$(RESEXT): dk-sqlsplit.$(RCEXT)
+ @RESCRULE@
-test-membuf: test-membuf.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-membuf.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-t2dbres.$(RESEXT): dk-t2db.$(RCEXT)
+ @RESCRULE@
-test-dk4wxah: test-dk4wxah.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4wxah.o -ldk4 $(WXLDFLAGS) $(IMGLIBS) $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dk-t2hres.$(RESEXT): dk-t2h.$(RCEXT)
+ @RESCRULE@
-TESTCONTAINEROBJ= test-container.o Dk4Comparable.o
+dk-t2lres.$(RESEXT): dk-t2l.$(RCEXT)
+ @RESCRULE@
-test-container: $(TESTCONTAINEROBJ) libdk4.a
- $(LDCPP) -o $@ $(TESTCONTAINEROBJ) libdk4.a $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkwtadmres.$(RESEXT): dkwtadm.$(RCEXT)
+ @RESCRULE@
-test-skip: test-skip.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-skip.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkwtres.$(RESEXT): dkwt.$(RCEXT)
+ @RESCRULE@
-test-opt: test-opt.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-opt.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkwxpathres.$(RESEXT): dkwxpath.$(RCEXT)
+ @RESCRULE@
-test-udpa: test-udpa.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-udpa.o -ldk4 $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+dkwxwizres.$(RESEXT): dkwxwiz.$(RCEXT)
+ @RESCRULE@
-test-sqdbl: test-sqdbl.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-sqdbl.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+fig2latres.$(RESEXT): fig2lat.$(RCEXT)
+ @RESCRULE@
-test-ser: test-ser.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-ser.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+htmlbookres.$(RESEXT): htmlbook.$(RCEXT)
+ @RESCRULE@
-test-unser: test-unser.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-unser.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+itadminres.$(RESEXT): itadmin.$(RCEXT)
+ @RESCRULE@
-test-strmw: test-strmw.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-strmw.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+lprngclres.$(RESEXT): lprngcl.$(RCEXT)
+ @RESCRULE@
-test-strms: test-strms.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-strms.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+plpdftexres.$(RESEXT): plpdftex.$(RCEXT)
+ @RESCRULE@
-test-strmu: test-strmu.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-strmu.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+winprintres.$(RESEXT): winprint.$(RCEXT)
+ @RESCRULE@
-test-mbstr: test-mbstr.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-mbstr.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wprcleanres.$(RESEXT): wprclean.$(RCEXT)
+ @RESCRULE@
-test-dk4strmco: test-dk4strmco.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4strmco.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxdkdrawres.$(RESEXT): wxdkdraw.$(RCEXT)
+ @RESCRULE@
-test-paper: test-paper.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-paper.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxbmppres.$(RESEXT): wxbmpp.$(RCEXT)
+ @RESCRULE@
-testlzw: testlzw.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ testlzw.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxdkclockres.$(RESEXT): wxdkclock.$(RCEXT)
+ @RESCRULE@
-testlzws: testlzws.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ testlzws.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxdkctres.$(RESEXT): wxdkct.$(RCEXT)
+ @RESCRULE@
-test-dk4c8dbl: test-dk4c8dbl.o libdk4.a
- $(LD) $(CFLAGS) $(LDFLAGS) -L. -o $@ test-dk4c8dbl.o -ldk4 $(BZLIB) $(ZLIB) -lm
- chmod 755 $@
+wxdkfcsres.$(RESEXT): wxdkfcs.$(RCEXT)
+ @RESCRULE@
-distclean: # Clean up (remove build and configure script results)
-distclean: clean
- -[ ! -f confdefs.h ] || rm -fr confdefs.h
- -[ ! -f config.h ] || rm -fr config.h
- -[ ! -f config.log ] || rm -fr config.log
- -[ ! -f config.status ] || rm -fr config.status
- -[ ! -f conftest ] || rm -fr conftest
- -[ ! -f conftest.c ] || rm -fr conftest.c
- -[ ! -f conftest.er1 ] || rm -fr conftest.er1
- -[ ! -f config.h ] || rm -f config.h
- -[ ! -f scripts/wr-dk3inst.sh ] || rm -f scripts/wr-dk3inst.sh
- -[ ! -f scripts/wr-dk4inst.sh ] || rm -f scripts/wr-dk4inst.sh
- -[ ! -f scripts/create-desktop-files.sh ] || rm -f scripts/create-desktop-files.sh
- -[ ! -f initd-printqd ] || rm -f initd-printqd
- -[ ! -f dktools.pc ] || rm -f dktools.pc
+wxdkhtbres.$(RESEXT): wxdkhtb.$(RCEXT)
+ @RESCRULE@
-maketest: # Test: Check availability of make programs.
-maketest:
- @echo OK
+wxdkscrszres.$(RESEXT): wxdkscrsz.$(RCEXT)
+ @RESCRULE@
-cleanest: # NOT FOR END USER: Clean up completely
-cleanest: distclean
- -[ ! -d autom4te.cache ] || rm -fr autom4te.cache
- scripts/clean-resources.sh
- find help-htb -type f -exec rm -f {} \;
- find help-chm -type f -exec rm -f {} \;
- find help-html -type f -exec rm -f {} \;
- find doc/html -type f -exec rm -f {} \;
- -[ ! -d doc/doxygen ] || find doc/doxygen -type f -exec rm -f {} \;
- -[ ! -f dk4info1.c ] || rm -f dk4info1.c
- -find help-src -name '*.html' -exec rm -f {} \;
- -find help-src -name '*.hhc' -exec rm -f {} \;
- -find help-src -name '*.hhk' -exec rm -f {} \;
- -find help-src -name '*.hhp' -exec rm -f {} \;
- -find help-src -name '*.aux' -exec rm -f {} \;
- -find doc/src -name '*.html' -exec rm -f {} \;
- -find doc/src -name '*.hhc' -exec rm -f {} \;
- -find doc/src -name '*.hhk' -exec rm -f {} \;
- -find doc/src -name '*.hhp' -exec rm -f {} \;
- -find doc/src -name '*.aux' -exec rm -f {} \;
- -find dktools -name '*.chm' -exec rm {} \;
- -find dktools -name '*.htb' -exec rm {} \;
- -find . -name '*.ico' -exec rm -f {} \;
- -find . -name '*.xpm' -exec rm -f {} \;
- -[ ! -x ./scripts/clean.sh ] || ./scripts/clean.sh
- -[ ! -x ./scripts/clean-for-fig.sh ] || ./scripts/clean-for-fig.sh
- -[ ! -x ./scripts/clean-for-tex.sh ] || ./scripts/clean-for-tex.sh
- -rm -fr *.rc
- -rm -fr *-gui.cpp
+wximgszres.$(RESEXT): wximgsz.$(RCEXT)
+ @RESCRULE@
+wxpqdicres.$(RESEXT): wxpqdic.$(RCEXT)
+ @RESCRULE@
-check-cleanest: # NOT FOR END USER: Check for unlisted files
-check-cleanest: cleanest
- perl scripts/filechk.pl
+# Test programs
+# =============
+# Test programs typically consist of one module.
-distrenew: # NOT FOR END USER: Renew files before creating distro
-distrenew: check-cleanest
- dkct -l
- find . -type f -exec touch {} \;
- sleep 2
- find . -name '*.pdf' -exec touch {} \;
- sleep 2
- find . -name '*.svg' -exec touch {} \;
- sleep 2
- find . -name '*.png' -exec touch {} \;
- find . -name '*.ico' -exec touch {} \;
- find . -name '*.xpm' -exec touch {} \;
- scripts/update-doxyfile.sh
- doxygen
- scripts/mkrc.pl
- scripts/make-resources.sh
- scripts/build-help.sh
- scripts/doc-install.sh
- scripts/man-install.sh
- scripts/transform-config.pl
- autoconf
- scripts/create-spec-iss.sh
- scripts/create-debian-changelog.pl > debian/changelog
+.c:
+ -[ ! -f "$@" ] || rm -f "$@"
+ $(CC) $(CFL_CLI_DK) $(LDFLC_CLI_DK) -o $@ $< -L. -ldk4 $(ZLIB) $(BZLIB) -lm
+ chmod 755 $@
-dist: # NOT FOR END USER: Create distro archives
-dist: distrenew
- scripts/create-distribution.sh
-
-doxydoc: # NOT FOR END USER: Documentation created by doxygen
- -[ ! -d doc/doxygen ] || rm -fr doc/doxygen
- -[ ! -f doxygen.out ] || rm -fr doxygen.out
- mkdir doc/doxygen
- chmod 755 doc/doxygen
- doxygen Doxyfile > doxygen.out 2>&1
-
-wprclean2: # Temporary: Base for the wprclean rewrite
-wprclean2$(EXEEXT): wprclean2.o @LPRNGCLLIBF@
- -[ ! -f $@ ] || rm -f $@
- @echo '### Link (C) ' $@
- $(LINK) -o $@ wprclean2.o @LPRNGCLLIBS@ $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm
+.cpp:
+ -[ ! -f "$@" ] || rm -f "$@"
+ $(CXX) $(CXXFL_GUI) $(LDFLCXX_GUI) -o $@ $< -L. -ldk4 $(ZLIB) $(BZLIB) -lm
chmod 755 $@
diff --git a/support/dktools/PKGBUILD.in b/support/dktools/PKGBUILD.in
new file mode 100644
index 0000000000..45aeb53d80
--- /dev/null
+++ b/support/dktools/PKGBUILD.in
@@ -0,0 +1,61 @@
+# Package build script for Arch Linux.
+
+# Maintainer: Dirk Krause <mail-not-published>
+pkgname=dktools
+pkgver=VERSNO
+pkgrel=1
+epoch=
+pkgdesc="Tools and libraries by Dirk Krause"
+arch=("x86_64")
+url="http://sourceforge.net/p/dktools/wiki/Home/"
+license=('custom:BSD')
+groups=()
+depends=('zlib' 'bzip2' 'libpng' 'openssl' 'libjpeg-turbo' 'libtiff' 'net-snmp' 'db' 'wxgtk3' 'mariadb-clients')
+makedepends=()
+checkdepends=()
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=('strip')
+install=
+changelog=
+source=("http://downloads.sourceforge.net/project/dktools/dktools/dktools-$pkgver/src/$pkgname-$pkgver.tar.gz")
+noextract=()
+md5sums=("db954fcbf3f4972a1a21972e51548eb0")
+validpgpkeys=()
+
+prepare() {
+ cd "$pkgname-$pkgver"
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-packaging
+ make
+}
+
+check() {
+ cd "$pkgname-$pkgver"
+ /bin/true
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+ mkdir -p "$pkgdir/usr/share/licenses/dktools"
+ chmod 755 "$pkgdir/usr/share/licenses/dktools"
+ cp bsdlic.txt "$pkgdir/usr/share/licenses/dktools/LICENSE"
+ chmod 644 "$pkgdir/usr/share/licenses/dktools/LICENSE"
+ mkdir -p "$pkgdir/usr/share/doc/dktools"
+ chmod 755 "$pkgdir/usr/share/doc/dktools"
+ cp bsdlic.txt "$pkgdir/usr/share/doc/dktools/LICENSE"
+ cp README "$pkgdir/usr/share/doc/dktools/README"
+ cp INSTALL "$pkgdir/usr/share/doc/dktools/INSTALL"
+ chmod 644 "$pkgdir/usr/share/doc/dktools/LICENSE"
+ chmod 644 "$pkgdir/usr/share/doc/dktools/README"
+ chmod 644 "$pkgdir/usr/share/doc/dktools/INSTALL"
+ rm -fr "$pkgdir/var/run"
+}
+
diff --git a/support/dktools/README b/support/dktools/README
index f2dac11b16..db3f0566dd 100644
--- a/support/dktools/README
+++ b/support/dktools/README
@@ -2,7 +2,7 @@ DK Tools and Libaries
=====================
This package contains Dirk Krause's tools and libraries.
SourceForge project page: http://sourceforge.net/projects/dktools
-Project home page: http://dktools.sourceforge.net
+Project home page: http://sourceforge.net/p/dktools/wiki/Home/
License
=======
@@ -20,10 +20,15 @@ See the INSTALL file for installation instructions.
Programs
========
+Drawing
+-------
+wxdkdraw Minimalistic drawing program for use with LaTeX
+
Graphics conversion
-------------------
+wxd2lat Convert wxdkdraw drawings to PDF+TeX, EPS+TeX, TeX (PGF)
bmpp Convert PNG, JPEG, TIFF to PDF, PS, EPS
-fig2lat Convrt *.fig to PS(+TeX), PDF(+TeX), PGF
+fig2lat Convert *.fig to PS(+TeX), PDF(+TeX), PGF
wximgsz Suggest size pairs to rescale bitmap images
Web publishing
@@ -35,6 +40,7 @@ Software development
dkct C preprocessor for debugging, tracing, state machines wx GUI
dkwxwiz Create initial files for wxWidgets + DK tools programs
wxdkhtb View HTB help files
+dk-bin2c Convert binary data to C source (array of unsigned char)
IT administration
-----------------
@@ -43,7 +49,8 @@ itadmin Create configuration and docu (*.tex) files from MySQL DB
File and directory tols
-----------------------
dk-ls List files, output column order is configurable
-dk-fic Check file integrity
+dk-fic Check file integrity
+wxdkfcs Show file checksums
dk-bmm Backup media managements
dk-blks Create stream with constant block size for use with dd
dk-eradisk Create data stream to erase a disk
@@ -56,7 +63,7 @@ dk-t2l Convert plain text to LaTeX
dk-t2h Convert plain text to HTML
dk-cat Show file contents, some recoding possible
dk-sort Sort text line by line
-
+dk-lines Extract specific lines from text stream
User and password tools
@@ -103,3 +110,9 @@ Other programs
plpdftex Output driver for octpgfpl to produce PDF+TeX
wxdkclock Simple clock with one alert
+
+FULL SOURCES
+============
+To have full sources available, unpack the man-help-src.tar.gz and
+test-src.tar.gz archives.
+
diff --git a/support/dktools/ScreenSizeApp.cpp b/support/dktools/ScreenSizeApp.cpp
index 8857b324a1..e1f31e8554 100644
--- a/support/dktools/ScreenSizeApp.cpp
+++ b/support/dktools/ScreenSizeApp.cpp
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: ScreenSizeApp.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: ScreenSizeApp.cpt
*/
/** @file ScreenSizeApp.cpp The ScreenSizeApp module.
*/
-#line 67 "ScreenSizeApp.cpt"
+#line 72 "ScreenSizeApp.cpt"
#include "wxdkscrsz.h"
@@ -45,7 +23,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 73 "ScreenSizeApp.cpt"
+#line 78 "ScreenSizeApp.cpt"
@@ -148,7 +126,7 @@ wxT("Result"),
NULL
-#line 201 "ScreenSizeApp.cpt"
+#line 206 "ScreenSizeApp.cpt"
};
@@ -187,7 +165,7 @@ wxT("\n"),
wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."),
/* 10 */
-wxT("http://dktools.sourceforge.net"),
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
/* 11 */
wxT("http://www.wxwidgets.org"),
@@ -213,7 +191,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 261 "ScreenSizeApp.cpt"
+#line 266 "ScreenSizeApp.cpt"
};
@@ -236,14 +214,19 @@ dkT("wxdkscrsz.htb"),
NULL
-#line 286 "ScreenSizeApp.cpt"
+#line 291 "ScreenSizeApp.cpt"
};
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(ScreenSizeApp);
+#else
IMPLEMENT_APP(ScreenSizeApp)
+#endif
bool
@@ -342,8 +325,8 @@ ScreenSizeApp::OnInit()
/* Show frame, restore position and indicate success.
*/
- frame->Show();
frame->RestorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed.
diff --git a/support/dktools/ScreenSizeApp.cpt b/support/dktools/ScreenSizeApp.cpt
index 7d40bf76ad..368b855ec2 100644
--- a/support/dktools/ScreenSizeApp.cpt
+++ b/support/dktools/ScreenSizeApp.cpt
@@ -1,8 +1,8 @@
%% options
copyright owner = Dirk Krause
-copyright year = 2017
-license = bsd
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
@@ -58,7 +58,12 @@ class ScreenSizeApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(ScreenSizeApp);
+#else
DECLARE_APP(ScreenSizeApp)
+#endif
@@ -246,7 +251,7 @@ aaaaa
# 9 10 11 12 13 14 15: List of libraries used.
#
DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
http://www.wxwidgets.org
http://www.libpng.org/pub/png/libpng.html
http://www.ijg.org
@@ -289,7 +294,12 @@ $!end
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(ScreenSizeApp);
+#else
IMPLEMENT_APP(ScreenSizeApp)
+#endif
bool
@@ -388,8 +398,8 @@ ScreenSizeApp::OnInit()
/* Show frame, restore position and indicate success.
*/
- frame->Show();
frame->RestorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed.
diff --git a/support/dktools/ScreenSizeApp.h b/support/dktools/ScreenSizeApp.h
index ae6cfea802..633b4ed6a4 100644
--- a/support/dktools/ScreenSizeApp.h
+++ b/support/dktools/ScreenSizeApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: ScreenSizeApp.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: ScreenSizeApp.cpt
*/
#ifndef SCREENSIZEAPP_H_INCLUDED
@@ -90,7 +68,12 @@ class ScreenSizeApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(ScreenSizeApp);
+#else
DECLARE_APP(ScreenSizeApp)
+#endif
diff --git a/support/dktools/ScreenSizeFrame.cpp b/support/dktools/ScreenSizeFrame.cpp
index b22753fde2..0870666469 100644
--- a/support/dktools/ScreenSizeFrame.cpp
+++ b/support/dktools/ScreenSizeFrame.cpp
@@ -1,61 +1,39 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: ScreenSizeFrame.wxc
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: ScreenSizeFrame.wxc
*/
/** @file ScreenSizeFrame.cpp The ScreenSizeFrame module.
*/
-#line 294 "ScreenSizeFrame.wxc"
+#line 309 "ScreenSizeFrame.wxc"
#define AUTO_EXIT_ONLY_ON_SUCCESS 1
-
+#include "dk4conf.h"
#include "dk4mem.h"
#include "wxdkscrsz.h"
#include <dk4maixdul.h>
#include "dk4maoxd.h"
#if !defined(__WXMSW__)
-#include "wxdkscrsz.xpm"
+#include "gui-img/icons/wxdkscrsz.xpm"
#endif
-#line 310 "ScreenSizeFrame.wxc"
+#line 325 "ScreenSizeFrame.wxc"
@@ -75,23 +53,32 @@ wxT("screen.size.alternative.height"),
NULL
-#line 320 "ScreenSizeFrame.wxc"
+#line 335 "ScreenSizeFrame.wxc"
};
/* __CHANGE__ 017: Add further events. */
/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
-BEGIN_EVENT_TABLE(ScreenSizeFrame, wxFrame)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(ScreenSizeFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(ScreenSizeFrame,wxFrame)
+#endif
EVT_MENU(ScreenSizeFrame_Quit, ScreenSizeFrame::OnQuit)
EVT_MENU(ScreenSizeFrame_Help_About, ScreenSizeFrame::OnAbout)
EVT_MENU(ScreenSizeFrame_Help_Contents, ScreenSizeFrame::OnHelpContents)
EVT_IDLE(ScreenSizeFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
-#line 335 "ScreenSizeFrame.wxc"
+#line 359 "ScreenSizeFrame.wxc"
ScreenSizeFrame::ScreenSizeFrame(
int wxid,
Dk4WxApplicationHelper *applicationHelper,
@@ -466,12 +453,9 @@ ScreenSizeFrame::ScreenSizeFrame(
mainSizer->SetSizeHints(this);
}
-#line 370 "ScreenSizeFrame.wxc"
+#line 394 "ScreenSizeFrame.wxc"
if(dkctGUILayoutOK) {
SetTitle(nlWx[0]);
-#if 0
- RestorePosition();
-#endif
oAsc.SetAutoStart(true);
oAsc.SetAutoExit(true);
}
@@ -481,7 +465,7 @@ ScreenSizeFrame::ScreenSizeFrame(
}
-#line 384 "ScreenSizeFrame.wxc"
+#line 405 "ScreenSizeFrame.wxc"
@@ -728,7 +712,7 @@ ScreenSizeFrame::ChangeScreenSize(void)
bool found = false;
-#line 629 "ScreenSizeFrame.wxc"
+#line 650 "ScreenSizeFrame.wxc"
switch (iArgc) {
case 5 : {
back = true;
@@ -829,7 +813,6 @@ ScreenSizeFrame::ChangeScreenSize(void)
} break;
}
- finished:
if (back) {
lSsr->SetLabel(sTexts[16]);
lSsr->SetForegroundColour(cGreen);
@@ -842,7 +825,7 @@ ScreenSizeFrame::ChangeScreenSize(void)
Update();
-#line 741 "ScreenSizeFrame.wxc"
+#line 761 "ScreenSizeFrame.wxc"
return back;
}
@@ -858,16 +841,16 @@ ScreenSizeFrame::OnIdle(wxIdleEvent & event)
#endif
-#line 755 "ScreenSizeFrame.wxc"
+#line 775 "ScreenSizeFrame.wxc"
/* __CHANGE__
*/
if (bActive) {
switch (oAsc.GetReaction()) {
#if 0
- case DK4WX_AUTOSTART_REACTION_IGNORE : {
+ case Dk4WxAutostartController::REACTION_IGNORE : {
} break;
#endif
- case DK4WX_AUTOSTART_REACTION_START : {
+ case Dk4WxAutostartController::REACTION_START : {
oAsc.StartProcessing();
#if AUTO_EXIT_ONLY_ON_SUCCESS
bSuccess = ChangeScreenSize();
@@ -877,9 +860,9 @@ ScreenSizeFrame::OnIdle(wxIdleEvent & event)
oAsc.EndProcessing(true);
#endif
} break;
- case DK4WX_AUTOSTART_REACTION_MORE : {
+ case Dk4WxAutostartController::REACTION_MORE : {
} break;
- case DK4WX_AUTOSTART_REACTION_EXIT : {
+ case Dk4WxAutostartController::REACTION_EXIT : {
bActive = false;
Close();
} break;
@@ -888,7 +871,7 @@ ScreenSizeFrame::OnIdle(wxIdleEvent & event)
}
-#line 783 "ScreenSizeFrame.wxc"
+#line 803 "ScreenSizeFrame.wxc"
event.Skip();
}
diff --git a/support/dktools/ScreenSizeFrame.h b/support/dktools/ScreenSizeFrame.h
index 44f1a12949..6511c6aadd 100644
--- a/support/dktools/ScreenSizeFrame.h
+++ b/support/dktools/ScreenSizeFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: ScreenSizeFrame.wxc
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: ScreenSizeFrame.wxc
*/
/** @file ScreenSizeFrame.h Header file for the ScreenSizeFrame module.
@@ -43,31 +21,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 131 "ScreenSizeFrame.wxc"
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+#ifndef DK4WXAUTOSTARTCONTROLLER_H_INCLUDED
#include <Dk4WxAutostartController.h>
+#endif
-enum {
- /** Set new screen size.
- */
- ACTION_SET_SCREEN_SIZE = 0 ,
-
- /** Toggle between normal and alternative size.
- */
- ACTION_TOGGLE_SCREEN_SIZE ,
-
- ACTION_REPORT_NO_ARGS_NO_SETTINGS
-};
-#line 149 "ScreenSizeFrame.wxc"
+#line 143 "ScreenSizeFrame.wxc"
class ScreenSizeFrame : public Dk4WxFrame
{
private:
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -230,7 +206,7 @@ class ScreenSizeFrame : public Dk4WxFrame
wxStaticText *lSsr;
-#line 200 "ScreenSizeFrame.wxc"
+#line 198 "ScreenSizeFrame.wxc"
private:
@@ -249,6 +225,23 @@ class ScreenSizeFrame : public Dk4WxFrame
public:
+ /** Action to perform.
+ */
+ enum {
+ /** Set new screen size.
+ */
+ ACTION_SET_SCREEN_SIZE = 0 ,
+
+ /** Toggle between normal and
+ alternative size.
+ */
+ ACTION_TOGGLE_SCREEN_SIZE ,
+
+ /** No arguments, do nothing.
+ */
+ ACTION_REPORT_NO_ARGS_NO_SETTINGS
+ };
+
/** Constructor.
@param wxid Window ID.
@param applicationHelper Application helper object.
@@ -321,7 +314,7 @@ class ScreenSizeFrame : public Dk4WxFrame
};
-#line 290 "ScreenSizeFrame.wxc"
+#line 305 "ScreenSizeFrame.wxc"
/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/ScreenSizeFrame.wxc b/support/dktools/ScreenSizeFrame.wxc
index 72ec946f7a..5a4aa93773 100644
--- a/support/dktools/ScreenSizeFrame.wxc
+++ b/support/dktools/ScreenSizeFrame.wxc
@@ -1,8 +1,8 @@
%% options
copyright owner = Dirk Krause
-copyright year = 2017
-license = bsd
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
@@ -129,21 +129,15 @@ text style = left
%% header start
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+#ifndef DK4WXAUTOSTARTCONTROLLER_H_INCLUDED
#include <Dk4WxAutostartController.h>
+#endif
-enum {
- /** Set new screen size.
- */
- ACTION_SET_SCREEN_SIZE = 0 ,
-
- /** Toggle between normal and alternative size.
- */
- ACTION_TOGGLE_SCREEN_SIZE ,
-
- ACTION_REPORT_NO_ARGS_NO_SETTINGS
-};
%% class start
class ScreenSizeFrame : public Dk4WxFrame
@@ -152,7 +146,11 @@ class ScreenSizeFrame : public Dk4WxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -215,6 +213,23 @@ class ScreenSizeFrame : public Dk4WxFrame
public:
+ /** Action to perform.
+ */
+ enum {
+ /** Set new screen size.
+ */
+ ACTION_SET_SCREEN_SIZE = 0 ,
+
+ /** Toggle between normal and
+ alternative size.
+ */
+ ACTION_TOGGLE_SCREEN_SIZE ,
+
+ /** No arguments, do nothing.
+ */
+ ACTION_REPORT_NO_ARGS_NO_SETTINGS
+ };
+
/** Constructor.
@param wxid Window ID.
@param applicationHelper Application helper object.
@@ -294,14 +309,14 @@ class ScreenSizeFrame : public Dk4WxFrame
#define AUTO_EXIT_ONLY_ON_SUCCESS 1
-
+#include "dk4conf.h"
#include "dk4mem.h"
#include "wxdkscrsz.h"
#include <dk4maixdul.h>
#include "dk4maoxd.h"
#if !defined(__WXMSW__)
-#include "wxdkscrsz.xpm"
+#include "gui-img/icons/wxdkscrsz.xpm"
#endif
@@ -322,12 +337,21 @@ $!end
/* __CHANGE__ 017: Add further events. */
/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
-BEGIN_EVENT_TABLE(ScreenSizeFrame, wxFrame)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(ScreenSizeFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(ScreenSizeFrame,wxFrame)
+#endif
EVT_MENU(ScreenSizeFrame_Quit, ScreenSizeFrame::OnQuit)
EVT_MENU(ScreenSizeFrame_Help_About, ScreenSizeFrame::OnAbout)
EVT_MENU(ScreenSizeFrame_Help_Contents, ScreenSizeFrame::OnHelpContents)
EVT_IDLE(ScreenSizeFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -369,9 +393,6 @@ ScreenSizeFrame::ScreenSizeFrame(
%% constructor end
if(dkctGUILayoutOK) {
SetTitle(nlWx[0]);
-#if 0
- RestorePosition();
-#endif
oAsc.SetAutoStart(true);
oAsc.SetAutoExit(true);
}
@@ -726,7 +747,6 @@ ScreenSizeFrame::ChangeScreenSize(void)
} break;
}
- finished:
if (back) {
lSsr->SetLabel(sTexts[16]);
lSsr->SetForegroundColour(cGreen);
@@ -757,10 +777,10 @@ ScreenSizeFrame::OnIdle(wxIdleEvent & event)
if (bActive) {
switch (oAsc.GetReaction()) {
#if 0
- case DK4WX_AUTOSTART_REACTION_IGNORE : {
+ case Dk4WxAutostartController::REACTION_IGNORE : {
} break;
#endif
- case DK4WX_AUTOSTART_REACTION_START : {
+ case Dk4WxAutostartController::REACTION_START : {
oAsc.StartProcessing();
#if AUTO_EXIT_ONLY_ON_SUCCESS
bSuccess = ChangeScreenSize();
@@ -770,9 +790,9 @@ ScreenSizeFrame::OnIdle(wxIdleEvent & event)
oAsc.EndProcessing(true);
#endif
} break;
- case DK4WX_AUTOSTART_REACTION_MORE : {
+ case Dk4WxAutostartController::REACTION_MORE : {
} break;
- case DK4WX_AUTOSTART_REACTION_EXIT : {
+ case Dk4WxAutostartController::REACTION_EXIT : {
bActive = false;
Close();
} break;
diff --git a/support/dktools/TODO b/support/dktools/TODO
index 3bb67beb0f..f93a497cea 100644
--- a/support/dktools/TODO
+++ b/support/dktools/TODO
@@ -1,15 +1,33 @@
-dk4strmco-Modul kontrollieren:
-Resourcen-Freigabe noch nicht drin beim Schließen des Streams.
+Complete wxdkdraw
+- Move points
+- Change image size
+- Add points
+- Remove points
+- Edit objects
+- Group objects
+- Ungroup objects
-png_set_packing(), falls weniger als 8 bits per component
+Change HTML and man pages, list options in alphabetical order
+or in alphabetical order within option groups.
-dk4strmu-Modul
-- bmeps-Modul
-- PDF-Modul
+Reimplementation of wxWidgets applications for
+DK libraries version 4:
+- wxdkpath
+- winprint
+- wxdkclock
+- wxdkhtb
+- ChangeScreenSize
-- EPS-Modul
+Reimplementation of CLI applications for
+DK libraries version 4:
-- wxDraw
+- htmlbook
+- fig2lat
+- itadmin
+- dkwt
+- wprclean
+- dkwxwiz
+- dkct
diff --git a/support/dktools/WinprintApp.cpp b/support/dktools/WinprintApp.cpp
index 4493c11cd0..dd70d4e014 100644
--- a/support/dktools/WinprintApp.cpp
+++ b/support/dktools/WinprintApp.cpp
@@ -1,50 +1,28 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WinprintApp.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WinprintApp.cpt
*/
/** @file WinprintApp.cpp The WinprintApp module.
*/
-#line 91 "WinprintApp.cpt"
+#line 96 "WinprintApp.cpt"
#include "winprint.h"
-#line 96 "WinprintApp.cpt"
+#line 101 "WinprintApp.cpt"
@@ -192,7 +170,7 @@ wxT("Printer name conversion failed!"),
NULL
-#line 288 "WinprintApp.cpt"
+#line 293 "WinprintApp.cpt"
};
@@ -231,7 +209,7 @@ wxT("\n"),
wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."),
/* 10 */
-wxT("http://dktools.sourceforge.net"),
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
/* 11 */
wxT("http://www.wxwidgets.org"),
@@ -257,7 +235,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 350 "WinprintApp.cpt"
+#line 355 "WinprintApp.cpt"
};
@@ -274,14 +252,19 @@ dkT("winprint.str"),
NULL
-#line 367 "WinprintApp.cpt"
+#line 372 "WinprintApp.cpt"
};
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(WinprintApp);
+#else
IMPLEMENT_APP(WinprintApp)
+#endif
bool
@@ -292,12 +275,12 @@ WinprintApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchFs = NULL;
bool back = false;
-#line 388 "WinprintApp.cpt"
+#line 398 "WinprintApp.cpt"
/* Initialize members. */
nDefPrinter = 0;
@@ -340,9 +323,9 @@ WinprintApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+ phArchFs = new wxArchiveFSHandler();
+ if (NULL != phArchFs) {
+ wxFileSystem::AddHandler(phArchFs);
} else {
ShowMemoryErrorMessage();
goto finished;
@@ -381,8 +364,8 @@ WinprintApp::OnInit()
nDefPrinter
);
if(!(frame)) { ShowMemoryErrorMessage(); goto finished; }
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed. */
@@ -436,7 +419,7 @@ WinprintApp::OnExit()
-#line 525 "WinprintApp.cpt"
+#line 535 "WinprintApp.cpt"
/* __CHANGE__ 010: Set back to exit status code.
*/
@@ -515,14 +498,14 @@ WinprintApp::releasePrinterNames(void)
size_t i; /* Index of current printer name. */
-#line 602 "WinprintApp.cpt"
+#line 612 "WinprintApp.cpt"
if(pNames) {
wxptr = pNames;
for(i = 0; i < nNames; i++) {
if(*wxptr) {
-#line 607 "WinprintApp.cpt"
+#line 617 "WinprintApp.cpt"
dk3_release(*wxptr);
wxptr++;
}
@@ -531,7 +514,7 @@ WinprintApp::releasePrinterNames(void)
pNames = NULL;
}
-#line 614 "WinprintApp.cpt"
+#line 624 "WinprintApp.cpt"
}
diff --git a/support/dktools/WinprintApp.cpt b/support/dktools/WinprintApp.cpt
index e2784892bb..1e4bd565e3 100644
--- a/support/dktools/WinprintApp.cpt
+++ b/support/dktools/WinprintApp.cpt
@@ -8,7 +8,7 @@ copyright year = 2013-xxxx
# __CHANGE__ 002: Correct license type if necessary.
# Use "bsd", "gpl", "lgpl", or "commercial".
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -83,7 +83,12 @@ class WinprintApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(WinprintApp);
+#else
DECLARE_APP(WinprintApp)
+#endif
@@ -335,7 +340,7 @@ winprint.htb
# 9 10 11 12 13 14 15: List of libraries used.
#
DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
http://www.wxwidgets.org
http://www.libpng.org/pub/png/libpng.html
http://www.ijg.org
@@ -370,7 +375,12 @@ $!end
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(WinprintApp);
+#else
IMPLEMENT_APP(WinprintApp)
+#endif
bool
@@ -381,7 +391,7 @@ WinprintApp::OnInit()
wxPNGHandler *phPng = NULL;
wxXPMHandler *phXpm = NULL;
wxICOHandler *phIco = NULL;
- wxZipFSHandler *phZipFs = NULL;
+ wxArchiveFSHandler *phArchFs = NULL;
bool back = false;
$!trace-init winprint.deb
@@ -427,9 +437,9 @@ WinprintApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
- phZipFs = new wxZipFSHandler();
- if (NULL != phZipFs) {
- wxFileSystem::AddHandler(phZipFs);
+ phArchFs = new wxArchiveFSHandler();
+ if (NULL != phArchFs) {
+ wxFileSystem::AddHandler(phArchFs);
} else {
ShowMemoryErrorMessage();
goto finished;
@@ -468,8 +478,8 @@ WinprintApp::OnInit()
nDefPrinter
);
if(!(frame)) { ShowMemoryErrorMessage(); goto finished; }
- frame->Show();
frame->restorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed. */
diff --git a/support/dktools/WinprintApp.h b/support/dktools/WinprintApp.h
index a8f2653369..1684d63b23 100644
--- a/support/dktools/WinprintApp.h
+++ b/support/dktools/WinprintApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WinprintApp.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WinprintApp.cpt
*/
/** @file WinprintApp.h Header file for the WinprintApp module.
@@ -112,7 +90,12 @@ class WinprintApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(WinprintApp);
+#else
DECLARE_APP(WinprintApp)
+#endif
diff --git a/support/dktools/WinprintChooserDialog.cpp b/support/dktools/WinprintChooserDialog.cpp
index 49ebcd19b8..1be5ce8d16 100644
--- a/support/dktools/WinprintChooserDialog.cpp
+++ b/support/dktools/WinprintChooserDialog.cpp
@@ -1,63 +1,52 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WinprintChooserDialog.wxc
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WinprintChooserDialog.wxc
*/
/** @file WinprintChooserDialog.cpp The WinprintChooserDialog module.
*/
-#line 134 "WinprintChooserDialog.wxc"
+#line 138 "WinprintChooserDialog.wxc"
+
+#include "dk3conf.h"
#include "winprint.h"
-#line 140 "WinprintChooserDialog.wxc"
+#line 146 "WinprintChooserDialog.wxc"
/** Event table.
*/
-BEGIN_EVENT_TABLE(WinprintChooserDialog, wxDialog)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WinprintChooserDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WinprintChooserDialog,wxDialog)
+#endif
EVT_BUTTON(wxID_OK, WinprintChooserDialog::OnOK)
EVT_BUTTON(wxID_CANCEL, WinprintChooserDialog::OnCancel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
-#line 151 "WinprintChooserDialog.wxc"
+#line 166 "WinprintChooserDialog.wxc"
WinprintChooserDialog::WinprintChooserDialog(
DkWxFrame *parent,
wxChar const *title,
@@ -172,7 +161,7 @@ WinprintChooserDialog::WinprintChooserDialog(
sDialog->SetSizeHints(this);
}
-#line 171 "WinprintChooserDialog.wxc"
+#line 186 "WinprintChooserDialog.wxc"
if(dkctGUILayoutOK) {
if((pNames) && (nNames > 0)) {
#if VERSION_BEFORE_20140929
@@ -197,7 +186,7 @@ WinprintChooserDialog::WinprintChooserDialog(
}
-#line 195 "WinprintChooserDialog.wxc"
+#line 210 "WinprintChooserDialog.wxc"
void
diff --git a/support/dktools/WinprintChooserDialog.h b/support/dktools/WinprintChooserDialog.h
index 0512be7213..201bf5b497 100644
--- a/support/dktools/WinprintChooserDialog.h
+++ b/support/dktools/WinprintChooserDialog.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WinprintChooserDialog.wxc
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WinprintChooserDialog.wxc
*/
/** @file WinprintChooserDialog.h Header file for the WinprintChooserDialog module.
@@ -52,7 +30,11 @@ class WinprintChooserDialog : public wxDialog
private:
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
/** Flag: GUI ok.
*/
@@ -94,7 +76,7 @@ class WinprintChooserDialog : public wxDialog
wxButton *bCancel;
-#line 69 "WinprintChooserDialog.wxc"
+#line 73 "WinprintChooserDialog.wxc"
protected:
@@ -158,7 +140,7 @@ class WinprintChooserDialog : public wxDialog
};
-#line 132 "WinprintChooserDialog.wxc"
+#line 136 "WinprintChooserDialog.wxc"
#endif
diff --git a/support/dktools/WinprintChooserDialog.wxc b/support/dktools/WinprintChooserDialog.wxc
index d6bc73dc2b..c083a48d1d 100644
--- a/support/dktools/WinprintChooserDialog.wxc
+++ b/support/dktools/WinprintChooserDialog.wxc
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% wx-gui
@@ -63,7 +63,11 @@ class WinprintChooserDialog : public wxDialog
private:
/** Event table.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
%% class end
@@ -132,6 +136,8 @@ class WinprintChooserDialog : public wxDialog
%% module start
+
+#include "dk3conf.h"
#include "winprint.h"
@@ -141,10 +147,19 @@ $!trace-include
/** Event table.
*/
-BEGIN_EVENT_TABLE(WinprintChooserDialog, wxDialog)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WinprintChooserDialog,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WinprintChooserDialog,wxDialog)
+#endif
EVT_BUTTON(wxID_OK, WinprintChooserDialog::OnOK)
EVT_BUTTON(wxID_CANCEL, WinprintChooserDialog::OnCancel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
%% constructor start
diff --git a/support/dktools/WinprintFrame.cpp b/support/dktools/WinprintFrame.cpp
index 24fbcfe9db..ca4d4f56b7 100644
--- a/support/dktools/WinprintFrame.cpp
+++ b/support/dktools/WinprintFrame.cpp
@@ -1,78 +1,71 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WinprintFrame.wxc
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WinprintFrame.wxc
*/
/** @file WinprintFrame.cpp The WinprintFrame module.
*/
-#line 303 "WinprintFrame.wxc"
+#line 313 "WinprintFrame.wxc"
+#include "dk3conf.h"
#include "winprint.h"
#if 0
#include "dkt-version.h"
#endif
#include "dk4verswx.h"
#include "dk4verswx.h"
-#include "run-conversion.xpm"
-#include "exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
#if !defined(__WXMSW__)
-#include "winprint.xpm"
+#include "gui-img/icons/winprint.xpm"
#endif
-#line 321 "WinprintFrame.wxc"
+#line 332 "WinprintFrame.wxc"
/* __CHANGE__ 017: Add further events. */
/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
-BEGIN_EVENT_TABLE(WinprintFrame, wxFrame)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WinprintFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WinprintFrame,wxFrame)
+#endif
EVT_MENU(WinprintFrame_Quit, WinprintFrame::OnQuit)
EVT_MENU(WinprintFrame_Print, WinprintFrame::OnPrint)
EVT_MENU(WinprintFrame_Help_About, WinprintFrame::OnAbout)
EVT_MENU(WinprintFrame_Help_Contents, WinprintFrame::OnHelpContents)
EVT_IDLE(WinprintFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc winprint_cmd_line_desc[] = {
{
wxCMD_LINE_OPTION,
@@ -98,9 +91,13 @@ static const wxCmdLineEntryDesc winprint_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
-#line 363 "WinprintFrame.wxc"
+#line 392 "WinprintFrame.wxc"
WinprintFrame::WinprintFrame(
int wxid,
DkWxAppHelper *applicationHelper,
@@ -313,12 +310,9 @@ WinprintFrame::WinprintFrame(
mainSizer->SetSizeHints(this);
}
-#line 412 "WinprintFrame.wxc"
+#line 441 "WinprintFrame.wxc"
if(dkctGUILayoutOK) {
SetTitle(nlWx[0]);
-#if 0
- restorePosition();
-#endif
}
if((pNames) && (nNames > 0)) {
wxsNames = new wxString[nNames];
@@ -353,7 +347,8 @@ WinprintFrame::WinprintFrame(
} else {
if(parser.Found(wxT("P"), &sPrinter)) {
/* Use named printer */
- ptr = sPrinter.c_str();
+ wxCStrData printerstrdata = sPrinter.c_str();
+ ptr = (wxChar const *)printerstrdata;
if(ptr) {
if(sNamedPrinter) {
dk3_release(sNamedPrinter);
@@ -373,7 +368,8 @@ WinprintFrame::WinprintFrame(
| wxPATH_NORM_TILDE | wxPATH_NORM_ABSOLUTE
);
fullPath = fn.GetFullPath();
- ptr = fullPath.c_str();
+ wxCStrData fullpathstrdata = fullPath.c_str();
+ ptr = (wxChar const *)fullpathstrdata;
if(ptr) {
if(sNamedFile) {
dk3_release(sNamedFile);
@@ -389,7 +385,7 @@ WinprintFrame::WinprintFrame(
-#line 487 "WinprintFrame.wxc"
+#line 515 "WinprintFrame.wxc"
@@ -520,12 +516,12 @@ WinprintFrame::OnIdle(wxIdleEvent & event)
int res; /* Operation result. */
-#line 616 "WinprintFrame.wxc"
+#line 644 "WinprintFrame.wxc"
/* __CHANGE__
*/
if(firstIdle) {
-#line 619 "WinprintFrame.wxc"
+#line 647 "WinprintFrame.wxc"
firstIdle = false;
tStatus->SetLabel(wxT(""));
Refresh();
@@ -534,49 +530,49 @@ WinprintFrame::OnIdle(wxIdleEvent & event)
event.RequestMore();
} else {
-#line 626 "WinprintFrame.wxc"
+#line 654 "WinprintFrame.wxc"
if(!bCloseScheduled) {
-#line 627 "WinprintFrame.wxc"
+#line 655 "WinprintFrame.wxc"
if(pComm) {
-#line 628 "WinprintFrame.wxc"
+#line 656 "WinprintFrame.wxc"
if((bAutostartWanted) && (pComm->autostartCanRun())) {
-#line 630 "WinprintFrame.wxc"
+#line 658 "WinprintFrame.wxc"
res = runJob();
if(res > 0) {
-#line 632 "WinprintFrame.wxc"
+#line 660 "WinprintFrame.wxc"
event.RequestMore();
}
} else {
-#line 635 "WinprintFrame.wxc"
+#line 663 "WinprintFrame.wxc"
if(pComm->autostartIsFinished()) {
-#line 636 "WinprintFrame.wxc"
+#line 664 "WinprintFrame.wxc"
if(!(timeClose)) {
-#line 637 "WinprintFrame.wxc"
+#line 665 "WinprintFrame.wxc"
if(pComm->getLogLevel() > DK3_LL_WARNING) {
-#line 638 "WinprintFrame.wxc"
+#line 666 "WinprintFrame.wxc"
dk3sf_time(&timeClose);
-#line 639 "WinprintFrame.wxc"
+#line 667 "WinprintFrame.wxc"
event.RequestMore();
tStatus->SetLabel(sTexts[14]);
-#line 641 "WinprintFrame.wxc"
+#line 669 "WinprintFrame.wxc"
tStatus->SetForegroundColour(cGreen);
Refresh();
Update();
} else {
tStatus->SetLabel(pComm->getText());
-#line 646 "WinprintFrame.wxc"
+#line 674 "WinprintFrame.wxc"
tStatus->SetForegroundColour(cRed);
Refresh();
Update();
@@ -585,32 +581,32 @@ WinprintFrame::OnIdle(wxIdleEvent & event)
);
dk3sf_time(&timeClose);
-#line 653 "WinprintFrame.wxc"
+#line 681 "WinprintFrame.wxc"
event.RequestMore();
}
}
}
if(timeClose) {
-#line 658 "WinprintFrame.wxc"
+#line 686 "WinprintFrame.wxc"
dk3sf_time(&ct);
if(ct > (timeClose + (dk3_time_t)1UL)) {
-#line 660 "WinprintFrame.wxc"
+#line 688 "WinprintFrame.wxc"
timeClose = (dk3_time_t)0UL;
bCloseScheduled = true;
Show(false);
Close();
} else {
-#line 665 "WinprintFrame.wxc"
+#line 693 "WinprintFrame.wxc"
event.RequestMore();
}
}
}
} else {
-#line 670 "WinprintFrame.wxc"
+#line 698 "WinprintFrame.wxc"
/* ERROR: No communicator */
if(timeClose) {
dk3sf_time(&ct);
@@ -626,78 +622,43 @@ WinprintFrame::OnIdle(wxIdleEvent & event)
}
} else {
-#line 684 "WinprintFrame.wxc"
+#line 712 "WinprintFrame.wxc"
}
}
event.Skip();
-#line 688 "WinprintFrame.wxc"
+#line 716 "WinprintFrame.wxc"
}
int
-WinprintFrame::runJob(void)
+WinprintFrame::runFileNameJob(wxChar const *filename)
{
- wxChar prbuf[512]; /* Printer name in system enc. */
- wxString path; /* File path. */
- wxChar const *filename = NULL; /* File name. */
- wxChar const *printername = NULL; /* Printer name. */
- int res; /* Operation result. */
- int ok = 0; /* Flag: Success. */
- int back = 0;
+ wxChar prbuf[512]; /* Printer name system enc */
+ wxChar const *printername = NULL; /* Printer name */
+ int res = 0; /* Operation result */
+ int ok = 0; /* Flag: Success */
+ int back = 0; /* Function result */
-#line 703 "WinprintFrame.wxc"
- tStatus->SetLabel(sTexts[17]);
-
-#line 704 "WinprintFrame.wxc"
- tStatus->SetForegroundColour(cBlack);
- Refresh();
- Update();
- if(sNamedFile) {
-
-#line 708 "WinprintFrame.wxc"
- filename = sNamedFile;
- } else {
-
-#line 710 "WinprintFrame.wxc"
- wxString s(wxT(""));
- s.Append(wxT("Print files (*.prn)|*.prn"));
- s.Append(wxT("|All files (*.*)|*.*"));
-#if wxCHECK_VERSION(2, 9, 0)
- wxFileDialog dlg(this, sTexts[18], wxT("."), wxT(""), s, wxFD_OPEN);
-#else
- wxFileDialog dlg(this, sTexts[18], wxT("."), wxT(""), s, wxOPEN);
-#endif
- pHelper->setRelatedPosition(this, &dlg, &fdx, &fdy);
- if(wxID_OK == dlg.ShowModal()) {
- path = dlg.GetPath();
- filename = path.c_str();
- } else {
- /* Aborted by user */
- setErrorStatus(sTexts[19], NULL);
-
-#line 725 "WinprintFrame.wxc"
- }
- dlg.GetPosition(&fdx, &fdy);
- }
+#line 729 "WinprintFrame.wxc"
if(filename) {
-#line 729 "WinprintFrame.wxc"
+#line 730 "WinprintFrame.wxc"
if(bUseDefaultPrinter) {
-#line 730 "WinprintFrame.wxc"
+#line 731 "WinprintFrame.wxc"
if(pc) {
-#line 731 "WinprintFrame.wxc"
+#line 732 "WinprintFrame.wxc"
if(pc->defPrinter) {
-#line 732 "WinprintFrame.wxc"
+#line 733 "WinprintFrame.wxc"
if((pc->defPrinter->name)) {
-#line 733 "WinprintFrame.wxc"
+#line 734 "WinprintFrame.wxc"
res = dk3wxs_from_dkstr(
prbuf,
DK3_SIZEOF(prbuf,wxChar),
@@ -707,102 +668,102 @@ WinprintFrame::runJob(void)
);
if(res) {
-#line 741 "WinprintFrame.wxc"
+#line 742 "WinprintFrame.wxc"
printername = prbuf;
} else {
-#line 743 "WinprintFrame.wxc"
+#line 744 "WinprintFrame.wxc"
/* ERROR: Failed to convert printer name! */
setErrorStatus(sTexts[24], filename);
-#line 745 "WinprintFrame.wxc"
+#line 746 "WinprintFrame.wxc"
}
} else {
-#line 747 "WinprintFrame.wxc"
+#line 748 "WinprintFrame.wxc"
/* ERROR: No default printer name */
setErrorStatus(sTexts[25], filename);
-#line 749 "WinprintFrame.wxc"
+#line 750 "WinprintFrame.wxc"
}
} else {
-#line 751 "WinprintFrame.wxc"
+#line 752 "WinprintFrame.wxc"
/* ERROR: No default printer */
setErrorStatus(sTexts[25], filename);
-#line 753 "WinprintFrame.wxc"
+#line 754 "WinprintFrame.wxc"
}
} else {
-#line 755 "WinprintFrame.wxc"
+#line 756 "WinprintFrame.wxc"
/* ERROR: No print configuration */
setErrorStatus(sTexts[26], filename);
-#line 757 "WinprintFrame.wxc"
+#line 758 "WinprintFrame.wxc"
}
} else {
-#line 759 "WinprintFrame.wxc"
+#line 760 "WinprintFrame.wxc"
if(sNamedPrinter) {
-#line 760 "WinprintFrame.wxc"
+#line 761 "WinprintFrame.wxc"
printername = sNamedPrinter;
} else {
-#line 762 "WinprintFrame.wxc"
+#line 763 "WinprintFrame.wxc"
if((pNames) && (wxsNames) && (nNames > 0)) {
-#line 763 "WinprintFrame.wxc"
+#line 764 "WinprintFrame.wxc"
WinprintChooserDialog dlg(this, sTexts[30], sTexts, wxsNames, nNames);
dlg.setCurrentPrinter(nDefPrinter);
pHelper->setRelatedPosition(this, &dlg, &pcx, &pcy);
if(wxID_OK == dlg.ShowModal()) {
-#line 767 "WinprintFrame.wxc"
+#line 768 "WinprintFrame.wxc"
nDefPrinter = dlg.getCurrentPrinter();
if((nDefPrinter >= 0) && (nDefPrinter < (int)nNames)) {
-#line 769 "WinprintFrame.wxc"
+#line 770 "WinprintFrame.wxc"
printername = pNames[nDefPrinter];
} else {
-#line 771 "WinprintFrame.wxc"
+#line 772 "WinprintFrame.wxc"
/* BUG: Illegal return value from dialog */
setErrorStatus(sTexts[26], filename);
-#line 773 "WinprintFrame.wxc"
+#line 774 "WinprintFrame.wxc"
}
} else {
-#line 775 "WinprintFrame.wxc"
+#line 776 "WinprintFrame.wxc"
/* ERROR: Aborted by user */
setErrorStatus(sTexts[19], filename);
-#line 777 "WinprintFrame.wxc"
+#line 778 "WinprintFrame.wxc"
}
dlg.GetPosition(&pcx, &pcy);
} else {
-#line 780 "WinprintFrame.wxc"
+#line 781 "WinprintFrame.wxc"
/* ERROR: No printer configuration */
setErrorStatus(sTexts[26], filename);
-#line 782 "WinprintFrame.wxc"
+#line 783 "WinprintFrame.wxc"
}
}
}
} else {
-#line 786 "WinprintFrame.wxc"
+#line 787 "WinprintFrame.wxc"
}
if((filename) && (printername)) {
-#line 788 "WinprintFrame.wxc"
+#line 789 "WinprintFrame.wxc"
/* wxMessageBox(filename, printername); */
if(pComm) {
-#line 790 "WinprintFrame.wxc"
+#line 791 "WinprintFrame.wxc"
DkWxProgressDialog *pd;
pComm->prepareRun();
pd = new DkWxProgressDialog(
@@ -817,17 +778,17 @@ WinprintFrame::runJob(void)
);
if(pd) {
-#line 803 "WinprintFrame.wxc"
+#line 804 "WinprintFrame.wxc"
WinprintThread *pt;
pt = new WinprintThread(
pComm, sTexts, pHelper, pc, filename, printername
);
if(pt) {
-#line 808 "WinprintFrame.wxc"
+#line 809 "WinprintFrame.wxc"
if(wxTHREAD_NO_ERROR == pt->Create()) {
-#line 809 "WinprintFrame.wxc"
+#line 810 "WinprintFrame.wxc"
pt->SetPriority(WXTHREAD_DEFAULT_PRIORITY);
pt->Run();
pd->chooseModalPosition();
@@ -835,20 +796,20 @@ WinprintFrame::runJob(void)
ok = 1;
if(pComm->getLogLevel() <= DK3_LL_WARNING) {
-#line 815 "WinprintFrame.wxc"
+#line 816 "WinprintFrame.wxc"
/* ERRORS occured */
tStatus->SetLabel(pComm->getText());
-#line 817 "WinprintFrame.wxc"
+#line 818 "WinprintFrame.wxc"
tStatus->SetForegroundColour(cRed);
} else {
-#line 819 "WinprintFrame.wxc"
+#line 820 "WinprintFrame.wxc"
/* Transfer succeeeded */
if(!(bAutostartWanted)) {
tStatus->SetLabel(sTexts[37]);
-#line 822 "WinprintFrame.wxc"
+#line 823 "WinprintFrame.wxc"
tStatus->SetForegroundColour(cGreen);
}
}
@@ -857,37 +818,37 @@ WinprintFrame::runJob(void)
back = 1;
} else {
-#line 829 "WinprintFrame.wxc"
+#line 830 "WinprintFrame.wxc"
/* ERROR: Create method failed! */
setErrorStatus(sTexts[27], filename);
-#line 831 "WinprintFrame.wxc"
+#line 832 "WinprintFrame.wxc"
}
} else {
-#line 833 "WinprintFrame.wxc"
+#line 834 "WinprintFrame.wxc"
/* ERROR: Failed to create thread */
setErrorStatus(sTexts[27], filename);
-#line 835 "WinprintFrame.wxc"
+#line 836 "WinprintFrame.wxc"
}
pd->Destroy();
} else {
-#line 838 "WinprintFrame.wxc"
+#line 839 "WinprintFrame.wxc"
/* ERROR: Failed to create progress dialog */
setErrorStatus(sTexts[28], filename);
-#line 840 "WinprintFrame.wxc"
+#line 841 "WinprintFrame.wxc"
}
} else {
-#line 842 "WinprintFrame.wxc"
+#line 843 "WinprintFrame.wxc"
/* ###### ERROR: No communicator */
}
} else {
-#line 845 "WinprintFrame.wxc"
+#line 846 "WinprintFrame.wxc"
if(pComm) {
if(!(filename)) {
}
@@ -896,9 +857,65 @@ WinprintFrame::runJob(void)
} else {
/* ##### ERROR: No communicator */
}
- }
+ }
+
+
+#line 856 "WinprintFrame.wxc"
+ return back;
+}
+
+
+
+int
+WinprintFrame::runJob(void)
+{
+ wxString path; /* File path. */
+ wxChar const *filename = NULL; /* File name. */
+ int back = 0;
+
+
+#line 868 "WinprintFrame.wxc"
+ tStatus->SetLabel(sTexts[17]);
+
+#line 869 "WinprintFrame.wxc"
+ tStatus->SetForegroundColour(cBlack);
+ Refresh();
+ Update();
+ if(sNamedFile) {
+
+#line 873 "WinprintFrame.wxc"
+ filename = sNamedFile;
+ back = runFileNameJob(filename);
+ } else {
+
+#line 876 "WinprintFrame.wxc"
+ wxString s(wxT(""));
+ s.Append(wxT("Print files (*.prn)|*.prn"));
+ s.Append(wxT("|All files (*.*)|*.*"));
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(this, sTexts[18], wxT("."), wxT(""), s, wxFD_OPEN);
+#else
+ wxFileDialog dlg(this, sTexts[18], wxT("."), wxT(""), s, wxOPEN);
+#endif
+ pHelper->setRelatedPosition(this, &dlg, &fdx, &fdy);
+ if(wxID_OK == dlg.ShowModal()) {
+ path = dlg.GetPath();
+ wxCStrData pathstrdata = path.c_str();
+ filename = (wxChar const *)pathstrdata;
+ if (NULL != filename) {
+ back = runFileNameJob(filename);
+ }
+ } else {
+ /* Aborted by user */
+ setErrorStatus(sTexts[19], NULL);
+
+#line 895 "WinprintFrame.wxc"
+ }
+ dlg.GetPosition(&fdx, &fdy);
+ }
+
-#line 854 "WinprintFrame.wxc"
+#line 899 "WinprintFrame.wxc"
return back;
}
diff --git a/support/dktools/WinprintFrame.h b/support/dktools/WinprintFrame.h
index 3f13a839a5..6c87772e08 100644
--- a/support/dktools/WinprintFrame.h
+++ b/support/dktools/WinprintFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WinprintFrame.wxc
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WinprintFrame.wxc
*/
/** @file WinprintFrame.h Header file for the WinprintFrame module.
@@ -59,7 +37,11 @@ class WinprintFrame : public DkWxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -230,7 +212,7 @@ class WinprintFrame : public DkWxFrame
wxStaticText *tStatus;
-#line 212 "WinprintFrame.wxc"
+#line 216 "WinprintFrame.wxc"
public:
@@ -307,6 +289,12 @@ class WinprintFrame : public DkWxFrame
/* __CHANGE__ 014: Add further methods.
*/
+ /** Run print job for given file name.
+ @param filename Name of file to print.
+ */
+ int
+ runFileNameJob(wxChar const *filename);
+
/** Run for a print job.
*/
int runJob(void);
@@ -320,7 +308,7 @@ class WinprintFrame : public DkWxFrame
};
-#line 301 "WinprintFrame.wxc"
+#line 311 "WinprintFrame.wxc"
#endif
diff --git a/support/dktools/WinprintFrame.wxc b/support/dktools/WinprintFrame.wxc
index 6d92aa94fa..feff881687 100644
--- a/support/dktools/WinprintFrame.wxc
+++ b/support/dktools/WinprintFrame.wxc
@@ -8,7 +8,7 @@ copyright year = 2013-xxxx
# __CHANGE__ 002: Correct license type if necessary.
# Use "bsd", "gpl", "lgpl", or "commercial".
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -116,7 +116,11 @@ class WinprintFrame : public DkWxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -285,6 +289,12 @@ class WinprintFrame : public DkWxFrame
/* __CHANGE__ 014: Add further methods.
*/
+ /** Run print job for given file name.
+ @param filename Name of file to print.
+ */
+ int
+ runFileNameJob(wxChar const *filename);
+
/** Run for a print job.
*/
int runJob(void);
@@ -301,18 +311,19 @@ class WinprintFrame : public DkWxFrame
%% module start
+#include "dk3conf.h"
#include "winprint.h"
#if 0
#include "dkt-version.h"
#endif
#include "dk4verswx.h"
#include "dk4verswx.h"
-#include "run-conversion.xpm"
-#include "exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
#if !defined(__WXMSW__)
-#include "winprint.xpm"
+#include "gui-img/icons/winprint.xpm"
#endif
@@ -323,16 +334,30 @@ $!trace-include
/* __CHANGE__ 017: Add further events. */
/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
-BEGIN_EVENT_TABLE(WinprintFrame, wxFrame)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WinprintFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WinprintFrame,wxFrame)
+#endif
EVT_MENU(WinprintFrame_Quit, WinprintFrame::OnQuit)
EVT_MENU(WinprintFrame_Print, WinprintFrame::OnPrint)
EVT_MENU(WinprintFrame_Help_About, WinprintFrame::OnAbout)
EVT_MENU(WinprintFrame_Help_Contents, WinprintFrame::OnHelpContents)
EVT_IDLE(WinprintFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc winprint_cmd_line_desc[] = {
{
wxCMD_LINE_OPTION,
@@ -358,6 +383,10 @@ static const wxCmdLineEntryDesc winprint_cmd_line_desc[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
%% constructor start
WinprintFrame::WinprintFrame(
@@ -411,9 +440,6 @@ WinprintFrame::WinprintFrame(
%% constructor end
if(dkctGUILayoutOK) {
SetTitle(nlWx[0]);
-#if 0
- restorePosition();
-#endif
}
if((pNames) && (nNames > 0)) {
wxsNames = new wxString[nNames];
@@ -448,7 +474,8 @@ WinprintFrame::WinprintFrame(
} else {
if(parser.Found(wxT("P"), &sPrinter)) {
/* Use named printer */
- ptr = sPrinter.c_str();
+ wxCStrData printerstrdata = sPrinter.c_str();
+ ptr = (wxChar const *)printerstrdata;
if(ptr) {
if(sNamedPrinter) {
dk3_release(sNamedPrinter);
@@ -468,7 +495,8 @@ WinprintFrame::WinprintFrame(
| wxPATH_NORM_TILDE | wxPATH_NORM_ABSOLUTE
);
fullPath = fn.GetFullPath();
- ptr = fullPath.c_str();
+ wxCStrData fullpathstrdata = fullPath.c_str();
+ ptr = (wxChar const *)fullpathstrdata;
if(ptr) {
if(sNamedFile) {
dk3_release(sNamedFile);
@@ -690,41 +718,14 @@ WinprintFrame::OnIdle(wxIdleEvent & event)
int
-WinprintFrame::runJob(void)
+WinprintFrame::runFileNameJob(wxChar const *filename)
{
- wxChar prbuf[512]; /* Printer name in system enc. */
- wxString path; /* File path. */
- wxChar const *filename = NULL; /* File name. */
- wxChar const *printername = NULL; /* Printer name. */
- int res; /* Operation result. */
- int ok = 0; /* Flag: Success. */
- int back = 0;
- $? "+ WinprintFrame::runJob"
- tStatus->SetLabel(sTexts[17]); $? ". tStatus 17"
- tStatus->SetForegroundColour(cBlack);
- Refresh();
- Update();
- if(sNamedFile) { $? ". named file"
- filename = sNamedFile;
- } else { $? ". no named file"
- wxString s(wxT(""));
- s.Append(wxT("Print files (*.prn)|*.prn"));
- s.Append(wxT("|All files (*.*)|*.*"));
-#if wxCHECK_VERSION(2, 9, 0)
- wxFileDialog dlg(this, sTexts[18], wxT("."), wxT(""), s, wxFD_OPEN);
-#else
- wxFileDialog dlg(this, sTexts[18], wxT("."), wxT(""), s, wxOPEN);
-#endif
- pHelper->setRelatedPosition(this, &dlg, &fdx, &fdy);
- if(wxID_OK == dlg.ShowModal()) {
- path = dlg.GetPath();
- filename = path.c_str();
- } else {
- /* Aborted by user */
- setErrorStatus(sTexts[19], NULL); $? ". setErrorStatus 19"
- }
- dlg.GetPosition(&fdx, &fdy);
- }
+ wxChar prbuf[512]; /* Printer name system enc */
+ wxChar const *printername = NULL; /* Printer name */
+ int res = 0; /* Operation result */
+ int ok = 0; /* Flag: Success */
+ int back = 0; /* Function result */
+ $? "+ runFileNameJob"
if(filename) { $? ". have file"
if(bUseDefaultPrinter) { $? ". use default printer"
if(pc) { $? ". have print conf"
@@ -850,7 +851,51 @@ WinprintFrame::runJob(void)
} else {
/* ##### ERROR: No communicator */
}
- } $? "- WinprintFrame::runJob %d", back
+ }
+ $? "- runFileNameJob %d", back
+ return back;
+}
+
+
+
+int
+WinprintFrame::runJob(void)
+{
+ wxString path; /* File path. */
+ wxChar const *filename = NULL; /* File name. */
+ int back = 0;
+ $? "+ WinprintFrame::runJob"
+ tStatus->SetLabel(sTexts[17]); $? ". tStatus 17"
+ tStatus->SetForegroundColour(cBlack);
+ Refresh();
+ Update();
+ if(sNamedFile) { $? ". named file"
+ filename = sNamedFile;
+ back = runFileNameJob(filename);
+ } else { $? ". no named file"
+ wxString s(wxT(""));
+ s.Append(wxT("Print files (*.prn)|*.prn"));
+ s.Append(wxT("|All files (*.*)|*.*"));
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(this, sTexts[18], wxT("."), wxT(""), s, wxFD_OPEN);
+#else
+ wxFileDialog dlg(this, sTexts[18], wxT("."), wxT(""), s, wxOPEN);
+#endif
+ pHelper->setRelatedPosition(this, &dlg, &fdx, &fdy);
+ if(wxID_OK == dlg.ShowModal()) {
+ path = dlg.GetPath();
+ wxCStrData pathstrdata = path.c_str();
+ filename = (wxChar const *)pathstrdata;
+ if (NULL != filename) {
+ back = runFileNameJob(filename);
+ }
+ } else {
+ /* Aborted by user */
+ setErrorStatus(sTexts[19], NULL); $? ". setErrorStatus 19"
+ }
+ dlg.GetPosition(&fdx, &fdy);
+ }
+ $? "- WinprintFrame::runJob %d", back
return back;
}
diff --git a/support/dktools/WinprintThread.cpp b/support/dktools/WinprintThread.cpp
index a953b97d90..70d10dce7d 100644
--- a/support/dktools/WinprintThread.cpp
+++ b/support/dktools/WinprintThread.cpp
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WinprintThread.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WinprintThread.cpt
*/
/** @file WinprintThread.cpp The WinprintThread module.
diff --git a/support/dktools/WinprintThread.cpt b/support/dktools/WinprintThread.cpt
index c5af61985f..60afb1061b 100644
--- a/support/dktools/WinprintThread.cpt
+++ b/support/dktools/WinprintThread.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/WinprintThread.h b/support/dktools/WinprintThread.h
index 7b88e4643a..bbbc53e5b6 100644
--- a/support/dktools/WinprintThread.h
+++ b/support/dktools/WinprintThread.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WinprintThread.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WinprintThread.cpt
*/
/** @file WinprintThread.h Header file for the WinprintThread module.
diff --git a/support/dktools/WxdkdrawApp.cpp b/support/dktools/WxdkdrawApp.cpp
new file mode 100644
index 0000000000..478111e38a
--- /dev/null
+++ b/support/dktools/WxdkdrawApp.cpp
@@ -0,0 +1,2299 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawApp.cpt
+*/
+
+/** @file WxdkdrawApp.cpp The WxdkdrawApp module.
+*/
+
+
+#line 71 "WxdkdrawApp.cpt"
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+#line 83 "WxdkdrawApp.cpt"
+
+
+
+/** Localized wxChar texts.
+*/
+static wxChar const * wxdkdraw_texts[] = {
+/* 0 */
+wxT("File"),
+
+/* 1 */
+wxT("Quit"),
+
+/* 2 */
+wxT("Exit the application"),
+
+/* 3 */
+wxT("Help"),
+
+/* 4 */
+wxT("About"),
+
+/* 5 */
+wxT("Show version information"),
+
+/* 6 */
+wxT("Contents"),
+
+/* 7 */
+wxT("Open table of contents"),
+
+/* 8 */
+wxT("Initializing..."),
+
+/* 9 */
+wxT("Copyright (c) "),
+
+/* 10 */
+wxT("About "),
+
+/* 11 */
+wxT("This program uses the following libraries:"),
+
+/* 12 */
+wxT("See:"),
+
+/* 13 */
+wxT("L: "),
+
+/* 14 */
+wxT(" M: "),
+
+/* 15 */
+wxT(" R: "),
+
+/* 16 */
+wxT(" X: "),
+
+/* 17 */
+wxT(" Y: "),
+
+/* 18 */
+wxT("wxdkdraw - Draw for LaTeX"),
+
+/* 19 */
+wxT("part of DK tools and libraries, version "),
+
+/* 20 */
+wxT("New"),
+
+/* 21 */
+wxT("Create new empty drawing"),
+
+/* 22 */
+wxT("Open"),
+
+/* 23 */
+wxT("Open a file"),
+
+/* 24 */
+wxT("Save"),
+
+/* 25 */
+wxT("Save drawing to file"),
+
+/* 26 */
+wxT("Save as..."),
+
+/* 27 */
+wxT("Save drawing to new file name"),
+
+/* 28 */
+wxT("Add"),
+
+/* 29 */
+wxT("Polyline"),
+
+/* 30 */
+wxT("Add polyline"),
+
+/* 31 */
+wxT("Polygon"),
+
+/* 32 */
+wxT("Add polygon"),
+
+/* 33 */
+wxT("Rectangle"),
+
+/* 34 */
+wxT("Add rectangular box"),
+
+/* 35 */
+wxT("Box"),
+
+/* 36 */
+wxT("Add box with rounded corners"),
+
+/* 37 */
+wxT("Circle"),
+
+/* 38 */
+wxT("Add circle"),
+
+/* 39 */
+wxT("Ellipse"),
+
+/* 40 */
+wxT("Add ellipse"),
+
+/* 41 */
+wxT("Open approximated spline"),
+
+/* 42 */
+wxT("Add open approximated spline"),
+
+/* 43 */
+wxT("Closed approximated spline"),
+
+/* 44 */
+wxT("Add closed approximated spline"),
+
+/* 45 */
+wxT("Open interpolated spline"),
+
+/* 46 */
+wxT("Add open interpolated spline"),
+
+/* 47 */
+wxT("Closed interpolated spline"),
+
+/* 48 */
+wxT("Add closed interpolated spline"),
+
+/* 49 */
+wxT("Connector dot"),
+
+/* 50 */
+wxT("Add dot indicating a connection"),
+
+/* 51 */
+wxT("Pin dot"),
+
+/* 52 */
+wxT("Add dot indicating a pin"),
+
+/* 53 */
+wxT("Text label"),
+
+/* 54 */
+wxT("Add text label"),
+
+/* 55 */
+wxT("Image"),
+
+/* 56 */
+wxT("Add bitmap image (PNG/JPEG/TIFF/NetPBM)"),
+
+/* 57 */
+wxT("Library element"),
+
+/* 58 */
+wxT("Add library element from file"),
+
+/* 59 */
+wxT("Edit"),
+
+/* 60 */
+wxT("Copy object"),
+
+/* 61 */
+wxT("Copy object"),
+
+/* 62 */
+wxT("Move object"),
+
+/* 63 */
+wxT("Move object"),
+
+/* 64 */
+wxT("Delete object"),
+
+/* 65 */
+wxT("Delete object"),
+
+/* 66 */
+wxT("Move point"),
+
+/* 67 */
+wxT("Move one point of an object"),
+
+/* 68 */
+wxT("Add Point"),
+
+/* 69 */
+wxT("Add point to polyline/polygon/spline object"),
+
+/* 70 */
+wxT("Remove point"),
+
+/* 71 */
+wxT("Remove point from polyline/polygon/spline object"),
+
+/* 72 */
+wxT("Details"),
+
+/* 73 */
+wxT("Edit object details"),
+
+/* 74 */
+wxT("Group"),
+
+/* 75 */
+wxT("Group objects"),
+
+/* 76 */
+wxT("Ungroup"),
+
+/* 77 */
+wxT("Resolve group of objects"),
+
+/* 78 */
+wxT("Flip horizontally"),
+
+/* 79 */
+wxT("Flip object(s) horizontally"),
+
+/* 80 */
+wxT("Flip vertically"),
+
+/* 81 */
+wxT("Flip object(s) vertically"),
+
+/* 82 */
+wxT("Drawing size"),
+
+/* 83 */
+wxT("Change drawing size"),
+
+/* 84 */
+wxT("View"),
+
+/* 85 */
+wxT("Zoom"),
+
+/* 86 */
+wxT("In"),
+
+/* 87 */
+wxT("Zoom in"),
+
+/* 88 */
+wxT("Out"),
+
+/* 89 */
+wxT("Zoom out"),
+
+/* 90 */
+wxT("Reset"),
+
+/* 91 */
+wxT("Reset zoom to original size"),
+
+/* 92 */
+wxT("Layer"),
+
+/* 93 */
+wxT("Activate all"),
+
+/* 94 */
+wxT("Activate all layers"),
+
+/* 95 */
+wxT("Layer manager"),
+
+/* 96 */
+wxT("Show layer manager"),
+
+/* 97 */
+wxT("Center view"),
+
+/* 98 */
+wxT("Place center of drawing in center of control"),
+
+/* 99 */
+wxT("Open file"),
+
+/* 100 */
+wxT("Save file"),
+
+/* 101 */
+wxT("Copy object"),
+
+/* 102 */
+wxT("Move object"),
+
+/* 103 */
+wxT("Delete object"),
+
+/* 104 */
+wxT("Move point"),
+
+/* 105 */
+wxT("Object details"),
+
+/* 106 */
+wxT("Group objects, select one by one"),
+
+/* 107 */
+wxT("Resolve group"),
+
+/* 108 */
+wxT("Flip horizontally"),
+
+/* 109 */
+wxT("Flip vertically"),
+
+/* 110 */
+wxT("Add point"),
+
+/* 111 */
+wxT("Remove point"),
+
+/* 112 */
+wxT("Drawing size"),
+
+/* 113 */
+wxT("Zoom in"),
+
+/* 114 */
+wxT("Zoom out"),
+
+/* 115 */
+wxT("Reset zoom"),
+
+/* 116 */
+wxT("Show grid"),
+
+/* 117 */
+wxT("Grid unit: in or cm"),
+
+/* 118 */
+wxT("Snap grid intervals per optical grid interval"),
+
+/* 119 */
+wxT("Placement help"),
+
+/* 120 */
+wxT("Polyline"),
+
+/* 121 */
+wxT("Polygon"),
+
+/* 122 */
+wxT("Rectangular box"),
+
+/* 123 */
+wxT("Rounded box"),
+
+/* 124 */
+wxT("Circle"),
+
+/* 125 */
+wxT("Ellipse"),
+
+/* 126 */
+wxT("Open arc"),
+
+/* 127 */
+wxT("Closed arc"),
+
+/* 128 */
+wxT("Open approximated spline"),
+
+/* 129 */
+wxT("Closed approximated spline"),
+
+/* 130 */
+wxT("Open interpolated spline"),
+
+/* 131 */
+wxT("Closed interpolated spline"),
+
+/* 132 */
+wxT("Connection dot"),
+
+/* 133 */
+wxT("Pin dot"),
+
+/* 134 */
+wxT("Text label"),
+
+/* 135 */
+wxT("Library element"),
+
+/* 136 */
+wxT("Image"),
+
+/* 137 */
+wxT("Layer:"),
+
+/* 138 */
+wxT("Line:"),
+
+/* 139 */
+wxT("Fill:"),
+
+/* 140 */
+wxT("Text:"),
+
+/* 141 */
+wxT("Layer number"),
+
+/* 142 */
+wxT("Line and text colour"),
+
+/* 143 */
+wxT("Line width (multiples of the base line width)"),
+
+/* 144 */
+wxT("Line style"),
+
+/* 145 */
+wxT("Line cap style"),
+
+/* 146 */
+wxT("Line join style"),
+
+/* 147 */
+wxT("Arrowhead forward"),
+
+/* 148 */
+wxT("Arrowhead backward"),
+
+/* 149 */
+wxT("Fill colour"),
+
+/* 150 */
+wxT("Fill style"),
+
+/* 151 */
+wxT("LaTeX"),
+
+/* 152 */
+wxT("LaTeX special text"),
+
+/* 153 */
+wxT("Text alignment"),
+
+/* 154 */
+wxT("Font name"),
+
+/* 155 */
+wxT("Font size"),
+
+/* 156 */
+wxT("in"),
+
+/* 157 */
+wxT("cm"),
+
+/* 158 */
+wxT("4"),
+
+/* 159 */
+wxT("5"),
+
+/* 160 */
+wxT("Grid"),
+
+/* 161 */
+wxT("PH"),
+
+/* 162 */
+wxT("Select object"),
+
+/* 163 */
+wxT("to open interpolated spline"),
+
+/* 164 */
+wxT("Group objects, select by region"),
+
+/* 165 */
+wxT("Select one by one"),
+
+/* 166 */
+wxT("Convert object to open interpolated spline"),
+
+/* 167 */
+wxT("Select by region"),
+
+/* 168 */
+wxT("Save drawing?"),
+
+/* 169 */
+wxT("Drawing contains unsaved modifications.\nSave drawing to file?"),
+
+/* 170 */
+wxT("* "),
+
+/* 171 */
+wxT("Save drawing"),
+
+/* 172 */
+wxT("WXD files (*.wxd)|*.wxd"),
+
+/* 173 */
+wxT("Group"),
+
+/* 174 */
+wxT("Text"),
+
+/* 175 */
+wxT("Polyline"),
+
+/* 176 */
+wxT("Open spline"),
+
+/* 177 */
+wxT("Open arc"),
+
+/* 178 */
+wxT("Polygon"),
+
+/* 179 */
+wxT("Closed spline"),
+
+/* 180 */
+wxT("Closed arc"),
+
+/* 181 */
+wxT("Circle"),
+
+/* 182 */
+wxT("Ellipse"),
+
+/* 183 */
+wxT("Box"),
+
+/* 184 */
+wxT("Image"),
+
+/* 185 */
+wxT("Filled dot"),
+
+/* 186 */
+wxT("White dot"),
+
+/* 187 */
+wxT("Modify text"),
+
+/* 188 */
+wxT("Modify polyline"),
+
+/* 189 */
+wxT("Modify open spline"),
+
+/* 190 */
+wxT("Modify open arc"),
+
+/* 191 */
+wxT("Modify polygon"),
+
+/* 192 */
+wxT("Modify closed spline"),
+
+/* 193 */
+wxT("Modify closed arc"),
+
+/* 194 */
+wxT("Modify circle"),
+
+/* 195 */
+wxT("Modify ellipse"),
+
+/* 196 */
+wxT("Modify box"),
+
+/* 197 */
+wxT("Modify image"),
+
+/* 198 */
+wxT("Modify filled dot"),
+
+/* 199 */
+wxT("Modify white dot"),
+
+/* 200 */
+wxT("Unselect object"),
+
+/* 201 */
+wxT("Select object"),
+
+/* 202 */
+wxT("NOT SAVED!"),
+
+/* 203 */
+wxT("The file was not saved!\nFailed to open file for writing."),
+
+/* 204 */
+wxT("The file was not saved!\nError in write operation."),
+
+/* 205 */
+wxT("The file was not saved!\nString \""),
+
+/* 206 */
+wxT("\" too long."),
+
+/* 207 */
+wxT("The file was not saved!\nString was too long."),
+
+/* 208 */
+wxT("The file was not saved!\nFailed to recode string\""),
+
+/* 209 */
+wxT("\"!"),
+
+/* 210 */
+wxT("The file was not saved!\nFailed to recode string."),
+
+/* 211 */
+wxT("The file was not saved!\nFailed to recode file name\""),
+
+/* 212 */
+wxT("\"!"),
+
+/* 213 */
+wxT("The file was not saved!\nFailed to recode file name."),
+
+/* 214 */
+wxT("The file was not saved!\nAn object contains an empty string."),
+
+/* 215 */
+wxT("The file was not saved!"),
+
+/* 216 */
+wxT("Line style"),
+
+/* 217 */
+wxT("Solid"),
+
+/* 218 */
+wxT("Dashed line"),
+
+/* 219 */
+wxT("Dotted line"),
+
+/* 220 */
+wxT("Dash dot line"),
+
+/* 221 */
+wxT("Dash dot dot line"),
+
+/* 222 */
+wxT("Dash dot dot dot line"),
+
+/* 223 */
+wxT("Cancel"),
+
+/* 224 */
+wxT("Keep line style"),
+
+/* 225 */
+wxT("Style length"),
+
+/* 226 */
+wxT("Style length:"),
+
+/* 227 */
+wxT("Dash length in multiples of the line length"),
+
+/* 228 */
+wxT("OK"),
+
+/* 229 */
+wxT("Use style length as specified"),
+
+/* 230 */
+wxT("Cancel"),
+
+/* 231 */
+wxT("Discard input"),
+
+/* 232 */
+wxT("Line join"),
+
+/* 233 */
+wxT("Mitered"),
+
+/* 234 */
+wxT("Rounded"),
+
+/* 235 */
+wxT("Beveled"),
+
+/* 236 */
+wxT("Cancel"),
+
+/* 237 */
+wxT("Leave line join as is"),
+
+/* 238 */
+wxT("Miter limit"),
+
+/* 239 */
+wxT("Limit:"),
+
+/* 240 */
+wxT("Choose miter limit value"),
+
+/* 241 */
+wxT("OK"),
+
+/* 242 */
+wxT("Use choosen value"),
+
+/* 243 */
+wxT("Cancel"),
+
+/* 244 */
+wxT("Discard input"),
+
+/* 245 */
+wxT("Line cap"),
+
+/* 246 */
+wxT("Butted"),
+
+/* 247 */
+wxT("Rounded"),
+
+/* 248 */
+wxT("Projecting"),
+
+/* 249 */
+wxT("Cancel"),
+
+/* 250 */
+wxT("Leave line cap as is"),
+
+/* 251 */
+wxT("Arrow type"),
+
+/* 252 */
+wxT("Cancel"),
+
+/* 253 */
+wxT("Leave arrow type as is"),
+
+/* 254 */
+wxT("Arrow size"),
+
+/* 255 */
+wxT("Length:"),
+
+/* 256 */
+wxT("Width:"),
+
+/* 257 */
+wxT("Specify arrow length in multiples of the line width"),
+
+/* 258 */
+wxT("Specify arrow width in multiples of the line width"),
+
+/* 259 */
+wxT("OK"),
+
+/* 260 */
+wxT("Cancel"),
+
+/* 261 */
+wxT("Use settings from dialog"),
+
+/* 262 */
+wxT("Discard settings from dialog"),
+
+/* 263 */
+wxT("Fill style"),
+
+/* 264 */
+wxT("No fill"),
+
+/* 265 */
+wxT("Pure colour fill"),
+
+/* 266 */
+wxT("30 degree diagonal lines to the left"),
+
+/* 267 */
+wxT("30 degree diagonal lines to the right"),
+
+/* 268 */
+wxT("30 degree diagonal crosshatch"),
+
+/* 269 */
+wxT("45 degree diagonal lines to the left"),
+
+/* 270 */
+wxT("45 degree diagonal lines to the right"),
+
+/* 271 */
+wxT("45 degree diagonal crosshatch"),
+
+/* 272 */
+wxT("Horizontal bricks"),
+
+/* 273 */
+wxT("Vertical bricks"),
+
+/* 274 */
+wxT("Horizontal lines"),
+
+/* 275 */
+wxT("Vertical lines"),
+
+/* 276 */
+wxT("Horizontal/vertical crosshatch"),
+
+/* 277 */
+wxT("Horizontal shingles skewed to the right"),
+
+/* 278 */
+wxT("Horizontal shingles skewed to the left"),
+
+/* 279 */
+wxT("Vertical shingles skewed to one side"),
+
+/* 280 */
+wxT("Vertical shingles skewed to the other side"),
+
+/* 281 */
+wxT("Large fish scales"),
+
+/* 282 */
+wxT("Small fish scales"),
+
+/* 283 */
+wxT("Circles"),
+
+/* 284 */
+wxT("Hexagons"),
+
+/* 285 */
+wxT("Octagons"),
+
+/* 286 */
+wxT("Horizontal tire treads"),
+
+/* 287 */
+wxT("Vertical tire treads"),
+
+/* 288 */
+wxT("Cancel"),
+
+/* 289 */
+wxT("Leave fill style unchanged"),
+
+/* 290 */
+wxT("Text align"),
+
+/* 291 */
+wxT("Left"),
+
+/* 292 */
+wxT("Centered"),
+
+/* 293 */
+wxT("Right"),
+
+/* 294 */
+wxT("Cancel"),
+
+/* 295 */
+wxT("Leave text align unchanged"),
+
+/* 296 */
+wxT("Text font"),
+
+/* 297 */
+wxT("Cancel"),
+
+/* 298 */
+wxT("Leave text font as is"),
+
+/* 299 */
+wxT("Times Roman"),
+
+/* 300 */
+wxT("Times Italic"),
+
+/* 301 */
+wxT("Times Bold"),
+
+/* 302 */
+wxT("Times Bold Italic"),
+
+/* 303 */
+wxT("Avantgarde Book"),
+
+/* 304 */
+wxT("Avantgarde Book Oblique"),
+
+/* 305 */
+wxT("Avantgarde Book Demi"),
+
+/* 306 */
+wxT("Avantgarde Book Demi Oblique"),
+
+/* 307 */
+wxT("Bookman Light"),
+
+/* 308 */
+wxT("Bookman Light Italic"),
+
+/* 309 */
+wxT("Bookman Demi"),
+
+/* 310 */
+wxT("Bookman Demi Italic"),
+
+/* 311 */
+wxT("Courier"),
+
+/* 312 */
+wxT("Courier Oblique"),
+
+/* 313 */
+wxT("Courier Bold"),
+
+/* 314 */
+wxT("Courier Bold Oblique"),
+
+/* 315 */
+wxT("Helvetica"),
+
+/* 316 */
+wxT("Helvetica Oblique"),
+
+/* 317 */
+wxT("Helvetica Bold"),
+
+/* 318 */
+wxT("Helvetica Bold Oblique"),
+
+/* 319 */
+wxT("Helvetica Narrow"),
+
+/* 320 */
+wxT("Helvetica Narrow Oblique"),
+
+/* 321 */
+wxT("Helvetica Narrow Bold"),
+
+/* 322 */
+wxT("Helvetica Narrow Bold Oblique"),
+
+/* 323 */
+wxT("New Century Schoolbook Roman"),
+
+/* 324 */
+wxT("New Century Schoolbook Italic"),
+
+/* 325 */
+wxT("New Century Schoolbook Bold"),
+
+/* 326 */
+wxT("New Century Schoolbook Bold Italic"),
+
+/* 327 */
+wxT("Palatino Roman"),
+
+/* 328 */
+wxT("Palatino Italic"),
+
+/* 329 */
+wxT("Palatino Bold"),
+
+/* 330 */
+wxT("Palatino Bild Italic"),
+
+/* 331 */
+wxT("Symbol"),
+
+/* 332 */
+wxT("Zapf Chancery"),
+
+/* 333 */
+wxT("Zapf Dingbats"),
+
+/* 334 */
+wxT("Layers"),
+
+/* 335 */
+wxT("OK"),
+
+/* 336 */
+wxT("Cancel"),
+
+/* 337 */
+wxT("Use settings from dialog"),
+
+/* 338 */
+wxT("Discard settings from dialog"),
+
+/* 339 */
+wxT("Open drawing"),
+
+/* 340 */
+wxT("Delete object"),
+
+/* 341 */
+wxT("Cancel deletion"),
+
+/* 342 */
+wxT("Move object"),
+
+/* 343 */
+wxT("Place object"),
+
+/* 344 */
+wxT("Cancel move"),
+
+/* 345 */
+wxT("Error: Memory"),
+
+/* 346 */
+wxT("A memory allocation failed!\nInsufficient memory (RAM/swap space)!"),
+
+/* 347 */
+wxT("Error: Invalid placement"),
+
+/* 348 */
+wxT("The selected placement would result in numeric overflow for coordinates!"),
+
+/* 349 */
+wxT("Error"),
+
+/* 350 */
+wxT("An error occured.\nUnfortunately no detail information is available!"),
+
+/* 351 */
+wxT("Font family:"),
+
+/* 352 */
+wxT("Times"),
+
+/* 353 */
+wxT("AvantGarde"),
+
+/* 354 */
+wxT("Bookman"),
+
+/* 355 */
+wxT("Courier"),
+
+/* 356 */
+wxT("Helvetica"),
+
+/* 357 */
+wxT("HelveticaNarrow"),
+
+/* 358 */
+wxT("NewCenturySchlbk"),
+
+/* 359 */
+wxT("Palatino"),
+
+/* 360 */
+wxT("Symbol"),
+
+/* 361 */
+wxT("ZapfChancery"),
+
+/* 362 */
+wxT("ZapfDingbats"),
+
+/* 363 */
+wxT("bold / demi"),
+
+/* 364 */
+wxT("italic / oblique"),
+
+/* 365 */
+wxT("OK"),
+
+/* 366 */
+wxT("Use font configured in dialog"),
+
+/* 367 */
+wxT("Choose font family"),
+
+/* 368 */
+wxT("No layers are in use at this time."),
+
+/* 369 */
+wxT("No layers in use"),
+
+/* 370 */
+wxT("Copy object"),
+
+/* 371 */
+wxT("Place object"),
+
+/* 372 */
+wxT("Cancel copy"),
+
+/* 373 */
+wxT("First point"),
+
+/* 374 */
+wxT("Add point"),
+
+/* 375 */
+wxT("Cancel"),
+
+/* 376 */
+wxT("Finish"),
+
+/* 377 */
+wxT("First point"),
+
+/* 378 */
+wxT("Opposite point"),
+
+/* 379 */
+wxT("Cancel"),
+
+/* 380 */
+wxT("Center point"),
+
+/* 381 */
+wxT("Circle point"),
+
+/* 382 */
+wxT("Cancel"),
+
+/* 383 */
+wxT("Finish"),
+
+/* 384 */
+wxT("BB corner point"),
+
+/* 385 */
+wxT("Open arc"),
+
+/* 386 */
+wxT("Add open arc"),
+
+/* 387 */
+wxT("Closed arc"),
+
+/* 388 */
+wxT("Add closed arc"),
+
+/* 389 */
+wxT("Start point"),
+
+/* 390 */
+wxT("Intermediate point"),
+
+/* 391 */
+wxT("End point"),
+
+/* 392 */
+wxT("Cancel"),
+
+/* 393 */
+wxT("Finished"),
+
+/* 394 */
+wxT("Place dot"),
+
+/* 395 */
+wxT("Finished"),
+
+/* 396 */
+wxT("Export text:"),
+
+/* 397 */
+wxT("Screen text:"),
+
+/* 398 */
+wxT("Enter text to export"),
+
+/* 399 */
+wxT("Enter text to show on screen"),
+
+/* 400 */
+wxT("Text input"),
+
+/* 401 */
+wxT("Create/modify text object"),
+
+/* 402 */
+wxT("Skip text object creation/modification"),
+
+/* 403 */
+wxT("Place text label"),
+
+/* 404 */
+wxT("Finish"),
+
+/* 405 */
+wxT("Image corner"),
+
+/* 406 */
+wxT("Opposite corner"),
+
+/* 407 */
+wxT("Skip adding image"),
+
+/* 408 */
+wxT("Finished"),
+
+/* 409 */
+wxT("Choose image"),
+
+/* 410 */
+wxT("Choose library element"),
+
+/* 411 */
+wxT("Place element"),
+
+/* 412 */
+wxT("Skip adding element"),
+
+/* 413 */
+wxT("Point move mode"),
+
+/* 414 */
+wxT("snap"),
+
+/* 415 */
+wxT("rel"),
+
+/* 416 */
+wxT("Rot:"),
+
+/* 417 */
+wxT("Text or ellipse rotation in degree"),
+
+/* 418 */
+wxT("Select point"),
+
+/* 419 */
+wxT("Place point"),
+
+/* 420 */
+wxT("Skip point move"),
+
+/* 421 */
+wxT("Move object point"),
+
+/* 422 */
+wxT("Spline s value"),
+
+/* 423 */
+wxT("s: "),
+
+/* 424 */
+wxT("OK"),
+
+/* 425 */
+wxT("Modify s value"),
+
+/* 426 */
+wxT("Cancel"),
+
+/* 427 */
+wxT("Close dialog, discard input"),
+
+/* 428 */
+wxT("Choose s value"),
+
+/* 429 */
+wxT("Spline s value"),
+
+/* 430 */
+wxT("0"),
+
+/* 431 */
+wxT("Delete point"),
+
+/* 432 */
+wxT("Skip point deletion"),
+
+/* 433 */
+wxT("Delete spline, polyline or polygon point"),
+
+/* 434 */
+wxT("Add point to polyline, polygon or spline"),
+
+/* 435 */
+wxT("Add point"),
+
+/* 436 */
+wxT("Place point"),
+
+/* 437 */
+wxT("Finish point adding"),
+
+/* 438 */
+wxT("Skip point"),
+
+/* 439 */
+wxT("Select corner"),
+
+/* 440 */
+wxT("Finish size change"),
+
+/* 441 */
+wxT("Change drawing size"),
+
+/* 442 */
+wxT("Place corner"),
+
+/* 443 */
+wxT("Skip size change"),
+
+/* 444 */
+wxT("Flip object(s)"),
+
+/* 445 */
+wxT("Flip object"),
+
+/* 446 */
+wxT("Finish flipping"),
+
+/* 447 */
+wxT("Select object"),
+
+/* 448 */
+wxT("Unselect object"),
+
+/* 449 */
+wxT("Finish group"),
+
+/* 450 */
+wxT("Skip grouping"),
+
+/* 451 */
+wxT("Finish grouping"),
+
+/* 452 */
+wxT("Group objects one by one"),
+
+/* 453 */
+wxT("Ungroup objects"),
+
+/* 454 */
+wxT("Ungroup"),
+
+/* 455 */
+wxT("Finish ungrouping"),
+
+/* 456 */
+wxT("Corner point"),
+
+/* 457 */
+wxT("Group objects by region"),
+
+/* 458 */
+wxT("Modify object details"),
+
+/* 459 */
+wxT("Modify object"),
+
+/* 460 */
+wxT("Finish details"),
+
+/* 461 */
+wxT("Image options"),
+
+/* 462 */
+wxT("RGB to gray:"),
+
+/* 463 */
+wxT("Choose RGB to gray conversion method"),
+
+/* 464 */
+wxT("Keep aspect ratio"),
+
+/* 465 */
+wxT("Keep image aspect ratio, eventually leaving space unused"),
+
+/* 466 */
+wxT("Use alpha channel"),
+
+/* 467 */
+wxT("Use opacity data from alpha channel to mix foreground and background"),
+
+/* 468 */
+wxT("Image interpolation"),
+
+/* 469 */
+wxT("Allow image interpolation"),
+
+/* 470 */
+wxT("DCT data"),
+
+/* 471 */
+wxT("Allow direct re-use of DCT encoded data from JPEG files"),
+
+/* 472 */
+wxT("Image interpolation for DCT data"),
+
+/* 473 */
+wxT("Allow image interpolation also for directly re-used DCT encoded data"),
+
+/* 474 */
+wxT("Enforce background"),
+
+/* 475 */
+wxT("Enforce use of background specified in WXD file"),
+
+/* 476 */
+wxT("OK"),
+
+/* 477 */
+wxT("Cancel"),
+
+/* 478 */
+wxT("Use options configured in this dialog"),
+
+/* 479 */
+wxT("Discard settings from dialog"),
+
+/* 480 */
+wxT("Default method"),
+
+/* 481 */
+wxT("Luminance (default coefficients)"),
+
+/* 482 */
+wxT("Luminance (shorter coefficients)"),
+
+/* 483 */
+wxT("Fast"),
+
+/* 484 */
+wxT("Faster"),
+
+/* 485 */
+wxT("Luminance (alternative coefficients)"),
+
+/* 486 */
+wxT("Average"),
+
+/* 487 */
+wxT("Desaturation"),
+
+/* 488 */
+wxT("Minimum decomposition"),
+
+/* 489 */
+wxT("Medium decomposition"),
+
+/* 490 */
+wxT("Maximum decomposition"),
+
+/* 491 */
+wxT("Red"),
+
+/* 492 */
+wxT("Green"),
+
+/* 493 */
+wxT("Blue"),
+
+/* 494 */
+wxT("Dot options"),
+
+/* 495 */
+wxT("Diameter:"),
+
+/* 496 */
+wxT("Diameter in multiples of the base line width"),
+
+/* 497 */
+wxT("Line width:"),
+
+/* 498 */
+wxT("Line width in mulitples of the base line width"),
+
+/* 499 */
+wxT("Box options"),
+
+/* 500 */
+wxT("in"),
+
+/* 501 */
+wxT("cm"),
+
+/* 502 */
+wxT("Radius:"),
+
+/* 503 */
+wxT("Numeric overflow"),
+
+/* 504 */
+wxT("Numeric overflow in radius calculation!"),
+
+/* 505 */
+wxT("Read file failed"),
+
+/* 506 */
+wxT("Failed to read file:"),
+
+/* 507 */
+wxT("Open file failed"),
+
+/* 508 */
+wxT("Failed to open file!"),
+
+/* 509 */
+wxT("Mouse outside"),
+
+/* 510 */
+wxT("Mouse position outside usable coordinates range!"),
+
+/* 511 */
+wxT("Text missing"),
+
+/* 512 */
+wxT("Empty export text is not allowed!"),
+
+/* 513 */
+wxT("File name missing"),
+
+/* 514 */
+wxT("An empty file name string was returned by selection dialog!"),
+
+/* 515 */
+wxT("No coordinates"),
+
+/* 516 */
+wxT("Failed to obtain coordinates from object!"),
+
+/* 517 */
+wxT("No coordinates"),
+
+/* 518 */
+wxT("Failed to set coordinates on object!"),
+
+/* 519 */
+wxT("Numeric overflow"),
+
+/* 520 */
+wxT("Numeric overflow in coordinates calculation!"),
+
+/* 521 */
+wxT("Grouping failed"),
+
+/* 522 */
+wxT("Failed to move an object into a group!"),
+
+/* 523 */
+wxT("Ungrouping failed"),
+
+/* 524 */
+wxT("Failed to remove an object from group!"),
+
+/* 525 */
+wxT("Radius calculation failed"),
+
+/* 526 */
+wxT("Box is too small to calculate a corner radius!"),
+
+/* 527 */
+wxT("BUG"),
+
+/* 528 */
+wxT("New point out of index range!"),
+
+/* 529 */
+wxT("Too many points"),
+
+/* 530 */
+wxT("Only 65535 point allowed for spline, polygon, or polyline!"),
+
+/* 531 */
+wxT("Ready"),
+
+/* 532 */
+wxT("Delete region"),
+
+/* 533 */
+wxT("Cancel region"),
+
+/* 534 */
+wxT("Select region"),
+
+/* 535 */
+wxT("Convert"),
+
+/* 536 */
+wxT("to polygon"),
+
+/* 537 */
+wxT("to polyline"),
+
+/* 538 */
+wxT("to closed interpolated spline"),
+
+/* 539 */
+wxT("to closed arc"),
+
+/* 540 */
+wxT("to open arc"),
+
+/* 541 */
+wxT("to closed approximated spline"),
+
+/* 542 */
+wxT("to open approximated spline"),
+
+/* 543 */
+wxT("to white filled dot"),
+
+/* 544 */
+wxT("to simple dot"),
+
+/* 545 */
+wxT("Convert object to polygon"),
+
+/* 546 */
+wxT("Convert object to polyline"),
+
+/* 547 */
+wxT("Convert object to closed interpolated spline"),
+
+/* 548 */
+wxT("Convert object to closed arc"),
+
+/* 549 */
+wxT("Convert object to open arc"),
+
+/* 550 */
+wxT("Convert object to closed approximated spline"),
+
+/* 551 */
+wxT("Convert object to open approximated spline"),
+
+/* 552 */
+wxT("Convert object to white filled dot"),
+
+/* 553 */
+wxT("Convert object to simple dot"),
+
+/* 554 */
+wxT("Convert object"),
+
+/* 555 */
+wxT("Skip conversion"),
+
+/* 556 */
+wxT("Conversion failed"),
+
+/* 557 */
+wxT("Object is unsuitable for conversion!"),
+
+/* 558 */
+wxT("Directory too long"),
+
+/* 559 */
+wxT("Output file directory too long!"),
+
+/* 560 */
+wxT("Current directory"),
+
+/* 561 */
+wxT("Failed to find current working directory!"),
+
+/* 562 */
+wxT("File name too long"),
+
+/* 563 */
+wxT("Output file name is too long!"),
+
+/* 564 */
+wxT("Output directory"),
+
+/* 565 */
+wxT("Failed to find output directory name!"),
+
+/* 566 */
+wxT("Rotate left"),
+
+/* 567 */
+wxT("Rotate object 90 degree to the left"),
+
+/* 568 */
+wxT("Rotate right"),
+
+/* 569 */
+wxT("Rotate object 90 degree to the right"),
+
+/* 570 */
+wxT("Rotate left"),
+
+/* 571 */
+wxT("Rotate right"),
+
+/* 572 */
+wxT("Rotate object"),
+
+/* 573 */
+wxT("Finish rotating"),
+
+/* 574 */
+wxT("Box details"),
+
+/* 575 */
+wxT("\nNo detailed information available."),
+
+/* 576 */
+wxT("\nNot enough memory available!"),
+
+/* 577 */
+wxT("\nExpected number of text parts not found!"),
+
+/* 578 */
+wxT("\nConversion of text part to number failed!"),
+
+/* 579 */
+wxT("\nText label recoding failed!"),
+
+/* 580 */
+wxT("\nFile name recoding failed!"),
+
+/* 581 */
+wxT("\nInvalid arguments passed to reader function (bug)!"),
+
+/* 582 */
+wxT("\nFile format version information missing!"),
+
+/* 583 */
+wxT("\nBounding box information missing!"),
+
+/* 584 */
+wxT("\nNot a wxdkdraw file!"),
+
+/* 585 */
+wxT("\nFile format version too new, can not handle it!"),
+
+/* 586 */
+wxT("\nObject start line expected!"),
+
+/* 587 */
+wxT("\nObject details line expected!"),
+
+/* 588 */
+wxT("\nReader in unsupported state (bug)!"),
+
+/* 589 */
+wxT("\nUnsupported object type or subtype!"),
+
+/* 590 */
+wxT("\nNumeric overflow in coordinates conversion or calculation!"),
+
+/* 591 */
+wxT("\nNo open group to close here!"),
+
+/* 592 */
+wxT("\nToo few points specified!"),
+
+/* 593 */
+wxT("\nEmpty image file name!"),
+
+/* 594 */
+wxT("\nImage file name too long!"),
+
+/* 595 */
+wxT("\nBox does not span an area!"),
+
+/* 596 */
+wxT("\nLine "),
+
+/* 597 */
+wxT(", text part "),
+
+/* 598 */
+wxT("."),
+
+/* 599 */
+wxT("Drawing modified"),
+
+/* 600 */
+wxT("Corrections were applied to the drawing."),
+
+/* 601 */
+wxT("Options"),
+
+/* 602 */
+wxT("Reset all options"),
+
+/* 603 */
+wxT("Reset all options to default values"),
+
+/* 604 */
+wxT("Are you sure?"),
+
+/* 605 */
+wxT("Do you really want to reset all options to default values?"),
+
+/* 606 */
+wxT("Colours"),
+
+/* 607 */
+wxT("Reset"),
+
+/* 608 */
+wxT("Reset colour to default"),
+
+/* 609 */
+wxT("Modify"),
+
+/* 610 */
+wxT("Modify colour"),
+
+/* 611 */
+wxT("Border"),
+
+/* 612 */
+wxT("Background"),
+
+/* 613 */
+wxT("Grid"),
+
+/* 614 */
+wxT("Placement help"),
+
+/* 615 */
+wxT("Highlight Copy"),
+
+/* 616 */
+wxT("Highlight Move"),
+
+/* 617 */
+wxT("Highlight Delete"),
+
+/* 618 */
+wxT("Highlight Group"),
+
+/* 619 */
+wxT("Missing image"),
+
+/* 620 */
+wxT("Modify s"),
+
+/* 621 */
+wxT("Modify spline point s value"),
+
+/* 622 */
+wxT("Modify s"),
+
+/* 623 */
+wxT("Finish modifications"),
+
+/* 624 */
+wxT("Modify spline point s value"),
+
+/* 625 */
+wxT("New objects"),
+
+/* 626 */
+wxT("Set defaults for new objects"),
+
+/* 627 */
+wxT("New objects defaults"),
+
+/* 628 */
+wxT("Filled dots"),
+
+/* 629 */
+wxT("White filled dots"),
+
+/* 630 */
+wxT("Screen representation"),
+
+/* 631 */
+wxT("Modify screen representation options"),
+
+/* 632 */
+wxT("Splines"),
+
+/* 633 */
+wxT("Bezier segments per X-spline sub-segment"),
+
+/* 634 */
+wxT("Specify number of Bezier segments to use for each X-spline sub-segment"),
+
+/* 635 */
+wxT("Screen representation options"),
+
+/* 636 */
+wxT("Texts"),
+
+/* 637 */
+wxT("Exact fonts"),
+
+/* 638 */
+wxT("Attempt to use exact fonts for non-LaTeX text"),
+
+/* 639 */
+wxT("Point add / delete / move / modify operations"),
+
+/* 640 */
+wxT("Reduce markup size"),
+
+/* 641 */
+wxT("Reduce point markup for point related operations"),
+
+/* 642 */
+wxT("Export text (required):"),
+
+/* 643 */
+wxT("Open arc"),
+
+/* 644 */
+wxT("Add open arc"),
+
+/* 645 */
+wxT("Closed arc"),
+
+/* 646 */
+wxT("Add closed arc"),
+
+NULL
+
+
+#line 1281 "WxdkdrawApp.cpt"
+};
+
+
+
+/** Non-localized wxChar texts.
+*/
+static wxChar const * wxdkdraw_nl_wx[] = {
+/* 0 */
+wxT("wxdkdraw"),
+
+/* 1 */
+wxT("1.0.0"),
+
+/* 2 */
+wxT("Dirk Krause"),
+
+/* 3 */
+wxT("DKrause"),
+
+/* 4 */
+wxT("aaaaa"),
+
+/* 5 */
+wxT(""),
+
+/* 6 */
+wxT(""),
+
+/* 7 */
+wxT(" "),
+
+/* 8 */
+wxT("\n"),
+
+/* 9 */
+wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."),
+
+/* 10 */
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
+
+/* 11 */
+wxT("http://www.wxwidgets.org"),
+
+/* 12 */
+wxT("http://www.libpng.org/pub/png/libpng.html"),
+
+/* 13 */
+wxT("http://www.ijg.org"),
+
+/* 14 */
+wxT("http://www.remotesensing.org/libtiff"),
+
+/* 15 */
+wxT("http://www.zlib.net"),
+
+/* 16 */
+wxT("Error"),
+
+/* 17 */
+wxT("Not enough memory (RAM)!"),
+
+/* 18 */
+wxT("0.0078125"),
+
+/* 19 */
+wxT(""),
+
+/* 20 */
+wxT(" "),
+
+NULL
+
+
+#line 1356 "WxdkdrawApp.cpt"
+};
+
+
+
+/** Non-localized dkChar texts.
+*/
+static dkChar const * wxdkdraw_nl_dk[] = {
+/* 0 */
+dkT("dktools"),
+
+/* 1 */
+dkT("wxdkdraw.str"),
+
+/* 2 */
+dkT("wxdkdraw.chm"),
+
+/* 3 */
+dkT("wxdkdraw.htb"),
+
+NULL
+
+
+#line 1381 "WxdkdrawApp.cpt"
+};
+
+
+
+/** Implementation of the wxApp functionality.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(WxdkdrawApp);
+#else
+IMPLEMENT_APP(WxdkdrawApp)
+#endif
+
+
+bool
+WxdkdrawApp::OnInit()
+{
+ WxdkdrawFrame *frame = NULL;
+ wxChar const * const *localizedTexts = NULL;
+ wxPNGHandler *phPng = NULL;
+ wxXPMHandler *phXpm = NULL;
+ wxICOHandler *phIco = NULL;
+ wxArchiveFSHandler *phArchiveFS = NULL;
+ bool back = false;
+
+
+
+#line 1407 "WxdkdrawApp.cpt"
+
+ /* Initialize members.
+ */
+ pAh = NULL;
+#if 1
+ pHc = NULL;
+#endif
+ /* __CHANGE__ 009: Initialize further members here.
+ */
+
+ /* Set up helper object.
+ */
+ pAh = new Dk4WxApplicationHelper();
+ if (NULL == pAh) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pAh->Initialize(argv[0], wxdkdraw_nl_wx[3], wxdkdraw_nl_dk[0]))) {
+ goto finished;
+ }
+
+ /* Add image and file system handlers for online help.
+ */
+ phPng = new wxPNGHandler();
+ if (NULL != phPng) {
+ wxImage::AddHandler(phPng);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phXpm = new wxXPMHandler();
+ if (NULL != phXpm) {
+ wxImage::AddHandler(phXpm);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phIco = new wxICOHandler();
+ if (NULL != phIco) {
+ wxImage::AddHandler(phIco);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is not released.
+ This is a false positive as phArchiveFs is passed to
+ wxFileSystem and managed by the wxWidgets library.
+ */
+ phArchiveFS = new wxArchiveFSHandler();
+ if (NULL != phArchiveFS) {
+ wxFileSystem::AddHandler(phArchiveFS);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Set up help controller.
+ */
+#if 1
+ pHc = new Dk4WxHelpController();
+ if (NULL == pHc) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pHc->Initialize(pAh, wxdkdraw_nl_dk[2], wxdkdraw_nl_dk[3]))) {
+ goto finished;
+ }
+#endif
+
+ /* Attempt to obtain localized texts in users preferred language.
+ */
+ localizedTexts = pAh->GetStringTable(wxdkdraw_nl_dk[1], wxdkdraw_texts);
+ if(!(localizedTexts)) {
+ localizedTexts = wxdkdraw_texts;
+ }
+
+ /* Create and show frame.
+ */
+ frame = new WxdkdrawFrame(
+ WxdkdrawFrame::ID_FRAME,
+ pAh,
+#if 1
+ pHc,
+#else
+ NULL,
+#endif
+ argc,
+ argv,
+ localizedTexts,
+ wxdkdraw_nl_wx,
+ wxdkdraw_nl_dk
+ );
+ if(!(frame)) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Show frame, restore position and indicate success.
+ */
+ frame->RestorePosition();
+ frame->Connect(
+ wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(WxdkdrawFrame::OnIdle)
+ );
+ frame->Show();
+ back = true;
+
+ /* Release resources if initialization failed.
+ */
+ finished:
+ if(!(back)) {
+#if 1
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+#endif
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+ }
+
+
+#line 1535 "WxdkdrawApp.cpt"
+ return back;
+}
+
+
+
+int
+WxdkdrawApp::OnExit()
+{
+ int back = 0;
+
+
+
+#line 1546 "WxdkdrawApp.cpt"
+
+ /* __CHANGE__ 009: Release resources allocated by further members.
+ */
+
+ /* Release resources.
+ */
+#if 1
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+#endif
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+
+ /* __CHANGE__ 010: Set exit status code.
+ */
+
+
+#line 1564 "WxdkdrawApp.cpt"
+ return back;
+}
+
+
+
+void
+WxdkdrawApp::ShowMemoryErrorMessage(void)
+{
+ const wxChar *s_title = NULL;
+ const wxChar *s_text = NULL;
+
+ if (NULL != pAh) {
+ s_title = pAh->GetBasicString(6);
+ s_text = pAh->GetBasicString(7);
+ }
+ if (NULL == s_title) {
+ s_title = wxdkdraw_nl_wx[16];
+ }
+ if (NULL == s_text) {
+ s_text = wxdkdraw_nl_wx[17];
+ }
+ wxMessageBox(s_text, s_title, (wxOK | wxCENTRE | wxICON_ERROR));
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawApp.cpt b/support/dktools/WxdkdrawApp.cpt
new file mode 100644
index 0000000000..281d0a0ae6
--- /dev/null
+++ b/support/dktools/WxdkdrawApp.cpt
@@ -0,0 +1,1591 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file WxdkdrawApp.h The WxdkdrawApp class.
+*/
+
+
+
+/** Application class, derived from wxApp, one instance per program.
+*/
+class WxdkdrawApp : public wxApp
+{
+ protected:
+
+ /** Helper object.
+ */
+ Dk4WxApplicationHelper *pAh;
+
+ /** Controller fr online help.
+ */
+#if 1
+ Dk4WxHelpController *pHc;
+#endif
+
+ /* __CHANGE__ 009: Add further members here.
+ */
+
+ protected:
+
+ /** Show error message if there is not enough memory available.
+ */
+ void
+ ShowMemoryErrorMessage(void);
+
+ public:
+
+ /** Application initialization.
+ @return true on success, false on error.
+ */
+ virtual
+ bool
+ OnInit();
+
+ /** Application shutdown.
+ @return 0 on success, any other value indicates an error.
+ */
+ virtual
+ int
+ OnExit();
+};
+
+
+
+/** Declaration as the wxApp object.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(WxdkdrawApp);
+#else
+DECLARE_APP(WxdkdrawApp)
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+$!trace-include
+
+
+
+/** Localized wxChar texts.
+*/
+static wxChar const * wxdkdraw_texts[] = {
+$!string-table macro=wxT
+#
+# 0: Menu "File"
+#
+File
+#
+# 1: Menu item "File/Quit"
+#
+Quit
+#
+# 2: Tool tip text for menu item "File/Exit"
+#
+Exit the application
+#
+# 3: Menu "Help"
+#
+Help
+#
+# 4: Menu item "Help/About"
+#
+About
+#
+# 5: Tooltip text for menu item "Help/About"
+#
+Show version information
+#
+# 6: Menu item "Help/Contents"
+#
+Contents
+#
+# 7: Tooltip text for menu item "Help/Contents"
+#
+Open table of contents
+#
+# 8: Initial status text
+#
+Initializing...
+#
+# 9: Copyright notice.
+#
+Copyright (c)
+#
+# 10: Dialog box title "About ..."
+#
+About
+#
+# 11: This program uses the following libraries
+#
+This program uses the following libraries:
+#
+# 12: See
+#
+See:
+#
+# 13-17 Texts for mouse key messages and cursor position
+#
+L:
+ M:
+ R:
+ X:
+ Y:
+#
+# 18 Title text
+#
+wxdkdraw - Draw for LaTeX
+#
+# 19 Used in about dialog box (trailing space)
+#
+part of DK tools and libraries, version
+#
+# 20-21 Menu item text and tip for File / New
+#
+New
+Create new empty drawing
+#
+# 22-23 Menu item text and tip for File / Open
+#
+Open
+Open a file
+#
+# 24-25 Menu item text and tip for File / Save
+#
+Save
+Save drawing to file
+#
+# 26-27 Menu item text and tip for File / Save as
+#
+Save as...
+Save drawing to new file name
+#
+# 28 Menu name Add
+#
+Add
+#
+# 29-30 Menu item text and tip Add / Polyline
+#
+Polyline
+Add polyline
+#
+# 31-32 Menu item text and tip Add / Polygon
+#
+Polygon
+Add polygon
+#
+# 33-34 Menu item text and tip Add / Rectangle
+#
+Rectangle
+Add rectangular box
+#
+# 35-36 Menu item text and tip Add / Box
+#
+Box
+Add box with rounded corners
+#
+# 37-38 Menu item text and tip Add / Circle
+#
+Circle
+Add circle
+#
+# 39-40 Menu item text and tip Add / Ellipse
+#
+Ellipse
+Add ellipse
+#
+# 41-42 Menu item text and tip Add / Open approximated spline
+#
+Open approximated spline
+Add open approximated spline
+#
+# 43-44 Menu item text and tip Add / Closed approximated spline
+#
+Closed approximated spline
+Add closed approximated spline
+#
+# 45-46 Menu item text and tip Add / Open interpolated spline
+#
+Open interpolated spline
+Add open interpolated spline
+#
+# 47-48 Menu item text and tip Add / Closed interpolated spline
+#
+Closed interpolated spline
+Add closed interpolated spline
+#
+# 49-50 Menu item text and tip Add / Connector dot
+#
+Connector dot
+Add dot indicating a connection
+#
+# 51-52 Menu item text and tip Add / Pin dot
+#
+Pin dot
+Add dot indicating a pin
+#
+# 53-54 Menu item text and tip Add / Text label
+#
+Text label
+Add text label
+#
+# 55-56 Menu item text and tip Add / Image
+#
+Image
+Add bitmap image (PNG/JPEG/TIFF/NetPBM)
+#
+# 57-58 Menu item text and tip Add / Library element
+#
+Library element
+Add library element from file
+#
+# 59 Menu name Edit
+#
+Edit
+#
+# 60-61 Menu item text and tip Edit / Copy object
+#
+Copy object
+Copy object
+#
+# 62-63 Menu item text and tip Edit / Move object
+#
+Move object
+Move object
+#
+# 64-65 Menu item text and tip Edit / Delete object
+#
+Delete object
+Delete object
+#
+# 66-67 Menu item text and tip Edit / Move point
+#
+Move point
+Move one point of an object
+#
+# 68-69 Menu item text and tip Edit / Add point
+#
+Add Point
+Add point to polyline/polygon/spline object
+#
+# 70-71 Menu item text and tip Edit / Remove point
+#
+Remove point
+Remove point from polyline/polygon/spline object
+#
+# 72-73 Menu item text and tip Edit / Details
+#
+Details
+Edit object details
+#
+# 74-75 Menu item text and tip Edit / Group
+#
+Group
+Group objects
+#
+# 76-77 Menu item text and tip Edit / Ungroup
+#
+Ungroup
+Resolve group of objects
+#
+# 78-79 Menu item text and tip Edit / Flip horizontally
+#
+Flip horizontally
+Flip object(s) horizontally
+#
+# 80-81 Menu item text and tip Edit / Flip vertically
+#
+Flip vertically
+Flip object(s) vertically
+#
+# 82-83 Menu item text and tip Edit / Drawing size
+#
+Drawing size
+Change drawing size
+#
+# 84 Menu name View
+#
+View
+#
+# 85 Menu name Zoom
+#
+Zoom
+#
+# 86-87 Menu item text and tip View / Zoom / In
+#
+In
+Zoom in
+#
+# 88-89 Menu item text and tip View / Zoom / Out
+#
+Out
+Zoom out
+#
+# 90-91 Menu item text and tip View / Zoom / Reset
+#
+Reset
+Reset zoom to original size
+#
+# 92 Menu name Layer
+#
+Layer
+#
+# 93-94 Menu item text and tip View / Layer / Activate all
+#
+Activate all
+Activate all layers
+#
+# 95-96 Menu item text and tip View / Layer / Layer manager
+#
+Layer manager
+Show layer manager
+#
+# 97-98 Menu item text and tip View / Center view
+#
+Center view
+Place center of drawing in center of control
+#
+# 99-119 Button tip texts
+#
+Open file
+Save file
+Copy object
+Move object
+Delete object
+Move point
+Object details
+Group objects, select one by one
+Resolve group
+Flip horizontally
+Flip vertically
+Add point
+Remove point
+Drawing size
+Zoom in
+Zoom out
+Reset zoom
+Show grid
+Grid unit: in or cm
+Snap grid intervals per optical grid interval
+Placement help
+#
+# 120-136
+#
+Polyline
+Polygon
+Rectangular box
+Rounded box
+Circle
+Ellipse
+Open arc
+Closed arc
+Open approximated spline
+Closed approximated spline
+Open interpolated spline
+Closed interpolated spline
+Connection dot
+Pin dot
+Text label
+Library element
+Image
+#
+# 137-140 Markers above controls
+#
+Layer:
+Line:
+Fill:
+Text:
+#
+# 141-155 Tips for controls in bottom bar
+#
+Layer number
+Line and text colour
+Line width (multiples of the base line width)
+Line style
+Line cap style
+Line join style
+Arrowhead forward
+Arrowhead backward
+Fill colour
+Fill style
+LaTeX
+LaTeX special text
+Text alignment
+Font name
+Font size
+#
+# 156-157 Units for grid
+#
+in
+cm
+#
+# 158-159 Grid base
+#
+4
+5
+#
+# 160 Checkbox label Grid
+#
+Grid
+#
+# 161 Checkbox label PH
+#
+PH
+#
+# 162 Tool tip for button Select object
+#
+Select object
+#
+# 163-167 Tool tip for further buttons for grouping
+#
+to open interpolated spline
+Group objects, select by region
+Select one by one
+Convert object to open interpolated spline
+Select by region
+#
+# 168-169 Title and text to save drawing
+#
+Save drawing?
+Drawing contains unsaved modifications.\nSave drawing to file?
+#
+# 170 Marker for modified drawing
+#
+*
+#
+# 171 Dialog title
+#
+Save drawing
+#
+# 172 File types
+#
+WXD files (*.wxd)|*.wxd
+#
+# 173 Dialog title
+#
+Group
+#
+# 174-186 Status texts for selection candidates
+#
+Text
+Polyline
+Open spline
+Open arc
+Polygon
+Closed spline
+Closed arc
+Circle
+Ellipse
+Box
+Image
+Filled dot
+White dot
+#
+# 187-199 Status text while modifying objects
+#
+Modify text
+Modify polyline
+Modify open spline
+Modify open arc
+Modify polygon
+Modify closed spline
+Modify closed arc
+Modify circle
+Modify ellipse
+Modify box
+Modify image
+Modify filled dot
+Modify white dot
+#
+# 200-201 Mouse button hint
+#
+Unselect object
+Select object
+#
+# 202-207 Error message parts
+#
+NOT SAVED!
+The file was not saved!\nFailed to open file for writing.
+The file was not saved!\nError in write operation.
+The file was not saved!\nString "
+" too long.
+The file was not saved!\nString was too long.
+#
+# 208-210 Error message parts
+#
+The file was not saved!\nFailed to recode string"
+"!
+The file was not saved!\nFailed to recode string.
+#
+# 211-213 Error message parts
+#
+The file was not saved!\nFailed to recode file name"
+"!
+The file was not saved!\nFailed to recode file name.
+#
+# 214
+#
+The file was not saved!\nAn object contains an empty string.
+#
+# 215
+#
+The file was not saved!
+#
+# 216-224 Line style dialog
+#
+Line style
+Solid
+Dashed line
+Dotted line
+Dash dot line
+Dash dot dot line
+Dash dot dot dot line
+Cancel
+Keep line style
+#
+# 225-231 Style length dialog
+#
+Style length
+Style length:
+Dash length in multiples of the line length
+OK
+Use style length as specified
+Cancel
+Discard input
+#
+# 232-237 Line join dialog
+#
+Line join
+Mitered
+Rounded
+Beveled
+Cancel
+Leave line join as is
+#
+# 238-244 Miter limit dialog
+#
+Miter limit
+Limit:
+Choose miter limit value
+OK
+Use choosen value
+Cancel
+Discard input
+#
+# 245-250 Line cap dialog
+#
+Line cap
+Butted
+Rounded
+Projecting
+Cancel
+Leave line cap as is
+#
+# 251-253 Arrow type dialog
+#
+Arrow type
+Cancel
+Leave arrow type as is
+#
+# 254-262 Arrow size dialog
+#
+Arrow size
+Length:
+Width:
+Specify arrow length in multiples of the line width
+Specify arrow width in multiples of the line width
+OK
+Cancel
+Use settings from dialog
+Discard settings from dialog
+#
+# 263-289 Fill style dialog
+#
+Fill style
+No fill
+Pure colour fill
+30 degree diagonal lines to the left
+30 degree diagonal lines to the right
+30 degree diagonal crosshatch
+45 degree diagonal lines to the left
+45 degree diagonal lines to the right
+45 degree diagonal crosshatch
+Horizontal bricks
+Vertical bricks
+Horizontal lines
+Vertical lines
+Horizontal/vertical crosshatch
+Horizontal shingles skewed to the right
+Horizontal shingles skewed to the left
+Vertical shingles skewed to one side
+Vertical shingles skewed to the other side
+Large fish scales
+Small fish scales
+Circles
+Hexagons
+Octagons
+Horizontal tire treads
+Vertical tire treads
+Cancel
+Leave fill style unchanged
+#
+# 290-295 Text align dialog
+#
+Text align
+Left
+Centered
+Right
+Cancel
+Leave text align unchanged
+#
+# 296-333 Text font dialog
+#
+Text font
+Cancel
+Leave text font as is
+Times Roman
+Times Italic
+Times Bold
+Times Bold Italic
+Avantgarde Book
+Avantgarde Book Oblique
+Avantgarde Book Demi
+Avantgarde Book Demi Oblique
+Bookman Light
+Bookman Light Italic
+Bookman Demi
+Bookman Demi Italic
+Courier
+Courier Oblique
+Courier Bold
+Courier Bold Oblique
+Helvetica
+Helvetica Oblique
+Helvetica Bold
+Helvetica Bold Oblique
+Helvetica Narrow
+Helvetica Narrow Oblique
+Helvetica Narrow Bold
+Helvetica Narrow Bold Oblique
+New Century Schoolbook Roman
+New Century Schoolbook Italic
+New Century Schoolbook Bold
+New Century Schoolbook Bold Italic
+Palatino Roman
+Palatino Italic
+Palatino Bold
+Palatino Bild Italic
+Symbol
+Zapf Chancery
+Zapf Dingbats
+#
+# 334-338 Layer manager dialog
+#
+Layers
+OK
+Cancel
+Use settings from dialog
+Discard settings from dialog
+#
+# 339 Dialog title to open drawing
+#
+Open drawing
+#
+# 340-341 Status text to delete object
+#
+Delete object
+Cancel deletion
+#
+# 342-344 Status texts to move object
+#
+Move object
+Place object
+Cancel move
+#
+# 345-346 Error message for failed memory allocation
+#
+Error: Memory
+A memory allocation failed!\nInsufficient memory (RAM/swap space)!
+#
+# 347-348 Error message for invalid placement
+#
+Error: Invalid placement
+The selected placement would result in numeric overflow for coordinates!
+#
+# 349-350 Error with no detailed information
+#
+Error
+An error occured.\nUnfortunately no detail information is available!
+#
+# 351-364 Font selection dialog.
+#
+Font family:
+Times
+AvantGarde
+Bookman
+Courier
+Helvetica
+HelveticaNarrow
+NewCenturySchlbk
+Palatino
+Symbol
+ZapfChancery
+ZapfDingbats
+bold / demi
+italic / oblique
+#
+# 365-367 Font selection OK button
+#
+OK
+Use font configured in dialog
+Choose font family
+#
+# 368-369 Information, no layers used
+#
+No layers are in use at this time.
+No layers in use
+#
+# 370-372 Copy operation
+#
+Copy object
+Place object
+Cancel copy
+#
+# 373-376 Polyline and polygon creation.
+#
+First point
+Add point
+Cancel
+Finish
+#
+# 377-379 Rectangle and box creation.
+#
+First point
+Opposite point
+Cancel
+#
+# 380-384 Circle creation
+#
+Center point
+Circle point
+Cancel
+Finish
+BB corner point
+#
+# 385-388 Arc creation
+#
+Open arc
+Add open arc
+Closed arc
+Add closed arc
+#
+# 389-393 Arc creation
+#
+Start point
+Intermediate point
+End point
+Cancel
+Finished
+#
+# 394-395 Dot creation
+#
+Place dot
+Finished
+#
+# 396-402 Label texts for text input dialog.
+#
+Export text:
+Screen text:
+Enter text to export
+Enter text to show on screen
+Text input
+Create/modify text object
+Skip text object creation/modification
+#
+# 403-404 Text label creation
+#
+Place text label
+Finish
+#
+# 405-408 Adding image
+#
+Image corner
+Opposite corner
+Skip adding image
+Finished
+#
+# 409 Dialog box title "Choose image"
+#
+Choose image
+#
+# 410
+#
+Choose library element
+#
+# 411-412 Adding library element
+#
+Place element
+Skip adding element
+#
+# 413-415 Point move mode, snap or relative
+#
+Point move mode
+snap
+rel
+#
+# 416-417 Texts for rotation spin control
+#
+Rot:
+Text or ellipse rotation in degree
+#
+# 418-421 Texts for point move operation
+#
+Select point
+Place point
+Skip point move
+Move object point
+#
+# 422-427 Texts for spline s modification
+#
+Spline s value
+s:
+OK
+Modify s value
+Cancel
+Close dialog, discard input
+#
+# 428 Slider tool tip
+#
+Choose s value
+#
+# 429-430 Texts in spline s value modification dialog
+#
+Spline s value
+0
+#
+# 431-433 Mouse button texts for point deletion
+#
+Delete point
+Skip point deletion
+Delete spline, polyline or polygon point
+#
+# 434-438 Status and mouse button texts for point adding
+#
+Add point to polyline, polygon or spline
+Add point
+Place point
+Finish point adding
+Skip point
+#
+# 439-441 Status and mouse button texts for drawing size change (s)
+#
+Select corner
+Finish size change
+Change drawing size
+#
+# 442-443 Status and mouse button texts for drawing size change (p)
+#
+Place corner
+Skip size change
+#
+# 444-446 Status and mouse button texts for object flipping
+#
+Flip object(s)
+Flip object
+Finish flipping
+#
+# 447-452 Status and mouse button texts for grouping objects
+#
+Select object
+Unselect object
+Finish group
+Skip grouping
+Finish grouping
+Group objects one by one
+#
+# 453-455 Status and mouse button texts for ungrouping objects
+#
+Ungroup objects
+Ungroup
+Finish ungrouping
+#
+# 456-457 Status and mouse button texts for grouping by box
+#
+Corner point
+Group objects by region
+#
+# 458-460 Status and mouse button texts for detail modification
+#
+Modify object details
+Modify object
+Finish details
+#
+# 461 Dialog box title for image options
+#
+Image options
+#
+# 462-475 texts for image options dialog
+#
+RGB to gray:
+Choose RGB to gray conversion method
+Keep aspect ratio
+Keep image aspect ratio, eventually leaving space unused
+Use alpha channel
+Use opacity data from alpha channel to mix foreground and background
+Image interpolation
+Allow image interpolation
+DCT data
+Allow direct re-use of DCT encoded data from JPEG files
+Image interpolation for DCT data
+Allow image interpolation also for directly re-used DCT encoded data
+Enforce background
+Enforce use of background specified in WXD file
+#
+# 476-479 Texts for OK and Cancel button of image options dialog
+#
+OK
+Cancel
+Use options configured in this dialog
+Discard settings from dialog
+#
+# 480-493 RGB to gray conversion method names
+#
+Default method
+Luminance (default coefficients)
+Luminance (shorter coefficients)
+Fast
+Faster
+Luminance (alternative coefficients)
+Average
+Desaturation
+Minimum decomposition
+Medium decomposition
+Maximum decomposition
+Red
+Green
+Blue
+#
+# 494-498 Texts for dot details
+#
+Dot options
+Diameter:
+Diameter in multiples of the base line width
+Line width:
+Line width in mulitples of the base line width
+#
+# 499-502 Text for box options (radius)
+#
+Box options
+in
+cm
+Radius:
+#
+# 503-504 Error message about numeric overflow in radius calculation
+#
+Numeric overflow
+Numeric overflow in radius calculation!
+#
+# 505-506 Error message, failed to read file
+#
+Read file failed
+Failed to read file:
+#
+# 507-508
+#
+Open file failed
+Failed to open file!
+#
+# 509-510
+#
+Mouse outside
+Mouse position outside usable coordinates range!
+#
+# 511-512
+#
+Text missing
+Empty export text is not allowed!
+#
+# 513-514
+#
+File name missing
+An empty file name string was returned by selection dialog!
+#
+# 515-516
+#
+No coordinates
+Failed to obtain coordinates from object!
+#
+# 517-518
+#
+No coordinates
+Failed to set coordinates on object!
+#
+# 519-520
+#
+Numeric overflow
+Numeric overflow in coordinates calculation!
+#
+# 521-522
+#
+Grouping failed
+Failed to move an object into a group!
+#
+# 523-524
+#
+Ungrouping failed
+Failed to remove an object from group!
+#
+# 525-526
+#
+Radius calculation failed
+Box is too small to calculate a corner radius!
+#
+# 527-528
+#
+BUG
+New point out of index range!
+#
+# 529-530
+#
+Too many points
+Only 65535 point allowed for spline, polygon, or polyline!
+#
+# 531 Status text: Ready
+#
+Ready
+#
+# 532-534 Delete region
+#
+Delete region
+Cancel region
+Select region
+#
+# 535-544 Conversions
+#
+Convert
+to polygon
+to polyline
+to closed interpolated spline
+to closed arc
+to open arc
+to closed approximated spline
+to open approximated spline
+to white filled dot
+to simple dot
+#
+# 545-553 Conversion tool tips
+#
+Convert object to polygon
+Convert object to polyline
+Convert object to closed interpolated spline
+Convert object to closed arc
+Convert object to open arc
+Convert object to closed approximated spline
+Convert object to open approximated spline
+Convert object to white filled dot
+Convert object to simple dot
+#
+# 554-555 Conversion mouse button labels
+#
+Convert object
+Skip conversion
+#
+# 556-557 Message box text for failed conversion
+#
+Conversion failed
+Object is unsuitable for conversion!
+#
+# 558-559 Message box text if output directory too long
+#
+Directory too long
+Output file directory too long!
+#
+# 560-561 Message box text if failed to find current working directory
+#
+Current directory
+Failed to find current working directory!
+#
+# 562-563 Message box output file name is too long
+#
+File name too long
+Output file name is too long!
+#
+# 564-565 Messagae box, failed to find output directory.
+#
+Output directory
+Failed to find output directory name!
+#
+# 566-569 Menu item and tip texts for 90 degree rotations
+#
+Rotate left
+Rotate object 90 degree to the left
+Rotate right
+Rotate object 90 degree to the right
+#
+# 570-571 Status texts
+#
+Rotate left
+Rotate right
+#
+# 572-573 Mouse button texts
+#
+Rotate object
+Finish rotating
+#
+# 574 Dialog box title for box details
+#
+Box details
+#
+# 575-595 Details for error message
+#
+\nNo detailed information available.
+\nNot enough memory available!
+\nExpected number of text parts not found!
+\nConversion of text part to number failed!
+\nText label recoding failed!
+\nFile name recoding failed!
+\nInvalid arguments passed to reader function (bug)!
+\nFile format version information missing!
+\nBounding box information missing!
+\nNot a wxdkdraw file!
+\nFile format version too new, can not handle it!
+\nObject start line expected!
+\nObject details line expected!
+\nReader in unsupported state (bug)!
+\nUnsupported object type or subtype!
+\nNumeric overflow in coordinates conversion or calculation!
+\nNo open group to close here!
+\nToo few points specified!
+\nEmpty image file name!
+\nImage file name too long!
+\nBox does not span an area!
+#
+# 596-598 Information about line numbers...
+#
+\nLine
+, text part
+.
+#
+# 599-600 Information message box title and text.
+#
+Drawing modified
+Corrections were applied to the drawing.
+#
+# 601 Options menu
+#
+Options
+#
+# 602-603 Reset options
+#
+Reset all options
+Reset all options to default values
+#
+# 604-605 Confirmation dialog box
+#
+Are you sure?
+Do you really want to reset all options to default values?
+#
+# 606-610 Menu items
+#
+Colours
+Reset
+Reset colour to default
+Modify
+Modify colour
+#
+# 611-619 Colours to modify
+#
+Border
+Background
+Grid
+Placement help
+Highlight Copy
+Highlight Move
+Highlight Delete
+Highlight Group
+Missing image
+#
+# 620-624 Menu item, tool tip and mouse hints to modify spline point s
+#
+Modify s
+Modify spline point s value
+Modify s
+Finish modifications
+Modify spline point s value
+#
+# 625-626 Menu item and tool tip for new objects.
+#
+New objects
+Set defaults for new objects
+#
+# 627-629 Dialog title and contents, defaults for new objects
+#
+New objects defaults
+Filled dots
+White filled dots
+#
+# 630-631 Menu item and tool tip for screen representation options
+#
+Screen representation
+Modify screen representation options
+#
+# 632-634 X-spline options
+#
+Splines
+Bezier segments per X-spline sub-segment
+Specify number of Bezier segments to use for each X-spline sub-segment
+#
+# 635 Dialog title
+#
+Screen representation options
+#
+# 636-638 Option use exact text fonts
+#
+Texts
+Exact fonts
+Attempt to use exact fonts for non-LaTeX text
+#
+# 639-641 Option reduce point markup for point operations
+#
+Point add / delete / move / modify operations
+Reduce markup size
+Reduce point markup for point related operations
+#
+# 642 Hint for export text
+#
+Export text (required):
+#
+# 643-646
+#
+Open arc
+Add open arc
+Closed arc
+Add closed arc
+$!end
+};
+
+
+
+/** Non-localized wxChar texts.
+*/
+static wxChar const * wxdkdraw_nl_wx[] = {
+$!string-table macro=wxT
+#
+# 0: Program name.
+#
+wxdkdraw
+#
+# 1: Program version.
+#
+1.0.0
+#
+# 2: Copyright owner name.
+#
+Dirk Krause
+#
+# 3: Software vendor name.
+#
+DKrause
+#
+# 4: Resource name of Windows icon
+#
+aaaaa
+#
+# 5: UNUSED (previously chm help file name)
+#
+
+#
+# 6: UNUSED (previously non-Windows htb help file name)
+#
+
+#
+# 7: Space
+#
+
+#
+# 8: Newline
+#
+\n
+#
+# 9 10 11 12 13 14 15: List of libraries used.
+#
+DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
+http://sourceforge.net/p/dktools/wiki/Home/
+http://www.wxwidgets.org
+http://www.libpng.org/pub/png/libpng.html
+http://www.ijg.org
+http://www.remotesensing.org/libtiff
+http://www.zlib.net
+#
+# 16 17
+#
+Error
+Not enough memory (RAM)!
+#
+# 18 Default value for the zoom factor (max zoom out)
+#
+0.0078125
+#
+# 19 Empty string
+#
+
+#
+# 20 30 spaces as initial text for text controls to set size.
+#
+
+#
+#
+#
+$!end
+};
+
+
+
+/** Non-localized dkChar texts.
+*/
+static dkChar const * wxdkdraw_nl_dk[] = {
+$!string-table macro=dkT
+#
+# 0: Program group name.
+#
+dktools
+#
+# 1: String table name.
+#
+wxdkdraw.str
+#
+# 2: CHM help file name
+#
+wxdkdraw.chm
+#
+# 3: HTB help file name
+#
+wxdkdraw.htb
+$!end
+};
+
+
+
+/** Implementation of the wxApp functionality.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(WxdkdrawApp);
+#else
+IMPLEMENT_APP(WxdkdrawApp)
+#endif
+
+
+bool
+WxdkdrawApp::OnInit()
+{
+ WxdkdrawFrame *frame = NULL;
+ wxChar const * const *localizedTexts = NULL;
+ wxPNGHandler *phPng = NULL;
+ wxXPMHandler *phXpm = NULL;
+ wxICOHandler *phIco = NULL;
+ wxArchiveFSHandler *phArchiveFS = NULL;
+ bool back = false;
+
+ $? "+ WxdkdrawApp::OnInit"
+
+ /* Initialize members.
+ */
+ pAh = NULL;
+#if 1
+ pHc = NULL;
+#endif
+ /* __CHANGE__ 009: Initialize further members here.
+ */
+
+ /* Set up helper object.
+ */
+ pAh = new Dk4WxApplicationHelper();
+ if (NULL == pAh) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pAh->Initialize(argv[0], wxdkdraw_nl_wx[3], wxdkdraw_nl_dk[0]))) {
+ goto finished;
+ }
+
+ /* Add image and file system handlers for online help.
+ */
+ phPng = new wxPNGHandler();
+ if (NULL != phPng) {
+ wxImage::AddHandler(phPng);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phXpm = new wxXPMHandler();
+ if (NULL != phXpm) {
+ wxImage::AddHandler(phXpm);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phIco = new wxICOHandler();
+ if (NULL != phIco) {
+ wxImage::AddHandler(phIco);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is not released.
+ This is a false positive as phArchiveFs is passed to
+ wxFileSystem and managed by the wxWidgets library.
+ */
+ phArchiveFS = new wxArchiveFSHandler();
+ if (NULL != phArchiveFS) {
+ wxFileSystem::AddHandler(phArchiveFS);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Set up help controller.
+ */
+#if 1
+ pHc = new Dk4WxHelpController();
+ if (NULL == pHc) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pHc->Initialize(pAh, wxdkdraw_nl_dk[2], wxdkdraw_nl_dk[3]))) {
+ goto finished;
+ }
+#endif
+
+ /* Attempt to obtain localized texts in users preferred language.
+ */
+ localizedTexts = pAh->GetStringTable(wxdkdraw_nl_dk[1], wxdkdraw_texts);
+ if(!(localizedTexts)) {
+ localizedTexts = wxdkdraw_texts;
+ }
+
+ /* Create and show frame.
+ */
+ frame = new WxdkdrawFrame(
+ WxdkdrawFrame::ID_FRAME,
+ pAh,
+#if 1
+ pHc,
+#else
+ NULL,
+#endif
+ argc,
+ argv,
+ localizedTexts,
+ wxdkdraw_nl_wx,
+ wxdkdraw_nl_dk
+ );
+ if(!(frame)) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Show frame, restore position and indicate success.
+ */
+ frame->RestorePosition();
+ frame->Connect(
+ wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(WxdkdrawFrame::OnIdle)
+ );
+ frame->Show();
+ back = true;
+
+ /* Release resources if initialization failed.
+ */
+ finished:
+ if(!(back)) {
+#if 1
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+#endif
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+ }
+ $? "- WxdkdrawApp::OnInit %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+int
+WxdkdrawApp::OnExit()
+{
+ int back = 0;
+
+ $? "+ WxdkdrawApp::OnExit"
+
+ /* __CHANGE__ 009: Release resources allocated by further members.
+ */
+
+ /* Release resources.
+ */
+#if 1
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+#endif
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+
+ /* __CHANGE__ 010: Set exit status code.
+ */
+ $? "- WxdkdrawApp::OnExit %d", back
+ return back;
+}
+
+
+
+void
+WxdkdrawApp::ShowMemoryErrorMessage(void)
+{
+ const wxChar *s_title = NULL;
+ const wxChar *s_text = NULL;
+
+ if (NULL != pAh) {
+ s_title = pAh->GetBasicString(6);
+ s_text = pAh->GetBasicString(7);
+ }
+ if (NULL == s_title) {
+ s_title = wxdkdraw_nl_wx[16];
+ }
+ if (NULL == s_text) {
+ s_text = wxdkdraw_nl_wx[17];
+ }
+ wxMessageBox(s_text, s_title, (wxOK | wxCENTRE | wxICON_ERROR));
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawApp.h b/support/dktools/WxdkdrawApp.h
new file mode 100644
index 0000000000..794c03d505
--- /dev/null
+++ b/support/dktools/WxdkdrawApp.h
@@ -0,0 +1,83 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawApp.cpt
+*/
+
+#ifndef WXDKDRAWAPP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWAPP_H_INCLUDED 1
+
+
+#line 8 "WxdkdrawApp.cpt"
+
+/** @file WxdkdrawApp.h The WxdkdrawApp class.
+*/
+
+
+
+/** Application class, derived from wxApp, one instance per program.
+*/
+class WxdkdrawApp : public wxApp
+{
+ protected:
+
+ /** Helper object.
+ */
+ Dk4WxApplicationHelper *pAh;
+
+ /** Controller fr online help.
+ */
+#if 1
+ Dk4WxHelpController *pHc;
+#endif
+
+ /* __CHANGE__ 009: Add further members here.
+ */
+
+ protected:
+
+ /** Show error message if there is not enough memory available.
+ */
+ void
+ ShowMemoryErrorMessage(void);
+
+ public:
+
+ /** Application initialization.
+ @return true on success, false on error.
+ */
+ virtual
+ bool
+ OnInit();
+
+ /** Application shutdown.
+ @return 0 on success, any other value indicates an error.
+ */
+ virtual
+ int
+ OnExit();
+};
+
+
+
+/** Declaration as the wxApp object.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(WxdkdrawApp);
+#else
+DECLARE_APP(WxdkdrawApp)
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/WxdkdrawComp.cpp b/support/dktools/WxdkdrawComp.cpp
new file mode 100644
index 0000000000..64a2dc1c49
--- /dev/null
+++ b/support/dktools/WxdkdrawComp.cpp
@@ -0,0 +1,282 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawComp.cpt
+*/
+
+/** @file WxdkdrawComp.cpp The WxdkdrawComp module.
+*/
+
+
+#line 92 "WxdkdrawComp.cpt"
+
+#include "wxdkdraw.h"
+
+
+
+
+
+#line 98 "WxdkdrawComp.cpt"
+
+
+
+int
+drawobj_object_category(int8_t ot)
+{
+ int back = WXD_OC_CONTROL;
+
+
+#line 106 "WxdkdrawComp.cpt"
+ switch (ot) {
+ case WXD_OT_TEXT : {
+ back = WXD_OC_TEXT ;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE : case WXD_OT_O_ARC : {
+ back = WXD_OC_OPEN ;
+ } break;
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE : case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : case WXD_OT_BOX : {
+ back = WXD_OC_CLOSED ;
+ } break;
+ case WXD_OT_IMAGE : {
+ back = WXD_OC_IMAGE ;
+ } break;
+ }
+
+
+#line 122 "WxdkdrawComp.cpt"
+ return back;
+}
+
+
+
+static
+int
+cmp_u8(uint8_t a, uint8_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+#if 0
+static
+int
+cmp_i8(int8_t a, int8_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+#endif
+
+
+#if 0
+static
+int
+cmp_u16(uint16_t a, uint16_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+#endif
+
+
+static
+int
+cmp_i16(int16_t a, int16_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+
+#if 0
+static
+int
+cmp_int(int a, int b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+#endif
+
+
+
+int
+drawobj_compare_object(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ const Wxd_object_t *pl; /* Left object */
+ const Wxd_object_t *pr; /* Right object */
+#if 0
+ int cal; /* Left object category */
+ int car; /* Right object category */
+#endif
+ int back = 0; /* Comparison result */
+ DK4_UNUSED_ARG(cr)
+
+
+#line 187 "WxdkdrawComp.cpt"
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const Wxd_object_t *)l;
+ pr = (const Wxd_object_t *)r;
+ back = cmp_i16(pl->lay, pr->lay);
+ /*
+ 2019-05-10 Modification
+ Objects in the flat storage are compared by layer number
+ only. Otherwise we would need to change object order on
+ each style modification.
+ */
+#if 0
+ if (0 == back) {
+ cal = drawobj_object_category(pl->ot);
+ car = drawobj_object_category(pr->ot);
+ back = cmp_int(cal, car);
+ if (0 == back) {
+ back = cmp_u16(pl->lw, pr->lw);
+ if (0 == back) {
+ back = cmp_u8(pl->ls, pr->ls);
+ if (0 == back) {
+ back = cmp_u8(pl->sl, pr->sl);
+ if (0 == back) {
+ back = cmp_u8(pl->js, pr->js);
+ if (0 == back) {
+ back = cmp_u8(pl->cs, pr->cs);
+ if (0 == back) {
+ back = cmp_u8(pl->fs, pr->fs);
+ if (0 == back) {
+ back = cmp_u8(pl->ml, pr->ml);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[0], pr->sc[0]);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[1], pr->sc[1]);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[2], pr->sc[2]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[0], pr->fc[0]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[1], pr->fc[1]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[2], pr->fc[2]);
+ if (0 == back) {
+ back = cmp_i8(pl->ot, pr->ot);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+#endif
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+
+
+#line 258 "WxdkdrawComp.cpt"
+ return back;
+}
+
+
+
+int
+drawobj_compare_stipples(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ Wxd_stipple_t const *pl; /* Left stipple */
+ Wxd_stipple_t const *pr; /* Right stipple */
+ int back = 0; /* Comparison result */
+ DK4_UNUSED_ARG(cr)
+
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (Wxd_stipple_t const *)l;
+ pr = (Wxd_stipple_t const *)r;
+ for (size_t i = 0; ((0 == back) && (i < 7)); i++) {
+ back = cmp_u8(pl->cd[i], pr->cd[i]);
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+int
+drawobj_compare_layers(const void *l, const void *r, int cr)
+{
+ const Wxd_layer_t *pl; /* Left layer structure */
+ const Wxd_layer_t *pr; /* Right layer structure */
+ const int16_t *pnum; /* Address of layer number variable */
+ int back = 0; /* Comparison result */
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const Wxd_layer_t *)l;
+ switch (cr) {
+ case 1: {
+ pnum = (const int16_t *)r;
+ if (pl->lay > *pnum) {
+ back = 1;
+ }
+ else {
+ if (pl->lay < *pnum) {
+ back = -1;
+ }
+ }
+ } break;
+ default: {
+ pr = (const Wxd_layer_t *)r;
+ if (pl->lay > pr->lay) {
+ back = 1;
+ }
+ else {
+ if (pl->lay < pr->lay) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawComp.cpt b/support/dktools/WxdkdrawComp.cpt
new file mode 100644
index 0000000000..82e30801a1
--- /dev/null
+++ b/support/dktools/WxdkdrawComp.cpt
@@ -0,0 +1,345 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file WxdkdrawComp.h Compare drawing objects.
+*/
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+/** Comparison criteria for drawing objects.
+*/
+enum {
+ /** Compare by layer number and
+ object properties.
+ */
+ WXD2LAT_OBJ_COMPARE_CR_PROPERTIES = 0 ,
+
+ /** Compare objects by name.
+ */
+ WXD2LAT_OBJ_COMPARE_CR_BY_NAME ,
+
+ /** Compare object name against
+ specified name.
+ */
+ WXD2LAT_OBJ_COMPARE_CR_AGAINST_NAME
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Compare drawing objects.
+ @param l Left object.
+ @param r Right object or name.
+ @param cr Comparison criteria:
+ - WXD2LAT_OBJ_COMPARE_CR_PROPERTIES: Object/object by features,
+ - WXD2LAT_OBJ_COMPARE_CR_BY_NAME: Object/object by name,
+ - WXD2LAT_OBJ_COMPARE_CR_AGAINST_NAME: Object/name.
+ @return Comparison result: -1: l<r, 0: l=r, 1 l>r.
+*/
+
+int
+drawobj_compare_object(const void *l, const void *r, int cr);
+
+
+/** Find category for object type.
+ @param ot Object type.
+ @return Category for object type.
+*/
+
+int
+drawobj_object_category(int8_t ot);
+
+
+/** Compare stipple bitmaps.
+ @param l Address of left structure.
+ @param r Address of right structure.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+*/
+
+int
+drawobj_compare_stipples(const void *l, const void *r, int cr);
+
+
+/** Compare two layer structures.
+ @param l Left layer structure.
+ @param r Right layer structure or layer number.
+ @param cr Comparison criteria (0=layer/layer, 1=layer/number).
+ @return Comparison result.
+*/
+
+int
+drawobj_compare_layers(const void *l, const void *r, int cr);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "wxdkdraw.h"
+
+
+
+$!trace-include
+
+
+
+int
+drawobj_object_category(int8_t ot)
+{
+ int back = WXD_OC_CONTROL;
+ $? "+ drawobj_object_category %d", (int)ot
+ switch (ot) {
+ case WXD_OT_TEXT : {
+ back = WXD_OC_TEXT ;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE : case WXD_OT_O_ARC : {
+ back = WXD_OC_OPEN ;
+ } break;
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE : case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : case WXD_OT_BOX : {
+ back = WXD_OC_CLOSED ;
+ } break;
+ case WXD_OT_IMAGE : {
+ back = WXD_OC_IMAGE ;
+ } break;
+ }
+ $? "- drawobj_object_category %d", back
+ return back;
+}
+
+
+
+static
+int
+cmp_u8(uint8_t a, uint8_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+#if 0
+static
+int
+cmp_i8(int8_t a, int8_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+#endif
+
+
+#if 0
+static
+int
+cmp_u16(uint16_t a, uint16_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+#endif
+
+
+static
+int
+cmp_i16(int16_t a, int16_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+
+#if 0
+static
+int
+cmp_int(int a, int b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+#endif
+
+
+
+int
+drawobj_compare_object(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ const Wxd_object_t *pl; /* Left object */
+ const Wxd_object_t *pr; /* Right object */
+#if 0
+ int cal; /* Left object category */
+ int car; /* Right object category */
+#endif
+ int back = 0; /* Comparison result */
+ DK4_UNUSED_ARG(cr)
+ $? "+ drawobj_compare_object %d", cr
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const Wxd_object_t *)l;
+ pr = (const Wxd_object_t *)r;
+ back = cmp_i16(pl->lay, pr->lay);
+ /*
+ 2019-05-10 Modification
+ Objects in the flat storage are compared by layer number
+ only. Otherwise we would need to change object order on
+ each style modification.
+ */
+#if 0
+ if (0 == back) {
+ cal = drawobj_object_category(pl->ot);
+ car = drawobj_object_category(pr->ot);
+ back = cmp_int(cal, car);
+ if (0 == back) {
+ back = cmp_u16(pl->lw, pr->lw);
+ if (0 == back) {
+ back = cmp_u8(pl->ls, pr->ls);
+ if (0 == back) {
+ back = cmp_u8(pl->sl, pr->sl);
+ if (0 == back) {
+ back = cmp_u8(pl->js, pr->js);
+ if (0 == back) {
+ back = cmp_u8(pl->cs, pr->cs);
+ if (0 == back) {
+ back = cmp_u8(pl->fs, pr->fs);
+ if (0 == back) {
+ back = cmp_u8(pl->ml, pr->ml);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[0], pr->sc[0]);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[1], pr->sc[1]);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[2], pr->sc[2]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[0], pr->fc[0]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[1], pr->fc[1]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[2], pr->fc[2]);
+ if (0 == back) {
+ back = cmp_i8(pl->ot, pr->ot);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+#endif
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ $? "- drawobj_compare_object %d", back
+ return back;
+}
+
+
+
+int
+drawobj_compare_stipples(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ Wxd_stipple_t const *pl; /* Left stipple */
+ Wxd_stipple_t const *pr; /* Right stipple */
+ int back = 0; /* Comparison result */
+ DK4_UNUSED_ARG(cr)
+
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (Wxd_stipple_t const *)l;
+ pr = (Wxd_stipple_t const *)r;
+ for (size_t i = 0; ((0 == back) && (i < 7)); i++) {
+ back = cmp_u8(pl->cd[i], pr->cd[i]);
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+int
+drawobj_compare_layers(const void *l, const void *r, int cr)
+{
+ const Wxd_layer_t *pl; /* Left layer structure */
+ const Wxd_layer_t *pr; /* Right layer structure */
+ const int16_t *pnum; /* Address of layer number variable */
+ int back = 0; /* Comparison result */
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const Wxd_layer_t *)l;
+ switch (cr) {
+ case 1: {
+ pnum = (const int16_t *)r;
+ if (pl->lay > *pnum) {
+ back = 1;
+ }
+ else {
+ if (pl->lay < *pnum) {
+ back = -1;
+ }
+ }
+ } break;
+ default: {
+ pr = (const Wxd_layer_t *)r;
+ if (pl->lay > pr->lay) {
+ back = 1;
+ }
+ else {
+ if (pl->lay < pr->lay) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawComp.h b/support/dktools/WxdkdrawComp.h
new file mode 100644
index 0000000000..31601c753b
--- /dev/null
+++ b/support/dktools/WxdkdrawComp.h
@@ -0,0 +1,104 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawComp.cpt
+*/
+
+#ifndef WXDKDRAWCOMP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWCOMP_H_INCLUDED 1
+
+
+#line 8 "WxdkdrawComp.cpt"
+
+/** @file WxdkdrawComp.h Compare drawing objects.
+*/
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+/** Comparison criteria for drawing objects.
+*/
+enum {
+ /** Compare by layer number and
+ object properties.
+ */
+ WXD2LAT_OBJ_COMPARE_CR_PROPERTIES = 0 ,
+
+ /** Compare objects by name.
+ */
+ WXD2LAT_OBJ_COMPARE_CR_BY_NAME ,
+
+ /** Compare object name against
+ specified name.
+ */
+ WXD2LAT_OBJ_COMPARE_CR_AGAINST_NAME
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Compare drawing objects.
+ @param l Left object.
+ @param r Right object or name.
+ @param cr Comparison criteria:
+ - WXD2LAT_OBJ_COMPARE_CR_PROPERTIES: Object/object by features,
+ - WXD2LAT_OBJ_COMPARE_CR_BY_NAME: Object/object by name,
+ - WXD2LAT_OBJ_COMPARE_CR_AGAINST_NAME: Object/name.
+ @return Comparison result: -1: l<r, 0: l=r, 1 l>r.
+*/
+
+int
+drawobj_compare_object(const void *l, const void *r, int cr);
+
+
+/** Find category for object type.
+ @param ot Object type.
+ @return Category for object type.
+*/
+
+int
+drawobj_object_category(int8_t ot);
+
+
+/** Compare stipple bitmaps.
+ @param l Address of left structure.
+ @param r Address of right structure.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+*/
+
+int
+drawobj_compare_stipples(const void *l, const void *r, int cr);
+
+
+/** Compare two layer structures.
+ @param l Left layer structure.
+ @param r Right layer structure or layer number.
+ @param cr Comparison criteria (0=layer/layer, 1=layer/number).
+ @return Comparison result.
+*/
+
+int
+drawobj_compare_layers(const void *l, const void *r, int cr);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/WxdkdrawControl.cpp b/support/dktools/WxdkdrawControl.cpp
new file mode 100644
index 0000000000..a1ff51f1e2
--- /dev/null
+++ b/support/dktools/WxdkdrawControl.cpp
@@ -0,0 +1,179 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawControl.cpt
+*/
+
+/** @file WxdkdrawControl.cpp The WxdkdrawControl module.
+*/
+
+
+#line 10 "WxdkdrawControl.cpt"
+
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+
+#line 24 "WxdkdrawControl.cpt"
+
+
+
+WxdkdrawFrame::Control::Control()
+: m_szDrawco(
+ 0, 0
+)
+{
+
+
+#line 33 "WxdkdrawControl.cpt"
+ m_pParent = NULL;
+ m_pB1 = NULL;
+ m_pB2 = NULL;
+ m_pB3 = NULL;
+ m_bCanAllocate = true;
+ m_ptRes.x = 96.0;
+ m_ptRes.y = 96.0;
+ m_dZoom = 1.0;
+ m_uGridOptical = 8128000UL;
+ m_uGridSnap = 2032000UL;
+
+
+#line 44 "WxdkdrawControl.cpt"
+}
+
+
+
+/** Constructor
+*/
+WxdkdrawFrame::Control::Control(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ WxdkdrawFrame *pFrame,
+ wxPoint const & pos,
+ wxSize const & sz,
+ long st,
+ wxChar const *name
+) : wxControl(
+ pParent, wxid, pos, sz, st, wxDefaultValidator, name
+), m_szDrawco(
+ 0, 0
+)
+{
+
+
+#line 65 "WxdkdrawControl.cpt"
+ m_pParent = pFrame;
+ m_pB1 = NULL;
+ m_pB2 = NULL;
+ m_pB3 = NULL;
+ m_bCanAllocate = true;
+ m_ptRes.x = 96.0;
+ m_ptRes.y = 96.0;
+ m_dZoom = 1.0;
+ m_uGridOptical = 8128000UL;
+ m_uGridSnap = 2032000UL;
+
+
+#line 76 "WxdkdrawControl.cpt"
+}
+
+
+
+bool
+WxdkdrawFrame::Control::Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ WxdkdrawFrame *pFrame,
+ wxPoint const & pos,
+ wxSize const & sz,
+ long st,
+ wxChar const *name
+)
+{
+ bool back;
+
+
+#line 93 "WxdkdrawControl.cpt"
+ back = wxControl::Create(
+ pParent, wxid, pos, sz, st, wxDefaultValidator,
+ wxString(name)
+ );
+ m_pParent = pFrame;
+ m_pB1 = NULL;
+ m_pB2 = NULL;
+ m_pB3 = NULL;
+ m_bCanAllocate = true;
+ m_ptRes.x = 96.0;
+ m_ptRes.y = 96.0;
+ m_dZoom = 1.0;
+ m_szDrawco = wxSize(0, 0);
+ m_uGridOptical = 8128000UL;
+ m_uGridSnap = 2032000UL;
+
+
+#line 109 "WxdkdrawControl.cpt"
+ return back;
+}
+
+
+
+WxdkdrawFrame::Control::~Control()
+{
+
+
+#line 117 "WxdkdrawControl.cpt"
+ m_pParent = NULL;
+ if (NULL != m_pB1) { delete m_pB1; }
+ m_pB1 = NULL;
+ if (NULL != m_pB2) { delete m_pB2; }
+ m_pB2 = NULL;
+ if (NULL != m_pB3) { delete m_pB3; }
+ m_pB3 = NULL;
+ m_bCanAllocate = false;
+
+
+#line 126 "WxdkdrawControl.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PrepareForDestruction(void)
+{
+
+
+#line 134 "WxdkdrawControl.cpt"
+ if (NULL != m_pB1) { delete m_pB1; }
+ m_pB1 = NULL;
+ if (NULL != m_pB2) { delete m_pB2; }
+ m_pB2 = NULL;
+ if (NULL != m_pB3) { delete m_pB3; }
+ m_pB3 = NULL;
+ m_bCanAllocate = false;
+
+
+#line 142 "WxdkdrawControl.cpt"
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawControl.cpt b/support/dktools/WxdkdrawControl.cpt
new file mode 100644
index 0000000000..3217dbe368
--- /dev/null
+++ b/support/dktools/WxdkdrawControl.cpt
@@ -0,0 +1,148 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% module
+
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+WxdkdrawFrame::Control::Control()
+: m_szDrawco(
+ 0, 0
+)
+{
+ $? "+ Control (without arguments)"
+ m_pParent = NULL;
+ m_pB1 = NULL;
+ m_pB2 = NULL;
+ m_pB3 = NULL;
+ m_bCanAllocate = true;
+ m_ptRes.x = 96.0;
+ m_ptRes.y = 96.0;
+ m_dZoom = 1.0;
+ m_uGridOptical = 8128000UL;
+ m_uGridSnap = 2032000UL;
+ $? "- Control"
+}
+
+
+
+/** Constructor
+*/
+WxdkdrawFrame::Control::Control(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ WxdkdrawFrame *pFrame,
+ wxPoint const & pos,
+ wxSize const & sz,
+ long st,
+ wxChar const *name
+) : wxControl(
+ pParent, wxid, pos, sz, st, wxDefaultValidator, name
+), m_szDrawco(
+ 0, 0
+)
+{
+ $? "+ Control (with arguments)"
+ m_pParent = pFrame;
+ m_pB1 = NULL;
+ m_pB2 = NULL;
+ m_pB3 = NULL;
+ m_bCanAllocate = true;
+ m_ptRes.x = 96.0;
+ m_ptRes.y = 96.0;
+ m_dZoom = 1.0;
+ m_uGridOptical = 8128000UL;
+ m_uGridSnap = 2032000UL;
+ $? "- Control"
+}
+
+
+
+bool
+WxdkdrawFrame::Control::Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ WxdkdrawFrame *pFrame,
+ wxPoint const & pos,
+ wxSize const & sz,
+ long st,
+ wxChar const *name
+)
+{
+ bool back;
+ $? "+ Create"
+ back = wxControl::Create(
+ pParent, wxid, pos, sz, st, wxDefaultValidator,
+ wxString(name)
+ );
+ m_pParent = pFrame;
+ m_pB1 = NULL;
+ m_pB2 = NULL;
+ m_pB3 = NULL;
+ m_bCanAllocate = true;
+ m_ptRes.x = 96.0;
+ m_ptRes.y = 96.0;
+ m_dZoom = 1.0;
+ m_szDrawco = wxSize(0, 0);
+ m_uGridOptical = 8128000UL;
+ m_uGridSnap = 2032000UL;
+ $? "- Create %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+WxdkdrawFrame::Control::~Control()
+{
+ $? "+ ~Control"
+ m_pParent = NULL;
+ if (NULL != m_pB1) { delete m_pB1; }
+ m_pB1 = NULL;
+ if (NULL != m_pB2) { delete m_pB2; }
+ m_pB2 = NULL;
+ if (NULL != m_pB3) { delete m_pB3; }
+ m_pB3 = NULL;
+ m_bCanAllocate = false;
+ $? "- ~Control"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PrepareForDestruction(void)
+{
+ $? "+ PrepareForDestruction"
+ if (NULL != m_pB1) { delete m_pB1; }
+ m_pB1 = NULL;
+ if (NULL != m_pB2) { delete m_pB2; }
+ m_pB2 = NULL;
+ if (NULL != m_pB3) { delete m_pB3; }
+ m_pB3 = NULL;
+ m_bCanAllocate = false;
+ $? "- PrepareForDestruction"
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawControlArrows.cpp b/support/dktools/WxdkdrawControlArrows.cpp
new file mode 100644
index 0000000000..a599bed9ba
--- /dev/null
+++ b/support/dktools/WxdkdrawControlArrows.cpp
@@ -0,0 +1,753 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawControlArrows.cpt
+*/
+
+/** @file WxdkdrawControlArrows.cpp The WxdkdrawControlArrows module.
+*/
+
+
+#line 10 "WxdkdrawControlArrows.cpt"
+
+/* This module contains the methods to draw the arrowheads.
+*/
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+
+#line 26 "WxdkdrawControlArrows.cpt"
+
+
+
+void
+WxdkdrawFrame::Control::ArrowVertices(
+ dk4_gra_point_t *pt,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ double xpos,
+ double ypos,
+ double rot,
+ uint8_t atype,
+ uint8_t alength,
+ uint8_t awidth
+)
+{
+ double lw; /* Line width */
+ double l; /* Arrowhead length */
+ double w; /* Arrowhead width */
+ double w2; /* Half arrowhead width */
+ size_t szUsed = 0; /* Number of elements used in pt array */
+ size_t i; /* Traverse pt array */
+
+
+#line 49 "WxdkdrawControlArrows.cpt"
+ if ((1 <= atype) && (29 >= atype)) {
+ lw = (double)(pObj->lw) * (double)(pDrw->baselw);
+ l = lw * ((double)alength);
+ w = lw * ((double)awidth);
+ w2 = w / 2.0;
+ switch (atype) {
+ case 1: case 2: case 3: {
+ szUsed = 3;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - l;
+ pt[2].y = 0.0 - w2;
+ } break;
+ case 4: case 5: {
+ szUsed = 4;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - l;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0;
+ } break;
+ case 6: case 7: case 8: case 9: {
+ szUsed = 4;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - l;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - 0.75 * l;
+ pt[3].y = 0.0;
+ } break;
+ case 10: case 11: case 12: case 13: {
+ szUsed = 4;
+ pt[0].x = 0.0 - 0.75 * l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - 0.75 * l;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0;
+ } break;
+ case 14: case 15: case 16: case 17: {
+ szUsed = 4;
+ pt[0].x = 0.0 - 0.5 * l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - 0.5 * l;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0;
+ } break;
+ case 18: case 19: case 22: {
+ szUsed = 4;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = w2;
+ pt[2].x = 0.0;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0 - w2;
+ } break;
+ case 20: case 21: {
+ szUsed = 6;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = w2;
+ pt[2].x = 0.0;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0 - w2;
+ pt[4].x = 0.0;
+ pt[4].y = 0.0;
+ pt[5].x = 0.0 - l;
+ pt[5].y = 0.0;
+ } break;
+ case 23: case 24: {
+ szUsed = 3;
+ pt[0].x = 0.0;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0 - w2;
+ pt[2].x = 0.0 - l;
+ pt[2].y = 0.0;
+ } break;
+ case 25: case 26: {
+ szUsed = 4;
+ pt[0].x = 0.0;
+ pt[0].y = w2;
+ pt[1].x = 0.0 - l;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0;
+ pt[3].y = 0.0;
+ } break;
+ case 27: case 28: {
+ szUsed = 1;
+ pt[0].x = 0.0 - (l / 2.0);
+ pt[0].y = 0.0;
+ } break;
+ case 29: {
+ szUsed = 2;
+ pt[0].x = 0.0;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0 - w2;
+ } break;
+ }
+ /* Finally:
+ - Rotate all points
+ - Shift points to position
+ - Translate WXD coordinates to pixel coordinates
+ */
+ for (i = 0; i < szUsed; i++) {
+ dk4gratool_rotate_point(&(pt[i]), rot);
+ pt[i].x += xpos;
+ pt[i].y += ypos;
+ pt[i].x = ConvX(pt[i].x);
+ pt[i].y = ConvY(pt[i].y);
+ }
+ }
+
+
+#line 181 "WxdkdrawControlArrows.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawOneArrowhead(
+ wxGraphicsContext *gc,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int const *sc,
+ double xpos,
+ double ypos,
+ double rot,
+ uint8_t atype,
+ uint8_t alength,
+ uint8_t awidth
+)
+{
+ dk4_gra_point_t pt[8]; /* Vertices coordinates in pixels */
+ int plw; /* Pen line width */
+
+ wxColour cs(sc[0], sc[1], sc[2]); /* Stroke colour */
+ wxColour cw(255, 255, 255); /* White colour */
+
+
+#line 205 "WxdkdrawControlArrows.cpt"
+
+
+#line 206 "WxdkdrawControlArrows.cpt"
+
+
+#line 207 "WxdkdrawControlArrows.cpt"
+
+
+#line 208 "WxdkdrawControlArrows.cpt"
+
+
+#line 209 "WxdkdrawControlArrows.cpt"
+
+
+#line 210 "WxdkdrawControlArrows.cpt"
+
+
+#line 211 "WxdkdrawControlArrows.cpt"
+
+ plw = LineWidthForObject(pDrw, pObj);
+ wxPen pen(cs, plw, wxPENSTYLE_SOLID);
+ pen.SetCap(wxCAP_ROUND);
+ pen.SetJoin(wxJOIN_MITER);
+ ArrowVertices(pt, pDrw, pObj, xpos, ypos, rot, atype, alength, awidth);
+ switch (atype) {
+ case 1: {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 2: case 23: {
+ wxBrush bru(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 3: case 24: {
+ wxBrush bru(cs);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 4: case 8: case 12: case 16: case 25: {
+ wxBrush bru(cs);
+ wxBrush brv(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ wxGraphicsPath q = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ q.MoveToPoint(pt[0].x, pt[0].y);
+ q.AddLineToPoint(pt[1].x, pt[1].y);
+ q.AddLineToPoint(pt[3].x, pt[3].y);
+ q.AddLineToPoint(pt[0].x, pt[0].y);
+ q.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brv);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(q);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 5: case 9: case 13: case 17: case 26: {
+ wxBrush bru(cs);
+ wxBrush brv(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ wxGraphicsPath q = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ q.MoveToPoint(pt[3].x, pt[3].y);
+ q.AddLineToPoint(pt[1].x, pt[1].y);
+ q.AddLineToPoint(pt[2].x, pt[2].y);
+ q.AddLineToPoint(pt[3].x, pt[3].y);
+ q.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brv);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(q);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 6: case 10: case 14: case 18: {
+ wxBrush bru(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 7: case 11: case 15: case 19: {
+ wxBrush bru(cs);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 20: {
+ wxBrush bru(cs);
+ wxBrush brv(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ wxGraphicsPath q = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ q.MoveToPoint(pt[0].x, pt[0].y);
+ q.AddLineToPoint(pt[1].x, pt[1].y);
+ q.AddLineToPoint(pt[4].x, pt[4].y);
+ q.AddLineToPoint(pt[5].x, pt[5].y);
+ q.AddLineToPoint(pt[0].x, pt[0].y);
+ q.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brv);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(q);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 21: {
+ wxBrush bru(cs);
+ wxBrush brv(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ wxGraphicsPath q = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ q.MoveToPoint(pt[3].x, pt[3].y);
+ q.AddLineToPoint(pt[2].x, pt[2].y);
+ q.AddLineToPoint(pt[4].x, pt[4].y);
+ q.AddLineToPoint(pt[5].x, pt[5].y);
+ q.AddLineToPoint(pt[3].x, pt[3].y);
+ q.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brv);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(q);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 22: {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 27: {
+ wxBrush bru(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddCircle(
+ pt[0].x, pt[0].y,
+ ConvDist(
+ ((double)(pObj->lw) * (double)(pDrw->baselw)
+ * ((double)alength)) / 2.0
+ )
+ );
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 28: {
+ wxBrush bru(cs);
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddCircle(
+ pt[0].x, pt[0].y,
+ ConvDist(
+ ((double)(pObj->lw) * (double)(pDrw->baselw)
+ * ((double)alength)) / 2.0
+ )
+ );
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 29: {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ }
+
+
+#line 464 "WxdkdrawControlArrows.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::AddArrowheads(
+ wxGraphicsContext *gc,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int const *sc,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_xsp_2d_t xsp; /* 2D X-spline */
+ double pa[2]; /* Point A */
+ double pb[2]; /* Point B */
+ double rot; /* Rotation counterclockwise in radians */
+ int32_t i32ShiftX = 0L; /* X shift distance */
+ int32_t i32ShiftY = 0L; /* Y shift distance */
+
+
+#line 484 "WxdkdrawControlArrows.cpt"
+
+ if (NULL != pShift) { i32ShiftX = pShift->x; i32ShiftY = pShift->y; }
+ if ((uint8_t)0 != pObj->aft) {
+ switch (pObj->ot) {
+ case WXD_OT_POLYLINE : {
+ if ((NULL != (pObj->det).p.p) && (1 < (pObj->det).p.n)) {
+ rot = atan2(
+ (
+ (double)(((pObj->det).p.p)[(pObj->det).p.n - 1].y)
+ - (double)(((pObj->det).p.p)[(pObj->det).p.n - 2].y)
+ ),
+ (
+ (double)(((pObj->det).p.p)[(pObj->det).p.n - 1].x)
+ - (double)(((pObj->det).p.p)[(pObj->det).p.n - 2].x)
+ )
+ );
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ (
+ (double)(((pObj->det).p.p)[(pObj->det).p.n-1].x)
+ + (double)i32ShiftX
+ ),
+ (
+ (double)(((pObj->det).p.p)[(pObj->det).p.n-1].y)
+ + (double)i32ShiftY
+ ),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if ((NULL != (pObj->det).s.p) && (2 <= (pObj->det).s.n)) {
+ dk4xsp2d_reset(&xsp);
+ dk4xsp2d_reset_points(&xsp);
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[(pObj->det).s.n - 3].x,
+ ((pObj->det).s.p)[(pObj->det).s.n - 3].y,
+ ((pObj->det).s.p)[(pObj->det).s.n - 3].s,
+ 0
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[(pObj->det).s.n - 2].x,
+ ((pObj->det).s.p)[(pObj->det).s.n - 2].y,
+ ((pObj->det).s.p)[(pObj->det).s.n - 2].s,
+ 1
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[(pObj->det).s.n - 1].x,
+ ((pObj->det).s.p)[(pObj->det).s.n - 1].y,
+ ((pObj->det).s.p)[(pObj->det).s.n - 1].s,
+ 2
+ );
+ if (0 != dk4xsp2d_calculate_value(pb, &xsp, 1.0, NULL)) {
+ if (0 != dk4xsp2d_calculate_value(pa,&xsp,0.95,NULL)) {
+ rot = atan2((pb[1]-pa[1]), (pb[0]-pa[0]));
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ (pb[0] + (double)i32ShiftX),
+ (pb[1] + (double)i32ShiftY),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : {
+ if ((int8_t)0 != (pObj->det).a.d) {
+ if ((int8_t)0 < (pObj->det).a.d) {
+ rot = (pObj->det).a.b + M_PI_2;
+ }
+ else {
+ rot = (pObj->det).a.b - M_PI_2;
+ }
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ ((double)((pObj->det).a.x3) + (double)i32ShiftX),
+ ((double)((pObj->det).a.y3) + (double)i32ShiftY),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ else {
+ if (
+ ((pObj->det).a.x3 != (pObj->det).a.x2)
+ || ((pObj->det).a.y3 != (pObj->det).a.y2)
+ ) {
+ rot = atan2(
+ (
+ (double)((pObj->det).a.y3)
+ - (double)((pObj->det).a.y2)
+ ),
+ (
+ (double)((pObj->det).a.x3)
+ - (double)((pObj->det).a.x2)
+ )
+ );
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ ((double)((pObj->det).a.x3)+(double)i32ShiftX),
+ ((double)((pObj->det).a.y3)+(double)i32ShiftY),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ }
+ }
+ } break;
+ }
+ }
+ if ((uint8_t)0 != pObj->abt) {
+ switch (pObj->ot) {
+ case WXD_OT_POLYLINE : {
+ if ((NULL != (pObj->det).p.p) && (1 < (pObj->det).p.n)) {
+ rot = atan2(
+ (
+ (double)(((pObj->det).p.p)[0].y)
+ - (double)(((pObj->det).p.p)[1].y)
+ ),
+ (
+ (double)(((pObj->det).p.p)[0].x)
+ - (double)(((pObj->det).p.p)[1].x)
+ )
+ );
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ (
+ ((pObj->det).p.p)[0].x
+ + i32ShiftX
+ ),
+ (
+ ((pObj->det).p.p)[0].y
+ + i32ShiftY
+ ),
+ rot, pObj->abt, pObj->abl, pObj->abw
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if ((NULL != (pObj->det).s.p) && (2 <= (pObj->det).s.n)) {
+
+ dk4xsp2d_reset(&xsp);
+ dk4xsp2d_reset_points(&xsp);
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[0].x,
+ ((pObj->det).s.p)[0].y,
+ ((pObj->det).s.p)[0].s,
+ 1
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[1].x,
+ ((pObj->det).s.p)[1].y,
+ ((pObj->det).s.p)[1].s,
+ 2
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[2].x,
+ ((pObj->det).s.p)[2].y,
+ ((pObj->det).s.p)[2].s,
+ 3
+ );
+ if (0 != dk4xsp2d_calculate_value(pb, &xsp, 0.0, NULL)) {
+ if (0 != dk4xsp2d_calculate_value(pa,&xsp,0.05,NULL)) {
+ rot = atan2((pb[1]-pa[1]), (pb[0]-pa[0]));
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ (pb[0] + (double)i32ShiftX),
+ (pb[1] + (double)i32ShiftY),
+ rot, pObj->abt, pObj->abl, pObj->abw
+ );
+ }
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : {
+ if ((int8_t)0 != (pObj->det).a.d) {
+ if ((int8_t)0 < (pObj->det).a.d) {
+ rot = (pObj->det).a.a - M_PI_2;
+ }
+ else {
+ rot = (pObj->det).a.a + M_PI_2;
+ }
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ ((double)((pObj->det).a.x1)+(double)i32ShiftX),
+ ((double)((pObj->det).a.y1)+(double)i32ShiftY),
+ rot, pObj->abt, pObj->abl, pObj->abw
+ );
+ }
+ else {
+ if (
+ ((pObj->det).a.x1 != (pObj->det).a.x2)
+ || ((pObj->det).a.y1 != (pObj->det).a.y2)
+ ) {
+ rot = atan2(
+ (
+ (double)((pObj->det).a.y1)
+ - (double)((pObj->det).a.y2)
+ ),
+ (
+ (double)((pObj->det).a.x1)
+ - (double)((pObj->det).a.x2)
+ )
+ );
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ ((double)((pObj->det).a.x1)+(double)i32ShiftX),
+ ((double)((pObj->det).a.y1)+(double)i32ShiftY),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ }
+ }
+ } break;
+ }
+ }
+
+
+#line 714 "WxdkdrawControlArrows.cpt"
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawControlArrows.cpt b/support/dktools/WxdkdrawControlArrows.cpt
new file mode 100644
index 0000000000..ec194136c2
--- /dev/null
+++ b/support/dktools/WxdkdrawControlArrows.cpt
@@ -0,0 +1,718 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% module
+
+/* This module contains the methods to draw the arrowheads.
+*/
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+void
+WxdkdrawFrame::Control::ArrowVertices(
+ dk4_gra_point_t *pt,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ double xpos,
+ double ypos,
+ double rot,
+ uint8_t atype,
+ uint8_t alength,
+ uint8_t awidth
+)
+{
+ double lw; /* Line width */
+ double l; /* Arrowhead length */
+ double w; /* Arrowhead width */
+ double w2; /* Half arrowhead width */
+ size_t szUsed = 0; /* Number of elements used in pt array */
+ size_t i; /* Traverse pt array */
+ $? "+ ArrowVertices"
+ if ((1 <= atype) && (29 >= atype)) {
+ lw = (double)(pObj->lw) * (double)(pDrw->baselw);
+ l = lw * ((double)alength);
+ w = lw * ((double)awidth);
+ w2 = w / 2.0;
+ switch (atype) {
+ case 1: case 2: case 3: {
+ szUsed = 3;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - l;
+ pt[2].y = 0.0 - w2;
+ } break;
+ case 4: case 5: {
+ szUsed = 4;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - l;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0;
+ } break;
+ case 6: case 7: case 8: case 9: {
+ szUsed = 4;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - l;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - 0.75 * l;
+ pt[3].y = 0.0;
+ } break;
+ case 10: case 11: case 12: case 13: {
+ szUsed = 4;
+ pt[0].x = 0.0 - 0.75 * l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - 0.75 * l;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0;
+ } break;
+ case 14: case 15: case 16: case 17: {
+ szUsed = 4;
+ pt[0].x = 0.0 - 0.5 * l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0 - 0.5 * l;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0;
+ } break;
+ case 18: case 19: case 22: {
+ szUsed = 4;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = w2;
+ pt[2].x = 0.0;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0 - w2;
+ } break;
+ case 20: case 21: {
+ szUsed = 6;
+ pt[0].x = 0.0 - l;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = w2;
+ pt[2].x = 0.0;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0 - l;
+ pt[3].y = 0.0 - w2;
+ pt[4].x = 0.0;
+ pt[4].y = 0.0;
+ pt[5].x = 0.0 - l;
+ pt[5].y = 0.0;
+ } break;
+ case 23: case 24: {
+ szUsed = 3;
+ pt[0].x = 0.0;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0 - w2;
+ pt[2].x = 0.0 - l;
+ pt[2].y = 0.0;
+ } break;
+ case 25: case 26: {
+ szUsed = 4;
+ pt[0].x = 0.0;
+ pt[0].y = w2;
+ pt[1].x = 0.0 - l;
+ pt[1].y = 0.0;
+ pt[2].x = 0.0;
+ pt[2].y = 0.0 - w2;
+ pt[3].x = 0.0;
+ pt[3].y = 0.0;
+ } break;
+ case 27: case 28: {
+ szUsed = 1;
+ pt[0].x = 0.0 - (l / 2.0);
+ pt[0].y = 0.0;
+ } break;
+ case 29: {
+ szUsed = 2;
+ pt[0].x = 0.0;
+ pt[0].y = w2;
+ pt[1].x = 0.0;
+ pt[1].y = 0.0 - w2;
+ } break;
+ }
+ /* Finally:
+ - Rotate all points
+ - Shift points to position
+ - Translate WXD coordinates to pixel coordinates
+ */
+ for (i = 0; i < szUsed; i++) {
+ dk4gratool_rotate_point(&(pt[i]), rot);
+ pt[i].x += xpos;
+ pt[i].y += ypos;
+ pt[i].x = ConvX(pt[i].x);
+ pt[i].y = ConvY(pt[i].y);
+ }
+ }
+ $? "- ArrowVertices"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawOneArrowhead(
+ wxGraphicsContext *gc,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int const *sc,
+ double xpos,
+ double ypos,
+ double rot,
+ uint8_t atype,
+ uint8_t alength,
+ uint8_t awidth
+)
+{
+ dk4_gra_point_t pt[8]; /* Vertices coordinates in pixels */
+ int plw; /* Pen line width */
+
+ wxColour cs(sc[0], sc[1], sc[2]); /* Stroke colour */
+ wxColour cw(255, 255, 255); /* White colour */
+ $? "+ DrawOneArrowhead"
+ $? ". xpos = %g", xpos
+ $? ". ypos = %g", ypos
+ $? ". angle = %g", rot
+ $? ". type = %d", (int)atype
+ $? ". length = %d", (int)alength
+ $? ". width = %d", (int)awidth
+
+ plw = LineWidthForObject(pDrw, pObj);
+ wxPen pen(cs, plw, wxPENSTYLE_SOLID);
+ pen.SetCap(wxCAP_ROUND);
+ pen.SetJoin(wxJOIN_MITER);
+ ArrowVertices(pt, pDrw, pObj, xpos, ypos, rot, atype, alength, awidth);
+ switch (atype) {
+ case 1: {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 2: case 23: {
+ wxBrush bru(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 3: case 24: {
+ wxBrush bru(cs);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 4: case 8: case 12: case 16: case 25: {
+ wxBrush bru(cs);
+ wxBrush brv(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ wxGraphicsPath q = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ q.MoveToPoint(pt[0].x, pt[0].y);
+ q.AddLineToPoint(pt[1].x, pt[1].y);
+ q.AddLineToPoint(pt[3].x, pt[3].y);
+ q.AddLineToPoint(pt[0].x, pt[0].y);
+ q.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brv);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(q);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 5: case 9: case 13: case 17: case 26: {
+ wxBrush bru(cs);
+ wxBrush brv(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ wxGraphicsPath q = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ q.MoveToPoint(pt[3].x, pt[3].y);
+ q.AddLineToPoint(pt[1].x, pt[1].y);
+ q.AddLineToPoint(pt[2].x, pt[2].y);
+ q.AddLineToPoint(pt[3].x, pt[3].y);
+ q.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brv);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(q);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 6: case 10: case 14: case 18: {
+ wxBrush bru(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 7: case 11: case 15: case 19: {
+ wxBrush bru(cs);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 20: {
+ wxBrush bru(cs);
+ wxBrush brv(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ wxGraphicsPath q = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ q.MoveToPoint(pt[0].x, pt[0].y);
+ q.AddLineToPoint(pt[1].x, pt[1].y);
+ q.AddLineToPoint(pt[4].x, pt[4].y);
+ q.AddLineToPoint(pt[5].x, pt[5].y);
+ q.AddLineToPoint(pt[0].x, pt[0].y);
+ q.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brv);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(q);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 21: {
+ wxBrush bru(cs);
+ wxBrush brv(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ wxGraphicsPath q = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ p.AddLineToPoint(pt[0].x, pt[0].y);
+ p.CloseSubpath();
+ q.MoveToPoint(pt[3].x, pt[3].y);
+ q.AddLineToPoint(pt[2].x, pt[2].y);
+ q.AddLineToPoint(pt[4].x, pt[4].y);
+ q.AddLineToPoint(pt[5].x, pt[5].y);
+ q.AddLineToPoint(pt[3].x, pt[3].y);
+ q.CloseSubpath();
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brv);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(q);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 22: {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ p.AddLineToPoint(pt[2].x, pt[2].y);
+ p.AddLineToPoint(pt[3].x, pt[3].y);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 27: {
+ wxBrush bru(cw);
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddCircle(
+ pt[0].x, pt[0].y,
+ ConvDist(
+ ((double)(pObj->lw) * (double)(pDrw->baselw)
+ * ((double)alength)) / 2.0
+ )
+ );
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 28: {
+ wxBrush bru(cs);
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddCircle(
+ pt[0].x, pt[0].y,
+ ConvDist(
+ ((double)(pObj->lw) * (double)(pDrw->baselw)
+ * ((double)alength)) / 2.0
+ )
+ );
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ case 29: {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(pt[0].x, pt[0].y);
+ p.AddLineToPoint(pt[1].x, pt[1].y);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ } break;
+ }
+ $? "- DrawOneArrowhead"
+}
+
+
+
+void
+WxdkdrawFrame::Control::AddArrowheads(
+ wxGraphicsContext *gc,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int const *sc,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_xsp_2d_t xsp; /* 2D X-spline */
+ double pa[2]; /* Point A */
+ double pb[2]; /* Point B */
+ double rot; /* Rotation counterclockwise in radians */
+ int32_t i32ShiftX = 0L; /* X shift distance */
+ int32_t i32ShiftY = 0L; /* Y shift distance */
+ $? "+ AddArrowheads"
+
+ if (NULL != pShift) { i32ShiftX = pShift->x; i32ShiftY = pShift->y; }
+ if ((uint8_t)0 != pObj->aft) {
+ switch (pObj->ot) {
+ case WXD_OT_POLYLINE : {
+ if ((NULL != (pObj->det).p.p) && (1 < (pObj->det).p.n)) {
+ rot = atan2(
+ (
+ (double)(((pObj->det).p.p)[(pObj->det).p.n - 1].y)
+ - (double)(((pObj->det).p.p)[(pObj->det).p.n - 2].y)
+ ),
+ (
+ (double)(((pObj->det).p.p)[(pObj->det).p.n - 1].x)
+ - (double)(((pObj->det).p.p)[(pObj->det).p.n - 2].x)
+ )
+ );
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ (
+ (double)(((pObj->det).p.p)[(pObj->det).p.n-1].x)
+ + (double)i32ShiftX
+ ),
+ (
+ (double)(((pObj->det).p.p)[(pObj->det).p.n-1].y)
+ + (double)i32ShiftY
+ ),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if ((NULL != (pObj->det).s.p) && (2 <= (pObj->det).s.n)) {
+ dk4xsp2d_reset(&xsp);
+ dk4xsp2d_reset_points(&xsp);
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[(pObj->det).s.n - 3].x,
+ ((pObj->det).s.p)[(pObj->det).s.n - 3].y,
+ ((pObj->det).s.p)[(pObj->det).s.n - 3].s,
+ 0
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[(pObj->det).s.n - 2].x,
+ ((pObj->det).s.p)[(pObj->det).s.n - 2].y,
+ ((pObj->det).s.p)[(pObj->det).s.n - 2].s,
+ 1
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[(pObj->det).s.n - 1].x,
+ ((pObj->det).s.p)[(pObj->det).s.n - 1].y,
+ ((pObj->det).s.p)[(pObj->det).s.n - 1].s,
+ 2
+ );
+ if (0 != dk4xsp2d_calculate_value(pb, &xsp, 1.0, NULL)) {
+ if (0 != dk4xsp2d_calculate_value(pa,&xsp,0.95,NULL)) {
+ rot = atan2((pb[1]-pa[1]), (pb[0]-pa[0]));
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ (pb[0] + (double)i32ShiftX),
+ (pb[1] + (double)i32ShiftY),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : {
+ if ((int8_t)0 != (pObj->det).a.d) {
+ if ((int8_t)0 < (pObj->det).a.d) {
+ rot = (pObj->det).a.b + M_PI_2;
+ }
+ else {
+ rot = (pObj->det).a.b - M_PI_2;
+ }
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ ((double)((pObj->det).a.x3) + (double)i32ShiftX),
+ ((double)((pObj->det).a.y3) + (double)i32ShiftY),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ else {
+ if (
+ ((pObj->det).a.x3 != (pObj->det).a.x2)
+ || ((pObj->det).a.y3 != (pObj->det).a.y2)
+ ) {
+ rot = atan2(
+ (
+ (double)((pObj->det).a.y3)
+ - (double)((pObj->det).a.y2)
+ ),
+ (
+ (double)((pObj->det).a.x3)
+ - (double)((pObj->det).a.x2)
+ )
+ );
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ ((double)((pObj->det).a.x3)+(double)i32ShiftX),
+ ((double)((pObj->det).a.y3)+(double)i32ShiftY),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ }
+ }
+ } break;
+ }
+ }
+ if ((uint8_t)0 != pObj->abt) {
+ switch (pObj->ot) {
+ case WXD_OT_POLYLINE : {
+ if ((NULL != (pObj->det).p.p) && (1 < (pObj->det).p.n)) {
+ rot = atan2(
+ (
+ (double)(((pObj->det).p.p)[0].y)
+ - (double)(((pObj->det).p.p)[1].y)
+ ),
+ (
+ (double)(((pObj->det).p.p)[0].x)
+ - (double)(((pObj->det).p.p)[1].x)
+ )
+ );
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ (
+ ((pObj->det).p.p)[0].x
+ + i32ShiftX
+ ),
+ (
+ ((pObj->det).p.p)[0].y
+ + i32ShiftY
+ ),
+ rot, pObj->abt, pObj->abl, pObj->abw
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if ((NULL != (pObj->det).s.p) && (2 <= (pObj->det).s.n)) {
+
+ dk4xsp2d_reset(&xsp);
+ dk4xsp2d_reset_points(&xsp);
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[0].x,
+ ((pObj->det).s.p)[0].y,
+ ((pObj->det).s.p)[0].s,
+ 1
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[1].x,
+ ((pObj->det).s.p)[1].y,
+ ((pObj->det).s.p)[1].s,
+ 2
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ ((pObj->det).s.p)[2].x,
+ ((pObj->det).s.p)[2].y,
+ ((pObj->det).s.p)[2].s,
+ 3
+ );
+ if (0 != dk4xsp2d_calculate_value(pb, &xsp, 0.0, NULL)) {
+ if (0 != dk4xsp2d_calculate_value(pa,&xsp,0.05,NULL)) {
+ rot = atan2((pb[1]-pa[1]), (pb[0]-pa[0]));
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ (pb[0] + (double)i32ShiftX),
+ (pb[1] + (double)i32ShiftY),
+ rot, pObj->abt, pObj->abl, pObj->abw
+ );
+ }
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : {
+ if ((int8_t)0 != (pObj->det).a.d) {
+ if ((int8_t)0 < (pObj->det).a.d) {
+ rot = (pObj->det).a.a - M_PI_2;
+ }
+ else {
+ rot = (pObj->det).a.a + M_PI_2;
+ }
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ ((double)((pObj->det).a.x1)+(double)i32ShiftX),
+ ((double)((pObj->det).a.y1)+(double)i32ShiftY),
+ rot, pObj->abt, pObj->abl, pObj->abw
+ );
+ }
+ else {
+ if (
+ ((pObj->det).a.x1 != (pObj->det).a.x2)
+ || ((pObj->det).a.y1 != (pObj->det).a.y2)
+ ) {
+ rot = atan2(
+ (
+ (double)((pObj->det).a.y1)
+ - (double)((pObj->det).a.y2)
+ ),
+ (
+ (double)((pObj->det).a.x1)
+ - (double)((pObj->det).a.x2)
+ )
+ );
+ if (0 != dk4ma_is_finite(rot)) {
+ DrawOneArrowhead(
+ gc, pDrw, pObj, sc,
+ ((double)((pObj->det).a.x1)+(double)i32ShiftX),
+ ((double)((pObj->det).a.y1)+(double)i32ShiftY),
+ rot, pObj->aft, pObj->afl, pObj->afw
+ );
+ }
+ }
+ }
+ } break;
+ }
+ }
+ $? "- AddArrowheads"
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawControlDraw.cpp b/support/dktools/WxdkdrawControlDraw.cpp
new file mode 100644
index 0000000000..fb398df3a8
--- /dev/null
+++ b/support/dktools/WxdkdrawControlDraw.cpp
@@ -0,0 +1,3554 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawControlDraw.cpt
+*/
+
+/** @file WxdkdrawControlDraw.cpp The WxdkdrawControlDraw module.
+*/
+
+
+#line 10 "WxdkdrawControlDraw.cpt"
+
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+
+#line 24 "WxdkdrawControlDraw.cpt"
+
+
+
+double
+WxdkdrawFrame::Control::MarkupPointRadius(uint16_t lw)
+{
+ double back;
+ double max;
+ /* 2019-05-18 Modification
+ For texts (linewidth is 0) use same size as for a linewidth 2 line
+ */
+ if ((uint16_t)0U == lw) {
+ lw = (uint16_t)2U;
+ }
+ if ((uint16_t)12U >= lw) {
+ back = 1.75 * (double)(m_pParent->m_pDrw->baselw) * (double)lw;
+ }
+ else {
+ back =
+ (15.0 + 0.5 * ((double)lw)) * (double)(m_pParent->m_pDrw->baselw);
+ }
+
+ /* 2020-03-21 Modification
+ For moving, adding and deleting points the point markups should
+ not overlap
+ */
+ if (0 != m_pParent->m_iv[IVI_REDUCE_MARKUP_POINTS]) {
+ switch (m_pParent->m_iState) {
+ case S_MOVEPT_SELECT : case S_ADDPT_SELECT :
+ case S_DELPT : case S_MOD_SPLINE :
+ {
+ max = (double)m_uGridSnap / 2.0;
+ if (back > max) {
+ back = max;
+ }
+ } break;
+ }
+ }
+
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawMarkupPoint(
+ wxGraphicsContext *gc,
+ int const *sc,
+ double x,
+ double y,
+ uint16_t lw,
+ Wxd_point_t const *pShift
+)
+{
+ double r; /* Half side length of markup square */
+ int32_t shiftx = 0L; /* X shift distance */
+ int32_t shifty = 0L; /* Y shift distance */
+
+
+#line 82 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ x = ConvX(x + (double)shiftx);
+ y = ConvY(y + (double)shifty);
+ r = ConvDist(MarkupPointRadius(lw));
+ wxColour fc(sc[0], sc[1], sc[2]);
+ wxBrush br(fc);
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint((x - r), (y - r));
+ p1.AddLineToPoint((x + r), (y - r));
+ p1.AddLineToPoint((x + r), (y + r));
+ p1.AddLineToPoint((x - r), (y + r));
+ p1.AddLineToPoint((x - r), (y - r));
+ p1.CloseSubpath();
+ gc->FillPath(p1);
+ gc->SetBrush(wxNullBrush);
+
+
+#line 100 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawMarkupPoint(
+ wxGraphicsContext *gc,
+ int const *sc,
+ int32_t x,
+ int32_t y,
+ uint16_t lw,
+ Wxd_point_t const *pShift
+)
+{
+
+
+#line 115 "WxdkdrawControlDraw.cpt"
+ DrawMarkupPoint(gc, sc, (double)x, (double)y, lw, pShift);
+
+
+#line 117 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+bool
+WxdkdrawFrame::Control::StateHasObjectsUnderModification(void)
+{
+ bool back = false;
+
+
+#line 126 "WxdkdrawControlDraw.cpt"
+ /*
+ _STATE_ Do we have objects under modification which must
+ be drawn in markup pass?
+ */
+ switch (m_pParent->m_iState) {
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FURTHER :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ case S_DETAILS_2 :
+ {
+ back = true;
+ } break;
+ }
+
+
+#line 149 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::StateHasObjectsToHighlight(void)
+{
+ bool back = false;
+
+
+#line 159 "WxdkdrawControlDraw.cpt"
+ /*
+ _STATE_ Do we have object to highlight?
+ */
+ switch ( m_pParent->m_iState ) {
+ case S_NOOP : {
+
+#line 164 "WxdkdrawControlDraw.cpt"
+ back = true;
+ } break;
+ case S_DELETE :
+ case S_REGION_DELETE :
+ case S_MOVE_SELECT :
+ case S_COPY_SELECT :
+ case S_MOVEPT_SELECT :
+ case S_DELPT :
+ case S_ADDPT_SELECT :
+ case S_FLIP :
+ case S_GROUP_ONE :
+ case S_UNGROUP :
+ case S_DETAILS :
+ case S_CONVERT :
+ case S_ROTATE :
+ case S_MOD_SPLINE :
+ {
+ back = true;
+ } break;
+ }
+
+
+#line 185 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::StateHasObjectsToHighlight2(void)
+{
+ bool back = false;
+
+
+#line 195 "WxdkdrawControlDraw.cpt"
+ switch (m_pParent->m_iState) {
+ /*
+ _STATE_ State has object to mark for grouping
+ */
+ case S_GROUP_ONE :
+ case S_GROUP_RECT_2 : {
+ back = true;
+ } break;
+ }
+
+
+#line 205 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::StateUsesPlacementHelp(void)
+{
+ bool back = false;
+
+
+#line 215 "WxdkdrawControlDraw.cpt"
+ /*
+ _STATE_ Does state use placement help?
+ */
+ switch (m_pParent->m_iState) {
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_POLY_FIRST :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FIRST :
+ case S_SPLINE_FURTHER :
+ case S_BOX_FIRST :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_CENTER :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CENTER :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_1 :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_DOT :
+ case S_TEXT :
+ case S_IMG_1 :
+ case S_IMG_2 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ case S_DRWSZ_PLACE :
+ case S_GROUP_RECT_1 :
+ case S_DELETE :
+ {
+ back = true;
+ } break;
+ }
+
+
+#line 249 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::CanDrawElement(Wxd_object_t const *pobj)
+{
+ bool back = true;
+
+
+#line 259 "WxdkdrawControlDraw.cpt"
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : {
+
+#line 261 "WxdkdrawControlDraw.cpt"
+ if (NULL == (pobj->det).t.t) {
+
+#line 262 "WxdkdrawControlDraw.cpt"
+ back = false;
+ }
+ if (0U == (pobj->det).t.fsz) {
+
+#line 265 "WxdkdrawControlDraw.cpt"
+ back = false;
+ }
+ if (NULL == (pobj->det).t.font) {
+
+#line 268 "WxdkdrawControlDraw.cpt"
+ back = false;
+ }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if (NULL == (pobj->det).p.p) { back = false; }
+ if (2U > (pobj->det).p.n) { back = false; }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if (NULL == (pobj->det).s.p) { back = false; }
+ if (2U > (pobj->det).s.n) { back = false; }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ } break;
+ case WXD_OT_CIRCLE : {
+ if (0U == (pobj->det).e.rx) { back = false; }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ if (0U == (pobj->det).e.rx) { back = false; }
+ if (0U == (pobj->det).e.ry) { back = false; }
+ } break;
+ case WXD_OT_BOX : {
+ } break;
+ case WXD_OT_IMAGE : {
+ if (NULL == (pobj->det).i.fn) { back = false; }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ if (0U == (pobj->det).d.d) { back = false; }
+ } break;
+ }
+
+
+#line 298 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::MustDrawElementInNormalPass(
+ Wxd_object_t const *pobj
+)
+{
+ bool back = true;
+
+
+#line 310 "WxdkdrawControlDraw.cpt"
+ /*
+ _STATE_ Do we need to draw object in normal drawing pass?
+ */
+ switch (m_pParent->m_iState) {
+ case S_MOVE_PLACE :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FURTHER :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ case S_DETAILS_2 :
+ {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ back = false;
+ }
+ } break;
+ }
+
+
+#line 333 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::MustDrawElementInMarkupPass(
+ Wxd_object_t const *pobj
+)
+{
+ bool back = false;
+
+
+#line 345 "WxdkdrawControlDraw.cpt"
+ /*
+ _STATE_ Do we need to draw object in markup pass?
+ */
+ switch (m_pParent->m_iState) {
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FURTHER :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ case S_DETAILS_2 :
+ {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ back = true;
+ }
+ } break;
+ }
+
+
+#line 369 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::MustHighlightElementInMarkupPass(
+ Wxd_object_t const *pobj
+)
+{
+ bool back = false;
+
+
+#line 381 "WxdkdrawControlDraw.cpt"
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ /*
+ _STATE_ Do we need to highlight object in markup pass?
+ */
+ switch (m_pParent->m_iState) {
+ case S_NOOP : {
+ back = true;
+ } break;
+ case S_DELETE :
+ case S_REGION_DELETE :
+ case S_MOVE_SELECT :
+ case S_COPY_SELECT :
+ case S_MOVEPT_SELECT :
+ case S_DELPT :
+ case S_ADDPT_SELECT :
+ case S_FLIP :
+ case S_GROUP_ONE :
+ case S_UNGROUP :
+ case S_DETAILS :
+ case S_CONVERT :
+ case S_ROTATE :
+ case S_MOD_SPLINE :
+ {
+ back = true;
+ } break;
+ }
+ }
+
+
+#line 409 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::MustHighlight2ElementInMarkupPass(
+ Wxd_object_t const *pobj
+)
+{
+ bool back = false;
+
+
+#line 421 "WxdkdrawControlDraw.cpt"
+ /*
+ _STATE_ : Must highlight element with marker 2 in markup pass
+ */
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_2)) {
+ switch (m_pParent->m_iState) {
+ case S_GROUP_ONE :
+ case S_GROUP_RECT_2 :
+ {
+ back = true;
+ } break;
+ }
+ }
+
+
+#line 434 "WxdkdrawControlDraw.cpt"
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::Control::ChooseStrokeColour(
+ int *sc,
+ Wxd_object_t const *pObj,
+ int iMarkup
+)
+{
+ unsigned i;
+
+
+#line 448 "WxdkdrawControlDraw.cpt"
+ switch (iMarkup) {
+ case WXD_MARKUP_COPY : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_COPY_RED]),(3*sizeof(int)));
+ } break;
+ case WXD_MARKUP_MOVE : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_MOVE_RED]),(3*sizeof(int)));
+ } break;
+ case WXD_MARKUP_DELETE : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_DEL_RED]),(3*sizeof(int)));
+ } break;
+ case WXD_MARKUP_GROUP : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_GROUP_RED]),(3*sizeof(int)));
+ } break;
+ case WXD_MARKUP_PTMOVE : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_MOVE_RED]),(3*sizeof(int)));
+ for (i = 0; i < 3; i++) {
+ sc[i] = (sc[i] + 2 * 255) / 3;
+ }
+ } break;
+ case WXD_MARKUP_IMGRES : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_MOVE_RED]),(3*sizeof(int)));
+ } break;
+ default : {
+ sc[0] = (int)(pObj->sc[0]);
+ sc[1] = (int)(pObj->sc[1]);
+ sc[2] = (int)(pObj->sc[2]);
+ } break;
+ }
+
+
+#line 477 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::SetupPenForObject(
+ wxPen & pen,
+ Wxd_object_t const *pObj,
+ wxDash *pDash,
+ int *pNdash
+)
+{
+
+
+#line 490 "WxdkdrawControlDraw.cpt"
+ if (WXD_LS_SOLID != pObj->ls) {
+ int ldash = (int)(pObj->sl);
+ int ldots = 1;
+ int lgaps = ((3 < ldash) ? (2) : (1));
+ if (WXD_LS_DOT == pObj->ls) {
+ lgaps = ldots;
+ }
+ switch (pObj->cs) {
+ case WXD_LC_PROJECTING : case WXD_LC_ROUNDED : {
+ ldots = 0;
+ lgaps++;
+ } break;
+ }
+ switch (pObj->ls) {
+ case WXD_LS_DASH_DOT_DOT_DOT : {
+ pDash[0] = ldash;
+ pDash[1] = lgaps;
+ pDash[2] = ldots;
+ pDash[3] = lgaps;
+ pDash[4] = ldots;
+ pDash[5] = lgaps;
+ pDash[6] = ldots;
+ pDash[7] = lgaps;
+ *pNdash = 8;
+ } break;
+ case WXD_LS_DASH_DOT_DOT : {
+ pDash[0] = ldash;
+ pDash[1] = lgaps;
+ pDash[2] = ldots;
+ pDash[3] = lgaps;
+ pDash[4] = ldots;
+ pDash[5] = lgaps;
+ *pNdash = 6;
+ } break;
+ case WXD_LS_DASH_DOT : {
+ pDash[0] = ldash;
+ pDash[1] = lgaps;
+ pDash[2] = ldots;
+ pDash[3] = lgaps;
+ *pNdash = 4;
+ } break;
+ case WXD_LS_DOT : {
+ pDash[0] = ldots;
+ pDash[1] = lgaps;
+ *pNdash = 2;
+ } break;
+ default : { /* dash */
+ pDash[0] = ldash;
+ pDash[1] = lgaps;
+ *pNdash = 2;
+ } break;
+ }
+
+#line 542 "WxdkdrawControlDraw.cpt"
+ pen.SetStyle(wxPENSTYLE_USER_DASH);
+ pen.SetDashes(*pNdash, pDash);
+
+ }
+ else {
+ }
+ switch (pObj->cs) {
+ case WXD_LC_PROJECTING : {
+
+#line 550 "WxdkdrawControlDraw.cpt"
+ pen.SetCap(wxCAP_PROJECTING);
+ } break;
+ case WXD_LC_ROUNDED : {
+
+#line 553 "WxdkdrawControlDraw.cpt"
+ pen.SetCap(wxCAP_ROUND);
+ } break;
+ default : {
+
+#line 556 "WxdkdrawControlDraw.cpt"
+ pen.SetCap(wxCAP_BUTT);
+ } break;
+ }
+ switch ( (int)(pObj->ot) ) {
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ pen.SetJoin(wxJOIN_ROUND);
+ } break;
+ default : {
+ switch (pObj->js) {
+ case WXD_LJ_BEVELED : {
+
+#line 567 "WxdkdrawControlDraw.cpt"
+ pen.SetJoin(wxJOIN_BEVEL);
+ } break;
+ case WXD_LJ_ROUNDED : {
+
+#line 570 "WxdkdrawControlDraw.cpt"
+ pen.SetJoin(wxJOIN_ROUND);
+ } break;
+ default : {
+
+#line 573 "WxdkdrawControlDraw.cpt"
+ pen.SetJoin(wxJOIN_MITER);
+ } break;
+ }
+ } break;
+ }
+
+
+#line 579 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawTextElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour */
+ wxChar const *t = NULL; /* Text to show */
+ wxDouble tw(0.0); /* Text width in pixels */
+ wxDouble th(0.0); /* Text height in pixels */
+ wxDouble td(0.0); /* Text descender in pixels */
+ wxDouble el(0.0); /* External leader in pixels */
+ double w; /* Text width in pixels */
+ double h; /* Text height in pixels */
+ double d; /* Text descender in pixels */
+ double x; /* Text x position */
+ double y; /* Text y position */
+ double alpha; /* Text rotation in radians */
+ int32_t shiftx; /* X shift */
+ int32_t shifty; /* Y shift */
+
+
+#line 606 "WxdkdrawControlDraw.cpt"
+ shiftx = 0L;
+ shifty = 0L;
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ t = (
+ (NULL != (pObj->det).t.tsc) ? ((pObj->det).t.tsc) : ((pObj->det).t.t)
+ );
+ if ((NULL != t) && ((uint16_t)0 < (pObj->det).t.fsz)) {
+ alpha = ((double)((pObj->det).t.a) * M_PI) / 180.0;
+ if (NULL != (pObj->det).t.font) {
+ if (NULL != ((pObj->det).t.font)->font) {
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ wxColour fcol(sc[0], sc[1], sc[2]);
+ gc->SetFont(*(((pObj->det).t.font)->font), fcol);
+ gc->GetTextExtent(t, &tw, &th, &td, &el);
+ w = (double)tw; h = (double)th; d = (double)td;
+ x = ConvX((pObj->det).t.x + shiftx);
+ y = ConvY((pObj->det).t.y + shifty);
+ if ((int16_t)0 != (pObj->det).t.a) {
+ switch ((pObj->det).t.al) {
+ case WXD_TA_RIGHT : {
+ x -= (w * cos(alpha));
+ y += (w * sin(alpha));
+ } break;
+ case WXD_TA_CENTERED : {
+ x -= ((w * cos(alpha)) / 2.0);
+ y += ((w * sin(alpha)) / 2.0);
+ } break;
+ }
+ x += ((d - h) * sin(alpha));
+ y += ((d - h) * cos(alpha));
+ gc->DrawText(t, x, y, alpha);
+ }
+ else {
+ switch ((pObj->det).t.al) {
+ case WXD_TA_RIGHT : {
+ x -= w;
+ } break;
+ case WXD_TA_CENTERED : {
+ x -= (w / 2.0);
+ } break;
+ }
+ y += (d - h);
+ gc->DrawText(t, x, y);
+ }
+ gc->SetFont(wxNullFont, wxNullColour);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ DrawMarkupPoint(
+ gc, sc, (pObj->det).t.x, (pObj->det).t.y, 0U, pShift
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 659 "WxdkdrawControlDraw.cpt"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 664 "WxdkdrawControlDraw.cpt"
+ }
+#endif
+ }
+
+
+#line 668 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathPolyline(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ uint16_t i; /* Current point index */
+
+
+#line 683 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ for (i = 0U; i < (pObj->det).p.n; i++) {
+ if (0U == i) {
+ p.MoveToPoint(
+ ConvX((double)(((pObj->det).p.p)[i].x) + shiftx),
+ ConvY((double)(((pObj->det).p.p)[i].y) + shifty)
+ );
+ }
+ else {
+ p.AddLineToPoint(
+ ConvX((double)(((pObj->det).p.p)[i].x) + shiftx),
+ ConvY((double)(((pObj->det).p.p)[i].y) + shifty)
+ );
+ }
+ }
+ if (WXD_OT_POLYGON == pObj->ot) {
+ p.AddLineToPoint(
+ ConvX((double)(((pObj->det).p.p)[0].x) + shiftx),
+ ConvY((double)(((pObj->det).p.p)[0].y) + shifty)
+ );
+ p.CloseSubpath();
+ }
+
+
+#line 709 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::SplineSegment(
+ wxGraphicsPath & p,
+ Wxd_spline_point_t *pt,
+ dk4_xsp_2d_t *xsp,
+ uint16_t segno,
+ size_t subsegs,
+ double divisor,
+ double shiftx,
+ double shifty,
+ uint16_t ib,
+ uint16_t ic
+)
+{
+#if 0
+ /*
+ 2019-04-28
+ This deactivated section shows real variable names.
+ The active section below uses and copies array members
+ directly for performance reasons.
+ */
+ double rp[4];
+ double x0;
+ double y0;
+ double dxdt0;
+ double dydt0;
+ double x1;
+ double y1;
+ double dxdt1;
+ double dydt1;
+ double t;
+ size_t ss;
+
+ if ((1.0e-7 > fabs(pt[ib].s)) && (1.0e-7 > fabs(pt[ic].s))) {
+ if (0U == segno) {
+ p.MoveToPoint( ConvX(pt[ib].x + shiftx), ConvY(pt[ib].y + shifty) );
+ }
+ p.AddLineToPoint( ConvX(pt[ic].x + shiftx), ConvY(pt[ic].y + shifty) );
+ }
+ else {
+ dk4xsp2d_calculate_value_derivative(rp, xsp, 0.0, NULL);
+ x0 = rp[0];
+ y0 = rp[2];
+ dxdt0 = rp[1] / divisor;
+ dydt0 = rp[3] / divisor;
+ if (0U == segno) {
+ p.MoveToPoint( ConvX(x0 + shiftx), ConvY(y0 + shifty) );
+ }
+ for (ss = 0; ss < subsegs; ss++) {
+ if ((subsegs - (size_t)1U) == ss) {
+ t = 1.0;
+ }
+ else {
+ t = (double)(ss + (size_t)1U) / (double)subsegs;
+ }
+ dk4xsp2d_calculate_value_derivative(rp, xsp, t, NULL);
+ x1 = rp[0];
+ y1 = rp[2];
+ dxdt1 = rp[1] / divisor;
+ dydt1 = rp[3] / divisor;
+ p.AddCurveToPoint(
+ ConvX(x0 + dxdt0 + shiftx), ConvY(y0 + dydt0 + shifty),
+ ConvX(x1 - dxdt1 + shiftx), ConvY(y1 - dydt1 + shifty),
+ ConvX(x1 + shiftx), ConvY(y1 + shifty)
+ );
+ x0 = x1;
+ y0 = y1;
+ dxdt0 = dxdt1;
+ dydt0 = dydt1;
+ }
+ }
+#endif
+ double rp0[4];
+ double rp1[4];
+ double t;
+ size_t ss;
+
+ if ((1.0e-7 > fabs(pt[ib].s)) && (1.0e-7 > fabs(pt[ic].s))) {
+ /*
+ Both start and end of segment have s=0 so we can draw a
+ straight line.
+ */
+ if (0U == segno) {
+ p.MoveToPoint( ConvX(pt[ib].x + shiftx), ConvY(pt[ib].y + shifty) );
+ }
+ p.AddLineToPoint( ConvX(pt[ic].x + shiftx), ConvY(pt[ic].y + shifty) );
+ }
+ else {
+ /*
+ At least one from start and end has s!=0 so we must draw
+ a spline sequence.
+ */
+ dk4xsp2d_calculate_value_derivative(rp0, xsp, 0.0, NULL);
+ rp0[1] = rp0[1] / divisor;
+ rp0[3] = rp0[3] / divisor;
+ if (0U == segno) {
+ p.MoveToPoint( ConvX(rp0[0] + shiftx), ConvY(rp0[2] + shifty) );
+ }
+ for (ss = 0; ss < subsegs; ss++) {
+ if ((subsegs - (size_t)1U) == ss) {
+ t = 1.0;
+ }
+ else {
+ t = (double)(ss + (size_t)1U) / (double)subsegs;
+ }
+ dk4xsp2d_calculate_value_derivative(rp1, xsp, t, NULL);
+ rp1[1] = rp1[1] / divisor;
+ rp1[3] = rp1[3] / divisor;
+ p.AddCurveToPoint(
+ ConvX(rp0[0]+rp0[1]+shiftx), ConvY(rp0[2]+rp0[3]+shifty),
+ ConvX(rp1[0]-rp1[1]+shiftx), ConvY(rp1[2]-rp1[3]+shifty),
+ ConvX(rp1[0] + shiftx), ConvY(rp1[2] + shifty)
+ );
+ DK4_MEMCPY(rp0,rp1,(sizeof(double)*4));
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathSpline(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_xsp_2d_t xsp; /* 2D X-spline */
+ Wxd_spline_point_t *pt; /* Address of spline points array */
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ double divisor; /* Divisor in calculations */
+ size_t subsegs; /* Number of subsegments */
+ uint16_t ia; /* Index of point A */
+ uint16_t ib; /* Index of point B */
+ uint16_t ic; /* Index of point C */
+ uint16_t id; /* Index of point D */
+ uint16_t segno; /* Current segment index */
+ uint16_t segments; /* Number of segments */
+
+
+
+#line 854 "WxdkdrawControlDraw.cpt"
+ dk4xsp2d_reset(&xsp);
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ segments = (pObj->det).s.n - (uint16_t)1U;
+ pt = (pObj->det).s.p;
+ subsegs = (size_t)(m_pParent->m_iv[IVI_XS_SUBSEGS]);
+ if (1U > subsegs) { subsegs = 1U; }
+ divisor = 3.0 * (double)subsegs;
+ for (segno = 0U; segno < segments; segno++) {
+ dk4xsp2d_reset_points(&xsp);
+ ib = segno;
+ ic = ib + 1;
+ dk4xsp2d_set_point(&xsp, pt[ib].x, pt[ib].y, pt[ib].s, 1);
+ dk4xsp2d_set_point(&xsp, pt[ic].x, pt[ic].y, pt[ic].s, 2);
+ if (0U < ib) {
+ ia = ib - (uint16_t)1U;
+ dk4xsp2d_set_point(&xsp, pt[ia].x, pt[ia].y, pt[ia].s, 0);
+ }
+ else {
+ if (WXD_OT_C_SPLINE == pObj->ot) {
+ ia = segments;
+ dk4xsp2d_set_point(&xsp, pt[ia].x, pt[ia].y, pt[ia].s, 0);
+ }
+ }
+ if (ic < segments) {
+ id = ic + (uint16_t)1U;
+ dk4xsp2d_set_point(&xsp, pt[id].x, pt[id].y, pt[id].s, 3);
+ }
+ else {
+ if (WXD_OT_C_SPLINE == pObj->ot) {
+ id = 0;
+ dk4xsp2d_set_point(&xsp, pt[id].x, pt[id].y, pt[id].s, 3);
+ }
+ }
+ SplineSegment(
+ p, pt, &xsp, segno, subsegs, divisor, shiftx, shifty, ib, ic
+ );
+ }
+ if (WXD_OT_C_SPLINE == pObj->ot) {
+ dk4xsp2d_reset_points(&xsp);
+ ia = segments - (uint16_t)1U;
+ ib = segments;
+ ic = 0U;
+ id = 1U;
+ dk4xsp2d_set_point(&xsp, pt[ia].x, pt[ia].y, pt[ia].s, 0);
+ dk4xsp2d_set_point(&xsp, pt[ib].x, pt[ib].y, pt[ib].s, 1);
+ dk4xsp2d_set_point(&xsp, pt[ic].x, pt[ic].y, pt[ic].s, 2);
+ dk4xsp2d_set_point(&xsp, pt[id].x, pt[id].y, pt[id].s, 3);
+ SplineSegment(
+ p, pt, &xsp, segments, subsegs, divisor, shiftx, shifty, ib, ic
+ );
+ p.CloseSubpath();
+ }
+
+
+#line 907 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathArc(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ double deltaa; /* Difference start angle to end angle */
+ double x0; /* Segment start point X position */
+ double y0; /* Segment start point Y position */
+ double dxdt0; /* Segment start point X derivative */
+ double dydt0; /* Segment start point Y derivative */
+ double x1; /* Segment end point X position */
+ double y1; /* Segment end point Y position */
+ double dxdt1; /* Segment end point X derivative */
+ double dydt1; /* Segment end point Y derivative */
+ double cx0; /* Converted start point X */
+ double cy0; /* Converted start point Y */
+ double a0; /* Segment start angle */
+ double a1; /* Segment end angle */
+ double kappa; /* Kappa value for segment */
+ size_t segments; /* Number of segments */
+ size_t i; /* Index of current segment */
+
+
+#line 937 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ if ((int8_t)0 != (pObj->det).a.d) {
+ segments = (size_t)dk4ma_rint(
+ ceil( fabs((pObj->det).a.b - (pObj->det).a.a) / M_PI_2 )
+ );
+ a0 = (pObj->det).a.a;
+ x0 = (pObj->det).a.x + (pObj->det).a.r * cos(a0) + shiftx;
+ y0 = (pObj->det).a.y + (pObj->det).a.r * sin(a0) + shifty;
+ cx0 = ConvX(x0);
+ cy0 = ConvY(y0);
+
+ p.MoveToPoint(cx0, cy0);
+ deltaa = (pObj->det).a.b - (pObj->det).a.a;
+ for (i = 0; i < segments; i++) {
+ if (i >= (segments - 1)) {
+ a1 = (pObj->det).a.b;
+ }
+ else {
+ a1 = (pObj->det).a.a
+ + ((double)(i + (size_t)1) * deltaa) / (double)segments;
+ }
+ kappa = dk4gratool_kappa_for_angle(fabs(a1 - a0));
+ dxdt0 = -1.0 * (a1 - a0) * (pObj->det).a.r * sin(a0);
+ dydt0 = (a1 - a0) * (pObj->det).a.r * cos(a0);
+ x1 = (pObj->det).a.x + (pObj->det).a.r * cos(a1) + shiftx;
+ y1 = (pObj->det).a.y + (pObj->det).a.r * sin(a1) + shifty;
+ dxdt1 = -1.0 * (a1 - a0) * (pObj->det).a.r * sin(a1);
+ dydt1 = (a1 - a0) * (pObj->det).a.r * cos(a1);
+ p.AddCurveToPoint(
+ ConvX(x0 + kappa * dxdt0), ConvY(y0 + kappa * dydt0),
+ ConvX(x1 - kappa * dxdt1), ConvY(y1 - kappa * dydt1),
+ ConvX(x1), ConvY(y1)
+ );
+ a0 = a1;
+ x0 = x1;
+ y0 = y1;
+ }
+ if (WXD_OT_C_ARC == pObj->ot) {
+ p.AddLineToPoint(
+ ConvX((pObj->det).a.x + shiftx), ConvY((pObj->det).a.y + shifty)
+ );
+ p.AddLineToPoint(cx0, cy0);
+ p.CloseSubpath();
+ }
+ }
+ else {
+ x0 = (double)((pObj->det).a.x1) + shiftx;
+ y0 = (double)((pObj->det).a.y1) + shifty;
+ cx0 = ConvX(x0);
+ cy0 = ConvY(y0);
+ p.MoveToPoint(cx0, cy0);
+ p.AddLineToPoint(
+ ConvX((double)((pObj->det).a.x2) + shiftx),
+ ConvY((double)((pObj->det).a.y2) + shifty)
+ );
+ p.AddLineToPoint(
+ ConvX((double)((pObj->det).a.x3) + shiftx),
+ ConvY((double)((pObj->det).a.y3) + shifty)
+ );
+ if (WXD_OT_C_ARC == pObj->ot) {
+ p.AddLineToPoint(cx0, cy0);
+ p.CloseSubpath();
+ }
+ }
+
+
+#line 1002 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathCircle(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+
+
+#line 1017 "WxdkdrawControlDraw.cpt"
+ p.AddCircle(
+ ConvX((double)((pObj->det).e.x) + shiftx),
+ ConvY((double)((pObj->det).e.y) + shifty),
+ fabs(ConvDist((double)((pObj->det).e.rx)))
+ );
+
+
+#line 1023 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathEllipse(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_gra_point_t pt[DK4_GRA_CIRCLE_POINTS]; /* Point set for circle */
+ dk4_er_t er; /* Error report */
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ size_t const szpt = DK4_SIZEOF(pt,dk4_gra_point_t);
+ size_t i; /* Current segment index */
+ size_t c1; /* First ctrl pt index */
+ size_t c2; /* Second ctrl pt index */
+ size_t c3; /* Segment index */
+ int res; /* Intermediate result */
+
+
+#line 1045 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ if ((int16_t)0 != (pObj->det).e.a) {
+ dk4error_init(&er);
+ res = dk4gratool_points_for_ellipse(
+ pt, szpt,
+ ((double)((pObj->det).e.x) + shiftx),
+ ((double)((pObj->det).e.y) + shifty),
+ (double)((pObj->det).e.rx), (double)((pObj->det).e.ry),
+ ((M_PI * (double)((pObj->det).e.a)) / 180.0),
+ &er
+ );
+ if (0 != res) {
+ p.MoveToPoint(ConvX(pt[0].x), ConvY(pt[0].y));
+ for (i = 0; i < (szpt / (size_t)3U); i++) {
+ c1 = 3 * i + 1;
+ c2 = 3 * i + 2;
+ c3 = 3 * i + 3;
+ if (DK4_GRA_CIRCLE_POINTS <= c3) { c3 = 0; }
+ p.AddCurveToPoint(
+ ConvX(pt[c1].x), ConvY(pt[c1].y),
+ ConvX(pt[c2].x), ConvY(pt[c2].y),
+ ConvX(pt[c3].x), ConvY(pt[c3].y)
+ );
+ }
+ p.CloseSubpath();
+ }
+ }
+ else {
+ p.AddEllipse(
+ ConvX(
+ (double)((pObj->det).e.x) - (double)((pObj->det).e.rx) + shiftx
+ ),
+ ConvY(
+ (double)((pObj->det).e.y) + (double)((pObj->det).e.ry) + shifty
+ ),
+ ConvDist(2.0 * (pObj->det).e.rx),
+ ConvDist(2.0 * (pObj->det).e.ry)
+ );
+ }
+
+
+#line 1085 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathBox(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_bb_t bb; /* Bounding box data */
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ double w; /* Box width */
+ double h; /* Box height */
+ double r; /* Corner radius */
+
+
+#line 1103 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ if ((pObj->det).b.b.xl <= (pObj->det).b.b.xr) {
+ bb.xmin = (double)((pObj->det).b.b.xl);
+ bb.xmax = (double)((pObj->det).b.b.xr);
+ w = (double)((pObj->det).b.b.xr) - (double)((pObj->det).b.b.xl);
+ }
+ else {
+ bb.xmax = (double)((pObj->det).b.b.xl);
+ bb.xmin = (double)((pObj->det).b.b.xr);
+ w = (double)((pObj->det).b.b.xl) - (double)((pObj->det).b.b.xr);
+ }
+ if ((pObj->det).b.b.yb <= (pObj->det).b.b.yt) {
+ bb.ymin = (double)((pObj->det).b.b.yb);
+ bb.ymax = (double)((pObj->det).b.b.yt);
+ h = (double)((pObj->det).b.b.yt) - (double)((pObj->det).b.b.yb);
+ }
+ else {
+ bb.ymax = (double)((pObj->det).b.b.yb);
+ bb.ymin = (double)((pObj->det).b.b.yt);
+ h = (double)((pObj->det).b.b.yb) - (double)((pObj->det).b.b.yt);
+ }
+ bb.xmin = ConvX(bb.xmin + shiftx);
+ bb.xmax = ConvX(bb.xmax + shiftx);
+ bb.ymin = ConvY(bb.ymin + shifty);
+ bb.ymax = ConvY(bb.ymax + shifty);
+ w = ConvDist(w);
+ h = ConvDist(h);
+ if ((uint32_t)0UL < (pObj->det).b.r) {
+ r = ConvDist((double)((pObj->det).b.r));
+ if (r > (w / 2.0)) { r = w / 2.0; }
+ if (r > (h / 2.0)) { r = h / 2.0; }
+ p.AddRoundedRectangle(bb.xmin, bb.ymax, w, h, r);
+ }
+ else {
+ p.AddRectangle(bb.xmin, bb.ymax, w, h);
+ }
+
+
+#line 1140 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupPolyline(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half markup point length (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Left x value for markup square (pixels) */
+ double yt; /* Top y value for markup square (pixels) */
+ double w; /* Markup square width (pixels) */
+ uint16_t i; /* Current point index */
+
+
+#line 1161 "WxdkdrawControlDraw.cpt"
+ if ((NULL != (pObj->det).p.p) && (0 < (pObj->det).p.n)) {
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ gc->SetBrush(brstr);
+ gc->SetPen(wxNullPen);
+ w = ConvDist(2.0 * r);
+ for (i = 0; i < (pObj->det).p.n; i++) {
+
+
+#line 1176 "WxdkdrawControlDraw.cpt"
+ wxGraphicsPath p = gc->CreatePath();
+ xl = ConvX((double)(((pObj->det).p.p)[i].x) + shiftx - r);
+ yt = ConvY((double)(((pObj->det).p.p)[i].y) + shifty + r);
+
+
+#line 1180 "WxdkdrawControlDraw.cpt"
+
+
+#line 1181 "WxdkdrawControlDraw.cpt"
+
+
+#line 1182 "WxdkdrawControlDraw.cpt"
+ p.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p);
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+ }
+
+
+#line 1189 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupSpline(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half width of markup square (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Left x of markup square (pixels) */
+ double yt; /* Top y of markup square (pixels) */
+ double w; /* Markup square width (pixels) */
+ uint16_t i; /* Current point index */
+
+
+#line 1210 "WxdkdrawControlDraw.cpt"
+ if ((NULL != (pObj->det).s.p) && (0 < (pObj->det).s.n)) {
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ gc->SetBrush(brstr);
+ gc->SetPen(wxNullPen);
+ w = ConvDist(2.0 * r);
+ for (i = 0; i < (pObj->det).s.n; i++) {
+
+
+#line 1225 "WxdkdrawControlDraw.cpt"
+ wxGraphicsPath p = gc->CreatePath();
+ xl = ConvX((double)(((pObj->det).s.p)[i].x) + shiftx - r);
+ yt = ConvY((double)(((pObj->det).s.p)[i].y) + shifty + r);
+
+
+#line 1229 "WxdkdrawControlDraw.cpt"
+
+
+#line 1230 "WxdkdrawControlDraw.cpt"
+
+
+#line 1231 "WxdkdrawControlDraw.cpt"
+ p.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p);
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+ }
+
+
+#line 1238 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupArc(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half width of markup square (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Left x of markup square (pixels) */
+ double yt; /* Top y of markup square (pixels) */
+ double w; /* Markup square width (pixels) */
+
+
+#line 1258 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ gc->SetBrush(brstr);
+ gc->SetPen(wxNullPen);
+ w = ConvDist(2.0 * r);
+ {
+ wxGraphicsPath p1 = gc->CreatePath();
+ xl = ConvX((double)((pObj->det).a.x1) + shiftx - r);
+ yt = ConvY((double)((pObj->det).a.y1) + shifty + r);
+ p1.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p1);
+ }
+ {
+ wxGraphicsPath p2 = gc->CreatePath();
+ xl = ConvX((double)((pObj->det).a.x2) + shiftx - r);
+ yt = ConvY((double)((pObj->det).a.y2) + shifty + r);
+ p2.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p2);
+ }
+ {
+ wxGraphicsPath p3 = gc->CreatePath();
+ xl = ConvX((double)((pObj->det).a.x3) + shiftx - r);
+ yt = ConvY((double)((pObj->det).a.y3) + shifty + r);
+ p3.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p3);
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+
+
+#line 1294 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupCircle(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half width of markup square (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double x; /* Markup point x (wxd) */
+ double y; /* Markup point y (wxd) */
+ double xl; /* Left x of markup square (pixels) */
+ double yt; /* Top y of markup square (pixels) */
+ double w; /* Markup square width (pixels) */
+
+
+#line 1316 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ gc->SetBrush(brstr);
+ gc->SetPen(wxNullPen);
+ w = ConvDist(2.0 * r);
+ {
+ wxGraphicsPath p1 = gc->CreatePath();
+ x = (double)((pObj->det).e.x) - (double)((pObj->det).e.rx);
+ y = (double)((pObj->det).e.y);
+ xl = ConvX(x + shiftx - r);
+ yt = ConvY(y + shifty + r);
+ p1.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p1);
+ }
+ {
+ wxGraphicsPath p2 = gc->CreatePath();
+ x = (double)((pObj->det).e.x) + (double)((pObj->det).e.rx);
+ y = (double)((pObj->det).e.y);
+ xl = ConvX(x + shiftx - r);
+ yt = ConvY(y + shifty + r);
+ p2.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p2);
+ }
+ {
+ wxGraphicsPath p3 = gc->CreatePath();
+ x = (double)((pObj->det).e.x);
+ y = (double)((pObj->det).e.y) - (double)((pObj->det).e.rx);
+ xl = ConvX(x + shiftx - r);
+ yt = ConvY(y + shifty + r);
+ p3.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p3);
+ }
+ {
+ wxGraphicsPath p4 = gc->CreatePath();
+ x = (double)((pObj->det).e.x);
+ y = (double)((pObj->det).e.y) + (double)((pObj->det).e.rx);
+ xl = ConvX(x + shiftx - r);
+ yt = ConvY(y + shifty + r);
+ p4.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p4);
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+
+
+#line 1367 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupEllipse(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_gra_point_t pt[5]; /* Ellipse key points to mark */
+ int sc[3]; /* Stroke colour components */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Left markup square x (pixels) */
+ double yt; /* Top markup square y (pixels) */
+ double w; /* Markup square width (pixels) */
+ double a; /* Rotation in radians */
+ double r; /* Half markup square width (wxd) */
+ size_t i; /* Current point index */
+
+
+#line 1390 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x); shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ w = ConvDist(2.0 * r);
+ pt[0].x = (double)((pObj->det).e.rx);
+ pt[0].y = 0.0;
+ pt[1].x = 0.0;
+ pt[1].y = (double)((pObj->det).e.ry);
+ pt[2].x = 0.0 - (double)((pObj->det).e.rx);
+ pt[2].y = 0.0;
+ pt[3].x = 0.0;
+ pt[3].y = 0.0 - (double)((pObj->det).e.ry);
+ a = (M_PI * (double)((pObj->det).e.a)) / 180.0;
+ {
+ wxColour fc(sc[0], sc[1], sc[2]);
+ wxBrush br(fc);
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ for (i = 0; i < 4; i++) {
+ dk4gratool_rotate_point(&(pt[i]), a);
+ pt[i].x += (double)((pObj->det).e.x);
+ pt[i].y += (double)((pObj->det).e.y);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ xl = ConvX(pt[i].x + shiftx - r);
+ yt = ConvY(pt[i].y + shifty + r);
+ p.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p);
+ }
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+
+
+#line 1425 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupBoundingBox(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ Wxd_bb_t const *pbb,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half markup square width (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Markup square left x (pixels) */
+ double yt; /* Markup square top y (pixels) */
+ double w; /* Markup square width (pixels) */
+ double dlw; /* Markup rectangle line width */
+ int lw; /* Markup rectangle line width */
+
+
+#line 1448 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ if (WXD_OT_IMAGE == pObj->ot) {
+ dlw = 2.0 * (double)(m_pParent->m_pDrw->baselw);
+ lw = (int)dk4ma_rint(ConvDist(dlw));
+ if (1 > lw) { lw = 1; }
+ }
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ if (WXD_OT_IMAGE == pObj->ot) {
+ wxPen penRect(cstroke, lw);
+ wxGraphicsPath pathRect = gc->CreatePath();
+ gc->SetPen(penRect);
+ gc->SetBrush(wxNullBrush);
+ pathRect.AddRectangle(
+ ConvX((double)(pbb->xl) + shiftx),
+ ConvY((double)(pbb->yt) + shifty),
+ ConvDist((double)(pbb->xr) - (double)(pbb->xl)),
+ ConvDist((double)(pbb->yt) - (double)(pbb->yb))
+ );
+ gc->StrokePath(pathRect);
+ gc->SetPen(wxNullPen);
+ }
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brstr);
+ switch (iMarkup) {
+ case WXD_MARKUP_IMGRES : {
+ } break;
+ default : {
+ w = ConvDist(2.0 * r);
+ {
+ wxGraphicsPath p1 = gc->CreatePath();
+ xl = ConvX((double)(pbb->xl) + shiftx - r);
+ yt = ConvY((double)(pbb->yb) + shifty + r);
+ p1.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p1);
+ }
+ {
+ wxGraphicsPath p2 = gc->CreatePath();
+ xl = ConvX((double)(pbb->xr) + shiftx - r);
+ yt = ConvY((double)(pbb->yb) + shifty + r);
+ p2.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p2);
+ }
+ {
+ wxGraphicsPath p3 = gc->CreatePath();
+ xl = ConvX((double)(pbb->xr) + shiftx - r);
+ yt = ConvY((double)(pbb->yt) + shifty + r);
+ p3.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p3);
+ }
+ {
+ wxGraphicsPath p4 = gc->CreatePath();
+ xl = ConvX((double)(pbb->xl) + shiftx - r);
+ yt = ConvY((double)(pbb->yt) + shifty + r);
+ p4.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p4);
+ }
+ } break;
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+
+
+#line 1516 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupBox(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+
+
+#line 1529 "WxdkdrawControlDraw.cpt"
+ MarkupBoundingBox(gc, pObj, &((pObj->det).b.b), iMarkup, pShift);
+
+
+#line 1531 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawOpenPathElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ wxDash dash[8]; /* Dash length values array */
+ int sc[3]; /* Stroke colour */
+ int lw; /* Line width */
+ int nDash = 0; /* Number of dash elements */
+ bool bStroke = false; /* Flag: Stroke this element */
+
+
+#line 1549 "WxdkdrawControlDraw.cpt"
+ if (((uint16_t)0U != pObj->lw) || (WXD_MARKUP_NONE != iMarkup)) {
+ bStroke = true;
+ }
+ if (bStroke) {
+ wxGraphicsPath p = gc->CreatePath();
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ lw = LineWidthForObject(m_pParent->m_pDrw, pObj, iMarkup);
+ switch (pObj->ot) {
+ case WXD_OT_POLYLINE : {
+ PathPolyline(p, pObj, pShift);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ PathSpline(p, pObj, pShift);
+ } break;
+ case WXD_OT_O_ARC : {
+ PathArc(p, pObj, pShift);
+ } break;
+ }
+ wxColour penc(sc[0], sc[1], sc[2]);
+ wxPen pen(penc, lw);
+ SetupPenForObject(pen, pObj, dash, &nDash);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ /*
+ Arrowheads, if any
+ */
+ AddArrowheads(gc, m_pParent->m_pDrw, pObj, sc, pShift);
+ /*
+ Markup
+ */
+ if (WXD_MARKUP_NONE != iMarkup) {
+ switch (pObj->ot) {
+ case WXD_OT_POLYLINE : {
+ MarkupPolyline(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ MarkupSpline(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_O_ARC : {
+ MarkupArc(gc, pObj, iMarkup, pShift);
+ } break;
+ }
+ }
+ }
+
+
+#line 1596 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawClosedPathElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ wxDash dash[8]; /* Dash length values array */
+ int sc[3]; /* Stroke colour */
+ int nDash = 0; /* Number of dash values */
+ bool bFill = false; /* Flag: Fill element */
+ bool bStroke = false; /* Flag: Stroke element */
+
+
+#line 1614 "WxdkdrawControlDraw.cpt"
+ if ((uint8_t)(WXD_FS_NONE) != pObj->fs) {
+ /*
+ 2020-03-24 Modification
+ Marked elements are drawned on top of other elements,
+ so they can hide elements normally below them.
+ */
+ if (WXD_MARKUP_NONE == iMarkup) {
+ bFill = true;
+ }
+ }
+ /* Stroke element if linewidth not 0 or any markup required
+ */
+ if (((uint16_t)0U != pObj->lw) || (WXD_MARKUP_NONE != iMarkup)) {
+ bStroke = true;
+ }
+ if (bFill || bStroke) {
+ wxGraphicsPath p = gc->CreatePath();
+ switch (pObj->ot) {
+ case WXD_OT_POLYGON : {
+ PathPolyline(p, pObj, pShift);
+ } break;
+ case WXD_OT_C_SPLINE : {
+ PathSpline(p, pObj, pShift);
+ } break;
+ case WXD_OT_C_ARC : {
+ PathArc(p, pObj, pShift);
+ } break;
+ case WXD_OT_CIRCLE : {
+ PathCircle(p, pObj, pShift);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ PathEllipse(p, pObj, pShift);
+ } break;
+ case WXD_OT_BOX : {
+ PathBox(p, pObj, pShift);
+ } break;
+ }
+ if (bFill) {
+ gc->SetPen(wxNullPen);
+ if (
+ ((uint8_t)(WXD_FS_PURE) < pObj->fs)
+ && (NULL != pObj->psti)
+ && (NULL != (pObj->psti)->bm)
+ ) {
+ wxBrush br(*((pObj->psti)->bm));
+ gc->SetBrush(br);
+ gc->DrawPath(p);
+ gc->SetBrush(wxNullBrush);
+ }
+ else {
+ wxColour fc(
+ (int)(pObj->fc[0]), (int)(pObj->fc[1]), (int)(pObj->fc[2])
+ );
+ wxBrush br(fc);
+ gc->SetBrush(br);
+ gc->DrawPath(p);
+ gc->SetBrush(wxNullBrush);
+ }
+ }
+ if (bStroke) {
+ gc->SetBrush(wxNullBrush);
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ wxColour penc(sc[0], sc[1], sc[2]);
+ wxPen pen(
+ penc,
+ LineWidthForObject(m_pParent->m_pDrw, pObj, iMarkup)
+ );
+ SetupPenForObject(pen, pObj, dash, &nDash);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ }
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(wxNullBrush);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ switch (pObj->ot) {
+ case WXD_OT_POLYGON : {
+ MarkupPolyline(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_C_SPLINE : {
+ MarkupSpline(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_C_ARC : {
+ MarkupArc(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_CIRCLE : {
+ MarkupCircle(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ MarkupEllipse(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_BOX : {
+ MarkupBox(gc, pObj, iMarkup, pShift);
+ } break;
+ }
+ }
+ }
+
+
+#line 1712 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawImageRegion(
+ wxGraphicsContext *gc
+)
+{
+ double xps; /* Start x coordinate */
+ double xpe; /* End x coordinate */
+ double yps; /* Start y coordinate */
+ double ype; /* End y coordinate */
+
+ wxColour co(
+ m_pParent->m_iv[IVI_MISSIMG_RED],
+ m_pParent->m_iv[IVI_MISSIMG_GREEN],
+ m_pParent->m_iv[IVI_MISSIMG_BLUE]
+ );
+ wxPen pen(co);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ xps = ConvX((double)((m_pParent->m_ptMouseMoveStart).x));
+ xpe = ConvX((double)((m_pParent->m_ptMousePosGrid).x));
+ yps = ConvY((double)((m_pParent->m_ptMouseMoveStart).y));
+ ype = ConvY((double)((m_pParent->m_ptMousePosGrid).y));
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(xps, yps, (xpe-xps), (ype-yps));
+ gc->StrokePath(p);
+ }
+ gc->SetPen(wxNullPen);
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawImageElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ double xps; /* Start x coordinate */
+ double xpe; /* End x coordinate */
+ double yps; /* Start y coordinate */
+ double ype; /* End y coordinate */
+
+
+#line 1763 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ if (NULL != (pObj->det).i.bm) {
+
+#line 1768 "WxdkdrawControlDraw.cpt"
+ gc->DrawBitmap(
+ *((pObj->det).i.bm),
+ ConvX((pObj->det).i.pl.xmin + shiftx),
+ ConvY((pObj->det).i.pl.ymax + shifty),
+ (
+ ConvX((pObj->det).i.pl.xmax + shiftx)
+ - ConvX((pObj->det).i.pl.xmin + shiftx)
+ ),
+ ( ConvY((pObj->det).i.pl.ymin + shifty)
+ - ConvY((pObj->det).i.pl.ymax + shifty)
+ )
+ );
+ if (WXD_MARKUP_NONE != iMarkup) {
+ MarkupBoundingBox(gc, pObj, &((pObj->det).i.br), iMarkup, pShift);
+ }
+ }
+ else {
+
+#line 1785 "WxdkdrawControlDraw.cpt"
+ wxColour co(
+ m_pParent->m_iv[IVI_MISSIMG_RED],
+ m_pParent->m_iv[IVI_MISSIMG_GREEN],
+ m_pParent->m_iv[IVI_MISSIMG_BLUE]
+ );
+ wxPen pen(co);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ xps = ConvX((double)((pObj->det).i.br.xl) + shiftx);
+ xpe = ConvX((double)((pObj->det).i.br.xr) + shiftx);
+ yps = ConvY((double)((pObj->det).i.br.yt) + shifty);
+ ype = ConvY((double)((pObj->det).i.br.yb) + shifty);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(xps, yps, (xpe-xps), (ype-yps));
+ gc->StrokePath(p);
+ }
+#if 0
+ /* 2019-05-04
+ Test whether rectangle coordinates are correct.
+ */
+ wxColour blue(0, 0, 127);
+ wxPen pblue(blue);
+ gc->SetPen(pblue);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(xps, yps);
+ p.AddLineToPoint(xpe, yps);
+ p.AddLineToPoint(xpe, ype);
+ p.AddLineToPoint(xps, ype);
+ p.AddLineToPoint(xps, yps);
+ p.CloseSubpath();
+ gc->StrokePath(p);
+ }
+#endif
+ if (WXD_MARKUP_NONE != iMarkup) {
+ MarkupBoundingBox(gc, pObj, &((pObj->det).i.br), iMarkup, pShift);
+ }
+ gc->SetPen(wxNullPen);
+ }
+
+
+#line 1826 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawDotElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour */
+ double shiftx = 0.0; /* X shift distacne */
+ double shifty = 0.0; /* Y shift distance */
+ double r; /* Circle radius */
+ double dlw; /* Line width for markup as double */
+ int lw; /* Line width for markup as int */
+
+
+#line 1845 "WxdkdrawControlDraw.cpt"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ dlw = 2.0 * (double)(m_pParent->m_pDrw->baselw);
+ lw = (int)dk4ma_rint(ConvDist(dlw));
+ if (1 > lw) { lw = 1; }
+ }
+ if (WXD_OT_DOT_WHITE == pObj->ot) {
+ wxColour fco(sc[0], sc[1], sc[2]);
+ wxBrush br(fco);
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ r = (double)((pObj->det).d.d) + (double)(pObj->lw);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->FillPath(p);
+ if (pObj->lw < m_pParent->m_pDrw->baselw) {
+ wxBrush br2(*wxWHITE);
+ gc->SetBrush(br2);
+ r = (double)((pObj->det).d.d) - (double)(pObj->lw);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ wxGraphicsPath p2 = gc->CreatePath();
+ p2.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->FillPath(p2);
+ }
+ gc->SetBrush(wxNullBrush);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ wxPen penMarkup(fco, lw);
+ r = 8.0 + (double)((pObj->det).d.d) + (double)(pObj->lw);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ gc->SetPen(penMarkup);
+ wxGraphicsPath pMarkup = gc->CreatePath();
+ pMarkup.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->StrokePath(pMarkup);
+ gc->SetPen(wxNullPen);
+ }
+ }
+ else {
+ wxColour fco(sc[0], sc[1], sc[2]);
+ wxBrush br(fco);
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ r = (double)(m_pParent->m_pDrw->baselw) * (double)((pObj->det).d.d);
+ r = r / 2.0;
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ wxPen penMarkup(fco, lw);
+ r = 8.0 + (double)((pObj->det).d.d);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ gc->SetPen(penMarkup);
+ wxGraphicsPath pMarkup = gc->CreatePath();
+ pMarkup.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->StrokePath(pMarkup);
+ gc->SetPen(wxNullPen);
+ }
+ }
+
+
+#line 1930 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+
+
+#line 1943 "WxdkdrawControlDraw.cpt"
+ switch ( (int)(pObj->ot) ) {
+ case WXD_OT_TEXT : {
+
+#line 1945 "WxdkdrawControlDraw.cpt"
+ DrawTextElement(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC : {
+
+#line 1950 "WxdkdrawControlDraw.cpt"
+ DrawOpenPathElement(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE :
+ case WXD_OT_ELLIPSE :
+ case WXD_OT_BOX : {
+
+#line 1958 "WxdkdrawControlDraw.cpt"
+ DrawClosedPathElement(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_IMAGE : {
+
+#line 1961 "WxdkdrawControlDraw.cpt"
+ DrawImageElement(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+
+#line 1965 "WxdkdrawControlDraw.cpt"
+ DrawDotElement(gc, pObj, iMarkup, pShift);
+ } break;
+ }
+
+
+#line 1969 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperationCanvas(wxGraphicsContext *gc)
+{
+ int coco[3]; /* Colour components */
+ double xl; /* Left x */
+ double xr; /* Right x */
+ double yb; /* Bottom y */
+ double yt; /* Top y */
+ double xrmax; /* Maximum for right x */
+ double ybmax; /* Maximum for bottom y */
+
+
+#line 1984 "WxdkdrawControlDraw.cpt"
+ coco[0] = m_pParent->m_iv[IVI_BG_RED];
+ coco[1] = m_pParent->m_iv[IVI_BG_GREEN];
+ coco[2] = m_pParent->m_iv[IVI_BG_BLUE];
+ wxColour co(coco[0], coco[1], coco[2]);
+ wxBrush br(co);
+ xl = ConvX((m_pParent->m_pDrw->bb).xl);
+ xr = ConvX((m_pParent->m_pDrw->bb).xr);
+ yb = ConvY((m_pParent->m_pDrw->bb).yb);
+ yt = ConvY((m_pParent->m_pDrw->bb).yt);
+
+
+#line 1994 "WxdkdrawControlDraw.cpt"
+
+
+#line 1995 "WxdkdrawControlDraw.cpt"
+
+
+#line 1996 "WxdkdrawControlDraw.cpt"
+
+
+#line 1997 "WxdkdrawControlDraw.cpt"
+ xrmax = (double)(m_szDrawco.GetWidth());
+ ybmax = (double)(m_szDrawco.GetHeight());
+ if (0.0 > xl) { xl = 0.0; }
+ if (xrmax < xr) { xr = xrmax; }
+ if (0.0 > yt) { yt = 0.0; }
+ if (ybmax < yb) { yb = ybmax; }
+
+
+#line 2004 "WxdkdrawControlDraw.cpt"
+
+
+#line 2005 "WxdkdrawControlDraw.cpt"
+
+
+#line 2006 "WxdkdrawControlDraw.cpt"
+
+
+#line 2007 "WxdkdrawControlDraw.cpt"
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint(xl, yb);
+ p1.AddLineToPoint(xr, yb);
+ p1.AddLineToPoint(xr, yt);
+ p1.AddLineToPoint(xl, yt);
+ p1.AddLineToPoint(xl, yb);
+ p1.CloseSubpath();
+ gc->FillPath(p1);
+ gc->SetBrush(wxNullBrush);
+
+
+#line 2019 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+#if TRACE_DEBUG
+static
+void
+show_bb(Wxd_bb_t const *bbptr)
+{
+
+
+#line 2029 "WxdkdrawControlDraw.cpt"
+
+
+#line 2030 "WxdkdrawControlDraw.cpt"
+
+
+#line 2031 "WxdkdrawControlDraw.cpt"
+
+
+#line 2032 "WxdkdrawControlDraw.cpt"
+
+
+#line 2033 "WxdkdrawControlDraw.cpt"
+
+
+#line 2034 "WxdkdrawControlDraw.cpt"
+}
+#endif
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperationBoundingBoxGrid(
+ wxGraphicsContext *gc,
+ Wxd_bb_t const & g_end
+)
+{
+ dk4_er_t er; /* Error report */
+ wxColour grco(
+ m_pParent->m_iv[IVI_GRID_RED],
+ m_pParent->m_iv[IVI_GRID_GREEN],
+ m_pParent->m_iv[IVI_GRID_BLUE]
+ ); /* Grid colour */
+ wxPen grpen(grco); /* Pen to draw grid */
+
+
+#line 2053 "WxdkdrawControlDraw.cpt"
+ double xps; /* Start x position (converted) */
+ double xpe; /* End x position (converted) */
+ double yps; /* Start y position (converted) */
+ double ype; /* End y position (converted) */
+ int32_t i; /* Current coordinate value */
+ int32_t xs; /* Start x position (WXD) */
+#if 0
+ int32_t xe;
+#endif
+ int32_t ys; /* Start y position (WXD) */
+#if 0
+ int32_t ye;
+#endif
+
+ dk4error_init(&er);
+ gc->SetPen(grpen);
+ gc->SetBrush(wxNullBrush);
+
+
+#line 2071 "WxdkdrawControlDraw.cpt"
+
+
+#line 2072 "WxdkdrawControlDraw.cpt"
+ /*
+ Horizontal lines
+ */
+ ys = dk4ma_int32_t_add(g_end.yb, (int32_t)(m_uGridOptical), &er);
+ xps = ConvX(g_end.xl);
+ xpe = ConvX(g_end.xr);
+ if (DK4_E_NONE == er.ec) {
+ for (i = ys; i < g_end.yt; i += (int32_t)(m_uGridOptical)) {
+ yps = ConvY(i);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(xps, yps);
+ p.AddLineToPoint(xpe, yps);
+ gc->StrokePath(p);
+ }
+ }
+ /*
+ Vertical lines
+ */
+ xs = dk4ma_int32_t_add(g_end.xl, (int32_t)(m_uGridOptical), &er);
+ yps = ConvY(g_end.yb);
+ ype = ConvY(g_end.yt);
+ if (DK4_E_NONE == er.ec) {
+ for (i = xs; i < g_end.xr; i += (int32_t)(m_uGridOptical)) {
+ xps = ConvX(i);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(xps, yps);
+ p.AddLineToPoint(xps, ype);
+ gc->StrokePath(p);
+ }
+ }
+ /*
+ Rectangle
+ */
+ xps = ConvX(g_end.xl);
+ xpe = ConvX(g_end.xr);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(xps, yps, (xpe-xps), (ype-yps));
+ gc->StrokePath(p);
+ }
+ gc->SetPen(wxNullPen);
+
+
+#line 2114 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperationGrid(wxGraphicsContext *gc)
+{
+ dk4_er_t er; /* Error report */
+ Wxd_bb_t g_drw; /* Grid size calculated from drawing */
+ Wxd_bb_t g_con; /* Grid size calculated from control */
+ Wxd_bb_t g_end; /* Final grid size */
+ bool ok; /* Flag: No errors */
+
+
+#line 2127 "WxdkdrawControlDraw.cpt"
+ /*
+ Initialize error detection
+ */
+ dk4error_init(&er);
+ ok = true;
+ /*
+ Calculate grid borders from drawing size and borders
+ */
+ g_drw.xl = dk4ma_int32_t_sub(
+ (m_pParent->m_pDrw->bb).xl, (int32_t)(m_pParent->m_pDrw->bleft), &er
+ );
+ g_drw.xr = dk4ma_int32_t_add(
+ (m_pParent->m_pDrw->bb).xr, (int32_t)(m_pParent->m_pDrw->bright), &er
+ );
+ g_drw.yb = dk4ma_int32_t_sub(
+ (m_pParent->m_pDrw->bb).yb, (int32_t)(m_pParent->m_pDrw->bbottom), &er
+ );
+ g_drw.yt = dk4ma_int32_t_add(
+ (m_pParent->m_pDrw->bb).yt, (int32_t)(m_pParent->m_pDrw->btop), &er
+ );
+ g_drw.xl = GridRoundDown(g_drw.xl, m_uGridOptical, ok);
+ g_drw.xr = GridRoundUp(g_drw.xr, m_uGridOptical, ok);
+ g_drw.yb = GridRoundDown(g_drw.yb, m_uGridOptical, ok);
+ g_drw.yt = GridRoundUp(g_drw.yt, m_uGridOptical, ok);
+ wxdobj_bb_correct(&g_drw);
+
+
+#line 2153 "WxdkdrawControlDraw.cpt"
+
+
+#line 2154 "WxdkdrawControlDraw.cpt"
+ /*
+ Calculate grid borders from control size and scrollbar positions
+ and zoom factor
+ */
+ if ((DK4_E_NONE == er.ec) && (ok)) {
+ g_con.xl = InvX(0.0, ok);
+ g_con.xr = InvX((double)(m_szDrawco.GetWidth()), ok);
+ g_con.yb = InvY((double)(m_szDrawco.GetHeight()), ok);
+ g_con.yt = InvY(0.0, ok);
+ g_con.xl = GridRoundDown(g_con.xl, m_uGridOptical, ok, true);
+ g_con.xr = GridRoundUp(g_con.xr, m_uGridOptical, ok, true);
+ g_con.yb = GridRoundDown(g_con.yb, m_uGridOptical, ok, true);
+ g_con.yt = GridRoundUp(g_con.yt, m_uGridOptical, ok, true);
+ wxdobj_bb_correct(&g_con);
+
+
+#line 2169 "WxdkdrawControlDraw.cpt"
+
+
+#line 2170 "WxdkdrawControlDraw.cpt"
+ if (ok) {
+ if (wxdobj_bb_intersection(&g_end, &g_drw, &g_con)) {
+
+
+#line 2173 "WxdkdrawControlDraw.cpt"
+
+
+#line 2174 "WxdkdrawControlDraw.cpt"
+ PaintOperationBoundingBoxGrid(gc, g_end);
+ }
+ }
+ else {
+ PaintOperationBoundingBoxGrid(gc, g_drw);
+ }
+ }
+
+
+#line 2182 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperation0(wxDC & dc)
+{
+ int coco[3];
+
+
+#line 2191 "WxdkdrawControlDraw.cpt"
+ coco[0] = m_pParent->m_iv[IVI_BORDER_RED];
+ coco[1] = m_pParent->m_iv[IVI_BORDER_GREEN];
+ coco[2] = m_pParent->m_iv[IVI_BORDER_BLUE];
+ wxColour co(coco[0], coco[1], coco[2]);
+ wxBrush br(co);
+ wxPen pen(co);
+ dc.SetBrush(br);
+ dc.SetPen(pen);
+ dc.DrawRectangle(0, 0, m_szDrawco.GetWidth(), m_szDrawco.GetHeight());
+ dc.SetBrush(wxNullBrush);
+ dc.SetPen(wxNullPen);
+
+
+#line 2203 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperation1(wxGraphicsContext *gc)
+{
+
+
+#line 2211 "WxdkdrawControlDraw.cpt"
+ PaintOperationCanvas(gc);
+ if (m_pParent->cbGridOnOff->GetValue()) {
+ PaintOperationGrid(gc);
+ }
+
+
+#line 2216 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperation2(wxGraphicsContext *gc)
+{
+ Wxd_object_t *pobj;
+
+
+#line 2225 "WxdkdrawControlDraw.cpt"
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != pobj) {
+ if (wxdobj_is_active(pobj)) {
+ if (MustDrawElementInNormalPass(pobj)) {
+ if (CanDrawElement(pobj)) {
+ DrawElement(gc, pobj, WXD_MARKUP_NONE);
+ }
+ }
+ }
+ }
+ } while (NULL != pobj);
+
+
+#line 2239 "WxdkdrawControlDraw.cpt"
+}
+
+
+void
+WxdkdrawFrame::Control::GetPointFromBox(
+ double & x,
+ double & y,
+ Wxd_bb_t const *pbb,
+ uint16_t pno
+)
+{
+
+
+#line 2251 "WxdkdrawControlDraw.cpt"
+ if (3 == pno) {
+ x = (double)(pbb->xl);
+ y = (double)(pbb->yt);
+ }
+ else {
+ if (2 == pno) {
+ x = (double)(pbb->xr);
+ y = (double)(pbb->yt);
+ }
+ else {
+ if (1 == pno) {
+ x = (double)(pbb->xr);
+ y = (double)(pbb->yb);
+ }
+ else {
+ x = (double)(pbb->xl);
+ y = (double)(pbb->yb);
+ }
+ }
+ }
+
+
+#line 2272 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightPointForOperation(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ int ci
+)
+{
+ dk4_gra_point_t pta;
+ int sc[3];
+ double x = 0.0;
+ double y = 0.0;
+ bool bCanHighlight = false;
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[ci]),(3*sizeof(int)));
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ x = (double)((pobj->det).t.x);
+ y = (double)((pobj->det).t.y);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if (NULL != (pobj->det).p.p) {
+ if (pno < (pobj->det).p.n) {
+ x = (double)(((pobj->det).p.p)[pno].x);
+ y = (double)(((pobj->det).p.p)[pno].y);
+ bCanHighlight = true;
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if (NULL != (pobj->det).s.p) {
+ if (pno < (pobj->det).s.n) {
+ x = (double)(((pobj->det).s.p)[pno].x);
+ y = (double)(((pobj->det).s.p)[pno].y);
+ bCanHighlight = true;
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (2 == pno) {
+ x = (double)((pobj->det).a.x3);
+ y = (double)((pobj->det).a.y3);
+ bCanHighlight = true;
+ }
+ else {
+ if (1 == pno) {
+ x = (double)((pobj->det).a.x2);
+ y = (double)((pobj->det).a.y2);
+ bCanHighlight = true;
+
+ }
+ else {
+ x = (double)((pobj->det).a.x1);
+ y = (double)((pobj->det).a.y1);
+ bCanHighlight = true;
+ }
+ }
+ } break;
+ case WXD_OT_CIRCLE : {
+
+
+#line 2336 "WxdkdrawControlDraw.cpt"
+ if (3 == pno) {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((pobj->det).e.rx);
+ }
+ else {
+ if (2 == pno) {
+ pta.x = 0.0 - (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ }
+ else {
+ if (1 == pno) {
+ pta.x = 0.0;
+ pta.y = (double)((pobj->det).e.rx);
+ }
+ else {
+ pta.x = (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ }
+ }
+ }
+ x = pta.x + (double)((pobj->det).e.x);
+ y = pta.y + (double)((pobj->det).e.y);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_ELLIPSE : {
+
+
+#line 2362 "WxdkdrawControlDraw.cpt"
+ if (3 == pno) {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((pobj->det).e.ry);
+ }
+ else {
+ if (2 == pno) {
+ pta.x = 0.0 - (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ }
+ else {
+ if (1 == pno) {
+ pta.x = 0.0;
+ pta.y = (double)((pobj->det).e.ry);
+ }
+ else {
+ pta.x = (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ }
+ }
+ }
+ dk4gratool_rotate_point(
+ &pta, ((M_PI * (double)((pobj->det).e.a)) / 180.0)
+ );
+ x = pta.x + (double)((pobj->det).e.x);
+ y = pta.y + (double)((pobj->det).e.y);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_BOX : {
+ GetPointFromBox(x, y, &((pobj->det).b.b), pno);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_IMAGE : {
+ GetPointFromBox(x, y, &((pobj->det).i.br), pno);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ x = (double)((pobj->det).d.x);
+ y = (double)((pobj->det).d.y);
+ bCanHighlight = true;
+ } break;
+ }
+ if (bCanHighlight) {
+ DrawMarkupPoint(gc, sc, x, y, pobj->lw, NULL);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightLineToPoint(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ int ci
+)
+{
+ double x1;
+ double y1;
+ double x2;
+ double y2;
+ int sc[3];
+ int lw;
+ bool bCanDo = false;
+ x1 = x2 = ConvX((m_pParent->m_ptMousePosRaw).x);
+ y1 = y2 = ConvY((m_pParent->m_ptMousePosRaw).y);
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ x2 = ConvX((double)(((pobj->det).p.p)[pno].x));
+ y2 = ConvY((double)(((pobj->det).p.p)[pno].y));
+ bCanDo = true;
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ x2 = ConvX((double)(((pobj->det).s.p)[pno].x));
+ y2 = ConvY((double)(((pobj->det).s.p)[pno].y));
+ bCanDo = true;
+ } break;
+ }
+ if (bCanDo) {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[ci]),(3*sizeof(int)));
+ lw = 1;
+ }
+ if (bCanDo) {
+ wxColour col(sc[0], sc[1], sc[2]);
+ wxPen pen(col, lw);
+ wxGraphicsPath path = gc->CreatePath();
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ path.MoveToPoint(x1, y1);
+ path.AddLineToPoint(x2, y2);
+ gc->StrokePath(path);
+ gc->SetPen(wxNullPen);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightPointToMove(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno
+)
+{
+ HighlightPointForOperation(gc, pobj, pno, IVI_M_MOVE_RED);
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightPointToDelete(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno
+)
+{
+ HighlightPointForOperation(gc, pobj, pno, IVI_M_DEL_RED);
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightPointToAdd(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ bool bAppend
+)
+{
+ uint16_t i;
+
+
+#line 2492 "WxdkdrawControlDraw.cpt"
+ HighlightPointForOperation(gc, pobj, pno, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, pno, IVI_M_COPY_RED);
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : {
+ if (bAppend) {
+ if (((pobj->det).p.n - (uint16_t)1U) > pno) {
+ i = pno + (uint16_t)1U;
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ }
+ else {
+ if ((uint16_t)0U < pno) {
+ i = pno - (uint16_t)1U;
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if (bAppend) {
+ if (((pobj->det).s.n - (uint16_t)1U) > pno) {
+ i = pno + (uint16_t)1U;
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ }
+ else {
+ if ((uint16_t)0U < pno) {
+ i = pno - (uint16_t)1U;
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+ if (bAppend) {
+ if (((pobj->det).p.n - (uint16_t)1U) > pno) {
+ i = pno + (uint16_t)1U;
+ }
+ else {
+ i = (uint16_t)0U;
+ }
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ else {
+ if ((uint16_t)0U < pno) {
+ i = pno - (uint16_t)1U;
+ }
+ else {
+ i = (pobj->det).p.n - (uint16_t)1U;
+ }
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ if (bAppend) {
+ if (((pobj->det).s.n - (uint16_t)1U) > pno) {
+ i = pno + (uint16_t)1U;
+ }
+ else {
+ i = (uint16_t)0U;
+ }
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ else {
+ if ((uint16_t)0U < pno) {
+ i = pno - (uint16_t)1U;
+ }
+ else {
+ i = (pobj->det).p.n - (uint16_t)1U;
+ }
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ } break;
+ }
+
+
+#line 2573 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightStylePoint(
+ wxGraphicsContext *gc,
+ double x,
+ double y,
+ double r,
+ int const *sc
+)
+{
+ wxColour col(sc[0], sc[1], sc[2]);
+ wxPen pen(col);
+ wxGraphicsPath p = gc->CreatePath();
+ double xx = ConvX(x);
+ double yy = ConvY(y);
+ double r2 = 2.0 * r;
+ if (10.0 < r) {
+ r2 = r + 10.0;
+ }
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ p.AddRectangle((xx - r2 / 2.0), (yy - r2 / 2.0), r2, r2);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightStylePoint(
+ wxGraphicsContext *gc,
+ int32_t x,
+ int32_t y,
+ double r,
+ int const *sc
+)
+{
+ HighlightStylePoint(gc, (double)x, (double)y, r, sc);
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightStyleElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj
+)
+{
+ dk4_gra_point_t pt;
+ int sc[3];
+ double r;
+ double alpha;
+ uint16_t i;
+
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_MOVE_RED]),(3*sizeof(int)));
+ r = 2.0 * ConvDist(MarkupPointRadius(pobj->lw));
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ HighlightStylePoint(
+ gc, (pobj->det).t.x, (pobj->det).t.y, r, sc
+ );
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (pobj->det).p.p) && ((uint16_t)0U < (pobj->det).p.n)) {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ HighlightStylePoint(
+ gc,((pobj->det).p.p)[i].x,((pobj->det).p.p)[i].y,r,sc
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (pobj->det).s.p) && ((uint16_t)0U < (pobj->det).s.n)) {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ HighlightStylePoint(
+ gc,((pobj->det).s.p)[i].x,((pobj->det).s.p)[i].y,r,sc
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ HighlightStylePoint(
+ gc, (pobj->det).a.x1, (pobj->det).a.y1, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).a.x2, (pobj->det).a.y2, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).a.x3, (pobj->det).a.y3, r, sc
+ );
+ } break;
+ case WXD_OT_CIRCLE : {
+ HighlightStylePoint(
+ gc,
+ ((double)((pobj->det).e.x) + (double)((pobj->det).e.rx)),
+ (double)((pobj->det).e.y),
+ r, sc
+ );
+ HighlightStylePoint(
+ gc,
+ ((double)((pobj->det).e.x) - (double)((pobj->det).e.rx)),
+ (double)((pobj->det).e.y),
+ r, sc
+ );
+ HighlightStylePoint(
+ gc, (double)((pobj->det).e.x),
+ ((double)((pobj->det).e.y) + (double)((pobj->det).e.rx)),
+ r, sc
+ );
+ HighlightStylePoint(
+ gc, (double)((pobj->det).e.x),
+ ((double)((pobj->det).e.y) - (double)((pobj->det).e.rx)),
+ r, sc
+ );
+ } break;
+ case WXD_OT_ELLIPSE : {
+ alpha = (M_PI * (double)((pobj->det).e.a)) / 180.0;
+ pt.x = (double)((pobj->det).e.rx);
+ pt.y = 0.0;
+ dk4gratool_rotate_point(&pt, alpha);
+ pt.x += (double)((pobj->det).e.x);
+ pt.y += (double)((pobj->det).e.y);
+ HighlightStylePoint(gc, pt.x, pt.y, r, sc);
+ pt.x = 0.0;
+ pt.y = (double)((pobj->det).e.ry);
+ dk4gratool_rotate_point(&pt, alpha);
+ pt.x += (double)((pobj->det).e.x);
+ pt.y += (double)((pobj->det).e.y);
+ HighlightStylePoint(gc, pt.x, pt.y, r, sc);
+ pt.x = 0.0 - (double)((pobj->det).e.rx);
+ pt.y = 0.0;
+ dk4gratool_rotate_point(&pt, alpha);
+ pt.x += (double)((pobj->det).e.x);
+ pt.y += (double)((pobj->det).e.y);
+ HighlightStylePoint(gc, pt.x, pt.y, r, sc);
+ pt.x = 0.0;
+ pt.y = 0.0 - (double)((pobj->det).e.ry);
+ dk4gratool_rotate_point(&pt, alpha);
+ pt.x += (double)((pobj->det).e.x);
+ pt.y += (double)((pobj->det).e.y);
+ HighlightStylePoint(gc, pt.x, pt.y, r, sc);
+ } break;
+ case WXD_OT_BOX : {
+ HighlightStylePoint(gc,(pobj->det).b.b.xl,(pobj->det).b.b.yb,r,sc);
+ HighlightStylePoint(gc,(pobj->det).b.b.xl,(pobj->det).b.b.yt,r,sc);
+ HighlightStylePoint(gc,(pobj->det).b.b.xr,(pobj->det).b.b.yb,r,sc);
+ HighlightStylePoint(gc,(pobj->det).b.b.xr,(pobj->det).b.b.yt,r,sc);
+ } break;
+ case WXD_OT_IMAGE : {
+ HighlightStylePoint(
+ gc, (pobj->det).i.br.xl, (pobj->det).i.br.yb, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).i.br.xl, (pobj->det).i.br.yt, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).i.br.xr, (pobj->det).i.br.yb, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).i.br.xr, (pobj->det).i.br.yt, r, sc
+ );
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ r = 8.0 + (double)((pobj->det).d.d) + (double)(pobj->lw);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ r = ConvDist(r);
+ HighlightStylePoint(gc, (pobj->det).d.x, (pobj->det).d.y, r, sc);
+ } break;
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperation3(wxGraphicsContext *gc)
+{
+ Wxd_object_t *pobj = NULL; /* Current object */
+ double xcur = 0.0; /* Cursor x position */
+ double ycur = 0.0; /* Cursor y position */
+ double lcur = 0.0; /* Cursor length */
+
+
+#line 2758 "WxdkdrawControlDraw.cpt"
+/*
+ Top level bounding boxes
+*/
+#if 0
+ {
+ wxColour bbgrey(127, 127, 127);
+ wxPen bbpen(bbgrey);
+ Wxd_object_t *po;
+ double xl;
+ double xr;
+ double yb;
+ double yt;
+
+
+#line 2771 "WxdkdrawControlDraw.cpt"
+ gc->SetPen(bbpen);
+ gc->SetBrush(wxNullBrush);
+ dk4sto_it_reset(m_pParent->m_pDrw->i_stru);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_stru);
+ if (NULL != po) {
+
+#line 2777 "WxdkdrawControlDraw.cpt"
+ if (
+ (0 != dk4bb_have_x(&(po->bb)))
+ && (0 != dk4bb_have_y(&(po->bb)))
+ ) {
+ wxGraphicsPath p = gc->CreatePath();
+
+
+#line 2783 "WxdkdrawControlDraw.cpt"
+ xl = ConvX(dk4bb_get_xmin(&(po->bb)));
+ xr = ConvX(dk4bb_get_xmax(&(po->bb)));
+ yb = ConvY(dk4bb_get_ymin(&(po->bb)));
+ yt = ConvY(dk4bb_get_ymax(&(po->bb)));
+ p.AddRectangle(xl, yt, (xr - xl), (yb - yt));
+ gc->StrokePath(p);
+ }
+ else {
+
+#line 2791 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ } while (NULL != po);
+ gc->SetPen(wxNullPen);
+
+
+#line 2796 "WxdkdrawControlDraw.cpt"
+ }
+#endif
+/*
+ All bounding boxes
+*/
+#if 0
+ {
+ wxColour bbgrey(127, 127, 127);
+ wxPen bbpen(bbgrey);
+ Wxd_object_t *po;
+ double xl;
+ double xr;
+ double yb;
+ double yt;
+
+ gc->SetPen(bbpen);
+ gc->SetBrush(wxNullBrush);
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != po) {
+ if (
+ (0 != dk4bb_have_x(&(po->bb)))
+ && (0 != dk4bb_have_y(&(po->bb)))
+ ) {
+ wxGraphicsPath p = gc->CreatePath();
+
+
+#line 2823 "WxdkdrawControlDraw.cpt"
+ xl = ConvX(dk4bb_get_xmin(&(po->bb)));
+ xr = ConvX(dk4bb_get_xmax(&(po->bb)));
+ yb = ConvY(dk4bb_get_ymin(&(po->bb)));
+ yt = ConvY(dk4bb_get_ymax(&(po->bb)));
+ p.AddRectangle(xl, yt, (xr - xl), (yb - yt));
+ gc->StrokePath(p);
+ }
+ else {
+
+#line 2831 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ } while (NULL != po);
+ gc->SetPen(wxNullPen);
+ }
+#endif
+ /*
+ Calculate cursor position
+ */
+ if (m_pParent->m_bMousePos) {
+ xcur = ConvX((m_pParent->m_ptMousePosGrid).x);
+ ycur = ConvY((m_pParent->m_ptMousePosGrid).y);
+ lcur = ConvDist((int32_t)m_uGridSnap / (int32_t)2L);
+ }
+ /*
+ Placement help
+ */
+
+
+#line 2849 "WxdkdrawControlDraw.cpt"
+ if (m_pParent->m_bMousePos) {
+ if (m_pParent->cbPH->GetValue()) {
+ if (StateUsesPlacementHelp()) {
+ wxColour gold(
+ m_pParent->m_iv[WxdkdrawFrame::IVI_PH_RED],
+ m_pParent->m_iv[WxdkdrawFrame::IVI_PH_GREEN],
+ m_pParent->m_iv[WxdkdrawFrame::IVI_PH_BLUE]
+ );
+ wxPen pen(gold);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint(0.0, ycur);
+ p1.AddLineToPoint((double)(m_szDrawco.GetWidth()), ycur);
+ gc->StrokePath(p1);
+ wxGraphicsPath p2 = gc->CreatePath();
+ p2.MoveToPoint(xcur, 0.0);
+ p2.AddLineToPoint(xcur, (double)(m_szDrawco.GetHeight()));
+ gc->StrokePath(p2);
+ gc->SetPen(wxNullPen);
+ }
+ }
+ }
+
+
+#line 2873 "WxdkdrawControlDraw.cpt"
+ /*
+ Objects under modification
+ */
+
+
+#line 2877 "WxdkdrawControlDraw.cpt"
+ if (StateHasObjectsUnderModification()) {
+
+#line 2878 "WxdkdrawControlDraw.cpt"
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != pobj) {
+
+#line 2882 "WxdkdrawControlDraw.cpt"
+ if (wxdobj_is_active(pobj)) {
+
+#line 2883 "WxdkdrawControlDraw.cpt"
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+
+
+#line 2885 "WxdkdrawControlDraw.cpt"
+ if (MustDrawElementInMarkupPass(pobj)) {
+
+
+#line 2887 "WxdkdrawControlDraw.cpt"
+ if (CanDrawElement(pobj)) {
+
+
+#line 2889 "WxdkdrawControlDraw.cpt"
+ switch (m_pParent->m_iState) {
+ /*
+ _STATE_ Do we need to draw the object
+ shifted?
+ */
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_LIBELEM_PLACE :
+ {
+ DrawElement(
+ gc, pobj, WXD_MARKUP_NONE,
+ &(m_pParent->m_ptMouseMoveDiff)
+ );
+ } break;
+ default : {
+ DrawElement(gc, pobj, WXD_MARKUP_NONE);
+ } break;
+ }
+ }
+ else {
+
+#line 2909 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ else {
+
+#line 2912 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ else {
+
+#line 2915 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ else {
+
+#line 2918 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ } while (NULL != pobj);
+ }
+
+
+#line 2923 "WxdkdrawControlDraw.cpt"
+ /*
+ Image object under construction
+ */
+ switch ( m_pParent->m_iState ) {
+ case S_IMG_2 : {
+ DrawImageRegion(gc);
+ } break;
+ case S_MOVEPT_PLACE : {
+ if (
+ (NULL != m_pParent->m_pCurrent)
+ && (WXD_OT_IMAGE == m_pParent->m_pCurrent->ot)
+ ) {
+#if 0
+ DrawObjectBoundingBox(m_pCurrent);
+#else
+ MarkupBoundingBox(
+ gc,
+ m_pParent->m_pCurrent,
+ &(((m_pParent->m_pCurrent)->det).i.br),
+ WXD_MARKUP_IMGRES, NULL
+ );
+#endif
+ }
+ } break;
+ }
+
+
+ /*
+ Objects to highlight as selected candidates for grouping
+ */
+
+
+#line 2954 "WxdkdrawControlDraw.cpt"
+ if (StateHasObjectsToHighlight2()) {
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != pobj) {
+
+#line 2959 "WxdkdrawControlDraw.cpt"
+ if (wxdobj_is_active(pobj)) {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_2)) {
+ if (MustHighlight2ElementInMarkupPass(pobj)) {
+ DrawElement(gc, pobj, WXD_MARKUP_GROUP);
+ }
+ else {
+
+#line 2965 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ else {
+
+#line 2968 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ else {
+
+#line 2971 "WxdkdrawControlDraw.cpt"
+ }
+ }
+ } while (NULL != pobj);
+ }
+
+
+#line 2976 "WxdkdrawControlDraw.cpt"
+ /*
+ Objects to highlight as candidate for copy, move, delete operation
+ or to change grouping selection
+ */
+
+
+#line 2981 "WxdkdrawControlDraw.cpt"
+ if (StateHasObjectsToHighlight()) {
+
+#line 2982 "WxdkdrawControlDraw.cpt"
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != pobj) {
+
+#line 2986 "WxdkdrawControlDraw.cpt"
+ if (wxdobj_is_active(pobj)) {
+ if (MustHighlightElementInMarkupPass(pobj)) {
+
+#line 2988 "WxdkdrawControlDraw.cpt"
+ if (CanDrawElement(pobj)) {
+
+#line 2989 "WxdkdrawControlDraw.cpt"
+ /*
+ _STATE_ Do we need to draw the object
+ highlighted?
+ */
+ switch (m_pParent->m_iState) {
+ case S_NOOP : {
+ DrawElement(gc, pobj, WXD_MARKUP_MOVE);
+ } break;
+ case S_DELETE :
+ case S_REGION_DELETE : {
+ DrawElement(gc, pobj, WXD_MARKUP_DELETE);
+ } break;
+ case S_DETAILS :
+ case S_UNGROUP :
+ case S_GROUP_ONE :
+ case S_FLIP :
+ case S_MOVE_SELECT :
+ case S_CONVERT :
+ case S_ROTATE :
+ {
+ DrawElement(gc, pobj, WXD_MARKUP_MOVE);
+ } break;
+ case S_COPY_SELECT : {
+ DrawElement(gc, pobj, WXD_MARKUP_COPY);
+ } break;
+ case S_MOD_SPLINE :
+ case S_MOVEPT_SELECT : {
+ DrawElement(gc, pobj, WXD_MARKUP_PTMOVE);
+ HighlightPointToMove(
+ gc, pobj, m_pParent->m_uCurrent
+ );
+ } break;
+ case S_DELPT : {
+ DrawElement(gc, pobj, WXD_MARKUP_PTMOVE);
+ HighlightPointToDelete(
+ gc, pobj, m_pParent->m_uCurrent
+ );
+ } break;
+ case S_ADDPT_SELECT : {
+ DrawElement(gc, pobj, WXD_MARKUP_PTMOVE);
+ HighlightPointToAdd(
+ gc, pobj, m_pParent->m_uCurrent,
+ m_pParent->m_bAppendPoint
+ );
+ } break;
+ }
+ }
+ }
+ }
+ }
+ } while (NULL != pobj);
+ }
+
+
+#line 3042 "WxdkdrawControlDraw.cpt"
+ /*
+ Selected object for style changes
+ */
+ if ((S_NOOP == m_pParent->m_iState) && (NULL != m_pParent->m_pStyle)) {
+ bool bStyleActive = true;
+ if (NULL != m_pParent->m_pStyle->play) {
+ if ((uint8_t)0U == m_pParent->m_pStyle->play->active) {
+ bStyleActive = false;
+ }
+ }
+ if (bStyleActive) {
+ HighlightStyleElement(gc, m_pParent->m_pStyle);
+ }
+ }
+ /*
+ Drawing borders
+ */
+
+
+#line 3060 "WxdkdrawControlDraw.cpt"
+ switch (m_pParent->m_iState) {
+ case S_DRWSZ_SELECT : case S_DRWSZ_PLACE : {
+ DK4_MEMCPY(\
+ &((m_pParent->m_oBorder).det.b.b),\
+ &(m_pParent->m_pDrw->bb),\
+ sizeof(Wxd_bb_t)\
+ );
+ DrawClosedPathElement(
+ gc, &(m_pParent->m_oBorder),
+ (
+ (
+ (S_DRWSZ_SELECT == m_pParent->m_iState)
+ && (m_pParent->m_bHaveCornerPoint)
+ )
+ ? (WXD_MARKUP_PTMOVE)
+ : (WXD_MARKUP_NONE)
+ ),
+ NULL
+ );
+ if (
+ (S_DRWSZ_SELECT == m_pParent->m_iState)
+ && (m_pParent->m_bHaveCornerPoint)
+ ) {
+ MarkupBoundingBox(
+ gc, &(m_pParent->m_oBorder),
+ &((m_pParent->m_oBorder).det.b.b),
+ WXD_MARKUP_PTMOVE, NULL
+ );
+ switch ( (int)(m_pParent->m_uCurrent) ) {
+ case 3 : {
+ DrawMarkupPoint(
+ gc, &(m_pParent->m_iv[IVI_M_MOVE_RED]),
+ (m_pParent->m_pDrw->bb).xl,
+ (m_pParent->m_pDrw->bb).yt,
+ 2, NULL
+ );
+ } break;
+ case 2 : {
+ DrawMarkupPoint(
+ gc, &(m_pParent->m_iv[IVI_M_MOVE_RED]),
+ (m_pParent->m_pDrw->bb).xr,
+ (m_pParent->m_pDrw->bb).yt,
+ 2, NULL
+ );
+ } break;
+ case 1 : {
+ DrawMarkupPoint(
+ gc, &(m_pParent->m_iv[IVI_M_MOVE_RED]),
+ (m_pParent->m_pDrw->bb).xr,
+ (m_pParent->m_pDrw->bb).yb,
+ 2, NULL
+ );
+ } break;
+ default : {
+ DrawMarkupPoint(
+ gc, &(m_pParent->m_iv[IVI_M_MOVE_RED]),
+ (m_pParent->m_pDrw->bb).xl,
+ (m_pParent->m_pDrw->bb).yb,
+ 2, NULL
+ );
+ } break;
+ }
+ }
+ } break;
+ }
+
+
+#line 3126 "WxdkdrawControlDraw.cpt"
+
+
+#line 3127 "WxdkdrawControlDraw.cpt"
+ switch (m_pParent->m_iState) {
+ case S_REGION_DELETE :
+ case S_GROUP_RECT_2 :
+ {
+ Wxd_bb_t ibb;
+ int rgb[3];
+ double xl;
+ double xr;
+ double yb;
+ double yt;
+ ibb.xl = m_pParent->m_ptMouseMoveStart.x;
+ ibb.xr = m_pParent->m_ptMousePosGrid.x;
+ ibb.yb = m_pParent->m_ptMouseMoveStart.y;
+ ibb.yt = m_pParent->m_ptMousePosGrid.y;
+ wxdobj_bb_correct(&ibb);
+ xl = ConvX(ibb.xl);
+ xr = ConvX(ibb.xr);
+ yb = ConvY(ibb.yb);
+ yt = ConvY(ibb.yt);
+ rgb[0] = 0;
+ rgb[1] = 0;
+ rgb[2] = 0;
+ switch (m_pParent->m_iState) {
+ case S_REGION_DELETE : {
+ rgb[0] = m_pParent->m_iv[IVI_M_DEL_RED];
+ rgb[1] = m_pParent->m_iv[IVI_M_DEL_GREEN];
+ rgb[2] = m_pParent->m_iv[IVI_M_DEL_BLUE];
+ } break;
+ }
+ {
+ wxColour black(rgb[0],rgb[1],rgb[2]);
+ wxPen pen(black);
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(xl, yt, (xr - xl), (yb - yt));
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ }
+ } break;
+ }
+
+
+#line 3169 "WxdkdrawControlDraw.cpt"
+ /*
+ Cursor
+ */
+
+
+#line 3173 "WxdkdrawControlDraw.cpt"
+ if (m_pParent->m_bMousePos) {
+ wxPen pen(*wxBLACK);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint((xcur - lcur), ycur);
+ p1.AddLineToPoint((xcur + lcur), ycur);
+ gc->StrokePath(p1);
+ wxGraphicsPath p2 = gc->CreatePath();
+ p2.MoveToPoint(xcur, (ycur - lcur));
+ p2.AddLineToPoint(xcur, (ycur + lcur));
+ gc->StrokePath(p2);
+ gc->SetPen(wxNullPen);
+ }
+
+
+#line 3188 "WxdkdrawControlDraw.cpt"
+
+
+#line 3189 "WxdkdrawControlDraw.cpt"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawControlDraw.cpt b/support/dktools/WxdkdrawControlDraw.cpt
new file mode 100644
index 0000000000..8e5ed49e64
--- /dev/null
+++ b/support/dktools/WxdkdrawControlDraw.cpt
@@ -0,0 +1,3195 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+# vim: set ai sw=4 ts=4 :
+
+%% module
+
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+double
+WxdkdrawFrame::Control::MarkupPointRadius(uint16_t lw)
+{
+ double back;
+ double max;
+ /* 2019-05-18 Modification
+ For texts (linewidth is 0) use same size as for a linewidth 2 line
+ */
+ if ((uint16_t)0U == lw) {
+ lw = (uint16_t)2U;
+ }
+ if ((uint16_t)12U >= lw) {
+ back = 1.75 * (double)(m_pParent->m_pDrw->baselw) * (double)lw;
+ }
+ else {
+ back =
+ (15.0 + 0.5 * ((double)lw)) * (double)(m_pParent->m_pDrw->baselw);
+ }
+
+ /* 2020-03-21 Modification
+ For moving, adding and deleting points the point markups should
+ not overlap
+ */
+ if (0 != m_pParent->m_iv[IVI_REDUCE_MARKUP_POINTS]) {
+ switch (m_pParent->m_iState) {
+ case S_MOVEPT_SELECT : case S_ADDPT_SELECT :
+ case S_DELPT : case S_MOD_SPLINE :
+ {
+ max = (double)m_uGridSnap / 2.0;
+ if (back > max) {
+ back = max;
+ }
+ } break;
+ }
+ }
+
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawMarkupPoint(
+ wxGraphicsContext *gc,
+ int const *sc,
+ double x,
+ double y,
+ uint16_t lw,
+ Wxd_point_t const *pShift
+)
+{
+ double r; /* Half side length of markup square */
+ int32_t shiftx = 0L; /* X shift distance */
+ int32_t shifty = 0L; /* Y shift distance */
+ $? "+ DrawMarkupPoint (double)"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ x = ConvX(x + (double)shiftx);
+ y = ConvY(y + (double)shifty);
+ r = ConvDist(MarkupPointRadius(lw));
+ wxColour fc(sc[0], sc[1], sc[2]);
+ wxBrush br(fc);
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint((x - r), (y - r));
+ p1.AddLineToPoint((x + r), (y - r));
+ p1.AddLineToPoint((x + r), (y + r));
+ p1.AddLineToPoint((x - r), (y + r));
+ p1.AddLineToPoint((x - r), (y - r));
+ p1.CloseSubpath();
+ gc->FillPath(p1);
+ gc->SetBrush(wxNullBrush);
+ $? "- DrawMarkupPoint (double)"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawMarkupPoint(
+ wxGraphicsContext *gc,
+ int const *sc,
+ int32_t x,
+ int32_t y,
+ uint16_t lw,
+ Wxd_point_t const *pShift
+)
+{
+ $? "+ DrawMarkupPoint (int32_t)"
+ DrawMarkupPoint(gc, sc, (double)x, (double)y, lw, pShift);
+ $? "- DrawMarkupPoint (int32_t)"
+}
+
+
+
+bool
+WxdkdrawFrame::Control::StateHasObjectsUnderModification(void)
+{
+ bool back = false;
+ $? "+ StateHasObjectsUnderModification"
+ /*
+ _STATE_ Do we have objects under modification which must
+ be drawn in markup pass?
+ */
+ switch (m_pParent->m_iState) {
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FURTHER :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ case S_DETAILS_2 :
+ {
+ back = true;
+ } break;
+ }
+ $? "- StateHasObjectsUnderModification %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::StateHasObjectsToHighlight(void)
+{
+ bool back = false;
+ $? "+ StateHasObjectsToHighlight"
+ /*
+ _STATE_ Do we have object to highlight?
+ */
+ switch ( m_pParent->m_iState ) {
+ case S_NOOP : { $? ". S_NOOP"
+ back = true;
+ } break;
+ case S_DELETE :
+ case S_REGION_DELETE :
+ case S_MOVE_SELECT :
+ case S_COPY_SELECT :
+ case S_MOVEPT_SELECT :
+ case S_DELPT :
+ case S_ADDPT_SELECT :
+ case S_FLIP :
+ case S_GROUP_ONE :
+ case S_UNGROUP :
+ case S_DETAILS :
+ case S_CONVERT :
+ case S_ROTATE :
+ case S_MOD_SPLINE :
+ {
+ back = true;
+ } break;
+ }
+ $? "- StateHasObjectsToHighlight %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::StateHasObjectsToHighlight2(void)
+{
+ bool back = false;
+ $? "+ StateHasObjectsToHighlight2"
+ switch (m_pParent->m_iState) {
+ /*
+ _STATE_ State has object to mark for grouping
+ */
+ case S_GROUP_ONE :
+ case S_GROUP_RECT_2 : {
+ back = true;
+ } break;
+ }
+ $? "- StateHasObjectsToHighlight2 %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::StateUsesPlacementHelp(void)
+{
+ bool back = false;
+ $? "+ StateUsesPlacementHelp"
+ /*
+ _STATE_ Does state use placement help?
+ */
+ switch (m_pParent->m_iState) {
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_POLY_FIRST :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FIRST :
+ case S_SPLINE_FURTHER :
+ case S_BOX_FIRST :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_CENTER :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CENTER :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_1 :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_DOT :
+ case S_TEXT :
+ case S_IMG_1 :
+ case S_IMG_2 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ case S_DRWSZ_PLACE :
+ case S_GROUP_RECT_1 :
+ case S_DELETE :
+ {
+ back = true;
+ } break;
+ }
+ $? "- StateUsesPlacementHelp %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::CanDrawElement(Wxd_object_t const *pobj)
+{
+ bool back = true;
+ $? "+ CanDrawElement %d", (int)(pobj->ot)
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : { $? ". text"
+ if (NULL == (pobj->det).t.t) { $? "! t"
+ back = false;
+ }
+ if (0U == (pobj->det).t.fsz) { $? "! fsz"
+ back = false;
+ }
+ if (NULL == (pobj->det).t.font) { $? "! font"
+ back = false;
+ }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if (NULL == (pobj->det).p.p) { back = false; }
+ if (2U > (pobj->det).p.n) { back = false; }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if (NULL == (pobj->det).s.p) { back = false; }
+ if (2U > (pobj->det).s.n) { back = false; }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ } break;
+ case WXD_OT_CIRCLE : {
+ if (0U == (pobj->det).e.rx) { back = false; }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ if (0U == (pobj->det).e.rx) { back = false; }
+ if (0U == (pobj->det).e.ry) { back = false; }
+ } break;
+ case WXD_OT_BOX : {
+ } break;
+ case WXD_OT_IMAGE : {
+ if (NULL == (pobj->det).i.fn) { back = false; }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ if (0U == (pobj->det).d.d) { back = false; }
+ } break;
+ }
+ $? "- CanDrawElement %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::MustDrawElementInNormalPass(
+ Wxd_object_t const *pobj
+)
+{
+ bool back = true;
+ $? "+ MustDrawElementInNormalPass"
+ /*
+ _STATE_ Do we need to draw object in normal drawing pass?
+ */
+ switch (m_pParent->m_iState) {
+ case S_MOVE_PLACE :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FURTHER :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ case S_DETAILS_2 :
+ {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ back = false;
+ }
+ } break;
+ }
+ $? "- MustDrawElementInNormalPass %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::MustDrawElementInMarkupPass(
+ Wxd_object_t const *pobj
+)
+{
+ bool back = false;
+ $? "+ MustDrawElementInMarkupPass"
+ /*
+ _STATE_ Do we need to draw object in markup pass?
+ */
+ switch (m_pParent->m_iState) {
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FURTHER :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ case S_DETAILS_2 :
+ {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ back = true;
+ }
+ } break;
+ }
+ $? "- MustDrawElementInMarkupPass %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::MustHighlightElementInMarkupPass(
+ Wxd_object_t const *pobj
+)
+{
+ bool back = false;
+ $? "+ MustHighlightElementInMarkupPass"
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ /*
+ _STATE_ Do we need to highlight object in markup pass?
+ */
+ switch (m_pParent->m_iState) {
+ case S_NOOP : {
+ back = true;
+ } break;
+ case S_DELETE :
+ case S_REGION_DELETE :
+ case S_MOVE_SELECT :
+ case S_COPY_SELECT :
+ case S_MOVEPT_SELECT :
+ case S_DELPT :
+ case S_ADDPT_SELECT :
+ case S_FLIP :
+ case S_GROUP_ONE :
+ case S_UNGROUP :
+ case S_DETAILS :
+ case S_CONVERT :
+ case S_ROTATE :
+ case S_MOD_SPLINE :
+ {
+ back = true;
+ } break;
+ }
+ }
+ $? "- MustHighlightElementInMarkupPass %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::Control::MustHighlight2ElementInMarkupPass(
+ Wxd_object_t const *pobj
+)
+{
+ bool back = false;
+ $? "+ MustHighlight2ElementInMarkupPass"
+ /*
+ _STATE_ : Must highlight element with marker 2 in markup pass
+ */
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_2)) {
+ switch (m_pParent->m_iState) {
+ case S_GROUP_ONE :
+ case S_GROUP_RECT_2 :
+ {
+ back = true;
+ } break;
+ }
+ }
+ $? "- MustHighlight2ElementInMarkupPass %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::Control::ChooseStrokeColour(
+ int *sc,
+ Wxd_object_t const *pObj,
+ int iMarkup
+)
+{
+ unsigned i;
+ $? "+ ChooseStrokeColour"
+ switch (iMarkup) {
+ case WXD_MARKUP_COPY : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_COPY_RED]),(3*sizeof(int)));
+ } break;
+ case WXD_MARKUP_MOVE : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_MOVE_RED]),(3*sizeof(int)));
+ } break;
+ case WXD_MARKUP_DELETE : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_DEL_RED]),(3*sizeof(int)));
+ } break;
+ case WXD_MARKUP_GROUP : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_GROUP_RED]),(3*sizeof(int)));
+ } break;
+ case WXD_MARKUP_PTMOVE : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_MOVE_RED]),(3*sizeof(int)));
+ for (i = 0; i < 3; i++) {
+ sc[i] = (sc[i] + 2 * 255) / 3;
+ }
+ } break;
+ case WXD_MARKUP_IMGRES : {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_MOVE_RED]),(3*sizeof(int)));
+ } break;
+ default : {
+ sc[0] = (int)(pObj->sc[0]);
+ sc[1] = (int)(pObj->sc[1]);
+ sc[2] = (int)(pObj->sc[2]);
+ } break;
+ }
+ $? "- ChooseStrokeColour"
+}
+
+
+
+void
+WxdkdrawFrame::Control::SetupPenForObject(
+ wxPen & pen,
+ Wxd_object_t const *pObj,
+ wxDash *pDash,
+ int *pNdash
+)
+{
+ $? "+ SetupPenForObject"
+ if (WXD_LS_SOLID != pObj->ls) {
+ int ldash = (int)(pObj->sl);
+ int ldots = 1;
+ int lgaps = ((3 < ldash) ? (2) : (1));
+ if (WXD_LS_DOT == pObj->ls) {
+ lgaps = ldots;
+ }
+ switch (pObj->cs) {
+ case WXD_LC_PROJECTING : case WXD_LC_ROUNDED : {
+ ldots = 0;
+ lgaps++;
+ } break;
+ }
+ switch (pObj->ls) {
+ case WXD_LS_DASH_DOT_DOT_DOT : {
+ pDash[0] = ldash;
+ pDash[1] = lgaps;
+ pDash[2] = ldots;
+ pDash[3] = lgaps;
+ pDash[4] = ldots;
+ pDash[5] = lgaps;
+ pDash[6] = ldots;
+ pDash[7] = lgaps;
+ *pNdash = 8;
+ } break;
+ case WXD_LS_DASH_DOT_DOT : {
+ pDash[0] = ldash;
+ pDash[1] = lgaps;
+ pDash[2] = ldots;
+ pDash[3] = lgaps;
+ pDash[4] = ldots;
+ pDash[5] = lgaps;
+ *pNdash = 6;
+ } break;
+ case WXD_LS_DASH_DOT : {
+ pDash[0] = ldash;
+ pDash[1] = lgaps;
+ pDash[2] = ldots;
+ pDash[3] = lgaps;
+ *pNdash = 4;
+ } break;
+ case WXD_LS_DOT : {
+ pDash[0] = ldots;
+ pDash[1] = lgaps;
+ *pNdash = 2;
+ } break;
+ default : { /* dash */
+ pDash[0] = ldash;
+ pDash[1] = lgaps;
+ *pNdash = 2;
+ } break;
+ } $? ". set dashes"
+ pen.SetStyle(wxPENSTYLE_USER_DASH);
+ pen.SetDashes(*pNdash, pDash);
+
+ }
+ else {
+ }
+ switch (pObj->cs) {
+ case WXD_LC_PROJECTING : { $? ". lc projecting"
+ pen.SetCap(wxCAP_PROJECTING);
+ } break;
+ case WXD_LC_ROUNDED : { $? ". lc rounded"
+ pen.SetCap(wxCAP_ROUND);
+ } break;
+ default : { $? ". lc butted"
+ pen.SetCap(wxCAP_BUTT);
+ } break;
+ }
+ switch ( (int)(pObj->ot) ) {
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ pen.SetJoin(wxJOIN_ROUND);
+ } break;
+ default : {
+ switch (pObj->js) {
+ case WXD_LJ_BEVELED : { $? ". lj beveled"
+ pen.SetJoin(wxJOIN_BEVEL);
+ } break;
+ case WXD_LJ_ROUNDED : { $? ". lj rounded"
+ pen.SetJoin(wxJOIN_ROUND);
+ } break;
+ default : { $? ". lj mitered"
+ pen.SetJoin(wxJOIN_MITER);
+ } break;
+ }
+ } break;
+ }
+ $? "- SetupPenForObject"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawTextElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour */
+ wxChar const *t = NULL; /* Text to show */
+ wxDouble tw(0.0); /* Text width in pixels */
+ wxDouble th(0.0); /* Text height in pixels */
+ wxDouble td(0.0); /* Text descender in pixels */
+ wxDouble el(0.0); /* External leader in pixels */
+ double w; /* Text width in pixels */
+ double h; /* Text height in pixels */
+ double d; /* Text descender in pixels */
+ double x; /* Text x position */
+ double y; /* Text y position */
+ double alpha; /* Text rotation in radians */
+ int32_t shiftx; /* X shift */
+ int32_t shifty; /* Y shift */
+ $? "+ DrawTextElement"
+ shiftx = 0L;
+ shifty = 0L;
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ t = (
+ (NULL != (pObj->det).t.tsc) ? ((pObj->det).t.tsc) : ((pObj->det).t.t)
+ );
+ if ((NULL != t) && ((uint16_t)0 < (pObj->det).t.fsz)) {
+ alpha = ((double)((pObj->det).t.a) * M_PI) / 180.0;
+ if (NULL != (pObj->det).t.font) {
+ if (NULL != ((pObj->det).t.font)->font) {
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ wxColour fcol(sc[0], sc[1], sc[2]);
+ gc->SetFont(*(((pObj->det).t.font)->font), fcol);
+ gc->GetTextExtent(t, &tw, &th, &td, &el);
+ w = (double)tw; h = (double)th; d = (double)td;
+ x = ConvX((pObj->det).t.x + shiftx);
+ y = ConvY((pObj->det).t.y + shifty);
+ if ((int16_t)0 != (pObj->det).t.a) {
+ switch ((pObj->det).t.al) {
+ case WXD_TA_RIGHT : {
+ x -= (w * cos(alpha));
+ y += (w * sin(alpha));
+ } break;
+ case WXD_TA_CENTERED : {
+ x -= ((w * cos(alpha)) / 2.0);
+ y += ((w * sin(alpha)) / 2.0);
+ } break;
+ }
+ x += ((d - h) * sin(alpha));
+ y += ((d - h) * cos(alpha));
+ gc->DrawText(t, x, y, alpha);
+ }
+ else {
+ switch ((pObj->det).t.al) {
+ case WXD_TA_RIGHT : {
+ x -= w;
+ } break;
+ case WXD_TA_CENTERED : {
+ x -= (w / 2.0);
+ } break;
+ }
+ y += (d - h);
+ gc->DrawText(t, x, y);
+ }
+ gc->SetFont(wxNullFont, wxNullColour);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ DrawMarkupPoint(
+ gc, sc, (pObj->det).t.x, (pObj->det).t.y, 0U, pShift
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! font->font missing"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! font missing"
+ }
+#endif
+ }
+ $? "- DrawTextElement"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathPolyline(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ uint16_t i; /* Current point index */
+ $? "+ PathPolyline"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ for (i = 0U; i < (pObj->det).p.n; i++) {
+ if (0U == i) {
+ p.MoveToPoint(
+ ConvX((double)(((pObj->det).p.p)[i].x) + shiftx),
+ ConvY((double)(((pObj->det).p.p)[i].y) + shifty)
+ );
+ }
+ else {
+ p.AddLineToPoint(
+ ConvX((double)(((pObj->det).p.p)[i].x) + shiftx),
+ ConvY((double)(((pObj->det).p.p)[i].y) + shifty)
+ );
+ }
+ }
+ if (WXD_OT_POLYGON == pObj->ot) {
+ p.AddLineToPoint(
+ ConvX((double)(((pObj->det).p.p)[0].x) + shiftx),
+ ConvY((double)(((pObj->det).p.p)[0].y) + shifty)
+ );
+ p.CloseSubpath();
+ }
+ $? "- PathPolyline"
+}
+
+
+
+void
+WxdkdrawFrame::Control::SplineSegment(
+ wxGraphicsPath & p,
+ Wxd_spline_point_t *pt,
+ dk4_xsp_2d_t *xsp,
+ uint16_t segno,
+ size_t subsegs,
+ double divisor,
+ double shiftx,
+ double shifty,
+ uint16_t ib,
+ uint16_t ic
+)
+{
+#if 0
+ /*
+ 2019-04-28
+ This deactivated section shows real variable names.
+ The active section below uses and copies array members
+ directly for performance reasons.
+ */
+ double rp[4];
+ double x0;
+ double y0;
+ double dxdt0;
+ double dydt0;
+ double x1;
+ double y1;
+ double dxdt1;
+ double dydt1;
+ double t;
+ size_t ss;
+
+ if ((1.0e-7 > fabs(pt[ib].s)) && (1.0e-7 > fabs(pt[ic].s))) {
+ if (0U == segno) {
+ p.MoveToPoint( ConvX(pt[ib].x + shiftx), ConvY(pt[ib].y + shifty) );
+ }
+ p.AddLineToPoint( ConvX(pt[ic].x + shiftx), ConvY(pt[ic].y + shifty) );
+ }
+ else {
+ dk4xsp2d_calculate_value_derivative(rp, xsp, 0.0, NULL);
+ x0 = rp[0];
+ y0 = rp[2];
+ dxdt0 = rp[1] / divisor;
+ dydt0 = rp[3] / divisor;
+ if (0U == segno) {
+ p.MoveToPoint( ConvX(x0 + shiftx), ConvY(y0 + shifty) );
+ }
+ for (ss = 0; ss < subsegs; ss++) {
+ if ((subsegs - (size_t)1U) == ss) {
+ t = 1.0;
+ }
+ else {
+ t = (double)(ss + (size_t)1U) / (double)subsegs;
+ }
+ dk4xsp2d_calculate_value_derivative(rp, xsp, t, NULL);
+ x1 = rp[0];
+ y1 = rp[2];
+ dxdt1 = rp[1] / divisor;
+ dydt1 = rp[3] / divisor;
+ p.AddCurveToPoint(
+ ConvX(x0 + dxdt0 + shiftx), ConvY(y0 + dydt0 + shifty),
+ ConvX(x1 - dxdt1 + shiftx), ConvY(y1 - dydt1 + shifty),
+ ConvX(x1 + shiftx), ConvY(y1 + shifty)
+ );
+ x0 = x1;
+ y0 = y1;
+ dxdt0 = dxdt1;
+ dydt0 = dydt1;
+ }
+ }
+#endif
+ double rp0[4];
+ double rp1[4];
+ double t;
+ size_t ss;
+
+ if ((1.0e-7 > fabs(pt[ib].s)) && (1.0e-7 > fabs(pt[ic].s))) {
+ /*
+ Both start and end of segment have s=0 so we can draw a
+ straight line.
+ */
+ if (0U == segno) {
+ p.MoveToPoint( ConvX(pt[ib].x + shiftx), ConvY(pt[ib].y + shifty) );
+ }
+ p.AddLineToPoint( ConvX(pt[ic].x + shiftx), ConvY(pt[ic].y + shifty) );
+ }
+ else {
+ /*
+ At least one from start and end has s!=0 so we must draw
+ a spline sequence.
+ */
+ dk4xsp2d_calculate_value_derivative(rp0, xsp, 0.0, NULL);
+ rp0[1] = rp0[1] / divisor;
+ rp0[3] = rp0[3] / divisor;
+ if (0U == segno) {
+ p.MoveToPoint( ConvX(rp0[0] + shiftx), ConvY(rp0[2] + shifty) );
+ }
+ for (ss = 0; ss < subsegs; ss++) {
+ if ((subsegs - (size_t)1U) == ss) {
+ t = 1.0;
+ }
+ else {
+ t = (double)(ss + (size_t)1U) / (double)subsegs;
+ }
+ dk4xsp2d_calculate_value_derivative(rp1, xsp, t, NULL);
+ rp1[1] = rp1[1] / divisor;
+ rp1[3] = rp1[3] / divisor;
+ p.AddCurveToPoint(
+ ConvX(rp0[0]+rp0[1]+shiftx), ConvY(rp0[2]+rp0[3]+shifty),
+ ConvX(rp1[0]-rp1[1]+shiftx), ConvY(rp1[2]-rp1[3]+shifty),
+ ConvX(rp1[0] + shiftx), ConvY(rp1[2] + shifty)
+ );
+ DK4_MEMCPY(rp0,rp1,(sizeof(double)*4));
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathSpline(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_xsp_2d_t xsp; /* 2D X-spline */
+ Wxd_spline_point_t *pt; /* Address of spline points array */
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ double divisor; /* Divisor in calculations */
+ size_t subsegs; /* Number of subsegments */
+ uint16_t ia; /* Index of point A */
+ uint16_t ib; /* Index of point B */
+ uint16_t ic; /* Index of point C */
+ uint16_t id; /* Index of point D */
+ uint16_t segno; /* Current segment index */
+ uint16_t segments; /* Number of segments */
+
+ $? "+ PathSpline"
+ dk4xsp2d_reset(&xsp);
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ segments = (pObj->det).s.n - (uint16_t)1U;
+ pt = (pObj->det).s.p;
+ subsegs = (size_t)(m_pParent->m_iv[IVI_XS_SUBSEGS]);
+ if (1U > subsegs) { subsegs = 1U; }
+ divisor = 3.0 * (double)subsegs;
+ for (segno = 0U; segno < segments; segno++) {
+ dk4xsp2d_reset_points(&xsp);
+ ib = segno;
+ ic = ib + 1;
+ dk4xsp2d_set_point(&xsp, pt[ib].x, pt[ib].y, pt[ib].s, 1);
+ dk4xsp2d_set_point(&xsp, pt[ic].x, pt[ic].y, pt[ic].s, 2);
+ if (0U < ib) {
+ ia = ib - (uint16_t)1U;
+ dk4xsp2d_set_point(&xsp, pt[ia].x, pt[ia].y, pt[ia].s, 0);
+ }
+ else {
+ if (WXD_OT_C_SPLINE == pObj->ot) {
+ ia = segments;
+ dk4xsp2d_set_point(&xsp, pt[ia].x, pt[ia].y, pt[ia].s, 0);
+ }
+ }
+ if (ic < segments) {
+ id = ic + (uint16_t)1U;
+ dk4xsp2d_set_point(&xsp, pt[id].x, pt[id].y, pt[id].s, 3);
+ }
+ else {
+ if (WXD_OT_C_SPLINE == pObj->ot) {
+ id = 0;
+ dk4xsp2d_set_point(&xsp, pt[id].x, pt[id].y, pt[id].s, 3);
+ }
+ }
+ SplineSegment(
+ p, pt, &xsp, segno, subsegs, divisor, shiftx, shifty, ib, ic
+ );
+ }
+ if (WXD_OT_C_SPLINE == pObj->ot) {
+ dk4xsp2d_reset_points(&xsp);
+ ia = segments - (uint16_t)1U;
+ ib = segments;
+ ic = 0U;
+ id = 1U;
+ dk4xsp2d_set_point(&xsp, pt[ia].x, pt[ia].y, pt[ia].s, 0);
+ dk4xsp2d_set_point(&xsp, pt[ib].x, pt[ib].y, pt[ib].s, 1);
+ dk4xsp2d_set_point(&xsp, pt[ic].x, pt[ic].y, pt[ic].s, 2);
+ dk4xsp2d_set_point(&xsp, pt[id].x, pt[id].y, pt[id].s, 3);
+ SplineSegment(
+ p, pt, &xsp, segments, subsegs, divisor, shiftx, shifty, ib, ic
+ );
+ p.CloseSubpath();
+ }
+ $? "- PathSpline"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathArc(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ double deltaa; /* Difference start angle to end angle */
+ double x0; /* Segment start point X position */
+ double y0; /* Segment start point Y position */
+ double dxdt0; /* Segment start point X derivative */
+ double dydt0; /* Segment start point Y derivative */
+ double x1; /* Segment end point X position */
+ double y1; /* Segment end point Y position */
+ double dxdt1; /* Segment end point X derivative */
+ double dydt1; /* Segment end point Y derivative */
+ double cx0; /* Converted start point X */
+ double cy0; /* Converted start point Y */
+ double a0; /* Segment start angle */
+ double a1; /* Segment end angle */
+ double kappa; /* Kappa value for segment */
+ size_t segments; /* Number of segments */
+ size_t i; /* Index of current segment */
+ $? "+ PathArc"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ if ((int8_t)0 != (pObj->det).a.d) {
+ segments = (size_t)dk4ma_rint(
+ ceil( fabs((pObj->det).a.b - (pObj->det).a.a) / M_PI_2 )
+ );
+ a0 = (pObj->det).a.a;
+ x0 = (pObj->det).a.x + (pObj->det).a.r * cos(a0) + shiftx;
+ y0 = (pObj->det).a.y + (pObj->det).a.r * sin(a0) + shifty;
+ cx0 = ConvX(x0);
+ cy0 = ConvY(y0);
+
+ p.MoveToPoint(cx0, cy0);
+ deltaa = (pObj->det).a.b - (pObj->det).a.a;
+ for (i = 0; i < segments; i++) {
+ if (i >= (segments - 1)) {
+ a1 = (pObj->det).a.b;
+ }
+ else {
+ a1 = (pObj->det).a.a
+ + ((double)(i + (size_t)1) * deltaa) / (double)segments;
+ }
+ kappa = dk4gratool_kappa_for_angle(fabs(a1 - a0));
+ dxdt0 = -1.0 * (a1 - a0) * (pObj->det).a.r * sin(a0);
+ dydt0 = (a1 - a0) * (pObj->det).a.r * cos(a0);
+ x1 = (pObj->det).a.x + (pObj->det).a.r * cos(a1) + shiftx;
+ y1 = (pObj->det).a.y + (pObj->det).a.r * sin(a1) + shifty;
+ dxdt1 = -1.0 * (a1 - a0) * (pObj->det).a.r * sin(a1);
+ dydt1 = (a1 - a0) * (pObj->det).a.r * cos(a1);
+ p.AddCurveToPoint(
+ ConvX(x0 + kappa * dxdt0), ConvY(y0 + kappa * dydt0),
+ ConvX(x1 - kappa * dxdt1), ConvY(y1 - kappa * dydt1),
+ ConvX(x1), ConvY(y1)
+ );
+ a0 = a1;
+ x0 = x1;
+ y0 = y1;
+ }
+ if (WXD_OT_C_ARC == pObj->ot) {
+ p.AddLineToPoint(
+ ConvX((pObj->det).a.x + shiftx), ConvY((pObj->det).a.y + shifty)
+ );
+ p.AddLineToPoint(cx0, cy0);
+ p.CloseSubpath();
+ }
+ }
+ else {
+ x0 = (double)((pObj->det).a.x1) + shiftx;
+ y0 = (double)((pObj->det).a.y1) + shifty;
+ cx0 = ConvX(x0);
+ cy0 = ConvY(y0);
+ p.MoveToPoint(cx0, cy0);
+ p.AddLineToPoint(
+ ConvX((double)((pObj->det).a.x2) + shiftx),
+ ConvY((double)((pObj->det).a.y2) + shifty)
+ );
+ p.AddLineToPoint(
+ ConvX((double)((pObj->det).a.x3) + shiftx),
+ ConvY((double)((pObj->det).a.y3) + shifty)
+ );
+ if (WXD_OT_C_ARC == pObj->ot) {
+ p.AddLineToPoint(cx0, cy0);
+ p.CloseSubpath();
+ }
+ }
+ $? "- PathArc"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathCircle(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ $? "+ PathCircle"
+ p.AddCircle(
+ ConvX((double)((pObj->det).e.x) + shiftx),
+ ConvY((double)((pObj->det).e.y) + shifty),
+ fabs(ConvDist((double)((pObj->det).e.rx)))
+ );
+ $? "- PathCircle"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathEllipse(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_gra_point_t pt[DK4_GRA_CIRCLE_POINTS]; /* Point set for circle */
+ dk4_er_t er; /* Error report */
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ size_t const szpt = DK4_SIZEOF(pt,dk4_gra_point_t);
+ size_t i; /* Current segment index */
+ size_t c1; /* First ctrl pt index */
+ size_t c2; /* Second ctrl pt index */
+ size_t c3; /* Segment index */
+ int res; /* Intermediate result */
+ $? "+ PathEllipse"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ if ((int16_t)0 != (pObj->det).e.a) {
+ dk4error_init(&er);
+ res = dk4gratool_points_for_ellipse(
+ pt, szpt,
+ ((double)((pObj->det).e.x) + shiftx),
+ ((double)((pObj->det).e.y) + shifty),
+ (double)((pObj->det).e.rx), (double)((pObj->det).e.ry),
+ ((M_PI * (double)((pObj->det).e.a)) / 180.0),
+ &er
+ );
+ if (0 != res) {
+ p.MoveToPoint(ConvX(pt[0].x), ConvY(pt[0].y));
+ for (i = 0; i < (szpt / (size_t)3U); i++) {
+ c1 = 3 * i + 1;
+ c2 = 3 * i + 2;
+ c3 = 3 * i + 3;
+ if (DK4_GRA_CIRCLE_POINTS <= c3) { c3 = 0; }
+ p.AddCurveToPoint(
+ ConvX(pt[c1].x), ConvY(pt[c1].y),
+ ConvX(pt[c2].x), ConvY(pt[c2].y),
+ ConvX(pt[c3].x), ConvY(pt[c3].y)
+ );
+ }
+ p.CloseSubpath();
+ }
+ }
+ else {
+ p.AddEllipse(
+ ConvX(
+ (double)((pObj->det).e.x) - (double)((pObj->det).e.rx) + shiftx
+ ),
+ ConvY(
+ (double)((pObj->det).e.y) + (double)((pObj->det).e.ry) + shifty
+ ),
+ ConvDist(2.0 * (pObj->det).e.rx),
+ ConvDist(2.0 * (pObj->det).e.ry)
+ );
+ }
+ $? "- PathEllipse"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PathBox(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_bb_t bb; /* Bounding box data */
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ double w; /* Box width */
+ double h; /* Box height */
+ double r; /* Corner radius */
+ $? "+ PathBox"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ if ((pObj->det).b.b.xl <= (pObj->det).b.b.xr) {
+ bb.xmin = (double)((pObj->det).b.b.xl);
+ bb.xmax = (double)((pObj->det).b.b.xr);
+ w = (double)((pObj->det).b.b.xr) - (double)((pObj->det).b.b.xl);
+ }
+ else {
+ bb.xmax = (double)((pObj->det).b.b.xl);
+ bb.xmin = (double)((pObj->det).b.b.xr);
+ w = (double)((pObj->det).b.b.xl) - (double)((pObj->det).b.b.xr);
+ }
+ if ((pObj->det).b.b.yb <= (pObj->det).b.b.yt) {
+ bb.ymin = (double)((pObj->det).b.b.yb);
+ bb.ymax = (double)((pObj->det).b.b.yt);
+ h = (double)((pObj->det).b.b.yt) - (double)((pObj->det).b.b.yb);
+ }
+ else {
+ bb.ymax = (double)((pObj->det).b.b.yb);
+ bb.ymin = (double)((pObj->det).b.b.yt);
+ h = (double)((pObj->det).b.b.yb) - (double)((pObj->det).b.b.yt);
+ }
+ bb.xmin = ConvX(bb.xmin + shiftx);
+ bb.xmax = ConvX(bb.xmax + shiftx);
+ bb.ymin = ConvY(bb.ymin + shifty);
+ bb.ymax = ConvY(bb.ymax + shifty);
+ w = ConvDist(w);
+ h = ConvDist(h);
+ if ((uint32_t)0UL < (pObj->det).b.r) {
+ r = ConvDist((double)((pObj->det).b.r));
+ if (r > (w / 2.0)) { r = w / 2.0; }
+ if (r > (h / 2.0)) { r = h / 2.0; }
+ p.AddRoundedRectangle(bb.xmin, bb.ymax, w, h, r);
+ }
+ else {
+ p.AddRectangle(bb.xmin, bb.ymax, w, h);
+ }
+ $? "- PathBox"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupPolyline(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half markup point length (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Left x value for markup square (pixels) */
+ double yt; /* Top y value for markup square (pixels) */
+ double w; /* Markup square width (pixels) */
+ uint16_t i; /* Current point index */
+ $? "+ MarkupPolyline"
+ if ((NULL != (pObj->det).p.p) && (0 < (pObj->det).p.n)) {
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ gc->SetBrush(brstr);
+ gc->SetPen(wxNullPen);
+ w = ConvDist(2.0 * r);
+ for (i = 0; i < (pObj->det).p.n; i++) {
+ $? ". point %u", (unsigned)i
+ wxGraphicsPath p = gc->CreatePath();
+ xl = ConvX((double)(((pObj->det).p.p)[i].x) + shiftx - r);
+ yt = ConvY((double)(((pObj->det).p.p)[i].y) + shifty + r);
+ $? ". xl (pixel) = %g", xl
+ $? ". yt (pixel) = %g", yt
+ $? ". w (pixel) = %g", w
+ p.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p);
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+ }
+ $? "- MarkupPolyline"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupSpline(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half width of markup square (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Left x of markup square (pixels) */
+ double yt; /* Top y of markup square (pixels) */
+ double w; /* Markup square width (pixels) */
+ uint16_t i; /* Current point index */
+ $? "+ MarkupSpline"
+ if ((NULL != (pObj->det).s.p) && (0 < (pObj->det).s.n)) {
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ gc->SetBrush(brstr);
+ gc->SetPen(wxNullPen);
+ w = ConvDist(2.0 * r);
+ for (i = 0; i < (pObj->det).s.n; i++) {
+ $? ". point %u", (unsigned)i
+ wxGraphicsPath p = gc->CreatePath();
+ xl = ConvX((double)(((pObj->det).s.p)[i].x) + shiftx - r);
+ yt = ConvY((double)(((pObj->det).s.p)[i].y) + shifty + r);
+ $? ". xl (pixel) = %g", xl
+ $? ". yt (pixel) = %g", yt
+ $? ". w (pixel) = %g", w
+ p.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p);
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+ }
+ $? "- MarkupSpline"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupArc(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half width of markup square (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Left x of markup square (pixels) */
+ double yt; /* Top y of markup square (pixels) */
+ double w; /* Markup square width (pixels) */
+ $? "+ MarkupArc"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ gc->SetBrush(brstr);
+ gc->SetPen(wxNullPen);
+ w = ConvDist(2.0 * r);
+ {
+ wxGraphicsPath p1 = gc->CreatePath();
+ xl = ConvX((double)((pObj->det).a.x1) + shiftx - r);
+ yt = ConvY((double)((pObj->det).a.y1) + shifty + r);
+ p1.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p1);
+ }
+ {
+ wxGraphicsPath p2 = gc->CreatePath();
+ xl = ConvX((double)((pObj->det).a.x2) + shiftx - r);
+ yt = ConvY((double)((pObj->det).a.y2) + shifty + r);
+ p2.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p2);
+ }
+ {
+ wxGraphicsPath p3 = gc->CreatePath();
+ xl = ConvX((double)((pObj->det).a.x3) + shiftx - r);
+ yt = ConvY((double)((pObj->det).a.y3) + shifty + r);
+ p3.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p3);
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+ $? "- MarkupArc"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupCircle(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half width of markup square (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double x; /* Markup point x (wxd) */
+ double y; /* Markup point y (wxd) */
+ double xl; /* Left x of markup square (pixels) */
+ double yt; /* Top y of markup square (pixels) */
+ double w; /* Markup square width (pixels) */
+ $? "+ MarkupCircle"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ gc->SetBrush(brstr);
+ gc->SetPen(wxNullPen);
+ w = ConvDist(2.0 * r);
+ {
+ wxGraphicsPath p1 = gc->CreatePath();
+ x = (double)((pObj->det).e.x) - (double)((pObj->det).e.rx);
+ y = (double)((pObj->det).e.y);
+ xl = ConvX(x + shiftx - r);
+ yt = ConvY(y + shifty + r);
+ p1.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p1);
+ }
+ {
+ wxGraphicsPath p2 = gc->CreatePath();
+ x = (double)((pObj->det).e.x) + (double)((pObj->det).e.rx);
+ y = (double)((pObj->det).e.y);
+ xl = ConvX(x + shiftx - r);
+ yt = ConvY(y + shifty + r);
+ p2.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p2);
+ }
+ {
+ wxGraphicsPath p3 = gc->CreatePath();
+ x = (double)((pObj->det).e.x);
+ y = (double)((pObj->det).e.y) - (double)((pObj->det).e.rx);
+ xl = ConvX(x + shiftx - r);
+ yt = ConvY(y + shifty + r);
+ p3.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p3);
+ }
+ {
+ wxGraphicsPath p4 = gc->CreatePath();
+ x = (double)((pObj->det).e.x);
+ y = (double)((pObj->det).e.y) + (double)((pObj->det).e.rx);
+ xl = ConvX(x + shiftx - r);
+ yt = ConvY(y + shifty + r);
+ p4.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p4);
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+ $? "- MarkupCircle"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupEllipse(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ dk4_gra_point_t pt[5]; /* Ellipse key points to mark */
+ int sc[3]; /* Stroke colour components */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Left markup square x (pixels) */
+ double yt; /* Top markup square y (pixels) */
+ double w; /* Markup square width (pixels) */
+ double a; /* Rotation in radians */
+ double r; /* Half markup square width (wxd) */
+ size_t i; /* Current point index */
+ $? "+ MarkupEllipse"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x); shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ w = ConvDist(2.0 * r);
+ pt[0].x = (double)((pObj->det).e.rx);
+ pt[0].y = 0.0;
+ pt[1].x = 0.0;
+ pt[1].y = (double)((pObj->det).e.ry);
+ pt[2].x = 0.0 - (double)((pObj->det).e.rx);
+ pt[2].y = 0.0;
+ pt[3].x = 0.0;
+ pt[3].y = 0.0 - (double)((pObj->det).e.ry);
+ a = (M_PI * (double)((pObj->det).e.a)) / 180.0;
+ {
+ wxColour fc(sc[0], sc[1], sc[2]);
+ wxBrush br(fc);
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ for (i = 0; i < 4; i++) {
+ dk4gratool_rotate_point(&(pt[i]), a);
+ pt[i].x += (double)((pObj->det).e.x);
+ pt[i].y += (double)((pObj->det).e.y);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ xl = ConvX(pt[i].x + shiftx - r);
+ yt = ConvY(pt[i].y + shifty + r);
+ p.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p);
+ }
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+ $? "- MarkupEllipse"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupBoundingBox(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ Wxd_bb_t const *pbb,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour components */
+ double r; /* Half markup square width (wxd) */
+ double shiftx = 0.0; /* X shift distance (wxd) */
+ double shifty = 0.0; /* Y shift distance (wxd) */
+ double xl; /* Markup square left x (pixels) */
+ double yt; /* Markup square top y (pixels) */
+ double w; /* Markup square width (pixels) */
+ double dlw; /* Markup rectangle line width */
+ int lw; /* Markup rectangle line width */
+ $? "+ MarkupBox"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ r = MarkupPointRadius(pObj->lw);
+ if (WXD_OT_IMAGE == pObj->ot) {
+ dlw = 2.0 * (double)(m_pParent->m_pDrw->baselw);
+ lw = (int)dk4ma_rint(ConvDist(dlw));
+ if (1 > lw) { lw = 1; }
+ }
+ {
+ wxColour cstroke(sc[0], sc[1], sc[2]);
+ wxBrush brstr(cstroke);
+ if (WXD_OT_IMAGE == pObj->ot) {
+ wxPen penRect(cstroke, lw);
+ wxGraphicsPath pathRect = gc->CreatePath();
+ gc->SetPen(penRect);
+ gc->SetBrush(wxNullBrush);
+ pathRect.AddRectangle(
+ ConvX((double)(pbb->xl) + shiftx),
+ ConvY((double)(pbb->yt) + shifty),
+ ConvDist((double)(pbb->xr) - (double)(pbb->xl)),
+ ConvDist((double)(pbb->yt) - (double)(pbb->yb))
+ );
+ gc->StrokePath(pathRect);
+ gc->SetPen(wxNullPen);
+ }
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(brstr);
+ switch (iMarkup) {
+ case WXD_MARKUP_IMGRES : {
+ } break;
+ default : {
+ w = ConvDist(2.0 * r);
+ {
+ wxGraphicsPath p1 = gc->CreatePath();
+ xl = ConvX((double)(pbb->xl) + shiftx - r);
+ yt = ConvY((double)(pbb->yb) + shifty + r);
+ p1.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p1);
+ }
+ {
+ wxGraphicsPath p2 = gc->CreatePath();
+ xl = ConvX((double)(pbb->xr) + shiftx - r);
+ yt = ConvY((double)(pbb->yb) + shifty + r);
+ p2.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p2);
+ }
+ {
+ wxGraphicsPath p3 = gc->CreatePath();
+ xl = ConvX((double)(pbb->xr) + shiftx - r);
+ yt = ConvY((double)(pbb->yt) + shifty + r);
+ p3.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p3);
+ }
+ {
+ wxGraphicsPath p4 = gc->CreatePath();
+ xl = ConvX((double)(pbb->xl) + shiftx - r);
+ yt = ConvY((double)(pbb->yt) + shifty + r);
+ p4.AddRectangle(xl, yt, w, w);
+ gc->FillPath(p4);
+ }
+ } break;
+ }
+ gc->SetBrush(wxNullBrush);
+ }
+ $? "- MarkupBox"
+}
+
+
+
+void
+WxdkdrawFrame::Control::MarkupBox(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ $? "+ MarkupBox"
+ MarkupBoundingBox(gc, pObj, &((pObj->det).b.b), iMarkup, pShift);
+ $? "- MarkupBox"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawOpenPathElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ wxDash dash[8]; /* Dash length values array */
+ int sc[3]; /* Stroke colour */
+ int lw; /* Line width */
+ int nDash = 0; /* Number of dash elements */
+ bool bStroke = false; /* Flag: Stroke this element */
+ $? "+ DrawOpenPathElement"
+ if (((uint16_t)0U != pObj->lw) || (WXD_MARKUP_NONE != iMarkup)) {
+ bStroke = true;
+ }
+ if (bStroke) {
+ wxGraphicsPath p = gc->CreatePath();
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ lw = LineWidthForObject(m_pParent->m_pDrw, pObj, iMarkup);
+ switch (pObj->ot) {
+ case WXD_OT_POLYLINE : {
+ PathPolyline(p, pObj, pShift);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ PathSpline(p, pObj, pShift);
+ } break;
+ case WXD_OT_O_ARC : {
+ PathArc(p, pObj, pShift);
+ } break;
+ }
+ wxColour penc(sc[0], sc[1], sc[2]);
+ wxPen pen(penc, lw);
+ SetupPenForObject(pen, pObj, dash, &nDash);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ /*
+ Arrowheads, if any
+ */
+ AddArrowheads(gc, m_pParent->m_pDrw, pObj, sc, pShift);
+ /*
+ Markup
+ */
+ if (WXD_MARKUP_NONE != iMarkup) {
+ switch (pObj->ot) {
+ case WXD_OT_POLYLINE : {
+ MarkupPolyline(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ MarkupSpline(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_O_ARC : {
+ MarkupArc(gc, pObj, iMarkup, pShift);
+ } break;
+ }
+ }
+ }
+ $? "- DrawOpenPathElement"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawClosedPathElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ wxDash dash[8]; /* Dash length values array */
+ int sc[3]; /* Stroke colour */
+ int nDash = 0; /* Number of dash values */
+ bool bFill = false; /* Flag: Fill element */
+ bool bStroke = false; /* Flag: Stroke element */
+ $? "+ DrawClosedPathElement"
+ if ((uint8_t)(WXD_FS_NONE) != pObj->fs) {
+ /*
+ 2020-03-24 Modification
+ Marked elements are drawned on top of other elements,
+ so they can hide elements normally below them.
+ */
+ if (WXD_MARKUP_NONE == iMarkup) {
+ bFill = true;
+ }
+ }
+ /* Stroke element if linewidth not 0 or any markup required
+ */
+ if (((uint16_t)0U != pObj->lw) || (WXD_MARKUP_NONE != iMarkup)) {
+ bStroke = true;
+ }
+ if (bFill || bStroke) {
+ wxGraphicsPath p = gc->CreatePath();
+ switch (pObj->ot) {
+ case WXD_OT_POLYGON : {
+ PathPolyline(p, pObj, pShift);
+ } break;
+ case WXD_OT_C_SPLINE : {
+ PathSpline(p, pObj, pShift);
+ } break;
+ case WXD_OT_C_ARC : {
+ PathArc(p, pObj, pShift);
+ } break;
+ case WXD_OT_CIRCLE : {
+ PathCircle(p, pObj, pShift);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ PathEllipse(p, pObj, pShift);
+ } break;
+ case WXD_OT_BOX : {
+ PathBox(p, pObj, pShift);
+ } break;
+ }
+ if (bFill) {
+ gc->SetPen(wxNullPen);
+ if (
+ ((uint8_t)(WXD_FS_PURE) < pObj->fs)
+ && (NULL != pObj->psti)
+ && (NULL != (pObj->psti)->bm)
+ ) {
+ wxBrush br(*((pObj->psti)->bm));
+ gc->SetBrush(br);
+ gc->DrawPath(p);
+ gc->SetBrush(wxNullBrush);
+ }
+ else {
+ wxColour fc(
+ (int)(pObj->fc[0]), (int)(pObj->fc[1]), (int)(pObj->fc[2])
+ );
+ wxBrush br(fc);
+ gc->SetBrush(br);
+ gc->DrawPath(p);
+ gc->SetBrush(wxNullBrush);
+ }
+ }
+ if (bStroke) {
+ gc->SetBrush(wxNullBrush);
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ wxColour penc(sc[0], sc[1], sc[2]);
+ wxPen pen(
+ penc,
+ LineWidthForObject(m_pParent->m_pDrw, pObj, iMarkup)
+ );
+ SetupPenForObject(pen, pObj, dash, &nDash);
+ gc->SetPen(pen);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ }
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(wxNullBrush);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ switch (pObj->ot) {
+ case WXD_OT_POLYGON : {
+ MarkupPolyline(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_C_SPLINE : {
+ MarkupSpline(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_C_ARC : {
+ MarkupArc(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_CIRCLE : {
+ MarkupCircle(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ MarkupEllipse(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_BOX : {
+ MarkupBox(gc, pObj, iMarkup, pShift);
+ } break;
+ }
+ }
+ }
+ $? "- DrawClosedPathElement"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawImageRegion(
+ wxGraphicsContext *gc
+)
+{
+ double xps; /* Start x coordinate */
+ double xpe; /* End x coordinate */
+ double yps; /* Start y coordinate */
+ double ype; /* End y coordinate */
+
+ wxColour co(
+ m_pParent->m_iv[IVI_MISSIMG_RED],
+ m_pParent->m_iv[IVI_MISSIMG_GREEN],
+ m_pParent->m_iv[IVI_MISSIMG_BLUE]
+ );
+ wxPen pen(co);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ xps = ConvX((double)((m_pParent->m_ptMouseMoveStart).x));
+ xpe = ConvX((double)((m_pParent->m_ptMousePosGrid).x));
+ yps = ConvY((double)((m_pParent->m_ptMouseMoveStart).y));
+ ype = ConvY((double)((m_pParent->m_ptMousePosGrid).y));
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(xps, yps, (xpe-xps), (ype-yps));
+ gc->StrokePath(p);
+ }
+ gc->SetPen(wxNullPen);
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawImageElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ double shiftx = 0.0; /* X shift distance */
+ double shifty = 0.0; /* Y shift distance */
+ double xps; /* Start x coordinate */
+ double xpe; /* End x coordinate */
+ double yps; /* Start y coordinate */
+ double ype; /* End y coordinate */
+ $? "+ DrawImageElement"
+ if (NULL != pShift) {
+ shiftx = (double)(pShift->x);
+ shifty = (double)(pShift->y);
+ }
+ if (NULL != (pObj->det).i.bm) { $? ". bitmap available"
+ gc->DrawBitmap(
+ *((pObj->det).i.bm),
+ ConvX((pObj->det).i.pl.xmin + shiftx),
+ ConvY((pObj->det).i.pl.ymax + shifty),
+ (
+ ConvX((pObj->det).i.pl.xmax + shiftx)
+ - ConvX((pObj->det).i.pl.xmin + shiftx)
+ ),
+ ( ConvY((pObj->det).i.pl.ymin + shifty)
+ - ConvY((pObj->det).i.pl.ymax + shifty)
+ )
+ );
+ if (WXD_MARKUP_NONE != iMarkup) {
+ MarkupBoundingBox(gc, pObj, &((pObj->det).i.br), iMarkup, pShift);
+ }
+ }
+ else { $? "! no bitmap available"
+ wxColour co(
+ m_pParent->m_iv[IVI_MISSIMG_RED],
+ m_pParent->m_iv[IVI_MISSIMG_GREEN],
+ m_pParent->m_iv[IVI_MISSIMG_BLUE]
+ );
+ wxPen pen(co);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ xps = ConvX((double)((pObj->det).i.br.xl) + shiftx);
+ xpe = ConvX((double)((pObj->det).i.br.xr) + shiftx);
+ yps = ConvY((double)((pObj->det).i.br.yt) + shifty);
+ ype = ConvY((double)((pObj->det).i.br.yb) + shifty);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(xps, yps, (xpe-xps), (ype-yps));
+ gc->StrokePath(p);
+ }
+#if 0
+ /* 2019-05-04
+ Test whether rectangle coordinates are correct.
+ */
+ wxColour blue(0, 0, 127);
+ wxPen pblue(blue);
+ gc->SetPen(pblue);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(xps, yps);
+ p.AddLineToPoint(xpe, yps);
+ p.AddLineToPoint(xpe, ype);
+ p.AddLineToPoint(xps, ype);
+ p.AddLineToPoint(xps, yps);
+ p.CloseSubpath();
+ gc->StrokePath(p);
+ }
+#endif
+ if (WXD_MARKUP_NONE != iMarkup) {
+ MarkupBoundingBox(gc, pObj, &((pObj->det).i.br), iMarkup, pShift);
+ }
+ gc->SetPen(wxNullPen);
+ }
+ $? "- DrawImageElement"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawDotElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ int sc[3]; /* Stroke colour */
+ double shiftx = 0.0; /* X shift distacne */
+ double shifty = 0.0; /* Y shift distance */
+ double r; /* Circle radius */
+ double dlw; /* Line width for markup as double */
+ int lw; /* Line width for markup as int */
+ $? "+ DrawDotElement"
+ if (NULL != pShift) { shiftx = pShift->x; shifty = pShift->y; }
+ ChooseStrokeColour(sc, pObj, iMarkup);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ dlw = 2.0 * (double)(m_pParent->m_pDrw->baselw);
+ lw = (int)dk4ma_rint(ConvDist(dlw));
+ if (1 > lw) { lw = 1; }
+ }
+ if (WXD_OT_DOT_WHITE == pObj->ot) {
+ wxColour fco(sc[0], sc[1], sc[2]);
+ wxBrush br(fco);
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ r = (double)((pObj->det).d.d) + (double)(pObj->lw);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->FillPath(p);
+ if (pObj->lw < m_pParent->m_pDrw->baselw) {
+ wxBrush br2(*wxWHITE);
+ gc->SetBrush(br2);
+ r = (double)((pObj->det).d.d) - (double)(pObj->lw);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ wxGraphicsPath p2 = gc->CreatePath();
+ p2.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->FillPath(p2);
+ }
+ gc->SetBrush(wxNullBrush);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ wxPen penMarkup(fco, lw);
+ r = 8.0 + (double)((pObj->det).d.d) + (double)(pObj->lw);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ gc->SetPen(penMarkup);
+ wxGraphicsPath pMarkup = gc->CreatePath();
+ pMarkup.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->StrokePath(pMarkup);
+ gc->SetPen(wxNullPen);
+ }
+ }
+ else {
+ wxColour fco(sc[0], sc[1], sc[2]);
+ wxBrush br(fco);
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ r = (double)(m_pParent->m_pDrw->baselw) * (double)((pObj->det).d.d);
+ r = r / 2.0;
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->FillPath(p);
+ gc->SetBrush(wxNullBrush);
+ if (WXD_MARKUP_NONE != iMarkup) {
+ wxPen penMarkup(fco, lw);
+ r = 8.0 + (double)((pObj->det).d.d);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ gc->SetPen(penMarkup);
+ wxGraphicsPath pMarkup = gc->CreatePath();
+ pMarkup.AddCircle(
+ ConvX((double)((pObj->det).d.x) + shiftx),
+ ConvY((double)((pObj->det).d.y) + shifty),
+ ConvDist(r)
+ );
+ gc->StrokePath(pMarkup);
+ gc->SetPen(wxNullPen);
+ }
+ }
+ $? "- DrawDotElement"
+}
+
+
+
+void
+WxdkdrawFrame::Control::DrawElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift
+)
+{
+ $? "+ DrawElement ot=%d markup=%d", (int)(pObj->ot), iMarkup
+ switch ( (int)(pObj->ot) ) {
+ case WXD_OT_TEXT : { $? ". text"
+ DrawTextElement(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC : { $? ". open path element"
+ DrawOpenPathElement(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE :
+ case WXD_OT_ELLIPSE :
+ case WXD_OT_BOX : { $? ". closed path element"
+ DrawClosedPathElement(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_IMAGE : { $? ". image element"
+ DrawImageElement(gc, pObj, iMarkup, pShift);
+ } break;
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : { $? ". dot element"
+ DrawDotElement(gc, pObj, iMarkup, pShift);
+ } break;
+ }
+ $? "- DrawElement"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperationCanvas(wxGraphicsContext *gc)
+{
+ int coco[3]; /* Colour components */
+ double xl; /* Left x */
+ double xr; /* Right x */
+ double yb; /* Bottom y */
+ double yt; /* Top y */
+ double xrmax; /* Maximum for right x */
+ double ybmax; /* Maximum for bottom y */
+ $? "+ PaintOperationCanvas"
+ coco[0] = m_pParent->m_iv[IVI_BG_RED];
+ coco[1] = m_pParent->m_iv[IVI_BG_GREEN];
+ coco[2] = m_pParent->m_iv[IVI_BG_BLUE];
+ wxColour co(coco[0], coco[1], coco[2]);
+ wxBrush br(co);
+ xl = ConvX((m_pParent->m_pDrw->bb).xl);
+ xr = ConvX((m_pParent->m_pDrw->bb).xr);
+ yb = ConvY((m_pParent->m_pDrw->bb).yb);
+ yt = ConvY((m_pParent->m_pDrw->bb).yt);
+ $? ". xl = %g", xl
+ $? ". xr = %g", xr
+ $? ". yb = %g", yb
+ $? ". yt = %g", yt
+ xrmax = (double)(m_szDrawco.GetWidth());
+ ybmax = (double)(m_szDrawco.GetHeight());
+ if (0.0 > xl) { xl = 0.0; }
+ if (xrmax < xr) { xr = xrmax; }
+ if (0.0 > yt) { yt = 0.0; }
+ if (ybmax < yb) { yb = ybmax; }
+ $? ". xl = %g", xl
+ $? ". xr = %g", xr
+ $? ". yb = %g", yb
+ $? ". yt = %g", yt
+ gc->SetBrush(br);
+ gc->SetPen(wxNullPen);
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint(xl, yb);
+ p1.AddLineToPoint(xr, yb);
+ p1.AddLineToPoint(xr, yt);
+ p1.AddLineToPoint(xl, yt);
+ p1.AddLineToPoint(xl, yb);
+ p1.CloseSubpath();
+ gc->FillPath(p1);
+ gc->SetBrush(wxNullBrush);
+ $? "- PaintOperationCanvas"
+}
+
+
+
+#if TRACE_DEBUG
+static
+void
+show_bb(Wxd_bb_t const *bbptr)
+{
+ $? ". xl = %ld", (long)(bbptr->xl)
+ $? ". xr = %ld", (long)(bbptr->xr)
+ $? ". yb = %ld", (long)(bbptr->yb)
+ $? ". yt = %ld", (long)(bbptr->yt)
+ $? ". w = %ld", (long)(bbptr->xr) - (long)(bbptr->xl)
+ $? ". h = %ld", (long)(bbptr->yt) - (long)(bbptr->yb)
+}
+#endif
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperationBoundingBoxGrid(
+ wxGraphicsContext *gc,
+ Wxd_bb_t const & g_end
+)
+{
+ dk4_er_t er; /* Error report */
+ wxColour grco(
+ m_pParent->m_iv[IVI_GRID_RED],
+ m_pParent->m_iv[IVI_GRID_GREEN],
+ m_pParent->m_iv[IVI_GRID_BLUE]
+ ); /* Grid colour */
+ wxPen grpen(grco); /* Pen to draw grid */
+ $? "+ PaintOperationBoundingBoxGrid"
+ double xps; /* Start x position (converted) */
+ double xpe; /* End x position (converted) */
+ double yps; /* Start y position (converted) */
+ double ype; /* End y position (converted) */
+ int32_t i; /* Current coordinate value */
+ int32_t xs; /* Start x position (WXD) */
+#if 0
+ int32_t xe;
+#endif
+ int32_t ys; /* Start y position (WXD) */
+#if 0
+ int32_t ye;
+#endif
+
+ dk4error_init(&er);
+ gc->SetPen(grpen);
+ gc->SetBrush(wxNullBrush);
+ $? ". grid borders (intersection)"
+ $!trace-code show_bb(&g_end);
+ /*
+ Horizontal lines
+ */
+ ys = dk4ma_int32_t_add(g_end.yb, (int32_t)(m_uGridOptical), &er);
+ xps = ConvX(g_end.xl);
+ xpe = ConvX(g_end.xr);
+ if (DK4_E_NONE == er.ec) {
+ for (i = ys; i < g_end.yt; i += (int32_t)(m_uGridOptical)) {
+ yps = ConvY(i);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(xps, yps);
+ p.AddLineToPoint(xpe, yps);
+ gc->StrokePath(p);
+ }
+ }
+ /*
+ Vertical lines
+ */
+ xs = dk4ma_int32_t_add(g_end.xl, (int32_t)(m_uGridOptical), &er);
+ yps = ConvY(g_end.yb);
+ ype = ConvY(g_end.yt);
+ if (DK4_E_NONE == er.ec) {
+ for (i = xs; i < g_end.xr; i += (int32_t)(m_uGridOptical)) {
+ xps = ConvX(i);
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(xps, yps);
+ p.AddLineToPoint(xps, ype);
+ gc->StrokePath(p);
+ }
+ }
+ /*
+ Rectangle
+ */
+ xps = ConvX(g_end.xl);
+ xpe = ConvX(g_end.xr);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(xps, yps, (xpe-xps), (ype-yps));
+ gc->StrokePath(p);
+ }
+ gc->SetPen(wxNullPen);
+ $? "- PaintOperationBoundingBoxGrid"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperationGrid(wxGraphicsContext *gc)
+{
+ dk4_er_t er; /* Error report */
+ Wxd_bb_t g_drw; /* Grid size calculated from drawing */
+ Wxd_bb_t g_con; /* Grid size calculated from control */
+ Wxd_bb_t g_end; /* Final grid size */
+ bool ok; /* Flag: No errors */
+ $? "+ PaintOperationGrid"
+ /*
+ Initialize error detection
+ */
+ dk4error_init(&er);
+ ok = true;
+ /*
+ Calculate grid borders from drawing size and borders
+ */
+ g_drw.xl = dk4ma_int32_t_sub(
+ (m_pParent->m_pDrw->bb).xl, (int32_t)(m_pParent->m_pDrw->bleft), &er
+ );
+ g_drw.xr = dk4ma_int32_t_add(
+ (m_pParent->m_pDrw->bb).xr, (int32_t)(m_pParent->m_pDrw->bright), &er
+ );
+ g_drw.yb = dk4ma_int32_t_sub(
+ (m_pParent->m_pDrw->bb).yb, (int32_t)(m_pParent->m_pDrw->bbottom), &er
+ );
+ g_drw.yt = dk4ma_int32_t_add(
+ (m_pParent->m_pDrw->bb).yt, (int32_t)(m_pParent->m_pDrw->btop), &er
+ );
+ g_drw.xl = GridRoundDown(g_drw.xl, m_uGridOptical, ok);
+ g_drw.xr = GridRoundUp(g_drw.xr, m_uGridOptical, ok);
+ g_drw.yb = GridRoundDown(g_drw.yb, m_uGridOptical, ok);
+ g_drw.yt = GridRoundUp(g_drw.yt, m_uGridOptical, ok);
+ wxdobj_bb_correct(&g_drw);
+ $? ". grid borders (drawing size)"
+ $!trace-code show_bb(&g_drw);
+ /*
+ Calculate grid borders from control size and scrollbar positions
+ and zoom factor
+ */
+ if ((DK4_E_NONE == er.ec) && (ok)) {
+ g_con.xl = InvX(0.0, ok);
+ g_con.xr = InvX((double)(m_szDrawco.GetWidth()), ok);
+ g_con.yb = InvY((double)(m_szDrawco.GetHeight()), ok);
+ g_con.yt = InvY(0.0, ok);
+ g_con.xl = GridRoundDown(g_con.xl, m_uGridOptical, ok, true);
+ g_con.xr = GridRoundUp(g_con.xr, m_uGridOptical, ok, true);
+ g_con.yb = GridRoundDown(g_con.yb, m_uGridOptical, ok, true);
+ g_con.yt = GridRoundUp(g_con.yt, m_uGridOptical, ok, true);
+ wxdobj_bb_correct(&g_con);
+ $? ". grid borders (control, position and zoom)"
+ $!trace-code show_bb(&g_con);
+ if (ok) {
+ if (wxdobj_bb_intersection(&g_end, &g_drw, &g_con)) {
+ $? ". grid borders (intersection)"
+ $!trace-code show_bb(&g_end);
+ PaintOperationBoundingBoxGrid(gc, g_end);
+ }
+ }
+ else {
+ PaintOperationBoundingBoxGrid(gc, g_drw);
+ }
+ }
+ $? "- PaintOperationGrid"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperation0(wxDC & dc)
+{
+ int coco[3];
+ $? "+ PaintOperation0"
+ coco[0] = m_pParent->m_iv[IVI_BORDER_RED];
+ coco[1] = m_pParent->m_iv[IVI_BORDER_GREEN];
+ coco[2] = m_pParent->m_iv[IVI_BORDER_BLUE];
+ wxColour co(coco[0], coco[1], coco[2]);
+ wxBrush br(co);
+ wxPen pen(co);
+ dc.SetBrush(br);
+ dc.SetPen(pen);
+ dc.DrawRectangle(0, 0, m_szDrawco.GetWidth(), m_szDrawco.GetHeight());
+ dc.SetBrush(wxNullBrush);
+ dc.SetPen(wxNullPen);
+ $? "- PaintOperation0"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperation1(wxGraphicsContext *gc)
+{
+ $? "+ PaintOperation1"
+ PaintOperationCanvas(gc);
+ if (m_pParent->cbGridOnOff->GetValue()) {
+ PaintOperationGrid(gc);
+ }
+ $? "- PaintOperation1"
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperation2(wxGraphicsContext *gc)
+{
+ Wxd_object_t *pobj;
+ $? "+ PaintOperation2"
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != pobj) {
+ if (wxdobj_is_active(pobj)) {
+ if (MustDrawElementInNormalPass(pobj)) {
+ if (CanDrawElement(pobj)) {
+ DrawElement(gc, pobj, WXD_MARKUP_NONE);
+ }
+ }
+ }
+ }
+ } while (NULL != pobj);
+ $? "- PaintOperation2"
+}
+
+
+void
+WxdkdrawFrame::Control::GetPointFromBox(
+ double & x,
+ double & y,
+ Wxd_bb_t const *pbb,
+ uint16_t pno
+)
+{
+ $? "+ GetPointFromBox %u", (unsigned)pno
+ if (3 == pno) {
+ x = (double)(pbb->xl);
+ y = (double)(pbb->yt);
+ }
+ else {
+ if (2 == pno) {
+ x = (double)(pbb->xr);
+ y = (double)(pbb->yt);
+ }
+ else {
+ if (1 == pno) {
+ x = (double)(pbb->xr);
+ y = (double)(pbb->yb);
+ }
+ else {
+ x = (double)(pbb->xl);
+ y = (double)(pbb->yb);
+ }
+ }
+ }
+ $? "- GetPointFromBox x=%g y=%g", x, y
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightPointForOperation(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ int ci
+)
+{
+ dk4_gra_point_t pta;
+ int sc[3];
+ double x = 0.0;
+ double y = 0.0;
+ bool bCanHighlight = false;
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[ci]),(3*sizeof(int)));
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ x = (double)((pobj->det).t.x);
+ y = (double)((pobj->det).t.y);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if (NULL != (pobj->det).p.p) {
+ if (pno < (pobj->det).p.n) {
+ x = (double)(((pobj->det).p.p)[pno].x);
+ y = (double)(((pobj->det).p.p)[pno].y);
+ bCanHighlight = true;
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if (NULL != (pobj->det).s.p) {
+ if (pno < (pobj->det).s.n) {
+ x = (double)(((pobj->det).s.p)[pno].x);
+ y = (double)(((pobj->det).s.p)[pno].y);
+ bCanHighlight = true;
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (2 == pno) {
+ x = (double)((pobj->det).a.x3);
+ y = (double)((pobj->det).a.y3);
+ bCanHighlight = true;
+ }
+ else {
+ if (1 == pno) {
+ x = (double)((pobj->det).a.x2);
+ y = (double)((pobj->det).a.y2);
+ bCanHighlight = true;
+
+ }
+ else {
+ x = (double)((pobj->det).a.x1);
+ y = (double)((pobj->det).a.y1);
+ bCanHighlight = true;
+ }
+ }
+ } break;
+ case WXD_OT_CIRCLE : {
+ $? ". highlight circle control point %u", (unsigned)pno
+ if (3 == pno) {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((pobj->det).e.rx);
+ }
+ else {
+ if (2 == pno) {
+ pta.x = 0.0 - (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ }
+ else {
+ if (1 == pno) {
+ pta.x = 0.0;
+ pta.y = (double)((pobj->det).e.rx);
+ }
+ else {
+ pta.x = (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ }
+ }
+ }
+ x = pta.x + (double)((pobj->det).e.x);
+ y = pta.y + (double)((pobj->det).e.y);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_ELLIPSE : {
+ $? ". highlight ellipse control point %u", (unsigned)pno
+ if (3 == pno) {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((pobj->det).e.ry);
+ }
+ else {
+ if (2 == pno) {
+ pta.x = 0.0 - (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ }
+ else {
+ if (1 == pno) {
+ pta.x = 0.0;
+ pta.y = (double)((pobj->det).e.ry);
+ }
+ else {
+ pta.x = (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ }
+ }
+ }
+ dk4gratool_rotate_point(
+ &pta, ((M_PI * (double)((pobj->det).e.a)) / 180.0)
+ );
+ x = pta.x + (double)((pobj->det).e.x);
+ y = pta.y + (double)((pobj->det).e.y);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_BOX : {
+ GetPointFromBox(x, y, &((pobj->det).b.b), pno);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_IMAGE : {
+ GetPointFromBox(x, y, &((pobj->det).i.br), pno);
+ bCanHighlight = true;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ x = (double)((pobj->det).d.x);
+ y = (double)((pobj->det).d.y);
+ bCanHighlight = true;
+ } break;
+ }
+ if (bCanHighlight) {
+ DrawMarkupPoint(gc, sc, x, y, pobj->lw, NULL);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightLineToPoint(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ int ci
+)
+{
+ double x1;
+ double y1;
+ double x2;
+ double y2;
+ int sc[3];
+ int lw;
+ bool bCanDo = false;
+ x1 = x2 = ConvX((m_pParent->m_ptMousePosRaw).x);
+ y1 = y2 = ConvY((m_pParent->m_ptMousePosRaw).y);
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ x2 = ConvX((double)(((pobj->det).p.p)[pno].x));
+ y2 = ConvY((double)(((pobj->det).p.p)[pno].y));
+ bCanDo = true;
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ x2 = ConvX((double)(((pobj->det).s.p)[pno].x));
+ y2 = ConvY((double)(((pobj->det).s.p)[pno].y));
+ bCanDo = true;
+ } break;
+ }
+ if (bCanDo) {
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[ci]),(3*sizeof(int)));
+ lw = 1;
+ }
+ if (bCanDo) {
+ wxColour col(sc[0], sc[1], sc[2]);
+ wxPen pen(col, lw);
+ wxGraphicsPath path = gc->CreatePath();
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ path.MoveToPoint(x1, y1);
+ path.AddLineToPoint(x2, y2);
+ gc->StrokePath(path);
+ gc->SetPen(wxNullPen);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightPointToMove(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno
+)
+{
+ HighlightPointForOperation(gc, pobj, pno, IVI_M_MOVE_RED);
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightPointToDelete(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno
+)
+{
+ HighlightPointForOperation(gc, pobj, pno, IVI_M_DEL_RED);
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightPointToAdd(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ bool bAppend
+)
+{
+ uint16_t i;
+ $? "+ HighlightPointToAdd"
+ HighlightPointForOperation(gc, pobj, pno, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, pno, IVI_M_COPY_RED);
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : {
+ if (bAppend) {
+ if (((pobj->det).p.n - (uint16_t)1U) > pno) {
+ i = pno + (uint16_t)1U;
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ }
+ else {
+ if ((uint16_t)0U < pno) {
+ i = pno - (uint16_t)1U;
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if (bAppend) {
+ if (((pobj->det).s.n - (uint16_t)1U) > pno) {
+ i = pno + (uint16_t)1U;
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ }
+ else {
+ if ((uint16_t)0U < pno) {
+ i = pno - (uint16_t)1U;
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+ if (bAppend) {
+ if (((pobj->det).p.n - (uint16_t)1U) > pno) {
+ i = pno + (uint16_t)1U;
+ }
+ else {
+ i = (uint16_t)0U;
+ }
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ else {
+ if ((uint16_t)0U < pno) {
+ i = pno - (uint16_t)1U;
+ }
+ else {
+ i = (pobj->det).p.n - (uint16_t)1U;
+ }
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ if (bAppend) {
+ if (((pobj->det).s.n - (uint16_t)1U) > pno) {
+ i = pno + (uint16_t)1U;
+ }
+ else {
+ i = (uint16_t)0U;
+ }
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ else {
+ if ((uint16_t)0U < pno) {
+ i = pno - (uint16_t)1U;
+ }
+ else {
+ i = (pobj->det).p.n - (uint16_t)1U;
+ }
+ HighlightPointForOperation(gc, pobj, i, IVI_M_COPY_RED);
+ HighlightLineToPoint(gc, pobj, i, IVI_M_COPY_RED);
+ }
+ } break;
+ }
+ $? "- HighlightPointToAdd"
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightStylePoint(
+ wxGraphicsContext *gc,
+ double x,
+ double y,
+ double r,
+ int const *sc
+)
+{
+ wxColour col(sc[0], sc[1], sc[2]);
+ wxPen pen(col);
+ wxGraphicsPath p = gc->CreatePath();
+ double xx = ConvX(x);
+ double yy = ConvY(y);
+ double r2 = 2.0 * r;
+ if (10.0 < r) {
+ r2 = r + 10.0;
+ }
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ p.AddRectangle((xx - r2 / 2.0), (yy - r2 / 2.0), r2, r2);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightStylePoint(
+ wxGraphicsContext *gc,
+ int32_t x,
+ int32_t y,
+ double r,
+ int const *sc
+)
+{
+ HighlightStylePoint(gc, (double)x, (double)y, r, sc);
+}
+
+
+
+void
+WxdkdrawFrame::Control::HighlightStyleElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj
+)
+{
+ dk4_gra_point_t pt;
+ int sc[3];
+ double r;
+ double alpha;
+ uint16_t i;
+
+ DK4_MEMCPY(sc,&(m_pParent->m_iv[IVI_M_MOVE_RED]),(3*sizeof(int)));
+ r = 2.0 * ConvDist(MarkupPointRadius(pobj->lw));
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ HighlightStylePoint(
+ gc, (pobj->det).t.x, (pobj->det).t.y, r, sc
+ );
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (pobj->det).p.p) && ((uint16_t)0U < (pobj->det).p.n)) {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ HighlightStylePoint(
+ gc,((pobj->det).p.p)[i].x,((pobj->det).p.p)[i].y,r,sc
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (pobj->det).s.p) && ((uint16_t)0U < (pobj->det).s.n)) {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ HighlightStylePoint(
+ gc,((pobj->det).s.p)[i].x,((pobj->det).s.p)[i].y,r,sc
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ HighlightStylePoint(
+ gc, (pobj->det).a.x1, (pobj->det).a.y1, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).a.x2, (pobj->det).a.y2, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).a.x3, (pobj->det).a.y3, r, sc
+ );
+ } break;
+ case WXD_OT_CIRCLE : {
+ HighlightStylePoint(
+ gc,
+ ((double)((pobj->det).e.x) + (double)((pobj->det).e.rx)),
+ (double)((pobj->det).e.y),
+ r, sc
+ );
+ HighlightStylePoint(
+ gc,
+ ((double)((pobj->det).e.x) - (double)((pobj->det).e.rx)),
+ (double)((pobj->det).e.y),
+ r, sc
+ );
+ HighlightStylePoint(
+ gc, (double)((pobj->det).e.x),
+ ((double)((pobj->det).e.y) + (double)((pobj->det).e.rx)),
+ r, sc
+ );
+ HighlightStylePoint(
+ gc, (double)((pobj->det).e.x),
+ ((double)((pobj->det).e.y) - (double)((pobj->det).e.rx)),
+ r, sc
+ );
+ } break;
+ case WXD_OT_ELLIPSE : {
+ alpha = (M_PI * (double)((pobj->det).e.a)) / 180.0;
+ pt.x = (double)((pobj->det).e.rx);
+ pt.y = 0.0;
+ dk4gratool_rotate_point(&pt, alpha);
+ pt.x += (double)((pobj->det).e.x);
+ pt.y += (double)((pobj->det).e.y);
+ HighlightStylePoint(gc, pt.x, pt.y, r, sc);
+ pt.x = 0.0;
+ pt.y = (double)((pobj->det).e.ry);
+ dk4gratool_rotate_point(&pt, alpha);
+ pt.x += (double)((pobj->det).e.x);
+ pt.y += (double)((pobj->det).e.y);
+ HighlightStylePoint(gc, pt.x, pt.y, r, sc);
+ pt.x = 0.0 - (double)((pobj->det).e.rx);
+ pt.y = 0.0;
+ dk4gratool_rotate_point(&pt, alpha);
+ pt.x += (double)((pobj->det).e.x);
+ pt.y += (double)((pobj->det).e.y);
+ HighlightStylePoint(gc, pt.x, pt.y, r, sc);
+ pt.x = 0.0;
+ pt.y = 0.0 - (double)((pobj->det).e.ry);
+ dk4gratool_rotate_point(&pt, alpha);
+ pt.x += (double)((pobj->det).e.x);
+ pt.y += (double)((pobj->det).e.y);
+ HighlightStylePoint(gc, pt.x, pt.y, r, sc);
+ } break;
+ case WXD_OT_BOX : {
+ HighlightStylePoint(gc,(pobj->det).b.b.xl,(pobj->det).b.b.yb,r,sc);
+ HighlightStylePoint(gc,(pobj->det).b.b.xl,(pobj->det).b.b.yt,r,sc);
+ HighlightStylePoint(gc,(pobj->det).b.b.xr,(pobj->det).b.b.yb,r,sc);
+ HighlightStylePoint(gc,(pobj->det).b.b.xr,(pobj->det).b.b.yt,r,sc);
+ } break;
+ case WXD_OT_IMAGE : {
+ HighlightStylePoint(
+ gc, (pobj->det).i.br.xl, (pobj->det).i.br.yb, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).i.br.xl, (pobj->det).i.br.yt, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).i.br.xr, (pobj->det).i.br.yb, r, sc
+ );
+ HighlightStylePoint(
+ gc, (pobj->det).i.br.xr, (pobj->det).i.br.yt, r, sc
+ );
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ r = 8.0 + (double)((pobj->det).d.d) + (double)(pobj->lw);
+ r = r * (double)(m_pParent->m_pDrw->baselw);
+ r = r / 2.0;
+ r = ConvDist(r);
+ HighlightStylePoint(gc, (pobj->det).d.x, (pobj->det).d.y, r, sc);
+ } break;
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::PaintOperation3(wxGraphicsContext *gc)
+{
+ Wxd_object_t *pobj = NULL; /* Current object */
+ double xcur = 0.0; /* Cursor x position */
+ double ycur = 0.0; /* Cursor y position */
+ double lcur = 0.0; /* Cursor length */
+ $? "+ PaintOperation3"
+/*
+ Top level bounding boxes
+*/
+#if 0
+ {
+ wxColour bbgrey(127, 127, 127);
+ wxPen bbpen(bbgrey);
+ Wxd_object_t *po;
+ double xl;
+ double xr;
+ double yb;
+ double yt;
+ $? ". top level bounding boxes (start)"
+ gc->SetPen(bbpen);
+ gc->SetBrush(wxNullBrush);
+ dk4sto_it_reset(m_pParent->m_pDrw->i_stru);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_stru);
+ if (NULL != po) { $? ". yet another object"
+ if (
+ (0 != dk4bb_have_x(&(po->bb)))
+ && (0 != dk4bb_have_y(&(po->bb)))
+ ) {
+ wxGraphicsPath p = gc->CreatePath();
+ $? ". have bb for group"
+ xl = ConvX(dk4bb_get_xmin(&(po->bb)));
+ xr = ConvX(dk4bb_get_xmax(&(po->bb)));
+ yb = ConvY(dk4bb_get_ymin(&(po->bb)));
+ yt = ConvY(dk4bb_get_ymax(&(po->bb)));
+ p.AddRectangle(xl, yt, (xr - xl), (yb - yt));
+ gc->StrokePath(p);
+ }
+ else { $? "! no bb for group"
+ }
+ }
+ } while (NULL != po);
+ gc->SetPen(wxNullPen);
+ $? ". top level bounding boxes (end)"
+ }
+#endif
+/*
+ All bounding boxes
+*/
+#if 0
+ {
+ wxColour bbgrey(127, 127, 127);
+ wxPen bbpen(bbgrey);
+ Wxd_object_t *po;
+ double xl;
+ double xr;
+ double yb;
+ double yt;
+
+ gc->SetPen(bbpen);
+ gc->SetBrush(wxNullBrush);
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != po) {
+ if (
+ (0 != dk4bb_have_x(&(po->bb)))
+ && (0 != dk4bb_have_y(&(po->bb)))
+ ) {
+ wxGraphicsPath p = gc->CreatePath();
+ $? ". have bb for object"
+ xl = ConvX(dk4bb_get_xmin(&(po->bb)));
+ xr = ConvX(dk4bb_get_xmax(&(po->bb)));
+ yb = ConvY(dk4bb_get_ymin(&(po->bb)));
+ yt = ConvY(dk4bb_get_ymax(&(po->bb)));
+ p.AddRectangle(xl, yt, (xr - xl), (yb - yt));
+ gc->StrokePath(p);
+ }
+ else { $? "! no bb for object"
+ }
+ }
+ } while (NULL != po);
+ gc->SetPen(wxNullPen);
+ }
+#endif
+ /*
+ Calculate cursor position
+ */
+ if (m_pParent->m_bMousePos) {
+ xcur = ConvX((m_pParent->m_ptMousePosGrid).x);
+ ycur = ConvY((m_pParent->m_ptMousePosGrid).y);
+ lcur = ConvDist((int32_t)m_uGridSnap / (int32_t)2L);
+ }
+ /*
+ Placement help
+ */
+ $? ". placement help (start)"
+ if (m_pParent->m_bMousePos) {
+ if (m_pParent->cbPH->GetValue()) {
+ if (StateUsesPlacementHelp()) {
+ wxColour gold(
+ m_pParent->m_iv[WxdkdrawFrame::IVI_PH_RED],
+ m_pParent->m_iv[WxdkdrawFrame::IVI_PH_GREEN],
+ m_pParent->m_iv[WxdkdrawFrame::IVI_PH_BLUE]
+ );
+ wxPen pen(gold);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint(0.0, ycur);
+ p1.AddLineToPoint((double)(m_szDrawco.GetWidth()), ycur);
+ gc->StrokePath(p1);
+ wxGraphicsPath p2 = gc->CreatePath();
+ p2.MoveToPoint(xcur, 0.0);
+ p2.AddLineToPoint(xcur, (double)(m_szDrawco.GetHeight()));
+ gc->StrokePath(p2);
+ gc->SetPen(wxNullPen);
+ }
+ }
+ }
+ $? ". placement help (finished)"
+ /*
+ Objects under modification
+ */
+ $? ". objects under modification (start)"
+ if (StateHasObjectsUnderModification()) { $? ". state modifies objs"
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != pobj) { $? ". object found"
+ if (wxdobj_is_active(pobj)) { $? ". object active"
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ $? ". object marked"
+ if (MustDrawElementInMarkupPass(pobj)) {
+ $? ". must draw object"
+ if (CanDrawElement(pobj)) {
+ $? ". can draw object"
+ switch (m_pParent->m_iState) {
+ /*
+ _STATE_ Do we need to draw the object
+ shifted?
+ */
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_LIBELEM_PLACE :
+ {
+ DrawElement(
+ gc, pobj, WXD_MARKUP_NONE,
+ &(m_pParent->m_ptMouseMoveDiff)
+ );
+ } break;
+ default : {
+ DrawElement(gc, pobj, WXD_MARKUP_NONE);
+ } break;
+ }
+ }
+ else { $? "! can not draw object"
+ }
+ }
+ else { $? ". drawing not reqired"
+ }
+ }
+ else { $? ". object not marked"
+ }
+ }
+ else { $? ". object not active"
+ }
+ }
+ } while (NULL != pobj);
+ }
+ $? ". objects under modification (finished)"
+ /*
+ Image object under construction
+ */
+ switch ( m_pParent->m_iState ) {
+ case S_IMG_2 : {
+ DrawImageRegion(gc);
+ } break;
+ case S_MOVEPT_PLACE : {
+ if (
+ (NULL != m_pParent->m_pCurrent)
+ && (WXD_OT_IMAGE == m_pParent->m_pCurrent->ot)
+ ) {
+#if 0
+ DrawObjectBoundingBox(m_pCurrent);
+#else
+ MarkupBoundingBox(
+ gc,
+ m_pParent->m_pCurrent,
+ &(((m_pParent->m_pCurrent)->det).i.br),
+ WXD_MARKUP_IMGRES, NULL
+ );
+#endif
+ }
+ } break;
+ }
+
+
+ /*
+ Objects to highlight as selected candidates for grouping
+ */
+ $? ". group candidates objects (start)"
+ if (StateHasObjectsToHighlight2()) {
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != pobj) { $? ". object"
+ if (wxdobj_is_active(pobj)) {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_2)) {
+ if (MustHighlight2ElementInMarkupPass(pobj)) {
+ DrawElement(gc, pobj, WXD_MARKUP_GROUP);
+ }
+ else { $? ". no need to highlight"
+ }
+ }
+ else { $? ". object not marked 2"
+ }
+ }
+ else { $? ". object not active"
+ }
+ }
+ } while (NULL != pobj);
+ }
+ $? ". group candidates objects (finished)"
+ /*
+ Objects to highlight as candidate for copy, move, delete operation
+ or to change grouping selection
+ */
+ $? ". copy move delete candidates (start)"
+ if (StateHasObjectsToHighlight()) { $? ". state -> highlight"
+ dk4sto_it_reset(m_pParent->m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pParent->m_pDrw->i_flat);
+ if (NULL != pobj) { $? ". obj"
+ if (wxdobj_is_active(pobj)) {
+ if (MustHighlightElementInMarkupPass(pobj)) { $? ". mh"
+ if (CanDrawElement(pobj)) { $? ". cd"
+ /*
+ _STATE_ Do we need to draw the object
+ highlighted?
+ */
+ switch (m_pParent->m_iState) {
+ case S_NOOP : {
+ DrawElement(gc, pobj, WXD_MARKUP_MOVE);
+ } break;
+ case S_DELETE :
+ case S_REGION_DELETE : {
+ DrawElement(gc, pobj, WXD_MARKUP_DELETE);
+ } break;
+ case S_DETAILS :
+ case S_UNGROUP :
+ case S_GROUP_ONE :
+ case S_FLIP :
+ case S_MOVE_SELECT :
+ case S_CONVERT :
+ case S_ROTATE :
+ {
+ DrawElement(gc, pobj, WXD_MARKUP_MOVE);
+ } break;
+ case S_COPY_SELECT : {
+ DrawElement(gc, pobj, WXD_MARKUP_COPY);
+ } break;
+ case S_MOD_SPLINE :
+ case S_MOVEPT_SELECT : {
+ DrawElement(gc, pobj, WXD_MARKUP_PTMOVE);
+ HighlightPointToMove(
+ gc, pobj, m_pParent->m_uCurrent
+ );
+ } break;
+ case S_DELPT : {
+ DrawElement(gc, pobj, WXD_MARKUP_PTMOVE);
+ HighlightPointToDelete(
+ gc, pobj, m_pParent->m_uCurrent
+ );
+ } break;
+ case S_ADDPT_SELECT : {
+ DrawElement(gc, pobj, WXD_MARKUP_PTMOVE);
+ HighlightPointToAdd(
+ gc, pobj, m_pParent->m_uCurrent,
+ m_pParent->m_bAppendPoint
+ );
+ } break;
+ }
+ }
+ }
+ }
+ }
+ } while (NULL != pobj);
+ }
+ $? ". copy move delete candidates (finished)"
+ /*
+ Selected object for style changes
+ */
+ if ((S_NOOP == m_pParent->m_iState) && (NULL != m_pParent->m_pStyle)) {
+ bool bStyleActive = true;
+ if (NULL != m_pParent->m_pStyle->play) {
+ if ((uint8_t)0U == m_pParent->m_pStyle->play->active) {
+ bStyleActive = false;
+ }
+ }
+ if (bStyleActive) {
+ HighlightStyleElement(gc, m_pParent->m_pStyle);
+ }
+ }
+ /*
+ Drawing borders
+ */
+ $? ". drawing borders (start)"
+ switch (m_pParent->m_iState) {
+ case S_DRWSZ_SELECT : case S_DRWSZ_PLACE : {
+ DK4_MEMCPY(\
+ &((m_pParent->m_oBorder).det.b.b),\
+ &(m_pParent->m_pDrw->bb),\
+ sizeof(Wxd_bb_t)\
+ );
+ DrawClosedPathElement(
+ gc, &(m_pParent->m_oBorder),
+ (
+ (
+ (S_DRWSZ_SELECT == m_pParent->m_iState)
+ && (m_pParent->m_bHaveCornerPoint)
+ )
+ ? (WXD_MARKUP_PTMOVE)
+ : (WXD_MARKUP_NONE)
+ ),
+ NULL
+ );
+ if (
+ (S_DRWSZ_SELECT == m_pParent->m_iState)
+ && (m_pParent->m_bHaveCornerPoint)
+ ) {
+ MarkupBoundingBox(
+ gc, &(m_pParent->m_oBorder),
+ &((m_pParent->m_oBorder).det.b.b),
+ WXD_MARKUP_PTMOVE, NULL
+ );
+ switch ( (int)(m_pParent->m_uCurrent) ) {
+ case 3 : {
+ DrawMarkupPoint(
+ gc, &(m_pParent->m_iv[IVI_M_MOVE_RED]),
+ (m_pParent->m_pDrw->bb).xl,
+ (m_pParent->m_pDrw->bb).yt,
+ 2, NULL
+ );
+ } break;
+ case 2 : {
+ DrawMarkupPoint(
+ gc, &(m_pParent->m_iv[IVI_M_MOVE_RED]),
+ (m_pParent->m_pDrw->bb).xr,
+ (m_pParent->m_pDrw->bb).yt,
+ 2, NULL
+ );
+ } break;
+ case 1 : {
+ DrawMarkupPoint(
+ gc, &(m_pParent->m_iv[IVI_M_MOVE_RED]),
+ (m_pParent->m_pDrw->bb).xr,
+ (m_pParent->m_pDrw->bb).yb,
+ 2, NULL
+ );
+ } break;
+ default : {
+ DrawMarkupPoint(
+ gc, &(m_pParent->m_iv[IVI_M_MOVE_RED]),
+ (m_pParent->m_pDrw->bb).xl,
+ (m_pParent->m_pDrw->bb).yb,
+ 2, NULL
+ );
+ } break;
+ }
+ }
+ } break;
+ }
+ $? ". drawing borders (finished)"
+ $? ". region selection rectangle (start)"
+ switch (m_pParent->m_iState) {
+ case S_REGION_DELETE :
+ case S_GROUP_RECT_2 :
+ {
+ Wxd_bb_t ibb;
+ int rgb[3];
+ double xl;
+ double xr;
+ double yb;
+ double yt;
+ ibb.xl = m_pParent->m_ptMouseMoveStart.x;
+ ibb.xr = m_pParent->m_ptMousePosGrid.x;
+ ibb.yb = m_pParent->m_ptMouseMoveStart.y;
+ ibb.yt = m_pParent->m_ptMousePosGrid.y;
+ wxdobj_bb_correct(&ibb);
+ xl = ConvX(ibb.xl);
+ xr = ConvX(ibb.xr);
+ yb = ConvY(ibb.yb);
+ yt = ConvY(ibb.yt);
+ rgb[0] = 0;
+ rgb[1] = 0;
+ rgb[2] = 0;
+ switch (m_pParent->m_iState) {
+ case S_REGION_DELETE : {
+ rgb[0] = m_pParent->m_iv[IVI_M_DEL_RED];
+ rgb[1] = m_pParent->m_iv[IVI_M_DEL_GREEN];
+ rgb[2] = m_pParent->m_iv[IVI_M_DEL_BLUE];
+ } break;
+ }
+ {
+ wxColour black(rgb[0],rgb[1],rgb[2]);
+ wxPen pen(black);
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(xl, yt, (xr - xl), (yb - yt));
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ gc->StrokePath(p);
+ gc->SetPen(wxNullPen);
+ }
+ } break;
+ }
+ $? ". region selection rectangle (finished)"
+ /*
+ Cursor
+ */
+ $? ". cursor (start)"
+ if (m_pParent->m_bMousePos) {
+ wxPen pen(*wxBLACK);
+ gc->SetPen(pen);
+ gc->SetBrush(wxNullBrush);
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint((xcur - lcur), ycur);
+ p1.AddLineToPoint((xcur + lcur), ycur);
+ gc->StrokePath(p1);
+ wxGraphicsPath p2 = gc->CreatePath();
+ p2.MoveToPoint(xcur, (ycur - lcur));
+ p2.AddLineToPoint(xcur, (ycur + lcur));
+ gc->StrokePath(p2);
+ gc->SetPen(wxNullPen);
+ }
+ $? ". cursor (finished)"
+ $? "- PaintOperation3"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawControlEvents.cpp b/support/dktools/WxdkdrawControlEvents.cpp
new file mode 100644
index 0000000000..fc0f7bba44
--- /dev/null
+++ b/support/dktools/WxdkdrawControlEvents.cpp
@@ -0,0 +1,410 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawControlEvents.cpt
+*/
+
+/** @file WxdkdrawControlEvents.cpp The WxdkdrawControlEvents module.
+*/
+
+
+#line 10 "WxdkdrawControlEvents.cpt"
+
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+
+#line 24 "WxdkdrawControlEvents.cpt"
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawFrame::Control,wxControl)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawFrame::Control,wxControl)
+#endif
+ EVT_ERASE_BACKGROUND(WxdkdrawFrame::Control::OnErase)
+ EVT_PAINT(WxdkdrawFrame::Control::OnPaint)
+ EVT_SIZE(WxdkdrawFrame::Control::OnSize)
+ EVT_ENTER_WINDOW(WxdkdrawFrame::Control::OnMouseEnter)
+ EVT_LEAVE_WINDOW(WxdkdrawFrame::Control::OnMouseLeave)
+ EVT_MOTION(WxdkdrawFrame::Control::OnMouseMove)
+ EVT_LEFT_DOWN(WxdkdrawFrame::Control::OnLeftMouseButtonDown)
+ EVT_MIDDLE_DOWN(WxdkdrawFrame::Control::OnMiddleMouseButtonDown)
+ EVT_RIGHT_DOWN(WxdkdrawFrame::Control::OnRightMouseButtonDown)
+ EVT_MOUSEWHEEL(WxdkdrawFrame::Control::OnMouseWheel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(WxdkdrawFrame::Control,wxControl);
+#else
+IMPLEMENT_DYNAMIC_CLASS(WxdkdrawFrame::Control,wxControl)
+#endif
+
+
+
+wxChar const WxdkdrawFrame::Control::ms_controlname[] =
+{ wxT("WxdkdrawControl") } ;
+
+
+
+bool
+WxdkdrawFrame::Control::CanHandleEvents(void)
+{
+ bool back = false;
+ if (m_bCanAllocate && (NULL != m_pParent)) {
+ if (NULL != m_pParent->m_pDrw) {
+ back = m_pParent->m_bActive;
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnErase(wxEraseEvent & WXUNUSED(event))
+{
+
+
+#line 80 "WxdkdrawControlEvents.cpt"
+ /*
+ Intentionally empty.
+ We must overwrite the method to avoid background erasing,
+ but we do nothing here as we do not want to erase something.
+ */
+
+
+#line 86 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnPaint(wxPaintEvent & WXUNUSED(event))
+{
+
+
+#line 94 "WxdkdrawControlEvents.cpt"
+ m_szDrawco = GetClientSize();
+ if (CanHandleEvents()) {
+ /*
+ Calculate coordinates conversion coefficients
+ */
+ CalculateConversionCoefficients();
+ /*
+ Destroy old bitmaps if size does not match
+ */
+ if (NULL != m_pB3) {
+ wxSize bmsz = m_pB3->GetSize();
+ if (m_szDrawco != bmsz) { delete m_pB3; m_pB3 = NULL; }
+ }
+ if (NULL != m_pB2) {
+ wxSize bmsz = m_pB2->GetSize();
+ if (m_szDrawco != bmsz) { delete m_pB2; m_pB2 = NULL; }
+ }
+ if (NULL != m_pB1) {
+ wxSize bmsz = m_pB1->GetSize();
+ if (m_szDrawco != bmsz) { delete m_pB1; m_pB1 = NULL; }
+ }
+ /* Allocate new bitmaps
+ */
+ if (NULL == m_pB1) {
+ m_pB1 = new wxBitmap(m_szDrawco.GetWidth(), m_szDrawco.GetHeight());
+ if (NULL != m_pB1) {
+ wxdobj_drw_require_redraw(m_pParent->m_pDrw,WXD_REFRESH_GRID);
+ }
+ }
+ if (NULL == m_pB2) {
+ m_pB2 = new wxBitmap(m_szDrawco.GetWidth(), m_szDrawco.GetHeight());
+ if (NULL != m_pB2) {
+ wxdobj_drw_require_redraw(
+ m_pParent->m_pDrw,WXD_REFRESH_DRAWING
+ );
+ }
+ }
+ if (NULL == m_pB3) {
+ m_pB3 = new wxBitmap(m_szDrawco.GetWidth(), m_szDrawco.GetHeight());
+ if (NULL != m_pB3) {
+ wxdobj_drw_require_redraw(m_pParent->m_pDrw,WXD_REFRESH_MARKUP);
+ }
+ }
+ /* Draw either buffered or unbuffered
+ */
+ if ((NULL != m_pB1) && (NULL != m_pB2) && (NULL != m_pB3)) {
+ /*
+ All bitmaps available, buffered drawing
+ */
+ wxPaintDC paintDC(this);
+ int rl;
+
+ rl = wxdobj_drw_get_required_redraw_level(m_pParent->m_pDrw);
+ if (WXD_REFRESH_GRID <= rl) {
+
+#line 148 "WxdkdrawControlEvents.cpt"
+ wxMemoryDC mdc;
+ mdc.SelectObject(*m_pB1);
+ PaintOperation0(mdc);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(mdc);
+ if (NULL != gc) {
+ PaintOperation1(gc);
+ delete gc;
+ }
+ mdc.SelectObject(wxNullBitmap);
+ }
+ if (WXD_REFRESH_DRAWING <= rl) {
+
+#line 159 "WxdkdrawControlEvents.cpt"
+ wxMemoryDC mdc;
+ mdc.SelectObject(*m_pB2);
+ mdc.DrawBitmap(*m_pB1, 0, 0, false);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(mdc);
+ if (NULL != gc) {
+ PaintOperation2(gc);
+ delete gc;
+ }
+ mdc.SelectObject(wxNullBitmap);
+ }
+ if (WXD_REFRESH_MARKUP <= rl) {
+
+#line 170 "WxdkdrawControlEvents.cpt"
+ wxMemoryDC mdc;
+ mdc.SelectObject(*m_pB3);
+ mdc.DrawBitmap(*m_pB2, 0, 0, false);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(mdc);
+ if (NULL != gc) {
+ PaintOperation3(gc);
+ delete gc;
+ }
+ mdc.SelectObject(wxNullBitmap);
+ }
+
+#line 180 "WxdkdrawControlEvents.cpt"
+ paintDC.DrawBitmap(*m_pB3, 0, 0, false);
+ }
+ else {
+ /*
+ At least one bitmap not allocated, unbuffered drawing
+ */
+ wxBufferedPaintDC paintDC(this);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(paintDC);
+ if (NULL != gc) {
+ PaintOperation0(paintDC);
+ PaintOperation1(gc);
+ PaintOperation2(gc);
+ PaintOperation3(gc);
+ delete gc;
+ }
+ }
+ /* Reset the redraw level to mark that the produced
+ bitmap 3 (if any) can be re-used without drawing operations.
+ */
+ wxdobj_drw_reset_required_redraw_level(m_pParent->m_pDrw);
+ }
+ else {
+ /*
+ Draw control not yet or no longer ready for normal use.
+ Simply draw placeholder for draw control.
+ */
+ wxBufferedPaintDC paintDC(this);
+ PaintOperation0(paintDC);
+ }
+
+
+#line 210 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnSize(wxSizeEvent & WXUNUSED(event))
+{
+ int oldw;
+ int oldh;
+ bool bEnlarged = false;
+
+
+#line 221 "WxdkdrawControlEvents.cpt"
+ if (CanHandleEvents()) {
+ oldw = m_szDrawco.GetWidth();
+ oldh = m_szDrawco.GetHeight();
+ m_szDrawco = GetClientSize();
+ if (m_szDrawco.GetWidth() > oldw) {
+ bEnlarged = true;
+ }
+ if (m_szDrawco.GetHeight() > oldh) {
+ bEnlarged = true;
+ }
+ if (bEnlarged && (0 != m_pParent->m_iv[IVI_C_COR_POSITION])) {
+ m_pParent->CorrectCenterPointIfNecessary();
+ }
+ m_pParent->AdjustScrollbars();
+ wxdobj_drw_require_redraw(m_pParent->m_pDrw, WXD_REFRESH_GRID);
+ Refresh();
+ m_pParent->Update();
+ }
+
+
+#line 240 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMouseEnter(wxMouseEvent & event)
+{
+
+
+#line 248 "WxdkdrawControlEvents.cpt"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMouseEnter(event);
+ }
+#ifndef __WXGTK__
+ SetFocus();
+#endif
+
+
+#line 255 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMouseLeave(wxMouseEvent & event)
+{
+
+
+#line 263 "WxdkdrawControlEvents.cpt"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMouseLeave(event);
+ }
+
+
+#line 267 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMouseMove(wxMouseEvent & event)
+{
+
+
+#line 275 "WxdkdrawControlEvents.cpt"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMouseMove(event);
+ }
+
+
+#line 279 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnLeftMouseButtonDown(wxMouseEvent & event)
+{
+
+
+#line 287 "WxdkdrawControlEvents.cpt"
+ if (CanHandleEvents()) {
+ m_pParent->ControlLeftMouseButton(event);
+ }
+#ifndef __WXGTK__
+ SetFocus();
+#endif
+#if 0
+ event.Skip();
+#endif
+
+
+#line 297 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnRightMouseButtonDown(wxMouseEvent & event)
+{
+
+
+#line 305 "WxdkdrawControlEvents.cpt"
+ if (CanHandleEvents()) {
+ m_pParent->ControlRightMouseButton(event);
+ }
+#ifndef __WXGTK__
+ SetFocus();
+#endif
+#if 0
+ event.Skip();
+#endif
+
+
+#line 315 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMiddleMouseButtonDown(wxMouseEvent & event)
+{
+
+
+#line 323 "WxdkdrawControlEvents.cpt"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMiddleMouseButton(event);
+ }
+#ifndef __WXGTK__
+ SetFocus();
+#endif
+#if 0
+ event.Skip();
+#endif
+
+
+#line 333 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMouseWheel(wxMouseEvent & event)
+{
+
+
+#line 341 "WxdkdrawControlEvents.cpt"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMouseWheel(event);
+ }
+
+
+#line 345 "WxdkdrawControlEvents.cpt"
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawControlEvents.cpt b/support/dktools/WxdkdrawControlEvents.cpt
new file mode 100644
index 0000000000..bd4ea33321
--- /dev/null
+++ b/support/dktools/WxdkdrawControlEvents.cpt
@@ -0,0 +1,351 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+# vim: set ai sw=4 ts=4 :
+
+%% module
+
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawFrame::Control,wxControl)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawFrame::Control,wxControl)
+#endif
+ EVT_ERASE_BACKGROUND(WxdkdrawFrame::Control::OnErase)
+ EVT_PAINT(WxdkdrawFrame::Control::OnPaint)
+ EVT_SIZE(WxdkdrawFrame::Control::OnSize)
+ EVT_ENTER_WINDOW(WxdkdrawFrame::Control::OnMouseEnter)
+ EVT_LEAVE_WINDOW(WxdkdrawFrame::Control::OnMouseLeave)
+ EVT_MOTION(WxdkdrawFrame::Control::OnMouseMove)
+ EVT_LEFT_DOWN(WxdkdrawFrame::Control::OnLeftMouseButtonDown)
+ EVT_MIDDLE_DOWN(WxdkdrawFrame::Control::OnMiddleMouseButtonDown)
+ EVT_RIGHT_DOWN(WxdkdrawFrame::Control::OnRightMouseButtonDown)
+ EVT_MOUSEWHEEL(WxdkdrawFrame::Control::OnMouseWheel)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(WxdkdrawFrame::Control,wxControl);
+#else
+IMPLEMENT_DYNAMIC_CLASS(WxdkdrawFrame::Control,wxControl)
+#endif
+
+
+
+wxChar const WxdkdrawFrame::Control::ms_controlname[] =
+{ wxT("WxdkdrawControl") } ;
+
+
+
+bool
+WxdkdrawFrame::Control::CanHandleEvents(void)
+{
+ bool back = false;
+ if (m_bCanAllocate && (NULL != m_pParent)) {
+ if (NULL != m_pParent->m_pDrw) {
+ back = m_pParent->m_bActive;
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnErase(wxEraseEvent & WXUNUSED(event))
+{
+ $? "+ OnErase"
+ /*
+ Intentionally empty.
+ We must overwrite the method to avoid background erasing,
+ but we do nothing here as we do not want to erase something.
+ */
+ $? "- OnErase"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnPaint(wxPaintEvent & WXUNUSED(event))
+{
+ $? "+ OnPaint"
+ m_szDrawco = GetClientSize();
+ if (CanHandleEvents()) {
+ /*
+ Calculate coordinates conversion coefficients
+ */
+ CalculateConversionCoefficients();
+ /*
+ Destroy old bitmaps if size does not match
+ */
+ if (NULL != m_pB3) {
+ wxSize bmsz = m_pB3->GetSize();
+ if (m_szDrawco != bmsz) { delete m_pB3; m_pB3 = NULL; }
+ }
+ if (NULL != m_pB2) {
+ wxSize bmsz = m_pB2->GetSize();
+ if (m_szDrawco != bmsz) { delete m_pB2; m_pB2 = NULL; }
+ }
+ if (NULL != m_pB1) {
+ wxSize bmsz = m_pB1->GetSize();
+ if (m_szDrawco != bmsz) { delete m_pB1; m_pB1 = NULL; }
+ }
+ /* Allocate new bitmaps
+ */
+ if (NULL == m_pB1) {
+ m_pB1 = new wxBitmap(m_szDrawco.GetWidth(), m_szDrawco.GetHeight());
+ if (NULL != m_pB1) {
+ wxdobj_drw_require_redraw(m_pParent->m_pDrw,WXD_REFRESH_GRID);
+ }
+ }
+ if (NULL == m_pB2) {
+ m_pB2 = new wxBitmap(m_szDrawco.GetWidth(), m_szDrawco.GetHeight());
+ if (NULL != m_pB2) {
+ wxdobj_drw_require_redraw(
+ m_pParent->m_pDrw,WXD_REFRESH_DRAWING
+ );
+ }
+ }
+ if (NULL == m_pB3) {
+ m_pB3 = new wxBitmap(m_szDrawco.GetWidth(), m_szDrawco.GetHeight());
+ if (NULL != m_pB3) {
+ wxdobj_drw_require_redraw(m_pParent->m_pDrw,WXD_REFRESH_MARKUP);
+ }
+ }
+ /* Draw either buffered or unbuffered
+ */
+ if ((NULL != m_pB1) && (NULL != m_pB2) && (NULL != m_pB3)) {
+ /*
+ All bitmaps available, buffered drawing
+ */
+ wxPaintDC paintDC(this);
+ int rl;
+
+ rl = wxdobj_drw_get_required_redraw_level(m_pParent->m_pDrw);
+ if (WXD_REFRESH_GRID <= rl) { $? ". draw grid"
+ wxMemoryDC mdc;
+ mdc.SelectObject(*m_pB1);
+ PaintOperation0(mdc);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(mdc);
+ if (NULL != gc) {
+ PaintOperation1(gc);
+ delete gc;
+ }
+ mdc.SelectObject(wxNullBitmap);
+ }
+ if (WXD_REFRESH_DRAWING <= rl) { $? ". draw elements"
+ wxMemoryDC mdc;
+ mdc.SelectObject(*m_pB2);
+ mdc.DrawBitmap(*m_pB1, 0, 0, false);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(mdc);
+ if (NULL != gc) {
+ PaintOperation2(gc);
+ delete gc;
+ }
+ mdc.SelectObject(wxNullBitmap);
+ }
+ if (WXD_REFRESH_MARKUP <= rl) { $? ". draw markup"
+ wxMemoryDC mdc;
+ mdc.SelectObject(*m_pB3);
+ mdc.DrawBitmap(*m_pB2, 0, 0, false);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(mdc);
+ if (NULL != gc) {
+ PaintOperation3(gc);
+ delete gc;
+ }
+ mdc.SelectObject(wxNullBitmap);
+ } $? ". use cached bitmap"
+ paintDC.DrawBitmap(*m_pB3, 0, 0, false);
+ }
+ else {
+ /*
+ At least one bitmap not allocated, unbuffered drawing
+ */
+ wxBufferedPaintDC paintDC(this);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(paintDC);
+ if (NULL != gc) {
+ PaintOperation0(paintDC);
+ PaintOperation1(gc);
+ PaintOperation2(gc);
+ PaintOperation3(gc);
+ delete gc;
+ }
+ }
+ /* Reset the redraw level to mark that the produced
+ bitmap 3 (if any) can be re-used without drawing operations.
+ */
+ wxdobj_drw_reset_required_redraw_level(m_pParent->m_pDrw);
+ }
+ else {
+ /*
+ Draw control not yet or no longer ready for normal use.
+ Simply draw placeholder for draw control.
+ */
+ wxBufferedPaintDC paintDC(this);
+ PaintOperation0(paintDC);
+ }
+ $? "- OnPaint"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnSize(wxSizeEvent & WXUNUSED(event))
+{
+ int oldw;
+ int oldh;
+ bool bEnlarged = false;
+ $? "+ OnSize"
+ if (CanHandleEvents()) {
+ oldw = m_szDrawco.GetWidth();
+ oldh = m_szDrawco.GetHeight();
+ m_szDrawco = GetClientSize();
+ if (m_szDrawco.GetWidth() > oldw) {
+ bEnlarged = true;
+ }
+ if (m_szDrawco.GetHeight() > oldh) {
+ bEnlarged = true;
+ }
+ if (bEnlarged && (0 != m_pParent->m_iv[IVI_C_COR_POSITION])) {
+ m_pParent->CorrectCenterPointIfNecessary();
+ }
+ m_pParent->AdjustScrollbars();
+ wxdobj_drw_require_redraw(m_pParent->m_pDrw, WXD_REFRESH_GRID);
+ Refresh();
+ m_pParent->Update();
+ }
+ $? "- OnSize"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMouseEnter(wxMouseEvent & event)
+{
+ $? "+ OnMouseEnter"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMouseEnter(event);
+ }
+#ifndef __WXGTK__
+ SetFocus();
+#endif
+ $? "- OnMouseEnter"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMouseLeave(wxMouseEvent & event)
+{
+ $? "+ OnMouseLeave"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMouseLeave(event);
+ }
+ $? "- OnMouseLeave"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMouseMove(wxMouseEvent & event)
+{
+ $? "+ OnMouseMove"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMouseMove(event);
+ }
+ $? "- OnMouseMove"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnLeftMouseButtonDown(wxMouseEvent & event)
+{
+ $? "+ OnLeftMouseButtonDown"
+ if (CanHandleEvents()) {
+ m_pParent->ControlLeftMouseButton(event);
+ }
+#ifndef __WXGTK__
+ SetFocus();
+#endif
+#if 0
+ event.Skip();
+#endif
+ $? "- OnLeftMouseButtonDown"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnRightMouseButtonDown(wxMouseEvent & event)
+{
+ $? "+ OnRightMouseButtonDown"
+ if (CanHandleEvents()) {
+ m_pParent->ControlRightMouseButton(event);
+ }
+#ifndef __WXGTK__
+ SetFocus();
+#endif
+#if 0
+ event.Skip();
+#endif
+ $? "- OnRightMouseButtonDown"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMiddleMouseButtonDown(wxMouseEvent & event)
+{
+ $? "+ OnMiddleMouseButtonDown"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMiddleMouseButton(event);
+ }
+#ifndef __WXGTK__
+ SetFocus();
+#endif
+#if 0
+ event.Skip();
+#endif
+ $? "- OnMiddleMouseButtonDown"
+}
+
+
+
+void
+WxdkdrawFrame::Control::OnMouseWheel(wxMouseEvent & event)
+{
+ $? "+ OnMouseWheel"
+ if (CanHandleEvents()) {
+ m_pParent->ControlMouseWheel(event);
+ }
+ $? "- OnMouseWheel"
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawControlTools.cpp b/support/dktools/WxdkdrawControlTools.cpp
new file mode 100644
index 0000000000..5290addcf4
--- /dev/null
+++ b/support/dktools/WxdkdrawControlTools.cpp
@@ -0,0 +1,476 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawControlTools.cpt
+*/
+
+/** @file WxdkdrawControlTools.cpp The WxdkdrawControlTools module.
+*/
+
+
+#line 10 "WxdkdrawControlTools.cpt"
+
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+
+#line 21 "WxdkdrawControlTools.cpt"
+
+
+
+void
+WxdkdrawFrame::Control::CalculateZoomFactor(void)
+{
+ int8_t zl; /* Local copy of zoom level to analyze */
+
+ m_dZoom = 1.0;
+ if (NULL != m_pParent) {
+ if (NULL != m_pParent->m_pDrw) {
+ if ((uint8_t)0U != m_pParent->m_pDrw->gridunit) {
+ /* Grid is in cm */
+ m_uGridOptical = 6400000UL;
+ }
+ else {
+ /* Grid is inch based (1/2 inch) */
+ m_uGridOptical = 8128000UL;
+ }
+ zl = m_pParent->m_pDrw->zl;
+ if ((int8_t)0 < zl) {
+ while ((int8_t)1 < zl) {
+ zl -= (int8_t)2;
+ m_dZoom *= 2.0;
+ m_uGridOptical /= (uint32_t)2UL;
+ }
+ if ((int8_t)0 < zl) {
+ m_dZoom *= M_SQRT2;
+ m_uGridOptical /= (uint32_t)2UL;
+ }
+ }
+ else {
+ if ((int8_t)0 > zl) {
+ while ((int8_t)(-1) > zl) {
+ zl += (int8_t)2;
+ m_dZoom /= 2.0;
+ m_uGridOptical *= (uint32_t)2UL;
+ }
+ if ((int8_t)0 > zl) {
+ m_dZoom /= M_SQRT2;
+ m_uGridOptical *= (uint32_t)2UL;
+ }
+ }
+ }
+ if ((uint8_t)0U != m_pParent->m_pDrw->gridbase) {
+ m_uGridSnap = m_uGridOptical / (uint32_t)5UL;
+ }
+ else {
+ m_uGridSnap = m_uGridOptical / (uint32_t)4UL;
+ }
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::CalculateGridDistances(void)
+{
+
+ int8_t zl; /* Local copy of zoom level to analyze */
+
+ if (NULL != m_pParent) {
+ if (NULL != m_pParent->m_pDrw) {
+ if ((uint8_t)0U != m_pParent->m_pDrw->gridunit) {
+ /* Grid is in cm */
+ m_uGridOptical = 6400000UL;
+ }
+ else {
+ /* Grid is inch based (1/2 inch) */
+ m_uGridOptical = 8128000UL;
+ }
+ zl = m_pParent->m_pDrw->zl;
+ if ((int8_t)0 < zl) {
+ while ((int8_t)1 < zl) {
+ zl -= (int8_t)2;
+ m_uGridOptical /= (uint32_t)2UL;
+ }
+ if ((int8_t)0 < zl) {
+ m_uGridOptical /= (uint32_t)2UL;
+ }
+ }
+ else {
+ if ((int8_t)0 > zl) {
+ while ((int8_t)(-1) > zl) {
+ zl += (int8_t)2;
+ m_uGridOptical *= (uint32_t)2UL;
+ }
+ if ((int8_t)0 > zl) {
+ m_uGridOptical *= (uint32_t)2UL;
+ }
+ }
+ }
+ if ((uint8_t)0U != m_pParent->m_pDrw->gridbase) {
+ m_uGridSnap = m_uGridOptical / (uint32_t)5UL;
+ }
+ else {
+ m_uGridSnap = m_uGridOptical / (uint32_t)4UL;
+ }
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::CalculateConversionCoefficients(void)
+{
+
+
+#line 130 "WxdkdrawControlTools.cpt"
+ m_ptM.x = (m_ptRes.x * m_dZoom) / 16256000.0;
+ m_ptN.x = (double)(m_szDrawco.GetWidth()) / 2.0;
+ m_ptN.x -= ((double)(m_pParent->m_pDrw->cx) * m_ptRes.x * m_dZoom)
+ / 16256000.0;
+ m_ptM.y = 0.0 - (m_ptRes.y * m_dZoom) / 16256000.0;
+ m_ptN.y = (double)(m_szDrawco.GetHeight()) / 2.0;
+ m_ptN.y += ((double)(m_pParent->m_pDrw->cy) * m_ptRes.y * m_dZoom)
+ / 16256000.0;
+
+
+#line 139 "WxdkdrawControlTools.cpt"
+
+
+#line 140 "WxdkdrawControlTools.cpt"
+
+
+#line 141 "WxdkdrawControlTools.cpt"
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvDist(double d)
+{
+#if TRACE_DEBUG
+ double back;
+ back = fabs(m_ptM.x * d);
+
+
+#line 152 "WxdkdrawControlTools.cpt"
+ return back;
+#else
+ return (fabs(m_ptM.x * d));
+#endif
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvX(double x)
+{
+#if TRACE_DEBUG
+ double back;
+ back = m_ptM.x * x + m_ptN.x;
+
+
+#line 167 "WxdkdrawControlTools.cpt"
+ return back;
+#else
+ return (m_ptM.x * x + m_ptN.x);
+#endif
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvY(double y)
+{
+#if TRACE_DEBUG
+ double back;
+ back = m_ptM.y * y + m_ptN.y;
+
+
+#line 182 "WxdkdrawControlTools.cpt"
+ return back;
+#else
+ return (m_ptM.y * y + m_ptN.y);
+#endif
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvDist(int32_t d)
+{
+ return (ConvDist((double)d));
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvX(int32_t x)
+{
+ return (ConvX((double)x));
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvY(int32_t y)
+{
+ return (ConvY((double)y));
+}
+
+
+
+double
+WxdkdrawFrame::Control::InvX(double x)
+{
+#if TRACE_DEBUG
+ double back;
+ back = (x - m_ptN.x) / m_ptM.x;
+
+
+#line 221 "WxdkdrawControlTools.cpt"
+ return back;
+#else
+ return ((x - m_ptN.x) / m_ptM.x);
+#endif
+}
+
+
+
+double
+WxdkdrawFrame::Control::InvY(double y)
+{
+#if TRACE_DEBUG
+ double back;
+ back = (y - m_ptN.y) / m_ptM.y;
+
+
+#line 236 "WxdkdrawControlTools.cpt"
+ return back;
+#else
+ return ((y - m_ptN.y) / m_ptM.y);
+#endif
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::InvX(double x, bool & ok)
+{
+ dk4_er_t er; /* Error report */
+ double invx; /* Inverted x value */
+ int32_t i32; /* Intermediate result */
+ int32_t back = (int32_t)0L;
+
+
+#line 252 "WxdkdrawControlTools.cpt"
+ dk4error_init(&er);
+ invx = InvX(x);
+ i32 = dk4ma_int32_from_double(dk4ma_rint(invx), &er);
+ if (DK4_E_NONE == er.ec) {
+ back = i32;
+ }
+ else {
+
+#line 259 "WxdkdrawControlTools.cpt"
+ ok = false;
+ }
+
+
+#line 262 "WxdkdrawControlTools.cpt"
+ return back;
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::InvY(double y, bool & ok)
+{
+ dk4_er_t er; /* Error report */
+ double invy; /* Inverted y value */
+ int32_t i32; /* Intermediate result */
+ int32_t back = (int32_t)0L;
+
+
+#line 275 "WxdkdrawControlTools.cpt"
+ dk4error_init(&er);
+ invy = InvY(y);
+ i32 = dk4ma_int32_from_double(dk4ma_rint(invy), &er);
+ if (DK4_E_NONE == er.ec) {
+ back = i32;
+ }
+ else {
+
+#line 282 "WxdkdrawControlTools.cpt"
+ ok = false;
+ }
+
+
+#line 285 "WxdkdrawControlTools.cpt"
+ return back;
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::GridRoundDown(int32_t x,uint32_t gr,bool & ok,bool fo)
+{
+ dk4_er_t er; /* Error report */
+ int32_t back; /* Function result */
+ int32_t rem; /* Division remainder */
+
+
+#line 297 "WxdkdrawControlTools.cpt"
+ back = x / (int32_t)gr;
+
+#line 298 "WxdkdrawControlTools.cpt"
+ rem = x % (int32_t)gr;
+
+#line 299 "WxdkdrawControlTools.cpt"
+ dk4error_init(&er);
+ if (((int32_t)0L > rem) || ((fo) && ((int32_t)0L == rem))) {
+ back--;
+ }
+ back = dk4ma_int32_t_mul(back, (int32_t)gr, &er);
+ if (DK4_E_NONE != er.ec) {
+ ok = false;
+ }
+
+
+#line 308 "WxdkdrawControlTools.cpt"
+ return back;
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::GridRoundUp(int32_t x, uint32_t gr, bool & ok, bool fo)
+{
+ dk4_er_t er; /* Error report */
+ int32_t back; /* Function result */
+ int32_t rem; /* Division remainder */
+
+
+#line 320 "WxdkdrawControlTools.cpt"
+ dk4error_init(&er);
+ back = x / (int32_t)gr;
+ rem = x % (int32_t)gr;
+ if (((int32_t)0L < rem) || ((fo) && ((int32_t)0L == rem))) {
+ back++;
+ }
+ back = dk4ma_int32_t_mul(back, (int32_t)gr, &er);
+ if (DK4_E_NONE != er.ec) {
+ ok = false;
+ }
+
+
+#line 331 "WxdkdrawControlTools.cpt"
+ return back;
+
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::GridRoundNearest(int32_t x, uint32_t gr, bool & ok)
+{
+ dk4_er_t er; /* Error report */
+ int32_t back; /* Function result */
+ int32_t rem; /* Division remainder */
+
+
+#line 344 "WxdkdrawControlTools.cpt"
+ dk4error_init(&er);
+ back = x / (int32_t)gr;
+ rem = x % (int32_t)gr;
+ if ((int32_t)0L > rem) {
+ if (rem <= ((int32_t)0L - (int32_t)gr / (int32_t)2L)) {
+ back = dk4ma_int32_t_sub(back, (int32_t)1L, &er);
+ }
+ }
+ else {
+ if (rem >= (int32_t)gr / (int32_t)2L) {
+ back = dk4ma_int32_t_add(back, (int32_t)1L, &er);
+ }
+ }
+ back = dk4ma_int32_t_mul(back, (int32_t)gr, &er);
+ if (DK4_E_NONE != er.ec) {
+ ok = false;
+ }
+
+
+#line 362 "WxdkdrawControlTools.cpt"
+ return back;
+}
+
+
+
+int
+WxdkdrawFrame::Control::LineWidthForObject(
+ Wxd_drawing_t const *pDrw, Wxd_object_t const *pObj, int iMarkup
+)
+{
+ int back;
+ uint16_t lw;
+
+
+#line 375 "WxdkdrawControlTools.cpt"
+#if TRACE_DEBUG
+
+
+#line 377 "WxdkdrawControlTools.cpt"
+
+
+#line 378 "WxdkdrawControlTools.cpt"
+
+
+#line 379 "WxdkdrawControlTools.cpt"
+
+
+#line 380 "WxdkdrawControlTools.cpt"
+#endif
+
+#if VERSION_BEFORE_2020_08_16
+ back = (int)dk4ma_rint(
+ ConvDist((double)(pDrw->baselw) * (double)(pObj->lw))
+ );
+#else
+ lw = pObj->lw;
+ if (((uint16_t)0U == lw) && (WXD_MARKUP_NONE != iMarkup)) {
+ lw = (uint16_t)2U;
+
+#line 390 "WxdkdrawControlTools.cpt"
+ }
+ back = (int)dk4ma_rint(
+ ConvDist((double)(pDrw->baselw) * (double)lw)
+ );
+#endif
+
+
+#line 396 "WxdkdrawControlTools.cpt"
+ if (0 == back) { back = 1; }
+
+
+#line 398 "WxdkdrawControlTools.cpt"
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawControlTools.cpt b/support/dktools/WxdkdrawControlTools.cpt
new file mode 100644
index 0000000000..31fc6a84fe
--- /dev/null
+++ b/support/dktools/WxdkdrawControlTools.cpt
@@ -0,0 +1,403 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+# vim: set ai sw=4 ts=4 :
+
+%% module
+
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+void
+WxdkdrawFrame::Control::CalculateZoomFactor(void)
+{
+ int8_t zl; /* Local copy of zoom level to analyze */
+
+ m_dZoom = 1.0;
+ if (NULL != m_pParent) {
+ if (NULL != m_pParent->m_pDrw) {
+ if ((uint8_t)0U != m_pParent->m_pDrw->gridunit) {
+ /* Grid is in cm */
+ m_uGridOptical = 6400000UL;
+ }
+ else {
+ /* Grid is inch based (1/2 inch) */
+ m_uGridOptical = 8128000UL;
+ }
+ zl = m_pParent->m_pDrw->zl;
+ if ((int8_t)0 < zl) {
+ while ((int8_t)1 < zl) {
+ zl -= (int8_t)2;
+ m_dZoom *= 2.0;
+ m_uGridOptical /= (uint32_t)2UL;
+ }
+ if ((int8_t)0 < zl) {
+ m_dZoom *= M_SQRT2;
+ m_uGridOptical /= (uint32_t)2UL;
+ }
+ }
+ else {
+ if ((int8_t)0 > zl) {
+ while ((int8_t)(-1) > zl) {
+ zl += (int8_t)2;
+ m_dZoom /= 2.0;
+ m_uGridOptical *= (uint32_t)2UL;
+ }
+ if ((int8_t)0 > zl) {
+ m_dZoom /= M_SQRT2;
+ m_uGridOptical *= (uint32_t)2UL;
+ }
+ }
+ }
+ if ((uint8_t)0U != m_pParent->m_pDrw->gridbase) {
+ m_uGridSnap = m_uGridOptical / (uint32_t)5UL;
+ }
+ else {
+ m_uGridSnap = m_uGridOptical / (uint32_t)4UL;
+ }
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::CalculateGridDistances(void)
+{
+
+ int8_t zl; /* Local copy of zoom level to analyze */
+
+ if (NULL != m_pParent) {
+ if (NULL != m_pParent->m_pDrw) {
+ if ((uint8_t)0U != m_pParent->m_pDrw->gridunit) {
+ /* Grid is in cm */
+ m_uGridOptical = 6400000UL;
+ }
+ else {
+ /* Grid is inch based (1/2 inch) */
+ m_uGridOptical = 8128000UL;
+ }
+ zl = m_pParent->m_pDrw->zl;
+ if ((int8_t)0 < zl) {
+ while ((int8_t)1 < zl) {
+ zl -= (int8_t)2;
+ m_uGridOptical /= (uint32_t)2UL;
+ }
+ if ((int8_t)0 < zl) {
+ m_uGridOptical /= (uint32_t)2UL;
+ }
+ }
+ else {
+ if ((int8_t)0 > zl) {
+ while ((int8_t)(-1) > zl) {
+ zl += (int8_t)2;
+ m_uGridOptical *= (uint32_t)2UL;
+ }
+ if ((int8_t)0 > zl) {
+ m_uGridOptical *= (uint32_t)2UL;
+ }
+ }
+ }
+ if ((uint8_t)0U != m_pParent->m_pDrw->gridbase) {
+ m_uGridSnap = m_uGridOptical / (uint32_t)5UL;
+ }
+ else {
+ m_uGridSnap = m_uGridOptical / (uint32_t)4UL;
+ }
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::Control::CalculateConversionCoefficients(void)
+{
+ $? "+ CalculateConversionCoefficients"
+ m_ptM.x = (m_ptRes.x * m_dZoom) / 16256000.0;
+ m_ptN.x = (double)(m_szDrawco.GetWidth()) / 2.0;
+ m_ptN.x -= ((double)(m_pParent->m_pDrw->cx) * m_ptRes.x * m_dZoom)
+ / 16256000.0;
+ m_ptM.y = 0.0 - (m_ptRes.y * m_dZoom) / 16256000.0;
+ m_ptN.y = (double)(m_szDrawco.GetHeight()) / 2.0;
+ m_ptN.y += ((double)(m_pParent->m_pDrw->cy) * m_ptRes.y * m_dZoom)
+ / 16256000.0;
+ $? ". mx = %g nx = %g", m_ptM.x, m_ptN.x
+ $? ". my = %g ny = %g", m_ptM.y, m_ptN.y
+ $? "- CalculateConversionCoefficients"
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvDist(double d)
+{
+#if TRACE_DEBUG
+ double back;
+ back = fabs(m_ptM.x * d);
+ $? "= ConvDist ( %g ) = %g", d, back
+ return back;
+#else
+ return (fabs(m_ptM.x * d));
+#endif
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvX(double x)
+{
+#if TRACE_DEBUG
+ double back;
+ back = m_ptM.x * x + m_ptN.x;
+ $? "= ConvX ( %g ) = %g", x, back
+ return back;
+#else
+ return (m_ptM.x * x + m_ptN.x);
+#endif
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvY(double y)
+{
+#if TRACE_DEBUG
+ double back;
+ back = m_ptM.y * y + m_ptN.y;
+ $? "= ConvY ( %g ) = %g", y, back
+ return back;
+#else
+ return (m_ptM.y * y + m_ptN.y);
+#endif
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvDist(int32_t d)
+{
+ return (ConvDist((double)d));
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvX(int32_t x)
+{
+ return (ConvX((double)x));
+}
+
+
+
+double
+WxdkdrawFrame::Control::ConvY(int32_t y)
+{
+ return (ConvY((double)y));
+}
+
+
+
+double
+WxdkdrawFrame::Control::InvX(double x)
+{
+#if TRACE_DEBUG
+ double back;
+ back = (x - m_ptN.x) / m_ptM.x;
+ $? "= InvX ( %g ) = %g", x, back
+ return back;
+#else
+ return ((x - m_ptN.x) / m_ptM.x);
+#endif
+}
+
+
+
+double
+WxdkdrawFrame::Control::InvY(double y)
+{
+#if TRACE_DEBUG
+ double back;
+ back = (y - m_ptN.y) / m_ptM.y;
+ $? "= InvY ( %g ) = %g", y, back
+ return back;
+#else
+ return ((y - m_ptN.y) / m_ptM.y);
+#endif
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::InvX(double x, bool & ok)
+{
+ dk4_er_t er; /* Error report */
+ double invx; /* Inverted x value */
+ int32_t i32; /* Intermediate result */
+ int32_t back = (int32_t)0L;
+ $? "+ InvX %g", x
+ dk4error_init(&er);
+ invx = InvX(x);
+ i32 = dk4ma_int32_from_double(dk4ma_rint(invx), &er);
+ if (DK4_E_NONE == er.ec) {
+ back = i32;
+ }
+ else { $? "! overflow"
+ ok = false;
+ }
+ $? "- InvX %ld", (long)back
+ return back;
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::InvY(double y, bool & ok)
+{
+ dk4_er_t er; /* Error report */
+ double invy; /* Inverted y value */
+ int32_t i32; /* Intermediate result */
+ int32_t back = (int32_t)0L;
+ $? "+ InvY %g", y
+ dk4error_init(&er);
+ invy = InvY(y);
+ i32 = dk4ma_int32_from_double(dk4ma_rint(invy), &er);
+ if (DK4_E_NONE == er.ec) {
+ back = i32;
+ }
+ else { $? "! overflow"
+ ok = false;
+ }
+ $? "- InvY %ld", (long)back
+ return back;
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::GridRoundDown(int32_t x,uint32_t gr,bool & ok,bool fo)
+{
+ dk4_er_t er; /* Error report */
+ int32_t back; /* Function result */
+ int32_t rem; /* Division remainder */
+ $? "+ GridRoundDown %ld %lu %d", (long)x, (unsigned long)gr, (fo ? 1 : 0)
+ back = x / (int32_t)gr; $? ". back = %ld", (long)back
+ rem = x % (int32_t)gr; $? ". rem = %ld", (long)rem
+ dk4error_init(&er);
+ if (((int32_t)0L > rem) || ((fo) && ((int32_t)0L == rem))) {
+ back--;
+ }
+ back = dk4ma_int32_t_mul(back, (int32_t)gr, &er);
+ if (DK4_E_NONE != er.ec) {
+ ok = false;
+ }
+ $? "- GridRoundDown %ld", (long)back
+ return back;
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::GridRoundUp(int32_t x, uint32_t gr, bool & ok, bool fo)
+{
+ dk4_er_t er; /* Error report */
+ int32_t back; /* Function result */
+ int32_t rem; /* Division remainder */
+ $? "+ GridRoundUp %ld %lu %d", (long)x, (unsigned long)gr, (fo ? 1 : 0)
+ dk4error_init(&er);
+ back = x / (int32_t)gr;
+ rem = x % (int32_t)gr;
+ if (((int32_t)0L < rem) || ((fo) && ((int32_t)0L == rem))) {
+ back++;
+ }
+ back = dk4ma_int32_t_mul(back, (int32_t)gr, &er);
+ if (DK4_E_NONE != er.ec) {
+ ok = false;
+ }
+ $? "- GridRoundUp %ld", (long)back
+ return back;
+
+}
+
+
+
+int32_t
+WxdkdrawFrame::Control::GridRoundNearest(int32_t x, uint32_t gr, bool & ok)
+{
+ dk4_er_t er; /* Error report */
+ int32_t back; /* Function result */
+ int32_t rem; /* Division remainder */
+ $? "+ GridRoundNearest %ld %lu", (long)x, (unsigned long)gr
+ dk4error_init(&er);
+ back = x / (int32_t)gr;
+ rem = x % (int32_t)gr;
+ if ((int32_t)0L > rem) {
+ if (rem <= ((int32_t)0L - (int32_t)gr / (int32_t)2L)) {
+ back = dk4ma_int32_t_sub(back, (int32_t)1L, &er);
+ }
+ }
+ else {
+ if (rem >= (int32_t)gr / (int32_t)2L) {
+ back = dk4ma_int32_t_add(back, (int32_t)1L, &er);
+ }
+ }
+ back = dk4ma_int32_t_mul(back, (int32_t)gr, &er);
+ if (DK4_E_NONE != er.ec) {
+ ok = false;
+ }
+ $? "- GridRoundNearest %ld", (long)back
+ return back;
+}
+
+
+
+int
+WxdkdrawFrame::Control::LineWidthForObject(
+ Wxd_drawing_t const *pDrw, Wxd_object_t const *pObj, int iMarkup
+)
+{
+ int back;
+ uint16_t lw;
+ $? "+ LineWidthForObject"
+#if TRACE_DEBUG
+ $? ". base lw = %d", (int)(pDrw->baselw)
+ $? ". obj lw = %d", (int)(pObj->lw)
+ $? ". product = %g", (double)(pDrw->baselw) * (double)(pObj->lw)
+ $? ". convert = %g", ConvDist((double)(pDrw->baselw) * (double)(pObj->lw))
+#endif
+
+#if VERSION_BEFORE_2020_08_16
+ back = (int)dk4ma_rint(
+ ConvDist((double)(pDrw->baselw) * (double)(pObj->lw))
+ );
+#else
+ lw = pObj->lw;
+ if (((uint16_t)0U == lw) && (WXD_MARKUP_NONE != iMarkup)) {
+ lw = (uint16_t)2U; $? ". lw correction for iMarkup
+ }
+ back = (int)dk4ma_rint(
+ ConvDist((double)(pDrw->baselw) * (double)lw)
+ );
+#endif
+ $? ". back = %d", back
+ if (0 == back) { back = 1; }
+ $? "- LineWidthForObject %d", back
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgArrowSize.cpp b/support/dktools/WxdkdrawDlgArrowSize.cpp
new file mode 100644
index 0000000000..3f585b58c7
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgArrowSize.cpp
@@ -0,0 +1,461 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgArrowSize.wxc
+*/
+
+/** @file WxdkdrawDlgArrowSize.cpp The WxdkdrawDlgArrowSize module.
+*/
+
+
+#line 208 "WxdkdrawDlgArrowSize.wxc"
+
+#ifndef WxdkdrawDlgArrowSize_H_INCLUDED
+#include "WxdkdrawDlgArrowSize.h"
+#endif
+
+
+
+
+
+#line 216 "WxdkdrawDlgArrowSize.wxc"
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgArrowSize,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgArrowSize,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgArrowSize::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgArrowSize::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgArrowSize::WXD_ID_AS_LENGTH,\
+ WxdkdrawDlgArrowSize::OnLength\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgArrowSize::WXD_ID_AS_WIDTH,\
+ WxdkdrawDlgArrowSize::OnWidth\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 248 "WxdkdrawDlgArrowSize.wxc"
+WxdkdrawDlgArrowSize::WxdkdrawDlgArrowSize(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ bool bDrwElem,
+ bool bBackward
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[254],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_bBackward = bBackward;
+ if (bBackward) {
+ m_uLengthOriginal = pObject->abl;
+ m_uWidthOriginal = pObject->abw;
+ }
+ else {
+ m_uLengthOriginal = pObject->afl;
+ m_uWidthOriginal = pObject->afw;
+ }
+ if (1U > m_uLengthOriginal) { m_uLengthOriginal = 1U; }
+ if (1U > m_uWidthOriginal) { m_uWidthOriginal = 1U; }
+ m_uLengthCurrent = m_uLengthOriginal;
+ m_uWidthCurrent = m_uWidthOriginal;
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerContents = NULL;
+ sizerButtons = NULL;
+ labelLength = NULL;
+ spinLength = NULL;
+ labelWidth = NULL;
+ spinWidth = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerContents = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ labelLength = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[255]
+ );
+ if(!(labelLength)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ labelLength,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spinLength = new wxSpinCtrl(
+ this,
+ WXD_ID_AS_LENGTH,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 255,
+ 1
+ );
+ if(!(spinLength)) {
+ goto dkctGUILayoutFinished;
+ }
+ spinLength->SetToolTip(pTexts[257]);
+ sizerContents->Add(
+ spinLength,
+ wxGBPosition(0, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ labelWidth = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[256]
+ );
+ if(!(labelWidth)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ labelWidth,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spinWidth = new wxSpinCtrl(
+ this,
+ WXD_ID_AS_WIDTH,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 255,
+ 1
+ );
+ if(!(spinWidth)) {
+ goto dkctGUILayoutFinished;
+ }
+ spinWidth->SetToolTip(pTexts[258]);
+ sizerContents->Add(
+ spinWidth,
+ wxGBPosition(1, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerContents,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[259]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[261]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[260]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[262]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 282 "WxdkdrawDlgArrowSize.wxc"
+ if (dkctGUILayoutOK) {
+ spinLength->SetValue(m_uLengthOriginal);
+ spinWidth->SetValue(m_uWidthOriginal);
+ if (bBackward) {
+ switch ( (int)(pObject->abt) ) {
+ case 27: case 28: {
+ spinWidth->Enable(false);
+ } break;
+ case 29: {
+ spinLength->Enable(false);
+ } break;
+ }
+ }
+ else {
+ switch ( (int)(pObject->aft) ) {
+ case 27: case 28: {
+ spinWidth->Enable(false);
+ } break;
+ case 29: {
+ spinLength->Enable(false);
+ } break;
+ }
+ }
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+#line 311 "WxdkdrawDlgArrowSize.wxc"
+
+
+
+void
+WxdkdrawDlgArrowSize::TransferLength(void)
+{
+ bool bDoRefresh = false;
+ m_uLengthCurrent = spinLength->GetValue();
+ if (m_bBackward) {
+ if (m_uLengthCurrent != m_pObject->abl) {
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ m_pObject->abl = m_uLengthCurrent;
+ }
+ }
+ else {
+ if (m_uLengthCurrent != m_pObject->afl) {
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ m_pObject->afl = m_uLengthCurrent;
+ }
+ }
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::TransferWidth(void)
+{
+ bool bDoRefresh = false;
+ m_uWidthCurrent = spinWidth->GetValue();
+ if (m_bBackward) {
+ if (m_uWidthCurrent != m_pObject->abw) {
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ m_pObject->abw = m_uWidthCurrent;
+ }
+ }
+ else {
+ if (m_uWidthCurrent != m_pObject->afw) {
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ m_pObject->afw = m_uWidthCurrent;
+ }
+ }
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 374 "WxdkdrawDlgArrowSize.wxc"
+ TransferLength();
+ TransferWidth();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+
+
+#line 384 "WxdkdrawDlgArrowSize.wxc"
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+
+
+#line 393 "WxdkdrawDlgArrowSize.wxc"
+ if (m_bBackward) {
+ if (m_uLengthOriginal != m_pObject->abl) {
+ m_pObject->abl = m_uLengthOriginal;
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ }
+ if (m_uWidthOriginal != m_pObject->abw) {
+ m_pObject->abw = m_uWidthOriginal;
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ }
+ }
+ else {
+ if (m_uLengthOriginal != m_pObject->afl) {
+ m_pObject->afl = m_uLengthOriginal;
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ }
+ if (m_uWidthOriginal != m_pObject->afw) {
+ m_pObject->afw = m_uWidthOriginal;
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ }
+ }
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+
+
+#line 432 "WxdkdrawDlgArrowSize.wxc"
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::OnLength(wxSpinEvent & WXUNUSED(event))
+{
+
+
+#line 440 "WxdkdrawDlgArrowSize.wxc"
+ TransferLength();
+
+
+#line 442 "WxdkdrawDlgArrowSize.wxc"
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::OnWidth(wxSpinEvent & WXUNUSED(event))
+{
+
+
+#line 450 "WxdkdrawDlgArrowSize.wxc"
+ TransferWidth();
+
+
+#line 452 "WxdkdrawDlgArrowSize.wxc"
+}
+
+
+#if 0
+
+uint8_t
+WxdkdrawDlgArrowSize::GetArrowLength(void)
+const
+{
+ return m_uLengthCurrent;
+}
+
+
+
+uint8_t
+WxdkdrawDlgArrowSize::GetArrowWidth(void)
+const
+{
+ return m_uWidthCurrent;
+}
+
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawDlgArrowSize.h b/support/dktools/WxdkdrawDlgArrowSize.h
new file mode 100644
index 0000000000..9cfc5631dd
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgArrowSize.h
@@ -0,0 +1,220 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgArrowSize.wxc
+*/
+
+/** @file WxdkdrawDlgArrowSize.h Header file for the WxdkdrawDlgArrowSize module.
+*/
+
+#ifndef WXDKDRAWDLGARROWSIZE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGARROWSIZE_H_INCLUDED 1
+
+
+#line 68 "WxdkdrawDlgArrowSize.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#line 79 "WxdkdrawDlgArrowSize.wxc"
+
+/** The arrow size dialog asks the user to set arrow length and
+ width in multiples of the line width.
+*/
+class WxdkdrawDlgArrowSize : public wxDialog
+{
+
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent frame (the programs main window).
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Graphics object the arrowhead is attached to.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Arrow length.
+ */
+ uint8_t m_uLengthOriginal;
+
+ /** Arrow width.
+ */
+ uint8_t m_uWidthOriginal;
+
+ /** Arrow length.
+ */
+ uint8_t m_uLengthCurrent;
+
+ /** Arrow width.
+ */
+ uint8_t m_uWidthCurrent;
+
+ /** Flag: Changing a real drawing element.
+ */
+ bool m_bDrwElem;
+
+ /** Flag: Changing backward arrow (false for forward arrow).
+ */
+ bool m_bBackward;
+
+ public:
+
+ /** Window IDs.
+ */
+ enum {
+ WXD_ID_AS_LENGTH = (wxID_HIGHEST + 1), /**< Length spin ctrl. */
+ WXD_ID_AS_WIDTH /**< Width spin ctrl. */
+ };
+
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param bDrwElem Flag: Changing real drawing element.
+ @param bBackward Flag: Changing backward arrow.
+ */
+ WxdkdrawDlgArrowSize(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ bool bDrwElem,
+ bool bBackward
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Length spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnLength(wxSpinEvent & event);
+
+ /** Width spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnWidth(wxSpinEvent & event);
+
+#if 0
+ /** Retrieve arrow length.
+ @return Arrow length.
+ */
+ uint8_t
+ GetArrowLength(void) const;
+
+ /** Retrieve arrow width.
+ @return Arrow width.
+ */
+ uint8_t
+ GetArrowWidth(void) const;
+#endif
+
+ protected:
+
+ void
+ TransferLength(void);
+
+ void
+ TransferWidth(void);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgArrowSize.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 18 "WxdkdrawDlgArrowSize.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerContents.
+ */
+#line 26 "WxdkdrawDlgArrowSize.wxc"
+ wxGridBagSizer *sizerContents;
+
+ /** GUI element sizerButtons.
+ */
+#line 51 "WxdkdrawDlgArrowSize.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element labelLength.
+ */
+#line 33 "WxdkdrawDlgArrowSize.wxc"
+ wxStaticText *labelLength;
+
+ /** GUI element spinLength.
+ */
+#line 36 "WxdkdrawDlgArrowSize.wxc"
+ wxSpinCtrl *spinLength;
+
+ /** GUI element labelWidth.
+ */
+#line 42 "WxdkdrawDlgArrowSize.wxc"
+ wxStaticText *labelWidth;
+
+ /** GUI element spinWidth.
+ */
+#line 45 "WxdkdrawDlgArrowSize.wxc"
+ wxSpinCtrl *spinWidth;
+
+ /** GUI element buttonOK.
+ */
+#line 55 "WxdkdrawDlgArrowSize.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 60 "WxdkdrawDlgArrowSize.wxc"
+ wxButton *buttonCancel;
+
+
+#line 202 "WxdkdrawDlgArrowSize.wxc"
+};
+
+
+
+#line 206 "WxdkdrawDlgArrowSize.wxc"
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgArrowSize.wxc b/support/dktools/WxdkdrawDlgArrowSize.wxc
new file mode 100644
index 0000000000..6c1e5c619d
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgArrowSize.wxc
@@ -0,0 +1,475 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerContents centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxGridBagSizer sizerContents]
+grid = 5 5
+contents = labelLength 0 0 1 1 right centered-y
+contents = spinLength . +1 1 1 left centered-y
+contents = labelWidth +1 0 1 1 right centered-y
+contents = spinWidth . +1 1 1 left centered-y
+
+[wxStaticText labelLength]
+text = pTexts[255]
+
+[wxSpinCtrl spinLength]
+id = WXD_ID_AS_LENGTH
+tip = pTexts[257]
+range = 1 255
+value = 1
+
+[wxStaticText labelWidth]
+text = pTexts[256]
+
+[wxSpinCtrl spinWidth]
+id = WXD_ID_AS_WIDTH
+tip = pTexts[258]
+range = 1 255
+value = 1
+
+[wxStdDialogButtonSizer sizerButtons]
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[259]
+tip = pTexts[261]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[260]
+tip = pTexts[262]
+
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+%% class start
+
+/** The arrow size dialog asks the user to set arrow length and
+ width in multiples of the line width.
+*/
+class WxdkdrawDlgArrowSize : public wxDialog
+{
+
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent frame (the programs main window).
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Graphics object the arrowhead is attached to.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Arrow length.
+ */
+ uint8_t m_uLengthOriginal;
+
+ /** Arrow width.
+ */
+ uint8_t m_uWidthOriginal;
+
+ /** Arrow length.
+ */
+ uint8_t m_uLengthCurrent;
+
+ /** Arrow width.
+ */
+ uint8_t m_uWidthCurrent;
+
+ /** Flag: Changing a real drawing element.
+ */
+ bool m_bDrwElem;
+
+ /** Flag: Changing backward arrow (false for forward arrow).
+ */
+ bool m_bBackward;
+
+ public:
+
+ /** Window IDs.
+ */
+ enum {
+ WXD_ID_AS_LENGTH = (wxID_HIGHEST + 1), /**< Length spin ctrl. */
+ WXD_ID_AS_WIDTH /**< Width spin ctrl. */
+ };
+
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param bDrwElem Flag: Changing real drawing element.
+ @param bBackward Flag: Changing backward arrow.
+ */
+ WxdkdrawDlgArrowSize(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ bool bDrwElem,
+ bool bBackward
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Length spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnLength(wxSpinEvent & event);
+
+ /** Width spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnWidth(wxSpinEvent & event);
+
+#if 0
+ /** Retrieve arrow length.
+ @return Arrow length.
+ */
+ uint8_t
+ GetArrowLength(void) const;
+
+ /** Retrieve arrow width.
+ @return Arrow width.
+ */
+ uint8_t
+ GetArrowWidth(void) const;
+#endif
+
+ protected:
+
+ void
+ TransferLength(void);
+
+ void
+ TransferWidth(void);
+
+%% class end
+};
+
+
+%% header end
+
+%% module start
+
+#ifndef WxdkdrawDlgArrowSize_H_INCLUDED
+#include "WxdkdrawDlgArrowSize.h"
+#endif
+
+
+
+$!trace-include
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgArrowSize,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgArrowSize,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgArrowSize::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgArrowSize::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgArrowSize::WXD_ID_AS_LENGTH,\
+ WxdkdrawDlgArrowSize::OnLength\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgArrowSize::WXD_ID_AS_WIDTH,\
+ WxdkdrawDlgArrowSize::OnWidth\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+WxdkdrawDlgArrowSize::WxdkdrawDlgArrowSize(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ bool bDrwElem,
+ bool bBackward
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[254],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_bBackward = bBackward;
+ if (bBackward) {
+ m_uLengthOriginal = pObject->abl;
+ m_uWidthOriginal = pObject->abw;
+ }
+ else {
+ m_uLengthOriginal = pObject->afl;
+ m_uWidthOriginal = pObject->afw;
+ }
+ if (1U > m_uLengthOriginal) { m_uLengthOriginal = 1U; }
+ if (1U > m_uWidthOriginal) { m_uWidthOriginal = 1U; }
+ m_uLengthCurrent = m_uLengthOriginal;
+ m_uWidthCurrent = m_uWidthOriginal;
+%% constructor end
+ if (dkctGUILayoutOK) {
+ spinLength->SetValue(m_uLengthOriginal);
+ spinWidth->SetValue(m_uWidthOriginal);
+ if (bBackward) {
+ switch ( (int)(pObject->abt) ) {
+ case 27: case 28: {
+ spinWidth->Enable(false);
+ } break;
+ case 29: {
+ spinLength->Enable(false);
+ } break;
+ }
+ }
+ else {
+ switch ( (int)(pObject->aft) ) {
+ case 27: case 28: {
+ spinWidth->Enable(false);
+ } break;
+ case 29: {
+ spinLength->Enable(false);
+ } break;
+ }
+ }
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+%% module end
+
+
+
+void
+WxdkdrawDlgArrowSize::TransferLength(void)
+{
+ bool bDoRefresh = false;
+ m_uLengthCurrent = spinLength->GetValue();
+ if (m_bBackward) {
+ if (m_uLengthCurrent != m_pObject->abl) {
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ m_pObject->abl = m_uLengthCurrent;
+ }
+ }
+ else {
+ if (m_uLengthCurrent != m_pObject->afl) {
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ m_pObject->afl = m_uLengthCurrent;
+ }
+ }
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::TransferWidth(void)
+{
+ bool bDoRefresh = false;
+ m_uWidthCurrent = spinWidth->GetValue();
+ if (m_bBackward) {
+ if (m_uWidthCurrent != m_pObject->abw) {
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ m_pObject->abw = m_uWidthCurrent;
+ }
+ }
+ else {
+ if (m_uWidthCurrent != m_pObject->afw) {
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ m_pObject->afw = m_uWidthCurrent;
+ }
+ }
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnOK"
+ TransferLength();
+ TransferWidth();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ $? "- OnOK"
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ $? "+ OnCancel"
+ if (m_bBackward) {
+ if (m_uLengthOriginal != m_pObject->abl) {
+ m_pObject->abl = m_uLengthOriginal;
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ }
+ if (m_uWidthOriginal != m_pObject->abw) {
+ m_pObject->abw = m_uWidthOriginal;
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ }
+ }
+ else {
+ if (m_uLengthOriginal != m_pObject->afl) {
+ m_pObject->afl = m_uLengthOriginal;
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ }
+ if (m_uWidthOriginal != m_pObject->afw) {
+ m_pObject->afw = m_uWidthOriginal;
+ if (m_bDrwElem) {
+ bDoRefresh = true;
+ }
+ }
+ }
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+ $? "- OnCancel"
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::OnLength(wxSpinEvent & WXUNUSED(event))
+{
+ $? "+ OnLength"
+ TransferLength();
+ $? "- OnLength"
+}
+
+
+
+void
+WxdkdrawDlgArrowSize::OnWidth(wxSpinEvent & WXUNUSED(event))
+{
+ $? "+ OnWidth"
+ TransferWidth();
+ $? "- OnWidth"
+}
+
+
+#if 0
+
+uint8_t
+WxdkdrawDlgArrowSize::GetArrowLength(void)
+const
+{
+ return m_uLengthCurrent;
+}
+
+
+
+uint8_t
+WxdkdrawDlgArrowSize::GetArrowWidth(void)
+const
+{
+ return m_uWidthCurrent;
+}
+
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawDlgArrowType.cpp b/support/dktools/WxdkdrawDlgArrowType.cpp
new file mode 100644
index 0000000000..7a05a1ce25
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgArrowType.cpp
@@ -0,0 +1,861 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgArrowType.wxc
+*/
+
+/** @file WxdkdrawDlgArrowType.cpp The WxdkdrawDlgArrowType module.
+*/
+
+
+#line 324 "WxdkdrawDlgArrowType.wxc"
+
+#ifndef WXDKDRAWDLGARROWTYPE_H_INCLUDED
+#include "WxdkdrawDlgArrowType.h"
+#endif
+
+
+
+
+
+#line 332 "WxdkdrawDlgArrowType.wxc"
+
+
+
+/** Assign methods to events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgArrowType,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgArrowType,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgArrowType::OnCancel\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_NONE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_STROKE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_I_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_I_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_I_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_I_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_B_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_B_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_B_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_B_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RA_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RA_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RA_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RA_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_STROKE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_C_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_C_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_STROKE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 474 "WxdkdrawDlgArrowType.wxc"
+WxdkdrawDlgArrowType::WxdkdrawDlgArrowType(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem,
+ bool bBackward
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[251],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_bBackward = bBackward;
+ m_uArrowTypeOriginal = m_uArrowTypeCurrent =
+ ((bBackward) ? (pObject->abt) : (pObject->aft));
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerButtons = NULL;
+ buttonCancel = NULL;
+ b00 = NULL;
+ b01 = NULL;
+ b02 = NULL;
+ b03 = NULL;
+ b04 = NULL;
+ b05 = NULL;
+ b06 = NULL;
+ b07 = NULL;
+ b08 = NULL;
+ b09 = NULL;
+ b10 = NULL;
+ b11 = NULL;
+ b12 = NULL;
+ b13 = NULL;
+ b14 = NULL;
+ b15 = NULL;
+ b16 = NULL;
+ b17 = NULL;
+ b18 = NULL;
+ b19 = NULL;
+ b20 = NULL;
+ b21 = NULL;
+ b22 = NULL;
+ b23 = NULL;
+ b24 = NULL;
+ b25 = NULL;
+ b26 = NULL;
+ b27 = NULL;
+ b28 = NULL;
+ b29 = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_NONE,
+ pImages[0]
+ );
+ if(!(b00)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b00,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b01 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_N_STROKE,
+ pImages[1]
+ );
+ if(!(b01)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b01,
+ wxGBPosition(0, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b02 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_N_WHITE,
+ pImages[2]
+ );
+ if(!(b02)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b02,
+ wxGBPosition(0, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b03 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_N_FILLED,
+ pImages[3]
+ );
+ if(!(b03)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b03,
+ wxGBPosition(0, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b04 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_N_HALF_FILLED_LEFT,
+ pImages[4]
+ );
+ if(!(b04)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b04,
+ wxGBPosition(0, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b05 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_N_HALF_FILLED_RIGHT,
+ pImages[5]
+ );
+ if(!(b05)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b05,
+ wxGBPosition(0, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b06 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_I_WHITE,
+ pImages[6]
+ );
+ if(!(b06)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b06,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b07 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_I_FILLED,
+ pImages[7]
+ );
+ if(!(b07)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b07,
+ wxGBPosition(1, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b08 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_I_HALF_FILLED_LEFT,
+ pImages[8]
+ );
+ if(!(b08)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b08,
+ wxGBPosition(1, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b09 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_I_HALF_FILLED_RIGHT,
+ pImages[9]
+ );
+ if(!(b09)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b09,
+ wxGBPosition(1, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b10 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_B_WHITE,
+ pImages[10]
+ );
+ if(!(b10)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b10,
+ wxGBPosition(1, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b11 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_B_FILLED,
+ pImages[11]
+ );
+ if(!(b11)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b11,
+ wxGBPosition(1, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b12 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_B_HALF_FILLED_LEFT,
+ pImages[12]
+ );
+ if(!(b12)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b12,
+ wxGBPosition(2, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b13 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_B_HALF_FILLED_RIGHT,
+ pImages[13]
+ );
+ if(!(b13)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b13,
+ wxGBPosition(2, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b14 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RA_WHITE,
+ pImages[14]
+ );
+ if(!(b14)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b14,
+ wxGBPosition(2, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b15 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RA_FILLED,
+ pImages[15]
+ );
+ if(!(b15)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b15,
+ wxGBPosition(2, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b16 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RA_HALF_FILLED_LEFT,
+ pImages[16]
+ );
+ if(!(b16)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b16,
+ wxGBPosition(2, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b17 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RA_HALF_FILLED_RIGHT,
+ pImages[17]
+ );
+ if(!(b17)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b17,
+ wxGBPosition(2, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b18 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RE_WHITE,
+ pImages[18]
+ );
+ if(!(b18)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b18,
+ wxGBPosition(3, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b19 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RE_FILLED,
+ pImages[19]
+ );
+ if(!(b19)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b19,
+ wxGBPosition(3, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b20 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RE_HALF_FILLED_LEFT,
+ pImages[20]
+ );
+ if(!(b20)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b20,
+ wxGBPosition(3, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b21 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RE_HALF_FILLED_RIGHT,
+ pImages[21]
+ );
+ if(!(b21)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b21,
+ wxGBPosition(3, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b22 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_RE_STROKE,
+ pImages[22]
+ );
+ if(!(b22)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b22,
+ wxGBPosition(3, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b23 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_T_WHITE,
+ pImages[23]
+ );
+ if(!(b23)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b23,
+ wxGBPosition(3, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b24 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_T_FILLED,
+ pImages[24]
+ );
+ if(!(b24)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b24,
+ wxGBPosition(4, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b25 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_T_HALF_FILLED_LEFT,
+ pImages[25]
+ );
+ if(!(b25)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b25,
+ wxGBPosition(4, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b26 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_T_HALF_FILLED_RIGHT,
+ pImages[26]
+ );
+ if(!(b26)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b26,
+ wxGBPosition(4, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b27 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_C_WHITE,
+ pImages[27]
+ );
+ if(!(b27)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b27,
+ wxGBPosition(4, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b28 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_C_FILLED,
+ pImages[28]
+ );
+ if(!(b28)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b28,
+ wxGBPosition(4, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b29 = new wxBitmapButton(
+ this,
+ WXD_AT_ID_T_STROKE,
+ pImages[29]
+ );
+ if(!(b29)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerButtons->Add(
+ b29,
+ wxGBPosition(4, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[252]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[253]);
+ sizerVertical->Add(
+ buttonCancel,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 499 "WxdkdrawDlgArrowType.wxc"
+}
+
+
+#line 502 "WxdkdrawDlgArrowType.wxc"
+
+
+void
+WxdkdrawDlgArrowType::OnArrowType(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+
+ switch (event.GetId()) {
+ case WXD_AT_ID_NONE : {
+ m_uArrowTypeCurrent = 0U;
+ } break;
+ case WXD_AT_ID_N_STROKE : {
+ m_uArrowTypeCurrent = 1U;
+ } break;
+ case WXD_AT_ID_N_WHITE : {
+ m_uArrowTypeCurrent = 2U;
+ } break;
+ case WXD_AT_ID_N_FILLED : {
+ m_uArrowTypeCurrent = 3U;
+ } break;
+ case WXD_AT_ID_N_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 4U;
+ } break;
+ case WXD_AT_ID_N_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 5U;
+ } break;
+ case WXD_AT_ID_I_WHITE : {
+ m_uArrowTypeCurrent = 6U;
+ } break;
+ case WXD_AT_ID_I_FILLED : {
+ m_uArrowTypeCurrent = 7U;
+ } break;
+ case WXD_AT_ID_I_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 8U;
+ } break;
+ case WXD_AT_ID_I_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 9U;
+ } break;
+ case WXD_AT_ID_B_WHITE : {
+ m_uArrowTypeCurrent = 10U;
+ } break;
+ case WXD_AT_ID_B_FILLED : {
+ m_uArrowTypeCurrent = 11U;
+ } break;
+ case WXD_AT_ID_B_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 12U;
+ } break;
+ case WXD_AT_ID_B_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 13U;
+ } break;
+ case WXD_AT_ID_RA_WHITE : {
+ m_uArrowTypeCurrent = 14U;
+ } break;
+ case WXD_AT_ID_RA_FILLED : {
+ m_uArrowTypeCurrent = 15U;
+ } break;
+ case WXD_AT_ID_RA_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 16U;
+ } break;
+ case WXD_AT_ID_RA_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 17U;
+ } break;
+ case WXD_AT_ID_RE_WHITE : {
+ m_uArrowTypeCurrent = 18U;
+ } break;
+ case WXD_AT_ID_RE_FILLED : {
+ m_uArrowTypeCurrent = 19U;
+ } break;
+ case WXD_AT_ID_RE_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 20U;
+ } break;
+ case WXD_AT_ID_RE_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 21U;
+ } break;
+ case WXD_AT_ID_RE_STROKE : {
+ m_uArrowTypeCurrent = 22U;
+ } break;
+ case WXD_AT_ID_T_WHITE : {
+ m_uArrowTypeCurrent = 23U;
+ } break;
+ case WXD_AT_ID_T_FILLED : {
+ m_uArrowTypeCurrent = 24U;
+ } break;
+ case WXD_AT_ID_T_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 25U;
+ } break;
+ case WXD_AT_ID_T_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 26U;
+ } break;
+ case WXD_AT_ID_C_WHITE : {
+ m_uArrowTypeCurrent = 27U;
+ } break;
+ case WXD_AT_ID_C_FILLED : {
+ m_uArrowTypeCurrent = 28U;
+ } break;
+ case WXD_AT_ID_T_STROKE : {
+ m_uArrowTypeCurrent = 29U;
+ } break;
+ }
+ if (m_bBackward) {
+ if ((m_bDrwElem) && (m_uArrowTypeCurrent != m_pObject->abt)) {
+ bDoRefresh = true;
+ }
+ m_pObject->abt = m_uArrowTypeCurrent;
+ }
+ else {
+ if ((m_bDrwElem) && (m_uArrowTypeCurrent != m_pObject->aft)) {
+ bDoRefresh = true;
+ }
+ m_pObject->aft = m_uArrowTypeCurrent;
+ }
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgArrowType::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+#if 0
+
+uint8_t
+WxdkdrawDlgArrowType::GetArrowType(void)
+const
+{
+ return m_uArrowTypeCurrent;
+}
+
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgArrowType.h b/support/dktools/WxdkdrawDlgArrowType.h
new file mode 100644
index 0000000000..63e5901bf6
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgArrowType.h
@@ -0,0 +1,337 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgArrowType.wxc
+*/
+
+/** @file WxdkdrawDlgArrowType.h Header file for the WxdkdrawDlgArrowType module.
+*/
+
+#ifndef WXDKDRAWDLGARROWTYPE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGARROWTYPE_H_INCLUDED 1
+
+
+#line 187 "WxdkdrawDlgArrowType.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#line 198 "WxdkdrawDlgArrowType.wxc"
+
+/** The arrow type dialog lets the user choose the arrow type.
+*/
+class WxdkdrawDlgArrowType : public wxDialog
+{
+
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Program main window.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Current arrow type in dialog.
+ */
+ uint8_t m_uArrowTypeCurrent;
+
+ /** Original arrow type when opening dialog.
+ */
+ uint8_t m_uArrowTypeOriginal;
+
+ /** Modify backward arrowhead (true) or forward arrowhead (false).
+ */
+ bool m_bBackward;
+
+ /** Modify drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for arrow type buttons.
+ */
+ enum {
+ WXD_AT_ID_NONE = (wxID_HIGHEST + 1), /**< No arrow. */
+ WXD_AT_ID_N_STROKE , /**< Normal, stroked. */
+ WXD_AT_ID_N_WHITE , /**< Normal, white filled. */
+ WXD_AT_ID_N_FILLED , /**< Normal, colour filled. */
+ WXD_AT_ID_N_HALF_FILLED_LEFT , /**< Normal, left half filled. */
+ WXD_AT_ID_N_HALF_FILLED_RIGHT , /**< Normal, right half filled. */
+ WXD_AT_ID_I_WHITE , /**< Indented, white filled. */
+ WXD_AT_ID_I_FILLED , /**< Indented, colour filled. */
+ WXD_AT_ID_I_HALF_FILLED_LEFT , /**< Indented, left half. */
+ WXD_AT_ID_I_HALF_FILLED_RIGHT , /**< Indented, right half. */
+ WXD_AT_ID_B_WHITE , /**< Butted, white filled. */
+ WXD_AT_ID_B_FILLED , /**< Butted, colour filled. */
+ WXD_AT_ID_B_HALF_FILLED_LEFT , /**< Butted, left half. */
+ WXD_AT_ID_B_HALF_FILLED_RIGHT , /**< Butted, right half. */
+ WXD_AT_ID_RA_WHITE , /**< Raute, white filled. */
+ WXD_AT_ID_RA_FILLED , /**< Raute, colour filled. */
+ WXD_AT_ID_RA_HALF_FILLED_LEFT , /**< Raute, left half. */
+ WXD_AT_ID_RA_HALF_FILLED_RIGHT, /**< Raute, right half. */
+ WXD_AT_ID_RE_WHITE , /**< Rectangle, white filled. */
+ WXD_AT_ID_RE_FILLED , /**< Rectangle, colour filled. */
+ WXD_AT_ID_RE_HALF_FILLED_LEFT , /**< Rectangle, left half. */
+ WXD_AT_ID_RE_HALF_FILLED_RIGHT, /**< Rectangle, right half. */
+ WXD_AT_ID_RE_STROKE, /**< Rectangle, stroked. */
+ WXD_AT_ID_T_WHITE , /**< Triangle, white filled. */
+ WXD_AT_ID_T_FILLED , /**< Triangle, colour filled. */
+ WXD_AT_ID_T_HALF_FILLED_LEFT , /**< Triangle, left half. */
+ WXD_AT_ID_T_HALF_FILLED_RIGHT , /**< Triangle, right half. */
+ WXD_AT_ID_C_WHITE , /**< Circle, white filled. */
+ WXD_AT_ID_C_FILLED , /**< Circle, colour filled. */
+ WXD_AT_ID_T_STROKE /**< T stroke over line end. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Modify drawing element (or default style).
+ @param bBackward Modify backward arrow (or forward).
+ */
+ WxdkdrawDlgArrowType(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem,
+ bool bBackward
+ );
+
+ /** Handler for arrow type buttons.
+ @param event Event to process.
+ */
+ void
+ OnArrowType(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+#if 0
+
+ /** Retrieve arrow type.
+ @return Arrow type selected in dialog.
+ */
+ uint8_t
+ GetArrowType(void) const;
+
+#endif
+
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgArrowType.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 18 "WxdkdrawDlgArrowType.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerButtons.
+ */
+#line 26 "WxdkdrawDlgArrowType.wxc"
+ wxGridBagSizer *sizerButtons;
+
+ /** GUI element buttonCancel.
+ */
+#line 179 "WxdkdrawDlgArrowType.wxc"
+ wxButton *buttonCancel;
+
+ /** GUI element b00.
+ */
+#line 59 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b00;
+
+ /** GUI element b01.
+ */
+#line 63 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b01;
+
+ /** GUI element b02.
+ */
+#line 67 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b02;
+
+ /** GUI element b03.
+ */
+#line 71 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b03;
+
+ /** GUI element b04.
+ */
+#line 75 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b04;
+
+ /** GUI element b05.
+ */
+#line 79 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b05;
+
+ /** GUI element b06.
+ */
+#line 83 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b06;
+
+ /** GUI element b07.
+ */
+#line 87 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b07;
+
+ /** GUI element b08.
+ */
+#line 91 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b08;
+
+ /** GUI element b09.
+ */
+#line 95 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b09;
+
+ /** GUI element b10.
+ */
+#line 99 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b10;
+
+ /** GUI element b11.
+ */
+#line 103 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b11;
+
+ /** GUI element b12.
+ */
+#line 107 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b12;
+
+ /** GUI element b13.
+ */
+#line 111 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b13;
+
+ /** GUI element b14.
+ */
+#line 115 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b14;
+
+ /** GUI element b15.
+ */
+#line 119 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b15;
+
+ /** GUI element b16.
+ */
+#line 123 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b16;
+
+ /** GUI element b17.
+ */
+#line 127 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b17;
+
+ /** GUI element b18.
+ */
+#line 131 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b18;
+
+ /** GUI element b19.
+ */
+#line 135 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b19;
+
+ /** GUI element b20.
+ */
+#line 139 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b20;
+
+ /** GUI element b21.
+ */
+#line 143 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b21;
+
+ /** GUI element b22.
+ */
+#line 147 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b22;
+
+ /** GUI element b23.
+ */
+#line 151 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b23;
+
+ /** GUI element b24.
+ */
+#line 155 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b24;
+
+ /** GUI element b25.
+ */
+#line 159 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b25;
+
+ /** GUI element b26.
+ */
+#line 163 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b26;
+
+ /** GUI element b27.
+ */
+#line 167 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b27;
+
+ /** GUI element b28.
+ */
+#line 171 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b28;
+
+ /** GUI element b29.
+ */
+#line 175 "WxdkdrawDlgArrowType.wxc"
+ wxBitmapButton *b29;
+
+
+#line 318 "WxdkdrawDlgArrowType.wxc"
+};
+
+
+
+#line 322 "WxdkdrawDlgArrowType.wxc"
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgArrowType.wxc b/support/dktools/WxdkdrawDlgArrowType.wxc
new file mode 100644
index 0000000000..1345d2502c
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgArrowType.wxc
@@ -0,0 +1,654 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+contents = buttonCancel centered-x
+contents = $space(10)
+
+[wxGridBagSizer sizerButtons]
+grid = 5 5
+contents = b00 0 0 1 1 centered-x centered-y
+contents = b01 0 1 1 1 centered-x centered-y
+contents = b02 0 2 1 1 centered-x centered-y
+contents = b03 0 3 1 1 centered-x centered-y
+contents = b04 0 4 1 1 centered-x centered-y
+contents = b05 0 5 1 1 centered-x centered-y
+contents = b06 1 0 1 1 centered-x centered-y
+contents = b07 1 1 1 1 centered-x centered-y
+contents = b08 1 2 1 1 centered-x centered-y
+contents = b09 1 3 1 1 centered-x centered-y
+contents = b10 1 4 1 1 centered-x centered-y
+contents = b11 1 5 1 1 centered-x centered-y
+contents = b12 2 0 1 1 centered-x centered-y
+contents = b13 2 1 1 1 centered-x centered-y
+contents = b14 2 2 1 1 centered-x centered-y
+contents = b15 2 3 1 1 centered-x centered-y
+contents = b16 2 4 1 1 centered-x centered-y
+contents = b17 2 5 1 1 centered-x centered-y
+contents = b18 3 0 1 1 centered-x centered-y
+contents = b19 3 1 1 1 centered-x centered-y
+contents = b20 3 2 1 1 centered-x centered-y
+contents = b21 3 3 1 1 centered-x centered-y
+contents = b22 3 4 1 1 centered-x centered-y
+contents = b23 3 5 1 1 centered-x centered-y
+contents = b24 4 0 1 1 centered-x centered-y
+contents = b25 4 1 1 1 centered-x centered-y
+contents = b26 4 2 1 1 centered-x centered-y
+contents = b27 4 3 1 1 centered-x centered-y
+contents = b28 4 4 1 1 centered-x centered-y
+contents = b29 4 5 1 1 centered-x centered-y
+
+[wxBitmapButton b00]
+id = WXD_AT_ID_NONE
+bitmap = pImages[0]
+
+[wxBitmapButton b01]
+id = WXD_AT_ID_N_STROKE
+bitmap = pImages[1]
+
+[wxBitmapButton b02]
+id = WXD_AT_ID_N_WHITE
+bitmap = pImages[2]
+
+[wxBitmapButton b03]
+id = WXD_AT_ID_N_FILLED
+bitmap = pImages[3]
+
+[wxBitmapButton b04]
+id = WXD_AT_ID_N_HALF_FILLED_LEFT
+bitmap = pImages[4]
+
+[wxBitmapButton b05]
+id = WXD_AT_ID_N_HALF_FILLED_RIGHT
+bitmap = pImages[5]
+
+[wxBitmapButton b06]
+id = WXD_AT_ID_I_WHITE
+bitmap = pImages[6]
+
+[wxBitmapButton b07]
+id = WXD_AT_ID_I_FILLED
+bitmap = pImages[7]
+
+[wxBitmapButton b08]
+id = WXD_AT_ID_I_HALF_FILLED_LEFT
+bitmap = pImages[8]
+
+[wxBitmapButton b09]
+id = WXD_AT_ID_I_HALF_FILLED_RIGHT
+bitmap = pImages[9]
+
+[wxBitmapButton b10]
+id = WXD_AT_ID_B_WHITE
+bitmap = pImages[10]
+
+[wxBitmapButton b11]
+id = WXD_AT_ID_B_FILLED
+bitmap = pImages[11]
+
+[wxBitmapButton b12]
+id = WXD_AT_ID_B_HALF_FILLED_LEFT
+bitmap = pImages[12]
+
+[wxBitmapButton b13]
+id = WXD_AT_ID_B_HALF_FILLED_RIGHT
+bitmap = pImages[13]
+
+[wxBitmapButton b14]
+id = WXD_AT_ID_RA_WHITE
+bitmap = pImages[14]
+
+[wxBitmapButton b15]
+id = WXD_AT_ID_RA_FILLED
+bitmap = pImages[15]
+
+[wxBitmapButton b16]
+id = WXD_AT_ID_RA_HALF_FILLED_LEFT
+bitmap = pImages[16]
+
+[wxBitmapButton b17]
+id = WXD_AT_ID_RA_HALF_FILLED_RIGHT
+bitmap = pImages[17]
+
+[wxBitmapButton b18]
+id = WXD_AT_ID_RE_WHITE
+bitmap = pImages[18]
+
+[wxBitmapButton b19]
+id = WXD_AT_ID_RE_FILLED
+bitmap = pImages[19]
+
+[wxBitmapButton b20]
+id = WXD_AT_ID_RE_HALF_FILLED_LEFT
+bitmap = pImages[20]
+
+[wxBitmapButton b21]
+id = WXD_AT_ID_RE_HALF_FILLED_RIGHT
+bitmap = pImages[21]
+
+[wxBitmapButton b22]
+id = WXD_AT_ID_RE_STROKE
+bitmap = pImages[22]
+
+[wxBitmapButton b23]
+id = WXD_AT_ID_T_WHITE
+bitmap = pImages[23]
+
+[wxBitmapButton b24]
+id = WXD_AT_ID_T_FILLED
+bitmap = pImages[24]
+
+[wxBitmapButton b25]
+id = WXD_AT_ID_T_HALF_FILLED_LEFT
+bitmap = pImages[25]
+
+[wxBitmapButton b26]
+id = WXD_AT_ID_T_HALF_FILLED_RIGHT
+bitmap = pImages[26]
+
+[wxBitmapButton b27]
+id = WXD_AT_ID_C_WHITE
+bitmap = pImages[27]
+
+[wxBitmapButton b28]
+id = WXD_AT_ID_C_FILLED
+bitmap = pImages[28]
+
+[wxBitmapButton b29]
+id = WXD_AT_ID_T_STROKE
+bitmap = pImages[29]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[252]
+tip = pTexts[253]
+
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+%% class start
+
+/** The arrow type dialog lets the user choose the arrow type.
+*/
+class WxdkdrawDlgArrowType : public wxDialog
+{
+
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Program main window.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Current arrow type in dialog.
+ */
+ uint8_t m_uArrowTypeCurrent;
+
+ /** Original arrow type when opening dialog.
+ */
+ uint8_t m_uArrowTypeOriginal;
+
+ /** Modify backward arrowhead (true) or forward arrowhead (false).
+ */
+ bool m_bBackward;
+
+ /** Modify drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for arrow type buttons.
+ */
+ enum {
+ WXD_AT_ID_NONE = (wxID_HIGHEST + 1), /**< No arrow. */
+ WXD_AT_ID_N_STROKE , /**< Normal, stroked. */
+ WXD_AT_ID_N_WHITE , /**< Normal, white filled. */
+ WXD_AT_ID_N_FILLED , /**< Normal, colour filled. */
+ WXD_AT_ID_N_HALF_FILLED_LEFT , /**< Normal, left half filled. */
+ WXD_AT_ID_N_HALF_FILLED_RIGHT , /**< Normal, right half filled. */
+ WXD_AT_ID_I_WHITE , /**< Indented, white filled. */
+ WXD_AT_ID_I_FILLED , /**< Indented, colour filled. */
+ WXD_AT_ID_I_HALF_FILLED_LEFT , /**< Indented, left half. */
+ WXD_AT_ID_I_HALF_FILLED_RIGHT , /**< Indented, right half. */
+ WXD_AT_ID_B_WHITE , /**< Butted, white filled. */
+ WXD_AT_ID_B_FILLED , /**< Butted, colour filled. */
+ WXD_AT_ID_B_HALF_FILLED_LEFT , /**< Butted, left half. */
+ WXD_AT_ID_B_HALF_FILLED_RIGHT , /**< Butted, right half. */
+ WXD_AT_ID_RA_WHITE , /**< Raute, white filled. */
+ WXD_AT_ID_RA_FILLED , /**< Raute, colour filled. */
+ WXD_AT_ID_RA_HALF_FILLED_LEFT , /**< Raute, left half. */
+ WXD_AT_ID_RA_HALF_FILLED_RIGHT, /**< Raute, right half. */
+ WXD_AT_ID_RE_WHITE , /**< Rectangle, white filled. */
+ WXD_AT_ID_RE_FILLED , /**< Rectangle, colour filled. */
+ WXD_AT_ID_RE_HALF_FILLED_LEFT , /**< Rectangle, left half. */
+ WXD_AT_ID_RE_HALF_FILLED_RIGHT, /**< Rectangle, right half. */
+ WXD_AT_ID_RE_STROKE, /**< Rectangle, stroked. */
+ WXD_AT_ID_T_WHITE , /**< Triangle, white filled. */
+ WXD_AT_ID_T_FILLED , /**< Triangle, colour filled. */
+ WXD_AT_ID_T_HALF_FILLED_LEFT , /**< Triangle, left half. */
+ WXD_AT_ID_T_HALF_FILLED_RIGHT , /**< Triangle, right half. */
+ WXD_AT_ID_C_WHITE , /**< Circle, white filled. */
+ WXD_AT_ID_C_FILLED , /**< Circle, colour filled. */
+ WXD_AT_ID_T_STROKE /**< T stroke over line end. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Modify drawing element (or default style).
+ @param bBackward Modify backward arrow (or forward).
+ */
+ WxdkdrawDlgArrowType(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem,
+ bool bBackward
+ );
+
+ /** Handler for arrow type buttons.
+ @param event Event to process.
+ */
+ void
+ OnArrowType(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+#if 0
+
+ /** Retrieve arrow type.
+ @return Arrow type selected in dialog.
+ */
+ uint8_t
+ GetArrowType(void) const;
+
+#endif
+
+
+%% class end
+};
+
+
+%% header end
+
+%% module start
+
+#ifndef WXDKDRAWDLGARROWTYPE_H_INCLUDED
+#include "WxdkdrawDlgArrowType.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Assign methods to events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgArrowType,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgArrowType,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgArrowType::OnCancel\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_NONE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_STROKE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_N_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_I_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_I_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_I_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_I_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_B_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_B_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_B_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_B_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RA_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RA_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RA_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RA_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_RE_STROKE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_HALF_FILLED_LEFT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_HALF_FILLED_RIGHT,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_C_WHITE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_C_FILLED,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgArrowType::WXD_AT_ID_T_STROKE,\
+ WxdkdrawDlgArrowType::OnArrowType\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+WxdkdrawDlgArrowType::WxdkdrawDlgArrowType(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem,
+ bool bBackward
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[251],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_bBackward = bBackward;
+ m_uArrowTypeOriginal = m_uArrowTypeCurrent =
+ ((bBackward) ? (pObject->abt) : (pObject->aft));
+%% constructor end
+}
+
+%% module end
+
+
+void
+WxdkdrawDlgArrowType::OnArrowType(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+
+ switch (event.GetId()) {
+ case WXD_AT_ID_NONE : {
+ m_uArrowTypeCurrent = 0U;
+ } break;
+ case WXD_AT_ID_N_STROKE : {
+ m_uArrowTypeCurrent = 1U;
+ } break;
+ case WXD_AT_ID_N_WHITE : {
+ m_uArrowTypeCurrent = 2U;
+ } break;
+ case WXD_AT_ID_N_FILLED : {
+ m_uArrowTypeCurrent = 3U;
+ } break;
+ case WXD_AT_ID_N_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 4U;
+ } break;
+ case WXD_AT_ID_N_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 5U;
+ } break;
+ case WXD_AT_ID_I_WHITE : {
+ m_uArrowTypeCurrent = 6U;
+ } break;
+ case WXD_AT_ID_I_FILLED : {
+ m_uArrowTypeCurrent = 7U;
+ } break;
+ case WXD_AT_ID_I_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 8U;
+ } break;
+ case WXD_AT_ID_I_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 9U;
+ } break;
+ case WXD_AT_ID_B_WHITE : {
+ m_uArrowTypeCurrent = 10U;
+ } break;
+ case WXD_AT_ID_B_FILLED : {
+ m_uArrowTypeCurrent = 11U;
+ } break;
+ case WXD_AT_ID_B_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 12U;
+ } break;
+ case WXD_AT_ID_B_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 13U;
+ } break;
+ case WXD_AT_ID_RA_WHITE : {
+ m_uArrowTypeCurrent = 14U;
+ } break;
+ case WXD_AT_ID_RA_FILLED : {
+ m_uArrowTypeCurrent = 15U;
+ } break;
+ case WXD_AT_ID_RA_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 16U;
+ } break;
+ case WXD_AT_ID_RA_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 17U;
+ } break;
+ case WXD_AT_ID_RE_WHITE : {
+ m_uArrowTypeCurrent = 18U;
+ } break;
+ case WXD_AT_ID_RE_FILLED : {
+ m_uArrowTypeCurrent = 19U;
+ } break;
+ case WXD_AT_ID_RE_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 20U;
+ } break;
+ case WXD_AT_ID_RE_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 21U;
+ } break;
+ case WXD_AT_ID_RE_STROKE : {
+ m_uArrowTypeCurrent = 22U;
+ } break;
+ case WXD_AT_ID_T_WHITE : {
+ m_uArrowTypeCurrent = 23U;
+ } break;
+ case WXD_AT_ID_T_FILLED : {
+ m_uArrowTypeCurrent = 24U;
+ } break;
+ case WXD_AT_ID_T_HALF_FILLED_LEFT : {
+ m_uArrowTypeCurrent = 25U;
+ } break;
+ case WXD_AT_ID_T_HALF_FILLED_RIGHT : {
+ m_uArrowTypeCurrent = 26U;
+ } break;
+ case WXD_AT_ID_C_WHITE : {
+ m_uArrowTypeCurrent = 27U;
+ } break;
+ case WXD_AT_ID_C_FILLED : {
+ m_uArrowTypeCurrent = 28U;
+ } break;
+ case WXD_AT_ID_T_STROKE : {
+ m_uArrowTypeCurrent = 29U;
+ } break;
+ }
+ if (m_bBackward) {
+ if ((m_bDrwElem) && (m_uArrowTypeCurrent != m_pObject->abt)) {
+ bDoRefresh = true;
+ }
+ m_pObject->abt = m_uArrowTypeCurrent;
+ }
+ else {
+ if ((m_bDrwElem) && (m_uArrowTypeCurrent != m_pObject->aft)) {
+ bDoRefresh = true;
+ }
+ m_pObject->aft = m_uArrowTypeCurrent;
+ }
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgArrowType::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+#if 0
+
+uint8_t
+WxdkdrawDlgArrowType::GetArrowType(void)
+const
+{
+ return m_uArrowTypeCurrent;
+}
+
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgBoxRadius.cpp b/support/dktools/WxdkdrawDlgBoxRadius.cpp
new file mode 100644
index 0000000000..eebeb880d3
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgBoxRadius.cpp
@@ -0,0 +1,359 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgBoxRadius.wxc
+*/
+
+/** @file WxdkdrawDlgBoxRadius.cpp The WxdkdrawDlgBoxRadius module.
+*/
+
+
+#line 193 "WxdkdrawDlgBoxRadius.wxc"
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgBoxRadius.h"
+#endif
+
+
+
+
+#line 200 "WxdkdrawDlgBoxRadius.wxc"
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgBoxRadius,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgBoxRadius,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgBoxRadius::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgBoxRadius::OnCancel\
+ )
+ EVT_SLIDER(\
+ WxdkdrawDlgBoxRadius::WXD_ID_RADIUS,\
+ WxdkdrawDlgBoxRadius::OnRadius\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 229 "WxdkdrawDlgBoxRadius.wxc"
+
+WxdkdrawDlgBoxRadius::WxdkdrawDlgBoxRadius(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ wxChar const * const *sNlWx,
+ uint32_t uStepLength,
+ int iRangeMax,
+ size_t szUnitIndex
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[574],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+
+
+#line 252 "WxdkdrawDlgBoxRadius.wxc"
+
+
+#line 253 "WxdkdrawDlgBoxRadius.wxc"
+
+
+#line 254 "WxdkdrawDlgBoxRadius.wxc"
+
+
+#line 255 "WxdkdrawDlgBoxRadius.wxc"
+ m_pParent = pParent;
+ m_pControl = pControl;
+ m_pDrw = pDrw;
+ m_pObject = pObject;
+ m_sTexts = pTexts;
+ m_sNlWx = sNlWx;
+ m_uStepLength = uStepLength;
+ m_iRangeMax = iRangeMax;
+
+ m_uOriginalRadius = (pObject->det).b.r;
+ m_dDivisor = ((((size_t)501U) == szUnitIndex) ? (CMWXD) : (RESWXD));
+
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerContents = NULL;
+ sizerButtons = NULL;
+ lRadius = NULL;
+ tRadius = NULL;
+ tUnit = NULL;
+ slRadius = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerContents = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ lRadius = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[502]
+ );
+ if(!(lRadius)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lRadius,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ tRadius = new wxStaticText(
+ this,
+ wxID_ANY,
+ sNlWx[7]
+ );
+ if(!(tRadius)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ tRadius,
+ wxGBPosition(0, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ tUnit = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[szUnitIndex]
+ );
+ if(!(tUnit)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ tUnit,
+ wxGBPosition(0, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ slRadius = new wxSlider(
+ this,
+ WXD_ID_RADIUS,
+ 0,
+ 0,
+ 10
+ );
+ if(!(slRadius)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ slRadius,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 3),
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerContents->AddGrowableCol(1);
+ sizerVertical->Add(
+ sizerContents,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[476]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[478]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[477]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[479]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 268 "WxdkdrawDlgBoxRadius.wxc"
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Retrieve object attributes
+ */
+ slRadius->SetRange(0, iRangeMax);
+ {
+ wxString s;
+ s.Printf(wxT("%g"), ((double)m_uOriginalRadius / m_dDivisor));
+ tRadius->SetLabel(s);
+ }
+ {
+ int v;
+ v = (int)(m_uOriginalRadius / uStepLength);
+ if (
+ (m_uOriginalRadius % uStepLength)
+ >= (uStepLength / (uint32_t)2UL)
+ ) {
+ v++;
+ }
+ slRadius->SetValue(v);
+ }
+ }
+
+
+#line 296 "WxdkdrawDlgBoxRadius.wxc"
+}
+
+
+
+#line 300 "WxdkdrawDlgBoxRadius.wxc"
+
+
+void
+WxdkdrawDlgBoxRadius::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgBoxRadius::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ (m_pObject->det).b.r = m_uOriginalRadius;
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgBoxRadius::OnRadius(wxCommandEvent & WXUNUSED(event))
+{
+ dk4_er_t er;
+ uint32_t r;
+ int v;
+
+
+#line 338 "WxdkdrawDlgBoxRadius.wxc"
+ v = slRadius->GetValue();
+
+#line 339 "WxdkdrawDlgBoxRadius.wxc"
+ dk4error_init(&er);
+ r = dk4ma_uint32_t_mul(m_uStepLength, (uint32_t)v, &er);
+
+
+#line 342 "WxdkdrawDlgBoxRadius.wxc"
+ if (DK4_E_NONE == er.ec) {
+ (m_pObject->det).b.r = r;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_pControl->Refresh();
+ m_pParent->Update();
+ {
+ wxString s;
+ s.Printf(wxT("%g"), ((double)r / m_dDivisor));
+ tRadius->SetLabel(s);
+ }
+ Refresh();
+ Update();
+ }
+ else {
+ /* ERROR: Overflow */
+ wxMessageBox(
+ m_sTexts[504], m_sTexts[503], (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+
+
+#line 362 "WxdkdrawDlgBoxRadius.wxc"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgBoxRadius.h b/support/dktools/WxdkdrawDlgBoxRadius.h
new file mode 100644
index 0000000000..e5de280604
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgBoxRadius.h
@@ -0,0 +1,206 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgBoxRadius.wxc
+*/
+
+/** @file WxdkdrawDlgBoxRadius.h Header file for the WxdkdrawDlgBoxRadius module.
+*/
+
+#ifndef WXDKDRAWDLGBOXRADIUS_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGBOXRADIUS_H_INCLUDED 1
+
+
+#line 67 "WxdkdrawDlgBoxRadius.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+#line 77 "WxdkdrawDlgBoxRadius.wxc"
+
+
+/** The box radius dialog lets the user choose the box radius using a slider.
+*/
+class WxdkdrawDlgBoxRadius : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 11 "WxdkdrawDlgBoxRadius.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 17 "WxdkdrawDlgBoxRadius.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerContents.
+ */
+#line 25 "WxdkdrawDlgBoxRadius.wxc"
+ wxGridBagSizer *sizerContents;
+
+ /** GUI element sizerButtons.
+ */
+#line 50 "WxdkdrawDlgBoxRadius.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element lRadius.
+ */
+#line 34 "WxdkdrawDlgBoxRadius.wxc"
+ wxStaticText *lRadius;
+
+ /** GUI element tRadius.
+ */
+#line 37 "WxdkdrawDlgBoxRadius.wxc"
+ wxStaticText *tRadius;
+
+ /** GUI element tUnit.
+ */
+#line 40 "WxdkdrawDlgBoxRadius.wxc"
+ wxStaticText *tUnit;
+
+ /** GUI element slRadius.
+ */
+#line 43 "WxdkdrawDlgBoxRadius.wxc"
+ wxSlider *slRadius;
+
+ /** GUI element buttonOK.
+ */
+#line 55 "WxdkdrawDlgBoxRadius.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 60 "WxdkdrawDlgBoxRadius.wxc"
+ wxButton *buttonCancel;
+
+
+#line 94 "WxdkdrawDlgBoxRadius.wxc"
+
+ protected:
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing control to refresh on changes.
+ */
+ wxControl *m_pControl;
+
+ /** Entire drawing.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ /** Not localized text fragments.
+ */
+ wxChar const * const *m_sNlWx;
+
+ /** Divisor to calculate inches or cm.
+ */
+ double m_dDivisor;
+
+ /** Original diameter.
+ */
+ uint32_t m_uOriginalRadius;
+
+ /** Step length.
+ */
+ uint32_t m_uStepLength;
+
+ /** Maximum number of steps.
+ */
+ int m_iRangeMax;
+
+ public:
+
+ /** Slider control events.
+ */
+ enum {
+ WXD_ID_RADIUS = (wxID_HIGHEST + 1) /**< Diameter changed. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (programs main window).
+ @param pControl Drawing control to refresh on changes.
+ @param pDrw Drawing.
+ @param pObject Box object to change radius for.
+ @param pTexts Localized text fragments.
+ @param sNlWx Non-localized text fragments.
+ @param uStepLength Slider step size.
+ @param iRangeMax Range maximum for slider (minimum is 0).
+ @param szUnitIndex Unit name index in pTexts.
+ */
+ WxdkdrawDlgBoxRadius(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ wxChar const * const *sNlWx,
+ uint32_t uStepLength,
+ int iRangeMax,
+ size_t szUnitIndex
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Slider event handler.
+ @param event Event to process.
+ */
+ void
+ OnRadius(wxCommandEvent & event);
+
+};
+
+
+
+#line 190 "WxdkdrawDlgBoxRadius.wxc"
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgBoxRadius.wxc b/support/dktools/WxdkdrawDlgBoxRadius.wxc
new file mode 100644
index 0000000000..f10b033b8f
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgBoxRadius.wxc
@@ -0,0 +1,367 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2020-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerContents centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxGridBagSizer sizerContents]
+grid = 5 5
+grow = yes
+contents = lRadius 0 0 1 1 left centered-y
+contents = tRadius . +1 1 1 left centered-y
+contents = tUnit . +1 1 1 left centered-y
+contents = slRadius +1 0 1 3 centered-x
+growable column = 1
+
+[wxStaticText lRadius]
+text = pTexts[502]
+
+[wxStaticText tRadius]
+text = sNlWx[7]
+
+[wxStaticText tUnit]
+text = pTexts[szUnitIndex]
+
+[wxSlider slRadius]
+id = WXD_ID_RADIUS
+range = 0 10
+value = 0
+direction = horizontal
+grow = yes
+
+[wxStdDialogButtonSizer sizerButtons]
+grow = yes
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[476]
+tip = pTexts[478]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[477]
+tip = pTexts[479]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+%% class start
+
+
+/** The box radius dialog lets the user choose the box radius using a slider.
+*/
+class WxdkdrawDlgBoxRadius : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+%% class end
+
+ protected:
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing control to refresh on changes.
+ */
+ wxControl *m_pControl;
+
+ /** Entire drawing.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ /** Not localized text fragments.
+ */
+ wxChar const * const *m_sNlWx;
+
+ /** Divisor to calculate inches or cm.
+ */
+ double m_dDivisor;
+
+ /** Original diameter.
+ */
+ uint32_t m_uOriginalRadius;
+
+ /** Step length.
+ */
+ uint32_t m_uStepLength;
+
+ /** Maximum number of steps.
+ */
+ int m_iRangeMax;
+
+ public:
+
+ /** Slider control events.
+ */
+ enum {
+ WXD_ID_RADIUS = (wxID_HIGHEST + 1) /**< Diameter changed. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (programs main window).
+ @param pControl Drawing control to refresh on changes.
+ @param pDrw Drawing.
+ @param pObject Box object to change radius for.
+ @param pTexts Localized text fragments.
+ @param sNlWx Non-localized text fragments.
+ @param uStepLength Slider step size.
+ @param iRangeMax Range maximum for slider (minimum is 0).
+ @param szUnitIndex Unit name index in pTexts.
+ */
+ WxdkdrawDlgBoxRadius(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ wxChar const * const *sNlWx,
+ uint32_t uStepLength,
+ int iRangeMax,
+ size_t szUnitIndex
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Slider event handler.
+ @param event Event to process.
+ */
+ void
+ OnRadius(wxCommandEvent & event);
+
+};
+
+
+%% header end
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgBoxRadius.h"
+#endif
+
+
+$!trace-include
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgBoxRadius,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgBoxRadius,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgBoxRadius::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgBoxRadius::OnCancel\
+ )
+ EVT_SLIDER(\
+ WxdkdrawDlgBoxRadius::WXD_ID_RADIUS,\
+ WxdkdrawDlgBoxRadius::OnRadius\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+
+WxdkdrawDlgBoxRadius::WxdkdrawDlgBoxRadius(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ wxChar const * const *sNlWx,
+ uint32_t uStepLength,
+ int iRangeMax,
+ size_t szUnitIndex
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[574],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ $? "+ WxdkdrawDlgBoxRadius"
+ $? ". uStepLength = %lu", (unsigned long)uStepLength
+ $? ". iRangeMax = %d", iRangeMax
+ $? ". szUnitIndex = %u", (unsigned)szUnitIndex
+ m_pParent = pParent;
+ m_pControl = pControl;
+ m_pDrw = pDrw;
+ m_pObject = pObject;
+ m_sTexts = pTexts;
+ m_sNlWx = sNlWx;
+ m_uStepLength = uStepLength;
+ m_iRangeMax = iRangeMax;
+
+ m_uOriginalRadius = (pObject->det).b.r;
+ m_dDivisor = ((((size_t)501U) == szUnitIndex) ? (CMWXD) : (RESWXD));
+
+%% constructor end
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Retrieve object attributes
+ */
+ slRadius->SetRange(0, iRangeMax);
+ {
+ wxString s;
+ s.Printf(wxT("%g"), ((double)m_uOriginalRadius / m_dDivisor));
+ tRadius->SetLabel(s);
+ }
+ {
+ int v;
+ v = (int)(m_uOriginalRadius / uStepLength);
+ if (
+ (m_uOriginalRadius % uStepLength)
+ >= (uStepLength / (uint32_t)2UL)
+ ) {
+ v++;
+ }
+ slRadius->SetValue(v);
+ }
+ }
+ $? "- WxdkdrawDlgBoxRadius"
+}
+
+
+%% module end
+
+
+void
+WxdkdrawDlgBoxRadius::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgBoxRadius::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ (m_pObject->det).b.r = m_uOriginalRadius;
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgBoxRadius::OnRadius(wxCommandEvent & WXUNUSED(event))
+{
+ dk4_er_t er;
+ uint32_t r;
+ int v;
+ $? "+ OnRadius"
+ v = slRadius->GetValue(); $? ". v = %d", v
+ dk4error_init(&er);
+ r = dk4ma_uint32_t_mul(m_uStepLength, (uint32_t)v, &er);
+ $? ". r = %lu", (unsigned long)r
+ if (DK4_E_NONE == er.ec) {
+ (m_pObject->det).b.r = r;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_pControl->Refresh();
+ m_pParent->Update();
+ {
+ wxString s;
+ s.Printf(wxT("%g"), ((double)r / m_dDivisor));
+ tRadius->SetLabel(s);
+ }
+ Refresh();
+ Update();
+ }
+ else {
+ /* ERROR: Overflow */
+ wxMessageBox(
+ m_sTexts[504], m_sTexts[503], (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ $? "- OnRadius"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgDotFilled.cpp b/support/dktools/WxdkdrawDlgDotFilled.cpp
new file mode 100644
index 0000000000..4cfb580a9b
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgDotFilled.cpp
@@ -0,0 +1,362 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgDotFilled.wxc
+*/
+
+/** @file WxdkdrawDlgDotFilled.cpp The WxdkdrawDlgDotFilled module.
+*/
+
+
+#line 181 "WxdkdrawDlgDotFilled.wxc"
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgDotFilled.h"
+#endif
+
+
+
+
+#line 188 "WxdkdrawDlgDotFilled.wxc"
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgDotFilled,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgDotFilled,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgDotFilled::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgDotFilled::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgDotFilled::WXD_ID_DIAMETER,\
+ WxdkdrawDlgDotFilled::OnDiameter\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgDotFilled::WXD_ID_LINEWIDTH,\
+ WxdkdrawDlgDotFilled::OnLinewidth\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 221 "WxdkdrawDlgDotFilled.wxc"
+
+WxdkdrawDlgDotFilled::WxdkdrawDlgDotFilled(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[494],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pControl = pControl;
+ m_pDrw = pDrw;
+ m_pObject = pObject;
+ m_sTexts = pTexts;
+
+ m_uOriginalDiameter = (pObject->det).d.d;
+ m_uOriginalLinewidth = pObject->lw;
+
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerContents = NULL;
+ sizerButtons = NULL;
+ lDiameter = NULL;
+ spDiameter = NULL;
+ lLinewidth = NULL;
+ spLinewidth = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerContents = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ lDiameter = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[495]
+ );
+ if(!(lDiameter)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lDiameter,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spDiameter = new wxSpinCtrl(
+ this,
+ WXD_ID_DIAMETER,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 8
+ );
+ if(!(spDiameter)) {
+ goto dkctGUILayoutFinished;
+ }
+ spDiameter->SetToolTip(pTexts[496]);
+ sizerContents->Add(
+ spDiameter,
+ wxGBPosition(0, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lLinewidth = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[497]
+ );
+ if(!(lLinewidth)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lLinewidth,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spLinewidth = new wxSpinCtrl(
+ this,
+ WXD_ID_LINEWIDTH,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 2
+ );
+ if(!(spLinewidth)) {
+ goto dkctGUILayoutFinished;
+ }
+ spLinewidth->SetToolTip(pTexts[498]);
+ sizerContents->Add(
+ spLinewidth,
+ wxGBPosition(1, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerContents,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[476]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[478]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[477]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[479]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 249 "WxdkdrawDlgDotFilled.wxc"
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Retrieve object attributes
+ */
+ spDiameter->SetValue( (int)((pObject->det).d.d) );
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ if ((uint16_t)1U < (pObject->det).d.d) {
+ spLinewidth->SetRange(1, ((int)((pObject->det).d.d) - 1));
+ }
+ else {
+ spLinewidth->SetRange(1, (int)((pObject->det).d.d) );
+ }
+ spLinewidth->SetValue(pObject->lw);
+ }
+ else {
+ spLinewidth->Enable(false);
+ }
+ }
+}
+
+
+
+#line 276 "WxdkdrawDlgDotFilled.wxc"
+
+
+void
+WxdkdrawDlgDotFilled::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ (m_pObject->det).d.d = (uint16_t)(spDiameter->GetValue());
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ m_pObject->lw = (uint16_t)(spLinewidth->GetValue());
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgDotFilled::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ (m_pObject->det).d.d = m_uOriginalDiameter;
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ m_pObject->lw = m_uOriginalLinewidth;
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgDotFilled::OnDiameter(wxSpinEvent & WXUNUSED(event))
+{
+ int diameter;
+ int lw;
+ int maxlw;
+ bool bUpdateDrawing = false;
+ bool bUpdateDialog = false;
+
+ diameter = spDiameter->GetValue();
+ if ((uint16_t)diameter != (m_pObject->det).d.d) {
+ (m_pObject->det).d.d = diameter;
+ bUpdateDrawing = true;
+ }
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ maxlw = ((1 < diameter) ? (diameter - 1) : (diameter));
+ spLinewidth->SetRange(1, maxlw);
+ bUpdateDialog = true;
+ lw = spLinewidth->GetValue();
+ if (lw > maxlw) {
+ spLinewidth->SetValue(maxlw);
+ m_pObject->lw = (uint16_t)maxlw;
+ }
+ }
+ if (bUpdateDrawing) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_pControl->Refresh();
+ m_pParent->Update();
+ }
+ if (bUpdateDialog) {
+ spLinewidth->Refresh();
+ Update();
+ }
+}
+
+
+
+void
+WxdkdrawDlgDotFilled::OnLinewidth(wxSpinEvent & WXUNUSED(event))
+{
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ m_pObject->lw = spLinewidth->GetValue();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_pControl->Refresh();
+ m_pParent->Update();
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgDotFilled.h b/support/dktools/WxdkdrawDlgDotFilled.h
new file mode 100644
index 0000000000..4a598bec5a
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgDotFilled.h
@@ -0,0 +1,192 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgDotFilled.wxc
+*/
+
+/** @file WxdkdrawDlgDotFilled.h Header file for the WxdkdrawDlgDotFilled module.
+*/
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGDOTFILLED_H_INCLUDED 1
+
+
+#line 69 "WxdkdrawDlgDotFilled.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+#line 79 "WxdkdrawDlgDotFilled.wxc"
+
+/** Dialog to change dot details.
+*/
+class WxdkdrawDlgDotFilled : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 11 "WxdkdrawDlgDotFilled.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 17 "WxdkdrawDlgDotFilled.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerContents.
+ */
+#line 25 "WxdkdrawDlgDotFilled.wxc"
+ wxGridBagSizer *sizerContents;
+
+ /** GUI element sizerButtons.
+ */
+#line 52 "WxdkdrawDlgDotFilled.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element lDiameter.
+ */
+#line 33 "WxdkdrawDlgDotFilled.wxc"
+ wxStaticText *lDiameter;
+
+ /** GUI element spDiameter.
+ */
+#line 36 "WxdkdrawDlgDotFilled.wxc"
+ wxSpinCtrl *spDiameter;
+
+ /** GUI element lLinewidth.
+ */
+#line 42 "WxdkdrawDlgDotFilled.wxc"
+ wxStaticText *lLinewidth;
+
+ /** GUI element spLinewidth.
+ */
+#line 45 "WxdkdrawDlgDotFilled.wxc"
+ wxSpinCtrl *spLinewidth;
+
+ /** GUI element buttonOK.
+ */
+#line 57 "WxdkdrawDlgDotFilled.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 62 "WxdkdrawDlgDotFilled.wxc"
+ wxButton *buttonCancel;
+
+
+#line 95 "WxdkdrawDlgDotFilled.wxc"
+
+ protected:
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing control to refresh on changes.
+ */
+ wxControl *m_pControl;
+
+ /** Entire drawing.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ /** Original diameter.
+ */
+ uint16_t m_uOriginalDiameter;
+
+ /** Original line width.
+ */
+ uint16_t m_uOriginalLinewidth;
+
+ public:
+
+ /** Spin contrl events.
+ */
+ enum {
+ WXD_ID_DIAMETER = (wxID_HIGHEST + 1), /**< Diameter changed. */
+ WXD_ID_LINEWIDTH /**< Line width changed. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (programs main window).
+ @param pControl Control to refresh on changes.
+ @param pDrw Drawing.
+ @param pObject Dot object to modify.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgDotFilled(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Diameter spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnDiameter(wxSpinEvent & event);
+
+ /** Line width spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnLinewidth(wxSpinEvent & event);
+
+};
+
+
+
+#line 178 "WxdkdrawDlgDotFilled.wxc"
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgDotFilled.wxc b/support/dktools/WxdkdrawDlgDotFilled.wxc
new file mode 100644
index 0000000000..524514b9ff
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgDotFilled.wxc
@@ -0,0 +1,365 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2020-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerContents centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxGridBagSizer sizerContents]
+grid = 5 5
+grow = yes
+contents = lDiameter 0 0 1 1 right centered-y
+contents = spDiameter . +1 1 1 left centered-y
+contents = lLinewidth +1 0 1 1 right centered-y
+contents = spLinewidth . +1 1 1 left centered-y
+
+[wxStaticText lDiameter]
+text = pTexts[495]
+
+[wxSpinCtrl spDiameter]
+id = WXD_ID_DIAMETER
+range = 1 65535
+value = 8
+tip = pTexts[496]
+
+[wxStaticText lLinewidth]
+text = pTexts[497]
+
+[wxSpinCtrl spLinewidth]
+id = WXD_ID_LINEWIDTH
+range = 1 65535
+value = 2
+tip = pTexts[498]
+
+
+[wxStdDialogButtonSizer sizerButtons]
+grow = yes
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[476]
+tip = pTexts[478]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[477]
+tip = pTexts[479]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+%% class start
+
+/** Dialog to change dot details.
+*/
+class WxdkdrawDlgDotFilled : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+%% class end
+
+ protected:
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing control to refresh on changes.
+ */
+ wxControl *m_pControl;
+
+ /** Entire drawing.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ /** Original diameter.
+ */
+ uint16_t m_uOriginalDiameter;
+
+ /** Original line width.
+ */
+ uint16_t m_uOriginalLinewidth;
+
+ public:
+
+ /** Spin contrl events.
+ */
+ enum {
+ WXD_ID_DIAMETER = (wxID_HIGHEST + 1), /**< Diameter changed. */
+ WXD_ID_LINEWIDTH /**< Line width changed. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (programs main window).
+ @param pControl Control to refresh on changes.
+ @param pDrw Drawing.
+ @param pObject Dot object to modify.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgDotFilled(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Diameter spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnDiameter(wxSpinEvent & event);
+
+ /** Line width spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnLinewidth(wxSpinEvent & event);
+
+};
+
+
+%% header end
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgDotFilled.h"
+#endif
+
+
+$!trace-include
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgDotFilled,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgDotFilled,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgDotFilled::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgDotFilled::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgDotFilled::WXD_ID_DIAMETER,\
+ WxdkdrawDlgDotFilled::OnDiameter\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgDotFilled::WXD_ID_LINEWIDTH,\
+ WxdkdrawDlgDotFilled::OnLinewidth\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+
+WxdkdrawDlgDotFilled::WxdkdrawDlgDotFilled(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[494],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pControl = pControl;
+ m_pDrw = pDrw;
+ m_pObject = pObject;
+ m_sTexts = pTexts;
+
+ m_uOriginalDiameter = (pObject->det).d.d;
+ m_uOriginalLinewidth = pObject->lw;
+
+%% constructor end
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Retrieve object attributes
+ */
+ spDiameter->SetValue( (int)((pObject->det).d.d) );
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ if ((uint16_t)1U < (pObject->det).d.d) {
+ spLinewidth->SetRange(1, ((int)((pObject->det).d.d) - 1));
+ }
+ else {
+ spLinewidth->SetRange(1, (int)((pObject->det).d.d) );
+ }
+ spLinewidth->SetValue(pObject->lw);
+ }
+ else {
+ spLinewidth->Enable(false);
+ }
+ }
+}
+
+
+%% module end
+
+
+void
+WxdkdrawDlgDotFilled::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ (m_pObject->det).d.d = (uint16_t)(spDiameter->GetValue());
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ m_pObject->lw = (uint16_t)(spLinewidth->GetValue());
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgDotFilled::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ (m_pObject->det).d.d = m_uOriginalDiameter;
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ m_pObject->lw = m_uOriginalLinewidth;
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgDotFilled::OnDiameter(wxSpinEvent & WXUNUSED(event))
+{
+ int diameter;
+ int lw;
+ int maxlw;
+ bool bUpdateDrawing = false;
+ bool bUpdateDialog = false;
+
+ diameter = spDiameter->GetValue();
+ if ((uint16_t)diameter != (m_pObject->det).d.d) {
+ (m_pObject->det).d.d = diameter;
+ bUpdateDrawing = true;
+ }
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ maxlw = ((1 < diameter) ? (diameter - 1) : (diameter));
+ spLinewidth->SetRange(1, maxlw);
+ bUpdateDialog = true;
+ lw = spLinewidth->GetValue();
+ if (lw > maxlw) {
+ spLinewidth->SetValue(maxlw);
+ m_pObject->lw = (uint16_t)maxlw;
+ }
+ }
+ if (bUpdateDrawing) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_pControl->Refresh();
+ m_pParent->Update();
+ }
+ if (bUpdateDialog) {
+ spLinewidth->Refresh();
+ Update();
+ }
+}
+
+
+
+void
+WxdkdrawDlgDotFilled::OnLinewidth(wxSpinEvent & WXUNUSED(event))
+{
+ if (WXD_OT_DOT_WHITE == m_pObject->ot) {
+ m_pObject->lw = spLinewidth->GetValue();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_pControl->Refresh();
+ m_pParent->Update();
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgFillStyle.cpp b/support/dktools/WxdkdrawDlgFillStyle.cpp
new file mode 100644
index 0000000000..861e7f9a5f
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgFillStyle.cpp
@@ -0,0 +1,687 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgFillStyle.wxc
+*/
+
+/** @file WxdkdrawDlgFillStyle.cpp The WxdkdrawDlgFillStyle module.
+*/
+
+
+#line 293 "WxdkdrawDlgFillStyle.wxc"
+
+#ifndef WXDKDRAWDLGFILLSTYLE_H_INCLUDED
+#include "WxdkdrawDlgFillStyle.h"
+#endif
+
+
+
+
+
+#line 301 "WxdkdrawDlgFillStyle.wxc"
+
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgFillStyle,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgFillStyle,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgFillStyle::OnCancel\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_NONE,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_PURE,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_LEFT_DIAG_30,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_RIGHT_DIAG_30,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SIEVE_30,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_LEFT_DIAG_45,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_RIGHT_DIAG_45,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SIEVE_45,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_BRICKS_HOR,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_BRICKS_VER,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_LINES_HOR,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_LINES_VER,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SIEVE_HOR_VER,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SHINGLES_HOR_1,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SHINGLES_HOR_2,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SHINGLES_VER_1,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SHINGLES_VER_2,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_FISH_SCALES_L,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_FISH_SCALES_S,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_CIRCLES,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_HEXAGONS,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_OCTAGONS,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_TIRES_HOR,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_TIRES_VER,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 418 "WxdkdrawDlgFillStyle.wxc"
+
+WxdkdrawDlgFillStyle::WxdkdrawDlgFillStyle(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[263],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_uFillStyleOriginal = m_uFillStyleCurrent = pObject->fs;
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerContents = NULL;
+ buttonCancel = NULL;
+ b00 = NULL;
+ b01 = NULL;
+ b02 = NULL;
+ b03 = NULL;
+ b04 = NULL;
+ b05 = NULL;
+ b06 = NULL;
+ b07 = NULL;
+ b08 = NULL;
+ b09 = NULL;
+ b10 = NULL;
+ b11 = NULL;
+ b12 = NULL;
+ b13 = NULL;
+ b14 = NULL;
+ b15 = NULL;
+ b16 = NULL;
+ b17 = NULL;
+ b18 = NULL;
+ b19 = NULL;
+ b20 = NULL;
+ b21 = NULL;
+ b22 = NULL;
+ b23 = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerContents = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_NONE,
+ pImages[0]
+ );
+ if(!(b00)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00->SetToolTip(pTexts[264]);
+ sizerContents->Add(
+ b00,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b01 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_PURE,
+ pImages[1]
+ );
+ if(!(b01)) {
+ goto dkctGUILayoutFinished;
+ }
+ b01->SetToolTip(pTexts[265]);
+ sizerContents->Add(
+ b01,
+ wxGBPosition(0, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b02 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_LEFT_DIAG_30,
+ pImages[2]
+ );
+ if(!(b02)) {
+ goto dkctGUILayoutFinished;
+ }
+ b02->SetToolTip(pTexts[266]);
+ sizerContents->Add(
+ b02,
+ wxGBPosition(0, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b03 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_RIGHT_DIAG_30,
+ pImages[3]
+ );
+ if(!(b03)) {
+ goto dkctGUILayoutFinished;
+ }
+ b03->SetToolTip(pTexts[267]);
+ sizerContents->Add(
+ b03,
+ wxGBPosition(0, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b04 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_SIEVE_30,
+ pImages[4]
+ );
+ if(!(b04)) {
+ goto dkctGUILayoutFinished;
+ }
+ b04->SetToolTip(pTexts[268]);
+ sizerContents->Add(
+ b04,
+ wxGBPosition(0, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b05 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_LEFT_DIAG_45,
+ pImages[5]
+ );
+ if(!(b05)) {
+ goto dkctGUILayoutFinished;
+ }
+ b05->SetToolTip(pTexts[269]);
+ sizerContents->Add(
+ b05,
+ wxGBPosition(0, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b06 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_RIGHT_DIAG_45,
+ pImages[6]
+ );
+ if(!(b06)) {
+ goto dkctGUILayoutFinished;
+ }
+ b06->SetToolTip(pTexts[270]);
+ sizerContents->Add(
+ b06,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b07 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_SIEVE_45,
+ pImages[7]
+ );
+ if(!(b07)) {
+ goto dkctGUILayoutFinished;
+ }
+ b07->SetToolTip(pTexts[271]);
+ sizerContents->Add(
+ b07,
+ wxGBPosition(1, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b08 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_BRICKS_HOR,
+ pImages[8]
+ );
+ if(!(b08)) {
+ goto dkctGUILayoutFinished;
+ }
+ b08->SetToolTip(pTexts[272]);
+ sizerContents->Add(
+ b08,
+ wxGBPosition(1, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b09 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_BRICKS_VER,
+ pImages[9]
+ );
+ if(!(b09)) {
+ goto dkctGUILayoutFinished;
+ }
+ b09->SetToolTip(pTexts[273]);
+ sizerContents->Add(
+ b09,
+ wxGBPosition(1, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b10 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_LINES_HOR,
+ pImages[10]
+ );
+ if(!(b10)) {
+ goto dkctGUILayoutFinished;
+ }
+ b10->SetToolTip(pTexts[274]);
+ sizerContents->Add(
+ b10,
+ wxGBPosition(1, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b11 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_LINES_VER,
+ pImages[11]
+ );
+ if(!(b11)) {
+ goto dkctGUILayoutFinished;
+ }
+ b11->SetToolTip(pTexts[275]);
+ sizerContents->Add(
+ b11,
+ wxGBPosition(1, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b12 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_SIEVE_HOR_VER,
+ pImages[12]
+ );
+ if(!(b12)) {
+ goto dkctGUILayoutFinished;
+ }
+ b12->SetToolTip(pTexts[276]);
+ sizerContents->Add(
+ b12,
+ wxGBPosition(2, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b13 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_SHINGLES_HOR_1,
+ pImages[13]
+ );
+ if(!(b13)) {
+ goto dkctGUILayoutFinished;
+ }
+ b13->SetToolTip(pTexts[277]);
+ sizerContents->Add(
+ b13,
+ wxGBPosition(2, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b14 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_SHINGLES_HOR_2,
+ pImages[14]
+ );
+ if(!(b14)) {
+ goto dkctGUILayoutFinished;
+ }
+ b14->SetToolTip(pTexts[278]);
+ sizerContents->Add(
+ b14,
+ wxGBPosition(2, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b15 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_SHINGLES_VER_1,
+ pImages[15]
+ );
+ if(!(b15)) {
+ goto dkctGUILayoutFinished;
+ }
+ b15->SetToolTip(pTexts[279]);
+ sizerContents->Add(
+ b15,
+ wxGBPosition(2, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b16 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_SHINGLES_VER_2,
+ pImages[16]
+ );
+ if(!(b16)) {
+ goto dkctGUILayoutFinished;
+ }
+ b16->SetToolTip(pTexts[280]);
+ sizerContents->Add(
+ b16,
+ wxGBPosition(2, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b17 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_FISH_SCALES_L,
+ pImages[17]
+ );
+ if(!(b17)) {
+ goto dkctGUILayoutFinished;
+ }
+ b17->SetToolTip(pTexts[281]);
+ sizerContents->Add(
+ b17,
+ wxGBPosition(2, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b18 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_FISH_SCALES_S,
+ pImages[18]
+ );
+ if(!(b18)) {
+ goto dkctGUILayoutFinished;
+ }
+ b18->SetToolTip(pTexts[282]);
+ sizerContents->Add(
+ b18,
+ wxGBPosition(3, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b19 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_CIRCLES,
+ pImages[19]
+ );
+ if(!(b19)) {
+ goto dkctGUILayoutFinished;
+ }
+ b19->SetToolTip(pTexts[283]);
+ sizerContents->Add(
+ b19,
+ wxGBPosition(3, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b20 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_HEXAGONS,
+ pImages[20]
+ );
+ if(!(b20)) {
+ goto dkctGUILayoutFinished;
+ }
+ b20->SetToolTip(pTexts[284]);
+ sizerContents->Add(
+ b20,
+ wxGBPosition(3, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b21 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_OCTAGONS,
+ pImages[21]
+ );
+ if(!(b21)) {
+ goto dkctGUILayoutFinished;
+ }
+ b21->SetToolTip(pTexts[285]);
+ sizerContents->Add(
+ b21,
+ wxGBPosition(3, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b22 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_TIRES_HOR,
+ pImages[22]
+ );
+ if(!(b22)) {
+ goto dkctGUILayoutFinished;
+ }
+ b22->SetToolTip(pTexts[286]);
+ sizerContents->Add(
+ b22,
+ wxGBPosition(3, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ b23 = new wxBitmapButton(
+ this,
+ WXD_ID_FS_TIRES_VER,
+ pImages[23]
+ );
+ if(!(b23)) {
+ goto dkctGUILayoutFinished;
+ }
+ b23->SetToolTip(pTexts[287]);
+ sizerContents->Add(
+ b23,
+ wxGBPosition(3, 5),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerContents,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[288]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[289]);
+ sizerVertical->Add(
+ buttonCancel,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 441 "WxdkdrawDlgFillStyle.wxc"
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+
+#line 449 "WxdkdrawDlgFillStyle.wxc"
+
+
+void
+WxdkdrawDlgFillStyle::OnFillStyle(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+
+ switch (event.GetId()) {
+ case WXD_ID_FS_NONE : { m_uFillStyleCurrent = 0; } break;
+ case WXD_ID_FS_PURE : { m_uFillStyleCurrent = 1; } break;
+ case WXD_ID_FS_LEFT_DIAG_30 : { m_uFillStyleCurrent = 2; } break;
+ case WXD_ID_FS_RIGHT_DIAG_30 : { m_uFillStyleCurrent = 3; } break;
+ case WXD_ID_FS_SIEVE_30 : { m_uFillStyleCurrent = 4; } break;
+ case WXD_ID_FS_LEFT_DIAG_45 : { m_uFillStyleCurrent = 5; } break;
+ case WXD_ID_FS_RIGHT_DIAG_45 : { m_uFillStyleCurrent = 6; } break;
+ case WXD_ID_FS_SIEVE_45 : { m_uFillStyleCurrent = 7; } break;
+ case WXD_ID_FS_BRICKS_HOR : { m_uFillStyleCurrent = 8; } break;
+ case WXD_ID_FS_BRICKS_VER : { m_uFillStyleCurrent = 9; } break;
+ case WXD_ID_FS_LINES_HOR : { m_uFillStyleCurrent = 10; } break;
+ case WXD_ID_FS_LINES_VER : { m_uFillStyleCurrent = 11; } break;
+ case WXD_ID_FS_SIEVE_HOR_VER : { m_uFillStyleCurrent = 12; } break;
+ case WXD_ID_FS_SHINGLES_HOR_1 : { m_uFillStyleCurrent = 13; } break;
+ case WXD_ID_FS_SHINGLES_HOR_2 : { m_uFillStyleCurrent = 14; } break;
+ case WXD_ID_FS_SHINGLES_VER_1 : { m_uFillStyleCurrent = 15; } break;
+ case WXD_ID_FS_SHINGLES_VER_2 : { m_uFillStyleCurrent = 16; } break;
+ case WXD_ID_FS_FISH_SCALES_L : { m_uFillStyleCurrent = 17; } break;
+ case WXD_ID_FS_FISH_SCALES_S : { m_uFillStyleCurrent = 18; } break;
+ case WXD_ID_FS_CIRCLES : { m_uFillStyleCurrent = 19; } break;
+ case WXD_ID_FS_HEXAGONS : { m_uFillStyleCurrent = 20; } break;
+ case WXD_ID_FS_OCTAGONS : { m_uFillStyleCurrent = 21; } break;
+ case WXD_ID_FS_TIRES_HOR : { m_uFillStyleCurrent = 22; } break;
+ case WXD_ID_FS_TIRES_VER : { m_uFillStyleCurrent = 23; } break;
+ }
+ if ((m_bDrwElem) && (m_uFillStyleCurrent != m_pObject->fs)) {
+ bDoRefresh = true;
+ }
+ m_pObject->fs = m_uFillStyleCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgFillStyle::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgFillStyle.h b/support/dktools/WxdkdrawDlgFillStyle.h
new file mode 100644
index 0000000000..08911c69d7
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgFillStyle.h
@@ -0,0 +1,284 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgFillStyle.wxc
+*/
+
+/** @file WxdkdrawDlgFillStyle.h Header file for the WxdkdrawDlgFillStyle module.
+*/
+
+#ifndef WXDKDRAWDLGFILLSTYLE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGFILLSTYLE_H_INCLUDED 1
+
+
+#line 179 "WxdkdrawDlgFillStyle.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+#line 189 "WxdkdrawDlgFillStyle.wxc"
+
+/** Dialog to modify fill style.
+*/
+class WxdkdrawDlgFillStyle : public wxDialog
+{
+
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+ protected:
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Selected fill style.
+ */
+ uint8_t m_uFillStyleCurrent;
+
+ /** Original fill style when starting dialog.
+ */
+ uint8_t m_uFillStyleOriginal;
+
+ /** Is drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for buttons.
+ */
+ enum {
+ WXD_ID_FS_NONE = (wxID_HIGHEST + 1), /**< No fill. */
+ WXD_ID_FS_PURE , /**< Pure colour fill. */
+ WXD_ID_FS_LEFT_DIAG_30 , /**< 30 degree diagonal left lines. */
+ WXD_ID_FS_RIGHT_DIAG_30 , /**< 30 degree diagonal right lines. */
+ WXD_ID_FS_SIEVE_30 , /**< 30 degree diagonal sieve. */
+ WXD_ID_FS_LEFT_DIAG_45 , /**< 45 degree diagonal left lines. */
+ WXD_ID_FS_RIGHT_DIAG_45 , /**< 45 degree diagonal right lines. */
+ WXD_ID_FS_SIEVE_45 , /**< 45 degree diagonal sieve. */
+ WXD_ID_FS_BRICKS_HOR , /**< Horizontal bricks. */
+ WXD_ID_FS_BRICKS_VER , /**< Vertical bricks. */
+ WXD_ID_FS_LINES_HOR , /**< Horizontal lines. */
+ WXD_ID_FS_LINES_VER , /**< Vertical lines. */
+ WXD_ID_FS_SIEVE_HOR_VER , /**< Horizontal-vertical sieve. */
+ WXD_ID_FS_SHINGLES_HOR_1 , /**< Horizontal shingles 1. */
+ WXD_ID_FS_SHINGLES_HOR_2 , /**< Horizontal shingles 2. */
+ WXD_ID_FS_SHINGLES_VER_1 , /**< Vertical shingles 1. */
+ WXD_ID_FS_SHINGLES_VER_2 , /**< Vertical shingles 2. */
+ WXD_ID_FS_FISH_SCALES_L , /**< Large fish scales. */
+ WXD_ID_FS_FISH_SCALES_S , /**< Small fish scales. */
+ WXD_ID_FS_CIRCLES , /**< Circles. */
+ WXD_ID_FS_HEXAGONS , /**< Hexagons. */
+ WXD_ID_FS_OCTAGONS , /**< Octagons. */
+ WXD_ID_FS_TIRES_HOR , /**< Horizontal tire treads. */
+ WXD_ID_FS_TIRES_VER /**< Vertical tire treads. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Is drawing element (true) or default (false).
+ */
+ WxdkdrawDlgFillStyle(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for fill style buttons.
+ @param event Event to process.
+ */
+ void
+ OnFillStyle(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgFillStyle.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 18 "WxdkdrawDlgFillStyle.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerContents.
+ */
+#line 26 "WxdkdrawDlgFillStyle.wxc"
+ wxGridBagSizer *sizerContents;
+
+ /** GUI element buttonCancel.
+ */
+#line 173 "WxdkdrawDlgFillStyle.wxc"
+ wxButton *buttonCancel;
+
+ /** GUI element b00.
+ */
+#line 53 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b00;
+
+ /** GUI element b01.
+ */
+#line 58 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b01;
+
+ /** GUI element b02.
+ */
+#line 63 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b02;
+
+ /** GUI element b03.
+ */
+#line 68 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b03;
+
+ /** GUI element b04.
+ */
+#line 73 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b04;
+
+ /** GUI element b05.
+ */
+#line 78 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b05;
+
+ /** GUI element b06.
+ */
+#line 83 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b06;
+
+ /** GUI element b07.
+ */
+#line 88 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b07;
+
+ /** GUI element b08.
+ */
+#line 93 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b08;
+
+ /** GUI element b09.
+ */
+#line 98 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b09;
+
+ /** GUI element b10.
+ */
+#line 103 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b10;
+
+ /** GUI element b11.
+ */
+#line 108 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b11;
+
+ /** GUI element b12.
+ */
+#line 113 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b12;
+
+ /** GUI element b13.
+ */
+#line 118 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b13;
+
+ /** GUI element b14.
+ */
+#line 123 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b14;
+
+ /** GUI element b15.
+ */
+#line 128 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b15;
+
+ /** GUI element b16.
+ */
+#line 133 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b16;
+
+ /** GUI element b17.
+ */
+#line 138 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b17;
+
+ /** GUI element b18.
+ */
+#line 143 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b18;
+
+ /** GUI element b19.
+ */
+#line 148 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b19;
+
+ /** GUI element b20.
+ */
+#line 153 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b20;
+
+ /** GUI element b21.
+ */
+#line 158 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b21;
+
+ /** GUI element b22.
+ */
+#line 163 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b22;
+
+ /** GUI element b23.
+ */
+#line 168 "WxdkdrawDlgFillStyle.wxc"
+ wxBitmapButton *b23;
+
+
+#line 285 "WxdkdrawDlgFillStyle.wxc"
+};
+
+
+
+#line 289 "WxdkdrawDlgFillStyle.wxc"
+
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgFillStyle.wxc b/support/dktools/WxdkdrawDlgFillStyle.wxc
new file mode 100644
index 0000000000..5b2490baa5
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgFillStyle.wxc
@@ -0,0 +1,515 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerContents centered-x
+contents = $space(10)
+contents = buttonCancel centered-x
+contents = $space(10)
+
+[wxGridBagSizer sizerContents]
+grid = 5 5
+contents = b00 0 0 1 1 centered-x centered-y
+contents = b01 0 1 1 1 centered-x centered-y
+contents = b02 0 2 1 1 centered-x centered-y
+contents = b03 0 3 1 1 centered-x centered-y
+contents = b04 0 4 1 1 centered-x centered-y
+contents = b05 0 5 1 1 centered-x centered-y
+contents = b06 1 0 1 1 centered-x centered-y
+contents = b07 1 1 1 1 centered-x centered-y
+contents = b08 1 2 1 1 centered-x centered-y
+contents = b09 1 3 1 1 centered-x centered-y
+contents = b10 1 4 1 1 centered-x centered-y
+contents = b11 1 5 1 1 centered-x centered-y
+contents = b12 2 0 1 1 centered-x centered-y
+contents = b13 2 1 1 1 centered-x centered-y
+contents = b14 2 2 1 1 centered-x centered-y
+contents = b15 2 3 1 1 centered-x centered-y
+contents = b16 2 4 1 1 centered-x centered-y
+contents = b17 2 5 1 1 centered-x centered-y
+contents = b18 3 0 1 1 centered-x centered-y
+contents = b19 3 1 1 1 centered-x centered-y
+contents = b20 3 2 1 1 centered-x centered-y
+contents = b21 3 3 1 1 centered-x centered-y
+contents = b22 3 4 1 1 centered-x centered-y
+contents = b23 3 5 1 1 centered-x centered-y
+
+[wxBitmapButton b00]
+id = WXD_ID_FS_NONE
+tip = pTexts[264]
+bitmap = pImages[0]
+
+[wxBitmapButton b01]
+id = WXD_ID_FS_PURE
+tip = pTexts[265]
+bitmap = pImages[1]
+
+[wxBitmapButton b02]
+id = WXD_ID_FS_LEFT_DIAG_30
+tip = pTexts[266]
+bitmap = pImages[2]
+
+[wxBitmapButton b03]
+id = WXD_ID_FS_RIGHT_DIAG_30
+tip = pTexts[267]
+bitmap = pImages[3]
+
+[wxBitmapButton b04]
+id = WXD_ID_FS_SIEVE_30
+tip = pTexts[268]
+bitmap = pImages[4]
+
+[wxBitmapButton b05]
+id = WXD_ID_FS_LEFT_DIAG_45
+tip = pTexts[269]
+bitmap = pImages[5]
+
+[wxBitmapButton b06]
+id = WXD_ID_FS_RIGHT_DIAG_45
+tip = pTexts[270]
+bitmap = pImages[6]
+
+[wxBitmapButton b07]
+id = WXD_ID_FS_SIEVE_45
+tip = pTexts[271]
+bitmap = pImages[7]
+
+[wxBitmapButton b08]
+id = WXD_ID_FS_BRICKS_HOR
+tip = pTexts[272]
+bitmap = pImages[8]
+
+[wxBitmapButton b09]
+id = WXD_ID_FS_BRICKS_VER
+tip = pTexts[273]
+bitmap = pImages[9]
+
+[wxBitmapButton b10]
+id = WXD_ID_FS_LINES_HOR
+tip = pTexts[274]
+bitmap = pImages[10]
+
+[wxBitmapButton b11]
+id = WXD_ID_FS_LINES_VER
+tip = pTexts[275]
+bitmap = pImages[11]
+
+[wxBitmapButton b12]
+id = WXD_ID_FS_SIEVE_HOR_VER
+tip = pTexts[276]
+bitmap = pImages[12]
+
+[wxBitmapButton b13]
+id = WXD_ID_FS_SHINGLES_HOR_1
+tip = pTexts[277]
+bitmap = pImages[13]
+
+[wxBitmapButton b14]
+id = WXD_ID_FS_SHINGLES_HOR_2
+tip = pTexts[278]
+bitmap = pImages[14]
+
+[wxBitmapButton b15]
+id = WXD_ID_FS_SHINGLES_VER_1
+tip = pTexts[279]
+bitmap = pImages[15]
+
+[wxBitmapButton b16]
+id = WXD_ID_FS_SHINGLES_VER_2
+tip = pTexts[280]
+bitmap = pImages[16]
+
+[wxBitmapButton b17]
+id = WXD_ID_FS_FISH_SCALES_L
+tip = pTexts[281]
+bitmap = pImages[17]
+
+[wxBitmapButton b18]
+id = WXD_ID_FS_FISH_SCALES_S
+tip = pTexts[282]
+bitmap = pImages[18]
+
+[wxBitmapButton b19]
+id = WXD_ID_FS_CIRCLES
+tip = pTexts[283]
+bitmap = pImages[19]
+
+[wxBitmapButton b20]
+id = WXD_ID_FS_HEXAGONS
+tip = pTexts[284]
+bitmap = pImages[20]
+
+[wxBitmapButton b21]
+id = WXD_ID_FS_OCTAGONS
+tip = pTexts[285]
+bitmap = pImages[21]
+
+[wxBitmapButton b22]
+id = WXD_ID_FS_TIRES_HOR
+tip = pTexts[286]
+bitmap = pImages[22]
+
+[wxBitmapButton b23]
+id = WXD_ID_FS_TIRES_VER
+tip = pTexts[287]
+bitmap = pImages[23]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[288]
+tip = pTexts[289]
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+%% class start
+
+/** Dialog to modify fill style.
+*/
+class WxdkdrawDlgFillStyle : public wxDialog
+{
+
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+ protected:
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Selected fill style.
+ */
+ uint8_t m_uFillStyleCurrent;
+
+ /** Original fill style when starting dialog.
+ */
+ uint8_t m_uFillStyleOriginal;
+
+ /** Is drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for buttons.
+ */
+ enum {
+ WXD_ID_FS_NONE = (wxID_HIGHEST + 1), /**< No fill. */
+ WXD_ID_FS_PURE , /**< Pure colour fill. */
+ WXD_ID_FS_LEFT_DIAG_30 , /**< 30 degree diagonal left lines. */
+ WXD_ID_FS_RIGHT_DIAG_30 , /**< 30 degree diagonal right lines. */
+ WXD_ID_FS_SIEVE_30 , /**< 30 degree diagonal sieve. */
+ WXD_ID_FS_LEFT_DIAG_45 , /**< 45 degree diagonal left lines. */
+ WXD_ID_FS_RIGHT_DIAG_45 , /**< 45 degree diagonal right lines. */
+ WXD_ID_FS_SIEVE_45 , /**< 45 degree diagonal sieve. */
+ WXD_ID_FS_BRICKS_HOR , /**< Horizontal bricks. */
+ WXD_ID_FS_BRICKS_VER , /**< Vertical bricks. */
+ WXD_ID_FS_LINES_HOR , /**< Horizontal lines. */
+ WXD_ID_FS_LINES_VER , /**< Vertical lines. */
+ WXD_ID_FS_SIEVE_HOR_VER , /**< Horizontal-vertical sieve. */
+ WXD_ID_FS_SHINGLES_HOR_1 , /**< Horizontal shingles 1. */
+ WXD_ID_FS_SHINGLES_HOR_2 , /**< Horizontal shingles 2. */
+ WXD_ID_FS_SHINGLES_VER_1 , /**< Vertical shingles 1. */
+ WXD_ID_FS_SHINGLES_VER_2 , /**< Vertical shingles 2. */
+ WXD_ID_FS_FISH_SCALES_L , /**< Large fish scales. */
+ WXD_ID_FS_FISH_SCALES_S , /**< Small fish scales. */
+ WXD_ID_FS_CIRCLES , /**< Circles. */
+ WXD_ID_FS_HEXAGONS , /**< Hexagons. */
+ WXD_ID_FS_OCTAGONS , /**< Octagons. */
+ WXD_ID_FS_TIRES_HOR , /**< Horizontal tire treads. */
+ WXD_ID_FS_TIRES_VER /**< Vertical tire treads. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Is drawing element (true) or default (false).
+ */
+ WxdkdrawDlgFillStyle(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for fill style buttons.
+ @param event Event to process.
+ */
+ void
+ OnFillStyle(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+%% class end
+};
+
+
+%% header end
+
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGFILLSTYLE_H_INCLUDED
+#include "WxdkdrawDlgFillStyle.h"
+#endif
+
+
+
+$!trace-include
+
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgFillStyle,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgFillStyle,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgFillStyle::OnCancel\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_NONE,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_PURE,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_LEFT_DIAG_30,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_RIGHT_DIAG_30,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SIEVE_30,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_LEFT_DIAG_45,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_RIGHT_DIAG_45,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SIEVE_45,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_BRICKS_HOR,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_BRICKS_VER,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_LINES_HOR,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_LINES_VER,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SIEVE_HOR_VER,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SHINGLES_HOR_1,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SHINGLES_HOR_2,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SHINGLES_VER_1,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_SHINGLES_VER_2,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_FISH_SCALES_L,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_FISH_SCALES_S,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_CIRCLES,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_HEXAGONS,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_OCTAGONS,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_TIRES_HOR,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgFillStyle::WXD_ID_FS_TIRES_VER,\
+ WxdkdrawDlgFillStyle::OnFillStyle\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+
+WxdkdrawDlgFillStyle::WxdkdrawDlgFillStyle(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[263],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_uFillStyleOriginal = m_uFillStyleCurrent = pObject->fs;
+%% constructor end
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+%% module end
+
+
+void
+WxdkdrawDlgFillStyle::OnFillStyle(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+
+ switch (event.GetId()) {
+ case WXD_ID_FS_NONE : { m_uFillStyleCurrent = 0; } break;
+ case WXD_ID_FS_PURE : { m_uFillStyleCurrent = 1; } break;
+ case WXD_ID_FS_LEFT_DIAG_30 : { m_uFillStyleCurrent = 2; } break;
+ case WXD_ID_FS_RIGHT_DIAG_30 : { m_uFillStyleCurrent = 3; } break;
+ case WXD_ID_FS_SIEVE_30 : { m_uFillStyleCurrent = 4; } break;
+ case WXD_ID_FS_LEFT_DIAG_45 : { m_uFillStyleCurrent = 5; } break;
+ case WXD_ID_FS_RIGHT_DIAG_45 : { m_uFillStyleCurrent = 6; } break;
+ case WXD_ID_FS_SIEVE_45 : { m_uFillStyleCurrent = 7; } break;
+ case WXD_ID_FS_BRICKS_HOR : { m_uFillStyleCurrent = 8; } break;
+ case WXD_ID_FS_BRICKS_VER : { m_uFillStyleCurrent = 9; } break;
+ case WXD_ID_FS_LINES_HOR : { m_uFillStyleCurrent = 10; } break;
+ case WXD_ID_FS_LINES_VER : { m_uFillStyleCurrent = 11; } break;
+ case WXD_ID_FS_SIEVE_HOR_VER : { m_uFillStyleCurrent = 12; } break;
+ case WXD_ID_FS_SHINGLES_HOR_1 : { m_uFillStyleCurrent = 13; } break;
+ case WXD_ID_FS_SHINGLES_HOR_2 : { m_uFillStyleCurrent = 14; } break;
+ case WXD_ID_FS_SHINGLES_VER_1 : { m_uFillStyleCurrent = 15; } break;
+ case WXD_ID_FS_SHINGLES_VER_2 : { m_uFillStyleCurrent = 16; } break;
+ case WXD_ID_FS_FISH_SCALES_L : { m_uFillStyleCurrent = 17; } break;
+ case WXD_ID_FS_FISH_SCALES_S : { m_uFillStyleCurrent = 18; } break;
+ case WXD_ID_FS_CIRCLES : { m_uFillStyleCurrent = 19; } break;
+ case WXD_ID_FS_HEXAGONS : { m_uFillStyleCurrent = 20; } break;
+ case WXD_ID_FS_OCTAGONS : { m_uFillStyleCurrent = 21; } break;
+ case WXD_ID_FS_TIRES_HOR : { m_uFillStyleCurrent = 22; } break;
+ case WXD_ID_FS_TIRES_VER : { m_uFillStyleCurrent = 23; } break;
+ }
+ if ((m_bDrwElem) && (m_uFillStyleCurrent != m_pObject->fs)) {
+ bDoRefresh = true;
+ }
+ m_pObject->fs = m_uFillStyleCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgFillStyle::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgFontName.cpp b/support/dktools/WxdkdrawDlgFontName.cpp
new file mode 100644
index 0000000000..eef79e7a49
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgFontName.cpp
@@ -0,0 +1,709 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgFontName.wxc
+*/
+
+/** @file WxdkdrawDlgFontName.cpp The WxdkdrawDlgFontName module.
+*/
+
+
+#line 285 "WxdkdrawDlgFontName.wxc"
+
+
+#ifndef WXDKDRAWDLGFONTNAME_H_INCLUDED
+#include "WxdkdrawDlgFontName.h"
+#endif
+
+
+
+
+
+#line 294 "WxdkdrawDlgFontName.wxc"
+
+
+/** Assign event handlers to window IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgFontName,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgFontName,wxDialog)
+#endif
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_00,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_01,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_02,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_03,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_04,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_05,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_06,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_07,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_08,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_09,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_10,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_BOLD,\
+ WxdkdrawDlgFontName::OnBold\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_ITALIC,\
+ WxdkdrawDlgFontName::OnItalic\
+ )
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgFontName::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgFontName::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 371 "WxdkdrawDlgFontName.wxc"
+
+WxdkdrawDlgFontName::WxdkdrawDlgFontName(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ bool bRealObj,
+ wxChar const * const *pTexts,
+ const char ** const *pImages
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[296],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bRealObj = bRealObj;
+ m_pTexts = pTexts;
+ m_pImages = pImages;
+ m_uOldFontnumber = m_uFontnumber = (pObject->det).t.find;
+ m_uFontbase = m_uFontnumber;
+ if (32U > m_uFontnumber) {
+ m_uFontbase = 4U * (m_uFontbase / 4U);
+ }
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerInputs = NULL;
+ sizerResult = NULL;
+ sizerButtons = NULL;
+ b00 = NULL;
+ b01 = NULL;
+ b02 = NULL;
+ b03 = NULL;
+ b04 = NULL;
+ b05 = NULL;
+ b06 = NULL;
+ b07 = NULL;
+ b08 = NULL;
+ b09 = NULL;
+ b10 = NULL;
+ checkboxBold = NULL;
+ checkboxItalic = NULL;
+ labelFontname = NULL;
+ bitmapFontname = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerInputs = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerInputs)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_00,
+ pTexts[352],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxRB_GROUP
+ );
+ if(!(b00)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00->SetToolTip(pTexts[352]);
+ sizerInputs->Add(
+ b00,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b01 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_01,
+ pTexts[353]
+ );
+ if(!(b01)) {
+ goto dkctGUILayoutFinished;
+ }
+ b01->SetToolTip(pTexts[353]);
+ sizerInputs->Add(
+ b01,
+ wxGBPosition(0, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b02 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_02,
+ pTexts[354]
+ );
+ if(!(b02)) {
+ goto dkctGUILayoutFinished;
+ }
+ b02->SetToolTip(pTexts[354]);
+ sizerInputs->Add(
+ b02,
+ wxGBPosition(0, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b03 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_03,
+ pTexts[355]
+ );
+ if(!(b03)) {
+ goto dkctGUILayoutFinished;
+ }
+ b03->SetToolTip(pTexts[355]);
+ sizerInputs->Add(
+ b03,
+ wxGBPosition(0, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b04 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_04,
+ pTexts[356]
+ );
+ if(!(b04)) {
+ goto dkctGUILayoutFinished;
+ }
+ b04->SetToolTip(pTexts[356]);
+ sizerInputs->Add(
+ b04,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b05 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_05,
+ pTexts[357]
+ );
+ if(!(b05)) {
+ goto dkctGUILayoutFinished;
+ }
+ b05->SetToolTip(pTexts[357]);
+ sizerInputs->Add(
+ b05,
+ wxGBPosition(1, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b06 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_06,
+ pTexts[358]
+ );
+ if(!(b06)) {
+ goto dkctGUILayoutFinished;
+ }
+ b06->SetToolTip(pTexts[358]);
+ sizerInputs->Add(
+ b06,
+ wxGBPosition(1, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b07 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_07,
+ pTexts[359]
+ );
+ if(!(b07)) {
+ goto dkctGUILayoutFinished;
+ }
+ b07->SetToolTip(pTexts[359]);
+ sizerInputs->Add(
+ b07,
+ wxGBPosition(1, 3),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b08 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_08,
+ pTexts[360]
+ );
+ if(!(b08)) {
+ goto dkctGUILayoutFinished;
+ }
+ b08->SetToolTip(pTexts[360]);
+ sizerInputs->Add(
+ b08,
+ wxGBPosition(2, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b09 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_09,
+ pTexts[361]
+ );
+ if(!(b09)) {
+ goto dkctGUILayoutFinished;
+ }
+ b09->SetToolTip(pTexts[361]);
+ sizerInputs->Add(
+ b09,
+ wxGBPosition(2, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ b10 = new wxRadioButton(
+ this,
+ WXD_ID_FONT_10,
+ pTexts[362]
+ );
+ if(!(b10)) {
+ goto dkctGUILayoutFinished;
+ }
+ b10->SetToolTip(pTexts[362]);
+ sizerInputs->Add(
+ b10,
+ wxGBPosition(2, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerInputs->Add(10, 10, wxGBPosition(3, 0), wxGBSpan(1, 1));
+ checkboxBold = new wxCheckBox(
+ this,
+ WXD_ID_FONT_BOLD,
+ pTexts[363]
+ );
+ if(!(checkboxBold)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerInputs->Add(
+ checkboxBold,
+ wxGBPosition(4, 0),
+ wxGBSpan(1, 4),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ checkboxItalic = new wxCheckBox(
+ this,
+ WXD_ID_FONT_ITALIC,
+ pTexts[364]
+ );
+ if(!(checkboxItalic)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerInputs->Add(
+ checkboxItalic,
+ wxGBPosition(5, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerInputs->Add(10, 10, wxGBPosition(6, 0), wxGBSpan(1, 1));
+ sizerVertical->Add(
+ sizerInputs,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerResult = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerResult)) {
+ goto dkctGUILayoutFinished;
+ }
+ labelFontname = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[352]
+ );
+ if(!(labelFontname)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerResult->Add(
+ labelFontname,
+ 0,
+ wxALIGN_LEFT
+ );
+ sizerResult->Add(5, 5, 0);
+ bitmapFontname = new wxStaticBitmap(
+ this,
+ wxID_ANY,
+ wxBitmap(pImages[0])
+ );
+ if(!(bitmapFontname)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerResult->Add(
+ bitmapFontname,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(
+ sizerResult,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[365]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[366]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[297]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[298]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 400 "WxdkdrawDlgFontName.wxc"
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Transfer font from drawing object to UI elements
+ */
+ labelFontname->SetLabel(pTexts[299 + m_uFontnumber]);
+ bitmapFontname->SetBitmap(wxBitmap(pImages[m_uFontnumber]));
+ switch (m_uFontbase) {
+ case 0 : { b00->SetValue(true); } break;
+ case 4 : { b01->SetValue(true); } break;
+ case 8 : { b02->SetValue(true); } break;
+ case 12 : { b03->SetValue(true); } break;
+ case 16 : { b04->SetValue(true); } break;
+ case 20 : { b05->SetValue(true); } break;
+ case 24 : { b06->SetValue(true); } break;
+ case 28 : { b07->SetValue(true); } break;
+ case 32 : { b08->SetValue(true); } break;
+ case 33 : { b09->SetValue(true); } break;
+ case 34 : { b10->SetValue(true); } break;
+ }
+ if (32U > m_uFontnumber) {
+ switch (m_uFontnumber % 4U) {
+ case 0 : {
+ checkboxBold->SetValue(false);
+ checkboxItalic->SetValue(false);
+ } break;
+ case 1 : {
+ checkboxBold->SetValue(false);
+ checkboxItalic->SetValue(true);
+ } break;
+ case 2 : {
+ checkboxBold->SetValue(true);
+ checkboxItalic->SetValue(false);
+ } break;
+ case 3 : {
+ checkboxBold->SetValue(true);
+ checkboxItalic->SetValue(true);
+ } break;
+ }
+ }
+ else {
+ checkboxBold->SetValue(false);
+ checkboxItalic->SetValue(false);
+ checkboxBold->Enable(false);
+ checkboxItalic->Enable(false);
+ }
+ }
+}
+
+
+#line 454 "WxdkdrawDlgFontName.wxc"
+
+
+void
+WxdkdrawDlgFontName::UpdateFontInformation(void)
+{
+
+
+#line 460 "WxdkdrawDlgFontName.wxc"
+ m_uFontnumber = m_uFontbase;
+ if (32U > m_uFontnumber) {
+ /*
+ Fonts allowing bold/italic variants
+ */
+ if (checkboxBold->GetValue()) {
+ m_uFontnumber += 2U;
+ }
+ if (checkboxItalic->GetValue()) {
+ m_uFontnumber += 1U;
+ }
+ checkboxBold->Enable();
+ checkboxItalic->Enable();
+ }
+ else {
+ /*
+ Fonts without bold/italic variants
+ */
+ checkboxBold->Enable(false);
+ checkboxItalic->Enable(false);
+ }
+ /*
+ Update dialog
+ */
+ labelFontname->SetLabel(m_pTexts[299 + m_uFontnumber]);
+ bitmapFontname->SetBitmap(m_pImages[m_uFontnumber]);
+ Refresh();
+ Update();
+ (m_pObject->det).t.find = m_uFontnumber;
+ /*
+ When modifying a drawing element, update draw control
+ */
+ if (m_bRealObj) {
+ m_pParent->UpdateTextForFont(m_pObject);
+ }
+
+
+#line 496 "WxdkdrawDlgFontName.wxc"
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnFontFamily(wxCommandEvent & event)
+{
+
+
+#line 504 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 0U;
+ switch (event.GetId()) {
+ case WXD_ID_FONT_00 : {
+
+#line 507 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 0U;
+ } break;
+ case WXD_ID_FONT_01 : {
+
+#line 510 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 4U;
+ } break;
+ case WXD_ID_FONT_02 : {
+
+#line 513 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 8U;
+ } break;
+ case WXD_ID_FONT_03 : {
+
+#line 516 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 12U;
+ } break;
+ case WXD_ID_FONT_04 : {
+
+#line 519 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 16U;
+ } break;
+ case WXD_ID_FONT_05 : {
+
+#line 522 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 20U;
+ } break;
+ case WXD_ID_FONT_06 : {
+
+#line 525 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 24U;
+ } break;
+ case WXD_ID_FONT_07 : {
+
+#line 528 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 28U;
+ } break;
+ case WXD_ID_FONT_08 : {
+
+#line 531 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 32U;
+ } break;
+ case WXD_ID_FONT_09 : {
+
+#line 534 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 33U;
+ } break;
+ case WXD_ID_FONT_10 : {
+
+#line 537 "WxdkdrawDlgFontName.wxc"
+ m_uFontbase = 34U;
+ } break;
+ }
+
+
+#line 541 "WxdkdrawDlgFontName.wxc"
+ UpdateFontInformation();
+
+
+#line 543 "WxdkdrawDlgFontName.wxc"
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if (m_bRealObj) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ if ((m_bRealObj) && (m_uOldFontnumber != (m_pObject->det).t.find)) {
+ bDoRefresh = true;
+ }
+ (m_pObject->det).t.find = m_uFontnumber = m_uOldFontnumber;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnBold(wxCommandEvent & WXUNUSED(event))
+{
+ UpdateFontInformation();
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnItalic(wxCommandEvent & WXUNUSED(event))
+{
+ UpdateFontInformation();
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgFontName.h b/support/dktools/WxdkdrawDlgFontName.h
new file mode 100644
index 0000000000..2c7f5af245
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgFontName.h
@@ -0,0 +1,288 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgFontName.wxc
+*/
+
+/** @file WxdkdrawDlgFontName.h Header file for the WxdkdrawDlgFontName module.
+*/
+
+#ifndef WXDKDRAWDLGFONTNAME_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGFONTNAME_H_INCLUDED 1
+
+
+#line 137 "WxdkdrawDlgFontName.wxc"
+
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#line 149 "WxdkdrawDlgFontName.wxc"
+
+/** Dialog to modify font.
+*/
+class WxdkdrawDlgFontName : public wxDialog
+{
+
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 11 "WxdkdrawDlgFontName.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 17 "WxdkdrawDlgFontName.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerInputs.
+ */
+#line 27 "WxdkdrawDlgFontName.wxc"
+ wxGridBagSizer *sizerInputs;
+
+ /** GUI element sizerResult.
+ */
+#line 109 "WxdkdrawDlgFontName.wxc"
+ wxBoxSizer *sizerResult;
+
+ /** GUI element sizerButtons.
+ */
+#line 121 "WxdkdrawDlgFontName.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element b00.
+ */
+#line 45 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b00;
+
+ /** GUI element b01.
+ */
+#line 51 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b01;
+
+ /** GUI element b02.
+ */
+#line 56 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b02;
+
+ /** GUI element b03.
+ */
+#line 61 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b03;
+
+ /** GUI element b04.
+ */
+#line 66 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b04;
+
+ /** GUI element b05.
+ */
+#line 71 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b05;
+
+ /** GUI element b06.
+ */
+#line 76 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b06;
+
+ /** GUI element b07.
+ */
+#line 81 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b07;
+
+ /** GUI element b08.
+ */
+#line 86 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b08;
+
+ /** GUI element b09.
+ */
+#line 91 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b09;
+
+ /** GUI element b10.
+ */
+#line 96 "WxdkdrawDlgFontName.wxc"
+ wxRadioButton *b10;
+
+ /** GUI element checkboxBold.
+ */
+#line 101 "WxdkdrawDlgFontName.wxc"
+ wxCheckBox *checkboxBold;
+
+ /** GUI element checkboxItalic.
+ */
+#line 105 "WxdkdrawDlgFontName.wxc"
+ wxCheckBox *checkboxItalic;
+
+ /** GUI element labelFontname.
+ */
+#line 115 "WxdkdrawDlgFontName.wxc"
+ wxStaticText *labelFontname;
+
+ /** GUI element bitmapFontname.
+ */
+#line 118 "WxdkdrawDlgFontName.wxc"
+ wxStaticBitmap *bitmapFontname;
+
+ /** GUI element buttonOK.
+ */
+#line 125 "WxdkdrawDlgFontName.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 130 "WxdkdrawDlgFontName.wxc"
+ wxButton *buttonCancel;
+
+
+#line 166 "WxdkdrawDlgFontName.wxc"
+
+ protected:
+
+ /** Applications main frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ /** Images to show fonts.
+ */
+ const char ** const *m_pImages;
+
+ /** Original font number when opening dialog.
+ */
+ uint8_t m_uOldFontnumber;
+
+ /** Complete font number (family+bold+italic).
+ */
+ uint8_t m_uFontnumber;
+
+ /** Base font number, ignoring bold/italic.
+ */
+ uint8_t m_uFontbase;
+
+ /** Flag: Modify drawing object (style default object otherwise).
+ */
+ bool m_bRealObj;
+
+ public:
+
+ /** Window IDs used in GUI.
+ */
+ enum {
+ WXD_ID_FONT_00 = (wxID_HIGHEST + 1), /**< Times. */
+ WXD_ID_FONT_01 , /**< AvantGarde. */
+ WXD_ID_FONT_02 , /**< Bookman. */
+ WXD_ID_FONT_03 , /**< Courier. */
+ WXD_ID_FONT_04 , /**< Helvetica. */
+ WXD_ID_FONT_05 , /**< HelveticaNarrow. */
+ WXD_ID_FONT_06 , /**< NewCenturySchoolbk. */
+ WXD_ID_FONT_07 , /**< Palatino. */
+ WXD_ID_FONT_08 , /**< Symbol. */
+ WXD_ID_FONT_09 , /**< ZapfChancery. */
+ WXD_ID_FONT_10 , /**< ZapfDingbats. */
+ WXD_ID_FONT_BOLD , /**< Bold font. */
+ WXD_ID_FONT_ITALIC /**< Italic font. */
+ };
+
+ public:
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param bRealObj Flag: Real object (style object otherwise).
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ */
+
+ WxdkdrawDlgFontName(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ bool bRealObj,
+ wxChar const * const *pTexts,
+ const char ** const *pImages
+ );
+
+ /** Handler for radio button click.
+ @param event Event to process.
+ */
+ void
+ OnFontFamily(wxCommandEvent & event);
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Bold checkbox handler.
+ @param event Event to process.
+ */
+ void
+ OnBold(wxCommandEvent & event);
+
+ /** Italic checkbox handler.
+ @param event Event to process.
+ */
+ void
+ OnItalic(wxCommandEvent & event);
+
+ protected:
+
+ /** Update UI after click on font family radio button
+ or bold or italic checkbox.
+ */
+ void
+ UpdateFontInformation(void);
+
+};
+
+
+
+#line 281 "WxdkdrawDlgFontName.wxc"
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgFontName.wxc b/support/dktools/WxdkdrawDlgFontName.wxc
new file mode 100644
index 0000000000..963dd82b5c
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgFontName.wxc
@@ -0,0 +1,605 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerInputs centered-x
+contents = $space(10)
+contents = sizerResult centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxGridBagSizer sizerInputs]
+grid = 5 5
+contents = b00 0 0 1 1 left centered-y
+contents = b01 . +1 1 1 left centered-y
+contents = b02 . +1 1 1 left centered-y
+contents = b03 . +1 1 1 left centered-y
+contents = b04 +1 0 1 1 left centered-y
+contents = b05 . +1 1 1 left centered-y
+contents = b06 . +1 1 1 left centered-y
+contents = b07 . +1 1 1 left centered-y
+contents = b08 +1 0 1 1 left centered-y
+contents = b09 . +1 1 1 left centered-y
+contents = b10 . +1 1 1 left centered-y
+contents = $space(10) +1 0 1 1 left centered-y
+contents = checkboxBold +1 0 1 4 left centered-y
+contents = checkboxItalic +1 0 1 1 left centered-y
+contents = $space(10) +1 0 1 1 left centered-y
+
+[wxRadioButton b00]
+id = WXD_ID_FONT_00
+text = pTexts[352]
+tip = pTexts[352]
+start group = yes
+
+[wxRadioButton b01]
+id = WXD_ID_FONT_01
+text = pTexts[353]
+tip = pTexts[353]
+
+[wxRadioButton b02]
+id = WXD_ID_FONT_02
+text = pTexts[354]
+tip = pTexts[354]
+
+[wxRadioButton b03]
+id = WXD_ID_FONT_03
+text = pTexts[355]
+tip = pTexts[355]
+
+[wxRadioButton b04]
+id = WXD_ID_FONT_04
+text = pTexts[356]
+tip = pTexts[356]
+
+[wxRadioButton b05]
+id = WXD_ID_FONT_05
+text = pTexts[357]
+tip = pTexts[357]
+
+[wxRadioButton b06]
+id = WXD_ID_FONT_06
+text = pTexts[358]
+tip = pTexts[358]
+
+[wxRadioButton b07]
+id = WXD_ID_FONT_07
+text = pTexts[359]
+tip = pTexts[359]
+
+[wxRadioButton b08]
+id = WXD_ID_FONT_08
+text = pTexts[360]
+tip = pTexts[360]
+
+[wxRadioButton b09]
+id = WXD_ID_FONT_09
+text = pTexts[361]
+tip = pTexts[361]
+
+[wxRadioButton b10]
+id = WXD_ID_FONT_10
+text = pTexts[362]
+tip = pTexts[362]
+
+[wxCheckBox checkboxBold]
+id = WXD_ID_FONT_BOLD
+text = pTexts[363]
+
+[wxCheckBox checkboxItalic]
+id = WXD_ID_FONT_ITALIC
+text = pTexts[364]
+
+[wxBoxSizer sizerResult]
+direction = vertical
+contents = labelFontname left
+contents = $space(5)
+contents = bitmapFontname centered-x
+
+[wxStaticText labelFontname]
+text = pTexts[352]
+
+[wxStaticBitmap bitmapFontname]
+bitmap = wxBitmap(pImages[0])
+
+[wxStdDialogButtonSizer sizerButtons]
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[365]
+tip = pTexts[366]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[297]
+tip = pTexts[298]
+
+
+%% header start
+
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+%% class start
+
+/** Dialog to modify font.
+*/
+class WxdkdrawDlgFontName : public wxDialog
+{
+
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+%% class end
+
+ protected:
+
+ /** Applications main frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ /** Images to show fonts.
+ */
+ const char ** const *m_pImages;
+
+ /** Original font number when opening dialog.
+ */
+ uint8_t m_uOldFontnumber;
+
+ /** Complete font number (family+bold+italic).
+ */
+ uint8_t m_uFontnumber;
+
+ /** Base font number, ignoring bold/italic.
+ */
+ uint8_t m_uFontbase;
+
+ /** Flag: Modify drawing object (style default object otherwise).
+ */
+ bool m_bRealObj;
+
+ public:
+
+ /** Window IDs used in GUI.
+ */
+ enum {
+ WXD_ID_FONT_00 = (wxID_HIGHEST + 1), /**< Times. */
+ WXD_ID_FONT_01 , /**< AvantGarde. */
+ WXD_ID_FONT_02 , /**< Bookman. */
+ WXD_ID_FONT_03 , /**< Courier. */
+ WXD_ID_FONT_04 , /**< Helvetica. */
+ WXD_ID_FONT_05 , /**< HelveticaNarrow. */
+ WXD_ID_FONT_06 , /**< NewCenturySchoolbk. */
+ WXD_ID_FONT_07 , /**< Palatino. */
+ WXD_ID_FONT_08 , /**< Symbol. */
+ WXD_ID_FONT_09 , /**< ZapfChancery. */
+ WXD_ID_FONT_10 , /**< ZapfDingbats. */
+ WXD_ID_FONT_BOLD , /**< Bold font. */
+ WXD_ID_FONT_ITALIC /**< Italic font. */
+ };
+
+ public:
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param bRealObj Flag: Real object (style object otherwise).
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ */
+
+ WxdkdrawDlgFontName(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ bool bRealObj,
+ wxChar const * const *pTexts,
+ const char ** const *pImages
+ );
+
+ /** Handler for radio button click.
+ @param event Event to process.
+ */
+ void
+ OnFontFamily(wxCommandEvent & event);
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Bold checkbox handler.
+ @param event Event to process.
+ */
+ void
+ OnBold(wxCommandEvent & event);
+
+ /** Italic checkbox handler.
+ @param event Event to process.
+ */
+ void
+ OnItalic(wxCommandEvent & event);
+
+ protected:
+
+ /** Update UI after click on font family radio button
+ or bold or italic checkbox.
+ */
+ void
+ UpdateFontInformation(void);
+
+};
+
+
+%% header end
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module start
+
+
+#ifndef WXDKDRAWDLGFONTNAME_H_INCLUDED
+#include "WxdkdrawDlgFontName.h"
+#endif
+
+
+
+$!trace-include
+
+
+/** Assign event handlers to window IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgFontName,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgFontName,wxDialog)
+#endif
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_00,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_01,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_02,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_03,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_04,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_05,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_06,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_07,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_08,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_09,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_RADIOBUTTON(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_10,\
+ WxdkdrawDlgFontName::OnFontFamily\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_BOLD,\
+ WxdkdrawDlgFontName::OnBold\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgFontName::WXD_ID_FONT_ITALIC,\
+ WxdkdrawDlgFontName::OnItalic\
+ )
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgFontName::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgFontName::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+
+WxdkdrawDlgFontName::WxdkdrawDlgFontName(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ bool bRealObj,
+ wxChar const * const *pTexts,
+ const char ** const *pImages
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[296],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bRealObj = bRealObj;
+ m_pTexts = pTexts;
+ m_pImages = pImages;
+ m_uOldFontnumber = m_uFontnumber = (pObject->det).t.find;
+ m_uFontbase = m_uFontnumber;
+ if (32U > m_uFontnumber) {
+ m_uFontbase = 4U * (m_uFontbase / 4U);
+ }
+%% constructor end
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Transfer font from drawing object to UI elements
+ */
+ labelFontname->SetLabel(pTexts[299 + m_uFontnumber]);
+ bitmapFontname->SetBitmap(wxBitmap(pImages[m_uFontnumber]));
+ switch (m_uFontbase) {
+ case 0 : { b00->SetValue(true); } break;
+ case 4 : { b01->SetValue(true); } break;
+ case 8 : { b02->SetValue(true); } break;
+ case 12 : { b03->SetValue(true); } break;
+ case 16 : { b04->SetValue(true); } break;
+ case 20 : { b05->SetValue(true); } break;
+ case 24 : { b06->SetValue(true); } break;
+ case 28 : { b07->SetValue(true); } break;
+ case 32 : { b08->SetValue(true); } break;
+ case 33 : { b09->SetValue(true); } break;
+ case 34 : { b10->SetValue(true); } break;
+ }
+ if (32U > m_uFontnumber) {
+ switch (m_uFontnumber % 4U) {
+ case 0 : {
+ checkboxBold->SetValue(false);
+ checkboxItalic->SetValue(false);
+ } break;
+ case 1 : {
+ checkboxBold->SetValue(false);
+ checkboxItalic->SetValue(true);
+ } break;
+ case 2 : {
+ checkboxBold->SetValue(true);
+ checkboxItalic->SetValue(false);
+ } break;
+ case 3 : {
+ checkboxBold->SetValue(true);
+ checkboxItalic->SetValue(true);
+ } break;
+ }
+ }
+ else {
+ checkboxBold->SetValue(false);
+ checkboxItalic->SetValue(false);
+ checkboxBold->Enable(false);
+ checkboxItalic->Enable(false);
+ }
+ }
+}
+
+%% module end
+
+
+void
+WxdkdrawDlgFontName::UpdateFontInformation(void)
+{
+ $? "+ UpdateFontInformation"
+ m_uFontnumber = m_uFontbase;
+ if (32U > m_uFontnumber) {
+ /*
+ Fonts allowing bold/italic variants
+ */
+ if (checkboxBold->GetValue()) {
+ m_uFontnumber += 2U;
+ }
+ if (checkboxItalic->GetValue()) {
+ m_uFontnumber += 1U;
+ }
+ checkboxBold->Enable();
+ checkboxItalic->Enable();
+ }
+ else {
+ /*
+ Fonts without bold/italic variants
+ */
+ checkboxBold->Enable(false);
+ checkboxItalic->Enable(false);
+ }
+ /*
+ Update dialog
+ */
+ labelFontname->SetLabel(m_pTexts[299 + m_uFontnumber]);
+ bitmapFontname->SetBitmap(m_pImages[m_uFontnumber]);
+ Refresh();
+ Update();
+ (m_pObject->det).t.find = m_uFontnumber;
+ /*
+ When modifying a drawing element, update draw control
+ */
+ if (m_bRealObj) {
+ m_pParent->UpdateTextForFont(m_pObject);
+ }
+ $? "- UpdateFontInformation"
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnFontFamily(wxCommandEvent & event)
+{
+ $? "+ OnFontFamily %d", (int)(event.GetId())
+ m_uFontbase = 0U;
+ switch (event.GetId()) {
+ case WXD_ID_FONT_00 : { $? ". 00"
+ m_uFontbase = 0U;
+ } break;
+ case WXD_ID_FONT_01 : { $? ". 01"
+ m_uFontbase = 4U;
+ } break;
+ case WXD_ID_FONT_02 : { $? ". 02"
+ m_uFontbase = 8U;
+ } break;
+ case WXD_ID_FONT_03 : { $? ". 03"
+ m_uFontbase = 12U;
+ } break;
+ case WXD_ID_FONT_04 : { $? ". 04"
+ m_uFontbase = 16U;
+ } break;
+ case WXD_ID_FONT_05 : { $? ". 05"
+ m_uFontbase = 20U;
+ } break;
+ case WXD_ID_FONT_06 : { $? ". 06"
+ m_uFontbase = 24U;
+ } break;
+ case WXD_ID_FONT_07 : { $? ". 07"
+ m_uFontbase = 28U;
+ } break;
+ case WXD_ID_FONT_08 : { $? ". 08"
+ m_uFontbase = 32U;
+ } break;
+ case WXD_ID_FONT_09 : { $? ". 09"
+ m_uFontbase = 33U;
+ } break;
+ case WXD_ID_FONT_10 : { $? ". 10"
+ m_uFontbase = 34U;
+ } break;
+ }
+ $? ". m_uFontbase = %u", (unsigned)m_uFontbase
+ UpdateFontInformation();
+ $? "- OnFontFamily"
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if (m_bRealObj) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ if ((m_bRealObj) && (m_uOldFontnumber != (m_pObject->det).t.find)) {
+ bDoRefresh = true;
+ }
+ (m_pObject->det).t.find = m_uFontnumber = m_uOldFontnumber;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnBold(wxCommandEvent & WXUNUSED(event))
+{
+ UpdateFontInformation();
+}
+
+
+
+void
+WxdkdrawDlgFontName::OnItalic(wxCommandEvent & WXUNUSED(event))
+{
+ UpdateFontInformation();
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgImageOptions.cpp b/support/dktools/WxdkdrawDlgImageOptions.cpp
new file mode 100644
index 0000000000..63dcec6d8a
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgImageOptions.cpp
@@ -0,0 +1,450 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgImageOptions.wxc
+*/
+
+/** @file WxdkdrawDlgImageOptions.cpp The WxdkdrawDlgImageOptions module.
+*/
+
+
+#line 191 "WxdkdrawDlgImageOptions.wxc"
+
+#ifndef WXDKDRAWDLGIMAGEOPTIONS_H_INCLUDED
+#include "WxdkdrawDlgImageOptions.h"
+#endif
+
+
+
+
+#line 198 "WxdkdrawDlgImageOptions.wxc"
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgImageOptions,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgImageOptions,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgImageOptions::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgImageOptions::OnCancel\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgImageOptions::WXD_ID_DCT,\
+ WxdkdrawDlgImageOptions::OnDCT\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgImageOptions::WXD_ID_INT,\
+ WxdkdrawDlgImageOptions::OnInterpolation\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 231 "WxdkdrawDlgImageOptions.wxc"
+
+WxdkdrawDlgImageOptions::WxdkdrawDlgImageOptions(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[461],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ wxString saConversionMethods[] = {
+ wxString(pTexts[480]),
+ wxString(pTexts[481]),
+ wxString(pTexts[482]),
+ wxString(pTexts[483]),
+ wxString(pTexts[484]),
+ wxString(pTexts[485]),
+ wxString(pTexts[486]),
+ wxString(pTexts[487]),
+ wxString(pTexts[488]),
+ wxString(pTexts[489]),
+ wxString(pTexts[490]),
+ wxString(pTexts[491]),
+ wxString(pTexts[492]),
+ wxString(pTexts[493])
+ };
+ int sel;
+
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_sTexts = pTexts;
+
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerRgbToGray = NULL;
+ sizerOptions = NULL;
+ sizerButtons = NULL;
+ lConversionMethods = NULL;
+ chConversionMethods = NULL;
+ cbKeepAspectRatio = NULL;
+ cbUseAlphaChannel = NULL;
+ cbDCTData = NULL;
+ cbInterpolation = NULL;
+ cbDCTInterpolation = NULL;
+ cbEnforceBackground = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerRgbToGray = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerRgbToGray)) {
+ goto dkctGUILayoutFinished;
+ }
+ lConversionMethods = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[462]
+ );
+ if(!(lConversionMethods)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerRgbToGray->Add(
+ lConversionMethods,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerRgbToGray->Add(10, 10, 0);
+ chConversionMethods = new wxChoice(
+ this,
+ wxID_ANY,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 14,
+ saConversionMethods
+ );
+ if(!(chConversionMethods)) {
+ goto dkctGUILayoutFinished;
+ }
+ chConversionMethods->SetToolTip(pTexts[463]);
+ sizerRgbToGray->Add(
+ chConversionMethods,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerRgbToGray,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerOptions = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerOptions)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbKeepAspectRatio = new wxCheckBox(
+ this,
+ wxID_ANY,
+ pTexts[464]
+ );
+ if(!(cbKeepAspectRatio)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbKeepAspectRatio->SetToolTip(pTexts[465]);
+ sizerOptions->Add(
+ cbKeepAspectRatio,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbUseAlphaChannel = new wxCheckBox(
+ this,
+ wxID_ANY,
+ pTexts[466]
+ );
+ if(!(cbUseAlphaChannel)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbUseAlphaChannel->SetToolTip(pTexts[467]);
+ sizerOptions->Add(
+ cbUseAlphaChannel,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbDCTData = new wxCheckBox(
+ this,
+ WXD_ID_DCT,
+ pTexts[470]
+ );
+ if(!(cbDCTData)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbDCTData->SetToolTip(pTexts[471]);
+ sizerOptions->Add(
+ cbDCTData,
+ wxGBPosition(2, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbInterpolation = new wxCheckBox(
+ this,
+ WXD_ID_INT,
+ pTexts[468]
+ );
+ if(!(cbInterpolation)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbInterpolation->SetToolTip(pTexts[469]);
+ sizerOptions->Add(
+ cbInterpolation,
+ wxGBPosition(3, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerOptions->Add(20, 1, wxGBPosition(4, 0), wxGBSpan(1, 1));
+ cbDCTInterpolation = new wxCheckBox(
+ this,
+ wxID_ANY,
+ pTexts[472]
+ );
+ if(!(cbDCTInterpolation)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbDCTInterpolation->SetToolTip(pTexts[473]);
+ sizerOptions->Add(
+ cbDCTInterpolation,
+ wxGBPosition(4, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbEnforceBackground = new wxCheckBox(
+ this,
+ wxID_ANY,
+ pTexts[474]
+ );
+ if(!(cbEnforceBackground)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbEnforceBackground->SetToolTip(pTexts[475]);
+ sizerOptions->Add(
+ cbEnforceBackground,
+ wxGBPosition(5, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerOptions,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[476]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[478]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[477]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[479]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 270 "WxdkdrawDlgImageOptions.wxc"
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Load flags into GUI
+ */
+ sel = (int)((m_pObject->det).i.r2g) + 1;
+ if ( 0 > sel) { sel = 0; }
+ if (13 < sel) { sel = 13; }
+ chConversionMethods->SetSelection(sel);
+ cbKeepAspectRatio->SetValue(
+ 0 != (WXD_IMFL_ASPECT & ((m_pObject->det).i.fl))
+ );
+ cbUseAlphaChannel->SetValue(
+ 0 != (WXD_IMFL_USE_ALPHA & ((m_pObject->det).i.fl))
+ );
+ cbDCTData->SetValue(
+ 0 != (WXD_IMFL_USE_DCT & ((m_pObject->det).i.fl))
+ );
+ cbInterpolation->SetValue(
+ 0 != (WXD_IMFL_IMG_INT & ((m_pObject->det).i.fl))
+ );
+ cbDCTInterpolation->SetValue(
+ 0 != (WXD_IMFL_DCT_INT & ((m_pObject->det).i.fl))
+ );
+ cbEnforceBackground->SetValue(
+ 0 != (WXD_IMFL_FORCE_BG & ((m_pObject->det).i.fl))
+ );
+ CorrectGUI(false);
+ }
+}
+
+
+
+#line 307 "WxdkdrawDlgImageOptions.wxc"
+
+
+void
+WxdkdrawDlgImageOptions::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ uint8_t back = (uint8_t)0U;
+
+ if (cbKeepAspectRatio->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_ASPECT);
+ }
+ if (cbUseAlphaChannel->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_USE_ALPHA);
+ }
+ if (cbDCTData->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_USE_DCT);
+ }
+ if (cbInterpolation->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_IMG_INT);
+ }
+ if (cbDCTInterpolation->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_DCT_INT);
+ }
+ if (cbEnforceBackground->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_FORCE_BG);
+ }
+ (m_pObject->det).i.fl = back;
+ (m_pObject->det).i.r2g = (int8_t)(chConversionMethods->GetSelection() - 1);
+ if (-1 > (m_pObject->det).i.r2g) { (m_pObject->det).i.r2g = -1; }
+ if (12 < (m_pObject->det).i.r2g) { (m_pObject->det).i.r2g = 12; }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgImageOptions::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgImageOptions::CorrectGUI(bool bUpdate)
+{
+ if ((cbDCTData->GetValue()) && (cbInterpolation->GetValue())) {
+ cbDCTInterpolation->Enable();
+ }
+ else {
+ cbDCTInterpolation->Enable(false);
+ }
+ if (bUpdate) {
+ Refresh();
+ Update();
+ }
+}
+
+
+
+void
+WxdkdrawDlgImageOptions::OnDCT(wxCommandEvent & WXUNUSED(event))
+{
+ CorrectGUI();
+}
+
+
+
+void
+WxdkdrawDlgImageOptions::OnInterpolation(wxCommandEvent & WXUNUSED(event))
+{
+ CorrectGUI();
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgImageOptions.h b/support/dktools/WxdkdrawDlgImageOptions.h
new file mode 100644
index 0000000000..82dd88cc0a
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgImageOptions.h
@@ -0,0 +1,205 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgImageOptions.wxc
+*/
+
+/** @file WxdkdrawDlgImageOptions.h Header file for the WxdkdrawDlgImageOptions module.
+*/
+
+#ifndef WXDKDRAWDLGIMAGEOPTIONS_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGIMAGEOPTIONS_H_INCLUDED 1
+
+
+#line 91 "WxdkdrawDlgImageOptions.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+#line 101 "WxdkdrawDlgImageOptions.wxc"
+
+/** Dialog to set image options.
+ These options are not used by wxdkdraw but by wxd2lat when producing
+ output for LaTeX.
+*/
+class WxdkdrawDlgImageOptions : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 11 "WxdkdrawDlgImageOptions.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 17 "WxdkdrawDlgImageOptions.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerRgbToGray.
+ */
+#line 26 "WxdkdrawDlgImageOptions.wxc"
+ wxBoxSizer *sizerRgbToGray;
+
+ /** GUI element sizerOptions.
+ */
+#line 39 "WxdkdrawDlgImageOptions.wxc"
+ wxGridBagSizer *sizerOptions;
+
+ /** GUI element sizerButtons.
+ */
+#line 75 "WxdkdrawDlgImageOptions.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element lConversionMethods.
+ */
+#line 32 "WxdkdrawDlgImageOptions.wxc"
+ wxStaticText *lConversionMethods;
+
+ /** GUI element chConversionMethods.
+ */
+#line 35 "WxdkdrawDlgImageOptions.wxc"
+ wxChoice *chConversionMethods;
+
+ /** GUI element cbKeepAspectRatio.
+ */
+#line 49 "WxdkdrawDlgImageOptions.wxc"
+ wxCheckBox *cbKeepAspectRatio;
+
+ /** GUI element cbUseAlphaChannel.
+ */
+#line 53 "WxdkdrawDlgImageOptions.wxc"
+ wxCheckBox *cbUseAlphaChannel;
+
+ /** GUI element cbDCTData.
+ */
+#line 57 "WxdkdrawDlgImageOptions.wxc"
+ wxCheckBox *cbDCTData;
+
+ /** GUI element cbInterpolation.
+ */
+#line 62 "WxdkdrawDlgImageOptions.wxc"
+ wxCheckBox *cbInterpolation;
+
+ /** GUI element cbDCTInterpolation.
+ */
+#line 67 "WxdkdrawDlgImageOptions.wxc"
+ wxCheckBox *cbDCTInterpolation;
+
+ /** GUI element cbEnforceBackground.
+ */
+#line 71 "WxdkdrawDlgImageOptions.wxc"
+ wxCheckBox *cbEnforceBackground;
+
+ /** GUI element buttonOK.
+ */
+#line 79 "WxdkdrawDlgImageOptions.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 84 "WxdkdrawDlgImageOptions.wxc"
+ wxButton *buttonCancel;
+
+
+#line 119 "WxdkdrawDlgImageOptions.wxc"
+
+ protected:
+
+ /** Parent frame (the programs main window).
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Image object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ public:
+
+ /** Control IDs.
+ */
+ enum {
+ WXD_ID_DCT = (wxID_HIGHEST + 1), /**< DCT check box. */
+ WXD_ID_INT , /**< Image interpolation. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (main window).
+ @param pObject Image object to modify.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgImageOptions(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** DCT checkbox handler.
+ @param event Event to process.
+ */
+ void
+ OnDCT(wxCommandEvent & event);
+
+ /** Image interpolation checkbox handler.
+ @param event Event to process.
+ */
+ void
+ OnInterpolation(wxCommandEvent & event);
+
+ protected:
+
+ /** Correct GUI.
+ */
+ void
+ CorrectGUI(bool bUpdate = true);
+};
+
+
+
+#line 188 "WxdkdrawDlgImageOptions.wxc"
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgImageOptions.wxc b/support/dktools/WxdkdrawDlgImageOptions.wxc
new file mode 100644
index 0000000000..e6fb70111d
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgImageOptions.wxc
@@ -0,0 +1,395 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2020-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerRgbToGray centered-x
+contents = sizerOptions centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxBoxSizer sizerRgbToGray]
+direction = horizontal
+contents = lConversionMethods centered-y
+contents = $space(10)
+contents = chConversionMethods centered-y
+
+[wxStaticText lConversionMethods]
+text = pTexts[462]
+
+[wxChoice chConversionMethods]
+choices = 14 saConversionMethods
+tip = pTexts[463]
+
+[wxGridBagSizer sizerOptions]
+grid = 5 5
+contents = cbKeepAspectRatio 0 0 1 2 left centered-y
+contents = cbUseAlphaChannel +1 0 1 2 left centered-y
+contents = cbDCTData +1 0 1 2 left centered-y
+contents = cbInterpolation +1 0 1 2 left centered-y
+contents = $space(20,1) +1 0 1 1 left centered-y
+contents = cbDCTInterpolation . +1 1 1 left centered-y
+contents = cbEnforceBackground +1 0 1 2 left centered-y
+
+[wxCheckBox cbKeepAspectRatio]
+text = pTexts[464]
+tip = pTexts[465]
+
+[wxCheckBox cbUseAlphaChannel]
+text = pTexts[466]
+tip = pTexts[467]
+
+[wxCheckBox cbDCTData]
+id = WXD_ID_DCT
+text = pTexts[470]
+tip = pTexts[471]
+
+[wxCheckBox cbInterpolation]
+id = WXD_ID_INT
+text = pTexts[468]
+tip = pTexts[469]
+
+[wxCheckBox cbDCTInterpolation]
+text = pTexts[472]
+tip = pTexts[473]
+
+[wxCheckBox cbEnforceBackground]
+text = pTexts[474]
+tip = pTexts[475]
+
+[wxStdDialogButtonSizer sizerButtons]
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[476]
+tip = pTexts[478]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[477]
+tip = pTexts[479]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+%% class start
+
+/** Dialog to set image options.
+ These options are not used by wxdkdraw but by wxd2lat when producing
+ output for LaTeX.
+*/
+class WxdkdrawDlgImageOptions : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+%% class end
+
+ protected:
+
+ /** Parent frame (the programs main window).
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Image object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ public:
+
+ /** Control IDs.
+ */
+ enum {
+ WXD_ID_DCT = (wxID_HIGHEST + 1), /**< DCT check box. */
+ WXD_ID_INT , /**< Image interpolation. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (main window).
+ @param pObject Image object to modify.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgImageOptions(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** DCT checkbox handler.
+ @param event Event to process.
+ */
+ void
+ OnDCT(wxCommandEvent & event);
+
+ /** Image interpolation checkbox handler.
+ @param event Event to process.
+ */
+ void
+ OnInterpolation(wxCommandEvent & event);
+
+ protected:
+
+ /** Correct GUI.
+ */
+ void
+ CorrectGUI(bool bUpdate = true);
+};
+
+
+%% header end
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGIMAGEOPTIONS_H_INCLUDED
+#include "WxdkdrawDlgImageOptions.h"
+#endif
+
+
+$!trace-include
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgImageOptions,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgImageOptions,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgImageOptions::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgImageOptions::OnCancel\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgImageOptions::WXD_ID_DCT,\
+ WxdkdrawDlgImageOptions::OnDCT\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgImageOptions::WXD_ID_INT,\
+ WxdkdrawDlgImageOptions::OnInterpolation\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+
+WxdkdrawDlgImageOptions::WxdkdrawDlgImageOptions(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[461],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ wxString saConversionMethods[] = {
+ wxString(pTexts[480]),
+ wxString(pTexts[481]),
+ wxString(pTexts[482]),
+ wxString(pTexts[483]),
+ wxString(pTexts[484]),
+ wxString(pTexts[485]),
+ wxString(pTexts[486]),
+ wxString(pTexts[487]),
+ wxString(pTexts[488]),
+ wxString(pTexts[489]),
+ wxString(pTexts[490]),
+ wxString(pTexts[491]),
+ wxString(pTexts[492]),
+ wxString(pTexts[493])
+ };
+ int sel;
+
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_sTexts = pTexts;
+
+%% constructor end
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Load flags into GUI
+ */
+ sel = (int)((m_pObject->det).i.r2g) + 1;
+ if ( 0 > sel) { sel = 0; }
+ if (13 < sel) { sel = 13; }
+ chConversionMethods->SetSelection(sel);
+ cbKeepAspectRatio->SetValue(
+ 0 != (WXD_IMFL_ASPECT & ((m_pObject->det).i.fl))
+ );
+ cbUseAlphaChannel->SetValue(
+ 0 != (WXD_IMFL_USE_ALPHA & ((m_pObject->det).i.fl))
+ );
+ cbDCTData->SetValue(
+ 0 != (WXD_IMFL_USE_DCT & ((m_pObject->det).i.fl))
+ );
+ cbInterpolation->SetValue(
+ 0 != (WXD_IMFL_IMG_INT & ((m_pObject->det).i.fl))
+ );
+ cbDCTInterpolation->SetValue(
+ 0 != (WXD_IMFL_DCT_INT & ((m_pObject->det).i.fl))
+ );
+ cbEnforceBackground->SetValue(
+ 0 != (WXD_IMFL_FORCE_BG & ((m_pObject->det).i.fl))
+ );
+ CorrectGUI(false);
+ }
+}
+
+
+%% module end
+
+
+void
+WxdkdrawDlgImageOptions::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ uint8_t back = (uint8_t)0U;
+
+ if (cbKeepAspectRatio->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_ASPECT);
+ }
+ if (cbUseAlphaChannel->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_USE_ALPHA);
+ }
+ if (cbDCTData->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_USE_DCT);
+ }
+ if (cbInterpolation->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_IMG_INT);
+ }
+ if (cbDCTInterpolation->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_DCT_INT);
+ }
+ if (cbEnforceBackground->GetValue()) {
+ back |= (uint8_t)(WXD_IMFL_FORCE_BG);
+ }
+ (m_pObject->det).i.fl = back;
+ (m_pObject->det).i.r2g = (int8_t)(chConversionMethods->GetSelection() - 1);
+ if (-1 > (m_pObject->det).i.r2g) { (m_pObject->det).i.r2g = -1; }
+ if (12 < (m_pObject->det).i.r2g) { (m_pObject->det).i.r2g = 12; }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgImageOptions::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgImageOptions::CorrectGUI(bool bUpdate)
+{
+ if ((cbDCTData->GetValue()) && (cbInterpolation->GetValue())) {
+ cbDCTInterpolation->Enable();
+ }
+ else {
+ cbDCTInterpolation->Enable(false);
+ }
+ if (bUpdate) {
+ Refresh();
+ Update();
+ }
+}
+
+
+
+void
+WxdkdrawDlgImageOptions::OnDCT(wxCommandEvent & WXUNUSED(event))
+{
+ CorrectGUI();
+}
+
+
+
+void
+WxdkdrawDlgImageOptions::OnInterpolation(wxCommandEvent & WXUNUSED(event))
+{
+ CorrectGUI();
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgLayerManager.cpp b/support/dktools/WxdkdrawDlgLayerManager.cpp
new file mode 100644
index 0000000000..fad6d42feb
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLayerManager.cpp
@@ -0,0 +1,338 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLayerManager.cpt
+*/
+
+
+#line 164 "WxdkdrawDlgLayerManager.cpt"
+
+/** @file WxdkdrawDlgLayerManager.cpp The WxdkdrawDlgLayerManager module.
+*/
+
+
+#ifndef WXDKDRAWDLGLAYERMANAGER_H_INCLUDED
+#include "WxdkdrawDlgLayerManager.h"
+#endif
+
+
+
+
+#line 175 "WxdkdrawDlgLayerManager.cpt"
+
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLayerManager,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLayerManager,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgLayerManager::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLayerManager::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+WxdkdrawDlgLayerManager::WxdkdrawDlgLayerManager(
+ WxdkdrawFrame *pParent,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pTexts,
+ Wxd_layer_cb_t *pLayerCb,
+ size_t sLayerCb
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[334],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ ((wxDEFAULT_DIALOG_STYLE)
+ | (wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ size_t i;
+
+
+#line 218 "WxdkdrawDlgLayerManager.cpt"
+ m_pParent = pParent;
+ m_pDrw = pDrw;
+ m_pTexts = pTexts;
+ m_pLayerCb = pLayerCb;
+ m_sLayerCb = sLayerCb;
+
+#line 223 "WxdkdrawDlgLayerManager.cpt"
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ scwContents = NULL;
+ sizerButtons = NULL;
+ sizerScwContents = NULL;
+ panelContents = NULL;
+ sizerContents = NULL;
+#if 0
+ b00 = NULL;
+#endif
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ scwContents = new wxScrolledWindow(
+ this,
+ wxID_ANY,
+ wxDefaultPosition,
+ wxSize(150, 200)
+ );
+ if(!(scwContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerScwContents = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerScwContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ panelContents = new wxPanel(
+ scwContents,
+ wxID_ANY
+ );
+ if(!(panelContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(10, 10, 0);
+
+
+#line 280 "WxdkdrawDlgLayerManager.cpt"
+ for (i = 0; i < m_sLayerCb; i++) {
+
+
+#line 282 "WxdkdrawDlgLayerManager.cpt"
+ if ((size_t)0U != i) {
+ sizerContents->Add(10, 10, 0);
+ }
+ if (NULL != m_pLayerCb[i].lay) {
+
+
+#line 287 "WxdkdrawDlgLayerManager.cpt"
+ int idv = WXD_ID_LAYER_START + (int)i;
+ wxString str;
+ str.Printf(wxT("%6d"), (int)((m_pLayerCb[i].lay)->lay));
+ m_pLayerCb[i].cb = new wxCheckBox(panelContents, idv, str);
+ if (NULL == m_pLayerCb[i].cb) { goto dkctGUILayoutFinished; }
+ sizerContents->Add(m_pLayerCb[i].cb);
+ Connect(
+ idv, wxEVT_CHECKBOX,
+ wxCommandEventHandler(WxdkdrawDlgLayerManager::OnCheckBox)
+ );
+ }
+ }
+
+#if 0
+ b00 = new wxCheckBox(
+ panelContents,
+ wxID_ANY,
+ wxT("Button 0")
+ );
+ if(!(b00)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00->SetToolTip(wxT("A button to click"));
+ sizerContents->Add(
+ b00
+ );
+#endif
+
+ sizerContents->Add(10, 10, 0);
+ panelContents->SetSizer(sizerContents);
+ sizerScwContents->Add(
+ panelContents
+ );
+ scwContents->SetSizer(sizerScwContents);
+ sizerVertical->Add(
+ scwContents,
+ 1,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[335]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[337]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[336]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[338]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical,
+ 1,
+ wxGROW
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+
+ dkctGUILayoutFinished:
+ if (dkctGUILayoutOK) {
+ for (i = 0; i < m_sLayerCb; i++) {
+ if ((NULL != m_pLayerCb[i].lay) && (NULL != m_pLayerCb[i].cb)) {
+ if (0x00 != (m_pLayerCb[i].lay)->active) {
+ (m_pLayerCb[i].cb)->SetValue(true);
+ }
+ else {
+ (m_pLayerCb[i].cb)->SetValue(false);
+ }
+ }
+ }
+ panelContents->Layout();
+ wxSize panelsize = panelContents->GetSize();
+ scwContents->SetScrollbars(
+ 10, 10,
+ (panelsize.GetWidth() / 10), (panelsize.GetHeight() / 10)
+ );
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+
+#line 394 "WxdkdrawDlgLayerManager.cpt"
+}
+
+
+
+void
+WxdkdrawDlgLayerManager::UnconnectCheckBoxEvents(void)
+{
+ size_t i; /* Traverse all checkboxes */
+
+ for (i = 0; i < m_sLayerCb; i++) {
+ Disconnect(
+ (WXD_ID_LAYER_START + (int)i), wxEVT_CHECKBOX,
+ wxCommandEventHandler(WxdkdrawDlgLayerManager::OnCheckBox)
+ );
+ }
+}
+
+
+
+
+void
+WxdkdrawDlgLayerManager::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ UnconnectCheckBoxEvents();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLayerManager::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ UnconnectCheckBoxEvents();
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+
+void
+WxdkdrawDlgLayerManager::OnCheckBox(wxCommandEvent & event)
+{
+ int idv; /* Window ID from checkbox, index in array */
+ bool b; /* Checkbox value */
+
+
+#line 451 "WxdkdrawDlgLayerManager.cpt"
+ idv = event.GetId();
+ idv = idv - WXD_ID_LAYER_START;
+ if (0 <= idv) {
+ if ((size_t)idv < m_sLayerCb) {
+ if ((NULL != m_pLayerCb[idv].lay) && (NULL != m_pLayerCb[idv].cb)) {
+ b = (m_pLayerCb[idv].cb)->GetValue();
+ (m_pLayerCb[idv].lay)->active = ((b) ? (0x01) : (0x00));
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ }
+ }
+
+
+#line 463 "WxdkdrawDlgLayerManager.cpt"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgLayerManager.cpt b/support/dktools/WxdkdrawDlgLayerManager.cpt
new file mode 100644
index 0000000000..8ef38008bf
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLayerManager.cpt
@@ -0,0 +1,468 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+
+/** @file WxdkdrawDlgLayerManager.h Header file for the WxdkdrawDlgLayerManager
+ module.
+*/
+
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+/** Dialog to change layer visibility.
+*/
+class WxdkdrawDlgLayerManager : public wxDialog
+{
+
+ private:
+
+ /** Events to handle
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Applications main frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing to modify.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ /** Layer structures containing checkbox pointers and previous value.
+ */
+ Wxd_layer_cb_t *m_pLayerCb;
+
+ /** Number of layers in drawing.
+ */
+ size_t m_sLayerCb;
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element scwContents.
+ */
+ wxScrolledWindow *scwContents;
+
+ /** GUI element sizerButtons.
+ */
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element sizerScwContents.
+ */
+ wxBoxSizer *sizerScwContents;
+
+ /** GUI element panelContents.
+ */
+ wxPanel *panelContents;
+
+ /** GUI element sizerContents.
+ */
+ wxBoxSizer *sizerContents;
+
+#if 0
+ /** GUI element b00.
+ */
+ wxCheckBox *b00;
+#endif
+
+ /** GUI element buttonOK.
+ */
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+ wxButton *buttonCancel;
+
+
+ public:
+
+ /** Window IDs for events.
+ */
+ enum {
+ /** Start ID for layer checkboxes.
+ */
+ WXD_ID_LAYER_START = (wxID_HIGHEST + 1)
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pDrw Drawing to modify.
+ @param pTexts Localized text fragments.
+ @param pLayerCb Layer information structures.
+ @param sLayerCb Number of layers in drawing and in pLayerCb.
+ */
+ WxdkdrawDlgLayerManager(
+ WxdkdrawFrame *pParent,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pTexts,
+ Wxd_layer_cb_t *pLayerCb,
+ size_t sLayerCb
+ );
+
+ /** Handler for OK button.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Handler for checkbox state change.
+ @param event Event to process.
+ */
+ void
+ OnCheckBox(wxCommandEvent & event);
+
+ protected:
+
+ /** Unconnect event handler from all checkboxes.
+ */
+ void
+ UnconnectCheckBoxEvents(void);
+
+};
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+/** @file WxdkdrawDlgLayerManager.cpp The WxdkdrawDlgLayerManager module.
+*/
+
+
+#ifndef WXDKDRAWDLGLAYERMANAGER_H_INCLUDED
+#include "WxdkdrawDlgLayerManager.h"
+#endif
+
+
+$!trace-include
+
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLayerManager,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLayerManager,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgLayerManager::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLayerManager::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+WxdkdrawDlgLayerManager::WxdkdrawDlgLayerManager(
+ WxdkdrawFrame *pParent,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pTexts,
+ Wxd_layer_cb_t *pLayerCb,
+ size_t sLayerCb
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[334],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ ((wxDEFAULT_DIALOG_STYLE)
+ | (wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ size_t i;
+ $? "+ WxdkdrawDlgLayerManager"
+ m_pParent = pParent;
+ m_pDrw = pDrw;
+ m_pTexts = pTexts;
+ m_pLayerCb = pLayerCb;
+ m_sLayerCb = sLayerCb; $? ". sLayerCb = %u", (unsigned)sLayerCb
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ scwContents = NULL;
+ sizerButtons = NULL;
+ sizerScwContents = NULL;
+ panelContents = NULL;
+ sizerContents = NULL;
+#if 0
+ b00 = NULL;
+#endif
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ scwContents = new wxScrolledWindow(
+ this,
+ wxID_ANY,
+ wxDefaultPosition,
+ wxSize(150, 200)
+ );
+ if(!(scwContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerScwContents = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerScwContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ panelContents = new wxPanel(
+ scwContents,
+ wxID_ANY
+ );
+ if(!(panelContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(10, 10, 0);
+ $? ". have %u layers", (unsigned)m_sLayerCb
+ for (i = 0; i < m_sLayerCb; i++) {
+ $? ". loop start %u", (unsigned)i
+ if ((size_t)0U != i) {
+ sizerContents->Add(10, 10, 0);
+ }
+ if (NULL != m_pLayerCb[i].lay) {
+ $? ". layer number %d", (int)((m_pLayerCb[i].lay)->lay)
+ int idv = WXD_ID_LAYER_START + (int)i;
+ wxString str;
+ str.Printf(wxT("%6d"), (int)((m_pLayerCb[i].lay)->lay));
+ m_pLayerCb[i].cb = new wxCheckBox(panelContents, idv, str);
+ if (NULL == m_pLayerCb[i].cb) { goto dkctGUILayoutFinished; }
+ sizerContents->Add(m_pLayerCb[i].cb);
+ Connect(
+ idv, wxEVT_CHECKBOX,
+ wxCommandEventHandler(WxdkdrawDlgLayerManager::OnCheckBox)
+ );
+ }
+ }
+
+#if 0
+ b00 = new wxCheckBox(
+ panelContents,
+ wxID_ANY,
+ wxT("Button 0")
+ );
+ if(!(b00)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00->SetToolTip(wxT("A button to click"));
+ sizerContents->Add(
+ b00
+ );
+#endif
+
+ sizerContents->Add(10, 10, 0);
+ panelContents->SetSizer(sizerContents);
+ sizerScwContents->Add(
+ panelContents
+ );
+ scwContents->SetSizer(sizerScwContents);
+ sizerVertical->Add(
+ scwContents,
+ 1,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[335]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[337]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[336]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[338]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical,
+ 1,
+ wxGROW
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+
+ dkctGUILayoutFinished:
+ if (dkctGUILayoutOK) {
+ for (i = 0; i < m_sLayerCb; i++) {
+ if ((NULL != m_pLayerCb[i].lay) && (NULL != m_pLayerCb[i].cb)) {
+ if (0x00 != (m_pLayerCb[i].lay)->active) {
+ (m_pLayerCb[i].cb)->SetValue(true);
+ }
+ else {
+ (m_pLayerCb[i].cb)->SetValue(false);
+ }
+ }
+ }
+ panelContents->Layout();
+ wxSize panelsize = panelContents->GetSize();
+ scwContents->SetScrollbars(
+ 10, 10,
+ (panelsize.GetWidth() / 10), (panelsize.GetHeight() / 10)
+ );
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+ $? "- WxdkdrawDlgLayerManager"
+}
+
+
+
+void
+WxdkdrawDlgLayerManager::UnconnectCheckBoxEvents(void)
+{
+ size_t i; /* Traverse all checkboxes */
+
+ for (i = 0; i < m_sLayerCb; i++) {
+ Disconnect(
+ (WXD_ID_LAYER_START + (int)i), wxEVT_CHECKBOX,
+ wxCommandEventHandler(WxdkdrawDlgLayerManager::OnCheckBox)
+ );
+ }
+}
+
+
+
+
+void
+WxdkdrawDlgLayerManager::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ UnconnectCheckBoxEvents();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLayerManager::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ UnconnectCheckBoxEvents();
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+
+void
+WxdkdrawDlgLayerManager::OnCheckBox(wxCommandEvent & event)
+{
+ int idv; /* Window ID from checkbox, index in array */
+ bool b; /* Checkbox value */
+ $? "+ OnCheckBox"
+ idv = event.GetId();
+ idv = idv - WXD_ID_LAYER_START;
+ if (0 <= idv) {
+ if ((size_t)idv < m_sLayerCb) {
+ if ((NULL != m_pLayerCb[idv].lay) && (NULL != m_pLayerCb[idv].cb)) {
+ b = (m_pLayerCb[idv].cb)->GetValue();
+ (m_pLayerCb[idv].lay)->active = ((b) ? (0x01) : (0x00));
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ }
+ }
+ $? "- OnCheckBox"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgLayerManager.h b/support/dktools/WxdkdrawDlgLayerManager.h
new file mode 100644
index 0000000000..50d1949e25
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLayerManager.h
@@ -0,0 +1,177 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLayerManager.cpt
+*/
+
+#ifndef WXDKDRAWDLGLAYERMANAGER_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGLAYERMANAGER_H_INCLUDED 1
+
+
+#line 7 "WxdkdrawDlgLayerManager.cpt"
+
+
+/** @file WxdkdrawDlgLayerManager.h Header file for the WxdkdrawDlgLayerManager
+ module.
+*/
+
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+/** Dialog to change layer visibility.
+*/
+class WxdkdrawDlgLayerManager : public wxDialog
+{
+
+ private:
+
+ /** Events to handle
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Applications main frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing to modify.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ /** Layer structures containing checkbox pointers and previous value.
+ */
+ Wxd_layer_cb_t *m_pLayerCb;
+
+ /** Number of layers in drawing.
+ */
+ size_t m_sLayerCb;
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element scwContents.
+ */
+ wxScrolledWindow *scwContents;
+
+ /** GUI element sizerButtons.
+ */
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element sizerScwContents.
+ */
+ wxBoxSizer *sizerScwContents;
+
+ /** GUI element panelContents.
+ */
+ wxPanel *panelContents;
+
+ /** GUI element sizerContents.
+ */
+ wxBoxSizer *sizerContents;
+
+#if 0
+ /** GUI element b00.
+ */
+ wxCheckBox *b00;
+#endif
+
+ /** GUI element buttonOK.
+ */
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+ wxButton *buttonCancel;
+
+
+ public:
+
+ /** Window IDs for events.
+ */
+ enum {
+ /** Start ID for layer checkboxes.
+ */
+ WXD_ID_LAYER_START = (wxID_HIGHEST + 1)
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pDrw Drawing to modify.
+ @param pTexts Localized text fragments.
+ @param pLayerCb Layer information structures.
+ @param sLayerCb Number of layers in drawing and in pLayerCb.
+ */
+ WxdkdrawDlgLayerManager(
+ WxdkdrawFrame *pParent,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pTexts,
+ Wxd_layer_cb_t *pLayerCb,
+ size_t sLayerCb
+ );
+
+ /** Handler for OK button.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Handler for checkbox state change.
+ @param event Event to process.
+ */
+ void
+ OnCheckBox(wxCommandEvent & event);
+
+ protected:
+
+ /** Unconnect event handler from all checkboxes.
+ */
+ void
+ UnconnectCheckBoxEvents(void);
+
+};
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgLayers.cpp b/support/dktools/WxdkdrawDlgLayers.cpp
new file mode 100644
index 0000000000..6a9124ba64
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLayers.cpp
@@ -0,0 +1,244 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLayers.wxc
+*/
+
+/** @file WxdkdrawDlgLayers.cpp The WxdkdrawDlgLayers module.
+*/
+
+
+#line 152 "WxdkdrawDlgLayers.wxc"
+
+#ifndef WXDKDRAWDLGLAYERS_H_INCLUDED
+#include "WxdkdrawDlgLayers.h"
+#endif
+
+
+
+
+#line 159 "WxdkdrawDlgLayers.wxc"
+
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLayerManager,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLayerManager,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgLayerManager::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLayerManager::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 184 "WxdkdrawDlgLayers.wxc"
+WxdkdrawDlgLayerManager::WxdkdrawDlgLayerManager(
+ WxdkdrawFrame *pParent,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[334],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ ((wxDEFAULT_DIALOG_STYLE)
+ | (wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pDrw = pDrw;
+ m_pTexts = pTexts;
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ scwContents = NULL;
+ sizerButtons = NULL;
+ sizerScwContents = NULL;
+ panelContents = NULL;
+ sizerContents = NULL;
+ b00 = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ scwContents = new wxScrolledWindow(
+ this,
+ wxID_ANY,
+ wxDefaultPosition,
+ wxSize(150, 200)
+ );
+ if(!(scwContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerScwContents = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerScwContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ panelContents = new wxPanel(
+ scwContents,
+ wxID_ANY
+ );
+ if(!(panelContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(10, 10, 0);
+ b00 = new wxCheckBox(
+ panelContents,
+ wxID_ANY,
+ wxT("Button 0")
+ );
+ if(!(b00)) {
+ goto dkctGUILayoutFinished;
+ }
+ b00->SetToolTip(wxT("A button to click"));
+ sizerContents->Add(
+ b00
+ );
+ sizerContents->Add(10, 10, 0);
+ panelContents->SetSizer(sizerContents);
+ sizerScwContents->Add(
+ panelContents
+ );
+ scwContents->SetSizer(sizerScwContents);
+ sizerVertical->Add(
+ scwContents,
+ 1,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[335]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[337]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[336]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[338]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical,
+ 1,
+ wxGROW
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 203 "WxdkdrawDlgLayers.wxc"
+
+ if (dkctGUILayoutOK) {
+ panelContents->Layout();
+ wxSize panelsize = panelContents->GetSize();
+ scwContents->SetScrollbars(
+ 10, 10,
+ (panelsize.GetWidth() / 10), (panelsize.GetHeight() / 10)
+ );
+ }
+}
+
+
+
+#line 216 "WxdkdrawDlgLayers.wxc"
+
+
+
+void
+WxdkdrawDlgLayerManager::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLayerManager::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawDlgLayers.h b/support/dktools/WxdkdrawDlgLayers.h
new file mode 100644
index 0000000000..2091e6ec96
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLayers.h
@@ -0,0 +1,162 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLayers.wxc
+*/
+
+/** @file WxdkdrawDlgLayers.h Header file for the WxdkdrawDlgLayers module.
+*/
+
+#ifndef WXDKDRAWDLGLAYERS_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGLAYERS_H_INCLUDED 1
+
+
+#line 70 "WxdkdrawDlgLayers.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#line 81 "WxdkdrawDlgLayers.wxc"
+
+
+/** Dialog to change layer visibility.
+*/
+class WxdkdrawDlgLayerManager : public wxDialog
+{
+
+ private:
+
+ /** Events to handle
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Applications main frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing to modify.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ public:
+
+ /** Window IDs for events.
+ */
+ enum {
+ /** Start ID for layer checkboxes.
+ */
+ WXD_ID_LAYER_START = (wxID_HIGHEST + 1)
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pDrw Drawing to modify.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgLayerManager(
+ WxdkdrawFrame *pParent,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pTexts
+ );
+
+ /** Handler for OK button.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgLayers.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 20 "WxdkdrawDlgLayers.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element scwContents.
+ */
+#line 30 "WxdkdrawDlgLayers.wxc"
+ wxScrolledWindow *scwContents;
+
+ /** GUI element sizerButtons.
+ */
+#line 54 "WxdkdrawDlgLayers.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element sizerScwContents.
+ */
+#line 35 "WxdkdrawDlgLayers.wxc"
+ wxBoxSizer *sizerScwContents;
+
+ /** GUI element panelContents.
+ */
+#line 39 "WxdkdrawDlgLayers.wxc"
+ wxPanel *panelContents;
+
+ /** GUI element sizerContents.
+ */
+#line 42 "WxdkdrawDlgLayers.wxc"
+ wxBoxSizer *sizerContents;
+
+ /** GUI element b00.
+ */
+#line 48 "WxdkdrawDlgLayers.wxc"
+ wxCheckBox *b00;
+
+ /** GUI element buttonOK.
+ */
+#line 58 "WxdkdrawDlgLayers.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 63 "WxdkdrawDlgLayers.wxc"
+ wxButton *buttonCancel;
+
+
+#line 146 "WxdkdrawDlgLayers.wxc"
+};
+
+
+
+#line 150 "WxdkdrawDlgLayers.wxc"
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgLayers.wxc b/support/dktools/WxdkdrawDlgLayers.wxc
new file mode 100644
index 0000000000..c2dd603e4a
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLayers.wxc
@@ -0,0 +1,245 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+grow = yes
+proportion = 1
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+grow = yes
+proportion = 1
+contents = $space(10)
+contents = scwContents centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxScrolledWindow scwContents]
+proportion = 1
+contents = sizerScwContents
+size = 150 200
+
+[wxBoxSizer sizerScwContents]
+direction = vertical
+contents = panelContents
+
+[wxPanel panelContents]
+contents = sizerContents
+
+[wxBoxSizer sizerContents]
+direction = vertical
+contents = $space(10)
+contents = b00
+contents = $space(10)
+
+[wxCheckBox b00]
+id = wxID_ANY
+text = wxT("Button 0")
+tip = wxT("A button to click")
+
+
+[wxStdDialogButtonSizer sizerButtons]
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[335]
+tip = pTexts[337]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[336]
+tip = pTexts[338]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+%% class start
+
+
+/** Dialog to change layer visibility.
+*/
+class WxdkdrawDlgLayerManager : public wxDialog
+{
+
+ private:
+
+ /** Events to handle
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Applications main frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing to modify.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ public:
+
+ /** Window IDs for events.
+ */
+ enum {
+ /** Start ID for layer checkboxes.
+ */
+ WXD_ID_LAYER_START = (wxID_HIGHEST + 1)
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pDrw Drawing to modify.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgLayerManager(
+ WxdkdrawFrame *pParent,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pTexts
+ );
+
+ /** Handler for OK button.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+%% class end
+};
+
+
+%% header end
+
+%% module start
+
+#ifndef WXDKDRAWDLGLAYERS_H_INCLUDED
+#include "WxdkdrawDlgLayers.h"
+#endif
+
+
+$!trace-include
+
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLayerManager,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLayerManager,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgLayerManager::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLayerManager::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+WxdkdrawDlgLayerManager::WxdkdrawDlgLayerManager(
+ WxdkdrawFrame *pParent,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[334],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ ((wxDEFAULT_DIALOG_STYLE)
+ | (wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pDrw = pDrw;
+ m_pTexts = pTexts;
+%% constructor end
+
+ if (dkctGUILayoutOK) {
+ panelContents->Layout();
+ wxSize panelsize = panelContents->GetSize();
+ scwContents->SetScrollbars(
+ 10, 10,
+ (panelsize.GetWidth() / 10), (panelsize.GetHeight() / 10)
+ );
+ }
+}
+
+
+%% module end
+
+
+
+void
+WxdkdrawDlgLayerManager::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLayerManager::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawDlgLineCap.cpp b/support/dktools/WxdkdrawDlgLineCap.cpp
new file mode 100644
index 0000000000..9e4c68c76e
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineCap.cpp
@@ -0,0 +1,255 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLineCap.wxc
+*/
+
+/** @file WxdkdrawDlgLineCap.cpp The WxdkdrawDlgLineCap module.
+*/
+
+
+#line 146 "WxdkdrawDlgLineCap.wxc"
+
+#ifndef WXDKDRAWDLGLINECAP_H_INCLUDED
+#include "WxdkdrawDlgLineCap.h"
+#endif
+
+
+
+
+#line 153 "WxdkdrawDlgLineCap.wxc"
+
+
+
+/** Assign functions to events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLineCap,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLineCap,wxDialog)
+#endif
+ EVT_BUTTON(\
+ WxdkdrawDlgLineCap::WXD_ID_LC_BUTTED,\
+ WxdkdrawDlgLineCap::OnLineCap\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineCap::WXD_ID_LC_ROUNDED,\
+ WxdkdrawDlgLineCap::OnLineCap\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineCap::WXD_ID_LC_PROJECTING,\
+ WxdkdrawDlgLineCap::OnLineCap\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLineCap::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+
+#line 188 "WxdkdrawDlgLineCap.wxc"
+WxdkdrawDlgLineCap::WxdkdrawDlgLineCap(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[245],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_uLineCapOriginal = pObject->cs;
+ if (WXD_LC_PROJECTING < m_uLineCapOriginal) {
+ m_uLineCapOriginal = WXD_LC_PROJECTING;
+ }
+ m_uLineCapCurrent = m_uLineCapOriginal;
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerButtons = NULL;
+ buttonCancel = NULL;
+ buttonButted = NULL;
+ buttonRounded = NULL;
+ buttonProjecting = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonButted = new wxBitmapButton(
+ this,
+ WXD_ID_LC_BUTTED,
+ pImages[0]
+ );
+ if(!(buttonButted)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonButted->SetToolTip(pTexts[246]);
+ sizerButtons->Add(
+ buttonButted,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonRounded = new wxBitmapButton(
+ this,
+ WXD_ID_LC_ROUNDED,
+ pImages[1]
+ );
+ if(!(buttonRounded)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonRounded->SetToolTip(pTexts[247]);
+ sizerButtons->Add(
+ buttonRounded,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonProjecting = new wxBitmapButton(
+ this,
+ WXD_ID_LC_PROJECTING,
+ pImages[2]
+ );
+ if(!(buttonProjecting)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonProjecting->SetToolTip(pTexts[248]);
+ sizerButtons->Add(
+ buttonProjecting,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[249]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[250]);
+ sizerVertical->Add(
+ buttonCancel,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 214 "WxdkdrawDlgLineCap.wxc"
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+
+
+#line 223 "WxdkdrawDlgLineCap.wxc"
+
+
+void
+WxdkdrawDlgLineCap::OnLineCap(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+ switch (event.GetId()) {
+ case WXD_ID_LC_ROUNDED : {
+ m_uLineCapCurrent = WXD_LC_ROUNDED;
+ } break;
+ case WXD_ID_LC_PROJECTING : {
+ m_uLineCapCurrent = WXD_LC_PROJECTING;
+ } break;
+ default : {
+ m_uLineCapCurrent = WXD_LC_BUTTED;
+ } break;
+ }
+ if ((m_bDrwElem) && (m_uLineCapCurrent != m_uLineCapOriginal)) {
+ bDoRefresh = true;
+ }
+ m_pObject->cs = m_uLineCapCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLineCap::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgLineCap.h b/support/dktools/WxdkdrawDlgLineCap.h
new file mode 100644
index 0000000000..b6d1ad0de9
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineCap.h
@@ -0,0 +1,156 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLineCap.wxc
+*/
+
+/** @file WxdkdrawDlgLineCap.h Header file for the WxdkdrawDlgLineCap module.
+*/
+
+#ifndef WXDKDRAWDLGLINECAP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGLINECAP_H_INCLUDED 1
+
+
+#line 55 "WxdkdrawDlgLineCap.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#line 66 "WxdkdrawDlgLineCap.wxc"
+
+/** Dialog to set up line cap.
+*/
+class WxdkdrawDlgLineCap : public wxDialog
+{
+
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Program main window.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Original line cap assigned to object.
+ */
+ uint8_t m_uLineCapOriginal;
+
+ /** Line cap selected in the dialog.
+ */
+ uint8_t m_uLineCapCurrent;
+
+ /** Drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for buttons.
+ */
+ enum {
+ WXD_ID_LC_BUTTED = (wxID_HIGHEST + 1), /**< Butted line cap. */
+ WXD_ID_LC_ROUNDED , /**< Rounded line cap. */
+ WXD_ID_LC_PROJECTING /**< Projecting line cap. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ */
+ WxdkdrawDlgLineCap(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for line cap buttons.
+ @param event Event to process.
+ */
+ void
+ OnLineCap(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgLineCap.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 18 "WxdkdrawDlgLineCap.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerButtons.
+ */
+#line 26 "WxdkdrawDlgLineCap.wxc"
+ wxBoxSizer *sizerButtons;
+
+ /** GUI element buttonCancel.
+ */
+#line 49 "WxdkdrawDlgLineCap.wxc"
+ wxButton *buttonCancel;
+
+ /** GUI element buttonButted.
+ */
+#line 34 "WxdkdrawDlgLineCap.wxc"
+ wxBitmapButton *buttonButted;
+
+ /** GUI element buttonRounded.
+ */
+#line 39 "WxdkdrawDlgLineCap.wxc"
+ wxBitmapButton *buttonRounded;
+
+ /** GUI element buttonProjecting.
+ */
+#line 44 "WxdkdrawDlgLineCap.wxc"
+ wxBitmapButton *buttonProjecting;
+
+
+#line 141 "WxdkdrawDlgLineCap.wxc"
+};
+
+
+#line 144 "WxdkdrawDlgLineCap.wxc"
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgLineCap.wxc b/support/dktools/WxdkdrawDlgLineCap.wxc
new file mode 100644
index 0000000000..b7e5bc8ccf
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineCap.wxc
@@ -0,0 +1,273 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+contents = buttonCancel centered-x
+contents = $space(10)
+
+[wxBoxSizer sizerButtons]
+direction = horizontal
+contents = buttonButted centered-y
+contents = $space(10)
+contents = buttonRounded centered-y
+contents = $space(10)
+contents = buttonProjecting centered-y
+
+[wxBitmapButton buttonButted]
+id = WXD_ID_LC_BUTTED
+bitmap = pImages[0]
+tip = pTexts[246]
+
+[wxBitmapButton buttonRounded]
+id = WXD_ID_LC_ROUNDED
+bitmap = pImages[1]
+tip = pTexts[247]
+
+[wxBitmapButton buttonProjecting]
+id = WXD_ID_LC_PROJECTING
+bitmap = pImages[2]
+tip = pTexts[248]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[249]
+tip = pTexts[250]
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+%% class start
+
+/** Dialog to set up line cap.
+*/
+class WxdkdrawDlgLineCap : public wxDialog
+{
+
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Program main window.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Original line cap assigned to object.
+ */
+ uint8_t m_uLineCapOriginal;
+
+ /** Line cap selected in the dialog.
+ */
+ uint8_t m_uLineCapCurrent;
+
+ /** Drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for buttons.
+ */
+ enum {
+ WXD_ID_LC_BUTTED = (wxID_HIGHEST + 1), /**< Butted line cap. */
+ WXD_ID_LC_ROUNDED , /**< Rounded line cap. */
+ WXD_ID_LC_PROJECTING /**< Projecting line cap. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ */
+ WxdkdrawDlgLineCap(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for line cap buttons.
+ @param event Event to process.
+ */
+ void
+ OnLineCap(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+%% class end
+};
+
+%% header end
+
+%% module start
+
+#ifndef WXDKDRAWDLGLINECAP_H_INCLUDED
+#include "WxdkdrawDlgLineCap.h"
+#endif
+
+
+$!trace-include
+
+
+
+/** Assign functions to events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLineCap,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLineCap,wxDialog)
+#endif
+ EVT_BUTTON(\
+ WxdkdrawDlgLineCap::WXD_ID_LC_BUTTED,\
+ WxdkdrawDlgLineCap::OnLineCap\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineCap::WXD_ID_LC_ROUNDED,\
+ WxdkdrawDlgLineCap::OnLineCap\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineCap::WXD_ID_LC_PROJECTING,\
+ WxdkdrawDlgLineCap::OnLineCap\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLineCap::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+%% constructor start
+WxdkdrawDlgLineCap::WxdkdrawDlgLineCap(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[245],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_uLineCapOriginal = pObject->cs;
+ if (WXD_LC_PROJECTING < m_uLineCapOriginal) {
+ m_uLineCapOriginal = WXD_LC_PROJECTING;
+ }
+ m_uLineCapCurrent = m_uLineCapOriginal;
+%% constructor end
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+
+%% module end
+
+
+void
+WxdkdrawDlgLineCap::OnLineCap(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+ switch (event.GetId()) {
+ case WXD_ID_LC_ROUNDED : {
+ m_uLineCapCurrent = WXD_LC_ROUNDED;
+ } break;
+ case WXD_ID_LC_PROJECTING : {
+ m_uLineCapCurrent = WXD_LC_PROJECTING;
+ } break;
+ default : {
+ m_uLineCapCurrent = WXD_LC_BUTTED;
+ } break;
+ }
+ if ((m_bDrwElem) && (m_uLineCapCurrent != m_uLineCapOriginal)) {
+ bDoRefresh = true;
+ }
+ m_pObject->cs = m_uLineCapCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLineCap::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgLineJoin.cpp b/support/dktools/WxdkdrawDlgLineJoin.cpp
new file mode 100644
index 0000000000..68f97e16c0
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineJoin.cpp
@@ -0,0 +1,256 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLineJoin.wxc
+*/
+
+/** @file WxdkdrawDlgLineJoin.cpp The WxdkdrawDlgLineJoin module.
+*/
+
+
+#line 159 "WxdkdrawDlgLineJoin.wxc"
+
+#ifndef WXDKDRAWDLGLINEJOIN_H_INCLUDED
+#include "WxdkdrawDlgLineJoin.h"
+#endif
+
+
+
+
+
+#line 167 "WxdkdrawDlgLineJoin.wxc"
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLineJoin,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLineJoin,wxDialog)
+#endif
+ EVT_BUTTON(\
+ WxdkdrawDlgLineJoin::WXD_ID_LJ_MITERED,\
+ WxdkdrawDlgLineJoin::OnJoinButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineJoin::WXD_ID_LJ_ROUNDED,\
+ WxdkdrawDlgLineJoin::OnJoinButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineJoin::WXD_ID_LJ_BEVELED,\
+ WxdkdrawDlgLineJoin::OnJoinButton\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLineJoin::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+
+#line 200 "WxdkdrawDlgLineJoin.wxc"
+WxdkdrawDlgLineJoin::WxdkdrawDlgLineJoin(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[232],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_pTexts = pTexts;
+ m_pImages = pImages;
+ m_bDrwElem = bDrwElem;
+ m_uLineJoinOriginal = pObject->js;
+ if (WXD_LJ_BEVELED < m_uLineJoinOriginal) {
+ m_uLineJoinOriginal = WXD_LJ_BEVELED;
+ }
+ m_uLineJoinCurrent = m_uLineJoinOriginal;
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerButtons = NULL;
+ buttonCancel = NULL;
+ buttonMitered = NULL;
+ buttonRounded = NULL;
+ buttonBeveled = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonMitered = new wxBitmapButton(
+ this,
+ WXD_ID_LJ_MITERED,
+ pImages[0]
+ );
+ if(!(buttonMitered)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonMitered->SetToolTip(pTexts[233]);
+ sizerButtons->Add(
+ buttonMitered,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonRounded = new wxBitmapButton(
+ this,
+ WXD_ID_LJ_ROUNDED,
+ pImages[1]
+ );
+ if(!(buttonRounded)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonRounded->SetToolTip(pTexts[234]);
+ sizerButtons->Add(
+ buttonRounded,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonBeveled = new wxBitmapButton(
+ this,
+ WXD_ID_LJ_BEVELED,
+ pImages[2]
+ );
+ if(!(buttonBeveled)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonBeveled->SetToolTip(pTexts[235]);
+ sizerButtons->Add(
+ buttonBeveled,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerButtons
+ );
+ sizerVertical->Add(10, 10, 0);
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[236]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[237]);
+ sizerVertical->Add(
+ buttonCancel,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 228 "WxdkdrawDlgLineJoin.wxc"
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+
+
+#line 237 "WxdkdrawDlgLineJoin.wxc"
+
+
+void
+WxdkdrawDlgLineJoin::OnJoinButton(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+ switch (event.GetId()) {
+ case WXD_ID_LJ_ROUNDED : {
+ m_uLineJoinCurrent = WXD_LJ_ROUNDED;
+ } break;
+ case WXD_ID_LJ_BEVELED : {
+ m_uLineJoinCurrent = WXD_LJ_BEVELED;
+ } break;
+ default : {
+ m_uLineJoinCurrent = WXD_LJ_MITERED;
+ } break;
+ }
+ if ((m_bDrwElem) && (m_uLineJoinCurrent != m_pObject->js)) {
+ bDoRefresh = true;
+ }
+ m_pObject->js = m_uLineJoinCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLineJoin::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgLineJoin.h b/support/dktools/WxdkdrawDlgLineJoin.h
new file mode 100644
index 0000000000..0f7f489990
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineJoin.h
@@ -0,0 +1,166 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLineJoin.wxc
+*/
+
+/** @file WxdkdrawDlgLineJoin.h Header file for the WxdkdrawDlgLineJoin module.
+*/
+
+#ifndef WXDKDRAWDLGLINEJOIN_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGLINEJOIN_H_INCLUDED 1
+
+
+#line 58 "WxdkdrawDlgLineJoin.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#line 69 "WxdkdrawDlgLineJoin.wxc"
+
+/** Dialog to modify line join.
+*/
+class WxdkdrawDlgLineJoin : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Application main window.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ /** Line join button images.
+ */
+ const char ** const *m_pImages;
+
+ /** Line join from object.
+ */
+ uint8_t m_uLineJoinOriginal;
+
+ /** Line join selected in dialog.
+ */
+ uint8_t m_uLineJoinCurrent;
+
+ /** Drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for line join buttons.
+ */
+ enum {
+ WXD_ID_LJ_MITERED = (wxID_HIGHEST + 1), /**< Mitered line join. */
+ WXD_ID_LJ_ROUNDED , /**< Rounded line join. */
+ WXD_ID_LJ_BEVELED /**< Beveled line join. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Drawing element (true) or default obj (false).
+ */
+ WxdkdrawDlgLineJoin(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for line join buttons.
+ @param event Event to process.
+ */
+ void
+ OnJoinButton(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 13 "WxdkdrawDlgLineJoin.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 19 "WxdkdrawDlgLineJoin.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerButtons.
+ */
+#line 27 "WxdkdrawDlgLineJoin.wxc"
+ wxBoxSizer *sizerButtons;
+
+ /** GUI element buttonCancel.
+ */
+#line 50 "WxdkdrawDlgLineJoin.wxc"
+ wxButton *buttonCancel;
+
+ /** GUI element buttonMitered.
+ */
+#line 35 "WxdkdrawDlgLineJoin.wxc"
+ wxBitmapButton *buttonMitered;
+
+ /** GUI element buttonRounded.
+ */
+#line 40 "WxdkdrawDlgLineJoin.wxc"
+ wxBitmapButton *buttonRounded;
+
+ /** GUI element buttonBeveled.
+ */
+#line 45 "WxdkdrawDlgLineJoin.wxc"
+ wxBitmapButton *buttonBeveled;
+
+
+#line 152 "WxdkdrawDlgLineJoin.wxc"
+};
+
+
+#line 155 "WxdkdrawDlgLineJoin.wxc"
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgLineJoin.wxc b/support/dktools/WxdkdrawDlgLineJoin.wxc
new file mode 100644
index 0000000000..daca236928
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineJoin.wxc
@@ -0,0 +1,289 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerButtons
+contents = $space(10)
+contents = buttonCancel centered-x
+contents = $space(10)
+
+[wxBoxSizer sizerButtons]
+direction = horizontal
+contents = buttonMitered centered-y
+contents = $space(10)
+contents = buttonRounded centered-y
+contents = $space(10)
+contents = buttonBeveled centered-y
+
+[wxBitmapButton buttonMitered]
+id = WXD_ID_LJ_MITERED
+bitmap = pImages[0]
+tip = pTexts[233]
+
+[wxBitmapButton buttonRounded]
+id = WXD_ID_LJ_ROUNDED
+bitmap = pImages[1]
+tip = pTexts[234]
+
+[wxBitmapButton buttonBeveled]
+id = WXD_ID_LJ_BEVELED
+bitmap = pImages[2]
+tip = pTexts[235]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[236]
+tip = pTexts[237]
+
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+%% class start
+
+/** Dialog to modify line join.
+*/
+class WxdkdrawDlgLineJoin : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Application main window.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ /** Line join button images.
+ */
+ const char ** const *m_pImages;
+
+ /** Line join from object.
+ */
+ uint8_t m_uLineJoinOriginal;
+
+ /** Line join selected in dialog.
+ */
+ uint8_t m_uLineJoinCurrent;
+
+ /** Drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for line join buttons.
+ */
+ enum {
+ WXD_ID_LJ_MITERED = (wxID_HIGHEST + 1), /**< Mitered line join. */
+ WXD_ID_LJ_ROUNDED , /**< Rounded line join. */
+ WXD_ID_LJ_BEVELED /**< Beveled line join. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Drawing element (true) or default obj (false).
+ */
+ WxdkdrawDlgLineJoin(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for line join buttons.
+ @param event Event to process.
+ */
+ void
+ OnJoinButton(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+%% class end
+};
+
+%% header end
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module start
+
+#ifndef WXDKDRAWDLGLINEJOIN_H_INCLUDED
+#include "WxdkdrawDlgLineJoin.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLineJoin,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLineJoin,wxDialog)
+#endif
+ EVT_BUTTON(\
+ WxdkdrawDlgLineJoin::WXD_ID_LJ_MITERED,\
+ WxdkdrawDlgLineJoin::OnJoinButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineJoin::WXD_ID_LJ_ROUNDED,\
+ WxdkdrawDlgLineJoin::OnJoinButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineJoin::WXD_ID_LJ_BEVELED,\
+ WxdkdrawDlgLineJoin::OnJoinButton\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLineJoin::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+%% constructor start
+WxdkdrawDlgLineJoin::WxdkdrawDlgLineJoin(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[232],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_pTexts = pTexts;
+ m_pImages = pImages;
+ m_bDrwElem = bDrwElem;
+ m_uLineJoinOriginal = pObject->js;
+ if (WXD_LJ_BEVELED < m_uLineJoinOriginal) {
+ m_uLineJoinOriginal = WXD_LJ_BEVELED;
+ }
+ m_uLineJoinCurrent = m_uLineJoinOriginal;
+%% constructor end
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+
+%% module end
+
+
+void
+WxdkdrawDlgLineJoin::OnJoinButton(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+ switch (event.GetId()) {
+ case WXD_ID_LJ_ROUNDED : {
+ m_uLineJoinCurrent = WXD_LJ_ROUNDED;
+ } break;
+ case WXD_ID_LJ_BEVELED : {
+ m_uLineJoinCurrent = WXD_LJ_BEVELED;
+ } break;
+ default : {
+ m_uLineJoinCurrent = WXD_LJ_MITERED;
+ } break;
+ }
+ if ((m_bDrwElem) && (m_uLineJoinCurrent != m_pObject->js)) {
+ bDoRefresh = true;
+ }
+ m_pObject->js = m_uLineJoinCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLineJoin::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgLineStyle.cpp b/support/dktools/WxdkdrawDlgLineStyle.cpp
new file mode 100644
index 0000000000..c515e096af
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineStyle.cpp
@@ -0,0 +1,342 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLineStyle.wxc
+*/
+
+/** @file WxdkdrawDlgLineStyle.cpp The WxdkdrawDlgLineStyle module.
+*/
+
+
+#line 188 "WxdkdrawDlgLineStyle.wxc"
+
+#ifndef WXDKDRAWDLGLINESTYLE_H_INCLUDED
+#include "WxdkdrawDlgLineStyle.h"
+#endif
+
+
+
+
+
+#line 196 "WxdkdrawDlgLineStyle.wxc"
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLineStyle,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLineStyle,wxDialog)
+#endif
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_SOLID,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DASH,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DOT,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DASH_DOT,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DASH_DOT_DOT,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DASH_DOT_DOT_DOT,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLineStyle::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 240 "WxdkdrawDlgLineStyle.wxc"
+
+WxdkdrawDlgLineStyle::WxdkdrawDlgLineStyle(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[216],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_pTexts = pTexts;
+ m_pImages = pImages;
+ m_bDrwElem = bDrwElem;
+ m_uLineStyleOriginal = m_uLineStyleCurrent = pObject->ls;
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerButtons = NULL;
+ buttonCancel = NULL;
+ buttonSolid = NULL;
+ buttonDashed = NULL;
+ buttonDotted = NULL;
+ buttonDashDot = NULL;
+ buttonDashDotDot = NULL;
+ buttonDashDotDotDot = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonSolid = new wxBitmapButton(
+ this,
+ WXD_ID_LS_SOLID,
+ pImages[0]
+ );
+ if(!(buttonSolid)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonSolid->SetToolTip(pTexts[217]);
+ sizerButtons->Add(
+ buttonSolid,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonDashed = new wxBitmapButton(
+ this,
+ WXD_ID_LS_DASH,
+ pImages[1]
+ );
+ if(!(buttonDashed)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonDashed->SetToolTip(pTexts[218]);
+ sizerButtons->Add(
+ buttonDashed,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonDotted = new wxBitmapButton(
+ this,
+ WXD_ID_LS_DOT,
+ pImages[2]
+ );
+ if(!(buttonDotted)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonDotted->SetToolTip(pTexts[219]);
+ sizerButtons->Add(
+ buttonDotted,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonDashDot = new wxBitmapButton(
+ this,
+ WXD_ID_LS_DASH_DOT,
+ pImages[3]
+ );
+ if(!(buttonDashDot)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonDashDot->SetToolTip(pTexts[220]);
+ sizerButtons->Add(
+ buttonDashDot,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonDashDotDot = new wxBitmapButton(
+ this,
+ WXD_ID_LS_DASH_DOT_DOT,
+ pImages[4]
+ );
+ if(!(buttonDashDotDot)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonDashDotDot->SetToolTip(pTexts[221]);
+ sizerButtons->Add(
+ buttonDashDotDot,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonDashDotDotDot = new wxBitmapButton(
+ this,
+ WXD_ID_LS_DASH_DOT_DOT_DOT,
+ pImages[5]
+ );
+ if(!(buttonDashDotDotDot)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonDashDotDotDot->SetToolTip(pTexts[222]);
+ sizerButtons->Add(
+ buttonDashDotDotDot,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerButtons
+ );
+ sizerVertical->Add(10, 10, 0);
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[223]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[224]);
+ sizerVertical->Add(
+ buttonCancel,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 265 "WxdkdrawDlgLineStyle.wxc"
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+
+
+#line 274 "WxdkdrawDlgLineStyle.wxc"
+
+
+void
+WxdkdrawDlgLineStyle::OnStyleButton(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+
+ switch (event.GetId()) {
+ case WXD_ID_LS_DASH : {
+ m_uLineStyleCurrent = WXD_LS_DASH;
+ } break;
+ case WXD_ID_LS_DOT : {
+ m_uLineStyleCurrent = WXD_LS_DOT;
+ } break;
+ case WXD_ID_LS_DASH_DOT : {
+ m_uLineStyleCurrent = WXD_LS_DASH_DOT;
+ } break;
+ case WXD_ID_LS_DASH_DOT_DOT : {
+ m_uLineStyleCurrent = WXD_LS_DASH_DOT_DOT;
+ } break;
+ case WXD_ID_LS_DASH_DOT_DOT_DOT : {
+ m_uLineStyleCurrent = WXD_LS_DASH_DOT_DOT_DOT;
+ } break;
+ default : { /* solid */
+ m_uLineStyleCurrent = WXD_LS_SOLID;
+ } break;
+ }
+ if ((m_bDrwElem) && (m_uLineStyleCurrent != m_pObject->ls)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ls = m_uLineStyleCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLineStyle::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ m_uLineStyleCurrent = m_uLineStyleOriginal;
+ if ((m_bDrwElem) && (m_pObject->ls != m_uLineStyleCurrent)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ls = m_uLineStyleCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+#if 0
+
+uint8_t
+WxdkdrawDlgLineStyle::GetLineStyle(void)
+const
+{
+ return m_uLineStyleCurrent;
+}
+
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgLineStyle.h b/support/dktools/WxdkdrawDlgLineStyle.h
new file mode 100644
index 0000000000..4235345c10
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineStyle.h
@@ -0,0 +1,193 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgLineStyle.wxc
+*/
+
+/** @file WxdkdrawDlgLineStyle.h Header file for the WxdkdrawDlgLineStyle module.
+*/
+
+#ifndef WXDKDRAWDLGLINESTYLE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGLINESTYLE_H_INCLUDED 1
+
+
+#line 75 "WxdkdrawDlgLineStyle.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+#line 87 "WxdkdrawDlgLineStyle.wxc"
+
+/** Dialog to change line style.
+*/
+class WxdkdrawDlgLineStyle : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ /** Line style button images.
+ */
+ const char ** const *m_pImages;
+
+ /** Line style from object.
+ */
+ uint8_t m_uLineStyleOriginal;
+
+ /** Line style selected in dialog.
+ */
+ uint8_t m_uLineStyleCurrent;
+
+ /** Is drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for the buttons.
+ */
+ enum {
+ WXD_ID_LS_SOLID = (wxID_HIGHEST + 1) , /**< Solid line. */
+ WXD_ID_LS_DASH , /**< Dashed line. */
+ WXD_ID_LS_DOT , /**< Dotted line. */
+ WXD_ID_LS_DASH_DOT , /**< Dash dot line. */
+ WXD_ID_LS_DASH_DOT_DOT , /**< Dash dot dot line. */
+ WXD_ID_LS_DASH_DOT_DOT_DOT /**< Dash dot dot dot. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Is drawing element (true) or default (false).
+ */
+ WxdkdrawDlgLineStyle(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for line style buttons.
+ @param event Event to process.
+ */
+ void
+ OnStyleButton(wxCommandEvent & event);
+
+ /** Handler for cancel button.
+ @param event Event to process (ignored).
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+#if 0
+
+ /** Retrieve line style.
+ @return Line style modified in dialog.
+ */
+ uint8_t
+ GetLineStyle(void) const;
+
+#endif
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgLineStyle.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 18 "WxdkdrawDlgLineStyle.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerButtons.
+ */
+#line 26 "WxdkdrawDlgLineStyle.wxc"
+ wxBoxSizer *sizerButtons;
+
+ /** GUI element buttonCancel.
+ */
+#line 69 "WxdkdrawDlgLineStyle.wxc"
+ wxButton *buttonCancel;
+
+ /** GUI element buttonSolid.
+ */
+#line 39 "WxdkdrawDlgLineStyle.wxc"
+ wxBitmapButton *buttonSolid;
+
+ /** GUI element buttonDashed.
+ */
+#line 44 "WxdkdrawDlgLineStyle.wxc"
+ wxBitmapButton *buttonDashed;
+
+ /** GUI element buttonDotted.
+ */
+#line 49 "WxdkdrawDlgLineStyle.wxc"
+ wxBitmapButton *buttonDotted;
+
+ /** GUI element buttonDashDot.
+ */
+#line 54 "WxdkdrawDlgLineStyle.wxc"
+ wxBitmapButton *buttonDashDot;
+
+ /** GUI element buttonDashDotDot.
+ */
+#line 59 "WxdkdrawDlgLineStyle.wxc"
+ wxBitmapButton *buttonDashDotDot;
+
+ /** GUI element buttonDashDotDotDot.
+ */
+#line 64 "WxdkdrawDlgLineStyle.wxc"
+ wxBitmapButton *buttonDashDotDotDot;
+
+
+#line 183 "WxdkdrawDlgLineStyle.wxc"
+};
+
+
+#line 186 "WxdkdrawDlgLineStyle.wxc"
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgLineStyle.wxc b/support/dktools/WxdkdrawDlgLineStyle.wxc
new file mode 100644
index 0000000000..d79e8f079c
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgLineStyle.wxc
@@ -0,0 +1,356 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerButtons
+contents = $space(10)
+contents = buttonCancel centered-x
+contents = $space(10)
+
+[wxBoxSizer sizerButtons]
+contents = buttonSolid centered-y
+contents = $space(10)
+contents = buttonDashed centered-y
+contents = $space(10)
+contents = buttonDotted centered-y
+contents = $space(10)
+contents = buttonDashDot centered-y
+contents = $space(10)
+contents = buttonDashDotDot centered-y
+contents = $space(10)
+contents = buttonDashDotDotDot centered-y
+
+[wxBitmapButton buttonSolid]
+id = WXD_ID_LS_SOLID
+bitmap = pImages[0]
+tip = pTexts[217]
+
+[wxBitmapButton buttonDashed]
+id = WXD_ID_LS_DASH
+bitmap = pImages[1]
+tip = pTexts[218]
+
+[wxBitmapButton buttonDotted]
+id = WXD_ID_LS_DOT
+bitmap = pImages[2]
+tip = pTexts[219]
+
+[wxBitmapButton buttonDashDot]
+id = WXD_ID_LS_DASH_DOT
+bitmap = pImages[3]
+tip = pTexts[220]
+
+[wxBitmapButton buttonDashDotDot]
+id = WXD_ID_LS_DASH_DOT_DOT
+bitmap = pImages[4]
+tip = pTexts[221]
+
+[wxBitmapButton buttonDashDotDotDot]
+id = WXD_ID_LS_DASH_DOT_DOT_DOT
+bitmap = pImages[5]
+tip = pTexts[222]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[223]
+tip = pTexts[224]
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+%% class start
+
+/** Dialog to change line style.
+*/
+class WxdkdrawDlgLineStyle : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_pTexts;
+
+ /** Line style button images.
+ */
+ const char ** const *m_pImages;
+
+ /** Line style from object.
+ */
+ uint8_t m_uLineStyleOriginal;
+
+ /** Line style selected in dialog.
+ */
+ uint8_t m_uLineStyleCurrent;
+
+ /** Is drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for the buttons.
+ */
+ enum {
+ WXD_ID_LS_SOLID = (wxID_HIGHEST + 1) , /**< Solid line. */
+ WXD_ID_LS_DASH , /**< Dashed line. */
+ WXD_ID_LS_DOT , /**< Dotted line. */
+ WXD_ID_LS_DASH_DOT , /**< Dash dot line. */
+ WXD_ID_LS_DASH_DOT_DOT , /**< Dash dot dot line. */
+ WXD_ID_LS_DASH_DOT_DOT_DOT /**< Dash dot dot dot. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Is drawing element (true) or default (false).
+ */
+ WxdkdrawDlgLineStyle(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for line style buttons.
+ @param event Event to process.
+ */
+ void
+ OnStyleButton(wxCommandEvent & event);
+
+ /** Handler for cancel button.
+ @param event Event to process (ignored).
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+#if 0
+
+ /** Retrieve line style.
+ @return Line style modified in dialog.
+ */
+ uint8_t
+ GetLineStyle(void) const;
+
+#endif
+
+%% class end
+};
+
+%% header end
+
+%% module start
+
+#ifndef WXDKDRAWDLGLINESTYLE_H_INCLUDED
+#include "WxdkdrawDlgLineStyle.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgLineStyle,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgLineStyle,wxDialog)
+#endif
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_SOLID,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DASH,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DOT,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DASH_DOT,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DASH_DOT_DOT,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgLineStyle::WXD_ID_LS_DASH_DOT_DOT_DOT,\
+ WxdkdrawDlgLineStyle::OnStyleButton\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgLineStyle::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+
+WxdkdrawDlgLineStyle::WxdkdrawDlgLineStyle(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[216],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_pTexts = pTexts;
+ m_pImages = pImages;
+ m_bDrwElem = bDrwElem;
+ m_uLineStyleOriginal = m_uLineStyleCurrent = pObject->ls;
+%% constructor end
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+
+%% module end
+
+
+void
+WxdkdrawDlgLineStyle::OnStyleButton(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+
+ switch (event.GetId()) {
+ case WXD_ID_LS_DASH : {
+ m_uLineStyleCurrent = WXD_LS_DASH;
+ } break;
+ case WXD_ID_LS_DOT : {
+ m_uLineStyleCurrent = WXD_LS_DOT;
+ } break;
+ case WXD_ID_LS_DASH_DOT : {
+ m_uLineStyleCurrent = WXD_LS_DASH_DOT;
+ } break;
+ case WXD_ID_LS_DASH_DOT_DOT : {
+ m_uLineStyleCurrent = WXD_LS_DASH_DOT_DOT;
+ } break;
+ case WXD_ID_LS_DASH_DOT_DOT_DOT : {
+ m_uLineStyleCurrent = WXD_LS_DASH_DOT_DOT_DOT;
+ } break;
+ default : { /* solid */
+ m_uLineStyleCurrent = WXD_LS_SOLID;
+ } break;
+ }
+ if ((m_bDrwElem) && (m_uLineStyleCurrent != m_pObject->ls)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ls = m_uLineStyleCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgLineStyle::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ m_uLineStyleCurrent = m_uLineStyleOriginal;
+ if ((m_bDrwElem) && (m_pObject->ls != m_uLineStyleCurrent)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ls = m_uLineStyleCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+#if 0
+
+uint8_t
+WxdkdrawDlgLineStyle::GetLineStyle(void)
+const
+{
+ return m_uLineStyleCurrent;
+}
+
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgMiterLimit.cpp b/support/dktools/WxdkdrawDlgMiterLimit.cpp
new file mode 100644
index 0000000000..5c2a2f2a86
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgMiterLimit.cpp
@@ -0,0 +1,279 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgMiterLimit.wxc
+*/
+
+/** @file WxdkdrawDlgMiterLimit.cpp The WxdkdrawDlgMiterLimit module.
+*/
+
+
+#line 150 "WxdkdrawDlgMiterLimit.wxc"
+
+#ifndef WXDKDRAWDLGMITERLIMIT_H_INCLUDED
+#include "WxdkdrawDlgMiterLimit.h"
+#endif
+
+
+
+
+
+#line 158 "WxdkdrawDlgMiterLimit.wxc"
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgMiterLimit,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgMiterLimit,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgMiterLimit::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgMiterLimit::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgMiterLimit::WXD_ID_SL_ML,\
+ WxdkdrawDlgMiterLimit::OnSpin\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 186 "WxdkdrawDlgMiterLimit.wxc"
+WxdkdrawDlgMiterLimit::WxdkdrawDlgMiterLimit(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[238],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_uLimitOriginal = pObject->ml;
+ m_uLimitCurrent = m_uLimitOriginal;
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerInput = NULL;
+ sizerButtons = NULL;
+ labelValue = NULL;
+ spinValue = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerInput = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerInput)) {
+ goto dkctGUILayoutFinished;
+ }
+ labelValue = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[239]
+ );
+ if(!(labelValue)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerInput->Add(
+ labelValue,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerInput->Add(10, 10, 0);
+ spinValue = new wxSpinCtrl(
+ this,
+ WXD_ID_SL_ML,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 255,
+ 8
+ );
+ if(!(spinValue)) {
+ goto dkctGUILayoutFinished;
+ }
+ spinValue->SetToolTip(pTexts[240]);
+ sizerInput->Add(
+ spinValue,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerInput,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[241]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[242]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[243]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[244]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 208 "WxdkdrawDlgMiterLimit.wxc"
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ spinValue->SetValue(m_uLimitCurrent);
+ }
+}
+
+
+
+#line 217 "WxdkdrawDlgMiterLimit.wxc"
+
+
+void
+WxdkdrawDlgMiterLimit::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+
+ m_uLimitCurrent = spinValue->GetValue();
+ if ((m_bDrwElem) && (m_uLimitCurrent != m_pObject->ml)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ml = m_uLimitCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgMiterLimit::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ m_uLimitCurrent = m_uLimitOriginal;
+ if ((m_bDrwElem) && (m_pObject->ml != m_uLimitCurrent)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ml = m_uLimitCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgMiterLimit::OnSpin(wxSpinEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+
+
+#line 271 "WxdkdrawDlgMiterLimit.wxc"
+ m_uLimitCurrent = spinValue->GetValue();
+ if ((m_bDrwElem) && (m_uLimitCurrent != m_pObject->ml)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ml = m_uLimitCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+
+
+#line 280 "WxdkdrawDlgMiterLimit.wxc"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgMiterLimit.h b/support/dktools/WxdkdrawDlgMiterLimit.h
new file mode 100644
index 0000000000..4136fb5a90
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgMiterLimit.h
@@ -0,0 +1,162 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgMiterLimit.wxc
+*/
+
+/** @file WxdkdrawDlgMiterLimit.h Header file for the WxdkdrawDlgMiterLimit module.
+*/
+
+#ifndef WXDKDRAWDLGMITERLIMIT_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGMITERLIMIT_H_INCLUDED 1
+
+
+#line 58 "WxdkdrawDlgMiterLimit.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+#line 70 "WxdkdrawDlgMiterLimit.wxc"
+
+/** Dialog to set miter limit.
+*/
+class WxdkdrawDlgMiterLimit : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Program main window
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify, either drawing element or default style object.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Original miter limit from object.
+ */
+ uint8_t m_uLimitOriginal;
+
+ /** New miter limit set up in dialog.
+ */
+ uint8_t m_uLimitCurrent;
+
+ /** Is drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs used in this dialog.
+ */
+ enum {
+ WXD_ID_SL_ML = (wxID_HIGHEST + 1) /**< Slider change. */
+ };
+
+ /** Constructor.
+ @param pParent Application main window.
+ @param pObject Object to modify.
+ @param pText Localized text fragments.
+ */
+ WxdkdrawDlgMiterLimit(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ bool bDrwElem
+ );
+
+ /** Handler for OK button.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Handler for spin control change.
+ */
+ void
+ OnSpin(wxSpinEvent & event);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 13 "WxdkdrawDlgMiterLimit.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 19 "WxdkdrawDlgMiterLimit.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerInput.
+ */
+#line 27 "WxdkdrawDlgMiterLimit.wxc"
+ wxBoxSizer *sizerInput;
+
+ /** GUI element sizerButtons.
+ */
+#line 41 "WxdkdrawDlgMiterLimit.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element labelValue.
+ */
+#line 32 "WxdkdrawDlgMiterLimit.wxc"
+ wxStaticText *labelValue;
+
+ /** GUI element spinValue.
+ */
+#line 35 "WxdkdrawDlgMiterLimit.wxc"
+ wxSpinCtrl *spinValue;
+
+ /** GUI element buttonOK.
+ */
+#line 45 "WxdkdrawDlgMiterLimit.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 50 "WxdkdrawDlgMiterLimit.wxc"
+ wxButton *buttonCancel;
+
+
+#line 145 "WxdkdrawDlgMiterLimit.wxc"
+};
+
+
+#line 148 "WxdkdrawDlgMiterLimit.wxc"
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgMiterLimit.wxc b/support/dktools/WxdkdrawDlgMiterLimit.wxc
new file mode 100644
index 0000000000..4d58fef7a7
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgMiterLimit.wxc
@@ -0,0 +1,285 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerInput centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxBoxSizer sizerInput]
+contents = labelValue centered-y
+contents = $space(10)
+contents = spinValue centered-y
+
+[wxStaticText labelValue]
+text = pTexts[239]
+
+[wxSpinCtrl spinValue]
+range = 1 255
+value = 8
+tip = pTexts[240]
+id = WXD_ID_SL_ML
+
+[wxStdDialogButtonSizer sizerButtons]
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[241]
+tip = pTexts[242]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[243]
+tip = pTexts[244]
+
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+%% class start
+
+/** Dialog to set miter limit.
+*/
+class WxdkdrawDlgMiterLimit : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Program main window
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify, either drawing element or default style object.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Original miter limit from object.
+ */
+ uint8_t m_uLimitOriginal;
+
+ /** New miter limit set up in dialog.
+ */
+ uint8_t m_uLimitCurrent;
+
+ /** Is drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs used in this dialog.
+ */
+ enum {
+ WXD_ID_SL_ML = (wxID_HIGHEST + 1) /**< Slider change. */
+ };
+
+ /** Constructor.
+ @param pParent Application main window.
+ @param pObject Object to modify.
+ @param pText Localized text fragments.
+ */
+ WxdkdrawDlgMiterLimit(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ bool bDrwElem
+ );
+
+ /** Handler for OK button.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Handler for spin control change.
+ */
+ void
+ OnSpin(wxSpinEvent & event);
+
+%% class end
+};
+
+%% header end
+
+%% module start
+
+#ifndef WXDKDRAWDLGMITERLIMIT_H_INCLUDED
+#include "WxdkdrawDlgMiterLimit.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgMiterLimit,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgMiterLimit,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgMiterLimit::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgMiterLimit::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgMiterLimit::WXD_ID_SL_ML,\
+ WxdkdrawDlgMiterLimit::OnSpin\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+WxdkdrawDlgMiterLimit::WxdkdrawDlgMiterLimit(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[238],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+ m_uLimitOriginal = pObject->ml;
+ m_uLimitCurrent = m_uLimitOriginal;
+%% constructor end
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ spinValue->SetValue(m_uLimitCurrent);
+ }
+}
+
+
+%% module end
+
+
+void
+WxdkdrawDlgMiterLimit::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+
+ m_uLimitCurrent = spinValue->GetValue();
+ if ((m_bDrwElem) && (m_uLimitCurrent != m_pObject->ml)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ml = m_uLimitCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgMiterLimit::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ m_uLimitCurrent = m_uLimitOriginal;
+ if ((m_bDrwElem) && (m_pObject->ml != m_uLimitCurrent)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ml = m_uLimitCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgMiterLimit::OnSpin(wxSpinEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ $? "+ OnSpin"
+ m_uLimitCurrent = spinValue->GetValue();
+ if ((m_bDrwElem) && (m_uLimitCurrent != m_pObject->ml)) {
+ bDoRefresh = true;
+ }
+ m_pObject->ml = m_uLimitCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ $? "- OnSpin"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgOptionsNewObjects.cpp b/support/dktools/WxdkdrawDlgOptionsNewObjects.cpp
new file mode 100644
index 0000000000..0a1969971f
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgOptionsNewObjects.cpp
@@ -0,0 +1,338 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgOptionsNewObjects.wxc
+*/
+
+/** @file WxdkdrawDlgOptionsNewObjects.cpp The WxdkdrawDlgOptionsNewObjects module.
+*/
+
+
+#line 176 "WxdkdrawDlgOptionsNewObjects.wxc"
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgOptionsNewObjects.h"
+#endif
+
+
+
+
+#line 183 "WxdkdrawDlgOptionsNewObjects.wxc"
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgOptionsNewObjects,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgOptionsNewObjects,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgOptionsNewObjects::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgOptionsNewObjects::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 208 "WxdkdrawDlgOptionsNewObjects.wxc"
+
+WxdkdrawDlgOptionsNewObjects::WxdkdrawDlgOptionsNewObjects(
+ WxdkdrawFrame *pParent,
+ int *pFilled,
+ int *pWhite,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[627],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+),
+#if defined(__WXMSW__)
+m_oColourRed(127, 0, 0)
+#else
+m_oColourRed(191, 0, 0)
+#endif
+{
+ m_pParent = pParent;
+ m_sTexts = pTexts;
+ m_pFilled = pFilled;
+ m_pWhite = pWhite;
+ m_iDiameterFilled = *pFilled;
+ m_iDiameterWhite = *pWhite;
+
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerContents = NULL;
+ sizerButtons = NULL;
+ lGroupDotFilled = NULL;
+ lDiameterFilled = NULL;
+ spDiameterFilled = NULL;
+ lGroupDotWhite = NULL;
+ lDiameterWhite = NULL;
+ spDiameterWhite = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerContents = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ lGroupDotFilled = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[628]
+ );
+ if(!(lGroupDotFilled)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lGroupDotFilled,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lDiameterFilled = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[495]
+ );
+ if(!(lDiameterFilled)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lDiameterFilled,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spDiameterFilled = new wxSpinCtrl(
+ this,
+ wxID_ANY,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 8
+ );
+ if(!(spDiameterFilled)) {
+ goto dkctGUILayoutFinished;
+ }
+ spDiameterFilled->SetToolTip(pTexts[496]);
+ sizerContents->Add(
+ spDiameterFilled,
+ wxGBPosition(1, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerContents->Add(10, 10, wxGBPosition(2, 0), wxGBSpan(1, 2));
+ lGroupDotWhite = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[629]
+ );
+ if(!(lGroupDotWhite)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lGroupDotWhite,
+ wxGBPosition(3, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lDiameterWhite = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[495]
+ );
+ if(!(lDiameterWhite)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lDiameterWhite,
+ wxGBPosition(4, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spDiameterWhite = new wxSpinCtrl(
+ this,
+ wxID_ANY,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 8
+ );
+ if(!(spDiameterWhite)) {
+ goto dkctGUILayoutFinished;
+ }
+ spDiameterWhite->SetToolTip(pTexts[496]);
+ sizerContents->Add(
+ spDiameterWhite,
+ wxGBPosition(4, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerContents,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[476]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[478]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[477]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[479]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 238 "WxdkdrawDlgOptionsNewObjects.wxc"
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Retrieve object attributes
+ */
+ lGroupDotFilled->SetForegroundColour(m_oColourRed);
+ lGroupDotWhite->SetForegroundColour(m_oColourRed);
+ spDiameterFilled->SetValue(m_iDiameterFilled);
+ spDiameterWhite->SetValue(m_iDiameterWhite);
+ }
+}
+
+
+
+#line 256 "WxdkdrawDlgOptionsNewObjects.wxc"
+
+
+void
+WxdkdrawDlgOptionsNewObjects::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ *m_pFilled = spDiameterFilled->GetValue();
+ *m_pWhite = spDiameterWhite->GetValue();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgOptionsNewObjects::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+int
+WxdkdrawDlgOptionsNewObjects::GetFilledDotDiameter(void)
+{
+ return 8;
+}
+
+
+
+int
+WxdkdrawDlgOptionsNewObjects::GetWhiteDotDiameter(void)
+{
+ return 10;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgOptionsNewObjects.h b/support/dktools/WxdkdrawDlgOptionsNewObjects.h
new file mode 100644
index 0000000000..8e4fac52d5
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgOptionsNewObjects.h
@@ -0,0 +1,191 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgOptionsNewObjects.wxc
+*/
+
+/** @file WxdkdrawDlgOptionsNewObjects.h Header file for the WxdkdrawDlgOptionsNewObjects module.
+*/
+
+#ifndef WXDKDRAWDLGOPTIONSNEWOBJECTS_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGOPTIONSNEWOBJECTS_H_INCLUDED 1
+
+
+#line 75 "WxdkdrawDlgOptionsNewObjects.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+#line 85 "WxdkdrawDlgOptionsNewObjects.wxc"
+
+/** Dialog to change dot details.
+*/
+class WxdkdrawDlgOptionsNewObjects : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 11 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 17 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerContents.
+ */
+#line 25 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxGridBagSizer *sizerContents;
+
+ /** GUI element sizerButtons.
+ */
+#line 59 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element lGroupDotFilled.
+ */
+#line 36 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxStaticText *lGroupDotFilled;
+
+ /** GUI element lDiameterFilled.
+ */
+#line 39 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxStaticText *lDiameterFilled;
+
+ /** GUI element spDiameterFilled.
+ */
+#line 42 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxSpinCtrl *spDiameterFilled;
+
+ /** GUI element lGroupDotWhite.
+ */
+#line 47 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxStaticText *lGroupDotWhite;
+
+ /** GUI element lDiameterWhite.
+ */
+#line 50 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxStaticText *lDiameterWhite;
+
+ /** GUI element spDiameterWhite.
+ */
+#line 53 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxSpinCtrl *spDiameterWhite;
+
+ /** GUI element buttonOK.
+ */
+#line 64 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 69 "WxdkdrawDlgOptionsNewObjects.wxc"
+ wxButton *buttonCancel;
+
+
+#line 101 "WxdkdrawDlgOptionsNewObjects.wxc"
+
+ protected:
+
+ wxColour m_oColourRed;
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ /** Address of filled dot diameter variable.
+ */
+ int *m_pFilled;
+
+ /** Address of white dot diameter variable.
+ */
+ int *m_pWhite;
+
+ /** Diameter of filled dots.
+ */
+ int m_iDiameterFilled;
+
+ /** Diameter of white filled dots.
+ */
+ int m_iDiameterWhite;
+
+ public:
+
+ /** Constructor.
+ @param pParent Parent frame (programs main window).
+ @param pFilled Address of filled dot diameter variable.
+ @param pWhite Address of white filled dot diameter variable.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgOptionsNewObjects(
+ WxdkdrawFrame *pParent,
+ int *pFilled,
+ int *pWhite,
+ wxChar const * const *pTexts
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Retrieve diameter for filled dots.
+ @return Diameter for filled dots.
+ */
+ int
+ GetFilledDotDiameter(void);
+
+ /** Retrieve diameter for white filled dots.
+ @return Diameter for white filled dots.
+ */
+ int
+ GetWhiteDotDiameter(void);
+
+};
+
+
+
+#line 173 "WxdkdrawDlgOptionsNewObjects.wxc"
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgOptionsNewObjects.wxc b/support/dktools/WxdkdrawDlgOptionsNewObjects.wxc
new file mode 100644
index 0000000000..4a6390e40c
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgOptionsNewObjects.wxc
@@ -0,0 +1,305 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2020-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerContents centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxGridBagSizer sizerContents]
+grid = 5 5
+grow = yes
+contents = lGroupDotFilled 0 0 1 2 left centered-y
+contents = lDiameterFilled +1 0 1 1 right centered-y
+contents = spDiameterFilled . +1 1 1 left centered-y
+contents = $space(10) +1 0 1 2 left centered-y
+contents = lGroupDotWhite +1 0 1 2 left centered-y
+contents = lDiameterWhite +1 0 1 1 right centered-y
+contents = spDiameterWhite . +1 1 1 left centered-y
+
+[wxStaticText lGroupDotFilled]
+text = pTexts[628]
+
+[wxStaticText lDiameterFilled]
+text = pTexts[495]
+
+[wxSpinCtrl spDiameterFilled]
+range = 1 65535
+value = 8
+tip = pTexts[496]
+
+[wxStaticText lGroupDotWhite]
+text = pTexts[629]
+
+[wxStaticText lDiameterWhite]
+text = pTexts[495]
+
+[wxSpinCtrl spDiameterWhite]
+range = 1 65535
+value = 8
+tip = pTexts[496]
+
+
+[wxStdDialogButtonSizer sizerButtons]
+grow = yes
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[476]
+tip = pTexts[478]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[477]
+tip = pTexts[479]
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+%% class start
+
+/** Dialog to change dot details.
+*/
+class WxdkdrawDlgOptionsNewObjects : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+%% class end
+
+ protected:
+
+ wxColour m_oColourRed;
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ /** Address of filled dot diameter variable.
+ */
+ int *m_pFilled;
+
+ /** Address of white dot diameter variable.
+ */
+ int *m_pWhite;
+
+ /** Diameter of filled dots.
+ */
+ int m_iDiameterFilled;
+
+ /** Diameter of white filled dots.
+ */
+ int m_iDiameterWhite;
+
+ public:
+
+ /** Constructor.
+ @param pParent Parent frame (programs main window).
+ @param pFilled Address of filled dot diameter variable.
+ @param pWhite Address of white filled dot diameter variable.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgOptionsNewObjects(
+ WxdkdrawFrame *pParent,
+ int *pFilled,
+ int *pWhite,
+ wxChar const * const *pTexts
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Retrieve diameter for filled dots.
+ @return Diameter for filled dots.
+ */
+ int
+ GetFilledDotDiameter(void);
+
+ /** Retrieve diameter for white filled dots.
+ @return Diameter for white filled dots.
+ */
+ int
+ GetWhiteDotDiameter(void);
+
+};
+
+
+%% header end
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgOptionsNewObjects.h"
+#endif
+
+
+$!trace-include
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgOptionsNewObjects,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgOptionsNewObjects,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgOptionsNewObjects::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgOptionsNewObjects::OnCancel\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+
+WxdkdrawDlgOptionsNewObjects::WxdkdrawDlgOptionsNewObjects(
+ WxdkdrawFrame *pParent,
+ int *pFilled,
+ int *pWhite,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[627],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+),
+#if defined(__WXMSW__)
+m_oColourRed(127, 0, 0)
+#else
+m_oColourRed(191, 0, 0)
+#endif
+{
+ m_pParent = pParent;
+ m_sTexts = pTexts;
+ m_pFilled = pFilled;
+ m_pWhite = pWhite;
+ m_iDiameterFilled = *pFilled;
+ m_iDiameterWhite = *pWhite;
+
+%% constructor end
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Retrieve object attributes
+ */
+ lGroupDotFilled->SetForegroundColour(m_oColourRed);
+ lGroupDotWhite->SetForegroundColour(m_oColourRed);
+ spDiameterFilled->SetValue(m_iDiameterFilled);
+ spDiameterWhite->SetValue(m_iDiameterWhite);
+ }
+}
+
+
+%% module end
+
+
+void
+WxdkdrawDlgOptionsNewObjects::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ *m_pFilled = spDiameterFilled->GetValue();
+ *m_pWhite = spDiameterWhite->GetValue();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgOptionsNewObjects::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+int
+WxdkdrawDlgOptionsNewObjects::GetFilledDotDiameter(void)
+{
+ return 8;
+}
+
+
+
+int
+WxdkdrawDlgOptionsNewObjects::GetWhiteDotDiameter(void)
+{
+ return 10;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgOptionsScreen.cpp b/support/dktools/WxdkdrawDlgOptionsScreen.cpp
new file mode 100644
index 0000000000..b9d6267c24
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgOptionsScreen.cpp
@@ -0,0 +1,416 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgOptionsScreen.wxc
+*/
+
+/** @file WxdkdrawDlgOptionsScreen.cpp The WxdkdrawDlgOptionsScreen module.
+*/
+
+
+#line 223 "WxdkdrawDlgOptionsScreen.wxc"
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgOptionsScreen.h"
+#endif
+
+
+
+
+#line 230 "WxdkdrawDlgOptionsScreen.wxc"
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgOptionsScreen,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgOptionsScreen,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgOptionsScreen::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgOptionsScreen::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgOptionsScreen::WXD_ID_SUBSEGS,\
+ WxdkdrawDlgOptionsScreen::OnSubsegs\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgOptionsScreen::WXD_ID_EXACT,\
+ WxdkdrawDlgOptionsScreen::OnFontExact\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgOptionsScreen::WXD_ID_POINT_OPS,\
+ WxdkdrawDlgOptionsScreen::OnMarkupReduce\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 267 "WxdkdrawDlgOptionsScreen.wxc"
+
+WxdkdrawDlgOptionsScreen::WxdkdrawDlgOptionsScreen(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ int *pSubsegs,
+ int *pExact,
+ int *pReduce,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[635],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+),
+#if defined(__WXMSW__)
+m_oColourRed(127, 0, 0)
+#else
+m_oColourRed(191, 0, 0)
+#endif
+{
+ m_pParent = pParent;
+ m_pControl = pControl;
+ m_pDrw = pDrw;
+ m_sTexts = pTexts;
+ m_pSubsegs = pSubsegs;
+ m_pExact = pExact;
+ m_pReduceMarkup = pReduce;
+ m_iSubsegments = *pSubsegs;
+ m_iExact = *pExact;
+ m_iReduceMarkup = *pReduce;
+
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerContents = NULL;
+ sizerButtons = NULL;
+ lTexts = NULL;
+ cbTexts = NULL;
+ lSplines = NULL;
+ lSubsegs = NULL;
+ spSubsegs = NULL;
+ lPointMoveOps = NULL;
+ cbPointMoveOps = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerContents = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ lTexts = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[636]
+ );
+ if(!(lTexts)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lTexts,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbTexts = new wxCheckBox(
+ this,
+ WXD_ID_EXACT,
+ pTexts[637]
+ );
+ if(!(cbTexts)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbTexts->SetToolTip(pTexts[638]);
+ sizerContents->Add(
+ cbTexts,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerContents->Add(10, 10, wxGBPosition(2, 0), wxGBSpan(1, 2));
+ lSplines = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[632]
+ );
+ if(!(lSplines)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lSplines,
+ wxGBPosition(3, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lSubsegs = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[633]
+ );
+ if(!(lSubsegs)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lSubsegs,
+ wxGBPosition(4, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spSubsegs = new wxSpinCtrl(
+ this,
+ WXD_ID_SUBSEGS,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 2,
+ 32,
+ 4
+ );
+ if(!(spSubsegs)) {
+ goto dkctGUILayoutFinished;
+ }
+ spSubsegs->SetToolTip(pTexts[634]);
+ sizerContents->Add(
+ spSubsegs,
+ wxGBPosition(4, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerContents->Add(10, 10, wxGBPosition(5, 0), wxGBSpan(1, 2));
+ lPointMoveOps = new wxStaticText(
+ this,
+ wxID_ANY,
+ pTexts[639]
+ );
+ if(!(lPointMoveOps)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ lPointMoveOps,
+ wxGBPosition(6, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ cbPointMoveOps = new wxCheckBox(
+ this,
+ WXD_ID_POINT_OPS,
+ pTexts[640]
+ );
+ if(!(cbPointMoveOps)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbPointMoveOps->SetToolTip(pTexts[641]);
+ sizerContents->Add(
+ cbPointMoveOps,
+ wxGBPosition(7, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerContents,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pTexts[476]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pTexts[478]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[477]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[479]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 304 "WxdkdrawDlgOptionsScreen.wxc"
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Retrieve object attributes
+ */
+ lSplines->SetForegroundColour(m_oColourRed);
+ lTexts->SetForegroundColour(m_oColourRed);
+ lPointMoveOps->SetForegroundColour(m_oColourRed);
+ cbTexts->SetValue((0 != *m_pExact));
+ spSubsegs->SetValue(*m_pSubsegs);
+ cbPointMoveOps->SetValue((0 != *m_pReduceMarkup));
+ }
+}
+
+
+
+#line 324 "WxdkdrawDlgOptionsScreen.wxc"
+
+
+void
+WxdkdrawDlgOptionsScreen::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ *m_pSubsegs = m_iSubsegments = spSubsegs->GetValue();
+ *m_pExact = m_iExact = (((cbTexts->GetValue()) ? 1 : 0));
+ *m_pReduceMarkup = m_iReduceMarkup =
+ (((cbPointMoveOps->GetValue()) ? 1 : 0));
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgOptionsScreen::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ *m_pSubsegs = m_iSubsegments;
+ *m_pExact = m_iExact;
+ *m_pReduceMarkup = m_iReduceMarkup;
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgOptionsScreen::OnSubsegs(wxSpinEvent & WXUNUSED(event))
+{
+
+
+#line 365 "WxdkdrawDlgOptionsScreen.wxc"
+ *m_pSubsegs = spSubsegs->GetValue();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_pControl->Refresh();
+ m_pParent->Update();
+
+
+#line 370 "WxdkdrawDlgOptionsScreen.wxc"
+}
+
+
+
+void
+WxdkdrawDlgOptionsScreen::OnFontExact(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 378 "WxdkdrawDlgOptionsScreen.wxc"
+ *m_pExact = ((cbTexts->GetValue()) ? 1 : 0);
+ m_pParent->UpdateFonts();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_pControl->Refresh();
+ m_pParent->Refresh();
+ m_pParent->Update();
+
+
+#line 385 "WxdkdrawDlgOptionsScreen.wxc"
+}
+
+
+
+void
+WxdkdrawDlgOptionsScreen::OnMarkupReduce(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 393 "WxdkdrawDlgOptionsScreen.wxc"
+ *m_pReduceMarkup = (((cbPointMoveOps->GetValue()) ? 1 : 0));
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_pControl->Refresh();
+ m_pParent->Refresh();
+ m_pParent->Update();
+
+
+#line 399 "WxdkdrawDlgOptionsScreen.wxc"
+
+
+#line 400 "WxdkdrawDlgOptionsScreen.wxc"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgOptionsScreen.h b/support/dktools/WxdkdrawDlgOptionsScreen.h
new file mode 100644
index 0000000000..86f99909c0
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgOptionsScreen.h
@@ -0,0 +1,234 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgOptionsScreen.wxc
+*/
+
+/** @file WxdkdrawDlgOptionsScreen.h Header file for the WxdkdrawDlgOptionsScreen module.
+*/
+
+#ifndef WXDKDRAWDLGOPTIONSSCREEN_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGOPTIONSSCREEN_H_INCLUDED 1
+
+
+#line 84 "WxdkdrawDlgOptionsScreen.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+#line 94 "WxdkdrawDlgOptionsScreen.wxc"
+
+/** Dialog to change dot details.
+*/
+class WxdkdrawDlgOptionsScreen : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 11 "WxdkdrawDlgOptionsScreen.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 17 "WxdkdrawDlgOptionsScreen.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerContents.
+ */
+#line 25 "WxdkdrawDlgOptionsScreen.wxc"
+ wxGridBagSizer *sizerContents;
+
+ /** GUI element sizerButtons.
+ */
+#line 67 "WxdkdrawDlgOptionsScreen.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element lTexts.
+ */
+#line 38 "WxdkdrawDlgOptionsScreen.wxc"
+ wxStaticText *lTexts;
+
+ /** GUI element cbTexts.
+ */
+#line 41 "WxdkdrawDlgOptionsScreen.wxc"
+ wxCheckBox *cbTexts;
+
+ /** GUI element lSplines.
+ */
+#line 46 "WxdkdrawDlgOptionsScreen.wxc"
+ wxStaticText *lSplines;
+
+ /** GUI element lSubsegs.
+ */
+#line 49 "WxdkdrawDlgOptionsScreen.wxc"
+ wxStaticText *lSubsegs;
+
+ /** GUI element spSubsegs.
+ */
+#line 52 "WxdkdrawDlgOptionsScreen.wxc"
+ wxSpinCtrl *spSubsegs;
+
+ /** GUI element lPointMoveOps.
+ */
+#line 58 "WxdkdrawDlgOptionsScreen.wxc"
+ wxStaticText *lPointMoveOps;
+
+ /** GUI element cbPointMoveOps.
+ */
+#line 61 "WxdkdrawDlgOptionsScreen.wxc"
+ wxCheckBox *cbPointMoveOps;
+
+ /** GUI element buttonOK.
+ */
+#line 72 "WxdkdrawDlgOptionsScreen.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 77 "WxdkdrawDlgOptionsScreen.wxc"
+ wxButton *buttonCancel;
+
+
+#line 110 "WxdkdrawDlgOptionsScreen.wxc"
+
+ protected:
+
+ /** Red colour for group titles.
+ */
+ wxColour m_oColourRed;
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing control to refresh on changes.
+ */
+ wxControl *m_pControl;
+
+ /** Entire drawing.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ /** Address of subsegments variable.
+ */
+ int *m_pSubsegs;
+
+ /** Address of exact fonts variable.
+ */
+ int *m_pExact;
+
+ /** Address of variable for markup reduction.
+ */
+ int *m_pReduceMarkup;
+
+ /** Initial value for number of subsegments.
+ */
+ int m_iSubsegments;
+
+ /** Initial value for exact font flag.
+ */
+ int m_iExact;
+
+ /** Initial value for markup reduction.
+ */
+ int m_iReduceMarkup;
+
+ public:
+
+ /** Control events.
+ */
+ enum {
+ WXD_ID_SUBSEGS = (wxID_HIGHEST + 1), /**< Subsegs changed. */
+ WXD_ID_EXACT , /**< Use exact fonts. */
+ WXD_ID_POINT_OPS , /**< Reduce markup. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (programs main window).
+ @param pControl Drawing control.
+ @param pDrw Drawing.
+ @param pSubsegs Address of sub-segments variable.
+ @param pExact Address of exact font variables.
+ @param pReduce Address of variable to reduce markup.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgOptionsScreen(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ int *pSubsegs,
+ int *pExact,
+ int *pReduce,
+ wxChar const * const *pTexts
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Subsegs spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnSubsegs(wxSpinEvent & event);
+
+ /** Handler for checkbox change.
+ @param event Event to process.
+ */
+ void
+ OnFontExact(wxCommandEvent & event);
+
+ /** Handler for reduce markup checkbox change.
+ @param event Event to process.
+ */
+ void
+ OnMarkupReduce(wxCommandEvent & event);
+
+};
+
+
+
+#line 220 "WxdkdrawDlgOptionsScreen.wxc"
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgOptionsScreen.wxc b/support/dktools/WxdkdrawDlgOptionsScreen.wxc
new file mode 100644
index 0000000000..048a3680d1
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgOptionsScreen.wxc
@@ -0,0 +1,405 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2020-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerContents centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxGridBagSizer sizerContents]
+grid = 5 5
+grow = yes
+contents = lTexts 0 0 1 2 left centered-y
+contents = cbTexts +1 0 1 2 left centered-y
+contents = $space(10) +1 0 1 2 left centered-y
+contents = lSplines +1 0 1 2 left centered-y
+contents = lSubsegs +1 0 1 1 right centered-y
+contents = spSubsegs . +1 1 1 left centered-y
+contents = $space(10) +1 0 1 2 left centered-y
+contents = lPointMoveOps +1 0 1 2 left centered-y
+contents = cbPointMoveOps +1 0 1 2 left centered-y
+
+[wxStaticText lTexts]
+text = pTexts[636]
+
+[wxCheckBox cbTexts]
+text = pTexts[637]
+tip = pTexts[638]
+id = WXD_ID_EXACT
+
+[wxStaticText lSplines]
+text = pTexts[632]
+
+[wxStaticText lSubsegs]
+text = pTexts[633]
+
+[wxSpinCtrl spSubsegs]
+id = WXD_ID_SUBSEGS
+range = 2 32
+value = 4
+tip = pTexts[634]
+
+[wxStaticText lPointMoveOps]
+text = pTexts[639]
+
+[wxCheckBox cbPointMoveOps]
+text = pTexts[640]
+tip = pTexts[641]
+id = WXD_ID_POINT_OPS
+
+
+[wxStdDialogButtonSizer sizerButtons]
+grow = yes
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pTexts[476]
+tip = pTexts[478]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[477]
+tip = pTexts[479]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+%% class start
+
+/** Dialog to change dot details.
+*/
+class WxdkdrawDlgOptionsScreen : public wxDialog
+{
+ private:
+
+ /** Events to process.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+%% class end
+
+ protected:
+
+ /** Red colour for group titles.
+ */
+ wxColour m_oColourRed;
+
+ /** Parent frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Drawing control to refresh on changes.
+ */
+ wxControl *m_pControl;
+
+ /** Entire drawing.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Localized text fragments.
+ */
+ wxChar const * const *m_sTexts;
+
+ /** Address of subsegments variable.
+ */
+ int *m_pSubsegs;
+
+ /** Address of exact fonts variable.
+ */
+ int *m_pExact;
+
+ /** Address of variable for markup reduction.
+ */
+ int *m_pReduceMarkup;
+
+ /** Initial value for number of subsegments.
+ */
+ int m_iSubsegments;
+
+ /** Initial value for exact font flag.
+ */
+ int m_iExact;
+
+ /** Initial value for markup reduction.
+ */
+ int m_iReduceMarkup;
+
+ public:
+
+ /** Control events.
+ */
+ enum {
+ WXD_ID_SUBSEGS = (wxID_HIGHEST + 1), /**< Subsegs changed. */
+ WXD_ID_EXACT , /**< Use exact fonts. */
+ WXD_ID_POINT_OPS , /**< Reduce markup. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (programs main window).
+ @param pControl Drawing control.
+ @param pDrw Drawing.
+ @param pSubsegs Address of sub-segments variable.
+ @param pExact Address of exact font variables.
+ @param pReduce Address of variable to reduce markup.
+ @param pTexts Localized text fragments.
+ */
+ WxdkdrawDlgOptionsScreen(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ int *pSubsegs,
+ int *pExact,
+ int *pReduce,
+ wxChar const * const *pTexts
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Subsegs spin control handler.
+ @param event Event to process.
+ */
+ void
+ OnSubsegs(wxSpinEvent & event);
+
+ /** Handler for checkbox change.
+ @param event Event to process.
+ */
+ void
+ OnFontExact(wxCommandEvent & event);
+
+ /** Handler for reduce markup checkbox change.
+ @param event Event to process.
+ */
+ void
+ OnMarkupReduce(wxCommandEvent & event);
+
+};
+
+
+%% header end
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgOptionsScreen.h"
+#endif
+
+
+$!trace-include
+
+
+/** Events to process in this dialog.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgOptionsScreen,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgOptionsScreen,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgOptionsScreen::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgOptionsScreen::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgOptionsScreen::WXD_ID_SUBSEGS,\
+ WxdkdrawDlgOptionsScreen::OnSubsegs\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgOptionsScreen::WXD_ID_EXACT,\
+ WxdkdrawDlgOptionsScreen::OnFontExact\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawDlgOptionsScreen::WXD_ID_POINT_OPS,\
+ WxdkdrawDlgOptionsScreen::OnMarkupReduce\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+
+WxdkdrawDlgOptionsScreen::WxdkdrawDlgOptionsScreen(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ int *pSubsegs,
+ int *pExact,
+ int *pReduce,
+ wxChar const * const *pTexts
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[635],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+),
+#if defined(__WXMSW__)
+m_oColourRed(127, 0, 0)
+#else
+m_oColourRed(191, 0, 0)
+#endif
+{
+ m_pParent = pParent;
+ m_pControl = pControl;
+ m_pDrw = pDrw;
+ m_sTexts = pTexts;
+ m_pSubsegs = pSubsegs;
+ m_pExact = pExact;
+ m_pReduceMarkup = pReduce;
+ m_iSubsegments = *pSubsegs;
+ m_iExact = *pExact;
+ m_iReduceMarkup = *pReduce;
+
+%% constructor end
+ if (dkctGUILayoutOK) {
+ /*
+ Fix dialog size
+ */
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ /*
+ Retrieve object attributes
+ */
+ lSplines->SetForegroundColour(m_oColourRed);
+ lTexts->SetForegroundColour(m_oColourRed);
+ lPointMoveOps->SetForegroundColour(m_oColourRed);
+ cbTexts->SetValue((0 != *m_pExact));
+ spSubsegs->SetValue(*m_pSubsegs);
+ cbPointMoveOps->SetValue((0 != *m_pReduceMarkup));
+ }
+}
+
+
+%% module end
+
+
+void
+WxdkdrawDlgOptionsScreen::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ *m_pSubsegs = m_iSubsegments = spSubsegs->GetValue();
+ *m_pExact = m_iExact = (((cbTexts->GetValue()) ? 1 : 0));
+ *m_pReduceMarkup = m_iReduceMarkup =
+ (((cbPointMoveOps->GetValue()) ? 1 : 0));
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgOptionsScreen::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ *m_pSubsegs = m_iSubsegments;
+ *m_pExact = m_iExact;
+ *m_pReduceMarkup = m_iReduceMarkup;
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgOptionsScreen::OnSubsegs(wxSpinEvent & WXUNUSED(event))
+{
+ $? "+ OnSubsegs"
+ *m_pSubsegs = spSubsegs->GetValue();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_pControl->Refresh();
+ m_pParent->Update();
+ $? "- OnSubsegs"
+}
+
+
+
+void
+WxdkdrawDlgOptionsScreen::OnFontExact(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnFontExact"
+ *m_pExact = ((cbTexts->GetValue()) ? 1 : 0);
+ m_pParent->UpdateFonts();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_pControl->Refresh();
+ m_pParent->Refresh();
+ m_pParent->Update();
+ $? "- OnFontExact"
+}
+
+
+
+void
+WxdkdrawDlgOptionsScreen::OnMarkupReduce(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnMarkupReduce"
+ *m_pReduceMarkup = (((cbPointMoveOps->GetValue()) ? 1 : 0));
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_pControl->Refresh();
+ m_pParent->Refresh();
+ m_pParent->Update();
+ $? "- OnFontExact"
+ $? "- OnMarkupReduce"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgSplineValue.cpp b/support/dktools/WxdkdrawDlgSplineValue.cpp
new file mode 100644
index 0000000000..48372fd082
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgSplineValue.cpp
@@ -0,0 +1,280 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgSplineValue.wxc
+*/
+
+/** @file WxdkdrawDlgSplineValue.cpp The WxdkdrawDlgSplineValue module.
+*/
+
+
+#line 157 "WxdkdrawDlgSplineValue.wxc"
+
+#ifndef WXDKDRAWDLGSPLINEVALUE_H_INCLUDED
+#include "WxdkdrawDlgSplineValue.h"
+#endif
+
+
+
+#line 163 "WxdkdrawDlgSplineValue.wxc"
+
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgSplineValue,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgSplineValue,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgSplineValue::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgSplineValue::OnCancel\
+ )
+ EVT_SLIDER(\
+ WxdkdrawDlgSplineValue::WXD_ID_SVALUE,\
+ WxdkdrawDlgSplineValue::OnSlider\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 192 "WxdkdrawDlgSplineValue.wxc"
+WxdkdrawDlgSplineValue::WxdkdrawDlgSplineValue(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pLocTexts,
+ double *pDest
+) : wxDialog(
+ pParent, wxID_ANY, pLocTexts[422],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ int iSliderPosition;
+ wxString s;
+ m_pParent = pParent;
+ m_pControl = pControl;
+ m_pDrw = pDrw;
+ m_pDest = pDest;
+ m_dOriginal = *pDest;
+
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ lName = NULL;
+ lValue = NULL;
+ sValue = NULL;
+ sizerButtons = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ lName = new wxStaticText(
+ this,
+ wxID_ANY,
+ pLocTexts[429]
+ );
+ if(!(lName)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(
+ lName,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ lValue = new wxStaticText(
+ this,
+ wxID_ANY,
+ pLocTexts[430]
+ );
+ if(!(lValue)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(
+ lValue,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sValue = new wxSlider(
+ this,
+ WXD_ID_SVALUE,
+ 0,
+ -20,
+ 20
+ );
+ if(!(sValue)) {
+ goto dkctGUILayoutFinished;
+ }
+ sValue->SetToolTip(pLocTexts[428]);
+ sizerVertical->Add(
+ sValue,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pLocTexts[241]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pLocTexts[242]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pLocTexts[243]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pLocTexts[244]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical,
+ 1,
+ wxGROW
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 218 "WxdkdrawDlgSplineValue.wxc"
+ if (dkctGUILayoutOK) {
+ iSliderPosition = (int)(dk4ma_rint(20.0 * m_dOriginal));
+ if (-20 > iSliderPosition) { iSliderPosition = -20; }
+ if ( 20 < iSliderPosition) { iSliderPosition = 20; }
+ sValue->SetValue(iSliderPosition);
+ s.Printf(wxT("%g"), (((double)iSliderPosition) / 20.0));
+ lValue->SetLabel(s);
+ }
+}
+
+
+#line 229 "WxdkdrawDlgSplineValue.wxc"
+
+void
+WxdkdrawDlgSplineValue::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 234 "WxdkdrawDlgSplineValue.wxc"
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+
+
+#line 242 "WxdkdrawDlgSplineValue.wxc"
+}
+
+
+
+void
+WxdkdrawDlgSplineValue::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 250 "WxdkdrawDlgSplineValue.wxc"
+ *m_pDest = m_dOriginal;
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+
+
+#line 259 "WxdkdrawDlgSplineValue.wxc"
+}
+
+
+
+void
+WxdkdrawDlgSplineValue::OnSlider(wxCommandEvent & WXUNUSED(event))
+{
+ wxString s;
+ double d;
+ int i;
+
+
+#line 270 "WxdkdrawDlgSplineValue.wxc"
+ i = sValue->GetValue();
+ d = (double)i / 20.0;
+ *m_pDest = d;
+ s.Printf(wxT("%g"), d);
+ lValue->SetLabel(s);
+ lValue->Refresh();
+ Update();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_pControl->Refresh();
+ m_pParent->Update();
+
+
+#line 281 "WxdkdrawDlgSplineValue.wxc"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgSplineValue.h b/support/dktools/WxdkdrawDlgSplineValue.h
new file mode 100644
index 0000000000..b1d540de7a
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgSplineValue.h
@@ -0,0 +1,165 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgSplineValue.wxc
+*/
+
+/** @file WxdkdrawDlgSplineValue.h Header file for the WxdkdrawDlgSplineValue module.
+*/
+
+#ifndef WXDKDRAWDLGSPLINEVALUE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGSPLINEVALUE_H_INCLUDED 1
+
+
+#line 62 "WxdkdrawDlgSplineValue.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+#line 72 "WxdkdrawDlgSplineValue.wxc"
+
+/** Dialog to set s value for a point.
+*/
+class WxdkdrawDlgSplineValue : public wxDialog
+{
+ private:
+
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent frame (main window).
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Control to refresh on changes.
+ */
+ wxControl *m_pControl;
+
+ /** Drawing.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Address of s value variable.
+ */
+ double *m_pDest;
+
+ /** Original s value when dialog was started.
+ */
+ double m_dOriginal;
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgSplineValue.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 19 "WxdkdrawDlgSplineValue.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element lName.
+ */
+#line 31 "WxdkdrawDlgSplineValue.wxc"
+ wxStaticText *lName;
+
+ /** GUI element lValue.
+ */
+#line 34 "WxdkdrawDlgSplineValue.wxc"
+ wxStaticText *lValue;
+
+ /** GUI element sValue.
+ */
+#line 37 "WxdkdrawDlgSplineValue.wxc"
+ wxSlider *sValue;
+
+ /** GUI element sizerButtons.
+ */
+#line 45 "WxdkdrawDlgSplineValue.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element buttonOK.
+ */
+#line 50 "WxdkdrawDlgSplineValue.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 55 "WxdkdrawDlgSplineValue.wxc"
+ wxButton *buttonCancel;
+
+
+#line 108 "WxdkdrawDlgSplineValue.wxc"
+
+ public:
+
+ /** Window IDs.
+ */
+ enum {
+ WXD_ID_SVALUE = (wxID_HIGHEST + 1) /**< Slider for s value. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (main window).
+ @param pControl Control to redraw on change.
+ @param pDrw Drawing to modify.
+ @param pLocTexts Localized text fragments.
+ @param pDest Address of destination variable.
+ */
+ WxdkdrawDlgSplineValue(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pLocTexts,
+ double *pDest
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Slider handler
+ @param event Event to process.
+ */
+ void
+ OnSlider(wxCommandEvent & event);
+};
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#line 154 "WxdkdrawDlgSplineValue.wxc"
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgSplineValue.wxc b/support/dktools/WxdkdrawDlgSplineValue.wxc
new file mode 100644
index 0000000000..f39ee25cff
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgSplineValue.wxc
@@ -0,0 +1,286 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+proportion = 1
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+grow = yes
+proportion = 1
+contents = $space(10)
+contents = lName centered-x
+contents = lValue centered-x
+contents = sValue centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxStaticText lName]
+text = pLocTexts[429]
+
+[wxStaticText lValue]
+text = pLocTexts[430]
+
+[wxSlider sValue]
+id = WXD_ID_SVALUE
+direction = horizontal
+range = -20 20
+value = 0
+grow = yes
+tip = pLocTexts[428]
+
+[wxStdDialogButtonSizer sizerButtons]
+grow = yes
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pLocTexts[241]
+tip = pLocTexts[242]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pLocTexts[243]
+tip = pLocTexts[244]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+%% class start
+
+/** Dialog to set s value for a point.
+*/
+class WxdkdrawDlgSplineValue : public wxDialog
+{
+ private:
+
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Parent frame (main window).
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Control to refresh on changes.
+ */
+ wxControl *m_pControl;
+
+ /** Drawing.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Address of s value variable.
+ */
+ double *m_pDest;
+
+ /** Original s value when dialog was started.
+ */
+ double m_dOriginal;
+
+%% class end
+
+ public:
+
+ /** Window IDs.
+ */
+ enum {
+ WXD_ID_SVALUE = (wxID_HIGHEST + 1) /**< Slider for s value. */
+ };
+
+ /** Constructor.
+ @param pParent Parent frame (main window).
+ @param pControl Control to redraw on change.
+ @param pDrw Drawing to modify.
+ @param pLocTexts Localized text fragments.
+ @param pDest Address of destination variable.
+ */
+ WxdkdrawDlgSplineValue(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pLocTexts,
+ double *pDest
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Slider handler
+ @param event Event to process.
+ */
+ void
+ OnSlider(wxCommandEvent & event);
+};
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% header end
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGSPLINEVALUE_H_INCLUDED
+#include "WxdkdrawDlgSplineValue.h"
+#endif
+
+$!trace-include
+
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgSplineValue,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgSplineValue,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgSplineValue::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgSplineValue::OnCancel\
+ )
+ EVT_SLIDER(\
+ WxdkdrawDlgSplineValue::WXD_ID_SVALUE,\
+ WxdkdrawDlgSplineValue::OnSlider\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+WxdkdrawDlgSplineValue::WxdkdrawDlgSplineValue(
+ WxdkdrawFrame *pParent,
+ wxControl *pControl,
+ Wxd_drawing_t *pDrw,
+ wxChar const * const *pLocTexts,
+ double *pDest
+) : wxDialog(
+ pParent, wxID_ANY, pLocTexts[422],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ int iSliderPosition;
+ wxString s;
+ m_pParent = pParent;
+ m_pControl = pControl;
+ m_pDrw = pDrw;
+ m_pDest = pDest;
+ m_dOriginal = *pDest;
+
+%% constructor end
+ if (dkctGUILayoutOK) {
+ iSliderPosition = (int)(dk4ma_rint(20.0 * m_dOriginal));
+ if (-20 > iSliderPosition) { iSliderPosition = -20; }
+ if ( 20 < iSliderPosition) { iSliderPosition = 20; }
+ sValue->SetValue(iSliderPosition);
+ s.Printf(wxT("%g"), (((double)iSliderPosition) / 20.0));
+ lValue->SetLabel(s);
+ }
+}
+
+%% module end
+
+void
+WxdkdrawDlgSplineValue::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnOK"
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ $? "- OnOK"
+}
+
+
+
+void
+WxdkdrawDlgSplineValue::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnCancel"
+ *m_pDest = m_dOriginal;
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+ $? "- OnCancel"
+}
+
+
+
+void
+WxdkdrawDlgSplineValue::OnSlider(wxCommandEvent & WXUNUSED(event))
+{
+ wxString s;
+ double d;
+ int i;
+ $? "+ OnSlider"
+ i = sValue->GetValue();
+ d = (double)i / 20.0;
+ *m_pDest = d;
+ s.Printf(wxT("%g"), d);
+ lValue->SetLabel(s);
+ lValue->Refresh();
+ Update();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_pControl->Refresh();
+ m_pParent->Update();
+ $? "- OnSlider"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgStyleLength.cpp b/support/dktools/WxdkdrawDlgStyleLength.cpp
new file mode 100644
index 0000000000..d567d76b8b
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgStyleLength.cpp
@@ -0,0 +1,297 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgStyleLength.wxc
+*/
+
+/** @file WxdkdrawDlgStyleLength.cpp The WxdkdrawDlgStyleLength module.
+*/
+
+
+#line 150 "WxdkdrawDlgStyleLength.wxc"
+
+#ifndef WXDKDRAWDLGSTYLELENGTH_H_INCLUDED
+#include "WxdkdrawDlgStyleLength.h"
+#endif
+
+
+
+
+
+#line 158 "WxdkdrawDlgStyleLength.wxc"
+
+
+
+/** Assign function calls to events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgStyleLength,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgStyleLength,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgStyleLength::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgStyleLength::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgStyleLength::WXD_ID_SL_LENGTH,\
+ WxdkdrawDlgStyleLength::OnSpin\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 188 "WxdkdrawDlgStyleLength.wxc"
+WxdkdrawDlgStyleLength::WxdkdrawDlgStyleLength(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ bool bDrwElem,
+ wxChar const * const *pText
+) : wxDialog(
+ pParent, wxID_ANY, pText[225],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+
+)
+{
+
+
+#line 206 "WxdkdrawDlgStyleLength.wxc"
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+
+ m_uLengthOriginal = pObject->sl;
+ m_uLengthCurrent = m_uLengthOriginal;
+
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerInput = NULL;
+ sizerButtons = NULL;
+ labelStyleLength = NULL;
+ spinStyleLength = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerInput = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerInput)) {
+ goto dkctGUILayoutFinished;
+ }
+ labelStyleLength = new wxStaticText(
+ this,
+ wxID_ANY,
+ pText[226]
+ );
+ if(!(labelStyleLength)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerInput->Add(
+ labelStyleLength
+ );
+ sizerInput->Add(10, 10, 0);
+ spinStyleLength = new wxSpinCtrl(
+ this,
+ WXD_ID_SL_LENGTH,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 255,
+ 4
+ );
+ if(!(spinStyleLength)) {
+ goto dkctGUILayoutFinished;
+ }
+ spinStyleLength->SetToolTip(pText[227]);
+ sizerInput->Add(
+ spinStyleLength
+ );
+ sizerVertical->Add(
+ sizerInput
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pText[228]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pText[229]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pText[230]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pText[231]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 214 "WxdkdrawDlgStyleLength.wxc"
+
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+
+
+#line 220 "WxdkdrawDlgStyleLength.wxc"
+}
+
+
+
+
+#line 225 "WxdkdrawDlgStyleLength.wxc"
+
+
+
+void
+WxdkdrawDlgStyleLength::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+
+
+#line 233 "WxdkdrawDlgStyleLength.wxc"
+
+ m_uLengthCurrent = spinStyleLength->GetValue();
+ if ((m_bDrwElem) && (m_uLengthCurrent != m_pObject->sl)) {
+ bDoRefresh = true;
+ }
+ m_pObject->sl = m_uLengthCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+
+
+#line 250 "WxdkdrawDlgStyleLength.wxc"
+}
+
+
+
+void
+WxdkdrawDlgStyleLength::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+
+
+#line 259 "WxdkdrawDlgStyleLength.wxc"
+ m_uLengthCurrent = m_uLengthOriginal;
+ if ((m_bDrwElem) && (m_uLengthCurrent != m_pObject->sl)) {
+ bDoRefresh = true;
+ }
+ m_pObject->sl = m_uLengthCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+
+
+#line 275 "WxdkdrawDlgStyleLength.wxc"
+}
+
+
+
+void
+WxdkdrawDlgStyleLength::OnSpin(wxSpinEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+
+
+#line 284 "WxdkdrawDlgStyleLength.wxc"
+ m_uLengthCurrent = spinStyleLength->GetValue();
+ if ((m_bDrwElem) && (m_pObject->sl != m_uLengthCurrent)) {
+ bDoRefresh = true;
+ }
+ m_pObject->sl = m_uLengthCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+
+
+#line 293 "WxdkdrawDlgStyleLength.wxc"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgStyleLength.h b/support/dktools/WxdkdrawDlgStyleLength.h
new file mode 100644
index 0000000000..daff17bedd
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgStyleLength.h
@@ -0,0 +1,165 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgStyleLength.wxc
+*/
+
+/** @file WxdkdrawDlgStyleLength.h Header file for the WxdkdrawDlgStyleLength module.
+*/
+
+#ifndef WXDKDRAWDLGSTYLELENGTH_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGSTYLELENGTH_H_INCLUDED 1
+
+
+#line 55 "WxdkdrawDlgStyleLength.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+#line 67 "WxdkdrawDlgStyleLength.wxc"
+
+/** Dialog to mofify style length.
+ The style length is the dash length in integer multiples of the line width.
+*/
+class WxdkdrawDlgStyleLength : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Applications main frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Original style length.
+ */
+ uint8_t m_uLengthOriginal;
+
+ /** Style length set up in dialog.
+ */
+ uint8_t m_uLengthCurrent;
+
+ /** Flag: Object is drawing element, not default style collection.
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for GUI components.
+ */
+ enum {
+ WXD_ID_SL_LENGTH = (wxID_HIGHEST + 1) /**< Spin control. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param bDrwElem Flag: Object is drawing element.
+ @param pText Localized text fragments.
+ */
+ WxdkdrawDlgStyleLength(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ bool bDrwElem,
+ wxChar const * const *pText
+ );
+
+ /** Handler for OK button.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Handler for spin control.
+ @param event Event to process.
+ */
+ void
+ OnSpin(wxSpinEvent & event);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 11 "WxdkdrawDlgStyleLength.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 17 "WxdkdrawDlgStyleLength.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerInput.
+ */
+#line 25 "WxdkdrawDlgStyleLength.wxc"
+ wxBoxSizer *sizerInput;
+
+ /** GUI element sizerButtons.
+ */
+#line 39 "WxdkdrawDlgStyleLength.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element labelStyleLength.
+ */
+#line 30 "WxdkdrawDlgStyleLength.wxc"
+ wxStaticText *labelStyleLength;
+
+ /** GUI element spinStyleLength.
+ */
+#line 33 "WxdkdrawDlgStyleLength.wxc"
+ wxSpinCtrl *spinStyleLength;
+
+ /** GUI element buttonOK.
+ */
+#line 43 "WxdkdrawDlgStyleLength.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 48 "WxdkdrawDlgStyleLength.wxc"
+ wxButton *buttonCancel;
+
+
+#line 145 "WxdkdrawDlgStyleLength.wxc"
+};
+
+
+#line 148 "WxdkdrawDlgStyleLength.wxc"
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgStyleLength.wxc b/support/dktools/WxdkdrawDlgStyleLength.wxc
new file mode 100644
index 0000000000..b32712619b
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgStyleLength.wxc
@@ -0,0 +1,299 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerInput
+contents = $space(10)
+contents = sizerButtons
+contents = $space(10)
+
+[wxBoxSizer sizerInput]
+contents = labelStyleLength
+contents = $space(10)
+contents = spinStyleLength
+
+[wxStaticText labelStyleLength]
+text = pText[226]
+
+[wxSpinCtrl spinStyleLength]
+id = WXD_ID_SL_LENGTH
+range = 1 255
+value = 4
+tip = pText[227]
+
+[wxStdDialogButtonSizer sizerButtons]
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pText[228]
+tip = pText[229]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pText[230]
+tip = pText[231]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+%% class start
+
+/** Dialog to mofify style length.
+ The style length is the dash length in integer multiples of the line width.
+*/
+class WxdkdrawDlgStyleLength : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Applications main frame.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Original style length.
+ */
+ uint8_t m_uLengthOriginal;
+
+ /** Style length set up in dialog.
+ */
+ uint8_t m_uLengthCurrent;
+
+ /** Flag: Object is drawing element, not default style collection.
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for GUI components.
+ */
+ enum {
+ WXD_ID_SL_LENGTH = (wxID_HIGHEST + 1) /**< Spin control. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param bDrwElem Flag: Object is drawing element.
+ @param pText Localized text fragments.
+ */
+ WxdkdrawDlgStyleLength(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ bool bDrwElem,
+ wxChar const * const *pText
+ );
+
+ /** Handler for OK button.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Handler for spin control.
+ @param event Event to process.
+ */
+ void
+ OnSpin(wxSpinEvent & event);
+
+%% class end
+};
+
+%% header end
+
+%% module start
+
+#ifndef WXDKDRAWDLGSTYLELENGTH_H_INCLUDED
+#include "WxdkdrawDlgStyleLength.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Assign function calls to events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgStyleLength,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgStyleLength,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgStyleLength::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgStyleLength::OnCancel\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawDlgStyleLength::WXD_ID_SL_LENGTH,\
+ WxdkdrawDlgStyleLength::OnSpin\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+WxdkdrawDlgStyleLength::WxdkdrawDlgStyleLength(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ bool bDrwElem,
+ wxChar const * const *pText
+) : wxDialog(
+ pParent, wxID_ANY, pText[225],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+
+)
+{
+ $? "+ WxdkdrawDlgStyleLength"
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_bDrwElem = bDrwElem;
+
+ m_uLengthOriginal = pObject->sl;
+ m_uLengthCurrent = m_uLengthOriginal;
+
+%% constructor end
+
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+ $? "- WxdkdrawDlgStyleLength"
+}
+
+
+
+%% module end
+
+
+
+void
+WxdkdrawDlgStyleLength::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ $? "+ OnOK"
+
+ m_uLengthCurrent = spinStyleLength->GetValue();
+ if ((m_bDrwElem) && (m_uLengthCurrent != m_pObject->sl)) {
+ bDoRefresh = true;
+ }
+ m_pObject->sl = m_uLengthCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ $? "- OnOK"
+}
+
+
+
+void
+WxdkdrawDlgStyleLength::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ $? "+ OnCancel"
+ m_uLengthCurrent = m_uLengthOriginal;
+ if ((m_bDrwElem) && (m_uLengthCurrent != m_pObject->sl)) {
+ bDoRefresh = true;
+ }
+ m_pObject->sl = m_uLengthCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+ $? "- OnCancel"
+}
+
+
+
+void
+WxdkdrawDlgStyleLength::OnSpin(wxSpinEvent & WXUNUSED(event))
+{
+ bool bDoRefresh = false;
+ $? "+ OnSpin"
+ m_uLengthCurrent = spinStyleLength->GetValue();
+ if ((m_bDrwElem) && (m_pObject->sl != m_uLengthCurrent)) {
+ bDoRefresh = true;
+ }
+ m_pObject->sl = m_uLengthCurrent;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ $? "- OnSpin %u", (unsigned)(m_uLengthCurrent)
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawDlgTextAlign.cpp b/support/dktools/WxdkdrawDlgTextAlign.cpp
new file mode 100644
index 0000000000..fccef65f1a
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgTextAlign.cpp
@@ -0,0 +1,261 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgTextAlign.wxc
+*/
+
+/** @file WxdkdrawDlgTextAlign.cpp The WxdkdrawDlgTextAlign module.
+*/
+
+
+#line 156 "WxdkdrawDlgTextAlign.wxc"
+
+#ifndef WXDKDRAWDLGTEXTALIGN_H_INCLUDED
+#include "WxdkdrawDlgTextAlign.h"
+#endif
+
+
+
+
+
+#line 164 "WxdkdrawDlgTextAlign.wxc"
+
+
+/** Assign methods to events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgTextAlign,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgTextAlign,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgTextAlign::OnCancel\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgTextAlign::WXD_ID_TA_LEFT,\
+ WxdkdrawDlgTextAlign::OnTextAlign\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgTextAlign::WXD_ID_TA_CENTERED,\
+ WxdkdrawDlgTextAlign::OnTextAlign\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgTextAlign::WXD_ID_TA_RIGHT,\
+ WxdkdrawDlgTextAlign::OnTextAlign\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 197 "WxdkdrawDlgTextAlign.wxc"
+WxdkdrawDlgTextAlign::WxdkdrawDlgTextAlign(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[290],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_uTextAlign = WXD_TA_LEFT;
+ m_bDrwElem = bDrwElem;
+ if (WXD_OT_TEXT == pObject->ot) { m_uTextAlign = (pObject->det).t.al; }
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerButtons = NULL;
+ buttonCancel = NULL;
+ buttonLeft = NULL;
+ buttonCentered = NULL;
+ buttonRight = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonLeft = new wxBitmapButton(
+ this,
+ WXD_ID_TA_LEFT,
+ pImages[0]
+ );
+ if(!(buttonLeft)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonLeft->SetToolTip(pTexts[291]);
+ sizerButtons->Add(
+ buttonLeft,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonCentered = new wxBitmapButton(
+ this,
+ WXD_ID_TA_CENTERED,
+ pImages[1]
+ );
+ if(!(buttonCentered)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCentered->SetToolTip(pTexts[292]);
+ sizerButtons->Add(
+ buttonCentered,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerButtons->Add(10, 10, 0);
+ buttonRight = new wxBitmapButton(
+ this,
+ WXD_ID_TA_RIGHT,
+ pImages[2]
+ );
+ if(!(buttonRight)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonRight->SetToolTip(pTexts[293]);
+ sizerButtons->Add(
+ buttonRight,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pTexts[294]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pTexts[295]);
+ sizerVertical->Add(
+ buttonCancel,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 220 "WxdkdrawDlgTextAlign.wxc"
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+
+#line 227 "WxdkdrawDlgTextAlign.wxc"
+
+
+void
+WxdkdrawDlgTextAlign::OnTextAlign(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+ switch (event.GetId()) {
+ case WXD_ID_TA_LEFT : {
+ m_uTextAlign = WXD_TA_LEFT;
+ } break;
+ case WXD_ID_TA_CENTERED : {
+ m_uTextAlign = WXD_TA_CENTERED;
+ } break;
+ case WXD_ID_TA_RIGHT : {
+ m_uTextAlign = WXD_TA_RIGHT;
+ } break;
+ }
+ if ((m_bDrwElem) && ((m_pObject->det).t.al != m_uTextAlign)) {
+ bDoRefresh = true;
+ }
+ (m_pObject->det).t.al = m_uTextAlign;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgTextAlign::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+#if 0
+
+uint8_t
+WxdkdrawDlgTextAlign::GetTextAlign(void)
+const
+{
+ return m_uTextAlign;
+}
+
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawDlgTextAlign.h b/support/dktools/WxdkdrawDlgTextAlign.h
new file mode 100644
index 0000000000..a857300768
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgTextAlign.h
@@ -0,0 +1,165 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgTextAlign.wxc
+*/
+
+/** @file WxdkdrawDlgTextAlign.h Header file for the WxdkdrawDlgTextAlign module.
+*/
+
+#ifndef WXDKDRAWDLGTEXTALIGN_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGTEXTALIGN_H_INCLUDED 1
+
+
+#line 56 "WxdkdrawDlgTextAlign.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#line 67 "WxdkdrawDlgTextAlign.wxc"
+
+
+/** Text alignment dialog.
+*/
+class WxdkdrawDlgTextAlign : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Program main window.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Text align set up in dialog.
+ */
+ uint8_t m_uTextAlign;
+
+ /** Is drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for text align buttons.
+ */
+ enum {
+ WXD_ID_TA_LEFT = (wxID_HIGHEST + 1), /**< Left aligned text. */
+ WXD_ID_TA_CENTERED , /**< Centered text. */
+ WXD_ID_TA_RIGHT /**< Right aligned text. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Is drawing element (true) or default (false).
+ */
+ WxdkdrawDlgTextAlign(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for text align buttons.
+ @param event Event to process.
+ */
+ void
+ OnTextAlign(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+#if 0
+
+ /** Retrieve text alignment.
+ @return Text alignment selected in dialog.
+ */
+ uint8_t
+ GetTextAlign(void) const;
+
+#endif
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgTextAlign.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 18 "WxdkdrawDlgTextAlign.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerButtons.
+ */
+#line 26 "WxdkdrawDlgTextAlign.wxc"
+ wxBoxSizer *sizerButtons;
+
+ /** GUI element buttonCancel.
+ */
+#line 49 "WxdkdrawDlgTextAlign.wxc"
+ wxButton *buttonCancel;
+
+ /** GUI element buttonLeft.
+ */
+#line 34 "WxdkdrawDlgTextAlign.wxc"
+ wxBitmapButton *buttonLeft;
+
+ /** GUI element buttonCentered.
+ */
+#line 39 "WxdkdrawDlgTextAlign.wxc"
+ wxBitmapButton *buttonCentered;
+
+ /** GUI element buttonRight.
+ */
+#line 44 "WxdkdrawDlgTextAlign.wxc"
+ wxBitmapButton *buttonRight;
+
+
+#line 149 "WxdkdrawDlgTextAlign.wxc"
+};
+
+
+
+#line 153 "WxdkdrawDlgTextAlign.wxc"
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgTextAlign.wxc b/support/dktools/WxdkdrawDlgTextAlign.wxc
new file mode 100644
index 0000000000..956170d3f6
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgTextAlign.wxc
@@ -0,0 +1,289 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+contents = buttonCancel centered-x
+contents = $space(10)
+
+[wxBoxSizer sizerButtons]
+direction = horizontal
+contents = buttonLeft centered-y
+contents = $space(10)
+contents = buttonCentered centered-y
+contents = $space(10)
+contents = buttonRight centered-y
+
+[wxBitmapButton buttonLeft]
+id = WXD_ID_TA_LEFT
+bitmap = pImages[0]
+tip = pTexts[291]
+
+[wxBitmapButton buttonCentered]
+id = WXD_ID_TA_CENTERED
+bitmap = pImages[1]
+tip = pTexts[292]
+
+[wxBitmapButton buttonRight]
+id = WXD_ID_TA_RIGHT
+bitmap = pImages[2]
+tip = pTexts[293]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pTexts[294]
+tip = pTexts[295]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+%% class start
+
+
+/** Text alignment dialog.
+*/
+class WxdkdrawDlgTextAlign : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Program main window.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Object to modify.
+ */
+ Wxd_object_t *m_pObject;
+
+ /** Text align set up in dialog.
+ */
+ uint8_t m_uTextAlign;
+
+ /** Is drawing element (true) or default style object (false).
+ */
+ bool m_bDrwElem;
+
+ public:
+
+ /** Window IDs for text align buttons.
+ */
+ enum {
+ WXD_ID_TA_LEFT = (wxID_HIGHEST + 1), /**< Left aligned text. */
+ WXD_ID_TA_CENTERED , /**< Centered text. */
+ WXD_ID_TA_RIGHT /**< Right aligned text. */
+ };
+
+ /** Constructor.
+ @param pParent Applications main frame.
+ @param pObject Object to modify.
+ @param pTexts Localized text fragments.
+ @param pImages Images for line style buttons.
+ @param bDrwElem Is drawing element (true) or default (false).
+ */
+ WxdkdrawDlgTextAlign(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+ );
+
+ /** Handler for text align buttons.
+ @param event Event to process.
+ */
+ void
+ OnTextAlign(wxCommandEvent & event);
+
+ /** Handler for Cancel button.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+#if 0
+
+ /** Retrieve text alignment.
+ @return Text alignment selected in dialog.
+ */
+ uint8_t
+ GetTextAlign(void) const;
+
+#endif
+
+%% class end
+};
+
+
+%% header end
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGTEXTALIGN_H_INCLUDED
+#include "WxdkdrawDlgTextAlign.h"
+#endif
+
+
+
+$!trace-include
+
+
+/** Assign methods to events.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgTextAlign,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgTextAlign,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgTextAlign::OnCancel\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgTextAlign::WXD_ID_TA_LEFT,\
+ WxdkdrawDlgTextAlign::OnTextAlign\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgTextAlign::WXD_ID_TA_CENTERED,\
+ WxdkdrawDlgTextAlign::OnTextAlign\
+ )
+ EVT_BUTTON(\
+ WxdkdrawDlgTextAlign::WXD_ID_TA_RIGHT,\
+ WxdkdrawDlgTextAlign::OnTextAlign\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+WxdkdrawDlgTextAlign::WxdkdrawDlgTextAlign(
+ WxdkdrawFrame *pParent,
+ Wxd_object_t *pObject,
+ wxChar const * const *pTexts,
+ const char ** const *pImages,
+ bool bDrwElem
+) : wxDialog(
+ pParent, wxID_ANY, pTexts[290],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ (wxDEFAULT_DIALOG_STYLE)
+ & (~(wxRESIZE_BORDER))
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+)
+{
+ m_pParent = pParent;
+ m_pObject = pObject;
+ m_uTextAlign = WXD_TA_LEFT;
+ m_bDrwElem = bDrwElem;
+ if (WXD_OT_TEXT == pObject->ot) { m_uTextAlign = (pObject->det).t.al; }
+%% constructor end
+ if (dkctGUILayoutOK) {
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+ }
+}
+
+%% module end
+
+
+void
+WxdkdrawDlgTextAlign::OnTextAlign(wxCommandEvent & event)
+{
+ bool bDoRefresh = false;
+ switch (event.GetId()) {
+ case WXD_ID_TA_LEFT : {
+ m_uTextAlign = WXD_TA_LEFT;
+ } break;
+ case WXD_ID_TA_CENTERED : {
+ m_uTextAlign = WXD_TA_CENTERED;
+ } break;
+ case WXD_ID_TA_RIGHT : {
+ m_uTextAlign = WXD_TA_RIGHT;
+ } break;
+ }
+ if ((m_bDrwElem) && ((m_pObject->det).t.al != m_uTextAlign)) {
+ bDoRefresh = true;
+ }
+ (m_pObject->det).t.al = m_uTextAlign;
+ if (bDoRefresh) {
+ m_pParent->RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgTextAlign::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+#if 0
+
+uint8_t
+WxdkdrawDlgTextAlign::GetTextAlign(void)
+const
+{
+ return m_uTextAlign;
+}
+
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawDlgTextInput.cpp b/support/dktools/WxdkdrawDlgTextInput.cpp
new file mode 100644
index 0000000000..984a1d8183
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgTextInput.cpp
@@ -0,0 +1,495 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgTextInput.wxc
+*/
+
+/** @file WxdkdrawDlgTextInput.cpp The WxdkdrawDlgTextInput module.
+*/
+
+
+#line 208 "WxdkdrawDlgTextInput.wxc"
+
+#ifndef WXDKDRAWDLGTEXTINPUT_H_INCLUDED
+#include "WxdkdrawDlgTextInput.h"
+#endif
+
+
+
+
+#line 215 "WxdkdrawDlgTextInput.wxc"
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgTextInput,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgTextInput,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgTextInput::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgTextInput::OnCancel\
+ )
+ EVT_TEXT_ENTER(\
+ WXD_ID_EXPORT_TEXT,\
+ WxdkdrawDlgTextInput::OnExportText\
+ )
+ EVT_TEXT_ENTER(\
+ WXD_ID_SCREEN_TEXT,\
+ WxdkdrawDlgTextInput::OnScreenText\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+#line 247 "WxdkdrawDlgTextInput.wxc"
+WxdkdrawDlgTextInput::WxdkdrawDlgTextInput(
+ WxdkdrawFrame *pParent,
+ wxChar const * const *pLocTexts,
+ wxChar const * const *pNlTexts,
+ wxChar **ppExport,
+ wxChar **ppScreen,
+ bool bLaTeX,
+ dk4_er_t *pErrorReport
+) : wxDialog(
+ pParent, wxID_ANY, pLocTexts[400],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ ((wxDEFAULT_DIALOG_STYLE) | (wxRESIZE_BORDER))
+#if 0
+ & (~(wxRESIZE_BORDER))
+#endif
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+),
+m_cRed(0x7F, 0, 0)
+{
+ m_pParent = pParent;
+ m_bLaTeX = bLaTeX;
+ m_ppExport = ppExport;
+ m_ppScreen = ppScreen;
+ m_pLocTexts = pLocTexts;
+ m_pErrorReport = pErrorReport;
+ dkctGUILayoutOK = false;
+ sizerHorizontal = NULL;
+ sizerVertical = NULL;
+ sizerContents = NULL;
+ sizerButtons = NULL;
+ labelExport = NULL;
+ textExport = NULL;
+ labelScreen = NULL;
+ textScreen = NULL;
+ buttonOK = NULL;
+ buttonCancel = NULL;
+ sizerHorizontal = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(sizerHorizontal)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerHorizontal->Add(10, 10, 0);
+ sizerVertical = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerVertical)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerVertical->Add(10, 10, 0);
+ sizerContents = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(sizerContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ labelExport = new wxStaticText(
+ this,
+ wxID_ANY,
+ pLocTexts[396]
+ );
+ if(!(labelExport)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ labelExport,
+ 0,
+ wxALIGN_LEFT
+ );
+ textExport = new wxTextCtrl(
+ this,
+ WXD_ID_EXPORT_TEXT,
+ pNlTexts[20],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxTE_PROCESS_ENTER
+ );
+ if(!(textExport)) {
+ goto dkctGUILayoutFinished;
+ }
+ textExport->SetToolTip(pLocTexts[398]);
+ sizerContents->Add(
+ textExport,
+ 1,
+ wxALIGN_LEFT|wxGROW
+ );
+ sizerContents->Add(10, 10, 0);
+ labelScreen = new wxStaticText(
+ this,
+ wxID_ANY,
+ pLocTexts[397]
+ );
+ if(!(labelScreen)) {
+ goto dkctGUILayoutFinished;
+ }
+ sizerContents->Add(
+ labelScreen,
+ 0,
+ wxALIGN_LEFT
+ );
+ textScreen = new wxTextCtrl(
+ this,
+ WXD_ID_SCREEN_TEXT,
+ pNlTexts[20],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxTE_PROCESS_ENTER
+ );
+ if(!(textScreen)) {
+ goto dkctGUILayoutFinished;
+ }
+ textScreen->SetToolTip(pLocTexts[399]);
+ sizerContents->Add(
+ textScreen,
+ 1,
+ wxALIGN_LEFT|wxGROW
+ );
+ sizerVertical->Add(
+ sizerContents,
+ 1,
+ wxALIGN_CENTER_HORIZONTAL|wxGROW
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerButtons = new wxStdDialogButtonSizer(
+ );
+ if(!(sizerButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK = new wxButton(
+ this,
+ wxID_OK,
+ pLocTexts[259]
+ );
+ if(!(buttonOK)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonOK->SetToolTip(pLocTexts[401]);
+ sizerButtons->AddButton(
+ buttonOK
+ );
+ buttonCancel = new wxButton(
+ this,
+ wxID_CANCEL,
+ pLocTexts[260]
+ );
+ if(!(buttonCancel)) {
+ goto dkctGUILayoutFinished;
+ }
+ buttonCancel->SetToolTip(pLocTexts[402]);
+ sizerButtons->AddButton(
+ buttonCancel
+ );
+ sizerButtons->Realize();
+ sizerVertical->Add(
+ sizerButtons,
+ 0,
+ wxALIGN_CENTER_HORIZONTAL
+ );
+ sizerVertical->Add(10, 10, 0);
+ sizerHorizontal->Add(
+ sizerVertical,
+ 1,
+ wxGROW
+ );
+ sizerHorizontal->Add(10, 10, 0);
+ SetSizer(sizerHorizontal);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+ if(dkctGUILayoutOK) {
+ sizerHorizontal->Fit(this);
+ sizerHorizontal->SetSizeHints(this);
+ }
+
+#line 276 "WxdkdrawDlgTextInput.wxc"
+ if (dkctGUILayoutOK) {
+ if (NULL != *ppExport) {
+ wxString str(*ppExport);
+ {
+ textExport->SetValue(str);
+ }
+ }
+ else {
+ textExport->SetValue(pNlTexts[19]);
+ }
+ if ((bLaTeX) && (NULL != *ppScreen)) {
+ wxString str(*ppScreen);
+ {
+ textScreen->SetValue(str);
+ }
+ }
+ else {
+ textScreen->SetValue(pNlTexts[19]);
+ }
+ if (!(bLaTeX)) {
+ textScreen->Enable(false);
+ }
+#if 0
+ panelContents->Layout();
+#endif
+ Layout();
+#if 0
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+#endif
+ }
+}
+
+
+
+#line 311 "WxdkdrawDlgTextInput.wxc"
+
+
+
+bool
+WxdkdrawDlgTextInput::CheckSufficientInput(void)
+{
+ bool back = false;
+ wxString exportString = textExport->GetValue();
+ {
+ wxCStrData exportCstr = exportString.c_str();
+ {
+ wxChar const *exportPtr = (wxChar const *)exportCstr;
+ if (NULL != exportPtr) {
+ if ((size_t)0U < dk4strx_len(exportPtr)) {
+ back = true;
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawDlgTextInput::TransferInputData(void)
+{
+ bool successExport = false;
+ wxString exportString = textExport->GetValue();
+ {
+ wxCStrData exportCstr = exportString.c_str();
+ {
+ wxChar const *exportPtr = (wxChar const *)exportCstr;
+ if (NULL != exportPtr) {
+ if ((size_t)0U < dk4strx_len(exportPtr)) {
+ wxChar *exportNew = dk4strx_dup(exportPtr, NULL);
+ if (NULL != exportNew) {
+ if (NULL != *m_ppExport) {
+ dk4mem_free(*m_ppExport);
+ }
+ *m_ppExport = exportNew;
+ successExport = true;
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ m_pErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: No text entered */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+ }
+ else {
+ /* ERROR: No text entered */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+ }
+ }
+ if (successExport && m_bLaTeX) {
+ wxString screenString = textScreen->GetValue();
+ {
+ wxCStrData screenCstr = screenString.c_str();
+ {
+ wxChar const *screenPtr = (wxChar const *)screenCstr;
+ if (NULL != screenPtr) {
+ if ((size_t)0U < dk4strx_len(screenPtr)) {
+ wxChar *screenNew = dk4strx_dup(screenPtr, NULL);
+ if (NULL != screenNew) {
+ if (NULL != *m_ppScreen) {
+ dk4mem_free(*m_ppScreen);
+ }
+ *m_ppScreen = screenNew;
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ m_pErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+
+ }
+ }
+ else {
+ /* No text entered */
+ }
+ }
+ else {
+ /* No text entered */
+ }
+ }
+ }
+ }
+ else {
+ if (NULL != *m_ppScreen) {
+ dk4mem_free(*m_ppScreen);
+ *m_ppScreen = NULL;
+ }
+ }
+}
+
+
+
+void
+WxdkdrawDlgTextInput::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if (CheckSufficientInput()) {
+ TransferInputData();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ }
+ else {
+ /* TODO: Return to export text */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+}
+
+
+
+void
+WxdkdrawDlgTextInput::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgTextInput::OnExportText(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 466 "WxdkdrawDlgTextInput.wxc"
+ if (m_bLaTeX) {
+ textScreen->SetFocus();
+ }
+ else {
+ if (CheckSufficientInput()) {
+ TransferInputData();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ }
+ else {
+ /* TODO: Return to export text */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+ }
+
+
+#line 490 "WxdkdrawDlgTextInput.wxc"
+}
+
+
+
+void
+WxdkdrawDlgTextInput::OnScreenText(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 498 "WxdkdrawDlgTextInput.wxc"
+ if (CheckSufficientInput()) {
+ TransferInputData();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ }
+ else {
+ /* TODO: Return to export text */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+
+
+#line 517 "WxdkdrawDlgTextInput.wxc"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
diff --git a/support/dktools/WxdkdrawDlgTextInput.h b/support/dktools/WxdkdrawDlgTextInput.h
new file mode 100644
index 0000000000..18fb808653
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgTextInput.h
@@ -0,0 +1,210 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawDlgTextInput.wxc
+*/
+
+/** @file WxdkdrawDlgTextInput.h Header file for the WxdkdrawDlgTextInput module.
+*/
+
+#ifndef WXDKDRAWDLGTEXTINPUT_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWDLGTEXTINPUT_H_INCLUDED 1
+
+
+#line 78 "WxdkdrawDlgTextInput.wxc"
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#line 89 "WxdkdrawDlgTextInput.wxc"
+
+
+/** Text input dialog to create or modify a text label.
+*/
+class WxdkdrawDlgTextInput : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Red colour for label.
+ */
+ wxColour m_cRed;
+
+ /** Localized texts.
+ */
+ wxChar const * const *m_pLocTexts;
+
+ /** Parent frame (main window).
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Address of export text pointer.
+ */
+ wxChar **m_ppExport;
+
+ /** Address of screen text pointer.
+ */
+ wxChar **m_ppScreen;
+
+ /** Error report for out of memory.
+ */
+ dk4_er_t *m_pErrorReport;
+
+ /** Text object is LaTeX special text.
+ */
+ bool m_bLaTeX;
+
+ public:
+
+ /** Window IDs.
+ */
+ enum {
+ WXD_ID_EXPORT_TEXT = (wxID_HIGHEST + 1), /**< Export text. */
+ WXD_ID_SCREEN_TEXT /**< Screen text. */
+ };
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** GUI element sizerHorizontal.
+ */
+#line 12 "WxdkdrawDlgTextInput.wxc"
+ wxBoxSizer *sizerHorizontal;
+
+ /** GUI element sizerVertical.
+ */
+#line 20 "WxdkdrawDlgTextInput.wxc"
+ wxBoxSizer *sizerVertical;
+
+ /** GUI element sizerContents.
+ */
+#line 30 "WxdkdrawDlgTextInput.wxc"
+ wxBoxSizer *sizerContents;
+
+ /** GUI element sizerButtons.
+ */
+#line 62 "WxdkdrawDlgTextInput.wxc"
+ wxStdDialogButtonSizer *sizerButtons;
+
+ /** GUI element labelExport.
+ */
+#line 40 "WxdkdrawDlgTextInput.wxc"
+ wxStaticText *labelExport;
+
+ /** GUI element textExport.
+ */
+#line 43 "WxdkdrawDlgTextInput.wxc"
+ wxTextCtrl *textExport;
+
+ /** GUI element labelScreen.
+ */
+#line 51 "WxdkdrawDlgTextInput.wxc"
+ wxStaticText *labelScreen;
+
+ /** GUI element textScreen.
+ */
+#line 54 "WxdkdrawDlgTextInput.wxc"
+ wxTextCtrl *textScreen;
+
+ /** GUI element buttonOK.
+ */
+#line 66 "WxdkdrawDlgTextInput.wxc"
+ wxButton *buttonOK;
+
+ /** GUI element buttonCancel.
+ */
+#line 71 "WxdkdrawDlgTextInput.wxc"
+ wxButton *buttonCancel;
+
+
+#line 145 "WxdkdrawDlgTextInput.wxc"
+
+ public:
+
+ /** Constructor.
+ @param pParent Parent frame (main window).
+ @param pLocTexts Localized text fragments.
+ @param pNlTexts Not localized text fragments.
+ @param ppExport Address of export text pointer.
+ @param ppScreen Address of screen text pointer.
+ @param bLaTeX Flag: LaTeX special text object.
+ */
+ WxdkdrawDlgTextInput(
+ WxdkdrawFrame *pParent,
+ wxChar const * const *pLocTexts,
+ wxChar const * const *pNlTexts,
+ wxChar **ppExport,
+ wxChar **ppScreen,
+ bool bLaTeX,
+ dk4_er_t *pErrorReport
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Enter in export text handler.
+ @param event Event to process.
+ */
+ void
+ OnExportText(wxCommandEvent & event);
+
+ /** Enter in screen text handler.
+ @param event Event to process.
+ */
+ void
+ OnScreenText(wxCommandEvent & event);
+
+ protected:
+
+ /** Check whether sufficient input available.
+ @return True on success, false on error.
+ */
+ bool
+ CheckSufficientInput(void);
+
+ /** Transfer data from text fields to the destination pointers.
+ */
+ void
+ TransferInputData(void);
+};
+
+
+#line 205 "WxdkdrawDlgTextInput.wxc"
+
+
+
+#endif
diff --git a/support/dktools/WxdkdrawDlgTextInput.wxc b/support/dktools/WxdkdrawDlgTextInput.wxc
new file mode 100644
index 0000000000..1b5e703727
--- /dev/null
+++ b/support/dktools/WxdkdrawDlgTextInput.wxc
@@ -0,0 +1,524 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% wx-gui
+
+type = dialog
+contents = sizerHorizontal
+
+[wxBoxSizer sizerHorizontal]
+proportion = 1
+grow = yes
+direction = horizontal
+contents = $space(10)
+contents = sizerVertical
+contents = $space(10)
+
+[wxBoxSizer sizerVertical]
+direction = vertical
+grow = yes
+proportion = 1
+contents = $space(10)
+contents = sizerContents centered-x
+contents = $space(10)
+contents = sizerButtons centered-x
+contents = $space(10)
+
+[wxBoxSizer sizerContents]
+direction = vertical
+grow = yes
+proportion = 1
+contents = labelExport left
+contents = textExport left
+contents = $space(10)
+contents = labelScreen left
+contents = textScreen left
+
+[wxStaticText labelExport]
+text = pLocTexts[396]
+
+[wxTextCtrl textExport]
+proportion = 1
+grow = yes
+id = WXD_ID_EXPORT_TEXT
+tip = pLocTexts[398]
+text = pNlTexts[20]
+text style = enter
+
+[wxStaticText labelScreen]
+text = pLocTexts[397]
+
+[wxTextCtrl textScreen]
+proportion = 1
+grow = yes
+id = WXD_ID_SCREEN_TEXT
+tip = pLocTexts[399]
+text = pNlTexts[20]
+text style = enter
+
+[wxStdDialogButtonSizer sizerButtons]
+contents = buttonOK
+contents = buttonCancel
+
+[wxButton buttonOK]
+id = wxID_OK
+text = pLocTexts[259]
+tip = pLocTexts[401]
+
+[wxButton buttonCancel]
+id = wxID_CANCEL
+text = pLocTexts[260]
+tip = pLocTexts[402]
+
+
+%% header start
+
+#ifndef WXDKDRAW_H_INCLUDED
+#include "wxdkdraw.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+%% class start
+
+
+/** Text input dialog to create or modify a text label.
+*/
+class WxdkdrawDlgTextInput : public wxDialog
+{
+ private:
+
+ /** Events to handle.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /** Red colour for label.
+ */
+ wxColour m_cRed;
+
+ /** Localized texts.
+ */
+ wxChar const * const *m_pLocTexts;
+
+ /** Parent frame (main window).
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Address of export text pointer.
+ */
+ wxChar **m_ppExport;
+
+ /** Address of screen text pointer.
+ */
+ wxChar **m_ppScreen;
+
+ /** Error report for out of memory.
+ */
+ dk4_er_t *m_pErrorReport;
+
+ /** Text object is LaTeX special text.
+ */
+ bool m_bLaTeX;
+
+ public:
+
+ /** Window IDs.
+ */
+ enum {
+ WXD_ID_EXPORT_TEXT = (wxID_HIGHEST + 1), /**< Export text. */
+ WXD_ID_SCREEN_TEXT /**< Screen text. */
+ };
+
+%% class end
+
+ public:
+
+ /** Constructor.
+ @param pParent Parent frame (main window).
+ @param pLocTexts Localized text fragments.
+ @param pNlTexts Not localized text fragments.
+ @param ppExport Address of export text pointer.
+ @param ppScreen Address of screen text pointer.
+ @param bLaTeX Flag: LaTeX special text object.
+ */
+ WxdkdrawDlgTextInput(
+ WxdkdrawFrame *pParent,
+ wxChar const * const *pLocTexts,
+ wxChar const * const *pNlTexts,
+ wxChar **ppExport,
+ wxChar **ppScreen,
+ bool bLaTeX,
+ dk4_er_t *pErrorReport
+ );
+
+ /** OK button handler.
+ @param event Event to process.
+ */
+ void
+ OnOK(wxCommandEvent & event);
+
+ /** Cancel button handler.
+ @param event Event to process.
+ */
+ void
+ OnCancel(wxCommandEvent & event);
+
+ /** Enter in export text handler.
+ @param event Event to process.
+ */
+ void
+ OnExportText(wxCommandEvent & event);
+
+ /** Enter in screen text handler.
+ @param event Event to process.
+ */
+ void
+ OnScreenText(wxCommandEvent & event);
+
+ protected:
+
+ /** Check whether sufficient input available.
+ @return True on success, false on error.
+ */
+ bool
+ CheckSufficientInput(void);
+
+ /** Transfer data from text fields to the destination pointers.
+ */
+ void
+ TransferInputData(void);
+};
+
+%% header end
+
+
+%% module start
+
+#ifndef WXDKDRAWDLGTEXTINPUT_H_INCLUDED
+#include "WxdkdrawDlgTextInput.h"
+#endif
+
+
+$!trace-include
+
+/** Assign methods to event IDs.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawDlgTextInput,wxDialog)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawDlgTextInput,wxDialog)
+#endif
+ EVT_BUTTON(\
+ wxID_OK,\
+ WxdkdrawDlgTextInput::OnOK\
+ )
+ EVT_BUTTON(\
+ wxID_CANCEL,\
+ WxdkdrawDlgTextInput::OnCancel\
+ )
+ EVT_TEXT_ENTER(\
+ WXD_ID_EXPORT_TEXT,\
+ WxdkdrawDlgTextInput::OnExportText\
+ )
+ EVT_TEXT_ENTER(\
+ WXD_ID_SCREEN_TEXT,\
+ WxdkdrawDlgTextInput::OnScreenText\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+%% constructor start
+WxdkdrawDlgTextInput::WxdkdrawDlgTextInput(
+ WxdkdrawFrame *pParent,
+ wxChar const * const *pLocTexts,
+ wxChar const * const *pNlTexts,
+ wxChar **ppExport,
+ wxChar **ppScreen,
+ bool bLaTeX,
+ dk4_er_t *pErrorReport
+) : wxDialog(
+ pParent, wxID_ANY, pLocTexts[400],
+ wxDefaultPosition, wxDefaultSize,
+ (
+ ((wxDEFAULT_DIALOG_STYLE) | (wxRESIZE_BORDER))
+#if 0
+ & (~(wxRESIZE_BORDER))
+#endif
+ & (~(wxCLOSE_BOX))
+ & (~(wxSYSTEM_MENU))
+ )
+),
+m_cRed(0x7F, 0, 0)
+{
+ m_pParent = pParent;
+ m_bLaTeX = bLaTeX;
+ m_ppExport = ppExport;
+ m_ppScreen = ppScreen;
+ m_pLocTexts = pLocTexts;
+ m_pErrorReport = pErrorReport;
+%% constructor end
+ if (dkctGUILayoutOK) {
+ if (NULL != *ppExport) {
+ wxString str(*ppExport);
+ {
+ textExport->SetValue(str);
+ }
+ }
+ else {
+ textExport->SetValue(pNlTexts[19]);
+ }
+ if ((bLaTeX) && (NULL != *ppScreen)) {
+ wxString str(*ppScreen);
+ {
+ textScreen->SetValue(str);
+ }
+ }
+ else {
+ textScreen->SetValue(pNlTexts[19]);
+ }
+ if (!(bLaTeX)) {
+ textScreen->Enable(false);
+ }
+#if 0
+ panelContents->Layout();
+#endif
+ Layout();
+#if 0
+ wxSize minsize = GetMinSize();
+ SetMaxSize(minsize);
+#endif
+ }
+}
+
+
+%% module end
+
+
+
+bool
+WxdkdrawDlgTextInput::CheckSufficientInput(void)
+{
+ bool back = false;
+ wxString exportString = textExport->GetValue();
+ {
+ wxCStrData exportCstr = exportString.c_str();
+ {
+ wxChar const *exportPtr = (wxChar const *)exportCstr;
+ if (NULL != exportPtr) {
+ if ((size_t)0U < dk4strx_len(exportPtr)) {
+ back = true;
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawDlgTextInput::TransferInputData(void)
+{
+ bool successExport = false;
+ wxString exportString = textExport->GetValue();
+ {
+ wxCStrData exportCstr = exportString.c_str();
+ {
+ wxChar const *exportPtr = (wxChar const *)exportCstr;
+ if (NULL != exportPtr) {
+ if ((size_t)0U < dk4strx_len(exportPtr)) {
+ wxChar *exportNew = dk4strx_dup(exportPtr, NULL);
+ if (NULL != exportNew) {
+ if (NULL != *m_ppExport) {
+ dk4mem_free(*m_ppExport);
+ }
+ *m_ppExport = exportNew;
+ successExport = true;
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ m_pErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: No text entered */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+ }
+ else {
+ /* ERROR: No text entered */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+ }
+ }
+ if (successExport && m_bLaTeX) {
+ wxString screenString = textScreen->GetValue();
+ {
+ wxCStrData screenCstr = screenString.c_str();
+ {
+ wxChar const *screenPtr = (wxChar const *)screenCstr;
+ if (NULL != screenPtr) {
+ if ((size_t)0U < dk4strx_len(screenPtr)) {
+ wxChar *screenNew = dk4strx_dup(screenPtr, NULL);
+ if (NULL != screenNew) {
+ if (NULL != *m_ppScreen) {
+ dk4mem_free(*m_ppScreen);
+ }
+ *m_ppScreen = screenNew;
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ m_pErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+
+ }
+ }
+ else {
+ /* No text entered */
+ }
+ }
+ else {
+ /* No text entered */
+ }
+ }
+ }
+ }
+ else {
+ if (NULL != *m_ppScreen) {
+ dk4mem_free(*m_ppScreen);
+ *m_ppScreen = NULL;
+ }
+ }
+}
+
+
+
+void
+WxdkdrawDlgTextInput::OnOK(wxCommandEvent & WXUNUSED(event))
+{
+ if (CheckSufficientInput()) {
+ TransferInputData();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ }
+ else {
+ /* TODO: Return to export text */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+}
+
+
+
+void
+WxdkdrawDlgTextInput::OnCancel(wxCommandEvent & WXUNUSED(event))
+{
+ if(IsModal()) {
+ EndModal(wxID_CANCEL);
+ }
+ else {
+ SetReturnCode(wxID_CANCEL);
+ Show(false);
+ }
+}
+
+
+
+void
+WxdkdrawDlgTextInput::OnExportText(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnExportText"
+ if (m_bLaTeX) {
+ textScreen->SetFocus();
+ }
+ else {
+ if (CheckSufficientInput()) {
+ TransferInputData();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ }
+ else {
+ /* TODO: Return to export text */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+ }
+ $? "- OnExportText"
+}
+
+
+
+void
+WxdkdrawDlgTextInput::OnScreenText(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnScreenText"
+ if (CheckSufficientInput()) {
+ TransferInputData();
+ if(IsModal()) {
+ EndModal(wxID_OK);
+ }
+ else {
+ SetReturnCode(wxID_OK);
+ Show(false);
+ }
+ }
+ else {
+ /* TODO: Return to export text */
+ labelExport->SetForegroundColour(m_cRed);
+ labelExport->SetLabel(m_pLocTexts[642]);
+ textExport->SetFocus();
+ Refresh();
+ Update();
+ }
+ $? "- OnScreenText"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
diff --git a/support/dktools/WxdkdrawFont.cpp b/support/dktools/WxdkdrawFont.cpp
new file mode 100644
index 0000000000..c1fbd10fae
--- /dev/null
+++ b/support/dktools/WxdkdrawFont.cpp
@@ -0,0 +1,782 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawFont.cpt
+*/
+
+/** @file WxdkdrawFont.cpp The WxdkdrawFont module.
+*/
+
+
+#line 75 "WxdkdrawFont.cpt"
+
+
+#include "WxdkdrawFont.h"
+
+#include "wxdkdraw.h"
+
+
+
+
+#line 83 "WxdkdrawFont.cpt"
+
+
+
+/** Font family names for font 00.
+*/
+static wxChar const * const font_families_00[] = {
+/* 0 */
+wxT("Times"),
+
+/* 1 */
+wxT("Nimbus Roman"),
+
+/* 2 */
+wxT("Nimbus Roman No9 L"),
+
+/* 3 */
+wxT("ptmr"),
+
+/* 4 */
+wxT("Times New Roman"),
+
+/* 5 */
+wxT("Bodoni MT"),
+
+NULL
+
+
+#line 97 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Font family names for font 04.
+*/
+static wxChar const * const font_families_04[] = {
+/* 0 */
+wxT("AvantGarde"),
+
+/* 1 */
+wxT("URW Gothic"),
+
+/* 2 */
+wxT("URW Gothic L"),
+
+/* 3 */
+wxT("pagk"),
+
+/* 4 */
+wxT("Trebuchet MS"),
+
+/* 5 */
+wxT("Verdana"),
+
+NULL
+
+
+#line 112 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Font family names for font 08.
+*/
+static wxChar const * const font_families_08[] = {
+/* 0 */
+wxT("Bookman"),
+
+/* 1 */
+wxT("URW Bookman"),
+
+/* 2 */
+wxT("URW Bookman L"),
+
+/* 3 */
+wxT("pbkl"),
+
+/* 4 */
+wxT("Bookman Old Style"),
+
+/* 5 */
+wxT("Times New Roman"),
+
+NULL
+
+
+#line 127 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Font family names for font 12.
+*/
+static wxChar const * const font_families_12[] = {
+/* 0 */
+wxT("Courier"),
+
+/* 1 */
+wxT("Nimbus Mono PS"),
+
+/* 2 */
+wxT("Nimbus Mono L"),
+
+/* 3 */
+wxT("pcr"),
+
+/* 4 */
+wxT("Courier New"),
+
+NULL
+
+
+#line 141 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Font family names for font 16.
+*/
+static wxChar const * const font_families_16[] = {
+/* 0 */
+wxT("Helvetica"),
+
+/* 1 */
+wxT("Nimbus Sans"),
+
+/* 2 */
+wxT("Nimbus Sans L"),
+
+/* 3 */
+wxT("phv"),
+
+/* 4 */
+wxT("Arial"),
+
+/* 5 */
+wxT("Gill Sans MT"),
+
+/* 6 */
+wxT("Lucida Sans"),
+
+/* 7 */
+wxT("Tahoma"),
+
+NULL
+
+
+#line 158 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Font family names for font 20.
+*/
+static wxChar const * const font_families_20[] = {
+/* 0 */
+wxT("Helvetica-Narrow"),
+
+/* 1 */
+wxT("Nimbus Sans Narrow"),
+
+/* 2 */
+wxT("Nimbus Sans L"),
+
+/* 3 */
+wxT("phv"),
+
+/* 4 */
+wxT("Arial Narrow"),
+
+/* 5 */
+wxT("Arial"),
+
+NULL
+
+
+#line 173 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Font family names for font 24.
+*/
+static wxChar const * const font_families_24[] = {
+/* 0 */
+wxT("C059"),
+
+/* 1 */
+wxT("Century Schoolbook"),
+
+/* 2 */
+wxT("Century Schoolbook L"),
+
+/* 3 */
+wxT("NewCenturySchlbk"),
+
+/* 4 */
+wxT("pnc"),
+
+/* 5 */
+wxT("Times New Roman"),
+
+NULL
+
+
+#line 188 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Font family names for font 28.
+*/
+static wxChar const * const font_families_28[] = {
+/* 0 */
+wxT("Palatino"),
+
+/* 1 */
+wxT("P052"),
+
+/* 2 */
+wxT("URW Palladio L"),
+
+/* 3 */
+wxT("Palatino Linotype"),
+
+/* 4 */
+wxT("ppl"),
+
+/* 5 */
+wxT("Times New Roman"),
+
+NULL
+
+
+#line 203 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Font family names for font 32.
+*/
+static wxChar const * const font_families_32[] = {
+NULL
+
+
+#line 212 "WxdkdrawFont.cpt"
+};
+
+
+/** Font family names for font 33.
+*/
+static wxChar const * const font_families_33[] = {
+/* 0 */
+wxT("ZapfChancery"),
+
+/* 1 */
+wxT("Z003"),
+
+/* 2 */
+wxT("URW Chancery L"),
+
+/* 3 */
+wxT("pzc"),
+
+/* 4 */
+wxT("Edwardian Script ITC"),
+
+/* 5 */
+wxT("Blackadder ITC"),
+
+NULL
+
+
+#line 226 "WxdkdrawFont.cpt"
+};
+
+
+/** Font family names for font 34.
+*/
+static wxChar const * const font_families_34[] = {
+/* 0 */
+wxT("ZapfDingbats"),
+
+/* 1 */
+wxT("D050000L"),
+
+/* 2 */
+wxT("Dingbats"),
+
+/* 3 */
+wxT("pzdr"),
+
+/* 4 */
+wxT("WingDings"),
+
+NULL
+
+
+#line 239 "WxdkdrawFont.cpt"
+};
+
+
+
+/** Information about one font.
+*/
+typedef struct {
+ wxFontFamily f; /**< Font family. */
+ wxFontStyle s; /**< Font style. */
+ wxFontWeight w; /**< Font weight. */
+ wxChar const * const *n; /**< Font names array. */
+} font_info_t;
+
+
+
+/** The 35 fonts.
+*/
+static const font_info_t font_info[] = {
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_00
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_00
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_00
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_00
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_04
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_04
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_04
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_04
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_08
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_08
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_08
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_08
+ },
+ {
+ wxFONTFAMILY_TELETYPE,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_12
+ },
+ {
+ wxFONTFAMILY_TELETYPE,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_12
+ },
+ {
+ wxFONTFAMILY_TELETYPE,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_12
+ },
+ {
+ wxFONTFAMILY_TELETYPE,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_12
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_16
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_16
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_16
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_16
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_20
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_20
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_20
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_20
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_24
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_24
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_24
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_24
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_28
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_28
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_28
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_28
+ },
+ {
+ wxFONTFAMILY_DEFAULT,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_32
+ },
+ {
+ wxFONTFAMILY_SCRIPT,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_33
+ },
+ {
+ wxFONTFAMILY_DECORATIVE,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_34
+ }
+};
+
+
+
+int
+wxdfont_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ Wxd_font_t const *pl;
+ Wxd_font_t const *pr;
+ int back = 0;
+
+
+#line 478 "WxdkdrawFont.cpt"
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (Wxd_font_t const *)l;
+ pr = (Wxd_font_t const *)r;
+ if (pl->find > pr->find) {
+
+#line 484 "WxdkdrawFont.cpt"
+ back = 1;
+ }
+ else {
+ if (pl->find < pr->find) {
+
+#line 488 "WxdkdrawFont.cpt"
+ back = -1;
+ }
+ else {
+ if (pl->fsz > pr->fsz) {
+
+#line 492 "WxdkdrawFont.cpt"
+ back = 1;
+ }
+ else {
+ if (pl->fsz < pr->fsz) {
+
+#line 496 "WxdkdrawFont.cpt"
+ back = -1;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 500 "WxdkdrawFont.cpt"
+ }
+#endif
+ }
+ }
+ }
+ }
+ else {
+
+#line 507 "WxdkdrawFont.cpt"
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+
+#line 512 "WxdkdrawFont.cpt"
+ back = -1;
+ }
+ }
+
+#line 515 "WxdkdrawFont.cpt"
+ return back;
+}
+
+
+
+Wxd_font_t *
+wxdfont_new(uint8_t find, uint16_t fsz)
+{
+ Wxd_font_t *back = NULL;
+
+
+#line 525 "WxdkdrawFont.cpt"
+ back = dk4mem_new(Wxd_font_t,1,NULL);
+ if (NULL != back) {
+ back->font = NULL;
+ back->fsz = fsz;
+ back->find = find;
+ back->used = false;
+ back->attempted = false;
+ }
+
+#line 533 "WxdkdrawFont.cpt"
+ return back;
+}
+
+
+
+void
+wxdfont_delete(Wxd_font_t *ptr)
+{
+
+
+#line 542 "WxdkdrawFont.cpt"
+ if (NULL != ptr) {
+
+
+#line 544 "WxdkdrawFont.cpt"
+ if (NULL != ptr->font) {
+ delete (ptr->font);
+ ptr->font = NULL;
+ }
+ dk4mem_free(ptr);
+ }
+
+#line 550 "WxdkdrawFont.cpt"
+}
+
+
+
+wxFont *
+wxdfont_get_font(Wxd_font_t *ptr)
+{
+ wxFont *back = NULL;
+
+
+#line 559 "WxdkdrawFont.cpt"
+ if (NULL != ptr) {
+ back = ptr->font;
+ }
+
+#line 562 "WxdkdrawFont.cpt"
+ return back;
+}
+
+
+
+void
+wxdfont_find_font(Wxd_font_t *ptr, double zoom, double res, bool exf)
+{
+ wxChar const * const *nptr; /* Traverse names */
+ wxFontFamily ffam = wxFONTFAMILY_DEFAULT; /* Font family */
+ wxFontStyle fsty = wxFONTSTYLE_NORMAL; /* Font style */
+ wxFontWeight fwei = wxFONTWEIGHT_NORMAL; /* Font weight */
+ int ifsz; /* Font size as int */
+ bool cc; /* Flag: can continue */
+
+
+#line 577 "WxdkdrawFont.cpt"
+ ifsz = (int)dk4ma_rint((zoom * (double)(ptr->fsz) *res) / 72.27);
+ if (0 < ifsz) {
+ wxSize fspx(0, ifsz);
+ ffam = font_info[ptr->find].f;
+ fsty = font_info[ptr->find].s;
+ fwei = font_info[ptr->find].w;
+ nptr = font_info[ptr->find].n;
+ if (exf) {
+ /*
+ Use exact font specified by family and features
+ */
+ cc = true;
+ while (cc) {
+ if (NULL != *nptr) {
+ wxString facename(*nptr);
+ ptr->font = new wxFont(fspx,ffam,fsty,fwei,false,facename);
+ if (NULL != ptr->font) {
+ if (ptr->font->IsOk()) {
+ cc = false;
+
+#line 596 "WxdkdrawFont.cpt"
+ }
+ else {
+ delete (ptr->font);
+ ptr->font = NULL;
+ }
+ }
+ }
+ else {
+ cc = false;
+ ptr->font = new wxFont(fspx, ffam, fsty, fwei);
+ if (NULL != ptr->font) {
+ if (!(ptr->font->IsOk())) {
+ delete (ptr->font);
+ ptr->font = NULL;
+ }
+ }
+ }
+ }
+ }
+ else {
+ /*
+ Use font specified by type and features
+ */
+ ptr->font = new wxFont(fspx, ffam, fsty, fwei);
+ if (NULL != ptr->font) {
+ if (!(ptr->font->IsOk())) {
+ delete (ptr->font);
+ ptr->font = NULL;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ if (NULL != ptr->font) {
+ wxString facestr = (ptr->font)->GetFaceName();
+ wxString userdes = (ptr->font)->GetNativeFontInfoUserDesc();
+ wxCStrData facedata = facestr.c_str();
+ wxCStrData userdata = userdes.c_str();
+ wxChar const *facename = (wxChar const *)facedata;
+ wxChar const *username = (wxChar const *)userdata;
+ if (NULL != facename) {
+
+
+#line 637 "WxdkdrawFont.cpt"
+
+
+#line 638 "WxdkdrawFont.cpt"
+ }
+ }
+ else {
+
+#line 641 "WxdkdrawFont.cpt"
+ }
+#endif
+ }
+
+
+#line 645 "WxdkdrawFont.cpt"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawFont.cpt b/support/dktools/WxdkdrawFont.cpt
new file mode 100644
index 0000000000..53a2bc4e3f
--- /dev/null
+++ b/support/dktools/WxdkdrawFont.cpt
@@ -0,0 +1,650 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file WxdkdrawFont.h WXD font structures.
+*/
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+#ifndef WXDENUM_H_INCLUDED
+#include "wxdenum.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int
+wxdfont_compare(const void *l, const void *r, int cr);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/** Create new font structure.
+ @param find Font index (0 to 34).
+ @param fsz Font size in pt.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+Wxd_font_t *
+wxdfont_new(uint8_t find, uint16_t fsz);
+
+
+/** Delete font structure, release memory.
+ @param ptr Font structure to delete.
+*/
+
+void
+wxdfont_delete(Wxd_font_t *ptr);
+
+
+/** Retrieve wxFont from font structure.
+ @param ptr Font structure to use.
+ @return wxFont pointer or NULL.
+*/
+
+wxFont *
+wxdfont_get_font(Wxd_font_t *ptr);
+
+
+/** Create wxFont component.
+ @param ptr Font structure to modify.
+ @param zoom Current zoom factor.
+ @param res Resolution.
+ @param exf Use exact font.
+*/
+
+void
+wxdfont_find_font(Wxd_font_t *ptr, double zoom, double res, bool exf);
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#include "WxdkdrawFont.h"
+
+#include "wxdkdraw.h"
+
+
+$!trace-include
+
+
+
+/** Font family names for font 00.
+*/
+static wxChar const * const font_families_00[] = {
+$!string-table macro=wxT
+Times
+Nimbus Roman
+Nimbus Roman No9 L
+ptmr
+Times New Roman
+Bodoni MT
+$!end
+};
+
+
+
+/** Font family names for font 04.
+*/
+static wxChar const * const font_families_04[] = {
+$!string-table macro=wxT
+AvantGarde
+URW Gothic
+URW Gothic L
+pagk
+Trebuchet MS
+Verdana
+$!end
+};
+
+
+
+/** Font family names for font 08.
+*/
+static wxChar const * const font_families_08[] = {
+$!string-table macro=wxT
+Bookman
+URW Bookman
+URW Bookman L
+pbkl
+Bookman Old Style
+Times New Roman
+$!end
+};
+
+
+
+/** Font family names for font 12.
+*/
+static wxChar const * const font_families_12[] = {
+$!string-table macro=wxT
+Courier
+Nimbus Mono PS
+Nimbus Mono L
+pcr
+Courier New
+$!end
+};
+
+
+
+/** Font family names for font 16.
+*/
+static wxChar const * const font_families_16[] = {
+$!string-table macro=wxT
+Helvetica
+Nimbus Sans
+Nimbus Sans L
+phv
+Arial
+Gill Sans MT
+Lucida Sans
+Tahoma
+$!end
+};
+
+
+
+/** Font family names for font 20.
+*/
+static wxChar const * const font_families_20[] = {
+$!string-table macro=wxT
+Helvetica-Narrow
+Nimbus Sans Narrow
+Nimbus Sans L
+phv
+Arial Narrow
+Arial
+$!end
+};
+
+
+
+/** Font family names for font 24.
+*/
+static wxChar const * const font_families_24[] = {
+$!string-table macro=wxT
+C059
+Century Schoolbook
+Century Schoolbook L
+NewCenturySchlbk
+pnc
+Times New Roman
+$!end
+};
+
+
+
+/** Font family names for font 28.
+*/
+static wxChar const * const font_families_28[] = {
+$!string-table macro=wxT
+Palatino
+P052
+URW Palladio L
+Palatino Linotype
+ppl
+Times New Roman
+$!end
+};
+
+
+
+/** Font family names for font 32.
+*/
+static wxChar const * const font_families_32[] = {
+$!string-table macro=wxT
+$!end
+};
+
+
+/** Font family names for font 33.
+*/
+static wxChar const * const font_families_33[] = {
+$!string-table macro=wxT
+ZapfChancery
+Z003
+URW Chancery L
+pzc
+Edwardian Script ITC
+Blackadder ITC
+$!end
+};
+
+
+/** Font family names for font 34.
+*/
+static wxChar const * const font_families_34[] = {
+$!string-table macro=wxT
+ZapfDingbats
+D050000L
+Dingbats
+pzdr
+WingDings
+$!end
+};
+
+
+
+/** Information about one font.
+*/
+typedef struct {
+ wxFontFamily f; /**< Font family. */
+ wxFontStyle s; /**< Font style. */
+ wxFontWeight w; /**< Font weight. */
+ wxChar const * const *n; /**< Font names array. */
+} font_info_t;
+
+
+
+/** The 35 fonts.
+*/
+static const font_info_t font_info[] = {
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_00
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_00
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_00
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_00
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_04
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_04
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_04
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_04
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_08
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_08
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_08
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_08
+ },
+ {
+ wxFONTFAMILY_TELETYPE,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_12
+ },
+ {
+ wxFONTFAMILY_TELETYPE,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_12
+ },
+ {
+ wxFONTFAMILY_TELETYPE,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_12
+ },
+ {
+ wxFONTFAMILY_TELETYPE,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_12
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_16
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_16
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_16
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_16
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_20
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_20
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_20
+ },
+ {
+ wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_20
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_24
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_24
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_24
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_24
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_28
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_NORMAL,
+ font_families_28
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_BOLD,
+ font_families_28
+ },
+ {
+ wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_ITALIC,
+ wxFONTWEIGHT_BOLD,
+ font_families_28
+ },
+ {
+ wxFONTFAMILY_DEFAULT,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_32
+ },
+ {
+ wxFONTFAMILY_SCRIPT,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_33
+ },
+ {
+ wxFONTFAMILY_DECORATIVE,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ font_families_34
+ }
+};
+
+
+
+int
+wxdfont_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ Wxd_font_t const *pl;
+ Wxd_font_t const *pr;
+ int back = 0;
+ $? "+ wxdfont_compare"
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (Wxd_font_t const *)l;
+ pr = (Wxd_font_t const *)r;
+ if (pl->find > pr->find) { $? ". pl->find > pr->find"
+ back = 1;
+ }
+ else {
+ if (pl->find < pr->find) { $? ". pl->find < pr->find"
+ back = -1;
+ }
+ else {
+ if (pl->fsz > pr->fsz) { $? ". pl->fsz > pr->fsz"
+ back = 1;
+ }
+ else {
+ if (pl->fsz < pr->fsz) { $? ". pl->fsz < pr->fsz"
+ back = -1;
+ }
+#if TRACE_DEBUG
+ else { $? ". fonts equal"
+ }
+#endif
+ }
+ }
+ }
+ }
+ else { $? ". no right font"
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) { $? ". no left font"
+ back = -1;
+ }
+ } $? "- wxdfont_compare %d", back
+ return back;
+}
+
+
+
+Wxd_font_t *
+wxdfont_new(uint8_t find, uint16_t fsz)
+{
+ Wxd_font_t *back = NULL;
+ $? "+ wxdfont_new %u %u", (unsigned)find, (unsigned)fsz
+ back = dk4mem_new(Wxd_font_t,1,NULL);
+ if (NULL != back) {
+ back->font = NULL;
+ back->fsz = fsz;
+ back->find = find;
+ back->used = false;
+ back->attempted = false;
+ } $? "- wxdfont_new %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+wxdfont_delete(Wxd_font_t *ptr)
+{
+ $? "+ wxdfont_delete %d", TR_IPTR(ptr)
+ if (NULL != ptr) {
+ $? ". delete font=%u size=%u", (unsigned)(ptr->find), (unsigned)(ptr->fsz)
+ if (NULL != ptr->font) {
+ delete (ptr->font);
+ ptr->font = NULL;
+ }
+ dk4mem_free(ptr);
+ } $? "- wxdfont_delete"
+}
+
+
+
+wxFont *
+wxdfont_get_font(Wxd_font_t *ptr)
+{
+ wxFont *back = NULL;
+ $? "+ wxdfont_get_font %d", TR_IPTR(ptr)
+ if (NULL != ptr) {
+ back = ptr->font;
+ } $? "- wxdfont_get_font %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+wxdfont_find_font(Wxd_font_t *ptr, double zoom, double res, bool exf)
+{
+ wxChar const * const *nptr; /* Traverse names */
+ wxFontFamily ffam = wxFONTFAMILY_DEFAULT; /* Font family */
+ wxFontStyle fsty = wxFONTSTYLE_NORMAL; /* Font style */
+ wxFontWeight fwei = wxFONTWEIGHT_NORMAL; /* Font weight */
+ int ifsz; /* Font size as int */
+ bool cc; /* Flag: can continue */
+ $? "+ wxdfont_find_font %u %u", (unsigned)(ptr->find), (unsigned)(ptr->fsz)
+ ifsz = (int)dk4ma_rint((zoom * (double)(ptr->fsz) *res) / 72.27);
+ if (0 < ifsz) {
+ wxSize fspx(0, ifsz);
+ ffam = font_info[ptr->find].f;
+ fsty = font_info[ptr->find].s;
+ fwei = font_info[ptr->find].w;
+ nptr = font_info[ptr->find].n;
+ if (exf) {
+ /*
+ Use exact font specified by family and features
+ */
+ cc = true;
+ while (cc) {
+ if (NULL != *nptr) {
+ wxString facename(*nptr);
+ ptr->font = new wxFont(fspx,ffam,fsty,fwei,false,facename);
+ if (NULL != ptr->font) {
+ if (ptr->font->IsOk()) {
+ cc = false; $? ". success \"%!xs\"", *nptr
+ }
+ else {
+ delete (ptr->font);
+ ptr->font = NULL;
+ }
+ }
+ }
+ else {
+ cc = false;
+ ptr->font = new wxFont(fspx, ffam, fsty, fwei);
+ if (NULL != ptr->font) {
+ if (!(ptr->font->IsOk())) {
+ delete (ptr->font);
+ ptr->font = NULL;
+ }
+ }
+ }
+ }
+ }
+ else {
+ /*
+ Use font specified by type and features
+ */
+ ptr->font = new wxFont(fspx, ffam, fsty, fwei);
+ if (NULL != ptr->font) {
+ if (!(ptr->font->IsOk())) {
+ delete (ptr->font);
+ ptr->font = NULL;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ if (NULL != ptr->font) {
+ wxString facestr = (ptr->font)->GetFaceName();
+ wxString userdes = (ptr->font)->GetNativeFontInfoUserDesc();
+ wxCStrData facedata = facestr.c_str();
+ wxCStrData userdata = userdes.c_str();
+ wxChar const *facename = (wxChar const *)facedata;
+ wxChar const *username = (wxChar const *)userdata;
+ if (NULL != facename) {
+ $? ". facename = \"%!xs\"", TR_WXSTR(facename)
+ $? ". font = \"%!xs\"", TR_WXSTR(username)
+ }
+ }
+ else { $? "! font"
+ }
+#endif
+ }
+ $? "- wxdfont_find_font %d", TR_IPTR(ptr->font)
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxdkdrawFont.h b/support/dktools/WxdkdrawFont.h
new file mode 100644
index 0000000000..023e561af5
--- /dev/null
+++ b/support/dktools/WxdkdrawFont.h
@@ -0,0 +1,87 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawFont.cpt
+*/
+
+#ifndef WXDKDRAWFONT_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWFONT_H_INCLUDED 1
+
+
+#line 8 "WxdkdrawFont.cpt"
+
+/** @file WxdkdrawFont.h WXD font structures.
+*/
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+#ifndef WXDENUM_H_INCLUDED
+#include "wxdenum.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int
+wxdfont_compare(const void *l, const void *r, int cr);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/** Create new font structure.
+ @param find Font index (0 to 34).
+ @param fsz Font size in pt.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+Wxd_font_t *
+wxdfont_new(uint8_t find, uint16_t fsz);
+
+
+/** Delete font structure, release memory.
+ @param ptr Font structure to delete.
+*/
+
+void
+wxdfont_delete(Wxd_font_t *ptr);
+
+
+/** Retrieve wxFont from font structure.
+ @param ptr Font structure to use.
+ @return wxFont pointer or NULL.
+*/
+
+wxFont *
+wxdfont_get_font(Wxd_font_t *ptr);
+
+
+/** Create wxFont component.
+ @param ptr Font structure to modify.
+ @param zoom Current zoom factor.
+ @param res Resolution.
+ @param exf Use exact font.
+*/
+
+void
+wxdfont_find_font(Wxd_font_t *ptr, double zoom, double res, bool exf);
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/WxdkdrawFrame.cpp b/support/dktools/WxdkdrawFrame.cpp
new file mode 100644
index 0000000000..9be55f551d
--- /dev/null
+++ b/support/dktools/WxdkdrawFrame.cpp
@@ -0,0 +1,2726 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawFrame.wxc
+*/
+
+/** @file WxdkdrawFrame.cpp The WxdkdrawFrame module.
+*/
+
+
+#line 4375 "WxdkdrawFrame.wxc"
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#if !defined(__WXMSW__)
+#include "gui-img/icons/wxdkdraw.xpm"
+#endif
+
+
+
+/* Bitmaps for Buttons and dialogs.
+*/
+#include "gui-img/wxdkdraw/buttons/wxd-bbox.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bbulletf.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bbullet.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bcarc.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bcircle.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bcopy.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bdel.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bellipse.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bfliph.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bflipv.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bgroup.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bgroup3.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bmove.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bmvpoint.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-boarc.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bpolygon.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bpolyline.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-brectangle.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bsplineca.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bsplineci.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bsplineoa.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bsplineoi.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-btext.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-blib.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bimg.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bungroup.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-baddpoint.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bdelpoint.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bdetails.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-borders.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-open.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-save.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bmodifys.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-brotleft.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-brotright.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as00.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as01.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as02.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as03.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as04.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as05.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as06.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as07.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as08.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as09.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as10.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as11.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as12.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as13.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as14.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as15.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as16.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as17.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as18.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as19.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as20.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as21.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as22.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as23.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as24.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as25.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as26.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as27.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as28.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as29.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs00.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs01.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs02.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs03.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs04.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs05.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs06.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs07.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs08.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs09.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs10.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs11.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs12.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs13.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs14.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs15.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs16.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs17.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs18.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs19.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs20.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs21.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs22.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs23.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-js1.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-js2.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-js3.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls1.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls2.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls3.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls4.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls5.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls6.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-lc1.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-lc2.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-lc3.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ts00.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ts01.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ts02.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn00.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn01.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn02.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn03.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn04.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn05.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn06.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn07.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn08.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn09.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn10.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn11.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn12.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn13.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn14.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn15.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn16.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn17.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn18.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn19.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn20.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn21.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn22.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn23.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn24.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn25.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn26.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn27.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn28.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn29.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn30.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn31.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn32.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn33.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn34.xpm"
+
+
+
+
+
+#line 4541 "WxdkdrawFrame.wxc"
+
+
+
+
+/** Array containing the images to visualize line styles.
+*/
+const char ** const WxdkdrawFrame::ms_ls_images[] = {
+ xpm_wxd_ls1, xpm_wxd_ls2, xpm_wxd_ls3,
+ xpm_wxd_ls4, xpm_wxd_ls5, xpm_wxd_ls6
+};
+
+
+
+/** Array containing the images to visualize line cap styles.
+*/
+const char ** const WxdkdrawFrame::ms_lc_images[] = {
+ xpm_wxd_lc1, xpm_wxd_lc2, xpm_wxd_lc3
+};
+
+
+
+/** Array containing the images to visualize line join styles.
+*/
+const char ** const WxdkdrawFrame::ms_lj_images[] = {
+ xpm_wxd_js1, xpm_wxd_js2, xpm_wxd_js3
+};
+
+
+
+/** Array containing the images to visualize arrow heads.
+*/
+const char ** const WxdkdrawFrame::ms_arrow_images[] = {
+ xpm_wxd_as00, xpm_wxd_as01, xpm_wxd_as02, xpm_wxd_as03,
+ xpm_wxd_as04, xpm_wxd_as05, xpm_wxd_as06, xpm_wxd_as07,
+ xpm_wxd_as08, xpm_wxd_as09, xpm_wxd_as10, xpm_wxd_as11,
+ xpm_wxd_as12, xpm_wxd_as13, xpm_wxd_as14, xpm_wxd_as15,
+ xpm_wxd_as16, xpm_wxd_as17, xpm_wxd_as18, xpm_wxd_as19,
+ xpm_wxd_as20, xpm_wxd_as21, xpm_wxd_as22, xpm_wxd_as23,
+ xpm_wxd_as24, xpm_wxd_as25, xpm_wxd_as26, xpm_wxd_as27,
+ xpm_wxd_as28, xpm_wxd_as29
+};
+
+
+
+/** Array containing the images to visualize fill styles.
+*/
+const char ** const WxdkdrawFrame::ms_fs_images[] = {
+ xpm_wxd_fs00, xpm_wxd_fs01, xpm_wxd_fs02, xpm_wxd_fs03,
+ xpm_wxd_fs04, xpm_wxd_fs05, xpm_wxd_fs06, xpm_wxd_fs07,
+ xpm_wxd_fs08, xpm_wxd_fs09, xpm_wxd_fs10, xpm_wxd_fs11,
+ xpm_wxd_fs12, xpm_wxd_fs13, xpm_wxd_fs14, xpm_wxd_fs15,
+ xpm_wxd_fs16, xpm_wxd_fs17, xpm_wxd_fs18, xpm_wxd_fs19,
+ xpm_wxd_fs20, xpm_wxd_fs21, xpm_wxd_fs22, xpm_wxd_fs23,
+};
+
+
+
+/** Array containing the images to visualize text alignments.
+*/
+const char ** const WxdkdrawFrame::ms_ta_images[] = {
+ xpm_wxd_ts00, xpm_wxd_ts01, xpm_wxd_ts02
+};
+
+
+
+/** Array containing the images to visualize fonts.
+*/
+const char ** const WxdkdrawFrame::ms_fn_images[] = {
+ xpm_wxd_fn00, xpm_wxd_fn01, xpm_wxd_fn02, xpm_wxd_fn03, xpm_wxd_fn04,
+ xpm_wxd_fn05, xpm_wxd_fn06, xpm_wxd_fn07, xpm_wxd_fn08, xpm_wxd_fn09,
+ xpm_wxd_fn10, xpm_wxd_fn11, xpm_wxd_fn12, xpm_wxd_fn13, xpm_wxd_fn14,
+ xpm_wxd_fn15, xpm_wxd_fn16, xpm_wxd_fn17, xpm_wxd_fn18, xpm_wxd_fn19,
+ xpm_wxd_fn20, xpm_wxd_fn21, xpm_wxd_fn22, xpm_wxd_fn23, xpm_wxd_fn24,
+ xpm_wxd_fn25, xpm_wxd_fn26, xpm_wxd_fn27, xpm_wxd_fn28, xpm_wxd_fn29,
+ xpm_wxd_fn30, xpm_wxd_fn31, xpm_wxd_fn32, xpm_wxd_fn33, xpm_wxd_fn34
+};
+
+
+
+/** Subdirectory for wxdkdraw library in datadir.
+*/
+static const wxChar libsubdir[] = {
+#if DK4_HAVE_BACKSLASH_AS_SEP
+ wxT("\\dktools\\wxdkdraw\\library")
+#else
+ wxT("/dktools/wxdkdraw/library")
+#endif
+};
+
+
+
+#line 4632 "WxdkdrawFrame.wxc"
+WxdkdrawFrame::WxdkdrawFrame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ int argc,
+ wxChar **argv,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk
+) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid),
+ m_sFileFull(wxEmptyString),
+ m_sFileShort(wxEmptyString),
+ m_sFileDir(wxEmptyString),
+ m_sImageDir(wxEmptyString),
+ m_sLibraryDir(wxEmptyString),
+ m_sLibraryShort(wxEmptyString),
+ m_szMousePosPix(0,0)
+{
+
+
+#line 4651 "WxdkdrawFrame.wxc"
+ /* __CHANGE__ 012: Add further local variables.
+ */
+ wxString saGridChoices[] = { /* Choice texts for grid */
+ wxString(localizedTexts[156]),
+ wxString(localizedTexts[157])
+ };
+ wxString saGridBase[] = { /* Choice texts for grid base */
+ wxString(localizedTexts[158]),
+ wxString(localizedTexts[159])
+ };
+ wxString saPointMoveMode[] = {
+ wxString(localizedTexts[414]),
+ wxString(localizedTexts[415])
+ };
+ const wxChar *pShare; /* Shared directory */
+ double a1; /* Start angle for fish scales */
+ double a2; /* End angle for fish scales */
+ double kappa; /* Kappa value for fish scales */
+
+ /* __CHANGE__ 012: Initialize further local variables.
+ */
+
+ sTexts = localizedTexts;
+ sNlWx = nlWx;
+ sNlDk = nlDk;
+#if defined(__WXMSW__)
+ wxIcon wxdkdraw_icon(sNlWx[4]);
+#else
+ wxIcon wxdkdraw_icon(xpm_wxdkdraw);
+#endif
+
+ /* __CHANGE__ 011: Initialize further class members.
+ */
+
+
+#line 4685 "WxdkdrawFrame.wxc"
+ wxdrd_status_init(&m_oStatusReader);
+ wxdwr_status_init(&m_oStatusWriter, pAppHelp->GetWxEncoding());
+ m_pDrw = NULL; /* Drawing is opened later in first idle event */
+ m_bIsFirstIdle = true; /* The idle event processed next is first at all */
+ m_bActive = false; /* Not yet active because no drawing yet */
+ m_bModified = false; /* No changes applied yet */
+ m_bHaveName = false; /* File name not known yet */
+ m_bMousePos = false; /* Mouse position not yet known */
+ m_bMouseDiff = false; /* Shift vector not yet known */
+
+
+#line 4695 "WxdkdrawFrame.wxc"
+ m_iState = S_NOOP; /* No operation in progress */
+ m_iWheelControl = 0; /* No wheel movement with pressed control key */
+ m_iWheelShift = 0; /* No wheel movement with pressed shift key */
+ m_iWheelNormal = 0; /* No wheel movement yet */
+ m_uCurrent = 0U; /* No current point to edit */
+ m_iObjToCreate = WXD_OT_GROUP_END; /* Object type to create */
+ m_bSplineInterpolated = false;
+ m_bAcceptablePoint = false;
+ m_bUpdate = false; /* No need to update frame */
+ m_bAppendPoint = false;
+ m_bHaveCornerPoint = false;
+ m_ptMousePosRaw.x = (int32_t)0L;
+ m_ptMousePosRaw.y = (int32_t)0L;
+ m_ptMousePosGrid.x = (int32_t)0L;
+ m_ptMousePosGrid.y = (int32_t)0L;
+ m_ptMouseMoveStart.x = (int32_t)0L;
+ m_ptMouseMoveStart.y = (int32_t)0L;
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_ptPointMoveOri.x = (int32_t)0L;
+ m_ptPointMoveOri.y = (int32_t)0L;
+ wxdobj_det_init_ellipse(&m_ellPointMoveOri);
+ m_bSnap = true;
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ wxdobj_obj_init(&m_oStyle, WXD_OT_TEXT, NULL);
+ wxdobj_obj_init(&m_oBorder, WXD_OT_BOX, NULL);
+ dk4error_init(&m_oErrorReport);
+
+ /* Check first filename.
+ */
+ if (1 < argc) {
+ wxFileName wxfn(argv[1]);
+ if (wxfn.IsFileReadable()) {
+ m_sFileFull = wxfn.GetFullPath();
+ m_sFileShort = wxfn.GetFullName();
+ m_sFileDir = wxfn.GetPath();
+ m_bHaveName = true;
+ }
+ else {
+ m_sFileFull = wxfn.GetFullPath();
+ m_sFileShort = wxfn.GetFullName();
+ m_sFileDir = wxfn.GetPath();
+ m_bHaveName = true;
+ }
+ }
+
+ dkctGUILayoutOK = false;
+ dkctGUIContentsPanel = NULL;
+ mainSizer = NULL;
+ mbMain = NULL;
+ menuFile = NULL;
+ menuAdd = NULL;
+ menuEdit = NULL;
+ menuView = NULL;
+ menuOptions = NULL;
+ menuHelp = NULL;
+ miFileNew = NULL;
+ miFileOpen = NULL;
+ miFileSave = NULL;
+ miFileSaveAs = NULL;
+ miFileExit = NULL;
+ miAddPolyline = NULL;
+ miAddPolygon = NULL;
+ miAddRectangle = NULL;
+ miAddRoundedBox = NULL;
+ miAddCircle = NULL;
+ miAddEllipse = NULL;
+ miAddArcOpen = NULL;
+ miAddArcClosed = NULL;
+ miAddSplineAO = NULL;
+ miAddSplineAC = NULL;
+ miAddSplineIO = NULL;
+ miAddSplineIC = NULL;
+ miAddConnector = NULL;
+ miAddPin = NULL;
+ miAddText = NULL;
+ miAddImage = NULL;
+ miAddLibelem = NULL;
+ miEditCopy = NULL;
+ miEditMove = NULL;
+ miEditDelete = NULL;
+ miEditPointAdd = NULL;
+ miEditPointRemove = NULL;
+ miEditPointMove = NULL;
+ miEditModifySpline = NULL;
+ miEditFlipH = NULL;
+ miEditFlipV = NULL;
+ miEditRotLeft = NULL;
+ miEditRotRight = NULL;
+ miEditDetails = NULL;
+ mEditGroup = NULL;
+ miEditUngroup = NULL;
+ miEditChangeSize = NULL;
+ mEditConvert = NULL;
+ miEditGroupElements = NULL;
+ miEditGroupIncluding = NULL;
+ miPolygonToPolyline = NULL;
+ miPolylineToPolygon = NULL;
+ miClosedToOpenArc = NULL;
+ miOpenToClosedArc = NULL;
+ miClosedToOpenSpline = NULL;
+ miOpenToClosedSpline = NULL;
+ miClosedToOpenIntSpline = NULL;
+ miOpenToClosedIntSpline = NULL;
+ miWhiteFilledToDot = NULL;
+ miDotToWhiteFilled = NULL;
+ menuZoom = NULL;
+ menuLayer = NULL;
+ miViewCenterView = NULL;
+ menuColours = NULL;
+ miOptionsNewObjects = NULL;
+ miOptionsScreen = NULL;
+ miOptionsReset = NULL;
+ miZoomIn = NULL;
+ miZoomOut = NULL;
+ miZoomReset = NULL;
+ miLayerActivateAll = NULL;
+ miLayerManager = NULL;
+ menuColourBorder = NULL;
+ menuColourBackground = NULL;
+ menuColourGrid = NULL;
+ menuColourPlacement = NULL;
+ menuColourCopy = NULL;
+ menuColourMove = NULL;
+ menuColourDelete = NULL;
+ menuColourGroup = NULL;
+ menuColourMissing = NULL;
+ miColourBorderModify = NULL;
+ miColourBorderReset = NULL;
+ miColourBackgroundModify = NULL;
+ miColourBackgroundReset = NULL;
+ miColourGridModify = NULL;
+ miColourGridReset = NULL;
+ miColourPlacementModify = NULL;
+ miColourPlacementReset = NULL;
+ miColourCopyModify = NULL;
+ miColourCopyReset = NULL;
+ miColourMoveModify = NULL;
+ miColourMoveReset = NULL;
+ miColourDeleteModify = NULL;
+ miColourDeleteReset = NULL;
+ miColourGroupModify = NULL;
+ miColourGroupReset = NULL;
+ miColourMissingModify = NULL;
+ miColourMissingReset = NULL;
+ miHelpAbout = NULL;
+ miHelpContents = NULL;
+ verticalSizer = NULL;
+ szTopBar = NULL;
+ szMiddleBar = NULL;
+ szBottomBar = NULL;
+ szHintsBar = NULL;
+ bFileOpen = NULL;
+ bFileSave = NULL;
+ lZoomPercent = NULL;
+ bZoomIn = NULL;
+ bZoomOut = NULL;
+ bZoomOne = NULL;
+ cbGridOnOff = NULL;
+ cbGridUnit = NULL;
+ cbGridBase = NULL;
+ cbPH = NULL;
+ szLeftBar = NULL;
+ szOperationsAndDraw = NULL;
+ bPolyline = NULL;
+ bPolygon = NULL;
+ bRect = NULL;
+ bBox = NULL;
+ bCircle = NULL;
+ bEllipse = NULL;
+ bArcOpen = NULL;
+ bArcClosed = NULL;
+ bSplineAO = NULL;
+ bSplineAC = NULL;
+ bSplineIO = NULL;
+ bSplineIC = NULL;
+ bConnector = NULL;
+ bPin = NULL;
+ bText = NULL;
+ bImage = NULL;
+ bLibelem = NULL;
+ szOperationButtons = NULL;
+ szDrawco = NULL;
+ lLayer = NULL;
+ spLayerNumber = NULL;
+ lLine = NULL;
+ szLine = NULL;
+ lFill = NULL;
+ szFill = NULL;
+ lText = NULL;
+ szText = NULL;
+ ccLineColour = NULL;
+ spLineWidth = NULL;
+ bStyleLineStyle = NULL;
+ bStyleLineJoins = NULL;
+ bStyleLineEnds = NULL;
+ bStyleArrowForward = NULL;
+ bStyleArrowBackward = NULL;
+ ccFillColour = NULL;
+ bStyleFillPattern = NULL;
+ cbStyleTextLaTeX = NULL;
+ bStyleTextAlign = NULL;
+ bStyleFontName = NULL;
+ spFontSize = NULL;
+ lRotation = NULL;
+ spRotation = NULL;
+ tlMouseL = NULL;
+ msgMouseL = NULL;
+ tlMouseM = NULL;
+ msgMouseM = NULL;
+ tlMouseR = NULL;
+ msgMouseR = NULL;
+ tlPosX = NULL;
+ msgPosX = NULL;
+ tlPosY = NULL;
+ msgPosY = NULL;
+ bEditCopy = NULL;
+ bEditMove = NULL;
+ bEditDelete = NULL;
+ bEditPointAdd = NULL;
+ bEditPointDelete = NULL;
+ bEditPointMove = NULL;
+ cbPointMoveMode = NULL;
+ bModifySplineValue = NULL;
+ bEditFlipH = NULL;
+ bEditFlipV = NULL;
+ bEditRotLeft = NULL;
+ bEditRotRight = NULL;
+ bEditDetails = NULL;
+ bEditGroup = NULL;
+ bEditGroup3 = NULL;
+ bEditUngroup = NULL;
+ bEditChangeSize = NULL;
+ drawco = NULL;
+ sbVert = NULL;
+ sbHori = NULL;
+ dkctGUIContentsPanel = new wxPanel(this);
+ if(!(dkctGUIContentsPanel)) {
+ goto dkctGUILayoutFinished;
+ }
+#if wxUSE_MENUS
+ mbMain = new wxMenuBar(
+ );
+ if(!(mbMain)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuFile = new wxMenu(
+ );
+ if(!(menuFile)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileNew = menuFile->Append(
+ wxID_NEW,
+ sTexts[20],
+ sTexts[21]
+ );
+ if(!(miFileNew)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileOpen = menuFile->Append(
+ wxID_OPEN,
+ sTexts[22],
+ sTexts[23]
+ );
+ if(!(miFileOpen)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileSave = menuFile->Append(
+ wxID_SAVE,
+ sTexts[24],
+ sTexts[25]
+ );
+ if(!(miFileSave)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileSaveAs = menuFile->Append(
+ wxID_SAVEAS,
+ sTexts[26],
+ sTexts[27]
+ );
+ if(!(miFileSaveAs)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileExit = menuFile->Append(
+ wxID_EXIT,
+ sTexts[1],
+ sTexts[2]
+ );
+ if(!(miFileExit)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuFile, sTexts[0]);
+ menuAdd = new wxMenu(
+ );
+ if(!(menuAdd)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddPolyline = menuAdd->Append(
+ ID_ADD_POLYINE,
+ sTexts[29],
+ sTexts[30]
+ );
+ if(!(miAddPolyline)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddPolygon = menuAdd->Append(
+ ID_ADD_POLYGON,
+ sTexts[31],
+ sTexts[32]
+ );
+ if(!(miAddPolygon)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddRectangle = menuAdd->Append(
+ ID_ADD_RECT,
+ sTexts[33],
+ sTexts[34]
+ );
+ if(!(miAddRectangle)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddRoundedBox = menuAdd->Append(
+ ID_ADD_BOX,
+ sTexts[35],
+ sTexts[36]
+ );
+ if(!(miAddRoundedBox)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddCircle = menuAdd->Append(
+ ID_ADD_CIRCLE,
+ sTexts[37],
+ sTexts[38]
+ );
+ if(!(miAddCircle)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddEllipse = menuAdd->Append(
+ ID_ADD_ELLIPSE,
+ sTexts[39],
+ sTexts[40]
+ );
+ if(!(miAddEllipse)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddArcOpen = menuAdd->Append(
+ ID_ADD_ARC_O,
+ sTexts[643],
+ sTexts[644]
+ );
+ if(!(miAddArcOpen)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddArcClosed = menuAdd->Append(
+ ID_ADD_ARC_C,
+ sTexts[645],
+ sTexts[646]
+ );
+ if(!(miAddArcClosed)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddSplineAO = menuAdd->Append(
+ ID_ADD_SPL_AO,
+ sTexts[41],
+ sTexts[42]
+ );
+ if(!(miAddSplineAO)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddSplineAC = menuAdd->Append(
+ ID_ADD_SPL_AC,
+ sTexts[43],
+ sTexts[44]
+ );
+ if(!(miAddSplineAC)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddSplineIO = menuAdd->Append(
+ ID_ADD_SPL_IO,
+ sTexts[45],
+ sTexts[46]
+ );
+ if(!(miAddSplineIO)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddSplineIC = menuAdd->Append(
+ ID_ADD_SPL_IC,
+ sTexts[47],
+ sTexts[48]
+ );
+ if(!(miAddSplineIC)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddConnector = menuAdd->Append(
+ ID_ADD_DOT_C,
+ sTexts[49],
+ sTexts[50]
+ );
+ if(!(miAddConnector)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddPin = menuAdd->Append(
+ ID_ADD_DOT_W,
+ sTexts[51],
+ sTexts[52]
+ );
+ if(!(miAddPin)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddText = menuAdd->Append(
+ ID_ADD_TEXT,
+ sTexts[53],
+ sTexts[54]
+ );
+ if(!(miAddText)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddImage = menuAdd->Append(
+ ID_ADD_IMG,
+ sTexts[55],
+ sTexts[56]
+ );
+ if(!(miAddImage)) {
+ goto dkctGUILayoutFinished;
+ }
+ miAddLibelem = menuAdd->Append(
+ ID_ADD_LIBELEM,
+ sTexts[57],
+ sTexts[58]
+ );
+ if(!(miAddLibelem)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuAdd, sTexts[28]);
+ menuEdit = new wxMenu(
+ );
+ if(!(menuEdit)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditCopy = menuEdit->Append(
+ ID_EDIT_COPY,
+ sTexts[60],
+ sTexts[61]
+ );
+ if(!(miEditCopy)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditMove = menuEdit->Append(
+ ID_EDIT_MOVE,
+ sTexts[62],
+ sTexts[63]
+ );
+ if(!(miEditMove)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditDelete = menuEdit->Append(
+ ID_EDIT_DEL,
+ sTexts[64],
+ sTexts[65]
+ );
+ if(!(miEditDelete)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditPointAdd = menuEdit->Append(
+ ID_EDIT_PT_ADD,
+ sTexts[68],
+ sTexts[69]
+ );
+ if(!(miEditPointAdd)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditPointRemove = menuEdit->Append(
+ ID_EDIT_PT_DEL,
+ sTexts[70],
+ sTexts[71]
+ );
+ if(!(miEditPointRemove)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditPointMove = menuEdit->Append(
+ ID_EDIT_PT_MOVE,
+ sTexts[66],
+ sTexts[67]
+ );
+ if(!(miEditPointMove)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditModifySpline = menuEdit->Append(
+ ID_MOD_SPLINE,
+ sTexts[620],
+ sTexts[621]
+ );
+ if(!(miEditModifySpline)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditFlipH = menuEdit->Append(
+ ID_EDIT_FLIPH,
+ sTexts[78],
+ sTexts[79]
+ );
+ if(!(miEditFlipH)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditFlipV = menuEdit->Append(
+ ID_EDIT_FLIPV,
+ sTexts[80],
+ sTexts[81]
+ );
+ if(!(miEditFlipV)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditRotLeft = menuEdit->Append(
+ ID_EDIT_ROTLEFT,
+ sTexts[566],
+ sTexts[567]
+ );
+ if(!(miEditRotLeft)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditRotRight = menuEdit->Append(
+ ID_EDIT_ROTRIGHT,
+ sTexts[568],
+ sTexts[569]
+ );
+ if(!(miEditRotRight)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditDetails = menuEdit->Append(
+ ID_EDIT_DET,
+ sTexts[72],
+ sTexts[73]
+ );
+ if(!(miEditDetails)) {
+ goto dkctGUILayoutFinished;
+ }
+ mEditGroup = new wxMenu(
+ );
+ if(!(mEditGroup)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditGroupElements = mEditGroup->Append(
+ ID_EDIT_GRP1,
+ sTexts[165],
+ sTexts[106]
+ );
+ if(!(miEditGroupElements)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditGroupIncluding = mEditGroup->Append(
+ ID_EDIT_GRP13,
+ sTexts[167],
+ sTexts[164]
+ );
+ if(!(miEditGroupIncluding)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuEdit->Append(wxID_ANY, sTexts[74], mEditGroup);
+ miEditUngroup = menuEdit->Append(
+ ID_EDIT_UNGRP,
+ sTexts[76],
+ sTexts[77]
+ );
+ if(!(miEditUngroup)) {
+ goto dkctGUILayoutFinished;
+ }
+ miEditChangeSize = menuEdit->Append(
+ ID_EDIT_DRSZ,
+ sTexts[82],
+ sTexts[83]
+ );
+ if(!(miEditChangeSize)) {
+ goto dkctGUILayoutFinished;
+ }
+ mEditConvert = new wxMenu(
+ );
+ if(!(mEditConvert)) {
+ goto dkctGUILayoutFinished;
+ }
+ miPolygonToPolyline = mEditConvert->Append(
+ ID_EDIT_CONVERT_2,
+ sTexts[537],
+ sTexts[546]
+ );
+ if(!(miPolygonToPolyline)) {
+ goto dkctGUILayoutFinished;
+ }
+ miPolylineToPolygon = mEditConvert->Append(
+ ID_EDIT_CONVERT_1,
+ sTexts[536],
+ sTexts[545]
+ );
+ if(!(miPolylineToPolygon)) {
+ goto dkctGUILayoutFinished;
+ }
+ miClosedToOpenArc = mEditConvert->Append(
+ ID_EDIT_CONVERT_5,
+ sTexts[540],
+ sTexts[549]
+ );
+ if(!(miClosedToOpenArc)) {
+ goto dkctGUILayoutFinished;
+ }
+ miOpenToClosedArc = mEditConvert->Append(
+ ID_EDIT_CONVERT_4,
+ sTexts[539],
+ sTexts[548]
+ );
+ if(!(miOpenToClosedArc)) {
+ goto dkctGUILayoutFinished;
+ }
+ miClosedToOpenSpline = mEditConvert->Append(
+ ID_EDIT_CONVERT_7,
+ sTexts[542],
+ sTexts[551]
+ );
+ if(!(miClosedToOpenSpline)) {
+ goto dkctGUILayoutFinished;
+ }
+ miOpenToClosedSpline = mEditConvert->Append(
+ ID_EDIT_CONVERT_6,
+ sTexts[541],
+ sTexts[550]
+ );
+ if(!(miOpenToClosedSpline)) {
+ goto dkctGUILayoutFinished;
+ }
+ miClosedToOpenIntSpline = mEditConvert->Append(
+ ID_EDIT_CONVERT_3,
+ sTexts[163],
+ sTexts[166]
+ );
+ if(!(miClosedToOpenIntSpline)) {
+ goto dkctGUILayoutFinished;
+ }
+ miOpenToClosedIntSpline = mEditConvert->Append(
+ ID_EDIT_CONVERT_A,
+ sTexts[538],
+ sTexts[547]
+ );
+ if(!(miOpenToClosedIntSpline)) {
+ goto dkctGUILayoutFinished;
+ }
+ miWhiteFilledToDot = mEditConvert->Append(
+ ID_EDIT_CONVERT_9,
+ sTexts[544],
+ sTexts[553]
+ );
+ if(!(miWhiteFilledToDot)) {
+ goto dkctGUILayoutFinished;
+ }
+ miDotToWhiteFilled = mEditConvert->Append(
+ ID_EDIT_CONVERT_8,
+ sTexts[543],
+ sTexts[552]
+ );
+ if(!(miDotToWhiteFilled)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuEdit->Append(wxID_ANY, sTexts[535], mEditConvert);
+ mbMain->Append(menuEdit, sTexts[59]);
+ menuView = new wxMenu(
+ );
+ if(!(menuView)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuZoom = new wxMenu(
+ );
+ if(!(menuZoom)) {
+ goto dkctGUILayoutFinished;
+ }
+ miZoomIn = menuZoom->Append(
+ wxID_ZOOM_IN,
+ sTexts[86],
+ sTexts[87]
+ );
+ if(!(miZoomIn)) {
+ goto dkctGUILayoutFinished;
+ }
+ miZoomOut = menuZoom->Append(
+ wxID_ZOOM_OUT,
+ sTexts[88],
+ sTexts[89]
+ );
+ if(!(miZoomOut)) {
+ goto dkctGUILayoutFinished;
+ }
+ miZoomReset = menuZoom->Append(
+ wxID_ZOOM_100,
+ sTexts[90],
+ sTexts[91]
+ );
+ if(!(miZoomReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuView->Append(wxID_ANY, sTexts[85], menuZoom);
+ menuLayer = new wxMenu(
+ );
+ if(!(menuLayer)) {
+ goto dkctGUILayoutFinished;
+ }
+ miLayerActivateAll = menuLayer->Append(
+ ID_LAYERS_ALL,
+ sTexts[93],
+ sTexts[94]
+ );
+ if(!(miLayerActivateAll)) {
+ goto dkctGUILayoutFinished;
+ }
+ miLayerManager = menuLayer->Append(
+ ID_LAYERS_MGR,
+ sTexts[95],
+ sTexts[96]
+ );
+ if(!(miLayerManager)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuView->Append(wxID_ANY, sTexts[92], menuLayer);
+ miViewCenterView = menuView->Append(
+ ID_ZOOM_CENTER,
+ sTexts[97],
+ sTexts[98]
+ );
+ if(!(miViewCenterView)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuView, sTexts[84]);
+ menuOptions = new wxMenu(
+ );
+ if(!(menuOptions)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours = new wxMenu(
+ );
+ if(!(menuColours)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColourBorder = new wxMenu(
+ );
+ if(!(menuColourBorder)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourBorderModify = menuColourBorder->Append(
+ ID_COL_MOD_BORDER,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourBorderModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourBorderReset = menuColourBorder->Append(
+ ID_COL_RES_BORDER,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourBorderReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[611], menuColourBorder);
+ menuColourBackground = new wxMenu(
+ );
+ if(!(menuColourBackground)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourBackgroundModify = menuColourBackground->Append(
+ ID_COL_MOD_BACKGROUND,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourBackgroundModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourBackgroundReset = menuColourBackground->Append(
+ ID_COL_RES_BACKGROUND,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourBackgroundReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[612], menuColourBackground);
+ menuColourGrid = new wxMenu(
+ );
+ if(!(menuColourGrid)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourGridModify = menuColourGrid->Append(
+ ID_COL_MOD_GRID,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourGridModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourGridReset = menuColourGrid->Append(
+ ID_COL_RES_GRID,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourGridReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[613], menuColourGrid);
+ menuColourPlacement = new wxMenu(
+ );
+ if(!(menuColourPlacement)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourPlacementModify = menuColourPlacement->Append(
+ ID_COL_MOD_PH,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourPlacementModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourPlacementReset = menuColourPlacement->Append(
+ ID_COL_RES_PH,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourPlacementReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[614], menuColourPlacement);
+ menuColourCopy = new wxMenu(
+ );
+ if(!(menuColourCopy)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourCopyModify = menuColourCopy->Append(
+ ID_COL_MOD_COPY,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourCopyModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourCopyReset = menuColourCopy->Append(
+ ID_COL_RES_COPY,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourCopyReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[615], menuColourCopy);
+ menuColourMove = new wxMenu(
+ );
+ if(!(menuColourMove)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourMoveModify = menuColourMove->Append(
+ ID_COL_MOD_MOVE,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourMoveModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourMoveReset = menuColourMove->Append(
+ ID_COL_RES_MOVE,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourMoveReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[616], menuColourMove);
+ menuColourDelete = new wxMenu(
+ );
+ if(!(menuColourDelete)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourDeleteModify = menuColourDelete->Append(
+ ID_COL_MOD_DELETE,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourDeleteModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourDeleteReset = menuColourDelete->Append(
+ ID_COL_RES_DELETE,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourDeleteReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[617], menuColourDelete);
+ menuColourGroup = new wxMenu(
+ );
+ if(!(menuColourGroup)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourGroupModify = menuColourGroup->Append(
+ ID_COL_MOD_GROUP,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourGroupModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourGroupReset = menuColourGroup->Append(
+ ID_COL_RES_GROUP,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourGroupReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[618], menuColourGroup);
+ menuColourMissing = new wxMenu(
+ );
+ if(!(menuColourMissing)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourMissingModify = menuColourMissing->Append(
+ ID_COL_MOD_MISSING,
+ sTexts[609],
+ sTexts[610]
+ );
+ if(!(miColourMissingModify)) {
+ goto dkctGUILayoutFinished;
+ }
+ miColourMissingReset = menuColourMissing->Append(
+ ID_COL_RES_MISSING,
+ sTexts[607],
+ sTexts[608]
+ );
+ if(!(miColourMissingReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuColours->Append(wxID_ANY, sTexts[619], menuColourMissing);
+ menuOptions->Append(wxID_ANY, sTexts[606], menuColours);
+ miOptionsNewObjects = menuOptions->Append(
+ ID_OPT_NEW_OBJECTS,
+ sTexts[625],
+ sTexts[626]
+ );
+ if(!(miOptionsNewObjects)) {
+ goto dkctGUILayoutFinished;
+ }
+ miOptionsScreen = menuOptions->Append(
+ ID_OPT_SCREEN,
+ sTexts[630],
+ sTexts[631]
+ );
+ if(!(miOptionsScreen)) {
+ goto dkctGUILayoutFinished;
+ }
+ miOptionsReset = menuOptions->Append(
+ ID_RESET_OPTIONS,
+ sTexts[602],
+ sTexts[603]
+ );
+ if(!(miOptionsReset)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuOptions, sTexts[601]);
+ menuHelp = new wxMenu(
+ );
+ if(!(menuHelp)) {
+ goto dkctGUILayoutFinished;
+ }
+ miHelpAbout = menuHelp->Append(
+ ID_HELP_ABOUT,
+ sTexts[4],
+ sTexts[5]
+ );
+ if(!(miHelpAbout)) {
+ goto dkctGUILayoutFinished;
+ }
+ miHelpContents = menuHelp->Append(
+ ID_HELP_CONTENTS,
+ sTexts[6],
+ sTexts[7]
+ );
+ if(!(miHelpContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuHelp, sTexts[3]);
+ SetMenuBar(mbMain);
+#endif
+ mainSizer = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(mainSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ mainSizer->Add(10, 10, 0);
+ verticalSizer = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(verticalSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ verticalSizer->Add(10, 10, 0);
+ szTopBar = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(szTopBar)) {
+ goto dkctGUILayoutFinished;
+ }
+ bFileOpen = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ wxID_OPEN,
+ xpm_wxd_tb_open
+ );
+ if(!(bFileOpen)) {
+ goto dkctGUILayoutFinished;
+ }
+ bFileOpen->SetToolTip(sTexts[99]);
+ szTopBar->Add(
+ bFileOpen,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bFileSave = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ wxID_SAVE,
+ xpm_wxd_tb_save
+ );
+ if(!(bFileSave)) {
+ goto dkctGUILayoutFinished;
+ }
+ bFileSave->SetToolTip(sTexts[100]);
+ szTopBar->Add(
+ bFileSave,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szTopBar->Add(10, 10, 1);
+ lZoomPercent = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sNlWx[18]
+ );
+ if(!(lZoomPercent)) {
+ goto dkctGUILayoutFinished;
+ }
+ szTopBar->Add(
+ lZoomPercent,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szTopBar->Add(10, 10, 0);
+ bZoomIn = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ wxID_ZOOM_IN,
+ xpm_wxd_tb_zoom_in
+ );
+ if(!(bZoomIn)) {
+ goto dkctGUILayoutFinished;
+ }
+ bZoomIn->SetToolTip(sTexts[113]);
+ szTopBar->Add(
+ bZoomIn,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bZoomOut = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ wxID_ZOOM_OUT,
+ xpm_wxd_tb_zoom_out
+ );
+ if(!(bZoomOut)) {
+ goto dkctGUILayoutFinished;
+ }
+ bZoomOut->SetToolTip(sTexts[114]);
+ szTopBar->Add(
+ bZoomOut,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bZoomOne = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ wxID_ZOOM_100,
+ xpm_wxd_tb_zoom_11
+ );
+ if(!(bZoomOne)) {
+ goto dkctGUILayoutFinished;
+ }
+ bZoomOne->SetToolTip(sTexts[115]);
+ szTopBar->Add(
+ bZoomOne,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szTopBar->Add(10, 10, 0);
+ cbGridOnOff = new wxCheckBox(
+ dkctGUIContentsPanel,
+ ID_GRID_ON_OFF,
+ sTexts[160]
+ );
+ if(!(cbGridOnOff)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbGridOnOff->SetToolTip(sTexts[116]);
+ szTopBar->Add(
+ cbGridOnOff,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szTopBar->Add(5, 5, 0);
+ cbGridUnit = new wxChoice(
+ dkctGUIContentsPanel,
+ ID_GRID_UNIT,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 2,
+ saGridChoices
+ );
+ if(!(cbGridUnit)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbGridUnit->SetToolTip(sTexts[117]);
+ szTopBar->Add(
+ cbGridUnit,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ cbGridBase = new wxChoice(
+ dkctGUIContentsPanel,
+ ID_GRID_BASE,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 2,
+ saGridBase
+ );
+ if(!(cbGridBase)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbGridBase->SetToolTip(sTexts[118]);
+ szTopBar->Add(
+ cbGridBase,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szTopBar->Add(10, 10, 0);
+ cbPH = new wxCheckBox(
+ dkctGUIContentsPanel,
+ ID_PLACEMENT,
+ sTexts[161]
+ );
+ if(!(cbPH)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbPH->SetToolTip(sTexts[119]);
+ szTopBar->Add(
+ cbPH,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ verticalSizer->Add(
+ szTopBar,
+ 0,
+ wxGROW
+ );
+ verticalSizer->Add(10, 10, 0);
+ szMiddleBar = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(szMiddleBar)) {
+ goto dkctGUILayoutFinished;
+ }
+ szLeftBar = new wxGridBagSizer(
+ );
+ if(!(szLeftBar)) {
+ goto dkctGUILayoutFinished;
+ }
+ bPolyline = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_POLYINE,
+ xpm_wxd_bpolyline
+ );
+ if(!(bPolyline)) {
+ goto dkctGUILayoutFinished;
+ }
+ bPolyline->SetToolTip(sTexts[120]);
+ szLeftBar->Add(
+ bPolyline,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1)
+ );
+ bPolygon = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_POLYGON,
+ xpm_wxd_bpolygon
+ );
+ if(!(bPolygon)) {
+ goto dkctGUILayoutFinished;
+ }
+ bPolygon->SetToolTip(sTexts[121]);
+ szLeftBar->Add(
+ bPolygon,
+ wxGBPosition(0, 1),
+ wxGBSpan(1, 1)
+ );
+ bRect = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_RECT,
+ xpm_wxd_brectangle
+ );
+ if(!(bRect)) {
+ goto dkctGUILayoutFinished;
+ }
+ bRect->SetToolTip(sTexts[122]);
+ szLeftBar->Add(
+ bRect,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1)
+ );
+ bBox = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_BOX,
+ xpm_wxd_bbox
+ );
+ if(!(bBox)) {
+ goto dkctGUILayoutFinished;
+ }
+ bBox->SetToolTip(sTexts[123]);
+ szLeftBar->Add(
+ bBox,
+ wxGBPosition(1, 1),
+ wxGBSpan(1, 1)
+ );
+ bCircle = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_CIRCLE,
+ xpm_wxd_bcircle
+ );
+ if(!(bCircle)) {
+ goto dkctGUILayoutFinished;
+ }
+ bCircle->SetToolTip(sTexts[124]);
+ szLeftBar->Add(
+ bCircle,
+ wxGBPosition(2, 0),
+ wxGBSpan(1, 1)
+ );
+ bEllipse = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_ELLIPSE,
+ xpm_wxd_bellipse
+ );
+ if(!(bEllipse)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEllipse->SetToolTip(sTexts[125]);
+ szLeftBar->Add(
+ bEllipse,
+ wxGBPosition(2, 1),
+ wxGBSpan(1, 1)
+ );
+ bArcOpen = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_ARC_O,
+ xpm_wxd_boarc
+ );
+ if(!(bArcOpen)) {
+ goto dkctGUILayoutFinished;
+ }
+ bArcOpen->SetToolTip(sTexts[126]);
+ szLeftBar->Add(
+ bArcOpen,
+ wxGBPosition(3, 0),
+ wxGBSpan(1, 1)
+ );
+ bArcClosed = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_ARC_C,
+ xpm_wxd_bcarc
+ );
+ if(!(bArcClosed)) {
+ goto dkctGUILayoutFinished;
+ }
+ bArcClosed->SetToolTip(sTexts[127]);
+ szLeftBar->Add(
+ bArcClosed,
+ wxGBPosition(3, 1),
+ wxGBSpan(1, 1)
+ );
+ bSplineAO = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_SPL_AO,
+ xpm_wxd_bsplineoa
+ );
+ if(!(bSplineAO)) {
+ goto dkctGUILayoutFinished;
+ }
+ bSplineAO->SetToolTip(sTexts[128]);
+ szLeftBar->Add(
+ bSplineAO,
+ wxGBPosition(4, 0),
+ wxGBSpan(1, 1)
+ );
+ bSplineAC = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_SPL_AC,
+ xpm_wxd_bsplineca
+ );
+ if(!(bSplineAC)) {
+ goto dkctGUILayoutFinished;
+ }
+ bSplineAC->SetToolTip(sTexts[129]);
+ szLeftBar->Add(
+ bSplineAC,
+ wxGBPosition(4, 1),
+ wxGBSpan(1, 1)
+ );
+ bSplineIO = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_SPL_IO,
+ xpm_wxd_bsplineoi
+ );
+ if(!(bSplineIO)) {
+ goto dkctGUILayoutFinished;
+ }
+ bSplineIO->SetToolTip(sTexts[130]);
+ szLeftBar->Add(
+ bSplineIO,
+ wxGBPosition(5, 0),
+ wxGBSpan(1, 1)
+ );
+ bSplineIC = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_SPL_IC,
+ xpm_wxd_bsplineci
+ );
+ if(!(bSplineIC)) {
+ goto dkctGUILayoutFinished;
+ }
+ bSplineIC->SetToolTip(sTexts[131]);
+ szLeftBar->Add(
+ bSplineIC,
+ wxGBPosition(5, 1),
+ wxGBSpan(1, 1)
+ );
+ bConnector = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_DOT_C,
+ xpm_wxd_bbullet
+ );
+ if(!(bConnector)) {
+ goto dkctGUILayoutFinished;
+ }
+ bConnector->SetToolTip(sTexts[132]);
+ szLeftBar->Add(
+ bConnector,
+ wxGBPosition(6, 0),
+ wxGBSpan(1, 1)
+ );
+ bPin = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_DOT_W,
+ xpm_wxd_bbulletf
+ );
+ if(!(bPin)) {
+ goto dkctGUILayoutFinished;
+ }
+ bPin->SetToolTip(sTexts[133]);
+ szLeftBar->Add(
+ bPin,
+ wxGBPosition(6, 1),
+ wxGBSpan(1, 1)
+ );
+ bText = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_TEXT,
+ xpm_wxd_btext
+ );
+ if(!(bText)) {
+ goto dkctGUILayoutFinished;
+ }
+ bText->SetToolTip(sTexts[134]);
+ szLeftBar->Add(
+ bText,
+ wxGBPosition(7, 0),
+ wxGBSpan(1, 1)
+ );
+ bImage = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_IMG,
+ xpm_wxd_bimg
+ );
+ if(!(bImage)) {
+ goto dkctGUILayoutFinished;
+ }
+ bImage->SetToolTip(sTexts[136]);
+ szLeftBar->Add(
+ bImage,
+ wxGBPosition(7, 1),
+ wxGBSpan(1, 1)
+ );
+ bLibelem = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_ADD_LIBELEM,
+ xpm_wxd_blib
+ );
+ if(!(bLibelem)) {
+ goto dkctGUILayoutFinished;
+ }
+ bLibelem->SetToolTip(sTexts[135]);
+ szLeftBar->Add(
+ bLibelem,
+ wxGBPosition(8, 0),
+ wxGBSpan(1, 1)
+ );
+ szMiddleBar->Add(
+ szLeftBar
+ );
+ szMiddleBar->Add(10, 10, 0);
+ szOperationsAndDraw = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(szOperationsAndDraw)) {
+ goto dkctGUILayoutFinished;
+ }
+ szOperationButtons = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(szOperationButtons)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditCopy = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_COPY,
+ xpm_wxd_bcopy
+ );
+ if(!(bEditCopy)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditCopy->SetToolTip(sTexts[101]);
+ szOperationButtons->Add(
+ bEditCopy,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditMove = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_MOVE,
+ xpm_wxd_bmove
+ );
+ if(!(bEditMove)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditMove->SetToolTip(sTexts[102]);
+ szOperationButtons->Add(
+ bEditMove,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditDelete = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_DEL,
+ xpm_wxd_bdel
+ );
+ if(!(bEditDelete)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditDelete->SetToolTip(sTexts[103]);
+ szOperationButtons->Add(
+ bEditDelete,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szOperationButtons->Add(10, 10, 0);
+ bEditPointAdd = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_PT_ADD,
+ xpm_wxd_baddpoint
+ );
+ if(!(bEditPointAdd)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditPointAdd->SetToolTip(sTexts[110]);
+ szOperationButtons->Add(
+ bEditPointAdd,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditPointDelete = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_PT_DEL,
+ xpm_wxd_bdelpoint
+ );
+ if(!(bEditPointDelete)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditPointDelete->SetToolTip(sTexts[111]);
+ szOperationButtons->Add(
+ bEditPointDelete,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditPointMove = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_PT_MOVE,
+ xpm_wxd_bmvpoint
+ );
+ if(!(bEditPointMove)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditPointMove->SetToolTip(sTexts[104]);
+ szOperationButtons->Add(
+ bEditPointMove,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ cbPointMoveMode = new wxChoice(
+ dkctGUIContentsPanel,
+ ID_CB_POINT_MOVE_MODE,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 2,
+ saPointMoveMode
+ );
+ if(!(cbPointMoveMode)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbPointMoveMode->SetToolTip(sTexts[413]);
+ szOperationButtons->Add(
+ cbPointMoveMode,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bModifySplineValue = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_MOD_SPLINE,
+ xpm_wxd_bmodifys
+ );
+ if(!(bModifySplineValue)) {
+ goto dkctGUILayoutFinished;
+ }
+ bModifySplineValue->SetToolTip(sTexts[621]);
+ szOperationButtons->Add(
+ bModifySplineValue,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szOperationButtons->Add(10, 10, 0);
+ bEditFlipH = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_FLIPH,
+ xpm_wxd_bfliph
+ );
+ if(!(bEditFlipH)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditFlipH->SetToolTip(sTexts[108]);
+ szOperationButtons->Add(
+ bEditFlipH,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditFlipV = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_FLIPV,
+ xpm_wxd_bflipv
+ );
+ if(!(bEditFlipV)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditFlipV->SetToolTip(sTexts[109]);
+ szOperationButtons->Add(
+ bEditFlipV,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditRotLeft = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_ROTLEFT,
+ xpm_wxd_brotleft
+ );
+ if(!(bEditRotLeft)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditRotLeft->SetToolTip(sTexts[567]);
+ szOperationButtons->Add(
+ bEditRotLeft,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditRotRight = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_ROTRIGHT,
+ xpm_wxd_brotright
+ );
+ if(!(bEditRotRight)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditRotRight->SetToolTip(sTexts[569]);
+ szOperationButtons->Add(
+ bEditRotRight,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szOperationButtons->Add(10, 10, 0);
+ bEditDetails = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_DET,
+ xpm_wxd_bdetails
+ );
+ if(!(bEditDetails)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditDetails->SetToolTip(sTexts[105]);
+ szOperationButtons->Add(
+ bEditDetails,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szOperationButtons->Add(10, 10, 0);
+ bEditGroup = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_GRP1,
+ xpm_wxd_bgroup
+ );
+ if(!(bEditGroup)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditGroup->SetToolTip(sTexts[106]);
+ szOperationButtons->Add(
+ bEditGroup,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditGroup3 = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_GRP13,
+ xpm_wxd_bgroup3
+ );
+ if(!(bEditGroup3)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditGroup3->SetToolTip(sTexts[164]);
+ szOperationButtons->Add(
+ bEditGroup3,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bEditUngroup = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_UNGRP,
+ xpm_wxd_bungroup
+ );
+ if(!(bEditUngroup)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditUngroup->SetToolTip(sTexts[107]);
+ szOperationButtons->Add(
+ bEditUngroup,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szOperationButtons->Add(10, 10, 0);
+ bEditChangeSize = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_EDIT_DRSZ,
+ xpm_wxd_tb_borders
+ );
+ if(!(bEditChangeSize)) {
+ goto dkctGUILayoutFinished;
+ }
+ bEditChangeSize->SetToolTip(sTexts[112]);
+ szOperationButtons->Add(
+ bEditChangeSize,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szOperationsAndDraw->Add(
+ szOperationButtons,
+ 0,
+ wxGROW
+ );
+ szOperationsAndDraw->Add(10, 10, 0);
+ szDrawco = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(szDrawco)) {
+ goto dkctGUILayoutFinished;
+ }
+ drawco = new Control(
+ dkctGUIContentsPanel,wxID_ANY,this
+ );
+ if(!(drawco)) {
+ goto dkctGUILayoutFinished;
+ }
+ szDrawco->Add(
+ drawco,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1),
+ wxGROW
+ );
+ sbVert = new wxScrollBar(
+ dkctGUIContentsPanel,
+ ID_SCROLL_V,
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxSB_VERTICAL
+ );
+ if(!(sbVert)) {
+ goto dkctGUILayoutFinished;
+ }
+ szDrawco->Add(
+ sbVert,
+ wxGBPosition(0, 1),
+ wxGBSpan(1, 1),
+ wxGROW
+ );
+ sbHori = new wxScrollBar(
+ dkctGUIContentsPanel,
+ ID_SCROLL_H
+ );
+ if(!(sbHori)) {
+ goto dkctGUILayoutFinished;
+ }
+ szDrawco->Add(
+ sbHori,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1),
+ wxGROW
+ );
+ szDrawco->AddGrowableRow(0);
+ szDrawco->AddGrowableCol(0);
+ szOperationsAndDraw->Add(
+ szDrawco,
+ 1,
+ wxGROW
+ );
+ szMiddleBar->Add(
+ szOperationsAndDraw,
+ 1,
+ wxGROW
+ );
+ verticalSizer->Add(
+ szMiddleBar,
+ 1,
+ wxGROW
+ );
+ verticalSizer->Add(10, 10, 0);
+ szBottomBar = new wxGridBagSizer(
+ );
+ if(!(szBottomBar)) {
+ goto dkctGUILayoutFinished;
+ }
+ lLayer = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[137],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_RIGHT
+ );
+ if(!(lLayer)) {
+ goto dkctGUILayoutFinished;
+ }
+ szBottomBar->Add(
+ lLayer,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(5, 5, wxGBPosition(0, 1), wxGBSpan(1, 1));
+ spLayerNumber = new wxSpinCtrl(
+ dkctGUIContentsPanel,
+ ID_STYLE_LAYER,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ -32768,
+ 32767
+ );
+ if(!(spLayerNumber)) {
+ goto dkctGUILayoutFinished;
+ }
+ spLayerNumber->SetToolTip(sTexts[141]);
+ szBottomBar->Add(
+ spLayerNumber,
+ wxGBPosition(0, 2),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(5, 5, wxGBPosition(0, 3), wxGBSpan(1, 1));
+ lLine = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[138],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_RIGHT
+ );
+ if(!(lLine)) {
+ goto dkctGUILayoutFinished;
+ }
+ szBottomBar->Add(
+ lLine,
+ wxGBPosition(0, 4),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(5, 5, wxGBPosition(0, 5), wxGBSpan(1, 1));
+ szLine = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(szLine)) {
+ goto dkctGUILayoutFinished;
+ }
+ ccLineColour = new Dk4WxColourView(
+ dkctGUIContentsPanel,ID_STYLE_LINE_COL,applicationHelper,0,0,0,wxDefaultPosition,ColourViewSize()
+ );
+ if(!(ccLineColour)) {
+ goto dkctGUILayoutFinished;
+ }
+ ccLineColour->SetToolTip(sTexts[142]);
+ szLine->Add(
+ ccLineColour,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szLine->Add(5, 5, 0);
+ spLineWidth = new wxSpinCtrl(
+ dkctGUIContentsPanel,
+ ID_STYLE_LINE_WIDTH,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 0,
+ 65535,
+ 2
+ );
+ if(!(spLineWidth)) {
+ goto dkctGUILayoutFinished;
+ }
+ spLineWidth->SetToolTip(sTexts[143]);
+ szLine->Add(
+ spLineWidth,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bStyleLineStyle = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_STYLE_LINE_STYLE,
+ xpm_wxd_ls1
+ );
+ if(!(bStyleLineStyle)) {
+ goto dkctGUILayoutFinished;
+ }
+ bStyleLineStyle->SetToolTip(sTexts[144]);
+ szLine->Add(
+ bStyleLineStyle,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bStyleLineJoins = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_STYLE_LINE_JOIN,
+ xpm_wxd_js1
+ );
+ if(!(bStyleLineJoins)) {
+ goto dkctGUILayoutFinished;
+ }
+ bStyleLineJoins->SetToolTip(sTexts[146]);
+ szLine->Add(
+ bStyleLineJoins,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bStyleLineEnds = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_STYLE_LINE_CAP,
+ xpm_wxd_lc1
+ );
+ if(!(bStyleLineEnds)) {
+ goto dkctGUILayoutFinished;
+ }
+ bStyleLineEnds->SetToolTip(sTexts[145]);
+ szLine->Add(
+ bStyleLineEnds,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bStyleArrowForward = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_STYLE_ARROW_F,
+ xpm_wxd_as00
+ );
+ if(!(bStyleArrowForward)) {
+ goto dkctGUILayoutFinished;
+ }
+ bStyleArrowForward->SetToolTip(sTexts[147]);
+ szLine->Add(
+ bStyleArrowForward,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bStyleArrowBackward = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_STYLE_ARROW_B,
+ xpm_wxd_as00
+ );
+ if(!(bStyleArrowBackward)) {
+ goto dkctGUILayoutFinished;
+ }
+ bStyleArrowBackward->SetToolTip(sTexts[148]);
+ szLine->Add(
+ bStyleArrowBackward,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(
+ szLine,
+ wxGBPosition(0, 6),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(5, 5, wxGBPosition(0, 7), wxGBSpan(1, 1));
+ lFill = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[139],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_RIGHT
+ );
+ if(!(lFill)) {
+ goto dkctGUILayoutFinished;
+ }
+ szBottomBar->Add(
+ lFill,
+ wxGBPosition(0, 8),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(5, 5, wxGBPosition(0, 9), wxGBSpan(1, 1));
+ szFill = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(szFill)) {
+ goto dkctGUILayoutFinished;
+ }
+ ccFillColour = new Dk4WxColourView(
+ dkctGUIContentsPanel,ID_STYLE_FILL_COL,applicationHelper,0,0,0,wxDefaultPosition,ColourViewSize()
+ );
+ if(!(ccFillColour)) {
+ goto dkctGUILayoutFinished;
+ }
+ ccFillColour->SetToolTip(sTexts[149]);
+ szFill->Add(
+ ccFillColour,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bStyleFillPattern = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_STYLE_FILL_PATT,
+ xpm_wxd_fs01
+ );
+ if(!(bStyleFillPattern)) {
+ goto dkctGUILayoutFinished;
+ }
+ bStyleFillPattern->SetToolTip(sTexts[150]);
+ szFill->Add(
+ bStyleFillPattern,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(
+ szFill,
+ wxGBPosition(0, 10),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(5, 5, wxGBPosition(1, 0), wxGBSpan(1, 1));
+ lText = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[140],
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_RIGHT
+ );
+ if(!(lText)) {
+ goto dkctGUILayoutFinished;
+ }
+ szBottomBar->Add(
+ lText,
+ wxGBPosition(2, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(5, 5, wxGBPosition(2, 1), wxGBSpan(1, 1));
+ szText = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(szText)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbStyleTextLaTeX = new wxCheckBox(
+ dkctGUIContentsPanel,
+ ID_STYLE_TEXT_LATEX,
+ sTexts[151]
+ );
+ if(!(cbStyleTextLaTeX)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbStyleTextLaTeX->SetToolTip(sTexts[152]);
+ szText->Add(
+ cbStyleTextLaTeX,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bStyleTextAlign = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_STYLE_TEXT_ALIGN,
+ xpm_wxd_ts00
+ );
+ if(!(bStyleTextAlign)) {
+ goto dkctGUILayoutFinished;
+ }
+ bStyleTextAlign->SetToolTip(sTexts[153]);
+ szText->Add(
+ bStyleTextAlign,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ bStyleFontName = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_STYLE_TEXT_FONT,
+ xpm_wxd_fn00
+ );
+ if(!(bStyleFontName)) {
+ goto dkctGUILayoutFinished;
+ }
+ bStyleFontName->SetToolTip(sTexts[154]);
+ szText->Add(
+ bStyleFontName,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ spFontSize = new wxSpinCtrl(
+ dkctGUIContentsPanel,
+ ID_STYLE_TEXT_SIZE,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 12
+ );
+ if(!(spFontSize)) {
+ goto dkctGUILayoutFinished;
+ }
+ spFontSize->SetToolTip(sTexts[155]);
+ szText->Add(
+ spFontSize,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szText->Add(10, 10, 1);
+ lRotation = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[416]
+ );
+ if(!(lRotation)) {
+ goto dkctGUILayoutFinished;
+ }
+ szText->Add(
+ lRotation,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szText->Add(5, 5, 0);
+ spRotation = new wxSpinCtrl(
+ dkctGUIContentsPanel,
+ ID_SPIN_ROTATION,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ -360,
+ 360
+ );
+ if(!(spRotation)) {
+ goto dkctGUILayoutFinished;
+ }
+ spRotation->SetToolTip(sTexts[417]);
+ szText->Add(
+ spRotation,
+ 0,
+ wxALIGN_CENTER_VERTICAL
+ );
+ szBottomBar->Add(
+ szText,
+ wxGBPosition(2, 2),
+ wxGBSpan(1, 10),
+ wxALIGN_CENTER_VERTICAL|wxGROW
+ );
+ verticalSizer->Add(
+ szBottomBar
+ );
+ verticalSizer->Add(10, 10, 0);
+ szHintsBar = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(szHintsBar)) {
+ goto dkctGUILayoutFinished;
+ }
+ tlMouseL = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[13]
+ );
+ if(!(tlMouseL)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ tlMouseL
+ );
+ msgMouseL = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sNlWx[7]
+ );
+ if(!(msgMouseL)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ msgMouseL,
+ 3
+ );
+ tlMouseM = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[14]
+ );
+ if(!(tlMouseM)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ tlMouseM
+ );
+ msgMouseM = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sNlWx[7]
+ );
+ if(!(msgMouseM)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ msgMouseM,
+ 3
+ );
+ tlMouseR = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[15]
+ );
+ if(!(tlMouseR)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ tlMouseR
+ );
+ msgMouseR = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sNlWx[7]
+ );
+ if(!(msgMouseR)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ msgMouseR,
+ 3
+ );
+ tlPosX = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[16]
+ );
+ if(!(tlPosX)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ tlPosX
+ );
+ msgPosX = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sNlWx[7]
+ );
+ if(!(msgPosX)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ msgPosX,
+ 2
+ );
+ tlPosY = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[17]
+ );
+ if(!(tlPosY)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ tlPosY
+ );
+ msgPosY = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sNlWx[7]
+ );
+ if(!(msgPosY)) {
+ goto dkctGUILayoutFinished;
+ }
+ szHintsBar->Add(
+ msgPosY,
+ 2
+ );
+ verticalSizer->Add(
+ szHintsBar,
+ 0,
+ wxGROW
+ );
+ mainSizer->Add(
+ verticalSizer,
+ 1,
+ wxGROW
+ );
+ mainSizer->Add(10, 10, 0);
+ dkctGUIContentsPanel->SetSizer(mainSizer);
+ SetIcon(wxdkdraw_icon);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+#if wxUSE_STATUSBAR
+ if(dkctGUILayoutOK) {
+ CreateStatusBar(1);
+ SetStatusText(sTexts[8]);
+ }
+#endif
+ if(dkctGUILayoutOK) {
+ mainSizer->Fit(this);
+ mainSizer->SetSizeHints(this);
+ }
+
+#line 4743 "WxdkdrawFrame.wxc"
+ if(dkctGUILayoutOK) {
+ pShare = pAppHelp->GetWxsShare();
+ if (NULL != pShare) {
+ wxString basedir(pShare);
+ wxString subdir(libsubdir);
+ basedir.Append(subdir);
+ m_sLibraryDir = basedir;
+ }
+ ccLineColour->SetPlaceColourChooser();
+ ccFillColour->SetPlaceColourChooser();
+ ccLineColour->SetPalettePreferred();
+ ccFillColour->SetPalettePreferred();
+ SetTitle(sTexts[18]);
+ cbGridUnit->SetSelection(0);
+ cbGridBase->SetSelection(0);
+ cbGridOnOff->SetValue(true);
+ cbPH->SetValue(false);
+ cbPointMoveMode->SetSelection(0);
+ LoadConfiguration();
+ m_oStyle.aft = m_oStyle.abt = 0;
+ m_oStyle.afl = m_oStyle.abl = m_iv[IVI_ARROWHEAD_LENGTH];
+ m_oStyle.afw = m_oStyle.abw = m_iv[IVI_ARROWHEAD_WIDTH];
+ m_oStyle.sl = m_iv[IVI_STYLE_VALUE];
+ m_oBorder.pa = NULL;
+ m_oBorder.psti = NULL;
+ m_oBorder.play = NULL;
+ m_oBorder.lw = (uint16_t)2U;
+ m_oBorder.fc[0] = m_iv[IVI_M_MOVE_RED];
+ m_oBorder.fc[1] = m_iv[IVI_M_MOVE_GREEN];
+ m_oBorder.fc[2] = m_iv[IVI_M_MOVE_BLUE];
+ m_oBorder.sc[0] = m_iv[IVI_M_MOVE_RED];
+ m_oBorder.sc[1] = m_iv[IVI_M_MOVE_GREEN];
+ m_oBorder.sc[2] = m_iv[IVI_M_MOVE_BLUE];
+ m_oBorder.cs = DK4_GRA_LC_BUTTED;
+ m_oBorder.fs = WXD_FS_NONE;
+ m_oBorder.ls = WXD_LS_SOLID;
+ m_oBorder.sl = m_iv[IVI_STYLE_VALUE];
+ m_oBorder.js = WXD_LJ_MITERED;
+ m_oBorder.ml = 8;
+ m_oBorder.aft = m_oBorder.abt = 0;
+ m_oBorder.afl = m_oBorder.abl = m_iv[IVI_ARROWHEAD_LENGTH];
+ m_oBorder.afw = m_oBorder.abw = m_iv[IVI_ARROWHEAD_WIDTH];
+ m_oBorder.mark = 0x00;
+ m_oBorder.ot = WXD_OT_BOX;
+ m_oBorder.det.b.r = (uint32_t)0UL;
+ wxSize szscr = ::wxGetDisplayPPI();
+ drawco->m_ptRes.x = szscr.GetWidth();
+ drawco->m_ptRes.y = szscr.GetHeight();
+#if 0
+ RestorePosition();
+#endif
+ /*
+ Calculate factors later used for fish scale and other fill patterns
+ */
+ m_dFactors[0] = sqrt(3.0);
+ a1 = (216.1 * M_PI) / 180.0;
+ a2 = (323.9 * M_PI) / 180.0;
+ kappa = dk4gratool_kappa_for_angle(a2 - a1);
+ m_dFactors[1] =
+ (-1.0 * 9.0 * (a2 - a1) * kappa * sin(a1) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[2] =
+ (-1.0 * 9.0 * (a2 - a1) * kappa * cos(a1) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[3] =
+ (-1.0 * 9.0 * (a2 - a1) * kappa * sin(a2) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[4] =
+ (-1.0 * 9.0 * (a2 - a1) * kappa * cos(a2) * drawco->m_ptRes.x) / 72.0;
+ a1 = M_PI;
+ a2 = 2.0 * M_PI;
+ kappa = dk4gratool_kappa_for_angle(a2 - a1);
+ m_dFactors[5] =
+ (-1.0 * 3.6 * (a2 - a1) * kappa * sin(a1) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[6] =
+ (-1.0 * 3.6 * (a2 - a1) * kappa * cos(a1) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[7] =
+ (-1.0 * 3.6 * (a2 - a1) * kappa * sin(a2) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[8] =
+ (-1.0 * 3.6 * (a2 - a1) * kappa * cos(a2) * drawco->m_ptRes.x) / 72.0;
+#ifndef __WXGTK__
+ /*
+ Set focus to draw control (for mouse wheel)
+ */
+ drawco->SetFocus();
+#endif
+ /*
+ Transfer style information to GUI components
+ */
+ StyleToGUI(false);
+ }
+
+ /* __CHANGE__ 012: Release resources allocated by local variables.
+ */
+
+
+
+#line 4836 "WxdkdrawFrame.wxc"
+}
+
+
+#line 4839 "WxdkdrawFrame.wxc"
+
+
+
+WxdkdrawFrame::~WxdkdrawFrame()
+{
+
+
+#line 4845 "WxdkdrawFrame.wxc"
+
+ /* __CHANGE__ 011: Release resources allocated by further class members.
+ */
+ if (NULL != m_pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ m_pDrw = NULL;
+ }
+
+
+
+#line 4854 "WxdkdrawFrame.wxc"
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawFrame.h b/support/dktools/WxdkdrawFrame.h
new file mode 100644
index 0000000000..70d0b0ce95
--- /dev/null
+++ b/support/dktools/WxdkdrawFrame.h
@@ -0,0 +1,4200 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawFrame.wxc
+*/
+
+/** @file WxdkdrawFrame.h Header file for the WxdkdrawFrame module.
+*/
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWFRAME_H_INCLUDED 1
+
+
+#line 1149 "WxdkdrawFrame.wxc"
+
+#include "wxdkdraw.h"
+
+#ifndef DK4WXCOLOURVIEW_H_INCLUDED
+#include "Dk4WxColourView.h"
+#define DK4WXCOLOURVIEW_H_INCLUDED 1
+#endif
+
+
+
+#line 1159 "WxdkdrawFrame.wxc"
+/** The programs main window.
+*/
+class WxdkdrawFrame : public Dk4WxFrame
+{
+ /* ----- start of control class ----- */
+
+ /** The draw control.
+ Defined as nested class to make both classes friend of each other.
+ */
+ class Control : public wxControl
+ {
+ /** Allow frame class full access to all members.
+ */
+ friend class WxdkdrawFrame;
+
+ /** Class responds to events.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(Control);
+#else
+ DECLARE_DYNAMIC_CLASS(Control)
+#endif
+
+ private:
+
+ /* control private members */
+
+ /** This class uses an event table.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /* control protected members */
+
+ /** Name of control, used in initialization.
+ */
+ static wxChar const ms_controlname[];
+
+ /** Draw control size.
+ Only available within OnPaint handler.
+ */
+ wxSize m_szDrawco;
+
+ /** Screen resolution in dpi for x and y direction.
+ */
+ dk4_gra_point_t m_ptRes;
+
+ /** Coefficients for coordinate transformations.
+ Only available within OnPaint handler.
+ */
+ dk4_gra_point_t m_ptM;
+
+ /** Coefficients for coordinate transformations.
+ Only available within OnPaint handler.
+ */
+ dk4_gra_point_t m_ptN;
+
+ /** Parent frame, containing pointer to the drawing.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Bitmap 1 contains border, viewport and grid.
+ */
+ wxBitmap *m_pB1;
+
+ /** Bitmap 2 contains the graphics elements on top of bitmap 1.
+ */
+ wxBitmap *m_pB2;
+
+ /** Bitmap 3 contains the markup on top of bitmap 2.
+ */
+ wxBitmap *m_pB3;
+
+ /** Zoom factor, depends on zoom level.
+ */
+ double m_dZoom;
+
+ /** Optical grid distance.
+ */
+ uint32_t m_uGridOptical;
+
+ /** Snap grid distance.
+ */
+ uint32_t m_uGridSnap;
+
+ /** Control is allowed to allocate bitmaps.
+ */
+ bool m_bCanAllocate;
+
+ public:
+
+ /* control public methods */
+
+ /** Default constructor.
+ Here for completeness
+ */
+ Control();
+
+ /** Constructor
+ */
+ Control(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ WxdkdrawFrame *pFrame,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & sz = wxDefaultSize,
+ long st = wxBORDER_NONE,
+ wxChar const *name = ms_controlname
+ );
+
+ /** Create control.
+ This method is here for completeness, it is not used
+ by the wxdkdraw program.
+ @param pParent Parent frame.
+ @param wxid Window ID.
+ @param pFrame Parent frame.
+ @param pos Position.
+ @param sz Size.
+ @param st Control style.
+ @param name Control name.
+ */
+ bool
+ Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ WxdkdrawFrame *pFrame,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & sz = wxDefaultSize,
+ long st = wxBORDER_NONE,
+ wxChar const *name = ms_controlname
+ );
+
+ /** Destructor.
+ */
+ ~Control();
+
+ /** Prepare control for destruction.
+ Release bitmaps and avoid re-allocation.
+ */
+ void
+ PrepareForDestruction(void);
+
+ /** Handler for erase event.
+ @param event Event to handle.
+ */
+ void
+ OnErase(wxEraseEvent & event);
+
+ /** Handler for paint event.
+ @param event Event to handle.
+ */
+ void
+ OnPaint(wxPaintEvent & event);
+
+ /** Handler for resize event.
+ @param event Event to handle.
+ */
+ void
+ OnSize(wxSizeEvent & event);
+
+ /** Handler for mouse enter event.
+ @param event Event to handle.
+ */
+ void
+ OnMouseEnter(wxMouseEvent & event);
+
+ /** Handler for mouse leave event.
+ @param event Event to handle.
+ */
+ void
+ OnMouseLeave(wxMouseEvent & event);
+
+ /** Handler for mouse motion event.
+ @param event Event to handle.
+ */
+ void
+ OnMouseMove(wxMouseEvent & event);
+
+ /** Handler for left mouse button event.
+ @param event Event to handle.
+ */
+ void
+ OnLeftMouseButtonDown(wxMouseEvent & event);
+
+ /** Handler for right mouse button event.
+ @param event Event to handle.
+ */
+ void
+ OnRightMouseButtonDown(wxMouseEvent & event);
+
+ /** Handler for middle mouse button event.
+ @param event Event to handle.
+ */
+ void
+ OnMiddleMouseButtonDown(wxMouseEvent & event);
+
+ /** Handler for mouse wheel event.
+ @param event Event to handle.
+ */
+ void
+ OnMouseWheel(wxMouseEvent & event);
+
+ protected:
+
+ /** Check for completed initialization.
+ @return True if ready to handle events, false otherwise.
+ */
+ bool
+ CanHandleEvents(void);
+
+ /** Fill entire control using border colour.
+ @param dc Drawing context.
+ */
+ void
+ PaintOperation0(wxDC & dc);
+
+ /** Draw background for drawing canvas.
+ @param gc Graphics context to use.
+ */
+ void
+ PaintOperationCanvas(
+ wxGraphicsContext *gc
+ );
+
+ /** Draw grid in a calculated bounding box.
+ @param gc Graphics context to use.
+ @param g_end Bounding box data for grid.
+ */
+ void
+ PaintOperationBoundingBoxGrid(
+ wxGraphicsContext *gc,
+ Wxd_bb_t const & g_end
+ );
+
+ /** Draw grid.
+ @param gc Graphics context to use.
+ */
+ void
+ PaintOperationGrid(
+ wxGraphicsContext *gc
+ );
+
+ /** Decide whether or not to use placement help in current state.
+ @return True to show placement help, false otherwise.
+ */
+ bool
+ StateUsesPlacementHelp(void);
+
+ /** Draw border, drawable area and grid.
+ @param gc Graphics context to use.
+ */
+ void
+ PaintOperation1(wxGraphicsContext *gc);
+
+ /** Draw drawing objects.
+ @param gc Graphics context to use.
+ @param event Event to process.
+ */
+ void
+ PaintOperation2(wxGraphicsContext *gc);
+
+ /** Draw markup on top of drawing.
+ @param gc Graphics context to use.
+ @param event Event to process.
+ */
+ void
+ PaintOperation3(wxGraphicsContext *gc);
+
+ /** Calculate zoom factor and grid distances after zooming in
+ or out or after changing graphics.
+ */
+ void
+ CalculateZoomFactor(void);
+
+ /** Calculate grid distances after changing grid settings.
+ */
+ void
+ CalculateGridDistances(void);
+
+ /** Calculate conversion coefficients.
+ */
+ void
+ CalculateConversionCoefficients(void);
+
+ /** Convert x distance from wxd to pixels.
+ @param d Distance to convert.
+ @return Conversion result.
+ */
+ double
+ ConvDist(double d);
+
+ /** Convert x distance from wxd to pixels.
+ @param d Distance to convert.
+ @return Conversion result.
+ */
+ double
+ ConvDist(int32_t d);
+
+ /** Convert x coordinate from wxd to pixels.
+ @param x X coordinate value in wxd.
+ @return X coordinate value in pixels.
+ */
+ double
+ ConvX(double x);
+
+ /** Convert x coordinate from wxd to pixels.
+ @param x X coordinate value in wxd.
+ @return X coordinate value in pixels.
+ */
+ double
+ ConvX(int32_t x);
+
+ /** Convert y coordinate from wxd to pixels.
+ @param y Y coordinate value in wxd.
+ @return Y coordinate value in pixels.
+ */
+ double
+ ConvY(double y);
+
+ /** Convert y coordinate from wxd to pixels.
+ @param y Y coordinate value in wxd.
+ @return Y coordinate value in pixels.
+ */
+ double
+ ConvY(int32_t y);
+
+ /** Convert x coordinate back from pixels to wxd.
+ @param x X coordinate in pixels.
+ @return X coordinate in wxd.
+ */
+ double
+ InvX(double x);
+
+ /** Convert y coordinate back from pixels to wxd.
+ @param y Y coordinate in pixels.
+ @return Y coordinate in wxd.
+ */
+ double
+ InvY(double y);
+
+ /** Convert x coordinate back from pixels to wxd.
+ @param x X coordinate in pixels.
+ @param ok Success flag to reset on error.
+ @return Backward conversion value on success, 0L on error.
+ */
+ int32_t
+ InvX(double x, bool & ok);
+
+ /** Convert y coordinate back from pixels to wxd.
+ @param y Y coordinate in pixels.
+ @param ok Success flag to reset on error.
+ @return Backward conversion value on success, 0L on error.
+ */
+ int32_t
+ InvY(double y, bool & ok);
+
+#if 0
+
+ /** Convert x coordinate back from pixels to wxd.
+ @param dptr Address of result variable.
+ @param x X coordinate in pixels.
+ @return True on success, false on error (x out of range).
+ */
+ bool
+ InvX(int32_t *dptr, double x);
+
+ /** Convert y coordinate back from pixels to wxd.
+ @param dptr Address of result variable.
+ @param y Y coordinate in pixels.
+ @return True on success, false on error (y out of range).
+ */
+ bool
+ InvY(int32_t *dptr, double y);
+
+ /** Convert x coordinate back from pixels to wxd.
+ @param dptr Address of result variable.
+ @param x X coordinate in pixels.
+ @return True on success, false on error (x out of range).
+ */
+ bool
+ InvX(int32_t *dptr, int x);
+
+ /** Convert y coordinate back from pixels to wxd.
+ @param dptr Address of result variable.
+ @param y Y coordinate in pixels.
+ @return True on success, false on error (y out of range).
+ */
+ bool
+ InvY(int32_t *dptr, int y);
+
+#endif
+
+
+ /** Round grid coordinate downward.
+ @param x Original coordinate.
+ @param gr Grid distance.
+ @param ok Success variable to reset on numerical errors.
+ @param fo Force downward rounding.
+ @return Result.
+ */
+ int32_t
+ GridRoundDown(
+ int32_t x,
+ uint32_t gr,
+ bool & ok,
+ bool fo = false
+ );
+
+ /** Round grid coordinate upward.
+ @param x Original coordinate.
+ @param gr Grid distance.
+ @param ok Success variable to reset on numerical errors.
+ @param fo Force upward rounding.
+ @return Result.
+ */
+ int32_t
+ GridRoundUp(
+ int32_t x,
+ uint32_t gr,
+ bool & ok,
+ bool fo = false
+ );
+
+ /** Round grid coordinate to nearest grid point.
+ @param x Original coordinate.
+ @param gr Grid distance.
+ @param ok Success variable to reset on numerical errors.
+ @return Result.
+ */
+ int32_t
+ GridRoundNearest(int32_t x, uint32_t gr, bool & ok);
+
+ /** Check whether object contains all required data for drawing.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip object.
+ */
+ bool
+ CanDrawElement(Wxd_object_t const *pobj);
+
+ /** Check whether to draw an object in normal drawing pass.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip drawing.
+ */
+ bool
+ MustDrawElementInNormalPass(Wxd_object_t const *pobj);
+
+ /** Check whether to draw an object in markup pass.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip drawing.
+ */
+ bool
+ MustDrawElementInMarkupPass(Wxd_object_t const *pobj);
+
+ /** Check whether to highlight an object in markup pass.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip drawing.
+ */
+ bool
+ MustHighlightElementInMarkupPass(Wxd_object_t const *pobj);
+
+ /** Check whether to highlight an object in markup pass.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip drawing.
+ */
+ bool
+ MustHighlight2ElementInMarkupPass(Wxd_object_t const *pobj);
+
+ /** Check whether there are objects under construction in
+ current state.
+ @return True for states with objects under construction.
+ */
+ bool
+ StateHasObjectsUnderModification(void);
+
+ /** Check whether there are objects to highlight in current state.
+ @return True for states with objects under construction.
+ */
+ bool
+ StateHasObjectsToHighlight(void);
+
+ /** Check whether there are objects to highlight in current state.
+ @return True for states with objects under construction.
+ */
+ bool
+ StateHasObjectsToHighlight2(void);
+
+ /** Choose stroke colour, either the objects stroke colour
+ or a colour for markup.
+ @param sc Destination array for colour components.
+ @param pObj Object to draw.
+ @param iMarkup Markup type to use.
+ */
+ void
+ ChooseStrokeColour(int *sc, Wxd_object_t const *pObj, int iMarkup);
+
+ /** Draw one graphics object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one text object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawTextElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Create path for polyline or polygon.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathPolyline(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for one X-spline segment consisting
+ of multiple sub-segments.
+ @param p Graphics path to modify.
+ @param pt Spline points array.
+ @param xsp X-spline data.
+ @param segno Number of current segment.
+ @param subsegs Number of sub-segments to produce.
+ @param divisor Divisor for derivative values.
+ @param shiftx X shift value.
+ @param shifty Y shift value.
+ @param ib Index of point B in pt.
+ @param ic Index of point C in pt.
+ */
+ void
+ SplineSegment(
+ wxGraphicsPath & p,
+ Wxd_spline_point_t *pt,
+ dk4_xsp_2d_t *xsp,
+ uint16_t segno,
+ size_t subsegs,
+ double divisor,
+ double shiftx,
+ double shifty,
+ uint16_t ib,
+ uint16_t ic
+ );
+
+ /** Create path for spline.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathSpline(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for arc.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathArc(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for circle.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathCircle(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for ellipse.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathEllipse(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for box.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathBox(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Mark up one polyline object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupPolyline(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one spline object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupSpline(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one arc object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupArc(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one circle object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupCircle(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one ellipse object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupEllipse(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one box object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupBoundingBox(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ Wxd_bb_t const *pbb,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one box object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupBox(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one open path graphics object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawOpenPathElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one closed path graphics object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawClosedPathElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one image creation region to graphics context.
+ @param gc Graphics context.
+ */
+ void
+ DrawImageRegion(
+ wxGraphicsContext *gc
+ );
+
+ /** Draw one image object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawImageElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one dot object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawDotElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Set up pen attributes for object.
+ @param pen Pen to modify.
+ @param pObj Object to draw.
+ @param pDash Address of dash lengths array.
+ @param pNdash Address of variable for number of elements.
+ */
+ void
+ SetupPenForObject(
+ wxPen & pen,
+ Wxd_object_t const *pObj,
+ wxDash *pDash,
+ int *pNdash
+ );
+
+ /** Calculate point radius for markup point.
+ @param lw Line width of object to markup, may be 0.
+ @return Markup radius to use.
+ */
+ double
+ MarkupPointRadius(uint16_t lw);
+
+ /** Draw a markup point.
+ @param gc Grahics context to draw to.
+ @param sc Stroke colour.
+ @param x X position of point.
+ @param y Y position of point.
+ @param lw Line width of object markup point belongs to.
+ @param pShift Shift vector, may be NULL.
+ */
+ void
+ DrawMarkupPoint(
+ wxGraphicsContext *gc,
+ int const *sc,
+ double x,
+ double y,
+ uint16_t lw,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw a markup point.
+ @param gc Grahics context to draw to.
+ @param sc Stroke colour.
+ @param x X position of point.
+ @param y Y position of point.
+ @param lw Line width of object markup point belongs to.
+ @param pShift Shift vector, may be NULL.
+ */
+ void
+ DrawMarkupPoint(
+ wxGraphicsContext *gc,
+ int const *sc,
+ int32_t x,
+ int32_t y,
+ uint16_t lw,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Calculate vertices for arrowhead.
+ @param pt Address of result array.
+ @param pDrw Drawing.
+ @param pObj Object to add arrowheads to.
+ @param xpos X position of arrow end.
+ @param ypos Y position of arrow end.
+ @param rot Arrow rotation.
+ @param atype Arrow type.
+ @param alength Arrow length.
+ @param awidth Arrow width.
+ */
+ void
+ ArrowVertices(
+ dk4_gra_point_t *pt,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ double xpos,
+ double ypos,
+ double rot,
+ uint8_t atype,
+ uint8_t alength,
+ uint8_t awidth
+ );
+
+ /** Draw one arrowhead.
+ @param gc Grahpics context to use for drawing.
+ @param pDrw Drawing.
+ @param pObj Object to add arrowhead to.
+ @param sc Stroke colour.
+ @param xpos X position of arrowhead end.
+ @param ypos Y position of arrowhead end.
+ @param rot Arrowhead rotation.
+ @param atype Arrowhead type.
+ @param alength Arrowhead length.
+ @param awidth Arrowhead width.
+ */
+ void
+ DrawOneArrowhead(
+ wxGraphicsContext *gc,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int const *sc,
+ double xpos,
+ double ypos,
+ double rot,
+ uint8_t atype,
+ uint8_t alength,
+ uint8_t awidth
+ );
+
+ /** Add arrowheads to object.
+ @param gc Graphics context to use for drawing.
+ @param pDrw Drawing.
+ @param pObj Object to add arrows to.
+ @param sc Stroke colour.
+ @param pShift Shift vector.
+ */
+ void
+ AddArrowheads(
+ wxGraphicsContext *gc,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int const *sc,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Calculate line width in pixels for object.
+ @param pDrw Drawing.
+ @param pObj Object.
+ @return Line width to use on screen.
+ */
+ int
+ LineWidthForObject(
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int iMarkup = WXD_MARKUP_NONE
+ );
+
+ /** Highlight the point to move.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ */
+ void
+ HighlightPointToMove(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno
+ );
+
+ /** Highlight the point to delete.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ */
+ void
+ HighlightPointToDelete(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno
+ );
+
+ /** Highlight the point to delete.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ @param bAppend New point must be appended after pno.
+ */
+ void
+ HighlightPointToAdd(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ bool bAppend
+ );
+
+ /** Highlight one point of the element for style changes.
+ @param gc Graphics context to use.
+ @param x X position (in WXD coordinates).
+ @param y Y position (in WXD coordinates).
+ @param r Radius (half square length).
+ @param sc Colour components.
+ */
+ void
+ HighlightStylePoint(
+ wxGraphicsContext *gc,
+ double x,
+ double y,
+ double r,
+ int const *sc
+ );
+
+ /** Highlight one point of the element for style changes.
+ @param gc Graphics context to use.
+ @param x X position (in WXD coordinates).
+ @param y Y position (in WXD coordinates).
+ @param r Radius (half square length).
+ @param sc Colour components.
+ */
+ void
+ HighlightStylePoint(
+ wxGraphicsContext *gc,
+ int32_t x,
+ int32_t y,
+ double r,
+ int const *sc
+ );
+
+ /** Highlight the element for style changes.
+ @param gc Graphics context to use.
+ @param pobj Object to highlight.
+ */
+ void
+ HighlightStyleElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj
+ );
+
+ /** Retrieve point coordinates from a bounding box.
+ @param x Result variable for x coordinate.
+ @param y Result variable for y coordinate.
+ @param pbb Bounding box (box or image).
+ @param pno Point number.
+ */
+ void
+ GetPointFromBox(
+ double & x,
+ double & y,
+ Wxd_bb_t const *pbb,
+ uint16_t pno
+ );
+
+ /** Highlight the point to move.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ @param ci Color index for highlighting.
+ */
+ void
+ HighlightPointForOperation(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ int ci
+ );
+
+ /** Highlight line from mouse position to control point.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ @param ci Color index for highlighting.
+ */
+ void
+ HighlightLineToPoint(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ int ci
+ );
+
+ };
+
+ /* ----- End of control class ----- */
+
+ /** The control has full access to all members of the frame class.
+ */
+ friend class Control;
+
+ public:
+
+ /** IDs for menu items, buttons and other elements.
+ */
+ enum {
+ ID_FRAME = ((wxID_HIGHEST) + 1) , /**< Main window. */
+ ID_HELP_ABOUT , /**< Show version dialog box. */
+ ID_HELP_CONTENTS , /**< Open online help table of contents. */
+ ID_ADD_POLYINE , /**< Add polyline. */
+ ID_ADD_POLYGON , /**< Add polygon. */
+ ID_ADD_RECT , /**< Add rectangle. */
+ ID_ADD_BOX , /**< Add box (rounded corner rectangle). */
+ ID_ADD_CIRCLE , /**< Add circle. */
+ ID_ADD_ELLIPSE , /**< Add ellipse. */
+ ID_ADD_ARC_O , /**< Add open arc. */
+ ID_ADD_ARC_C , /**< Add closed arc. */
+ ID_ADD_SPL_AO , /**< Add open approximated spline. */
+ ID_ADD_SPL_AC , /**< Add closed approximated spline. */
+ ID_ADD_SPL_IO , /**< Add open interpolated spline. */
+ ID_ADD_SPL_IC , /**< Add closed interpolated spline. */
+ ID_ADD_DOT_C , /**< Add colour filled dot. */
+ ID_ADD_DOT_W , /**< Add white filled dot. */
+ ID_ADD_TEXT , /**< Add text label. */
+ ID_ADD_IMG , /**< Add image. */
+ ID_ADD_LIBELEM , /**< Add library element. */
+ ID_EDIT_COPY , /**< Copy object. */
+ ID_EDIT_MOVE , /**< Move object. */
+ ID_EDIT_DEL , /**< Delete object. */
+ ID_EDIT_PT_MOVE , /**< Move point. */
+ ID_EDIT_PT_ADD , /**< Add point. */
+ ID_EDIT_PT_DEL , /**< Delete point. */
+ ID_EDIT_DET , /**< Edit details. */
+ ID_EDIT_GRP1 , /**< Group objects (elements one by one). */
+#if 0
+ ID_EDIT_GRP12 , /**< Group objects (touching rectangle). */
+#endif
+ ID_EDIT_GRP13 , /**< Group objects (including rectangle). */
+ ID_EDIT_UNGRP , /**< Ungroup objects. */
+ ID_EDIT_FLIPH , /**< Flip ojects horizontally. */
+ ID_EDIT_FLIPV , /**< Flip objects vertically. */
+ ID_EDIT_ROTLEFT , /**< Rotate 90 degree to left. */
+ ID_EDIT_ROTRIGHT , /**< Rotate 90 degree to right. */
+ ID_EDIT_DRSZ , /**< Change drawing size. */
+ ID_LAYERS_ALL , /**< Activate all layers. */
+ ID_LAYERS_MGR , /**< Run layer manager. */
+ ID_ZOOM_CENTER , /**< Center view. */
+ ID_GRID_ON_OFF , /**< Activate or deactivate grid. */
+ ID_GRID_UNIT , /**< Grid unit changed. */
+ ID_GRID_BASE , /**< Grid base changed. */
+ ID_PLACEMENT , /**< Placement help changed. */
+#if 0
+ ID_SELECT_OBJ, /**< Select object to change style .*/
+#endif
+ ID_STYLE_LAYER , /**< Layer spin control. */
+ ID_STYLE_LINE_COL , /**< Line colour button. */
+ ID_STYLE_LINE_WIDTH , /**< Line width spin control. */
+ ID_STYLE_LINE_STYLE , /**< Line style button. */
+ ID_STYLE_LINE_CAP , /**< Line cap button. */
+ ID_STYLE_LINE_JOIN , /**< Line joint button. */
+ ID_STYLE_ARROW_F , /**< Arrowhead forward button. */
+ ID_STYLE_ARROW_B , /**< Arrowhead backward button. */
+ ID_STYLE_FILL_COL , /**< Fill colour button. */
+ ID_STYLE_FILL_PATT , /**< Fill pattern button. */
+ ID_STYLE_TEXT_LATEX , /**< LaTeX special text checkbox. */
+ ID_STYLE_TEXT_ALIGN , /**< Text align button. */
+ ID_STYLE_TEXT_FONT , /**< Text font button. */
+ ID_STYLE_TEXT_SIZE , /**< Text size spin control. */
+ ID_SCROLL_H , /**< Horizontal scrollbar. */
+ ID_SCROLL_V , /**< Vertical scrollbar. */
+ ID_CB_POINT_MOVE_MODE , /**< Checkbox for point move mode. */
+ ID_SPIN_ROTATION , /**< Spin control for rotation. */
+ ID_EDIT_CONVERT_1 , /**< Convert to polygon. */
+ ID_EDIT_CONVERT_2 , /**< Convert to polyline. */
+ ID_EDIT_CONVERT_3 , /**< Convert to open interpolated spline. */
+ ID_EDIT_CONVERT_4 , /**< Convert to closed arc. */
+ ID_EDIT_CONVERT_5 , /**< Convert to open arc. */
+ ID_EDIT_CONVERT_6 , /**< Convert to closed approximated spl. */
+ ID_EDIT_CONVERT_7 , /**< Convert to open approximated spline. */
+ ID_EDIT_CONVERT_8 , /**< Convert to white filled dot. */
+ ID_EDIT_CONVERT_9 , /**< Convert to simple dot. */
+ ID_EDIT_CONVERT_A , /**< Convert to closed interpolated spl. */
+ ID_RESET_OPTIONS , /**< Reset options to default values. */
+ ID_COL_MOD_BORDER , /**< Modify border colour. */
+ ID_COL_RES_BORDER , /**< Reset border colour. */
+ ID_COL_MOD_BACKGROUND , /**< Modify background colour. */
+ ID_COL_RES_BACKGROUND , /**< Reset background colour. */
+ ID_COL_MOD_GRID , /**< Modify grid colour. */
+ ID_COL_RES_GRID , /**< Reset grid colour. */
+ ID_COL_MOD_PH , /**< Modify placement help colour. */
+ ID_COL_RES_PH , /**< Reset placement help colour. */
+ ID_COL_MOD_COPY , /**< Modify copy operation colour. */
+ ID_COL_RES_COPY , /**< Reset copy operation colour. */
+ ID_COL_MOD_MOVE , /**< Modify move operation colour. */
+ ID_COL_RES_MOVE , /**< Reset move operation colour. */
+ ID_COL_MOD_DELETE , /**< Modify delete operation colour. */
+ ID_COL_RES_DELETE , /**< Reset delete operation colour. */
+ ID_COL_MOD_GROUP , /**< Modify group candidates colour. */
+ ID_COL_RES_GROUP , /**< Reset group candidates colour. */
+ ID_COL_MOD_MISSING , /**< Modify missing image colour. */
+ ID_COL_RES_MISSING , /**< Reset missing image colour. */
+ ID_MOD_SPLINE , /**< Modify spline s value. */
+ ID_OPT_NEW_OBJECTS , /**< Options for new objects. */
+ ID_OPT_SCREEN , /**< Options for screen representation. */
+ };
+
+ /** Zoom level range.
+ */
+ enum {
+ ZOOM_LEVEL_MIN = -14 , /**< Minimum zoom level. */
+ ZOOM_LEVEL_MAX = 14 /**< Maximum zoom level. */
+ };
+
+ /* IMPORTANT: Number and order of entries (except IVI_MAX) must match
+ the number and order of entries in the default_values and
+ iv_keys arrays in the WxdkdrawFrameTools module!
+ */
+ /** Names for indices into the m_iv array.
+ */
+ enum {
+ IVI_BORDER_RED = 0 , /**< Border colour red component. */
+ IVI_BORDER_GREEN , /**< Border colour green component. */
+ IVI_BORDER_BLUE , /**< Border colour blue component. */
+ IVI_BG_RED , /**< Background colour red. */
+ IVI_BG_GREEN , /**< Background colour green. */
+ IVI_BG_BLUE , /**< Background colour blue. */
+ IVI_GRID_RED , /**< Grid colour red. */
+ IVI_GRID_GREEN , /**< Grid colour green. */
+ IVI_GRID_BLUE , /**< Grid colour blue. */
+ IVI_PH_RED , /**< Placement help colour red. */
+ IVI_PH_GREEN , /**< Placement help colour green. */
+ IVI_PH_BLUE , /**< Placement help colour blue. */
+ IVI_M_COPY_RED , /**< Copy markup colour red. */
+ IVI_M_COPY_GREEN , /**< Copy markup colour green. */
+ IVI_M_COPY_BLUE , /**< Copy markup colour blue. */
+ IVI_M_MOVE_RED , /**< Move markup colour red. */
+ IVI_M_MOVE_GREEN , /**< Move markup colour green. */
+ IVI_M_MOVE_BLUE , /**< Move markup colour blue. */
+ IVI_M_DEL_RED , /**< Delete markup colour red. */
+ IVI_M_DEL_GREEN , /**< Delete markup colour green. */
+ IVI_M_DEL_BLUE , /**< Delete markup colour blue. */
+ IVI_M_GROUP_RED , /**< Group markup colour red. */
+ IVI_M_GROUP_GREEN , /**< Group markup colour green. */
+ IVI_M_GROUP_BLUE , /**< Group markup colour blue. */
+ IVI_MISSIMG_RED , /**< Missing image border red. */
+ IVI_MISSIMG_GREEN , /**< Missing image border green. */
+ IVI_MISSIMG_BLUE , /**< Missing image border blue. */
+ IVI_XS_SUBSEGS , /**< X-spline sub segments. */
+ IVI_FONT_EXACT , /**< Flag: Use exact fonts. */
+ IVI_DOT_DIAMETER_FILLED , /**< Diameter filled dots. */
+ IVI_DOT_DIAMETER_WHITE , /**< Diameter white filled dots. */
+ IVI_ARROWHEAD_LENGTH , /**< Default arrowhead length. */
+ IVI_ARROWHEAD_WIDTH , /**< Default arrowhead width. */
+ IVI_STYLE_VALUE , /**< Default style value. */
+ IVI_MITER_LIMIT , /**< Miter limit. */
+ IVI_REDUCE_MARKUP_POINTS , /**< Reduce markup point radius. */
+ IVI_D_LAYER , /**< Default layer for new objects. */
+ IVI_D_LINE_COL_RED , /**< Default line colour red comp. */
+ IVI_D_LINE_COL_GREEN , /**< Default line colour green comp. */
+ IVI_D_LINE_COL_BLUE , /**< Default line colour blue comp. */
+ IVI_D_LINEWIDTH , /**< Default line width. */
+ IVI_D_LINESTYLE , /**< Default line style. */
+ IVI_D_STYLE_VALUE , /**< Default style value. */
+ IVI_D_JOIN_STYLE , /**< Default line join style. */
+ IVI_D_MITER_LIMIT , /**< Default miter limit. */
+ IVI_D_CAP_STYLE , /**< Default line cap style. */
+ IVI_D_AHF_TYPE , /**< Default arrowhead forward type. */
+ IVI_D_AHF_LENGTH , /**< Default arrowhead forward lgt. */
+ IVI_D_AHF_WIDTH , /**< Default arrowhead forward width. */
+ IVI_D_AHB_TYPE , /**< Default arrowhead backward type. */
+ IVI_D_AHB_LENGTH , /**< Default arrowhead backward lgt. */
+ IVI_D_AHB_WIDTH , /**< Default arrowhead backward wdth. */
+ IVI_D_FILL_COL_RED , /**< Default fill colour red comp. */
+ IVI_D_FILL_COL_GREEN , /**< Default fill colour green comp. */
+ IVI_D_FILL_COL_BLUE , /**< Default fill colour blue comp. */
+ IVI_D_FILL_STYLE , /**< Default fill style. */
+ IVI_D_TEXT_LATEX , /**< Default LaTeX option for text. */
+ IVI_D_TEXT_ALIGN , /**< Default text align. */
+ IVI_D_TEXT_FONT , /**< Default text font. */
+ IVI_D_TEXT_SIZE , /**< Default text size. */
+ IVI_C_GRID , /**< Enable or disable grid. */
+ IVI_C_PH , /**< Enable or disable place help. */
+ IVI_C_COR_POSITION , /**< Correct position after zoom out. */
+ IVI_MAX /**< Number of indices in the list. */
+ };
+ /* IMPORTANT: Number and order of entries (except IVI_MAX) must match
+ the number and order of entries in the default_values and
+ iv_keys arrays in the WxdkdrawFrameTools module!
+ */
+
+ private:
+
+ /* Frame private members */
+
+ /** Event table for frame.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /* frame protected members */
+
+ /** Drawing object containing default style information.
+ */
+ Wxd_object_t m_oStyle;
+
+ /** Border object to show drawing size.
+ */
+ Wxd_object_t m_oBorder;
+
+ /** Status structure to read WXD file.
+ */
+ wxdrd_status_t m_oStatusReader;
+
+ /** Status structure to write WXD file.
+ */
+ wxdwr_status_t m_oStatusWriter;
+
+ /** Integer values for different purposes, configurable.
+ */
+ int m_iv[IVI_MAX];
+
+ /** Coefficients used to create stipple bitmaps,
+ recalculated on zoom level changes or file reload.
+ 0: Length equivalent for 3.6 / sqrt(3)
+ 1: Length equivalent for 7.2
+ 2: Length equivalent for 3.6 * sqrt(2)
+ 3: Length equivalent for 14.4
+ 4: Length equivalent for 3.6
+ 5: Length equivalent for 21.6
+ 6: Length equivalent for 14.54 (width of large fish scale)
+ 7: Length equivalent for 3.7 (height of large fish scale)
+ 8: Length equivalent for 14.4 * sqrt(3)
+ 9: X difference at start of large fish scale
+ 10: Y difference at start of large fish scale
+ 11: X difference at end of large fish scale
+ 12: Y difference at end of large fish scale
+ 13: X difference at start of small fish scale
+ 14: Y difference at start of small fish scale
+ 15: X difference at end of small fish scale
+ 16: Y difference at end of small fish scale
+ 17...19 unused
+ */
+ double m_dPatterns[20];
+
+ /** Constant factors calculated once in the constructor.
+ 0: sqrt(3)
+ 1: dx/dt at 0 factor for large fish scales
+ 2: dy/dt at 0 factor for large fish scales
+ 3: dx/dt at 1 factor for large fish scales
+ 4: dy/dt at 1 factor for large fish scales
+ 5: dx/dt at 0 factor for small fish scales
+ 6: dy/dt at 0 factor for small fish scales
+ 7: dx/dt at 1 factor for small fish scales
+ 8: dy/dt at 1 factor for small fish scales
+ 9...15 unused
+ */
+ double m_dFactors[16];
+
+ /** Error report used in event processing.
+ */
+ dk4_er_t m_oErrorReport;
+
+ /** Protect m_bIsFirstIdle against multiple access.
+ */
+ wxCriticalSection csIsFirstIdle;
+
+ /** Original ellipse/circle data before moving a point.
+ */
+ Wxd_det_ellipse_t m_ellPointMoveOri;
+
+ /** Full path name.
+ */
+ wxString m_sFileFull;
+
+ /** Short file name without leading directory.
+ */
+ wxString m_sFileShort;
+
+ /** Directory file resides in.
+ */
+ wxString m_sFileDir;
+
+ /** Directory previous embedded image was taken from.
+ */
+ wxString m_sImageDir;
+
+ /** Directory previous library element was taken from.
+ */
+ wxString m_sLibraryDir;
+
+ /** Short name of previous library element.
+ */
+ wxString m_sLibraryShort;
+
+ /** Original drawing size.
+ */
+ Wxd_bb_t m_oOldSize;
+
+ /** Raw mouse position (not aligned to grid).
+ */
+ Wxd_point_t m_ptMousePosRaw;
+
+ /** Mouse position aligned to grid.
+ */
+ Wxd_point_t m_ptMousePosGrid;
+
+ /** Start point of copy or move operation.
+ */
+ Wxd_point_t m_ptMouseMoveStart;
+
+ /** Difference in copy or move operation,
+ (m_ptMousePosGrid - m_ptMouseMoveStart).
+ */
+ Wxd_point_t m_ptMouseMoveDiff;
+
+ /** Original position of the point currently moved.
+ Required to compute differences or to restore
+ position on abort.
+ */
+ Wxd_point_t m_ptPointMoveOri;
+
+ /** Mouse position on control in pixels.
+ */
+ wxSize m_szMousePosPix;
+
+ /** Object currently to edit with style elements.
+ */
+ Wxd_object_t *m_pStyle;
+
+ /** Current object, used for several purposes:
+ * S_NOOP: Selection candidate.
+ * S_POLY_FURTHER: Polyline we are editing.
+ */
+ Wxd_object_t *m_pCurrent;
+
+ /** Localized texts.
+ */
+ wxChar const * const *sTexts;
+
+ /** Non-localized texts.
+ */
+ wxChar const * const *sNlWx;
+
+ /** Non-localized texts.
+ */
+ dkChar const * const *sNlDk;
+
+ /** Drawing opened in this frame.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Current operation state.
+ */
+ int m_iState;
+
+ /** Accumulated wheel rotation with control key pressed.
+ */
+ int m_iWheelControl;
+
+ /** Accumulated wheel rotation with shift key pressed.
+ */
+ int m_iWheelShift;
+
+ /** Accumulated wheel rotation with not key pressed.
+ */
+ int m_iWheelNormal;
+
+ /** Index of current point to edit.
+ */
+ uint16_t m_uCurrent;
+
+ /** Object we are about to create or to convert to.
+ */
+ int8_t m_iObjToCreate;
+
+ /** Flag for different purposes:
+ * Spline just created is interpolated (otherwise approximated).
+ * Box just created is a rounded box (otherwise rectangular).
+ * Rotation in negative direction.
+ */
+ bool m_bSplineInterpolated;
+
+ /** Flag: Current mouse position is an acceptable point.
+ */
+ bool m_bAcceptablePoint;
+
+ /** Flag: Is first idle.
+ */
+ bool m_bIsFirstIdle;
+
+ /** Flag: Windows is active an event handlers can be executed.
+ This flag is set in the reaction on the first idle event
+ and reset on closing the application.
+ */
+ bool m_bActive;
+
+ /** Flag: Drawing was modified (there are unsaved changes).
+ */
+ bool m_bModified;
+
+ /** Flag: File name known for output file.
+ */
+ bool m_bHaveName;
+
+ /** Flag: Mouse position is known.
+ */
+ bool m_bMousePos;
+
+ /** Flag: Successfully calculated difference for copy/shift operation.
+ */
+ bool m_bMouseDiff;
+
+ /** Snap point to move to the mouse position (otherwise relative
+ movement).
+ */
+ bool m_bSnap;
+
+ /** Flag: Update frame at end of event handler.
+ */
+ bool m_bUpdate;
+
+ /** Flag: Append new point after current point (true)
+ or insert before current point (false).
+ */
+ bool m_bAppendPoint;
+
+ /** Flag: Have corner point to move when changing drawing size.
+ */
+ bool m_bHaveCornerPoint;
+
+ /** Flip vertically (true) or horizontally (false).
+ */
+ bool m_bVerticalFlip;
+
+ /* __CHANGE__ 011: Add further member variables.
+ */
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** Contents panel.
+ */
+ wxPanel *dkctGUIContentsPanel;
+
+ /** GUI element mainSizer.
+ */
+#line 567 "WxdkdrawFrame.wxc"
+ wxBoxSizer *mainSizer;
+
+ /** GUI element mbMain.
+ */
+#line 17 "WxdkdrawFrame.wxc"
+ wxMenuBar *mbMain;
+
+ /** GUI element menuFile.
+ */
+#line 25 "WxdkdrawFrame.wxc"
+ wxMenu *menuFile;
+
+ /** GUI element menuAdd.
+ */
+#line 58 "WxdkdrawFrame.wxc"
+ wxMenu *menuAdd;
+
+ /** GUI element menuEdit.
+ */
+#line 164 "WxdkdrawFrame.wxc"
+ wxMenu *menuEdit;
+
+ /** GUI element menuView.
+ */
+#line 335 "WxdkdrawFrame.wxc"
+ wxMenu *menuView;
+
+ /** GUI element menuOptions.
+ */
+#line 341 "WxdkdrawFrame.wxc"
+ wxMenu *menuOptions;
+
+ /** GUI element menuHelp.
+ */
+#line 552 "WxdkdrawFrame.wxc"
+ wxMenu *menuHelp;
+
+ /** GUI element miFileNew.
+ */
+#line 33 "WxdkdrawFrame.wxc"
+ wxMenuItem *miFileNew;
+
+ /** GUI element miFileOpen.
+ */
+#line 38 "WxdkdrawFrame.wxc"
+ wxMenuItem *miFileOpen;
+
+ /** GUI element miFileSave.
+ */
+#line 43 "WxdkdrawFrame.wxc"
+ wxMenuItem *miFileSave;
+
+ /** GUI element miFileSaveAs.
+ */
+#line 48 "WxdkdrawFrame.wxc"
+ wxMenuItem *miFileSaveAs;
+
+ /** GUI element miFileExit.
+ */
+#line 53 "WxdkdrawFrame.wxc"
+ wxMenuItem *miFileExit;
+
+ /** GUI element miAddPolyline.
+ */
+#line 79 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddPolyline;
+
+ /** GUI element miAddPolygon.
+ */
+#line 84 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddPolygon;
+
+ /** GUI element miAddRectangle.
+ */
+#line 89 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddRectangle;
+
+ /** GUI element miAddRoundedBox.
+ */
+#line 94 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddRoundedBox;
+
+ /** GUI element miAddCircle.
+ */
+#line 99 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddCircle;
+
+ /** GUI element miAddEllipse.
+ */
+#line 104 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddEllipse;
+
+ /** GUI element miAddArcOpen.
+ */
+#line 109 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddArcOpen;
+
+ /** GUI element miAddArcClosed.
+ */
+#line 114 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddArcClosed;
+
+ /** GUI element miAddSplineAO.
+ */
+#line 119 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddSplineAO;
+
+ /** GUI element miAddSplineAC.
+ */
+#line 124 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddSplineAC;
+
+ /** GUI element miAddSplineIO.
+ */
+#line 129 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddSplineIO;
+
+ /** GUI element miAddSplineIC.
+ */
+#line 134 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddSplineIC;
+
+ /** GUI element miAddConnector.
+ */
+#line 139 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddConnector;
+
+ /** GUI element miAddPin.
+ */
+#line 144 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddPin;
+
+ /** GUI element miAddText.
+ */
+#line 149 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddText;
+
+ /** GUI element miAddImage.
+ */
+#line 154 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddImage;
+
+ /** GUI element miAddLibelem.
+ */
+#line 159 "WxdkdrawFrame.wxc"
+ wxMenuItem *miAddLibelem;
+
+ /** GUI element miEditCopy.
+ */
+#line 184 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditCopy;
+
+ /** GUI element miEditMove.
+ */
+#line 189 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditMove;
+
+ /** GUI element miEditDelete.
+ */
+#line 194 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditDelete;
+
+ /** GUI element miEditPointAdd.
+ */
+#line 209 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditPointAdd;
+
+ /** GUI element miEditPointRemove.
+ */
+#line 214 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditPointRemove;
+
+ /** GUI element miEditPointMove.
+ */
+#line 199 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditPointMove;
+
+ /** GUI element miEditModifySpline.
+ */
+#line 204 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditModifySpline;
+
+ /** GUI element miEditFlipH.
+ */
+#line 246 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditFlipH;
+
+ /** GUI element miEditFlipV.
+ */
+#line 251 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditFlipV;
+
+ /** GUI element miEditRotLeft.
+ */
+#line 256 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditRotLeft;
+
+ /** GUI element miEditRotRight.
+ */
+#line 261 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditRotRight;
+
+ /** GUI element miEditDetails.
+ */
+#line 219 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditDetails;
+
+ /** GUI element mEditGroup.
+ */
+#line 224 "WxdkdrawFrame.wxc"
+ wxMenu *mEditGroup;
+
+ /** GUI element miEditUngroup.
+ */
+#line 241 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditUngroup;
+
+ /** GUI element miEditChangeSize.
+ */
+#line 267 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditChangeSize;
+
+ /** GUI element mEditConvert.
+ */
+#line 272 "WxdkdrawFrame.wxc"
+ wxMenu *mEditConvert;
+
+ /** GUI element miEditGroupElements.
+ */
+#line 230 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditGroupElements;
+
+ /** GUI element miEditGroupIncluding.
+ */
+#line 235 "WxdkdrawFrame.wxc"
+ wxMenuItem *miEditGroupIncluding;
+
+ /** GUI element miPolygonToPolyline.
+ */
+#line 290 "WxdkdrawFrame.wxc"
+ wxMenuItem *miPolygonToPolyline;
+
+ /** GUI element miPolylineToPolygon.
+ */
+#line 285 "WxdkdrawFrame.wxc"
+ wxMenuItem *miPolylineToPolygon;
+
+ /** GUI element miClosedToOpenArc.
+ */
+#line 300 "WxdkdrawFrame.wxc"
+ wxMenuItem *miClosedToOpenArc;
+
+ /** GUI element miOpenToClosedArc.
+ */
+#line 295 "WxdkdrawFrame.wxc"
+ wxMenuItem *miOpenToClosedArc;
+
+ /** GUI element miClosedToOpenSpline.
+ */
+#line 310 "WxdkdrawFrame.wxc"
+ wxMenuItem *miClosedToOpenSpline;
+
+ /** GUI element miOpenToClosedSpline.
+ */
+#line 305 "WxdkdrawFrame.wxc"
+ wxMenuItem *miOpenToClosedSpline;
+
+ /** GUI element miClosedToOpenIntSpline.
+ */
+#line 320 "WxdkdrawFrame.wxc"
+ wxMenuItem *miClosedToOpenIntSpline;
+
+ /** GUI element miOpenToClosedIntSpline.
+ */
+#line 315 "WxdkdrawFrame.wxc"
+ wxMenuItem *miOpenToClosedIntSpline;
+
+ /** GUI element miWhiteFilledToDot.
+ */
+#line 330 "WxdkdrawFrame.wxc"
+ wxMenuItem *miWhiteFilledToDot;
+
+ /** GUI element miDotToWhiteFilled.
+ */
+#line 325 "WxdkdrawFrame.wxc"
+ wxMenuItem *miDotToWhiteFilled;
+
+ /** GUI element menuZoom.
+ */
+#line 348 "WxdkdrawFrame.wxc"
+ wxMenu *menuZoom;
+
+ /** GUI element menuLayer.
+ */
+#line 369 "WxdkdrawFrame.wxc"
+ wxMenu *menuLayer;
+
+ /** GUI element miViewCenterView.
+ */
+#line 384 "WxdkdrawFrame.wxc"
+ wxMenuItem *miViewCenterView;
+
+ /** GUI element menuColours.
+ */
+#line 389 "WxdkdrawFrame.wxc"
+ wxMenu *menuColours;
+
+ /** GUI element miOptionsNewObjects.
+ */
+#line 537 "WxdkdrawFrame.wxc"
+ wxMenuItem *miOptionsNewObjects;
+
+ /** GUI element miOptionsScreen.
+ */
+#line 542 "WxdkdrawFrame.wxc"
+ wxMenuItem *miOptionsScreen;
+
+ /** GUI element miOptionsReset.
+ */
+#line 547 "WxdkdrawFrame.wxc"
+ wxMenuItem *miOptionsReset;
+
+ /** GUI element miZoomIn.
+ */
+#line 354 "WxdkdrawFrame.wxc"
+ wxMenuItem *miZoomIn;
+
+ /** GUI element miZoomOut.
+ */
+#line 359 "WxdkdrawFrame.wxc"
+ wxMenuItem *miZoomOut;
+
+ /** GUI element miZoomReset.
+ */
+#line 364 "WxdkdrawFrame.wxc"
+ wxMenuItem *miZoomReset;
+
+ /** GUI element miLayerActivateAll.
+ */
+#line 374 "WxdkdrawFrame.wxc"
+ wxMenuItem *miLayerActivateAll;
+
+ /** GUI element miLayerManager.
+ */
+#line 379 "WxdkdrawFrame.wxc"
+ wxMenuItem *miLayerManager;
+
+ /** GUI element menuColourBorder.
+ */
+#line 401 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourBorder;
+
+ /** GUI element menuColourBackground.
+ */
+#line 416 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourBackground;
+
+ /** GUI element menuColourGrid.
+ */
+#line 432 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourGrid;
+
+ /** GUI element menuColourPlacement.
+ */
+#line 447 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourPlacement;
+
+ /** GUI element menuColourCopy.
+ */
+#line 462 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourCopy;
+
+ /** GUI element menuColourMove.
+ */
+#line 477 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourMove;
+
+ /** GUI element menuColourDelete.
+ */
+#line 492 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourDelete;
+
+ /** GUI element menuColourGroup.
+ */
+#line 507 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourGroup;
+
+ /** GUI element menuColourMissing.
+ */
+#line 522 "WxdkdrawFrame.wxc"
+ wxMenu *menuColourMissing;
+
+ /** GUI element miColourBorderModify.
+ */
+#line 406 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourBorderModify;
+
+ /** GUI element miColourBorderReset.
+ */
+#line 411 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourBorderReset;
+
+ /** GUI element miColourBackgroundModify.
+ */
+#line 422 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourBackgroundModify;
+
+ /** GUI element miColourBackgroundReset.
+ */
+#line 427 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourBackgroundReset;
+
+ /** GUI element miColourGridModify.
+ */
+#line 437 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourGridModify;
+
+ /** GUI element miColourGridReset.
+ */
+#line 442 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourGridReset;
+
+ /** GUI element miColourPlacementModify.
+ */
+#line 452 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourPlacementModify;
+
+ /** GUI element miColourPlacementReset.
+ */
+#line 457 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourPlacementReset;
+
+ /** GUI element miColourCopyModify.
+ */
+#line 467 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourCopyModify;
+
+ /** GUI element miColourCopyReset.
+ */
+#line 472 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourCopyReset;
+
+ /** GUI element miColourMoveModify.
+ */
+#line 482 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourMoveModify;
+
+ /** GUI element miColourMoveReset.
+ */
+#line 487 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourMoveReset;
+
+ /** GUI element miColourDeleteModify.
+ */
+#line 497 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourDeleteModify;
+
+ /** GUI element miColourDeleteReset.
+ */
+#line 502 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourDeleteReset;
+
+ /** GUI element miColourGroupModify.
+ */
+#line 512 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourGroupModify;
+
+ /** GUI element miColourGroupReset.
+ */
+#line 517 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourGroupReset;
+
+ /** GUI element miColourMissingModify.
+ */
+#line 527 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourMissingModify;
+
+ /** GUI element miColourMissingReset.
+ */
+#line 532 "WxdkdrawFrame.wxc"
+ wxMenuItem *miColourMissingReset;
+
+ /** GUI element miHelpAbout.
+ */
+#line 557 "WxdkdrawFrame.wxc"
+ wxMenuItem *miHelpAbout;
+
+ /** GUI element miHelpContents.
+ */
+#line 562 "WxdkdrawFrame.wxc"
+ wxMenuItem *miHelpContents;
+
+ /** GUI element verticalSizer.
+ */
+#line 573 "WxdkdrawFrame.wxc"
+ wxBoxSizer *verticalSizer;
+
+ /** GUI element szTopBar.
+ */
+#line 588 "WxdkdrawFrame.wxc"
+ wxBoxSizer *szTopBar;
+
+ /** GUI element szMiddleBar.
+ */
+#line 609 "WxdkdrawFrame.wxc"
+ wxBoxSizer *szMiddleBar;
+
+ /** GUI element szBottomBar.
+ */
+#line 648 "WxdkdrawFrame.wxc"
+ wxGridBagSizer *szBottomBar;
+
+ /** GUI element szHintsBar.
+ */
+#line 721 "WxdkdrawFrame.wxc"
+ wxBoxSizer *szHintsBar;
+
+ /** GUI element bFileOpen.
+ */
+#line 773 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bFileOpen;
+
+ /** GUI element bFileSave.
+ */
+#line 778 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bFileSave;
+
+ /** GUI element lZoomPercent.
+ */
+#line 884 "WxdkdrawFrame.wxc"
+ wxStaticText *lZoomPercent;
+
+ /** GUI element bZoomIn.
+ */
+#line 869 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bZoomIn;
+
+ /** GUI element bZoomOut.
+ */
+#line 874 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bZoomOut;
+
+ /** GUI element bZoomOne.
+ */
+#line 879 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bZoomOne;
+
+ /** GUI element cbGridOnOff.
+ */
+#line 887 "WxdkdrawFrame.wxc"
+ wxCheckBox *cbGridOnOff;
+
+ /** GUI element cbGridUnit.
+ */
+#line 892 "WxdkdrawFrame.wxc"
+ wxChoice *cbGridUnit;
+
+ /** GUI element cbGridBase.
+ */
+#line 897 "WxdkdrawFrame.wxc"
+ wxChoice *cbGridBase;
+
+ /** GUI element cbPH.
+ */
+#line 903 "WxdkdrawFrame.wxc"
+ wxCheckBox *cbPH;
+
+ /** GUI element szLeftBar.
+ */
+#line 618 "WxdkdrawFrame.wxc"
+ wxGridBagSizer *szLeftBar;
+
+ /** GUI element szOperationsAndDraw.
+ */
+#line 638 "WxdkdrawFrame.wxc"
+ wxBoxSizer *szOperationsAndDraw;
+
+ /** GUI element bPolyline.
+ */
+#line 908 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bPolyline;
+
+ /** GUI element bPolygon.
+ */
+#line 913 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bPolygon;
+
+ /** GUI element bRect.
+ */
+#line 918 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bRect;
+
+ /** GUI element bBox.
+ */
+#line 923 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bBox;
+
+ /** GUI element bCircle.
+ */
+#line 928 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bCircle;
+
+ /** GUI element bEllipse.
+ */
+#line 933 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEllipse;
+
+ /** GUI element bArcOpen.
+ */
+#line 938 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bArcOpen;
+
+ /** GUI element bArcClosed.
+ */
+#line 943 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bArcClosed;
+
+ /** GUI element bSplineAO.
+ */
+#line 948 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bSplineAO;
+
+ /** GUI element bSplineAC.
+ */
+#line 953 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bSplineAC;
+
+ /** GUI element bSplineIO.
+ */
+#line 958 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bSplineIO;
+
+ /** GUI element bSplineIC.
+ */
+#line 963 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bSplineIC;
+
+ /** GUI element bConnector.
+ */
+#line 968 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bConnector;
+
+ /** GUI element bPin.
+ */
+#line 973 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bPin;
+
+ /** GUI element bText.
+ */
+#line 978 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bText;
+
+ /** GUI element bImage.
+ */
+#line 988 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bImage;
+
+ /** GUI element bLibelem.
+ */
+#line 983 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bLibelem;
+
+ /** GUI element szOperationButtons.
+ */
+#line 735 "WxdkdrawFrame.wxc"
+ wxBoxSizer *szOperationButtons;
+
+ /** GUI element szDrawco.
+ */
+#line 762 "WxdkdrawFrame.wxc"
+ wxGridBagSizer *szDrawco;
+
+ /** GUI element lLayer.
+ */
+#line 994 "WxdkdrawFrame.wxc"
+ wxStaticText *lLayer;
+
+ /** GUI element spLayerNumber.
+ */
+#line 1015 "WxdkdrawFrame.wxc"
+ wxSpinCtrl *spLayerNumber;
+
+ /** GUI element lLine.
+ */
+#line 998 "WxdkdrawFrame.wxc"
+ wxStaticText *lLine;
+
+ /** GUI element szLine.
+ */
+#line 690 "WxdkdrawFrame.wxc"
+ wxBoxSizer *szLine;
+
+ /** GUI element lFill.
+ */
+#line 1002 "WxdkdrawFrame.wxc"
+ wxStaticText *lFill;
+
+ /** GUI element szFill.
+ */
+#line 701 "WxdkdrawFrame.wxc"
+ wxBoxSizer *szFill;
+
+ /** GUI element lText.
+ */
+#line 1006 "WxdkdrawFrame.wxc"
+ wxStaticText *lText;
+
+ /** GUI element szText.
+ */
+#line 706 "WxdkdrawFrame.wxc"
+ wxBoxSizer *szText;
+
+ /** GUI element ccLineColour.
+ */
+#line 1021 "WxdkdrawFrame.wxc"
+ Dk4WxColourView *ccLineColour;
+
+ /** GUI element spLineWidth.
+ */
+#line 1026 "WxdkdrawFrame.wxc"
+ wxSpinCtrl *spLineWidth;
+
+ /** GUI element bStyleLineStyle.
+ */
+#line 1032 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bStyleLineStyle;
+
+ /** GUI element bStyleLineJoins.
+ */
+#line 1042 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bStyleLineJoins;
+
+ /** GUI element bStyleLineEnds.
+ */
+#line 1037 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bStyleLineEnds;
+
+ /** GUI element bStyleArrowForward.
+ */
+#line 1047 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bStyleArrowForward;
+
+ /** GUI element bStyleArrowBackward.
+ */
+#line 1052 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bStyleArrowBackward;
+
+ /** GUI element ccFillColour.
+ */
+#line 1057 "WxdkdrawFrame.wxc"
+ Dk4WxColourView *ccFillColour;
+
+ /** GUI element bStyleFillPattern.
+ */
+#line 1062 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bStyleFillPattern;
+
+ /** GUI element cbStyleTextLaTeX.
+ */
+#line 1067 "WxdkdrawFrame.wxc"
+ wxCheckBox *cbStyleTextLaTeX;
+
+ /** GUI element bStyleTextAlign.
+ */
+#line 1072 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bStyleTextAlign;
+
+ /** GUI element bStyleFontName.
+ */
+#line 1077 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bStyleFontName;
+
+ /** GUI element spFontSize.
+ */
+#line 1082 "WxdkdrawFrame.wxc"
+ wxSpinCtrl *spFontSize;
+
+ /** GUI element lRotation.
+ */
+#line 1088 "WxdkdrawFrame.wxc"
+ wxStaticText *lRotation;
+
+ /** GUI element spRotation.
+ */
+#line 1091 "WxdkdrawFrame.wxc"
+ wxSpinCtrl *spRotation;
+
+ /** GUI element tlMouseL.
+ */
+#line 1097 "WxdkdrawFrame.wxc"
+ wxStaticText *tlMouseL;
+
+ /** GUI element msgMouseL.
+ */
+#line 1100 "WxdkdrawFrame.wxc"
+ wxStaticText *msgMouseL;
+
+ /** GUI element tlMouseM.
+ */
+#line 1104 "WxdkdrawFrame.wxc"
+ wxStaticText *tlMouseM;
+
+ /** GUI element msgMouseM.
+ */
+#line 1107 "WxdkdrawFrame.wxc"
+ wxStaticText *msgMouseM;
+
+ /** GUI element tlMouseR.
+ */
+#line 1111 "WxdkdrawFrame.wxc"
+ wxStaticText *tlMouseR;
+
+ /** GUI element msgMouseR.
+ */
+#line 1114 "WxdkdrawFrame.wxc"
+ wxStaticText *msgMouseR;
+
+ /** GUI element tlPosX.
+ */
+#line 1118 "WxdkdrawFrame.wxc"
+ wxStaticText *tlPosX;
+
+ /** GUI element msgPosX.
+ */
+#line 1121 "WxdkdrawFrame.wxc"
+ wxStaticText *msgPosX;
+
+ /** GUI element tlPosY.
+ */
+#line 1125 "WxdkdrawFrame.wxc"
+ wxStaticText *tlPosY;
+
+ /** GUI element msgPosY.
+ */
+#line 1128 "WxdkdrawFrame.wxc"
+ wxStaticText *msgPosY;
+
+ /** GUI element bEditCopy.
+ */
+#line 783 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditCopy;
+
+ /** GUI element bEditMove.
+ */
+#line 788 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditMove;
+
+ /** GUI element bEditDelete.
+ */
+#line 793 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditDelete;
+
+ /** GUI element bEditPointAdd.
+ */
+#line 854 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditPointAdd;
+
+ /** GUI element bEditPointDelete.
+ */
+#line 859 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditPointDelete;
+
+ /** GUI element bEditPointMove.
+ */
+#line 798 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditPointMove;
+
+ /** GUI element cbPointMoveMode.
+ */
+#line 803 "WxdkdrawFrame.wxc"
+ wxChoice *cbPointMoveMode;
+
+ /** GUI element bModifySplineValue.
+ */
+#line 808 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bModifySplineValue;
+
+ /** GUI element bEditFlipH.
+ */
+#line 834 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditFlipH;
+
+ /** GUI element bEditFlipV.
+ */
+#line 839 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditFlipV;
+
+ /** GUI element bEditRotLeft.
+ */
+#line 844 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditRotLeft;
+
+ /** GUI element bEditRotRight.
+ */
+#line 849 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditRotRight;
+
+ /** GUI element bEditDetails.
+ */
+#line 813 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditDetails;
+
+ /** GUI element bEditGroup.
+ */
+#line 819 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditGroup;
+
+ /** GUI element bEditGroup3.
+ */
+#line 824 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditGroup3;
+
+ /** GUI element bEditUngroup.
+ */
+#line 829 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditUngroup;
+
+ /** GUI element bEditChangeSize.
+ */
+#line 864 "WxdkdrawFrame.wxc"
+ wxBitmapButton *bEditChangeSize;
+
+ /** GUI element drawco.
+ */
+#line 1133 "WxdkdrawFrame.wxc"
+ Control *drawco;
+
+ /** GUI element sbVert.
+ */
+#line 1138 "WxdkdrawFrame.wxc"
+ wxScrollBar *sbVert;
+
+ /** GUI element sbHori.
+ */
+#line 1143 "WxdkdrawFrame.wxc"
+ wxScrollBar *sbHori;
+
+
+#line 2656 "WxdkdrawFrame.wxc"
+
+ public:
+
+ /* frame public members */
+
+ /** Names for bitmaps to visualize line styles.
+ */
+ static const char ** const ms_ls_images[];
+
+ /** Names for bitmaps to visualize line cap styles.
+ */
+ static const char ** const ms_lc_images[];
+
+ /** Names for bitmaps to visualize line join styles.
+ */
+ static const char ** const ms_lj_images[];
+
+ /** Names for bitmaps to visualize arrow types.
+ */
+ static const char ** const ms_arrow_images[];
+
+ /** Names for bitmaps to visualize fill patterns.
+ */
+ static const char ** const ms_fs_images[];
+
+ /** Names for bitmaps to visualize text alignments.
+ */
+ static const char ** const ms_ta_images[];
+
+ /** Names for bitmaps to visualize fonts.
+ */
+ static const char ** const ms_fn_images[];
+
+ /** Constructor.
+ @param wxid Window ID.
+ @param applicationHelper Application helper object.
+ @param hc Help controller for online help.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @param localizedTexts Localized wxChar texts.
+ @param nlWx Non-localized wxChar texts.
+ @param nlDk Non-localized dkChar texts.
+ */
+ WxdkdrawFrame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ int argc,
+ wxChar **argv,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk
+ );
+
+ /** Destructor.
+ */
+ ~WxdkdrawFrame();
+
+ /** Check whether we can close the window.
+ @param isLast Flag: Last main window to close.
+ */
+ bool
+ CanClose(bool isFinal);
+
+ /** Handler for File/Exit.
+ @param event Event to process.
+ */
+ void
+ OnQuit(wxCommandEvent & event);
+
+ /** Handler for Help/About.
+ @param event Event to process.
+ */
+ void
+ OnAbout(wxCommandEvent & event);
+
+ /** Handler for Help/Contents.
+ @param event Event to process.
+ */
+ void
+ OnHelpContents(wxCommandEvent & event);
+
+ /** Handler for idle events.
+ @param event Event to process.
+ */
+ void
+ OnIdle(wxIdleEvent & event);
+
+ /** Handler File / New.
+ @param event Event to process.
+ */
+ void
+ OnFileNew(wxCommandEvent & event);
+
+ /** Handler File / Open.
+ @param event Event to process.
+ */
+ void
+ OnFileOpen(wxCommandEvent & event);
+
+ /** Save drawing to file.
+ @return True on success, false on error.
+ */
+ bool
+ SaveToFile(void);
+
+ /** Mark the drawing as modified or not modified.
+ @param f New flag value.
+ */
+ void
+ SetModified(bool f = true);
+
+ /** Handler File / Save.
+ @param event Event to process.
+ */
+ void
+ OnFileSave(wxCommandEvent & event);
+
+ /** Handler File / Save as.
+ @param event Event to process.
+ */
+ void
+ OnFileSaveAs(wxCommandEvent & event);
+
+ /** On zoom out correct the center point if necessary.
+ */
+ void
+ CorrectCenterPointIfNecessary(void);
+
+ /** Zoom level was changed.
+ @param bZoomOut Zoom change was "zoom out".
+ */
+ void
+ ZoomChanged(bool bZoomOut = false);
+
+ /** Adjust scrollbars after zoom or position change.
+ */
+ void
+ AdjustScrollbars(void);
+
+ /** Handler Zoom / In.
+ @param event Event to process.
+ */
+ void
+ OnZoomIn(wxCommandEvent & event);
+
+ /** Handler Zoom / Out.
+ @param event Event to process.
+ */
+ void
+ OnZoomOut(wxCommandEvent & event);
+
+ /** Handler Zoom / Reset.
+ @param event Event to process.
+ */
+ void
+ OnZoom100(wxCommandEvent & event);
+
+ /** Start polygon or polyline.
+ @param ot Object type to start, WXD_OT_POLYLINE or WXD_OT_POLYGON.
+ */
+ void
+ OnPolygonPolyline(int8_t ot);
+
+ /** Handler for Add polyline.
+ @param event Event to process.
+ */
+ void
+ OnAddPolyline(wxCommandEvent & event);
+
+
+ /** Handler for Add polygon.
+ @param event Event to process.
+ */
+ void
+ OnAddPolygon(wxCommandEvent & event);
+
+ /** Start creation of rectangular box.
+ @param bRounded Rounded corners (rectangular otherwise).
+ */
+ void
+ OnRectangleBox(bool bRounded);
+
+ /** Handler for Add rectangle.
+ @param event Event to process.
+ */
+ void
+ OnAddRectangle(wxCommandEvent & event);
+
+ /** Handler for Add box.
+ @param event Event to process.
+ */
+ void
+ OnAddBox(wxCommandEvent & event);
+
+ /** Handler for Add circle.
+ @param event Event to process.
+ */
+ void
+ OnAddCircle(wxCommandEvent & event);
+
+ /** Handler for Add ellipse.
+ @param event Event to process.
+ */
+ void
+ OnAddEllipse(wxCommandEvent & event);
+
+ /** Handler for Add open arc.
+ @param event Event to process.
+ */
+ void
+ OnAddArcOpen(wxCommandEvent & event);
+
+ /** Handler for Add closed arc.
+ @param event Event to process.
+ */
+ void
+ OnAddArcClosed(wxCommandEvent & event);
+
+ /** Start creation of new spline.
+ @param ot Object type (open or closed spline).
+ @param bInterpolated Interpolated or approximated.
+ */
+ void
+ OnSpline(int8_t ot, bool bInterpolated);
+
+ /** Handler for Add open approximated spline.
+ @param event Event to process.
+ */
+ void
+ OnAddSplineAO(wxCommandEvent & event);
+
+ /** Handler for Add closed approximated spline.
+ @param event Event to process.
+ */
+ void
+ OnAddSplineAC(wxCommandEvent & event);
+
+ /** Handler for Add open interpolated spline.
+ @param event Event to process.
+ */
+ void
+ OnAddSplineIO(wxCommandEvent & event);
+
+ /** Handler for Add closed interpolated spline.
+ @param event Event to process.
+ */
+ void
+ OnAddSplineIC(wxCommandEvent & event);
+
+ /** Handler for Add dot.
+ @param event Event to process.
+ */
+ void
+ OnAddDot(wxCommandEvent & event);
+
+ /** Handler for Add white filled dot.
+ @param event Event to process.
+ */
+ void
+ OnAddWhiteDot(wxCommandEvent & event);
+
+ /** Handler for Add text label.
+ @param event Event to process.
+ */
+ void
+ OnAddTextlabel(wxCommandEvent & event);
+
+ /** Handler for Add image.
+ @param event Event to process.
+ */
+ void
+ OnAddImage(wxCommandEvent & event);
+
+ /** Inner function to add library element.
+ */
+ void
+ AddLibelem(void);
+
+ /** Handler for Add library element.
+ @param event Event to process.
+ */
+ void
+ OnAddLibelem(wxCommandEvent & event);
+
+ /** Handler for Edit / copy.
+ @param event Event to process.
+ */
+ void
+ OnEditCopy(wxCommandEvent & event);
+
+ /** Handler for Edit / move.
+ @param event Event to process.
+ */
+ void
+ OnEditMove(wxCommandEvent & event);
+
+ /** Handler for Edit / delete.
+ @param event Event to process.
+ */
+ void
+ OnEditDelete(wxCommandEvent & event);
+
+ /** Handler for Edit / Move point.
+ @param event Event to process.
+ */
+ void
+ OnEditPointMove(wxCommandEvent & event);
+
+ /** Handler for Edit / Add point.
+ @param event Event to process.
+ */
+ void
+ OnEditPointAdd(wxCommandEvent & event);
+
+ /** Handler for Edit / Delete point.
+ @param event Event to process.
+ */
+ void
+ OnEditPointDelete(wxCommandEvent & event);
+
+ /** Handler for Edit / Details.
+ @param event Event to process.
+ */
+ void
+ OnEditDetails(wxCommandEvent & event);
+
+ /** Handler for Edit / Group.
+ @param event Event to process.
+ */
+ void
+ OnEditGroup(wxCommandEvent & event);
+
+ /** Handler for Edit / Group.
+ @param event Event to process.
+ */
+ void
+ OnEditGroup3(wxCommandEvent & event);
+
+ /** Handler for Edit / Ungroup.
+ @param event Event to process.
+ */
+ void
+ OnEditUngroup(wxCommandEvent & event);
+
+ /** Handler for Edit / Flip horizontally.
+ @param event Event to process.
+ */
+ void
+ OnEditFlipH(wxCommandEvent & event);
+
+ /** Handler for Edit / Flip vertically.
+ @param event Event to process.
+ */
+ void
+ OnEditFlipV(wxCommandEvent & event);
+
+ /** Handler for Rotate left.
+ @param event Event to process.
+ */
+ void
+ OnEditRotateLeft(wxCommandEvent & event);
+
+ /** Handler for Rotate right.
+ @param event Event to process.
+ */
+ void
+ OnEditRotateRight(wxCommandEvent & event);
+
+ /** Handler for Edit / Change drawing size.
+ @param event Event to process.
+ */
+ void
+ OnEditChangeSize(wxCommandEvent & event);
+
+ /** Handler for View / Layers / Activate all.
+ @param event Event to process.
+ */
+ void
+ OnLayersAll(wxCommandEvent & event);
+
+ /** Handler for View / Layers / Layer manager.
+ @param event Event to process.
+ */
+ void
+ OnLayerManager(wxCommandEvent & event);
+
+ /** Center view.
+ */
+ void
+ OnCenterViewFunction(void);
+
+ /** Handler for View / center view.
+ @param event Event to process.
+ */
+ void
+ OnCenterView(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert1(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert2(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert3(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert4(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert5(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert6(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert7(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert8(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert9(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvertA(wxCommandEvent & event);
+
+ /** Handler for options reset.
+ @param event Event to process.
+ */
+ void
+ OnResetOptions(wxCommandEvent & event);
+
+ /** Handler for "modify spline s value" button or menu item.
+ */
+ void
+ OnModifySplineValue(wxCommandEvent & event);
+
+ /** Handler for "defaults for new objects" menu item.
+ @param event Event to process.
+ */
+ void
+ OnOptionsNewObjects(wxCommandEvent & event);
+
+ /** Handler for "screen representation options" menu item.
+ @param event Event to process.
+ */
+ void
+ OnOptionsScreenRepresentation(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourBorderModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourBorderReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourBackgroundModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourBackgroundReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourGridModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourGridReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourPlacementModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourPlacementReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourCopyModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourCopyReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourMoveModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourMoveReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourDeleteModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourDeleteReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourGroupModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourGroupReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourMissingModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourMissingReset(wxCommandEvent & event);
+
+ /** Handler for Grid on/off.
+ @param event Event to process.
+ */
+ void
+ OnGridOnOff(wxCommandEvent & event);
+
+ /** Handler for Grid unit.
+ @param event Event to process.
+ */
+ void
+ OnGridUnit(wxCommandEvent & event);
+
+ /** Handler for Grid base.
+ @param event Event to process.
+ */
+ void
+ OnGridBase(wxCommandEvent & event);
+
+ /** Handler for placement help checkbox.
+ @param event Event to process.
+ */
+ void
+ OnPlacementHelp(wxCommandEvent & event);
+
+ /** Handler for layer change.
+ @param event Event to process.
+ */
+ void
+ OnStyleLayer(wxSpinEvent & event);
+
+ /** Handler for line colour change.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineColour(wxCommandEvent & event);
+
+ /** Handler for line width change.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineWidth(wxSpinEvent & event);
+
+ /** Handler for line style button.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineStyle(wxCommandEvent & event);
+
+ /** Handler for line cap.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineCap(wxCommandEvent & event);
+
+ /** Handler for line width change.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineJoin(wxCommandEvent & event);
+
+ /** Handler for arrowhead forward button.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineArrowF(wxCommandEvent & event);
+
+ /** Handler for arrowhead backward button.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineArrowB(wxCommandEvent & event);
+
+ /** Handler for line width change.
+ @param event Event to process.
+ */
+ void
+ OnStyleFillColour(wxCommandEvent & event);
+
+ /** Handler for fill pattern change.
+ @param event Event to process.
+ */
+ void
+ OnStyleFillPattern(wxCommandEvent & event);
+
+ /** Handler for line width change.
+ @param event Event to process.
+ */
+ void
+ OnStyleTextLatex(wxCommandEvent & event);
+
+ /** Handler for text align change.
+ @param event Event to process.
+ */
+ void
+ OnStyleTextAlign(wxCommandEvent & event);
+
+ /** Handler for text font change.
+ @param event Event to process.
+ */
+ void
+ OnStyleTextFont(wxCommandEvent & event);
+
+ /** Handler for text size change.
+ @param event Event to process.
+ */
+ void
+ OnStyleTextSize(wxSpinEvent & event);
+
+ /** Handler for rotation spin control.
+ @param event Event to process.
+ */
+ void
+ OnSpinRotation(wxSpinEvent & event);
+
+ /** Horizontal scrollbar handler.
+ @param event Event to process.
+ */
+ void
+ OnScrollH(wxScrollEvent & event);
+
+ /** Vertical scrollbar handler.
+ @param event Event to process.
+ */
+ void
+ OnScrollV(wxScrollEvent & event);
+
+ /** Require a redraw.
+ Only to be executed between BeginEventHandling()
+ and EndEventHandling().
+ @param level Redraw level to require.
+ */
+ void
+ RequireRedraw(int level);
+
+ /** Update text if new font was choosen.
+ @param pobj Modified text object.
+ @param bRedraw Schedule redraw.
+ */
+ void
+ UpdateTextForFont(Wxd_object_t *pobj, bool bRedraw = true);
+
+ /** Set text for mouse messages when entering a new state.
+ @param st New state to enter.
+ */
+ void
+ SetMouseAndStatusTexts(int st);
+
+ /* __CHANGE__ 014: Add further methods.
+ */
+
+ /** Attempt to update all fonts.
+ */
+ void
+ UpdateFonts(void);
+
+ protected:
+
+ /* frame protected methods */
+
+ /** Transfer style information from object to GUI elements.
+ @param refresh Flag: Refresh GUI elements explicitly.
+ */
+ void
+ StyleToGUI(bool refresh = true);
+
+ /** Set style object (object to modify using the style GUI elements).
+ @param pObj Object to modify.
+ */
+ void
+ SetStyleObject(Wxd_object_t *pObj = NULL, bool bUpdate = true);
+
+ /** Check whether the frame is up and initialized to handle events.
+ On success, initialize things to handle one event.
+ @return True to start event handling, false to skip.
+ */
+ bool
+ BeginEventHandling(void);
+
+ /** Start handling of events from control.
+ */
+ void
+ StartEventHandling(void);
+
+ /** Report modifications while reading a file at the end
+ of event processing.
+ */
+ void
+ ModificationReportingAtEventEnd(void);
+
+ /** Do error reporting at end of event handling.
+ */
+ void
+ ErrorReportingAtEventEnd(void);
+
+ /** End handling one event. If necessary call Update() on the frame.
+ */
+ void
+ EndEventHandling(void);
+
+ /** Update one stipple structure.
+ @param psti Stipple structure to update.
+ */
+ void
+ UpdateOneStipple(Wxd_stipple_t *psti);
+
+ /** Update internal pattern coefficients in m_dPatterns.
+ Recalculation necessary after changing zoom factor and/or
+ loading a new file.
+ */
+ void
+ UpdatePatternCoefficients(void);
+
+ /** Update stipple bitmaps after changing zoom or loading
+ a file.
+ */
+ void
+ UpdateStipples(void);
+
+ /** Attempt to read all images not yet read.
+ */
+ void
+ UpdateImages(void);
+
+ /** Update one font.
+ @param pfont Font to update.
+ */
+ void
+ UpdateOneFont(Wxd_font_t *pfont);
+
+ /** Find font structure, create new one if necessary.
+ @param find Font index.
+ @param fsz Font size in pt.
+ @return Valid pointer to font structure on success, NULL on error.
+ */
+ Wxd_font_t *
+ FindFont(uint8_t find, uint16_t fsz);
+
+ /** Read a drawing from file.
+ @param fn File name to read.
+ @return Pointer to new drawing on success, NULL on error.
+ */
+ Wxd_drawing_t *
+ ReadDrawingFromFile(wxString & fn);
+
+ /** A new drawing was loaded, adjust GUI.
+ */
+ void
+ DrawingLoaded(void);
+
+ /** Find suitable size for colour viewers, derived from
+ the height of the layer number spin control.
+ @return Size suggestion for colour viewer.
+ */
+ wxSize
+ ColourViewSize(void);
+
+ /** Complete setup on first idle event.
+ Using the first idle event ensures the window is already
+ shown on screen.
+ */
+ void
+ OnFirstIdle(void);
+
+ /** Copy default style values to m_iv array.
+ */
+ void
+ DefaultStyleToArray(void);
+
+ /** Get default style values from m_iv array.
+ */
+ void
+ DefaultStyleFromArray(void);
+
+ /** Load defaults.
+ */
+ void
+ LoadDefaults(void);
+
+ /** Load configuration.
+ */
+ void
+ LoadConfiguration(void);
+
+ /** Save configuration.
+ */
+ void
+ SaveConfiguration(void);
+
+ /** Reset configuration settings to default values.
+ */
+ void
+ ResetConfiguration(void);
+
+ /** Update the position labels.
+ @param havepos Flag: Position is known.
+ @param x X position if position is known.
+ @param y Y position if position is known.
+ */
+ void
+ UpdatePositionLabels(bool havepos, int32_t x, int32_t y);
+
+ /** Calculate drawing and grid position from mouse position.
+ @return True if position was changed, false if no change.
+ */
+ bool
+ UpdateGridPosition(void);
+
+ /** Retrieve mouse position, calculate drawing and grid position.
+ @param event Event to process.
+ @return True if position was changed, false if everything
+ unchanged.
+ */
+ bool
+ UpdateMousePosition(wxMouseEvent & event);
+
+ /** Move scrollbar position as action on mouse wheel.
+ @param sb Scrollbar to modify.
+ @param lines Number of lines to move.
+ @param vert Flag: Moving the vertical bar.
+ */
+ void
+ MoveScrollbar(wxScrollBar *sb, int lines, bool vert);
+
+ /** Check whether an object is selectable in the current state.
+ @param pobj Object to check.
+ @return True if object is selectable, false otherwise.
+ */
+ bool
+ ObjectSelectableInState(Wxd_object_t const *pobj);
+
+ /** Find object nearest to raw mouse coordinates (not grid-aligned).
+ @param gr Return group object instead of simple object.
+ @return Object if found or NULL.
+ */
+ Wxd_object_t *
+ FindNearestObject(bool gr = false);
+
+ /** End polyline drawing operation while waiting for first point.
+ @param bComplete End completely.
+ @param bSkip Skip data entered so far in operation.
+ */
+ void
+ EndOperationPolyFirst(void);
+
+ /** End polyline drawing operation if points exist.
+ @param bComplete End completely.
+ @param bSkip Skip data entered so far in operation.
+ */
+ void
+ EndOperationPolyFurther(bool bComplete, bool bSkip);
+
+ /** End spline drawing operation while waiting for first point.
+ */
+ void
+ EndOperationSplineFirst(void);
+
+ /** End spline drawing operation if points exist.
+ @param bComplete End completely.
+ @param bSkip Skip data entered so far in operation.
+ */
+ void
+ EndOperationSplineFurther(bool bComplete, bool bSkip);
+
+ /** End 2-point operation while waiting for second point.
+ @param ns Next state.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationTwoPointsSecond(int ns, bool bComplete);
+
+ /** End box drawing while waiting for first point.
+ */
+ void
+ EndOperationBoxFirst(void);
+
+ /** End box drawing while waiting for opposite point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationBoxOpposite(bool bComplete);
+
+ /** End circle drawing while waiting for center point.
+ */
+ void
+ EndOperationCircleCenter(void);
+
+ /** End circle drawing while waiting for radius point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationCircleRadius(bool bComplete);
+
+ /** End ellipse drawing while waiting for center point.
+ */
+ void
+ EndOperationEllipseCenter(void);
+
+ /** End ellipse drawing while waiting for bounding box corner point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationEllipseCorner(bool bComplete);
+
+ /** End arc drawing while waiting for start point.
+ */
+ void
+ EndOperationArc1(void);
+
+ /** End arc drawing while waiting for intermediate point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationArc2(bool bComplete);
+
+ /** End arc drawing while waiting for end point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationArc3(bool bComplete);
+
+ /** End dot drawing while waiting for point.
+ */
+ void
+ EndOperationDot(void);
+
+ /** End library element placement operation while waiting for point.
+ */
+ void
+ EndOperationLibelemPlace(void);
+
+ /** End point move operation while placing point.
+ */
+ void
+ EndOperationPointMovePlace(void);
+
+ /** End point add operation while placing point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationPointAddPlace(bool bComplete);
+
+ /** End point add operation while placing drawing corner point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationDrawingSizePlace(bool bComplete);
+
+ /** End recent operation.
+ @param bComplete End completely.
+ @param bSkip Skip data entered so far in operation.
+ */
+ void
+ EndOperation(bool bComplete = false, bool bSkip = false);
+
+ /** Move marker 2 marked objects into new group.
+ */
+ void
+ GroupNewForMarkedObjects(void);
+
+ /** Ungroup objects from group (resolve group).
+ @param pgrp Group to resolve.
+ */
+ void
+ UngroupObjects(Wxd_object_t *pgrp);
+
+ /** Check whether the current point is an acceptable point.
+ @return Test result.
+ */
+ bool
+ IsAcceptablePoint(void);
+
+ /** Reaction on mouse move in S_NOOP state.
+ */
+ void
+ MouseMoveNoop(void);
+
+ /** Reaction on mouse move in S_DELETE state.
+ */
+ void
+ MouseMoveDelete(void);
+
+ /** Reaction on mouse move in S_REGION_DELETE state.
+ */
+ void
+ MouseMoveRegionDelete(void);
+
+ /** Reaction on mouse move while selecting objects to move.
+ */
+ void
+ MouseMoveMoveSelect(void);
+
+ /** Reaction on mouse move while placing objects to move.
+ */
+ void
+ MouseMoveMovePlace(void);
+
+ /** Reaction on mouse move while selecting objects to copy.
+ */
+ void
+ MouseMoveCopySelect(void);
+
+ /** Reaction on mouse move while placing objects to copy.
+ */
+ void
+ MouseMoveCopyPlace(void);
+
+ /** Reaction on middle mouse key.
+ */
+ void
+ MouseMiddleDelete(void);
+
+ /** Reaction on left mouse click in S_NOOP state.
+ */
+ void
+ MouseLeftNoop(void);
+
+ /** Reaction on left mouse click in S_DELETE state.
+ */
+ void
+ MouseLeftDelete(void);
+
+ /** Reaction on left mouse click in S_REGION_DELETE state.
+ */
+ void
+ MouseLeftRegionDelete(void);
+
+ /** Reaction on left mouse click while selecting objects to move.
+ */
+ void
+ MouseLeftMoveSelect(void);
+
+ /** Reaction on left mouse click while placing objects to move.
+ */
+ void
+ MouseLeftMovePlace(void);
+
+ /** Reaction on left mouse click while selecting objects to copy.
+ */
+ void
+ MouseLeftCopySelect(void);
+
+ /** Reaction on left mouse click while placing objects to copy.
+ */
+ void
+ MouseLeftCopyPlace(void);
+
+ /** Reaction on mouse move in S_POLY_FIRST state.
+ */
+ void
+ MouseMovePolyFirst(void);
+
+ /** Reaction on mouse move in S_POLY_FURTHER state.
+ */
+ void
+ MouseMovePolyFurther(void);
+
+ /** Reaction on mouse left click in S_POLY_FIRST state.
+ */
+ void
+ MouseLeftPolyFirst(void);
+
+ /** Reaction on mouse left click in S_POLY_FURTHER state.
+ */
+ void
+ MouseLeftPolyFurther(void);
+
+ /** X-spline s value at end points.
+ @return S value.
+ */
+ double
+ SValueAtEnd(void);
+
+ /** Reaction on mouse movement in S_SPLINE_FIRST state.
+ */
+ void
+ MouseMoveSplineFirst(void);
+
+ /** Reaction on mouse movement in S_SPLINE_FURTHER state.
+ */
+ void
+ MouseMoveSplineFurther(void);
+
+ /** Reaction on mouse left click in S_SPLINE_FIRST state.
+ */
+ void
+ MouseLeftSplineFirst(void);
+
+ /** Reaction on mouse left click in S_SPLINE_FURTHER state.
+ */
+ void
+ MouseLeftSplineFurther(void);
+
+ /** Reaction on mouse move in S_ELLIPSE_CENTER state.
+ */
+ void
+ MouseMoveEllipseCenter(void);
+
+ /** Reaction on mouse left click in S_ELLIPSE_CENTER state.
+ */
+ void
+ MouseLeftEllipseCenter(void);
+
+ /** Reaction on mouse move in S_ELLIPSE_CORNER state.
+ */
+ void
+ MouseMoveEllipseCorner(void);
+
+ /** Reaction on mouse left click in S_ELLIPSE_CORNER state.
+ */
+ void
+ MouseLeftEllipseCorner(void);
+
+ /** Reaction on mouse move in S_ARC_1 state.
+ */
+ void
+ MouseMoveArc1(void);
+
+ /** Reaction on mouse left click in S_ARC_1 state.
+ */
+ void
+ MouseLeftArc1(void);
+
+ /** Reaction on mouse move in S_ARC_2 state.
+ */
+ void
+ MouseMoveArc2(void);
+
+ /** Reaction on mouse left click in S_ARC_2 state.
+ */
+ void
+ MouseLeftArc2(void);
+
+ /** Reaction on mouse move in S_ARC_3 state.
+ */
+ void
+ MouseMoveArc3(void);
+
+ /** Reaction on mouse left click in S_ARC_3 state.
+ */
+ void
+ MouseLeftArc3(void);
+
+ /** Set box details (bounding box from start point and current point).
+ The radius should be updated only while constructing a box,
+ not while moving a point.
+ @param bUpdateRadius Update radius.
+ */
+ void
+ SetBoxDetails(bool bUpdateRadius);
+
+ /** Reaction on mouse move in S_BOX_FIRST state.
+ */
+ void
+ MouseMoveBoxFirst(void);
+
+ /** Reaction on mouse move in S_BOX_OPPOSITE state.
+ */
+ void
+ MouseMoveBoxOpposite(void);
+
+ /** Reaction on mouse left click in S_BOX_FIRST state.
+ */
+ void
+ MouseLeftBoxFirst(void);
+
+ /** Reaction on mouse left click in S_BOX_OPPOSITE state.
+ */
+ void
+ MouseLeftBoxOpposite(void);
+
+ /** Reaction on mouse move in S_CIRCLE_CENTER state.
+ */
+ void
+ MouseMoveCircleCenter(void);
+
+ /** Calculate circle radius from center point to current point.
+ */
+ void
+ CalculateCircleRadius(uint32_t & rx, dk4_er_t *erp);
+
+ /** Calculate ellipse radii from center point to current point.
+ */
+ void
+ CalculateEllipseRadii(uint32_t & rx, uint32_t & ry, dk4_er_t *erp);
+
+ /** Reaction on mouse move in S_CIRCLE_RADIUS state.
+ */
+ void
+ MouseMoveCircleRadius(void);
+
+ /** Reaction on mouse left click in S_CIRCLE_CENTER state.
+ */
+ void
+ MouseLeftCircleCenter(void);
+
+ /** Reaction on mouse left click in S_CIRCLE_RADIUS state.
+ */
+ void
+ MouseLeftCircleRadius(void);
+
+ /** Reaction on mouse move in S_DOT state.
+ */
+ void
+ MouseMoveDot(void);
+
+ /** Reaction on mouse left click in S_DOT state.
+ */
+ void
+ MouseLeftDot(void);
+
+ /** Reaction on mouse move in S_TEXT state.
+ */
+ void
+ MouseMoveText(void);
+
+ /** Reaction on mouse left click in S_TEXT state.
+ */
+ void
+ MouseLeftText(void);
+
+ /** Reaction on mouse move in S_IMG_1 state.
+ */
+ void
+ MouseMoveImage1(void);
+
+ /** Reaction on mouse move in S_IMG_2 state.
+ */
+ void
+ MouseMoveImage2(void);
+
+ /** Reaction on mouse left click in S_IMG_1 state.
+ */
+ void
+ MouseLeftImage1(void);
+
+ /** Reaction on mouse left click in S_IMG_2 state.
+ */
+ void
+ MouseLeftImage2(void);
+
+ /** Reaction on mouse move in S_LIBELEM_PLACE state.
+ */
+ void
+ MouseMoveLibelemPlace(void);
+
+ /** Reaction on mouse left click in S_LIBELEM_PLACE state.
+ */
+ void
+ MouseLeftLibelemPlace(void);
+
+ /** Reaction on mouse move in S_MOVEPT_SELECT state.
+ */
+ void
+ MouseMovePointMoveSelect(void);
+
+ /** Reaction on mouse left click in S_MOVEPT_SELECT state.
+ */
+ void
+ MouseLeftPointMoveSelect(void);
+
+ /** Reaction on mouse move in S_MOVEPT_PLACE state.
+ */
+ void
+ MouseMovePointMovePlace(void);
+
+ /** Modify spline s value after moving a spline point.
+ @param pCurrent Spline object to modify.
+ @param uCurrent Index of point to modify.
+ */
+ void
+ ModifySplineValue(Wxd_object_t *pCurrent, uint16_t uCurrent);
+
+ /** Reaction on mouse left click in S_MOVEPT_PLACE state.
+ */
+ void
+ MouseLeftPointMovePlace(void);
+
+ /** Reaction on mouse move in S_DELPT state.
+ */
+ void
+ MouseMovePointDelete(void);
+
+ /** Reaction on mouse left click in S_DELPT state.
+ */
+ void
+ MouseLeftPointDelete(void);
+
+ /** Reaction on mouse move in S_ADDPT_SELECT state.
+ */
+ void
+ MouseMovePointAddSelect(void);
+
+ /** Reaction on mouse left click in S_ADDPT_SELECT state.
+ */
+ void
+ MouseLeftPointAddSelect(void);
+
+ /** Reaction on mouse move in S_ADDPT_PLACE state.
+ */
+ void
+ MouseMovePointAddPlace(void);
+
+ /** Reaction on mouse move in S_DRWSZ_SELECT state.
+ */
+ void
+ MouseMoveDrawingSizeSelect(void);
+
+ /** Reaction on mouse move in S_DRWSZ_PLACE state.
+ */
+ void
+ MouseMoveDrawingSizePlace(void);
+
+ /** Reaction on mouse left click in S_ADDPT_PLACE state.
+ */
+ void
+ MouseLeftPointAddPlace(void);
+
+ /** Reaction on mouse left click in S_DRWSZ_SELECT state.
+ */
+ void
+ MouseLeftDrawingSizeSelect(void);
+
+ /** Reaction on mouse left click in S_DRWSZ_PLACE state.
+ */
+ void
+ MouseLeftDrawingSizePlace(void);
+
+ /** Reaction on mouse movement click in S_FLIP state.
+ */
+ void
+ MouseMoveFlip(void);
+
+ /** Reaction on mouse left click in S_FLIP state.
+ */
+ void
+ MouseLeftFlip(void);
+
+ /** Reaction on mouse movement in S_GROUP_ONE state.
+ */
+ void
+ MouseMoveGroupOne(void);
+
+ /** Reaction on mouse left click in S_GROUP_ONE state.
+ */
+ void
+ MouseLeftGroupOne(void);
+
+ /** Mark objects in the selected rectangle for grouping.
+ */
+ void
+ MarkObjectsForRectangleGrouping(void);
+
+ /** Mark objects in the selected rectangle for deletion.
+ */
+ void
+ MarkObjectsForRectangleDeletion(void);
+
+ /** Reaction on mouse movement in S_GROUP_RECT_1 state.
+ */
+ void
+ MouseMoveGroupRect1(void);
+
+ /** Reaction on mouse left click in S_GROUP_RECT_1 state.
+ */
+ void
+ MouseLeftGroupRect1(void);
+
+ /** Reaction on mouse movement in S_GROUP_RECT_2 state.
+ */
+ void
+ MouseMoveGroupRect2(void);
+
+ /** Reaction on mouse left click in S_GROUP_RECT_2 state.
+ */
+ void
+ MouseLeftGroupRect2(void);
+
+ /** Reaction on mouse movement in S_UNGROUP state.
+ */
+ void
+ MouseMoveUngroup(void);
+
+ /** Reaction on mouse left click in S_UNGROUP state.
+ */
+ void
+ MouseLeftUngroup(void);
+
+ /** Reaction on mouse movement in S_DETAILS state.
+ */
+ void
+ MouseMoveDetails(void);
+
+ /** Reaction on mouse left click in S_DETAILS state.
+ */
+ void
+ MouseLeftDetails(void);
+
+ /** Object type conversion: spline to polyline or polygon.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertSplineToPoly(Wxd_object_t *pobj);
+
+ /** Object type conversion: arc to polyline or polygon.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertArcToPoly(Wxd_object_t *pobj);
+
+ /** Object type conversion: box to polyline or polygon.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertBoxToPoly(Wxd_object_t *pobj);
+
+ /** Object type conversion: polyline or polygon to spline.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertPolyToSpline(Wxd_object_t *pobj);
+
+ /** Object type conversion: spline to spline.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertSplineToSpline(Wxd_object_t *pobj);
+
+ /** Object type conversion: arc to spline.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertArcToSpline(Wxd_object_t *pobj);
+
+ /** Object type conversion: box to spline.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertBoxToSpline(Wxd_object_t *pobj);
+
+ /** Object type conversion: polyline or polygon to arc.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertPolyToArc(Wxd_object_t *pobj);
+
+ /** Object type conversion: spline to arc.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertSplineToArc(Wxd_object_t *pobj);
+
+ /** Object type conversion: circle to dot.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertCircleToDot(Wxd_object_t *pobj);
+
+ /** Convert object to specified type.
+ */
+ void
+ ObjectTypeConversion(Wxd_object_t *pobj);
+
+ /** Reaction on mouse move in S_CONVERT state.
+ */
+ void
+ MouseMoveConvert(void);
+
+ /** Reaction on left mouse button in S_CONVERT state.
+ */
+ void
+ MouseLeftConvert(void);
+
+ /** Reaction on mouse move in S_ROTATE state.
+ */
+ void
+ MouseMoveRotate(void);
+
+ /** Reaction on left mouse button in S_ROTATE state.
+ */
+ void
+ MouseLeftRotate(void);
+
+ /** Reaction on mouse move in S_MOD_SPLINE state.
+ */
+ void
+ MouseMoveModspline(void);
+
+ /** Reaction on left mouse button in S_MOD_SPLINE state.
+ */
+ void
+ MouseLeftModspline(void);
+
+ /** Retrieve input from one text control, set pointer to
+ a dynamic copy of the input text.
+ @param ptxt Address of pointer to modify.
+ @param ptc Text control containing users input.
+ @param bKeepOld Keep old text if new text is empty.
+ */
+ void
+ ChangeOneLabelText(
+ wxChar **ptxt,
+ wxTextCtrl *ptc,
+ bool bKeepOld = true
+ );
+
+ /** Retrieve the input from text controls for export text and
+ screen text, save text to m_pCurrent.
+ @param ptce Text control for export text.
+ @param ptcs Text control for screen text.
+ @param bLaTeX LaTeX or non-LaTeX text.
+ */
+ void
+ RetrieveTextDetails(
+ wxTextCtrl *ptce,
+ wxTextCtrl *ptcs,
+ bool bLaTeX
+ );
+
+ /** Modify text label details (texts).
+ */
+ void
+ ModifyDetailsText(void);
+
+ /** Modify box details (corner radius).
+ */
+ void
+ ModifyDetailsBox(void);
+
+ /** Change image file for image object.
+ @param pa New file name to use.
+ */
+ void
+ ChangeImageFile(wxString & pa);
+
+ /** Modify image details (image file name and flags).
+ */
+ void
+ ModifyDetailsImage(void);
+
+ /** Modify filled dot details (diameter).
+ */
+ void
+ ModifyDetailsDotFilled(void);
+
+ /** Modify white dot details (diameter and line width).
+ */
+ void
+ ModifyDetailsDotWhite(void);
+
+ /** Handler for mouse entering control area.
+ @param event Event to process.
+ */
+ void
+ ControlMouseEnter(wxMouseEvent & event);
+
+ /** Handler for mouse leaving the control area.
+ @param event Event to process.
+ */
+ void
+ ControlMouseLeave(wxMouseEvent & event);
+
+ /** Handler for mouse move.
+ @param event Event to process.
+ */
+ void
+ ControlMouseMove(wxMouseEvent & event);
+
+ /** Handler for left mouse button click.
+ @param event Event to process.
+ */
+ void
+ ControlLeftMouseButton(wxMouseEvent & event);
+
+ /** Handler for right mouse button click.
+ @param event Event to process.
+ */
+ void
+ ControlRightMouseButton(wxMouseEvent & event);
+
+ /** Handler for middle mouse button click.
+ @param event Event to process.
+ */
+ void
+ ControlMiddleMouseButton(wxMouseEvent & event);
+
+ /** Handler for mouse wheell move.
+ @param event Event to process.
+ */
+ void
+ ControlMouseWheel(wxMouseEvent & event);
+
+ /** Use values from horizontal scrollbar.
+ */
+ void
+ UseScrollH(void);
+
+ /** Use values from vertical scrollbar.
+ */
+ void
+ UseScrollV(void);
+
+ /** Find directory where current file is saved.
+ @param dnb Buffer for directory.
+ @param dnsz Size of dnb (number of wxChar).
+ @param fn File name to find directory for.
+ @return True on success, false on error.
+ */
+ bool
+ FindDirectoryForFile(wxChar *dnb, size_t dnsz, wxString & fn);
+
+ /** Modify a colour.
+ @param ivi Index of color start in m_iv array.
+ @param rdl Redraw level required by operation.
+ */
+ void
+ ColorModify(size_t ivi, int rdl);
+
+ /** Modify a colour.
+ @param ivi Index of color start in m_iv array.
+ @param rdl Redraw level required by operation.
+ */
+ void
+ ColorReset(size_t ivi, int rdl);
+};
+
+
+#line 4371 "WxdkdrawFrame.wxc"
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/WxdkdrawFrame.wxc b/support/dktools/WxdkdrawFrame.wxc
new file mode 100644
index 0000000000..6a606adf59
--- /dev/null
+++ b/support/dktools/WxdkdrawFrame.wxc
@@ -0,0 +1,4858 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% wx-gui
+
+type = frame
+contents = mainSizer
+icon = wxdkdraw_icon
+status bar = 1 sTexts[8]
+menu bar = mbMain
+
+[wxMenuBar mbMain]
+contents = menuFile
+contents = menuAdd
+contents = menuEdit
+contents = menuView
+contents = menuOptions
+contents = menuHelp
+
+[wxMenu menuFile]
+text = sTexts[0]
+contents = miFileNew
+contents = miFileOpen
+contents = miFileSave
+contents = miFileSaveAs
+contents = miFileExit
+
+[wxMenuItem miFileNew]
+text = sTexts[20]
+tip = sTexts[21]
+id = wxID_NEW
+
+[wxMenuItem miFileOpen]
+text = sTexts[22]
+tip = sTexts[23]
+id = wxID_OPEN
+
+[wxMenuItem miFileSave]
+text = sTexts[24]
+tip = sTexts[25]
+id = wxID_SAVE
+
+[wxMenuItem miFileSaveAs]
+text = sTexts[26]
+tip = sTexts[27]
+id = wxID_SAVEAS
+
+[wxMenuItem miFileExit]
+id = wxID_EXIT
+text = sTexts[1]
+tip = sTexts[2]
+
+[wxMenu menuAdd]
+text = sTexts[28]
+contents = miAddPolyline
+contents = miAddPolygon
+contents = miAddRectangle
+contents = miAddRoundedBox
+contents = miAddCircle
+contents = miAddEllipse
+contents = miAddArcOpen
+contents = miAddArcClosed
+contents = miAddSplineAO
+contents = miAddSplineAC
+contents = miAddSplineIO
+contents = miAddSplineIC
+contents = miAddConnector
+contents = miAddPin
+contents = miAddText
+contents = miAddImage
+contents = miAddLibelem
+
+
+[wxMenuItem miAddPolyline]
+text = sTexts[29]
+tip = sTexts[30]
+id = ID_ADD_POLYINE
+
+[wxMenuItem miAddPolygon]
+text = sTexts[31]
+tip = sTexts[32]
+id = ID_ADD_POLYGON
+
+[wxMenuItem miAddRectangle]
+text = sTexts[33]
+tip = sTexts[34]
+id = ID_ADD_RECT
+
+[wxMenuItem miAddRoundedBox]
+text = sTexts[35]
+tip = sTexts[36]
+id = ID_ADD_BOX
+
+[wxMenuItem miAddCircle]
+text = sTexts[37]
+tip = sTexts[38]
+id = ID_ADD_CIRCLE
+
+[wxMenuItem miAddEllipse]
+text = sTexts[39]
+tip = sTexts[40]
+id = ID_ADD_ELLIPSE
+
+[wxMenuItem miAddArcOpen]
+text = sTexts[643]
+tip = sTexts[644]
+id = ID_ADD_ARC_O
+
+[wxMenuItem miAddArcClosed]
+text = sTexts[645]
+tip = sTexts[646]
+id = ID_ADD_ARC_C
+
+[wxMenuItem miAddSplineAO]
+text = sTexts[41]
+tip = sTexts[42]
+id = ID_ADD_SPL_AO
+
+[wxMenuItem miAddSplineAC]
+text = sTexts[43]
+tip = sTexts[44]
+id = ID_ADD_SPL_AC
+
+[wxMenuItem miAddSplineIO]
+text = sTexts[45]
+tip = sTexts[46]
+id = ID_ADD_SPL_IO
+
+[wxMenuItem miAddSplineIC]
+text = sTexts[47]
+tip = sTexts[48]
+id = ID_ADD_SPL_IC
+
+[wxMenuItem miAddConnector]
+text = sTexts[49]
+tip = sTexts[50]
+id = ID_ADD_DOT_C
+
+[wxMenuItem miAddPin]
+text = sTexts[51]
+tip = sTexts[52]
+id = ID_ADD_DOT_W
+
+[wxMenuItem miAddText]
+text = sTexts[53]
+tip = sTexts[54]
+id = ID_ADD_TEXT
+
+[wxMenuItem miAddImage]
+text = sTexts[55]
+tip = sTexts[56]
+id = ID_ADD_IMG
+
+[wxMenuItem miAddLibelem]
+text = sTexts[57]
+tip = sTexts[58]
+id = ID_ADD_LIBELEM
+
+[wxMenu menuEdit]
+text = sTexts[59]
+contents = miEditCopy
+contents = miEditMove
+contents = miEditDelete
+contents = miEditPointAdd
+contents = miEditPointRemove
+contents = miEditPointMove
+contents = miEditModifySpline
+contents = miEditFlipH
+contents = miEditFlipV
+contents = miEditRotLeft
+contents = miEditRotRight
+contents = miEditDetails
+contents = mEditGroup
+contents = miEditUngroup
+contents = miEditChangeSize
+contents = mEditConvert
+
+
+[wxMenuItem miEditCopy]
+text = sTexts[60]
+tip = sTexts[61]
+id = ID_EDIT_COPY
+
+[wxMenuItem miEditMove]
+text = sTexts[62]
+tip = sTexts[63]
+id = ID_EDIT_MOVE
+
+[wxMenuItem miEditDelete]
+text = sTexts[64]
+tip = sTexts[65]
+id = ID_EDIT_DEL
+
+[wxMenuItem miEditPointMove]
+text = sTexts[66]
+tip = sTexts[67]
+id = ID_EDIT_PT_MOVE
+
+[wxMenuItem miEditModifySpline]
+text = sTexts[620]
+tip = sTexts[621]
+id = ID_MOD_SPLINE
+
+[wxMenuItem miEditPointAdd]
+text = sTexts[68]
+tip = sTexts[69]
+id = ID_EDIT_PT_ADD
+
+[wxMenuItem miEditPointRemove]
+text = sTexts[70]
+tip = sTexts[71]
+id = ID_EDIT_PT_DEL
+
+[wxMenuItem miEditDetails]
+text = sTexts[72]
+tip = sTexts[73]
+id = ID_EDIT_DET
+
+[wxMenu mEditGroup]
+text = sTexts[74]
+contents = miEditGroupElements
+# contents = miEditGroupTouching
+contents = miEditGroupIncluding
+
+[wxMenuItem miEditGroupElements]
+text = sTexts[165]
+tip = sTexts[106]
+id = ID_EDIT_GRP1
+
+[wxMenuItem miEditGroupIncluding]
+text = sTexts[167]
+tip = sTexts[164]
+id = ID_EDIT_GRP13
+
+
+[wxMenuItem miEditUngroup]
+text = sTexts[76]
+tip = sTexts[77]
+id = ID_EDIT_UNGRP
+
+[wxMenuItem miEditFlipH]
+text = sTexts[78]
+tip = sTexts[79]
+id = ID_EDIT_FLIPH
+
+[wxMenuItem miEditFlipV]
+text = sTexts[80]
+tip = sTexts[81]
+id = ID_EDIT_FLIPV
+
+[wxMenuItem miEditRotLeft]
+text = sTexts[566]
+tip = sTexts[567]
+id = ID_EDIT_ROTLEFT
+
+[wxMenuItem miEditRotRight]
+text = sTexts[568]
+tip = sTexts[569]
+id = ID_EDIT_ROTRIGHT
+
+
+[wxMenuItem miEditChangeSize]
+text = sTexts[82]
+tip = sTexts[83]
+id = ID_EDIT_DRSZ
+
+[wxMenu mEditConvert]
+text = sTexts[535]
+contents = miPolygonToPolyline
+contents = miPolylineToPolygon
+contents = miClosedToOpenArc
+contents = miOpenToClosedArc
+contents = miClosedToOpenSpline
+contents = miOpenToClosedSpline
+contents = miClosedToOpenIntSpline
+contents = miOpenToClosedIntSpline
+contents = miWhiteFilledToDot
+contents = miDotToWhiteFilled
+
+[wxMenuItem miPolylineToPolygon]
+text = sTexts[536]
+tip = sTexts[545]
+id = ID_EDIT_CONVERT_1
+
+[wxMenuItem miPolygonToPolyline]
+text = sTexts[537]
+tip = sTexts[546]
+id = ID_EDIT_CONVERT_2
+
+[wxMenuItem miOpenToClosedArc]
+text = sTexts[539]
+tip = sTexts[548]
+id = ID_EDIT_CONVERT_4
+
+[wxMenuItem miClosedToOpenArc]
+text = sTexts[540]
+tip = sTexts[549]
+id = ID_EDIT_CONVERT_5
+
+[wxMenuItem miOpenToClosedSpline]
+text = sTexts[541]
+tip = sTexts[550]
+id = ID_EDIT_CONVERT_6
+
+[wxMenuItem miClosedToOpenSpline]
+text = sTexts[542]
+tip = sTexts[551]
+id = ID_EDIT_CONVERT_7
+
+[wxMenuItem miOpenToClosedIntSpline]
+text = sTexts[538]
+tip = sTexts[547]
+id = ID_EDIT_CONVERT_A
+
+[wxMenuItem miClosedToOpenIntSpline]
+text = sTexts[163]
+tip = sTexts[166]
+id = ID_EDIT_CONVERT_3
+
+[wxMenuItem miDotToWhiteFilled]
+text = sTexts[543]
+tip = sTexts[552]
+id = ID_EDIT_CONVERT_8
+
+[wxMenuItem miWhiteFilledToDot]
+text = sTexts[544]
+tip = sTexts[553]
+id = ID_EDIT_CONVERT_9
+
+[wxMenu menuView]
+text = sTexts[84]
+contents = menuZoom
+contents = menuLayer
+contents = miViewCenterView
+
+[wxMenu menuOptions]
+text = sTexts[601]
+contents = menuColours
+contents = miOptionsNewObjects
+contents = miOptionsScreen
+contents = miOptionsReset
+
+[wxMenu menuZoom]
+text = sTexts[85]
+contents = miZoomIn
+contents = miZoomOut
+contents = miZoomReset
+
+[wxMenuItem miZoomIn]
+text = sTexts[86]
+tip = sTexts[87]
+id = wxID_ZOOM_IN
+
+[wxMenuItem miZoomOut]
+text = sTexts[88]
+tip = sTexts[89]
+id = wxID_ZOOM_OUT
+
+[wxMenuItem miZoomReset]
+text = sTexts[90]
+tip = sTexts[91]
+id = wxID_ZOOM_100
+
+[wxMenu menuLayer]
+text = sTexts[92]
+contents = miLayerActivateAll
+contents = miLayerManager
+
+[wxMenuItem miLayerActivateAll]
+text = sTexts[93]
+tip = sTexts[94]
+id = ID_LAYERS_ALL
+
+[wxMenuItem miLayerManager]
+text = sTexts[95]
+tip = sTexts[96]
+id = ID_LAYERS_MGR
+
+[wxMenuItem miViewCenterView]
+text = sTexts[97]
+tip = sTexts[98]
+id = ID_ZOOM_CENTER
+
+[wxMenu menuColours]
+text = sTexts[606]
+contents = menuColourBorder
+contents = menuColourBackground
+contents = menuColourGrid
+contents = menuColourPlacement
+contents = menuColourCopy
+contents = menuColourMove
+contents = menuColourDelete
+contents = menuColourGroup
+contents = menuColourMissing
+
+[wxMenu menuColourBorder]
+text = sTexts[611]
+contents = miColourBorderModify
+contents = miColourBorderReset
+
+[wxMenuItem miColourBorderModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_BORDER
+
+[wxMenuItem miColourBorderReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_BORDER
+
+[wxMenu menuColourBackground]
+text = sTexts[612]
+contents = miColourBackgroundModify
+contents = miColourBackgroundReset
+
+
+[wxMenuItem miColourBackgroundModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_BACKGROUND
+
+[wxMenuItem miColourBackgroundReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_BACKGROUND
+
+[wxMenu menuColourGrid]
+text = sTexts[613]
+contents = miColourGridModify
+contents = miColourGridReset
+
+[wxMenuItem miColourGridModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_GRID
+
+[wxMenuItem miColourGridReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_GRID
+
+[wxMenu menuColourPlacement]
+text = sTexts[614]
+contents = miColourPlacementModify
+contents = miColourPlacementReset
+
+[wxMenuItem miColourPlacementModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_PH
+
+[wxMenuItem miColourPlacementReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_PH
+
+[wxMenu menuColourCopy]
+text = sTexts[615]
+contents = miColourCopyModify
+contents = miColourCopyReset
+
+[wxMenuItem miColourCopyModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_COPY
+
+[wxMenuItem miColourCopyReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_COPY
+
+[wxMenu menuColourMove]
+text = sTexts[616]
+contents = miColourMoveModify
+contents = miColourMoveReset
+
+[wxMenuItem miColourMoveModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_MOVE
+
+[wxMenuItem miColourMoveReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_MOVE
+
+[wxMenu menuColourDelete]
+text = sTexts[617]
+contents = miColourDeleteModify
+contents = miColourDeleteReset
+
+[wxMenuItem miColourDeleteModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_DELETE
+
+[wxMenuItem miColourDeleteReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_DELETE
+
+[wxMenu menuColourGroup]
+text = sTexts[618]
+contents = miColourGroupModify
+contents = miColourGroupReset
+
+[wxMenuItem miColourGroupModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_GROUP
+
+[wxMenuItem miColourGroupReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_GROUP
+
+[wxMenu menuColourMissing]
+text = sTexts[619]
+contents = miColourMissingModify
+contents = miColourMissingReset
+
+[wxMenuItem miColourMissingModify]
+text = sTexts[609]
+tip = sTexts[610]
+id = ID_COL_MOD_MISSING
+
+[wxMenuItem miColourMissingReset]
+text = sTexts[607]
+tip = sTexts[608]
+id = ID_COL_RES_MISSING
+
+[wxMenuItem miOptionsNewObjects]
+text = sTexts[625]
+tip = sTexts[626]
+id = ID_OPT_NEW_OBJECTS
+
+[wxMenuItem miOptionsScreen]
+text = sTexts[630]
+tip = sTexts[631]
+id = ID_OPT_SCREEN
+
+[wxMenuItem miOptionsReset]
+text = sTexts[602]
+tip = sTexts[603]
+id = ID_RESET_OPTIONS
+
+[wxMenu menuHelp]
+text = sTexts[3]
+contents = miHelpAbout
+contents = miHelpContents
+
+[wxMenuItem miHelpAbout]
+id = ID_HELP_ABOUT
+text = sTexts[4]
+tip = sTexts[5]
+
+[wxMenuItem miHelpContents]
+id = ID_HELP_CONTENTS
+text = sTexts[6]
+tip = sTexts[7]
+
+[wxBoxSizer mainSizer]
+direction = horizontal
+contents = $space(10)
+contents = verticalSizer
+contents = $space(10)
+
+[wxBoxSizer verticalSizer]
+direction = vertical
+grow = yes
+proportion = 1
+contents = $space(10)
+contents = szTopBar
+contents = $space(10)
+contents = szMiddleBar
+contents = $space(10)
+contents = szBottomBar
+contents = $space(10)
+contents = szHintsBar
+# contents = $space(10)
+
+# Button bar at top of frame
+[wxBoxSizer szTopBar]
+direction = horizontal
+grow = yes
+contents = bFileOpen centered-y
+contents = bFileSave centered-y
+contents = $stretch(10)
+contents = lZoomPercent centered-y
+contents = $space(10)
+contents = bZoomIn centered-y
+contents = bZoomOut centered-y
+contents = bZoomOne centered-y
+contents = $space(10)
+contents = cbGridOnOff centered-y
+contents = $space(5)
+contents = cbGridUnit centered-y
+contents = cbGridBase centered-y
+contents = $space(10)
+contents = cbPH centered-y
+
+
+# Horizontal box sizer containing left button bar and draw control
+[wxBoxSizer szMiddleBar]
+direction = horizontal
+grow = yes
+proportion = 1
+contents = szLeftBar
+contents = $space(10)
+contents = szOperationsAndDraw
+
+# Left button bar (add elements)
+[wxGridBagSizer szLeftBar]
+contents = bPolyline 0 0 1 1
+contents = bPolygon . +1 1 1
+contents = bRect +1 0 1 1
+contents = bBox . +1 1 1
+contents = bCircle +1 0 1 1
+contents = bEllipse . +1 1 1
+contents = bArcOpen +1 0 1 1
+contents = bArcClosed . +1 1 1
+contents = bSplineAO +1 0 1 1
+contents = bSplineAC . +1 1 1
+contents = bSplineIO +1 0 1 1
+contents = bSplineIC . +1 1 1
+contents = bConnector +1 0 1 1
+contents = bPin . +1 1 1
+contents = bText +1 0 1 1
+contents = bImage . +1 1 1
+contents = bLibelem +1 0 1 1
+
+
+[wxBoxSizer szOperationsAndDraw]
+direction = vertical
+grow = yes
+proportion = 1
+contents = szOperationButtons
+contents = $space(10,10)
+contents = szDrawco
+
+
+# Button bar at bottom of frame
+[wxGridBagSizer szBottomBar]
+# contents = lLayer 0 2 1 2 centered-y
+# contents = lLine . +2 1 9 centered-y
+# contents = lFill . +9 1 3 centered-y
+# contents = lText . +3 1 4 centered-y
+# contents = $space(5,5) +1 0 1 1 centered-y
+# contents = bSelectObject +1 0 1 1 centered-y
+# contents = $space(5,5) . +1 1 1 centered-y
+# contents = spLayerNumber . +1 1 1 centered-y
+# contents = $space(5,5) . +1 1 1 centered-y
+# contents = ccLineColour . +1 1 1 centered-y
+# contents = $space(5,5) . +1 1 1 centered-y
+# contents = spLineWidth . +1 1 1 centered-y
+# contents = bStyleLineStyle . +1 1 1 centered-y
+# contents = bStyleLineJoins . +1 1 1 centered-y
+# contents = bStyleLineEnds . +1 1 1 centered-y
+# contents = bStyleArrowForward . +1 1 1 centered-y
+# contents = bStyleArrowBackward . +1 1 1 centered-y
+# contents = $space(5,5) . +1 1 1 centered-y
+# contents = ccFillColour . +1 1 1 centered-y
+# contents = bStyleFillPattern . +1 1 1 centered-y
+# contents = $space(5,5) . +1 1 1 centered-y
+# contents = cbStyleTextLaTeX . +1 1 1 centered-y
+# contents = bStyleTextAlign . +1 1 1 centered-y
+# contents = bStyleFontName . +1 1 1 centered-y
+# contents = spFontSize . +1 1 1 centered-y
+contents = lLayer 0 0 1 1 centered-y right
+contents = $space(5,5) . +1 1 1 centered-y
+contents = spLayerNumber . +1 1 1 centered-y
+contents = $space(5,5) . +1 1 1 centered-y
+contents = lLine . +1 1 1 centered-y right
+contents = $space(5,5) . +1 1 1 centered-y
+contents = szLine . +1 1 1 centered-y
+contents = $space(5,5) . +1 1 1 centered-y
+contents = lFill . +1 1 1 centered-y right
+contents = $space(5,5) . +1 1 1 centered-y
+contents = szFill . +1 1 1 centered-y
+contents = $space(5,5) +1 0 1 1 centered-y
+contents = lText +1 0 1 1 centered-y right
+contents = $space(5,5) . +1 1 1 centered-y
+contents = szText . +1 1 10 centered-y
+
+[wxBoxSizer szLine]
+direction = horizontal
+contents = ccLineColour centered-y
+contents = $space(5,5)
+contents = spLineWidth centered-y
+contents = bStyleLineStyle centered-y
+contents = bStyleLineJoins centered-y
+contents = bStyleLineEnds centered-y
+contents = bStyleArrowForward centered-y
+contents = bStyleArrowBackward centered-y
+
+[wxBoxSizer szFill]
+direction = horizontal
+contents = ccFillColour centered-y
+contents = bStyleFillPattern centered-y
+
+[wxBoxSizer szText]
+direction = horizontal
+grow = yes
+proportion = 1
+contents = cbStyleTextLaTeX centered-y
+contents = bStyleTextAlign centered-y
+contents = bStyleFontName centered-y
+contents = spFontSize centered-y
+contents = $stretch(10)
+contents = lRotation centered-y
+contents = $space(5,5)
+contents = spRotation centered-y
+
+
+# Mouse key texts and cursor position
+[wxBoxSizer szHintsBar]
+direction = horizontal
+grow = yes
+contents = tlMouseL
+contents = msgMouseL
+contents = tlMouseM
+contents = msgMouseM
+contents = tlMouseR
+contents = msgMouseR
+contents = tlPosX
+contents = msgPosX
+contents = tlPosY
+contents = msgPosY
+
+[wxBoxSizer szOperationButtons]
+direction = horizontal
+grow = yes
+contents = bEditCopy centered-y
+contents = bEditMove centered-y
+contents = bEditDelete centered-y
+contents = $space(10)
+contents = bEditPointAdd centered-y
+contents = bEditPointDelete centered-y
+contents = bEditPointMove centered-y
+contents = cbPointMoveMode centered-y
+contents = bModifySplineValue centered-y
+contents = $space(10)
+contents = bEditFlipH centered-y
+contents = bEditFlipV centered-y
+contents = bEditRotLeft centered-y
+contents = bEditRotRight centered-y
+contents = $space(10)
+contents = bEditDetails centered-y
+contents = $space(10)
+contents = bEditGroup centered-y
+# contents = bEditGroup2 centered-y
+contents = bEditGroup3 centered-y
+contents = bEditUngroup centered-y
+contents = $space(10)
+contents = bEditChangeSize centered-y
+
+[wxGridBagSizer szDrawco]
+grid = 5 5
+grow = yes
+proportion = 1
+growable row = 0
+growable column = 0
+contents = drawco 0 0 1 1
+contents = sbVert . +1 1 1
+contents = sbHori +1 0 1 1
+
+
+[wxBitmapButton bFileOpen]
+bitmap = xpm_wxd_tb_open
+id = wxID_OPEN
+tip = sTexts[99]
+
+[wxBitmapButton bFileSave]
+bitmap = xpm_wxd_tb_save
+id = wxID_SAVE
+tip = sTexts[100]
+
+[wxBitmapButton bEditCopy]
+bitmap = xpm_wxd_bcopy
+id = ID_EDIT_COPY
+tip = sTexts[101]
+
+[wxBitmapButton bEditMove]
+bitmap = xpm_wxd_bmove
+id = ID_EDIT_MOVE
+tip = sTexts[102]
+
+[wxBitmapButton bEditDelete]
+bitmap = xpm_wxd_bdel
+id = ID_EDIT_DEL
+tip = sTexts[103]
+
+[wxBitmapButton bEditPointMove]
+bitmap = xpm_wxd_bmvpoint
+id = ID_EDIT_PT_MOVE
+tip = sTexts[104]
+
+[wxChoice cbPointMoveMode]
+choices = 2 saPointMoveMode
+tip = sTexts[413]
+id = ID_CB_POINT_MOVE_MODE
+
+[wxBitmapButton bModifySplineValue]
+bitmap = xpm_wxd_bmodifys
+tip = sTexts[621]
+id = ID_MOD_SPLINE
+
+[wxBitmapButton bEditDetails]
+bitmap = xpm_wxd_bdetails
+tip = sTexts[105]
+id = ID_EDIT_DET
+
+
+[wxBitmapButton bEditGroup]
+bitmap = xpm_wxd_bgroup
+tip = sTexts[106]
+id = ID_EDIT_GRP1
+
+[wxBitmapButton bEditGroup3]
+bitmap = xpm_wxd_bgroup3
+tip = sTexts[164]
+id = ID_EDIT_GRP13
+
+[wxBitmapButton bEditUngroup]
+bitmap = xpm_wxd_bungroup
+tip = sTexts[107]
+id = ID_EDIT_UNGRP
+
+[wxBitmapButton bEditFlipH]
+bitmap = xpm_wxd_bfliph
+tip = sTexts[108]
+id = ID_EDIT_FLIPH
+
+[wxBitmapButton bEditFlipV]
+bitmap = xpm_wxd_bflipv
+tip = sTexts[109]
+id = ID_EDIT_FLIPV
+
+[wxBitmapButton bEditRotLeft]
+bitmap = xpm_wxd_brotleft
+tip = sTexts[567]
+id = ID_EDIT_ROTLEFT
+
+[wxBitmapButton bEditRotRight]
+bitmap = xpm_wxd_brotright
+tip = sTexts[569]
+id = ID_EDIT_ROTRIGHT
+
+[wxBitmapButton bEditPointAdd]
+bitmap = xpm_wxd_baddpoint
+id = ID_EDIT_PT_ADD
+tip = sTexts[110]
+
+[wxBitmapButton bEditPointDelete]
+bitmap = xpm_wxd_bdelpoint
+id = ID_EDIT_PT_DEL
+tip = sTexts[111]
+
+[wxBitmapButton bEditChangeSize]
+bitmap = xpm_wxd_tb_borders
+tip = sTexts[112]
+id = ID_EDIT_DRSZ
+
+[wxBitmapButton bZoomIn]
+bitmap = xpm_wxd_tb_zoom_in
+tip = sTexts[113]
+id = wxID_ZOOM_IN
+
+[wxBitmapButton bZoomOut]
+bitmap = xpm_wxd_tb_zoom_out
+tip = sTexts[114]
+id = wxID_ZOOM_OUT
+
+[wxBitmapButton bZoomOne]
+bitmap = xpm_wxd_tb_zoom_11
+tip = sTexts[115]
+id = wxID_ZOOM_100
+
+[wxStaticText lZoomPercent]
+text = sNlWx[18]
+
+[wxCheckBox cbGridOnOff]
+text = sTexts[160]
+tip = sTexts[116]
+id = ID_GRID_ON_OFF
+
+[wxChoice cbGridUnit]
+choices = 2 saGridChoices
+tip = sTexts[117]
+id = ID_GRID_UNIT
+
+[wxChoice cbGridBase]
+choices = 2 saGridBase
+tip = sTexts[118]
+id = ID_GRID_BASE
+
+
+[wxCheckBox cbPH]
+text = sTexts[161]
+tip = sTexts[119]
+id = ID_PLACEMENT
+
+[wxBitmapButton bPolyline]
+bitmap = xpm_wxd_bpolyline
+tip = sTexts[120]
+id = ID_ADD_POLYINE
+
+[wxBitmapButton bPolygon]
+bitmap = xpm_wxd_bpolygon
+tip = sTexts[121]
+id = ID_ADD_POLYGON
+
+[wxBitmapButton bRect]
+bitmap = xpm_wxd_brectangle
+tip = sTexts[122]
+id = ID_ADD_RECT
+
+[wxBitmapButton bBox]
+bitmap = xpm_wxd_bbox
+tip = sTexts[123]
+id = ID_ADD_BOX
+
+[wxBitmapButton bCircle]
+bitmap = xpm_wxd_bcircle
+tip = sTexts[124]
+id = ID_ADD_CIRCLE
+
+[wxBitmapButton bEllipse]
+bitmap = xpm_wxd_bellipse
+tip = sTexts[125]
+id = ID_ADD_ELLIPSE
+
+[wxBitmapButton bArcOpen]
+bitmap = xpm_wxd_boarc
+tip = sTexts[126]
+id = ID_ADD_ARC_O
+
+[wxBitmapButton bArcClosed]
+bitmap = xpm_wxd_bcarc
+tip = sTexts[127]
+id = ID_ADD_ARC_C
+
+[wxBitmapButton bSplineAO]
+bitmap = xpm_wxd_bsplineoa
+tip = sTexts[128]
+id = ID_ADD_SPL_AO
+
+[wxBitmapButton bSplineAC]
+bitmap = xpm_wxd_bsplineca
+tip = sTexts[129]
+id = ID_ADD_SPL_AC
+
+[wxBitmapButton bSplineIO]
+bitmap = xpm_wxd_bsplineoi
+tip = sTexts[130]
+id = ID_ADD_SPL_IO
+
+[wxBitmapButton bSplineIC]
+bitmap = xpm_wxd_bsplineci
+tip = sTexts[131]
+id = ID_ADD_SPL_IC
+
+[wxBitmapButton bConnector]
+bitmap = xpm_wxd_bbullet
+tip = sTexts[132]
+id = ID_ADD_DOT_C
+
+[wxBitmapButton bPin]
+bitmap = xpm_wxd_bbulletf
+tip = sTexts[133]
+id = ID_ADD_DOT_W
+
+[wxBitmapButton bText]
+bitmap = xpm_wxd_btext
+tip = sTexts[134]
+id = ID_ADD_TEXT
+
+[wxBitmapButton bLibelem]
+bitmap = xpm_wxd_blib
+tip = sTexts[135]
+id = ID_ADD_LIBELEM
+
+[wxBitmapButton bImage]
+bitmap = xpm_wxd_bimg
+tip = sTexts[136]
+id = ID_ADD_IMG
+
+
+[wxStaticText lLayer]
+text = sTexts[137]
+text style = right
+
+[wxStaticText lLine]
+text = sTexts[138]
+text style = right
+
+[wxStaticText lFill]
+text = sTexts[139]
+text style = right
+
+[wxStaticText lText]
+text = sTexts[140]
+text style = right
+
+# [wxBitmapButton bSelectObject]
+# bitmap = xpm_wxd_bproperties
+# tip = sTexts[162]
+# id = wxID_ANY
+
+[wxSpinCtrl spLayerNumber]
+value = 0
+range = -32768 32767
+tip = sTexts[141]
+id = ID_STYLE_LAYER
+
+[Dk4WxColourView ccLineColour]
+constructor = applicationHelper,0,0,0,wxDefaultPosition,ColourViewSize()
+id = ID_STYLE_LINE_COL
+tip = sTexts[142]
+
+[wxSpinCtrl spLineWidth]
+value = 2
+range = 0 65535
+tip = sTexts[143]
+id = ID_STYLE_LINE_WIDTH
+
+[wxBitmapButton bStyleLineStyle]
+bitmap = xpm_wxd_ls1
+id = ID_STYLE_LINE_STYLE
+tip = sTexts[144]
+
+[wxBitmapButton bStyleLineEnds]
+bitmap = xpm_wxd_lc1
+id = ID_STYLE_LINE_CAP
+tip = sTexts[145]
+
+[wxBitmapButton bStyleLineJoins]
+bitmap = xpm_wxd_js1
+id = ID_STYLE_LINE_JOIN
+tip = sTexts[146]
+
+[wxBitmapButton bStyleArrowForward]
+bitmap = xpm_wxd_as00
+id = ID_STYLE_ARROW_F
+tip = sTexts[147]
+
+[wxBitmapButton bStyleArrowBackward]
+bitmap = xpm_wxd_as00
+id = ID_STYLE_ARROW_B
+tip = sTexts[148]
+
+[Dk4WxColourView ccFillColour]
+constructor = applicationHelper,0,0,0,wxDefaultPosition,ColourViewSize()
+id = ID_STYLE_FILL_COL
+tip = sTexts[149]
+
+[wxBitmapButton bStyleFillPattern]
+bitmap = xpm_wxd_fs01
+id = ID_STYLE_FILL_PATT
+tip = sTexts[150]
+
+[wxCheckBox cbStyleTextLaTeX]
+text = sTexts[151]
+tip = sTexts[152]
+id = ID_STYLE_TEXT_LATEX
+
+[wxBitmapButton bStyleTextAlign]
+bitmap = xpm_wxd_ts00
+id = ID_STYLE_TEXT_ALIGN
+tip = sTexts[153]
+
+[wxBitmapButton bStyleFontName]
+bitmap = xpm_wxd_fn00
+id = ID_STYLE_TEXT_FONT
+tip = sTexts[154]
+
+[wxSpinCtrl spFontSize]
+range = 1 65535
+value = 12
+tip = sTexts[155]
+id = ID_STYLE_TEXT_SIZE
+
+[wxStaticText lRotation]
+text = sTexts[416]
+
+[wxSpinCtrl spRotation]
+range = -360 360
+value = 0
+tip = sTexts[417]
+id = ID_SPIN_ROTATION
+
+[wxStaticText tlMouseL]
+text = sTexts[13]
+
+[wxStaticText msgMouseL]
+proportion = 3
+text = sNlWx[7]
+
+[wxStaticText tlMouseM]
+text = sTexts[14]
+
+[wxStaticText msgMouseM]
+proportion = 3
+text = sNlWx[7]
+
+[wxStaticText tlMouseR]
+text = sTexts[15]
+
+[wxStaticText msgMouseR]
+proportion = 3
+text = sNlWx[7]
+
+[wxStaticText tlPosX]
+text = sTexts[16]
+
+[wxStaticText msgPosX]
+proportion = 2
+text = sNlWx[7]
+
+[wxStaticText tlPosY]
+text = sTexts[17]
+
+[wxStaticText msgPosY]
+proportion = 2
+text = sNlWx[7]
+
+# The drawing control
+[Control drawco]
+grow = yes
+proportion = 1
+constructor = this
+
+[wxScrollBar sbVert]
+direction = vertical
+grow = yes
+id = ID_SCROLL_V
+
+[wxScrollBar sbHori]
+grow = yes
+id = ID_SCROLL_H
+
+
+%% header start
+
+#include "wxdkdraw.h"
+
+#ifndef DK4WXCOLOURVIEW_H_INCLUDED
+#include "Dk4WxColourView.h"
+#define DK4WXCOLOURVIEW_H_INCLUDED 1
+#endif
+
+
+%% class start
+/** The programs main window.
+*/
+class WxdkdrawFrame : public Dk4WxFrame
+{
+ /* ----- start of control class ----- */
+
+ /** The draw control.
+ Defined as nested class to make both classes friend of each other.
+ */
+ class Control : public wxControl
+ {
+ /** Allow frame class full access to all members.
+ */
+ friend class WxdkdrawFrame;
+
+ /** Class responds to events.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_DYNAMIC_CLASS(Control);
+#else
+ DECLARE_DYNAMIC_CLASS(Control)
+#endif
+
+ private:
+
+ /* control private members */
+
+ /** This class uses an event table.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /* control protected members */
+
+ /** Name of control, used in initialization.
+ */
+ static wxChar const ms_controlname[];
+
+ /** Draw control size.
+ Only available within OnPaint handler.
+ */
+ wxSize m_szDrawco;
+
+ /** Screen resolution in dpi for x and y direction.
+ */
+ dk4_gra_point_t m_ptRes;
+
+ /** Coefficients for coordinate transformations.
+ Only available within OnPaint handler.
+ */
+ dk4_gra_point_t m_ptM;
+
+ /** Coefficients for coordinate transformations.
+ Only available within OnPaint handler.
+ */
+ dk4_gra_point_t m_ptN;
+
+ /** Parent frame, containing pointer to the drawing.
+ */
+ WxdkdrawFrame *m_pParent;
+
+ /** Bitmap 1 contains border, viewport and grid.
+ */
+ wxBitmap *m_pB1;
+
+ /** Bitmap 2 contains the graphics elements on top of bitmap 1.
+ */
+ wxBitmap *m_pB2;
+
+ /** Bitmap 3 contains the markup on top of bitmap 2.
+ */
+ wxBitmap *m_pB3;
+
+ /** Zoom factor, depends on zoom level.
+ */
+ double m_dZoom;
+
+ /** Optical grid distance.
+ */
+ uint32_t m_uGridOptical;
+
+ /** Snap grid distance.
+ */
+ uint32_t m_uGridSnap;
+
+ /** Control is allowed to allocate bitmaps.
+ */
+ bool m_bCanAllocate;
+
+ public:
+
+ /* control public methods */
+
+ /** Default constructor.
+ Here for completeness
+ */
+ Control();
+
+ /** Constructor
+ */
+ Control(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ WxdkdrawFrame *pFrame,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & sz = wxDefaultSize,
+ long st = wxBORDER_NONE,
+ wxChar const *name = ms_controlname
+ );
+
+ /** Create control.
+ This method is here for completeness, it is not used
+ by the wxdkdraw program.
+ @param pParent Parent frame.
+ @param wxid Window ID.
+ @param pFrame Parent frame.
+ @param pos Position.
+ @param sz Size.
+ @param st Control style.
+ @param name Control name.
+ */
+ bool
+ Create(
+ wxWindow *pParent,
+ wxWindowID wxid,
+ WxdkdrawFrame *pFrame,
+ wxPoint const & pos = wxDefaultPosition,
+ wxSize const & sz = wxDefaultSize,
+ long st = wxBORDER_NONE,
+ wxChar const *name = ms_controlname
+ );
+
+ /** Destructor.
+ */
+ ~Control();
+
+ /** Prepare control for destruction.
+ Release bitmaps and avoid re-allocation.
+ */
+ void
+ PrepareForDestruction(void);
+
+ /** Handler for erase event.
+ @param event Event to handle.
+ */
+ void
+ OnErase(wxEraseEvent & event);
+
+ /** Handler for paint event.
+ @param event Event to handle.
+ */
+ void
+ OnPaint(wxPaintEvent & event);
+
+ /** Handler for resize event.
+ @param event Event to handle.
+ */
+ void
+ OnSize(wxSizeEvent & event);
+
+ /** Handler for mouse enter event.
+ @param event Event to handle.
+ */
+ void
+ OnMouseEnter(wxMouseEvent & event);
+
+ /** Handler for mouse leave event.
+ @param event Event to handle.
+ */
+ void
+ OnMouseLeave(wxMouseEvent & event);
+
+ /** Handler for mouse motion event.
+ @param event Event to handle.
+ */
+ void
+ OnMouseMove(wxMouseEvent & event);
+
+ /** Handler for left mouse button event.
+ @param event Event to handle.
+ */
+ void
+ OnLeftMouseButtonDown(wxMouseEvent & event);
+
+ /** Handler for right mouse button event.
+ @param event Event to handle.
+ */
+ void
+ OnRightMouseButtonDown(wxMouseEvent & event);
+
+ /** Handler for middle mouse button event.
+ @param event Event to handle.
+ */
+ void
+ OnMiddleMouseButtonDown(wxMouseEvent & event);
+
+ /** Handler for mouse wheel event.
+ @param event Event to handle.
+ */
+ void
+ OnMouseWheel(wxMouseEvent & event);
+
+ protected:
+
+ /** Check for completed initialization.
+ @return True if ready to handle events, false otherwise.
+ */
+ bool
+ CanHandleEvents(void);
+
+ /** Fill entire control using border colour.
+ @param dc Drawing context.
+ */
+ void
+ PaintOperation0(wxDC & dc);
+
+ /** Draw background for drawing canvas.
+ @param gc Graphics context to use.
+ */
+ void
+ PaintOperationCanvas(
+ wxGraphicsContext *gc
+ );
+
+ /** Draw grid in a calculated bounding box.
+ @param gc Graphics context to use.
+ @param g_end Bounding box data for grid.
+ */
+ void
+ PaintOperationBoundingBoxGrid(
+ wxGraphicsContext *gc,
+ Wxd_bb_t const & g_end
+ );
+
+ /** Draw grid.
+ @param gc Graphics context to use.
+ */
+ void
+ PaintOperationGrid(
+ wxGraphicsContext *gc
+ );
+
+ /** Decide whether or not to use placement help in current state.
+ @return True to show placement help, false otherwise.
+ */
+ bool
+ StateUsesPlacementHelp(void);
+
+ /** Draw border, drawable area and grid.
+ @param gc Graphics context to use.
+ */
+ void
+ PaintOperation1(wxGraphicsContext *gc);
+
+ /** Draw drawing objects.
+ @param gc Graphics context to use.
+ @param event Event to process.
+ */
+ void
+ PaintOperation2(wxGraphicsContext *gc);
+
+ /** Draw markup on top of drawing.
+ @param gc Graphics context to use.
+ @param event Event to process.
+ */
+ void
+ PaintOperation3(wxGraphicsContext *gc);
+
+ /** Calculate zoom factor and grid distances after zooming in
+ or out or after changing graphics.
+ */
+ void
+ CalculateZoomFactor(void);
+
+ /** Calculate grid distances after changing grid settings.
+ */
+ void
+ CalculateGridDistances(void);
+
+ /** Calculate conversion coefficients.
+ */
+ void
+ CalculateConversionCoefficients(void);
+
+ /** Convert x distance from wxd to pixels.
+ @param d Distance to convert.
+ @return Conversion result.
+ */
+ double
+ ConvDist(double d);
+
+ /** Convert x distance from wxd to pixels.
+ @param d Distance to convert.
+ @return Conversion result.
+ */
+ double
+ ConvDist(int32_t d);
+
+ /** Convert x coordinate from wxd to pixels.
+ @param x X coordinate value in wxd.
+ @return X coordinate value in pixels.
+ */
+ double
+ ConvX(double x);
+
+ /** Convert x coordinate from wxd to pixels.
+ @param x X coordinate value in wxd.
+ @return X coordinate value in pixels.
+ */
+ double
+ ConvX(int32_t x);
+
+ /** Convert y coordinate from wxd to pixels.
+ @param y Y coordinate value in wxd.
+ @return Y coordinate value in pixels.
+ */
+ double
+ ConvY(double y);
+
+ /** Convert y coordinate from wxd to pixels.
+ @param y Y coordinate value in wxd.
+ @return Y coordinate value in pixels.
+ */
+ double
+ ConvY(int32_t y);
+
+ /** Convert x coordinate back from pixels to wxd.
+ @param x X coordinate in pixels.
+ @return X coordinate in wxd.
+ */
+ double
+ InvX(double x);
+
+ /** Convert y coordinate back from pixels to wxd.
+ @param y Y coordinate in pixels.
+ @return Y coordinate in wxd.
+ */
+ double
+ InvY(double y);
+
+ /** Convert x coordinate back from pixels to wxd.
+ @param x X coordinate in pixels.
+ @param ok Success flag to reset on error.
+ @return Backward conversion value on success, 0L on error.
+ */
+ int32_t
+ InvX(double x, bool & ok);
+
+ /** Convert y coordinate back from pixels to wxd.
+ @param y Y coordinate in pixels.
+ @param ok Success flag to reset on error.
+ @return Backward conversion value on success, 0L on error.
+ */
+ int32_t
+ InvY(double y, bool & ok);
+
+#if 0
+
+ /** Convert x coordinate back from pixels to wxd.
+ @param dptr Address of result variable.
+ @param x X coordinate in pixels.
+ @return True on success, false on error (x out of range).
+ */
+ bool
+ InvX(int32_t *dptr, double x);
+
+ /** Convert y coordinate back from pixels to wxd.
+ @param dptr Address of result variable.
+ @param y Y coordinate in pixels.
+ @return True on success, false on error (y out of range).
+ */
+ bool
+ InvY(int32_t *dptr, double y);
+
+ /** Convert x coordinate back from pixels to wxd.
+ @param dptr Address of result variable.
+ @param x X coordinate in pixels.
+ @return True on success, false on error (x out of range).
+ */
+ bool
+ InvX(int32_t *dptr, int x);
+
+ /** Convert y coordinate back from pixels to wxd.
+ @param dptr Address of result variable.
+ @param y Y coordinate in pixels.
+ @return True on success, false on error (y out of range).
+ */
+ bool
+ InvY(int32_t *dptr, int y);
+
+#endif
+
+
+ /** Round grid coordinate downward.
+ @param x Original coordinate.
+ @param gr Grid distance.
+ @param ok Success variable to reset on numerical errors.
+ @param fo Force downward rounding.
+ @return Result.
+ */
+ int32_t
+ GridRoundDown(
+ int32_t x,
+ uint32_t gr,
+ bool & ok,
+ bool fo = false
+ );
+
+ /** Round grid coordinate upward.
+ @param x Original coordinate.
+ @param gr Grid distance.
+ @param ok Success variable to reset on numerical errors.
+ @param fo Force upward rounding.
+ @return Result.
+ */
+ int32_t
+ GridRoundUp(
+ int32_t x,
+ uint32_t gr,
+ bool & ok,
+ bool fo = false
+ );
+
+ /** Round grid coordinate to nearest grid point.
+ @param x Original coordinate.
+ @param gr Grid distance.
+ @param ok Success variable to reset on numerical errors.
+ @return Result.
+ */
+ int32_t
+ GridRoundNearest(int32_t x, uint32_t gr, bool & ok);
+
+ /** Check whether object contains all required data for drawing.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip object.
+ */
+ bool
+ CanDrawElement(Wxd_object_t const *pobj);
+
+ /** Check whether to draw an object in normal drawing pass.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip drawing.
+ */
+ bool
+ MustDrawElementInNormalPass(Wxd_object_t const *pobj);
+
+ /** Check whether to draw an object in markup pass.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip drawing.
+ */
+ bool
+ MustDrawElementInMarkupPass(Wxd_object_t const *pobj);
+
+ /** Check whether to highlight an object in markup pass.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip drawing.
+ */
+ bool
+ MustHighlightElementInMarkupPass(Wxd_object_t const *pobj);
+
+ /** Check whether to highlight an object in markup pass.
+ @param pobj Object to check.
+ @return True to draw the object, false to skip drawing.
+ */
+ bool
+ MustHighlight2ElementInMarkupPass(Wxd_object_t const *pobj);
+
+ /** Check whether there are objects under construction in
+ current state.
+ @return True for states with objects under construction.
+ */
+ bool
+ StateHasObjectsUnderModification(void);
+
+ /** Check whether there are objects to highlight in current state.
+ @return True for states with objects under construction.
+ */
+ bool
+ StateHasObjectsToHighlight(void);
+
+ /** Check whether there are objects to highlight in current state.
+ @return True for states with objects under construction.
+ */
+ bool
+ StateHasObjectsToHighlight2(void);
+
+ /** Choose stroke colour, either the objects stroke colour
+ or a colour for markup.
+ @param sc Destination array for colour components.
+ @param pObj Object to draw.
+ @param iMarkup Markup type to use.
+ */
+ void
+ ChooseStrokeColour(int *sc, Wxd_object_t const *pObj, int iMarkup);
+
+ /** Draw one graphics object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one text object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawTextElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Create path for polyline or polygon.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathPolyline(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for one X-spline segment consisting
+ of multiple sub-segments.
+ @param p Graphics path to modify.
+ @param pt Spline points array.
+ @param xsp X-spline data.
+ @param segno Number of current segment.
+ @param subsegs Number of sub-segments to produce.
+ @param divisor Divisor for derivative values.
+ @param shiftx X shift value.
+ @param shifty Y shift value.
+ @param ib Index of point B in pt.
+ @param ic Index of point C in pt.
+ */
+ void
+ SplineSegment(
+ wxGraphicsPath & p,
+ Wxd_spline_point_t *pt,
+ dk4_xsp_2d_t *xsp,
+ uint16_t segno,
+ size_t subsegs,
+ double divisor,
+ double shiftx,
+ double shifty,
+ uint16_t ib,
+ uint16_t ic
+ );
+
+ /** Create path for spline.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathSpline(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for arc.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathArc(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for circle.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathCircle(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for ellipse.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathEllipse(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Create path for box.
+ @param p Path to construct.
+ @param pObj Object.
+ @param pShift Vector to shift object.
+ */
+ void
+ PathBox(
+ wxGraphicsPath & p,
+ Wxd_object_t const *pObj,
+ Wxd_point_t const *pShift
+ );
+
+ /** Mark up one polyline object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupPolyline(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one spline object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupSpline(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one arc object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupArc(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one circle object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupCircle(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one ellipse object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupEllipse(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one box object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupBoundingBox(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ Wxd_bb_t const *pbb,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Mark up one box object.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ MarkupBox(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one open path graphics object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawOpenPathElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one closed path graphics object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawClosedPathElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one image creation region to graphics context.
+ @param gc Graphics context.
+ */
+ void
+ DrawImageRegion(
+ wxGraphicsContext *gc
+ );
+
+ /** Draw one image object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawImageElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw one dot object to graphics context.
+ @param gc Graphics context.
+ @param pObj Object to draw.
+ @param iMarkup Markup to apply.
+ @param pShift Optional shift vector.
+ */
+ void
+ DrawDotElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pObj,
+ int iMarkup,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Set up pen attributes for object.
+ @param pen Pen to modify.
+ @param pObj Object to draw.
+ @param pDash Address of dash lengths array.
+ @param pNdash Address of variable for number of elements.
+ */
+ void
+ SetupPenForObject(
+ wxPen & pen,
+ Wxd_object_t const *pObj,
+ wxDash *pDash,
+ int *pNdash
+ );
+
+ /** Calculate point radius for markup point.
+ @param lw Line width of object to markup, may be 0.
+ @return Markup radius to use.
+ */
+ double
+ MarkupPointRadius(uint16_t lw);
+
+ /** Draw a markup point.
+ @param gc Grahics context to draw to.
+ @param sc Stroke colour.
+ @param x X position of point.
+ @param y Y position of point.
+ @param lw Line width of object markup point belongs to.
+ @param pShift Shift vector, may be NULL.
+ */
+ void
+ DrawMarkupPoint(
+ wxGraphicsContext *gc,
+ int const *sc,
+ double x,
+ double y,
+ uint16_t lw,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Draw a markup point.
+ @param gc Grahics context to draw to.
+ @param sc Stroke colour.
+ @param x X position of point.
+ @param y Y position of point.
+ @param lw Line width of object markup point belongs to.
+ @param pShift Shift vector, may be NULL.
+ */
+ void
+ DrawMarkupPoint(
+ wxGraphicsContext *gc,
+ int const *sc,
+ int32_t x,
+ int32_t y,
+ uint16_t lw,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Calculate vertices for arrowhead.
+ @param pt Address of result array.
+ @param pDrw Drawing.
+ @param pObj Object to add arrowheads to.
+ @param xpos X position of arrow end.
+ @param ypos Y position of arrow end.
+ @param rot Arrow rotation.
+ @param atype Arrow type.
+ @param alength Arrow length.
+ @param awidth Arrow width.
+ */
+ void
+ ArrowVertices(
+ dk4_gra_point_t *pt,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ double xpos,
+ double ypos,
+ double rot,
+ uint8_t atype,
+ uint8_t alength,
+ uint8_t awidth
+ );
+
+ /** Draw one arrowhead.
+ @param gc Grahpics context to use for drawing.
+ @param pDrw Drawing.
+ @param pObj Object to add arrowhead to.
+ @param sc Stroke colour.
+ @param xpos X position of arrowhead end.
+ @param ypos Y position of arrowhead end.
+ @param rot Arrowhead rotation.
+ @param atype Arrowhead type.
+ @param alength Arrowhead length.
+ @param awidth Arrowhead width.
+ */
+ void
+ DrawOneArrowhead(
+ wxGraphicsContext *gc,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int const *sc,
+ double xpos,
+ double ypos,
+ double rot,
+ uint8_t atype,
+ uint8_t alength,
+ uint8_t awidth
+ );
+
+ /** Add arrowheads to object.
+ @param gc Graphics context to use for drawing.
+ @param pDrw Drawing.
+ @param pObj Object to add arrows to.
+ @param sc Stroke colour.
+ @param pShift Shift vector.
+ */
+ void
+ AddArrowheads(
+ wxGraphicsContext *gc,
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int const *sc,
+ Wxd_point_t const *pShift = NULL
+ );
+
+ /** Calculate line width in pixels for object.
+ @param pDrw Drawing.
+ @param pObj Object.
+ @return Line width to use on screen.
+ */
+ int
+ LineWidthForObject(
+ Wxd_drawing_t const *pDrw,
+ Wxd_object_t const *pObj,
+ int iMarkup = WXD_MARKUP_NONE
+ );
+
+ /** Highlight the point to move.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ */
+ void
+ HighlightPointToMove(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno
+ );
+
+ /** Highlight the point to delete.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ */
+ void
+ HighlightPointToDelete(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno
+ );
+
+ /** Highlight the point to delete.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ @param bAppend New point must be appended after pno.
+ */
+ void
+ HighlightPointToAdd(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ bool bAppend
+ );
+
+ /** Highlight one point of the element for style changes.
+ @param gc Graphics context to use.
+ @param x X position (in WXD coordinates).
+ @param y Y position (in WXD coordinates).
+ @param r Radius (half square length).
+ @param sc Colour components.
+ */
+ void
+ HighlightStylePoint(
+ wxGraphicsContext *gc,
+ double x,
+ double y,
+ double r,
+ int const *sc
+ );
+
+ /** Highlight one point of the element for style changes.
+ @param gc Graphics context to use.
+ @param x X position (in WXD coordinates).
+ @param y Y position (in WXD coordinates).
+ @param r Radius (half square length).
+ @param sc Colour components.
+ */
+ void
+ HighlightStylePoint(
+ wxGraphicsContext *gc,
+ int32_t x,
+ int32_t y,
+ double r,
+ int const *sc
+ );
+
+ /** Highlight the element for style changes.
+ @param gc Graphics context to use.
+ @param pobj Object to highlight.
+ */
+ void
+ HighlightStyleElement(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj
+ );
+
+ /** Retrieve point coordinates from a bounding box.
+ @param x Result variable for x coordinate.
+ @param y Result variable for y coordinate.
+ @param pbb Bounding box (box or image).
+ @param pno Point number.
+ */
+ void
+ GetPointFromBox(
+ double & x,
+ double & y,
+ Wxd_bb_t const *pbb,
+ uint16_t pno
+ );
+
+ /** Highlight the point to move.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ @param ci Color index for highlighting.
+ */
+ void
+ HighlightPointForOperation(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ int ci
+ );
+
+ /** Highlight line from mouse position to control point.
+ @param gc Graphics context to draw to.
+ @param pobj Object to highlight.
+ @param pno Point number.
+ @param ci Color index for highlighting.
+ */
+ void
+ HighlightLineToPoint(
+ wxGraphicsContext *gc,
+ Wxd_object_t const *pobj,
+ uint16_t pno,
+ int ci
+ );
+
+ };
+
+ /* ----- End of control class ----- */
+
+ /** The control has full access to all members of the frame class.
+ */
+ friend class Control;
+
+ public:
+
+ /** IDs for menu items, buttons and other elements.
+ */
+ enum {
+ ID_FRAME = ((wxID_HIGHEST) + 1) , /**< Main window. */
+ ID_HELP_ABOUT , /**< Show version dialog box. */
+ ID_HELP_CONTENTS , /**< Open online help table of contents. */
+ ID_ADD_POLYINE , /**< Add polyline. */
+ ID_ADD_POLYGON , /**< Add polygon. */
+ ID_ADD_RECT , /**< Add rectangle. */
+ ID_ADD_BOX , /**< Add box (rounded corner rectangle). */
+ ID_ADD_CIRCLE , /**< Add circle. */
+ ID_ADD_ELLIPSE , /**< Add ellipse. */
+ ID_ADD_ARC_O , /**< Add open arc. */
+ ID_ADD_ARC_C , /**< Add closed arc. */
+ ID_ADD_SPL_AO , /**< Add open approximated spline. */
+ ID_ADD_SPL_AC , /**< Add closed approximated spline. */
+ ID_ADD_SPL_IO , /**< Add open interpolated spline. */
+ ID_ADD_SPL_IC , /**< Add closed interpolated spline. */
+ ID_ADD_DOT_C , /**< Add colour filled dot. */
+ ID_ADD_DOT_W , /**< Add white filled dot. */
+ ID_ADD_TEXT , /**< Add text label. */
+ ID_ADD_IMG , /**< Add image. */
+ ID_ADD_LIBELEM , /**< Add library element. */
+ ID_EDIT_COPY , /**< Copy object. */
+ ID_EDIT_MOVE , /**< Move object. */
+ ID_EDIT_DEL , /**< Delete object. */
+ ID_EDIT_PT_MOVE , /**< Move point. */
+ ID_EDIT_PT_ADD , /**< Add point. */
+ ID_EDIT_PT_DEL , /**< Delete point. */
+ ID_EDIT_DET , /**< Edit details. */
+ ID_EDIT_GRP1 , /**< Group objects (elements one by one). */
+#if 0
+ ID_EDIT_GRP12 , /**< Group objects (touching rectangle). */
+#endif
+ ID_EDIT_GRP13 , /**< Group objects (including rectangle). */
+ ID_EDIT_UNGRP , /**< Ungroup objects. */
+ ID_EDIT_FLIPH , /**< Flip ojects horizontally. */
+ ID_EDIT_FLIPV , /**< Flip objects vertically. */
+ ID_EDIT_ROTLEFT , /**< Rotate 90 degree to left. */
+ ID_EDIT_ROTRIGHT , /**< Rotate 90 degree to right. */
+ ID_EDIT_DRSZ , /**< Change drawing size. */
+ ID_LAYERS_ALL , /**< Activate all layers. */
+ ID_LAYERS_MGR , /**< Run layer manager. */
+ ID_ZOOM_CENTER , /**< Center view. */
+ ID_GRID_ON_OFF , /**< Activate or deactivate grid. */
+ ID_GRID_UNIT , /**< Grid unit changed. */
+ ID_GRID_BASE , /**< Grid base changed. */
+ ID_PLACEMENT , /**< Placement help changed. */
+#if 0
+ ID_SELECT_OBJ, /**< Select object to change style .*/
+#endif
+ ID_STYLE_LAYER , /**< Layer spin control. */
+ ID_STYLE_LINE_COL , /**< Line colour button. */
+ ID_STYLE_LINE_WIDTH , /**< Line width spin control. */
+ ID_STYLE_LINE_STYLE , /**< Line style button. */
+ ID_STYLE_LINE_CAP , /**< Line cap button. */
+ ID_STYLE_LINE_JOIN , /**< Line joint button. */
+ ID_STYLE_ARROW_F , /**< Arrowhead forward button. */
+ ID_STYLE_ARROW_B , /**< Arrowhead backward button. */
+ ID_STYLE_FILL_COL , /**< Fill colour button. */
+ ID_STYLE_FILL_PATT , /**< Fill pattern button. */
+ ID_STYLE_TEXT_LATEX , /**< LaTeX special text checkbox. */
+ ID_STYLE_TEXT_ALIGN , /**< Text align button. */
+ ID_STYLE_TEXT_FONT , /**< Text font button. */
+ ID_STYLE_TEXT_SIZE , /**< Text size spin control. */
+ ID_SCROLL_H , /**< Horizontal scrollbar. */
+ ID_SCROLL_V , /**< Vertical scrollbar. */
+ ID_CB_POINT_MOVE_MODE , /**< Checkbox for point move mode. */
+ ID_SPIN_ROTATION , /**< Spin control for rotation. */
+ ID_EDIT_CONVERT_1 , /**< Convert to polygon. */
+ ID_EDIT_CONVERT_2 , /**< Convert to polyline. */
+ ID_EDIT_CONVERT_3 , /**< Convert to open interpolated spline. */
+ ID_EDIT_CONVERT_4 , /**< Convert to closed arc. */
+ ID_EDIT_CONVERT_5 , /**< Convert to open arc. */
+ ID_EDIT_CONVERT_6 , /**< Convert to closed approximated spl. */
+ ID_EDIT_CONVERT_7 , /**< Convert to open approximated spline. */
+ ID_EDIT_CONVERT_8 , /**< Convert to white filled dot. */
+ ID_EDIT_CONVERT_9 , /**< Convert to simple dot. */
+ ID_EDIT_CONVERT_A , /**< Convert to closed interpolated spl. */
+ ID_RESET_OPTIONS , /**< Reset options to default values. */
+ ID_COL_MOD_BORDER , /**< Modify border colour. */
+ ID_COL_RES_BORDER , /**< Reset border colour. */
+ ID_COL_MOD_BACKGROUND , /**< Modify background colour. */
+ ID_COL_RES_BACKGROUND , /**< Reset background colour. */
+ ID_COL_MOD_GRID , /**< Modify grid colour. */
+ ID_COL_RES_GRID , /**< Reset grid colour. */
+ ID_COL_MOD_PH , /**< Modify placement help colour. */
+ ID_COL_RES_PH , /**< Reset placement help colour. */
+ ID_COL_MOD_COPY , /**< Modify copy operation colour. */
+ ID_COL_RES_COPY , /**< Reset copy operation colour. */
+ ID_COL_MOD_MOVE , /**< Modify move operation colour. */
+ ID_COL_RES_MOVE , /**< Reset move operation colour. */
+ ID_COL_MOD_DELETE , /**< Modify delete operation colour. */
+ ID_COL_RES_DELETE , /**< Reset delete operation colour. */
+ ID_COL_MOD_GROUP , /**< Modify group candidates colour. */
+ ID_COL_RES_GROUP , /**< Reset group candidates colour. */
+ ID_COL_MOD_MISSING , /**< Modify missing image colour. */
+ ID_COL_RES_MISSING , /**< Reset missing image colour. */
+ ID_MOD_SPLINE , /**< Modify spline s value. */
+ ID_OPT_NEW_OBJECTS , /**< Options for new objects. */
+ ID_OPT_SCREEN , /**< Options for screen representation. */
+ };
+
+ /** Zoom level range.
+ */
+ enum {
+ ZOOM_LEVEL_MIN = -14 , /**< Minimum zoom level. */
+ ZOOM_LEVEL_MAX = 14 /**< Maximum zoom level. */
+ };
+
+ /* IMPORTANT: Number and order of entries (except IVI_MAX) must match
+ the number and order of entries in the default_values and
+ iv_keys arrays in the WxdkdrawFrameTools module!
+ */
+ /** Names for indices into the m_iv array.
+ */
+ enum {
+ IVI_BORDER_RED = 0 , /**< Border colour red component. */
+ IVI_BORDER_GREEN , /**< Border colour green component. */
+ IVI_BORDER_BLUE , /**< Border colour blue component. */
+ IVI_BG_RED , /**< Background colour red. */
+ IVI_BG_GREEN , /**< Background colour green. */
+ IVI_BG_BLUE , /**< Background colour blue. */
+ IVI_GRID_RED , /**< Grid colour red. */
+ IVI_GRID_GREEN , /**< Grid colour green. */
+ IVI_GRID_BLUE , /**< Grid colour blue. */
+ IVI_PH_RED , /**< Placement help colour red. */
+ IVI_PH_GREEN , /**< Placement help colour green. */
+ IVI_PH_BLUE , /**< Placement help colour blue. */
+ IVI_M_COPY_RED , /**< Copy markup colour red. */
+ IVI_M_COPY_GREEN , /**< Copy markup colour green. */
+ IVI_M_COPY_BLUE , /**< Copy markup colour blue. */
+ IVI_M_MOVE_RED , /**< Move markup colour red. */
+ IVI_M_MOVE_GREEN , /**< Move markup colour green. */
+ IVI_M_MOVE_BLUE , /**< Move markup colour blue. */
+ IVI_M_DEL_RED , /**< Delete markup colour red. */
+ IVI_M_DEL_GREEN , /**< Delete markup colour green. */
+ IVI_M_DEL_BLUE , /**< Delete markup colour blue. */
+ IVI_M_GROUP_RED , /**< Group markup colour red. */
+ IVI_M_GROUP_GREEN , /**< Group markup colour green. */
+ IVI_M_GROUP_BLUE , /**< Group markup colour blue. */
+ IVI_MISSIMG_RED , /**< Missing image border red. */
+ IVI_MISSIMG_GREEN , /**< Missing image border green. */
+ IVI_MISSIMG_BLUE , /**< Missing image border blue. */
+ IVI_XS_SUBSEGS , /**< X-spline sub segments. */
+ IVI_FONT_EXACT , /**< Flag: Use exact fonts. */
+ IVI_DOT_DIAMETER_FILLED , /**< Diameter filled dots. */
+ IVI_DOT_DIAMETER_WHITE , /**< Diameter white filled dots. */
+ IVI_ARROWHEAD_LENGTH , /**< Default arrowhead length. */
+ IVI_ARROWHEAD_WIDTH , /**< Default arrowhead width. */
+ IVI_STYLE_VALUE , /**< Default style value. */
+ IVI_MITER_LIMIT , /**< Miter limit. */
+ IVI_REDUCE_MARKUP_POINTS , /**< Reduce markup point radius. */
+ IVI_D_LAYER , /**< Default layer for new objects. */
+ IVI_D_LINE_COL_RED , /**< Default line colour red comp. */
+ IVI_D_LINE_COL_GREEN , /**< Default line colour green comp. */
+ IVI_D_LINE_COL_BLUE , /**< Default line colour blue comp. */
+ IVI_D_LINEWIDTH , /**< Default line width. */
+ IVI_D_LINESTYLE , /**< Default line style. */
+ IVI_D_STYLE_VALUE , /**< Default style value. */
+ IVI_D_JOIN_STYLE , /**< Default line join style. */
+ IVI_D_MITER_LIMIT , /**< Default miter limit. */
+ IVI_D_CAP_STYLE , /**< Default line cap style. */
+ IVI_D_AHF_TYPE , /**< Default arrowhead forward type. */
+ IVI_D_AHF_LENGTH , /**< Default arrowhead forward lgt. */
+ IVI_D_AHF_WIDTH , /**< Default arrowhead forward width. */
+ IVI_D_AHB_TYPE , /**< Default arrowhead backward type. */
+ IVI_D_AHB_LENGTH , /**< Default arrowhead backward lgt. */
+ IVI_D_AHB_WIDTH , /**< Default arrowhead backward wdth. */
+ IVI_D_FILL_COL_RED , /**< Default fill colour red comp. */
+ IVI_D_FILL_COL_GREEN , /**< Default fill colour green comp. */
+ IVI_D_FILL_COL_BLUE , /**< Default fill colour blue comp. */
+ IVI_D_FILL_STYLE , /**< Default fill style. */
+ IVI_D_TEXT_LATEX , /**< Default LaTeX option for text. */
+ IVI_D_TEXT_ALIGN , /**< Default text align. */
+ IVI_D_TEXT_FONT , /**< Default text font. */
+ IVI_D_TEXT_SIZE , /**< Default text size. */
+ IVI_C_GRID , /**< Enable or disable grid. */
+ IVI_C_PH , /**< Enable or disable place help. */
+ IVI_C_COR_POSITION , /**< Correct position after zoom out. */
+ IVI_MAX /**< Number of indices in the list. */
+ };
+ /* IMPORTANT: Number and order of entries (except IVI_MAX) must match
+ the number and order of entries in the default_values and
+ iv_keys arrays in the WxdkdrawFrameTools module!
+ */
+
+ private:
+
+ /* Frame private members */
+
+ /** Event table for frame.
+ */
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
+ DECLARE_EVENT_TABLE()
+#endif
+
+ protected:
+
+ /* frame protected members */
+
+ /** Drawing object containing default style information.
+ */
+ Wxd_object_t m_oStyle;
+
+ /** Border object to show drawing size.
+ */
+ Wxd_object_t m_oBorder;
+
+ /** Status structure to read WXD file.
+ */
+ wxdrd_status_t m_oStatusReader;
+
+ /** Status structure to write WXD file.
+ */
+ wxdwr_status_t m_oStatusWriter;
+
+ /** Integer values for different purposes, configurable.
+ */
+ int m_iv[IVI_MAX];
+
+ /** Coefficients used to create stipple bitmaps,
+ recalculated on zoom level changes or file reload.
+ 0: Length equivalent for 3.6 / sqrt(3)
+ 1: Length equivalent for 7.2
+ 2: Length equivalent for 3.6 * sqrt(2)
+ 3: Length equivalent for 14.4
+ 4: Length equivalent for 3.6
+ 5: Length equivalent for 21.6
+ 6: Length equivalent for 14.54 (width of large fish scale)
+ 7: Length equivalent for 3.7 (height of large fish scale)
+ 8: Length equivalent for 14.4 * sqrt(3)
+ 9: X difference at start of large fish scale
+ 10: Y difference at start of large fish scale
+ 11: X difference at end of large fish scale
+ 12: Y difference at end of large fish scale
+ 13: X difference at start of small fish scale
+ 14: Y difference at start of small fish scale
+ 15: X difference at end of small fish scale
+ 16: Y difference at end of small fish scale
+ 17...19 unused
+ */
+ double m_dPatterns[20];
+
+ /** Constant factors calculated once in the constructor.
+ 0: sqrt(3)
+ 1: dx/dt at 0 factor for large fish scales
+ 2: dy/dt at 0 factor for large fish scales
+ 3: dx/dt at 1 factor for large fish scales
+ 4: dy/dt at 1 factor for large fish scales
+ 5: dx/dt at 0 factor for small fish scales
+ 6: dy/dt at 0 factor for small fish scales
+ 7: dx/dt at 1 factor for small fish scales
+ 8: dy/dt at 1 factor for small fish scales
+ 9...15 unused
+ */
+ double m_dFactors[16];
+
+ /** Error report used in event processing.
+ */
+ dk4_er_t m_oErrorReport;
+
+ /** Protect m_bIsFirstIdle against multiple access.
+ */
+ wxCriticalSection csIsFirstIdle;
+
+ /** Original ellipse/circle data before moving a point.
+ */
+ Wxd_det_ellipse_t m_ellPointMoveOri;
+
+ /** Full path name.
+ */
+ wxString m_sFileFull;
+
+ /** Short file name without leading directory.
+ */
+ wxString m_sFileShort;
+
+ /** Directory file resides in.
+ */
+ wxString m_sFileDir;
+
+ /** Directory previous embedded image was taken from.
+ */
+ wxString m_sImageDir;
+
+ /** Directory previous library element was taken from.
+ */
+ wxString m_sLibraryDir;
+
+ /** Short name of previous library element.
+ */
+ wxString m_sLibraryShort;
+
+ /** Original drawing size.
+ */
+ Wxd_bb_t m_oOldSize;
+
+ /** Raw mouse position (not aligned to grid).
+ */
+ Wxd_point_t m_ptMousePosRaw;
+
+ /** Mouse position aligned to grid.
+ */
+ Wxd_point_t m_ptMousePosGrid;
+
+ /** Start point of copy or move operation.
+ */
+ Wxd_point_t m_ptMouseMoveStart;
+
+ /** Difference in copy or move operation,
+ (m_ptMousePosGrid - m_ptMouseMoveStart).
+ */
+ Wxd_point_t m_ptMouseMoveDiff;
+
+ /** Original position of the point currently moved.
+ Required to compute differences or to restore
+ position on abort.
+ */
+ Wxd_point_t m_ptPointMoveOri;
+
+ /** Mouse position on control in pixels.
+ */
+ wxSize m_szMousePosPix;
+
+ /** Object currently to edit with style elements.
+ */
+ Wxd_object_t *m_pStyle;
+
+ /** Current object, used for several purposes:
+ * S_NOOP: Selection candidate.
+ * S_POLY_FURTHER: Polyline we are editing.
+ */
+ Wxd_object_t *m_pCurrent;
+
+ /** Localized texts.
+ */
+ wxChar const * const *sTexts;
+
+ /** Non-localized texts.
+ */
+ wxChar const * const *sNlWx;
+
+ /** Non-localized texts.
+ */
+ dkChar const * const *sNlDk;
+
+ /** Drawing opened in this frame.
+ */
+ Wxd_drawing_t *m_pDrw;
+
+ /** Current operation state.
+ */
+ int m_iState;
+
+ /** Accumulated wheel rotation with control key pressed.
+ */
+ int m_iWheelControl;
+
+ /** Accumulated wheel rotation with shift key pressed.
+ */
+ int m_iWheelShift;
+
+ /** Accumulated wheel rotation with not key pressed.
+ */
+ int m_iWheelNormal;
+
+ /** Index of current point to edit.
+ */
+ uint16_t m_uCurrent;
+
+ /** Object we are about to create or to convert to.
+ */
+ int8_t m_iObjToCreate;
+
+ /** Flag for different purposes:
+ * Spline just created is interpolated (otherwise approximated).
+ * Box just created is a rounded box (otherwise rectangular).
+ * Rotation in negative direction.
+ */
+ bool m_bSplineInterpolated;
+
+ /** Flag: Current mouse position is an acceptable point.
+ */
+ bool m_bAcceptablePoint;
+
+ /** Flag: Is first idle.
+ */
+ bool m_bIsFirstIdle;
+
+ /** Flag: Windows is active an event handlers can be executed.
+ This flag is set in the reaction on the first idle event
+ and reset on closing the application.
+ */
+ bool m_bActive;
+
+ /** Flag: Drawing was modified (there are unsaved changes).
+ */
+ bool m_bModified;
+
+ /** Flag: File name known for output file.
+ */
+ bool m_bHaveName;
+
+ /** Flag: Mouse position is known.
+ */
+ bool m_bMousePos;
+
+ /** Flag: Successfully calculated difference for copy/shift operation.
+ */
+ bool m_bMouseDiff;
+
+ /** Snap point to move to the mouse position (otherwise relative
+ movement).
+ */
+ bool m_bSnap;
+
+ /** Flag: Update frame at end of event handler.
+ */
+ bool m_bUpdate;
+
+ /** Flag: Append new point after current point (true)
+ or insert before current point (false).
+ */
+ bool m_bAppendPoint;
+
+ /** Flag: Have corner point to move when changing drawing size.
+ */
+ bool m_bHaveCornerPoint;
+
+ /** Flip vertically (true) or horizontally (false).
+ */
+ bool m_bVerticalFlip;
+
+ /* __CHANGE__ 011: Add further member variables.
+ */
+
+%% class end
+
+ public:
+
+ /* frame public members */
+
+ /** Names for bitmaps to visualize line styles.
+ */
+ static const char ** const ms_ls_images[];
+
+ /** Names for bitmaps to visualize line cap styles.
+ */
+ static const char ** const ms_lc_images[];
+
+ /** Names for bitmaps to visualize line join styles.
+ */
+ static const char ** const ms_lj_images[];
+
+ /** Names for bitmaps to visualize arrow types.
+ */
+ static const char ** const ms_arrow_images[];
+
+ /** Names for bitmaps to visualize fill patterns.
+ */
+ static const char ** const ms_fs_images[];
+
+ /** Names for bitmaps to visualize text alignments.
+ */
+ static const char ** const ms_ta_images[];
+
+ /** Names for bitmaps to visualize fonts.
+ */
+ static const char ** const ms_fn_images[];
+
+ /** Constructor.
+ @param wxid Window ID.
+ @param applicationHelper Application helper object.
+ @param hc Help controller for online help.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @param localizedTexts Localized wxChar texts.
+ @param nlWx Non-localized wxChar texts.
+ @param nlDk Non-localized dkChar texts.
+ */
+ WxdkdrawFrame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ int argc,
+ wxChar **argv,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk
+ );
+
+ /** Destructor.
+ */
+ ~WxdkdrawFrame();
+
+ /** Check whether we can close the window.
+ @param isLast Flag: Last main window to close.
+ */
+ bool
+ CanClose(bool isFinal);
+
+ /** Handler for File/Exit.
+ @param event Event to process.
+ */
+ void
+ OnQuit(wxCommandEvent & event);
+
+ /** Handler for Help/About.
+ @param event Event to process.
+ */
+ void
+ OnAbout(wxCommandEvent & event);
+
+ /** Handler for Help/Contents.
+ @param event Event to process.
+ */
+ void
+ OnHelpContents(wxCommandEvent & event);
+
+ /** Handler for idle events.
+ @param event Event to process.
+ */
+ void
+ OnIdle(wxIdleEvent & event);
+
+ /** Handler File / New.
+ @param event Event to process.
+ */
+ void
+ OnFileNew(wxCommandEvent & event);
+
+ /** Handler File / Open.
+ @param event Event to process.
+ */
+ void
+ OnFileOpen(wxCommandEvent & event);
+
+ /** Save drawing to file.
+ @return True on success, false on error.
+ */
+ bool
+ SaveToFile(void);
+
+ /** Mark the drawing as modified or not modified.
+ @param f New flag value.
+ */
+ void
+ SetModified(bool f = true);
+
+ /** Handler File / Save.
+ @param event Event to process.
+ */
+ void
+ OnFileSave(wxCommandEvent & event);
+
+ /** Handler File / Save as.
+ @param event Event to process.
+ */
+ void
+ OnFileSaveAs(wxCommandEvent & event);
+
+ /** On zoom out correct the center point if necessary.
+ */
+ void
+ CorrectCenterPointIfNecessary(void);
+
+ /** Zoom level was changed.
+ @param bZoomOut Zoom change was "zoom out".
+ */
+ void
+ ZoomChanged(bool bZoomOut = false);
+
+ /** Adjust scrollbars after zoom or position change.
+ */
+ void
+ AdjustScrollbars(void);
+
+ /** Handler Zoom / In.
+ @param event Event to process.
+ */
+ void
+ OnZoomIn(wxCommandEvent & event);
+
+ /** Handler Zoom / Out.
+ @param event Event to process.
+ */
+ void
+ OnZoomOut(wxCommandEvent & event);
+
+ /** Handler Zoom / Reset.
+ @param event Event to process.
+ */
+ void
+ OnZoom100(wxCommandEvent & event);
+
+ /** Start polygon or polyline.
+ @param ot Object type to start, WXD_OT_POLYLINE or WXD_OT_POLYGON.
+ */
+ void
+ OnPolygonPolyline(int8_t ot);
+
+ /** Handler for Add polyline.
+ @param event Event to process.
+ */
+ void
+ OnAddPolyline(wxCommandEvent & event);
+
+
+ /** Handler for Add polygon.
+ @param event Event to process.
+ */
+ void
+ OnAddPolygon(wxCommandEvent & event);
+
+ /** Start creation of rectangular box.
+ @param bRounded Rounded corners (rectangular otherwise).
+ */
+ void
+ OnRectangleBox(bool bRounded);
+
+ /** Handler for Add rectangle.
+ @param event Event to process.
+ */
+ void
+ OnAddRectangle(wxCommandEvent & event);
+
+ /** Handler for Add box.
+ @param event Event to process.
+ */
+ void
+ OnAddBox(wxCommandEvent & event);
+
+ /** Handler for Add circle.
+ @param event Event to process.
+ */
+ void
+ OnAddCircle(wxCommandEvent & event);
+
+ /** Handler for Add ellipse.
+ @param event Event to process.
+ */
+ void
+ OnAddEllipse(wxCommandEvent & event);
+
+ /** Handler for Add open arc.
+ @param event Event to process.
+ */
+ void
+ OnAddArcOpen(wxCommandEvent & event);
+
+ /** Handler for Add closed arc.
+ @param event Event to process.
+ */
+ void
+ OnAddArcClosed(wxCommandEvent & event);
+
+ /** Start creation of new spline.
+ @param ot Object type (open or closed spline).
+ @param bInterpolated Interpolated or approximated.
+ */
+ void
+ OnSpline(int8_t ot, bool bInterpolated);
+
+ /** Handler for Add open approximated spline.
+ @param event Event to process.
+ */
+ void
+ OnAddSplineAO(wxCommandEvent & event);
+
+ /** Handler for Add closed approximated spline.
+ @param event Event to process.
+ */
+ void
+ OnAddSplineAC(wxCommandEvent & event);
+
+ /** Handler for Add open interpolated spline.
+ @param event Event to process.
+ */
+ void
+ OnAddSplineIO(wxCommandEvent & event);
+
+ /** Handler for Add closed interpolated spline.
+ @param event Event to process.
+ */
+ void
+ OnAddSplineIC(wxCommandEvent & event);
+
+ /** Handler for Add dot.
+ @param event Event to process.
+ */
+ void
+ OnAddDot(wxCommandEvent & event);
+
+ /** Handler for Add white filled dot.
+ @param event Event to process.
+ */
+ void
+ OnAddWhiteDot(wxCommandEvent & event);
+
+ /** Handler for Add text label.
+ @param event Event to process.
+ */
+ void
+ OnAddTextlabel(wxCommandEvent & event);
+
+ /** Handler for Add image.
+ @param event Event to process.
+ */
+ void
+ OnAddImage(wxCommandEvent & event);
+
+ /** Inner function to add library element.
+ */
+ void
+ AddLibelem(void);
+
+ /** Handler for Add library element.
+ @param event Event to process.
+ */
+ void
+ OnAddLibelem(wxCommandEvent & event);
+
+ /** Handler for Edit / copy.
+ @param event Event to process.
+ */
+ void
+ OnEditCopy(wxCommandEvent & event);
+
+ /** Handler for Edit / move.
+ @param event Event to process.
+ */
+ void
+ OnEditMove(wxCommandEvent & event);
+
+ /** Handler for Edit / delete.
+ @param event Event to process.
+ */
+ void
+ OnEditDelete(wxCommandEvent & event);
+
+ /** Handler for Edit / Move point.
+ @param event Event to process.
+ */
+ void
+ OnEditPointMove(wxCommandEvent & event);
+
+ /** Handler for Edit / Add point.
+ @param event Event to process.
+ */
+ void
+ OnEditPointAdd(wxCommandEvent & event);
+
+ /** Handler for Edit / Delete point.
+ @param event Event to process.
+ */
+ void
+ OnEditPointDelete(wxCommandEvent & event);
+
+ /** Handler for Edit / Details.
+ @param event Event to process.
+ */
+ void
+ OnEditDetails(wxCommandEvent & event);
+
+ /** Handler for Edit / Group.
+ @param event Event to process.
+ */
+ void
+ OnEditGroup(wxCommandEvent & event);
+
+ /** Handler for Edit / Group.
+ @param event Event to process.
+ */
+ void
+ OnEditGroup3(wxCommandEvent & event);
+
+ /** Handler for Edit / Ungroup.
+ @param event Event to process.
+ */
+ void
+ OnEditUngroup(wxCommandEvent & event);
+
+ /** Handler for Edit / Flip horizontally.
+ @param event Event to process.
+ */
+ void
+ OnEditFlipH(wxCommandEvent & event);
+
+ /** Handler for Edit / Flip vertically.
+ @param event Event to process.
+ */
+ void
+ OnEditFlipV(wxCommandEvent & event);
+
+ /** Handler for Rotate left.
+ @param event Event to process.
+ */
+ void
+ OnEditRotateLeft(wxCommandEvent & event);
+
+ /** Handler for Rotate right.
+ @param event Event to process.
+ */
+ void
+ OnEditRotateRight(wxCommandEvent & event);
+
+ /** Handler for Edit / Change drawing size.
+ @param event Event to process.
+ */
+ void
+ OnEditChangeSize(wxCommandEvent & event);
+
+ /** Handler for View / Layers / Activate all.
+ @param event Event to process.
+ */
+ void
+ OnLayersAll(wxCommandEvent & event);
+
+ /** Handler for View / Layers / Layer manager.
+ @param event Event to process.
+ */
+ void
+ OnLayerManager(wxCommandEvent & event);
+
+ /** Center view.
+ */
+ void
+ OnCenterViewFunction(void);
+
+ /** Handler for View / center view.
+ @param event Event to process.
+ */
+ void
+ OnCenterView(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert1(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert2(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert3(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert4(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert5(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert6(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert7(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert8(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvert9(wxCommandEvent & event);
+
+ /** Handler for conversion.
+ @param event Event to process.
+ */
+ void
+ OnConvertA(wxCommandEvent & event);
+
+ /** Handler for options reset.
+ @param event Event to process.
+ */
+ void
+ OnResetOptions(wxCommandEvent & event);
+
+ /** Handler for "modify spline s value" button or menu item.
+ */
+ void
+ OnModifySplineValue(wxCommandEvent & event);
+
+ /** Handler for "defaults for new objects" menu item.
+ @param event Event to process.
+ */
+ void
+ OnOptionsNewObjects(wxCommandEvent & event);
+
+ /** Handler for "screen representation options" menu item.
+ @param event Event to process.
+ */
+ void
+ OnOptionsScreenRepresentation(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourBorderModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourBorderReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourBackgroundModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourBackgroundReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourGridModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourGridReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourPlacementModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourPlacementReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourCopyModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourCopyReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourMoveModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourMoveReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourDeleteModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourDeleteReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourGroupModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourGroupReset(wxCommandEvent & event);
+
+ /** Handler for colour modification.
+ @param event Event to process.
+ */
+ void
+ OnColourMissingModify(wxCommandEvent & event);
+
+ /** Handler for colour reset.
+ @param event Event to process.
+ */
+ void
+ OnColourMissingReset(wxCommandEvent & event);
+
+ /** Handler for Grid on/off.
+ @param event Event to process.
+ */
+ void
+ OnGridOnOff(wxCommandEvent & event);
+
+ /** Handler for Grid unit.
+ @param event Event to process.
+ */
+ void
+ OnGridUnit(wxCommandEvent & event);
+
+ /** Handler for Grid base.
+ @param event Event to process.
+ */
+ void
+ OnGridBase(wxCommandEvent & event);
+
+ /** Handler for placement help checkbox.
+ @param event Event to process.
+ */
+ void
+ OnPlacementHelp(wxCommandEvent & event);
+
+ /** Handler for layer change.
+ @param event Event to process.
+ */
+ void
+ OnStyleLayer(wxSpinEvent & event);
+
+ /** Handler for line colour change.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineColour(wxCommandEvent & event);
+
+ /** Handler for line width change.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineWidth(wxSpinEvent & event);
+
+ /** Handler for line style button.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineStyle(wxCommandEvent & event);
+
+ /** Handler for line cap.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineCap(wxCommandEvent & event);
+
+ /** Handler for line width change.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineJoin(wxCommandEvent & event);
+
+ /** Handler for arrowhead forward button.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineArrowF(wxCommandEvent & event);
+
+ /** Handler for arrowhead backward button.
+ @param event Event to process.
+ */
+ void
+ OnStyleLineArrowB(wxCommandEvent & event);
+
+ /** Handler for line width change.
+ @param event Event to process.
+ */
+ void
+ OnStyleFillColour(wxCommandEvent & event);
+
+ /** Handler for fill pattern change.
+ @param event Event to process.
+ */
+ void
+ OnStyleFillPattern(wxCommandEvent & event);
+
+ /** Handler for line width change.
+ @param event Event to process.
+ */
+ void
+ OnStyleTextLatex(wxCommandEvent & event);
+
+ /** Handler for text align change.
+ @param event Event to process.
+ */
+ void
+ OnStyleTextAlign(wxCommandEvent & event);
+
+ /** Handler for text font change.
+ @param event Event to process.
+ */
+ void
+ OnStyleTextFont(wxCommandEvent & event);
+
+ /** Handler for text size change.
+ @param event Event to process.
+ */
+ void
+ OnStyleTextSize(wxSpinEvent & event);
+
+ /** Handler for rotation spin control.
+ @param event Event to process.
+ */
+ void
+ OnSpinRotation(wxSpinEvent & event);
+
+ /** Horizontal scrollbar handler.
+ @param event Event to process.
+ */
+ void
+ OnScrollH(wxScrollEvent & event);
+
+ /** Vertical scrollbar handler.
+ @param event Event to process.
+ */
+ void
+ OnScrollV(wxScrollEvent & event);
+
+ /** Require a redraw.
+ Only to be executed between BeginEventHandling()
+ and EndEventHandling().
+ @param level Redraw level to require.
+ */
+ void
+ RequireRedraw(int level);
+
+ /** Update text if new font was choosen.
+ @param pobj Modified text object.
+ @param bRedraw Schedule redraw.
+ */
+ void
+ UpdateTextForFont(Wxd_object_t *pobj, bool bRedraw = true);
+
+ /** Set text for mouse messages when entering a new state.
+ @param st New state to enter.
+ */
+ void
+ SetMouseAndStatusTexts(int st);
+
+ /* __CHANGE__ 014: Add further methods.
+ */
+
+ /** Attempt to update all fonts.
+ */
+ void
+ UpdateFonts(void);
+
+ protected:
+
+ /* frame protected methods */
+
+ /** Transfer style information from object to GUI elements.
+ @param refresh Flag: Refresh GUI elements explicitly.
+ */
+ void
+ StyleToGUI(bool refresh = true);
+
+ /** Set style object (object to modify using the style GUI elements).
+ @param pObj Object to modify.
+ */
+ void
+ SetStyleObject(Wxd_object_t *pObj = NULL, bool bUpdate = true);
+
+ /** Check whether the frame is up and initialized to handle events.
+ On success, initialize things to handle one event.
+ @return True to start event handling, false to skip.
+ */
+ bool
+ BeginEventHandling(void);
+
+ /** Start handling of events from control.
+ */
+ void
+ StartEventHandling(void);
+
+ /** Report modifications while reading a file at the end
+ of event processing.
+ */
+ void
+ ModificationReportingAtEventEnd(void);
+
+ /** Do error reporting at end of event handling.
+ */
+ void
+ ErrorReportingAtEventEnd(void);
+
+ /** End handling one event. If necessary call Update() on the frame.
+ */
+ void
+ EndEventHandling(void);
+
+ /** Update one stipple structure.
+ @param psti Stipple structure to update.
+ */
+ void
+ UpdateOneStipple(Wxd_stipple_t *psti);
+
+ /** Update internal pattern coefficients in m_dPatterns.
+ Recalculation necessary after changing zoom factor and/or
+ loading a new file.
+ */
+ void
+ UpdatePatternCoefficients(void);
+
+ /** Update stipple bitmaps after changing zoom or loading
+ a file.
+ */
+ void
+ UpdateStipples(void);
+
+ /** Attempt to read all images not yet read.
+ */
+ void
+ UpdateImages(void);
+
+ /** Update one font.
+ @param pfont Font to update.
+ */
+ void
+ UpdateOneFont(Wxd_font_t *pfont);
+
+ /** Find font structure, create new one if necessary.
+ @param find Font index.
+ @param fsz Font size in pt.
+ @return Valid pointer to font structure on success, NULL on error.
+ */
+ Wxd_font_t *
+ FindFont(uint8_t find, uint16_t fsz);
+
+ /** Read a drawing from file.
+ @param fn File name to read.
+ @return Pointer to new drawing on success, NULL on error.
+ */
+ Wxd_drawing_t *
+ ReadDrawingFromFile(wxString & fn);
+
+ /** A new drawing was loaded, adjust GUI.
+ */
+ void
+ DrawingLoaded(void);
+
+ /** Find suitable size for colour viewers, derived from
+ the height of the layer number spin control.
+ @return Size suggestion for colour viewer.
+ */
+ wxSize
+ ColourViewSize(void);
+
+ /** Complete setup on first idle event.
+ Using the first idle event ensures the window is already
+ shown on screen.
+ */
+ void
+ OnFirstIdle(void);
+
+ /** Copy default style values to m_iv array.
+ */
+ void
+ DefaultStyleToArray(void);
+
+ /** Get default style values from m_iv array.
+ */
+ void
+ DefaultStyleFromArray(void);
+
+ /** Load defaults.
+ */
+ void
+ LoadDefaults(void);
+
+ /** Load configuration.
+ */
+ void
+ LoadConfiguration(void);
+
+ /** Save configuration.
+ */
+ void
+ SaveConfiguration(void);
+
+ /** Reset configuration settings to default values.
+ */
+ void
+ ResetConfiguration(void);
+
+ /** Update the position labels.
+ @param havepos Flag: Position is known.
+ @param x X position if position is known.
+ @param y Y position if position is known.
+ */
+ void
+ UpdatePositionLabels(bool havepos, int32_t x, int32_t y);
+
+ /** Calculate drawing and grid position from mouse position.
+ @return True if position was changed, false if no change.
+ */
+ bool
+ UpdateGridPosition(void);
+
+ /** Retrieve mouse position, calculate drawing and grid position.
+ @param event Event to process.
+ @return True if position was changed, false if everything
+ unchanged.
+ */
+ bool
+ UpdateMousePosition(wxMouseEvent & event);
+
+ /** Move scrollbar position as action on mouse wheel.
+ @param sb Scrollbar to modify.
+ @param lines Number of lines to move.
+ @param vert Flag: Moving the vertical bar.
+ */
+ void
+ MoveScrollbar(wxScrollBar *sb, int lines, bool vert);
+
+ /** Check whether an object is selectable in the current state.
+ @param pobj Object to check.
+ @return True if object is selectable, false otherwise.
+ */
+ bool
+ ObjectSelectableInState(Wxd_object_t const *pobj);
+
+ /** Find object nearest to raw mouse coordinates (not grid-aligned).
+ @param gr Return group object instead of simple object.
+ @return Object if found or NULL.
+ */
+ Wxd_object_t *
+ FindNearestObject(bool gr = false);
+
+ /** End polyline drawing operation while waiting for first point.
+ @param bComplete End completely.
+ @param bSkip Skip data entered so far in operation.
+ */
+ void
+ EndOperationPolyFirst(void);
+
+ /** End polyline drawing operation if points exist.
+ @param bComplete End completely.
+ @param bSkip Skip data entered so far in operation.
+ */
+ void
+ EndOperationPolyFurther(bool bComplete, bool bSkip);
+
+ /** End spline drawing operation while waiting for first point.
+ */
+ void
+ EndOperationSplineFirst(void);
+
+ /** End spline drawing operation if points exist.
+ @param bComplete End completely.
+ @param bSkip Skip data entered so far in operation.
+ */
+ void
+ EndOperationSplineFurther(bool bComplete, bool bSkip);
+
+ /** End 2-point operation while waiting for second point.
+ @param ns Next state.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationTwoPointsSecond(int ns, bool bComplete);
+
+ /** End box drawing while waiting for first point.
+ */
+ void
+ EndOperationBoxFirst(void);
+
+ /** End box drawing while waiting for opposite point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationBoxOpposite(bool bComplete);
+
+ /** End circle drawing while waiting for center point.
+ */
+ void
+ EndOperationCircleCenter(void);
+
+ /** End circle drawing while waiting for radius point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationCircleRadius(bool bComplete);
+
+ /** End ellipse drawing while waiting for center point.
+ */
+ void
+ EndOperationEllipseCenter(void);
+
+ /** End ellipse drawing while waiting for bounding box corner point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationEllipseCorner(bool bComplete);
+
+ /** End arc drawing while waiting for start point.
+ */
+ void
+ EndOperationArc1(void);
+
+ /** End arc drawing while waiting for intermediate point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationArc2(bool bComplete);
+
+ /** End arc drawing while waiting for end point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationArc3(bool bComplete);
+
+ /** End dot drawing while waiting for point.
+ */
+ void
+ EndOperationDot(void);
+
+ /** End library element placement operation while waiting for point.
+ */
+ void
+ EndOperationLibelemPlace(void);
+
+ /** End point move operation while placing point.
+ */
+ void
+ EndOperationPointMovePlace(void);
+
+ /** End point add operation while placing point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationPointAddPlace(bool bComplete);
+
+ /** End point add operation while placing drawing corner point.
+ @param bComplete End completely.
+ */
+ void
+ EndOperationDrawingSizePlace(bool bComplete);
+
+ /** End recent operation.
+ @param bComplete End completely.
+ @param bSkip Skip data entered so far in operation.
+ */
+ void
+ EndOperation(bool bComplete = false, bool bSkip = false);
+
+ /** Move marker 2 marked objects into new group.
+ */
+ void
+ GroupNewForMarkedObjects(void);
+
+ /** Ungroup objects from group (resolve group).
+ @param pgrp Group to resolve.
+ */
+ void
+ UngroupObjects(Wxd_object_t *pgrp);
+
+ /** Check whether the current point is an acceptable point.
+ @return Test result.
+ */
+ bool
+ IsAcceptablePoint(void);
+
+ /** Reaction on mouse move in S_NOOP state.
+ */
+ void
+ MouseMoveNoop(void);
+
+ /** Reaction on mouse move in S_DELETE state.
+ */
+ void
+ MouseMoveDelete(void);
+
+ /** Reaction on mouse move in S_REGION_DELETE state.
+ */
+ void
+ MouseMoveRegionDelete(void);
+
+ /** Reaction on mouse move while selecting objects to move.
+ */
+ void
+ MouseMoveMoveSelect(void);
+
+ /** Reaction on mouse move while placing objects to move.
+ */
+ void
+ MouseMoveMovePlace(void);
+
+ /** Reaction on mouse move while selecting objects to copy.
+ */
+ void
+ MouseMoveCopySelect(void);
+
+ /** Reaction on mouse move while placing objects to copy.
+ */
+ void
+ MouseMoveCopyPlace(void);
+
+ /** Reaction on middle mouse key.
+ */
+ void
+ MouseMiddleDelete(void);
+
+ /** Reaction on left mouse click in S_NOOP state.
+ */
+ void
+ MouseLeftNoop(void);
+
+ /** Reaction on left mouse click in S_DELETE state.
+ */
+ void
+ MouseLeftDelete(void);
+
+ /** Reaction on left mouse click in S_REGION_DELETE state.
+ */
+ void
+ MouseLeftRegionDelete(void);
+
+ /** Reaction on left mouse click while selecting objects to move.
+ */
+ void
+ MouseLeftMoveSelect(void);
+
+ /** Reaction on left mouse click while placing objects to move.
+ */
+ void
+ MouseLeftMovePlace(void);
+
+ /** Reaction on left mouse click while selecting objects to copy.
+ */
+ void
+ MouseLeftCopySelect(void);
+
+ /** Reaction on left mouse click while placing objects to copy.
+ */
+ void
+ MouseLeftCopyPlace(void);
+
+ /** Reaction on mouse move in S_POLY_FIRST state.
+ */
+ void
+ MouseMovePolyFirst(void);
+
+ /** Reaction on mouse move in S_POLY_FURTHER state.
+ */
+ void
+ MouseMovePolyFurther(void);
+
+ /** Reaction on mouse left click in S_POLY_FIRST state.
+ */
+ void
+ MouseLeftPolyFirst(void);
+
+ /** Reaction on mouse left click in S_POLY_FURTHER state.
+ */
+ void
+ MouseLeftPolyFurther(void);
+
+ /** X-spline s value at end points.
+ @return S value.
+ */
+ double
+ SValueAtEnd(void);
+
+ /** Reaction on mouse movement in S_SPLINE_FIRST state.
+ */
+ void
+ MouseMoveSplineFirst(void);
+
+ /** Reaction on mouse movement in S_SPLINE_FURTHER state.
+ */
+ void
+ MouseMoveSplineFurther(void);
+
+ /** Reaction on mouse left click in S_SPLINE_FIRST state.
+ */
+ void
+ MouseLeftSplineFirst(void);
+
+ /** Reaction on mouse left click in S_SPLINE_FURTHER state.
+ */
+ void
+ MouseLeftSplineFurther(void);
+
+ /** Reaction on mouse move in S_ELLIPSE_CENTER state.
+ */
+ void
+ MouseMoveEllipseCenter(void);
+
+ /** Reaction on mouse left click in S_ELLIPSE_CENTER state.
+ */
+ void
+ MouseLeftEllipseCenter(void);
+
+ /** Reaction on mouse move in S_ELLIPSE_CORNER state.
+ */
+ void
+ MouseMoveEllipseCorner(void);
+
+ /** Reaction on mouse left click in S_ELLIPSE_CORNER state.
+ */
+ void
+ MouseLeftEllipseCorner(void);
+
+ /** Reaction on mouse move in S_ARC_1 state.
+ */
+ void
+ MouseMoveArc1(void);
+
+ /** Reaction on mouse left click in S_ARC_1 state.
+ */
+ void
+ MouseLeftArc1(void);
+
+ /** Reaction on mouse move in S_ARC_2 state.
+ */
+ void
+ MouseMoveArc2(void);
+
+ /** Reaction on mouse left click in S_ARC_2 state.
+ */
+ void
+ MouseLeftArc2(void);
+
+ /** Reaction on mouse move in S_ARC_3 state.
+ */
+ void
+ MouseMoveArc3(void);
+
+ /** Reaction on mouse left click in S_ARC_3 state.
+ */
+ void
+ MouseLeftArc3(void);
+
+ /** Set box details (bounding box from start point and current point).
+ The radius should be updated only while constructing a box,
+ not while moving a point.
+ @param bUpdateRadius Update radius.
+ */
+ void
+ SetBoxDetails(bool bUpdateRadius);
+
+ /** Reaction on mouse move in S_BOX_FIRST state.
+ */
+ void
+ MouseMoveBoxFirst(void);
+
+ /** Reaction on mouse move in S_BOX_OPPOSITE state.
+ */
+ void
+ MouseMoveBoxOpposite(void);
+
+ /** Reaction on mouse left click in S_BOX_FIRST state.
+ */
+ void
+ MouseLeftBoxFirst(void);
+
+ /** Reaction on mouse left click in S_BOX_OPPOSITE state.
+ */
+ void
+ MouseLeftBoxOpposite(void);
+
+ /** Reaction on mouse move in S_CIRCLE_CENTER state.
+ */
+ void
+ MouseMoveCircleCenter(void);
+
+ /** Calculate circle radius from center point to current point.
+ */
+ void
+ CalculateCircleRadius(uint32_t & rx, dk4_er_t *erp);
+
+ /** Calculate ellipse radii from center point to current point.
+ */
+ void
+ CalculateEllipseRadii(uint32_t & rx, uint32_t & ry, dk4_er_t *erp);
+
+ /** Reaction on mouse move in S_CIRCLE_RADIUS state.
+ */
+ void
+ MouseMoveCircleRadius(void);
+
+ /** Reaction on mouse left click in S_CIRCLE_CENTER state.
+ */
+ void
+ MouseLeftCircleCenter(void);
+
+ /** Reaction on mouse left click in S_CIRCLE_RADIUS state.
+ */
+ void
+ MouseLeftCircleRadius(void);
+
+ /** Reaction on mouse move in S_DOT state.
+ */
+ void
+ MouseMoveDot(void);
+
+ /** Reaction on mouse left click in S_DOT state.
+ */
+ void
+ MouseLeftDot(void);
+
+ /** Reaction on mouse move in S_TEXT state.
+ */
+ void
+ MouseMoveText(void);
+
+ /** Reaction on mouse left click in S_TEXT state.
+ */
+ void
+ MouseLeftText(void);
+
+ /** Reaction on mouse move in S_IMG_1 state.
+ */
+ void
+ MouseMoveImage1(void);
+
+ /** Reaction on mouse move in S_IMG_2 state.
+ */
+ void
+ MouseMoveImage2(void);
+
+ /** Reaction on mouse left click in S_IMG_1 state.
+ */
+ void
+ MouseLeftImage1(void);
+
+ /** Reaction on mouse left click in S_IMG_2 state.
+ */
+ void
+ MouseLeftImage2(void);
+
+ /** Reaction on mouse move in S_LIBELEM_PLACE state.
+ */
+ void
+ MouseMoveLibelemPlace(void);
+
+ /** Reaction on mouse left click in S_LIBELEM_PLACE state.
+ */
+ void
+ MouseLeftLibelemPlace(void);
+
+ /** Reaction on mouse move in S_MOVEPT_SELECT state.
+ */
+ void
+ MouseMovePointMoveSelect(void);
+
+ /** Reaction on mouse left click in S_MOVEPT_SELECT state.
+ */
+ void
+ MouseLeftPointMoveSelect(void);
+
+ /** Reaction on mouse move in S_MOVEPT_PLACE state.
+ */
+ void
+ MouseMovePointMovePlace(void);
+
+ /** Modify spline s value after moving a spline point.
+ @param pCurrent Spline object to modify.
+ @param uCurrent Index of point to modify.
+ */
+ void
+ ModifySplineValue(Wxd_object_t *pCurrent, uint16_t uCurrent);
+
+ /** Reaction on mouse left click in S_MOVEPT_PLACE state.
+ */
+ void
+ MouseLeftPointMovePlace(void);
+
+ /** Reaction on mouse move in S_DELPT state.
+ */
+ void
+ MouseMovePointDelete(void);
+
+ /** Reaction on mouse left click in S_DELPT state.
+ */
+ void
+ MouseLeftPointDelete(void);
+
+ /** Reaction on mouse move in S_ADDPT_SELECT state.
+ */
+ void
+ MouseMovePointAddSelect(void);
+
+ /** Reaction on mouse left click in S_ADDPT_SELECT state.
+ */
+ void
+ MouseLeftPointAddSelect(void);
+
+ /** Reaction on mouse move in S_ADDPT_PLACE state.
+ */
+ void
+ MouseMovePointAddPlace(void);
+
+ /** Reaction on mouse move in S_DRWSZ_SELECT state.
+ */
+ void
+ MouseMoveDrawingSizeSelect(void);
+
+ /** Reaction on mouse move in S_DRWSZ_PLACE state.
+ */
+ void
+ MouseMoveDrawingSizePlace(void);
+
+ /** Reaction on mouse left click in S_ADDPT_PLACE state.
+ */
+ void
+ MouseLeftPointAddPlace(void);
+
+ /** Reaction on mouse left click in S_DRWSZ_SELECT state.
+ */
+ void
+ MouseLeftDrawingSizeSelect(void);
+
+ /** Reaction on mouse left click in S_DRWSZ_PLACE state.
+ */
+ void
+ MouseLeftDrawingSizePlace(void);
+
+ /** Reaction on mouse movement click in S_FLIP state.
+ */
+ void
+ MouseMoveFlip(void);
+
+ /** Reaction on mouse left click in S_FLIP state.
+ */
+ void
+ MouseLeftFlip(void);
+
+ /** Reaction on mouse movement in S_GROUP_ONE state.
+ */
+ void
+ MouseMoveGroupOne(void);
+
+ /** Reaction on mouse left click in S_GROUP_ONE state.
+ */
+ void
+ MouseLeftGroupOne(void);
+
+ /** Mark objects in the selected rectangle for grouping.
+ */
+ void
+ MarkObjectsForRectangleGrouping(void);
+
+ /** Mark objects in the selected rectangle for deletion.
+ */
+ void
+ MarkObjectsForRectangleDeletion(void);
+
+ /** Reaction on mouse movement in S_GROUP_RECT_1 state.
+ */
+ void
+ MouseMoveGroupRect1(void);
+
+ /** Reaction on mouse left click in S_GROUP_RECT_1 state.
+ */
+ void
+ MouseLeftGroupRect1(void);
+
+ /** Reaction on mouse movement in S_GROUP_RECT_2 state.
+ */
+ void
+ MouseMoveGroupRect2(void);
+
+ /** Reaction on mouse left click in S_GROUP_RECT_2 state.
+ */
+ void
+ MouseLeftGroupRect2(void);
+
+ /** Reaction on mouse movement in S_UNGROUP state.
+ */
+ void
+ MouseMoveUngroup(void);
+
+ /** Reaction on mouse left click in S_UNGROUP state.
+ */
+ void
+ MouseLeftUngroup(void);
+
+ /** Reaction on mouse movement in S_DETAILS state.
+ */
+ void
+ MouseMoveDetails(void);
+
+ /** Reaction on mouse left click in S_DETAILS state.
+ */
+ void
+ MouseLeftDetails(void);
+
+ /** Object type conversion: spline to polyline or polygon.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertSplineToPoly(Wxd_object_t *pobj);
+
+ /** Object type conversion: arc to polyline or polygon.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertArcToPoly(Wxd_object_t *pobj);
+
+ /** Object type conversion: box to polyline or polygon.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertBoxToPoly(Wxd_object_t *pobj);
+
+ /** Object type conversion: polyline or polygon to spline.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertPolyToSpline(Wxd_object_t *pobj);
+
+ /** Object type conversion: spline to spline.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertSplineToSpline(Wxd_object_t *pobj);
+
+ /** Object type conversion: arc to spline.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertArcToSpline(Wxd_object_t *pobj);
+
+ /** Object type conversion: box to spline.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertBoxToSpline(Wxd_object_t *pobj);
+
+ /** Object type conversion: polyline or polygon to arc.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertPolyToArc(Wxd_object_t *pobj);
+
+ /** Object type conversion: spline to arc.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertSplineToArc(Wxd_object_t *pobj);
+
+ /** Object type conversion: circle to dot.
+ @param pobj Object to convert.
+ */
+ void
+ ConvertCircleToDot(Wxd_object_t *pobj);
+
+ /** Convert object to specified type.
+ */
+ void
+ ObjectTypeConversion(Wxd_object_t *pobj);
+
+ /** Reaction on mouse move in S_CONVERT state.
+ */
+ void
+ MouseMoveConvert(void);
+
+ /** Reaction on left mouse button in S_CONVERT state.
+ */
+ void
+ MouseLeftConvert(void);
+
+ /** Reaction on mouse move in S_ROTATE state.
+ */
+ void
+ MouseMoveRotate(void);
+
+ /** Reaction on left mouse button in S_ROTATE state.
+ */
+ void
+ MouseLeftRotate(void);
+
+ /** Reaction on mouse move in S_MOD_SPLINE state.
+ */
+ void
+ MouseMoveModspline(void);
+
+ /** Reaction on left mouse button in S_MOD_SPLINE state.
+ */
+ void
+ MouseLeftModspline(void);
+
+ /** Retrieve input from one text control, set pointer to
+ a dynamic copy of the input text.
+ @param ptxt Address of pointer to modify.
+ @param ptc Text control containing users input.
+ @param bKeepOld Keep old text if new text is empty.
+ */
+ void
+ ChangeOneLabelText(
+ wxChar **ptxt,
+ wxTextCtrl *ptc,
+ bool bKeepOld = true
+ );
+
+ /** Retrieve the input from text controls for export text and
+ screen text, save text to m_pCurrent.
+ @param ptce Text control for export text.
+ @param ptcs Text control for screen text.
+ @param bLaTeX LaTeX or non-LaTeX text.
+ */
+ void
+ RetrieveTextDetails(
+ wxTextCtrl *ptce,
+ wxTextCtrl *ptcs,
+ bool bLaTeX
+ );
+
+ /** Modify text label details (texts).
+ */
+ void
+ ModifyDetailsText(void);
+
+ /** Modify box details (corner radius).
+ */
+ void
+ ModifyDetailsBox(void);
+
+ /** Change image file for image object.
+ @param pa New file name to use.
+ */
+ void
+ ChangeImageFile(wxString & pa);
+
+ /** Modify image details (image file name and flags).
+ */
+ void
+ ModifyDetailsImage(void);
+
+ /** Modify filled dot details (diameter).
+ */
+ void
+ ModifyDetailsDotFilled(void);
+
+ /** Modify white dot details (diameter and line width).
+ */
+ void
+ ModifyDetailsDotWhite(void);
+
+ /** Handler for mouse entering control area.
+ @param event Event to process.
+ */
+ void
+ ControlMouseEnter(wxMouseEvent & event);
+
+ /** Handler for mouse leaving the control area.
+ @param event Event to process.
+ */
+ void
+ ControlMouseLeave(wxMouseEvent & event);
+
+ /** Handler for mouse move.
+ @param event Event to process.
+ */
+ void
+ ControlMouseMove(wxMouseEvent & event);
+
+ /** Handler for left mouse button click.
+ @param event Event to process.
+ */
+ void
+ ControlLeftMouseButton(wxMouseEvent & event);
+
+ /** Handler for right mouse button click.
+ @param event Event to process.
+ */
+ void
+ ControlRightMouseButton(wxMouseEvent & event);
+
+ /** Handler for middle mouse button click.
+ @param event Event to process.
+ */
+ void
+ ControlMiddleMouseButton(wxMouseEvent & event);
+
+ /** Handler for mouse wheell move.
+ @param event Event to process.
+ */
+ void
+ ControlMouseWheel(wxMouseEvent & event);
+
+ /** Use values from horizontal scrollbar.
+ */
+ void
+ UseScrollH(void);
+
+ /** Use values from vertical scrollbar.
+ */
+ void
+ UseScrollV(void);
+
+ /** Find directory where current file is saved.
+ @param dnb Buffer for directory.
+ @param dnsz Size of dnb (number of wxChar).
+ @param fn File name to find directory for.
+ @return True on success, false on error.
+ */
+ bool
+ FindDirectoryForFile(wxChar *dnb, size_t dnsz, wxString & fn);
+
+ /** Modify a colour.
+ @param ivi Index of color start in m_iv array.
+ @param rdl Redraw level required by operation.
+ */
+ void
+ ColorModify(size_t ivi, int rdl);
+
+ /** Modify a colour.
+ @param ivi Index of color start in m_iv array.
+ @param rdl Redraw level required by operation.
+ */
+ void
+ ColorReset(size_t ivi, int rdl);
+};
+
+%% header end
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module start
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+#if !defined(__WXMSW__)
+#include "gui-img/icons/wxdkdraw.xpm"
+#endif
+
+
+
+/* Bitmaps for Buttons and dialogs.
+*/
+#include "gui-img/wxdkdraw/buttons/wxd-bbox.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bbulletf.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bbullet.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bcarc.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bcircle.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bcopy.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bdel.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bellipse.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bfliph.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bflipv.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bgroup.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bgroup3.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bmove.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bmvpoint.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-boarc.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bpolygon.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bpolyline.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-brectangle.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bsplineca.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bsplineci.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bsplineoa.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bsplineoi.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-btext.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-blib.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bimg.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bungroup.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-baddpoint.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bdelpoint.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bdetails.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-borders.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-open.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-save.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-bmodifys.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-brotleft.xpm"
+#include "gui-img/wxdkdraw/buttons/wxd-brotright.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as00.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as01.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as02.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as03.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as04.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as05.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as06.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as07.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as08.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as09.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as10.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as11.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as12.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as13.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as14.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as15.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as16.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as17.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as18.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as19.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as20.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as21.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as22.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as23.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as24.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as25.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as26.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as27.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as28.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-as29.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs00.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs01.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs02.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs03.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs04.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs05.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs06.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs07.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs08.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs09.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs10.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs11.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs12.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs13.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs14.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs15.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs16.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs17.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs18.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs19.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs20.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs21.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs22.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-fs23.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-js1.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-js2.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-js3.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls1.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls2.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls3.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls4.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls5.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ls6.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-lc1.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-lc2.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-lc3.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ts00.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ts01.xpm"
+#include "gui-img/wxdkdraw/styles/wxd-ts02.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn00.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn01.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn02.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn03.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn04.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn05.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn06.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn07.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn08.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn09.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn10.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn11.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn12.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn13.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn14.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn15.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn16.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn17.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn18.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn19.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn20.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn21.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn22.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn23.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn24.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn25.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn26.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn27.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn28.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn29.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn30.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn31.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn32.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn33.xpm"
+#include "gui-img/wxdkdraw/font-names/wxd-fn34.xpm"
+
+
+
+$!trace-include
+
+
+
+
+/** Array containing the images to visualize line styles.
+*/
+const char ** const WxdkdrawFrame::ms_ls_images[] = {
+ xpm_wxd_ls1, xpm_wxd_ls2, xpm_wxd_ls3,
+ xpm_wxd_ls4, xpm_wxd_ls5, xpm_wxd_ls6
+};
+
+
+
+/** Array containing the images to visualize line cap styles.
+*/
+const char ** const WxdkdrawFrame::ms_lc_images[] = {
+ xpm_wxd_lc1, xpm_wxd_lc2, xpm_wxd_lc3
+};
+
+
+
+/** Array containing the images to visualize line join styles.
+*/
+const char ** const WxdkdrawFrame::ms_lj_images[] = {
+ xpm_wxd_js1, xpm_wxd_js2, xpm_wxd_js3
+};
+
+
+
+/** Array containing the images to visualize arrow heads.
+*/
+const char ** const WxdkdrawFrame::ms_arrow_images[] = {
+ xpm_wxd_as00, xpm_wxd_as01, xpm_wxd_as02, xpm_wxd_as03,
+ xpm_wxd_as04, xpm_wxd_as05, xpm_wxd_as06, xpm_wxd_as07,
+ xpm_wxd_as08, xpm_wxd_as09, xpm_wxd_as10, xpm_wxd_as11,
+ xpm_wxd_as12, xpm_wxd_as13, xpm_wxd_as14, xpm_wxd_as15,
+ xpm_wxd_as16, xpm_wxd_as17, xpm_wxd_as18, xpm_wxd_as19,
+ xpm_wxd_as20, xpm_wxd_as21, xpm_wxd_as22, xpm_wxd_as23,
+ xpm_wxd_as24, xpm_wxd_as25, xpm_wxd_as26, xpm_wxd_as27,
+ xpm_wxd_as28, xpm_wxd_as29
+};
+
+
+
+/** Array containing the images to visualize fill styles.
+*/
+const char ** const WxdkdrawFrame::ms_fs_images[] = {
+ xpm_wxd_fs00, xpm_wxd_fs01, xpm_wxd_fs02, xpm_wxd_fs03,
+ xpm_wxd_fs04, xpm_wxd_fs05, xpm_wxd_fs06, xpm_wxd_fs07,
+ xpm_wxd_fs08, xpm_wxd_fs09, xpm_wxd_fs10, xpm_wxd_fs11,
+ xpm_wxd_fs12, xpm_wxd_fs13, xpm_wxd_fs14, xpm_wxd_fs15,
+ xpm_wxd_fs16, xpm_wxd_fs17, xpm_wxd_fs18, xpm_wxd_fs19,
+ xpm_wxd_fs20, xpm_wxd_fs21, xpm_wxd_fs22, xpm_wxd_fs23,
+};
+
+
+
+/** Array containing the images to visualize text alignments.
+*/
+const char ** const WxdkdrawFrame::ms_ta_images[] = {
+ xpm_wxd_ts00, xpm_wxd_ts01, xpm_wxd_ts02
+};
+
+
+
+/** Array containing the images to visualize fonts.
+*/
+const char ** const WxdkdrawFrame::ms_fn_images[] = {
+ xpm_wxd_fn00, xpm_wxd_fn01, xpm_wxd_fn02, xpm_wxd_fn03, xpm_wxd_fn04,
+ xpm_wxd_fn05, xpm_wxd_fn06, xpm_wxd_fn07, xpm_wxd_fn08, xpm_wxd_fn09,
+ xpm_wxd_fn10, xpm_wxd_fn11, xpm_wxd_fn12, xpm_wxd_fn13, xpm_wxd_fn14,
+ xpm_wxd_fn15, xpm_wxd_fn16, xpm_wxd_fn17, xpm_wxd_fn18, xpm_wxd_fn19,
+ xpm_wxd_fn20, xpm_wxd_fn21, xpm_wxd_fn22, xpm_wxd_fn23, xpm_wxd_fn24,
+ xpm_wxd_fn25, xpm_wxd_fn26, xpm_wxd_fn27, xpm_wxd_fn28, xpm_wxd_fn29,
+ xpm_wxd_fn30, xpm_wxd_fn31, xpm_wxd_fn32, xpm_wxd_fn33, xpm_wxd_fn34
+};
+
+
+
+/** Subdirectory for wxdkdraw library in datadir.
+*/
+static const wxChar libsubdir[] = {
+#if DK4_HAVE_BACKSLASH_AS_SEP
+ wxT("\\dktools\\wxdkdraw\\library")
+#else
+ wxT("/dktools/wxdkdraw/library")
+#endif
+};
+
+
+%% constructor start
+WxdkdrawFrame::WxdkdrawFrame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ int argc,
+ wxChar **argv,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk
+) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid),
+ m_sFileFull(wxEmptyString),
+ m_sFileShort(wxEmptyString),
+ m_sFileDir(wxEmptyString),
+ m_sImageDir(wxEmptyString),
+ m_sLibraryDir(wxEmptyString),
+ m_sLibraryShort(wxEmptyString),
+ m_szMousePosPix(0,0)
+{
+ $? "+ WxdkdrawFrame::WxdkdrawFrame"
+ /* __CHANGE__ 012: Add further local variables.
+ */
+ wxString saGridChoices[] = { /* Choice texts for grid */
+ wxString(localizedTexts[156]),
+ wxString(localizedTexts[157])
+ };
+ wxString saGridBase[] = { /* Choice texts for grid base */
+ wxString(localizedTexts[158]),
+ wxString(localizedTexts[159])
+ };
+ wxString saPointMoveMode[] = {
+ wxString(localizedTexts[414]),
+ wxString(localizedTexts[415])
+ };
+ const wxChar *pShare; /* Shared directory */
+ double a1; /* Start angle for fish scales */
+ double a2; /* End angle for fish scales */
+ double kappa; /* Kappa value for fish scales */
+
+ /* __CHANGE__ 012: Initialize further local variables.
+ */
+
+ sTexts = localizedTexts;
+ sNlWx = nlWx;
+ sNlDk = nlDk;
+#if defined(__WXMSW__)
+ wxIcon wxdkdraw_icon(sNlWx[4]);
+#else
+ wxIcon wxdkdraw_icon(xpm_wxdkdraw);
+#endif
+
+ /* __CHANGE__ 011: Initialize further class members.
+ */
+ $? ". initialize m_oStatusReader"
+ wxdrd_status_init(&m_oStatusReader);
+ wxdwr_status_init(&m_oStatusWriter, pAppHelp->GetWxEncoding());
+ m_pDrw = NULL; /* Drawing is opened later in first idle event */
+ m_bIsFirstIdle = true; /* The idle event processed next is first at all */
+ m_bActive = false; /* Not yet active because no drawing yet */
+ m_bModified = false; /* No changes applied yet */
+ m_bHaveName = false; /* File name not known yet */
+ m_bMousePos = false; /* Mouse position not yet known */
+ m_bMouseDiff = false; /* Shift vector not yet known */
+ $? ". m_bMouseDiff = false"
+ m_iState = S_NOOP; /* No operation in progress */
+ m_iWheelControl = 0; /* No wheel movement with pressed control key */
+ m_iWheelShift = 0; /* No wheel movement with pressed shift key */
+ m_iWheelNormal = 0; /* No wheel movement yet */
+ m_uCurrent = 0U; /* No current point to edit */
+ m_iObjToCreate = WXD_OT_GROUP_END; /* Object type to create */
+ m_bSplineInterpolated = false;
+ m_bAcceptablePoint = false;
+ m_bUpdate = false; /* No need to update frame */
+ m_bAppendPoint = false;
+ m_bHaveCornerPoint = false;
+ m_ptMousePosRaw.x = (int32_t)0L;
+ m_ptMousePosRaw.y = (int32_t)0L;
+ m_ptMousePosGrid.x = (int32_t)0L;
+ m_ptMousePosGrid.y = (int32_t)0L;
+ m_ptMouseMoveStart.x = (int32_t)0L;
+ m_ptMouseMoveStart.y = (int32_t)0L;
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_ptPointMoveOri.x = (int32_t)0L;
+ m_ptPointMoveOri.y = (int32_t)0L;
+ wxdobj_det_init_ellipse(&m_ellPointMoveOri);
+ m_bSnap = true;
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ wxdobj_obj_init(&m_oStyle, WXD_OT_TEXT, NULL);
+ wxdobj_obj_init(&m_oBorder, WXD_OT_BOX, NULL);
+ dk4error_init(&m_oErrorReport);
+
+ /* Check first filename.
+ */
+ if (1 < argc) {
+ wxFileName wxfn(argv[1]);
+ if (wxfn.IsFileReadable()) {
+ m_sFileFull = wxfn.GetFullPath();
+ m_sFileShort = wxfn.GetFullName();
+ m_sFileDir = wxfn.GetPath();
+ m_bHaveName = true;
+ }
+ else {
+ m_sFileFull = wxfn.GetFullPath();
+ m_sFileShort = wxfn.GetFullName();
+ m_sFileDir = wxfn.GetPath();
+ m_bHaveName = true;
+ }
+ }
+
+%% constructor end
+ if(dkctGUILayoutOK) {
+ pShare = pAppHelp->GetWxsShare();
+ if (NULL != pShare) {
+ wxString basedir(pShare);
+ wxString subdir(libsubdir);
+ basedir.Append(subdir);
+ m_sLibraryDir = basedir;
+ }
+ ccLineColour->SetPlaceColourChooser();
+ ccFillColour->SetPlaceColourChooser();
+ ccLineColour->SetPalettePreferred();
+ ccFillColour->SetPalettePreferred();
+ SetTitle(sTexts[18]);
+ cbGridUnit->SetSelection(0);
+ cbGridBase->SetSelection(0);
+ cbGridOnOff->SetValue(true);
+ cbPH->SetValue(false);
+ cbPointMoveMode->SetSelection(0);
+ LoadConfiguration();
+ m_oStyle.aft = m_oStyle.abt = 0;
+ m_oStyle.afl = m_oStyle.abl = m_iv[IVI_ARROWHEAD_LENGTH];
+ m_oStyle.afw = m_oStyle.abw = m_iv[IVI_ARROWHEAD_WIDTH];
+ m_oStyle.sl = m_iv[IVI_STYLE_VALUE];
+ m_oBorder.pa = NULL;
+ m_oBorder.psti = NULL;
+ m_oBorder.play = NULL;
+ m_oBorder.lw = (uint16_t)2U;
+ m_oBorder.fc[0] = m_iv[IVI_M_MOVE_RED];
+ m_oBorder.fc[1] = m_iv[IVI_M_MOVE_GREEN];
+ m_oBorder.fc[2] = m_iv[IVI_M_MOVE_BLUE];
+ m_oBorder.sc[0] = m_iv[IVI_M_MOVE_RED];
+ m_oBorder.sc[1] = m_iv[IVI_M_MOVE_GREEN];
+ m_oBorder.sc[2] = m_iv[IVI_M_MOVE_BLUE];
+ m_oBorder.cs = DK4_GRA_LC_BUTTED;
+ m_oBorder.fs = WXD_FS_NONE;
+ m_oBorder.ls = WXD_LS_SOLID;
+ m_oBorder.sl = m_iv[IVI_STYLE_VALUE];
+ m_oBorder.js = WXD_LJ_MITERED;
+ m_oBorder.ml = 8;
+ m_oBorder.aft = m_oBorder.abt = 0;
+ m_oBorder.afl = m_oBorder.abl = m_iv[IVI_ARROWHEAD_LENGTH];
+ m_oBorder.afw = m_oBorder.abw = m_iv[IVI_ARROWHEAD_WIDTH];
+ m_oBorder.mark = 0x00;
+ m_oBorder.ot = WXD_OT_BOX;
+ m_oBorder.det.b.r = (uint32_t)0UL;
+ wxSize szscr = ::wxGetDisplayPPI();
+ drawco->m_ptRes.x = szscr.GetWidth();
+ drawco->m_ptRes.y = szscr.GetHeight();
+#if 0
+ RestorePosition();
+#endif
+ /*
+ Calculate factors later used for fish scale and other fill patterns
+ */
+ m_dFactors[0] = sqrt(3.0);
+ a1 = (216.1 * M_PI) / 180.0;
+ a2 = (323.9 * M_PI) / 180.0;
+ kappa = dk4gratool_kappa_for_angle(a2 - a1);
+ m_dFactors[1] =
+ (-1.0 * 9.0 * (a2 - a1) * kappa * sin(a1) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[2] =
+ (-1.0 * 9.0 * (a2 - a1) * kappa * cos(a1) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[3] =
+ (-1.0 * 9.0 * (a2 - a1) * kappa * sin(a2) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[4] =
+ (-1.0 * 9.0 * (a2 - a1) * kappa * cos(a2) * drawco->m_ptRes.x) / 72.0;
+ a1 = M_PI;
+ a2 = 2.0 * M_PI;
+ kappa = dk4gratool_kappa_for_angle(a2 - a1);
+ m_dFactors[5] =
+ (-1.0 * 3.6 * (a2 - a1) * kappa * sin(a1) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[6] =
+ (-1.0 * 3.6 * (a2 - a1) * kappa * cos(a1) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[7] =
+ (-1.0 * 3.6 * (a2 - a1) * kappa * sin(a2) * drawco->m_ptRes.x) / 72.0;
+ m_dFactors[8] =
+ (-1.0 * 3.6 * (a2 - a1) * kappa * cos(a2) * drawco->m_ptRes.x) / 72.0;
+#ifndef __WXGTK__
+ /*
+ Set focus to draw control (for mouse wheel)
+ */
+ drawco->SetFocus();
+#endif
+ /*
+ Transfer style information to GUI components
+ */
+ StyleToGUI(false);
+ }
+
+ /* __CHANGE__ 012: Release resources allocated by local variables.
+ */
+
+ $? "- WxdkdrawFrame::WxdkdrawFrame"
+}
+
+%% module end
+
+
+
+WxdkdrawFrame::~WxdkdrawFrame()
+{
+ $? "+ WxdkdrawFrame::~WxdkdrawFrame"
+
+ /* __CHANGE__ 011: Release resources allocated by further class members.
+ */
+ if (NULL != m_pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ m_pDrw = NULL;
+ }
+
+ $? "- WxdkdrawFrame::~WxdkdrawFrame"
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawFrameEvents.cpp b/support/dktools/WxdkdrawFrameEvents.cpp
new file mode 100644
index 0000000000..c0042cb635
--- /dev/null
+++ b/support/dktools/WxdkdrawFrameEvents.cpp
@@ -0,0 +1,4310 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawFrameEvents.cpt
+*/
+
+/** @file WxdkdrawFrameEvents.cpp The WxdkdrawFrameEvents module.
+*/
+
+
+#line 7 "WxdkdrawFrameEvents.cpt"
+
+#include "wxdkdraw.h"
+
+#ifndef DK4WXYESNODIALOG_H_INCLUDED
+#include "Dk4WxYesNoDialog.h"
+#endif
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+#ifndef WXDKDRAWDLGLINESTYLE_H_INCLUDED
+#include "WxdkdrawDlgLineStyle.h"
+#endif
+
+#ifndef WXDKDRAWDLGSTYLELENGTH_H_INCLUDED
+#include "WxdkdrawDlgStyleLength.h"
+#endif
+
+#ifndef WXDKDRAWDLGLINEJOIN_H_INCLUDED
+#include "WxdkdrawDlgLineJoin.h"
+#endif
+
+#ifndef WXDKDRAWDLGMITERLIMIT_H_INCLUDED
+#include "WxdkdrawDlgMiterLimit.h"
+#endif
+
+#ifndef WXDKDRAWDLGLINECAP_H_INCLUDED
+#include "WxdkdrawDlgLineCap.h"
+#endif
+
+#ifndef WXDKDRAWDLGARROWTYPE_H_INCLUDED
+#include "WxdkdrawDlgArrowType.h"
+#endif
+
+#ifndef WXDKDRAWDLGARROWSIZE_H_INCLUDED
+#include "WxdkdrawDlgArrowSize.h"
+#endif
+
+#ifndef WXDKDRAWDLGFILLSTYLE_H_INCLUDED
+#include "WxdkdrawDlgFillStyle.h"
+#endif
+
+#ifndef WXDKDRAWDLGTEXTALIGN_H_INCLUDED
+#include "WxdkdrawDlgTextAlign.h"
+#endif
+
+#ifndef WXDKDRAWDLGFONTNAME_H_INCLUDED
+#include "WxdkdrawDlgFontName.h"
+#endif
+
+#ifndef WXDKDRAWDLGLAYERMANAGER_H_INCLUDED
+#include "WxdkdrawDlgLayerManager.h"
+#endif
+
+#ifndef WXDKDRAWDLGTEXTINPUT_H_INCLUDED
+#include "WxdkdrawDlgTextInput.h"
+#endif
+
+#ifndef WXDKDRAWDLGSPLINEVALUE_H_INCLUDED
+#include "WxdkdrawDlgSplineValue.h"
+#endif
+
+#ifndef WXDKDRAWDLGOPTIONSNEWOBJECTS_H_INCLUDED
+#include "WxdkdrawDlgOptionsNewObjects.h"
+#endif
+
+#ifndef WXDKDRAWDLGOPTIONSSCREEN_H_INCLUDED
+#include "WxdkdrawDlgOptionsScreen.h"
+#endif
+
+
+
+
+#line 84 "WxdkdrawFrameEvents.cpt"
+
+
+
+/** Events the frame must handle.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawFrame,wxFrame)
+#endif
+ EVT_MENU(\
+ wxID_EXIT,\
+ WxdkdrawFrame::OnQuit\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_HELP_ABOUT,\
+ WxdkdrawFrame::OnAbout\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_HELP_CONTENTS,\
+ WxdkdrawFrame::OnHelpContents\
+ )
+ EVT_MENU(\
+ wxID_NEW,\
+ WxdkdrawFrame::OnFileNew\
+ )
+ EVT_MENU(\
+ wxID_OPEN,\
+ WxdkdrawFrame::OnFileOpen\
+ )
+ EVT_BUTTON(\
+ wxID_OPEN,\
+ WxdkdrawFrame::OnFileOpen\
+ )
+ EVT_MENU(\
+ wxID_SAVE,\
+ WxdkdrawFrame::OnFileSave\
+ )
+ EVT_BUTTON(\
+ wxID_SAVE,\
+ WxdkdrawFrame::OnFileSave\
+ )
+ EVT_MENU(\
+ wxID_SAVEAS,\
+ WxdkdrawFrame::OnFileSaveAs\
+ )
+ EVT_MENU(\
+ wxID_ZOOM_IN,\
+ WxdkdrawFrame::OnZoomIn\
+ )
+ EVT_BUTTON(\
+ wxID_ZOOM_IN,\
+ WxdkdrawFrame::OnZoomIn\
+ )
+ EVT_MENU(\
+ wxID_ZOOM_OUT,\
+ WxdkdrawFrame::OnZoomOut\
+ )
+ EVT_BUTTON(\
+ wxID_ZOOM_OUT,\
+ WxdkdrawFrame::OnZoomOut\
+ )
+ EVT_MENU(\
+ wxID_ZOOM_100,\
+ WxdkdrawFrame::OnZoom100\
+ )
+ EVT_BUTTON(\
+ wxID_ZOOM_100,\
+ WxdkdrawFrame::OnZoom100\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_POLYINE,\
+ WxdkdrawFrame::OnAddPolyline\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_POLYINE,\
+ WxdkdrawFrame::OnAddPolyline\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_POLYGON,\
+ WxdkdrawFrame::OnAddPolygon\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_POLYGON,\
+ WxdkdrawFrame::OnAddPolygon\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_RECT,\
+ WxdkdrawFrame::OnAddRectangle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_RECT,\
+ WxdkdrawFrame::OnAddRectangle\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_BOX,\
+ WxdkdrawFrame::OnAddBox\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_BOX,\
+ WxdkdrawFrame::OnAddBox\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_CIRCLE,\
+ WxdkdrawFrame::OnAddCircle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_CIRCLE,\
+ WxdkdrawFrame::OnAddCircle\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_ELLIPSE,\
+ WxdkdrawFrame::OnAddEllipse\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_ELLIPSE,\
+ WxdkdrawFrame::OnAddEllipse\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_ARC_O,\
+ WxdkdrawFrame::OnAddArcOpen\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_ARC_O,\
+ WxdkdrawFrame::OnAddArcOpen\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_ARC_C,\
+ WxdkdrawFrame::OnAddArcClosed\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_ARC_C,\
+ WxdkdrawFrame::OnAddArcClosed\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_SPL_AO,\
+ WxdkdrawFrame::OnAddSplineAO\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_SPL_AO,\
+ WxdkdrawFrame::OnAddSplineAO\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_SPL_AC,\
+ WxdkdrawFrame::OnAddSplineAC\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_SPL_AC,\
+ WxdkdrawFrame::OnAddSplineAC\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_SPL_IO,\
+ WxdkdrawFrame::OnAddSplineIO\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_SPL_IO,\
+ WxdkdrawFrame::OnAddSplineIO\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_SPL_IC,\
+ WxdkdrawFrame::OnAddSplineIC\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_SPL_IC,\
+ WxdkdrawFrame::OnAddSplineIC\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_DOT_C,\
+ WxdkdrawFrame::OnAddDot\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_DOT_C,\
+ WxdkdrawFrame::OnAddDot\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_DOT_W,\
+ WxdkdrawFrame::OnAddWhiteDot\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_DOT_W,\
+ WxdkdrawFrame::OnAddWhiteDot\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_TEXT,\
+ WxdkdrawFrame::OnAddTextlabel\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_TEXT,\
+ WxdkdrawFrame::OnAddTextlabel\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_IMG,\
+ WxdkdrawFrame::OnAddImage\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_IMG,\
+ WxdkdrawFrame::OnAddImage\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_LIBELEM,\
+ WxdkdrawFrame::OnAddLibelem\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_LIBELEM,\
+ WxdkdrawFrame::OnAddLibelem\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_COPY,\
+ WxdkdrawFrame::OnEditCopy\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_COPY,\
+ WxdkdrawFrame::OnEditCopy\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_MOVE,\
+ WxdkdrawFrame::OnEditMove\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_MOVE,\
+ WxdkdrawFrame::OnEditMove\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_DEL,\
+ WxdkdrawFrame::OnEditDelete\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_DEL,\
+ WxdkdrawFrame::OnEditDelete\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_PT_MOVE,\
+ WxdkdrawFrame::OnEditPointMove\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_PT_MOVE,\
+ WxdkdrawFrame::OnEditPointMove\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_PT_ADD,\
+ WxdkdrawFrame::OnEditPointAdd\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_PT_ADD,\
+ WxdkdrawFrame::OnEditPointAdd\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_PT_DEL,\
+ WxdkdrawFrame::OnEditPointDelete\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_PT_DEL,\
+ WxdkdrawFrame::OnEditPointDelete\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_DET,\
+ WxdkdrawFrame::OnEditDetails\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_DET,\
+ WxdkdrawFrame::OnEditDetails\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_GRP1,\
+ WxdkdrawFrame::OnEditGroup\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_GRP13,\
+ WxdkdrawFrame::OnEditGroup3\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_GRP1,\
+ WxdkdrawFrame::OnEditGroup\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_GRP13,\
+ WxdkdrawFrame::OnEditGroup3\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_UNGRP,\
+ WxdkdrawFrame::OnEditUngroup\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_UNGRP,\
+ WxdkdrawFrame::OnEditUngroup\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_FLIPH,\
+ WxdkdrawFrame::OnEditFlipH\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_FLIPH,\
+ WxdkdrawFrame::OnEditFlipH\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_FLIPV,\
+ WxdkdrawFrame::OnEditFlipV\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_FLIPV,\
+ WxdkdrawFrame::OnEditFlipV\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_ROTLEFT,\
+ WxdkdrawFrame::OnEditRotateLeft\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_ROTLEFT,\
+ WxdkdrawFrame::OnEditRotateLeft\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_ROTRIGHT,\
+ WxdkdrawFrame::OnEditRotateRight\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_ROTRIGHT,\
+ WxdkdrawFrame::OnEditRotateRight\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_DRSZ,\
+ WxdkdrawFrame::OnEditChangeSize\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_DRSZ,\
+ WxdkdrawFrame::OnEditChangeSize\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_LAYERS_ALL,\
+ WxdkdrawFrame::OnLayersAll\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_LAYERS_ALL,\
+ WxdkdrawFrame::OnLayersAll\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_LAYERS_MGR,\
+ WxdkdrawFrame::OnLayerManager\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_LAYERS_MGR,\
+ WxdkdrawFrame::OnLayerManager\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ZOOM_CENTER,\
+ WxdkdrawFrame::OnCenterView\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_1,\
+ WxdkdrawFrame::OnConvert1\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_2,\
+ WxdkdrawFrame::OnConvert2\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_3,\
+ WxdkdrawFrame::OnConvert3\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_4,\
+ WxdkdrawFrame::OnConvert4\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_5,\
+ WxdkdrawFrame::OnConvert5\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_6,\
+ WxdkdrawFrame::OnConvert6\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_7,\
+ WxdkdrawFrame::OnConvert7\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_8,\
+ WxdkdrawFrame::OnConvert8\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_9,\
+ WxdkdrawFrame::OnConvert9\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_A,\
+ WxdkdrawFrame::OnConvertA\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_BORDER,\
+ WxdkdrawFrame::OnColourBorderModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_BORDER,\
+ WxdkdrawFrame::OnColourBorderReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_BACKGROUND,\
+ WxdkdrawFrame::OnColourBackgroundModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_BACKGROUND,\
+ WxdkdrawFrame::OnColourBackgroundReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_GRID,\
+ WxdkdrawFrame::OnColourGridModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_GRID,\
+ WxdkdrawFrame::OnColourGridReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_PH,\
+ WxdkdrawFrame::OnColourPlacementModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_PH,\
+ WxdkdrawFrame::OnColourPlacementReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_COPY,\
+ WxdkdrawFrame::OnColourCopyModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_COPY,\
+ WxdkdrawFrame::OnColourCopyReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_MOVE,\
+ WxdkdrawFrame::OnColourMoveModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_MOVE,\
+ WxdkdrawFrame::OnColourMoveReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_DELETE,\
+ WxdkdrawFrame::OnColourDeleteModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_DELETE,\
+ WxdkdrawFrame::OnColourDeleteReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_GROUP,\
+ WxdkdrawFrame::OnColourGroupModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_GROUP,\
+ WxdkdrawFrame::OnColourGroupReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_MISSING,\
+ WxdkdrawFrame::OnColourMissingModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_MISSING,\
+ WxdkdrawFrame::OnColourMissingReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_RESET_OPTIONS,\
+ WxdkdrawFrame::OnResetOptions\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_MOD_SPLINE,\
+ WxdkdrawFrame::OnModifySplineValue\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_MOD_SPLINE,\
+ WxdkdrawFrame::OnModifySplineValue\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_OPT_NEW_OBJECTS,\
+ WxdkdrawFrame::OnOptionsNewObjects\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_OPT_SCREEN,\
+ WxdkdrawFrame::OnOptionsScreenRepresentation\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ZOOM_CENTER,\
+ WxdkdrawFrame::OnCenterView\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawFrame::ID_GRID_ON_OFF,\
+ WxdkdrawFrame::OnGridOnOff\
+ )
+ EVT_CHOICE(\
+ WxdkdrawFrame::ID_GRID_UNIT,\
+ WxdkdrawFrame::OnGridUnit\
+ )
+ EVT_CHOICE(\
+ WxdkdrawFrame::ID_GRID_BASE,\
+ WxdkdrawFrame::OnGridBase\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawFrame::ID_PLACEMENT,\
+ WxdkdrawFrame::OnPlacementHelp\
+ )
+ EVT_COMMAND(\
+ WxdkdrawFrame::ID_STYLE_LINE_COL,\
+ wxEVT_DK4_COLOUR_VIEW_EVENT,WxdkdrawFrame::OnStyleLineColour\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawFrame::ID_STYLE_LAYER,\
+ WxdkdrawFrame::OnStyleLayer\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawFrame::ID_STYLE_LINE_WIDTH,\
+ WxdkdrawFrame::OnStyleLineWidth\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawFrame::ID_SPIN_ROTATION,\
+ WxdkdrawFrame::OnSpinRotation\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_LINE_STYLE,\
+ WxdkdrawFrame::OnStyleLineStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_LINE_CAP,\
+ WxdkdrawFrame::OnStyleLineCap\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_LINE_JOIN,\
+ WxdkdrawFrame::OnStyleLineJoin\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_ARROW_F,\
+ WxdkdrawFrame::OnStyleLineArrowF\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_ARROW_B,\
+ WxdkdrawFrame::OnStyleLineArrowB\
+ )
+ EVT_COMMAND(\
+ WxdkdrawFrame::ID_STYLE_FILL_COL,\
+ wxEVT_DK4_COLOUR_VIEW_EVENT,WxdkdrawFrame::OnStyleFillColour\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_FILL_PATT,\
+ WxdkdrawFrame::OnStyleFillPattern\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawFrame::ID_STYLE_TEXT_LATEX,\
+ WxdkdrawFrame::OnStyleTextLatex\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_TEXT_ALIGN,\
+ WxdkdrawFrame::OnStyleTextAlign\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_TEXT_FONT,\
+ WxdkdrawFrame::OnStyleTextFont\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawFrame::ID_STYLE_TEXT_SIZE,\
+ WxdkdrawFrame::OnStyleTextSize\
+ )
+ EVT_COMMAND_SCROLL(\
+ WxdkdrawFrame::ID_SCROLL_H,\
+ WxdkdrawFrame::OnScrollH\
+ )
+ EVT_COMMAND_SCROLL(\
+ WxdkdrawFrame::ID_SCROLL_V,\
+ WxdkdrawFrame::OnScrollV\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+/** DK tools and libraries version number as wxChar text.
+*/
+static const wxChar versno[] = { DKT_VERSION_WX };
+
+
+
+/** Files to open in dialog box.
+*/
+static const wxChar wxd_file_type_suffix[] = {
+ wxT("WXD files (*.wxd)|*.wxd")
+};
+
+
+
+bool
+WxdkdrawFrame::BeginEventHandling(void)
+{
+ bool back = false;
+ dk4error_init(&m_oErrorReport);
+ if ((NULL != m_pDrw) && (m_bActive) && (NULL != drawco)) {
+ back = true;
+ m_bUpdate = false;
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::ErrorReportingAtEventEnd(void)
+{
+ wxString msgText(sTexts[506]);
+ int msgflags;
+ bool usetp;
+
+ if (DK4_E_NONE != m_oErrorReport.ec) {
+ msgflags = (wxOK | wxCENTRE | wxICON_ERROR);
+ usetp = false;
+ switch (m_oErrorReport.ec) {
+ case DK4_E_MEMORY_ALLOCATION_FAILED : {
+ wxMessageBox(sTexts[346], sTexts[345], msgflags);
+ } break;
+ case DK4_E_MATH_OVERFLOW : {
+ wxMessageBox(sTexts[348], sTexts[347], msgflags);
+ } break;
+ case WXD_E_FAILED_TO_OPEN_FILE : {
+ wxMessageBox(sTexts[508], sTexts[507], msgflags);
+ } break;
+ case WXD_E_MOUSE_POS_NOT_AVAILABLE : {
+ wxMessageBox(sTexts[510], sTexts[509], msgflags);
+ } break;
+ case WXD_E_NO_EXPORT_TEXT : {
+ wxMessageBox(sTexts[512], sTexts[511], msgflags);
+ } break;
+ case WXD_E_NO_FILENAME : {
+ wxMessageBox(sTexts[514], sTexts[513], msgflags);
+ } break;
+ case WXD_E_GET_CONTROL_POINT : {
+ wxMessageBox(sTexts[516], sTexts[515], msgflags);
+ } break;
+ case WXD_E_SET_CONTROL_POINT : {
+ wxMessageBox(sTexts[518], sTexts[517], msgflags);
+ } break;
+ case WXD_E_OVERFLOW_COORDINATES : {
+ wxMessageBox(sTexts[520], sTexts[519], msgflags);
+ } break;
+ case WXD_E_MOVE_TO_GROUP : {
+ wxMessageBox(sTexts[522], sTexts[521], msgflags);
+ } break;
+ case WXD_E_UNGROUP_OBJECT : {
+ wxMessageBox(sTexts[524], sTexts[523], msgflags);
+ } break;
+ case WXD_E_BOX_TOO_SMALL : {
+ wxMessageBox(sTexts[526], sTexts[525], msgflags);
+ } break;
+ case WXD_E_BUG_POINT_OOR : {
+ wxMessageBox(sTexts[528], sTexts[527], msgflags);
+ } break;
+ case WXD_E_TOO_MANY_POINTS : {
+ wxMessageBox(sTexts[530], sTexts[529], msgflags);
+ } break;
+ case WXD_E_CANNOT_CONVERT : {
+ wxMessageBox(sTexts[557], sTexts[556], msgflags);
+ } break;
+ case WXD_E_CWD_TOO_LONG : {
+ wxMessageBox(sTexts[559], sTexts[558], msgflags);
+ } break;
+ case WXD_E_NO_CWD : {
+ wxMessageBox(sTexts[561], sTexts[560], msgflags);
+ } break;
+ case WXD_E_OUTPUT_FN_TOO_LONG : {
+ wxMessageBox(sTexts[563], sTexts[562], msgflags);
+ } break;
+ case WXD_E_OUTPUT_DIRNAME : {
+ wxMessageBox(sTexts[565], sTexts[564], msgflags);
+ } break;
+ case WXD_E_FAILED_TO_READ_FILE : {
+ if (
+ (WXDRD_E_MEMORY <= m_oStatusReader.ec)
+ && (WXDRD_E_BOX_NO_AREA >= m_oStatusReader.ec)
+ ) {
+ switch (m_oStatusReader.ec) {
+ case WXDRD_E_NUM_CONV :
+ case WXDRD_E_COORD_OVERFLOW :
+ case WXDRD_E_BOX_NO_AREA :
+ {
+ usetp = true;
+ } break;
+ }
+ msgText.Append(sTexts[575 + m_oStatusReader.ec]);
+ }
+ else {
+ msgText.Append(sTexts[575]);
+ }
+ if (0UL < m_oStatusReader.ln) {
+ wxString strLineno;
+ strLineno.Printf(wxT("%lu"), m_oStatusReader.ln);
+ msgText.Append(sTexts[596]);
+ msgText.Append(strLineno);
+ if (usetp) {
+ wxString strTextno;
+ strTextno.Printf(
+ wxT("%lu"),
+ ((unsigned long)(m_oStatusReader.te) + 1UL)
+ );
+ msgText.Append(sTexts[597]);
+ msgText.Append(strTextno);
+ }
+ msgText.Append(sTexts[598]);
+ }
+ wxMessageBox(msgText, sTexts[505], msgflags);
+ } break;
+ default : {
+ wxMessageBox(sTexts[350], sTexts[349], msgflags);
+ } break;
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::EndEventHandling(void)
+{
+ if ((NULL != m_pDrw) && (m_bActive) && (NULL != drawco)) {
+ if (WXD_REFRESH_NONE < m_pDrw->redraw) {
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ if (m_bUpdate) {
+ Update();
+ }
+ ErrorReportingAtEventEnd();
+ dk4error_init(&m_oErrorReport);
+}
+
+
+
+bool
+WxdkdrawFrame::CanClose(bool isLast)
+{
+ int res; /* Result from message box */
+ bool back = true; /* Function result */
+
+
+#line 823 "WxdkdrawFrameEvents.cpt"
+
+ /* __CHANGE__ 013: Check for unsaved data.
+ */
+ if (isLast) {
+ SaveConfiguration();
+ }
+ if ((NULL != m_pDrw) && (NULL != drawco) && (m_bActive)) {
+ if (m_bModified) {
+ Dk4WxYesNoDialog dlg(
+ this, pAppHelp, sTexts[169], sTexts[168]
+ );
+#if VERSION_BEFORE_2020_08_23
+ res =
+ wxMessageBox(sTexts[169],sTexts[168],(wxYES_NO | wxICON_QUESTION));
+#else
+ res = dlg.ShowModal();
+#endif
+ if (wxYES == res) {
+ if (!(SaveToFile())) {
+ back = false;
+ }
+ }
+ }
+ if (back) {
+ m_bActive = false;
+ if (NULL != m_pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ }
+ m_pDrw = NULL;
+ }
+ }
+
+
+#line 855 "WxdkdrawFrameEvents.cpt"
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::UpdatePositionLabels(bool havepos, int32_t x, int32_t y)
+{
+ double res;
+
+ if (havepos) {
+ wxString s1 = wxString(sTexts[16]);
+ wxString s2 = wxString(sTexts[17]);
+ wxString sx = wxEmptyString;
+ wxString sy = wxEmptyString;
+ if (0 != cbGridUnit->GetSelection()) { res = 6400000.0; }
+ else { res = 16256000.0; }
+ sx.Printf(wxT("%g"), ((double)x / res));
+ sy.Printf(wxT("%g"), ((double)y / res));
+ s1.Append(sx);
+ s2.Append(sy);
+ tlPosX->SetLabel(s1);
+ tlPosY->SetLabel(s2);
+ }
+ else {
+ tlPosX->SetLabel(sTexts[16]);
+ tlPosY->SetLabel(sTexts[17]);
+ }
+ tlPosX->Refresh();
+ tlPosY->Refresh();
+ m_bUpdate = true;
+}
+
+
+
+bool
+WxdkdrawFrame::UpdateGridPosition(void)
+{
+ dk4_er_t er; /* Error report */
+ int32_t xdraw; /* Raw x position (not grid-snapped) */
+ int32_t ydraw; /* Raw y position (not grid-snapped) */
+ int32_t xgrid; /* Corrected x position (grid-snap) */
+ int32_t ygrid; /* Corrected y position (grid-snap) */
+ bool ok = true; /* Flag: No errors occured */
+ bool back = false; /* Function result */
+
+
+#line 901 "WxdkdrawFrameEvents.cpt"
+ xdraw = drawco->InvX((double)(m_szMousePosPix.GetWidth()), ok);
+ ydraw = drawco->InvY((double)(m_szMousePosPix.GetHeight()), ok);
+ if (ok) {
+
+#line 904 "WxdkdrawFrameEvents.cpt"
+ if ((m_ptMousePosRaw.x != xdraw) || (m_ptMousePosRaw.y != ydraw)) {
+ m_ptMousePosRaw.x = xdraw;
+ m_ptMousePosRaw.y = ydraw;
+ back = true;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 912 "WxdkdrawFrameEvents.cpt"
+ }
+#endif
+ xgrid = drawco->GridRoundNearest(xdraw, drawco->m_uGridSnap, ok);
+ ygrid = drawco->GridRoundNearest(ydraw, drawco->m_uGridSnap, ok);
+ if (ok) {
+
+#line 917 "WxdkdrawFrameEvents.cpt"
+ if ((m_ptMousePosGrid.x != xgrid) || (m_ptMousePosGrid.y != ygrid)) {
+ m_ptMousePosGrid.x = xgrid;
+ m_ptMousePosGrid.y = ygrid;
+ back = true;
+ }
+ if (!(m_bMousePos)) {
+ back = true;
+ }
+ if (back) {
+ UpdatePositionLabels(true, xgrid, ygrid);
+ }
+ m_bMousePos = true;
+ m_bMouseDiff = false;
+
+#line 930 "WxdkdrawFrameEvents.cpt"
+ switch (m_iState) {
+ /*
+ _STATE_ For some states we need to calculate the difference
+ between move/copy origin point and current point.
+ */
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_DRWSZ_PLACE :
+ {
+ dk4error_init(&er);
+ m_ptMouseMoveDiff.x = dk4ma_int32_t_sub(
+ m_ptMousePosGrid.x, m_ptMouseMoveStart.x, &er
+ );
+ m_ptMouseMoveDiff.y = dk4ma_int32_t_sub(
+ m_ptMousePosGrid.y, m_ptMouseMoveStart.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ m_bMouseDiff = true;
+
+#line 950 "WxdkdrawFrameEvents.cpt"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 953 "WxdkdrawFrameEvents.cpt"
+ }
+#endif
+ } break;
+#if TRACE_DEBUG
+ default : {
+
+#line 958 "WxdkdrawFrameEvents.cpt"
+ } break;
+#endif
+ }
+ }
+ else {
+
+#line 963 "WxdkdrawFrameEvents.cpt"
+ if (m_bMousePos) {
+ UpdatePositionLabels(false, (int32_t)0L, (int32_t)0L);
+ back = true;
+ }
+ m_bMousePos = false;
+ m_bMouseDiff = false;
+
+#line 969 "WxdkdrawFrameEvents.cpt"
+ }
+
+#line 970 "WxdkdrawFrameEvents.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::UpdateMousePosition(wxMouseEvent & event)
+{
+ int xpos = 0; /* Mouse x position in pixels */
+ int ypos = 0; /* Mouse y position in pixels */
+ bool back = false; /* Function result */
+
+
+#line 982 "WxdkdrawFrameEvents.cpt"
+ event.GetPosition(&xpos, &ypos);
+ if (
+ (m_szMousePosPix.GetWidth() != xpos)
+ || (m_szMousePosPix.GetHeight() != ypos)
+ )
+ {
+ m_szMousePosPix.SetWidth(xpos);
+ m_szMousePosPix.SetHeight(ypos);
+ back = UpdateGridPosition();
+ }
+
+
+#line 993 "WxdkdrawFrameEvents.cpt"
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::ControlMouseEnter(wxMouseEvent & event)
+{
+#if 0
+
+
+#line 1003 "WxdkdrawFrameEvents.cpt"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+
+
+#line 1008 "WxdkdrawFrameEvents.cpt"
+ EndEventHandling();
+#endif
+
+
+#line 1011 "WxdkdrawFrameEvents.cpt"
+ ControlMouseMove(event);
+
+
+#line 1013 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ControlMouseLeave(wxMouseEvent & WXUNUSED(event))
+{
+
+
+#line 1021 "WxdkdrawFrameEvents.cpt"
+ StartEventHandling();
+ if (m_bMousePos) {
+ UpdatePositionLabels(false, (int32_t)0L, (int32_t)0L);
+ }
+ m_bMousePos = false;
+ if ((S_NOOP == m_iState) && (NULL != m_pCurrent)) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ m_pCurrent = NULL;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+
+
+#line 1032 "WxdkdrawFrameEvents.cpt"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::ControlMouseMove(wxMouseEvent & event)
+{
+
+
+#line 1041 "WxdkdrawFrameEvents.cpt"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ /*
+ _STATE_ Call mouse move method.
+ */
+ switch (m_iState) {
+ case S_NOOP : {
+ MouseMoveNoop();
+ } break;
+ case S_DELETE : {
+ MouseMoveDelete();
+ } break;
+ case S_REGION_DELETE : {
+ MouseMoveRegionDelete();
+ } break;
+ case S_MOVE_SELECT : {
+ MouseMoveMoveSelect();
+ } break;
+ case S_MOVE_PLACE : {
+ MouseMoveMovePlace();
+ } break;
+ case S_COPY_SELECT : {
+ MouseMoveCopySelect();
+ } break;
+ case S_COPY_PLACE : {
+ MouseMoveCopyPlace();
+ } break;
+ case S_POLY_FIRST : {
+ MouseMovePolyFirst();
+ } break;
+ case S_POLY_FURTHER : {
+ MouseMovePolyFurther();
+ } break;
+ case S_SPLINE_FIRST : {
+ MouseMoveSplineFirst();
+ } break;
+ case S_SPLINE_FURTHER : {
+ MouseMoveSplineFurther();
+ } break;
+ case S_BOX_FIRST : {
+ MouseMoveBoxFirst();
+ } break;
+ case S_BOX_OPPOSITE : {
+ MouseMoveBoxOpposite();
+ } break;
+ case S_CIRCLE_CENTER : {
+ MouseMoveCircleCenter();
+ } break;
+ case S_CIRCLE_RADIUS : {
+ MouseMoveCircleRadius();
+ } break;
+ case S_ELLIPSE_CENTER : {
+ MouseMoveEllipseCenter();
+ } break;
+ case S_ELLIPSE_CORNER : {
+ MouseMoveEllipseCorner();
+ } break;
+ case S_ARC_1 : {
+ MouseMoveArc1();
+ } break;
+ case S_ARC_2 : {
+ MouseMoveArc2();
+ } break;
+ case S_ARC_3 : {
+ MouseMoveArc3();
+ } break;
+ case S_DOT : {
+ MouseMoveDot();
+ } break;
+ case S_TEXT : {
+ MouseMoveText();
+ } break;
+ case S_IMG_1 : {
+ MouseMoveImage1();
+ } break;
+ case S_IMG_2 : {
+ MouseMoveImage2();
+ } break;
+ case S_LIBELEM_PLACE : {
+ MouseMoveLibelemPlace();
+ } break;
+ case S_MOVEPT_SELECT : {
+ MouseMovePointMoveSelect();
+ } break;
+ case S_MOVEPT_PLACE : {
+ MouseMovePointMovePlace();
+ } break;
+ case S_DELPT : {
+ MouseMovePointDelete();
+ } break;
+ case S_ADDPT_SELECT : {
+ MouseMovePointAddSelect();
+ } break;
+ case S_ADDPT_PLACE : {
+ MouseMovePointAddPlace();
+ } break;
+ case S_DRWSZ_SELECT : {
+ MouseMoveDrawingSizeSelect();
+ } break;
+ case S_DRWSZ_PLACE : {
+ MouseMoveDrawingSizePlace();
+ } break;
+ case S_FLIP : {
+ MouseMoveFlip();
+ } break;
+ case S_GROUP_ONE : {
+ MouseMoveGroupOne();
+ } break;
+ case S_GROUP_RECT_1 : {
+ MouseMoveGroupRect1();
+ } break;
+ case S_GROUP_RECT_2 : {
+ MouseMoveGroupRect2();
+ } break;
+ case S_UNGROUP : {
+ MouseMoveUngroup();
+ } break;
+ case S_DETAILS : {
+ MouseMoveDetails();
+ } break;
+ case S_DETAILS_2 : {
+ } break;
+ case S_CONVERT : {
+ MouseMoveConvert();
+ } break;
+ case S_ROTATE : {
+ MouseMoveRotate();
+ } break;
+ case S_MOD_SPLINE : {
+ MouseMoveModspline();
+ } break;
+ }
+
+
+#line 1176 "WxdkdrawFrameEvents.cpt"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::ControlLeftMouseButton(wxMouseEvent & event)
+{
+
+
+#line 1185 "WxdkdrawFrameEvents.cpt"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ /*
+ _STATE_ Call mouse button method.
+ */
+ switch (m_iState) {
+ case S_NOOP : {
+ MouseLeftNoop();
+ } break;
+ case S_DELETE : {
+ MouseLeftDelete();
+ } break;
+ case S_REGION_DELETE : {
+ MouseLeftRegionDelete();
+ } break;
+ case S_MOVE_SELECT : {
+ MouseLeftMoveSelect();
+ } break;
+ case S_MOVE_PLACE : {
+ MouseLeftMovePlace();
+ } break;
+ case S_COPY_SELECT : {
+ MouseLeftCopySelect();
+ } break;
+ case S_COPY_PLACE : {
+ MouseLeftCopyPlace();
+ } break;
+ case S_POLY_FIRST : {
+ MouseLeftPolyFirst();
+ } break;
+ case S_POLY_FURTHER : {
+ MouseLeftPolyFurther();
+ } break;
+ case S_SPLINE_FIRST : {
+ MouseLeftSplineFirst();
+ } break;
+ case S_SPLINE_FURTHER : {
+ MouseLeftSplineFurther();
+ } break;
+ case S_BOX_FIRST : {
+ MouseLeftBoxFirst();
+ } break;
+ case S_BOX_OPPOSITE : {
+ MouseLeftBoxOpposite();
+ } break;
+ case S_CIRCLE_CENTER : {
+ MouseLeftCircleCenter();
+ } break;
+ case S_CIRCLE_RADIUS : {
+ MouseLeftCircleRadius();
+ } break;
+ case S_ELLIPSE_CENTER : {
+ MouseLeftEllipseCenter();
+ } break;
+ case S_ELLIPSE_CORNER : {
+ MouseLeftEllipseCorner();
+ } break;
+ case S_ARC_1 : {
+ MouseLeftArc1();
+ } break;
+ case S_ARC_2 : {
+ MouseLeftArc2();
+ } break;
+ case S_ARC_3 : {
+ MouseLeftArc3();
+ } break;
+ case S_DOT : {
+ MouseLeftDot();
+ } break;
+ case S_TEXT : {
+ MouseLeftText();
+ } break;
+ case S_IMG_1 : {
+ MouseLeftImage1();
+ } break;
+ case S_IMG_2 : {
+ MouseLeftImage2();
+ } break;
+ case S_LIBELEM_PLACE : {
+ MouseLeftLibelemPlace();
+ } break;
+ case S_MOVEPT_SELECT : {
+ MouseLeftPointMoveSelect();
+ } break;
+ case S_MOVEPT_PLACE : {
+ MouseLeftPointMovePlace();
+ } break;
+ case S_DELPT : {
+ MouseLeftPointDelete();
+ } break;
+ case S_ADDPT_SELECT : {
+ MouseLeftPointAddSelect();
+ } break;
+ case S_ADDPT_PLACE : {
+ MouseLeftPointAddPlace();
+ } break;
+ case S_DRWSZ_SELECT : {
+ MouseLeftDrawingSizeSelect();
+ } break;
+ case S_DRWSZ_PLACE : {
+ MouseLeftDrawingSizePlace();
+ } break;
+ case S_FLIP : {
+ MouseLeftFlip();
+ } break;
+ case S_GROUP_ONE : {
+ MouseLeftGroupOne();
+ } break;
+ case S_GROUP_RECT_1 : {
+ MouseLeftGroupRect1();
+ } break;
+ case S_GROUP_RECT_2 : {
+ MouseLeftGroupRect2();
+ } break;
+ case S_UNGROUP : {
+ MouseLeftUngroup();
+ } break;
+ case S_DETAILS : {
+ MouseLeftDetails();
+ } break;
+ case S_DETAILS_2 : {
+ } break;
+ case S_CONVERT : {
+ MouseLeftConvert();
+ } break;
+ case S_ROTATE : {
+ MouseLeftRotate();
+ } break;
+ case S_MOD_SPLINE : {
+ MouseLeftModspline();
+ } break;
+ }
+
+
+#line 1320 "WxdkdrawFrameEvents.cpt"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::ControlRightMouseButton(wxMouseEvent & event)
+{
+ Wxd_object_t *pCurrent;
+ uint16_t uCurrent;
+
+
+#line 1331 "WxdkdrawFrameEvents.cpt"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ /*
+ _STATE_ Call right mouse button method.
+ */
+ switch (m_iState) {
+ case S_MOVEPT_PLACE : {
+ pCurrent = NULL;
+ uCurrent = 0U;
+ if (
+ (NULL != m_pCurrent)
+ && (
+ (WXD_OT_O_SPLINE == m_pCurrent->ot)
+ || (WXD_OT_C_SPLINE == m_pCurrent->ot)
+ )
+ && (m_uCurrent < (m_pCurrent->det).s.n)
+ ) {
+ pCurrent = m_pCurrent;
+ uCurrent = m_uCurrent;
+ }
+ EndOperation();
+ if (NULL != pCurrent) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ drawco->Refresh();
+ Update();
+ ModifySplineValue(pCurrent, uCurrent);
+ m_iState = S_MOVEPT_SELECT;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ } break;
+ case S_NOOP :
+ case S_DELETE :
+ case S_REGION_DELETE :
+ case S_MOVE_SELECT :
+ case S_MOVE_PLACE :
+ case S_COPY_SELECT :
+ case S_COPY_PLACE :
+ case S_POLY_FIRST :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FIRST :
+ case S_SPLINE_FURTHER :
+ case S_BOX_FIRST :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_CENTER :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CENTER :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_1 :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_DOT :
+ case S_TEXT :
+ case S_IMG_1 :
+ case S_IMG_2 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_SELECT :
+ case S_DELPT :
+ case S_DRWSZ_SELECT :
+ case S_DRWSZ_PLACE :
+ case S_GROUP_ONE :
+ case S_GROUP_RECT_1 :
+ case S_GROUP_RECT_2 :
+ case S_DETAILS :
+ case S_DETAILS_2 :
+ case S_CONVERT :
+ case S_ROTATE :
+ case S_MOD_SPLINE :
+ default : {
+ EndOperation();
+ } break;
+ }
+
+
+#line 1406 "WxdkdrawFrameEvents.cpt"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::ControlMiddleMouseButton(wxMouseEvent & event)
+{
+
+
+#line 1415 "WxdkdrawFrameEvents.cpt"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ switch (m_iState) {
+ case S_DELETE : {
+ MouseMiddleDelete();
+ } break;
+ }
+
+
+#line 1425 "WxdkdrawFrameEvents.cpt"
+ EndEventHandling();
+}
+
+
+
+
+void
+WxdkdrawFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1435 "WxdkdrawFrameEvents.cpt"
+ EndOperation(true);
+
+
+#line 1437 "WxdkdrawFrameEvents.cpt"
+ Close();
+}
+
+
+
+void
+WxdkdrawFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
+{
+ wxString text(wxT(""));
+ wxString title(wxT(""));
+
+
+#line 1448 "WxdkdrawFrameEvents.cpt"
+ /* Construct message text. */
+ text.Append(sNlWx[0]);
+#if 0
+ /* Do not show a separated version number for wxdkdraw as it is
+ a part of DK tools and libraries.
+ */
+ text.Append(sNlWx[7]);
+ text.Append(sNlWx[1]);
+#endif
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[19]);
+ text.Append(versno);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[9]);
+ text.Append(sNlWx[2]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[9]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[10]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[13]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[14]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[15]);
+ text.Append(sNlWx[8]);
+
+ /* Construct dialog box title. */
+ title.Append(sTexts[10]);
+ title.Append(sNlWx[0]);
+
+ /* Show dialog box. */
+ wxMessageBox(text, title);
+
+
+
+#line 1493 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1501 "WxdkdrawFrameEvents.cpt"
+#if 1
+ DisplayContents();
+#else
+ if (!(FindFileAndLaunch(dkT("wxdkdraw.pdf"), true))) {
+ DisplayContents();
+ }
+#endif
+
+
+#line 1509 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnIdle(wxIdleEvent & event)
+{
+ bool isFirstIdleEvent = true;
+
+
+#line 1518 "WxdkdrawFrameEvents.cpt"
+ /*
+ Check whether we really have the first idle event.
+ */
+ {
+ wxCriticalSectionLocker lock(csIsFirstIdle);
+ isFirstIdleEvent = m_bIsFirstIdle;
+ m_bIsFirstIdle = false;
+ }
+ if (isFirstIdleEvent) {
+
+
+#line 1528 "WxdkdrawFrameEvents.cpt"
+ Disconnect(wxEVT_IDLE, wxIdleEventHandler(WxdkdrawFrame::OnIdle));
+
+
+#line 1530 "WxdkdrawFrameEvents.cpt"
+ OnFirstIdle();
+
+
+#line 1532 "WxdkdrawFrameEvents.cpt"
+ Update();
+ }
+
+
+#line 1535 "WxdkdrawFrameEvents.cpt"
+ event.Skip();
+}
+
+
+
+void
+WxdkdrawFrame::OnFileNew(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_drawing_t *pDrw = NULL; /* New drawing */
+ int res; /* Operation result */
+ bool bLoadNew = true; /* Can load new empty drawing */
+
+
+#line 1547 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ EndEventHandling();
+ if (m_bModified) {
+ Dk4WxYesNoDialog dlg(
+ this, pAppHelp, sTexts[169], sTexts[168]
+ );
+#if VERSION_BEFORE_2020_08_23
+ res =
+ wxMessageBox(sTexts[169],sTexts[168],(wxYES_NO | wxICON_QUESTION));
+#else
+ res = dlg.ShowModal();
+#endif
+ if (wxYES == res) {
+ if (!(SaveToFile())) {
+ bLoadNew = false;
+ }
+ }
+ }
+ if (bLoadNew) {
+ pDrw = wxdobj_drw_new();
+ if (NULL != pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ m_pDrw = pDrw;
+ m_sFileFull = wxEmptyString;
+ m_sFileDir = wxEmptyString;
+ m_sFileShort = wxEmptyString;
+ m_bHaveName = false;
+ SetTitle(sTexts[18]);
+ DrawingLoaded();
+ szTopBar->Layout();
+ m_bUpdate = true;
+ }
+ else {
+ }
+ }
+ }
+
+
+#line 1585 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnFileOpen(wxCommandEvent & WXUNUSED(event))
+{
+ wxString sDialogTitle(sTexts[339]); /* Dialog box title */
+ wxString sFileTypes(sTexts[172]); /* File type suffixes */
+ Wxd_drawing_t *pDrw = NULL; /* New drawing */
+ int res; /* Intermediate result */
+ bool bLoadNew = true; /* Flag: Can load new file */
+
+
+#line 1598 "WxdkdrawFrameEvents.cpt"
+
+
+#line 1599 "WxdkdrawFrameEvents.cpt"
+ wxdrd_status_init(&m_oStatusReader);
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ if (m_bModified) {
+ Dk4WxYesNoDialog dlg(
+ this, pAppHelp, sTexts[169], sTexts[168]
+ );
+#if VERSION_BEFORE_2020_08_23
+ res =
+ wxMessageBox(sTexts[169],sTexts[168],(wxYES_NO | wxICON_QUESTION));
+#else
+ res = dlg.ShowModal();
+#endif
+ if (wxYES == res) {
+ if (!(SaveToFile())) {
+ bLoadNew = false;
+ }
+ }
+ }
+ if (bLoadNew) {
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sFileDir, m_sFileShort,
+ sFileTypes, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sFileDir, m_sFileShort,
+ sFileTypes, wxOPEN
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ pDrw = ReadDrawingFromFile(pa);
+ if (NULL != pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ m_pDrw = pDrw;
+ m_sFileFull = pa;
+ m_sFileDir = dlg.GetDirectory();
+ m_sFileShort = dlg.GetFilename();
+ m_bHaveName = true;
+ SetTitle(m_sFileShort);
+ DrawingLoaded();
+ szTopBar->Layout();
+ m_bUpdate = true;
+ }
+ else {
+ /* ERROR: Failed to read file, already reported */
+ }
+ }
+ }
+ ModificationReportingAtEventEnd();
+ EndEventHandling();
+
+
+#line 1653 "WxdkdrawFrameEvents.cpt"
+ wxdrd_status_init(&m_oStatusReader);
+ }
+
+
+#line 1656 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnFileSave(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1664 "WxdkdrawFrameEvents.cpt"
+ wxdwr_status_init(&m_oStatusWriter, pAppHelp->GetWxEncoding());
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ SaveToFile();
+ EndEventHandling();
+ }
+
+
+#line 1671 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnFileSaveAs(wxCommandEvent & WXUNUSED(event))
+{
+ wxString sNewTitle = wxEmptyString; /* New program window title */
+ wxString sDlgTitle(sTexts[171]); /* Dialog title */
+ wxString sDlgTypes(sTexts[172]); /* File type suffixes */
+
+
+#line 1682 "WxdkdrawFrameEvents.cpt"
+ wxdwr_status_init(&m_oStatusWriter, pAppHelp->GetWxEncoding());
+ if (BeginEventHandling()) {
+ EndOperation(true);
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDlgTitle, m_sFileDir, m_sFileShort,
+ sDlgTypes, (wxFD_SAVE | wxFD_OVERWRITE_PROMPT)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDlgTitle, m_sFileDir, m_sFileShort,
+ sDlgTypes, wxSAVE
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ m_sFileFull = dlg.GetPath();
+ m_sFileDir = dlg.GetDirectory();
+ m_sFileShort = dlg.GetFilename();
+ m_bHaveName = true;
+ if (m_bModified) {
+ sNewTitle.Append(sTexts[170]);
+ sNewTitle.Append(m_sFileShort);
+ SetTitle(sNewTitle);
+ }
+ else {
+ SetTitle(m_sFileShort);
+ }
+ m_bUpdate = true;
+ SaveToFile();
+ }
+ EndEventHandling();
+ }
+
+
+#line 1715 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnZoomIn(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1723 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ if ((int8_t)14 > m_pDrw->zl) {
+ m_pDrw->zl += (int8_t)1;
+ ZoomChanged(false);
+ }
+ EndEventHandling();
+ }
+
+
+#line 1731 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnZoomOut(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1739 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ if ((int8_t)(-14) < m_pDrw->zl) {
+ m_pDrw->zl -= (int8_t)1;
+ ZoomChanged(true);
+ }
+ EndEventHandling();
+ }
+
+
+#line 1747 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnZoom100(wxCommandEvent & WXUNUSED(event))
+{
+ bool bZoomOut;
+
+
+#line 1756 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ if ((int8_t)0 != m_pDrw->zl) {
+ bZoomOut = ((int8_t)0 < m_pDrw->zl);
+ m_pDrw->zl = (int8_t)0;
+ ZoomChanged(bZoomOut);
+ }
+ EndEventHandling();
+ }
+
+
+#line 1765 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnPolygonPolyline(int8_t ot)
+{
+ m_iObjToCreate = ot;
+ m_iState = S_POLY_FIRST;
+ SetMouseAndStatusTexts(S_POLY_FIRST);
+ m_bAcceptablePoint = false;
+}
+
+
+
+void
+WxdkdrawFrame::OnAddPolyline(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1784 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnPolygonPolyline(WXD_OT_POLYLINE);
+ EndEventHandling();
+ }
+
+
+#line 1790 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddPolygon(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1798 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnPolygonPolyline(WXD_OT_POLYGON);
+ EndEventHandling();
+ }
+
+
+#line 1804 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnRectangleBox(bool bRounded)
+{
+ m_iState = S_BOX_FIRST;
+ m_bSplineInterpolated = bRounded;
+ m_bAcceptablePoint = false;
+ SetMouseAndStatusTexts(S_BOX_FIRST);
+}
+
+
+
+void
+WxdkdrawFrame::OnAddRectangle(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1823 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnRectangleBox(false);
+ EndEventHandling();
+ }
+
+
+#line 1829 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddBox(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1837 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnRectangleBox(true);
+ EndEventHandling();
+ }
+
+
+#line 1843 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddCircle(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1851 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_CIRCLE_CENTER;
+ SetMouseAndStatusTexts(S_CIRCLE_CENTER);
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+
+
+#line 1859 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddEllipse(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1867 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_ELLIPSE_CENTER;
+ SetMouseAndStatusTexts(m_iState);
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+
+
+#line 1875 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddArcOpen(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1883 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iObjToCreate = WXD_OT_O_ARC;
+ m_iState = S_ARC_1;
+ SetMouseAndStatusTexts(m_iState);
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+
+
+#line 1892 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddArcClosed(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1900 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iObjToCreate = WXD_OT_C_ARC;
+ m_iState = S_ARC_1;
+ SetMouseAndStatusTexts(m_iState);
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+
+
+#line 1909 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnSpline(int8_t ot, bool bInterpolated)
+{
+ m_iObjToCreate = ot;
+ m_bSplineInterpolated = bInterpolated;
+ m_iState = S_SPLINE_FIRST;
+ m_bAcceptablePoint = false;
+ SetMouseAndStatusTexts(S_SPLINE_FIRST);
+}
+
+
+
+void
+WxdkdrawFrame::OnAddSplineAO(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1929 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnSpline(WXD_OT_O_SPLINE, false);
+ EndEventHandling();
+ }
+
+
+#line 1935 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddSplineAC(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1943 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnSpline(WXD_OT_C_SPLINE, false);
+ EndEventHandling();
+ }
+
+
+#line 1949 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddSplineIO(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1957 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnSpline(WXD_OT_O_SPLINE, true);
+ EndEventHandling();
+ }
+
+
+#line 1963 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddSplineIC(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1971 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnSpline(WXD_OT_C_SPLINE, true);
+ EndEventHandling();
+ }
+
+
+#line 1977 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddDot(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1985 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iObjToCreate = WXD_OT_DOT_FILLED;
+ m_iState = S_DOT;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 1993 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddWhiteDot(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2001 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iObjToCreate = WXD_OT_DOT_WHITE;
+ m_iState = S_DOT;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2009 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddTextlabel(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2017 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_TEXT;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2024 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddImage(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2032 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_IMG_1;
+ SetMouseAndStatusTexts(m_iState);
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+
+
+#line 2041 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::AddLibelem(void)
+{
+ wxString sDialogTitle(sTexts[410]);
+ wxString sFileTypes(wxd_file_type_suffix);
+ dk4_er_t er;
+ FILE *fp = NULL;
+
+ m_iState = S_NOOP;
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sLibraryDir, m_sLibraryShort,
+ sFileTypes, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sLibraryDir, m_sLibraryShort,
+ sFileTypes, wxOPEN
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ m_sLibraryDir = dlg.GetDirectory();
+ m_sLibraryShort = dlg.GetFilename();
+ {
+ wxFFile wxff(pa);
+ if (wxff.IsOpened()) {
+ fp = wxff.Detach();
+ if (NULL != fp) {
+
+
+#line 2075 "WxdkdrawFrameEvents.cpt"
+ wxdrd_status_init(&m_oStatusReader);
+ m_pCurrent = wxdrd_read_symbol(m_pDrw,fp,&m_oStatusReader);
+ if (NULL != m_pCurrent) {
+ UpdateStipples();
+ UpdateFonts();
+ UpdateImages();
+ m_iState = S_LIBELEM_PLACE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ m_ptMouseMoveStart.x = m_oStatusReader.bb.xl;
+ m_ptMouseMoveStart.y = m_oStatusReader.bb.yb;
+ dk4error_init(&er);
+ m_ptMouseMoveDiff.x = dk4ma_int32_t_sub(
+ m_ptMousePosGrid.x, m_oStatusReader.bb.xl, &er
+ );
+ m_ptMouseMoveDiff.y = dk4ma_int32_t_sub(
+ m_ptMousePosGrid.y, m_oStatusReader.bb.yb, &er
+ );
+ m_bMouseDiff = (DK4_E_NONE == er.ec);
+ m_iState = S_LIBELEM_PLACE;
+ wxdobj_drw_require_redraw(
+ m_pDrw, WXD_REFRESH_MARKUP
+ );
+ }
+ else {
+ /* ERROR: Failed to read file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_READ_FILE
+ );
+ m_iState = S_NOOP;
+ }
+ fclose(fp);
+ }
+ else {
+ /* ERROR: Failed to open file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ m_iState = S_NOOP;
+ }
+ }
+ else {
+ /* ERROR: Failed to open file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ m_iState = S_NOOP;
+ }
+ }
+ }
+ else {
+ m_iState = S_NOOP;
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnAddLibelem(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2136 "WxdkdrawFrameEvents.cpt"
+
+
+#line 2137 "WxdkdrawFrameEvents.cpt"
+ wxdrd_status_init(&m_oStatusReader);
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ AddLibelem();
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2145 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditCopy(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2153 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ m_iState = S_COPY_SELECT;
+ SetMouseAndStatusTexts(S_COPY_SELECT);
+ EndEventHandling();
+ }
+
+
+#line 2164 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditMove(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2172 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ m_iState = S_MOVE_SELECT;
+ SetMouseAndStatusTexts(S_MOVE_SELECT);
+ EndEventHandling();
+ }
+
+
+#line 2183 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditDelete(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2191 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_DELETE;
+ SetMouseAndStatusTexts(S_DELETE);
+ EndEventHandling();
+ }
+
+
+#line 2198 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditPointMove(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2206 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_MOVEPT_SELECT;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2214 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditPointAdd(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2222 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_ADDPT_SELECT;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2230 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditPointDelete(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2238 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_DELPT;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2246 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditDetails(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2254 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_DETAILS;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2262 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditGroup(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2270 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_GROUP_ONE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2279 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditGroup3(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2287 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_GROUP_RECT_1;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2296 "WxdkdrawFrameEvents.cpt"
+}
+
+
+void
+WxdkdrawFrame::OnEditUngroup(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2303 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_UNGROUP;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2311 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditFlipH(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2319 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_bVerticalFlip = false;
+ m_iState = S_FLIP;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2329 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditFlipV(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2337 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_bVerticalFlip = true;
+ m_iState = S_FLIP;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2347 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditRotateLeft(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2355 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_bSplineInterpolated = false;
+ m_iState = S_ROTATE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2366 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditRotateRight(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2374 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_bSplineInterpolated = true;
+ m_iState = S_ROTATE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 2385 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditChangeSize(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2393 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_DRWSZ_SELECT;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ m_bHaveCornerPoint = false;
+ m_uCurrent = 0U;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ DK4_MEMCPY(&m_oOldSize,&(m_pDrw->bb),sizeof(Wxd_bb_t));
+ DK4_MEMCPY(&(m_oBorder.det.b.b),&(m_pDrw->bb),sizeof(Wxd_bb_t));
+ EndEventHandling();
+ }
+
+
+#line 2406 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnLayersAll(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_layer_t *play;
+
+
+#line 2415 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ dk4sto_it_reset(m_pDrw->i_layers);
+ do {
+ play = (Wxd_layer_t *)dk4sto_it_next(m_pDrw->i_layers);
+ if (NULL != play) {
+ if (0x00 == play->active) {
+ play->active = 0x01;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+ } while (NULL != play);
+ EndEventHandling();
+ }
+
+
+#line 2429 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnLayerManager(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_layer_cb_t *pLayerCb;
+ Wxd_layer_t *pLayer;
+ size_t nl;
+ size_t i;
+ bool changed;
+
+
+#line 2442 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ nl = wxdobj_get_number_of_layers(m_pDrw);
+
+
+#line 2445 "WxdkdrawFrameEvents.cpt"
+ if ((size_t)0U < nl) {
+ pLayerCb = dk4mem_new(Wxd_layer_cb_t,nl,NULL);
+ if (NULL != pLayerCb) {
+ for (i = 0; i < nl; i++) {
+
+
+#line 2450 "WxdkdrawFrameEvents.cpt"
+ pLayerCb[i].lay = NULL;
+ pLayerCb[i].cb = NULL;
+ pLayerCb[i].oa = 0x00;
+ }
+ i = 0;
+ dk4sto_it_reset(m_pDrw->i_layers);
+ do {
+ pLayer = (Wxd_layer_t *)dk4sto_it_next(m_pDrw->i_layers);
+ if (NULL != pLayer) {
+ if (i < nl) {
+
+
+#line 2461 "WxdkdrawFrameEvents.cpt"
+ pLayerCb[i].lay = pLayer;
+ pLayerCb[i].oa = pLayer->active;
+ i++;
+ }
+ }
+ } while (NULL != pLayer);
+ WxdkdrawDlgLayerManager dlg(this, m_pDrw, sTexts, pLayerCb, nl);
+ if (wxID_OK != dlg.ShowModal()) {
+ changed = false;
+ for (i = 0; i < nl; i++) {
+ if (NULL != pLayerCb[i].lay) {
+ if (0x00 != pLayerCb[i].oa) {
+ if (0x00 == (pLayerCb[i].lay)->active) {
+ (pLayerCb[i].lay)->active = 0x01;
+ changed = true;
+ }
+ }
+ else {
+ if (0x00 != (pLayerCb[i].lay)->active) {
+ (pLayerCb[i].lay)->active = 0x01;
+ changed = true;
+ }
+ }
+ }
+ }
+ if (changed) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2492 "WxdkdrawFrameEvents.cpt"
+ }
+#endif
+ for (i = 0; i < nl; i++) {
+ pLayerCb[i].lay = NULL;
+ pLayerCb[i].cb = NULL;
+ pLayerCb[i].oa = 0x00;
+ }
+ dk4mem_free(pLayerCb);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* NOTICE: No layer currently in use */
+ wxMessageBox(
+ sTexts[368], sTexts[369],
+ (wxOK | wxCENTRE | wxICON_INFORMATION)
+ );
+ }
+ EndEventHandling();
+ }
+
+
+#line 2518 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnCenterViewFunction(void)
+{
+ dk4_er_t er; /* Error report */
+
+
+#line 2527 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ dk4error_init(&er);
+ m_pDrw->cx =
+ dk4ma_int32_t_add((m_pDrw->bb).xl, (m_pDrw->bb).xr, &er) / (int32_t)2L;
+ if (DK4_E_NONE != er.ec) {
+ m_pDrw->cx =
+ (m_pDrw->bb).xl / (int32_t)2L + (m_pDrw->bb).xr / (int32_t)2L;
+ }
+ dk4error_init(&er);
+ m_pDrw->cy =
+ dk4ma_int32_t_add((m_pDrw->bb).yb, (m_pDrw->bb).yt, &er) / (int32_t)2L;
+ if (DK4_E_NONE != er.ec) {
+ m_pDrw->cy =
+ (m_pDrw->bb).yb / (int32_t)2L + (m_pDrw->bb).yt / (int32_t)2L;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ AdjustScrollbars();
+ EndEventHandling();
+ }
+
+
+#line 2549 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnCenterView(wxCommandEvent & WXUNUSED(event))
+{
+ OnCenterViewFunction();
+}
+
+
+
+void
+WxdkdrawFrame::OnGridOnOff(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2565 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ EndEventHandling();
+ }
+
+
+#line 2572 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnGridUnit(wxCommandEvent & WXUNUSED(event))
+{
+ int seli; /* Selected index */
+
+
+#line 2581 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ seli = cbGridUnit->GetSelection();
+ switch (seli) {
+ case 0: {
+ m_pDrw->gridunit = (uint8_t)0U;
+ } break;
+ default : {
+ m_pDrw->gridunit = (uint8_t)1U;
+ } break;
+ }
+ drawco->CalculateGridDistances();
+ if (cbGridOnOff->GetValue()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+ EndEventHandling();
+ }
+
+
+#line 2600 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnGridBase(wxCommandEvent & WXUNUSED(event))
+{
+ int seli; /* Selected index */
+
+
+#line 2609 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ seli = cbGridBase->GetSelection();
+ switch (seli) {
+ case 0: {
+ m_pDrw->gridbase = (uint8_t)0U;
+ } break;
+ default : {
+ m_pDrw->gridbase = (uint8_t)1U;
+ } break;
+ }
+ drawco->CalculateGridDistances();
+ if (cbGridOnOff->GetValue()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+ EndEventHandling();
+ }
+
+
+#line 2628 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnPlacementHelp(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 2636 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ EndEventHandling();
+ }
+
+
+#line 2643 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineColour(wxCommandEvent & WXUNUSED(event))
+{
+ int r;
+ int g;
+ int b;
+
+
+#line 2654 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ r = ccLineColour->Red();
+ g = ccLineColour->Green();
+ b = ccLineColour->Blue();
+ if (NULL != m_pStyle) {
+ if (
+ ((uint8_t)r != m_pStyle->sc[0])
+ || ((uint8_t)g != m_pStyle->sc[1])
+ || ((uint8_t)b != m_pStyle->sc[2])
+ ) {
+ switch (m_pStyle->ot) {
+ case WXD_OT_TEXT :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ m_pStyle->sc[0] = (uint8_t)r;
+ m_pStyle->sc[1] = (uint8_t)g;
+ m_pStyle->sc[2] = (uint8_t)b;
+#if 0
+ m_pStyle->fc[0] = (uint8_t)r;
+ m_pStyle->fc[1] = (uint8_t)g;
+ m_pStyle->fc[2] = (uint8_t)b;
+#endif
+ } break;
+ default : {
+ m_pStyle->sc[0] = (uint8_t)r;
+ m_pStyle->sc[1] = (uint8_t)g;
+ m_pStyle->sc[2] = (uint8_t)b;
+ } break;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ else {
+ m_oStyle.sc[0] = (uint8_t)r;
+ m_oStyle.sc[1] = (uint8_t)g;
+ m_oStyle.sc[2] = (uint8_t)b;
+ }
+ EndEventHandling();
+ }
+
+
+#line 2695 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLayer(wxSpinEvent & WXUNUSED(event))
+{
+ int nl;
+
+
+#line 2704 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ nl = spLayerNumber->GetValue();
+ if (NULL != m_pStyle) {
+ if (nl != m_pStyle->lay) {
+ SetModified();
+ if (0 == wxdobj_modify_layer(m_pDrw, m_pStyle, nl)) {
+ m_pStyle = NULL;
+ RequireRedraw(WXD_REFRESH_DRAWING);
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ }
+ else {
+ m_oStyle.lay = nl;
+ }
+ EndEventHandling();
+ }
+
+
+#line 2725 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineWidth(wxSpinEvent & WXUNUSED(event))
+{
+ int lw;
+
+
+#line 2734 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ lw = spLineWidth->GetValue();
+ if (NULL != m_pStyle) {
+ if ((uint16_t)lw != m_pStyle->lw) {
+ m_pStyle->lw = (uint16_t)lw;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ else {
+ m_oStyle.lw = (uint16_t)lw;
+ }
+ EndEventHandling();
+ }
+
+
+#line 2749 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineStyle(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj; /* Object to modify */
+ int res; /* Result from showing dialog */
+ uint8_t ols; /* Old line style */
+ uint8_t osv; /* Old style value */
+ uint8_t nls; /* New line style */
+ uint8_t nsv; /* New style value */
+ bool bDrwElem; /* Object is drawing element */
+ bool bRefresh; /* Refresh draw control */
+
+
+#line 2765 "WxdkdrawFrameEvents.cpt"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = ((NULL != m_pStyle) ? (true) : (false));
+ if (BeginEventHandling()) {
+ WxdkdrawDlgLineStyle dlg(
+ this, pobj, sTexts, ms_ls_images, bDrwElem
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleLineStyle, dlg);
+ ols = pobj->ls;
+#if 0
+ /* 2020-03-24 Modification
+ Line below removed due to clang static analyzers complaints
+ about dead assignment.
+ */
+ nls = ols;
+#endif
+ osv = pobj->sl;
+#if 0
+ /* 2020-03-24 Modification
+ Line below removed due to clang static analyzers complaints
+ about dead assignment.
+ */
+ nsv = osv;
+#endif
+ res = dlg.ShowModal();
+ switch (res) {
+ case wxID_OK : {
+ nls = pobj->ls;
+ if (nls != ols) {
+ if (NULL != m_pStyle) {
+ if (WXD_LS_SOLID == ols) {
+ pobj->sl = m_iv[IVI_STYLE_VALUE];
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ drawco->Refresh();
+ drawco->Update();
+ }
+ bStyleLineStyle->SetBitmap(ms_ls_images[nls]);
+ bStyleLineStyle->Refresh();
+ m_bUpdate = true;
+ }
+ switch (nls) {
+ case WXD_LS_DASH :
+ case WXD_LS_DASH_DOT :
+ case WXD_LS_DASH_DOT_DOT :
+ case WXD_LS_DASH_DOT_DOT_DOT : {
+
+
+#line 2812 "WxdkdrawFrameEvents.cpt"
+ WxdkdrawDlgStyleLength dlh(
+ this, pobj, bDrwElem, sTexts
+ );
+
+
+#line 2816 "WxdkdrawFrameEvents.cpt"
+ Dk4WxApplicationHelper::ChooseChildPosition(
+ *bStyleLineStyle, dlh
+ );
+
+
+#line 2820 "WxdkdrawFrameEvents.cpt"
+ res = dlh.ShowModal();
+
+
+#line 2822 "WxdkdrawFrameEvents.cpt"
+ switch (res) {
+ case wxID_OK :
+ case wxID_CANCEL : {
+
+
+#line 2826 "WxdkdrawFrameEvents.cpt"
+ bRefresh = true;
+ nsv = pobj->sl;
+ if (wxID_OK == res) {
+ m_iv[IVI_STYLE_VALUE ] = nsv;
+ }
+ if (nsv == pobj->sl) {
+
+#line 2832 "WxdkdrawFrameEvents.cpt"
+ bRefresh = false;
+ }
+ else {
+
+#line 2835 "WxdkdrawFrameEvents.cpt"
+ }
+ if (osv != nsv) {
+ SetModified();
+ }
+ if (bRefresh) {
+ wxdobj_drw_require_redraw(
+ m_pDrw, WXD_REFRESH_DRAWING
+ );
+ }
+
+
+#line 2845 "WxdkdrawFrameEvents.cpt"
+ } break;
+ }
+ } break;
+ }
+ } break;
+ case wxID_CANCEL : {
+ } break;
+ }
+ EndEventHandling();
+ }
+
+
+#line 2856 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineCap(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t ocs;
+ uint8_t ncs;
+ bool bDrwElem;
+
+
+#line 2869 "WxdkdrawFrameEvents.cpt"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ ocs = ncs = pobj->cs;
+ if (BeginEventHandling()) {
+ WxdkdrawDlgLineCap dlg(this, pobj, sTexts, ms_lc_images, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleLineEnds, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ ncs = pobj->cs;
+ if (ocs != ncs) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ bStyleLineEnds->SetBitmap(ms_lc_images[ncs]);
+ bStyleLineEnds->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ EndEventHandling();
+ }
+
+
+#line 2891 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineJoin(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t ojs;
+ uint8_t njs;
+ uint8_t oml;
+ uint8_t nml;
+ bool bDrwElem;
+
+
+#line 2906 "WxdkdrawFrameEvents.cpt"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ ojs = njs = pobj->js;
+ oml = nml = pobj->ml;
+ if (BeginEventHandling()) {
+ WxdkdrawDlgLineJoin dlg(this, pobj, sTexts, ms_lj_images, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleLineJoins, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ njs = pobj->js;
+ if (ojs != njs) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ if (WXD_LJ_MITERED == njs) {
+ pobj->ml = m_iv[IVI_MITER_LIMIT];
+ drawco->Refresh();
+ drawco->Update();
+ }
+ }
+ bStyleLineJoins->SetBitmap(ms_lj_images[njs]);
+ bStyleLineJoins->Refresh();
+ m_bUpdate = true;
+ }
+ if (WXD_LJ_MITERED == njs) {
+ WxdkdrawDlgMiterLimit dlh(this, pobj, sTexts, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(
+ *bStyleLineJoins, dlh
+ );
+ res = dlh.ShowModal();
+ if (wxID_OK == res) {
+
+#line 2937 "WxdkdrawFrameEvents.cpt"
+ nml = pobj->ml;
+
+#line 2938 "WxdkdrawFrameEvents.cpt"
+ m_iv[IVI_MITER_LIMIT] = nml;
+ if (oml != nml) {
+ SetModified();
+ }
+ }
+ }
+ }
+ EndEventHandling();
+ }
+
+
+#line 2948 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineArrowF(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t oat;
+ uint8_t nat;
+ uint8_t oal;
+ uint8_t nal;
+ uint8_t oaw;
+ uint8_t naw;
+ bool bDrwElem;
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ oat = nat = pobj->aft;
+ oal = nal = pobj->afl;
+ oaw = naw = pobj->afw;
+
+
+#line 2970 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ WxdkdrawDlgArrowType dlg(
+ this, pobj, sTexts, ms_arrow_images, bDrwElem, false
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleArrowForward, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ nat = pobj->aft;
+ if (oat != nat) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ /*
+ 2020-03-20 Show new arrow style immediately
+ */
+ if (0 == oat) {
+ pobj->afl = m_iv[IVI_ARROWHEAD_LENGTH];
+ pobj->afw = m_iv[IVI_ARROWHEAD_WIDTH];
+ }
+ drawco->Refresh();
+ drawco->Update();
+ }
+ bStyleArrowForward->SetBitmap(ms_arrow_images[nat]);
+ bStyleArrowForward->Refresh();
+ m_bUpdate = true;
+ }
+ if (0U != nat) {
+ WxdkdrawDlgArrowSize dlh(this, pobj, sTexts, bDrwElem, false);
+ Dk4WxApplicationHelper::ChooseChildPosition(
+ *bStyleArrowForward, dlh
+ );
+ res = dlh.ShowModal();
+ if (wxID_OK == res) {
+ nal = pobj->afl;
+ naw = pobj->afw;
+ m_iv[IVI_ARROWHEAD_LENGTH] = nal;
+ m_iv[IVI_ARROWHEAD_WIDTH] = naw;
+ if ((oal != nal) || (oaw != naw)) {
+ if (NULL != m_pStyle) {
+ SetModified();
+ wxdobj_drw_require_redraw(
+ m_pDrw, WXD_REFRESH_DRAWING
+ );
+ }
+ }
+ }
+ }
+ }
+ EndEventHandling();
+ }
+
+
+#line 3021 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineArrowB(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t oat;
+ uint8_t nat;
+ uint8_t oal;
+ uint8_t nal;
+ uint8_t oaw;
+ uint8_t naw;
+ bool bDrwElem;
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ oat = nat = pobj->abt;
+ oal = nal = pobj->abl;
+ oaw = naw = pobj->abw;
+
+
+#line 3043 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ WxdkdrawDlgArrowType dlg(
+ this, pobj, sTexts, ms_arrow_images, bDrwElem, true
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleArrowBackward, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ nat = pobj->abt;
+ if (oat != nat) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ if (0 == oat) {
+ pobj->abl = m_iv[IVI_ARROWHEAD_LENGTH];
+ pobj->abw = m_iv[IVI_ARROWHEAD_WIDTH];
+ }
+ drawco->Refresh();
+ drawco->Update();
+ }
+ bStyleArrowBackward->SetBitmap(ms_arrow_images[nat]);
+ bStyleArrowBackward->Refresh();
+ m_bUpdate = true;
+ }
+ if (0U != nat) {
+ WxdkdrawDlgArrowSize dlh(this, pobj, sTexts, bDrwElem, true);
+ Dk4WxApplicationHelper::ChooseChildPosition(
+ *bStyleArrowForward, dlh
+ );
+ res = dlh.ShowModal();
+ if (wxID_OK == res) {
+ nal = pobj->abl;
+ naw = pobj->abw;
+ m_iv[IVI_ARROWHEAD_LENGTH] = nal;
+ m_iv[IVI_ARROWHEAD_WIDTH] = naw;
+ if ((oal != nal) || (oaw != naw)) {
+ if (NULL != m_pStyle) {
+ SetModified();
+ wxdobj_drw_require_redraw(
+ m_pDrw, WXD_REFRESH_DRAWING
+ );
+ }
+ }
+ }
+ }
+ }
+ EndEventHandling();
+ }
+
+
+#line 3091 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleFillColour(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_stipple_t *pstip;
+ int r;
+ int g;
+ int b;
+ bool hsti;
+
+
+#line 3104 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ r = ccFillColour->Red();
+ g = ccFillColour->Green();
+ b = ccFillColour->Blue();
+ if (NULL != m_pStyle) {
+ if (
+ ((uint8_t)r != m_pStyle->fc[0])
+ || ((uint8_t)g != m_pStyle->fc[1])
+ || ((uint8_t)b != m_pStyle->fc[2])
+ ) {
+ m_pStyle->fc[0] = (uint8_t)r;
+ m_pStyle->fc[1] = (uint8_t)g;
+ m_pStyle->fc[2] = (uint8_t)b;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ hsti = (NULL != m_pStyle->psti);
+ if (WXD_FS_PURE < m_pStyle->fs) {
+ pstip = wxdobj_find_stipple_structure(m_pDrw, m_pStyle);
+ m_pStyle->psti = pstip;
+ }
+ else {
+ m_pStyle->psti = NULL;
+ }
+ if (hsti) {
+
+#line 3128 "WxdkdrawFrameEvents.cpt"
+ wxdobj_remove_unused_stipples(m_pDrw);
+ }
+ if (NULL != m_pStyle->psti) {
+ if (NULL == (m_pStyle->psti)->bm) {
+ UpdateOneStipple(m_pStyle->psti);
+ }
+ }
+ }
+ }
+ else {
+ m_oStyle.fc[0] = r;
+ m_oStyle.fc[1] = g;
+ m_oStyle.fc[2] = b;
+ }
+ EndEventHandling();
+ }
+
+
+#line 3145 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleFillPattern(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ Wxd_stipple_t *pstip;
+ int res;
+ uint8_t ofs;
+ uint8_t nfs;
+ bool hsti;
+ bool bDrwElem;
+
+
+#line 3160 "WxdkdrawFrameEvents.cpt"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ ofs = nfs = pobj->fs;
+ if (BeginEventHandling()) {
+ WxdkdrawDlgFillStyle dlg(this, pobj, sTexts, ms_fs_images, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleFillPattern, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ nfs = pobj->fs;
+ if (ofs != nfs) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ hsti = (NULL != m_pStyle->psti);
+ if (WXD_FS_PURE < m_pStyle->fs) {
+ pstip = wxdobj_find_stipple_structure(m_pDrw, m_pStyle);
+ m_pStyle->psti = pstip;
+ }
+ else {
+ m_pStyle->psti = NULL;
+ }
+ if (hsti) {
+ wxdobj_remove_unused_stipples(m_pDrw);
+ }
+ if (NULL != m_pStyle->psti) {
+ if (NULL == (m_pStyle->psti)->bm) {
+ UpdateOneStipple(m_pStyle->psti);
+ }
+ }
+ }
+ bStyleFillPattern->SetBitmap(ms_fs_images[nfs]);
+ bStyleFillPattern->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ EndEventHandling();
+ }
+
+
+#line 3198 "WxdkdrawFrameEvents.cpt"
+}
+
+
+void
+WxdkdrawFrame::OnStyleTextLatex(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3205 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ if (cbStyleTextLaTeX->GetValue()) {
+ if (NULL != m_pStyle) {
+ (m_pStyle->det).t.fl |= WXD_TEXT_FLAG_LATEX;
+ }
+ else {
+ m_oStyle.det.t.fl |= WXD_TEXT_FLAG_LATEX;
+ }
+ }
+ else {
+ if (NULL != m_pStyle) {
+ (m_pStyle->det).t.fl &= (~(WXD_TEXT_FLAG_LATEX));
+ }
+ else {
+ m_oStyle.det.t.fl &= (~(WXD_TEXT_FLAG_LATEX));
+ }
+ }
+ if (NULL != m_pStyle) {
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ EndEventHandling();
+ }
+
+
+#line 3229 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleTextAlign(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t oal;
+ uint8_t nal;
+ bool bDrwElem;
+
+
+#line 3242 "WxdkdrawFrameEvents.cpt"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ oal = nal = WXD_TA_LEFT;
+ if (WXD_OT_TEXT == pobj->ot) { oal = nal = (pobj->det).t.al; }
+ if (BeginEventHandling()) {
+ WxdkdrawDlgTextAlign dlg(this, pobj, sTexts, ms_ta_images, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleTextAlign, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ nal = (pobj->det).t.al;
+ if (oal != nal) {
+ if (WXD_OT_TEXT == pobj->ot) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ bStyleTextAlign->SetBitmap(ms_ta_images[nal]);
+ bStyleLineEnds->Refresh();
+ m_bUpdate = true;
+ }
+ else {
+ if (NULL == m_pStyle) {
+ bStyleTextAlign->SetBitmap(ms_ta_images[nal]);
+ bStyleLineEnds->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ }
+ }
+ EndEventHandling();
+ }
+
+
+#line 3274 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleTextFont(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t ofind;
+ bool isobj;
+
+ if (NULL != m_pStyle) {
+ pobj = m_pStyle;
+ isobj = true;
+ }
+ else {
+ pobj = &m_oStyle;
+ isobj = false;
+ }
+ ofind = (pobj->det).t.find;
+ if (DK4_FONT_MAX < ofind) { ofind = DK4_FONT_MAX; }
+ if (BeginEventHandling()) {
+ WxdkdrawDlgFontName dlg(this, pobj, isobj, sTexts, ms_fn_images);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleFontName, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK != res) {
+ UpdateTextForFont(pobj, false);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ if (ofind != (pobj->det).t.find) {
+ SetModified();
+ bStyleFontName->SetBitmap(ms_fn_images[(pobj->det).t.find]);
+ bStyleFontName->Refresh();
+ m_bUpdate = true;
+ }
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleTextSize(wxSpinEvent & WXUNUSED(event))
+{
+ Wxd_font_t *pfont;
+ uint16_t ofs;
+ uint16_t nfs;
+ bool hasf;
+
+
+#line 3324 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ if (NULL != m_pStyle) {
+ if (WXD_OT_TEXT == m_pStyle->ot) {
+ ofs = nfs = (m_pStyle->det).t.fsz;
+ nfs = (uint16_t)(spFontSize->GetValue());
+ if (ofs != nfs) {
+ (m_pStyle->det).t.fsz = nfs;
+ hasf = (NULL != (m_pStyle->det).t.font);
+ pfont = FindFont((m_pStyle->det).t.find, nfs);
+ (m_pStyle->det).t.font = pfont;
+ if (NULL != pfont) { UpdateOneFont(pfont); }
+ if (hasf) { wxdobj_remove_unused_fonts(m_pDrw); }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ }
+ else {
+ m_oStyle.det.t.fsz = (uint16_t)(spFontSize->GetValue());
+ }
+ EndEventHandling();
+ }
+
+
+#line 3347 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnSpinRotation(wxSpinEvent & WXUNUSED(event))
+{
+
+
+#line 3355 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ if (NULL != m_pStyle) {
+ switch ( (int)(m_pStyle->ot) ) {
+ case WXD_OT_TEXT : {
+ (m_pStyle->det).t.a = spRotation->GetValue();
+ SetModified();
+ RequireRedraw(WXD_REFRESH_DRAWING);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ (m_pStyle->det).e.a = spRotation->GetValue();
+ SetModified();
+ RequireRedraw(WXD_REFRESH_DRAWING);
+ } break;
+ }
+ }
+ EndEventHandling();
+ }
+
+
+#line 3373 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnScrollH(wxScrollEvent & WXUNUSED(event))
+{
+
+
+#line 3381 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ UseScrollH();
+ EndEventHandling();
+ }
+
+
+#line 3386 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnScrollV(wxScrollEvent & WXUNUSED(event))
+{
+
+
+#line 3394 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ UseScrollV();
+ EndEventHandling();
+ }
+
+
+#line 3399 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert1(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3407 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_POLYGON;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3416 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert2(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3424 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_POLYLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3433 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert3(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3441 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = true;
+ m_iObjToCreate = WXD_OT_O_SPLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3450 "WxdkdrawFrameEvents.cpt"
+}
+
+
+void
+WxdkdrawFrame::OnConvert4(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3457 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_C_ARC;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3466 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert5(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3474 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_O_ARC;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3483 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert6(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3491 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_C_SPLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3500 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert7(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3508 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_O_SPLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3517 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert8(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3525 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_DOT_WHITE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3534 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert9(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3542 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_DOT_FILLED;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3551 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvertA(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3559 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = true;
+ m_iObjToCreate = WXD_OT_C_SPLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3568 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnColourBorderModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_BORDER_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourBorderReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_BORDER_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourBackgroundModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_BG_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourBackgroundReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_BG_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourGridModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_GRID_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourGridReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_GRID_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourPlacementModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_PH_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourPlacementReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_PH_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourCopyModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_M_COPY_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourCopyReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_M_COPY_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourMoveModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_M_MOVE_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourMoveReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_M_MOVE_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourDeleteModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_M_DEL_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourDeleteReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_M_DEL_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourGroupModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_M_GROUP_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourGroupReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_M_GROUP_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourMissingModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_MISSIMG_RED, WXD_REFRESH_DRAWING);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourMissingReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_MISSIMG_RED, WXD_REFRESH_DRAWING);
+ EndEventHandling();
+ }
+}
+
+
+
+
+void
+WxdkdrawFrame::OnResetOptions(wxCommandEvent & WXUNUSED(event))
+{
+ int res; /* Message box result */
+
+
+#line 3776 "WxdkdrawFrameEvents.cpt"
+ if (m_bActive) {
+ Dk4WxYesNoDialog dlg(
+ this, pAppHelp, sTexts[605], sTexts[604]
+ );
+ StartEventHandling();
+#if VERSION_BEFORE_2020_08_23
+ res = wxMessageBox(
+ sTexts[605], sTexts[604], (wxYES_NO | wxICON_QUESTION)
+ );
+#else
+ res = dlg.ShowModal();
+#endif
+ if (wxYES == res) {
+ ResetConfiguration();
+ cbGridOnOff->SetValue(true);
+ cbPH->SetValue(false);
+ if (
+ (S_NOOP != m_iState) || (NULL == m_pStyle)
+ || (&m_oStyle == m_pStyle)
+ ) {
+ StyleToGUI();
+ }
+ cbGridOnOff->Refresh();
+ cbPH->Refresh();
+ if ((NULL != m_pDrw) && (NULL != drawco)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ }
+ m_bUpdate = true;
+ }
+ EndEventHandling();
+ }
+
+
+#line 3809 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnModifySplineValue(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3817 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_MOD_SPLINE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+
+
+#line 3826 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnOptionsNewObjects(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3834 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ WxdkdrawDlgOptionsNewObjects dlg(
+ this,
+ &(m_iv[IVI_DOT_DIAMETER_FILLED]),
+ &(m_iv[IVI_DOT_DIAMETER_WHITE]),
+ sTexts
+ );
+ dlg.ShowModal();
+ EndEventHandling();
+ }
+
+
+#line 3846 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::OnOptionsScreenRepresentation(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 3854 "WxdkdrawFrameEvents.cpt"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ WxdkdrawDlgOptionsScreen dlg(
+ this, drawco, m_pDrw,
+ &(m_iv[IVI_XS_SUBSEGS]), &(m_iv[IVI_FONT_EXACT]),
+ &(m_iv[IVI_REDUCE_MARKUP_POINTS]), sTexts
+ );
+ dlg.ShowModal();
+ UpdateFonts();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ drawco->Refresh();
+ m_bUpdate = true;
+ EndEventHandling();
+ }
+
+
+#line 3869 "WxdkdrawFrameEvents.cpt"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawFrameEvents.cpt b/support/dktools/WxdkdrawFrameEvents.cpt
new file mode 100644
index 0000000000..79b0dfaed2
--- /dev/null
+++ b/support/dktools/WxdkdrawFrameEvents.cpt
@@ -0,0 +1,3874 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% module
+
+#include "wxdkdraw.h"
+
+#ifndef DK4WXYESNODIALOG_H_INCLUDED
+#include "Dk4WxYesNoDialog.h"
+#endif
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+#ifndef WXDKDRAWDLGLINESTYLE_H_INCLUDED
+#include "WxdkdrawDlgLineStyle.h"
+#endif
+
+#ifndef WXDKDRAWDLGSTYLELENGTH_H_INCLUDED
+#include "WxdkdrawDlgStyleLength.h"
+#endif
+
+#ifndef WXDKDRAWDLGLINEJOIN_H_INCLUDED
+#include "WxdkdrawDlgLineJoin.h"
+#endif
+
+#ifndef WXDKDRAWDLGMITERLIMIT_H_INCLUDED
+#include "WxdkdrawDlgMiterLimit.h"
+#endif
+
+#ifndef WXDKDRAWDLGLINECAP_H_INCLUDED
+#include "WxdkdrawDlgLineCap.h"
+#endif
+
+#ifndef WXDKDRAWDLGARROWTYPE_H_INCLUDED
+#include "WxdkdrawDlgArrowType.h"
+#endif
+
+#ifndef WXDKDRAWDLGARROWSIZE_H_INCLUDED
+#include "WxdkdrawDlgArrowSize.h"
+#endif
+
+#ifndef WXDKDRAWDLGFILLSTYLE_H_INCLUDED
+#include "WxdkdrawDlgFillStyle.h"
+#endif
+
+#ifndef WXDKDRAWDLGTEXTALIGN_H_INCLUDED
+#include "WxdkdrawDlgTextAlign.h"
+#endif
+
+#ifndef WXDKDRAWDLGFONTNAME_H_INCLUDED
+#include "WxdkdrawDlgFontName.h"
+#endif
+
+#ifndef WXDKDRAWDLGLAYERMANAGER_H_INCLUDED
+#include "WxdkdrawDlgLayerManager.h"
+#endif
+
+#ifndef WXDKDRAWDLGTEXTINPUT_H_INCLUDED
+#include "WxdkdrawDlgTextInput.h"
+#endif
+
+#ifndef WXDKDRAWDLGSPLINEVALUE_H_INCLUDED
+#include "WxdkdrawDlgSplineValue.h"
+#endif
+
+#ifndef WXDKDRAWDLGOPTIONSNEWOBJECTS_H_INCLUDED
+#include "WxdkdrawDlgOptionsNewObjects.h"
+#endif
+
+#ifndef WXDKDRAWDLGOPTIONSSCREEN_H_INCLUDED
+#include "WxdkdrawDlgOptionsScreen.h"
+#endif
+
+
+$!trace-include
+
+
+
+/** Events the frame must handle.
+*/
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxdkdrawFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WxdkdrawFrame,wxFrame)
+#endif
+ EVT_MENU(\
+ wxID_EXIT,\
+ WxdkdrawFrame::OnQuit\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_HELP_ABOUT,\
+ WxdkdrawFrame::OnAbout\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_HELP_CONTENTS,\
+ WxdkdrawFrame::OnHelpContents\
+ )
+ EVT_MENU(\
+ wxID_NEW,\
+ WxdkdrawFrame::OnFileNew\
+ )
+ EVT_MENU(\
+ wxID_OPEN,\
+ WxdkdrawFrame::OnFileOpen\
+ )
+ EVT_BUTTON(\
+ wxID_OPEN,\
+ WxdkdrawFrame::OnFileOpen\
+ )
+ EVT_MENU(\
+ wxID_SAVE,\
+ WxdkdrawFrame::OnFileSave\
+ )
+ EVT_BUTTON(\
+ wxID_SAVE,\
+ WxdkdrawFrame::OnFileSave\
+ )
+ EVT_MENU(\
+ wxID_SAVEAS,\
+ WxdkdrawFrame::OnFileSaveAs\
+ )
+ EVT_MENU(\
+ wxID_ZOOM_IN,\
+ WxdkdrawFrame::OnZoomIn\
+ )
+ EVT_BUTTON(\
+ wxID_ZOOM_IN,\
+ WxdkdrawFrame::OnZoomIn\
+ )
+ EVT_MENU(\
+ wxID_ZOOM_OUT,\
+ WxdkdrawFrame::OnZoomOut\
+ )
+ EVT_BUTTON(\
+ wxID_ZOOM_OUT,\
+ WxdkdrawFrame::OnZoomOut\
+ )
+ EVT_MENU(\
+ wxID_ZOOM_100,\
+ WxdkdrawFrame::OnZoom100\
+ )
+ EVT_BUTTON(\
+ wxID_ZOOM_100,\
+ WxdkdrawFrame::OnZoom100\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_POLYINE,\
+ WxdkdrawFrame::OnAddPolyline\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_POLYINE,\
+ WxdkdrawFrame::OnAddPolyline\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_POLYGON,\
+ WxdkdrawFrame::OnAddPolygon\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_POLYGON,\
+ WxdkdrawFrame::OnAddPolygon\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_RECT,\
+ WxdkdrawFrame::OnAddRectangle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_RECT,\
+ WxdkdrawFrame::OnAddRectangle\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_BOX,\
+ WxdkdrawFrame::OnAddBox\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_BOX,\
+ WxdkdrawFrame::OnAddBox\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_CIRCLE,\
+ WxdkdrawFrame::OnAddCircle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_CIRCLE,\
+ WxdkdrawFrame::OnAddCircle\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_ELLIPSE,\
+ WxdkdrawFrame::OnAddEllipse\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_ELLIPSE,\
+ WxdkdrawFrame::OnAddEllipse\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_ARC_O,\
+ WxdkdrawFrame::OnAddArcOpen\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_ARC_O,\
+ WxdkdrawFrame::OnAddArcOpen\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_ARC_C,\
+ WxdkdrawFrame::OnAddArcClosed\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_ARC_C,\
+ WxdkdrawFrame::OnAddArcClosed\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_SPL_AO,\
+ WxdkdrawFrame::OnAddSplineAO\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_SPL_AO,\
+ WxdkdrawFrame::OnAddSplineAO\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_SPL_AC,\
+ WxdkdrawFrame::OnAddSplineAC\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_SPL_AC,\
+ WxdkdrawFrame::OnAddSplineAC\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_SPL_IO,\
+ WxdkdrawFrame::OnAddSplineIO\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_SPL_IO,\
+ WxdkdrawFrame::OnAddSplineIO\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_SPL_IC,\
+ WxdkdrawFrame::OnAddSplineIC\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_SPL_IC,\
+ WxdkdrawFrame::OnAddSplineIC\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_DOT_C,\
+ WxdkdrawFrame::OnAddDot\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_DOT_C,\
+ WxdkdrawFrame::OnAddDot\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_DOT_W,\
+ WxdkdrawFrame::OnAddWhiteDot\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_DOT_W,\
+ WxdkdrawFrame::OnAddWhiteDot\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_TEXT,\
+ WxdkdrawFrame::OnAddTextlabel\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_TEXT,\
+ WxdkdrawFrame::OnAddTextlabel\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_IMG,\
+ WxdkdrawFrame::OnAddImage\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_IMG,\
+ WxdkdrawFrame::OnAddImage\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ADD_LIBELEM,\
+ WxdkdrawFrame::OnAddLibelem\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ADD_LIBELEM,\
+ WxdkdrawFrame::OnAddLibelem\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_COPY,\
+ WxdkdrawFrame::OnEditCopy\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_COPY,\
+ WxdkdrawFrame::OnEditCopy\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_MOVE,\
+ WxdkdrawFrame::OnEditMove\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_MOVE,\
+ WxdkdrawFrame::OnEditMove\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_DEL,\
+ WxdkdrawFrame::OnEditDelete\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_DEL,\
+ WxdkdrawFrame::OnEditDelete\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_PT_MOVE,\
+ WxdkdrawFrame::OnEditPointMove\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_PT_MOVE,\
+ WxdkdrawFrame::OnEditPointMove\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_PT_ADD,\
+ WxdkdrawFrame::OnEditPointAdd\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_PT_ADD,\
+ WxdkdrawFrame::OnEditPointAdd\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_PT_DEL,\
+ WxdkdrawFrame::OnEditPointDelete\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_PT_DEL,\
+ WxdkdrawFrame::OnEditPointDelete\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_DET,\
+ WxdkdrawFrame::OnEditDetails\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_DET,\
+ WxdkdrawFrame::OnEditDetails\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_GRP1,\
+ WxdkdrawFrame::OnEditGroup\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_GRP13,\
+ WxdkdrawFrame::OnEditGroup3\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_GRP1,\
+ WxdkdrawFrame::OnEditGroup\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_GRP13,\
+ WxdkdrawFrame::OnEditGroup3\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_UNGRP,\
+ WxdkdrawFrame::OnEditUngroup\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_UNGRP,\
+ WxdkdrawFrame::OnEditUngroup\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_FLIPH,\
+ WxdkdrawFrame::OnEditFlipH\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_FLIPH,\
+ WxdkdrawFrame::OnEditFlipH\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_FLIPV,\
+ WxdkdrawFrame::OnEditFlipV\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_FLIPV,\
+ WxdkdrawFrame::OnEditFlipV\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_ROTLEFT,\
+ WxdkdrawFrame::OnEditRotateLeft\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_ROTLEFT,\
+ WxdkdrawFrame::OnEditRotateLeft\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_ROTRIGHT,\
+ WxdkdrawFrame::OnEditRotateRight\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_ROTRIGHT,\
+ WxdkdrawFrame::OnEditRotateRight\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_DRSZ,\
+ WxdkdrawFrame::OnEditChangeSize\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_EDIT_DRSZ,\
+ WxdkdrawFrame::OnEditChangeSize\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_LAYERS_ALL,\
+ WxdkdrawFrame::OnLayersAll\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_LAYERS_ALL,\
+ WxdkdrawFrame::OnLayersAll\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_LAYERS_MGR,\
+ WxdkdrawFrame::OnLayerManager\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_LAYERS_MGR,\
+ WxdkdrawFrame::OnLayerManager\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_ZOOM_CENTER,\
+ WxdkdrawFrame::OnCenterView\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_1,\
+ WxdkdrawFrame::OnConvert1\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_2,\
+ WxdkdrawFrame::OnConvert2\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_3,\
+ WxdkdrawFrame::OnConvert3\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_4,\
+ WxdkdrawFrame::OnConvert4\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_5,\
+ WxdkdrawFrame::OnConvert5\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_6,\
+ WxdkdrawFrame::OnConvert6\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_7,\
+ WxdkdrawFrame::OnConvert7\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_8,\
+ WxdkdrawFrame::OnConvert8\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_9,\
+ WxdkdrawFrame::OnConvert9\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_EDIT_CONVERT_A,\
+ WxdkdrawFrame::OnConvertA\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_BORDER,\
+ WxdkdrawFrame::OnColourBorderModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_BORDER,\
+ WxdkdrawFrame::OnColourBorderReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_BACKGROUND,\
+ WxdkdrawFrame::OnColourBackgroundModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_BACKGROUND,\
+ WxdkdrawFrame::OnColourBackgroundReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_GRID,\
+ WxdkdrawFrame::OnColourGridModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_GRID,\
+ WxdkdrawFrame::OnColourGridReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_PH,\
+ WxdkdrawFrame::OnColourPlacementModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_PH,\
+ WxdkdrawFrame::OnColourPlacementReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_COPY,\
+ WxdkdrawFrame::OnColourCopyModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_COPY,\
+ WxdkdrawFrame::OnColourCopyReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_MOVE,\
+ WxdkdrawFrame::OnColourMoveModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_MOVE,\
+ WxdkdrawFrame::OnColourMoveReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_DELETE,\
+ WxdkdrawFrame::OnColourDeleteModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_DELETE,\
+ WxdkdrawFrame::OnColourDeleteReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_GROUP,\
+ WxdkdrawFrame::OnColourGroupModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_GROUP,\
+ WxdkdrawFrame::OnColourGroupReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_MOD_MISSING,\
+ WxdkdrawFrame::OnColourMissingModify\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_COL_RES_MISSING,\
+ WxdkdrawFrame::OnColourMissingReset\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_RESET_OPTIONS,\
+ WxdkdrawFrame::OnResetOptions\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_MOD_SPLINE,\
+ WxdkdrawFrame::OnModifySplineValue\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_MOD_SPLINE,\
+ WxdkdrawFrame::OnModifySplineValue\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_OPT_NEW_OBJECTS,\
+ WxdkdrawFrame::OnOptionsNewObjects\
+ )
+ EVT_MENU(\
+ WxdkdrawFrame::ID_OPT_SCREEN,\
+ WxdkdrawFrame::OnOptionsScreenRepresentation\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_ZOOM_CENTER,\
+ WxdkdrawFrame::OnCenterView\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawFrame::ID_GRID_ON_OFF,\
+ WxdkdrawFrame::OnGridOnOff\
+ )
+ EVT_CHOICE(\
+ WxdkdrawFrame::ID_GRID_UNIT,\
+ WxdkdrawFrame::OnGridUnit\
+ )
+ EVT_CHOICE(\
+ WxdkdrawFrame::ID_GRID_BASE,\
+ WxdkdrawFrame::OnGridBase\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawFrame::ID_PLACEMENT,\
+ WxdkdrawFrame::OnPlacementHelp\
+ )
+ EVT_COMMAND(\
+ WxdkdrawFrame::ID_STYLE_LINE_COL,\
+ wxEVT_DK4_COLOUR_VIEW_EVENT,WxdkdrawFrame::OnStyleLineColour\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawFrame::ID_STYLE_LAYER,\
+ WxdkdrawFrame::OnStyleLayer\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawFrame::ID_STYLE_LINE_WIDTH,\
+ WxdkdrawFrame::OnStyleLineWidth\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawFrame::ID_SPIN_ROTATION,\
+ WxdkdrawFrame::OnSpinRotation\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_LINE_STYLE,\
+ WxdkdrawFrame::OnStyleLineStyle\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_LINE_CAP,\
+ WxdkdrawFrame::OnStyleLineCap\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_LINE_JOIN,\
+ WxdkdrawFrame::OnStyleLineJoin\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_ARROW_F,\
+ WxdkdrawFrame::OnStyleLineArrowF\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_ARROW_B,\
+ WxdkdrawFrame::OnStyleLineArrowB\
+ )
+ EVT_COMMAND(\
+ WxdkdrawFrame::ID_STYLE_FILL_COL,\
+ wxEVT_DK4_COLOUR_VIEW_EVENT,WxdkdrawFrame::OnStyleFillColour\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_FILL_PATT,\
+ WxdkdrawFrame::OnStyleFillPattern\
+ )
+ EVT_CHECKBOX(\
+ WxdkdrawFrame::ID_STYLE_TEXT_LATEX,\
+ WxdkdrawFrame::OnStyleTextLatex\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_TEXT_ALIGN,\
+ WxdkdrawFrame::OnStyleTextAlign\
+ )
+ EVT_BUTTON(\
+ WxdkdrawFrame::ID_STYLE_TEXT_FONT,\
+ WxdkdrawFrame::OnStyleTextFont\
+ )
+ EVT_SPINCTRL(\
+ WxdkdrawFrame::ID_STYLE_TEXT_SIZE,\
+ WxdkdrawFrame::OnStyleTextSize\
+ )
+ EVT_COMMAND_SCROLL(\
+ WxdkdrawFrame::ID_SCROLL_H,\
+ WxdkdrawFrame::OnScrollH\
+ )
+ EVT_COMMAND_SCROLL(\
+ WxdkdrawFrame::ID_SCROLL_V,\
+ WxdkdrawFrame::OnScrollV\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+/** DK tools and libraries version number as wxChar text.
+*/
+static const wxChar versno[] = { DKT_VERSION_WX };
+
+
+
+/** Files to open in dialog box.
+*/
+static const wxChar wxd_file_type_suffix[] = {
+ wxT("WXD files (*.wxd)|*.wxd")
+};
+
+
+
+bool
+WxdkdrawFrame::BeginEventHandling(void)
+{
+ bool back = false;
+ dk4error_init(&m_oErrorReport);
+ if ((NULL != m_pDrw) && (m_bActive) && (NULL != drawco)) {
+ back = true;
+ m_bUpdate = false;
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::ErrorReportingAtEventEnd(void)
+{
+ wxString msgText(sTexts[506]);
+ int msgflags;
+ bool usetp;
+
+ if (DK4_E_NONE != m_oErrorReport.ec) {
+ msgflags = (wxOK | wxCENTRE | wxICON_ERROR);
+ usetp = false;
+ switch (m_oErrorReport.ec) {
+ case DK4_E_MEMORY_ALLOCATION_FAILED : {
+ wxMessageBox(sTexts[346], sTexts[345], msgflags);
+ } break;
+ case DK4_E_MATH_OVERFLOW : {
+ wxMessageBox(sTexts[348], sTexts[347], msgflags);
+ } break;
+ case WXD_E_FAILED_TO_OPEN_FILE : {
+ wxMessageBox(sTexts[508], sTexts[507], msgflags);
+ } break;
+ case WXD_E_MOUSE_POS_NOT_AVAILABLE : {
+ wxMessageBox(sTexts[510], sTexts[509], msgflags);
+ } break;
+ case WXD_E_NO_EXPORT_TEXT : {
+ wxMessageBox(sTexts[512], sTexts[511], msgflags);
+ } break;
+ case WXD_E_NO_FILENAME : {
+ wxMessageBox(sTexts[514], sTexts[513], msgflags);
+ } break;
+ case WXD_E_GET_CONTROL_POINT : {
+ wxMessageBox(sTexts[516], sTexts[515], msgflags);
+ } break;
+ case WXD_E_SET_CONTROL_POINT : {
+ wxMessageBox(sTexts[518], sTexts[517], msgflags);
+ } break;
+ case WXD_E_OVERFLOW_COORDINATES : {
+ wxMessageBox(sTexts[520], sTexts[519], msgflags);
+ } break;
+ case WXD_E_MOVE_TO_GROUP : {
+ wxMessageBox(sTexts[522], sTexts[521], msgflags);
+ } break;
+ case WXD_E_UNGROUP_OBJECT : {
+ wxMessageBox(sTexts[524], sTexts[523], msgflags);
+ } break;
+ case WXD_E_BOX_TOO_SMALL : {
+ wxMessageBox(sTexts[526], sTexts[525], msgflags);
+ } break;
+ case WXD_E_BUG_POINT_OOR : {
+ wxMessageBox(sTexts[528], sTexts[527], msgflags);
+ } break;
+ case WXD_E_TOO_MANY_POINTS : {
+ wxMessageBox(sTexts[530], sTexts[529], msgflags);
+ } break;
+ case WXD_E_CANNOT_CONVERT : {
+ wxMessageBox(sTexts[557], sTexts[556], msgflags);
+ } break;
+ case WXD_E_CWD_TOO_LONG : {
+ wxMessageBox(sTexts[559], sTexts[558], msgflags);
+ } break;
+ case WXD_E_NO_CWD : {
+ wxMessageBox(sTexts[561], sTexts[560], msgflags);
+ } break;
+ case WXD_E_OUTPUT_FN_TOO_LONG : {
+ wxMessageBox(sTexts[563], sTexts[562], msgflags);
+ } break;
+ case WXD_E_OUTPUT_DIRNAME : {
+ wxMessageBox(sTexts[565], sTexts[564], msgflags);
+ } break;
+ case WXD_E_FAILED_TO_READ_FILE : {
+ if (
+ (WXDRD_E_MEMORY <= m_oStatusReader.ec)
+ && (WXDRD_E_BOX_NO_AREA >= m_oStatusReader.ec)
+ ) {
+ switch (m_oStatusReader.ec) {
+ case WXDRD_E_NUM_CONV :
+ case WXDRD_E_COORD_OVERFLOW :
+ case WXDRD_E_BOX_NO_AREA :
+ {
+ usetp = true;
+ } break;
+ }
+ msgText.Append(sTexts[575 + m_oStatusReader.ec]);
+ }
+ else {
+ msgText.Append(sTexts[575]);
+ }
+ if (0UL < m_oStatusReader.ln) {
+ wxString strLineno;
+ strLineno.Printf(wxT("%lu"), m_oStatusReader.ln);
+ msgText.Append(sTexts[596]);
+ msgText.Append(strLineno);
+ if (usetp) {
+ wxString strTextno;
+ strTextno.Printf(
+ wxT("%lu"),
+ ((unsigned long)(m_oStatusReader.te) + 1UL)
+ );
+ msgText.Append(sTexts[597]);
+ msgText.Append(strTextno);
+ }
+ msgText.Append(sTexts[598]);
+ }
+ wxMessageBox(msgText, sTexts[505], msgflags);
+ } break;
+ default : {
+ wxMessageBox(sTexts[350], sTexts[349], msgflags);
+ } break;
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::EndEventHandling(void)
+{
+ if ((NULL != m_pDrw) && (m_bActive) && (NULL != drawco)) {
+ if (WXD_REFRESH_NONE < m_pDrw->redraw) {
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ if (m_bUpdate) {
+ Update();
+ }
+ ErrorReportingAtEventEnd();
+ dk4error_init(&m_oErrorReport);
+}
+
+
+
+bool
+WxdkdrawFrame::CanClose(bool isLast)
+{
+ int res; /* Result from message box */
+ bool back = true; /* Function result */
+ $? "+ WxdkdrawFrame::CanClose isLast=%d", (isLast ? 1 : 0)
+
+ /* __CHANGE__ 013: Check for unsaved data.
+ */
+ if (isLast) {
+ SaveConfiguration();
+ }
+ if ((NULL != m_pDrw) && (NULL != drawco) && (m_bActive)) {
+ if (m_bModified) {
+ Dk4WxYesNoDialog dlg(
+ this, pAppHelp, sTexts[169], sTexts[168]
+ );
+#if VERSION_BEFORE_2020_08_23
+ res =
+ wxMessageBox(sTexts[169],sTexts[168],(wxYES_NO | wxICON_QUESTION));
+#else
+ res = dlg.ShowModal();
+#endif
+ if (wxYES == res) {
+ if (!(SaveToFile())) {
+ back = false;
+ }
+ }
+ }
+ if (back) {
+ m_bActive = false;
+ if (NULL != m_pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ }
+ m_pDrw = NULL;
+ }
+ }
+ $? "- WxdkdrawFrame::CanClose %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::UpdatePositionLabels(bool havepos, int32_t x, int32_t y)
+{
+ double res;
+
+ if (havepos) {
+ wxString s1 = wxString(sTexts[16]);
+ wxString s2 = wxString(sTexts[17]);
+ wxString sx = wxEmptyString;
+ wxString sy = wxEmptyString;
+ if (0 != cbGridUnit->GetSelection()) { res = 6400000.0; }
+ else { res = 16256000.0; }
+ sx.Printf(wxT("%g"), ((double)x / res));
+ sy.Printf(wxT("%g"), ((double)y / res));
+ s1.Append(sx);
+ s2.Append(sy);
+ tlPosX->SetLabel(s1);
+ tlPosY->SetLabel(s2);
+ }
+ else {
+ tlPosX->SetLabel(sTexts[16]);
+ tlPosY->SetLabel(sTexts[17]);
+ }
+ tlPosX->Refresh();
+ tlPosY->Refresh();
+ m_bUpdate = true;
+}
+
+
+
+bool
+WxdkdrawFrame::UpdateGridPosition(void)
+{
+ dk4_er_t er; /* Error report */
+ int32_t xdraw; /* Raw x position (not grid-snapped) */
+ int32_t ydraw; /* Raw y position (not grid-snapped) */
+ int32_t xgrid; /* Corrected x position (grid-snap) */
+ int32_t ygrid; /* Corrected y position (grid-snap) */
+ bool ok = true; /* Flag: No errors occured */
+ bool back = false; /* Function result */
+ $? "+ UpdateGridPosition"
+ xdraw = drawco->InvX((double)(m_szMousePosPix.GetWidth()), ok);
+ ydraw = drawco->InvY((double)(m_szMousePosPix.GetHeight()), ok);
+ if (ok) { $? ". backward calculation ok"
+ if ((m_ptMousePosRaw.x != xdraw) || (m_ptMousePosRaw.y != ydraw)) {
+ m_ptMousePosRaw.x = xdraw;
+ m_ptMousePosRaw.y = ydraw;
+ back = true;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! backward calculation failed"
+ }
+#endif
+ xgrid = drawco->GridRoundNearest(xdraw, drawco->m_uGridSnap, ok);
+ ygrid = drawco->GridRoundNearest(ydraw, drawco->m_uGridSnap, ok);
+ if (ok) { $? ". grid rounding ok"
+ if ((m_ptMousePosGrid.x != xgrid) || (m_ptMousePosGrid.y != ygrid)) {
+ m_ptMousePosGrid.x = xgrid;
+ m_ptMousePosGrid.y = ygrid;
+ back = true;
+ }
+ if (!(m_bMousePos)) {
+ back = true;
+ }
+ if (back) {
+ UpdatePositionLabels(true, xgrid, ygrid);
+ }
+ m_bMousePos = true;
+ m_bMouseDiff = false; $? ". m_bMouseDiff = false"
+ switch (m_iState) {
+ /*
+ _STATE_ For some states we need to calculate the difference
+ between move/copy origin point and current point.
+ */
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_PLACE :
+ case S_DRWSZ_PLACE :
+ {
+ dk4error_init(&er);
+ m_ptMouseMoveDiff.x = dk4ma_int32_t_sub(
+ m_ptMousePosGrid.x, m_ptMouseMoveStart.x, &er
+ );
+ m_ptMouseMoveDiff.y = dk4ma_int32_t_sub(
+ m_ptMousePosGrid.y, m_ptMouseMoveStart.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ m_bMouseDiff = true; $? ". m_bMouseDiff = true"
+ }
+#if TRACE_DEBUG
+ else { $? "! error in diff calculation"
+ }
+#endif
+ } break;
+#if TRACE_DEBUG
+ default : { $? ". no need to calulcate diff"
+ } break;
+#endif
+ }
+ }
+ else { $? "! grid rounding failed"
+ if (m_bMousePos) {
+ UpdatePositionLabels(false, (int32_t)0L, (int32_t)0L);
+ back = true;
+ }
+ m_bMousePos = false;
+ m_bMouseDiff = false; $? ". m_bMouseDiff = false"
+ } $? "- UpdateGridPosition"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::UpdateMousePosition(wxMouseEvent & event)
+{
+ int xpos = 0; /* Mouse x position in pixels */
+ int ypos = 0; /* Mouse y position in pixels */
+ bool back = false; /* Function result */
+ $? "+ UpdateMousePosition"
+ event.GetPosition(&xpos, &ypos);
+ if (
+ (m_szMousePosPix.GetWidth() != xpos)
+ || (m_szMousePosPix.GetHeight() != ypos)
+ )
+ {
+ m_szMousePosPix.SetWidth(xpos);
+ m_szMousePosPix.SetHeight(ypos);
+ back = UpdateGridPosition();
+ }
+ $? "- UpdateMousePosition"
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::ControlMouseEnter(wxMouseEvent & event)
+{
+#if 0
+ $? "+ ControlMouseEnter"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ $? "- ControlMouseEnter"
+ EndEventHandling();
+#endif
+ $? "+ ControlMouseEnter"
+ ControlMouseMove(event);
+ $? "- ControlMouseEnter"
+}
+
+
+
+void
+WxdkdrawFrame::ControlMouseLeave(wxMouseEvent & WXUNUSED(event))
+{
+ $? "+ ControlMouseLeave"
+ StartEventHandling();
+ if (m_bMousePos) {
+ UpdatePositionLabels(false, (int32_t)0L, (int32_t)0L);
+ }
+ m_bMousePos = false;
+ if ((S_NOOP == m_iState) && (NULL != m_pCurrent)) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ m_pCurrent = NULL;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ $? "- ControlMouseLeave"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::ControlMouseMove(wxMouseEvent & event)
+{
+ $? "+ ControlMouseMove"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ /*
+ _STATE_ Call mouse move method.
+ */
+ switch (m_iState) {
+ case S_NOOP : {
+ MouseMoveNoop();
+ } break;
+ case S_DELETE : {
+ MouseMoveDelete();
+ } break;
+ case S_REGION_DELETE : {
+ MouseMoveRegionDelete();
+ } break;
+ case S_MOVE_SELECT : {
+ MouseMoveMoveSelect();
+ } break;
+ case S_MOVE_PLACE : {
+ MouseMoveMovePlace();
+ } break;
+ case S_COPY_SELECT : {
+ MouseMoveCopySelect();
+ } break;
+ case S_COPY_PLACE : {
+ MouseMoveCopyPlace();
+ } break;
+ case S_POLY_FIRST : {
+ MouseMovePolyFirst();
+ } break;
+ case S_POLY_FURTHER : {
+ MouseMovePolyFurther();
+ } break;
+ case S_SPLINE_FIRST : {
+ MouseMoveSplineFirst();
+ } break;
+ case S_SPLINE_FURTHER : {
+ MouseMoveSplineFurther();
+ } break;
+ case S_BOX_FIRST : {
+ MouseMoveBoxFirst();
+ } break;
+ case S_BOX_OPPOSITE : {
+ MouseMoveBoxOpposite();
+ } break;
+ case S_CIRCLE_CENTER : {
+ MouseMoveCircleCenter();
+ } break;
+ case S_CIRCLE_RADIUS : {
+ MouseMoveCircleRadius();
+ } break;
+ case S_ELLIPSE_CENTER : {
+ MouseMoveEllipseCenter();
+ } break;
+ case S_ELLIPSE_CORNER : {
+ MouseMoveEllipseCorner();
+ } break;
+ case S_ARC_1 : {
+ MouseMoveArc1();
+ } break;
+ case S_ARC_2 : {
+ MouseMoveArc2();
+ } break;
+ case S_ARC_3 : {
+ MouseMoveArc3();
+ } break;
+ case S_DOT : {
+ MouseMoveDot();
+ } break;
+ case S_TEXT : {
+ MouseMoveText();
+ } break;
+ case S_IMG_1 : {
+ MouseMoveImage1();
+ } break;
+ case S_IMG_2 : {
+ MouseMoveImage2();
+ } break;
+ case S_LIBELEM_PLACE : {
+ MouseMoveLibelemPlace();
+ } break;
+ case S_MOVEPT_SELECT : {
+ MouseMovePointMoveSelect();
+ } break;
+ case S_MOVEPT_PLACE : {
+ MouseMovePointMovePlace();
+ } break;
+ case S_DELPT : {
+ MouseMovePointDelete();
+ } break;
+ case S_ADDPT_SELECT : {
+ MouseMovePointAddSelect();
+ } break;
+ case S_ADDPT_PLACE : {
+ MouseMovePointAddPlace();
+ } break;
+ case S_DRWSZ_SELECT : {
+ MouseMoveDrawingSizeSelect();
+ } break;
+ case S_DRWSZ_PLACE : {
+ MouseMoveDrawingSizePlace();
+ } break;
+ case S_FLIP : {
+ MouseMoveFlip();
+ } break;
+ case S_GROUP_ONE : {
+ MouseMoveGroupOne();
+ } break;
+ case S_GROUP_RECT_1 : {
+ MouseMoveGroupRect1();
+ } break;
+ case S_GROUP_RECT_2 : {
+ MouseMoveGroupRect2();
+ } break;
+ case S_UNGROUP : {
+ MouseMoveUngroup();
+ } break;
+ case S_DETAILS : {
+ MouseMoveDetails();
+ } break;
+ case S_DETAILS_2 : {
+ } break;
+ case S_CONVERT : {
+ MouseMoveConvert();
+ } break;
+ case S_ROTATE : {
+ MouseMoveRotate();
+ } break;
+ case S_MOD_SPLINE : {
+ MouseMoveModspline();
+ } break;
+ }
+ $? "- ControlMouseMove"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::ControlLeftMouseButton(wxMouseEvent & event)
+{
+ $? "+ ControlLeftMouseButton"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ /*
+ _STATE_ Call mouse button method.
+ */
+ switch (m_iState) {
+ case S_NOOP : {
+ MouseLeftNoop();
+ } break;
+ case S_DELETE : {
+ MouseLeftDelete();
+ } break;
+ case S_REGION_DELETE : {
+ MouseLeftRegionDelete();
+ } break;
+ case S_MOVE_SELECT : {
+ MouseLeftMoveSelect();
+ } break;
+ case S_MOVE_PLACE : {
+ MouseLeftMovePlace();
+ } break;
+ case S_COPY_SELECT : {
+ MouseLeftCopySelect();
+ } break;
+ case S_COPY_PLACE : {
+ MouseLeftCopyPlace();
+ } break;
+ case S_POLY_FIRST : {
+ MouseLeftPolyFirst();
+ } break;
+ case S_POLY_FURTHER : {
+ MouseLeftPolyFurther();
+ } break;
+ case S_SPLINE_FIRST : {
+ MouseLeftSplineFirst();
+ } break;
+ case S_SPLINE_FURTHER : {
+ MouseLeftSplineFurther();
+ } break;
+ case S_BOX_FIRST : {
+ MouseLeftBoxFirst();
+ } break;
+ case S_BOX_OPPOSITE : {
+ MouseLeftBoxOpposite();
+ } break;
+ case S_CIRCLE_CENTER : {
+ MouseLeftCircleCenter();
+ } break;
+ case S_CIRCLE_RADIUS : {
+ MouseLeftCircleRadius();
+ } break;
+ case S_ELLIPSE_CENTER : {
+ MouseLeftEllipseCenter();
+ } break;
+ case S_ELLIPSE_CORNER : {
+ MouseLeftEllipseCorner();
+ } break;
+ case S_ARC_1 : {
+ MouseLeftArc1();
+ } break;
+ case S_ARC_2 : {
+ MouseLeftArc2();
+ } break;
+ case S_ARC_3 : {
+ MouseLeftArc3();
+ } break;
+ case S_DOT : {
+ MouseLeftDot();
+ } break;
+ case S_TEXT : {
+ MouseLeftText();
+ } break;
+ case S_IMG_1 : {
+ MouseLeftImage1();
+ } break;
+ case S_IMG_2 : {
+ MouseLeftImage2();
+ } break;
+ case S_LIBELEM_PLACE : {
+ MouseLeftLibelemPlace();
+ } break;
+ case S_MOVEPT_SELECT : {
+ MouseLeftPointMoveSelect();
+ } break;
+ case S_MOVEPT_PLACE : {
+ MouseLeftPointMovePlace();
+ } break;
+ case S_DELPT : {
+ MouseLeftPointDelete();
+ } break;
+ case S_ADDPT_SELECT : {
+ MouseLeftPointAddSelect();
+ } break;
+ case S_ADDPT_PLACE : {
+ MouseLeftPointAddPlace();
+ } break;
+ case S_DRWSZ_SELECT : {
+ MouseLeftDrawingSizeSelect();
+ } break;
+ case S_DRWSZ_PLACE : {
+ MouseLeftDrawingSizePlace();
+ } break;
+ case S_FLIP : {
+ MouseLeftFlip();
+ } break;
+ case S_GROUP_ONE : {
+ MouseLeftGroupOne();
+ } break;
+ case S_GROUP_RECT_1 : {
+ MouseLeftGroupRect1();
+ } break;
+ case S_GROUP_RECT_2 : {
+ MouseLeftGroupRect2();
+ } break;
+ case S_UNGROUP : {
+ MouseLeftUngroup();
+ } break;
+ case S_DETAILS : {
+ MouseLeftDetails();
+ } break;
+ case S_DETAILS_2 : {
+ } break;
+ case S_CONVERT : {
+ MouseLeftConvert();
+ } break;
+ case S_ROTATE : {
+ MouseLeftRotate();
+ } break;
+ case S_MOD_SPLINE : {
+ MouseLeftModspline();
+ } break;
+ }
+ $? "- ControlLeftMouseButton"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::ControlRightMouseButton(wxMouseEvent & event)
+{
+ Wxd_object_t *pCurrent;
+ uint16_t uCurrent;
+ $? "+ ControlRightMouseButton"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ /*
+ _STATE_ Call right mouse button method.
+ */
+ switch (m_iState) {
+ case S_MOVEPT_PLACE : {
+ pCurrent = NULL;
+ uCurrent = 0U;
+ if (
+ (NULL != m_pCurrent)
+ && (
+ (WXD_OT_O_SPLINE == m_pCurrent->ot)
+ || (WXD_OT_C_SPLINE == m_pCurrent->ot)
+ )
+ && (m_uCurrent < (m_pCurrent->det).s.n)
+ ) {
+ pCurrent = m_pCurrent;
+ uCurrent = m_uCurrent;
+ }
+ EndOperation();
+ if (NULL != pCurrent) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ drawco->Refresh();
+ Update();
+ ModifySplineValue(pCurrent, uCurrent);
+ m_iState = S_MOVEPT_SELECT;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ } break;
+ case S_NOOP :
+ case S_DELETE :
+ case S_REGION_DELETE :
+ case S_MOVE_SELECT :
+ case S_MOVE_PLACE :
+ case S_COPY_SELECT :
+ case S_COPY_PLACE :
+ case S_POLY_FIRST :
+ case S_POLY_FURTHER :
+ case S_SPLINE_FIRST :
+ case S_SPLINE_FURTHER :
+ case S_BOX_FIRST :
+ case S_BOX_OPPOSITE :
+ case S_CIRCLE_CENTER :
+ case S_CIRCLE_RADIUS :
+ case S_ELLIPSE_CENTER :
+ case S_ELLIPSE_CORNER :
+ case S_ARC_1 :
+ case S_ARC_2 :
+ case S_ARC_3 :
+ case S_DOT :
+ case S_TEXT :
+ case S_IMG_1 :
+ case S_IMG_2 :
+ case S_LIBELEM_PLACE :
+ case S_MOVEPT_SELECT :
+ case S_DELPT :
+ case S_DRWSZ_SELECT :
+ case S_DRWSZ_PLACE :
+ case S_GROUP_ONE :
+ case S_GROUP_RECT_1 :
+ case S_GROUP_RECT_2 :
+ case S_DETAILS :
+ case S_DETAILS_2 :
+ case S_CONVERT :
+ case S_ROTATE :
+ case S_MOD_SPLINE :
+ default : {
+ EndOperation();
+ } break;
+ }
+ $? "- ControlRightMouseButton"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::ControlMiddleMouseButton(wxMouseEvent & event)
+{
+ $? "+ ControlMiddleMouseButton"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ switch (m_iState) {
+ case S_DELETE : {
+ MouseMiddleDelete();
+ } break;
+ }
+ $? "- ControlMiddleMouseButton"
+ EndEventHandling();
+}
+
+
+
+
+void
+WxdkdrawFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ WxdkdrawFrame::OnQuit"
+ EndOperation(true);
+ $? "- WxdkdrawFrame::OnQuit"
+ Close();
+}
+
+
+
+void
+WxdkdrawFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
+{
+ wxString text(wxT(""));
+ wxString title(wxT(""));
+ $? "+ WxdkdrawFrame::OnAbout"
+ /* Construct message text. */
+ text.Append(sNlWx[0]);
+#if 0
+ /* Do not show a separated version number for wxdkdraw as it is
+ a part of DK tools and libraries.
+ */
+ text.Append(sNlWx[7]);
+ text.Append(sNlWx[1]);
+#endif
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[19]);
+ text.Append(versno);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[9]);
+ text.Append(sNlWx[2]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[9]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[10]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[13]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[14]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[15]);
+ text.Append(sNlWx[8]);
+
+ /* Construct dialog box title. */
+ title.Append(sTexts[10]);
+ title.Append(sNlWx[0]);
+
+ /* Show dialog box. */
+ wxMessageBox(text, title);
+
+ $? "- WxdkdrawFrame::OnAbout"
+}
+
+
+
+void
+WxdkdrawFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ WxdkdrawFrame::OnHelpContents"
+#if 1
+ DisplayContents();
+#else
+ if (!(FindFileAndLaunch(dkT("wxdkdraw.pdf"), true))) {
+ DisplayContents();
+ }
+#endif
+ $? "- WxdkdrawFrame::OnHelpContents"
+}
+
+
+
+void
+WxdkdrawFrame::OnIdle(wxIdleEvent & event)
+{
+ bool isFirstIdleEvent = true;
+ $? "+ WxdkdrawFrame::OnIdle"
+ /*
+ Check whether we really have the first idle event.
+ */
+ {
+ wxCriticalSectionLocker lock(csIsFirstIdle);
+ isFirstIdleEvent = m_bIsFirstIdle;
+ m_bIsFirstIdle = false;
+ }
+ if (isFirstIdleEvent) {
+ $? ". going to disconnect"
+ Disconnect(wxEVT_IDLE, wxIdleEventHandler(WxdkdrawFrame::OnIdle));
+ $? ". handle first idle"
+ OnFirstIdle();
+ $? ". update drawing"
+ Update();
+ }
+ $? "- WxdkdrawFrame::OnIdle"
+ event.Skip();
+}
+
+
+
+void
+WxdkdrawFrame::OnFileNew(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_drawing_t *pDrw = NULL; /* New drawing */
+ int res; /* Operation result */
+ bool bLoadNew = true; /* Can load new empty drawing */
+ $? "+ OnFileNew"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ EndEventHandling();
+ if (m_bModified) {
+ Dk4WxYesNoDialog dlg(
+ this, pAppHelp, sTexts[169], sTexts[168]
+ );
+#if VERSION_BEFORE_2020_08_23
+ res =
+ wxMessageBox(sTexts[169],sTexts[168],(wxYES_NO | wxICON_QUESTION));
+#else
+ res = dlg.ShowModal();
+#endif
+ if (wxYES == res) {
+ if (!(SaveToFile())) {
+ bLoadNew = false;
+ }
+ }
+ }
+ if (bLoadNew) {
+ pDrw = wxdobj_drw_new();
+ if (NULL != pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ m_pDrw = pDrw;
+ m_sFileFull = wxEmptyString;
+ m_sFileDir = wxEmptyString;
+ m_sFileShort = wxEmptyString;
+ m_bHaveName = false;
+ SetTitle(sTexts[18]);
+ DrawingLoaded();
+ szTopBar->Layout();
+ m_bUpdate = true;
+ }
+ else {
+ }
+ }
+ }
+ $? "- OnFileNew"
+}
+
+
+
+void
+WxdkdrawFrame::OnFileOpen(wxCommandEvent & WXUNUSED(event))
+{
+ wxString sDialogTitle(sTexts[339]); /* Dialog box title */
+ wxString sFileTypes(sTexts[172]); /* File type suffixes */
+ Wxd_drawing_t *pDrw = NULL; /* New drawing */
+ int res; /* Intermediate result */
+ bool bLoadNew = true; /* Flag: Can load new file */
+ $? "+ OnFileOpen"
+ $? ". initialize m_oStatusReader"
+ wxdrd_status_init(&m_oStatusReader);
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ if (m_bModified) {
+ Dk4WxYesNoDialog dlg(
+ this, pAppHelp, sTexts[169], sTexts[168]
+ );
+#if VERSION_BEFORE_2020_08_23
+ res =
+ wxMessageBox(sTexts[169],sTexts[168],(wxYES_NO | wxICON_QUESTION));
+#else
+ res = dlg.ShowModal();
+#endif
+ if (wxYES == res) {
+ if (!(SaveToFile())) {
+ bLoadNew = false;
+ }
+ }
+ }
+ if (bLoadNew) {
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sFileDir, m_sFileShort,
+ sFileTypes, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sFileDir, m_sFileShort,
+ sFileTypes, wxOPEN
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ pDrw = ReadDrawingFromFile(pa);
+ if (NULL != pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ m_pDrw = pDrw;
+ m_sFileFull = pa;
+ m_sFileDir = dlg.GetDirectory();
+ m_sFileShort = dlg.GetFilename();
+ m_bHaveName = true;
+ SetTitle(m_sFileShort);
+ DrawingLoaded();
+ szTopBar->Layout();
+ m_bUpdate = true;
+ }
+ else {
+ /* ERROR: Failed to read file, already reported */
+ }
+ }
+ }
+ ModificationReportingAtEventEnd();
+ EndEventHandling();
+ $? ". initialize m_oStatusReader"
+ wxdrd_status_init(&m_oStatusReader);
+ }
+ $? "- OnFileOpen"
+}
+
+
+
+void
+WxdkdrawFrame::OnFileSave(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnFileSave"
+ wxdwr_status_init(&m_oStatusWriter, pAppHelp->GetWxEncoding());
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ SaveToFile();
+ EndEventHandling();
+ }
+ $? "- OnFileSave"
+}
+
+
+
+void
+WxdkdrawFrame::OnFileSaveAs(wxCommandEvent & WXUNUSED(event))
+{
+ wxString sNewTitle = wxEmptyString; /* New program window title */
+ wxString sDlgTitle(sTexts[171]); /* Dialog title */
+ wxString sDlgTypes(sTexts[172]); /* File type suffixes */
+ $? "+ OnFileSaveAs"
+ wxdwr_status_init(&m_oStatusWriter, pAppHelp->GetWxEncoding());
+ if (BeginEventHandling()) {
+ EndOperation(true);
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDlgTitle, m_sFileDir, m_sFileShort,
+ sDlgTypes, (wxFD_SAVE | wxFD_OVERWRITE_PROMPT)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDlgTitle, m_sFileDir, m_sFileShort,
+ sDlgTypes, wxSAVE
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ m_sFileFull = dlg.GetPath();
+ m_sFileDir = dlg.GetDirectory();
+ m_sFileShort = dlg.GetFilename();
+ m_bHaveName = true;
+ if (m_bModified) {
+ sNewTitle.Append(sTexts[170]);
+ sNewTitle.Append(m_sFileShort);
+ SetTitle(sNewTitle);
+ }
+ else {
+ SetTitle(m_sFileShort);
+ }
+ m_bUpdate = true;
+ SaveToFile();
+ }
+ EndEventHandling();
+ }
+ $? "- OnFileSaveAs"
+}
+
+
+
+void
+WxdkdrawFrame::OnZoomIn(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnZoomIn"
+ if (BeginEventHandling()) {
+ if ((int8_t)14 > m_pDrw->zl) {
+ m_pDrw->zl += (int8_t)1;
+ ZoomChanged(false);
+ }
+ EndEventHandling();
+ }
+ $? "- OnZoomIn"
+}
+
+
+
+void
+WxdkdrawFrame::OnZoomOut(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnZoomOut"
+ if (BeginEventHandling()) {
+ if ((int8_t)(-14) < m_pDrw->zl) {
+ m_pDrw->zl -= (int8_t)1;
+ ZoomChanged(true);
+ }
+ EndEventHandling();
+ }
+ $? "- OnZoomOut"
+}
+
+
+
+void
+WxdkdrawFrame::OnZoom100(wxCommandEvent & WXUNUSED(event))
+{
+ bool bZoomOut;
+ $? "+ OnZoom100"
+ if (BeginEventHandling()) {
+ if ((int8_t)0 != m_pDrw->zl) {
+ bZoomOut = ((int8_t)0 < m_pDrw->zl);
+ m_pDrw->zl = (int8_t)0;
+ ZoomChanged(bZoomOut);
+ }
+ EndEventHandling();
+ }
+ $? "- OnZoom100"
+}
+
+
+
+void
+WxdkdrawFrame::OnPolygonPolyline(int8_t ot)
+{
+ m_iObjToCreate = ot;
+ m_iState = S_POLY_FIRST;
+ SetMouseAndStatusTexts(S_POLY_FIRST);
+ m_bAcceptablePoint = false;
+}
+
+
+
+void
+WxdkdrawFrame::OnAddPolyline(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddPolyline"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnPolygonPolyline(WXD_OT_POLYLINE);
+ EndEventHandling();
+ }
+ $? "- OnAddPolyline"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddPolygon(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddPolygon"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnPolygonPolyline(WXD_OT_POLYGON);
+ EndEventHandling();
+ }
+ $? "- OnAddPolygon"
+}
+
+
+
+void
+WxdkdrawFrame::OnRectangleBox(bool bRounded)
+{
+ m_iState = S_BOX_FIRST;
+ m_bSplineInterpolated = bRounded;
+ m_bAcceptablePoint = false;
+ SetMouseAndStatusTexts(S_BOX_FIRST);
+}
+
+
+
+void
+WxdkdrawFrame::OnAddRectangle(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddRectangle"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnRectangleBox(false);
+ EndEventHandling();
+ }
+ $? "- OnAddRectangle"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddBox(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddBox"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnRectangleBox(true);
+ EndEventHandling();
+ }
+ $? "- OnAddBox"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddCircle(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddCircle"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_CIRCLE_CENTER;
+ SetMouseAndStatusTexts(S_CIRCLE_CENTER);
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+ $? "- OnAddCircle"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddEllipse(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddEllipse"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_ELLIPSE_CENTER;
+ SetMouseAndStatusTexts(m_iState);
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+ $? "- OnAddEllipse"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddArcOpen(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddArcOpen"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iObjToCreate = WXD_OT_O_ARC;
+ m_iState = S_ARC_1;
+ SetMouseAndStatusTexts(m_iState);
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+ $? "- OnAddArcOpen"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddArcClosed(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddArcClosed"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iObjToCreate = WXD_OT_C_ARC;
+ m_iState = S_ARC_1;
+ SetMouseAndStatusTexts(m_iState);
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+ $? "- OnAddArcClosed"
+}
+
+
+
+void
+WxdkdrawFrame::OnSpline(int8_t ot, bool bInterpolated)
+{
+ m_iObjToCreate = ot;
+ m_bSplineInterpolated = bInterpolated;
+ m_iState = S_SPLINE_FIRST;
+ m_bAcceptablePoint = false;
+ SetMouseAndStatusTexts(S_SPLINE_FIRST);
+}
+
+
+
+void
+WxdkdrawFrame::OnAddSplineAO(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddSplineAO"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnSpline(WXD_OT_O_SPLINE, false);
+ EndEventHandling();
+ }
+ $? "- OnAddSplineAO"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddSplineAC(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddSplineAC"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnSpline(WXD_OT_C_SPLINE, false);
+ EndEventHandling();
+ }
+ $? "- OnAddSplineAC"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddSplineIO(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddSplineIO"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnSpline(WXD_OT_O_SPLINE, true);
+ EndEventHandling();
+ }
+ $? "- OnAddSplineIO"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddSplineIC(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddSplineIC"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ OnSpline(WXD_OT_C_SPLINE, true);
+ EndEventHandling();
+ }
+ $? "- OnAddSplineIC"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddDot(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddDot"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iObjToCreate = WXD_OT_DOT_FILLED;
+ m_iState = S_DOT;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnAddDot"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddWhiteDot(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddWhiteDot"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iObjToCreate = WXD_OT_DOT_WHITE;
+ m_iState = S_DOT;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnAddWhiteDot"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddTextlabel(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddTextlabel"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_TEXT;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnAddTextlabel"
+}
+
+
+
+void
+WxdkdrawFrame::OnAddImage(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddImage"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_IMG_1;
+ SetMouseAndStatusTexts(m_iState);
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_bAcceptablePoint = false;
+ EndEventHandling();
+ }
+ $? "- OnAddImage"
+}
+
+
+
+void
+WxdkdrawFrame::AddLibelem(void)
+{
+ wxString sDialogTitle(sTexts[410]);
+ wxString sFileTypes(wxd_file_type_suffix);
+ dk4_er_t er;
+ FILE *fp = NULL;
+
+ m_iState = S_NOOP;
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sLibraryDir, m_sLibraryShort,
+ sFileTypes, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sLibraryDir, m_sLibraryShort,
+ sFileTypes, wxOPEN
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ m_sLibraryDir = dlg.GetDirectory();
+ m_sLibraryShort = dlg.GetFilename();
+ {
+ wxFFile wxff(pa);
+ if (wxff.IsOpened()) {
+ fp = wxff.Detach();
+ if (NULL != fp) {
+ $? ". initialize m_oStatusReader"
+ wxdrd_status_init(&m_oStatusReader);
+ m_pCurrent = wxdrd_read_symbol(m_pDrw,fp,&m_oStatusReader);
+ if (NULL != m_pCurrent) {
+ UpdateStipples();
+ UpdateFonts();
+ UpdateImages();
+ m_iState = S_LIBELEM_PLACE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ m_ptMouseMoveStart.x = m_oStatusReader.bb.xl;
+ m_ptMouseMoveStart.y = m_oStatusReader.bb.yb;
+ dk4error_init(&er);
+ m_ptMouseMoveDiff.x = dk4ma_int32_t_sub(
+ m_ptMousePosGrid.x, m_oStatusReader.bb.xl, &er
+ );
+ m_ptMouseMoveDiff.y = dk4ma_int32_t_sub(
+ m_ptMousePosGrid.y, m_oStatusReader.bb.yb, &er
+ );
+ m_bMouseDiff = (DK4_E_NONE == er.ec);
+ m_iState = S_LIBELEM_PLACE;
+ wxdobj_drw_require_redraw(
+ m_pDrw, WXD_REFRESH_MARKUP
+ );
+ }
+ else {
+ /* ERROR: Failed to read file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_READ_FILE
+ );
+ m_iState = S_NOOP;
+ }
+ fclose(fp);
+ }
+ else {
+ /* ERROR: Failed to open file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ m_iState = S_NOOP;
+ }
+ }
+ else {
+ /* ERROR: Failed to open file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ m_iState = S_NOOP;
+ }
+ }
+ }
+ else {
+ m_iState = S_NOOP;
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnAddLibelem(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnAddLibelem"
+ $? ". initialize m_oStatusReader"
+ wxdrd_status_init(&m_oStatusReader);
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ AddLibelem();
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnAddLibelem"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditCopy(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditCopy"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ m_iState = S_COPY_SELECT;
+ SetMouseAndStatusTexts(S_COPY_SELECT);
+ EndEventHandling();
+ }
+ $? "- OnEditCopy"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditMove(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditMove"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ m_iState = S_MOVE_SELECT;
+ SetMouseAndStatusTexts(S_MOVE_SELECT);
+ EndEventHandling();
+ }
+ $? "- OnEditMove"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditDelete(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditDelete"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_DELETE;
+ SetMouseAndStatusTexts(S_DELETE);
+ EndEventHandling();
+ }
+ $? "- OnEditDelete"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditPointMove(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditPointMove"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_MOVEPT_SELECT;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditPointMove"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditPointAdd(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditPointAdd"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_ADDPT_SELECT;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditPointAdd"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditPointDelete(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditPointDelete"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_DELPT;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditPointDelete"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditDetails(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditDetails"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_DETAILS;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditDetails"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditGroup(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditGroup"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_GROUP_ONE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditGroup"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditGroup3(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditGroup3"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_GROUP_RECT_1;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditGroup3"
+}
+
+
+void
+WxdkdrawFrame::OnEditUngroup(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditUngroup"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_UNGROUP;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditUngroup"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditFlipH(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditFlipH"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_bVerticalFlip = false;
+ m_iState = S_FLIP;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditFlipH"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditFlipV(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditFlipV"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_bVerticalFlip = true;
+ m_iState = S_FLIP;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditFlipV"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditRotateLeft(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditRotateLeft"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_bSplineInterpolated = false;
+ m_iState = S_ROTATE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditRotateLeft"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditRotateRight(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditRotateRight"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_bSplineInterpolated = true;
+ m_iState = S_ROTATE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnEditRotateRight"
+}
+
+
+
+void
+WxdkdrawFrame::OnEditChangeSize(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnEditChangeSize"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_DRWSZ_SELECT;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ m_bHaveCornerPoint = false;
+ m_uCurrent = 0U;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ DK4_MEMCPY(&m_oOldSize,&(m_pDrw->bb),sizeof(Wxd_bb_t));
+ DK4_MEMCPY(&(m_oBorder.det.b.b),&(m_pDrw->bb),sizeof(Wxd_bb_t));
+ EndEventHandling();
+ }
+ $? "- OnEditChangeSize"
+}
+
+
+
+void
+WxdkdrawFrame::OnLayersAll(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_layer_t *play;
+ $? "+ OnLayersAll"
+ if (BeginEventHandling()) {
+ dk4sto_it_reset(m_pDrw->i_layers);
+ do {
+ play = (Wxd_layer_t *)dk4sto_it_next(m_pDrw->i_layers);
+ if (NULL != play) {
+ if (0x00 == play->active) {
+ play->active = 0x01;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+ } while (NULL != play);
+ EndEventHandling();
+ }
+ $? "- OnLayersAll"
+}
+
+
+
+void
+WxdkdrawFrame::OnLayerManager(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_layer_cb_t *pLayerCb;
+ Wxd_layer_t *pLayer;
+ size_t nl;
+ size_t i;
+ bool changed;
+ $? "+ OnLayerManager"
+ if (BeginEventHandling()) {
+ nl = wxdobj_get_number_of_layers(m_pDrw);
+ $? ". nl = %u", (unsigned)nl
+ if ((size_t)0U < nl) {
+ pLayerCb = dk4mem_new(Wxd_layer_cb_t,nl,NULL);
+ if (NULL != pLayerCb) {
+ for (i = 0; i < nl; i++) {
+ $? ". initialize record %u", (unsigned)i
+ pLayerCb[i].lay = NULL;
+ pLayerCb[i].cb = NULL;
+ pLayerCb[i].oa = 0x00;
+ }
+ i = 0;
+ dk4sto_it_reset(m_pDrw->i_layers);
+ do {
+ pLayer = (Wxd_layer_t *)dk4sto_it_next(m_pDrw->i_layers);
+ if (NULL != pLayer) {
+ if (i < nl) {
+ $? ". set up record %u", (unsigned)i
+ pLayerCb[i].lay = pLayer;
+ pLayerCb[i].oa = pLayer->active;
+ i++;
+ }
+ }
+ } while (NULL != pLayer);
+ WxdkdrawDlgLayerManager dlg(this, m_pDrw, sTexts, pLayerCb, nl);
+ if (wxID_OK != dlg.ShowModal()) {
+ changed = false;
+ for (i = 0; i < nl; i++) {
+ if (NULL != pLayerCb[i].lay) {
+ if (0x00 != pLayerCb[i].oa) {
+ if (0x00 == (pLayerCb[i].lay)->active) {
+ (pLayerCb[i].lay)->active = 0x01;
+ changed = true;
+ }
+ }
+ else {
+ if (0x00 != (pLayerCb[i].lay)->active) {
+ (pLayerCb[i].lay)->active = 0x01;
+ changed = true;
+ }
+ }
+ }
+ }
+ if (changed) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". exited using Cancel button"
+ }
+#endif
+ for (i = 0; i < nl; i++) {
+ pLayerCb[i].lay = NULL;
+ pLayerCb[i].cb = NULL;
+ pLayerCb[i].oa = 0x00;
+ }
+ dk4mem_free(pLayerCb);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* NOTICE: No layer currently in use */
+ wxMessageBox(
+ sTexts[368], sTexts[369],
+ (wxOK | wxCENTRE | wxICON_INFORMATION)
+ );
+ }
+ EndEventHandling();
+ }
+ $? "- OnLayerManager"
+}
+
+
+
+void
+WxdkdrawFrame::OnCenterViewFunction(void)
+{
+ dk4_er_t er; /* Error report */
+ $? "+ OnCenterView"
+ if (BeginEventHandling()) {
+ dk4error_init(&er);
+ m_pDrw->cx =
+ dk4ma_int32_t_add((m_pDrw->bb).xl, (m_pDrw->bb).xr, &er) / (int32_t)2L;
+ if (DK4_E_NONE != er.ec) {
+ m_pDrw->cx =
+ (m_pDrw->bb).xl / (int32_t)2L + (m_pDrw->bb).xr / (int32_t)2L;
+ }
+ dk4error_init(&er);
+ m_pDrw->cy =
+ dk4ma_int32_t_add((m_pDrw->bb).yb, (m_pDrw->bb).yt, &er) / (int32_t)2L;
+ if (DK4_E_NONE != er.ec) {
+ m_pDrw->cy =
+ (m_pDrw->bb).yb / (int32_t)2L + (m_pDrw->bb).yt / (int32_t)2L;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ AdjustScrollbars();
+ EndEventHandling();
+ }
+ $? "- OnCenterView"
+}
+
+
+
+void
+WxdkdrawFrame::OnCenterView(wxCommandEvent & WXUNUSED(event))
+{
+ OnCenterViewFunction();
+}
+
+
+
+void
+WxdkdrawFrame::OnGridOnOff(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnGridOnOff"
+ if (BeginEventHandling()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ EndEventHandling();
+ }
+ $? "- OnGridOnOff"
+}
+
+
+
+void
+WxdkdrawFrame::OnGridUnit(wxCommandEvent & WXUNUSED(event))
+{
+ int seli; /* Selected index */
+ $? "+ OnGridUnit"
+ if (BeginEventHandling()) {
+ seli = cbGridUnit->GetSelection();
+ switch (seli) {
+ case 0: {
+ m_pDrw->gridunit = (uint8_t)0U;
+ } break;
+ default : {
+ m_pDrw->gridunit = (uint8_t)1U;
+ } break;
+ }
+ drawco->CalculateGridDistances();
+ if (cbGridOnOff->GetValue()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+ EndEventHandling();
+ }
+ $? "- OnGridUnit"
+}
+
+
+
+void
+WxdkdrawFrame::OnGridBase(wxCommandEvent & WXUNUSED(event))
+{
+ int seli; /* Selected index */
+ $? "+ OnGridBase"
+ if (BeginEventHandling()) {
+ seli = cbGridBase->GetSelection();
+ switch (seli) {
+ case 0: {
+ m_pDrw->gridbase = (uint8_t)0U;
+ } break;
+ default : {
+ m_pDrw->gridbase = (uint8_t)1U;
+ } break;
+ }
+ drawco->CalculateGridDistances();
+ if (cbGridOnOff->GetValue()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+ EndEventHandling();
+ }
+ $? "- OnGridBase"
+}
+
+
+
+void
+WxdkdrawFrame::OnPlacementHelp(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnPlacementHelp"
+ if (BeginEventHandling()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ EndEventHandling();
+ }
+ $? "- OnPlacementHelp"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineColour(wxCommandEvent & WXUNUSED(event))
+{
+ int r;
+ int g;
+ int b;
+ $? "+ OnStyleLineColour"
+ if (BeginEventHandling()) {
+ r = ccLineColour->Red();
+ g = ccLineColour->Green();
+ b = ccLineColour->Blue();
+ if (NULL != m_pStyle) {
+ if (
+ ((uint8_t)r != m_pStyle->sc[0])
+ || ((uint8_t)g != m_pStyle->sc[1])
+ || ((uint8_t)b != m_pStyle->sc[2])
+ ) {
+ switch (m_pStyle->ot) {
+ case WXD_OT_TEXT :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ m_pStyle->sc[0] = (uint8_t)r;
+ m_pStyle->sc[1] = (uint8_t)g;
+ m_pStyle->sc[2] = (uint8_t)b;
+#if 0
+ m_pStyle->fc[0] = (uint8_t)r;
+ m_pStyle->fc[1] = (uint8_t)g;
+ m_pStyle->fc[2] = (uint8_t)b;
+#endif
+ } break;
+ default : {
+ m_pStyle->sc[0] = (uint8_t)r;
+ m_pStyle->sc[1] = (uint8_t)g;
+ m_pStyle->sc[2] = (uint8_t)b;
+ } break;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ else {
+ m_oStyle.sc[0] = (uint8_t)r;
+ m_oStyle.sc[1] = (uint8_t)g;
+ m_oStyle.sc[2] = (uint8_t)b;
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleLineColour"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLayer(wxSpinEvent & WXUNUSED(event))
+{
+ int nl;
+ $? "+ OnStyleLayer"
+ if (BeginEventHandling()) {
+ nl = spLayerNumber->GetValue();
+ if (NULL != m_pStyle) {
+ if (nl != m_pStyle->lay) {
+ SetModified();
+ if (0 == wxdobj_modify_layer(m_pDrw, m_pStyle, nl)) {
+ m_pStyle = NULL;
+ RequireRedraw(WXD_REFRESH_DRAWING);
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ }
+ else {
+ m_oStyle.lay = nl;
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleLayer"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineWidth(wxSpinEvent & WXUNUSED(event))
+{
+ int lw;
+ $? "+ OnStyleLineWidth"
+ if (BeginEventHandling()) {
+ lw = spLineWidth->GetValue();
+ if (NULL != m_pStyle) {
+ if ((uint16_t)lw != m_pStyle->lw) {
+ m_pStyle->lw = (uint16_t)lw;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ else {
+ m_oStyle.lw = (uint16_t)lw;
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleLineWidth"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineStyle(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj; /* Object to modify */
+ int res; /* Result from showing dialog */
+ uint8_t ols; /* Old line style */
+ uint8_t osv; /* Old style value */
+ uint8_t nls; /* New line style */
+ uint8_t nsv; /* New style value */
+ bool bDrwElem; /* Object is drawing element */
+ bool bRefresh; /* Refresh draw control */
+ $? "+ OnStyleLineStyle"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = ((NULL != m_pStyle) ? (true) : (false));
+ if (BeginEventHandling()) {
+ WxdkdrawDlgLineStyle dlg(
+ this, pobj, sTexts, ms_ls_images, bDrwElem
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleLineStyle, dlg);
+ ols = pobj->ls;
+#if 0
+ /* 2020-03-24 Modification
+ Line below removed due to clang static analyzers complaints
+ about dead assignment.
+ */
+ nls = ols;
+#endif
+ osv = pobj->sl;
+#if 0
+ /* 2020-03-24 Modification
+ Line below removed due to clang static analyzers complaints
+ about dead assignment.
+ */
+ nsv = osv;
+#endif
+ res = dlg.ShowModal();
+ switch (res) {
+ case wxID_OK : {
+ nls = pobj->ls;
+ if (nls != ols) {
+ if (NULL != m_pStyle) {
+ if (WXD_LS_SOLID == ols) {
+ pobj->sl = m_iv[IVI_STYLE_VALUE];
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ drawco->Refresh();
+ drawco->Update();
+ }
+ bStyleLineStyle->SetBitmap(ms_ls_images[nls]);
+ bStyleLineStyle->Refresh();
+ m_bUpdate = true;
+ }
+ switch (nls) {
+ case WXD_LS_DASH :
+ case WXD_LS_DASH_DOT :
+ case WXD_LS_DASH_DOT_DOT :
+ case WXD_LS_DASH_DOT_DOT_DOT : {
+ $? ". need dash length"
+ WxdkdrawDlgStyleLength dlh(
+ this, pobj, bDrwElem, sTexts
+ );
+ $? ". dialog created"
+ Dk4WxApplicationHelper::ChooseChildPosition(
+ *bStyleLineStyle, dlh
+ );
+ $? ". dialog positioned"
+ res = dlh.ShowModal();
+ $? ". dialog modal run"
+ switch (res) {
+ case wxID_OK :
+ case wxID_CANCEL : {
+ $? ". must use dialog results"
+ bRefresh = true;
+ nsv = pobj->sl;
+ if (wxID_OK == res) {
+ m_iv[IVI_STYLE_VALUE ] = nsv;
+ }
+ if (nsv == pobj->sl) { $? ". same style lgt"
+ bRefresh = false;
+ }
+ else { $? ". style lgt changed"
+ }
+ if (osv != nsv) {
+ SetModified();
+ }
+ if (bRefresh) {
+ wxdobj_drw_require_redraw(
+ m_pDrw, WXD_REFRESH_DRAWING
+ );
+ }
+ $? ". finished using dialog results"
+ } break;
+ }
+ } break;
+ }
+ } break;
+ case wxID_CANCEL : {
+ } break;
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleLineStyle"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineCap(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t ocs;
+ uint8_t ncs;
+ bool bDrwElem;
+ $? "+ OnStyleLineCap"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ ocs = ncs = pobj->cs;
+ if (BeginEventHandling()) {
+ WxdkdrawDlgLineCap dlg(this, pobj, sTexts, ms_lc_images, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleLineEnds, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ ncs = pobj->cs;
+ if (ocs != ncs) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ bStyleLineEnds->SetBitmap(ms_lc_images[ncs]);
+ bStyleLineEnds->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleLineCap"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineJoin(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t ojs;
+ uint8_t njs;
+ uint8_t oml;
+ uint8_t nml;
+ bool bDrwElem;
+ $? "+ OnStyleLineJoin"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ ojs = njs = pobj->js;
+ oml = nml = pobj->ml;
+ if (BeginEventHandling()) {
+ WxdkdrawDlgLineJoin dlg(this, pobj, sTexts, ms_lj_images, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleLineJoins, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ njs = pobj->js;
+ if (ojs != njs) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ if (WXD_LJ_MITERED == njs) {
+ pobj->ml = m_iv[IVI_MITER_LIMIT];
+ drawco->Refresh();
+ drawco->Update();
+ }
+ }
+ bStyleLineJoins->SetBitmap(ms_lj_images[njs]);
+ bStyleLineJoins->Refresh();
+ m_bUpdate = true;
+ }
+ if (WXD_LJ_MITERED == njs) {
+ WxdkdrawDlgMiterLimit dlh(this, pobj, sTexts, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(
+ *bStyleLineJoins, dlh
+ );
+ res = dlh.ShowModal();
+ if (wxID_OK == res) { $? ". oml = %u", (unsigned)oml
+ nml = pobj->ml; $? ". nml = %u", (unsigned)nml
+ m_iv[IVI_MITER_LIMIT] = nml;
+ if (oml != nml) {
+ SetModified();
+ }
+ }
+ }
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleLineJoin"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineArrowF(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t oat;
+ uint8_t nat;
+ uint8_t oal;
+ uint8_t nal;
+ uint8_t oaw;
+ uint8_t naw;
+ bool bDrwElem;
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ oat = nat = pobj->aft;
+ oal = nal = pobj->afl;
+ oaw = naw = pobj->afw;
+ $? "+ OnStyleLineArrowF"
+ if (BeginEventHandling()) {
+ WxdkdrawDlgArrowType dlg(
+ this, pobj, sTexts, ms_arrow_images, bDrwElem, false
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleArrowForward, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ nat = pobj->aft;
+ if (oat != nat) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ /*
+ 2020-03-20 Show new arrow style immediately
+ */
+ if (0 == oat) {
+ pobj->afl = m_iv[IVI_ARROWHEAD_LENGTH];
+ pobj->afw = m_iv[IVI_ARROWHEAD_WIDTH];
+ }
+ drawco->Refresh();
+ drawco->Update();
+ }
+ bStyleArrowForward->SetBitmap(ms_arrow_images[nat]);
+ bStyleArrowForward->Refresh();
+ m_bUpdate = true;
+ }
+ if (0U != nat) {
+ WxdkdrawDlgArrowSize dlh(this, pobj, sTexts, bDrwElem, false);
+ Dk4WxApplicationHelper::ChooseChildPosition(
+ *bStyleArrowForward, dlh
+ );
+ res = dlh.ShowModal();
+ if (wxID_OK == res) {
+ nal = pobj->afl;
+ naw = pobj->afw;
+ m_iv[IVI_ARROWHEAD_LENGTH] = nal;
+ m_iv[IVI_ARROWHEAD_WIDTH] = naw;
+ if ((oal != nal) || (oaw != naw)) {
+ if (NULL != m_pStyle) {
+ SetModified();
+ wxdobj_drw_require_redraw(
+ m_pDrw, WXD_REFRESH_DRAWING
+ );
+ }
+ }
+ }
+ }
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleLineArrowF"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleLineArrowB(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t oat;
+ uint8_t nat;
+ uint8_t oal;
+ uint8_t nal;
+ uint8_t oaw;
+ uint8_t naw;
+ bool bDrwElem;
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ oat = nat = pobj->abt;
+ oal = nal = pobj->abl;
+ oaw = naw = pobj->abw;
+ $? "+ OnStyleLineArrowB"
+ if (BeginEventHandling()) {
+ WxdkdrawDlgArrowType dlg(
+ this, pobj, sTexts, ms_arrow_images, bDrwElem, true
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleArrowBackward, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ nat = pobj->abt;
+ if (oat != nat) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ if (0 == oat) {
+ pobj->abl = m_iv[IVI_ARROWHEAD_LENGTH];
+ pobj->abw = m_iv[IVI_ARROWHEAD_WIDTH];
+ }
+ drawco->Refresh();
+ drawco->Update();
+ }
+ bStyleArrowBackward->SetBitmap(ms_arrow_images[nat]);
+ bStyleArrowBackward->Refresh();
+ m_bUpdate = true;
+ }
+ if (0U != nat) {
+ WxdkdrawDlgArrowSize dlh(this, pobj, sTexts, bDrwElem, true);
+ Dk4WxApplicationHelper::ChooseChildPosition(
+ *bStyleArrowForward, dlh
+ );
+ res = dlh.ShowModal();
+ if (wxID_OK == res) {
+ nal = pobj->abl;
+ naw = pobj->abw;
+ m_iv[IVI_ARROWHEAD_LENGTH] = nal;
+ m_iv[IVI_ARROWHEAD_WIDTH] = naw;
+ if ((oal != nal) || (oaw != naw)) {
+ if (NULL != m_pStyle) {
+ SetModified();
+ wxdobj_drw_require_redraw(
+ m_pDrw, WXD_REFRESH_DRAWING
+ );
+ }
+ }
+ }
+ }
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleLineArrowB"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleFillColour(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_stipple_t *pstip;
+ int r;
+ int g;
+ int b;
+ bool hsti;
+ $? "+ OnStyleFillColour"
+ if (BeginEventHandling()) {
+ r = ccFillColour->Red();
+ g = ccFillColour->Green();
+ b = ccFillColour->Blue();
+ if (NULL != m_pStyle) {
+ if (
+ ((uint8_t)r != m_pStyle->fc[0])
+ || ((uint8_t)g != m_pStyle->fc[1])
+ || ((uint8_t)b != m_pStyle->fc[2])
+ ) {
+ m_pStyle->fc[0] = (uint8_t)r;
+ m_pStyle->fc[1] = (uint8_t)g;
+ m_pStyle->fc[2] = (uint8_t)b;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ hsti = (NULL != m_pStyle->psti);
+ if (WXD_FS_PURE < m_pStyle->fs) {
+ pstip = wxdobj_find_stipple_structure(m_pDrw, m_pStyle);
+ m_pStyle->psti = pstip;
+ }
+ else {
+ m_pStyle->psti = NULL;
+ }
+ if (hsti) { $? ". must check stipples"
+ wxdobj_remove_unused_stipples(m_pDrw);
+ }
+ if (NULL != m_pStyle->psti) {
+ if (NULL == (m_pStyle->psti)->bm) {
+ UpdateOneStipple(m_pStyle->psti);
+ }
+ }
+ }
+ }
+ else {
+ m_oStyle.fc[0] = r;
+ m_oStyle.fc[1] = g;
+ m_oStyle.fc[2] = b;
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleFillColour"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleFillPattern(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ Wxd_stipple_t *pstip;
+ int res;
+ uint8_t ofs;
+ uint8_t nfs;
+ bool hsti;
+ bool bDrwElem;
+ $? "+ OnStyleFillPattern"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ ofs = nfs = pobj->fs;
+ if (BeginEventHandling()) {
+ WxdkdrawDlgFillStyle dlg(this, pobj, sTexts, ms_fs_images, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleFillPattern, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ nfs = pobj->fs;
+ if (ofs != nfs) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ hsti = (NULL != m_pStyle->psti);
+ if (WXD_FS_PURE < m_pStyle->fs) {
+ pstip = wxdobj_find_stipple_structure(m_pDrw, m_pStyle);
+ m_pStyle->psti = pstip;
+ }
+ else {
+ m_pStyle->psti = NULL;
+ }
+ if (hsti) {
+ wxdobj_remove_unused_stipples(m_pDrw);
+ }
+ if (NULL != m_pStyle->psti) {
+ if (NULL == (m_pStyle->psti)->bm) {
+ UpdateOneStipple(m_pStyle->psti);
+ }
+ }
+ }
+ bStyleFillPattern->SetBitmap(ms_fs_images[nfs]);
+ bStyleFillPattern->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleFillPattern"
+}
+
+
+void
+WxdkdrawFrame::OnStyleTextLatex(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnStyleTextLatex"
+ if (BeginEventHandling()) {
+ if (cbStyleTextLaTeX->GetValue()) {
+ if (NULL != m_pStyle) {
+ (m_pStyle->det).t.fl |= WXD_TEXT_FLAG_LATEX;
+ }
+ else {
+ m_oStyle.det.t.fl |= WXD_TEXT_FLAG_LATEX;
+ }
+ }
+ else {
+ if (NULL != m_pStyle) {
+ (m_pStyle->det).t.fl &= (~(WXD_TEXT_FLAG_LATEX));
+ }
+ else {
+ m_oStyle.det.t.fl &= (~(WXD_TEXT_FLAG_LATEX));
+ }
+ }
+ if (NULL != m_pStyle) {
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleTextLatex"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleTextAlign(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t oal;
+ uint8_t nal;
+ bool bDrwElem;
+ $? "+ OnStyleTextAlign"
+ pobj = ((NULL != m_pStyle) ? (m_pStyle) : (&m_oStyle));
+ bDrwElem = (NULL != m_pStyle);
+ oal = nal = WXD_TA_LEFT;
+ if (WXD_OT_TEXT == pobj->ot) { oal = nal = (pobj->det).t.al; }
+ if (BeginEventHandling()) {
+ WxdkdrawDlgTextAlign dlg(this, pobj, sTexts, ms_ta_images, bDrwElem);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleTextAlign, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK == res) {
+ nal = (pobj->det).t.al;
+ if (oal != nal) {
+ if (WXD_OT_TEXT == pobj->ot) {
+ if (NULL != m_pStyle) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ bStyleTextAlign->SetBitmap(ms_ta_images[nal]);
+ bStyleLineEnds->Refresh();
+ m_bUpdate = true;
+ }
+ else {
+ if (NULL == m_pStyle) {
+ bStyleTextAlign->SetBitmap(ms_ta_images[nal]);
+ bStyleLineEnds->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ }
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleTextAlign"
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleTextFont(wxCommandEvent & WXUNUSED(event))
+{
+ Wxd_object_t *pobj;
+ int res;
+ uint8_t ofind;
+ bool isobj;
+
+ if (NULL != m_pStyle) {
+ pobj = m_pStyle;
+ isobj = true;
+ }
+ else {
+ pobj = &m_oStyle;
+ isobj = false;
+ }
+ ofind = (pobj->det).t.find;
+ if (DK4_FONT_MAX < ofind) { ofind = DK4_FONT_MAX; }
+ if (BeginEventHandling()) {
+ WxdkdrawDlgFontName dlg(this, pobj, isobj, sTexts, ms_fn_images);
+ Dk4WxApplicationHelper::ChooseChildPosition(*bStyleFontName, dlg);
+ res = dlg.ShowModal();
+ if (wxID_OK != res) {
+ UpdateTextForFont(pobj, false);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ if (ofind != (pobj->det).t.find) {
+ SetModified();
+ bStyleFontName->SetBitmap(ms_fn_images[(pobj->det).t.find]);
+ bStyleFontName->Refresh();
+ m_bUpdate = true;
+ }
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnStyleTextSize(wxSpinEvent & WXUNUSED(event))
+{
+ Wxd_font_t *pfont;
+ uint16_t ofs;
+ uint16_t nfs;
+ bool hasf;
+ $? "+ OnStyleTextSize"
+ if (BeginEventHandling()) {
+ if (NULL != m_pStyle) {
+ if (WXD_OT_TEXT == m_pStyle->ot) {
+ ofs = nfs = (m_pStyle->det).t.fsz;
+ nfs = (uint16_t)(spFontSize->GetValue());
+ if (ofs != nfs) {
+ (m_pStyle->det).t.fsz = nfs;
+ hasf = (NULL != (m_pStyle->det).t.font);
+ pfont = FindFont((m_pStyle->det).t.find, nfs);
+ (m_pStyle->det).t.font = pfont;
+ if (NULL != pfont) { UpdateOneFont(pfont); }
+ if (hasf) { wxdobj_remove_unused_fonts(m_pDrw); }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ }
+ else {
+ m_oStyle.det.t.fsz = (uint16_t)(spFontSize->GetValue());
+ }
+ EndEventHandling();
+ }
+ $? "- OnStyleTextSize"
+}
+
+
+
+void
+WxdkdrawFrame::OnSpinRotation(wxSpinEvent & WXUNUSED(event))
+{
+ $? "+ OnSpinRotation"
+ if (BeginEventHandling()) {
+ if (NULL != m_pStyle) {
+ switch ( (int)(m_pStyle->ot) ) {
+ case WXD_OT_TEXT : {
+ (m_pStyle->det).t.a = spRotation->GetValue();
+ SetModified();
+ RequireRedraw(WXD_REFRESH_DRAWING);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ (m_pStyle->det).e.a = spRotation->GetValue();
+ SetModified();
+ RequireRedraw(WXD_REFRESH_DRAWING);
+ } break;
+ }
+ }
+ EndEventHandling();
+ }
+ $? "- OnSpinRotation"
+}
+
+
+
+void
+WxdkdrawFrame::OnScrollH(wxScrollEvent & WXUNUSED(event))
+{
+ $? "+ OnScrollH"
+ if (BeginEventHandling()) {
+ UseScrollH();
+ EndEventHandling();
+ }
+ $? "- OnScrollH"
+}
+
+
+
+void
+WxdkdrawFrame::OnScrollV(wxScrollEvent & WXUNUSED(event))
+{
+ $? "+ OnScrollV"
+ if (BeginEventHandling()) {
+ UseScrollV();
+ EndEventHandling();
+ }
+ $? "- OnScrollV"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert1(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert1"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_POLYGON;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert1"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert2(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert2"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_POLYLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert2"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert3(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert3"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = true;
+ m_iObjToCreate = WXD_OT_O_SPLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert3"
+}
+
+
+void
+WxdkdrawFrame::OnConvert4(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert4"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_C_ARC;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert4"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert5(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert5"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_O_ARC;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert5"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert6(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert6"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_C_SPLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert6"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert7(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert7"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_O_SPLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert7"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert8(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert8"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_DOT_WHITE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert8"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvert9(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvert9"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = false;
+ m_iObjToCreate = WXD_OT_DOT_FILLED;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvert9"
+}
+
+
+
+void
+WxdkdrawFrame::OnConvertA(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnConvertA"
+ if (BeginEventHandling()) {
+ m_bSplineInterpolated = true;
+ m_iObjToCreate = WXD_OT_C_SPLINE;
+ m_iState = S_CONVERT;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnConvertA"
+}
+
+
+
+void
+WxdkdrawFrame::OnColourBorderModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_BORDER_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourBorderReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_BORDER_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourBackgroundModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_BG_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourBackgroundReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_BG_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourGridModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_GRID_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourGridReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_GRID_RED, WXD_REFRESH_GRID);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourPlacementModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_PH_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourPlacementReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_PH_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourCopyModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_M_COPY_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourCopyReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_M_COPY_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourMoveModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_M_MOVE_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourMoveReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_M_MOVE_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourDeleteModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_M_DEL_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourDeleteReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_M_DEL_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourGroupModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_M_GROUP_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourGroupReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_M_GROUP_RED, WXD_REFRESH_MARKUP);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourMissingModify(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorModify(IVI_MISSIMG_RED, WXD_REFRESH_DRAWING);
+ EndEventHandling();
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnColourMissingReset(wxCommandEvent & WXUNUSED(event))
+{
+ if (BeginEventHandling()) {
+ ColorReset(IVI_MISSIMG_RED, WXD_REFRESH_DRAWING);
+ EndEventHandling();
+ }
+}
+
+
+
+
+void
+WxdkdrawFrame::OnResetOptions(wxCommandEvent & WXUNUSED(event))
+{
+ int res; /* Message box result */
+ $? "+ OnResetOptions"
+ if (m_bActive) {
+ Dk4WxYesNoDialog dlg(
+ this, pAppHelp, sTexts[605], sTexts[604]
+ );
+ StartEventHandling();
+#if VERSION_BEFORE_2020_08_23
+ res = wxMessageBox(
+ sTexts[605], sTexts[604], (wxYES_NO | wxICON_QUESTION)
+ );
+#else
+ res = dlg.ShowModal();
+#endif
+ if (wxYES == res) {
+ ResetConfiguration();
+ cbGridOnOff->SetValue(true);
+ cbPH->SetValue(false);
+ if (
+ (S_NOOP != m_iState) || (NULL == m_pStyle)
+ || (&m_oStyle == m_pStyle)
+ ) {
+ StyleToGUI();
+ }
+ cbGridOnOff->Refresh();
+ cbPH->Refresh();
+ if ((NULL != m_pDrw) && (NULL != drawco)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ }
+ m_bUpdate = true;
+ }
+ EndEventHandling();
+ }
+ $? "- OnResetOptions"
+}
+
+
+
+void
+WxdkdrawFrame::OnModifySplineValue(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnModifySplineValue"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ m_iState = S_MOD_SPLINE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ EndEventHandling();
+ }
+ $? "- OnModifySplineValue"
+}
+
+
+
+void
+WxdkdrawFrame::OnOptionsNewObjects(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnOptionsNewObjects"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ WxdkdrawDlgOptionsNewObjects dlg(
+ this,
+ &(m_iv[IVI_DOT_DIAMETER_FILLED]),
+ &(m_iv[IVI_DOT_DIAMETER_WHITE]),
+ sTexts
+ );
+ dlg.ShowModal();
+ EndEventHandling();
+ }
+ $? "- OnOptionsNewObjects"
+}
+
+
+
+void
+WxdkdrawFrame::OnOptionsScreenRepresentation(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnOptionsScreenRepresentation"
+ if (BeginEventHandling()) {
+ EndOperation(true);
+ WxdkdrawDlgOptionsScreen dlg(
+ this, drawco, m_pDrw,
+ &(m_iv[IVI_XS_SUBSEGS]), &(m_iv[IVI_FONT_EXACT]),
+ &(m_iv[IVI_REDUCE_MARKUP_POINTS]), sTexts
+ );
+ dlg.ShowModal();
+ UpdateFonts();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ drawco->Refresh();
+ m_bUpdate = true;
+ EndEventHandling();
+ }
+ $? "- OnOptionsScreenRepresentation"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawFrameStipples.cpp b/support/dktools/WxdkdrawFrameStipples.cpp
new file mode 100644
index 0000000000..9df9a5b648
--- /dev/null
+++ b/support/dktools/WxdkdrawFrameStipples.cpp
@@ -0,0 +1,1415 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawFrameStipples.cpt
+*/
+
+/** @file WxdkdrawFrameStipples.cpp The WxdkdrawFrameStipples module.
+*/
+
+
+#line 7 "WxdkdrawFrameStipples.cpt"
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+
+#line 17 "WxdkdrawFrameStipples.cpt"
+
+
+
+/** Calculate bitmap dimensions.
+ @param pw Address of width variable.
+ @param ph Address of height variable.
+ @param patt Pattern type.
+ @param patco Pattern coefficients.
+*/
+static
+void
+calculate_bitmap_dimensions(
+ int *pw,
+ int *ph,
+ int patt,
+ double const *patco
+)
+{
+ int w = 0; /* Image width */
+ int h = 0; /* Image height */
+
+
+#line 38 "WxdkdrawFrameStipples.cpt"
+ switch (patt) {
+ case WXD_FS_30_DEGREE_LEFT :
+ case WXD_FS_30_DEGREE_RIGHT :
+ case WXD_FS_30_DEGREE_SIEVE : {
+ h = (int)ceil(patco[0]);
+ w = (int)ceil(patco[1]);
+ } break;
+ case WXD_FS_45_DEGREE_LEFT :
+ case WXD_FS_45_DEGREE_RIGHT :
+ case WXD_FS_45_DEGREE_SIEVE : {
+ w = h = (int)ceil(patco[2]);
+ } break;
+ case WXD_FS_HORIZONTAL_BRICKS :
+ case WXD_FS_VERTICAL_BRICKS : {
+ w = h = (int)ceil(patco[3]);
+ } break;
+ case WXD_FS_HORIZONTAL_LINES :
+ case WXD_FS_VERTICAL_LINES :
+ case WXD_FS_HORIZONTAL_VERTICAL_SIEVE : {
+ w = h = (int)ceil(patco[4]);
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_LEFT :
+ case WXD_FS_HORIZONTAL_SHINGLES_RIGHT :
+ case WXD_FS_VERTICAL_SHINGLES_1 :
+ case WXD_FS_VERTICAL_SHINGLES_2 : {
+ w = h = (int)ceil(patco[5]);
+ } break;
+ case WXD_FS_LARGE_FISH_SCALES : {
+ w = (int)ceil(patco[6]);
+ h = (int)ceil(patco[7]);
+ } break;
+ case WXD_FS_SMALL_FISH_SCALES : {
+ w = (int)ceil(patco[1]);
+ h = (int)ceil(patco[1]);
+ } break;
+ case WXD_FS_CIRCLES : {
+ w = h = (int)ceil(patco[3]);
+ } break;
+ case WXD_FS_HEXAGONS : {
+ h = (int)ceil(patco[3]);
+ w = (int)ceil(patco[8]);
+ } break;
+ case WXD_FS_OCTAGONS : {
+ w = h = (int)ceil(patco[3]);
+ } break;
+ case WXD_FS_HORIZONTAL_TIRES : {
+ w = (int)ceil(patco[1]);
+ h = (int)ceil(patco[4]);
+ } break;
+ case WXD_FS_VERTICAL_TIRES : {
+ h = (int)ceil(patco[1]);
+ w = (int)ceil(patco[4]);
+ } break;
+ }
+
+
+#line 93 "WxdkdrawFrameStipples.cpt"
+
+
+#line 94 "WxdkdrawFrameStipples.cpt"
+ if (NULL != pw) { *pw = w; }
+ if (NULL != ph) { *ph = h; }
+
+
+#line 97 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+ @param coeff Fixed coefficients.
+*/
+static
+void
+draw_pattern_30_left(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw,
+ double const *coeff
+)
+{
+ double dh;
+ double dw;
+ double d_h;
+ double d_w;
+
+
+#line 123 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ d_h = (double)h;
+ d_w = (double)w;
+ dh = (double)lw;
+ dw = coeff[0] * dh;
+ /*
+ Diagonal line
+ */
+ p1.MoveToPoint(0.0, 0.0);
+ p1.AddLineToPoint(d_w, d_h);
+ gc->StrokePath(p1);
+ /*
+ Line at top right corner
+ */
+ p2.MoveToPoint((d_w - dw), (0.0 - dh));
+ p2.AddLineToPoint((d_w + dw), dh);
+ gc->StrokePath(p2);
+ /*
+ Line at bottom left corner
+ */
+ p3.MoveToPoint((0.0 - dw), (d_h - dh));
+ p3.AddLineToPoint(dw, (d_h + dh));
+ gc->StrokePath(p3);
+
+
+#line 149 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+ @param coeff Fixed coefficients.
+*/
+static
+void
+draw_pattern_30_right(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw,
+ double const *coeff
+)
+{
+ double dh;
+ double dw;
+ double d_h;
+ double d_w;
+
+
+#line 175 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ d_h = (double)h;
+ d_w = (double)w;
+ dh = (double)lw;
+ dw = coeff[0] * dh;
+ /*
+ Diagonal line
+ */
+ p1.MoveToPoint(d_w, 0.0);
+ p1.AddLineToPoint(0.0, d_h);
+ gc->StrokePath(p1);
+ /*
+ Line at top left corner
+ */
+ p2.MoveToPoint((0.0 - dw), dh);
+ p2.AddLineToPoint(dw, (0.0 - dh));
+ gc->StrokePath(p2);
+ /*
+ Line at bottom right corner
+ */
+ p3.MoveToPoint((d_w - dw), (d_h + dh));
+ p3.AddLineToPoint((d_w + dw), (d_h - dh));
+ gc->StrokePath(p3);
+
+
+#line 201 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_45_left(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double d_w;
+ double d_h;
+
+
+#line 223 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ /*
+ Diagonal line
+ */
+ p1.MoveToPoint(0.0, 0.0);
+ p1.AddLineToPoint(d_w, d_h);
+ gc->StrokePath(p1);
+ /*
+ Line at top right corner
+ */
+ p2.MoveToPoint((double)(w - 2 * lw), (double)(0 - 2 * lw));
+ p2.AddLineToPoint((double)(w + 2 * lw), (double)(0 + 2 * lw));
+ gc->StrokePath(p2);
+ /*
+ Line at bottom left corner
+ */
+ p3.MoveToPoint((double)(0 - 2 * lw), (double)(h - 2 * lw));
+ p3.AddLineToPoint((double)(0 + 2 * lw), (double)(h + 2 * lw));
+ gc->StrokePath(p3);
+
+
+#line 247 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_45_right(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double d_w;
+ double d_h;
+
+
+#line 269 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ /*
+ Diagonal line
+ */
+ p1.MoveToPoint(d_w, 0.0);
+ p1.AddLineToPoint(0.0, d_h);
+ gc->StrokePath(p1);
+ /*
+ Line at top right corner
+ */
+ p2.MoveToPoint((double)(2 * lw), (double)(0 - 2 * lw));
+ p2.AddLineToPoint((double)(0 - 2 * lw), (double)(2 * lw));
+ gc->StrokePath(p2);
+ /*
+ Line at bottom left corner
+ */
+ p3.MoveToPoint((double)(w + 2 * lw), (double)(h - 2 * lw));
+ p3.AddLineToPoint((double)(w - 2 * lw), (double)(h + 2 * lw));
+ gc->StrokePath(p3);
+
+
+#line 293 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_horizontal_bricks(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x;
+ double y;
+ double d_w;
+ double d_h;
+ double d_lw;
+
+
+#line 318 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y = d_h / 4.0;
+ x = d_w / 4.0;
+ p1.MoveToPoint((0.0 - d_lw), y);
+ p1.AddLineToPoint((d_w + d_lw), y);
+ gc->StrokePath(p1);
+ y = (3.0 * d_h) / 4.0;
+ p2.MoveToPoint((0.0 - d_lw), y);
+ p2.AddLineToPoint((d_w + d_lw), y);
+ gc->StrokePath(p2);
+ p3.MoveToPoint(x, y);
+ y = d_h / 4.0;
+ p3.AddLineToPoint(x, y);
+ gc->StrokePath(p3);
+ x = (3.0 * d_w) / 4.0;
+ p4.MoveToPoint(x, y);
+ p4.AddLineToPoint(x, (0.0 - d_lw));
+ gc->StrokePath(p4);
+ y = (3.0 * d_h) / 4.0;
+ p5.MoveToPoint(x, y);
+ p5.AddLineToPoint(x, (d_h + d_lw));
+ gc->StrokePath(p5);
+
+
+#line 348 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_vertical_bricks(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x;
+ double y;
+ double d_w;
+ double d_h;
+ double d_lw;
+
+
+#line 373 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y = d_h / 4.0;
+ x = d_w / 4.0;
+ p1.MoveToPoint(y, (0.0 - d_lw));
+ p1.AddLineToPoint(y, (d_w + d_lw));
+ gc->StrokePath(p1);
+ y = (3.0 * d_h) / 4.0;
+ p2.MoveToPoint(y, (0.0 - d_lw));
+ p2.AddLineToPoint(y, (d_w + d_lw));
+ gc->StrokePath(p2);
+ p3.MoveToPoint(y, x);
+ y = d_h / 4.0;
+ p3.AddLineToPoint(y, x);
+ gc->StrokePath(p3);
+ x = (3.0 * d_w) / 4.0;
+ p4.MoveToPoint(y, x);
+ p4.AddLineToPoint((0.0 - d_lw), x);
+ gc->StrokePath(p4);
+ y = (3.0 * d_h) / 4.0;
+ p5.MoveToPoint(y, x);
+ p5.AddLineToPoint((d_h + d_lw), x);
+ gc->StrokePath(p5);
+
+
+#line 403 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_horizontal_lines(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double y;
+ double d_lw;
+
+
+#line 425 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ d_lw = (double)lw;
+ y = (double)h / 2.0;
+ p1.MoveToPoint((0.0 - d_lw), y);
+ p1.AddLineToPoint(((double)w + d_lw), y);
+ gc->StrokePath(p1);
+
+
+#line 432 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_vertical_lines(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x;
+ double d_lw;
+
+
+#line 454 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ d_lw = (double)lw;
+ x = (double)w / 2.0;
+ p1.MoveToPoint(x, (0.0 - d_lw));
+ p1.AddLineToPoint(x, ((double)h + d_lw));
+ gc->StrokePath(p1);
+
+
+#line 461 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_horizontal_shingles_left(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double dx;
+ double y1;
+ double y2;
+ double y3;
+ double y4;
+ double y5;
+ double d_w;
+ double d_h;
+ double d_lw;
+
+
+#line 493 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ wxGraphicsPath p6 = gc->CreatePath();
+ wxGraphicsPath p7 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y1 = 0.0 - (d_h / 6.0);
+ y2 = d_h / 6.0;
+ y3 = d_h / 2.0;
+ y4 = (5.0 * d_h) / 6.0;
+ y5 = (7.0 * d_h) / 6.0;
+ x1 = d_w / 6.0;
+ x2 = d_w / 2.0;
+ x3 = (5.0 * d_w) / 6.0;
+ dx = d_w / 12.0;
+ p1.MoveToPoint((0.0 - d_lw), y2);
+ p1.AddLineToPoint((d_w + d_lw), y2);
+ gc->StrokePath(p1);
+ p2.MoveToPoint((0.0 - d_lw), y3);
+ p2.AddLineToPoint((d_w + d_lw), y3);
+ gc->StrokePath(p2);
+ p3.MoveToPoint((0.0 - d_lw), y4);
+ p3.AddLineToPoint((d_w + d_lw), y4);
+ gc->StrokePath(p3);
+ p4.MoveToPoint((x3 + dx), y1);
+ p4.AddLineToPoint((x3 - dx), y2);
+ gc->StrokePath(p4);
+ p5.MoveToPoint((x1 + dx), y2);
+ p5.AddLineToPoint((x1 - dx), y3);
+ gc->StrokePath(p5);
+ p6.MoveToPoint((x2 + dx), y3);
+ p6.AddLineToPoint((x2 - dx), y4);
+ gc->StrokePath(p6);
+ p7.MoveToPoint((x3 + dx), y4);
+ p7.AddLineToPoint((x3 - dx), y5);
+ gc->StrokePath(p7);
+
+
+#line 534 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_horizontal_shingles_right(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double dx;
+ double y1;
+ double y2;
+ double y3;
+ double y4;
+ double y5;
+ double d_h;
+ double d_w;
+ double d_lw;
+
+
+#line 566 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ wxGraphicsPath p6 = gc->CreatePath();
+ wxGraphicsPath p7 = gc->CreatePath();
+ d_h = (double)h;
+ d_w = (double)w;
+ d_lw = (double)lw;
+ y1 = 0.0 - (d_h / 6.0);
+ y2 = d_h / 6.0;
+ y3 = d_h / 2.0;
+ y4 = (5.0 * d_h) / 6.0;
+ y5 = (7.0 * d_h) / 6.0;
+ x1 = d_w / 6.0;
+ x2 = d_w / 2.0;
+ x3 = (5.0 * d_w) / 6.0;
+ dx = d_w / 12.0;
+ p1.MoveToPoint((0.0 - d_lw), y2);
+ p1.AddLineToPoint((d_w + d_lw), y2);
+ gc->StrokePath(p1);
+ p2.MoveToPoint((0.0 - d_lw), y3);
+ p2.AddLineToPoint((d_w + d_lw), y3);
+ gc->StrokePath(p2);
+ p3.MoveToPoint((0.0 - d_lw), y4);
+ p3.AddLineToPoint((d_w + d_lw), y4);
+ gc->StrokePath(p3);
+ p4.MoveToPoint((x3 - dx), y1);
+ p4.AddLineToPoint(x3 + dx, y2);
+ gc->StrokePath(p4);
+ p5.MoveToPoint((x2 - dx), y2);
+ p5.AddLineToPoint((x2 + dx), y3);
+ gc->StrokePath(p5);
+ p6.MoveToPoint((x1 - dx), y3);
+ p6.AddLineToPoint((x1 + dx), y4);
+ gc->StrokePath(p6);
+ p7.MoveToPoint((x3 - dx), y4);
+ p7.AddLineToPoint((x3 + dx), y5);
+ gc->StrokePath(p7);
+
+
+#line 607 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_vertical_shingles_1(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double dx;
+ double y1;
+ double y2;
+ double y3;
+ double y4;
+ double y5;
+ double d_w;
+ double d_h;
+ double d_lw;
+
+
+#line 639 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ wxGraphicsPath p6 = gc->CreatePath();
+ wxGraphicsPath p7 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y1 = 0.0 - (d_h / 6.0);
+ y2 = d_h / 6.0;
+ y3 = d_h / 2.0;
+ y4 = (5.0 * d_h) / 6.0;
+ y5 = (7.0 * d_h) / 6.0;
+ x1 = d_w / 6.0;
+ x2 = d_w / 2.0;
+ x3 = (5.0 * d_w) / 6.0;
+ dx = d_w / 12.0;
+ p1.MoveToPoint(y2, (0.0 - d_lw));
+ p1.AddLineToPoint(y2, (d_w + d_lw));
+ gc->StrokePath(p1);
+ p2.MoveToPoint(y3, (0.0 - d_lw));
+ p2.AddLineToPoint(y3, (d_w + d_lw));
+ gc->StrokePath(p2);
+ p3.MoveToPoint(y4, (0.0 - d_lw));
+ p3.AddLineToPoint(y4, (d_w + d_lw));
+ gc->StrokePath(p3);
+ p4.MoveToPoint(y1, (x3 - dx));
+ p4.AddLineToPoint(y2, (x3 + dx));
+ gc->StrokePath(p4);
+ p5.MoveToPoint(y2, (x2 - dx));
+ p5.AddLineToPoint(y3, (x2 + dx));
+ gc->StrokePath(p5);
+ p6.MoveToPoint(y3, (x1 - dx));
+ p6.AddLineToPoint(y4, (x1 + dx));
+ gc->StrokePath(p6);
+ p7.MoveToPoint(y4, (x3 - dx));
+ p7.AddLineToPoint(y5, (x3 + dx));
+ gc->StrokePath(p7);
+
+
+#line 680 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_vertical_shingles_2(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double dx;
+ double y1;
+ double y2;
+ double y3;
+ double y4;
+ double y5;
+ double d_w;
+ double d_h;
+ double d_lw;
+
+
+#line 712 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ wxGraphicsPath p6 = gc->CreatePath();
+ wxGraphicsPath p7 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y1 = 0.0 - (d_h / 6.0);
+ y2 = d_h / 6.0;
+ y3 = d_h / 2.0;
+ y4 = (5.0 * d_h) / 6.0;
+ y5 = (7.0 * d_h) / 6.0;
+ x1 = d_w / 6.0;
+ x2 = d_w / 2.0;
+ x3 = (5.0 * d_w) / 6.0;
+ dx = d_w / 12.0;
+ p1.MoveToPoint(y2, (0.0 - d_lw));
+ p1.AddLineToPoint(y2, (d_w + d_lw));
+ gc->StrokePath(p1);
+ p2.MoveToPoint(y3, (0.0 - d_lw));
+ p2.AddLineToPoint(y3, (d_w + d_lw));
+ gc->StrokePath(p2);
+ p3.MoveToPoint(y4, (0.0 - d_lw));
+ p3.AddLineToPoint(y4, (d_w + d_lw));
+ gc->StrokePath(p3);
+ p4.MoveToPoint(y1, (x3 + dx));
+ p4.AddLineToPoint(y2, (x3 - dx));
+ gc->StrokePath(p4);
+ p5.MoveToPoint(y2, (x1 + dx));
+ p5.AddLineToPoint(y3, (x1 - dx));
+ gc->StrokePath(p5);
+ p6.MoveToPoint(y3, (x2 + dx));
+ p6.AddLineToPoint(y4, (x2 - dx));
+ gc->StrokePath(p6);
+ p7.MoveToPoint(y4, (x3 + dx));
+ p7.AddLineToPoint(y5, (x3 - dx));
+ gc->StrokePath(p7);
+
+
+#line 753 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param patco Coefficients for pattern drawing.
+ @param patci Index of start coefficient in array.
+*/
+static
+void
+draw_pattern_fish_scales(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ double const *patco,
+ size_t patci
+)
+{
+ double x0;
+ double y0;
+ double x1;
+ double y1;
+ double d_w;
+ double d_h;
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+
+
+#line 785 "WxdkdrawFrameStipples.cpt"
+ d_w = (double)w;
+ d_h = (double)h;
+
+
+#line 788 "WxdkdrawFrameStipples.cpt"
+
+
+#line 789 "WxdkdrawFrameStipples.cpt"
+ x0 = 0.0;
+ y0 = 0.0;
+ x1 = d_w;
+ y1 = 0.0;
+ p1.MoveToPoint(x0, y0);
+ p1.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ gc->StrokePath(p1);
+ x0 = (-1.0 * d_w) / 2.0;
+ y0 = d_h / 2.0;
+ x1 = x0 + d_w;
+ y1 = y0;
+ p2.MoveToPoint(x0, y0);
+ p2.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ x0 += d_w;
+ x1 += d_w;
+ p2.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ gc->StrokePath(p2);
+ x0 = 0.0;
+ y0 = d_h;
+ x1 = d_w;
+ y1 = d_h;
+ p3.MoveToPoint(x0, y0);
+ p3.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ gc->StrokePath(p3);
+ x0 = (-1.0 * d_w) / 2.0;
+ y0 = (-1.0 * d_h) / 2.0;
+ x1 = x0 + d_w;
+ y1 = y0;
+ p4.MoveToPoint(x0, y0);
+ p4.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ x0 += d_w;
+ x1 += d_w;
+ p4.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ gc->StrokePath(p4);
+
+
+
+#line 849 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+*/
+static
+void
+draw_pattern_circles(
+ wxGraphicsContext *gc,
+ int w,
+ int h
+)
+{
+ double r;
+
+
+#line 868 "WxdkdrawFrameStipples.cpt"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ r = (double)w / 2.0;
+ p1.AddCircle(r, r, r);
+ gc->StrokePath(p1);
+ p2.AddCircle((0.0 - r), r, r);
+ gc->StrokePath(p2);
+ p3.AddCircle(r, (0.0 - r), r);
+ gc->StrokePath(p3);
+ p4.AddCircle((w + r), r, r);
+ gc->StrokePath(p4);
+ p5.AddCircle(r, (h + r), r);
+ gc->StrokePath(p5);
+
+
+#line 885 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param coeff Fixed coefficients.
+*/
+static
+void
+draw_pattern_hexagons(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ double const *coeff
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double b;
+ double d_h;
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+
+
+#line 912 "WxdkdrawFrameStipples.cpt"
+ d_h = (double)h;
+ b = d_h / 2.0;
+ x1 = b / coeff[0];
+ x2 = b * coeff[0];
+ x3 = (coeff[0] + 1.0 / coeff[0]) * b;
+ p1.MoveToPoint(x1, 0.0);
+ p1.AddLineToPoint(x2, 0.0);
+ p1.AddLineToPoint(x3, (d_h / 2.0));
+ p1.AddLineToPoint(x2, d_h);
+ p1.AddLineToPoint(x1, d_h);
+ p1.AddLineToPoint(0.0, (d_h / 2.0));
+ p1.AddLineToPoint(x1, 0.0);
+ p1.CloseSubpath();
+ gc->StrokePath(p1);
+ p2.MoveToPoint(x3, (d_h / 2.0));
+ p2.AddLineToPoint(w, (d_h / 2.0));
+ gc->StrokePath(p2);
+
+
+#line 930 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_octagons(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double xc;
+ double yc;
+ double d_w;
+ double d_h;
+ double d_lw;
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+
+
+#line 961 "WxdkdrawFrameStipples.cpt"
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ /* x1 = d_w * (1.0 - 1.0 / (1.0 + M_SQRT2)); */
+ x1 = (w * M_SQRT2) / (2.0 * (1.0 + M_SQRT2));
+ xc = d_w / 2.0;
+ yc = d_h / 2.0;
+ p1.MoveToPoint((xc - x1), yc);
+ p1.AddLineToPoint(xc, (yc - x1));
+ p1.AddLineToPoint((xc + x1), yc);
+ p1.AddLineToPoint(xc, (yc + x1));
+ p1.AddLineToPoint((xc - x1), yc);
+ p1.CloseSubpath();
+ gc->StrokePath(p1);
+ p2.MoveToPoint((xc - x1), yc);
+ p2.AddLineToPoint((0.0 - d_lw), yc);
+ gc->StrokePath(p2);
+ p3.MoveToPoint(xc, (yc - x1));
+ p3.AddLineToPoint(xc, (0.0 - d_lw));
+ gc->StrokePath(p3);
+ p4.MoveToPoint((xc + x1), yc);
+ p4.AddLineToPoint((d_w + d_lw), yc);
+ gc->StrokePath(p4);
+ p5.MoveToPoint(xc, (yc + x1));
+ p5.AddLineToPoint(xc, (d_h + d_lw));
+ gc->StrokePath(p5);
+
+
+#line 988 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+*/
+static
+void
+draw_pattern_horizontal_tires(
+ wxGraphicsContext *gc,
+ int w,
+ int h
+)
+{
+ double y;
+ double d_w;
+ double d_h;
+ size_t i;
+
+
+#line 1010 "WxdkdrawFrameStipples.cpt"
+ d_w = (double)w;
+ d_h = (double)h;
+ y = 0.0;
+ for (i = 0; i < 3; i++) {
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint((0.0 - d_w), y);
+ p1.AddLineToPoint((0.0 - d_w / 2.0), (y - d_h));
+ p1.AddLineToPoint(0.0, y);
+ p1.AddLineToPoint(((d_w) / 2.0), (y - d_h));
+ p1.AddLineToPoint(d_w, y);
+ p1.AddLineToPoint((1.5 * d_w), (y - d_h));
+ p1.AddLineToPoint((2.0 * d_w), y);
+ gc->StrokePath(p1);
+ y += h;
+ }
+
+
+#line 1026 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+*/
+static
+void
+draw_pattern_vertical_tires(
+ wxGraphicsContext *gc,
+ int w,
+ int h
+)
+{
+ double x;
+ double d_w;
+ double d_h;
+ size_t i;
+
+
+#line 1048 "WxdkdrawFrameStipples.cpt"
+ d_w = (double)w;
+ d_h = (double)h;
+ x = 0.0;
+ for (i = 0; i < 3; i++) {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(x, (0.0 - d_h));
+ p.AddLineToPoint((x - d_w), (0.0 - d_h / 2.0));
+ p.AddLineToPoint(x, 0.0);
+ p.AddLineToPoint((x - d_w), (d_h / 2.0));
+ p.AddLineToPoint(x, h);
+ p.AddLineToPoint((x - d_w), (1.5 * d_h));
+ p.AddLineToPoint(x, (2.0 * d_h));
+ gc->StrokePath(p);
+ x += w;
+ }
+
+
+#line 1064 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param pt Pattern type.
+ @param lw Line width to draw pattern.
+ @param patco Pattern coefficients.
+ @param coeff Fixed coefficients.
+*/
+static
+void
+draw_fill_pattern(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int pt,
+ int lw,
+ double const *patco,
+ double const *coeff
+)
+{
+
+
+#line 1090 "WxdkdrawFrameStipples.cpt"
+ switch (pt) {
+ case WXD_FS_30_DEGREE_LEFT : {
+ draw_pattern_30_left(gc, w, h, lw, coeff);
+ } break;
+ case WXD_FS_30_DEGREE_RIGHT : {
+ draw_pattern_30_right(gc, w, h, lw, coeff);
+ } break;
+ case WXD_FS_30_DEGREE_SIEVE : {
+ draw_pattern_30_left(gc, w, h, lw, coeff);
+ draw_pattern_30_right(gc, w, h, lw, coeff);
+ } break;
+ case WXD_FS_45_DEGREE_LEFT : {
+ draw_pattern_45_left(gc, w, h, lw);
+ } break;
+ case WXD_FS_45_DEGREE_RIGHT : {
+ draw_pattern_45_right(gc, w, h, lw);
+ } break;
+ case WXD_FS_45_DEGREE_SIEVE : {
+ draw_pattern_45_left(gc, w, h, lw);
+ draw_pattern_45_right(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_BRICKS : {
+ draw_pattern_horizontal_bricks(gc, w, h, lw);
+ } break;
+ case WXD_FS_VERTICAL_BRICKS : {
+ draw_pattern_vertical_bricks(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_LINES : {
+ draw_pattern_horizontal_lines(gc, w, h, lw);
+ } break;
+ case WXD_FS_VERTICAL_LINES : {
+ draw_pattern_vertical_lines(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_VERTICAL_SIEVE : {
+ draw_pattern_horizontal_lines(gc, w, h, lw);
+ draw_pattern_vertical_lines(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_LEFT : {
+ draw_pattern_horizontal_shingles_left(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_RIGHT : {
+ draw_pattern_horizontal_shingles_right(gc, w, h, lw);
+ } break;
+ case WXD_FS_VERTICAL_SHINGLES_1 : {
+ draw_pattern_vertical_shingles_1(gc, w, h, lw);
+ } break;
+ case WXD_FS_VERTICAL_SHINGLES_2 : {
+ draw_pattern_vertical_shingles_2(gc, w, h, lw);
+ } break;
+ case WXD_FS_LARGE_FISH_SCALES : {
+ draw_pattern_fish_scales(gc, w, h, patco, 9);
+ } break;
+ case WXD_FS_SMALL_FISH_SCALES : {
+ draw_pattern_fish_scales(gc, w, h, patco, 13);
+ } break;
+ case WXD_FS_CIRCLES : {
+ draw_pattern_circles(gc, w, h);
+ } break;
+ case WXD_FS_HEXAGONS : {
+ draw_pattern_hexagons(gc, w, h, coeff);
+ } break;
+ case WXD_FS_OCTAGONS : {
+ draw_pattern_octagons(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_TIRES : {
+ draw_pattern_horizontal_tires(gc, w, h);
+ } break;
+ case WXD_FS_VERTICAL_TIRES : {
+ draw_pattern_vertical_tires(gc, w, h);
+ } break;
+ }
+
+
+#line 1162 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::UpdateOneStipple(Wxd_stipple_t *psti)
+{
+ int w = 0; /* Bitmap width */
+ int h = 0; /* Bitmap height */
+ int lw = 0; /* Line width to draw fill pattern */
+
+
+
+#line 1174 "WxdkdrawFrameStipples.cpt"
+ if (NULL != psti->bm) {
+
+#line 1175 "WxdkdrawFrameStipples.cpt"
+ delete(psti->bm);
+ psti->bm = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1180 "WxdkdrawFrameStipples.cpt"
+ }
+#endif
+ calculate_bitmap_dimensions(&w, &h, (int)(psti->cd[0]), m_dPatterns);
+ lw = (int)dk4ma_rint(
+ (0.45 * drawco->m_dZoom * (drawco->m_ptRes).x) / 72.0
+ );
+ if (0 >= lw) { lw = 1; }
+
+
+#line 1188 "WxdkdrawFrameStipples.cpt"
+
+
+#line 1189 "WxdkdrawFrameStipples.cpt"
+
+
+#line 1190 "WxdkdrawFrameStipples.cpt"
+ if ((1 < w) && (1 < h)) {
+
+#line 1191 "WxdkdrawFrameStipples.cpt"
+ wxImage imag(w, h);
+ wxColour fc(
+ (int)(psti->cd[1]), (int)(psti->cd[2]), (int)(psti->cd[3])
+ );
+ wxColour sc(
+ (int)(psti->cd[4]), (int)(psti->cd[5]), (int)(psti->cd[6])
+ );
+ wxBrush bru(fc);
+ wxPen pen(sc, lw);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(imag);
+ if (NULL != gc) {
+
+#line 1202 "WxdkdrawFrameStipples.cpt"
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(0.0, 0.0, (double)w, (double)h);
+ gc->FillPath(p);
+ }
+ gc->SetBrush(wxNullBrush);
+ pen.SetCap(wxCAP_ROUND);
+ pen.SetJoin(wxJOIN_ROUND);
+ gc->SetPen(pen);
+ draw_fill_pattern(gc,w,h,psti->cd[0],lw,m_dPatterns,m_dFactors);
+ gc->SetPen(wxNullPen);
+ gc->Flush();
+ delete gc;
+ psti->bm = new wxBitmap(imag);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1221 "WxdkdrawFrameStipples.cpt"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1226 "WxdkdrawFrameStipples.cpt"
+ }
+#endif
+
+
+#line 1229 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::UpdatePatternCoefficients(void)
+{
+ size_t i;
+ m_dPatterns[0] =
+ (drawco->m_dZoom * drawco->m_ptRes.x) / (10.0 * m_dFactors[0]);
+ m_dPatterns[1] =
+ (drawco->m_dZoom * drawco->m_ptRes.x) / 10.0;
+ m_dPatterns[2] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * M_SQRT2) / 20.0;
+ m_dPatterns[3] =
+ (drawco->m_dZoom * drawco->m_ptRes.x) / 5.0;
+ m_dPatterns[4] =
+ (drawco->m_dZoom * drawco->m_ptRes.x) / 20.0;
+ m_dPatterns[5] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * 0.3);
+ m_dPatterns[6] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * 14.54) / 72.0;
+ m_dPatterns[7] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * 3.7) / 36.0;
+ m_dPatterns[8] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * m_dFactors[0]) / 5.0;
+ /*
+ 9 to 16
+ */
+ for (i = 0; i < 8; i++) {
+ m_dPatterns[9 + i] = drawco->m_dZoom * m_dFactors[1 + i];
+ }
+}
+
+
+
+void
+WxdkdrawFrame::UpdateStipples(void)
+{
+ Wxd_stipple_t *psti;
+
+
+
+#line 1271 "WxdkdrawFrameStipples.cpt"
+ UpdatePatternCoefficients();
+ if (NULL != m_pDrw) {
+ dk4sto_it_reset(m_pDrw->i_stip);
+ do {
+ psti = (Wxd_stipple_t *)dk4sto_it_next(m_pDrw->i_stip);
+ if (NULL != psti) {
+ UpdateOneStipple(psti);
+ }
+ } while (NULL != psti);
+ }
+
+
+#line 1282 "WxdkdrawFrameStipples.cpt"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawFrameStipples.cpt b/support/dktools/WxdkdrawFrameStipples.cpt
new file mode 100644
index 0000000000..1af8884cca
--- /dev/null
+++ b/support/dktools/WxdkdrawFrameStipples.cpt
@@ -0,0 +1,1287 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% module
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Calculate bitmap dimensions.
+ @param pw Address of width variable.
+ @param ph Address of height variable.
+ @param patt Pattern type.
+ @param patco Pattern coefficients.
+*/
+static
+void
+calculate_bitmap_dimensions(
+ int *pw,
+ int *ph,
+ int patt,
+ double const *patco
+)
+{
+ int w = 0; /* Image width */
+ int h = 0; /* Image height */
+ $? "+ calculate_bitmap_dimensions"
+ switch (patt) {
+ case WXD_FS_30_DEGREE_LEFT :
+ case WXD_FS_30_DEGREE_RIGHT :
+ case WXD_FS_30_DEGREE_SIEVE : {
+ h = (int)ceil(patco[0]);
+ w = (int)ceil(patco[1]);
+ } break;
+ case WXD_FS_45_DEGREE_LEFT :
+ case WXD_FS_45_DEGREE_RIGHT :
+ case WXD_FS_45_DEGREE_SIEVE : {
+ w = h = (int)ceil(patco[2]);
+ } break;
+ case WXD_FS_HORIZONTAL_BRICKS :
+ case WXD_FS_VERTICAL_BRICKS : {
+ w = h = (int)ceil(patco[3]);
+ } break;
+ case WXD_FS_HORIZONTAL_LINES :
+ case WXD_FS_VERTICAL_LINES :
+ case WXD_FS_HORIZONTAL_VERTICAL_SIEVE : {
+ w = h = (int)ceil(patco[4]);
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_LEFT :
+ case WXD_FS_HORIZONTAL_SHINGLES_RIGHT :
+ case WXD_FS_VERTICAL_SHINGLES_1 :
+ case WXD_FS_VERTICAL_SHINGLES_2 : {
+ w = h = (int)ceil(patco[5]);
+ } break;
+ case WXD_FS_LARGE_FISH_SCALES : {
+ w = (int)ceil(patco[6]);
+ h = (int)ceil(patco[7]);
+ } break;
+ case WXD_FS_SMALL_FISH_SCALES : {
+ w = (int)ceil(patco[1]);
+ h = (int)ceil(patco[1]);
+ } break;
+ case WXD_FS_CIRCLES : {
+ w = h = (int)ceil(patco[3]);
+ } break;
+ case WXD_FS_HEXAGONS : {
+ h = (int)ceil(patco[3]);
+ w = (int)ceil(patco[8]);
+ } break;
+ case WXD_FS_OCTAGONS : {
+ w = h = (int)ceil(patco[3]);
+ } break;
+ case WXD_FS_HORIZONTAL_TIRES : {
+ w = (int)ceil(patco[1]);
+ h = (int)ceil(patco[4]);
+ } break;
+ case WXD_FS_VERTICAL_TIRES : {
+ h = (int)ceil(patco[1]);
+ w = (int)ceil(patco[4]);
+ } break;
+ }
+ $? ". w = %d", w
+ $? ". h = %d", h
+ if (NULL != pw) { *pw = w; }
+ if (NULL != ph) { *ph = h; }
+ $? "- calculate_bitmap_dimensions"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+ @param coeff Fixed coefficients.
+*/
+static
+void
+draw_pattern_30_left(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw,
+ double const *coeff
+)
+{
+ double dh;
+ double dw;
+ double d_h;
+ double d_w;
+ $? "+ draw_pattern_30_left"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ d_h = (double)h;
+ d_w = (double)w;
+ dh = (double)lw;
+ dw = coeff[0] * dh;
+ /*
+ Diagonal line
+ */
+ p1.MoveToPoint(0.0, 0.0);
+ p1.AddLineToPoint(d_w, d_h);
+ gc->StrokePath(p1);
+ /*
+ Line at top right corner
+ */
+ p2.MoveToPoint((d_w - dw), (0.0 - dh));
+ p2.AddLineToPoint((d_w + dw), dh);
+ gc->StrokePath(p2);
+ /*
+ Line at bottom left corner
+ */
+ p3.MoveToPoint((0.0 - dw), (d_h - dh));
+ p3.AddLineToPoint(dw, (d_h + dh));
+ gc->StrokePath(p3);
+ $? "- draw_pattern_30_left"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+ @param coeff Fixed coefficients.
+*/
+static
+void
+draw_pattern_30_right(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw,
+ double const *coeff
+)
+{
+ double dh;
+ double dw;
+ double d_h;
+ double d_w;
+ $? "+ draw_pattern_30_right"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ d_h = (double)h;
+ d_w = (double)w;
+ dh = (double)lw;
+ dw = coeff[0] * dh;
+ /*
+ Diagonal line
+ */
+ p1.MoveToPoint(d_w, 0.0);
+ p1.AddLineToPoint(0.0, d_h);
+ gc->StrokePath(p1);
+ /*
+ Line at top left corner
+ */
+ p2.MoveToPoint((0.0 - dw), dh);
+ p2.AddLineToPoint(dw, (0.0 - dh));
+ gc->StrokePath(p2);
+ /*
+ Line at bottom right corner
+ */
+ p3.MoveToPoint((d_w - dw), (d_h + dh));
+ p3.AddLineToPoint((d_w + dw), (d_h - dh));
+ gc->StrokePath(p3);
+ $? "- draw_pattern_30_right"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_45_left(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double d_w;
+ double d_h;
+ $? "+ draw_pattern_45_left"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ /*
+ Diagonal line
+ */
+ p1.MoveToPoint(0.0, 0.0);
+ p1.AddLineToPoint(d_w, d_h);
+ gc->StrokePath(p1);
+ /*
+ Line at top right corner
+ */
+ p2.MoveToPoint((double)(w - 2 * lw), (double)(0 - 2 * lw));
+ p2.AddLineToPoint((double)(w + 2 * lw), (double)(0 + 2 * lw));
+ gc->StrokePath(p2);
+ /*
+ Line at bottom left corner
+ */
+ p3.MoveToPoint((double)(0 - 2 * lw), (double)(h - 2 * lw));
+ p3.AddLineToPoint((double)(0 + 2 * lw), (double)(h + 2 * lw));
+ gc->StrokePath(p3);
+ $? "- draw_pattern_45_left"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_45_right(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double d_w;
+ double d_h;
+ $? "+ draw_pattern_45_right"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ /*
+ Diagonal line
+ */
+ p1.MoveToPoint(d_w, 0.0);
+ p1.AddLineToPoint(0.0, d_h);
+ gc->StrokePath(p1);
+ /*
+ Line at top right corner
+ */
+ p2.MoveToPoint((double)(2 * lw), (double)(0 - 2 * lw));
+ p2.AddLineToPoint((double)(0 - 2 * lw), (double)(2 * lw));
+ gc->StrokePath(p2);
+ /*
+ Line at bottom left corner
+ */
+ p3.MoveToPoint((double)(w + 2 * lw), (double)(h - 2 * lw));
+ p3.AddLineToPoint((double)(w - 2 * lw), (double)(h + 2 * lw));
+ gc->StrokePath(p3);
+ $? "- draw_pattern_45_right"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_horizontal_bricks(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x;
+ double y;
+ double d_w;
+ double d_h;
+ double d_lw;
+ $? "+ draw_pattern_horizontal_bricks"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y = d_h / 4.0;
+ x = d_w / 4.0;
+ p1.MoveToPoint((0.0 - d_lw), y);
+ p1.AddLineToPoint((d_w + d_lw), y);
+ gc->StrokePath(p1);
+ y = (3.0 * d_h) / 4.0;
+ p2.MoveToPoint((0.0 - d_lw), y);
+ p2.AddLineToPoint((d_w + d_lw), y);
+ gc->StrokePath(p2);
+ p3.MoveToPoint(x, y);
+ y = d_h / 4.0;
+ p3.AddLineToPoint(x, y);
+ gc->StrokePath(p3);
+ x = (3.0 * d_w) / 4.0;
+ p4.MoveToPoint(x, y);
+ p4.AddLineToPoint(x, (0.0 - d_lw));
+ gc->StrokePath(p4);
+ y = (3.0 * d_h) / 4.0;
+ p5.MoveToPoint(x, y);
+ p5.AddLineToPoint(x, (d_h + d_lw));
+ gc->StrokePath(p5);
+ $? "- draw_pattern_horizontal_bricks"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_vertical_bricks(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x;
+ double y;
+ double d_w;
+ double d_h;
+ double d_lw;
+ $? "+ draw_pattern_vertical_bricks"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y = d_h / 4.0;
+ x = d_w / 4.0;
+ p1.MoveToPoint(y, (0.0 - d_lw));
+ p1.AddLineToPoint(y, (d_w + d_lw));
+ gc->StrokePath(p1);
+ y = (3.0 * d_h) / 4.0;
+ p2.MoveToPoint(y, (0.0 - d_lw));
+ p2.AddLineToPoint(y, (d_w + d_lw));
+ gc->StrokePath(p2);
+ p3.MoveToPoint(y, x);
+ y = d_h / 4.0;
+ p3.AddLineToPoint(y, x);
+ gc->StrokePath(p3);
+ x = (3.0 * d_w) / 4.0;
+ p4.MoveToPoint(y, x);
+ p4.AddLineToPoint((0.0 - d_lw), x);
+ gc->StrokePath(p4);
+ y = (3.0 * d_h) / 4.0;
+ p5.MoveToPoint(y, x);
+ p5.AddLineToPoint((d_h + d_lw), x);
+ gc->StrokePath(p5);
+ $? "- draw_pattern_vertical_bricks"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_horizontal_lines(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double y;
+ double d_lw;
+ $? "+ draw_pattern_horizontal_lines"
+ wxGraphicsPath p1 = gc->CreatePath();
+ d_lw = (double)lw;
+ y = (double)h / 2.0;
+ p1.MoveToPoint((0.0 - d_lw), y);
+ p1.AddLineToPoint(((double)w + d_lw), y);
+ gc->StrokePath(p1);
+ $? "- draw_pattern_horizontal_lines"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_vertical_lines(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x;
+ double d_lw;
+ $? "+ draw_pattern_vertical_lines"
+ wxGraphicsPath p1 = gc->CreatePath();
+ d_lw = (double)lw;
+ x = (double)w / 2.0;
+ p1.MoveToPoint(x, (0.0 - d_lw));
+ p1.AddLineToPoint(x, ((double)h + d_lw));
+ gc->StrokePath(p1);
+ $? "- draw_pattern_vertical_lines"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_horizontal_shingles_left(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double dx;
+ double y1;
+ double y2;
+ double y3;
+ double y4;
+ double y5;
+ double d_w;
+ double d_h;
+ double d_lw;
+ $? "+ draw_pattern_horizontal_shingles_left"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ wxGraphicsPath p6 = gc->CreatePath();
+ wxGraphicsPath p7 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y1 = 0.0 - (d_h / 6.0);
+ y2 = d_h / 6.0;
+ y3 = d_h / 2.0;
+ y4 = (5.0 * d_h) / 6.0;
+ y5 = (7.0 * d_h) / 6.0;
+ x1 = d_w / 6.0;
+ x2 = d_w / 2.0;
+ x3 = (5.0 * d_w) / 6.0;
+ dx = d_w / 12.0;
+ p1.MoveToPoint((0.0 - d_lw), y2);
+ p1.AddLineToPoint((d_w + d_lw), y2);
+ gc->StrokePath(p1);
+ p2.MoveToPoint((0.0 - d_lw), y3);
+ p2.AddLineToPoint((d_w + d_lw), y3);
+ gc->StrokePath(p2);
+ p3.MoveToPoint((0.0 - d_lw), y4);
+ p3.AddLineToPoint((d_w + d_lw), y4);
+ gc->StrokePath(p3);
+ p4.MoveToPoint((x3 + dx), y1);
+ p4.AddLineToPoint((x3 - dx), y2);
+ gc->StrokePath(p4);
+ p5.MoveToPoint((x1 + dx), y2);
+ p5.AddLineToPoint((x1 - dx), y3);
+ gc->StrokePath(p5);
+ p6.MoveToPoint((x2 + dx), y3);
+ p6.AddLineToPoint((x2 - dx), y4);
+ gc->StrokePath(p6);
+ p7.MoveToPoint((x3 + dx), y4);
+ p7.AddLineToPoint((x3 - dx), y5);
+ gc->StrokePath(p7);
+ $? "- draw_pattern_horizontal_shingles_left"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_horizontal_shingles_right(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double dx;
+ double y1;
+ double y2;
+ double y3;
+ double y4;
+ double y5;
+ double d_h;
+ double d_w;
+ double d_lw;
+ $? "+ draw_pattern_horizontal_shingles_right"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ wxGraphicsPath p6 = gc->CreatePath();
+ wxGraphicsPath p7 = gc->CreatePath();
+ d_h = (double)h;
+ d_w = (double)w;
+ d_lw = (double)lw;
+ y1 = 0.0 - (d_h / 6.0);
+ y2 = d_h / 6.0;
+ y3 = d_h / 2.0;
+ y4 = (5.0 * d_h) / 6.0;
+ y5 = (7.0 * d_h) / 6.0;
+ x1 = d_w / 6.0;
+ x2 = d_w / 2.0;
+ x3 = (5.0 * d_w) / 6.0;
+ dx = d_w / 12.0;
+ p1.MoveToPoint((0.0 - d_lw), y2);
+ p1.AddLineToPoint((d_w + d_lw), y2);
+ gc->StrokePath(p1);
+ p2.MoveToPoint((0.0 - d_lw), y3);
+ p2.AddLineToPoint((d_w + d_lw), y3);
+ gc->StrokePath(p2);
+ p3.MoveToPoint((0.0 - d_lw), y4);
+ p3.AddLineToPoint((d_w + d_lw), y4);
+ gc->StrokePath(p3);
+ p4.MoveToPoint((x3 - dx), y1);
+ p4.AddLineToPoint(x3 + dx, y2);
+ gc->StrokePath(p4);
+ p5.MoveToPoint((x2 - dx), y2);
+ p5.AddLineToPoint((x2 + dx), y3);
+ gc->StrokePath(p5);
+ p6.MoveToPoint((x1 - dx), y3);
+ p6.AddLineToPoint((x1 + dx), y4);
+ gc->StrokePath(p6);
+ p7.MoveToPoint((x3 - dx), y4);
+ p7.AddLineToPoint((x3 + dx), y5);
+ gc->StrokePath(p7);
+ $? "- draw_pattern_horizontal_shingles_right"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_vertical_shingles_1(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double dx;
+ double y1;
+ double y2;
+ double y3;
+ double y4;
+ double y5;
+ double d_w;
+ double d_h;
+ double d_lw;
+ $? "+ draw_pattern_vertical_shingles_1"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ wxGraphicsPath p6 = gc->CreatePath();
+ wxGraphicsPath p7 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y1 = 0.0 - (d_h / 6.0);
+ y2 = d_h / 6.0;
+ y3 = d_h / 2.0;
+ y4 = (5.0 * d_h) / 6.0;
+ y5 = (7.0 * d_h) / 6.0;
+ x1 = d_w / 6.0;
+ x2 = d_w / 2.0;
+ x3 = (5.0 * d_w) / 6.0;
+ dx = d_w / 12.0;
+ p1.MoveToPoint(y2, (0.0 - d_lw));
+ p1.AddLineToPoint(y2, (d_w + d_lw));
+ gc->StrokePath(p1);
+ p2.MoveToPoint(y3, (0.0 - d_lw));
+ p2.AddLineToPoint(y3, (d_w + d_lw));
+ gc->StrokePath(p2);
+ p3.MoveToPoint(y4, (0.0 - d_lw));
+ p3.AddLineToPoint(y4, (d_w + d_lw));
+ gc->StrokePath(p3);
+ p4.MoveToPoint(y1, (x3 - dx));
+ p4.AddLineToPoint(y2, (x3 + dx));
+ gc->StrokePath(p4);
+ p5.MoveToPoint(y2, (x2 - dx));
+ p5.AddLineToPoint(y3, (x2 + dx));
+ gc->StrokePath(p5);
+ p6.MoveToPoint(y3, (x1 - dx));
+ p6.AddLineToPoint(y4, (x1 + dx));
+ gc->StrokePath(p6);
+ p7.MoveToPoint(y4, (x3 - dx));
+ p7.AddLineToPoint(y5, (x3 + dx));
+ gc->StrokePath(p7);
+ $? "- draw_pattern_vertical_shingles_1"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_vertical_shingles_2(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double dx;
+ double y1;
+ double y2;
+ double y3;
+ double y4;
+ double y5;
+ double d_w;
+ double d_h;
+ double d_lw;
+ $? "+ draw_pattern_vertical_shingles_2"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ wxGraphicsPath p6 = gc->CreatePath();
+ wxGraphicsPath p7 = gc->CreatePath();
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ y1 = 0.0 - (d_h / 6.0);
+ y2 = d_h / 6.0;
+ y3 = d_h / 2.0;
+ y4 = (5.0 * d_h) / 6.0;
+ y5 = (7.0 * d_h) / 6.0;
+ x1 = d_w / 6.0;
+ x2 = d_w / 2.0;
+ x3 = (5.0 * d_w) / 6.0;
+ dx = d_w / 12.0;
+ p1.MoveToPoint(y2, (0.0 - d_lw));
+ p1.AddLineToPoint(y2, (d_w + d_lw));
+ gc->StrokePath(p1);
+ p2.MoveToPoint(y3, (0.0 - d_lw));
+ p2.AddLineToPoint(y3, (d_w + d_lw));
+ gc->StrokePath(p2);
+ p3.MoveToPoint(y4, (0.0 - d_lw));
+ p3.AddLineToPoint(y4, (d_w + d_lw));
+ gc->StrokePath(p3);
+ p4.MoveToPoint(y1, (x3 + dx));
+ p4.AddLineToPoint(y2, (x3 - dx));
+ gc->StrokePath(p4);
+ p5.MoveToPoint(y2, (x1 + dx));
+ p5.AddLineToPoint(y3, (x1 - dx));
+ gc->StrokePath(p5);
+ p6.MoveToPoint(y3, (x2 + dx));
+ p6.AddLineToPoint(y4, (x2 - dx));
+ gc->StrokePath(p6);
+ p7.MoveToPoint(y4, (x3 + dx));
+ p7.AddLineToPoint(y5, (x3 - dx));
+ gc->StrokePath(p7);
+ $? "- draw_pattern_vertical_shingles_2"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param patco Coefficients for pattern drawing.
+ @param patci Index of start coefficient in array.
+*/
+static
+void
+draw_pattern_fish_scales(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ double const *patco,
+ size_t patci
+)
+{
+ double x0;
+ double y0;
+ double x1;
+ double y1;
+ double d_w;
+ double d_h;
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ $? "+ draw_pattern_fish_scales"
+ d_w = (double)w;
+ d_h = (double)h;
+ $? ". w = %d", w
+ $? ". h = %d", h
+ x0 = 0.0;
+ y0 = 0.0;
+ x1 = d_w;
+ y1 = 0.0;
+ p1.MoveToPoint(x0, y0);
+ p1.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ gc->StrokePath(p1);
+ x0 = (-1.0 * d_w) / 2.0;
+ y0 = d_h / 2.0;
+ x1 = x0 + d_w;
+ y1 = y0;
+ p2.MoveToPoint(x0, y0);
+ p2.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ x0 += d_w;
+ x1 += d_w;
+ p2.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ gc->StrokePath(p2);
+ x0 = 0.0;
+ y0 = d_h;
+ x1 = d_w;
+ y1 = d_h;
+ p3.MoveToPoint(x0, y0);
+ p3.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ gc->StrokePath(p3);
+ x0 = (-1.0 * d_w) / 2.0;
+ y0 = (-1.0 * d_h) / 2.0;
+ x1 = x0 + d_w;
+ y1 = y0;
+ p4.MoveToPoint(x0, y0);
+ p4.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ x0 += d_w;
+ x1 += d_w;
+ p4.AddCurveToPoint(
+ (x0 + patco[patci]), (y0 + patco[patci + 1]),
+ (x1 - patco[patci + 2]), (y1 - patco[patci + 3]),
+ x1, y1
+ );
+ gc->StrokePath(p4);
+
+ $? "- draw_pattern_fish_scales"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+*/
+static
+void
+draw_pattern_circles(
+ wxGraphicsContext *gc,
+ int w,
+ int h
+)
+{
+ double r;
+ $? "+ draw_pattern_circles"
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ r = (double)w / 2.0;
+ p1.AddCircle(r, r, r);
+ gc->StrokePath(p1);
+ p2.AddCircle((0.0 - r), r, r);
+ gc->StrokePath(p2);
+ p3.AddCircle(r, (0.0 - r), r);
+ gc->StrokePath(p3);
+ p4.AddCircle((w + r), r, r);
+ gc->StrokePath(p4);
+ p5.AddCircle(r, (h + r), r);
+ gc->StrokePath(p5);
+ $? "- draw_pattern_circles"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param coeff Fixed coefficients.
+*/
+static
+void
+draw_pattern_hexagons(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ double const *coeff
+)
+{
+ double x1;
+ double x2;
+ double x3;
+ double b;
+ double d_h;
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ $? "+ draw_pattern_hexagons"
+ d_h = (double)h;
+ b = d_h / 2.0;
+ x1 = b / coeff[0];
+ x2 = b * coeff[0];
+ x3 = (coeff[0] + 1.0 / coeff[0]) * b;
+ p1.MoveToPoint(x1, 0.0);
+ p1.AddLineToPoint(x2, 0.0);
+ p1.AddLineToPoint(x3, (d_h / 2.0));
+ p1.AddLineToPoint(x2, d_h);
+ p1.AddLineToPoint(x1, d_h);
+ p1.AddLineToPoint(0.0, (d_h / 2.0));
+ p1.AddLineToPoint(x1, 0.0);
+ p1.CloseSubpath();
+ gc->StrokePath(p1);
+ p2.MoveToPoint(x3, (d_h / 2.0));
+ p2.AddLineToPoint(w, (d_h / 2.0));
+ gc->StrokePath(p2);
+ $? "- draw_pattern_hexagons"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param lw Line width to draw pattern.
+*/
+static
+void
+draw_pattern_octagons(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int lw
+)
+{
+ double x1;
+ double xc;
+ double yc;
+ double d_w;
+ double d_h;
+ double d_lw;
+ wxGraphicsPath p1 = gc->CreatePath();
+ wxGraphicsPath p2 = gc->CreatePath();
+ wxGraphicsPath p3 = gc->CreatePath();
+ wxGraphicsPath p4 = gc->CreatePath();
+ wxGraphicsPath p5 = gc->CreatePath();
+ $? "+ draw_pattern_octagons"
+ d_w = (double)w;
+ d_h = (double)h;
+ d_lw = (double)lw;
+ /* x1 = d_w * (1.0 - 1.0 / (1.0 + M_SQRT2)); */
+ x1 = (w * M_SQRT2) / (2.0 * (1.0 + M_SQRT2));
+ xc = d_w / 2.0;
+ yc = d_h / 2.0;
+ p1.MoveToPoint((xc - x1), yc);
+ p1.AddLineToPoint(xc, (yc - x1));
+ p1.AddLineToPoint((xc + x1), yc);
+ p1.AddLineToPoint(xc, (yc + x1));
+ p1.AddLineToPoint((xc - x1), yc);
+ p1.CloseSubpath();
+ gc->StrokePath(p1);
+ p2.MoveToPoint((xc - x1), yc);
+ p2.AddLineToPoint((0.0 - d_lw), yc);
+ gc->StrokePath(p2);
+ p3.MoveToPoint(xc, (yc - x1));
+ p3.AddLineToPoint(xc, (0.0 - d_lw));
+ gc->StrokePath(p3);
+ p4.MoveToPoint((xc + x1), yc);
+ p4.AddLineToPoint((d_w + d_lw), yc);
+ gc->StrokePath(p4);
+ p5.MoveToPoint(xc, (yc + x1));
+ p5.AddLineToPoint(xc, (d_h + d_lw));
+ gc->StrokePath(p5);
+ $? "- draw_pattern_octagons"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+*/
+static
+void
+draw_pattern_horizontal_tires(
+ wxGraphicsContext *gc,
+ int w,
+ int h
+)
+{
+ double y;
+ double d_w;
+ double d_h;
+ size_t i;
+ $? "+ draw_pattern_horizontal_tires"
+ d_w = (double)w;
+ d_h = (double)h;
+ y = 0.0;
+ for (i = 0; i < 3; i++) {
+ wxGraphicsPath p1 = gc->CreatePath();
+ p1.MoveToPoint((0.0 - d_w), y);
+ p1.AddLineToPoint((0.0 - d_w / 2.0), (y - d_h));
+ p1.AddLineToPoint(0.0, y);
+ p1.AddLineToPoint(((d_w) / 2.0), (y - d_h));
+ p1.AddLineToPoint(d_w, y);
+ p1.AddLineToPoint((1.5 * d_w), (y - d_h));
+ p1.AddLineToPoint((2.0 * d_w), y);
+ gc->StrokePath(p1);
+ y += h;
+ }
+ $? "- draw_pattern_horizontal_tires"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+*/
+static
+void
+draw_pattern_vertical_tires(
+ wxGraphicsContext *gc,
+ int w,
+ int h
+)
+{
+ double x;
+ double d_w;
+ double d_h;
+ size_t i;
+ $? "+ draw_pattern_vertical_tires"
+ d_w = (double)w;
+ d_h = (double)h;
+ x = 0.0;
+ for (i = 0; i < 3; i++) {
+ wxGraphicsPath p = gc->CreatePath();
+ p.MoveToPoint(x, (0.0 - d_h));
+ p.AddLineToPoint((x - d_w), (0.0 - d_h / 2.0));
+ p.AddLineToPoint(x, 0.0);
+ p.AddLineToPoint((x - d_w), (d_h / 2.0));
+ p.AddLineToPoint(x, h);
+ p.AddLineToPoint((x - d_w), (1.5 * d_h));
+ p.AddLineToPoint(x, (2.0 * d_h));
+ gc->StrokePath(p);
+ x += w;
+ }
+ $? "- draw_pattern_vertical_tires"
+}
+
+
+
+/** Draw the fill pattern into the stipple bitmap.
+ @param gc Graphics context.
+ @param w Image width.
+ @param h Image height.
+ @param pt Pattern type.
+ @param lw Line width to draw pattern.
+ @param patco Pattern coefficients.
+ @param coeff Fixed coefficients.
+*/
+static
+void
+draw_fill_pattern(
+ wxGraphicsContext *gc,
+ int w,
+ int h,
+ int pt,
+ int lw,
+ double const *patco,
+ double const *coeff
+)
+{
+ $? "+ draw_fill_pattern"
+ switch (pt) {
+ case WXD_FS_30_DEGREE_LEFT : {
+ draw_pattern_30_left(gc, w, h, lw, coeff);
+ } break;
+ case WXD_FS_30_DEGREE_RIGHT : {
+ draw_pattern_30_right(gc, w, h, lw, coeff);
+ } break;
+ case WXD_FS_30_DEGREE_SIEVE : {
+ draw_pattern_30_left(gc, w, h, lw, coeff);
+ draw_pattern_30_right(gc, w, h, lw, coeff);
+ } break;
+ case WXD_FS_45_DEGREE_LEFT : {
+ draw_pattern_45_left(gc, w, h, lw);
+ } break;
+ case WXD_FS_45_DEGREE_RIGHT : {
+ draw_pattern_45_right(gc, w, h, lw);
+ } break;
+ case WXD_FS_45_DEGREE_SIEVE : {
+ draw_pattern_45_left(gc, w, h, lw);
+ draw_pattern_45_right(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_BRICKS : {
+ draw_pattern_horizontal_bricks(gc, w, h, lw);
+ } break;
+ case WXD_FS_VERTICAL_BRICKS : {
+ draw_pattern_vertical_bricks(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_LINES : {
+ draw_pattern_horizontal_lines(gc, w, h, lw);
+ } break;
+ case WXD_FS_VERTICAL_LINES : {
+ draw_pattern_vertical_lines(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_VERTICAL_SIEVE : {
+ draw_pattern_horizontal_lines(gc, w, h, lw);
+ draw_pattern_vertical_lines(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_LEFT : {
+ draw_pattern_horizontal_shingles_left(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_RIGHT : {
+ draw_pattern_horizontal_shingles_right(gc, w, h, lw);
+ } break;
+ case WXD_FS_VERTICAL_SHINGLES_1 : {
+ draw_pattern_vertical_shingles_1(gc, w, h, lw);
+ } break;
+ case WXD_FS_VERTICAL_SHINGLES_2 : {
+ draw_pattern_vertical_shingles_2(gc, w, h, lw);
+ } break;
+ case WXD_FS_LARGE_FISH_SCALES : {
+ draw_pattern_fish_scales(gc, w, h, patco, 9);
+ } break;
+ case WXD_FS_SMALL_FISH_SCALES : {
+ draw_pattern_fish_scales(gc, w, h, patco, 13);
+ } break;
+ case WXD_FS_CIRCLES : {
+ draw_pattern_circles(gc, w, h);
+ } break;
+ case WXD_FS_HEXAGONS : {
+ draw_pattern_hexagons(gc, w, h, coeff);
+ } break;
+ case WXD_FS_OCTAGONS : {
+ draw_pattern_octagons(gc, w, h, lw);
+ } break;
+ case WXD_FS_HORIZONTAL_TIRES : {
+ draw_pattern_horizontal_tires(gc, w, h);
+ } break;
+ case WXD_FS_VERTICAL_TIRES : {
+ draw_pattern_vertical_tires(gc, w, h);
+ } break;
+ }
+ $? "- draw_fill_pattern"
+}
+
+
+
+void
+WxdkdrawFrame::UpdateOneStipple(Wxd_stipple_t *psti)
+{
+ int w = 0; /* Bitmap width */
+ int h = 0; /* Bitmap height */
+ int lw = 0; /* Line width to draw fill pattern */
+
+ $? "+ UpdateOneStipple"
+ if (NULL != psti->bm) { $? ". delete existing stipple bitmap"
+ delete(psti->bm);
+ psti->bm = NULL;
+ }
+#if TRACE_DEBUG
+ else { $? "! no existing stipple bitmap"
+ }
+#endif
+ calculate_bitmap_dimensions(&w, &h, (int)(psti->cd[0]), m_dPatterns);
+ lw = (int)dk4ma_rint(
+ (0.45 * drawco->m_dZoom * (drawco->m_ptRes).x) / 72.0
+ );
+ if (0 >= lw) { lw = 1; }
+ $? ". w = %d", w
+ $? ". h = %d", h
+ $? ". lw = %d", lw
+ if ((1 < w) && (1 < h)) { $? ". w h ok"
+ wxImage imag(w, h);
+ wxColour fc(
+ (int)(psti->cd[1]), (int)(psti->cd[2]), (int)(psti->cd[3])
+ );
+ wxColour sc(
+ (int)(psti->cd[4]), (int)(psti->cd[5]), (int)(psti->cd[6])
+ );
+ wxBrush bru(fc);
+ wxPen pen(sc, lw);
+ wxGraphicsContext *gc = wxGraphicsContext::Create(imag);
+ if (NULL != gc) { $? ". gc ok"
+ gc->SetPen(wxNullPen);
+ gc->SetBrush(bru);
+ {
+ wxGraphicsPath p = gc->CreatePath();
+ p.AddRectangle(0.0, 0.0, (double)w, (double)h);
+ gc->FillPath(p);
+ }
+ gc->SetBrush(wxNullBrush);
+ pen.SetCap(wxCAP_ROUND);
+ pen.SetJoin(wxJOIN_ROUND);
+ gc->SetPen(pen);
+ draw_fill_pattern(gc,w,h,psti->cd[0],lw,m_dPatterns,m_dFactors);
+ gc->SetPen(wxNullPen);
+ gc->Flush();
+ delete gc;
+ psti->bm = new wxBitmap(imag);
+ }
+#if TRACE_DEBUG
+ else { $? "! gc"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! w h problem"
+ }
+#endif
+ $? "- UpdateOneStipple"
+}
+
+
+
+void
+WxdkdrawFrame::UpdatePatternCoefficients(void)
+{
+ size_t i;
+ m_dPatterns[0] =
+ (drawco->m_dZoom * drawco->m_ptRes.x) / (10.0 * m_dFactors[0]);
+ m_dPatterns[1] =
+ (drawco->m_dZoom * drawco->m_ptRes.x) / 10.0;
+ m_dPatterns[2] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * M_SQRT2) / 20.0;
+ m_dPatterns[3] =
+ (drawco->m_dZoom * drawco->m_ptRes.x) / 5.0;
+ m_dPatterns[4] =
+ (drawco->m_dZoom * drawco->m_ptRes.x) / 20.0;
+ m_dPatterns[5] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * 0.3);
+ m_dPatterns[6] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * 14.54) / 72.0;
+ m_dPatterns[7] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * 3.7) / 36.0;
+ m_dPatterns[8] =
+ (drawco->m_dZoom * drawco->m_ptRes.x * m_dFactors[0]) / 5.0;
+ /*
+ 9 to 16
+ */
+ for (i = 0; i < 8; i++) {
+ m_dPatterns[9 + i] = drawco->m_dZoom * m_dFactors[1 + i];
+ }
+}
+
+
+
+void
+WxdkdrawFrame::UpdateStipples(void)
+{
+ Wxd_stipple_t *psti;
+
+ $? "+ UpdateStipples"
+ UpdatePatternCoefficients();
+ if (NULL != m_pDrw) {
+ dk4sto_it_reset(m_pDrw->i_stip);
+ do {
+ psti = (Wxd_stipple_t *)dk4sto_it_next(m_pDrw->i_stip);
+ if (NULL != psti) {
+ UpdateOneStipple(psti);
+ }
+ } while (NULL != psti);
+ }
+ $? "- UpdateStipples"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawFrameTools.cpp b/support/dktools/WxdkdrawFrameTools.cpp
new file mode 100644
index 0000000000..32494687b2
--- /dev/null
+++ b/support/dktools/WxdkdrawFrameTools.cpp
@@ -0,0 +1,2775 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawFrameTools.cpt
+*/
+
+/** @file WxdkdrawFrameTools.cpp The WxdkdrawFrameTools module.
+*/
+
+
+#line 9 "WxdkdrawFrameTools.cpt"
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+
+
+#line 22 "WxdkdrawFrameTools.cpt"
+
+
+/* IMPORTANT: Number and order of entries here must match the order in the
+ m_iv member array and the iv_keys array below!
+*/
+/** Default values for the integer array.
+*/
+static const int default_values[] = {
+/* IVI_BORDER_RED */ 236 ,
+/* IVI_BORDER_GREEN */ 236 ,
+/* IVI_BORDER_BLUE */ 255 ,
+/* IVI_BG_RED */ 242 ,
+/* IVI_BG_GREEN */ 242 ,
+/* IVI_BG_BLUE */ 242 ,
+/* IVI_GRID_RED */ 202 ,
+/* IVI_GRID_GREEN */ 202 ,
+/* IVI_GRID_BLUE */ 230 ,
+/* IVI_PH_RED */ 255 ,
+/* IVI_PH_GREEN */ 214 ,
+/* IVI_PH_BLUE */ 0 ,
+/* IVI_M_COPY_RED */ 0 ,
+/* IVI_M_COPY_GREEN */ 143 ,
+/* IVI_M_COPY_BLUE */ 0 ,
+/* IVI_M_MOVE_RED */ 0 ,
+/* IVI_M_MOVE_GREEN */ 0 ,
+/* IVI_M_MOVE_BLUE */ 204 ,
+/* IVI_M_DEL_RED */ 204 ,
+/* IVI_M_DEL_GREEN */ 0 ,
+/* IVI_M_DEL_BLUE */ 0 ,
+/* IVI_M_GROUP_RED */ 0 ,
+/* IVI_M_GROUP_GREEN */ 0 ,
+/* IVI_M_GROUP_BLUE */ 0 ,
+/* IVI_MISSIMG_RED */ 204 ,
+/* IVI_MISSIMG_GREEN */ 0 ,
+/* IVI_MISSIMG_BLUE */ 0 ,
+/* IVI_XS_SUBSEGS */ 4 ,
+/* IVI_FONT_EXACT */ 0 ,
+/* IVI_DOT_DIAMETER_FILLED */ 8 ,
+/* IVI_DOT_DIAMETER_WHITE */ 10 ,
+/* IVI_ARROWHEAD_LENGTH */ 16 ,
+/* IVI_ARROWHEAD_WIDTH */ 8 ,
+/* IVI_STYLE_VALUE */ 4 ,
+/* IVI_MITER_LIMIT */ 8 ,
+/* IVI_REDUCE_MARKUP_POINTS */ 1 ,
+/* IVI_D_LAYER */ 0 ,
+/* IVI_D_LINE_COL_RED */ 0 ,
+/* IVI_D_LINE_COL_GREEN */ 0 ,
+/* IVI_D_LINE_COL_BLUE */ 0 ,
+/* IVI_D_LINEWIDTH */ 2 ,
+/* IVI_D_LINESTYLE */ WXD_LS_SOLID ,
+/* IVI_D_STYLE_VALUE */ 4 ,
+/* IVI_D_JOIN_STYLE */ WXD_LJ_MITERED ,
+/* IVI_D_MITER_LIMIT */ 8 ,
+/* IVI_D_CAP_STYLE */ WXD_LC_BUTTED ,
+/* IVI_D_AHF_TYPE */ 0 ,
+/* IVI_D_AHF_LENGTH */ 16 ,
+/* IVI_D_AHF_WIDTH */ 8 ,
+/* IVI_D_AHB_TYPE */ 0 ,
+/* IVI_D_AHB_LENGTH */ 16 ,
+/* IVI_D_AHB_WIDTH */ 8 ,
+/* IVI_D_FILL_COL_RED */ 255 ,
+/* IVI_D_FILL_COL_GREEN */ 255 ,
+/* IVI_D_FILL_COL_BLUE */ 255 ,
+/* IVI_D_FILL_STYLE */ WXD_FS_NONE ,
+/* IVI_D_TEXT_LATEX */ 1 ,
+/* IVI_D_TEXT_ALIGN */ WXD_TEXT_ALIGN_LEFT ,
+/* IVI_D_TEXT_FONT */ 0 ,
+/* IVI_D_TEXT_SIZE */ 12 ,
+/* IVI_C_GRID */ 1 ,
+/* IVI_C_PH */ 0 ,
+/* IVI_C_COR_POSITION */ 1 ,
+};
+/* IMPORTANT: Number and order of entries here must match the order in the
+ m_iv member array and the iv_keys array below!
+*/
+
+
+
+/* IMPORTANT: Number and order of entries here must match the
+ order in the default_values and m_iv arrays!
+*/
+/** Keys to save and restore the int values.
+*/
+static const wxChar * const iv_keys[] = {
+/* 0 */
+wxT("colour.border.red"),
+
+/* 1 */
+wxT("colour.border.green"),
+
+/* 2 */
+wxT("colour.border.blue"),
+
+/* 3 */
+wxT("colour.background.red"),
+
+/* 4 */
+wxT("colour.background.blue"),
+
+/* 5 */
+wxT("colour.background.green"),
+
+/* 6 */
+wxT("colour.grid.red"),
+
+/* 7 */
+wxT("colour.grid.green"),
+
+/* 8 */
+wxT("colour.grid.blue"),
+
+/* 9 */
+wxT("colour.placement-help.red"),
+
+/* 10 */
+wxT("colour.placement-help.green"),
+
+/* 11 */
+wxT("colour.placement-help.blue"),
+
+/* 12 */
+wxT("colour.modify.copy.red"),
+
+/* 13 */
+wxT("colour.modify.copy.green"),
+
+/* 14 */
+wxT("colour.modify.copy.blue"),
+
+/* 15 */
+wxT("colour.modify.move.red"),
+
+/* 16 */
+wxT("colour.modify.move.green"),
+
+/* 17 */
+wxT("colour.modify.move.blue"),
+
+/* 18 */
+wxT("colour.modify.delete.red"),
+
+/* 19 */
+wxT("colour.modify.delete.green"),
+
+/* 20 */
+wxT("colour.modify.delete.blue"),
+
+/* 21 */
+wxT("colour.modify.group.red"),
+
+/* 22 */
+wxT("colour.modify.group.green"),
+
+/* 23 */
+wxT("colour.modify.group.blue"),
+
+/* 24 */
+wxT("colour.markup.missing-image.red"),
+
+/* 25 */
+wxT("colour.markup.missing-image.green"),
+
+/* 26 */
+wxT("colour.markup.missing-image.blue"),
+
+/* 27 */
+wxT("config.x-spline.sub-segments"),
+
+/* 28 */
+wxT("config.text.font.exact"),
+
+/* 29 */
+wxT("config.dot.filled.diameter"),
+
+/* 30 */
+wxT("config.dot.white.diameter"),
+
+/* 31 */
+wxT("config.arrowhead.length"),
+
+/* 32 */
+wxT("config.arrowhead.width"),
+
+/* 33 */
+wxT("config.line.dash.length"),
+
+/* 34 */
+wxT("config.join.miter-limit"),
+
+/* 35 */
+wxT("config.markup-point.reduce-size"),
+
+/* 36 */
+wxT("default.layer"),
+
+/* 37 */
+wxT("default.colour.stroke.red"),
+
+/* 38 */
+wxT("default.colour.stroke.green"),
+
+/* 39 */
+wxT("default.colour.stroke.blue"),
+
+/* 40 */
+wxT("default.line.width"),
+
+/* 41 */
+wxT("default.line.style"),
+
+/* 42 */
+wxT("default.line.dash.length"),
+
+/* 43 */
+wxT("default.join.style"),
+
+/* 44 */
+wxT("default.join.miter-limit"),
+
+/* 45 */
+wxT("default.cap.style"),
+
+/* 46 */
+wxT("default.arrowhead.forward.type"),
+
+/* 47 */
+wxT("default.arrowhead.forward.length"),
+
+/* 48 */
+wxT("default.arrowhead.forward.width"),
+
+/* 49 */
+wxT("default.arrowhead.backward.type"),
+
+/* 50 */
+wxT("default.arrowhead.backward.length"),
+
+/* 51 */
+wxT("default.arrowhead.backward.width"),
+
+/* 52 */
+wxT("default.colour.fill.red"),
+
+/* 53 */
+wxT("default.colour.fill.green"),
+
+/* 54 */
+wxT("default.colour.fill.blue"),
+
+/* 55 */
+wxT("default.fill.style"),
+
+/* 56 */
+wxT("default.text.latex"),
+
+/* 57 */
+wxT("default.text.align"),
+
+/* 58 */
+wxT("default.text.font"),
+
+/* 59 */
+wxT("default.text.size"),
+
+/* 60 */
+wxT("config.grid.enable"),
+
+/* 61 */
+wxT("config.placement-help.enable"),
+
+/* 62 */
+wxT("config.zoom-out.correct-position"),
+
+NULL
+
+
+#line 258 "WxdkdrawFrameTools.cpt"
+};
+/* IMPORTANT: Number and order of entries here must match the
+ order in the default_values and m_iv arrays!
+*/
+
+
+
+/** Correct given int value v to a range specified by minimum and maximum.
+ @param min Range minimum.
+ @param max Range maximum.
+ @param v Value to correct if necessary.
+ @return Corrected value.
+*/
+static
+int
+i_to_range(int min, int max, int v)
+{
+ if (min > v) { v = min; }
+ if (max < v) { v = max; }
+ return v;
+}
+
+
+
+/** Correct given int value v to an unsigned range specified by minimum
+ and maximum.
+ @param min Range minimum.
+ @param max Range maximum.
+ @param v Value to correct if necessary.
+ @return Corrected value.
+*/
+static
+unsigned
+u_to_range(unsigned min, unsigned max, int v)
+{
+ unsigned back;
+
+ if (0 <= v) {
+ back = (unsigned)v;
+ }
+ else {
+ back = 0U;
+ }
+ if (min > back) { back = min; }
+ if (max < back) { back = max; }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::DefaultStyleToArray(void)
+{
+
+
+#line 312 "WxdkdrawFrameTools.cpt"
+ m_iv[IVI_D_LAYER] = m_oStyle.lay;
+ m_iv[IVI_D_LINE_COL_RED] = m_oStyle.sc[0] ;
+ m_iv[IVI_D_LINE_COL_GREEN] = m_oStyle.sc[1] ;
+ m_iv[IVI_D_LINE_COL_BLUE] = m_oStyle.sc[2] ;
+ m_iv[IVI_D_LINEWIDTH] = m_oStyle.lw ;
+ m_iv[IVI_D_LINESTYLE] = m_oStyle.ls ;
+ m_iv[IVI_D_STYLE_VALUE] = m_oStyle.sl ;
+ m_iv[IVI_D_JOIN_STYLE] = m_oStyle.js ;
+ m_iv[IVI_D_MITER_LIMIT] = m_oStyle.ml ;
+ m_iv[IVI_D_CAP_STYLE] = m_oStyle.cs ;
+ m_iv[IVI_D_AHF_TYPE] = m_oStyle.aft ;
+ m_iv[IVI_D_AHF_LENGTH] = m_oStyle.afl ;
+ m_iv[IVI_D_AHF_WIDTH] = m_oStyle.afw ;
+ m_iv[IVI_D_AHB_TYPE] = m_oStyle.abt ;
+ m_iv[IVI_D_AHB_LENGTH] = m_oStyle.abl ;
+ m_iv[IVI_D_AHB_WIDTH] = m_oStyle.abw ;
+ m_iv[IVI_D_FILL_COL_RED] = m_oStyle.fc[0] ;
+ m_iv[IVI_D_FILL_COL_GREEN] = m_oStyle.fc[1] ;
+ m_iv[IVI_D_FILL_COL_BLUE] = m_oStyle.fc[2] ;
+ m_iv[IVI_D_FILL_STYLE] = m_oStyle.fs ;
+ m_iv[IVI_D_TEXT_LATEX] = m_oStyle.det.t.fl ;
+ m_iv[IVI_D_TEXT_ALIGN] = m_oStyle.det.t.al ;
+ m_iv[IVI_D_TEXT_FONT] = m_oStyle.det.t.find ;
+ m_iv[IVI_D_TEXT_SIZE] = m_oStyle.det.t.fsz ;
+
+
+#line 337 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::DefaultStyleFromArray(void)
+{
+
+
+#line 345 "WxdkdrawFrameTools.cpt"
+ m_oStyle.lay = (int16_t)i_to_range(
+ DK4_I16_MIN, DK4_I16_MAX, m_iv[IVI_D_LAYER]
+ );
+ m_oStyle.sc[0] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_LINE_COL_RED]
+ );
+ m_oStyle.sc[1] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_LINE_COL_GREEN]
+ );
+ m_oStyle.sc[2] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_LINE_COL_BLUE]
+ );
+ m_oStyle.lw = (uint16_t)u_to_range(
+ 0U, DK4_U16_MAX, m_iv[IVI_D_LINEWIDTH]
+ );
+ m_oStyle.ls = (uint8_t)u_to_range(
+ WXD_LS_SOLID, WXD_LS_DASH_DOT_DOT_DOT, m_iv[IVI_D_LINESTYLE]
+ );
+ m_oStyle.sl = (uint8_t)u_to_range(
+ 1U, 255U, m_iv[IVI_D_STYLE_VALUE]
+ );
+ m_oStyle.js = (uint8_t)u_to_range(
+ WXD_LJ_MITERED, WXD_LJ_BEVELED, m_iv[IVI_D_JOIN_STYLE]
+ );
+ m_oStyle.ml = (uint8_t)u_to_range(
+ 1U, 255U, m_iv[IVI_D_MITER_LIMIT]
+ );
+ m_oStyle.cs = (uint8_t)u_to_range(
+ WXD_LC_BUTTED, WXD_LC_PROJECTING, m_iv[IVI_D_CAP_STYLE]
+ );
+ m_oStyle.aft = (uint8_t)u_to_range(
+ 0U, 29U, m_iv[IVI_D_AHF_TYPE]
+ );
+ m_oStyle.afl = (uint8_t)u_to_range(
+ 2U, 255U, m_iv[IVI_D_AHF_LENGTH]
+ );
+ m_oStyle.afw = (uint8_t)u_to_range(
+ 2U, 255U, m_iv[IVI_D_AHF_WIDTH]
+ );
+ m_oStyle.abt = (uint8_t)u_to_range(
+ 0U, 29U, m_iv[IVI_D_AHB_TYPE]
+ );
+ m_oStyle.abl = (uint8_t)u_to_range(
+ 2U, 255U, m_iv[IVI_D_AHB_LENGTH]
+ );
+ m_oStyle.abw = (uint8_t)u_to_range(
+ 2U, 255U, m_iv[IVI_D_AHB_WIDTH]
+ );
+ m_oStyle.fc[0] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_FILL_COL_RED]
+ );
+ m_oStyle.fc[1] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_FILL_COL_GREEN]
+ );
+ m_oStyle.fc[2] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_FILL_COL_BLUE]
+ );
+ m_oStyle.fs = (uint8_t)u_to_range(
+ WXD_FS_NONE, WXD_FS_VERTICAL_TIRES, m_iv[IVI_D_FILL_STYLE]
+ );
+ m_oStyle.det.t.fl = (uint8_t)u_to_range(
+ 0U, 1U, m_iv[IVI_D_TEXT_LATEX]
+ );
+ m_oStyle.det.t.al = (uint8_t)u_to_range(
+ WXD_TA_LEFT, WXD_TA_RIGHT, m_iv[IVI_D_TEXT_ALIGN]
+ );
+ m_oStyle.det.t.find = (uint8_t)u_to_range(
+ 0U, 34U, m_iv[IVI_D_TEXT_FONT]
+ );
+ m_oStyle.det.t.fsz = (uint16_t)u_to_range(
+ 1U, DK4_U16_MAX, m_iv[IVI_D_TEXT_SIZE]
+ );
+
+
+#line 418 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::LoadDefaults(void)
+{
+ DK4_MEMCPY(m_iv,default_values,((size_t)(IVI_MAX)*sizeof(int)));
+}
+
+
+
+void
+WxdkdrawFrame::LoadConfiguration(void)
+{
+ LoadDefaults();
+ DefaultStyleToArray();
+ pAppHelp->GetMultiple(iv_keys ,m_iv, IVI_MAX);
+ DefaultStyleFromArray();
+ cbGridOnOff->SetValue((0 != m_iv[IVI_C_GRID]));
+ cbPH->SetValue((0 != m_iv[IVI_C_PH]));
+}
+
+
+
+void
+WxdkdrawFrame::SaveConfiguration(void)
+{
+ DefaultStyleToArray();
+ m_iv[IVI_C_GRID] = ((cbGridOnOff->GetValue()) ? 1 : 0);
+ m_iv[IVI_C_PH] = ((cbPH->GetValue()) ? 1 : 0);
+ pAppHelp->SetMultiple(iv_keys ,m_iv, IVI_MAX);
+}
+
+
+
+void
+WxdkdrawFrame::ResetConfiguration(void)
+{
+ LoadDefaults();
+ wxdobj_obj_init(&m_oStyle, WXD_OT_TEXT, NULL);
+}
+
+
+
+void
+WxdkdrawFrame::ColorModify(size_t ivi, int rdl)
+{
+ wxColour curcol(m_iv[ivi], m_iv[ivi + 1], m_iv[ivi + 2]);
+ wxColourData wxcd;
+
+
+#line 469 "WxdkdrawFrameTools.cpt"
+ wxcd.SetColour(curcol);
+ wxColourDialog dlg(this, &wxcd);
+
+ if (wxID_OK == dlg.ShowModal()) {
+ wxColour col = dlg.GetColourData().GetColour();
+ m_iv[ivi ] = col.Red();
+ m_iv[ivi + 1] = col.Green();
+ m_iv[ivi + 2] = col.Blue();
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ }
+
+
+#line 480 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ColorReset(size_t ivi, int rdl)
+{
+
+
+#line 488 "WxdkdrawFrameTools.cpt"
+ DK4_MEMCPY(&(m_iv[ivi]),&(default_values[ivi]),(3*sizeof(int)));
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+
+
+#line 491 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+bool
+WxdkdrawFrame::FindDirectoryForFile(wxChar *dnb, size_t dnsz, wxString & fn)
+{
+ wxChar const *fnstr = NULL;
+ wxChar const *cwdstr = NULL;
+ wxChar *ptr = NULL;
+ size_t lgt = (size_t)0U;
+ bool back = false;
+
+
+#line 504 "WxdkdrawFrameTools.cpt"
+ if ((NULL != dnb) && ((size_t)0U < dnsz)) {
+ dnb[0] = wxT('\0');
+ wxCStrData strd = fn.c_str();
+ fnstr = (wxChar const *)strd;
+ if (NULL != fnstr) {
+ lgt = dk4strx_len(fnstr);
+ if ((size_t)0U < lgt) {
+ if (lgt < dnsz) {
+ dk4strx_cpy_s(dnb, dnsz, fnstr, NULL);
+#if DK4_HAVE_BACKSLASH_AS_SEP
+ ptr = dk4strx_rchr(dnb, wxT('\\'));
+#else
+ ptr = dk4strx_rchr(dnb, wxT('/'));
+#endif
+ if (NULL != ptr) {
+ *ptr = wxT('\0');
+ back = true;
+
+
+#line 522 "WxdkdrawFrameTools.cpt"
+ }
+ else {
+
+#line 524 "WxdkdrawFrameTools.cpt"
+ wxString cwd = ::wxGetCwd();
+ {
+ wxCStrData strwcd = cwd.c_str();
+ {
+ cwdstr = (wxChar const *)strwcd;
+ if (NULL != cwdstr) {
+ lgt = dk4strx_len(cwdstr);
+ if ((size_t)0U < lgt) {
+ if (lgt < dnsz) {
+ dk4strx_cpy_s(dnb,dnsz,cwdstr,NULL);
+ back = true;
+
+
+#line 536 "WxdkdrawFrameTools.cpt"
+ }
+ else {
+
+#line 538 "WxdkdrawFrameTools.cpt"
+ /* ERROR: CWD too long */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport,
+ WXD_E_CWD_TOO_LONG
+ );
+ }
+ }
+ else {
+
+#line 546 "WxdkdrawFrameTools.cpt"
+ /* ERROR: No current dir */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport,
+ WXD_E_NO_CWD
+ );
+ }
+ }
+ else {
+
+#line 554 "WxdkdrawFrameTools.cpt"
+ /* ERROR: No current dir */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_NO_CWD
+ );
+ }
+ }
+ }
+ }
+ }
+ else {
+
+#line 564 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Output file name too long */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OUTPUT_FN_TOO_LONG
+ );
+ }
+ }
+ else {
+
+#line 571 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to find directory for file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OUTPUT_DIRNAME
+ );
+ }
+ }
+ else {
+
+#line 578 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to find directory for file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OUTPUT_DIRNAME
+ );
+ }
+ }
+ else {
+
+#line 585 "WxdkdrawFrameTools.cpt"
+ }
+
+#line 586 "WxdkdrawFrameTools.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::SaveToFile(void)
+{
+ wxChar fnbuf[DK4_MAX_PATH]; /* File name current dir */
+ wxdwr_status_t wrst; /* Writer status */
+ wxString sNewTitle = wxEmptyString; /* New program window title */
+ wxString sDlgTitle(sTexts[171]); /* Dialog title */
+ wxString sDlgTypes(sTexts[172]); /* File type suffixes */
+ FILE *fipo; /* File for output */
+ int res; /* Save operation result */
+ bool cc = true; /* Flag: Can continue */
+ bool back = false;
+
+
+#line 604 "WxdkdrawFrameTools.cpt"
+ if (!(m_bHaveName)) {
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDlgTitle, m_sFileDir, m_sFileShort,
+ sDlgTypes, (wxFD_SAVE | wxFD_OVERWRITE_PROMPT)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDlgTitle, m_sFileDir, m_sFileShort,
+ sDlgTypes, wxSAVE
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ m_sFileFull = dlg.GetPath();
+ m_sFileDir = dlg.GetDirectory();
+ m_sFileShort = dlg.GetFilename();
+ m_bHaveName = true;
+ if (m_bModified) {
+ sNewTitle.Append(sTexts[170]);
+ sNewTitle.Append(m_sFileShort);
+ SetTitle(sNewTitle);
+ }
+ else {
+ SetTitle(m_sFileShort);
+ }
+ m_bUpdate = true;
+ }
+ else {
+ cc = false;
+ }
+ }
+ if (m_bHaveName && cc) {
+ cc = FindDirectoryForFile(fnbuf, DK4_SIZEOF(fnbuf,wxChar), m_sFileFull);
+ if (!(cc)) {
+ /* ##### ERROR: Failed to find directory */
+ }
+ }
+ if (m_bHaveName && cc) {
+
+#line 642 "WxdkdrawFrameTools.cpt"
+ wxFFile wxff(m_sFileFull, wxT("w"));
+ if (wxff.IsOpened()) {
+
+#line 644 "WxdkdrawFrameTools.cpt"
+ fipo = wxff.Detach();
+ if (NULL != fipo) {
+
+#line 646 "WxdkdrawFrameTools.cpt"
+ back = true;
+ wxdwr_status_init(&wrst, pAppHelp->GetWxEncoding());
+ wrst.dirn = fnbuf;
+ res = wxdwr_write_file(fipo, m_pDrw, &wrst);
+ wrst.dirn = NULL;
+ if (0 == res) {
+
+#line 652 "WxdkdrawFrameTools.cpt"
+ back = false;
+ switch (wrst.ec) {
+ case WXDWR_E_WRITE : {
+
+#line 655 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Write operation failed */
+ wxMessageBox(
+ sTexts[204], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ } break;
+ case WXDWR_E_STRING_TOO_LONG : {
+
+#line 662 "WxdkdrawFrameTools.cpt"
+ /* ERROR: String too long */
+ if (NULL != wrst.str) {
+ wxString msg = wxString(sTexts[205]);
+ msg.Append(wxString(wrst.str));
+ msg.Append(wxString(sTexts[206]));
+ wxMessageBox(
+ msg, sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ else {
+ wxMessageBox(
+ sTexts[207], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ } break;
+ case WXDWR_E_RECODE_TEXT : {
+
+#line 680 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to recode text */
+ if (NULL != wrst.str) {
+ wxString msg = wxString(sTexts[208]);
+ msg.Append(wxString(wrst.str));
+ msg.Append(wxString(sTexts[209]));
+ wxMessageBox(
+ msg, sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ else {
+ wxMessageBox(
+ sTexts[210], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+
+ } break;
+ case WXDWR_E_RECODE_FILENAME : {
+
+#line 699 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to recode file name */
+ if (NULL != wrst.str) {
+ wxString msg = wxString(sTexts[211]);
+ msg.Append(wxString(wrst.str));
+ msg.Append(wxString(sTexts[212]));
+ wxMessageBox(
+ msg, sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ else {
+ wxMessageBox(
+ sTexts[213], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ } break;
+ case WXDWR_E_STRING_EMPTY : {
+
+#line 717 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Empty string not expected */
+ wxMessageBox(
+ sTexts[214], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ } break;
+ default : {
+
+#line 724 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Unknown reason */
+ wxMessageBox(
+ sTexts[215], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ } break;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 734 "WxdkdrawFrameTools.cpt"
+ }
+#endif
+ if (0 != fclose(fipo)) {
+
+#line 737 "WxdkdrawFrameTools.cpt"
+ if (back) {
+ /* ERROR: Failed to write to file */
+ wxMessageBox(
+ sTexts[204], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ back = false;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 748 "WxdkdrawFrameTools.cpt"
+ }
+#endif
+ }
+ else {
+
+#line 752 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to open file */
+ wxMessageBox(
+ sTexts[203], sTexts[202], (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ else {
+
+#line 759 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to open file */
+ wxMessageBox(
+ sTexts[203], sTexts[202], (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ if (back) {
+ SetTitle(m_sFileShort);
+ SetModified(false);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 771 "WxdkdrawFrameTools.cpt"
+ }
+#endif
+
+
+#line 774 "WxdkdrawFrameTools.cpt"
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::SetModified(bool f)
+{
+
+
+#line 783 "WxdkdrawFrameTools.cpt"
+if (f != m_bModified) {
+ if (f) {
+ wxString s = wxEmptyString;
+ s.Append(sTexts[170]);
+ if (m_bHaveName) {
+ s.Append(m_sFileShort);
+ }
+ else {
+ s.Append(sTexts[18]);
+ }
+ SetTitle(s);
+ }
+ else {
+ if (m_bHaveName) {
+ SetTitle(m_sFileShort);
+ }
+ else {
+ SetTitle(sTexts[18]);
+ }
+ }
+ m_bModified = f;
+ m_bUpdate = true;
+}
+
+
+#line 807 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+
+wxSize
+WxdkdrawFrame::ColourViewSize(void)
+{
+int sl = 20;
+if (NULL != bFileOpen) {
+ sl = (bFileOpen->GetClientSize()).GetHeight();
+}
+
+
+#line 820 "WxdkdrawFrameTools.cpt"
+return(wxSize(sl,sl));
+}
+
+
+
+Wxd_drawing_t *
+WxdkdrawFrame::ReadDrawingFromFile(wxString & fn)
+{
+ wxChar dirnb[DK4_MAX_PATH];
+ Wxd_drawing_t *back = NULL; /* Function result */
+ FILE *fp = NULL; /* File to read from */
+ bool haved = false; /* Have directory name */
+
+
+#line 833 "WxdkdrawFrameTools.cpt"
+ wxFFile wxff(fn);
+ haved = FindDirectoryForFile(dirnb, DK4_SIZEOF(dirnb,wxChar), fn);
+ if (wxff.IsOpened()) {
+ fp = wxff.Detach();
+ if (NULL != fp) {
+
+
+#line 839 "WxdkdrawFrameTools.cpt"
+ wxdrd_status_init(&m_oStatusReader);
+ if (haved) {
+ m_oStatusReader.dirn = dirnb;
+ }
+ else {
+ m_oStatusReader.dirn = NULL;
+ }
+ back = wxdrd_read_file(fp, &m_oStatusReader);
+ m_oStatusReader.dirn = NULL;
+ fclose(fp);
+ if (NULL != back) {
+ wxdobj_drw_set_xsubs(back, (size_t)(m_iv[IVI_XS_SUBSEGS]));
+ wxdobj_bb_for_drawing(back);
+ }
+ else {
+ /* ERROR: Failed to read file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_READ_FILE
+ );
+ }
+ }
+ else {
+
+#line 861 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to open file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ }
+ }
+ else {
+
+#line 868 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to open file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ }
+
+
+#line 874 "WxdkdrawFrameTools.cpt"
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::UpdateImages(void)
+{
+ Wxd_object_t *pobj;
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (NULL != pobj) {
+ if (WXD_OT_IMAGE == pobj->ot) {
+ if (NULL != (pobj->det).i.fn) {
+ if (NULL == (pobj->det).i.bm) {
+ wxdobj_load_image(
+ pobj,
+ pAppHelp->GetDkEncoding(),
+ pAppHelp->GetWxEncoding()
+ );
+ }
+ }
+ }
+ }
+ } while (NULL != pobj);
+}
+
+
+
+void
+WxdkdrawFrame::DrawingLoaded(void)
+{
+ /* No operation started on new drawing yet
+ */
+ m_iState = S_NOOP;
+ m_iWheelControl = 0;
+ m_iWheelShift = 0;
+ m_iWheelNormal = 0;
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ /* Zoom factor and grid distances
+ */
+ drawco->CalculateZoomFactor();
+ {
+ wxString s;
+ s.Printf("%g", drawco->m_dZoom);
+ lZoomPercent->SetLabel(s);
+ lZoomPercent->Refresh();
+ m_bUpdate = true;
+ }
+ /* Update coefficients for fill patterns
+ */
+ UpdateStipples();
+ UpdateFonts();
+ szTopBar->Layout();
+ lZoomPercent->Refresh();
+ UpdateImages();
+ /* Coordinates conversion coefficients
+ */
+ drawco->CalculateConversionCoefficients();
+
+ /* Grid setup to GUI
+ */
+ if (NULL != m_pDrw) {
+ if ((uint8_t)0U != m_pDrw->gridunit) {
+ cbGridUnit->SetSelection(1);
+ }
+ else {
+ cbGridUnit->SetSelection(0);
+ }
+ if ((uint8_t)0U != m_pDrw->gridbase) {
+ cbGridBase->SetSelection(1);
+ }
+ else {
+ cbGridBase->SetSelection(0);
+ }
+ cbGridUnit->Refresh();
+ cbGridBase->Refresh();
+ m_bUpdate = true;
+ }
+
+ /* Calculate grid
+ */
+ drawco->CalculateGridDistances();
+
+ /* Required width and height
+ */
+
+ /* Scrollbar positions
+ */
+ AdjustScrollbars();
+
+ /* GUI attributes object
+ */
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ m_iWheelControl = 0;
+ m_iWheelShift = 0;
+ m_iWheelNormal = 0;
+ m_uCurrent = 0;
+ m_iObjToCreate = -1;
+ m_bSplineInterpolated = false;
+ m_bModified = false;
+ m_bMouseDiff = false;
+
+#line 980 "WxdkdrawFrameTools.cpt"
+
+ drawco->Refresh();
+ m_bUpdate = true;
+}
+
+
+
+void
+WxdkdrawFrame::ModificationReportingAtEventEnd(void)
+{
+ if (DK4_E_NONE == m_oErrorReport.ec) {
+ if (0 != m_oStatusReader.mod) {
+ SetModified();
+ wxMessageBox(
+ sTexts[600], sTexts[599],
+ (wxOK | wxCENTRE | wxICON_INFORMATION)
+ );
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnFirstIdle(void)
+{
+ Wxd_drawing_t *pDrw;
+
+
+#line 1008 "WxdkdrawFrameTools.cpt"
+
+
+#line 1009 "WxdkdrawFrameTools.cpt"
+ wxdrd_status_init(&m_oStatusReader);
+ dk4error_init(&m_oErrorReport);
+ m_pDrw = wxdobj_drw_new();
+ if (m_bHaveName) {
+ wxFileName wxfn(m_sFileFull);
+ SetTitle(m_sFileShort);
+ if (wxfn.IsFileReadable()) {
+ pDrw = ReadDrawingFromFile(m_sFileFull);
+ if (NULL != pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ m_pDrw = pDrw;
+ m_bHaveName = true;
+ m_bUpdate = true;
+ }
+ else {
+
+#line 1024 "WxdkdrawFrameTools.cpt"
+ /* ERROR: Failed to read file, already reported */
+ }
+ }
+ else {
+
+#line 1028 "WxdkdrawFrameTools.cpt"
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1035 "WxdkdrawFrameTools.cpt"
+ }
+#endif
+ /* If drawing was read, set frame as active (ready for events).
+ Otherwise show error message and exit application.
+ */
+ if (NULL != m_pDrw) {
+ m_bActive = true;
+ DrawingLoaded();
+ szTopBar->Layout();
+ SetStatusText(sTexts[531]);
+ Refresh();
+ Update();
+ }
+ else {
+ Close();
+ }
+ ModificationReportingAtEventEnd();
+ ErrorReportingAtEventEnd();
+ dk4error_init(&m_oErrorReport);
+
+
+#line 1055 "WxdkdrawFrameTools.cpt"
+ wxdrd_status_init(&m_oStatusReader);
+
+
+#line 1057 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+static
+int32_t i32_avg(int32_t a, int32_t b, dk4_er_t *erp)
+{
+ dk4_er_t er;
+ int32_t back = (int32_t)0L;
+
+ dk4error_init(&er);
+ back = dk4ma_int32_t_add(a, b, &er) / ((int32_t)2L);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_init(&er);
+ back = dk4ma_int32_t_add(
+ a,
+ (dk4ma_int32_t_sub(b, a, &er) / ((int32_t)2L)),
+ &er
+ );
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::CorrectCenterPointIfNecessary(void)
+{
+ dk4_er_t er;
+ int32_t xcmin; /* Minimum value for center x position */
+ int32_t xcmax; /* Maximum value for center x position */
+ int32_t ycmin; /* Minimum value for center y position */
+ int32_t ycmax; /* Maximum value for center y position */
+ int32_t deltax; /* X difference border to center */
+ int32_t deltay; /* Y difference border to center */
+
+
+#line 1096 "WxdkdrawFrameTools.cpt"
+ dk4error_init(&er);
+ deltax = dk4ma_int32_from_double(
+ (
+ (16256000.0 * (double)((drawco->m_szDrawco).GetWidth()))
+ / (2.0 * drawco->m_dZoom * (drawco->m_ptRes).x)
+ ), &er
+ );
+ deltay = dk4ma_int32_from_double(
+ (
+ (16256000.0 * (double)((drawco->m_szDrawco).GetHeight()))
+ / (2.0 * drawco->m_dZoom * (drawco->m_ptRes).y)
+ ), &er
+ );
+ xcmin = dk4ma_int32_t_add(
+ dk4ma_int32_t_sub(
+ (m_pDrw->bb).xl,
+ dk4ma_int32_from_double((double)(m_pDrw->bleft), &er),
+ &er
+ ), deltax, &er
+ );
+ xcmax = dk4ma_int32_t_sub(
+ dk4ma_int32_t_add(
+ (m_pDrw->bb).xr,
+ dk4ma_int32_from_double((double)(m_pDrw->bright), &er),
+ &er
+ ), deltax, &er
+ );
+ ycmin = dk4ma_int32_t_add(
+ dk4ma_int32_t_sub(
+ (m_pDrw->bb).yb,
+ dk4ma_int32_from_double((double)(m_pDrw->bbottom), &er),
+ &er
+ ), deltay, &er
+ );
+ ycmax = dk4ma_int32_t_sub(
+ dk4ma_int32_t_add(
+ (m_pDrw->bb).yt,
+ dk4ma_int32_from_double((double)(m_pDrw->btop), &er),
+ &er
+ ), deltay, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ /*
+ X correction
+ */
+ if (xcmax > xcmin) {
+ if (m_pDrw->cx < xcmin) {
+ m_pDrw->cx = xcmin;
+ }
+ else {
+ if (m_pDrw->cx > xcmax) {
+ m_pDrw->cx = xcmax;
+ }
+ }
+ }
+ else {
+ if (xcmax == xcmin) {
+ m_pDrw->cx = xcmin;
+ }
+ else {
+ xcmin = i32_avg((m_pDrw->bb).xl, (m_pDrw->bb).xr, &er);
+ if (DK4_E_NONE == er.ec) {
+ m_pDrw->cx = xcmin;
+ }
+ }
+ }
+ /*
+ Y correction
+ */
+ if (ycmax > ycmin) {
+ if (m_pDrw->cy < ycmin) {
+ m_pDrw->cy = ycmin;
+ }
+ else {
+ if (m_pDrw->cy > ycmax) {
+ m_pDrw->cy = ycmax;
+ }
+ }
+ }
+ else {
+ if (ycmax == ycmin) {
+ m_pDrw->cy = ycmin;
+ }
+ else {
+ dk4error_init(&er);
+ ycmin = i32_avg((m_pDrw->bb).yb, (m_pDrw->bb).yt, &er);
+ if (DK4_E_NONE == er.ec) {
+ m_pDrw->cy = ycmin;
+ }
+ }
+ }
+ }
+ else {
+
+#line 1189 "WxdkdrawFrameTools.cpt"
+ }
+
+
+#line 1191 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ZoomChanged(bool bZoomOut)
+{
+ drawco->CalculateZoomFactor();
+ {
+ wxString s;
+ s.Printf("%g", drawco->m_dZoom);
+ lZoomPercent->SetLabel(s);
+ }
+ UpdateStipples();
+ UpdateFonts();
+ szTopBar->Layout();
+ lZoomPercent->Refresh();
+ if (bZoomOut && (0 != m_iv[IVI_C_COR_POSITION])) {
+ CorrectCenterPointIfNecessary();
+ }
+ drawco->CalculateConversionCoefficients();
+ AdjustScrollbars();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+}
+
+
+
+void
+WxdkdrawFrame::AdjustScrollbars(void)
+{
+ dk4_er_t er; /* Error report */
+ int xPos; /* Horizontal scrolblar position */
+ int yPos; /* Vertical scrollbar position */
+ int xThumb; /* Thumb size width (control width) */
+ int yThumb; /* Thumb size height (control height) */
+ int xRange; /* Range (required pixels) */
+ int yRange; /* Range (required pixels) */
+ int xPageSize; /* Pixels to scroll for page */
+ int yPageSize; /* Pixels to scroll for page */
+ bool bEnableX = false; /* Enable horizontal scrollbar */
+ bool bEnableY = false; /* Enable vertical scrollbar */
+
+
+#line 1235 "WxdkdrawFrameTools.cpt"
+ dk4error_init(&er);
+ xThumb = (drawco->m_szDrawco).GetWidth();
+ yThumb = (drawco->m_szDrawco).GetHeight();
+ xRange = dk4ma_int_from_double(
+ ceil(
+ (
+ (
+ (double)((m_pDrw->bb).xr) - (double)((m_pDrw->bb).xl)
+ + (double)(m_pDrw->bleft) + (double)(m_pDrw->bright)
+ ) * (drawco->m_ptRes).x * drawco->m_dZoom
+ ) / RESWXD
+ ), &er
+ );
+ yRange = dk4ma_int_from_double(
+ ceil(
+ (
+ (
+ (double)((m_pDrw->bb).yt) - (double)((m_pDrw->bb).yb)
+ + (double)(m_pDrw->bbottom) + (double)(m_pDrw->btop)
+ ) * (drawco->m_ptRes).y * drawco->m_dZoom
+ ) / RESWXD
+ ), &er
+ );
+ xPageSize = dk4ma_int_mul(xThumb, 4, &er) / 5;
+ yPageSize = dk4ma_int_mul(yThumb, 4, &er) / 5;
+ xPos = dk4ma_int_from_double(
+ dk4ma_rint(
+ (
+ (
+ (
+ (double)(m_pDrw->cx) - (double)((m_pDrw->bb).xl)
+ + (double)(m_pDrw->bleft)
+ ) * (drawco->m_ptRes).x * drawco->m_dZoom
+ ) / RESWXD
+ ) - ((double)xThumb / 2.0)
+ ), &er
+ );
+ yPos = dk4ma_int_from_double(
+ dk4ma_rint(
+ (
+ (
+ (
+ (double)((m_pDrw->bb).yt) - (double)(m_pDrw->cy)
+ + (double)(m_pDrw->btop)
+ ) * (drawco->m_ptRes).y * drawco->m_dZoom
+ ) / RESWXD
+ ) - ((double)yThumb / 2.0)
+ ), &er
+ );
+ if (0 > xPos) { xPos = 0; }
+ if (0 > yPos) { yPos = 0; }
+ if ((xRange - xThumb) < xPos) { xPos = xRange - xThumb; }
+ if ((yRange - yThumb) < yPos) { yPos = yRange - yThumb; }
+ if (DK4_E_NONE == er.ec) {
+ if (xRange > xThumb) {
+ bEnableX = true;
+ }
+ if (yRange > yThumb) {
+ bEnableY = true;
+ }
+ }
+ /* Set up horizontal scrollbar
+ */
+ if (bEnableX) {
+ if (!(sbHori->IsEnabled())) {
+ sbHori->Enable();
+ }
+
+
+#line 1303 "WxdkdrawFrameTools.cpt"
+
+
+#line 1304 "WxdkdrawFrameTools.cpt"
+
+
+#line 1305 "WxdkdrawFrameTools.cpt"
+
+
+#line 1306 "WxdkdrawFrameTools.cpt"
+ sbHori->SetScrollbar(xPos, xThumb, xRange, xPageSize, true);
+ sbHori->SetThumbPosition(xPos);
+ sbHori->Refresh();
+ }
+ else {
+ if (sbHori->IsEnabled()) {
+ sbHori->Enable(false);
+ sbHori->Refresh();
+ }
+ }
+ /* Set up vertical scrollbar
+ */
+ if (bEnableY) {
+ if (!(sbVert->IsEnabled())) {
+ sbVert->Enable();
+ }
+
+
+#line 1323 "WxdkdrawFrameTools.cpt"
+
+
+#line 1324 "WxdkdrawFrameTools.cpt"
+
+
+#line 1325 "WxdkdrawFrameTools.cpt"
+
+
+#line 1326 "WxdkdrawFrameTools.cpt"
+ sbVert->SetScrollbar(yPos, yThumb, yRange, yPageSize, true);
+ sbVert->SetThumbPosition(yPos);
+ sbVert->Refresh();
+ }
+ else {
+ if (sbVert->IsEnabled()) {
+ sbVert->Enable(false);
+ sbVert->Refresh();
+ }
+ }
+
+#line 1336 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::StartEventHandling(void)
+{
+ dk4error_init(&m_oErrorReport);
+ m_bUpdate = false;
+}
+
+
+
+void
+WxdkdrawFrame::MoveScrollbar(wxScrollBar *sb, int lines, bool vert)
+{
+ int range; /* Scrollbar range (maximum) */
+#if 0
+ int ps; /* Page size */
+#endif
+ int pos; /* Position */
+ int ts; /* Thumb size */
+
+
+#line 1359 "WxdkdrawFrameTools.cpt"
+ range = sb->GetRange();
+#if 0
+ ps = sb->GetPageSize();
+#endif
+ pos = sb->GetThumbPosition();
+ ts = sb->GetThumbSize();
+
+ if (range > ts) {
+ pos -= (lines * ts) / 10;
+ if (0 > pos) { pos = 0; }
+ if ((range - ts) <= pos) { pos = range - ts - 1; }
+ sb->SetThumbPosition(pos);
+ if (vert) {
+ UseScrollV();
+ }
+ else {
+ UseScrollH();
+ }
+ sb->Refresh();
+ sb->Update();
+ }
+
+
+#line 1381 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ControlMouseWheel(wxMouseEvent & event)
+{
+ int modifiers; /* Modifier keys */
+ int rotation; /* Rotation of wheel */
+ int delta; /* Required rotation for line */
+ int lines; /* Number of lines */
+ int8_t ozl;
+
+
+#line 1394 "WxdkdrawFrameTools.cpt"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ modifiers = event.GetModifiers();
+ rotation = event.GetWheelRotation();
+ delta = event.GetWheelDelta();
+ switch (modifiers) {
+ case wxMOD_CONTROL : {
+ m_iWheelControl += rotation;
+ lines = m_iWheelControl / delta;
+ m_iWheelControl -= (lines * delta);
+ ozl = m_pDrw->zl;
+ if (0 < lines) {
+ while (0 < lines--) {
+ if ((int8_t)(-14) < m_pDrw->zl) {
+ m_pDrw->zl -= (int8_t)1;
+ }
+ }
+ }
+ else {
+ if (0 > lines) {
+ while (0 > lines++) {
+ if ((int8_t)14 > m_pDrw->zl) {
+ m_pDrw->zl += (int8_t)1;
+ }
+ }
+ }
+ }
+ if (ozl != m_pDrw->zl) {
+ ZoomChanged((ozl > m_pDrw->zl));
+ UpdateGridPosition();
+ }
+ } break;
+ case wxMOD_SHIFT : {
+ m_iWheelShift += rotation;
+ lines = m_iWheelShift /delta;
+ m_iWheelShift -= (lines * delta);
+ if (sbHori->IsEnabled()) {
+ MoveScrollbar(sbHori, lines, false);
+ drawco->CalculateConversionCoefficients();
+ UpdateGridPosition();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ }
+ } break;
+ case wxMOD_NONE : {
+ m_iWheelNormal += rotation;
+ lines = m_iWheelNormal / delta;
+ m_iWheelNormal -= (lines * delta);
+ if (sbVert->IsEnabled()) {
+ MoveScrollbar(sbVert, lines, true);
+ drawco->CalculateConversionCoefficients();
+ UpdateGridPosition();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ }
+ } break;
+ }
+
+
+#line 1452 "WxdkdrawFrameTools.cpt"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::UseScrollH(void)
+{
+ dk4_er_t er; /* Error report */
+ int32_t cx; /* Center x */
+ int tp; /* Thumb position */
+ int ts; /* Thumb size */
+#if 0
+ int r;
+ int p;
+#endif
+
+
+#line 1469 "WxdkdrawFrameTools.cpt"
+#if 0
+ r = sbHori->GetRange();
+ p = sbHori->GetPageSize();
+#endif
+ tp = sbHori->GetThumbPosition();
+ ts = sbHori->GetThumbSize();
+ dk4error_init(&er);
+ cx = dk4ma_int32_from_double(
+ dk4ma_rint(
+ (
+ ((double)tp + (double)ts / 2.0) * RESWXD
+ ) / ((drawco->m_ptRes).x * drawco->m_dZoom)
+ ), &er
+ );
+ cx = dk4ma_int32_t_add(cx, (m_pDrw->bb).xl, &er);
+ cx = dk4ma_int32_t_sub(cx, m_pDrw->bleft, &er);
+ if (DK4_E_NONE == er.ec) {
+ m_pDrw->cx = cx;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+
+
+#line 1492 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::UseScrollV(void)
+{
+ dk4_er_t er; /* Error report */
+ int32_t cy; /* Center y */
+ int tp; /* Thumb position */
+ int ts; /* Thumb size */
+#if 0
+ int r;
+ int p;
+#endif
+
+
+#line 1508 "WxdkdrawFrameTools.cpt"
+#if 0
+ r = sbVert->GetRange();
+ p = sbVert->GetPageSize();
+#endif
+ tp = sbVert->GetThumbPosition();
+ ts = sbVert->GetThumbSize();
+ dk4error_init(&er);
+ cy = dk4ma_int32_from_double(
+ dk4ma_rint(
+ (
+ ((double)tp + (double)ts / 2.0) * RESWXD
+ ) / ((drawco->m_ptRes).x * drawco->m_dZoom)
+ ), &er
+ );
+ cy = dk4ma_int32_t_sub((m_pDrw->bb).yt, cy, &er);
+ cy = dk4ma_int32_t_add(cy, m_pDrw->btop, &er);
+ if (DK4_E_NONE == er.ec) {
+ m_pDrw->cy = cy;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+
+
+#line 1531 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+#if 0
+
+static
+bool
+ColourChooserDiffersFromColour(Dk4WxColourView *pcc, int *pcol)
+{
+ bool back = false;
+ if (pcc->Red() != pcol[0]) {
+ back = true;
+ }
+ else {
+ if (pcc->Green() != pcol[1]) {
+ back = true;
+ }
+ else {
+ if (pcc->Blue() != pcol[2]) {
+ back = true;
+ }
+ }
+ }
+ return back;
+}
+
+#endif
+
+
+
+void
+WxdkdrawFrame::StyleToGUI(bool refresh)
+{
+ int valrotation = 0; /* Rotation value */
+ bool enalayer = true; /* Enable layer spin control */
+ bool enalinecolour = false; /* Enable line colour chooser */
+ bool enalinewidth = false; /* Enable line width spin control */
+ bool enalinestyle = false; /* Enable line style button */
+ bool enajoinstyle = false; /* Enable join style button */
+ bool enacapstyle = false; /* Enable cap style button */
+ bool enafwarrow = false; /* Enable forward arrow button */
+ bool enabwarrow = false; /* Enable backward arrow button */
+ bool enafillcolour = false; /* Enable fill colour chooser */
+ bool enafillstyle = false; /* Enable fill style button */
+ bool enalatex = false; /* Enable LaTeX checkbox */
+ bool enatextalign = false; /* Enable text align button */
+ bool enatextfont = false; /* Enable text font button */
+ bool enatextsize = false; /* Enable text size spin control */
+ bool enarotation = false; /* Enable rotation spin control */
+
+
+#line 1582 "WxdkdrawFrameTools.cpt"
+ if (NULL != m_pStyle) {
+
+#line 1583 "WxdkdrawFrameTools.cpt"
+ /*
+ Check which style elements to enable
+ */
+ switch ( (int)(m_pStyle->ot) ) {
+ case WXD_OT_TEXT : {
+
+#line 1588 "WxdkdrawFrameTools.cpt"
+ enalinecolour = true;
+ enalatex = true;
+ enatextalign = true;
+ enatextfont = true;
+ enatextsize = true;
+ enarotation = true;
+ valrotation = (m_pStyle->det).t.a;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE : {
+
+#line 1597 "WxdkdrawFrameTools.cpt"
+ enalinecolour = true;
+ enalinewidth = true;
+ enalinestyle = true;
+ enajoinstyle = true;
+ enacapstyle = true;
+ enafwarrow = true;
+ enabwarrow = true;
+ } break;
+ case WXD_OT_O_ARC : {
+
+#line 1606 "WxdkdrawFrameTools.cpt"
+ enalinecolour = true;
+ enalinewidth = true;
+ enalinestyle = true;
+ enacapstyle = true;
+ enafwarrow = true;
+ enabwarrow = true;
+ } break;
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE : case WXD_OT_C_ARC : {
+
+
+#line 1615 "WxdkdrawFrameTools.cpt"
+ enalinecolour = true;
+
+#line 1616 "WxdkdrawFrameTools.cpt"
+ enalinewidth = true;
+
+#line 1617 "WxdkdrawFrameTools.cpt"
+ enalinestyle = true;
+
+#line 1618 "WxdkdrawFrameTools.cpt"
+ enajoinstyle = true;
+
+#line 1619 "WxdkdrawFrameTools.cpt"
+ enafillcolour = true;
+
+#line 1620 "WxdkdrawFrameTools.cpt"
+ enafillstyle = true;
+
+#line 1621 "WxdkdrawFrameTools.cpt"
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+
+#line 1623 "WxdkdrawFrameTools.cpt"
+ enalinecolour = true;
+ enalinewidth = true;
+ enalinestyle = true;
+ enafillcolour = true;
+ enafillstyle = true;
+ if (WXD_OT_ELLIPSE == m_pStyle->ot) {
+ enarotation = true;
+ valrotation = (m_pStyle->det).e.a;
+ }
+ } break;
+ case WXD_OT_BOX : {
+
+#line 1634 "WxdkdrawFrameTools.cpt"
+ enalinecolour = true;
+ enalinewidth = true;
+ enalinestyle = true;
+ enajoinstyle = true;
+ enafillcolour = true;
+ enafillstyle = true;
+ } break;
+ case WXD_OT_IMAGE : {
+
+#line 1642 "WxdkdrawFrameTools.cpt"
+ enafillcolour = true;
+ } break;
+ case WXD_OT_DOT_FILLED : {
+
+#line 1645 "WxdkdrawFrameTools.cpt"
+ enalinecolour = true;
+ } break;
+ case WXD_OT_DOT_WHITE : {
+
+#line 1648 "WxdkdrawFrameTools.cpt"
+ enalinecolour = true;
+ enalinewidth = true;
+ } break;
+ default : {
+
+#line 1652 "WxdkdrawFrameTools.cpt"
+ } break;
+ }
+
+ /*
+ Prepare to change style for selected object.
+ */
+
+ /* Layer */
+ spLayerNumber->SetValue( (int)(m_pStyle->lay) );
+ spLayerNumber->Enable(enalayer);
+ if (refresh) { spLayerNumber->Refresh(); m_bUpdate = true; }
+
+
+#line 1664 "WxdkdrawFrameTools.cpt"
+
+ /* Line colour */
+ ccLineColour->SetRGB(m_pStyle->sc[0], m_pStyle->sc[1], m_pStyle->sc[2]);
+
+
+#line 1668 "WxdkdrawFrameTools.cpt"
+ ccLineColour->Enable(enalinecolour);
+ if (refresh) { ccLineColour->Refresh(); m_bUpdate = true; }
+
+
+#line 1671 "WxdkdrawFrameTools.cpt"
+
+ /* Line width */
+ spLineWidth->SetValue( (int)(m_pStyle->lw) );
+
+
+#line 1675 "WxdkdrawFrameTools.cpt"
+ spLineWidth->Enable(enalinewidth);
+ if (refresh) { spLineWidth->Refresh(); m_bUpdate = true; }
+
+
+#line 1678 "WxdkdrawFrameTools.cpt"
+
+ /* Line style */
+ bStyleLineStyle->SetBitmap(WxdkdrawFrame::ms_ls_images[m_pStyle->ls]);
+
+
+#line 1682 "WxdkdrawFrameTools.cpt"
+ bStyleLineStyle->Enable(enalinestyle);
+ if (refresh) { bStyleLineStyle->Refresh(); m_bUpdate = true; }
+
+
+#line 1685 "WxdkdrawFrameTools.cpt"
+
+ /* Join style */
+ bStyleLineJoins->SetBitmap(WxdkdrawFrame::ms_lj_images[m_pStyle->js]);
+ bStyleLineJoins->Enable(enajoinstyle);
+ if (refresh) { bStyleLineJoins->Refresh(); m_bUpdate = true; }
+
+
+#line 1691 "WxdkdrawFrameTools.cpt"
+
+ /* Cap style */
+ bStyleLineEnds->SetBitmap(WxdkdrawFrame::ms_lc_images[m_pStyle->cs]);
+ bStyleLineEnds->Enable(enacapstyle);
+ if (refresh) { bStyleLineEnds->Refresh(); m_bUpdate = true; }
+
+
+#line 1697 "WxdkdrawFrameTools.cpt"
+
+ /* Forward arrow */
+ bStyleArrowForward->SetBitmap(
+ WxdkdrawFrame::ms_arrow_images[m_pStyle->aft]
+ );
+ bStyleArrowForward->Enable(enafwarrow);
+ if (refresh) { bStyleArrowForward->Refresh(); m_bUpdate = true; }
+
+
+#line 1705 "WxdkdrawFrameTools.cpt"
+
+ /* Backward arrow */
+ bStyleArrowBackward->SetBitmap(
+ WxdkdrawFrame::ms_arrow_images[m_pStyle->abt]
+ );
+ bStyleArrowBackward->Enable(enabwarrow);
+ if (refresh) { bStyleArrowBackward->Refresh(); m_bUpdate = true; }
+
+
+#line 1713 "WxdkdrawFrameTools.cpt"
+
+ /* Fill colour */
+ ccFillColour->SetRGB(
+ m_pStyle->fc[0], m_pStyle->fc[1], m_pStyle->fc[2]
+ );
+ ccFillColour->Enable(enafillcolour);
+ if (refresh) { ccFillColour->Refresh(); m_bUpdate = true; }
+
+
+#line 1721 "WxdkdrawFrameTools.cpt"
+
+ /* Fill style */
+ bStyleFillPattern->SetBitmap(WxdkdrawFrame::ms_fs_images[m_pStyle->fs]);
+ bStyleFillPattern->Enable(enafillstyle);
+ if (refresh) { bStyleFillPattern->Refresh(); m_bUpdate = true; }
+
+
+#line 1727 "WxdkdrawFrameTools.cpt"
+
+ if (WXD_OT_TEXT == m_pStyle->ot) {
+
+ /* LaTeX text flag */
+ cbStyleTextLaTeX->SetValue(
+ WXD_TEXT_FLAG_NONE
+ != (WXD_TEXT_FLAG_LATEX & (m_pStyle->det).t.fl)
+ );
+ cbStyleTextLaTeX->Enable(enalatex);
+ if (refresh) { cbStyleTextLaTeX->Refresh(); m_bUpdate = true; }
+
+
+#line 1738 "WxdkdrawFrameTools.cpt"
+
+
+
+#line 1740 "WxdkdrawFrameTools.cpt"
+ bStyleTextAlign->SetBitmap(
+ WxdkdrawFrame::ms_ta_images[(m_pStyle->det).t.al]
+ );
+ bStyleTextAlign->Enable(enatextalign);
+ if (refresh) { bStyleTextAlign->Refresh(); m_bUpdate = true; }
+
+
+#line 1746 "WxdkdrawFrameTools.cpt"
+
+ /* Text font */
+ bStyleFontName->SetBitmap(
+ WxdkdrawFrame::ms_fn_images[(m_pStyle->det).t.find]
+ );
+ bStyleFontName->Enable(enatextfont);
+ if (refresh) { bStyleFontName->Refresh(); m_bUpdate = true; }
+
+
+#line 1754 "WxdkdrawFrameTools.cpt"
+
+ /* Text size */
+ spFontSize->SetValue((m_pStyle->det).t.fsz);
+ spFontSize->Enable(enatextsize);
+ if (refresh) { spFontSize->Refresh(); m_bUpdate = true; }
+
+
+#line 1760 "WxdkdrawFrameTools.cpt"
+
+ }
+ else {
+ cbStyleTextLaTeX->Enable(false);
+ bStyleTextAlign->Enable(false);
+ bStyleFontName->Enable(false);
+ spFontSize->Enable(false);
+ }
+ spRotation->SetValue(valrotation);
+ spRotation->Enable(enarotation);
+ if (refresh) { spRotation->Refresh(); m_bUpdate = true; }
+ }
+ else {
+
+#line 1773 "WxdkdrawFrameTools.cpt"
+ /*
+ Prepare to change default styles.
+ */
+
+ /* Layer number */
+ spLayerNumber->SetValue( (int)(m_oStyle.lay) );
+ spLayerNumber->Enable();
+ if (refresh) { spLayerNumber->Refresh(); m_bUpdate = true; }
+
+ /* Line colour */
+ ccLineColour->SetRGB( m_oStyle.sc[0], m_oStyle.sc[1], m_oStyle.sc[2] );
+ ccLineColour->Enable();
+ if (refresh) { ccLineColour->Refresh(); m_bUpdate = true; }
+
+ /* Line width */
+ spLineWidth->SetValue( (int)(m_oStyle.lw) );
+ spLineWidth->Enable();
+ if (refresh) { spLineWidth->Refresh(); m_bUpdate = true; }
+
+ /* Line style */
+ bStyleLineStyle->SetBitmap(WxdkdrawFrame::ms_ls_images[m_oStyle.ls]);
+ bStyleLineStyle->Enable();
+ if (refresh) { bStyleLineStyle->Refresh(); m_bUpdate = true; }
+
+ /* Join style */
+ bStyleLineJoins->SetBitmap(WxdkdrawFrame::ms_lj_images[m_oStyle.js]);
+ bStyleLineJoins->Enable();
+ if (refresh) { bStyleLineJoins->Refresh(); m_bUpdate = true; }
+
+ /* Cap style */
+ bStyleLineEnds->SetBitmap(WxdkdrawFrame::ms_lc_images[m_oStyle.cs]);
+ bStyleLineEnds->Enable();
+ if (refresh) { bStyleLineEnds->Refresh(); m_bUpdate = true; }
+
+ /* Forward arrow */
+ bStyleArrowForward->SetBitmap(
+ WxdkdrawFrame::ms_arrow_images[m_oStyle.aft]
+ );
+ bStyleArrowForward->Enable();
+ if (refresh) { bStyleArrowForward->Refresh(); m_bUpdate = true; }
+
+ /* Backward arrow */
+ bStyleArrowBackward->SetBitmap(
+ WxdkdrawFrame::ms_arrow_images[m_oStyle.abt]
+ );
+ bStyleArrowBackward->Enable();
+ if (refresh) { bStyleArrowBackward->Refresh(); m_bUpdate = true; }
+
+ /* Fill colour */
+ ccFillColour->SetRGB( m_oStyle.fc[0], m_oStyle.fc[1], m_oStyle.fc[2] );
+ ccFillColour->Enable();
+ if (refresh) { ccFillColour->Refresh(); m_bUpdate = true; }
+
+ /* Fill style */
+ bStyleFillPattern->SetBitmap(WxdkdrawFrame::ms_fs_images[m_oStyle.fs]);
+ bStyleFillPattern->Enable();
+ if (refresh) { bStyleFillPattern->Refresh(); m_bUpdate = true; }
+
+ /* LaTeX text flag */
+ cbStyleTextLaTeX->SetValue(
+ WXD_TEXT_FLAG_NONE != (WXD_TEXT_FLAG_LATEX & m_oStyle.det.t.fl)
+ );
+ cbStyleTextLaTeX->Enable();
+ if (refresh) { cbStyleTextLaTeX->Refresh(); m_bUpdate = true; }
+
+ /* Text align */
+ bStyleTextAlign->SetBitmap(
+ WxdkdrawFrame::ms_ta_images[m_oStyle.det.t.al]
+ );
+ bStyleTextAlign->Enable();
+ if (refresh) { bStyleTextAlign->Refresh(); m_bUpdate = true; }
+
+ /* Text font */
+ bStyleFontName->SetBitmap(
+ WxdkdrawFrame::ms_fn_images[m_oStyle.det.t.find]
+ );
+ bStyleFontName->Enable();
+ if (refresh) { bStyleFontName->Refresh(); m_bUpdate = true; }
+
+ /* Text size */
+ spFontSize->SetValue(m_oStyle.det.t.fsz);
+ spFontSize->Enable();
+ if (refresh) { spFontSize->Refresh(); m_bUpdate = true; }
+
+ /* Rotation */
+ spRotation->SetValue(0);
+ spRotation->Enable(false);
+ if (refresh) { spRotation->Refresh(); m_bUpdate = true; }
+ }
+
+
+#line 1863 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::SetStyleObject(Wxd_object_t *pObj, bool bUpdate)
+{
+ if (m_pStyle != pObj) {
+ m_pStyle = pObj;
+ StyleToGUI(bUpdate);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::UpdateOneFont(
+ Wxd_font_t *pfont
+)
+{
+ pfont->attempted = false;
+ if (NULL != pfont->font) {
+ delete (pfont->font);
+ pfont->font = NULL;
+ }
+ wxdfont_find_font(
+ pfont, drawco->m_dZoom, (drawco->m_ptRes).y,
+ (0 != m_iv[IVI_FONT_EXACT])
+ );
+}
+
+
+
+void
+WxdkdrawFrame::UpdateFonts(void)
+{
+ Wxd_font_t *pfont;
+ Wxd_object_t *pobj;
+
+
+#line 1902 "WxdkdrawFrameTools.cpt"
+ /* Connect text details to fonts.
+ */
+
+
+#line 1905 "WxdkdrawFrameTools.cpt"
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (NULL != pobj) {
+ if (WXD_OT_TEXT == pobj->ot) {
+
+#line 1910 "WxdkdrawFrameTools.cpt"
+ if (NULL == (pobj->det).t.font) {
+
+#line 1911 "WxdkdrawFrameTools.cpt"
+ (pobj->det).t.font = FindFont(
+ (pobj->det).t.find, (pobj->det).t.fsz
+ );
+ }
+ }
+ }
+ } while (NULL != pobj);
+
+
+#line 1919 "WxdkdrawFrameTools.cpt"
+ /* Clear and renew all fonts
+ */
+
+
+#line 1922 "WxdkdrawFrameTools.cpt"
+ dk4sto_it_reset(m_pDrw->i_fonts);
+ do {
+ pfont = (Wxd_font_t *)dk4sto_it_next(m_pDrw->i_fonts);
+ if (NULL != pfont) {
+ UpdateOneFont(pfont);
+ }
+ } while (NULL != pfont);
+
+
+#line 1930 "WxdkdrawFrameTools.cpt"
+
+
+#line 1931 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+Wxd_font_t *
+WxdkdrawFrame::FindFont(uint8_t find, uint16_t fsz)
+{
+ Wxd_font_t tf;
+ Wxd_font_t *back = NULL;
+
+
+#line 1941 "WxdkdrawFrameTools.cpt"
+ tf.find = find; tf.fsz = fsz;
+ back = (Wxd_font_t *)dk4sto_it_find_like(m_pDrw->i_fonts, &tf, 0);
+ if (NULL == back) {
+ back = wxdfont_new(find, fsz);
+ if (NULL != back) {
+ if (0 != dk4sto_add(m_pDrw->s_fonts, back, NULL)) {
+ wxdfont_find_font(
+ back, drawco->m_dZoom, (drawco->m_ptRes).y,
+ (0 != m_iv[IVI_FONT_EXACT])
+ );
+ }
+ else {
+ wxdfont_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+#line 1958 "WxdkdrawFrameTools.cpt"
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::ObjectSelectableInState(Wxd_object_t const *pobj)
+{
+ bool back = false;
+ if (NULL != pobj) {
+ back = true;
+ /*
+ _STATE_
+ In some states we want to select objects of certain
+ types only
+ */
+ switch (m_iState) {
+ case S_MOD_SPLINE : {
+ back = false;
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE :
+ {
+ back = true;
+ } break;
+ }
+ } break;
+ case S_ROTATE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_CIRCLE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE :
+ {
+ if (NULL == pobj->pa) {
+ back = false;
+ }
+ } break;
+ }
+ } break;
+ case S_CONVERT : {
+ back = wxdobj_can_convert(m_iObjToCreate, pobj);
+ } break;
+ case S_FLIP : {
+ /*
+ For some object types flipping would result
+ in no change
+ */
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_CIRCLE :
+ case WXD_OT_BOX :
+ case WXD_OT_IMAGE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ if (NULL == pobj->pa) {
+ back = false;
+ }
+ } break;
+ }
+ } break;
+ case S_UNGROUP : {
+ /*
+ Only members of groups are of interest, from the member
+ we go upwards to find the top level group object
+ */
+ if (NULL == pobj->pa) {
+ back = false;
+ }
+ } break;
+ case S_DETAILS : {
+ /*
+ The details to modify - if any - depend on the object type:
+ */
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : /* Texts */
+ case WXD_OT_BOX : /* Rounded corner radius */
+ case WXD_OT_IMAGE : /* Image file and flags */
+ case WXD_OT_DOT_FILLED : /* Diameter */
+ case WXD_OT_DOT_WHITE : /* Diameter */
+ {
+ back = true;
+ } break;
+ default : {
+ back = false;
+ } break;
+ }
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+Wxd_object_t *
+WxdkdrawFrame::FindNearestObject(bool gr)
+{
+ Wxd_object_t *back = NULL; /* Object with minimum distance */
+ Wxd_object_t *pobj; /* Current object */
+ double min = -1.0; /* Minimum distance found so far */
+ double d; /* Distance to current object */
+
+
+#line 2059 "WxdkdrawFrameTools.cpt"
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (NULL != pobj) {
+ if ((wxdobj_is_active(pobj)) && (ObjectSelectableInState(pobj))) {
+ d = wxdobj_distance_to_point(pobj, &m_ptMousePosRaw);
+ if (
+ (0.0 < d)
+ && ((0.0 > min) || (d < min))
+ && (d < 2.0 * (double)(drawco->m_uGridSnap))
+ ) {
+ min = d;
+ back = pobj;
+ }
+ }
+ }
+ } while (NULL != pobj);
+ if ((gr) && (NULL != back)) {
+ while (NULL != back->pa) { back = back->pa; }
+ }
+
+#line 2079 "WxdkdrawFrameTools.cpt"
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::RequireRedraw(int level)
+{
+ wxdobj_drw_require_redraw(m_pDrw, level);
+ drawco->Refresh();
+ Update();
+}
+
+
+
+void
+WxdkdrawFrame::UpdateTextForFont(Wxd_object_t *pobj, bool bRedraw)
+{
+ Wxd_font_t *pfont;
+ bool hasf;
+
+
+#line 2100 "WxdkdrawFrameTools.cpt"
+ hasf = (NULL != (pobj->det).t.font);
+ (pobj->det).t.font = pfont = FindFont((pobj->det).t.find,(pobj->det).t.fsz);
+ if (NULL != pfont) {
+ UpdateOneFont(pfont);
+ }
+ if (hasf) {
+ wxdobj_remove_unused_fonts(m_pDrw);
+ }
+ if (bRedraw) {
+ RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+
+
+#line 2112 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::SetMouseAndStatusTexts(int st)
+{
+
+
+#line 2120 "WxdkdrawFrameTools.cpt"
+ /* Defaults
+ */
+
+
+#line 2123 "WxdkdrawFrameTools.cpt"
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseM->SetLabel(sNlWx[7]);
+ msgMouseR->SetLabel(sNlWx[7]);
+ SetStatusText(sNlWx[7]);
+ /*
+ _STATE_ Messages depending on state to enter.
+ */
+ switch (st) {
+ case S_NOOP : {
+
+#line 2132 "WxdkdrawFrameTools.cpt"
+ } break;
+ case S_DELETE : {
+
+#line 2134 "WxdkdrawFrameTools.cpt"
+ msgMouseR->SetLabel(sTexts[341]);
+ msgMouseM->SetLabel(sTexts[534]);
+ } break;
+ case S_REGION_DELETE : {
+ msgMouseL->SetLabel(sTexts[532]);
+ msgMouseR->SetLabel(sTexts[533]);
+ } break;
+ case S_MOVE_SELECT : {
+
+#line 2142 "WxdkdrawFrameTools.cpt"
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseR->SetLabel(sTexts[344]);
+ } break;
+ case S_MOVE_PLACE : {
+
+#line 2146 "WxdkdrawFrameTools.cpt"
+ } break;
+ case S_COPY_SELECT : {
+
+#line 2148 "WxdkdrawFrameTools.cpt"
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseR->SetLabel(sTexts[372]);
+ } break;
+ case S_COPY_PLACE : {
+
+#line 2152 "WxdkdrawFrameTools.cpt"
+ } break;
+ case S_POLY_FIRST : {
+
+#line 2154 "WxdkdrawFrameTools.cpt"
+ msgMouseL->SetLabel(sTexts[373]);
+ msgMouseR->SetLabel(sTexts[375]);
+ SetStatusText(
+ sTexts[(WXD_OT_POLYLINE == m_iObjToCreate) ? 30 : 32]
+ );
+ } break;
+ case S_POLY_FURTHER : {
+
+#line 2161 "WxdkdrawFrameTools.cpt"
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[374]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[376]);
+ SetStatusText(
+ sTexts[(WXD_OT_POLYLINE == m_iObjToCreate) ? 30 : 32]
+ );
+ } break;
+ case S_SPLINE_FIRST : {
+
+#line 2170 "WxdkdrawFrameTools.cpt"
+ msgMouseL->SetLabel(sTexts[373]);
+ msgMouseR->SetLabel(sTexts[375]);
+ if (WXD_OT_C_SPLINE == m_iObjToCreate) {
+ SetStatusText(sTexts[m_bSplineInterpolated ? 48 : 44]);
+ }
+ else {
+ SetStatusText(sTexts[m_bSplineInterpolated ? 46 : 42]);
+ }
+ } break;
+ case S_SPLINE_FURTHER : {
+
+#line 2180 "WxdkdrawFrameTools.cpt"
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[374]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[376]);
+ if (WXD_OT_C_SPLINE == m_iObjToCreate) {
+ SetStatusText(sTexts[m_bSplineInterpolated ? 48 : 44]);
+ }
+ else {
+ SetStatusText(sTexts[m_bSplineInterpolated ? 46 : 42]);
+ }
+ } break;
+ case S_BOX_FIRST : {
+ msgMouseL->SetLabel(sTexts[377]);
+ msgMouseR->SetLabel(sTexts[379]);
+ SetStatusText(sTexts[m_bSplineInterpolated ? 36 : 34]);
+ } break;
+ case S_BOX_OPPOSITE : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[378]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[379]);
+ SetStatusText(sTexts[m_bSplineInterpolated ? 36 : 34]);
+ } break;
+ case S_CIRCLE_CENTER : {
+ msgMouseL->SetLabel(sTexts[380]);
+ msgMouseR->SetLabel(sTexts[383]);
+ SetStatusText(sTexts[38]);
+ } break;
+ case S_CIRCLE_RADIUS : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[381]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[382]);
+ SetStatusText(sTexts[38]);
+ } break;
+ case S_ELLIPSE_CENTER : {
+ msgMouseL->SetLabel(sTexts[380]);
+ msgMouseR->SetLabel(sTexts[383]);
+ SetStatusText(sTexts[40]);
+ } break;
+ case S_ELLIPSE_CORNER : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[384]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[382]);
+ SetStatusText(sTexts[40]);
+ } break;
+ case S_ARC_1 : {
+ msgMouseL->SetLabel(sTexts[389]);
+ msgMouseR->SetLabel(sTexts[393]);
+ SetStatusText(sTexts[(WXD_OT_C_ARC == m_iObjToCreate) ? 388 : 386]);
+ } break;
+ case S_ARC_2 : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[390]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[392]);
+ SetStatusText(sTexts[(WXD_OT_C_ARC == m_iObjToCreate) ? 388 : 386]);
+ } break;
+ case S_ARC_3 : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[391]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[392]);
+ SetStatusText(sTexts[(WXD_OT_C_ARC == m_iObjToCreate) ? 388 : 386]);
+ } break;
+ case S_DOT : {
+ msgMouseL->SetLabel(sTexts[394]);
+ msgMouseR->SetLabel(sTexts[395]);
+ SetStatusText(
+ sTexts[(WXD_OT_DOT_WHITE == m_iObjToCreate) ? 52 : 50]
+ );
+ } break;
+ case S_TEXT : {
+ msgMouseL->SetLabel(sTexts[403]);
+ msgMouseR->SetLabel(sTexts[404]);
+ SetStatusText(sTexts[54]);
+ } break;
+ case S_IMG_1 : {
+ msgMouseL->SetLabel(sTexts[405]);
+ msgMouseR->SetLabel(sTexts[408]);
+ SetStatusText(sTexts[56]);
+ } break;
+ case S_IMG_2 : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[406]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[407]);
+ SetStatusText(sTexts[56]);
+ } break;
+ case S_LIBELEM_PLACE : {
+ msgMouseL->SetLabel(sTexts[411]);
+ msgMouseR->SetLabel(sTexts[412]);
+ SetStatusText(sTexts[58]);
+ } break;
+ case S_MOVEPT_SELECT : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[418]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[420]);
+ SetStatusText(sTexts[421]);
+ } break;
+ case S_MOVEPT_PLACE : {
+ msgMouseL->SetLabel(sTexts[419]);
+ msgMouseR->SetLabel(sTexts[420]);
+ SetStatusText(sTexts[421]);
+ } break;
+ case S_DELPT : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[431]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[432]);
+ SetStatusText(sTexts[433]);
+ } break;
+ case S_ADDPT_SELECT : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[435]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[437]);
+ SetStatusText(sTexts[434]);
+ } break;
+ case S_ADDPT_PLACE : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[436]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[438]);
+ SetStatusText(sTexts[434]);
+ } break;
+ case S_DRWSZ_SELECT : {
+ msgMouseL->SetLabel(
+ (m_bHaveCornerPoint) ? (sTexts[439]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[440]);
+ SetStatusText(sTexts[441]);
+ } break;
+ case S_DRWSZ_PLACE : {
+ msgMouseL->SetLabel(sTexts[442]);
+ msgMouseR->SetLabel(sTexts[443]);
+ SetStatusText(sTexts[441]);
+ } break;
+ case S_FLIP : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[445]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[446]);
+ SetStatusText(sTexts[444]);
+ } break;
+ case S_GROUP_ONE : {
+ int num_marked_2 = wxdobj_num_marked_2(m_pDrw);
+ if (NULL != m_pCurrent) {
+ msgMouseL->SetLabel(sTexts[
+ ((wxdobj_is_marked(m_pCurrent,OBJ_MARKER_2))
+ ? (448) : (447))
+ ]);
+ }
+ else {
+ msgMouseL->SetLabel(
+ (2 <= num_marked_2) ? (sTexts[449]) : (sNlWx[7])
+ );
+ }
+ msgMouseR->SetLabel(sTexts[(2<= num_marked_2) ? (450) : (451)]);
+ SetStatusText(sTexts[452]);
+ } break;
+ case S_UNGROUP : {
+ msgMouseL->SetLabel(
+ ((NULL != m_pCurrent) ? (sTexts[454]) : (sNlWx[7]))
+ );
+ msgMouseR->SetLabel(sTexts[455]);
+ SetStatusText(sTexts[453]);
+ } break;
+ case S_GROUP_RECT_1 : {
+ msgMouseL->SetLabel(sTexts[456]);
+ msgMouseR->SetLabel(sTexts[451]);
+ SetStatusText(sTexts[457]);
+ } break;
+ case S_GROUP_RECT_2 : {
+ msgMouseL->SetLabel(sTexts[449]);
+ msgMouseR->SetLabel(sTexts[450]);
+ SetStatusText(sTexts[457]);
+ } break;
+ case S_DETAILS : case S_DETAILS_2 : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[459]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[460]);
+ SetStatusText(sTexts[458]);
+ } break;
+ case S_CONVERT : {
+ switch ( (int)m_iObjToCreate ) {
+ case WXD_OT_POLYLINE : {
+ SetStatusText(sTexts[546]);
+ } break;
+ case WXD_OT_POLYGON : {
+ SetStatusText(sTexts[545]);
+ } break;
+ case WXD_OT_C_SPLINE: {
+ if (m_bSplineInterpolated) {
+ SetStatusText(sTexts[547]);
+ }
+ else {
+ SetStatusText(sTexts[550]);
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if (m_bSplineInterpolated) {
+ SetStatusText(sTexts[166]);
+ }
+ else {
+ SetStatusText(sTexts[551]);
+ }
+ } break;
+ case WXD_OT_C_ARC : {
+ SetStatusText(sTexts[548]);
+ } break;
+ case WXD_OT_O_ARC : {
+ SetStatusText(sTexts[549]);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ SetStatusText(sTexts[553]);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ SetStatusText(sTexts[552]);
+ } break;
+ }
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[554]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[555]);
+ } break;
+ case S_ROTATE : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[572]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[573]);
+ SetStatusText(sTexts[(m_bSplineInterpolated) ? 571 : 570]);
+ } break;
+ case S_MOD_SPLINE : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[622]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[623]);
+ SetStatusText(sTexts[624]);
+ } break;
+ default : {
+
+#line 2424 "WxdkdrawFrameTools.cpt"
+ } break;
+ }
+ /*
+ Refresh widgets and update window
+ */
+ msgMouseL->Refresh();
+ msgMouseM->Refresh();
+ msgMouseR->Refresh();
+ m_bUpdate = true;
+
+
+#line 2434 "WxdkdrawFrameTools.cpt"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawFrameTools.cpt b/support/dktools/WxdkdrawFrameTools.cpt
new file mode 100644
index 0000000000..ac19aeca5b
--- /dev/null
+++ b/support/dktools/WxdkdrawFrameTools.cpt
@@ -0,0 +1,2440 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+
+
+
+$!trace-include
+
+
+/* IMPORTANT: Number and order of entries here must match the order in the
+ m_iv member array and the iv_keys array below!
+*/
+/** Default values for the integer array.
+*/
+static const int default_values[] = {
+/* IVI_BORDER_RED */ 236 ,
+/* IVI_BORDER_GREEN */ 236 ,
+/* IVI_BORDER_BLUE */ 255 ,
+/* IVI_BG_RED */ 242 ,
+/* IVI_BG_GREEN */ 242 ,
+/* IVI_BG_BLUE */ 242 ,
+/* IVI_GRID_RED */ 202 ,
+/* IVI_GRID_GREEN */ 202 ,
+/* IVI_GRID_BLUE */ 230 ,
+/* IVI_PH_RED */ 255 ,
+/* IVI_PH_GREEN */ 214 ,
+/* IVI_PH_BLUE */ 0 ,
+/* IVI_M_COPY_RED */ 0 ,
+/* IVI_M_COPY_GREEN */ 143 ,
+/* IVI_M_COPY_BLUE */ 0 ,
+/* IVI_M_MOVE_RED */ 0 ,
+/* IVI_M_MOVE_GREEN */ 0 ,
+/* IVI_M_MOVE_BLUE */ 204 ,
+/* IVI_M_DEL_RED */ 204 ,
+/* IVI_M_DEL_GREEN */ 0 ,
+/* IVI_M_DEL_BLUE */ 0 ,
+/* IVI_M_GROUP_RED */ 0 ,
+/* IVI_M_GROUP_GREEN */ 0 ,
+/* IVI_M_GROUP_BLUE */ 0 ,
+/* IVI_MISSIMG_RED */ 204 ,
+/* IVI_MISSIMG_GREEN */ 0 ,
+/* IVI_MISSIMG_BLUE */ 0 ,
+/* IVI_XS_SUBSEGS */ 4 ,
+/* IVI_FONT_EXACT */ 0 ,
+/* IVI_DOT_DIAMETER_FILLED */ 8 ,
+/* IVI_DOT_DIAMETER_WHITE */ 10 ,
+/* IVI_ARROWHEAD_LENGTH */ 16 ,
+/* IVI_ARROWHEAD_WIDTH */ 8 ,
+/* IVI_STYLE_VALUE */ 4 ,
+/* IVI_MITER_LIMIT */ 8 ,
+/* IVI_REDUCE_MARKUP_POINTS */ 1 ,
+/* IVI_D_LAYER */ 0 ,
+/* IVI_D_LINE_COL_RED */ 0 ,
+/* IVI_D_LINE_COL_GREEN */ 0 ,
+/* IVI_D_LINE_COL_BLUE */ 0 ,
+/* IVI_D_LINEWIDTH */ 2 ,
+/* IVI_D_LINESTYLE */ WXD_LS_SOLID ,
+/* IVI_D_STYLE_VALUE */ 4 ,
+/* IVI_D_JOIN_STYLE */ WXD_LJ_MITERED ,
+/* IVI_D_MITER_LIMIT */ 8 ,
+/* IVI_D_CAP_STYLE */ WXD_LC_BUTTED ,
+/* IVI_D_AHF_TYPE */ 0 ,
+/* IVI_D_AHF_LENGTH */ 16 ,
+/* IVI_D_AHF_WIDTH */ 8 ,
+/* IVI_D_AHB_TYPE */ 0 ,
+/* IVI_D_AHB_LENGTH */ 16 ,
+/* IVI_D_AHB_WIDTH */ 8 ,
+/* IVI_D_FILL_COL_RED */ 255 ,
+/* IVI_D_FILL_COL_GREEN */ 255 ,
+/* IVI_D_FILL_COL_BLUE */ 255 ,
+/* IVI_D_FILL_STYLE */ WXD_FS_NONE ,
+/* IVI_D_TEXT_LATEX */ 1 ,
+/* IVI_D_TEXT_ALIGN */ WXD_TEXT_ALIGN_LEFT ,
+/* IVI_D_TEXT_FONT */ 0 ,
+/* IVI_D_TEXT_SIZE */ 12 ,
+/* IVI_C_GRID */ 1 ,
+/* IVI_C_PH */ 0 ,
+/* IVI_C_COR_POSITION */ 1 ,
+};
+/* IMPORTANT: Number and order of entries here must match the order in the
+ m_iv member array and the iv_keys array below!
+*/
+
+
+
+/* IMPORTANT: Number and order of entries here must match the
+ order in the default_values and m_iv arrays!
+*/
+/** Keys to save and restore the int values.
+*/
+static const wxChar * const iv_keys[] = {
+$!string-table macro=wxT
+#
+# 0 - 2 Border colour
+#
+colour.border.red
+colour.border.green
+colour.border.blue
+#
+# 3 - 5 Background colour
+#
+colour.background.red
+colour.background.blue
+colour.background.green
+#
+# 6 - 8 Grid colour
+#
+colour.grid.red
+colour.grid.green
+colour.grid.blue
+#
+# 9 - 11 Placement help
+#
+colour.placement-help.red
+colour.placement-help.green
+colour.placement-help.blue
+#
+# 12 - 14 Modification operation: Copy
+#
+colour.modify.copy.red
+colour.modify.copy.green
+colour.modify.copy.blue
+#
+# 15 - 17 Modification operation: Move
+#
+colour.modify.move.red
+colour.modify.move.green
+colour.modify.move.blue
+#
+# 18 - 20 Modification operation: Delete
+#
+colour.modify.delete.red
+colour.modify.delete.green
+colour.modify.delete.blue
+#
+# 21 - 23 Modification operation: Group
+#
+colour.modify.group.red
+colour.modify.group.green
+colour.modify.group.blue
+#
+# 24 - 26 Markup for missing image file
+#
+colour.markup.missing-image.red
+colour.markup.missing-image.green
+colour.markup.missing-image.blue
+#
+# 27 Bezier spline segments per X-spline sub-segment
+#
+config.x-spline.sub-segments
+#
+# 28 Flag: Use exact font for text representation
+#
+config.text.font.exact
+#
+# 29 Diameter of filled dots in multiples of the base line width
+#
+config.dot.filled.diameter
+#
+# 30 Diameter of white-filled dots in multiples of base line width
+#
+config.dot.white.diameter
+#
+# 31 - 32 Length and width of arrowheads
+#
+config.arrowhead.length
+config.arrowhead.width
+#
+# 33 Dash length in multiples of the line width
+#
+config.line.dash.length
+#
+# 34 Miter limit for mitered line join
+#
+config.join.miter-limit
+#
+# 35 Flag: Reduce size of point markup for point-related operations
+#
+config.markup-point.reduce-size
+#
+# 36 Default layer
+#
+default.layer
+#
+# 37 - 39 Default line and text colour
+#
+default.colour.stroke.red
+default.colour.stroke.green
+default.colour.stroke.blue
+#
+# 40 Default line width
+#
+default.line.width
+#
+# 41 - 42 Default line style and style length
+#
+default.line.style
+default.line.dash.length
+#
+# 43 - 44 Join style and miter limit
+#
+default.join.style
+default.join.miter-limit
+#
+# 45 Line cap style
+#
+default.cap.style
+#
+# 46 - 48 Arrowhead forward
+#
+default.arrowhead.forward.type
+default.arrowhead.forward.length
+default.arrowhead.forward.width
+#
+# 49 - 51 Arrowhead backward
+#
+default.arrowhead.backward.type
+default.arrowhead.backward.length
+default.arrowhead.backward.width
+#
+# 52 - 55 Fill colour and fill style
+#
+default.colour.fill.red
+default.colour.fill.green
+default.colour.fill.blue
+default.fill.style
+#
+# 56 - 59 Default text setup
+#
+default.text.latex
+default.text.align
+default.text.font
+default.text.size
+#
+# 60 - 61 Configuration items for grid and placement help
+#
+config.grid.enable
+config.placement-help.enable
+#
+# 62 Correct position after zooming out
+#
+config.zoom-out.correct-position
+$!end
+};
+/* IMPORTANT: Number and order of entries here must match the
+ order in the default_values and m_iv arrays!
+*/
+
+
+
+/** Correct given int value v to a range specified by minimum and maximum.
+ @param min Range minimum.
+ @param max Range maximum.
+ @param v Value to correct if necessary.
+ @return Corrected value.
+*/
+static
+int
+i_to_range(int min, int max, int v)
+{
+ if (min > v) { v = min; }
+ if (max < v) { v = max; }
+ return v;
+}
+
+
+
+/** Correct given int value v to an unsigned range specified by minimum
+ and maximum.
+ @param min Range minimum.
+ @param max Range maximum.
+ @param v Value to correct if necessary.
+ @return Corrected value.
+*/
+static
+unsigned
+u_to_range(unsigned min, unsigned max, int v)
+{
+ unsigned back;
+
+ if (0 <= v) {
+ back = (unsigned)v;
+ }
+ else {
+ back = 0U;
+ }
+ if (min > back) { back = min; }
+ if (max < back) { back = max; }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::DefaultStyleToArray(void)
+{
+ $? "+ DefaultStyleToArray"
+ m_iv[IVI_D_LAYER] = m_oStyle.lay;
+ m_iv[IVI_D_LINE_COL_RED] = m_oStyle.sc[0] ;
+ m_iv[IVI_D_LINE_COL_GREEN] = m_oStyle.sc[1] ;
+ m_iv[IVI_D_LINE_COL_BLUE] = m_oStyle.sc[2] ;
+ m_iv[IVI_D_LINEWIDTH] = m_oStyle.lw ;
+ m_iv[IVI_D_LINESTYLE] = m_oStyle.ls ;
+ m_iv[IVI_D_STYLE_VALUE] = m_oStyle.sl ;
+ m_iv[IVI_D_JOIN_STYLE] = m_oStyle.js ;
+ m_iv[IVI_D_MITER_LIMIT] = m_oStyle.ml ;
+ m_iv[IVI_D_CAP_STYLE] = m_oStyle.cs ;
+ m_iv[IVI_D_AHF_TYPE] = m_oStyle.aft ;
+ m_iv[IVI_D_AHF_LENGTH] = m_oStyle.afl ;
+ m_iv[IVI_D_AHF_WIDTH] = m_oStyle.afw ;
+ m_iv[IVI_D_AHB_TYPE] = m_oStyle.abt ;
+ m_iv[IVI_D_AHB_LENGTH] = m_oStyle.abl ;
+ m_iv[IVI_D_AHB_WIDTH] = m_oStyle.abw ;
+ m_iv[IVI_D_FILL_COL_RED] = m_oStyle.fc[0] ;
+ m_iv[IVI_D_FILL_COL_GREEN] = m_oStyle.fc[1] ;
+ m_iv[IVI_D_FILL_COL_BLUE] = m_oStyle.fc[2] ;
+ m_iv[IVI_D_FILL_STYLE] = m_oStyle.fs ;
+ m_iv[IVI_D_TEXT_LATEX] = m_oStyle.det.t.fl ;
+ m_iv[IVI_D_TEXT_ALIGN] = m_oStyle.det.t.al ;
+ m_iv[IVI_D_TEXT_FONT] = m_oStyle.det.t.find ;
+ m_iv[IVI_D_TEXT_SIZE] = m_oStyle.det.t.fsz ;
+ $? "- DefaultStyleToArray"
+}
+
+
+
+void
+WxdkdrawFrame::DefaultStyleFromArray(void)
+{
+ $? "+ DefaultStyleFromArray"
+ m_oStyle.lay = (int16_t)i_to_range(
+ DK4_I16_MIN, DK4_I16_MAX, m_iv[IVI_D_LAYER]
+ );
+ m_oStyle.sc[0] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_LINE_COL_RED]
+ );
+ m_oStyle.sc[1] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_LINE_COL_GREEN]
+ );
+ m_oStyle.sc[2] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_LINE_COL_BLUE]
+ );
+ m_oStyle.lw = (uint16_t)u_to_range(
+ 0U, DK4_U16_MAX, m_iv[IVI_D_LINEWIDTH]
+ );
+ m_oStyle.ls = (uint8_t)u_to_range(
+ WXD_LS_SOLID, WXD_LS_DASH_DOT_DOT_DOT, m_iv[IVI_D_LINESTYLE]
+ );
+ m_oStyle.sl = (uint8_t)u_to_range(
+ 1U, 255U, m_iv[IVI_D_STYLE_VALUE]
+ );
+ m_oStyle.js = (uint8_t)u_to_range(
+ WXD_LJ_MITERED, WXD_LJ_BEVELED, m_iv[IVI_D_JOIN_STYLE]
+ );
+ m_oStyle.ml = (uint8_t)u_to_range(
+ 1U, 255U, m_iv[IVI_D_MITER_LIMIT]
+ );
+ m_oStyle.cs = (uint8_t)u_to_range(
+ WXD_LC_BUTTED, WXD_LC_PROJECTING, m_iv[IVI_D_CAP_STYLE]
+ );
+ m_oStyle.aft = (uint8_t)u_to_range(
+ 0U, 29U, m_iv[IVI_D_AHF_TYPE]
+ );
+ m_oStyle.afl = (uint8_t)u_to_range(
+ 2U, 255U, m_iv[IVI_D_AHF_LENGTH]
+ );
+ m_oStyle.afw = (uint8_t)u_to_range(
+ 2U, 255U, m_iv[IVI_D_AHF_WIDTH]
+ );
+ m_oStyle.abt = (uint8_t)u_to_range(
+ 0U, 29U, m_iv[IVI_D_AHB_TYPE]
+ );
+ m_oStyle.abl = (uint8_t)u_to_range(
+ 2U, 255U, m_iv[IVI_D_AHB_LENGTH]
+ );
+ m_oStyle.abw = (uint8_t)u_to_range(
+ 2U, 255U, m_iv[IVI_D_AHB_WIDTH]
+ );
+ m_oStyle.fc[0] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_FILL_COL_RED]
+ );
+ m_oStyle.fc[1] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_FILL_COL_GREEN]
+ );
+ m_oStyle.fc[2] = (uint8_t)u_to_range(
+ 0U, 255U, m_iv[IVI_D_FILL_COL_BLUE]
+ );
+ m_oStyle.fs = (uint8_t)u_to_range(
+ WXD_FS_NONE, WXD_FS_VERTICAL_TIRES, m_iv[IVI_D_FILL_STYLE]
+ );
+ m_oStyle.det.t.fl = (uint8_t)u_to_range(
+ 0U, 1U, m_iv[IVI_D_TEXT_LATEX]
+ );
+ m_oStyle.det.t.al = (uint8_t)u_to_range(
+ WXD_TA_LEFT, WXD_TA_RIGHT, m_iv[IVI_D_TEXT_ALIGN]
+ );
+ m_oStyle.det.t.find = (uint8_t)u_to_range(
+ 0U, 34U, m_iv[IVI_D_TEXT_FONT]
+ );
+ m_oStyle.det.t.fsz = (uint16_t)u_to_range(
+ 1U, DK4_U16_MAX, m_iv[IVI_D_TEXT_SIZE]
+ );
+ $? "- DefaultStyleFromArray"
+}
+
+
+
+void
+WxdkdrawFrame::LoadDefaults(void)
+{
+ DK4_MEMCPY(m_iv,default_values,((size_t)(IVI_MAX)*sizeof(int)));
+}
+
+
+
+void
+WxdkdrawFrame::LoadConfiguration(void)
+{
+ LoadDefaults();
+ DefaultStyleToArray();
+ pAppHelp->GetMultiple(iv_keys ,m_iv, IVI_MAX);
+ DefaultStyleFromArray();
+ cbGridOnOff->SetValue((0 != m_iv[IVI_C_GRID]));
+ cbPH->SetValue((0 != m_iv[IVI_C_PH]));
+}
+
+
+
+void
+WxdkdrawFrame::SaveConfiguration(void)
+{
+ DefaultStyleToArray();
+ m_iv[IVI_C_GRID] = ((cbGridOnOff->GetValue()) ? 1 : 0);
+ m_iv[IVI_C_PH] = ((cbPH->GetValue()) ? 1 : 0);
+ pAppHelp->SetMultiple(iv_keys ,m_iv, IVI_MAX);
+}
+
+
+
+void
+WxdkdrawFrame::ResetConfiguration(void)
+{
+ LoadDefaults();
+ wxdobj_obj_init(&m_oStyle, WXD_OT_TEXT, NULL);
+}
+
+
+
+void
+WxdkdrawFrame::ColorModify(size_t ivi, int rdl)
+{
+ wxColour curcol(m_iv[ivi], m_iv[ivi + 1], m_iv[ivi + 2]);
+ wxColourData wxcd;
+ $? "+ ColorModify"
+ wxcd.SetColour(curcol);
+ wxColourDialog dlg(this, &wxcd);
+
+ if (wxID_OK == dlg.ShowModal()) {
+ wxColour col = dlg.GetColourData().GetColour();
+ m_iv[ivi ] = col.Red();
+ m_iv[ivi + 1] = col.Green();
+ m_iv[ivi + 2] = col.Blue();
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ }
+ $? "- ColorModify"
+}
+
+
+
+void
+WxdkdrawFrame::ColorReset(size_t ivi, int rdl)
+{
+ $? "+ ColorReset"
+ DK4_MEMCPY(&(m_iv[ivi]),&(default_values[ivi]),(3*sizeof(int)));
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ $? "- ColorReset"
+}
+
+
+
+bool
+WxdkdrawFrame::FindDirectoryForFile(wxChar *dnb, size_t dnsz, wxString & fn)
+{
+ wxChar const *fnstr = NULL;
+ wxChar const *cwdstr = NULL;
+ wxChar *ptr = NULL;
+ size_t lgt = (size_t)0U;
+ bool back = false;
+ $? "+ FindDirectoryForFile"
+ if ((NULL != dnb) && ((size_t)0U < dnsz)) {
+ dnb[0] = wxT('\0');
+ wxCStrData strd = fn.c_str();
+ fnstr = (wxChar const *)strd;
+ if (NULL != fnstr) {
+ lgt = dk4strx_len(fnstr);
+ if ((size_t)0U < lgt) {
+ if (lgt < dnsz) {
+ dk4strx_cpy_s(dnb, dnsz, fnstr, NULL);
+#if DK4_HAVE_BACKSLASH_AS_SEP
+ ptr = dk4strx_rchr(dnb, wxT('\\'));
+#else
+ ptr = dk4strx_rchr(dnb, wxT('/'));
+#endif
+ if (NULL != ptr) {
+ *ptr = wxT('\0');
+ back = true;
+ $? ". \"%!ws\"", dnb
+ }
+ else { $? ". no sep found"
+ wxString cwd = ::wxGetCwd();
+ {
+ wxCStrData strwcd = cwd.c_str();
+ {
+ cwdstr = (wxChar const *)strwcd;
+ if (NULL != cwdstr) {
+ lgt = dk4strx_len(cwdstr);
+ if ((size_t)0U < lgt) {
+ if (lgt < dnsz) {
+ dk4strx_cpy_s(dnb,dnsz,cwdstr,NULL);
+ back = true;
+ $? ". \"%!ws\"", cwdstr
+ }
+ else { $? "! string too long"
+ /* ERROR: CWD too long */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport,
+ WXD_E_CWD_TOO_LONG
+ );
+ }
+ }
+ else { $? "! empty string"
+ /* ERROR: No current dir */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport,
+ WXD_E_NO_CWD
+ );
+ }
+ }
+ else { $? "! no string"
+ /* ERROR: No current dir */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_NO_CWD
+ );
+ }
+ }
+ }
+ }
+ }
+ else { $? "! string too long"
+ /* ERROR: Output file name too long */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OUTPUT_FN_TOO_LONG
+ );
+ }
+ }
+ else { $? "! empty string"
+ /* ERROR: Failed to find directory for file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OUTPUT_DIRNAME
+ );
+ }
+ }
+ else { $? "! no string"
+ /* ERROR: Failed to find directory for file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OUTPUT_DIRNAME
+ );
+ }
+ }
+ else { $? "! illegal arguments"
+ } $? "- FindDirectoryForFile %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::SaveToFile(void)
+{
+ wxChar fnbuf[DK4_MAX_PATH]; /* File name current dir */
+ wxdwr_status_t wrst; /* Writer status */
+ wxString sNewTitle = wxEmptyString; /* New program window title */
+ wxString sDlgTitle(sTexts[171]); /* Dialog title */
+ wxString sDlgTypes(sTexts[172]); /* File type suffixes */
+ FILE *fipo; /* File for output */
+ int res; /* Save operation result */
+ bool cc = true; /* Flag: Can continue */
+ bool back = false;
+ $? "+ SaveToFile"
+ if (!(m_bHaveName)) {
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDlgTitle, m_sFileDir, m_sFileShort,
+ sDlgTypes, (wxFD_SAVE | wxFD_OVERWRITE_PROMPT)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDlgTitle, m_sFileDir, m_sFileShort,
+ sDlgTypes, wxSAVE
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ m_sFileFull = dlg.GetPath();
+ m_sFileDir = dlg.GetDirectory();
+ m_sFileShort = dlg.GetFilename();
+ m_bHaveName = true;
+ if (m_bModified) {
+ sNewTitle.Append(sTexts[170]);
+ sNewTitle.Append(m_sFileShort);
+ SetTitle(sNewTitle);
+ }
+ else {
+ SetTitle(m_sFileShort);
+ }
+ m_bUpdate = true;
+ }
+ else {
+ cc = false;
+ }
+ }
+ if (m_bHaveName && cc) {
+ cc = FindDirectoryForFile(fnbuf, DK4_SIZEOF(fnbuf,wxChar), m_sFileFull);
+ if (!(cc)) {
+ /* ##### ERROR: Failed to find directory */
+ }
+ }
+ if (m_bHaveName && cc) { $? ". can save"
+ wxFFile wxff(m_sFileFull, wxT("w"));
+ if (wxff.IsOpened()) { $? ". file is opened"
+ fipo = wxff.Detach();
+ if (NULL != fipo) { $? ". file is opened"
+ back = true;
+ wxdwr_status_init(&wrst, pAppHelp->GetWxEncoding());
+ wrst.dirn = fnbuf;
+ res = wxdwr_write_file(fipo, m_pDrw, &wrst);
+ wrst.dirn = NULL;
+ if (0 == res) { $? "! failed"
+ back = false;
+ switch (wrst.ec) {
+ case WXDWR_E_WRITE : { $? "! write op"
+ /* ERROR: Write operation failed */
+ wxMessageBox(
+ sTexts[204], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ } break;
+ case WXDWR_E_STRING_TOO_LONG : { $? "! str too long"
+ /* ERROR: String too long */
+ if (NULL != wrst.str) {
+ wxString msg = wxString(sTexts[205]);
+ msg.Append(wxString(wrst.str));
+ msg.Append(wxString(sTexts[206]));
+ wxMessageBox(
+ msg, sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ else {
+ wxMessageBox(
+ sTexts[207], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ } break;
+ case WXDWR_E_RECODE_TEXT : { $? "! recode string"
+ /* ERROR: Failed to recode text */
+ if (NULL != wrst.str) {
+ wxString msg = wxString(sTexts[208]);
+ msg.Append(wxString(wrst.str));
+ msg.Append(wxString(sTexts[209]));
+ wxMessageBox(
+ msg, sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ else {
+ wxMessageBox(
+ sTexts[210], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+
+ } break;
+ case WXDWR_E_RECODE_FILENAME : { $? "! recode fname"
+ /* ERROR: Failed to recode file name */
+ if (NULL != wrst.str) {
+ wxString msg = wxString(sTexts[211]);
+ msg.Append(wxString(wrst.str));
+ msg.Append(wxString(sTexts[212]));
+ wxMessageBox(
+ msg, sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ else {
+ wxMessageBox(
+ sTexts[213], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ } break;
+ case WXDWR_E_STRING_EMPTY : { $? "! empty string"
+ /* ERROR: Empty string not expected */
+ wxMessageBox(
+ sTexts[214], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ } break;
+ default : { $? "! any other"
+ /* ERROR: Unknown reason */
+ wxMessageBox(
+ sTexts[215], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ } break;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". successfully written"
+ }
+#endif
+ if (0 != fclose(fipo)) { $? "! fclose"
+ if (back) {
+ /* ERROR: Failed to write to file */
+ wxMessageBox(
+ sTexts[204], sTexts[202],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ back = false;
+ }
+#if TRACE_DEBUG
+ else { $? ". successfully closed"
+ }
+#endif
+ }
+ else { $? "! NULL returned"
+ /* ERROR: Failed to open file */
+ wxMessageBox(
+ sTexts[203], sTexts[202], (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ else { $? "! file not opened"
+ /* ERROR: Failed to open file */
+ wxMessageBox(
+ sTexts[203], sTexts[202], (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ if (back) {
+ SetTitle(m_sFileShort);
+ SetModified(false);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! no file name"
+ }
+#endif
+ $? "- SaveToFile %d", ((back) ? 1 : 0)
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::SetModified(bool f)
+{
+$? "+ SetModified"
+if (f != m_bModified) {
+ if (f) {
+ wxString s = wxEmptyString;
+ s.Append(sTexts[170]);
+ if (m_bHaveName) {
+ s.Append(m_sFileShort);
+ }
+ else {
+ s.Append(sTexts[18]);
+ }
+ SetTitle(s);
+ }
+ else {
+ if (m_bHaveName) {
+ SetTitle(m_sFileShort);
+ }
+ else {
+ SetTitle(sTexts[18]);
+ }
+ }
+ m_bModified = f;
+ m_bUpdate = true;
+}
+$? "- SetModified"
+}
+
+
+
+
+wxSize
+WxdkdrawFrame::ColourViewSize(void)
+{
+int sl = 20;
+if (NULL != bFileOpen) {
+ sl = (bFileOpen->GetClientSize()).GetHeight();
+}
+$? "= ColourViewSize %d %d", sl, sl
+return(wxSize(sl,sl));
+}
+
+
+
+Wxd_drawing_t *
+WxdkdrawFrame::ReadDrawingFromFile(wxString & fn)
+{
+ wxChar dirnb[DK4_MAX_PATH];
+ Wxd_drawing_t *back = NULL; /* Function result */
+ FILE *fp = NULL; /* File to read from */
+ bool haved = false; /* Have directory name */
+ $? "+ ReadDrawingFromFile"
+ wxFFile wxff(fn);
+ haved = FindDirectoryForFile(dirnb, DK4_SIZEOF(dirnb,wxChar), fn);
+ if (wxff.IsOpened()) {
+ fp = wxff.Detach();
+ if (NULL != fp) {
+ $? ". initialize m_oStatusReader"
+ wxdrd_status_init(&m_oStatusReader);
+ if (haved) {
+ m_oStatusReader.dirn = dirnb;
+ }
+ else {
+ m_oStatusReader.dirn = NULL;
+ }
+ back = wxdrd_read_file(fp, &m_oStatusReader);
+ m_oStatusReader.dirn = NULL;
+ fclose(fp);
+ if (NULL != back) {
+ wxdobj_drw_set_xsubs(back, (size_t)(m_iv[IVI_XS_SUBSEGS]));
+ wxdobj_bb_for_drawing(back);
+ }
+ else {
+ /* ERROR: Failed to read file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_READ_FILE
+ );
+ }
+ }
+ else { $? "! open"
+ /* ERROR: Failed to open file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ }
+ }
+ else { $? "! open"
+ /* ERROR: Failed to open file */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ }
+ $? "- ReadDrawingFromFile %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::UpdateImages(void)
+{
+ Wxd_object_t *pobj;
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (NULL != pobj) {
+ if (WXD_OT_IMAGE == pobj->ot) {
+ if (NULL != (pobj->det).i.fn) {
+ if (NULL == (pobj->det).i.bm) {
+ wxdobj_load_image(
+ pobj,
+ pAppHelp->GetDkEncoding(),
+ pAppHelp->GetWxEncoding()
+ );
+ }
+ }
+ }
+ }
+ } while (NULL != pobj);
+}
+
+
+
+void
+WxdkdrawFrame::DrawingLoaded(void)
+{
+ /* No operation started on new drawing yet
+ */
+ m_iState = S_NOOP;
+ m_iWheelControl = 0;
+ m_iWheelShift = 0;
+ m_iWheelNormal = 0;
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ /* Zoom factor and grid distances
+ */
+ drawco->CalculateZoomFactor();
+ {
+ wxString s;
+ s.Printf("%g", drawco->m_dZoom);
+ lZoomPercent->SetLabel(s);
+ lZoomPercent->Refresh();
+ m_bUpdate = true;
+ }
+ /* Update coefficients for fill patterns
+ */
+ UpdateStipples();
+ UpdateFonts();
+ szTopBar->Layout();
+ lZoomPercent->Refresh();
+ UpdateImages();
+ /* Coordinates conversion coefficients
+ */
+ drawco->CalculateConversionCoefficients();
+
+ /* Grid setup to GUI
+ */
+ if (NULL != m_pDrw) {
+ if ((uint8_t)0U != m_pDrw->gridunit) {
+ cbGridUnit->SetSelection(1);
+ }
+ else {
+ cbGridUnit->SetSelection(0);
+ }
+ if ((uint8_t)0U != m_pDrw->gridbase) {
+ cbGridBase->SetSelection(1);
+ }
+ else {
+ cbGridBase->SetSelection(0);
+ }
+ cbGridUnit->Refresh();
+ cbGridBase->Refresh();
+ m_bUpdate = true;
+ }
+
+ /* Calculate grid
+ */
+ drawco->CalculateGridDistances();
+
+ /* Required width and height
+ */
+
+ /* Scrollbar positions
+ */
+ AdjustScrollbars();
+
+ /* GUI attributes object
+ */
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ m_iWheelControl = 0;
+ m_iWheelShift = 0;
+ m_iWheelNormal = 0;
+ m_uCurrent = 0;
+ m_iObjToCreate = -1;
+ m_bSplineInterpolated = false;
+ m_bModified = false;
+ m_bMouseDiff = false; $? ". m_bMouseDiff = false"
+
+ drawco->Refresh();
+ m_bUpdate = true;
+}
+
+
+
+void
+WxdkdrawFrame::ModificationReportingAtEventEnd(void)
+{
+ if (DK4_E_NONE == m_oErrorReport.ec) {
+ if (0 != m_oStatusReader.mod) {
+ SetModified();
+ wxMessageBox(
+ sTexts[600], sTexts[599],
+ (wxOK | wxCENTRE | wxICON_INFORMATION)
+ );
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::OnFirstIdle(void)
+{
+ Wxd_drawing_t *pDrw;
+ $? "+ OnFirstIdle"
+ $? ". initialize m_oStatusReader"
+ wxdrd_status_init(&m_oStatusReader);
+ dk4error_init(&m_oErrorReport);
+ m_pDrw = wxdobj_drw_new();
+ if (m_bHaveName) {
+ wxFileName wxfn(m_sFileFull);
+ SetTitle(m_sFileShort);
+ if (wxfn.IsFileReadable()) {
+ pDrw = ReadDrawingFromFile(m_sFileFull);
+ if (NULL != pDrw) {
+ wxdobj_drw_delete(m_pDrw);
+ m_pDrw = pDrw;
+ m_bHaveName = true;
+ m_bUpdate = true;
+ }
+ else { $? "! failed to read file"
+ /* ERROR: Failed to read file, already reported */
+ }
+ }
+ else { $? "! not a readable file"
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_FAILED_TO_OPEN_FILE
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". no file name specified"
+ }
+#endif
+ /* If drawing was read, set frame as active (ready for events).
+ Otherwise show error message and exit application.
+ */
+ if (NULL != m_pDrw) {
+ m_bActive = true;
+ DrawingLoaded();
+ szTopBar->Layout();
+ SetStatusText(sTexts[531]);
+ Refresh();
+ Update();
+ }
+ else {
+ Close();
+ }
+ ModificationReportingAtEventEnd();
+ ErrorReportingAtEventEnd();
+ dk4error_init(&m_oErrorReport);
+ $? ". initialize m_oStatusReader"
+ wxdrd_status_init(&m_oStatusReader);
+ $? "- OnFirstIdle"
+}
+
+
+
+static
+int32_t i32_avg(int32_t a, int32_t b, dk4_er_t *erp)
+{
+ dk4_er_t er;
+ int32_t back = (int32_t)0L;
+
+ dk4error_init(&er);
+ back = dk4ma_int32_t_add(a, b, &er) / ((int32_t)2L);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_init(&er);
+ back = dk4ma_int32_t_add(
+ a,
+ (dk4ma_int32_t_sub(b, a, &er) / ((int32_t)2L)),
+ &er
+ );
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::CorrectCenterPointIfNecessary(void)
+{
+ dk4_er_t er;
+ int32_t xcmin; /* Minimum value for center x position */
+ int32_t xcmax; /* Maximum value for center x position */
+ int32_t ycmin; /* Minimum value for center y position */
+ int32_t ycmax; /* Maximum value for center y position */
+ int32_t deltax; /* X difference border to center */
+ int32_t deltay; /* Y difference border to center */
+ $? "+ CorrectCenterPointIfNecessary"
+ dk4error_init(&er);
+ deltax = dk4ma_int32_from_double(
+ (
+ (16256000.0 * (double)((drawco->m_szDrawco).GetWidth()))
+ / (2.0 * drawco->m_dZoom * (drawco->m_ptRes).x)
+ ), &er
+ );
+ deltay = dk4ma_int32_from_double(
+ (
+ (16256000.0 * (double)((drawco->m_szDrawco).GetHeight()))
+ / (2.0 * drawco->m_dZoom * (drawco->m_ptRes).y)
+ ), &er
+ );
+ xcmin = dk4ma_int32_t_add(
+ dk4ma_int32_t_sub(
+ (m_pDrw->bb).xl,
+ dk4ma_int32_from_double((double)(m_pDrw->bleft), &er),
+ &er
+ ), deltax, &er
+ );
+ xcmax = dk4ma_int32_t_sub(
+ dk4ma_int32_t_add(
+ (m_pDrw->bb).xr,
+ dk4ma_int32_from_double((double)(m_pDrw->bright), &er),
+ &er
+ ), deltax, &er
+ );
+ ycmin = dk4ma_int32_t_add(
+ dk4ma_int32_t_sub(
+ (m_pDrw->bb).yb,
+ dk4ma_int32_from_double((double)(m_pDrw->bbottom), &er),
+ &er
+ ), deltay, &er
+ );
+ ycmax = dk4ma_int32_t_sub(
+ dk4ma_int32_t_add(
+ (m_pDrw->bb).yt,
+ dk4ma_int32_from_double((double)(m_pDrw->btop), &er),
+ &er
+ ), deltay, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ /*
+ X correction
+ */
+ if (xcmax > xcmin) {
+ if (m_pDrw->cx < xcmin) {
+ m_pDrw->cx = xcmin;
+ }
+ else {
+ if (m_pDrw->cx > xcmax) {
+ m_pDrw->cx = xcmax;
+ }
+ }
+ }
+ else {
+ if (xcmax == xcmin) {
+ m_pDrw->cx = xcmin;
+ }
+ else {
+ xcmin = i32_avg((m_pDrw->bb).xl, (m_pDrw->bb).xr, &er);
+ if (DK4_E_NONE == er.ec) {
+ m_pDrw->cx = xcmin;
+ }
+ }
+ }
+ /*
+ Y correction
+ */
+ if (ycmax > ycmin) {
+ if (m_pDrw->cy < ycmin) {
+ m_pDrw->cy = ycmin;
+ }
+ else {
+ if (m_pDrw->cy > ycmax) {
+ m_pDrw->cy = ycmax;
+ }
+ }
+ }
+ else {
+ if (ycmax == ycmin) {
+ m_pDrw->cy = ycmin;
+ }
+ else {
+ dk4error_init(&er);
+ ycmin = i32_avg((m_pDrw->bb).yb, (m_pDrw->bb).yt, &er);
+ if (DK4_E_NONE == er.ec) {
+ m_pDrw->cy = ycmin;
+ }
+ }
+ }
+ }
+ else { $? "! math error"
+ }
+ $? "- CorrectCenterPointIfNecessary"
+}
+
+
+
+void
+WxdkdrawFrame::ZoomChanged(bool bZoomOut)
+{
+ drawco->CalculateZoomFactor();
+ {
+ wxString s;
+ s.Printf("%g", drawco->m_dZoom);
+ lZoomPercent->SetLabel(s);
+ }
+ UpdateStipples();
+ UpdateFonts();
+ szTopBar->Layout();
+ lZoomPercent->Refresh();
+ if (bZoomOut && (0 != m_iv[IVI_C_COR_POSITION])) {
+ CorrectCenterPointIfNecessary();
+ }
+ drawco->CalculateConversionCoefficients();
+ AdjustScrollbars();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+}
+
+
+
+void
+WxdkdrawFrame::AdjustScrollbars(void)
+{
+ dk4_er_t er; /* Error report */
+ int xPos; /* Horizontal scrolblar position */
+ int yPos; /* Vertical scrollbar position */
+ int xThumb; /* Thumb size width (control width) */
+ int yThumb; /* Thumb size height (control height) */
+ int xRange; /* Range (required pixels) */
+ int yRange; /* Range (required pixels) */
+ int xPageSize; /* Pixels to scroll for page */
+ int yPageSize; /* Pixels to scroll for page */
+ bool bEnableX = false; /* Enable horizontal scrollbar */
+ bool bEnableY = false; /* Enable vertical scrollbar */
+ $? "+ AdjustScrollbars"
+ dk4error_init(&er);
+ xThumb = (drawco->m_szDrawco).GetWidth();
+ yThumb = (drawco->m_szDrawco).GetHeight();
+ xRange = dk4ma_int_from_double(
+ ceil(
+ (
+ (
+ (double)((m_pDrw->bb).xr) - (double)((m_pDrw->bb).xl)
+ + (double)(m_pDrw->bleft) + (double)(m_pDrw->bright)
+ ) * (drawco->m_ptRes).x * drawco->m_dZoom
+ ) / RESWXD
+ ), &er
+ );
+ yRange = dk4ma_int_from_double(
+ ceil(
+ (
+ (
+ (double)((m_pDrw->bb).yt) - (double)((m_pDrw->bb).yb)
+ + (double)(m_pDrw->bbottom) + (double)(m_pDrw->btop)
+ ) * (drawco->m_ptRes).y * drawco->m_dZoom
+ ) / RESWXD
+ ), &er
+ );
+ xPageSize = dk4ma_int_mul(xThumb, 4, &er) / 5;
+ yPageSize = dk4ma_int_mul(yThumb, 4, &er) / 5;
+ xPos = dk4ma_int_from_double(
+ dk4ma_rint(
+ (
+ (
+ (
+ (double)(m_pDrw->cx) - (double)((m_pDrw->bb).xl)
+ + (double)(m_pDrw->bleft)
+ ) * (drawco->m_ptRes).x * drawco->m_dZoom
+ ) / RESWXD
+ ) - ((double)xThumb / 2.0)
+ ), &er
+ );
+ yPos = dk4ma_int_from_double(
+ dk4ma_rint(
+ (
+ (
+ (
+ (double)((m_pDrw->bb).yt) - (double)(m_pDrw->cy)
+ + (double)(m_pDrw->btop)
+ ) * (drawco->m_ptRes).y * drawco->m_dZoom
+ ) / RESWXD
+ ) - ((double)yThumb / 2.0)
+ ), &er
+ );
+ if (0 > xPos) { xPos = 0; }
+ if (0 > yPos) { yPos = 0; }
+ if ((xRange - xThumb) < xPos) { xPos = xRange - xThumb; }
+ if ((yRange - yThumb) < yPos) { yPos = yRange - yThumb; }
+ if (DK4_E_NONE == er.ec) {
+ if (xRange > xThumb) {
+ bEnableX = true;
+ }
+ if (yRange > yThumb) {
+ bEnableY = true;
+ }
+ }
+ /* Set up horizontal scrollbar
+ */
+ if (bEnableX) {
+ if (!(sbHori->IsEnabled())) {
+ sbHori->Enable();
+ }
+ $? ". xPos = %d", xPos
+ $? ". xThumb = %d", xThumb
+ $? ". xRange = %d", xRange
+ $? ". xPageSize = %d", xPageSize
+ sbHori->SetScrollbar(xPos, xThumb, xRange, xPageSize, true);
+ sbHori->SetThumbPosition(xPos);
+ sbHori->Refresh();
+ }
+ else {
+ if (sbHori->IsEnabled()) {
+ sbHori->Enable(false);
+ sbHori->Refresh();
+ }
+ }
+ /* Set up vertical scrollbar
+ */
+ if (bEnableY) {
+ if (!(sbVert->IsEnabled())) {
+ sbVert->Enable();
+ }
+ $? ". yPos = %d", yPos
+ $? ". yThumb = %d", yThumb
+ $? ". yRange = %d", yRange
+ $? ". yPageSize = %d", yPageSize
+ sbVert->SetScrollbar(yPos, yThumb, yRange, yPageSize, true);
+ sbVert->SetThumbPosition(yPos);
+ sbVert->Refresh();
+ }
+ else {
+ if (sbVert->IsEnabled()) {
+ sbVert->Enable(false);
+ sbVert->Refresh();
+ }
+ } $? "- AdjustScrollbars"
+}
+
+
+
+void
+WxdkdrawFrame::StartEventHandling(void)
+{
+ dk4error_init(&m_oErrorReport);
+ m_bUpdate = false;
+}
+
+
+
+void
+WxdkdrawFrame::MoveScrollbar(wxScrollBar *sb, int lines, bool vert)
+{
+ int range; /* Scrollbar range (maximum) */
+#if 0
+ int ps; /* Page size */
+#endif
+ int pos; /* Position */
+ int ts; /* Thumb size */
+ $? "+ MoveScrollbar"
+ range = sb->GetRange();
+#if 0
+ ps = sb->GetPageSize();
+#endif
+ pos = sb->GetThumbPosition();
+ ts = sb->GetThumbSize();
+
+ if (range > ts) {
+ pos -= (lines * ts) / 10;
+ if (0 > pos) { pos = 0; }
+ if ((range - ts) <= pos) { pos = range - ts - 1; }
+ sb->SetThumbPosition(pos);
+ if (vert) {
+ UseScrollV();
+ }
+ else {
+ UseScrollH();
+ }
+ sb->Refresh();
+ sb->Update();
+ }
+ $? "- MoveScrollbar"
+}
+
+
+
+void
+WxdkdrawFrame::ControlMouseWheel(wxMouseEvent & event)
+{
+ int modifiers; /* Modifier keys */
+ int rotation; /* Rotation of wheel */
+ int delta; /* Required rotation for line */
+ int lines; /* Number of lines */
+ int8_t ozl;
+ $? "+ ControlMouseWheel"
+ StartEventHandling();
+ if (UpdateMousePosition(event)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ modifiers = event.GetModifiers();
+ rotation = event.GetWheelRotation();
+ delta = event.GetWheelDelta();
+ switch (modifiers) {
+ case wxMOD_CONTROL : {
+ m_iWheelControl += rotation;
+ lines = m_iWheelControl / delta;
+ m_iWheelControl -= (lines * delta);
+ ozl = m_pDrw->zl;
+ if (0 < lines) {
+ while (0 < lines--) {
+ if ((int8_t)(-14) < m_pDrw->zl) {
+ m_pDrw->zl -= (int8_t)1;
+ }
+ }
+ }
+ else {
+ if (0 > lines) {
+ while (0 > lines++) {
+ if ((int8_t)14 > m_pDrw->zl) {
+ m_pDrw->zl += (int8_t)1;
+ }
+ }
+ }
+ }
+ if (ozl != m_pDrw->zl) {
+ ZoomChanged((ozl > m_pDrw->zl));
+ UpdateGridPosition();
+ }
+ } break;
+ case wxMOD_SHIFT : {
+ m_iWheelShift += rotation;
+ lines = m_iWheelShift /delta;
+ m_iWheelShift -= (lines * delta);
+ if (sbHori->IsEnabled()) {
+ MoveScrollbar(sbHori, lines, false);
+ drawco->CalculateConversionCoefficients();
+ UpdateGridPosition();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ }
+ } break;
+ case wxMOD_NONE : {
+ m_iWheelNormal += rotation;
+ lines = m_iWheelNormal / delta;
+ m_iWheelNormal -= (lines * delta);
+ if (sbVert->IsEnabled()) {
+ MoveScrollbar(sbVert, lines, true);
+ drawco->CalculateConversionCoefficients();
+ UpdateGridPosition();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ }
+ } break;
+ }
+ $? "- ControlMouseWheel"
+ EndEventHandling();
+}
+
+
+
+void
+WxdkdrawFrame::UseScrollH(void)
+{
+ dk4_er_t er; /* Error report */
+ int32_t cx; /* Center x */
+ int tp; /* Thumb position */
+ int ts; /* Thumb size */
+#if 0
+ int r;
+ int p;
+#endif
+ $? "+ UseScrollH"
+#if 0
+ r = sbHori->GetRange();
+ p = sbHori->GetPageSize();
+#endif
+ tp = sbHori->GetThumbPosition();
+ ts = sbHori->GetThumbSize();
+ dk4error_init(&er);
+ cx = dk4ma_int32_from_double(
+ dk4ma_rint(
+ (
+ ((double)tp + (double)ts / 2.0) * RESWXD
+ ) / ((drawco->m_ptRes).x * drawco->m_dZoom)
+ ), &er
+ );
+ cx = dk4ma_int32_t_add(cx, (m_pDrw->bb).xl, &er);
+ cx = dk4ma_int32_t_sub(cx, m_pDrw->bleft, &er);
+ if (DK4_E_NONE == er.ec) {
+ m_pDrw->cx = cx;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+ $? "- UseScrollH"
+}
+
+
+
+void
+WxdkdrawFrame::UseScrollV(void)
+{
+ dk4_er_t er; /* Error report */
+ int32_t cy; /* Center y */
+ int tp; /* Thumb position */
+ int ts; /* Thumb size */
+#if 0
+ int r;
+ int p;
+#endif
+ $? "+ UseScrollV"
+#if 0
+ r = sbVert->GetRange();
+ p = sbVert->GetPageSize();
+#endif
+ tp = sbVert->GetThumbPosition();
+ ts = sbVert->GetThumbSize();
+ dk4error_init(&er);
+ cy = dk4ma_int32_from_double(
+ dk4ma_rint(
+ (
+ ((double)tp + (double)ts / 2.0) * RESWXD
+ ) / ((drawco->m_ptRes).x * drawco->m_dZoom)
+ ), &er
+ );
+ cy = dk4ma_int32_t_sub((m_pDrw->bb).yt, cy, &er);
+ cy = dk4ma_int32_t_add(cy, m_pDrw->btop, &er);
+ if (DK4_E_NONE == er.ec) {
+ m_pDrw->cy = cy;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ drawco->Refresh();
+ m_bUpdate = true;
+ }
+ $? "- UseScrollV"
+}
+
+
+
+#if 0
+
+static
+bool
+ColourChooserDiffersFromColour(Dk4WxColourView *pcc, int *pcol)
+{
+ bool back = false;
+ if (pcc->Red() != pcol[0]) {
+ back = true;
+ }
+ else {
+ if (pcc->Green() != pcol[1]) {
+ back = true;
+ }
+ else {
+ if (pcc->Blue() != pcol[2]) {
+ back = true;
+ }
+ }
+ }
+ return back;
+}
+
+#endif
+
+
+
+void
+WxdkdrawFrame::StyleToGUI(bool refresh)
+{
+ int valrotation = 0; /* Rotation value */
+ bool enalayer = true; /* Enable layer spin control */
+ bool enalinecolour = false; /* Enable line colour chooser */
+ bool enalinewidth = false; /* Enable line width spin control */
+ bool enalinestyle = false; /* Enable line style button */
+ bool enajoinstyle = false; /* Enable join style button */
+ bool enacapstyle = false; /* Enable cap style button */
+ bool enafwarrow = false; /* Enable forward arrow button */
+ bool enabwarrow = false; /* Enable backward arrow button */
+ bool enafillcolour = false; /* Enable fill colour chooser */
+ bool enafillstyle = false; /* Enable fill style button */
+ bool enalatex = false; /* Enable LaTeX checkbox */
+ bool enatextalign = false; /* Enable text align button */
+ bool enatextfont = false; /* Enable text font button */
+ bool enatextsize = false; /* Enable text size spin control */
+ bool enarotation = false; /* Enable rotation spin control */
+ $? "+ StyleToGUI"
+ if (NULL != m_pStyle) { $? ". style pointer %d", (int)(m_pStyle->ot)
+ /*
+ Check which style elements to enable
+ */
+ switch ( (int)(m_pStyle->ot) ) {
+ case WXD_OT_TEXT : { $? ". text"
+ enalinecolour = true;
+ enalatex = true;
+ enatextalign = true;
+ enatextfont = true;
+ enatextsize = true;
+ enarotation = true;
+ valrotation = (m_pStyle->det).t.a;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE : { $? ". polyline"
+ enalinecolour = true;
+ enalinewidth = true;
+ enalinestyle = true;
+ enajoinstyle = true;
+ enacapstyle = true;
+ enafwarrow = true;
+ enabwarrow = true;
+ } break;
+ case WXD_OT_O_ARC : { $? ". open arc"
+ enalinecolour = true;
+ enalinewidth = true;
+ enalinestyle = true;
+ enacapstyle = true;
+ enafwarrow = true;
+ enabwarrow = true;
+ } break;
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE : case WXD_OT_C_ARC : {
+ $? ". closed path"
+ enalinecolour = true; $? ". line colour"
+ enalinewidth = true; $? ". line width"
+ enalinestyle = true; $? ". line style"
+ enajoinstyle = true; $? ". join style"
+ enafillcolour = true; $? ". fill colour"
+ enafillstyle = true; $? ". fill style"
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : { $? ". circle/elli"
+ enalinecolour = true;
+ enalinewidth = true;
+ enalinestyle = true;
+ enafillcolour = true;
+ enafillstyle = true;
+ if (WXD_OT_ELLIPSE == m_pStyle->ot) {
+ enarotation = true;
+ valrotation = (m_pStyle->det).e.a;
+ }
+ } break;
+ case WXD_OT_BOX : { $? ". box"
+ enalinecolour = true;
+ enalinewidth = true;
+ enalinestyle = true;
+ enajoinstyle = true;
+ enafillcolour = true;
+ enafillstyle = true;
+ } break;
+ case WXD_OT_IMAGE : { $? ". image"
+ enafillcolour = true;
+ } break;
+ case WXD_OT_DOT_FILLED : { $? ". dot filled"
+ enalinecolour = true;
+ } break;
+ case WXD_OT_DOT_WHITE : { $? ". dot white"
+ enalinecolour = true;
+ enalinewidth = true;
+ } break;
+ default : { $? "! unknown object type"
+ } break;
+ }
+
+ /*
+ Prepare to change style for selected object.
+ */
+
+ /* Layer */
+ spLayerNumber->SetValue( (int)(m_pStyle->lay) );
+ spLayerNumber->Enable(enalayer);
+ if (refresh) { spLayerNumber->Refresh(); m_bUpdate = true; }
+ $? ". layer"
+
+ /* Line colour */
+ ccLineColour->SetRGB(m_pStyle->sc[0], m_pStyle->sc[1], m_pStyle->sc[2]);
+ $? ". enalinecolour = %d", (enalinecolour ? 1 : 0)
+ ccLineColour->Enable(enalinecolour);
+ if (refresh) { ccLineColour->Refresh(); m_bUpdate = true; }
+ $? ". line colour"
+
+ /* Line width */
+ spLineWidth->SetValue( (int)(m_pStyle->lw) );
+ $? ". enalinewidth = %d", (enalinewidth ? 1 : 0)
+ spLineWidth->Enable(enalinewidth);
+ if (refresh) { spLineWidth->Refresh(); m_bUpdate = true; }
+ $? ". line width"
+
+ /* Line style */
+ bStyleLineStyle->SetBitmap(WxdkdrawFrame::ms_ls_images[m_pStyle->ls]);
+ $? ". enalinestyle = %d", (enalinestyle ? 1 : 0)
+ bStyleLineStyle->Enable(enalinestyle);
+ if (refresh) { bStyleLineStyle->Refresh(); m_bUpdate = true; }
+ $? ". line style"
+
+ /* Join style */
+ bStyleLineJoins->SetBitmap(WxdkdrawFrame::ms_lj_images[m_pStyle->js]);
+ bStyleLineJoins->Enable(enajoinstyle);
+ if (refresh) { bStyleLineJoins->Refresh(); m_bUpdate = true; }
+ $? ". join style"
+
+ /* Cap style */
+ bStyleLineEnds->SetBitmap(WxdkdrawFrame::ms_lc_images[m_pStyle->cs]);
+ bStyleLineEnds->Enable(enacapstyle);
+ if (refresh) { bStyleLineEnds->Refresh(); m_bUpdate = true; }
+ $? ". cap style"
+
+ /* Forward arrow */
+ bStyleArrowForward->SetBitmap(
+ WxdkdrawFrame::ms_arrow_images[m_pStyle->aft]
+ );
+ bStyleArrowForward->Enable(enafwarrow);
+ if (refresh) { bStyleArrowForward->Refresh(); m_bUpdate = true; }
+ $? ". forward arrow"
+
+ /* Backward arrow */
+ bStyleArrowBackward->SetBitmap(
+ WxdkdrawFrame::ms_arrow_images[m_pStyle->abt]
+ );
+ bStyleArrowBackward->Enable(enabwarrow);
+ if (refresh) { bStyleArrowBackward->Refresh(); m_bUpdate = true; }
+ $? ". backward arrow"
+
+ /* Fill colour */
+ ccFillColour->SetRGB(
+ m_pStyle->fc[0], m_pStyle->fc[1], m_pStyle->fc[2]
+ );
+ ccFillColour->Enable(enafillcolour);
+ if (refresh) { ccFillColour->Refresh(); m_bUpdate = true; }
+ $? ". fill colour"
+
+ /* Fill style */
+ bStyleFillPattern->SetBitmap(WxdkdrawFrame::ms_fs_images[m_pStyle->fs]);
+ bStyleFillPattern->Enable(enafillstyle);
+ if (refresh) { bStyleFillPattern->Refresh(); m_bUpdate = true; }
+ $? ". fill style"
+
+ if (WXD_OT_TEXT == m_pStyle->ot) {
+
+ /* LaTeX text flag */
+ cbStyleTextLaTeX->SetValue(
+ WXD_TEXT_FLAG_NONE
+ != (WXD_TEXT_FLAG_LATEX & (m_pStyle->det).t.fl)
+ );
+ cbStyleTextLaTeX->Enable(enalatex);
+ if (refresh) { cbStyleTextLaTeX->Refresh(); m_bUpdate = true; }
+ $? ". latex flag"
+
+ $? ". text align = %u", (unsigned)((m_pStyle->det).t.al)
+ bStyleTextAlign->SetBitmap(
+ WxdkdrawFrame::ms_ta_images[(m_pStyle->det).t.al]
+ );
+ bStyleTextAlign->Enable(enatextalign);
+ if (refresh) { bStyleTextAlign->Refresh(); m_bUpdate = true; }
+ $? ". text align"
+
+ /* Text font */
+ bStyleFontName->SetBitmap(
+ WxdkdrawFrame::ms_fn_images[(m_pStyle->det).t.find]
+ );
+ bStyleFontName->Enable(enatextfont);
+ if (refresh) { bStyleFontName->Refresh(); m_bUpdate = true; }
+ $? ". font name"
+
+ /* Text size */
+ spFontSize->SetValue((m_pStyle->det).t.fsz);
+ spFontSize->Enable(enatextsize);
+ if (refresh) { spFontSize->Refresh(); m_bUpdate = true; }
+ $? ". text size"
+
+ }
+ else {
+ cbStyleTextLaTeX->Enable(false);
+ bStyleTextAlign->Enable(false);
+ bStyleFontName->Enable(false);
+ spFontSize->Enable(false);
+ }
+ spRotation->SetValue(valrotation);
+ spRotation->Enable(enarotation);
+ if (refresh) { spRotation->Refresh(); m_bUpdate = true; }
+ }
+ else { $? ". no style object, default style"
+ /*
+ Prepare to change default styles.
+ */
+
+ /* Layer number */
+ spLayerNumber->SetValue( (int)(m_oStyle.lay) );
+ spLayerNumber->Enable();
+ if (refresh) { spLayerNumber->Refresh(); m_bUpdate = true; }
+
+ /* Line colour */
+ ccLineColour->SetRGB( m_oStyle.sc[0], m_oStyle.sc[1], m_oStyle.sc[2] );
+ ccLineColour->Enable();
+ if (refresh) { ccLineColour->Refresh(); m_bUpdate = true; }
+
+ /* Line width */
+ spLineWidth->SetValue( (int)(m_oStyle.lw) );
+ spLineWidth->Enable();
+ if (refresh) { spLineWidth->Refresh(); m_bUpdate = true; }
+
+ /* Line style */
+ bStyleLineStyle->SetBitmap(WxdkdrawFrame::ms_ls_images[m_oStyle.ls]);
+ bStyleLineStyle->Enable();
+ if (refresh) { bStyleLineStyle->Refresh(); m_bUpdate = true; }
+
+ /* Join style */
+ bStyleLineJoins->SetBitmap(WxdkdrawFrame::ms_lj_images[m_oStyle.js]);
+ bStyleLineJoins->Enable();
+ if (refresh) { bStyleLineJoins->Refresh(); m_bUpdate = true; }
+
+ /* Cap style */
+ bStyleLineEnds->SetBitmap(WxdkdrawFrame::ms_lc_images[m_oStyle.cs]);
+ bStyleLineEnds->Enable();
+ if (refresh) { bStyleLineEnds->Refresh(); m_bUpdate = true; }
+
+ /* Forward arrow */
+ bStyleArrowForward->SetBitmap(
+ WxdkdrawFrame::ms_arrow_images[m_oStyle.aft]
+ );
+ bStyleArrowForward->Enable();
+ if (refresh) { bStyleArrowForward->Refresh(); m_bUpdate = true; }
+
+ /* Backward arrow */
+ bStyleArrowBackward->SetBitmap(
+ WxdkdrawFrame::ms_arrow_images[m_oStyle.abt]
+ );
+ bStyleArrowBackward->Enable();
+ if (refresh) { bStyleArrowBackward->Refresh(); m_bUpdate = true; }
+
+ /* Fill colour */
+ ccFillColour->SetRGB( m_oStyle.fc[0], m_oStyle.fc[1], m_oStyle.fc[2] );
+ ccFillColour->Enable();
+ if (refresh) { ccFillColour->Refresh(); m_bUpdate = true; }
+
+ /* Fill style */
+ bStyleFillPattern->SetBitmap(WxdkdrawFrame::ms_fs_images[m_oStyle.fs]);
+ bStyleFillPattern->Enable();
+ if (refresh) { bStyleFillPattern->Refresh(); m_bUpdate = true; }
+
+ /* LaTeX text flag */
+ cbStyleTextLaTeX->SetValue(
+ WXD_TEXT_FLAG_NONE != (WXD_TEXT_FLAG_LATEX & m_oStyle.det.t.fl)
+ );
+ cbStyleTextLaTeX->Enable();
+ if (refresh) { cbStyleTextLaTeX->Refresh(); m_bUpdate = true; }
+
+ /* Text align */
+ bStyleTextAlign->SetBitmap(
+ WxdkdrawFrame::ms_ta_images[m_oStyle.det.t.al]
+ );
+ bStyleTextAlign->Enable();
+ if (refresh) { bStyleTextAlign->Refresh(); m_bUpdate = true; }
+
+ /* Text font */
+ bStyleFontName->SetBitmap(
+ WxdkdrawFrame::ms_fn_images[m_oStyle.det.t.find]
+ );
+ bStyleFontName->Enable();
+ if (refresh) { bStyleFontName->Refresh(); m_bUpdate = true; }
+
+ /* Text size */
+ spFontSize->SetValue(m_oStyle.det.t.fsz);
+ spFontSize->Enable();
+ if (refresh) { spFontSize->Refresh(); m_bUpdate = true; }
+
+ /* Rotation */
+ spRotation->SetValue(0);
+ spRotation->Enable(false);
+ if (refresh) { spRotation->Refresh(); m_bUpdate = true; }
+ }
+ $? "- StyleToGUI"
+}
+
+
+
+void
+WxdkdrawFrame::SetStyleObject(Wxd_object_t *pObj, bool bUpdate)
+{
+ if (m_pStyle != pObj) {
+ m_pStyle = pObj;
+ StyleToGUI(bUpdate);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::UpdateOneFont(
+ Wxd_font_t *pfont
+)
+{
+ pfont->attempted = false;
+ if (NULL != pfont->font) {
+ delete (pfont->font);
+ pfont->font = NULL;
+ }
+ wxdfont_find_font(
+ pfont, drawco->m_dZoom, (drawco->m_ptRes).y,
+ (0 != m_iv[IVI_FONT_EXACT])
+ );
+}
+
+
+
+void
+WxdkdrawFrame::UpdateFonts(void)
+{
+ Wxd_font_t *pfont;
+ Wxd_object_t *pobj;
+ $? "+ UpdateFonts"
+ /* Connect text details to fonts.
+ */
+ $? ". assign font structures to text objects (start)"
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (NULL != pobj) {
+ if (WXD_OT_TEXT == pobj->ot) { $? ". text object"
+ if (NULL == (pobj->det).t.font) { $? ". obj without font"
+ (pobj->det).t.font = FindFont(
+ (pobj->det).t.find, (pobj->det).t.fsz
+ );
+ }
+ }
+ }
+ } while (NULL != pobj);
+ $? ". assign font structures to text objects (finished)"
+ /* Clear and renew all fonts
+ */
+ $? ". clear and renew font objects (start)"
+ dk4sto_it_reset(m_pDrw->i_fonts);
+ do {
+ pfont = (Wxd_font_t *)dk4sto_it_next(m_pDrw->i_fonts);
+ if (NULL != pfont) {
+ UpdateOneFont(pfont);
+ }
+ } while (NULL != pfont);
+ $? ". clear and renew font objects (finished)"
+ $? "- UpdateFonts"
+}
+
+
+
+Wxd_font_t *
+WxdkdrawFrame::FindFont(uint8_t find, uint16_t fsz)
+{
+ Wxd_font_t tf;
+ Wxd_font_t *back = NULL;
+ $? "+ FindFont %u %u", (unsigned)find, (unsigned)fsz
+ tf.find = find; tf.fsz = fsz;
+ back = (Wxd_font_t *)dk4sto_it_find_like(m_pDrw->i_fonts, &tf, 0);
+ if (NULL == back) {
+ back = wxdfont_new(find, fsz);
+ if (NULL != back) {
+ if (0 != dk4sto_add(m_pDrw->s_fonts, back, NULL)) {
+ wxdfont_find_font(
+ back, drawco->m_dZoom, (drawco->m_ptRes).y,
+ (0 != m_iv[IVI_FONT_EXACT])
+ );
+ }
+ else {
+ wxdfont_delete(back);
+ back = NULL;
+ }
+ }
+ } $? "- FindFont %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+bool
+WxdkdrawFrame::ObjectSelectableInState(Wxd_object_t const *pobj)
+{
+ bool back = false;
+ if (NULL != pobj) {
+ back = true;
+ /*
+ _STATE_
+ In some states we want to select objects of certain
+ types only
+ */
+ switch (m_iState) {
+ case S_MOD_SPLINE : {
+ back = false;
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE :
+ {
+ back = true;
+ } break;
+ }
+ } break;
+ case S_ROTATE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_CIRCLE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE :
+ {
+ if (NULL == pobj->pa) {
+ back = false;
+ }
+ } break;
+ }
+ } break;
+ case S_CONVERT : {
+ back = wxdobj_can_convert(m_iObjToCreate, pobj);
+ } break;
+ case S_FLIP : {
+ /*
+ For some object types flipping would result
+ in no change
+ */
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_CIRCLE :
+ case WXD_OT_BOX :
+ case WXD_OT_IMAGE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ if (NULL == pobj->pa) {
+ back = false;
+ }
+ } break;
+ }
+ } break;
+ case S_UNGROUP : {
+ /*
+ Only members of groups are of interest, from the member
+ we go upwards to find the top level group object
+ */
+ if (NULL == pobj->pa) {
+ back = false;
+ }
+ } break;
+ case S_DETAILS : {
+ /*
+ The details to modify - if any - depend on the object type:
+ */
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : /* Texts */
+ case WXD_OT_BOX : /* Rounded corner radius */
+ case WXD_OT_IMAGE : /* Image file and flags */
+ case WXD_OT_DOT_FILLED : /* Diameter */
+ case WXD_OT_DOT_WHITE : /* Diameter */
+ {
+ back = true;
+ } break;
+ default : {
+ back = false;
+ } break;
+ }
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+Wxd_object_t *
+WxdkdrawFrame::FindNearestObject(bool gr)
+{
+ Wxd_object_t *back = NULL; /* Object with minimum distance */
+ Wxd_object_t *pobj; /* Current object */
+ double min = -1.0; /* Minimum distance found so far */
+ double d; /* Distance to current object */
+ $? "+ FindNearestObject"
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (NULL != pobj) {
+ if ((wxdobj_is_active(pobj)) && (ObjectSelectableInState(pobj))) {
+ d = wxdobj_distance_to_point(pobj, &m_ptMousePosRaw);
+ if (
+ (0.0 < d)
+ && ((0.0 > min) || (d < min))
+ && (d < 2.0 * (double)(drawco->m_uGridSnap))
+ ) {
+ min = d;
+ back = pobj;
+ }
+ }
+ }
+ } while (NULL != pobj);
+ if ((gr) && (NULL != back)) {
+ while (NULL != back->pa) { back = back->pa; }
+ } $? "- FindNearestObject %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::RequireRedraw(int level)
+{
+ wxdobj_drw_require_redraw(m_pDrw, level);
+ drawco->Refresh();
+ Update();
+}
+
+
+
+void
+WxdkdrawFrame::UpdateTextForFont(Wxd_object_t *pobj, bool bRedraw)
+{
+ Wxd_font_t *pfont;
+ bool hasf;
+ $? "+ UpdateTextForFont"
+ hasf = (NULL != (pobj->det).t.font);
+ (pobj->det).t.font = pfont = FindFont((pobj->det).t.find,(pobj->det).t.fsz);
+ if (NULL != pfont) {
+ UpdateOneFont(pfont);
+ }
+ if (hasf) {
+ wxdobj_remove_unused_fonts(m_pDrw);
+ }
+ if (bRedraw) {
+ RequireRedraw(WXD_REFRESH_DRAWING);
+ }
+ $? "- UpdateTextForFont"
+}
+
+
+
+void
+WxdkdrawFrame::SetMouseAndStatusTexts(int st)
+{
+ $? "+ SetMouseAndStatusTexts"
+ /* Defaults
+ */
+ $? ". clean all texts"
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseM->SetLabel(sNlWx[7]);
+ msgMouseR->SetLabel(sNlWx[7]);
+ SetStatusText(sNlWx[7]);
+ /*
+ _STATE_ Messages depending on state to enter.
+ */
+ switch (st) {
+ case S_NOOP : { $? ". S_NOOP"
+ } break;
+ case S_DELETE : { $? ". S_DELETE"
+ msgMouseR->SetLabel(sTexts[341]);
+ msgMouseM->SetLabel(sTexts[534]);
+ } break;
+ case S_REGION_DELETE : {
+ msgMouseL->SetLabel(sTexts[532]);
+ msgMouseR->SetLabel(sTexts[533]);
+ } break;
+ case S_MOVE_SELECT : { $? ". S_MOVE_SELECT"
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseR->SetLabel(sTexts[344]);
+ } break;
+ case S_MOVE_PLACE : { $? ". S_MOVE_PLACE"
+ } break;
+ case S_COPY_SELECT : { $? ". S_COPY_SELECT"
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseR->SetLabel(sTexts[372]);
+ } break;
+ case S_COPY_PLACE : { $? ". S_COPY_PLACE"
+ } break;
+ case S_POLY_FIRST : { $? ". S_POLY_FIRST"
+ msgMouseL->SetLabel(sTexts[373]);
+ msgMouseR->SetLabel(sTexts[375]);
+ SetStatusText(
+ sTexts[(WXD_OT_POLYLINE == m_iObjToCreate) ? 30 : 32]
+ );
+ } break;
+ case S_POLY_FURTHER : { $? ". S_POLY_FURTHER"
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[374]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[376]);
+ SetStatusText(
+ sTexts[(WXD_OT_POLYLINE == m_iObjToCreate) ? 30 : 32]
+ );
+ } break;
+ case S_SPLINE_FIRST : { $? ". S_SPLINE_FIRST"
+ msgMouseL->SetLabel(sTexts[373]);
+ msgMouseR->SetLabel(sTexts[375]);
+ if (WXD_OT_C_SPLINE == m_iObjToCreate) {
+ SetStatusText(sTexts[m_bSplineInterpolated ? 48 : 44]);
+ }
+ else {
+ SetStatusText(sTexts[m_bSplineInterpolated ? 46 : 42]);
+ }
+ } break;
+ case S_SPLINE_FURTHER : { $? ". S_SPLINE_FURTHER"
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[374]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[376]);
+ if (WXD_OT_C_SPLINE == m_iObjToCreate) {
+ SetStatusText(sTexts[m_bSplineInterpolated ? 48 : 44]);
+ }
+ else {
+ SetStatusText(sTexts[m_bSplineInterpolated ? 46 : 42]);
+ }
+ } break;
+ case S_BOX_FIRST : {
+ msgMouseL->SetLabel(sTexts[377]);
+ msgMouseR->SetLabel(sTexts[379]);
+ SetStatusText(sTexts[m_bSplineInterpolated ? 36 : 34]);
+ } break;
+ case S_BOX_OPPOSITE : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[378]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[379]);
+ SetStatusText(sTexts[m_bSplineInterpolated ? 36 : 34]);
+ } break;
+ case S_CIRCLE_CENTER : {
+ msgMouseL->SetLabel(sTexts[380]);
+ msgMouseR->SetLabel(sTexts[383]);
+ SetStatusText(sTexts[38]);
+ } break;
+ case S_CIRCLE_RADIUS : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[381]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[382]);
+ SetStatusText(sTexts[38]);
+ } break;
+ case S_ELLIPSE_CENTER : {
+ msgMouseL->SetLabel(sTexts[380]);
+ msgMouseR->SetLabel(sTexts[383]);
+ SetStatusText(sTexts[40]);
+ } break;
+ case S_ELLIPSE_CORNER : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[384]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[382]);
+ SetStatusText(sTexts[40]);
+ } break;
+ case S_ARC_1 : {
+ msgMouseL->SetLabel(sTexts[389]);
+ msgMouseR->SetLabel(sTexts[393]);
+ SetStatusText(sTexts[(WXD_OT_C_ARC == m_iObjToCreate) ? 388 : 386]);
+ } break;
+ case S_ARC_2 : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[390]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[392]);
+ SetStatusText(sTexts[(WXD_OT_C_ARC == m_iObjToCreate) ? 388 : 386]);
+ } break;
+ case S_ARC_3 : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[391]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[392]);
+ SetStatusText(sTexts[(WXD_OT_C_ARC == m_iObjToCreate) ? 388 : 386]);
+ } break;
+ case S_DOT : {
+ msgMouseL->SetLabel(sTexts[394]);
+ msgMouseR->SetLabel(sTexts[395]);
+ SetStatusText(
+ sTexts[(WXD_OT_DOT_WHITE == m_iObjToCreate) ? 52 : 50]
+ );
+ } break;
+ case S_TEXT : {
+ msgMouseL->SetLabel(sTexts[403]);
+ msgMouseR->SetLabel(sTexts[404]);
+ SetStatusText(sTexts[54]);
+ } break;
+ case S_IMG_1 : {
+ msgMouseL->SetLabel(sTexts[405]);
+ msgMouseR->SetLabel(sTexts[408]);
+ SetStatusText(sTexts[56]);
+ } break;
+ case S_IMG_2 : {
+ msgMouseL->SetLabel(
+ (IsAcceptablePoint()) ? (sTexts[406]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[407]);
+ SetStatusText(sTexts[56]);
+ } break;
+ case S_LIBELEM_PLACE : {
+ msgMouseL->SetLabel(sTexts[411]);
+ msgMouseR->SetLabel(sTexts[412]);
+ SetStatusText(sTexts[58]);
+ } break;
+ case S_MOVEPT_SELECT : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[418]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[420]);
+ SetStatusText(sTexts[421]);
+ } break;
+ case S_MOVEPT_PLACE : {
+ msgMouseL->SetLabel(sTexts[419]);
+ msgMouseR->SetLabel(sTexts[420]);
+ SetStatusText(sTexts[421]);
+ } break;
+ case S_DELPT : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[431]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[432]);
+ SetStatusText(sTexts[433]);
+ } break;
+ case S_ADDPT_SELECT : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[435]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[437]);
+ SetStatusText(sTexts[434]);
+ } break;
+ case S_ADDPT_PLACE : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[436]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[438]);
+ SetStatusText(sTexts[434]);
+ } break;
+ case S_DRWSZ_SELECT : {
+ msgMouseL->SetLabel(
+ (m_bHaveCornerPoint) ? (sTexts[439]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[440]);
+ SetStatusText(sTexts[441]);
+ } break;
+ case S_DRWSZ_PLACE : {
+ msgMouseL->SetLabel(sTexts[442]);
+ msgMouseR->SetLabel(sTexts[443]);
+ SetStatusText(sTexts[441]);
+ } break;
+ case S_FLIP : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[445]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[446]);
+ SetStatusText(sTexts[444]);
+ } break;
+ case S_GROUP_ONE : {
+ int num_marked_2 = wxdobj_num_marked_2(m_pDrw);
+ if (NULL != m_pCurrent) {
+ msgMouseL->SetLabel(sTexts[
+ ((wxdobj_is_marked(m_pCurrent,OBJ_MARKER_2))
+ ? (448) : (447))
+ ]);
+ }
+ else {
+ msgMouseL->SetLabel(
+ (2 <= num_marked_2) ? (sTexts[449]) : (sNlWx[7])
+ );
+ }
+ msgMouseR->SetLabel(sTexts[(2<= num_marked_2) ? (450) : (451)]);
+ SetStatusText(sTexts[452]);
+ } break;
+ case S_UNGROUP : {
+ msgMouseL->SetLabel(
+ ((NULL != m_pCurrent) ? (sTexts[454]) : (sNlWx[7]))
+ );
+ msgMouseR->SetLabel(sTexts[455]);
+ SetStatusText(sTexts[453]);
+ } break;
+ case S_GROUP_RECT_1 : {
+ msgMouseL->SetLabel(sTexts[456]);
+ msgMouseR->SetLabel(sTexts[451]);
+ SetStatusText(sTexts[457]);
+ } break;
+ case S_GROUP_RECT_2 : {
+ msgMouseL->SetLabel(sTexts[449]);
+ msgMouseR->SetLabel(sTexts[450]);
+ SetStatusText(sTexts[457]);
+ } break;
+ case S_DETAILS : case S_DETAILS_2 : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[459]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[460]);
+ SetStatusText(sTexts[458]);
+ } break;
+ case S_CONVERT : {
+ switch ( (int)m_iObjToCreate ) {
+ case WXD_OT_POLYLINE : {
+ SetStatusText(sTexts[546]);
+ } break;
+ case WXD_OT_POLYGON : {
+ SetStatusText(sTexts[545]);
+ } break;
+ case WXD_OT_C_SPLINE: {
+ if (m_bSplineInterpolated) {
+ SetStatusText(sTexts[547]);
+ }
+ else {
+ SetStatusText(sTexts[550]);
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if (m_bSplineInterpolated) {
+ SetStatusText(sTexts[166]);
+ }
+ else {
+ SetStatusText(sTexts[551]);
+ }
+ } break;
+ case WXD_OT_C_ARC : {
+ SetStatusText(sTexts[548]);
+ } break;
+ case WXD_OT_O_ARC : {
+ SetStatusText(sTexts[549]);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ SetStatusText(sTexts[553]);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ SetStatusText(sTexts[552]);
+ } break;
+ }
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[554]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[555]);
+ } break;
+ case S_ROTATE : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[572]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[573]);
+ SetStatusText(sTexts[(m_bSplineInterpolated) ? 571 : 570]);
+ } break;
+ case S_MOD_SPLINE : {
+ msgMouseL->SetLabel(
+ (NULL != m_pCurrent) ? (sTexts[622]) : (sNlWx[7])
+ );
+ msgMouseR->SetLabel(sTexts[623]);
+ SetStatusText(sTexts[624]);
+ } break;
+ default : { $? "! default"
+ } break;
+ }
+ /*
+ Refresh widgets and update window
+ */
+ msgMouseL->Refresh();
+ msgMouseM->Refresh();
+ msgMouseR->Refresh();
+ m_bUpdate = true;
+ $? "- SetMouseAndStatusTexts"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawMouse.cpp b/support/dktools/WxdkdrawMouse.cpp
new file mode 100644
index 0000000000..c61bbef303
--- /dev/null
+++ b/support/dktools/WxdkdrawMouse.cpp
@@ -0,0 +1,5944 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawMouse.cpt
+*/
+
+/** @file WxdkdrawMouse.cpp The WxdkdrawMouse module.
+*/
+
+
+#line 10 "WxdkdrawMouse.cpt"
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+#ifndef WXDKDRAWDLGTEXTINPUT_H_INCLUDED
+#include "WxdkdrawDlgTextInput.h"
+#endif
+#ifndef WXDKDRAWDLGSPLINEVALUE_H_INCLUDED
+#include "WxdkdrawDlgSplineValue.h"
+#endif
+#ifndef WXDKDRAWDLGIMAGEOPTIONS_H_INCLUDED
+#include "WxdkdrawDlgImageOptions.h"
+#endif
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgDotFilled.h"
+#endif
+#ifndef WXDKDRAWDLGBOXRADIUS_H_INCLUDED
+#include "WxdkdrawDlgBoxRadius.h"
+#endif
+#ifndef DK4MAAU32_H_INCLUDED
+#include "dk4maau32.h"
+#endif
+#ifndef DK4MAAI32_H_INCLUDED
+#include "dk4maai32.h"
+#endif
+#ifndef DK4MAAU16_H_INCLUDED
+#include "dk4maau16.h"
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 53 "WxdkdrawMouse.cpt"
+
+
+
+/** Image file types we can handle.
+*/
+static wxChar const image_files_to_open[] = {
+#if DK4_HAVE_PNG_H
+ wxT("PNG files (*.png)|*.png")
+#if DK4_HAVE_JPEGLIB_H
+ wxT("|JPEG files (*.jpeg)|*.jpeg")
+ wxT("|JPEG files (*.jpg)|*.jpg")
+#endif
+/* if DK4_HAVE_JPEGLIB_H */
+#if DK4_HAVE_TIFF_H
+ wxT("|TIFF files (*.tiff)|*.tiff")
+ wxT("|TIFF files (*.tif)|*.tif")
+#endif
+/* if DK4_HAVE_TIFF_H */
+ wxT("|NetPBM files (*.pam)|*.pam")
+#else
+/* if DK4_HAVE_PNG_H */
+#if DK4_HAVE_JPEGLIB_H
+ wxT("JPEG files (*.jpeg)|*.jpeg")
+ wxT("|JPEG files (*.jpg)|*.jpg")
+#if DK4_HAVE_TIFF_H
+ wxT("|TIFF files (*.tiff)|*.tiff")
+ wxT("|TIFF files (*.tif)|*.tif")
+#endif
+/* if DK4_HAVE_TIFF_H */
+ wxT("|NetPBM files (*.pam)|*.pam")
+#else
+/* if DK4_HAVE_JPEGLIB_H */
+#if DK4_HAVE_TIFF_H
+ wxT("TIFF files (*.tiff)|*.tiff")
+ wxT("|TIFF files (*.tif)|*.tif")
+ wxT("|NetPBM files (*.pam)|*.pam")
+#else
+/* if DK4_HAVE_TIFF_H */
+ wxT("NetPBM files (*.pam)|*.pam")
+#endif
+/* if DK4_HAVE_TIFF_H */
+#endif
+/* if DK4_HAVE_JPEGLIB_H */
+#endif
+/* DK4_HAVE_PNG_H */
+ wxT("|NetPBM files (*.pnm)|*.pnm")
+ wxT("|NetPBM files (*.ppm)|*.ppm")
+ wxT("|NetPBM files (*.pgm)|*.pgm")
+ wxT("|NetPBM files (*.pbm)|*.pbm")
+};
+
+
+
+bool
+WxdkdrawFrame::IsAcceptablePoint(void)
+{
+ bool back = true;
+
+ switch (m_iState) {
+ case S_POLY_FURTHER :
+ case S_SPLINE_FURTHER :
+ case S_CIRCLE_RADIUS :
+ case S_IMG_2 :
+ {
+ if (
+ (m_ptMousePosGrid.x == m_ptMouseMoveStart.x)
+ && (m_ptMousePosGrid.y == m_ptMouseMoveStart.y)
+ ) {
+ back = false;
+ }
+ } break;
+ case S_ELLIPSE_CORNER :
+ case S_BOX_OPPOSITE :
+ {
+ back = false;
+ /*
+ For a box we accept neither equal x nor equal y coordinates
+ */
+ if (
+ (m_ptMousePosGrid.x != m_ptMouseMoveStart.x)
+ && (m_ptMousePosGrid.y != m_ptMouseMoveStart.y)
+ ) {
+ back = true;
+ }
+ } break;
+ case S_ARC_2 : {
+ if (
+ ((m_pCurrent->det).a.x1 == (m_pCurrent->det).a.x2)
+ && ((m_pCurrent->det).a.y1 == (m_pCurrent->det).a.y2)
+ ) {
+ back = false;
+ }
+ } break;
+ case S_ARC_3 : {
+ if (
+ (
+ ((m_pCurrent->det).a.x1 == (m_pCurrent->det).a.x3)
+ && ((m_pCurrent->det).a.y1 == (m_pCurrent->det).a.y3)
+ ) || (
+ ((m_pCurrent->det).a.x2 == (m_pCurrent->det).a.x3)
+ && ((m_pCurrent->det).a.y2 == (m_pCurrent->det).a.y3)
+ )
+ ) {
+ back = false;
+ }
+ } break;
+ }
+ return back;
+}
+
+
+void
+WxdkdrawFrame::MouseMoveNoop(void)
+{
+ Wxd_object_t *pobj;
+ size_t si;
+ int oldtype = WXD_OT_GROUP_END;
+
+
+#line 171 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ oldtype = (int)(m_pCurrent->ot);
+ }
+#if 0
+ if (NULL == m_pStyle) {
+#endif
+ pobj = FindNearestObject();
+ if (m_pCurrent != pobj) {
+ if ((NULL != pobj) && (NULL == m_pCurrent)) {
+ msgMouseL->SetLabel(sTexts[201]);
+ msgMouseL->Refresh();
+ m_bUpdate = true;
+ }
+ else {
+ if ((NULL == pobj) && (NULL != m_pCurrent)) {
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = pobj;
+ if (NULL != m_pCurrent) {
+ pobj->mark |= OBJ_MARKER_1;
+ if (oldtype != (int)(m_pCurrent->ot)) {
+ if (
+ (WXD_OT_TEXT <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ si = (size_t)172U + (size_t)(m_pCurrent->ot);
+ SetStatusText(sTexts[si]);
+ m_bUpdate = true;
+ }
+ }
+ }
+ else {
+ SetStatusText(sNlWx[19]);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+#if 0
+ }
+#endif
+ }
+ else {
+ if (NULL != m_pCurrent) {
+ m_pCurrent = NULL;
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ SetStatusText(sNlWx[19]);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+
+
+#line 226 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDelete(void)
+{
+ Wxd_object_t *pOldCurrent;
+
+
+#line 235 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ SetStatusText(
+ sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]
+ );
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[340]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+
+
+#line 270 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveMoveSelect(void)
+{
+ Wxd_object_t *pOldCurrent;
+
+
+#line 279 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+
+#line 280 "WxdkdrawMouse.cpt"
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+
+#line 283 "WxdkdrawMouse.cpt"
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+
+#line 285 "WxdkdrawMouse.cpt"
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+
+#line 290 "WxdkdrawMouse.cpt"
+ SetStatusText(
+ sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]
+ );
+ }
+ else {
+
+#line 295 "WxdkdrawMouse.cpt"
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[342]);
+ }
+ else {
+
+#line 300 "WxdkdrawMouse.cpt"
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 308 "WxdkdrawMouse.cpt"
+ }
+#endif
+ }
+ else {
+
+#line 312 "WxdkdrawMouse.cpt"
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+
+
+#line 318 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveMovePlace(void)
+{
+
+
+#line 326 "WxdkdrawMouse.cpt"
+
+
+#line 327 "WxdkdrawMouse.cpt"
+
+
+#line 328 "WxdkdrawMouse.cpt"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+
+#line 329 "WxdkdrawMouse.cpt"
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+
+
+#line 331 "WxdkdrawMouse.cpt"
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 335 "WxdkdrawMouse.cpt"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 340 "WxdkdrawMouse.cpt"
+ }
+#endif
+
+
+#line 343 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveCopySelect(void)
+{
+ Wxd_object_t *pOldCurrent;
+
+
+#line 352 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ SetStatusText(
+ sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]
+ );
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[370]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+
+
+#line 387 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveCopyPlace(void)
+{
+
+
+#line 395 "WxdkdrawMouse.cpt"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+ }
+ }
+ else {
+ }
+
+
+#line 405 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftNoop(void)
+{
+ Wxd_object_t *pobj;
+ size_t si;
+
+
+#line 415 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+#if 0
+ if (NULL == m_pStyle) {
+
+#line 418 "WxdkdrawMouse.cpt"
+#endif
+ pobj = FindNearestObject();
+ if (NULL != pobj) {
+ m_pStyle = pobj;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+
+
+#line 424 "WxdkdrawMouse.cpt"
+ if (
+ (WXD_OT_TEXT <= m_pStyle->ot)
+ && (WXD_OT_DOT_WHITE >= m_pStyle->ot)
+ ) {
+ msgMouseR->SetLabel(sTexts[200]);
+
+
+#line 430 "WxdkdrawMouse.cpt"
+ msgMouseL->SetLabel(sNlWx[7]);
+
+
+#line 432 "WxdkdrawMouse.cpt"
+ si = (size_t)185U + (size_t)(m_pStyle->ot);
+
+
+#line 434 "WxdkdrawMouse.cpt"
+ SetStatusText(sTexts[si]);
+
+
+#line 436 "WxdkdrawMouse.cpt"
+ msgMouseR->Refresh();
+
+
+#line 438 "WxdkdrawMouse.cpt"
+ msgMouseL->Refresh();
+
+
+#line 440 "WxdkdrawMouse.cpt"
+ m_bUpdate = true;
+
+
+#line 442 "WxdkdrawMouse.cpt"
+ StyleToGUI();
+ }
+ else {
+ SetStatusText(sNlWx[19]);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+#if 0
+ }
+ else {
+
+#line 452 "WxdkdrawMouse.cpt"
+ }
+#endif
+ }
+ else {
+ }
+
+
+#line 458 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDelete(void)
+{
+ Wxd_object_t *pobj;
+
+
+#line 467 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ pobj = FindNearestObject(true);
+ if (NULL != pobj) {
+ wxdobj_obj_delete_from_drawing(m_pDrw, pobj);
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ SetStatusText(sNlWx[7]);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ else {
+ }
+
+
+#line 481 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftMoveSelect(void)
+{
+
+
+#line 489 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject(true);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ m_iState = S_MOVE_PLACE;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ SetStatusText(sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[343]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+ }
+
+
+#line 524 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftMovePlace(void)
+{
+
+
+#line 532 "WxdkdrawMouse.cpt"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 1);
+ if (NULL != m_pCurrent) {
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ wxdobj_bb_for_drawing(m_pDrw);
+ }
+ m_iState = S_MOVE_SELECT;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+
+
+#line 547 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftCopySelect(void)
+{
+
+
+#line 555 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject(true);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ m_iState = S_COPY_PLACE;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ SetStatusText(sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[371]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+
+
+#line 588 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftCopyPlace(void)
+{
+
+
+#line 596 "WxdkdrawMouse.cpt"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ /* Create copy and shift objects in copy */
+ if (NULL != m_pCurrent) {
+ wxdobj_copy_recursive(m_pDrw, m_pCurrent, &m_ptMouseMoveDiff);
+ SetModified();
+ }
+ m_iState = S_COPY_SELECT;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+
+
+#line 608 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationPolyFirst(void)
+{
+
+
+#line 616 "WxdkdrawMouse.cpt"
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+
+
+#line 623 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationPolyFurther(bool bComplete, bool bSkip)
+{
+ dk4_er_t er;
+ uint16_t itd;
+
+
+#line 633 "WxdkdrawMouse.cpt"
+ if (bSkip) {
+
+
+#line 635 "WxdkdrawMouse.cpt"
+ if (NULL != m_pCurrent) {
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ m_iState = S_POLY_FIRST;
+ }
+ else {
+ m_iState = S_NOOP;
+ }
+ }
+ else {
+
+#line 644 "WxdkdrawMouse.cpt"
+ if (NULL != m_pCurrent) {
+
+#line 645 "WxdkdrawMouse.cpt"
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (
+ (WXD_OT_POLYLINE == m_pCurrent->ot)
+ || (WXD_OT_POLYGON == m_pCurrent->ot)
+ ) {
+
+#line 650 "WxdkdrawMouse.cpt"
+ if (2U < (m_pCurrent->det).p.n) {
+ dk4error_init(&er);
+
+#line 652 "WxdkdrawMouse.cpt"
+ itd = (m_pCurrent->det).p.n - 1U;
+ if ( wxdobj_del_polypoint(m_pCurrent, itd, &er) ) {
+ m_iState = S_POLY_FIRST;
+
+#line 655 "WxdkdrawMouse.cpt"
+ }
+ else {
+
+#line 657 "WxdkdrawMouse.cpt"
+ m_iState = S_NOOP;
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ SetModified();
+ }
+ else {
+
+#line 664 "WxdkdrawMouse.cpt"
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ }
+ m_iState = S_POLY_FIRST;
+ }
+ else {
+
+#line 669 "WxdkdrawMouse.cpt"
+ m_iState = S_NOOP;
+ }
+ }
+ else {
+
+#line 673 "WxdkdrawMouse.cpt"
+ m_iState = S_NOOP;
+ }
+ }
+ m_pCurrent = NULL;
+ if (bComplete) {
+ m_iState = S_NOOP;
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+
+
+#line 683 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationSplineFirst(void)
+{
+
+
+#line 691 "WxdkdrawMouse.cpt"
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+
+
+#line 702 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationSplineFurther(bool bComplete, bool bSkip)
+{
+ dk4_er_t er;
+ uint16_t itd;
+
+
+#line 712 "WxdkdrawMouse.cpt"
+ if (bSkip) {
+
+
+#line 714 "WxdkdrawMouse.cpt"
+ if (NULL != m_pCurrent) {
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ m_iState = S_SPLINE_FIRST;
+ }
+ else {
+ m_iState = S_NOOP;
+ }
+ }
+ else {
+
+#line 723 "WxdkdrawMouse.cpt"
+ if (NULL != m_pCurrent) {
+
+#line 724 "WxdkdrawMouse.cpt"
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (
+ (WXD_OT_O_SPLINE == m_pCurrent->ot)
+ || (WXD_OT_C_SPLINE == m_pCurrent->ot)
+ ) {
+
+#line 729 "WxdkdrawMouse.cpt"
+ if (2U < (m_pCurrent->det).s.n) {
+ dk4error_init(&er);
+
+#line 731 "WxdkdrawMouse.cpt"
+ itd = (m_pCurrent->det).s.n - 1U;
+ if ( wxdobj_del_splinepoint(m_pCurrent, itd, &er) ) {
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].s =
+ SValueAtEnd();
+ m_iState = S_SPLINE_FIRST;
+
+#line 736 "WxdkdrawMouse.cpt"
+ }
+ else {
+
+#line 738 "WxdkdrawMouse.cpt"
+ m_iState = S_NOOP;
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ SetModified();
+ }
+ else {
+
+#line 745 "WxdkdrawMouse.cpt"
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ }
+ m_iState = S_SPLINE_FIRST;
+ }
+ else {
+
+#line 750 "WxdkdrawMouse.cpt"
+ m_iState = S_NOOP;
+ }
+ }
+ else {
+
+#line 754 "WxdkdrawMouse.cpt"
+ m_iState = S_NOOP;
+ }
+ }
+ m_pCurrent = NULL;
+ if (bComplete) {
+ m_iState = S_NOOP;
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+
+
+#line 764 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationBoxFirst(void)
+{
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationTwoPointsSecond(int ns, bool bComplete)
+{
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ }
+ m_iState = ns;
+ if (bComplete) {
+ m_iState = S_NOOP;
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationBoxOpposite(bool bComplete)
+{
+ EndOperationTwoPointsSecond(S_BOX_FIRST, bComplete);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationCircleCenter(void)
+{
+
+
+#line 815 "WxdkdrawMouse.cpt"
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+
+
+#line 826 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationCircleRadius(bool bComplete)
+{
+
+
+#line 834 "WxdkdrawMouse.cpt"
+ EndOperationTwoPointsSecond(S_CIRCLE_CENTER, bComplete);
+
+
+#line 836 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationEllipseCenter(void)
+{
+
+
+#line 844 "WxdkdrawMouse.cpt"
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+
+
+#line 855 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationEllipseCorner(bool bComplete)
+{
+
+
+#line 863 "WxdkdrawMouse.cpt"
+ EndOperationTwoPointsSecond(S_ELLIPSE_CENTER, bComplete);
+
+
+#line 865 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationArc1(void)
+{
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationArc2(bool bComplete)
+{
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ }
+ m_iState = S_ARC_1;
+ if (bComplete) {
+ m_iState = S_NOOP;
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationArc3(bool bComplete)
+{
+ EndOperationArc2(bComplete);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationDot(void)
+{
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(m_iState);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationLibelemPlace(void)
+{
+ /*
+ Remove library element group object from drawing
+ */
+ if (NULL != m_pCurrent) {
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(m_iState);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationPointMovePlace(void)
+{
+ if (NULL != m_pCurrent) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_ELLIPSE : case WXD_OT_CIRCLE : {
+ DK4_MEMCPY(\
+ &((m_pCurrent->det).e),\
+ &m_ellPointMoveOri,\
+ sizeof(Wxd_det_ellipse_t)\
+ );
+ } break;
+ }
+ if (
+ wxdobj_set_control_point(m_pCurrent, &m_ptPointMoveOri, m_uCurrent)
+ ) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(&((m_pCurrent->det).b.b), &m_uCurrent);
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(&((m_pCurrent->det).i.br), &m_uCurrent);
+ } break;
+ }
+ }
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ }
+ m_uCurrent = (uint16_t)0U;
+#if 0
+ m_iState = S_NOOP;
+#endif
+ /* 2020-03-21 Bugfix
+ When aborting placement we probably want to select
+ another point to move.
+ */
+ m_iState = S_MOVEPT_SELECT;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationPointAddPlace(bool bComplete)
+{
+
+
+#line 986 "WxdkdrawMouse.cpt"
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_delete_control_point(m_pCurrent, m_uCurrent);
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ m_iState = ((bComplete) ? (S_NOOP) : (S_ADDPT_SELECT));
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+
+
+#line 997 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationDrawingSizePlace(bool bComplete)
+{
+
+
+#line 1005 "WxdkdrawMouse.cpt"
+ m_iState = ((bComplete) ? (S_NOOP) : (S_DRWSZ_SELECT));
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ DK4_MEMCPY(&(m_pDrw->bb),&m_oOldSize,sizeof(Wxd_bb_t));
+ DK4_MEMCPY(&(m_oBorder.det.b.b),&m_oOldSize,sizeof(Wxd_bb_t));
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+
+
+#line 1013 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperation(bool bComplete, bool bSkip)
+{
+ int rdl = WXD_REFRESH_MARKUP;
+
+
+#line 1022 "WxdkdrawMouse.cpt"
+ /*
+ _STATE_ End current operation.
+ */
+ switch (m_iState) {
+ /*
+ When ending operations in states having objects under
+ modification which are drawn in the markup pass,
+ we must refresh the drawing.
+ */
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_MOVEPT_SELECT :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ {
+ rdl = WXD_REFRESH_DRAWING;
+ } break;
+ }
+ /*
+ _STATE_ End current operation.
+ */
+ switch (m_iState) {
+ case S_NOOP : {
+ if (NULL != m_pStyle) {
+ m_pStyle = NULL;
+ StyleToGUI();
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ msgMouseR->SetLabel(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ SetStatusText(sNlWx[19]);
+ msgMouseR->Refresh();
+ msgMouseL->Refresh();
+ m_bUpdate = true;
+ }
+ m_pCurrent = NULL;
+ } break;
+ case S_POLY_FIRST : {
+ EndOperationPolyFirst();
+ } break;
+ case S_POLY_FURTHER : {
+ EndOperationPolyFurther(bComplete, bSkip);
+ } break;
+ case S_SPLINE_FIRST : {
+ EndOperationSplineFirst();
+ } break;
+ case S_SPLINE_FURTHER : {
+ EndOperationSplineFurther(bComplete, bSkip);
+ } break;
+ case S_BOX_FIRST : {
+ EndOperationBoxFirst();
+ } break;
+ case S_BOX_OPPOSITE : {
+ EndOperationBoxOpposite(bComplete);
+ } break;
+ case S_CIRCLE_CENTER : {
+ EndOperationCircleCenter();
+ } break;
+ case S_CIRCLE_RADIUS : {
+ EndOperationCircleRadius(bComplete);
+ } break;
+ case S_ELLIPSE_CENTER : {
+ EndOperationEllipseCenter();
+ } break;
+ case S_ELLIPSE_CORNER : {
+ EndOperationEllipseCorner(bComplete);
+ } break;
+ case S_ARC_1 : {
+ EndOperationArc1();
+ } break;
+ case S_ARC_2 : {
+ EndOperationArc2(bComplete);
+ } break;
+ case S_ARC_3 : {
+ EndOperationArc3(bComplete);
+ } break;
+ case S_DOT : {
+ EndOperationDot();
+ } break;
+ case S_LIBELEM_PLACE : {
+ EndOperationLibelemPlace();
+ } break;
+ case S_MOVEPT_PLACE : {
+ EndOperationPointMovePlace();
+ } break;
+ case S_ADDPT_PLACE : {
+ EndOperationPointAddPlace(bComplete);
+ } break;
+ case S_DRWSZ_PLACE : {
+ EndOperationDrawingSizePlace(bComplete);
+ } break;
+ case S_GROUP_ONE : {
+ if ((2 > wxdobj_num_marked_2(m_pDrw)) || (bComplete)) {
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ } break;
+ case S_GROUP_RECT_2 : {
+ m_iState = ((bComplete) ? (S_NOOP) : (S_GROUP_RECT_1));
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ } break;
+ case S_REGION_DELETE : {
+ m_iState = ((bComplete) ? (S_NOOP) : (S_DELETE));
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ } break;
+ default : {
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ } break;
+ }
+
+
+#line 1148 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePolyFirst(void)
+{
+
+
+#line 1156 "WxdkdrawMouse.cpt"
+
+
+#line 1157 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPolyFirst(void)
+{
+
+
+#line 1165 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_polyline(
+ m_pDrw, NULL, 2U,
+ ((WXD_OT_POLYGON == m_iObjToCreate) ? 1 : 0), &m_oStyle
+ );
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).p.p)
+ ) {
+ m_iState = S_POLY_FURTHER;
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ ((m_pCurrent->det).p.p)[0].x = ((m_pCurrent->det).p.p)[1].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).p.p)[0].y = ((m_pCurrent->det).p.p)[1].y =
+ m_ptMousePosGrid.y;
+ if (WXD_OT_POLYGON == m_iObjToCreate) {
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+
+
+#line 1203 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePolyFurther(void)
+{
+ bool bOldAcceptable;
+
+
+#line 1212 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).p.p)
+ ) {
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].y =
+ m_ptMousePosGrid.y;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1240 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPolyFurther(void)
+{
+ dk4_er_t er;
+
+
+#line 1249 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).p.p)
+ ) {
+ /* Fix current segment end point
+ */
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].y =
+ m_ptMousePosGrid.y;
+ dk4error_init(&er);
+ if (
+ wxdobj_add_polypoint(m_pCurrent, (m_pCurrent->det).p.n, &er)
+ ) {
+ /*
+ Initial end point value for new segment
+ */
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].y =
+ m_ptMousePosGrid.y;
+ SetModified();
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1298 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveSplineFirst(void)
+{
+
+
+#line 1306 "WxdkdrawMouse.cpt"
+
+
+#line 1307 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftSplineFirst(void)
+{
+
+
+#line 1315 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_spline(
+ m_pDrw, NULL, 2U,
+ ((WXD_OT_C_SPLINE == m_iObjToCreate) ? 1 : 0), &m_oStyle
+ );
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).s.p)
+ ) {
+ m_iState = S_SPLINE_FURTHER;
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ ((m_pCurrent->det).s.p)[0].x = ((m_pCurrent->det).s.p)[1].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).s.p)[0].y = ((m_pCurrent->det).s.p)[1].y =
+ m_ptMousePosGrid.y;
+ ((m_pCurrent->det).s.p)[0].s = ((m_pCurrent->det).s.p)[1].s =
+ SValueAtEnd();
+ if (WXD_OT_C_SPLINE == m_iObjToCreate) {
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+
+
+#line 1355 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveSplineFurther(void)
+{
+ bool bOldAcceptable;
+
+
+#line 1364 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).s.p)
+ ) {
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].y =
+ m_ptMousePosGrid.y;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1392 "WxdkdrawMouse.cpt"
+}
+
+
+
+double
+WxdkdrawFrame::SValueAtEnd(void)
+{
+ double back = 0.0;
+ if (NULL != m_pCurrent) {
+ if (WXD_OT_C_SPLINE == m_pCurrent->ot) {
+ back = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftSplineFurther(void)
+{
+ dk4_er_t er;
+
+
+#line 1415 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+
+#line 1416 "WxdkdrawMouse.cpt"
+ if (IsAcceptablePoint()) {
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).s.p)
+ ) {
+
+#line 1421 "WxdkdrawMouse.cpt"
+ /* Fix current segment end point
+ */
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].y =
+ m_ptMousePosGrid.y;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].s =
+ (m_bSplineInterpolated ? (-1.0) : (1.0));
+ dk4error_init(&er);
+ if (
+ wxdobj_add_splinepoint(m_pCurrent,(m_pCurrent->det).s.n,&er)
+ ) {
+
+
+#line 1434 "WxdkdrawMouse.cpt"
+ /*
+ Initial end point value for new segment
+ */
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].y =
+ m_ptMousePosGrid.y;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].s =
+ SValueAtEnd();
+ SetModified();
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ }
+ else {
+
+#line 1452 "WxdkdrawMouse.cpt"
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+
+#line 1458 "WxdkdrawMouse.cpt"
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ }
+ else {
+
+#line 1463 "WxdkdrawMouse.cpt"
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1469 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::SetBoxDetails(bool bUpdateRadius)
+{
+ int32_t h;
+ int32_t w;
+ int32_t m;
+ if (NULL != m_pCurrent) {
+ if (m_ptMousePosGrid.x >= m_ptMouseMoveStart.x) {
+ (m_pCurrent->det).b.b.xl = m_ptMouseMoveStart.x;
+ (m_pCurrent->det).b.b.xr = m_ptMousePosGrid.x;
+ }
+ else {
+ (m_pCurrent->det).b.b.xl = m_ptMousePosGrid.x;
+ (m_pCurrent->det).b.b.xr = m_ptMouseMoveStart.x;
+ }
+ if (m_ptMousePosGrid.y >= m_ptMouseMoveStart.y) {
+ (m_pCurrent->det).b.b.yb = m_ptMouseMoveStart.y;
+ (m_pCurrent->det).b.b.yt = m_ptMousePosGrid.y;
+ }
+ else {
+ (m_pCurrent->det).b.b.yb = m_ptMousePosGrid.y;
+ (m_pCurrent->det).b.b.yt = m_ptMouseMoveStart.y;
+ }
+ if (bUpdateRadius && m_bSplineInterpolated) {
+ w = (m_pCurrent->det).b.b.xr - (m_pCurrent->det).b.b.xl;
+ h = (m_pCurrent->det).b.b.yt - (m_pCurrent->det).b.b.yb;
+ m = ((w < h) ? (w) : (h));
+ (m_pCurrent->det).b.r = (uint32_t)(m / (int32_t)4UL);
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveBoxFirst(void)
+{
+
+
+#line 1511 "WxdkdrawMouse.cpt"
+
+
+#line 1512 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftBoxFirst(void)
+{
+
+
+#line 1520 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ m_bAcceptablePoint = false;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_box(m_pDrw, NULL, &m_oStyle);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_iState = S_BOX_OPPOSITE;
+ (m_pCurrent->det).b.r = (uint32_t)0UL;
+ (m_pCurrent->det).b.b.xl = m_ptMousePosGrid.x;
+ (m_pCurrent->det).b.b.xr = m_ptMousePosGrid.x;
+ (m_pCurrent->det).b.b.yb = m_ptMousePosGrid.y;
+ (m_pCurrent->det).b.b.yt = m_ptMousePosGrid.y;
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ }
+
+
+#line 1554 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveBoxOpposite(void)
+{
+ bool bOldAcceptablePoint;
+
+
+#line 1563 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ SetBoxDetails(true);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptablePoint = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptablePoint != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1585 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftBoxOpposite(void)
+{
+
+
+#line 1593 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ if (IsAcceptablePoint()) {
+ m_iState = S_BOX_FIRST;
+ SetBoxDetails(true);
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1617 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveCircleCenter(void)
+{
+
+
+#line 1625 "WxdkdrawMouse.cpt"
+
+
+#line 1626 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::CalculateCircleRadius(uint32_t & rx, dk4_er_t *erp)
+{
+ dk4_er_t er;
+ double dx;
+ double dy;
+ int32_t xdiff = (int32_t)0L;
+ int32_t ydiff = (int32_t)0L;
+
+ dk4error_init(&er);
+ xdiff = dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ m_ptMousePosGrid.x, m_ptMouseMoveStart.x, &er
+ ), &er
+ );
+ ydiff = dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ m_ptMousePosGrid.y, m_ptMouseMoveStart.y, &er
+ ), &er
+ );
+ if ((int32_t)0L == xdiff) {
+ rx = (uint32_t)ydiff;
+ }
+ else {
+ if ((int32_t)0L == ydiff) {
+ rx = (uint32_t)xdiff;
+ }
+ else {
+ dx = (double)xdiff;
+ dy = (double)ydiff;
+ dx = dk4ma_rint(sqrt(dx * dx + dy * dy));
+ rx = dk4ma_uint32_from_double(dx, &er);
+ }
+ }
+ if (DK4_E_NONE != er.ec) {
+ rx = (uint32_t)0UL;
+ dk4error_copy(erp, &er);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftCircleCenter(void)
+{
+
+
+#line 1676 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_circle(m_pDrw, NULL, &m_oStyle);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_iState = S_CIRCLE_RADIUS;
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ (m_pCurrent->det).e.x = m_ptMousePosGrid.x;
+ (m_pCurrent->det).e.y = m_ptMousePosGrid.y;
+ (m_pCurrent->det).e.rx = 0UL;
+ (m_pCurrent->det).e.ry = 0UL;
+ (m_pCurrent->det).e.a = 0;
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ }
+
+
+#line 1709 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveCircleRadius(void)
+{
+ dk4_er_t er;
+ uint32_t rx = 0UL;
+ bool bOldAcceptable;
+
+
+#line 1720 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ dk4error_init(&er);
+ CalculateCircleRadius(rx, &er);
+ if (DK4_E_NONE == er.ec) {
+ (m_pCurrent->det).e.rx = rx;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1749 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftCircleRadius(void)
+{
+ dk4_er_t er;
+ uint32_t rx = 0UL;
+
+
+#line 1759 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (NULL != m_pCurrent) {
+ dk4error_init(&er);
+ CalculateCircleRadius(rx, &er);
+ if (DK4_E_NONE == er.ec) {
+ (m_pCurrent->det).e.rx = rx;
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetModified();
+ m_iState = S_CIRCLE_CENTER;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1790 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::CalculateEllipseRadii(uint32_t & rx,uint32_t & ry,dk4_er_t *erp)
+{
+ dk4_er_t er;
+
+ dk4error_init(&er);
+ rx = (uint32_t)dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ m_ptMousePosGrid.x, m_ptMouseMoveStart.x, &er
+ ), &er
+ );
+ ry = (uint32_t)dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ m_ptMousePosGrid.y, m_ptMouseMoveStart.y, &er
+ ), &er
+ );
+ if (DK4_E_NONE != er.ec) {
+ rx = ry = (uint32_t)0UL;
+ dk4error_copy(erp, &er);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveEllipseCenter(void)
+{
+
+
+#line 1822 "WxdkdrawMouse.cpt"
+
+
+#line 1823 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftEllipseCenter(void)
+{
+
+
+#line 1831 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_ellipse(m_pDrw, NULL, &m_oStyle);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_iState = S_ELLIPSE_CORNER;
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ (m_pCurrent->det).e.x = m_ptMousePosGrid.x;
+ (m_pCurrent->det).e.y = m_ptMousePosGrid.y;
+ (m_pCurrent->det).e.rx = 0UL;
+ (m_pCurrent->det).e.ry = 0UL;
+ (m_pCurrent->det).e.a = 0;
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Mouse position not known */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1868 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveEllipseCorner(void)
+{
+ dk4_er_t er;
+ uint32_t rx = 0UL;
+ uint32_t ry = 0UL;
+ bool bOldAcceptable;
+
+
+#line 1880 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ dk4error_init(&er);
+ CalculateEllipseRadii(rx, ry, &er);
+ if (DK4_E_NONE == er.ec) {
+ (m_pCurrent->det).e.rx = rx;
+ (m_pCurrent->det).e.ry = ry;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1910 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftEllipseCorner(void)
+{
+ dk4_er_t er;
+ uint32_t rx = 0UL;
+ uint32_t ry = 0UL;
+
+
+#line 1921 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (NULL != m_pCurrent) {
+ dk4error_init(&er);
+ CalculateEllipseRadii(rx, ry, &er);
+ if (DK4_E_NONE == er.ec) {
+ (m_pCurrent->det).e.rx = rx;
+ (m_pCurrent->det).e.ry = ry;
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetModified();
+ m_iState = S_ELLIPSE_CENTER;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported). */
+ }
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 1953 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveArc1(void)
+{
+
+
+#line 1961 "WxdkdrawMouse.cpt"
+
+
+#line 1962 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftArc1(void)
+{
+
+
+#line 1970 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_arc(
+ m_pDrw, NULL, ((WXD_OT_C_ARC == m_iObjToCreate) ? 1 : 0), &m_oStyle
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_iState = S_ARC_2;
+ m_bAcceptablePoint = false;
+ (m_pCurrent->det).a.x1 =
+ (m_pCurrent->det).a.x2 =
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y1 =
+ (m_pCurrent->det).a.y2 =
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ (m_pCurrent->det).a.x = (double)(m_ptMousePosGrid.x);
+ (m_pCurrent->det).a.y = (double)(m_ptMousePosGrid.y);
+ (m_pCurrent->det).a.r = 0.0;
+ (m_pCurrent->det).a.a = 0.0;
+ (m_pCurrent->det).a.b = 2.0 * M_PI;
+ (m_pCurrent->det).a.d = (int8_t)0;
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ SetMouseAndStatusTexts(m_iState);
+ if (WXD_OT_C_ARC == m_iObjToCreate) {
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Unknown mouse position */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 2013 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveArc2(void)
+{
+ bool bOldAcceptable;
+
+
+#line 2022 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ (m_pCurrent->det).a.x2 =
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y2 =
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: Unknown mouse position */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 2047 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftArc2(void)
+{
+
+
+#line 2055 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (NULL != m_pCurrent) {
+ (m_pCurrent->det).a.x2 =
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y2 =
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ m_iState = S_ARC_3;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ }
+ else {
+ /* RROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 2079 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveArc3(void)
+{
+ bool bOldAcceptable;
+
+
+#line 2088 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ wxdarc_calculation(
+ &((m_pCurrent->det).a.x),
+ &((m_pCurrent->det).a.y),
+ &((m_pCurrent->det).a.r),
+ &((m_pCurrent->det).a.a),
+ &((m_pCurrent->det).a.b),
+ &((m_pCurrent->det).a.d),
+ (m_pCurrent->det).a.x1,
+ (m_pCurrent->det).a.y1,
+ (m_pCurrent->det).a.x2,
+ (m_pCurrent->det).a.y2,
+ (m_pCurrent->det).a.x3,
+ (m_pCurrent->det).a.y3
+ );
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: Unknown mouse position */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 2125 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftArc3(void)
+{
+
+
+#line 2133 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (NULL != m_pCurrent) {
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ wxdarc_calculation(
+ &((m_pCurrent->det).a.x),
+ &((m_pCurrent->det).a.y),
+ &((m_pCurrent->det).a.r),
+ &((m_pCurrent->det).a.a),
+ &((m_pCurrent->det).a.b),
+ &((m_pCurrent->det).a.d),
+ (m_pCurrent->det).a.x1,
+ (m_pCurrent->det).a.y1,
+ (m_pCurrent->det).a.x2,
+ (m_pCurrent->det).a.y2,
+ (m_pCurrent->det).a.x3,
+ (m_pCurrent->det).a.y3
+ );
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ m_iState = S_ARC_1;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ /* ERROR: Memory (already reported). */
+ }
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 2172 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDot(void)
+{
+
+
+#line 2180 "WxdkdrawMouse.cpt"
+
+
+#line 2181 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDot(void)
+{
+
+
+#line 2189 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ m_pCurrent = wxdobj_add_dot(
+ m_pDrw, NULL,
+ ((WXD_OT_DOT_WHITE == m_iObjToCreate) ? (1) : (0)),
+ &m_oStyle
+ );
+ if (NULL != m_pCurrent) {
+
+
+#line 2197 "WxdkdrawMouse.cpt"
+
+
+#line 2198 "WxdkdrawMouse.cpt"
+
+
+#line 2199 "WxdkdrawMouse.cpt"
+
+
+#line 2200 "WxdkdrawMouse.cpt"
+
+
+#line 2201 "WxdkdrawMouse.cpt"
+
+
+#line 2202 "WxdkdrawMouse.cpt"
+ (m_pCurrent->det).d.x = m_ptMousePosGrid.x;
+ (m_pCurrent->det).d.y = m_ptMousePosGrid.y;
+ (m_pCurrent->det).d.d = (
+ (WXD_OT_DOT_WHITE == m_iObjToCreate)
+ ? (m_iv[IVI_DOT_DIAMETER_WHITE])
+ : (m_iv[IVI_DOT_DIAMETER_FILLED])
+ );
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (DK4_I16_MAX > m_pCurrent->lay) {
+ m_pCurrent->lay += (int16_t)1;
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 2232 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveText(void)
+{
+
+
+#line 2240 "WxdkdrawMouse.cpt"
+
+
+#line 2241 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftText(void)
+{
+ Wxd_object_t *pObject = NULL;
+#if 0
+ wxChar const *ptrExportText = NULL;
+ wxChar const *ptrScreenText = NULL;
+#endif
+ wxChar *ptrExportText = NULL;
+ wxChar *ptrScreenText = NULL;
+ int32_t x;
+ int32_t y;
+ bool bLaTeX;
+
+
+#line 2259 "WxdkdrawMouse.cpt"
+ x = m_ptMousePosGrid.x;
+ y = m_ptMousePosGrid.y;
+ bLaTeX = cbStyleTextLaTeX->GetValue();
+ m_pCurrent = NULL;
+ if (m_bMousePos) {
+ WxdkdrawDlgTextInput tid(
+ this, sTexts, sNlWx, &ptrExportText, &ptrScreenText, bLaTeX,
+ &m_oErrorReport
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ if (wxID_OK == tid.ShowModal()) {
+ if (NULL != ptrExportText) {
+ pObject = wxdobj_add_textlabel(
+ m_pDrw, NULL, ptrExportText, &m_oStyle
+ );
+ if (NULL != pObject) {
+ (pObject->det).t.a = 0;
+ (pObject->det).t.x = x;
+ (pObject->det).t.y = y;
+ (pObject->det).t.tsc = ptrScreenText;
+ UpdateFonts();
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ wxdobj_bb_simple_object(m_pDrw, pObject);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ }
+#if 0
+ WxdkdrawDlgTextInput tid(this, sTexts, sNlWx, bLaTeX);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ if (wxID_OK == tid.ShowModal()) {
+ wxTextCtrl *pExportText = tid.GetExportTextCtrl();
+ wxTextCtrl *pScreenText = tid.GetScreenTextCtrl();
+ wxString stringExp = pExportText->GetValue();
+ wxString stringScr = pScreenText->GetValue();
+ wxCStrData sExportText = stringExp.c_str();
+ wxCStrData sScreenText = stringScr.c_str();
+ ptrExportText = (wxChar const *)sExportText;
+ ptrScreenText = (wxChar const *)sScreenText;
+ if ((NULL != ptrExportText)) {
+ if (0 < dk4strx_len(ptrExportText)) {
+ pObject = wxdobj_add_textlabel(
+ m_pDrw, NULL, ptrExportText, &m_oStyle
+ );
+ if (NULL != pObject) {
+ (pObject->det).t.a = 0;
+ (pObject->det).t.x = m_ptMousePosGrid.x;
+ (pObject->det).t.y = m_ptMousePosGrid.y;
+ UpdateFonts();
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ wxdobj_bb_simple_object(m_pDrw, pObject);
+ if (
+ bLaTeX
+ && (NULL != ptrScreenText)
+ && (0 < dk4strx_len(ptrScreenText))
+ ) {
+ (pObject->det).t.tsc =
+ dk4strx_dup(ptrScreenText, NULL);
+ if (NULL == (pObject->det).t.tsc) {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport,
+ DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ UpdateFonts();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: No input for export text */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_NO_EXPORT_TEXT
+ );
+ }
+ }
+ else {
+ /* ERROR: No export text (memory) */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_NO_EXPORT_TEXT
+ );
+ }
+ }
+ else {
+ /* Aborted by user */
+ }
+#endif
+ }
+ else {
+ /* ERROR: Mouse position outside coordinates */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+
+
+#line 2367 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveImage1(void)
+{
+
+
+#line 2375 "WxdkdrawMouse.cpt"
+
+
+#line 2376 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveImage2(void)
+{
+ bool bOldAcceptable;
+
+
+#line 2385 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+
+
+#line 2394 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftImage1(void)
+{
+
+
+#line 2402 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_iState = S_IMG_2;
+ m_bAcceptablePoint = false;
+ SetMouseAndStatusTexts(m_iState);
+ }
+
+
+#line 2409 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftImage2(void)
+{
+ wxString sDialogTitle(sTexts[409]);
+ wxString sFileTypes(image_files_to_open);
+ wxChar const *vptr;
+ Wxd_object_t *pobj;
+
+
+#line 2421 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (
+ (m_ptMouseMoveStart.x != m_ptMousePosGrid.x)
+ && (m_ptMouseMoveStart.y != m_ptMousePosGrid.y)
+ ) {
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sImageDir, wxEmptyString,
+ sFileTypes, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sImageDir, wxEmptyString,
+ sFileTypes, wxOPEN
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ m_sImageDir = dlg.GetDirectory();
+ {
+ wxCStrData vstrdata = pa.c_str();
+ vptr = (wxChar const *)vstrdata;
+ if (NULL != vptr) {
+ pobj = wxdobj_add_image(m_pDrw,NULL,vptr,&m_oStyle);
+ if (NULL != pobj) {
+ (pobj->det).i.br.xl = m_ptMouseMoveStart.x;
+ (pobj->det).i.br.yb = m_ptMouseMoveStart.y;
+ (pobj->det).i.br.xr = m_ptMousePosGrid.x;
+ (pobj->det).i.br.yt = m_ptMousePosGrid.y;
+ wxdobj_bb_correct(&((pobj->det).i.br));
+ wxdobj_load_image(
+ pobj,
+ pAppHelp->GetDkEncoding(),
+ pAppHelp->GetWxEncoding()
+ );
+ SetModified();
+ wxdobj_bb_simple_object(m_pDrw, pobj);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport,
+ DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: No string data */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_NO_FILENAME
+ );
+ }
+ }
+ }
+ else {
+ }
+ m_iState = S_IMG_1;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+ }
+
+
+#line 2485 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveLibelemPlace(void)
+{
+
+
+#line 2493 "WxdkdrawMouse.cpt"
+ /*
+ Reaction is same as placing an element to move
+ */
+ MouseMoveMovePlace();
+ if (NULL != m_pCurrent) {
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+
+
+#line 2501 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftLibelemPlace(void)
+{
+
+
+#line 2509 "WxdkdrawMouse.cpt"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 1);
+ m_iState = S_NOOP;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ if (NULL != m_pCurrent) {
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ AddLibelem();
+ }
+ }
+
+
+#line 2522 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointMoveSelect(void)
+{
+ Wxd_object_t *prevobj;
+ uint16_t prevpoint;
+
+
+
+#line 2533 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ /*
+ Save previous candidate object and point
+ */
+ prevobj = m_pCurrent;
+ prevpoint = m_uCurrent;
+ /*
+ Check for new candicate
+ */
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_move_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+
+
+#line 2552 "WxdkdrawMouse.cpt"
+ }
+ /*
+ On object or point change redraw the markup
+ */
+ if (
+ ((NULL != m_pCurrent) && (NULL == prevobj))
+ || ((NULL == m_pCurrent) && (NULL != prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ if ((prevobj != m_pCurrent) || (prevpoint != m_uCurrent)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+
+
+#line 2567 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointMoveSelect(void)
+{
+
+
+#line 2575 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+
+#line 2576 "WxdkdrawMouse.cpt"
+ if (NULL != m_pCurrent) {
+
+#line 2577 "WxdkdrawMouse.cpt"
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+
+#line 2579 "WxdkdrawMouse.cpt"
+ m_pCurrent = wxdobj_point_move_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+
+#line 2583 "WxdkdrawMouse.cpt"
+ if (NULL != m_pCurrent) {
+
+#line 2584 "WxdkdrawMouse.cpt"
+
+
+#line 2585 "WxdkdrawMouse.cpt"
+
+
+#line 2586 "WxdkdrawMouse.cpt"
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_bSnap = (
+ (0 == cbPointMoveMode->GetSelection()) ? (true) : (false)
+ );
+
+
+#line 2591 "WxdkdrawMouse.cpt"
+
+
+#line 2592 "WxdkdrawMouse.cpt"
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+
+
+#line 2598 "WxdkdrawMouse.cpt"
+
+
+#line 2599 "WxdkdrawMouse.cpt"
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+
+
+#line 2603 "WxdkdrawMouse.cpt"
+
+
+#line 2604 "WxdkdrawMouse.cpt"
+ if (
+ wxdobj_get_control_point(
+ &m_ptPointMoveOri, m_pCurrent, m_uCurrent
+ )
+ ) {
+
+
+#line 2610 "WxdkdrawMouse.cpt"
+
+
+#line 2611 "WxdkdrawMouse.cpt"
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_ELLIPSE : case WXD_OT_CIRCLE : {
+
+
+#line 2614 "WxdkdrawMouse.cpt"
+
+
+#line 2615 "WxdkdrawMouse.cpt"
+ DK4_MEMCPY(\
+ &m_ellPointMoveOri,\
+ &((m_pCurrent->det).e),\
+ sizeof(Wxd_det_ellipse_t)\
+ );
+
+
+#line 2621 "WxdkdrawMouse.cpt"
+
+
+#line 2622 "WxdkdrawMouse.cpt"
+ } break;
+ }
+ if (m_bSnap) {
+
+
+#line 2626 "WxdkdrawMouse.cpt"
+
+
+#line 2627 "WxdkdrawMouse.cpt"
+ wxdobj_set_control_point(
+ m_pCurrent, &m_ptMousePosGrid, m_uCurrent
+ );
+
+
+#line 2631 "WxdkdrawMouse.cpt"
+
+
+#line 2632 "WxdkdrawMouse.cpt"
+ }
+
+#line 2633 "WxdkdrawMouse.cpt"
+ m_iState = S_MOVEPT_PLACE;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+
+#line 2638 "WxdkdrawMouse.cpt"
+ /* ERROR: Failed to get control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_GET_CONTROL_POINT
+ );
+ }
+ }
+ }
+
+
+#line 2646 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointMovePlace(void)
+{
+ dk4_er_t er;
+ Wxd_point_t pt;
+
+
+#line 2656 "WxdkdrawMouse.cpt"
+
+
+#line 2657 "WxdkdrawMouse.cpt"
+ if (m_bMousePos && (NULL != m_pCurrent)) {
+
+#line 2658 "WxdkdrawMouse.cpt"
+ if (m_bSnap || m_bMouseDiff) {
+
+#line 2659 "WxdkdrawMouse.cpt"
+ if (m_bSnap) {
+
+#line 2660 "WxdkdrawMouse.cpt"
+ if (
+ wxdobj_set_control_point(
+ m_pCurrent, &m_ptMousePosGrid, m_uCurrent
+ )
+ ) {
+
+#line 2665 "WxdkdrawMouse.cpt"
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).b.b), &m_uCurrent
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).i.br), &m_uCurrent
+ );
+ } break;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ else {
+
+#line 2681 "WxdkdrawMouse.cpt"
+ /* ERROR: Failed to set control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_SET_CONTROL_POINT
+ );
+ }
+ }
+ else {
+
+#line 2688 "WxdkdrawMouse.cpt"
+ dk4error_init(&er);
+ pt.x = dk4ma_int32_t_add(
+ m_ptPointMoveOri.x, m_ptMouseMoveDiff.x, &er
+ );
+ pt.y = dk4ma_int32_t_add(
+ m_ptPointMoveOri.y, m_ptMouseMoveDiff.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+
+#line 2696 "WxdkdrawMouse.cpt"
+ if (
+ wxdobj_set_control_point(m_pCurrent, &pt, m_uCurrent)
+ ) {
+
+#line 2699 "WxdkdrawMouse.cpt"
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).b.b), &m_uCurrent
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).i.br), &m_uCurrent
+ );
+ } break;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ else {
+
+#line 2715 "WxdkdrawMouse.cpt"
+ /* ERROR: Failed to set control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_SET_CONTROL_POINT
+ );
+ }
+ }
+ else {
+
+#line 2722 "WxdkdrawMouse.cpt"
+ /* ERROR: Math overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ }
+ else {
+
+#line 2730 "WxdkdrawMouse.cpt"
+ /* ERROR: Failed to calculate mouse difference */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else {
+ if (!(m_bMousePos)) {
+
+#line 2739 "WxdkdrawMouse.cpt"
+ }
+ if (NULL == m_pCurrent) {
+
+#line 2741 "WxdkdrawMouse.cpt"
+ }
+ }
+#endif
+
+
+#line 2745 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ModifySplineValue(Wxd_object_t *pCurrent, uint16_t uCurrent)
+{
+ double olds;
+
+ if (
+ (NULL != pCurrent)
+ && (
+ (WXD_OT_O_SPLINE == pCurrent->ot)
+ || (WXD_OT_C_SPLINE == pCurrent->ot)
+ )
+ && (uCurrent < (pCurrent->det).s.n)
+ ) {
+ WxdkdrawDlgSplineValue dlg(
+ this, drawco, m_pDrw, sTexts, &(((pCurrent->det).s.p)[uCurrent].s)
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, dlg);
+ olds = ((pCurrent->det).s.p)[uCurrent].s;
+ dlg.ShowModal();
+ wxdobj_bb_modified_object(m_pDrw, pCurrent);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_bUpdate = true;
+ if (olds != ((pCurrent->det).s.p)[uCurrent].s) {
+ SetModified();
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointMovePlace(void)
+{
+ dk4_er_t er;
+ Wxd_point_t pt;
+
+
+#line 2785 "WxdkdrawMouse.cpt"
+ if (m_bMousePos && (NULL != m_pCurrent)) {
+
+
+#line 2787 "WxdkdrawMouse.cpt"
+ if (m_bSnap || m_bMouseDiff) {
+ if (m_bSnap) {
+ if (
+ wxdobj_set_control_point(
+ m_pCurrent, &m_ptMousePosGrid, m_uCurrent
+ )
+ ) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).b.b), &m_uCurrent
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).i.br), &m_uCurrent
+ );
+ /* 2020-03-24 Bugfix
+ After changing the available space we must
+ re-calculate the used space
+ */
+ wxdobj_image_placement(m_pCurrent);
+ } break;
+ }
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (
+ (NULL != m_pCurrent)
+ && (
+ (WXD_OT_O_SPLINE == m_pCurrent->ot)
+ || (WXD_OT_C_SPLINE == m_pCurrent->ot)
+ )
+ && (m_uCurrent < (m_pCurrent->det).s.n)
+ ) {
+#if 0
+ /* 2020-03-22 Modification
+ Changing spline s value is now decoupled
+ from moving spline points.
+ */
+ ModifySplineValue(m_pCurrent, m_uCurrent);
+#endif
+ }
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ m_iState = S_MOVEPT_SELECT;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ else {
+ /* ERROR: Failed to set control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_SET_CONTROL_POINT
+ );
+ }
+ }
+ else {
+ dk4error_init(&er);
+ pt.x = dk4ma_int32_t_add(
+ m_ptPointMoveOri.x, m_ptMouseMoveDiff.x, &er
+ );
+ pt.y = dk4ma_int32_t_add(
+ m_ptPointMoveOri.y, m_ptMouseMoveDiff.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ if (
+ wxdobj_set_control_point(m_pCurrent, &pt, m_uCurrent)
+ ) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).b.b), &m_uCurrent
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).i.br), &m_uCurrent
+ );
+ } break;
+ }
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (
+ (NULL != m_pCurrent)
+ && (
+ (WXD_OT_O_SPLINE == m_pCurrent->ot)
+ || (WXD_OT_C_SPLINE == m_pCurrent->ot)
+ )
+ && (m_uCurrent < (m_pCurrent->det).s.n)
+ ) {
+#if 0
+ ModifySplineValue(m_pCurrent, m_uCurrent);
+#endif
+ }
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ m_iState = S_MOVEPT_SELECT;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ else {
+ /* ERROR: Failed to set control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_SET_CONTROL_POINT
+ );
+ }
+ }
+ else {
+ /* ERROR: Math overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ }
+ else {
+ /* ERROR: Failed to calculate mouse difference */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+
+
+#line 2909 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointDelete(void)
+{
+ Wxd_object_t *prevobj;
+ uint16_t prevpoint;
+
+
+#line 2919 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ prevobj = m_pCurrent;
+ prevpoint = m_uCurrent;
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_del_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+
+
+#line 2932 "WxdkdrawMouse.cpt"
+ }
+ if (
+ ((NULL != m_pCurrent) && (NULL == prevobj))
+ || ((NULL == m_pCurrent) && (NULL != prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ if ((prevobj != m_pCurrent) || (prevpoint != m_uCurrent)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+
+
+#line 2944 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointDelete(void)
+{
+ Wxd_object_t *prevobj;
+#if 0
+ uint16_t prevpoint;
+#endif
+
+
+#line 2956 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ prevobj = m_pCurrent;
+#if 0
+ prevpoint = m_uCurrent;
+#endif
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_del_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ wxdobj_delete_control_point(m_pCurrent, m_uCurrent);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ SetModified();
+ }
+ else {
+ if (NULL != prevobj) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ }
+
+
+#line 2983 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointAddSelect(void)
+{
+ Wxd_object_t *prevobj;
+ uint16_t prevpoint;
+ bool prevappend;
+
+
+#line 2994 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ prevobj = m_pCurrent;
+ prevpoint = m_uCurrent;
+ prevappend = m_bAppendPoint;
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_add_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent, &m_bAppendPoint,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ }
+ if (
+ (prevobj != m_pCurrent)
+ || (prevpoint != m_uCurrent)
+ || (prevappend != m_bAppendPoint)
+ ) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ if (
+ ((NULL == m_pCurrent) && (NULL != prevobj))
+ || ((NULL != m_pCurrent) && (NULL == prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+
+
+#line 3023 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointAddSelect(void)
+{
+ bool bres = false;
+
+
+#line 3032 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_add_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent, &m_bAppendPoint,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ if (m_bAppendPoint) {
+ bres = wxdobj_add_control_point(
+ m_pCurrent, (m_uCurrent + (uint16_t)1U), &m_ptMousePosGrid
+ );
+ if (bres) {
+ m_uCurrent++;
+ }
+ }
+ else {
+ bres = wxdobj_add_control_point(
+ m_pCurrent, m_uCurrent, &m_ptMousePosGrid
+ );
+ }
+ if (bres) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ m_iState = S_ADDPT_PLACE;
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ }
+
+
+#line 3064 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointAddPlace(void)
+{
+
+
+#line 3072 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ wxdobj_set_control_point(m_pCurrent,&m_ptMousePosGrid,m_uCurrent);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ }
+
+
+#line 3080 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointAddPlace(void)
+{
+
+
+#line 3088 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ wxdobj_set_control_point(m_pCurrent,&m_ptMousePosGrid,m_uCurrent);
+ m_iState = S_ADDPT_SELECT;
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+
+
+#line 3101 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDrawingSizeSelect(void)
+{
+ dk4_gra_point_t ppt;
+ double dlim;
+ double d;
+ uint16_t prevSelected;
+ uint16_t newSelected;
+ bool prevHavePoint;
+
+
+
+#line 3116 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ prevSelected = m_uCurrent;
+ prevHavePoint = m_bHaveCornerPoint;
+ newSelected = (uint16_t)0U;
+ dlim = 2.0 * (double)(drawco->m_uGridSnap);
+ ppt.x = (double)(m_ptMousePosRaw.x);
+ ppt.y = (double)(m_ptMousePosRaw.y);
+ d = wxdobj_dist_box(
+ &(m_pDrw->bb), (uint32_t)0UL, &ppt, true, &newSelected
+ );
+ if (dlim >= d) {
+ m_uCurrent = newSelected;
+ m_bHaveCornerPoint = true;
+ }
+ else {
+ m_uCurrent = (uint16_t)0U;
+ m_bHaveCornerPoint = false;
+ }
+ if (
+ (prevSelected != m_uCurrent)
+ || (prevHavePoint != m_bHaveCornerPoint)
+ ) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ if (prevHavePoint != m_bHaveCornerPoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+
+
+#line 3145 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDrawingSizeSelect(void)
+{
+ dk4_gra_point_t ppt;
+ double dlim;
+ double d;
+ uint16_t newSelected;
+
+
+#line 3157 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ newSelected = (uint16_t)0U;
+ dlim = 2.0 * (double)(drawco->m_uGridSnap);
+ ppt.x = (double)(m_ptMousePosRaw.x);
+ ppt.y = (double)(m_ptMousePosRaw.y);
+ d = wxdobj_dist_box(
+ &(m_pDrw->bb), (uint32_t)0UL, &ppt, true, &newSelected
+ );
+ if (dlim >= d) {
+ m_uCurrent = newSelected;
+ m_bHaveCornerPoint = true;
+ m_bSnap = (
+ (0 == cbPointMoveMode->GetSelection()) ? (true) : (false)
+ );
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ DK4_MEMCPY(\
+ &m_ptPointMoveOri,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ switch ( (int)m_uCurrent ) {
+ case 3 : {
+ m_ptPointMoveOri.x = m_oBorder.det.b.b.xl;
+ m_ptPointMoveOri.y = m_oBorder.det.b.b.yt;
+ } break;
+ case 2 : {
+ m_ptPointMoveOri.x = m_oBorder.det.b.b.xr;
+ m_ptPointMoveOri.y = m_oBorder.det.b.b.yt;
+ } break;
+ case 1 : {
+ m_ptPointMoveOri.x = m_oBorder.det.b.b.xr;
+ m_ptPointMoveOri.y = m_oBorder.det.b.b.yb;
+ } break;
+ default : {
+ m_ptPointMoveOri.x = m_oBorder.det.b.b.xl;
+ m_ptPointMoveOri.y = m_oBorder.det.b.b.yb;
+ } break;
+ }
+ if (m_bSnap) {
+ wxdobj_set_control_point(
+ &m_oBorder, &m_ptMousePosGrid, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ else {
+ }
+ m_iState = S_DRWSZ_PLACE;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+
+
+#line 3221 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDrawingSizePlace(void)
+{
+ dk4_er_t er;
+ Wxd_point_t pt;
+
+
+#line 3231 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (m_bSnap) {
+ wxdobj_set_control_point(
+ &m_oBorder, &m_ptMousePosGrid, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ else {
+ if (m_bMouseDiff) {
+
+#line 3245 "WxdkdrawMouse.cpt"
+ dk4error_init(&er);
+ pt.x = dk4ma_int32_t_add(
+ m_ptPointMoveOri.x, m_ptMouseMoveDiff.x, &er
+ );
+ pt.y = dk4ma_int32_t_add(
+ m_ptPointMoveOri.y, m_ptMouseMoveDiff.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ wxdobj_set_control_point(
+ &m_oBorder, &pt, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ }
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+
+
+#line 3268 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDrawingSizePlace(void)
+{
+ dk4_er_t er;
+ Wxd_point_t pt;
+ bool bEqual = false;;
+
+
+#line 3279 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (m_bSnap) {
+
+#line 3281 "WxdkdrawMouse.cpt"
+ wxdobj_set_control_point(
+ &m_oBorder, &m_ptMousePosGrid, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+#if 0
+ bEqual = wxdobj_bb_equal(&(m_pDrw->bb), &(m_oBorder.det.b.b));
+#endif
+ bEqual = wxdobj_bb_equal(&(m_pDrw->bb), &m_oOldSize);
+
+
+#line 3292 "WxdkdrawMouse.cpt"
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ else {
+ if (m_bMouseDiff) {
+
+#line 3298 "WxdkdrawMouse.cpt"
+ dk4error_init(&er);
+ pt.x = dk4ma_int32_t_add(
+ m_ptPointMoveOri.x, m_ptMouseMoveDiff.x, &er
+ );
+ pt.y = dk4ma_int32_t_add(
+ m_ptPointMoveOri.y, m_ptMouseMoveDiff.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ wxdobj_set_control_point(
+ &m_oBorder, &pt, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+#if 0
+ bEqual = wxdobj_bb_equal(
+ &(m_pDrw->bb), &(m_oBorder.det.b.b)
+ );
+#endif
+ bEqual = wxdobj_bb_equal(&(m_pDrw->bb), &m_oOldSize);
+
+
+#line 3319 "WxdkdrawMouse.cpt"
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ }
+ }
+ if ((!(bEqual)) && (0 != m_iv[IVI_C_COR_POSITION])) {
+ OnCenterViewFunction();
+
+#line 3327 "WxdkdrawMouse.cpt"
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ m_iState = S_DRWSZ_SELECT;
+ SetMouseAndStatusTexts(m_iState);
+ if (0 != DK4_MEMCMP(&m_oOldSize,&(m_pDrw->bb),sizeof(Wxd_bb_t))) {
+ SetModified();
+ }
+ DK4_MEMCPY(&m_oOldSize,&(m_pDrw->bb),sizeof(Wxd_bb_t));
+ }
+
+
+#line 3337 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveFlip(void)
+{
+ Wxd_object_t *pOldCurrent;
+
+
+#line 3346 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ }
+ if (
+ ((NULL != m_pCurrent) && (NULL == pOldCurrent))
+ || ((NULL == m_pCurrent) && (NULL != pOldCurrent))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ else {
+ }
+
+
+#line 3366 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftFlip(void)
+{
+ Wxd_bb_t bball;
+ Wxd_bb_t bbobj;
+ bool bFirst;
+ bool bSuccess;
+ Wxd_object_t *pobj;
+
+
+#line 3379 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject(true);
+ if (NULL != m_pCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_GROUP_BEGIN : {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ /*
+ Gather bounding box information
+ */
+ wxdobj_det_init_bb(&bball);
+ bFirst = true;
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (
+ (NULL != pobj)
+ && (wxdobj_is_marked(pobj, OBJ_MARKER_1))
+ ) {
+ if (wxdobj_control_pt_to_bb(&bbobj, pobj)) {
+ if (bFirst) {
+ DK4_MEMCPY(&bball,&bbobj,sizeof(Wxd_bb_t));
+ bFirst = false;
+ }
+ else {
+ wxdobj_bb_add_bb(&bball, &bbobj);
+ }
+ }
+ }
+ } while (NULL != pobj);
+ /*
+ Run test
+ */
+ bSuccess = true;
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (
+ (NULL != pobj)
+ && (wxdobj_is_marked(pobj, OBJ_MARKER_1))
+ ) {
+ bFirst = wxdobj_flip_object(
+ pobj, &bball, m_bVerticalFlip, false
+ );
+ if (!(bFirst)) { bSuccess = false; }
+ }
+ } while (NULL != pobj);
+ /*
+ Real run
+ */
+ if (bSuccess) {
+ bSuccess = false;
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj =
+ (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (
+ (NULL != pobj)
+ && (wxdobj_is_marked(pobj, OBJ_MARKER_1))
+ ) {
+ wxdobj_flip_object(
+ pobj, &bball, m_bVerticalFlip, true
+ );
+ bSuccess = true;
+ }
+ } while (NULL != pobj);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ if (bSuccess) {
+ SetModified();
+ }
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ } break;
+ case WXD_OT_TEXT :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_ELLIPSE : {
+ if (wxdobj_control_pt_to_bb(&bbobj, m_pCurrent)) {
+ if (
+ wxdobj_flip_object(
+ m_pCurrent, &bbobj, m_bVerticalFlip, false
+ )
+ ) {
+ wxdobj_flip_object(
+ m_pCurrent, &bbobj, m_bVerticalFlip, true
+ );
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ SetModified();
+ }
+ }
+ } break;
+ case WXD_OT_CIRCLE :
+ case WXD_OT_BOX :
+ case WXD_OT_IMAGE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ /* Intentionally empty */
+ } break;
+ }
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+
+
+#line 3488 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveGroupOne(void)
+{
+ Wxd_object_t *pOldCurrent;
+
+
+#line 3497 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+
+
+#line 3510 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::GroupNewForMarkedObjects(void)
+{
+ dk4_er_t er;
+ Wxd_object_t *pobj;
+ Wxd_object_t *pngrp;
+ int res;
+ bool bFoundObject;
+ bool bError;
+
+ pngrp = wxdobj_drw_add_group(m_pDrw, NULL);
+ if (NULL != pngrp) {
+ bError = false;
+ do {
+ bFoundObject = false;
+ dk4sto_it_reset(m_pDrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_stru);
+ if (NULL != pobj) {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_2)) {
+ bFoundObject = true;
+ dk4error_init(&er);
+ res = dk4sto_add((pngrp->det).g.s_e, pobj, &er);
+ if (0 != res) {
+ dk4error_init(&er);
+ res = dk4sto_remove(m_pDrw->s_stru, pobj, &er);
+ if (0 != res) {
+ pobj->pa = pngrp;
+ }
+ else {
+ bError = true;
+ (void)dk4sto_remove(
+ (pngrp->det).g.s_e, pobj, NULL
+ );
+ /* ERROR: Failed to delete */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOVE_TO_GROUP
+ );
+ }
+ }
+ else {
+ bError = true;
+ /* ERROR: Failed to insert (memory) */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ }
+ } while ((NULL != pobj) && (!(bFoundObject)) && (!(bError)));
+ } while ((bFoundObject) && (!(bError)));
+ wxdobj_bb_group_structural(m_pDrw, pngrp);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+}
+
+
+
+void
+WxdkdrawFrame::UngroupObjects(Wxd_object_t *pgrp)
+{
+ Wxd_object_t *pobj; /* Current object */
+ int res; /* Storage operation result */
+ bool bFound; /* Found an object in current pass */
+ bool bError; /* Error occured, stop */
+
+
+#line 3585 "WxdkdrawMouse.cpt"
+ bError = false;
+ do {
+ bFound = false;
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next((pgrp->det).g.i_e);
+ if (NULL != pobj) {
+ bFound = true;
+ res = dk4sto_add(m_pDrw->s_stru, pobj, NULL);
+ if (0 != res) {
+ res = dk4sto_remove((pgrp->det).g.s_e, pobj, NULL);
+ if (0 != res) {
+
+#line 3597 "WxdkdrawMouse.cpt"
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ pobj->pa = NULL;
+ }
+ else {
+
+#line 3601 "WxdkdrawMouse.cpt"
+ (void)dk4sto_remove(m_pDrw->s_stru, pobj, NULL);
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_UNGROUP_OBJECT
+ );
+ }
+ }
+ else {
+
+#line 3608 "WxdkdrawMouse.cpt"
+ /* ERROR: Failed to add */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_UNGROUP_OBJECT
+ );
+ }
+ }
+ } while ((NULL != pobj) && (!(bFound)) && (!(bError)));
+ } while (bFound && (!(bError)));
+ if (!(bError)) {
+
+#line 3617 "WxdkdrawMouse.cpt"
+ res = dk4sto_remove(m_pDrw->s_stru, pgrp, NULL);
+ if (0 != res) {
+
+#line 3619 "WxdkdrawMouse.cpt"
+ if (NULL != (pgrp->det).g.i_e) {
+ dk4sto_it_close((pgrp->det).g.i_e);
+ (pgrp->det).g.i_e = NULL;
+ }
+ if (NULL != (pgrp->det).g.s_e) {
+ dk4sto_close((pgrp->det).g.s_e);
+ (pgrp->det).g.s_e = NULL;
+ }
+ pgrp->pa = NULL;
+ pgrp->psti = NULL;
+ pgrp->play = NULL;
+ dk4mem_free(pgrp);
+ }
+ else {
+ /* ERROR: Failed to remove */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_UNGROUP_OBJECT
+ );
+ }
+ }
+
+
+#line 3640 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftGroupOne(void)
+{
+
+
+#line 3648 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject(true);
+ if (NULL != m_pCurrent) {
+ if (wxdobj_is_marked(m_pCurrent, OBJ_MARKER_2)) {
+ wxdobj_unmark_recursively(m_pCurrent, OBJ_MARKER_2);
+ }
+ else {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_2);
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ if (2 <= wxdobj_num_marked_2(m_pDrw)) {
+ GroupNewForMarkedObjects();
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ m_pCurrent = NULL;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ SetModified();
+ }
+ else {
+ /* Intentionally empty, do not group a single element */
+ }
+ }
+ }
+
+
+#line 3678 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveUngroup(void)
+{
+ Wxd_object_t *pOldCurrent;
+
+
+#line 3687 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (NULL != m_pCurrent) {
+ if (WXD_OT_GROUP_BEGIN != m_pCurrent->ot) {
+ m_pCurrent = NULL;
+ }
+ }
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+
+
+#line 3705 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftUngroup(void)
+{
+ Wxd_object_t *pobj;
+
+
+#line 3714 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ pobj = FindNearestObject(true);
+ if (NULL != pobj) {
+ UngroupObjects(pobj);
+ SetModified();
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+
+
+#line 3726 "WxdkdrawMouse.cpt"
+}
+
+
+
+
+void
+WxdkdrawFrame::MarkObjectsForRectangleGrouping(void)
+{
+ Wxd_bb_t ibb; /* Bounding box using int values */
+ dk4_bb_t bbdbl; /* Bounding box using double values */
+ Wxd_object_t *pobj; /* Current object to check */
+
+ /* Initialize ibb with mouse coordinates
+ */
+ ibb.xl = m_ptMouseMoveStart.x;
+ ibb.xr = m_ptMousePosGrid.x;
+ ibb.yb = m_ptMouseMoveStart.y;
+ ibb.yt = m_ptMousePosGrid.y;
+ wxdobj_bb_correct(&ibb);
+ /*
+ Unmark all objects
+ */
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ /*
+ Convert mouse coordinates to double coordinates
+ */
+ bbdbl.xmin = (double)(ibb.xl);
+ bbdbl.xmax = (double)(ibb.xr);
+ bbdbl.ymin = (double)(ibb.yb);
+ bbdbl.ymax = (double)(ibb.yt);
+ bbdbl.fl = ((unsigned char)3U);
+ /*
+ Check all objects in structural storage
+ */
+ dk4sto_it_reset(m_pDrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_stru);
+ if (NULL != pobj) {
+ if (0 != dk4bb_contains_bb(&bbdbl, &(pobj->bb), 1)) {
+ wxdobj_mark_recursively(pobj, OBJ_MARKER_2);
+ }
+ }
+ } while (NULL != pobj);
+}
+
+
+void
+WxdkdrawFrame::MouseMoveGroupRect1(void)
+{
+
+
+#line 3777 "WxdkdrawMouse.cpt"
+
+
+#line 3778 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftGroupRect1(void)
+{
+
+
+#line 3786 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_iState = S_GROUP_RECT_2;
+ SetMouseAndStatusTexts(m_iState);
+ }
+
+
+#line 3792 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveGroupRect2(void)
+{
+
+
+#line 3800 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ MarkObjectsForRectangleGrouping();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+
+
+#line 3805 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftGroupRect2(void)
+{
+
+
+#line 3813 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ MarkObjectsForRectangleGrouping();
+ if (2 <= wxdobj_num_marked_2(m_pDrw)) {
+ GroupNewForMarkedObjects();
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ m_pCurrent = NULL;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_iState = S_GROUP_RECT_1;
+ SetMouseAndStatusTexts(m_iState);
+ SetModified();
+ }
+ else {
+ /* Intentionally empty, do not group a single element */
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+
+ }
+ }
+
+
+#line 3832 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDetails(void)
+{
+ Wxd_object_t *pOldCurrent;
+
+
+#line 3841 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject();
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ }
+ if (
+ ((NULL != m_pCurrent) && (NULL == pOldCurrent))
+ || ((NULL == m_pCurrent) && (NULL != pOldCurrent))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+
+
+#line 3859 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ChangeOneLabelText(
+ wxChar **ptxt,
+ wxTextCtrl *ptc,
+ bool bKeepOld
+)
+{
+ wxString str = ptc->GetValue();
+ {
+ wxCStrData strd = str.c_str();
+ {
+ wxChar const *pstr = (wxChar const *)strd;
+ if (NULL != pstr) {
+ if (0 < dk4strx_len(pstr)) {
+ wxChar *pnstr = dk4strx_dup(pstr, NULL);
+ if (NULL != pnstr) {
+ if (NULL != *ptxt) {
+ dk4mem_free(*ptxt);
+ }
+ *ptxt = pnstr;
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ if (!(bKeepOld)) {
+ if (NULL != *ptxt) {
+ dk4mem_free(*ptxt);
+ *ptxt = NULL;
+ }
+ }
+ }
+ }
+ else {
+ if (!(bKeepOld)) {
+ if (NULL != *ptxt) {
+ dk4mem_free(*ptxt);
+ *ptxt = NULL;
+ }
+ }
+ }
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::RetrieveTextDetails(
+ wxTextCtrl *ptce,
+ wxTextCtrl *ptcs,
+ bool bLaTeX
+)
+{
+ if (bLaTeX) {
+ ChangeOneLabelText(&((m_pCurrent->det).t.t), ptce);
+ ChangeOneLabelText(&((m_pCurrent->det).t.tsc), ptcs, false);
+ }
+ else {
+ ChangeOneLabelText(&((m_pCurrent->det).t.t), ptce);
+ if (NULL != (m_pCurrent->det).t.tsc) {
+ dk4mem_free((m_pCurrent->det).t.tsc);
+ (m_pCurrent->det).t.tsc = NULL;
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsText(void)
+{
+ bool bLaTeX = false;
+
+
+#line 3941 "WxdkdrawMouse.cpt"
+ bLaTeX = wxdobj_text_is_latex(m_pCurrent);
+ WxdkdrawDlgTextInput tid(
+ this, sTexts, sNlWx,
+ &((m_pCurrent->det).t.t), &((m_pCurrent->det).t.tsc),
+ bLaTeX, &m_oErrorReport
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ if (wxID_OK == tid.ShowModal()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+
+#if 0
+ if (NULL != (m_pCurrent->det).t.t) {
+ /*
+ Export text available
+ */
+ wxString te((m_pCurrent->det).t.t);
+ if (bLaTeX && (NULL != (m_pCurrent->det).t.tsc)) {
+ /* Screen text available and in use
+ */
+ wxString ts((m_pCurrent->det).t.tsc);
+ {
+ WxdkdrawDlgTextInput tid(this, sTexts, sNlWx, bLaTeX);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ wxTextCtrl *ptce = tid.GetExportTextCtrl();
+ wxTextCtrl *ptcs = tid.GetScreenTextCtrl();
+ ptce->SetValue(te);
+ ptcs->SetValue(ts);
+ if (wxID_OK == tid.ShowModal()) {
+ RetrieveTextDetails(ptce, ptcs, bLaTeX);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ }
+ else {
+ /* No screen text
+ */
+ WxdkdrawDlgTextInput tid(this, sTexts, sNlWx, bLaTeX);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ wxTextCtrl *ptce = tid.GetExportTextCtrl();
+ wxTextCtrl *ptcs = tid.GetScreenTextCtrl();
+ ptce->SetValue(te);
+ if (wxID_OK == tid.ShowModal()) {
+ RetrieveTextDetails(ptce, ptcs, bLaTeX);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ }
+ else {
+ /*
+ No export text (yet)
+ */
+ WxdkdrawDlgTextInput tid(this, sTexts, sNlWx, bLaTeX);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ wxTextCtrl *ptce = tid.GetExportTextCtrl();
+ wxTextCtrl *ptcs = tid.GetScreenTextCtrl();
+ if (wxID_OK == tid.ShowModal()) {
+ RetrieveTextDetails(ptce, ptcs, bLaTeX);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+#endif
+
+
+#line 4008 "WxdkdrawMouse.cpt"
+}
+
+
+
+/** Find the exponent of powers of 2 contained in a number.
+ @param x Number to inspect.
+ @return Exponent of powers of 2 contained in product on success, 0 on error.
+*/
+static
+uint32_t
+powers_of_two_in_product(uint32_t x)
+{
+ uint32_t back = (uint32_t)0UL;
+
+
+#line 4022 "WxdkdrawMouse.cpt"
+ while ((uint32_t)0UL == (x % ((uint32_t)2UL))) {
+ back++;
+ x = x / ((uint32_t)2UL);
+ }
+
+
+#line 4027 "WxdkdrawMouse.cpt"
+ return back;
+}
+
+
+
+/** Find a suitable scroll step to scroll through a given length.
+ @param snap Grid distance, result should be a product or an
+ 1/x fraction of this.
+ @param lgt Length to scroll through.
+ @param mins Minimum number of scroll steps.
+ @return Positive step width on success, 0 on error.
+*/
+static
+uint32_t
+step_length(uint32_t snap, uint32_t lgt, uint32_t mins)
+{
+ dk4_er_t er;
+ double d_l;
+ double d_s;
+ double d_m;
+ double c;
+ uint32_t back = (uint32_t)0UL;
+ uint32_t maxe;
+ uint32_t expo = (uint32_t)0UL;
+
+
+#line 4052 "WxdkdrawMouse.cpt"
+#if 0
+ /* 2020-03-24 Modification
+ Turned to initialization due to complaints by clang static analyzer.
+ */
+ expo = (uint32_t)0UL;
+#endif
+ d_l = (double)lgt;
+ d_s = (double)snap;
+ d_m = (double)mins;
+ back = snap;
+ if (snap > (lgt / mins)) {
+ dk4error_init(&er);
+ maxe = powers_of_two_in_product(snap);
+
+
+#line 4066 "WxdkdrawMouse.cpt"
+ c = ceil(0.0 - ((log(d_l/(d_s*d_m)))/ log(2.0)));
+ if (0.0 < c) {
+ expo = dk4ma_uint32_from_double(c, &er);
+
+
+#line 4070 "WxdkdrawMouse.cpt"
+ if (DK4_E_NONE == er.ec) {
+ if ((uint32_t)0UL < expo) {
+ if (expo > maxe) { expo = maxe; }
+ while((int32_t)0L < expo--) {
+ back = back / ((uint32_t)2UL);
+ }
+ }
+ }
+ }
+ }
+
+#line 4080 "WxdkdrawMouse.cpt"
+ return back;
+}
+
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsBox(void)
+{
+ dk4_er_t er;
+ size_t ui;
+ uint32_t w;
+ uint32_t h;
+ uint32_t s;
+ uint32_t m;
+
+
+#line 4096 "WxdkdrawMouse.cpt"
+ ui = ((0 != cbGridUnit->GetSelection()) ? (501) : (500));
+ dk4error_init(&er);
+ w = (uint32_t)dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ (m_pCurrent->det).b.b.xr, (m_pCurrent->det).b.b.xl, &er
+ ),
+ &er
+ );
+ h = (uint32_t)dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ (m_pCurrent->det).b.b.yt, (m_pCurrent->det).b.b.yb, &er
+ ),
+ &er
+ );
+
+#line 4110 "WxdkdrawMouse.cpt"
+ if (DK4_E_NONE == er.ec) {
+ if (h < w) { w = h; }
+
+#line 4112 "WxdkdrawMouse.cpt"
+ w = w / (uint32_t)2UL; /* Have half of minimum side length */
+
+
+#line 4114 "WxdkdrawMouse.cpt"
+ s = step_length(drawco->m_uGridSnap, w, (uint32_t)8UL);
+
+
+#line 4116 "WxdkdrawMouse.cpt"
+ if ((uint32_t)0UL < s) {
+
+#line 4117 "WxdkdrawMouse.cpt"
+ m = (w / s);
+ if (w == m * s) { m--; }
+
+#line 4119 "WxdkdrawMouse.cpt"
+ if (((uint32_t)0UL) < m) {
+
+#line 4120 "WxdkdrawMouse.cpt"
+ WxdkdrawDlgBoxRadius dlg(
+ this, drawco, m_pDrw, m_pCurrent, sTexts, sNlWx,
+ s, m, ui
+ );
+ m_iState = S_DETAILS_2;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ if (wxID_OK == dlg.ShowModal()) {
+ SetModified();
+ }
+ m_iState = S_DETAILS;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+
+#line 4133 "WxdkdrawMouse.cpt"
+ /* ERROR: Box too small */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_BOX_TOO_SMALL
+ );
+ }
+ }
+ else {
+
+#line 4140 "WxdkdrawMouse.cpt"
+ /* ERROR: Box too small */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_BOX_TOO_SMALL
+ );
+ }
+ }
+ else {
+
+#line 4147 "WxdkdrawMouse.cpt"
+ /* ERROR: Overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+
+
+#line 4153 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ChangeImageFile(wxString & pa)
+{
+ wxChar const *vptr;
+ wxChar *nptr;
+ wxCStrData vstrdata = pa.c_str();
+ vptr = (wxChar const *)vstrdata;
+ if (NULL != vptr) {
+ if (0 < dk4strx_len(vptr)) {
+ nptr = dk4strx_dup(vptr, NULL);
+ if (NULL != nptr) {
+ if (NULL != (m_pCurrent->det).i.fn) {
+ dk4mem_free((m_pCurrent->det).i.fn);
+ }
+ (m_pCurrent->det).i.fn = nptr;
+ if (NULL != (m_pCurrent->det).i.bm) {
+ delete((m_pCurrent->det).i.bm);
+ (m_pCurrent->det).i.bm = NULL;
+ }
+ (m_pCurrent->det).i.t = wxBITMAP_TYPE_INVALID;
+ wxdobj_load_image(
+ m_pCurrent,
+ pAppHelp->GetDkEncoding(), pAppHelp->GetWxEncoding()
+ );
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Empty name */
+ dk4error_set_simple_error_code(&m_oErrorReport, WXD_E_NO_FILENAME);
+ }
+ }
+}
+
+
+
+static
+wxChar const *
+final_path_component(wxChar const *fn)
+{
+ wxChar const *back = NULL;
+ wxChar const *rptr = NULL;
+ wxChar const *ptr;
+
+ if (NULL != fn) {
+ ptr = fn;
+ while (wxT('\0') != *ptr) {
+#if DK4_HAVE_BACKSLASH_AS_SEP
+ if (wxT('\\') == *ptr) {
+ rptr = ptr;
+ }
+#else
+ if (wxT('/') == *ptr) {
+ rptr = ptr;
+ }
+#endif
+ ptr++;
+ }
+ if (NULL != rptr) {
+ back = ++rptr;
+ }
+ else {
+ back = fn;
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsImage(void)
+{
+ wxString sDialogTitle(sTexts[409]);
+ wxString sFileTypes(image_files_to_open);
+ wxString sCurrentFileName(final_path_component((m_pCurrent->det).i.fn));
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sImageDir, sCurrentFileName,
+ sFileTypes, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sImageDir, sCurrentFileName,
+ sFileTypes, wxOPEN
+ );
+#endif
+
+
+#line 4251 "WxdkdrawMouse.cpt"
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ m_sImageDir = dlg.GetDirectory();
+ ChangeImageFile(pa);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ {
+ WxdkdrawDlgImageOptions iodlg(this, m_pCurrent, sTexts);
+ if (wxID_OK == iodlg.ShowModal()) {
+ SetModified();
+ }
+ }
+ m_bUpdate = true;
+
+
+#line 4266 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsDotFilled(void)
+{
+
+
+#line 4274 "WxdkdrawMouse.cpt"
+ m_iState = S_DETAILS_2;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ {
+ WxdkdrawDlgDotFilled dlg(this, drawco, m_pDrw, m_pCurrent, sTexts);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, dlg);
+ if (wxID_OK == dlg.ShowModal()) {
+ SetModified();
+ }
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_iState = S_DETAILS;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+
+
+#line 4288 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsDotWhite(void)
+{
+
+
+#line 4296 "WxdkdrawMouse.cpt"
+ ModifyDetailsDotFilled();
+
+
+#line 4298 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDetails(void)
+{
+
+
+#line 4306 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject();
+ if (NULL != m_pCurrent) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_TEXT : {
+ ModifyDetailsText();
+ } break;
+ case WXD_OT_BOX : {
+ ModifyDetailsBox();
+ } break;
+ case WXD_OT_IMAGE : {
+ ModifyDetailsImage();
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ ModifyDetailsDotFilled();
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ ModifyDetailsDotWhite();
+ } break;
+ }
+ m_pCurrent = NULL;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+
+
+#line 4333 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMiddleDelete(void)
+{
+
+
+#line 4341 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_iState = S_REGION_DELETE;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ }
+
+
+#line 4349 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MarkObjectsForRectangleDeletion(void)
+{
+ Wxd_bb_t ibb; /* Bounding box using int values */
+ dk4_bb_t bbdbl; /* Bounding box using double values */
+ Wxd_object_t *pobj; /* Current object to check */
+
+ /* Initialize ibb with mouse coordinates
+ */
+ ibb.xl = m_ptMouseMoveStart.x;
+ ibb.xr = m_ptMousePosGrid.x;
+ ibb.yb = m_ptMouseMoveStart.y;
+ ibb.yt = m_ptMousePosGrid.y;
+ wxdobj_bb_correct(&ibb);
+ /*
+ Unmark all objects
+ */
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ /*
+ Convert mouse coordinates to double coordinates
+ */
+ bbdbl.xmin = (double)(ibb.xl);
+ bbdbl.xmax = (double)(ibb.xr);
+ bbdbl.ymin = (double)(ibb.yb);
+ bbdbl.ymax = (double)(ibb.yt);
+ bbdbl.fl = ((unsigned char)3U);
+ /*
+ Check all objects in structural storage
+ */
+ dk4sto_it_reset(m_pDrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_stru);
+ if (NULL != pobj) {
+ if (0 != dk4bb_contains_bb(&bbdbl, &(pobj->bb), 1)) {
+ wxdobj_mark_recursively(pobj, OBJ_MARKER_1);
+ }
+ }
+ } while (NULL != pobj);
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveRegionDelete(void)
+{
+
+
+#line 4400 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ MarkObjectsForRectangleDeletion();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+
+
+#line 4405 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftRegionDelete(void)
+{
+ Wxd_object_t *pobj;
+ bool bModified;
+ bool bFoundChange;
+
+
+#line 4416 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ /*
+ Find objects to delete
+ */
+ MarkObjectsForRectangleDeletion();
+ /*
+ Delete marked elements
+ */
+ bModified = false;
+ do {
+ bFoundChange = false;
+ dk4sto_it_reset(m_pDrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_stru);
+ if (NULL != pobj) {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ bModified = true;
+ bFoundChange = true;
+ wxdobj_obj_delete_from_drawing(m_pDrw, pobj);
+ }
+ }
+ } while ((NULL != pobj) && (!(bFoundChange)));
+ } while (bFoundChange);
+ /*
+ Go back to S_DELETE state
+ */
+ wxdobj_drw_require_redraw(
+ m_pDrw,
+ ((bModified) ? (WXD_REFRESH_DRAWING) : (WXD_REFRESH_MARKUP))
+ );
+ m_iState = S_DELETE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ if (bModified) { SetModified(); }
+ }
+
+
+#line 4454 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveConvert(void)
+{
+ Wxd_object_t *pOldCurrent;
+
+
+#line 4463 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject();
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+
+
+#line 4476 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertSplineToPoly(Wxd_object_t *pobj)
+{
+ Wxd_det_t nd; /* New details */
+
+
+#line 4485 "WxdkdrawMouse.cpt"
+ if ((uint16_t)0U < (pobj->det).s.n) {
+ if (NULL != (pobj->det).s.p) {
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ nd.p.n = (pobj->det).s.n;
+ nd.p.p = dk4mem_new(Wxd_point_t,(size_t)(nd.p.n),NULL);
+ if (NULL != nd.p.p) {
+ for (uint16_t i = 0; i < nd.p.n; i++) {
+ (nd.p.p)[i].x = ((pobj->det).s.p)[i].x;
+ (nd.p.p)[i].y = ((pobj->det).s.p)[i].y;
+ }
+ dk4mem_free((pobj->det).s.p);
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ }
+
+
+#line 4509 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertArcToPoly(Wxd_object_t *pobj)
+{
+ dk4_er_t er;
+ Wxd_det_t nd; /* New details */
+
+
+#line 4519 "WxdkdrawMouse.cpt"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+
+ if (
+ (WXD_OT_POLYGON == m_iObjToCreate)
+ && (WXD_OT_C_ARC == pobj->ot)
+ && (0 != (pobj->det).a.d)
+ ) {
+
+ nd.p.n = 4U;
+ nd.p.p = dk4mem_new(Wxd_point_t,(size_t)4,NULL);
+ if (NULL != nd.p.p) {
+ dk4error_init(&er);
+ (nd.p.p)[0].x = (pobj->det).a.x1;
+ (nd.p.p)[0].y = (pobj->det).a.y1;
+ (nd.p.p)[1].x = (pobj->det).a.x2;
+ (nd.p.p)[1].y = (pobj->det).a.y2;
+ (nd.p.p)[2].x = (pobj->det).a.x3;
+ (nd.p.p)[2].y = (pobj->det).a.y3;
+ (nd.p.p)[3].x = dk4ma_int32_from_double((pobj->det).a.x, &er);
+ (nd.p.p)[3].y = dk4ma_int32_from_double((pobj->det).a.y, &er);
+ if (DK4_E_NONE == er.ec) {
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ dk4mem_free(nd.p.p);
+ /* ERROR: Numeric overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ nd.p.n = 3U;
+ nd.p.p = dk4mem_new(Wxd_point_t,(size_t)3,NULL);
+ if (NULL != nd.p.p) {
+ (nd.p.p)[0].x = (pobj->det).a.x1;
+ (nd.p.p)[0].y = (pobj->det).a.y1;
+ (nd.p.p)[1].x = (pobj->det).a.x2;
+ (nd.p.p)[1].y = (pobj->det).a.y2;
+ (nd.p.p)[2].x = (pobj->det).a.x3;
+ (nd.p.p)[2].y = (pobj->det).a.y3;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+
+
+#line 4581 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertBoxToPoly(Wxd_object_t *pobj)
+{
+
+ Wxd_det_t nd; /* New details */
+
+
+#line 4591 "WxdkdrawMouse.cpt"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ nd.p.n = 4;
+ nd.p.p = dk4mem_new(Wxd_point_t,(size_t)4,NULL);
+ if (NULL != nd.p.p) {
+ (nd.p.p)[0].x = (pobj->det).b.b.xl;
+ (nd.p.p)[0].y = (pobj->det).b.b.yb;
+ (nd.p.p)[1].x = (pobj->det).b.b.xr;
+ (nd.p.p)[1].y = (pobj->det).b.b.yb;
+ (nd.p.p)[2].x = (pobj->det).b.b.xr;
+ (nd.p.p)[2].y = (pobj->det).b.b.yt;
+ (nd.p.p)[2].x = (pobj->det).b.b.xl;
+ (nd.p.p)[2].y = (pobj->det).b.b.yt;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+
+
+#line 4614 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertPolyToSpline(Wxd_object_t *pobj)
+{
+ Wxd_det_t nd; /* New details */
+ double s; /* Spline value */
+
+
+#line 4624 "WxdkdrawMouse.cpt"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ if (((uint16_t)0U < (pobj->det).p.n) && (NULL != (pobj->det).p.p)) {
+ nd.s.n = (pobj->det).p.n;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)(nd.s.n),NULL);
+ if (NULL != nd.s.p) {
+ s = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ for (uint16_t i = (uint16_t)0U; i < nd.s.n; i++) {
+ (nd.s.p)[i].x = ((pobj->det).p.p)[i].x;
+ (nd.s.p)[i].y = ((pobj->det).p.p)[i].y;
+ (nd.s.p)[i].s = s;
+ }
+ if (WXD_OT_O_SPLINE == m_iObjToCreate) {
+ (nd.s.p)[0].s = 0.0;
+ (nd.s.p)[(size_t)(nd.s.n - (uint16_t)1U)].s = 0.0;
+ }
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Bad original object */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_CANNOT_CONVERT
+ );
+ }
+
+
+#line 4657 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertSplineToSpline(Wxd_object_t *pobj)
+{
+ double s; /* Spline value */
+
+
+#line 4666 "WxdkdrawMouse.cpt"
+ if (((uint16_t)0U < (pobj->det).s.n) && (NULL != (pobj->det).s.p)) {
+ s = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ for (uint16_t i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ ((pobj->det).s.p)[i].s = s;
+ }
+ if (WXD_OT_O_SPLINE == m_iObjToCreate) {
+ ((pobj->det).s.p)[0].s = 0.0;
+ ((pobj->det).s.p)[(size_t)((pobj->det).s.n - (uint16_t)1U)].s = 0.0;
+ }
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Bad original object */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_CANNOT_CONVERT
+ );
+ }
+
+
+#line 4685 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertArcToSpline(Wxd_object_t *pobj)
+{
+ dk4_er_t er; /* For double to int32_t conversion */
+ Wxd_det_t nd; /* New details */
+ double s; /* Spline value */
+
+
+#line 4696 "WxdkdrawMouse.cpt"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ s = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ if (
+ (WXD_OT_C_SPLINE == m_iObjToCreate)
+ && (WXD_OT_C_ARC == pobj->ot)
+ && ((int8_t)0 != (pobj->det).a.d)
+ ) {
+ nd.s.n = 4U;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)4,NULL);
+ if (NULL != nd.s.p) {
+ dk4error_init(&er);
+ (nd.s.p)[0].x = (pobj->det).a.x1;
+ (nd.s.p)[0].y = (pobj->det).a.y1;
+ (nd.s.p)[0].s = 0.0;
+ (nd.s.p)[1].x = (pobj->det).a.x2;
+ (nd.s.p)[1].y = (pobj->det).a.y2;
+ (nd.s.p)[1].s = s;
+ (nd.s.p)[2].x = (pobj->det).a.x3;
+ (nd.s.p)[2].y = (pobj->det).a.y3;
+ (nd.s.p)[2].s = 0.0;
+ (nd.s.p)[3].x = dk4ma_int32_from_double((pobj->det).a.x, &er);
+ (nd.s.p)[3].y = dk4ma_int32_from_double((pobj->det).a.y, &er);
+ (nd.s.p)[3].s = 0.0;
+ if (DK4_E_NONE == er.ec) {
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ dk4mem_free(nd.s.p);
+ /* ERROR: Numeric overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ nd.s.n = 3U;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)3,NULL);
+ if (NULL != nd.s.p) {
+ (nd.s.p)[0].x = (pobj->det).a.x1;
+ (nd.s.p)[0].y = (pobj->det).a.y1;
+ (nd.s.p)[0].s = 0.0;
+ (nd.s.p)[1].x = (pobj->det).a.x2;
+ (nd.s.p)[1].y = (pobj->det).a.y2;
+ (nd.s.p)[1].s = s;
+ (nd.s.p)[2].x = (pobj->det).a.x3;
+ (nd.s.p)[2].y = (pobj->det).a.y3;
+ (nd.s.p)[2].s = 0.0;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+
+
+#line 4764 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertBoxToSpline(Wxd_object_t *pobj)
+{
+ dk4_er_t er; /* For double to int32_t conversion */
+ Wxd_det_t nd; /* New details */
+ double s; /* Spline value */
+ int32_t r;
+ int32_t w;
+ int32_t h;
+
+
+#line 4778 "WxdkdrawMouse.cpt"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ s = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ dk4error_init(&er);
+ if (
+ (WXD_OT_C_SPLINE == m_iObjToCreate)
+ && (!(m_bSplineInterpolated))
+ && ((uint32_t)0UL < (pobj->det).b.r)
+ ) {
+ w = dk4ma_int32_t_sub((pobj->det).b.b.xr, (pobj->det).b.b.xl, &er);
+ w = dk4ma_int32_t_abs(w, &er);
+ h = dk4ma_int32_t_sub((pobj->det).b.b.yt, (pobj->det).b.b.yb, &er);
+ h = dk4ma_int32_t_abs(h, &er);
+ if (w > h) w = h;
+ r = w / (int32_t)2L;
+ if ((uint32_t)r > (pobj->det).b.r) {
+ r = (int32_t)((pobj->det).b.r);
+ }
+ }
+ if (
+ (WXD_OT_C_SPLINE == m_iObjToCreate)
+ && (!(m_bSplineInterpolated))
+ && ((uint32_t)0UL < (pobj->det).b.r)
+ && (DK4_E_NONE == er.ec)
+ ) {
+ nd.s.n = 12;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)12,NULL);
+ if (NULL != nd.s.p) {
+ (nd.s.p)[0].x = (pobj->det).b.b.xl + r;
+ (nd.s.p)[0].y = (pobj->det).b.b.yb;
+ (nd.s.p)[0].s = 0.0;
+ (nd.s.p)[1].x = (pobj->det).b.b.xr - r;
+ (nd.s.p)[1].y = (pobj->det).b.b.yb;
+ (nd.s.p)[1].s = 0.0;
+ (nd.s.p)[2].x = (pobj->det).b.b.xr;
+ (nd.s.p)[2].y = (pobj->det).b.b.yb;
+ (nd.s.p)[2].s = 1.0;
+ (nd.s.p)[3].x = (pobj->det).b.b.xr;
+ (nd.s.p)[3].y = (pobj->det).b.b.yb + r;
+ (nd.s.p)[3].s = 0.0;
+ (nd.s.p)[4].x = (pobj->det).b.b.xr;
+ (nd.s.p)[4].y = (pobj->det).b.b.yt - r;
+ (nd.s.p)[4].s = 0.0;
+ (nd.s.p)[5].x = (pobj->det).b.b.xr;
+ (nd.s.p)[5].y = (pobj->det).b.b.yt;
+ (nd.s.p)[5].s = 1.0;
+ (nd.s.p)[6].x = (pobj->det).b.b.xr - r;
+ (nd.s.p)[6].y = (pobj->det).b.b.yt;
+ (nd.s.p)[6].s = 0.0;
+ (nd.s.p)[7].x = (pobj->det).b.b.xl + r;
+ (nd.s.p)[7].y = (pobj->det).b.b.yt;
+ (nd.s.p)[7].s = 0.0;
+ (nd.s.p)[8].x = (pobj->det).b.b.xl;
+ (nd.s.p)[8].y = (pobj->det).b.b.yt;
+ (nd.s.p)[8].s = 1.0;
+ (nd.s.p)[9].x = (pobj->det).b.b.xl;
+ (nd.s.p)[9].y = (pobj->det).b.b.yt - r;
+ (nd.s.p)[9].s = 0.0;
+ (nd.s.p)[10].x = (pobj->det).b.b.xl;
+ (nd.s.p)[10].y = (pobj->det).b.b.yb + r;
+ (nd.s.p)[10].s = 0.0;
+ (nd.s.p)[11].x = (pobj->det).b.b.xl;
+ (nd.s.p)[11].y = (pobj->det).b.b.yb;
+ (nd.s.p)[11].s = 1.0;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ nd.s.n = 4;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)4,NULL);
+ if (NULL != nd.s.p) {
+ (nd.s.p)[0].x = (pobj->det).b.b.xl;
+ (nd.s.p)[0].y = (pobj->det).b.b.yb;
+ (nd.s.p)[0].s = s;
+ (nd.s.p)[1].x = (pobj->det).b.b.xr;
+ (nd.s.p)[1].y = (pobj->det).b.b.yb;
+ (nd.s.p)[1].s = s;
+ (nd.s.p)[2].x = (pobj->det).b.b.xr;
+ (nd.s.p)[2].y = (pobj->det).b.b.yt;
+ (nd.s.p)[2].s = s;
+ (nd.s.p)[3].x = (pobj->det).b.b.xl;
+ (nd.s.p)[3].y = (pobj->det).b.b.yt;
+ (nd.s.p)[3].s = s;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ if (WXD_OT_C_SPLINE != pobj->ot) {
+ ((pobj->det).s.p)[0].s = 0.0;
+ ((pobj->det).s.p)[(size_t)((pobj->det).s.n-(uint16_t)1U)].s=0.0;
+ }
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+
+
+#line 4884 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertPolyToArc(Wxd_object_t *pobj)
+{
+ Wxd_det_t nd;
+
+
+#line 4893 "WxdkdrawMouse.cpt"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ if (((uint16_t)2U < (pobj->det).p.n) && (NULL != (pobj->det).p.p)) {
+ nd.a.x1 = ((pobj->det).p.p)[0].x;
+ nd.a.y1 = ((pobj->det).p.p)[0].y;
+ nd.a.x2 = ((pobj->det).p.p)[1].x;
+ nd.a.y2 = ((pobj->det).p.p)[1].y;
+ nd.a.x3 = ((pobj->det).p.p)[2].x;
+ nd.a.y3 = ((pobj->det).p.p)[2].y;
+ wxdarc_calculation(
+ &(nd.a.x), &(nd.a.y), &(nd.a.r), &(nd.a.a), &(nd.a.b), &(nd.a.d),
+ nd.a.x1, nd.a.y1, nd.a.x2, nd.a.y2, nd.a.x3, nd.a.y3
+ );
+ dk4mem_free((pobj->det).p.p);
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Bad original object */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_CANNOT_CONVERT
+ );
+ }
+
+
+#line 4917 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertSplineToArc(Wxd_object_t *pobj)
+{
+ Wxd_det_t nd;
+
+
+#line 4926 "WxdkdrawMouse.cpt"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ if (((uint16_t)2U < (pobj->det).s.n) && (NULL != (pobj->det).s.p)) {
+ nd.a.x1 = ((pobj->det).s.p)[0].x;
+ nd.a.y1 = ((pobj->det).s.p)[0].y;
+ nd.a.x2 = ((pobj->det).s.p)[1].x;
+ nd.a.y2 = ((pobj->det).s.p)[1].y;
+ nd.a.x3 = ((pobj->det).s.p)[2].x;
+ nd.a.y3 = ((pobj->det).s.p)[2].y;
+ wxdarc_calculation(
+ &(nd.a.x), &(nd.a.y), &(nd.a.r), &(nd.a.a), &(nd.a.b), &(nd.a.d),
+ nd.a.x1, nd.a.y1, nd.a.x2, nd.a.y2, nd.a.x3, nd.a.y3
+ );
+ dk4mem_free((pobj->det).s.p);
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Bad original object */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_CANNOT_CONVERT
+ );
+ }
+
+
+#line 4950 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertCircleToDot(Wxd_object_t *pobj)
+{
+ dk4_er_t er;
+ Wxd_det_t nd;
+ uint16_t d; /* New diameter */
+
+
+#line 4961 "WxdkdrawMouse.cpt"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ dk4error_init(&er);
+ d = dk4ma_uint16_from(
+ (dk4_um_t)dk4ma_uint32_t_div(
+ dk4ma_uint32_t_mul((pobj->det).e.rx, (uint32_t)2UL, &er),
+ m_pDrw->baselw, &er
+ ),
+ &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ nd.d.x = (pobj->det).e.x;
+ nd.d.y = (pobj->det).e.y;
+ nd.d.d = d;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Numeric overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+
+
+#line 4985 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::ObjectTypeConversion(Wxd_object_t *pobj)
+{
+ if (NULL != pobj) {
+ if (wxdobj_can_convert(m_iObjToCreate, pobj)) {
+ switch ( (int)m_iObjToCreate ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ pobj->ot = m_iObjToCreate;
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ ConvertSplineToPoly(pobj);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ ConvertArcToPoly(pobj);
+ } break;
+ case WXD_OT_BOX : {
+ ConvertBoxToPoly(pobj);
+ } break;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ ConvertPolyToSpline(pobj);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ ConvertSplineToSpline(pobj);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ ConvertArcToSpline(pobj);
+ } break;
+ case WXD_OT_BOX : {
+ ConvertBoxToSpline(pobj);
+ } break;
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_C_ARC : case WXD_OT_O_ARC : {
+ pobj->ot = m_iObjToCreate;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ ConvertPolyToArc(pobj);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ ConvertSplineToArc(pobj);
+ } break;
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ pobj->ot = m_iObjToCreate;
+ } break;
+ case WXD_OT_CIRCLE : {
+ ConvertCircleToDot(pobj);
+ } break;
+ }
+ } break;
+ }
+ wxdobj_bb_simple_object(m_pDrw, pobj);
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftConvert(void)
+{
+
+
+#line 5062 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject();
+ if (NULL != m_pCurrent) {
+ ObjectTypeConversion(m_pCurrent);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+
+
+#line 5073 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveRotate(void)
+{
+ Wxd_point_t center;
+ Wxd_object_t *prevobj;
+
+
+#line 5083 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ prevobj = m_pCurrent;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_rotate_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ if (wxdobj_get_control_point(&center, m_pCurrent, m_uCurrent)) {
+ while (NULL != m_pCurrent->pa) { m_pCurrent = m_pCurrent->pa; }
+ if (
+ wxdobj_rotate_object(
+ m_pCurrent, center.x, center.y,
+ m_bSplineInterpolated, false
+ )
+
+ ) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ } else {
+
+#line 5102 "WxdkdrawMouse.cpt"
+ m_pCurrent = NULL;
+ }
+ }
+ else {
+
+#line 5106 "WxdkdrawMouse.cpt"
+ m_pCurrent = NULL;
+ }
+ }
+ else {
+
+#line 5110 "WxdkdrawMouse.cpt"
+ }
+ if (
+ ((NULL != m_pCurrent) && (NULL == prevobj))
+ || ((NULL == m_pCurrent) && (NULL != prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+
+
+#line 5120 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftRotate(void)
+{
+ Wxd_point_t center;
+
+
+#line 5129 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_rotate_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ if (wxdobj_get_control_point(&center, m_pCurrent, m_uCurrent)) {
+ while (NULL != m_pCurrent->pa) { m_pCurrent = m_pCurrent->pa; }
+ if (
+ wxdobj_rotate_object(
+ m_pCurrent, center.x, center.y,
+ m_bSplineInterpolated, false
+ )
+ ) {
+ wxdobj_rotate_object(
+ m_pCurrent, center.x, center.y,
+ m_bSplineInterpolated, true
+ );
+ SetModified();
+ }
+ else {
+ m_pCurrent = NULL;
+ }
+ }
+ else {
+ m_pCurrent = NULL;
+ }
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+
+
+#line 5162 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveModspline(void)
+{
+ Wxd_object_t *prevobj;
+ uint16_t prevpoint;
+
+
+#line 5172 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ /*
+ Save previous candidate object and point
+ */
+ prevobj = m_pCurrent;
+ prevpoint = m_uCurrent;
+ /*
+ Check for new candicate
+ */
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_modify_spline_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+
+
+#line 5191 "WxdkdrawMouse.cpt"
+ }
+ /*
+ On object or point change redraw the markup
+ */
+ if (
+ ((NULL != m_pCurrent) && (NULL == prevobj))
+ || ((NULL == m_pCurrent) && (NULL != prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ if ((prevobj != m_pCurrent) || (prevpoint != m_uCurrent)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+
+
+#line 5206 "WxdkdrawMouse.cpt"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftModspline(void)
+{
+
+
+#line 5214 "WxdkdrawMouse.cpt"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_modify_spline_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ ModifySplineValue(m_pCurrent, m_uCurrent);
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+
+
+#line 5230 "WxdkdrawMouse.cpt"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawMouse.cpt b/support/dktools/WxdkdrawMouse.cpt
new file mode 100644
index 0000000000..564d5cd56e
--- /dev/null
+++ b/support/dktools/WxdkdrawMouse.cpt
@@ -0,0 +1,5235 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% module
+
+#include "wxdkdraw.h"
+
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
+#ifndef WXDKDRAWDLGTEXTINPUT_H_INCLUDED
+#include "WxdkdrawDlgTextInput.h"
+#endif
+#ifndef WXDKDRAWDLGSPLINEVALUE_H_INCLUDED
+#include "WxdkdrawDlgSplineValue.h"
+#endif
+#ifndef WXDKDRAWDLGIMAGEOPTIONS_H_INCLUDED
+#include "WxdkdrawDlgImageOptions.h"
+#endif
+#ifndef WXDKDRAWDLGDOTFILLED_H_INCLUDED
+#include "WxdkdrawDlgDotFilled.h"
+#endif
+#ifndef WXDKDRAWDLGBOXRADIUS_H_INCLUDED
+#include "WxdkdrawDlgBoxRadius.h"
+#endif
+#ifndef DK4MAAU32_H_INCLUDED
+#include "dk4maau32.h"
+#endif
+#ifndef DK4MAAI32_H_INCLUDED
+#include "dk4maai32.h"
+#endif
+#ifndef DK4MAAU16_H_INCLUDED
+#include "dk4maau16.h"
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Image file types we can handle.
+*/
+static wxChar const image_files_to_open[] = {
+#if DK4_HAVE_PNG_H
+ wxT("PNG files (*.png)|*.png")
+#if DK4_HAVE_JPEGLIB_H
+ wxT("|JPEG files (*.jpeg)|*.jpeg")
+ wxT("|JPEG files (*.jpg)|*.jpg")
+#endif
+/* if DK4_HAVE_JPEGLIB_H */
+#if DK4_HAVE_TIFF_H
+ wxT("|TIFF files (*.tiff)|*.tiff")
+ wxT("|TIFF files (*.tif)|*.tif")
+#endif
+/* if DK4_HAVE_TIFF_H */
+ wxT("|NetPBM files (*.pam)|*.pam")
+#else
+/* if DK4_HAVE_PNG_H */
+#if DK4_HAVE_JPEGLIB_H
+ wxT("JPEG files (*.jpeg)|*.jpeg")
+ wxT("|JPEG files (*.jpg)|*.jpg")
+#if DK4_HAVE_TIFF_H
+ wxT("|TIFF files (*.tiff)|*.tiff")
+ wxT("|TIFF files (*.tif)|*.tif")
+#endif
+/* if DK4_HAVE_TIFF_H */
+ wxT("|NetPBM files (*.pam)|*.pam")
+#else
+/* if DK4_HAVE_JPEGLIB_H */
+#if DK4_HAVE_TIFF_H
+ wxT("TIFF files (*.tiff)|*.tiff")
+ wxT("|TIFF files (*.tif)|*.tif")
+ wxT("|NetPBM files (*.pam)|*.pam")
+#else
+/* if DK4_HAVE_TIFF_H */
+ wxT("NetPBM files (*.pam)|*.pam")
+#endif
+/* if DK4_HAVE_TIFF_H */
+#endif
+/* if DK4_HAVE_JPEGLIB_H */
+#endif
+/* DK4_HAVE_PNG_H */
+ wxT("|NetPBM files (*.pnm)|*.pnm")
+ wxT("|NetPBM files (*.ppm)|*.ppm")
+ wxT("|NetPBM files (*.pgm)|*.pgm")
+ wxT("|NetPBM files (*.pbm)|*.pbm")
+};
+
+
+
+bool
+WxdkdrawFrame::IsAcceptablePoint(void)
+{
+ bool back = true;
+
+ switch (m_iState) {
+ case S_POLY_FURTHER :
+ case S_SPLINE_FURTHER :
+ case S_CIRCLE_RADIUS :
+ case S_IMG_2 :
+ {
+ if (
+ (m_ptMousePosGrid.x == m_ptMouseMoveStart.x)
+ && (m_ptMousePosGrid.y == m_ptMouseMoveStart.y)
+ ) {
+ back = false;
+ }
+ } break;
+ case S_ELLIPSE_CORNER :
+ case S_BOX_OPPOSITE :
+ {
+ back = false;
+ /*
+ For a box we accept neither equal x nor equal y coordinates
+ */
+ if (
+ (m_ptMousePosGrid.x != m_ptMouseMoveStart.x)
+ && (m_ptMousePosGrid.y != m_ptMouseMoveStart.y)
+ ) {
+ back = true;
+ }
+ } break;
+ case S_ARC_2 : {
+ if (
+ ((m_pCurrent->det).a.x1 == (m_pCurrent->det).a.x2)
+ && ((m_pCurrent->det).a.y1 == (m_pCurrent->det).a.y2)
+ ) {
+ back = false;
+ }
+ } break;
+ case S_ARC_3 : {
+ if (
+ (
+ ((m_pCurrent->det).a.x1 == (m_pCurrent->det).a.x3)
+ && ((m_pCurrent->det).a.y1 == (m_pCurrent->det).a.y3)
+ ) || (
+ ((m_pCurrent->det).a.x2 == (m_pCurrent->det).a.x3)
+ && ((m_pCurrent->det).a.y2 == (m_pCurrent->det).a.y3)
+ )
+ ) {
+ back = false;
+ }
+ } break;
+ }
+ return back;
+}
+
+
+void
+WxdkdrawFrame::MouseMoveNoop(void)
+{
+ Wxd_object_t *pobj;
+ size_t si;
+ int oldtype = WXD_OT_GROUP_END;
+ $? "+ MouseMoveNoop"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ oldtype = (int)(m_pCurrent->ot);
+ }
+#if 0
+ if (NULL == m_pStyle) {
+#endif
+ pobj = FindNearestObject();
+ if (m_pCurrent != pobj) {
+ if ((NULL != pobj) && (NULL == m_pCurrent)) {
+ msgMouseL->SetLabel(sTexts[201]);
+ msgMouseL->Refresh();
+ m_bUpdate = true;
+ }
+ else {
+ if ((NULL == pobj) && (NULL != m_pCurrent)) {
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ m_bUpdate = true;
+ }
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = pobj;
+ if (NULL != m_pCurrent) {
+ pobj->mark |= OBJ_MARKER_1;
+ if (oldtype != (int)(m_pCurrent->ot)) {
+ if (
+ (WXD_OT_TEXT <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ si = (size_t)172U + (size_t)(m_pCurrent->ot);
+ SetStatusText(sTexts[si]);
+ m_bUpdate = true;
+ }
+ }
+ }
+ else {
+ SetStatusText(sNlWx[19]);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+#if 0
+ }
+#endif
+ }
+ else {
+ if (NULL != m_pCurrent) {
+ m_pCurrent = NULL;
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ SetStatusText(sNlWx[19]);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ $? "- MouseMoveNoop"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDelete(void)
+{
+ Wxd_object_t *pOldCurrent;
+ $? "+ MouseMoveDelete"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ SetStatusText(
+ sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]
+ );
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[340]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ $? "- MouseMoveDelete"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveMoveSelect(void)
+{
+ Wxd_object_t *pOldCurrent;
+ $? "+ MouseMoveMoveSelect"
+ if (m_bMousePos) { $? ". mouse pos"
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) { $? ". other object"
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) { $? ". object"
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) { $? ". type ok"
+ SetStatusText(
+ sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]
+ );
+ }
+ else { $? "! type"
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[342]);
+ }
+ else { $? ". no object"
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+#if TRACE_DEBUG
+ else { $? ". no other object"
+ }
+#endif
+ }
+ else { $? "! no mouse pos"
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ $? "- MouseMoveMoveSelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveMovePlace(void)
+{
+ $? "+ MouseMoveMovePlace"
+ $? ". m_bMousePos = %d", ((m_bMousePos) ? 1 : 0)
+ $? ". m_bMouseDiff = %d", ((m_bMouseDiff) ? 1 : 0)
+ if ((m_bMousePos) && (m_bMouseDiff)) { $? ". conditions"
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ $? ". shift test ok"
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+#if TRACE_DEBUG
+ else { $? "! overflow"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! conditions"
+ }
+#endif
+ $? "- MouseMoveMovePlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveCopySelect(void)
+{
+ Wxd_object_t *pOldCurrent;
+ $? "+ MouseMoveCopySelect"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ SetStatusText(
+ sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]
+ );
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[370]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ $? "- MouseMoveCopySelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveCopyPlace(void)
+{
+ $? "+ MouseMoveCopyPlace"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+ }
+ }
+ else {
+ }
+ $? "- MouseMoveCopyPlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftNoop(void)
+{
+ Wxd_object_t *pobj;
+ size_t si;
+ $? "+ MouseLeftNoop"
+ if (m_bMousePos) {
+#if 0
+ if (NULL == m_pStyle) { $? ". new style pointer"
+#endif
+ pobj = FindNearestObject();
+ if (NULL != pobj) {
+ m_pStyle = pobj;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ $? ". all unmarked"
+ if (
+ (WXD_OT_TEXT <= m_pStyle->ot)
+ && (WXD_OT_DOT_WHITE >= m_pStyle->ot)
+ ) {
+ msgMouseR->SetLabel(sTexts[200]);
+ $? ". r label set"
+ msgMouseL->SetLabel(sNlWx[7]);
+ $? ". l label set"
+ si = (size_t)185U + (size_t)(m_pStyle->ot);
+ $? ". si = %u", (unsigned)si
+ SetStatusText(sTexts[si]);
+ $? ". status text set"
+ msgMouseR->Refresh();
+ $? ". refresh right"
+ msgMouseL->Refresh();
+ $? ". refresh left"
+ m_bUpdate = true;
+ $? ". update flag set"
+ StyleToGUI();
+ }
+ else {
+ SetStatusText(sNlWx[19]);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+#if 0
+ }
+ else { $? ". style pointer already available"
+ }
+#endif
+ }
+ else {
+ }
+ $? "- MouseLeftNoop"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDelete(void)
+{
+ Wxd_object_t *pobj;
+ $? "+ MouseLeftDelete"
+ if (m_bMousePos) {
+ pobj = FindNearestObject(true);
+ if (NULL != pobj) {
+ wxdobj_obj_delete_from_drawing(m_pDrw, pobj);
+ msgMouseL->SetLabel(sNlWx[7]);
+ msgMouseL->Refresh();
+ SetStatusText(sNlWx[7]);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ else {
+ }
+ $? "- MouseLeftDelete"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftMoveSelect(void)
+{
+ $? "+ MouseLeftMoveSelect"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject(true);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ m_iState = S_MOVE_PLACE;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ SetStatusText(sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[343]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+ }
+ $? "- MouseLeftMoveSelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftMovePlace(void)
+{
+ $? "+ MouseLeftMovePlace"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 1);
+ if (NULL != m_pCurrent) {
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ wxdobj_bb_for_drawing(m_pDrw);
+ }
+ m_iState = S_MOVE_SELECT;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+ $? "- MouseLeftMovePlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftCopySelect(void)
+{
+ $? "+ MouseLeftCopySelect"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject(true);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ m_iState = S_COPY_PLACE;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ if (
+ (WXD_OT_GROUP_BEGIN <= m_pCurrent->ot)
+ && (WXD_OT_DOT_WHITE >= m_pCurrent->ot)
+ ) {
+ SetStatusText(sTexts[(size_t)172U + (size_t)(m_pCurrent->ot)]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ }
+ msgMouseL->SetLabel(sTexts[371]);
+ }
+ else {
+ SetStatusText(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ }
+ msgMouseL->Refresh();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ $? "- MouseLeftCopySelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftCopyPlace(void)
+{
+ $? "+ MouseLeftCopyPlace"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ /* Create copy and shift objects in copy */
+ if (NULL != m_pCurrent) {
+ wxdobj_copy_recursive(m_pDrw, m_pCurrent, &m_ptMouseMoveDiff);
+ SetModified();
+ }
+ m_iState = S_COPY_SELECT;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+ $? "- MouseLeftCopyPlace"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationPolyFirst(void)
+{
+ $? "+ EndOperationPolyFirst"
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+ $? "- EndOperationPolyFirst"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationPolyFurther(bool bComplete, bool bSkip)
+{
+ dk4_er_t er;
+ uint16_t itd;
+ $? "+ EndOperationPolyFurther complete=%d skip=%d", (bComplete ? 1 : 0), (bSkip ? 1 : 0)
+ if (bSkip) {
+ $? ". skip input"
+ if (NULL != m_pCurrent) {
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ m_iState = S_POLY_FIRST;
+ }
+ else {
+ m_iState = S_NOOP;
+ }
+ }
+ else { $? ". do not skip input"
+ if (NULL != m_pCurrent) { $? ". have current object"
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (
+ (WXD_OT_POLYLINE == m_pCurrent->ot)
+ || (WXD_OT_POLYGON == m_pCurrent->ot)
+ ) { $? ". polyline or polygon"
+ if (2U < (m_pCurrent->det).p.n) {
+ dk4error_init(&er); $? ". more than 2 points"
+ itd = (m_pCurrent->det).p.n - 1U;
+ if ( wxdobj_del_polypoint(m_pCurrent, itd, &er) ) {
+ m_iState = S_POLY_FIRST; $? ". del point ok"
+ }
+ else { $? "! del point"
+ m_iState = S_NOOP;
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ SetModified();
+ }
+ else { $? ". 2 points or less"
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ }
+ m_iState = S_POLY_FIRST;
+ }
+ else { $? "! not a polyline or polygon"
+ m_iState = S_NOOP;
+ }
+ }
+ else { $? "! no current object"
+ m_iState = S_NOOP;
+ }
+ }
+ m_pCurrent = NULL;
+ if (bComplete) {
+ m_iState = S_NOOP;
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ $? "- EndOperationPolyFurther"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationSplineFirst(void)
+{
+ $? "+ EndOperationSplineFirst"
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+ $? "- EndOperationSplineFirst"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationSplineFurther(bool bComplete, bool bSkip)
+{
+ dk4_er_t er;
+ uint16_t itd;
+ $? "+ EndOperationSplineFurther complete=%d skip=%d", (bComplete ? 1 : 0), (bSkip ? 1 : 0)
+ if (bSkip) {
+ $? ". skip input"
+ if (NULL != m_pCurrent) {
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ m_iState = S_SPLINE_FIRST;
+ }
+ else {
+ m_iState = S_NOOP;
+ }
+ }
+ else { $? ". do not skip input"
+ if (NULL != m_pCurrent) { $? ". have current object"
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (
+ (WXD_OT_O_SPLINE == m_pCurrent->ot)
+ || (WXD_OT_C_SPLINE == m_pCurrent->ot)
+ ) { $? ". spline"
+ if (2U < (m_pCurrent->det).s.n) {
+ dk4error_init(&er); $? ". more than 2 points"
+ itd = (m_pCurrent->det).s.n - 1U;
+ if ( wxdobj_del_splinepoint(m_pCurrent, itd, &er) ) {
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].s =
+ SValueAtEnd();
+ m_iState = S_SPLINE_FIRST; $? ". del point ok"
+ }
+ else { $? "! del point"
+ m_iState = S_NOOP;
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ SetModified();
+ }
+ else { $? ". 2 points or less"
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ }
+ m_iState = S_SPLINE_FIRST;
+ }
+ else { $? "! not a polyline or polygon"
+ m_iState = S_NOOP;
+ }
+ }
+ else { $? "! no current object"
+ m_iState = S_NOOP;
+ }
+ }
+ m_pCurrent = NULL;
+ if (bComplete) {
+ m_iState = S_NOOP;
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ $? "- EndOperationSplineFurther"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationBoxFirst(void)
+{
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationTwoPointsSecond(int ns, bool bComplete)
+{
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ }
+ m_iState = ns;
+ if (bComplete) {
+ m_iState = S_NOOP;
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationBoxOpposite(bool bComplete)
+{
+ EndOperationTwoPointsSecond(S_BOX_FIRST, bComplete);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationCircleCenter(void)
+{
+ $? "+ EndOperationCircleCenter"
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+ $? "- EndOperationCircleCenter"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationCircleRadius(bool bComplete)
+{
+ $? "+ EndOperationCircleRadius"
+ EndOperationTwoPointsSecond(S_CIRCLE_CENTER, bComplete);
+ $? "- EndOperationCircleRadius"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationEllipseCenter(void)
+{
+ $? "+ EndOperationEllipseCenter"
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+ $? "- EndOperationEllipseCenter"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationEllipseCorner(bool bComplete)
+{
+ $? "+ EndOperationEllipseCorner"
+ EndOperationTwoPointsSecond(S_ELLIPSE_CENTER, bComplete);
+ $? "- EndOperationEllipseCorner"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationArc1(void)
+{
+#if 0
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(S_NOOP);
+#else
+ EndOperationPolyFirst();
+#endif
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationArc2(bool bComplete)
+{
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ }
+ m_iState = S_ARC_1;
+ if (bComplete) {
+ m_iState = S_NOOP;
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationArc3(bool bComplete)
+{
+ EndOperationArc2(bComplete);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationDot(void)
+{
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(m_iState);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationLibelemPlace(void)
+{
+ /*
+ Remove library element group object from drawing
+ */
+ if (NULL != m_pCurrent) {
+ wxdobj_obj_delete_from_drawing(m_pDrw, m_pCurrent);
+ }
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(m_iState);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationPointMovePlace(void)
+{
+ if (NULL != m_pCurrent) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_ELLIPSE : case WXD_OT_CIRCLE : {
+ DK4_MEMCPY(\
+ &((m_pCurrent->det).e),\
+ &m_ellPointMoveOri,\
+ sizeof(Wxd_det_ellipse_t)\
+ );
+ } break;
+ }
+ if (
+ wxdobj_set_control_point(m_pCurrent, &m_ptPointMoveOri, m_uCurrent)
+ ) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(&((m_pCurrent->det).b.b), &m_uCurrent);
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(&((m_pCurrent->det).i.br), &m_uCurrent);
+ } break;
+ }
+ }
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ }
+ m_uCurrent = (uint16_t)0U;
+#if 0
+ m_iState = S_NOOP;
+#endif
+ /* 2020-03-21 Bugfix
+ When aborting placement we probably want to select
+ another point to move.
+ */
+ m_iState = S_MOVEPT_SELECT;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationPointAddPlace(bool bComplete)
+{
+ $? "+ EndOperationPointAddPlace"
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_delete_control_point(m_pCurrent, m_uCurrent);
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ m_iState = ((bComplete) ? (S_NOOP) : (S_ADDPT_SELECT));
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ $? "- EndOperationPointAddPlace"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperationDrawingSizePlace(bool bComplete)
+{
+ $? "+ EndOperationPointAddPlace"
+ m_iState = ((bComplete) ? (S_NOOP) : (S_DRWSZ_SELECT));
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ DK4_MEMCPY(&(m_pDrw->bb),&m_oOldSize,sizeof(Wxd_bb_t));
+ DK4_MEMCPY(&(m_oBorder.det.b.b),&m_oOldSize,sizeof(Wxd_bb_t));
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ $? "- EndOperationPointAddPlace"
+}
+
+
+
+void
+WxdkdrawFrame::EndOperation(bool bComplete, bool bSkip)
+{
+ int rdl = WXD_REFRESH_MARKUP;
+ $? "+ EndOperation complete=%d skip=%d",(bComplete ? 1 : 0),(bSkip ? 1 : 0)
+ /*
+ _STATE_ End current operation.
+ */
+ switch (m_iState) {
+ /*
+ When ending operations in states having objects under
+ modification which are drawn in the markup pass,
+ we must refresh the drawing.
+ */
+ case S_MOVE_PLACE :
+ case S_COPY_PLACE :
+ case S_MOVEPT_SELECT :
+ case S_MOVEPT_PLACE :
+ case S_ADDPT_PLACE :
+ {
+ rdl = WXD_REFRESH_DRAWING;
+ } break;
+ }
+ /*
+ _STATE_ End current operation.
+ */
+ switch (m_iState) {
+ case S_NOOP : {
+ if (NULL != m_pStyle) {
+ m_pStyle = NULL;
+ StyleToGUI();
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ msgMouseR->SetLabel(sNlWx[7]);
+ msgMouseL->SetLabel(sNlWx[7]);
+ SetStatusText(sNlWx[19]);
+ msgMouseR->Refresh();
+ msgMouseL->Refresh();
+ m_bUpdate = true;
+ }
+ m_pCurrent = NULL;
+ } break;
+ case S_POLY_FIRST : {
+ EndOperationPolyFirst();
+ } break;
+ case S_POLY_FURTHER : {
+ EndOperationPolyFurther(bComplete, bSkip);
+ } break;
+ case S_SPLINE_FIRST : {
+ EndOperationSplineFirst();
+ } break;
+ case S_SPLINE_FURTHER : {
+ EndOperationSplineFurther(bComplete, bSkip);
+ } break;
+ case S_BOX_FIRST : {
+ EndOperationBoxFirst();
+ } break;
+ case S_BOX_OPPOSITE : {
+ EndOperationBoxOpposite(bComplete);
+ } break;
+ case S_CIRCLE_CENTER : {
+ EndOperationCircleCenter();
+ } break;
+ case S_CIRCLE_RADIUS : {
+ EndOperationCircleRadius(bComplete);
+ } break;
+ case S_ELLIPSE_CENTER : {
+ EndOperationEllipseCenter();
+ } break;
+ case S_ELLIPSE_CORNER : {
+ EndOperationEllipseCorner(bComplete);
+ } break;
+ case S_ARC_1 : {
+ EndOperationArc1();
+ } break;
+ case S_ARC_2 : {
+ EndOperationArc2(bComplete);
+ } break;
+ case S_ARC_3 : {
+ EndOperationArc3(bComplete);
+ } break;
+ case S_DOT : {
+ EndOperationDot();
+ } break;
+ case S_LIBELEM_PLACE : {
+ EndOperationLibelemPlace();
+ } break;
+ case S_MOVEPT_PLACE : {
+ EndOperationPointMovePlace();
+ } break;
+ case S_ADDPT_PLACE : {
+ EndOperationPointAddPlace(bComplete);
+ } break;
+ case S_DRWSZ_PLACE : {
+ EndOperationDrawingSizePlace(bComplete);
+ } break;
+ case S_GROUP_ONE : {
+ if ((2 > wxdobj_num_marked_2(m_pDrw)) || (bComplete)) {
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ } break;
+ case S_GROUP_RECT_2 : {
+ m_iState = ((bComplete) ? (S_NOOP) : (S_GROUP_RECT_1));
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ } break;
+ case S_REGION_DELETE : {
+ m_iState = ((bComplete) ? (S_NOOP) : (S_DELETE));
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ } break;
+ default : {
+ m_pStyle = NULL;
+ m_pCurrent = NULL;
+ m_iState = S_NOOP;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, rdl);
+ } break;
+ }
+ $? "- EndOperation"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePolyFirst(void)
+{
+ $? "+ MouseMovePolyFirst"
+ $? "- MouseMovePolyFirst"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPolyFirst(void)
+{
+ $? "+ MouseLeftPolyFirst"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_polyline(
+ m_pDrw, NULL, 2U,
+ ((WXD_OT_POLYGON == m_iObjToCreate) ? 1 : 0), &m_oStyle
+ );
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).p.p)
+ ) {
+ m_iState = S_POLY_FURTHER;
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ ((m_pCurrent->det).p.p)[0].x = ((m_pCurrent->det).p.p)[1].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).p.p)[0].y = ((m_pCurrent->det).p.p)[1].y =
+ m_ptMousePosGrid.y;
+ if (WXD_OT_POLYGON == m_iObjToCreate) {
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ $? "- MouseLeftPolyFirst"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePolyFurther(void)
+{
+ bool bOldAcceptable;
+ $? "+ MouseMovePolyFurther"
+ if (m_bMousePos) {
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).p.p)
+ ) {
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].y =
+ m_ptMousePosGrid.y;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseMovePolyFurther"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPolyFurther(void)
+{
+ dk4_er_t er;
+ $? "+ MouseLeftPolyFurther"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).p.p)
+ ) {
+ /* Fix current segment end point
+ */
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].y =
+ m_ptMousePosGrid.y;
+ dk4error_init(&er);
+ if (
+ wxdobj_add_polypoint(m_pCurrent, (m_pCurrent->det).p.n, &er)
+ ) {
+ /*
+ Initial end point value for new segment
+ */
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).p.p)[(m_pCurrent->det).p.n - 1U].y =
+ m_ptMousePosGrid.y;
+ SetModified();
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftPolyFurther"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveSplineFirst(void)
+{
+ $? "+ MouseMoveSplineFirst"
+ $? "- MouseMoveSplineFirst"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftSplineFirst(void)
+{
+ $? "+ MouseLeftSplineFirst"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_spline(
+ m_pDrw, NULL, 2U,
+ ((WXD_OT_C_SPLINE == m_iObjToCreate) ? 1 : 0), &m_oStyle
+ );
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).s.p)
+ ) {
+ m_iState = S_SPLINE_FURTHER;
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ ((m_pCurrent->det).s.p)[0].x = ((m_pCurrent->det).s.p)[1].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).s.p)[0].y = ((m_pCurrent->det).s.p)[1].y =
+ m_ptMousePosGrid.y;
+ ((m_pCurrent->det).s.p)[0].s = ((m_pCurrent->det).s.p)[1].s =
+ SValueAtEnd();
+ if (WXD_OT_C_SPLINE == m_iObjToCreate) {
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ $? "- MouseLeftSplineFirst"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveSplineFurther(void)
+{
+ bool bOldAcceptable;
+ $? "+ MouseMoveSplineFurther"
+ if (m_bMousePos) {
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).s.p)
+ ) {
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].y =
+ m_ptMousePosGrid.y;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseMoveSplineFurther"
+}
+
+
+
+double
+WxdkdrawFrame::SValueAtEnd(void)
+{
+ double back = 0.0;
+ if (NULL != m_pCurrent) {
+ if (WXD_OT_C_SPLINE == m_pCurrent->ot) {
+ back = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftSplineFurther(void)
+{
+ dk4_er_t er;
+ $? "+ MouseLeftSplineFurther"
+ if (m_bMousePos) { $? ". mouse position available"
+ if (IsAcceptablePoint()) {
+ if (
+ (NULL != m_pCurrent)
+ && (NULL != (m_pCurrent->det).s.p)
+ ) { $? ". pointers ok"
+ /* Fix current segment end point
+ */
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].y =
+ m_ptMousePosGrid.y;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].s =
+ (m_bSplineInterpolated ? (-1.0) : (1.0));
+ dk4error_init(&er);
+ if (
+ wxdobj_add_splinepoint(m_pCurrent,(m_pCurrent->det).s.n,&er)
+ ) {
+ $? ". spline point added"
+ /*
+ Initial end point value for new segment
+ */
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].x =
+ m_ptMousePosGrid.x;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].y =
+ m_ptMousePosGrid.y;
+ ((m_pCurrent->det).s.p)[(m_pCurrent->det).s.n - 1U].s =
+ SValueAtEnd();
+ SetModified();
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ }
+ else { $? "! failed to add spline point"
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else { $? "! no object or no points"
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ }
+ else { $? "! mouse position"
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftSplineFurther"
+}
+
+
+
+void
+WxdkdrawFrame::SetBoxDetails(bool bUpdateRadius)
+{
+ int32_t h;
+ int32_t w;
+ int32_t m;
+ if (NULL != m_pCurrent) {
+ if (m_ptMousePosGrid.x >= m_ptMouseMoveStart.x) {
+ (m_pCurrent->det).b.b.xl = m_ptMouseMoveStart.x;
+ (m_pCurrent->det).b.b.xr = m_ptMousePosGrid.x;
+ }
+ else {
+ (m_pCurrent->det).b.b.xl = m_ptMousePosGrid.x;
+ (m_pCurrent->det).b.b.xr = m_ptMouseMoveStart.x;
+ }
+ if (m_ptMousePosGrid.y >= m_ptMouseMoveStart.y) {
+ (m_pCurrent->det).b.b.yb = m_ptMouseMoveStart.y;
+ (m_pCurrent->det).b.b.yt = m_ptMousePosGrid.y;
+ }
+ else {
+ (m_pCurrent->det).b.b.yb = m_ptMousePosGrid.y;
+ (m_pCurrent->det).b.b.yt = m_ptMouseMoveStart.y;
+ }
+ if (bUpdateRadius && m_bSplineInterpolated) {
+ w = (m_pCurrent->det).b.b.xr - (m_pCurrent->det).b.b.xl;
+ h = (m_pCurrent->det).b.b.yt - (m_pCurrent->det).b.b.yb;
+ m = ((w < h) ? (w) : (h));
+ (m_pCurrent->det).b.r = (uint32_t)(m / (int32_t)4UL);
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveBoxFirst(void)
+{
+ $? "+ MouseMoveBoxFirst"
+ $? "- MouseMoveBoxFirst"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftBoxFirst(void)
+{
+ $? "+ MouseLeftBoxFirst"
+ if (m_bMousePos) {
+ m_bAcceptablePoint = false;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_box(m_pDrw, NULL, &m_oStyle);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_iState = S_BOX_OPPOSITE;
+ (m_pCurrent->det).b.r = (uint32_t)0UL;
+ (m_pCurrent->det).b.b.xl = m_ptMousePosGrid.x;
+ (m_pCurrent->det).b.b.xr = m_ptMousePosGrid.x;
+ (m_pCurrent->det).b.b.yb = m_ptMousePosGrid.y;
+ (m_pCurrent->det).b.b.yt = m_ptMousePosGrid.y;
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ }
+ $? "- MouseLeftBoxFirst"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveBoxOpposite(void)
+{
+ bool bOldAcceptablePoint;
+ $? "+ MouseMoveBoxOpposite"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ SetBoxDetails(true);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptablePoint = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptablePoint != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseMoveBoxOpposite"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftBoxOpposite(void)
+{
+ $? "+ MouseLeftBoxOpposite"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ if (IsAcceptablePoint()) {
+ m_iState = S_BOX_FIRST;
+ SetBoxDetails(true);
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftBoxOpposite"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveCircleCenter(void)
+{
+ $? "+ MouseMoveCircleCenter"
+ $? "- MouseMoveCircleCenter"
+}
+
+
+
+void
+WxdkdrawFrame::CalculateCircleRadius(uint32_t & rx, dk4_er_t *erp)
+{
+ dk4_er_t er;
+ double dx;
+ double dy;
+ int32_t xdiff = (int32_t)0L;
+ int32_t ydiff = (int32_t)0L;
+
+ dk4error_init(&er);
+ xdiff = dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ m_ptMousePosGrid.x, m_ptMouseMoveStart.x, &er
+ ), &er
+ );
+ ydiff = dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ m_ptMousePosGrid.y, m_ptMouseMoveStart.y, &er
+ ), &er
+ );
+ if ((int32_t)0L == xdiff) {
+ rx = (uint32_t)ydiff;
+ }
+ else {
+ if ((int32_t)0L == ydiff) {
+ rx = (uint32_t)xdiff;
+ }
+ else {
+ dx = (double)xdiff;
+ dy = (double)ydiff;
+ dx = dk4ma_rint(sqrt(dx * dx + dy * dy));
+ rx = dk4ma_uint32_from_double(dx, &er);
+ }
+ }
+ if (DK4_E_NONE != er.ec) {
+ rx = (uint32_t)0UL;
+ dk4error_copy(erp, &er);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftCircleCenter(void)
+{
+ $? "+ MouseLeftCircleCenter"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_circle(m_pDrw, NULL, &m_oStyle);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_iState = S_CIRCLE_RADIUS;
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ (m_pCurrent->det).e.x = m_ptMousePosGrid.x;
+ (m_pCurrent->det).e.y = m_ptMousePosGrid.y;
+ (m_pCurrent->det).e.rx = 0UL;
+ (m_pCurrent->det).e.ry = 0UL;
+ (m_pCurrent->det).e.a = 0;
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ }
+ $? "- MouseLeftCircleCenter"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveCircleRadius(void)
+{
+ dk4_er_t er;
+ uint32_t rx = 0UL;
+ bool bOldAcceptable;
+ $? "+ MouseMoveCircleRadius"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ dk4error_init(&er);
+ CalculateCircleRadius(rx, &er);
+ if (DK4_E_NONE == er.ec) {
+ (m_pCurrent->det).e.rx = rx;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseMoveCircleRadius"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftCircleRadius(void)
+{
+ dk4_er_t er;
+ uint32_t rx = 0UL;
+ $? "+ MouseLeftCircleRadius"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (NULL != m_pCurrent) {
+ dk4error_init(&er);
+ CalculateCircleRadius(rx, &er);
+ if (DK4_E_NONE == er.ec) {
+ (m_pCurrent->det).e.rx = rx;
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetModified();
+ m_iState = S_CIRCLE_CENTER;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ }
+ else {
+ /* ERROR: No mouse position available */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftCircleRadius"
+}
+
+
+
+void
+WxdkdrawFrame::CalculateEllipseRadii(uint32_t & rx,uint32_t & ry,dk4_er_t *erp)
+{
+ dk4_er_t er;
+
+ dk4error_init(&er);
+ rx = (uint32_t)dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ m_ptMousePosGrid.x, m_ptMouseMoveStart.x, &er
+ ), &er
+ );
+ ry = (uint32_t)dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ m_ptMousePosGrid.y, m_ptMouseMoveStart.y, &er
+ ), &er
+ );
+ if (DK4_E_NONE != er.ec) {
+ rx = ry = (uint32_t)0UL;
+ dk4error_copy(erp, &er);
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveEllipseCenter(void)
+{
+ $? "+ MouseMoveEllipseCenter"
+ $? "- MouseMoveEllipseCenter"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftEllipseCenter(void)
+{
+ $? "+ MouseLeftEllipseCenter"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_ellipse(m_pDrw, NULL, &m_oStyle);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_iState = S_ELLIPSE_CORNER;
+ m_bAcceptablePoint = false;
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ SetMouseAndStatusTexts(m_iState);
+ (m_pCurrent->det).e.x = m_ptMousePosGrid.x;
+ (m_pCurrent->det).e.y = m_ptMousePosGrid.y;
+ (m_pCurrent->det).e.rx = 0UL;
+ (m_pCurrent->det).e.ry = 0UL;
+ (m_pCurrent->det).e.a = 0;
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Mouse position not known */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftEllipseCenter"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveEllipseCorner(void)
+{
+ dk4_er_t er;
+ uint32_t rx = 0UL;
+ uint32_t ry = 0UL;
+ bool bOldAcceptable;
+ $? "+ MouseMoveEllipseCorner"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ dk4error_init(&er);
+ CalculateEllipseRadii(rx, ry, &er);
+ if (DK4_E_NONE == er.ec) {
+ (m_pCurrent->det).e.rx = rx;
+ (m_pCurrent->det).e.ry = ry;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: No mouse position */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseMoveEllipseCorner"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftEllipseCorner(void)
+{
+ dk4_er_t er;
+ uint32_t rx = 0UL;
+ uint32_t ry = 0UL;
+ $? "+ MouseLeftEllipseCorner"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (NULL != m_pCurrent) {
+ dk4error_init(&er);
+ CalculateEllipseRadii(rx, ry, &er);
+ if (DK4_E_NONE == er.ec) {
+ (m_pCurrent->det).e.rx = rx;
+ (m_pCurrent->det).e.ry = ry;
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetModified();
+ m_iState = S_ELLIPSE_CENTER;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ dk4error_copy(&m_oErrorReport, &er);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported). */
+ }
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftEllipseCorner"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveArc1(void)
+{
+ $? "+ MouseMoveArc1"
+ $? "- MouseMoveArc1"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftArc1(void)
+{
+ $? "+ MouseLeftArc1"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_add_arc(
+ m_pDrw, NULL, ((WXD_OT_C_ARC == m_iObjToCreate) ? 1 : 0), &m_oStyle
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_iState = S_ARC_2;
+ m_bAcceptablePoint = false;
+ (m_pCurrent->det).a.x1 =
+ (m_pCurrent->det).a.x2 =
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y1 =
+ (m_pCurrent->det).a.y2 =
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ (m_pCurrent->det).a.x = (double)(m_ptMousePosGrid.x);
+ (m_pCurrent->det).a.y = (double)(m_ptMousePosGrid.y);
+ (m_pCurrent->det).a.r = 0.0;
+ (m_pCurrent->det).a.a = 0.0;
+ (m_pCurrent->det).a.b = 2.0 * M_PI;
+ (m_pCurrent->det).a.d = (int8_t)0;
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ SetMouseAndStatusTexts(m_iState);
+ if (WXD_OT_C_ARC == m_iObjToCreate) {
+ if (WXD_FS_PURE < m_pCurrent->fs) {
+ UpdateStipples();
+ }
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Unknown mouse position */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftArc1"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveArc2(void)
+{
+ bool bOldAcceptable;
+ $? "+ MouseMoveArc2"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ (m_pCurrent->det).a.x2 =
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y2 =
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: Unknown mouse position */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseMoveArc2"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftArc2(void)
+{
+ $? "+ MouseLeftArc2"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (NULL != m_pCurrent) {
+ (m_pCurrent->det).a.x2 =
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y2 =
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ m_iState = S_ARC_3;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ }
+ else {
+ /* RROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftArc2"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveArc3(void)
+{
+ bool bOldAcceptable;
+ $? "+ MouseMoveArc3"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ wxdarc_calculation(
+ &((m_pCurrent->det).a.x),
+ &((m_pCurrent->det).a.y),
+ &((m_pCurrent->det).a.r),
+ &((m_pCurrent->det).a.a),
+ &((m_pCurrent->det).a.b),
+ &((m_pCurrent->det).a.d),
+ (m_pCurrent->det).a.x1,
+ (m_pCurrent->det).a.y1,
+ (m_pCurrent->det).a.x2,
+ (m_pCurrent->det).a.y2,
+ (m_pCurrent->det).a.x3,
+ (m_pCurrent->det).a.y3
+ );
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ /* ERROR: Unknown mouse position */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseMoveArc3"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftArc3(void)
+{
+ $? "+ MouseLeftArc3"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (NULL != m_pCurrent) {
+ (m_pCurrent->det).a.x3 = m_ptMousePosGrid.x;
+ (m_pCurrent->det).a.y3 = m_ptMousePosGrid.y;
+ wxdarc_calculation(
+ &((m_pCurrent->det).a.x),
+ &((m_pCurrent->det).a.y),
+ &((m_pCurrent->det).a.r),
+ &((m_pCurrent->det).a.a),
+ &((m_pCurrent->det).a.b),
+ &((m_pCurrent->det).a.d),
+ (m_pCurrent->det).a.x1,
+ (m_pCurrent->det).a.y1,
+ (m_pCurrent->det).a.x2,
+ (m_pCurrent->det).a.y2,
+ (m_pCurrent->det).a.x3,
+ (m_pCurrent->det).a.y3
+ );
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ m_iState = S_ARC_1;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ /* ERROR: Memory (already reported). */
+ }
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftArc3"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDot(void)
+{
+ $? "+ MouseMoveDot"
+ $? "- MouseMoveDot"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDot(void)
+{
+ $? "+ MouseLeftDot"
+ if (m_bMousePos) {
+ m_pCurrent = wxdobj_add_dot(
+ m_pDrw, NULL,
+ ((WXD_OT_DOT_WHITE == m_iObjToCreate) ? (1) : (0)),
+ &m_oStyle
+ );
+ if (NULL != m_pCurrent) {
+ $? ". stroke red %d", (int)(m_pCurrent->sc[0])
+ $? ". stroke green %d", (int)(m_pCurrent->sc[1])
+ $? ". stroke blue %d", (int)(m_pCurrent->sc[2])
+ $? ". fill red %d", (int)(m_pCurrent->fc[0])
+ $? ". fill green %d", (int)(m_pCurrent->fc[1])
+ $? ". fill blue %d", (int)(m_pCurrent->fc[2])
+ (m_pCurrent->det).d.x = m_ptMousePosGrid.x;
+ (m_pCurrent->det).d.y = m_ptMousePosGrid.y;
+ (m_pCurrent->det).d.d = (
+ (WXD_OT_DOT_WHITE == m_iObjToCreate)
+ ? (m_iv[IVI_DOT_DIAMETER_WHITE])
+ : (m_iv[IVI_DOT_DIAMETER_FILLED])
+ );
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (DK4_I16_MAX > m_pCurrent->lay) {
+ m_pCurrent->lay += (int16_t)1;
+ }
+ wxdobj_bb_simple_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Mouse position unknown */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftDot"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveText(void)
+{
+ $? "+ MouseMoveText"
+ $? "- MouseMoveText"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftText(void)
+{
+ Wxd_object_t *pObject = NULL;
+#if 0
+ wxChar const *ptrExportText = NULL;
+ wxChar const *ptrScreenText = NULL;
+#endif
+ wxChar *ptrExportText = NULL;
+ wxChar *ptrScreenText = NULL;
+ int32_t x;
+ int32_t y;
+ bool bLaTeX;
+ $? "+ MouseLeftText"
+ x = m_ptMousePosGrid.x;
+ y = m_ptMousePosGrid.y;
+ bLaTeX = cbStyleTextLaTeX->GetValue();
+ m_pCurrent = NULL;
+ if (m_bMousePos) {
+ WxdkdrawDlgTextInput tid(
+ this, sTexts, sNlWx, &ptrExportText, &ptrScreenText, bLaTeX,
+ &m_oErrorReport
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ if (wxID_OK == tid.ShowModal()) {
+ if (NULL != ptrExportText) {
+ pObject = wxdobj_add_textlabel(
+ m_pDrw, NULL, ptrExportText, &m_oStyle
+ );
+ if (NULL != pObject) {
+ (pObject->det).t.a = 0;
+ (pObject->det).t.x = x;
+ (pObject->det).t.y = y;
+ (pObject->det).t.tsc = ptrScreenText;
+ UpdateFonts();
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ wxdobj_bb_simple_object(m_pDrw, pObject);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ }
+#if 0
+ WxdkdrawDlgTextInput tid(this, sTexts, sNlWx, bLaTeX);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ if (wxID_OK == tid.ShowModal()) {
+ wxTextCtrl *pExportText = tid.GetExportTextCtrl();
+ wxTextCtrl *pScreenText = tid.GetScreenTextCtrl();
+ wxString stringExp = pExportText->GetValue();
+ wxString stringScr = pScreenText->GetValue();
+ wxCStrData sExportText = stringExp.c_str();
+ wxCStrData sScreenText = stringScr.c_str();
+ ptrExportText = (wxChar const *)sExportText;
+ ptrScreenText = (wxChar const *)sScreenText;
+ if ((NULL != ptrExportText)) {
+ if (0 < dk4strx_len(ptrExportText)) {
+ pObject = wxdobj_add_textlabel(
+ m_pDrw, NULL, ptrExportText, &m_oStyle
+ );
+ if (NULL != pObject) {
+ (pObject->det).t.a = 0;
+ (pObject->det).t.x = m_ptMousePosGrid.x;
+ (pObject->det).t.y = m_ptMousePosGrid.y;
+ UpdateFonts();
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ wxdobj_bb_simple_object(m_pDrw, pObject);
+ if (
+ bLaTeX
+ && (NULL != ptrScreenText)
+ && (0 < dk4strx_len(ptrScreenText))
+ ) {
+ (pObject->det).t.tsc =
+ dk4strx_dup(ptrScreenText, NULL);
+ if (NULL == (pObject->det).t.tsc) {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport,
+ DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ UpdateFonts();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: No input for export text */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_NO_EXPORT_TEXT
+ );
+ }
+ }
+ else {
+ /* ERROR: No export text (memory) */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_NO_EXPORT_TEXT
+ );
+ }
+ }
+ else {
+ /* Aborted by user */
+ }
+#endif
+ }
+ else {
+ /* ERROR: Mouse position outside coordinates */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOUSE_POS_NOT_AVAILABLE
+ );
+ }
+ $? "- MouseLeftText"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveImage1(void)
+{
+ $? "+ MouseMoveImage1"
+ $? "- MouseMoveImage1"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveImage2(void)
+{
+ bool bOldAcceptable;
+ $? "+ MouseMoveImage2"
+ if (m_bMousePos) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ bOldAcceptable = m_bAcceptablePoint;
+ m_bAcceptablePoint = IsAcceptablePoint();
+ if (bOldAcceptable != m_bAcceptablePoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ $? "- MouseMoveImage2"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftImage1(void)
+{
+ $? "+ MouseLeftImage1"
+ if (m_bMousePos) {
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_iState = S_IMG_2;
+ m_bAcceptablePoint = false;
+ SetMouseAndStatusTexts(m_iState);
+ }
+ $? "- MouseLeftImage1"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftImage2(void)
+{
+ wxString sDialogTitle(sTexts[409]);
+ wxString sFileTypes(image_files_to_open);
+ wxChar const *vptr;
+ Wxd_object_t *pobj;
+ $? "+ MouseLeftImage2"
+ if (m_bMousePos) {
+ if (IsAcceptablePoint()) {
+ if (
+ (m_ptMouseMoveStart.x != m_ptMousePosGrid.x)
+ && (m_ptMouseMoveStart.y != m_ptMousePosGrid.y)
+ ) {
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sImageDir, wxEmptyString,
+ sFileTypes, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sImageDir, wxEmptyString,
+ sFileTypes, wxOPEN
+ );
+#endif
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ m_sImageDir = dlg.GetDirectory();
+ {
+ wxCStrData vstrdata = pa.c_str();
+ vptr = (wxChar const *)vstrdata;
+ if (NULL != vptr) {
+ pobj = wxdobj_add_image(m_pDrw,NULL,vptr,&m_oStyle);
+ if (NULL != pobj) {
+ (pobj->det).i.br.xl = m_ptMouseMoveStart.x;
+ (pobj->det).i.br.yb = m_ptMouseMoveStart.y;
+ (pobj->det).i.br.xr = m_ptMousePosGrid.x;
+ (pobj->det).i.br.yt = m_ptMousePosGrid.y;
+ wxdobj_bb_correct(&((pobj->det).i.br));
+ wxdobj_load_image(
+ pobj,
+ pAppHelp->GetDkEncoding(),
+ pAppHelp->GetWxEncoding()
+ );
+ SetModified();
+ wxdobj_bb_simple_object(m_pDrw, pobj);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport,
+ DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: No string data */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_NO_FILENAME
+ );
+ }
+ }
+ }
+ else {
+ }
+ m_iState = S_IMG_1;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+ }
+ $? "- MouseLeftImage2"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveLibelemPlace(void)
+{
+ $? "+ MouseMoveLibelemPlace"
+ /*
+ Reaction is same as placing an element to move
+ */
+ MouseMoveMovePlace();
+ if (NULL != m_pCurrent) {
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ $? "- MouseMoveLibelemPlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftLibelemPlace(void)
+{
+ $? "+ MouseLeftLibelemPlace"
+ if ((m_bMousePos) && (m_bMouseDiff)) {
+ if (0 != wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 0)) {
+ wxdobj_shift_marked(m_pDrw, &m_ptMouseMoveDiff, 1);
+ m_iState = S_NOOP;
+ SetModified();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ if (NULL != m_pCurrent) {
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ AddLibelem();
+ }
+ }
+ $? "- MouseLeftLibelemPlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointMoveSelect(void)
+{
+ Wxd_object_t *prevobj;
+ uint16_t prevpoint;
+
+ $? "+ MouseMovePointMoveSelect"
+ if (m_bMousePos) {
+ /*
+ Save previous candidate object and point
+ */
+ prevobj = m_pCurrent;
+ prevpoint = m_uCurrent;
+ /*
+ Check for new candicate
+ */
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_move_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ }
+ /*
+ On object or point change redraw the markup
+ */
+ if (
+ ((NULL != m_pCurrent) && (NULL == prevobj))
+ || ((NULL == m_pCurrent) && (NULL != prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ if ((prevobj != m_pCurrent) || (prevpoint != m_uCurrent)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ $? "- MouseMovePointMoveSelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointMoveSelect(void)
+{
+ $? "+ MouseLeftPointMoveSelect"
+ if (m_bMousePos) { $? ". have mouse position"
+ if (NULL != m_pCurrent) { $? ". have old current object"
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ } $? ". do object search"
+ m_pCurrent = wxdobj_point_move_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ ); $? ". did object search"
+ if (NULL != m_pCurrent) { $? ". have new current object"
+ $? ". 1 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ m_bSnap = (
+ (0 == cbPointMoveMode->GetSelection()) ? (true) : (false)
+ );
+ $? ". 2 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ $? ". 3 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ $? ". 4 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ if (
+ wxdobj_get_control_point(
+ &m_ptPointMoveOri, m_pCurrent, m_uCurrent
+ )
+ ) {
+ $? ". 5 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_ELLIPSE : case WXD_OT_CIRCLE : {
+ $? ". 6 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ DK4_MEMCPY(\
+ &m_ellPointMoveOri,\
+ &((m_pCurrent->det).e),\
+ sizeof(Wxd_det_ellipse_t)\
+ );
+ $? ". 7 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ } break;
+ }
+ if (m_bSnap) {
+ $? ". 8 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ wxdobj_set_control_point(
+ m_pCurrent, &m_ptMousePosGrid, m_uCurrent
+ );
+ $? ". 9 %d", m_oErrorReport.ec
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ } $? ". 10 %d", m_oErrorReport.ec
+ m_iState = S_MOVEPT_PLACE;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else { $? "! failed to get control point"
+ /* ERROR: Failed to get control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_GET_CONTROL_POINT
+ );
+ }
+ }
+ }
+ $? "- MouseLeftPointMoveSelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointMovePlace(void)
+{
+ dk4_er_t er;
+ Wxd_point_t pt;
+ $? "+ MouseMovePointMovePlace"
+ $? ". m_bMouseDiff = %d", (m_bMouseDiff ? 1 : 0)
+ if (m_bMousePos && (NULL != m_pCurrent)) { $? ". mouse pos, object ok"
+ if (m_bSnap || m_bMouseDiff) { $? ". snap or mouse diff"
+ if (m_bSnap) { $? ". snap"
+ if (
+ wxdobj_set_control_point(
+ m_pCurrent, &m_ptMousePosGrid, m_uCurrent
+ )
+ ) { $? ". set control point"
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).b.b), &m_uCurrent
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).i.br), &m_uCurrent
+ );
+ } break;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ else { $? "! failed to set control point"
+ /* ERROR: Failed to set control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_SET_CONTROL_POINT
+ );
+ }
+ }
+ else { $? ". mouse diff"
+ dk4error_init(&er);
+ pt.x = dk4ma_int32_t_add(
+ m_ptPointMoveOri.x, m_ptMouseMoveDiff.x, &er
+ );
+ pt.y = dk4ma_int32_t_add(
+ m_ptPointMoveOri.y, m_ptMouseMoveDiff.y, &er
+ );
+ if (DK4_E_NONE == er.ec) { $? ". x, y ok"
+ if (
+ wxdobj_set_control_point(m_pCurrent, &pt, m_uCurrent)
+ ) { $? ". control point set ok"
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).b.b), &m_uCurrent
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).i.br), &m_uCurrent
+ );
+ } break;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ else { $? "! failed to set control point"
+ /* ERROR: Failed to set control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_SET_CONTROL_POINT
+ );
+ }
+ }
+ else { $? "! math overflow"
+ /* ERROR: Math overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ }
+ else { $? "! failed to calculate mouse diff"
+ /* ERROR: Failed to calculate mouse difference */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else {
+ if (!(m_bMousePos)) { $? "! no mouse pos"
+ }
+ if (NULL == m_pCurrent) { $? "! no object"
+ }
+ }
+#endif
+ $? "- MouseMovePointMovePlace"
+}
+
+
+
+void
+WxdkdrawFrame::ModifySplineValue(Wxd_object_t *pCurrent, uint16_t uCurrent)
+{
+ double olds;
+
+ if (
+ (NULL != pCurrent)
+ && (
+ (WXD_OT_O_SPLINE == pCurrent->ot)
+ || (WXD_OT_C_SPLINE == pCurrent->ot)
+ )
+ && (uCurrent < (pCurrent->det).s.n)
+ ) {
+ WxdkdrawDlgSplineValue dlg(
+ this, drawco, m_pDrw, sTexts, &(((pCurrent->det).s.p)[uCurrent].s)
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, dlg);
+ olds = ((pCurrent->det).s.p)[uCurrent].s;
+ dlg.ShowModal();
+ wxdobj_bb_modified_object(m_pDrw, pCurrent);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_bUpdate = true;
+ if (olds != ((pCurrent->det).s.p)[uCurrent].s) {
+ SetModified();
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointMovePlace(void)
+{
+ dk4_er_t er;
+ Wxd_point_t pt;
+ $? "+ MouseLeftPointMovePlace"
+ if (m_bMousePos && (NULL != m_pCurrent)) {
+ $? ". m_bMouseDiff = %d", (m_bMouseDiff ? 1 : 0)
+ if (m_bSnap || m_bMouseDiff) {
+ if (m_bSnap) {
+ if (
+ wxdobj_set_control_point(
+ m_pCurrent, &m_ptMousePosGrid, m_uCurrent
+ )
+ ) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).b.b), &m_uCurrent
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).i.br), &m_uCurrent
+ );
+ /* 2020-03-24 Bugfix
+ After changing the available space we must
+ re-calculate the used space
+ */
+ wxdobj_image_placement(m_pCurrent);
+ } break;
+ }
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (
+ (NULL != m_pCurrent)
+ && (
+ (WXD_OT_O_SPLINE == m_pCurrent->ot)
+ || (WXD_OT_C_SPLINE == m_pCurrent->ot)
+ )
+ && (m_uCurrent < (m_pCurrent->det).s.n)
+ ) {
+#if 0
+ /* 2020-03-22 Modification
+ Changing spline s value is now decoupled
+ from moving spline points.
+ */
+ ModifySplineValue(m_pCurrent, m_uCurrent);
+#endif
+ }
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ m_iState = S_MOVEPT_SELECT;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ else {
+ /* ERROR: Failed to set control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_SET_CONTROL_POINT
+ );
+ }
+ }
+ else {
+ dk4error_init(&er);
+ pt.x = dk4ma_int32_t_add(
+ m_ptPointMoveOri.x, m_ptMouseMoveDiff.x, &er
+ );
+ pt.y = dk4ma_int32_t_add(
+ m_ptPointMoveOri.y, m_ptMouseMoveDiff.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ if (
+ wxdobj_set_control_point(m_pCurrent, &pt, m_uCurrent)
+ ) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_BOX : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).b.b), &m_uCurrent
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_bb_correct(
+ &((m_pCurrent->det).i.br), &m_uCurrent
+ );
+ } break;
+ }
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ if (
+ (NULL != m_pCurrent)
+ && (
+ (WXD_OT_O_SPLINE == m_pCurrent->ot)
+ || (WXD_OT_C_SPLINE == m_pCurrent->ot)
+ )
+ && (m_uCurrent < (m_pCurrent->det).s.n)
+ ) {
+#if 0
+ ModifySplineValue(m_pCurrent, m_uCurrent);
+#endif
+ }
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ m_iState = S_MOVEPT_SELECT;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ else {
+ /* ERROR: Failed to set control point */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_SET_CONTROL_POINT
+ );
+ }
+ }
+ else {
+ /* ERROR: Math overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ }
+ else {
+ /* ERROR: Failed to calculate mouse difference */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ $? "- MouseLeftPointMovePlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointDelete(void)
+{
+ Wxd_object_t *prevobj;
+ uint16_t prevpoint;
+ $? "+ MouseMovePointDelete"
+ if (m_bMousePos) {
+ prevobj = m_pCurrent;
+ prevpoint = m_uCurrent;
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_del_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ }
+ if (
+ ((NULL != m_pCurrent) && (NULL == prevobj))
+ || ((NULL == m_pCurrent) && (NULL != prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ if ((prevobj != m_pCurrent) || (prevpoint != m_uCurrent)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ $? "- MouseMovePointDelete"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointDelete(void)
+{
+ Wxd_object_t *prevobj;
+#if 0
+ uint16_t prevpoint;
+#endif
+ $? "+ MouseLeftPointDelete"
+ if (m_bMousePos) {
+ prevobj = m_pCurrent;
+#if 0
+ prevpoint = m_uCurrent;
+#endif
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_del_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ wxdobj_delete_control_point(m_pCurrent, m_uCurrent);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ SetModified();
+ }
+ else {
+ if (NULL != prevobj) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ }
+ $? "- MouseLeftPointDelete"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointAddSelect(void)
+{
+ Wxd_object_t *prevobj;
+ uint16_t prevpoint;
+ bool prevappend;
+ $? "+ MouseMovePointAddSelect"
+ if (m_bMousePos) {
+ prevobj = m_pCurrent;
+ prevpoint = m_uCurrent;
+ prevappend = m_bAppendPoint;
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_add_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent, &m_bAppendPoint,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ }
+ if (
+ (prevobj != m_pCurrent)
+ || (prevpoint != m_uCurrent)
+ || (prevappend != m_bAppendPoint)
+ ) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ if (
+ ((NULL == m_pCurrent) && (NULL != prevobj))
+ || ((NULL != m_pCurrent) && (NULL == prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ $? "- MouseMovePointAddSelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointAddSelect(void)
+{
+ bool bres = false;
+ $? "+ MouseLeftPointAddSelect"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_point_add_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent, &m_bAppendPoint,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ if (m_bAppendPoint) {
+ bres = wxdobj_add_control_point(
+ m_pCurrent, (m_uCurrent + (uint16_t)1U), &m_ptMousePosGrid
+ );
+ if (bres) {
+ m_uCurrent++;
+ }
+ }
+ else {
+ bres = wxdobj_add_control_point(
+ m_pCurrent, m_uCurrent, &m_ptMousePosGrid
+ );
+ }
+ if (bres) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ m_iState = S_ADDPT_PLACE;
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ }
+ $? "- MouseLeftPointAddSelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMovePointAddPlace(void)
+{
+ $? "+ MouseMovePointAddPlace"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ wxdobj_set_control_point(m_pCurrent,&m_ptMousePosGrid,m_uCurrent);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ }
+ }
+ $? "- MouseMovePointAddPlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftPointAddPlace(void)
+{
+ $? "+ MouseLeftPointAddPlace"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ wxdobj_set_control_point(m_pCurrent,&m_ptMousePosGrid,m_uCurrent);
+ m_iState = S_ADDPT_SELECT;
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ $? "- MouseLeftPointAddPlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDrawingSizeSelect(void)
+{
+ dk4_gra_point_t ppt;
+ double dlim;
+ double d;
+ uint16_t prevSelected;
+ uint16_t newSelected;
+ bool prevHavePoint;
+
+ $? "+ MouseMoveDrawingSizeSelect"
+ if (m_bMousePos) {
+ prevSelected = m_uCurrent;
+ prevHavePoint = m_bHaveCornerPoint;
+ newSelected = (uint16_t)0U;
+ dlim = 2.0 * (double)(drawco->m_uGridSnap);
+ ppt.x = (double)(m_ptMousePosRaw.x);
+ ppt.y = (double)(m_ptMousePosRaw.y);
+ d = wxdobj_dist_box(
+ &(m_pDrw->bb), (uint32_t)0UL, &ppt, true, &newSelected
+ );
+ if (dlim >= d) {
+ m_uCurrent = newSelected;
+ m_bHaveCornerPoint = true;
+ }
+ else {
+ m_uCurrent = (uint16_t)0U;
+ m_bHaveCornerPoint = false;
+ }
+ if (
+ (prevSelected != m_uCurrent)
+ || (prevHavePoint != m_bHaveCornerPoint)
+ ) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ if (prevHavePoint != m_bHaveCornerPoint) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ $? "- MouseMoveDrawingSizeSelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDrawingSizeSelect(void)
+{
+ dk4_gra_point_t ppt;
+ double dlim;
+ double d;
+ uint16_t newSelected;
+ $? "+ MouseLeftDrawingSizeSelect"
+ if (m_bMousePos) {
+ newSelected = (uint16_t)0U;
+ dlim = 2.0 * (double)(drawco->m_uGridSnap);
+ ppt.x = (double)(m_ptMousePosRaw.x);
+ ppt.y = (double)(m_ptMousePosRaw.y);
+ d = wxdobj_dist_box(
+ &(m_pDrw->bb), (uint32_t)0UL, &ppt, true, &newSelected
+ );
+ if (dlim >= d) {
+ m_uCurrent = newSelected;
+ m_bHaveCornerPoint = true;
+ m_bSnap = (
+ (0 == cbPointMoveMode->GetSelection()) ? (true) : (false)
+ );
+ DK4_MEMCPY(\
+ &m_ptMouseMoveStart,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ DK4_MEMCPY(\
+ &m_ptPointMoveOri,\
+ &m_ptMousePosGrid,\
+ sizeof(Wxd_point_t)\
+ );
+ m_ptMouseMoveDiff.x = (int32_t)0L;
+ m_ptMouseMoveDiff.y = (int32_t)0L;
+ m_bMouseDiff = true;
+ switch ( (int)m_uCurrent ) {
+ case 3 : {
+ m_ptPointMoveOri.x = m_oBorder.det.b.b.xl;
+ m_ptPointMoveOri.y = m_oBorder.det.b.b.yt;
+ } break;
+ case 2 : {
+ m_ptPointMoveOri.x = m_oBorder.det.b.b.xr;
+ m_ptPointMoveOri.y = m_oBorder.det.b.b.yt;
+ } break;
+ case 1 : {
+ m_ptPointMoveOri.x = m_oBorder.det.b.b.xr;
+ m_ptPointMoveOri.y = m_oBorder.det.b.b.yb;
+ } break;
+ default : {
+ m_ptPointMoveOri.x = m_oBorder.det.b.b.xl;
+ m_ptPointMoveOri.y = m_oBorder.det.b.b.yb;
+ } break;
+ }
+ if (m_bSnap) {
+ wxdobj_set_control_point(
+ &m_oBorder, &m_ptMousePosGrid, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ else {
+ }
+ m_iState = S_DRWSZ_PLACE;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ $? "- MouseLeftDrawingSizeSelect"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDrawingSizePlace(void)
+{
+ dk4_er_t er;
+ Wxd_point_t pt;
+ $? "+ MouseMoveDrawingSizePlace"
+ if (m_bMousePos) {
+ if (m_bSnap) {
+ wxdobj_set_control_point(
+ &m_oBorder, &m_ptMousePosGrid, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ else {
+ if (m_bMouseDiff) { $? ". m_bMouseDiff true"
+ dk4error_init(&er);
+ pt.x = dk4ma_int32_t_add(
+ m_ptPointMoveOri.x, m_ptMouseMoveDiff.x, &er
+ );
+ pt.y = dk4ma_int32_t_add(
+ m_ptPointMoveOri.y, m_ptMouseMoveDiff.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ wxdobj_set_control_point(
+ &m_oBorder, &pt, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ }
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ $? "- MouseMoveDrawingSizePlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDrawingSizePlace(void)
+{
+ dk4_er_t er;
+ Wxd_point_t pt;
+ bool bEqual = false;;
+ $? "+ MouseLeftDrawingSizePlace"
+ if (m_bMousePos) {
+ if (m_bSnap) { $? ". snap"
+ wxdobj_set_control_point(
+ &m_oBorder, &m_ptMousePosGrid, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+#if 0
+ bEqual = wxdobj_bb_equal(&(m_pDrw->bb), &(m_oBorder.det.b.b));
+#endif
+ bEqual = wxdobj_bb_equal(&(m_pDrw->bb), &m_oOldSize);
+ $? ". bEqual = %d", (bEqual ? 1 : 0)
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ else {
+ if (m_bMouseDiff) { $? ". relative"
+ dk4error_init(&er);
+ pt.x = dk4ma_int32_t_add(
+ m_ptPointMoveOri.x, m_ptMouseMoveDiff.x, &er
+ );
+ pt.y = dk4ma_int32_t_add(
+ m_ptPointMoveOri.y, m_ptMouseMoveDiff.y, &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ wxdobj_set_control_point(
+ &m_oBorder, &pt, m_uCurrent
+ );
+ wxdobj_bb_correct(
+ &(m_oBorder.det.b.b), &m_uCurrent
+ );
+#if 0
+ bEqual = wxdobj_bb_equal(
+ &(m_pDrw->bb), &(m_oBorder.det.b.b)
+ );
+#endif
+ bEqual = wxdobj_bb_equal(&(m_pDrw->bb), &m_oOldSize);
+ $? ". bEqual = %d", (bEqual ? 1 : 0)
+ DK4_MEMCPY(\
+ &(m_pDrw->bb),&(m_oBorder.det.b.b),sizeof(Wxd_bb_t)\
+ );
+ }
+ }
+ }
+ if ((!(bEqual)) && (0 != m_iv[IVI_C_COR_POSITION])) {
+ OnCenterViewFunction(); $? ". center view"
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_GRID);
+ m_iState = S_DRWSZ_SELECT;
+ SetMouseAndStatusTexts(m_iState);
+ if (0 != DK4_MEMCMP(&m_oOldSize,&(m_pDrw->bb),sizeof(Wxd_bb_t))) {
+ SetModified();
+ }
+ DK4_MEMCPY(&m_oOldSize,&(m_pDrw->bb),sizeof(Wxd_bb_t));
+ }
+ $? "- MouseLeftDrawingSizePlace"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveFlip(void)
+{
+ Wxd_object_t *pOldCurrent;
+ $? "+ MouseMoveFlip"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ }
+ if (
+ ((NULL != m_pCurrent) && (NULL == pOldCurrent))
+ || ((NULL == m_pCurrent) && (NULL != pOldCurrent))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ else {
+ }
+ $? "- MouseMoveFlip"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftFlip(void)
+{
+ Wxd_bb_t bball;
+ Wxd_bb_t bbobj;
+ bool bFirst;
+ bool bSuccess;
+ Wxd_object_t *pobj;
+ $? "+ MouseLeftFlip"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject(true);
+ if (NULL != m_pCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_GROUP_BEGIN : {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ /*
+ Gather bounding box information
+ */
+ wxdobj_det_init_bb(&bball);
+ bFirst = true;
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (
+ (NULL != pobj)
+ && (wxdobj_is_marked(pobj, OBJ_MARKER_1))
+ ) {
+ if (wxdobj_control_pt_to_bb(&bbobj, pobj)) {
+ if (bFirst) {
+ DK4_MEMCPY(&bball,&bbobj,sizeof(Wxd_bb_t));
+ bFirst = false;
+ }
+ else {
+ wxdobj_bb_add_bb(&bball, &bbobj);
+ }
+ }
+ }
+ } while (NULL != pobj);
+ /*
+ Run test
+ */
+ bSuccess = true;
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (
+ (NULL != pobj)
+ && (wxdobj_is_marked(pobj, OBJ_MARKER_1))
+ ) {
+ bFirst = wxdobj_flip_object(
+ pobj, &bball, m_bVerticalFlip, false
+ );
+ if (!(bFirst)) { bSuccess = false; }
+ }
+ } while (NULL != pobj);
+ /*
+ Real run
+ */
+ if (bSuccess) {
+ bSuccess = false;
+ dk4sto_it_reset(m_pDrw->i_flat);
+ do {
+ pobj =
+ (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_flat);
+ if (
+ (NULL != pobj)
+ && (wxdobj_is_marked(pobj, OBJ_MARKER_1))
+ ) {
+ wxdobj_flip_object(
+ pobj, &bball, m_bVerticalFlip, true
+ );
+ bSuccess = true;
+ }
+ } while (NULL != pobj);
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ if (bSuccess) {
+ SetModified();
+ }
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ } break;
+ case WXD_OT_TEXT :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_ELLIPSE : {
+ if (wxdobj_control_pt_to_bb(&bbobj, m_pCurrent)) {
+ if (
+ wxdobj_flip_object(
+ m_pCurrent, &bbobj, m_bVerticalFlip, false
+ )
+ ) {
+ wxdobj_flip_object(
+ m_pCurrent, &bbobj, m_bVerticalFlip, true
+ );
+ wxdobj_bb_modified_object(m_pDrw, m_pCurrent);
+ SetModified();
+ }
+ }
+ } break;
+ case WXD_OT_CIRCLE :
+ case WXD_OT_BOX :
+ case WXD_OT_IMAGE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ /* Intentionally empty */
+ } break;
+ }
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ }
+ $? "- MouseLeftFlip"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveGroupOne(void)
+{
+ Wxd_object_t *pOldCurrent;
+ $? "+ MouseMoveGroupOne"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ $? "- MouseMoveGroupOne"
+}
+
+
+
+void
+WxdkdrawFrame::GroupNewForMarkedObjects(void)
+{
+ dk4_er_t er;
+ Wxd_object_t *pobj;
+ Wxd_object_t *pngrp;
+ int res;
+ bool bFoundObject;
+ bool bError;
+
+ pngrp = wxdobj_drw_add_group(m_pDrw, NULL);
+ if (NULL != pngrp) {
+ bError = false;
+ do {
+ bFoundObject = false;
+ dk4sto_it_reset(m_pDrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_stru);
+ if (NULL != pobj) {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_2)) {
+ bFoundObject = true;
+ dk4error_init(&er);
+ res = dk4sto_add((pngrp->det).g.s_e, pobj, &er);
+ if (0 != res) {
+ dk4error_init(&er);
+ res = dk4sto_remove(m_pDrw->s_stru, pobj, &er);
+ if (0 != res) {
+ pobj->pa = pngrp;
+ }
+ else {
+ bError = true;
+ (void)dk4sto_remove(
+ (pngrp->det).g.s_e, pobj, NULL
+ );
+ /* ERROR: Failed to delete */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_MOVE_TO_GROUP
+ );
+ }
+ }
+ else {
+ bError = true;
+ /* ERROR: Failed to insert (memory) */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ }
+ } while ((NULL != pobj) && (!(bFoundObject)) && (!(bError)));
+ } while ((bFoundObject) && (!(bError)));
+ wxdobj_bb_group_structural(m_pDrw, pngrp);
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+}
+
+
+
+void
+WxdkdrawFrame::UngroupObjects(Wxd_object_t *pgrp)
+{
+ Wxd_object_t *pobj; /* Current object */
+ int res; /* Storage operation result */
+ bool bFound; /* Found an object in current pass */
+ bool bError; /* Error occured, stop */
+ $? "+ UngroupObjects"
+ bError = false;
+ do {
+ bFound = false;
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next((pgrp->det).g.i_e);
+ if (NULL != pobj) {
+ bFound = true;
+ res = dk4sto_add(m_pDrw->s_stru, pobj, NULL);
+ if (0 != res) {
+ res = dk4sto_remove((pgrp->det).g.s_e, pobj, NULL);
+ if (0 != res) { $? ". object removed from group"
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ pobj->pa = NULL;
+ }
+ else { $? "! failed to remove object from group"
+ (void)dk4sto_remove(m_pDrw->s_stru, pobj, NULL);
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_UNGROUP_OBJECT
+ );
+ }
+ }
+ else { $? "! failed to move object"
+ /* ERROR: Failed to add */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_UNGROUP_OBJECT
+ );
+ }
+ }
+ } while ((NULL != pobj) && (!(bFound)) && (!(bError)));
+ } while (bFound && (!(bError)));
+ if (!(bError)) { $? ". contents moved successfully"
+ res = dk4sto_remove(m_pDrw->s_stru, pgrp, NULL);
+ if (0 != res) { $? ". group removed successfully"
+ if (NULL != (pgrp->det).g.i_e) {
+ dk4sto_it_close((pgrp->det).g.i_e);
+ (pgrp->det).g.i_e = NULL;
+ }
+ if (NULL != (pgrp->det).g.s_e) {
+ dk4sto_close((pgrp->det).g.s_e);
+ (pgrp->det).g.s_e = NULL;
+ }
+ pgrp->pa = NULL;
+ pgrp->psti = NULL;
+ pgrp->play = NULL;
+ dk4mem_free(pgrp);
+ }
+ else {
+ /* ERROR: Failed to remove */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_UNGROUP_OBJECT
+ );
+ }
+ }
+ $? "- UngroupObjects"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftGroupOne(void)
+{
+ $? "+ MouseLeftGroupOne"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject(true);
+ if (NULL != m_pCurrent) {
+ if (wxdobj_is_marked(m_pCurrent, OBJ_MARKER_2)) {
+ wxdobj_unmark_recursively(m_pCurrent, OBJ_MARKER_2);
+ }
+ else {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_2);
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ else {
+ if (2 <= wxdobj_num_marked_2(m_pDrw)) {
+ GroupNewForMarkedObjects();
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ m_pCurrent = NULL;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ SetModified();
+ }
+ else {
+ /* Intentionally empty, do not group a single element */
+ }
+ }
+ }
+ $? "- MouseLeftGroupOne"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveUngroup(void)
+{
+ Wxd_object_t *pOldCurrent;
+ $? "+ MouseMoveUngroup"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject(true);
+ if (NULL != m_pCurrent) {
+ if (WXD_OT_GROUP_BEGIN != m_pCurrent->ot) {
+ m_pCurrent = NULL;
+ }
+ }
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ $? "- MouseMoveUngroup"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftUngroup(void)
+{
+ Wxd_object_t *pobj;
+ $? "+ MouseLeftUngroup"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ pobj = FindNearestObject(true);
+ if (NULL != pobj) {
+ UngroupObjects(pobj);
+ SetModified();
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ $? "- MouseLeftUngroup"
+}
+
+
+
+
+void
+WxdkdrawFrame::MarkObjectsForRectangleGrouping(void)
+{
+ Wxd_bb_t ibb; /* Bounding box using int values */
+ dk4_bb_t bbdbl; /* Bounding box using double values */
+ Wxd_object_t *pobj; /* Current object to check */
+
+ /* Initialize ibb with mouse coordinates
+ */
+ ibb.xl = m_ptMouseMoveStart.x;
+ ibb.xr = m_ptMousePosGrid.x;
+ ibb.yb = m_ptMouseMoveStart.y;
+ ibb.yt = m_ptMousePosGrid.y;
+ wxdobj_bb_correct(&ibb);
+ /*
+ Unmark all objects
+ */
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ /*
+ Convert mouse coordinates to double coordinates
+ */
+ bbdbl.xmin = (double)(ibb.xl);
+ bbdbl.xmax = (double)(ibb.xr);
+ bbdbl.ymin = (double)(ibb.yb);
+ bbdbl.ymax = (double)(ibb.yt);
+ bbdbl.fl = ((unsigned char)3U);
+ /*
+ Check all objects in structural storage
+ */
+ dk4sto_it_reset(m_pDrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_stru);
+ if (NULL != pobj) {
+ if (0 != dk4bb_contains_bb(&bbdbl, &(pobj->bb), 1)) {
+ wxdobj_mark_recursively(pobj, OBJ_MARKER_2);
+ }
+ }
+ } while (NULL != pobj);
+}
+
+
+void
+WxdkdrawFrame::MouseMoveGroupRect1(void)
+{
+ $? "+ MouseMoveGroupRect1"
+ $? "- MouseMoveGroupRect1"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftGroupRect1(void)
+{
+ $? "+ MouseLeftGroupRect1"
+ if (m_bMousePos) {
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_iState = S_GROUP_RECT_2;
+ SetMouseAndStatusTexts(m_iState);
+ }
+ $? "- MouseLeftGroupRect1"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveGroupRect2(void)
+{
+ $? "+ MouseMoveGroupRect2"
+ if (m_bMousePos) {
+ MarkObjectsForRectangleGrouping();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ $? "- MouseMoveGroupRect2"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftGroupRect2(void)
+{
+ $? "+ MouseLeftGroupRect2"
+ if (m_bMousePos) {
+ MarkObjectsForRectangleGrouping();
+ if (2 <= wxdobj_num_marked_2(m_pDrw)) {
+ GroupNewForMarkedObjects();
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ m_pCurrent = NULL;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ m_iState = S_GROUP_RECT_1;
+ SetMouseAndStatusTexts(m_iState);
+ SetModified();
+ }
+ else {
+ /* Intentionally empty, do not group a single element */
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+
+ }
+ }
+ $? "- MouseLeftGroupRect2"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveDetails(void)
+{
+ Wxd_object_t *pOldCurrent;
+ $? "+ MouseMoveDetails"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject();
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ }
+ if (
+ ((NULL != m_pCurrent) && (NULL == pOldCurrent))
+ || ((NULL == m_pCurrent) && (NULL != pOldCurrent))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ $? "- MouseMoveDetails"
+}
+
+
+
+void
+WxdkdrawFrame::ChangeOneLabelText(
+ wxChar **ptxt,
+ wxTextCtrl *ptc,
+ bool bKeepOld
+)
+{
+ wxString str = ptc->GetValue();
+ {
+ wxCStrData strd = str.c_str();
+ {
+ wxChar const *pstr = (wxChar const *)strd;
+ if (NULL != pstr) {
+ if (0 < dk4strx_len(pstr)) {
+ wxChar *pnstr = dk4strx_dup(pstr, NULL);
+ if (NULL != pnstr) {
+ if (NULL != *ptxt) {
+ dk4mem_free(*ptxt);
+ }
+ *ptxt = pnstr;
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ if (!(bKeepOld)) {
+ if (NULL != *ptxt) {
+ dk4mem_free(*ptxt);
+ *ptxt = NULL;
+ }
+ }
+ }
+ }
+ else {
+ if (!(bKeepOld)) {
+ if (NULL != *ptxt) {
+ dk4mem_free(*ptxt);
+ *ptxt = NULL;
+ }
+ }
+ }
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::RetrieveTextDetails(
+ wxTextCtrl *ptce,
+ wxTextCtrl *ptcs,
+ bool bLaTeX
+)
+{
+ if (bLaTeX) {
+ ChangeOneLabelText(&((m_pCurrent->det).t.t), ptce);
+ ChangeOneLabelText(&((m_pCurrent->det).t.tsc), ptcs, false);
+ }
+ else {
+ ChangeOneLabelText(&((m_pCurrent->det).t.t), ptce);
+ if (NULL != (m_pCurrent->det).t.tsc) {
+ dk4mem_free((m_pCurrent->det).t.tsc);
+ (m_pCurrent->det).t.tsc = NULL;
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsText(void)
+{
+ bool bLaTeX = false;
+ $? "+ ModifyDetailsText"
+ bLaTeX = wxdobj_text_is_latex(m_pCurrent);
+ WxdkdrawDlgTextInput tid(
+ this, sTexts, sNlWx,
+ &((m_pCurrent->det).t.t), &((m_pCurrent->det).t.tsc),
+ bLaTeX, &m_oErrorReport
+ );
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ if (wxID_OK == tid.ShowModal()) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+
+#if 0
+ if (NULL != (m_pCurrent->det).t.t) {
+ /*
+ Export text available
+ */
+ wxString te((m_pCurrent->det).t.t);
+ if (bLaTeX && (NULL != (m_pCurrent->det).t.tsc)) {
+ /* Screen text available and in use
+ */
+ wxString ts((m_pCurrent->det).t.tsc);
+ {
+ WxdkdrawDlgTextInput tid(this, sTexts, sNlWx, bLaTeX);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ wxTextCtrl *ptce = tid.GetExportTextCtrl();
+ wxTextCtrl *ptcs = tid.GetScreenTextCtrl();
+ ptce->SetValue(te);
+ ptcs->SetValue(ts);
+ if (wxID_OK == tid.ShowModal()) {
+ RetrieveTextDetails(ptce, ptcs, bLaTeX);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ }
+ else {
+ /* No screen text
+ */
+ WxdkdrawDlgTextInput tid(this, sTexts, sNlWx, bLaTeX);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ wxTextCtrl *ptce = tid.GetExportTextCtrl();
+ wxTextCtrl *ptcs = tid.GetScreenTextCtrl();
+ ptce->SetValue(te);
+ if (wxID_OK == tid.ShowModal()) {
+ RetrieveTextDetails(ptce, ptcs, bLaTeX);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+ }
+ else {
+ /*
+ No export text (yet)
+ */
+ WxdkdrawDlgTextInput tid(this, sTexts, sNlWx, bLaTeX);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, tid);
+ wxTextCtrl *ptce = tid.GetExportTextCtrl();
+ wxTextCtrl *ptcs = tid.GetScreenTextCtrl();
+ if (wxID_OK == tid.ShowModal()) {
+ RetrieveTextDetails(ptce, ptcs, bLaTeX);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ }
+#endif
+ $? "- ModifyDetailsText"
+}
+
+
+
+/** Find the exponent of powers of 2 contained in a number.
+ @param x Number to inspect.
+ @return Exponent of powers of 2 contained in product on success, 0 on error.
+*/
+static
+uint32_t
+powers_of_two_in_product(uint32_t x)
+{
+ uint32_t back = (uint32_t)0UL;
+ $? "+ powers_of_two_in_product %lu", (unsigned long)x
+ while ((uint32_t)0UL == (x % ((uint32_t)2UL))) {
+ back++;
+ x = x / ((uint32_t)2UL);
+ }
+ $? "- powers_of_two_in_product %lu", (unsigned long)back
+ return back;
+}
+
+
+
+/** Find a suitable scroll step to scroll through a given length.
+ @param snap Grid distance, result should be a product or an
+ 1/x fraction of this.
+ @param lgt Length to scroll through.
+ @param mins Minimum number of scroll steps.
+ @return Positive step width on success, 0 on error.
+*/
+static
+uint32_t
+step_length(uint32_t snap, uint32_t lgt, uint32_t mins)
+{
+ dk4_er_t er;
+ double d_l;
+ double d_s;
+ double d_m;
+ double c;
+ uint32_t back = (uint32_t)0UL;
+ uint32_t maxe;
+ uint32_t expo = (uint32_t)0UL;
+ $? "+ step_length %lu %lu %lu", (unsigned long)snap, (unsigned long)lgt, (unsigned long)mins
+#if 0
+ /* 2020-03-24 Modification
+ Turned to initialization due to complaints by clang static analyzer.
+ */
+ expo = (uint32_t)0UL;
+#endif
+ d_l = (double)lgt;
+ d_s = (double)snap;
+ d_m = (double)mins;
+ back = snap;
+ if (snap > (lgt / mins)) {
+ dk4error_init(&er);
+ maxe = powers_of_two_in_product(snap);
+ $? ". maxe = %lu", (unsigned long)maxe
+ c = ceil(0.0 - ((log(d_l/(d_s*d_m)))/ log(2.0)));
+ if (0.0 < c) {
+ expo = dk4ma_uint32_from_double(c, &er);
+ $? ". expo = %lu", (unsigned long)expo
+ if (DK4_E_NONE == er.ec) {
+ if ((uint32_t)0UL < expo) {
+ if (expo > maxe) { expo = maxe; }
+ while((int32_t)0L < expo--) {
+ back = back / ((uint32_t)2UL);
+ }
+ }
+ }
+ }
+ } $? "- step_length %lu", (unsigned long)back
+ return back;
+}
+
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsBox(void)
+{
+ dk4_er_t er;
+ size_t ui;
+ uint32_t w;
+ uint32_t h;
+ uint32_t s;
+ uint32_t m;
+ $? "+ ModifyDetailsBox"
+ ui = ((0 != cbGridUnit->GetSelection()) ? (501) : (500));
+ dk4error_init(&er);
+ w = (uint32_t)dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ (m_pCurrent->det).b.b.xr, (m_pCurrent->det).b.b.xl, &er
+ ),
+ &er
+ );
+ h = (uint32_t)dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub(
+ (m_pCurrent->det).b.b.yt, (m_pCurrent->det).b.b.yb, &er
+ ),
+ &er
+ ); $? ". w = %lu h = %lu", (unsigned long)w, (unsigned long)h
+ if (DK4_E_NONE == er.ec) {
+ if (h < w) { w = h; } $? ". w = %lu", (unsigned long)w
+ w = w / (uint32_t)2UL; /* Have half of minimum side length */
+ $? ". w = %lu", (unsigned long)w
+ s = step_length(drawco->m_uGridSnap, w, (uint32_t)8UL);
+ $? ". s = %lu", (unsigned long)s
+ if ((uint32_t)0UL < s) { $? ". s ok"
+ m = (w / s);
+ if (w == m * s) { m--; } $? ". m = %lu", (unsigned long)m
+ if (((uint32_t)0UL) < m) { $? ". m ok"
+ WxdkdrawDlgBoxRadius dlg(
+ this, drawco, m_pDrw, m_pCurrent, sTexts, sNlWx,
+ s, m, ui
+ );
+ m_iState = S_DETAILS_2;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ if (wxID_OK == dlg.ShowModal()) {
+ SetModified();
+ }
+ m_iState = S_DETAILS;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ else { $? "! box too small"
+ /* ERROR: Box too small */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_BOX_TOO_SMALL
+ );
+ }
+ }
+ else { $? "! box too small"
+ /* ERROR: Box too small */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_BOX_TOO_SMALL
+ );
+ }
+ }
+ else { $? "! overflow"
+ /* ERROR: Overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ $? "- ModifyDetailsBox"
+}
+
+
+
+void
+WxdkdrawFrame::ChangeImageFile(wxString & pa)
+{
+ wxChar const *vptr;
+ wxChar *nptr;
+ wxCStrData vstrdata = pa.c_str();
+ vptr = (wxChar const *)vstrdata;
+ if (NULL != vptr) {
+ if (0 < dk4strx_len(vptr)) {
+ nptr = dk4strx_dup(vptr, NULL);
+ if (NULL != nptr) {
+ if (NULL != (m_pCurrent->det).i.fn) {
+ dk4mem_free((m_pCurrent->det).i.fn);
+ }
+ (m_pCurrent->det).i.fn = nptr;
+ if (NULL != (m_pCurrent->det).i.bm) {
+ delete((m_pCurrent->det).i.bm);
+ (m_pCurrent->det).i.bm = NULL;
+ }
+ (m_pCurrent->det).i.t = wxBITMAP_TYPE_INVALID;
+ wxdobj_load_image(
+ m_pCurrent,
+ pAppHelp->GetDkEncoding(), pAppHelp->GetWxEncoding()
+ );
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Empty name */
+ dk4error_set_simple_error_code(&m_oErrorReport, WXD_E_NO_FILENAME);
+ }
+ }
+}
+
+
+
+static
+wxChar const *
+final_path_component(wxChar const *fn)
+{
+ wxChar const *back = NULL;
+ wxChar const *rptr = NULL;
+ wxChar const *ptr;
+
+ if (NULL != fn) {
+ ptr = fn;
+ while (wxT('\0') != *ptr) {
+#if DK4_HAVE_BACKSLASH_AS_SEP
+ if (wxT('\\') == *ptr) {
+ rptr = ptr;
+ }
+#else
+ if (wxT('/') == *ptr) {
+ rptr = ptr;
+ }
+#endif
+ ptr++;
+ }
+ if (NULL != rptr) {
+ back = ++rptr;
+ }
+ else {
+ back = fn;
+ }
+ }
+ return back;
+}
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsImage(void)
+{
+ wxString sDialogTitle(sTexts[409]);
+ wxString sFileTypes(image_files_to_open);
+ wxString sCurrentFileName(final_path_component((m_pCurrent->det).i.fn));
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sImageDir, sCurrentFileName,
+ sFileTypes, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sDialogTitle, m_sImageDir, sCurrentFileName,
+ sFileTypes, wxOPEN
+ );
+#endif
+ $? "+ ModifyDetailsImage"
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ m_sImageDir = dlg.GetDirectory();
+ ChangeImageFile(pa);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetModified();
+ }
+ {
+ WxdkdrawDlgImageOptions iodlg(this, m_pCurrent, sTexts);
+ if (wxID_OK == iodlg.ShowModal()) {
+ SetModified();
+ }
+ }
+ m_bUpdate = true;
+ $? "- ModifyDetailsImage"
+}
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsDotFilled(void)
+{
+ $? "+ ModifyDetailsDotFilled"
+ m_iState = S_DETAILS_2;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ {
+ WxdkdrawDlgDotFilled dlg(this, drawco, m_pDrw, m_pCurrent, sTexts);
+ Dk4WxApplicationHelper::ChooseChildPosition(*drawco, dlg);
+ if (wxID_OK == dlg.ShowModal()) {
+ SetModified();
+ }
+ }
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_iState = S_DETAILS;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ $? "- ModifyDetailsDotFilled"
+}
+
+
+
+void
+WxdkdrawFrame::ModifyDetailsDotWhite(void)
+{
+ $? "+ ModifyDetailsDotWhite"
+ ModifyDetailsDotFilled();
+ $? "- ModifyDetailsDotWhite"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftDetails(void)
+{
+ $? "+ MouseLeftDetails"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject();
+ if (NULL != m_pCurrent) {
+ switch ( (int)(m_pCurrent->ot) ) {
+ case WXD_OT_TEXT : {
+ ModifyDetailsText();
+ } break;
+ case WXD_OT_BOX : {
+ ModifyDetailsBox();
+ } break;
+ case WXD_OT_IMAGE : {
+ ModifyDetailsImage();
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ ModifyDetailsDotFilled();
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ ModifyDetailsDotWhite();
+ } break;
+ }
+ m_pCurrent = NULL;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ $? "- MouseLeftDetails"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMiddleDelete(void)
+{
+ $? "+ MouseMiddleDelete"
+ if (m_bMousePos) {
+ DK4_MEMCPY(&m_ptMouseMoveStart,&m_ptMousePosGrid,sizeof(Wxd_point_t));
+ m_iState = S_REGION_DELETE;
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ }
+ $? "- MouseMiddleDelete"
+}
+
+
+
+void
+WxdkdrawFrame::MarkObjectsForRectangleDeletion(void)
+{
+ Wxd_bb_t ibb; /* Bounding box using int values */
+ dk4_bb_t bbdbl; /* Bounding box using double values */
+ Wxd_object_t *pobj; /* Current object to check */
+
+ /* Initialize ibb with mouse coordinates
+ */
+ ibb.xl = m_ptMouseMoveStart.x;
+ ibb.xr = m_ptMousePosGrid.x;
+ ibb.yb = m_ptMouseMoveStart.y;
+ ibb.yt = m_ptMousePosGrid.y;
+ wxdobj_bb_correct(&ibb);
+ /*
+ Unmark all objects
+ */
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ /*
+ Convert mouse coordinates to double coordinates
+ */
+ bbdbl.xmin = (double)(ibb.xl);
+ bbdbl.xmax = (double)(ibb.xr);
+ bbdbl.ymin = (double)(ibb.yb);
+ bbdbl.ymax = (double)(ibb.yt);
+ bbdbl.fl = ((unsigned char)3U);
+ /*
+ Check all objects in structural storage
+ */
+ dk4sto_it_reset(m_pDrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_stru);
+ if (NULL != pobj) {
+ if (0 != dk4bb_contains_bb(&bbdbl, &(pobj->bb), 1)) {
+ wxdobj_mark_recursively(pobj, OBJ_MARKER_1);
+ }
+ }
+ } while (NULL != pobj);
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveRegionDelete(void)
+{
+ $? "+ MouseMoveRegionDelete"
+ if (m_bMousePos) {
+ MarkObjectsForRectangleDeletion();
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ $? "- MouseMoveRegionDelete"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftRegionDelete(void)
+{
+ Wxd_object_t *pobj;
+ bool bModified;
+ bool bFoundChange;
+ $? "+ MouseLeftRegionDelete"
+ if (m_bMousePos) {
+ /*
+ Find objects to delete
+ */
+ MarkObjectsForRectangleDeletion();
+ /*
+ Delete marked elements
+ */
+ bModified = false;
+ do {
+ bFoundChange = false;
+ dk4sto_it_reset(m_pDrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(m_pDrw->i_stru);
+ if (NULL != pobj) {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_1)) {
+ bModified = true;
+ bFoundChange = true;
+ wxdobj_obj_delete_from_drawing(m_pDrw, pobj);
+ }
+ }
+ } while ((NULL != pobj) && (!(bFoundChange)));
+ } while (bFoundChange);
+ /*
+ Go back to S_DELETE state
+ */
+ wxdobj_drw_require_redraw(
+ m_pDrw,
+ ((bModified) ? (WXD_REFRESH_DRAWING) : (WXD_REFRESH_MARKUP))
+ );
+ m_iState = S_DELETE;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_2);
+ m_pCurrent = NULL;
+ SetMouseAndStatusTexts(m_iState);
+ if (bModified) { SetModified(); }
+ }
+ $? "- MouseLeftRegionDelete"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveConvert(void)
+{
+ Wxd_object_t *pOldCurrent;
+ $? "+ MouseMoveConvert"
+ if (m_bMousePos) {
+ pOldCurrent = m_pCurrent;
+ m_pCurrent = FindNearestObject();
+ if (m_pCurrent != pOldCurrent) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ $? "- MouseMoveConvert"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertSplineToPoly(Wxd_object_t *pobj)
+{
+ Wxd_det_t nd; /* New details */
+ $? "+ ConvertSplineToPoly"
+ if ((uint16_t)0U < (pobj->det).s.n) {
+ if (NULL != (pobj->det).s.p) {
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ nd.p.n = (pobj->det).s.n;
+ nd.p.p = dk4mem_new(Wxd_point_t,(size_t)(nd.p.n),NULL);
+ if (NULL != nd.p.p) {
+ for (uint16_t i = 0; i < nd.p.n; i++) {
+ (nd.p.p)[i].x = ((pobj->det).s.p)[i].x;
+ (nd.p.p)[i].y = ((pobj->det).s.p)[i].y;
+ }
+ dk4mem_free((pobj->det).s.p);
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ }
+ $? "- ConvertSplineToPoly"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertArcToPoly(Wxd_object_t *pobj)
+{
+ dk4_er_t er;
+ Wxd_det_t nd; /* New details */
+ $? "+ ConvertArcToPoly"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+
+ if (
+ (WXD_OT_POLYGON == m_iObjToCreate)
+ && (WXD_OT_C_ARC == pobj->ot)
+ && (0 != (pobj->det).a.d)
+ ) {
+
+ nd.p.n = 4U;
+ nd.p.p = dk4mem_new(Wxd_point_t,(size_t)4,NULL);
+ if (NULL != nd.p.p) {
+ dk4error_init(&er);
+ (nd.p.p)[0].x = (pobj->det).a.x1;
+ (nd.p.p)[0].y = (pobj->det).a.y1;
+ (nd.p.p)[1].x = (pobj->det).a.x2;
+ (nd.p.p)[1].y = (pobj->det).a.y2;
+ (nd.p.p)[2].x = (pobj->det).a.x3;
+ (nd.p.p)[2].y = (pobj->det).a.y3;
+ (nd.p.p)[3].x = dk4ma_int32_from_double((pobj->det).a.x, &er);
+ (nd.p.p)[3].y = dk4ma_int32_from_double((pobj->det).a.y, &er);
+ if (DK4_E_NONE == er.ec) {
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ dk4mem_free(nd.p.p);
+ /* ERROR: Numeric overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ nd.p.n = 3U;
+ nd.p.p = dk4mem_new(Wxd_point_t,(size_t)3,NULL);
+ if (NULL != nd.p.p) {
+ (nd.p.p)[0].x = (pobj->det).a.x1;
+ (nd.p.p)[0].y = (pobj->det).a.y1;
+ (nd.p.p)[1].x = (pobj->det).a.x2;
+ (nd.p.p)[1].y = (pobj->det).a.y2;
+ (nd.p.p)[2].x = (pobj->det).a.x3;
+ (nd.p.p)[2].y = (pobj->det).a.y3;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ $? "- ConvertArcToPoly"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertBoxToPoly(Wxd_object_t *pobj)
+{
+
+ Wxd_det_t nd; /* New details */
+ $? "+ ConvertBoxToPoly"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ nd.p.n = 4;
+ nd.p.p = dk4mem_new(Wxd_point_t,(size_t)4,NULL);
+ if (NULL != nd.p.p) {
+ (nd.p.p)[0].x = (pobj->det).b.b.xl;
+ (nd.p.p)[0].y = (pobj->det).b.b.yb;
+ (nd.p.p)[1].x = (pobj->det).b.b.xr;
+ (nd.p.p)[1].y = (pobj->det).b.b.yb;
+ (nd.p.p)[2].x = (pobj->det).b.b.xr;
+ (nd.p.p)[2].y = (pobj->det).b.b.yt;
+ (nd.p.p)[2].x = (pobj->det).b.b.xl;
+ (nd.p.p)[2].y = (pobj->det).b.b.yt;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ $? "- ConvertBoxToPoly"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertPolyToSpline(Wxd_object_t *pobj)
+{
+ Wxd_det_t nd; /* New details */
+ double s; /* Spline value */
+ $? "+ ConvertPolyToSpline"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ if (((uint16_t)0U < (pobj->det).p.n) && (NULL != (pobj->det).p.p)) {
+ nd.s.n = (pobj->det).p.n;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)(nd.s.n),NULL);
+ if (NULL != nd.s.p) {
+ s = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ for (uint16_t i = (uint16_t)0U; i < nd.s.n; i++) {
+ (nd.s.p)[i].x = ((pobj->det).p.p)[i].x;
+ (nd.s.p)[i].y = ((pobj->det).p.p)[i].y;
+ (nd.s.p)[i].s = s;
+ }
+ if (WXD_OT_O_SPLINE == m_iObjToCreate) {
+ (nd.s.p)[0].s = 0.0;
+ (nd.s.p)[(size_t)(nd.s.n - (uint16_t)1U)].s = 0.0;
+ }
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ /* ERROR: Bad original object */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_CANNOT_CONVERT
+ );
+ }
+ $? "- ConvertPolyToSpline"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertSplineToSpline(Wxd_object_t *pobj)
+{
+ double s; /* Spline value */
+ $? "+ ConvertSplineToSpline"
+ if (((uint16_t)0U < (pobj->det).s.n) && (NULL != (pobj->det).s.p)) {
+ s = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ for (uint16_t i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ ((pobj->det).s.p)[i].s = s;
+ }
+ if (WXD_OT_O_SPLINE == m_iObjToCreate) {
+ ((pobj->det).s.p)[0].s = 0.0;
+ ((pobj->det).s.p)[(size_t)((pobj->det).s.n - (uint16_t)1U)].s = 0.0;
+ }
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Bad original object */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_CANNOT_CONVERT
+ );
+ }
+ $? "- ConvertSplineToSpline"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertArcToSpline(Wxd_object_t *pobj)
+{
+ dk4_er_t er; /* For double to int32_t conversion */
+ Wxd_det_t nd; /* New details */
+ double s; /* Spline value */
+ $? "+ ConvertArcToSpline"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ s = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ if (
+ (WXD_OT_C_SPLINE == m_iObjToCreate)
+ && (WXD_OT_C_ARC == pobj->ot)
+ && ((int8_t)0 != (pobj->det).a.d)
+ ) {
+ nd.s.n = 4U;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)4,NULL);
+ if (NULL != nd.s.p) {
+ dk4error_init(&er);
+ (nd.s.p)[0].x = (pobj->det).a.x1;
+ (nd.s.p)[0].y = (pobj->det).a.y1;
+ (nd.s.p)[0].s = 0.0;
+ (nd.s.p)[1].x = (pobj->det).a.x2;
+ (nd.s.p)[1].y = (pobj->det).a.y2;
+ (nd.s.p)[1].s = s;
+ (nd.s.p)[2].x = (pobj->det).a.x3;
+ (nd.s.p)[2].y = (pobj->det).a.y3;
+ (nd.s.p)[2].s = 0.0;
+ (nd.s.p)[3].x = dk4ma_int32_from_double((pobj->det).a.x, &er);
+ (nd.s.p)[3].y = dk4ma_int32_from_double((pobj->det).a.y, &er);
+ (nd.s.p)[3].s = 0.0;
+ if (DK4_E_NONE == er.ec) {
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ dk4mem_free(nd.s.p);
+ /* ERROR: Numeric overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ nd.s.n = 3U;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)3,NULL);
+ if (NULL != nd.s.p) {
+ (nd.s.p)[0].x = (pobj->det).a.x1;
+ (nd.s.p)[0].y = (pobj->det).a.y1;
+ (nd.s.p)[0].s = 0.0;
+ (nd.s.p)[1].x = (pobj->det).a.x2;
+ (nd.s.p)[1].y = (pobj->det).a.y2;
+ (nd.s.p)[1].s = s;
+ (nd.s.p)[2].x = (pobj->det).a.x3;
+ (nd.s.p)[2].y = (pobj->det).a.y3;
+ (nd.s.p)[2].s = 0.0;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ $? "- ConvertArcToSpline"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertBoxToSpline(Wxd_object_t *pobj)
+{
+ dk4_er_t er; /* For double to int32_t conversion */
+ Wxd_det_t nd; /* New details */
+ double s; /* Spline value */
+ int32_t r;
+ int32_t w;
+ int32_t h;
+ $? "+ ConvertBoxToSpline"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ s = ((m_bSplineInterpolated) ? (-1.0) : (1.0));
+ dk4error_init(&er);
+ if (
+ (WXD_OT_C_SPLINE == m_iObjToCreate)
+ && (!(m_bSplineInterpolated))
+ && ((uint32_t)0UL < (pobj->det).b.r)
+ ) {
+ w = dk4ma_int32_t_sub((pobj->det).b.b.xr, (pobj->det).b.b.xl, &er);
+ w = dk4ma_int32_t_abs(w, &er);
+ h = dk4ma_int32_t_sub((pobj->det).b.b.yt, (pobj->det).b.b.yb, &er);
+ h = dk4ma_int32_t_abs(h, &er);
+ if (w > h) w = h;
+ r = w / (int32_t)2L;
+ if ((uint32_t)r > (pobj->det).b.r) {
+ r = (int32_t)((pobj->det).b.r);
+ }
+ }
+ if (
+ (WXD_OT_C_SPLINE == m_iObjToCreate)
+ && (!(m_bSplineInterpolated))
+ && ((uint32_t)0UL < (pobj->det).b.r)
+ && (DK4_E_NONE == er.ec)
+ ) {
+ nd.s.n = 12;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)12,NULL);
+ if (NULL != nd.s.p) {
+ (nd.s.p)[0].x = (pobj->det).b.b.xl + r;
+ (nd.s.p)[0].y = (pobj->det).b.b.yb;
+ (nd.s.p)[0].s = 0.0;
+ (nd.s.p)[1].x = (pobj->det).b.b.xr - r;
+ (nd.s.p)[1].y = (pobj->det).b.b.yb;
+ (nd.s.p)[1].s = 0.0;
+ (nd.s.p)[2].x = (pobj->det).b.b.xr;
+ (nd.s.p)[2].y = (pobj->det).b.b.yb;
+ (nd.s.p)[2].s = 1.0;
+ (nd.s.p)[3].x = (pobj->det).b.b.xr;
+ (nd.s.p)[3].y = (pobj->det).b.b.yb + r;
+ (nd.s.p)[3].s = 0.0;
+ (nd.s.p)[4].x = (pobj->det).b.b.xr;
+ (nd.s.p)[4].y = (pobj->det).b.b.yt - r;
+ (nd.s.p)[4].s = 0.0;
+ (nd.s.p)[5].x = (pobj->det).b.b.xr;
+ (nd.s.p)[5].y = (pobj->det).b.b.yt;
+ (nd.s.p)[5].s = 1.0;
+ (nd.s.p)[6].x = (pobj->det).b.b.xr - r;
+ (nd.s.p)[6].y = (pobj->det).b.b.yt;
+ (nd.s.p)[6].s = 0.0;
+ (nd.s.p)[7].x = (pobj->det).b.b.xl + r;
+ (nd.s.p)[7].y = (pobj->det).b.b.yt;
+ (nd.s.p)[7].s = 0.0;
+ (nd.s.p)[8].x = (pobj->det).b.b.xl;
+ (nd.s.p)[8].y = (pobj->det).b.b.yt;
+ (nd.s.p)[8].s = 1.0;
+ (nd.s.p)[9].x = (pobj->det).b.b.xl;
+ (nd.s.p)[9].y = (pobj->det).b.b.yt - r;
+ (nd.s.p)[9].s = 0.0;
+ (nd.s.p)[10].x = (pobj->det).b.b.xl;
+ (nd.s.p)[10].y = (pobj->det).b.b.yb + r;
+ (nd.s.p)[10].s = 0.0;
+ (nd.s.p)[11].x = (pobj->det).b.b.xl;
+ (nd.s.p)[11].y = (pobj->det).b.b.yb;
+ (nd.s.p)[11].s = 1.0;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ else {
+ nd.s.n = 4;
+ nd.s.p = dk4mem_new(Wxd_spline_point_t,(size_t)4,NULL);
+ if (NULL != nd.s.p) {
+ (nd.s.p)[0].x = (pobj->det).b.b.xl;
+ (nd.s.p)[0].y = (pobj->det).b.b.yb;
+ (nd.s.p)[0].s = s;
+ (nd.s.p)[1].x = (pobj->det).b.b.xr;
+ (nd.s.p)[1].y = (pobj->det).b.b.yb;
+ (nd.s.p)[1].s = s;
+ (nd.s.p)[2].x = (pobj->det).b.b.xr;
+ (nd.s.p)[2].y = (pobj->det).b.b.yt;
+ (nd.s.p)[2].s = s;
+ (nd.s.p)[3].x = (pobj->det).b.b.xl;
+ (nd.s.p)[3].y = (pobj->det).b.b.yt;
+ (nd.s.p)[3].s = s;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ if (WXD_OT_C_SPLINE != pobj->ot) {
+ ((pobj->det).s.p)[0].s = 0.0;
+ ((pobj->det).s.p)[(size_t)((pobj->det).s.n-(uint16_t)1U)].s=0.0;
+ }
+ SetModified();
+ }
+ else {
+ /* ERROR: Memory */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ }
+ }
+ $? "- ConvertBoxToSpline"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertPolyToArc(Wxd_object_t *pobj)
+{
+ Wxd_det_t nd;
+ $? "+ ConvertPolyToArc"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ if (((uint16_t)2U < (pobj->det).p.n) && (NULL != (pobj->det).p.p)) {
+ nd.a.x1 = ((pobj->det).p.p)[0].x;
+ nd.a.y1 = ((pobj->det).p.p)[0].y;
+ nd.a.x2 = ((pobj->det).p.p)[1].x;
+ nd.a.y2 = ((pobj->det).p.p)[1].y;
+ nd.a.x3 = ((pobj->det).p.p)[2].x;
+ nd.a.y3 = ((pobj->det).p.p)[2].y;
+ wxdarc_calculation(
+ &(nd.a.x), &(nd.a.y), &(nd.a.r), &(nd.a.a), &(nd.a.b), &(nd.a.d),
+ nd.a.x1, nd.a.y1, nd.a.x2, nd.a.y2, nd.a.x3, nd.a.y3
+ );
+ dk4mem_free((pobj->det).p.p);
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Bad original object */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_CANNOT_CONVERT
+ );
+ }
+ $? "- ConvertPolyToArc"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertSplineToArc(Wxd_object_t *pobj)
+{
+ Wxd_det_t nd;
+ $? "+ ConvertSplineToArc"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ if (((uint16_t)2U < (pobj->det).s.n) && (NULL != (pobj->det).s.p)) {
+ nd.a.x1 = ((pobj->det).s.p)[0].x;
+ nd.a.y1 = ((pobj->det).s.p)[0].y;
+ nd.a.x2 = ((pobj->det).s.p)[1].x;
+ nd.a.y2 = ((pobj->det).s.p)[1].y;
+ nd.a.x3 = ((pobj->det).s.p)[2].x;
+ nd.a.y3 = ((pobj->det).s.p)[2].y;
+ wxdarc_calculation(
+ &(nd.a.x), &(nd.a.y), &(nd.a.r), &(nd.a.a), &(nd.a.b), &(nd.a.d),
+ nd.a.x1, nd.a.y1, nd.a.x2, nd.a.y2, nd.a.x3, nd.a.y3
+ );
+ dk4mem_free((pobj->det).s.p);
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Bad original object */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_CANNOT_CONVERT
+ );
+ }
+ $? "- ConvertSplineToArc"
+}
+
+
+
+void
+WxdkdrawFrame::ConvertCircleToDot(Wxd_object_t *pobj)
+{
+ dk4_er_t er;
+ Wxd_det_t nd;
+ uint16_t d; /* New diameter */
+ $? "+ ConvertCircleToDot"
+ DK4_MEMRES(&nd,sizeof(Wxd_det_t));
+ dk4error_init(&er);
+ d = dk4ma_uint16_from(
+ (dk4_um_t)dk4ma_uint32_t_div(
+ dk4ma_uint32_t_mul((pobj->det).e.rx, (uint32_t)2UL, &er),
+ m_pDrw->baselw, &er
+ ),
+ &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ nd.d.x = (pobj->det).e.x;
+ nd.d.y = (pobj->det).e.y;
+ nd.d.d = d;
+ DK4_MEMCPY(&(pobj->det),&nd,sizeof(Wxd_det_t));
+ pobj->ot = m_iObjToCreate;
+ SetModified();
+ }
+ else {
+ /* ERROR: Numeric overflow */
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+ }
+ $? "- ConvertCircleToDot"
+}
+
+
+
+void
+WxdkdrawFrame::ObjectTypeConversion(Wxd_object_t *pobj)
+{
+ if (NULL != pobj) {
+ if (wxdobj_can_convert(m_iObjToCreate, pobj)) {
+ switch ( (int)m_iObjToCreate ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ pobj->ot = m_iObjToCreate;
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ ConvertSplineToPoly(pobj);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ ConvertArcToPoly(pobj);
+ } break;
+ case WXD_OT_BOX : {
+ ConvertBoxToPoly(pobj);
+ } break;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ ConvertPolyToSpline(pobj);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ ConvertSplineToSpline(pobj);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ ConvertArcToSpline(pobj);
+ } break;
+ case WXD_OT_BOX : {
+ ConvertBoxToSpline(pobj);
+ } break;
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_C_ARC : case WXD_OT_O_ARC : {
+ pobj->ot = m_iObjToCreate;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ ConvertPolyToArc(pobj);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ ConvertSplineToArc(pobj);
+ } break;
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ pobj->ot = m_iObjToCreate;
+ } break;
+ case WXD_OT_CIRCLE : {
+ ConvertCircleToDot(pobj);
+ } break;
+ }
+ } break;
+ }
+ wxdobj_bb_simple_object(m_pDrw, pobj);
+ }
+ }
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftConvert(void)
+{
+ $? "+ MouseLeftConvert"
+ if (m_bMousePos) {
+ m_pCurrent = FindNearestObject();
+ if (NULL != m_pCurrent) {
+ ObjectTypeConversion(m_pCurrent);
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = NULL;
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ $? "- MouseLeftConvert"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveRotate(void)
+{
+ Wxd_point_t center;
+ Wxd_object_t *prevobj;
+ $? "+ MouseMoveRotate"
+ if (m_bMousePos) {
+ prevobj = m_pCurrent;
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_rotate_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ if (wxdobj_get_control_point(&center, m_pCurrent, m_uCurrent)) {
+ while (NULL != m_pCurrent->pa) { m_pCurrent = m_pCurrent->pa; }
+ if (
+ wxdobj_rotate_object(
+ m_pCurrent, center.x, center.y,
+ m_bSplineInterpolated, false
+ )
+
+ ) {
+ wxdobj_mark_recursively(m_pCurrent, OBJ_MARKER_1);
+ } else { $? "! rotation test failed"
+ m_pCurrent = NULL;
+ }
+ }
+ else { $? "! failed to retrieve control point"
+ m_pCurrent = NULL;
+ }
+ }
+ else { $? "! no current object"
+ }
+ if (
+ ((NULL != m_pCurrent) && (NULL == prevobj))
+ || ((NULL == m_pCurrent) && (NULL != prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ $? "- MouseMoveRotate"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftRotate(void)
+{
+ Wxd_point_t center;
+ $? "+ MouseLeftRotate"
+ if (m_bMousePos) {
+ wxdobj_unmark_all(m_pDrw, OBJ_MARKER_1);
+ m_pCurrent = wxdobj_rotate_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ if (wxdobj_get_control_point(&center, m_pCurrent, m_uCurrent)) {
+ while (NULL != m_pCurrent->pa) { m_pCurrent = m_pCurrent->pa; }
+ if (
+ wxdobj_rotate_object(
+ m_pCurrent, center.x, center.y,
+ m_bSplineInterpolated, false
+ )
+ ) {
+ wxdobj_rotate_object(
+ m_pCurrent, center.x, center.y,
+ m_bSplineInterpolated, true
+ );
+ SetModified();
+ }
+ else {
+ m_pCurrent = NULL;
+ }
+ }
+ else {
+ m_pCurrent = NULL;
+ }
+ }
+ SetMouseAndStatusTexts(m_iState);
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_DRAWING);
+ }
+ $? "- MouseLeftRotate"
+}
+
+
+
+void
+WxdkdrawFrame::MouseMoveModspline(void)
+{
+ Wxd_object_t *prevobj;
+ uint16_t prevpoint;
+ $? "+ MouseMoveModspline"
+ if (m_bMousePos) {
+ /*
+ Save previous candidate object and point
+ */
+ prevobj = m_pCurrent;
+ prevpoint = m_uCurrent;
+ /*
+ Check for new candicate
+ */
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_modify_spline_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark |= OBJ_MARKER_1;
+ $!trace-code wxdobj_report_object(m_pCurrent);
+ }
+ /*
+ On object or point change redraw the markup
+ */
+ if (
+ ((NULL != m_pCurrent) && (NULL == prevobj))
+ || ((NULL == m_pCurrent) && (NULL != prevobj))
+ ) {
+ SetMouseAndStatusTexts(m_iState);
+ }
+ if ((prevobj != m_pCurrent) || (prevpoint != m_uCurrent)) {
+ wxdobj_drw_require_redraw(m_pDrw, WXD_REFRESH_MARKUP);
+ }
+ }
+ $? "- MouseMoveModspline"
+}
+
+
+
+void
+WxdkdrawFrame::MouseLeftModspline(void)
+{
+ $? "+ MouseLeftModspline"
+ if (m_bMousePos) {
+ if (NULL != m_pCurrent) {
+ m_pCurrent->mark &= (~(OBJ_MARKER_1));
+ }
+ m_pCurrent = wxdobj_modify_spline_find_object(
+ m_pDrw, &m_ptMousePosRaw, &m_uCurrent,
+ (2.0 * (double)(drawco->m_uGridSnap))
+ );
+ if (NULL != m_pCurrent) {
+ ModifySplineValue(m_pCurrent, m_uCurrent);
+ m_pCurrent = NULL;
+ m_uCurrent = (uint16_t)0U;
+ SetMouseAndStatusTexts(m_iState);
+ }
+ }
+ $? "- MouseLeftModspline"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/DkWxImgszApp.h b/support/dktools/WxdkdrawMouseMove.cpp
index f1e6d14b9b..4b1791759e 100644
--- a/support/dktools/DkWxImgszApp.h
+++ b/support/dktools/WxdkdrawMouseMove.cpp
@@ -2,11 +2,11 @@
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
- Original source: DkWxImgszApp.cpt
+ Original source: WxdkdrawMouseMove.cpt
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
+Copyright (C) 2019-2019, Dirk Krause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -33,52 +33,40 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/** @file DkWxImgszApp.h Header file for the DkWxImgszApp module.
+/** @file WxdkdrawMouseMove.cpp The WxdkdrawMouseMove module.
*/
-#ifndef DKWXIMGSZAPP_H_INCLUDED
-/** Avoid multiple inclusions. */
-#define DKWXIMGSZAPP_H_INCLUDED 1
+#line 10 "WxdkdrawMouseMove.cpt"
-#line 8 "DkWxImgszApp.cpt"
+#include "wxdkdraw.h"
+#ifndef WXDKDRAWAPPH_INCLUDED
+#include "WxdkdrawApp.h"
+#endif
+#ifndef WXDKDRAWFRAME_H_INCLUDED
+#include "WxdkdrawFrame.h"
+#endif
-/** Application class for the wximgsz program.
-*/
-class DkWxImgszApp : public wxApp
-{
- protected:
- /** Application helper.
- */
- DkWxAppHelper *pHelper;
- /** Controller for online-help.
- */
- DkWxHelpController *pHelpController;
- protected:
- /** Show error message if there is not sufficient memory available.
- */
- void
- ShowMemoryErrorMessage(void);
+#line 23 "WxdkdrawMouseMove.cpt"
- public:
- /** Initialize application.
- @return True on success (can run), false on error (abort).
- */
- virtual bool OnInit();
- /** Clean up after running.
- @return Exit status code.
- */
- virtual int OnExit();
-};
+void
+WxdkdrawFrame::MouseMoveNoop(void)
+{
+ Wxd_object_t *pobj;
+ /* TODO: IMPLEMENTATAION */
+ if (NULL == m_pStyle) {
+ pobj = FindNearestObject();
+ }
+}
-DECLARE_APP(DkWxImgszApp)
-#endif
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawObj.cpp b/support/dktools/WxdkdrawObj.cpp
new file mode 100644
index 0000000000..d4d3bb0108
--- /dev/null
+++ b/support/dktools/WxdkdrawObj.cpp
@@ -0,0 +1,8226 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawObj.cpt
+*/
+
+/** @file WxdkdrawObj.cpp The WxdkdrawObj module.
+*/
+
+
+#line 1258 "WxdkdrawObj.cpt"
+
+#include "wxdkdraw.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include <dk4math.h>
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include <dk4bif.h>
+#endif
+
+
+#ifndef DK4MAAU16_H_INCLUDED
+#include "dk4maau16.h"
+#endif
+
+#ifndef DK4MAAI16_H_INCLUDED
+#include "dk4maai16.h"
+#endif
+
+#ifndef DK4MAAI32_H_INCLUDED
+#include "dk4maai32.h"
+#endif
+
+
+
+#line 1290 "WxdkdrawObj.cpt"
+
+
+
+/** Image types handled by wxdkdraw.
+*/
+static const Wxd_suffix_and_type_t image_type_suffixes[] = {
+ { wxT(".png") , wxBITMAP_TYPE_PNG } ,
+ { wxT(".jpg") , wxBITMAP_TYPE_JPEG } ,
+ { wxT(".jpeg") , wxBITMAP_TYPE_JPEG } ,
+ { wxT(".pbm") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".pgm") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".ppm") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".pnm") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".pam") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".tif") , wxBITMAP_TYPE_TIF } ,
+ { wxT(".tiff") , wxBITMAP_TYPE_TIFF } ,
+ { NULL , wxBITMAP_TYPE_INVALID }
+};
+
+
+
+/** Angles to check when calculating arc bounding box.
+*/
+static double arc_angles[] = {
+ (-4.0 * M_PI),
+ (-3.0 * M_PI - M_PI_2),
+ (-3.0 * M_PI),
+ (-2.0 * M_PI - M_PI_2),
+ (-2.0 * M_PI),
+ (-1.0 * M_PI - M_PI_2),
+ (-1.0 * M_PI),
+ (-1.0 * M_PI_2),
+ 0.0,
+ M_PI_2,
+ M_PI,
+ (M_PI + M_PI_2),
+ (2.0 * M_PI),
+ (2.0 * M_PI + M_PI_2),
+ (3.0 * M_PI),
+ (3.0 * M_PI + M_PI_2)
+};
+
+
+
+/** Number of elements in arc_angles array.
+*/
+static const size_t sz_arc_angles = sizeof(arc_angles)/sizeof(double);
+
+
+
+/** Flip coordinate value.
+ @param min Bounding box minimum.
+ @param max Bounding box maximum.
+ @param v Value to flip.
+ @param erp Error report, may be NULL.
+ @return Flip result.
+*/
+static
+int32_t
+wxdobj_flip_coordinate(int32_t min, int32_t max, int32_t v, dk4_er_t *erp)
+{
+ dk4_er_t er;
+ int32_t back = (int32_t)0L;
+
+ dk4error_init(&er);
+ back = dk4ma_int32_t_sub(dk4ma_int32_t_add(min, max, &er), v, &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_init(&er);
+ back = dk4ma_int32_t_add(min, dk4ma_int32_t_sub(max, v, &er), &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_init(&er);
+ back = dk4ma_int32_t_add(max, dk4ma_int32_t_sub(min, v, &er), &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_init(&er);
+ back = dk4ma_int32_from_double(
+ ((double)min + (double)max - (double)v), &er
+ );
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+/** Set bounding box x and y value.
+ Use this function to add the first point.
+ @param pbox Bounding box to set.
+ @param x X coordinate.
+ @param y Y coordinate.
+*/
+static
+void
+wxdobj_bb_set_point(
+ Wxd_bb_t *pbox,
+ int32_t x,
+ int32_t y
+)
+{
+ if (NULL != pbox) {
+ pbox->xl = pbox->xr = x;
+ pbox->yb = pbox->yt = y;
+ }
+}
+
+
+
+/** Add bounding box x and y value.
+ Use this function to add further points.
+ @param pbox Bounding box to set.
+ @param x X coordinate.
+ @param y Y coordinate.
+*/
+static
+void
+wxdobj_bb_add_point(
+ Wxd_bb_t *pbox,
+ int32_t x,
+ int32_t y
+)
+{
+ if (NULL != pbox) {
+ if (x < pbox->xl) { pbox->xl = x; }
+ if (x > pbox->xr) { pbox->xr = x; }
+ if (y < pbox->yb) { pbox->yb = y; }
+ if (y > pbox->yt) { pbox->yt = y; }
+ }
+}
+
+
+
+bool
+wxdobj_bb_add_bb(
+ Wxd_bb_t *pbox,
+ Wxd_bb_t const *psrc
+)
+{
+ bool back = false;
+ if ((NULL != pbox) && (NULL != psrc)) {
+ wxdobj_bb_add_point(pbox, psrc->xl, psrc->yb);
+ wxdobj_bb_add_point(pbox, psrc->xr, psrc->yt);
+ back = true;
+ }
+ return back;
+}
+
+
+
+void
+wxdobj_report_object(
+#if TRACE_DEBUG
+ Wxd_object_t *pobj
+#else
+ Wxd_object_t * DK4_ARG_UNUSED(pobj)
+#endif
+)
+{
+#if TRACE_DEBUG
+ double s;
+ uint16_t i;
+ int32_t x;
+ int32_t y;
+
+
+#line 1456 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ switch (pobj->ot) {
+ case WXD_OT_GROUP_BEGIN : {
+
+
+#line 1460 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_TEXT : {
+
+
+#line 1463 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if (WXD_OT_POLYLINE == pobj->ot) {
+
+
+#line 1467 "WxdkdrawObj.cpt"
+ }
+ else {
+
+
+#line 1470 "WxdkdrawObj.cpt"
+ }
+
+
+#line 1472 "WxdkdrawObj.cpt"
+ if (NULL != (pobj->det).p.p) {
+ for (i = 0; i < (pobj->det).p.n; i++) {
+ x = ((pobj->det).p.p)[i].x;
+ y = ((pobj->det).p.p)[i].y;
+
+
+#line 1477 "WxdkdrawObj.cpt"
+ }
+ }
+ else {
+
+
+#line 1481 "WxdkdrawObj.cpt"
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if (WXD_OT_O_SPLINE == pobj->ot) {
+
+
+#line 1486 "WxdkdrawObj.cpt"
+ }
+ else {
+
+
+#line 1489 "WxdkdrawObj.cpt"
+ }
+
+
+#line 1491 "WxdkdrawObj.cpt"
+ if (NULL != (pobj->det).p.p) {
+ for (i = 0; i < (pobj->det).s.n; i++) {
+ x = ((pobj->det).s.p)[i].x;
+ y = ((pobj->det).s.p)[i].y;
+ s = ((pobj->det).s.p)[i].s;
+
+
+#line 1497 "WxdkdrawObj.cpt"
+ }
+ }
+ else {
+
+
+#line 1501 "WxdkdrawObj.cpt"
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (WXD_OT_O_ARC == pobj->ot) {
+
+
+#line 1506 "WxdkdrawObj.cpt"
+ }
+ else {
+
+
+#line 1509 "WxdkdrawObj.cpt"
+ }
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ if (WXD_OT_CIRCLE == pobj->ot) {
+
+
+#line 1514 "WxdkdrawObj.cpt"
+ }
+ else {
+
+
+#line 1517 "WxdkdrawObj.cpt"
+ }
+
+
+#line 1519 "WxdkdrawObj.cpt"
+
+
+#line 1520 "WxdkdrawObj.cpt"
+
+
+#line 1521 "WxdkdrawObj.cpt"
+
+
+#line 1522 "WxdkdrawObj.cpt"
+
+
+#line 1523 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_BOX : {
+
+
+#line 1526 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_IMAGE : {
+
+
+#line 1529 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ if (WXD_OT_DOT_FILLED == pobj->ot) {
+
+
+#line 1533 "WxdkdrawObj.cpt"
+ }
+ else {
+
+
+#line 1536 "WxdkdrawObj.cpt"
+ }
+ } break;
+ default : {
+ } break;
+ }
+ }
+ else {
+
+#line 1543 "WxdkdrawObj.cpt"
+ }
+
+
+#line 1545 "WxdkdrawObj.cpt"
+#else
+ DK4_UNUSED_ARG(pobj)
+#endif
+}
+
+
+
+bool
+wxdobj_is_active(Wxd_object_t *pobj)
+{
+ bool back = false;
+
+
+#line 1557 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ back = true;
+ if (NULL != pobj->play) {
+ if ((uint8_t)0x00 == pobj->play->active) {
+ back = false;
+ }
+ }
+ }
+
+
+#line 1566 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+wxBitmapType
+wxdobj_image_type(wxChar const *fn)
+{
+ wxChar const *suffix;
+ Wxd_suffix_and_type_t const *tptr;
+ wxBitmapType back = wxBITMAP_TYPE_INVALID;
+
+
+#line 1578 "WxdkdrawObj.cpt"
+ suffix = dk4strx_get_path_suffix(fn, NULL);
+ if (NULL != suffix) {
+ tptr = image_type_suffixes;
+ while ((NULL != tptr->suffix) && (wxBITMAP_TYPE_INVALID == back)) {
+ if (0 == dk4strx_casecmp(tptr->suffix, suffix)) {
+ back = tptr->t;
+ }
+ else {
+ tptr++;
+ }
+ }
+ }
+
+#line 1590 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+void
+wxdobj_det_init_bb(Wxd_bb_t *pdst)
+{
+
+
+#line 1599 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_bb_t));
+ pdst->xl = (int32_t)0L;
+ pdst->xr = (int32_t)0L;
+ pdst->yb = (int32_t)0L;
+ pdst->yt = (int32_t)0L;
+ }
+
+#line 1606 "WxdkdrawObj.cpt"
+}
+
+
+void
+wxdobj_det_init_text(Wxd_det_text_t *pdst)
+{
+
+
+#line 1613 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_text_t));
+ pdst->t = NULL;
+ pdst->tsc = NULL;
+ pdst->font = NULL;
+ pdst->x = (int32_t)0L;
+ pdst->y = (int32_t)0L;
+ pdst->fsz = (uint16_t)12U;
+ pdst->a = (int16_t)0;
+ pdst->find = (uint8_t)0U;
+ pdst->al = WXD_TA_LEFT;
+ pdst->fl = 0x01;
+ pdst->font = NULL;
+ }
+
+#line 1627 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_det_init_poly(Wxd_det_pl_t *pdst)
+{
+
+
+#line 1635 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_pl_t));
+ pdst->p = NULL;
+ pdst->n = (uint16_t)0U;
+ }
+
+#line 1640 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_det_init_spline(Wxd_det_xs_t *pdst)
+{
+
+
+#line 1648 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_xs_t));
+ pdst->p = NULL;
+ pdst->n = (uint16_t)0U;
+ }
+
+#line 1653 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_det_init_arc(Wxd_det_arc_t *pdst)
+{
+
+
+#line 1661 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_arc_t));
+ pdst->a = 0.0;
+ pdst->b = 360.0;
+ pdst->x = 0.0;
+ pdst->y = 0.0;
+ pdst->r = 0.0;
+ pdst->x1 = (int32_t)0L;
+ pdst->y1 = (int32_t)0L;
+ pdst->x2 = (int32_t)0L;
+ pdst->y2 = (int32_t)0L;
+ pdst->x3 = (int32_t)0L;
+ pdst->y3 = (int32_t)0L;
+ pdst->d = (int8_t)0;
+ }
+
+#line 1676 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_det_init_ellipse(Wxd_det_ellipse_t *pdst)
+{
+
+
+#line 1684 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_ellipse_t));
+ pdst->x = (int32_t)0L;
+ pdst->y = (int32_t)0L;
+ pdst->rx = (uint32_t)0UL;
+ pdst->ry = (uint32_t)0UL;
+ pdst->a = (int16_t)0;
+ }
+
+#line 1692 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_det_init_box(Wxd_det_box_t *pdst)
+{
+
+
+#line 1700 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_box_t));
+ wxdobj_det_init_bb(&(pdst->b));
+ pdst->r = (uint32_t)0UL;
+ }
+
+#line 1705 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_det_init_image(Wxd_det_image_t *pdst)
+{
+
+
+#line 1713 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_image_t));
+ pdst->fn = NULL;
+ pdst->bm = NULL;
+ dk4bb_init(&(pdst->pl));
+ wxdobj_det_init_bb(&(pdst->br));
+ pdst->xres = -1.0;
+ pdst->yres = -1.0;
+ pdst->fl = WXD_IMFL_ASPECT | WXD_IMFL_USE_ALPHA
+ | WXD_IMFL_IMG_INT | WXD_IMFL_USE_DCT;
+ pdst->r2g = (int8_t)(-1);
+ pdst->r2c = (int8_t)(-1);
+ pdst->t = wxBITMAP_TYPE_INVALID;
+ }
+
+#line 1727 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_det_init_dot(Wxd_det_dot_t *pdst)
+{
+
+
+#line 1735 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_dot_t));
+ pdst->x = (int32_t)0L;
+ pdst->y = (int32_t)0L;
+ pdst->d = (uint16_t)0U;
+ }
+
+#line 1741 "WxdkdrawObj.cpt"
+}
+
+
+
+/** Initialize object, use template if specified.
+ @param pdst Object to initialize.
+ @param ot Object type.
+ @param ptpl Template object, may be NULL.
+*/
+void
+wxdobj_obj_init(Wxd_object_t *pdst, int ot, Wxd_object_t const *ptpl)
+{
+
+
+#line 1754 "WxdkdrawObj.cpt"
+ if (NULL != ptpl) {
+
+#line 1755 "WxdkdrawObj.cpt"
+ /*
+ Apply template settings
+ */
+ DK4_MEMCPY(pdst,ptpl,sizeof(Wxd_object_t));
+ }
+ else {
+
+#line 1761 "WxdkdrawObj.cpt"
+ /*
+ Apply default settings
+ */
+ DK4_MEMRES(pdst,sizeof(Wxd_object_t));
+ pdst->lay = 0;
+ pdst->lw = 2;
+ pdst->fc[0] = (uint8_t)255U;
+ pdst->fc[1] = (uint8_t)255U;
+ pdst->fc[2] = (uint8_t)255U;
+ pdst->sc[0] = (uint8_t)0U;
+ pdst->sc[1] = (uint8_t)0U;
+ pdst->sc[2] = (uint8_t)0U;
+ pdst->cs = (uint8_t)(WXD_LC_BUTTED);
+ pdst->fs = (uint8_t)(WXD_FS_NONE);
+ pdst->ls = (uint8_t)(WXD_LS_SOLID);
+ pdst->sl = (uint8_t)4U;
+ pdst->js = (uint8_t)(WXD_LJ_MITERED);
+ pdst->ml = (uint8_t)8U;
+ pdst->aft = (uint8_t)0U;
+ pdst->afl = (uint8_t)16U;
+ pdst->afw = (uint8_t)8U;
+ pdst->abt = (uint8_t)0U;
+ pdst->abl = (uint8_t)16U;
+ pdst->abw = (uint8_t)8U;
+ pdst->mark = (uint8_t)0U;
+ }
+ pdst->pa = NULL;
+ pdst->psti = NULL;
+ pdst->play = NULL;
+ pdst->ot = ot;
+ dk4bb_init(&(pdst->bb));
+ /*
+ Use default values for details if no template was specified
+ or template object type does not match
+ */
+ if ((NULL == ptpl) || ((NULL != ptpl) && (ot != ptpl->ot))) {
+ switch (ot) {
+ case WXD_OT_GROUP_BEGIN : {
+ } break;
+ case WXD_OT_TEXT : {
+ wxdobj_det_init_text(&((pdst->det).t));
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ wxdobj_det_init_poly(&((pdst->det).p));
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ wxdobj_det_init_spline(&((pdst->det).s));
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ wxdobj_det_init_arc(&((pdst->det).a));
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ wxdobj_det_init_ellipse(&((pdst->det).e));
+ } break;
+ case WXD_OT_BOX : {
+ wxdobj_det_init_box(&((pdst->det).b));
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_det_init_image(&((pdst->det).i));
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ wxdobj_det_init_dot(&((pdst->det).d));
+ } break;
+ }
+ }
+ /*
+ Make sure not to re-use dynamic objects from template.
+ */
+ switch (ot) {
+ case WXD_OT_GROUP_BEGIN : {
+ (pdst->det).g.s_e = NULL;
+ (pdst->det).g.i_e = NULL;
+ } break;
+ case WXD_OT_TEXT : {
+ (pdst->det).t.t = NULL;
+ (pdst->det).t.tsc = NULL;
+ /*
+ 2020-01-05 Set font to NULL too.
+ */
+ (pdst->det).t.font = NULL;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ (pdst->det).p.n = (uint16_t)0U;
+ (pdst->det).p.p = NULL;
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ (pdst->det).s.n = (uint16_t)0U;
+ (pdst->det).s.p = NULL;
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ } break;
+ case WXD_OT_BOX : {
+ } break;
+ case WXD_OT_IMAGE : {
+ (pdst->det).i.fn = NULL;
+ (pdst->det).i.bm = NULL;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ } break;
+ }
+
+#line 1863 "WxdkdrawObj.cpt"
+}
+
+
+
+/** Check whether a layer is used in a drawing, remove layer if unused.
+ @param pdrw Drawing to check and modify.
+ @param play Layer to check and probably remove.
+*/
+
+static
+void
+i_check_layer_structure_removal(Wxd_drawing_t *pdrw, Wxd_layer_t *play)
+{
+ Wxd_object_t *pobj;
+
+
+#line 1878 "WxdkdrawObj.cpt"
+ play->used = 0x00;
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ if (NULL != pobj->play) {
+ pobj->play->used = 0x01;
+ }
+ }
+ } while (NULL != pobj);
+ if (0x00 == play->used) {
+
+#line 1889 "WxdkdrawObj.cpt"
+ dk4sto_remove(pdrw->s_layers, play, NULL);
+ dk4sto_it_reset(pdrw->i_layers);
+ dk4mem_free(play);
+ }
+
+
+#line 1894 "WxdkdrawObj.cpt"
+}
+
+
+
+/** Find group for object.
+ @param pdrw Drawing containing the object.
+ @param pobj Object to search for.
+ @return Valid pointer on success, NULL if not found.
+
+*/
+
+static
+Wxd_object_t *
+i_find_group_for(Wxd_drawing_t *pdrw, Wxd_object_t *pobj)
+{
+ Wxd_object_t *back = NULL; /* Result */
+ Wxd_object_t *pgrc = NULL; /* Group candidate */
+ Wxd_object_t *pgrp = NULL; /* Current (sub)group tested */
+ Wxd_object_t *pno = NULL; /* Next object */
+ void *pt = NULL; /* Test whether object contained */
+
+
+#line 1915 "WxdkdrawObj.cpt"
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pgrc = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pgrc) {
+ if (WXD_OT_GROUP_BEGIN == pgrc->ot) {
+ if (NULL != dk4sto_it_find_exact((pgrc->det).g.i_e, pobj)) {
+ /*
+ Object found in top-level group
+ */
+ back = pgrc;
+ }
+ else {
+ /*
+ Must search group structure recursively
+ */
+ pgrp = pgrc;
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ while ((NULL != pgrp) && (NULL == back)) {
+ pno = (Wxd_object_t *)dk4sto_it_next((pgrp->det).g.i_e);
+ if (NULL != pno) {
+ if (WXD_OT_GROUP_BEGIN == pno->ot) {
+ pt =
+ dk4sto_it_find_exact((pno->det).g.i_e, pobj);
+ if (NULL != pt) {
+ back = pno;
+ }
+ else {
+ pgrp = pno;
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ }
+ }
+ }
+ else {
+ /*
+ No more objects in group, go up 1 level
+ */
+ pgrp = pgrp->pa;
+ }
+ }
+ }
+ }
+ }
+ } while ((NULL != pgrc) && (NULL == back));
+#if TRACE_DEBUG
+ if (NULL == back) {
+
+#line 1960 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 1963 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+void
+wxdobj_obj_delete(Wxd_object_t *pobj)
+{
+
+
+#line 1972 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_GROUP_BEGIN : {
+
+#line 1975 "WxdkdrawObj.cpt"
+ if (NULL != (pobj->det).g.i_e) {
+ dk4sto_it_close((pobj->det).g.i_e);
+ }
+ if (NULL != (pobj->det).g.s_e) {
+ dk4sto_close((pobj->det).g.s_e);
+ }
+ (pobj->det).g.s_e = NULL;
+ (pobj->det).g.i_e = NULL;
+ } break;
+ case WXD_OT_TEXT : {
+
+#line 1985 "WxdkdrawObj.cpt"
+ dk4mem_release((pobj->det).t.t);
+ dk4mem_release((pobj->det).t.tsc);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+
+#line 1989 "WxdkdrawObj.cpt"
+ dk4mem_release((pobj->det).p.p);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+
+#line 1992 "WxdkdrawObj.cpt"
+ dk4mem_release((pobj->det).s.p);
+ } break;
+ case WXD_OT_IMAGE : {
+
+#line 1995 "WxdkdrawObj.cpt"
+ dk4mem_release((pobj->det).i.fn);
+ if (NULL != (pobj->det).i.bm) {
+
+#line 1997 "WxdkdrawObj.cpt"
+ delete (pobj->det).i.bm;
+ (pobj->det).i.bm = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2002 "WxdkdrawObj.cpt"
+ }
+#endif
+ } break;
+#if TRACE_DEBUG
+ case WXD_OT_O_ARC : {
+
+#line 2007 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_C_ARC : {
+
+#line 2009 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_CIRCLE : {
+
+#line 2011 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_ELLIPSE : {
+
+#line 2013 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_BOX : {
+
+#line 2015 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_DOT_FILLED : {
+
+#line 2017 "WxdkdrawObj.cpt"
+ } break;
+ case WXD_OT_DOT_WHITE : {
+
+#line 2019 "WxdkdrawObj.cpt"
+ } break;
+ default : {
+
+#line 2021 "WxdkdrawObj.cpt"
+ } break;
+#endif
+ }
+ dk4mem_free(pobj);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2028 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2031 "WxdkdrawObj.cpt"
+}
+
+
+
+/** Internally delete a group structure recursively.
+ @param pgrp Group structure object to delete
+ (must not be NULL, must be WXD_OT_GROUP_BEGIN type,
+ s_e and i_e must not be NULL).
+*/
+static
+void
+grp_delete_recursive(Wxd_object_t *pgrp)
+{
+ Wxd_object_t *no; /* Next object */
+ Wxd_object_t *ng; /* Next group */
+
+
+#line 2047 "WxdkdrawObj.cpt"
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ while (NULL != pgrp) {
+ no = (Wxd_object_t *)dk4sto_it_next((pgrp->det).g.i_e);
+ if (NULL != no) {
+ if (WXD_OT_GROUP_BEGIN == no->ot) {
+ if ((NULL != (no->det).g.s_e) && (NULL != (no->det).g.i_e)) {
+ dk4sto_it_reset((no->det).g.i_e);
+ pgrp = no;
+ }
+ else {
+ dk4sto_remove((pgrp->det).g.s_e, no, NULL);
+ dk4sto_it_reset((pgrp->det).g.i_e);
+#if 0
+ if (NULL != (no->det).g.s_e) {
+ dk4sto_close((no->det).g.s_e);
+ (no->det).g.s_e = NULL;
+ }
+ dk4mem_free(no);
+#endif
+ wxdobj_obj_delete(no);
+ }
+ }
+ else {
+ no->pa = NULL;
+ dk4sto_remove((pgrp->det).g.s_e, no, NULL);
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ }
+ }
+ else {
+ ng = pgrp->pa;
+ if (NULL != ng) {
+ dk4sto_remove((ng->det).g.s_e, pgrp, NULL);
+ dk4sto_it_reset((ng->det).g.i_e);
+ }
+#if 0
+ dk4sto_it_close((pgrp->det).g.i_e);
+ (pgrp->det).g.i_e = NULL;
+ dk4sto_close((pgrp->det).g.s_e);
+ (pgrp->det).g.s_e = NULL;
+ dk4mem_free(pgrp);
+#endif
+ wxdobj_obj_delete(pgrp);
+ pgrp = ng;
+ }
+ }
+
+
+#line 2093 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_grp_delete_recursive(Wxd_object_t *pgrp)
+{
+
+
+#line 2101 "WxdkdrawObj.cpt"
+ if (NULL != pgrp) {
+ if (WXD_OT_GROUP_BEGIN == pgrp->ot) {
+ if ((NULL != (pgrp->det).g.s_e) && (NULL != (pgrp->det).g.i_e)) {
+ grp_delete_recursive(pgrp);
+ }
+ else {
+ if (NULL != (pgrp->det).g.s_e) {
+ dk4sto_close((pgrp->det).g.s_e);
+ (pgrp->det).g.s_e = NULL;
+ }
+ dk4mem_free(pgrp);
+ }
+ }
+ }
+ else {
+ }
+
+
+#line 2118 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_drw_delete(Wxd_drawing_t *pdrw)
+{
+ Wxd_object_t *pgrp; /* Current group to delete */
+ Wxd_stipple_t *pstip; /* Current stipple to delete */
+ Wxd_layer_t *play; /* Current layer to delete */
+ Wxd_font_t *pfont; /* Current font to delete */
+
+
+#line 2130 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ /*
+ Delete structured information
+ */
+
+
+#line 2135 "WxdkdrawObj.cpt"
+ if (NULL != pdrw->s_stru) {
+ if (NULL != pdrw->i_stru) {
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pgrp = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pgrp) {
+ if (WXD_OT_GROUP_BEGIN == pgrp->ot) {
+ wxdobj_grp_delete_recursive(pgrp);
+ }
+ else {
+ pgrp->pa = NULL;
+ }
+ }
+ } while (NULL != pgrp);
+ dk4sto_it_close(pdrw->i_stru);
+ pdrw->i_stru = NULL;
+ }
+ dk4sto_close(pdrw->s_stru);
+ pdrw->s_stru = NULL;
+ }
+
+
+#line 2156 "WxdkdrawObj.cpt"
+ /*
+ Delete stipples
+ */
+
+
+#line 2160 "WxdkdrawObj.cpt"
+ if (NULL != pdrw->s_stip) {
+
+#line 2161 "WxdkdrawObj.cpt"
+ if (NULL != pdrw->i_stip) {
+
+#line 2162 "WxdkdrawObj.cpt"
+ dk4sto_it_reset(pdrw->i_stip);
+ do {
+
+#line 2164 "WxdkdrawObj.cpt"
+ pstip = (Wxd_stipple_t *)dk4sto_it_next(pdrw->i_stip);
+ if (NULL != pstip) {
+
+
+#line 2167 "WxdkdrawObj.cpt"
+ if (NULL != pstip->bm) {
+
+#line 2168 "WxdkdrawObj.cpt"
+ delete (pstip->bm);
+ pstip->bm = NULL;
+ }
+ else {
+
+#line 2172 "WxdkdrawObj.cpt"
+ }
+ dk4mem_free(pstip);
+ }
+ } while (NULL != pstip);
+ dk4sto_it_close(pdrw->i_stip);
+ pdrw->i_stip = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2181 "WxdkdrawObj.cpt"
+ }
+#endif
+ dk4sto_close(pdrw->s_stip);
+ pdrw->s_stip = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2188 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2191 "WxdkdrawObj.cpt"
+ /*
+ Delete layers
+ */
+
+
+#line 2195 "WxdkdrawObj.cpt"
+ if (NULL != pdrw->s_layers) {
+ if (NULL != pdrw->i_layers) {
+ dk4sto_it_reset(pdrw->i_layers);
+ do {
+ play = (Wxd_layer_t *)dk4sto_it_next(pdrw->i_layers);
+ if (NULL != play) {
+
+
+#line 2202 "WxdkdrawObj.cpt"
+ dk4mem_free(play);
+ }
+ } while (NULL != play);
+ dk4sto_it_close(pdrw->i_layers);
+ pdrw->i_layers = NULL;
+ }
+ dk4sto_close(pdrw->s_layers);
+ pdrw->s_layers = NULL;
+ }
+
+
+#line 2212 "WxdkdrawObj.cpt"
+ /*
+ Delete flat list and objects
+ */
+
+
+#line 2216 "WxdkdrawObj.cpt"
+ if (NULL != pdrw->s_flat) {
+ if (NULL != pdrw->i_flat) {
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pgrp = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pgrp) {
+
+#line 2222 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(pgrp);
+ }
+ } while (NULL != pgrp);
+ dk4sto_it_close(pdrw->i_flat);
+ pdrw->i_flat = NULL;
+ }
+ dk4sto_close(pdrw->s_flat);
+ pdrw->s_flat = NULL;
+ }
+
+
+#line 2232 "WxdkdrawObj.cpt"
+
+
+#line 2233 "WxdkdrawObj.cpt"
+ /*
+ Delete font structures
+ */
+ if (NULL != pdrw->s_fonts) {
+ if (NULL != pdrw->i_fonts) {
+ dk4sto_it_reset(pdrw->i_fonts);
+ do {
+ pfont = (Wxd_font_t *)dk4sto_it_next(pdrw->i_fonts);
+ if (NULL != pfont) {
+
+
+#line 2243 "WxdkdrawObj.cpt"
+ wxdfont_delete(pfont);
+ }
+ } while (NULL != pfont);
+ dk4sto_it_close(pdrw->i_fonts);
+ pdrw->i_fonts = NULL;
+ }
+ dk4sto_close(pdrw->s_fonts);
+ pdrw->s_fonts = NULL;
+ }
+
+
+#line 2253 "WxdkdrawObj.cpt"
+ dk4mem_free(pdrw);
+
+
+#line 2255 "WxdkdrawObj.cpt"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2258 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2261 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_drw_set_xsubs(Wxd_drawing_t *pdrw, size_t xs)
+{
+ if (NULL != pdrw) {
+ if ((size_t)2U > xs) {
+ xs = (size_t)2U;
+ }
+ pdrw->xsubs = xs;
+ }
+}
+
+
+
+void
+wxdobj_drw_require_redraw(Wxd_drawing_t *pdrw, int level)
+{
+
+
+#line 2282 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ if (level > pdrw->redraw) {
+ pdrw->redraw = level;
+ }
+ }
+
+
+#line 2288 "WxdkdrawObj.cpt"
+}
+
+
+
+int
+wxdobj_drw_get_required_redraw_level(Wxd_drawing_t *pdrw, int level)
+{
+
+
+#line 2296 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ if (pdrw->redraw > level) {
+ level = pdrw->redraw;
+ }
+ }
+
+#line 2301 "WxdkdrawObj.cpt"
+ return level;
+}
+
+
+
+void
+wxdobj_drw_reset_required_redraw_level(Wxd_drawing_t *pdrw)
+{
+
+
+#line 2310 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ pdrw->redraw = WXD_REFRESH_NONE;
+ }
+
+
+#line 2314 "WxdkdrawObj.cpt"
+}
+
+
+
+Wxd_drawing_t *
+wxdobj_drw_new(void)
+{
+ Wxd_drawing_t *back = NULL;
+ bool ok = false;
+
+
+#line 2324 "WxdkdrawObj.cpt"
+ back = dk4mem_new(Wxd_drawing_t,1,NULL);
+ if (NULL != back) {
+ /*
+ Initialize drawing members
+ */
+ back->s_stru = back->s_flat = back->s_stip =
+ back->s_layers = back->s_fonts = NULL;
+ back->i_stru = back->i_flat = back->i_stip =
+ back->i_layers = back->i_fonts = NULL;
+ (back->bb).xl = 0L;
+ (back->bb).yb = 0L;
+ (back->bb).xr = 130048000L;
+ (back->bb).yt = 73152000L;
+ back->xsubs = (size_t)8U;
+ back->cx = 65024000L;
+ back->cy = 36576000L;
+ back->baselw = 101600L;
+ back->bleft = 16256000L;
+ back->bright = 16256000L;
+ back->bbottom = 16256000L;
+ back->btop = 16256000L;
+ back->fv_maj = 1U;
+ back->fv_min = 0U;
+ back->zl = 0;
+ back->gridunit = 0U;
+ back->gridbase = 0U;
+ back->s_stru = dk4sto_open(NULL);
+ back->s_flat = dk4sto_open(NULL);
+ back->s_stip = dk4sto_open(NULL);
+ back->s_layers = dk4sto_open(NULL);
+ back->s_fonts = dk4sto_open(NULL);
+ /*
+ After loading a drawing the first repaint must do a
+ complete redraw.
+ */
+ back->redraw = WXD_REFRESH_GRID;
+ /*
+ Allocate storages and iterators.
+ */
+ if (
+ (NULL != back->s_stru) && (NULL != back->s_flat)
+ && (NULL != back->s_stip) && (NULL != back->s_layers)
+ && (NULL != back->s_fonts)
+ ) {
+ dk4sto_set_comp(back->s_stru, drawobj_compare_object, 0);
+ dk4sto_set_comp(back->s_flat, drawobj_compare_object, 0);
+ dk4sto_set_comp(back->s_stip, drawobj_compare_stipples, 0);
+ dk4sto_set_comp(back->s_layers, drawobj_compare_layers, 0);
+ dk4sto_set_comp(back->s_fonts, wxdfont_compare, 0);
+ back->i_stru = dk4sto_it_open(back->s_stru, NULL);
+ back->i_flat = dk4sto_it_open(back->s_flat, NULL);
+ back->i_stip = dk4sto_it_open(back->s_stip, NULL);
+ back->i_layers = dk4sto_it_open(back->s_layers, NULL);
+ back->i_fonts = dk4sto_it_open(back->s_fonts, NULL);
+ if (
+ (NULL != back->i_stru) && (NULL != back->i_flat)
+ && (NULL != back->i_stip) && (NULL != back->i_layers)
+ && (NULL != back->i_fonts)
+ ) {
+ ok = true;
+ }
+ }
+ /*
+ Check whether initialization completed successfully
+ */
+ if(!(ok)) {
+
+#line 2390 "WxdkdrawObj.cpt"
+ wxdobj_drw_delete(back);
+ back = NULL;
+ }
+ }
+
+
+#line 2395 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+#if 0
+static
+Wxd_object_t *
+wxdobj_obj_new_text(
+ wxChar const *t,
+ wxChar const *tsc,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2411 "WxdkdrawObj.cpt"
+ if (NULL != t) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_TEXT, ptpl);
+ (back->det).t.t = dk4strx_dup(t, NULL);
+ if (NULL == (back->det).t.t) {
+
+#line 2417 "WxdkdrawObj.cpt"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ else {
+ if (NULL != tsc) {
+ (back->det).t.tsc = dk4strx_dup(tsc, NULL);
+ if (NULL == (back->det).t.tsc) {
+
+#line 2424 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2432 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+
+#line 2435 "WxdkdrawObj.cpt"
+ return back;
+}
+#endif
+
+
+
+static
+Wxd_object_t *
+wxdobj_obj_new_polyany(uint16_t np, int ot, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2447 "WxdkdrawObj.cpt"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, ot, ptpl);
+ (back->det).p.n = np;
+ (back->det).p.p = NULL;
+ (back->det).p.p = dk4mem_new(Wxd_point_t,((size_t)np),NULL);
+ if (NULL == (back->det).p.p) {
+
+#line 2454 "WxdkdrawObj.cpt"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+
+#line 2458 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_polyline(uint16_t np, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2468 "WxdkdrawObj.cpt"
+ if ((uint16_t)1U < np) {
+ back = wxdobj_obj_new_polyany(np, WXD_OT_POLYLINE, ptpl);
+ }
+
+#line 2471 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_polygon(uint16_t np, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2481 "WxdkdrawObj.cpt"
+ if ((uint16_t)1U < np) {
+ back = wxdobj_obj_new_polyany(np, WXD_OT_POLYGON, ptpl);
+ }
+
+#line 2484 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_spline(uint16_t np, int cl, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2494 "WxdkdrawObj.cpt"
+ if ((uint16_t)1U < np) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(
+ back, ((0 != cl) ? (WXD_OT_C_SPLINE) : (WXD_OT_O_SPLINE)), ptpl
+ );
+ (back->det).s.n = np;
+ (back->det).s.p = dk4mem_new(Wxd_spline_point_t,((size_t)np),NULL);
+ if (NULL == (back->det).s.p) {
+
+#line 2503 "WxdkdrawObj.cpt"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2509 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+
+#line 2512 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_arc(int cl, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2522 "WxdkdrawObj.cpt"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(
+ back, ((0 != cl) ? (WXD_OT_C_ARC) : (WXD_OT_O_ARC)), ptpl
+ );
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2530 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2533 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_circle(Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2543 "WxdkdrawObj.cpt"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_CIRCLE, ptpl);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2549 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2552 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_ellipse(Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2562 "WxdkdrawObj.cpt"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_ELLIPSE, ptpl);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2568 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2571 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_box(Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2581 "WxdkdrawObj.cpt"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_BOX, ptpl);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2587 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2590 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_image(wxChar const *fn, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2600 "WxdkdrawObj.cpt"
+ if (NULL != fn) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_IMAGE, ptpl);
+ (back->det).i.fn = dk4strx_dup(fn, NULL);
+ if (NULL == (back->det).i.fn) {
+
+#line 2606 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2613 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2616 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_dot(int wh, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2626 "WxdkdrawObj.cpt"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(
+ back, ((0 != wh) ? (WXD_OT_DOT_WHITE) : (WXD_OT_DOT_FILLED)), ptpl
+ );
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2634 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2637 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_textlabel(wxChar const *te, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2647 "WxdkdrawObj.cpt"
+ if (NULL != te) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_TEXT, ptpl);
+ if (NULL != ptpl) {
+ back->fc[0] = ptpl->sc[0];
+ back->fc[1] = ptpl->sc[1];
+ back->fc[2] = ptpl->sc[2];
+ }
+ (back->det).t.t = dk4strx_dup(te, NULL);
+ if (NULL == (back->det).t.t) {
+
+#line 2658 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2664 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2669 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2672 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+int
+wxdobj_needs_stipple(
+ Wxd_object_t *pobj
+)
+{
+ int back = 0;
+
+
+#line 2684 "WxdkdrawObj.cpt"
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE :
+ case WXD_OT_ELLIPSE :
+ case WXD_OT_BOX : {
+
+#line 2691 "WxdkdrawObj.cpt"
+
+
+#line 2692 "WxdkdrawObj.cpt"
+ if (WXD_FS_PURE < pobj->fs) {
+ back = 1;
+ }
+ } break;
+ }
+
+#line 2697 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+/** Find existing stipple structure for object or create a new one.
+ @param pdrw Drawing.
+ @param pobj Object.
+ @return Address of stipple on success, NULL on error.
+*/
+
+static
+Wxd_stipple_t *
+i_find_stipple_structure(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ Wxd_stipple_t teststip;
+ Wxd_stipple_t *back;
+
+
+#line 2718 "WxdkdrawObj.cpt"
+ teststip.cd[0] = pobj->fs;
+ teststip.cd[1] = pobj->fc[0];
+ teststip.cd[2] = pobj->fc[1];
+ teststip.cd[3] = pobj->fc[2];
+ teststip.cd[4] = pobj->sc[0];
+ teststip.cd[5] = pobj->sc[1];
+ teststip.cd[6] = pobj->sc[2];
+ teststip.cd[7] = 0x01;
+ teststip.bm = NULL;
+
+ back = (Wxd_stipple_t *)dk4sto_it_find_like(
+ pdrw->i_stip, (const void *)(&teststip), 0
+ );
+ if (NULL == back) {
+
+#line 2732 "WxdkdrawObj.cpt"
+ back = dk4mem_new(Wxd_stipple_t,1,NULL);
+ if (NULL != back) {
+
+#line 2734 "WxdkdrawObj.cpt"
+ DK4_MEMCPY(back,&teststip,sizeof(Wxd_stipple_t));
+ back->bm = NULL;
+ if (0 == dk4sto_add(pdrw->s_stip, (void *)back, NULL)) {
+ dk4mem_free(back);
+
+#line 2738 "WxdkdrawObj.cpt"
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2742 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2747 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+
+#line 2750 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+static
+int
+i_find_layer_structure(Wxd_drawing_t *pdrw, Wxd_object_t *pobj)
+{
+ Wxd_layer_t *ptest;
+ int back = 0;
+
+
+#line 2762 "WxdkdrawObj.cpt"
+ if (NULL == pobj->play) {
+ ptest = (Wxd_layer_t *)dk4sto_it_find_like(
+ pdrw->i_layers, &(pobj->lay), 1
+ );
+ if (NULL != ptest) {
+ pobj->play = ptest;
+ back = 1;
+ }
+ else {
+ ptest = dk4mem_new(Wxd_layer_t,1,NULL);
+ if (NULL != ptest) {
+ ptest->lay = pobj->lay;
+ ptest->active = 0x01;
+ ptest->used = 0x01;
+ if (0 != dk4sto_add(pdrw->s_layers, ptest, NULL)) {
+ pobj->play = ptest;
+ back = 1;
+ }
+ else {
+
+#line 2781 "WxdkdrawObj.cpt"
+ dk4mem_free(ptest);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2786 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ else {
+ back = 1;
+ }
+
+#line 2793 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+static
+int
+wxdobj_drw_layer_and_stipple(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ int back = 1;
+
+
+#line 2807 "WxdkdrawObj.cpt"
+ if (NULL == pobj->play) {
+ if (0 == i_find_layer_structure(pdrw, pobj)) {
+ back = 0;
+ }
+ }
+ if (0 != wxdobj_needs_stipple(pobj)) {
+
+#line 2813 "WxdkdrawObj.cpt"
+ if (NULL == pobj->psti) {
+
+#line 2814 "WxdkdrawObj.cpt"
+ pobj->psti = i_find_stipple_structure(pdrw, pobj);
+ if (NULL == pobj->psti) {
+
+#line 2816 "WxdkdrawObj.cpt"
+ back = 0;
+ }
+#if TRACE_DEBUG
+ else {
+
+
+#line 2821 "WxdkdrawObj.cpt"
+
+
+#line 2822 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+
+#line 2826 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+int
+wxdobj_drw_register_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t *pobj
+)
+{
+ int back = 0;
+
+
+#line 2840 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ /*
+ Group objects go to structured storage only, no layer structure
+ */
+ if (NULL != pgrp) {
+ if (0 != dk4sto_add((pgrp->det).g.s_e, pobj, NULL)) {
+ pobj->pa = pgrp;
+ back = 1;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2852 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ else {
+ if (0 != dk4sto_add(pdrw->s_stru, pobj, NULL)) {
+ back = 1;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2861 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ else {
+ if (0 != wxdobj_drw_layer_and_stipple(pdrw, pobj)) {
+ /*
+ Non-group elements are added to flat and structured storage
+ */
+ if (0 != dk4sto_add(pdrw->s_flat, pobj, NULL)) {
+ /*
+ Add to structured storage,
+ either group or top-level storage.
+ */
+ if (NULL != pgrp) {
+ if (0 != dk4sto_add((pgrp->det).g.s_e, pobj, NULL)) {
+ back = 1;
+ pobj->pa = pgrp;
+ }
+ else {
+
+#line 2881 "WxdkdrawObj.cpt"
+ dk4sto_remove(pdrw->s_flat, pobj, NULL);
+ }
+ }
+ else {
+ if (0 != dk4sto_add(pdrw->s_stru, pobj, NULL)) {
+ back = 1;
+ }
+ else {
+
+#line 2889 "WxdkdrawObj.cpt"
+ dk4sto_remove(pdrw->s_flat, pobj, NULL);
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2895 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2902 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2905 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_drw_add_group(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2918 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_GROUP_BEGIN, NULL);
+ (back->det).g.s_e = dk4sto_open(NULL);
+ if (NULL != (back->det).g.s_e) {
+ dk4sto_set_comp(
+ (back->det).g.s_e, drawobj_compare_object,
+ WXD2LAT_OBJ_COMPARE_CR_PROPERTIES
+ );
+ (back->det).g.i_e = dk4sto_it_open((back->det).g.s_e, NULL);
+ if (NULL != (back->det).g.i_e) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+
+#line 2933 "WxdkdrawObj.cpt"
+ }
+ }
+ else {
+
+#line 2936 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ else {
+
+#line 2941 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2947 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2952 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 2955 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_polyline(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ uint16_t np,
+ int cl,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 2971 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ if (0 != cl) {
+ back = wxdobj_obj_new_polygon(np, ptpl);
+ }
+ else {
+ back = wxdobj_obj_new_polyline(np, ptpl);
+ }
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 2986 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_add_polypoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report */
+ Wxd_point_t *pnew; /* New allocated points array */
+ size_t btc; /* Bytes to copy */
+ uint16_t nn; /* New array size */
+ uint16_t num; /* Number of elements to move */
+ uint16_t i; /* Index of element to copy */
+ bool back = false;
+
+
+#line 3006 "WxdkdrawObj.cpt"
+ if (
+ (NULL != pobj)
+ && (
+ (WXD_OT_POLYLINE == pobj->ot)
+ || (WXD_OT_POLYGON == pobj->ot)
+ )
+ && (NULL != (pobj->det).p.p)
+ ) {
+ dk4error_init(&er);
+ nn = dk4ma_uint16_t_add((pobj->det).p.n, 1U, &er);
+ if (DK4_E_NONE == er.ec) {
+ pnew = dk4mem_new(Wxd_point_t,((size_t)nn),&er);
+ if (NULL != pnew) {
+ back = true;
+ btc = sizeof(Wxd_point_t) * (size_t)((pobj->det).p.n);
+ DK4_MEMCPY(pnew,(pobj->det).p.p,btc);
+ dk4mem_free((pobj->det).p.p);
+ (pobj->det).p.p = pnew;
+ if (pind < (pobj->det).p.n) {
+ num = (pobj->det).p.n - pind;
+ for (i = 0; i < num; i++) {
+ ((pobj->det).p.p)[(pobj->det).p.n - i].x =
+ ((pobj->det).p.p)[(pobj->det).p.n - i - 1].x;
+ ((pobj->det).p.p)[(pobj->det).p.n - i].y =
+ ((pobj->det).p.p)[(pobj->det).p.n - i - 1].y;
+ }
+ }
+ else {
+ ((pobj->det).p.p)[(pobj->det).p.n].x =
+ ((pobj->det).p.p)[(pobj->det).p.n - 1].x;
+ ((pobj->det).p.p)[(pobj->det).p.n].y =
+ ((pobj->det).p.p)[(pobj->det).p.n - 1].y;
+ }
+ (pobj->det).p.n = nn;
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ dk4error_copy(erp, &er);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 3052 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_del_polypoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ Wxd_point_t *pnew;
+ size_t btc;
+ uint16_t num;
+ uint16_t i;
+ uint16_t nn;
+ bool back = false;
+
+
+#line 3071 "WxdkdrawObj.cpt"
+
+
+#line 3072 "WxdkdrawObj.cpt"
+ if (
+ (NULL != pobj)
+ && (
+ (WXD_OT_POLYLINE == pobj->ot)
+ || (WXD_OT_POLYGON == pobj->ot)
+ )
+ ) {
+
+#line 3079 "WxdkdrawObj.cpt"
+
+
+#line 3080 "WxdkdrawObj.cpt"
+ back = true;
+ if (pind < ((pobj->det).p.n - 1U)) {
+
+#line 3082 "WxdkdrawObj.cpt"
+ num = (pobj->det).p.n - 1U - pind;
+ for (i = 0U; i < num; i++) {
+ ((pobj->det).p.p)[pind + i].x =
+ ((pobj->det).p.p)[pind + i + 1U].x;
+ ((pobj->det).p.p)[pind + i].y =
+ ((pobj->det).p.p)[pind + i + 1U].y;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3092 "WxdkdrawObj.cpt"
+ }
+#endif
+ nn = (pobj->det).p.n - 1U;
+ pnew = dk4mem_new(Wxd_point_t,((size_t)nn),erp);
+ if (NULL != pnew) {
+
+#line 3097 "WxdkdrawObj.cpt"
+ btc = sizeof(Wxd_point_t) * ((size_t)nn);
+ DK4_MEMCPY(pnew,(pobj->det).p.p,btc);
+ dk4mem_free((pobj->det).p.p);
+ (pobj->det).p.p = pnew;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3104 "WxdkdrawObj.cpt"
+ }
+#endif
+ (pobj->det).p.n = (pobj->det).p.n - 1U;
+
+
+#line 3108 "WxdkdrawObj.cpt"
+ }
+ else {
+
+#line 3110 "WxdkdrawObj.cpt"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 3113 "WxdkdrawObj.cpt"
+
+
+#line 3114 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_spline(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ uint16_t np,
+ int cl,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3130 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_spline(np, cl, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 3140 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_add_splinepoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report */
+ Wxd_spline_point_t *pnew; /* New allocated points array */
+ size_t btc; /* Bytes to copy */
+ uint16_t nn; /* New array size */
+ uint16_t num; /* Number of elements to move */
+ uint16_t i; /* Index of element to copy */
+ bool back = false;
+
+
+#line 3160 "WxdkdrawObj.cpt"
+ if (
+ (NULL != pobj)
+ && (
+ (WXD_OT_O_SPLINE == pobj->ot)
+ || (WXD_OT_C_SPLINE == pobj->ot)
+ )
+ && (NULL != (pobj->det).s.p)
+ ) {
+ dk4error_init(&er);
+ nn = dk4ma_uint16_t_add((pobj->det).s.n, 1U, &er);
+ if (DK4_E_NONE == er.ec) {
+ pnew = dk4mem_new(Wxd_spline_point_t,((size_t)nn),&er);
+ if (NULL != pnew) {
+ back = true;
+ btc = sizeof(Wxd_spline_point_t) * (size_t)((pobj->det).s.n);
+ DK4_MEMCPY(pnew,(pobj->det).s.p,btc);
+ dk4mem_free((pobj->det).s.p);
+ (pobj->det).s.p = pnew;
+ if (pind < (pobj->det).s.n) {
+ num = (pobj->det).s.n - pind;
+ for (i = 0; i < num; i++) {
+ ((pobj->det).s.p)[(pobj->det).s.n - i].x =
+ ((pobj->det).s.p)[(pobj->det).s.n - i - 1].x;
+ ((pobj->det).s.p)[(pobj->det).s.n - i].y =
+ ((pobj->det).s.p)[(pobj->det).s.n - i - 1].y;
+ ((pobj->det).s.p)[(pobj->det).s.n - i].s =
+ ((pobj->det).s.p)[(pobj->det).s.n - i - 1].s;
+ }
+ }
+ else {
+ ((pobj->det).s.p)[(pobj->det).s.n].x =
+ ((pobj->det).s.p)[(pobj->det).s.n - 1].x;
+ ((pobj->det).s.p)[(pobj->det).s.n].y =
+ ((pobj->det).s.p)[(pobj->det).s.n - 1].y;
+ ((pobj->det).s.p)[(pobj->det).s.n].s =
+ ((pobj->det).s.p)[(pobj->det).s.n - 1].s;
+ }
+ (pobj->det).s.n = nn;
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ dk4error_copy(erp, &er);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 3210 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_del_splinepoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ Wxd_spline_point_t *pnew;
+ size_t btc;
+ uint16_t num;
+ uint16_t i;
+ uint16_t nn;
+ bool back = false;
+
+
+#line 3229 "WxdkdrawObj.cpt"
+
+
+#line 3230 "WxdkdrawObj.cpt"
+ if (
+ (NULL != pobj)
+ && (
+ (WXD_OT_O_SPLINE == pobj->ot)
+ || (WXD_OT_C_SPLINE == pobj->ot)
+ )
+ ) {
+
+#line 3237 "WxdkdrawObj.cpt"
+
+
+#line 3238 "WxdkdrawObj.cpt"
+ back = true;
+ if (pind < ((pobj->det).s.n - 1U)) {
+
+#line 3240 "WxdkdrawObj.cpt"
+ num = (pobj->det).s.n - 1U - pind;
+ for (i = 0U; i < num; i++) {
+ ((pobj->det).s.p)[pind + i].x =
+ ((pobj->det).s.p)[pind + i + 1U].x;
+ ((pobj->det).s.p)[pind + i].y =
+ ((pobj->det).s.p)[pind + i + 1U].y;
+ ((pobj->det).s.p)[pind + i].s =
+ ((pobj->det).s.p)[pind + i + 1U].s;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3252 "WxdkdrawObj.cpt"
+ }
+#endif
+ nn = (pobj->det).s.n - 1U;
+ pnew = dk4mem_new(Wxd_spline_point_t,((size_t)nn),erp);
+ if (NULL != pnew) {
+
+#line 3257 "WxdkdrawObj.cpt"
+ btc = sizeof(Wxd_spline_point_t) * ((size_t)nn);
+ DK4_MEMCPY(pnew,(pobj->det).s.p,btc);
+ dk4mem_free((pobj->det).s.p);
+ (pobj->det).s.p = pnew;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3264 "WxdkdrawObj.cpt"
+ }
+#endif
+ (pobj->det).s.n = (pobj->det).s.n - 1U;
+
+
+#line 3268 "WxdkdrawObj.cpt"
+ }
+ else {
+
+#line 3270 "WxdkdrawObj.cpt"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 3273 "WxdkdrawObj.cpt"
+
+
+#line 3274 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_arc(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ int cl,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3289 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_arc(cl, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 3299 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_circle(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3313 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_circle(ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 3323 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_ellipse(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3337 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_ellipse(ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 3347 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_box(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3361 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_box(ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 3371 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_image(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ wxChar const *fn,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3386 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_image(fn, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 3396 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_dot(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ int wh,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3411 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_dot(wh, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 3421 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_textlabel(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ wxChar const *te,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3436 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != te)) {
+ back = wxdobj_obj_new_textlabel(te, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back= NULL;
+ }
+ }
+ }
+
+
+#line 3446 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_find_group_for(Wxd_drawing_t *pdrw, Wxd_object_t *pobj)
+{
+ Wxd_object_t *back = NULL;
+
+
+#line 3456 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ back = i_find_group_for(pdrw, pobj);
+ }
+
+
+#line 3460 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+int
+wxdobj_find_layer_structure(Wxd_drawing_t *pdrw, Wxd_object_t *pobj)
+{
+ int back = 0;
+
+
+#line 3470 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ back = i_find_layer_structure(pdrw, pobj);
+ }
+
+#line 3473 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+/** Modify object layer internally.
+ @param pdrw Drawing to modify.
+ @param pobj Object to modify.
+ @param nl New layer differing from objects current layer.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+i_modify_layer(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj,
+ int16_t nl
+)
+{
+ Wxd_layer_t *playold; /* Old layer structure */
+ Wxd_object_t *pgrp; /* Group containing the object */
+ int back = 0; /* Result */
+
+
+#line 3497 "WxdkdrawObj.cpt"
+ playold = pobj->play;
+ pobj->play = NULL;
+ if (NULL != dk4sto_it_find_exact(pdrw->i_flat, pobj)) {
+ /*
+ In flat list
+ */
+ if (NULL != dk4sto_it_find_exact(pdrw->i_stru, pobj)) {
+ /*
+ Top-level element
+ */
+ dk4sto_remove(pdrw->s_stru, pobj, NULL);
+ dk4sto_remove(pdrw->s_flat, pobj, NULL);
+ pobj->lay = nl;
+ back = wxdobj_drw_register_object(pdrw, NULL, pobj);
+ if (0 == back) {
+
+#line 3512 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(pobj);
+ }
+ wxdobj_drw_require_redraw(pdrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+ /*
+ Member of a group
+ */
+ pgrp = i_find_group_for(pdrw, pobj);
+ if (NULL != pgrp) {
+ /*
+ Group found
+ */
+ dk4sto_remove((pgrp->det).g.s_e, pobj, NULL);
+ dk4sto_remove(pdrw->s_flat, pobj, NULL);
+ pobj->lay = nl;
+ back = wxdobj_drw_register_object(pdrw, pgrp, pobj);
+ if (0 == back) {
+
+#line 3530 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(pobj);
+ }
+ wxdobj_drw_require_redraw(pdrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+
+#line 3535 "WxdkdrawObj.cpt"
+ /*
+ Group not found
+ */
+ }
+ }
+ }
+ else {
+
+#line 3542 "WxdkdrawObj.cpt"
+ /*
+ Not in flat list
+ */
+ }
+ /*
+ Find layer structure
+ */
+ if (0 != back) {
+ back = i_find_layer_structure(pdrw, pobj);
+ }
+
+ /* Remove playold from drawing if not used by other objects */
+ if (NULL != playold) { i_check_layer_structure_removal(pdrw, playold); }
+
+
+#line 3556 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+int
+wxdobj_modify_layer(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj,
+ int16_t nl
+)
+{
+ int back = 0;
+
+
+#line 3570 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (pobj->lay != nl) {
+ back = i_modify_layer(pdrw, pobj, nl);
+ }
+ else {
+ back = 1;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3580 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 3583 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+
+void
+wxdobj_bb_correct(Wxd_bb_t *bbptr, uint16_t *ppoint)
+{
+ int32_t x;
+
+
+#line 3594 "WxdkdrawObj.cpt"
+ if (NULL != bbptr) {
+ if (bbptr->xl > bbptr->xr) {
+ if (bbptr->yb > bbptr->yt) {
+ x = bbptr->xl;
+ bbptr->xl = bbptr->xr;
+ bbptr->xr = x;
+ x = bbptr->yb;
+ bbptr->yb = bbptr->yt;
+ bbptr->yt = x;
+ if (NULL != ppoint) {
+ switch ( (int)(*ppoint) ) {
+ case 3 : {
+ *ppoint = (uint16_t)0U;
+ } break;
+ case 2 : {
+ *ppoint = (uint16_t)0U;
+ } break;
+ case 1 : {
+ *ppoint = (uint16_t)3U;
+ } break;
+ default : {
+ *ppoint = (uint16_t)2U;
+ } break;
+ }
+ }
+ }
+ else {
+ x = bbptr->xl;
+ bbptr->xl = bbptr->xr;
+ bbptr->xr = x;
+ if (NULL != ppoint) {
+ switch ( (int)(*ppoint) ) {
+ case 3 : {
+ *ppoint = (uint16_t)2U;
+ } break;
+ case 2 : {
+ *ppoint = (uint16_t)3U;
+ } break;
+ case 1 : {
+ *ppoint = (uint16_t)0U;
+ } break;
+ default : {
+ *ppoint = (uint16_t)1U;
+ } break;
+ }
+ }
+ }
+ }
+ else {
+ if (bbptr->yb > bbptr->yt) {
+ x = bbptr->yb;
+ bbptr->yb = bbptr->yt;
+ bbptr->yt = x;
+ if (NULL != ppoint) {
+ switch ( (int)(*ppoint) ) {
+ case 3 : {
+ *ppoint = (uint16_t)0U;
+ } break;
+ case 2 : {
+ *ppoint = (uint16_t)1U;
+ } break;
+ case 1 : {
+ *ppoint = (uint16_t)2U;
+ } break;
+ default : {
+ *ppoint = (uint16_t)3U;
+ } break;
+ }
+ }
+ }
+ }
+ }
+
+#line 3666 "WxdkdrawObj.cpt"
+}
+
+
+
+bool
+wxdobj_bb_is_null_area(Wxd_bb_t *bbptr)
+{
+ bool back = false;
+
+
+#line 3675 "WxdkdrawObj.cpt"
+ if (NULL != bbptr) {
+ if (bbptr->xl >= bbptr->xr) {
+ back = true;
+ }
+ if (bbptr->yb >= bbptr->yt) {
+ back = true;
+ }
+ }
+
+#line 3683 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+static
+int32_t
+wxdobj_i32_max(int32_t a, int32_t b)
+{
+ return ((a >= b) ? (a) : (b));
+}
+
+
+
+static
+int32_t
+wxdobj_i32_min(int32_t a, int32_t b)
+{
+ return ((a <= b) ? (a) : (b));
+}
+
+
+
+bool
+wxdobj_bb_intersection(
+ Wxd_bb_t *res,
+ Wxd_bb_t const *a,
+ Wxd_bb_t const *b
+)
+{
+ if ((NULL == res) || (NULL == a) || (NULL == b)) {
+ return false;
+ }
+ if (a->xr < b->xl) return false;
+ if (b->xr < a->xl) return false;
+ if (a->yt < b->yb) return false;
+ if (b->yt < a->yb) return false;
+ res->xl = wxdobj_i32_max(a->xl, b->xl);
+ res->xr = wxdobj_i32_min(a->xr, b->xr);
+ res->yb = wxdobj_i32_max(a->yb, b->yb);
+ res->yt = wxdobj_i32_min(a->yt, b->yt);
+ return true;
+}
+
+
+
+static
+dk4_bif_t *
+wxdobj_image_bif_open(
+ Wxd_object_t *pobj,
+ int dkenc,
+ int wxenc
+)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ dk4_bif_t *back = NULL;
+ const size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+ int res;
+
+
+#line 3742 "WxdkdrawObj.cpt"
+ res = dk4recwx_wxchar_to_dkchar(
+ fnb, szfnb, dkenc, (pobj->det).i.fn, wxenc, NULL
+ );
+ if (0 != res) {
+ back = dk4bif_open(fnb, 1, NULL, NULL);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3750 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 3753 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+void
+wxdobj_image_placement(
+ Wxd_object_t *pobj
+)
+{
+ double iw; /* Image width */
+ double ih; /* Image height */
+ double sw; /* Scale factor for width */
+ double sh; /* Scale factor for height */
+ double l; /* Length */
+ double b; /* Border */
+
+
+#line 3770 "WxdkdrawObj.cpt"
+
+
+#line 3771 "WxdkdrawObj.cpt"
+
+
+#line 3772 "WxdkdrawObj.cpt"
+
+
+#line 3773 "WxdkdrawObj.cpt"
+
+
+#line 3774 "WxdkdrawObj.cpt"
+ if (0 != ((uint16_t)(WXD_IMFL_ASPECT) & (pobj->det).i.fl)) {
+
+
+#line 3776 "WxdkdrawObj.cpt"
+ wxSize wxsz = ((pobj->det).i.bm)->GetSize();
+ iw = (double)(wxsz.GetWidth());
+ ih = (double)(wxsz.GetHeight());
+ if (
+ (0.0 < (pobj->det).i.xres) && (0.0 < (pobj->det).i.yres)
+ && ((pobj->det).i.xres != (pobj->det).i.yres)
+ ) {
+
+#line 3783 "WxdkdrawObj.cpt"
+ iw = iw / (pobj->det).i.xres;
+ ih = ih / (pobj->det).i.yres;
+ }
+ sw = (
+ (double)((pobj->det).i.br.xr) - (double)((pobj->det).i.br.xl)
+ ) / iw;
+ sh = (
+ (double)((pobj->det).i.br.yt) - (double)((pobj->det).i.br.yb)
+ ) / ih;
+ if (sw <= sh) {
+
+#line 3793 "WxdkdrawObj.cpt"
+ (pobj->det).i.pl.xmin = (pobj->det).i.br.xl;
+ (pobj->det).i.pl.xmax = (pobj->det).i.br.xr;
+ l = sw * ih;
+ b = (double)((pobj->det).i.br.yt) - (double)((pobj->det).i.br.yb);
+ b = (b - l) / 2.0;
+ (pobj->det).i.pl.ymin = (pobj->det).i.br.yb + b;
+ (pobj->det).i.pl.ymax = (pobj->det).i.br.yt - b;
+ }
+ else {
+
+#line 3802 "WxdkdrawObj.cpt"
+ (pobj->det).i.pl.ymin = (pobj->det).i.br.yb;
+ (pobj->det).i.pl.ymax = (pobj->det).i.br.yt;
+ l = sh * iw;
+ b = (double)((pobj->det).i.br.xr) - (double)((pobj->det).i.br.xl);
+ b = (b - l) / 2.0;
+ (pobj->det).i.pl.xmin = (pobj->det).i.br.xl + b;
+ (pobj->det).i.pl.xmax = (pobj->det).i.br.xr - b;
+ }
+ }
+ else {
+
+#line 3812 "WxdkdrawObj.cpt"
+ (pobj->det).i.pl.xmin = (pobj->det).i.br.xl;
+ (pobj->det).i.pl.xmax = (pobj->det).i.br.xr;
+ (pobj->det).i.pl.ymin = (pobj->det).i.br.yb;
+ (pobj->det).i.pl.ymax = (pobj->det).i.br.yt;
+ }
+
+
+#line 3818 "WxdkdrawObj.cpt"
+
+
+#line 3819 "WxdkdrawObj.cpt"
+
+
+#line 3820 "WxdkdrawObj.cpt"
+
+
+#line 3821 "WxdkdrawObj.cpt"
+
+
+#line 3822 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_load_image(
+ Wxd_object_t *pobj,
+ int dkenc,
+ int wxenc
+)
+{
+ dk4_bif_t *bifptr;
+ wxString strfn((pobj->det).i.fn);
+
+
+#line 3836 "WxdkdrawObj.cpt"
+ if (NULL == (pobj->det).i.bm) {
+
+#line 3837 "WxdkdrawObj.cpt"
+ (pobj->det).i.xres = -1.0;
+ (pobj->det).i.yres = -1.0;
+ (pobj->det).i.t = wxdobj_image_type((pobj->det).i.fn);
+ if (wxBITMAP_TYPE_INVALID != (pobj->det).i.t) {
+ (pobj->det).i.bm = new wxBitmap(
+ strfn, (pobj->det).i.t
+ );
+ if (NULL != (pobj->det).i.bm) {
+
+#line 3845 "WxdkdrawObj.cpt"
+ if (!(((pobj->det).i.bm)->IsOk())) {
+
+#line 3846 "WxdkdrawObj.cpt"
+ delete ((pobj->det).i.bm);
+ (pobj->det).i.bm = NULL;
+ }
+ }
+ if (NULL != (pobj->det).i.bm) {
+
+#line 3851 "WxdkdrawObj.cpt"
+ if (0 != ((uint16_t)(WXD_IMFL_ASPECT) & (pobj->det).i.fl)) {
+
+
+#line 3853 "WxdkdrawObj.cpt"
+ bifptr = wxdobj_image_bif_open(pobj, dkenc, wxenc);
+ if (NULL != bifptr) {
+ (pobj->det).i.xres = dk4bif_get_xres(bifptr);
+ (pobj->det).i.yres = dk4bif_get_yres(bifptr);
+
+
+#line 3858 "WxdkdrawObj.cpt"
+
+
+#line 3859 "WxdkdrawObj.cpt"
+ dk4bif_close(bifptr);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3864 "WxdkdrawObj.cpt"
+ }
+#endif
+ wxdobj_image_placement(pobj);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3870 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3875 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3880 "WxdkdrawObj.cpt"
+ }
+#endif
+
+
+#line 3883 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_unmark_recursively(Wxd_object_t *pobj, uint8_t marker)
+{
+ Wxd_object_t *po;
+
+
+#line 3892 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ pobj->mark &= (~(marker));
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) {
+ wxdobj_unmark_recursively(po, marker);
+ }
+ } while (NULL != po);
+ }
+ }
+
+
+#line 3905 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_unmark_all(Wxd_drawing_t *pdrw, uint8_t marker)
+{
+ Wxd_object_t *pobj;
+
+
+#line 3914 "WxdkdrawObj.cpt"
+ uint8_t mask;
+
+ mask = (~(marker));
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ pobj->mark &= mask;
+ }
+ } while (NULL != pobj);
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pobj) {
+ pobj->mark &= mask;
+ }
+ } while (NULL != pobj);
+
+
+#line 3932 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_mark_recursively(Wxd_object_t *pobj, uint8_t marker)
+{
+ Wxd_object_t *po;
+
+
+#line 3941 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ pobj->mark |= marker;
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) {
+ wxdobj_mark_recursively(po, marker);
+ }
+ } while (NULL != po);
+ }
+ }
+
+
+#line 3954 "WxdkdrawObj.cpt"
+}
+
+
+
+/** Find sector for point relative to box.
+ @param pbox Box.
+ @param r Rounded corners radius.
+ @param ppt Point.
+ @return Sector number, one from:
+ - 0: Point is lower left than box center.
+ - 1: Point is centered below box.
+ - 2: Point is lower right than box center.
+ - 3: Point is left from box center.
+ - 4: Point is in box center.
+ - 5: Point is right from box center.
+ - 6: Point is upper left from box center.
+ - 7: Point is centered over box.
+ - 8: Point is upper right from box center.
+*/
+static
+int
+wxdobj_box_sector(Wxd_bb_t *pbox, uint32_t r, dk4_gra_point_t *ppt)
+{
+ int back = 4;
+
+
+#line 3979 "WxdkdrawObj.cpt"
+ if (ppt->x < (double)(pbox->xl) + (double)r) {
+ /* X: left */
+ if (ppt->y < (double)(pbox->yb) + (double)r) {
+ back = 0;
+ }
+ else {
+ if (ppt->y > (double)(pbox->yt) - (double)r) {
+ back = 6;
+ }
+ else {
+ back = 3;
+ }
+ }
+ }
+ else {
+ if (ppt->x > (double)(pbox->xr) - (double)r) {
+ /* X: right */
+ if (ppt->y < (double)(pbox->yb) + (double)r) {
+ back = 2;
+ }
+ else {
+ if (ppt->y > (double)(pbox->yt) - (double)r) {
+ back = 8;
+ }
+ else {
+ back = 5;
+ }
+ }
+ }
+ else {
+ /* X: centered */
+ if (ppt->y < (double)(pbox->yb) + (double)r) {
+ back = 1;
+ }
+ else {
+ if (ppt->y > (double)(pbox->yt) - (double)r) {
+ back = 7;
+ }
+ }
+
+ }
+ }
+
+#line 4021 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+double
+wxdobj_dist_box(
+ Wxd_bb_t *pbox,
+ uint32_t r,
+ dk4_gra_point_t *ppt,
+ bool bCtrlPt,
+ uint16_t *pIndex
+)
+{
+ dk4_gra_point_t pta;
+ dk4_gra_point_t ptb;
+ double d;
+ double back = -1.0;
+ uint16_t n;
+
+
+#line 4041 "WxdkdrawObj.cpt"
+ if (bCtrlPt) {
+ pta.x = (double)(pbox->xl);
+ pta.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ n = 0;
+ pta.x = (double)(pbox->xr);
+ pta.y = (double)(pbox->yb);
+ d = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ if (d < back) {
+ back = d;
+ n = 1;
+ }
+ pta.x = (double)(pbox->xr);
+ pta.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ if (d < back) {
+ back = d;
+ n = 2;
+ }
+ pta.x = (double)(pbox->xl);
+ pta.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ if (d < back) {
+ back = d;
+ n = 3;
+ }
+ if (NULL != pIndex) {
+ *pIndex = n;
+ }
+ }
+ else {
+ if ((uint32_t)0UL == r) {
+ pta.x = (double)(pbox->xl);
+ pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xr);
+ ptb.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ pta.x = (double)(pbox->xr);
+ pta.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ ptb.x = (double)(pbox->xl);
+ ptb.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ pta.x = (double)(pbox->xl);
+ pta.y = (double)(pbox->yb);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ }
+ else {
+ switch (wxdobj_box_sector(pbox, r, ppt)) {
+ case 0: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ back = fabs(back - (double)r);
+ } break;
+ case 1: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xr); ptb.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ } break;
+ case 2: {
+ pta.x = (double)(pbox->xr); pta.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ back = fabs(back - (double)r);
+ } break;
+ case 3: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xl); ptb.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ } break;
+ case 5: {
+ pta.x = (double)(pbox->xr); pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xr); ptb.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ } break;
+ case 6: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ back = fabs(back - (double)r);
+ } break;
+ case 7: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yt);
+ ptb.x = (double)(pbox->xr); ptb.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ } break;
+ case 8: {
+ pta.x = (double)(pbox->xr); pta.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ back = fabs(back - (double)r);
+ } break;
+ default : {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xr); ptb.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ pta.x = (double)(pbox->xr); pta.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ ptb.x = (double)(pbox->xl); ptb.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ } break;
+ }
+ }
+ }
+
+
+#line 4151 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_ctrlpt_dist_box(
+ Wxd_bb_t *pbox,
+ dk4_gra_point_t *ppt,
+ uint16_t *pIndex,
+ double dlim
+)
+{
+ double d;
+ uint16_t ind = (uint16_t)0U;
+ bool back = false;
+
+ d = wxdobj_dist_box(pbox, (uint32_t)0UL, ppt, true, &ind);
+ if (dlim >= d) {
+ *pIndex = ind;
+ back = true;
+ }
+ return back;
+}
+
+
+
+static
+double
+wxdobj_dist_dot(
+ Wxd_object_t *pobj,
+ dk4_gra_point_t *grapt
+)
+{
+ dk4_gra_point_t pta;
+ double back = 0.0;
+ double r;
+
+
+#line 4189 "WxdkdrawObj.cpt"
+ pta.x = (double)((pobj->det).d.x);
+ pta.y = (double)((pobj->det).d.y);
+ back = dk4gratool_dist_point_point(grapt, &pta, NULL);
+ /* (d / 2) * (16256000 / 160) */
+ r = 50800.0 * (double)((pobj->det).d.d);
+ if (WXD_OT_DOT_WHITE == pobj->ot) {
+ r += 101600.0;
+ }
+ if (back > r) {
+ back = back - r;
+ }
+
+#line 4200 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+double
+wxdobj_distance_to_point(
+ Wxd_object_t *pobj,
+ Wxd_point_t const *ppt,
+ bool bCtrlPt,
+ uint16_t *pIndex
+)
+{
+ dk4_gra_point_t grapt; /* Point to test in double coords */
+ dk4_gra_point_t pta; /* Section start point */
+ dk4_gra_point_t ptb; /* Section end point */
+ double back = -1.0; /* Result distance */
+ double d; /* Distance in current test */
+ double alpha; /* Ellipse rotation in degree */
+ uint16_t i; /* Traverse point array */
+
+
+#line 4221 "WxdkdrawObj.cpt"
+ grapt.x = (double)(ppt->x);
+ grapt.y = (double)(ppt->y);
+ switch ( pobj->ot ) {
+ case WXD_OT_TEXT : {
+ pta.x = (double)((pobj->det).t.x);
+ pta.y = (double)((pobj->det).t.y);
+ back = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if (bCtrlPt && (NULL != pIndex)) { *pIndex = (uint16_t)0U; }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (pobj->det).p.p) && (1 < (pobj->det).p.n)) {
+ if (bCtrlPt) {
+ for (i = 0; i < (pobj->det).p.n; i++) {
+ pta.x = (double)(((pobj->det).p.p)[i].x);
+ pta.y = (double)(((pobj->det).p.p)[i].y);
+ d = dk4gratool_dist_point_point(&pta, &grapt, NULL);
+ if (0 == i) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ }
+ else {
+ if (d < back) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)i; }
+ }
+ }
+ }
+ }
+ else {
+ pta.x = (double)(((pobj->det).p.p)[0].x);
+ pta.y = (double)(((pobj->det).p.p)[0].y);
+ for (i = 0; i < ((pobj->det).p.n - (uint16_t)1U); i++) {
+ ptb.x =
+ (double)(((pobj->det).p.p)[i + (uint16_t)1U].x);
+ ptb.y =
+ (double)(((pobj->det).p.p)[i + (uint16_t)1U].y);
+ d = dk4gratool_dist_point_track(&pta,&ptb,&grapt,NULL);
+ if (0.0 < d) {
+ if ((0.0 > back) || (d < back)) { back = d; }
+ }
+ DK4_MEMCPY(&pta,&ptb,sizeof(dk4_gra_point_t));
+ }
+ if (WXD_OT_POLYGON == pobj->ot) {
+ ptb.x = (double)(((pobj->det).p.p)[0].x);
+ ptb.y = (double)(((pobj->det).p.p)[0].y);
+ d = dk4gratool_dist_point_track(&pta,&ptb,&grapt,NULL);
+ if (0.0 < d) {
+ if ((0.0 > back) || (d < back)) { back = d; }
+ }
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (pobj->det).s.p) && (1 < (pobj->det).s.n)) {
+ if (bCtrlPt) {
+ for (i = 0; i < (pobj->det).s.n; i++) {
+ pta.x = (double)(((pobj->det).s.p)[i].x);
+ pta.y = (double)(((pobj->det).s.p)[i].y);
+ d = dk4gratool_dist_point_point(&pta, &grapt, NULL);
+ if (0 == i) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ }
+ else {
+ if (d < back) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)i; }
+ }
+ }
+ }
+ }
+ else {
+ pta.x = (double)(((pobj->det).s.p)[0].x);
+ pta.y = (double)(((pobj->det).s.p)[0].y);
+ for (i = 0; i < ((pobj->det).s.n - (uint16_t)1U); i++) {
+ ptb.x =
+ (double)(((pobj->det).s.p)[i + (uint16_t)1U].x);
+ ptb.y =
+ (double)(((pobj->det).s.p)[i + (uint16_t)1U].y);
+ d = dk4gratool_dist_point_track(&pta,&ptb,&grapt,NULL);
+ if (0.0 < d) {
+ if ((0.0 > back) || (d < back)) { back = d; }
+ }
+ DK4_MEMCPY(&pta,&ptb,sizeof(dk4_gra_point_t));
+ }
+ if (WXD_OT_C_SPLINE == pobj->ot) {
+ ptb.x = (double)(((pobj->det).s.p)[0].x);
+ ptb.y = (double)(((pobj->det).s.p)[0].y);
+ d = dk4gratool_dist_point_track(&pta,&ptb,&grapt,NULL);
+ if (0.0 < d) {
+ if ((0.0 > back) || (d < back)) { back = d; }
+ }
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ pta.x = (double)((pobj->det).a.x1);
+ pta.y = (double)((pobj->det).a.y1);
+ back = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ pta.x = (double)((pobj->det).a.x2);
+ pta.y = (double)((pobj->det).a.y2);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if ((0.0 <= d) && (d < back)) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)1U; }
+ }
+ pta.x = (double)((pobj->det).a.x3);
+ pta.y = (double)((pobj->det).a.y3);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if ((0.0 <= d) && (d < back)) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)2U; }
+ }
+ if ((WXD_OT_C_ARC == pobj->ot) && (!(bCtrlPt))) {
+ if (0 != (pobj->det).a.d) {
+ pta.x = (double)((pobj->det).a.x1);
+ pta.y = (double)((pobj->det).a.y1);
+ ptb.x = (pobj->det).a.x;
+ ptb.y = (pobj->det).a.y;
+ d = dk4gratool_dist_point_track(&pta, &ptb, &grapt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ pta.x = (double)((pobj->det).a.x3);
+ pta.y = (double)((pobj->det).a.y3);
+ d = dk4gratool_dist_point_track(&pta, &ptb, &grapt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ }
+ }
+ } break;
+ case WXD_OT_CIRCLE : {
+ if (bCtrlPt) {
+ for (i = 0; i < 4; i++) {
+ switch (i) {
+ case 0 : {
+ pta.x = (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 1 : {
+ pta.x = 0.0;
+ pta.y = (double)((pobj->det).e.rx);
+ } break;
+ case 2 : {
+ pta.x = 0.0 - (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 3 : {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((pobj->det).e.rx);
+ } break;
+ }
+ pta.x += (double)((pobj->det).e.x);
+ pta.y += (double)((pobj->det).e.y);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if (0 == i) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = i; }
+ }
+ else {
+ if (d < back) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = i; }
+ }
+ }
+ }
+ if (NULL != pIndex) {
+
+
+#line 4389 "WxdkdrawObj.cpt"
+ }
+
+ }
+ else {
+ pta.x = (double)((pobj->det).e.x);
+ pta.y = (double)((pobj->det).e.y);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ d = d - (double)((pobj->det).e.rx);
+ back = fabs(d);
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ if (bCtrlPt) {
+
+#line 4403 "WxdkdrawObj.cpt"
+ alpha = (M_PI * (double)((pobj->det).e.a)) / 180.0;
+ for (i = 0; i < 4; i++) {
+ switch (i) {
+ case 0 : {
+ pta.x = (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 1 : {
+ pta.x = 0.0;
+ pta.y = (double)((pobj->det).e.ry);
+ } break;
+ case 2 : {
+ pta.x = 0.0 - (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 3 : {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((pobj->det).e.ry);
+ } break;
+ }
+ dk4gratool_rotate_point(&pta, alpha);
+ pta.x += (double)((pobj->det).e.x);
+ pta.y += (double)((pobj->det).e.y);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if (0 == i) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = i; }
+ }
+ else {
+ if (d < back) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = i; }
+ }
+ }
+ }
+ if (NULL != pIndex) {
+
+
+#line 4440 "WxdkdrawObj.cpt"
+ }
+ }
+ else {
+ pta.x = (double)((pobj->det).e.x);
+ pta.y = (double)((pobj->det).e.y);
+ back = dk4gratool_dist_point_ellipse(
+ &pta,(double)((pobj->det).e.rx),(double)((pobj->det).e.ry),
+ ((M_PI * (double)((pobj->det).e.a)) / 180.0), &grapt, NULL
+ );
+ }
+ } break;
+ case WXD_OT_BOX : {
+ back = wxdobj_dist_box(
+ &((pobj->det).b.b), (pobj->det).b.r, &grapt, bCtrlPt, pIndex
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxdobj_dist_box(
+ &((pobj->det).i.br), 0UL, &grapt, bCtrlPt, pIndex
+ );
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ back = wxdobj_dist_dot(pobj, &grapt);
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ } break;
+ }
+
+#line 4466 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_stipple_t *
+wxdobj_find_stipple_structure(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ return (i_find_stipple_structure(pdrw,pobj));
+ }
+ return NULL;
+}
+
+
+
+void
+wxdobj_remove_unused_stipples(
+ Wxd_drawing_t *pdrw
+)
+{
+ Wxd_stipple_t *pstip;
+ Wxd_object_t *pobj;
+ bool changed;
+
+
+#line 4494 "WxdkdrawObj.cpt"
+ /*
+ Mark all stipples as unused
+ */
+ dk4sto_it_reset(pdrw->i_stip);
+ do {
+ pstip = (Wxd_stipple_t *)dk4sto_it_next(pdrw->i_stip);
+ if (NULL != pstip) {
+ pstip->cd[7] = 0x00;
+ }
+ } while (NULL != pstip);
+ /*
+ Mark used stipples
+ */
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ if (NULL != pobj->psti) {
+ pobj->psti->cd[7] = 0x01;
+ }
+ }
+ } while (NULL != pobj);
+ /*
+ Remove stipples not marked as used
+ */
+ do {
+ changed = false;
+ dk4sto_it_reset(pdrw->i_stip);
+ do {
+ pstip = (Wxd_stipple_t *)dk4sto_it_next(pdrw->i_stip);
+ if (NULL != pstip) {
+ if (0x00 == pstip->cd[7]) {
+
+
+#line 4527 "WxdkdrawObj.cpt"
+#if TRACE_DEBUG
+ for (size_t i = 0; i < 8; i++) {
+
+
+#line 4530 "WxdkdrawObj.cpt"
+ }
+
+
+#line 4532 "WxdkdrawObj.cpt"
+#endif
+ changed = true;
+ dk4sto_remove(pdrw->s_stip, pstip, NULL);
+ if (NULL != pstip->bm) {
+ delete (pstip->bm);
+ }
+ dk4mem_free(pstip);
+ }
+ }
+ } while ((NULL != pstip) && (!(changed)));
+ } while (changed);
+
+
+#line 4544 "WxdkdrawObj.cpt"
+}
+
+
+
+void
+wxdobj_remove_unused_fonts(
+ Wxd_drawing_t *pdrw
+)
+{
+ Wxd_font_t *pfont;
+ Wxd_object_t *pobj;
+ bool changed;
+
+
+#line 4557 "WxdkdrawObj.cpt"
+ /* Mark all fonts as unused
+ */
+ dk4sto_it_reset(pdrw->i_fonts);
+ do {
+ pfont = (Wxd_font_t *)dk4sto_it_next(pdrw->i_fonts);
+ if (NULL != pfont) {
+ pfont->used = false;
+ }
+ } while (NULL != pfont);
+ /*
+ Mark used fonts
+ */
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ if (WXD_OT_TEXT == pobj->ot) {
+ if (NULL != (pobj->det).t.font) {
+ ((pobj->det).t.font)->used = true;
+ }
+ }
+ }
+ } while (NULL != pobj);
+ /*
+ Remove fonts not marked as used
+ */
+ do {
+ changed = false;
+ dk4sto_it_reset(pdrw->i_fonts);
+ do {
+ pfont = (Wxd_font_t *)dk4sto_it_next(pdrw->i_fonts);
+ if (NULL != pfont) {
+ if (!(pfont->used)) {
+ changed = true;
+ dk4sto_remove(pdrw->s_fonts, pfont, NULL);
+ if (NULL != pfont->font) {
+ delete (pfont->font);
+ pfont->font = NULL;
+ }
+ dk4mem_free(pfont);
+ }
+ }
+ } while ((NULL != pfont) && (!(changed)));
+ } while (changed);
+
+
+#line 4602 "WxdkdrawObj.cpt"
+}
+
+
+
+size_t
+wxdobj_get_number_of_layers(
+ Wxd_drawing_t *pdrw
+)
+{
+ size_t back = 0U;
+
+
+#line 4613 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ if (NULL != pdrw->i_layers) {
+ dk4sto_it_reset(pdrw->i_layers);
+ while (NULL != dk4sto_it_next(pdrw->i_layers)) { back++; }
+ }
+ }
+
+#line 4619 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+void
+wxdobj_obj_delete_from_drawing(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ Wxd_object_t *po;
+ Wxd_object_t *pn;
+
+
+#line 4633 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+
+#line 4635 "WxdkdrawObj.cpt"
+ dk4sto_remove(pdrw->s_stru, (void *)pobj, NULL);
+ pobj->pa = NULL;
+ dk4sto_it_reset((pobj->det).g.i_e);
+ while (NULL != pobj) {
+
+#line 4639 "WxdkdrawObj.cpt"
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) {
+
+#line 4641 "WxdkdrawObj.cpt"
+ if (WXD_OT_GROUP_BEGIN == po->ot) {
+
+#line 4642 "WxdkdrawObj.cpt"
+ if (
+ (NULL != (po->det).g.s_e)
+ && (NULL != (po->det).g.i_e)
+ ) {
+
+#line 4646 "WxdkdrawObj.cpt"
+ dk4sto_it_reset((po->det).g.i_e);
+ po->pa = pobj;
+ pobj = po;
+ }
+ else {
+
+#line 4651 "WxdkdrawObj.cpt"
+ wxdobj_obj_delete(po);
+ }
+ }
+ else {
+
+#line 4655 "WxdkdrawObj.cpt"
+ dk4sto_remove(pdrw->s_flat, (void *)po, NULL);
+ wxdobj_obj_delete(po);
+ }
+ }
+ else {
+
+#line 4660 "WxdkdrawObj.cpt"
+ pn = pobj->pa;
+ wxdobj_obj_delete(pobj);
+ pobj = pn;
+ }
+
+
+#line 4665 "WxdkdrawObj.cpt"
+ }
+ }
+ else {
+
+#line 4668 "WxdkdrawObj.cpt"
+ dk4sto_remove(pdrw->s_stru, (void *)pobj, NULL);
+ dk4sto_remove(pdrw->s_flat, (void *)pobj, NULL);
+ wxdobj_obj_delete(pobj);
+ }
+ }
+ else {
+
+#line 4674 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ wxdobj_obj_delete(pobj);
+ }
+ }
+
+
+#line 4679 "WxdkdrawObj.cpt"
+}
+
+
+
+int
+wxdobj_shift(Wxd_object_t *pobj, Wxd_point_t *ppt, int doit)
+{
+ dk4_er_t er;
+ int32_t xdiff = (int32_t)0L;
+ int32_t ydiff = (int32_t)0L;
+ int back = 0;
+ uint16_t i = 0;
+
+
+#line 4692 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ if (NULL != ppt) {
+ xdiff = ppt->x;
+ ydiff = ppt->y;
+ if (((int32_t)0L != xdiff) || ((int32_t)0L != ydiff)) {
+ dk4error_init(&er);
+ back = 1;
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : {
+
+#line 4701 "WxdkdrawObj.cpt"
+ if (0 != doit) {
+ (pobj->det).t.x = dk4ma_int32_t_add(
+ (pobj->det).t.x, xdiff, &er
+ );
+ (pobj->det).t.y = dk4ma_int32_t_add(
+ (pobj->det).t.y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ (pobj->det).t.x, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).t.y, ydiff, &er
+ );
+ }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+
+
+#line 4720 "WxdkdrawObj.cpt"
+ if (
+ (NULL != (pobj->det).p.p)
+ && ((uint16_t)0U < (pobj->det).p.n)
+ ) {
+ for (i = 0; i < (pobj->det).p.n; i++) {
+ if (0 != doit) {
+ ((pobj->det).p.p)[i].x =
+ dk4ma_int32_t_add(
+ ((pobj->det).p.p)[i].x, xdiff, &er
+ );
+ ((pobj->det).p.p)[i].y =
+ dk4ma_int32_t_add(
+ ((pobj->det).p.p)[i].y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ ((pobj->det).p.p)[i].x, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ ((pobj->det).p.p)[i].y, ydiff, &er
+ );
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+
+
+#line 4748 "WxdkdrawObj.cpt"
+ if (
+ (NULL != (pobj->det).s.p)
+ && ((uint16_t)0U < (pobj->det).s.n)
+ ) {
+ for (i = 0; i < (pobj->det).s.n; i++) {
+ if (0 != doit) {
+ ((pobj->det).s.p)[i].x =
+ dk4ma_int32_t_add(
+ ((pobj->det).s.p)[i].x, xdiff, &er
+ );
+ ((pobj->det).s.p)[i].y =
+ dk4ma_int32_t_add(
+ ((pobj->det).s.p)[i].y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ ((pobj->det).s.p)[i].x, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ ((pobj->det).s.p)[i].y, ydiff, &er
+ );
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+
+
+#line 4776 "WxdkdrawObj.cpt"
+ if (0 != doit) {
+ (pobj->det).a.x1 = dk4ma_int32_t_add(
+ (pobj->det).a.x1, xdiff, &er
+ );
+ (pobj->det).a.y1 = dk4ma_int32_t_add(
+ (pobj->det).a.y1, ydiff, &er
+ );
+ (pobj->det).a.x2 = dk4ma_int32_t_add(
+ (pobj->det).a.x2, xdiff, &er
+ );
+ (pobj->det).a.y2 = dk4ma_int32_t_add(
+ (pobj->det).a.y2, ydiff, &er
+ );
+ (pobj->det).a.x3 = dk4ma_int32_t_add(
+ (pobj->det).a.x3, xdiff, &er
+ );
+ (pobj->det).a.y3 = dk4ma_int32_t_add(
+ (pobj->det).a.y3, ydiff, &er
+ );
+ (pobj->det).a.x += (double)xdiff;
+ (pobj->det).a.y += (double)ydiff;
+ }
+ else {
+ (void)dk4ma_int32_t_add((pobj->det).a.x1,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.y1,ydiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.x2,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.y2,ydiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.x3,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.y3,ydiff,&er);
+ }
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+
+
+#line 4809 "WxdkdrawObj.cpt"
+ if (0 != doit) {
+ (pobj->det).e.x = dk4ma_int32_t_add(
+ (pobj->det).e.x, xdiff, &er
+ );
+ (pobj->det).e.y = dk4ma_int32_t_add(
+ (pobj->det).e.y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add((pobj->det).e.x,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).e.y,ydiff,&er);
+ }
+ } break;
+ case WXD_OT_BOX : {
+
+
+#line 4824 "WxdkdrawObj.cpt"
+ if (0 != doit) {
+ (pobj->det).b.b.xl = dk4ma_int32_t_add(
+ (pobj->det).b.b.xl, xdiff, &er
+ );
+ (pobj->det).b.b.xr = dk4ma_int32_t_add(
+ (pobj->det).b.b.xr, xdiff, &er
+ );
+ (pobj->det).b.b.yb = dk4ma_int32_t_add(
+ (pobj->det).b.b.yb, ydiff, &er
+ );
+ (pobj->det).b.b.yt = dk4ma_int32_t_add(
+ (pobj->det).b.b.yt, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ (pobj->det).b.b.xl, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).b.b.xr, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).b.b.yb, ydiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).b.b.yt, ydiff, &er
+ );
+ }
+ } break;
+ case WXD_OT_IMAGE : {
+
+
+#line 4855 "WxdkdrawObj.cpt"
+ if (0 != doit) {
+ (pobj->det).i.br.xl = dk4ma_int32_t_add(
+ (pobj->det).i.br.xl, xdiff, &er
+ );
+ (pobj->det).i.br.xr = dk4ma_int32_t_add(
+ (pobj->det).i.br.xr, xdiff, &er
+ );
+ (pobj->det).i.br.yb = dk4ma_int32_t_add(
+ (pobj->det).i.br.yb, ydiff, &er
+ );
+ (pobj->det).i.br.yt = dk4ma_int32_t_add(
+ (pobj->det).i.br.yt, ydiff, &er
+ );
+ /* Re-calculate image placement
+ */
+ wxdobj_image_placement(pobj);
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ (pobj->det).i.br.xl, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).i.br.xr, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).i.br.yb, ydiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).i.br.yt, ydiff, &er
+ );
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+
+
+#line 4889 "WxdkdrawObj.cpt"
+ if (0 != doit) {
+ (pobj->det).d.x = dk4ma_int32_t_add(
+ (pobj->det).d.x, xdiff, &er
+ );
+ (pobj->det).d.y = dk4ma_int32_t_add(
+ (pobj->det).d.y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add((pobj->det).d.x,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).d.y,ydiff,&er);
+ }
+ } break;
+ }
+ if (DK4_E_NONE != er.ec) {
+ back = 0;
+
+#line 4905 "WxdkdrawObj.cpt"
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+
+
+#line 4916 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+int
+wxdobj_shift_marked(Wxd_drawing_t *pdrw, Wxd_point_t *ppt, int doit)
+{
+ Wxd_object_t *pobj;
+ int back = 0;
+
+
+#line 4927 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = 1;
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ if ((uint8_t)0U != (OBJ_MARKER_1 & (pobj->mark))) {
+ if (0 == wxdobj_shift(pobj, ppt, doit)) {
+ back = 0;
+ }
+ }
+ }
+ } while (NULL != pobj);
+ }
+
+
+#line 4942 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_copy(Wxd_object_t *psrc)
+{
+ Wxd_object_t *back = NULL;
+ wxBitmap *obm = NULL;
+ size_t npt;
+
+
+#line 4954 "WxdkdrawObj.cpt"
+ if (NULL != psrc) {
+ if (WXD_OT_GROUP_BEGIN != psrc->ot) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ DK4_MEMCPY(back,psrc,sizeof(Wxd_object_t));
+ back->pa = NULL;
+ switch (psrc->ot) {
+ case WXD_OT_TEXT : {
+ /* t.t, t.tsc */
+ (back->det).t.t = NULL;
+ (back->det).t.tsc = NULL;
+ (back->det).t.t = dk4strx_dup((psrc->det).t.t, NULL);
+ if (NULL != (back->det).t.t) {
+ if (NULL != (psrc->det).t.tsc) {
+ (back->det).t.tsc =
+ dk4strx_dup((psrc->det).t.tsc, NULL);
+ if (NULL == (back->det).t.tsc) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ else {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ /* p.p */
+ npt = (size_t)((psrc->det).p.n);
+ (back->det).p.p = dk4mem_new(Wxd_point_t, npt, NULL);
+ if (NULL != (back->det).p.p) {
+ npt *= sizeof(Wxd_point_t);
+ DK4_MEMCPY((back->det).p.p,(psrc->det).p.p,npt);
+ }
+ else {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ /* s.p */
+ npt = (size_t)((psrc->det).s.n);
+ (back->det).s.p =
+ dk4mem_new(Wxd_spline_point_t,npt,NULL);
+ if (NULL != (back->det).s.p) {
+ npt *= sizeof(Wxd_spline_point_t);
+ DK4_MEMCPY((back->det).s.p,(psrc->det).s.p,npt);
+ }
+ else {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ } break;
+ case WXD_OT_IMAGE : {
+ /* i.fn, i.bm */
+ (back->det).i.fn = NULL;
+ (back->det).i.bm = NULL;
+ obm = (psrc->det).i.bm;
+ (back->det).i.fn = dk4strx_dup((psrc->det).i.fn, NULL);
+ if (NULL != (back->det).i.fn) {
+ (back->det).i.bm =
+ new wxBitmap(
+ obm->GetSubBitmap(
+ wxRect(0, 0, obm->GetWidth(), obm->GetHeight())
+ )
+ );
+ if (NULL == (back->det).i.bm) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ else {
+ if (!(((back->det).i.bm)->IsOk())) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ else {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ } break;
+ }
+ }
+ }
+ }
+
+#line 5041 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+/** Test whether the entire group contents can be shifted by given vector.
+ @param pgrsrc Group containing objects to shift.
+ @param psh Shift vector.
+ @param doit Flag: Really do shift operation, 0=test only.
+ @return 1 on success, 0 on error (numeric overflow).
+*/
+
+static
+int
+wxdobj_i_group_shift(
+ Wxd_object_t *pgrsrc,
+ Wxd_point_t *psh,
+ int doit
+)
+{
+ Wxd_object_t *pno;
+ int back = 1;
+
+
+#line 5064 "WxdkdrawObj.cpt"
+ pgrsrc->pa = NULL;
+ dk4sto_it_reset((pgrsrc->det).g.i_e);
+ while ((1 == back) && (NULL != pgrsrc)) {
+ pno = (Wxd_object_t *)dk4sto_it_next((pgrsrc->det).g.i_e);
+ if (NULL != pno) {
+ if (WXD_OT_GROUP_BEGIN == pno->ot) {
+ if (
+ (NULL != (pgrsrc->det).g.s_e)
+ && (NULL != (pgrsrc->det).g.i_e)
+ ) {
+ pno->pa = pgrsrc;
+ pgrsrc = pno;
+ dk4sto_it_reset((pgrsrc->det).g.i_e);
+ }
+ }
+ else {
+ if (0 == wxdobj_shift(pno, psh, doit)) {
+ back = 0;
+ }
+ }
+ }
+ else {
+ pgrsrc = pgrsrc->pa;
+ }
+ }
+
+#line 5089 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+/** Test whether the entire group contents can be shifted by given vector.
+ @param pgrsrc Group containing objects to shift.
+ @param psh Shift vector.
+ @return 1 on success, 0 on error (numeric overflow).
+*/
+
+static
+int
+wxdobj_group_test_shift(
+ Wxd_object_t *pgrsrc,
+ Wxd_point_t *psh
+)
+{
+ int back = 0;
+
+
+#line 5109 "WxdkdrawObj.cpt"
+ if (NULL != pgrsrc) {
+ if (NULL != psh) {
+ if (((int32_t)0L != psh->x) || ((int32_t)0L != psh->y)) {
+ back = wxdobj_i_group_shift(pgrsrc, psh, 0);
+ }
+ else {
+
+#line 5115 "WxdkdrawObj.cpt"
+ back = 1;
+ }
+ }
+ else {
+
+#line 5119 "WxdkdrawObj.cpt"
+ back = 1;
+ }
+ }
+
+
+#line 5123 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+
+/** Copy group contents recursively.
+ Both source and destination group object must be root group
+ objects having no parent.
+ @param pdrw Drawing containing both groups.
+ @param pgrdst Destination group.
+ @param pgrsrc Source group.
+ @param psh Shift vector for the copy.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+wxdobj_i_group_copy(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrdst,
+ Wxd_object_t *pgrsrc,
+ Wxd_point_t *psh
+)
+{
+ Wxd_object_t *pso;
+ Wxd_object_t *pdo;
+ int back = 1;
+
+
+#line 5152 "WxdkdrawObj.cpt"
+ dk4sto_it_reset((pgrsrc->det).g.i_e);
+ while ((NULL != pgrsrc) && (NULL != pgrdst) && (1 == back)) {
+ pso = (Wxd_object_t *)dk4sto_it_next((pgrsrc->det).g.i_e);
+ if (NULL != pso) {
+ if (WXD_OT_GROUP_BEGIN == pso->ot) {
+ if (
+ (NULL != (pso->det).g.s_e)
+ && (NULL != (pso->det).g.i_e)
+ ) {
+ pdo = wxdobj_drw_add_group(pdrw, pgrdst);
+ if (NULL != pdo) {
+ dk4sto_it_reset((pso->det).g.i_e);
+ pgrsrc = pso;
+ pgrdst = pdo;
+ }
+ else {
+ back = 0;
+ }
+ }
+ }
+ else {
+ pdo = wxdobj_copy(pso);
+ if (NULL != pdo) {
+ if (0 != wxdobj_drw_register_object(pdrw, pgrdst, pdo)) {
+ wxdobj_shift(pdo, psh, 1);
+ }
+ else {
+ wxdobj_obj_delete(pdo);
+ back = 0;
+ }
+ }
+ else {
+ back = 0;
+ }
+ }
+ }
+ else {
+ pgrsrc = pgrsrc->pa;
+ pgrdst = pgrdst->pa;
+ }
+ }
+
+
+#line 5194 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+int
+wxdobj_copy_recursive(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj,
+ Wxd_point_t *psh
+)
+{
+ Wxd_object_t *pno;
+ Wxd_object_t *png;
+ int back = 0;
+
+
+#line 5210 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN != pobj->ot) {
+ /*
+ Copy simple object
+ */
+ if (0 != wxdobj_shift(pobj, psh, 0)) {
+ pno = wxdobj_copy(pobj);
+ if (NULL != pno) {
+ wxdobj_shift(pno, psh, 1);
+ if (0 != wxdobj_drw_register_object(pdrw, NULL, pno)) {
+ back = 1;
+ wxdobj_bb_simple_object(pdrw, pno);
+ }
+ else {
+ wxdobj_obj_delete(pno);
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = 0;
+ }
+ }
+ else {
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = 0;
+ }
+ }
+ else {
+
+#line 5245 "WxdkdrawObj.cpt"
+ /* ERROR: Failed to shift */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+#endif
+ back = 0;
+ }
+ }
+ else {
+ /*
+ Copy a group of objects, probably including subgroups...
+ */
+ if (0 != wxdobj_group_test_shift(pobj, psh)) {
+ png = wxdobj_drw_add_group(pdrw, NULL);
+ if (NULL != png) {
+ back = wxdobj_i_group_copy(pdrw, png, pobj, psh);
+ wxdobj_bb_modified_object(pdrw, png);
+ }
+ else {
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = false;
+ }
+ }
+ else {
+
+#line 5275 "WxdkdrawObj.cpt"
+ /* ERROR: Failed to shift */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+#endif
+ back = false;
+ }
+ }
+ }
+
+
+#line 5286 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_point_move_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+)
+{
+ Wxd_object_t *back = NULL; /* Object to modify */
+ Wxd_object_t *pcand = NULL; /* Current object to test */
+ double backd; /* Distance to back */
+ double candd; /* Distance to cand */
+ double backx; /* Distance to back */
+ double candx; /* Distance to cand */
+ uint16_t backi; /* Point index on back */
+ uint16_t candi; /* Point index on cand */
+
+
+#line 5308 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != ppt) && (NULL != pindex)) {
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pcand = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pcand) {
+
+#line 5313 "WxdkdrawObj.cpt"
+ if (wxdobj_is_active(pcand)) {
+ switch ( (int)(pcand->ot) ) {
+ case WXD_OT_TEXT :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE :
+ case WXD_OT_ELLIPSE :
+ case WXD_OT_BOX :
+ case WXD_OT_IMAGE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ candd = wxdobj_distance_to_point(pcand,ppt,true,&candi);
+ candx = wxdobj_distance_to_point(pcand, ppt);
+
+
+#line 5331 "WxdkdrawObj.cpt"
+ if (dlim >= candd) {
+
+#line 5332 "WxdkdrawObj.cpt"
+ if (NULL == back) {
+
+#line 5333 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+
+#line 5339 "WxdkdrawObj.cpt"
+ if (backd > candd) {
+
+#line 5340 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if ((!(backd < candd)) && (backx > candx)) {
+
+
+#line 5348 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 5355 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 5362 "WxdkdrawObj.cpt"
+ }
+#endif
+ } break;
+ }
+ }
+ }
+ } while (NULL != pcand);
+ if (NULL != back) {
+ *pindex = backi;
+ }
+ }
+
+
+#line 5374 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_modify_spline_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+)
+{
+ Wxd_object_t *back = NULL; /* Object to modify */
+ Wxd_object_t *pcand = NULL; /* Current object to test */
+ double backd; /* Distance to back */
+ double candd; /* Distance to cand */
+ double backx; /* Distance to back */
+ double candx; /* Distance to cand */
+ uint16_t backi; /* Point index on back */
+ uint16_t candi; /* Point index on cand */
+
+
+#line 5396 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != ppt) && (NULL != pindex)) {
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pcand = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pcand) {
+
+#line 5401 "WxdkdrawObj.cpt"
+ if (wxdobj_is_active(pcand)) {
+ switch ( (int)(pcand->ot) ) {
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE :
+ {
+ candd = wxdobj_distance_to_point(pcand,ppt,true,&candi);
+ candx = wxdobj_distance_to_point(pcand, ppt);
+
+
+#line 5409 "WxdkdrawObj.cpt"
+ if (dlim >= candd) {
+
+#line 5410 "WxdkdrawObj.cpt"
+ if (NULL == back) {
+
+#line 5411 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+
+#line 5417 "WxdkdrawObj.cpt"
+ if (backd > candd) {
+
+#line 5418 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if ((!(backd < candd)) && (backx > candx)) {
+
+
+#line 5426 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 5433 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 5440 "WxdkdrawObj.cpt"
+ }
+#endif
+ } break;
+ }
+ }
+ }
+ } while (NULL != pcand);
+ if (NULL != back) {
+ *pindex = backi;
+ }
+ }
+
+
+#line 5452 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+
+Wxd_object_t *
+wxdobj_rotate_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+)
+{
+ Wxd_object_t *back = NULL; /* Object to modify */
+ Wxd_object_t *pcand = NULL; /* Current object to test */
+ double backd; /* Distance to back */
+ double candd; /* Distance to cand */
+ double backx; /* Distance to back */
+ double candx; /* Distance to cand */
+ uint16_t backi; /* Point index on back */
+ uint16_t candi; /* Point index on cand */
+ bool is_rotatable; /* Object is rotatable */
+
+
+#line 5476 "WxdkdrawObj.cpt"
+ if ((NULL != pdrw) && (NULL != ppt) && (NULL != pindex)) {
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pcand = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pcand) {
+
+#line 5481 "WxdkdrawObj.cpt"
+ if (wxdobj_is_active(pcand)) {
+ is_rotatable = false;
+ switch ( (int)(pcand->ot) ) {
+ case WXD_OT_TEXT :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE :
+ case WXD_OT_ELLIPSE :
+ case WXD_OT_BOX :
+ case WXD_OT_IMAGE : {
+ is_rotatable = true;
+ } break;
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ if (NULL != pcand->pa) {
+ is_rotatable = true;
+ }
+ } break;
+ }
+ if (is_rotatable) {
+ candd = wxdobj_distance_to_point(pcand,ppt,true,&candi);
+ candx = wxdobj_distance_to_point(pcand, ppt);
+
+
+#line 5508 "WxdkdrawObj.cpt"
+ if (dlim >= candd) {
+
+#line 5509 "WxdkdrawObj.cpt"
+ if (NULL == back) {
+
+#line 5510 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+
+#line 5516 "WxdkdrawObj.cpt"
+ if (backd > candd) {
+
+#line 5517 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if ((!(backd < candd)) && (backx > candx)) {
+
+
+#line 5525 "WxdkdrawObj.cpt"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 5532 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 5539 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ }
+ } while (NULL != pcand);
+ if (NULL != back) {
+ *pindex = backi;
+ }
+ }
+
+
+#line 5550 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+/** Check whether to insert the new point before the selected point
+ or append after the selected point.
+ @param pobj Object to modify.
+ @param ppt Mouse position, not grid-aligned.
+ @param ileft Index of "left side" point.
+ @param ipoint Index of selected point.
+ @param iright Index of "right side" point.
+ @param pbapp Address of flag to set for appending (true) or
+ inserting (false).
+*/
+
+static
+void
+wxdobj_point_add_find_poly_point(
+ Wxd_object_t *pobj,
+ Wxd_point_t const *ppt,
+ uint16_t ileft,
+ uint16_t ipoint,
+ uint16_t iright,
+ bool *pbapp
+)
+{
+ dk4_gra_point_t pta;
+ dk4_gra_point_t ptb;
+ dk4_gra_point_t ptc;
+ dk4_gra_point_t ptt;
+ double da;
+ double db;
+
+
+#line 5584 "WxdkdrawObj.cpt"
+ pta.x = (double)(((pobj->det).p.p)[ileft].x);
+ pta.y = (double)(((pobj->det).p.p)[ileft].y);
+ ptb.x = (double)(((pobj->det).p.p)[iright].x);
+ ptb.y = (double)(((pobj->det).p.p)[iright].y);
+ ptc.x = (double)(((pobj->det).p.p)[ipoint].x);
+ ptc.y = (double)(((pobj->det).p.p)[ipoint].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_track(&pta, &ptc, &ptt, NULL);
+ db = dk4gratool_dist_point_track(&ptb, &ptc, &ptt, NULL);
+ *pbapp = (db < da);
+
+
+#line 5596 "WxdkdrawObj.cpt"
+}
+
+
+
+/** Check whether to insert the new point before the selected point
+ or append after the selected point.
+ @param pobj Object to modify.
+ @param ppt Mouse position, not grid-aligned.
+ @param ileft Index of "left side" point.
+ @param ipoint Index of selected point.
+ @param iright Index of "right side" point.
+ @param pbapp Address of flag to set for appending (true) or
+ inserting (false).
+*/
+
+static
+void
+wxdobj_point_add_find_spline_point(
+ Wxd_object_t *pobj,
+ Wxd_point_t const *ppt,
+ uint16_t ileft,
+ uint16_t ipoint,
+ uint16_t iright,
+ bool *pbapp
+)
+{
+ dk4_gra_point_t pta;
+ dk4_gra_point_t ptb;
+ dk4_gra_point_t ptc;
+ dk4_gra_point_t ptt;
+ double da;
+ double db;
+
+
+#line 5629 "WxdkdrawObj.cpt"
+ pta.x = (double)(((pobj->det).s.p)[ileft].x);
+ pta.y = (double)(((pobj->det).s.p)[ileft].y);
+ ptb.x = (double)(((pobj->det).s.p)[iright].x);
+ ptb.y = (double)(((pobj->det).s.p)[iright].y);
+ ptc.x = (double)(((pobj->det).s.p)[ipoint].x);
+ ptc.y = (double)(((pobj->det).s.p)[ipoint].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_track(&pta, &ptc, &ptt, NULL);
+ db = dk4gratool_dist_point_track(&ptb, &ptc, &ptt, NULL);
+ *pbapp = (db < da);
+
+
+#line 5641 "WxdkdrawObj.cpt"
+}
+
+
+
+/** Find object to add points to or delete points from.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @param doadd Flag: Find object to add points to.
+ @return Object found.
+*/
+static
+Wxd_object_t *
+wxdobj_point_del_find_object_internal(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim,
+ int doadd
+)
+{
+ Wxd_object_t *back = NULL; /* Object to modify */
+ Wxd_object_t *pcand = NULL; /* Current object to test */
+ double backd; /* Distance to back */
+ double candd; /* Distance to cand */
+ double backx; /* Distance to back */
+ double candx; /* Distance to cand */
+ uint16_t backi; /* Point index on back */
+ uint16_t candi; /* Point index on cand */
+ bool btest;
+ if ((NULL != pdrw) && (NULL != ppt) && (NULL != pindex)) {
+ backi = (uint16_t)0U;
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pcand = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pcand) {
+ btest = false;
+ /* For open splines and polylines we need at least
+ 2 points remaining after deleting a point.
+ For closed splines and polygons we need at least
+ 3 points remaining after deleting a point.
+
+ 2020-08-28
+ When adding point there must be less than UINT16_MAX
+ existing points.
+ */
+ switch ( (int)(pcand->ot) ) {
+ case WXD_OT_POLYLINE : {
+ if (0 != doadd) {
+ if (UINT16_MAX > (pcand->det).p.n) {
+ btest = true;
+ }
+ }
+ else {
+ if ((uint16_t)2U < (pcand->det).p.n) {
+ btest = true;
+ }
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+ if (0 != doadd) {
+ if (UINT16_MAX > (pcand->det).p.n) {
+ btest = true;
+ }
+ }
+ else {
+ if ((uint16_t)3U < (pcand->det).p.n) {
+ btest = true;
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if (0 != doadd) {
+ if (UINT16_MAX > (pcand->det).s.n) {
+ btest = true;
+ }
+ }
+ else {
+ if ((uint16_t)2U < (pcand->det).s.n) {
+ btest = true;
+ }
+ }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ if (0 != doadd) {
+ if (UINT16_MAX > (pcand->det).s.n) {
+ btest = true;
+ }
+ }
+ else {
+ if ((uint16_t)3U < (pcand->det).s.n) {
+ btest = true;
+ }
+ }
+ } break;
+ }
+ if (btest) {
+ if (!wxdobj_is_active(pcand)) {
+ btest = false;
+ }
+ }
+ if (btest) {
+ candd = wxdobj_distance_to_point(pcand, ppt, true, &candi);
+ candx = wxdobj_distance_to_point(pcand, ppt);
+ if (dlim >= candd) {
+ if (NULL == back) {
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if (backd > candd) {
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if ((!(backd < candd)) && (backx > candx)) {
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 5769 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 5776 "WxdkdrawObj.cpt"
+ }
+#endif
+ }
+ }
+ } while (NULL != pcand);
+ if (NULL != back) {
+ *pindex = backi;
+ }
+ }
+ return back;
+
+}
+
+
+Wxd_object_t *
+wxdobj_point_add_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ bool *pbapp,
+ double dlim
+)
+{
+ dk4_gra_point_t pta;
+ dk4_gra_point_t ptb;
+ dk4_gra_point_t ptt;
+ Wxd_object_t *back = NULL;
+ double da;
+ double db;
+ uint16_t ileft = (uint16_t)0U;
+ uint16_t iright = (uint16_t)0U;
+ bool bAppend = false;
+
+
+#line 5809 "WxdkdrawObj.cpt"
+ back = wxdobj_point_del_find_object_internal(pdrw, ppt, pindex, dlim, 1);
+ if (NULL != back) {
+ ileft = *pindex - (uint16_t)1U;
+ iright = *pindex + (uint16_t)1U;
+ switch ( (int)(back->ot) ) {
+ case WXD_OT_POLYLINE : {
+
+#line 5815 "WxdkdrawObj.cpt"
+ if ((uint16_t)0U < *pindex) {
+ if ( ((back->det).p.n - (uint16_t)1U) > *pindex) {
+
+
+#line 5818 "WxdkdrawObj.cpt"
+ wxdobj_point_add_find_poly_point(
+ back, ppt, ileft, *pindex, iright, &bAppend
+ );
+ }
+ else {
+
+#line 5823 "WxdkdrawObj.cpt"
+ pta.x = (double)(((back->det).p.p)[ileft].x);
+ pta.y = (double)(((back->det).p.p)[ileft].y);
+ ptb.x = (double)(((back->det).p.p)[*pindex].x);
+ ptb.y = (double)(((back->det).p.p)[*pindex].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_point(&ptb, &pta, NULL);
+ db = dk4gratool_dist_point_point(&ptt, &pta, NULL);
+ bAppend = (db > da);
+ }
+ }
+ else {
+
+#line 5835 "WxdkdrawObj.cpt"
+ pta.x = (double)(((back->det).p.p)[0].x);
+ pta.y = (double)(((back->det).p.p)[0].y);
+ ptb.x = (double)(((back->det).p.p)[1].x);
+ ptb.y = (double)(((back->det).p.p)[1].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_point(&pta, &ptb, NULL);
+ db = dk4gratool_dist_point_point(&ptt, &ptb, NULL);
+ bAppend = (db <= da);
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+
+#line 5847 "WxdkdrawObj.cpt"
+ if ((uint16_t)0U < *pindex) {
+ if ( ((back->det).s.n - (uint16_t)1U) > *pindex) {
+
+
+#line 5850 "WxdkdrawObj.cpt"
+ wxdobj_point_add_find_spline_point(
+ back, ppt, ileft, *pindex, iright, &bAppend
+ );
+ }
+ else {
+
+#line 5855 "WxdkdrawObj.cpt"
+ pta.x = (double)(((back->det).s.p)[ileft].x);
+ pta.y = (double)(((back->det).s.p)[ileft].y);
+ ptb.x = (double)(((back->det).s.p)[*pindex].x);
+ ptb.y = (double)(((back->det).s.p)[*pindex].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_point(&ptb, &pta, NULL);
+ db = dk4gratool_dist_point_point(&ptt, &pta, NULL);
+ bAppend = (db > da);
+ }
+ }
+ else {
+
+#line 5867 "WxdkdrawObj.cpt"
+ pta.x = (double)(((back->det).s.p)[0].x);
+ pta.y = (double)(((back->det).s.p)[0].y);
+ ptb.x = (double)(((back->det).s.p)[1].x);
+ ptb.y = (double)(((back->det).s.p)[1].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_point(&pta, &ptb, NULL);
+ db = dk4gratool_dist_point_point(&ptt, &ptb, NULL);
+ bAppend = (db <= da);
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+
+#line 5879 "WxdkdrawObj.cpt"
+ if ((uint16_t)0U < *pindex) {
+ if ( ((back->det).p.n - (uint16_t)1U) <= *pindex) {
+
+
+#line 5882 "WxdkdrawObj.cpt"
+ iright = (uint16_t)0U;
+ }
+ }
+ else {
+
+#line 5886 "WxdkdrawObj.cpt"
+ ileft = (back->det).p.n - (uint16_t)1U;
+ }
+ wxdobj_point_add_find_poly_point(
+ back, ppt, ileft, *pindex, iright, &bAppend
+ );
+ } break;
+ case WXD_OT_C_SPLINE : {
+
+#line 5893 "WxdkdrawObj.cpt"
+ if ((uint16_t)0U < *pindex) {
+ if ( ((back->det).s.n - (uint16_t)1U) <= *pindex) {
+ iright = (uint16_t)0U;
+ }
+ }
+ else {
+
+#line 5899 "WxdkdrawObj.cpt"
+ ileft = (back->det).s.n - (uint16_t)1U;
+ }
+ wxdobj_point_add_find_spline_point(
+ back, ppt, ileft, *pindex, iright, &bAppend
+ );
+ } break;
+ }
+ *pbapp = bAppend;
+ }
+
+#line 5908 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_point_del_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+)
+{
+ return (wxdobj_point_del_find_object_internal(pdrw, ppt, pindex, dlim, 0));
+}
+
+
+
+static
+void
+wxdobj_get_box_control_point(
+ Wxd_point_t *pdst,
+ Wxd_bb_t const *psrc,
+ uint16_t pind
+)
+{
+ switch ( (int)pind ) {
+ case 3 : {
+ pdst->x = psrc->xl; pdst->y = psrc->yt;
+ } break;
+ case 2 : {
+ pdst->x = psrc->xr; pdst->y = psrc->yt;
+ } break;
+ case 1 : {
+ pdst->x = psrc->xr; pdst->y = psrc->yb;
+ } break;
+ default : {
+ pdst->x = psrc->xl; pdst->y = psrc->yb;
+ } break;
+ }
+}
+
+
+
+static
+void
+wxdobj_set_box_control_point(
+ Wxd_bb_t *pdst,
+ Wxd_point_t const *psrc,
+ uint16_t pind
+)
+{
+ switch ( (int)pind ) {
+ case 3 : {
+ pdst->xl = psrc->x; pdst->yt = psrc->y;
+ } break;
+ case 2 : {
+ pdst->xr = psrc->x; pdst->yt = psrc->y;
+ } break;
+ case 1 : {
+ pdst->xr = psrc->x; pdst->yb = psrc->y;
+ } break;
+ default : {
+ pdst->xl = psrc->x; pdst->yb = psrc->y;
+ } break;
+ }
+}
+
+
+
+static
+void
+wxdobj_set_ellipse_control_point(
+ Wxd_object_t *pdst,
+ Wxd_point_t const *psrc,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ int32_t r;
+ int16_t rot;
+ double dx;
+ double dy;
+ double a;
+
+
+#line 5993 "WxdkdrawObj.cpt"
+
+
+#line 5994 "WxdkdrawObj.cpt"
+
+
+#line 5995 "WxdkdrawObj.cpt"
+ dx = (double)(psrc->x) - (double)((pdst->det).e.x);
+ dy = (double)(psrc->y) - (double)((pdst->det).e.y);
+
+
+#line 5998 "WxdkdrawObj.cpt"
+
+
+#line 5999 "WxdkdrawObj.cpt"
+ r = dk4ma_int32_from_double(
+ dk4ma_rint(sqrt(dx * dx + dy * dy)), erp
+ );
+
+#line 6002 "WxdkdrawObj.cpt"
+ a = atan2(dy, dx);
+
+#line 6003 "WxdkdrawObj.cpt"
+ if (dk4ma_is_finite(a)) {
+ rot = dk4ma_int16_from_double(
+ dk4ma_rint((180.0 * a) / M_PI), erp
+ );
+
+#line 6007 "WxdkdrawObj.cpt"
+ while (-360 > rot) { rot += (int16_t)360; }
+ while ( 360 < rot) { rot -= (int16_t)360; }
+
+
+#line 6010 "WxdkdrawObj.cpt"
+ switch ( (int)pind ) {
+ case 3 : {
+
+#line 6012 "WxdkdrawObj.cpt"
+ (pdst->det).e.ry = r;
+
+#line 6013 "WxdkdrawObj.cpt"
+ rot -= 270;
+ while (-360 > rot) { rot += (int16_t)360; }
+ } break;
+ case 2 : {
+
+#line 6017 "WxdkdrawObj.cpt"
+ (pdst->det).e.rx = r;
+
+#line 6018 "WxdkdrawObj.cpt"
+ rot -= 180;
+ while (-360 > rot) { rot += (int16_t)360; }
+ } break;
+ case 1 : {
+
+#line 6022 "WxdkdrawObj.cpt"
+ (pdst->det).e.ry = r;
+
+#line 6023 "WxdkdrawObj.cpt"
+ rot -= 90;
+ while (-360 > rot) { rot += (int16_t)360; }
+ } break;
+ default : {
+
+#line 6027 "WxdkdrawObj.cpt"
+ (pdst->det).e.rx = r;
+
+#line 6028 "WxdkdrawObj.cpt"
+ } break;
+ }
+ (pdst->det).e.a = rot;
+
+#line 6031 "WxdkdrawObj.cpt"
+ }
+ else {
+
+#line 6033 "WxdkdrawObj.cpt"
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+
+#line 6035 "WxdkdrawObj.cpt"
+}
+
+
+
+bool
+wxdobj_get_control_point(
+ Wxd_point_t *pdst,
+ Wxd_object_t const *psrc,
+ uint16_t pind
+)
+{
+ dk4_er_t er; /* Error report */
+ dk4_gra_point_t pta; /* Graphics point */
+ bool back = false; /* Function result */
+
+
+#line 6050 "WxdkdrawObj.cpt"
+ if ((NULL != pdst) && (NULL != psrc)) {
+ switch ( (int)(psrc->ot) ) {
+ case WXD_OT_TEXT : {
+ pdst->x = (psrc->det).t.x;
+ pdst->y = (psrc->det).t.y;
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (psrc->det).p.p) && (pind < (psrc->det).p.n)) {
+ pdst->x = ((psrc->det).p.p)[pind].x;
+ pdst->y = ((psrc->det).p.p)[pind].y;
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (psrc->det).s.p) && (pind < (psrc->det).s.n)) {
+ pdst->x = ((psrc->det).s.p)[pind].x;
+ pdst->y = ((psrc->det).s.p)[pind].y;
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (2U == pind) {
+ pdst->x = (psrc->det).a.x3;
+ pdst->y = (psrc->det).a.y3;
+ back = true;
+ }
+ else {
+ if (1U == pind) {
+ pdst->x = (psrc->det).a.x2;
+ pdst->y = (psrc->det).a.y2;
+ back = true;
+ }
+ else {
+ pdst->x = (psrc->det).a.x1;
+ pdst->y = (psrc->det).a.y1;
+ back = true;
+ }
+ }
+ } break;
+ case WXD_OT_CIRCLE : {
+ if ((uint32_t)(DK4_I32_MAX) >= (psrc->det).e.rx) {
+ dk4error_init(&er);
+ switch ( (int)pind ) {
+ case 3 : {
+ pdst->x = (psrc->det).e.x;
+ pdst->y = dk4ma_int32_t_sub(
+ (psrc->det).e.y,(int32_t)((psrc->det).e.rx),&er
+ );
+ } break;
+ case 2 : {
+ pdst->x = dk4ma_int32_t_sub(
+ (psrc->det).e.x,(int32_t)((psrc->det).e.rx),&er
+ );
+ pdst->y = (psrc->det).e.y;
+ } break;
+ case 1 : {
+ pdst->x = (psrc->det).e.x;
+ pdst->y = dk4ma_int32_t_add(
+ (psrc->det).e.y,(int32_t)((psrc->det).e.rx),&er
+ );
+ } break;
+ default : {
+ pdst->x = dk4ma_int32_t_add(
+ (psrc->det).e.x,(int32_t)((psrc->det).e.rx),&er
+ );
+ pdst->y = (psrc->det).e.y;
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ }
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ dk4error_init(&er);
+ if ((int16_t)0 == (psrc->det).e.a) { /* Not rotated */
+ if (
+ ((uint32_t)(DK4_I32_MAX) >= (psrc->det).e.rx)
+ && ((uint32_t)(DK4_I32_MAX) >= (psrc->det).e.ry)
+ ) {
+ switch ( (int)pind ) {
+ case 3 : {
+ pdst->x = (psrc->det).e.x;
+ pdst->y = dk4ma_int32_t_sub(
+ (psrc->det).e.y,
+ (int32_t)((psrc->det).e.ry), &er
+ );
+ } break;
+ case 2 : {
+ pdst->x = dk4ma_int32_t_sub(
+ (psrc->det).e.x,
+ (int32_t)((psrc->det).e.rx), &er
+ );
+ pdst->y = (psrc->det).e.y;
+ } break;
+ case 1 : {
+ pdst->x = (psrc->det).e.x;
+ pdst->y = dk4ma_int32_t_add(
+ (psrc->det).e.y,
+ (int32_t)((psrc->det).e.ry), &er
+ );
+ } break;
+ default : {
+ pdst->x = dk4ma_int32_t_add(
+ (psrc->det).e.x,
+ (int32_t)((psrc->det).e.rx), &er
+ );
+ pdst->y = (psrc->det).e.y;
+ } break;
+ }
+ }
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ }
+ }
+ else { /* Rotated */
+ switch ( (int)pind ) {
+ case 3 : {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((psrc->det).e.ry);
+ } break;
+ case 2 : {
+ pta.x = 0.0 - (double)((psrc->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 1 : {
+ pta.x = 0.0;
+ pta.y = (double)((psrc->det).e.ry);
+ } break;
+ default : {
+ pta.x = (double)((psrc->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ }
+ dk4gratool_rotate_point(
+ &pta, ((M_PI * (double)((psrc->det).e.a)) / 180.0)
+ );
+ pta.x += (double)((psrc->det).e.x);
+ pta.y += (double)((psrc->det).e.y);
+ pdst->x = dk4ma_int32_from_double(dk4ma_rint(pta.x), &er);
+ pdst->y = dk4ma_int32_from_double(dk4ma_rint(pta.y), &er);
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ }
+ }
+ } break;
+ case WXD_OT_BOX : {
+ wxdobj_get_box_control_point(pdst, &((psrc->det).b.b), pind);
+ back = true;
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_get_box_control_point(pdst, &((psrc->det).i.br), pind);
+ back = true;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ pdst->x = (psrc->det).d.x;
+ pdst->y = (psrc->det).d.y;
+ back = true;
+ } break;
+ }
+ }
+
+#line 6212 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_set_control_point(
+ Wxd_object_t *pdst,
+ Wxd_point_t const *psrc,
+ uint16_t pind
+)
+{
+ dk4_er_t er; /* Error report */
+ double dx; /* X difference control point, center */
+ double dy; /* Y difference control point, center */
+ int32_t newr; /* New radius */
+ bool back = false; /* Function result */
+
+
+#line 6230 "WxdkdrawObj.cpt"
+ if ((NULL != pdst) && (NULL != psrc)) {
+
+
+#line 6232 "WxdkdrawObj.cpt"
+
+
+#line 6233 "WxdkdrawObj.cpt"
+ switch ( (int)(pdst->ot) ) {
+ case WXD_OT_TEXT : {
+ (pdst->det).t.x = psrc->x;
+ (pdst->det).t.y = psrc->y;
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (pdst->det).p.p) && (pind < (pdst->det).p.n)) {
+ ((pdst->det).p.p)[pind].x = psrc->x;
+ ((pdst->det).p.p)[pind].y = psrc->y;
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (pdst->det).s.p) && (pind < (pdst->det).s.n)) {
+ ((pdst->det).s.p)[pind].x = psrc->x;
+ ((pdst->det).s.p)[pind].y = psrc->y;
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (2U == pind) {
+ (pdst->det).a.x3 = psrc->x;
+ (pdst->det).a.y3 = psrc->y;
+ back = true;
+ }
+ else {
+ if (1U == pind) {
+ (pdst->det).a.x2 = psrc->x;
+ (pdst->det).a.y2 = psrc->y;
+ back = true;
+ }
+ else {
+ (pdst->det).a.x1 = psrc->x;
+ (pdst->det).a.y1 = psrc->y;
+ back = true;
+ }
+ }
+ wxdarc_calculation(
+ &((pdst->det).a.x),
+ &((pdst->det).a.y),
+ &((pdst->det).a.r),
+ &((pdst->det).a.a),
+ &((pdst->det).a.b),
+ &((pdst->det).a.d),
+ (pdst->det).a.x1,
+ (pdst->det).a.y1,
+ (pdst->det).a.x2,
+ (pdst->det).a.y2,
+ (pdst->det).a.x3,
+ (pdst->det).a.y3
+ );
+ } break;
+ case WXD_OT_CIRCLE : {
+ dk4error_init(&er);
+#if 0
+ /* 2020-03-24 Modification
+ Clang static analyzer complains about this line because
+ newr is overwritten in all the if/else branches below.
+ */
+ newr = (int32_t)0L;
+#endif
+ if ((pdst->det).e.x == psrc->x) {
+ newr = dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub((pdst->det).e.y, psrc->y, &er), &er
+ );
+ }
+ else {
+ if ((pdst->det).e.y == psrc->y) {
+ newr = dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub((pdst->det).e.x,psrc->x,&er), &er
+ );
+ }
+ else {
+ dx = (double)((pdst->det).e.x) - (double)(psrc->x);
+ dy = (double)((pdst->det).e.y) - (double)(psrc->y);
+ newr = dk4ma_int32_from_double(
+ sqrt(dx * dx + dy * dy), &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) {
+ (pdst->det).e.rx = newr;
+ back = true;
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+
+
+#line 6321 "WxdkdrawObj.cpt"
+ dk4error_init(&er);
+ switch ( (int)pind ) {
+ case 3 : {
+
+#line 6324 "WxdkdrawObj.cpt"
+ if ((pdst->det).e.x == psrc->x) {
+ if (psrc->y <= (pdst->det).e.y) {
+ (pdst->det).e.a = 0;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ (pdst->det).e.y, psrc->y, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = 180;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ psrc->y, (pdst->det).e.y, &er
+ );
+ }
+ }
+ else {
+ if ((pdst->det).e.y == psrc->y) {
+ if (psrc->x >= (pdst->det).e.x) {
+ (pdst->det).e.a = 90;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ psrc->x, (pdst->det).e.x, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = -90;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ (pdst->det).e.x, psrc->x, &er
+ );
+ }
+ }
+ else {
+ wxdobj_set_ellipse_control_point(
+ pdst, psrc, pind, &er
+ );
+ }
+ }
+ } break;
+ case 2 : {
+
+#line 6361 "WxdkdrawObj.cpt"
+ if ((pdst->det).e.y == psrc->y) {
+ if (psrc->x <= (pdst->det).e.x) {
+ (pdst->det).e.a = 0;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ (pdst->det).e.x, psrc->x, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = 180;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ psrc->x, (pdst->det).e.x, &er
+ );
+ }
+ }
+ else {
+ if ((pdst->det).e.x == psrc->x) {
+ if (psrc->y <= (pdst->det).e.y) {
+ (pdst->det).e.a = 90;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ (pdst->det).e.y, psrc->y, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = -90;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ psrc->y, (pdst->det).e.y, &er
+ );
+ }
+ }
+ else {
+ wxdobj_set_ellipse_control_point(
+ pdst, psrc, pind, &er
+ );
+ }
+ }
+ } break;
+ case 1 : {
+
+#line 6398 "WxdkdrawObj.cpt"
+ if ((pdst->det).e.x == psrc->x) {
+ if (psrc->y >= (pdst->det).e.y) {
+ (pdst->det).e.a = 0;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ psrc->y, (pdst->det).e.y, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = 180;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ (pdst->det).e.y, psrc->y, &er
+ );
+ }
+ }
+ else {
+ if ((pdst->det).e.y == psrc->y) {
+ if (psrc->x <= (pdst->det).e.x) {
+ (pdst->det).e.a = 90;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ (pdst->det).e.x, psrc->x, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = -90;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ psrc->x, (pdst->det).e.x, &er
+ );
+ }
+ }
+ else {
+ wxdobj_set_ellipse_control_point(
+ pdst, psrc, pind, &er
+ );
+ }
+ }
+ } break;
+ default : {
+
+#line 6435 "WxdkdrawObj.cpt"
+ if ((pdst->det).e.y == psrc->y) {
+
+#line 6436 "WxdkdrawObj.cpt"
+ if (psrc->x >= (pdst->det).e.x) {
+ (pdst->det).e.a = 0;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ psrc->x, (pdst->det).e.x, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = 180;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ (pdst->det).e.x, psrc->x, &er
+ );
+ }
+ }
+ else {
+ if ((pdst->det).e.x == psrc->x) {
+
+#line 6451 "WxdkdrawObj.cpt"
+ if (psrc->y >= (pdst->det).e.y) {
+ (pdst->det).e.a = 90;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ psrc->y, (pdst->det).e.y, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = -90;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ (pdst->det).e.y, psrc->y, &er
+ );
+ }
+ }
+ else {
+
+#line 6465 "WxdkdrawObj.cpt"
+ wxdobj_set_ellipse_control_point(
+ pdst, psrc, pind, &er
+ );
+ }
+ }
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ }
+ } break;
+ case WXD_OT_BOX : {
+ wxdobj_set_box_control_point(&((pdst->det).b.b), psrc, pind);
+ back = true;
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_set_box_control_point(&((pdst->det).i.br), psrc, pind);
+ back = true;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ (pdst->det).d.x = psrc->x;
+ (pdst->det).d.y = psrc->y;
+ back = true;
+ } break;
+ }
+ }
+
+#line 6491 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+void
+wxdobj_delete_control_point(
+ Wxd_object_t *pdst,
+ uint16_t pind
+)
+{
+ Wxd_point_t *ptrppt; /* New poly points array */
+ Wxd_spline_point_t *ptrspl; /* New spline points array */
+ double olds; /* Old s value */
+ size_t sz; /* Number of points to allocate */
+ uint16_t i; /* Traverse control points */
+ bool bCanDo; /* Can delete point from this object */
+ bool bBorder; /* Deleted point was border point */
+
+
+#line 6510 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ bCanDo = false;
+ switch ( (int)(pdst->ot) ) {
+ case WXD_OT_POLYLINE : {
+ if ((uint16_t)2U < (pdst->det).p.n) { bCanDo = true; }
+ } break;
+ case WXD_OT_POLYGON : {
+ if ((uint16_t)3U < (pdst->det).p.n) { bCanDo = true; }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if ((uint16_t)2U < (pdst->det).s.n) { bCanDo = true; }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ if ((uint16_t)3U < (pdst->det).s.n) { bCanDo = true; }
+ } break;
+ }
+ if (bCanDo) {
+ switch ( (int)(pdst->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ ptrppt = NULL;
+ sz = (size_t)((pdst->det).p.n);
+ sz--;
+ ptrppt = dk4mem_new(Wxd_point_t, sz, NULL);
+ if (NULL != ptrppt) {
+ DK4_MEMCPY(\
+ ptrppt, (pdst->det).p.p,\
+ (sz * sizeof(Wxd_point_t))\
+ );
+ if ((size_t)pind < sz) {
+ DK4_MEMCPY(\
+ &(ptrppt[pind]),\
+ &(((pdst->det).p.p)[pind + (uint16_t)1U]),\
+ (\
+ sizeof(Wxd_point_t) * (sz - (size_t)pind)\
+ )\
+ );
+ }
+ dk4mem_free((pdst->det).p.p);
+ (pdst->det).p.p = ptrppt;
+ (pdst->det).p.n = sz;
+ }
+ else {
+ if ((size_t)pind < sz) {
+ /* Can not do one large memcpy as source
+ and destination range would overlap.
+ */
+ for (i = pind; (size_t)i < sz; i++) {
+ DK4_MEMCPY(\
+ &(((pdst->det).p.p)[i]),\
+ &(((pdst->det).p.p)[i + (uint16_t)1U]),\
+ sizeof(Wxd_point_t)\
+ );
+ }
+ }
+ (pdst->det).p.n = sz;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ ptrspl = NULL;
+ sz = (size_t)((pdst->det).s.n);
+ sz--;
+ olds = ((pdst->det).s.p)[pind].s;
+ bBorder = false;
+ if (
+ (((pdst->det).s.n - (uint16_t)1U) == pind)
+ || ((uint16_t)0U == pind)
+ ) {
+ bBorder = true;
+ }
+ ptrspl = dk4mem_new(Wxd_spline_point_t, sz, NULL);
+ if (NULL != ptrspl) {
+ DK4_MEMCPY(\
+ ptrspl, (pdst->det).s.p,\
+ (sz * sizeof(Wxd_spline_point_t))\
+ );
+ if ((size_t)pind < sz) {
+ DK4_MEMCPY(\
+ &(ptrspl[pind]),\
+ &(((pdst->det).s.p)[pind + (uint16_t)1U]),\
+ (\
+ sizeof(Wxd_spline_point_t)\
+ * (sz - (size_t)pind)\
+ )\
+ );
+ }
+ dk4mem_free((pdst->det).s.p);
+ (pdst->det).s.p = ptrspl;
+ (pdst->det).s.n = sz;
+ }
+ else {
+ if ((size_t)pind < sz) {
+ /* Can not do one large memcpy as source
+ and destination range would overlap.
+ */
+ for (i = pind; (size_t)i < sz; i++) {
+ DK4_MEMCPY(\
+ &(((pdst->det).s.p)[i]),\
+ &(((pdst->det).s.p)[i + (uint16_t)1U]),\
+ sizeof(Wxd_spline_point_t)\
+ );
+ }
+ }
+ (pdst->det).s.n = sz;
+ }
+ if (bBorder) {
+ if ((uint16_t)0U == pind) {
+ ((pdst->det).s.p)[0].s = olds;
+ }
+ else {
+ ((pdst->det).s.p)[sz - (size_t)1U].s = olds;
+ }
+ }
+ } break;
+ }
+ }
+ }
+
+
+#line 6627 "WxdkdrawObj.cpt"
+}
+
+
+
+bool
+wxdobj_add_control_point(
+ Wxd_object_t *pdst,
+ uint16_t pind,
+ Wxd_point_t const *ppt
+)
+{
+ Wxd_spline_point_t *ptrspl;
+ Wxd_point_t *ptrppt;
+ size_t oldsz;
+ size_t newsz;
+ bool back = false;
+ bool bCanDo = false;
+
+
+#line 6645 "WxdkdrawObj.cpt"
+ if (NULL != pdst) {
+ switch ( (int)(pdst->ot) ) {
+ case WXD_OT_POLYLINE :
+ case WXD_OT_POLYGON : {
+
+#line 6649 "WxdkdrawObj.cpt"
+ if ((uint16_t)0xFFFFU > (pdst->det).p.n) {
+ if (pind <= (pdst->det).p.n) {
+
+#line 6651 "WxdkdrawObj.cpt"
+ oldsz = (size_t)((pdst->det).p.n);
+ newsz = oldsz + (size_t)1U;
+ ptrppt = dk4mem_new(Wxd_point_t,newsz,NULL);
+ if (NULL != ptrppt) {
+
+#line 6655 "WxdkdrawObj.cpt"
+ DK4_MEMCPY(\
+ ptrppt, (pdst->det).p.p,\
+ (oldsz * sizeof(Wxd_point_t))\
+ );
+ if ((size_t)pind < oldsz) {
+ DK4_MEMCPY(\
+ &(ptrppt[pind + (uint16_t)1U]),\
+ &(((pdst->det).p.p)[pind]),\
+ (\
+ (oldsz - (size_t)pind)\
+ * sizeof(Wxd_point_t)\
+ )\
+ );
+ }
+ dk4mem_free((pdst->det).p.p);
+ (pdst->det).p.p = ptrppt;
+ (pdst->det).p.n = (uint16_t)newsz;
+ ((pdst->det).p.p)[pind].x = ppt->x;
+ ((pdst->det).p.p)[pind].y = ppt->y;
+ back = true;
+ }
+ else {
+
+#line 6677 "WxdkdrawObj.cpt"
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = false;
+ }
+ }
+ else {
+
+#line 6687 "WxdkdrawObj.cpt"
+ /* ERROR: New point index out of range (bug) */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_BUG_POINT_OOR
+ );
+#endif
+ back = false;
+ }
+ }
+ else {
+
+#line 6697 "WxdkdrawObj.cpt"
+ /* ERROR: Too many points */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_TOO_MANY_POINTS
+ );
+#endif
+ back = false;
+ }
+ } break;
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE : {
+
+#line 6708 "WxdkdrawObj.cpt"
+ if ((uint16_t)0xFFFFU > (pdst->det).s.n) {
+ if (pind <= (pdst->det).s.n) {
+ oldsz = (size_t)((pdst->det).s.n);
+ newsz = oldsz + (size_t)1U;
+ ptrspl = dk4mem_new(Wxd_spline_point_t,newsz,NULL);
+ if (NULL != ptrspl) {
+ DK4_MEMCPY(\
+ ptrspl, (pdst->det).s.p,\
+ (oldsz * sizeof(Wxd_spline_point_t))\
+ );
+ if ((size_t)pind < oldsz) {
+ DK4_MEMCPY(\
+ &(ptrspl[pind + (uint16_t)1U]),\
+ &(((pdst->det).s.p)[pind]),\
+ (\
+ (oldsz - (size_t)pind)\
+ * sizeof(Wxd_spline_point_t)\
+ )\
+ );
+ }
+ dk4mem_free((pdst->det).s.p);
+ (pdst->det).s.p = ptrspl;
+ (pdst->det).s.n = (uint16_t)newsz;
+ ((pdst->det).s.p)[pind].x = ppt->x;
+ ((pdst->det).s.p)[pind].y = ppt->y;
+ back = true;
+ if ((uint16_t)0U == pind) {
+ ((pdst->det).s.p)[0].s = 0.0;
+ ((pdst->det).s.p)[1].s =
+ ((pdst->det).s.p)[2].s;
+ }
+ else {
+ if (((pdst->det).s.n - (uint16_t)1U) == pind) {
+ ((pdst->det).s.p)[pind].s = 0.0;
+ ((pdst->det).s.p)[pind - (uint16_t)1U].s =
+ ((pdst->det).s.p)[pind - (uint16_t)2U].s;
+ }
+ }
+ }
+ else {
+
+#line 6748 "WxdkdrawObj.cpt"
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = false;
+ }
+ }
+ else {
+
+#line 6758 "WxdkdrawObj.cpt"
+ /* ERROR: New point index out of range (bug) */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_BUG_POINT_OOR
+ );
+#endif
+ back = false;
+ }
+ }
+ else {
+
+#line 6768 "WxdkdrawObj.cpt"
+ /* ERROR: Too many points */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_TOO_MANY_POINTS
+ );
+#endif
+ back = false;
+ }
+ } break;
+ }
+ if (bCanDo) {
+ }
+ }
+
+#line 6781 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_control_pt_to_bb(
+ Wxd_bb_t *pbox,
+ Wxd_object_t const *pobj
+)
+{
+ bool back = false;
+ uint16_t i;
+ if (NULL != pbox) {
+ wxdobj_det_init_bb(pbox);
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ wxdobj_bb_set_point(
+ pbox, (pobj->det).t.x, (pobj->det).t.y
+ );
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((0U < (pobj->det).p.n) && (NULL != (pobj->det).p.p)) {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ if ((uint16_t)0U != i) {
+ wxdobj_bb_add_point(
+ pbox,
+ ((pobj->det).p.p)[i].x,
+ ((pobj->det).p.p)[i].y
+ );
+ }
+ else {
+ wxdobj_bb_set_point(
+ pbox,
+ ((pobj->det).p.p)[i].x,
+ ((pobj->det).p.p)[i].y
+ );
+ }
+ }
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((0U < (pobj->det).s.n) && (NULL != (pobj->det).s.p)) {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ if ((uint16_t)0U != i) {
+ wxdobj_bb_add_point(
+ pbox,
+ ((pobj->det).s.p)[i].x,
+ ((pobj->det).s.p)[i].y
+ );
+ }
+ else {
+ wxdobj_bb_set_point(
+ pbox,
+ ((pobj->det).s.p)[i].x,
+ ((pobj->det).s.p)[i].y
+ );
+ }
+ }
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ wxdobj_bb_set_point(
+ pbox, (pobj->det).a.x1, (pobj->det).a.y1
+ );
+ wxdobj_bb_add_point(
+ pbox, (pobj->det).a.x2, (pobj->det).a.y2
+ );
+ wxdobj_bb_add_point(
+ pbox, (pobj->det).a.x3, (pobj->det).a.y3
+ );
+ back = true;
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ wxdobj_bb_set_point(
+ pbox, (pobj->det).e.x, (pobj->det).e.y
+ );
+ back = true;
+ } break;
+ case WXD_OT_BOX : {
+ DK4_MEMCPY(pbox,&((pobj->det).b.b),sizeof(Wxd_bb_t));
+ back = true;
+ } break;
+ case WXD_OT_IMAGE : {
+ DK4_MEMCPY(pbox,&((pobj->det).i.br),sizeof(Wxd_bb_t));
+ back = true;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ wxdobj_bb_set_point(
+ pbox, (pobj->det).d.x, (pobj->det).d.y
+ );
+ back = true;
+ } break;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+bool
+wxdobj_flip_object(
+ Wxd_object_t *pobj,
+ Wxd_bb_t const *pbox,
+ bool bVert,
+ bool bRealRun
+)
+{
+ dk4_er_t er;
+ uint16_t i;
+ bool back = false;
+
+
+#line 6898 "WxdkdrawObj.cpt"
+ if ((NULL != pobj) && (NULL != pbox)) {
+ dk4error_init(&er);
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).t.y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).t.y, &er
+ );
+ (pobj->det).t.a = (int16_t)0 - (pobj->det).t.a;
+ }
+ else {
+ (pobj->det).t.x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).t.x, &er
+ );
+ (pobj->det).t.a = (int16_t)180 - (pobj->det).t.a;
+ switch ( (int)((pobj->det).t.al) ) {
+ case WXD_TA_RIGHT : {
+ (pobj->det).t.al = (uint8_t)(WXD_TA_LEFT);
+ } break;
+ case WXD_TA_CENTERED : {
+ (pobj->det).t.al = (uint8_t)(WXD_TA_CENTERED);
+ } break;
+ default : {
+ (pobj->det).t.al = (uint8_t)(WXD_TA_RIGHT);
+ } break;
+ }
+ }
+ while ((int16_t)(-360) >= (pobj->det).t.a) {
+ (pobj->det).t.a += (int16_t)360;
+ }
+ while ((int16_t)360 <= (pobj->det).t.a) {
+ (pobj->det).t.a -= (int16_t)360;
+ }
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).t.y, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).t.x, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (pobj->det).p.p) && (0U < (pobj->det).p.n)) {
+ if (bRealRun) {
+ if (bVert) {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ ((pobj->det).p.p)[i].y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt,
+ ((pobj->det).p.p)[i].y, &er
+ );
+ }
+ }
+ else {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ ((pobj->det).p.p)[i].x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr,
+ ((pobj->det).p.p)[i].x, &er
+ );
+ }
+ }
+ }
+ else {
+ if (bVert) {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt,
+ ((pobj->det).p.p)[i].y, &er
+ );
+ }
+ }
+ else {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr,
+ ((pobj->det).p.p)[i].x, &er
+ );
+ }
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (pobj->det).s.p) && (0U < (pobj->det).s.n)) {
+ if (bRealRun) {
+ if (bVert) {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ ((pobj->det).s.p)[i].y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt,
+ ((pobj->det).s.p)[i].y, &er
+ );
+ }
+ }
+ else {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ ((pobj->det).s.p)[i].x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr,
+ ((pobj->det).s.p)[i].x, &er
+ );
+ }
+ }
+ }
+ else {
+ if (bVert) {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt,
+ ((pobj->det).s.p)[i].y, &er
+ );
+ }
+ }
+ else {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr,
+ ((pobj->det).s.p)[i].x, &er
+ );
+ }
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).a.y1 = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y1, &er
+ );
+ (pobj->det).a.y2 = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y2, &er
+ );
+ (pobj->det).a.y3 = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y3, &er
+ );
+ }
+ else {
+ (pobj->det).a.x1 = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x1, &er
+ );
+ (pobj->det).a.x2 = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x2, &er
+ );
+ (pobj->det).a.x3 = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x3, &er
+ );
+ }
+ wxdarc_calculation(
+ &((pobj->det).a.x),
+ &((pobj->det).a.y),
+ &((pobj->det).a.r),
+ &((pobj->det).a.a),
+ &((pobj->det).a.b),
+ &((pobj->det).a.d),
+ (pobj->det).a.x1,
+ (pobj->det).a.y1,
+ (pobj->det).a.x2,
+ (pobj->det).a.y2,
+ (pobj->det).a.x3,
+ (pobj->det).a.y3
+ );
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y1, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y2, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y3, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x1, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x2, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x3, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).e.y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).e.y, &er
+ );
+ }
+ else {
+ (pobj->det).e.x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).e.x, &er
+ );
+ }
+ if (
+ (WXD_OT_ELLIPSE == pobj->ot)
+ && ((int16_t)0 != (pobj->det).e.a)
+ ) {
+ if (bVert) {
+ (pobj->det).e.a = (int16_t)0 - (pobj->det).e.a;
+ }
+ else {
+ (pobj->det).e.a = (int16_t)180 - (pobj->det).e.a;
+ }
+ while ((int16_t)(-360) >= (pobj->det).t.a) {
+ (pobj->det).t.a += (int16_t)360;
+ }
+ while ((int16_t)360 <= (pobj->det).t.a) {
+ (pobj->det).t.a -= (int16_t)360;
+ }
+ }
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).e.y, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).e.x, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_BOX : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).b.b.yb = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).b.b.yb, &er
+ );
+ (pobj->det).b.b.yt = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).b.b.yt, &er
+ );
+ }
+ else {
+ (pobj->det).b.b.xl = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).b.b.xl, &er
+ );
+ (pobj->det).b.b.xr = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).b.b.xr, &er
+ );
+ }
+ wxdobj_bb_correct(&((pobj->det).b.b));
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).b.b.yb, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).b.b.yt, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).b.b.xl, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).b.b.xr, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_IMAGE : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).i.br.yb = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).i.br.yb, &er
+ );
+ (pobj->det).i.br.yt = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).i.br.yt, &er
+ );
+ }
+ else {
+ (pobj->det).i.br.xl = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).i.br.xl, &er
+ );
+ (pobj->det).i.br.xr = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).i.br.xr, &er
+ );
+ }
+ wxdobj_bb_correct(&((pobj->det).i.br));
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).i.br.yb, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).i.br.yt, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).i.br.xl, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).i.br.xr, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).d.y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).d.y, &er
+ );
+ }
+ else {
+ (pobj->det).d.x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).d.x, &er
+ );
+ }
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).d.y, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).d.x, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ }
+ }
+
+#line 7247 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_is_marked(Wxd_object_t const *pobj, uint8_t marker)
+{
+ bool back = false;
+
+
+#line 7257 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ if ((uint8_t)0U != (marker & (pobj->mark))) {
+ back = true;
+ }
+ }
+
+
+#line 7263 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+int
+wxdobj_num_marked_2(Wxd_drawing_t *pdrw)
+{
+ Wxd_object_t *pobj;
+ int back = 0;
+
+
+#line 7274 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pobj) {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_2)) {
+ back++;
+ }
+ }
+ } while ((NULL != pobj) && (2 > back));
+ }
+
+
+#line 7286 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+#if TRACE_DEBUG
+static
+void
+wxdobj_report_bb(dk4_bb_t const *pbb)
+{
+#if TRACE_DEBUG
+
+
+#line 7298 "WxdkdrawObj.cpt"
+ if (0 != dk4bb_have_x(pbb)) {
+
+
+#line 7300 "WxdkdrawObj.cpt"
+ }
+ else {
+
+
+#line 7303 "WxdkdrawObj.cpt"
+ }
+ if (0 != dk4bb_have_y(pbb)) {
+
+
+#line 7306 "WxdkdrawObj.cpt"
+ }
+ else {
+
+
+#line 7309 "WxdkdrawObj.cpt"
+ }
+
+
+#line 7311 "WxdkdrawObj.cpt"
+#endif
+}
+#endif
+
+
+
+static
+bool
+wxdobj_bb_simple_text(Wxd_object_t *pobj)
+{
+
+
+#line 7322 "WxdkdrawObj.cpt"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).t.x), (double)((pobj->det).t.y)
+ );
+
+
+#line 7328 "WxdkdrawObj.cpt"
+
+
+#line 7329 "WxdkdrawObj.cpt"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_polyline(Wxd_object_t *pobj)
+{
+ uint16_t u;
+ bool back = false;
+
+
+#line 7341 "WxdkdrawObj.cpt"
+ dk4bb_init(&(pobj->bb));
+ if ((NULL != (pobj->det).p.p) && ((uint16_t)0U < (pobj->det).p.n)) {
+ back = true;
+ for (u = (uint16_t)0U; u < (pobj->det).p.n; u++) {
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)(((pobj->det).p.p)[u].x),
+ (double)(((pobj->det).p.p)[u].y)
+ );
+ }
+ }
+
+
+#line 7353 "WxdkdrawObj.cpt"
+
+
+#line 7354 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_spline(
+ Wxd_object_t *pobj,
+ size_t subsegs
+)
+{
+ double aa[4]; /* Subsegment start */
+ double ab[4]; /* Subsegment end */
+ dk4_xsp_2d_t xsp; /* X-spline structure for calculations */
+ double divisor; /* Divisor for derivatives */
+ double t; /* Current "time" */
+ size_t ssegno; /* Current subsegment */
+ uint16_t nsegs; /* Number of segments in spline */
+ uint16_t a; /* Point A index */
+ uint16_t b; /* Point B index */
+ uint16_t c; /* Point C index */
+ uint16_t d; /* Point D index */
+ bool back = false;
+
+
+#line 7379 "WxdkdrawObj.cpt"
+ divisor = 3.0 * ((double)subsegs);
+ dk4bb_init(&(pobj->bb));
+ if ((NULL != (pobj->det).s.p) && ((uint16_t)1U < (pobj->det).s.n)) {
+ back = true;
+
+#line 7383 "WxdkdrawObj.cpt"
+ nsegs = (pobj->det).s.n;
+ if (WXD_OT_C_SPLINE != pobj->ot) { nsegs--; }
+
+
+#line 7386 "WxdkdrawObj.cpt"
+ dk4xsp2d_reset(&xsp);
+ for (b = (uint16_t)0U; b < nsegs; b++) {
+
+
+#line 7389 "WxdkdrawObj.cpt"
+ if (b < ((pobj->det).s.n - (uint16_t)1U)) {
+ c = b + (uint16_t)1U;
+ }
+ else {
+ c = 0;
+ }
+
+#line 7395 "WxdkdrawObj.cpt"
+ if (
+ (1.0e-7 > fabs(((pobj->det).s.p)[b].s))
+ && (1.0e-7 > fabs(((pobj->det).s.p)[c].s))
+ ) {
+
+#line 7399 "WxdkdrawObj.cpt"
+ dk4bb_add_point(
+ &(pobj->bb), ((pobj->det).s.p)[b].x, ((pobj->det).s.p)[b].y
+ );
+ dk4bb_add_point(
+ &(pobj->bb), ((pobj->det).s.p)[c].x, ((pobj->det).s.p)[c].y
+ );
+ }
+ else {
+
+#line 7407 "WxdkdrawObj.cpt"
+ dk4xsp2d_reset_points(&xsp);
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[b].x),
+ (double)(((pobj->det).s.p)[b].y),
+ ((pobj->det).s.p)[b].s,
+ 1
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[c].x),
+ (double)(((pobj->det).s.p)[c].y),
+ ((pobj->det).s.p)[c].s,
+ 2
+ );
+ if (b < ((pobj->det).s.n - (uint16_t)2U)) {
+ d = b + (uint16_t)2U;
+
+#line 7424 "WxdkdrawObj.cpt"
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[d].x),
+ (double)(((pobj->det).s.p)[d].y),
+ ((pobj->det).s.p)[d].s,
+ 3
+ );
+ }
+ else {
+ if (WXD_OT_C_SPLINE == pobj->ot) {
+ d = b - ((pobj->det).s.n - (uint16_t)2U);
+
+
+#line 7436 "WxdkdrawObj.cpt"
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[d].x),
+ (double)(((pobj->det).s.p)[d].y),
+ ((pobj->det).s.p)[d].s,
+ 3
+ );
+ }
+ }
+ if ((uint16_t)0U < b) {
+ a = b - (uint16_t)1U;
+
+#line 7447 "WxdkdrawObj.cpt"
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[a].x),
+ (double)(((pobj->det).s.p)[a].y),
+ ((pobj->det).s.p)[a].s,
+ 0
+ );
+ }
+ else {
+ if (WXD_OT_C_SPLINE == pobj->ot) {
+ a = (pobj->det).s.n - (uint16_t)1U;
+
+
+#line 7459 "WxdkdrawObj.cpt"
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[a].x),
+ (double)(((pobj->det).s.p)[a].y),
+ ((pobj->det).s.p)[a].s,
+ 0
+ );
+ }
+ }
+ /*
+ Minimum number of sub segments is 2
+ */
+ if ((size_t)2U > subsegs) { subsegs = (size_t)2U; }
+ /*
+ Start point of segment
+ */
+ dk4xsp2d_calculate_value_derivative(aa, &xsp, 0.0, NULL);
+ aa[1] = aa[1] / divisor;
+ aa[3] = aa[3] / divisor;
+ for (ssegno = (size_t)0U; ssegno < subsegs; ssegno++) {
+ if ((subsegs - (size_t)1U) == ssegno) {
+ t = 1.0;
+ }
+ else {
+ t = ((double)(ssegno + (size_t)1U)) / ((double)subsegs);
+ }
+ dk4xsp2d_calculate_value_derivative(ab, &xsp, t, NULL);
+ ab[1] = ab[1] / divisor;
+ ab[3] = ab[3] / divisor;
+ dk4bb_add_bezier(
+ &(pobj->bb),
+ aa[0], aa[2], (aa[0] + aa[1]), (aa[2] + aa[3]),
+ (ab[0] - ab[1]), (ab[2] - ab[3]), ab[0], ab[2]
+ );
+ DK4_MEMCPY(aa,ab,sizeof(aa));
+ }
+ }
+ }
+ }
+
+
+#line 7499 "WxdkdrawObj.cpt"
+
+
+#line 7500 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_arc(Wxd_object_t *pobj)
+{
+ double a;
+ double b;
+ size_t i;
+ int c;
+
+
+#line 7514 "WxdkdrawObj.cpt"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb), (double)((pobj->det).a.x1), (double)((pobj->det).a.y1)
+ );
+ dk4bb_add_point(
+ &(pobj->bb), (double)((pobj->det).a.x2), (double)((pobj->det).a.y2)
+ );
+ dk4bb_add_point(
+ &(pobj->bb), (double)((pobj->det).a.x3), (double)((pobj->det).a.y3)
+ );
+ if ((int8_t)0 != (pobj->det).a.d) {
+ if ((pobj->det).a.a <= (pobj->det).a.b) {
+ a = (pobj->det).a.a;
+ b = (pobj->det).a.b;
+ }
+ else {
+ a = (pobj->det).a.b;
+ b = (pobj->det).a.a;
+ }
+ c = 0;
+ for (i = (size_t)0U; i < sz_arc_angles; i++) {
+ if (a <= arc_angles[i]) {
+ if (arc_angles[i] <= b) {
+ switch (c) {
+ case 3 : {
+ dk4bb_add_y(
+ &(pobj->bb), ((pobj->det).a.y - (pobj->det).a.r)
+ );
+ } break;
+ case 2 : {
+ dk4bb_add_x(
+ &(pobj->bb), ((pobj->det).a.x - (pobj->det).a.r)
+ );
+ } break;
+ case 1 : {
+ dk4bb_add_y(
+ &(pobj->bb), ((pobj->det).a.y + (pobj->det).a.r)
+ );
+ } break;
+ default : {
+ dk4bb_add_x(
+ &(pobj->bb), ((pobj->det).a.x + (pobj->det).a.r)
+ );
+ } break;
+ }
+ }
+ }
+ if (4 <= ++c) { c = 0; }
+ }
+ if (WXD_OT_C_ARC == pobj->ot) {
+ dk4bb_add_point(&(pobj->bb), (pobj->det).a.x, (pobj->det).a.y);
+ }
+ }
+
+
+#line 7568 "WxdkdrawObj.cpt"
+
+
+#line 7569 "WxdkdrawObj.cpt"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_circle(Wxd_object_t *pobj)
+{
+
+
+#line 7579 "WxdkdrawObj.cpt"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb),
+ ((double)((pobj->det).e.x) - (double)((pobj->det).e.rx)),
+ ((double)((pobj->det).e.y) - (double)((pobj->det).e.rx))
+ );
+ dk4bb_add_point(
+ &(pobj->bb),
+ ((double)((pobj->det).e.x) + (double)((pobj->det).e.rx)),
+ ((double)((pobj->det).e.y) + (double)((pobj->det).e.rx))
+ );
+
+
+#line 7591 "WxdkdrawObj.cpt"
+
+
+#line 7592 "WxdkdrawObj.cpt"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_ellipse(Wxd_object_t *pobj)
+{
+
+
+#line 7602 "WxdkdrawObj.cpt"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_rotated_ellipse(
+ &(pobj->bb),
+ (double)((pobj->det).e.x),
+ (double)((pobj->det).e.y),
+ (double)((pobj->det).e.rx),
+ (double)((pobj->det).e.ry),
+ ((M_PI * ((double)((pobj->det).e.a))) / 180.0)
+ );
+
+
+#line 7612 "WxdkdrawObj.cpt"
+
+
+#line 7613 "WxdkdrawObj.cpt"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_box(Wxd_object_t *pobj)
+{
+
+
+#line 7623 "WxdkdrawObj.cpt"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).b.b.xl), (double)((pobj->det).b.b.yb)
+ );
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).b.b.xr), (double)((pobj->det).b.b.yt)
+ );
+
+
+#line 7633 "WxdkdrawObj.cpt"
+
+
+#line 7634 "WxdkdrawObj.cpt"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_image(Wxd_object_t *pobj)
+{
+
+
+#line 7644 "WxdkdrawObj.cpt"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).i.br.xl), (double)((pobj->det).i.br.yb)
+ );
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).i.br.xr), (double)((pobj->det).i.br.yt)
+ );
+
+
+#line 7654 "WxdkdrawObj.cpt"
+
+
+#line 7655 "WxdkdrawObj.cpt"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_dot(Wxd_drawing_t const *pdrw, Wxd_object_t *pobj)
+{
+#if 1
+ double r;
+#endif
+
+
+#line 7668 "WxdkdrawObj.cpt"
+ dk4bb_init(&(pobj->bb));
+#if 1
+ r = (((double)((pobj->det).d.d) * (double)(pdrw->baselw)) / 2.0);
+ dk4bb_add_point(
+ &(pobj->bb),
+ ((double)((pobj->det).d.x) - r), ((double)((pobj->det).d.y) - r)
+ );
+ dk4bb_add_point(
+ &(pobj->bb),
+ ((double)((pobj->det).d.x) + r), ((double)((pobj->det).d.y) + r)
+ );
+#else
+ dk4bb_add_point(&(pobj->bb), (pobj->det).d.x, (pobj->det).d.y);
+#endif
+
+
+#line 7683 "WxdkdrawObj.cpt"
+
+
+#line 7684 "WxdkdrawObj.cpt"
+ return true;
+}
+
+
+
+bool
+wxdobj_bb_simple_object(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ bool back = false;
+
+
+#line 7697 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ back = wxdobj_bb_simple_text(pobj);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ back = wxdobj_bb_simple_polyline(pobj);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ back = wxdobj_bb_simple_spline(pobj, pdrw->xsubs);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ back = wxdobj_bb_simple_arc(pobj);
+ } break;
+ case WXD_OT_CIRCLE : {
+ back = wxdobj_bb_simple_circle(pobj);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ back = wxdobj_bb_simple_ellipse(pobj);
+ } break;
+ case WXD_OT_BOX : {
+ back = wxdobj_bb_simple_box(pobj);
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxdobj_bb_simple_image(pobj);
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ back = wxdobj_bb_simple_dot(pdrw, pobj);
+ } break;
+ }
+ }
+
+
+#line 7729 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_group_structural(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ Wxd_object_t *po;
+ bool back = false;
+
+
+#line 7743 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ dk4bb_init(&(pobj->bb));
+ }
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ back = true;
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) {
+
+#line 7753 "WxdkdrawObj.cpt"
+ if (WXD_OT_GROUP_BEGIN == po->ot) {
+ if (!wxdobj_bb_group_structural(pdrw, po)) {
+ back = false;
+ }
+ }
+
+
+#line 7759 "WxdkdrawObj.cpt"
+ dk4bb_add_bb(&(pobj->bb), &(po->bb));
+ }
+ } while (NULL != po);
+ }
+
+
+#line 7764 "WxdkdrawObj.cpt"
+ }
+
+
+#line 7766 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_group_and_contents(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ Wxd_object_t *po;
+ bool back = false;
+
+
+#line 7780 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ dk4bb_init(&(pobj->bb));
+ }
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ back = true;
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) {
+
+#line 7790 "WxdkdrawObj.cpt"
+ if (WXD_OT_GROUP_BEGIN == po->ot) {
+ if (!wxdobj_bb_group_and_contents(pdrw, po)) {
+ back = false;
+ }
+ }
+ else {
+ if (!wxdobj_bb_simple_object(pdrw, po)) {
+ back = false;
+ }
+ }
+
+
+#line 7801 "WxdkdrawObj.cpt"
+ dk4bb_add_bb(&(pobj->bb), &(po->bb));
+ }
+ } while (NULL != po);
+ }
+
+
+#line 7806 "WxdkdrawObj.cpt"
+ }
+
+
+#line 7808 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_modified_object(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ bool back = false;
+
+
+#line 7821 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ dk4bb_init(&(pobj->bb));
+ }
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ /*
+ If a group was modified (i.e. moved) rebuild
+ bounding box information completely
+ */
+ back = wxdobj_bb_group_and_contents(pdrw, pobj);
+ }
+ else {
+ /*
+ Rebuild bounding box information for simple object
+ */
+ back = wxdobj_bb_simple_object(pdrw, pobj);
+ if (NULL != pobj->pa) {
+ /*
+ If object is member of a group rebuild bounding box
+ information in structural nodes
+ */
+ while (NULL != pobj->pa) { pobj = pobj->pa; }
+ if (!wxdobj_bb_group_structural(pdrw, pobj)) {
+ back = false;
+ }
+ }
+ }
+ }
+
+
+#line 7850 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_for_drawing(
+ Wxd_drawing_t *pdrw
+)
+{
+ Wxd_object_t *pobj;
+ bool back = false;
+
+
+#line 7863 "WxdkdrawObj.cpt"
+ if (NULL != pdrw) {
+ back = true;
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+
+#line 7869 "WxdkdrawObj.cpt"
+ if (!wxdobj_bb_simple_object(pdrw, pobj)) {
+ back = false;
+ }
+ }
+ } while (NULL != pobj);
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pobj) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+
+
+#line 7880 "WxdkdrawObj.cpt"
+ if (!wxdobj_bb_group_structural(pdrw, pobj)) {
+ back = false;
+ }
+ }
+ }
+ } while (NULL != pobj);
+ }
+
+
+#line 7888 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+bool
+wxdobj_text_is_latex(Wxd_object_t const *pobj)
+{
+ bool back = false;
+ if (NULL != pobj) {
+ if (WXD_OT_TEXT == pobj->ot) {
+ if (
+ WXD_TEXT_FLAG_NONE
+ != (WXD_TEXT_FLAG_LATEX & ((pobj->det).t.fl))
+ ) {
+ back = true;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+bool
+wxdobj_can_convert(
+ int destot,
+ const Wxd_object_t *pobj
+)
+{
+ bool back = false;
+
+
+#line 7920 "WxdkdrawObj.cpt"
+ if (NULL != pobj) {
+ switch (destot) {
+ case WXD_OT_POLYLINE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_BOX :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC : {
+ back = true;
+ } break;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_BOX :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC : {
+ back = true;
+ } break;
+ }
+ } break;
+ case WXD_OT_O_ARC : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_C_ARC :
+ case WXD_OT_O_ARC : {
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE :
+ case WXD_OT_POLYGON : {
+ if ((uint16_t)3U == (pobj->det).p.n) {
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE : {
+ if ((uint16_t)3U == (pobj->det).s.n) {
+ back = true;
+ }
+ } break;
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_BOX :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC : {
+ back = true;
+ } break;
+ }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_BOX :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC : {
+ back = true;
+ } break;
+ }
+
+ } break;
+ case WXD_OT_C_ARC : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_C_ARC :
+ case WXD_OT_O_ARC : {
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE :
+ case WXD_OT_POLYGON : {
+ if ((uint16_t)3U == (pobj->det).p.n) {
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE : {
+ if ((uint16_t)3U == (pobj->det).s.n) {
+ back = true;
+ }
+ } break;
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE :
+ case WXD_OT_CIRCLE : {
+ back = true;
+ } break;
+ }
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE :
+ case WXD_OT_CIRCLE : {
+ back = true;
+ } break;
+ }
+ } break;
+ }
+ }
+
+#line 8035 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+
+/** Rotate one point relatively to a center point by 90 degree.
+ @param x Point x coordinate (in and out).
+ @paam y Point y coordinate (in and out).
+ @param x0 Center point x coordinate.
+ @param y0 Center point y coordinate.
+ @param neg Negative direction (false=positive direction).
+ @param doit Really modify point (false=test only).
+ @return True on success, false on error.
+*/
+static
+bool
+wxdobj_rotate_point(
+ int32_t & x,
+ int32_t & y,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ dk4_er_t er;
+ int32_t dx;
+ int32_t dy;
+ int32_t nx;
+ int32_t ny;
+ bool back = false;
+
+ if ((x == x0) && (y == y0)) {
+ back = true;
+ }
+ else {
+ dk4error_init(&er);
+ dx = dk4ma_int32_t_sub(x, x0, &er);
+ dy = dk4ma_int32_t_sub(y, y0, &er);
+ if (neg) {
+ nx = dk4ma_int32_t_add(x0, dy, &er);
+ ny = dk4ma_int32_t_sub(y0, dx, &er);
+ }
+ else {
+ nx = dk4ma_int32_t_sub(x0, dy, &er);
+ ny = dk4ma_int32_t_add(y0, dx, &er);
+ }
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ if (doit) {
+ x = nx;
+ y = ny;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_text(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back;
+ back = wxdobj_rotate_point(
+ (pobj->det).t.x, (pobj->det).t.y, x0, y0, neg, doit
+ );
+ if (doit) {
+ if (neg) {
+ (pobj->det).t.a -= (int16_t)90;
+ if ((int16_t)0 > (pobj->det).t.a) {
+ (pobj->det).t.a += (int16_t)360;
+ }
+ }
+ else {
+ (pobj->det).t.a += (int16_t)90;
+ if ((int16_t)360 < (pobj->det).t.a) {
+ (pobj->det).t.a -= (int16_t)360;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_polyline(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ uint16_t i;
+ bool back = false;
+ bool res;
+ if ((NULL != (pobj->det).p.p) && ((uint16_t)0U < (pobj->det).p.n)) {
+ back = true;
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ res = wxdobj_rotate_point(
+ ((pobj->det).p.p)[i].x,((pobj->det).p.p)[i].y,x0,y0,neg,doit
+ );
+ if (!(res)) { back = false; }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_spline(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ uint16_t i;
+ bool back = false;
+ bool res;
+ if ((NULL != (pobj->det).s.p) && ((uint16_t)0U < (pobj->det).s.n)) {
+ back = true;
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ res = wxdobj_rotate_point(
+ ((pobj->det).s.p)[i].x,((pobj->det).s.p)[i].y,x0,y0,neg,doit
+ );
+ if (!(res)) { back = false; }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_arc(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = true;
+ bool res;
+ res = wxdobj_rotate_point((pobj->det).a.x1,(pobj->det).a.y1,x0,y0,neg,doit);
+ if (!(res)) { back = false; }
+ res = wxdobj_rotate_point((pobj->det).a.x2,(pobj->det).a.y2,x0,y0,neg,doit);
+ if (!(res)) { back = false; }
+ res = wxdobj_rotate_point((pobj->det).a.x3,(pobj->det).a.y3,x0,y0,neg,doit);
+ if (!(res)) { back = false; }
+ if (doit) {
+ wxdarc_calculation(
+ &((pobj->det).a.x), &((pobj->det).a.y), &((pobj->det).a.r),
+ &((pobj->det).a.a), &((pobj->det).a.b), &((pobj->det).a.d),
+ (pobj->det).a.x1, (pobj->det).a.y1, (pobj->det).a.x2,
+ (pobj->det).a.y2, (pobj->det).a.x3, (pobj->det).a.y3
+ );
+
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_ellipse(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = false;
+ back = wxdobj_rotate_point(
+ (pobj->det).e.x, (pobj->det).e.y, x0, y0, neg, doit
+ );
+ if (doit && (WXD_OT_ELLIPSE == pobj->ot)) {
+ if (neg) {
+ (pobj->det).e.a -= (int16_t)90;
+ if ((int16_t)0 > (pobj->det).e.a) {
+ (pobj->det).e.a += (int16_t)360;
+ }
+ }
+ else {
+ (pobj->det).e.a += (int16_t)90;
+ if ((int16_t)360 < (pobj->det).e.a) {
+ (pobj->det).e.a -= (int16_t)360;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_bb(
+ Wxd_bb_t *pbb,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = true;
+ bool res;
+ res = wxdobj_rotate_point(pbb->xl, pbb->yb, x0, y0, neg, doit);
+ if (!(res)) { back = false; }
+ res = wxdobj_rotate_point(pbb->xr, pbb->yt, x0, y0, neg, doit);
+ if (!(res)) { back = false; }
+ if (doit) {
+ wxdobj_bb_correct(pbb);
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_simple_object(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = false;
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ back = wxdobj_rotate_text(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ back = wxdobj_rotate_polyline(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ back = wxdobj_rotate_spline(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ back = wxdobj_rotate_arc(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ back = wxdobj_rotate_ellipse(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_BOX : {
+ back = wxdobj_rotate_bb(&((pobj->det).b.b), x0, y0, neg, doit);
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxdobj_rotate_bb(&((pobj->det).i.br), x0, y0, neg, doit);
+ if (doit) { wxdobj_image_placement(pobj); }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ back = wxdobj_rotate_point(
+ (pobj->det).d.x, (pobj->det).d.y, x0, y0, neg, doit
+ );
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_structural_object(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ Wxd_object_t *o;
+ bool back = false;
+ bool res;
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ back = true;
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ o = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != o) {
+ switch ( (int)(o->ot) ) {
+ case WXD_OT_GROUP_BEGIN : {
+ res = wxdobj_rotate_structural_object(
+ o, x0, y0, neg, doit
+ );
+ } break;
+ default : {
+ res = wxdobj_rotate_simple_object(
+ o, x0, y0, neg, doit
+ );
+ } break;
+ }
+ if (!(res)) { back = false; }
+ }
+ } while (NULL != o);
+ }
+ return back;
+}
+
+
+
+bool
+wxdobj_rotate_object(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = false;
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_GROUP_BEGIN : {
+ back = wxdobj_rotate_structural_object(
+ pobj, x0, y0, neg, doit
+ );
+ } break;
+ default : {
+ back = wxdobj_rotate_simple_object(
+ pobj, x0, y0, neg, doit
+ );
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_equal(Wxd_bb_t const *pa, Wxd_bb_t const *pb)
+{
+ bool back = false;
+
+
+#line 8392 "WxdkdrawObj.cpt"
+ if ((NULL != pa) && (NULL != pb)) {
+
+
+#line 8394 "WxdkdrawObj.cpt"
+
+
+#line 8395 "WxdkdrawObj.cpt"
+ if (
+ (pa->xl == pb->xl) && (pa->xr == pb->xr)
+ && (pa->yb == pb->yb) && (pa->yt == pb->yt)
+ ) {
+ back = true;
+ }
+ }
+
+#line 8402 "WxdkdrawObj.cpt"
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawObj.cpt b/support/dktools/WxdkdrawObj.cpt
new file mode 100644
index 0000000000..98d98201bd
--- /dev/null
+++ b/support/dktools/WxdkdrawObj.cpt
@@ -0,0 +1,8407 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file WxdkdrawObj.h Graphics elements handling.
+*/
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+#ifndef WXDENUM_H_INCLUDED
+#include "wxdenum.h"
+#endif
+
+
+/* PROTOTYPES (start) */
+
+
+/*
+ Create and destroy drawing
+ --------------------------
+*/
+
+/** Open a new empty drawing.
+ @return Valid pointer on success, NULL on error (not enough memory).
+*/
+
+Wxd_drawing_t *
+wxdobj_drw_new(void);
+
+
+/** Delete drawing including all contents.
+ @param pdrw Drawing to delete.
+*/
+
+void
+wxdobj_drw_delete(Wxd_drawing_t *pdrw);
+
+
+/** Set required redraw level.
+ During handling one event this function may be called multiple
+ times. The maximum of the required redraw levels is saved
+ in the drawing.
+ @param pdrw Drawing to update.
+ @param level Required minimum redraw level.
+*/
+
+void
+wxdobj_drw_require_redraw(Wxd_drawing_t *pdrw, int level);
+
+
+/** Retrieve required redraw level.
+ This function should be called at the end of event handlers
+ to check whether or not to refresh and update the control
+ and from within the repaint handler to check which caches to
+ update.
+ @param pdrw Drawing to check.
+ @param level Required redraw level already found.
+ @return Required redraw level.
+*/
+
+int
+wxdobj_drw_get_required_redraw_level(
+ Wxd_drawing_t *pdrw,
+ int level = WXD_REFRESH_NONE
+);
+
+
+/** Reset required redraw level.
+ This function should be called from the repaint handler when
+ redrawing is done.
+ @param pdrw Drawing to modify.
+*/
+
+void
+wxdobj_drw_reset_required_redraw_level(Wxd_drawing_t *pdrw);
+
+
+/*
+ Create and destroy elements without registration
+ and unregistration to drawing
+ ------------------------------------------------
+*/
+
+
+/** Initialize bounding box structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_bb(Wxd_bb_t *pdst);
+
+
+/** Initialize text details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_text(Wxd_det_text_t *pdst);
+
+
+/** Initialize polyline or polygon details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_poly(Wxd_det_pl_t *pdst);
+
+
+/** Initialize spline details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_spline(Wxd_det_xs_t *pdst);
+
+
+/** Initialize arc details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_arc(Wxd_det_arc_t *pdst);
+
+
+/** Initialize details structure for ellipse or circle.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_ellipse(Wxd_det_ellipse_t *pdst);
+
+
+/** Initialize box details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_box(Wxd_det_box_t *pdst);
+
+
+/** Initialize image details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_image(Wxd_det_image_t *pdst);
+
+
+/** Initialize dot details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_dot(Wxd_det_dot_t *pdst);
+
+
+
+/** Initialize object, use template if specified.
+ @param pdst Object to initialize.
+ @param ot Object type.
+ @param ptpl Template object, may be NULL.
+*/
+
+void
+wxdobj_obj_init(Wxd_object_t *pdst, int ot, Wxd_object_t const *ptpl = NULL);
+
+
+/** Delete group structure recursively.
+ Only group structural information is deleted, graphics
+ objects remain intact.
+ The parent information of all graphics objects is set to NULL.
+*/
+
+void
+wxdobj_grp_delete_recursive(Wxd_object_t *pgrp);
+
+
+/** Create polyline object.
+ @param np Number of points.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_polyline(uint16_t np, Wxd_object_t const *ptpl);
+
+
+/** Create polygon object.
+ @param np Number of points.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_polygon(uint16_t np, Wxd_object_t const *ptpl);
+
+
+/** Create spline object.
+ @param np Number of points.
+ @param cl Flag: Closed spline.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_spline(uint16_t np, int cl, Wxd_object_t const *ptpl);
+
+
+/** Create arc object.
+ @param cl Flag: Closed arc.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_arc(int cl, Wxd_object_t const *ptpl);
+
+
+/** Create circle object.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_circle(Wxd_object_t const *ptpl);
+
+
+/** Create ellipse object.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_ellipse(Wxd_object_t const *ptpl);
+
+
+/** Create box object.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_box(Wxd_object_t const *ptpl);
+
+
+/** Create image object.
+ @param fn Image file name.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_image(wxChar const *fn, Wxd_object_t const *ptpl);
+
+
+/** Create dot object.
+ @param wh Flag: White filled dot.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_dot(int wh, Wxd_object_t const *ptpl);
+
+
+/** Create new text label.
+ @param te Export text.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_textlabel(wxChar const *te, Wxd_object_t const *ptpl);
+
+
+/** Delete object, release memory.
+ The object is not unregistered from the drawing.
+ For a group object the storage and iterator are just closed,
+ no recursive processing.
+ @param pobj Object to delete.
+*/
+
+void
+wxdobj_obj_delete(Wxd_object_t *pobj);
+
+
+/*
+ Create new elements in a drawing (create element and register it
+ in the drawings storages)
+ ----------------------------------------------------------------
+*/
+
+/** Register an object in drawing and group structure.
+ @param pdrw Drawing to register object.
+ @param pgrp Objects parent group or NULL for a top-level element.
+ @param pobj Object to register in drawing.
+*/
+
+int
+wxdobj_drw_register_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t *pobj
+);
+
+
+/** Add a new group to a drawing, register it in structered storage.
+ @param pdrw Drawing to add group to.
+ @param pgrp Parent group, NULL for a new top-level group.
+ @return Valid pointer to new group on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_drw_add_group(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp
+);
+
+
+/** Add a new polyline to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param np Number of points.
+ @param cl Flag: Closed polyline (polygon).
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_polyline(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ uint16_t np,
+ int cl,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add point to polygon or polyline.
+ @param pobj Polygon or polyline to modify.
+ @param pind Index of new point.
+ @param erp Error report, may be NULL.
+ @return True on success, false on error (memory).
+*/
+
+bool
+wxdobj_add_polypoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+);
+
+
+/** Delete one polyline or polygon point.
+ @param pobj Polyline or polygon object to modify.
+ @param pind Index of point to delete.
+ @param erp Error report, may be NULL.
+ @return True on success, false on error (memory).
+*/
+
+bool
+wxdobj_del_polypoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+);
+
+
+/** Add a new spline to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param np Number of points.
+ @param cl Flag: Closed spline.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_spline(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ uint16_t np,
+ int cl,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add point to spline.
+ @param pobj Spline to modify.
+ @param pind Index of new point.
+ @param erp Error report, may be NULL.
+ @return True on success, false on error (memory).
+*/
+
+bool
+wxdobj_add_splinepoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+);
+
+
+/** Delete one spline point.
+ @param pobj Open or closed spline object to modify.
+ @param pind Index of point to delete.
+ @param erp Error report, may be NULL.
+ @return True on success, false on error (memory).
+*/
+
+bool
+wxdobj_del_splinepoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+);
+
+
+/** Add a new arc to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param cl Flag: Closed polyline (polygon).
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_arc(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ int cl,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new circle to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_circle(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new ellipse to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_ellipse(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new box to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_box(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new polyline to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param fn File name of image file.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_image(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ wxChar const *fn,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new dot to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param wh Flag: White filled dot.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_dot(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ int wh,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new text label to the drawing and register it to the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param te Export text.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_textlabel(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ wxChar const *te,
+ Wxd_object_t const *ptpl
+);
+
+
+/*
+ Modify elements within a drawing, update registration
+ if necessary
+ -----------------------------------------------------
+*/
+
+
+/** Check whether or not object is active.
+ @param pobj Object to check.
+ @return True normally, false for objects on inactive layers.
+*/
+
+bool
+wxdobj_is_active(Wxd_object_t *pobj);
+
+
+/** Increase point number of polyline or polygon by one
+ (after clicking on a new point to add).
+ @param pobj Object to modify.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_mod_poly_add_point(
+ Wxd_object_t *pobj
+);
+
+
+/** Decrease point number of polyline or polygon by one
+ (after right-clicking for finalizing).
+ @param pobj Object to modify.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_mod_poly_del_point(
+ Wxd_object_t *pobj
+);
+
+
+/** Increase point number of spline by one
+ (after clicking on a new point to add).
+ @param pobj Object to modify.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_mod_spline_add_point(
+ Wxd_object_t *pobj
+);
+
+
+/** Decrease point number of spline by one
+ (after right-clicking for finalizing).
+ @param pobj Object to modify.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_mod_spline_del_point(
+ Wxd_object_t *pobj
+);
+
+
+/** Find group containing an object.
+ @param pdrw Drawing containing the object.
+ @param pobj Object to search for.
+ @return Valid pointer to group on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_find_group_for(Wxd_drawing_t *pdrw, Wxd_object_t *pobj);
+
+
+/** Ensure object has layer structure pointer.
+ @param pdrw Drawing.
+ @param pobj Object to check.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_find_layer_structure(Wxd_drawing_t *pdrw, Wxd_object_t *pobj);
+
+
+/** Check whether an object needs a stipple structure.
+ @param pobj Object to check.
+ @return 1 for true, 0 for false.
+*/
+
+int
+wxdobj_needs_stipple(
+ Wxd_object_t *pobj
+);
+
+
+/** Modify layer of an object.
+ This includes reorganization of sorted storages.
+ @param pdrw Drawing to modify.
+ @param pobj Object for layer change.
+ @param nl New layer number.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_modify_layer(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj,
+ int16_t nl
+);
+
+
+/** Correct bounding box and/or generic rectangle.
+ @param bbptr Rectangle to correct.
+*/
+
+void
+wxdobj_bb_correct(Wxd_bb_t *bbptr, uint16_t *ppoint = NULL);
+
+
+/** Check for incorrect rectangle (width or height 0 or negative).
+ @param bbptr Rectangle to check.
+ @return True for incorrect rectangle.
+*/
+
+bool
+wxdobj_bb_is_null_area(Wxd_bb_t *bbptr);
+
+
+/** Check two rectangles for intersection, find intersection area if any.
+ The intersection area is saved to res only if the function returns
+ true.
+ @param res Address of result rectangle variable.
+ @param a One rectangle to check.
+ @param b Other rectangle to check.
+ @return True if there is any intersection, false otherwise.
+*/
+
+bool
+wxdobj_bb_intersection(
+ Wxd_bb_t *res,
+ Wxd_bb_t const *a,
+ Wxd_bb_t const *b
+);
+
+
+/** Find bitmap type for file name.
+ @param fn File name to check.
+ @return Bitmap image type on success, wxBITMAP_TYPE_INVALID on error
+ (file name has no suffix or suffix not in the list of supported types).
+*/
+
+wxBitmapType
+wxdobj_image_type(wxChar const *fn);
+
+
+/** Load image from file.
+ @param pobj Image object, must be type WXD_OT_IMAGE.
+ @param dkenc Encoding used for dkChar strings.
+ @param wxenc Encoding used for wxChar strings.
+*/
+
+void
+wxdobj_load_image(
+ Wxd_object_t *pobj,
+ int dkenc,
+ int wxenc
+);
+
+
+/** Calculate image placement, save in pl component.
+ @param pobj Image object, must be type WXD_OT_IMAGE.
+*/
+
+void
+wxdobj_image_placement(
+ Wxd_object_t *pobj
+);
+
+
+/** Calculate distance from point to object.
+ @param pobj Object to check.
+ @param ppt Point to check.
+ @return Distance from point to object if found, negative value otherwise.
+*/
+
+double
+wxdobj_distance_to_point(
+ Wxd_object_t *pobj,
+ Wxd_point_t const *ppt,
+ bool bCtrlPt = false,
+ uint16_t *pIndex = NULL
+);
+
+
+/** Unmark all objects in drawing.
+ @param pdrw Drawing to modify.
+ @param marker Marker bit to delete from all objects.
+*/
+
+void
+wxdobj_unmark_all(Wxd_drawing_t *pdrw, uint8_t marker);
+
+
+/** Mark one object recursively.
+ @param pobj Object to mark.
+ @param marker Marker to set on object.
+*/
+
+void
+wxdobj_mark_recursively(Wxd_object_t *pobj, uint8_t marker);
+
+
+/** Unmark one object recursively.
+ @param pobj Object to modify.
+ @param marker Marker to remove from object.
+*/
+
+void
+wxdobj_unmark_recursively(Wxd_object_t *pobj, uint8_t marker);
+
+
+/** Find stipple structure for object.
+ @param pdrw Drawing the object belongs to.
+ @param pobj Object needing stipple.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_stipple_t *
+wxdobj_find_stipple_structure(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Find font structure for object.
+ @param pdrw Drawing the object belongs to.
+ @param pobj Object needing font.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_font_t *
+wxdobj_find_font_structure(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Remove unused stipple data from drawing.
+ @param pdrw Drawing to clean up.
+*/
+
+void
+wxdobj_remove_unused_stipples(
+ Wxd_drawing_t *pdrw
+);
+
+
+/** Remove unused font data from drawing.
+ @param pdrw Drawing to clean up.
+*/
+
+void
+wxdobj_remove_unused_fonts(
+ Wxd_drawing_t *pdrw
+);
+
+
+/** Get number of used layers in drawing.
+ @param pdrw Drawing to check.
+ @return Number of used layers, may be 0 for empty drawing.
+*/
+
+size_t
+wxdobj_get_number_of_layers(
+ Wxd_drawing_t *pdrw
+);
+
+
+/** Remove object from drawing.
+ The object can be a simple object or a group object.
+ When removing a group object all contents objects are removed too.
+ @param pdrw Drawing containing the object.
+ @param pobj Object to remove.
+*/
+
+void
+wxdobj_obj_delete_from_drawing(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Shift drawing object for a difference.
+ Call this function on members of the flat storage only.
+ @param pobj Object to shift.
+ @param ppt Point containing vector for shifting.
+ @param doit Flag: Really do it (1=yes, 0=simulation/check only).
+ @return 1 on success, 0 on error (mathematical overflow).
+*/
+
+int
+wxdobj_shift(Wxd_object_t *pobj, Wxd_point_t *ppt, int doit);
+
+
+/** Shift drawing objects marked by OBJ_MARKER_1 in a drawing.
+ @param pdrw Drawing containing the objects to shift.
+ @param ppt Point containing vector for shifting.
+ @param doit Flag: Really do it (1=yes, 0=simulation/check only).
+ @return 1 on success, 0 on error (mathematical overflow).
+*/
+
+int
+wxdobj_shift_marked(Wxd_drawing_t *pdrw, Wxd_point_t *ppt, int doit);
+
+
+/** Check whether a given marker is set on object.
+ @param pobj Object to test.
+ @param marker Marker to check for.
+ @return Test result.
+*/
+
+bool
+wxdobj_is_marked(Wxd_object_t const *pobj, uint8_t marker);
+
+
+/** Create copy of an object.
+ The copy is not registered to a drawing.
+ @param psrc Object to copy, must not be a group.
+ @return Valid pointer to new object on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_copy(Wxd_object_t *psrc);
+
+
+
+/** Copy drawing object (recursively if object is a group).
+ @param pdrw Drawing containing the object.
+ @param pobj Drawing object, may be a group.
+ @param psh Shift vector for the copy.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_copy_recursive(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *obj,
+ Wxd_point_t *psh
+);
+
+
+/** Report one object.
+ @param pobj Object to report.
+*/
+
+void
+wxdobj_report_object(
+ Wxd_object_t *pobj
+);
+
+
+/** Find object and point index for point move operation.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_point_move_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+);
+
+
+/** Find object and point index for spline value modification.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_modify_spline_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+);
+
+
+/** Find object and point index for object rotation.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_rotate_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+);
+
+/** Find object and point index for adding a further point.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param pbins Address of flag, whether to append after or insert before.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_point_add_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ bool *pbapp,
+ double dlim
+);
+
+
+/** Find object and point index for point delete operation.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_point_del_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+);
+
+/** Retrieve control point coordinates.
+ @param pdst Destination variable to save point coordinates.
+ @param psrc Object to retrieve control point from.
+ @param pind Control point index.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_get_control_point(
+ Wxd_point_t *pdst,
+ Wxd_object_t const *psrc,
+ uint16_t pind
+);
+
+
+/** Modify control point coordinates.
+ @param pdst Destination object to modify control point.
+ @param psrc New control point coordinates.
+ @param pind Control point index.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_set_control_point(
+ Wxd_object_t *pdst,
+ Wxd_point_t const *psrc,
+ uint16_t pind
+);
+
+
+/** Delete one control point of polygon, polyline or spline.
+ @param pdst Destination object to modify control points.
+ @param pind Control point index.
+*/
+
+void
+wxdobj_delete_control_point(
+ Wxd_object_t *pdst,
+ uint16_t pind
+);
+
+
+/** Add one control point to polygon, polyline or spline.
+ @param pdst Destination object to modify control points.
+ @param pind Control point index.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_add_control_point(
+ Wxd_object_t *pdst,
+ uint16_t pind,
+ Wxd_point_t const *ppt
+);
+
+
+/** Calculate distance from point to box.
+ @param pbox Box coordinates.
+ @param r Radius for rounded corners.
+ @param ppt Point coordinates.
+ @param bCtrlPt Find distance to control points, not lines.
+ @param pIndex Address of index variable for control points.
+ @return Distance from point ppt to box.
+*/
+
+double
+wxdobj_dist_box(
+ Wxd_bb_t *pbox,
+ uint32_t r,
+ dk4_gra_point_t *ppt,
+ bool bCtrlPt,
+ uint16_t *pIndex
+);
+
+
+/** Calculate distance from point to box.
+ @param pbox Box coordinates.
+ @param ppt Point coordinates.
+ @param pIndex Address of index variable for control points.
+ @param dlim Distance limit.
+ @return True if point is near enough to control point, false otherwise.
+*/
+
+bool
+wxdobj_ctrlpt_dist_box(
+ Wxd_bb_t *pbox,
+ dk4_gra_point_t *ppt,
+ uint16_t *pIndex,
+ double dlim
+);
+
+
+/** Set a bounding box structure with control points from an object.
+ @param pbox Bounding box to set up.
+ @param pobj Object to use, must be simple object (not a group).
+*/
+
+bool
+wxdobj_control_pt_to_bb(
+ Wxd_bb_t *pbox,
+ Wxd_object_t const *pobj
+);
+
+
+/** Add object bounding box to another bounding box.
+ @param pbox Accumulated bounding box information for all objects.
+ @param psrc Bounding box information to add for one object.
+*/
+
+bool
+wxdobj_bb_add_bb(
+ Wxd_bb_t *pbox,
+ Wxd_bb_t const *psrc
+);
+
+
+/** Flip one object, use collected bounding box information.
+ @param pobj Object to flip.
+ @param pbox Bounding box information to use.
+ @param bVert Flip vertically (true) or horizontally (false).
+ @param bRealRun Really flip object (false: test only).
+*/
+
+bool
+wxdobj_flip_object(
+ Wxd_object_t *pobj,
+ Wxd_bb_t const *pbox,
+ bool bVert = false,
+ bool bRealRun = true
+);
+
+
+/** Find number of objects in structured storage marked by marker 2.
+ @param pdrw Drawing to check.
+ @return 0, 1 or 2 (for 2 and more).
+*/
+
+int
+wxdobj_num_marked_2(Wxd_drawing_t *pdrw);
+
+
+/** Find bounding box for a simple graphics element.
+ @param pdrw Drawing containing the graphics element.
+ @param pobj Graphics element to find bounding box for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_simple_object(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Rebuild bounding box for structural nodes in a group.
+ Bounding boxes for simple objects are not renewed.
+ @param pdrw Drawing containing the graphics element.
+ @param pobj Graphics element to find bounding box for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_group_structural(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Rebuild bounding box for a group completely (both for structural
+ nodes and simple objects.
+ @param pdrw Drawing containing the graphics element.
+ @param pobj Graphics element to find bounding box for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_group_and_contents(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Rebuild bounding box for a modified object.
+ If the modified (moved) object is a group, rebuild the bounding
+ box completely. If a simple object was modified, rebuild the bounding
+ box for that object; if the object is member of a group, rebuild
+ the groups structural bounding boxes.
+ @param pdrw Drawing containing the graphics element.
+ @param pobj Graphics element to find bounding box for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_modified_object(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** (Re)build bounding box information for all drawing elements.
+ @param pdrw Drawing to build bounding box information for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_for_drawing(
+ Wxd_drawing_t *pdrw
+);
+
+
+/** Set number of sub segments per X-spline segment.
+ @param pdrw Drawing to set up.
+ @param xs Number of sub segments per X-spline segment.
+*/
+
+void
+wxdobj_drw_set_xsubs(Wxd_drawing_t *pdrw, size_t xs);
+
+
+/** Check whether a text label object is a LaTeX text label.
+ @param pobj Object to check.
+ @rturn True for LaTeX text labels, false otherwise.
+*/
+
+bool
+wxdobj_text_is_latex(Wxd_object_t const *pobj);
+
+
+/** Check whether an object can be converted to another object type.
+ @param destot Destination object type.
+ @param pobj Object to check.
+ @return True if the conversion is possible, false otherwise.
+*/
+
+bool
+wxdobj_can_convert(
+ int destot,
+ const Wxd_object_t *pobj
+);
+
+
+/** Rotate an object by 90 degree.
+ @param pobj Object to rotate.
+ @param x0 Center point x coordinate.
+ @param y0 Center point y coordinate.
+ @param neg Flag: Negative direction (false=positive).
+ @param doit Flag: Really do it (false=test only).
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_rotate_object(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+);
+
+
+/** Check two bounding boxes for equality.
+ @param pa One bounding box.
+ @param pb Other bounding box.
+ @return True if both boxes are equal, false otherwise.
+*/
+
+bool
+wxdobj_bb_equal(Wxd_bb_t const *pa, Wxd_bb_t const *pb);
+
+
+/* PROTOTYPES (end) */
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#include "wxdkdraw.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include <dk4math.h>
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include <dk4bif.h>
+#endif
+
+
+#ifndef DK4MAAU16_H_INCLUDED
+#include "dk4maau16.h"
+#endif
+
+#ifndef DK4MAAI16_H_INCLUDED
+#include "dk4maai16.h"
+#endif
+
+#ifndef DK4MAAI32_H_INCLUDED
+#include "dk4maai32.h"
+#endif
+
+$!trace-include
+
+
+
+/** Image types handled by wxdkdraw.
+*/
+static const Wxd_suffix_and_type_t image_type_suffixes[] = {
+ { wxT(".png") , wxBITMAP_TYPE_PNG } ,
+ { wxT(".jpg") , wxBITMAP_TYPE_JPEG } ,
+ { wxT(".jpeg") , wxBITMAP_TYPE_JPEG } ,
+ { wxT(".pbm") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".pgm") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".ppm") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".pnm") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".pam") , wxBITMAP_TYPE_PNM } ,
+ { wxT(".tif") , wxBITMAP_TYPE_TIF } ,
+ { wxT(".tiff") , wxBITMAP_TYPE_TIFF } ,
+ { NULL , wxBITMAP_TYPE_INVALID }
+};
+
+
+
+/** Angles to check when calculating arc bounding box.
+*/
+static double arc_angles[] = {
+ (-4.0 * M_PI),
+ (-3.0 * M_PI - M_PI_2),
+ (-3.0 * M_PI),
+ (-2.0 * M_PI - M_PI_2),
+ (-2.0 * M_PI),
+ (-1.0 * M_PI - M_PI_2),
+ (-1.0 * M_PI),
+ (-1.0 * M_PI_2),
+ 0.0,
+ M_PI_2,
+ M_PI,
+ (M_PI + M_PI_2),
+ (2.0 * M_PI),
+ (2.0 * M_PI + M_PI_2),
+ (3.0 * M_PI),
+ (3.0 * M_PI + M_PI_2)
+};
+
+
+
+/** Number of elements in arc_angles array.
+*/
+static const size_t sz_arc_angles = sizeof(arc_angles)/sizeof(double);
+
+
+
+/** Flip coordinate value.
+ @param min Bounding box minimum.
+ @param max Bounding box maximum.
+ @param v Value to flip.
+ @param erp Error report, may be NULL.
+ @return Flip result.
+*/
+static
+int32_t
+wxdobj_flip_coordinate(int32_t min, int32_t max, int32_t v, dk4_er_t *erp)
+{
+ dk4_er_t er;
+ int32_t back = (int32_t)0L;
+
+ dk4error_init(&er);
+ back = dk4ma_int32_t_sub(dk4ma_int32_t_add(min, max, &er), v, &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_init(&er);
+ back = dk4ma_int32_t_add(min, dk4ma_int32_t_sub(max, v, &er), &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_init(&er);
+ back = dk4ma_int32_t_add(max, dk4ma_int32_t_sub(min, v, &er), &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_init(&er);
+ back = dk4ma_int32_from_double(
+ ((double)min + (double)max - (double)v), &er
+ );
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+/** Set bounding box x and y value.
+ Use this function to add the first point.
+ @param pbox Bounding box to set.
+ @param x X coordinate.
+ @param y Y coordinate.
+*/
+static
+void
+wxdobj_bb_set_point(
+ Wxd_bb_t *pbox,
+ int32_t x,
+ int32_t y
+)
+{
+ if (NULL != pbox) {
+ pbox->xl = pbox->xr = x;
+ pbox->yb = pbox->yt = y;
+ }
+}
+
+
+
+/** Add bounding box x and y value.
+ Use this function to add further points.
+ @param pbox Bounding box to set.
+ @param x X coordinate.
+ @param y Y coordinate.
+*/
+static
+void
+wxdobj_bb_add_point(
+ Wxd_bb_t *pbox,
+ int32_t x,
+ int32_t y
+)
+{
+ if (NULL != pbox) {
+ if (x < pbox->xl) { pbox->xl = x; }
+ if (x > pbox->xr) { pbox->xr = x; }
+ if (y < pbox->yb) { pbox->yb = y; }
+ if (y > pbox->yt) { pbox->yt = y; }
+ }
+}
+
+
+
+bool
+wxdobj_bb_add_bb(
+ Wxd_bb_t *pbox,
+ Wxd_bb_t const *psrc
+)
+{
+ bool back = false;
+ if ((NULL != pbox) && (NULL != psrc)) {
+ wxdobj_bb_add_point(pbox, psrc->xl, psrc->yb);
+ wxdobj_bb_add_point(pbox, psrc->xr, psrc->yt);
+ back = true;
+ }
+ return back;
+}
+
+
+
+void
+wxdobj_report_object(
+#if TRACE_DEBUG
+ Wxd_object_t *pobj
+#else
+ Wxd_object_t * DK4_ARG_UNUSED(pobj)
+#endif
+)
+{
+#if TRACE_DEBUG
+ double s;
+ uint16_t i;
+ int32_t x;
+ int32_t y;
+ $? "+ wxdobj_report_object"
+ if (NULL != pobj) {
+ switch (pobj->ot) {
+ case WXD_OT_GROUP_BEGIN : {
+ $? ". group object"
+ } break;
+ case WXD_OT_TEXT : {
+ $? ". text object"
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if (WXD_OT_POLYLINE == pobj->ot) {
+ $? ". polyline"
+ }
+ else {
+ $? ". polygon"
+ }
+ $? ". points: %u", (unsigned)((pobj->det).p.n)
+ if (NULL != (pobj->det).p.p) {
+ for (i = 0; i < (pobj->det).p.n; i++) {
+ x = ((pobj->det).p.p)[i].x;
+ y = ((pobj->det).p.p)[i].y;
+ $? ". [%u] x = %ld y = %ld",(unsigned)i,(long)x,(long)y
+ }
+ }
+ else {
+ $? "! no point data available"
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if (WXD_OT_O_SPLINE == pobj->ot) {
+ $? ". open spline"
+ }
+ else {
+ $? ". closed spline"
+ }
+ $? ". points: %u", (unsigned)((pobj->det).s.n)
+ if (NULL != (pobj->det).p.p) {
+ for (i = 0; i < (pobj->det).s.n; i++) {
+ x = ((pobj->det).s.p)[i].x;
+ y = ((pobj->det).s.p)[i].y;
+ s = ((pobj->det).s.p)[i].s;
+ $? ". [%u] x = %ld y = %ld s = %g",(unsigned)i,(long)x,(long)y,s
+ }
+ }
+ else {
+ $? "! no point data available"
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (WXD_OT_O_ARC == pobj->ot) {
+ $? ". open arc"
+ }
+ else {
+ $? ". closed arc"
+ }
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ if (WXD_OT_CIRCLE == pobj->ot) {
+ $? ". circle"
+ }
+ else {
+ $? ". ellipse"
+ }
+ $? ". x = %ld", (long)((pobj->det).e.x)
+ $? ". y = %ld", (long)((pobj->det).e.y)
+ $? ". rx = %lu", (unsigned long)((pobj->det).e.rx)
+ $? ". ry = %lu", (unsigned long)((pobj->det).e.ry)
+ $? ". a = %d", (int)((pobj->det).e.a)
+ } break;
+ case WXD_OT_BOX : {
+ $? ". box"
+ } break;
+ case WXD_OT_IMAGE : {
+ $? ". image"
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ if (WXD_OT_DOT_FILLED == pobj->ot) {
+ $? ". colour filled dot"
+ }
+ else {
+ $? ". white dot"
+ }
+ } break;
+ default : {
+ } break;
+ }
+ }
+ else { $? "! NULL pointer"
+ }
+ $? "- wxdobj_report_object"
+#else
+ DK4_UNUSED_ARG(pobj)
+#endif
+}
+
+
+
+bool
+wxdobj_is_active(Wxd_object_t *pobj)
+{
+ bool back = false;
+ $? "+ wxdobj_is_active"
+ if (NULL != pobj) {
+ back = true;
+ if (NULL != pobj->play) {
+ if ((uint8_t)0x00 == pobj->play->active) {
+ back = false;
+ }
+ }
+ }
+ $? "- wxdobj_is_active %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+wxBitmapType
+wxdobj_image_type(wxChar const *fn)
+{
+ wxChar const *suffix;
+ Wxd_suffix_and_type_t const *tptr;
+ wxBitmapType back = wxBITMAP_TYPE_INVALID;
+ $? "+ wxdobj_image_type"
+ suffix = dk4strx_get_path_suffix(fn, NULL);
+ if (NULL != suffix) {
+ tptr = image_type_suffixes;
+ while ((NULL != tptr->suffix) && (wxBITMAP_TYPE_INVALID == back)) {
+ if (0 == dk4strx_casecmp(tptr->suffix, suffix)) {
+ back = tptr->t;
+ }
+ else {
+ tptr++;
+ }
+ }
+ } $? "- wxdobj_image_type %d", (int)back
+ return back;
+}
+
+
+
+void
+wxdobj_det_init_bb(Wxd_bb_t *pdst)
+{
+ $? "+ wxdobj_det_init_bb %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_bb_t));
+ pdst->xl = (int32_t)0L;
+ pdst->xr = (int32_t)0L;
+ pdst->yb = (int32_t)0L;
+ pdst->yt = (int32_t)0L;
+ } $? "- wxdobj_det_init_bb"
+}
+
+
+void
+wxdobj_det_init_text(Wxd_det_text_t *pdst)
+{
+ $? "+ wxdobj_det_init_text %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_text_t));
+ pdst->t = NULL;
+ pdst->tsc = NULL;
+ pdst->font = NULL;
+ pdst->x = (int32_t)0L;
+ pdst->y = (int32_t)0L;
+ pdst->fsz = (uint16_t)12U;
+ pdst->a = (int16_t)0;
+ pdst->find = (uint8_t)0U;
+ pdst->al = WXD_TA_LEFT;
+ pdst->fl = 0x01;
+ pdst->font = NULL;
+ } $? "- wxdobj_det_init_text"
+}
+
+
+
+void
+wxdobj_det_init_poly(Wxd_det_pl_t *pdst)
+{
+ $? "+ wxdobj_det_init_poly %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_pl_t));
+ pdst->p = NULL;
+ pdst->n = (uint16_t)0U;
+ } $? "- wxdobj_det_init_poly"
+}
+
+
+
+void
+wxdobj_det_init_spline(Wxd_det_xs_t *pdst)
+{
+ $? "+ wxdobj_det_init_spline %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_xs_t));
+ pdst->p = NULL;
+ pdst->n = (uint16_t)0U;
+ } $? "- wxdobj_det_init_spline"
+}
+
+
+
+void
+wxdobj_det_init_arc(Wxd_det_arc_t *pdst)
+{
+ $? "+ wxdobj_det_init_arc %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_arc_t));
+ pdst->a = 0.0;
+ pdst->b = 360.0;
+ pdst->x = 0.0;
+ pdst->y = 0.0;
+ pdst->r = 0.0;
+ pdst->x1 = (int32_t)0L;
+ pdst->y1 = (int32_t)0L;
+ pdst->x2 = (int32_t)0L;
+ pdst->y2 = (int32_t)0L;
+ pdst->x3 = (int32_t)0L;
+ pdst->y3 = (int32_t)0L;
+ pdst->d = (int8_t)0;
+ } $? "- wxdobj_det_init_arc"
+}
+
+
+
+void
+wxdobj_det_init_ellipse(Wxd_det_ellipse_t *pdst)
+{
+ $? "+ wxdobj_det_init_ellipse %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_ellipse_t));
+ pdst->x = (int32_t)0L;
+ pdst->y = (int32_t)0L;
+ pdst->rx = (uint32_t)0UL;
+ pdst->ry = (uint32_t)0UL;
+ pdst->a = (int16_t)0;
+ } $? "- wxdobj_det_init_ellipse"
+}
+
+
+
+void
+wxdobj_det_init_box(Wxd_det_box_t *pdst)
+{
+ $? "+ wxdobj_det_init_box %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_box_t));
+ wxdobj_det_init_bb(&(pdst->b));
+ pdst->r = (uint32_t)0UL;
+ } $? "- wxdobj_det_init_box"
+}
+
+
+
+void
+wxdobj_det_init_image(Wxd_det_image_t *pdst)
+{
+ $? "+ wxdobj_det_init_image %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_image_t));
+ pdst->fn = NULL;
+ pdst->bm = NULL;
+ dk4bb_init(&(pdst->pl));
+ wxdobj_det_init_bb(&(pdst->br));
+ pdst->xres = -1.0;
+ pdst->yres = -1.0;
+ pdst->fl = WXD_IMFL_ASPECT | WXD_IMFL_USE_ALPHA
+ | WXD_IMFL_IMG_INT | WXD_IMFL_USE_DCT;
+ pdst->r2g = (int8_t)(-1);
+ pdst->r2c = (int8_t)(-1);
+ pdst->t = wxBITMAP_TYPE_INVALID;
+ } $? "- wxdobj_det_init_image"
+}
+
+
+
+void
+wxdobj_det_init_dot(Wxd_det_dot_t *pdst)
+{
+ $? "+ wxdobj_det_init_dot %d", TR_IPTR(pdst)
+ if (NULL != pdst) {
+ DK4_MEMRES(pdst,sizeof(Wxd_det_dot_t));
+ pdst->x = (int32_t)0L;
+ pdst->y = (int32_t)0L;
+ pdst->d = (uint16_t)0U;
+ } $? "- wxdobj_det_init_dot"
+}
+
+
+
+/** Initialize object, use template if specified.
+ @param pdst Object to initialize.
+ @param ot Object type.
+ @param ptpl Template object, may be NULL.
+*/
+void
+wxdobj_obj_init(Wxd_object_t *pdst, int ot, Wxd_object_t const *ptpl)
+{
+ $? "+ wxdobj_obj_init"
+ if (NULL != ptpl) { $? ". from template"
+ /*
+ Apply template settings
+ */
+ DK4_MEMCPY(pdst,ptpl,sizeof(Wxd_object_t));
+ }
+ else { $? ". no template"
+ /*
+ Apply default settings
+ */
+ DK4_MEMRES(pdst,sizeof(Wxd_object_t));
+ pdst->lay = 0;
+ pdst->lw = 2;
+ pdst->fc[0] = (uint8_t)255U;
+ pdst->fc[1] = (uint8_t)255U;
+ pdst->fc[2] = (uint8_t)255U;
+ pdst->sc[0] = (uint8_t)0U;
+ pdst->sc[1] = (uint8_t)0U;
+ pdst->sc[2] = (uint8_t)0U;
+ pdst->cs = (uint8_t)(WXD_LC_BUTTED);
+ pdst->fs = (uint8_t)(WXD_FS_NONE);
+ pdst->ls = (uint8_t)(WXD_LS_SOLID);
+ pdst->sl = (uint8_t)4U;
+ pdst->js = (uint8_t)(WXD_LJ_MITERED);
+ pdst->ml = (uint8_t)8U;
+ pdst->aft = (uint8_t)0U;
+ pdst->afl = (uint8_t)16U;
+ pdst->afw = (uint8_t)8U;
+ pdst->abt = (uint8_t)0U;
+ pdst->abl = (uint8_t)16U;
+ pdst->abw = (uint8_t)8U;
+ pdst->mark = (uint8_t)0U;
+ }
+ pdst->pa = NULL;
+ pdst->psti = NULL;
+ pdst->play = NULL;
+ pdst->ot = ot;
+ dk4bb_init(&(pdst->bb));
+ /*
+ Use default values for details if no template was specified
+ or template object type does not match
+ */
+ if ((NULL == ptpl) || ((NULL != ptpl) && (ot != ptpl->ot))) {
+ switch (ot) {
+ case WXD_OT_GROUP_BEGIN : {
+ } break;
+ case WXD_OT_TEXT : {
+ wxdobj_det_init_text(&((pdst->det).t));
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ wxdobj_det_init_poly(&((pdst->det).p));
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ wxdobj_det_init_spline(&((pdst->det).s));
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ wxdobj_det_init_arc(&((pdst->det).a));
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ wxdobj_det_init_ellipse(&((pdst->det).e));
+ } break;
+ case WXD_OT_BOX : {
+ wxdobj_det_init_box(&((pdst->det).b));
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_det_init_image(&((pdst->det).i));
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ wxdobj_det_init_dot(&((pdst->det).d));
+ } break;
+ }
+ }
+ /*
+ Make sure not to re-use dynamic objects from template.
+ */
+ switch (ot) {
+ case WXD_OT_GROUP_BEGIN : {
+ (pdst->det).g.s_e = NULL;
+ (pdst->det).g.i_e = NULL;
+ } break;
+ case WXD_OT_TEXT : {
+ (pdst->det).t.t = NULL;
+ (pdst->det).t.tsc = NULL;
+ /*
+ 2020-01-05 Set font to NULL too.
+ */
+ (pdst->det).t.font = NULL;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ (pdst->det).p.n = (uint16_t)0U;
+ (pdst->det).p.p = NULL;
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ (pdst->det).s.n = (uint16_t)0U;
+ (pdst->det).s.p = NULL;
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ } break;
+ case WXD_OT_BOX : {
+ } break;
+ case WXD_OT_IMAGE : {
+ (pdst->det).i.fn = NULL;
+ (pdst->det).i.bm = NULL;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ } break;
+ } $? "- wxdobj_obj_init"
+}
+
+
+
+/** Check whether a layer is used in a drawing, remove layer if unused.
+ @param pdrw Drawing to check and modify.
+ @param play Layer to check and probably remove.
+*/
+
+static
+void
+i_check_layer_structure_removal(Wxd_drawing_t *pdrw, Wxd_layer_t *play)
+{
+ Wxd_object_t *pobj;
+ $? "+ i_check_layer_structure_removal %d", (int)(play->lay)
+ play->used = 0x00;
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ if (NULL != pobj->play) {
+ pobj->play->used = 0x01;
+ }
+ }
+ } while (NULL != pobj);
+ if (0x00 == play->used) { $? ". delete layer"
+ dk4sto_remove(pdrw->s_layers, play, NULL);
+ dk4sto_it_reset(pdrw->i_layers);
+ dk4mem_free(play);
+ }
+ $? "- i_check_layer_structure_removal"
+}
+
+
+
+/** Find group for object.
+ @param pdrw Drawing containing the object.
+ @param pobj Object to search for.
+ @return Valid pointer on success, NULL if not found.
+
+*/
+
+static
+Wxd_object_t *
+i_find_group_for(Wxd_drawing_t *pdrw, Wxd_object_t *pobj)
+{
+ Wxd_object_t *back = NULL; /* Result */
+ Wxd_object_t *pgrc = NULL; /* Group candidate */
+ Wxd_object_t *pgrp = NULL; /* Current (sub)group tested */
+ Wxd_object_t *pno = NULL; /* Next object */
+ void *pt = NULL; /* Test whether object contained */
+ $? "+ i_find_group_for"
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pgrc = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pgrc) {
+ if (WXD_OT_GROUP_BEGIN == pgrc->ot) {
+ if (NULL != dk4sto_it_find_exact((pgrc->det).g.i_e, pobj)) {
+ /*
+ Object found in top-level group
+ */
+ back = pgrc;
+ }
+ else {
+ /*
+ Must search group structure recursively
+ */
+ pgrp = pgrc;
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ while ((NULL != pgrp) && (NULL == back)) {
+ pno = (Wxd_object_t *)dk4sto_it_next((pgrp->det).g.i_e);
+ if (NULL != pno) {
+ if (WXD_OT_GROUP_BEGIN == pno->ot) {
+ pt =
+ dk4sto_it_find_exact((pno->det).g.i_e, pobj);
+ if (NULL != pt) {
+ back = pno;
+ }
+ else {
+ pgrp = pno;
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ }
+ }
+ }
+ else {
+ /*
+ No more objects in group, go up 1 level
+ */
+ pgrp = pgrp->pa;
+ }
+ }
+ }
+ }
+ }
+ } while ((NULL != pgrc) && (NULL == back));
+#if TRACE_DEBUG
+ if (NULL == back) { $? "! not found"
+ }
+#endif
+ $? "- i_find_group_for %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+wxdobj_obj_delete(Wxd_object_t *pobj)
+{
+ $? "+ wxdobj_obj_delete"
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_GROUP_BEGIN : { $? ". group"
+ if (NULL != (pobj->det).g.i_e) {
+ dk4sto_it_close((pobj->det).g.i_e);
+ }
+ if (NULL != (pobj->det).g.s_e) {
+ dk4sto_close((pobj->det).g.s_e);
+ }
+ (pobj->det).g.s_e = NULL;
+ (pobj->det).g.i_e = NULL;
+ } break;
+ case WXD_OT_TEXT : { $? ". text label"
+ dk4mem_release((pobj->det).t.t);
+ dk4mem_release((pobj->det).t.tsc);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : { $? ". polygon"
+ dk4mem_release((pobj->det).p.p);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : { $? ". spline"
+ dk4mem_release((pobj->det).s.p);
+ } break;
+ case WXD_OT_IMAGE : { $? ". image"
+ dk4mem_release((pobj->det).i.fn);
+ if (NULL != (pobj->det).i.bm) { $? ". have bitmap"
+ delete (pobj->det).i.bm;
+ (pobj->det).i.bm = NULL;
+ }
+#if TRACE_DEBUG
+ else { $? "! no bitmap"
+ }
+#endif
+ } break;
+#if TRACE_DEBUG
+ case WXD_OT_O_ARC : { $? ". open arc"
+ } break;
+ case WXD_OT_C_ARC : { $? ". closed arc"
+ } break;
+ case WXD_OT_CIRCLE : { $? ". circle"
+ } break;
+ case WXD_OT_ELLIPSE : { $? ". ellipse"
+ } break;
+ case WXD_OT_BOX : { $? ". box"
+ } break;
+ case WXD_OT_DOT_FILLED : { $? ". dot"
+ } break;
+ case WXD_OT_DOT_WHITE : { $? ". white dot"
+ } break;
+ default : { $? ". other object"
+ } break;
+#endif
+ }
+ dk4mem_free(pobj);
+ }
+#if TRACE_DEBUG
+ else { $? "! pobj"
+ }
+#endif
+ $? "- wxdobj_obj_delete"
+}
+
+
+
+/** Internally delete a group structure recursively.
+ @param pgrp Group structure object to delete
+ (must not be NULL, must be WXD_OT_GROUP_BEGIN type,
+ s_e and i_e must not be NULL).
+*/
+static
+void
+grp_delete_recursive(Wxd_object_t *pgrp)
+{
+ Wxd_object_t *no; /* Next object */
+ Wxd_object_t *ng; /* Next group */
+ $? "+ grp_delete_recursive"
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ while (NULL != pgrp) {
+ no = (Wxd_object_t *)dk4sto_it_next((pgrp->det).g.i_e);
+ if (NULL != no) {
+ if (WXD_OT_GROUP_BEGIN == no->ot) {
+ if ((NULL != (no->det).g.s_e) && (NULL != (no->det).g.i_e)) {
+ dk4sto_it_reset((no->det).g.i_e);
+ pgrp = no;
+ }
+ else {
+ dk4sto_remove((pgrp->det).g.s_e, no, NULL);
+ dk4sto_it_reset((pgrp->det).g.i_e);
+#if 0
+ if (NULL != (no->det).g.s_e) {
+ dk4sto_close((no->det).g.s_e);
+ (no->det).g.s_e = NULL;
+ }
+ dk4mem_free(no);
+#endif
+ wxdobj_obj_delete(no);
+ }
+ }
+ else {
+ no->pa = NULL;
+ dk4sto_remove((pgrp->det).g.s_e, no, NULL);
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ }
+ }
+ else {
+ ng = pgrp->pa;
+ if (NULL != ng) {
+ dk4sto_remove((ng->det).g.s_e, pgrp, NULL);
+ dk4sto_it_reset((ng->det).g.i_e);
+ }
+#if 0
+ dk4sto_it_close((pgrp->det).g.i_e);
+ (pgrp->det).g.i_e = NULL;
+ dk4sto_close((pgrp->det).g.s_e);
+ (pgrp->det).g.s_e = NULL;
+ dk4mem_free(pgrp);
+#endif
+ wxdobj_obj_delete(pgrp);
+ pgrp = ng;
+ }
+ }
+ $? "- grp_delete_recursive"
+}
+
+
+
+void
+wxdobj_grp_delete_recursive(Wxd_object_t *pgrp)
+{
+ $? "+ wxdobj_grp_delete_recursive"
+ if (NULL != pgrp) {
+ if (WXD_OT_GROUP_BEGIN == pgrp->ot) {
+ if ((NULL != (pgrp->det).g.s_e) && (NULL != (pgrp->det).g.i_e)) {
+ grp_delete_recursive(pgrp);
+ }
+ else {
+ if (NULL != (pgrp->det).g.s_e) {
+ dk4sto_close((pgrp->det).g.s_e);
+ (pgrp->det).g.s_e = NULL;
+ }
+ dk4mem_free(pgrp);
+ }
+ }
+ }
+ else {
+ }
+ $? "- wxdobj_grp_delete_recursive"
+}
+
+
+
+void
+wxdobj_drw_delete(Wxd_drawing_t *pdrw)
+{
+ Wxd_object_t *pgrp; /* Current group to delete */
+ Wxd_stipple_t *pstip; /* Current stipple to delete */
+ Wxd_layer_t *play; /* Current layer to delete */
+ Wxd_font_t *pfont; /* Current font to delete */
+ $? "+ wxdobj_drw_delete"
+ if (NULL != pdrw) {
+ /*
+ Delete structured information
+ */
+ $? ". delete structured information"
+ if (NULL != pdrw->s_stru) {
+ if (NULL != pdrw->i_stru) {
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pgrp = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pgrp) {
+ if (WXD_OT_GROUP_BEGIN == pgrp->ot) {
+ wxdobj_grp_delete_recursive(pgrp);
+ }
+ else {
+ pgrp->pa = NULL;
+ }
+ }
+ } while (NULL != pgrp);
+ dk4sto_it_close(pdrw->i_stru);
+ pdrw->i_stru = NULL;
+ }
+ dk4sto_close(pdrw->s_stru);
+ pdrw->s_stru = NULL;
+ }
+ $? ". structured information deleted"
+ /*
+ Delete stipples
+ */
+ $? ". delete stipples"
+ if (NULL != pdrw->s_stip) { $? ". s_stip"
+ if (NULL != pdrw->i_stip) { $? ". i_stip"
+ dk4sto_it_reset(pdrw->i_stip);
+ do { $? ". do"
+ pstip = (Wxd_stipple_t *)dk4sto_it_next(pdrw->i_stip);
+ if (NULL != pstip) {
+ $? ". delete stipple %u (%u,%u,%u) (%u,%u,%u)", (unsigned)(pstip->cd[0]), (unsigned)(pstip->cd[1]),(unsigned)(pstip->cd[2]),(unsigned)(pstip->cd[3]),(unsigned)(pstip->cd[4]),(unsigned)(pstip->cd[5]),(unsigned)(pstip->cd[6])
+ if (NULL != pstip->bm) { $? ". have bitmap"
+ delete (pstip->bm);
+ pstip->bm = NULL;
+ }
+ else { $? "! no bitmap"
+ }
+ dk4mem_free(pstip);
+ }
+ } while (NULL != pstip);
+ dk4sto_it_close(pdrw->i_stip);
+ pdrw->i_stip = NULL;
+ }
+#if TRACE_DEBUG
+ else { $? "! i_stip"
+ }
+#endif
+ dk4sto_close(pdrw->s_stip);
+ pdrw->s_stip = NULL;
+ }
+#if TRACE_DEBUG
+ else { $? "! s_stip"
+ }
+#endif
+ $? ". stipples deleted"
+ /*
+ Delete layers
+ */
+ $? ". delete layers"
+ if (NULL != pdrw->s_layers) {
+ if (NULL != pdrw->i_layers) {
+ dk4sto_it_reset(pdrw->i_layers);
+ do {
+ play = (Wxd_layer_t *)dk4sto_it_next(pdrw->i_layers);
+ if (NULL != play) {
+ $? ". delete layer %d", (int)(play->lay)
+ dk4mem_free(play);
+ }
+ } while (NULL != play);
+ dk4sto_it_close(pdrw->i_layers);
+ pdrw->i_layers = NULL;
+ }
+ dk4sto_close(pdrw->s_layers);
+ pdrw->s_layers = NULL;
+ }
+ $? ". layers deleted"
+ /*
+ Delete flat list and objects
+ */
+ $? ". delete flat list"
+ if (NULL != pdrw->s_flat) {
+ if (NULL != pdrw->i_flat) {
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pgrp = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pgrp) { $? ". delete one object from flat list"
+ wxdobj_obj_delete(pgrp);
+ }
+ } while (NULL != pgrp);
+ dk4sto_it_close(pdrw->i_flat);
+ pdrw->i_flat = NULL;
+ }
+ dk4sto_close(pdrw->s_flat);
+ pdrw->s_flat = NULL;
+ }
+ $? ". flat list deleted"
+ $? ". delete fonts"
+ /*
+ Delete font structures
+ */
+ if (NULL != pdrw->s_fonts) {
+ if (NULL != pdrw->i_fonts) {
+ dk4sto_it_reset(pdrw->i_fonts);
+ do {
+ pfont = (Wxd_font_t *)dk4sto_it_next(pdrw->i_fonts);
+ if (NULL != pfont) {
+ $? ". one font structure to delete"
+ wxdfont_delete(pfont);
+ }
+ } while (NULL != pfont);
+ dk4sto_it_close(pdrw->i_fonts);
+ pdrw->i_fonts = NULL;
+ }
+ dk4sto_close(pdrw->s_fonts);
+ pdrw->s_fonts = NULL;
+ }
+ $? ". fonts deleted"
+ dk4mem_free(pdrw);
+ $? ". finished"
+ }
+#if TRACE_DEBUG
+ else { $? "! pdrw"
+ }
+#endif
+ $? "- wxdobj_drw_delete"
+}
+
+
+
+void
+wxdobj_drw_set_xsubs(Wxd_drawing_t *pdrw, size_t xs)
+{
+ if (NULL != pdrw) {
+ if ((size_t)2U > xs) {
+ xs = (size_t)2U;
+ }
+ pdrw->xsubs = xs;
+ }
+}
+
+
+
+void
+wxdobj_drw_require_redraw(Wxd_drawing_t *pdrw, int level)
+{
+ $? "+ wxdobj_drw_require_redraw %d", level
+ if (NULL != pdrw) {
+ if (level > pdrw->redraw) {
+ pdrw->redraw = level;
+ }
+ }
+ $? "- wxdobj_drw_require_redraw"
+}
+
+
+
+int
+wxdobj_drw_get_required_redraw_level(Wxd_drawing_t *pdrw, int level)
+{
+ $? "+ wxdobj_drw_get_required_redraw_level %d", level
+ if (NULL != pdrw) {
+ if (pdrw->redraw > level) {
+ level = pdrw->redraw;
+ }
+ } $? "- wxdobj_drw_get_required_redraw_level %d", level
+ return level;
+}
+
+
+
+void
+wxdobj_drw_reset_required_redraw_level(Wxd_drawing_t *pdrw)
+{
+ $? "+ wxdobj_drw_reset_required_redraw_level"
+ if (NULL != pdrw) {
+ pdrw->redraw = WXD_REFRESH_NONE;
+ }
+ $? "- wxdobj_drw_reset_required_redraw_level"
+}
+
+
+
+Wxd_drawing_t *
+wxdobj_drw_new(void)
+{
+ Wxd_drawing_t *back = NULL;
+ bool ok = false;
+ $? "+ wxdobj_drw_new"
+ back = dk4mem_new(Wxd_drawing_t,1,NULL);
+ if (NULL != back) {
+ /*
+ Initialize drawing members
+ */
+ back->s_stru = back->s_flat = back->s_stip =
+ back->s_layers = back->s_fonts = NULL;
+ back->i_stru = back->i_flat = back->i_stip =
+ back->i_layers = back->i_fonts = NULL;
+ (back->bb).xl = 0L;
+ (back->bb).yb = 0L;
+ (back->bb).xr = 130048000L;
+ (back->bb).yt = 73152000L;
+ back->xsubs = (size_t)8U;
+ back->cx = 65024000L;
+ back->cy = 36576000L;
+ back->baselw = 101600L;
+ back->bleft = 16256000L;
+ back->bright = 16256000L;
+ back->bbottom = 16256000L;
+ back->btop = 16256000L;
+ back->fv_maj = 1U;
+ back->fv_min = 0U;
+ back->zl = 0;
+ back->gridunit = 0U;
+ back->gridbase = 0U;
+ back->s_stru = dk4sto_open(NULL);
+ back->s_flat = dk4sto_open(NULL);
+ back->s_stip = dk4sto_open(NULL);
+ back->s_layers = dk4sto_open(NULL);
+ back->s_fonts = dk4sto_open(NULL);
+ /*
+ After loading a drawing the first repaint must do a
+ complete redraw.
+ */
+ back->redraw = WXD_REFRESH_GRID;
+ /*
+ Allocate storages and iterators.
+ */
+ if (
+ (NULL != back->s_stru) && (NULL != back->s_flat)
+ && (NULL != back->s_stip) && (NULL != back->s_layers)
+ && (NULL != back->s_fonts)
+ ) {
+ dk4sto_set_comp(back->s_stru, drawobj_compare_object, 0);
+ dk4sto_set_comp(back->s_flat, drawobj_compare_object, 0);
+ dk4sto_set_comp(back->s_stip, drawobj_compare_stipples, 0);
+ dk4sto_set_comp(back->s_layers, drawobj_compare_layers, 0);
+ dk4sto_set_comp(back->s_fonts, wxdfont_compare, 0);
+ back->i_stru = dk4sto_it_open(back->s_stru, NULL);
+ back->i_flat = dk4sto_it_open(back->s_flat, NULL);
+ back->i_stip = dk4sto_it_open(back->s_stip, NULL);
+ back->i_layers = dk4sto_it_open(back->s_layers, NULL);
+ back->i_fonts = dk4sto_it_open(back->s_fonts, NULL);
+ if (
+ (NULL != back->i_stru) && (NULL != back->i_flat)
+ && (NULL != back->i_stip) && (NULL != back->i_layers)
+ && (NULL != back->i_fonts)
+ ) {
+ ok = true;
+ }
+ }
+ /*
+ Check whether initialization completed successfully
+ */
+ if(!(ok)) { $? "! memory"
+ wxdobj_drw_delete(back);
+ back = NULL;
+ }
+ }
+ $? "- wxdobj_drw_new %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+#if 0
+static
+Wxd_object_t *
+wxdobj_obj_new_text(
+ wxChar const *t,
+ wxChar const *tsc,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_text"
+ if (NULL != t) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_TEXT, ptpl);
+ (back->det).t.t = dk4strx_dup(t, NULL);
+ if (NULL == (back->det).t.t) { $? "! memory"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ else {
+ if (NULL != tsc) {
+ (back->det).t.tsc = dk4strx_dup(tsc, NULL);
+ if (NULL == (back->det).t.tsc) { $? "! memory"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ } $? "- wxdobj_obj_new_text %d", TR_IPTR(back)
+ return back;
+}
+#endif
+
+
+
+static
+Wxd_object_t *
+wxdobj_obj_new_polyany(uint16_t np, int ot, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_polyany"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, ot, ptpl);
+ (back->det).p.n = np;
+ (back->det).p.p = NULL;
+ (back->det).p.p = dk4mem_new(Wxd_point_t,((size_t)np),NULL);
+ if (NULL == (back->det).p.p) { $? "! memory"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ } $? "- wxdobj_obj_new_polyany %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_polyline(uint16_t np, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_polyline"
+ if ((uint16_t)1U < np) {
+ back = wxdobj_obj_new_polyany(np, WXD_OT_POLYLINE, ptpl);
+ } $? "- wxdobj_obj_new_polyline %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_polygon(uint16_t np, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_polygon"
+ if ((uint16_t)1U < np) {
+ back = wxdobj_obj_new_polyany(np, WXD_OT_POLYGON, ptpl);
+ } $? "- wxdobj_obj_new_polygon %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_spline(uint16_t np, int cl, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_spline"
+ if ((uint16_t)1U < np) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(
+ back, ((0 != cl) ? (WXD_OT_C_SPLINE) : (WXD_OT_O_SPLINE)), ptpl
+ );
+ (back->det).s.n = np;
+ (back->det).s.p = dk4mem_new(Wxd_spline_point_t,((size_t)np),NULL);
+ if (NULL == (back->det).s.p) { $? "! memory"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ } $? "- wxdobj_obj_new_spline %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_arc(int cl, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_arc"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(
+ back, ((0 != cl) ? (WXD_OT_C_ARC) : (WXD_OT_O_ARC)), ptpl
+ );
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ $? "- wxdobj_obj_new_arc %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_circle(Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_circle"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_CIRCLE, ptpl);
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ $? "- wxdobj_obj_new_circle %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_ellipse(Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_ellipse"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_ELLIPSE, ptpl);
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ $? "- wxdobj_obj_new_ellipse %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_box(Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_box"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_BOX, ptpl);
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ $? "- wxdobj_obj_new_box %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_image(wxChar const *fn, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_image"
+ if (NULL != fn) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_IMAGE, ptpl);
+ (back->det).i.fn = dk4strx_dup(fn, NULL);
+ if (NULL == (back->det).i.fn) { $? "! memory"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ $? "- wxdobj_obj_new_image %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_dot(int wh, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_dot"
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(
+ back, ((0 != wh) ? (WXD_OT_DOT_WHITE) : (WXD_OT_DOT_FILLED)), ptpl
+ );
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ $? "- wxdobj_obj_new_dot %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_obj_new_textlabel(wxChar const *te, Wxd_object_t const *ptpl)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_obj_new_textlabel \"%!xs\"", TR_WXSTR(te)
+ if (NULL != te) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_TEXT, ptpl);
+ if (NULL != ptpl) {
+ back->fc[0] = ptpl->sc[0];
+ back->fc[1] = ptpl->sc[1];
+ back->fc[2] = ptpl->sc[2];
+ }
+ (back->det).t.t = dk4strx_dup(te, NULL);
+ if (NULL == (back->det).t.t) { $? "! memory"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! arg te"
+ }
+#endif
+ $? "- wxdobj_obj_new_textlabel %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+wxdobj_needs_stipple(
+ Wxd_object_t *pobj
+)
+{
+ int back = 0;
+ $? "+ wxdobj_needs_stipple"
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE :
+ case WXD_OT_ELLIPSE :
+ case WXD_OT_BOX : { $? ". object type allows filling"
+ $? ". fs = %u", (unsigned)(pobj->fs)
+ if (WXD_FS_PURE < pobj->fs) {
+ back = 1;
+ }
+ } break;
+ } $? "- wxdobj_needs_stipple %d", back
+ return back;
+}
+
+
+
+/** Find existing stipple structure for object or create a new one.
+ @param pdrw Drawing.
+ @param pobj Object.
+ @return Address of stipple on success, NULL on error.
+*/
+
+static
+Wxd_stipple_t *
+i_find_stipple_structure(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ Wxd_stipple_t teststip;
+ Wxd_stipple_t *back;
+ $? "+ i_find_stipple_structure"
+ teststip.cd[0] = pobj->fs;
+ teststip.cd[1] = pobj->fc[0];
+ teststip.cd[2] = pobj->fc[1];
+ teststip.cd[3] = pobj->fc[2];
+ teststip.cd[4] = pobj->sc[0];
+ teststip.cd[5] = pobj->sc[1];
+ teststip.cd[6] = pobj->sc[2];
+ teststip.cd[7] = 0x01;
+ teststip.bm = NULL;
+
+ back = (Wxd_stipple_t *)dk4sto_it_find_like(
+ pdrw->i_stip, (const void *)(&teststip), 0
+ );
+ if (NULL == back) { $? ". no matching stipple found"
+ back = dk4mem_new(Wxd_stipple_t,1,NULL);
+ if (NULL != back) { $? ". allocated"
+ DK4_MEMCPY(back,&teststip,sizeof(Wxd_stipple_t));
+ back->bm = NULL;
+ if (0 == dk4sto_add(pdrw->s_stip, (void *)back, NULL)) {
+ dk4mem_free(back); $? "! add"
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ else { $? ". added to storage"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ } $? "- i_find_stipple_structure %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+static
+int
+i_find_layer_structure(Wxd_drawing_t *pdrw, Wxd_object_t *pobj)
+{
+ Wxd_layer_t *ptest;
+ int back = 0;
+ $? "+ i_find_layer_structure"
+ if (NULL == pobj->play) {
+ ptest = (Wxd_layer_t *)dk4sto_it_find_like(
+ pdrw->i_layers, &(pobj->lay), 1
+ );
+ if (NULL != ptest) {
+ pobj->play = ptest;
+ back = 1;
+ }
+ else {
+ ptest = dk4mem_new(Wxd_layer_t,1,NULL);
+ if (NULL != ptest) {
+ ptest->lay = pobj->lay;
+ ptest->active = 0x01;
+ ptest->used = 0x01;
+ if (0 != dk4sto_add(pdrw->s_layers, ptest, NULL)) {
+ pobj->play = ptest;
+ back = 1;
+ }
+ else { $? "! memory"
+ dk4mem_free(ptest);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ }
+ }
+ else {
+ back = 1;
+ } $? "- i_find_layer_structure %d", back
+ return back;
+}
+
+
+
+static
+int
+wxdobj_drw_layer_and_stipple(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ int back = 1;
+ $? "+ wxdobj_drw_layer_and_stipple"
+ if (NULL == pobj->play) {
+ if (0 == i_find_layer_structure(pdrw, pobj)) {
+ back = 0;
+ }
+ }
+ if (0 != wxdobj_needs_stipple(pobj)) { $? ". need stipple"
+ if (NULL == pobj->psti) { $? ". no stipple yet"
+ pobj->psti = i_find_stipple_structure(pdrw, pobj);
+ if (NULL == pobj->psti) { $? ". still NULL"
+ back = 0;
+ }
+#if TRACE_DEBUG
+ else {
+ $? ". stipple found"
+ $? ". fs = %u", (unsigned)((pobj->psti)->cd[0])
+ }
+#endif
+ }
+ } $? "- wxdobj_drw_layer_and_stipple %d", back
+ return back;
+}
+
+
+
+int
+wxdobj_drw_register_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t *pobj
+)
+{
+ int back = 0;
+ $? "+ wxdobj_drw_register_object %d %d %d", TR_IPTR(pdrw), TR_IPTR(pgrp), TR_IPTR(pobj)
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ /*
+ Group objects go to structured storage only, no layer structure
+ */
+ if (NULL != pgrp) {
+ if (0 != dk4sto_add((pgrp->det).g.s_e, pobj, NULL)) {
+ pobj->pa = pgrp;
+ back = 1;
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ }
+ else {
+ if (0 != dk4sto_add(pdrw->s_stru, pobj, NULL)) {
+ back = 1;
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ }
+ }
+ else {
+ if (0 != wxdobj_drw_layer_and_stipple(pdrw, pobj)) {
+ /*
+ Non-group elements are added to flat and structured storage
+ */
+ if (0 != dk4sto_add(pdrw->s_flat, pobj, NULL)) {
+ /*
+ Add to structured storage,
+ either group or top-level storage.
+ */
+ if (NULL != pgrp) {
+ if (0 != dk4sto_add((pgrp->det).g.s_e, pobj, NULL)) {
+ back = 1;
+ pobj->pa = pgrp;
+ }
+ else { $? "! memory"
+ dk4sto_remove(pdrw->s_flat, pobj, NULL);
+ }
+ }
+ else {
+ if (0 != dk4sto_add(pdrw->s_stru, pobj, NULL)) {
+ back = 1;
+ }
+ else { $? "! memory"
+ dk4sto_remove(pdrw->s_flat, pobj, NULL);
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! args"
+ }
+#endif
+ $? "- wxdobj_drw_register_object %d", back
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_drw_add_group(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_drw_add_group %d %d", TR_IPTR(pdrw), TR_IPTR(pgrp)
+ if (NULL != pdrw) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxdobj_obj_init(back, WXD_OT_GROUP_BEGIN, NULL);
+ (back->det).g.s_e = dk4sto_open(NULL);
+ if (NULL != (back->det).g.s_e) {
+ dk4sto_set_comp(
+ (back->det).g.s_e, drawobj_compare_object,
+ WXD2LAT_OBJ_COMPARE_CR_PROPERTIES
+ );
+ (back->det).g.i_e = dk4sto_it_open((back->det).g.s_e, NULL);
+ if (NULL != (back->det).g.i_e) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL; $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ else { $? "! memory"
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! args"
+ }
+#endif
+ $? "- wxdobj_drw_add_group %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_polyline(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ uint16_t np,
+ int cl,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_polyline"
+ if (NULL != pdrw) {
+ if (0 != cl) {
+ back = wxdobj_obj_new_polygon(np, ptpl);
+ }
+ else {
+ back = wxdobj_obj_new_polyline(np, ptpl);
+ }
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_polyline %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+bool
+wxdobj_add_polypoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report */
+ Wxd_point_t *pnew; /* New allocated points array */
+ size_t btc; /* Bytes to copy */
+ uint16_t nn; /* New array size */
+ uint16_t num; /* Number of elements to move */
+ uint16_t i; /* Index of element to copy */
+ bool back = false;
+ $? "+ wxdobj_add_polypoint %u", (unsigned)pind
+ if (
+ (NULL != pobj)
+ && (
+ (WXD_OT_POLYLINE == pobj->ot)
+ || (WXD_OT_POLYGON == pobj->ot)
+ )
+ && (NULL != (pobj->det).p.p)
+ ) {
+ dk4error_init(&er);
+ nn = dk4ma_uint16_t_add((pobj->det).p.n, 1U, &er);
+ if (DK4_E_NONE == er.ec) {
+ pnew = dk4mem_new(Wxd_point_t,((size_t)nn),&er);
+ if (NULL != pnew) {
+ back = true;
+ btc = sizeof(Wxd_point_t) * (size_t)((pobj->det).p.n);
+ DK4_MEMCPY(pnew,(pobj->det).p.p,btc);
+ dk4mem_free((pobj->det).p.p);
+ (pobj->det).p.p = pnew;
+ if (pind < (pobj->det).p.n) {
+ num = (pobj->det).p.n - pind;
+ for (i = 0; i < num; i++) {
+ ((pobj->det).p.p)[(pobj->det).p.n - i].x =
+ ((pobj->det).p.p)[(pobj->det).p.n - i - 1].x;
+ ((pobj->det).p.p)[(pobj->det).p.n - i].y =
+ ((pobj->det).p.p)[(pobj->det).p.n - i - 1].y;
+ }
+ }
+ else {
+ ((pobj->det).p.p)[(pobj->det).p.n].x =
+ ((pobj->det).p.p)[(pobj->det).p.n - 1].x;
+ ((pobj->det).p.p)[(pobj->det).p.n].y =
+ ((pobj->det).p.p)[(pobj->det).p.n - 1].y;
+ }
+ (pobj->det).p.n = nn;
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ dk4error_copy(erp, &er);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- wxdobj_add_polypoint %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_del_polypoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ Wxd_point_t *pnew;
+ size_t btc;
+ uint16_t num;
+ uint16_t i;
+ uint16_t nn;
+ bool back = false;
+ $? "+ wxdobj_del_polypoint"
+ $!trace-code wxdobj_report_object(pobj);
+ if (
+ (NULL != pobj)
+ && (
+ (WXD_OT_POLYLINE == pobj->ot)
+ || (WXD_OT_POLYGON == pobj->ot)
+ )
+ ) { $? ". obj ok"
+ $? ". number of points %u", (unsigned)((pobj->det).p.n)
+ back = true;
+ if (pind < ((pobj->det).p.n - 1U)) { $? ". must squeeze"
+ num = (pobj->det).p.n - 1U - pind;
+ for (i = 0U; i < num; i++) {
+ ((pobj->det).p.p)[pind + i].x =
+ ((pobj->det).p.p)[pind + i + 1U].x;
+ ((pobj->det).p.p)[pind + i].y =
+ ((pobj->det).p.p)[pind + i + 1U].y;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". no need to squeeze"
+ }
+#endif
+ nn = (pobj->det).p.n - 1U;
+ pnew = dk4mem_new(Wxd_point_t,((size_t)nn),erp);
+ if (NULL != pnew) { $? ". mem for smaller array"
+ btc = sizeof(Wxd_point_t) * ((size_t)nn);
+ DK4_MEMCPY(pnew,(pobj->det).p.p,btc);
+ dk4mem_free((pobj->det).p.p);
+ (pobj->det).p.p = pnew;
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ (pobj->det).p.n = (pobj->det).p.n - 1U;
+ $? ". number of points %u", (unsigned)((pobj->det).p.n)
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $!trace-code wxdobj_report_object(pobj);
+ $? "- wxdobj_del_polypoint %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_spline(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ uint16_t np,
+ int cl,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_spline"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_spline(np, cl, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_spline %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+bool
+wxdobj_add_splinepoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report */
+ Wxd_spline_point_t *pnew; /* New allocated points array */
+ size_t btc; /* Bytes to copy */
+ uint16_t nn; /* New array size */
+ uint16_t num; /* Number of elements to move */
+ uint16_t i; /* Index of element to copy */
+ bool back = false;
+ $? "+ wxdobj_add_splinepoint %u", (unsigned)pind
+ if (
+ (NULL != pobj)
+ && (
+ (WXD_OT_O_SPLINE == pobj->ot)
+ || (WXD_OT_C_SPLINE == pobj->ot)
+ )
+ && (NULL != (pobj->det).s.p)
+ ) {
+ dk4error_init(&er);
+ nn = dk4ma_uint16_t_add((pobj->det).s.n, 1U, &er);
+ if (DK4_E_NONE == er.ec) {
+ pnew = dk4mem_new(Wxd_spline_point_t,((size_t)nn),&er);
+ if (NULL != pnew) {
+ back = true;
+ btc = sizeof(Wxd_spline_point_t) * (size_t)((pobj->det).s.n);
+ DK4_MEMCPY(pnew,(pobj->det).s.p,btc);
+ dk4mem_free((pobj->det).s.p);
+ (pobj->det).s.p = pnew;
+ if (pind < (pobj->det).s.n) {
+ num = (pobj->det).s.n - pind;
+ for (i = 0; i < num; i++) {
+ ((pobj->det).s.p)[(pobj->det).s.n - i].x =
+ ((pobj->det).s.p)[(pobj->det).s.n - i - 1].x;
+ ((pobj->det).s.p)[(pobj->det).s.n - i].y =
+ ((pobj->det).s.p)[(pobj->det).s.n - i - 1].y;
+ ((pobj->det).s.p)[(pobj->det).s.n - i].s =
+ ((pobj->det).s.p)[(pobj->det).s.n - i - 1].s;
+ }
+ }
+ else {
+ ((pobj->det).s.p)[(pobj->det).s.n].x =
+ ((pobj->det).s.p)[(pobj->det).s.n - 1].x;
+ ((pobj->det).s.p)[(pobj->det).s.n].y =
+ ((pobj->det).s.p)[(pobj->det).s.n - 1].y;
+ ((pobj->det).s.p)[(pobj->det).s.n].s =
+ ((pobj->det).s.p)[(pobj->det).s.n - 1].s;
+ }
+ (pobj->det).s.n = nn;
+ }
+ else {
+ /* ERROR: Memory (already reported) */
+ }
+ }
+ else {
+ dk4error_copy(erp, &er);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- wxdobj_add_splinepoint %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_del_splinepoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ Wxd_spline_point_t *pnew;
+ size_t btc;
+ uint16_t num;
+ uint16_t i;
+ uint16_t nn;
+ bool back = false;
+ $? "+ wxdobj_del_splinepoint"
+ $!trace-code wxdobj_report_object(pobj);
+ if (
+ (NULL != pobj)
+ && (
+ (WXD_OT_O_SPLINE == pobj->ot)
+ || (WXD_OT_C_SPLINE == pobj->ot)
+ )
+ ) { $? ". obj ok"
+ $? ". number of points %u", (unsigned)((pobj->det).s.n)
+ back = true;
+ if (pind < ((pobj->det).s.n - 1U)) { $? ". must squeeze"
+ num = (pobj->det).s.n - 1U - pind;
+ for (i = 0U; i < num; i++) {
+ ((pobj->det).s.p)[pind + i].x =
+ ((pobj->det).s.p)[pind + i + 1U].x;
+ ((pobj->det).s.p)[pind + i].y =
+ ((pobj->det).s.p)[pind + i + 1U].y;
+ ((pobj->det).s.p)[pind + i].s =
+ ((pobj->det).s.p)[pind + i + 1U].s;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". no need to squeeze"
+ }
+#endif
+ nn = (pobj->det).s.n - 1U;
+ pnew = dk4mem_new(Wxd_spline_point_t,((size_t)nn),erp);
+ if (NULL != pnew) { $? ". mem for smaller array"
+ btc = sizeof(Wxd_spline_point_t) * ((size_t)nn);
+ DK4_MEMCPY(pnew,(pobj->det).s.p,btc);
+ dk4mem_free((pobj->det).s.p);
+ (pobj->det).s.p = pnew;
+ }
+#if TRACE_DEBUG
+ else { $? "! memory"
+ }
+#endif
+ (pobj->det).s.n = (pobj->det).s.n - 1U;
+ $? ". number of points %u", (unsigned)((pobj->det).s.n)
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $!trace-code wxdobj_report_object(pobj);
+ $? "- wxdobj_del_splinepoint %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_arc(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ int cl,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_arc"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_arc(cl, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_arc %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_circle(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_circle"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_circle(ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_circle %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_ellipse(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_ellipse"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_ellipse(ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_ellipse %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_box(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_box"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_box(ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_box %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_image(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ wxChar const *fn,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_image"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_image(fn, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_image %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_dot(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ int wh,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_dot"
+ if (NULL != pdrw) {
+ back = wxdobj_obj_new_dot(wh, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_dot %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_add_textlabel(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ wxChar const *te,
+ Wxd_object_t const *ptpl
+)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_add_textlabel"
+ if ((NULL != pdrw) && (NULL != te)) {
+ back = wxdobj_obj_new_textlabel(te, ptpl);
+ if (NULL != back) {
+ if (0 == wxdobj_drw_register_object(pdrw, pgrp, back)) {
+ wxdobj_obj_delete(back);
+ back= NULL;
+ }
+ }
+ }
+ $? "- wxdobj_add_textlabel %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_find_group_for(Wxd_drawing_t *pdrw, Wxd_object_t *pobj)
+{
+ Wxd_object_t *back = NULL;
+ $? "+ wxdobj_find_group_for"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ back = i_find_group_for(pdrw, pobj);
+ }
+ $? "- wxdobj_find_group_for %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+wxdobj_find_layer_structure(Wxd_drawing_t *pdrw, Wxd_object_t *pobj)
+{
+ int back = 0;
+ $? "+ wxdobj_find_layer_structure"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ back = i_find_layer_structure(pdrw, pobj);
+ } $? "- wxdobj_find_layer_structure %d", back
+ return back;
+}
+
+
+
+/** Modify object layer internally.
+ @param pdrw Drawing to modify.
+ @param pobj Object to modify.
+ @param nl New layer differing from objects current layer.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+i_modify_layer(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj,
+ int16_t nl
+)
+{
+ Wxd_layer_t *playold; /* Old layer structure */
+ Wxd_object_t *pgrp; /* Group containing the object */
+ int back = 0; /* Result */
+ $? "+ i_modify_layer"
+ playold = pobj->play;
+ pobj->play = NULL;
+ if (NULL != dk4sto_it_find_exact(pdrw->i_flat, pobj)) {
+ /*
+ In flat list
+ */
+ if (NULL != dk4sto_it_find_exact(pdrw->i_stru, pobj)) {
+ /*
+ Top-level element
+ */
+ dk4sto_remove(pdrw->s_stru, pobj, NULL);
+ dk4sto_remove(pdrw->s_flat, pobj, NULL);
+ pobj->lay = nl;
+ back = wxdobj_drw_register_object(pdrw, NULL, pobj);
+ if (0 == back) { $? "! registration failed"
+ wxdobj_obj_delete(pobj);
+ }
+ wxdobj_drw_require_redraw(pdrw, WXD_REFRESH_DRAWING);
+ }
+ else {
+ /*
+ Member of a group
+ */
+ pgrp = i_find_group_for(pdrw, pobj);
+ if (NULL != pgrp) {
+ /*
+ Group found
+ */
+ dk4sto_remove((pgrp->det).g.s_e, pobj, NULL);
+ dk4sto_remove(pdrw->s_flat, pobj, NULL);
+ pobj->lay = nl;
+ back = wxdobj_drw_register_object(pdrw, pgrp, pobj);
+ if (0 == back) { $? "! registration failed"
+ wxdobj_obj_delete(pobj);
+ }
+ wxdobj_drw_require_redraw(pdrw, WXD_REFRESH_DRAWING);
+ }
+ else { $? "! group not found"
+ /*
+ Group not found
+ */
+ }
+ }
+ }
+ else { $? "! not in flat list"
+ /*
+ Not in flat list
+ */
+ }
+ /*
+ Find layer structure
+ */
+ if (0 != back) {
+ back = i_find_layer_structure(pdrw, pobj);
+ }
+
+ /* Remove playold from drawing if not used by other objects */
+ if (NULL != playold) { i_check_layer_structure_removal(pdrw, playold); }
+ $? "- i_modify_layer %d", back
+ return back;
+}
+
+
+
+int
+wxdobj_modify_layer(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj,
+ int16_t nl
+)
+{
+ int back = 0;
+ $? "+ wxdobj_modify_layer"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (pobj->lay != nl) {
+ back = i_modify_layer(pdrw, pobj, nl);
+ }
+ else {
+ back = 1;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! args"
+ }
+#endif
+ $? "- wxdobj_modify_layer %d", back
+ return back;
+}
+
+
+
+
+void
+wxdobj_bb_correct(Wxd_bb_t *bbptr, uint16_t *ppoint)
+{
+ int32_t x;
+ $? "+ wxdobj_bb_correct"
+ if (NULL != bbptr) {
+ if (bbptr->xl > bbptr->xr) {
+ if (bbptr->yb > bbptr->yt) {
+ x = bbptr->xl;
+ bbptr->xl = bbptr->xr;
+ bbptr->xr = x;
+ x = bbptr->yb;
+ bbptr->yb = bbptr->yt;
+ bbptr->yt = x;
+ if (NULL != ppoint) {
+ switch ( (int)(*ppoint) ) {
+ case 3 : {
+ *ppoint = (uint16_t)0U;
+ } break;
+ case 2 : {
+ *ppoint = (uint16_t)0U;
+ } break;
+ case 1 : {
+ *ppoint = (uint16_t)3U;
+ } break;
+ default : {
+ *ppoint = (uint16_t)2U;
+ } break;
+ }
+ }
+ }
+ else {
+ x = bbptr->xl;
+ bbptr->xl = bbptr->xr;
+ bbptr->xr = x;
+ if (NULL != ppoint) {
+ switch ( (int)(*ppoint) ) {
+ case 3 : {
+ *ppoint = (uint16_t)2U;
+ } break;
+ case 2 : {
+ *ppoint = (uint16_t)3U;
+ } break;
+ case 1 : {
+ *ppoint = (uint16_t)0U;
+ } break;
+ default : {
+ *ppoint = (uint16_t)1U;
+ } break;
+ }
+ }
+ }
+ }
+ else {
+ if (bbptr->yb > bbptr->yt) {
+ x = bbptr->yb;
+ bbptr->yb = bbptr->yt;
+ bbptr->yt = x;
+ if (NULL != ppoint) {
+ switch ( (int)(*ppoint) ) {
+ case 3 : {
+ *ppoint = (uint16_t)0U;
+ } break;
+ case 2 : {
+ *ppoint = (uint16_t)1U;
+ } break;
+ case 1 : {
+ *ppoint = (uint16_t)2U;
+ } break;
+ default : {
+ *ppoint = (uint16_t)3U;
+ } break;
+ }
+ }
+ }
+ }
+ } $? "- wxdobj_bb_correct"
+}
+
+
+
+bool
+wxdobj_bb_is_null_area(Wxd_bb_t *bbptr)
+{
+ bool back = false;
+ $? "+ wxdobj_bb_is_null_area"
+ if (NULL != bbptr) {
+ if (bbptr->xl >= bbptr->xr) {
+ back = true;
+ }
+ if (bbptr->yb >= bbptr->yt) {
+ back = true;
+ }
+ } $? "- wxdobj_bb_is_null_area %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+static
+int32_t
+wxdobj_i32_max(int32_t a, int32_t b)
+{
+ return ((a >= b) ? (a) : (b));
+}
+
+
+
+static
+int32_t
+wxdobj_i32_min(int32_t a, int32_t b)
+{
+ return ((a <= b) ? (a) : (b));
+}
+
+
+
+bool
+wxdobj_bb_intersection(
+ Wxd_bb_t *res,
+ Wxd_bb_t const *a,
+ Wxd_bb_t const *b
+)
+{
+ if ((NULL == res) || (NULL == a) || (NULL == b)) {
+ return false;
+ }
+ if (a->xr < b->xl) return false;
+ if (b->xr < a->xl) return false;
+ if (a->yt < b->yb) return false;
+ if (b->yt < a->yb) return false;
+ res->xl = wxdobj_i32_max(a->xl, b->xl);
+ res->xr = wxdobj_i32_min(a->xr, b->xr);
+ res->yb = wxdobj_i32_max(a->yb, b->yb);
+ res->yt = wxdobj_i32_min(a->yt, b->yt);
+ return true;
+}
+
+
+
+static
+dk4_bif_t *
+wxdobj_image_bif_open(
+ Wxd_object_t *pobj,
+ int dkenc,
+ int wxenc
+)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ dk4_bif_t *back = NULL;
+ const size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+ int res;
+ $? "+ wxdobj_image_bif_open"
+ res = dk4recwx_wxchar_to_dkchar(
+ fnb, szfnb, dkenc, (pobj->det).i.fn, wxenc, NULL
+ );
+ if (0 != res) {
+ back = dk4bif_open(fnb, 1, NULL, NULL);
+ }
+#if TRACE_DEBUG
+ else { $? "! file name conversion failed"
+ }
+#endif
+ $? "- wxdobj_image_bif_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+wxdobj_image_placement(
+ Wxd_object_t *pobj
+)
+{
+ double iw; /* Image width */
+ double ih; /* Image height */
+ double sw; /* Scale factor for width */
+ double sh; /* Scale factor for height */
+ double l; /* Length */
+ double b; /* Border */
+ $? "+ wxdobj_image_placement"
+ $? ". br.xl = %ld", (long)((pobj->det).i.br.xl)
+ $? ". br.xr = %ld", (long)((pobj->det).i.br.xr)
+ $? ". br.yb = %ld", (long)((pobj->det).i.br.yb)
+ $? ". br.yt = %ld", (long)((pobj->det).i.br.yt)
+ if (0 != ((uint16_t)(WXD_IMFL_ASPECT) & (pobj->det).i.fl)) {
+ $? ". keep aspect ratio"
+ wxSize wxsz = ((pobj->det).i.bm)->GetSize();
+ iw = (double)(wxsz.GetWidth());
+ ih = (double)(wxsz.GetHeight());
+ if (
+ (0.0 < (pobj->det).i.xres) && (0.0 < (pobj->det).i.yres)
+ && ((pobj->det).i.xres != (pobj->det).i.yres)
+ ) { $? ". use resolution"
+ iw = iw / (pobj->det).i.xres;
+ ih = ih / (pobj->det).i.yres;
+ }
+ sw = (
+ (double)((pobj->det).i.br.xr) - (double)((pobj->det).i.br.xl)
+ ) / iw;
+ sh = (
+ (double)((pobj->det).i.br.yt) - (double)((pobj->det).i.br.yb)
+ ) / ih;
+ if (sw <= sh) { $? ". more height available"
+ (pobj->det).i.pl.xmin = (pobj->det).i.br.xl;
+ (pobj->det).i.pl.xmax = (pobj->det).i.br.xr;
+ l = sw * ih;
+ b = (double)((pobj->det).i.br.yt) - (double)((pobj->det).i.br.yb);
+ b = (b - l) / 2.0;
+ (pobj->det).i.pl.ymin = (pobj->det).i.br.yb + b;
+ (pobj->det).i.pl.ymax = (pobj->det).i.br.yt - b;
+ }
+ else { $? ". more width available"
+ (pobj->det).i.pl.ymin = (pobj->det).i.br.yb;
+ (pobj->det).i.pl.ymax = (pobj->det).i.br.yt;
+ l = sh * iw;
+ b = (double)((pobj->det).i.br.xr) - (double)((pobj->det).i.br.xl);
+ b = (b - l) / 2.0;
+ (pobj->det).i.pl.xmin = (pobj->det).i.br.xl + b;
+ (pobj->det).i.pl.xmax = (pobj->det).i.br.xr - b;
+ }
+ }
+ else { $? ". fill available space"
+ (pobj->det).i.pl.xmin = (pobj->det).i.br.xl;
+ (pobj->det).i.pl.xmax = (pobj->det).i.br.xr;
+ (pobj->det).i.pl.ymin = (pobj->det).i.br.yb;
+ (pobj->det).i.pl.ymax = (pobj->det).i.br.yt;
+ }
+ $? ". pl.xmin = %g", (pobj->det).i.pl.xmin
+ $? ". pl.xmax = %g", (pobj->det).i.pl.xmax
+ $? ". pl.ymin = %g", (pobj->det).i.pl.ymin
+ $? ". pl.ymax = %g", (pobj->det).i.pl.ymax
+ $? "- wxdobj_image_placement"
+}
+
+
+
+void
+wxdobj_load_image(
+ Wxd_object_t *pobj,
+ int dkenc,
+ int wxenc
+)
+{
+ dk4_bif_t *bifptr;
+ wxString strfn((pobj->det).i.fn);
+ $? "+ wxdobj_load_image"
+ if (NULL == (pobj->det).i.bm) { $? ". no img yet"
+ (pobj->det).i.xres = -1.0;
+ (pobj->det).i.yres = -1.0;
+ (pobj->det).i.t = wxdobj_image_type((pobj->det).i.fn);
+ if (wxBITMAP_TYPE_INVALID != (pobj->det).i.t) {
+ (pobj->det).i.bm = new wxBitmap(
+ strfn, (pobj->det).i.t
+ );
+ if (NULL != (pobj->det).i.bm) { $? ". have bitmap"
+ if (!(((pobj->det).i.bm)->IsOk())) { $? "! not ok"
+ delete ((pobj->det).i.bm);
+ (pobj->det).i.bm = NULL;
+ }
+ }
+ if (NULL != (pobj->det).i.bm) { $? ". have bitmap"
+ if (0 != ((uint16_t)(WXD_IMFL_ASPECT) & (pobj->det).i.fl)) {
+ $? ". keep aspect ratio"
+ bifptr = wxdobj_image_bif_open(pobj, dkenc, wxenc);
+ if (NULL != bifptr) {
+ (pobj->det).i.xres = dk4bif_get_xres(bifptr);
+ (pobj->det).i.yres = dk4bif_get_yres(bifptr);
+ $? ". x resolution = %g", (pobj->det).i.xres
+ $? ". y resolution = %g", (pobj->det).i.yres
+ dk4bif_close(bifptr);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". fill region"
+ }
+#endif
+ wxdobj_image_placement(pobj);
+ }
+#if TRACE_DEBUG
+ else { $? "! no bitmap"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! image type"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? ". have image"
+ }
+#endif
+ $? "- wxdobj_load_image %d", ((NULL != (pobj->det).i.bm) ? 1 : 0)
+}
+
+
+
+void
+wxdobj_unmark_recursively(Wxd_object_t *pobj, uint8_t marker)
+{
+ Wxd_object_t *po;
+ $? "+ wxdobj_unmark_recursively"
+ if (NULL != pobj) {
+ pobj->mark &= (~(marker));
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) {
+ wxdobj_unmark_recursively(po, marker);
+ }
+ } while (NULL != po);
+ }
+ }
+ $? "- wxdobj_unmark_recursively"
+}
+
+
+
+void
+wxdobj_unmark_all(Wxd_drawing_t *pdrw, uint8_t marker)
+{
+ Wxd_object_t *pobj;
+ $? "+ wxdobj_unmark_all"
+ uint8_t mask;
+
+ mask = (~(marker));
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ pobj->mark &= mask;
+ }
+ } while (NULL != pobj);
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pobj) {
+ pobj->mark &= mask;
+ }
+ } while (NULL != pobj);
+ $? "- wxdobj_unmark_all"
+}
+
+
+
+void
+wxdobj_mark_recursively(Wxd_object_t *pobj, uint8_t marker)
+{
+ Wxd_object_t *po;
+ $? "+ wxdobj_mark_recursively"
+ if (NULL != pobj) {
+ pobj->mark |= marker;
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) {
+ wxdobj_mark_recursively(po, marker);
+ }
+ } while (NULL != po);
+ }
+ }
+ $? "- wxdobj_mark_recursively"
+}
+
+
+
+/** Find sector for point relative to box.
+ @param pbox Box.
+ @param r Rounded corners radius.
+ @param ppt Point.
+ @return Sector number, one from:
+ - 0: Point is lower left than box center.
+ - 1: Point is centered below box.
+ - 2: Point is lower right than box center.
+ - 3: Point is left from box center.
+ - 4: Point is in box center.
+ - 5: Point is right from box center.
+ - 6: Point is upper left from box center.
+ - 7: Point is centered over box.
+ - 8: Point is upper right from box center.
+*/
+static
+int
+wxdobj_box_sector(Wxd_bb_t *pbox, uint32_t r, dk4_gra_point_t *ppt)
+{
+ int back = 4;
+ $? "+ wxdobj_box_sector"
+ if (ppt->x < (double)(pbox->xl) + (double)r) {
+ /* X: left */
+ if (ppt->y < (double)(pbox->yb) + (double)r) {
+ back = 0;
+ }
+ else {
+ if (ppt->y > (double)(pbox->yt) - (double)r) {
+ back = 6;
+ }
+ else {
+ back = 3;
+ }
+ }
+ }
+ else {
+ if (ppt->x > (double)(pbox->xr) - (double)r) {
+ /* X: right */
+ if (ppt->y < (double)(pbox->yb) + (double)r) {
+ back = 2;
+ }
+ else {
+ if (ppt->y > (double)(pbox->yt) - (double)r) {
+ back = 8;
+ }
+ else {
+ back = 5;
+ }
+ }
+ }
+ else {
+ /* X: centered */
+ if (ppt->y < (double)(pbox->yb) + (double)r) {
+ back = 1;
+ }
+ else {
+ if (ppt->y > (double)(pbox->yt) - (double)r) {
+ back = 7;
+ }
+ }
+
+ }
+ } $? "- wxdobj_box_sector %d", back
+ return back;
+}
+
+
+
+double
+wxdobj_dist_box(
+ Wxd_bb_t *pbox,
+ uint32_t r,
+ dk4_gra_point_t *ppt,
+ bool bCtrlPt,
+ uint16_t *pIndex
+)
+{
+ dk4_gra_point_t pta;
+ dk4_gra_point_t ptb;
+ double d;
+ double back = -1.0;
+ uint16_t n;
+ $? "+ wxdobj_dist_box"
+ if (bCtrlPt) {
+ pta.x = (double)(pbox->xl);
+ pta.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ n = 0;
+ pta.x = (double)(pbox->xr);
+ pta.y = (double)(pbox->yb);
+ d = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ if (d < back) {
+ back = d;
+ n = 1;
+ }
+ pta.x = (double)(pbox->xr);
+ pta.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ if (d < back) {
+ back = d;
+ n = 2;
+ }
+ pta.x = (double)(pbox->xl);
+ pta.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ if (d < back) {
+ back = d;
+ n = 3;
+ }
+ if (NULL != pIndex) {
+ *pIndex = n;
+ }
+ }
+ else {
+ if ((uint32_t)0UL == r) {
+ pta.x = (double)(pbox->xl);
+ pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xr);
+ ptb.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ pta.x = (double)(pbox->xr);
+ pta.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ ptb.x = (double)(pbox->xl);
+ ptb.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ pta.x = (double)(pbox->xl);
+ pta.y = (double)(pbox->yb);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ }
+ else {
+ switch (wxdobj_box_sector(pbox, r, ppt)) {
+ case 0: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ back = fabs(back - (double)r);
+ } break;
+ case 1: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xr); ptb.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ } break;
+ case 2: {
+ pta.x = (double)(pbox->xr); pta.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ back = fabs(back - (double)r);
+ } break;
+ case 3: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xl); ptb.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ } break;
+ case 5: {
+ pta.x = (double)(pbox->xr); pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xr); ptb.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ } break;
+ case 6: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ back = fabs(back - (double)r);
+ } break;
+ case 7: {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yt);
+ ptb.x = (double)(pbox->xr); ptb.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ } break;
+ case 8: {
+ pta.x = (double)(pbox->xr); pta.y = (double)(pbox->yt);
+ back = dk4gratool_dist_point_point(&pta, ppt, NULL);
+ back = fabs(back - (double)r);
+ } break;
+ default : {
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ ptb.x = (double)(pbox->xr); ptb.y = (double)(pbox->yb);
+ back = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ pta.x = (double)(pbox->xr); pta.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ ptb.x = (double)(pbox->xl); ptb.y = (double)(pbox->yt);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ pta.x = (double)(pbox->xl); pta.y = (double)(pbox->yb);
+ d = dk4gratool_dist_point_track(&pta, &ptb, ppt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ } break;
+ }
+ }
+ }
+ $? "- wxdobj_dist_box %g", back
+ return back;
+}
+
+
+
+bool
+wxdobj_ctrlpt_dist_box(
+ Wxd_bb_t *pbox,
+ dk4_gra_point_t *ppt,
+ uint16_t *pIndex,
+ double dlim
+)
+{
+ double d;
+ uint16_t ind = (uint16_t)0U;
+ bool back = false;
+
+ d = wxdobj_dist_box(pbox, (uint32_t)0UL, ppt, true, &ind);
+ if (dlim >= d) {
+ *pIndex = ind;
+ back = true;
+ }
+ return back;
+}
+
+
+
+static
+double
+wxdobj_dist_dot(
+ Wxd_object_t *pobj,
+ dk4_gra_point_t *grapt
+)
+{
+ dk4_gra_point_t pta;
+ double back = 0.0;
+ double r;
+ $? "+ wxdobj_dist_dot"
+ pta.x = (double)((pobj->det).d.x);
+ pta.y = (double)((pobj->det).d.y);
+ back = dk4gratool_dist_point_point(grapt, &pta, NULL);
+ /* (d / 2) * (16256000 / 160) */
+ r = 50800.0 * (double)((pobj->det).d.d);
+ if (WXD_OT_DOT_WHITE == pobj->ot) {
+ r += 101600.0;
+ }
+ if (back > r) {
+ back = back - r;
+ } $? "- wxdobj_dist_dot %g", back
+ return back;
+}
+
+
+
+double
+wxdobj_distance_to_point(
+ Wxd_object_t *pobj,
+ Wxd_point_t const *ppt,
+ bool bCtrlPt,
+ uint16_t *pIndex
+)
+{
+ dk4_gra_point_t grapt; /* Point to test in double coords */
+ dk4_gra_point_t pta; /* Section start point */
+ dk4_gra_point_t ptb; /* Section end point */
+ double back = -1.0; /* Result distance */
+ double d; /* Distance in current test */
+ double alpha; /* Ellipse rotation in degree */
+ uint16_t i; /* Traverse point array */
+ $? "+ wxdobj_distance_to_point"
+ grapt.x = (double)(ppt->x);
+ grapt.y = (double)(ppt->y);
+ switch ( pobj->ot ) {
+ case WXD_OT_TEXT : {
+ pta.x = (double)((pobj->det).t.x);
+ pta.y = (double)((pobj->det).t.y);
+ back = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if (bCtrlPt && (NULL != pIndex)) { *pIndex = (uint16_t)0U; }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (pobj->det).p.p) && (1 < (pobj->det).p.n)) {
+ if (bCtrlPt) {
+ for (i = 0; i < (pobj->det).p.n; i++) {
+ pta.x = (double)(((pobj->det).p.p)[i].x);
+ pta.y = (double)(((pobj->det).p.p)[i].y);
+ d = dk4gratool_dist_point_point(&pta, &grapt, NULL);
+ if (0 == i) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ }
+ else {
+ if (d < back) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)i; }
+ }
+ }
+ }
+ }
+ else {
+ pta.x = (double)(((pobj->det).p.p)[0].x);
+ pta.y = (double)(((pobj->det).p.p)[0].y);
+ for (i = 0; i < ((pobj->det).p.n - (uint16_t)1U); i++) {
+ ptb.x =
+ (double)(((pobj->det).p.p)[i + (uint16_t)1U].x);
+ ptb.y =
+ (double)(((pobj->det).p.p)[i + (uint16_t)1U].y);
+ d = dk4gratool_dist_point_track(&pta,&ptb,&grapt,NULL);
+ if (0.0 < d) {
+ if ((0.0 > back) || (d < back)) { back = d; }
+ }
+ DK4_MEMCPY(&pta,&ptb,sizeof(dk4_gra_point_t));
+ }
+ if (WXD_OT_POLYGON == pobj->ot) {
+ ptb.x = (double)(((pobj->det).p.p)[0].x);
+ ptb.y = (double)(((pobj->det).p.p)[0].y);
+ d = dk4gratool_dist_point_track(&pta,&ptb,&grapt,NULL);
+ if (0.0 < d) {
+ if ((0.0 > back) || (d < back)) { back = d; }
+ }
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (pobj->det).s.p) && (1 < (pobj->det).s.n)) {
+ if (bCtrlPt) {
+ for (i = 0; i < (pobj->det).s.n; i++) {
+ pta.x = (double)(((pobj->det).s.p)[i].x);
+ pta.y = (double)(((pobj->det).s.p)[i].y);
+ d = dk4gratool_dist_point_point(&pta, &grapt, NULL);
+ if (0 == i) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ }
+ else {
+ if (d < back) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)i; }
+ }
+ }
+ }
+ }
+ else {
+ pta.x = (double)(((pobj->det).s.p)[0].x);
+ pta.y = (double)(((pobj->det).s.p)[0].y);
+ for (i = 0; i < ((pobj->det).s.n - (uint16_t)1U); i++) {
+ ptb.x =
+ (double)(((pobj->det).s.p)[i + (uint16_t)1U].x);
+ ptb.y =
+ (double)(((pobj->det).s.p)[i + (uint16_t)1U].y);
+ d = dk4gratool_dist_point_track(&pta,&ptb,&grapt,NULL);
+ if (0.0 < d) {
+ if ((0.0 > back) || (d < back)) { back = d; }
+ }
+ DK4_MEMCPY(&pta,&ptb,sizeof(dk4_gra_point_t));
+ }
+ if (WXD_OT_C_SPLINE == pobj->ot) {
+ ptb.x = (double)(((pobj->det).s.p)[0].x);
+ ptb.y = (double)(((pobj->det).s.p)[0].y);
+ d = dk4gratool_dist_point_track(&pta,&ptb,&grapt,NULL);
+ if (0.0 < d) {
+ if ((0.0 > back) || (d < back)) { back = d; }
+ }
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ pta.x = (double)((pobj->det).a.x1);
+ pta.y = (double)((pobj->det).a.y1);
+ back = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ pta.x = (double)((pobj->det).a.x2);
+ pta.y = (double)((pobj->det).a.y2);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if ((0.0 <= d) && (d < back)) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)1U; }
+ }
+ pta.x = (double)((pobj->det).a.x3);
+ pta.y = (double)((pobj->det).a.y3);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if ((0.0 <= d) && (d < back)) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = (uint16_t)2U; }
+ }
+ if ((WXD_OT_C_ARC == pobj->ot) && (!(bCtrlPt))) {
+ if (0 != (pobj->det).a.d) {
+ pta.x = (double)((pobj->det).a.x1);
+ pta.y = (double)((pobj->det).a.y1);
+ ptb.x = (pobj->det).a.x;
+ ptb.y = (pobj->det).a.y;
+ d = dk4gratool_dist_point_track(&pta, &ptb, &grapt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ pta.x = (double)((pobj->det).a.x3);
+ pta.y = (double)((pobj->det).a.y3);
+ d = dk4gratool_dist_point_track(&pta, &ptb, &grapt, NULL);
+ if ((0.0 <= d) && (d < back)) { back = d; }
+ }
+ }
+ } break;
+ case WXD_OT_CIRCLE : {
+ if (bCtrlPt) {
+ for (i = 0; i < 4; i++) {
+ switch (i) {
+ case 0 : {
+ pta.x = (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 1 : {
+ pta.x = 0.0;
+ pta.y = (double)((pobj->det).e.rx);
+ } break;
+ case 2 : {
+ pta.x = 0.0 - (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 3 : {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((pobj->det).e.rx);
+ } break;
+ }
+ pta.x += (double)((pobj->det).e.x);
+ pta.y += (double)((pobj->det).e.y);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if (0 == i) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = i; }
+ }
+ else {
+ if (d < back) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = i; }
+ }
+ }
+ }
+ if (NULL != pIndex) {
+ $? ". control point %u", (unsigned)(*pIndex)
+ }
+
+ }
+ else {
+ pta.x = (double)((pobj->det).e.x);
+ pta.y = (double)((pobj->det).e.y);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ d = d - (double)((pobj->det).e.rx);
+ back = fabs(d);
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ if (bCtrlPt) { $? ". ellipse control points"
+ alpha = (M_PI * (double)((pobj->det).e.a)) / 180.0;
+ for (i = 0; i < 4; i++) {
+ switch (i) {
+ case 0 : {
+ pta.x = (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 1 : {
+ pta.x = 0.0;
+ pta.y = (double)((pobj->det).e.ry);
+ } break;
+ case 2 : {
+ pta.x = 0.0 - (double)((pobj->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 3 : {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((pobj->det).e.ry);
+ } break;
+ }
+ dk4gratool_rotate_point(&pta, alpha);
+ pta.x += (double)((pobj->det).e.x);
+ pta.y += (double)((pobj->det).e.y);
+ d = dk4gratool_dist_point_point(&grapt, &pta, NULL);
+ if (0 == i) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = i; }
+ }
+ else {
+ if (d < back) {
+ back = d;
+ if (NULL != pIndex) { *pIndex = i; }
+ }
+ }
+ }
+ if (NULL != pIndex) {
+ $? ". control point %u", (unsigned)(*pIndex)
+ }
+ }
+ else {
+ pta.x = (double)((pobj->det).e.x);
+ pta.y = (double)((pobj->det).e.y);
+ back = dk4gratool_dist_point_ellipse(
+ &pta,(double)((pobj->det).e.rx),(double)((pobj->det).e.ry),
+ ((M_PI * (double)((pobj->det).e.a)) / 180.0), &grapt, NULL
+ );
+ }
+ } break;
+ case WXD_OT_BOX : {
+ back = wxdobj_dist_box(
+ &((pobj->det).b.b), (pobj->det).b.r, &grapt, bCtrlPt, pIndex
+ );
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxdobj_dist_box(
+ &((pobj->det).i.br), 0UL, &grapt, bCtrlPt, pIndex
+ );
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ back = wxdobj_dist_dot(pobj, &grapt);
+ if (NULL != pIndex) { *pIndex = (uint16_t)0U; }
+ } break;
+ } $? "- wxdobj_distance_to_point %g", back
+ return back;
+}
+
+
+
+Wxd_stipple_t *
+wxdobj_find_stipple_structure(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ return (i_find_stipple_structure(pdrw,pobj));
+ }
+ return NULL;
+}
+
+
+
+void
+wxdobj_remove_unused_stipples(
+ Wxd_drawing_t *pdrw
+)
+{
+ Wxd_stipple_t *pstip;
+ Wxd_object_t *pobj;
+ bool changed;
+ $? "+ wxdobj_remove_unused_stipples"
+ /*
+ Mark all stipples as unused
+ */
+ dk4sto_it_reset(pdrw->i_stip);
+ do {
+ pstip = (Wxd_stipple_t *)dk4sto_it_next(pdrw->i_stip);
+ if (NULL != pstip) {
+ pstip->cd[7] = 0x00;
+ }
+ } while (NULL != pstip);
+ /*
+ Mark used stipples
+ */
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ if (NULL != pobj->psti) {
+ pobj->psti->cd[7] = 0x01;
+ }
+ }
+ } while (NULL != pobj);
+ /*
+ Remove stipples not marked as used
+ */
+ do {
+ changed = false;
+ dk4sto_it_reset(pdrw->i_stip);
+ do {
+ pstip = (Wxd_stipple_t *)dk4sto_it_next(pdrw->i_stip);
+ if (NULL != pstip) {
+ if (0x00 == pstip->cd[7]) {
+ $? ". unused stipple found"
+#if TRACE_DEBUG
+ for (size_t i = 0; i < 8; i++) {
+ $? ". [%u] = %u", (unsigned)i, (unsigned)(pstip->cd[i])
+ }
+ $? ". bm = %d", TR_IPTR(pstip->bm)
+#endif
+ changed = true;
+ dk4sto_remove(pdrw->s_stip, pstip, NULL);
+ if (NULL != pstip->bm) {
+ delete (pstip->bm);
+ }
+ dk4mem_free(pstip);
+ }
+ }
+ } while ((NULL != pstip) && (!(changed)));
+ } while (changed);
+ $? "- wxdobj_remove_unused_stipples"
+}
+
+
+
+void
+wxdobj_remove_unused_fonts(
+ Wxd_drawing_t *pdrw
+)
+{
+ Wxd_font_t *pfont;
+ Wxd_object_t *pobj;
+ bool changed;
+ $? "+ wxdobj_remove_unused_fonts"
+ /* Mark all fonts as unused
+ */
+ dk4sto_it_reset(pdrw->i_fonts);
+ do {
+ pfont = (Wxd_font_t *)dk4sto_it_next(pdrw->i_fonts);
+ if (NULL != pfont) {
+ pfont->used = false;
+ }
+ } while (NULL != pfont);
+ /*
+ Mark used fonts
+ */
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ if (WXD_OT_TEXT == pobj->ot) {
+ if (NULL != (pobj->det).t.font) {
+ ((pobj->det).t.font)->used = true;
+ }
+ }
+ }
+ } while (NULL != pobj);
+ /*
+ Remove fonts not marked as used
+ */
+ do {
+ changed = false;
+ dk4sto_it_reset(pdrw->i_fonts);
+ do {
+ pfont = (Wxd_font_t *)dk4sto_it_next(pdrw->i_fonts);
+ if (NULL != pfont) {
+ if (!(pfont->used)) {
+ changed = true;
+ dk4sto_remove(pdrw->s_fonts, pfont, NULL);
+ if (NULL != pfont->font) {
+ delete (pfont->font);
+ pfont->font = NULL;
+ }
+ dk4mem_free(pfont);
+ }
+ }
+ } while ((NULL != pfont) && (!(changed)));
+ } while (changed);
+ $? "- wxdobj_remove_unused_fonts"
+}
+
+
+
+size_t
+wxdobj_get_number_of_layers(
+ Wxd_drawing_t *pdrw
+)
+{
+ size_t back = 0U;
+ $? "+ wxdobj_get_number_of_layers"
+ if (NULL != pdrw) {
+ if (NULL != pdrw->i_layers) {
+ dk4sto_it_reset(pdrw->i_layers);
+ while (NULL != dk4sto_it_next(pdrw->i_layers)) { back++; }
+ }
+ } $? "- wxdobj_get_number_of_layers %u", (unsigned)back
+ return back;
+}
+
+
+
+void
+wxdobj_obj_delete_from_drawing(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ Wxd_object_t *po;
+ Wxd_object_t *pn;
+ $? "+ wxdobj_obj_delete_from_drawing"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) { $? ". group"
+ dk4sto_remove(pdrw->s_stru, (void *)pobj, NULL);
+ pobj->pa = NULL;
+ dk4sto_it_reset((pobj->det).g.i_e);
+ while (NULL != pobj) { $? ". start of loop"
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) { $? ". yet another object"
+ if (WXD_OT_GROUP_BEGIN == po->ot) { $? ". group object"
+ if (
+ (NULL != (po->det).g.s_e)
+ && (NULL != (po->det).g.i_e)
+ ) { $? ". complete group"
+ dk4sto_it_reset((po->det).g.i_e);
+ po->pa = pobj;
+ pobj = po;
+ }
+ else { $? ". incomplete group"
+ wxdobj_obj_delete(po);
+ }
+ }
+ else { $? ". normal object"
+ dk4sto_remove(pdrw->s_flat, (void *)po, NULL);
+ wxdobj_obj_delete(po);
+ }
+ }
+ else { $? ". no more contents objects"
+ pn = pobj->pa;
+ wxdobj_obj_delete(pobj);
+ pobj = pn;
+ }
+ $? ". end of loop %d", TR_IPTR(pobj)
+ }
+ }
+ else { $? ". simple object"
+ dk4sto_remove(pdrw->s_stru, (void *)pobj, NULL);
+ dk4sto_remove(pdrw->s_flat, (void *)pobj, NULL);
+ wxdobj_obj_delete(pobj);
+ }
+ }
+ else { $? "! pdrw, pobj"
+ if (NULL != pobj) {
+ wxdobj_obj_delete(pobj);
+ }
+ }
+ $? "- wxdobj_obj_delete_from_drawing"
+}
+
+
+
+int
+wxdobj_shift(Wxd_object_t *pobj, Wxd_point_t *ppt, int doit)
+{
+ dk4_er_t er;
+ int32_t xdiff = (int32_t)0L;
+ int32_t ydiff = (int32_t)0L;
+ int back = 0;
+ uint16_t i = 0;
+ $? "+ wxdobj_shift"
+ if (NULL != pobj) {
+ if (NULL != ppt) {
+ xdiff = ppt->x;
+ ydiff = ppt->y;
+ if (((int32_t)0L != xdiff) || ((int32_t)0L != ydiff)) {
+ dk4error_init(&er);
+ back = 1;
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : { $? ". text"
+ if (0 != doit) {
+ (pobj->det).t.x = dk4ma_int32_t_add(
+ (pobj->det).t.x, xdiff, &er
+ );
+ (pobj->det).t.y = dk4ma_int32_t_add(
+ (pobj->det).t.y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ (pobj->det).t.x, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).t.y, ydiff, &er
+ );
+ }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ $? ". polyline/polygon"
+ if (
+ (NULL != (pobj->det).p.p)
+ && ((uint16_t)0U < (pobj->det).p.n)
+ ) {
+ for (i = 0; i < (pobj->det).p.n; i++) {
+ if (0 != doit) {
+ ((pobj->det).p.p)[i].x =
+ dk4ma_int32_t_add(
+ ((pobj->det).p.p)[i].x, xdiff, &er
+ );
+ ((pobj->det).p.p)[i].y =
+ dk4ma_int32_t_add(
+ ((pobj->det).p.p)[i].y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ ((pobj->det).p.p)[i].x, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ ((pobj->det).p.p)[i].y, ydiff, &er
+ );
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ $? ". spline"
+ if (
+ (NULL != (pobj->det).s.p)
+ && ((uint16_t)0U < (pobj->det).s.n)
+ ) {
+ for (i = 0; i < (pobj->det).s.n; i++) {
+ if (0 != doit) {
+ ((pobj->det).s.p)[i].x =
+ dk4ma_int32_t_add(
+ ((pobj->det).s.p)[i].x, xdiff, &er
+ );
+ ((pobj->det).s.p)[i].y =
+ dk4ma_int32_t_add(
+ ((pobj->det).s.p)[i].y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ ((pobj->det).s.p)[i].x, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ ((pobj->det).s.p)[i].y, ydiff, &er
+ );
+ }
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ $? ". arc"
+ if (0 != doit) {
+ (pobj->det).a.x1 = dk4ma_int32_t_add(
+ (pobj->det).a.x1, xdiff, &er
+ );
+ (pobj->det).a.y1 = dk4ma_int32_t_add(
+ (pobj->det).a.y1, ydiff, &er
+ );
+ (pobj->det).a.x2 = dk4ma_int32_t_add(
+ (pobj->det).a.x2, xdiff, &er
+ );
+ (pobj->det).a.y2 = dk4ma_int32_t_add(
+ (pobj->det).a.y2, ydiff, &er
+ );
+ (pobj->det).a.x3 = dk4ma_int32_t_add(
+ (pobj->det).a.x3, xdiff, &er
+ );
+ (pobj->det).a.y3 = dk4ma_int32_t_add(
+ (pobj->det).a.y3, ydiff, &er
+ );
+ (pobj->det).a.x += (double)xdiff;
+ (pobj->det).a.y += (double)ydiff;
+ }
+ else {
+ (void)dk4ma_int32_t_add((pobj->det).a.x1,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.y1,ydiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.x2,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.y2,ydiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.x3,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).a.y3,ydiff,&er);
+ }
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ $? ". circle/ellipse"
+ if (0 != doit) {
+ (pobj->det).e.x = dk4ma_int32_t_add(
+ (pobj->det).e.x, xdiff, &er
+ );
+ (pobj->det).e.y = dk4ma_int32_t_add(
+ (pobj->det).e.y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add((pobj->det).e.x,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).e.y,ydiff,&er);
+ }
+ } break;
+ case WXD_OT_BOX : {
+ $? ". box"
+ if (0 != doit) {
+ (pobj->det).b.b.xl = dk4ma_int32_t_add(
+ (pobj->det).b.b.xl, xdiff, &er
+ );
+ (pobj->det).b.b.xr = dk4ma_int32_t_add(
+ (pobj->det).b.b.xr, xdiff, &er
+ );
+ (pobj->det).b.b.yb = dk4ma_int32_t_add(
+ (pobj->det).b.b.yb, ydiff, &er
+ );
+ (pobj->det).b.b.yt = dk4ma_int32_t_add(
+ (pobj->det).b.b.yt, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ (pobj->det).b.b.xl, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).b.b.xr, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).b.b.yb, ydiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).b.b.yt, ydiff, &er
+ );
+ }
+ } break;
+ case WXD_OT_IMAGE : {
+ $? ". image"
+ if (0 != doit) {
+ (pobj->det).i.br.xl = dk4ma_int32_t_add(
+ (pobj->det).i.br.xl, xdiff, &er
+ );
+ (pobj->det).i.br.xr = dk4ma_int32_t_add(
+ (pobj->det).i.br.xr, xdiff, &er
+ );
+ (pobj->det).i.br.yb = dk4ma_int32_t_add(
+ (pobj->det).i.br.yb, ydiff, &er
+ );
+ (pobj->det).i.br.yt = dk4ma_int32_t_add(
+ (pobj->det).i.br.yt, ydiff, &er
+ );
+ /* Re-calculate image placement
+ */
+ wxdobj_image_placement(pobj);
+ }
+ else {
+ (void)dk4ma_int32_t_add(
+ (pobj->det).i.br.xl, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).i.br.xr, xdiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).i.br.yb, ydiff, &er
+ );
+ (void)dk4ma_int32_t_add(
+ (pobj->det).i.br.yt, ydiff, &er
+ );
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ $? ". dot"
+ if (0 != doit) {
+ (pobj->det).d.x = dk4ma_int32_t_add(
+ (pobj->det).d.x, xdiff, &er
+ );
+ (pobj->det).d.y = dk4ma_int32_t_add(
+ (pobj->det).d.y, ydiff, &er
+ );
+ }
+ else {
+ (void)dk4ma_int32_t_add((pobj->det).d.x,xdiff,&er);
+ (void)dk4ma_int32_t_add((pobj->det).d.y,ydiff,&er);
+ }
+ } break;
+ }
+ if (DK4_E_NONE != er.ec) {
+ back = 0; $? "! overflow"
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ $? "- wxdobj_shift %d", back
+ return back;
+}
+
+
+
+int
+wxdobj_shift_marked(Wxd_drawing_t *pdrw, Wxd_point_t *ppt, int doit)
+{
+ Wxd_object_t *pobj;
+ int back = 0;
+ $? "+ wxdobj_shift_marked"
+ if (NULL != pdrw) {
+ back = 1;
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) {
+ if ((uint8_t)0U != (OBJ_MARKER_1 & (pobj->mark))) {
+ if (0 == wxdobj_shift(pobj, ppt, doit)) {
+ back = 0;
+ }
+ }
+ }
+ } while (NULL != pobj);
+ }
+ $? "- wxdobj_shift_marked %d", back
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_copy(Wxd_object_t *psrc)
+{
+ Wxd_object_t *back = NULL;
+ wxBitmap *obm = NULL;
+ size_t npt;
+ $? "+ wxdobj_copy %d", TR_IPTR(psrc)
+ if (NULL != psrc) {
+ if (WXD_OT_GROUP_BEGIN != psrc->ot) {
+ back = dk4mem_new(Wxd_object_t,1,NULL);
+ if (NULL != back) {
+ DK4_MEMCPY(back,psrc,sizeof(Wxd_object_t));
+ back->pa = NULL;
+ switch (psrc->ot) {
+ case WXD_OT_TEXT : {
+ /* t.t, t.tsc */
+ (back->det).t.t = NULL;
+ (back->det).t.tsc = NULL;
+ (back->det).t.t = dk4strx_dup((psrc->det).t.t, NULL);
+ if (NULL != (back->det).t.t) {
+ if (NULL != (psrc->det).t.tsc) {
+ (back->det).t.tsc =
+ dk4strx_dup((psrc->det).t.tsc, NULL);
+ if (NULL == (back->det).t.tsc) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ else {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ /* p.p */
+ npt = (size_t)((psrc->det).p.n);
+ (back->det).p.p = dk4mem_new(Wxd_point_t, npt, NULL);
+ if (NULL != (back->det).p.p) {
+ npt *= sizeof(Wxd_point_t);
+ DK4_MEMCPY((back->det).p.p,(psrc->det).p.p,npt);
+ }
+ else {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ /* s.p */
+ npt = (size_t)((psrc->det).s.n);
+ (back->det).s.p =
+ dk4mem_new(Wxd_spline_point_t,npt,NULL);
+ if (NULL != (back->det).s.p) {
+ npt *= sizeof(Wxd_spline_point_t);
+ DK4_MEMCPY((back->det).s.p,(psrc->det).s.p,npt);
+ }
+ else {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ } break;
+ case WXD_OT_IMAGE : {
+ /* i.fn, i.bm */
+ (back->det).i.fn = NULL;
+ (back->det).i.bm = NULL;
+ obm = (psrc->det).i.bm;
+ (back->det).i.fn = dk4strx_dup((psrc->det).i.fn, NULL);
+ if (NULL != (back->det).i.fn) {
+ (back->det).i.bm =
+ new wxBitmap(
+ obm->GetSubBitmap(
+ wxRect(0, 0, obm->GetWidth(), obm->GetHeight())
+ )
+ );
+ if (NULL == (back->det).i.bm) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ else {
+ if (!(((back->det).i.bm)->IsOk())) {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ }
+ }
+ else {
+ wxdobj_obj_delete(back);
+ back = NULL;
+ }
+ } break;
+ }
+ }
+ }
+ } $? "- wxdobj_copy %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Test whether the entire group contents can be shifted by given vector.
+ @param pgrsrc Group containing objects to shift.
+ @param psh Shift vector.
+ @param doit Flag: Really do shift operation, 0=test only.
+ @return 1 on success, 0 on error (numeric overflow).
+*/
+
+static
+int
+wxdobj_i_group_shift(
+ Wxd_object_t *pgrsrc,
+ Wxd_point_t *psh,
+ int doit
+)
+{
+ Wxd_object_t *pno;
+ int back = 1;
+ $? "+ wxdobj_i_group_shift"
+ pgrsrc->pa = NULL;
+ dk4sto_it_reset((pgrsrc->det).g.i_e);
+ while ((1 == back) && (NULL != pgrsrc)) {
+ pno = (Wxd_object_t *)dk4sto_it_next((pgrsrc->det).g.i_e);
+ if (NULL != pno) {
+ if (WXD_OT_GROUP_BEGIN == pno->ot) {
+ if (
+ (NULL != (pgrsrc->det).g.s_e)
+ && (NULL != (pgrsrc->det).g.i_e)
+ ) {
+ pno->pa = pgrsrc;
+ pgrsrc = pno;
+ dk4sto_it_reset((pgrsrc->det).g.i_e);
+ }
+ }
+ else {
+ if (0 == wxdobj_shift(pno, psh, doit)) {
+ back = 0;
+ }
+ }
+ }
+ else {
+ pgrsrc = pgrsrc->pa;
+ }
+ } $? "- wxdobj_i_group_shift %d", back
+ return back;
+}
+
+
+
+/** Test whether the entire group contents can be shifted by given vector.
+ @param pgrsrc Group containing objects to shift.
+ @param psh Shift vector.
+ @return 1 on success, 0 on error (numeric overflow).
+*/
+
+static
+int
+wxdobj_group_test_shift(
+ Wxd_object_t *pgrsrc,
+ Wxd_point_t *psh
+)
+{
+ int back = 0;
+ $? "+ wxdobj_group_test_shift"
+ if (NULL != pgrsrc) {
+ if (NULL != psh) {
+ if (((int32_t)0L != psh->x) || ((int32_t)0L != psh->y)) {
+ back = wxdobj_i_group_shift(pgrsrc, psh, 0);
+ }
+ else { $? ". 0 vector"
+ back = 1;
+ }
+ }
+ else { $? ". no vector"
+ back = 1;
+ }
+ }
+ $? "- wxdobj_group_test_shift %d", back
+ return back;
+}
+
+
+
+
+/** Copy group contents recursively.
+ Both source and destination group object must be root group
+ objects having no parent.
+ @param pdrw Drawing containing both groups.
+ @param pgrdst Destination group.
+ @param pgrsrc Source group.
+ @param psh Shift vector for the copy.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+wxdobj_i_group_copy(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrdst,
+ Wxd_object_t *pgrsrc,
+ Wxd_point_t *psh
+)
+{
+ Wxd_object_t *pso;
+ Wxd_object_t *pdo;
+ int back = 1;
+ $? "+ wxdobj_i_group_copy"
+ dk4sto_it_reset((pgrsrc->det).g.i_e);
+ while ((NULL != pgrsrc) && (NULL != pgrdst) && (1 == back)) {
+ pso = (Wxd_object_t *)dk4sto_it_next((pgrsrc->det).g.i_e);
+ if (NULL != pso) {
+ if (WXD_OT_GROUP_BEGIN == pso->ot) {
+ if (
+ (NULL != (pso->det).g.s_e)
+ && (NULL != (pso->det).g.i_e)
+ ) {
+ pdo = wxdobj_drw_add_group(pdrw, pgrdst);
+ if (NULL != pdo) {
+ dk4sto_it_reset((pso->det).g.i_e);
+ pgrsrc = pso;
+ pgrdst = pdo;
+ }
+ else {
+ back = 0;
+ }
+ }
+ }
+ else {
+ pdo = wxdobj_copy(pso);
+ if (NULL != pdo) {
+ if (0 != wxdobj_drw_register_object(pdrw, pgrdst, pdo)) {
+ wxdobj_shift(pdo, psh, 1);
+ }
+ else {
+ wxdobj_obj_delete(pdo);
+ back = 0;
+ }
+ }
+ else {
+ back = 0;
+ }
+ }
+ }
+ else {
+ pgrsrc = pgrsrc->pa;
+ pgrdst = pgrdst->pa;
+ }
+ }
+ $? "- wxdobj_i_group_copy %d", back
+ return back;
+}
+
+
+
+int
+wxdobj_copy_recursive(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj,
+ Wxd_point_t *psh
+)
+{
+ Wxd_object_t *pno;
+ Wxd_object_t *png;
+ int back = 0;
+ $? "+ wxdobj_copy_recursive"
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN != pobj->ot) {
+ /*
+ Copy simple object
+ */
+ if (0 != wxdobj_shift(pobj, psh, 0)) {
+ pno = wxdobj_copy(pobj);
+ if (NULL != pno) {
+ wxdobj_shift(pno, psh, 1);
+ if (0 != wxdobj_drw_register_object(pdrw, NULL, pno)) {
+ back = 1;
+ wxdobj_bb_simple_object(pdrw, pno);
+ }
+ else {
+ wxdobj_obj_delete(pno);
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = 0;
+ }
+ }
+ else {
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = 0;
+ }
+ }
+ else { $? "! shift"
+ /* ERROR: Failed to shift */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+#endif
+ back = 0;
+ }
+ }
+ else {
+ /*
+ Copy a group of objects, probably including subgroups...
+ */
+ if (0 != wxdobj_group_test_shift(pobj, psh)) {
+ png = wxdobj_drw_add_group(pdrw, NULL);
+ if (NULL != png) {
+ back = wxdobj_i_group_copy(pdrw, png, pobj, psh);
+ wxdobj_bb_modified_object(pdrw, png);
+ }
+ else {
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = false;
+ }
+ }
+ else { $? "! shift"
+ /* ERROR: Failed to shift */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_OVERFLOW_COORDINATES
+ );
+#endif
+ back = false;
+ }
+ }
+ }
+ $? "- wxdobj_copy_recursive %d", back
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_point_move_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+)
+{
+ Wxd_object_t *back = NULL; /* Object to modify */
+ Wxd_object_t *pcand = NULL; /* Current object to test */
+ double backd; /* Distance to back */
+ double candd; /* Distance to cand */
+ double backx; /* Distance to back */
+ double candx; /* Distance to cand */
+ uint16_t backi; /* Point index on back */
+ uint16_t candi; /* Point index on cand */
+ $? "+ wxdobj_point_move_find_object dlim=%g", dlim
+ if ((NULL != pdrw) && (NULL != ppt) && (NULL != pindex)) {
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pcand = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pcand) { $? ". yet another object to test"
+ if (wxdobj_is_active(pcand)) {
+ switch ( (int)(pcand->ot) ) {
+ case WXD_OT_TEXT :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE :
+ case WXD_OT_ELLIPSE :
+ case WXD_OT_BOX :
+ case WXD_OT_IMAGE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ candd = wxdobj_distance_to_point(pcand,ppt,true,&candi);
+ candx = wxdobj_distance_to_point(pcand, ppt);
+ $? ". candd=%g candx=%g", candd, candx
+ if (dlim >= candd) { $? ". within limit"
+ if (NULL == back) { $? ". first object"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else { $? ". already have obj"
+ if (backd > candd) { $? ". smaller distance"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if ((!(backd < candd)) && (backx > candx)) {
+ $? ". equal distance, better"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+#if TRACE_DEBUG
+ else { $? ". distances larger"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". distance larger than limit"
+ }
+#endif
+ } break;
+ }
+ }
+ }
+ } while (NULL != pcand);
+ if (NULL != back) {
+ *pindex = backi;
+ }
+ }
+ $? "- wxdobj_point_move_find_object %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_modify_spline_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+)
+{
+ Wxd_object_t *back = NULL; /* Object to modify */
+ Wxd_object_t *pcand = NULL; /* Current object to test */
+ double backd; /* Distance to back */
+ double candd; /* Distance to cand */
+ double backx; /* Distance to back */
+ double candx; /* Distance to cand */
+ uint16_t backi; /* Point index on back */
+ uint16_t candi; /* Point index on cand */
+ $? "+ wxdobj_point_move_find_object dlim=%g", dlim
+ if ((NULL != pdrw) && (NULL != ppt) && (NULL != pindex)) {
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pcand = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pcand) { $? ". yet another object to test"
+ if (wxdobj_is_active(pcand)) {
+ switch ( (int)(pcand->ot) ) {
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE :
+ {
+ candd = wxdobj_distance_to_point(pcand,ppt,true,&candi);
+ candx = wxdobj_distance_to_point(pcand, ppt);
+ $? ". candd=%g candx=%g", candd, candx
+ if (dlim >= candd) { $? ". within limit"
+ if (NULL == back) { $? ". first object"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else { $? ". already have obj"
+ if (backd > candd) { $? ". smaller distance"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if ((!(backd < candd)) && (backx > candx)) {
+ $? ". equal distance, better"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+#if TRACE_DEBUG
+ else { $? ". distances larger"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". distance larger than limit"
+ }
+#endif
+ } break;
+ }
+ }
+ }
+ } while (NULL != pcand);
+ if (NULL != back) {
+ *pindex = backi;
+ }
+ }
+ $? "- wxdobj_point_move_find_object %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+
+Wxd_object_t *
+wxdobj_rotate_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+)
+{
+ Wxd_object_t *back = NULL; /* Object to modify */
+ Wxd_object_t *pcand = NULL; /* Current object to test */
+ double backd; /* Distance to back */
+ double candd; /* Distance to cand */
+ double backx; /* Distance to back */
+ double candx; /* Distance to cand */
+ uint16_t backi; /* Point index on back */
+ uint16_t candi; /* Point index on cand */
+ bool is_rotatable; /* Object is rotatable */
+ $? "+ wxdobj_rotate_find_object dlim=%g", dlim
+ if ((NULL != pdrw) && (NULL != ppt) && (NULL != pindex)) {
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pcand = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pcand) { $? ". yet another object to test"
+ if (wxdobj_is_active(pcand)) {
+ is_rotatable = false;
+ switch ( (int)(pcand->ot) ) {
+ case WXD_OT_TEXT :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE :
+ case WXD_OT_ELLIPSE :
+ case WXD_OT_BOX :
+ case WXD_OT_IMAGE : {
+ is_rotatable = true;
+ } break;
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE : {
+ if (NULL != pcand->pa) {
+ is_rotatable = true;
+ }
+ } break;
+ }
+ if (is_rotatable) {
+ candd = wxdobj_distance_to_point(pcand,ppt,true,&candi);
+ candx = wxdobj_distance_to_point(pcand, ppt);
+ $? ". candd=%g candx=%g", candd, candx
+ if (dlim >= candd) { $? ". within limit"
+ if (NULL == back) { $? ". first object"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else { $? ". already have obj"
+ if (backd > candd) { $? ". smaller distance"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if ((!(backd < candd)) && (backx > candx)) {
+ $? ". equal distance, better"
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+#if TRACE_DEBUG
+ else { $? ". distances larger"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". distance larger than limit"
+ }
+#endif
+ }
+ }
+ }
+ } while (NULL != pcand);
+ if (NULL != back) {
+ *pindex = backi;
+ }
+ }
+ $? "- wxdobj_rotate_find_object %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Check whether to insert the new point before the selected point
+ or append after the selected point.
+ @param pobj Object to modify.
+ @param ppt Mouse position, not grid-aligned.
+ @param ileft Index of "left side" point.
+ @param ipoint Index of selected point.
+ @param iright Index of "right side" point.
+ @param pbapp Address of flag to set for appending (true) or
+ inserting (false).
+*/
+
+static
+void
+wxdobj_point_add_find_poly_point(
+ Wxd_object_t *pobj,
+ Wxd_point_t const *ppt,
+ uint16_t ileft,
+ uint16_t ipoint,
+ uint16_t iright,
+ bool *pbapp
+)
+{
+ dk4_gra_point_t pta;
+ dk4_gra_point_t ptb;
+ dk4_gra_point_t ptc;
+ dk4_gra_point_t ptt;
+ double da;
+ double db;
+ $? "+ wxdobj_point_add_find_poly_point"
+ pta.x = (double)(((pobj->det).p.p)[ileft].x);
+ pta.y = (double)(((pobj->det).p.p)[ileft].y);
+ ptb.x = (double)(((pobj->det).p.p)[iright].x);
+ ptb.y = (double)(((pobj->det).p.p)[iright].y);
+ ptc.x = (double)(((pobj->det).p.p)[ipoint].x);
+ ptc.y = (double)(((pobj->det).p.p)[ipoint].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_track(&pta, &ptc, &ptt, NULL);
+ db = dk4gratool_dist_point_track(&ptb, &ptc, &ptt, NULL);
+ *pbapp = (db < da);
+ $? "- wxdobj_point_add_find_poly_point"
+}
+
+
+
+/** Check whether to insert the new point before the selected point
+ or append after the selected point.
+ @param pobj Object to modify.
+ @param ppt Mouse position, not grid-aligned.
+ @param ileft Index of "left side" point.
+ @param ipoint Index of selected point.
+ @param iright Index of "right side" point.
+ @param pbapp Address of flag to set for appending (true) or
+ inserting (false).
+*/
+
+static
+void
+wxdobj_point_add_find_spline_point(
+ Wxd_object_t *pobj,
+ Wxd_point_t const *ppt,
+ uint16_t ileft,
+ uint16_t ipoint,
+ uint16_t iright,
+ bool *pbapp
+)
+{
+ dk4_gra_point_t pta;
+ dk4_gra_point_t ptb;
+ dk4_gra_point_t ptc;
+ dk4_gra_point_t ptt;
+ double da;
+ double db;
+ $? "+ wxdobj_point_add_find_spline_point"
+ pta.x = (double)(((pobj->det).s.p)[ileft].x);
+ pta.y = (double)(((pobj->det).s.p)[ileft].y);
+ ptb.x = (double)(((pobj->det).s.p)[iright].x);
+ ptb.y = (double)(((pobj->det).s.p)[iright].y);
+ ptc.x = (double)(((pobj->det).s.p)[ipoint].x);
+ ptc.y = (double)(((pobj->det).s.p)[ipoint].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_track(&pta, &ptc, &ptt, NULL);
+ db = dk4gratool_dist_point_track(&ptb, &ptc, &ptt, NULL);
+ *pbapp = (db < da);
+ $? "- wxdobj_point_add_find_spline_point"
+}
+
+
+
+/** Find object to add points to or delete points from.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @param doadd Flag: Find object to add points to.
+ @return Object found.
+*/
+static
+Wxd_object_t *
+wxdobj_point_del_find_object_internal(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim,
+ int doadd
+)
+{
+ Wxd_object_t *back = NULL; /* Object to modify */
+ Wxd_object_t *pcand = NULL; /* Current object to test */
+ double backd; /* Distance to back */
+ double candd; /* Distance to cand */
+ double backx; /* Distance to back */
+ double candx; /* Distance to cand */
+ uint16_t backi; /* Point index on back */
+ uint16_t candi; /* Point index on cand */
+ bool btest;
+ if ((NULL != pdrw) && (NULL != ppt) && (NULL != pindex)) {
+ backi = (uint16_t)0U;
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pcand = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pcand) {
+ btest = false;
+ /* For open splines and polylines we need at least
+ 2 points remaining after deleting a point.
+ For closed splines and polygons we need at least
+ 3 points remaining after deleting a point.
+
+ 2020-08-28
+ When adding point there must be less than UINT16_MAX
+ existing points.
+ */
+ switch ( (int)(pcand->ot) ) {
+ case WXD_OT_POLYLINE : {
+ if (0 != doadd) {
+ if (UINT16_MAX > (pcand->det).p.n) {
+ btest = true;
+ }
+ }
+ else {
+ if ((uint16_t)2U < (pcand->det).p.n) {
+ btest = true;
+ }
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+ if (0 != doadd) {
+ if (UINT16_MAX > (pcand->det).p.n) {
+ btest = true;
+ }
+ }
+ else {
+ if ((uint16_t)3U < (pcand->det).p.n) {
+ btest = true;
+ }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if (0 != doadd) {
+ if (UINT16_MAX > (pcand->det).s.n) {
+ btest = true;
+ }
+ }
+ else {
+ if ((uint16_t)2U < (pcand->det).s.n) {
+ btest = true;
+ }
+ }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ if (0 != doadd) {
+ if (UINT16_MAX > (pcand->det).s.n) {
+ btest = true;
+ }
+ }
+ else {
+ if ((uint16_t)3U < (pcand->det).s.n) {
+ btest = true;
+ }
+ }
+ } break;
+ }
+ if (btest) {
+ if (!wxdobj_is_active(pcand)) {
+ btest = false;
+ }
+ }
+ if (btest) {
+ candd = wxdobj_distance_to_point(pcand, ppt, true, &candi);
+ candx = wxdobj_distance_to_point(pcand, ppt);
+ if (dlim >= candd) {
+ if (NULL == back) {
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if (backd > candd) {
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+ else {
+ if ((!(backd < candd)) && (backx > candx)) {
+ back = pcand;
+ backd = candd;
+ backx = candx;
+ backi = candi;
+ }
+#if TRACE_DEBUG
+ else { $? ". distances larger"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". distance larger than limit"
+ }
+#endif
+ }
+ }
+ } while (NULL != pcand);
+ if (NULL != back) {
+ *pindex = backi;
+ }
+ }
+ return back;
+
+}
+
+
+Wxd_object_t *
+wxdobj_point_add_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ bool *pbapp,
+ double dlim
+)
+{
+ dk4_gra_point_t pta;
+ dk4_gra_point_t ptb;
+ dk4_gra_point_t ptt;
+ Wxd_object_t *back = NULL;
+ double da;
+ double db;
+ uint16_t ileft = (uint16_t)0U;
+ uint16_t iright = (uint16_t)0U;
+ bool bAppend = false;
+ $? "+ wxdobj_point_add_find_object"
+ back = wxdobj_point_del_find_object_internal(pdrw, ppt, pindex, dlim, 1);
+ if (NULL != back) {
+ ileft = *pindex - (uint16_t)1U;
+ iright = *pindex + (uint16_t)1U;
+ switch ( (int)(back->ot) ) {
+ case WXD_OT_POLYLINE : { $? ". polyline"
+ if ((uint16_t)0U < *pindex) {
+ if ( ((back->det).p.n - (uint16_t)1U) > *pindex) {
+ $? ". inner point"
+ wxdobj_point_add_find_poly_point(
+ back, ppt, ileft, *pindex, iright, &bAppend
+ );
+ }
+ else { $? ". end point"
+ pta.x = (double)(((back->det).p.p)[ileft].x);
+ pta.y = (double)(((back->det).p.p)[ileft].y);
+ ptb.x = (double)(((back->det).p.p)[*pindex].x);
+ ptb.y = (double)(((back->det).p.p)[*pindex].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_point(&ptb, &pta, NULL);
+ db = dk4gratool_dist_point_point(&ptt, &pta, NULL);
+ bAppend = (db > da);
+ }
+ }
+ else { $? ". start point"
+ pta.x = (double)(((back->det).p.p)[0].x);
+ pta.y = (double)(((back->det).p.p)[0].y);
+ ptb.x = (double)(((back->det).p.p)[1].x);
+ ptb.y = (double)(((back->det).p.p)[1].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_point(&pta, &ptb, NULL);
+ db = dk4gratool_dist_point_point(&ptt, &ptb, NULL);
+ bAppend = (db <= da);
+ }
+ } break;
+ case WXD_OT_O_SPLINE : { $? ". open spline"
+ if ((uint16_t)0U < *pindex) {
+ if ( ((back->det).s.n - (uint16_t)1U) > *pindex) {
+ $? ". inner point"
+ wxdobj_point_add_find_spline_point(
+ back, ppt, ileft, *pindex, iright, &bAppend
+ );
+ }
+ else { $? ". end point"
+ pta.x = (double)(((back->det).s.p)[ileft].x);
+ pta.y = (double)(((back->det).s.p)[ileft].y);
+ ptb.x = (double)(((back->det).s.p)[*pindex].x);
+ ptb.y = (double)(((back->det).s.p)[*pindex].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_point(&ptb, &pta, NULL);
+ db = dk4gratool_dist_point_point(&ptt, &pta, NULL);
+ bAppend = (db > da);
+ }
+ }
+ else { $? ". start point"
+ pta.x = (double)(((back->det).s.p)[0].x);
+ pta.y = (double)(((back->det).s.p)[0].y);
+ ptb.x = (double)(((back->det).s.p)[1].x);
+ ptb.y = (double)(((back->det).s.p)[1].y);
+ ptt.x = (double)(ppt->x);
+ ptt.y = (double)(ppt->y);
+ da = dk4gratool_dist_point_point(&pta, &ptb, NULL);
+ db = dk4gratool_dist_point_point(&ptt, &ptb, NULL);
+ bAppend = (db <= da);
+ }
+ } break;
+ case WXD_OT_POLYGON : { $? ". polygon"
+ if ((uint16_t)0U < *pindex) {
+ if ( ((back->det).p.n - (uint16_t)1U) <= *pindex) {
+ $? ". last point"
+ iright = (uint16_t)0U;
+ }
+ }
+ else { $? ". first point"
+ ileft = (back->det).p.n - (uint16_t)1U;
+ }
+ wxdobj_point_add_find_poly_point(
+ back, ppt, ileft, *pindex, iright, &bAppend
+ );
+ } break;
+ case WXD_OT_C_SPLINE : { $? ". closed spline"
+ if ((uint16_t)0U < *pindex) {
+ if ( ((back->det).s.n - (uint16_t)1U) <= *pindex) {
+ iright = (uint16_t)0U;
+ }
+ }
+ else { $? ". start point"
+ ileft = (back->det).s.n - (uint16_t)1U;
+ }
+ wxdobj_point_add_find_spline_point(
+ back, ppt, ileft, *pindex, iright, &bAppend
+ );
+ } break;
+ }
+ *pbapp = bAppend;
+ } $? "- wxdobj_point_add_find_object %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdobj_point_del_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+)
+{
+ return (wxdobj_point_del_find_object_internal(pdrw, ppt, pindex, dlim, 0));
+}
+
+
+
+static
+void
+wxdobj_get_box_control_point(
+ Wxd_point_t *pdst,
+ Wxd_bb_t const *psrc,
+ uint16_t pind
+)
+{
+ switch ( (int)pind ) {
+ case 3 : {
+ pdst->x = psrc->xl; pdst->y = psrc->yt;
+ } break;
+ case 2 : {
+ pdst->x = psrc->xr; pdst->y = psrc->yt;
+ } break;
+ case 1 : {
+ pdst->x = psrc->xr; pdst->y = psrc->yb;
+ } break;
+ default : {
+ pdst->x = psrc->xl; pdst->y = psrc->yb;
+ } break;
+ }
+}
+
+
+
+static
+void
+wxdobj_set_box_control_point(
+ Wxd_bb_t *pdst,
+ Wxd_point_t const *psrc,
+ uint16_t pind
+)
+{
+ switch ( (int)pind ) {
+ case 3 : {
+ pdst->xl = psrc->x; pdst->yt = psrc->y;
+ } break;
+ case 2 : {
+ pdst->xr = psrc->x; pdst->yt = psrc->y;
+ } break;
+ case 1 : {
+ pdst->xr = psrc->x; pdst->yb = psrc->y;
+ } break;
+ default : {
+ pdst->xl = psrc->x; pdst->yb = psrc->y;
+ } break;
+ }
+}
+
+
+
+static
+void
+wxdobj_set_ellipse_control_point(
+ Wxd_object_t *pdst,
+ Wxd_point_t const *psrc,
+ uint16_t pind,
+ dk4_er_t *erp
+)
+{
+ int32_t r;
+ int16_t rot;
+ double dx;
+ double dy;
+ double a;
+ $? "+ wxdobj_set_ellipse_control_point %u", (unsigned)pind
+ $? ". psrc.x = %ld", (long)(psrc->x)
+ $? ". psrc.y = %ld", (long)(psrc->y)
+ dx = (double)(psrc->x) - (double)((pdst->det).e.x);
+ dy = (double)(psrc->y) - (double)((pdst->det).e.y);
+ $? ". dx = %g", dx
+ $? ". dy = %g", dy
+ r = dk4ma_int32_from_double(
+ dk4ma_rint(sqrt(dx * dx + dy * dy)), erp
+ ); $? ". r = %ld", (long)r
+ a = atan2(dy, dx); $? ". a = %g", a
+ if (dk4ma_is_finite(a)) {
+ rot = dk4ma_int16_from_double(
+ dk4ma_rint((180.0 * a) / M_PI), erp
+ ); $? ". rot = %d", (int)rot
+ while (-360 > rot) { rot += (int16_t)360; }
+ while ( 360 < rot) { rot -= (int16_t)360; }
+ $? ". rot = %d", (int)rot
+ switch ( (int)pind ) {
+ case 3 : { $? ". control point 3"
+ (pdst->det).e.ry = r; $? ". ry = %ld", (long)r
+ rot -= 270;
+ while (-360 > rot) { rot += (int16_t)360; }
+ } break;
+ case 2 : { $? ". control point 2"
+ (pdst->det).e.rx = r; $? ". rx = %ld", (long)r
+ rot -= 180;
+ while (-360 > rot) { rot += (int16_t)360; }
+ } break;
+ case 1 : { $? ". control point 1"
+ (pdst->det).e.ry = r; $? ". ry = %ld", (long)r
+ rot -= 90;
+ while (-360 > rot) { rot += (int16_t)360; }
+ } break;
+ default : { $? ". control point 0"
+ (pdst->det).e.rx = r; $? ". rx = %ld", (long)r
+ } break;
+ }
+ (pdst->det).e.a = rot; $? ". r=%d rot=%d", (int)r, (int)rot
+ }
+ else { $? "! failed to calculate rotation"
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ } $? "- wxdobj_set_ellipse_control_point"
+}
+
+
+
+bool
+wxdobj_get_control_point(
+ Wxd_point_t *pdst,
+ Wxd_object_t const *psrc,
+ uint16_t pind
+)
+{
+ dk4_er_t er; /* Error report */
+ dk4_gra_point_t pta; /* Graphics point */
+ bool back = false; /* Function result */
+ $? "+ wxdobj_get_control_point"
+ if ((NULL != pdst) && (NULL != psrc)) {
+ switch ( (int)(psrc->ot) ) {
+ case WXD_OT_TEXT : {
+ pdst->x = (psrc->det).t.x;
+ pdst->y = (psrc->det).t.y;
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (psrc->det).p.p) && (pind < (psrc->det).p.n)) {
+ pdst->x = ((psrc->det).p.p)[pind].x;
+ pdst->y = ((psrc->det).p.p)[pind].y;
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (psrc->det).s.p) && (pind < (psrc->det).s.n)) {
+ pdst->x = ((psrc->det).s.p)[pind].x;
+ pdst->y = ((psrc->det).s.p)[pind].y;
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (2U == pind) {
+ pdst->x = (psrc->det).a.x3;
+ pdst->y = (psrc->det).a.y3;
+ back = true;
+ }
+ else {
+ if (1U == pind) {
+ pdst->x = (psrc->det).a.x2;
+ pdst->y = (psrc->det).a.y2;
+ back = true;
+ }
+ else {
+ pdst->x = (psrc->det).a.x1;
+ pdst->y = (psrc->det).a.y1;
+ back = true;
+ }
+ }
+ } break;
+ case WXD_OT_CIRCLE : {
+ if ((uint32_t)(DK4_I32_MAX) >= (psrc->det).e.rx) {
+ dk4error_init(&er);
+ switch ( (int)pind ) {
+ case 3 : {
+ pdst->x = (psrc->det).e.x;
+ pdst->y = dk4ma_int32_t_sub(
+ (psrc->det).e.y,(int32_t)((psrc->det).e.rx),&er
+ );
+ } break;
+ case 2 : {
+ pdst->x = dk4ma_int32_t_sub(
+ (psrc->det).e.x,(int32_t)((psrc->det).e.rx),&er
+ );
+ pdst->y = (psrc->det).e.y;
+ } break;
+ case 1 : {
+ pdst->x = (psrc->det).e.x;
+ pdst->y = dk4ma_int32_t_add(
+ (psrc->det).e.y,(int32_t)((psrc->det).e.rx),&er
+ );
+ } break;
+ default : {
+ pdst->x = dk4ma_int32_t_add(
+ (psrc->det).e.x,(int32_t)((psrc->det).e.rx),&er
+ );
+ pdst->y = (psrc->det).e.y;
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ }
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ dk4error_init(&er);
+ if ((int16_t)0 == (psrc->det).e.a) { /* Not rotated */
+ if (
+ ((uint32_t)(DK4_I32_MAX) >= (psrc->det).e.rx)
+ && ((uint32_t)(DK4_I32_MAX) >= (psrc->det).e.ry)
+ ) {
+ switch ( (int)pind ) {
+ case 3 : {
+ pdst->x = (psrc->det).e.x;
+ pdst->y = dk4ma_int32_t_sub(
+ (psrc->det).e.y,
+ (int32_t)((psrc->det).e.ry), &er
+ );
+ } break;
+ case 2 : {
+ pdst->x = dk4ma_int32_t_sub(
+ (psrc->det).e.x,
+ (int32_t)((psrc->det).e.rx), &er
+ );
+ pdst->y = (psrc->det).e.y;
+ } break;
+ case 1 : {
+ pdst->x = (psrc->det).e.x;
+ pdst->y = dk4ma_int32_t_add(
+ (psrc->det).e.y,
+ (int32_t)((psrc->det).e.ry), &er
+ );
+ } break;
+ default : {
+ pdst->x = dk4ma_int32_t_add(
+ (psrc->det).e.x,
+ (int32_t)((psrc->det).e.rx), &er
+ );
+ pdst->y = (psrc->det).e.y;
+ } break;
+ }
+ }
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ }
+ }
+ else { /* Rotated */
+ switch ( (int)pind ) {
+ case 3 : {
+ pta.x = 0.0;
+ pta.y = 0.0 - (double)((psrc->det).e.ry);
+ } break;
+ case 2 : {
+ pta.x = 0.0 - (double)((psrc->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ case 1 : {
+ pta.x = 0.0;
+ pta.y = (double)((psrc->det).e.ry);
+ } break;
+ default : {
+ pta.x = (double)((psrc->det).e.rx);
+ pta.y = 0.0;
+ } break;
+ }
+ dk4gratool_rotate_point(
+ &pta, ((M_PI * (double)((psrc->det).e.a)) / 180.0)
+ );
+ pta.x += (double)((psrc->det).e.x);
+ pta.y += (double)((psrc->det).e.y);
+ pdst->x = dk4ma_int32_from_double(dk4ma_rint(pta.x), &er);
+ pdst->y = dk4ma_int32_from_double(dk4ma_rint(pta.y), &er);
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ }
+ }
+ } break;
+ case WXD_OT_BOX : {
+ wxdobj_get_box_control_point(pdst, &((psrc->det).b.b), pind);
+ back = true;
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_get_box_control_point(pdst, &((psrc->det).i.br), pind);
+ back = true;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ pdst->x = (psrc->det).d.x;
+ pdst->y = (psrc->det).d.y;
+ back = true;
+ } break;
+ }
+ } $? "- wxdobj_get_control_point %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_set_control_point(
+ Wxd_object_t *pdst,
+ Wxd_point_t const *psrc,
+ uint16_t pind
+)
+{
+ dk4_er_t er; /* Error report */
+ double dx; /* X difference control point, center */
+ double dy; /* Y difference control point, center */
+ int32_t newr; /* New radius */
+ bool back = false; /* Function result */
+ $? "+ wxdobj_set_control_point"
+ if ((NULL != pdst) && (NULL != psrc)) {
+ $? ". psrc.x = %ld", (long)(psrc->x)
+ $? ". psrc.y = %ld", (long)(psrc->y)
+ switch ( (int)(pdst->ot) ) {
+ case WXD_OT_TEXT : {
+ (pdst->det).t.x = psrc->x;
+ (pdst->det).t.y = psrc->y;
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (pdst->det).p.p) && (pind < (pdst->det).p.n)) {
+ ((pdst->det).p.p)[pind].x = psrc->x;
+ ((pdst->det).p.p)[pind].y = psrc->y;
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (pdst->det).s.p) && (pind < (pdst->det).s.n)) {
+ ((pdst->det).s.p)[pind].x = psrc->x;
+ ((pdst->det).s.p)[pind].y = psrc->y;
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (2U == pind) {
+ (pdst->det).a.x3 = psrc->x;
+ (pdst->det).a.y3 = psrc->y;
+ back = true;
+ }
+ else {
+ if (1U == pind) {
+ (pdst->det).a.x2 = psrc->x;
+ (pdst->det).a.y2 = psrc->y;
+ back = true;
+ }
+ else {
+ (pdst->det).a.x1 = psrc->x;
+ (pdst->det).a.y1 = psrc->y;
+ back = true;
+ }
+ }
+ wxdarc_calculation(
+ &((pdst->det).a.x),
+ &((pdst->det).a.y),
+ &((pdst->det).a.r),
+ &((pdst->det).a.a),
+ &((pdst->det).a.b),
+ &((pdst->det).a.d),
+ (pdst->det).a.x1,
+ (pdst->det).a.y1,
+ (pdst->det).a.x2,
+ (pdst->det).a.y2,
+ (pdst->det).a.x3,
+ (pdst->det).a.y3
+ );
+ } break;
+ case WXD_OT_CIRCLE : {
+ dk4error_init(&er);
+#if 0
+ /* 2020-03-24 Modification
+ Clang static analyzer complains about this line because
+ newr is overwritten in all the if/else branches below.
+ */
+ newr = (int32_t)0L;
+#endif
+ if ((pdst->det).e.x == psrc->x) {
+ newr = dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub((pdst->det).e.y, psrc->y, &er), &er
+ );
+ }
+ else {
+ if ((pdst->det).e.y == psrc->y) {
+ newr = dk4ma_int32_t_abs(
+ dk4ma_int32_t_sub((pdst->det).e.x,psrc->x,&er), &er
+ );
+ }
+ else {
+ dx = (double)((pdst->det).e.x) - (double)(psrc->x);
+ dy = (double)((pdst->det).e.y) - (double)(psrc->y);
+ newr = dk4ma_int32_from_double(
+ sqrt(dx * dx + dy * dy), &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) {
+ (pdst->det).e.rx = newr;
+ back = true;
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ $? ". set ellipse control point %u", (unsigned)pind
+ dk4error_init(&er);
+ switch ( (int)pind ) {
+ case 3 : { $? ". 3"
+ if ((pdst->det).e.x == psrc->x) {
+ if (psrc->y <= (pdst->det).e.y) {
+ (pdst->det).e.a = 0;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ (pdst->det).e.y, psrc->y, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = 180;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ psrc->y, (pdst->det).e.y, &er
+ );
+ }
+ }
+ else {
+ if ((pdst->det).e.y == psrc->y) {
+ if (psrc->x >= (pdst->det).e.x) {
+ (pdst->det).e.a = 90;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ psrc->x, (pdst->det).e.x, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = -90;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ (pdst->det).e.x, psrc->x, &er
+ );
+ }
+ }
+ else {
+ wxdobj_set_ellipse_control_point(
+ pdst, psrc, pind, &er
+ );
+ }
+ }
+ } break;
+ case 2 : { $? ". 2"
+ if ((pdst->det).e.y == psrc->y) {
+ if (psrc->x <= (pdst->det).e.x) {
+ (pdst->det).e.a = 0;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ (pdst->det).e.x, psrc->x, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = 180;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ psrc->x, (pdst->det).e.x, &er
+ );
+ }
+ }
+ else {
+ if ((pdst->det).e.x == psrc->x) {
+ if (psrc->y <= (pdst->det).e.y) {
+ (pdst->det).e.a = 90;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ (pdst->det).e.y, psrc->y, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = -90;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ psrc->y, (pdst->det).e.y, &er
+ );
+ }
+ }
+ else {
+ wxdobj_set_ellipse_control_point(
+ pdst, psrc, pind, &er
+ );
+ }
+ }
+ } break;
+ case 1 : { $? ". 1"
+ if ((pdst->det).e.x == psrc->x) {
+ if (psrc->y >= (pdst->det).e.y) {
+ (pdst->det).e.a = 0;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ psrc->y, (pdst->det).e.y, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = 180;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ (pdst->det).e.y, psrc->y, &er
+ );
+ }
+ }
+ else {
+ if ((pdst->det).e.y == psrc->y) {
+ if (psrc->x <= (pdst->det).e.x) {
+ (pdst->det).e.a = 90;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ (pdst->det).e.x, psrc->x, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = -90;
+ (pdst->det).e.ry = dk4ma_int32_t_sub(
+ psrc->x, (pdst->det).e.x, &er
+ );
+ }
+ }
+ else {
+ wxdobj_set_ellipse_control_point(
+ pdst, psrc, pind, &er
+ );
+ }
+ }
+ } break;
+ default : { $? ". 0"
+ if ((pdst->det).e.y == psrc->y) { $? ". same y"
+ if (psrc->x >= (pdst->det).e.x) {
+ (pdst->det).e.a = 0;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ psrc->x, (pdst->det).e.x, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = 180;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ (pdst->det).e.x, psrc->x, &er
+ );
+ }
+ }
+ else {
+ if ((pdst->det).e.x == psrc->x) { $? ". same x"
+ if (psrc->y >= (pdst->det).e.y) {
+ (pdst->det).e.a = 90;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ psrc->y, (pdst->det).e.y, &er
+ );
+ }
+ else {
+ (pdst->det).e.a = -90;
+ (pdst->det).e.rx = dk4ma_int32_t_sub(
+ (pdst->det).e.y, psrc->y, &er
+ );
+ }
+ }
+ else { $? ". rotated"
+ wxdobj_set_ellipse_control_point(
+ pdst, psrc, pind, &er
+ );
+ }
+ }
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ }
+ } break;
+ case WXD_OT_BOX : {
+ wxdobj_set_box_control_point(&((pdst->det).b.b), psrc, pind);
+ back = true;
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdobj_set_box_control_point(&((pdst->det).i.br), psrc, pind);
+ back = true;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ (pdst->det).d.x = psrc->x;
+ (pdst->det).d.y = psrc->y;
+ back = true;
+ } break;
+ }
+ } $? "- wxdobj_set_control_point %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+void
+wxdobj_delete_control_point(
+ Wxd_object_t *pdst,
+ uint16_t pind
+)
+{
+ Wxd_point_t *ptrppt; /* New poly points array */
+ Wxd_spline_point_t *ptrspl; /* New spline points array */
+ double olds; /* Old s value */
+ size_t sz; /* Number of points to allocate */
+ uint16_t i; /* Traverse control points */
+ bool bCanDo; /* Can delete point from this object */
+ bool bBorder; /* Deleted point was border point */
+ $? "+ wxdobj_delete_control_point"
+ if (NULL != pdst) {
+ bCanDo = false;
+ switch ( (int)(pdst->ot) ) {
+ case WXD_OT_POLYLINE : {
+ if ((uint16_t)2U < (pdst->det).p.n) { bCanDo = true; }
+ } break;
+ case WXD_OT_POLYGON : {
+ if ((uint16_t)3U < (pdst->det).p.n) { bCanDo = true; }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ if ((uint16_t)2U < (pdst->det).s.n) { bCanDo = true; }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ if ((uint16_t)3U < (pdst->det).s.n) { bCanDo = true; }
+ } break;
+ }
+ if (bCanDo) {
+ switch ( (int)(pdst->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ ptrppt = NULL;
+ sz = (size_t)((pdst->det).p.n);
+ sz--;
+ ptrppt = dk4mem_new(Wxd_point_t, sz, NULL);
+ if (NULL != ptrppt) {
+ DK4_MEMCPY(\
+ ptrppt, (pdst->det).p.p,\
+ (sz * sizeof(Wxd_point_t))\
+ );
+ if ((size_t)pind < sz) {
+ DK4_MEMCPY(\
+ &(ptrppt[pind]),\
+ &(((pdst->det).p.p)[pind + (uint16_t)1U]),\
+ (\
+ sizeof(Wxd_point_t) * (sz - (size_t)pind)\
+ )\
+ );
+ }
+ dk4mem_free((pdst->det).p.p);
+ (pdst->det).p.p = ptrppt;
+ (pdst->det).p.n = sz;
+ }
+ else {
+ if ((size_t)pind < sz) {
+ /* Can not do one large memcpy as source
+ and destination range would overlap.
+ */
+ for (i = pind; (size_t)i < sz; i++) {
+ DK4_MEMCPY(\
+ &(((pdst->det).p.p)[i]),\
+ &(((pdst->det).p.p)[i + (uint16_t)1U]),\
+ sizeof(Wxd_point_t)\
+ );
+ }
+ }
+ (pdst->det).p.n = sz;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ ptrspl = NULL;
+ sz = (size_t)((pdst->det).s.n);
+ sz--;
+ olds = ((pdst->det).s.p)[pind].s;
+ bBorder = false;
+ if (
+ (((pdst->det).s.n - (uint16_t)1U) == pind)
+ || ((uint16_t)0U == pind)
+ ) {
+ bBorder = true;
+ }
+ ptrspl = dk4mem_new(Wxd_spline_point_t, sz, NULL);
+ if (NULL != ptrspl) {
+ DK4_MEMCPY(\
+ ptrspl, (pdst->det).s.p,\
+ (sz * sizeof(Wxd_spline_point_t))\
+ );
+ if ((size_t)pind < sz) {
+ DK4_MEMCPY(\
+ &(ptrspl[pind]),\
+ &(((pdst->det).s.p)[pind + (uint16_t)1U]),\
+ (\
+ sizeof(Wxd_spline_point_t)\
+ * (sz - (size_t)pind)\
+ )\
+ );
+ }
+ dk4mem_free((pdst->det).s.p);
+ (pdst->det).s.p = ptrspl;
+ (pdst->det).s.n = sz;
+ }
+ else {
+ if ((size_t)pind < sz) {
+ /* Can not do one large memcpy as source
+ and destination range would overlap.
+ */
+ for (i = pind; (size_t)i < sz; i++) {
+ DK4_MEMCPY(\
+ &(((pdst->det).s.p)[i]),\
+ &(((pdst->det).s.p)[i + (uint16_t)1U]),\
+ sizeof(Wxd_spline_point_t)\
+ );
+ }
+ }
+ (pdst->det).s.n = sz;
+ }
+ if (bBorder) {
+ if ((uint16_t)0U == pind) {
+ ((pdst->det).s.p)[0].s = olds;
+ }
+ else {
+ ((pdst->det).s.p)[sz - (size_t)1U].s = olds;
+ }
+ }
+ } break;
+ }
+ }
+ }
+ $? "- wxdobj_delete_control_point"
+}
+
+
+
+bool
+wxdobj_add_control_point(
+ Wxd_object_t *pdst,
+ uint16_t pind,
+ Wxd_point_t const *ppt
+)
+{
+ Wxd_spline_point_t *ptrspl;
+ Wxd_point_t *ptrppt;
+ size_t oldsz;
+ size_t newsz;
+ bool back = false;
+ bool bCanDo = false;
+ $? "+ wxdobj_add_control_point"
+ if (NULL != pdst) {
+ switch ( (int)(pdst->ot) ) {
+ case WXD_OT_POLYLINE :
+ case WXD_OT_POLYGON : { $? ". polyline/polygon"
+ if ((uint16_t)0xFFFFU > (pdst->det).p.n) {
+ if (pind <= (pdst->det).p.n) { $? ". pind ok"
+ oldsz = (size_t)((pdst->det).p.n);
+ newsz = oldsz + (size_t)1U;
+ ptrppt = dk4mem_new(Wxd_point_t,newsz,NULL);
+ if (NULL != ptrppt) { $? ". allocation ok"
+ DK4_MEMCPY(\
+ ptrppt, (pdst->det).p.p,\
+ (oldsz * sizeof(Wxd_point_t))\
+ );
+ if ((size_t)pind < oldsz) {
+ DK4_MEMCPY(\
+ &(ptrppt[pind + (uint16_t)1U]),\
+ &(((pdst->det).p.p)[pind]),\
+ (\
+ (oldsz - (size_t)pind)\
+ * sizeof(Wxd_point_t)\
+ )\
+ );
+ }
+ dk4mem_free((pdst->det).p.p);
+ (pdst->det).p.p = ptrppt;
+ (pdst->det).p.n = (uint16_t)newsz;
+ ((pdst->det).p.p)[pind].x = ppt->x;
+ ((pdst->det).p.p)[pind].y = ppt->y;
+ back = true;
+ }
+ else { $? "! memory"
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = false;
+ }
+ }
+ else { $? "! pind"
+ /* ERROR: New point index out of range (bug) */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_BUG_POINT_OOR
+ );
+#endif
+ back = false;
+ }
+ }
+ else { $? "! too many points"
+ /* ERROR: Too many points */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_TOO_MANY_POINTS
+ );
+#endif
+ back = false;
+ }
+ } break;
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE : { $? ". spline"
+ if ((uint16_t)0xFFFFU > (pdst->det).s.n) {
+ if (pind <= (pdst->det).s.n) {
+ oldsz = (size_t)((pdst->det).s.n);
+ newsz = oldsz + (size_t)1U;
+ ptrspl = dk4mem_new(Wxd_spline_point_t,newsz,NULL);
+ if (NULL != ptrspl) {
+ DK4_MEMCPY(\
+ ptrspl, (pdst->det).s.p,\
+ (oldsz * sizeof(Wxd_spline_point_t))\
+ );
+ if ((size_t)pind < oldsz) {
+ DK4_MEMCPY(\
+ &(ptrspl[pind + (uint16_t)1U]),\
+ &(((pdst->det).s.p)[pind]),\
+ (\
+ (oldsz - (size_t)pind)\
+ * sizeof(Wxd_spline_point_t)\
+ )\
+ );
+ }
+ dk4mem_free((pdst->det).s.p);
+ (pdst->det).s.p = ptrspl;
+ (pdst->det).s.n = (uint16_t)newsz;
+ ((pdst->det).s.p)[pind].x = ppt->x;
+ ((pdst->det).s.p)[pind].y = ppt->y;
+ back = true;
+ if ((uint16_t)0U == pind) {
+ ((pdst->det).s.p)[0].s = 0.0;
+ ((pdst->det).s.p)[1].s =
+ ((pdst->det).s.p)[2].s;
+ }
+ else {
+ if (((pdst->det).s.n - (uint16_t)1U) == pind) {
+ ((pdst->det).s.p)[pind].s = 0.0;
+ ((pdst->det).s.p)[pind - (uint16_t)1U].s =
+ ((pdst->det).s.p)[pind - (uint16_t)2U].s;
+ }
+ }
+ }
+ else { $? "! memory"
+ /* ERROR: Memory */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+#endif
+ back = false;
+ }
+ }
+ else { $? "! pind"
+ /* ERROR: New point index out of range (bug) */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_BUG_POINT_OOR
+ );
+#endif
+ back = false;
+ }
+ }
+ else { $? "! too many points"
+ /* ERROR: Too many points */
+#if 0
+ dk4error_set_simple_error_code(
+ &m_oErrorReport, WXD_E_TOO_MANY_POINTS
+ );
+#endif
+ back = false;
+ }
+ } break;
+ }
+ if (bCanDo) {
+ }
+ } $? "- wxdobj_add_control_point %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_control_pt_to_bb(
+ Wxd_bb_t *pbox,
+ Wxd_object_t const *pobj
+)
+{
+ bool back = false;
+ uint16_t i;
+ if (NULL != pbox) {
+ wxdobj_det_init_bb(pbox);
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ wxdobj_bb_set_point(
+ pbox, (pobj->det).t.x, (pobj->det).t.y
+ );
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((0U < (pobj->det).p.n) && (NULL != (pobj->det).p.p)) {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ if ((uint16_t)0U != i) {
+ wxdobj_bb_add_point(
+ pbox,
+ ((pobj->det).p.p)[i].x,
+ ((pobj->det).p.p)[i].y
+ );
+ }
+ else {
+ wxdobj_bb_set_point(
+ pbox,
+ ((pobj->det).p.p)[i].x,
+ ((pobj->det).p.p)[i].y
+ );
+ }
+ }
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((0U < (pobj->det).s.n) && (NULL != (pobj->det).s.p)) {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ if ((uint16_t)0U != i) {
+ wxdobj_bb_add_point(
+ pbox,
+ ((pobj->det).s.p)[i].x,
+ ((pobj->det).s.p)[i].y
+ );
+ }
+ else {
+ wxdobj_bb_set_point(
+ pbox,
+ ((pobj->det).s.p)[i].x,
+ ((pobj->det).s.p)[i].y
+ );
+ }
+ }
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ wxdobj_bb_set_point(
+ pbox, (pobj->det).a.x1, (pobj->det).a.y1
+ );
+ wxdobj_bb_add_point(
+ pbox, (pobj->det).a.x2, (pobj->det).a.y2
+ );
+ wxdobj_bb_add_point(
+ pbox, (pobj->det).a.x3, (pobj->det).a.y3
+ );
+ back = true;
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ wxdobj_bb_set_point(
+ pbox, (pobj->det).e.x, (pobj->det).e.y
+ );
+ back = true;
+ } break;
+ case WXD_OT_BOX : {
+ DK4_MEMCPY(pbox,&((pobj->det).b.b),sizeof(Wxd_bb_t));
+ back = true;
+ } break;
+ case WXD_OT_IMAGE : {
+ DK4_MEMCPY(pbox,&((pobj->det).i.br),sizeof(Wxd_bb_t));
+ back = true;
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ wxdobj_bb_set_point(
+ pbox, (pobj->det).d.x, (pobj->det).d.y
+ );
+ back = true;
+ } break;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+bool
+wxdobj_flip_object(
+ Wxd_object_t *pobj,
+ Wxd_bb_t const *pbox,
+ bool bVert,
+ bool bRealRun
+)
+{
+ dk4_er_t er;
+ uint16_t i;
+ bool back = false;
+ $? "+ wxdobj_flip_object"
+ if ((NULL != pobj) && (NULL != pbox)) {
+ dk4error_init(&er);
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).t.y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).t.y, &er
+ );
+ (pobj->det).t.a = (int16_t)0 - (pobj->det).t.a;
+ }
+ else {
+ (pobj->det).t.x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).t.x, &er
+ );
+ (pobj->det).t.a = (int16_t)180 - (pobj->det).t.a;
+ switch ( (int)((pobj->det).t.al) ) {
+ case WXD_TA_RIGHT : {
+ (pobj->det).t.al = (uint8_t)(WXD_TA_LEFT);
+ } break;
+ case WXD_TA_CENTERED : {
+ (pobj->det).t.al = (uint8_t)(WXD_TA_CENTERED);
+ } break;
+ default : {
+ (pobj->det).t.al = (uint8_t)(WXD_TA_RIGHT);
+ } break;
+ }
+ }
+ while ((int16_t)(-360) >= (pobj->det).t.a) {
+ (pobj->det).t.a += (int16_t)360;
+ }
+ while ((int16_t)360 <= (pobj->det).t.a) {
+ (pobj->det).t.a -= (int16_t)360;
+ }
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).t.y, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).t.x, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if ((NULL != (pobj->det).p.p) && (0U < (pobj->det).p.n)) {
+ if (bRealRun) {
+ if (bVert) {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ ((pobj->det).p.p)[i].y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt,
+ ((pobj->det).p.p)[i].y, &er
+ );
+ }
+ }
+ else {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ ((pobj->det).p.p)[i].x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr,
+ ((pobj->det).p.p)[i].x, &er
+ );
+ }
+ }
+ }
+ else {
+ if (bVert) {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt,
+ ((pobj->det).p.p)[i].y, &er
+ );
+ }
+ }
+ else {
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr,
+ ((pobj->det).p.p)[i].x, &er
+ );
+ }
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if ((NULL != (pobj->det).s.p) && (0U < (pobj->det).s.n)) {
+ if (bRealRun) {
+ if (bVert) {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ ((pobj->det).s.p)[i].y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt,
+ ((pobj->det).s.p)[i].y, &er
+ );
+ }
+ }
+ else {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ ((pobj->det).s.p)[i].x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr,
+ ((pobj->det).s.p)[i].x, &er
+ );
+ }
+ }
+ }
+ else {
+ if (bVert) {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt,
+ ((pobj->det).s.p)[i].y, &er
+ );
+ }
+ }
+ else {
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr,
+ ((pobj->det).s.p)[i].x, &er
+ );
+ }
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).a.y1 = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y1, &er
+ );
+ (pobj->det).a.y2 = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y2, &er
+ );
+ (pobj->det).a.y3 = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y3, &er
+ );
+ }
+ else {
+ (pobj->det).a.x1 = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x1, &er
+ );
+ (pobj->det).a.x2 = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x2, &er
+ );
+ (pobj->det).a.x3 = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x3, &er
+ );
+ }
+ wxdarc_calculation(
+ &((pobj->det).a.x),
+ &((pobj->det).a.y),
+ &((pobj->det).a.r),
+ &((pobj->det).a.a),
+ &((pobj->det).a.b),
+ &((pobj->det).a.d),
+ (pobj->det).a.x1,
+ (pobj->det).a.y1,
+ (pobj->det).a.x2,
+ (pobj->det).a.y2,
+ (pobj->det).a.x3,
+ (pobj->det).a.y3
+ );
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y1, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y2, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).a.y3, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x1, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x2, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).a.x3, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).e.y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).e.y, &er
+ );
+ }
+ else {
+ (pobj->det).e.x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).e.x, &er
+ );
+ }
+ if (
+ (WXD_OT_ELLIPSE == pobj->ot)
+ && ((int16_t)0 != (pobj->det).e.a)
+ ) {
+ if (bVert) {
+ (pobj->det).e.a = (int16_t)0 - (pobj->det).e.a;
+ }
+ else {
+ (pobj->det).e.a = (int16_t)180 - (pobj->det).e.a;
+ }
+ while ((int16_t)(-360) >= (pobj->det).t.a) {
+ (pobj->det).t.a += (int16_t)360;
+ }
+ while ((int16_t)360 <= (pobj->det).t.a) {
+ (pobj->det).t.a -= (int16_t)360;
+ }
+ }
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).e.y, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).e.x, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_BOX : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).b.b.yb = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).b.b.yb, &er
+ );
+ (pobj->det).b.b.yt = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).b.b.yt, &er
+ );
+ }
+ else {
+ (pobj->det).b.b.xl = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).b.b.xl, &er
+ );
+ (pobj->det).b.b.xr = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).b.b.xr, &er
+ );
+ }
+ wxdobj_bb_correct(&((pobj->det).b.b));
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).b.b.yb, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).b.b.yt, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).b.b.xl, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).b.b.xr, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_IMAGE : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).i.br.yb = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).i.br.yb, &er
+ );
+ (pobj->det).i.br.yt = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).i.br.yt, &er
+ );
+ }
+ else {
+ (pobj->det).i.br.xl = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).i.br.xl, &er
+ );
+ (pobj->det).i.br.xr = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).i.br.xr, &er
+ );
+ }
+ wxdobj_bb_correct(&((pobj->det).i.br));
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).i.br.yb, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).i.br.yt, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).i.br.xl, &er
+ );
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).i.br.xr, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ if (bRealRun) {
+ if (bVert) {
+ (pobj->det).d.y = wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).d.y, &er
+ );
+ }
+ else {
+ (pobj->det).d.x = wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).d.x, &er
+ );
+ }
+ }
+ else {
+ if (bVert) {
+ (void)wxdobj_flip_coordinate(
+ pbox->yb, pbox->yt, (pobj->det).d.y, &er
+ );
+ }
+ else {
+ (void)wxdobj_flip_coordinate(
+ pbox->xl, pbox->xr, (pobj->det).d.x, &er
+ );
+ }
+ }
+ if (DK4_E_NONE == er.ec) { back = true; }
+ } break;
+ }
+ } $? "- wxdobj_flip_object %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_is_marked(Wxd_object_t const *pobj, uint8_t marker)
+{
+ bool back = false;
+ $? "+ wxdobj_is_marked"
+ if (NULL != pobj) {
+ if ((uint8_t)0U != (marker & (pobj->mark))) {
+ back = true;
+ }
+ }
+ $? "- wxdobj_is_marked %d", (back ? (1) : (0))
+ return back;
+}
+
+
+
+int
+wxdobj_num_marked_2(Wxd_drawing_t *pdrw)
+{
+ Wxd_object_t *pobj;
+ int back = 0;
+ $? "+ wxdobj_num_marked_2"
+ if (NULL != pdrw) {
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pobj) {
+ if (wxdobj_is_marked(pobj, OBJ_MARKER_2)) {
+ back++;
+ }
+ }
+ } while ((NULL != pobj) && (2 > back));
+ }
+ $? "- wxdobj_num_marked_2 %d", back
+ return back;
+}
+
+
+
+#if TRACE_DEBUG
+static
+void
+wxdobj_report_bb(dk4_bb_t const *pbb)
+{
+#if TRACE_DEBUG
+ $? "+ wxdobj_report_bb"
+ if (0 != dk4bb_have_x(pbb)) {
+ $? ". xmin=%lg xmax=%lg", pbb->xmin, pbb->xmax
+ }
+ else {
+ $? "! no x information"
+ }
+ if (0 != dk4bb_have_y(pbb)) {
+ $? ". ymin=%lg ymax=%lg", pbb->ymin, pbb->ymax
+ }
+ else {
+ $? "! no y information"
+ }
+ $? "- wxdobj_report_bb"
+#endif
+}
+#endif
+
+
+
+static
+bool
+wxdobj_bb_simple_text(Wxd_object_t *pobj)
+{
+ $? "+ wxdobj_bb_simple_text"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).t.x), (double)((pobj->det).t.y)
+ );
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_text"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_polyline(Wxd_object_t *pobj)
+{
+ uint16_t u;
+ bool back = false;
+ $? "+ wxdobj_bb_simple_polyline"
+ dk4bb_init(&(pobj->bb));
+ if ((NULL != (pobj->det).p.p) && ((uint16_t)0U < (pobj->det).p.n)) {
+ back = true;
+ for (u = (uint16_t)0U; u < (pobj->det).p.n; u++) {
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)(((pobj->det).p.p)[u].x),
+ (double)(((pobj->det).p.p)[u].y)
+ );
+ }
+ }
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_polyline %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_spline(
+ Wxd_object_t *pobj,
+ size_t subsegs
+)
+{
+ double aa[4]; /* Subsegment start */
+ double ab[4]; /* Subsegment end */
+ dk4_xsp_2d_t xsp; /* X-spline structure for calculations */
+ double divisor; /* Divisor for derivatives */
+ double t; /* Current "time" */
+ size_t ssegno; /* Current subsegment */
+ uint16_t nsegs; /* Number of segments in spline */
+ uint16_t a; /* Point A index */
+ uint16_t b; /* Point B index */
+ uint16_t c; /* Point C index */
+ uint16_t d; /* Point D index */
+ bool back = false;
+ $? "+ wxdobj_bb_simple_spline"
+ divisor = 3.0 * ((double)subsegs);
+ dk4bb_init(&(pobj->bb));
+ if ((NULL != (pobj->det).s.p) && ((uint16_t)1U < (pobj->det).s.n)) {
+ back = true; $? ". enough points"
+ nsegs = (pobj->det).s.n;
+ if (WXD_OT_C_SPLINE != pobj->ot) { nsegs--; }
+ $? ". nsegs=%u", (unsigned)nsegs
+ dk4xsp2d_reset(&xsp);
+ for (b = (uint16_t)0U; b < nsegs; b++) {
+ $? ". b=%u", (unsigned)b
+ if (b < ((pobj->det).s.n - (uint16_t)1U)) {
+ c = b + (uint16_t)1U;
+ }
+ else {
+ c = 0;
+ } $? ". c=%u", (unsigned)c
+ if (
+ (1.0e-7 > fabs(((pobj->det).s.p)[b].s))
+ && (1.0e-7 > fabs(((pobj->det).s.p)[c].s))
+ ) { $? ". straight line"
+ dk4bb_add_point(
+ &(pobj->bb), ((pobj->det).s.p)[b].x, ((pobj->det).s.p)[b].y
+ );
+ dk4bb_add_point(
+ &(pobj->bb), ((pobj->det).s.p)[c].x, ((pobj->det).s.p)[c].y
+ );
+ }
+ else { $? ". spline segment"
+ dk4xsp2d_reset_points(&xsp);
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[b].x),
+ (double)(((pobj->det).s.p)[b].y),
+ ((pobj->det).s.p)[b].s,
+ 1
+ );
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[c].x),
+ (double)(((pobj->det).s.p)[c].y),
+ ((pobj->det).s.p)[c].s,
+ 2
+ );
+ if (b < ((pobj->det).s.n - (uint16_t)2U)) {
+ d = b + (uint16_t)2U; $? ". d=%u", (unsigned)d
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[d].x),
+ (double)(((pobj->det).s.p)[d].y),
+ ((pobj->det).s.p)[d].s,
+ 3
+ );
+ }
+ else {
+ if (WXD_OT_C_SPLINE == pobj->ot) {
+ d = b - ((pobj->det).s.n - (uint16_t)2U);
+ $? ". d=%u", (unsigned)d
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[d].x),
+ (double)(((pobj->det).s.p)[d].y),
+ ((pobj->det).s.p)[d].s,
+ 3
+ );
+ }
+ }
+ if ((uint16_t)0U < b) {
+ a = b - (uint16_t)1U; $? ". a=%u", (unsigned)a
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[a].x),
+ (double)(((pobj->det).s.p)[a].y),
+ ((pobj->det).s.p)[a].s,
+ 0
+ );
+ }
+ else {
+ if (WXD_OT_C_SPLINE == pobj->ot) {
+ a = (pobj->det).s.n - (uint16_t)1U;
+ $? ". a=%u", (unsigned)a
+ dk4xsp2d_set_point(
+ &xsp,
+ (double)(((pobj->det).s.p)[a].x),
+ (double)(((pobj->det).s.p)[a].y),
+ ((pobj->det).s.p)[a].s,
+ 0
+ );
+ }
+ }
+ /*
+ Minimum number of sub segments is 2
+ */
+ if ((size_t)2U > subsegs) { subsegs = (size_t)2U; }
+ /*
+ Start point of segment
+ */
+ dk4xsp2d_calculate_value_derivative(aa, &xsp, 0.0, NULL);
+ aa[1] = aa[1] / divisor;
+ aa[3] = aa[3] / divisor;
+ for (ssegno = (size_t)0U; ssegno < subsegs; ssegno++) {
+ if ((subsegs - (size_t)1U) == ssegno) {
+ t = 1.0;
+ }
+ else {
+ t = ((double)(ssegno + (size_t)1U)) / ((double)subsegs);
+ }
+ dk4xsp2d_calculate_value_derivative(ab, &xsp, t, NULL);
+ ab[1] = ab[1] / divisor;
+ ab[3] = ab[3] / divisor;
+ dk4bb_add_bezier(
+ &(pobj->bb),
+ aa[0], aa[2], (aa[0] + aa[1]), (aa[2] + aa[3]),
+ (ab[0] - ab[1]), (ab[2] - ab[3]), ab[0], ab[2]
+ );
+ DK4_MEMCPY(aa,ab,sizeof(aa));
+ }
+ }
+ }
+ }
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_spline %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_arc(Wxd_object_t *pobj)
+{
+ double a;
+ double b;
+ size_t i;
+ int c;
+ $? "+ wxdobj_bb_simple_arc"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb), (double)((pobj->det).a.x1), (double)((pobj->det).a.y1)
+ );
+ dk4bb_add_point(
+ &(pobj->bb), (double)((pobj->det).a.x2), (double)((pobj->det).a.y2)
+ );
+ dk4bb_add_point(
+ &(pobj->bb), (double)((pobj->det).a.x3), (double)((pobj->det).a.y3)
+ );
+ if ((int8_t)0 != (pobj->det).a.d) {
+ if ((pobj->det).a.a <= (pobj->det).a.b) {
+ a = (pobj->det).a.a;
+ b = (pobj->det).a.b;
+ }
+ else {
+ a = (pobj->det).a.b;
+ b = (pobj->det).a.a;
+ }
+ c = 0;
+ for (i = (size_t)0U; i < sz_arc_angles; i++) {
+ if (a <= arc_angles[i]) {
+ if (arc_angles[i] <= b) {
+ switch (c) {
+ case 3 : {
+ dk4bb_add_y(
+ &(pobj->bb), ((pobj->det).a.y - (pobj->det).a.r)
+ );
+ } break;
+ case 2 : {
+ dk4bb_add_x(
+ &(pobj->bb), ((pobj->det).a.x - (pobj->det).a.r)
+ );
+ } break;
+ case 1 : {
+ dk4bb_add_y(
+ &(pobj->bb), ((pobj->det).a.y + (pobj->det).a.r)
+ );
+ } break;
+ default : {
+ dk4bb_add_x(
+ &(pobj->bb), ((pobj->det).a.x + (pobj->det).a.r)
+ );
+ } break;
+ }
+ }
+ }
+ if (4 <= ++c) { c = 0; }
+ }
+ if (WXD_OT_C_ARC == pobj->ot) {
+ dk4bb_add_point(&(pobj->bb), (pobj->det).a.x, (pobj->det).a.y);
+ }
+ }
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_arc"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_circle(Wxd_object_t *pobj)
+{
+ $? "+ wxdobj_bb_simple_circle"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb),
+ ((double)((pobj->det).e.x) - (double)((pobj->det).e.rx)),
+ ((double)((pobj->det).e.y) - (double)((pobj->det).e.rx))
+ );
+ dk4bb_add_point(
+ &(pobj->bb),
+ ((double)((pobj->det).e.x) + (double)((pobj->det).e.rx)),
+ ((double)((pobj->det).e.y) + (double)((pobj->det).e.rx))
+ );
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_circle"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_ellipse(Wxd_object_t *pobj)
+{
+ $? "+ wxdobj_bb_simple_ellipse"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_rotated_ellipse(
+ &(pobj->bb),
+ (double)((pobj->det).e.x),
+ (double)((pobj->det).e.y),
+ (double)((pobj->det).e.rx),
+ (double)((pobj->det).e.ry),
+ ((M_PI * ((double)((pobj->det).e.a))) / 180.0)
+ );
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_ellipse"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_box(Wxd_object_t *pobj)
+{
+ $? "+ wxdobj_bb_simple_box"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).b.b.xl), (double)((pobj->det).b.b.yb)
+ );
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).b.b.xr), (double)((pobj->det).b.b.yt)
+ );
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_box"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_image(Wxd_object_t *pobj)
+{
+ $? "+ wxdobj_bb_simple_image"
+ dk4bb_init(&(pobj->bb));
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).i.br.xl), (double)((pobj->det).i.br.yb)
+ );
+ dk4bb_add_point(
+ &(pobj->bb),
+ (double)((pobj->det).i.br.xr), (double)((pobj->det).i.br.yt)
+ );
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_image"
+ return true;
+}
+
+
+
+static
+bool
+wxdobj_bb_simple_dot(Wxd_drawing_t const *pdrw, Wxd_object_t *pobj)
+{
+#if 1
+ double r;
+#endif
+ $? "+ wxdobj_bb_simple_dot"
+ dk4bb_init(&(pobj->bb));
+#if 1
+ r = (((double)((pobj->det).d.d) * (double)(pdrw->baselw)) / 2.0);
+ dk4bb_add_point(
+ &(pobj->bb),
+ ((double)((pobj->det).d.x) - r), ((double)((pobj->det).d.y) - r)
+ );
+ dk4bb_add_point(
+ &(pobj->bb),
+ ((double)((pobj->det).d.x) + r), ((double)((pobj->det).d.y) + r)
+ );
+#else
+ dk4bb_add_point(&(pobj->bb), (pobj->det).d.x, (pobj->det).d.y);
+#endif
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ $? "- wxdobj_bb_simple_dot"
+ return true;
+}
+
+
+
+bool
+wxdobj_bb_simple_object(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ bool back = false;
+ $? "+ wxdobj_bb_simple_object pdrw=%d pobj=%d", TR_IPTR(pdrw), TR_IPTR(pobj)
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ back = wxdobj_bb_simple_text(pobj);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ back = wxdobj_bb_simple_polyline(pobj);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ back = wxdobj_bb_simple_spline(pobj, pdrw->xsubs);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ back = wxdobj_bb_simple_arc(pobj);
+ } break;
+ case WXD_OT_CIRCLE : {
+ back = wxdobj_bb_simple_circle(pobj);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ back = wxdobj_bb_simple_ellipse(pobj);
+ } break;
+ case WXD_OT_BOX : {
+ back = wxdobj_bb_simple_box(pobj);
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxdobj_bb_simple_image(pobj);
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ back = wxdobj_bb_simple_dot(pdrw, pobj);
+ } break;
+ }
+ }
+ $? "- wxdobj_bb_simple_object %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_group_structural(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ Wxd_object_t *po;
+ bool back = false;
+ $? "+ wxdobj_bb_group_structural"
+ if (NULL != pobj) {
+ dk4bb_init(&(pobj->bb));
+ }
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ back = true;
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) { $? ". yet another member"
+ if (WXD_OT_GROUP_BEGIN == po->ot) {
+ if (!wxdobj_bb_group_structural(pdrw, po)) {
+ back = false;
+ }
+ }
+ $!trace-code wxdobj_report_bb(&(po->bb));
+ dk4bb_add_bb(&(pobj->bb), &(po->bb));
+ }
+ } while (NULL != po);
+ }
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ }
+ $? "- wxdobj_bb_group_structural %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_group_and_contents(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ Wxd_object_t *po;
+ bool back = false;
+ $? "+ wxdobj_bb_group_and_contents"
+ if (NULL != pobj) {
+ dk4bb_init(&(pobj->bb));
+ }
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ back = true;
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ po = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != po) { $? ". yet another member"
+ if (WXD_OT_GROUP_BEGIN == po->ot) {
+ if (!wxdobj_bb_group_and_contents(pdrw, po)) {
+ back = false;
+ }
+ }
+ else {
+ if (!wxdobj_bb_simple_object(pdrw, po)) {
+ back = false;
+ }
+ }
+ $!trace-code wxdobj_report_bb(&(po->bb));
+ dk4bb_add_bb(&(pobj->bb), &(po->bb));
+ }
+ } while (NULL != po);
+ }
+ $!trace-code wxdobj_report_bb(&(pobj->bb));
+ }
+ $? "- wxdobj_bb_group_and_contents %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_modified_object(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+)
+{
+ bool back = false;
+ $? "+ wxdobj_bb_modified_object"
+ if (NULL != pobj) {
+ dk4bb_init(&(pobj->bb));
+ }
+ if ((NULL != pdrw) && (NULL != pobj)) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ /*
+ If a group was modified (i.e. moved) rebuild
+ bounding box information completely
+ */
+ back = wxdobj_bb_group_and_contents(pdrw, pobj);
+ }
+ else {
+ /*
+ Rebuild bounding box information for simple object
+ */
+ back = wxdobj_bb_simple_object(pdrw, pobj);
+ if (NULL != pobj->pa) {
+ /*
+ If object is member of a group rebuild bounding box
+ information in structural nodes
+ */
+ while (NULL != pobj->pa) { pobj = pobj->pa; }
+ if (!wxdobj_bb_group_structural(pdrw, pobj)) {
+ back = false;
+ }
+ }
+ }
+ }
+ $? "- wxdobj_bb_modified_object %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_for_drawing(
+ Wxd_drawing_t *pdrw
+)
+{
+ Wxd_object_t *pobj;
+ bool back = false;
+ $? "+ wxdobj_bb_for_drawing pdrw=%d", TR_IPTR(pdrw)
+ if (NULL != pdrw) {
+ back = true;
+ dk4sto_it_reset(pdrw->i_flat);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_flat);
+ if (NULL != pobj) { $? ". yet another simple object"
+ if (!wxdobj_bb_simple_object(pdrw, pobj)) {
+ back = false;
+ }
+ }
+ } while (NULL != pobj);
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pobj = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pobj) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ $? ". yet another group"
+ if (!wxdobj_bb_group_structural(pdrw, pobj)) {
+ back = false;
+ }
+ }
+ }
+ } while (NULL != pobj);
+ }
+ $? "- wxdobj_bb_for_drawing %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+bool
+wxdobj_text_is_latex(Wxd_object_t const *pobj)
+{
+ bool back = false;
+ if (NULL != pobj) {
+ if (WXD_OT_TEXT == pobj->ot) {
+ if (
+ WXD_TEXT_FLAG_NONE
+ != (WXD_TEXT_FLAG_LATEX & ((pobj->det).t.fl))
+ ) {
+ back = true;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+bool
+wxdobj_can_convert(
+ int destot,
+ const Wxd_object_t *pobj
+)
+{
+ bool back = false;
+ $? "+ wxdobj_can_convert new=%d old=%d", destot, (int)(pobj->ot)
+ if (NULL != pobj) {
+ switch (destot) {
+ case WXD_OT_POLYLINE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_BOX :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC : {
+ back = true;
+ } break;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_BOX :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC : {
+ back = true;
+ } break;
+ }
+ } break;
+ case WXD_OT_O_ARC : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_C_ARC :
+ case WXD_OT_O_ARC : {
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE :
+ case WXD_OT_POLYGON : {
+ if ((uint16_t)3U == (pobj->det).p.n) {
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE : {
+ if ((uint16_t)3U == (pobj->det).s.n) {
+ back = true;
+ }
+ } break;
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_BOX :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC : {
+ back = true;
+ } break;
+ }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_BOX :
+ case WXD_OT_POLYLINE :
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_O_ARC :
+ case WXD_OT_POLYGON :
+ case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC : {
+ back = true;
+ } break;
+ }
+
+ } break;
+ case WXD_OT_C_ARC : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_C_ARC :
+ case WXD_OT_O_ARC : {
+ back = true;
+ } break;
+ case WXD_OT_POLYLINE :
+ case WXD_OT_POLYGON : {
+ if ((uint16_t)3U == (pobj->det).p.n) {
+ back = true;
+ }
+ } break;
+ case WXD_OT_O_SPLINE :
+ case WXD_OT_C_SPLINE : {
+ if ((uint16_t)3U == (pobj->det).s.n) {
+ back = true;
+ }
+ } break;
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE :
+ case WXD_OT_CIRCLE : {
+ back = true;
+ } break;
+ }
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_DOT_WHITE :
+ case WXD_OT_CIRCLE : {
+ back = true;
+ } break;
+ }
+ } break;
+ }
+ } $? "- wxdobj_can_convert %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+/** Rotate one point relatively to a center point by 90 degree.
+ @param x Point x coordinate (in and out).
+ @paam y Point y coordinate (in and out).
+ @param x0 Center point x coordinate.
+ @param y0 Center point y coordinate.
+ @param neg Negative direction (false=positive direction).
+ @param doit Really modify point (false=test only).
+ @return True on success, false on error.
+*/
+static
+bool
+wxdobj_rotate_point(
+ int32_t & x,
+ int32_t & y,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ dk4_er_t er;
+ int32_t dx;
+ int32_t dy;
+ int32_t nx;
+ int32_t ny;
+ bool back = false;
+
+ if ((x == x0) && (y == y0)) {
+ back = true;
+ }
+ else {
+ dk4error_init(&er);
+ dx = dk4ma_int32_t_sub(x, x0, &er);
+ dy = dk4ma_int32_t_sub(y, y0, &er);
+ if (neg) {
+ nx = dk4ma_int32_t_add(x0, dy, &er);
+ ny = dk4ma_int32_t_sub(y0, dx, &er);
+ }
+ else {
+ nx = dk4ma_int32_t_sub(x0, dy, &er);
+ ny = dk4ma_int32_t_add(y0, dx, &er);
+ }
+ if (DK4_E_NONE == er.ec) {
+ back = true;
+ if (doit) {
+ x = nx;
+ y = ny;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_text(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back;
+ back = wxdobj_rotate_point(
+ (pobj->det).t.x, (pobj->det).t.y, x0, y0, neg, doit
+ );
+ if (doit) {
+ if (neg) {
+ (pobj->det).t.a -= (int16_t)90;
+ if ((int16_t)0 > (pobj->det).t.a) {
+ (pobj->det).t.a += (int16_t)360;
+ }
+ }
+ else {
+ (pobj->det).t.a += (int16_t)90;
+ if ((int16_t)360 < (pobj->det).t.a) {
+ (pobj->det).t.a -= (int16_t)360;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_polyline(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ uint16_t i;
+ bool back = false;
+ bool res;
+ if ((NULL != (pobj->det).p.p) && ((uint16_t)0U < (pobj->det).p.n)) {
+ back = true;
+ for (i = (uint16_t)0U; i < (pobj->det).p.n; i++) {
+ res = wxdobj_rotate_point(
+ ((pobj->det).p.p)[i].x,((pobj->det).p.p)[i].y,x0,y0,neg,doit
+ );
+ if (!(res)) { back = false; }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_spline(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ uint16_t i;
+ bool back = false;
+ bool res;
+ if ((NULL != (pobj->det).s.p) && ((uint16_t)0U < (pobj->det).s.n)) {
+ back = true;
+ for (i = (uint16_t)0U; i < (pobj->det).s.n; i++) {
+ res = wxdobj_rotate_point(
+ ((pobj->det).s.p)[i].x,((pobj->det).s.p)[i].y,x0,y0,neg,doit
+ );
+ if (!(res)) { back = false; }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_arc(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = true;
+ bool res;
+ res = wxdobj_rotate_point((pobj->det).a.x1,(pobj->det).a.y1,x0,y0,neg,doit);
+ if (!(res)) { back = false; }
+ res = wxdobj_rotate_point((pobj->det).a.x2,(pobj->det).a.y2,x0,y0,neg,doit);
+ if (!(res)) { back = false; }
+ res = wxdobj_rotate_point((pobj->det).a.x3,(pobj->det).a.y3,x0,y0,neg,doit);
+ if (!(res)) { back = false; }
+ if (doit) {
+ wxdarc_calculation(
+ &((pobj->det).a.x), &((pobj->det).a.y), &((pobj->det).a.r),
+ &((pobj->det).a.a), &((pobj->det).a.b), &((pobj->det).a.d),
+ (pobj->det).a.x1, (pobj->det).a.y1, (pobj->det).a.x2,
+ (pobj->det).a.y2, (pobj->det).a.x3, (pobj->det).a.y3
+ );
+
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_ellipse(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = false;
+ back = wxdobj_rotate_point(
+ (pobj->det).e.x, (pobj->det).e.y, x0, y0, neg, doit
+ );
+ if (doit && (WXD_OT_ELLIPSE == pobj->ot)) {
+ if (neg) {
+ (pobj->det).e.a -= (int16_t)90;
+ if ((int16_t)0 > (pobj->det).e.a) {
+ (pobj->det).e.a += (int16_t)360;
+ }
+ }
+ else {
+ (pobj->det).e.a += (int16_t)90;
+ if ((int16_t)360 < (pobj->det).e.a) {
+ (pobj->det).e.a -= (int16_t)360;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_bb(
+ Wxd_bb_t *pbb,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = true;
+ bool res;
+ res = wxdobj_rotate_point(pbb->xl, pbb->yb, x0, y0, neg, doit);
+ if (!(res)) { back = false; }
+ res = wxdobj_rotate_point(pbb->xr, pbb->yt, x0, y0, neg, doit);
+ if (!(res)) { back = false; }
+ if (doit) {
+ wxdobj_bb_correct(pbb);
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_simple_object(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = false;
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ back = wxdobj_rotate_text(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ back = wxdobj_rotate_polyline(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ back = wxdobj_rotate_spline(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ back = wxdobj_rotate_arc(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ back = wxdobj_rotate_ellipse(pobj, x0, y0, neg, doit);
+ } break;
+ case WXD_OT_BOX : {
+ back = wxdobj_rotate_bb(&((pobj->det).b.b), x0, y0, neg, doit);
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxdobj_rotate_bb(&((pobj->det).i.br), x0, y0, neg, doit);
+ if (doit) { wxdobj_image_placement(pobj); }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ back = wxdobj_rotate_point(
+ (pobj->det).d.x, (pobj->det).d.y, x0, y0, neg, doit
+ );
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+static
+bool
+wxdobj_rotate_structural_object(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ Wxd_object_t *o;
+ bool back = false;
+ bool res;
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ back = true;
+ dk4sto_it_reset((pobj->det).g.i_e);
+ do {
+ o = (Wxd_object_t *)dk4sto_it_next((pobj->det).g.i_e);
+ if (NULL != o) {
+ switch ( (int)(o->ot) ) {
+ case WXD_OT_GROUP_BEGIN : {
+ res = wxdobj_rotate_structural_object(
+ o, x0, y0, neg, doit
+ );
+ } break;
+ default : {
+ res = wxdobj_rotate_simple_object(
+ o, x0, y0, neg, doit
+ );
+ } break;
+ }
+ if (!(res)) { back = false; }
+ }
+ } while (NULL != o);
+ }
+ return back;
+}
+
+
+
+bool
+wxdobj_rotate_object(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+)
+{
+ bool back = false;
+ if (NULL != pobj) {
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_GROUP_BEGIN : {
+ back = wxdobj_rotate_structural_object(
+ pobj, x0, y0, neg, doit
+ );
+ } break;
+ default : {
+ back = wxdobj_rotate_simple_object(
+ pobj, x0, y0, neg, doit
+ );
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+bool
+wxdobj_bb_equal(Wxd_bb_t const *pa, Wxd_bb_t const *pb)
+{
+ bool back = false;
+ $? "+ wxdobj_bb_equal"
+ if ((NULL != pa) && (NULL != pb)) {
+ $? ". pa = %ld %ld %ld %ld", (long)(pa->xl), (long)(pa->xr), (long)(pa->yb), (long)(pa->yt)
+ $? ". pb = %ld %ld %ld %ld", (long)(pb->xl), (long)(pb->xr), (long)(pb->yb), (long)(pb->yt)
+ if (
+ (pa->xl == pb->xl) && (pa->xr == pb->xr)
+ && (pa->yb == pb->yb) && (pa->yt == pb->yt)
+ ) {
+ back = true;
+ }
+ } $? "- wxdobj_bb_equal %d", (back ? 1 : 0)
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawObj.h b/support/dktools/WxdkdrawObj.h
new file mode 100644
index 0000000000..4e5877067b
--- /dev/null
+++ b/support/dktools/WxdkdrawObj.h
@@ -0,0 +1,1270 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawObj.cpt
+*/
+
+#ifndef WXDKDRAWOBJ_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWOBJ_H_INCLUDED 1
+
+
+#line 8 "WxdkdrawObj.cpt"
+
+/** @file WxdkdrawObj.h Graphics elements handling.
+*/
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+#ifndef WXDENUM_H_INCLUDED
+#include "wxdenum.h"
+#endif
+
+
+/* PROTOTYPES (start) */
+
+
+/*
+ Create and destroy drawing
+ --------------------------
+*/
+
+/** Open a new empty drawing.
+ @return Valid pointer on success, NULL on error (not enough memory).
+*/
+
+Wxd_drawing_t *
+wxdobj_drw_new(void);
+
+
+/** Delete drawing including all contents.
+ @param pdrw Drawing to delete.
+*/
+
+void
+wxdobj_drw_delete(Wxd_drawing_t *pdrw);
+
+
+/** Set required redraw level.
+ During handling one event this function may be called multiple
+ times. The maximum of the required redraw levels is saved
+ in the drawing.
+ @param pdrw Drawing to update.
+ @param level Required minimum redraw level.
+*/
+
+void
+wxdobj_drw_require_redraw(Wxd_drawing_t *pdrw, int level);
+
+
+/** Retrieve required redraw level.
+ This function should be called at the end of event handlers
+ to check whether or not to refresh and update the control
+ and from within the repaint handler to check which caches to
+ update.
+ @param pdrw Drawing to check.
+ @param level Required redraw level already found.
+ @return Required redraw level.
+*/
+
+int
+wxdobj_drw_get_required_redraw_level(
+ Wxd_drawing_t *pdrw,
+ int level = WXD_REFRESH_NONE
+);
+
+
+/** Reset required redraw level.
+ This function should be called from the repaint handler when
+ redrawing is done.
+ @param pdrw Drawing to modify.
+*/
+
+void
+wxdobj_drw_reset_required_redraw_level(Wxd_drawing_t *pdrw);
+
+
+/*
+ Create and destroy elements without registration
+ and unregistration to drawing
+ ------------------------------------------------
+*/
+
+
+/** Initialize bounding box structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_bb(Wxd_bb_t *pdst);
+
+
+/** Initialize text details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_text(Wxd_det_text_t *pdst);
+
+
+/** Initialize polyline or polygon details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_poly(Wxd_det_pl_t *pdst);
+
+
+/** Initialize spline details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_spline(Wxd_det_xs_t *pdst);
+
+
+/** Initialize arc details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_arc(Wxd_det_arc_t *pdst);
+
+
+/** Initialize details structure for ellipse or circle.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_ellipse(Wxd_det_ellipse_t *pdst);
+
+
+/** Initialize box details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_box(Wxd_det_box_t *pdst);
+
+
+/** Initialize image details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_image(Wxd_det_image_t *pdst);
+
+
+/** Initialize dot details structure.
+ @param pdst Structure to initialize.
+*/
+
+void
+wxdobj_det_init_dot(Wxd_det_dot_t *pdst);
+
+
+
+/** Initialize object, use template if specified.
+ @param pdst Object to initialize.
+ @param ot Object type.
+ @param ptpl Template object, may be NULL.
+*/
+
+void
+wxdobj_obj_init(Wxd_object_t *pdst, int ot, Wxd_object_t const *ptpl = NULL);
+
+
+/** Delete group structure recursively.
+ Only group structural information is deleted, graphics
+ objects remain intact.
+ The parent information of all graphics objects is set to NULL.
+*/
+
+void
+wxdobj_grp_delete_recursive(Wxd_object_t *pgrp);
+
+
+/** Create polyline object.
+ @param np Number of points.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_polyline(uint16_t np, Wxd_object_t const *ptpl);
+
+
+/** Create polygon object.
+ @param np Number of points.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_polygon(uint16_t np, Wxd_object_t const *ptpl);
+
+
+/** Create spline object.
+ @param np Number of points.
+ @param cl Flag: Closed spline.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_spline(uint16_t np, int cl, Wxd_object_t const *ptpl);
+
+
+/** Create arc object.
+ @param cl Flag: Closed arc.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_arc(int cl, Wxd_object_t const *ptpl);
+
+
+/** Create circle object.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_circle(Wxd_object_t const *ptpl);
+
+
+/** Create ellipse object.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_ellipse(Wxd_object_t const *ptpl);
+
+
+/** Create box object.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_box(Wxd_object_t const *ptpl);
+
+
+/** Create image object.
+ @param fn Image file name.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_image(wxChar const *fn, Wxd_object_t const *ptpl);
+
+
+/** Create dot object.
+ @param wh Flag: White filled dot.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_dot(int wh, Wxd_object_t const *ptpl);
+
+
+/** Create new text label.
+ @param te Export text.
+ @param ptpl Style template.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_obj_new_textlabel(wxChar const *te, Wxd_object_t const *ptpl);
+
+
+/** Delete object, release memory.
+ The object is not unregistered from the drawing.
+ For a group object the storage and iterator are just closed,
+ no recursive processing.
+ @param pobj Object to delete.
+*/
+
+void
+wxdobj_obj_delete(Wxd_object_t *pobj);
+
+
+/*
+ Create new elements in a drawing (create element and register it
+ in the drawings storages)
+ ----------------------------------------------------------------
+*/
+
+/** Register an object in drawing and group structure.
+ @param pdrw Drawing to register object.
+ @param pgrp Objects parent group or NULL for a top-level element.
+ @param pobj Object to register in drawing.
+*/
+
+int
+wxdobj_drw_register_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t *pobj
+);
+
+
+/** Add a new group to a drawing, register it in structered storage.
+ @param pdrw Drawing to add group to.
+ @param pgrp Parent group, NULL for a new top-level group.
+ @return Valid pointer to new group on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_drw_add_group(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp
+);
+
+
+/** Add a new polyline to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param np Number of points.
+ @param cl Flag: Closed polyline (polygon).
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_polyline(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ uint16_t np,
+ int cl,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add point to polygon or polyline.
+ @param pobj Polygon or polyline to modify.
+ @param pind Index of new point.
+ @param erp Error report, may be NULL.
+ @return True on success, false on error (memory).
+*/
+
+bool
+wxdobj_add_polypoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+);
+
+
+/** Delete one polyline or polygon point.
+ @param pobj Polyline or polygon object to modify.
+ @param pind Index of point to delete.
+ @param erp Error report, may be NULL.
+ @return True on success, false on error (memory).
+*/
+
+bool
+wxdobj_del_polypoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+);
+
+
+/** Add a new spline to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param np Number of points.
+ @param cl Flag: Closed spline.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_spline(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ uint16_t np,
+ int cl,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add point to spline.
+ @param pobj Spline to modify.
+ @param pind Index of new point.
+ @param erp Error report, may be NULL.
+ @return True on success, false on error (memory).
+*/
+
+bool
+wxdobj_add_splinepoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+);
+
+
+/** Delete one spline point.
+ @param pobj Open or closed spline object to modify.
+ @param pind Index of point to delete.
+ @param erp Error report, may be NULL.
+ @return True on success, false on error (memory).
+*/
+
+bool
+wxdobj_del_splinepoint(
+ Wxd_object_t *pobj,
+ uint16_t pind,
+ dk4_er_t *erp
+);
+
+
+/** Add a new arc to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param cl Flag: Closed polyline (polygon).
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_arc(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ int cl,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new circle to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_circle(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new ellipse to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_ellipse(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new box to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_box(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new polyline to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param fn File name of image file.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_image(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ wxChar const *fn,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new dot to drawing and register it in the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param wh Flag: White filled dot.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_dot(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ int wh,
+ Wxd_object_t const *ptpl
+);
+
+
+/** Add a new text label to the drawing and register it to the storages.
+ @param pdrw Drawing to add to.
+ @param pgrp Parent group, NULL for top-level object.
+ @param te Export text.
+ @param ptpl Style template, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_add_textlabel(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pgrp,
+ wxChar const *te,
+ Wxd_object_t const *ptpl
+);
+
+
+/*
+ Modify elements within a drawing, update registration
+ if necessary
+ -----------------------------------------------------
+*/
+
+
+/** Check whether or not object is active.
+ @param pobj Object to check.
+ @return True normally, false for objects on inactive layers.
+*/
+
+bool
+wxdobj_is_active(Wxd_object_t *pobj);
+
+
+/** Increase point number of polyline or polygon by one
+ (after clicking on a new point to add).
+ @param pobj Object to modify.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_mod_poly_add_point(
+ Wxd_object_t *pobj
+);
+
+
+/** Decrease point number of polyline or polygon by one
+ (after right-clicking for finalizing).
+ @param pobj Object to modify.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_mod_poly_del_point(
+ Wxd_object_t *pobj
+);
+
+
+/** Increase point number of spline by one
+ (after clicking on a new point to add).
+ @param pobj Object to modify.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_mod_spline_add_point(
+ Wxd_object_t *pobj
+);
+
+
+/** Decrease point number of spline by one
+ (after right-clicking for finalizing).
+ @param pobj Object to modify.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_mod_spline_del_point(
+ Wxd_object_t *pobj
+);
+
+
+/** Find group containing an object.
+ @param pdrw Drawing containing the object.
+ @param pobj Object to search for.
+ @return Valid pointer to group on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_find_group_for(Wxd_drawing_t *pdrw, Wxd_object_t *pobj);
+
+
+/** Ensure object has layer structure pointer.
+ @param pdrw Drawing.
+ @param pobj Object to check.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_find_layer_structure(Wxd_drawing_t *pdrw, Wxd_object_t *pobj);
+
+
+/** Check whether an object needs a stipple structure.
+ @param pobj Object to check.
+ @return 1 for true, 0 for false.
+*/
+
+int
+wxdobj_needs_stipple(
+ Wxd_object_t *pobj
+);
+
+
+/** Modify layer of an object.
+ This includes reorganization of sorted storages.
+ @param pdrw Drawing to modify.
+ @param pobj Object for layer change.
+ @param nl New layer number.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_modify_layer(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj,
+ int16_t nl
+);
+
+
+/** Correct bounding box and/or generic rectangle.
+ @param bbptr Rectangle to correct.
+*/
+
+void
+wxdobj_bb_correct(Wxd_bb_t *bbptr, uint16_t *ppoint = NULL);
+
+
+/** Check for incorrect rectangle (width or height 0 or negative).
+ @param bbptr Rectangle to check.
+ @return True for incorrect rectangle.
+*/
+
+bool
+wxdobj_bb_is_null_area(Wxd_bb_t *bbptr);
+
+
+/** Check two rectangles for intersection, find intersection area if any.
+ The intersection area is saved to res only if the function returns
+ true.
+ @param res Address of result rectangle variable.
+ @param a One rectangle to check.
+ @param b Other rectangle to check.
+ @return True if there is any intersection, false otherwise.
+*/
+
+bool
+wxdobj_bb_intersection(
+ Wxd_bb_t *res,
+ Wxd_bb_t const *a,
+ Wxd_bb_t const *b
+);
+
+
+/** Find bitmap type for file name.
+ @param fn File name to check.
+ @return Bitmap image type on success, wxBITMAP_TYPE_INVALID on error
+ (file name has no suffix or suffix not in the list of supported types).
+*/
+
+wxBitmapType
+wxdobj_image_type(wxChar const *fn);
+
+
+/** Load image from file.
+ @param pobj Image object, must be type WXD_OT_IMAGE.
+ @param dkenc Encoding used for dkChar strings.
+ @param wxenc Encoding used for wxChar strings.
+*/
+
+void
+wxdobj_load_image(
+ Wxd_object_t *pobj,
+ int dkenc,
+ int wxenc
+);
+
+
+/** Calculate image placement, save in pl component.
+ @param pobj Image object, must be type WXD_OT_IMAGE.
+*/
+
+void
+wxdobj_image_placement(
+ Wxd_object_t *pobj
+);
+
+
+/** Calculate distance from point to object.
+ @param pobj Object to check.
+ @param ppt Point to check.
+ @return Distance from point to object if found, negative value otherwise.
+*/
+
+double
+wxdobj_distance_to_point(
+ Wxd_object_t *pobj,
+ Wxd_point_t const *ppt,
+ bool bCtrlPt = false,
+ uint16_t *pIndex = NULL
+);
+
+
+/** Unmark all objects in drawing.
+ @param pdrw Drawing to modify.
+ @param marker Marker bit to delete from all objects.
+*/
+
+void
+wxdobj_unmark_all(Wxd_drawing_t *pdrw, uint8_t marker);
+
+
+/** Mark one object recursively.
+ @param pobj Object to mark.
+ @param marker Marker to set on object.
+*/
+
+void
+wxdobj_mark_recursively(Wxd_object_t *pobj, uint8_t marker);
+
+
+/** Unmark one object recursively.
+ @param pobj Object to modify.
+ @param marker Marker to remove from object.
+*/
+
+void
+wxdobj_unmark_recursively(Wxd_object_t *pobj, uint8_t marker);
+
+
+/** Find stipple structure for object.
+ @param pdrw Drawing the object belongs to.
+ @param pobj Object needing stipple.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_stipple_t *
+wxdobj_find_stipple_structure(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Find font structure for object.
+ @param pdrw Drawing the object belongs to.
+ @param pobj Object needing font.
+ @return Valid pointer on success, NULL on error.
+*/
+
+Wxd_font_t *
+wxdobj_find_font_structure(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Remove unused stipple data from drawing.
+ @param pdrw Drawing to clean up.
+*/
+
+void
+wxdobj_remove_unused_stipples(
+ Wxd_drawing_t *pdrw
+);
+
+
+/** Remove unused font data from drawing.
+ @param pdrw Drawing to clean up.
+*/
+
+void
+wxdobj_remove_unused_fonts(
+ Wxd_drawing_t *pdrw
+);
+
+
+/** Get number of used layers in drawing.
+ @param pdrw Drawing to check.
+ @return Number of used layers, may be 0 for empty drawing.
+*/
+
+size_t
+wxdobj_get_number_of_layers(
+ Wxd_drawing_t *pdrw
+);
+
+
+/** Remove object from drawing.
+ The object can be a simple object or a group object.
+ When removing a group object all contents objects are removed too.
+ @param pdrw Drawing containing the object.
+ @param pobj Object to remove.
+*/
+
+void
+wxdobj_obj_delete_from_drawing(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Shift drawing object for a difference.
+ Call this function on members of the flat storage only.
+ @param pobj Object to shift.
+ @param ppt Point containing vector for shifting.
+ @param doit Flag: Really do it (1=yes, 0=simulation/check only).
+ @return 1 on success, 0 on error (mathematical overflow).
+*/
+
+int
+wxdobj_shift(Wxd_object_t *pobj, Wxd_point_t *ppt, int doit);
+
+
+/** Shift drawing objects marked by OBJ_MARKER_1 in a drawing.
+ @param pdrw Drawing containing the objects to shift.
+ @param ppt Point containing vector for shifting.
+ @param doit Flag: Really do it (1=yes, 0=simulation/check only).
+ @return 1 on success, 0 on error (mathematical overflow).
+*/
+
+int
+wxdobj_shift_marked(Wxd_drawing_t *pdrw, Wxd_point_t *ppt, int doit);
+
+
+/** Check whether a given marker is set on object.
+ @param pobj Object to test.
+ @param marker Marker to check for.
+ @return Test result.
+*/
+
+bool
+wxdobj_is_marked(Wxd_object_t const *pobj, uint8_t marker);
+
+
+/** Create copy of an object.
+ The copy is not registered to a drawing.
+ @param psrc Object to copy, must not be a group.
+ @return Valid pointer to new object on success, NULL on error.
+*/
+
+Wxd_object_t *
+wxdobj_copy(Wxd_object_t *psrc);
+
+
+
+/** Copy drawing object (recursively if object is a group).
+ @param pdrw Drawing containing the object.
+ @param pobj Drawing object, may be a group.
+ @param psh Shift vector for the copy.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdobj_copy_recursive(
+ Wxd_drawing_t *pdrw,
+ Wxd_object_t *obj,
+ Wxd_point_t *psh
+);
+
+
+/** Report one object.
+ @param pobj Object to report.
+*/
+
+void
+wxdobj_report_object(
+ Wxd_object_t *pobj
+);
+
+
+/** Find object and point index for point move operation.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_point_move_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+);
+
+
+/** Find object and point index for spline value modification.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_modify_spline_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+);
+
+
+/** Find object and point index for object rotation.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_rotate_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+);
+
+/** Find object and point index for adding a further point.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param pbins Address of flag, whether to append after or insert before.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_point_add_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ bool *pbapp,
+ double dlim
+);
+
+
+/** Find object and point index for point delete operation.
+ @param pdrw Drawing to search.
+ @param ppt Mouse position.
+ @param pindex Address of index variable to set on success.
+ @param dlim Distance limit.
+ @return Found object on success, NULL if no object found.
+*/
+
+Wxd_object_t *
+wxdobj_point_del_find_object(
+ Wxd_drawing_t *pdrw,
+ Wxd_point_t const *ppt,
+ uint16_t *pindex,
+ double dlim
+);
+
+/** Retrieve control point coordinates.
+ @param pdst Destination variable to save point coordinates.
+ @param psrc Object to retrieve control point from.
+ @param pind Control point index.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_get_control_point(
+ Wxd_point_t *pdst,
+ Wxd_object_t const *psrc,
+ uint16_t pind
+);
+
+
+/** Modify control point coordinates.
+ @param pdst Destination object to modify control point.
+ @param psrc New control point coordinates.
+ @param pind Control point index.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_set_control_point(
+ Wxd_object_t *pdst,
+ Wxd_point_t const *psrc,
+ uint16_t pind
+);
+
+
+/** Delete one control point of polygon, polyline or spline.
+ @param pdst Destination object to modify control points.
+ @param pind Control point index.
+*/
+
+void
+wxdobj_delete_control_point(
+ Wxd_object_t *pdst,
+ uint16_t pind
+);
+
+
+/** Add one control point to polygon, polyline or spline.
+ @param pdst Destination object to modify control points.
+ @param pind Control point index.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_add_control_point(
+ Wxd_object_t *pdst,
+ uint16_t pind,
+ Wxd_point_t const *ppt
+);
+
+
+/** Calculate distance from point to box.
+ @param pbox Box coordinates.
+ @param r Radius for rounded corners.
+ @param ppt Point coordinates.
+ @param bCtrlPt Find distance to control points, not lines.
+ @param pIndex Address of index variable for control points.
+ @return Distance from point ppt to box.
+*/
+
+double
+wxdobj_dist_box(
+ Wxd_bb_t *pbox,
+ uint32_t r,
+ dk4_gra_point_t *ppt,
+ bool bCtrlPt,
+ uint16_t *pIndex
+);
+
+
+/** Calculate distance from point to box.
+ @param pbox Box coordinates.
+ @param ppt Point coordinates.
+ @param pIndex Address of index variable for control points.
+ @param dlim Distance limit.
+ @return True if point is near enough to control point, false otherwise.
+*/
+
+bool
+wxdobj_ctrlpt_dist_box(
+ Wxd_bb_t *pbox,
+ dk4_gra_point_t *ppt,
+ uint16_t *pIndex,
+ double dlim
+);
+
+
+/** Set a bounding box structure with control points from an object.
+ @param pbox Bounding box to set up.
+ @param pobj Object to use, must be simple object (not a group).
+*/
+
+bool
+wxdobj_control_pt_to_bb(
+ Wxd_bb_t *pbox,
+ Wxd_object_t const *pobj
+);
+
+
+/** Add object bounding box to another bounding box.
+ @param pbox Accumulated bounding box information for all objects.
+ @param psrc Bounding box information to add for one object.
+*/
+
+bool
+wxdobj_bb_add_bb(
+ Wxd_bb_t *pbox,
+ Wxd_bb_t const *psrc
+);
+
+
+/** Flip one object, use collected bounding box information.
+ @param pobj Object to flip.
+ @param pbox Bounding box information to use.
+ @param bVert Flip vertically (true) or horizontally (false).
+ @param bRealRun Really flip object (false: test only).
+*/
+
+bool
+wxdobj_flip_object(
+ Wxd_object_t *pobj,
+ Wxd_bb_t const *pbox,
+ bool bVert = false,
+ bool bRealRun = true
+);
+
+
+/** Find number of objects in structured storage marked by marker 2.
+ @param pdrw Drawing to check.
+ @return 0, 1 or 2 (for 2 and more).
+*/
+
+int
+wxdobj_num_marked_2(Wxd_drawing_t *pdrw);
+
+
+/** Find bounding box for a simple graphics element.
+ @param pdrw Drawing containing the graphics element.
+ @param pobj Graphics element to find bounding box for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_simple_object(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Rebuild bounding box for structural nodes in a group.
+ Bounding boxes for simple objects are not renewed.
+ @param pdrw Drawing containing the graphics element.
+ @param pobj Graphics element to find bounding box for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_group_structural(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Rebuild bounding box for a group completely (both for structural
+ nodes and simple objects.
+ @param pdrw Drawing containing the graphics element.
+ @param pobj Graphics element to find bounding box for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_group_and_contents(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** Rebuild bounding box for a modified object.
+ If the modified (moved) object is a group, rebuild the bounding
+ box completely. If a simple object was modified, rebuild the bounding
+ box for that object; if the object is member of a group, rebuild
+ the groups structural bounding boxes.
+ @param pdrw Drawing containing the graphics element.
+ @param pobj Graphics element to find bounding box for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_modified_object(
+ Wxd_drawing_t const *pdrw,
+ Wxd_object_t *pobj
+);
+
+
+/** (Re)build bounding box information for all drawing elements.
+ @param pdrw Drawing to build bounding box information for.
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_bb_for_drawing(
+ Wxd_drawing_t *pdrw
+);
+
+
+/** Set number of sub segments per X-spline segment.
+ @param pdrw Drawing to set up.
+ @param xs Number of sub segments per X-spline segment.
+*/
+
+void
+wxdobj_drw_set_xsubs(Wxd_drawing_t *pdrw, size_t xs);
+
+
+/** Check whether a text label object is a LaTeX text label.
+ @param pobj Object to check.
+ @rturn True for LaTeX text labels, false otherwise.
+*/
+
+bool
+wxdobj_text_is_latex(Wxd_object_t const *pobj);
+
+
+/** Check whether an object can be converted to another object type.
+ @param destot Destination object type.
+ @param pobj Object to check.
+ @return True if the conversion is possible, false otherwise.
+*/
+
+bool
+wxdobj_can_convert(
+ int destot,
+ const Wxd_object_t *pobj
+);
+
+
+/** Rotate an object by 90 degree.
+ @param pobj Object to rotate.
+ @param x0 Center point x coordinate.
+ @param y0 Center point y coordinate.
+ @param neg Flag: Negative direction (false=positive).
+ @param doit Flag: Really do it (false=test only).
+ @return True on success, false on error.
+*/
+
+bool
+wxdobj_rotate_object(
+ Wxd_object_t *pobj,
+ int32_t x0,
+ int32_t y0,
+ bool neg,
+ bool doit
+);
+
+
+/** Check two bounding boxes for equality.
+ @param pa One bounding box.
+ @param pb Other bounding box.
+ @return True if both boxes are equal, false otherwise.
+*/
+
+bool
+wxdobj_bb_equal(Wxd_bb_t const *pa, Wxd_bb_t const *pb);
+
+
+/* PROTOTYPES (end) */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/WxdkdrawRead.cpp b/support/dktools/WxdkdrawRead.cpp
new file mode 100644
index 0000000000..565f206827
--- /dev/null
+++ b/support/dktools/WxdkdrawRead.cpp
@@ -0,0 +1,2776 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawRead.cpt
+*/
+
+/** @file WxdkdrawRead.cpp The WxdkdrawRead module.
+*/
+
+
+#line 52 "WxdkdrawRead.cpt"
+
+#include "wxdkdraw.h"
+
+
+
+
+
+#line 58 "WxdkdrawRead.cpt"
+
+
+
+/** Flags in the context.
+*/
+enum {
+ FLAG_VERSION_OK = 0x0001 , /**< Version number found and ok. */
+ FLAG_BB = 0x0002 , /**< Bounding box found. */
+};
+
+
+
+/** Current reader state, what is expected in next line.
+*/
+enum {
+ S_OBJ_START = 0, /**< Start of new object. */
+ S_TEXT_DETAILS , /**< Text label: Coordinates. */
+ S_TEXT_EXPORT , /**< Text label: Export text. */
+ S_TEXT_SCREEN , /**< Text label: Screen text. */
+ S_POLY_POINT , /**< Polyline/polygon: Point. */
+ S_SPLINE_POINT , /**< Spline: Point. */
+ S_ARC , /**< Arc: 3 points. */
+ S_CIRCLE , /**< Circle: Coordinates. */
+ S_DOT_FILLED , /**< Filled dot: Details. */
+ S_DOT_WHITE , /**< White filled dot: Details. */
+ S_ELLIPSE , /**< Ellipse: Details. */
+ S_BOX , /**< Box: Details. */
+ S_IMAGE_DETAILS , /**< Image: Coordinates and details. */
+ S_IMAGE_FILENAME /**< Image: File name. */
+};
+
+
+
+/** Context.
+*/
+typedef struct {
+ Wxd_object_t styletemp; /**< Style template. */
+ Wxd_drawing_t *pdrw; /**< Drawing to add to. */
+ Wxd_object_t *pgrp; /**< Group object to add to. */
+ Wxd_object_t *pouc; /**< Object under construction. */
+ FILE *fin; /**< Input file to read. */
+ wxdrd_status_t *pstat; /**< Status to report errors. */
+ char **parts; /**< Words in the current line. */
+ int *back; /**< Address of result variable. */
+ size_t nparts; /**< Elements available in parts array. */
+ size_t uparts; /**< Number of words in current line. */
+ unsigned long lineno; /**< Current line number. */
+ int issym; /**< Flag: Reading library symbol. */
+ int flags; /**< Flags about found information. */
+ int cc; /**< Flag: Can continue. */
+ int st; /**< Current reader state. */
+ uint16_t cpi; /**< Current point index. */
+} wxdrd_ctx_t;
+
+
+
+/** Constant text fragments.
+*/
+static const char * const wxdrd_c8_kw[] = {
+/* 0 */
+"WXD",
+
+NULL
+
+
+#line 123 "WxdkdrawRead.cpt"
+};
+
+
+
+/** Initialize a reader context before using it.
+ @param pctx Context to initialize.
+*/
+static
+void
+ctx_init(wxdrd_ctx_t *pctx)
+{
+
+
+#line 135 "WxdkdrawRead.cpt"
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_POLYLINE);
+ pctx->pdrw = NULL;
+ pctx->pgrp = NULL;
+ pctx->pouc = NULL;
+ pctx->fin = NULL;
+ pctx->pstat = NULL;
+ pctx->back = NULL;
+ pctx->lineno = 0UL;
+ pctx->issym = 0;
+ pctx->flags = 0;
+ pctx->cc = 0;
+ pctx->st = S_OBJ_START;
+ pctx->cpi = 0U;
+
+
+#line 149 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Write error to status and abort processing.
+ @param pctx Reader context.
+ @param ec Error code.
+ @param te Number of text element in the line causing the problem.
+*/
+static
+void
+wxd_read_error(wxdrd_ctx_t *pctx, int ec, size_t te)
+{
+
+
+#line 163 "WxdkdrawRead.cpt"
+ pctx->cc = -1;
+ *(pctx->back) = 0;
+ if ((0UL == pctx->pstat->ln) || (WXDRD_E_NONE == pctx->pstat->ec)) {
+ pctx->pstat->ln = pctx->lineno;
+ pctx->pstat->te = te;
+ pctx->pstat->ec = ec;
+ }
+
+
+#line 171 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Read double number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pd Address of result variable.
+*/
+static
+void
+rd_dbl(wxdrd_ctx_t *pctx, size_t te, double *pd)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_double(pd, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) {
+
+#line 188 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 8 bit unsigned integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pu Address of result variable.
+*/
+static
+void
+rd_u08(wxdrd_ctx_t *pctx, size_t te, uint8_t *pu)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_u8(pu, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) {
+
+#line 207 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 8 bit signed integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pi Address of result variable.
+*/
+static
+void
+rd_i08(wxdrd_ctx_t *pctx, size_t te, int8_t *pi)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_i8(pi, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) {
+
+#line 226 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 16 bit unsigned integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pu Address of result variable.
+*/
+static
+void
+rd_u16(wxdrd_ctx_t *pctx, size_t te, uint16_t *pu)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_u16(pu, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) {
+
+#line 245 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 16 bit signed integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pi Address of result variable.
+*/
+static
+void
+rd_i16(wxdrd_ctx_t *pctx, size_t te, int16_t *pi)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_i16(pi, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) {
+
+#line 264 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 32 bit unsigned integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pu Address of result variable.
+*/
+static
+void
+rd_u32(wxdrd_ctx_t *pctx, size_t te, uint32_t *pu)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_u32(pu, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) {
+
+#line 283 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 32 bit signed integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pi Address of result variable.
+*/
+static
+void
+rd_i32(wxdrd_ctx_t *pctx, size_t te, int32_t *pi)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_i32(pi, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) {
+
+#line 302 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+
+
+
+/** Check whether the line starts with space or tabulator.
+ @param il Line to check.
+ @return 0 for object start line, 1 for details line (indented).
+*/
+static
+int
+line_starts_with_space(char const *il)
+{
+ int back = 0;
+ if (' ' == *il) { back = 1; }
+ if ('\t' == *il) { back = 1; }
+ return back;
+}
+
+
+
+/** Check whether the file version found is acceptable.
+ @param maj Major format version number found in file.
+ @param min Minor format version number found in file.
+ @param maxmaj Major format version allowed by module.
+ @param maxmin Minor format version allowed by module.
+ @return 1 for acceptable file format version.
+
+*/
+static
+int
+acceptable_version(uint16_t maj, uint16_t min, uint16_t maxmaj, uint16_t maxmin)
+{
+ int back = 0;
+
+
+#line 341 "WxdkdrawRead.cpt"
+ if (maxmaj > maj) {
+ back = 1;
+ }
+ else {
+ if (maxmaj == maj) {
+ if (maxmin >= min) {
+ back = 1;
+ }
+ }
+ }
+
+#line 351 "WxdkdrawRead.cpt"
+ return back;
+}
+
+
+
+/** Apply the first line of a WXD file, check for file format keyword
+ and format version numbers.
+ @param pctx Reader context.
+ @param il Input line to process.
+*/
+static
+void
+apply_first_line(wxdrd_ctx_t *pctx, char *il)
+{
+ int res;
+
+
+#line 367 "WxdkdrawRead.cpt"
+ if (0 == line_starts_with_space(il)) {
+ pctx->uparts = dk4str8_tokenize(
+ pctx->parts, pctx->nparts, il, NULL, NULL
+ );
+ if (3 == pctx->uparts) {
+ if (0 == strcmp(wxdrd_c8_kw[0], (pctx->parts)[0])) {
+ rd_u16(pctx, 1, &((pctx->pdrw)->fv_maj));
+ rd_u16(pctx, 2, &((pctx->pdrw)->fv_min));
+ res = acceptable_version(
+ (pctx->pdrw)->fv_maj, (pctx->pdrw)->fv_min, 1, 0
+ );
+ if (0 == res) {
+
+#line 379 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_WRONG_VERSION, 0);
+ }
+ }
+ else {
+
+#line 383 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NO_WXD, 0);
+ }
+ }
+ else {
+
+#line 387 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NO_WXD, 0);
+ }
+ }
+ else {
+
+#line 391 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NO_WXD, 0);
+ }
+
+
+#line 394 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Check whether or not to split the current line for processing.
+ @param pctx Reader context containing the state.
+ @return 1 to split the line, 0 to leave unchanged.
+*/
+static
+int
+must_split_line(wxdrd_ctx_t *pctx)
+{
+ int back = 1;
+
+
+#line 408 "WxdkdrawRead.cpt"
+ switch (pctx->st) {
+ case S_TEXT_EXPORT : case S_TEXT_SCREEN : case S_IMAGE_FILENAME : {
+ back = 0;
+ } break;
+ }
+
+#line 413 "WxdkdrawRead.cpt"
+ return back;
+}
+
+
+
+/** Process configuration line.
+ The line is processed only when reading an entire drawing.
+ Configuration lines are not processed when reading a symbol.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_config(wxdrd_ctx_t *pctx)
+{
+ int16_t st = 0; /* Sub type */
+
+
+#line 429 "WxdkdrawRead.cpt"
+ if (0 == pctx->issym) {
+ if (1 < pctx->uparts) {
+ rd_i16(pctx, 1, &st);
+ if (1 == pctx->cc) {
+ switch ( (int)st ) {
+ case 0 : {
+
+#line 435 "WxdkdrawRead.cpt"
+ if (6 == pctx->uparts) {
+ rd_i32(pctx, 2, &(((pctx->pdrw)->bb).xl));
+ rd_i32(pctx, 3, &(((pctx->pdrw)->bb).xr));
+ rd_i32(pctx, 4, &(((pctx->pdrw)->bb).yb));
+ rd_i32(pctx, 5, &(((pctx->pdrw)->bb).yt));
+ if (wxdobj_bb_is_null_area(&((pctx->pdrw)->bb))) {
+
+
+#line 442 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_BOX_NO_AREA, 2);
+ }
+ }
+ else {
+
+#line 446 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 1 : {
+
+#line 450 "WxdkdrawRead.cpt"
+ if (3 == pctx->uparts) {
+ rd_u32(pctx, 2, &((pctx->pdrw)->baselw));
+ if ((uint32_t)0UL == (pctx->pdrw)->baselw) {
+ (pctx->pdrw)->baselw = 1UL;
+ }
+ }
+ else {
+
+#line 457 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 2 : {
+
+#line 461 "WxdkdrawRead.cpt"
+ if (3 == pctx->uparts) {
+ rd_i08(pctx, 2, &((pctx->pdrw)->zl));
+ if ((int8_t)(-14) > (pctx->pdrw)->zl) {
+ (pctx->pdrw)->zl = (int8_t)(-14);
+ }
+ if ((int8_t)14 < (pctx->pdrw)->zl) {
+ (pctx->pdrw)->zl = (int8_t)14;
+ }
+ }
+ else {
+
+#line 471 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 3 : {
+
+#line 475 "WxdkdrawRead.cpt"
+ /*
+ The "0 3 xc yc" configuration option was removed
+ from the file format.
+ As we have some old test files we ignore 0 3 lines.
+ */
+ } break;
+ case 4 : {
+
+#line 482 "WxdkdrawRead.cpt"
+ if (6 == pctx->uparts) {
+ rd_u32(pctx, 2, &((pctx->pdrw)->bleft));
+ rd_u32(pctx, 2, &((pctx->pdrw)->bright));
+ rd_u32(pctx, 2, &((pctx->pdrw)->bbottom));
+ rd_u32(pctx, 2, &((pctx->pdrw)->btop));
+ }
+ else {
+
+#line 489 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 5 : {
+
+#line 493 "WxdkdrawRead.cpt"
+ if (3 == pctx->uparts) {
+ rd_u08(pctx, 2, &((pctx->pdrw)->gridunit));
+ if (0x00 != (pctx->pdrw)->gridunit) {
+ (pctx->pdrw)->gridunit = 0x01;
+ }
+ }
+ else {
+
+#line 500 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 6 : {
+
+#line 504 "WxdkdrawRead.cpt"
+ if (3 == pctx->uparts) {
+ rd_u08(pctx, 2, &((pctx->pdrw)->gridbase));
+ if (0x00 != (pctx->pdrw)->gridbase) {
+ (pctx->pdrw)->gridbase = 0x01;
+ }
+ }
+ else {
+
+#line 511 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ default : {
+
+#line 515 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_OBJTYPE, 0);
+ } break;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 521 "WxdkdrawRead.cpt"
+ }
+#endif
+ }
+ else {
+
+#line 525 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else {
+
+#line 529 "WxdkdrawRead.cpt"
+ if (1 < pctx->uparts) {
+ rd_i16(pctx, 1, &st);
+ if (1 == pctx->cc) {
+ switch ( (int)st ) {
+ case 0 : {
+ if (6 == pctx->uparts) {
+ rd_i32(pctx, 2, &(((pctx->pstat)->bb).xl));
+ rd_i32(pctx, 3, &(((pctx->pstat)->bb).xr));
+ rd_i32(pctx, 4, &(((pctx->pstat)->bb).yb));
+ rd_i32(pctx, 5, &(((pctx->pstat)->bb).yt));
+ if (wxdobj_bb_is_null_area(&((pctx->pstat)->bb))) {
+
+
+#line 541 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_BOX_NO_AREA, 2);
+ }
+ }
+ } break;
+ }
+ }
+ }
+ }
+
+
+#line 550 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process group begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_group_begin(wxdrd_ctx_t *pctx)
+{
+ Wxd_object_t *ng;
+
+
+#line 563 "WxdkdrawRead.cpt"
+ ng = wxdobj_drw_add_group(pctx->pdrw, pctx->pgrp);
+ if (NULL != ng) {
+ pctx->pgrp = ng;
+ }
+ else {
+
+#line 568 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+
+
+#line 571 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process group end line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_group_end(wxdrd_ctx_t *pctx)
+{
+ Wxd_object_t *ng = NULL;
+ if (NULL != pctx->pgrp) {
+ ng = (pctx->pgrp)->pa;
+ pctx->pgrp = ng;
+ if ((NULL == pctx->pgrp) && (0 != pctx->issym)) {
+
+#line 587 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NO_GROUP_TO_END, 0);
+ }
+ }
+ else {
+
+#line 591 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_NO_GROUP_TO_END, 0);
+ }
+}
+
+
+
+/** Read layer number and stroke/fill colour for text labels,
+ dots and images.
+ @param pctx Reader context.
+*/
+static
+void
+read_elements_05(wxdrd_ctx_t *pctx)
+{
+
+
+#line 606 "WxdkdrawRead.cpt"
+ rd_i16(pctx, 1, &((pctx->styletemp).lay));
+ rd_u08(pctx, 2, &((pctx->styletemp).fc[0]));
+ rd_u08(pctx, 3, &((pctx->styletemp).fc[1]));
+ rd_u08(pctx, 4, &((pctx->styletemp).fc[2]));
+ (pctx->styletemp).sc[0] = (pctx->styletemp).fc[0];
+ (pctx->styletemp).sc[1] = (pctx->styletemp).fc[1];
+ (pctx->styletemp).sc[2] = (pctx->styletemp).fc[2];
+
+
+#line 614 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process text label begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_textlabel(wxdrd_ctx_t *pctx)
+{
+
+
+#line 626 "WxdkdrawRead.cpt"
+ if (5 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_TEXT);
+ read_elements_05(pctx);
+ pctx->st = S_TEXT_DETAILS;
+ }
+ else {
+
+#line 632 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 635 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Correct line style.
+ @param pls Address of line style variable to correct.
+*/
+static
+void
+correct_linestyle(uint8_t *pls)
+{
+ if ((uint8_t)(WXD_LS_DASH_DOT_DOT_DOT) < *pls) {
+ *pls = (uint8_t)(WXD_LS_DASH_DOT_DOT_DOT);
+ }
+}
+
+
+
+/** Correct style length.
+ @param psl Address of style length variable to correct.
+*/
+static
+void
+correct_stylelength(uint8_t *psl)
+{
+ if ((uint8_t)1U > *psl) {
+ *psl = (uint8_t)1U;
+ }
+}
+
+
+
+/** Correct line cap style.
+ @param pcs Address of line cap style variable to correct.
+*/
+static
+void
+correct_capstyle(uint8_t *pcs)
+{
+ if ((uint8_t)(WXD_LC_PROJECTING) < *pcs) {
+ *pcs = (uint8_t)(WXD_LC_PROJECTING);
+ }
+}
+
+
+
+/** Correct line join style.
+ @param pjs Address of line join style variable to correct.
+*/
+static
+void
+correct_joinstyle(uint8_t *pjs)
+{
+ if ((uint8_t)(WXD_LJ_BEVELED) < *pjs) {
+ *pjs = (uint8_t)(WXD_LJ_BEVELED);
+ }
+}
+
+
+
+/** Correct miter limit.
+ @param pml Address of miter limit variable to correct.
+*/
+static
+void
+correct_miterlimit(uint8_t *pml)
+{
+ if ((uint8_t)1U > *pml) {
+ *pml = (uint8_t)1U;
+ }
+}
+
+
+
+/** Correct arrow type.
+ @param pat Address of arrow type variable to correct.
+*/
+static
+void
+correct_arrowtype(uint8_t *pat)
+{
+ if ((uint8_t)29U < *pat) {
+ *pat = (uint8_t)29U;
+ }
+}
+
+
+
+/** Correct arrow length.
+ @param pal Address of arrow length variable to correct.
+*/
+static
+void
+correct_arrowlength(uint8_t *pal)
+{
+ if ((uint8_t)1U > *pal) {
+ *pal = (uint8_t)1U;
+ }
+}
+
+
+
+/** Correct arrow width.
+ @param paw Address of arrow width variable to correct.
+*/
+static
+void
+correct_arrowwidth(uint8_t *paw)
+{
+ if ((uint8_t)1U > *paw) {
+ *paw = (uint8_t)1U;
+ }
+}
+
+
+
+/** Correct fill style.
+ @param pfs Address of fill style variable to correct.
+*/
+static
+void
+correct_fillstyle(uint8_t *pfs)
+{
+ if ((uint8_t)(WXD_FS_VERTICAL_TIRES) < *pfs) {
+ *pfs = (uint8_t)(WXD_FS_VERTICAL_TIRES);
+ }
+}
+
+
+/** Read 18 style values for polylines and open splines.
+ @param pctx Reader context.
+*/
+static
+void
+read_elements_18(wxdrd_ctx_t *pctx)
+{
+
+
+#line 772 "WxdkdrawRead.cpt"
+ rd_u16(pctx, 1, &(((pctx->styletemp).det).p.n));
+ rd_i16(pctx, 2, &((pctx->styletemp).lay));
+ rd_u08(pctx, 3, &((pctx->styletemp).sc[0]));
+ rd_u08(pctx, 4, &((pctx->styletemp).sc[1]));
+ rd_u08(pctx, 5, &((pctx->styletemp).sc[2]));
+ rd_u16(pctx, 6, &((pctx->styletemp).lw));
+ rd_u08(pctx, 7, &((pctx->styletemp).ls));
+ correct_linestyle(&((pctx->styletemp).ls));
+ rd_u08(pctx, 8, &((pctx->styletemp).sl));
+ correct_stylelength(&((pctx->styletemp).sl));
+ rd_u08(pctx, 9, &((pctx->styletemp).cs));
+ correct_capstyle(&((pctx->styletemp).cs));
+ rd_u08(pctx, 10, &((pctx->styletemp).js));
+ correct_joinstyle(&((pctx->styletemp).js));
+ rd_u08(pctx, 11, &((pctx->styletemp).ml));
+ correct_miterlimit(&((pctx->styletemp).ml));
+ rd_u08(pctx, 12, &((pctx->styletemp).aft));
+ correct_arrowtype(&((pctx->styletemp).aft));
+ rd_u08(pctx, 13, &((pctx->styletemp).afl));
+ correct_arrowlength(&((pctx->styletemp).afl));
+ rd_u08(pctx, 14, &((pctx->styletemp).afw));
+ correct_arrowwidth(&((pctx->styletemp).afw));
+ rd_u08(pctx, 15, &((pctx->styletemp).abt));
+ correct_arrowtype(&((pctx->styletemp).abt));
+ rd_u08(pctx, 16, &((pctx->styletemp).abl));
+ correct_arrowlength(&((pctx->styletemp).abl));
+ rd_u08(pctx, 17, &((pctx->styletemp).abw));
+ correct_arrowwidth(&((pctx->styletemp).abw));
+
+
+#line 801 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process polyline object begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_polyline(wxdrd_ctx_t *pctx)
+{
+
+
+#line 813 "WxdkdrawRead.cpt"
+ if (18 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_POLYLINE);
+ read_elements_18(pctx);
+ if (1 < (pctx->styletemp).det.p.n) {
+ pctx->pouc = wxdobj_add_polyline(
+ pctx->pdrw, pctx->pgrp, (pctx->styletemp).det.p.n, 0,
+ &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_POLY_POINT;
+ pctx->cpi = 0U;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 826 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 829 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 833 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TOO_FEW_POINTS, 0);
+ }
+ }
+ else {
+
+#line 837 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 840 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process open spline begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_ospline(wxdrd_ctx_t *pctx)
+{
+
+
+#line 852 "WxdkdrawRead.cpt"
+ if (18 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_O_SPLINE);
+ read_elements_18(pctx);
+ if (1 < (pctx->styletemp).det.p.n) {
+ pctx->pouc = wxdobj_add_spline(
+ pctx->pdrw, pctx->pgrp, (pctx->styletemp).det.p.n, 0,
+ &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_SPLINE_POINT;
+ pctx->cpi = 0U;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 865 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 868 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 872 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TOO_FEW_POINTS, 0);
+ }
+ }
+ else {
+
+#line 876 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 879 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process open arc begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_oarc(wxdrd_ctx_t *pctx)
+{
+
+
+#line 891 "WxdkdrawRead.cpt"
+ if (15 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_O_ARC);
+ rd_i16(pctx, 1, &((pctx->styletemp).lay));
+ rd_u08(pctx, 2, &((pctx->styletemp).sc[0]));
+ rd_u08(pctx, 3, &((pctx->styletemp).sc[1]));
+ rd_u08(pctx, 4, &((pctx->styletemp).sc[2]));
+ rd_u16(pctx, 5, &((pctx->styletemp).lw));
+ rd_u08(pctx, 6, &((pctx->styletemp).ls));
+ correct_linestyle(&((pctx->styletemp).ls));
+ rd_u08(pctx, 7, &((pctx->styletemp).sl));
+ correct_stylelength(&((pctx->styletemp).sl));
+ rd_u08(pctx, 8, &((pctx->styletemp).cs));
+ correct_capstyle(&((pctx->styletemp).cs));
+ rd_u08(pctx, 9, &((pctx->styletemp).aft));
+ correct_arrowtype(&((pctx->styletemp).aft));
+ rd_u08(pctx, 10, &((pctx->styletemp).afl));
+ correct_arrowlength(&((pctx->styletemp).afl));
+ rd_u08(pctx, 11, &((pctx->styletemp).afw));
+ correct_arrowwidth(&((pctx->styletemp).afw));
+ rd_u08(pctx, 12, &((pctx->styletemp).abt));
+ correct_arrowtype(&((pctx->styletemp).abt));
+ rd_u08(pctx, 13, &((pctx->styletemp).abl));
+ correct_arrowlength(&((pctx->styletemp).abl));
+ rd_u08(pctx, 14, &((pctx->styletemp).abw));
+ correct_arrowwidth(&((pctx->styletemp).abw));
+ pctx->pouc = wxdobj_add_arc(pctx->pdrw,pctx->pgrp,0,&(pctx->styletemp));
+ if (NULL != pctx->pouc) {
+ pctx->st = S_ARC;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 921 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 924 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 928 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 931 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Read 14 or 15 style values for polygons, closed splines and closed
+ arcs.
+ @param pctx Reader context.
+ @param p 1 for polylines and splines, 0 for arc.
+*/
+static
+void
+read_elements_14_15(wxdrd_ctx_t *pctx, size_t p)
+{
+
+
+#line 945 "WxdkdrawRead.cpt"
+ if (0 != p) {
+ rd_u16(pctx, 1, &(((pctx->styletemp).det).p.n));
+ }
+ rd_i16(pctx, (p + 1), &((pctx->styletemp).lay));
+ rd_u08(pctx, (p + 2), &((pctx->styletemp).sc[0]));
+ rd_u08(pctx, (p + 3), &((pctx->styletemp).sc[1]));
+ rd_u08(pctx, (p + 4), &((pctx->styletemp).sc[2]));
+ rd_u08(pctx, (p + 5), &((pctx->styletemp).fc[0]));
+ rd_u08(pctx, (p + 6), &((pctx->styletemp).fc[1]));
+ rd_u08(pctx, (p + 7), &((pctx->styletemp).fc[2]));
+ rd_u16(pctx, (p + 8), &((pctx->styletemp).lw));
+ rd_u08(pctx, (p + 9), &((pctx->styletemp).ls));
+ correct_linestyle(&((pctx->styletemp).ls));
+ rd_u08(pctx, (p + 10), &((pctx->styletemp).sl));
+ correct_stylelength(&((pctx->styletemp).sl));
+ rd_u08(pctx, (p + 11), &((pctx->styletemp).js));
+ correct_joinstyle(&((pctx->styletemp).js));
+ rd_u08(pctx, (p + 12), &((pctx->styletemp).ml));
+ correct_miterlimit(&((pctx->styletemp).ml));
+ rd_u08(pctx, (p + 13), &((pctx->styletemp).fs));
+ correct_fillstyle(&((pctx->styletemp).fs));
+
+
+#line 967 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process polygon begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_polygon(wxdrd_ctx_t *pctx)
+{
+
+
+#line 979 "WxdkdrawRead.cpt"
+ if (15 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_POLYGON);
+ read_elements_14_15(pctx, 1);
+ if (1 < (pctx->styletemp).det.p.n) {
+ pctx->pouc = wxdobj_add_polyline(
+ pctx->pdrw, pctx->pgrp, (pctx->styletemp).det.p.n, 1,
+ &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_POLY_POINT;
+ pctx->cpi = 0U;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 992 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 995 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 999 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TOO_FEW_POINTS, 0);
+ }
+ }
+ else {
+
+#line 1003 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1006 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process closed spline begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_cspline(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1018 "WxdkdrawRead.cpt"
+ if (15 == pctx->uparts) {
+ /*
+ We initialize as polygon here as read_elements_14_15() writes
+ the number of points to det.p.n.
+ As the details of polygon and closed spline only contain
+ point number and buffer address, this is no problem. All style
+ values are initialized and transferred same way.
+ */
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_POLYGON);
+ read_elements_14_15(pctx, 1);
+ if (1 < (pctx->styletemp).det.p.n) {
+ pctx->pouc = wxdobj_add_spline(
+ pctx->pdrw, pctx->pgrp, (pctx->styletemp).det.p.n, 1,
+ &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_SPLINE_POINT;
+ pctx->cpi = 0U;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 1038 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1041 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1045 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TOO_FEW_POINTS, 0);
+ }
+ }
+ else {
+
+#line 1049 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1052 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process closed arc begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_carc(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1064 "WxdkdrawRead.cpt"
+ if (14 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_C_ARC);
+ read_elements_14_15(pctx, 0);
+ pctx->pouc = wxdobj_add_arc(
+ pctx->pdrw, pctx->pgrp, 1, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_ARC;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 1074 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1077 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1081 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1084 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Read 12 style values for circles, ellipses and boxes.
+ @param pctx Reader context.
+*/
+static
+void
+read_elements_12(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1096 "WxdkdrawRead.cpt"
+ rd_i16(pctx, 1, &((pctx->styletemp).lay));
+ rd_u08(pctx, 2, &((pctx->styletemp).sc[0]));
+ rd_u08(pctx, 3, &((pctx->styletemp).sc[1]));
+ rd_u08(pctx, 4, &((pctx->styletemp).sc[2]));
+ rd_u08(pctx, 5, &((pctx->styletemp).fc[0]));
+ rd_u08(pctx, 6, &((pctx->styletemp).fc[1]));
+ rd_u08(pctx, 7, &((pctx->styletemp).fc[2]));
+ rd_u16(pctx, 8, &((pctx->styletemp).lw));
+ rd_u08(pctx, 9, &((pctx->styletemp).ls));
+ correct_linestyle(&((pctx->styletemp).ls));
+ rd_u08(pctx, 10, &((pctx->styletemp).sl));
+ correct_stylelength(&((pctx->styletemp).sl));
+ rd_u08(pctx, 11, &((pctx->styletemp).fs));
+ correct_fillstyle(&((pctx->styletemp).fs));
+
+
+#line 1111 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process circle begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_circle(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1123 "WxdkdrawRead.cpt"
+ if (12 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_CIRCLE);
+ read_elements_12(pctx);
+ pctx->pouc = wxdobj_add_circle(
+ pctx->pdrw, pctx->pgrp, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_CIRCLE;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 1133 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1136 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1140 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1143 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process ellipse begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_ellipse(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1155 "WxdkdrawRead.cpt"
+ if (12 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_ELLIPSE);
+ read_elements_12(pctx);
+ pctx->pouc = wxdobj_add_ellipse(
+ pctx->pdrw, pctx->pgrp, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_ELLIPSE;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 1165 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1168 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1172 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1175 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process box begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_box(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1187 "WxdkdrawRead.cpt"
+ if (12 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_BOX);
+ read_elements_12(pctx);
+ pctx->pouc = wxdobj_add_box(
+ pctx->pdrw, pctx->pgrp, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_BOX;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 1197 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1200 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1204 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1207 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process image begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_image(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1219 "WxdkdrawRead.cpt"
+ if (5 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_IMAGE);
+ read_elements_05(pctx);
+ pctx->st = S_IMAGE_DETAILS;
+ }
+ else {
+
+#line 1225 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1228 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process filled dot begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_dot_filled(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1240 "WxdkdrawRead.cpt"
+ if (5 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_DOT_FILLED);
+ read_elements_05(pctx);
+ pctx->pouc = wxdobj_add_dot(pctx->pdrw,pctx->pgrp,0,&(pctx->styletemp));
+ if (NULL != pctx->pouc) {
+ pctx->st = S_DOT_FILLED;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 1248 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1251 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1255 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1258 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process white dot begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_dot_white(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1270 "WxdkdrawRead.cpt"
+ if (5 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_DOT_WHITE);
+ read_elements_05(pctx);
+ pctx->pouc = wxdobj_add_dot(pctx->pdrw,pctx->pgrp,1,&(pctx->styletemp));
+ if (NULL != pctx->pouc) {
+ pctx->st = S_DOT_WHITE;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 1278 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1281 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1285 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1288 "WxdkdrawRead.cpt"
+}
+
+
+
+
+
+
+/** Process object start line.
+ @param pctx Reader context.
+ @param il Input line to process.
+*/
+static
+void
+process_line_objstart(wxdrd_ctx_t *pctx, char *il)
+{
+ int8_t ot;
+
+
+#line 1305 "WxdkdrawRead.cpt"
+ for (size_t i = 0; i < pctx->nparts; i++) { (pctx->parts)[i] = NULL; }
+ pctx->uparts = dk4str8_tokenize(pctx->parts, pctx->nparts, il, NULL, NULL);
+ if (0 < pctx->uparts) {
+ ot = 0;
+ rd_i08(pctx, 0, &ot);
+ if (1 == pctx->cc) {
+ switch ( (int)ot ) {
+ case WXD_OT_CONFIG : {
+
+#line 1313 "WxdkdrawRead.cpt"
+ process_osl_config(pctx);
+ } break;
+ case WXD_OT_GROUP_BEGIN : {
+
+#line 1316 "WxdkdrawRead.cpt"
+ process_osl_group_begin(pctx);
+ } break;
+ case WXD_OT_GROUP_END : {
+
+#line 1319 "WxdkdrawRead.cpt"
+ process_osl_group_end(pctx);
+ } break;
+ case WXD_OT_TEXT : {
+
+#line 1322 "WxdkdrawRead.cpt"
+ process_osl_textlabel(pctx);
+ } break;
+ case WXD_OT_POLYLINE : {
+
+#line 1325 "WxdkdrawRead.cpt"
+ process_osl_polyline(pctx);
+ } break;
+ case WXD_OT_O_SPLINE : {
+
+#line 1328 "WxdkdrawRead.cpt"
+ process_osl_ospline(pctx);
+ } break;
+ case WXD_OT_O_ARC : {
+
+#line 1331 "WxdkdrawRead.cpt"
+ process_osl_oarc(pctx);
+ } break;
+ case WXD_OT_POLYGON : {
+
+#line 1334 "WxdkdrawRead.cpt"
+ process_osl_polygon(pctx);
+ } break;
+ case WXD_OT_C_SPLINE : {
+
+#line 1337 "WxdkdrawRead.cpt"
+ process_osl_cspline(pctx);
+ } break;
+ case WXD_OT_C_ARC : {
+
+#line 1340 "WxdkdrawRead.cpt"
+ process_osl_carc(pctx);
+ } break;
+ case WXD_OT_CIRCLE : {
+
+#line 1343 "WxdkdrawRead.cpt"
+ process_osl_circle(pctx);
+ } break;
+ case WXD_OT_ELLIPSE : {
+
+#line 1346 "WxdkdrawRead.cpt"
+ process_osl_ellipse(pctx);
+ } break;
+ case WXD_OT_BOX : {
+
+#line 1349 "WxdkdrawRead.cpt"
+ process_osl_box(pctx);
+ } break;
+ case WXD_OT_IMAGE : {
+
+#line 1352 "WxdkdrawRead.cpt"
+ process_osl_image(pctx);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+
+#line 1355 "WxdkdrawRead.cpt"
+ process_osl_dot_filled(pctx);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+
+#line 1358 "WxdkdrawRead.cpt"
+ process_osl_dot_white(pctx);
+ } break;
+ default : {
+
+#line 1361 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_OBJTYPE, 0);
+ } break;
+ }
+ }
+ }
+ else {
+
+#line 1367 "WxdkdrawRead.cpt"
+ /* Skip empty line */
+ }
+
+
+#line 1370 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Correct font index.
+ @param pfi Address of font index variable to correct.
+*/
+static
+void
+correct_fontindex(uint8_t *pfi)
+{
+ if ((uint8_t)34U < *pfi) {
+ *pfi = (uint8_t)34U;
+ }
+}
+
+
+
+/** Correct font size.
+ @param pfs Address of font size variable to correct.
+*/
+static
+void
+correct_fontsize(uint16_t *pfs)
+{
+ if ((uint16_t)1U > *pfs) {
+ *pfs = (uint16_t)1U;
+ }
+}
+
+
+
+/** Correct text align.
+ @param pta Address of text align variable to correct.
+*/
+static
+void
+correct_textalign(uint8_t *pta)
+{
+ if ((uint8_t)(WXD_TA_RIGHT) < *pta) {
+ *pta = (uint8_t)(WXD_TA_RIGHT);
+ }
+}
+
+
+/** Process details line 1 for text (coordinates).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_text1(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1423 "WxdkdrawRead.cpt"
+ if (7 == pctx->uparts) {
+ rd_u08(pctx, 0, &((pctx->styletemp).det.t.find));
+ correct_fontindex(&((pctx->styletemp).det.t.find));
+ rd_u16(pctx, 1, &((pctx->styletemp).det.t.fsz));
+ correct_fontsize(&((pctx->styletemp).det.t.fsz));
+ rd_u08(pctx, 2, &((pctx->styletemp).det.t.al));
+ correct_textalign(&((pctx->styletemp).det.t.al));
+ rd_u08(pctx, 3, &((pctx->styletemp).det.t.fl));
+ rd_i32(pctx, 4, &((pctx->styletemp).det.t.x));
+ rd_i32(pctx, 5, &((pctx->styletemp).det.t.y));
+ rd_i16(pctx, 6, &((pctx->styletemp).det.t.a));
+ pctx->st = S_TEXT_EXPORT;
+ }
+ else {
+
+#line 1437 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1440 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line 2 for text (export text).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_text2(wxdrd_ctx_t *pctx, const char *il)
+{
+ wxChar wxb[1024];
+ size_t const szwxb = DK4_SIZEOF(wxb,wxChar);
+
+
+#line 1454 "WxdkdrawRead.cpt"
+ if (0 != dk4recwx_utf8_to_wxchar(wxb, szwxb, &(il[1]), NULL)) {
+ pctx->pouc = wxdobj_add_textlabel(
+ pctx->pdrw, pctx->pgrp, wxb, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ ((pctx->pouc)->det).t.find = (pctx->styletemp).det.t.find;
+ ((pctx->pouc)->det).t.fsz = (pctx->styletemp).det.t.fsz;
+ ((pctx->pouc)->det).t.al = (pctx->styletemp).det.t.al;
+ ((pctx->pouc)->det).t.fl = (pctx->styletemp).det.t.fl;
+ ((pctx->pouc)->det).t.x = (pctx->styletemp).det.t.x;
+ ((pctx->pouc)->det).t.y = (pctx->styletemp).det.t.y;
+ ((pctx->pouc)->det).t.a = (pctx->styletemp).det.t.a;
+ ((pctx->pouc)->det).t.font = NULL;
+ pctx->st = S_TEXT_SCREEN;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 1470 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1473 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1477 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_RECODE_TEXT, 0);
+ }
+
+
+#line 1480 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line 3 for text (screen text).
+ @param pctx Reader context.
+ @param il Input line.
+*/
+static
+void
+process_det_text3(wxdrd_ctx_t *pctx, const char *il)
+{
+ wxChar wxb[1024];
+ size_t const szwxb = DK4_SIZEOF(wxb,wxChar);
+
+
+#line 1495 "WxdkdrawRead.cpt"
+ if ('\0' != il[1]) {
+ if (0 != dk4recwx_utf8_to_wxchar(wxb, szwxb, &(il[1]), NULL)) {
+ if (NULL != pctx->pouc) {
+ ((pctx->pouc)->det).t.tsc = dk4strx_dup(wxb, NULL);
+ if (NULL == ((pctx->pouc)->det).t.tsc) {
+
+#line 1500 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1504 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else {
+
+#line 1508 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_RECODE_TEXT, 0);
+ }
+ }
+ else {
+ if (NULL != pctx->pouc) {
+ ((pctx->pouc)->det).t.tsc = NULL;
+ }
+ else {
+
+#line 1516 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ pctx->st = S_OBJ_START;
+
+
+#line 1521 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line for polyline (point coordinates).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_poly(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1533 "WxdkdrawRead.cpt"
+ if (NULL != pctx->pouc) {
+ if (2 == pctx->uparts) {
+ rd_i32(pctx, 0, &((((pctx->pouc)->det).p.p)[pctx->cpi].x));
+ rd_i32(pctx, 1, &((((pctx->pouc)->det).p.p)[pctx->cpi].y));
+ }
+ else {
+
+#line 1539 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ pctx->cpi += 1U;
+ if (pctx->cpi >= ((pctx->pouc)->det).p.n) {
+ pctx->st = S_OBJ_START;
+
+#line 1544 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1547 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+
+
+#line 1550 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Correct X-spline s coefficient of control point.
+ @param ps Address of s value variable to correct.
+*/
+static
+void
+correct_svalue(double *ps)
+{
+ if (-1.0 > *ps) {
+ *ps = -1.0;
+ }
+ else {
+ if (1.0 < *ps) {
+ *ps = 1.0;
+ }
+ }
+}
+
+
+/** Process details line for spline (control point coordinates and s value).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_spline(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1580 "WxdkdrawRead.cpt"
+ if (NULL != pctx->pouc) {
+ if (3 == pctx->uparts) {
+ rd_i32(pctx, 0, &((((pctx->pouc)->det).s.p)[pctx->cpi].x));
+ rd_i32(pctx, 1, &((((pctx->pouc)->det).s.p)[pctx->cpi].y));
+ rd_dbl(pctx, 2, &((((pctx->pouc)->det).s.p)[pctx->cpi].s));
+ correct_svalue(&((((pctx->pouc)->det).s.p)[pctx->cpi].s));
+ }
+ else {
+
+#line 1588 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ pctx->cpi += 1U;
+ if (pctx->cpi >= ((pctx->pouc)->det).s.n) {
+ pctx->st = S_OBJ_START;
+
+#line 1593 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 1596 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+
+
+#line 1599 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line for arc.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_arc(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1611 "WxdkdrawRead.cpt"
+ if (NULL != pctx->pouc) {
+ if (6 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).a.x1));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).a.y1));
+ rd_i32(pctx, 2, &(((pctx->pouc)->det).a.x2));
+ rd_i32(pctx, 3, &(((pctx->pouc)->det).a.y2));
+ rd_i32(pctx, 4, &(((pctx->pouc)->det).a.x3));
+ rd_i32(pctx, 5, &(((pctx->pouc)->det).a.y3));
+ wxdarc_calculation(
+ &(((pctx->pouc)->det).a.x), &(((pctx->pouc)->det).a.y),
+ &(((pctx->pouc)->det).a.r), &(((pctx->pouc)->det).a.a),
+ &(((pctx->pouc)->det).a.b), &(((pctx->pouc)->det).a.d),
+ ((pctx->pouc)->det).a.x1, ((pctx->pouc)->det).a.y1,
+ ((pctx->pouc)->det).a.x2, ((pctx->pouc)->det).a.y2,
+ ((pctx->pouc)->det).a.x3, ((pctx->pouc)->det).a.y3
+ );
+ }
+ else {
+
+#line 1629 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else {
+
+#line 1633 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+
+
+#line 1637 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Correct a radius.
+ @param pr Address of radius variable to correct.
+ @param pctx Reader context.
+*/
+static
+void
+correct_radius(uint32_t *pr, wxdrd_ctx_t *pctx)
+{
+ if ((uint32_t)1UL > *pr) {
+ *pr = (uint32_t)15875UL;
+ (pctx->pstat)->mod = 1;
+
+#line 1652 "WxdkdrawRead.cpt"
+ }
+}
+
+
+
+/** Correct dot diameter.
+ @param pd Address of dot diameter variable to correct.
+ @param pctx Reader context.
+*/
+static
+void
+correct_dotdiameter(uint16_t *pd, wxdrd_ctx_t *pctx)
+{
+ if ((uint16_t)1U > *pd) {
+ *pd = (uint16_t)1U;
+ (pctx->pstat)->mod = 1;
+
+#line 1668 "WxdkdrawRead.cpt"
+ }
+}
+
+
+
+static
+void
+correct_bounding_box(Wxd_bb_t *pbb, wxdrd_ctx_t *pctx)
+{
+ if (pbb->xl >= pbb->xr) {
+ (pctx->pstat)->mod = 1;
+
+#line 1679 "WxdkdrawRead.cpt"
+ if ((DK4_I32_MAX - (int32_t)15875L) >= pbb->xl) {
+ pbb->xr = pbb->xl + (int32_t)15875L;
+ }
+ else {
+ pbb->xl = pbb->xr - (int32_t)15875L;
+ }
+ }
+ if (pbb->yb >= pbb->yt) {
+ (pctx->pstat)->mod = 1;
+
+#line 1688 "WxdkdrawRead.cpt"
+ if ((DK4_I32_MAX - (int32_t)15875L) >= pbb->yb) {
+ pbb->yt = pbb->yb + (int32_t)15875L;
+ }
+ else {
+ pbb->yb = pbb->yt - (int32_t)15875L;
+ }
+ }
+}
+
+
+
+/** Process details line for circle.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_circle(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1707 "WxdkdrawRead.cpt"
+ if (NULL != pctx->pouc) {
+ if (3 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).e.x));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).e.y));
+ rd_u32(pctx, 2, &(((pctx->pouc)->det).e.rx));
+ correct_radius(&(((pctx->pouc)->det).e.rx), pctx);
+ ((pctx->pouc)->det).e.ry = ((pctx->pouc)->det).e.rx;
+ }
+ else {
+
+#line 1716 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else {
+
+#line 1720 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+
+
+#line 1724 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line for colour filled dot.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_dot_filled(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1736 "WxdkdrawRead.cpt"
+ if (NULL != pctx->pouc) {
+ if (3 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).d.x));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).d.y));
+ rd_u16(pctx, 2, &(((pctx->pouc)->det).d.d));
+ correct_dotdiameter(&(((pctx->pouc)->det).d.d), pctx);
+ }
+ else {
+
+#line 1744 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else {
+
+#line 1748 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+
+
+#line 1752 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line for white filled dot.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_dot_white(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1764 "WxdkdrawRead.cpt"
+ if (NULL != pctx->pouc) {
+ if (4 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).d.x));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).d.y));
+ rd_u16(pctx, 2, &(((pctx->pouc)->det).d.d));
+ correct_dotdiameter(&(((pctx->pouc)->det).d.d), pctx);
+ rd_u16(pctx, 3, &((pctx->pouc)->lw));
+ correct_dotdiameter(&((pctx->pouc)->lw), pctx);
+ }
+ else {
+
+#line 1774 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else {
+
+#line 1778 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+
+
+#line 1782 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line for ellipse.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_ellipse(wxdrd_ctx_t *pctx)
+{
+
+
+#line 1794 "WxdkdrawRead.cpt"
+ if (NULL != pctx->pouc) {
+ if (5 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).e.x));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).e.y));
+ rd_u32(pctx, 2, &(((pctx->pouc)->det).e.rx));
+ correct_radius(&(((pctx->pouc)->det).e.rx), pctx);
+ rd_u32(pctx, 3, &(((pctx->pouc)->det).e.ry));
+ correct_radius(&(((pctx->pouc)->det).e.ry), pctx);
+ rd_i16(pctx, 4, &(((pctx->pouc)->det).e.a));
+ }
+ else {
+
+#line 1805 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else {
+
+#line 1809 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+
+
+#line 1813 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line for box.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_box(wxdrd_ctx_t *pctx)
+{
+ uint32_t w;
+ uint32_t h;
+
+
+#line 1827 "WxdkdrawRead.cpt"
+ if (NULL != pctx->pouc) {
+ if (5 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).b.b.xl));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).b.b.xr));
+ rd_i32(pctx, 2, &(((pctx->pouc)->det).b.b.yb));
+ rd_i32(pctx, 3, &(((pctx->pouc)->det).b.b.yt));
+ rd_u32(pctx, 4, &(((pctx->pouc)->det).b.r));
+ wxdobj_bb_correct(&(((pctx->pouc)->det).b.b));
+ if (wxdobj_bb_is_null_area(&(((pctx->pouc)->det).b.b))) {
+
+
+#line 1837 "WxdkdrawRead.cpt"
+#if 0
+ wxd_read_error(pctx, WXDRD_E_BOX_NO_AREA, 0);
+#endif
+ correct_bounding_box(&(((pctx->pouc)->det).b.b), pctx);
+ }
+ w = (uint32_t)(((pctx->pouc)->det).b.b.xr
+ - ((pctx->pouc)->det).b.b.xl);
+ h = (uint32_t)(((pctx->pouc)->det).b.b.yt
+ - ((pctx->pouc)->det).b.b.yb);
+ if (h < w) { w = h; }
+ w = w / (uint32_t)2UL;
+ if (((pctx->pouc)->det).b.r > w) {
+ ((pctx->pouc)->det).b.r = w;
+ }
+ }
+ else {
+
+#line 1853 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else {
+
+#line 1857 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+
+
+#line 1861 "WxdkdrawRead.cpt"
+}
+
+
+
+static
+int32_t
+add_signed_unsigned_32(wxdrd_ctx_t *pctx, int32_t s, uint32_t u, size_t te)
+{
+ dk4_er_t er;
+ uint32_t sum;
+ uint32_t x;
+ int32_t back = (int32_t)0L;
+
+
+#line 1874 "WxdkdrawRead.cpt"
+ dk4error_init(&er);
+ if (0 <= s) {
+
+#line 1876 "WxdkdrawRead.cpt"
+ sum = dk4ma_uint32_t_add((uint32_t)s, u, &er);
+ if (DK4_E_NONE == er.ec) {
+ if ((uint32_t)(DK4_I32_MAX) >= sum) {
+ back = (int32_t)sum;
+ }
+ else {
+
+#line 1882 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, te);
+ }
+ }
+ else {
+
+#line 1886 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, te);
+ }
+ }
+ else {
+
+#line 1890 "WxdkdrawRead.cpt"
+ x = (uint32_t)dk4ma_int32_t_abs(s, &er);
+ if (DK4_E_NONE != er.ec) {
+
+#line 1892 "WxdkdrawRead.cpt"
+ x = (uint32_t)(DK4_I32_MAX);
+ x += (uint32_t)1U;
+ }
+ dk4error_init(&er);
+ sum = dk4ma_uint32_t_sub(u, x, &er);
+ if (DK4_E_NONE == er.ec) {
+ if ((uint32_t)(DK4_I32_MAX) >= sum) {
+ back = (int32_t)sum;
+ }
+ else {
+
+#line 1902 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, te);
+ }
+ }
+ else {
+
+#line 1906 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, te);
+ }
+ }
+
+#line 1909 "WxdkdrawRead.cpt"
+ return back;
+}
+
+
+
+/** Process details line 1 for image (coordinates and flags).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_image1(wxdrd_ctx_t *pctx)
+{
+ uint32_t w;
+ uint32_t h;
+
+
+#line 1924 "WxdkdrawRead.cpt"
+ if (7 == pctx->uparts) {
+ rd_u16(pctx, 0, &((pctx->styletemp).det.i.fl));
+ rd_i08(pctx, 1, &((pctx->styletemp).det.i.r2g));
+ rd_i08(pctx, 2, &((pctx->styletemp).det.i.r2c));
+ rd_i32(pctx, 3, &((pctx->styletemp).det.i.br.xl));
+ rd_i32(pctx, 4, &((pctx->styletemp).det.i.br.yb));
+ rd_u32(pctx, 5, &w);
+ rd_u32(pctx, 6, &h);
+ (pctx->styletemp).det.i.br.xr = add_signed_unsigned_32(
+ pctx, (pctx->styletemp).det.i.br.xl, w, 5
+ );
+ (pctx->styletemp).det.i.br.yt = add_signed_unsigned_32(
+ pctx, (pctx->styletemp).det.i.br.yb, h, 6
+ );
+ pctx->st = S_IMAGE_FILENAME;
+ if (
+ ((pctx->styletemp).det.i.br.xr == (pctx->styletemp).det.i.br.xl)
+ || ((pctx->styletemp).det.i.br.yt == (pctx->styletemp).det.i.br.yb)
+ ) {
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, 0);
+ }
+ }
+ else {
+
+#line 1947 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+
+
+#line 1950 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Process details line 2 for image (file name).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_image2(wxdrd_ctx_t *pctx, const char *il)
+{
+ wxChar fnb[DK4_MAX_PATH];
+ wxChar wxb[1024];
+ size_t const szwxb = DK4_SIZEOF(wxb,wxChar);
+ size_t const szfnb = DK4_SIZEOF(fnb,wxChar);
+ int ok = 0;
+
+
+#line 1967 "WxdkdrawRead.cpt"
+
+ if ('\0' != il[1]) {
+ if (0 != dk4recwx_utf8_to_wxchar(wxb, szwxb, &(il[1]), NULL)) {
+ if (
+ (0 == dk4strx_path_is_absolute(wxb))
+ && (NULL != pctx->pstat->dirn)
+ ) {
+ if (0 != dk4strx_cpy_s(fnb, szfnb, (pctx->pstat->dirn), NULL)) {
+ if (0 != dk4strx_path_append(fnb, szfnb, wxb, NULL)) {
+ ok = 1;
+#if TRACE_DEBUG
+#if DK4_SIZEOF_WXCHAR > 1
+
+
+#line 1980 "WxdkdrawRead.cpt"
+#else
+
+
+#line 1982 "WxdkdrawRead.cpt"
+#endif
+#endif
+ }
+ else {
+
+#line 1986 "WxdkdrawRead.cpt"
+ /* ERROR: File name too long */
+ wxd_read_error(pctx, WXDRD_E_FILENAME_TOO_LONG, 0);
+ }
+ }
+ else {
+
+#line 1991 "WxdkdrawRead.cpt"
+ /* ERROR: Directory name too long */
+ wxd_read_error(pctx, WXDRD_E_FILENAME_TOO_LONG, 0);
+ }
+ }
+ else {
+ if (0 != dk4strx_cpy_s(fnb, szfnb, wxb, NULL)) {
+ ok = 1;
+#if TRACE_DEBUG
+#if DK4_SIZEOF_WXCHAR > 1
+
+
+#line 2001 "WxdkdrawRead.cpt"
+#else
+
+
+#line 2003 "WxdkdrawRead.cpt"
+#endif
+#endif
+ }
+ else {
+
+#line 2007 "WxdkdrawRead.cpt"
+ /* ERROR: Name too long */
+ wxd_read_error(pctx, WXDRD_E_FILENAME_TOO_LONG, 0);
+ }
+ }
+ if (0 != ok) {
+ pctx->pouc = wxdobj_add_image(
+ pctx->pdrw, pctx->pgrp, fnb, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ ((pctx->pouc)->det).i.fl = (pctx->styletemp).det.i.fl;
+ ((pctx->pouc)->det).i.r2g = (pctx->styletemp).det.i.r2g;
+ ((pctx->pouc)->det).i.r2c = (pctx->styletemp).det.i.r2c;
+ ((pctx->pouc)->det).i.br.xl = (pctx->styletemp).det.i.br.xl;
+ ((pctx->pouc)->det).i.br.yb = (pctx->styletemp).det.i.br.yb;
+ ((pctx->pouc)->det).i.br.xr = (pctx->styletemp).det.i.br.xr;
+ ((pctx->pouc)->det).i.br.yt = (pctx->styletemp).det.i.br.yt;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)
+ ) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+
+#line 2026 "WxdkdrawRead.cpt"
+ }
+ }
+ else {
+
+#line 2029 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ }
+ else {
+
+#line 2034 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_RECODE_FILENAME, 0);
+ }
+ }
+ else {
+
+#line 2038 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_EMPTY_FILENAME, 0);
+ }
+ pctx->st = S_OBJ_START;
+
+
+#line 2042 "WxdkdrawRead.cpt"
+}
+
+
+
+
+/** Process details line.
+ @param pctx Reader context.
+ @param il Input line to process.
+*/
+static
+void
+process_line_details(wxdrd_ctx_t *pctx, char *il)
+{
+
+
+#line 2056 "WxdkdrawRead.cpt"
+ for (size_t i = 0; i < pctx->nparts; i++) { (pctx->parts)[i] = NULL; }
+ if (0 != must_split_line(pctx)) {
+
+#line 2058 "WxdkdrawRead.cpt"
+ pctx->uparts = dk4str8_tokenize(pctx->parts,pctx->nparts,il,NULL,NULL);
+
+
+#line 2060 "WxdkdrawRead.cpt"
+ }
+ else {
+
+#line 2062 "WxdkdrawRead.cpt"
+ pctx->uparts = 0;
+ }
+ switch (pctx->st) {
+ case S_TEXT_DETAILS : {
+ process_det_text1(pctx);
+ } break;
+ case S_TEXT_EXPORT : {
+ process_det_text2(pctx, il);
+ } break;
+ case S_TEXT_SCREEN : {
+ process_det_text3(pctx, il);
+ } break;
+ case S_POLY_POINT : {
+ process_det_poly(pctx);
+ } break;
+ case S_SPLINE_POINT : {
+ process_det_spline(pctx);
+ } break;
+ case S_ARC : {
+ process_det_arc(pctx);
+ } break;
+ case S_CIRCLE : {
+ process_det_circle(pctx);
+ } break;
+ case S_DOT_FILLED : {
+ process_det_dot_filled(pctx);
+ } break;
+ case S_DOT_WHITE : {
+ process_det_dot_white(pctx);
+ } break;
+ case S_ELLIPSE : {
+ process_det_ellipse(pctx);
+ } break;
+ case S_BOX : {
+ process_det_box(pctx);
+ } break;
+ case S_IMAGE_DETAILS : {
+ process_det_image1(pctx);
+ } break;
+ case S_IMAGE_FILENAME : {
+ process_det_image2(pctx, il);
+ } break;
+ default : {
+
+#line 2105 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_READER_STATE, 0);
+ } break;
+ }
+
+#line 2108 "WxdkdrawRead.cpt"
+}
+
+
+
+static
+void
+apply_input_line(wxdrd_ctx_t *pctx, char *il)
+{
+
+
+#line 2117 "WxdkdrawRead.cpt"
+ if (1UL == pctx->lineno) {
+ apply_first_line(pctx, il);
+ }
+ else {
+ if (0 == line_starts_with_space(il)) {
+ if (S_OBJ_START == pctx->st) {
+ pctx->pouc = NULL;
+ pctx->uparts = 0;
+ process_line_objstart(pctx, il);
+ }
+ else {
+
+#line 2128 "WxdkdrawRead.cpt"
+ /* Details line expected */
+ wxd_read_error(pctx, WXDRD_E_EXPECTED_DETAILS, 0);
+ }
+ }
+ else {
+ if (S_OBJ_START != pctx->st) {
+ process_line_details(pctx, il);
+ }
+ else {
+
+#line 2137 "WxdkdrawRead.cpt"
+ /* Object start line expected */
+ wxd_read_error(pctx, WXDRD_E_EXPECTED_OBJSTART, 0);
+ }
+ }
+ }
+
+#line 2142 "WxdkdrawRead.cpt"
+}
+
+
+
+/** Apply input file contents to current drawing.
+ @param pctx Context, prepared to read drawing or symbol.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+apply_input_file(wxdrd_ctx_t *pctx)
+{
+ char ib[1024]; /* Input buffer */
+ char *parts[32];
+ int back;
+
+
+#line 2159 "WxdkdrawRead.cpt"
+ back = 1;
+ pctx->back = &back;
+ pctx->parts = parts;
+ pctx->nparts = 32;
+ pctx->uparts = 0;
+ pctx->cc = 1;
+ while (1 == pctx->cc) {
+ if (NULL != fgets(ib, sizeof(ib), pctx->fin)) {
+ if (ULONG_MAX > pctx->lineno) { pctx->lineno += 1UL; }
+ if ('\0' != ib[0]) { dk4str8_delnl(&(ib[1])); }
+
+
+#line 2170 "WxdkdrawRead.cpt"
+
+
+#line 2171 "WxdkdrawRead.cpt"
+ apply_input_line(pctx, ib);
+ }
+ else {
+ /* No more lines available
+ */
+ pctx->cc = 0;
+
+#line 2177 "WxdkdrawRead.cpt"
+ }
+ }
+ if ((1 == back) && (S_OBJ_START != pctx->st)) {
+
+#line 2180 "WxdkdrawRead.cpt"
+ wxd_read_error(pctx, WXDRD_E_READER_STATE, 0);
+ }
+
+
+#line 2183 "WxdkdrawRead.cpt"
+ return back;
+}
+
+
+
+Wxd_drawing_t *
+wxdrd_read_file(FILE *fin, wxdrd_status_t *pstat)
+{
+ wxdrd_ctx_t ctx;
+ Wxd_drawing_t *back = NULL;
+
+
+#line 2194 "WxdkdrawRead.cpt"
+ if ((NULL != fin) && (NULL != pstat)) {
+ back = wxdobj_drw_new();
+ if (NULL != back) {
+ ctx_init(&ctx);
+ ctx.pdrw = back;
+ ctx.fin = fin;
+ ctx.pstat = pstat;
+ ctx.lineno = 0UL;
+ ctx.issym = 0;
+ if (0 != apply_input_file(&ctx)) {
+ back->cx = (back->bb).xl / (int32_t)2L
+ + (back->bb).xr / (int32_t)2L;
+ back->cy = (back->bb).yb / (int32_t)2L
+ + (back->bb).yt / (int32_t)2L;
+ }
+ else {
+ wxdobj_drw_delete(back);
+ back = NULL;
+ }
+ }
+ else {
+
+#line 2215 "WxdkdrawRead.cpt"
+ pstat->ec = WXDRD_E_MEMORY;
+ }
+ }
+ else {
+
+#line 2219 "WxdkdrawRead.cpt"
+ if (NULL != pstat) {
+ pstat->ec = WXDRD_E_INVALID_ARGS;
+ }
+ }
+
+
+#line 2224 "WxdkdrawRead.cpt"
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdrd_read_symbol(Wxd_drawing_t *pdrw, FILE *fin, wxdrd_status_t *pstat)
+{
+ wxdrd_ctx_t ctx;
+ Wxd_object_t *back = NULL;
+
+
+#line 2235 "WxdkdrawRead.cpt"
+ if ((NULL != pdrw) && (NULL != fin) && (NULL != pstat)) {
+ (pstat->bb).xl = 0L;
+ (pstat->bb).xr = 0L;
+ (pstat->bb).yb = 0L;
+ (pstat->bb).yt = 0L;
+ ctx_init(&ctx);
+ ctx.pdrw = pdrw;
+ ctx.fin = fin;
+ ctx.pstat = pstat;
+ ctx.lineno = 0UL;
+ ctx.issym = 1;
+ ctx.pgrp = wxdobj_drw_add_group(pdrw, NULL);
+ if (NULL != ctx.pgrp) {
+ if (0 != apply_input_file(&ctx)) {
+
+#line 2249 "WxdkdrawRead.cpt"
+ back = ctx.pgrp;
+ }
+ else {
+
+#line 2252 "WxdkdrawRead.cpt"
+ wxdobj_obj_delete_from_drawing(pdrw, ctx.pgrp);
+ }
+ }
+ else {
+
+#line 2256 "WxdkdrawRead.cpt"
+ pstat->ec = WXDRD_E_MEMORY;
+ }
+ }
+ else {
+
+#line 2260 "WxdkdrawRead.cpt"
+ if (NULL != pstat) {
+ pstat->ec = WXDRD_E_INVALID_ARGS;
+ }
+ }
+
+
+#line 2265 "WxdkdrawRead.cpt"
+ return back;
+}
+
+
+
+void
+wxdrd_status_init(wxdrd_status_t *pstat)
+{
+#if DK4_SIZEOF_WXCHAR <= 1
+ dkChar blang[32];
+ dkChar bregi[32];
+ size_t const szblang = DK4_SIZEOF(blang,dkChar);
+ size_t const szbregi = DK4_SIZEOF(bregi,dkChar);
+ int enc;
+#endif
+
+
+#line 2281 "WxdkdrawRead.cpt"
+ if (NULL != pstat) {
+ pstat->dirn = NULL;
+ pstat->ln = 0UL;
+ pstat->ec = WXDRD_E_NONE;
+ pstat->te = (size_t)0U;
+#if DK4_SIZEOF_WXCHAR > 1
+#if DK4_SIZEOF_WXCHAR > 2
+ pstat->wxe = DK4_ENCODING_32;
+#else
+ pstat->wxe = DK4_ENCODING_UTF16;
+#endif
+#else
+ pstat->wxe = DK4_FILE_ENCODING_UTF8;
+ if (0 != dk4loc_get_settings(blang,szblang,bregi,szbregi,&enc,NULL)) {
+ pstat->wxe = enc;
+ }
+#endif
+ pstat->mod = 0;
+
+#line 2299 "WxdkdrawRead.cpt"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2302 "WxdkdrawRead.cpt"
+ }
+#endif
+
+
+#line 2305 "WxdkdrawRead.cpt"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawRead.cpt b/support/dktools/WxdkdrawRead.cpt
new file mode 100644
index 0000000000..e8371e2bbd
--- /dev/null
+++ b/support/dktools/WxdkdrawRead.cpt
@@ -0,0 +1,2310 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+
+
+/* PROTOTYPES (start) */
+
+
+/** Initialize status structure to "no error occured".
+ After initializing the status structure set the wxe component
+ to the wxChar encoding obtained from the Dk4WxApplicationHelper class,
+ method GetWxEncoding().
+ @param pstat Status structure to initialize.
+*/
+void
+wxdrd_status_init(wxdrd_status_t *pstat);
+
+
+/** Read drawing from file.
+ @param fin Input file opened for text reading.
+ @param pstat Status structure, must be initialized.
+ @return Valid pointer on success, NULL on error.
+*/
+Wxd_drawing_t *
+wxdrd_read_file(FILE *fin, wxdrd_status_t *pstat);
+
+/** Read library element from file.
+ @param pdrw Drawing to insert the library element.
+ @param fin Input file opened for text reading.
+ @param pstat Status structure, must be initialized.
+ @return Pointer to new group object on success, NULL on error.
+*/
+Wxd_object_t *
+wxdrd_read_symbol(Wxd_drawing_t *pdrw, FILE *fin, wxdrd_status_t *pstat);
+
+
+/* PROTOTYPES (end) */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#include "wxdkdraw.h"
+
+
+
+$!trace-include
+
+
+
+/** Flags in the context.
+*/
+enum {
+ FLAG_VERSION_OK = 0x0001 , /**< Version number found and ok. */
+ FLAG_BB = 0x0002 , /**< Bounding box found. */
+};
+
+
+
+/** Current reader state, what is expected in next line.
+*/
+enum {
+ S_OBJ_START = 0, /**< Start of new object. */
+ S_TEXT_DETAILS , /**< Text label: Coordinates. */
+ S_TEXT_EXPORT , /**< Text label: Export text. */
+ S_TEXT_SCREEN , /**< Text label: Screen text. */
+ S_POLY_POINT , /**< Polyline/polygon: Point. */
+ S_SPLINE_POINT , /**< Spline: Point. */
+ S_ARC , /**< Arc: 3 points. */
+ S_CIRCLE , /**< Circle: Coordinates. */
+ S_DOT_FILLED , /**< Filled dot: Details. */
+ S_DOT_WHITE , /**< White filled dot: Details. */
+ S_ELLIPSE , /**< Ellipse: Details. */
+ S_BOX , /**< Box: Details. */
+ S_IMAGE_DETAILS , /**< Image: Coordinates and details. */
+ S_IMAGE_FILENAME /**< Image: File name. */
+};
+
+
+
+/** Context.
+*/
+typedef struct {
+ Wxd_object_t styletemp; /**< Style template. */
+ Wxd_drawing_t *pdrw; /**< Drawing to add to. */
+ Wxd_object_t *pgrp; /**< Group object to add to. */
+ Wxd_object_t *pouc; /**< Object under construction. */
+ FILE *fin; /**< Input file to read. */
+ wxdrd_status_t *pstat; /**< Status to report errors. */
+ char **parts; /**< Words in the current line. */
+ int *back; /**< Address of result variable. */
+ size_t nparts; /**< Elements available in parts array. */
+ size_t uparts; /**< Number of words in current line. */
+ unsigned long lineno; /**< Current line number. */
+ int issym; /**< Flag: Reading library symbol. */
+ int flags; /**< Flags about found information. */
+ int cc; /**< Flag: Can continue. */
+ int st; /**< Current reader state. */
+ uint16_t cpi; /**< Current point index. */
+} wxdrd_ctx_t;
+
+
+
+/** Constant text fragments.
+*/
+static const char * const wxdrd_c8_kw[] = {
+$!string-table
+#
+# 0 File format keyword
+#
+WXD
+$!end
+};
+
+
+
+/** Initialize a reader context before using it.
+ @param pctx Context to initialize.
+*/
+static
+void
+ctx_init(wxdrd_ctx_t *pctx)
+{
+ $? "+ ctx_init"
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_POLYLINE);
+ pctx->pdrw = NULL;
+ pctx->pgrp = NULL;
+ pctx->pouc = NULL;
+ pctx->fin = NULL;
+ pctx->pstat = NULL;
+ pctx->back = NULL;
+ pctx->lineno = 0UL;
+ pctx->issym = 0;
+ pctx->flags = 0;
+ pctx->cc = 0;
+ pctx->st = S_OBJ_START;
+ pctx->cpi = 0U;
+ $? "- ctx_init"
+}
+
+
+
+/** Write error to status and abort processing.
+ @param pctx Reader context.
+ @param ec Error code.
+ @param te Number of text element in the line causing the problem.
+*/
+static
+void
+wxd_read_error(wxdrd_ctx_t *pctx, int ec, size_t te)
+{
+ $? "+ wxd_read_error"
+ pctx->cc = -1;
+ *(pctx->back) = 0;
+ if ((0UL == pctx->pstat->ln) || (WXDRD_E_NONE == pctx->pstat->ec)) {
+ pctx->pstat->ln = pctx->lineno;
+ pctx->pstat->te = te;
+ pctx->pstat->ec = ec;
+ }
+ $? "- wxd_read_error"
+}
+
+
+
+/** Read double number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pd Address of result variable.
+*/
+static
+void
+rd_dbl(wxdrd_ctx_t *pctx, size_t te, double *pd)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_double(pd, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) { $? "! not a double \"%s\"", TR_8STR((pctx->parts)[te])
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 8 bit unsigned integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pu Address of result variable.
+*/
+static
+void
+rd_u08(wxdrd_ctx_t *pctx, size_t te, uint8_t *pu)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_u8(pu, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) { $? "! not uint8_t \"%s\"", TR_8STR((pctx->parts)[te])
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 8 bit signed integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pi Address of result variable.
+*/
+static
+void
+rd_i08(wxdrd_ctx_t *pctx, size_t te, int8_t *pi)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_i8(pi, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) { $? "! not int8_t \"%s\"", TR_8STR((pctx->parts)[te])
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 16 bit unsigned integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pu Address of result variable.
+*/
+static
+void
+rd_u16(wxdrd_ctx_t *pctx, size_t te, uint16_t *pu)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_u16(pu, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) { $? "! not uint16_t \"%s\"", TR_8STR((pctx->parts)[te])
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 16 bit signed integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pi Address of result variable.
+*/
+static
+void
+rd_i16(wxdrd_ctx_t *pctx, size_t te, int16_t *pi)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_i16(pi, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) { $? "! not int16_t \"%s\"", TR_8STR((pctx->parts)[te])
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 32 bit unsigned integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pu Address of result variable.
+*/
+static
+void
+rd_u32(wxdrd_ctx_t *pctx, size_t te, uint32_t *pu)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_u32(pu, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) { $? "! not uint32_t \"%s\"", TR_8STR((pctx->parts)[te])
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+/** Read 32 bit signed integer number.
+ @param pctx Context to use.
+ @param te Text element index on line.
+ @param pi Address of result variable.
+*/
+static
+void
+rd_i32(wxdrd_ctx_t *pctx, size_t te, int32_t *pi)
+{
+ const char *ep = NULL;
+ int res;
+ res = dk4ma_input_c8_dec_i32(pi, (pctx->parts)[te], &ep, 1, NULL);
+ if (0 == res) { $? "! not int32_t \"%s\"", TR_8STR((pctx->parts)[te])
+ wxd_read_error(pctx, WXDRD_E_NUM_CONV, te);
+ }
+}
+
+
+
+
+
+
+/** Check whether the line starts with space or tabulator.
+ @param il Line to check.
+ @return 0 for object start line, 1 for details line (indented).
+*/
+static
+int
+line_starts_with_space(char const *il)
+{
+ int back = 0;
+ if (' ' == *il) { back = 1; }
+ if ('\t' == *il) { back = 1; }
+ return back;
+}
+
+
+
+/** Check whether the file version found is acceptable.
+ @param maj Major format version number found in file.
+ @param min Minor format version number found in file.
+ @param maxmaj Major format version allowed by module.
+ @param maxmin Minor format version allowed by module.
+ @return 1 for acceptable file format version.
+
+*/
+static
+int
+acceptable_version(uint16_t maj, uint16_t min, uint16_t maxmaj, uint16_t maxmin)
+{
+ int back = 0;
+ $? "+ acceptable_version %u.%u", (unsigned)maj, (unsigned)min
+ if (maxmaj > maj) {
+ back = 1;
+ }
+ else {
+ if (maxmaj == maj) {
+ if (maxmin >= min) {
+ back = 1;
+ }
+ }
+ } $? "- acceptable_version %d", back
+ return back;
+}
+
+
+
+/** Apply the first line of a WXD file, check for file format keyword
+ and format version numbers.
+ @param pctx Reader context.
+ @param il Input line to process.
+*/
+static
+void
+apply_first_line(wxdrd_ctx_t *pctx, char *il)
+{
+ int res;
+ $? "+ apply_first_line"
+ if (0 == line_starts_with_space(il)) {
+ pctx->uparts = dk4str8_tokenize(
+ pctx->parts, pctx->nparts, il, NULL, NULL
+ );
+ if (3 == pctx->uparts) {
+ if (0 == strcmp(wxdrd_c8_kw[0], (pctx->parts)[0])) {
+ rd_u16(pctx, 1, &((pctx->pdrw)->fv_maj));
+ rd_u16(pctx, 2, &((pctx->pdrw)->fv_min));
+ res = acceptable_version(
+ (pctx->pdrw)->fv_maj, (pctx->pdrw)->fv_min, 1, 0
+ );
+ if (0 == res) { $? "! version not acceptable"
+ wxd_read_error(pctx, WXDRD_E_WRONG_VERSION, 0);
+ }
+ }
+ else { $? "! keyword WXD missing"
+ wxd_read_error(pctx, WXDRD_E_NO_WXD, 0);
+ }
+ }
+ else { $? "! number of text words != 3"
+ wxd_read_error(pctx, WXDRD_E_NO_WXD, 0);
+ }
+ }
+ else { $? "! space at start"
+ wxd_read_error(pctx, WXDRD_E_NO_WXD, 0);
+ }
+ $? "- apply_first_line cc=%d", pctx->cc
+}
+
+
+
+/** Check whether or not to split the current line for processing.
+ @param pctx Reader context containing the state.
+ @return 1 to split the line, 0 to leave unchanged.
+*/
+static
+int
+must_split_line(wxdrd_ctx_t *pctx)
+{
+ int back = 1;
+ $? "+ must_split_line"
+ switch (pctx->st) {
+ case S_TEXT_EXPORT : case S_TEXT_SCREEN : case S_IMAGE_FILENAME : {
+ back = 0;
+ } break;
+ } $? "- must_split_line %d", back
+ return back;
+}
+
+
+
+/** Process configuration line.
+ The line is processed only when reading an entire drawing.
+ Configuration lines are not processed when reading a symbol.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_config(wxdrd_ctx_t *pctx)
+{
+ int16_t st = 0; /* Sub type */
+ $? "+ process_osl_config"
+ if (0 == pctx->issym) {
+ if (1 < pctx->uparts) {
+ rd_i16(pctx, 1, &st);
+ if (1 == pctx->cc) {
+ switch ( (int)st ) {
+ case 0 : { $? ". bounding box"
+ if (6 == pctx->uparts) {
+ rd_i32(pctx, 2, &(((pctx->pdrw)->bb).xl));
+ rd_i32(pctx, 3, &(((pctx->pdrw)->bb).xr));
+ rd_i32(pctx, 4, &(((pctx->pdrw)->bb).yb));
+ rd_i32(pctx, 5, &(((pctx->pdrw)->bb).yt));
+ if (wxdobj_bb_is_null_area(&((pctx->pdrw)->bb))) {
+ $? "! null area"
+ wxd_read_error(pctx, WXDRD_E_BOX_NO_AREA, 2);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 1 : { $? ". base line width"
+ if (3 == pctx->uparts) {
+ rd_u32(pctx, 2, &((pctx->pdrw)->baselw));
+ if ((uint32_t)0UL == (pctx->pdrw)->baselw) {
+ (pctx->pdrw)->baselw = 1UL;
+ }
+ }
+ else { $? "! number of txt words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 2 : { $? ". zoom level"
+ if (3 == pctx->uparts) {
+ rd_i08(pctx, 2, &((pctx->pdrw)->zl));
+ if ((int8_t)(-14) > (pctx->pdrw)->zl) {
+ (pctx->pdrw)->zl = (int8_t)(-14);
+ }
+ if ((int8_t)14 < (pctx->pdrw)->zl) {
+ (pctx->pdrw)->zl = (int8_t)14;
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 3 : { $? ". center coordinates"
+ /*
+ The "0 3 xc yc" configuration option was removed
+ from the file format.
+ As we have some old test files we ignore 0 3 lines.
+ */
+ } break;
+ case 4 : { $? ". borders"
+ if (6 == pctx->uparts) {
+ rd_u32(pctx, 2, &((pctx->pdrw)->bleft));
+ rd_u32(pctx, 2, &((pctx->pdrw)->bright));
+ rd_u32(pctx, 2, &((pctx->pdrw)->bbottom));
+ rd_u32(pctx, 2, &((pctx->pdrw)->btop));
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 5 : { $? ". grid unit"
+ if (3 == pctx->uparts) {
+ rd_u08(pctx, 2, &((pctx->pdrw)->gridunit));
+ if (0x00 != (pctx->pdrw)->gridunit) {
+ (pctx->pdrw)->gridunit = 0x01;
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ case 6 : { $? ". grid base"
+ if (3 == pctx->uparts) {
+ rd_u08(pctx, 2, &((pctx->pdrw)->gridbase));
+ if (0x00 != (pctx->pdrw)->gridbase) {
+ (pctx->pdrw)->gridbase = 0x01;
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ } break;
+ default : { $? "! illegal sub object type"
+ wxd_read_error(pctx, WXDRD_E_OBJTYPE, 0);
+ } break;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! aborted due to previous error"
+ }
+#endif
+ }
+ else { $? "! too few text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else { $? ". skip config line for symbol"
+ if (1 < pctx->uparts) {
+ rd_i16(pctx, 1, &st);
+ if (1 == pctx->cc) {
+ switch ( (int)st ) {
+ case 0 : {
+ if (6 == pctx->uparts) {
+ rd_i32(pctx, 2, &(((pctx->pstat)->bb).xl));
+ rd_i32(pctx, 3, &(((pctx->pstat)->bb).xr));
+ rd_i32(pctx, 4, &(((pctx->pstat)->bb).yb));
+ rd_i32(pctx, 5, &(((pctx->pstat)->bb).yt));
+ if (wxdobj_bb_is_null_area(&((pctx->pstat)->bb))) {
+ $? "! null area"
+ wxd_read_error(pctx, WXDRD_E_BOX_NO_AREA, 2);
+ }
+ }
+ } break;
+ }
+ }
+ }
+ }
+ $? "- process_osl_config"
+}
+
+
+
+/** Process group begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_group_begin(wxdrd_ctx_t *pctx)
+{
+ Wxd_object_t *ng;
+ $? "+ process_osl_group_begin"
+ ng = wxdobj_drw_add_group(pctx->pdrw, pctx->pgrp);
+ if (NULL != ng) {
+ pctx->pgrp = ng;
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ $? "- process_osl_group_begin"
+}
+
+
+
+/** Process group end line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_group_end(wxdrd_ctx_t *pctx)
+{
+ Wxd_object_t *ng = NULL;
+ if (NULL != pctx->pgrp) {
+ ng = (pctx->pgrp)->pa;
+ pctx->pgrp = ng;
+ if ((NULL == pctx->pgrp) && (0 != pctx->issym)) { $? "! no group..."
+ wxd_read_error(pctx, WXDRD_E_NO_GROUP_TO_END, 0);
+ }
+ }
+ else { $? "! no group to end"
+ wxd_read_error(pctx, WXDRD_E_NO_GROUP_TO_END, 0);
+ }
+}
+
+
+
+/** Read layer number and stroke/fill colour for text labels,
+ dots and images.
+ @param pctx Reader context.
+*/
+static
+void
+read_elements_05(wxdrd_ctx_t *pctx)
+{
+ $? "+ read_elements_05"
+ rd_i16(pctx, 1, &((pctx->styletemp).lay));
+ rd_u08(pctx, 2, &((pctx->styletemp).fc[0]));
+ rd_u08(pctx, 3, &((pctx->styletemp).fc[1]));
+ rd_u08(pctx, 4, &((pctx->styletemp).fc[2]));
+ (pctx->styletemp).sc[0] = (pctx->styletemp).fc[0];
+ (pctx->styletemp).sc[1] = (pctx->styletemp).fc[1];
+ (pctx->styletemp).sc[2] = (pctx->styletemp).fc[2];
+ $? "- read_elements_05 cc=%d", pctx->cc
+}
+
+
+
+/** Process text label begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_textlabel(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_textlabel"
+ if (5 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_TEXT);
+ read_elements_05(pctx);
+ pctx->st = S_TEXT_DETAILS;
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_textlabel cc=%d", pctx->cc
+}
+
+
+
+/** Correct line style.
+ @param pls Address of line style variable to correct.
+*/
+static
+void
+correct_linestyle(uint8_t *pls)
+{
+ if ((uint8_t)(WXD_LS_DASH_DOT_DOT_DOT) < *pls) {
+ *pls = (uint8_t)(WXD_LS_DASH_DOT_DOT_DOT);
+ }
+}
+
+
+
+/** Correct style length.
+ @param psl Address of style length variable to correct.
+*/
+static
+void
+correct_stylelength(uint8_t *psl)
+{
+ if ((uint8_t)1U > *psl) {
+ *psl = (uint8_t)1U;
+ }
+}
+
+
+
+/** Correct line cap style.
+ @param pcs Address of line cap style variable to correct.
+*/
+static
+void
+correct_capstyle(uint8_t *pcs)
+{
+ if ((uint8_t)(WXD_LC_PROJECTING) < *pcs) {
+ *pcs = (uint8_t)(WXD_LC_PROJECTING);
+ }
+}
+
+
+
+/** Correct line join style.
+ @param pjs Address of line join style variable to correct.
+*/
+static
+void
+correct_joinstyle(uint8_t *pjs)
+{
+ if ((uint8_t)(WXD_LJ_BEVELED) < *pjs) {
+ *pjs = (uint8_t)(WXD_LJ_BEVELED);
+ }
+}
+
+
+
+/** Correct miter limit.
+ @param pml Address of miter limit variable to correct.
+*/
+static
+void
+correct_miterlimit(uint8_t *pml)
+{
+ if ((uint8_t)1U > *pml) {
+ *pml = (uint8_t)1U;
+ }
+}
+
+
+
+/** Correct arrow type.
+ @param pat Address of arrow type variable to correct.
+*/
+static
+void
+correct_arrowtype(uint8_t *pat)
+{
+ if ((uint8_t)29U < *pat) {
+ *pat = (uint8_t)29U;
+ }
+}
+
+
+
+/** Correct arrow length.
+ @param pal Address of arrow length variable to correct.
+*/
+static
+void
+correct_arrowlength(uint8_t *pal)
+{
+ if ((uint8_t)1U > *pal) {
+ *pal = (uint8_t)1U;
+ }
+}
+
+
+
+/** Correct arrow width.
+ @param paw Address of arrow width variable to correct.
+*/
+static
+void
+correct_arrowwidth(uint8_t *paw)
+{
+ if ((uint8_t)1U > *paw) {
+ *paw = (uint8_t)1U;
+ }
+}
+
+
+
+/** Correct fill style.
+ @param pfs Address of fill style variable to correct.
+*/
+static
+void
+correct_fillstyle(uint8_t *pfs)
+{
+ if ((uint8_t)(WXD_FS_VERTICAL_TIRES) < *pfs) {
+ *pfs = (uint8_t)(WXD_FS_VERTICAL_TIRES);
+ }
+}
+
+
+/** Read 18 style values for polylines and open splines.
+ @param pctx Reader context.
+*/
+static
+void
+read_elements_18(wxdrd_ctx_t *pctx)
+{
+ $? "+ read_elements_18"
+ rd_u16(pctx, 1, &(((pctx->styletemp).det).p.n));
+ rd_i16(pctx, 2, &((pctx->styletemp).lay));
+ rd_u08(pctx, 3, &((pctx->styletemp).sc[0]));
+ rd_u08(pctx, 4, &((pctx->styletemp).sc[1]));
+ rd_u08(pctx, 5, &((pctx->styletemp).sc[2]));
+ rd_u16(pctx, 6, &((pctx->styletemp).lw));
+ rd_u08(pctx, 7, &((pctx->styletemp).ls));
+ correct_linestyle(&((pctx->styletemp).ls));
+ rd_u08(pctx, 8, &((pctx->styletemp).sl));
+ correct_stylelength(&((pctx->styletemp).sl));
+ rd_u08(pctx, 9, &((pctx->styletemp).cs));
+ correct_capstyle(&((pctx->styletemp).cs));
+ rd_u08(pctx, 10, &((pctx->styletemp).js));
+ correct_joinstyle(&((pctx->styletemp).js));
+ rd_u08(pctx, 11, &((pctx->styletemp).ml));
+ correct_miterlimit(&((pctx->styletemp).ml));
+ rd_u08(pctx, 12, &((pctx->styletemp).aft));
+ correct_arrowtype(&((pctx->styletemp).aft));
+ rd_u08(pctx, 13, &((pctx->styletemp).afl));
+ correct_arrowlength(&((pctx->styletemp).afl));
+ rd_u08(pctx, 14, &((pctx->styletemp).afw));
+ correct_arrowwidth(&((pctx->styletemp).afw));
+ rd_u08(pctx, 15, &((pctx->styletemp).abt));
+ correct_arrowtype(&((pctx->styletemp).abt));
+ rd_u08(pctx, 16, &((pctx->styletemp).abl));
+ correct_arrowlength(&((pctx->styletemp).abl));
+ rd_u08(pctx, 17, &((pctx->styletemp).abw));
+ correct_arrowwidth(&((pctx->styletemp).abw));
+ $? "- read_elements_18 cc=%d", pctx->cc
+}
+
+
+
+/** Process polyline object begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_polyline(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_polyline"
+ if (18 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_POLYLINE);
+ read_elements_18(pctx);
+ if (1 < (pctx->styletemp).det.p.n) {
+ pctx->pouc = wxdobj_add_polyline(
+ pctx->pdrw, pctx->pgrp, (pctx->styletemp).det.p.n, 0,
+ &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_POLY_POINT;
+ pctx->cpi = 0U;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! too few points"
+ wxd_read_error(pctx, WXDRD_E_TOO_FEW_POINTS, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_polyline cc=%d", pctx->cc
+}
+
+
+
+/** Process open spline begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_ospline(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_ospline"
+ if (18 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_O_SPLINE);
+ read_elements_18(pctx);
+ if (1 < (pctx->styletemp).det.p.n) {
+ pctx->pouc = wxdobj_add_spline(
+ pctx->pdrw, pctx->pgrp, (pctx->styletemp).det.p.n, 0,
+ &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_SPLINE_POINT;
+ pctx->cpi = 0U;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! too few points"
+ wxd_read_error(pctx, WXDRD_E_TOO_FEW_POINTS, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_ospline cc=%d", pctx->cc
+}
+
+
+
+/** Process open arc begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_oarc(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_oarc"
+ if (15 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_O_ARC);
+ rd_i16(pctx, 1, &((pctx->styletemp).lay));
+ rd_u08(pctx, 2, &((pctx->styletemp).sc[0]));
+ rd_u08(pctx, 3, &((pctx->styletemp).sc[1]));
+ rd_u08(pctx, 4, &((pctx->styletemp).sc[2]));
+ rd_u16(pctx, 5, &((pctx->styletemp).lw));
+ rd_u08(pctx, 6, &((pctx->styletemp).ls));
+ correct_linestyle(&((pctx->styletemp).ls));
+ rd_u08(pctx, 7, &((pctx->styletemp).sl));
+ correct_stylelength(&((pctx->styletemp).sl));
+ rd_u08(pctx, 8, &((pctx->styletemp).cs));
+ correct_capstyle(&((pctx->styletemp).cs));
+ rd_u08(pctx, 9, &((pctx->styletemp).aft));
+ correct_arrowtype(&((pctx->styletemp).aft));
+ rd_u08(pctx, 10, &((pctx->styletemp).afl));
+ correct_arrowlength(&((pctx->styletemp).afl));
+ rd_u08(pctx, 11, &((pctx->styletemp).afw));
+ correct_arrowwidth(&((pctx->styletemp).afw));
+ rd_u08(pctx, 12, &((pctx->styletemp).abt));
+ correct_arrowtype(&((pctx->styletemp).abt));
+ rd_u08(pctx, 13, &((pctx->styletemp).abl));
+ correct_arrowlength(&((pctx->styletemp).abl));
+ rd_u08(pctx, 14, &((pctx->styletemp).abw));
+ correct_arrowwidth(&((pctx->styletemp).abw));
+ pctx->pouc = wxdobj_add_arc(pctx->pdrw,pctx->pgrp,0,&(pctx->styletemp));
+ if (NULL != pctx->pouc) {
+ pctx->st = S_ARC;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_oarc cc=%d", pctx->cc
+}
+
+
+
+/** Read 14 or 15 style values for polygons, closed splines and closed
+ arcs.
+ @param pctx Reader context.
+ @param p 1 for polylines and splines, 0 for arc.
+*/
+static
+void
+read_elements_14_15(wxdrd_ctx_t *pctx, size_t p)
+{
+ $? "+ read_elements_14_15 p=%u", (unsigned)p
+ if (0 != p) {
+ rd_u16(pctx, 1, &(((pctx->styletemp).det).p.n));
+ }
+ rd_i16(pctx, (p + 1), &((pctx->styletemp).lay));
+ rd_u08(pctx, (p + 2), &((pctx->styletemp).sc[0]));
+ rd_u08(pctx, (p + 3), &((pctx->styletemp).sc[1]));
+ rd_u08(pctx, (p + 4), &((pctx->styletemp).sc[2]));
+ rd_u08(pctx, (p + 5), &((pctx->styletemp).fc[0]));
+ rd_u08(pctx, (p + 6), &((pctx->styletemp).fc[1]));
+ rd_u08(pctx, (p + 7), &((pctx->styletemp).fc[2]));
+ rd_u16(pctx, (p + 8), &((pctx->styletemp).lw));
+ rd_u08(pctx, (p + 9), &((pctx->styletemp).ls));
+ correct_linestyle(&((pctx->styletemp).ls));
+ rd_u08(pctx, (p + 10), &((pctx->styletemp).sl));
+ correct_stylelength(&((pctx->styletemp).sl));
+ rd_u08(pctx, (p + 11), &((pctx->styletemp).js));
+ correct_joinstyle(&((pctx->styletemp).js));
+ rd_u08(pctx, (p + 12), &((pctx->styletemp).ml));
+ correct_miterlimit(&((pctx->styletemp).ml));
+ rd_u08(pctx, (p + 13), &((pctx->styletemp).fs));
+ correct_fillstyle(&((pctx->styletemp).fs));
+ $? "- read_elements_14_15 cc=%d", pctx->cc
+}
+
+
+
+/** Process polygon begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_polygon(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_polygon"
+ if (15 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_POLYGON);
+ read_elements_14_15(pctx, 1);
+ if (1 < (pctx->styletemp).det.p.n) {
+ pctx->pouc = wxdobj_add_polyline(
+ pctx->pdrw, pctx->pgrp, (pctx->styletemp).det.p.n, 1,
+ &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_POLY_POINT;
+ pctx->cpi = 0U;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! too few points"
+ wxd_read_error(pctx, WXDRD_E_TOO_FEW_POINTS, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_polygon cc=%d", pctx->cc
+}
+
+
+
+/** Process closed spline begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_cspline(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_cspline"
+ if (15 == pctx->uparts) {
+ /*
+ We initialize as polygon here as read_elements_14_15() writes
+ the number of points to det.p.n.
+ As the details of polygon and closed spline only contain
+ point number and buffer address, this is no problem. All style
+ values are initialized and transferred same way.
+ */
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_POLYGON);
+ read_elements_14_15(pctx, 1);
+ if (1 < (pctx->styletemp).det.p.n) {
+ pctx->pouc = wxdobj_add_spline(
+ pctx->pdrw, pctx->pgrp, (pctx->styletemp).det.p.n, 1,
+ &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_SPLINE_POINT;
+ pctx->cpi = 0U;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! too few points"
+ wxd_read_error(pctx, WXDRD_E_TOO_FEW_POINTS, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_cspline cc=%d", pctx->cc
+}
+
+
+
+/** Process closed arc begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_carc(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_carc"
+ if (14 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_C_ARC);
+ read_elements_14_15(pctx, 0);
+ pctx->pouc = wxdobj_add_arc(
+ pctx->pdrw, pctx->pgrp, 1, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_ARC;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_carc cc=%d", pctx->cc
+}
+
+
+
+/** Read 12 style values for circles, ellipses and boxes.
+ @param pctx Reader context.
+*/
+static
+void
+read_elements_12(wxdrd_ctx_t *pctx)
+{
+ $? "+ read_elements_12"
+ rd_i16(pctx, 1, &((pctx->styletemp).lay));
+ rd_u08(pctx, 2, &((pctx->styletemp).sc[0]));
+ rd_u08(pctx, 3, &((pctx->styletemp).sc[1]));
+ rd_u08(pctx, 4, &((pctx->styletemp).sc[2]));
+ rd_u08(pctx, 5, &((pctx->styletemp).fc[0]));
+ rd_u08(pctx, 6, &((pctx->styletemp).fc[1]));
+ rd_u08(pctx, 7, &((pctx->styletemp).fc[2]));
+ rd_u16(pctx, 8, &((pctx->styletemp).lw));
+ rd_u08(pctx, 9, &((pctx->styletemp).ls));
+ correct_linestyle(&((pctx->styletemp).ls));
+ rd_u08(pctx, 10, &((pctx->styletemp).sl));
+ correct_stylelength(&((pctx->styletemp).sl));
+ rd_u08(pctx, 11, &((pctx->styletemp).fs));
+ correct_fillstyle(&((pctx->styletemp).fs));
+ $? "- read_elements_12 cc=%d", pctx->cc
+}
+
+
+
+/** Process circle begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_circle(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_circle"
+ if (12 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_CIRCLE);
+ read_elements_12(pctx);
+ pctx->pouc = wxdobj_add_circle(
+ pctx->pdrw, pctx->pgrp, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_CIRCLE;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_circle cc=%d", pctx->cc
+}
+
+
+
+/** Process ellipse begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_ellipse(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_ellipse"
+ if (12 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_ELLIPSE);
+ read_elements_12(pctx);
+ pctx->pouc = wxdobj_add_ellipse(
+ pctx->pdrw, pctx->pgrp, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_ELLIPSE;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_ellipse cc=%d", pctx->cc
+}
+
+
+
+/** Process box begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_box(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_box"
+ if (12 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_BOX);
+ read_elements_12(pctx);
+ pctx->pouc = wxdobj_add_box(
+ pctx->pdrw, pctx->pgrp, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ pctx->st = S_BOX;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! number of text parts"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_box cc=%d", pctx->cc
+}
+
+
+
+/** Process image begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_image(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_image"
+ if (5 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_IMAGE);
+ read_elements_05(pctx);
+ pctx->st = S_IMAGE_DETAILS;
+ }
+ else { $? "! number of text parts"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_image cc=%d", pctx->cc
+}
+
+
+
+/** Process filled dot begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_dot_filled(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_dot_filled"
+ if (5 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_DOT_FILLED);
+ read_elements_05(pctx);
+ pctx->pouc = wxdobj_add_dot(pctx->pdrw,pctx->pgrp,0,&(pctx->styletemp));
+ if (NULL != pctx->pouc) {
+ pctx->st = S_DOT_FILLED;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! number of text parts"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_dot_filled cc=%d", pctx->cc
+}
+
+
+
+/** Process white dot begin line.
+ @param pctx Reader context.
+*/
+static
+void
+process_osl_dot_white(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_osl_dot_white"
+ if (5 == pctx->uparts) {
+ wxdobj_obj_init(&(pctx->styletemp), WXD_OT_DOT_WHITE);
+ read_elements_05(pctx);
+ pctx->pouc = wxdobj_add_dot(pctx->pdrw,pctx->pgrp,1,&(pctx->styletemp));
+ if (NULL != pctx->pouc) {
+ pctx->st = S_DOT_WHITE;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_osl_dot_white cc=%d", pctx->cc
+}
+
+
+
+
+
+
+/** Process object start line.
+ @param pctx Reader context.
+ @param il Input line to process.
+*/
+static
+void
+process_line_objstart(wxdrd_ctx_t *pctx, char *il)
+{
+ int8_t ot;
+ $? "+ process_line_objstart"
+ for (size_t i = 0; i < pctx->nparts; i++) { (pctx->parts)[i] = NULL; }
+ pctx->uparts = dk4str8_tokenize(pctx->parts, pctx->nparts, il, NULL, NULL);
+ if (0 < pctx->uparts) {
+ ot = 0;
+ rd_i08(pctx, 0, &ot);
+ if (1 == pctx->cc) {
+ switch ( (int)ot ) {
+ case WXD_OT_CONFIG : { $? ". config"
+ process_osl_config(pctx);
+ } break;
+ case WXD_OT_GROUP_BEGIN : { $? ". group begin"
+ process_osl_group_begin(pctx);
+ } break;
+ case WXD_OT_GROUP_END : { $? ". group end"
+ process_osl_group_end(pctx);
+ } break;
+ case WXD_OT_TEXT : { $? ". text label"
+ process_osl_textlabel(pctx);
+ } break;
+ case WXD_OT_POLYLINE : { $? ". polyline"
+ process_osl_polyline(pctx);
+ } break;
+ case WXD_OT_O_SPLINE : { $? ". open spline"
+ process_osl_ospline(pctx);
+ } break;
+ case WXD_OT_O_ARC : { $? ". open arc"
+ process_osl_oarc(pctx);
+ } break;
+ case WXD_OT_POLYGON : { $? ". polygon"
+ process_osl_polygon(pctx);
+ } break;
+ case WXD_OT_C_SPLINE : { $? ". closed spline"
+ process_osl_cspline(pctx);
+ } break;
+ case WXD_OT_C_ARC : { $? ". closed arc"
+ process_osl_carc(pctx);
+ } break;
+ case WXD_OT_CIRCLE : { $? ". circle"
+ process_osl_circle(pctx);
+ } break;
+ case WXD_OT_ELLIPSE : { $? ". ellipse"
+ process_osl_ellipse(pctx);
+ } break;
+ case WXD_OT_BOX : { $? ". box"
+ process_osl_box(pctx);
+ } break;
+ case WXD_OT_IMAGE : { $? ". image"
+ process_osl_image(pctx);
+ } break;
+ case WXD_OT_DOT_FILLED : { $? ". colour filled dot"
+ process_osl_dot_filled(pctx);
+ } break;
+ case WXD_OT_DOT_WHITE : { $? ". white filled dot"
+ process_osl_dot_white(pctx);
+ } break;
+ default : { $? "! illegal object type %d", (int)ot
+ wxd_read_error(pctx, WXDRD_E_OBJTYPE, 0);
+ } break;
+ }
+ }
+ }
+ else { $? ". skip empty line"
+ /* Skip empty line */
+ }
+ $? "- process_line_objstart"
+}
+
+
+
+/** Correct font index.
+ @param pfi Address of font index variable to correct.
+*/
+static
+void
+correct_fontindex(uint8_t *pfi)
+{
+ if ((uint8_t)34U < *pfi) {
+ *pfi = (uint8_t)34U;
+ }
+}
+
+
+
+/** Correct font size.
+ @param pfs Address of font size variable to correct.
+*/
+static
+void
+correct_fontsize(uint16_t *pfs)
+{
+ if ((uint16_t)1U > *pfs) {
+ *pfs = (uint16_t)1U;
+ }
+}
+
+
+
+/** Correct text align.
+ @param pta Address of text align variable to correct.
+*/
+static
+void
+correct_textalign(uint8_t *pta)
+{
+ if ((uint8_t)(WXD_TA_RIGHT) < *pta) {
+ *pta = (uint8_t)(WXD_TA_RIGHT);
+ }
+}
+
+
+/** Process details line 1 for text (coordinates).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_text1(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_det_text1"
+ if (7 == pctx->uparts) {
+ rd_u08(pctx, 0, &((pctx->styletemp).det.t.find));
+ correct_fontindex(&((pctx->styletemp).det.t.find));
+ rd_u16(pctx, 1, &((pctx->styletemp).det.t.fsz));
+ correct_fontsize(&((pctx->styletemp).det.t.fsz));
+ rd_u08(pctx, 2, &((pctx->styletemp).det.t.al));
+ correct_textalign(&((pctx->styletemp).det.t.al));
+ rd_u08(pctx, 3, &((pctx->styletemp).det.t.fl));
+ rd_i32(pctx, 4, &((pctx->styletemp).det.t.x));
+ rd_i32(pctx, 5, &((pctx->styletemp).det.t.y));
+ rd_i16(pctx, 6, &((pctx->styletemp).det.t.a));
+ pctx->st = S_TEXT_EXPORT;
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_det_text1 cc=%d", pctx->cc
+}
+
+
+
+/** Process details line 2 for text (export text).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_text2(wxdrd_ctx_t *pctx, const char *il)
+{
+ wxChar wxb[1024];
+ size_t const szwxb = DK4_SIZEOF(wxb,wxChar);
+ $? "+ process_det_text2"
+ if (0 != dk4recwx_utf8_to_wxchar(wxb, szwxb, &(il[1]), NULL)) {
+ pctx->pouc = wxdobj_add_textlabel(
+ pctx->pdrw, pctx->pgrp, wxb, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ ((pctx->pouc)->det).t.find = (pctx->styletemp).det.t.find;
+ ((pctx->pouc)->det).t.fsz = (pctx->styletemp).det.t.fsz;
+ ((pctx->pouc)->det).t.al = (pctx->styletemp).det.t.al;
+ ((pctx->pouc)->det).t.fl = (pctx->styletemp).det.t.fl;
+ ((pctx->pouc)->det).t.x = (pctx->styletemp).det.t.x;
+ ((pctx->pouc)->det).t.y = (pctx->styletemp).det.t.y;
+ ((pctx->pouc)->det).t.a = (pctx->styletemp).det.t.a;
+ ((pctx->pouc)->det).t.font = NULL;
+ pctx->st = S_TEXT_SCREEN;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! recode failed"
+ wxd_read_error(pctx, WXDRD_E_RECODE_TEXT, 0);
+ }
+ $? "- process_det_text2 cc=%d", pctx->cc
+}
+
+
+
+/** Process details line 3 for text (screen text).
+ @param pctx Reader context.
+ @param il Input line.
+*/
+static
+void
+process_det_text3(wxdrd_ctx_t *pctx, const char *il)
+{
+ wxChar wxb[1024];
+ size_t const szwxb = DK4_SIZEOF(wxb,wxChar);
+ $? "+ process_det_text3"
+ if ('\0' != il[1]) {
+ if (0 != dk4recwx_utf8_to_wxchar(wxb, szwxb, &(il[1]), NULL)) {
+ if (NULL != pctx->pouc) {
+ ((pctx->pouc)->det).t.tsc = dk4strx_dup(wxb, NULL);
+ if (NULL == ((pctx->pouc)->det).t.tsc) { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ else { $? "! recode failed"
+ wxd_read_error(pctx, WXDRD_E_RECODE_TEXT, 0);
+ }
+ }
+ else {
+ if (NULL != pctx->pouc) {
+ ((pctx->pouc)->det).t.tsc = NULL;
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ pctx->st = S_OBJ_START;
+ $? "- process_det_text3 cc=%d", pctx->cc
+}
+
+
+
+/** Process details line for polyline (point coordinates).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_poly(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_det_poly"
+ if (NULL != pctx->pouc) {
+ if (2 == pctx->uparts) {
+ rd_i32(pctx, 0, &((((pctx->pouc)->det).p.p)[pctx->cpi].x));
+ rd_i32(pctx, 1, &((((pctx->pouc)->det).p.p)[pctx->cpi].y));
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ pctx->cpi += 1U;
+ if (pctx->cpi >= ((pctx->pouc)->det).p.n) {
+ pctx->st = S_OBJ_START; $? ". finished"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ $? "- process_det_poly cc=%d", pctx->cc
+}
+
+
+
+/** Correct X-spline s coefficient of control point.
+ @param ps Address of s value variable to correct.
+*/
+static
+void
+correct_svalue(double *ps)
+{
+ if (-1.0 > *ps) {
+ *ps = -1.0;
+ }
+ else {
+ if (1.0 < *ps) {
+ *ps = 1.0;
+ }
+ }
+}
+
+
+/** Process details line for spline (control point coordinates and s value).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_spline(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_det_spline"
+ if (NULL != pctx->pouc) {
+ if (3 == pctx->uparts) {
+ rd_i32(pctx, 0, &((((pctx->pouc)->det).s.p)[pctx->cpi].x));
+ rd_i32(pctx, 1, &((((pctx->pouc)->det).s.p)[pctx->cpi].y));
+ rd_dbl(pctx, 2, &((((pctx->pouc)->det).s.p)[pctx->cpi].s));
+ correct_svalue(&((((pctx->pouc)->det).s.p)[pctx->cpi].s));
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ pctx->cpi += 1U;
+ if (pctx->cpi >= ((pctx->pouc)->det).s.n) {
+ pctx->st = S_OBJ_START; $? ". finished"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ $? "- process_det_spline cc=%d", pctx->cc
+}
+
+
+
+/** Process details line for arc.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_arc(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_det_arc"
+ if (NULL != pctx->pouc) {
+ if (6 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).a.x1));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).a.y1));
+ rd_i32(pctx, 2, &(((pctx->pouc)->det).a.x2));
+ rd_i32(pctx, 3, &(((pctx->pouc)->det).a.y2));
+ rd_i32(pctx, 4, &(((pctx->pouc)->det).a.x3));
+ rd_i32(pctx, 5, &(((pctx->pouc)->det).a.y3));
+ wxdarc_calculation(
+ &(((pctx->pouc)->det).a.x), &(((pctx->pouc)->det).a.y),
+ &(((pctx->pouc)->det).a.r), &(((pctx->pouc)->det).a.a),
+ &(((pctx->pouc)->det).a.b), &(((pctx->pouc)->det).a.d),
+ ((pctx->pouc)->det).a.x1, ((pctx->pouc)->det).a.y1,
+ ((pctx->pouc)->det).a.x2, ((pctx->pouc)->det).a.y2,
+ ((pctx->pouc)->det).a.x3, ((pctx->pouc)->det).a.y3
+ );
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+ $? "- process_det_arc cc=%d", pctx->cc
+}
+
+
+
+/** Correct a radius.
+ @param pr Address of radius variable to correct.
+ @param pctx Reader context.
+*/
+static
+void
+correct_radius(uint32_t *pr, wxdrd_ctx_t *pctx)
+{
+ if ((uint32_t)1UL > *pr) {
+ *pr = (uint32_t)15875UL;
+ (pctx->pstat)->mod = 1; $? ". mod=1"
+ }
+}
+
+
+
+/** Correct dot diameter.
+ @param pd Address of dot diameter variable to correct.
+ @param pctx Reader context.
+*/
+static
+void
+correct_dotdiameter(uint16_t *pd, wxdrd_ctx_t *pctx)
+{
+ if ((uint16_t)1U > *pd) {
+ *pd = (uint16_t)1U;
+ (pctx->pstat)->mod = 1; $? ". mod=1"
+ }
+}
+
+
+
+static
+void
+correct_bounding_box(Wxd_bb_t *pbb, wxdrd_ctx_t *pctx)
+{
+ if (pbb->xl >= pbb->xr) {
+ (pctx->pstat)->mod = 1; $? ". mod=1"
+ if ((DK4_I32_MAX - (int32_t)15875L) >= pbb->xl) {
+ pbb->xr = pbb->xl + (int32_t)15875L;
+ }
+ else {
+ pbb->xl = pbb->xr - (int32_t)15875L;
+ }
+ }
+ if (pbb->yb >= pbb->yt) {
+ (pctx->pstat)->mod = 1; $? ". mod=1"
+ if ((DK4_I32_MAX - (int32_t)15875L) >= pbb->yb) {
+ pbb->yt = pbb->yb + (int32_t)15875L;
+ }
+ else {
+ pbb->yb = pbb->yt - (int32_t)15875L;
+ }
+ }
+}
+
+
+
+/** Process details line for circle.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_circle(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_det_circle"
+ if (NULL != pctx->pouc) {
+ if (3 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).e.x));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).e.y));
+ rd_u32(pctx, 2, &(((pctx->pouc)->det).e.rx));
+ correct_radius(&(((pctx->pouc)->det).e.rx), pctx);
+ ((pctx->pouc)->det).e.ry = ((pctx->pouc)->det).e.rx;
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+ $? "- process_det_circle cc=%d", pctx->cc
+}
+
+
+
+/** Process details line for colour filled dot.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_dot_filled(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_det_dot_filled"
+ if (NULL != pctx->pouc) {
+ if (3 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).d.x));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).d.y));
+ rd_u16(pctx, 2, &(((pctx->pouc)->det).d.d));
+ correct_dotdiameter(&(((pctx->pouc)->det).d.d), pctx);
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+ $? "- process_det_dot_filled cc=%d", pctx->cc
+}
+
+
+
+/** Process details line for white filled dot.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_dot_white(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_det_dot_white"
+ if (NULL != pctx->pouc) {
+ if (4 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).d.x));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).d.y));
+ rd_u16(pctx, 2, &(((pctx->pouc)->det).d.d));
+ correct_dotdiameter(&(((pctx->pouc)->det).d.d), pctx);
+ rd_u16(pctx, 3, &((pctx->pouc)->lw));
+ correct_dotdiameter(&((pctx->pouc)->lw), pctx);
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+ $? "- process_det_dot_white cc=%d", pctx->cc
+}
+
+
+
+/** Process details line for ellipse.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_ellipse(wxdrd_ctx_t *pctx)
+{
+ $? "+ process_det_ellipse"
+ if (NULL != pctx->pouc) {
+ if (5 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).e.x));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).e.y));
+ rd_u32(pctx, 2, &(((pctx->pouc)->det).e.rx));
+ correct_radius(&(((pctx->pouc)->det).e.rx), pctx);
+ rd_u32(pctx, 3, &(((pctx->pouc)->det).e.ry));
+ correct_radius(&(((pctx->pouc)->det).e.ry), pctx);
+ rd_i16(pctx, 4, &(((pctx->pouc)->det).e.a));
+ }
+ else { $? "! number of text parts"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+ $? "- process_det_ellipse cc=%d", pctx->cc
+}
+
+
+
+/** Process details line for box.
+ @param pctx Reader context.
+*/
+static
+void
+process_det_box(wxdrd_ctx_t *pctx)
+{
+ uint32_t w;
+ uint32_t h;
+ $? "+ process_det_box"
+ if (NULL != pctx->pouc) {
+ if (5 == pctx->uparts) {
+ rd_i32(pctx, 0, &(((pctx->pouc)->det).b.b.xl));
+ rd_i32(pctx, 1, &(((pctx->pouc)->det).b.b.xr));
+ rd_i32(pctx, 2, &(((pctx->pouc)->det).b.b.yb));
+ rd_i32(pctx, 3, &(((pctx->pouc)->det).b.b.yt));
+ rd_u32(pctx, 4, &(((pctx->pouc)->det).b.r));
+ wxdobj_bb_correct(&(((pctx->pouc)->det).b.b));
+ if (wxdobj_bb_is_null_area(&(((pctx->pouc)->det).b.b))) {
+ $? "! null area"
+#if 0
+ wxd_read_error(pctx, WXDRD_E_BOX_NO_AREA, 0);
+#endif
+ correct_bounding_box(&(((pctx->pouc)->det).b.b), pctx);
+ }
+ w = (uint32_t)(((pctx->pouc)->det).b.b.xr
+ - ((pctx->pouc)->det).b.b.xl);
+ h = (uint32_t)(((pctx->pouc)->det).b.b.yt
+ - ((pctx->pouc)->det).b.b.yb);
+ if (h < w) { w = h; }
+ w = w / (uint32_t)2UL;
+ if (((pctx->pouc)->det).b.r > w) {
+ ((pctx->pouc)->det).b.r = w;
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ pctx->st = S_OBJ_START;
+ $? "- process_det_box cc=%d", pctx->cc
+}
+
+
+
+static
+int32_t
+add_signed_unsigned_32(wxdrd_ctx_t *pctx, int32_t s, uint32_t u, size_t te)
+{
+ dk4_er_t er;
+ uint32_t sum;
+ uint32_t x;
+ int32_t back = (int32_t)0L;
+ $? "+ add_signed_unsigned_32 s=%ld u=%lu", (long)s, (unsigned long)u
+ dk4error_init(&er);
+ if (0 <= s) { $? ". both positive"
+ sum = dk4ma_uint32_t_add((uint32_t)s, u, &er);
+ if (DK4_E_NONE == er.ec) {
+ if ((uint32_t)(DK4_I32_MAX) >= sum) {
+ back = (int32_t)sum;
+ }
+ else { $? "! result does not fit into int32_t"
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, te);
+ }
+ }
+ else { $? "! overflow"
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, te);
+ }
+ }
+ else { $? ". negative and positive"
+ x = (uint32_t)dk4ma_int32_t_abs(s, &er);
+ if (DK4_E_NONE != er.ec) { $? ". s is minimum"
+ x = (uint32_t)(DK4_I32_MAX);
+ x += (uint32_t)1U;
+ }
+ dk4error_init(&er);
+ sum = dk4ma_uint32_t_sub(u, x, &er);
+ if (DK4_E_NONE == er.ec) {
+ if ((uint32_t)(DK4_I32_MAX) >= sum) {
+ back = (int32_t)sum;
+ }
+ else { $? "! result does not fit into int32_t"
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, te);
+ }
+ }
+ else { $? "! overflow"
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, te);
+ }
+ } $? "- add_signed_unsigned_32 %ld (error=%d)", (long)back, er.ec
+ return back;
+}
+
+
+
+/** Process details line 1 for image (coordinates and flags).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_image1(wxdrd_ctx_t *pctx)
+{
+ uint32_t w;
+ uint32_t h;
+ $? "+ process_det_image1"
+ if (7 == pctx->uparts) {
+ rd_u16(pctx, 0, &((pctx->styletemp).det.i.fl));
+ rd_i08(pctx, 1, &((pctx->styletemp).det.i.r2g));
+ rd_i08(pctx, 2, &((pctx->styletemp).det.i.r2c));
+ rd_i32(pctx, 3, &((pctx->styletemp).det.i.br.xl));
+ rd_i32(pctx, 4, &((pctx->styletemp).det.i.br.yb));
+ rd_u32(pctx, 5, &w);
+ rd_u32(pctx, 6, &h);
+ (pctx->styletemp).det.i.br.xr = add_signed_unsigned_32(
+ pctx, (pctx->styletemp).det.i.br.xl, w, 5
+ );
+ (pctx->styletemp).det.i.br.yt = add_signed_unsigned_32(
+ pctx, (pctx->styletemp).det.i.br.yb, h, 6
+ );
+ pctx->st = S_IMAGE_FILENAME;
+ if (
+ ((pctx->styletemp).det.i.br.xr == (pctx->styletemp).det.i.br.xl)
+ || ((pctx->styletemp).det.i.br.yt == (pctx->styletemp).det.i.br.yb)
+ ) {
+ wxd_read_error(pctx, WXDRD_E_COORD_OVERFLOW, 0);
+ }
+ }
+ else { $? "! number of text words"
+ wxd_read_error(pctx, WXDRD_E_TEXT_PARTS, 0);
+ }
+ $? "- process_det_image1 cc=%d", pctx->cc
+}
+
+
+
+/** Process details line 2 for image (file name).
+ @param pctx Reader context.
+*/
+static
+void
+process_det_image2(wxdrd_ctx_t *pctx, const char *il)
+{
+ wxChar fnb[DK4_MAX_PATH];
+ wxChar wxb[1024];
+ size_t const szwxb = DK4_SIZEOF(wxb,wxChar);
+ size_t const szfnb = DK4_SIZEOF(fnb,wxChar);
+ int ok = 0;
+ $? "+ process_det_image2"
+
+ if ('\0' != il[1]) {
+ if (0 != dk4recwx_utf8_to_wxchar(wxb, szwxb, &(il[1]), NULL)) {
+ if (
+ (0 == dk4strx_path_is_absolute(wxb))
+ && (NULL != pctx->pstat->dirn)
+ ) {
+ if (0 != dk4strx_cpy_s(fnb, szfnb, (pctx->pstat->dirn), NULL)) {
+ if (0 != dk4strx_path_append(fnb, szfnb, wxb, NULL)) {
+ ok = 1;
+#if TRACE_DEBUG
+#if DK4_SIZEOF_WXCHAR > 1
+ $? ". \"%!ws\"", fnb
+#else
+ $? ". \"%s\"", fnb
+#endif
+#endif
+ }
+ else { $? "! file name too long"
+ /* ERROR: File name too long */
+ wxd_read_error(pctx, WXDRD_E_FILENAME_TOO_LONG, 0);
+ }
+ }
+ else { $? "! directory name too long"
+ /* ERROR: Directory name too long */
+ wxd_read_error(pctx, WXDRD_E_FILENAME_TOO_LONG, 0);
+ }
+ }
+ else {
+ if (0 != dk4strx_cpy_s(fnb, szfnb, wxb, NULL)) {
+ ok = 1;
+#if TRACE_DEBUG
+#if DK4_SIZEOF_WXCHAR > 1
+ $? ". \"%!ws\"", fnb
+#else
+ $? ". \"%s\"", fnb
+#endif
+#endif
+ }
+ else { $? "! name too long"
+ /* ERROR: Name too long */
+ wxd_read_error(pctx, WXDRD_E_FILENAME_TOO_LONG, 0);
+ }
+ }
+ if (0 != ok) {
+ pctx->pouc = wxdobj_add_image(
+ pctx->pdrw, pctx->pgrp, fnb, &(pctx->styletemp)
+ );
+ if (NULL != pctx->pouc) {
+ ((pctx->pouc)->det).i.fl = (pctx->styletemp).det.i.fl;
+ ((pctx->pouc)->det).i.r2g = (pctx->styletemp).det.i.r2g;
+ ((pctx->pouc)->det).i.r2c = (pctx->styletemp).det.i.r2c;
+ ((pctx->pouc)->det).i.br.xl = (pctx->styletemp).det.i.br.xl;
+ ((pctx->pouc)->det).i.br.yb = (pctx->styletemp).det.i.br.yb;
+ ((pctx->pouc)->det).i.br.xr = (pctx->styletemp).det.i.br.xr;
+ ((pctx->pouc)->det).i.br.yt = (pctx->styletemp).det.i.br.yt;
+ if (0 == wxdobj_find_layer_structure(pctx->pdrw, pctx->pouc)
+ ) {
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0); $? "! memory"
+ }
+ }
+ else { $? "! memory"
+ wxd_read_error(pctx, WXDRD_E_MEMORY, 0);
+ }
+ }
+ }
+ else { $? "! recode file name"
+ wxd_read_error(pctx, WXDRD_E_RECODE_FILENAME, 0);
+ }
+ }
+ else { $? "! empty file name"
+ wxd_read_error(pctx, WXDRD_E_EMPTY_FILENAME, 0);
+ }
+ pctx->st = S_OBJ_START;
+ $? "- process_det_image2 cc=%d", pctx->cc
+}
+
+
+
+
+/** Process details line.
+ @param pctx Reader context.
+ @param il Input line to process.
+*/
+static
+void
+process_line_details(wxdrd_ctx_t *pctx, char *il)
+{
+ $? "+ process_line_details"
+ for (size_t i = 0; i < pctx->nparts; i++) { (pctx->parts)[i] = NULL; }
+ if (0 != must_split_line(pctx)) { $? ". split"
+ pctx->uparts = dk4str8_tokenize(pctx->parts,pctx->nparts,il,NULL,NULL);
+ $? ". uparts=%u", (unsigned)(pctx->uparts)
+ }
+ else { $? ". do not split"
+ pctx->uparts = 0;
+ }
+ switch (pctx->st) {
+ case S_TEXT_DETAILS : {
+ process_det_text1(pctx);
+ } break;
+ case S_TEXT_EXPORT : {
+ process_det_text2(pctx, il);
+ } break;
+ case S_TEXT_SCREEN : {
+ process_det_text3(pctx, il);
+ } break;
+ case S_POLY_POINT : {
+ process_det_poly(pctx);
+ } break;
+ case S_SPLINE_POINT : {
+ process_det_spline(pctx);
+ } break;
+ case S_ARC : {
+ process_det_arc(pctx);
+ } break;
+ case S_CIRCLE : {
+ process_det_circle(pctx);
+ } break;
+ case S_DOT_FILLED : {
+ process_det_dot_filled(pctx);
+ } break;
+ case S_DOT_WHITE : {
+ process_det_dot_white(pctx);
+ } break;
+ case S_ELLIPSE : {
+ process_det_ellipse(pctx);
+ } break;
+ case S_BOX : {
+ process_det_box(pctx);
+ } break;
+ case S_IMAGE_DETAILS : {
+ process_det_image1(pctx);
+ } break;
+ case S_IMAGE_FILENAME : {
+ process_det_image2(pctx, il);
+ } break;
+ default : { $? "! reader state"
+ wxd_read_error(pctx, WXDRD_E_READER_STATE, 0);
+ } break;
+ } $? "- process_line_details cc=%d", pctx->cc
+}
+
+
+
+static
+void
+apply_input_line(wxdrd_ctx_t *pctx, char *il)
+{
+ $? "+ apply_input_line"
+ if (1UL == pctx->lineno) {
+ apply_first_line(pctx, il);
+ }
+ else {
+ if (0 == line_starts_with_space(il)) {
+ if (S_OBJ_START == pctx->st) {
+ pctx->pouc = NULL;
+ pctx->uparts = 0;
+ process_line_objstart(pctx, il);
+ }
+ else { $? "! details expected"
+ /* Details line expected */
+ wxd_read_error(pctx, WXDRD_E_EXPECTED_DETAILS, 0);
+ }
+ }
+ else {
+ if (S_OBJ_START != pctx->st) {
+ process_line_details(pctx, il);
+ }
+ else { $? "! obj start expected"
+ /* Object start line expected */
+ wxd_read_error(pctx, WXDRD_E_EXPECTED_OBJSTART, 0);
+ }
+ }
+ } $? "- apply_input_line cc=%d", pctx->cc
+}
+
+
+
+/** Apply input file contents to current drawing.
+ @param pctx Context, prepared to read drawing or symbol.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+apply_input_file(wxdrd_ctx_t *pctx)
+{
+ char ib[1024]; /* Input buffer */
+ char *parts[32];
+ int back;
+ $? "+ apply_input_file"
+ back = 1;
+ pctx->back = &back;
+ pctx->parts = parts;
+ pctx->nparts = 32;
+ pctx->uparts = 0;
+ pctx->cc = 1;
+ while (1 == pctx->cc) {
+ if (NULL != fgets(ib, sizeof(ib), pctx->fin)) {
+ if (ULONG_MAX > pctx->lineno) { pctx->lineno += 1UL; }
+ if ('\0' != ib[0]) { dk4str8_delnl(&(ib[1])); }
+ $? ". st %d", pctx->st
+ $? ". line \"%s\"", ib
+ apply_input_line(pctx, ib);
+ }
+ else {
+ /* No more lines available
+ */
+ pctx->cc = 0; $? ". end of input"
+ }
+ }
+ if ((1 == back) && (S_OBJ_START != pctx->st)) { $? "! reader state"
+ wxd_read_error(pctx, WXDRD_E_READER_STATE, 0);
+ }
+ $? "- apply_input_file %d", back
+ return back;
+}
+
+
+
+Wxd_drawing_t *
+wxdrd_read_file(FILE *fin, wxdrd_status_t *pstat)
+{
+ wxdrd_ctx_t ctx;
+ Wxd_drawing_t *back = NULL;
+ $? "+ wxdrd_read_file"
+ if ((NULL != fin) && (NULL != pstat)) {
+ back = wxdobj_drw_new();
+ if (NULL != back) {
+ ctx_init(&ctx);
+ ctx.pdrw = back;
+ ctx.fin = fin;
+ ctx.pstat = pstat;
+ ctx.lineno = 0UL;
+ ctx.issym = 0;
+ if (0 != apply_input_file(&ctx)) {
+ back->cx = (back->bb).xl / (int32_t)2L
+ + (back->bb).xr / (int32_t)2L;
+ back->cy = (back->bb).yb / (int32_t)2L
+ + (back->bb).yt / (int32_t)2L;
+ }
+ else {
+ wxdobj_drw_delete(back);
+ back = NULL;
+ }
+ }
+ else { $? "! memory"
+ pstat->ec = WXDRD_E_MEMORY;
+ }
+ }
+ else { $? "! args"
+ if (NULL != pstat) {
+ pstat->ec = WXDRD_E_INVALID_ARGS;
+ }
+ }
+ $? "- wxdrd_read_file %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+Wxd_object_t *
+wxdrd_read_symbol(Wxd_drawing_t *pdrw, FILE *fin, wxdrd_status_t *pstat)
+{
+ wxdrd_ctx_t ctx;
+ Wxd_object_t *back = NULL;
+ $? "+ wxdrd_read_symbol"
+ if ((NULL != pdrw) && (NULL != fin) && (NULL != pstat)) {
+ (pstat->bb).xl = 0L;
+ (pstat->bb).xr = 0L;
+ (pstat->bb).yb = 0L;
+ (pstat->bb).yt = 0L;
+ ctx_init(&ctx);
+ ctx.pdrw = pdrw;
+ ctx.fin = fin;
+ ctx.pstat = pstat;
+ ctx.lineno = 0UL;
+ ctx.issym = 1;
+ ctx.pgrp = wxdobj_drw_add_group(pdrw, NULL);
+ if (NULL != ctx.pgrp) {
+ if (0 != apply_input_file(&ctx)) { $? ". success"
+ back = ctx.pgrp;
+ }
+ else { $? "! failed to apply input file"
+ wxdobj_obj_delete_from_drawing(pdrw, ctx.pgrp);
+ }
+ }
+ else { $? "! memory"
+ pstat->ec = WXDRD_E_MEMORY;
+ }
+ }
+ else { $? "! args"
+ if (NULL != pstat) {
+ pstat->ec = WXDRD_E_INVALID_ARGS;
+ }
+ }
+ $? "- wxdrd_read_symbol %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+wxdrd_status_init(wxdrd_status_t *pstat)
+{
+#if DK4_SIZEOF_WXCHAR <= 1
+ dkChar blang[32];
+ dkChar bregi[32];
+ size_t const szblang = DK4_SIZEOF(blang,dkChar);
+ size_t const szbregi = DK4_SIZEOF(bregi,dkChar);
+ int enc;
+#endif
+ $? "+ wxdrd_status_init"
+ if (NULL != pstat) {
+ pstat->dirn = NULL;
+ pstat->ln = 0UL;
+ pstat->ec = WXDRD_E_NONE;
+ pstat->te = (size_t)0U;
+#if DK4_SIZEOF_WXCHAR > 1
+#if DK4_SIZEOF_WXCHAR > 2
+ pstat->wxe = DK4_ENCODING_32;
+#else
+ pstat->wxe = DK4_ENCODING_UTF16;
+#endif
+#else
+ pstat->wxe = DK4_FILE_ENCODING_UTF8;
+ if (0 != dk4loc_get_settings(blang,szblang,bregi,szbregi,&enc,NULL)) {
+ pstat->wxe = enc;
+ }
+#endif
+ pstat->mod = 0; $? ". mod=0"
+ }
+#if TRACE_DEBUG
+ else { $? "! pstat"
+ }
+#endif
+ $? "- wxdrd_status_init"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawRead.h b/support/dktools/WxdkdrawRead.h
new file mode 100644
index 0000000000..2791fbe67b
--- /dev/null
+++ b/support/dktools/WxdkdrawRead.h
@@ -0,0 +1,67 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawRead.cpt
+*/
+
+/** @file WxdkdrawRead.h Header file for the WxdkdrawRead module.
+*/
+
+#ifndef WXDKDRAWREAD_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWREAD_H_INCLUDED 1
+
+
+#line 8 "WxdkdrawRead.cpt"
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+
+
+/* PROTOTYPES (start) */
+
+
+/** Initialize status structure to "no error occured".
+ After initializing the status structure set the wxe component
+ to the wxChar encoding obtained from the Dk4WxApplicationHelper class,
+ method GetWxEncoding().
+ @param pstat Status structure to initialize.
+*/
+void
+wxdrd_status_init(wxdrd_status_t *pstat);
+
+
+/** Read drawing from file.
+ @param fin Input file opened for text reading.
+ @param pstat Status structure, must be initialized.
+ @return Valid pointer on success, NULL on error.
+*/
+Wxd_drawing_t *
+wxdrd_read_file(FILE *fin, wxdrd_status_t *pstat);
+
+/** Read library element from file.
+ @param pdrw Drawing to insert the library element.
+ @param fin Input file opened for text reading.
+ @param pstat Status structure, must be initialized.
+ @return Pointer to new group object on success, NULL on error.
+*/
+Wxd_object_t *
+wxdrd_read_symbol(Wxd_drawing_t *pdrw, FILE *fin, wxdrd_status_t *pstat);
+
+
+/* PROTOTYPES (end) */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/WxdkdrawTypes.cpt b/support/dktools/WxdkdrawTypes.cpt
new file mode 100644
index 0000000000..d1a41613dc
--- /dev/null
+++ b/support/dktools/WxdkdrawTypes.cpt
@@ -0,0 +1,448 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file WxdkdrawTypes.h Data types for the wxd2lat program.
+
+ Here we have Wxd_... structures corresponding to the wxd_...
+ structures from the wxd2lat/wxdtypes.h file.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4BB_H_INCLUDED
+#include "dk4bb.h"
+#endif
+
+
+
+#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
+
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#if DK4_HAVE_WX_CHARTYPE_H
+#ifndef WX_CHARTYPE_H_INCLUDED
+#include <wx/chartype.h>
+#define WX_CHARTYPE_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_WX_WXCHAR_H
+#ifndef WX_WXCHAR_H_INCLUDED
+#include <wx/wxchar.h>
+#define WX_WXCHAR_H_INCLUDED 1
+#endif
+#else
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED
+#endif
+#endif
+#endif
+#endif
+
+#ifndef WX_BITMAP_H_INCLUDED
+#include <wx/bitmap.h>
+#define WX_BITMAP_H_INCLUDED 1
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#include "dk4sto.h"
+#endif
+
+
+/** Marker 1: Mouse moved over object or object selected
+ for copy/move/delete.
+ Indicated by coloured markup.
+*/
+#define OBJ_MARKER_1 ((uint8_t)1U)
+
+/** Marker 2: Object selected for grouping or style editing.
+ Indicated by black markup.
+*/
+#define OBJ_MARKER_2 ((uint8_t)2U)
+
+
+
+/** WXD font description.
+*/
+typedef struct {
+ wxFont *font; /**< Font to be used for drawing. */
+ uint16_t fsz; /**< Font size in pt. */
+ uint8_t find; /**< Font index. */
+ bool used; /**< Font is used by drawing. */
+ bool attempted; /**< Already attempted to find font. */
+} Wxd_font_t;
+
+
+
+/** Association of file name suffix and image type.
+*/
+typedef struct {
+ wxChar const *suffix; /**< File name suffix. */
+ wxBitmapType t; /**< Corresponding image type. */
+} Wxd_suffix_and_type_t;
+
+
+
+/** Polygon or polyline point.
+*/
+typedef struct {
+ int32_t x; /**< X position. */
+ int32_t y; /**< Y position. */
+} Wxd_point_t;
+
+
+
+/** X-Spline point.
+*/
+typedef struct {
+ double s; /**< S parameter. */
+ int32_t x; /**< X position. */
+ int32_t y; /**< Y position. */
+} Wxd_spline_point_t;
+
+
+
+/** Bounding box values.
+*/
+typedef struct {
+ int32_t xl; /**< Left x. */
+ int32_t xr; /**< Right x. */
+ int32_t yb; /**< Bottom y. */
+ int32_t yt; /**< Top y. */
+} Wxd_bb_t;
+
+
+
+#define WXD_TEXT_FLAG_NONE ((uint8_t)0U)
+#define WXD_TEXT_FLAG_LATEX ((uint8_t)1U)
+
+#define WXD_TEXT_ALIGN_LEFT ((uint8_t)0U)
+#define WXD_TEXT_ALIGN_CENTERED ((uint8_t)1U)
+#define WXD_TEXT_ALIGN_RIGHT ((uint8_t)2U)
+
+/** Details for a text.
+ The 4 most significant bits in al represent the vertical
+ text alignment, the 4 least significant bits represent the
+ horizontal alignment.
+*/
+typedef struct {
+ wxChar *t; /**< Text to export. */
+ wxChar *tsc; /**< Text to show on screen. */
+ Wxd_font_t *font; /**< WXD font structure. */
+ int32_t x; /**< X position. */
+ int32_t y; /**< Y position. */
+ uint16_t fsz; /**< Font size. */
+ int16_t a; /**< Rotation counterclockwise in degree. */
+ uint8_t find; /**< Font index. */
+ uint8_t al; /**< Horizontal and vertical align. */
+ uint8_t fl; /**< Text flags. */
+} Wxd_det_text_t;
+
+
+
+/** Polygon and polyline details.
+*/
+typedef struct {
+ Wxd_point_t *p; /**< Points. */
+ uint16_t n; /**< Number of points. */
+} Wxd_det_pl_t;
+
+
+
+/** X-Spline details (opened and closed).
+*/
+typedef struct {
+ Wxd_spline_point_t *p; /**< Points. */
+ uint16_t n; /**< Number of points. */
+} Wxd_det_xs_t;
+
+
+
+
+#define WXD_ARC_DIRECTION_POSITIVE ((int8_t)1)
+#define WXD_ARC_DIRECTION_NEGATIVE ((int8_t)-1)
+#define WXD_ARC_DIRECTION_UNKNOWN ((int8_t)0)
+
+/** Details for arcs (opened and closed).
+ The x1, y1, x2, y2, x3, y3 components are read from file, the
+ other values are calculated from the 3 points after reading
+ the file and after each point modification.
+*/
+typedef struct {
+ double a; /**< Start angle alpha counterclockwise in degree. */
+ double b; /**< Angle range beta counterclockwise in degree. */
+ double x; /**< X position of center point. */
+ double y; /**< Y position of center point. */
+ double r; /**< Radius. */
+ int32_t x1; /**< X position of point 1. */
+ int32_t y1; /**< Y position of point 1. */
+ int32_t x2; /**< X position of point 2. */
+ int32_t y2; /**< Y position of point 2. */
+ int32_t x3; /**< X position of point 3. */
+ int32_t y3; /**< Y position of point 3. */
+ int8_t d; /**< Direction, 1=positive, -1=negative, 0=unknown. */
+} Wxd_det_arc_t;
+
+
+/** Details for dot.
+*/
+typedef struct {
+ int32_t x; /**< X position of center point. */
+ int32_t y; /**< Y position of center point. */
+ uint16_t d; /**< Diameter in multiples of the base line width. */
+} Wxd_det_dot_t;
+
+
+/** Details for an ellipse or circle.
+ For a circle ry and a are ignored.
+*/
+typedef struct {
+ int32_t x; /**< X position of center point. */
+ int32_t y; /**< Y position of center point. */
+ uint32_t rx; /**< X radius for ellipse, radius for circle. */
+ uint32_t ry; /**< Y radius for ellipse. */
+ int16_t a; /**< Rotation counterclockwise in degree. */
+} Wxd_det_ellipse_t;
+
+
+/** Radius value to indicate corner is not rounded.
+*/
+#define WXD_BOX_CORNER_NONE ((uint32_t)0UL)
+
+/** Details for a box.
+*/
+typedef struct {
+ Wxd_bb_t b; /**< Box rectangle. */
+ uint32_t r; /**< Corner radius, 0 for no rounded corner. */
+} Wxd_det_box_t;
+
+
+
+/** Details for an embedded image.
+*/
+typedef struct {
+ wxChar *fn; /**< File name for image. */
+ wxBitmap *bm; /**< Bitmap to draw on screen. */
+ dk4_bb_t pl; /**< Calculated coordinates for placement. */
+ Wxd_bb_t br; /**< Box rectangle from file. */
+ double xres; /**< Image x resolution. */
+ double yres; /**< Image y resolution. */
+ uint16_t fl; /**< Image flags. */
+ int8_t r2g; /**< RGB to gray conversion method. */
+ int8_t r2c; /**< RGB to CMYK conversion method (unused). */
+ wxBitmapType t; /**< Bitmap type. */
+} Wxd_det_image_t;
+
+
+
+/** Details for a group of objects.
+*/
+typedef struct Wxd_det_group__t {
+ dk4_sto_t *s_e; /**< Elements storage. */
+ dk4_sto_it_t *i_e; /**< Elements iterator. */
+} Wxd_det_group_t;
+
+
+
+/** Union of different details.
+*/
+typedef union {
+ Wxd_det_text_t t; /**< Text details. */
+ Wxd_det_pl_t p; /**< Polygon and polyline details. */
+ Wxd_det_xs_t s; /**< Spline details. */
+ Wxd_det_arc_t a; /**< Arc and circle details. */
+ Wxd_det_dot_t d; /**< Details for a dot. */
+ Wxd_det_ellipse_t e; /**< Ellipse details. */
+ Wxd_det_box_t b; /**< Box details. */
+ Wxd_det_image_t i; /**< Image details. */
+ Wxd_det_group_t g; /**< Group details. */
+} Wxd_det_t;
+
+
+
+/** Stipple bitmap (fill pattern).
+*/
+typedef struct Wxd__stipple__t {
+ uint8_t cd[8]; /**< Color data. */
+ wxBitmap *bm; /**< Stipple bit map. */
+} Wxd_stipple_t;
+/*
+ The color data array cd contains the following data:
+ 0 fill style (pattern number)
+ 1 fill red
+ 2 fill green
+ 3 fill blue
+ 4 stroke red
+ 5 stroke green
+ 6 stroke blue
+ 7 Flag: Stipple is in use
+*/
+
+
+
+/** Information about a layer.
+*/
+typedef struct Wxd__layer__t {
+ int16_t lay; /**< Layer number. */
+ uint8_t active; /**< Flag: Layer is active. */
+ uint8_t used; /**< Flag: Layer is used. */
+} Wxd_layer_t;
+
+
+
+/** One drawing element.
+ The forward arrow and backward arrow components are ignored for
+ closed objects.
+*/
+typedef struct Wxd__object__t {
+ Wxd_det_t det; /**< Graphics element details. */
+ dk4_bb_t bb; /**< Object bounding box. */
+ struct Wxd__object__t *pa; /**< Parent group. */
+ Wxd_stipple_t *psti; /**< Stipple for some fill patterns. */
+ Wxd_layer_t *play; /**< Layer management information. */
+ int16_t lay; /**< Layer number. */
+ uint16_t lw; /**< Line width, multiples of base width. */
+ uint8_t fc[3]; /**< Fill color. */
+ uint8_t sc[3]; /**< Stroke and text color. */
+ uint8_t cs; /**< Cap style. */
+ uint8_t fs; /**< Fill style. */
+ uint8_t ls; /**< Line style. */
+ uint8_t sl; /**< Style length. */
+ uint8_t js; /**< Line join style. */
+ uint8_t ml; /**< Miter limit for mitered line join. */
+ uint8_t aft; /**< Arrowhead forward type. */
+ uint8_t afl; /**< Length of arrowhead forward. */
+ uint8_t afw; /**< Width of arrowhead forward. */
+ uint8_t abt; /**< Arrowhead backward type. */
+ uint8_t abl; /**< Length of arrowhead backward. */
+ uint8_t abw; /**< Width of arrowhead backward. */
+ uint8_t mark; /**< Markers or-combined. */
+ int8_t ot; /**< Object type. */
+} Wxd_object_t;
+
+
+
+/** Entire drawing.
+ The flattened container contains all objects of the drawing without
+ any group structure. Elements are sorted by layer number.
+ A second container s_stru contains the group structure.
+*/
+typedef struct {
+ dk4_sto_t *s_stru; /**< Structured container of all objects. */
+ dk4_sto_it_t *i_stru; /**< Iterator for structured container. */
+ dk4_sto_t *s_flat; /**< Flattened container of all objects. */
+ dk4_sto_it_t *i_flat; /**< Iterator for flattened container. */
+ dk4_sto_t *s_stip; /**< Stipples container. */
+ dk4_sto_it_t *i_stip; /**< Stipples iterator. */
+ dk4_sto_t *s_layers; /**< Layer management storage. */
+ dk4_sto_it_t *i_layers; /**< Layer management iterator. */
+ dk4_sto_t *s_fonts; /**< Fonts storage. */
+ dk4_sto_it_t *i_fonts; /**< Fonts storage iterator. */
+ Wxd_bb_t bb; /**< Bounding box. */
+ size_t xsubs; /**< Sub segments per X-spline segment. */
+ int32_t cx; /**< X coordinate in center of control. */
+ int32_t cy; /**< Y coordinate in center of control. */
+ uint32_t baselw; /**< Base line width in wxd units. */
+ uint32_t bleft; /**< Left border. */
+ uint32_t bright; /**< Right border. */
+ uint32_t bbottom; /**< Bottom border. */
+ uint32_t btop; /**< Top border. */
+ int redraw; /**< Required redraw level. */
+ uint16_t fv_maj; /**< Format version major number. */
+ uint16_t fv_min; /**< Format version minor number. */
+ int8_t zl; /**< Zoom level. */
+ uint8_t gridunit; /**< Grid unit (0=inch, 1=cm). */
+ uint8_t gridbase; /**< Grid base (0=powers of 2, 1=of 10). */
+} Wxd_drawing_t;
+
+
+
+/** Error codes for reader module.
+*/
+enum {
+ WXDRD_E_NONE = 0, /**< No error occured. */
+ WXDRD_E_MEMORY , /**< Not enough memory. */
+ WXDRD_E_TEXT_PARTS , /**< Expected number of texts ot found. */
+ WXDRD_E_NUM_CONV , /**< Conversion of text to number failed. */
+ WXDRD_E_RECODE_TEXT , /**< Recoding failed for text label. */
+ WXDRD_E_RECODE_FILENAME , /**< Recoding failed for file name. */
+ WXDRD_E_INVALID_ARGS , /**< Invalid function arguments. */
+ WXDRD_E_NO_VERSION , /**< File format information not found. */
+ WXDRD_E_NO_BB , /**< No bounding box information found. */
+ WXDRD_E_NO_WXD , /**< Not a WXD file. */
+ WXDRD_E_WRONG_VERSION , /**< File format too new. */
+ WXDRD_E_EXPECTED_OBJSTART , /**< Object start line expected. */
+ WXDRD_E_EXPECTED_DETAILS , /**< Details line expected. */
+ WXDRD_E_READER_STATE , /**< Wrong reader state. */
+ WXDRD_E_OBJTYPE , /**< Illegal object or subobject type. */
+ WXDRD_E_COORD_OVERFLOW , /**< Mathematical overflow in coordinates. */
+ WXDRD_E_NO_GROUP_TO_END , /**< No open group to end. */
+ WXDRD_E_TOO_FEW_POINTS , /**< Too few points. */
+ WXDRD_E_EMPTY_FILENAME , /**< Empty image file name. */
+ WXDRD_E_FILENAME_TOO_LONG , /**< Image file name too long. */
+ WXDRD_E_BOX_NO_AREA , /**< Box does not span an area. */
+};
+
+
+
+/** Reader status.
+*/
+typedef struct {
+ Wxd_bb_t bb; /**< Drawing bounding box. */
+ wxChar *dirn; /**< Directory file resides in. */
+ unsigned long ln; /**< Line number error occured in. */
+ size_t te; /**< Number of text element not convertable. */
+ int ec; /**< Error code from module. */
+ int wxe; /**< Encoding used for wxChar. */
+ int mod; /**< Flag: Modified by corrections. */
+} wxdrd_status_t;
+
+
+
+/** Errors occuring in write operations.
+*/
+enum {
+ WXDWR_E_NONE = 0, /**< No error occured. */
+ WXDWR_E_WRITE , /**< Error in write operation. */
+ WXDWR_E_STRING_TOO_LONG , /**< String is too long. */
+ WXDWR_E_RECODE_TEXT , /**< Failed to recode a text. */
+ WXDWR_E_RECODE_FILENAME , /**< Failed to recode a file name. */
+ WXDWR_E_STRING_EMPTY , /**< Empty string. */
+};
+
+
+/** Writer status.
+*/
+typedef struct {
+ int ec; /**< Error code. */
+ int wxe; /**< Encoding used for wxChar strings. */
+ wxChar *str; /**< String for which conversion failed. */
+ wxChar *dirn; /**< Directory name for output file. */
+} wxdwr_status_t;
+
+
+
+#endif
+/* if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus)) */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawTypes.h b/support/dktools/WxdkdrawTypes.h
new file mode 100644
index 0000000000..5e6db51293
--- /dev/null
+++ b/support/dktools/WxdkdrawTypes.h
@@ -0,0 +1,462 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawTypes.cpt
+*/
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWTYPES_H_INCLUDED 1
+
+
+#line 8 "WxdkdrawTypes.cpt"
+
+/** @file WxdkdrawTypes.h Data types for the wxd2lat program.
+
+ Here we have Wxd_... structures corresponding to the wxd_...
+ structures from the wxd2lat/wxdtypes.h file.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4BB_H_INCLUDED
+#include "dk4bb.h"
+#endif
+
+
+
+#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
+
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#if DK4_HAVE_WX_CHARTYPE_H
+#ifndef WX_CHARTYPE_H_INCLUDED
+#include <wx/chartype.h>
+#define WX_CHARTYPE_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_WX_WXCHAR_H
+#ifndef WX_WXCHAR_H_INCLUDED
+#include <wx/wxchar.h>
+#define WX_WXCHAR_H_INCLUDED 1
+#endif
+#else
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED
+#endif
+#endif
+#endif
+#endif
+
+#ifndef WX_BITMAP_H_INCLUDED
+#include <wx/bitmap.h>
+#define WX_BITMAP_H_INCLUDED 1
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#include "dk4sto.h"
+#endif
+
+
+/** Marker 1: Mouse moved over object or object selected
+ for copy/move/delete.
+ Indicated by coloured markup.
+*/
+#define OBJ_MARKER_1 ((uint8_t)1U)
+
+/** Marker 2: Object selected for grouping or style editing.
+ Indicated by black markup.
+*/
+#define OBJ_MARKER_2 ((uint8_t)2U)
+
+
+
+/** WXD font description.
+*/
+typedef struct {
+ wxFont *font; /**< Font to be used for drawing. */
+ uint16_t fsz; /**< Font size in pt. */
+ uint8_t find; /**< Font index. */
+ bool used; /**< Font is used by drawing. */
+ bool attempted; /**< Already attempted to find font. */
+} Wxd_font_t;
+
+
+
+/** Association of file name suffix and image type.
+*/
+typedef struct {
+ wxChar const *suffix; /**< File name suffix. */
+ wxBitmapType t; /**< Corresponding image type. */
+} Wxd_suffix_and_type_t;
+
+
+
+/** Polygon or polyline point.
+*/
+typedef struct {
+ int32_t x; /**< X position. */
+ int32_t y; /**< Y position. */
+} Wxd_point_t;
+
+
+
+/** X-Spline point.
+*/
+typedef struct {
+ double s; /**< S parameter. */
+ int32_t x; /**< X position. */
+ int32_t y; /**< Y position. */
+} Wxd_spline_point_t;
+
+
+
+/** Bounding box values.
+*/
+typedef struct {
+ int32_t xl; /**< Left x. */
+ int32_t xr; /**< Right x. */
+ int32_t yb; /**< Bottom y. */
+ int32_t yt; /**< Top y. */
+} Wxd_bb_t;
+
+
+
+#define WXD_TEXT_FLAG_NONE ((uint8_t)0U)
+#define WXD_TEXT_FLAG_LATEX ((uint8_t)1U)
+
+#define WXD_TEXT_ALIGN_LEFT ((uint8_t)0U)
+#define WXD_TEXT_ALIGN_CENTERED ((uint8_t)1U)
+#define WXD_TEXT_ALIGN_RIGHT ((uint8_t)2U)
+
+/** Details for a text.
+ The 4 most significant bits in al represent the vertical
+ text alignment, the 4 least significant bits represent the
+ horizontal alignment.
+*/
+typedef struct {
+ wxChar *t; /**< Text to export. */
+ wxChar *tsc; /**< Text to show on screen. */
+ Wxd_font_t *font; /**< WXD font structure. */
+ int32_t x; /**< X position. */
+ int32_t y; /**< Y position. */
+ uint16_t fsz; /**< Font size. */
+ int16_t a; /**< Rotation counterclockwise in degree. */
+ uint8_t find; /**< Font index. */
+ uint8_t al; /**< Horizontal and vertical align. */
+ uint8_t fl; /**< Text flags. */
+} Wxd_det_text_t;
+
+
+
+/** Polygon and polyline details.
+*/
+typedef struct {
+ Wxd_point_t *p; /**< Points. */
+ uint16_t n; /**< Number of points. */
+} Wxd_det_pl_t;
+
+
+
+/** X-Spline details (opened and closed).
+*/
+typedef struct {
+ Wxd_spline_point_t *p; /**< Points. */
+ uint16_t n; /**< Number of points. */
+} Wxd_det_xs_t;
+
+
+
+
+#define WXD_ARC_DIRECTION_POSITIVE ((int8_t)1)
+#define WXD_ARC_DIRECTION_NEGATIVE ((int8_t)-1)
+#define WXD_ARC_DIRECTION_UNKNOWN ((int8_t)0)
+
+/** Details for arcs (opened and closed).
+ The x1, y1, x2, y2, x3, y3 components are read from file, the
+ other values are calculated from the 3 points after reading
+ the file and after each point modification.
+*/
+typedef struct {
+ double a; /**< Start angle alpha counterclockwise in degree. */
+ double b; /**< Angle range beta counterclockwise in degree. */
+ double x; /**< X position of center point. */
+ double y; /**< Y position of center point. */
+ double r; /**< Radius. */
+ int32_t x1; /**< X position of point 1. */
+ int32_t y1; /**< Y position of point 1. */
+ int32_t x2; /**< X position of point 2. */
+ int32_t y2; /**< Y position of point 2. */
+ int32_t x3; /**< X position of point 3. */
+ int32_t y3; /**< Y position of point 3. */
+ int8_t d; /**< Direction, 1=positive, -1=negative, 0=unknown. */
+} Wxd_det_arc_t;
+
+
+/** Details for dot.
+*/
+typedef struct {
+ int32_t x; /**< X position of center point. */
+ int32_t y; /**< Y position of center point. */
+ uint16_t d; /**< Diameter in multiples of the base line width. */
+} Wxd_det_dot_t;
+
+
+/** Details for an ellipse or circle.
+ For a circle ry and a are ignored.
+*/
+typedef struct {
+ int32_t x; /**< X position of center point. */
+ int32_t y; /**< Y position of center point. */
+ uint32_t rx; /**< X radius for ellipse, radius for circle. */
+ uint32_t ry; /**< Y radius for ellipse. */
+ int16_t a; /**< Rotation counterclockwise in degree. */
+} Wxd_det_ellipse_t;
+
+
+/** Radius value to indicate corner is not rounded.
+*/
+#define WXD_BOX_CORNER_NONE ((uint32_t)0UL)
+
+/** Details for a box.
+*/
+typedef struct {
+ Wxd_bb_t b; /**< Box rectangle. */
+ uint32_t r; /**< Corner radius, 0 for no rounded corner. */
+} Wxd_det_box_t;
+
+
+
+/** Details for an embedded image.
+*/
+typedef struct {
+ wxChar *fn; /**< File name for image. */
+ wxBitmap *bm; /**< Bitmap to draw on screen. */
+ dk4_bb_t pl; /**< Calculated coordinates for placement. */
+ Wxd_bb_t br; /**< Box rectangle from file. */
+ double xres; /**< Image x resolution. */
+ double yres; /**< Image y resolution. */
+ uint16_t fl; /**< Image flags. */
+ int8_t r2g; /**< RGB to gray conversion method. */
+ int8_t r2c; /**< RGB to CMYK conversion method (unused). */
+ wxBitmapType t; /**< Bitmap type. */
+} Wxd_det_image_t;
+
+
+
+/** Details for a group of objects.
+*/
+typedef struct Wxd_det_group__t {
+ dk4_sto_t *s_e; /**< Elements storage. */
+ dk4_sto_it_t *i_e; /**< Elements iterator. */
+} Wxd_det_group_t;
+
+
+
+/** Union of different details.
+*/
+typedef union {
+ Wxd_det_text_t t; /**< Text details. */
+ Wxd_det_pl_t p; /**< Polygon and polyline details. */
+ Wxd_det_xs_t s; /**< Spline details. */
+ Wxd_det_arc_t a; /**< Arc and circle details. */
+ Wxd_det_dot_t d; /**< Details for a dot. */
+ Wxd_det_ellipse_t e; /**< Ellipse details. */
+ Wxd_det_box_t b; /**< Box details. */
+ Wxd_det_image_t i; /**< Image details. */
+ Wxd_det_group_t g; /**< Group details. */
+} Wxd_det_t;
+
+
+
+/** Stipple bitmap (fill pattern).
+*/
+typedef struct Wxd__stipple__t {
+ uint8_t cd[8]; /**< Color data. */
+ wxBitmap *bm; /**< Stipple bit map. */
+} Wxd_stipple_t;
+/*
+ The color data array cd contains the following data:
+ 0 fill style (pattern number)
+ 1 fill red
+ 2 fill green
+ 3 fill blue
+ 4 stroke red
+ 5 stroke green
+ 6 stroke blue
+ 7 Flag: Stipple is in use
+*/
+
+
+
+/** Information about a layer.
+*/
+typedef struct Wxd__layer__t {
+ int16_t lay; /**< Layer number. */
+ uint8_t active; /**< Flag: Layer is active. */
+ uint8_t used; /**< Flag: Layer is used. */
+} Wxd_layer_t;
+
+
+
+/** One drawing element.
+ The forward arrow and backward arrow components are ignored for
+ closed objects.
+*/
+typedef struct Wxd__object__t {
+ Wxd_det_t det; /**< Graphics element details. */
+ dk4_bb_t bb; /**< Object bounding box. */
+ struct Wxd__object__t *pa; /**< Parent group. */
+ Wxd_stipple_t *psti; /**< Stipple for some fill patterns. */
+ Wxd_layer_t *play; /**< Layer management information. */
+ int16_t lay; /**< Layer number. */
+ uint16_t lw; /**< Line width, multiples of base width. */
+ uint8_t fc[3]; /**< Fill color. */
+ uint8_t sc[3]; /**< Stroke and text color. */
+ uint8_t cs; /**< Cap style. */
+ uint8_t fs; /**< Fill style. */
+ uint8_t ls; /**< Line style. */
+ uint8_t sl; /**< Style length. */
+ uint8_t js; /**< Line join style. */
+ uint8_t ml; /**< Miter limit for mitered line join. */
+ uint8_t aft; /**< Arrowhead forward type. */
+ uint8_t afl; /**< Length of arrowhead forward. */
+ uint8_t afw; /**< Width of arrowhead forward. */
+ uint8_t abt; /**< Arrowhead backward type. */
+ uint8_t abl; /**< Length of arrowhead backward. */
+ uint8_t abw; /**< Width of arrowhead backward. */
+ uint8_t mark; /**< Markers or-combined. */
+ int8_t ot; /**< Object type. */
+} Wxd_object_t;
+
+
+
+/** Entire drawing.
+ The flattened container contains all objects of the drawing without
+ any group structure. Elements are sorted by layer number.
+ A second container s_stru contains the group structure.
+*/
+typedef struct {
+ dk4_sto_t *s_stru; /**< Structured container of all objects. */
+ dk4_sto_it_t *i_stru; /**< Iterator for structured container. */
+ dk4_sto_t *s_flat; /**< Flattened container of all objects. */
+ dk4_sto_it_t *i_flat; /**< Iterator for flattened container. */
+ dk4_sto_t *s_stip; /**< Stipples container. */
+ dk4_sto_it_t *i_stip; /**< Stipples iterator. */
+ dk4_sto_t *s_layers; /**< Layer management storage. */
+ dk4_sto_it_t *i_layers; /**< Layer management iterator. */
+ dk4_sto_t *s_fonts; /**< Fonts storage. */
+ dk4_sto_it_t *i_fonts; /**< Fonts storage iterator. */
+ Wxd_bb_t bb; /**< Bounding box. */
+ size_t xsubs; /**< Sub segments per X-spline segment. */
+ int32_t cx; /**< X coordinate in center of control. */
+ int32_t cy; /**< Y coordinate in center of control. */
+ uint32_t baselw; /**< Base line width in wxd units. */
+ uint32_t bleft; /**< Left border. */
+ uint32_t bright; /**< Right border. */
+ uint32_t bbottom; /**< Bottom border. */
+ uint32_t btop; /**< Top border. */
+ int redraw; /**< Required redraw level. */
+ uint16_t fv_maj; /**< Format version major number. */
+ uint16_t fv_min; /**< Format version minor number. */
+ int8_t zl; /**< Zoom level. */
+ uint8_t gridunit; /**< Grid unit (0=inch, 1=cm). */
+ uint8_t gridbase; /**< Grid base (0=powers of 2, 1=of 10). */
+} Wxd_drawing_t;
+
+
+
+/** Error codes for reader module.
+*/
+enum {
+ WXDRD_E_NONE = 0, /**< No error occured. */
+ WXDRD_E_MEMORY , /**< Not enough memory. */
+ WXDRD_E_TEXT_PARTS , /**< Expected number of texts ot found. */
+ WXDRD_E_NUM_CONV , /**< Conversion of text to number failed. */
+ WXDRD_E_RECODE_TEXT , /**< Recoding failed for text label. */
+ WXDRD_E_RECODE_FILENAME , /**< Recoding failed for file name. */
+ WXDRD_E_INVALID_ARGS , /**< Invalid function arguments. */
+ WXDRD_E_NO_VERSION , /**< File format information not found. */
+ WXDRD_E_NO_BB , /**< No bounding box information found. */
+ WXDRD_E_NO_WXD , /**< Not a WXD file. */
+ WXDRD_E_WRONG_VERSION , /**< File format too new. */
+ WXDRD_E_EXPECTED_OBJSTART , /**< Object start line expected. */
+ WXDRD_E_EXPECTED_DETAILS , /**< Details line expected. */
+ WXDRD_E_READER_STATE , /**< Wrong reader state. */
+ WXDRD_E_OBJTYPE , /**< Illegal object or subobject type. */
+ WXDRD_E_COORD_OVERFLOW , /**< Mathematical overflow in coordinates. */
+ WXDRD_E_NO_GROUP_TO_END , /**< No open group to end. */
+ WXDRD_E_TOO_FEW_POINTS , /**< Too few points. */
+ WXDRD_E_EMPTY_FILENAME , /**< Empty image file name. */
+ WXDRD_E_FILENAME_TOO_LONG , /**< Image file name too long. */
+ WXDRD_E_BOX_NO_AREA , /**< Box does not span an area. */
+};
+
+
+
+/** Reader status.
+*/
+typedef struct {
+ Wxd_bb_t bb; /**< Drawing bounding box. */
+ wxChar *dirn; /**< Directory file resides in. */
+ unsigned long ln; /**< Line number error occured in. */
+ size_t te; /**< Number of text element not convertable. */
+ int ec; /**< Error code from module. */
+ int wxe; /**< Encoding used for wxChar. */
+ int mod; /**< Flag: Modified by corrections. */
+} wxdrd_status_t;
+
+
+
+/** Errors occuring in write operations.
+*/
+enum {
+ WXDWR_E_NONE = 0, /**< No error occured. */
+ WXDWR_E_WRITE , /**< Error in write operation. */
+ WXDWR_E_STRING_TOO_LONG , /**< String is too long. */
+ WXDWR_E_RECODE_TEXT , /**< Failed to recode a text. */
+ WXDWR_E_RECODE_FILENAME , /**< Failed to recode a file name. */
+ WXDWR_E_STRING_EMPTY , /**< Empty string. */
+};
+
+
+/** Writer status.
+*/
+typedef struct {
+ int ec; /**< Error code. */
+ int wxe; /**< Encoding used for wxChar strings. */
+ wxChar *str; /**< String for which conversion failed. */
+ wxChar *dirn; /**< Directory name for output file. */
+} wxdwr_status_t;
+
+
+
+#endif
+/* if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus)) */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/WxdkdrawWrite.cpp b/support/dktools/WxdkdrawWrite.cpp
new file mode 100644
index 0000000000..8e2dfa35e4
--- /dev/null
+++ b/support/dktools/WxdkdrawWrite.cpp
@@ -0,0 +1,1299 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawWrite.cpt
+*/
+
+/** @file WxdkdrawWrite.cpp The WxdkdrawWrite module.
+*/
+
+
+#line 33 "WxdkdrawWrite.cpt"
+
+#include "wxdkdraw.h"
+
+
+
+
+
+#line 39 "WxdkdrawWrite.cpt"
+
+
+
+/** Contant text fragments, not localized.
+*/
+static char const * const wxdwr_c8_kw[] = {
+/* 0 */
+"\n",
+
+/* 1 */
+" ",
+
+/* 2 */
+"WXD",
+
+/* 3 */
+"0",
+
+/* 4 */
+"1",
+
+/* 5 */
+"0 2 ",
+
+/* 6 */
+"0 4 ",
+
+/* 7 */
+"0 5 1\n",
+
+/* 8 */
+"0 6 1\n",
+
+NULL
+
+
+#line 86 "WxdkdrawWrite.cpt"
+};
+
+
+
+/** Indicate error condition in a status structure.
+ The function does not overwrite existing error conditions,
+ so the status reports the first error found.
+ @param pstat Status structure to modify.
+ @param ec Error code.
+ @param s String we can not handle.
+*/
+static
+void
+wxdwr_status_set_error(wxdwr_status_t *pstat, int ec, wxChar *s)
+{
+ if (NULL != pstat) {
+ if (WXDWR_E_NONE == pstat->ec) {
+ pstat->ec = ec;
+ pstat->str = s;
+ }
+ }
+}
+
+
+
+/** Write char string to output file.
+ @param fout Output file.
+ @param str String to write.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_out_string_c8(
+ FILE *fout,
+ char const *str,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ if (EOF == fputs(str, fout)) {
+ *bptr = 0;
+ wxdwr_status_set_error(pstat, WXDWR_E_WRITE, NULL);
+ }
+}
+
+
+
+/** Write unsigned number to output file.
+ @param fout Output file.
+ @param um Unsigned value to write.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_out_unsigned(
+ FILE *fout,
+ dk4_um_t um,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char buf[16*sizeof(dk4_um_t)];
+ size_t const szbuf = DK4_SIZEOF(buf,char);
+
+ (void)dk4ma_write_c8_decimal_unsigned(buf, szbuf, um, 0, NULL);
+ wxdwr_out_string_c8(fout, buf, bptr, pstat);
+}
+
+
+
+/** Write signed integer value to output file.
+ @param fout Output file.
+ @param im Integer value to write.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_out_signed(
+ FILE *fout,
+ dk4_im_t im,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char buf[16*sizeof(dk4_um_t)];
+ size_t const szbuf = DK4_SIZEOF(buf,char);
+
+ (void)dk4ma_write_c8_decimal_signed(buf, szbuf, im, 0, NULL);
+ wxdwr_out_string_c8(fout, buf, bptr, pstat);
+}
+
+
+
+/** Write double value to output file.
+ @param fout Output file.
+ @param dbl Value to write.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_out_double(
+ FILE *fout,
+ double dbl,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char buf[32*sizeof(double)];
+ size_t const szbuf = DK4_SIZEOF(buf,char);
+
+ (void)dk4ma_write_c8_double(buf, szbuf, dbl, 0, 1, NULL);
+ wxdwr_out_string_c8(fout, buf, bptr, pstat);
+}
+
+
+
+/** Write first line for a drawing to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_first_line(
+ FILE *fout, Wxd_drawing_t *pdrw, int *bptr, wxdwr_status_t *pstat
+)
+{
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pdrw->fv_maj, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pdrw->fv_min, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write bounding box for a drawing to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_bounding_box(
+ FILE *fout,
+ Wxd_drawing_t *pdrw,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[3], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[3], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pdrw->bb).xl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pdrw->bb).xr, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pdrw->bb).yb, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pdrw->bb).yt, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write base line width for a drawing to output file if necessary.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_base_line_width(
+ FILE *fout,
+ Wxd_drawing_t *pdrw,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ if (101600UL != (unsigned long)(pdrw->baselw)) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[3], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[4], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pdrw->baselw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+}
+
+
+
+/** Write zoom level for a drawing to output file if necessary.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_zoom_level(
+ FILE *fout,
+ Wxd_drawing_t *pdrw,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ if (0 != (int)(pdrw->zl)) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[5], bptr, pstat);
+ wxdwr_out_signed(fout, pdrw->zl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+}
+
+
+
+/** Write grid unit and grid base for a drawing to output file if necessary.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_grid_unit_and_base(
+ FILE *fout,
+ Wxd_drawing_t *pdrw,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ if ((uint8_t)0U != pdrw->gridunit) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[7], bptr, pstat);
+ }
+ if ((uint8_t)0U != pdrw->gridbase) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[8], bptr, pstat);
+ }
+}
+
+
+
+/** Write 5 style attributes for a graphics object to file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_elements_05(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_DOT_WHITE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_TEXT :
+ {
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ } break;
+ default : {
+ wxdwr_out_unsigned(fout, pobj->fc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->fc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->fc[2], bptr, pstat);
+ } break;
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write 12 style attributes for a graphics object to file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_elements_12(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ /* object type */
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* layer */
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke red */
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke green */
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke blue */
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill red */
+ wxdwr_out_unsigned(fout, pobj->fc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill green */
+ wxdwr_out_unsigned(fout, pobj->fc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill blue */
+ wxdwr_out_unsigned(fout, pobj->fc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill style */
+ wxdwr_out_unsigned(fout, pobj->fs, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write 15 style attributes for a graphics object to file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_elements_15(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ /* object type */
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* number of points */
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ wxdwr_out_unsigned(fout, (pobj->det).p.n, bptr, pstat);
+ } break;
+ default : {
+ wxdwr_out_unsigned(fout, (pobj->det).s.n, bptr, pstat);
+ } break;
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* layer */
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke red */
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke green */
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke blue */
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill red */
+ wxdwr_out_unsigned(fout, pobj->fc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill green */
+ wxdwr_out_unsigned(fout, pobj->fc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill blue */
+ wxdwr_out_unsigned(fout, pobj->fc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* join style */
+ wxdwr_out_unsigned(fout, pobj->js, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* miter limit */
+ wxdwr_out_unsigned(fout, pobj->ml, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill style */
+ wxdwr_out_unsigned(fout, pobj->fs, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write 18 style attributes for a graphics object to file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_elements_18(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ /* object type */
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* number of points */
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ wxdwr_out_unsigned(fout, (pobj->det).p.n, bptr, pstat);
+ } break;
+ default : {
+ wxdwr_out_unsigned(fout, (pobj->det).s.n, bptr, pstat);
+ } break;
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* layer */
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke red */
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke green */
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke blue */
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* cap style */
+ wxdwr_out_unsigned(fout, pobj->cs, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* join style */
+ wxdwr_out_unsigned(fout, pobj->js, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* miter limit */
+ wxdwr_out_unsigned(fout, pobj->ml, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow type */
+ wxdwr_out_unsigned(fout, pobj->aft, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow length */
+ wxdwr_out_unsigned(fout, pobj->afl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow width */
+ wxdwr_out_unsigned(fout, pobj->afw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow type */
+ wxdwr_out_unsigned(fout, pobj->abt, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow length */
+ wxdwr_out_unsigned(fout, pobj->abl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow width */
+ wxdwr_out_unsigned(fout, pobj->abw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write text label to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_text_label(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char bte[1024];
+ char bts[1024];
+ size_t const szbte = DK4_SIZEOF(bte,char);
+ size_t const szbts = DK4_SIZEOF(bts,char);
+ int canrun = 1;
+ int res;
+
+#if 0
+ /* 2020-03-24 Modification
+ Turned into an initialization due to clang static analyzers
+ complaints about dead assignment.
+ */
+ canrun = 1;
+#endif
+ bte[0] = '\0';
+ bts[0] = '\0';
+ if (NULL != (pobj->det).t.t) {
+ res = dk4recwx_wxchar_to_char(
+ bte, szbte, DK4_ENCODING_UTF8, (pobj->det).t.t, pstat->wxe, NULL
+ );
+ if (0 != res) {
+ if (1022 > strlen(bte)) {
+ canrun = 1;
+ if (NULL != (pobj->det).t.tsc) {
+ res = dk4recwx_wxchar_to_char(
+ bts, szbts, DK4_ENCODING_UTF8, (pobj->det).t.tsc,
+ pstat->wxe, NULL
+ );
+ if (0 != res) {
+ if (1021 < strlen(bts)) {
+ canrun = 0;
+ /* ERROR: String too long */
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_STRING_TOO_LONG, (pobj->det).t.t
+ );
+ }
+ }
+ else {
+ canrun = 0;
+ /* ERROR: Encoding failed */
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_RECODE_TEXT, (pobj->det).t.t
+ );
+ }
+ }
+ if (0 != canrun) {
+ wxdwr_write_elements_05(fout, pobj, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).t.find, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).t.fsz, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).t.al, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).t.fl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).t.x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).t.y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).t.a, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, bte, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ if (NULL != (pobj->det).t.tsc) {
+ wxdwr_out_string_c8(fout, bts, bptr, pstat);
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+ }
+ else {
+ /* ERROR: String too long */
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_STRING_TOO_LONG, (pobj->det).t.t
+ );
+ }
+ }
+ else {
+ /* ERROR: Encoding failed */
+ wxdwr_status_set_error(pstat, WXDWR_E_RECODE_TEXT, (pobj->det).t.t);
+ }
+ }
+ else {
+ /* ERROR: No text. */
+ wxdwr_status_set_error(pstat, WXDWR_E_STRING_EMPTY, NULL);
+ }
+}
+
+
+
+/** Write polygon or polyline to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_polyline(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ uint16_t u;
+ if (WXD_OT_POLYLINE == pobj->ot) {
+ wxdwr_write_elements_18(fout, pobj, bptr, pstat);
+ }
+ else {
+ wxdwr_write_elements_15(fout, pobj, bptr, pstat);
+ }
+ for (u = 0; u < (pobj->det).p.n; u++) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, ((pobj->det).p.p)[u].x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, ((pobj->det).p.p)[u].y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+}
+
+
+
+/** Write spline to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_spline(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ uint16_t u;
+ if (WXD_OT_O_SPLINE == pobj->ot) {
+ wxdwr_write_elements_18(fout, pobj, bptr, pstat);
+ }
+ else {
+ wxdwr_write_elements_15(fout, pobj, bptr, pstat);
+ }
+ for (u = 0; u < (pobj->det).s.n; u++) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, ((pobj->det).s.p)[u].x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, ((pobj->det).s.p)[u].y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_double(fout, ((pobj->det).s.p)[u].s, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+}
+
+
+
+/** Write arc to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_arc(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ /* object type */
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* layer */
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke red */
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke green */
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke blue */
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ if (WXD_OT_O_ARC == pobj->ot) {
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* cap style */
+ wxdwr_out_unsigned(fout, pobj->cs, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow type */
+ wxdwr_out_unsigned(fout, pobj->aft, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow length */
+ wxdwr_out_unsigned(fout, pobj->afl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow width */
+ wxdwr_out_unsigned(fout, pobj->afw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow type */
+ wxdwr_out_unsigned(fout, pobj->abt, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow length */
+ wxdwr_out_unsigned(fout, pobj->abl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow width */
+ wxdwr_out_unsigned(fout, pobj->abw, bptr, pstat);
+ }
+ else {
+ /* fill red */
+ wxdwr_out_unsigned(fout, pobj->fc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill green */
+ wxdwr_out_unsigned(fout, pobj->fc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill blue */
+ wxdwr_out_unsigned(fout, pobj->fc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* join style */
+ wxdwr_out_unsigned(fout, pobj->js, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* miter limit */
+ wxdwr_out_unsigned(fout, pobj->ml, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill style */
+ wxdwr_out_unsigned(fout, pobj->fs, bptr, pstat);
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ /* second line: 3 point coordinates */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.x1, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.y1, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.x2, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.y2, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.x3, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.y3, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write circle to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_circle(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_write_elements_12(fout, pobj, bptr, pstat);
+ /* Second line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).e.rx, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write ellipse to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_ellipse(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_write_elements_12(fout, pobj, bptr, pstat);
+ /* Second line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).e.rx, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).e.ry, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.a, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write box to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_box(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_write_elements_12(fout, pobj, bptr, pstat);
+ /* Second line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).b.b.xl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).b.b.xr, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).b.b.yb, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).b.b.yt, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).b.r, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Calculate difference of 2 int32_t values as uint32_t value.
+ @param xl Smaller number.
+ @param xr Larger number.
+ @return Result (large - small number).
+*/
+static
+uint32_t
+wxdwr_diff_signed(int32_t xl, int32_t xr)
+{
+ dk4_er_t er;
+ uint32_t back = 0UL;
+ int32_t axl;
+ if (0L <= xr) {
+ if (0L <= xl) {
+ back = (uint32_t)(xr - xl);
+ }
+ else {
+ dk4error_init(&er);
+ axl = dk4ma_int32_t_abs(xl, &er);
+ if (DK4_E_NONE == er.ec) {
+ back = (uint32_t)xr + (uint32_t)axl;
+ }
+ else {
+ back = (uint32_t)xr + (uint32_t)(DK4_I32_MAX) + (uint32_t)1UL;
+ }
+ }
+ }
+ else {
+ if (0L <= xl) {
+ back = wxdwr_diff_signed(xr, xl);
+ }
+ else {
+ back = (uint32_t)(xr - xl);
+ }
+ }
+ return back;
+}
+
+
+
+/** Write image object to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_image(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char bfn[1024];
+ wxChar *fnco; /* File name to convert */
+ size_t const szbfn = DK4_SIZEOF(bfn,char);
+ int32_t x;
+ int32_t y;
+ uint32_t w;
+ uint32_t h;
+ int res;
+
+
+#line 1035 "WxdkdrawWrite.cpt"
+ if (NULL != (pobj->det).i.fn) {
+ fnco = (pobj->det).i.fn;
+#if TRACE_DEBUG
+#if DK4_SIZEOF_WXCHAR > 1
+
+
+#line 1040 "WxdkdrawWrite.cpt"
+#else
+
+
+#line 1042 "WxdkdrawWrite.cpt"
+#endif
+#endif
+ if (NULL != pstat->dirn) {
+ if (0 != dk4strx_path_is_in_subdir(fnco, pstat->dirn, NULL)) {
+ fnco = &(fnco[dk4strx_len(pstat->dirn) + (size_t)1U]);
+ }
+ }
+#if TRACE_DEBUG
+#if DK4_SIZEOF_WXCHAR > 1
+
+
+#line 1052 "WxdkdrawWrite.cpt"
+#else
+
+
+#line 1054 "WxdkdrawWrite.cpt"
+#endif
+#endif
+ res = dk4recwx_wxchar_to_char(
+ bfn, szbfn, DK4_ENCODING_UTF8, fnco, pstat->wxe, NULL
+ );
+ if (0 != res) {
+ if (1022 > strlen(bfn)) {
+ if ((pobj->det).i.br.xr >= (pobj->det).i.br.xl) {
+ x = (pobj->det).i.br.xl;
+ w = wxdwr_diff_signed(
+ (pobj->det).i.br.xl, (pobj->det).i.br.xr
+ );
+ }
+ else {
+ x = (pobj->det).i.br.xr;
+ w = wxdwr_diff_signed(
+ (pobj->det).i.br.xr, (pobj->det).i.br.xl
+ );
+ }
+ if ((pobj->det).i.br.yt >= (pobj->det).i.br.yb) {
+ y = (pobj->det).i.br.yb;
+ h = wxdwr_diff_signed(
+ (pobj->det).i.br.yb, (pobj->det).i.br.yt
+ );
+ }
+ else {
+ y = (pobj->det).i.br.yt;
+ h = wxdwr_diff_signed(
+ (pobj->det).i.br.yt, (pobj->det).i.br.yb
+ );
+ }
+ /* First line */
+ wxdwr_write_elements_05(fout, pobj, bptr, pstat);
+ /* Second line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* flags */
+ wxdwr_out_unsigned(fout, (pobj->det).i.fl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* rgb2gray */
+ wxdwr_out_signed(fout, (pobj->det).i.r2g, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* rgb2cmyk */
+ wxdwr_out_signed(fout, (pobj->det).i.r2c, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* x */
+ wxdwr_out_signed(fout, x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* y */
+ wxdwr_out_signed(fout, y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* w */
+ wxdwr_out_signed(fout, w, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* h */
+ wxdwr_out_signed(fout, h, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ /* Third line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, bfn, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+ else {
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_STRING_TOO_LONG, (pobj->det).i.fn
+ );
+ }
+ }
+ else {
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_RECODE_FILENAME, (pobj->det).i.fn
+ );
+ }
+ }
+ else {
+
+#line 1128 "WxdkdrawWrite.cpt"
+ }
+
+
+#line 1130 "WxdkdrawWrite.cpt"
+}
+
+
+
+/** Write dot to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_dot(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_write_elements_05(fout, pobj, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* x */
+ wxdwr_out_signed(fout, (pobj->det).d.x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* y */
+ wxdwr_out_signed(fout, (pobj->det).d.y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* d */
+ wxdwr_out_unsigned(fout, (pobj->det).d.d, bptr, pstat);
+ if (WXD_OT_DOT_WHITE == pobj->ot) {
+ /* l */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write graphics object to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_object(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ wxdwr_write_text_label(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ wxdwr_write_polyline(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ wxdwr_write_spline(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ wxdwr_write_arc(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_CIRCLE : {
+ wxdwr_write_circle(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ wxdwr_write_ellipse(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_BOX : {
+ wxdwr_write_box(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdwr_write_image(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ wxdwr_write_dot(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ wxdwr_write_dot(fout, pobj, bptr, pstat);
+ } break;
+ }
+}
+
+
+
+static
+void
+wxdwr_write_group_structure(
+ FILE *fout,
+ Wxd_object_t *proot,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ Wxd_object_t *pgrp;
+ Wxd_object_t *pobj;
+
+ pgrp = proot;
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ wxdwr_out_signed(fout, WXD_OT_GROUP_BEGIN, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ while (NULL != pgrp) {
+ pobj = (Wxd_object_t *)dk4sto_it_next((pgrp->det).g.i_e);
+ if (NULL != pobj) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ if (NULL != (pobj->det).g.i_e) {
+ dk4sto_it_reset((pobj->det).g.i_e);
+ pgrp = pobj;
+ wxdwr_out_signed(fout, WXD_OT_GROUP_BEGIN, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+ }
+ else {
+ wxdwr_write_object(fout, pobj, bptr, pstat);
+ }
+ }
+ else {
+ pgrp = pgrp->pa;
+ wxdwr_out_signed(fout, WXD_OT_GROUP_END, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+ }
+}
+
+
+
+int
+wxdwr_write_file(FILE *fout, Wxd_drawing_t *pdrw, wxdwr_status_t *pstat)
+{
+ Wxd_object_t *pgrp;
+ int back = 1;
+
+ if ((NULL != fout) && (NULL != pdrw)) {
+ wxdwr_write_first_line(fout, pdrw, &back, pstat);
+ wxdwr_write_bounding_box(fout, pdrw, &back, pstat);
+ wxdwr_write_base_line_width(fout, pdrw, &back, pstat);
+ wxdwr_write_zoom_level(fout, pdrw, &back, pstat);
+ wxdwr_write_grid_unit_and_base(fout, pdrw, &back, pstat);
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pgrp = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pgrp) {
+ if (WXD_OT_GROUP_BEGIN == pgrp->ot) {
+ wxdwr_write_group_structure(fout, pgrp, &back, pstat);
+ }
+ else {
+ wxdwr_write_object(fout, pgrp, &back, pstat);
+ }
+ }
+ } while (NULL != pgrp);
+ }
+ return back;
+}
+
+
+
+void
+wxdwr_status_init(wxdwr_status_t *pstat, int wxe)
+{
+ if (NULL != pstat) {
+ pstat->ec = WXDWR_E_NONE;
+ pstat->wxe = wxe;
+ pstat->str = NULL;
+ pstat->dirn = NULL;
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawWrite.cpt b/support/dktools/WxdkdrawWrite.cpt
new file mode 100644
index 0000000000..f702aa1115
--- /dev/null
+++ b/support/dktools/WxdkdrawWrite.cpt
@@ -0,0 +1,1307 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2020-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file WxdkdrawWrite.h Write drawing to file.
+*/
+
+#include "WxdkdrawTypes.h"
+
+
+/** Initialize a writer status structure.
+ @param pstat Status structure to initialize.
+ @param wxe Encoding for wxChar strings.
+*/
+void
+wxdwr_status_init(wxdwr_status_t *pstat, int wxe);
+
+/** Write drawing to file.
+ @param fout Output file to write, opened for text writing.
+ @param pdrw Drawing to write to file.
+ @param pstat Writer status.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdwr_write_file(FILE *fout, Wxd_drawing_t *pdrw, wxdwr_status_t *pstat);
+
+
+%% module
+
+#include "wxdkdraw.h"
+
+
+
+$!trace-include
+
+
+
+/** Contant text fragments, not localized.
+*/
+static char const * const wxdwr_c8_kw[] = {
+$!string-table
+#
+# 0 Newline
+#
+\n
+#
+# 1 Space
+#
+
+#
+# 2 Keyword WXD for file recognition.
+#
+WXD
+#
+# 3 Numeric value 0
+#
+0
+#
+# 4 Numeric value 1
+#
+1
+#
+# 5 Zoom level
+#
+0 2
+#
+# 6 Borders
+#
+0 4
+#
+# 7 Grid unit
+#
+0 5 1\n
+#
+# 8 Grid base
+#
+0 6 1\n
+#
+#
+#
+$!end
+};
+
+
+
+/** Indicate error condition in a status structure.
+ The function does not overwrite existing error conditions,
+ so the status reports the first error found.
+ @param pstat Status structure to modify.
+ @param ec Error code.
+ @param s String we can not handle.
+*/
+static
+void
+wxdwr_status_set_error(wxdwr_status_t *pstat, int ec, wxChar *s)
+{
+ if (NULL != pstat) {
+ if (WXDWR_E_NONE == pstat->ec) {
+ pstat->ec = ec;
+ pstat->str = s;
+ }
+ }
+}
+
+
+
+/** Write char string to output file.
+ @param fout Output file.
+ @param str String to write.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_out_string_c8(
+ FILE *fout,
+ char const *str,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ if (EOF == fputs(str, fout)) {
+ *bptr = 0;
+ wxdwr_status_set_error(pstat, WXDWR_E_WRITE, NULL);
+ }
+}
+
+
+
+/** Write unsigned number to output file.
+ @param fout Output file.
+ @param um Unsigned value to write.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_out_unsigned(
+ FILE *fout,
+ dk4_um_t um,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char buf[16*sizeof(dk4_um_t)];
+ size_t const szbuf = DK4_SIZEOF(buf,char);
+
+ (void)dk4ma_write_c8_decimal_unsigned(buf, szbuf, um, 0, NULL);
+ wxdwr_out_string_c8(fout, buf, bptr, pstat);
+}
+
+
+
+/** Write signed integer value to output file.
+ @param fout Output file.
+ @param im Integer value to write.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_out_signed(
+ FILE *fout,
+ dk4_im_t im,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char buf[16*sizeof(dk4_um_t)];
+ size_t const szbuf = DK4_SIZEOF(buf,char);
+
+ (void)dk4ma_write_c8_decimal_signed(buf, szbuf, im, 0, NULL);
+ wxdwr_out_string_c8(fout, buf, bptr, pstat);
+}
+
+
+
+/** Write double value to output file.
+ @param fout Output file.
+ @param dbl Value to write.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_out_double(
+ FILE *fout,
+ double dbl,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char buf[32*sizeof(double)];
+ size_t const szbuf = DK4_SIZEOF(buf,char);
+
+ (void)dk4ma_write_c8_double(buf, szbuf, dbl, 0, 1, NULL);
+ wxdwr_out_string_c8(fout, buf, bptr, pstat);
+}
+
+
+
+/** Write first line for a drawing to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_first_line(
+ FILE *fout, Wxd_drawing_t *pdrw, int *bptr, wxdwr_status_t *pstat
+)
+{
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pdrw->fv_maj, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pdrw->fv_min, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write bounding box for a drawing to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_bounding_box(
+ FILE *fout,
+ Wxd_drawing_t *pdrw,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[3], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[3], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pdrw->bb).xl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pdrw->bb).xr, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pdrw->bb).yb, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pdrw->bb).yt, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write base line width for a drawing to output file if necessary.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_base_line_width(
+ FILE *fout,
+ Wxd_drawing_t *pdrw,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ if (101600UL != (unsigned long)(pdrw->baselw)) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[3], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[4], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pdrw->baselw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+}
+
+
+
+/** Write zoom level for a drawing to output file if necessary.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_zoom_level(
+ FILE *fout,
+ Wxd_drawing_t *pdrw,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ if (0 != (int)(pdrw->zl)) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[5], bptr, pstat);
+ wxdwr_out_signed(fout, pdrw->zl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+}
+
+
+
+/** Write grid unit and grid base for a drawing to output file if necessary.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_grid_unit_and_base(
+ FILE *fout,
+ Wxd_drawing_t *pdrw,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ if ((uint8_t)0U != pdrw->gridunit) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[7], bptr, pstat);
+ }
+ if ((uint8_t)0U != pdrw->gridbase) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[8], bptr, pstat);
+ }
+}
+
+
+
+/** Write 5 style attributes for a graphics object to file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_elements_05(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_DOT_WHITE :
+ case WXD_OT_DOT_FILLED :
+ case WXD_OT_TEXT :
+ {
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ } break;
+ default : {
+ wxdwr_out_unsigned(fout, pobj->fc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->fc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->fc[2], bptr, pstat);
+ } break;
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write 12 style attributes for a graphics object to file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_elements_12(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ /* object type */
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* layer */
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke red */
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke green */
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke blue */
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill red */
+ wxdwr_out_unsigned(fout, pobj->fc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill green */
+ wxdwr_out_unsigned(fout, pobj->fc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill blue */
+ wxdwr_out_unsigned(fout, pobj->fc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill style */
+ wxdwr_out_unsigned(fout, pobj->fs, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write 15 style attributes for a graphics object to file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_elements_15(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ /* object type */
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* number of points */
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ wxdwr_out_unsigned(fout, (pobj->det).p.n, bptr, pstat);
+ } break;
+ default : {
+ wxdwr_out_unsigned(fout, (pobj->det).s.n, bptr, pstat);
+ } break;
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* layer */
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke red */
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke green */
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke blue */
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill red */
+ wxdwr_out_unsigned(fout, pobj->fc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill green */
+ wxdwr_out_unsigned(fout, pobj->fc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill blue */
+ wxdwr_out_unsigned(fout, pobj->fc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* join style */
+ wxdwr_out_unsigned(fout, pobj->js, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* miter limit */
+ wxdwr_out_unsigned(fout, pobj->ml, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill style */
+ wxdwr_out_unsigned(fout, pobj->fs, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write 18 style attributes for a graphics object to file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_elements_18(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ /* object type */
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* number of points */
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ wxdwr_out_unsigned(fout, (pobj->det).p.n, bptr, pstat);
+ } break;
+ default : {
+ wxdwr_out_unsigned(fout, (pobj->det).s.n, bptr, pstat);
+ } break;
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* layer */
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke red */
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke green */
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke blue */
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* cap style */
+ wxdwr_out_unsigned(fout, pobj->cs, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* join style */
+ wxdwr_out_unsigned(fout, pobj->js, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* miter limit */
+ wxdwr_out_unsigned(fout, pobj->ml, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow type */
+ wxdwr_out_unsigned(fout, pobj->aft, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow length */
+ wxdwr_out_unsigned(fout, pobj->afl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow width */
+ wxdwr_out_unsigned(fout, pobj->afw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow type */
+ wxdwr_out_unsigned(fout, pobj->abt, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow length */
+ wxdwr_out_unsigned(fout, pobj->abl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow width */
+ wxdwr_out_unsigned(fout, pobj->abw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write text label to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_text_label(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char bte[1024];
+ char bts[1024];
+ size_t const szbte = DK4_SIZEOF(bte,char);
+ size_t const szbts = DK4_SIZEOF(bts,char);
+ int canrun = 1;
+ int res;
+
+#if 0
+ /* 2020-03-24 Modification
+ Turned into an initialization due to clang static analyzers
+ complaints about dead assignment.
+ */
+ canrun = 1;
+#endif
+ bte[0] = '\0';
+ bts[0] = '\0';
+ if (NULL != (pobj->det).t.t) {
+ res = dk4recwx_wxchar_to_char(
+ bte, szbte, DK4_ENCODING_UTF8, (pobj->det).t.t, pstat->wxe, NULL
+ );
+ if (0 != res) {
+ if (1022 > strlen(bte)) {
+ canrun = 1;
+ if (NULL != (pobj->det).t.tsc) {
+ res = dk4recwx_wxchar_to_char(
+ bts, szbts, DK4_ENCODING_UTF8, (pobj->det).t.tsc,
+ pstat->wxe, NULL
+ );
+ if (0 != res) {
+ if (1021 < strlen(bts)) {
+ canrun = 0;
+ /* ERROR: String too long */
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_STRING_TOO_LONG, (pobj->det).t.t
+ );
+ }
+ }
+ else {
+ canrun = 0;
+ /* ERROR: Encoding failed */
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_RECODE_TEXT, (pobj->det).t.t
+ );
+ }
+ }
+ if (0 != canrun) {
+ wxdwr_write_elements_05(fout, pobj, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).t.find, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).t.fsz, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).t.al, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).t.fl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).t.x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).t.y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).t.a, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, bte, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ if (NULL != (pobj->det).t.tsc) {
+ wxdwr_out_string_c8(fout, bts, bptr, pstat);
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+ }
+ else {
+ /* ERROR: String too long */
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_STRING_TOO_LONG, (pobj->det).t.t
+ );
+ }
+ }
+ else {
+ /* ERROR: Encoding failed */
+ wxdwr_status_set_error(pstat, WXDWR_E_RECODE_TEXT, (pobj->det).t.t);
+ }
+ }
+ else {
+ /* ERROR: No text. */
+ wxdwr_status_set_error(pstat, WXDWR_E_STRING_EMPTY, NULL);
+ }
+}
+
+
+
+/** Write polygon or polyline to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_polyline(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ uint16_t u;
+ if (WXD_OT_POLYLINE == pobj->ot) {
+ wxdwr_write_elements_18(fout, pobj, bptr, pstat);
+ }
+ else {
+ wxdwr_write_elements_15(fout, pobj, bptr, pstat);
+ }
+ for (u = 0; u < (pobj->det).p.n; u++) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, ((pobj->det).p.p)[u].x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, ((pobj->det).p.p)[u].y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+}
+
+
+
+/** Write spline to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_spline(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ uint16_t u;
+ if (WXD_OT_O_SPLINE == pobj->ot) {
+ wxdwr_write_elements_18(fout, pobj, bptr, pstat);
+ }
+ else {
+ wxdwr_write_elements_15(fout, pobj, bptr, pstat);
+ }
+ for (u = 0; u < (pobj->det).s.n; u++) {
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, ((pobj->det).s.p)[u].x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, ((pobj->det).s.p)[u].y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_double(fout, ((pobj->det).s.p)[u].s, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+}
+
+
+
+/** Write arc to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_arc(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ /* object type */
+ wxdwr_out_signed(fout, pobj->ot, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* layer */
+ wxdwr_out_signed(fout, pobj->lay, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke red */
+ wxdwr_out_unsigned(fout, pobj->sc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke green */
+ wxdwr_out_unsigned(fout, pobj->sc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* stroke blue */
+ wxdwr_out_unsigned(fout, pobj->sc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ if (WXD_OT_O_ARC == pobj->ot) {
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* cap style */
+ wxdwr_out_unsigned(fout, pobj->cs, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow type */
+ wxdwr_out_unsigned(fout, pobj->aft, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow length */
+ wxdwr_out_unsigned(fout, pobj->afl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow width */
+ wxdwr_out_unsigned(fout, pobj->afw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow type */
+ wxdwr_out_unsigned(fout, pobj->abt, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow length */
+ wxdwr_out_unsigned(fout, pobj->abl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* arrow width */
+ wxdwr_out_unsigned(fout, pobj->abw, bptr, pstat);
+ }
+ else {
+ /* fill red */
+ wxdwr_out_unsigned(fout, pobj->fc[0], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill green */
+ wxdwr_out_unsigned(fout, pobj->fc[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill blue */
+ wxdwr_out_unsigned(fout, pobj->fc[2], bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line width */
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* line style */
+ wxdwr_out_unsigned(fout, pobj->ls, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* style value */
+ wxdwr_out_unsigned(fout, pobj->sl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* join style */
+ wxdwr_out_unsigned(fout, pobj->js, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* miter limit */
+ wxdwr_out_unsigned(fout, pobj->ml, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* fill style */
+ wxdwr_out_unsigned(fout, pobj->fs, bptr, pstat);
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ /* second line: 3 point coordinates */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.x1, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.y1, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.x2, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.y2, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.x3, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).a.y3, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write circle to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_circle(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_write_elements_12(fout, pobj, bptr, pstat);
+ /* Second line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).e.rx, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write ellipse to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_ellipse(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_write_elements_12(fout, pobj, bptr, pstat);
+ /* Second line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).e.rx, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).e.ry, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).e.a, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write box to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_box(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_write_elements_12(fout, pobj, bptr, pstat);
+ /* Second line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).b.b.xl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).b.b.xr, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).b.b.yb, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_signed(fout, (pobj->det).b.b.yt, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, (pobj->det).b.r, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Calculate difference of 2 int32_t values as uint32_t value.
+ @param xl Smaller number.
+ @param xr Larger number.
+ @return Result (large - small number).
+*/
+static
+uint32_t
+wxdwr_diff_signed(int32_t xl, int32_t xr)
+{
+ dk4_er_t er;
+ uint32_t back = 0UL;
+ int32_t axl;
+ if (0L <= xr) {
+ if (0L <= xl) {
+ back = (uint32_t)(xr - xl);
+ }
+ else {
+ dk4error_init(&er);
+ axl = dk4ma_int32_t_abs(xl, &er);
+ if (DK4_E_NONE == er.ec) {
+ back = (uint32_t)xr + (uint32_t)axl;
+ }
+ else {
+ back = (uint32_t)xr + (uint32_t)(DK4_I32_MAX) + (uint32_t)1UL;
+ }
+ }
+ }
+ else {
+ if (0L <= xl) {
+ back = wxdwr_diff_signed(xr, xl);
+ }
+ else {
+ back = (uint32_t)(xr - xl);
+ }
+ }
+ return back;
+}
+
+
+
+/** Write image object to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_image(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ char bfn[1024];
+ wxChar *fnco; /* File name to convert */
+ size_t const szbfn = DK4_SIZEOF(bfn,char);
+ int32_t x;
+ int32_t y;
+ uint32_t w;
+ uint32_t h;
+ int res;
+ $? "+ wxdwr_write_image"
+ if (NULL != (pobj->det).i.fn) {
+ fnco = (pobj->det).i.fn;
+#if TRACE_DEBUG
+#if DK4_SIZEOF_WXCHAR > 1
+ $? ". (1) \"%!ws\"", fnco
+#else
+ $? ". (1) \"%s\"", fnco
+#endif
+#endif
+ if (NULL != pstat->dirn) {
+ if (0 != dk4strx_path_is_in_subdir(fnco, pstat->dirn, NULL)) {
+ fnco = &(fnco[dk4strx_len(pstat->dirn) + (size_t)1U]);
+ }
+ }
+#if TRACE_DEBUG
+#if DK4_SIZEOF_WXCHAR > 1
+ $? ". (2) \"%!ws\"", fnco
+#else
+ $? ". (2) \"%s\"", fnco
+#endif
+#endif
+ res = dk4recwx_wxchar_to_char(
+ bfn, szbfn, DK4_ENCODING_UTF8, fnco, pstat->wxe, NULL
+ );
+ if (0 != res) {
+ if (1022 > strlen(bfn)) {
+ if ((pobj->det).i.br.xr >= (pobj->det).i.br.xl) {
+ x = (pobj->det).i.br.xl;
+ w = wxdwr_diff_signed(
+ (pobj->det).i.br.xl, (pobj->det).i.br.xr
+ );
+ }
+ else {
+ x = (pobj->det).i.br.xr;
+ w = wxdwr_diff_signed(
+ (pobj->det).i.br.xr, (pobj->det).i.br.xl
+ );
+ }
+ if ((pobj->det).i.br.yt >= (pobj->det).i.br.yb) {
+ y = (pobj->det).i.br.yb;
+ h = wxdwr_diff_signed(
+ (pobj->det).i.br.yb, (pobj->det).i.br.yt
+ );
+ }
+ else {
+ y = (pobj->det).i.br.yt;
+ h = wxdwr_diff_signed(
+ (pobj->det).i.br.yt, (pobj->det).i.br.yb
+ );
+ }
+ /* First line */
+ wxdwr_write_elements_05(fout, pobj, bptr, pstat);
+ /* Second line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* flags */
+ wxdwr_out_unsigned(fout, (pobj->det).i.fl, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* rgb2gray */
+ wxdwr_out_signed(fout, (pobj->det).i.r2g, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* rgb2cmyk */
+ wxdwr_out_signed(fout, (pobj->det).i.r2c, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* x */
+ wxdwr_out_signed(fout, x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* y */
+ wxdwr_out_signed(fout, y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* w */
+ wxdwr_out_signed(fout, w, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* h */
+ wxdwr_out_signed(fout, h, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ /* Third line */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_string_c8(fout, bfn, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+ else {
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_STRING_TOO_LONG, (pobj->det).i.fn
+ );
+ }
+ }
+ else {
+ wxdwr_status_set_error(
+ pstat, WXDWR_E_RECODE_FILENAME, (pobj->det).i.fn
+ );
+ }
+ }
+ else { $? "! empty"
+ }
+ $? "- wxdwr_write_image"
+}
+
+
+
+/** Write dot to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_dot(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ wxdwr_write_elements_05(fout, pobj, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* x */
+ wxdwr_out_signed(fout, (pobj->det).d.x, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* y */
+ wxdwr_out_signed(fout, (pobj->det).d.y, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ /* d */
+ wxdwr_out_unsigned(fout, (pobj->det).d.d, bptr, pstat);
+ if (WXD_OT_DOT_WHITE == pobj->ot) {
+ /* l */
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[1], bptr, pstat);
+ wxdwr_out_unsigned(fout, pobj->lw, bptr, pstat);
+ }
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+}
+
+
+
+/** Write graphics object to output file.
+ @param fout Output file.
+ @param pdrw Drawing.
+ @param pobj Object to handle.
+ @param bptr Address of success variable to reset on error.
+ @param pstat Status structure for error notification.
+*/
+static
+void
+wxdwr_write_object(
+ FILE *fout,
+ Wxd_object_t *pobj,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_TEXT : {
+ wxdwr_write_text_label(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ wxdwr_write_polyline(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ wxdwr_write_spline(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ wxdwr_write_arc(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_CIRCLE : {
+ wxdwr_write_circle(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ wxdwr_write_ellipse(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_BOX : {
+ wxdwr_write_box(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdwr_write_image(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ wxdwr_write_dot(fout, pobj, bptr, pstat);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ wxdwr_write_dot(fout, pobj, bptr, pstat);
+ } break;
+ }
+}
+
+
+
+static
+void
+wxdwr_write_group_structure(
+ FILE *fout,
+ Wxd_object_t *proot,
+ int *bptr,
+ wxdwr_status_t *pstat
+)
+{
+ Wxd_object_t *pgrp;
+ Wxd_object_t *pobj;
+
+ pgrp = proot;
+ dk4sto_it_reset((pgrp->det).g.i_e);
+ wxdwr_out_signed(fout, WXD_OT_GROUP_BEGIN, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ while (NULL != pgrp) {
+ pobj = (Wxd_object_t *)dk4sto_it_next((pgrp->det).g.i_e);
+ if (NULL != pobj) {
+ if (WXD_OT_GROUP_BEGIN == pobj->ot) {
+ if (NULL != (pobj->det).g.i_e) {
+ dk4sto_it_reset((pobj->det).g.i_e);
+ pgrp = pobj;
+ wxdwr_out_signed(fout, WXD_OT_GROUP_BEGIN, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+ }
+ else {
+ wxdwr_write_object(fout, pobj, bptr, pstat);
+ }
+ }
+ else {
+ pgrp = pgrp->pa;
+ wxdwr_out_signed(fout, WXD_OT_GROUP_END, bptr, pstat);
+ wxdwr_out_string_c8(fout, wxdwr_c8_kw[0], bptr, pstat);
+ }
+ }
+}
+
+
+
+int
+wxdwr_write_file(FILE *fout, Wxd_drawing_t *pdrw, wxdwr_status_t *pstat)
+{
+ Wxd_object_t *pgrp;
+ int back = 1;
+
+ if ((NULL != fout) && (NULL != pdrw)) {
+ wxdwr_write_first_line(fout, pdrw, &back, pstat);
+ wxdwr_write_bounding_box(fout, pdrw, &back, pstat);
+ wxdwr_write_base_line_width(fout, pdrw, &back, pstat);
+ wxdwr_write_zoom_level(fout, pdrw, &back, pstat);
+ wxdwr_write_grid_unit_and_base(fout, pdrw, &back, pstat);
+ dk4sto_it_reset(pdrw->i_stru);
+ do {
+ pgrp = (Wxd_object_t *)dk4sto_it_next(pdrw->i_stru);
+ if (NULL != pgrp) {
+ if (WXD_OT_GROUP_BEGIN == pgrp->ot) {
+ wxdwr_write_group_structure(fout, pgrp, &back, pstat);
+ }
+ else {
+ wxdwr_write_object(fout, pgrp, &back, pstat);
+ }
+ }
+ } while (NULL != pgrp);
+ }
+ return back;
+}
+
+
+
+void
+wxdwr_status_init(wxdwr_status_t *pstat, int wxe)
+{
+ if (NULL != pstat) {
+ pstat->ec = WXDWR_E_NONE;
+ pstat->wxe = wxe;
+ pstat->str = NULL;
+ pstat->dirn = NULL;
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WxdkdrawWrite.h b/support/dktools/WxdkdrawWrite.h
new file mode 100644
index 0000000000..8b86107f74
--- /dev/null
+++ b/support/dktools/WxdkdrawWrite.h
@@ -0,0 +1,46 @@
+/*
+Copyright (C) 2020-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxdkdrawWrite.cpt
+*/
+
+#ifndef WXDKDRAWWRITE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDKDRAWWRITE_H_INCLUDED 1
+
+
+#line 7 "WxdkdrawWrite.cpt"
+
+/** @file WxdkdrawWrite.h Write drawing to file.
+*/
+
+#include "WxdkdrawTypes.h"
+
+
+/** Initialize a writer status structure.
+ @param pstat Status structure to initialize.
+ @param wxe Encoding for wxChar strings.
+*/
+void
+wxdwr_status_init(wxdwr_status_t *pstat, int wxe);
+
+/** Write drawing to file.
+ @param fout Output file to write, opened for text writing.
+ @param pdrw Drawing to write to file.
+ @param pstat Writer status.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdwr_write_file(FILE *fout, Wxd_drawing_t *pdrw, wxdwr_status_t *pstat);
+
+
+
+#endif
diff --git a/support/dktools/WximgszApp.cpp b/support/dktools/WximgszApp.cpp
new file mode 100644
index 0000000000..64158cdca9
--- /dev/null
+++ b/support/dktools/WximgszApp.cpp
@@ -0,0 +1,569 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WximgszApp.cpt
+*/
+
+/** @file WximgszApp.cpp The WximgszApp module.
+*/
+
+
+#line 67 "WximgszApp.cpt"
+
+#include "wximgsz.h"
+
+
+
+
+
+#line 73 "WximgszApp.cpt"
+
+
+
+/** Localized wxChar texts.
+*/
+static wxChar const * wximgsz_texts[] = {
+/* 0 */
+wxT("File"),
+
+/* 1 */
+wxT("Quit"),
+
+/* 2 */
+wxT("Exit the application"),
+
+/* 3 */
+wxT("Help"),
+
+/* 4 */
+wxT("About"),
+
+/* 5 */
+wxT("Show version information"),
+
+/* 6 */
+wxT("Contents"),
+
+/* 7 */
+wxT("Open table of contents"),
+
+/* 8 */
+wxT("Ready"),
+
+/* 9 */
+wxT("Copyright (c) "),
+
+/* 10 */
+wxT("About "),
+
+/* 11 */
+wxT("This program uses the following libraries:"),
+
+/* 12 */
+wxT("See:"),
+
+/* 13 */
+wxT("Input"),
+
+/* 14 */
+wxT("Width: "),
+
+/* 15 */
+wxT("Height: "),
+
+/* 16 */
+wxT("Enter original image width"),
+
+/* 17 */
+wxT("Enter original image height"),
+
+/* 18 */
+wxT("Change"),
+
+/* 19 */
+wxT("Operation: "),
+
+/* 20 */
+wxT("Select the intended operation"),
+
+/* 21 */
+wxT("Downscale"),
+
+/* 22 */
+wxT("Width range"),
+
+/* 23 */
+wxT("Height range"),
+
+/* 24 */
+wxT("Minimum: "),
+
+/* 25 */
+wxT("Maximum: "),
+
+/* 26 */
+wxT("Enter range minimum"),
+
+/* 27 */
+wxT("Enter range maximum"),
+
+/* 28 */
+wxT("Results"),
+
+/* 29 */
+wxT("Run"),
+
+/* 30 */
+wxT("Width"),
+
+/* 31 */
+wxT("Height"),
+
+/* 32 */
+wxT("Factor"),
+
+/* 33 */
+wxT(""),
+
+/* 34 */
+wxT(""),
+
+/* 35 */
+wxT("+"),
+
+/* 36 */
+wxT("++"),
+
+/* 37 */
+wxT(" / "),
+
+/* 38 */
+wxT("Too many results"),
+
+/* 39 */
+wxT("Too many output rows, output limited."),
+
+/* 40 */
+wxT("Open"),
+
+/* 41 */
+wxT("Open bitmap image file and retrieve dimensions"),
+
+/* 42 */
+wxT("Open image file"),
+
+/* 43 */
+wxT("Open image failed"),
+
+/* 44 */
+wxT("Failed to open image!"),
+
+/* 45 */
+wxT("No such file:\n\""),
+
+/* 46 */
+wxT("\"!"),
+
+/* 47 */
+wxT("Insufficient permissions to file:\n\""),
+
+/* 48 */
+wxT("\"!"),
+
+/* 49 */
+wxT("Not a supported file type:\n\""),
+
+/* 50 */
+wxT("\"!"),
+
+NULL
+
+
+#line 225 "WximgszApp.cpt"
+};
+
+
+
+/** Non-localized wxChar texts.
+*/
+static wxChar const * wximgsz_nl_wx[] = {
+/* 0 */
+wxT("wximgsz"),
+
+/* 1 */
+wxT("1.0.0"),
+
+/* 2 */
+wxT("Dirk Krause"),
+
+/* 3 */
+wxT("DKrause"),
+
+/* 4 */
+wxT("aaaaa"),
+
+/* 5 */
+wxT(""),
+
+/* 6 */
+wxT(""),
+
+/* 7 */
+wxT(" "),
+
+/* 8 */
+wxT("\n"),
+
+/* 9 */
+wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."),
+
+/* 10 */
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
+
+/* 11 */
+wxT("http://www.wxwidgets.org"),
+
+/* 12 */
+wxT("http://www.libpng.org/pub/png/libpng.html"),
+
+/* 13 */
+wxT("http://www.ijg.org"),
+
+/* 14 */
+wxT("http://www.remotesensing.org/libtiff"),
+
+/* 15 */
+wxT("http://www.zlib.net"),
+
+/* 16 */
+wxT("Error"),
+
+/* 17 */
+wxT("Not enough memory (RAM)!"),
+
+NULL
+
+
+#line 290 "WximgszApp.cpt"
+};
+
+
+
+/** Non-localized dkChar texts.
+*/
+static dkChar const * wximgsz_nl_dk[] = {
+/* 0 */
+dkT("dktools"),
+
+/* 1 */
+dkT("wximgsz.str"),
+
+/* 2 */
+dkT("wximgsz.chm"),
+
+/* 3 */
+dkT("wximgsz.htb"),
+
+NULL
+
+
+#line 315 "WximgszApp.cpt"
+};
+
+
+
+/** Implementation of the wxApp functionality.
+*/
+IMPLEMENT_APP(WximgszApp)
+
+
+bool
+WximgszApp::OnInit()
+{
+ WximgszFrame *frame = NULL;
+ wxChar const * const *localizedTexts = NULL;
+#if !(wxCHECK_VERSION(3,0,0))
+ wxPNGHandler *phPng = NULL;
+ wxJPEGHandler *phJpg = NULL;
+ wxTIFFHandler *phTiff = NULL;
+ wxPNMHandler *phPnm = NULL;
+ wxXPMHandler *phXpm = NULL;
+ wxICOHandler *phIco = NULL;
+ wxGIFHandler *phGif = NULL;
+ wxPCXHandler *phPcx = NULL;
+ wxTGAHandler *phTga = NULL;
+ wxIFFHandler *phIff = NULL;
+ wxCURHandler *phCur = NULL;
+ wxANIHandler *phAni = NULL;
+#endif
+ wxArchiveFSHandler *phArchiveFS = NULL;
+ bool back = false;
+
+
+
+#line 347 "WximgszApp.cpt"
+
+ /* Initialize members.
+ */
+ pAh = NULL;
+ pHc = NULL;
+
+ /* __CHANGE__ 009: Initialize further members here.
+ */
+
+ /* Set up helper object.
+ */
+ pAh = new Dk4WxApplicationHelper();
+ if (NULL == pAh) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pAh->Initialize(argv[0], wximgsz_nl_wx[3], wximgsz_nl_dk[0]))) {
+ goto finished;
+ }
+
+#if wxCHECK_VERSION(3,0,0)
+ wxInitAllImageHandlers();
+#else
+ /* Add image and file system handlers for online help.
+ */
+ phPng = new wxPNGHandler();
+ if (NULL != phPng) {
+ wxImage::AddHandler(phPng);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phJpg = new wxJPEGHandler();
+ if (NULL != phJpg) {
+ wxImage::AddHandler(phJpg);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phTiff = new wxTIFFHandler();
+ if (NULL != phTiff) {
+ wxImage::AddHandler(phTiff);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phPnm = new wxPNMHandler();
+ if (NULL != phPnm) {
+ wxImage::AddHandler(phPnm);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phXpm = new wxXPMHandler();
+ if (NULL != phXpm) {
+ wxImage::AddHandler(phXpm);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phIco = new wxICOHandler();
+ if (NULL != phIco) {
+ wxImage::AddHandler(phIco);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phGif = new wxGIFHandler();
+ if (NULL != phGif) {
+ wxImage::AddHandler(phGif);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phPcx = new wxPCXHandler();
+ if (NULL != phPcx) {
+ wxImage::AddHandler(phPcx);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phTga = new wxTGAHandler();
+ if (NULL != phTga) {
+ wxImage::AddHandler(phTga);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phIff = new wxIFFHandler();
+ if (NULL != phIff) {
+ wxImage::AddHandler(phIff);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phCur = new wxCURHandler();
+ if (NULL != phCur) {
+ wxImage::AddHandler(phCur);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phAni = new wxANIHandler();
+ if (NULL != phAni) {
+ wxImage::AddHandler(phAni);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+#endif
+
+ phArchiveFS = new wxArchiveFSHandler();
+ if (NULL != phArchiveFS) {
+ wxFileSystem::AddHandler(phArchiveFS);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Set up help controller.
+ */
+ pHc = new Dk4WxHelpController();
+ if (NULL == pHc) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pHc->Initialize(pAh, wximgsz_nl_dk[2], wximgsz_nl_dk[3]))) {
+ goto finished;
+ }
+
+ /* Attempt to obtain localized texts in users preferred language.
+ */
+ localizedTexts = pAh->GetStringTable(wximgsz_nl_dk[1], wximgsz_texts);
+ if(!(localizedTexts)) {
+ localizedTexts = wximgsz_texts;
+ }
+
+ /* Create and show frame.
+ */
+ frame = new WximgszFrame(
+ WximgszFrame::ID_FRAME,
+ pAh,
+ pHc,
+ argc,
+ argv,
+ localizedTexts,
+ wximgsz_nl_wx,
+ wximgsz_nl_dk
+ );
+ if(!(frame)) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Show frame, restore position and indicate success.
+ */
+ frame->RestorePosition();
+ frame->Show();
+ frame->ActivateIdleProcessing();
+ back = true;
+
+ /* Release resources if initialization failed.
+ */
+ finished:
+ if(!(back)) {
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+ }
+
+
+#line 544 "WximgszApp.cpt"
+ return back;
+}
+
+
+
+int
+WximgszApp::OnExit()
+{
+ int back = 0;
+
+
+
+#line 555 "WximgszApp.cpt"
+
+ /* __CHANGE__ 009: Release resources allocated by further members.
+ */
+
+ /* Release resources.
+ */
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+
+ /* __CHANGE__ 010: Set exit status code.
+ */
+
+
+#line 571 "WximgszApp.cpt"
+ return back;
+}
+
+
+
+void
+WximgszApp::ShowMemoryErrorMessage(void)
+{
+ const wxChar *s_title = NULL;
+ const wxChar *s_text = NULL;
+
+ if (NULL != pAh) {
+ s_title = pAh->GetBasicString(6);
+ s_text = pAh->GetBasicString(7);
+ }
+ if (NULL == s_title) {
+ s_title = wximgsz_nl_wx[16];
+ }
+ if (NULL == s_text) {
+ s_text = wximgsz_nl_wx[17];
+ }
+ wxMessageBox(s_text, s_title, (wxOK | wxCENTRE | wxICON_ERROR));
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WximgszApp.cpt b/support/dktools/WximgszApp.cpt
new file mode 100644
index 0000000000..df9bbde95b
--- /dev/null
+++ b/support/dktools/WximgszApp.cpt
@@ -0,0 +1,598 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file WximgszApp.h The WximgszApp class.
+*/
+
+
+
+/** Application class, derived from wxApp, one instance per program.
+*/
+class WximgszApp : public wxApp
+{
+ protected:
+
+ /** Helper object.
+ */
+ Dk4WxApplicationHelper *pAh;
+
+ /** Controller fr online help.
+ */
+ Dk4WxHelpController *pHc;
+
+ /* __CHANGE__ 009: Add further members here.
+ */
+
+ protected:
+
+ /** Show error message if there is not enough memory available.
+ */
+ void
+ ShowMemoryErrorMessage(void);
+
+ public:
+
+ /** Application initialization.
+ @return true on success, false on error.
+ */
+ virtual
+ bool
+ OnInit();
+
+ /** Application shutdown.
+ @return 0 on success, any other value indicates an error.
+ */
+ virtual
+ int
+ OnExit();
+};
+
+
+
+/** Declaration as the wxApp object.
+*/
+DECLARE_APP(WximgszApp)
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#include "wximgsz.h"
+
+
+
+$!trace-include
+
+
+
+/** Localized wxChar texts.
+*/
+static wxChar const * wximgsz_texts[] = {
+$!string-table macro=wxT
+#
+# 0: Menu "File"
+#
+File
+#
+# 1: Menu item "File/Quit"
+#
+Quit
+#
+# 2: Tool tip text for menu item "File/Exit"
+#
+Exit the application
+#
+# 3: Menu "Help"
+#
+Help
+#
+# 4: Menu item "Help/About"
+#
+About
+#
+# 5: Tooltip text for menu item "Help/About"
+#
+Show version information
+#
+# 6: Menu item "Help/Contents"
+#
+Contents
+#
+# 7: Tooltip text for menu item "Help/Contents"
+#
+Open table of contents
+#
+# 8: Initial status text
+#
+Ready
+#
+# 9: Copyright notice.
+#
+Copyright (c)
+#
+# 10: Dialog box title "About ..."
+#
+About
+#
+# 11: This program uses the following libraries
+#
+This program uses the following libraries:
+#
+# 12: See
+#
+See:
+#
+# 13: __CHANGE__ 015: Text for dummy label, can be reused if lDummy removed.
+#
+Input
+#
+# 14-15 Input label for width and height
+#
+Width:
+Height:
+#
+# 16-17 Tooltips for spin controls.
+#
+Enter original image width
+Enter original image height
+#
+# 18 Group label
+#
+Change
+#
+# 19-20 Label and tooltip to select operation
+#
+Operation:
+Select the intended operation
+#
+# 21-23 Operation choices
+#
+Downscale
+Width range
+Height range
+#
+# 24-27 Range input labels and tooltips
+#
+Minimum:
+Maximum:
+Enter range minimum
+Enter range maximum
+#
+# 28 Group label results
+#
+Results
+#
+# 29 Tip for run button
+#
+Run
+#
+# 30-33 Table heads
+#
+Width
+Height
+Factor
+
+#
+# 34-36 Quality markers
+#
+
++
+++
+#
+# 37 Marker for fraction
+#
+ /
+#
+# 38-39 Dialog box for restrictions
+#
+Too many results
+Too many output rows, output limited.
+#
+# 40-41 Text and tool tip for file open
+#
+Open
+Open bitmap image file and retrieve dimensions
+#
+# 42 Dialog title
+#
+Open image file
+#
+# 43-44 Error message box title and text.
+#
+Open image failed
+Failed to open image!
+#
+# 45-48 Error message box texts
+#
+No such file:\n"
+"!
+Insufficient permissions to file:\n"
+"!
+#
+# 49-50 Error: Not a supported file type
+#
+Not a supported file type:\n"
+"!
+$!end
+};
+
+
+
+/** Non-localized wxChar texts.
+*/
+static wxChar const * wximgsz_nl_wx[] = {
+$!string-table macro=wxT
+#
+# 0: Program name. __CHANGE__ 004: Correct program name.
+#
+wximgsz
+#
+# 1: Program version. __CHANGE__ 005: Correct program version.
+#
+1.0.0
+#
+# 2: Copyright owner name. __CHANGE__ 001: Correct copyright owner name.
+#
+Dirk Krause
+#
+# 3: Software vendor name. __CHANGE__ 007: Correct software vendor name
+# if necessary. Must be one
+# string without spaces.
+#
+DKrause
+#
+# 4: Resource name of Windows icon
+#
+aaaaa
+#
+# 5: UNUSED (previously Windows chm help file name)
+#
+
+#
+# 6: UNUSED (previously non-Windows htb help file name)
+#
+
+#
+# 7: Space
+#
+
+#
+# 8: Newline
+#
+\n
+#
+# 9 10 11 12 13 14 15: List of libraries used.
+#
+DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
+http://sourceforge.net/p/dktools/wiki/Home/
+http://www.wxwidgets.org
+http://www.libpng.org/pub/png/libpng.html
+http://www.ijg.org
+http://www.remotesensing.org/libtiff
+http://www.zlib.net
+#
+# 16 17
+#
+Error
+Not enough memory (RAM)!
+#
+#
+#
+$!end
+};
+
+
+
+/** Non-localized dkChar texts.
+*/
+static dkChar const * wximgsz_nl_dk[] = {
+$!string-table macro=dkT
+#
+# 0: Program group name. __CHANGE__ 006: Correct program group name.
+#
+dktools
+#
+# 1: String table name.
+#
+wximgsz.str
+#
+# 2: CHM help file name
+#
+wximgsz.chm
+#
+# 3: HTB help file name
+#
+wximgsz.htb
+$!end
+};
+
+
+
+/** Implementation of the wxApp functionality.
+*/
+IMPLEMENT_APP(WximgszApp)
+
+
+bool
+WximgszApp::OnInit()
+{
+ WximgszFrame *frame = NULL;
+ wxChar const * const *localizedTexts = NULL;
+#if !(wxCHECK_VERSION(3,0,0))
+ wxPNGHandler *phPng = NULL;
+ wxJPEGHandler *phJpg = NULL;
+ wxTIFFHandler *phTiff = NULL;
+ wxPNMHandler *phPnm = NULL;
+ wxXPMHandler *phXpm = NULL;
+ wxICOHandler *phIco = NULL;
+ wxGIFHandler *phGif = NULL;
+ wxPCXHandler *phPcx = NULL;
+ wxTGAHandler *phTga = NULL;
+ wxIFFHandler *phIff = NULL;
+ wxCURHandler *phCur = NULL;
+ wxANIHandler *phAni = NULL;
+#endif
+ wxArchiveFSHandler *phArchiveFS = NULL;
+ bool back = false;
+
+ $? "+ WximgszApp::OnInit"
+
+ /* Initialize members.
+ */
+ pAh = NULL;
+ pHc = NULL;
+
+ /* __CHANGE__ 009: Initialize further members here.
+ */
+
+ /* Set up helper object.
+ */
+ pAh = new Dk4WxApplicationHelper();
+ if (NULL == pAh) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pAh->Initialize(argv[0], wximgsz_nl_wx[3], wximgsz_nl_dk[0]))) {
+ goto finished;
+ }
+
+#if wxCHECK_VERSION(3,0,0)
+ wxInitAllImageHandlers();
+#else
+ /* Add image and file system handlers for online help.
+ */
+ phPng = new wxPNGHandler();
+ if (NULL != phPng) {
+ wxImage::AddHandler(phPng);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phJpg = new wxJPEGHandler();
+ if (NULL != phJpg) {
+ wxImage::AddHandler(phJpg);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phTiff = new wxTIFFHandler();
+ if (NULL != phTiff) {
+ wxImage::AddHandler(phTiff);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phPnm = new wxPNMHandler();
+ if (NULL != phPnm) {
+ wxImage::AddHandler(phPnm);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phXpm = new wxXPMHandler();
+ if (NULL != phXpm) {
+ wxImage::AddHandler(phXpm);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phIco = new wxICOHandler();
+ if (NULL != phIco) {
+ wxImage::AddHandler(phIco);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phGif = new wxGIFHandler();
+ if (NULL != phGif) {
+ wxImage::AddHandler(phGif);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phPcx = new wxPCXHandler();
+ if (NULL != phPcx) {
+ wxImage::AddHandler(phPcx);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phTga = new wxTGAHandler();
+ if (NULL != phTga) {
+ wxImage::AddHandler(phTga);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phIff = new wxIFFHandler();
+ if (NULL != phIff) {
+ wxImage::AddHandler(phIff);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phCur = new wxCURHandler();
+ if (NULL != phCur) {
+ wxImage::AddHandler(phCur);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ phAni = new wxANIHandler();
+ if (NULL != phAni) {
+ wxImage::AddHandler(phAni);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+#endif
+
+ phArchiveFS = new wxArchiveFSHandler();
+ if (NULL != phArchiveFS) {
+ wxFileSystem::AddHandler(phArchiveFS);
+ }
+ else {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Set up help controller.
+ */
+ pHc = new Dk4WxHelpController();
+ if (NULL == pHc) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+ if (!(pHc->Initialize(pAh, wximgsz_nl_dk[2], wximgsz_nl_dk[3]))) {
+ goto finished;
+ }
+
+ /* Attempt to obtain localized texts in users preferred language.
+ */
+ localizedTexts = pAh->GetStringTable(wximgsz_nl_dk[1], wximgsz_texts);
+ if(!(localizedTexts)) {
+ localizedTexts = wximgsz_texts;
+ }
+
+ /* Create and show frame.
+ */
+ frame = new WximgszFrame(
+ WximgszFrame::ID_FRAME,
+ pAh,
+ pHc,
+ argc,
+ argv,
+ localizedTexts,
+ wximgsz_nl_wx,
+ wximgsz_nl_dk
+ );
+ if(!(frame)) {
+ ShowMemoryErrorMessage();
+ goto finished;
+ }
+
+ /* Show frame, restore position and indicate success.
+ */
+ frame->RestorePosition();
+ frame->Show();
+ frame->ActivateIdleProcessing();
+ back = true;
+
+ /* Release resources if initialization failed.
+ */
+ finished:
+ if(!(back)) {
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+ }
+ $? "- WximgszApp::OnInit %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+int
+WximgszApp::OnExit()
+{
+ int back = 0;
+
+ $? "+ WximgszApp::OnExit"
+
+ /* __CHANGE__ 009: Release resources allocated by further members.
+ */
+
+ /* Release resources.
+ */
+ if (NULL != pHc) {
+ pHc->Cleanup(); delete(pHc); pHc = NULL;
+ }
+ if (NULL != pAh) {
+ pAh->Cleanup(); delete(pAh); pAh = NULL;
+ }
+
+ /* __CHANGE__ 010: Set exit status code.
+ */
+ $? "- WximgszApp::OnExit %d", back
+ return back;
+}
+
+
+
+void
+WximgszApp::ShowMemoryErrorMessage(void)
+{
+ const wxChar *s_title = NULL;
+ const wxChar *s_text = NULL;
+
+ if (NULL != pAh) {
+ s_title = pAh->GetBasicString(6);
+ s_text = pAh->GetBasicString(7);
+ }
+ if (NULL == s_title) {
+ s_title = wximgsz_nl_wx[16];
+ }
+ if (NULL == s_text) {
+ s_text = wximgsz_nl_wx[17];
+ }
+ wxMessageBox(s_text, s_title, (wxOK | wxCENTRE | wxICON_ERROR));
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/WximgszApp.h b/support/dktools/WximgszApp.h
new file mode 100644
index 0000000000..32e8ffb4d2
--- /dev/null
+++ b/support/dktools/WximgszApp.h
@@ -0,0 +1,77 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WximgszApp.cpt
+*/
+
+#ifndef WXIMGSZAPP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXIMGSZAPP_H_INCLUDED 1
+
+
+#line 10 "WximgszApp.cpt"
+
+/** @file WximgszApp.h The WximgszApp class.
+*/
+
+
+
+/** Application class, derived from wxApp, one instance per program.
+*/
+class WximgszApp : public wxApp
+{
+ protected:
+
+ /** Helper object.
+ */
+ Dk4WxApplicationHelper *pAh;
+
+ /** Controller fr online help.
+ */
+ Dk4WxHelpController *pHc;
+
+ /* __CHANGE__ 009: Add further members here.
+ */
+
+ protected:
+
+ /** Show error message if there is not enough memory available.
+ */
+ void
+ ShowMemoryErrorMessage(void);
+
+ public:
+
+ /** Application initialization.
+ @return true on success, false on error.
+ */
+ virtual
+ bool
+ OnInit();
+
+ /** Application shutdown.
+ @return 0 on success, any other value indicates an error.
+ */
+ virtual
+ int
+ OnExit();
+};
+
+
+
+/** Declaration as the wxApp object.
+*/
+DECLARE_APP(WximgszApp)
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/WximgszFrame.cpp b/support/dktools/WximgszFrame.cpp
new file mode 100644
index 0000000000..e4fa15bf3f
--- /dev/null
+++ b/support/dktools/WximgszFrame.cpp
@@ -0,0 +1,1471 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WximgszFrame.wxc
+*/
+
+/** @file WximgszFrame.cpp The WximgszFrame module.
+*/
+
+
+#line 375 "WximgszFrame.wxc"
+
+#include "wximgsz.h"
+
+
+#if !defined(__WXMSW__)
+#include "gui-img/icons/dkicon.xpm"
+#endif
+
+
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+
+
+
+
+#line 388 "WximgszFrame.wxc"
+
+
+
+/* __CHANGE__ 017: Add further events. */
+
+/* Hint: Window IDs for main frame members are defined in an enum
+ in the frame class.
+ IDs defined in this enum should have WximgszFrame:: prepended
+ for an optical distinction from predefined window IDs (i.e. from
+ wxWidgets).
+*/
+
+/* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+ When removing the table entry here, remove the entire OnIdle() method.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WximgszFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WximgszFrame,wxFrame)
+#endif
+ EVT_MENU(\
+ wxID_OPEN,\
+ WximgszFrame::OnFileOpen\
+ )
+ EVT_MENU(\
+ wxID_EXIT,\
+ WximgszFrame::OnQuit\
+ )
+ EVT_MENU(\
+ WximgszFrame::ID_HELP_ABOUT,\
+ WximgszFrame::OnAbout\
+ )
+ EVT_MENU(\
+ WximgszFrame::ID_HELP_TOC,\
+ WximgszFrame::OnHelpContents\
+ )
+ EVT_BUTTON(\
+ WximgszFrame::ID_BUTTON_RUN,\
+ WximgszFrame::OnButtonRun\
+ )
+ EVT_CHOICE(\
+ WximgszFrame::ID_CHOICE_OP,\
+ WximgszFrame::OnChoiceOperation\
+ )
+ EVT_IDLE(\
+ WximgszFrame::OnIdle\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+/** Image file types we can handle.
+*/
+static wxChar const image_files_to_open[] = {
+ wxT("All files (*.*)|*.*")
+#if wxUSE_LIBPNG
+ wxT("|PNG files (*.png)|*.png")
+#endif
+#if wxUSE_LIBJPEG
+ wxT("|JPEG files (*.jpeg)|*.jpeg")
+ wxT("|JPEG files (*.jpg)|*.jpg")
+#endif
+#if wxUSE_LIBTIFF
+ wxT("|TIFF files (*.tiff)|*.tiff")
+ wxT("|TIFF files (*.tif)|*.tif")
+#endif
+#if wxUSE_GIF
+ wxT("|GIF files (*.gif)|*.gif")
+#endif
+#if wxUSE_PCX
+ wxT("|PCX files (*.pcx)|*.pcx")
+#endif
+ wxT("|BMP files (*.bmp)|*.bmp")
+#if wxUSE_ICO_CUR
+ wxT("|ICO files (*.ico)|*.ico")
+ wxT("|CUR files (*.cur)|*.cur")
+#endif
+#if wxUSE_XPM
+ wxT("|XPM files (*.xpm)|*.xpm")
+ wxT("|XBM files (*.xbm)|*.xbm")
+#endif
+#if wxUSE_TGA
+ wxT("|TGA files (*.tga)|*.tga")
+#endif
+#if wxUSE_IFF
+ wxT("|IFF files (*.iff)|*.iff")
+#endif
+ wxT("|ANI files (*.ani)|*.ani")
+#if wxUSE_PNM
+ wxT("|NetPBM files (*.pam)|*.pam")
+ wxT("|NetPBM files (*.pnm)|*.pnm")
+ wxT("|NetPBM files (*.ppm)|*.ppm")
+ wxT("|NetPBM files (*.pgm)|*.pgm")
+ wxT("|NetPBM files (*.pbm)|*.pbm")
+#endif
+};
+
+
+/** Suffix and bitmap type relationship.
+*/
+typedef struct {
+ wxChar const *s; /**< File name suffix. */
+ wxBitmapType t; /**< Bitmap type. */
+} Suffix_and_type_t;
+
+
+
+/** Array to assign file name suffixes to file types.
+*/
+Suffix_and_type_t suffix_and_type[] = {
+#if wxUSE_LIBPNG
+ { wxT(".png"), wxBITMAP_TYPE_PNG },
+#endif
+#if wxUSE_LIBJPEG
+ { wxT(".jpeg"), wxBITMAP_TYPE_JPEG },
+ { wxT(".jpg"), wxBITMAP_TYPE_JPEG },
+#endif
+#if wxUSE_LIBTIFF
+ { wxT(".tiff"), wxBITMAP_TYPE_TIFF },
+ { wxT(".tif"), wxBITMAP_TYPE_TIF },
+#endif
+#if wxUSE_PNM
+ { wxT(".pam"), wxBITMAP_TYPE_PNM },
+ { wxT(".pnm"), wxBITMAP_TYPE_PNM },
+ { wxT(".ppm"), wxBITMAP_TYPE_PNM },
+ { wxT(".pgm"), wxBITMAP_TYPE_PNM },
+ { wxT(".pbm"), wxBITMAP_TYPE_PNM },
+#endif
+#if wxUSE_XPM
+ { wxT(".xpm"), wxBITMAP_TYPE_XPM },
+ { wxT(".xbm"), wxBITMAP_TYPE_XBM },
+#endif
+#if wxUSE_ICO_CUR
+ { wxT(".ico"), wxBITMAP_TYPE_ICO },
+ { wxT(".cur"), wxBITMAP_TYPE_CUR },
+#endif
+#if wxUSE_GIF
+ { wxT(".gif"), wxBITMAP_TYPE_GIF },
+#endif
+#if wxUSE_PCX
+ { wxT(".pcx"), wxBITMAP_TYPE_PCX },
+#endif
+ { wxT(".bmp"), wxBITMAP_TYPE_BMP },
+#if wxUSE_TGA
+ { wxT(".tga"), wxBITMAP_TYPE_TGA },
+#endif
+#if wxUSE_IFF
+ { wxT(".iff"), wxBITMAP_TYPE_IFF },
+#endif
+ { wxT(".ani"), wxBITMAP_TYPE_ANI },
+ { NULL, wxBITMAP_TYPE_INVALID }
+};
+
+
+
+static
+wxBitmapType
+bitmap_type_for_name(wxString & fn)
+{
+ wxChar const *ptr = NULL;
+ Suffix_and_type_t *sat = NULL;
+ wxBitmapType back = wxBITMAP_TYPE_INVALID;
+ wxCStrData strdata = fn.c_str();
+ ptr = (wxChar const *)strdata;
+ if (NULL != ptr) {
+ ptr = dk4strx_get_path_suffix(ptr, NULL);
+ if (NULL != ptr) {
+ sat = suffix_and_type;
+ while((NULL != sat->s) && (wxBITMAP_TYPE_INVALID == back)) {
+ if (0 == dk4strx_casecmp(sat->s, ptr)) {
+ back = sat->t;
+ }
+ else {
+ sat++;
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+
+#line 577 "WximgszFrame.wxc"
+WximgszFrame::WximgszFrame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ int argc,
+ wxChar **argv,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk
+) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid),
+ cas(),
+ cLabelRed(127, 0, 0),
+ cRed(255, 91, 91),
+ cGreen(127, 255, 127),
+ cYellow(255, 255, 0),
+ cBlack(0, 0, 0),
+ sImageFileName((1 < argc)?(argv[1]):(wxT(""))),
+ sDirectory(wxEmptyString)
+{
+ wxString saOperation[] = {
+ wxString(localizedTexts[21]),
+ wxString(localizedTexts[22]),
+ wxString(localizedTexts[23])
+ };
+
+
+#line 602 "WximgszFrame.wxc"
+ /* __CHANGE__ 012: Add further local variables.
+ */
+
+ /* __CHANGE__ 012: Initialize further local variables.
+ */
+
+ sTexts = localizedTexts;
+ sNlWx = nlWx;
+ sNlDk = nlDk;
+#if defined(__WXMSW__)
+ wxIcon wximgsz_icon(sNlWx[4]);
+#else
+ wxIcon wximgsz_icon(xpm_dkicon);
+#endif
+
+ /* __CHANGE__ 011: Initialize further class members.
+ */
+ maxpass = MAXPASS;
+ bActive = false;
+ bImageFileName = false;
+ if (1 < argc) {
+ bImageFileName = true;
+ cas.SetAutoStart();
+ }
+
+ dkctGUILayoutOK = false;
+ dkctGUIContentsPanel = NULL;
+ mainSizer = NULL;
+ mbMain = NULL;
+ menuFile = NULL;
+ menuHelp = NULL;
+ miFileOpen = NULL;
+ miFileExit = NULL;
+ miHelpAbout = NULL;
+ miHelpContents = NULL;
+ verticalSizer = NULL;
+ contentsSizer = NULL;
+ inputSizer = NULL;
+ runButtonSizer = NULL;
+ resultSizer = NULL;
+ lInput = NULL;
+ lInputWidth = NULL;
+ spInputWidth = NULL;
+ lInputHeight = NULL;
+ spInputHeight = NULL;
+ lChange = NULL;
+ lOperation = NULL;
+ cbOperation = NULL;
+ lOperationMin = NULL;
+ spOperationMin = NULL;
+ lOperationMax = NULL;
+ spOperationMax = NULL;
+ bRun = NULL;
+ lResults = NULL;
+ tResult = NULL;
+ dkctGUIContentsPanel = new wxPanel(this);
+ if(!(dkctGUIContentsPanel)) {
+ goto dkctGUILayoutFinished;
+ }
+#if wxUSE_MENUS
+ mbMain = new wxMenuBar(
+ );
+ if(!(mbMain)) {
+ goto dkctGUILayoutFinished;
+ }
+ menuFile = new wxMenu(
+ );
+ if(!(menuFile)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileOpen = menuFile->Append(
+ wxID_OPEN,
+ sTexts[40],
+ sTexts[41]
+ );
+ if(!(miFileOpen)) {
+ goto dkctGUILayoutFinished;
+ }
+ miFileExit = menuFile->Append(
+ wxID_EXIT,
+ sTexts[1],
+ sTexts[2]
+ );
+ if(!(miFileExit)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuFile, sTexts[0]);
+ menuHelp = new wxMenu(
+ );
+ if(!(menuHelp)) {
+ goto dkctGUILayoutFinished;
+ }
+ miHelpAbout = menuHelp->Append(
+ WximgszFrame::ID_HELP_ABOUT,
+ sTexts[4],
+ sTexts[5]
+ );
+ if(!(miHelpAbout)) {
+ goto dkctGUILayoutFinished;
+ }
+ miHelpContents = menuHelp->Append(
+ WximgszFrame::ID_HELP_TOC,
+ sTexts[6],
+ sTexts[7]
+ );
+ if(!(miHelpContents)) {
+ goto dkctGUILayoutFinished;
+ }
+ mbMain->Append(menuHelp, sTexts[3]);
+ SetMenuBar(mbMain);
+#endif
+ mainSizer = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(mainSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ mainSizer->Add(10, 10, 0);
+ verticalSizer = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(verticalSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ verticalSizer->Add(10, 10, 0);
+ contentsSizer = new wxBoxSizer(
+ wxHORIZONTAL
+ );
+ if(!(contentsSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ inputSizer = new wxGridBagSizer(
+ 5, 5
+ );
+ if(!(inputSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ lInput = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[13]
+ );
+ if(!(lInput)) {
+ goto dkctGUILayoutFinished;
+ }
+ inputSizer->Add(
+ lInput,
+ wxGBPosition(0, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT
+ );
+ lInputWidth = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[14]
+ );
+ if(!(lInputWidth)) {
+ goto dkctGUILayoutFinished;
+ }
+ inputSizer->Add(
+ lInputWidth,
+ wxGBPosition(1, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spInputWidth = new wxSpinCtrl(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 1
+ );
+ if(!(spInputWidth)) {
+ goto dkctGUILayoutFinished;
+ }
+ spInputWidth->SetToolTip(sTexts[16]);
+ inputSizer->Add(
+ spInputWidth,
+ wxGBPosition(1, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_VERTICAL
+ );
+ lInputHeight = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[15]
+ );
+ if(!(lInputHeight)) {
+ goto dkctGUILayoutFinished;
+ }
+ inputSizer->Add(
+ lInputHeight,
+ wxGBPosition(2, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spInputHeight = new wxSpinCtrl(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 1
+ );
+ if(!(spInputHeight)) {
+ goto dkctGUILayoutFinished;
+ }
+ spInputHeight->SetToolTip(sTexts[17]);
+ inputSizer->Add(
+ spInputHeight,
+ wxGBPosition(2, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_CENTER_VERTICAL
+ );
+ inputSizer->Add(10, 10, wxGBPosition(3, 0), wxGBSpan(1, 1));
+ lChange = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[18]
+ );
+ if(!(lChange)) {
+ goto dkctGUILayoutFinished;
+ }
+ inputSizer->Add(
+ lChange,
+ wxGBPosition(4, 0),
+ wxGBSpan(1, 2),
+ wxALIGN_LEFT
+ );
+ lOperation = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[19]
+ );
+ if(!(lOperation)) {
+ goto dkctGUILayoutFinished;
+ }
+ inputSizer->Add(
+ lOperation,
+ wxGBPosition(5, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ cbOperation = new wxChoice(
+ dkctGUIContentsPanel,
+ ID_CHOICE_OP,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 3,
+ saOperation
+ );
+ if(!(cbOperation)) {
+ goto dkctGUILayoutFinished;
+ }
+ cbOperation->SetToolTip(sTexts[20]);
+ inputSizer->Add(
+ cbOperation,
+ wxGBPosition(5, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lOperationMin = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[24]
+ );
+ if(!(lOperationMin)) {
+ goto dkctGUILayoutFinished;
+ }
+ inputSizer->Add(
+ lOperationMin,
+ wxGBPosition(6, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spOperationMin = new wxSpinCtrl(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 1
+ );
+ if(!(spOperationMin)) {
+ goto dkctGUILayoutFinished;
+ }
+ spOperationMin->SetToolTip(sTexts[26]);
+ inputSizer->Add(
+ spOperationMin,
+ wxGBPosition(6, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ lOperationMax = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[25]
+ );
+ if(!(lOperationMax)) {
+ goto dkctGUILayoutFinished;
+ }
+ inputSizer->Add(
+ lOperationMax,
+ wxGBPosition(7, 0),
+ wxGBSpan(1, 1),
+ wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL
+ );
+ spOperationMax = new wxSpinCtrl(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0,
+ 1,
+ 65535,
+ 1
+ );
+ if(!(spOperationMax)) {
+ goto dkctGUILayoutFinished;
+ }
+ spOperationMax->SetToolTip(sTexts[27]);
+ inputSizer->Add(
+ spOperationMax,
+ wxGBPosition(7, 1),
+ wxGBSpan(1, 1),
+ wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL
+ );
+ contentsSizer->Add(
+ inputSizer
+ );
+ contentsSizer->Add(20, 20, 0);
+ runButtonSizer = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(runButtonSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ runButtonSizer->Add(10, 10, 1);
+ bRun = new wxBitmapButton(
+ dkctGUIContentsPanel,
+ ID_BUTTON_RUN,
+ xpm_run_conversion
+ );
+ if(!(bRun)) {
+ goto dkctGUILayoutFinished;
+ }
+ bRun->SetToolTip(sTexts[29]);
+ runButtonSizer->Add(
+ bRun
+ );
+ runButtonSizer->Add(10, 10, 1);
+ contentsSizer->Add(
+ runButtonSizer,
+ 0,
+ wxGROW
+ );
+ contentsSizer->Add(20, 20, 0);
+ resultSizer = new wxBoxSizer(
+ wxVERTICAL
+ );
+ if(!(resultSizer)) {
+ goto dkctGUILayoutFinished;
+ }
+ lResults = new wxStaticText(
+ dkctGUIContentsPanel,
+ wxID_ANY,
+ sTexts[28]
+ );
+ if(!(lResults)) {
+ goto dkctGUILayoutFinished;
+ }
+ resultSizer->Add(
+ lResults,
+ 0,
+ wxALIGN_LEFT
+ );
+ tResult = new wxGrid(
+ dkctGUIContentsPanel,
+ wxID_ANY
+ );
+ if(!(tResult)) {
+ goto dkctGUILayoutFinished;
+ }
+ tResult->CreateGrid(4, 4);
+ tResult->SetColLabelValue(0, sTexts[30]);
+ tResult->SetColLabelValue(1, sTexts[31]);
+ tResult->SetColLabelValue(2, sTexts[32]);
+ tResult->SetColLabelValue(3, sTexts[33]);
+ tResult->EnableEditing(false);
+ resultSizer->Add(
+ tResult,
+ 1,
+ wxALIGN_LEFT|wxGROW
+ );
+ contentsSizer->Add(
+ resultSizer,
+ 1,
+ wxGROW
+ );
+ verticalSizer->Add(
+ contentsSizer,
+ 1,
+ wxGROW
+ );
+ verticalSizer->Add(10, 10, 0);
+ mainSizer->Add(
+ verticalSizer,
+ 1,
+ wxGROW
+ );
+ mainSizer->Add(10, 10, 0);
+ dkctGUIContentsPanel->SetSizer(mainSizer);
+ SetIcon(wximgsz_icon);
+ dkctGUILayoutOK = true;
+ dkctGUILayoutFinished:
+#if wxUSE_STATUSBAR
+ if(dkctGUILayoutOK) {
+ CreateStatusBar(1);
+ SetStatusText(sTexts[8]);
+ }
+#endif
+ if(dkctGUILayoutOK) {
+ mainSizer->Fit(this);
+ mainSizer->SetSizeHints(this);
+ }
+
+#line 628 "WximgszFrame.wxc"
+ if(dkctGUILayoutOK) {
+ lInput->SetForegroundColour(cLabelRed);
+ lChange->SetForegroundColour(cLabelRed);
+ lResults->SetForegroundColour(cLabelRed);
+#if 0
+ spInputWidth->SetRange(1, INT_MAX);
+ spInputHeight->SetRange(1, INT_MAX);
+ spOperationMin->SetRange(1, INT_MAX);
+ spOperationMax->SetRange(1, INT_MAX);
+ inputSizer->Fit(spInputWidth);
+ inputSizer->Fit(spInputHeight);
+ inputSizer->Fit(spOperationMin);
+ inputSizer->Fit(spOperationMax);
+ mainSizer->Layout();
+#endif
+ cbOperation->SetSelection(0);
+ spOperationMin->Enable(false);
+ spOperationMax->Enable(false);
+ SetTitle(nlWx[0]);
+#if 0
+ RestorePosition();
+#endif
+ }
+
+ /* __CHANGE__ 012: Release resources allocated by local variables.
+ */
+
+
+
+#line 656 "WximgszFrame.wxc"
+}
+
+
+#line 659 "WximgszFrame.wxc"
+
+
+
+WximgszFrame::~WximgszFrame()
+{
+
+
+#line 665 "WximgszFrame.wxc"
+
+ /* __CHANGE__ 011: Release resources allocated by further class members.
+ */
+
+
+
+#line 670 "WximgszFrame.wxc"
+}
+
+
+
+bool
+WximgszFrame::CanClose(bool WXUNUSED(isLast))
+{
+ bool back = true;
+
+
+#line 679 "WximgszFrame.wxc"
+
+ /* __CHANGE__ 013: Check for unsaved data.
+ And probably change parameter to "bool WXUNUSED(isLast)"
+ */
+
+
+
+#line 685 "WximgszFrame.wxc"
+ return back;
+}
+
+
+
+void
+WximgszFrame::OnFileOpen(wxCommandEvent & WXUNUSED(event))
+{
+ dkChar buf[DK4_MAX_PATH];
+ dk4_bif_t *pbif;
+ const wxChar *ptrFilePath;
+ bool success = false;
+ int dke;
+ int wxe;
+ int res;
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sTexts[42], sDirectory, wxEmptyString,
+ image_files_to_open, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sTexts[42], sDirectory, wxEmptyString,
+ image_files_to_open, wxOPEN
+ );
+#endif
+
+
+#line 712 "WximgszFrame.wxc"
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ wxFileName wxfn(pa);
+ if (wxfn.FileExists() && wxfn.IsFileReadable()) {
+ sDirectory = dlg.GetDirectory();
+ {
+ wxCStrData sFilePath = pa.c_str();
+ ptrFilePath = (wxChar const *)sFilePath;
+ if (NULL != ptrFilePath) {
+ dke = pAppHelp->GetDkEncoding();
+ wxe = pAppHelp->GetWxEncoding();
+ res = dk4recwx_wxchar_to_dkchar(
+ buf, DK4_SIZEOF(buf,dkChar), dke, ptrFilePath, wxe, NULL
+ );
+ if (0 != res) {
+ pbif = dk4bif_open(buf, 1, NULL, NULL);
+ if (NULL != pbif) {
+ dk4_bif_dim_t w = dk4bif_get_width(pbif);
+ dk4_bif_dim_t h = dk4bif_get_height(pbif);
+ if (
+ ((dk4_im_t)0L < (dk4_im_t)w)
+ && ((dk4_im_t)0L < (dk4_im_t)h)
+ && ((dk4_im_t)(MAXIMGDIM) >= (dk4_im_t)w)
+ && ((dk4_im_t)(MAXIMGDIM) >= (dk4_im_t)h)
+ ) {
+ spInputWidth->SetValue(w);
+ spInputHeight->SetValue(h);
+ success = true;
+ }
+ dk4bif_close(pbif);
+ }
+ }
+ }
+ }
+ if (!(success)) {
+
+#line 747 "WximgszFrame.wxc"
+ wxBitmapType t = bitmap_type_for_name(pa);
+ if (wxBITMAP_TYPE_INVALID != t) {
+
+#line 749 "WximgszFrame.wxc"
+ wxBitmap bm(pa, t);
+ if (bm.IsOk()) {
+ int w = bm.GetWidth();
+ int h = bm.GetHeight();
+ if ((0 < w) && (0 < h)) {
+ spInputWidth->SetValue(w);
+ spInputHeight->SetValue(h);
+ success = true;
+ }
+ else {
+
+#line 759 "WximgszFrame.wxc"
+ wxMessageBox(
+ sTexts[44], sTexts[43],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ else {
+
+#line 766 "WximgszFrame.wxc"
+ wxMessageBox(
+ sTexts[44], sTexts[43],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ else {
+ wxString s(sTexts[49]);
+ s.Append(pa);
+ s.Append(sTexts[50]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ if(success) {
+ Calculations();
+ }
+ }
+ else {
+ if (!(wxfn.FileExists())) {
+
+#line 787 "WximgszFrame.wxc"
+ wxString s(sTexts[45]);
+ s.Append(pa);
+ s.Append(sTexts[46]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ else {
+ if (!(wxfn.IsFileReadable())) {
+
+#line 796 "WximgszFrame.wxc"
+ wxString s(sTexts[47]);
+ s.Append(pa);
+ s.Append(sTexts[48]);
+ wxMessageBox(
+ s,wxString(sTexts[43]),(wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ }
+ }
+
+
+#line 807 "WximgszFrame.wxc"
+ Refresh();
+ Update();
+}
+
+
+void
+WximgszFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 816 "WximgszFrame.wxc"
+ bActive = false;
+
+
+#line 818 "WximgszFrame.wxc"
+ Close();
+}
+
+
+
+void
+WximgszFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
+{
+ wxString text(wxT(""));
+ wxString title(wxT(""));
+
+
+#line 829 "WximgszFrame.wxc"
+ /* Construct message text. */
+ text.Append(sNlWx[0]);
+ text.Append(sNlWx[7]);
+#if 0
+ text.Append(sNlWx[1]);
+#endif
+ text.Append(DKT_VERSION_WX);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[9]);
+ text.Append(sNlWx[2]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[9]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[10]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[13]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[14]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[15]);
+ text.Append(sNlWx[8]);
+
+ /* Construct dialog box title. */
+ title.Append(sTexts[10]);
+ title.Append(sNlWx[0]);
+
+ /* Show dialog box. */
+ wxMessageBox(text, title);
+
+ /* __CHANGE__ 019: Create better about box.
+ */
+
+
+#line 871 "WximgszFrame.wxc"
+}
+
+
+
+void
+WximgszFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 879 "WximgszFrame.wxc"
+ DisplayContents();
+
+
+#line 881 "WximgszFrame.wxc"
+}
+
+
+
+static
+int
+bits_in_int(int x)
+{
+ int back = 0;
+ int test = 1;
+ int done = 0;
+
+ while (0 == done) {
+ if (0 != (x & test)) {
+ if (1 < ++back) {
+ done = 1;
+ }
+ }
+ if ((INT_MAX / 2) >= test) {
+ test = test * 2;
+ if (test > x) {
+ done = 1;
+ }
+ }
+ else {
+ done = 1;
+ }
+ }
+ return back;
+}
+
+
+static
+int
+is_power_of_2(int x)
+{
+ int back = 0;
+ if (1 == bits_in_int(x)) {
+ back = 1;
+ }
+ return back;
+}
+
+
+
+static
+int
+quality_for_fraction(int counter, int denom)
+{
+ int back = 0;
+ if (1 == denom) {
+ back = 1;
+ if (0 != is_power_of_2(counter)) {
+ back = 2;
+ }
+ }
+ else {
+ if (1 == counter) {
+ back = 1;
+ if (0 != is_power_of_2(denom)) {
+ back = 2;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+static
+int
+gcd(int a, int b)
+{
+ int h;
+
+
+#line 956 "WximgszFrame.wxc"
+ while (0 < b) {
+ h = a % b;
+ a = b;
+ b = h;
+ }
+
+#line 961 "WximgszFrame.wxc"
+ return a;
+}
+
+
+/* __CHANGE__ 017: Event handlers for further events.
+*/
+
+void
+WximgszFrame::Calculations(void)
+{
+ wxString s1; /* Width */
+ wxString s2; /* Height */
+ wxString s3; /* Factor */
+ wxString m2(sTexts[36]);
+ wxString m1(sTexts[35]);
+ wxString m0(sTexts[34]);
+ int w_ori; /* Original width */
+ int h_ori; /* Original height */
+ int w_min; /* Minimum width */
+ int h_min; /* Minimum height */
+ int gcd_ori; /* Greatest common divisor original width height */
+ int min; /* Destination range minimum */
+ int max; /* Destination range maximum */
+ int opsel; /* Operation selection */
+ int f_min; /* Minimum factor */
+ int f_max; /* Maximum factor */
+ int nrows; /* Number of table rows */
+ int passno; /* Current pass number (table row index) */
+ int f; /* Current factor */
+ int w; /* Current width */
+ int h; /* Current height */
+ int counter; /* Fraction counter */
+ int denom; /* Fraction denominator */
+ int gcd_fr; /* Fraction greatest common divisor */
+ int q; /* Fraction quality */
+ int i; /* Walk through the columns */
+ bool bDidSkip; /* Flag: Restricted output to 2000 columns */
+
+
+#line 999 "WximgszFrame.wxc"
+ bDidSkip = false;
+ w_ori = spInputWidth->GetValue();
+ h_ori = spInputHeight->GetValue();
+ min = spOperationMin->GetValue();
+ max = spOperationMax->GetValue();
+ opsel = cbOperation->GetSelection();
+ if (0 >= w_ori) { w_ori = 1; }
+ if (0 >= h_ori) { h_ori = 1; }
+ if (0 >= min) { min = 1; }
+ if (0 >= max) { max = 1; }
+ gcd_ori = gcd(w_ori, h_ori);
+ w_min = w_ori / gcd_ori;
+ h_min = h_ori / gcd_ori;
+ f_min = 1;
+ f_max = gcd_ori;
+ switch (opsel) {
+ case 1: {
+ f_min = min / w_min;
+ f_max = max / w_min;
+ if (0 >= f_min) { f_min = 1; }
+ if (0 >= f_max) { f_max = 1; }
+ } break;
+ case 2: {
+ f_min = min / h_min;
+ f_max = max / h_min;
+ if (0 >= f_min) { f_min = 1; }
+ if (0 >= f_max) { f_max = 1; }
+ } break;
+ }
+ nrows = f_max - f_min + 1;
+ if (nrows > maxpass) { nrows = maxpass; bDidSkip = true; }
+ /*
+ Delete old table columns, allocate new columns
+ */
+ passno = tResult->GetNumberRows();
+ tResult->DeleteRows(0, passno);
+ tResult->AppendRows(nrows);
+ /*
+ Fill table
+ */
+ passno = 0;
+ f = f_min;
+ while (passno < nrows) {
+ w = f * w_min;
+ h = f * h_min;
+ gcd_fr = gcd(f, gcd_ori);
+ counter = f / gcd_fr;
+ denom = gcd_ori / gcd_fr;
+ q = quality_for_fraction(counter, denom);
+ s1.Printf(wxT("%d"), w);
+ s2.Printf(wxT("%d"), h);
+ if (1 == denom) {
+ s3.Printf(wxT("%d"), counter);
+ }
+ else {
+ s3.Printf(wxT("%d / %d"), counter, denom);
+ }
+ for (i = 0; i < 4; i++) {
+ tResult->SetCellTextColour(passno, i, cBlack);
+ }
+ tResult->SetCellValue(passno, 0, s1);
+ tResult->SetCellValue(passno, 1, s2);
+ tResult->SetCellValue(passno, 2, s3);
+ switch (q) {
+ case 2: {
+ tResult->SetCellValue(passno, 3, m2);
+ for (i = 0; i < 4; i++) {
+ tResult->SetCellBackgroundColour(
+ passno, i, cGreen
+ );
+ }
+ } break;
+ case 1: {
+ tResult->SetCellValue(passno, 3, m1);
+ for (i = 0; i < 4; i++) {
+ tResult->SetCellBackgroundColour(
+ passno, i, cYellow
+ );
+ }
+ } break;
+ case 0: {
+ tResult->SetCellValue(passno, 3, m0);
+ for (i = 0; i < 4; i++) {
+ tResult->SetCellBackgroundColour(
+ passno, i, cRed
+ );
+ }
+ } break;
+ }
+ tResult->SetCellAlignment(passno, 0, wxALIGN_CENTRE, wxALIGN_CENTRE);
+ tResult->SetCellAlignment(passno, 1, wxALIGN_CENTRE, wxALIGN_CENTRE);
+ tResult->SetCellAlignment(passno, 2, wxALIGN_CENTRE, wxALIGN_CENTRE);
+ tResult->SetCellAlignment(passno, 3, wxALIGN_CENTRE, wxALIGN_CENTRE);
+ passno++;
+ f++;
+ }
+ tResult->AutoSizeColumns();
+ tResult->EnableDragColSize(true);
+ if (bDidSkip) {
+ wxMessageBox( sTexts[39], sTexts[38], (wxOK | wxCENTRE | wxICON_ERROR));
+ }
+
+
+#line 1101 "WximgszFrame.wxc"
+}
+
+
+
+void
+WximgszFrame::OnButtonRun(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1109 "WximgszFrame.wxc"
+ Calculations();
+
+
+#line 1111 "WximgszFrame.wxc"
+ Refresh();
+ Update();
+}
+
+
+
+void
+WximgszFrame::OnChoiceOperation(wxCommandEvent & WXUNUSED(event))
+{
+
+
+#line 1121 "WximgszFrame.wxc"
+ switch (cbOperation->GetSelection()) {
+ case 2 : case 1 : {
+ spOperationMin->Enable();
+ spOperationMax->Enable();
+ } break;
+ default : {
+ spOperationMin->Enable(false);
+ spOperationMax->Enable(false);
+ } break;
+ }
+
+
+#line 1132 "WximgszFrame.wxc"
+ Refresh();
+ Update();
+}
+
+
+/* __CHANGE__ 014: Implementation of further methods.
+*/
+
+
+void
+WximgszFrame::ActivateIdleProcessing(bool fl)
+{
+ bActive = fl;
+}
+
+
+void
+WximgszFrame::ProcessSpecifiedFileName(void)
+{
+ dkChar buf[DK4_MAX_PATH];
+ wxChar const *ptrImageFileName;
+ dk4_bif_t *pbif;
+ int dke;
+ int wxe;
+ int res;
+ bool success;
+
+
+#line 1159 "WximgszFrame.wxc"
+ success = false;
+ wxFileName wxfn(sImageFileName);
+ if (wxfn.FileExists() && wxfn.IsFileReadable()) {
+ wxCStrData csImageFileName = sImageFileName.c_str();
+ ptrImageFileName = (wxChar const *)csImageFileName;
+ if (NULL != ptrImageFileName) {
+
+#line 1165 "WximgszFrame.wxc"
+ dke = pAppHelp->GetDkEncoding();
+ wxe = pAppHelp->GetWxEncoding();
+ res = dk4recwx_wxchar_to_dkchar(
+ buf, DK4_SIZEOF(buf,dkChar), dke, ptrImageFileName, wxe, NULL
+ );
+ if (0 != res) {
+
+#line 1171 "WximgszFrame.wxc"
+ pbif = dk4bif_open(buf, 1, NULL, NULL);
+ if (NULL != pbif) {
+ dk4_bif_dim_t w = dk4bif_get_width(pbif);
+ dk4_bif_dim_t h = dk4bif_get_height(pbif);
+ if (
+ ((dk4_im_t)0L < (dk4_im_t)w)
+ && ((dk4_im_t)0L < (dk4_im_t)h)
+ && ((dk4_im_t)(MAXIMGDIM) >= (dk4_im_t)w)
+ && ((dk4_im_t)(MAXIMGDIM) >= (dk4_im_t)h)
+ ) {
+ spInputWidth->SetValue(w);
+ spInputHeight->SetValue(h);
+ success = true;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1187 "WximgszFrame.wxc"
+ }
+#endif
+ dk4bif_close(pbif);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1193 "WximgszFrame.wxc"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1198 "WximgszFrame.wxc"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1203 "WximgszFrame.wxc"
+ }
+#endif
+ if (!(success)) {
+
+#line 1206 "WximgszFrame.wxc"
+ wxBitmapType t = bitmap_type_for_name(sImageFileName);
+ if (wxBITMAP_TYPE_INVALID != t) {
+
+#line 1208 "WximgszFrame.wxc"
+ wxBitmap bm(sImageFileName, t);
+ if (bm.IsOk()) {
+ int w = bm.GetWidth();
+ int h = bm.GetHeight();
+ if ((0 < w) && (0 < h)) {
+ spInputWidth->SetValue(w);
+ spInputHeight->SetValue(h);
+ success = true;
+ }
+ else {
+
+#line 1218 "WximgszFrame.wxc"
+#if 0
+ wxMessageBox(
+ sTexts[44], sTexts[43],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ }
+ else {
+
+#line 1227 "WximgszFrame.wxc"
+#if 0
+ wxMessageBox(
+ sTexts[44],sTexts[43],(wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ }
+ else {
+
+#line 1235 "WximgszFrame.wxc"
+#if 0
+ wxString s(sTexts[49]);
+ s.Append(sImageFileName);
+ s.Append(sTexts[50]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ }
+ if (success) {
+ Calculations();
+ }
+ }
+ else {
+ if (!(wxfn.FileExists())) {
+
+#line 1251 "WximgszFrame.wxc"
+#if 0
+ wxString s(sTexts[45]);
+ s.Append(sImageFileName);
+ s.Append(sTexts[46]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ else {
+ if (!(wxfn.IsFileReadable())) {
+
+#line 1262 "WximgszFrame.wxc"
+#if 0
+ wxString s(sTexts[47]);
+ s.Append(sImageFileName);
+ s.Append(sTexts[48]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ }
+ }
+
+
+#line 1274 "WximgszFrame.wxc"
+}
+
+/* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+*/
+
+/* __CHANGE__ 008: Remove the request for more events if not needed.
+*/
+
+/* __CHANGE__ 008: Decide about Skip() call.
+ The function name is irritating: Skip() or Skip(true) will continue to
+ process the event, calling default handlers.
+ Skip(false) or handlers without Skip() will skip further processing of the
+ event.
+
+ From the wxWidgets documenation: Skip() should be called for all
+ non-command events to allow the default handling to take place.
+ The command events are, however, normally not skipped as usually a single
+ command such as a button click or menu item selection must only be
+ processed by one handler.
+
+ So my recommendation is to have a Skip() call in the idle event handler.
+*/
+
+void
+WximgszFrame::OnIdle(wxIdleEvent & event)
+{
+ bool rqm = false;
+
+
+#line 1302 "WximgszFrame.wxc"
+ /* __CHANGE__
+ */
+ if (bActive) {
+ switch (cas.GetReaction()) {
+ case Dk4WxAutostartController::REACTION_START : {
+ cas.StartProcessing();
+ ProcessSpecifiedFileName();
+ cas.EndProcessing();
+ Refresh();
+ Update();
+ } break;
+ }
+ if (rqm) { event.RequestMore(); }
+ }
+
+
+#line 1317 "WximgszFrame.wxc"
+ event.Skip();
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WximgszFrame.h b/support/dktools/WximgszFrame.h
new file mode 100644
index 0000000000..078490a1f3
--- /dev/null
+++ b/support/dktools/WximgszFrame.h
@@ -0,0 +1,378 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WximgszFrame.wxc
+*/
+
+/** @file WximgszFrame.h Header file for the WximgszFrame module.
+*/
+
+#ifndef WXIMGSZFRAME_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXIMGSZFRAME_H_INCLUDED 1
+
+
+#line 171 "WximgszFrame.wxc"
+
+
+
+
+#line 175 "WximgszFrame.wxc"
+class WximgszFrame : public Dk4WxFrame
+{
+ private:
+
+ /** Event table for frame.
+ */
+ DECLARE_EVENT_TABLE()
+
+ protected:
+
+ /** Auto start controller.
+ */
+ Dk4WxAutostartController cas;
+
+ /** Dark red text colour for group labels.
+ */
+ wxColour cLabelRed;
+
+ /** Light red background for table cells.
+ */
+ wxColour cRed;
+
+ /** Light green background for table cells.
+ */
+ wxColour cGreen;
+
+ /** Yellow background for table cells.
+ */
+ wxColour cYellow;
+
+ /** Text colour for table cells.
+ */
+ wxColour cBlack;
+
+ /** Image file name to process on autostart.
+ */
+ wxString sImageFileName;
+
+ /** Directory previous image file was read from.
+ */
+ wxString sDirectory;
+
+ /** Localized texts.
+ */
+ wxChar const * const *sTexts;
+
+ /** Non-localized texts.
+ */
+ wxChar const * const *sNlWx;
+
+ /** Non-localized texts.
+ */
+ dkChar const * const *sNlDk;
+
+ /* __CHANGE__ 011: Add further member variables.
+ */
+
+ /** Maximum number of items in grid.
+ */
+ int maxpass;
+
+ /** Have image file name.
+ */
+ bool bImageFileName;
+
+ /** Flag: Application should still respond to onidle.
+ */
+ bool bActive;
+
+ /** Process the file name which was specified on command line.
+ */
+ void
+ ProcessSpecifiedFileName(void);
+
+ /** Flag: GUI ok.
+ */
+ bool dkctGUILayoutOK;
+
+ /** Contents panel.
+ */
+ wxPanel *dkctGUIContentsPanel;
+
+ /** GUI element mainSizer.
+ */
+#line 50 "WximgszFrame.wxc"
+ wxBoxSizer *mainSizer;
+
+ /** GUI element mbMain.
+ */
+#line 16 "WximgszFrame.wxc"
+ wxMenuBar *mbMain;
+
+ /** GUI element menuFile.
+ */
+#line 20 "WximgszFrame.wxc"
+ wxMenu *menuFile;
+
+ /** GUI element menuHelp.
+ */
+#line 35 "WximgszFrame.wxc"
+ wxMenu *menuHelp;
+
+ /** GUI element miFileOpen.
+ */
+#line 25 "WximgszFrame.wxc"
+ wxMenuItem *miFileOpen;
+
+ /** GUI element miFileExit.
+ */
+#line 30 "WximgszFrame.wxc"
+ wxMenuItem *miFileExit;
+
+ /** GUI element miHelpAbout.
+ */
+#line 40 "WximgszFrame.wxc"
+ wxMenuItem *miHelpAbout;
+
+ /** GUI element miHelpContents.
+ */
+#line 45 "WximgszFrame.wxc"
+ wxMenuItem *miHelpContents;
+
+ /** GUI element verticalSizer.
+ */
+#line 56 "WximgszFrame.wxc"
+ wxBoxSizer *verticalSizer;
+
+ /** GUI element contentsSizer.
+ */
+#line 64 "WximgszFrame.wxc"
+ wxBoxSizer *contentsSizer;
+
+ /** GUI element inputSizer.
+ */
+#line 74 "WximgszFrame.wxc"
+ wxGridBagSizer *inputSizer;
+
+ /** GUI element runButtonSizer.
+ */
+#line 90 "WximgszFrame.wxc"
+ wxBoxSizer *runButtonSizer;
+
+ /** GUI element resultSizer.
+ */
+#line 97 "WximgszFrame.wxc"
+ wxBoxSizer *resultSizer;
+
+ /** GUI element lInput.
+ */
+#line 104 "WximgszFrame.wxc"
+ wxStaticText *lInput;
+
+ /** GUI element lInputWidth.
+ */
+#line 110 "WximgszFrame.wxc"
+ wxStaticText *lInputWidth;
+
+ /** GUI element spInputWidth.
+ */
+#line 116 "WximgszFrame.wxc"
+ wxSpinCtrl *spInputWidth;
+
+ /** GUI element lInputHeight.
+ */
+#line 113 "WximgszFrame.wxc"
+ wxStaticText *lInputHeight;
+
+ /** GUI element spInputHeight.
+ */
+#line 137 "WximgszFrame.wxc"
+ wxSpinCtrl *spInputHeight;
+
+ /** GUI element lChange.
+ */
+#line 142 "WximgszFrame.wxc"
+ wxStaticText *lChange;
+
+ /** GUI element lOperation.
+ */
+#line 145 "WximgszFrame.wxc"
+ wxStaticText *lOperation;
+
+ /** GUI element cbOperation.
+ */
+#line 148 "WximgszFrame.wxc"
+ wxChoice *cbOperation;
+
+ /** GUI element lOperationMin.
+ */
+#line 154 "WximgszFrame.wxc"
+ wxStaticText *lOperationMin;
+
+ /** GUI element spOperationMin.
+ */
+#line 157 "WximgszFrame.wxc"
+ wxSpinCtrl *spOperationMin;
+
+ /** GUI element lOperationMax.
+ */
+#line 162 "WximgszFrame.wxc"
+ wxStaticText *lOperationMax;
+
+ /** GUI element spOperationMax.
+ */
+#line 165 "WximgszFrame.wxc"
+ wxSpinCtrl *spOperationMax;
+
+ /** GUI element bRun.
+ */
+#line 121 "WximgszFrame.wxc"
+ wxBitmapButton *bRun;
+
+ /** GUI element lResults.
+ */
+#line 107 "WximgszFrame.wxc"
+ wxStaticText *lResults;
+
+ /** GUI element tResult.
+ */
+#line 126 "WximgszFrame.wxc"
+ wxGrid *tResult;
+
+
+#line 250 "WximgszFrame.wxc"
+
+ public:
+
+ /** Window IDs used in main window (frame).
+ */
+ enum {
+ ID_FRAME = (wxID_HIGHEST + 1), /**< Frame. */
+ ID_HELP_ABOUT , /**< Open information dialog box. */
+ ID_HELP_TOC , /**< Open help table of contents. */
+ ID_BUTTON_RUN , /**< Button to run calculation. */
+ ID_CHOICE_OP , /**< Choice box for operation. */
+ };
+
+ /** Maximum number of passes.
+ */
+ enum {
+ MAXPASS = 2000
+ };
+
+ /** Maximum image dimension adjustable in spin control.
+ */
+ enum {
+ /** Maximum image dimension adjustable in spin control.
+ */
+ MAXIMGDIM = 65535
+ };
+
+ /** Constructor.
+ @param wxid Window ID.
+ @param applicationHelper Application helper object.
+ @param hc Help controller for online help.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @param localizedTexts Localized wxChar texts.
+ @param nlWx Non-localized wxChar texts.
+ @param nlDk Non-localized dkChar texts.
+ */
+ WximgszFrame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ int argc,
+ wxChar **argv,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk
+ );
+
+ /** Destructor.
+ */
+ ~WximgszFrame();
+
+ /** Check whether we can close the window.
+ @param isLast Flag: Last main window to close.
+ */
+ bool
+ CanClose(bool isFinal);
+
+ /** Handler for File/Open.
+ @param event Event to process.
+ */
+ void
+ OnFileOpen(wxCommandEvent & event);
+
+ /** Handler for File/Exit.
+ @param event Event to process.
+ */
+ void
+ OnQuit(wxCommandEvent & event);
+
+ /** Handler for Help/About.
+ @param event Event to process.
+ */
+ void
+ OnAbout(wxCommandEvent & event);
+
+ /** Handler for Help/Contents.
+ @param event Event to process.
+ */
+ void
+ OnHelpContents(wxCommandEvent & event);
+
+ /** Do the calculations and update table.
+ */
+ void
+ Calculations(void);
+
+ /** Handler for Run button.
+ @param event Event to process.
+ */
+ void
+ OnButtonRun(wxCommandEvent & event);
+
+ /** Handler for operations choice box.
+ @param event Event to process.
+ */
+ void
+ OnChoiceOperation(wxCommandEvent & event);
+
+ /* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+ */
+ /** Handler for idle events.
+ */
+ void
+ OnIdle(wxIdleEvent & event);
+
+ /* __CHANGE__ 017: Event handlers for further events.
+ */
+
+ /* __CHANGE__ 014: Add further methods.
+ */
+
+ /** Activate or deactivate idle processing.
+ @param fl Flag to activate/deactivate.
+ */
+ void
+ ActivateIdleProcessing(bool fl = true);
+
+};
+
+
+#line 371 "WximgszFrame.wxc"
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/WximgszFrame.wxc b/support/dktools/WximgszFrame.wxc
new file mode 100644
index 0000000000..78bfa39b62
--- /dev/null
+++ b/support/dktools/WximgszFrame.wxc
@@ -0,0 +1,1321 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% wx-gui
+
+type = frame
+contents = mainSizer
+icon = wximgsz_icon
+status bar = 1 sTexts[8]
+menu bar = mbMain
+
+[wxMenuBar mbMain]
+contents = menuFile
+contents = menuHelp
+
+[wxMenu menuFile]
+text = sTexts[0]
+contents = miFileOpen
+contents = miFileExit
+
+[wxMenuItem miFileOpen]
+id = wxID_OPEN
+text = sTexts[40]
+tip = sTexts[41]
+
+[wxMenuItem miFileExit]
+id = wxID_EXIT
+text = sTexts[1]
+tip = sTexts[2]
+
+[wxMenu menuHelp]
+text = sTexts[3]
+contents = miHelpAbout
+contents = miHelpContents
+
+[wxMenuItem miHelpAbout]
+id = WximgszFrame::ID_HELP_ABOUT
+text = sTexts[4]
+tip = sTexts[5]
+
+[wxMenuItem miHelpContents]
+id = WximgszFrame::ID_HELP_TOC
+text = sTexts[6]
+tip = sTexts[7]
+
+[wxBoxSizer mainSizer]
+direction = horizontal
+contents = $space(10)
+contents = verticalSizer
+contents = $space(10)
+
+[wxBoxSizer verticalSizer]
+direction = vertical
+grow = yes
+proportion = 1
+contents = $space(10)
+contents = contentsSizer
+contents = $space(10)
+
+[wxBoxSizer contentsSizer]
+direction = horizontal
+grow = yes
+proportion = 1
+contents = inputSizer
+contents = $space(20,20)
+contents = runButtonSizer
+contents = $space(20,20)
+contents = resultSizer
+
+[wxGridBagSizer inputSizer]
+grid = 5 5
+contents = lInput 0 0 1 2 left
+contents = lInputWidth +1 0 1 1 right centered-y
+contents = spInputWidth . +1 1 1 centered-y
+contents = lInputHeight +1 0 1 1 right centered-y
+contents = spInputHeight . +1 1 1 centered-y
+contents = $space(10) +1 0 1 1
+contents = lChange +1 0 1 2 left
+contents = lOperation +1 0 1 1 right centered-y
+contents = cbOperation . +1 1 1 left centered-y
+contents = lOperationMin +1 0 1 1 right centered-y
+contents = spOperationMin . +1 1 1 left centered-y
+contents = lOperationMax +1 0 1 1 right centered-y
+contents = spOperationMax . +1 1 1 left centered-y
+
+[wxBoxSizer runButtonSizer]
+grow = yes
+direction = vertical
+contents = $stretch(10)
+contents = bRun
+contents = $stretch(10)
+
+[wxBoxSizer resultSizer]
+grow = yes
+proportion = 1
+direction = vertical
+contents = lResults left
+contents = tResult left
+
+[wxStaticText lInput]
+text = sTexts[13]
+
+[wxStaticText lResults]
+text = sTexts[28]
+
+[wxStaticText lInputWidth]
+text = sTexts[14]
+
+[wxStaticText lInputHeight]
+text = sTexts[15]
+
+[wxSpinCtrl spInputWidth]
+value = 1
+range = 1 65535
+tip = sTexts[16]
+
+[wxBitmapButton bRun]
+tip = sTexts[29]
+bitmap = xpm_run_conversion
+id = ID_BUTTON_RUN
+
+[wxGrid tResult]
+text style = readonly
+column head = sTexts[30]
+column head = sTexts[31]
+column head = sTexts[32]
+column head = sTexts[33]
+rows = 4
+# minimum size = 150 100
+grow = true
+proportion = 1
+
+[wxSpinCtrl spInputHeight]
+value = 1
+range = 1 65535
+tip = sTexts[17]
+
+[wxStaticText lChange]
+text = sTexts[18]
+
+[wxStaticText lOperation]
+text = sTexts[19]
+
+[wxChoice cbOperation]
+id = ID_CHOICE_OP
+choices = 3 saOperation
+tip = sTexts[20]
+proportion = 1
+
+[wxStaticText lOperationMin]
+text = sTexts[24]
+
+[wxSpinCtrl spOperationMin]
+value = 1
+range = 1 65535
+tip = sTexts[26]
+
+[wxStaticText lOperationMax]
+text = sTexts[25]
+
+[wxSpinCtrl spOperationMax]
+value = 1
+range = 1 65535
+tip = sTexts[27]
+
+%% header start
+
+
+
+%% class start
+class WximgszFrame : public Dk4WxFrame
+{
+ private:
+
+ /** Event table for frame.
+ */
+ DECLARE_EVENT_TABLE()
+
+ protected:
+
+ /** Auto start controller.
+ */
+ Dk4WxAutostartController cas;
+
+ /** Dark red text colour for group labels.
+ */
+ wxColour cLabelRed;
+
+ /** Light red background for table cells.
+ */
+ wxColour cRed;
+
+ /** Light green background for table cells.
+ */
+ wxColour cGreen;
+
+ /** Yellow background for table cells.
+ */
+ wxColour cYellow;
+
+ /** Text colour for table cells.
+ */
+ wxColour cBlack;
+
+ /** Image file name to process on autostart.
+ */
+ wxString sImageFileName;
+
+ /** Directory previous image file was read from.
+ */
+ wxString sDirectory;
+
+ /** Localized texts.
+ */
+ wxChar const * const *sTexts;
+
+ /** Non-localized texts.
+ */
+ wxChar const * const *sNlWx;
+
+ /** Non-localized texts.
+ */
+ dkChar const * const *sNlDk;
+
+ /* __CHANGE__ 011: Add further member variables.
+ */
+
+ /** Maximum number of items in grid.
+ */
+ int maxpass;
+
+ /** Have image file name.
+ */
+ bool bImageFileName;
+
+ /** Flag: Application should still respond to onidle.
+ */
+ bool bActive;
+
+ /** Process the file name which was specified on command line.
+ */
+ void
+ ProcessSpecifiedFileName(void);
+
+%% class end
+
+ public:
+
+ /** Window IDs used in main window (frame).
+ */
+ enum {
+ ID_FRAME = (wxID_HIGHEST + 1), /**< Frame. */
+ ID_HELP_ABOUT , /**< Open information dialog box. */
+ ID_HELP_TOC , /**< Open help table of contents. */
+ ID_BUTTON_RUN , /**< Button to run calculation. */
+ ID_CHOICE_OP , /**< Choice box for operation. */
+ };
+
+ /** Maximum number of passes.
+ */
+ enum {
+ MAXPASS = 2000
+ };
+
+ /** Maximum image dimension adjustable in spin control.
+ */
+ enum {
+ /** Maximum image dimension adjustable in spin control.
+ */
+ MAXIMGDIM = 65535
+ };
+
+ /** Constructor.
+ @param wxid Window ID.
+ @param applicationHelper Application helper object.
+ @param hc Help controller for online help.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @param localizedTexts Localized wxChar texts.
+ @param nlWx Non-localized wxChar texts.
+ @param nlDk Non-localized dkChar texts.
+ */
+ WximgszFrame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ int argc,
+ wxChar **argv,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk
+ );
+
+ /** Destructor.
+ */
+ ~WximgszFrame();
+
+ /** Check whether we can close the window.
+ @param isLast Flag: Last main window to close.
+ */
+ bool
+ CanClose(bool isFinal);
+
+ /** Handler for File/Open.
+ @param event Event to process.
+ */
+ void
+ OnFileOpen(wxCommandEvent & event);
+
+ /** Handler for File/Exit.
+ @param event Event to process.
+ */
+ void
+ OnQuit(wxCommandEvent & event);
+
+ /** Handler for Help/About.
+ @param event Event to process.
+ */
+ void
+ OnAbout(wxCommandEvent & event);
+
+ /** Handler for Help/Contents.
+ @param event Event to process.
+ */
+ void
+ OnHelpContents(wxCommandEvent & event);
+
+ /** Do the calculations and update table.
+ */
+ void
+ Calculations(void);
+
+ /** Handler for Run button.
+ @param event Event to process.
+ */
+ void
+ OnButtonRun(wxCommandEvent & event);
+
+ /** Handler for operations choice box.
+ @param event Event to process.
+ */
+ void
+ OnChoiceOperation(wxCommandEvent & event);
+
+ /* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+ */
+ /** Handler for idle events.
+ */
+ void
+ OnIdle(wxIdleEvent & event);
+
+ /* __CHANGE__ 017: Event handlers for further events.
+ */
+
+ /* __CHANGE__ 014: Add further methods.
+ */
+
+ /** Activate or deactivate idle processing.
+ @param fl Flag to activate/deactivate.
+ */
+ void
+ ActivateIdleProcessing(bool fl = true);
+
+};
+
+%% header end
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module start
+
+#include "wximgsz.h"
+
+
+#if !defined(__WXMSW__)
+#include "gui-img/icons/dkicon.xpm"
+#endif
+
+
+#include "gui-img/shared/toolbar/run-conversion.xpm"
+
+
+$!trace-include
+
+
+
+/* __CHANGE__ 017: Add further events. */
+
+/* Hint: Window IDs for main frame members are defined in an enum
+ in the frame class.
+ IDs defined in this enum should have WximgszFrame:: prepended
+ for an optical distinction from predefined window IDs (i.e. from
+ wxWidgets).
+*/
+
+/* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+ When removing the table entry here, remove the entire OnIdle() method.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WximgszFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WximgszFrame,wxFrame)
+#endif
+ EVT_MENU(\
+ wxID_OPEN,\
+ WximgszFrame::OnFileOpen\
+ )
+ EVT_MENU(\
+ wxID_EXIT,\
+ WximgszFrame::OnQuit\
+ )
+ EVT_MENU(\
+ WximgszFrame::ID_HELP_ABOUT,\
+ WximgszFrame::OnAbout\
+ )
+ EVT_MENU(\
+ WximgszFrame::ID_HELP_TOC,\
+ WximgszFrame::OnHelpContents\
+ )
+ EVT_BUTTON(\
+ WximgszFrame::ID_BUTTON_RUN,\
+ WximgszFrame::OnButtonRun\
+ )
+ EVT_CHOICE(\
+ WximgszFrame::ID_CHOICE_OP,\
+ WximgszFrame::OnChoiceOperation\
+ )
+ EVT_IDLE(\
+ WximgszFrame::OnIdle\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
+END_EVENT_TABLE()
+#endif
+
+
+
+/** Image file types we can handle.
+*/
+static wxChar const image_files_to_open[] = {
+ wxT("All files (*.*)|*.*")
+#if wxUSE_LIBPNG
+ wxT("|PNG files (*.png)|*.png")
+#endif
+#if wxUSE_LIBJPEG
+ wxT("|JPEG files (*.jpeg)|*.jpeg")
+ wxT("|JPEG files (*.jpg)|*.jpg")
+#endif
+#if wxUSE_LIBTIFF
+ wxT("|TIFF files (*.tiff)|*.tiff")
+ wxT("|TIFF files (*.tif)|*.tif")
+#endif
+#if wxUSE_GIF
+ wxT("|GIF files (*.gif)|*.gif")
+#endif
+#if wxUSE_PCX
+ wxT("|PCX files (*.pcx)|*.pcx")
+#endif
+ wxT("|BMP files (*.bmp)|*.bmp")
+#if wxUSE_ICO_CUR
+ wxT("|ICO files (*.ico)|*.ico")
+ wxT("|CUR files (*.cur)|*.cur")
+#endif
+#if wxUSE_XPM
+ wxT("|XPM files (*.xpm)|*.xpm")
+ wxT("|XBM files (*.xbm)|*.xbm")
+#endif
+#if wxUSE_TGA
+ wxT("|TGA files (*.tga)|*.tga")
+#endif
+#if wxUSE_IFF
+ wxT("|IFF files (*.iff)|*.iff")
+#endif
+ wxT("|ANI files (*.ani)|*.ani")
+#if wxUSE_PNM
+ wxT("|NetPBM files (*.pam)|*.pam")
+ wxT("|NetPBM files (*.pnm)|*.pnm")
+ wxT("|NetPBM files (*.ppm)|*.ppm")
+ wxT("|NetPBM files (*.pgm)|*.pgm")
+ wxT("|NetPBM files (*.pbm)|*.pbm")
+#endif
+};
+
+
+/** Suffix and bitmap type relationship.
+*/
+typedef struct {
+ wxChar const *s; /**< File name suffix. */
+ wxBitmapType t; /**< Bitmap type. */
+} Suffix_and_type_t;
+
+
+
+/** Array to assign file name suffixes to file types.
+*/
+Suffix_and_type_t suffix_and_type[] = {
+#if wxUSE_LIBPNG
+ { wxT(".png"), wxBITMAP_TYPE_PNG },
+#endif
+#if wxUSE_LIBJPEG
+ { wxT(".jpeg"), wxBITMAP_TYPE_JPEG },
+ { wxT(".jpg"), wxBITMAP_TYPE_JPEG },
+#endif
+#if wxUSE_LIBTIFF
+ { wxT(".tiff"), wxBITMAP_TYPE_TIFF },
+ { wxT(".tif"), wxBITMAP_TYPE_TIF },
+#endif
+#if wxUSE_PNM
+ { wxT(".pam"), wxBITMAP_TYPE_PNM },
+ { wxT(".pnm"), wxBITMAP_TYPE_PNM },
+ { wxT(".ppm"), wxBITMAP_TYPE_PNM },
+ { wxT(".pgm"), wxBITMAP_TYPE_PNM },
+ { wxT(".pbm"), wxBITMAP_TYPE_PNM },
+#endif
+#if wxUSE_XPM
+ { wxT(".xpm"), wxBITMAP_TYPE_XPM },
+ { wxT(".xbm"), wxBITMAP_TYPE_XBM },
+#endif
+#if wxUSE_ICO_CUR
+ { wxT(".ico"), wxBITMAP_TYPE_ICO },
+ { wxT(".cur"), wxBITMAP_TYPE_CUR },
+#endif
+#if wxUSE_GIF
+ { wxT(".gif"), wxBITMAP_TYPE_GIF },
+#endif
+#if wxUSE_PCX
+ { wxT(".pcx"), wxBITMAP_TYPE_PCX },
+#endif
+ { wxT(".bmp"), wxBITMAP_TYPE_BMP },
+#if wxUSE_TGA
+ { wxT(".tga"), wxBITMAP_TYPE_TGA },
+#endif
+#if wxUSE_IFF
+ { wxT(".iff"), wxBITMAP_TYPE_IFF },
+#endif
+ { wxT(".ani"), wxBITMAP_TYPE_ANI },
+ { NULL, wxBITMAP_TYPE_INVALID }
+};
+
+
+
+static
+wxBitmapType
+bitmap_type_for_name(wxString & fn)
+{
+ wxChar const *ptr = NULL;
+ Suffix_and_type_t *sat = NULL;
+ wxBitmapType back = wxBITMAP_TYPE_INVALID;
+ wxCStrData strdata = fn.c_str();
+ ptr = (wxChar const *)strdata;
+ if (NULL != ptr) {
+ ptr = dk4strx_get_path_suffix(ptr, NULL);
+ if (NULL != ptr) {
+ sat = suffix_and_type;
+ while((NULL != sat->s) && (wxBITMAP_TYPE_INVALID == back)) {
+ if (0 == dk4strx_casecmp(sat->s, ptr)) {
+ back = sat->t;
+ }
+ else {
+ sat++;
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+%% constructor start
+WximgszFrame::WximgszFrame(
+ int wxid,
+ Dk4WxApplicationHelper *applicationHelper,
+ Dk4WxHelpController *hc,
+ int argc,
+ wxChar **argv,
+ wxChar const * const *localizedTexts,
+ wxChar const * const *nlWx,
+ dkChar const * const *nlDk
+) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid),
+ cas(),
+ cLabelRed(127, 0, 0),
+ cRed(255, 91, 91),
+ cGreen(127, 255, 127),
+ cYellow(255, 255, 0),
+ cBlack(0, 0, 0),
+ sImageFileName((1 < argc)?(argv[1]):(wxT(""))),
+ sDirectory(wxEmptyString)
+{
+ wxString saOperation[] = {
+ wxString(localizedTexts[21]),
+ wxString(localizedTexts[22]),
+ wxString(localizedTexts[23])
+ };
+ $? "+ WximgszFrame::WximgszFrame"
+ /* __CHANGE__ 012: Add further local variables.
+ */
+
+ /* __CHANGE__ 012: Initialize further local variables.
+ */
+
+ sTexts = localizedTexts;
+ sNlWx = nlWx;
+ sNlDk = nlDk;
+#if defined(__WXMSW__)
+ wxIcon wximgsz_icon(sNlWx[4]);
+#else
+ wxIcon wximgsz_icon(xpm_dkicon);
+#endif
+
+ /* __CHANGE__ 011: Initialize further class members.
+ */
+ maxpass = MAXPASS;
+ bActive = false;
+ bImageFileName = false;
+ if (1 < argc) {
+ bImageFileName = true;
+ cas.SetAutoStart();
+ }
+
+%% constructor end
+ if(dkctGUILayoutOK) {
+ lInput->SetForegroundColour(cLabelRed);
+ lChange->SetForegroundColour(cLabelRed);
+ lResults->SetForegroundColour(cLabelRed);
+#if 0
+ spInputWidth->SetRange(1, INT_MAX);
+ spInputHeight->SetRange(1, INT_MAX);
+ spOperationMin->SetRange(1, INT_MAX);
+ spOperationMax->SetRange(1, INT_MAX);
+ inputSizer->Fit(spInputWidth);
+ inputSizer->Fit(spInputHeight);
+ inputSizer->Fit(spOperationMin);
+ inputSizer->Fit(spOperationMax);
+ mainSizer->Layout();
+#endif
+ cbOperation->SetSelection(0);
+ spOperationMin->Enable(false);
+ spOperationMax->Enable(false);
+ SetTitle(nlWx[0]);
+#if 0
+ RestorePosition();
+#endif
+ }
+
+ /* __CHANGE__ 012: Release resources allocated by local variables.
+ */
+
+ $? "- WximgszFrame::WximgszFrame"
+}
+
+%% module end
+
+
+
+WximgszFrame::~WximgszFrame()
+{
+ $? "+ WximgszFrame::~WximgszFrame"
+
+ /* __CHANGE__ 011: Release resources allocated by further class members.
+ */
+
+ $? "- WximgszFrame::~WximgszFrame"
+}
+
+
+
+bool
+WximgszFrame::CanClose(bool WXUNUSED(isLast))
+{
+ bool back = true;
+ $? "+ WximgszFrame::CanClose"
+
+ /* __CHANGE__ 013: Check for unsaved data.
+ And probably change parameter to "bool WXUNUSED(isLast)"
+ */
+
+ $? "- WximgszFrame::CanClose %d", (back ? 1 : 0)
+ return back;
+}
+
+
+
+void
+WximgszFrame::OnFileOpen(wxCommandEvent & WXUNUSED(event))
+{
+ dkChar buf[DK4_MAX_PATH];
+ dk4_bif_t *pbif;
+ const wxChar *ptrFilePath;
+ bool success = false;
+ int dke;
+ int wxe;
+ int res;
+#if wxCHECK_VERSION(2, 9, 0)
+ wxFileDialog dlg(
+ this, sTexts[42], sDirectory, wxEmptyString,
+ image_files_to_open, (wxFD_OPEN | wxFD_FILE_MUST_EXIST)
+ );
+#else
+ wxFileDialog dlg(
+ this, sTexts[42], sDirectory, wxEmptyString,
+ image_files_to_open, wxOPEN
+ );
+#endif
+ $? "+ OnFileOpen"
+ if(wxID_OK == dlg.ShowModal()) {
+ wxString pa = dlg.GetPath();
+ wxFileName wxfn(pa);
+ if (wxfn.FileExists() && wxfn.IsFileReadable()) {
+ sDirectory = dlg.GetDirectory();
+ {
+ wxCStrData sFilePath = pa.c_str();
+ ptrFilePath = (wxChar const *)sFilePath;
+ if (NULL != ptrFilePath) {
+ dke = pAppHelp->GetDkEncoding();
+ wxe = pAppHelp->GetWxEncoding();
+ res = dk4recwx_wxchar_to_dkchar(
+ buf, DK4_SIZEOF(buf,dkChar), dke, ptrFilePath, wxe, NULL
+ );
+ if (0 != res) {
+ pbif = dk4bif_open(buf, 1, NULL, NULL);
+ if (NULL != pbif) {
+ dk4_bif_dim_t w = dk4bif_get_width(pbif);
+ dk4_bif_dim_t h = dk4bif_get_height(pbif);
+ if (
+ ((dk4_im_t)0L < (dk4_im_t)w)
+ && ((dk4_im_t)0L < (dk4_im_t)h)
+ && ((dk4_im_t)(MAXIMGDIM) >= (dk4_im_t)w)
+ && ((dk4_im_t)(MAXIMGDIM) >= (dk4_im_t)h)
+ ) {
+ spInputWidth->SetValue(w);
+ spInputHeight->SetValue(h);
+ success = true;
+ }
+ dk4bif_close(pbif);
+ }
+ }
+ }
+ }
+ if (!(success)) { $? ". no success yet"
+ wxBitmapType t = bitmap_type_for_name(pa);
+ if (wxBITMAP_TYPE_INVALID != t) { $? ". file suffix ok"
+ wxBitmap bm(pa, t);
+ if (bm.IsOk()) {
+ int w = bm.GetWidth();
+ int h = bm.GetHeight();
+ if ((0 < w) && (0 < h)) {
+ spInputWidth->SetValue(w);
+ spInputHeight->SetValue(h);
+ success = true;
+ }
+ else { $? "! dimensions"
+ wxMessageBox(
+ sTexts[44], sTexts[43],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ else { $? "! bitmap not ok"
+ wxMessageBox(
+ sTexts[44], sTexts[43],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ else {
+ wxString s(sTexts[49]);
+ s.Append(pa);
+ s.Append(sTexts[50]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ if(success) {
+ Calculations();
+ }
+ }
+ else {
+ if (!(wxfn.FileExists())) { $? "! no such file"
+ wxString s(sTexts[45]);
+ s.Append(pa);
+ s.Append(sTexts[46]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ else {
+ if (!(wxfn.IsFileReadable())) { $? "! permissions"
+ wxString s(sTexts[47]);
+ s.Append(pa);
+ s.Append(sTexts[48]);
+ wxMessageBox(
+ s,wxString(sTexts[43]),(wxOK | wxCENTRE | wxICON_ERROR)
+ );
+ }
+ }
+ }
+ }
+ $? "- OnFileOpen"
+ Refresh();
+ Update();
+}
+
+
+void
+WximgszFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ WximgszFrame::OnQuit"
+ bActive = false;
+ $? "- WximgszFrame::OnQuit"
+ Close();
+}
+
+
+
+void
+WximgszFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
+{
+ wxString text(wxT(""));
+ wxString title(wxT(""));
+ $? "+ WximgszFrame::OnAbout"
+ /* Construct message text. */
+ text.Append(sNlWx[0]);
+ text.Append(sNlWx[7]);
+#if 0
+ text.Append(sNlWx[1]);
+#endif
+ text.Append(DKT_VERSION_WX);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[9]);
+ text.Append(sNlWx[2]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[9]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[8]);
+ text.Append(sTexts[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[10]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[11]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[12]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[13]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[14]);
+ text.Append(sNlWx[8]);
+ text.Append(sNlWx[15]);
+ text.Append(sNlWx[8]);
+
+ /* Construct dialog box title. */
+ title.Append(sTexts[10]);
+ title.Append(sNlWx[0]);
+
+ /* Show dialog box. */
+ wxMessageBox(text, title);
+
+ /* __CHANGE__ 019: Create better about box.
+ */
+ $? "- WximgszFrame::OnAbout"
+}
+
+
+
+void
+WximgszFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ WximgszFrame::OnHelpContents"
+ DisplayContents();
+ $? "- WximgszFrame::OnHelpContents"
+}
+
+
+
+static
+int
+bits_in_int(int x)
+{
+ int back = 0;
+ int test = 1;
+ int done = 0;
+
+ while (0 == done) {
+ if (0 != (x & test)) {
+ if (1 < ++back) {
+ done = 1;
+ }
+ }
+ if ((INT_MAX / 2) >= test) {
+ test = test * 2;
+ if (test > x) {
+ done = 1;
+ }
+ }
+ else {
+ done = 1;
+ }
+ }
+ return back;
+}
+
+
+static
+int
+is_power_of_2(int x)
+{
+ int back = 0;
+ if (1 == bits_in_int(x)) {
+ back = 1;
+ }
+ return back;
+}
+
+
+
+static
+int
+quality_for_fraction(int counter, int denom)
+{
+ int back = 0;
+ if (1 == denom) {
+ back = 1;
+ if (0 != is_power_of_2(counter)) {
+ back = 2;
+ }
+ }
+ else {
+ if (1 == counter) {
+ back = 1;
+ if (0 != is_power_of_2(denom)) {
+ back = 2;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+static
+int
+gcd(int a, int b)
+{
+ int h;
+ $? "+ gcd a=%d b=%d", a, b
+ while (0 < b) {
+ h = a % b;
+ a = b;
+ b = h;
+ } $? "- gcd %d", a
+ return a;
+}
+
+
+/* __CHANGE__ 017: Event handlers for further events.
+*/
+
+void
+WximgszFrame::Calculations(void)
+{
+ wxString s1; /* Width */
+ wxString s2; /* Height */
+ wxString s3; /* Factor */
+ wxString m2(sTexts[36]);
+ wxString m1(sTexts[35]);
+ wxString m0(sTexts[34]);
+ int w_ori; /* Original width */
+ int h_ori; /* Original height */
+ int w_min; /* Minimum width */
+ int h_min; /* Minimum height */
+ int gcd_ori; /* Greatest common divisor original width height */
+ int min; /* Destination range minimum */
+ int max; /* Destination range maximum */
+ int opsel; /* Operation selection */
+ int f_min; /* Minimum factor */
+ int f_max; /* Maximum factor */
+ int nrows; /* Number of table rows */
+ int passno; /* Current pass number (table row index) */
+ int f; /* Current factor */
+ int w; /* Current width */
+ int h; /* Current height */
+ int counter; /* Fraction counter */
+ int denom; /* Fraction denominator */
+ int gcd_fr; /* Fraction greatest common divisor */
+ int q; /* Fraction quality */
+ int i; /* Walk through the columns */
+ bool bDidSkip; /* Flag: Restricted output to 2000 columns */
+ $? "+ Calculations"
+ bDidSkip = false;
+ w_ori = spInputWidth->GetValue();
+ h_ori = spInputHeight->GetValue();
+ min = spOperationMin->GetValue();
+ max = spOperationMax->GetValue();
+ opsel = cbOperation->GetSelection();
+ if (0 >= w_ori) { w_ori = 1; }
+ if (0 >= h_ori) { h_ori = 1; }
+ if (0 >= min) { min = 1; }
+ if (0 >= max) { max = 1; }
+ gcd_ori = gcd(w_ori, h_ori);
+ w_min = w_ori / gcd_ori;
+ h_min = h_ori / gcd_ori;
+ f_min = 1;
+ f_max = gcd_ori;
+ switch (opsel) {
+ case 1: {
+ f_min = min / w_min;
+ f_max = max / w_min;
+ if (0 >= f_min) { f_min = 1; }
+ if (0 >= f_max) { f_max = 1; }
+ } break;
+ case 2: {
+ f_min = min / h_min;
+ f_max = max / h_min;
+ if (0 >= f_min) { f_min = 1; }
+ if (0 >= f_max) { f_max = 1; }
+ } break;
+ }
+ nrows = f_max - f_min + 1;
+ if (nrows > maxpass) { nrows = maxpass; bDidSkip = true; }
+ /*
+ Delete old table columns, allocate new columns
+ */
+ passno = tResult->GetNumberRows();
+ tResult->DeleteRows(0, passno);
+ tResult->AppendRows(nrows);
+ /*
+ Fill table
+ */
+ passno = 0;
+ f = f_min;
+ while (passno < nrows) {
+ w = f * w_min;
+ h = f * h_min;
+ gcd_fr = gcd(f, gcd_ori);
+ counter = f / gcd_fr;
+ denom = gcd_ori / gcd_fr;
+ q = quality_for_fraction(counter, denom);
+ s1.Printf(wxT("%d"), w);
+ s2.Printf(wxT("%d"), h);
+ if (1 == denom) {
+ s3.Printf(wxT("%d"), counter);
+ }
+ else {
+ s3.Printf(wxT("%d / %d"), counter, denom);
+ }
+ for (i = 0; i < 4; i++) {
+ tResult->SetCellTextColour(passno, i, cBlack);
+ }
+ tResult->SetCellValue(passno, 0, s1);
+ tResult->SetCellValue(passno, 1, s2);
+ tResult->SetCellValue(passno, 2, s3);
+ switch (q) {
+ case 2: {
+ tResult->SetCellValue(passno, 3, m2);
+ for (i = 0; i < 4; i++) {
+ tResult->SetCellBackgroundColour(
+ passno, i, cGreen
+ );
+ }
+ } break;
+ case 1: {
+ tResult->SetCellValue(passno, 3, m1);
+ for (i = 0; i < 4; i++) {
+ tResult->SetCellBackgroundColour(
+ passno, i, cYellow
+ );
+ }
+ } break;
+ case 0: {
+ tResult->SetCellValue(passno, 3, m0);
+ for (i = 0; i < 4; i++) {
+ tResult->SetCellBackgroundColour(
+ passno, i, cRed
+ );
+ }
+ } break;
+ }
+ tResult->SetCellAlignment(passno, 0, wxALIGN_CENTRE, wxALIGN_CENTRE);
+ tResult->SetCellAlignment(passno, 1, wxALIGN_CENTRE, wxALIGN_CENTRE);
+ tResult->SetCellAlignment(passno, 2, wxALIGN_CENTRE, wxALIGN_CENTRE);
+ tResult->SetCellAlignment(passno, 3, wxALIGN_CENTRE, wxALIGN_CENTRE);
+ passno++;
+ f++;
+ }
+ tResult->AutoSizeColumns();
+ tResult->EnableDragColSize(true);
+ if (bDidSkip) {
+ wxMessageBox( sTexts[39], sTexts[38], (wxOK | wxCENTRE | wxICON_ERROR));
+ }
+ $? "- Calculations"
+}
+
+
+
+void
+WximgszFrame::OnButtonRun(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnButtonRun"
+ Calculations();
+ $? "- OnButtonRun"
+ Refresh();
+ Update();
+}
+
+
+
+void
+WximgszFrame::OnChoiceOperation(wxCommandEvent & WXUNUSED(event))
+{
+ $? "+ OnChoiceOperation"
+ switch (cbOperation->GetSelection()) {
+ case 2 : case 1 : {
+ spOperationMin->Enable();
+ spOperationMax->Enable();
+ } break;
+ default : {
+ spOperationMin->Enable(false);
+ spOperationMax->Enable(false);
+ } break;
+ }
+ $? "- OnChoiceOperation"
+ Refresh();
+ Update();
+}
+
+
+/* __CHANGE__ 014: Implementation of further methods.
+*/
+
+
+void
+WximgszFrame::ActivateIdleProcessing(bool fl)
+{
+ bActive = fl;
+}
+
+
+void
+WximgszFrame::ProcessSpecifiedFileName(void)
+{
+ dkChar buf[DK4_MAX_PATH];
+ wxChar const *ptrImageFileName;
+ dk4_bif_t *pbif;
+ int dke;
+ int wxe;
+ int res;
+ bool success;
+ $? "+ ProcessSpecifiedFileName"
+ success = false;
+ wxFileName wxfn(sImageFileName);
+ if (wxfn.FileExists() && wxfn.IsFileReadable()) {
+ wxCStrData csImageFileName = sImageFileName.c_str();
+ ptrImageFileName = (wxChar const *)csImageFileName;
+ if (NULL != ptrImageFileName) { $? ". have wxChar file name"
+ dke = pAppHelp->GetDkEncoding();
+ wxe = pAppHelp->GetWxEncoding();
+ res = dk4recwx_wxchar_to_dkchar(
+ buf, DK4_SIZEOF(buf,dkChar), dke, ptrImageFileName, wxe, NULL
+ );
+ if (0 != res) { $? ". have dkChar file name"
+ pbif = dk4bif_open(buf, 1, NULL, NULL);
+ if (NULL != pbif) {
+ dk4_bif_dim_t w = dk4bif_get_width(pbif);
+ dk4_bif_dim_t h = dk4bif_get_height(pbif);
+ if (
+ ((dk4_im_t)0L < (dk4_im_t)w)
+ && ((dk4_im_t)0L < (dk4_im_t)h)
+ && ((dk4_im_t)(MAXIMGDIM) >= (dk4_im_t)w)
+ && ((dk4_im_t)(MAXIMGDIM) >= (dk4_im_t)h)
+ ) {
+ spInputWidth->SetValue(w);
+ spInputHeight->SetValue(h);
+ success = true;
+ }
+#if TRACE_DEBUG
+ else { $? "! dimensions out of range"
+ }
+#endif
+ dk4bif_close(pbif);
+ }
+#if TRACE_DEBUG
+ else { $? "! failed to open bif"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! no dkChar file name"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! no wxChar file name"
+ }
+#endif
+ if (!(success)) { $? ". not yet succeeded"
+ wxBitmapType t = bitmap_type_for_name(sImageFileName);
+ if (wxBITMAP_TYPE_INVALID != t) { $? ". valid file type"
+ wxBitmap bm(sImageFileName, t);
+ if (bm.IsOk()) {
+ int w = bm.GetWidth();
+ int h = bm.GetHeight();
+ if ((0 < w) && (0 < h)) {
+ spInputWidth->SetValue(w);
+ spInputHeight->SetValue(h);
+ success = true;
+ }
+ else { $? "! dimensions out of range"
+#if 0
+ wxMessageBox(
+ sTexts[44], sTexts[43],
+ (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ }
+ else { $? "! bitmap not ok"
+#if 0
+ wxMessageBox(
+ sTexts[44],sTexts[43],(wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ }
+ else { $? "! invalid file suffix"
+#if 0
+ wxString s(sTexts[49]);
+ s.Append(sImageFileName);
+ s.Append(sTexts[50]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ }
+ if (success) {
+ Calculations();
+ }
+ }
+ else {
+ if (!(wxfn.FileExists())) { $? "! no such file"
+#if 0
+ wxString s(sTexts[45]);
+ s.Append(sImageFileName);
+ s.Append(sTexts[46]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ else {
+ if (!(wxfn.IsFileReadable())) { $? "! permissions"
+#if 0
+ wxString s(sTexts[47]);
+ s.Append(sImageFileName);
+ s.Append(sTexts[48]);
+ wxMessageBox(
+ s, wxString(sTexts[43]), (wxOK | wxCENTRE | wxICON_ERROR)
+ );
+#endif
+ }
+ }
+ }
+ $? "- ProcessSpecifiedFileName"
+}
+
+/* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+*/
+
+/* __CHANGE__ 008: Remove the request for more events if not needed.
+*/
+
+/* __CHANGE__ 008: Decide about Skip() call.
+ The function name is irritating: Skip() or Skip(true) will continue to
+ process the event, calling default handlers.
+ Skip(false) or handlers without Skip() will skip further processing of the
+ event.
+
+ From the wxWidgets documenation: Skip() should be called for all
+ non-command events to allow the default handling to take place.
+ The command events are, however, normally not skipped as usually a single
+ command such as a button click or menu item selection must only be
+ processed by one handler.
+
+ So my recommendation is to have a Skip() call in the idle event handler.
+*/
+
+void
+WximgszFrame::OnIdle(wxIdleEvent & event)
+{
+ bool rqm = false;
+ $? "+ WximgszFrame::OnIdle"
+ /* __CHANGE__
+ */
+ if (bActive) {
+ switch (cas.GetReaction()) {
+ case Dk4WxAutostartController::REACTION_START : {
+ cas.StartProcessing();
+ ProcessSpecifiedFileName();
+ cas.EndProcessing();
+ Refresh();
+ Update();
+ } break;
+ }
+ if (rqm) { event.RequestMore(); }
+ }
+ $? "- WximgszFrame::OnIdle"
+ event.Skip();
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/WxpqdicApp.cpp b/support/dktools/WxpqdicApp.cpp
index 33ed4e0895..4bbc60cce2 100644
--- a/support/dktools/WxpqdicApp.cpp
+++ b/support/dktools/WxpqdicApp.cpp
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WxpqdicApp.cpt
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxpqdicApp.cpt
*/
/** @file WxpqdicApp.cpp The WxpqdicApp module.
*/
-#line 76 "WxpqdicApp.cpt"
+#line 81 "WxpqdicApp.cpt"
#include "wxpqdic.h"
@@ -45,7 +23,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 82 "WxpqdicApp.cpt"
+#line 87 "WxpqdicApp.cpt"
@@ -235,7 +213,7 @@ wxT("An unknown error occured during setup!"),
NULL
-#line 279 "WxpqdicApp.cpt"
+#line 284 "WxpqdicApp.cpt"
};
@@ -274,7 +252,7 @@ wxT("\n"),
wxT("DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib."),
/* 10 */
-wxT("http://dktools.sourceforge.net"),
+wxT("http://sourceforge.net/p/dktools/wiki/Home/"),
/* 11 */
wxT("http://www.wxwidgets.org"),
@@ -306,7 +284,7 @@ wxT("Not enough memory (RAM)!"),
NULL
-#line 346 "WxpqdicApp.cpt"
+#line 351 "WxpqdicApp.cpt"
};
@@ -329,14 +307,19 @@ dkT("wxpqdic.htb"),
NULL
-#line 371 "WxpqdicApp.cpt"
+#line 376 "WxpqdicApp.cpt"
};
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(WxpqdicApp);
+#else
IMPLEMENT_APP(WxpqdicApp)
+#endif
bool
@@ -352,10 +335,10 @@ WxpqdicApp::OnInit()
-#line 392 "WxpqdicApp.cpt"
+#line 402 "WxpqdicApp.cpt"
-#line 393 "WxpqdicApp.cpt"
+#line 403 "WxpqdicApp.cpt"
/* Initialize members.
*/
@@ -376,7 +359,7 @@ WxpqdicApp::OnInit()
if (!(pAh->Initialize(argv[0], wxpqdic_nl_wx[3], wxpqdic_nl_dk[0])))
{
-#line 412 "WxpqdicApp.cpt"
+#line 422 "WxpqdicApp.cpt"
goto finished;
}
@@ -389,6 +372,14 @@ WxpqdicApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -396,6 +387,14 @@ WxpqdicApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -403,6 +402,14 @@ WxpqdicApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phArchiveFS = new wxArchiveFSHandler();
if (NULL != phArchiveFS) {
wxFileSystem::AddHandler(phArchiveFS);
@@ -411,6 +418,13 @@ WxpqdicApp::OnInit()
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
/* Set up help controller.
*/
pHc = new Dk4WxHelpController();
@@ -421,7 +435,7 @@ WxpqdicApp::OnInit()
if (!(pHc->Initialize(pAh, wxpqdic_nl_dk[2], wxpqdic_nl_dk[3])))
{
-#line 455 "WxpqdicApp.cpt"
+#line 496 "WxpqdicApp.cpt"
goto finished;
}
@@ -458,8 +472,8 @@ WxpqdicApp::OnInit()
/* Show frame and indicate success.
*/
- frame->Show();
frame->RestorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed.
@@ -479,12 +493,12 @@ WxpqdicApp::OnInit()
}
-#line 511 "WxpqdicApp.cpt"
+#line 552 "WxpqdicApp.cpt"
#if 0
if(!(back)) {
-#line 514 "WxpqdicApp.cpt"
+#line 555 "WxpqdicApp.cpt"
}
#endif
return back;
@@ -498,7 +512,7 @@ WxpqdicApp::OnExit()
int back = 0;
-#line 526 "WxpqdicApp.cpt"
+#line 567 "WxpqdicApp.cpt"
/* __CHANGE__ 009: Release resources allocated by further members.
*/
if (bSocketsInitialized) {
@@ -518,10 +532,10 @@ WxpqdicApp::OnExit()
}
-#line 544 "WxpqdicApp.cpt"
+#line 585 "WxpqdicApp.cpt"
-#line 545 "WxpqdicApp.cpt"
+#line 586 "WxpqdicApp.cpt"
return back;
}
diff --git a/support/dktools/WxpqdicApp.cpt b/support/dktools/WxpqdicApp.cpt
index bef55e979e..1255afb37e 100644
--- a/support/dktools/WxpqdicApp.cpt
+++ b/support/dktools/WxpqdicApp.cpt
@@ -4,7 +4,7 @@ copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -68,7 +68,12 @@ class WxpqdicApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(WxpqdicApp);
+#else
DECLARE_APP(WxpqdicApp)
+#endif
@@ -326,7 +331,7 @@ aaaaa
# 9 10 11 12 13 14 15: List of libraries used.
#
DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
http://www.wxwidgets.org
http://www.libpng.org/pub/png/libpng.html
http://www.ijg.org
@@ -374,7 +379,12 @@ $!end
/** Implementation of the wxApp functionality.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_APP(WxpqdicApp);
+#else
IMPLEMENT_APP(WxpqdicApp)
+#endif
bool
@@ -421,6 +431,14 @@ WxpqdicApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phPng is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phXpm = new wxXPMHandler();
if (NULL != phXpm) {
wxImage::AddHandler(phXpm);
@@ -428,6 +446,14 @@ WxpqdicApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phXpm is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phIco = new wxICOHandler();
if (NULL != phIco) {
wxImage::AddHandler(phIco);
@@ -435,6 +461,14 @@ WxpqdicApp::OnInit()
ShowMemoryErrorMessage();
goto finished;
}
+
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phIco is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxImage destructor,
+ there is no memory leak.
+ */
+
phArchiveFS = new wxArchiveFSHandler();
if (NULL != phArchiveFS) {
wxFileSystem::AddHandler(phArchiveFS);
@@ -443,6 +477,13 @@ WxpqdicApp::OnInit()
goto finished;
}
+ /* CLANG STATIC ANALYSIS COMPLAINS ABOUT A POTENTIAL MEMORY LEAK,
+ because phArchiveFs is set using the new operator but there is no
+ matching delete.
+ The handler object is deleted from within wxFileSystem destructor,
+ there is no memory leak.
+ */
+
/* Set up help controller.
*/
pHc = new Dk4WxHelpController();
@@ -488,8 +529,8 @@ WxpqdicApp::OnInit()
/* Show frame and indicate success.
*/
- frame->Show();
frame->RestorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed.
diff --git a/support/dktools/WxpqdicApp.h b/support/dktools/WxpqdicApp.h
index e7ddc822f9..f30e928a69 100644
--- a/support/dktools/WxpqdicApp.h
+++ b/support/dktools/WxpqdicApp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WxpqdicApp.cpt
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxpqdicApp.cpt
*/
#ifndef WXPQDICAPP_H_INCLUDED
@@ -98,7 +76,12 @@ class WxpqdicApp : public wxApp
/** Declaration as the wxApp object.
*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxDECLARE_APP(WxpqdicApp);
+#else
DECLARE_APP(WxpqdicApp)
+#endif
diff --git a/support/dktools/WxpqdicFrame.cpp b/support/dktools/WxpqdicFrame.cpp
index 8de45643d3..7e31f57c89 100644
--- a/support/dktools/WxpqdicFrame.cpp
+++ b/support/dktools/WxpqdicFrame.cpp
@@ -1,43 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WxpqdicFrame.wxc
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxpqdicFrame.wxc
*/
/** @file WxpqdicFrame.cpp The WxpqdicFrame module.
*/
-#line 415 "WxpqdicFrame.wxc"
+#line 419 "WxpqdicFrame.wxc"
+
+#include "dk4conf.h"
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#include "wxpqdic.h"
#include "dk4user.h"
@@ -55,33 +41,42 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4numco.h"
-#include "exit-program.xpm"
-#include "run-conversion.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
#include "dk4verswx.h"
#if !defined(__WXMSW__)
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
#endif
-#line 444 "WxpqdicFrame.wxc"
+#line 456 "WxpqdicFrame.wxc"
/* __CHANGE__ 017: Add further events. */
/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
-BEGIN_EVENT_TABLE(WxpqdicFrame, wxFrame)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxpqdicFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WxpqdicFrame,wxFrame)
+#endif
EVT_MENU(WxpqdicFrame_View_Update, WxpqdicFrame::OnRun)
EVT_MENU(WxpqdicFrame_Quit, WxpqdicFrame::OnQuit)
EVT_MENU(WxpqdicFrame_Help_About, WxpqdicFrame::OnAbout)
EVT_MENU(WxpqdicFrame_Help_Contents, WxpqdicFrame::OnHelpContents)
EVT_TIMER(WxpqdicFrame_Timer, WxpqdicFrame::OnTimer)
EVT_IDLE(WxpqdicFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -89,6 +84,11 @@ static const wxChar versionNumber[] = { DKT_VERSION_WX };
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc wxpqdic_cmd_line_entries[] = {
{
wxCMD_LINE_OPTION,
@@ -149,6 +149,9 @@ static const wxCmdLineEntryDesc wxpqdic_cmd_line_entries[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
/** Key names for preferences.
@@ -175,7 +178,7 @@ wxT("printqd.encoding"),
NULL
-#line 537 "WxpqdicFrame.wxc"
+#line 566 "WxpqdicFrame.wxc"
};
@@ -195,12 +198,12 @@ static const char * const wxpqdic_kw[] = {
NULL
-#line 558 "WxpqdicFrame.wxc"
+#line 587 "WxpqdicFrame.wxc"
};
-#line 562 "WxpqdicFrame.wxc"
+#line 591 "WxpqdicFrame.wxc"
WxpqdicFrame::WxpqdicFrame(
int wxid,
Dk4WxApplicationHelper *applicationHelper,
@@ -551,7 +554,7 @@ WxpqdicFrame::WxpqdicFrame(
mainSizer->SetSizeHints(this);
}
-#line 624 "WxpqdicFrame.wxc"
+#line 653 "WxpqdicFrame.wxc"
if(dkctGUILayoutOK) {
SetTitle(nlWx[0]);
}
@@ -562,7 +565,7 @@ WxpqdicFrame::WxpqdicFrame(
}
-#line 634 "WxpqdicFrame.wxc"
+#line 663 "WxpqdicFrame.wxc"
@@ -576,7 +579,7 @@ WxpqdicFrame::~WxpqdicFrame()
bool
-WxpqdicFrame::CanClose(bool isLast)
+WxpqdicFrame::CanClose(bool WXUNUSED(isLast))
{
bool back = true;
@@ -585,7 +588,7 @@ WxpqdicFrame::CanClose(bool isLast)
void
-WxpqdicFrame::OnQuit(wxCommandEvent & event)
+WxpqdicFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
{
wxCriticalSectionLocker lockCsProtect(csProtect);
@@ -610,7 +613,7 @@ WxpqdicFrame::OnQuit(wxCommandEvent & event)
void
-WxpqdicFrame::OnAbout(wxCommandEvent & event)
+WxpqdicFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
@@ -659,7 +662,7 @@ WxpqdicFrame::OnAbout(wxCommandEvent & event)
void
-WxpqdicFrame::OnHelpContents(wxCommandEvent & event)
+WxpqdicFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
DisplayContents();
}
@@ -674,11 +677,14 @@ WxpqdicFrame::OnHelpContents(wxCommandEvent & event)
bool
WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
{
-
+ wxString dummy(wxT(""));
dkChar buf[1024];
char c8b[1024];
dk4_er_t er;
wxChar *pv[] = { NULL, NULL, NULL, NULL, NULL, NULL };
+ wxCStrData hnstrdata = dummy.c_str();
+ wxCStrData qnstrdata = dummy.c_str();
+ wxCStrData unstrdata = dummy.c_str();
const wxChar *cptr;
const size_t szbuf = DK4_SIZEOF(buf,dkChar);
const size_t szc8b = sizeof(c8b);
@@ -691,22 +697,22 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
pAppHelp->GetMultiple(wxpqdic_pref_key_names, pv, 6);
-#line 761 "WxpqdicFrame.wxc"
+#line 793 "WxpqdicFrame.wxc"
-#line 762 "WxpqdicFrame.wxc"
+#line 794 "WxpqdicFrame.wxc"
-#line 763 "WxpqdicFrame.wxc"
+#line 795 "WxpqdicFrame.wxc"
-#line 764 "WxpqdicFrame.wxc"
+#line 796 "WxpqdicFrame.wxc"
-#line 765 "WxpqdicFrame.wxc"
+#line 797 "WxpqdicFrame.wxc"
-#line 766 "WxpqdicFrame.wxc"
+#line 798 "WxpqdicFrame.wxc"
/* Check command line arguments
*/
@@ -719,7 +725,7 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
*/
if (0 != res) {
-#line 777 "WxpqdicFrame.wxc"
+#line 809 "WxpqdicFrame.wxc"
/* ERROR: Failed to parse command line arguments */
*perrc = WXPQDIC_FRAME_ERROR_PARSE;
goto finished;
@@ -744,7 +750,8 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
dk4error_init(&er);
cptr = NULL;
if (parser.Found(wxT_2("h"), &sHostname)) {
- cptr = sHostname.c_str();
+ hnstrdata = sHostname.c_str();
+ cptr = (wxChar const *)hnstrdata;
}
else {
cptr = pv[0];
@@ -754,7 +761,7 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
pHostname = dk4str_dup(buf, NULL);
if (NULL == pHostname) {
-#line 810 "WxpqdicFrame.wxc"
+#line 843 "WxpqdicFrame.wxc"
/* ERROR: Memory */
*perrc = WXPQDIC_FRAME_ERROR_MEMORY;
goto finished;
@@ -775,21 +782,22 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
*/
cptr = NULL;
if (parser.Found(wxT_2("q"), &sQueuename)) {
- cptr = sQueuename.c_str();
+ qnstrdata = sQueuename.c_str();
+ cptr = (wxChar const *)qnstrdata;
}
else {
cptr = pv[2];
}
if (NULL != cptr) {
res = dk4recwx_wxchar_to_char(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
cptr, pAppHelp->GetWxEncoding(), NULL
);
if (0 != res) {
pQueuename = dk4str8_dup(c8b, NULL);
if (NULL == pQueuename) {
-#line 843 "WxpqdicFrame.wxc"
+#line 877 "WxpqdicFrame.wxc"
/* ERROR: Memory */
*perrc = WXPQDIC_FRAME_ERROR_MEMORY;
goto finished;
@@ -876,9 +884,10 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
User name is optional, use current user by default.
*/
if (parser.Found(wxT_2("u"), &sUsername)) {
+ unstrdata = sUsername.c_str();
res = dk4recwx_wxchar_to_char(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
- sUsername.c_str(), pAppHelp->GetWxEncoding(), NULL
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
+ (wxChar const *)unstrdata, pAppHelp->GetWxEncoding(), NULL
);
if (0 != res) {
pUsername = dk4str8_dup(c8b, NULL);
@@ -898,7 +907,7 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
res = dk4user_get_logname(buf, szbuf, 0, NULL);
if (0 != res) {
res = dk4recode_dk_to_any(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
buf, pAppHelp->GetDkEncoding(), NULL
);
if (0 != res) {
@@ -995,7 +1004,7 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
szRequest = dk4str8_len(pRequest);
-#line 1047 "WxpqdicFrame.wxc"
+#line 1082 "WxpqdicFrame.wxc"
} else {
/* ERROR: Memory */
*perrc = WXPQDIC_FRAME_ERROR_MEMORY;
@@ -1021,7 +1030,7 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
-#line 1071 "WxpqdicFrame.wxc"
+#line 1106 "WxpqdicFrame.wxc"
tLimit->SetLabel(sTexts[27]);
tUsed->SetLabel(sTexts[27]);
@@ -1059,7 +1068,7 @@ WxpqdicFrame::OnIdle(wxIdleEvent & event)
bool mustClose = false;
-#line 1107 "WxpqdicFrame.wxc"
+#line 1142 "WxpqdicFrame.wxc"
/* __CHANGE__
*/
{
@@ -1071,7 +1080,7 @@ WxpqdicFrame::OnIdle(wxIdleEvent & event)
}
if (mustClose) {
-#line 1117 "WxpqdicFrame.wxc"
+#line 1152 "WxpqdicFrame.wxc"
const wxChar *ti;
const wxChar *tx;
ti = sTexts[58]; tx = sTexts[59];
@@ -1131,37 +1140,37 @@ WxpqdicFrame::OnIdle(wxIdleEvent & event)
*/
-#line 1175 "WxpqdicFrame.wxc"
+#line 1210 "WxpqdicFrame.wxc"
event.Skip();
}
void
-WxpqdicFrame::OnTimer(wxTimerEvent & event)
+WxpqdicFrame::OnTimer(wxTimerEvent & WXUNUSED(event))
{
bool mustUpdate = false;
-#line 1184 "WxpqdicFrame.wxc"
+#line 1219 "WxpqdicFrame.wxc"
{
wxCriticalSectionLocker lockCsProtect(csProtect);
-#line 1187 "WxpqdicFrame.wxc"
+#line 1222 "WxpqdicFrame.wxc"
if (bIsInitialized) {
-#line 1188 "WxpqdicFrame.wxc"
+#line 1223 "WxpqdicFrame.wxc"
mustUpdate = DataExchangeWithServer();
}
#if TRACE_DEBUG
else {
-#line 1192 "WxpqdicFrame.wxc"
+#line 1227 "WxpqdicFrame.wxc"
}
#endif
-#line 1195 "WxpqdicFrame.wxc"
+#line 1230 "WxpqdicFrame.wxc"
}
if (mustUpdate) {
Refresh();
@@ -1169,7 +1178,7 @@ WxpqdicFrame::OnTimer(wxTimerEvent & event)
}
-#line 1201 "WxpqdicFrame.wxc"
+#line 1236 "WxpqdicFrame.wxc"
}
@@ -1192,11 +1201,11 @@ WxpqdicFrame::ProcessResponse(bool & found)
bool back = false;
-#line 1222 "WxpqdicFrame.wxc"
+#line 1257 "WxpqdicFrame.wxc"
sz = dk4str8_tokenize(tokens, 8, bResponse, NULL, NULL);
if (4 == sz) {
-#line 1224 "WxpqdicFrame.wxc"
+#line 1259 "WxpqdicFrame.wxc"
founddet = 0;
force = bFirstResponse;
switch (iState) {
@@ -1205,14 +1214,14 @@ WxpqdicFrame::ProcessResponse(bool & found)
{
force = true;
-#line 1231 "WxpqdicFrame.wxc"
+#line 1266 "WxpqdicFrame.wxc"
} break;
}
-#line 1233 "WxpqdicFrame.wxc"
+#line 1268 "WxpqdicFrame.wxc"
if (0 == dk4str8_cmp("-1", tokens[0])) {
-#line 1234 "WxpqdicFrame.wxc"
+#line 1269 "WxpqdicFrame.wxc"
limit = DK4_UM_MAX;
founddet |= 1;
} else {
@@ -1221,13 +1230,13 @@ WxpqdicFrame::ProcessResponse(bool & found)
res = dk4ma_input_c8_dec_dk4_um_t(&limit, tokens[0], &ep, 1, NULL);
if (0 != res) {
-#line 1241 "WxpqdicFrame.wxc"
+#line 1276 "WxpqdicFrame.wxc"
founddet |= 1;
}
#if TRACE_DEBUG
else {
-#line 1245 "WxpqdicFrame.wxc"
+#line 1280 "WxpqdicFrame.wxc"
}
#endif
}
@@ -1236,13 +1245,13 @@ WxpqdicFrame::ProcessResponse(bool & found)
res = dk4ma_input_c8_dec_dk4_um_t(&used, tokens[1], &ep, 1, NULL);
if (0 != res) {
-#line 1252 "WxpqdicFrame.wxc"
+#line 1287 "WxpqdicFrame.wxc"
founddet |= 2;
}
#if TRACE_DEBUG
else {
-#line 1256 "WxpqdicFrame.wxc"
+#line 1291 "WxpqdicFrame.wxc"
}
#endif
account = (dk4_um_t)0UL;
@@ -1250,13 +1259,13 @@ WxpqdicFrame::ProcessResponse(bool & found)
res = dk4ma_input_c8_dec_dk4_um_t(&account, tokens[2], &ep, 1, NULL);
if (0 != res) {
-#line 1262 "WxpqdicFrame.wxc"
+#line 1297 "WxpqdicFrame.wxc"
founddet |= 4;
}
#if TRACE_DEBUG
else {
-#line 1266 "WxpqdicFrame.wxc"
+#line 1301 "WxpqdicFrame.wxc"
}
#endif
summary = 0;
@@ -1264,18 +1273,18 @@ WxpqdicFrame::ProcessResponse(bool & found)
res = dk4ma_input_c8_dec_int(&summary, tokens[3], &ep, 1, NULL);
if (0 != res) {
-#line 1272 "WxpqdicFrame.wxc"
+#line 1307 "WxpqdicFrame.wxc"
founddet |= 8;
}
#if TRACE_DEBUG
else {
-#line 1276 "WxpqdicFrame.wxc"
+#line 1311 "WxpqdicFrame.wxc"
}
#endif
if (15 == (15 & founddet)) {
-#line 1279 "WxpqdicFrame.wxc"
+#line 1314 "WxpqdicFrame.wxc"
/* Renew text labels
*/
#if DK4_SIZEOF_WXCHAR > 1
@@ -1318,21 +1327,21 @@ WxpqdicFrame::ProcessResponse(bool & found)
}
back = true;
-#line 1320 "WxpqdicFrame.wxc"
+#line 1355 "WxpqdicFrame.wxc"
}
if ((force) || (used != uUsed)) {
wxString s(tokens[1]);
tUsed->SetLabel(s);
back = true;
-#line 1325 "WxpqdicFrame.wxc"
+#line 1360 "WxpqdicFrame.wxc"
}
if ((force) || (account != uAccount)) {
wxString s(tokens[2]);
tAccount->SetLabel(s);
back = true;
-#line 1330 "WxpqdicFrame.wxc"
+#line 1365 "WxpqdicFrame.wxc"
}
#endif
if ((force) || (summary != iSummary)) {
@@ -1345,7 +1354,7 @@ WxpqdicFrame::ProcessResponse(bool & found)
}
back = true;
-#line 1341 "WxpqdicFrame.wxc"
+#line 1376 "WxpqdicFrame.wxc"
}
if (force) {
lStatus->SetLabel(sNlWx[5]);
@@ -1372,19 +1381,19 @@ WxpqdicFrame::ProcessResponse(bool & found)
#if TRACE_DEBUG
else {
-#line 1366 "WxpqdicFrame.wxc"
+#line 1401 "WxpqdicFrame.wxc"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 1371 "WxpqdicFrame.wxc"
+#line 1406 "WxpqdicFrame.wxc"
}
#endif
-#line 1374 "WxpqdicFrame.wxc"
+#line 1409 "WxpqdicFrame.wxc"
return back;
}
@@ -1401,7 +1410,7 @@ WxpqdicFrame::RetrieveResponse(void)
bool found = false; /* Flag: Found */
-#line 1389 "WxpqdicFrame.wxc"
+#line 1424 "WxpqdicFrame.wxc"
sz = szResponse;
szrema = sizeof(remaddr);
res = dk4socket_recvfrom(
@@ -1414,38 +1423,38 @@ WxpqdicFrame::RetrieveResponse(void)
case DK4_SOCKET_RESULT_IN_PROGRESS :
{
-#line 1400 "WxpqdicFrame.wxc"
+#line 1435 "WxpqdicFrame.wxc"
if (0 < sz) {
-#line 1401 "WxpqdicFrame.wxc"
+#line 1436 "WxpqdicFrame.wxc"
bResponse[(szResponse > sz) ? (sz) : (szResponse - 1)] = '\0';
#if TRACE_DEBUG
dk4str8_delnl(bResponse);
-#line 1404 "WxpqdicFrame.wxc"
+#line 1439 "WxpqdicFrame.wxc"
#endif
if (1 /* ##### TODO: Compare addresses */ ) {
-#line 1406 "WxpqdicFrame.wxc"
+#line 1441 "WxpqdicFrame.wxc"
back = ProcessResponse(found);
}
#if TRACE_DEBUG
else {
-#line 1410 "WxpqdicFrame.wxc"
+#line 1445 "WxpqdicFrame.wxc"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 1415 "WxpqdicFrame.wxc"
+#line 1450 "WxpqdicFrame.wxc"
}
#endif
} break;
default : {
-#line 1419 "WxpqdicFrame.wxc"
+#line 1454 "WxpqdicFrame.wxc"
} break;
}
if (!(found)) {
@@ -1463,7 +1472,7 @@ WxpqdicFrame::RetrieveResponse(void)
}
-#line 1435 "WxpqdicFrame.wxc"
+#line 1470 "WxpqdicFrame.wxc"
return back;
}
@@ -1479,7 +1488,7 @@ WxpqdicFrame::SendRequest(bool force)
bool back = false;
-#line 1449 "WxpqdicFrame.wxc"
+#line 1484 "WxpqdicFrame.wxc"
if ((dk4_time_t)0UL == tRequestSended) {
mustsend = true;
} else {
@@ -1494,7 +1503,7 @@ WxpqdicFrame::SendRequest(bool force)
}
if (mustsend) {
-#line 1462 "WxpqdicFrame.wxc"
+#line 1497 "WxpqdicFrame.wxc"
sz = szRequest;
if ((dk4_um_t)0UL == currenttime) {
dk4time_get(&currenttime);
@@ -1510,7 +1519,7 @@ WxpqdicFrame::SendRequest(bool force)
case DK4_SOCKET_RESULT_IN_PROGRESS :
{
-#line 1476 "WxpqdicFrame.wxc"
+#line 1511 "WxpqdicFrame.wxc"
switch (iState) {
case WXPQDIC_STATE_OK : {
iState = WXPQDIC_STATE_SENDED;
@@ -1519,7 +1528,7 @@ WxpqdicFrame::SendRequest(bool force)
} break;
default : {
-#line 1483 "WxpqdicFrame.wxc"
+#line 1518 "WxpqdicFrame.wxc"
if (WXPQDIC_STATE_SEND_FAILED != iState) {
tLimit->SetLabel(sTexts[27]);
tUsed->SetLabel(sTexts[27]);
@@ -1536,24 +1545,24 @@ WxpqdicFrame::SendRequest(bool force)
#if TRACE_DEBUG
else {
-#line 1498 "WxpqdicFrame.wxc"
+#line 1533 "WxpqdicFrame.wxc"
}
#endif
-#line 1501 "WxpqdicFrame.wxc"
+#line 1536 "WxpqdicFrame.wxc"
return back;
}
void
-WxpqdicFrame::OnRun(wxCommandEvent & event)
+WxpqdicFrame::OnRun(wxCommandEvent & WXUNUSED(event))
{
bool mustUpdate = false;
-#line 1511 "WxpqdicFrame.wxc"
+#line 1546 "WxpqdicFrame.wxc"
{
wxCriticalSectionLocker lockCsProtect(csProtect);
if (bIsInitialized) {
@@ -1566,7 +1575,7 @@ WxpqdicFrame::OnRun(wxCommandEvent & event)
}
-#line 1522 "WxpqdicFrame.wxc"
+#line 1557 "WxpqdicFrame.wxc"
}
@@ -1577,7 +1586,7 @@ WxpqdicFrame::DataExchangeWithServer(void)
bool back = false;
-#line 1531 "WxpqdicFrame.wxc"
+#line 1566 "WxpqdicFrame.wxc"
if (RetrieveResponse()) {
back = true;
}
@@ -1586,7 +1595,7 @@ WxpqdicFrame::DataExchangeWithServer(void)
}
-#line 1538 "WxpqdicFrame.wxc"
+#line 1573 "WxpqdicFrame.wxc"
return back;
}
diff --git a/support/dktools/WxpqdicFrame.h b/support/dktools/WxpqdicFrame.h
index c32313e6c1..d428b05fed 100644
--- a/support/dktools/WxpqdicFrame.h
+++ b/support/dktools/WxpqdicFrame.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: WxpqdicFrame.wxc
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: WxpqdicFrame.wxc
*/
/** @file WxpqdicFrame.h Header file for the WxpqdicFrame module.
@@ -53,7 +31,11 @@ class WxpqdicFrame : public Dk4WxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -336,7 +318,7 @@ class WxpqdicFrame : public Dk4WxFrame
wxToolBarToolBase *bExit;
-#line 303 "WxpqdicFrame.wxc"
+#line 307 "WxpqdicFrame.wxc"
public:
@@ -447,7 +429,7 @@ class WxpqdicFrame : public Dk4WxFrame
};
-#line 413 "WxpqdicFrame.wxc"
+#line 417 "WxpqdicFrame.wxc"
#endif
diff --git a/support/dktools/WxpqdicFrame.wxc b/support/dktools/WxpqdicFrame.wxc
index 9b28dae9ab..6597bcb7cf 100644
--- a/support/dktools/WxpqdicFrame.wxc
+++ b/support/dktools/WxpqdicFrame.wxc
@@ -4,7 +4,7 @@ copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -140,7 +140,11 @@ class WxpqdicFrame : public Dk4WxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -413,6 +417,14 @@ class WxpqdicFrame : public Dk4WxFrame
%% module start
+#include "dk4conf.h"
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
+
#include "wxpqdic.h"
#include "dk4user.h"
#include "dk4enc.h"
@@ -429,13 +441,13 @@ class WxpqdicFrame : public Dk4WxFrame
#include "dk4numco.h"
-#include "exit-program.xpm"
-#include "run-conversion.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
#include "dk4verswx.h"
#if !defined(__WXMSW__)
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
#endif
@@ -446,14 +458,23 @@ $!trace-include
/* __CHANGE__ 017: Add further events. */
/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
-BEGIN_EVENT_TABLE(WxpqdicFrame, wxFrame)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxpqdicFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WxpqdicFrame,wxFrame)
+#endif
EVT_MENU(WxpqdicFrame_View_Update, WxpqdicFrame::OnRun)
EVT_MENU(WxpqdicFrame_Quit, WxpqdicFrame::OnQuit)
EVT_MENU(WxpqdicFrame_Help_About, WxpqdicFrame::OnAbout)
EVT_MENU(WxpqdicFrame_Help_Contents, WxpqdicFrame::OnHelpContents)
EVT_TIMER(WxpqdicFrame_Timer, WxpqdicFrame::OnTimer)
EVT_IDLE(WxpqdicFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -461,6 +482,11 @@ static const wxChar versionNumber[] = { DKT_VERSION_WX };
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc wxpqdic_cmd_line_entries[] = {
{
wxCMD_LINE_OPTION,
@@ -521,6 +547,9 @@ static const wxCmdLineEntryDesc wxpqdic_cmd_line_entries[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
/** Key names for preferences.
@@ -644,7 +673,7 @@ WxpqdicFrame::~WxpqdicFrame()
bool
-WxpqdicFrame::CanClose(bool isLast)
+WxpqdicFrame::CanClose(bool WXUNUSED(isLast))
{
bool back = true;
@@ -653,7 +682,7 @@ WxpqdicFrame::CanClose(bool isLast)
void
-WxpqdicFrame::OnQuit(wxCommandEvent & event)
+WxpqdicFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
{
wxCriticalSectionLocker lockCsProtect(csProtect);
@@ -678,7 +707,7 @@ WxpqdicFrame::OnQuit(wxCommandEvent & event)
void
-WxpqdicFrame::OnAbout(wxCommandEvent & event)
+WxpqdicFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
@@ -727,7 +756,7 @@ WxpqdicFrame::OnAbout(wxCommandEvent & event)
void
-WxpqdicFrame::OnHelpContents(wxCommandEvent & event)
+WxpqdicFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
DisplayContents();
}
@@ -742,11 +771,14 @@ WxpqdicFrame::OnHelpContents(wxCommandEvent & event)
bool
WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
{
-
+ wxString dummy(wxT(""));
dkChar buf[1024];
char c8b[1024];
dk4_er_t er;
wxChar *pv[] = { NULL, NULL, NULL, NULL, NULL, NULL };
+ wxCStrData hnstrdata = dummy.c_str();
+ wxCStrData qnstrdata = dummy.c_str();
+ wxCStrData unstrdata = dummy.c_str();
const wxChar *cptr;
const size_t szbuf = DK4_SIZEOF(buf,dkChar);
const size_t szc8b = sizeof(c8b);
@@ -798,7 +830,8 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
dk4error_init(&er);
cptr = NULL;
if (parser.Found(wxT_2("h"), &sHostname)) {
- cptr = sHostname.c_str();
+ hnstrdata = sHostname.c_str();
+ cptr = (wxChar const *)hnstrdata;
}
else {
cptr = pv[0];
@@ -827,14 +860,15 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
*/
cptr = NULL;
if (parser.Found(wxT_2("q"), &sQueuename)) {
- cptr = sQueuename.c_str();
+ qnstrdata = sQueuename.c_str();
+ cptr = (wxChar const *)qnstrdata;
}
else {
cptr = pv[2];
}
if (NULL != cptr) {
res = dk4recwx_wxchar_to_char(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
cptr, pAppHelp->GetWxEncoding(), NULL
);
if (0 != res) {
@@ -926,9 +960,10 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
User name is optional, use current user by default.
*/
if (parser.Found(wxT_2("u"), &sUsername)) {
+ unstrdata = sUsername.c_str();
res = dk4recwx_wxchar_to_char(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
- sUsername.c_str(), pAppHelp->GetWxEncoding(), NULL
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
+ (wxChar const *)unstrdata, pAppHelp->GetWxEncoding(), NULL
);
if (0 != res) {
pUsername = dk4str8_dup(c8b, NULL);
@@ -948,7 +983,7 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
res = dk4user_get_logname(buf, szbuf, 0, NULL);
if (0 != res) {
res = dk4recode_dk_to_any(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
buf, pAppHelp->GetDkEncoding(), NULL
);
if (0 != res) {
@@ -1177,7 +1212,7 @@ WxpqdicFrame::OnIdle(wxIdleEvent & event)
void
-WxpqdicFrame::OnTimer(wxTimerEvent & event)
+WxpqdicFrame::OnTimer(wxTimerEvent & WXUNUSED(event))
{
bool mustUpdate = false;
$? "+ OnTimer"
@@ -1504,7 +1539,7 @@ WxpqdicFrame::SendRequest(bool force)
void
-WxpqdicFrame::OnRun(wxCommandEvent & event)
+WxpqdicFrame::OnRun(wxCommandEvent & WXUNUSED(event))
{
bool mustUpdate = false;
$? "+ OnRun"
diff --git a/support/dktools/addctrld.c b/support/dktools/addctrld.c
index 7e616817c7..622f9e6787 100644
--- a/support/dktools/addctrld.c
+++ b/support/dktools/addctrld.c
@@ -1,48 +1,20 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2001-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: addctrld.ctr
*/
-#line 1 "addctrld.ctr"
-/*
-Copyright (c) 2001-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms,
-with or without modification, are permitted provided
-that the following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-* Redistributions in binary form must reproduce the above
- opyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of
- contributors may be used to endorse or promote
- products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-*/
+#line 9 "addctrld.ctr"
+
+
/** @file addctrld.c Ensure to have CTRL-D as last byte.
@@ -79,7 +51,7 @@ is not a CTRL-D the program appends a CTRL-D.
-#line 71 "addctrld.ctr"
+#line 45 "addctrld.ctr"
@@ -123,12 +95,12 @@ static void flush_buffer(void)
(void)_write(1, (void *)outbuffer, (unsigned int)outbused);
#else
#if DK4_HAVE_WRITE
- if (write(1, (void *)outbuffer, outbused) != outbused) {
+ if (((size_t)write(1, (void *)outbuffer, outbused)) != outbused) {
/* Intentionally empty */
}
#else
#if DK4_HAVE__WRITE
- if (_write(1, (void *)outbuffer, outbused) != outbused) {
+ if (((size_t)_write(1, (void *)outbuffer, outbused)) != outbused) {
/* Intentionally empty */
}
#else
@@ -157,11 +129,9 @@ static void add_char(char c)
/** The main() function of the addctrld program.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
@return 0 on success, other values indicate errors.
*/
-int main(int argc, char *argv[])
+int main(void)
{
char inbuffer[sizeof(outbuffer)];
char *ptr;
diff --git a/support/dktools/addctrld.ctr b/support/dktools/addctrld.ctr
index dda237d93a..bbf7c74767 100644
--- a/support/dktools/addctrld.ctr
+++ b/support/dktools/addctrld.ctr
@@ -1,39 +1,13 @@
-/*
-Copyright (c) 2001-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms,
-with or without modification, are permitted provided
-that the following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-* Redistributions in binary form must reproduce the above
- opyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of
- contributors may be used to endorse or promote
- products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-*/
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2001-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+
+
/** @file addctrld.c Ensure to have CTRL-D as last byte.
@@ -111,12 +85,12 @@ static void flush_buffer(void)
(void)_write(1, (void *)outbuffer, (unsigned int)outbused);
#else
#if DK4_HAVE_WRITE
- if (write(1, (void *)outbuffer, outbused) != outbused) {
+ if (((size_t)write(1, (void *)outbuffer, outbused)) != outbused) {
/* Intentionally empty */
}
#else
#if DK4_HAVE__WRITE
- if (_write(1, (void *)outbuffer, outbused) != outbused) {
+ if (((size_t)_write(1, (void *)outbuffer, outbused)) != outbused) {
/* Intentionally empty */
}
#else
@@ -145,11 +119,9 @@ static void add_char(char c)
/** The main() function of the addctrld program.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
@return 0 on success, other values indicate errors.
*/
-int main(int argc, char *argv[])
+int main(void)
{
char inbuffer[sizeof(outbuffer)];
char *ptr;
diff --git a/support/dktools/addctrld.rc b/support/dktools/addctrld.rc
index 7502b80d97..35b3df6fed 100644
--- a/support/dktools/addctrld.rc
+++ b/support/dktools/addctrld.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Ensure final Ctrl-D\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Ensure final Ctrl-D\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "addctrld\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/autom4te.cache/output.0 b/support/dktools/autom4te.cache/output.0
index 9e520f429f..c74a8de775 100644
--- a/support/dktools/autom4te.cache/output.0
+++ b/support/dktools/autom4te.cache/output.0
@@ -621,6 +621,163 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIB@&t@OBJS
+THISYEAR
+SUITE
+systemddir
+LIBSPRIVATE
+WXPQDICRES
+WXIMGSZRES
+WXDKSCRSZRES
+WXDKHTBRES
+WXDKFCSRES
+WXDKCTRES
+WXDKCLOCKRES
+WXBMPPRES
+WPRCLEANRES
+WINPRINTRES
+PLPDFTEXRES
+LPRNGCLRES
+ITADMINRES
+HTMLBOOKRES
+FIG2LATRES
+DKWXWIZRES
+DKWXPATHRES
+DKWTRES
+DKWTADMRES
+DKT2LRES
+DKT2HRES
+DKT2DBRES
+DKSQLSPLITRES
+DKSORTRES
+DKSENDRES
+DKRECVRES
+DKRANDRES
+DKPWGENRES
+DKPWDRES
+DKLSRES
+DKLINESRES
+DKHEXRES
+DKFICRES
+DKERADISKRES
+DKDBTRES
+DKDBCORES
+DKDB2TRES
+DKCTRES
+DKCATRES
+DKBMMRES
+DKBLKSRES
+DKBIN2CRES
+DK4INFORES
+DK3INFORES
+BMPPRES
+ADDCTRLDRES
+GETSOURCE
+ITADMINLIBS
+ITADMINLIBF
+LPRNGCLLIBS
+LPRNGCLLIBF
+RSHDOWNLIBS
+RSHDOWNLIBF
+PRINTQDCLIBS
+PRINTQDCLIBF
+PRMONSNMPLIBS
+PRMONSNMPLIBF
+PJSNMPLIBS
+PJSNMPLIBF
+PRINTQDALIBS
+PRINTQDALIBF
+PRINTQDILIBS
+PRINTQDILIBF
+PRINTQDLIBS
+PRINTQDLIBF
+WXDKHTBLIBS
+WXDKHTBLIBF
+WXDKCLOCKLIBS
+WXDKCLOCKLIBF
+WXIMGSZLIBS
+WXIMGSZLIBF
+WXPQDICLIBS
+WXPQDICLIBF
+WXDKFCSLIBS
+WXDKFCSLIBF
+WXBMPPLIBS
+WXBMPPLIBF
+WXDKDRAWLIBS
+WXDKDRAWLIBF
+WXDKCTLIBS
+WXDKCTLIBF
+CHSCRSZLIBS
+CHSCRSZLIBF
+WINPRINTLIBS
+WINPRINTLIBF
+DKWXPATHLIBS
+DKWXPATHLIBF
+DKWXWIZLIBS
+DKWXWIZLIBF
+PLPDFTEXLIBS
+PLPDFTEXLIBF
+DK3INFOLIBS
+DK3INFOLIBF
+WPRCLEANLIBS
+WPRCLEANLIBF
+DKWTLIBS
+DKWTLIBF
+HTMLBOOKLIBS
+HTMLBOOKLIBF
+WXD2LATLIBS
+WXD2LATLIBF
+FIG2LATLIBS
+FIG2LATLIBF
+BMPPLIBS
+BMPPLIBF
+DKDBTLIBS
+DKDBTLIBF
+ADDCTRLDLIBS
+ADDCTRLDLIBF
+DKCTLIBS
+DKCTLIBF
+DK4INFOLIBF
+DK4INFOLIBS
+DKDBT2LIBS
+DKDBT2LIBF
+DKSENDLIBS
+DKSENDLIBF
+DKRECVLIBS
+DKRECVLIBF
+DKPWDLIBS
+DKPWDLIBF
+DKBMMLIBS
+DKBMMLIBF
+DKHEXLIBS
+DKHEXLIBF
+DKBIN2CLIBS
+DKBIN2CLIBF
+DKT2LLIBS
+DKT2LLIBF
+DKT2HLIBS
+DKT2HLIBF
+DKRANDLIBS
+DKRANDLIBF
+DKPWGENLIBS
+DKPWGENLIBF
+DKUIDLIBS
+DKUIDLIBF
+DKFICLIBS
+DKFICLIBF
+DKLINESLIBS
+DKLINESLIBF
+DKSORTLIBS
+DKSORTLIBF
+DKLSLIBS
+DKLSLIBF
+DKERADISKLIBS
+DKERADISKLIBF
+DKSQLSPLITLIBS
+DKSQLSPLITLIBF
+DKBLKSLIBS
+DKBLKSLIBF
+DKCATLIBS
+DKCATLIBF
LIBDK3WXLIBS
LIBDK3WXLIBF
LIBDK3FIGLIBS
@@ -647,16 +804,26 @@ LIBDK4SOCKALIBS
LIBDK4SOCKALIBF
LIBDK4PPPTALIBS
LIBDK4PPPTALIBF
+LIBDK4GRAALIBS
+LIBDK4GRAALIBF
+LIBDK4BIFALIBS
+LIBDK4BIFALIBF
LIBDK4APPLIBS
LIBDK4APPLIBF
LIBDK4PPPTLIBS
LIBDK4PPPTLIBF
+LIBDK4GRALIBS
+LIBDK4GRALIBF
+LIBDK4BIFLIBS
+LIBDK4BIFLIBF
LIBDK4MDRNDLIBS
LIBDK4MDRNDLIBF
LIBDK4SOCKLIBS
LIBDK4SOCKLIBF
LIBDK4LATLIBS
LIBDK4LATLIBF
+LIBDK4LATALIBS
+LIBDK4LATALIBF
LIBDK4CLIBS
LIBDK4CLIBF
LIBDK4DBILIBS
@@ -679,25 +846,12 @@ LIBDK4MALIBS
LIBDK4MALIBF
LIBDK4BASELIBS
LIBDK4BASELIBF
-RTLIB
-LIBSPRIVATE
-INSTALLMANPAGES
-WINUNICODE
-ENTRY
-GUILIB
-CLILIB
-MAKE
-GETSOURCE
-WXDKFCSLIBS
-WXDKFCSLIBF
-NETSNMP_CFLAGS
-MYSQLLIB
-NETSNMP_LIBS
SOLIBDK4DBIA
SOLIBDK4DBI
SOLIBDK4SOCKA
SOLIBDK4SOCK
SOLIBDK4LAT
+SOLIBDK4LATA
SOLIBDK4APP
SOLIBDK4PPPT
SOLIBDK4MDRND
@@ -727,144 +881,117 @@ SOLIBCRYPTO
SOLIBMATH
SOLIBBZ
SOLIBZ
+LPRNGGROUP
+LPRNGUSER
+LIBDK4WXOBJ
+LIBDK3WXOBJ
+MOD_DK4DMT
+MOD_DK3WREG
+WXVERSION
WXLDFLAGS
-WXCFLAGS
WXCXXFLAGS
+WXCFLAGS
WXCPPFLAGS
-TESTPROGRAMS
-SNMP_PROG_CLI
+GUILIB
+CLILIB
+WINGUILIB
+WINCLILIB
+NETSNMP_CFLAGS
+NETSNMP_LIBS
MYSQLLDFLAGS
-MYSQL_PROG_CLI
-NET_PROG_CLI
-NET_PROG_RES
-LIB_SH_GUI
-LIB_SH_CLI
-LIB_SH_RES
+MYSQLLIB
+DBLIBSOCK
+DBLIB
+PTHREADLIB
+RTLIB
NSLLIB
SOCKLIB
-PROGSOPENSSL
-DK4INFOLIBF
-DK4INFOLIBS
-DKDBT2LIBS
-DKDBT2LIBF
-DKSENDLIBS
-DKSENDLIBF
-DKRECVLIBS
-DKRECVLIBF
-DKPWDLIBS
-DKPWDLIBF
-DKBMMLIBS
-DKBMMLIBF
-DKHEXLIBS
-DKHEXLIBF
-DKT2LLIBS
-DKT2LLIBF
-DKT2HLIBS
-DKT2HLIBF
-DKRANDLIBS
-DKRANDLIBF
-DKPWGENLIBS
-DKPWGENLIBF
-DKUIDLIBS
-DKUIDLIBF
-DKFICLIBS
-DKFICLIBF
-DKSORTLIBS
-DKSORTLIBF
-DKLSLIBS
-DKLSLIBF
-DKERADISKLIBS
-DKERADISKLIBF
-DKSQLSPLITLIBS
-DKSQLSPLITLIBF
-DKBLKSLIBS
-DKBLKSLIBF
-DKCATLIBS
-DKCATLIBF
+FS64
CRYPTO
-CWARN
+LIBTIFF
+LIBJPEG
+LIBPNG
+BZLIB
+ZLIB
+rundir
+RESCRULE
+RESEXT
+RCEXT
+FOUND_SYSTEMD
+INSTALL_INDEP
+INSTALL_LIBS
+INSTALL_PROGRAMS
+BUILD_ARCH
+RES_GUI_WINDOWS
+MAN_GUI_WINDOWS
+PRG_GUI_WINDOWS
+RES_CLI_WINDOWS
+MAN_CLI_WINDOWS
+PRG_CLI_WINDOWS
+RES_CLI_POSIX
+MAN_CLI_POSIX
+PRG_CLI_POSIX
+RES_GUI_SSL
+MAN_GUI_SSL
+PRG_GUI_SSL
+RES_CLI_SSL
+MAN_CLI_SSL
+PRG_CLI_SSL
+RES_CLI_MYSQL
+MAN_CLI_MYSQL
+PRG_CLI_MYSQL
+RES_CLI_SNMP
+MAN_CLI_SNMP
+PRG_CLI_SNMP
+RES_CLI_NET_POSIX
+MAN_CLI_NET_POSIX
+PRG_CLI_NET_POSIX
+RES_GUI_NET
+MAN_GUI_NET
+PRG_GUI_NET
+RES_CLI_NET
+MAN_CLI_NET
+PRG_CLI_NET
+RES_RES_NET_DE
+RES_RES_NET_EN
+RES_RES_NET
+MAN_RES_NET
+PRG_RES_NET
+LIB_SHARED_RES_NET
SOVERS
VERSNO
-SHLIBSTYLE
+TOOLCHAIN
UNAME
+CROSSBUILD
+TARGETCLASS
+BUILDCLASS
+TARGETHOST
+BUILDHOST
+LDFLCXX_GUI
+LDFLCXX_CLI_WX
+LDFLCXX_CLI_DK
+LDFLCXX_CLI_C8
+LDFLC_CLI_DK
+LDFLC_CLI_C8
+CXXFL_GUI
+CXXFL_CLI_WX
+CXXFL_CLI_DK
+CXXFL_CLI_C8
+CFL_CLI_DK
+CFL_CLI_C8
+MKSOCHECKSYMBOLS
+MKSORPATHLINK
+MKSORPATH
RPATHLINK
RPATH
+MKSOLIBCPP
MKSOLIB
-RES_INSTALL
-LIBS_INSTALL
-LIBS_SHARED
-LIBS_STATIC
-LIBRARIES
-PROGRAMS
-CFPIC
-BZLIB
-ZLIB
-FS64
-ITADMINLIBS
-ITADMINLIBF
-LPRNGCLLIBS
-LPRNGCLLIBF
-RSHDOWNLIBS
-RSHDOWNLIBF
-PRINTQDCLIBS
-PRINTQDCLIBF
-PRMONSNMPLIBS
-PRMONSNMPLIBF
-PJSNMPLIBS
-PJSNMPLIBF
-PRINTQDALIBS
-PRINTQDALIBF
-PRINTQDILIBS
-PRINTQDILIBF
-PRINTQDLIBS
-PRINTQDLIBF
-WXDKHTBLIBS
-WXDKHTBLIBF
-WXDKCLOCKLIBS
-WXDKCLOCKLIBF
-WXIMGSZLIBS
-WXIMGSZLIBF
-WXPQDICLIBS
-WXPQDICLIBF
-WXBMPPLIBS
-WXBMPPLIBF
-WXDKCTLIBS
-WXDKCTLIBF
-DKWXWIZLIBS
-DKWXWIZLIBF
-PLPDFTEXLIBS
-PLPDFTEXLIBF
-DK3INFOLIBS
-DK3INFOLIBF
-HTMLBOOKLIBS
-HTMLBOOKLIBF
-FIG2LATLIBS
-FIG2LATLIBF
-BMPPLIBS
-BMPPLIBF
-DKDBTLIBS
-DKDBTLIBF
-ADDCTRLDLIBS
-ADDCTRLDLIBF
-DKCTLIBS
-DKCTLIBF
-LIBDK4WXTOBUILD
-LIBDK4WXOBJ
-LIBDK3WXOBJ
-PTHREADLIB
-CLI_MYSQLPROG
-DBLIBSOCK
-DBLIB
-LIBTIFF
-LIBJPEG
-LIBPNG
-CLI_SNMPPROG
-ANYDB
-CURL
-WGET
-NM
-AR
-RANLIB
+DELTARGETSO
+DELTARGET
+INSTALL
+RCFLAGS
+EGREP
+GREP
host_os
host_vendor
host_cpu
@@ -873,14 +1000,21 @@ build_os
build_vendor
build_cpu
build
+CURL
+WGET
+GMAKE
+MAKE
+PKG_CONFIG
+WINDRES
+NM
+AR
+RANLIB
LN_S
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
SED
MKDIR_P
-EGREP
-GREP
ac_ct_CXX
CXXFLAGS
CXX
@@ -911,6 +1045,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -933,18 +1068,21 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
-enable_inline
+with_suite
+with_systemd
+with_windows
+enable_devel
enable_static
enable_shared
enable_packaging
-enable_ndbm
+enable_link_so_so
+enable_rpath
+enable_man_pages
+enable_debug
enable_warnings
-enable_more_warnings
-with_suite
-with_man
-with_corrections
-with_fallback_limits
-with_printf_scanf
+enable_assert
+enable_corrections
+enable_fallback
'
ac_precious_vars='build_alias
host_alias
@@ -996,6 +1134,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1248,6 +1387,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1385,7 +1533,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1538,6 +1686,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1569,22 +1718,25 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-inline Allow use of inline keyword (no / yes)
- --enable-static Allow building static libraries (yes / no)
- --enable-shared Allow building shared libraries (yes / no)
- --enable-packaging Binaries use shared libraries (no / yes)
- --enable-ndbm Explicitly enable/disable NDBM if found
- --enable-warnings Enable high warning level, gcc only (yes / no)
- --enable-more-warnings Enable yet more warnings, gcc only (no / yes)
+ --enable-devel Enable developer support (yes / no)
+ --enable-static Build static libraries (yes / no)
+ --enable-shared Build shared libraries (no / yes)
+ --enable-packaging Build for package creation (no / yes)
+ --enable-link-so-so Link so libs with so libs (no / yes)
+ --enable-rpath Use -rpath when linking executables (no / yes)
+ --enable-man-pages Install man pages (yes / no)
+ --enable-debug Allow debug information (no / yes)
+ --enable-warnings Enable additional warnings for gcc (yes / no)
+ --enable-assert Use assertions (no / yes)
+ --enable-corrections Corrections for Solaris (no / yes)
+ --enable-fallback Enable fallback values for num limits (no / yes)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-suite=name Software suite to build: auto / gui / cli / rescue
- --with-man Install man pages (auto / yes / no)
- --with-corrections Enable corrections for Solaris: no / yes
- --with-fallback-limits Allow use of fallback limits (no / yes)
- --with-printf-scanf Allow use of printf and scanf (yes / no)
+ --with-suite Software suite to build (auto / gui / cli / rescue)
+ --with-systemd=DIR Directory for service unit files / yes / no
+ --with-windows Compile for Windows version (7 / XP)
Some influential environment variables:
CC C compiler command
@@ -1791,79 +1943,6 @@ fi
} @%:@ ac_fn_cxx_try_compile
-@%:@ ac_fn_c_try_run LINENO
-@%:@ ----------------------
-@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes
-@%:@ that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_c_try_run
-
-@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-@%:@ -------------------------------------------------------
-@%:@ Tests whether HEADER exists and can be compiled using the include files in
-@%:@ INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-@%:@include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} @%:@ ac_fn_c_check_header_compile
-
@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
@%:@ -------------------------------------------------------
@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using
@@ -1951,6 +2030,125 @@ fi
} @%:@ ac_fn_c_check_header_mongrel
+@%:@ ac_fn_c_try_run LINENO
+@%:@ ----------------------
+@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes
+@%:@ that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} @%:@ ac_fn_c_try_run
+
+@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+@%:@ -------------------------------------------------------
+@%:@ Tests whether HEADER exists and can be compiled using the include files in
+@%:@ INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+@%:@include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} @%:@ ac_fn_c_check_header_compile
+
+@%:@ ac_fn_c_try_link LINENO
+@%:@ -----------------------
+@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} @%:@ ac_fn_c_try_link
+
@%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
@%:@ --------------------------------------------
@%:@ Tries to find the compile-time value of EXPR in a program that includes
@@ -2134,52 +2332,6 @@ rm -f conftest.val
} @%:@ ac_fn_c_compute_int
-@%:@ ac_fn_c_try_link LINENO
-@%:@ -----------------------
-@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_c_try_link
-
@%:@ ac_fn_c_check_func LINENO FUNC VAR
@%:@ ----------------------------------
@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -2598,6 +2750,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
ac_config_headers="$ac_config_headers config.h"
ac_ext=c
@@ -3783,491 +3937,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes; then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_bigendian=no
-else
- ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- $as_echo "@%:@define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
- no)
- ;; #(
- universal)
-
-$as_echo "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
- ;; #(
- *)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
@@ -4512,78 +4181,6 @@ else
$as_echo "no, using $LN_S" >&6; }
fi
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
@@ -4860,458 +4457,272 @@ else
NM="$ac_cv_prog_NM"
fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_WINDRES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$WINDRES"; then
+ ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-echo 'CC = ' $CC `which $CC`
-echo 'CXX = ' $CXX `which $CXX`
-
-
-
-FORCESOLINKING="no"
-
-USESOLINKING="no"
-
-INSTALLMANPAGES='install-manpages'
-
-LIBSPRIVATE=""
-
-MANINST='auto'
-
-EXVAL=0
-
-SOLCOR='no'
-
-CFPIC=''
-MKSOLIB=''
-SHLIBSTYLE=''
-UNAME=''
-WXCPPFLAGS=''
-WXCXXFLAGS=''
-WXCFLAGS=''
-WXLDFLAGS=''
-SUITE='auto'
-ENASTATIC='auto'
-ENASHARED='auto'
-PROGRAMS=''
-LIBRARIES=''
-LIBS_STATIC=''
-LIBS_SHARED=''
-LIBS_INSTALL=''
-RES_INSTALL=''
-RPATH=''
-RPATHLINK=''
-CWARN=''
-FOUND_GDBM='no'
-FOUND_NDBM='no'
-FOUND_BDB='no'
-USE_NDBM='auto'
-NET_PROG_RES=''
-NET_PROG_CLI=''
-MYSQL_PROG_CLI=''
-SNMP_PROG_CLI=''
-MYSQLLDFLAGS=''
-MYSQLLIB=''
-RTLIB=''
-SOLIBZ=''
-SOLIBBZ=''
-SOLIBMATH=''
-SOLIBCRYPTO=''
-SOLIBNET=''
-SOLIBIMG=''
-SOLIBSDBI=''
-SOLIBWX=''
-SOLIBDK3PORT=''
-SOLIBDK3C=''
-SOLIBDK3OF=''
-SOLIBDK3CSRND=''
-SOLIBDK3BIF=''
-SOLIBDK3DBI=''
-SOLIBDK3FIG=''
-SOLIBDK3BMEPS=''
-SOLIBDK3NET=''
-SOLIBDK4BASE=''
-SOLIBDK4MA=''
-SOLIBDK4MAIO8H=''
-SOLIBDK4MAIOWH=''
-SOLIBDK4MAIODH=''
-SOLIBDK4MAIO8D=''
-SOLIBDK4MAIOWD=''
-SOLIBDK4MAIODD=''
-SOLIBDK4C=''
-SOLIBDK4MDRND=''
-SOLIBDK4PPPT=''
-SOLIBDK4APP=''
-SOLIBDK4LAT=''
-SOLIBDK4SOCK=''
-SOLIBDK4SOCKA=''
-SOLIBDK4DBI=''
-SOLIBDK4DBIA=''
-LIBDK4BASELIBF=''
-LIBDK4BASELIBS=''
-LIBDK4MALIBF=''
-LIBDK4MALIBS=''
-LIBDK4MAIO8DLIBF=''
-LIBDK4MAIO8DLIBS=''
-LIBDK4MAIOWDLIBF=''
-LIBDK4MAIOWDLIBS=''
-LIBDK4MAIODDLIBF=''
-LIBDK4MAIODDLIBS=''
-LIBDK4MAIOXDLIBF=''
-LIBDK4MAIOXDLIBS=''
-LIBDK4MAIO8HLIBF=''
-LIBDK4MAIO8HLIBS=''
-LIBDK4MAIOWHLIBF=''
-LIBDK4MAIOWHLIBS=''
-LIBDK4MAIODHLIBF=''
-LIBDK4MAIODHLIBS=''
-LIBDK4DBILIBF=''
-LIBDK4DBILIBS=''
-LIBDK4CLIBF=''
-LIBDK4CLIBS=''
-LIBDK4LATLIBF=''
-LIBDK4LATLIBS=''
-LIBDK4SOCKLIBF=''
-LIBDK4SOCKLIBS=''
-LIBDK4MDRNDLIBF=''
-LIBDK4MDRNDLIBS=''
-LIBDK4PPPTLIBF=''
-LIBDK4PPPTLIBS=''
-LIBDK4APPLIBF=''
-LIBDK4APPLIBS=''
-LIBDK4PPPTALIBF=''
-LIBDK4PPPTALIBS=''
-LIBDK4SOCKALIBF=''
-LIBDK4SOCKALIBS=''
-LIBDK4DBIALIBF=''
-LIBDK4DBIALIBS=''
-LIBDK4WXLIBF=''
-LIBDK4WXLIBS=''
-LIBDK3TRACELIBF=''
-LIBDK3TRACELIBS=''
-LIBDK3CLIBF=''
-LIBDK3CLIBS=''
-LIBDK3OFLIBF=''
-LIBDK3OFLIBS=''
-LIBDK3CSRNDLIBF=''
-LIBDK3CSRNDLIBS=''
-LIBDK3BIFLIBF=''
-LIBDK3BIFLIBS=''
-LIBDK3DBILIBF=''
-LIBDK3DBILIBS=''
-LIBDK3BMEPSLIBF=''
-LIBDK3BMEPSLIBS=''
-LIBDK3FIGLIBF=''
-LIBDK3FIGLIBS=''
-LIBDK3WXLIBF=''
-LIBDK3WXLIBS=''
-
-
-VERSNO=`cat version.txt`
-SOVERS=`echo $VERSNO | sed -e 's/\.[01-9][01-9]*$//'`
-ENAPACKAGING="auto"
-LIB_SH_RES='$(LIB_SH_RES_NO_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_NO_PACKAGING)'
-UNAME=`uname -s`
-GETSOURCE='@echo "ERROR: Neither wget nor curl available, can not download source!" && false'
-WGET=''
-CURL=''
-CLILIB=''
-GUILIB=''
-ENTRY=''
-ONWINDOWS='no'
-WINUNICODE=''
-FOUNDINLINE="no"
-USEINLINE="no"
-CROSSCOMPILING="no"
-
-MAKE="echo No make program found to build"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking GNU make" >&5
-$as_echo_n "checking GNU make... " >&6; }
-gmake maketest > /dev/null 2>&1
-if [ "X$?" = "X0" ]
-then
- MAKE='gmake'
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+fi
+fi
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
+$as_echo "$WINDRES" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking make" >&5
-$as_echo_n "checking make... " >&6; }
-make maketest > /dev/null 2>&1
-if [ "X$?" = "X0" ]
-then
- MAKE='make'
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+
+fi
+if test -z "$ac_cv_prog_WINDRES"; then
+ ac_ct_WINDRES=$WINDRES
+ # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_WINDRES"; then
+ ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_WINDRES="windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
+if test -n "$ac_ct_WINDRES"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
+$as_echo "$ac_ct_WINDRES" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-@%:@ Check whether --enable-inline was given.
-if test "${enable_inline+set}" = set; then :
- enableval=$enable_inline; USEINLINE="$enableval"
+ if test "x$ac_ct_WINDRES" = x; then
+ WINDRES=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ WINDRES=$ac_ct_WINDRES
+ fi
+else
+ WINDRES="$ac_cv_prog_WINDRES"
fi
-@%:@ Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; ENASTATIC="$enableval"
-fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PKG_CONFIG"; then
+ ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-@%:@ Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; ENASHARED="$enableval"
fi
-
-@%:@ Check whether --enable-packaging was given.
-if test "${enable_packaging+set}" = set; then :
- enableval=$enable_packaging; ENAPACKAGING="$enableval"
fi
-
-@%:@ Check whether --enable-ndbm was given.
-if test "${enable_ndbm+set}" = set; then :
- enableval=$enable_ndbm; USE_NDBM="$enableval"
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-@%:@ Check whether --enable-warnings was given.
-if test "${enable_warnings+set}" = set; then :
- enableval=$enable_warnings; WARNVAL="$enableval"
-fi
-@%:@ Check whether --enable-more-warnings was given.
-if test "${enable_more_warnings+set}" = set; then :
- enableval=$enable_more_warnings; WARNMOREVAL="$enableval"
fi
+if test -z "$ac_cv_prog_PKG_CONFIG"; then
+ ac_ct_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_PKG_CONFIG"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-
-@%:@ Check whether --with-suite was given.
-if test "${with_suite+set}" = set; then :
- withval=$with_suite; SUITE="$withval"
fi
-
-
-@%:@ Check whether --with-man was given.
-if test "${with_man+set}" = set; then :
- withval=$with_man; MANINST="$withval"
+fi
+ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5
+$as_echo "$ac_ct_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-@%:@ Check whether --with-corrections was given.
-if test "${with_corrections+set}" = set; then :
- withval=$with_corrections; SOLCOR="$withval"
+ if test "x$ac_ct_PKG_CONFIG" = x; then
+ PKG_CONFIG=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_ct_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_prog_PKG_CONFIG"
fi
+MAKE=''
+GMAKE=''
+# Extract the first word of "make", so it can be a program name with args.
+set dummy make; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MAKE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MAKE"; then
+ ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MAKE="make"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-if [ "X$SOLCOR" = "Xyes" -a "X$UNAME" != "XSunOS" ]
-then
- echo 'ERROR: The --with-corrections option is for Solaris/SunOS only!'
- SOLCOR='no'
fi
-
-if [ "X$host" != "X$build" ]
-then
- echo 'Building on: ' $build
- echo 'Building for:' $host
- CROSSCOMPILING="yes"
- case "X$SUITE" in
- "gui")
- echo "Warning: Cross-compiling, switching suite to cross."
- ;;
- "cli")
- echo "Warning: Cross-compiling, switching suite to cross."
- ;;
- esac
- SUITE="cross"
+fi
+MAKE=$ac_cv_prog_MAKE
+if test -n "$MAKE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
+$as_echo "$MAKE" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-case "X$ENAPACKAGING" in
- "Xauto")
- if [ "X$SUITE" = "Xrescue" ]
- then
- ENAPACKAGING="yes"
- else
- ENAPACKAGING="no"
- fi
- ;;
- "Xyes")
- ENAPACKAGING="yes"
- ;;
- *)
- ENAPACKAGING="no"
- ;;
-esac
-UNAME=`uname -s`
-if [ "X$CC" = "Xgcc" ]
-then
- SHLIBSTYLE='gcc'
- RPATHLINK="-Wl,-rpath-link,./"
-elif [ "X$UNAME" = "XSunOS" ]
-then
- SHLIBSTYLE='workshop'
-fi
+# Extract the first word of "gmake", so it can be a program name with args.
+set dummy gmake; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GMAKE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$GMAKE"; then
+ ac_cv_prog_GMAKE="$GMAKE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_GMAKE="gmake"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-if [ "X$CC" = "Xgcc" -a "X$WARNVAL" != "Xno" ]
-then
- # Enable all warnings and some extra warnings
- CWARN="-Wall"
- WARNVAL=yes
+fi
+fi
+GMAKE=$ac_cv_prog_GMAKE
+if test -n "$GMAKE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMAKE" >&5
+$as_echo "$GMAKE" >&6; }
else
- WARNVAL=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-if [ "X$CC" = "Xgcc" -a "X$WARNMOREVAL" == "Xyes" ]
-then
- # Extra warnings
- CWARN="$CWARN -Wextra"
- # Overlong strings (C89: 509 characters, C99: 4095 characters)
- CWARN="$CWARN -Woverlength-strings"
- # Padding bytes added to structures
- CWARN="$CWARN -Wpadded"
- # Redundant declarations
- CWARN="$CWARN -Wredundant-decls"
- # Suspicious logical operators in expressions
- CWARN="$CWARN -Wlogical-op"
- # Functions returning entire structures
- CWARN="$CWARN -Waggregate-return"
- # Prototypes required before function use
- CWARN="$CWARN -Wstrict-prototypes"
- # Old style function definitions
- CWARN="$CWARN -old-style-definition"
- # Prototypes missing for global functions (must be in a header)
- CWARN="$CWARN -Wmissing-prototypes"
- # Global function defined without a previous prototype
- CWARN="$CWARN -Wmissing-declarations"
- # "exern" definition in a function
- CWARN="$CWARN -Wnested-externs"
- # Unreachable code in a program
- CWARN="$CWARN -Wunreachable-code"
- # Failed to inline a function
- CWARN="$CWARN -Winline"
- # Invalid PCH file found
- CWARN="$CWARN -Winvalid-pch"
- # Variable length array
- CWARN="$CWARN -Wvla"
- # Using signed pointers
- CWARN="$CWARN -Wpointer-sign"
- # The stack protector can not handle some function
- CWARN="$CWARN -Wstack-protector"
- WARNMOREVAL="yes"
-else
- WARNMOREVAL="no"
-fi
-
-case "X$ENASHARED" in
- "Xauto")
- if [ "X$SHLIBSTYLE" = "Xgcc" -o "X$SHLIBSTYLE" = "Xworkshop" ]
- then
- ENASHARED='yes'
- else
- ENASHARED='no'
- fi
- ;;
- "Xyes")
- if [ "X$SHLIBSTYLE" = "Xgcc" -o "X$SHLIBSTYLE" = "Xworkshop" ]
- then
- ENASHARED='yes'
- else
- ENASHARED='no'
- as_fn_error $? "Can not build shared libraries!" "$LINENO" 5
- exit 1
- fi
- ;;
- *)
- ENASHARED='no'
- ;;
-esac
-if [ "X$ENASTATIC" = "Xauto" ]
-then
- case "X$ENASHARED" in
- "Xyes")
- ENASTATIC='no'
- ;;
- "Xno")
- ENASTATIC='yes'
- ;;
- esac
-fi
-if [ "X$ENASTATIC" != "Xyes" -a "X$ENASTATIC" != "Xno" ]
-then
- ENASTATIC='no'
-fi
-
-WXCPPFLAGS=`wx-config --cppflags`
-WXCXXFLAGS=`wx-config --cxxflags`
-WXVERSION=`wx-config --version`
-WXCFLAGS=`wx-config --cflags`
-WXLDFLAGS=`wx-config --libs`
-case "X$SUITE" in
- "Xauto")
- SUITE='gui'
- if [ "X$WXCPPFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXCXXFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXCFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXLDFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- ;;
- "Xgui")
- if [ "X$WXCPPFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXCXXFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXCFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXLDFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$SUITE" != "Xgui" ]
- then
- as_fn_error $? "Can not build GUI applications, wxWidgets not found!" "$LINENO" 5
- exit 1
- fi
- ;;
- "Xcli")
- SUITE='cli'
- ;;
- "Xrescue")
- SUITE='rescue'
- ;;
- "Xcross")
- SUITE='cross'
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown suite type $SUITE changed to cli." >&5
-$as_echo "$as_me: WARNING: Unknown suite type $SUITE changed to cli." >&2;}
- SUITE='cli'
- ;;
-esac
if [ "X$RANLIB" = "X:" ]
then
- RANLIB="@echo No need to run ranlib"
+ RANLIB='@echo No need to run ranlib'
fi
+
# Extract the first word of "wget", so it can be a program name with args.
set dummy wget; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5386,280 +4797,886 @@ $as_echo "no" >&6; }
fi
-
-if [ "X$SUITE" = "Xrescue" ]
+GETSOURCE='@echo "ERROR: Neither wget nor curl available!" && false'
+if [ "X$WGET" != "X" ]
then
- PROGRAMS='$(PROG_RES)'
- LIBS_STATIC='$(LIB_ST_RES)'
- LIBS_SHARED='$(LIB_SH_RES)'
- RES_INSTALL='i-r-res'
- INSTALLMANPAGES='install-rescue-man'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_RES) $(LIB_ST_RES)'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_RES)'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_RES)'
- ;;
- esac
- case "X$ENAPACKAGING" in
- "Xyes")
- LIBS_INSTALL='i-l-sh'
- ;;
- esac
- LIBRARIES=''
-elif [ "X$SUITE" = "Xgui" ]
+ GETSOURCE='wget -O dktools-$(VERSNO)'
+ GETSOURCE="$GETSOURCE"' $(SFBASE)/dktools-$(VERSNO).tar.gz/download'
+elif [ "X$CURL" != "X" ]
then
- PROGRAMS='$(PROG_GUI)'
- LIBS_STATIC='$(LIB_ST_GUI)'
- LIBS_SHARED='$(LIB_SH_GUI)'
- RES_INSTALL='i-r-gui'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_GUI) $(LIB_ST_GUI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_GUI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_GUI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
-elif [ "X$SUITE" = "Xcross" ]
+ GETSOURCE='curl -L $(SFBASE)/dktools-$(VERSNO).tar.gz'
+ GETSOURCE="$GETSOURCE "'> dktools-$(VERSNO).tar.gz'
+fi
+
+if [ "X$MAKE" = "X" -a "X$GMAKE" != "X" ]
then
- PROGRAMS='$(PROG_CROSS)'
- LIBS_STATIC='$(LIB_ST_CLI)'
- LIBS_SHARED='$(LIB_SH_CLI)'
- RES_INSTALL='i-r-cli'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_CLI) $(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_CLI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ENASHARED='no'
- ENASTATIC='yes'
- case "X$host" in
- "Xx86_64-w64-mingw32")
- ONWINDOWS="yes"
- WINUNICODE="-D_UNICODE=1 -DUNICODE=1"
- $as_echo "@%:@define HAVE_BACKSLASH_AS_SEP 1" >>confdefs.h
+ MAKE="$GMAKE"
+fi
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
- $as_echo "@%:@define HAVE_LINE_END_CR_NL 1" >>confdefs.h
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
- $as_echo "@%:@define HAVE_CASE_INSENSITIVE_PATHNAMES 1" >>confdefs.h
- ;;
- esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- PROGRAMS='$(PROG_CLI)'
- LIBS_STATIC='$(LIB_ST_CLI)'
- LIBS_SHARED='$(LIB_SH_CLI)'
- RES_INSTALL='i-r-cli'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_CLI) $(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_CLI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
-if [ "X$ENASHARED" = "Xno" ]
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+WHICHCC=`which $CC`
+WHICHCXX=`which $CXX`
+BUILDHOST="$build"
+TARGETHOST="$host"
+BUILDCLASS='posix'
+TARGETCLASS='posix'
+CROSSBUILD='no'
+UNAME=`uname -s`
+case X$TARGETHOST in
+ Xx86_64-w64-mingw32|Xx86_64-w32-mingw32)
+ TARGETCLASS='windows'
+ ;;
+esac
+case X$BUILDHOST in
+ Xx86_64-w64-mingw32|Xx86_64-w32-mingw32)
+ BUILDCLASS='windows'
+ ;;
+esac
+if [ "X$BUILDHOST" != "X$TARGETHOST" ]
then
- ENAPACKAGING="no"
+ CROSSBUILD='yes'
fi
+TOOLCHAIN='unknown'
+case X$CC in
+ Xgcc|X*gcc)
+ TOOLCHAIN='gcc'
+ ;;
+ Xclang|X*clang)
+ TOOLCHAIN='clang'
+ ;;
+ Xcc)
+ if [ "X$UNAME" = "XSunOS" ]
+ then
+ TOOLCHAIN='workshop'
+ fi
+ ;;
+ Xcl|XCL)
+ TOOLCHAIN='msvc'
+ ;;
+esac
-APPLIBF="libdk4app.so libdk4c.so"
-if [ "X$CROSSCOMPILING" = "Xyes" ]
+if [ "X$WINDRES" = "X:" -a "X$TOOLCHAIN" = "Xmsvc" ]
then
- APPLIBF="$APPLIBF libdk4ma.so libdk4maiodd.so libdk4maiowd.so libdk4maio8d.so"
-else
- APPLIBF="$APPLIBF libdk4ma.so libdk4maiodd.so libdk4maio8d.so"
+ WINDRES='RC'
+elif [ "X$WINDRES" = "X:" ]
+then
+ WINDRES='@echo "ERROR: No windows resouce compiler available!"'
fi
-APPLIBF="$APPLIBF libdk4base.so"
-APPLIBS="-ldk4app -ldk4c"
-if [ "X$CROSSCOMPILING" = "Xyes" ]
+THISYEAR=`date '+%Y'`
+
+
+
+GCCWARNFLAGS="-Wall -Wextra"
+GCXXWARNFLAGS="-Wall -Wextra"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Woverlength-strings"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Woverlength-strings"
+
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wredundant-decls"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wredundant-decls"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wlogical-op"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wlogical-op"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Waggregate-return"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wstrict-prototypes"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -old-style-definition"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wmissing-prototypes"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wmissing-declarations"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wmissing-declarations"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wnested-externs"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wunreachable-code"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wunreachable-code"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Winline"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Winvalid-pch"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Winvalid-pch"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wvla"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wvla"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wpointer-sign"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wstack-protector"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wstack-protector"
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Options: $*" >&5
+$as_echo "$as_me: Options: $*" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CC = $CC $WHICHCC" >&5
+$as_echo "$as_me: CC = $CC $WHICHCC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CXX = $CXX $WHICHCXX" >&5
+$as_echo "$as_me: CXX = $CXX $WHICHCXX" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS: $CPPFLAGS" >&5
+$as_echo "$as_me: CPPFLAGS: $CPPFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CFLAGS: $CFLAGS" >&5
+$as_echo "$as_me: CFLAGS: $CFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS: $LDFLAGS" >&5
+$as_echo "$as_me: LDFLAGS: $LDFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Building on: $BUILDHOST $BUILDCLASS" >&5
+$as_echo "$as_me: Building on: $BUILDHOST $BUILDCLASS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Building for: $TARGETHOST $TARGETCLASS" >&5
+$as_echo "$as_me: Building for: $TARGETHOST $TARGETCLASS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Cross build: $CROSSBUILD" >&5
+$as_echo "$as_me: Cross build: $CROSSBUILD" >&6;}
+
+if [ "X$PKG_CONFIG" = "X:" -a "X$CROSSBUILD" = "Xyes" ]
then
- APPLIBS="$APPLIBS -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d"
-else
- APPLIBS="$APPLIBS -ldk4ma -ldk4maiodd -ldk4maio8d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cross building, but no pkg-config available!" >&5
+$as_echo "$as_me: WARNING: Cross building, but no pkg-config available!" >&2;}
fi
-APPLIBS="$APPLIBS -ldk4base"
-DKCTLIBF='libdk3.a'
-DKCTLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-ADDCTRLDLIBF='libdk3.a'
-ADDCTRLDLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKDBTLIBF='libdk3.a'
-DKDBTLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-ITADMINLIBF='libdk3.a'
-ITADMINLIBS='-ldk3 -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) $(RTLIB)'
-BMPPLIBF='libdk3.a'
-BMPPLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-FIG2LATLIBF='libdk3.a'
-FIG2LATLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-HTMLBOOKLIBF='libdk3.a'
-HTMLBOOKLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-DK3INFOLIBF='libdk3.a'
-DK3INFOLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-PLPDFTEXLIBF='libdk3.a'
-PLPDFTEXLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-DKWXWIZLIBF='libdk3.a'
-DKWXWIZLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKCTLIBF='libdk3.a'
-WXDKCTLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXBMPPLIBF='libdk3.a'
-WXBMPPLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXIMGSZLIBF='libdk3.a'
-WXIMGSZLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKCLOCKLIBF='libdk3.a'
-WXDKCLOCKLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKHTBLIBF='libdk3.a'
-WXDKHTBLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
-PRINTQDILIBF='libdk3.a'
-PRINTQDILIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-PRINTQDALIBF='libdk3.a'
-PRINTQDALIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-
-DKCATLIBF="libdk4.a"
-DKCATLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKBLKSLIBF="libdk4.a"
-DKBLKSLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKSQLSPLITLIBF="libdk4.a"
-DKSQLSPLITLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKERADISKLIBF="libdk4.a"
-DKERADISKLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKLSLIBF="libdk4.a"
-DKLSLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKSORTLIBF="libdk4.a"
-DKSORTLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKFICLIBF="libdk4.a"
-DKFICLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKUIDLIBF="libdk4.a"
-DKUIDLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKPWGENLIBF="libdk4.a"
-DKPWGENLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKRANDLIBF="libdk4.a"
-DKRANDLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKT2HLIBF="libdk4.a"
-DKT2HLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKT2LLIBF="libdk4.a"
-DKT2LLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKHEXLIBF="libdk4.a"
-DKHEXLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKBMMLIBF="libdk4.a"
-DKBMMLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKPWDLIBF="libdk4.a"
-DKPWDLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKRECVLIBF="libdk4.a"
-DKRECVLIBS='-ldk4 $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-DKSENDLIBF="libdk4.a"
-DKSENDLIBS='-ldk4 $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-DKDBT2LIBF="libdk4.a"
-DKDBT2LIBS='-ldk4 $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
-DK4INFOLIBF="libdk4.a"
-DK4INFOLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-LPRNGCLLIBF="libdk4.a"
-LPRNGCLLIBS='-ldk4 $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-WXDKFCSLIBF="libdk4.a"
-WXDKFCSLIBS='-ldk4 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXPQDICLIBF="libdk4.a"
-WXPQDICLIBS='-ldk4 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-PJSNMPLIBF="libdk4.a"
-PJSNMPLIBS='-ldk4 $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
-PRMONSNMPLIBF="libdk4.a"
-PRMONSNMPLIBS='-ldk4 $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
-PRINTQDLIBF="libdk4.a"
-PRINTQDLIBS='-ldk4 $(DBLIB) $(SOCKLIB) $(NSLLIB)'
-PRINTQDCLIBF="libdk4.a"
-PRINTQDCLIBS='-ldk4 $(SOCKLIB) $(NSLLIB)'
-RSHDOWNLIBF="libdk4.a"
-RSHDOWNLIBS='-ldk4 $(SOCKLIB) $(NSLLIB)'
-
-LIB_SH_RES='$(LIB_SH_RES_NO_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_NO_PACKAGING)'
-LIB_SH_GUI='$(LIB_SH_GUI_NO_PACKAGING)'
-if [ "X$ENAPACKAGING" = "Xyes" ]
+VERSNO=`cat version.txt`
+SOVERS=`echo $VERSNO | sed -e 's/\.[01-9][01-9]*$//'`
+
+
+CFL_CLI_C8='$(CPPFLAGS) $(CFLAGS)'
+
+CFL_CLI_DK='$(CPPFLAGS) $(CFLAGS)'
+
+CXXFL_CLI_C8='$(CPPFLAGS) $(CXXFLAGS)'
+
+CXXFL_CLI_DK='$(CPPFLAGS) $(CXXFLAGS)'
+
+CXXFL_CLI_WX='$(CPPFLAGS) $(CXXFLAGS)'
+
+CXXFL_GUI='$(CPPFLAGS) $(CXXFLAGS)'
+
+LDFLC_CLI_C8='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLC_CLI_DK='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLCXX_CLI_C8='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLCXX_CLI_DK='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLCXX_CLI_WX='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLCXX_GUI='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+RPATH=''
+RPATHLINK=''
+MKSORPATH=''
+MKSORPATHLINK=''
+MKSOCHECKSYMBOLS=''
+
+if [ "X$LD_LIBRARY_PATH" != "X" -a "X$TOOLCHAIN" = "Xworkshop" ]
then
-LIB_SH_RES='$(LIB_SH_RES_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_PACKAGING)'
-LIB_SH_GUI='$(LIB_SH_GUI_PACKAGING)'
+ RPATH="-R${LD_LIBRARY_PATH}"
+fi
+
+
+SUITE='auto'
+
+@%:@ Check whether --with-suite was given.
+if test "${with_suite+set}" = set; then :
+ withval=$with_suite; SUITE=$withval
fi
-if [ "X$CC" = "Xgcc" -a "X$UNAME" = "XLinux" ]
+if [ "X$SUITE" != "Xgui" -a "X$SUITE" != "Xcli" -a "X$SUITE" != "Xrescue" ]
then
- USESOLINKING="yes"
+ SUITE='auto'
+fi
+
+FOUND_SYSTEMD='no'
+ENA_SYSTEMD='auto'
+systemddir=''
+
+@%:@ Check whether --with-systemd was given.
+if test "${with_systemd+set}" = set; then :
+ withval=$with_systemd; systemddir=$withval;FOUND_SYSTEMD='yes';ENA_SYSTEMD='yes'
fi
-if [ "X$SHLIBSTYLE" = "Xworkshop" -o "X$FORCESOLINKING" = "Xyes" ]
+
+if [ "X$systemddir" = "Xyes" ]
+then
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ systemddir=''
+elif [ "X$systemddir" = "Xno" ]
then
- USESOLINKING="yes"
+ ENA_SYSTEMD='no'
+ FOUND_SYSTEMD='no'
+ systemddir=''
fi
+WIN_VER_TEXT='auto'
+WINVER=0x0601
-case "X$SHLIBSTYLE" in
- "Xgcc")
- CFPIC='-fPIC -D_REENTRANT'
- if [ "X$USESOLINKING" = "Xyes" ]
- then
- MKSOLIB='$(COMPILEC) -L. $(RPATHLINK) $(LIBRARIES) $(LDFLAGS) -shared -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
- else
- MKSOLIB='$(COMPILEC) $(LIBRARIES) $(LDFLAGS) -shared -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
+@%:@ Check whether --with-windows was given.
+if test "${with_windows+set}" = set; then :
+ withval=$with_windows;
+WIN_VER_TEXT=$withval
+if [ "X$TARGETCLASS" != "Xwindows" ]
+then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-windows=... is for Windows builds only!" >&5
+$as_echo "$as_me: WARNING: Option --with-windows=... is for Windows builds only!" >&2;}
+fi
+
+fi
+
+case X$WIN_VER_TEXT in
+ X7)
+ WINVER=0x0601
+ ;;
+ XXP)
+ WINVER=0x0501
+ ;;
+ *)
+ WINVER=0x0601
+ ;;
+esac
+if [ "X$TARGETCLASS" = "Xwindows" ]
+then
+ CPPFLAGS="$CPPFLAGS -DWINVER=$WINVER -D_WIN32_WINNT=$WINVER"
+ CFLAGS="$CFLAGS -DWINVER=$WINVER -D_WIN32_WINNT=$WINVER"
+ CFL_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CFL_CLI_C8"
+ CFL_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CFL_CLI_DK"
+ CXXFL_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_C8"
+ CXXFL_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_DK"
+ CXXFL_CLI_WX="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_WX"
+ CXXFL_GUI="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_GUI"
+ LDFLC_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLC_CLI_C8"
+ LDFLC_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLC_CLI_DK"
+ LDFLCXX_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_C8"
+ LDFLCXX_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_DK"
+ LDFLCXX_CLI_WX="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_WX"
+ LDFLCXX_GUI="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_GUI"
+fi
+
+ENA_DEVEL='yes'
+@%:@ Check whether --enable-devel was given.
+if test "${enable_devel+set}" = set; then :
+ enableval=$enable_devel; ENA_DEVEL=$enableval
+fi
+
+if [ "X$ENA_DEVEL" != "Xno" ]
+then
+ ENA_DEVEL='yes'
+fi
+
+ENA_STATIC='auto'
+@%:@ Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; ENA_STATIC=$enableval
+fi
+
+
+ENA_SHARED='auto'
+@%:@ Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; ENA_SHARED=$enableval
+fi
+
+
+if [ "X$ENA_STATIC" != "Xyes" -a "X$ENA_STATIC" != "Xauto" ]
+then
+ ENA_STATIC='no'
+fi
+if [ "X$ENA_SHARED" != "Xyes" -a "X$ENA_SHARED" != "Xauto" ]
+then
+ ENA_SHARED='no'
+fi
+
+ENA_PACKAGE='no'
+@%:@ Check whether --enable-packaging was given.
+if test "${enable_packaging+set}" = set; then :
+ enableval=$enable_packaging; ENA_PACKAGE=$enableval
+fi
+
+if [ "X$ENA_PACKAGE" != "Xyes" ]
+then
+ ENA_PACKAGE='no'
+fi
+
+ENA_SOSO='no'
+@%:@ Check whether --enable-link-so-so was given.
+if test "${enable_link_so_so+set}" = set; then :
+ enableval=$enable_link_so_so; ENA_SOSO=$enableval
+fi
+
+if [ "X$ENA_SOSO" != "Xyes" ]
+then
+ ENA_SOSO='no'
+fi
+
+ENA_RPATH='no'
+@%:@ Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+ enableval=$enable_rpath; ENA_RPATH=$enableval
+fi
+
+if [ "X$ENA_RPATH" != "Xyes" ]
+then
+ ENA_RPATH='no'
+fi
+
+ENA_MAN='yes'
+@%:@ Check whether --enable-man-pages was given.
+if test "${enable_man_pages+set}" = set; then :
+ enableval=$enable_man_pages; ENA_MAN=$enableval
+fi
+
+if [ "X$ENA_MAN" != "Xno" ]
+then
+ ENA_MAN='yes'
+fi
+
+ENA_DEBUG='no'
+@%:@ Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+ enableval=$enable_debug; ENA_DEBUG=$enableval
+fi
+
+if [ "X$ENA_DEBUG" != "Xyes" ]
+then
+ ENA_DEBUG='no'
+fi
+
+ENA_WARN='no'
+@%:@ Check whether --enable-warnings was given.
+if test "${enable_warnings+set}" = set; then :
+ enableval=$enable_warnings; ENA_WARN=$enableval
+fi
+
+if [ "X$ENA_WARN" != "Xno" ]
+then
+ ENA_WARN='yes'
+fi
+
+case X$TOOLCHAIN/X$ENA_WARN/X$ENA_DEBUG in
+ Xgcc/Xyes/*)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xgcc/*/Xyes)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xclang/Xyes/*)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xclang/*/Xyes)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+esac
+
+
+
+
+ENA_ASSERT='no'
+@%:@ Check whether --enable-assert was given.
+if test "${enable_assert+set}" = set; then :
+ enableval=$enable_assert; ENA_ASSERT=$enableval
+fi
+
+if [ "X$ENA_ASSERT" != "Xyes" ]
+then
+ ENA_ASSERT='no'
+fi
+
+ENA_SUNOS_CORR='no'
+@%:@ Check whether --enable-corrections was given.
+if test "${enable_corrections+set}" = set; then :
+ enableval=$enable_corrections; ENA_SUNOS_CORR=$enableval
+fi
+
+if [ "X$ENA_SUNOS_CORR" != "Xyes" ]
+then
+ ENA_SUNOS_CORR='no'
+fi
+
+ENA_FALLBACK='no'
+@%:@ Check whether --enable-fallback was given.
+if test "${enable_fallback+set}" = set; then :
+ enableval=$enable_fallback; ENA_FALLBACK=$enableval
+fi
+
+if [ "X$ENA_FALLBACK" != "Xno" ]
+then
+ $as_echo "@%:@define USE_FALLBACK_NUMERIC_LIMITS 1" >>confdefs.h
+
+fi
+
+$as_echo "@%:@define USE_PRINTF_SCANF 1" >>confdefs.h
+
+
+case X$ENA_PACKAGE/X$ENA_STATIC/X$ENA_SHARED in
+ Xno/Xno/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Static linking enabled" >&5
+$as_echo "$as_me: WARNING: Static linking enabled" >&2;}
+ ;;
+ Xno/Xno/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xno/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xauto/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xauto/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xauto/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xyes/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xyes/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xyes/Xyes)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xno/Xno)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Shared linking enabled" >&5
+$as_echo "$as_me: WARNING: Shared linking enabled" >&2;}
+ ;;
+ Xyes/Xno/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xno/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xauto/Xno)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Shared linking enabled" >&5
+$as_echo "$as_me: WARNING: Shared linking enabled" >&2;}
+ ;;
+ Xyes/Xauto/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xauto/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xyes/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Shared linking enabled" >&5
+$as_echo "$as_me: WARNING: Shared linking enabled" >&2;}
+ ;;
+ Xyes/Xyes/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xyes/Xyes)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
+esac
+
+
+EXEEXT=''
+if [ "X$TARGETCLASS" = "Xwindows" ]
+then
+ EXEEXT='.exe'
+fi
+
+OBJEXT='o'
+if [ "X$TOOLCHAIN" = "Xmsvc" ]
+then
+ OBJEXT='obj'
+fi
+
+RCEXT='rc'
+RESEXT='o'
+RESCRULE='echo "ERROR: No resource compiler available!"'
+RCFLAGS='-I. -D_UNICODE=1 -DUNICODE=1 -Igui-img/icons'
+if [ "X$TOOLCHAIN" = "Xmsvc" ]
+then
+ RESEXT='res'
+fi
+if [ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]
+then
+ RESCRULE='$(RC) $(RCFLAGS) $< $@'
+elif [ "X$TOOLCHAIN" = "Xmsvc" ]
+then
+ RESCRULE='$(RC) $(RCFLAGS) -out:$@ $<'
+fi
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
fi
- ;;
- "Xworkshop")
- if [ "X$ENASHARED" != "Xno" ]
- then
- CFPIC='-Bdynamic -dy -xcode=pic32 -D_REENTRANT'
- else
- CFPIC='-xcode=pic32 -D_REENTRANT'
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
fi
- MKSOLIB='$(COMPILEC) -L. $(LIBRARIES) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
- ;;
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-if [ "X$LD_LIBRARY_PATH" != "X" -a "X$SHLIBSTYLE" = "Xworkshop" ]
-then
- RPATH="-R${LD_LIBRARY_PATH}"
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
fi
-ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
-if test "x$ac_cv_header_errno_h" = xyes; then :
- $as_echo "@%:@define HAVE_ERRNO_H 1" >>confdefs.h
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
-ac_fn_c_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default"
-if test "x$ac_cv_header_assert_h" = xyes; then :
- $as_echo "@%:@define HAVE_ASSERT_H 1" >>confdefs.h
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h
+
+fi
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
+done
+
ac_fn_c_check_header_mongrel "$LINENO" "complex.h" "ac_cv_header_complex_h" "$ac_includes_default"
if test "x$ac_cv_header_complex_h" = xyes; then :
@@ -5787,6 +5804,13 @@ if test "x$ac_cv_header_stdlib_h" = xyes; then :
fi
+ac_fn_c_check_header_mongrel "$LINENO" "sysexits.h" "ac_cv_header_sysexits_h" "$ac_includes_default"
+if test "x$ac_cv_header_sysexits_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYSEXITS_H 1" >>confdefs.h
+
+fi
+
+
ac_fn_c_check_header_mongrel "$LINENO" "stdnoreturn.h" "ac_cv_header_stdnoreturn_h" "$ac_includes_default"
if test "x$ac_cv_header_stdnoreturn_h" = xyes; then :
$as_echo "@%:@define HAVE_STDNORETURN_H 1" >>confdefs.h
@@ -5843,9 +5867,36 @@ if test "x$ac_cv_header_wctype_h" = xyes; then :
fi
+ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_errno_h" = xyes; then :
+ $as_echo "@%:@define HAVE_ERRNO_H 1" >>confdefs.h
+fi
+FOUND_ASSERT_H='no'
+ac_fn_c_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default"
+if test "x$ac_cv_header_assert_h" = xyes; then :
+ FOUND_ASSERT_H='yes';$as_echo "@%:@define HAVE_ASSERT_H 1" >>confdefs.h
+
+fi
+
+
+if [ "X$FOUND_ASSERT_H" = "Xno" -a "X$ENA_ASSERT" = "Xyes" ]
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Assertions enabled but assert.h not found!" >&5
+$as_echo "$as_me: WARNING: Assertions enabled but assert.h not found!" >&2;}
+elif [ "X$ENA_ASSERT" = "Xyes" ]
+then
+ CFLAGS="$CFLAGS -DDK4_USE_ASSERT=1"
+ CFL_CLI_C8="$CFL_CLI_C8 -DDK4_USE_ASSERT=1"
+ CFL_CLI_DK="$CFL_CLI_DK -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -DDK4_USE_ASSERT=1"
+ CXXFL_GUI="$CXXFL_GUI -DDK4_USE_ASSERT=1"
+fi
+
ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_types_h" = xyes; then :
$as_echo "@%:@define HAVE_SYS_TYPES_H 1" >>confdefs.h
@@ -5979,6 +6030,13 @@ if test "x$ac_cv_header_pwd_h" = xyes; then :
fi
+ac_fn_c_check_header_mongrel "$LINENO" "memory.h" "ac_cv_header_memory_h" "$ac_includes_default"
+if test "x$ac_cv_header_memory_h" = xyes; then :
+ $as_echo "@%:@define HAVE_MEMORY_H 1" >>confdefs.h
+
+fi
+
+
ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default"
if test "x$ac_cv_header_strings_h" = xyes; then :
$as_echo "@%:@define HAVE_STRINGS_H 1" >>confdefs.h
@@ -6000,6 +6058,13 @@ if test "x$ac_cv_header_bios_h" = xyes; then :
fi
+ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
+if test "x$ac_cv_header_search_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SEARCH_H 1" >>confdefs.h
+
+fi
+
+
ac_fn_c_check_header_mongrel "$LINENO" "dos.h" "ac_cv_header_dos_h" "$ac_includes_default"
if test "x$ac_cv_header_dos_h" = xyes; then :
$as_echo "@%:@define HAVE_DOS_H 1" >>confdefs.h
@@ -6035,51 +6100,184 @@ if test "x$ac_cv_header_direct_h" = xyes; then :
fi
-ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = xyes; then :
- ZLIB="-lz";$as_echo "@%:@define HAVE_ZLIB_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdio_h" = xyes; then :
+ $as_echo "@%:@define HAVE_STDIO_H 1" >>confdefs.h
fi
-ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = xyes; then :
- BZLIB="-lbz2";$as_echo "@%:@define HAVE_BZLIB_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "conio.h" "ac_cv_header_conio_h" "$ac_includes_default"
+if test "x$ac_cv_header_conio_h" = xyes; then :
+ $as_echo "@%:@define HAVE_CONIO_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_mongrel "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default"
+if test "x$ac_cv_header_grp_h" = xyes; then :
+ $as_echo "@%:@define HAVE_GRP_H 1" >>confdefs.h
-CRYPTO=""
-PROGSOPENSSL=""
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/rand.h" "ac_cv_header_openssl_rand_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_rand_h" = xyes; then :
-
-CRYPTO="-lcrypto"
-PROGSOPENSSL='dk-fic$(EXEEXT) dk-pwgen$(EXEEXT) dk-rand$(EXEEXT)'
-$as_echo "@%:@define HAVE_OPENSSL_RAND_H 1" >>confdefs.h
+fi
+ac_fn_c_check_header_mongrel "$LINENO" "dir.h" "ac_cv_header_dir_h" "$ac_includes_default"
+if test "x$ac_cv_header_dir_h" = xyes; then :
+ $as_echo "@%:@define HAVE_DIR_H 1" >>confdefs.h
+
fi
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_md5_h" = xyes; then :
- $as_echo "@%:@define HAVE_OPENSSL_MD5_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "err.h" "ac_cv_header_err_h" "$ac_includes_default"
+if test "x$ac_cv_header_err_h" = xyes; then :
+ $as_echo "@%:@define HAVE_ERR_H 1" >>confdefs.h
fi
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_sha_h" = xyes; then :
- $as_echo "@%:@define HAVE_OPENSSL_SHA_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default"
+if test "x$ac_cv_header_shadow_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SHADOW_H 1" >>confdefs.h
fi
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/ripemd.h" "ac_cv_header_openssl_ripemd_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_ripemd_h" = xyes; then :
- $as_echo "@%:@define HAVE_OPENSSL_RIPEMD_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$ac_includes_default"
+if test "x$ac_cv_header_stropts_h" = xyes; then :
+ $as_echo "@%:@define HAVE_STROPTS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
+if test "x$ac_cv_header_syslog_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYSLOG_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sysres.h" "ac_cv_header_sysres_h" "$ac_includes_default"
+if test "x$ac_cv_header_sysres_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYSRES_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default"
+if test "x$ac_cv_header_termios_h" = xyes; then :
+ $as_echo "@%:@define HAVE_TERMIOS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "vararg.h" "ac_cv_header_vararg_h" "$ac_includes_default"
+if test "x$ac_cv_header_vararg_h" = xyes; then :
+ $as_echo "@%:@define HAVE_VARARG_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "varargs.h" "ac_cv_header_varargs_h" "$ac_includes_default"
+if test "x$ac_cv_header_varargs_h" = xyes; then :
+ $as_echo "@%:@define HAVE_VARARGS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "ntifs.h" "ac_cv_header_ntifs_h" "$ac_includes_default"
+if test "x$ac_cv_header_ntifs_h" = xyes; then :
+ $as_echo "@%:@define HAVE_NTIFS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_file_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_FILE_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_resource_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_RESOURCE_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_statvfs_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_STATVFS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/stropts.h" "ac_cv_header_sys_stropts_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_stropts_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_STROPTS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/sunddi.h" "ac_cv_header_sys_sunddi_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sunddi_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_SUNDDI_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_SYSCTL_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/systeminfo.h" "ac_cv_header_sys_systeminfo_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_systeminfo_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_SYSTEMINFO_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/termios.h" "ac_cv_header_sys_termios_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_termios_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_TERMIOS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/ttold.h" "ac_cv_header_sys_ttold_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_ttold_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_TTOLD_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_uio_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_UIO_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_wait_h" = xyes; then :
+ $as_echo "@%:@define HAVE_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "lprng.h" "ac_cv_header_lprng_h" "$ac_includes_default"
+if test "x$ac_cv_header_lprng_h" = xyes; then :
+ $as_echo "@%:@define HAVE_LPRNG_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+ PTHREADLIB='-lpthread';$as_echo "@%:@define HAVE_PTHREAD_H 1" >>confdefs.h
fi
@@ -6121,8 +6319,274 @@ $as_echo "@%:@define TIME_WITH_SYS_TIME 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking longlong" >&5
-$as_echo_n "checking longlong... " >&6; }
+ac_fn_c_check_header_compile "$LINENO" "winbase.h" "ac_cv_header_winbase_h" "
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+"
+if test "x$ac_cv_header_winbase_h" = xyes; then :
+ $as_echo "@%:@define HAVE_WINBASE_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_compile "$LINENO" "winreg.h" "ac_cv_header_winreg_h" "
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+#if HAVE_WINBASE_H
+#include <winbase.h>
+#endif
+
+"
+if test "x$ac_cv_header_winreg_h" = xyes; then :
+ $as_echo "@%:@define HAVE_WINREG_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_compile "$LINENO" "wincon.h" "ac_cv_header_wincon_h" "
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+#if HAVE_WINBASE_H
+#include <winbase.h>
+#endif
+
+"
+if test "x$ac_cv_header_wincon_h" = xyes; then :
+ $as_echo "@%:@define HAVE_WINCON_H 1" >>confdefs.h
+
+fi
+
+
+
+FOUND_ZLIB='no'
+ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+ ZLIB='-lz';FOUND_ZLIB='yes';$as_echo "@%:@define HAVE_ZLIB_H 1" >>confdefs.h
+
+fi
+
+
+FOUND_BZLIB='no'
+ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
+ BZLIB='-lbz2';FOUND_BZLIB='yes';$as_echo "@%:@define HAVE_BZLIB_H 1" >>confdefs.h
+
+fi
+
+
+
+FOUND_OPENSSL='no'
+CRYPTO=''
+ac_fn_c_check_header_mongrel "$LINENO" "openssl/rand.h" "ac_cv_header_openssl_rand_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_rand_h" = xyes; then :
+
+FOUND_OPENSSL='yes'
+CRYPTO='-lcrypto'
+PRG_CLI_SSL='$(PRG_CLI_SSL)'
+MAN_CLI_SSL='$(MAN_CLI_SSL)'
+RES_CLI_SSL='$(RES_CLI_SSL)'
+PRG_GUI_SSL='$(PRG_GUI_SSL)'
+MAN_GUI_SSL='$(MAN_GUI_SSL)'
+RES_GUI_SSL='$(RES_GUI_SSL)'
+$as_echo "@%:@define HAVE_OPENSSL_RAND_H 1" >>confdefs.h
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_md5_h" = xyes; then :
+ $as_echo "@%:@define HAVE_OPENSSL_MD5_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_sha_h" = xyes; then :
+ $as_echo "@%:@define HAVE_OPENSSL_SHA_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "openssl/ripemd.h" "ac_cv_header_openssl_ripemd_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_ripemd_h" = xyes; then :
+ $as_echo "@%:@define HAVE_OPENSSL_RIPEMD_H 1" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Init in -lcrypto" >&5
+$as_echo_n "checking for SHA224_Init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA224_Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA224_Init ();
+int
+main ()
+{
+return SHA224_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA224_Init=yes
+else
+ ac_cv_lib_crypto_SHA224_Init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Init" >&5
+$as_echo "$ac_cv_lib_crypto_SHA224_Init" >&6; }
+if test "x$ac_cv_lib_crypto_SHA224_Init" = xyes; then :
+ $as_echo "@%:@define HAVE_SHA224 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Init in -lcrypto" >&5
+$as_echo_n "checking for SHA256_Init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA256_Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA256_Init ();
+int
+main ()
+{
+return SHA256_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA256_Init=yes
+else
+ ac_cv_lib_crypto_SHA256_Init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Init" >&5
+$as_echo "$ac_cv_lib_crypto_SHA256_Init" >&6; }
+if test "x$ac_cv_lib_crypto_SHA256_Init" = xyes; then :
+ $as_echo "@%:@define HAVE_SHA256 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA384_Init in -lcrypto" >&5
+$as_echo_n "checking for SHA384_Init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA384_Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA384_Init ();
+int
+main ()
+{
+return SHA384_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA384_Init=yes
+else
+ ac_cv_lib_crypto_SHA384_Init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA384_Init" >&5
+$as_echo "$ac_cv_lib_crypto_SHA384_Init" >&6; }
+if test "x$ac_cv_lib_crypto_SHA384_Init" = xyes; then :
+ $as_echo "@%:@define HAVE_SHA384 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Init in -lcrypto" >&5
+$as_echo_n "checking for SHA512_Init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA512_Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA512_Init ();
+int
+main ()
+{
+return SHA512_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA512_Init=yes
+else
+ ac_cv_lib_crypto_SHA512_Init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Init" >&5
+$as_echo "$ac_cv_lib_crypto_SHA512_Init" >&6; }
+if test "x$ac_cv_lib_crypto_SHA512_Init" = xyes; then :
+ $as_echo "@%:@define HAVE_SHA512 1" >>confdefs.h
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking long long" >&5
+$as_echo_n "checking long long... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -6149,8 +6613,8 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking longdouble" >&5
-$as_echo_n "checking longdouble... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking long double" >&5
+$as_echo_n "checking long double... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -6177,7 +6641,7 @@ else
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-DOINTMAXSIZECHECK="no"
+DOINTMAXSIZECHECK='no'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking intmax_t" >&5
$as_echo_n "checking intmax_t... " >&6; }
@@ -6203,7 +6667,7 @@ intmax_t im;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- DOINTMAXSIZECHECK="yes";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ DOINTMAXSIZECHECK='yes';{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_INTMAX_T 1" >>confdefs.h
else
@@ -6212,18 +6676,19 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking volatile" >&5
-$as_echo_n "checking volatile... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sig_atomic_t" >&5
+$as_echo_n "checking sig_atomic_t... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-volatile int i = 0;
+#include <sys/types.h>
+#include <signal.h>
int
main ()
{
-i = 1;
+sig_atomic_t sat;
;
return 0;
@@ -6231,7 +6696,7 @@ i = 1;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_VOLATILE 1" >>confdefs.h
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_SIG_ATOMIC_T 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -6239,19 +6704,291 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sig_atomic_t" >&5
-$as_echo_n "checking sig_atomic_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ssize_t" >&5
+$as_echo_n "checking ssize_t... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
#include <sys/types.h>
-#include <signal.h>
+#endif
int
main ()
{
-sig_atomic_t sat;
+ ssize_t sz;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_SSIZE_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int8_t" >&5
+$as_echo_n "checking int8_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+int8_t i8 = 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_INT8_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int16_t" >&5
+$as_echo_n "checking int16_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+int16_t i16 = 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_INT16_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int32_t" >&5
+$as_echo_n "checking int32_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+int32_t i32 = 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_INT32_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint8_t" >&5
+$as_echo_n "checking uint8_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+ uint8_t sz;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_UINT8_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint16_t" >&5
+$as_echo_n "checking uint16_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+ uint16_t sz;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_UINT16_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t" >&5
+$as_echo_n "checking uint32_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+ uint32_t sz;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_UINT32_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dev_t" >&5
+$as_echo_n "checking dev_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ dev_t devno;
;
return 0;
@@ -6259,7 +6996,555 @@ sig_atomic_t sat;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_SIG_ATOMIC_T 1" >>confdefs.h
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_DEV_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _dev_t" >&5
+$as_echo_n "checking _dev_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ _dev_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE__DEV_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ino_t" >&5
+$as_echo_n "checking ino_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ ino_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_INO_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _ino_t" >&5
+$as_echo_n "checking _ino_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ _ino_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE__INO_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ino64_t" >&5
+$as_echo_n "checking ino64_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ ino64_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_INO64_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mode_t" >&5
+$as_echo_n "checking mode_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ mode_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_MODE_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking nlink_t" >&5
+$as_echo_n "checking nlink_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ nlink_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_NLINK_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking off_t" >&5
+$as_echo_n "checking off_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ off_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_OFF_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking off64_t" >&5
+$as_echo_n "checking off64_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ off64_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_OFF64_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blksize_t" >&5
+$as_echo_n "checking blksize_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ blksize_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_BLKSIZE_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blkcnt_t" >&5
+$as_echo_n "checking blkcnt_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ blkcnt_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_BLKCNT_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fpos_t" >&5
+$as_echo_n "checking fpos_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ fpos_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_FPOS_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _fpos_t" >&5
+$as_echo_n "checking _fpos_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ _fpos_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE__FPOS_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uid_t" >&5
+$as_echo_n "checking uid_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ uid_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_UID_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gid_t" >&5
+$as_echo_n "checking gid_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ gid_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_GID_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking wchar_t" >&5
+$as_echo_n "checking wchar_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <wchar.h>
+
+int
+main ()
+{
+
+ wchar_t chr;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_WCHAR_T 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -6432,42 +7717,39 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-if [ "X$DOINTMAXSIZECHECK" = "Xyes" ]
-then
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intmax_t" >&5
-$as_echo_n "checking size of intmax_t... " >&6; }
-if ${ac_cv_sizeof_intmax_t+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int32_t" >&5
+$as_echo_n "checking size of int32_t... " >&6; }
+if ${ac_cv_sizeof_int32_t+:} false; then :
$as_echo_n "(cached) " >&6
else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intmax_t))" "ac_cv_sizeof_intmax_t" "$ac_includes_default"; then :
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int32_t))" "ac_cv_sizeof_int32_t" "$ac_includes_default"; then :
else
- if test "$ac_cv_type_intmax_t" = yes; then
+ if test "$ac_cv_type_int32_t" = yes; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (intmax_t)
+as_fn_error 77 "cannot compute sizeof (int32_t)
See \`config.log' for more details" "$LINENO" 5; }
else
- ac_cv_sizeof_intmax_t=0
+ ac_cv_sizeof_int32_t=0
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_intmax_t" >&5
-$as_echo "$ac_cv_sizeof_intmax_t" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int32_t" >&5
+$as_echo "$ac_cv_sizeof_int32_t" >&6; }
cat >>confdefs.h <<_ACEOF
-@%:@define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+@%:@define SIZEOF_INT32_T $ac_cv_sizeof_int32_t
_ACEOF
-fi
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -6567,6 +7849,687 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if ${ac_cv_sizeof_off_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
+$as_echo_n "checking size of ino_t... " >&6; }
+if ${ac_cv_sizeof_ino_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_ino_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ino_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_ino_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
+$as_echo "$ac_cv_sizeof_ino_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define SIZEOF_INO_T $ac_cv_sizeof_ino_t
+_ACEOF
+
+
+if [ "X$DOINTMAXSIZECHECK" = "Xyes" ]
+then
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intmax_t" >&5
+$as_echo_n "checking size of intmax_t... " >&6; }
+if ${ac_cv_sizeof_intmax_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intmax_t))" "ac_cv_sizeof_intmax_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_intmax_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (intmax_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_intmax_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_intmax_t" >&5
+$as_echo "$ac_cv_sizeof_intmax_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+_ACEOF
+
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking const" >&5
+$as_echo_n "checking const... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+static char const msg[] = { "Test" };
+
+int
+main ()
+{
+
+fputs(msg, stdout);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_CONST 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking inline" >&5
+$as_echo_n "checking inline... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+inline
+int
+summe(int a, int b)
+{
+ return (a + b);
+}
+
+int
+main ()
+{
+
+int i = 5;
+int j = 6;
+int k;
+k = summe(i, j);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };FOUNDINLINE='yes'
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if [ "X$FOUNDINLINE" = "Xyes" ]
+then
+ $as_echo "@%:@define HAVE_INLINE 1" >>confdefs.h
+
+fi
+if [ "X$FOUNDINLINE" = "Xyes" -a "X$USEINLINE" = "Xyes" ]
+then
+ $as_echo "@%:@define USE_INLINE 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking volatile" >&5
+$as_echo_n "checking volatile... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+volatile int i = 0;
+
+int
+main ()
+{
+
+i = 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_VOLATILE 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking __attribute__((unused))" >&5
+$as_echo_n "checking __attribute__((unused))... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+static
+int
+my_add(int a, int b, int c __attribute__((unused)) )
+{
+ return (a + b);
+}
+
+int
+main ()
+{
+
+ int i;
+ i = my_add(1, 2, 3);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "@%:@define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking use of twos complement for negative integers" >&5
+$as_echo_n "checking use of twos complement for negative integers... " >&6; }
+if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_TWOS_COMPLEMENT 1" >>confdefs.h
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_PROCESS_H
+#include <process.h>
+#endif
+
+int i1 = -1;
+
+#if SIZEOF_INT > 2
+#if SIZEOF_INT > 4
+#if SIZEOF_INT > 8
+#error "No test available yet for integers larger than 8 bytes!"
+#else
+int i2 = 0xFFFFFFFFFFFFFFFF;
+#endif
+#else
+int i2 = 0xFFFFFFFF;
+#endif
+#else
+int i2 = 0xFFFF;
+#endif
+
+int main(int argc, char *argv[])
+{
+ int exval = 1;
+ if (i1 == i2) exval = 0;
+ exit(exval); return exval;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_TWOS_COMPLEMENT 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+IEEE_754_DOUBLE_WISHED='yes'
+IEEE_754_DOUBLE_FOUND='no'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IEEE 754 double" >&5
+$as_echo_n "checking IEEE 754 double... " >&6; }
+if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };IEEE_754_DOUBLE_FOUND='yes'
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include <math.h>
+
+static double td[] = {
+ INFINITY,
+ 1234.75,
+ 4.0,
+ 1.0,
+ 0.375,
+ 0.0,
+ -0.625,
+ -1.0,
+ -8.0,
+ -23.875,
+ -INFINITY
+};
+
+#if WORDS_BIGENDIAN
+static unsigned char tuc[] = {
+ /* INF */ 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 1234.75 */ 0x40, 0x93, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 4.0 */ 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 1.0 */ 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0.375 */ 0x3F, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -0.625 */ 0xBF, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -1.0 */ 0xBF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -8.0 */ 0xC0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -23.875 */ 0xC0, 0x37, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -INF */ 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+#else
+static unsigned char tuc[] = {
+ /* INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F,
+ /* 1234.75 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x93, 0x40,
+ /* 4.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40,
+ /* 1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F,
+ /* 0.375 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x3F,
+ /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -0.625 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xBF,
+ /* -1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF,
+ /* -8.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xC0,
+ /* -23.875 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x37, 0xC0,
+ /* -INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF
+};
+#endif
+
+static
+#ifdef __cplusplus
+int
+test_double(double *dp, unsigned char *up)
+#else
+int
+test_double(dp, up)
+ double *dp;
+ unsigned char *up;
+#endif
+{
+ int back = 0;
+#if HAVE_MEMCMP
+ if(memcmp(dp, up, 8) == 0) {
+ back = 1;
+ }
+#else
+#if HAVE_BCMP
+ if(bcmp(dp, up, 8) == 0) {
+ back = 1;
+ }
+#else
+ unsigned char *cp1;
+ unsigned char *cp2;
+ size_t i;
+ back = 1;
+ cp1 = (unsigned char *)dp; cp2 = up;
+ for(i = 0; i < 8; i++) {
+ if(*(cp1++) != *(cp2++)) {
+ back = 0;
+ }
+ }
+#endif
+#endif
+ if(1 != back) {
+ printf("ERROR: %lg not conforming to IEEE 754!\n", *dp);
+ }
+ return back;
+}
+
+#ifdef __cplusplus
+int main(int argc, char *argv[])
+#else
+int main(argc, argv)
+ int argc;
+ char *argv[];
+#endif
+{
+ unsigned char *ucp;
+ double *dp;
+ size_t i;
+ int ev = 1;
+
+ if(8 == sizeof(double)) {
+ ev = 0;
+ ucp = tuc; dp = td;
+ for(i = 0; i < (sizeof(td)/sizeof(double)); i++) {
+ if(!test_double(dp, ucp)) {
+ ev = 1;
+ }
+ dp++;
+ ucp += 8;
+ }
+ } else {
+ printf("ERROR: Size of double is not 1!\n");
+ }
+ exit(ev);
+}
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };IEEE_754_DOUBLE_FOUND='yes'
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; };IEEE_754_DOUBLE_FOUND='no'
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+if [ "X$IEEE_754_DOUBLE_FOUND$IEEE_754_DOUBLE_WISHED" = "Xyesyes" ]
+then
+ $as_echo "@%:@define HAVE_IEEE_754_DOUBLE 1" >>confdefs.h
+
+else
+ IEEE_754_DOUBLE_FOUND='no'
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _LARGEFILE64_SOURCE" >&5
$as_echo_n "checking _LARGEFILE64_SOURCE... " >&6; }
@@ -6608,6 +8571,54 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blocksize and blockcount in stat output" >&5
+$as_echo_n "checking blocksize and blockcount in stat output... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+#if HAVE_TYPE_STAT64
+ struct stat64 stb;
+ stb.st_blksize = 0;
+ stb.st_blocks = 0;
+#else
+ struct stat stb;
+ stb.st_blksize = 0;
+ stb.st_blocks = 0;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_FILE_BLKSIZECNT 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
for ac_func in memset bzero memcpy bcopy memcmp bcmp
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -6847,7 +8858,7 @@ _ACEOF
fi
done
-for ac_func in getenv getenv_s setlocale select
+for ac_func in getenv getenv_s setlocale
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -6871,184 +8882,539 @@ _ACEOF
fi
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Init in -lcrypto" >&5
-$as_echo_n "checking for SHA224_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_SHA224_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+for ac_func in getuid setuid setgid
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in chdir chmod chown
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in opendir readdir closedir
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in getgrent getgrgid getgrnam endgrent setgrent
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in getpwuid getpwnam
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in fopen fclose feof ferror fflush fread fwrite
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _fclose _feof _ferror _fflush _fopen _fread _fwrite
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _getenv_s _wgetenv _getpid
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in fetestexcept _clearfp
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in fork getrlimit setpgrp setsid syslog
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in gethostname
+do :
+ ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname"
+if test "x$ac_cv_func_gethostname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_GETHOSTNAME 1
+_ACEOF
+
+fi
+done
+
+for ac_func in time localtime localtime_s
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in stat stat32 lstat32
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _stat _stat32 _stat64 _lstat _lstat32 _lstat64
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in mpctl sysconf sysctl
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in popen _popen
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in read write _read _write
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in seed48
+do :
+ ac_fn_c_check_func "$LINENO" "seed48" "ac_cv_func_seed48"
+if test "x$ac_cv_func_seed48" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_SEED48 1
+_ACEOF
+
+fi
+done
+
+for ac_func in sprintf_s sscanf_s swscanf_s
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in strcat strchr strcmp strcpy strdup strlen strncmp strncpy _strdup
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in strncpy_s strrchr strtoimax strtol strtoll strtoul strtoull
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in strtoumax
+do :
+ ac_fn_c_check_func "$LINENO" "strtoumax" "ac_cv_func_strtoumax"
+if test "x$ac_cv_func_strtoumax" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_STRTOUMAX 1
+_ACEOF
+
+fi
+done
+
+for ac_func in wcsdup wcsncmp wcsncpy wcsncpy_s wcstoimax wcstol wcstoll
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in wcstoul wcstoull wcstoumax
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _wcscat _wcschr _wcscpy _wcsdup _wcslen _wcsncmp _wcsncpy
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _wcsrchr
+do :
+ ac_fn_c_check_func "$LINENO" "_wcsrchr" "ac_cv_func__wcsrchr"
+if test "x$ac_cv_func__wcsrchr" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE__WCSRCHR 1
+_ACEOF
+
+fi
+done
+
+for ac_func in tcflush tcgetattr
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in umask
+do :
+ ac_fn_c_check_func "$LINENO" "umask" "ac_cv_func_umask"
+if test "x$ac_cv_func_umask" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_UMASK 1
+_ACEOF
+
+fi
+done
+
+for ac_func in GetFinalPathNameByHandle
+do :
+ ac_fn_c_check_func "$LINENO" "GetFinalPathNameByHandle" "ac_cv_func_GetFinalPathNameByHandle"
+if test "x$ac_cv_func_GetFinalPathNameByHandle" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_GETFINALPATHNAMEBYHANDLE 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isgreater" >&5
+$as_echo_n "checking isgreater... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char SHA224_Init ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return SHA224_Init ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isgreater(x, 4.0)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_SHA224_Init=yes
-else
- ac_cv_lib_crypto_SHA224_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Init" >&5
-$as_echo "$ac_cv_lib_crypto_SHA224_Init" >&6; }
-if test "x$ac_cv_lib_crypto_SHA224_Init" = xyes; then :
- $as_echo "@%:@define HAVE_SHA224 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ISGREATER 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Init in -lcrypto" >&5
-$as_echo_n "checking for SHA256_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_SHA256_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isgreaterequal" >&5
+$as_echo_n "checking isgreaterequal... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char SHA256_Init ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return SHA256_Init ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isgreaterequal(x, 4.0)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_SHA256_Init=yes
-else
- ac_cv_lib_crypto_SHA256_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Init" >&5
-$as_echo "$ac_cv_lib_crypto_SHA256_Init" >&6; }
-if test "x$ac_cv_lib_crypto_SHA256_Init" = xyes; then :
- $as_echo "@%:@define HAVE_SHA256 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ISGREATEREQUAL 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA384_Init in -lcrypto" >&5
-$as_echo_n "checking for SHA384_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_SHA384_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isless" >&5
+$as_echo_n "checking isless... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char SHA384_Init ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return SHA384_Init ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isless(x, 6.0)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_SHA384_Init=yes
-else
- ac_cv_lib_crypto_SHA384_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA384_Init" >&5
-$as_echo "$ac_cv_lib_crypto_SHA384_Init" >&6; }
-if test "x$ac_cv_lib_crypto_SHA384_Init" = xyes; then :
- $as_echo "@%:@define HAVE_SHA384 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ISLESS 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Init in -lcrypto" >&5
-$as_echo_n "checking for SHA512_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_SHA512_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking islessequal" >&5
+$as_echo_n "checking islessequal... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char SHA512_Init ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return SHA512_Init ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (islessequal(x, 6.0)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_SHA512_Init=yes
-else
- ac_cv_lib_crypto_SHA512_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Init" >&5
-$as_echo "$ac_cv_lib_crypto_SHA512_Init" >&6; }
-if test "x$ac_cv_lib_crypto_SHA512_Init" = xyes; then :
- $as_echo "@%:@define HAVE_SHA512 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ISLESSEQUAL 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RAND_egd" >&5
-$as_echo_n "checking RAND_egd... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isfinite" >&5
+$as_echo_n "checking isfinite... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <openssl/rand.h>
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
int
main ()
{
-int i;
-i = RAND_egd("/dev/egd");
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isfinite(x)) {
+ a = 1;
+ }
;
return 0;
@@ -7056,7 +9422,7 @@ i = RAND_egd("/dev/egd");
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_RAND_EGD 1" >>confdefs.h
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ISFINITE 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -7064,277 +9430,375 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
-$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if ${ac_cv_lib_rt_clock_gettime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrt $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isnormal" >&5
+$as_echo_n "checking isnormal... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char clock_gettime ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return clock_gettime ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isnormal(x)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_rt_clock_gettime=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ISNORMAL 1" >>confdefs.h
+
else
- ac_cv_lib_rt_clock_gettime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
-$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
- RTLIB="-lrt"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _finite" >&5
+$as_echo_n "checking _finite... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-SOCKLIB=''
-NSLLIB=''
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
-for ac_func in socket
-do :
- ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
-if test "x$ac_cv_func_socket" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_SOCKET 1
-_ACEOF
-
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-$as_echo "@%:@define HAVE_SOCKET 1" >>confdefs.h
+int
+main ()
+{
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (_finite(x)) {
+ a = 1;
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE__FINITE 1" >>confdefs.h
else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lxnet" >&5
-$as_echo_n "checking for socket in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fpclassify" >&5
+$as_echo_n "checking fpclassify... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char socket ();
+
int
main ()
{
-return socket ();
+
+int cl;
+cl = fpclassify(-0.5);
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_socket=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_FPCLASSIFY 1" >>confdefs.h
+
else
- ac_cv_lib_xnet_socket=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_socket" >&5
-$as_echo "$ac_cv_lib_xnet_socket" >&6; }
-if test "x$ac_cv_lib_xnet_socket" = xyes; then :
-
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-$as_echo "@%:@define HAVE_SOCKET 1" >>confdefs.h
-
-SOCKLIB='-lxnet'
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
-$as_echo_n "checking for socket in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mkdir(path,mode);" >&5
+$as_echo_n "checking mkdir(path,mode);... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
-char socket ();
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
int
main ()
{
-return socket ();
+
+mkdir("test", 0755);
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_socket=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_MKDIR2 1" >>confdefs.h
+
else
- ac_cv_lib_socket_socket=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
-$as_echo "$ac_cv_lib_socket_socket" >&6; }
-if test "x$ac_cv_lib_socket_socket" = xyes; then :
-
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-$as_echo "@%:@define HAVE_SOCKET 1" >>confdefs.h
-
-SOCKLIB='-lsocket'
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lws2_32" >&5
-$as_echo_n "checking for socket in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking qsort" >&5
+$as_echo_n "checking qsort... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#if HAVE_STDLIB_H
+#include <stdlib.h>
#endif
-char socket ();
+
+#if HAVE_SEARCH_H
+#include <search.h>
+#endif
+
+typedef struct { int a; int b; } test_t;
+
+test_t testvar[] = {
+ { 1, 1 },
+ { 2, 2 }
+};
+
+int testcmp(const void *l, const void *r)
+{
+ int back = 0;
+ const test_t *pl;
+ const test_t *pr;
+ pl = (const test_t *)l;
+ pr = (const test_t *)r;
+ if (pl->a < pr->a) {
+ back = -1;
+ }
+ else {
+ if (pl->a > pr->a) {
+ back = 1;
+ }
+ }
+}
+
int
main ()
{
-return socket ();
+
+qsort(testvar, 2, sizeof(test_t), testcmp);
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_socket=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_QSORT 1" >>confdefs.h
+
else
- ac_cv_lib_ws2_32_socket=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_socket" >&5
-$as_echo "$ac_cv_lib_ws2_32_socket" >&6; }
-if test "x$ac_cv_lib_ws2_32_socket" = xyes; then :
-
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-$as_echo "@%:@define HAVE_SOCKET 1" >>confdefs.h
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-SOCKLIB='-lws2_32'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking bsearch" >&5
+$as_echo_n "checking bsearch... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-fi
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SEARCH_H
+#include <search.h>
+#endif
-fi
+typedef struct { int a; int b; } test_t;
+test_t testvar[] = {
+ { 1, 1 },
+ { 2, 2 }
+};
-fi
+int testcmp(const void *l, const void *r)
+{
+ int back = 0;
+ const test_t *pl;
+ const test_t *pr;
+ pl = (const test_t *)l;
+ pr = (const test_t *)r;
+ if (pl->a < pr->a) {
+ back = -1;
+ }
+ else {
+ if (pl->a > pr->a) {
+ back = 1;
+ }
+ }
+}
+
+int
+main ()
+{
+bsearch(&(testvar[0]), testvar, 2, sizeof(test_t), testcmp);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_BSEARCH 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-done
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-for ac_func in setsockopt
-do :
- ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
-if test "x$ac_cv_func_setsockopt" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_SETSOCKOPT 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_SETSOCKOPT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking setgroups" >&5
+$as_echo_n "checking setgroups... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ gid_t gid = 0;
+ if (0 != setgroups(1, &gid)) {
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_SETGROUPS 1" >>confdefs.h
else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lxnet" >&5
-$as_echo_n "checking for setsockopt in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_setsockopt+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking initgroups" >&5
+$as_echo_n "checking initgroups... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
-char setsockopt ();
+#if HAVE_GRP_H
+#include <grp.h>
+#endif
+
int
main ()
{
-return setsockopt ();
+
+ gid_t gid = 0;
+ if (0 != initgroups("abcdefg", gid)) {
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_setsockopt=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_INITGROUPS 1" >>confdefs.h
+
else
- ac_cv_lib_xnet_setsockopt=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_setsockopt" >&5
-$as_echo "$ac_cv_lib_xnet_setsockopt" >&6; }
-if test "x$ac_cv_lib_xnet_setsockopt" = xyes; then :
-
-$as_echo "@%:@define HAVE_SETSOCKOPT 1" >>confdefs.h
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assert" >&5
+$as_echo_n "checking assert... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+#include <assert.h>
+int
+main ()
+{
+
+int i = -1;
+assert(0 < i);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ASSERT_FOUND='yes';{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
-$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_setsockopt+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosh in -lm" >&5
+$as_echo_n "checking for acosh in -lm... " >&6; }
+if ${ac_cv_lib_m_acosh+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7344,40 +9808,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char setsockopt ();
+char acosh ();
int
main ()
{
-return setsockopt ();
+return acosh ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_setsockopt=yes
+ ac_cv_lib_m_acosh=yes
else
- ac_cv_lib_socket_setsockopt=no
+ ac_cv_lib_m_acosh=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
-$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
-if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
-
-$as_echo "@%:@define HAVE_SETSOCKOPT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosh" >&5
+$as_echo "$ac_cv_lib_m_acosh" >&6; }
+if test "x$ac_cv_lib_m_acosh" = xyes; then :
+ $as_echo "@%:@define HAVE_ACOSH 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lws2_32" >&5
-$as_echo_n "checking for setsockopt in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_setsockopt+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acoshl in -lm" >&5
+$as_echo_n "checking for acoshl in -lm... " >&6; }
+if ${ac_cv_lib_m_acoshl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7387,64 +9849,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char setsockopt ();
+char acoshl ();
int
main ()
{
-return setsockopt ();
+return acoshl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_setsockopt=yes
+ ac_cv_lib_m_acoshl=yes
else
- ac_cv_lib_ws2_32_setsockopt=no
+ ac_cv_lib_m_acoshl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_setsockopt" >&5
-$as_echo "$ac_cv_lib_ws2_32_setsockopt" >&6; }
-if test "x$ac_cv_lib_ws2_32_setsockopt" = xyes; then :
-
-$as_echo "@%:@define HAVE_SETSOCKOPT 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acoshl" >&5
+$as_echo "$ac_cv_lib_m_acoshl" >&6; }
+if test "x$ac_cv_lib_m_acoshl" = xyes; then :
+ $as_echo "@%:@define HAVE_ACOSHL 1" >>confdefs.h
fi
-done
-
-for ac_func in getaddrinfo
-do :
- ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
-if test "x$ac_cv_func_getaddrinfo" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_GETADDRINFO 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lxnet" >&5
-$as_echo_n "checking for getaddrinfo in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_getaddrinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosl in -lm" >&5
+$as_echo_n "checking for acosl in -lm... " >&6; }
+if ${ac_cv_lib_m_acosl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7454,41 +9890,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getaddrinfo ();
+char acosl ();
int
main ()
{
-return getaddrinfo ();
+return acosl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_getaddrinfo=yes
+ ac_cv_lib_m_acosl=yes
else
- ac_cv_lib_xnet_getaddrinfo=no
+ ac_cv_lib_m_acosl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getaddrinfo" >&5
-$as_echo "$ac_cv_lib_xnet_getaddrinfo" >&6; }
-if test "x$ac_cv_lib_xnet_getaddrinfo" = xyes; then :
-
-NSLLIB='-lxnet'
-$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosl" >&5
+$as_echo "$ac_cv_lib_m_acosl" >&6; }
+if test "x$ac_cv_lib_m_acosl" = xyes; then :
+ $as_echo "@%:@define HAVE_ACOSL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lnsl" >&5
-$as_echo_n "checking for getaddrinfo in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_getaddrinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinh in -lm" >&5
+$as_echo_n "checking for asinh in -lm... " >&6; }
+if ${ac_cv_lib_m_asinh+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7498,41 +9931,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getaddrinfo ();
+char asinh ();
int
main ()
{
-return getaddrinfo ();
+return asinh ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_getaddrinfo=yes
+ ac_cv_lib_m_asinh=yes
else
- ac_cv_lib_nsl_getaddrinfo=no
+ ac_cv_lib_m_asinh=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getaddrinfo" >&5
-$as_echo "$ac_cv_lib_nsl_getaddrinfo" >&6; }
-if test "x$ac_cv_lib_nsl_getaddrinfo" = xyes; then :
-
-NSLLIB='-lnsl'
-$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinh" >&5
+$as_echo "$ac_cv_lib_m_asinh" >&6; }
+if test "x$ac_cv_lib_m_asinh" = xyes; then :
+ $as_echo "@%:@define HAVE_ASINH 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lsocket" >&5
-$as_echo_n "checking for getaddrinfo in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_getaddrinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinhl in -lm" >&5
+$as_echo_n "checking for asinhl in -lm... " >&6; }
+if ${ac_cv_lib_m_asinhl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7542,41 +9972,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getaddrinfo ();
+char asinhl ();
int
main ()
{
-return getaddrinfo ();
+return asinhl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_getaddrinfo=yes
+ ac_cv_lib_m_asinhl=yes
else
- ac_cv_lib_socket_getaddrinfo=no
+ ac_cv_lib_m_asinhl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getaddrinfo" >&5
-$as_echo "$ac_cv_lib_socket_getaddrinfo" >&6; }
-if test "x$ac_cv_lib_socket_getaddrinfo" = xyes; then :
-
-NSLLIB='-lsocket'
-$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinhl" >&5
+$as_echo "$ac_cv_lib_m_asinhl" >&6; }
+if test "x$ac_cv_lib_m_asinhl" = xyes; then :
+ $as_echo "@%:@define HAVE_ASINHL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lws2_32" >&5
-$as_echo_n "checking for getaddrinfo in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_getaddrinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinl in -lm" >&5
+$as_echo_n "checking for asinl in -lm... " >&6; }
+if ${ac_cv_lib_m_asinl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7586,67 +10013,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getaddrinfo ();
+char asinl ();
int
main ()
{
-return getaddrinfo ();
+return asinl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_getaddrinfo=yes
+ ac_cv_lib_m_asinl=yes
else
- ac_cv_lib_ws2_32_getaddrinfo=no
+ ac_cv_lib_m_asinl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getaddrinfo" >&5
-$as_echo "$ac_cv_lib_ws2_32_getaddrinfo" >&6; }
-if test "x$ac_cv_lib_ws2_32_getaddrinfo" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinl" >&5
+$as_echo "$ac_cv_lib_m_asinl" >&6; }
+if test "x$ac_cv_lib_m_asinl" = xyes; then :
+ $as_echo "@%:@define HAVE_ASINL 1" >>confdefs.h
fi
-
-fi
-done
-
-
-for ac_func in getnameinfo
-do :
- ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo"
-if test "x$ac_cv_func_getnameinfo" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_GETNAMEINFO 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lxnet" >&5
-$as_echo_n "checking for getnameinfo in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_getnameinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2 in -lm" >&5
+$as_echo_n "checking for atan2 in -lm... " >&6; }
+if ${ac_cv_lib_m_atan2+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7656,40 +10054,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getnameinfo ();
+char atan2 ();
int
main ()
{
-return getnameinfo ();
+return atan2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_getnameinfo=yes
+ ac_cv_lib_m_atan2=yes
else
- ac_cv_lib_xnet_getnameinfo=no
+ ac_cv_lib_m_atan2=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getnameinfo" >&5
-$as_echo "$ac_cv_lib_xnet_getnameinfo" >&6; }
-if test "x$ac_cv_lib_xnet_getnameinfo" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2" >&5
+$as_echo "$ac_cv_lib_m_atan2" >&6; }
+if test "x$ac_cv_lib_m_atan2" = xyes; then :
+ $as_echo "@%:@define HAVE_ATAN2 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lnsl" >&5
-$as_echo_n "checking for getnameinfo in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_getnameinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2l in -lm" >&5
+$as_echo_n "checking for atan2l in -lm... " >&6; }
+if ${ac_cv_lib_m_atan2l+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7699,40 +10095,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getnameinfo ();
+char atan2l ();
int
main ()
{
-return getnameinfo ();
+return atan2l ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_getnameinfo=yes
+ ac_cv_lib_m_atan2l=yes
else
- ac_cv_lib_nsl_getnameinfo=no
+ ac_cv_lib_m_atan2l=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getnameinfo" >&5
-$as_echo "$ac_cv_lib_nsl_getnameinfo" >&6; }
-if test "x$ac_cv_lib_nsl_getnameinfo" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2l" >&5
+$as_echo "$ac_cv_lib_m_atan2l" >&6; }
+if test "x$ac_cv_lib_m_atan2l" = xyes; then :
+ $as_echo "@%:@define HAVE_ATAN2L 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lsocket" >&5
-$as_echo_n "checking for getnameinfo in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_getnameinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanh in -lm" >&5
+$as_echo_n "checking for atanh in -lm... " >&6; }
+if ${ac_cv_lib_m_atanh+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7742,40 +10136,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getnameinfo ();
+char atanh ();
int
main ()
{
-return getnameinfo ();
+return atanh ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_getnameinfo=yes
+ ac_cv_lib_m_atanh=yes
else
- ac_cv_lib_socket_getnameinfo=no
+ ac_cv_lib_m_atanh=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getnameinfo" >&5
-$as_echo "$ac_cv_lib_socket_getnameinfo" >&6; }
-if test "x$ac_cv_lib_socket_getnameinfo" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanh" >&5
+$as_echo "$ac_cv_lib_m_atanh" >&6; }
+if test "x$ac_cv_lib_m_atanh" = xyes; then :
+ $as_echo "@%:@define HAVE_ATANH 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lws2_32" >&5
-$as_echo_n "checking for getnameinfo in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_getnameinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanhl in -lm" >&5
+$as_echo_n "checking for atanhl in -lm... " >&6; }
+if ${ac_cv_lib_m_atanhl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7785,67 +10177,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getnameinfo ();
+char atanhl ();
int
main ()
{
-return getnameinfo ();
+return atanhl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_getnameinfo=yes
+ ac_cv_lib_m_atanhl=yes
else
- ac_cv_lib_ws2_32_getnameinfo=no
+ ac_cv_lib_m_atanhl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getnameinfo" >&5
-$as_echo "$ac_cv_lib_ws2_32_getnameinfo" >&6; }
-if test "x$ac_cv_lib_ws2_32_getnameinfo" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanhl" >&5
+$as_echo "$ac_cv_lib_m_atanhl" >&6; }
+if test "x$ac_cv_lib_m_atanhl" = xyes; then :
+ $as_echo "@%:@define HAVE_ATANHL 1" >>confdefs.h
fi
-done
-
-for ac_func in gethostbyname
-do :
- ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_GETHOSTBYNAME 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lxnet" >&5
-$as_echo_n "checking for gethostbyname in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_gethostbyname+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanl in -lm" >&5
+$as_echo_n "checking for atanl in -lm... " >&6; }
+if ${ac_cv_lib_m_atanl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7855,40 +10218,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char atanl ();
int
main ()
{
-return gethostbyname ();
+return atanl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_gethostbyname=yes
+ ac_cv_lib_m_atanl=yes
else
- ac_cv_lib_xnet_gethostbyname=no
+ ac_cv_lib_m_atanl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_gethostbyname" >&5
-$as_echo "$ac_cv_lib_xnet_gethostbyname" >&6; }
-if test "x$ac_cv_lib_xnet_gethostbyname" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanl" >&5
+$as_echo "$ac_cv_lib_m_atanl" >&6; }
+if test "x$ac_cv_lib_m_atanl" = xyes; then :
+ $as_echo "@%:@define HAVE_ATANL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5
+$as_echo_n "checking for ceil in -lm... " >&6; }
+if ${ac_cv_lib_m_ceil+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7898,40 +10259,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char ceil ();
int
main ()
{
-return gethostbyname ();
+return ceil ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_gethostbyname=yes
+ ac_cv_lib_m_ceil=yes
else
- ac_cv_lib_nsl_gethostbyname=no
+ ac_cv_lib_m_ceil=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceil" >&5
+$as_echo "$ac_cv_lib_m_ceil" >&6; }
+if test "x$ac_cv_lib_m_ceil" = xyes; then :
+ $as_echo "@%:@define HAVE_CEIL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5
-$as_echo_n "checking for gethostbyname in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_gethostbyname+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceill in -lm" >&5
+$as_echo_n "checking for ceill in -lm... " >&6; }
+if ${ac_cv_lib_m_ceill+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7941,40 +10300,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char ceill ();
int
main ()
{
-return gethostbyname ();
+return ceill ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_gethostbyname=yes
+ ac_cv_lib_m_ceill=yes
else
- ac_cv_lib_socket_gethostbyname=no
+ ac_cv_lib_m_ceill=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5
-$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; }
-if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceill" >&5
+$as_echo "$ac_cv_lib_m_ceill" >&6; }
+if test "x$ac_cv_lib_m_ceill" = xyes; then :
+ $as_echo "@%:@define HAVE_CEILL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lws3_32" >&5
-$as_echo_n "checking for gethostbyname in -lws3_32... " >&6; }
-if ${ac_cv_lib_ws3_32_gethostbyname+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for coshl in -lm" >&5
+$as_echo_n "checking for coshl in -lm... " >&6; }
+if ${ac_cv_lib_m_coshl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws3_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7984,255 +10341,79 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char coshl ();
int
main ()
{
-return gethostbyname ();
+return coshl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws3_32_gethostbyname=yes
+ ac_cv_lib_m_coshl=yes
else
- ac_cv_lib_ws3_32_gethostbyname=no
+ ac_cv_lib_m_coshl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws3_32_gethostbyname" >&5
-$as_echo "$ac_cv_lib_ws3_32_gethostbyname" >&6; }
-if test "x$ac_cv_lib_ws3_32_gethostbyname" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_coshl" >&5
+$as_echo "$ac_cv_lib_m_coshl" >&6; }
+if test "x$ac_cv_lib_m_coshl" = xyes; then :
+ $as_echo "@%:@define HAVE_COSHL 1" >>confdefs.h
fi
-done
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking htons" >&5
-$as_echo_n "checking htons... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-int
-main ()
-{
-
- unsigned short s;
- s = htons(5);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "@%:@define HAVE_HTONS 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosl in -lm" >&5
+$as_echo_n "checking for cosl in -lm... " >&6; }
+if ${ac_cv_lib_m_cosl+:} false; then :
+ $as_echo_n "(cached) " >&6
else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ntohs" >&5
-$as_echo_n "checking ntohs... " >&6; }
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char cosl ();
int
main ()
{
-
- unsigned short s;
- s = ntohs(5);
-
+return cosl ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "@%:@define HAVE_NTOHS 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cosl=yes
else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
+ ac_cv_lib_m_cosl=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking htonl" >&5
-$as_echo_n "checking htonl... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-int
-main ()
-{
-
- unsigned long s;
- s = htonl(5);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "@%:@define HAVE_HTONL 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ntohl" >&5
-$as_echo_n "checking ntohl... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-int
-main ()
-{
-
- unsigned long s;
- s = ntohl(5);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "@%:@define HAVE_NTOHL 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cosl" >&5
+$as_echo "$ac_cv_lib_m_cosl" >&6; }
+if test "x$ac_cv_lib_m_cosl" = xyes; then :
+ $as_echo "@%:@define HAVE_COSL 1" >>confdefs.h
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-for ac_func in inet_addr
-do :
- ac_fn_c_check_func "$LINENO" "inet_addr" "ac_cv_func_inet_addr"
-if test "x$ac_cv_func_inet_addr" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_INET_ADDR 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lxnet" >&5
-$as_echo_n "checking for inet_addr in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_inet_addr+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for expl in -lm" >&5
+$as_echo_n "checking for expl in -lm... " >&6; }
+if ${ac_cv_lib_m_expl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8242,40 +10423,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_addr ();
+char expl ();
int
main ()
{
-return inet_addr ();
+return expl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_inet_addr=yes
+ ac_cv_lib_m_expl=yes
else
- ac_cv_lib_xnet_inet_addr=no
+ ac_cv_lib_m_expl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_addr" >&5
-$as_echo "$ac_cv_lib_xnet_inet_addr" >&6; }
-if test "x$ac_cv_lib_xnet_inet_addr" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_expl" >&5
+$as_echo "$ac_cv_lib_m_expl" >&6; }
+if test "x$ac_cv_lib_m_expl" = xyes; then :
+ $as_echo "@%:@define HAVE_EXPL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lnsl" >&5
-$as_echo_n "checking for inet_addr in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_inet_addr+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabs in -lm" >&5
+$as_echo_n "checking for fabs in -lm... " >&6; }
+if ${ac_cv_lib_m_fabs+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8285,40 +10464,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_addr ();
+char fabs ();
int
main ()
{
-return inet_addr ();
+return fabs ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_inet_addr=yes
+ ac_cv_lib_m_fabs=yes
else
- ac_cv_lib_nsl_inet_addr=no
+ ac_cv_lib_m_fabs=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_addr" >&5
-$as_echo "$ac_cv_lib_nsl_inet_addr" >&6; }
-if test "x$ac_cv_lib_nsl_inet_addr" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabs" >&5
+$as_echo "$ac_cv_lib_m_fabs" >&6; }
+if test "x$ac_cv_lib_m_fabs" = xyes; then :
+ $as_echo "@%:@define HAVE_FABS 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lsocket" >&5
-$as_echo_n "checking for inet_addr in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_inet_addr+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsl in -lm" >&5
+$as_echo_n "checking for fabsl in -lm... " >&6; }
+if ${ac_cv_lib_m_fabsl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8328,40 +10505,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_addr ();
+char fabsl ();
int
main ()
{
-return inet_addr ();
+return fabsl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_inet_addr=yes
+ ac_cv_lib_m_fabsl=yes
else
- ac_cv_lib_socket_inet_addr=no
+ ac_cv_lib_m_fabsl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_addr" >&5
-$as_echo "$ac_cv_lib_socket_inet_addr" >&6; }
-if test "x$ac_cv_lib_socket_inet_addr" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabsl" >&5
+$as_echo "$ac_cv_lib_m_fabsl" >&6; }
+if test "x$ac_cv_lib_m_fabsl" = xyes; then :
+ $as_echo "@%:@define HAVE_FABSL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lws2_32" >&5
-$as_echo_n "checking for inet_addr in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_inet_addr+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5
+$as_echo_n "checking for floor in -lm... " >&6; }
+if ${ac_cv_lib_m_floor+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8371,67 +10546,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_addr ();
+char floor ();
int
main ()
{
-return inet_addr ();
+return floor ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_inet_addr=yes
+ ac_cv_lib_m_floor=yes
else
- ac_cv_lib_ws2_32_inet_addr=no
+ ac_cv_lib_m_floor=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_addr" >&5
-$as_echo "$ac_cv_lib_ws2_32_inet_addr" >&6; }
-if test "x$ac_cv_lib_ws2_32_inet_addr" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5
+$as_echo "$ac_cv_lib_m_floor" >&6; }
+if test "x$ac_cv_lib_m_floor" = xyes; then :
+ $as_echo "@%:@define HAVE_FLOOR 1" >>confdefs.h
fi
-done
-
-
-for ac_func in inet_aton
-do :
- ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
-if test "x$ac_cv_func_inet_aton" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_INET_ATON 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lxnet" >&5
-$as_echo_n "checking for inet_aton in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_inet_aton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floorl in -lm" >&5
+$as_echo_n "checking for floorl in -lm... " >&6; }
+if ${ac_cv_lib_m_floorl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8441,40 +10587,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_aton ();
+char floorl ();
int
main ()
{
-return inet_aton ();
+return floorl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_inet_aton=yes
+ ac_cv_lib_m_floorl=yes
else
- ac_cv_lib_xnet_inet_aton=no
+ ac_cv_lib_m_floorl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_aton" >&5
-$as_echo "$ac_cv_lib_xnet_inet_aton" >&6; }
-if test "x$ac_cv_lib_xnet_inet_aton" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floorl" >&5
+$as_echo "$ac_cv_lib_m_floorl" >&6; }
+if test "x$ac_cv_lib_m_floorl" = xyes; then :
+ $as_echo "@%:@define HAVE_FLOORL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lnsl" >&5
-$as_echo_n "checking for inet_aton in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_inet_aton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for labs in -lm" >&5
+$as_echo_n "checking for labs in -lm... " >&6; }
+if ${ac_cv_lib_m_labs+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8484,40 +10628,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_aton ();
+char labs ();
int
main ()
{
-return inet_aton ();
+return labs ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_inet_aton=yes
+ ac_cv_lib_m_labs=yes
else
- ac_cv_lib_nsl_inet_aton=no
+ ac_cv_lib_m_labs=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_aton" >&5
-$as_echo "$ac_cv_lib_nsl_inet_aton" >&6; }
-if test "x$ac_cv_lib_nsl_inet_aton" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_labs" >&5
+$as_echo "$ac_cv_lib_m_labs" >&6; }
+if test "x$ac_cv_lib_m_labs" = xyes; then :
+ $as_echo "@%:@define HAVE_LABS 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lsocket" >&5
-$as_echo_n "checking for inet_aton in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_inet_aton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for logl in -lm" >&5
+$as_echo_n "checking for logl in -lm... " >&6; }
+if ${ac_cv_lib_m_logl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8527,40 +10669,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_aton ();
+char logl ();
int
main ()
{
-return inet_aton ();
+return logl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_inet_aton=yes
+ ac_cv_lib_m_logl=yes
else
- ac_cv_lib_socket_inet_aton=no
+ ac_cv_lib_m_logl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_aton" >&5
-$as_echo "$ac_cv_lib_socket_inet_aton" >&6; }
-if test "x$ac_cv_lib_socket_inet_aton" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_logl" >&5
+$as_echo "$ac_cv_lib_m_logl" >&6; }
+if test "x$ac_cv_lib_m_logl" = xyes; then :
+ $as_echo "@%:@define HAVE_LOGL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lws2_32" >&5
-$as_echo_n "checking for inet_aton in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_inet_aton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rint in -lm" >&5
+$as_echo_n "checking for rint in -lm... " >&6; }
+if ${ac_cv_lib_m_rint+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8570,67 +10710,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_aton ();
+char rint ();
int
main ()
{
-return inet_aton ();
+return rint ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_inet_aton=yes
+ ac_cv_lib_m_rint=yes
else
- ac_cv_lib_ws2_32_inet_aton=no
+ ac_cv_lib_m_rint=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_aton" >&5
-$as_echo "$ac_cv_lib_ws2_32_inet_aton" >&6; }
-if test "x$ac_cv_lib_ws2_32_inet_aton" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_rint" >&5
+$as_echo "$ac_cv_lib_m_rint" >&6; }
+if test "x$ac_cv_lib_m_rint" = xyes; then :
+ $as_echo "@%:@define HAVE_RINT 1" >>confdefs.h
fi
-done
-
-
-for ac_func in inet_pton
-do :
- ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
-if test "x$ac_cv_func_inet_pton" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_INET_PTON 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lxnet" >&5
-$as_echo_n "checking for inet_pton in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_inet_pton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rintl in -lm" >&5
+$as_echo_n "checking for rintl in -lm... " >&6; }
+if ${ac_cv_lib_m_rintl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8640,40 +10751,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_pton ();
+char rintl ();
int
main ()
{
-return inet_pton ();
+return rintl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_inet_pton=yes
+ ac_cv_lib_m_rintl=yes
else
- ac_cv_lib_xnet_inet_pton=no
+ ac_cv_lib_m_rintl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_pton" >&5
-$as_echo "$ac_cv_lib_xnet_inet_pton" >&6; }
-if test "x$ac_cv_lib_xnet_inet_pton" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_rintl" >&5
+$as_echo "$ac_cv_lib_m_rintl" >&6; }
+if test "x$ac_cv_lib_m_rintl" = xyes; then :
+ $as_echo "@%:@define HAVE_RINTL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lnsl" >&5
-$as_echo_n "checking for inet_pton in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_inet_pton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinhl in -lm" >&5
+$as_echo_n "checking for sinhl in -lm... " >&6; }
+if ${ac_cv_lib_m_sinhl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8683,40 +10792,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_pton ();
+char sinhl ();
int
main ()
{
-return inet_pton ();
+return sinhl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_inet_pton=yes
+ ac_cv_lib_m_sinhl=yes
else
- ac_cv_lib_nsl_inet_pton=no
+ ac_cv_lib_m_sinhl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_pton" >&5
-$as_echo "$ac_cv_lib_nsl_inet_pton" >&6; }
-if test "x$ac_cv_lib_nsl_inet_pton" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinhl" >&5
+$as_echo "$ac_cv_lib_m_sinhl" >&6; }
+if test "x$ac_cv_lib_m_sinhl" = xyes; then :
+ $as_echo "@%:@define HAVE_SINHL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lsocket" >&5
-$as_echo_n "checking for inet_pton in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_inet_pton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
+$as_echo_n "checking for sqrt in -lm... " >&6; }
+if ${ac_cv_lib_m_sqrt+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8726,40 +10833,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_pton ();
+char sqrt ();
int
main ()
{
-return inet_pton ();
+return sqrt ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_inet_pton=yes
+ ac_cv_lib_m_sqrt=yes
else
- ac_cv_lib_socket_inet_pton=no
+ ac_cv_lib_m_sqrt=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_pton" >&5
-$as_echo "$ac_cv_lib_socket_inet_pton" >&6; }
-if test "x$ac_cv_lib_socket_inet_pton" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
+$as_echo "$ac_cv_lib_m_sqrt" >&6; }
+if test "x$ac_cv_lib_m_sqrt" = xyes; then :
+ $as_echo "@%:@define HAVE_SQRT 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lws2_32" >&5
-$as_echo_n "checking for inet_pton in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_inet_pton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtl in -lm" >&5
+$as_echo_n "checking for sqrtl in -lm... " >&6; }
+if ${ac_cv_lib_m_sqrtl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8769,67 +10874,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_pton ();
+char sqrtl ();
int
main ()
{
-return inet_pton ();
+return sqrtl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_inet_pton=yes
+ ac_cv_lib_m_sqrtl=yes
else
- ac_cv_lib_ws2_32_inet_pton=no
+ ac_cv_lib_m_sqrtl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_pton" >&5
-$as_echo "$ac_cv_lib_ws2_32_inet_pton" >&6; }
-if test "x$ac_cv_lib_ws2_32_inet_pton" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrtl" >&5
+$as_echo "$ac_cv_lib_m_sqrtl" >&6; }
+if test "x$ac_cv_lib_m_sqrtl" = xyes; then :
+ $as_echo "@%:@define HAVE_SQRTL 1" >>confdefs.h
fi
-done
-
-
-for ac_func in inet_ntop
-do :
- ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
-if test "x$ac_cv_func_inet_ntop" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_INET_NTOP 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lxnet" >&5
-$as_echo_n "checking for inet_ntop in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_inet_ntop+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinl in -lm" >&5
+$as_echo_n "checking for sinl in -lm... " >&6; }
+if ${ac_cv_lib_m_sinl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8839,40 +10915,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntop ();
+char sinl ();
int
main ()
{
-return inet_ntop ();
+return sinl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_inet_ntop=yes
+ ac_cv_lib_m_sinl=yes
else
- ac_cv_lib_xnet_inet_ntop=no
+ ac_cv_lib_m_sinl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_ntop" >&5
-$as_echo "$ac_cv_lib_xnet_inet_ntop" >&6; }
-if test "x$ac_cv_lib_xnet_inet_ntop" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinl" >&5
+$as_echo "$ac_cv_lib_m_sinl" >&6; }
+if test "x$ac_cv_lib_m_sinl" = xyes; then :
+ $as_echo "@%:@define HAVE_SINL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lnsl" >&5
-$as_echo_n "checking for inet_ntop in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_inet_ntop+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanhl in -lm" >&5
+$as_echo_n "checking for tanhl in -lm... " >&6; }
+if ${ac_cv_lib_m_tanhl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8882,40 +10956,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntop ();
+char tanhl ();
int
main ()
{
-return inet_ntop ();
+return tanhl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_inet_ntop=yes
+ ac_cv_lib_m_tanhl=yes
else
- ac_cv_lib_nsl_inet_ntop=no
+ ac_cv_lib_m_tanhl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntop" >&5
-$as_echo "$ac_cv_lib_nsl_inet_ntop" >&6; }
-if test "x$ac_cv_lib_nsl_inet_ntop" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanhl" >&5
+$as_echo "$ac_cv_lib_m_tanhl" >&6; }
+if test "x$ac_cv_lib_m_tanhl" = xyes; then :
+ $as_echo "@%:@define HAVE_TANHL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lsocket" >&5
-$as_echo_n "checking for inet_ntop in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_inet_ntop+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanl in -lm" >&5
+$as_echo_n "checking for tanl in -lm... " >&6; }
+if ${ac_cv_lib_m_tanl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8925,40 +10997,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntop ();
+char tanl ();
int
main ()
{
-return inet_ntop ();
+return tanl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_inet_ntop=yes
+ ac_cv_lib_m_tanl=yes
else
- ac_cv_lib_socket_inet_ntop=no
+ ac_cv_lib_m_tanl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_ntop" >&5
-$as_echo "$ac_cv_lib_socket_inet_ntop" >&6; }
-if test "x$ac_cv_lib_socket_inet_ntop" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanl" >&5
+$as_echo "$ac_cv_lib_m_tanl" >&6; }
+if test "x$ac_cv_lib_m_tanl" = xyes; then :
+ $as_echo "@%:@define HAVE_TANL 1" >>confdefs.h
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lws2_32" >&5
-$as_echo_n "checking for inet_ntop in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_inet_ntop+:} false; then :
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lrt $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8968,139 +11040,91 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntop ();
+char clock_gettime ();
int
main ()
{
-return inet_ntop ();
+return clock_gettime ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_inet_ntop=yes
+ ac_cv_lib_rt_clock_gettime=yes
else
- ac_cv_lib_ws2_32_inet_ntop=no
+ ac_cv_lib_rt_clock_gettime=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_ntop" >&5
-$as_echo "$ac_cv_lib_ws2_32_inet_ntop" >&6; }
-if test "x$ac_cv_lib_ws2_32_inet_ntop" = xyes; then :
-
-$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+ RTLIB='-lrt'
+fi
-fi
+case X$TARGETCLASS in
+ Xwindows)
+ $as_echo "@%:@define HAVE_BACKSLASH_AS_SEP 1" >>confdefs.h
+ $as_echo "@%:@define HAVE_LINE_END_CR_NL 1" >>confdefs.h
-fi
+ $as_echo "@%:@define HAVE_CASE_INSENSITIVE_PATHNAMES 1" >>confdefs.h
+ $as_echo "@%:@define HAVE_CASE_INSENSITIVE_USERNAMES 1" >>confdefs.h
-fi
+ ;;
+ *)
+ $as_echo "@%:@define HAVE_FILE_DEVINO 1" >>confdefs.h
+ $as_echo "@%:@define HAVE_FILE_UIDGID 1" >>confdefs.h
-fi
+ $as_echo "@%:@define HAVE_FILE_ATIMECTIME 1" >>confdefs.h
+ ;;
+esac
-fi
-done
+$as_echo "@%:@define HAVE_COMPATDKTOOLS3 1" >>confdefs.h
-if [ "X$SOCKLIB" = "X$NSLLIB" ]
-then
-NSLLIB=''
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking /proc/.../exe symbolic link" >&5
-$as_echo_n "checking /proc/.../exe symbolic link... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - test not possible" >&5
-$as_echo "no - test not possible" >&6; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking socklen_t" >&5
+$as_echo_n "checking socklen_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-
-/* Buffer for result */
-char prog[1024];
-
-#ifdef __cplusplus
-int main(int argc, char *argv[])
-#else
-int main(argc, argv) int argc; char *argv[];
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
#endif
-{
- char buf[64];
- struct stat stbuf;
- int exv = 1;
- ssize_t res;
-#if HAVE_STDINT_H
- sprintf(buf, "/proc/%ju/exe", (uintmax_t)getpid());
-#else
- sprintf(buf, "/proc/%lu/exe", (unsigned long)getpid());
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
#endif
- res = readlink(buf, prog, sizeof(prog));
- if ((0 < res) && (sizeof(prog) > res)) {
- prog[res] = '\0';
- if (0 == stat(prog, &stbuf)) {
- exv = 0;
- }
- }
- return exv;
-}
-
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_PROC_PID_EXE 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ssize_t" >&5
-$as_echo_n "checking ssize_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if HAVE_STDLIB_H
-#include <stdlib.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
#endif
int
main ()
{
- ssize_t sz;
+socklen_t sz;
;
return 0;
@@ -9110,35 +11134,52 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_SSIZE_T 1" >>confdefs.h
+$as_echo "@%:@define HAVE_SOCKLEN_T 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int8_t" >&5
-$as_echo_n "checking int8_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_in" >&5
+$as_echo_n "checking struct sockaddr_in... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
-int8_t i8 = 0;
+struct sockaddr_in sain;
;
return 0;
@@ -9148,35 +11189,52 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_INT8_T 1" >>confdefs.h
+$as_echo "@%:@define HAVE_STRUCT_SOCKADDR_IN 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int16_t" >&5
-$as_echo_n "checking int16_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_in6" >&5
+$as_echo_n "checking struct sockaddr_in6... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
-int16_t i16 = 0;
+struct sockaddr_in6 sain;
;
return 0;
@@ -9186,35 +11244,55 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_INT16_T 1" >>confdefs.h
+$as_echo "@%:@define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int32_t" >&5
-$as_echo_n "checking int32_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_un" >&5
+$as_echo_n "checking struct sockaddr_un... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
-int32_t i32 = 0;
+struct sockaddr_un sain;
;
return 0;
@@ -9224,35 +11302,52 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_INT32_T 1" >>confdefs.h
+$as_echo "@%:@define HAVE_STRUCT_SOCKADDR_UN 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint8_t" >&5
-$as_echo_n "checking uint8_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct addrinfo" >&5
+$as_echo_n "checking struct addrinfo... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
- uint8_t sz;
+struct addrinfo adi;
;
return 0;
@@ -9262,35 +11357,58 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_UINT8_T 1" >>confdefs.h
+$as_echo "@%:@define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint16_t" >&5
-$as_echo_n "checking uint16_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_storage" >&5
+$as_echo_n "checking struct sockaddr_storage... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
- uint16_t sz;
+struct sockaddr_storage sain;
;
return 0;
@@ -9300,35 +11418,49 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_UINT16_T 1" >>confdefs.h
+$as_echo "@%:@define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t" >&5
-$as_echo_n "checking uint32_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IN_ADDR" >&5
+$as_echo_n "checking IN_ADDR... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
- uint32_t sz;
+IN_ADDR addr;
;
return 0;
@@ -9338,868 +11470,1049 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_UINT32_T 1" >>confdefs.h
+$as_echo "@%:@define HAVE_IN_ADDR 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dev_t" >&5
-$as_echo_n "checking dev_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IN6_ADDR" >&5
+$as_echo_n "checking IN6_ADDR... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
int
main ()
{
- dev_t devno;
+IN6_ADDR addr;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_DEV_T 1" >>confdefs.h
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_IN6_ADDR 1" >>confdefs.h
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _dev_t" >&5
-$as_echo_n "checking _dev_t... " >&6; }
+SOCKLIB=''
+NSLLIB=''
+FOUND_SOCKET='no'
+for ac_func in socket
+do :
+ ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
+if test "x$ac_cv_func_socket" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_SOCKET 1
+_ACEOF
+
+LIB_SHARED_RES_NET='$(LIB_SHARED_RES_NET)'
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+$as_echo "@%:@define HAVE_SOCKET 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lxnet" >&5
+$as_echo_n "checking for socket in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char socket ();
int
main ()
{
-
- _dev_t devno;
-
+return socket ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE__DEV_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_socket=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_xnet_socket=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_socket" >&5
+$as_echo "$ac_cv_lib_xnet_socket" >&6; }
+if test "x$ac_cv_lib_xnet_socket" = xyes; then :
+
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+$as_echo "@%:@define HAVE_SOCKET 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ino_t" >&5
-$as_echo_n "checking ino_t... " >&6; }
+SOCKLIB='-lxnet'
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char socket ();
int
main ()
{
-
- ino_t devno;
-
+return socket ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_INO_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_socket=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_socket_socket=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = xyes; then :
+
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+$as_echo "@%:@define HAVE_SOCKET 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _ino_t" >&5
-$as_echo_n "checking _ino_t... " >&6; }
+SOCKLIB='-lsocket'
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lws2_32" >&5
+$as_echo_n "checking for socket in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char socket ();
int
main ()
{
-
- _ino_t devno;
-
+return socket ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE__INO_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws2_32_socket=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_ws2_32_socket=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_socket" >&5
+$as_echo "$ac_cv_lib_ws2_32_socket" >&6; }
+if test "x$ac_cv_lib_ws2_32_socket" = xyes; then :
+
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+$as_echo "@%:@define HAVE_SOCKET 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ino64_t" >&5
-$as_echo_n "checking ino64_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+SOCKLIB='-lws2_32'
-#define _LARGEFILE64_SOURCE 1
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+fi
-int
-main ()
-{
- ino64_t devno;
+fi
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_INO64_T 1" >>confdefs.h
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mode_t" >&5
-$as_echo_n "checking mode_t... " >&6; }
+
+fi
+done
+
+
+for ac_func in setsockopt
+do :
+ ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
+if test "x$ac_cv_func_setsockopt" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_SETSOCKOPT 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_SETSOCKOPT 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lxnet" >&5
+$as_echo_n "checking for setsockopt in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char setsockopt ();
int
main ()
{
-
- mode_t devno;
-
+return setsockopt ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_MODE_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_setsockopt=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_xnet_setsockopt=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_setsockopt" >&5
+$as_echo "$ac_cv_lib_xnet_setsockopt" >&6; }
+if test "x$ac_cv_lib_xnet_setsockopt" = xyes; then :
+
+$as_echo "@%:@define HAVE_SETSOCKOPT 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking nlink_t" >&5
-$as_echo_n "checking nlink_t... " >&6; }
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
+$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char setsockopt ();
int
main ()
{
-
- nlink_t devno;
-
+return setsockopt ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_NLINK_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_setsockopt=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_socket_setsockopt=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
+$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
+if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
+
+$as_echo "@%:@define HAVE_SETSOCKOPT 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uid_t" >&5
-$as_echo_n "checking uid_t... " >&6; }
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lws2_32" >&5
+$as_echo_n "checking for setsockopt in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char setsockopt ();
int
main ()
{
-
- uid_t devno;
-
+return setsockopt ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_UID_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws2_32_setsockopt=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_ws2_32_setsockopt=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_setsockopt" >&5
+$as_echo "$ac_cv_lib_ws2_32_setsockopt" >&6; }
+if test "x$ac_cv_lib_ws2_32_setsockopt" = xyes; then :
+
+$as_echo "@%:@define HAVE_SETSOCKOPT 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gid_t" >&5
-$as_echo_n "checking gid_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+fi
-int
-main ()
-{
- gid_t devno;
+fi
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_GID_T 1" >>confdefs.h
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking off_t" >&5
-$as_echo_n "checking off_t... " >&6; }
+
+fi
+done
+
+
+for ac_func in getaddrinfo
+do :
+ ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
+if test "x$ac_cv_func_getaddrinfo" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_GETADDRINFO 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lxnet" >&5
+$as_echo_n "checking for getaddrinfo in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getaddrinfo ();
int
main ()
{
-
- off_t devno;
-
+return getaddrinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_OFF_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_getaddrinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_xnet_getaddrinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getaddrinfo" >&5
+$as_echo "$ac_cv_lib_xnet_getaddrinfo" >&6; }
+if test "x$ac_cv_lib_xnet_getaddrinfo" = xyes; then :
+
+NSLLIB='-lxnet'
+$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking off64_t" >&5
-$as_echo_n "checking off64_t... " >&6; }
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lnsl" >&5
+$as_echo_n "checking for getaddrinfo in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define _LARGEFILE64_SOURCE 1
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getaddrinfo ();
int
main ()
{
-
- off64_t devno;
-
+return getaddrinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_OFF64_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_getaddrinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_nsl_getaddrinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getaddrinfo" >&5
+$as_echo "$ac_cv_lib_nsl_getaddrinfo" >&6; }
+if test "x$ac_cv_lib_nsl_getaddrinfo" = xyes; then :
+
+NSLLIB='-lnsl'
+$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blksize_t" >&5
-$as_echo_n "checking blksize_t... " >&6; }
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lsocket" >&5
+$as_echo_n "checking for getaddrinfo in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getaddrinfo ();
int
main ()
{
-
- blksize_t devno;
-
+return getaddrinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_BLKSIZE_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_getaddrinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_socket_getaddrinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getaddrinfo" >&5
+$as_echo "$ac_cv_lib_socket_getaddrinfo" >&6; }
+if test "x$ac_cv_lib_socket_getaddrinfo" = xyes; then :
+
+NSLLIB='-lsocket'
+$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blkcnt_t" >&5
-$as_echo_n "checking blkcnt_t... " >&6; }
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lws2_32" >&5
+$as_echo_n "checking for getaddrinfo in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getaddrinfo ();
int
main ()
{
-
- blkcnt_t devno;
-
+return getaddrinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_BLKCNT_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws2_32_getaddrinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_ws2_32_getaddrinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getaddrinfo" >&5
+$as_echo "$ac_cv_lib_ws2_32_getaddrinfo" >&6; }
+if test "x$ac_cv_lib_ws2_32_getaddrinfo" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETADDRINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fpos_t" >&5
-$as_echo_n "checking fpos_t... " >&6; }
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in getnameinfo
+do :
+ ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo"
+if test "x$ac_cv_func_getnameinfo" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_GETNAMEINFO 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lxnet" >&5
+$as_echo_n "checking for getnameinfo in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_getnameinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getnameinfo ();
int
main ()
{
-
- fpos_t devno;
-
+return getnameinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_FPOS_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_getnameinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_xnet_getnameinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getnameinfo" >&5
+$as_echo "$ac_cv_lib_xnet_getnameinfo" >&6; }
+if test "x$ac_cv_lib_xnet_getnameinfo" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blocksize and blockcount in stat output" >&5
-$as_echo_n "checking blocksize and blockcount in stat output... " >&6; }
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lnsl" >&5
+$as_echo_n "checking for getnameinfo in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_getnameinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define _LARGEFILE64_SOURCE 1
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getnameinfo ();
int
main ()
{
-
-#if HAVE_TYPE_STAT64
- struct stat64 stb;
- stb.st_blksize = 0;
- stb.st_blocks = 0;
-#else
- struct stat stb;
- stb.st_blksize = 0;
- stb.st_blocks = 0;
-#endif
-
+return getnameinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_FILE_BLKSIZECNT 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_getnameinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_nsl_getnameinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getnameinfo" >&5
+$as_echo "$ac_cv_lib_nsl_getnameinfo" >&6; }
+if test "x$ac_cv_lib_nsl_getnameinfo" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _fpos_t" >&5
-$as_echo_n "checking _fpos_t... " >&6; }
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lsocket" >&5
+$as_echo_n "checking for getnameinfo in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_getnameinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getnameinfo ();
int
main ()
{
-
- _fpos_t devno;
-
+return getnameinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE__FPOS_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_getnameinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_socket_getnameinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getnameinfo" >&5
+$as_echo "$ac_cv_lib_socket_getnameinfo" >&6; }
+if test "x$ac_cv_lib_socket_getnameinfo" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking socklen_t" >&5
-$as_echo_n "checking socklen_t... " >&6; }
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lws2_32" >&5
+$as_echo_n "checking for getnameinfo in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_getnameinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getnameinfo ();
int
main ()
{
-
-socklen_t sz;
-
+return getnameinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws2_32_getnameinfo=yes
+else
+ ac_cv_lib_ws2_32_getnameinfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getnameinfo" >&5
+$as_echo "$ac_cv_lib_ws2_32_getnameinfo" >&6; }
+if test "x$ac_cv_lib_ws2_32_getnameinfo" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_SOCKLEN_T 1" >>confdefs.h
+$as_echo "@%:@define HAVE_GETNAMEINFO 1" >>confdefs.h
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+fi
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_in" >&5
-$as_echo_n "checking struct sockaddr_in... " >&6; }
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in gethostbyname
+do :
+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_GETHOSTBYNAME 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lxnet" >&5
+$as_echo_n "checking for gethostbyname in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char gethostbyname ();
int
main ()
{
-
-struct sockaddr_in sain;
-
+return gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_gethostbyname=yes
+else
+ ac_cv_lib_xnet_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_gethostbyname" >&5
+$as_echo "$ac_cv_lib_xnet_gethostbyname" >&6; }
+if test "x$ac_cv_lib_xnet_gethostbyname" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_STRUCT_SOCKADDR_IN 1" >>confdefs.h
+$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_in6" >&5
-$as_echo_n "checking struct sockaddr_in6... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char gethostbyname ();
int
main ()
{
-
-struct sockaddr_in6 sain;
-
+return gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
+$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_un" >&5
-$as_echo_n "checking struct sockaddr_un... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5
+$as_echo_n "checking for gethostbyname in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char gethostbyname ();
int
main ()
{
-
-struct sockaddr_un sain;
-
+return gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_gethostbyname=yes
+else
+ ac_cv_lib_socket_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5
+$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; }
+if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_STRUCT_SOCKADDR_UN 1" >>confdefs.h
+$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct addrinfo" >&5
-$as_echo_n "checking struct addrinfo... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lws3_32" >&5
+$as_echo_n "checking for gethostbyname in -lws3_32... " >&6; }
+if ${ac_cv_lib_ws3_32_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws3_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char gethostbyname ();
int
main ()
{
-
-struct addrinfo adi;
-
+return gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws3_32_gethostbyname=yes
+else
+ ac_cv_lib_ws3_32_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws3_32_gethostbyname" >&5
+$as_echo "$ac_cv_lib_ws3_32_gethostbyname" >&6; }
+if test "x$ac_cv_lib_ws3_32_gethostbyname" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h
+$as_echo "@%:@define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+fi
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_storage" >&5
-$as_echo_n "checking struct sockaddr_storage... " >&6; }
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking htons" >&5
+$as_echo_n "checking htons... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
int
main ()
{
-struct sockaddr_storage sain;
+ unsigned short s;
+ s = htons(5);
;
return 0;
@@ -10207,10 +12520,10 @@ struct sockaddr_storage sain;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+$as_echo "@%:@define HAVE_HTONS 1" >>confdefs.h
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
-
else
@@ -10220,28 +12533,22 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IN_ADDR" >&5
-$as_echo_n "checking IN_ADDR... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ntohs" >&5
+$as_echo_n "checking ntohs... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#if HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -10251,7 +12558,8 @@ int
main ()
{
-IN_ADDR addr;
+ unsigned short s;
+ s = ntohs(5);
;
return 0;
@@ -10259,10 +12567,10 @@ IN_ADDR addr;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+$as_echo "@%:@define HAVE_NTOHS 1" >>confdefs.h
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_IN_ADDR 1" >>confdefs.h
-
else
@@ -10272,28 +12580,22 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IN6_ADDR" >&5
-$as_echo_n "checking IN6_ADDR... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking htonl" >&5
+$as_echo_n "checking htonl... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#if HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -10303,7 +12605,8 @@ int
main ()
{
-IN6_ADDR addr;
+ unsigned long s;
+ s = htonl(5);
;
return 0;
@@ -10311,10 +12614,10 @@ IN6_ADDR addr;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+$as_echo "@%:@define HAVE_HTONL 1" >>confdefs.h
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_IN6_ADDR 1" >>confdefs.h
-
else
@@ -10324,55 +12627,33 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking rand srand" >&5
-$as_echo_n "checking rand srand... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main ()
-{
-
- srand(25);
- printf("%d\n", rand());
- printf("%d\n", RAND_MAX);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_RAND 1" >>confdefs.h
-
-$as_echo "@%:@define HAVE_SRAND 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking initstate setstate random" >&5
-$as_echo_n "checking initstate setstate random... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ntohl" >&5
+$as_echo_n "checking ntohl... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
int
main ()
{
-char rs[256];
-initstate(25, rs, sizeof(rs));
-setstate(rs);
-printf("%ld\n", random());
+ unsigned long s;
+ s = ntohl(5);
;
return 0;
@@ -10380,604 +12661,39 @@ printf("%ld\n", random());
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_INITSTATE 1" >>confdefs.h
-
-$as_echo "@%:@define HAVE_SETSTATE 1" >>confdefs.h
-
-$as_echo "@%:@define HAVE_RANDOM 1" >>confdefs.h
-
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lrand48 nrand48 seed48" >&5
-$as_echo_n "checking lrand48 nrand48 seed48... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main ()
-{
-
-unsigned short sv[3];
-sv[0] = 0;
-sv[1] = 1;
-sv[2] = 2;
-seed48(sv);
-printf("%ld\n", lrand48());
-printf("%ld\n", nrand48(sv));
+$as_echo "@%:@define HAVE_NTOHL 1" >>confdefs.h
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "@%:@define HAVE_LRAND48 1" >>confdefs.h
-
-$as_echo "@%:@define HAVE_NRAND48 1" >>confdefs.h
-
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
-$as_echo_n "checking size of off_t... " >&6; }
-if ${ac_cv_sizeof_off_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
-else
- if test "$ac_cv_type_off_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (off_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off_t=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
-$as_echo "$ac_cv_sizeof_off_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-@%:@define SIZEOF_OFF_T $ac_cv_sizeof_off_t
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off64_t" >&5
-$as_echo_n "checking size of off64_t... " >&6; }
-if ${ac_cv_sizeof_off64_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off64_t))" "ac_cv_sizeof_off64_t" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_off64_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (off64_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off64_t=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off64_t" >&5
-$as_echo "$ac_cv_sizeof_off64_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-@%:@define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
-$as_echo_n "checking size of ino_t... " >&6; }
-if ${ac_cv_sizeof_ino_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_ino_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (ino_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_ino_t=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
-$as_echo "$ac_cv_sizeof_ino_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-@%:@define SIZEOF_INO_T $ac_cv_sizeof_ino_t
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino64_t" >&5
-$as_echo_n "checking size of ino64_t... " >&6; }
-if ${ac_cv_sizeof_ino64_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino64_t))" "ac_cv_sizeof_ino64_t" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_ino64_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (ino64_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_ino64_t=0
- fi
-fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino64_t" >&5
-$as_echo "$ac_cv_sizeof_ino64_t" >&6; }
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-cat >>confdefs.h <<_ACEOF
-@%:@define SIZEOF_INO64_T $ac_cv_sizeof_ino64_t
+for ac_func in inet_addr
+do :
+ ac_fn_c_check_func "$LINENO" "inet_addr" "ac_cv_func_inet_addr"
+if test "x$ac_cv_func_inet_addr" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_INET_ADDR 1
_ACEOF
-
-
-
-
-@%:@ Check whether --with-fallback-limits was given.
-if test "${with_fallback_limits+set}" = set; then :
- withval=$with_fallback_limits; $as_echo "@%:@define USE_FALLBACK_NUMERIC_LIMITS 1" >>confdefs.h
-
-fi
-
-
-
-@%:@ Check whether --with-printf-scanf was given.
-if test "${with_printf_scanf+set}" = set; then :
- withval=$with_printf_scanf; CAN_USE_PRINTF_SCANF="$withval"
-fi
-
-
-if [ "X$CAN_USE_PRINTF_SCANF" != "Xno" ]
-then
- $as_echo "@%:@define USE_PRINTF_SCANF 1" >>confdefs.h
-
-fi
-
-$as_echo "@%:@define HAVE_FILE_DEVINO 1" >>confdefs.h
-
-$as_echo "@%:@define HAVE_FILE_UIDGID 1" >>confdefs.h
-
-$as_echo "@%:@define HAVE_FILE_ATIMECTIME 1" >>confdefs.h
-
-
-$as_echo "@%:@define HAVE_COMPATDKTOOLS3 1" >>confdefs.h
-
-
-SEP=`cat sep.txt`
-for i in test*.ctr
-do
-j=`echo $i | sed -e 's/\.ctr//g'`
-if [ "X$TESTPROGRAMS" = "X" ]
-then
- TESTPROGRAMS="$j"
-else
- TESTPROGRAMS="${TESTPROGRAMS} ${SEP}$j"
-fi
-done
-
-if [ "X$SUITE" = "Xgui" ]
-then
- $as_echo "@%:@define HAVE_WXWIDGETS 1" >>confdefs.h
-
-else
- WXCPPFLAGS=''
- WXCXXFLAGS=''
- WXCFLAGS=''
- WXLDFLAGS=''
-fi
-
-WXMAJOR=''
-WXMINOR=''
-
-if [ "X$WXVERSION" != "X" ]
-then
- WXMAJOR=`echo $WXVERSION | cut -f 1 -d .`
- WXMINOR=`echo $WXVERSION | cut -f 2 -d .`
-fi
-[ "X$WXMAJOR" != "X" ] || WXMAJOR="0"
-
-if [ "$WXMAJOR" -ge 3 ]
-then
-$as_echo "@%:@define HAVE_WX_CHARTYPE_H 1" >>confdefs.h
-
-elif [ "$WXMAJOR" -ge 2 ]
-then
-$as_echo "@%:@define HAVE_WX_WXCHAR_H 1" >>confdefs.h
-
-fi
-
-LIBPNG=''
-LIBJPEG=''
-LIBTIFF=''
-ANYDB=''
-SNMPPROG=''
-MYSQLPROG=''
-PTHREADLIB=''
-LIBDK3WXOBJ=''
-LIBDK4WXOBJ=''
-LIBDK4WXTOBUILD=''
-DBLIB=''
-DBLIBSOCK=''
-NETSNMP_LIBS=''
-NETSNMP_CFLAGS=''
-NETSNMP_LIBS=`net-snmp-config --libs`
-NETSNMP_CFLAGS=`net-snmp-config --cflags`
-ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdio_h" = xyes; then :
- $as_echo "@%:@define HAVE_STDIO_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "conio.h" "ac_cv_header_conio_h" "$ac_includes_default"
-if test "x$ac_cv_header_conio_h" = xyes; then :
- $as_echo "@%:@define HAVE_CONIO_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default"
-if test "x$ac_cv_header_grp_h" = xyes; then :
- $as_echo "@%:@define HAVE_GRP_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "gdbm.h" "ac_cv_header_gdbm_h" "$ac_includes_default"
-if test "x$ac_cv_header_gdbm_h" = xyes; then :
- FOUND_GDBM='yes'
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "ndbm.h" "ac_cv_header_ndbm_h" "$ac_includes_default"
-if test "x$ac_cv_header_ndbm_h" = xyes; then :
- FOUND_NDBM='yes'
-fi
-
-
-case "X${FOUND_NDBM}${USE_NDBM}${FOUND_GDBM}" in
- "Xyesyesyes")
- $as_echo "@%:@define HAVE_NDBM_H 1" >>confdefs.h
-
- ANYDB='ndbm'
- ;;
- "Xyesyesno")
- $as_echo "@%:@define HAVE_NDBM_H 1" >>confdefs.h
-
- ANYDB='ndbm'
- ;;
- "Xyesautono")
- $as_echo "@%:@define HAVE_NDBM_H 1" >>confdefs.h
-
- ANYDB='ndbm'
- ;;
-esac
-if [ "X$ANYDB" != "Xndbm" -a "X$FOUND_GDBM" = "Xyes" ]
-then
- $as_echo "@%:@define HAVE_GDBM_H 1" >>confdefs.h
-
-fi
-ac_fn_c_check_header_mongrel "$LINENO" "db.h" "ac_cv_header_db_h" "$ac_includes_default"
-if test "x$ac_cv_header_db_h" = xyes; then :
- FOUND_BDB='yes';ANYDB='db';DBLIB="-ldb";$as_echo "@%:@define HAVE_DB_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "dir.h" "ac_cv_header_dir_h" "$ac_includes_default"
-if test "x$ac_cv_header_dir_h" = xyes; then :
- $as_echo "@%:@define HAVE_DIR_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "err.h" "ac_cv_header_err_h" "$ac_includes_default"
-if test "x$ac_cv_header_err_h" = xyes; then :
- $as_echo "@%:@define HAVE_ERR_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default"
-if test "x$ac_cv_header_shadow_h" = xyes; then :
- $as_echo "@%:@define HAVE_SHADOW_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$ac_includes_default"
-if test "x$ac_cv_header_stropts_h" = xyes; then :
- $as_echo "@%:@define HAVE_STROPTS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
-if test "x$ac_cv_header_syslog_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYSLOG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sysres.h" "ac_cv_header_sysres_h" "$ac_includes_default"
-if test "x$ac_cv_header_sysres_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYSRES_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default"
-if test "x$ac_cv_header_termios_h" = xyes; then :
- $as_echo "@%:@define HAVE_TERMIOS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "vararg.h" "ac_cv_header_vararg_h" "$ac_includes_default"
-if test "x$ac_cv_header_vararg_h" = xyes; then :
- $as_echo "@%:@define HAVE_VARARG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "varargs.h" "ac_cv_header_varargs_h" "$ac_includes_default"
-if test "x$ac_cv_header_varargs_h" = xyes; then :
- $as_echo "@%:@define HAVE_VARARGS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "ntifs.h" "ac_cv_header_ntifs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ntifs_h" = xyes; then :
- $as_echo "@%:@define HAVE_NTIFS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_file_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_FILE_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_resource_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_RESOURCE_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_statvfs_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_STATVFS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/stropts.h" "ac_cv_header_sys_stropts_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_stropts_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_STROPTS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/sunddi.h" "ac_cv_header_sys_sunddi_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sunddi_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_SUNDDI_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_SYSCTL_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/systeminfo.h" "ac_cv_header_sys_systeminfo_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_systeminfo_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_SYSTEMINFO_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/termios.h" "ac_cv_header_sys_termios_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_termios_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_TERMIOS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/ttold.h" "ac_cv_header_sys_ttold_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_ttold_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_TTOLD_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_uio_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_UIO_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_wait_h" = xyes; then :
- $as_echo "@%:@define HAVE_SYS_WAIT_H 1" >>confdefs.h
-
-fi
-
-
-
-ac_fn_c_check_header_compile "$LINENO" "winbase.h" "ac_cv_header_winbase_h" "
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-"
-if test "x$ac_cv_header_winbase_h" = xyes; then :
- $as_echo "@%:@define HAVE_WINBASE_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_compile "$LINENO" "winreg.h" "ac_cv_header_winreg_h" "
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-#if HAVE_WINBASE_H
-#include <winbase.h>
-#endif
-
-"
-if test "x$ac_cv_header_winreg_h" = xyes; then :
- $as_echo "@%:@define HAVE_WINREG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_compile "$LINENO" "wincon.h" "ac_cv_header_wincon_h" "
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-#if HAVE_WINBASE_H
-#include <winbase.h>
-#endif
-
-"
-if test "x$ac_cv_header_wincon_h" = xyes; then :
- $as_echo "@%:@define HAVE_WINCON_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
-if test "x$ac_cv_header_png_h" = xyes; then :
- LIBPNG="-lpng";$as_echo "@%:@define HAVE_PNG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
-if test "x$ac_cv_header_jpeglib_h" = xyes; then :
- LIBJPEG="-ljpeg";$as_echo "@%:@define HAVE_JPEGLIB_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "tiff.h" "ac_cv_header_tiff_h" "$ac_includes_default"
-if test "x$ac_cv_header_tiff_h" = xyes; then :
- LIBTIFF="-ltiff";$as_echo "@%:@define HAVE_TIFF_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default"
-if test "x$ac_cv_header_mysql_mysql_h" = xyes; then :
-
-MYSQLPROG='mysqlprog'
-MYSQLLIB='-lmysqlclient'
-$as_echo "@%:@define HAVE_MYSQL_MYSQL_H 1" >>confdefs.h
+
+$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
else
-ac_fn_c_check_header_mongrel "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default"
-if test "x$ac_cv_header_mysql_h" = xyes; then :
-
-MYSQLPROG='mysqlprog'
-MYSQLLIB='-lmysqlclient'
-$as_echo "@%:@define HAVE_MYSQL_H 1" >>confdefs.h
-
-
-
-fi
-
-
-
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "lprng.h" "ac_cv_header_lprng_h" "$ac_includes_default"
-if test "x$ac_cv_header_lprng_h" = xyes; then :
- $as_echo "@%:@define HAVE_LPRNG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
-if test "x$ac_cv_header_pthread_h" = xyes; then :
- PTHREADLIB='-lpthread';$as_echo "@%:@define HAVE_PTHREAD_H 1" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosh in -lm" >&5
-$as_echo_n "checking for acosh in -lm... " >&6; }
-if ${ac_cv_lib_m_acosh+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lxnet" >&5
+$as_echo_n "checking for inet_addr in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_inet_addr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -10987,38 +12703,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char acosh ();
+char inet_addr ();
int
main ()
{
-return acosh ();
+return inet_addr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_acosh=yes
+ ac_cv_lib_xnet_inet_addr=yes
else
- ac_cv_lib_m_acosh=no
+ ac_cv_lib_xnet_inet_addr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosh" >&5
-$as_echo "$ac_cv_lib_m_acosh" >&6; }
-if test "x$ac_cv_lib_m_acosh" = xyes; then :
- $as_echo "@%:@define HAVE_ACOSH 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_addr" >&5
+$as_echo "$ac_cv_lib_xnet_inet_addr" >&6; }
+if test "x$ac_cv_lib_xnet_inet_addr" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acoshl in -lm" >&5
-$as_echo_n "checking for acoshl in -lm... " >&6; }
-if ${ac_cv_lib_m_acoshl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lnsl" >&5
+$as_echo_n "checking for inet_addr in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_addr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11028,38 +12746,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char acoshl ();
+char inet_addr ();
int
main ()
{
-return acoshl ();
+return inet_addr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_acoshl=yes
+ ac_cv_lib_nsl_inet_addr=yes
else
- ac_cv_lib_m_acoshl=no
+ ac_cv_lib_nsl_inet_addr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acoshl" >&5
-$as_echo "$ac_cv_lib_m_acoshl" >&6; }
-if test "x$ac_cv_lib_m_acoshl" = xyes; then :
- $as_echo "@%:@define HAVE_ACOSHL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_addr" >&5
+$as_echo "$ac_cv_lib_nsl_inet_addr" >&6; }
+if test "x$ac_cv_lib_nsl_inet_addr" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosl in -lm" >&5
-$as_echo_n "checking for acosl in -lm... " >&6; }
-if ${ac_cv_lib_m_acosl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lsocket" >&5
+$as_echo_n "checking for inet_addr in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_inet_addr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11069,38 +12789,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char acosl ();
+char inet_addr ();
int
main ()
{
-return acosl ();
+return inet_addr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_acosl=yes
+ ac_cv_lib_socket_inet_addr=yes
else
- ac_cv_lib_m_acosl=no
+ ac_cv_lib_socket_inet_addr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosl" >&5
-$as_echo "$ac_cv_lib_m_acosl" >&6; }
-if test "x$ac_cv_lib_m_acosl" = xyes; then :
- $as_echo "@%:@define HAVE_ACOSL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_addr" >&5
+$as_echo "$ac_cv_lib_socket_inet_addr" >&6; }
+if test "x$ac_cv_lib_socket_inet_addr" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinh in -lm" >&5
-$as_echo_n "checking for asinh in -lm... " >&6; }
-if ${ac_cv_lib_m_asinh+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lws2_32" >&5
+$as_echo_n "checking for inet_addr in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_inet_addr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11110,79 +12832,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char asinh ();
+char inet_addr ();
int
main ()
{
-return asinh ();
+return inet_addr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_asinh=yes
+ ac_cv_lib_ws2_32_inet_addr=yes
else
- ac_cv_lib_m_asinh=no
+ ac_cv_lib_ws2_32_inet_addr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinh" >&5
-$as_echo "$ac_cv_lib_m_asinh" >&6; }
-if test "x$ac_cv_lib_m_asinh" = xyes; then :
- $as_echo "@%:@define HAVE_ASINH 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_addr" >&5
+$as_echo "$ac_cv_lib_ws2_32_inet_addr" >&6; }
+if test "x$ac_cv_lib_ws2_32_inet_addr" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_ADDR 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinhl in -lm" >&5
-$as_echo_n "checking for asinhl in -lm... " >&6; }
-if ${ac_cv_lib_m_asinhl+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char asinhl ();
-int
-main ()
-{
-return asinhl ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_asinhl=yes
-else
- ac_cv_lib_m_asinhl=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinhl" >&5
-$as_echo "$ac_cv_lib_m_asinhl" >&6; }
-if test "x$ac_cv_lib_m_asinhl" = xyes; then :
- $as_echo "@%:@define HAVE_ASINHL 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinl in -lm" >&5
-$as_echo_n "checking for asinl in -lm... " >&6; }
-if ${ac_cv_lib_m_asinl+:} false; then :
+
+fi
+done
+
+
+for ac_func in inet_aton
+do :
+ ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
+if test "x$ac_cv_func_inet_aton" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_INET_ATON 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lxnet" >&5
+$as_echo_n "checking for inet_aton in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11192,38 +12902,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char asinl ();
+char inet_aton ();
int
main ()
{
-return asinl ();
+return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_asinl=yes
+ ac_cv_lib_xnet_inet_aton=yes
else
- ac_cv_lib_m_asinl=no
+ ac_cv_lib_xnet_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinl" >&5
-$as_echo "$ac_cv_lib_m_asinl" >&6; }
-if test "x$ac_cv_lib_m_asinl" = xyes; then :
- $as_echo "@%:@define HAVE_ASINL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_aton" >&5
+$as_echo "$ac_cv_lib_xnet_inet_aton" >&6; }
+if test "x$ac_cv_lib_xnet_inet_aton" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2 in -lm" >&5
-$as_echo_n "checking for atan2 in -lm... " >&6; }
-if ${ac_cv_lib_m_atan2+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lnsl" >&5
+$as_echo_n "checking for inet_aton in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11233,38 +12945,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char atan2 ();
+char inet_aton ();
int
main ()
{
-return atan2 ();
+return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atan2=yes
+ ac_cv_lib_nsl_inet_aton=yes
else
- ac_cv_lib_m_atan2=no
+ ac_cv_lib_nsl_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2" >&5
-$as_echo "$ac_cv_lib_m_atan2" >&6; }
-if test "x$ac_cv_lib_m_atan2" = xyes; then :
- $as_echo "@%:@define HAVE_ATAN2 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_aton" >&5
+$as_echo "$ac_cv_lib_nsl_inet_aton" >&6; }
+if test "x$ac_cv_lib_nsl_inet_aton" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2l in -lm" >&5
-$as_echo_n "checking for atan2l in -lm... " >&6; }
-if ${ac_cv_lib_m_atan2l+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lsocket" >&5
+$as_echo_n "checking for inet_aton in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11274,38 +12988,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char atan2l ();
+char inet_aton ();
int
main ()
{
-return atan2l ();
+return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atan2l=yes
+ ac_cv_lib_socket_inet_aton=yes
else
- ac_cv_lib_m_atan2l=no
+ ac_cv_lib_socket_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2l" >&5
-$as_echo "$ac_cv_lib_m_atan2l" >&6; }
-if test "x$ac_cv_lib_m_atan2l" = xyes; then :
- $as_echo "@%:@define HAVE_ATAN2L 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_aton" >&5
+$as_echo "$ac_cv_lib_socket_inet_aton" >&6; }
+if test "x$ac_cv_lib_socket_inet_aton" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanh in -lm" >&5
-$as_echo_n "checking for atanh in -lm... " >&6; }
-if ${ac_cv_lib_m_atanh+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lws2_32" >&5
+$as_echo_n "checking for inet_aton in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11315,79 +13031,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char atanh ();
+char inet_aton ();
int
main ()
{
-return atanh ();
+return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atanh=yes
+ ac_cv_lib_ws2_32_inet_aton=yes
else
- ac_cv_lib_m_atanh=no
+ ac_cv_lib_ws2_32_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanh" >&5
-$as_echo "$ac_cv_lib_m_atanh" >&6; }
-if test "x$ac_cv_lib_m_atanh" = xyes; then :
- $as_echo "@%:@define HAVE_ATANH 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_aton" >&5
+$as_echo "$ac_cv_lib_ws2_32_inet_aton" >&6; }
+if test "x$ac_cv_lib_ws2_32_inet_aton" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_ATON 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanhl in -lm" >&5
-$as_echo_n "checking for atanhl in -lm... " >&6; }
-if ${ac_cv_lib_m_atanhl+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char atanhl ();
-int
-main ()
-{
-return atanhl ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atanhl=yes
-else
- ac_cv_lib_m_atanhl=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanhl" >&5
-$as_echo "$ac_cv_lib_m_atanhl" >&6; }
-if test "x$ac_cv_lib_m_atanhl" = xyes; then :
- $as_echo "@%:@define HAVE_ATANHL 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanl in -lm" >&5
-$as_echo_n "checking for atanl in -lm... " >&6; }
-if ${ac_cv_lib_m_atanl+:} false; then :
+
+fi
+done
+
+
+for ac_func in inet_pton
+do :
+ ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
+if test "x$ac_cv_func_inet_pton" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_INET_PTON 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lxnet" >&5
+$as_echo_n "checking for inet_pton in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_inet_pton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11397,38 +13101,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char atanl ();
+char inet_pton ();
int
main ()
{
-return atanl ();
+return inet_pton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atanl=yes
+ ac_cv_lib_xnet_inet_pton=yes
else
- ac_cv_lib_m_atanl=no
+ ac_cv_lib_xnet_inet_pton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanl" >&5
-$as_echo "$ac_cv_lib_m_atanl" >&6; }
-if test "x$ac_cv_lib_m_atanl" = xyes; then :
- $as_echo "@%:@define HAVE_ATANL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_pton" >&5
+$as_echo "$ac_cv_lib_xnet_inet_pton" >&6; }
+if test "x$ac_cv_lib_xnet_inet_pton" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5
-$as_echo_n "checking for ceil in -lm... " >&6; }
-if ${ac_cv_lib_m_ceil+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lnsl" >&5
+$as_echo_n "checking for inet_pton in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_pton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11438,38 +13144,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char ceil ();
+char inet_pton ();
int
main ()
{
-return ceil ();
+return inet_pton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_ceil=yes
+ ac_cv_lib_nsl_inet_pton=yes
else
- ac_cv_lib_m_ceil=no
+ ac_cv_lib_nsl_inet_pton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceil" >&5
-$as_echo "$ac_cv_lib_m_ceil" >&6; }
-if test "x$ac_cv_lib_m_ceil" = xyes; then :
- $as_echo "@%:@define HAVE_CEIL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_pton" >&5
+$as_echo "$ac_cv_lib_nsl_inet_pton" >&6; }
+if test "x$ac_cv_lib_nsl_inet_pton" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceill in -lm" >&5
-$as_echo_n "checking for ceill in -lm... " >&6; }
-if ${ac_cv_lib_m_ceill+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lsocket" >&5
+$as_echo_n "checking for inet_pton in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_inet_pton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11479,38 +13187,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char ceill ();
+char inet_pton ();
int
main ()
{
-return ceill ();
+return inet_pton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_ceill=yes
+ ac_cv_lib_socket_inet_pton=yes
else
- ac_cv_lib_m_ceill=no
+ ac_cv_lib_socket_inet_pton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceill" >&5
-$as_echo "$ac_cv_lib_m_ceill" >&6; }
-if test "x$ac_cv_lib_m_ceill" = xyes; then :
- $as_echo "@%:@define HAVE_CEILL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_pton" >&5
+$as_echo "$ac_cv_lib_socket_inet_pton" >&6; }
+if test "x$ac_cv_lib_socket_inet_pton" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for coshl in -lm" >&5
-$as_echo_n "checking for coshl in -lm... " >&6; }
-if ${ac_cv_lib_m_coshl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lws2_32" >&5
+$as_echo_n "checking for inet_pton in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_inet_pton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11520,79 +13230,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char coshl ();
+char inet_pton ();
int
main ()
{
-return coshl ();
+return inet_pton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_coshl=yes
+ ac_cv_lib_ws2_32_inet_pton=yes
else
- ac_cv_lib_m_coshl=no
+ ac_cv_lib_ws2_32_inet_pton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_coshl" >&5
-$as_echo "$ac_cv_lib_m_coshl" >&6; }
-if test "x$ac_cv_lib_m_coshl" = xyes; then :
- $as_echo "@%:@define HAVE_COSHL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_pton" >&5
+$as_echo "$ac_cv_lib_ws2_32_inet_pton" >&6; }
+if test "x$ac_cv_lib_ws2_32_inet_pton" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_PTON 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosl in -lm" >&5
-$as_echo_n "checking for cosl in -lm... " >&6; }
-if ${ac_cv_lib_m_cosl+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char cosl ();
-int
-main ()
-{
-return cosl ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_cosl=yes
-else
- ac_cv_lib_m_cosl=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cosl" >&5
-$as_echo "$ac_cv_lib_m_cosl" >&6; }
-if test "x$ac_cv_lib_m_cosl" = xyes; then :
- $as_echo "@%:@define HAVE_COSL 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for expl in -lm" >&5
-$as_echo_n "checking for expl in -lm... " >&6; }
-if ${ac_cv_lib_m_expl+:} false; then :
+
+fi
+done
+
+
+for ac_func in inet_ntop
+do :
+ ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
+if test "x$ac_cv_func_inet_ntop" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_INET_NTOP 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lxnet" >&5
+$as_echo_n "checking for inet_ntop in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_inet_ntop+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11602,38 +13300,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char expl ();
+char inet_ntop ();
int
main ()
{
-return expl ();
+return inet_ntop ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_expl=yes
+ ac_cv_lib_xnet_inet_ntop=yes
else
- ac_cv_lib_m_expl=no
+ ac_cv_lib_xnet_inet_ntop=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_expl" >&5
-$as_echo "$ac_cv_lib_m_expl" >&6; }
-if test "x$ac_cv_lib_m_expl" = xyes; then :
- $as_echo "@%:@define HAVE_EXPL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_ntop" >&5
+$as_echo "$ac_cv_lib_xnet_inet_ntop" >&6; }
+if test "x$ac_cv_lib_xnet_inet_ntop" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabs in -lm" >&5
-$as_echo_n "checking for fabs in -lm... " >&6; }
-if ${ac_cv_lib_m_fabs+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lnsl" >&5
+$as_echo_n "checking for inet_ntop in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_ntop+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11643,38 +13343,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char fabs ();
+char inet_ntop ();
int
main ()
{
-return fabs ();
+return inet_ntop ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_fabs=yes
+ ac_cv_lib_nsl_inet_ntop=yes
else
- ac_cv_lib_m_fabs=no
+ ac_cv_lib_nsl_inet_ntop=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabs" >&5
-$as_echo "$ac_cv_lib_m_fabs" >&6; }
-if test "x$ac_cv_lib_m_fabs" = xyes; then :
- $as_echo "@%:@define HAVE_FABS 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntop" >&5
+$as_echo "$ac_cv_lib_nsl_inet_ntop" >&6; }
+if test "x$ac_cv_lib_nsl_inet_ntop" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsl in -lm" >&5
-$as_echo_n "checking for fabsl in -lm... " >&6; }
-if ${ac_cv_lib_m_fabsl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lsocket" >&5
+$as_echo_n "checking for inet_ntop in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_inet_ntop+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11684,38 +13386,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char fabsl ();
+char inet_ntop ();
int
main ()
{
-return fabsl ();
+return inet_ntop ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_fabsl=yes
+ ac_cv_lib_socket_inet_ntop=yes
else
- ac_cv_lib_m_fabsl=no
+ ac_cv_lib_socket_inet_ntop=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabsl" >&5
-$as_echo "$ac_cv_lib_m_fabsl" >&6; }
-if test "x$ac_cv_lib_m_fabsl" = xyes; then :
- $as_echo "@%:@define HAVE_FABSL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_ntop" >&5
+$as_echo "$ac_cv_lib_socket_inet_ntop" >&6; }
+if test "x$ac_cv_lib_socket_inet_ntop" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5
-$as_echo_n "checking for floor in -lm... " >&6; }
-if ${ac_cv_lib_m_floor+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lws2_32" >&5
+$as_echo_n "checking for inet_ntop in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_inet_ntop+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11725,38 +13429,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char floor ();
+char inet_ntop ();
int
main ()
{
-return floor ();
+return inet_ntop ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_floor=yes
+ ac_cv_lib_ws2_32_inet_ntop=yes
else
- ac_cv_lib_m_floor=no
+ ac_cv_lib_ws2_32_inet_ntop=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5
-$as_echo "$ac_cv_lib_m_floor" >&6; }
-if test "x$ac_cv_lib_m_floor" = xyes; then :
- $as_echo "@%:@define HAVE_FLOOR 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_ntop" >&5
+$as_echo "$ac_cv_lib_ws2_32_inet_ntop" >&6; }
+if test "x$ac_cv_lib_ws2_32_inet_ntop" = xyes; then :
+
+$as_echo "@%:@define HAVE_INET_NTOP 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floorl in -lm" >&5
-$as_echo_n "checking for floorl in -lm... " >&6; }
-if ${ac_cv_lib_m_floorl+:} false; then :
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in getpeername
+do :
+ ac_fn_c_check_func "$LINENO" "getpeername" "ac_cv_func_getpeername"
+if test "x$ac_cv_func_getpeername" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_GETPEERNAME 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lxnet" >&5
+$as_echo_n "checking for getpeername in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_getpeername+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11766,38 +13499,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char floorl ();
+char getpeername ();
int
main ()
{
-return floorl ();
+return getpeername ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_floorl=yes
+ ac_cv_lib_xnet_getpeername=yes
else
- ac_cv_lib_m_floorl=no
+ ac_cv_lib_xnet_getpeername=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floorl" >&5
-$as_echo "$ac_cv_lib_m_floorl" >&6; }
-if test "x$ac_cv_lib_m_floorl" = xyes; then :
- $as_echo "@%:@define HAVE_FLOORL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getpeername" >&5
+$as_echo "$ac_cv_lib_xnet_getpeername" >&6; }
+if test "x$ac_cv_lib_xnet_getpeername" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for labs in -lm" >&5
-$as_echo_n "checking for labs in -lm... " >&6; }
-if ${ac_cv_lib_m_labs+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lnsl" >&5
+$as_echo_n "checking for getpeername in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_getpeername+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11807,38 +13542,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char labs ();
+char getpeername ();
int
main ()
{
-return labs ();
+return getpeername ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_labs=yes
+ ac_cv_lib_nsl_getpeername=yes
else
- ac_cv_lib_m_labs=no
+ ac_cv_lib_nsl_getpeername=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_labs" >&5
-$as_echo "$ac_cv_lib_m_labs" >&6; }
-if test "x$ac_cv_lib_m_labs" = xyes; then :
- $as_echo "@%:@define HAVE_LABS 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getpeername" >&5
+$as_echo "$ac_cv_lib_nsl_getpeername" >&6; }
+if test "x$ac_cv_lib_nsl_getpeername" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for logl in -lm" >&5
-$as_echo_n "checking for logl in -lm... " >&6; }
-if ${ac_cv_lib_m_logl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lsocket" >&5
+$as_echo_n "checking for getpeername in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_getpeername+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11848,38 +13585,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char logl ();
+char getpeername ();
int
main ()
{
-return logl ();
+return getpeername ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_logl=yes
+ ac_cv_lib_socket_getpeername=yes
else
- ac_cv_lib_m_logl=no
+ ac_cv_lib_socket_getpeername=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_logl" >&5
-$as_echo "$ac_cv_lib_m_logl" >&6; }
-if test "x$ac_cv_lib_m_logl" = xyes; then :
- $as_echo "@%:@define HAVE_LOGL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getpeername" >&5
+$as_echo "$ac_cv_lib_socket_getpeername" >&6; }
+if test "x$ac_cv_lib_socket_getpeername" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rint in -lm" >&5
-$as_echo_n "checking for rint in -lm... " >&6; }
-if ${ac_cv_lib_m_rint+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lws2_32" >&5
+$as_echo_n "checking for getpeername in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_getpeername+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11889,38 +13628,65 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char rint ();
+char getpeername ();
int
main ()
{
-return rint ();
+return getpeername ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_rint=yes
+ ac_cv_lib_ws2_32_getpeername=yes
else
- ac_cv_lib_m_rint=no
+ ac_cv_lib_ws2_32_getpeername=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_rint" >&5
-$as_echo "$ac_cv_lib_m_rint" >&6; }
-if test "x$ac_cv_lib_m_rint" = xyes; then :
- $as_echo "@%:@define HAVE_RINT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getpeername" >&5
+$as_echo "$ac_cv_lib_ws2_32_getpeername" >&6; }
+if test "x$ac_cv_lib_ws2_32_getpeername" = xyes; then :
+ $as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rintl in -lm" >&5
-$as_echo_n "checking for rintl in -lm... " >&6; }
-if ${ac_cv_lib_m_rintl+:} false; then :
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in getsockname
+do :
+ ac_fn_c_check_func "$LINENO" "getsockname" "ac_cv_func_getsockname"
+if test "x$ac_cv_func_getsockname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_GETSOCKNAME 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lxnet" >&5
+$as_echo_n "checking for getsockname in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_getsockname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11930,38 +13696,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char rintl ();
+char getsockname ();
int
main ()
{
-return rintl ();
+return getsockname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_rintl=yes
+ ac_cv_lib_xnet_getsockname=yes
else
- ac_cv_lib_m_rintl=no
+ ac_cv_lib_xnet_getsockname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_rintl" >&5
-$as_echo "$ac_cv_lib_m_rintl" >&6; }
-if test "x$ac_cv_lib_m_rintl" = xyes; then :
- $as_echo "@%:@define HAVE_RINTL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getsockname" >&5
+$as_echo "$ac_cv_lib_xnet_getsockname" >&6; }
+if test "x$ac_cv_lib_xnet_getsockname" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinhl in -lm" >&5
-$as_echo_n "checking for sinhl in -lm... " >&6; }
-if ${ac_cv_lib_m_sinhl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lnsl" >&5
+$as_echo_n "checking for getsockname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_getsockname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11971,38 +13739,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sinhl ();
+char getsockname ();
int
main ()
{
-return sinhl ();
+return getsockname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sinhl=yes
+ ac_cv_lib_nsl_getsockname=yes
else
- ac_cv_lib_m_sinhl=no
+ ac_cv_lib_nsl_getsockname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinhl" >&5
-$as_echo "$ac_cv_lib_m_sinhl" >&6; }
-if test "x$ac_cv_lib_m_sinhl" = xyes; then :
- $as_echo "@%:@define HAVE_SINHL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getsockname" >&5
+$as_echo "$ac_cv_lib_nsl_getsockname" >&6; }
+if test "x$ac_cv_lib_nsl_getsockname" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
-$as_echo_n "checking for sqrt in -lm... " >&6; }
-if ${ac_cv_lib_m_sqrt+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lsocket" >&5
+$as_echo_n "checking for getsockname in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_getsockname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12012,38 +13782,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sqrt ();
+char getsockname ();
int
main ()
{
-return sqrt ();
+return getsockname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sqrt=yes
+ ac_cv_lib_socket_getsockname=yes
else
- ac_cv_lib_m_sqrt=no
+ ac_cv_lib_socket_getsockname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
-$as_echo "$ac_cv_lib_m_sqrt" >&6; }
-if test "x$ac_cv_lib_m_sqrt" = xyes; then :
- $as_echo "@%:@define HAVE_SQRT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getsockname" >&5
+$as_echo "$ac_cv_lib_socket_getsockname" >&6; }
+if test "x$ac_cv_lib_socket_getsockname" = xyes; then :
+
+$as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtl in -lm" >&5
-$as_echo_n "checking for sqrtl in -lm... " >&6; }
-if ${ac_cv_lib_m_sqrtl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lws2_32" >&5
+$as_echo_n "checking for getsockname in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_getsockname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12053,38 +13825,65 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sqrtl ();
+char getsockname ();
int
main ()
{
-return sqrtl ();
+return getsockname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sqrtl=yes
+ ac_cv_lib_ws2_32_getsockname=yes
else
- ac_cv_lib_m_sqrtl=no
+ ac_cv_lib_ws2_32_getsockname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrtl" >&5
-$as_echo "$ac_cv_lib_m_sqrtl" >&6; }
-if test "x$ac_cv_lib_m_sqrtl" = xyes; then :
- $as_echo "@%:@define HAVE_SQRTL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getsockname" >&5
+$as_echo "$ac_cv_lib_ws2_32_getsockname" >&6; }
+if test "x$ac_cv_lib_ws2_32_getsockname" = xyes; then :
+ $as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinl in -lm" >&5
-$as_echo_n "checking for sinl in -lm... " >&6; }
-if ${ac_cv_lib_m_sinl+:} false; then :
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in select
+do :
+ ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select"
+if test "x$ac_cv_func_select" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_SELECT 1
+_ACEOF
+
+$as_echo "@%:@define HAVE_SELECT 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in -lxnet" >&5
+$as_echo_n "checking for select in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_select+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12094,38 +13893,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sinl ();
+char select ();
int
main ()
{
-return sinl ();
+return select ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sinl=yes
+ ac_cv_lib_xnet_select=yes
else
- ac_cv_lib_m_sinl=no
+ ac_cv_lib_xnet_select=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinl" >&5
-$as_echo "$ac_cv_lib_m_sinl" >&6; }
-if test "x$ac_cv_lib_m_sinl" = xyes; then :
- $as_echo "@%:@define HAVE_SINL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_select" >&5
+$as_echo "$ac_cv_lib_xnet_select" >&6; }
+if test "x$ac_cv_lib_xnet_select" = xyes; then :
+
+$as_echo "@%:@define HAVE_SELECT 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanhl in -lm" >&5
-$as_echo_n "checking for tanhl in -lm... " >&6; }
-if ${ac_cv_lib_m_tanhl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in -lnsl" >&5
+$as_echo_n "checking for select in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_select+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12135,38 +13936,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char tanhl ();
+char select ();
int
main ()
{
-return tanhl ();
+return select ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_tanhl=yes
+ ac_cv_lib_nsl_select=yes
else
- ac_cv_lib_m_tanhl=no
+ ac_cv_lib_nsl_select=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanhl" >&5
-$as_echo "$ac_cv_lib_m_tanhl" >&6; }
-if test "x$ac_cv_lib_m_tanhl" = xyes; then :
- $as_echo "@%:@define HAVE_TANHL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_select" >&5
+$as_echo "$ac_cv_lib_nsl_select" >&6; }
+if test "x$ac_cv_lib_nsl_select" = xyes; then :
+
+$as_echo "@%:@define HAVE_SELECT 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanl in -lm" >&5
-$as_echo_n "checking for tanl in -lm... " >&6; }
-if ${ac_cv_lib_m_tanl+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in -lsocket" >&5
+$as_echo_n "checking for select in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_select+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12176,38 +13979,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char tanl ();
+char select ();
int
main ()
{
-return tanl ();
+return select ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_tanl=yes
+ ac_cv_lib_socket_select=yes
else
- ac_cv_lib_m_tanl=no
+ ac_cv_lib_socket_select=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanl" >&5
-$as_echo "$ac_cv_lib_m_tanl" >&6; }
-if test "x$ac_cv_lib_m_tanl" = xyes; then :
- $as_echo "@%:@define HAVE_TANL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_select" >&5
+$as_echo "$ac_cv_lib_socket_select" >&6; }
+if test "x$ac_cv_lib_socket_select" = xyes; then :
+
+$as_echo "@%:@define HAVE_SELECT 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_get_pixels_per_inch in -lpng" >&5
-$as_echo_n "checking for png_get_pixels_per_inch in -lpng... " >&6; }
-if ${ac_cv_lib_png_png_get_pixels_per_inch+:} false; then :
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in -lws2_32" >&5
+$as_echo_n "checking for select in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_select+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12217,439 +14022,394 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char png_get_pixels_per_inch ();
+char select ();
int
main ()
{
-return png_get_pixels_per_inch ();
+return select ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_png_png_get_pixels_per_inch=yes
+ ac_cv_lib_ws2_32_select=yes
else
- ac_cv_lib_png_png_get_pixels_per_inch=no
+ ac_cv_lib_ws2_32_select=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_get_pixels_per_inch" >&5
-$as_echo "$ac_cv_lib_png_png_get_pixels_per_inch" >&6; }
-if test "x$ac_cv_lib_png_png_get_pixels_per_inch" = xyes; then :
- $as_echo "@%:@define HAVE_PNG_GET_PIXELS_PER_INCH 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_select" >&5
+$as_echo "$ac_cv_lib_ws2_32_select" >&6; }
+if test "x$ac_cv_lib_ws2_32_select" = xyes; then :
+ $as_echo "@%:@define HAVE_SELECT 1" >>confdefs.h
fi
-for ac_func in getuid setuid setgid
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-for ac_func in chdir chmod chown
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
fi
-done
-for ac_func in opendir readdir closedir
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-for ac_func in getgrent getgrgid getgrnam endgrent setgrent
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
fi
-done
-for ac_func in getpwuid getpwnam
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-for ac_func in fopen fclose feof ferror fflush fread fwrite
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
fi
-done
-for ac_func in _fclose _feof _ferror _fflush _fopen _fread _fwrite
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-for ac_func in _getenv_s _wgetenv _getpid
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
fi
done
-for ac_func in fetestexcept _clearfp
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-for ac_func in fork getrlimit setpgrp setsid syslog
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+if [ "X$SOCKLIB" = "X$NSLLIB" ]
+then
+NSLLIB=''
fi
-done
-for ac_func in gethostname
-do :
- ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname"
-if test "x$ac_cv_func_gethostname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_GETHOSTNAME 1
-_ACEOF
-
-fi
-done
+rundir="$runstatedir"
-for ac_func in time localtime localtime_s
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
+if [ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" = "X" -a -d /lib/systemd/system ]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ $as_echo "@%:@define HAVE_SYSTEMD 1" >>confdefs.h
-for ac_func in stat stat32 lstat32
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/usr/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ $as_echo "@%:@define HAVE_SYSTEMD 1" >>confdefs.h
-for ac_func in _stat _stat32 _stat64 _lstat _lstat32 _lstat64
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" != "X" ]
+then
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ $as_echo "@%:@define HAVE_SYSTEMD 1" >>confdefs.h
-for ac_func in mpctl sysconf sysctl
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" = "X" -a -d /lib/systemd/system ]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ $as_echo "@%:@define HAVE_SYSTEMD 1" >>confdefs.h
+
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/usr/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ $as_echo "@%:@define HAVE_SYSTEMD 1" >>confdefs.h
+
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" != "X" ]
+then
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ $as_echo "@%:@define HAVE_SYSTEMD 1" >>confdefs.h
+
+ rundir='/run'
+elif [ "X$systemddir" = "X" -a -d /lib/systemd/system ]
+then
+ systemddir='/lib/systemd/system'
+elif [ "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]
+then
+ systemddir='/usr/lib/systemd/system'
+elif [ "X$systemddir" = "X" ]
+then
+ systemddir='/lib/systemd/system'
fi
-done
-for ac_func in popen _popen
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+
+
+
+SEP=`cat sep.txt`
+for i in test*.ctr
+do
+j=`echo $i | sed -e 's/\.ctr//g'`
+if [ "X$TESTPROGRAMS" = "X" ]
+then
+ TESTPROGRAMS="$j"
+else
+ TESTPROGRAMS="${TESTPROGRAMS} ${SEP}$j"
fi
done
-for ac_func in read write _read _write
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+
+LIBPNG=''
+LIBJPEG=''
+LIBTIFF=''
+ANYDB=''
+PTHREADLIB=''
+LIBDK3WXOBJ=''
+LIBDK4WXOBJ=''
+LIBDK4WXTOBUILD=''
+DBLIB=''
+DBLIBSOCK=''
+NETSNMP_LIBS=''
+NETSNMP_CFLAGS=''
+
+TESTSNMPCONFIG=''
+if [ "X$CROSSBUILD" != "Xyes" ]
+then
+ TESTSNMPCONFIG='net-snmp-config'
+else
+ CROSSPREFIX=`$PKG_CONFIG --variable=prefix zlib`
+ TESTSNMPCONFIG=`find $CROSSPREFIX -name 'net-snmp-config'`
+fi
+if [ "X$TESTSNMPCONFIG" != "X" ]
+then
+ NETSNMP_LIBS=`$TESTSNMPCONFIG --libs`
+ NETSNMP_CFLAGS=`$TESTSNMPCONFIG --cflags`
fi
-done
-for ac_func in seed48
-do :
- ac_fn_c_check_func "$LINENO" "seed48" "ac_cv_func_seed48"
-if test "x$ac_cv_func_seed48" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_SEED48 1
-_ACEOF
-
+ac_fn_c_check_header_mongrel "$LINENO" "gdbm.h" "ac_cv_header_gdbm_h" "$ac_includes_default"
+if test "x$ac_cv_header_gdbm_h" = xyes; then :
+ FOUND_GDBM='yes'
fi
-done
-for ac_func in sprintf_s sscanf_s swscanf_s
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+
+ac_fn_c_check_header_mongrel "$LINENO" "ndbm.h" "ac_cv_header_ndbm_h" "$ac_includes_default"
+if test "x$ac_cv_header_ndbm_h" = xyes; then :
+ FOUND_NDBM='yes'
fi
-done
-for ac_func in strcat strchr strcmp strcpy strdup strlen strncmp strncpy _strdup
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+
+case "X${FOUND_NDBM}${USE_NDBM}${FOUND_GDBM}" in
+ "Xyesyesyes")
+ $as_echo "@%:@define HAVE_NDBM_H 1" >>confdefs.h
+
+ ANYDB='ndbm'
+ ;;
+ "Xyesyesno")
+ $as_echo "@%:@define HAVE_NDBM_H 1" >>confdefs.h
+
+ ANYDB='ndbm'
+ ;;
+ "Xyesautono")
+ $as_echo "@%:@define HAVE_NDBM_H 1" >>confdefs.h
+
+ ANYDB='ndbm'
+ ;;
+esac
+if [ "X$ANYDB" != "Xndbm" -a "X$FOUND_GDBM" = "Xyes" ]
+then
+ $as_echo "@%:@define HAVE_GDBM_H 1" >>confdefs.h
+
fi
-done
+ac_fn_c_check_header_mongrel "$LINENO" "db.h" "ac_cv_header_db_h" "$ac_includes_default"
+if test "x$ac_cv_header_db_h" = xyes; then :
+ FOUND_BDB='yes';ANYDB='db';DBLIB='-ldb';$as_echo "@%:@define HAVE_DB_H 1" >>confdefs.h
-for ac_func in strncpy_s strrchr strtoimax strtol strtoll strtoul strtoull
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
fi
-done
-for ac_func in strtoumax
-do :
- ac_fn_c_check_func "$LINENO" "strtoumax" "ac_cv_func_strtoumax"
-if test "x$ac_cv_func_strtoumax" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_STRTOUMAX 1
-_ACEOF
-
+
+
+
+FOUND_PNG='no'
+ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
+if test "x$ac_cv_header_png_h" = xyes; then :
+ LIBPNG='-lpng';FOUND_PNG='yes';$as_echo "@%:@define HAVE_PNG_H 1" >>confdefs.h
+
fi
-done
-for ac_func in wcsdup wcsncmp wcsncpy wcsncpy_s wcstoimax wcstol wcstoll
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+
+FOUND_JPG='no'
+
+ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
+if test "x$ac_cv_header_jpeglib_h" = xyes; then :
+ LIBJPEG='-ljpeg';FOUND_JPG='yes';$as_echo "@%:@define HAVE_JPEGLIB_H 1" >>confdefs.h
+
fi
-done
-for ac_func in wcstoul wcstoull wcstoumax
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+
+
+FOUND_TIFF='no'
+ac_fn_c_check_header_mongrel "$LINENO" "tiff.h" "ac_cv_header_tiff_h" "$ac_includes_default"
+if test "x$ac_cv_header_tiff_h" = xyes; then :
+ LIBTIFF='-ltiff';FOUND_TIFF='yes';$as_echo "@%:@define HAVE_TIFF_H 1" >>confdefs.h
+
fi
-done
-for ac_func in _wcscat _wcschr _wcscpy _wcsdup _wcslen _wcsncmp _wcsncpy
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+
+
+WX_HEADER_FOUND='no'
+WX_HEADER_FILENAME=''
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking wx-config" >&5
+$as_echo_n "checking wx-config... " >&6; }
+TESTWXCONFIG=''
+if [ "X$CROSSBUILD" = "Xyes" -a "X$PKG_CONFIG" != "X:" ]
+then
+ CROSSPREFIX=`$PKG_CONFIG --variable=prefix zlib`
+ WX_HEADER_FILENAME=`find $CROSSPREFIX -name 'wx.h'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-3.0'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-gtk3'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-gtk2'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wxconfig'`
+elif [ "X$CROSSBUILD" != "Xyes" ]
+then
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wx-config-3.0`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wx-config-gtk3`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wx-config-gtk2`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wx-config`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wxconfig`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TESTWXCONFIG" >&5
+$as_echo "$TESTWXCONFIG" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking wxWidgets" >&5
+$as_echo_n "checking wxWidgets... " >&6; }
+if [ "XWX_HEADER_FILENAME" != "X" ]
+then
+ WX_HEADER_FOUND='yes'
+fi
+ac_fn_c_check_header_mongrel "$LINENO" "wx/wx.h" "ac_cv_header_wx_wx_h" "$ac_includes_default"
+if test "x$ac_cv_header_wx_wx_h" = xyes; then :
+ WX_HEADER_FOUND='yes'
fi
-done
-for ac_func in _wcsrchr
-do :
- ac_fn_c_check_func "$LINENO" "_wcsrchr" "ac_cv_func__wcsrchr"
-if test "x$ac_cv_func__wcsrchr" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE__WCSRCHR 1
-_ACEOF
-
+
+if [ "X$WX_HEADER_FOUND" = "Xyes" -a "X$TESTWXCONFIG" != "X" ]
+then
+ WXCPPFLAGS=`$TESTWXCONFIG --cppflags`
+ WXCXXFLAGS=`$TESTWXCONFIG --cxxflags`
+ WXVERSION=`$TESTWXCONFIG --version`
+ WXCFLAGS=`$TESTWXCONFIG --cflags`
+ WXLDFLAGS=`$TESTWXCONFIG --libs`
+ WXCONFIGLIBS="$WXLDFLAGS"
+elif [ "X$WX_HEADER_FOUND" = "Xyes" ]
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: wxWidgets headers found, bot no wx-config!" >&5
+$as_echo "$as_me: WARNING: wxWidgets headers found, bot no wx-config!" >&2;}
fi
-done
+if [ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]
+then
+ WXCPPFLAGS=`echo $WXCPPFLAGS | sed -e 's/\-I/-isystem /g'`
+ WXCXXFLAGS=`echo $WXCXXFLAGS | sed -e 's/\-I/-isystem /g'`
+ WXCFLAGS=`echo $WXCFLAGS | sed -e 's/\-I/-isystem /g'`
+fi
+FOUND_WX='no'
+if [ "X$WXLDFLAGS" != "X" ]
+then
+ FOUND_WX='yes'
+ $as_echo "@%:@define HAVE_WXWIDGETS 1" >>confdefs.h
-for ac_func in tcflush tcgetattr
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
fi
-done
+WXMAJOR=''
+WXMINOR=''
+if [ "X$WXVERSION" != "X" ]
+then
+ WXMAJOR=`echo $WXVERSION | cut -f 1 -d .`
+ WXMINOR=`echo $WXVERSION | cut -f 2 -d .`
+fi
+[ "X$WXMAJOR" != "X" ] || WXMAJOR='0'
+
+if [ "$WXMAJOR" -ge 3 ]
+then
+$as_echo "@%:@define HAVE_WX_DEFS_H 1" >>confdefs.h
+
+$as_echo "@%:@define HAVE_WX_CHARTYPE_H 1" >>confdefs.h
+
+elif [ "$WXMAJOR" -ge 2 ]
+then
+$as_echo "@%:@define HAVE_WX_DEFS_H 1" >>confdefs.h
+
+$as_echo "@%:@define HAVE_WX_WXCHAR_H 1" >>confdefs.h
-for ac_func in umask
-do :
- ac_fn_c_check_func "$LINENO" "umask" "ac_cv_func_umask"
-if test "x$ac_cv_func_umask" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_UMASK 1
-_ACEOF
-
fi
-done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOUND_WX" >&5
+$as_echo "$FOUND_WX" >&6; }
+
+FOUND_MYSQL='no'
+ac_fn_c_check_header_mongrel "$LINENO" "mariadb/mysql.h" "ac_cv_header_mariadb_mysql_h" "$ac_includes_default"
+if test "x$ac_cv_header_mariadb_mysql_h" = xyes; then :
+
+MYSQLLIB='-lmariadbclient'
+FOUND_MYSQL='yes'
+$as_echo "@%:@define HAVE_MARIADB_MYSQL_H 1" >>confdefs.h
+
+
+else
+
+ac_fn_c_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default"
+if test "x$ac_cv_header_mysql_mysql_h" = xyes; then :
+
+MYSQLLIB='-lmysqlclient'
+FOUND_MYSQL='yes'
+$as_echo "@%:@define HAVE_MYSQL_MYSQL_H 1" >>confdefs.h
+
+
+else
+
+ac_fn_c_check_header_mongrel "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default"
+if test "x$ac_cv_header_mysql_h" = xyes; then :
+
+MYSQLLIB='-lmysqlclient'
+FOUND_MYSQL='yes'
+$as_echo "@%:@define HAVE_MYSQL_H 1" >>confdefs.h
+
+
-for ac_func in GetFinalPathNameByHandle
-do :
- ac_fn_c_check_func "$LINENO" "GetFinalPathNameByHandle" "ac_cv_func_GetFinalPathNameByHandle"
-if test "x$ac_cv_func_GetFinalPathNameByHandle" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_GETFINALPATHNAMEBYHANDLE 1
-_ACEOF
-
fi
-done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking wchar_t" >&5
-$as_echo_n "checking wchar_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <wchar.h>
-int
-main ()
-{
+fi
- wchar_t chr;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_WCHAR_T 1" >>confdefs.h
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mkdir path mode" >&5
-$as_echo_n "checking mkdir path mode... " >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_get_pixels_per_inch in -lpng" >&5
+$as_echo_n "checking for png_get_pixels_per_inch in -lpng... " >&6; }
+if ${ac_cv_lib_png_png_get_pixels_per_inch+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpng $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char png_get_pixels_per_inch ();
int
main ()
{
-
-mkdir("test", 0755);
-
+return png_get_pixels_per_inch ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_MKDIR2 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_png_png_get_pixels_per_inch=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_png_png_get_pixels_per_inch=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_get_pixels_per_inch" >&5
+$as_echo "$ac_cv_lib_png_png_get_pixels_per_inch" >&6; }
+if test "x$ac_cv_lib_png_png_get_pixels_per_inch" = xyes; then :
+ $as_echo "@%:@define HAVE_PNG_GET_PIXELS_PER_INCH 1" >>confdefs.h
+
+fi
+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12675,19 +14435,22 @@ if ac_fn_c_try_compile "$LINENO"; then :
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking const" >&5
-$as_echo_n "checking const... " >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking rand srand" >&5
+$as_echo_n "checking rand srand... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
-static char const msg[] = { "Test" };
+#include <stdlib.h>
int
main ()
{
-fputs(msg, stdout);
+ srand(25);
+ printf("%d\n", rand());
+ printf("%d\n", RAND_MAX);
;
return 0;
@@ -12695,7 +14458,10 @@ fputs(msg, stdout);
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_CONST 1" >>confdefs.h
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_RAND 1" >>confdefs.h
+
+$as_echo "@%:@define HAVE_SRAND 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -12703,95 +14469,76 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking inline" >&5
-$as_echo_n "checking inline... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking initstate setstate random" >&5
+$as_echo_n "checking initstate setstate random... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
-
-inline
-int
-summe(int a, int b)
-{
- return (a + b);
-}
-
+#include <stdlib.h>
int
main ()
{
-int i = 5;
-int j = 6;
-int k;
-
-k = summe(i, j);
+char rs[256];
+initstate(25, rs, sizeof(rs));
+setstate(rs);
+printf("%ld\n", random());
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };FOUNDINLINE="yes"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if [ "X$FOUNDINLINE" = "Xyes" -a "X$USEINLINE" = "Xyes" ]
-then
- $as_echo "@%:@define HAVE_INLINE 1" >>confdefs.h
-
-fi
-
-if test -b /dev/urandom
-then
- $as_echo "@%:@define HAVE_DEV_URANDOM 1" >>confdefs.h
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_INITSTATE 1" >>confdefs.h
-fi
-if test -c /dev/urandom
-then
- $as_echo "@%:@define HAVE_DEV_URANDOM 1" >>confdefs.h
+$as_echo "@%:@define HAVE_SETSTATE 1" >>confdefs.h
-fi
-if test -b /dev/random
-then
- $as_echo "@%:@define HAVE_DEV_RANDOM 1" >>confdefs.h
+$as_echo "@%:@define HAVE_RANDOM 1" >>confdefs.h
-fi
-if test -c /dev/random
-then
- $as_echo "@%:@define HAVE_DEV_RANDOM 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fpclassify" >&5
-$as_echo_n "checking fpclassify... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lrand48 nrand48 seed48" >&5
+$as_echo_n "checking lrand48 nrand48 seed48... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <stdlib.h>
int
main ()
{
-int cl;
-cl = fpclassify(-0.5);
+unsigned short sv[3];
+sv[0] = 0;
+sv[1] = 1;
+sv[2] = 2;
+seed48(sv);
+printf("%ld\n", lrand48());
+printf("%ld\n", nrand48(sv));
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_FPCLASSIFY 1" >>confdefs.h
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "@%:@define HAVE_LRAND48 1" >>confdefs.h
+
+$as_echo "@%:@define HAVE_NRAND48 1" >>confdefs.h
+
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -12799,26 +14546,15 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-for ac_func in getpeername
-do :
- ac_fn_c_check_func "$LINENO" "getpeername" "ac_cv_func_getpeername"
-if test "x$ac_cv_func_getpeername" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_GETPEERNAME 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lxnet" >&5
-$as_echo_n "checking for getpeername in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_getpeername+:} false; then :
+COMPILE_RAND_EGD=no
+LIBCHECK_RAND_EGD=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAND_egd in -lcrypto" >&5
+$as_echo_n "checking for RAND_egd in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_RAND_egd+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lcrypto $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12828,286 +14564,160 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getpeername ();
+char RAND_egd ();
int
main ()
{
-return getpeername ();
+return RAND_egd ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_getpeername=yes
+ ac_cv_lib_crypto_RAND_egd=yes
else
- ac_cv_lib_xnet_getpeername=no
+ ac_cv_lib_crypto_RAND_egd=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getpeername" >&5
-$as_echo "$ac_cv_lib_xnet_getpeername" >&6; }
-if test "x$ac_cv_lib_xnet_getpeername" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_egd" >&5
+$as_echo "$ac_cv_lib_crypto_RAND_egd" >&6; }
+if test "x$ac_cv_lib_crypto_RAND_egd" = xyes; then :
+ LIBCHECK_RAND_EGD='yes'
+fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lnsl" >&5
-$as_echo_n "checking for getpeername in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_getpeername+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RAND_egd (compile test code)" >&5
+$as_echo_n "checking RAND_egd (compile test code)... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getpeername ();
+#include <openssl/rand.h>
+
int
main ()
{
-return getpeername ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_getpeername=yes
-else
- ac_cv_lib_nsl_getpeername=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getpeername" >&5
-$as_echo "$ac_cv_lib_nsl_getpeername" >&6; }
-if test "x$ac_cv_lib_nsl_getpeername" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lsocket" >&5
-$as_echo_n "checking for getpeername in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_getpeername+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+int i;
+i = RAND_egd("/dev/egd");
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getpeername ();
-int
-main ()
-{
-return getpeername ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_getpeername=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ COMPILE_RAND_EGD='yes';{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- ac_cv_lib_socket_getpeername=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getpeername" >&5
-$as_echo "$ac_cv_lib_socket_getpeername" >&6; }
-if test "x$ac_cv_lib_socket_getpeername" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETPEERNAME 1" >>confdefs.h
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if [ "X$COMPILE_RAND_EGD" = "Xyes" -a "X$LIBCHECK_RAND_EGD" = "Xyes" ]
+then
+$as_echo "@%:@define HAVE_RAND_EGD 1" >>confdefs.h
fi
-fi
-
+if test -b /dev/urandom
+then
+ $as_echo "@%:@define HAVE_DEV_URANDOM 1" >>confdefs.h
fi
-
+if test -c /dev/urandom
+then
+ $as_echo "@%:@define HAVE_DEV_URANDOM 1" >>confdefs.h
fi
-done
-
-
-for ac_func in getsockname
-do :
- ac_fn_c_check_func "$LINENO" "getsockname" "ac_cv_func_getsockname"
-if test "x$ac_cv_func_getsockname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_GETSOCKNAME 1
-_ACEOF
-
-$as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lxnet" >&5
-$as_echo_n "checking for getsockname in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_getsockname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+if test -b /dev/random
+then
+ $as_echo "@%:@define HAVE_DEV_RANDOM 1" >>confdefs.h
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getsockname ();
-int
-main ()
-{
-return getsockname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_getsockname=yes
-else
- ac_cv_lib_xnet_getsockname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getsockname" >&5
-$as_echo "$ac_cv_lib_xnet_getsockname" >&6; }
-if test "x$ac_cv_lib_xnet_getsockname" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lnsl" >&5
-$as_echo_n "checking for getsockname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_getsockname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+if test -c /dev/random
+then
+ $as_echo "@%:@define HAVE_DEV_RANDOM 1" >>confdefs.h
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getsockname ();
-int
-main ()
-{
-return getsockname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_getsockname=yes
-else
- ac_cv_lib_nsl_getsockname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getsockname" >&5
-$as_echo "$ac_cv_lib_nsl_getsockname" >&6; }
-if test "x$ac_cv_lib_nsl_getsockname" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lsocket" >&5
-$as_echo_n "checking for getsockname in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_getsockname+:} false; then :
- $as_echo_n "(cached) " >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking /proc/.../exe symbolic link" >&5
+$as_echo_n "checking /proc/.../exe symbolic link... " >&6; }
+if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+/* Buffer for result */
+char prog[1024];
#ifdef __cplusplus
-extern "C"
+int main(int argc, char *argv[])
+#else
+int main(argc, argv) int argc; char *argv[];
#endif
-char getsockname ();
-int
-main ()
{
-return getsockname ();
- ;
- return 0;
+ char buf[64];
+ struct stat stbuf;
+ int exv = 1;
+ ssize_t res;
+#if HAVE_STDINT_H
+ sprintf(buf, "/proc/%ju/exe", (uintmax_t)getpid());
+#else
+ sprintf(buf, "/proc/%lu/exe", (unsigned long)getpid());
+#endif
+ res = readlink(buf, prog, sizeof(prog));
+ if ((0 < res) && (sizeof(prog) > res)) {
+ prog[res] = '\0';
+ if (0 == stat(prog, &stbuf)) {
+ exv = 0;
+ }
+ }
+ return exv;
}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_getsockname=yes
-else
- ac_cv_lib_socket_getsockname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getsockname" >&5
-$as_echo "$ac_cv_lib_socket_getsockname" >&6; }
-if test "x$ac_cv_lib_socket_getsockname" = xyes; then :
-
-$as_echo "@%:@define HAVE_GETSOCKNAME 1" >>confdefs.h
-
-
-fi
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_PROC_PID_EXE 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
+if [ "X$CROSSBUILD" = "Xyes" ]
+then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Test for /proc/.../exe not possible!" >&5
+$as_echo "$as_me: WARNING: Test for /proc/.../exe not possible!" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Result is guessed and may be wrong." >&5
+$as_echo "$as_me: WARNING: Result is guessed and may be wrong." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Correct HAVE_PROC_PID_EXE in config.h if necessary." >&5
+$as_echo "$as_me: WARNING: Correct HAVE_PROC_PID_EXE in config.h if necessary." >&2;}
fi
-done
-
-
-
-
+FOUND_NETSNMP='no'
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13127,8 +14737,7 @@ netsnmp_session session, *ss;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
-SNMPPROG="snmpprog"
-SNMP_PROG_CLI='$(SNMP_PROG_CLI)'
+FOUND_NETSNMP='yes'
$as_echo "@%:@define HAVE_LIBNETSNMP 1" >>confdefs.h
@@ -13171,7 +14780,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netsnmp_snmp_enable_filelog" >&5
$as_echo "$ac_cv_lib_netsnmp_snmp_enable_filelog" >&6; }
if test "x$ac_cv_lib_netsnmp_snmp_enable_filelog" = xyes; then :
- SNMPPROG="snmpprog";$as_echo "@%:@define HAVE_SNMP_ENABLE_FILELOG 1" >>confdefs.h
+ $as_echo "@%:@define HAVE_SNMP_ENABLE_FILELOG 1" >>confdefs.h
fi
@@ -13298,542 +14907,841 @@ if test "x$ac_cv_lib_netsnmp_snmp_disable_filelog" = xyes; then :
fi
-IEEE_754_DOUBLE_WISHED='yes'
-IEEE_754_DOUBLE_FOUND='no'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IEEE 754 double" >&5
-$as_echo_n "checking IEEE 754 double... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - test not possible" >&5
-$as_echo "no - test not possible" >&6; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#include <math.h>
-static double td[] = {
- INFINITY,
- 1234.75,
- 4.0,
- 1.0,
- 0.375,
- 0.0,
- -0.625,
- -1.0,
- -8.0,
- -23.875,
- -INFINITY
-};
-
-#if WORDS_BIGENDIAN
-static unsigned char tuc[] = {
- /* INF */ 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 1234.75 */ 0x40, 0x93, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 4.0 */ 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 1.0 */ 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0.375 */ 0x3F, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -0.625 */ 0xBF, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -1.0 */ 0xBF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -8.0 */ 0xC0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -23.875 */ 0xC0, 0x37, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -INF */ 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-#else
-static unsigned char tuc[] = {
- /* INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F,
- /* 1234.75 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x93, 0x40,
- /* 4.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40,
- /* 1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F,
- /* 0.375 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x3F,
- /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -0.625 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xBF,
- /* -1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF,
- /* -8.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xC0,
- /* -23.875 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x37, 0xC0,
- /* -INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF
-};
-#endif
-
-static
-#ifdef __cplusplus
-int
-test_double(double *dp, unsigned char *up)
-#else
-int
-test_double(dp, up)
- double *dp;
- unsigned char *up;
-#endif
-{
- int back = 0;
-#if HAVE_MEMCMP
- if(memcmp(dp, up, 8) == 0) {
- back = 1;
- }
-#else
-#if HAVE_BCMP
- if(bcmp(dp, up, 8) == 0) {
- back = 1;
- }
-#else
- unsigned char *cp1;
- unsigned char *cp2;
- size_t i;
- back = 1;
- cp1 = (unsigned char *)dp; cp2 = up;
- for(i = 0; i < 8; i++) {
- if(*(cp1++) != *(cp2++)) {
- back = 0;
- }
- }
-#endif
-#endif
- if(1 != back) {
- printf("ERROR: %lg not conforming to IEEE 754!\n", *dp);
- }
- return back;
-}
-
-#ifdef __cplusplus
-int main(int argc, char *argv[])
-#else
-int main(argc, argv)
- int argc;
- char *argv[];
-#endif
-{
- unsigned char *ucp;
- double *dp;
- size_t i;
- int ev = 1;
-
- if(8 == sizeof(double)) {
- ev = 0;
- ucp = tuc; dp = td;
- for(i = 0; i < (sizeof(td)/sizeof(double)); i++) {
- if(!test_double(dp, ucp)) {
- ev = 1;
- }
- dp++;
- ucp += 8;
- }
- } else {
- printf("ERROR: Size of double is not 1!\n");
- }
- exit(ev);
-}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking MySQL client library" >&5
+$as_echo_n "checking MySQL client library... " >&6; }
+if [ "X$FOUND_MYSQL" = "Xyes" ]
+then
+ [ ! -f /usr/lib/mysql/libmysqlclient.so ] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
+ [ ! -f /usr/lib/mysql/libmysqlclient.a ] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
+ [ ! -f /usr/lib/mysql/libmysqlclient.so ] || MYSQLLDFLAGS="-L/usr/lib/mysql"
+ [ ! -f /usr/lib/mysql/libmysqlclient.a ] || MYSQLLDFLAGS="-L/usr/lib/mysql"
+ [ ! -f /usr/lib64/mysql/libmysqlclient.so ] || LDFLAGS="$LDFLAGS -L/usr/lib64/mysql"
+ [ ! -f /usr/lib64/mysql/libmysqlclient.a ] || LDFLAGS="$LDFLAGS -L/usr/lib64/mysql"
+ [ ! -f /usr/lib64/mysql/libmysqlclient.so ] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
+ [ ! -f /usr/lib64/mysql/libmysqlclient.a ] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+SOLIBZ=''
+SOLIBBZ=''
+SOLIBMATH=''
+SOLIBCRYPTO=''
+SOLIBNET=''
+SOLIBIMG=''
+SOLIBSDBI=''
+SOLIBWX=''
+SOLIBDK3PORT=''
+SOLIBDK3C=''
+SOLIBDK3OF=''
+SOLIBDK3CSRND=''
+SOLIBDK3BIF=''
+SOLIBDK3DBI=''
+SOLIBDK3FIG=''
+SOLIBDK3BMEPS=''
+SOLIBDK3NET=''
+SOLIBDK4BASE=''
+SOLIBDK4MA=''
+SOLIBDK4MAIO8H=''
+SOLIBDK4MAIOWH=''
+SOLIBDK4MAIODH=''
+SOLIBDK4MAIO8D=''
+SOLIBDK4MAIOWD=''
+SOLIBDK4MAIODD=''
+SOLIBDK4C=''
+SOLIBDK4MDRND=''
+SOLIBDK4PPPT=''
+SOLIBDK4APP=''
+SOLIBDK4LATA=''
+SOLIBDK4LAT=''
+SOLIBDK4SOCK=''
+SOLIBDK4SOCKA=''
+SOLIBDK4DBI=''
+SOLIBDK4DBIA=''
+LIBDK4BASELIBF=''
+LIBDK4BASELIBS=''
+LIBDK4MALIBF=''
+LIBDK4MALIBS=''
+LIBDK4MAIO8DLIBF=''
+LIBDK4MAIO8DLIBS=''
+LIBDK4MAIOWDLIBF=''
+LIBDK4MAIOWDLIBS=''
+LIBDK4MAIODDLIBF=''
+LIBDK4MAIODDLIBS=''
+LIBDK4MAIOXDLIBF=''
+LIBDK4MAIOXDLIBS=''
+LIBDK4MAIO8HLIBF=''
+LIBDK4MAIO8HLIBS=''
+LIBDK4MAIOWHLIBF=''
+LIBDK4MAIOWHLIBS=''
+LIBDK4MAIODHLIBF=''
+LIBDK4MAIODHLIBS=''
+LIBDK4DBILIBF=''
+LIBDK4DBILIBS=''
+LIBDK4CLIBF=''
+LIBDK4CLIBS=''
+LIBDK4LATALIBF=''
+LIBDK4LATALIBS=''
+LIBDK4LATLIBF=''
+LIBDK4LATLIBS=''
+LIBDK4BIFLIBF=''
+LIBDK4BIFLIBS=''
+LIBDK4GRALIBF=''
+LIBDK4GRALIBS=''
+LIBDK4SOCKLIBF=''
+LIBDK4SOCKLIBS=''
+LIBDK4MDRNDLIBF=''
+LIBDK4MDRNDLIBS=''
+LIBDK4PPPTLIBF=''
+LIBDK4PPPTLIBS=''
+LIBDK4APPLIBF=''
+LIBDK4APPLIBS=''
+LIBDK4PPPTALIBF=''
+LIBDK4PPPTALIBS=''
+LIBDK4SOCKALIBF=''
+LIBDK4SOCKALIBS=''
+LIBDK4DBIALIBF=''
+LIBDK4DBIALIBS=''
+LIBDK4BIFALIBF=''
+LIBDK4BIFALIBS=''
+LIBDK4GRAALIBF=''
+LIBDK4GRAALIBS=''
+LIBDK4WXLIBF=''
+LIBDK4WXLIBS=''
+LIBDK3TRACELIBF=''
+LIBDK3TRACELIBS=''
+LIBDK3CLIBF=''
+LIBDK3CLIBS=''
+LIBDK3OFLIBF=''
+LIBDK3OFLIBS=''
+LIBDK3CSRNDLIBF=''
+LIBDK3CSRNDLIBS=''
+LIBDK3BIFLIBF=''
+LIBDK3BIFLIBS=''
+LIBDK3DBILIBF=''
+LIBDK3DBILIBS=''
+LIBDK3BMEPSLIBF=''
+LIBDK3BMEPSLIBS=''
+LIBDK3FIGLIBF=''
+LIBDK3FIGLIBS=''
+LIBDK3WXLIBF=''
+LIBDK3WXLIBS=''
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Link shared libraries against shared libraries" >&5
+$as_echo_n "checking Link shared libraries against shared libraries... " >&6; }
+if [ "X$ENA_SHARED" = "Xyes" -a "X$ENA_SOSO" = "Xyes" ]
+then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };IEEE_754_DOUBLE_FOUND="yes"
+$as_echo "yes" >&6; }
+ SOLIBZ="$ZLIB"
+ SOLIBBZ="$BZLIB"
+ SOLIBMATH='-lm'
+ SOLIBCRYPTO="$CRYPTO"
+ SOLIBNET="$NETLIB"
+ SOLIBIMG="$IMGLIBS"
+ SOLIBSDBI="$DKSDBILIBS"
+ SOLIBWX="$WXCONFIGLIBS"
+ SOLIBDK3PORT=''
+ SOLIBDK3C='-ldk3c'
+ SOLIBDK3OF='-ldk3of'
+ SOLIBDK3CSRND='-ldk3csrnd'
+ SOLIBDK3BIF='-ldk3bif'
+ SOLIBDK3DBI='-ldk3dbi'
+ SOLIBDK3FIG='-ldk3fig'
+ SOLIBDK3BMEPS='-ldk3bmeps'
+ SOLIBDK3NET='-ldk3net'
+ SOLIBDK4BASE='-ldk4base'
+ SOLIBDK4MA='-ldk4ma'
+ SOLIBDK4MAIO8H='-ldk4maio8h'
+ SOLIBDK4MAIOWH='-ldk4maiowh'
+ SOLIBDK4MAIODH='-ldk4maiodh'
+ SOLIBDK4MAIO8D='-ldk4maio8d'
+ SOLIBDK4MAIOWD='-ldk4maiowd'
+ SOLIBDK4MAIODD='-ldk4maiodd'
+ SOLIBDK4C='-ldk4c'
+ SOLIBDK4MDRND='-ldk4mdrnd'
+ SOLIBDK4PPPT='-ldk4pppt'
+ SOLIBDK4APP='-ldk4app'
+ SOLIBDK4LATA='-ldk4lata'
+ SOLIBDK4LAT='-ldk4lat'
+ SOLIBDK4SOCK='-ldk4sock'
+ SOLIBDK4SOCKA='-ldk4socka'
+ SOLIBDK4DBI='-ldk4dbi'
+ SOLIBDK4DBIA='-ldk4dbia'
+ LIBDK4BASELIBF=''
+ LIBDK4BASELIBS=''
+ LIBDK4MALIBF='libdk4base.so'
+ LIBDK4MALIBS='-ldk4base'
+ LIBDK4MAIO8DLIBF='libdk4base.so libdk4ma.so'
+ LIBDK4MAIO8DLIBS='-ldk4ma -ldk4base'
+ LIBDK4MAIOWDLIBF='libdk4base.so libdk4ma.so'
+ LIBDK4MAIOWDLIBS='-ldk4ma -ldk4base'
+ LIBDK4MAIODDLIBF='libdk4maio8d.so'
+ LIBDK4MAIODDLIBS='-ldk4maio8d'
+ LIBDK4MAIOXDLIBF='libdk4maio8d.so libdk4maiowd.so'
+ LIBDK4MAIOXDLIBS='-ldk4maiowd -ldk4maio8d'
+ LIBDK4MAIO8HLIBF='libdk4base.so'
+ LIBDK4MAIO8HLIBS='-ldk4base'
+ LIBDK4MAIOWHLIBF='libdk4base.so'
+ LIBDK4MAIOWHLIBS='-ldk4base'
+ LIBDK4MAIODHLIBF='libdk4base.so libdk4maio8h.so'
+ LIBDK4MAIODHLIBS='-ldk4maio8h -ldk4base'
+ LIBDK4CLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so'
+ LIBDK4CLIBS='-ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(BZLIB) $(ZLIB)'
+ LIBDK4DBILIBF='libdk4base.so libdk4ma.so libdk4c.so'
+ LIBDK4DBILIBS='-ldk4c -ldk4ma -ldk4base $(DBLIB) $(DBLIBSOCK)'
+ LIBDK4LATLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4c.so'
+ LIBDK4LATLIBS='-ldk4c -ldk4maio8h -ldk4ma -ldk4base'
+ LIBDK4BIFLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4c.so'
+ LIBDK4BIFLIBS='-ldk4c -ldk4maio8d -ldk4ma -ldk4base $(IMGLIBS)'
+ LIBDK4GRALIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so'
+ LIBDK4GRALIBS='-ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base -lm'
+ LIBDK4SOCKLIBF='libdk4base.so libdk4maio8d.so libdk4c.so'
+ LIBDK4SOCKLIBS='-ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ LIBDK4MDRNDLIBF='libdk4base.so libdk4c.so'
+ LIBDK4MDRNDLIBS='$(CRYPTO) -ldk4c -ldk4base $(CRYPTO)'
+ LIBDK4PPPTLIBF='libdk4base.so libdk4c.so libdk4lat.so libdk4gra.so'
+ LIBDK4PPPTLIBS='-ldk4gra -ldk4lat -ldk4c -ldk4base'
+ LIBDK4APPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so'
+ LIBDK4APPLIBS='-ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base'
+ LIBDK4LATALIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
+ LIBDK4LATALIBS='-ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base'
+ LIBDK4SOCKALIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4maiodh.so libdk4sock.so libdk4app.so'
+ LIBDK4SOCKALIBS='-ldk4app -ldk4sock -ldk4maiodh -ldk4maiodd -ldk4maio8d -ldk4base'
+ LIBDK4DBIALIBF='libdk4base.so libdk4dbi.so libdk4app.so'
+ LIBDK4DBIALIBS='-ldk4app -ldk4dbi -ldk4base'
+ LIBDK4BIFALIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4bif.so libdk4app.so'
+ LIBDK4BIFALIBS='-ldk4app -ldk4bif -ldk4c -ldk4maiodd -ldk4ma -ldk4base'
+ LIBDK4GRAALIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4bifa.so'
+ LIBDK4GRAALIBS='-ldk4bifa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maiodd -ldk4maiodh -ldk4base'
+ LIBDK4PPPTALIBF='libdk4pppt.so libdk4app.so'
+ LIBDK4PPPTALIBS='-ldk4app -ldk4pppt'
+ LIBDK4WXLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4c.so'
+ LIBDK4WXLIBS='-ldk4c -ldk4base -ldk4maiowd -ldk4maio8d $(WXLDFLAGS)'
+ LIBDK3TRACELIBF=''
+ LIBDK3TRACELIBS=''
+ LIBDK3CLIBF=''
+ LIBDK3CLIBS='$(BZLIB) $(ZLIB) -lm'
+ LIBDK3OFLIBF='libdk3c.so'
+ LIBDK3OFLIBS='-ldk3c $(BZLIB) $(ZLIB)'
+ LIBDK3CSRNDLIBF='libdk3c.so'
+ LIBDK3CSRNDLIBS='-ldk3c $(CRYPTO)'
+ LIBDK3BIFLIBF='libdk3c.so'
+ LIBDK3BIFLIBS='-ldk3c $(IMGLIBS)'
+ LIBDK3DBILIBF='libdk3c.so'
+ LIBDK3DBILIBS='-ldk3c $(DBLIB) $(DBLIBSOCK)'
+ LIBDK3BMEPSLIBF='libdk3c.so libdk3of.so libdk3bif.so'
+ LIBDK3BMEPSLIBS='-ldk3bif -ldk3of -ldk3c -lm'
+ LIBDK3FIGLIBF='libdk3c.so'
+ LIBDK3FIGLIBS='-ldk3c -lm'
+ LIBDK3WXLIBF='libdk3c.so'
+ LIBDK3WXLIBS='-ldk3c $(WXLDFLAGS)'
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; };IEEE_754_DOUBLE_FOUND="no"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+$as_echo "no" >&6; }
fi
-if [ "X$IEEE_754_DOUBLE_FOUND$IEEE_754_DOUBLE_WISHED" = "Xyesyes" ]
-then
- $as_echo "@%:@define HAVE_IEEE_754_DOUBLE 1" >>confdefs.h
-else
- IEEE_754_DOUBLE_FOUND='no'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isfinite" >&5
-$as_echo_n "checking isfinite... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-int
-main ()
-{
- double x;
- int a = 0;
- x = 5.0;
- if (isfinite(x)) {
- a = 1;
- }
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ISFINITE 1" >>confdefs.h
+MKSOLIB='echo "ERROR: Can not build shared libraries!" #'
+MKSOLIBCPP='echo "ERROR: Can not build shared libraries!" #'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking toolchain specific options" >&5
+$as_echo_n "checking toolchain specific options... " >&6; }
+case X$TOOLCHAIN in
+ Xgcc|Xclang)
+ CFLAGS="$CFLAGS -fPIC -D_REENTRANT"
+ CFL_CLI_C8="$CFL_CLI_C8 -fPIC -D_REENTRANT"
+ CFL_CLI_DK="$CFL_CLI_DK -fPIC -D_REENTRANT"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -fPIC -D_REENTRANT"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -fPIC -D_REENTRANT"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -fPIC -D_REENTRANT"
+ CXXFL_GUI="$CXXFL_GUI -fPIC -D_REENTRANT"
+ if [ "X$ENA_SHARED" = "Xyes" ]
+ then
+ CXXFL_GUI="$CXXFL_GUI"
+ fi
+ MKSOLIB='$(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
+ MKSOLIBCPP='$(CXX) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
+ if [ "X$ENA_SHARED" = "Xyes" -a "X$ENA_SOSO" = "Xyes" ]
+ then
+ MKSORPATHLINK='-Wl,-rpath-link,./'
+ MKSOCHECKSYMBOLS='-Wl,-z,defs'
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: gcc" >&5
+$as_echo "gcc" >&6; }
+ ;;
+ Xworkshop)
+ if [ "X$ENA_SHARED" = "Xyes" ]
+ then
+ CFLAGS="-Bdynamic -dy $CFLAGS"
+ CFL_CLI_C8="-Bdynamic -dy $CFL_CLI_C8"
+ CFL_CLI_DK="-Bdynamic -dy $CFL_CLI_DK"
+ CXXFL_CLI_C8="-Bdynamic -dy $CXXFL_CLI_C8"
+ CXXFL_CLI_DK="-Bdynamic -dy $CXXFL_CLI_DK"
+ CXXFL_CLI_WX="-Bdynamic -dy $CXXFL_CLI_WX"
+ CXXFL_GUI="-Bdynamic -dy $CXXFL_GUI"
+ LDFLAGS="-Bdynamic -dy $LDFLAGS"
+ LDFLC_CLI_C8="-Bdynamic -dy $LDFLC_CLI_C8"
+ LDFLC_CLI_DK="-Bdynamic -dy $LDFLC_CLI_DK"
+ LDFLCXX_CLI_C8="-Bdynamic -dy $LDFLCXX_CLI_C8"
+ LDFLCXX_CLI_DK="-Bdynamic -dy $LDFLCXX_CLI_DK"
+ LDFLCXX_CLI_WX="-Bdynamic -dy $LDFLCXX_CLI_WX"
+ LDFLCXX_GUI="-Bdynamic -dy $LDFLCXX_GUI"
+ fi
+ CFLAGS="$CFLAGS -xcode=pic32 -D_REENTRANT"
+ CFL_CLI_C8="$CFL_CLI_C8 -xcode=pic32 -D_REENTRANT"
+ CFL_CLI_DK="$CFL_CLI_DK -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -xcode=pic32 -D_REENTRANT"
+ CXXFL_GUI="$CXXFL_GUI -xcode=pic32 -D_REENTRANT"
+ MKSOLIB='$(CC) -L. $(MKSORPATH) $(MKSORPATHLINK) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
+ MKSOLIBCPP='$(CXX) -L. $(MKSORPATH) $(MKSORPATHLINK) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: workshop" >&5
+$as_echo "workshop" >&6; }
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: other" >&5
+$as_echo "other" >&6; }
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker requires -R option" >&5
+$as_echo_n "checking linker requires -R option... " >&6; }
+if [ "X$LD_LIBRARY_PATH" != "X" -a "X$TOOLCHAIN" = "Xworkshop" ]
+then
+ RPATH="-R${LD_LIBRARY_PATH}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isnormal" >&5
-$as_echo_n "checking isnormal... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-
-int
-main ()
-{
+if [ "X$ENA_RPATH" = "Xyes" -a "X$ENA_PACKAGE" = "Xyes" -a \( "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" \) ]
+then
+ RPATH='-Wl,-rpath,$(libdir)'
+fi
- double x;
- int a = 0;
- x = 5.0;
- if (isnormal(x)) {
- a = 1;
- }
+DBLIBSOCK="$DBLIB"
+case X$TARGETHOST in
+ Xsparc-sun-solaris*)
+ if [ "X$ENA_SUNOS_CORR" = "Xyes" ]
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking corrections for Solaris" >&5
+$as_echo_n "checking corrections for Solaris... " >&6; }
+ [ "X$DBLIBSOCK" = "X" ] || DBLIBSOCK="$DBLIB -lrt "'$(SOCKLIB)'
+ [ "X$DBLIB" = "X" ] || DBLIB="$DBLIB -lrt"
+ [ "X$CRYPTO" = "X" ] || CRYPTO="$CRYPTO -lssl "'$(SOCKLIB)'
+ [ "X$MYSQLLIB" = "X" ] || MYSQLLIB="$MYSQLLIB -lrt "'$(SOCKLIB)'
+ NETSNMP_LIBS=`echo $NETSNMP_LIBS | sed -f modsnmp.sed`
+ SOCKLIB='-lsocket'
+ NSLLIB='-lnsl'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ NETSNMP_LIBS=''
+ FOUND_NETSNMP='no'
+ fi
+ ;;
+esac
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_ISNORMAL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking availability of network functions" >&5
+$as_echo_n "checking availability of network functions... " >&6; }
+if [ "X$FOUND_SOCKET" = "Xyes" ]
+then
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+RES_RES_NET_EN='$(RES_RES_NET_EN)'
+RES_RES_NET_DE='$(RES_RES_NET_DE)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking use of twos complement for negative integers" >&5
-$as_echo_n "checking use of twos complement for negative integers... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - test not possible" >&5
-$as_echo "no - test not possible" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking both network functions and POSIX" >&5
+$as_echo_n "checking both network functions and POSIX... " >&6; }
+if [ "X$FOUND_SOCKET" = "Xyes" -a "X$TARGETCLASS" = "Xposix" ]
+then
+PRG_CLI_NET_POSIX='$(PRG_CLI_NET_POSIX)'
+MAN_CLI_NET_POSIX='$(MAN_CLI_NET_POSIX)'
+RES_CLI_NET_POSIX='$(RES_CLI_NET_POSIX)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_PROCESS_H
-#include <process.h>
-#endif
-
-int i1 = -1;
-
-#if SIZEOF_INT > 2
-#if SIZEOF_INT > 4
-#if SIZEOF_INT > 8
-#error "No test available yet for integers larger than 8 bytes!"
-#else
-int i2 = 0xFFFFFFFFFFFFFFFF;
-#endif
-#else
-int i2 = 0xFFFFFFFF;
-#endif
-#else
-int i2 = 0xFFFF;
-#endif
-
-int main(int argc, char *argv[])
-{
- int exval = 1;
- if (i1 == i2) exval = 0;
- exit(exval); return exval;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "@%:@define HAVE_TWOS_COMPLEMENT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking NetSNMP support" >&5
+$as_echo_n "checking NetSNMP support... " >&6; }
+if [ "X$NETSNMP_LIBS" != "X" ]
+then
+PRG_CLI_SNMP='$(PRG_CLI_SNMP)'
+MAN_CLI_SNMP='$(MAN_CLI_SNMP)'
+RES_CLI_SNMP='$(RES_CLI_SNMP)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-CLI_SNMPPROG=''
-if [ "X$SNMPPROG" != "X" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking MySQL or MariaDB" >&5
+$as_echo_n "checking MySQL or MariaDB... " >&6; }
+if [ "X$MYSQLLIB" != "X" ]
then
- CLI_SNMPPROG='pjsnmp$(EXEEXT)'
+PRG_CLI_MYSQL='$(PRG_CLI_MYSQL)'
+MAN_CLI_MYSQL='$(MAN_CLI_MYSQL)'
+RES_CLI_MYSQL='$(RES_CLI_MYSQL)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-CLI_MYSQLPROG=''
-if [ "X$MYSQLPROG" != "X" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL" >&5
+$as_echo_n "checking OpenSSL... " >&6; }
+if [ "X$CRYPTO" != "X" ]
then
- CLI_MYSQLPROG='itadmin$(EXEEXT)'
- MYSQL_PROG_CLI='$(MYSQL_PROG_CLI)'
- [ ! -f /usr/lib/mysql/libmysqlclient.so ] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
- [ ! -f /usr/lib/mysql/libmysqlclient.a ] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
- [ ! -f /usr/lib/mysql/libmysqlclient.so ] || MYSQLLDFLAGS="-L/usr/lib/mysql"
- [ ! -f /usr/lib/mysql/libmysqlclient.a ] || MYSQLLDFLAGS="-L/usr/lib/mysql"
- [ ! -f /usr/lib64/mysql/libmysqlclient.so ] || LDFLAGS="$LDFLAGS -L/usr/lib64/mysql"
- [ ! -f /usr/lib64/mysql/libmysqlclient.a ] || LDFLAGS="$LDFLAGS -L/usr/lib64/mysql"
- [ ! -f /usr/lib64/mysql/libmysqlclient.so ] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
- [ ! -f /usr/lib64/mysql/libmysqlclient.a ] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
+PRG_CLI_SSL='$(PRG_CLI_SSL)'
+MAN_CLI_SSL='$(MAN_CLI_SSL)'
+RES_CLI_SSL='$(RES_CLI_SSL)'
+PRG_GUI_SSL='$(PRG_GUI_SSL)'
+MAN_GUI_SSL='$(MAN_GUI_SSL)'
+RES_GUI_SSL='$(RES_GUI_SSL)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-if [ "X$SUITE" = "Xgui" ]
+MOD_DK4DMT=''
+MOD_DKK3WREG=''
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target class POSIX" >&5
+$as_echo_n "checking target class POSIX... " >&6; }
+if [ "X$TARGETCLASS" = "Xposix" ]
then
- LIBDK3WXOBJ='$(LIBDK3WXOBJ)'
- LIBDK4WXOBJ='$(LIBDK4WXOBJ)'
- LIBDK4WXTOBUILD='libdk4wx.$(LIBEXT)'
+PRG_CLI_POSIX='$(PRG_CLI_POSIX)'
+MAN_CLI_POSIX='$(MAN_CLI_POSIX)'
+RES_CLI_POSIX='$(RES_CLI_POSIX)'
+MOD_DK4DMT='dk4dmt.$(OBJEXT)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-if [ "X$ENASHARED" = "Xyes" -a "X$USESOLINKING" = "Xyes" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target class Windows" >&5
+$as_echo_n "checking target class Windows... " >&6; }
+if [ "X$TARGETCLASS" = "Xwindows" ]
then
- SOLIBZ="$ZLIB"
- SOLIBBZ="$BZLIB"
- SOLIBMATH="-lm"
- SOLIBCRYPTO="$CRYPTO"
- SOLIBNET="$NETLIB"
- SOLIBIMG="$IMGLIBS"
- SOLIBSDBI="$DKSDBILIBS"
- SOLIBWX=`wx-config --libs`
- SOLIBDK3PORT=""
- SOLIBDK3C="-ldk3c"
- SOLIBDK3OF="-ldk3of"
- SOLIBDK3CSRND="-ldk3csrnd"
- SOLIBDK3BIF="-ldk3bif"
- SOLIBDK3DBI="-ldk3dbi"
- SOLIBDK3FIG="-ldk3fig"
- SOLIBDK3BMEPS="-ldk3bmeps"
- SOLIBDK3NET="-ldk3net"
- SOLIBDK4BASE="-ldk4base"
- SOLIBDK4MA="-ldk4ma"
- SOLIBDK4MAIO8H="-ldk4maio8h"
- SOLIBDK4MAIOWH="-ldk4maiowh"
- SOLIBDK4MAIODH="-ldk4maiodh"
- SOLIBDK4MAIO8D="-ldk4maio8d"
- SOLIBDK4MAIOWD="-ldk4maiowd"
- SOLIBDK4MAIODD="-ldk4maiodd"
- SOLIBDK4C="-ldk4c"
- SOLIBDK4MDRND="-ldk4mdrnd"
- SOLIBDK4PPPT="-ldk4pppt"
- SOLIBDK4APP="-ldk4app"
- SOLIBDK4LAT="-ldk4lat"
- SOLIBDK4SOCK="-ldk4sock"
- SOLIBDK4SOCKA="-ldk4socka"
- SOLIBDK4DBI="-ldk4dbi"
- SOLIBDK4DBIA="-ldk4dbia"
- LIBDK4MALIBF="libdk4base.so"
- LIBDK4MALIBS='-ldk4base'
- LIBDK4MAIO8DLIBF="libdk4base.so libdk4ma.so"
- LIBDK4MAIO8DLIBS='-ldk4ma -ldk4base'
- LIBDK4MAIOWDLIBF="libdk4base.so libdk4ma.so"
- LIBDK4MAIOWDLIBS='-ldk4ma -ldk4base'
- LIBDK4MAIODDLIBF="libdk4base.so libdk4maio8d.so"
- LIBDK4MAIODDLIBS='-ldk4maio8d -ldk4base'
- LIBDK4MAIOXDLIBF="libdk4base.so libdk4maio8d.so libdk4maiowd.so"
- LIBDK4MAIOXDLIBS='-ldk4maiowd -ldk4maio8d -ldk4base'
- LIBDK4MAIO8HLIBF="libdk4base.so"
- LIBDK4MAIO8HLIBS='-ldk4base'
- LIBDK4MAIOWHLIBF="libdk4base.so"
- LIBDK4MAIOWHLIBS='-ldk4base'
- LIBDK4MAIODHLIBF="libdk4base.so libdk4maio8h.so"
- LIBDK4MAIODHLIBS='-ldk4maio8h -ldk4base'
- LIBDK4CLIBF="libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so"
- LIBDK4CLIBS='-ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(BZLIB) $(ZLIB) -lm'
- LIBDK4DBILIBF="libdk4base.so libdk4ma.so libdk4c.so"
- LIBDK4DBILIBS='-ldk4c -ldk4ma -ldk4base $(DBLIB)'
- LIBDK4SOCKLIBF="libdk4base.so libdk4maio8d.so libdk4c.so"
- LIBDK4SOCKLIBS='-ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- LIBDK4MDRNDLIBF="libdk4base.so libdk4c.so"
- LIBDK4MDRNDLIBS='-ldk4c -ldk4base $(CRYPTO)'
- LIBDK4PPPTLIBF="libdk4base.so libdk4maiodd.so libdk4c.so"
- LIBDK4PPPTLIBS='-ldk4c -ldk4maiodd -ldk4base'
- LIBDK4APPLIBF="libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so"
- LIBDK4APPLIBS='-ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base'
- LIBDK4LATLIBF="libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4app.so"
- LIBDK4LATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maio8h -ldk4ma -ldk4base'
- LIBDK4PPPTALIBF="libdk4base.so libdk4c.so libdk4pppt.so libdk4app.so"
- LIBDK4PPPTALIBS='-ldk4app -ldk4pppt -ldk4c -ldk4base'
- LIBDK4SOCKALIBF="libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodh.so libdk4maiodd.so libdk4sock.so libdk4app.so"
- LIBDK4SOCKALIBS='-ldk4app -ldk4sock -ldk4maiodd -ldk4maiodh -ldk4maio8d -ldk4maio8h -ldk4base $(SOCKLIB) $(NSLLIB)'
- LIBDK4DBIALIBF="libdk4base.so libdk4dbi.so libdk4app.so"
- LIBDK4DBIALIBS='-ldk4dbi -ldk4app -ldk4base $(DBLIB)'
- LIBDK4WXLIBF="libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4app.so"
- LIBDK4WXLIBS='-ldk4app -ldk4c -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS)'
- LIBDK3TRACELIBF=""
- LIBDK3TRACELIBS=''
- LIBDK3CLIBF=""
- LIBDK3CLIBS='$(BZLIB) $(ZLIB) -lm'
- LIBDK3OFLIBF="libdk3c.so"
- LIBDK3OFLIBS='-ldk3c $(BZLIB) $(ZLIB)'
- LIBDK3CSRNDLIBF="libdk3c.so"
- LIBDK3CSRNDLIBS='-ldk3c $(CRYPTO)'
- LIBDK3BIFLIBF="libdk3c.so"
- LIBDK3BIFLIBS='-ldk3c $(IMGLIBS)'
- LIBDK3DBILIBF="libdk3c.so"
- LIBDK3DBILIBS='-ldk3c $(DBLIB)'
- LIBDK3BMEPSLIBF="libdk3c.so libdk3of.so libdk3bif.so"
- LIBDK3BMEPSLIBS='-ldk3bif -ldk3of -ldk3c -lm'
- LIBDK3FIGLIBF="libdk3c.so"
- LIBDK3FIGLIBS='-ldk3c -lm'
- LIBDK3WXLIBF="libdk3c.so"
- LIBDK3WXLIBS='-ldk3c $(WXLDFLAGS)'
+PRG_CLI_WINDOWS='$(PRG_CLI_WINDOWS)'
+MAN_CLI_WINDOWS='$(MAN_CLI_WINDOWS)'
+RES_CLI_WINDOWS='$(RES_CLI_WINDOWS)'
+PRG_GUI_WINDOWS='$(PRG_GUI_WINDOWS)'
+MAN_GUI_WINDOWS='$(MAN_GUI_WINDOWS)'
+RES_GUI_WINDOWS='$(RES_GUI_WINDOWS)'
+MOD_DK3WREG='dk3wreg.$(OBJEXT)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-if [ "X$ENASHARED" = "Xyes" -a "X$USESOLINKING" = "Xyes" -a "X$CROSSCOMPLING" = "Xyes" ]
+
+if [ "X$SUITE" = "Xauto" -a "X$FOUND_WX" = "Xyes" ]
+then
+ SUITE='gui'
+elif [ "X$SUITE" = "Xauto" ]
then
- LIBDK4MAIODDLIBF="$LIBDK4MAIODDLIBF libdk4maiowd.so"
- LIBDK4MAIODDLIBS='-ldk4maiowd $LIBDK4MAIODDLIBS'
- LIBDK4MAIODHLIBF="$LIBDK4MAIODHLIBF libdk4maiowh.so"
- LIBDK4MAIODHLIBS='-ldk4maiowh $LIBDK4MAIODHLIBS'
+ SUITE='cli'
fi
-case "X$ENAPACKAGING/X$USESOLINKING" in
- "Xyes/Xyes")
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking components to install" >&5
+$as_echo_n "checking components to install... " >&6; }
+INSTALL_INDEP='i-ind-cli'
+INSTALL_LIBS=''
+LIBDK3WXOBJ=''
+LIBDK4WXOBJ=''
+if [ "X$ENA_MAN" = "Xyes" ]
+then
+ INSTALL_INDEP='i-ind-cli i-man-cli'
+fi
+case X$SUITE in
+ Xrescue)
+ BUILD_ARCH='$(PRG_RES)'
+ INSTALL_INDEP='i-ind-res'
+ INSTALL_PROGRAMS='i-prg-res'
+ if [ "X$ENA_MAN" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-res"
+ fi
+ if [ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]
+ then
+ BUILD_ARCH='$(PRG_RES) $(LIB_SHARED_RES)'
+ INSTALL_LIBS='i-lib-dyn-res'
+ fi
+ ;;
+ Xcli)
+ BUILD_ARCH='$(PRG_CLI)'
+ INSTALL_INDEP='i-ind-cli'
+ if [ "X$ENA_MAN" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-cli"
+ fi
+ if [ "X$FOUND_SYSTEMD" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-sysd"
+ else
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-init"
+ fi
+ INSTALL_PROGRAMS='i-prg-cli'
+ if [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_STATIC_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli i-lib-stt-cli i-hdr-cli'
+ elif [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_SHARED" ]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli i-hdr-cli'
+ elif [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" ]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_STATIC_CLI)'
+ INSTALL_LIBS='i-lib-stt-cli i-hdr-cli'
+ elif [ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" ]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli'
+ else
+ BUILD_ARCH='$(PRG_CLI)'
+ fi
+ if [ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" ]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_DAEMON_NET_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-dae"
+ fi
+ if [ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" -a "X$FOUND_NETSNMP" = "Xyes" ]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_FILTER_SNMP_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-fil"
+ fi
+ ;;
+ *)
+ BUILD_ARCH='$(PRG_GUI)'
+ INSTALL_INDEP='i-ind-gui'
+ INSTALL_PROGRAMS='i-prg-gui'
+ if [ "X$ENA_MAN" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-gui"
+ fi
+ if [ "X$FOUND_SYSTEMD" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-sysd"
+ else
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-init"
+ fi
+ if [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_STATIC_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui i-lib-stt-gui i-hdr-gui'
+ elif [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_SHARED" ]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui i-hdr-gui'
+ elif [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" ]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_STATIC_GUI)'
+ INSTALL_LIBS='i-lib-stt-gui i-hdr-gui'
+ elif [ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" ]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui'
+ else
+ BUILD_ARCH='$(PRG_GUI)'
+ fi
+ LIBDK3WXOBJ='$(LIBDK3WXOBJ)'
+ LIBDK4WXOBJ='$(LIBDK4WXOBJ)'
+ if [ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" ]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_DAEMON_NET_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-dae"
+ fi
+ if [ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" -a "X$FOUND_NETSNMP" = "Xyes" ]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_FILTER_SNMP_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-fil"
+ fi
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+
+case X$TARGETCLASS/X$ENA_PACKAGE/X$TOOLCHAIN in
+ Xwindows/Xno/Xgcc)
+ CRYPTO="$CRYPTO $SOCKLIB"
+ ;;
+ Xwindows/Xno/Xclang)
+ CRYPTO="$CRYPTO $SOCKLIB"
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default elements for programs and libraries" >&5
+$as_echo_n "checking default elements for programs and libraries... " >&6; }
+DKCTLIBF='libdk3.a'
+DKCTLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+ADDCTRLDLIBF=''
+ADDCTRLDLIBS='$(CLILIB)'
+DKDBTLIBF='libdk3.a'
+DKDBTLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+ITADMINLIBF='libdk3.a'
+ITADMINLIBS='libdk3.a $(MYSQLLIB) $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) $(RTLIB)'
+FIG2LATLIBF='libdk3.a'
+FIG2LATLIBS='libdk3.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+HTMLBOOKLIBF='libdk3.a'
+HTMLBOOKLIBS='libdk3.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+DK3INFOLIBF='libdk3.a'
+DK3INFOLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWTLIBF='libdk3.a'
+DKWTLIBS='libdk3.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+WPRCLEANLIBF='libdk3.a'
+WPRCLEANLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWXWIZLIBF='libdk3.a'
+DKWXWIZLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWXPATHLIBF='libdk3.a'
+DKWXPATHLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WINPRINTLIBF='libdk3.a'
+WINPRINTLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+CHSCRSZLIBF='libdk3.a'
+CHSCRSZLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKCTLIBF='libdk3.a'
+WXDKCTLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXIMGSZLIBF='libdk4.a'
+WXIMGSZLIBS='libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKCLOCKLIBF='libdk3.a'
+WXDKCLOCKLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKHTBLIBF='libdk3.a'
+WXDKHTBLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
+PRINTQDILIBF='libdk3.a'
+PRINTQDILIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+PRINTQDALIBF='libdk3.a'
+PRINTQDALIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+
+WXDKDRAWLIBF='libdk4.a libdk4maioxd.a libdk4wx.a'
+WXDKDRAWLIBS='libdk4wx.a libdk4maioxd.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+WXBMPPLIBF='libdk4.a libdk4maioxd.a libdk4wx.a'
+WXBMPPLIBS='libdk4wx.a libdk4maioxd.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+BMPPLIBF='libdk4.a'
+BMPPLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+PLPDFTEXLIBF='libdk4.a'
+PLPDFTEXLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+DKCATLIBF='libdk4.a'
+DKCATLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBLKSLIBF='libdk4.a'
+DKBLKSLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKSQLSPLITLIBF='libdk4.a'
+DKSQLSPLITLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKERADISKLIBF='libdk4.a'
+DKERADISKLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKLSLIBF='libdk4.a'
+DKLSLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKSORTLIBF='libdk4.a'
+DKSORTLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKLINESLIBF='libdk4.a'
+DKLINESLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKFICLIBF='libdk4.a'
+DKFICLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKUIDLIBF='libdk4.a'
+DKUIDLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKPWGENLIBF='libdk4.a'
+DKPWGENLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKRANDLIBF='libdk4.a'
+DKRANDLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKT2HLIBF='libdk4.a'
+DKT2HLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKT2LLIBF='libdk4.a'
+DKT2LLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBIN2CLIBF='libdk4.a'
+DKBIN2CLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKHEXLIBF='libdk4.a'
+DKHEXLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBMMLIBF='libdk4.a'
+DKBMMLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKPWDLIBF='libdk4.a'
+DKPWDLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKRECVLIBF='libdk4.a'
+DKRECVLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+DKSENDLIBF='libdk4.a'
+DKSENDLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+DKDBT2LIBF='libdk4.a'
+DKDBT2LIBS='libdk4.a $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
+DK4INFOLIBF='libdk4.a'
+DK4INFOLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+LPRNGCLLIBF='libdk4.a'
+LPRNGCLLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+WXDKFCSLIBF='libdk4.a libdk4wx.a'
+WXDKFCSLIBS='libdk4wx.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXPQDICLIBF='libdk4.a libdk4wx.a'
+WXPQDICLIBS='libdk4wx.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+PJSNMPLIBF='libdk4.a'
+PJSNMPLIBS='libdk4.a $(CLILIB) $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+PRMONSNMPLIBF='libdk4.a'
+PRMONSNMPLIBS='libdk4.a $(CLILIB) $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+PRINTQDLIBF='libdk4.a'
+PRINTQDLIBS='libdk4.a $(DBLIB) $(SOCKLIB) $(NSLLIB)'
+PRINTQDCLIBF='libdk4.a'
+PRINTQDCLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+RSHDOWNLIBF='libdk4.a'
+RSHDOWNLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+WXD2LATLIBF='libdk4.a'
+WXD2LATLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking elements in programs and libraries" >&5
+$as_echo_n "checking elements in programs and libraries... " >&6; }
+case X$ENA_PACKAGE/X$ENA_SOSO in
+ Xyes/Xyes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: linking so with so" >&5
+$as_echo "linking so with so" >&6; }
DKCTLIBF='libdk3c.so'
- DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- ADDCTRLDLIBF='libdk3c.so'
- ADDCTRLDLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKDBTLIBF='libdk3c.so libdk3dbi.so'
- DKDBTLIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKCTLIBS='-ldk3c $(CLILIB)'
+ ADDCTRLDLIBF=''
+ ADDCTRLDLIBS='$(CLILIB)'
+ DKDBTLIBF=''
+ DKDBTLIBS=''
ITADMINLIBF='libdk3c.so libdk3of.so'
- ITADMINLIBS='-ldk3of -ldk3c -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
- BMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- BMPPLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
- FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3fig.so'
- FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
- HTMLBOOKLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- HTMLBOOKLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ ITADMINLIBS='-ldk3of -ldk3c $(MYSQLLIB) $(CLILIB) $(BZLIB) $(ZLIB)'
+ FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3bmeps.so libdk3fig.so'
+ FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3bif -ldk3c $(CLILIB) -lm'
+ HTMLBOOKLIBF='libdk3c.so libdk3bif.so'
+ HTMLBOOKLIBS='-ldk3bif -ldk3c $(CLILIB)'
DK3INFOLIBF='libdk3c.so'
- DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PLPDFTEXLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- PLPDFTEXLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK3INFOLIBS='-ldk3c $(CLILIB)'
DKWXWIZLIBF='libdk3c.so'
- DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKWXWIZLIBS='-ldk3c $(CLILIB)'
WXDKCTLIBF='libdk3c.so libdk3wx.so'
- WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXBMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3wx.so'
- WXBMPPLIBS='-ldk3wx -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXIMGSZLIBF='libdk3c.so libdk3wx.so'
- WXIMGSZLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
+ WXIMGSZLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4maioxd.so libdk4wx.so'
+ WXIMGSZLIBS='-ldk4wx -ldk4maioxd -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
WXDKCLOCKLIBF='libdk3c.so libdk3wx.so'
- WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
WXDKHTBLIBF='libdk3c.so libdk3wx.so'
- WXDKHTBLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
- PRINTQDILIBF='libdk3c.so libdk3dbi.so'
- PRINTQDILIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PRINTQDALIBF='libdk3c.so'
- PRINTQDALIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKCATLIBF='libdk4base.so libdk4c.so libdk4maiodd.so libdk4app.so'
- DKCATLIBS='-ldk4app -ldk4maiodd -ldk4maio8d -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBLKSLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKBLKSLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSQLSPLITLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKERADISKLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKERADISKLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKLSLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKLSLIBS='-ldk4app -ldk4maiodd -ldk4maiodh -ldk4ma -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKHTBLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
+ PRINTQDILIBF=''
+ PRINTQDILIBS=''
+ PRINTQDALIBF=''
+ PRINTQDALIBS=''
+ WXDKDRAWLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4wx.so'
+ WXDKDRAWLIBS='-ldk4wx -ldk4gra -ldk4lat -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXBMPPLIBF='libdk4base.so libdk4maio8h.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4graa.so libdk4maioxd.so libdk4wx.so'
+ WXBMPPLIBS='-ldk4wx -ldk4maioxd -ldk4graa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maio8h -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKCATLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKCATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB)'
+ DKBLKSLIBF='libdk4base.so libdk4app.so'
+ DKBLKSLIBS='-ldk4app -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKSQLSPLITLIBF='libdk4app.so'
+ DKSQLSPLITLIBS='-ldk4app $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKERADISKLIBF='libdk4base.so libdk4app.so'
+ DKERADISKLIBS='-ldk4app -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKLSLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodh -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
+ BMPPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4bifa.so libdk4graa.so'
+ BMPPLIBS='-ldk4graa -ldk4bifa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maio8d -ldk4maio8h -ldk4base $(CLILIB)'
+ PLPDFTEXLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4lat.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4lata.so libdk4graa.so'
+ PLPDFTEXLIBS='-ldk4graa -ldk4lata -ldk4app -ldk4pppt -ldk4gra -ldk4lat -ldk4c -ldk4maio8d -ldk4base $(IMGLIBS) $(CLILIB)'
DKSORTLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
- DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maiodh -ldk4base $(CLILIB)'
+ DKLINESLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKLINESLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB)'
+ DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRANDLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2HLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
- DKT2LLIBS='-ldk4lat -ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKHEXLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4maiodh.so'
- DKHEXLIBS='-ldk4app -ldk4maiodh -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
+ DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB)'
+ DKRANDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB)'
+ DKT2HLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4maio8h -ldk4base $(CLILIB)'
+ DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4app.so libdk4lata.so'
+ DKT2LLIBS='-ldk4lata -ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB)'
+ DKBIN2CLIBF='libdk4base.so libdk4c.so libdk4app.so'
+ DKBIN2CLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB)'
+ DKHEXLIBF='libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKHEXLIBS='-ldk4app -ldk4c -ldk4maiodh $(CLILIB)'
DKBMMLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB)'
DKPWDLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKSENDLIBS='-ldk4maiodd -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB)'
+ DKRECVLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) -lm'
+ DKSENDLIBF='libdk4base.so libdk4ma.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ DKSENDLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4ma -ldk4base $(SOCKLIB) $(CLILIB) -lm'
DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
- DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
DK4INFOLIBF='libdk4base.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- LPRNGCLLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
- LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- WXDKFCSLIBF='libdk4base.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4ma -ldk4maio8d -ldk4maio8h -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRMONSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8h -ldk4maio8d -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
+ DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB)'
+ LPRNGCLLIBF='libdk4base.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4base $(SOCKLIB) $(CLILIB) -lm'
+ WXDKFCSLIBF='libdk4ma.so libdk4maiodd.so libdk4c.so libdk4wx.so'
+ WXDKFCSLIBS='-ldk4wx -ldk4c -ldk4maiodd -ldk4ma $(WXLDFLAGS) $(CRYPTO) $(GUILIB) $(CLILIB)'
+ WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4wx.so'
+ WXPQDICLIBS='-ldk4wx -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(SOCKLIB) $(GUILIB) $(CLILIB)'
+ PJSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so'
+ PJSNMPLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ PRMONSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so'
+ PRMONSNMPLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(CLILIB)'
PRINTQDLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4dbi.so libdk4sock.so'
- PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
+ PRINTQDCLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
RSHDOWNLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
- RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ WXD2LATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4lata.so libdk4bifa.so libdk4graa.so'
+ WXD2LATLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) -lm'
;;
- "Yyes/Xno")
+ Xyes/Xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: linking programs with all required libs" >&5
+$as_echo "linking programs with all required libs" >&6; }
DKCTLIBF='libdk3c.so'
- DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- ADDCTRLDLIBF='libdk3c.so'
- ADDCTRLDLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ADDCTRLDLIBF=''
+ ADDCTRLDLIBS='$(CLILIB)'
DKDBTLIBF='libdk3c.so libdk3dbi.so'
DKDBTLIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
ITADMINLIBF='libdk3c.so libdk3of.so'
- ITADMINLIBS='-ldk3of -ldk3c -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
- BMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- BMPPLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ITADMINLIBS='-ldk3of -ldk3c $(MYSQLLIB) $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3fig.so'
FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
HTMLBOOKLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
HTMLBOOKLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
DK3INFOLIBF='libdk3c.so'
- DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PLPDFTEXLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- PLPDFTEXLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
DKWXWIZLIBF='libdk3c.so'
- DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
WXDKCTLIBF='libdk3c.so libdk3wx.so'
WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXBMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3wx.so'
- WXBMPPLIBS='-ldk3wx -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXIMGSZLIBF='libdk3c.so libdk3wx.so'
- WXIMGSZLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXIMGSZLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4maioxd.so libdk4wx.so'
+ WXIMGSZLIBS='-ldk4wx -ldk4maioxd -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
WXDKCLOCKLIBF='libdk3c.so libdk3wx.so'
WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
WXDKHTBLIBF='libdk3c.so libdk3wx.so'
@@ -13842,183 +15750,190 @@ case "X$ENAPACKAGING/X$USESOLINKING" in
PRINTQDILIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
PRINTQDALIBF='libdk3c.so'
PRINTQDALIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKCATLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKCATLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBLKSLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKBLKSLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSQLSPLITLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKERADISKLIBF='libdk4base.so libdk4c.so'
- DKERADISKLIBS='-ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKLSLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSORTLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
- DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRANDLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2HLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
- DKT2LLIBS='-ldk4lat -ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKHEXLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKHEXLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBMMLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWDLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKSENDLIBS='-ldk4maiodd -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
- DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
- DK4INFOLIBF='libdk4base.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- LPRNGCLLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
- LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- WXDKFCSLIBF='libdk4base.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4ma -ldk4maio8d -ldk4maio8h -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRMONSNMPLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8h -ldk4maio8d -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRINTQDLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4dbi.so libdk4sock.so'
- PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(DBLIB) $(SOCKLIB) $(NSLLIB)'
- PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- RSHDOWNLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
- RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ WXDKDRAWLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4wx.so'
+ WXDKDRAWLIBS='-ldk4wx -ldk4gra -ldk4lat -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXBMPPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4c.so libdk4app.so libdk4bifa.so libdk4graa.so libdk4wx.so libdk4maioxd.so'
+ WXBMPPLIBS='-ldk4maioxd -ldk4wx -ldk4graa -ldk4bifa -ldk4app -ldk4c -ldk4gra -ldk4lat -ldk4bif -ldk4maiodh -ldk4maiodd -ldk4maiowh -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ BMPPLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maio8d.so libdk4maiowh.so libdk4maiowd.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4app.so libdk4lata.so libdk4bifa.so libdk4graa.so'
+ BMPPLIBS='-ldk4graa -ldk4bifa -ldk4lata -ldk4app -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maiowh -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ PLPDFTEXLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4bifa.so libdk4lata.so libdk4graa.so'
+ PLPDFTEXLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKCATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKCATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBLKSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBLKSLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKSQLSPLITLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKERADISKLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKERADISKLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKLSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKSORTLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKLINESLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4app.so'
+ DKLINESLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKFICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKRANDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKT2HLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKT2LLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4app.so libdk4lata.so'
+ DKT2LLIBS='-ldk4lata -ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBIN2CLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBIN2CLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKHEXLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKHEXLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBMMLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKPWDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maio8d.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4ma.so'
+ DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4maiodh.so libdk4maiowh.so libdk4maio8h.so'
+ DKSENDLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4ma -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
+ DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK4INFOLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ LPRNGCLLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
+ LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ WXDKFCSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
+ WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
+ WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRMONSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4maiodd.so libdk4maiodh.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRINTQDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4sock.so'
+ PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(DBLIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRINTQDCLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maio8d.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ RSHDOWNLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4sock.so'
+ RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ WXD2LATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4bifa.so libdk4lata.so libdk4graa.so'
+ WXD2LATLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaults" >&5
+$as_echo "defaults" >&6; }
;;
esac
-if [ "X$WGET" != "X" ]
-then
- GETSOURCE='wget -O dktools-$(VERSNO) $(SFBASE)/dktools-$(VERSNO).tar.gz/download'
-elif [ "X$CURL" != "X" ]
+if [ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" -o "X$TOOLCHAIN" = "msvc" ]
then
- GETSOURCE='curl -L $(SFBASE)/dktools-$(VERSNO).tar.gz > dktools-$(VERSNO).tar.gz'
+ case X$TARGETCLASS in
+ Xwindows)
+ ADDCTRLDRES='addctrldres.$(RESEXT)'
+ BMPPRES='bmppres.$(RESEXT)'
+ DK3INFORES='dk3infores.$(RESEXT)'
+ DK4INFORES='dk4infores.$(RESEXT)'
+ DKBIN2CRES='dk-bin2cres.$(RESEXT)'
+ DKBLKSRES='dk-blksres.$(RESEXT)'
+ DKBMMRES='dk-bmmres.$(RESEXT)'
+ DKCATRES='dk-catres.$(RESEXT)'
+ DKCTRES='dkctres.$(RESEXT)'
+ DKDB2TRES='dk-db2tres.$(RESEXT)'
+ DKDBCORES='dk-dbcores.$(RESEXT)'
+ DKDBTRES='dkdbtres.$(RESEXT)'
+ DKERADISKRES='dk-eradiskres.$(RESEXT)'
+ DKFICRES='dk-ficres.$(RESEXT)'
+ DKHEXRES='dk-hexres.$(RESEXT)'
+ DKLINESRES='dk-linesres.$(RESEXT)'
+ DKLSRES='dk-lsres.$(RESEXT)'
+ DKPWDRES='dk-pwdres.$(RESEXT)'
+ DKPWGENRES='dk-pwgenres.$(RESEXT)'
+ DKRANDRES='dk-randres.$(RESEXT)'
+ DKRECVRES='dk-recvres.$(RESEXT)'
+ DKSENDRES='dk-sendres.$(RESEXT)'
+ DKSORTRES='dk-sortres.$(RESEXT)'
+ DKSQLSPLITRES='dk-sqlsplitres.$(RESEXT)'
+ DKT2DBRES='dk-t2dbres.$(RESEXT)'
+ DKT2HRES='dk-t2hres.$(RESEXT)'
+ DKT2LRES='dk-t2lres.$(RESEXT)'
+ DKWTADMRES='dkwtadmres.$(RESEXT)'
+ DKWTRES='dkwtres.$(RESEXT)'
+ DKWXPATHRES='dkwxpathres.$(RESEXT)'
+ DKWXWIZRES='dkwxwizres.$(RESEXT)'
+ FIG2LATRES='fig2latres.$(RESEXT)'
+ HTMLBOOKRES='htmlbookres.$(RESEXT)'
+ ITADMINRES='itadminres.$(RESEXT)'
+ LPRNGCLRES='lprngclres.$(RESEXT)'
+ PLPDFTEXRES='plpdftexres.$(RESEXT)'
+ WINPRINTRES='winprintres.$(RESEXT)'
+ WPRCLEANRES='wprcleanres.$(RESEXT)'
+ WXBMPPRES='wxbmppres.$(RESEXT)'
+ WXDKCLOCKRES='wxdkclockres.$(RESEXT)'
+ WXDKCTRES='wxdkctres.$(RESEXT)'
+ WXDKFCSRES='wxdkfcsres.$(RESEXT)'
+ WXDKHTBRES='wxdkhtbres.$(RESEXT)'
+ WXDKSCRSZRES='wxdkscrszres.$(RESEXT)'
+ WXIMGSZRES='wximgszres.$(RESEXT)'
+ WXPQDICRES='wxpqdicres.$(RESEXT)'
+ ;;
+ esac
fi
-if [ "X$UNAME" = "XSunOS" -a "X$SOLCOR" = "Xyes" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking options for Windows" >&5
+$as_echo_n "checking options for Windows... " >&6; }
+WINCLILIB=''
+WINGUILIB=''
+CLILIB=''
+GUILIB=''
+if [ "X$BUILDCLASS" = "Xwindows" ]
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS on Solaris" >&5
-$as_echo_n "checking CFLAGS on Solaris... " >&6; }
- NETSNMP_LIBS=`echo $NETSNMP_LIBS | sed -f modsnmp.sed`
- TMPVAR="$WXCPPFLAGS"
- WXCPPFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCPPFLAGS="$WXCPPFLAGS $i"
- ;;
- "X-I*")
- WXCPPFLAGS="$WXCPPFLAGS $i"
- ;;
- esac
- done
- TMPVAR="$WXCXXFLAGS"
- WXCXXFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- "X-I*")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- "X-pthread")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- esac
- done
- TMPVAR="$WXCFLAGS"
- WXCFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- "X-I*")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- "X-pthread")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- esac
- done
- TMPVAR="$WXLDFLAGS"
- WXLDFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-L*")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- "X-l*")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- "X-pthread")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- esac
- done
- SOCKLIB='-lsocket'
- NSLLIB='-lnsl'
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
+ DELTARGET='@-IF EXIST "$@" DEL /F /Q "$@"'
+ DELTARGETSO='@-IF EXIST "$@.$(SOVERS)" DEL /F /Q "$@.$(SOVERS)"'
+else
+ DELTARGET='@-[ ! -f "$@" ] || rm -f "$@"'
+ DELTARGETSO='@-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"'
fi
-
-if [ "X$ONWINDOWS" != "Xno" ]
+if [ "X$TARGETCLASS" = "Xwindows" ]
then
- CLILIB='$(WINCLILIB)'
- GUILIB='$(WINGUILIB)'
- ENTRY='$(WINENTRY)'
-else
- $as_echo "@%:@define HAVE_INODES 1" >>confdefs.h
-
+ WINCLILIB='-lkernel32 -lgdi32 -ladvapi32 -luser32 -lnetapi32 -lwinspool'
+ WINGUILIB='-lole32 -loleaut32 -lshell32 -lcomctl32 -lcomdlg32'
+ CLILIB='$(WINCLILIB)'
+ GUILIB='$(WINGUILIB)'
fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking manpage installation" >&5
-$as_echo_n "checking manpage installation... " >&6; }
-case "X$MANINST" in
- "Xauto")
- if uname -a | grep -q Debian
- then
- MANINST='no'
- else
- MANINST='yes'
- fi
- ;;
-esac
-if [ "X$MANINST" = "Xno" ]
+if [ "X$TARGETCLASS" = "Xwindows" -a "X$TOOLCHAIN" = "Xgcc" ]
then
- INSTALLMANPAGES=''
+ WINGUILIB="-lwinmm -limm32 -luuid $WINGUILIB"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -municode"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANINST" >&5
-$as_echo "$MANINST" >&6; }
+if [ "X$TARGETCLASS" = "Xwindows" -a "X$TOOLCHAIN" = "Xclang" ]
+then
+ WINGUILIB="-lwinmm -limm32 -luuid $WINGUILIB"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -municode"
+fi
+if [ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]
+then
+ case X$CROSSBUILD/X$ENA_PACKAGE in
+ Xyes/Xno)
+ LDFLC_CLI_C8="$LDFLC_CLI_C8 -static -static-libgcc -Wl,-Bstatic"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -static -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_C8="$LDFLCXX_CLI_C8 -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_DK="$LDFLCXX_CLI_DK -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_WX="$LDFLCXX_CLI_WX -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_GUI="$LDFLCXX_GUI -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ ;;
+ esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
-DBLIBSOCK="$DBLIB"
-if [ "X$UNAME" = "XSunOS" -a "X$SOLCOR" = "Xyes" ]
+LPRNGUSER='lp'
+LPRNGGROUP='lp'
+if [ -f /etc/debian_version ]
then
- [ "X$DBLIBSOCK" = "X" ] || DBLIBSOCK="$DBLIBSOCK -lrt "'$(SOCKLIB)'
- [ "X$DBLIB" = "X" ] || DBLIB="$DBLIB -lrt "
- [ "X$CRYPTO" = "X" ] || CRYPTO="$CRYPTO -lssl "'$(SOCKLIB)'
- [ "X$MYSQLLIB" = "X" ] || MYSQLLIB="$MYSQLLIB -lrt "'$(SOCKLIB)'
+ LPRNGUSER='daemon'
fi
-LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
@@ -14113,6 +16028,63 @@ LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
+# File name extensions
+# --------------------
+
+
+
+
+
+
+# Detected run path
+# -----------------
+
+
+# Detected features
+# -----------------
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS substituted: $CPPFLAGS" >&5
+$as_echo "$as_me: CPPFLAGS substituted: $CPPFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CFLAGS substituted: $CFLAGS" >&5
+$as_echo "$as_me: CFLAGS substituted: $CFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS substituted: $LDFLAGS" >&5
+$as_echo "$as_me: LDFLAGS substituted: $LDFLAGS" >&6;}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14271,7 +16243,117 @@ LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
-ac_config_files="$ac_config_files Makefile scripts/wr-dk3inst.sh scripts/wr-dk4inst.sh scripts/create-desktop-files.sh scripts/build-help.sh initd-printqd dktools.pc pkginfo debian/control"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
+
+
+
+
+
+cp debian/dktools-lib.install.in debian/dktools-lib-${SOVERS}.install
+cp debian/dktools-lib-dev.install.in debian/dktools-lib-${SOVERS}-dev.install
+echo package-name-doesnt-match-sonames > debian/dktools-lib-${SOVERS}.lintian-overrides
+
+
+
+ac_config_files="$ac_config_files Makefile scripts/write-files.sh scripts/build-help.sh initd-printqd initd-rshdown dktools.pc pkginfo debian/control debian/control9 debian/control8 debian/printqd.postrm debian/printqd.postinst debian/rshdown.postrm"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -14967,14 +17049,18 @@ do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "scripts/wr-dk3inst.sh") CONFIG_FILES="$CONFIG_FILES scripts/wr-dk3inst.sh" ;;
- "scripts/wr-dk4inst.sh") CONFIG_FILES="$CONFIG_FILES scripts/wr-dk4inst.sh" ;;
- "scripts/create-desktop-files.sh") CONFIG_FILES="$CONFIG_FILES scripts/create-desktop-files.sh" ;;
+ "scripts/write-files.sh") CONFIG_FILES="$CONFIG_FILES scripts/write-files.sh" ;;
"scripts/build-help.sh") CONFIG_FILES="$CONFIG_FILES scripts/build-help.sh" ;;
"initd-printqd") CONFIG_FILES="$CONFIG_FILES initd-printqd" ;;
+ "initd-rshdown") CONFIG_FILES="$CONFIG_FILES initd-rshdown" ;;
"dktools.pc") CONFIG_FILES="$CONFIG_FILES dktools.pc" ;;
"pkginfo") CONFIG_FILES="$CONFIG_FILES pkginfo" ;;
"debian/control") CONFIG_FILES="$CONFIG_FILES debian/control" ;;
+ "debian/control9") CONFIG_FILES="$CONFIG_FILES debian/control9" ;;
+ "debian/control8") CONFIG_FILES="$CONFIG_FILES debian/control8" ;;
+ "debian/printqd.postrm") CONFIG_FILES="$CONFIG_FILES debian/printqd.postrm" ;;
+ "debian/printqd.postinst") CONFIG_FILES="$CONFIG_FILES debian/printqd.postinst" ;;
+ "debian/rshdown.postrm") CONFIG_FILES="$CONFIG_FILES debian/rshdown.postrm" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -15568,255 +17654,161 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-chmod 755 scripts/*.sh
+export FOUND_SYSTEMD
+chmod ugo+rx scripts/*.sh initd-printqd initd-rshdown
+scripts/write-files.sh
-cp debian/dktools-lib.install.in debian/dktools-lib-${SOVERS}.install
-cp debian/dktools-lib.postinst.in debian/dktools-lib-${SOVERS}.postinst
-cp debian/dktools-lib.postrm.in debian/dktools-lib-${SOVERS}.postrm
-cp debian/dktools-lib-dev.install.in debian/dktools-lib-${SOVERS}-dev.install
-echo package-name-doesnt-match-sonames > debian/dktools-lib-${SOVERS}.lintian-overrides
-chmod 644 debian/dktools-lib-${SOVERS}.install
-chmod 644 debian/dktools-lib-${SOVERS}.postinst
-chmod 644 debian/dktools-lib-${SOVERS}.postrm
-chmod 644 debian/dktools-lib-${SOVERS}-dev.install
-chmod 644 debian/dktools-lib-${SOVERS}.lintian-overrides
-
-[ ! -f dk4config ] || rm -f dk4config
-[ ! -f dk4config.o ] || rm -f dk4config.o
-[ ! -f dk3config ] || rm -f dk3config
-[ ! -f dk3config.o ] || rm -fr dk3config.o
-[ ! -f wxcs ] || rm -f wxcs
-[ ! -f wxcs.o ] || rm -fr wxcs.o
-
-if [ "X$build" != "X$host" ]
+if [ "X$CROSSBUILD" = "Xyes" -o "X$MAKE" = "X" ]
then
- cp dk3conf.cross dk3conf.h
- cp dk4conf.cross dk4conf.h
- cp dk4wxcs.cross dk4wxcs.h
- echo 'ERROR: Cross-compiling not supported!'
-elif [ "X$SUITE" = "Xgui" ]
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Fix configure results: Use sed" >&5
+$as_echo "$as_me: Fix configure results: Use sed" >&6;}
+ (
+ cat dk4conf.h.start
+ grep '#define' config.h | awk '{print $2 " " $3;}' | grep -v CONFIG_H_INCLUDED | sort | sed -e 's/^/#define DK4_/g'
+ cat dk4conf.h.large
+ cat dk4conf.h.end
+ ) > dk4conf.h
+ (
+ cat dk3conf.h.start
+ grep '#define' config.h | awk '{print $2 " " $3;}' | grep -v CONFIG_H_INCLUDED | sort | sed -e 's/^/#define DK3_/g'
+ cat dk3conf.h.large
+ cat dk3conf.h.end
+ ) > dk3conf.h
+ cp dk4wxcs.cross dk4wxcs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Fix configure results: Run programs" >&5
+$as_echo "$as_me: Fix configure results: Run programs" >&6;}
+ [ ! -f "dk4config${EXEEXT}" ] || rm -f "dk4config${EXEEXT}"
+ [ ! -f "dk4wxcs${EXEEXT}" ] || rm -f "dk4wxcs${EXEEXT}"
+ [ ! -f "dk3config${EXEEXT}" ] || rm -f "dk3config${EXEEXT}"
+ ${MAKE} dk4config${EXEEXT} dk3config${EXEEXT} dk4wxcs${EXEEXT}
+ (
+ cat dk4conf.h.start
+ ./dk4config${EXEEXT}
+ cat dk4conf.h.end
+ ) > dk4conf.h
+ ./dk3config${EXEEXT} > dk3conf.h
+ ./dk4wxcs${EXEEXT} > dk4wxcs.h
+ sed -e 's/DK4/DK3/g' < dk4wxcs.h > dk3wxcs.h
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Software suite: $SUITE" >&5
+$as_echo "$as_me: Software suite: $SUITE" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build static libraries: $ENA_STATIC" >&5
+$as_echo "$as_me: Build static libraries: $ENA_STATIC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build shared libraries: $ENA_SHARED" >&5
+$as_echo "$as_me: Build shared libraries: $ENA_SHARED" >&6;}
+if [ "X$ENA_SHARED" = "Xyes" ]
then
- echo 'Build dk4config (C++)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- echo 'Build wxcs (C++)'
- $MAKE wxcs
- echo 'Generating configuration files'
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
- ./wxcs > dk4wxcs.h
-elif [ "X$CXX" != "X" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build for package generation: $ENA_PACKAGE" >&5
+$as_echo "$as_me: Build for package generation: $ENA_PACKAGE" >&6;}
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Link shared libs with shared libs: $ENA_SOSO" >&5
+$as_echo "$as_me: Link shared libs with shared libs: $ENA_SOSO" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Install man pages: $ENA_MAN" >&5
+$as_echo "$as_me: Install man pages: $ENA_MAN" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Activate more warnings: $ENA_WARN" >&5
+$as_echo "$as_me: Activate more warnings: $ENA_WARN" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Allow debug information: $ENA_DEBUG" >&5
+$as_echo "$as_me: Allow debug information: $ENA_DEBUG" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Corrections for SunOS: $ENA_SUNOS_CORR" >&5
+$as_echo "$as_me: Corrections for SunOS: $ENA_SUNOS_CORR" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build host: $BUILDHOST" >&5
+$as_echo "$as_me: Build host: $BUILDHOST" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build class: $BUILDCLASS" >&5
+$as_echo "$as_me: Build class: $BUILDCLASS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Target host: $TARGETHOST" >&5
+$as_echo "$as_me: Target host: $TARGETHOST" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Target class: $TARGETCLASS" >&5
+$as_echo "$as_me: Target class: $TARGETCLASS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Cross compilation build: $CROSSBUILD" >&5
+$as_echo "$as_me: Cross compilation build: $CROSSBUILD" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Tool chain: $TOOLCHAIN" >&5
+$as_echo "$as_me: Tool chain: $TOOLCHAIN" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: C compiler: $CC" >&5
+$as_echo "$as_me: C compiler: $CC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: C++ compiler: $CXX" >&5
+$as_echo "$as_me: C++ compiler: $CXX" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS: $CPPFLAGS" >&5
+$as_echo "$as_me: CPPFLAGS: $CPPFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CFLAGS: $CFLAGS" >&5
+$as_echo "$as_me: CFLAGS: $CFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS: $LDFLAGS" >&5
+$as_echo "$as_me: LDFLAGS: $LDFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Libraries and functions:" >&5
+$as_echo "$as_me: Libraries and functions:" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: socket $FOUND_SOCKET" >&5
+$as_echo "$as_me: socket $FOUND_SOCKET" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: zlib $FOUND_ZLIB" >&5
+$as_echo "$as_me: zlib $FOUND_ZLIB" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: libbz2 $FOUND_BZLIB" >&5
+$as_echo "$as_me: libbz2 $FOUND_BZLIB" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: libpng $FOUND_PNG" >&5
+$as_echo "$as_me: libpng $FOUND_PNG" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: libjpeg $FOUND_JPG" >&5
+$as_echo "$as_me: libjpeg $FOUND_JPG" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: libtiff $FOUND_TIFF" >&5
+$as_echo "$as_me: libtiff $FOUND_TIFF" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: OpenSSL $FOUND_OPENSSL" >&5
+$as_echo "$as_me: OpenSSL $FOUND_OPENSSL" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: NetSNMP $FOUND_NETSNMP" >&5
+$as_echo "$as_me: NetSNMP $FOUND_NETSNMP" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: MySQL / MariaDB $FOUND_MYSQL" >&5
+$as_echo "$as_me: MySQL / MariaDB $FOUND_MYSQL" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: wxWidgets $FOUND_WX" >&5
+$as_echo "$as_me: wxWidgets $FOUND_WX" >&6;}
+
+if [ "X$CROSSBUILD" = "Xyes" ]
then
- echo 'Build dk4config (C++)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- echo 'Generating configuration files'
- cp dk4wxcs.cross dk4wxcs.h
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
-else
- sed -f mod-dkconfig.sed < dk4config.cpp > dk4config.c
- mv dk4config.cpp dk4config.cpp.bck
- echo 'Build dk4config (C)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- mv dk4config.cpp.bck dk4config.cpp
- rm dk4config.c
- echo 'Generating configuration files'
- cp dk4wxcs.cross dk4wxcs.h
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
-fi
-sed -e 's/DK4/DK3/g' < dk4wxcs.h > dk3wxcs.h
-
-chmod 755 scripts/wr-dk4inst.sh
-echo './scripts/wr-dk4inst.sh > dk4inst.c'
-./scripts/wr-dk4inst.sh
-chmod 755 scripts/wr-dk3inst.sh
-./scripts/wr-dk3inst.sh > dk3inst.c
-chmod 755 scripts/create-desktop-files.sh
-./scripts/create-desktop-files.sh
-
-VERSNO=`cat version.txt`
-cat > dk4vers.h <<EOF
-#ifndef DK4VERS_H_INCLUDED
-#define DK4VERS_H_INCLUDED 1
-
-/** @file dk4vers.h Version number as text string.
-*/
-
-/** Version number in 8 bit characters.
-*/
-#define DKT_VERSION_C8 "$VERSNO"
-
-/** Version number in dkChar.
-*/
-#define DKT_VERSION_DK dkT("$VERSNO")
-
-#endif
-EOF
-
-cat > dk4verswx.h <<EOF
-#ifndef DK4VERSWX_H_INCLUDED
-/** Protection against multiple inclusions. */
-#define DK4VERSWX_H_INCLUDED 1
-/** @file dk4verswx.h Version number as wxChar string.
-*/
-
-#ifndef WX_WXPREC_H_INCLUDED
-#include "wx/wxprec.h"
-#define WX_WXPREC_H_INCLUDED 1
-#endif
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#ifndef WX_WX_H_INCLUDED
-#include "wx/wx.h"
-#define WX_WX_H_INCLUDED 1
-#endif
-#endif
-
-/** Version number as wxChar string.
-*/
-#define DKT_VERSION_WX wxT("$VERSNO")
-
-#endif
-EOF
-
-echo ''
-echo 'Configuration summary'
-echo '====================='
-if [ "X$ZLIB" = "X-lz" ]
-then
-echo 'zlib: found.'
-else
-echo 'zlib: NOT found! Required!'
-echo ' SL 6.x package name: zlib-devel'
-echo ' Debian package name: libz-dev'
-echo ' URL: http://www.zlib.net'
-EXVAL=1
-fi
-if [ "X-lbz2" = "X$BZLIB" ]
-then
-echo 'libbz2: found.'
-else
-echo 'libbz2: NOT found! Recommended.'
-echo ' Bzip compression not available.'
-echo ' SL 6.x package name: bzip2-devel'
-echo ' Debian package name: libbz2-dev'
-echo ' URL: http://www.bzip.org'
-fi
-if [ "X$LIBPNG" = "X-lpng" ]
-then
-echo 'libpng: found.'
-else
-echo 'libpng: NOT found! Required!'
-echo ' SL 6.x package name: libpng-devel'
-echo ' Debian package name: libpng-dev'
-echo ' URL: http://www.libpng.org'
-EXVAL=1
-fi
-if [ "X$LIBJPEG" = "X-ljpeg" ]
-then
-echo 'libjpeg: found.'
-else
-echo 'libjpeg: NOT found! Recommended.'
-echo ' No JPEG support in bmpp and fig2lat.'
-echo ' SL 6.x package name: libjpeg-turbo-devel'
-echo ' Debian package name: libjpeg-dev'
-echo ' URL: http://www.ijg.org/'
-fi
-if [ "X$LIBTIFF" = "X-ltiff" ]
-then
-echo 'libtiff: found.'
-else
-echo 'libtiff: NOT found! Recommended.'
-echo ' No TIFF support in bmpp and fig2lat.'
-echo ' SL 6.x package name: libtiff-devel'
-echo ' Debian package name: libtiff-dev'
-echo ' URL: http://www.remotesensing.org/libtiff/'
-fi
-if [ "X$ANYDB" != "X" ]
-then
-echo "database: $ANYDB"
-else
-echo 'database: NOT found! Recommended.'
-echo ' Skipping printqd build!'
-echo ' SL 6.x package name: db4-devel'
-echo ' Debian package name: libdb-dev'
-echo ' URL: http://www.oracle.com/database/berkeley-db/'
-fi
-if [ "X$MYSQLPROG" = "Xmysqlprog" ]
-then
-echo 'MySQL: found.'
-else
-echo 'MySQL: NOT found! Recommended.'
-echo ' Skipping itadmin build.'
-echo ' SL 6.x package name: mysql-devel'
-echo ' Debian package name: libmysqlclient-dev'
-echo ' URL: http://www.mysql.com/'
-fi
-if [ "X$CRYPTO" != "X" ]
-then
-echo 'OpenSSL: found.'
-else
-echo 'OpenSSL: NOT found!'
-echo ' SL 6.x package name: openssl-devel'
-echo ' Debian package name: libssl-dev'
-echo ' URL: http://www.openssl.org/'
-fi
-if [ "X$WXCPPFLAGS" != "X" ]
-then
-echo 'wxWidgets: found.'
-else
-echo 'wxWidgets: NOT found!'
-echo ' SL 6.x package name: wxGTK-devel'
-echo ' Debian package name: libwxgtk3.0-dev'
-echo ' URL: http://www.wxwidgets.org/'
-fi
-case "X$SUITE" in
-"Xgui")
-echo 'Software bundle: CLI and GUI programs'
-;;
-"Xrescue")
-echo 'Software bundle: Rescue system programs'
-;;
-"*")
-echo 'Software bundle: CLI programs'
-;;
-esac
-if [ "X$ENASTATIC" = "Xyes" ]
-then
-echo 'Install static libraries: yes'
-else
-echo 'Install static libraries: no'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CROSS-COMPILATION BUILD:" >&5
+$as_echo "$as_me: CROSS-COMPILATION BUILD:" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Test for twos complement not possible!" >&5
+$as_echo "$as_me: WARNING: Test for twos complement not possible!" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Test for IEEE 754 compliant double not possible!" >&5
+$as_echo "$as_me: WARNING: Test for IEEE 754 compliant double not possible!" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Test for /proc/.../exe not possible!" >&5
+$as_echo "$as_me: WARNING: Test for /proc/.../exe not possible!" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Results for these tests are guessed and may be wrong." >&5
+$as_echo "$as_me: WARNING: Results for these tests are guessed and may be wrong." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Before you continue check the following settings," >&5
+$as_echo "$as_me: WARNING: Before you continue check the following settings," >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: apply corrections if necessary:" >&5
+$as_echo "$as_me: WARNING: apply corrections if necessary:" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - HAVE_TWOS_COMPLEMENT in file config.h" >&5
+$as_echo "$as_me: WARNING: - HAVE_TWOS_COMPLEMENT in file config.h" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - HAVE_IEEE_754_DOUBLE in file config.h" >&5
+$as_echo "$as_me: WARNING: - HAVE_IEEE_754_DOUBLE in file config.h" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - HAVE_PROC_PID_EXE in file config.h" >&5
+$as_echo "$as_me: WARNING: - HAVE_PROC_PID_EXE in file config.h" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Run \"make confprogs\" if corrections were necessary." >&5
+$as_echo "$as_me: WARNING: Run \"make confprogs\" if corrections were necessary." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Before running \"make\" and \"make install\" transfer the programs" >&5
+$as_echo "$as_me: Before running \"make\" and \"make install\" transfer the programs" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: dk3config${EXEEXT}, dk4config${EXEEXT} and dk4wxcs${EXEEXT}" >&5
+$as_echo "$as_me: dk3config${EXEEXT}, dk4config${EXEEXT} and dk4wxcs${EXEEXT}" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: to the target system and run the commands" >&5
+$as_echo "$as_me: to the target system and run the commands" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ./dk3config > dk3conf.h" >&5
+$as_echo "$as_me: ./dk3config > dk3conf.h" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ./dk4config > dk4conf.h" >&5
+$as_echo "$as_me: ./dk4config > dk4conf.h" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ./dk4wxcs > dk4wxcs.h" >&5
+$as_echo "$as_me: ./dk4wxcs > dk4wxcs.h" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: on the target system." >&5
+$as_echo "$as_me: on the target system." >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Transfer the files dk3conf.h, dk4conf.h and dk4wxcs.h back to" >&5
+$as_echo "$as_me: Transfer the files dk3conf.h, dk4conf.h and dk4wxcs.h back to" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: here. At the start of dk4conf.h insert the dk4conf.h.start file." >&5
+$as_echo "$as_me: here. At the start of dk4conf.h insert the dk4conf.h.start file." >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: At the end of dk4conf.h insert the dk4conf.h.end file." >&5
+$as_echo "$as_me: At the end of dk4conf.h insert the dk4conf.h.end file." >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Now continue the build process." >&5
+$as_echo "$as_me: Now continue the build process." >&6;}
fi
-if [ "X$ENASHARED" = "Xyes" ]
-then
-echo 'Install shared libraries: yes'
-else
-echo 'Install shared libraries: no'
-fi
-if [ "X$USESOLINKING" = "Xyes" ]
-then
-echo 'Nested shared library linking: yes'
-else
-echo 'Nested shared library linking: no'
-fi
-if [ "X$ENAPACKAGING" = "Xyes" ]
-then
-echo 'Binaries use shared libraries: yes'
-else
-echo 'Binaries use shared libraries: no'
-fi
-echo ''
-echo The INSTALL files describes how to install via '*.rpm' or '.deb' package.
-echo ''
-exit $EXVAL
-
diff --git a/support/dktools/autom4te.cache/requests b/support/dktools/autom4te.cache/requests
index cb021fc6bb..146e98ea57 100644
--- a/support/dktools/autom4te.cache/requests
+++ b/support/dktools/autom4te.cache/requests
@@ -1,4 +1,4 @@
-# This file was generated by Autom4te Sun Aug 31 17:43:43 UTC 2014.
+# This file was generated by Autom4te Sun Aug 20 18:29:13 UTC 2017.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@@ -15,64 +15,64 @@
'configure.ac'
],
{
- 'AM_PATH_GUILE' => 1,
- 'AC_DEFINE_TRACE_LITERAL' => 1,
- 'sinclude' => 1,
- 'AM_PROG_FC_C_O' => 1,
'AM_XGETTEXT_OPTION' => 1,
- 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
- 'AC_CANONICAL_HOST' => 1,
- 'AM_INIT_AUTOMAKE' => 1,
- 'AH_OUTPUT' => 1,
+ 'AC_SUBST_TRACE' => 1,
+ 'AM_SILENT_RULES' => 1,
+ 'AC_CANONICAL_BUILD' => 1,
+ 'AM_PROG_AR' => 1,
'AM_PROG_F77_C_O' => 1,
+ '_m4_warn' => 1,
+ 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
+ 'AC_INIT' => 1,
+ 'AM_PROG_CXX_C_O' => 1,
+ 'AM_PATH_GUILE' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_FREEFORM' => 1,
+ 'AC_FC_PP_DEFINE' => 1,
+ 'AM_PROG_LIBTOOL' => 1,
+ 'm4_sinclude' => 1,
+ 'AM_GNU_GETTEXT' => 1,
+ 'AM_NLS' => 1,
'AM_MAINTAINER_MODE' => 1,
- '_m4_warn' => 1,
+ 'AM_PROG_CC_C_O' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_ENDIF' => 1,
- 'AC_FC_SRCEXT' => 1,
- 'AM_GNU_GETTEXT' => 1,
- 'AM_CONDITIONAL' => 1,
- 'AC_CONFIG_AUX_DIR' => 1,
- 'LT_CONFIG_LTDL_DIR' => 1,
- 'LT_SUPPORTED_TAG' => 1,
- 'AM_PROG_MOC' => 1,
- 'AC_REQUIRE_AUX_FILE' => 1,
- 'AC_CONFIG_FILES' => 1,
'_AM_SUBST_NOTMAKE' => 1,
- 'AC_FC_PP_DEFINE' => 1,
- 'AM_PROG_CXX_C_O' => 1,
- 'm4_include' => 1,
+ 'AC_REQUIRE_AUX_FILE' => 1,
+ 'AC_CONFIG_SUBDIRS' => 1,
+ 'AM_ENABLE_MULTILIB' => 1,
+ 'LT_SUPPORTED_TAG' => 1,
+ 'AC_CANONICAL_TARGET' => 1,
+ 'AH_OUTPUT' => 1,
+ 'AC_CONFIG_LINKS' => 1,
+ 'AC_FC_PP_SRCEXT' => 1,
+ 'AM_INIT_AUTOMAKE' => 1,
'AC_SUBST' => 1,
- 'm4_pattern_allow' => 1,
- 'AM_POT_TOOLS' => 1,
- 'AM_PROG_LIBTOOL' => 1,
- 'AC_SUBST_TRACE' => 1,
+ 'sinclude' => 1,
+ 'LT_CONFIG_LTDL_DIR' => 1,
+ 'AC_CONFIG_FILES' => 1,
'AC_LIBSOURCE' => 1,
- 'AC_CANONICAL_BUILD' => 1,
- 'AC_CONFIG_HEADERS' => 1,
- 'AM_PROG_CC_C_O' => 1,
- '_LT_AC_TAGCONFIG' => 1,
- '_AM_MAKEFILE_INCLUDE' => 1,
- 'AM_MAKEFILE_INCLUDE' => 1,
- 'AM_NLS' => 1,
- 'AC_INIT' => 1,
+ 'AC_CONFIG_AUX_DIR' => 1,
'_AM_COND_ELSE' => 1,
- 'AC_PROG_LIBTOOL' => 1,
- 'AM_ENABLE_MULTILIB' => 1,
+ 'AC_CONFIG_HEADERS' => 1,
'_AM_COND_IF' => 1,
- 'AM_SILENT_RULES' => 1,
- 'AM_PROG_AR' => 1,
- 'AC_CONFIG_SUBDIRS' => 1,
- 'LT_INIT' => 1,
- 'AC_CANONICAL_TARGET' => 1,
+ 'AC_DEFINE_TRACE_LITERAL' => 1,
+ 'm4_include' => 1,
+ 'include' => 1,
+ 'm4_pattern_allow' => 1,
+ 'AC_PROG_LIBTOOL' => 1,
+ 'AM_PROG_FC_C_O' => 1,
'AM_AUTOMAKE_VERSION' => 1,
+ 'LT_INIT' => 1,
+ 'AC_FC_SRCEXT' => 1,
'AC_CANONICAL_SYSTEM' => 1,
- 'm4_sinclude' => 1,
- 'AC_FC_PP_SRCEXT' => 1,
- 'AC_CONFIG_LINKS' => 1,
- 'include' => 1
+ 'AC_CANONICAL_HOST' => 1,
+ '_AM_MAKEFILE_INCLUDE' => 1,
+ '_LT_AC_TAGCONFIG' => 1,
+ 'AM_MAKEFILE_INCLUDE' => 1,
+ 'AM_CONDITIONAL' => 1,
+ 'AM_PROG_MOC' => 1,
+ 'AM_POT_TOOLS' => 1
}
], 'Autom4te::Request' )
);
diff --git a/support/dktools/autom4te.cache/traces.0 b/support/dktools/autom4te.cache/traces.0
index 900dc56690..0745d3c8ec 100644
--- a/support/dktools/autom4te.cache/traces.0
+++ b/support/dktools/autom4te.cache/traces.0
@@ -63,6 +63,9 @@ m4trace:configure.ac:2: -1- m4_pattern_allow([^sharedstatedir$])
m4trace:configure.ac:2: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([localstatedir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^localstatedir$])
+m4trace:configure.ac:2: -1- AC_SUBST([runstatedir], ['${localstatedir}/run'])
+m4trace:configure.ac:2: -1- AC_SUBST_TRACE([runstatedir])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^runstatedir$])
m4trace:configure.ac:2: -1- AC_SUBST([includedir], ['${prefix}/include'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([includedir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^includedir$])
@@ -146,2612 +149,3148 @@ m4trace:configure.ac:2: -1- m4_pattern_allow([^host_alias$])
m4trace:configure.ac:2: -1- AC_SUBST([target_alias])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([target_alias])
m4trace:configure.ac:2: -1- m4_pattern_allow([^target_alias$])
-m4trace:configure.ac:3: -1- AC_CONFIG_HEADERS([config.h])
-m4trace:configure.ac:4: -1- AC_SUBST([CC])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^CC$])
-m4trace:configure.ac:4: -1- AC_SUBST([CFLAGS])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([CFLAGS])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^CFLAGS$])
-m4trace:configure.ac:4: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.ac:4: -1- AC_SUBST([LIBS])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.ac:4: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.ac:4: -1- AC_SUBST([CC])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^CC$])
-m4trace:configure.ac:4: -1- AC_SUBST([CC])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^CC$])
-m4trace:configure.ac:4: -1- AC_SUBST([CC])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^CC$])
-m4trace:configure.ac:4: -1- AC_SUBST([CC])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^CC$])
-m4trace:configure.ac:4: -1- AC_SUBST([ac_ct_CC])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([ac_ct_CC])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^ac_ct_CC$])
-m4trace:configure.ac:4: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([EXEEXT])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^EXEEXT$])
-m4trace:configure.ac:4: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
-m4trace:configure.ac:4: -1- AC_SUBST_TRACE([OBJEXT])
-m4trace:configure.ac:4: -1- m4_pattern_allow([^OBJEXT$])
-m4trace:configure.ac:5: -1- AC_SUBST([CPP])
-m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.ac:5: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.ac:5: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.ac:5: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.ac:5: -1- AC_SUBST([CPP])
-m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.ac:5: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.ac:6: -1- AC_SUBST([CXX])
-m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.ac:6: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.ac:6: -1- AC_SUBST([CXXFLAGS])
-m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CXXFLAGS])
-m4trace:configure.ac:6: -1- m4_pattern_allow([^CXXFLAGS$])
-m4trace:configure.ac:6: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.ac:6: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.ac:6: -1- AC_SUBST([LIBS])
-m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.ac:6: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.ac:6: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.ac:6: -1- AC_SUBST([CXX])
-m4trace:configure.ac:6: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.ac:6: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.ac:6: -1- AC_SUBST([ac_ct_CXX])
-m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ac_ct_CXX])
-m4trace:configure.ac:6: -1- m4_pattern_allow([^ac_ct_CXX$])
-m4trace:configure.ac:7: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-# undef WORDS_BIGENDIAN
-# endif
-#endif])
-m4trace:configure.ac:7: -1- AC_SUBST([GREP])
-m4trace:configure.ac:7: -1- AC_SUBST_TRACE([GREP])
-m4trace:configure.ac:7: -1- m4_pattern_allow([^GREP$])
-m4trace:configure.ac:7: -1- AC_SUBST([EGREP])
-m4trace:configure.ac:7: -1- AC_SUBST_TRACE([EGREP])
-m4trace:configure.ac:7: -1- m4_pattern_allow([^EGREP$])
-m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
-m4trace:configure.ac:7: -1- m4_pattern_allow([^STDC_HEADERS$])
-m4trace:configure.ac:7: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
+m4trace:configure.ac:9: -1- AC_CONFIG_HEADERS([config.h])
+m4trace:configure.ac:10: -1- AC_SUBST([CC])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:10: -1- AC_SUBST([CFLAGS])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CFLAGS])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CFLAGS$])
+m4trace:configure.ac:10: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:10: -1- AC_SUBST([LIBS])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:10: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:10: -1- AC_SUBST([CC])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:10: -1- AC_SUBST([CC])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:10: -1- AC_SUBST([CC])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:10: -1- AC_SUBST([CC])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([ac_ct_CC])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_CC$])
+m4trace:configure.ac:10: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([EXEEXT])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.ac:10: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
+m4trace:configure.ac:10: -1- AC_SUBST_TRACE([OBJEXT])
+m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.ac:11: -1- AC_SUBST([CPP])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:11: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:11: -1- AC_SUBST([CPP])
+m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.ac:11: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:12: -1- AC_SUBST([CXX])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([CXX])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:12: -1- AC_SUBST([CXXFLAGS])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([CXXFLAGS])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^CXXFLAGS$])
+m4trace:configure.ac:12: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:12: -1- AC_SUBST([LIBS])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:12: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:12: -1- AC_SUBST([CXX])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([CXX])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:12: -1- AC_SUBST([ac_ct_CXX])
+m4trace:configure.ac:12: -1- AC_SUBST_TRACE([ac_ct_CXX])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^ac_ct_CXX$])
+m4trace:configure.ac:13: -1- AC_REQUIRE_AUX_FILE([install-sh])
+m4trace:configure.ac:13: -1- AC_SUBST([MKDIR_P])
+m4trace:configure.ac:13: -1- AC_SUBST_TRACE([MKDIR_P])
+m4trace:configure.ac:13: -1- m4_pattern_allow([^MKDIR_P$])
+m4trace:configure.ac:14: -1- AC_SUBST([SED])
+m4trace:configure.ac:14: -1- AC_SUBST_TRACE([SED])
+m4trace:configure.ac:14: -1- m4_pattern_allow([^SED$])
+m4trace:configure.ac:15: -1- AC_REQUIRE_AUX_FILE([install-sh])
+m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.ac:15: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
+m4trace:configure.ac:15: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.ac:15: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
+m4trace:configure.ac:15: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.ac:15: -1- AC_SUBST_TRACE([INSTALL_DATA])
+m4trace:configure.ac:15: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.ac:16: -1- AC_SUBST([LN_S], [$as_ln_s])
+m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LN_S])
+m4trace:configure.ac:16: -1- m4_pattern_allow([^LN_S$])
+m4trace:configure.ac:17: -1- AC_SUBST([RANLIB])
+m4trace:configure.ac:17: -1- AC_SUBST_TRACE([RANLIB])
+m4trace:configure.ac:17: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.ac:18: -1- AC_SUBST([AR])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([AR])
+m4trace:configure.ac:18: -1- m4_pattern_allow([^AR$])
+m4trace:configure.ac:19: -1- AC_SUBST([NM])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([NM])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^NM$])
+m4trace:configure.ac:20: -1- AC_SUBST([WINDRES])
+m4trace:configure.ac:20: -1- AC_SUBST_TRACE([WINDRES])
+m4trace:configure.ac:20: -1- m4_pattern_allow([^WINDRES$])
+m4trace:configure.ac:21: -1- AC_SUBST([PKG_CONFIG])
+m4trace:configure.ac:21: -1- AC_SUBST_TRACE([PKG_CONFIG])
+m4trace:configure.ac:21: -1- m4_pattern_allow([^PKG_CONFIG$])
+m4trace:configure.ac:24: -1- AC_SUBST([MAKE])
+m4trace:configure.ac:24: -1- AC_SUBST_TRACE([MAKE])
+m4trace:configure.ac:24: -1- m4_pattern_allow([^MAKE$])
+m4trace:configure.ac:25: -1- AC_SUBST([GMAKE])
+m4trace:configure.ac:25: -1- AC_SUBST_TRACE([GMAKE])
+m4trace:configure.ac:25: -1- m4_pattern_allow([^GMAKE$])
+m4trace:configure.ac:36: -1- AC_SUBST([WGET])
+m4trace:configure.ac:36: -1- AC_SUBST_TRACE([WGET])
+m4trace:configure.ac:36: -1- m4_pattern_allow([^WGET$])
+m4trace:configure.ac:37: -1- AC_SUBST([CURL])
+m4trace:configure.ac:37: -1- AC_SUBST_TRACE([CURL])
+m4trace:configure.ac:37: -1- m4_pattern_allow([^CURL$])
+m4trace:configure.ac:58: -1- AC_CANONICAL_HOST
+m4trace:configure.ac:58: -1- AC_CANONICAL_BUILD
+m4trace:configure.ac:58: -1- AC_REQUIRE_AUX_FILE([config.sub])
+m4trace:configure.ac:58: -1- AC_REQUIRE_AUX_FILE([config.guess])
+m4trace:configure.ac:58: -1- AC_SUBST([build], [$ac_cv_build])
+m4trace:configure.ac:58: -1- AC_SUBST_TRACE([build])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^build$])
+m4trace:configure.ac:58: -1- AC_SUBST([build_cpu], [$[1]])
+m4trace:configure.ac:58: -1- AC_SUBST_TRACE([build_cpu])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.ac:58: -1- AC_SUBST([build_vendor], [$[2]])
+m4trace:configure.ac:58: -1- AC_SUBST_TRACE([build_vendor])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.ac:58: -1- AC_SUBST([build_os])
+m4trace:configure.ac:58: -1- AC_SUBST_TRACE([build_os])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.ac:58: -1- AC_SUBST([host], [$ac_cv_host])
+m4trace:configure.ac:58: -1- AC_SUBST_TRACE([host])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^host$])
+m4trace:configure.ac:58: -1- AC_SUBST([host_cpu], [$[1]])
+m4trace:configure.ac:58: -1- AC_SUBST_TRACE([host_cpu])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.ac:58: -1- AC_SUBST([host_vendor], [$[2]])
+m4trace:configure.ac:58: -1- AC_SUBST_TRACE([host_vendor])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.ac:58: -1- AC_SUBST([host_os])
+m4trace:configure.ac:58: -1- AC_SUBST_TRACE([host_os])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.ac:59: -1- AC_CANONICAL_BUILD
+m4trace:configure.ac:493: -1- AC_DEFINE_TRACE_LITERAL([USE_FALLBACK_NUMERIC_LIMITS])
+m4trace:configure.ac:493: -1- m4_pattern_allow([^USE_FALLBACK_NUMERIC_LIMITS$])
+m4trace:configure.ac:502: -1- AC_DEFINE_TRACE_LITERAL([USE_PRINTF_SCANF])
+m4trace:configure.ac:502: -1- m4_pattern_allow([^USE_PRINTF_SCANF$])
+m4trace:configure.ac:631: -2- AC_DEFINE_TRACE_LITERAL([HAVE_COMPLEX_H])
+m4trace:configure.ac:631: -2- m4_pattern_allow([^HAVE_COMPLEX_H$])
+m4trace:configure.ac:631: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:631: the top level])
+m4trace:configure.ac:631: -1- AC_SUBST([GREP])
+m4trace:configure.ac:631: -1- AC_SUBST_TRACE([GREP])
+m4trace:configure.ac:631: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.ac:631: -1- AC_SUBST([EGREP])
+m4trace:configure.ac:631: -1- AC_SUBST_TRACE([EGREP])
+m4trace:configure.ac:631: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.ac:631: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
+m4trace:configure.ac:631: -1- m4_pattern_allow([^STDC_HEADERS$])
+m4trace:configure.ac:631: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
@%:@undef STDC_HEADERS])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
@%:@undef HAVE_SYS_TYPES_H])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
@%:@undef HAVE_SYS_STAT_H])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
@%:@undef HAVE_STDLIB_H])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
@%:@undef HAVE_STRING_H])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
@%:@undef HAVE_MEMORY_H])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
@%:@undef HAVE_STRINGS_H])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
@%:@undef HAVE_INTTYPES_H])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
@%:@undef HAVE_STDINT_H])
-m4trace:configure.ac:7: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
+m4trace:configure.ac:631: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
@%:@undef HAVE_UNISTD_H])
-m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN])
-m4trace:configure.ac:7: -1- m4_pattern_allow([^WORDS_BIGENDIAN$])
-m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD])
-m4trace:configure.ac:7: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$])
-m4trace:configure.ac:7: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */
-@%:@undef AC_APPLE_UNIVERSAL_BUILD])
-m4trace:configure.ac:8: -1- AC_REQUIRE_AUX_FILE([install-sh])
-m4trace:configure.ac:8: -1- AC_SUBST([MKDIR_P])
-m4trace:configure.ac:8: -1- AC_SUBST_TRACE([MKDIR_P])
-m4trace:configure.ac:8: -1- m4_pattern_allow([^MKDIR_P$])
-m4trace:configure.ac:9: -1- AC_SUBST([SED])
-m4trace:configure.ac:9: -1- AC_SUBST_TRACE([SED])
-m4trace:configure.ac:9: -1- m4_pattern_allow([^SED$])
-m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([install-sh])
-m4trace:configure.ac:10: -1- AC_SUBST([INSTALL_PROGRAM])
-m4trace:configure.ac:10: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
-m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
-m4trace:configure.ac:10: -1- AC_SUBST([INSTALL_SCRIPT])
-m4trace:configure.ac:10: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
-m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
-m4trace:configure.ac:10: -1- AC_SUBST([INSTALL_DATA])
-m4trace:configure.ac:10: -1- AC_SUBST_TRACE([INSTALL_DATA])
-m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_DATA$])
-m4trace:configure.ac:11: -1- AC_SUBST([LN_S], [$as_ln_s])
-m4trace:configure.ac:11: -1- AC_SUBST_TRACE([LN_S])
-m4trace:configure.ac:11: -1- m4_pattern_allow([^LN_S$])
-m4trace:configure.ac:12: -1- AC_CANONICAL_HOST
-m4trace:configure.ac:12: -1- AC_CANONICAL_BUILD
-m4trace:configure.ac:12: -1- AC_REQUIRE_AUX_FILE([config.sub])
-m4trace:configure.ac:12: -1- AC_REQUIRE_AUX_FILE([config.guess])
-m4trace:configure.ac:12: -1- AC_SUBST([build], [$ac_cv_build])
-m4trace:configure.ac:12: -1- AC_SUBST_TRACE([build])
-m4trace:configure.ac:12: -1- m4_pattern_allow([^build$])
-m4trace:configure.ac:12: -1- AC_SUBST([build_cpu], [$[1]])
-m4trace:configure.ac:12: -1- AC_SUBST_TRACE([build_cpu])
-m4trace:configure.ac:12: -1- m4_pattern_allow([^build_cpu$])
-m4trace:configure.ac:12: -1- AC_SUBST([build_vendor], [$[2]])
-m4trace:configure.ac:12: -1- AC_SUBST_TRACE([build_vendor])
-m4trace:configure.ac:12: -1- m4_pattern_allow([^build_vendor$])
-m4trace:configure.ac:12: -1- AC_SUBST([build_os])
-m4trace:configure.ac:12: -1- AC_SUBST_TRACE([build_os])
-m4trace:configure.ac:12: -1- m4_pattern_allow([^build_os$])
-m4trace:configure.ac:12: -1- AC_SUBST([host], [$ac_cv_host])
-m4trace:configure.ac:12: -1- AC_SUBST_TRACE([host])
-m4trace:configure.ac:12: -1- m4_pattern_allow([^host$])
-m4trace:configure.ac:12: -1- AC_SUBST([host_cpu], [$[1]])
-m4trace:configure.ac:12: -1- AC_SUBST_TRACE([host_cpu])
-m4trace:configure.ac:12: -1- m4_pattern_allow([^host_cpu$])
-m4trace:configure.ac:12: -1- AC_SUBST([host_vendor], [$[2]])
-m4trace:configure.ac:12: -1- AC_SUBST_TRACE([host_vendor])
-m4trace:configure.ac:12: -1- m4_pattern_allow([^host_vendor$])
-m4trace:configure.ac:12: -1- AC_SUBST([host_os])
-m4trace:configure.ac:12: -1- AC_SUBST_TRACE([host_os])
-m4trace:configure.ac:12: -1- m4_pattern_allow([^host_os$])
-m4trace:configure.ac:13: -1- AC_CANONICAL_BUILD
-m4trace:configure.ac:14: -1- AC_SUBST([RANLIB])
-m4trace:configure.ac:14: -1- AC_SUBST_TRACE([RANLIB])
-m4trace:configure.ac:14: -1- m4_pattern_allow([^RANLIB$])
-m4trace:configure.ac:15: -1- AC_SUBST([AR])
-m4trace:configure.ac:15: -1- AC_SUBST_TRACE([AR])
-m4trace:configure.ac:15: -1- m4_pattern_allow([^AR$])
-m4trace:configure.ac:16: -1- AC_SUBST([NM])
-m4trace:configure.ac:16: -1- AC_SUBST_TRACE([NM])
-m4trace:configure.ac:16: -1- m4_pattern_allow([^NM$])
-m4trace:configure.ac:440: -1- AC_SUBST([WGET])
-m4trace:configure.ac:440: -1- AC_SUBST_TRACE([WGET])
-m4trace:configure.ac:440: -1- m4_pattern_allow([^WGET$])
-m4trace:configure.ac:441: -1- AC_SUBST([CURL])
-m4trace:configure.ac:441: -1- AC_SUBST_TRACE([CURL])
-m4trace:configure.ac:441: -1- m4_pattern_allow([^CURL$])
-m4trace:configure.ac:516: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BACKSLASH_AS_SEP])
-m4trace:configure.ac:516: -1- m4_pattern_allow([^HAVE_BACKSLASH_AS_SEP$])
-m4trace:configure.ac:517: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LINE_END_CR_NL])
-m4trace:configure.ac:517: -1- m4_pattern_allow([^HAVE_LINE_END_CR_NL$])
-m4trace:configure.ac:518: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CASE_INSENSITIVE_PATHNAMES])
-m4trace:configure.ac:518: -1- m4_pattern_allow([^HAVE_CASE_INSENSITIVE_PATHNAMES$])
-m4trace:configure.ac:705: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ERRNO_H])
-m4trace:configure.ac:705: -2- m4_pattern_allow([^HAVE_ERRNO_H$])
+m4trace:configure.ac:632: -2- AC_DEFINE_TRACE_LITERAL([HAVE_CTYPE_H])
+m4trace:configure.ac:632: -2- m4_pattern_allow([^HAVE_CTYPE_H$])
+m4trace:configure.ac:632: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:632: the top level])
+m4trace:configure.ac:633: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FENV_H])
+m4trace:configure.ac:633: -2- m4_pattern_allow([^HAVE_FENV_H$])
+m4trace:configure.ac:633: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:633: the top level])
+m4trace:configure.ac:634: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FLOAT_H])
+m4trace:configure.ac:634: -2- m4_pattern_allow([^HAVE_FLOAT_H$])
+m4trace:configure.ac:634: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:634: the top level])
+m4trace:configure.ac:635: -2- AC_DEFINE_TRACE_LITERAL([HAVE_INTTYPES_H])
+m4trace:configure.ac:635: -2- m4_pattern_allow([^HAVE_INTTYPES_H$])
+m4trace:configure.ac:635: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:635: the top level])
+m4trace:configure.ac:636: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ISO646_H])
+m4trace:configure.ac:636: -2- m4_pattern_allow([^HAVE_ISO646_H$])
+m4trace:configure.ac:636: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:636: the top level])
+m4trace:configure.ac:637: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIMITS_H])
+m4trace:configure.ac:637: -2- m4_pattern_allow([^HAVE_LIMITS_H$])
+m4trace:configure.ac:637: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:637: the top level])
+m4trace:configure.ac:638: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LOCALE_H])
+m4trace:configure.ac:638: -2- m4_pattern_allow([^HAVE_LOCALE_H$])
+m4trace:configure.ac:638: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:638: the top level])
+m4trace:configure.ac:639: -2- AC_DEFINE_TRACE_LITERAL([HAVE_MATH_H])
+m4trace:configure.ac:639: -2- m4_pattern_allow([^HAVE_MATH_H$])
+m4trace:configure.ac:639: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:639: the top level])
+m4trace:configure.ac:640: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SETJMP_H])
+m4trace:configure.ac:640: -2- m4_pattern_allow([^HAVE_SETJMP_H$])
+m4trace:configure.ac:640: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:640: the top level])
+m4trace:configure.ac:641: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SIGNAL_H])
+m4trace:configure.ac:641: -2- m4_pattern_allow([^HAVE_SIGNAL_H$])
+m4trace:configure.ac:641: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:641: the top level])
+m4trace:configure.ac:642: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDALIGN_H])
+m4trace:configure.ac:642: -2- m4_pattern_allow([^HAVE_STDALIGN_H$])
+m4trace:configure.ac:642: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:642: the top level])
+m4trace:configure.ac:643: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDARG_H])
+m4trace:configure.ac:643: -2- m4_pattern_allow([^HAVE_STDARG_H$])
+m4trace:configure.ac:643: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:643: the top level])
+m4trace:configure.ac:644: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDATOMIC_H])
+m4trace:configure.ac:644: -2- m4_pattern_allow([^HAVE_STDATOMIC_H$])
+m4trace:configure.ac:644: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:644: the top level])
+m4trace:configure.ac:645: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDBOOL_H])
+m4trace:configure.ac:645: -2- m4_pattern_allow([^HAVE_STDBOOL_H$])
+m4trace:configure.ac:645: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:645: the top level])
+m4trace:configure.ac:646: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDDEF_H])
+m4trace:configure.ac:646: -2- m4_pattern_allow([^HAVE_STDDEF_H$])
+m4trace:configure.ac:646: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:646: the top level])
+m4trace:configure.ac:647: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H])
+m4trace:configure.ac:647: -2- m4_pattern_allow([^HAVE_STDINT_H$])
+m4trace:configure.ac:647: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:647: the top level])
+m4trace:configure.ac:648: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDLIB_H])
+m4trace:configure.ac:648: -2- m4_pattern_allow([^HAVE_STDLIB_H$])
+m4trace:configure.ac:648: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:648: the top level])
+m4trace:configure.ac:649: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYSEXITS_H])
+m4trace:configure.ac:649: -2- m4_pattern_allow([^HAVE_SYSEXITS_H$])
+m4trace:configure.ac:649: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:649: the top level])
+m4trace:configure.ac:650: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDNORETURN_H])
+m4trace:configure.ac:650: -2- m4_pattern_allow([^HAVE_STDNORETURN_H$])
+m4trace:configure.ac:650: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:650: the top level])
+m4trace:configure.ac:651: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STRING_H])
+m4trace:configure.ac:651: -2- m4_pattern_allow([^HAVE_STRING_H$])
+m4trace:configure.ac:651: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:651: the top level])
+m4trace:configure.ac:652: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TGMATH_H])
+m4trace:configure.ac:652: -2- m4_pattern_allow([^HAVE_TGMATH_H$])
+m4trace:configure.ac:652: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:652: the top level])
+m4trace:configure.ac:653: -2- AC_DEFINE_TRACE_LITERAL([HAVE_THREADS_H])
+m4trace:configure.ac:653: -2- m4_pattern_allow([^HAVE_THREADS_H$])
+m4trace:configure.ac:653: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:653: the top level])
+m4trace:configure.ac:654: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TIME_H])
+m4trace:configure.ac:654: -2- m4_pattern_allow([^HAVE_TIME_H$])
+m4trace:configure.ac:654: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:654: the top level])
+m4trace:configure.ac:655: -2- AC_DEFINE_TRACE_LITERAL([HAVE_UCHAR_H])
+m4trace:configure.ac:655: -2- m4_pattern_allow([^HAVE_UCHAR_H$])
+m4trace:configure.ac:655: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:655: the top level])
+m4trace:configure.ac:656: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WCHAR_H])
+m4trace:configure.ac:656: -2- m4_pattern_allow([^HAVE_WCHAR_H$])
+m4trace:configure.ac:656: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:656: the top level])
+m4trace:configure.ac:657: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WCTYPE_H])
+m4trace:configure.ac:657: -2- m4_pattern_allow([^HAVE_WCTYPE_H$])
+m4trace:configure.ac:657: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:657: the top level])
+m4trace:configure.ac:658: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ERRNO_H])
+m4trace:configure.ac:658: -2- m4_pattern_allow([^HAVE_ERRNO_H$])
+m4trace:configure.ac:658: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:658: the top level])
+m4trace:configure.ac:660: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:660: the top level])
+m4trace:configure.ac:660: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ASSERT_H])
+m4trace:configure.ac:660: -1- m4_pattern_allow([^HAVE_ASSERT_H$])
+m4trace:configure.ac:677: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TYPES_H])
+m4trace:configure.ac:677: -2- m4_pattern_allow([^HAVE_SYS_TYPES_H$])
+m4trace:configure.ac:677: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:677: the top level])
+m4trace:configure.ac:678: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_PARAM_H])
+m4trace:configure.ac:678: -2- m4_pattern_allow([^HAVE_SYS_PARAM_H$])
+m4trace:configure.ac:678: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:678: the top level])
+m4trace:configure.ac:679: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_STAT_H])
+m4trace:configure.ac:679: -2- m4_pattern_allow([^HAVE_SYS_STAT_H$])
+m4trace:configure.ac:679: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:679: the top level])
+m4trace:configure.ac:680: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TIME_H])
+m4trace:configure.ac:680: -2- m4_pattern_allow([^HAVE_SYS_TIME_H$])
+m4trace:configure.ac:680: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:680: the top level])
+m4trace:configure.ac:681: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SOCKET_H])
+m4trace:configure.ac:681: -2- m4_pattern_allow([^HAVE_SYS_SOCKET_H$])
+m4trace:configure.ac:681: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:681: the top level])
+m4trace:configure.ac:682: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SELECT_H])
+m4trace:configure.ac:682: -2- m4_pattern_allow([^HAVE_SYS_SELECT_H$])
+m4trace:configure.ac:682: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:682: the top level])
+m4trace:configure.ac:683: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_UN_H])
+m4trace:configure.ac:683: -2- m4_pattern_allow([^HAVE_SYS_UN_H$])
+m4trace:configure.ac:683: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:683: the top level])
+m4trace:configure.ac:684: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NETINET_IN_H])
+m4trace:configure.ac:684: -2- m4_pattern_allow([^HAVE_NETINET_IN_H$])
+m4trace:configure.ac:684: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:684: the top level])
+m4trace:configure.ac:685: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NETINET_IN6_H])
+m4trace:configure.ac:685: -2- m4_pattern_allow([^HAVE_NETINET_IN6_H$])
+m4trace:configure.ac:685: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:685: the top level])
+m4trace:configure.ac:686: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NETDB_H])
+m4trace:configure.ac:686: -2- m4_pattern_allow([^HAVE_NETDB_H$])
+m4trace:configure.ac:686: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:686: the top level])
+m4trace:configure.ac:687: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ARPA_INET_H])
+m4trace:configure.ac:687: -2- m4_pattern_allow([^HAVE_ARPA_INET_H$])
+m4trace:configure.ac:687: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:687: the top level])
+m4trace:configure.ac:688: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H])
+m4trace:configure.ac:688: -2- m4_pattern_allow([^HAVE_WINSOCK2_H$])
+m4trace:configure.ac:688: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:688: the top level])
+m4trace:configure.ac:689: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WS2TCPIP_H])
+m4trace:configure.ac:689: -2- m4_pattern_allow([^HAVE_WS2TCPIP_H$])
+m4trace:configure.ac:689: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:689: the top level])
+m4trace:configure.ac:690: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WINDOWS_H])
+m4trace:configure.ac:690: -2- m4_pattern_allow([^HAVE_WINDOWS_H$])
+m4trace:configure.ac:690: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:690: the top level])
+m4trace:configure.ac:691: -2- AC_DEFINE_TRACE_LITERAL([HAVE_UNISTD_H])
+m4trace:configure.ac:691: -2- m4_pattern_allow([^HAVE_UNISTD_H$])
+m4trace:configure.ac:691: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:691: the top level])
+m4trace:configure.ac:692: -2- AC_DEFINE_TRACE_LITERAL([HAVE_PROCESS_H])
+m4trace:configure.ac:692: -2- m4_pattern_allow([^HAVE_PROCESS_H$])
+m4trace:configure.ac:692: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:692: the top level])
+m4trace:configure.ac:693: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FCNTL_H])
+m4trace:configure.ac:693: -2- m4_pattern_allow([^HAVE_FCNTL_H$])
+m4trace:configure.ac:693: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:693: the top level])
+m4trace:configure.ac:694: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHARE_H])
+m4trace:configure.ac:694: -2- m4_pattern_allow([^HAVE_SHARE_H$])
+m4trace:configure.ac:694: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:694: the top level])
+m4trace:configure.ac:695: -2- AC_DEFINE_TRACE_LITERAL([HAVE_PWD_H])
+m4trace:configure.ac:695: -2- m4_pattern_allow([^HAVE_PWD_H$])
+m4trace:configure.ac:695: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:695: the top level])
+m4trace:configure.ac:696: -2- AC_DEFINE_TRACE_LITERAL([HAVE_MEMORY_H])
+m4trace:configure.ac:696: -2- m4_pattern_allow([^HAVE_MEMORY_H$])
+m4trace:configure.ac:696: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:696: the top level])
+m4trace:configure.ac:697: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STRINGS_H])
+m4trace:configure.ac:697: -2- m4_pattern_allow([^HAVE_STRINGS_H$])
+m4trace:configure.ac:697: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:697: the top level])
+m4trace:configure.ac:698: -2- AC_DEFINE_TRACE_LITERAL([HAVE_IO_H])
+m4trace:configure.ac:698: -2- m4_pattern_allow([^HAVE_IO_H$])
+m4trace:configure.ac:698: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:698: the top level])
+m4trace:configure.ac:699: -2- AC_DEFINE_TRACE_LITERAL([HAVE_BIOS_H])
+m4trace:configure.ac:699: -2- m4_pattern_allow([^HAVE_BIOS_H$])
+m4trace:configure.ac:699: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:699: the top level])
+m4trace:configure.ac:700: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SEARCH_H])
+m4trace:configure.ac:700: -2- m4_pattern_allow([^HAVE_SEARCH_H$])
+m4trace:configure.ac:700: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:700: the top level])
+m4trace:configure.ac:701: -2- AC_DEFINE_TRACE_LITERAL([HAVE_DOS_H])
+m4trace:configure.ac:701: -2- m4_pattern_allow([^HAVE_DOS_H$])
+m4trace:configure.ac:701: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:701: the top level])
+m4trace:configure.ac:702: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOC_H])
+m4trace:configure.ac:702: -2- m4_pattern_allow([^HAVE_ALLOC_H$])
+m4trace:configure.ac:702: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:702: the top level])
+m4trace:configure.ac:703: -2- AC_DEFINE_TRACE_LITERAL([HAVE_MALLOC_H])
+m4trace:configure.ac:703: -2- m4_pattern_allow([^HAVE_MALLOC_H$])
+m4trace:configure.ac:703: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:703: the top level])
+m4trace:configure.ac:704: -2- AC_DEFINE_TRACE_LITERAL([HAVE_DIRENT_H])
+m4trace:configure.ac:704: -2- m4_pattern_allow([^HAVE_DIRENT_H$])
+m4trace:configure.ac:704: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:704: the top level])
+m4trace:configure.ac:705: -2- AC_DEFINE_TRACE_LITERAL([HAVE_DIRECT_H])
+m4trace:configure.ac:705: -2- m4_pattern_allow([^HAVE_DIRECT_H$])
m4trace:configure.ac:705: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:705: the top level])
-m4trace:configure.ac:706: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ASSERT_H])
-m4trace:configure.ac:706: -2- m4_pattern_allow([^HAVE_ASSERT_H$])
+m4trace:configure.ac:706: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDIO_H])
+m4trace:configure.ac:706: -2- m4_pattern_allow([^HAVE_STDIO_H$])
m4trace:configure.ac:706: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:706: the top level])
-m4trace:configure.ac:707: -2- AC_DEFINE_TRACE_LITERAL([HAVE_COMPLEX_H])
-m4trace:configure.ac:707: -2- m4_pattern_allow([^HAVE_COMPLEX_H$])
+m4trace:configure.ac:707: -2- AC_DEFINE_TRACE_LITERAL([HAVE_CONIO_H])
+m4trace:configure.ac:707: -2- m4_pattern_allow([^HAVE_CONIO_H$])
m4trace:configure.ac:707: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:707: the top level])
-m4trace:configure.ac:708: -2- AC_DEFINE_TRACE_LITERAL([HAVE_CTYPE_H])
-m4trace:configure.ac:708: -2- m4_pattern_allow([^HAVE_CTYPE_H$])
+m4trace:configure.ac:708: -2- AC_DEFINE_TRACE_LITERAL([HAVE_GRP_H])
+m4trace:configure.ac:708: -2- m4_pattern_allow([^HAVE_GRP_H$])
m4trace:configure.ac:708: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:708: the top level])
-m4trace:configure.ac:709: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FENV_H])
-m4trace:configure.ac:709: -2- m4_pattern_allow([^HAVE_FENV_H$])
+m4trace:configure.ac:709: -2- AC_DEFINE_TRACE_LITERAL([HAVE_DIR_H])
+m4trace:configure.ac:709: -2- m4_pattern_allow([^HAVE_DIR_H$])
m4trace:configure.ac:709: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:709: the top level])
-m4trace:configure.ac:710: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FLOAT_H])
-m4trace:configure.ac:710: -2- m4_pattern_allow([^HAVE_FLOAT_H$])
+m4trace:configure.ac:710: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ERR_H])
+m4trace:configure.ac:710: -2- m4_pattern_allow([^HAVE_ERR_H$])
m4trace:configure.ac:710: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:710: the top level])
-m4trace:configure.ac:711: -2- AC_DEFINE_TRACE_LITERAL([HAVE_INTTYPES_H])
-m4trace:configure.ac:711: -2- m4_pattern_allow([^HAVE_INTTYPES_H$])
+m4trace:configure.ac:711: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHADOW_H])
+m4trace:configure.ac:711: -2- m4_pattern_allow([^HAVE_SHADOW_H$])
m4trace:configure.ac:711: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:711: the top level])
-m4trace:configure.ac:712: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ISO646_H])
-m4trace:configure.ac:712: -2- m4_pattern_allow([^HAVE_ISO646_H$])
+m4trace:configure.ac:712: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STROPTS_H])
+m4trace:configure.ac:712: -2- m4_pattern_allow([^HAVE_STROPTS_H$])
m4trace:configure.ac:712: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:712: the top level])
-m4trace:configure.ac:713: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIMITS_H])
-m4trace:configure.ac:713: -2- m4_pattern_allow([^HAVE_LIMITS_H$])
+m4trace:configure.ac:713: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYSLOG_H])
+m4trace:configure.ac:713: -2- m4_pattern_allow([^HAVE_SYSLOG_H$])
m4trace:configure.ac:713: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:713: the top level])
-m4trace:configure.ac:714: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LOCALE_H])
-m4trace:configure.ac:714: -2- m4_pattern_allow([^HAVE_LOCALE_H$])
+m4trace:configure.ac:714: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYSRES_H])
+m4trace:configure.ac:714: -2- m4_pattern_allow([^HAVE_SYSRES_H$])
m4trace:configure.ac:714: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:714: the top level])
-m4trace:configure.ac:715: -2- AC_DEFINE_TRACE_LITERAL([HAVE_MATH_H])
-m4trace:configure.ac:715: -2- m4_pattern_allow([^HAVE_MATH_H$])
+m4trace:configure.ac:715: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TERMIOS_H])
+m4trace:configure.ac:715: -2- m4_pattern_allow([^HAVE_TERMIOS_H$])
m4trace:configure.ac:715: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:715: the top level])
-m4trace:configure.ac:716: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SETJMP_H])
-m4trace:configure.ac:716: -2- m4_pattern_allow([^HAVE_SETJMP_H$])
+m4trace:configure.ac:716: -2- AC_DEFINE_TRACE_LITERAL([HAVE_VARARG_H])
+m4trace:configure.ac:716: -2- m4_pattern_allow([^HAVE_VARARG_H$])
m4trace:configure.ac:716: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:716: the top level])
-m4trace:configure.ac:717: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SIGNAL_H])
-m4trace:configure.ac:717: -2- m4_pattern_allow([^HAVE_SIGNAL_H$])
+m4trace:configure.ac:717: -2- AC_DEFINE_TRACE_LITERAL([HAVE_VARARGS_H])
+m4trace:configure.ac:717: -2- m4_pattern_allow([^HAVE_VARARGS_H$])
m4trace:configure.ac:717: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:717: the top level])
-m4trace:configure.ac:718: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDALIGN_H])
-m4trace:configure.ac:718: -2- m4_pattern_allow([^HAVE_STDALIGN_H$])
+m4trace:configure.ac:718: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NTIFS_H])
+m4trace:configure.ac:718: -2- m4_pattern_allow([^HAVE_NTIFS_H$])
m4trace:configure.ac:718: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:718: the top level])
-m4trace:configure.ac:719: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDARG_H])
-m4trace:configure.ac:719: -2- m4_pattern_allow([^HAVE_STDARG_H$])
+m4trace:configure.ac:719: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_FILE_H])
+m4trace:configure.ac:719: -2- m4_pattern_allow([^HAVE_SYS_FILE_H$])
m4trace:configure.ac:719: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:719: the top level])
-m4trace:configure.ac:720: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDATOMIC_H])
-m4trace:configure.ac:720: -2- m4_pattern_allow([^HAVE_STDATOMIC_H$])
+m4trace:configure.ac:720: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_RESOURCE_H])
+m4trace:configure.ac:720: -2- m4_pattern_allow([^HAVE_SYS_RESOURCE_H$])
m4trace:configure.ac:720: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:720: the top level])
-m4trace:configure.ac:721: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDBOOL_H])
-m4trace:configure.ac:721: -2- m4_pattern_allow([^HAVE_STDBOOL_H$])
+m4trace:configure.ac:721: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_STATVFS_H])
+m4trace:configure.ac:721: -2- m4_pattern_allow([^HAVE_SYS_STATVFS_H$])
m4trace:configure.ac:721: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:721: the top level])
-m4trace:configure.ac:722: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDDEF_H])
-m4trace:configure.ac:722: -2- m4_pattern_allow([^HAVE_STDDEF_H$])
+m4trace:configure.ac:722: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_STROPTS_H])
+m4trace:configure.ac:722: -2- m4_pattern_allow([^HAVE_SYS_STROPTS_H$])
m4trace:configure.ac:722: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:722: the top level])
-m4trace:configure.ac:723: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H])
-m4trace:configure.ac:723: -2- m4_pattern_allow([^HAVE_STDINT_H$])
+m4trace:configure.ac:723: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SUNDDI_H])
+m4trace:configure.ac:723: -2- m4_pattern_allow([^HAVE_SYS_SUNDDI_H$])
m4trace:configure.ac:723: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:723: the top level])
-m4trace:configure.ac:724: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDLIB_H])
-m4trace:configure.ac:724: -2- m4_pattern_allow([^HAVE_STDLIB_H$])
+m4trace:configure.ac:724: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SYSCTL_H])
+m4trace:configure.ac:724: -2- m4_pattern_allow([^HAVE_SYS_SYSCTL_H$])
m4trace:configure.ac:724: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:724: the top level])
-m4trace:configure.ac:725: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDNORETURN_H])
-m4trace:configure.ac:725: -2- m4_pattern_allow([^HAVE_STDNORETURN_H$])
+m4trace:configure.ac:725: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SYSTEMINFO_H])
+m4trace:configure.ac:725: -2- m4_pattern_allow([^HAVE_SYS_SYSTEMINFO_H$])
m4trace:configure.ac:725: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:725: the top level])
-m4trace:configure.ac:726: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STRING_H])
-m4trace:configure.ac:726: -2- m4_pattern_allow([^HAVE_STRING_H$])
+m4trace:configure.ac:726: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TERMIOS_H])
+m4trace:configure.ac:726: -2- m4_pattern_allow([^HAVE_SYS_TERMIOS_H$])
m4trace:configure.ac:726: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:726: the top level])
-m4trace:configure.ac:727: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TGMATH_H])
-m4trace:configure.ac:727: -2- m4_pattern_allow([^HAVE_TGMATH_H$])
+m4trace:configure.ac:727: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TTOLD_H])
+m4trace:configure.ac:727: -2- m4_pattern_allow([^HAVE_SYS_TTOLD_H$])
m4trace:configure.ac:727: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:727: the top level])
-m4trace:configure.ac:728: -2- AC_DEFINE_TRACE_LITERAL([HAVE_THREADS_H])
-m4trace:configure.ac:728: -2- m4_pattern_allow([^HAVE_THREADS_H$])
+m4trace:configure.ac:728: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_UIO_H])
+m4trace:configure.ac:728: -2- m4_pattern_allow([^HAVE_SYS_UIO_H$])
m4trace:configure.ac:728: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:728: the top level])
-m4trace:configure.ac:729: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TIME_H])
-m4trace:configure.ac:729: -2- m4_pattern_allow([^HAVE_TIME_H$])
+m4trace:configure.ac:729: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_WAIT_H])
+m4trace:configure.ac:729: -2- m4_pattern_allow([^HAVE_SYS_WAIT_H$])
m4trace:configure.ac:729: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:729: the top level])
-m4trace:configure.ac:730: -2- AC_DEFINE_TRACE_LITERAL([HAVE_UCHAR_H])
-m4trace:configure.ac:730: -2- m4_pattern_allow([^HAVE_UCHAR_H$])
+m4trace:configure.ac:730: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LPRNG_H])
+m4trace:configure.ac:730: -2- m4_pattern_allow([^HAVE_LPRNG_H$])
m4trace:configure.ac:730: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:730: the top level])
-m4trace:configure.ac:731: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WCHAR_H])
-m4trace:configure.ac:731: -2- m4_pattern_allow([^HAVE_WCHAR_H$])
m4trace:configure.ac:731: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:731: the top level])
-m4trace:configure.ac:732: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WCTYPE_H])
-m4trace:configure.ac:732: -2- m4_pattern_allow([^HAVE_WCTYPE_H$])
-m4trace:configure.ac:732: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:732: the top level])
-m4trace:configure.ac:737: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TYPES_H])
-m4trace:configure.ac:737: -2- m4_pattern_allow([^HAVE_SYS_TYPES_H$])
-m4trace:configure.ac:737: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:737: the top level])
-m4trace:configure.ac:738: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_PARAM_H])
-m4trace:configure.ac:738: -2- m4_pattern_allow([^HAVE_SYS_PARAM_H$])
-m4trace:configure.ac:738: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:738: the top level])
-m4trace:configure.ac:739: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_STAT_H])
-m4trace:configure.ac:739: -2- m4_pattern_allow([^HAVE_SYS_STAT_H$])
+m4trace:configure.ac:731: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PTHREAD_H])
+m4trace:configure.ac:731: -1- m4_pattern_allow([^HAVE_PTHREAD_H$])
+m4trace:configure.ac:735: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME])
+m4trace:configure.ac:735: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$])
+m4trace:configure.ac:735: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+@%:@undef TIME_WITH_SYS_TIME])
m4trace:configure.ac:739: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:739: the top level])
-m4trace:configure.ac:740: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TIME_H])
-m4trace:configure.ac:740: -2- m4_pattern_allow([^HAVE_SYS_TIME_H$])
-m4trace:configure.ac:740: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:740: the top level])
-m4trace:configure.ac:741: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SOCKET_H])
-m4trace:configure.ac:741: -2- m4_pattern_allow([^HAVE_SYS_SOCKET_H$])
-m4trace:configure.ac:741: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:741: the top level])
-m4trace:configure.ac:742: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SELECT_H])
-m4trace:configure.ac:742: -2- m4_pattern_allow([^HAVE_SYS_SELECT_H$])
-m4trace:configure.ac:742: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:742: the top level])
-m4trace:configure.ac:743: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_UN_H])
-m4trace:configure.ac:743: -2- m4_pattern_allow([^HAVE_SYS_UN_H$])
-m4trace:configure.ac:743: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:743: the top level])
-m4trace:configure.ac:744: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NETINET_IN_H])
-m4trace:configure.ac:744: -2- m4_pattern_allow([^HAVE_NETINET_IN_H$])
+m4trace:configure.ac:739: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINBASE_H])
+m4trace:configure.ac:739: -1- m4_pattern_allow([^HAVE_WINBASE_H$])
m4trace:configure.ac:744: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:744: the top level])
-m4trace:configure.ac:745: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NETINET_IN6_H])
-m4trace:configure.ac:745: -2- m4_pattern_allow([^HAVE_NETINET_IN6_H$])
-m4trace:configure.ac:745: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:745: the top level])
-m4trace:configure.ac:746: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NETDB_H])
-m4trace:configure.ac:746: -2- m4_pattern_allow([^HAVE_NETDB_H$])
-m4trace:configure.ac:746: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:746: the top level])
-m4trace:configure.ac:747: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ARPA_INET_H])
-m4trace:configure.ac:747: -2- m4_pattern_allow([^HAVE_ARPA_INET_H$])
-m4trace:configure.ac:747: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:747: the top level])
-m4trace:configure.ac:748: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WINSOCK2_H])
-m4trace:configure.ac:748: -2- m4_pattern_allow([^HAVE_WINSOCK2_H$])
-m4trace:configure.ac:748: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:748: the top level])
-m4trace:configure.ac:749: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WS2TCPIP_H])
-m4trace:configure.ac:749: -2- m4_pattern_allow([^HAVE_WS2TCPIP_H$])
-m4trace:configure.ac:749: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:749: the top level])
-m4trace:configure.ac:750: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WINDOWS_H])
-m4trace:configure.ac:750: -2- m4_pattern_allow([^HAVE_WINDOWS_H$])
-m4trace:configure.ac:750: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:750: the top level])
-m4trace:configure.ac:751: -2- AC_DEFINE_TRACE_LITERAL([HAVE_UNISTD_H])
-m4trace:configure.ac:751: -2- m4_pattern_allow([^HAVE_UNISTD_H$])
-m4trace:configure.ac:751: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:751: the top level])
-m4trace:configure.ac:752: -2- AC_DEFINE_TRACE_LITERAL([HAVE_PROCESS_H])
-m4trace:configure.ac:752: -2- m4_pattern_allow([^HAVE_PROCESS_H$])
+m4trace:configure.ac:744: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINREG_H])
+m4trace:configure.ac:744: -1- m4_pattern_allow([^HAVE_WINREG_H$])
m4trace:configure.ac:752: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:752: the top level])
-m4trace:configure.ac:753: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FCNTL_H])
-m4trace:configure.ac:753: -2- m4_pattern_allow([^HAVE_FCNTL_H$])
-m4trace:configure.ac:753: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:753: the top level])
-m4trace:configure.ac:754: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHARE_H])
-m4trace:configure.ac:754: -2- m4_pattern_allow([^HAVE_SHARE_H$])
-m4trace:configure.ac:754: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:754: the top level])
-m4trace:configure.ac:755: -2- AC_DEFINE_TRACE_LITERAL([HAVE_PWD_H])
-m4trace:configure.ac:755: -2- m4_pattern_allow([^HAVE_PWD_H$])
-m4trace:configure.ac:755: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:755: the top level])
-m4trace:configure.ac:756: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STRINGS_H])
-m4trace:configure.ac:756: -2- m4_pattern_allow([^HAVE_STRINGS_H$])
-m4trace:configure.ac:756: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:756: the top level])
-m4trace:configure.ac:757: -2- AC_DEFINE_TRACE_LITERAL([HAVE_IO_H])
-m4trace:configure.ac:757: -2- m4_pattern_allow([^HAVE_IO_H$])
-m4trace:configure.ac:757: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:757: the top level])
-m4trace:configure.ac:758: -2- AC_DEFINE_TRACE_LITERAL([HAVE_BIOS_H])
-m4trace:configure.ac:758: -2- m4_pattern_allow([^HAVE_BIOS_H$])
-m4trace:configure.ac:758: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:758: the top level])
-m4trace:configure.ac:759: -2- AC_DEFINE_TRACE_LITERAL([HAVE_DOS_H])
-m4trace:configure.ac:759: -2- m4_pattern_allow([^HAVE_DOS_H$])
-m4trace:configure.ac:759: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:759: the top level])
-m4trace:configure.ac:760: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOC_H])
-m4trace:configure.ac:760: -2- m4_pattern_allow([^HAVE_ALLOC_H$])
-m4trace:configure.ac:760: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:760: the top level])
-m4trace:configure.ac:761: -2- AC_DEFINE_TRACE_LITERAL([HAVE_MALLOC_H])
-m4trace:configure.ac:761: -2- m4_pattern_allow([^HAVE_MALLOC_H$])
-m4trace:configure.ac:761: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:761: the top level])
-m4trace:configure.ac:762: -2- AC_DEFINE_TRACE_LITERAL([HAVE_DIRENT_H])
-m4trace:configure.ac:762: -2- m4_pattern_allow([^HAVE_DIRENT_H$])
-m4trace:configure.ac:762: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:762: the top level])
-m4trace:configure.ac:763: -2- AC_DEFINE_TRACE_LITERAL([HAVE_DIRECT_H])
-m4trace:configure.ac:763: -2- m4_pattern_allow([^HAVE_DIRECT_H$])
-m4trace:configure.ac:763: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:763: the top level])
+m4trace:configure.ac:752: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINCON_H])
+m4trace:configure.ac:752: -1- m4_pattern_allow([^HAVE_WINCON_H$])
m4trace:configure.ac:764: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:764: the top level])
m4trace:configure.ac:764: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ZLIB_H])
m4trace:configure.ac:764: -1- m4_pattern_allow([^HAVE_ZLIB_H$])
-m4trace:configure.ac:765: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:765: the top level])
-m4trace:configure.ac:765: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BZLIB_H])
-m4trace:configure.ac:765: -1- m4_pattern_allow([^HAVE_BZLIB_H$])
-m4trace:configure.ac:770: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:770: the top level])
-m4trace:configure.ac:770: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL_RAND_H])
-m4trace:configure.ac:770: -1- m4_pattern_allow([^HAVE_OPENSSL_RAND_H$])
-m4trace:configure.ac:775: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:775: the top level])
-m4trace:configure.ac:775: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL_MD5_H])
-m4trace:configure.ac:775: -1- m4_pattern_allow([^HAVE_OPENSSL_MD5_H$])
-m4trace:configure.ac:776: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:776: the top level])
-m4trace:configure.ac:776: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL_SHA_H])
-m4trace:configure.ac:776: -1- m4_pattern_allow([^HAVE_OPENSSL_SHA_H$])
-m4trace:configure.ac:777: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:777: the top level])
-m4trace:configure.ac:777: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL_RIPEMD_H])
-m4trace:configure.ac:777: -1- m4_pattern_allow([^HAVE_OPENSSL_RIPEMD_H$])
-m4trace:configure.ac:780: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME])
-m4trace:configure.ac:780: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$])
-m4trace:configure.ac:780: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-@%:@undef TIME_WITH_SYS_TIME])
-m4trace:configure.ac:784: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
+m4trace:configure.ac:766: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:766: the top level])
+m4trace:configure.ac:766: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BZLIB_H])
+m4trace:configure.ac:766: -1- m4_pattern_allow([^HAVE_BZLIB_H$])
+m4trace:configure.ac:772: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:772: the top level])
+m4trace:configure.ac:772: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL_RAND_H])
+m4trace:configure.ac:772: -1- m4_pattern_allow([^HAVE_OPENSSL_RAND_H$])
+m4trace:configure.ac:783: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:783: the top level])
+m4trace:configure.ac:783: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL_MD5_H])
+m4trace:configure.ac:783: -1- m4_pattern_allow([^HAVE_OPENSSL_MD5_H$])
+m4trace:configure.ac:784: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
configure.ac:784: the top level])
-m4trace:configure.ac:784: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LONG_LONG])
-m4trace:configure.ac:784: -1- m4_pattern_allow([^HAVE_LONG_LONG$])
-m4trace:configure.ac:793: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:793: the top level])
-m4trace:configure.ac:793: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LONG_DOUBLE])
-m4trace:configure.ac:793: -1- m4_pattern_allow([^HAVE_LONG_DOUBLE$])
-m4trace:configure.ac:804: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:804: the top level])
-m4trace:configure.ac:804: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTMAX_T])
-m4trace:configure.ac:804: -1- m4_pattern_allow([^HAVE_INTMAX_T$])
-m4trace:configure.ac:818: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:818: the top level])
-m4trace:configure.ac:818: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VOLATILE])
-m4trace:configure.ac:818: -1- m4_pattern_allow([^HAVE_VOLATILE$])
-m4trace:configure.ac:826: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:826: the top level])
-m4trace:configure.ac:826: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIG_ATOMIC_T])
-m4trace:configure.ac:826: -1- m4_pattern_allow([^HAVE_SIG_ATOMIC_T$])
-m4trace:configure.ac:834: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT])
-m4trace:configure.ac:834: -1- m4_pattern_allow([^SIZEOF_SHORT$])
-m4trace:configure.ac:834: -1- AH_OUTPUT([SIZEOF_SHORT], [/* The size of `short\', as computed by sizeof. */
+m4trace:configure.ac:784: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL_SHA_H])
+m4trace:configure.ac:784: -1- m4_pattern_allow([^HAVE_OPENSSL_SHA_H$])
+m4trace:configure.ac:785: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:785: the top level])
+m4trace:configure.ac:785: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL_RIPEMD_H])
+m4trace:configure.ac:785: -1- m4_pattern_allow([^HAVE_OPENSSL_RIPEMD_H$])
+m4trace:configure.ac:786: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHA224])
+m4trace:configure.ac:786: -2- m4_pattern_allow([^HAVE_SHA224$])
+m4trace:configure.ac:787: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHA256])
+m4trace:configure.ac:787: -2- m4_pattern_allow([^HAVE_SHA256$])
+m4trace:configure.ac:788: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHA384])
+m4trace:configure.ac:788: -2- m4_pattern_allow([^HAVE_SHA384$])
+m4trace:configure.ac:789: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHA512])
+m4trace:configure.ac:789: -2- m4_pattern_allow([^HAVE_SHA512$])
+m4trace:configure.ac:797: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:797: the top level])
+m4trace:configure.ac:797: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LONG_LONG])
+m4trace:configure.ac:797: -1- m4_pattern_allow([^HAVE_LONG_LONG$])
+m4trace:configure.ac:807: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:807: the top level])
+m4trace:configure.ac:807: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LONG_DOUBLE])
+m4trace:configure.ac:807: -1- m4_pattern_allow([^HAVE_LONG_DOUBLE$])
+m4trace:configure.ac:819: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:819: the top level])
+m4trace:configure.ac:819: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTMAX_T])
+m4trace:configure.ac:819: -1- m4_pattern_allow([^HAVE_INTMAX_T$])
+m4trace:configure.ac:834: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:834: the top level])
+m4trace:configure.ac:834: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIG_ATOMIC_T])
+m4trace:configure.ac:834: -1- m4_pattern_allow([^HAVE_SIG_ATOMIC_T$])
+m4trace:configure.ac:844: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:844: the top level])
+m4trace:configure.ac:844: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SSIZE_T])
+m4trace:configure.ac:844: -1- m4_pattern_allow([^HAVE_SSIZE_T$])
+m4trace:configure.ac:861: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:861: the top level])
+m4trace:configure.ac:861: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT8_T])
+m4trace:configure.ac:861: -1- m4_pattern_allow([^HAVE_INT8_T$])
+m4trace:configure.ac:881: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:881: the top level])
+m4trace:configure.ac:881: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT16_T])
+m4trace:configure.ac:881: -1- m4_pattern_allow([^HAVE_INT16_T$])
+m4trace:configure.ac:901: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:901: the top level])
+m4trace:configure.ac:901: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT32_T])
+m4trace:configure.ac:901: -1- m4_pattern_allow([^HAVE_INT32_T$])
+m4trace:configure.ac:921: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:921: the top level])
+m4trace:configure.ac:921: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINT8_T])
+m4trace:configure.ac:921: -1- m4_pattern_allow([^HAVE_UINT8_T$])
+m4trace:configure.ac:941: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:941: the top level])
+m4trace:configure.ac:941: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINT16_T])
+m4trace:configure.ac:941: -1- m4_pattern_allow([^HAVE_UINT16_T$])
+m4trace:configure.ac:961: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:961: the top level])
+m4trace:configure.ac:961: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINT32_T])
+m4trace:configure.ac:961: -1- m4_pattern_allow([^HAVE_UINT32_T$])
+m4trace:configure.ac:981: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:981: the top level])
+m4trace:configure.ac:981: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_T])
+m4trace:configure.ac:981: -1- m4_pattern_allow([^HAVE_DEV_T$])
+m4trace:configure.ac:1000: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1000: the top level])
+m4trace:configure.ac:1000: -1- AC_DEFINE_TRACE_LITERAL([HAVE__DEV_T])
+m4trace:configure.ac:1000: -1- m4_pattern_allow([^HAVE__DEV_T$])
+m4trace:configure.ac:1019: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1019: the top level])
+m4trace:configure.ac:1019: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INO_T])
+m4trace:configure.ac:1019: -1- m4_pattern_allow([^HAVE_INO_T$])
+m4trace:configure.ac:1038: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1038: the top level])
+m4trace:configure.ac:1038: -1- AC_DEFINE_TRACE_LITERAL([HAVE__INO_T])
+m4trace:configure.ac:1038: -1- m4_pattern_allow([^HAVE__INO_T$])
+m4trace:configure.ac:1057: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1057: the top level])
+m4trace:configure.ac:1057: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INO64_T])
+m4trace:configure.ac:1057: -1- m4_pattern_allow([^HAVE_INO64_T$])
+m4trace:configure.ac:1077: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1077: the top level])
+m4trace:configure.ac:1077: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MODE_T])
+m4trace:configure.ac:1077: -1- m4_pattern_allow([^HAVE_MODE_T$])
+m4trace:configure.ac:1096: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1096: the top level])
+m4trace:configure.ac:1096: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NLINK_T])
+m4trace:configure.ac:1096: -1- m4_pattern_allow([^HAVE_NLINK_T$])
+m4trace:configure.ac:1115: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1115: the top level])
+m4trace:configure.ac:1115: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OFF_T])
+m4trace:configure.ac:1115: -1- m4_pattern_allow([^HAVE_OFF_T$])
+m4trace:configure.ac:1134: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1134: the top level])
+m4trace:configure.ac:1134: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OFF64_T])
+m4trace:configure.ac:1134: -1- m4_pattern_allow([^HAVE_OFF64_T$])
+m4trace:configure.ac:1154: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1154: the top level])
+m4trace:configure.ac:1154: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BLKSIZE_T])
+m4trace:configure.ac:1154: -1- m4_pattern_allow([^HAVE_BLKSIZE_T$])
+m4trace:configure.ac:1173: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1173: the top level])
+m4trace:configure.ac:1173: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BLKCNT_T])
+m4trace:configure.ac:1173: -1- m4_pattern_allow([^HAVE_BLKCNT_T$])
+m4trace:configure.ac:1192: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1192: the top level])
+m4trace:configure.ac:1192: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FPOS_T])
+m4trace:configure.ac:1192: -1- m4_pattern_allow([^HAVE_FPOS_T$])
+m4trace:configure.ac:1211: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1211: the top level])
+m4trace:configure.ac:1211: -1- AC_DEFINE_TRACE_LITERAL([HAVE__FPOS_T])
+m4trace:configure.ac:1211: -1- m4_pattern_allow([^HAVE__FPOS_T$])
+m4trace:configure.ac:1230: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1230: the top level])
+m4trace:configure.ac:1230: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UID_T])
+m4trace:configure.ac:1230: -1- m4_pattern_allow([^HAVE_UID_T$])
+m4trace:configure.ac:1249: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1249: the top level])
+m4trace:configure.ac:1249: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GID_T])
+m4trace:configure.ac:1249: -1- m4_pattern_allow([^HAVE_GID_T$])
+m4trace:configure.ac:1268: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1268: the top level])
+m4trace:configure.ac:1268: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCHAR_T])
+m4trace:configure.ac:1268: -1- m4_pattern_allow([^HAVE_WCHAR_T$])
+m4trace:configure.ac:1277: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT])
+m4trace:configure.ac:1277: -1- m4_pattern_allow([^SIZEOF_SHORT$])
+m4trace:configure.ac:1277: -1- AH_OUTPUT([SIZEOF_SHORT], [/* The size of `short\', as computed by sizeof. */
@%:@undef SIZEOF_SHORT])
-m4trace:configure.ac:835: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
-m4trace:configure.ac:835: -1- m4_pattern_allow([^SIZEOF_INT$])
-m4trace:configure.ac:835: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of `int\', as computed by sizeof. */
+m4trace:configure.ac:1278: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
+m4trace:configure.ac:1278: -1- m4_pattern_allow([^SIZEOF_INT$])
+m4trace:configure.ac:1278: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of `int\', as computed by sizeof. */
@%:@undef SIZEOF_INT])
-m4trace:configure.ac:836: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SIZE_T])
-m4trace:configure.ac:836: -1- m4_pattern_allow([^SIZEOF_SIZE_T$])
-m4trace:configure.ac:836: -1- AH_OUTPUT([SIZEOF_SIZE_T], [/* The size of `size_t\', as computed by sizeof. */
+m4trace:configure.ac:1279: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SIZE_T])
+m4trace:configure.ac:1279: -1- m4_pattern_allow([^SIZEOF_SIZE_T$])
+m4trace:configure.ac:1279: -1- AH_OUTPUT([SIZEOF_SIZE_T], [/* The size of `size_t\', as computed by sizeof. */
@%:@undef SIZEOF_SIZE_T])
-m4trace:configure.ac:837: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
-m4trace:configure.ac:837: -1- m4_pattern_allow([^SIZEOF_LONG$])
-m4trace:configure.ac:837: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of `long\', as computed by sizeof. */
+m4trace:configure.ac:1280: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
+m4trace:configure.ac:1280: -1- m4_pattern_allow([^SIZEOF_LONG$])
+m4trace:configure.ac:1280: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of `long\', as computed by sizeof. */
@%:@undef SIZEOF_LONG])
-m4trace:configure.ac:838: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_LONG])
-m4trace:configure.ac:838: -1- m4_pattern_allow([^SIZEOF_LONG_LONG$])
-m4trace:configure.ac:838: -1- AH_OUTPUT([SIZEOF_LONG_LONG], [/* The size of `long long\', as computed by sizeof. */
+m4trace:configure.ac:1281: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_LONG])
+m4trace:configure.ac:1281: -1- m4_pattern_allow([^SIZEOF_LONG_LONG$])
+m4trace:configure.ac:1281: -1- AH_OUTPUT([SIZEOF_LONG_LONG], [/* The size of `long long\', as computed by sizeof. */
@%:@undef SIZEOF_LONG_LONG])
-m4trace:configure.ac:841: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INTMAX_T])
-m4trace:configure.ac:841: -1- m4_pattern_allow([^SIZEOF_INTMAX_T$])
-m4trace:configure.ac:841: -1- AH_OUTPUT([SIZEOF_INTMAX_T], [/* The size of `intmax_t\', as computed by sizeof. */
-@%:@undef SIZEOF_INTMAX_T])
-m4trace:configure.ac:843: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_DOUBLE])
-m4trace:configure.ac:843: -1- m4_pattern_allow([^SIZEOF_DOUBLE$])
-m4trace:configure.ac:843: -1- AH_OUTPUT([SIZEOF_DOUBLE], [/* The size of `double\', as computed by sizeof. */
+m4trace:configure.ac:1282: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT32_T])
+m4trace:configure.ac:1282: -1- m4_pattern_allow([^SIZEOF_INT32_T$])
+m4trace:configure.ac:1282: -1- AH_OUTPUT([SIZEOF_INT32_T], [/* The size of `int32_t\', as computed by sizeof. */
+@%:@undef SIZEOF_INT32_T])
+m4trace:configure.ac:1283: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_DOUBLE])
+m4trace:configure.ac:1283: -1- m4_pattern_allow([^SIZEOF_DOUBLE$])
+m4trace:configure.ac:1283: -1- AH_OUTPUT([SIZEOF_DOUBLE], [/* The size of `double\', as computed by sizeof. */
@%:@undef SIZEOF_DOUBLE])
-m4trace:configure.ac:844: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_DOUBLE])
-m4trace:configure.ac:844: -1- m4_pattern_allow([^SIZEOF_LONG_DOUBLE$])
-m4trace:configure.ac:844: -1- AH_OUTPUT([SIZEOF_LONG_DOUBLE], [/* The size of `long double\', as computed by sizeof. */
+m4trace:configure.ac:1284: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_DOUBLE])
+m4trace:configure.ac:1284: -1- m4_pattern_allow([^SIZEOF_LONG_DOUBLE$])
+m4trace:configure.ac:1284: -1- AH_OUTPUT([SIZEOF_LONG_DOUBLE], [/* The size of `long double\', as computed by sizeof. */
@%:@undef SIZEOF_LONG_DOUBLE])
-m4trace:configure.ac:845: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_WCHAR_T])
-m4trace:configure.ac:845: -1- m4_pattern_allow([^SIZEOF_WCHAR_T$])
-m4trace:configure.ac:845: -1- AH_OUTPUT([SIZEOF_WCHAR_T], [/* The size of `wchar_t\', as computed by sizeof. */
+m4trace:configure.ac:1285: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_WCHAR_T])
+m4trace:configure.ac:1285: -1- m4_pattern_allow([^SIZEOF_WCHAR_T$])
+m4trace:configure.ac:1285: -1- AH_OUTPUT([SIZEOF_WCHAR_T], [/* The size of `wchar_t\', as computed by sizeof. */
@%:@undef SIZEOF_WCHAR_T])
-m4trace:configure.ac:850: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:850: the top level])
-m4trace:configure.ac:850: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LARGEFILE64_SOURCE])
-m4trace:configure.ac:850: -1- m4_pattern_allow([^HAVE_LARGEFILE64_SOURCE$])
-m4trace:configure.ac:850: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TYPE_STAT64])
-m4trace:configure.ac:850: -1- m4_pattern_allow([^HAVE_TYPE_STAT64$])
-m4trace:configure.ac:868: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1286: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_OFF_T])
+m4trace:configure.ac:1286: -1- m4_pattern_allow([^SIZEOF_OFF_T$])
+m4trace:configure.ac:1286: -1- AH_OUTPUT([SIZEOF_OFF_T], [/* The size of `off_t\', as computed by sizeof. */
+@%:@undef SIZEOF_OFF_T])
+m4trace:configure.ac:1287: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INO_T])
+m4trace:configure.ac:1287: -1- m4_pattern_allow([^SIZEOF_INO_T$])
+m4trace:configure.ac:1287: -1- AH_OUTPUT([SIZEOF_INO_T], [/* The size of `ino_t\', as computed by sizeof. */
+@%:@undef SIZEOF_INO_T])
+m4trace:configure.ac:1290: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INTMAX_T])
+m4trace:configure.ac:1290: -1- m4_pattern_allow([^SIZEOF_INTMAX_T$])
+m4trace:configure.ac:1290: -1- AH_OUTPUT([SIZEOF_INTMAX_T], [/* The size of `intmax_t\', as computed by sizeof. */
+@%:@undef SIZEOF_INTMAX_T])
+m4trace:configure.ac:1299: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1299: the top level])
+m4trace:configure.ac:1299: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CONST])
+m4trace:configure.ac:1299: -1- m4_pattern_allow([^HAVE_CONST$])
+m4trace:configure.ac:1309: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1309: the top level])
+m4trace:configure.ac:1325: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INLINE])
+m4trace:configure.ac:1325: -1- m4_pattern_allow([^HAVE_INLINE$])
+m4trace:configure.ac:1329: -1- AC_DEFINE_TRACE_LITERAL([USE_INLINE])
+m4trace:configure.ac:1329: -1- m4_pattern_allow([^USE_INLINE$])
+m4trace:configure.ac:1335: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1335: the top level])
+m4trace:configure.ac:1335: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VOLATILE])
+m4trace:configure.ac:1335: -1- m4_pattern_allow([^HAVE_VOLATILE$])
+m4trace:configure.ac:1344: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1344: the top level])
+m4trace:configure.ac:1344: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ATTRIBUTE_UNUSED])
+m4trace:configure.ac:1344: -1- m4_pattern_allow([^HAVE_ATTRIBUTE_UNUSED$])
+m4trace:configure.ac:1361: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif])
+m4trace:configure.ac:1361: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN])
+m4trace:configure.ac:1361: -1- m4_pattern_allow([^WORDS_BIGENDIAN$])
+m4trace:configure.ac:1361: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD])
+m4trace:configure.ac:1361: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$])
+m4trace:configure.ac:1361: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */
+@%:@undef AC_APPLE_UNIVERSAL_BUILD])
+m4trace:configure.ac:1366: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2775: AC_TRY_RUN is expanded from...
+configure.ac:1366: the top level])
+m4trace:configure.ac:1366: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TWOS_COMPLEMENT])
+m4trace:configure.ac:1366: -1- m4_pattern_allow([^HAVE_TWOS_COMPLEMENT$])
+m4trace:configure.ac:1366: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TWOS_COMPLEMENT])
+m4trace:configure.ac:1366: -1- m4_pattern_allow([^HAVE_TWOS_COMPLEMENT$])
+m4trace:configure.ac:1407: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2775: AC_TRY_RUN is expanded from...
+configure.ac:1407: the top level])
+m4trace:configure.ac:1539: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IEEE_754_DOUBLE])
+m4trace:configure.ac:1539: -1- m4_pattern_allow([^HAVE_IEEE_754_DOUBLE$])
+m4trace:configure.ac:1551: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1551: the top level])
+m4trace:configure.ac:1551: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LARGEFILE64_SOURCE])
+m4trace:configure.ac:1551: -1- m4_pattern_allow([^HAVE_LARGEFILE64_SOURCE$])
+m4trace:configure.ac:1551: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TYPE_STAT64])
+m4trace:configure.ac:1551: -1- m4_pattern_allow([^HAVE_TYPE_STAT64$])
+m4trace:configure.ac:1571: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1571: the top level])
+m4trace:configure.ac:1571: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FILE_BLKSIZECNT])
+m4trace:configure.ac:1571: -1- m4_pattern_allow([^HAVE_FILE_BLKSIZECNT$])
+m4trace:configure.ac:1602: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:868: the top level])
-m4trace:configure.ac:868: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */
+configure.ac:1602: the top level])
+m4trace:configure.ac:1602: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */
@%:@undef HAVE_MEMSET])
-m4trace:configure.ac:868: -1- AH_OUTPUT([HAVE_BZERO], [/* Define to 1 if you have the `bzero\' function. */
+m4trace:configure.ac:1602: -1- AH_OUTPUT([HAVE_BZERO], [/* Define to 1 if you have the `bzero\' function. */
@%:@undef HAVE_BZERO])
-m4trace:configure.ac:868: -1- AH_OUTPUT([HAVE_MEMCPY], [/* Define to 1 if you have the `memcpy\' function. */
+m4trace:configure.ac:1602: -1- AH_OUTPUT([HAVE_MEMCPY], [/* Define to 1 if you have the `memcpy\' function. */
@%:@undef HAVE_MEMCPY])
-m4trace:configure.ac:868: -1- AH_OUTPUT([HAVE_BCOPY], [/* Define to 1 if you have the `bcopy\' function. */
+m4trace:configure.ac:1602: -1- AH_OUTPUT([HAVE_BCOPY], [/* Define to 1 if you have the `bcopy\' function. */
@%:@undef HAVE_BCOPY])
-m4trace:configure.ac:868: -1- AH_OUTPUT([HAVE_MEMCMP], [/* Define to 1 if you have the `memcmp\' function. */
+m4trace:configure.ac:1602: -1- AH_OUTPUT([HAVE_MEMCMP], [/* Define to 1 if you have the `memcmp\' function. */
@%:@undef HAVE_MEMCMP])
-m4trace:configure.ac:868: -1- AH_OUTPUT([HAVE_BCMP], [/* Define to 1 if you have the `bcmp\' function. */
+m4trace:configure.ac:1602: -1- AH_OUTPUT([HAVE_BCMP], [/* Define to 1 if you have the `bcmp\' function. */
@%:@undef HAVE_BCMP])
-m4trace:configure.ac:869: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1603: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:869: the top level])
-m4trace:configure.ac:869: -1- AH_OUTPUT([HAVE_MALLOC], [/* Define to 1 if you have the `malloc\' function. */
+configure.ac:1603: the top level])
+m4trace:configure.ac:1603: -1- AH_OUTPUT([HAVE_MALLOC], [/* Define to 1 if you have the `malloc\' function. */
@%:@undef HAVE_MALLOC])
-m4trace:configure.ac:869: -1- AH_OUTPUT([HAVE_CALLOC], [/* Define to 1 if you have the `calloc\' function. */
+m4trace:configure.ac:1603: -1- AH_OUTPUT([HAVE_CALLOC], [/* Define to 1 if you have the `calloc\' function. */
@%:@undef HAVE_CALLOC])
-m4trace:configure.ac:869: -1- AH_OUTPUT([HAVE_FREE], [/* Define to 1 if you have the `free\' function. */
+m4trace:configure.ac:1603: -1- AH_OUTPUT([HAVE_FREE], [/* Define to 1 if you have the `free\' function. */
@%:@undef HAVE_FREE])
-m4trace:configure.ac:870: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1604: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:870: the top level])
-m4trace:configure.ac:870: -1- AH_OUTPUT([HAVE_STRCPY_S], [/* Define to 1 if you have the `strcpy_s\' function. */
+configure.ac:1604: the top level])
+m4trace:configure.ac:1604: -1- AH_OUTPUT([HAVE_STRCPY_S], [/* Define to 1 if you have the `strcpy_s\' function. */
@%:@undef HAVE_STRCPY_S])
-m4trace:configure.ac:870: -1- AH_OUTPUT([HAVE_STRCAT_S], [/* Define to 1 if you have the `strcat_s\' function. */
+m4trace:configure.ac:1604: -1- AH_OUTPUT([HAVE_STRCAT_S], [/* Define to 1 if you have the `strcat_s\' function. */
@%:@undef HAVE_STRCAT_S])
-m4trace:configure.ac:871: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1605: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:871: the top level])
-m4trace:configure.ac:871: -1- AH_OUTPUT([HAVE_STRCASECMP], [/* Define to 1 if you have the `strcasecmp\' function. */
+configure.ac:1605: the top level])
+m4trace:configure.ac:1605: -1- AH_OUTPUT([HAVE_STRCASECMP], [/* Define to 1 if you have the `strcasecmp\' function. */
@%:@undef HAVE_STRCASECMP])
-m4trace:configure.ac:871: -1- AH_OUTPUT([HAVE_STRICMP], [/* Define to 1 if you have the `stricmp\' function. */
+m4trace:configure.ac:1605: -1- AH_OUTPUT([HAVE_STRICMP], [/* Define to 1 if you have the `stricmp\' function. */
@%:@undef HAVE_STRICMP])
-m4trace:configure.ac:871: -1- AH_OUTPUT([HAVE__STRICMP], [/* Define to 1 if you have the `_stricmp\' function. */
+m4trace:configure.ac:1605: -1- AH_OUTPUT([HAVE__STRICMP], [/* Define to 1 if you have the `_stricmp\' function. */
@%:@undef HAVE__STRICMP])
-m4trace:configure.ac:872: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1606: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:872: the top level])
-m4trace:configure.ac:872: -1- AH_OUTPUT([HAVE_WCSLEN], [/* Define to 1 if you have the `wcslen\' function. */
+configure.ac:1606: the top level])
+m4trace:configure.ac:1606: -1- AH_OUTPUT([HAVE_WCSLEN], [/* Define to 1 if you have the `wcslen\' function. */
@%:@undef HAVE_WCSLEN])
-m4trace:configure.ac:872: -1- AH_OUTPUT([HAVE_WCSCPY_S], [/* Define to 1 if you have the `wcscpy_s\' function. */
+m4trace:configure.ac:1606: -1- AH_OUTPUT([HAVE_WCSCPY_S], [/* Define to 1 if you have the `wcscpy_s\' function. */
@%:@undef HAVE_WCSCPY_S])
-m4trace:configure.ac:872: -1- AH_OUTPUT([HAVE_WCSCPY], [/* Define to 1 if you have the `wcscpy\' function. */
+m4trace:configure.ac:1606: -1- AH_OUTPUT([HAVE_WCSCPY], [/* Define to 1 if you have the `wcscpy\' function. */
@%:@undef HAVE_WCSCPY])
-m4trace:configure.ac:872: -1- AH_OUTPUT([HAVE_WCSCAT_S], [/* Define to 1 if you have the `wcscat_s\' function. */
+m4trace:configure.ac:1606: -1- AH_OUTPUT([HAVE_WCSCAT_S], [/* Define to 1 if you have the `wcscat_s\' function. */
@%:@undef HAVE_WCSCAT_S])
-m4trace:configure.ac:872: -1- AH_OUTPUT([HAVE_WCSCAT], [/* Define to 1 if you have the `wcscat\' function. */
+m4trace:configure.ac:1606: -1- AH_OUTPUT([HAVE_WCSCAT], [/* Define to 1 if you have the `wcscat\' function. */
@%:@undef HAVE_WCSCAT])
-m4trace:configure.ac:872: -1- AH_OUTPUT([HAVE_WCSCHR], [/* Define to 1 if you have the `wcschr\' function. */
+m4trace:configure.ac:1606: -1- AH_OUTPUT([HAVE_WCSCHR], [/* Define to 1 if you have the `wcschr\' function. */
@%:@undef HAVE_WCSCHR])
-m4trace:configure.ac:872: -1- AH_OUTPUT([HAVE_WCSRCHR], [/* Define to 1 if you have the `wcsrchr\' function. */
+m4trace:configure.ac:1606: -1- AH_OUTPUT([HAVE_WCSRCHR], [/* Define to 1 if you have the `wcsrchr\' function. */
@%:@undef HAVE_WCSRCHR])
-m4trace:configure.ac:873: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1607: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:873: the top level])
-m4trace:configure.ac:873: -1- AH_OUTPUT([HAVE_WCSCMP], [/* Define to 1 if you have the `wcscmp\' function. */
+configure.ac:1607: the top level])
+m4trace:configure.ac:1607: -1- AH_OUTPUT([HAVE_WCSCMP], [/* Define to 1 if you have the `wcscmp\' function. */
@%:@undef HAVE_WCSCMP])
-m4trace:configure.ac:873: -1- AH_OUTPUT([HAVE__WCSCMP], [/* Define to 1 if you have the `_wcscmp\' function. */
+m4trace:configure.ac:1607: -1- AH_OUTPUT([HAVE__WCSCMP], [/* Define to 1 if you have the `_wcscmp\' function. */
@%:@undef HAVE__WCSCMP])
-m4trace:configure.ac:873: -1- AH_OUTPUT([HAVE_WCSCASECMP], [/* Define to 1 if you have the `wcscasecmp\' function. */
+m4trace:configure.ac:1607: -1- AH_OUTPUT([HAVE_WCSCASECMP], [/* Define to 1 if you have the `wcscasecmp\' function. */
@%:@undef HAVE_WCSCASECMP])
-m4trace:configure.ac:873: -1- AH_OUTPUT([HAVE__WCSCASECMP], [/* Define to 1 if you have the `_wcscasecmp\' function. */
+m4trace:configure.ac:1607: -1- AH_OUTPUT([HAVE__WCSCASECMP], [/* Define to 1 if you have the `_wcscasecmp\' function. */
@%:@undef HAVE__WCSCASECMP])
-m4trace:configure.ac:873: -1- AH_OUTPUT([HAVE_WCSICMP], [/* Define to 1 if you have the `wcsicmp\' function. */
+m4trace:configure.ac:1607: -1- AH_OUTPUT([HAVE_WCSICMP], [/* Define to 1 if you have the `wcsicmp\' function. */
@%:@undef HAVE_WCSICMP])
-m4trace:configure.ac:873: -1- AH_OUTPUT([HAVE__WCSICMP], [/* Define to 1 if you have the `_wcsicmp\' function. */
+m4trace:configure.ac:1607: -1- AH_OUTPUT([HAVE__WCSICMP], [/* Define to 1 if you have the `_wcsicmp\' function. */
@%:@undef HAVE__WCSICMP])
-m4trace:configure.ac:874: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1608: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:874: the top level])
-m4trace:configure.ac:874: -1- AH_OUTPUT([HAVE_GETPID], [/* Define to 1 if you have the `getpid\' function. */
+configure.ac:1608: the top level])
+m4trace:configure.ac:1608: -1- AH_OUTPUT([HAVE_GETPID], [/* Define to 1 if you have the `getpid\' function. */
@%:@undef HAVE_GETPID])
-m4trace:configure.ac:874: -1- AH_OUTPUT([HAVE_READLINK], [/* Define to 1 if you have the `readlink\' function. */
+m4trace:configure.ac:1608: -1- AH_OUTPUT([HAVE_READLINK], [/* Define to 1 if you have the `readlink\' function. */
@%:@undef HAVE_READLINK])
-m4trace:configure.ac:874: -1- AH_OUTPUT([HAVE_GETEXECNAME], [/* Define to 1 if you have the `getexecname\' function. */
+m4trace:configure.ac:1608: -1- AH_OUTPUT([HAVE_GETEXECNAME], [/* Define to 1 if you have the `getexecname\' function. */
@%:@undef HAVE_GETEXECNAME])
-m4trace:configure.ac:874: -1- AH_OUTPUT([HAVE_LSTAT], [/* Define to 1 if you have the `lstat\' function. */
+m4trace:configure.ac:1608: -1- AH_OUTPUT([HAVE_LSTAT], [/* Define to 1 if you have the `lstat\' function. */
@%:@undef HAVE_LSTAT])
-m4trace:configure.ac:874: -1- AH_OUTPUT([HAVE_STAT64], [/* Define to 1 if you have the `stat64\' function. */
+m4trace:configure.ac:1608: -1- AH_OUTPUT([HAVE_STAT64], [/* Define to 1 if you have the `stat64\' function. */
@%:@undef HAVE_STAT64])
-m4trace:configure.ac:874: -1- AH_OUTPUT([HAVE_LSTAT64], [/* Define to 1 if you have the `lstat64\' function. */
+m4trace:configure.ac:1608: -1- AH_OUTPUT([HAVE_LSTAT64], [/* Define to 1 if you have the `lstat64\' function. */
@%:@undef HAVE_LSTAT64])
-m4trace:configure.ac:874: -1- AH_OUTPUT([HAVE_LOCALTIME_R], [/* Define to 1 if you have the `localtime_r\' function. */
+m4trace:configure.ac:1608: -1- AH_OUTPUT([HAVE_LOCALTIME_R], [/* Define to 1 if you have the `localtime_r\' function. */
@%:@undef HAVE_LOCALTIME_R])
-m4trace:configure.ac:875: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1609: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:875: the top level])
-m4trace:configure.ac:875: -1- AH_OUTPUT([HAVE_GETEUID], [/* Define to 1 if you have the `geteuid\' function. */
+configure.ac:1609: the top level])
+m4trace:configure.ac:1609: -1- AH_OUTPUT([HAVE_GETEUID], [/* Define to 1 if you have the `geteuid\' function. */
@%:@undef HAVE_GETEUID])
-m4trace:configure.ac:875: -1- AH_OUTPUT([HAVE_FOPEN64], [/* Define to 1 if you have the `fopen64\' function. */
+m4trace:configure.ac:1609: -1- AH_OUTPUT([HAVE_FOPEN64], [/* Define to 1 if you have the `fopen64\' function. */
@%:@undef HAVE_FOPEN64])
-m4trace:configure.ac:875: -1- AH_OUTPUT([HAVE_FOPEN_S], [/* Define to 1 if you have the `fopen_s\' function. */
+m4trace:configure.ac:1609: -1- AH_OUTPUT([HAVE_FOPEN_S], [/* Define to 1 if you have the `fopen_s\' function. */
@%:@undef HAVE_FOPEN_S])
-m4trace:configure.ac:875: -1- AH_OUTPUT([HAVE__WFOPEN], [/* Define to 1 if you have the `_wfopen\' function. */
+m4trace:configure.ac:1609: -1- AH_OUTPUT([HAVE__WFOPEN], [/* Define to 1 if you have the `_wfopen\' function. */
@%:@undef HAVE__WFOPEN])
-m4trace:configure.ac:875: -1- AH_OUTPUT([HAVE__WFOPEN64], [/* Define to 1 if you have the `_wfopen64\' function. */
+m4trace:configure.ac:1609: -1- AH_OUTPUT([HAVE__WFOPEN64], [/* Define to 1 if you have the `_wfopen64\' function. */
@%:@undef HAVE__WFOPEN64])
-m4trace:configure.ac:875: -1- AH_OUTPUT([HAVE__WFOPEN_S], [/* Define to 1 if you have the `_wfopen_s\' function. */
+m4trace:configure.ac:1609: -1- AH_OUTPUT([HAVE__WFOPEN_S], [/* Define to 1 if you have the `_wfopen_s\' function. */
@%:@undef HAVE__WFOPEN_S])
-m4trace:configure.ac:876: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1610: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:876: the top level])
-m4trace:configure.ac:876: -1- AH_OUTPUT([HAVE_FPUTWS], [/* Define to 1 if you have the `fputws\' function. */
+configure.ac:1610: the top level])
+m4trace:configure.ac:1610: -1- AH_OUTPUT([HAVE_FPUTWS], [/* Define to 1 if you have the `fputws\' function. */
@%:@undef HAVE_FPUTWS])
-m4trace:configure.ac:876: -1- AH_OUTPUT([HAVE_FPUTWC], [/* Define to 1 if you have the `fputwc\' function. */
+m4trace:configure.ac:1610: -1- AH_OUTPUT([HAVE_FPUTWC], [/* Define to 1 if you have the `fputwc\' function. */
@%:@undef HAVE_FPUTWC])
-m4trace:configure.ac:877: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1611: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:877: the top level])
-m4trace:configure.ac:877: -1- AH_OUTPUT([HAVE_SETBUFFER], [/* Define to 1 if you have the `setbuffer\' function. */
+configure.ac:1611: the top level])
+m4trace:configure.ac:1611: -1- AH_OUTPUT([HAVE_SETBUFFER], [/* Define to 1 if you have the `setbuffer\' function. */
@%:@undef HAVE_SETBUFFER])
-m4trace:configure.ac:877: -1- AH_OUTPUT([HAVE_SETBUF], [/* Define to 1 if you have the `setbuf\' function. */
+m4trace:configure.ac:1611: -1- AH_OUTPUT([HAVE_SETBUF], [/* Define to 1 if you have the `setbuf\' function. */
@%:@undef HAVE_SETBUF])
-m4trace:configure.ac:877: -1- AH_OUTPUT([HAVE_SETVBUF], [/* Define to 1 if you have the `setvbuf\' function. */
+m4trace:configure.ac:1611: -1- AH_OUTPUT([HAVE_SETVBUF], [/* Define to 1 if you have the `setvbuf\' function. */
@%:@undef HAVE_SETVBUF])
-m4trace:configure.ac:878: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1612: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:878: the top level])
-m4trace:configure.ac:878: -1- AH_OUTPUT([HAVE_FILENO], [/* Define to 1 if you have the `fileno\' function. */
+configure.ac:1612: the top level])
+m4trace:configure.ac:1612: -1- AH_OUTPUT([HAVE_FILENO], [/* Define to 1 if you have the `fileno\' function. */
@%:@undef HAVE_FILENO])
-m4trace:configure.ac:878: -1- AH_OUTPUT([HAVE__FILENO], [/* Define to 1 if you have the `_fileno\' function. */
+m4trace:configure.ac:1612: -1- AH_OUTPUT([HAVE__FILENO], [/* Define to 1 if you have the `_fileno\' function. */
@%:@undef HAVE__FILENO])
-m4trace:configure.ac:878: -1- AH_OUTPUT([HAVE_SETMODE], [/* Define to 1 if you have the `setmode\' function. */
+m4trace:configure.ac:1612: -1- AH_OUTPUT([HAVE_SETMODE], [/* Define to 1 if you have the `setmode\' function. */
@%:@undef HAVE_SETMODE])
-m4trace:configure.ac:878: -1- AH_OUTPUT([HAVE__SETMODE], [/* Define to 1 if you have the `_setmode\' function. */
+m4trace:configure.ac:1612: -1- AH_OUTPUT([HAVE__SETMODE], [/* Define to 1 if you have the `_setmode\' function. */
@%:@undef HAVE__SETMODE])
-m4trace:configure.ac:878: -1- AH_OUTPUT([HAVE_ISATTY], [/* Define to 1 if you have the `isatty\' function. */
+m4trace:configure.ac:1612: -1- AH_OUTPUT([HAVE_ISATTY], [/* Define to 1 if you have the `isatty\' function. */
@%:@undef HAVE_ISATTY])
-m4trace:configure.ac:878: -1- AH_OUTPUT([HAVE__ISATTY], [/* Define to 1 if you have the `_isatty\' function. */
+m4trace:configure.ac:1612: -1- AH_OUTPUT([HAVE__ISATTY], [/* Define to 1 if you have the `_isatty\' function. */
@%:@undef HAVE__ISATTY])
-m4trace:configure.ac:879: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1613: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:879: the top level])
-m4trace:configure.ac:879: -1- AH_OUTPUT([HAVE_STRTOD], [/* Define to 1 if you have the `strtod\' function. */
+configure.ac:1613: the top level])
+m4trace:configure.ac:1613: -1- AH_OUTPUT([HAVE_STRTOD], [/* Define to 1 if you have the `strtod\' function. */
@%:@undef HAVE_STRTOD])
-m4trace:configure.ac:879: -1- AH_OUTPUT([HAVE__STRTOD], [/* Define to 1 if you have the `_strtod\' function. */
+m4trace:configure.ac:1613: -1- AH_OUTPUT([HAVE__STRTOD], [/* Define to 1 if you have the `_strtod\' function. */
@%:@undef HAVE__STRTOD])
-m4trace:configure.ac:879: -1- AH_OUTPUT([HAVE_WCSTOD], [/* Define to 1 if you have the `wcstod\' function. */
+m4trace:configure.ac:1613: -1- AH_OUTPUT([HAVE_WCSTOD], [/* Define to 1 if you have the `wcstod\' function. */
@%:@undef HAVE_WCSTOD])
-m4trace:configure.ac:879: -1- AH_OUTPUT([HAVE__WCSTOD], [/* Define to 1 if you have the `_wcstod\' function. */
+m4trace:configure.ac:1613: -1- AH_OUTPUT([HAVE__WCSTOD], [/* Define to 1 if you have the `_wcstod\' function. */
@%:@undef HAVE__WCSTOD])
-m4trace:configure.ac:880: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1614: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:880: the top level])
-m4trace:configure.ac:880: -1- AH_OUTPUT([HAVE__SNPRINTF_S], [/* Define to 1 if you have the `_snprintf_s\' function. */
+configure.ac:1614: the top level])
+m4trace:configure.ac:1614: -1- AH_OUTPUT([HAVE__SNPRINTF_S], [/* Define to 1 if you have the `_snprintf_s\' function. */
@%:@undef HAVE__SNPRINTF_S])
-m4trace:configure.ac:880: -1- AH_OUTPUT([HAVE__SNPRINTF], [/* Define to 1 if you have the `_snprintf\' function. */
+m4trace:configure.ac:1614: -1- AH_OUTPUT([HAVE__SNPRINTF], [/* Define to 1 if you have the `_snprintf\' function. */
@%:@undef HAVE__SNPRINTF])
-m4trace:configure.ac:880: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the `snprintf\' function. */
+m4trace:configure.ac:1614: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the `snprintf\' function. */
@%:@undef HAVE_SNPRINTF])
-m4trace:configure.ac:880: -1- AH_OUTPUT([HAVE__SNWPRINTF_S], [/* Define to 1 if you have the `_snwprintf_s\' function. */
+m4trace:configure.ac:1614: -1- AH_OUTPUT([HAVE__SNWPRINTF_S], [/* Define to 1 if you have the `_snwprintf_s\' function. */
@%:@undef HAVE__SNWPRINTF_S])
-m4trace:configure.ac:880: -1- AH_OUTPUT([HAVE__SNWPRINTF], [/* Define to 1 if you have the `_snwprintf\' function. */
+m4trace:configure.ac:1614: -1- AH_OUTPUT([HAVE__SNWPRINTF], [/* Define to 1 if you have the `_snwprintf\' function. */
@%:@undef HAVE__SNWPRINTF])
-m4trace:configure.ac:880: -1- AH_OUTPUT([HAVE_SNWPRINTF], [/* Define to 1 if you have the `snwprintf\' function. */
+m4trace:configure.ac:1614: -1- AH_OUTPUT([HAVE_SNWPRINTF], [/* Define to 1 if you have the `snwprintf\' function. */
@%:@undef HAVE_SNWPRINTF])
-m4trace:configure.ac:881: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1615: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:881: the top level])
-m4trace:configure.ac:881: -1- AH_OUTPUT([HAVE_SWPRINTF], [/* Define to 1 if you have the `swprintf\' function. */
+configure.ac:1615: the top level])
+m4trace:configure.ac:1615: -1- AH_OUTPUT([HAVE_SWPRINTF], [/* Define to 1 if you have the `swprintf\' function. */
@%:@undef HAVE_SWPRINTF])
-m4trace:configure.ac:881: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SWPRINTF])
-m4trace:configure.ac:881: -1- m4_pattern_allow([^HAVE_SWPRINTF$])
-m4trace:configure.ac:882: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1615: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SWPRINTF])
+m4trace:configure.ac:1615: -1- m4_pattern_allow([^HAVE_SWPRINTF$])
+m4trace:configure.ac:1616: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:882: the top level])
-m4trace:configure.ac:882: -1- AH_OUTPUT([HAVE_UNLINK], [/* Define to 1 if you have the `unlink\' function. */
+configure.ac:1616: the top level])
+m4trace:configure.ac:1616: -1- AH_OUTPUT([HAVE_UNLINK], [/* Define to 1 if you have the `unlink\' function. */
@%:@undef HAVE_UNLINK])
-m4trace:configure.ac:882: -1- AH_OUTPUT([HAVE__UNLINK], [/* Define to 1 if you have the `_unlink\' function. */
+m4trace:configure.ac:1616: -1- AH_OUTPUT([HAVE__UNLINK], [/* Define to 1 if you have the `_unlink\' function. */
@%:@undef HAVE__UNLINK])
-m4trace:configure.ac:882: -1- AH_OUTPUT([HAVE_WUNLINK], [/* Define to 1 if you have the `wunlink\' function. */
+m4trace:configure.ac:1616: -1- AH_OUTPUT([HAVE_WUNLINK], [/* Define to 1 if you have the `wunlink\' function. */
@%:@undef HAVE_WUNLINK])
-m4trace:configure.ac:882: -1- AH_OUTPUT([HAVE__WUNLINK], [/* Define to 1 if you have the `_wunlink\' function. */
+m4trace:configure.ac:1616: -1- AH_OUTPUT([HAVE__WUNLINK], [/* Define to 1 if you have the `_wunlink\' function. */
@%:@undef HAVE__WUNLINK])
-m4trace:configure.ac:883: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1617: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:883: the top level])
-m4trace:configure.ac:883: -1- AH_OUTPUT([HAVE_RMDIR], [/* Define to 1 if you have the `rmdir\' function. */
+configure.ac:1617: the top level])
+m4trace:configure.ac:1617: -1- AH_OUTPUT([HAVE_RMDIR], [/* Define to 1 if you have the `rmdir\' function. */
@%:@undef HAVE_RMDIR])
-m4trace:configure.ac:883: -1- AH_OUTPUT([HAVE__RMDIR], [/* Define to 1 if you have the `_rmdir\' function. */
+m4trace:configure.ac:1617: -1- AH_OUTPUT([HAVE__RMDIR], [/* Define to 1 if you have the `_rmdir\' function. */
@%:@undef HAVE__RMDIR])
-m4trace:configure.ac:883: -1- AH_OUTPUT([HAVE_WRMDIR], [/* Define to 1 if you have the `wrmdir\' function. */
+m4trace:configure.ac:1617: -1- AH_OUTPUT([HAVE_WRMDIR], [/* Define to 1 if you have the `wrmdir\' function. */
@%:@undef HAVE_WRMDIR])
-m4trace:configure.ac:883: -1- AH_OUTPUT([HAVE__WRMDIR], [/* Define to 1 if you have the `_wrmdir\' function. */
+m4trace:configure.ac:1617: -1- AH_OUTPUT([HAVE__WRMDIR], [/* Define to 1 if you have the `_wrmdir\' function. */
@%:@undef HAVE__WRMDIR])
-m4trace:configure.ac:884: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1618: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:884: the top level])
-m4trace:configure.ac:884: -1- AH_OUTPUT([HAVE_MKDIR], [/* Define to 1 if you have the `mkdir\' function. */
+configure.ac:1618: the top level])
+m4trace:configure.ac:1618: -1- AH_OUTPUT([HAVE_MKDIR], [/* Define to 1 if you have the `mkdir\' function. */
@%:@undef HAVE_MKDIR])
-m4trace:configure.ac:884: -1- AH_OUTPUT([HAVE__MKDIR], [/* Define to 1 if you have the `_mkdir\' function. */
+m4trace:configure.ac:1618: -1- AH_OUTPUT([HAVE__MKDIR], [/* Define to 1 if you have the `_mkdir\' function. */
@%:@undef HAVE__MKDIR])
-m4trace:configure.ac:884: -1- AH_OUTPUT([HAVE_WMKDIR], [/* Define to 1 if you have the `wmkdir\' function. */
+m4trace:configure.ac:1618: -1- AH_OUTPUT([HAVE_WMKDIR], [/* Define to 1 if you have the `wmkdir\' function. */
@%:@undef HAVE_WMKDIR])
-m4trace:configure.ac:884: -1- AH_OUTPUT([HAVE__WMKDIR], [/* Define to 1 if you have the `_wmkdir\' function. */
+m4trace:configure.ac:1618: -1- AH_OUTPUT([HAVE__WMKDIR], [/* Define to 1 if you have the `_wmkdir\' function. */
@%:@undef HAVE__WMKDIR])
-m4trace:configure.ac:885: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1619: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:885: the top level])
-m4trace:configure.ac:885: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the `strerror\' function. */
+configure.ac:1619: the top level])
+m4trace:configure.ac:1619: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the `strerror\' function. */
@%:@undef HAVE_STRERROR])
-m4trace:configure.ac:885: -1- AH_OUTPUT([HAVE_STRERROR_R], [/* Define to 1 if you have the `strerror_r\' function. */
+m4trace:configure.ac:1619: -1- AH_OUTPUT([HAVE_STRERROR_R], [/* Define to 1 if you have the `strerror_r\' function. */
@%:@undef HAVE_STRERROR_R])
-m4trace:configure.ac:886: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1620: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:886: the top level])
-m4trace:configure.ac:886: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the `sigaction\' function. */
+configure.ac:1620: the top level])
+m4trace:configure.ac:1620: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the `sigaction\' function. */
@%:@undef HAVE_SIGACTION])
-m4trace:configure.ac:886: -1- AH_OUTPUT([HAVE_SIGSET], [/* Define to 1 if you have the `sigset\' function. */
+m4trace:configure.ac:1620: -1- AH_OUTPUT([HAVE_SIGSET], [/* Define to 1 if you have the `sigset\' function. */
@%:@undef HAVE_SIGSET])
-m4trace:configure.ac:886: -1- AH_OUTPUT([HAVE_SIGNAL], [/* Define to 1 if you have the `signal\' function. */
+m4trace:configure.ac:1620: -1- AH_OUTPUT([HAVE_SIGNAL], [/* Define to 1 if you have the `signal\' function. */
@%:@undef HAVE_SIGNAL])
-m4trace:configure.ac:886: -1- AH_OUTPUT([HAVE_SIGPROCMASK], [/* Define to 1 if you have the `sigprocmask\' function. */
+m4trace:configure.ac:1620: -1- AH_OUTPUT([HAVE_SIGPROCMASK], [/* Define to 1 if you have the `sigprocmask\' function. */
@%:@undef HAVE_SIGPROCMASK])
-m4trace:configure.ac:886: -1- AH_OUTPUT([HAVE_SIGEMPTYSET], [/* Define to 1 if you have the `sigemptyset\' function. */
+m4trace:configure.ac:1620: -1- AH_OUTPUT([HAVE_SIGEMPTYSET], [/* Define to 1 if you have the `sigemptyset\' function. */
@%:@undef HAVE_SIGEMPTYSET])
-m4trace:configure.ac:887: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1621: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:887: the top level])
-m4trace:configure.ac:887: -1- AH_OUTPUT([HAVE_SETPWENT], [/* Define to 1 if you have the `setpwent\' function. */
+configure.ac:1621: the top level])
+m4trace:configure.ac:1621: -1- AH_OUTPUT([HAVE_SETPWENT], [/* Define to 1 if you have the `setpwent\' function. */
@%:@undef HAVE_SETPWENT])
-m4trace:configure.ac:887: -1- AH_OUTPUT([HAVE_GETPWENT], [/* Define to 1 if you have the `getpwent\' function. */
+m4trace:configure.ac:1621: -1- AH_OUTPUT([HAVE_GETPWENT], [/* Define to 1 if you have the `getpwent\' function. */
@%:@undef HAVE_GETPWENT])
-m4trace:configure.ac:887: -1- AH_OUTPUT([HAVE_ENDPWENT], [/* Define to 1 if you have the `endpwent\' function. */
+m4trace:configure.ac:1621: -1- AH_OUTPUT([HAVE_ENDPWENT], [/* Define to 1 if you have the `endpwent\' function. */
@%:@undef HAVE_ENDPWENT])
-m4trace:configure.ac:888: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1622: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:888: the top level])
-m4trace:configure.ac:888: -1- AH_OUTPUT([HAVE_GETENV], [/* Define to 1 if you have the `getenv\' function. */
+configure.ac:1622: the top level])
+m4trace:configure.ac:1622: -1- AH_OUTPUT([HAVE_GETENV], [/* Define to 1 if you have the `getenv\' function. */
@%:@undef HAVE_GETENV])
-m4trace:configure.ac:888: -1- AH_OUTPUT([HAVE_GETENV_S], [/* Define to 1 if you have the `getenv_s\' function. */
+m4trace:configure.ac:1622: -1- AH_OUTPUT([HAVE_GETENV_S], [/* Define to 1 if you have the `getenv_s\' function. */
@%:@undef HAVE_GETENV_S])
-m4trace:configure.ac:888: -1- AH_OUTPUT([HAVE_SETLOCALE], [/* Define to 1 if you have the `setlocale\' function. */
+m4trace:configure.ac:1622: -1- AH_OUTPUT([HAVE_SETLOCALE], [/* Define to 1 if you have the `setlocale\' function. */
@%:@undef HAVE_SETLOCALE])
-m4trace:configure.ac:888: -1- AH_OUTPUT([HAVE_SELECT], [/* Define to 1 if you have the `select\' function. */
-@%:@undef HAVE_SELECT])
-m4trace:configure.ac:889: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1623: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:889: the top level])
-m4trace:configure.ac:889: -1- AH_OUTPUT([HAVE_GETCWD], [/* Define to 1 if you have the `getcwd\' function. */
+configure.ac:1623: the top level])
+m4trace:configure.ac:1623: -1- AH_OUTPUT([HAVE_GETCWD], [/* Define to 1 if you have the `getcwd\' function. */
@%:@undef HAVE_GETCWD])
-m4trace:configure.ac:889: -1- AH_OUTPUT([HAVE__GETCWD], [/* Define to 1 if you have the `_getcwd\' function. */
+m4trace:configure.ac:1623: -1- AH_OUTPUT([HAVE__GETCWD], [/* Define to 1 if you have the `_getcwd\' function. */
@%:@undef HAVE__GETCWD])
-m4trace:configure.ac:889: -1- AH_OUTPUT([HAVE__WGETCWD], [/* Define to 1 if you have the `_wgetcwd\' function. */
+m4trace:configure.ac:1623: -1- AH_OUTPUT([HAVE__WGETCWD], [/* Define to 1 if you have the `_wgetcwd\' function. */
@%:@undef HAVE__WGETCWD])
-m4trace:configure.ac:890: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHA224])
-m4trace:configure.ac:890: -2- m4_pattern_allow([^HAVE_SHA224$])
-m4trace:configure.ac:891: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHA256])
-m4trace:configure.ac:891: -2- m4_pattern_allow([^HAVE_SHA256$])
-m4trace:configure.ac:892: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHA384])
-m4trace:configure.ac:892: -2- m4_pattern_allow([^HAVE_SHA384$])
-m4trace:configure.ac:893: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHA512])
-m4trace:configure.ac:893: -2- m4_pattern_allow([^HAVE_SHA512$])
-m4trace:configure.ac:896: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:896: the top level])
-m4trace:configure.ac:896: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RAND_EGD])
-m4trace:configure.ac:896: -1- m4_pattern_allow([^HAVE_RAND_EGD$])
-m4trace:configure.ac:909: -1- AH_OUTPUT([HAVE_SOCKET], [/* Define to 1 if you have the `socket\' function. */
-@%:@undef HAVE_SOCKET])
-m4trace:configure.ac:909: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
-m4trace:configure.ac:909: -1- m4_pattern_allow([^HAVE_SOCKET$])
-m4trace:configure.ac:909: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
-m4trace:configure.ac:909: -1- m4_pattern_allow([^HAVE_SOCKET$])
-m4trace:configure.ac:909: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
-m4trace:configure.ac:909: -1- m4_pattern_allow([^HAVE_SOCKET$])
-m4trace:configure.ac:909: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
-m4trace:configure.ac:909: -1- m4_pattern_allow([^HAVE_SOCKET$])
-m4trace:configure.ac:909: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
-m4trace:configure.ac:909: -1- m4_pattern_allow([^HAVE_SOCKET$])
-m4trace:configure.ac:937: -1- AH_OUTPUT([HAVE_SETSOCKOPT], [/* Define to 1 if you have the `setsockopt\' function. */
-@%:@undef HAVE_SETSOCKOPT])
-m4trace:configure.ac:937: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
-m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
-m4trace:configure.ac:937: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
-m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
-m4trace:configure.ac:937: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
-m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
-m4trace:configure.ac:937: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
-m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
-m4trace:configure.ac:937: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
-m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
-m4trace:configure.ac:954: -1- AH_OUTPUT([HAVE_GETADDRINFO], [/* Define to 1 if you have the `getaddrinfo\' function. */
-@%:@undef HAVE_GETADDRINFO])
-m4trace:configure.ac:954: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
-m4trace:configure.ac:954: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
-m4trace:configure.ac:954: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
-m4trace:configure.ac:954: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
-m4trace:configure.ac:954: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
-m4trace:configure.ac:954: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
-m4trace:configure.ac:954: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
-m4trace:configure.ac:954: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
-m4trace:configure.ac:954: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
-m4trace:configure.ac:954: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
-m4trace:configure.ac:954: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
-m4trace:configure.ac:954: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
-m4trace:configure.ac:978: -1- AH_OUTPUT([HAVE_GETNAMEINFO], [/* Define to 1 if you have the `getnameinfo\' function. */
-@%:@undef HAVE_GETNAMEINFO])
-m4trace:configure.ac:978: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
-m4trace:configure.ac:978: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
-m4trace:configure.ac:978: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
-m4trace:configure.ac:978: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
-m4trace:configure.ac:978: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
-m4trace:configure.ac:978: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
-m4trace:configure.ac:978: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
-m4trace:configure.ac:978: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
-m4trace:configure.ac:978: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
-m4trace:configure.ac:978: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
-m4trace:configure.ac:978: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
-m4trace:configure.ac:978: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
-m4trace:configure.ac:999: -1- AH_OUTPUT([HAVE_GETHOSTBYNAME], [/* Define to 1 if you have the `gethostbyname\' function. */
-@%:@undef HAVE_GETHOSTBYNAME])
-m4trace:configure.ac:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
-m4trace:configure.ac:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
-m4trace:configure.ac:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
-m4trace:configure.ac:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
-m4trace:configure.ac:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
-m4trace:configure.ac:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
-m4trace:configure.ac:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
-m4trace:configure.ac:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
-m4trace:configure.ac:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
-m4trace:configure.ac:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
-m4trace:configure.ac:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
-m4trace:configure.ac:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
-m4trace:configure.ac:1021: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1021: the top level])
-m4trace:configure.ac:1021: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HTONS])
-m4trace:configure.ac:1021: -1- m4_pattern_allow([^HAVE_HTONS$])
-m4trace:configure.ac:1049: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1049: the top level])
-m4trace:configure.ac:1049: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NTOHS])
-m4trace:configure.ac:1049: -1- m4_pattern_allow([^HAVE_NTOHS$])
-m4trace:configure.ac:1077: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1077: the top level])
-m4trace:configure.ac:1077: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HTONL])
-m4trace:configure.ac:1077: -1- m4_pattern_allow([^HAVE_HTONL$])
-m4trace:configure.ac:1105: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1105: the top level])
-m4trace:configure.ac:1105: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NTOHL])
-m4trace:configure.ac:1105: -1- m4_pattern_allow([^HAVE_NTOHL$])
-m4trace:configure.ac:1132: -1- AH_OUTPUT([HAVE_INET_ADDR], [/* Define to 1 if you have the `inet_addr\' function. */
-@%:@undef HAVE_INET_ADDR])
-m4trace:configure.ac:1132: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
-m4trace:configure.ac:1132: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
-m4trace:configure.ac:1132: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
-m4trace:configure.ac:1132: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
-m4trace:configure.ac:1132: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
-m4trace:configure.ac:1132: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
-m4trace:configure.ac:1132: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
-m4trace:configure.ac:1132: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
-m4trace:configure.ac:1132: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
-m4trace:configure.ac:1132: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
-m4trace:configure.ac:1132: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
-m4trace:configure.ac:1132: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
-m4trace:configure.ac:1153: -1- AH_OUTPUT([HAVE_INET_ATON], [/* Define to 1 if you have the `inet_aton\' function. */
-@%:@undef HAVE_INET_ATON])
-m4trace:configure.ac:1153: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
-m4trace:configure.ac:1153: -1- m4_pattern_allow([^HAVE_INET_ATON$])
-m4trace:configure.ac:1153: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
-m4trace:configure.ac:1153: -1- m4_pattern_allow([^HAVE_INET_ATON$])
-m4trace:configure.ac:1153: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
-m4trace:configure.ac:1153: -1- m4_pattern_allow([^HAVE_INET_ATON$])
-m4trace:configure.ac:1153: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
-m4trace:configure.ac:1153: -1- m4_pattern_allow([^HAVE_INET_ATON$])
-m4trace:configure.ac:1153: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
-m4trace:configure.ac:1153: -1- m4_pattern_allow([^HAVE_INET_ATON$])
-m4trace:configure.ac:1153: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
-m4trace:configure.ac:1153: -1- m4_pattern_allow([^HAVE_INET_ATON$])
-m4trace:configure.ac:1174: -1- AH_OUTPUT([HAVE_INET_PTON], [/* Define to 1 if you have the `inet_pton\' function. */
-@%:@undef HAVE_INET_PTON])
-m4trace:configure.ac:1174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
-m4trace:configure.ac:1174: -1- m4_pattern_allow([^HAVE_INET_PTON$])
-m4trace:configure.ac:1174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
-m4trace:configure.ac:1174: -1- m4_pattern_allow([^HAVE_INET_PTON$])
-m4trace:configure.ac:1174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
-m4trace:configure.ac:1174: -1- m4_pattern_allow([^HAVE_INET_PTON$])
-m4trace:configure.ac:1174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
-m4trace:configure.ac:1174: -1- m4_pattern_allow([^HAVE_INET_PTON$])
-m4trace:configure.ac:1174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
-m4trace:configure.ac:1174: -1- m4_pattern_allow([^HAVE_INET_PTON$])
-m4trace:configure.ac:1174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
-m4trace:configure.ac:1174: -1- m4_pattern_allow([^HAVE_INET_PTON$])
-m4trace:configure.ac:1195: -1- AH_OUTPUT([HAVE_INET_NTOP], [/* Define to 1 if you have the `inet_ntop\' function. */
-@%:@undef HAVE_INET_NTOP])
-m4trace:configure.ac:1195: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
-m4trace:configure.ac:1195: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
-m4trace:configure.ac:1195: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
-m4trace:configure.ac:1195: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
-m4trace:configure.ac:1195: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
-m4trace:configure.ac:1195: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
-m4trace:configure.ac:1195: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
-m4trace:configure.ac:1195: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
-m4trace:configure.ac:1195: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
-m4trace:configure.ac:1195: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
-m4trace:configure.ac:1195: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
-m4trace:configure.ac:1195: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
-m4trace:configure.ac:1223: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2764: AC_TRY_RUN is expanded from...
-configure.ac:1223: the top level])
-m4trace:configure.ac:1223: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PROC_PID_EXE])
-m4trace:configure.ac:1223: -1- m4_pattern_allow([^HAVE_PROC_PID_EXE$])
-m4trace:configure.ac:1274: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1274: the top level])
-m4trace:configure.ac:1274: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SSIZE_T])
-m4trace:configure.ac:1274: -1- m4_pattern_allow([^HAVE_SSIZE_T$])
-m4trace:configure.ac:1289: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1289: the top level])
-m4trace:configure.ac:1289: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT8_T])
-m4trace:configure.ac:1289: -1- m4_pattern_allow([^HAVE_INT8_T$])
-m4trace:configure.ac:1307: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1307: the top level])
-m4trace:configure.ac:1307: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT16_T])
-m4trace:configure.ac:1307: -1- m4_pattern_allow([^HAVE_INT16_T$])
-m4trace:configure.ac:1325: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1325: the top level])
-m4trace:configure.ac:1325: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT32_T])
-m4trace:configure.ac:1325: -1- m4_pattern_allow([^HAVE_INT32_T$])
-m4trace:configure.ac:1344: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1344: the top level])
-m4trace:configure.ac:1344: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINT8_T])
-m4trace:configure.ac:1344: -1- m4_pattern_allow([^HAVE_UINT8_T$])
-m4trace:configure.ac:1363: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1363: the top level])
-m4trace:configure.ac:1363: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINT16_T])
-m4trace:configure.ac:1363: -1- m4_pattern_allow([^HAVE_UINT16_T$])
-m4trace:configure.ac:1382: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1382: the top level])
-m4trace:configure.ac:1382: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINT32_T])
-m4trace:configure.ac:1382: -1- m4_pattern_allow([^HAVE_UINT32_T$])
-m4trace:configure.ac:1401: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1401: the top level])
-m4trace:configure.ac:1401: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_T])
-m4trace:configure.ac:1401: -1- m4_pattern_allow([^HAVE_DEV_T$])
-m4trace:configure.ac:1418: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1418: the top level])
-m4trace:configure.ac:1418: -1- AC_DEFINE_TRACE_LITERAL([HAVE__DEV_T])
-m4trace:configure.ac:1418: -1- m4_pattern_allow([^HAVE__DEV_T$])
-m4trace:configure.ac:1435: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1435: the top level])
-m4trace:configure.ac:1435: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INO_T])
-m4trace:configure.ac:1435: -1- m4_pattern_allow([^HAVE_INO_T$])
-m4trace:configure.ac:1452: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1452: the top level])
-m4trace:configure.ac:1452: -1- AC_DEFINE_TRACE_LITERAL([HAVE__INO_T])
-m4trace:configure.ac:1452: -1- m4_pattern_allow([^HAVE__INO_T$])
-m4trace:configure.ac:1469: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1469: the top level])
-m4trace:configure.ac:1469: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INO64_T])
-m4trace:configure.ac:1469: -1- m4_pattern_allow([^HAVE_INO64_T$])
-m4trace:configure.ac:1487: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1487: the top level])
-m4trace:configure.ac:1487: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MODE_T])
-m4trace:configure.ac:1487: -1- m4_pattern_allow([^HAVE_MODE_T$])
-m4trace:configure.ac:1504: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1504: the top level])
-m4trace:configure.ac:1504: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NLINK_T])
-m4trace:configure.ac:1504: -1- m4_pattern_allow([^HAVE_NLINK_T$])
-m4trace:configure.ac:1521: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1521: the top level])
-m4trace:configure.ac:1521: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UID_T])
-m4trace:configure.ac:1521: -1- m4_pattern_allow([^HAVE_UID_T$])
-m4trace:configure.ac:1538: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1538: the top level])
-m4trace:configure.ac:1538: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GID_T])
-m4trace:configure.ac:1538: -1- m4_pattern_allow([^HAVE_GID_T$])
-m4trace:configure.ac:1555: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1555: the top level])
-m4trace:configure.ac:1555: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OFF_T])
-m4trace:configure.ac:1555: -1- m4_pattern_allow([^HAVE_OFF_T$])
-m4trace:configure.ac:1572: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1572: the top level])
-m4trace:configure.ac:1572: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OFF64_T])
-m4trace:configure.ac:1572: -1- m4_pattern_allow([^HAVE_OFF64_T$])
-m4trace:configure.ac:1590: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1590: the top level])
-m4trace:configure.ac:1590: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BLKSIZE_T])
-m4trace:configure.ac:1590: -1- m4_pattern_allow([^HAVE_BLKSIZE_T$])
-m4trace:configure.ac:1607: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1607: the top level])
-m4trace:configure.ac:1607: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BLKCNT_T])
-m4trace:configure.ac:1607: -1- m4_pattern_allow([^HAVE_BLKCNT_T$])
-m4trace:configure.ac:1624: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1624: the top level])
-m4trace:configure.ac:1624: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FPOS_T])
-m4trace:configure.ac:1624: -1- m4_pattern_allow([^HAVE_FPOS_T$])
-m4trace:configure.ac:1642: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1642: the top level])
-m4trace:configure.ac:1642: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FILE_BLKSIZECNT])
-m4trace:configure.ac:1642: -1- m4_pattern_allow([^HAVE_FILE_BLKSIZECNT$])
-m4trace:configure.ac:1670: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1670: the top level])
-m4trace:configure.ac:1670: -1- AC_DEFINE_TRACE_LITERAL([HAVE__FPOS_T])
-m4trace:configure.ac:1670: -1- m4_pattern_allow([^HAVE__FPOS_T$])
-m4trace:configure.ac:1688: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1688: the top level])
-m4trace:configure.ac:1688: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKLEN_T])
-m4trace:configure.ac:1688: -1- m4_pattern_allow([^HAVE_SOCKLEN_T$])
-m4trace:configure.ac:1712: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1712: the top level])
-m4trace:configure.ac:1712: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_IN])
-m4trace:configure.ac:1712: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_IN$])
-m4trace:configure.ac:1736: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1736: the top level])
-m4trace:configure.ac:1736: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_IN6])
-m4trace:configure.ac:1736: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_IN6$])
-m4trace:configure.ac:1760: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1760: the top level])
-m4trace:configure.ac:1760: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_UN])
-m4trace:configure.ac:1760: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_UN$])
-m4trace:configure.ac:1787: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1787: the top level])
-m4trace:configure.ac:1787: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_ADDRINFO])
-m4trace:configure.ac:1787: -1- m4_pattern_allow([^HAVE_STRUCT_ADDRINFO$])
-m4trace:configure.ac:1811: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1811: the top level])
-m4trace:configure.ac:1811: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE])
-m4trace:configure.ac:1811: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE$])
-m4trace:configure.ac:1841: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1841: the top level])
-m4trace:configure.ac:1841: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IN_ADDR])
-m4trace:configure.ac:1841: -1- m4_pattern_allow([^HAVE_IN_ADDR$])
-m4trace:configure.ac:1874: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1874: the top level])
-m4trace:configure.ac:1874: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IN6_ADDR])
-m4trace:configure.ac:1874: -1- m4_pattern_allow([^HAVE_IN6_ADDR$])
-m4trace:configure.ac:1907: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1907: the top level])
-m4trace:configure.ac:1907: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RAND])
-m4trace:configure.ac:1907: -1- m4_pattern_allow([^HAVE_RAND$])
-m4trace:configure.ac:1907: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SRAND])
-m4trace:configure.ac:1907: -1- m4_pattern_allow([^HAVE_SRAND$])
-m4trace:configure.ac:1919: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1919: the top level])
-m4trace:configure.ac:1919: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INITSTATE])
-m4trace:configure.ac:1919: -1- m4_pattern_allow([^HAVE_INITSTATE$])
-m4trace:configure.ac:1919: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSTATE])
-m4trace:configure.ac:1919: -1- m4_pattern_allow([^HAVE_SETSTATE$])
-m4trace:configure.ac:1919: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RANDOM])
-m4trace:configure.ac:1919: -1- m4_pattern_allow([^HAVE_RANDOM$])
-m4trace:configure.ac:1936: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:1936: the top level])
-m4trace:configure.ac:1936: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LRAND48])
-m4trace:configure.ac:1936: -1- m4_pattern_allow([^HAVE_LRAND48$])
-m4trace:configure.ac:1936: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NRAND48])
-m4trace:configure.ac:1936: -1- m4_pattern_allow([^HAVE_NRAND48$])
-m4trace:configure.ac:1954: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_OFF_T])
-m4trace:configure.ac:1954: -1- m4_pattern_allow([^SIZEOF_OFF_T$])
-m4trace:configure.ac:1954: -1- AH_OUTPUT([SIZEOF_OFF_T], [/* The size of `off_t\', as computed by sizeof. */
-@%:@undef SIZEOF_OFF_T])
-m4trace:configure.ac:1955: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_OFF64_T])
-m4trace:configure.ac:1955: -1- m4_pattern_allow([^SIZEOF_OFF64_T$])
-m4trace:configure.ac:1955: -1- AH_OUTPUT([SIZEOF_OFF64_T], [/* The size of `off64_t\', as computed by sizeof. */
-@%:@undef SIZEOF_OFF64_T])
-m4trace:configure.ac:1956: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INO_T])
-m4trace:configure.ac:1956: -1- m4_pattern_allow([^SIZEOF_INO_T$])
-m4trace:configure.ac:1956: -1- AH_OUTPUT([SIZEOF_INO_T], [/* The size of `ino_t\', as computed by sizeof. */
-@%:@undef SIZEOF_INO_T])
-m4trace:configure.ac:1957: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INO64_T])
-m4trace:configure.ac:1957: -1- m4_pattern_allow([^SIZEOF_INO64_T$])
-m4trace:configure.ac:1957: -1- AH_OUTPUT([SIZEOF_INO64_T], [/* The size of `ino64_t\', as computed by sizeof. */
-@%:@undef SIZEOF_INO64_T])
-m4trace:configure.ac:1962: -1- AC_DEFINE_TRACE_LITERAL([USE_FALLBACK_NUMERIC_LIMITS])
-m4trace:configure.ac:1962: -1- m4_pattern_allow([^USE_FALLBACK_NUMERIC_LIMITS$])
-m4trace:configure.ac:1971: -1- AC_DEFINE_TRACE_LITERAL([USE_PRINTF_SCANF])
-m4trace:configure.ac:1971: -1- m4_pattern_allow([^USE_PRINTF_SCANF$])
-m4trace:configure.ac:1975: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FILE_DEVINO])
-m4trace:configure.ac:1975: -1- m4_pattern_allow([^HAVE_FILE_DEVINO$])
-m4trace:configure.ac:1976: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FILE_UIDGID])
-m4trace:configure.ac:1976: -1- m4_pattern_allow([^HAVE_FILE_UIDGID$])
-m4trace:configure.ac:1977: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FILE_ATIMECTIME])
-m4trace:configure.ac:1977: -1- m4_pattern_allow([^HAVE_FILE_ATIMECTIME$])
-m4trace:configure.ac:1981: -1- AC_DEFINE_TRACE_LITERAL([HAVE_COMPATDKTOOLS3])
-m4trace:configure.ac:1981: -1- m4_pattern_allow([^HAVE_COMPATDKTOOLS3$])
-m4trace:configure.ac:1998: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WXWIDGETS])
-m4trace:configure.ac:1998: -1- m4_pattern_allow([^HAVE_WXWIDGETS$])
-m4trace:configure.ac:2018: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WX_CHARTYPE_H])
-m4trace:configure.ac:2018: -1- m4_pattern_allow([^HAVE_WX_CHARTYPE_H$])
-m4trace:configure.ac:2021: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WX_WXCHAR_H])
-m4trace:configure.ac:2021: -1- m4_pattern_allow([^HAVE_WX_WXCHAR_H$])
-m4trace:configure.ac:2041: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STDIO_H])
-m4trace:configure.ac:2041: -2- m4_pattern_allow([^HAVE_STDIO_H$])
-m4trace:configure.ac:2041: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2041: the top level])
-m4trace:configure.ac:2042: -2- AC_DEFINE_TRACE_LITERAL([HAVE_CONIO_H])
-m4trace:configure.ac:2042: -2- m4_pattern_allow([^HAVE_CONIO_H$])
-m4trace:configure.ac:2042: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2042: the top level])
-m4trace:configure.ac:2043: -2- AC_DEFINE_TRACE_LITERAL([HAVE_GRP_H])
-m4trace:configure.ac:2043: -2- m4_pattern_allow([^HAVE_GRP_H$])
-m4trace:configure.ac:2043: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2043: the top level])
-m4trace:configure.ac:2044: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2044: the top level])
-m4trace:configure.ac:2045: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2045: the top level])
-m4trace:configure.ac:2048: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NDBM_H])
-m4trace:configure.ac:2048: -1- m4_pattern_allow([^HAVE_NDBM_H$])
-m4trace:configure.ac:2052: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NDBM_H])
-m4trace:configure.ac:2052: -1- m4_pattern_allow([^HAVE_NDBM_H$])
-m4trace:configure.ac:2056: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NDBM_H])
-m4trace:configure.ac:2056: -1- m4_pattern_allow([^HAVE_NDBM_H$])
-m4trace:configure.ac:2062: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GDBM_H])
-m4trace:configure.ac:2062: -1- m4_pattern_allow([^HAVE_GDBM_H$])
-m4trace:configure.ac:2064: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2064: the top level])
-m4trace:configure.ac:2064: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DB_H])
-m4trace:configure.ac:2064: -1- m4_pattern_allow([^HAVE_DB_H$])
-m4trace:configure.ac:2065: -2- AC_DEFINE_TRACE_LITERAL([HAVE_DIR_H])
-m4trace:configure.ac:2065: -2- m4_pattern_allow([^HAVE_DIR_H$])
-m4trace:configure.ac:2065: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2065: the top level])
-m4trace:configure.ac:2066: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ERR_H])
-m4trace:configure.ac:2066: -2- m4_pattern_allow([^HAVE_ERR_H$])
-m4trace:configure.ac:2066: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2066: the top level])
-m4trace:configure.ac:2067: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SHADOW_H])
-m4trace:configure.ac:2067: -2- m4_pattern_allow([^HAVE_SHADOW_H$])
-m4trace:configure.ac:2067: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2067: the top level])
-m4trace:configure.ac:2068: -2- AC_DEFINE_TRACE_LITERAL([HAVE_STROPTS_H])
-m4trace:configure.ac:2068: -2- m4_pattern_allow([^HAVE_STROPTS_H$])
-m4trace:configure.ac:2068: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2068: the top level])
-m4trace:configure.ac:2069: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYSLOG_H])
-m4trace:configure.ac:2069: -2- m4_pattern_allow([^HAVE_SYSLOG_H$])
-m4trace:configure.ac:2069: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2069: the top level])
-m4trace:configure.ac:2070: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYSRES_H])
-m4trace:configure.ac:2070: -2- m4_pattern_allow([^HAVE_SYSRES_H$])
-m4trace:configure.ac:2070: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2070: the top level])
-m4trace:configure.ac:2071: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TERMIOS_H])
-m4trace:configure.ac:2071: -2- m4_pattern_allow([^HAVE_TERMIOS_H$])
-m4trace:configure.ac:2071: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2071: the top level])
-m4trace:configure.ac:2072: -2- AC_DEFINE_TRACE_LITERAL([HAVE_VARARG_H])
-m4trace:configure.ac:2072: -2- m4_pattern_allow([^HAVE_VARARG_H$])
-m4trace:configure.ac:2072: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2072: the top level])
-m4trace:configure.ac:2073: -2- AC_DEFINE_TRACE_LITERAL([HAVE_VARARGS_H])
-m4trace:configure.ac:2073: -2- m4_pattern_allow([^HAVE_VARARGS_H$])
-m4trace:configure.ac:2073: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2073: the top level])
-m4trace:configure.ac:2074: -2- AC_DEFINE_TRACE_LITERAL([HAVE_NTIFS_H])
-m4trace:configure.ac:2074: -2- m4_pattern_allow([^HAVE_NTIFS_H$])
-m4trace:configure.ac:2074: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2074: the top level])
-m4trace:configure.ac:2075: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_FILE_H])
-m4trace:configure.ac:2075: -2- m4_pattern_allow([^HAVE_SYS_FILE_H$])
-m4trace:configure.ac:2075: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2075: the top level])
-m4trace:configure.ac:2076: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_RESOURCE_H])
-m4trace:configure.ac:2076: -2- m4_pattern_allow([^HAVE_SYS_RESOURCE_H$])
-m4trace:configure.ac:2076: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2076: the top level])
-m4trace:configure.ac:2077: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_STATVFS_H])
-m4trace:configure.ac:2077: -2- m4_pattern_allow([^HAVE_SYS_STATVFS_H$])
-m4trace:configure.ac:2077: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2077: the top level])
-m4trace:configure.ac:2078: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_STROPTS_H])
-m4trace:configure.ac:2078: -2- m4_pattern_allow([^HAVE_SYS_STROPTS_H$])
-m4trace:configure.ac:2078: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2078: the top level])
-m4trace:configure.ac:2079: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SUNDDI_H])
-m4trace:configure.ac:2079: -2- m4_pattern_allow([^HAVE_SYS_SUNDDI_H$])
-m4trace:configure.ac:2079: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2079: the top level])
-m4trace:configure.ac:2080: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SYSCTL_H])
-m4trace:configure.ac:2080: -2- m4_pattern_allow([^HAVE_SYS_SYSCTL_H$])
-m4trace:configure.ac:2080: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2080: the top level])
-m4trace:configure.ac:2081: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SYSTEMINFO_H])
-m4trace:configure.ac:2081: -2- m4_pattern_allow([^HAVE_SYS_SYSTEMINFO_H$])
-m4trace:configure.ac:2081: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2081: the top level])
-m4trace:configure.ac:2082: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TERMIOS_H])
-m4trace:configure.ac:2082: -2- m4_pattern_allow([^HAVE_SYS_TERMIOS_H$])
-m4trace:configure.ac:2082: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2082: the top level])
-m4trace:configure.ac:2083: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TTOLD_H])
-m4trace:configure.ac:2083: -2- m4_pattern_allow([^HAVE_SYS_TTOLD_H$])
-m4trace:configure.ac:2083: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2083: the top level])
-m4trace:configure.ac:2084: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_UIO_H])
-m4trace:configure.ac:2084: -2- m4_pattern_allow([^HAVE_SYS_UIO_H$])
-m4trace:configure.ac:2084: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2084: the top level])
-m4trace:configure.ac:2085: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_WAIT_H])
-m4trace:configure.ac:2085: -2- m4_pattern_allow([^HAVE_SYS_WAIT_H$])
-m4trace:configure.ac:2085: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2085: the top level])
-m4trace:configure.ac:2087: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2087: the top level])
-m4trace:configure.ac:2087: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINBASE_H])
-m4trace:configure.ac:2087: -1- m4_pattern_allow([^HAVE_WINBASE_H$])
-m4trace:configure.ac:2092: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2092: the top level])
-m4trace:configure.ac:2092: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINREG_H])
-m4trace:configure.ac:2092: -1- m4_pattern_allow([^HAVE_WINREG_H$])
-m4trace:configure.ac:2100: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2100: the top level])
-m4trace:configure.ac:2100: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WINCON_H])
-m4trace:configure.ac:2100: -1- m4_pattern_allow([^HAVE_WINCON_H$])
-m4trace:configure.ac:2108: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2108: the top level])
-m4trace:configure.ac:2108: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PNG_H])
-m4trace:configure.ac:2108: -1- m4_pattern_allow([^HAVE_PNG_H$])
-m4trace:configure.ac:2109: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2109: the top level])
-m4trace:configure.ac:2109: -1- AC_DEFINE_TRACE_LITERAL([HAVE_JPEGLIB_H])
-m4trace:configure.ac:2109: -1- m4_pattern_allow([^HAVE_JPEGLIB_H$])
-m4trace:configure.ac:2110: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2110: the top level])
-m4trace:configure.ac:2110: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TIFF_H])
-m4trace:configure.ac:2110: -1- m4_pattern_allow([^HAVE_TIFF_H$])
-m4trace:configure.ac:2111: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2111: the top level])
-m4trace:configure.ac:2111: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MYSQL_MYSQL_H])
-m4trace:configure.ac:2111: -1- m4_pattern_allow([^HAVE_MYSQL_MYSQL_H$])
-m4trace:configure.ac:2111: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
-../../lib/autoconf/headers.m4:129: _AC_CHECK_HEADER_MONGREL is expanded from...
-../../lib/autoconf/headers.m4:67: AC_CHECK_HEADER is expanded from...
-../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2111: the top level])
-m4trace:configure.ac:2111: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MYSQL_H])
-m4trace:configure.ac:2111: -1- m4_pattern_allow([^HAVE_MYSQL_H$])
-m4trace:configure.ac:2124: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LPRNG_H])
-m4trace:configure.ac:2124: -2- m4_pattern_allow([^HAVE_LPRNG_H$])
-m4trace:configure.ac:2124: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2124: the top level])
-m4trace:configure.ac:2125: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
-configure.ac:2125: the top level])
-m4trace:configure.ac:2125: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PTHREAD_H])
-m4trace:configure.ac:2125: -1- m4_pattern_allow([^HAVE_PTHREAD_H$])
-m4trace:configure.ac:2126: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ACOSH])
-m4trace:configure.ac:2126: -2- m4_pattern_allow([^HAVE_ACOSH$])
-m4trace:configure.ac:2127: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ACOSHL])
-m4trace:configure.ac:2127: -2- m4_pattern_allow([^HAVE_ACOSHL$])
-m4trace:configure.ac:2128: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ACOSL])
-m4trace:configure.ac:2128: -2- m4_pattern_allow([^HAVE_ACOSL$])
-m4trace:configure.ac:2129: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ASINH])
-m4trace:configure.ac:2129: -2- m4_pattern_allow([^HAVE_ASINH$])
-m4trace:configure.ac:2130: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ASINHL])
-m4trace:configure.ac:2130: -2- m4_pattern_allow([^HAVE_ASINHL$])
-m4trace:configure.ac:2131: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ASINL])
-m4trace:configure.ac:2131: -2- m4_pattern_allow([^HAVE_ASINL$])
-m4trace:configure.ac:2132: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATAN2])
-m4trace:configure.ac:2132: -2- m4_pattern_allow([^HAVE_ATAN2$])
-m4trace:configure.ac:2133: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATAN2L])
-m4trace:configure.ac:2133: -2- m4_pattern_allow([^HAVE_ATAN2L$])
-m4trace:configure.ac:2134: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATANH])
-m4trace:configure.ac:2134: -2- m4_pattern_allow([^HAVE_ATANH$])
-m4trace:configure.ac:2135: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATANHL])
-m4trace:configure.ac:2135: -2- m4_pattern_allow([^HAVE_ATANHL$])
-m4trace:configure.ac:2136: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATANL])
-m4trace:configure.ac:2136: -2- m4_pattern_allow([^HAVE_ATANL$])
-m4trace:configure.ac:2137: -2- AC_DEFINE_TRACE_LITERAL([HAVE_CEIL])
-m4trace:configure.ac:2137: -2- m4_pattern_allow([^HAVE_CEIL$])
-m4trace:configure.ac:2138: -2- AC_DEFINE_TRACE_LITERAL([HAVE_CEILL])
-m4trace:configure.ac:2138: -2- m4_pattern_allow([^HAVE_CEILL$])
-m4trace:configure.ac:2139: -2- AC_DEFINE_TRACE_LITERAL([HAVE_COSHL])
-m4trace:configure.ac:2139: -2- m4_pattern_allow([^HAVE_COSHL$])
-m4trace:configure.ac:2140: -2- AC_DEFINE_TRACE_LITERAL([HAVE_COSL])
-m4trace:configure.ac:2140: -2- m4_pattern_allow([^HAVE_COSL$])
-m4trace:configure.ac:2141: -2- AC_DEFINE_TRACE_LITERAL([HAVE_EXPL])
-m4trace:configure.ac:2141: -2- m4_pattern_allow([^HAVE_EXPL$])
-m4trace:configure.ac:2142: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FABS])
-m4trace:configure.ac:2142: -2- m4_pattern_allow([^HAVE_FABS$])
-m4trace:configure.ac:2143: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FABSL])
-m4trace:configure.ac:2143: -2- m4_pattern_allow([^HAVE_FABSL$])
-m4trace:configure.ac:2144: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FLOOR])
-m4trace:configure.ac:2144: -2- m4_pattern_allow([^HAVE_FLOOR$])
-m4trace:configure.ac:2145: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FLOORL])
-m4trace:configure.ac:2145: -2- m4_pattern_allow([^HAVE_FLOORL$])
-m4trace:configure.ac:2146: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LABS])
-m4trace:configure.ac:2146: -2- m4_pattern_allow([^HAVE_LABS$])
-m4trace:configure.ac:2147: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LOGL])
-m4trace:configure.ac:2147: -2- m4_pattern_allow([^HAVE_LOGL$])
-m4trace:configure.ac:2148: -2- AC_DEFINE_TRACE_LITERAL([HAVE_RINT])
-m4trace:configure.ac:2148: -2- m4_pattern_allow([^HAVE_RINT$])
-m4trace:configure.ac:2149: -2- AC_DEFINE_TRACE_LITERAL([HAVE_RINTL])
-m4trace:configure.ac:2149: -2- m4_pattern_allow([^HAVE_RINTL$])
-m4trace:configure.ac:2150: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SINHL])
-m4trace:configure.ac:2150: -2- m4_pattern_allow([^HAVE_SINHL$])
-m4trace:configure.ac:2151: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SQRT])
-m4trace:configure.ac:2151: -2- m4_pattern_allow([^HAVE_SQRT$])
-m4trace:configure.ac:2152: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SQRTL])
-m4trace:configure.ac:2152: -2- m4_pattern_allow([^HAVE_SQRTL$])
-m4trace:configure.ac:2153: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SINL])
-m4trace:configure.ac:2153: -2- m4_pattern_allow([^HAVE_SINL$])
-m4trace:configure.ac:2154: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TANHL])
-m4trace:configure.ac:2154: -2- m4_pattern_allow([^HAVE_TANHL$])
-m4trace:configure.ac:2155: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TANL])
-m4trace:configure.ac:2155: -2- m4_pattern_allow([^HAVE_TANL$])
-m4trace:configure.ac:2156: -2- AC_DEFINE_TRACE_LITERAL([HAVE_PNG_GET_PIXELS_PER_INCH])
-m4trace:configure.ac:2156: -2- m4_pattern_allow([^HAVE_PNG_GET_PIXELS_PER_INCH$])
-m4trace:configure.ac:2157: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1624: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2157: the top level])
-m4trace:configure.ac:2157: -1- AH_OUTPUT([HAVE_GETUID], [/* Define to 1 if you have the `getuid\' function. */
+configure.ac:1624: the top level])
+m4trace:configure.ac:1624: -1- AH_OUTPUT([HAVE_GETUID], [/* Define to 1 if you have the `getuid\' function. */
@%:@undef HAVE_GETUID])
-m4trace:configure.ac:2157: -1- AH_OUTPUT([HAVE_SETUID], [/* Define to 1 if you have the `setuid\' function. */
+m4trace:configure.ac:1624: -1- AH_OUTPUT([HAVE_SETUID], [/* Define to 1 if you have the `setuid\' function. */
@%:@undef HAVE_SETUID])
-m4trace:configure.ac:2157: -1- AH_OUTPUT([HAVE_SETGID], [/* Define to 1 if you have the `setgid\' function. */
+m4trace:configure.ac:1624: -1- AH_OUTPUT([HAVE_SETGID], [/* Define to 1 if you have the `setgid\' function. */
@%:@undef HAVE_SETGID])
-m4trace:configure.ac:2158: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1625: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2158: the top level])
-m4trace:configure.ac:2158: -1- AH_OUTPUT([HAVE_CHDIR], [/* Define to 1 if you have the `chdir\' function. */
+configure.ac:1625: the top level])
+m4trace:configure.ac:1625: -1- AH_OUTPUT([HAVE_CHDIR], [/* Define to 1 if you have the `chdir\' function. */
@%:@undef HAVE_CHDIR])
-m4trace:configure.ac:2158: -1- AH_OUTPUT([HAVE_CHMOD], [/* Define to 1 if you have the `chmod\' function. */
+m4trace:configure.ac:1625: -1- AH_OUTPUT([HAVE_CHMOD], [/* Define to 1 if you have the `chmod\' function. */
@%:@undef HAVE_CHMOD])
-m4trace:configure.ac:2158: -1- AH_OUTPUT([HAVE_CHOWN], [/* Define to 1 if you have the `chown\' function. */
+m4trace:configure.ac:1625: -1- AH_OUTPUT([HAVE_CHOWN], [/* Define to 1 if you have the `chown\' function. */
@%:@undef HAVE_CHOWN])
-m4trace:configure.ac:2159: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1626: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2159: the top level])
-m4trace:configure.ac:2159: -1- AH_OUTPUT([HAVE_OPENDIR], [/* Define to 1 if you have the `opendir\' function. */
+configure.ac:1626: the top level])
+m4trace:configure.ac:1626: -1- AH_OUTPUT([HAVE_OPENDIR], [/* Define to 1 if you have the `opendir\' function. */
@%:@undef HAVE_OPENDIR])
-m4trace:configure.ac:2159: -1- AH_OUTPUT([HAVE_READDIR], [/* Define to 1 if you have the `readdir\' function. */
+m4trace:configure.ac:1626: -1- AH_OUTPUT([HAVE_READDIR], [/* Define to 1 if you have the `readdir\' function. */
@%:@undef HAVE_READDIR])
-m4trace:configure.ac:2159: -1- AH_OUTPUT([HAVE_CLOSEDIR], [/* Define to 1 if you have the `closedir\' function. */
+m4trace:configure.ac:1626: -1- AH_OUTPUT([HAVE_CLOSEDIR], [/* Define to 1 if you have the `closedir\' function. */
@%:@undef HAVE_CLOSEDIR])
-m4trace:configure.ac:2160: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1627: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2160: the top level])
-m4trace:configure.ac:2160: -1- AH_OUTPUT([HAVE_GETGRENT], [/* Define to 1 if you have the `getgrent\' function. */
+configure.ac:1627: the top level])
+m4trace:configure.ac:1627: -1- AH_OUTPUT([HAVE_GETGRENT], [/* Define to 1 if you have the `getgrent\' function. */
@%:@undef HAVE_GETGRENT])
-m4trace:configure.ac:2160: -1- AH_OUTPUT([HAVE_GETGRGID], [/* Define to 1 if you have the `getgrgid\' function. */
+m4trace:configure.ac:1627: -1- AH_OUTPUT([HAVE_GETGRGID], [/* Define to 1 if you have the `getgrgid\' function. */
@%:@undef HAVE_GETGRGID])
-m4trace:configure.ac:2160: -1- AH_OUTPUT([HAVE_GETGRNAM], [/* Define to 1 if you have the `getgrnam\' function. */
+m4trace:configure.ac:1627: -1- AH_OUTPUT([HAVE_GETGRNAM], [/* Define to 1 if you have the `getgrnam\' function. */
@%:@undef HAVE_GETGRNAM])
-m4trace:configure.ac:2160: -1- AH_OUTPUT([HAVE_ENDGRENT], [/* Define to 1 if you have the `endgrent\' function. */
+m4trace:configure.ac:1627: -1- AH_OUTPUT([HAVE_ENDGRENT], [/* Define to 1 if you have the `endgrent\' function. */
@%:@undef HAVE_ENDGRENT])
-m4trace:configure.ac:2160: -1- AH_OUTPUT([HAVE_SETGRENT], [/* Define to 1 if you have the `setgrent\' function. */
+m4trace:configure.ac:1627: -1- AH_OUTPUT([HAVE_SETGRENT], [/* Define to 1 if you have the `setgrent\' function. */
@%:@undef HAVE_SETGRENT])
-m4trace:configure.ac:2161: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1628: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2161: the top level])
-m4trace:configure.ac:2161: -1- AH_OUTPUT([HAVE_GETPWUID], [/* Define to 1 if you have the `getpwuid\' function. */
+configure.ac:1628: the top level])
+m4trace:configure.ac:1628: -1- AH_OUTPUT([HAVE_GETPWUID], [/* Define to 1 if you have the `getpwuid\' function. */
@%:@undef HAVE_GETPWUID])
-m4trace:configure.ac:2161: -1- AH_OUTPUT([HAVE_GETPWNAM], [/* Define to 1 if you have the `getpwnam\' function. */
+m4trace:configure.ac:1628: -1- AH_OUTPUT([HAVE_GETPWNAM], [/* Define to 1 if you have the `getpwnam\' function. */
@%:@undef HAVE_GETPWNAM])
-m4trace:configure.ac:2162: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1629: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2162: the top level])
-m4trace:configure.ac:2162: -1- AH_OUTPUT([HAVE_FOPEN], [/* Define to 1 if you have the `fopen\' function. */
+configure.ac:1629: the top level])
+m4trace:configure.ac:1629: -1- AH_OUTPUT([HAVE_FOPEN], [/* Define to 1 if you have the `fopen\' function. */
@%:@undef HAVE_FOPEN])
-m4trace:configure.ac:2162: -1- AH_OUTPUT([HAVE_FCLOSE], [/* Define to 1 if you have the `fclose\' function. */
+m4trace:configure.ac:1629: -1- AH_OUTPUT([HAVE_FCLOSE], [/* Define to 1 if you have the `fclose\' function. */
@%:@undef HAVE_FCLOSE])
-m4trace:configure.ac:2162: -1- AH_OUTPUT([HAVE_FEOF], [/* Define to 1 if you have the `feof\' function. */
+m4trace:configure.ac:1629: -1- AH_OUTPUT([HAVE_FEOF], [/* Define to 1 if you have the `feof\' function. */
@%:@undef HAVE_FEOF])
-m4trace:configure.ac:2162: -1- AH_OUTPUT([HAVE_FERROR], [/* Define to 1 if you have the `ferror\' function. */
+m4trace:configure.ac:1629: -1- AH_OUTPUT([HAVE_FERROR], [/* Define to 1 if you have the `ferror\' function. */
@%:@undef HAVE_FERROR])
-m4trace:configure.ac:2162: -1- AH_OUTPUT([HAVE_FFLUSH], [/* Define to 1 if you have the `fflush\' function. */
+m4trace:configure.ac:1629: -1- AH_OUTPUT([HAVE_FFLUSH], [/* Define to 1 if you have the `fflush\' function. */
@%:@undef HAVE_FFLUSH])
-m4trace:configure.ac:2162: -1- AH_OUTPUT([HAVE_FREAD], [/* Define to 1 if you have the `fread\' function. */
+m4trace:configure.ac:1629: -1- AH_OUTPUT([HAVE_FREAD], [/* Define to 1 if you have the `fread\' function. */
@%:@undef HAVE_FREAD])
-m4trace:configure.ac:2162: -1- AH_OUTPUT([HAVE_FWRITE], [/* Define to 1 if you have the `fwrite\' function. */
+m4trace:configure.ac:1629: -1- AH_OUTPUT([HAVE_FWRITE], [/* Define to 1 if you have the `fwrite\' function. */
@%:@undef HAVE_FWRITE])
-m4trace:configure.ac:2163: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1630: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2163: the top level])
-m4trace:configure.ac:2163: -1- AH_OUTPUT([HAVE__FCLOSE], [/* Define to 1 if you have the `_fclose\' function. */
+configure.ac:1630: the top level])
+m4trace:configure.ac:1630: -1- AH_OUTPUT([HAVE__FCLOSE], [/* Define to 1 if you have the `_fclose\' function. */
@%:@undef HAVE__FCLOSE])
-m4trace:configure.ac:2163: -1- AH_OUTPUT([HAVE__FEOF], [/* Define to 1 if you have the `_feof\' function. */
+m4trace:configure.ac:1630: -1- AH_OUTPUT([HAVE__FEOF], [/* Define to 1 if you have the `_feof\' function. */
@%:@undef HAVE__FEOF])
-m4trace:configure.ac:2163: -1- AH_OUTPUT([HAVE__FERROR], [/* Define to 1 if you have the `_ferror\' function. */
+m4trace:configure.ac:1630: -1- AH_OUTPUT([HAVE__FERROR], [/* Define to 1 if you have the `_ferror\' function. */
@%:@undef HAVE__FERROR])
-m4trace:configure.ac:2163: -1- AH_OUTPUT([HAVE__FFLUSH], [/* Define to 1 if you have the `_fflush\' function. */
+m4trace:configure.ac:1630: -1- AH_OUTPUT([HAVE__FFLUSH], [/* Define to 1 if you have the `_fflush\' function. */
@%:@undef HAVE__FFLUSH])
-m4trace:configure.ac:2163: -1- AH_OUTPUT([HAVE__FOPEN], [/* Define to 1 if you have the `_fopen\' function. */
+m4trace:configure.ac:1630: -1- AH_OUTPUT([HAVE__FOPEN], [/* Define to 1 if you have the `_fopen\' function. */
@%:@undef HAVE__FOPEN])
-m4trace:configure.ac:2163: -1- AH_OUTPUT([HAVE__FREAD], [/* Define to 1 if you have the `_fread\' function. */
+m4trace:configure.ac:1630: -1- AH_OUTPUT([HAVE__FREAD], [/* Define to 1 if you have the `_fread\' function. */
@%:@undef HAVE__FREAD])
-m4trace:configure.ac:2163: -1- AH_OUTPUT([HAVE__FWRITE], [/* Define to 1 if you have the `_fwrite\' function. */
+m4trace:configure.ac:1630: -1- AH_OUTPUT([HAVE__FWRITE], [/* Define to 1 if you have the `_fwrite\' function. */
@%:@undef HAVE__FWRITE])
-m4trace:configure.ac:2164: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1631: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2164: the top level])
-m4trace:configure.ac:2164: -1- AH_OUTPUT([HAVE__GETENV_S], [/* Define to 1 if you have the `_getenv_s\' function. */
+configure.ac:1631: the top level])
+m4trace:configure.ac:1631: -1- AH_OUTPUT([HAVE__GETENV_S], [/* Define to 1 if you have the `_getenv_s\' function. */
@%:@undef HAVE__GETENV_S])
-m4trace:configure.ac:2164: -1- AH_OUTPUT([HAVE__WGETENV], [/* Define to 1 if you have the `_wgetenv\' function. */
+m4trace:configure.ac:1631: -1- AH_OUTPUT([HAVE__WGETENV], [/* Define to 1 if you have the `_wgetenv\' function. */
@%:@undef HAVE__WGETENV])
-m4trace:configure.ac:2164: -1- AH_OUTPUT([HAVE__GETPID], [/* Define to 1 if you have the `_getpid\' function. */
+m4trace:configure.ac:1631: -1- AH_OUTPUT([HAVE__GETPID], [/* Define to 1 if you have the `_getpid\' function. */
@%:@undef HAVE__GETPID])
-m4trace:configure.ac:2165: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1632: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2165: the top level])
-m4trace:configure.ac:2165: -1- AH_OUTPUT([HAVE_FETESTEXCEPT], [/* Define to 1 if you have the `fetestexcept\' function. */
+configure.ac:1632: the top level])
+m4trace:configure.ac:1632: -1- AH_OUTPUT([HAVE_FETESTEXCEPT], [/* Define to 1 if you have the `fetestexcept\' function. */
@%:@undef HAVE_FETESTEXCEPT])
-m4trace:configure.ac:2165: -1- AH_OUTPUT([HAVE__CLEARFP], [/* Define to 1 if you have the `_clearfp\' function. */
+m4trace:configure.ac:1632: -1- AH_OUTPUT([HAVE__CLEARFP], [/* Define to 1 if you have the `_clearfp\' function. */
@%:@undef HAVE__CLEARFP])
-m4trace:configure.ac:2166: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1633: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2166: the top level])
-m4trace:configure.ac:2166: -1- AH_OUTPUT([HAVE_FORK], [/* Define to 1 if you have the `fork\' function. */
+configure.ac:1633: the top level])
+m4trace:configure.ac:1633: -1- AH_OUTPUT([HAVE_FORK], [/* Define to 1 if you have the `fork\' function. */
@%:@undef HAVE_FORK])
-m4trace:configure.ac:2166: -1- AH_OUTPUT([HAVE_GETRLIMIT], [/* Define to 1 if you have the `getrlimit\' function. */
+m4trace:configure.ac:1633: -1- AH_OUTPUT([HAVE_GETRLIMIT], [/* Define to 1 if you have the `getrlimit\' function. */
@%:@undef HAVE_GETRLIMIT])
-m4trace:configure.ac:2166: -1- AH_OUTPUT([HAVE_SETPGRP], [/* Define to 1 if you have the `setpgrp\' function. */
+m4trace:configure.ac:1633: -1- AH_OUTPUT([HAVE_SETPGRP], [/* Define to 1 if you have the `setpgrp\' function. */
@%:@undef HAVE_SETPGRP])
-m4trace:configure.ac:2166: -1- AH_OUTPUT([HAVE_SETSID], [/* Define to 1 if you have the `setsid\' function. */
+m4trace:configure.ac:1633: -1- AH_OUTPUT([HAVE_SETSID], [/* Define to 1 if you have the `setsid\' function. */
@%:@undef HAVE_SETSID])
-m4trace:configure.ac:2166: -1- AH_OUTPUT([HAVE_SYSLOG], [/* Define to 1 if you have the `syslog\' function. */
+m4trace:configure.ac:1633: -1- AH_OUTPUT([HAVE_SYSLOG], [/* Define to 1 if you have the `syslog\' function. */
@%:@undef HAVE_SYSLOG])
-m4trace:configure.ac:2167: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1634: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2167: the top level])
-m4trace:configure.ac:2167: -1- AH_OUTPUT([HAVE_GETHOSTNAME], [/* Define to 1 if you have the `gethostname\' function. */
+configure.ac:1634: the top level])
+m4trace:configure.ac:1634: -1- AH_OUTPUT([HAVE_GETHOSTNAME], [/* Define to 1 if you have the `gethostname\' function. */
@%:@undef HAVE_GETHOSTNAME])
-m4trace:configure.ac:2167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTNAME])
-m4trace:configure.ac:2167: -1- m4_pattern_allow([^HAVE_GETHOSTNAME$])
-m4trace:configure.ac:2168: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1634: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTNAME])
+m4trace:configure.ac:1634: -1- m4_pattern_allow([^HAVE_GETHOSTNAME$])
+m4trace:configure.ac:1635: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2168: the top level])
-m4trace:configure.ac:2168: -1- AH_OUTPUT([HAVE_TIME], [/* Define to 1 if you have the `time\' function. */
+configure.ac:1635: the top level])
+m4trace:configure.ac:1635: -1- AH_OUTPUT([HAVE_TIME], [/* Define to 1 if you have the `time\' function. */
@%:@undef HAVE_TIME])
-m4trace:configure.ac:2168: -1- AH_OUTPUT([HAVE_LOCALTIME], [/* Define to 1 if you have the `localtime\' function. */
+m4trace:configure.ac:1635: -1- AH_OUTPUT([HAVE_LOCALTIME], [/* Define to 1 if you have the `localtime\' function. */
@%:@undef HAVE_LOCALTIME])
-m4trace:configure.ac:2168: -1- AH_OUTPUT([HAVE_LOCALTIME_S], [/* Define to 1 if you have the `localtime_s\' function. */
+m4trace:configure.ac:1635: -1- AH_OUTPUT([HAVE_LOCALTIME_S], [/* Define to 1 if you have the `localtime_s\' function. */
@%:@undef HAVE_LOCALTIME_S])
-m4trace:configure.ac:2169: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1636: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2169: the top level])
-m4trace:configure.ac:2169: -1- AH_OUTPUT([HAVE_STAT], [/* Define to 1 if you have the `stat\' function. */
+configure.ac:1636: the top level])
+m4trace:configure.ac:1636: -1- AH_OUTPUT([HAVE_STAT], [/* Define to 1 if you have the `stat\' function. */
@%:@undef HAVE_STAT])
-m4trace:configure.ac:2169: -1- AH_OUTPUT([HAVE_STAT32], [/* Define to 1 if you have the `stat32\' function. */
+m4trace:configure.ac:1636: -1- AH_OUTPUT([HAVE_STAT32], [/* Define to 1 if you have the `stat32\' function. */
@%:@undef HAVE_STAT32])
-m4trace:configure.ac:2169: -1- AH_OUTPUT([HAVE_LSTAT32], [/* Define to 1 if you have the `lstat32\' function. */
+m4trace:configure.ac:1636: -1- AH_OUTPUT([HAVE_LSTAT32], [/* Define to 1 if you have the `lstat32\' function. */
@%:@undef HAVE_LSTAT32])
-m4trace:configure.ac:2170: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1637: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2170: the top level])
-m4trace:configure.ac:2170: -1- AH_OUTPUT([HAVE__STAT], [/* Define to 1 if you have the `_stat\' function. */
+configure.ac:1637: the top level])
+m4trace:configure.ac:1637: -1- AH_OUTPUT([HAVE__STAT], [/* Define to 1 if you have the `_stat\' function. */
@%:@undef HAVE__STAT])
-m4trace:configure.ac:2170: -1- AH_OUTPUT([HAVE__STAT32], [/* Define to 1 if you have the `_stat32\' function. */
+m4trace:configure.ac:1637: -1- AH_OUTPUT([HAVE__STAT32], [/* Define to 1 if you have the `_stat32\' function. */
@%:@undef HAVE__STAT32])
-m4trace:configure.ac:2170: -1- AH_OUTPUT([HAVE__STAT64], [/* Define to 1 if you have the `_stat64\' function. */
+m4trace:configure.ac:1637: -1- AH_OUTPUT([HAVE__STAT64], [/* Define to 1 if you have the `_stat64\' function. */
@%:@undef HAVE__STAT64])
-m4trace:configure.ac:2170: -1- AH_OUTPUT([HAVE__LSTAT], [/* Define to 1 if you have the `_lstat\' function. */
+m4trace:configure.ac:1637: -1- AH_OUTPUT([HAVE__LSTAT], [/* Define to 1 if you have the `_lstat\' function. */
@%:@undef HAVE__LSTAT])
-m4trace:configure.ac:2170: -1- AH_OUTPUT([HAVE__LSTAT32], [/* Define to 1 if you have the `_lstat32\' function. */
+m4trace:configure.ac:1637: -1- AH_OUTPUT([HAVE__LSTAT32], [/* Define to 1 if you have the `_lstat32\' function. */
@%:@undef HAVE__LSTAT32])
-m4trace:configure.ac:2170: -1- AH_OUTPUT([HAVE__LSTAT64], [/* Define to 1 if you have the `_lstat64\' function. */
+m4trace:configure.ac:1637: -1- AH_OUTPUT([HAVE__LSTAT64], [/* Define to 1 if you have the `_lstat64\' function. */
@%:@undef HAVE__LSTAT64])
-m4trace:configure.ac:2171: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1638: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2171: the top level])
-m4trace:configure.ac:2171: -1- AH_OUTPUT([HAVE_MPCTL], [/* Define to 1 if you have the `mpctl\' function. */
+configure.ac:1638: the top level])
+m4trace:configure.ac:1638: -1- AH_OUTPUT([HAVE_MPCTL], [/* Define to 1 if you have the `mpctl\' function. */
@%:@undef HAVE_MPCTL])
-m4trace:configure.ac:2171: -1- AH_OUTPUT([HAVE_SYSCONF], [/* Define to 1 if you have the `sysconf\' function. */
+m4trace:configure.ac:1638: -1- AH_OUTPUT([HAVE_SYSCONF], [/* Define to 1 if you have the `sysconf\' function. */
@%:@undef HAVE_SYSCONF])
-m4trace:configure.ac:2171: -1- AH_OUTPUT([HAVE_SYSCTL], [/* Define to 1 if you have the `sysctl\' function. */
+m4trace:configure.ac:1638: -1- AH_OUTPUT([HAVE_SYSCTL], [/* Define to 1 if you have the `sysctl\' function. */
@%:@undef HAVE_SYSCTL])
-m4trace:configure.ac:2172: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1639: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2172: the top level])
-m4trace:configure.ac:2172: -1- AH_OUTPUT([HAVE_POPEN], [/* Define to 1 if you have the `popen\' function. */
+configure.ac:1639: the top level])
+m4trace:configure.ac:1639: -1- AH_OUTPUT([HAVE_POPEN], [/* Define to 1 if you have the `popen\' function. */
@%:@undef HAVE_POPEN])
-m4trace:configure.ac:2172: -1- AH_OUTPUT([HAVE__POPEN], [/* Define to 1 if you have the `_popen\' function. */
+m4trace:configure.ac:1639: -1- AH_OUTPUT([HAVE__POPEN], [/* Define to 1 if you have the `_popen\' function. */
@%:@undef HAVE__POPEN])
-m4trace:configure.ac:2173: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1640: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2173: the top level])
-m4trace:configure.ac:2173: -1- AH_OUTPUT([HAVE_READ], [/* Define to 1 if you have the `read\' function. */
+configure.ac:1640: the top level])
+m4trace:configure.ac:1640: -1- AH_OUTPUT([HAVE_READ], [/* Define to 1 if you have the `read\' function. */
@%:@undef HAVE_READ])
-m4trace:configure.ac:2173: -1- AH_OUTPUT([HAVE_WRITE], [/* Define to 1 if you have the `write\' function. */
+m4trace:configure.ac:1640: -1- AH_OUTPUT([HAVE_WRITE], [/* Define to 1 if you have the `write\' function. */
@%:@undef HAVE_WRITE])
-m4trace:configure.ac:2173: -1- AH_OUTPUT([HAVE__READ], [/* Define to 1 if you have the `_read\' function. */
+m4trace:configure.ac:1640: -1- AH_OUTPUT([HAVE__READ], [/* Define to 1 if you have the `_read\' function. */
@%:@undef HAVE__READ])
-m4trace:configure.ac:2173: -1- AH_OUTPUT([HAVE__WRITE], [/* Define to 1 if you have the `_write\' function. */
+m4trace:configure.ac:1640: -1- AH_OUTPUT([HAVE__WRITE], [/* Define to 1 if you have the `_write\' function. */
@%:@undef HAVE__WRITE])
-m4trace:configure.ac:2174: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1641: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2174: the top level])
-m4trace:configure.ac:2174: -1- AH_OUTPUT([HAVE_SEED48], [/* Define to 1 if you have the `seed48\' function. */
+configure.ac:1641: the top level])
+m4trace:configure.ac:1641: -1- AH_OUTPUT([HAVE_SEED48], [/* Define to 1 if you have the `seed48\' function. */
@%:@undef HAVE_SEED48])
-m4trace:configure.ac:2174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SEED48])
-m4trace:configure.ac:2174: -1- m4_pattern_allow([^HAVE_SEED48$])
-m4trace:configure.ac:2175: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1641: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SEED48])
+m4trace:configure.ac:1641: -1- m4_pattern_allow([^HAVE_SEED48$])
+m4trace:configure.ac:1642: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2175: the top level])
-m4trace:configure.ac:2175: -1- AH_OUTPUT([HAVE_SPRINTF_S], [/* Define to 1 if you have the `sprintf_s\' function. */
+configure.ac:1642: the top level])
+m4trace:configure.ac:1642: -1- AH_OUTPUT([HAVE_SPRINTF_S], [/* Define to 1 if you have the `sprintf_s\' function. */
@%:@undef HAVE_SPRINTF_S])
-m4trace:configure.ac:2175: -1- AH_OUTPUT([HAVE_SSCANF_S], [/* Define to 1 if you have the `sscanf_s\' function. */
+m4trace:configure.ac:1642: -1- AH_OUTPUT([HAVE_SSCANF_S], [/* Define to 1 if you have the `sscanf_s\' function. */
@%:@undef HAVE_SSCANF_S])
-m4trace:configure.ac:2175: -1- AH_OUTPUT([HAVE_SWSCANF_S], [/* Define to 1 if you have the `swscanf_s\' function. */
+m4trace:configure.ac:1642: -1- AH_OUTPUT([HAVE_SWSCANF_S], [/* Define to 1 if you have the `swscanf_s\' function. */
@%:@undef HAVE_SWSCANF_S])
-m4trace:configure.ac:2176: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1643: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2176: the top level])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE_STRCAT], [/* Define to 1 if you have the `strcat\' function. */
+configure.ac:1643: the top level])
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE_STRCAT], [/* Define to 1 if you have the `strcat\' function. */
@%:@undef HAVE_STRCAT])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE_STRCHR], [/* Define to 1 if you have the `strchr\' function. */
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE_STRCHR], [/* Define to 1 if you have the `strchr\' function. */
@%:@undef HAVE_STRCHR])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE_STRCMP], [/* Define to 1 if you have the `strcmp\' function. */
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE_STRCMP], [/* Define to 1 if you have the `strcmp\' function. */
@%:@undef HAVE_STRCMP])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE_STRCPY], [/* Define to 1 if you have the `strcpy\' function. */
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE_STRCPY], [/* Define to 1 if you have the `strcpy\' function. */
@%:@undef HAVE_STRCPY])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE_STRDUP], [/* Define to 1 if you have the `strdup\' function. */
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE_STRDUP], [/* Define to 1 if you have the `strdup\' function. */
@%:@undef HAVE_STRDUP])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE_STRLEN], [/* Define to 1 if you have the `strlen\' function. */
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE_STRLEN], [/* Define to 1 if you have the `strlen\' function. */
@%:@undef HAVE_STRLEN])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE_STRNCMP], [/* Define to 1 if you have the `strncmp\' function. */
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE_STRNCMP], [/* Define to 1 if you have the `strncmp\' function. */
@%:@undef HAVE_STRNCMP])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE_STRNCPY], [/* Define to 1 if you have the `strncpy\' function. */
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE_STRNCPY], [/* Define to 1 if you have the `strncpy\' function. */
@%:@undef HAVE_STRNCPY])
-m4trace:configure.ac:2176: -1- AH_OUTPUT([HAVE__STRDUP], [/* Define to 1 if you have the `_strdup\' function. */
+m4trace:configure.ac:1643: -1- AH_OUTPUT([HAVE__STRDUP], [/* Define to 1 if you have the `_strdup\' function. */
@%:@undef HAVE__STRDUP])
-m4trace:configure.ac:2177: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1644: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2177: the top level])
-m4trace:configure.ac:2177: -1- AH_OUTPUT([HAVE_STRNCPY_S], [/* Define to 1 if you have the `strncpy_s\' function. */
+configure.ac:1644: the top level])
+m4trace:configure.ac:1644: -1- AH_OUTPUT([HAVE_STRNCPY_S], [/* Define to 1 if you have the `strncpy_s\' function. */
@%:@undef HAVE_STRNCPY_S])
-m4trace:configure.ac:2177: -1- AH_OUTPUT([HAVE_STRRCHR], [/* Define to 1 if you have the `strrchr\' function. */
+m4trace:configure.ac:1644: -1- AH_OUTPUT([HAVE_STRRCHR], [/* Define to 1 if you have the `strrchr\' function. */
@%:@undef HAVE_STRRCHR])
-m4trace:configure.ac:2177: -1- AH_OUTPUT([HAVE_STRTOIMAX], [/* Define to 1 if you have the `strtoimax\' function. */
+m4trace:configure.ac:1644: -1- AH_OUTPUT([HAVE_STRTOIMAX], [/* Define to 1 if you have the `strtoimax\' function. */
@%:@undef HAVE_STRTOIMAX])
-m4trace:configure.ac:2177: -1- AH_OUTPUT([HAVE_STRTOL], [/* Define to 1 if you have the `strtol\' function. */
+m4trace:configure.ac:1644: -1- AH_OUTPUT([HAVE_STRTOL], [/* Define to 1 if you have the `strtol\' function. */
@%:@undef HAVE_STRTOL])
-m4trace:configure.ac:2177: -1- AH_OUTPUT([HAVE_STRTOLL], [/* Define to 1 if you have the `strtoll\' function. */
+m4trace:configure.ac:1644: -1- AH_OUTPUT([HAVE_STRTOLL], [/* Define to 1 if you have the `strtoll\' function. */
@%:@undef HAVE_STRTOLL])
-m4trace:configure.ac:2177: -1- AH_OUTPUT([HAVE_STRTOUL], [/* Define to 1 if you have the `strtoul\' function. */
+m4trace:configure.ac:1644: -1- AH_OUTPUT([HAVE_STRTOUL], [/* Define to 1 if you have the `strtoul\' function. */
@%:@undef HAVE_STRTOUL])
-m4trace:configure.ac:2177: -1- AH_OUTPUT([HAVE_STRTOULL], [/* Define to 1 if you have the `strtoull\' function. */
+m4trace:configure.ac:1644: -1- AH_OUTPUT([HAVE_STRTOULL], [/* Define to 1 if you have the `strtoull\' function. */
@%:@undef HAVE_STRTOULL])
-m4trace:configure.ac:2178: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1645: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2178: the top level])
-m4trace:configure.ac:2178: -1- AH_OUTPUT([HAVE_STRTOUMAX], [/* Define to 1 if you have the `strtoumax\' function. */
+configure.ac:1645: the top level])
+m4trace:configure.ac:1645: -1- AH_OUTPUT([HAVE_STRTOUMAX], [/* Define to 1 if you have the `strtoumax\' function. */
@%:@undef HAVE_STRTOUMAX])
-m4trace:configure.ac:2178: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRTOUMAX])
-m4trace:configure.ac:2178: -1- m4_pattern_allow([^HAVE_STRTOUMAX$])
-m4trace:configure.ac:2179: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1645: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRTOUMAX])
+m4trace:configure.ac:1645: -1- m4_pattern_allow([^HAVE_STRTOUMAX$])
+m4trace:configure.ac:1646: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2179: the top level])
-m4trace:configure.ac:2179: -1- AH_OUTPUT([HAVE_WCSDUP], [/* Define to 1 if you have the `wcsdup\' function. */
+configure.ac:1646: the top level])
+m4trace:configure.ac:1646: -1- AH_OUTPUT([HAVE_WCSDUP], [/* Define to 1 if you have the `wcsdup\' function. */
@%:@undef HAVE_WCSDUP])
-m4trace:configure.ac:2179: -1- AH_OUTPUT([HAVE_WCSNCMP], [/* Define to 1 if you have the `wcsncmp\' function. */
+m4trace:configure.ac:1646: -1- AH_OUTPUT([HAVE_WCSNCMP], [/* Define to 1 if you have the `wcsncmp\' function. */
@%:@undef HAVE_WCSNCMP])
-m4trace:configure.ac:2179: -1- AH_OUTPUT([HAVE_WCSNCPY], [/* Define to 1 if you have the `wcsncpy\' function. */
+m4trace:configure.ac:1646: -1- AH_OUTPUT([HAVE_WCSNCPY], [/* Define to 1 if you have the `wcsncpy\' function. */
@%:@undef HAVE_WCSNCPY])
-m4trace:configure.ac:2179: -1- AH_OUTPUT([HAVE_WCSNCPY_S], [/* Define to 1 if you have the `wcsncpy_s\' function. */
+m4trace:configure.ac:1646: -1- AH_OUTPUT([HAVE_WCSNCPY_S], [/* Define to 1 if you have the `wcsncpy_s\' function. */
@%:@undef HAVE_WCSNCPY_S])
-m4trace:configure.ac:2179: -1- AH_OUTPUT([HAVE_WCSTOIMAX], [/* Define to 1 if you have the `wcstoimax\' function. */
+m4trace:configure.ac:1646: -1- AH_OUTPUT([HAVE_WCSTOIMAX], [/* Define to 1 if you have the `wcstoimax\' function. */
@%:@undef HAVE_WCSTOIMAX])
-m4trace:configure.ac:2179: -1- AH_OUTPUT([HAVE_WCSTOL], [/* Define to 1 if you have the `wcstol\' function. */
+m4trace:configure.ac:1646: -1- AH_OUTPUT([HAVE_WCSTOL], [/* Define to 1 if you have the `wcstol\' function. */
@%:@undef HAVE_WCSTOL])
-m4trace:configure.ac:2179: -1- AH_OUTPUT([HAVE_WCSTOLL], [/* Define to 1 if you have the `wcstoll\' function. */
+m4trace:configure.ac:1646: -1- AH_OUTPUT([HAVE_WCSTOLL], [/* Define to 1 if you have the `wcstoll\' function. */
@%:@undef HAVE_WCSTOLL])
-m4trace:configure.ac:2180: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1647: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2180: the top level])
-m4trace:configure.ac:2180: -1- AH_OUTPUT([HAVE_WCSTOUL], [/* Define to 1 if you have the `wcstoul\' function. */
+configure.ac:1647: the top level])
+m4trace:configure.ac:1647: -1- AH_OUTPUT([HAVE_WCSTOUL], [/* Define to 1 if you have the `wcstoul\' function. */
@%:@undef HAVE_WCSTOUL])
-m4trace:configure.ac:2180: -1- AH_OUTPUT([HAVE_WCSTOULL], [/* Define to 1 if you have the `wcstoull\' function. */
+m4trace:configure.ac:1647: -1- AH_OUTPUT([HAVE_WCSTOULL], [/* Define to 1 if you have the `wcstoull\' function. */
@%:@undef HAVE_WCSTOULL])
-m4trace:configure.ac:2180: -1- AH_OUTPUT([HAVE_WCSTOUMAX], [/* Define to 1 if you have the `wcstoumax\' function. */
+m4trace:configure.ac:1647: -1- AH_OUTPUT([HAVE_WCSTOUMAX], [/* Define to 1 if you have the `wcstoumax\' function. */
@%:@undef HAVE_WCSTOUMAX])
-m4trace:configure.ac:2181: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1648: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2181: the top level])
-m4trace:configure.ac:2181: -1- AH_OUTPUT([HAVE__WCSCAT], [/* Define to 1 if you have the `_wcscat\' function. */
+configure.ac:1648: the top level])
+m4trace:configure.ac:1648: -1- AH_OUTPUT([HAVE__WCSCAT], [/* Define to 1 if you have the `_wcscat\' function. */
@%:@undef HAVE__WCSCAT])
-m4trace:configure.ac:2181: -1- AH_OUTPUT([HAVE__WCSCHR], [/* Define to 1 if you have the `_wcschr\' function. */
+m4trace:configure.ac:1648: -1- AH_OUTPUT([HAVE__WCSCHR], [/* Define to 1 if you have the `_wcschr\' function. */
@%:@undef HAVE__WCSCHR])
-m4trace:configure.ac:2181: -1- AH_OUTPUT([HAVE__WCSCPY], [/* Define to 1 if you have the `_wcscpy\' function. */
+m4trace:configure.ac:1648: -1- AH_OUTPUT([HAVE__WCSCPY], [/* Define to 1 if you have the `_wcscpy\' function. */
@%:@undef HAVE__WCSCPY])
-m4trace:configure.ac:2181: -1- AH_OUTPUT([HAVE__WCSDUP], [/* Define to 1 if you have the `_wcsdup\' function. */
+m4trace:configure.ac:1648: -1- AH_OUTPUT([HAVE__WCSDUP], [/* Define to 1 if you have the `_wcsdup\' function. */
@%:@undef HAVE__WCSDUP])
-m4trace:configure.ac:2181: -1- AH_OUTPUT([HAVE__WCSLEN], [/* Define to 1 if you have the `_wcslen\' function. */
+m4trace:configure.ac:1648: -1- AH_OUTPUT([HAVE__WCSLEN], [/* Define to 1 if you have the `_wcslen\' function. */
@%:@undef HAVE__WCSLEN])
-m4trace:configure.ac:2181: -1- AH_OUTPUT([HAVE__WCSNCMP], [/* Define to 1 if you have the `_wcsncmp\' function. */
+m4trace:configure.ac:1648: -1- AH_OUTPUT([HAVE__WCSNCMP], [/* Define to 1 if you have the `_wcsncmp\' function. */
@%:@undef HAVE__WCSNCMP])
-m4trace:configure.ac:2181: -1- AH_OUTPUT([HAVE__WCSNCPY], [/* Define to 1 if you have the `_wcsncpy\' function. */
+m4trace:configure.ac:1648: -1- AH_OUTPUT([HAVE__WCSNCPY], [/* Define to 1 if you have the `_wcsncpy\' function. */
@%:@undef HAVE__WCSNCPY])
-m4trace:configure.ac:2182: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1649: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2182: the top level])
-m4trace:configure.ac:2182: -1- AH_OUTPUT([HAVE__WCSRCHR], [/* Define to 1 if you have the `_wcsrchr\' function. */
+configure.ac:1649: the top level])
+m4trace:configure.ac:1649: -1- AH_OUTPUT([HAVE__WCSRCHR], [/* Define to 1 if you have the `_wcsrchr\' function. */
@%:@undef HAVE__WCSRCHR])
-m4trace:configure.ac:2182: -1- AC_DEFINE_TRACE_LITERAL([HAVE__WCSRCHR])
-m4trace:configure.ac:2182: -1- m4_pattern_allow([^HAVE__WCSRCHR$])
-m4trace:configure.ac:2183: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1649: -1- AC_DEFINE_TRACE_LITERAL([HAVE__WCSRCHR])
+m4trace:configure.ac:1649: -1- m4_pattern_allow([^HAVE__WCSRCHR$])
+m4trace:configure.ac:1650: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2183: the top level])
-m4trace:configure.ac:2183: -1- AH_OUTPUT([HAVE_TCFLUSH], [/* Define to 1 if you have the `tcflush\' function. */
+configure.ac:1650: the top level])
+m4trace:configure.ac:1650: -1- AH_OUTPUT([HAVE_TCFLUSH], [/* Define to 1 if you have the `tcflush\' function. */
@%:@undef HAVE_TCFLUSH])
-m4trace:configure.ac:2183: -1- AH_OUTPUT([HAVE_TCGETATTR], [/* Define to 1 if you have the `tcgetattr\' function. */
+m4trace:configure.ac:1650: -1- AH_OUTPUT([HAVE_TCGETATTR], [/* Define to 1 if you have the `tcgetattr\' function. */
@%:@undef HAVE_TCGETATTR])
-m4trace:configure.ac:2184: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1651: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2184: the top level])
-m4trace:configure.ac:2184: -1- AH_OUTPUT([HAVE_UMASK], [/* Define to 1 if you have the `umask\' function. */
+configure.ac:1651: the top level])
+m4trace:configure.ac:1651: -1- AH_OUTPUT([HAVE_UMASK], [/* Define to 1 if you have the `umask\' function. */
@%:@undef HAVE_UMASK])
-m4trace:configure.ac:2184: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UMASK])
-m4trace:configure.ac:2184: -1- m4_pattern_allow([^HAVE_UMASK$])
-m4trace:configure.ac:2185: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
+m4trace:configure.ac:1651: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UMASK])
+m4trace:configure.ac:1651: -1- m4_pattern_allow([^HAVE_UMASK$])
+m4trace:configure.ac:1652: -1- _m4_warn([obsolete], [The macro `AC_HAVE_FUNCS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/functions.m4:160: AC_HAVE_FUNCS is expanded from...
-configure.ac:2185: the top level])
-m4trace:configure.ac:2185: -1- AH_OUTPUT([HAVE_GETFINALPATHNAMEBYHANDLE], [/* Define to 1 if you have the `GetFinalPathNameByHandle\' function. */
+configure.ac:1652: the top level])
+m4trace:configure.ac:1652: -1- AH_OUTPUT([HAVE_GETFINALPATHNAMEBYHANDLE], [/* Define to 1 if you have the `GetFinalPathNameByHandle\' function. */
@%:@undef HAVE_GETFINALPATHNAMEBYHANDLE])
-m4trace:configure.ac:2185: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETFINALPATHNAMEBYHANDLE])
-m4trace:configure.ac:2185: -1- m4_pattern_allow([^HAVE_GETFINALPATHNAMEBYHANDLE$])
-m4trace:configure.ac:2189: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2189: the top level])
-m4trace:configure.ac:2189: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCHAR_T])
-m4trace:configure.ac:2189: -1- m4_pattern_allow([^HAVE_WCHAR_T$])
-m4trace:configure.ac:2198: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2198: the top level])
-m4trace:configure.ac:2198: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MKDIR2])
-m4trace:configure.ac:2198: -1- m4_pattern_allow([^HAVE_MKDIR2$])
-m4trace:configure.ac:2216: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2216: the top level])
-m4trace:configure.ac:2216: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DB_CURSOR_C_GET])
-m4trace:configure.ac:2216: -1- m4_pattern_allow([^HAVE_DB_CURSOR_C_GET$])
-m4trace:configure.ac:2227: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2227: the top level])
-m4trace:configure.ac:2227: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CONST])
-m4trace:configure.ac:2227: -1- m4_pattern_allow([^HAVE_CONST$])
-m4trace:configure.ac:2236: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2236: the top level])
-m4trace:configure.ac:2256: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INLINE])
-m4trace:configure.ac:2256: -1- m4_pattern_allow([^HAVE_INLINE$])
-m4trace:configure.ac:2262: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_URANDOM])
-m4trace:configure.ac:2262: -1- m4_pattern_allow([^HAVE_DEV_URANDOM$])
-m4trace:configure.ac:2266: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_URANDOM])
-m4trace:configure.ac:2266: -1- m4_pattern_allow([^HAVE_DEV_URANDOM$])
-m4trace:configure.ac:2270: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_RANDOM])
-m4trace:configure.ac:2270: -1- m4_pattern_allow([^HAVE_DEV_RANDOM$])
-m4trace:configure.ac:2274: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_RANDOM])
-m4trace:configure.ac:2274: -1- m4_pattern_allow([^HAVE_DEV_RANDOM$])
-m4trace:configure.ac:2279: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2279: the top level])
-m4trace:configure.ac:2279: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FPCLASSIFY])
-m4trace:configure.ac:2279: -1- m4_pattern_allow([^HAVE_FPCLASSIFY$])
-m4trace:configure.ac:2290: -1- AH_OUTPUT([HAVE_GETPEERNAME], [/* Define to 1 if you have the `getpeername\' function. */
+m4trace:configure.ac:1652: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETFINALPATHNAMEBYHANDLE])
+m4trace:configure.ac:1652: -1- m4_pattern_allow([^HAVE_GETFINALPATHNAMEBYHANDLE$])
+m4trace:configure.ac:1657: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1657: the top level])
+m4trace:configure.ac:1657: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISGREATER])
+m4trace:configure.ac:1657: -1- m4_pattern_allow([^HAVE_ISGREATER$])
+m4trace:configure.ac:1680: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1680: the top level])
+m4trace:configure.ac:1680: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISGREATEREQUAL])
+m4trace:configure.ac:1680: -1- m4_pattern_allow([^HAVE_ISGREATEREQUAL$])
+m4trace:configure.ac:1703: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1703: the top level])
+m4trace:configure.ac:1703: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISLESS])
+m4trace:configure.ac:1703: -1- m4_pattern_allow([^HAVE_ISLESS$])
+m4trace:configure.ac:1726: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1726: the top level])
+m4trace:configure.ac:1726: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISLESSEQUAL])
+m4trace:configure.ac:1726: -1- m4_pattern_allow([^HAVE_ISLESSEQUAL$])
+m4trace:configure.ac:1749: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1749: the top level])
+m4trace:configure.ac:1749: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISFINITE])
+m4trace:configure.ac:1749: -1- m4_pattern_allow([^HAVE_ISFINITE$])
+m4trace:configure.ac:1772: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1772: the top level])
+m4trace:configure.ac:1772: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISNORMAL])
+m4trace:configure.ac:1772: -1- m4_pattern_allow([^HAVE_ISNORMAL$])
+m4trace:configure.ac:1795: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1795: the top level])
+m4trace:configure.ac:1795: -1- AC_DEFINE_TRACE_LITERAL([HAVE__FINITE])
+m4trace:configure.ac:1795: -1- m4_pattern_allow([^HAVE__FINITE$])
+m4trace:configure.ac:1818: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1818: the top level])
+m4trace:configure.ac:1818: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FPCLASSIFY])
+m4trace:configure.ac:1818: -1- m4_pattern_allow([^HAVE_FPCLASSIFY$])
+m4trace:configure.ac:1831: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1831: the top level])
+m4trace:configure.ac:1831: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MKDIR2])
+m4trace:configure.ac:1831: -1- m4_pattern_allow([^HAVE_MKDIR2$])
+m4trace:configure.ac:1851: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1851: the top level])
+m4trace:configure.ac:1851: -1- AC_DEFINE_TRACE_LITERAL([HAVE_QSORT])
+m4trace:configure.ac:1851: -1- m4_pattern_allow([^HAVE_QSORT$])
+m4trace:configure.ac:1890: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1890: the top level])
+m4trace:configure.ac:1890: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BSEARCH])
+m4trace:configure.ac:1890: -1- m4_pattern_allow([^HAVE_BSEARCH$])
+m4trace:configure.ac:1930: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1930: the top level])
+m4trace:configure.ac:1930: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETGROUPS])
+m4trace:configure.ac:1930: -1- m4_pattern_allow([^HAVE_SETGROUPS$])
+m4trace:configure.ac:1946: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1946: the top level])
+m4trace:configure.ac:1946: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INITGROUPS])
+m4trace:configure.ac:1946: -1- m4_pattern_allow([^HAVE_INITGROUPS$])
+m4trace:configure.ac:1962: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:1962: the top level])
+m4trace:configure.ac:1972: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ACOSH])
+m4trace:configure.ac:1972: -2- m4_pattern_allow([^HAVE_ACOSH$])
+m4trace:configure.ac:1973: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ACOSHL])
+m4trace:configure.ac:1973: -2- m4_pattern_allow([^HAVE_ACOSHL$])
+m4trace:configure.ac:1974: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ACOSL])
+m4trace:configure.ac:1974: -2- m4_pattern_allow([^HAVE_ACOSL$])
+m4trace:configure.ac:1975: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ASINH])
+m4trace:configure.ac:1975: -2- m4_pattern_allow([^HAVE_ASINH$])
+m4trace:configure.ac:1976: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ASINHL])
+m4trace:configure.ac:1976: -2- m4_pattern_allow([^HAVE_ASINHL$])
+m4trace:configure.ac:1977: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ASINL])
+m4trace:configure.ac:1977: -2- m4_pattern_allow([^HAVE_ASINL$])
+m4trace:configure.ac:1978: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATAN2])
+m4trace:configure.ac:1978: -2- m4_pattern_allow([^HAVE_ATAN2$])
+m4trace:configure.ac:1979: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATAN2L])
+m4trace:configure.ac:1979: -2- m4_pattern_allow([^HAVE_ATAN2L$])
+m4trace:configure.ac:1980: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATANH])
+m4trace:configure.ac:1980: -2- m4_pattern_allow([^HAVE_ATANH$])
+m4trace:configure.ac:1981: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATANHL])
+m4trace:configure.ac:1981: -2- m4_pattern_allow([^HAVE_ATANHL$])
+m4trace:configure.ac:1982: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ATANL])
+m4trace:configure.ac:1982: -2- m4_pattern_allow([^HAVE_ATANL$])
+m4trace:configure.ac:1983: -2- AC_DEFINE_TRACE_LITERAL([HAVE_CEIL])
+m4trace:configure.ac:1983: -2- m4_pattern_allow([^HAVE_CEIL$])
+m4trace:configure.ac:1984: -2- AC_DEFINE_TRACE_LITERAL([HAVE_CEILL])
+m4trace:configure.ac:1984: -2- m4_pattern_allow([^HAVE_CEILL$])
+m4trace:configure.ac:1985: -2- AC_DEFINE_TRACE_LITERAL([HAVE_COSHL])
+m4trace:configure.ac:1985: -2- m4_pattern_allow([^HAVE_COSHL$])
+m4trace:configure.ac:1986: -2- AC_DEFINE_TRACE_LITERAL([HAVE_COSL])
+m4trace:configure.ac:1986: -2- m4_pattern_allow([^HAVE_COSL$])
+m4trace:configure.ac:1987: -2- AC_DEFINE_TRACE_LITERAL([HAVE_EXPL])
+m4trace:configure.ac:1987: -2- m4_pattern_allow([^HAVE_EXPL$])
+m4trace:configure.ac:1988: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FABS])
+m4trace:configure.ac:1988: -2- m4_pattern_allow([^HAVE_FABS$])
+m4trace:configure.ac:1989: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FABSL])
+m4trace:configure.ac:1989: -2- m4_pattern_allow([^HAVE_FABSL$])
+m4trace:configure.ac:1990: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FLOOR])
+m4trace:configure.ac:1990: -2- m4_pattern_allow([^HAVE_FLOOR$])
+m4trace:configure.ac:1991: -2- AC_DEFINE_TRACE_LITERAL([HAVE_FLOORL])
+m4trace:configure.ac:1991: -2- m4_pattern_allow([^HAVE_FLOORL$])
+m4trace:configure.ac:1992: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LABS])
+m4trace:configure.ac:1992: -2- m4_pattern_allow([^HAVE_LABS$])
+m4trace:configure.ac:1993: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LOGL])
+m4trace:configure.ac:1993: -2- m4_pattern_allow([^HAVE_LOGL$])
+m4trace:configure.ac:1994: -2- AC_DEFINE_TRACE_LITERAL([HAVE_RINT])
+m4trace:configure.ac:1994: -2- m4_pattern_allow([^HAVE_RINT$])
+m4trace:configure.ac:1995: -2- AC_DEFINE_TRACE_LITERAL([HAVE_RINTL])
+m4trace:configure.ac:1995: -2- m4_pattern_allow([^HAVE_RINTL$])
+m4trace:configure.ac:1996: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SINHL])
+m4trace:configure.ac:1996: -2- m4_pattern_allow([^HAVE_SINHL$])
+m4trace:configure.ac:1997: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SQRT])
+m4trace:configure.ac:1997: -2- m4_pattern_allow([^HAVE_SQRT$])
+m4trace:configure.ac:1998: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SQRTL])
+m4trace:configure.ac:1998: -2- m4_pattern_allow([^HAVE_SQRTL$])
+m4trace:configure.ac:1999: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SINL])
+m4trace:configure.ac:1999: -2- m4_pattern_allow([^HAVE_SINL$])
+m4trace:configure.ac:2000: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TANHL])
+m4trace:configure.ac:2000: -2- m4_pattern_allow([^HAVE_TANHL$])
+m4trace:configure.ac:2001: -2- AC_DEFINE_TRACE_LITERAL([HAVE_TANL])
+m4trace:configure.ac:2001: -2- m4_pattern_allow([^HAVE_TANL$])
+m4trace:configure.ac:2014: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BACKSLASH_AS_SEP])
+m4trace:configure.ac:2014: -1- m4_pattern_allow([^HAVE_BACKSLASH_AS_SEP$])
+m4trace:configure.ac:2015: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LINE_END_CR_NL])
+m4trace:configure.ac:2015: -1- m4_pattern_allow([^HAVE_LINE_END_CR_NL$])
+m4trace:configure.ac:2016: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CASE_INSENSITIVE_PATHNAMES])
+m4trace:configure.ac:2016: -1- m4_pattern_allow([^HAVE_CASE_INSENSITIVE_PATHNAMES$])
+m4trace:configure.ac:2017: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CASE_INSENSITIVE_USERNAMES])
+m4trace:configure.ac:2017: -1- m4_pattern_allow([^HAVE_CASE_INSENSITIVE_USERNAMES$])
+m4trace:configure.ac:2020: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FILE_DEVINO])
+m4trace:configure.ac:2020: -1- m4_pattern_allow([^HAVE_FILE_DEVINO$])
+m4trace:configure.ac:2021: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FILE_UIDGID])
+m4trace:configure.ac:2021: -1- m4_pattern_allow([^HAVE_FILE_UIDGID$])
+m4trace:configure.ac:2022: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FILE_ATIMECTIME])
+m4trace:configure.ac:2022: -1- m4_pattern_allow([^HAVE_FILE_ATIMECTIME$])
+m4trace:configure.ac:2029: -1- AC_DEFINE_TRACE_LITERAL([HAVE_COMPATDKTOOLS3])
+m4trace:configure.ac:2029: -1- m4_pattern_allow([^HAVE_COMPATDKTOOLS3$])
+m4trace:configure.ac:2037: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2037: the top level])
+m4trace:configure.ac:2037: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKLEN_T])
+m4trace:configure.ac:2037: -1- m4_pattern_allow([^HAVE_SOCKLEN_T$])
+m4trace:configure.ac:2074: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2074: the top level])
+m4trace:configure.ac:2074: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_IN])
+m4trace:configure.ac:2074: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_IN$])
+m4trace:configure.ac:2111: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2111: the top level])
+m4trace:configure.ac:2111: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_IN6])
+m4trace:configure.ac:2111: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_IN6$])
+m4trace:configure.ac:2148: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2148: the top level])
+m4trace:configure.ac:2148: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_UN])
+m4trace:configure.ac:2148: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_UN$])
+m4trace:configure.ac:2188: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2188: the top level])
+m4trace:configure.ac:2188: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_ADDRINFO])
+m4trace:configure.ac:2188: -1- m4_pattern_allow([^HAVE_STRUCT_ADDRINFO$])
+m4trace:configure.ac:2225: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2225: the top level])
+m4trace:configure.ac:2225: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE])
+m4trace:configure.ac:2225: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE$])
+m4trace:configure.ac:2268: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2268: the top level])
+m4trace:configure.ac:2268: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IN_ADDR])
+m4trace:configure.ac:2268: -1- m4_pattern_allow([^HAVE_IN_ADDR$])
+m4trace:configure.ac:2302: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2302: the top level])
+m4trace:configure.ac:2302: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IN6_ADDR])
+m4trace:configure.ac:2302: -1- m4_pattern_allow([^HAVE_IN6_ADDR$])
+m4trace:configure.ac:2338: -1- AH_OUTPUT([HAVE_SOCKET], [/* Define to 1 if you have the `socket\' function. */
+@%:@undef HAVE_SOCKET])
+m4trace:configure.ac:2338: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
+m4trace:configure.ac:2338: -1- m4_pattern_allow([^HAVE_SOCKET$])
+m4trace:configure.ac:2338: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
+m4trace:configure.ac:2338: -1- m4_pattern_allow([^HAVE_SOCKET$])
+m4trace:configure.ac:2338: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
+m4trace:configure.ac:2338: -1- m4_pattern_allow([^HAVE_SOCKET$])
+m4trace:configure.ac:2338: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
+m4trace:configure.ac:2338: -1- m4_pattern_allow([^HAVE_SOCKET$])
+m4trace:configure.ac:2338: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET])
+m4trace:configure.ac:2338: -1- m4_pattern_allow([^HAVE_SOCKET$])
+m4trace:configure.ac:2400: -1- AH_OUTPUT([HAVE_SETSOCKOPT], [/* Define to 1 if you have the `setsockopt\' function. */
+@%:@undef HAVE_SETSOCKOPT])
+m4trace:configure.ac:2400: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
+m4trace:configure.ac:2400: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
+m4trace:configure.ac:2400: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
+m4trace:configure.ac:2400: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
+m4trace:configure.ac:2400: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
+m4trace:configure.ac:2400: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
+m4trace:configure.ac:2400: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
+m4trace:configure.ac:2400: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
+m4trace:configure.ac:2400: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT])
+m4trace:configure.ac:2400: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$])
+m4trace:configure.ac:2418: -1- AH_OUTPUT([HAVE_GETADDRINFO], [/* Define to 1 if you have the `getaddrinfo\' function. */
+@%:@undef HAVE_GETADDRINFO])
+m4trace:configure.ac:2418: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
+m4trace:configure.ac:2418: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
+m4trace:configure.ac:2418: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
+m4trace:configure.ac:2418: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
+m4trace:configure.ac:2418: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
+m4trace:configure.ac:2418: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
+m4trace:configure.ac:2418: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
+m4trace:configure.ac:2418: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
+m4trace:configure.ac:2418: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
+m4trace:configure.ac:2418: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
+m4trace:configure.ac:2418: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETADDRINFO])
+m4trace:configure.ac:2418: -1- m4_pattern_allow([^HAVE_GETADDRINFO$])
+m4trace:configure.ac:2443: -1- AH_OUTPUT([HAVE_GETNAMEINFO], [/* Define to 1 if you have the `getnameinfo\' function. */
+@%:@undef HAVE_GETNAMEINFO])
+m4trace:configure.ac:2443: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
+m4trace:configure.ac:2443: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
+m4trace:configure.ac:2443: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
+m4trace:configure.ac:2443: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
+m4trace:configure.ac:2443: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
+m4trace:configure.ac:2443: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
+m4trace:configure.ac:2443: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
+m4trace:configure.ac:2443: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
+m4trace:configure.ac:2443: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
+m4trace:configure.ac:2443: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
+m4trace:configure.ac:2443: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETNAMEINFO])
+m4trace:configure.ac:2443: -1- m4_pattern_allow([^HAVE_GETNAMEINFO$])
+m4trace:configure.ac:2465: -1- AH_OUTPUT([HAVE_GETHOSTBYNAME], [/* Define to 1 if you have the `gethostbyname\' function. */
+@%:@undef HAVE_GETHOSTBYNAME])
+m4trace:configure.ac:2465: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
+m4trace:configure.ac:2465: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
+m4trace:configure.ac:2465: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
+m4trace:configure.ac:2465: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
+m4trace:configure.ac:2465: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
+m4trace:configure.ac:2465: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
+m4trace:configure.ac:2465: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
+m4trace:configure.ac:2465: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
+m4trace:configure.ac:2465: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
+m4trace:configure.ac:2465: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
+m4trace:configure.ac:2465: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME])
+m4trace:configure.ac:2465: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$])
+m4trace:configure.ac:2488: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2488: the top level])
+m4trace:configure.ac:2488: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HTONS])
+m4trace:configure.ac:2488: -1- m4_pattern_allow([^HAVE_HTONS$])
+m4trace:configure.ac:2517: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2517: the top level])
+m4trace:configure.ac:2517: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NTOHS])
+m4trace:configure.ac:2517: -1- m4_pattern_allow([^HAVE_NTOHS$])
+m4trace:configure.ac:2546: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2546: the top level])
+m4trace:configure.ac:2546: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HTONL])
+m4trace:configure.ac:2546: -1- m4_pattern_allow([^HAVE_HTONL$])
+m4trace:configure.ac:2575: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:2575: the top level])
+m4trace:configure.ac:2575: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NTOHL])
+m4trace:configure.ac:2575: -1- m4_pattern_allow([^HAVE_NTOHL$])
+m4trace:configure.ac:2603: -1- AH_OUTPUT([HAVE_INET_ADDR], [/* Define to 1 if you have the `inet_addr\' function. */
+@%:@undef HAVE_INET_ADDR])
+m4trace:configure.ac:2603: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
+m4trace:configure.ac:2603: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
+m4trace:configure.ac:2603: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
+m4trace:configure.ac:2603: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
+m4trace:configure.ac:2603: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
+m4trace:configure.ac:2603: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
+m4trace:configure.ac:2603: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
+m4trace:configure.ac:2603: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
+m4trace:configure.ac:2603: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
+m4trace:configure.ac:2603: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
+m4trace:configure.ac:2603: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ADDR])
+m4trace:configure.ac:2603: -1- m4_pattern_allow([^HAVE_INET_ADDR$])
+m4trace:configure.ac:2625: -1- AH_OUTPUT([HAVE_INET_ATON], [/* Define to 1 if you have the `inet_aton\' function. */
+@%:@undef HAVE_INET_ATON])
+m4trace:configure.ac:2625: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
+m4trace:configure.ac:2625: -1- m4_pattern_allow([^HAVE_INET_ATON$])
+m4trace:configure.ac:2625: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
+m4trace:configure.ac:2625: -1- m4_pattern_allow([^HAVE_INET_ATON$])
+m4trace:configure.ac:2625: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
+m4trace:configure.ac:2625: -1- m4_pattern_allow([^HAVE_INET_ATON$])
+m4trace:configure.ac:2625: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
+m4trace:configure.ac:2625: -1- m4_pattern_allow([^HAVE_INET_ATON$])
+m4trace:configure.ac:2625: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
+m4trace:configure.ac:2625: -1- m4_pattern_allow([^HAVE_INET_ATON$])
+m4trace:configure.ac:2625: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_ATON])
+m4trace:configure.ac:2625: -1- m4_pattern_allow([^HAVE_INET_ATON$])
+m4trace:configure.ac:2647: -1- AH_OUTPUT([HAVE_INET_PTON], [/* Define to 1 if you have the `inet_pton\' function. */
+@%:@undef HAVE_INET_PTON])
+m4trace:configure.ac:2647: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
+m4trace:configure.ac:2647: -1- m4_pattern_allow([^HAVE_INET_PTON$])
+m4trace:configure.ac:2647: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
+m4trace:configure.ac:2647: -1- m4_pattern_allow([^HAVE_INET_PTON$])
+m4trace:configure.ac:2647: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
+m4trace:configure.ac:2647: -1- m4_pattern_allow([^HAVE_INET_PTON$])
+m4trace:configure.ac:2647: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
+m4trace:configure.ac:2647: -1- m4_pattern_allow([^HAVE_INET_PTON$])
+m4trace:configure.ac:2647: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
+m4trace:configure.ac:2647: -1- m4_pattern_allow([^HAVE_INET_PTON$])
+m4trace:configure.ac:2647: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_PTON])
+m4trace:configure.ac:2647: -1- m4_pattern_allow([^HAVE_INET_PTON$])
+m4trace:configure.ac:2669: -1- AH_OUTPUT([HAVE_INET_NTOP], [/* Define to 1 if you have the `inet_ntop\' function. */
+@%:@undef HAVE_INET_NTOP])
+m4trace:configure.ac:2669: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
+m4trace:configure.ac:2669: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
+m4trace:configure.ac:2669: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
+m4trace:configure.ac:2669: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
+m4trace:configure.ac:2669: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
+m4trace:configure.ac:2669: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
+m4trace:configure.ac:2669: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
+m4trace:configure.ac:2669: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
+m4trace:configure.ac:2669: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
+m4trace:configure.ac:2669: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
+m4trace:configure.ac:2669: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
+m4trace:configure.ac:2669: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
+m4trace:configure.ac:2691: -1- AH_OUTPUT([HAVE_GETPEERNAME], [/* Define to 1 if you have the `getpeername\' function. */
@%:@undef HAVE_GETPEERNAME])
-m4trace:configure.ac:2290: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
-m4trace:configure.ac:2290: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
-m4trace:configure.ac:2290: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
-m4trace:configure.ac:2290: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
-m4trace:configure.ac:2290: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
-m4trace:configure.ac:2290: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
-m4trace:configure.ac:2290: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
-m4trace:configure.ac:2290: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
-m4trace:configure.ac:2290: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
-m4trace:configure.ac:2290: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
-m4trace:configure.ac:2307: -1- AH_OUTPUT([HAVE_GETSOCKNAME], [/* Define to 1 if you have the `getsockname\' function. */
+m4trace:configure.ac:2691: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
+m4trace:configure.ac:2691: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
+m4trace:configure.ac:2691: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
+m4trace:configure.ac:2691: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
+m4trace:configure.ac:2691: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
+m4trace:configure.ac:2691: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
+m4trace:configure.ac:2691: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
+m4trace:configure.ac:2691: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
+m4trace:configure.ac:2691: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
+m4trace:configure.ac:2691: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
+m4trace:configure.ac:2691: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPEERNAME])
+m4trace:configure.ac:2691: -1- m4_pattern_allow([^HAVE_GETPEERNAME$])
+m4trace:configure.ac:2711: -1- AH_OUTPUT([HAVE_GETSOCKNAME], [/* Define to 1 if you have the `getsockname\' function. */
@%:@undef HAVE_GETSOCKNAME])
-m4trace:configure.ac:2307: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
-m4trace:configure.ac:2307: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
-m4trace:configure.ac:2307: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
-m4trace:configure.ac:2307: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
-m4trace:configure.ac:2307: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
-m4trace:configure.ac:2307: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
-m4trace:configure.ac:2307: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
-m4trace:configure.ac:2307: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
-m4trace:configure.ac:2307: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
-m4trace:configure.ac:2307: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
-m4trace:configure.ac:2327: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2327: the top level])
-m4trace:configure.ac:2327: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNETSNMP])
-m4trace:configure.ac:2327: -1- m4_pattern_allow([^HAVE_LIBNETSNMP$])
-m4trace:configure.ac:2338: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNMP_ENABLE_FILELOG])
-m4trace:configure.ac:2338: -1- m4_pattern_allow([^HAVE_SNMP_ENABLE_FILELOG$])
-m4trace:configure.ac:2339: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNMP_DISABLE_SYSLOG])
-m4trace:configure.ac:2339: -1- m4_pattern_allow([^HAVE_SNMP_DISABLE_SYSLOG$])
-m4trace:configure.ac:2340: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNMP_DISABLE_STDERRLOG])
-m4trace:configure.ac:2340: -1- m4_pattern_allow([^HAVE_SNMP_DISABLE_STDERRLOG$])
-m4trace:configure.ac:2341: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNMP_DISABLE_FILELOG])
-m4trace:configure.ac:2341: -1- m4_pattern_allow([^HAVE_SNMP_DISABLE_FILELOG$])
-m4trace:configure.ac:2346: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2764: AC_TRY_RUN is expanded from...
-configure.ac:2346: the top level])
-m4trace:configure.ac:2478: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IEEE_754_DOUBLE])
-m4trace:configure.ac:2478: -1- m4_pattern_allow([^HAVE_IEEE_754_DOUBLE$])
-m4trace:configure.ac:2485: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2485: the top level])
-m4trace:configure.ac:2485: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISFINITE])
-m4trace:configure.ac:2485: -1- m4_pattern_allow([^HAVE_ISFINITE$])
-m4trace:configure.ac:2499: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
-configure.ac:2499: the top level])
-m4trace:configure.ac:2499: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ISNORMAL])
-m4trace:configure.ac:2499: -1- m4_pattern_allow([^HAVE_ISNORMAL$])
-m4trace:configure.ac:2516: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2764: AC_TRY_RUN is expanded from...
-configure.ac:2516: the top level])
-m4trace:configure.ac:2516: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TWOS_COMPLEMENT])
-m4trace:configure.ac:2516: -1- m4_pattern_allow([^HAVE_TWOS_COMPLEMENT$])
-m4trace:configure.ac:2956: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INODES])
-m4trace:configure.ac:2956: -1- m4_pattern_allow([^HAVE_INODES$])
-m4trace:configure.ac:2987: -1- AC_SUBST([ANYDB])
-m4trace:configure.ac:2987: -1- AC_SUBST_TRACE([ANYDB])
-m4trace:configure.ac:2987: -1- m4_pattern_allow([^ANYDB$])
-m4trace:configure.ac:2988: -1- AC_SUBST([CLI_SNMPPROG])
-m4trace:configure.ac:2988: -1- AC_SUBST_TRACE([CLI_SNMPPROG])
-m4trace:configure.ac:2988: -1- m4_pattern_allow([^CLI_SNMPPROG$])
-m4trace:configure.ac:2989: -1- AC_SUBST([LIBPNG])
-m4trace:configure.ac:2989: -1- AC_SUBST_TRACE([LIBPNG])
-m4trace:configure.ac:2989: -1- m4_pattern_allow([^LIBPNG$])
-m4trace:configure.ac:2990: -1- AC_SUBST([LIBJPEG])
-m4trace:configure.ac:2990: -1- AC_SUBST_TRACE([LIBJPEG])
-m4trace:configure.ac:2990: -1- m4_pattern_allow([^LIBJPEG$])
-m4trace:configure.ac:2991: -1- AC_SUBST([LIBTIFF])
-m4trace:configure.ac:2991: -1- AC_SUBST_TRACE([LIBTIFF])
-m4trace:configure.ac:2991: -1- m4_pattern_allow([^LIBTIFF$])
-m4trace:configure.ac:2992: -1- AC_SUBST([DBLIB])
-m4trace:configure.ac:2992: -1- AC_SUBST_TRACE([DBLIB])
-m4trace:configure.ac:2992: -1- m4_pattern_allow([^DBLIB$])
-m4trace:configure.ac:2993: -1- AC_SUBST([DBLIBSOCK])
-m4trace:configure.ac:2993: -1- AC_SUBST_TRACE([DBLIBSOCK])
-m4trace:configure.ac:2993: -1- m4_pattern_allow([^DBLIBSOCK$])
-m4trace:configure.ac:2994: -1- AC_SUBST([CLI_MYSQLPROG])
-m4trace:configure.ac:2994: -1- AC_SUBST_TRACE([CLI_MYSQLPROG])
-m4trace:configure.ac:2994: -1- m4_pattern_allow([^CLI_MYSQLPROG$])
-m4trace:configure.ac:2995: -1- AC_SUBST([PTHREADLIB])
-m4trace:configure.ac:2995: -1- AC_SUBST_TRACE([PTHREADLIB])
-m4trace:configure.ac:2995: -1- m4_pattern_allow([^PTHREADLIB$])
-m4trace:configure.ac:2996: -1- AC_SUBST([LIBDK3WXOBJ])
-m4trace:configure.ac:2996: -1- AC_SUBST_TRACE([LIBDK3WXOBJ])
-m4trace:configure.ac:2996: -1- m4_pattern_allow([^LIBDK3WXOBJ$])
-m4trace:configure.ac:2997: -1- AC_SUBST([LIBDK4WXOBJ])
-m4trace:configure.ac:2997: -1- AC_SUBST_TRACE([LIBDK4WXOBJ])
-m4trace:configure.ac:2997: -1- m4_pattern_allow([^LIBDK4WXOBJ$])
-m4trace:configure.ac:2998: -1- AC_SUBST([LIBDK4WXTOBUILD])
-m4trace:configure.ac:2998: -1- AC_SUBST_TRACE([LIBDK4WXTOBUILD])
-m4trace:configure.ac:2998: -1- m4_pattern_allow([^LIBDK4WXTOBUILD$])
-m4trace:configure.ac:2999: -1- AC_SUBST([DKCTLIBF])
-m4trace:configure.ac:2999: -1- AC_SUBST_TRACE([DKCTLIBF])
-m4trace:configure.ac:2999: -1- m4_pattern_allow([^DKCTLIBF$])
-m4trace:configure.ac:3000: -1- AC_SUBST([DKCTLIBS])
-m4trace:configure.ac:3000: -1- AC_SUBST_TRACE([DKCTLIBS])
-m4trace:configure.ac:3000: -1- m4_pattern_allow([^DKCTLIBS$])
-m4trace:configure.ac:3001: -1- AC_SUBST([ADDCTRLDLIBF])
-m4trace:configure.ac:3001: -1- AC_SUBST_TRACE([ADDCTRLDLIBF])
-m4trace:configure.ac:3001: -1- m4_pattern_allow([^ADDCTRLDLIBF$])
-m4trace:configure.ac:3002: -1- AC_SUBST([ADDCTRLDLIBS])
-m4trace:configure.ac:3002: -1- AC_SUBST_TRACE([ADDCTRLDLIBS])
-m4trace:configure.ac:3002: -1- m4_pattern_allow([^ADDCTRLDLIBS$])
-m4trace:configure.ac:3003: -1- AC_SUBST([DKDBTLIBF])
-m4trace:configure.ac:3003: -1- AC_SUBST_TRACE([DKDBTLIBF])
-m4trace:configure.ac:3003: -1- m4_pattern_allow([^DKDBTLIBF$])
-m4trace:configure.ac:3004: -1- AC_SUBST([DKDBTLIBS])
-m4trace:configure.ac:3004: -1- AC_SUBST_TRACE([DKDBTLIBS])
-m4trace:configure.ac:3004: -1- m4_pattern_allow([^DKDBTLIBS$])
-m4trace:configure.ac:3005: -1- AC_SUBST([BMPPLIBF])
-m4trace:configure.ac:3005: -1- AC_SUBST_TRACE([BMPPLIBF])
-m4trace:configure.ac:3005: -1- m4_pattern_allow([^BMPPLIBF$])
-m4trace:configure.ac:3006: -1- AC_SUBST([BMPPLIBS])
-m4trace:configure.ac:3006: -1- AC_SUBST_TRACE([BMPPLIBS])
-m4trace:configure.ac:3006: -1- m4_pattern_allow([^BMPPLIBS$])
-m4trace:configure.ac:3007: -1- AC_SUBST([FIG2LATLIBF])
-m4trace:configure.ac:3007: -1- AC_SUBST_TRACE([FIG2LATLIBF])
-m4trace:configure.ac:3007: -1- m4_pattern_allow([^FIG2LATLIBF$])
-m4trace:configure.ac:3008: -1- AC_SUBST([FIG2LATLIBS])
-m4trace:configure.ac:3008: -1- AC_SUBST_TRACE([FIG2LATLIBS])
-m4trace:configure.ac:3008: -1- m4_pattern_allow([^FIG2LATLIBS$])
-m4trace:configure.ac:3009: -1- AC_SUBST([HTMLBOOKLIBF])
-m4trace:configure.ac:3009: -1- AC_SUBST_TRACE([HTMLBOOKLIBF])
-m4trace:configure.ac:3009: -1- m4_pattern_allow([^HTMLBOOKLIBF$])
-m4trace:configure.ac:3010: -1- AC_SUBST([HTMLBOOKLIBS])
-m4trace:configure.ac:3010: -1- AC_SUBST_TRACE([HTMLBOOKLIBS])
-m4trace:configure.ac:3010: -1- m4_pattern_allow([^HTMLBOOKLIBS$])
-m4trace:configure.ac:3011: -1- AC_SUBST([DK3INFOLIBF])
-m4trace:configure.ac:3011: -1- AC_SUBST_TRACE([DK3INFOLIBF])
-m4trace:configure.ac:3011: -1- m4_pattern_allow([^DK3INFOLIBF$])
-m4trace:configure.ac:3012: -1- AC_SUBST([DK3INFOLIBS])
-m4trace:configure.ac:3012: -1- AC_SUBST_TRACE([DK3INFOLIBS])
-m4trace:configure.ac:3012: -1- m4_pattern_allow([^DK3INFOLIBS$])
-m4trace:configure.ac:3013: -1- AC_SUBST([PLPDFTEXLIBF])
-m4trace:configure.ac:3013: -1- AC_SUBST_TRACE([PLPDFTEXLIBF])
-m4trace:configure.ac:3013: -1- m4_pattern_allow([^PLPDFTEXLIBF$])
-m4trace:configure.ac:3014: -1- AC_SUBST([PLPDFTEXLIBS])
-m4trace:configure.ac:3014: -1- AC_SUBST_TRACE([PLPDFTEXLIBS])
-m4trace:configure.ac:3014: -1- m4_pattern_allow([^PLPDFTEXLIBS$])
-m4trace:configure.ac:3015: -1- AC_SUBST([DKWXWIZLIBF])
-m4trace:configure.ac:3015: -1- AC_SUBST_TRACE([DKWXWIZLIBF])
-m4trace:configure.ac:3015: -1- m4_pattern_allow([^DKWXWIZLIBF$])
-m4trace:configure.ac:3016: -1- AC_SUBST([DKWXWIZLIBS])
-m4trace:configure.ac:3016: -1- AC_SUBST_TRACE([DKWXWIZLIBS])
-m4trace:configure.ac:3016: -1- m4_pattern_allow([^DKWXWIZLIBS$])
-m4trace:configure.ac:3017: -1- AC_SUBST([WXDKCTLIBF])
-m4trace:configure.ac:3017: -1- AC_SUBST_TRACE([WXDKCTLIBF])
-m4trace:configure.ac:3017: -1- m4_pattern_allow([^WXDKCTLIBF$])
-m4trace:configure.ac:3018: -1- AC_SUBST([WXDKCTLIBS])
-m4trace:configure.ac:3018: -1- AC_SUBST_TRACE([WXDKCTLIBS])
-m4trace:configure.ac:3018: -1- m4_pattern_allow([^WXDKCTLIBS$])
-m4trace:configure.ac:3019: -1- AC_SUBST([WXBMPPLIBF])
-m4trace:configure.ac:3019: -1- AC_SUBST_TRACE([WXBMPPLIBF])
-m4trace:configure.ac:3019: -1- m4_pattern_allow([^WXBMPPLIBF$])
-m4trace:configure.ac:3020: -1- AC_SUBST([WXBMPPLIBS])
-m4trace:configure.ac:3020: -1- AC_SUBST_TRACE([WXBMPPLIBS])
-m4trace:configure.ac:3020: -1- m4_pattern_allow([^WXBMPPLIBS$])
-m4trace:configure.ac:3021: -1- AC_SUBST([WXPQDICLIBF])
-m4trace:configure.ac:3021: -1- AC_SUBST_TRACE([WXPQDICLIBF])
-m4trace:configure.ac:3021: -1- m4_pattern_allow([^WXPQDICLIBF$])
-m4trace:configure.ac:3022: -1- AC_SUBST([WXPQDICLIBS])
-m4trace:configure.ac:3022: -1- AC_SUBST_TRACE([WXPQDICLIBS])
-m4trace:configure.ac:3022: -1- m4_pattern_allow([^WXPQDICLIBS$])
-m4trace:configure.ac:3023: -1- AC_SUBST([WXIMGSZLIBF])
-m4trace:configure.ac:3023: -1- AC_SUBST_TRACE([WXIMGSZLIBF])
-m4trace:configure.ac:3023: -1- m4_pattern_allow([^WXIMGSZLIBF$])
-m4trace:configure.ac:3024: -1- AC_SUBST([WXIMGSZLIBS])
-m4trace:configure.ac:3024: -1- AC_SUBST_TRACE([WXIMGSZLIBS])
-m4trace:configure.ac:3024: -1- m4_pattern_allow([^WXIMGSZLIBS$])
-m4trace:configure.ac:3025: -1- AC_SUBST([WXDKCLOCKLIBF])
-m4trace:configure.ac:3025: -1- AC_SUBST_TRACE([WXDKCLOCKLIBF])
-m4trace:configure.ac:3025: -1- m4_pattern_allow([^WXDKCLOCKLIBF$])
-m4trace:configure.ac:3026: -1- AC_SUBST([WXDKCLOCKLIBS])
-m4trace:configure.ac:3026: -1- AC_SUBST_TRACE([WXDKCLOCKLIBS])
-m4trace:configure.ac:3026: -1- m4_pattern_allow([^WXDKCLOCKLIBS$])
-m4trace:configure.ac:3027: -1- AC_SUBST([WXDKHTBLIBF])
-m4trace:configure.ac:3027: -1- AC_SUBST_TRACE([WXDKHTBLIBF])
-m4trace:configure.ac:3027: -1- m4_pattern_allow([^WXDKHTBLIBF$])
-m4trace:configure.ac:3028: -1- AC_SUBST([WXDKHTBLIBS])
-m4trace:configure.ac:3028: -1- AC_SUBST_TRACE([WXDKHTBLIBS])
-m4trace:configure.ac:3028: -1- m4_pattern_allow([^WXDKHTBLIBS$])
-m4trace:configure.ac:3029: -1- AC_SUBST([PRINTQDLIBF])
-m4trace:configure.ac:3029: -1- AC_SUBST_TRACE([PRINTQDLIBF])
-m4trace:configure.ac:3029: -1- m4_pattern_allow([^PRINTQDLIBF$])
-m4trace:configure.ac:3030: -1- AC_SUBST([PRINTQDLIBS])
-m4trace:configure.ac:3030: -1- AC_SUBST_TRACE([PRINTQDLIBS])
-m4trace:configure.ac:3030: -1- m4_pattern_allow([^PRINTQDLIBS$])
-m4trace:configure.ac:3031: -1- AC_SUBST([PRINTQDILIBF])
-m4trace:configure.ac:3031: -1- AC_SUBST_TRACE([PRINTQDILIBF])
-m4trace:configure.ac:3031: -1- m4_pattern_allow([^PRINTQDILIBF$])
-m4trace:configure.ac:3032: -1- AC_SUBST([PRINTQDILIBS])
-m4trace:configure.ac:3032: -1- AC_SUBST_TRACE([PRINTQDILIBS])
-m4trace:configure.ac:3032: -1- m4_pattern_allow([^PRINTQDILIBS$])
-m4trace:configure.ac:3033: -1- AC_SUBST([PRINTQDALIBF])
-m4trace:configure.ac:3033: -1- AC_SUBST_TRACE([PRINTQDALIBF])
-m4trace:configure.ac:3033: -1- m4_pattern_allow([^PRINTQDALIBF$])
-m4trace:configure.ac:3034: -1- AC_SUBST([PRINTQDALIBS])
-m4trace:configure.ac:3034: -1- AC_SUBST_TRACE([PRINTQDALIBS])
-m4trace:configure.ac:3034: -1- m4_pattern_allow([^PRINTQDALIBS$])
-m4trace:configure.ac:3035: -1- AC_SUBST([PJSNMPLIBF])
-m4trace:configure.ac:3035: -1- AC_SUBST_TRACE([PJSNMPLIBF])
-m4trace:configure.ac:3035: -1- m4_pattern_allow([^PJSNMPLIBF$])
-m4trace:configure.ac:3036: -1- AC_SUBST([PJSNMPLIBS])
-m4trace:configure.ac:3036: -1- AC_SUBST_TRACE([PJSNMPLIBS])
-m4trace:configure.ac:3036: -1- m4_pattern_allow([^PJSNMPLIBS$])
-m4trace:configure.ac:3037: -1- AC_SUBST([PRMONSNMPLIBF])
-m4trace:configure.ac:3037: -1- AC_SUBST_TRACE([PRMONSNMPLIBF])
-m4trace:configure.ac:3037: -1- m4_pattern_allow([^PRMONSNMPLIBF$])
-m4trace:configure.ac:3038: -1- AC_SUBST([PRMONSNMPLIBS])
-m4trace:configure.ac:3038: -1- AC_SUBST_TRACE([PRMONSNMPLIBS])
-m4trace:configure.ac:3038: -1- m4_pattern_allow([^PRMONSNMPLIBS$])
-m4trace:configure.ac:3039: -1- AC_SUBST([PRINTQDCLIBF])
-m4trace:configure.ac:3039: -1- AC_SUBST_TRACE([PRINTQDCLIBF])
-m4trace:configure.ac:3039: -1- m4_pattern_allow([^PRINTQDCLIBF$])
-m4trace:configure.ac:3040: -1- AC_SUBST([PRINTQDCLIBS])
-m4trace:configure.ac:3040: -1- AC_SUBST_TRACE([PRINTQDCLIBS])
-m4trace:configure.ac:3040: -1- m4_pattern_allow([^PRINTQDCLIBS$])
-m4trace:configure.ac:3041: -1- AC_SUBST([RSHDOWNLIBF])
-m4trace:configure.ac:3041: -1- AC_SUBST_TRACE([RSHDOWNLIBF])
-m4trace:configure.ac:3041: -1- m4_pattern_allow([^RSHDOWNLIBF$])
-m4trace:configure.ac:3042: -1- AC_SUBST([RSHDOWNLIBS])
-m4trace:configure.ac:3042: -1- AC_SUBST_TRACE([RSHDOWNLIBS])
-m4trace:configure.ac:3042: -1- m4_pattern_allow([^RSHDOWNLIBS$])
-m4trace:configure.ac:3043: -1- AC_SUBST([LPRNGCLLIBF])
-m4trace:configure.ac:3043: -1- AC_SUBST_TRACE([LPRNGCLLIBF])
-m4trace:configure.ac:3043: -1- m4_pattern_allow([^LPRNGCLLIBF$])
-m4trace:configure.ac:3044: -1- AC_SUBST([LPRNGCLLIBS])
-m4trace:configure.ac:3044: -1- AC_SUBST_TRACE([LPRNGCLLIBS])
-m4trace:configure.ac:3044: -1- m4_pattern_allow([^LPRNGCLLIBS$])
-m4trace:configure.ac:3045: -1- AC_SUBST([ITADMINLIBF])
-m4trace:configure.ac:3045: -1- AC_SUBST_TRACE([ITADMINLIBF])
-m4trace:configure.ac:3045: -1- m4_pattern_allow([^ITADMINLIBF$])
-m4trace:configure.ac:3046: -1- AC_SUBST([ITADMINLIBS])
-m4trace:configure.ac:3046: -1- AC_SUBST_TRACE([ITADMINLIBS])
-m4trace:configure.ac:3046: -1- m4_pattern_allow([^ITADMINLIBS$])
-m4trace:configure.ac:3051: -1- AC_SUBST([CC])
-m4trace:configure.ac:3051: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.ac:3051: -1- m4_pattern_allow([^CC$])
-m4trace:configure.ac:3052: -1- AC_SUBST([CPP])
-m4trace:configure.ac:3052: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.ac:3052: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.ac:3053: -1- AC_SUBST([CXX])
-m4trace:configure.ac:3053: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.ac:3053: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.ac:3054: -1- AC_SUBST([DEFS])
-m4trace:configure.ac:3054: -1- AC_SUBST_TRACE([DEFS])
-m4trace:configure.ac:3054: -1- m4_pattern_allow([^DEFS$])
-m4trace:configure.ac:3055: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.ac:3055: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.ac:3055: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.ac:3056: -1- AC_SUBST([CXXFLAGS])
-m4trace:configure.ac:3056: -1- AC_SUBST_TRACE([CXXFLAGS])
-m4trace:configure.ac:3056: -1- m4_pattern_allow([^CXXFLAGS$])
-m4trace:configure.ac:3057: -1- AC_SUBST([CFLAGS])
-m4trace:configure.ac:3057: -1- AC_SUBST_TRACE([CFLAGS])
-m4trace:configure.ac:3057: -1- m4_pattern_allow([^CFLAGS$])
-m4trace:configure.ac:3058: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.ac:3058: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.ac:3058: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.ac:3059: -1- AC_SUBST([LIBS])
-m4trace:configure.ac:3059: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.ac:3059: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.ac:3060: -1- AC_SUBST([FS64])
-m4trace:configure.ac:3060: -1- AC_SUBST_TRACE([FS64])
-m4trace:configure.ac:3060: -1- m4_pattern_allow([^FS64$])
-m4trace:configure.ac:3061: -1- AC_SUBST([ZLIB])
-m4trace:configure.ac:3061: -1- AC_SUBST_TRACE([ZLIB])
-m4trace:configure.ac:3061: -1- m4_pattern_allow([^ZLIB$])
-m4trace:configure.ac:3062: -1- AC_SUBST([BZLIB])
-m4trace:configure.ac:3062: -1- AC_SUBST_TRACE([BZLIB])
-m4trace:configure.ac:3062: -1- m4_pattern_allow([^BZLIB$])
-m4trace:configure.ac:3063: -1- AC_SUBST([RANLIB])
-m4trace:configure.ac:3063: -1- AC_SUBST_TRACE([RANLIB])
-m4trace:configure.ac:3063: -1- m4_pattern_allow([^RANLIB$])
-m4trace:configure.ac:3064: -1- AC_SUBST([CFPIC])
-m4trace:configure.ac:3064: -1- AC_SUBST_TRACE([CFPIC])
-m4trace:configure.ac:3064: -1- m4_pattern_allow([^CFPIC$])
-m4trace:configure.ac:3065: -1- AC_SUBST([PROGRAMS])
-m4trace:configure.ac:3065: -1- AC_SUBST_TRACE([PROGRAMS])
-m4trace:configure.ac:3065: -1- m4_pattern_allow([^PROGRAMS$])
-m4trace:configure.ac:3066: -1- AC_SUBST([LIBRARIES])
-m4trace:configure.ac:3066: -1- AC_SUBST_TRACE([LIBRARIES])
-m4trace:configure.ac:3066: -1- m4_pattern_allow([^LIBRARIES$])
-m4trace:configure.ac:3067: -1- AC_SUBST([LIBS_STATIC])
-m4trace:configure.ac:3067: -1- AC_SUBST_TRACE([LIBS_STATIC])
-m4trace:configure.ac:3067: -1- m4_pattern_allow([^LIBS_STATIC$])
-m4trace:configure.ac:3068: -1- AC_SUBST([LIBS_SHARED])
-m4trace:configure.ac:3068: -1- AC_SUBST_TRACE([LIBS_SHARED])
-m4trace:configure.ac:3068: -1- m4_pattern_allow([^LIBS_SHARED$])
-m4trace:configure.ac:3069: -1- AC_SUBST([LIBS_INSTALL])
-m4trace:configure.ac:3069: -1- AC_SUBST_TRACE([LIBS_INSTALL])
-m4trace:configure.ac:3069: -1- m4_pattern_allow([^LIBS_INSTALL$])
-m4trace:configure.ac:3070: -1- AC_SUBST([RES_INSTALL])
-m4trace:configure.ac:3070: -1- AC_SUBST_TRACE([RES_INSTALL])
-m4trace:configure.ac:3070: -1- m4_pattern_allow([^RES_INSTALL$])
-m4trace:configure.ac:3071: -1- AC_SUBST([MKSOLIB])
-m4trace:configure.ac:3071: -1- AC_SUBST_TRACE([MKSOLIB])
-m4trace:configure.ac:3071: -1- m4_pattern_allow([^MKSOLIB$])
-m4trace:configure.ac:3072: -1- AC_SUBST([RPATH])
-m4trace:configure.ac:3072: -1- AC_SUBST_TRACE([RPATH])
-m4trace:configure.ac:3072: -1- m4_pattern_allow([^RPATH$])
-m4trace:configure.ac:3073: -1- AC_SUBST([RPATHLINK])
-m4trace:configure.ac:3073: -1- AC_SUBST_TRACE([RPATHLINK])
-m4trace:configure.ac:3073: -1- m4_pattern_allow([^RPATHLINK$])
-m4trace:configure.ac:3074: -1- AC_SUBST([UNAME])
-m4trace:configure.ac:3074: -1- AC_SUBST_TRACE([UNAME])
-m4trace:configure.ac:3074: -1- m4_pattern_allow([^UNAME$])
-m4trace:configure.ac:3075: -1- AC_SUBST([SHLIBSTYLE])
-m4trace:configure.ac:3075: -1- AC_SUBST_TRACE([SHLIBSTYLE])
-m4trace:configure.ac:3075: -1- m4_pattern_allow([^SHLIBSTYLE$])
-m4trace:configure.ac:3076: -1- AC_SUBST([VERSNO])
-m4trace:configure.ac:3076: -1- AC_SUBST_TRACE([VERSNO])
-m4trace:configure.ac:3076: -1- m4_pattern_allow([^VERSNO$])
-m4trace:configure.ac:3077: -1- AC_SUBST([SOVERS])
-m4trace:configure.ac:3077: -1- AC_SUBST_TRACE([SOVERS])
-m4trace:configure.ac:3077: -1- m4_pattern_allow([^SOVERS$])
-m4trace:configure.ac:3078: -1- AC_SUBST([CWARN])
-m4trace:configure.ac:3078: -1- AC_SUBST_TRACE([CWARN])
-m4trace:configure.ac:3078: -1- m4_pattern_allow([^CWARN$])
-m4trace:configure.ac:3079: -1- AC_SUBST([CRYPTO])
-m4trace:configure.ac:3079: -1- AC_SUBST_TRACE([CRYPTO])
-m4trace:configure.ac:3079: -1- m4_pattern_allow([^CRYPTO$])
-m4trace:configure.ac:3080: -1- AC_SUBST([DKCATLIBF])
-m4trace:configure.ac:3080: -1- AC_SUBST_TRACE([DKCATLIBF])
-m4trace:configure.ac:3080: -1- m4_pattern_allow([^DKCATLIBF$])
-m4trace:configure.ac:3081: -1- AC_SUBST([DKCATLIBS])
-m4trace:configure.ac:3081: -1- AC_SUBST_TRACE([DKCATLIBS])
-m4trace:configure.ac:3081: -1- m4_pattern_allow([^DKCATLIBS$])
-m4trace:configure.ac:3082: -1- AC_SUBST([DKBLKSLIBF])
-m4trace:configure.ac:3082: -1- AC_SUBST_TRACE([DKBLKSLIBF])
-m4trace:configure.ac:3082: -1- m4_pattern_allow([^DKBLKSLIBF$])
-m4trace:configure.ac:3083: -1- AC_SUBST([DKBLKSLIBS])
-m4trace:configure.ac:3083: -1- AC_SUBST_TRACE([DKBLKSLIBS])
-m4trace:configure.ac:3083: -1- m4_pattern_allow([^DKBLKSLIBS$])
-m4trace:configure.ac:3084: -1- AC_SUBST([DKSQLSPLITLIBF])
-m4trace:configure.ac:3084: -1- AC_SUBST_TRACE([DKSQLSPLITLIBF])
-m4trace:configure.ac:3084: -1- m4_pattern_allow([^DKSQLSPLITLIBF$])
-m4trace:configure.ac:3085: -1- AC_SUBST([DKSQLSPLITLIBS])
-m4trace:configure.ac:3085: -1- AC_SUBST_TRACE([DKSQLSPLITLIBS])
-m4trace:configure.ac:3085: -1- m4_pattern_allow([^DKSQLSPLITLIBS$])
-m4trace:configure.ac:3086: -1- AC_SUBST([DKERADISKLIBF])
-m4trace:configure.ac:3086: -1- AC_SUBST_TRACE([DKERADISKLIBF])
-m4trace:configure.ac:3086: -1- m4_pattern_allow([^DKERADISKLIBF$])
-m4trace:configure.ac:3087: -1- AC_SUBST([DKERADISKLIBS])
-m4trace:configure.ac:3087: -1- AC_SUBST_TRACE([DKERADISKLIBS])
-m4trace:configure.ac:3087: -1- m4_pattern_allow([^DKERADISKLIBS$])
-m4trace:configure.ac:3088: -1- AC_SUBST([DKLSLIBF])
-m4trace:configure.ac:3088: -1- AC_SUBST_TRACE([DKLSLIBF])
-m4trace:configure.ac:3088: -1- m4_pattern_allow([^DKLSLIBF$])
-m4trace:configure.ac:3089: -1- AC_SUBST([DKLSLIBS])
-m4trace:configure.ac:3089: -1- AC_SUBST_TRACE([DKLSLIBS])
-m4trace:configure.ac:3089: -1- m4_pattern_allow([^DKLSLIBS$])
-m4trace:configure.ac:3090: -1- AC_SUBST([DKSORTLIBF])
-m4trace:configure.ac:3090: -1- AC_SUBST_TRACE([DKSORTLIBF])
-m4trace:configure.ac:3090: -1- m4_pattern_allow([^DKSORTLIBF$])
-m4trace:configure.ac:3091: -1- AC_SUBST([DKSORTLIBS])
-m4trace:configure.ac:3091: -1- AC_SUBST_TRACE([DKSORTLIBS])
-m4trace:configure.ac:3091: -1- m4_pattern_allow([^DKSORTLIBS$])
-m4trace:configure.ac:3092: -1- AC_SUBST([DKFICLIBF])
-m4trace:configure.ac:3092: -1- AC_SUBST_TRACE([DKFICLIBF])
-m4trace:configure.ac:3092: -1- m4_pattern_allow([^DKFICLIBF$])
-m4trace:configure.ac:3093: -1- AC_SUBST([DKFICLIBS])
-m4trace:configure.ac:3093: -1- AC_SUBST_TRACE([DKFICLIBS])
-m4trace:configure.ac:3093: -1- m4_pattern_allow([^DKFICLIBS$])
-m4trace:configure.ac:3094: -1- AC_SUBST([DKUIDLIBF])
-m4trace:configure.ac:3094: -1- AC_SUBST_TRACE([DKUIDLIBF])
-m4trace:configure.ac:3094: -1- m4_pattern_allow([^DKUIDLIBF$])
-m4trace:configure.ac:3095: -1- AC_SUBST([DKUIDLIBS])
-m4trace:configure.ac:3095: -1- AC_SUBST_TRACE([DKUIDLIBS])
-m4trace:configure.ac:3095: -1- m4_pattern_allow([^DKUIDLIBS$])
-m4trace:configure.ac:3096: -1- AC_SUBST([DKPWGENLIBF])
-m4trace:configure.ac:3096: -1- AC_SUBST_TRACE([DKPWGENLIBF])
-m4trace:configure.ac:3096: -1- m4_pattern_allow([^DKPWGENLIBF$])
-m4trace:configure.ac:3097: -1- AC_SUBST([DKPWGENLIBS])
-m4trace:configure.ac:3097: -1- AC_SUBST_TRACE([DKPWGENLIBS])
-m4trace:configure.ac:3097: -1- m4_pattern_allow([^DKPWGENLIBS$])
-m4trace:configure.ac:3098: -1- AC_SUBST([DKRANDLIBF])
-m4trace:configure.ac:3098: -1- AC_SUBST_TRACE([DKRANDLIBF])
-m4trace:configure.ac:3098: -1- m4_pattern_allow([^DKRANDLIBF$])
-m4trace:configure.ac:3099: -1- AC_SUBST([DKRANDLIBS])
-m4trace:configure.ac:3099: -1- AC_SUBST_TRACE([DKRANDLIBS])
-m4trace:configure.ac:3099: -1- m4_pattern_allow([^DKRANDLIBS$])
-m4trace:configure.ac:3100: -1- AC_SUBST([DKT2HLIBF])
-m4trace:configure.ac:3100: -1- AC_SUBST_TRACE([DKT2HLIBF])
-m4trace:configure.ac:3100: -1- m4_pattern_allow([^DKT2HLIBF$])
-m4trace:configure.ac:3101: -1- AC_SUBST([DKT2HLIBS])
-m4trace:configure.ac:3101: -1- AC_SUBST_TRACE([DKT2HLIBS])
-m4trace:configure.ac:3101: -1- m4_pattern_allow([^DKT2HLIBS$])
-m4trace:configure.ac:3102: -1- AC_SUBST([DKT2LLIBF])
-m4trace:configure.ac:3102: -1- AC_SUBST_TRACE([DKT2LLIBF])
-m4trace:configure.ac:3102: -1- m4_pattern_allow([^DKT2LLIBF$])
-m4trace:configure.ac:3103: -1- AC_SUBST([DKT2LLIBS])
-m4trace:configure.ac:3103: -1- AC_SUBST_TRACE([DKT2LLIBS])
-m4trace:configure.ac:3103: -1- m4_pattern_allow([^DKT2LLIBS$])
-m4trace:configure.ac:3104: -1- AC_SUBST([DKHEXLIBF])
-m4trace:configure.ac:3104: -1- AC_SUBST_TRACE([DKHEXLIBF])
-m4trace:configure.ac:3104: -1- m4_pattern_allow([^DKHEXLIBF$])
-m4trace:configure.ac:3105: -1- AC_SUBST([DKHEXLIBS])
-m4trace:configure.ac:3105: -1- AC_SUBST_TRACE([DKHEXLIBS])
-m4trace:configure.ac:3105: -1- m4_pattern_allow([^DKHEXLIBS$])
-m4trace:configure.ac:3106: -1- AC_SUBST([DKBMMLIBF])
-m4trace:configure.ac:3106: -1- AC_SUBST_TRACE([DKBMMLIBF])
-m4trace:configure.ac:3106: -1- m4_pattern_allow([^DKBMMLIBF$])
-m4trace:configure.ac:3107: -1- AC_SUBST([DKBMMLIBS])
-m4trace:configure.ac:3107: -1- AC_SUBST_TRACE([DKBMMLIBS])
-m4trace:configure.ac:3107: -1- m4_pattern_allow([^DKBMMLIBS$])
-m4trace:configure.ac:3108: -1- AC_SUBST([DKPWDLIBF])
-m4trace:configure.ac:3108: -1- AC_SUBST_TRACE([DKPWDLIBF])
-m4trace:configure.ac:3108: -1- m4_pattern_allow([^DKPWDLIBF$])
-m4trace:configure.ac:3109: -1- AC_SUBST([DKPWDLIBS])
-m4trace:configure.ac:3109: -1- AC_SUBST_TRACE([DKPWDLIBS])
-m4trace:configure.ac:3109: -1- m4_pattern_allow([^DKPWDLIBS$])
-m4trace:configure.ac:3110: -1- AC_SUBST([DKRECVLIBF])
-m4trace:configure.ac:3110: -1- AC_SUBST_TRACE([DKRECVLIBF])
-m4trace:configure.ac:3110: -1- m4_pattern_allow([^DKRECVLIBF$])
-m4trace:configure.ac:3111: -1- AC_SUBST([DKRECVLIBS])
-m4trace:configure.ac:3111: -1- AC_SUBST_TRACE([DKRECVLIBS])
-m4trace:configure.ac:3111: -1- m4_pattern_allow([^DKRECVLIBS$])
-m4trace:configure.ac:3112: -1- AC_SUBST([DKSENDLIBF])
-m4trace:configure.ac:3112: -1- AC_SUBST_TRACE([DKSENDLIBF])
-m4trace:configure.ac:3112: -1- m4_pattern_allow([^DKSENDLIBF$])
-m4trace:configure.ac:3113: -1- AC_SUBST([DKSENDLIBS])
-m4trace:configure.ac:3113: -1- AC_SUBST_TRACE([DKSENDLIBS])
-m4trace:configure.ac:3113: -1- m4_pattern_allow([^DKSENDLIBS$])
-m4trace:configure.ac:3114: -1- AC_SUBST([DKDBT2LIBF])
-m4trace:configure.ac:3114: -1- AC_SUBST_TRACE([DKDBT2LIBF])
-m4trace:configure.ac:3114: -1- m4_pattern_allow([^DKDBT2LIBF$])
-m4trace:configure.ac:3115: -1- AC_SUBST([DKDBT2LIBS])
-m4trace:configure.ac:3115: -1- AC_SUBST_TRACE([DKDBT2LIBS])
-m4trace:configure.ac:3115: -1- m4_pattern_allow([^DKDBT2LIBS$])
-m4trace:configure.ac:3116: -1- AC_SUBST([DK4INFOLIBS])
-m4trace:configure.ac:3116: -1- AC_SUBST_TRACE([DK4INFOLIBS])
-m4trace:configure.ac:3116: -1- m4_pattern_allow([^DK4INFOLIBS$])
-m4trace:configure.ac:3117: -1- AC_SUBST([DK4INFOLIBF])
-m4trace:configure.ac:3117: -1- AC_SUBST_TRACE([DK4INFOLIBF])
-m4trace:configure.ac:3117: -1- m4_pattern_allow([^DK4INFOLIBF$])
-m4trace:configure.ac:3118: -1- AC_SUBST([PROGSOPENSSL])
-m4trace:configure.ac:3118: -1- AC_SUBST_TRACE([PROGSOPENSSL])
-m4trace:configure.ac:3118: -1- m4_pattern_allow([^PROGSOPENSSL$])
-m4trace:configure.ac:3119: -1- AC_SUBST([SOCKLIB])
-m4trace:configure.ac:3119: -1- AC_SUBST_TRACE([SOCKLIB])
-m4trace:configure.ac:3119: -1- m4_pattern_allow([^SOCKLIB$])
-m4trace:configure.ac:3120: -1- AC_SUBST([NSLLIB])
-m4trace:configure.ac:3120: -1- AC_SUBST_TRACE([NSLLIB])
-m4trace:configure.ac:3120: -1- m4_pattern_allow([^NSLLIB$])
-m4trace:configure.ac:3121: -1- AC_SUBST([LIB_SH_RES])
-m4trace:configure.ac:3121: -1- AC_SUBST_TRACE([LIB_SH_RES])
-m4trace:configure.ac:3121: -1- m4_pattern_allow([^LIB_SH_RES$])
-m4trace:configure.ac:3122: -1- AC_SUBST([LIB_SH_CLI])
-m4trace:configure.ac:3122: -1- AC_SUBST_TRACE([LIB_SH_CLI])
-m4trace:configure.ac:3122: -1- m4_pattern_allow([^LIB_SH_CLI$])
-m4trace:configure.ac:3123: -1- AC_SUBST([LIB_SH_GUI])
-m4trace:configure.ac:3123: -1- AC_SUBST_TRACE([LIB_SH_GUI])
-m4trace:configure.ac:3123: -1- m4_pattern_allow([^LIB_SH_GUI$])
-m4trace:configure.ac:3124: -1- AC_SUBST([NET_PROG_RES])
-m4trace:configure.ac:3124: -1- AC_SUBST_TRACE([NET_PROG_RES])
-m4trace:configure.ac:3124: -1- m4_pattern_allow([^NET_PROG_RES$])
-m4trace:configure.ac:3125: -1- AC_SUBST([NET_PROG_CLI])
-m4trace:configure.ac:3125: -1- AC_SUBST_TRACE([NET_PROG_CLI])
-m4trace:configure.ac:3125: -1- m4_pattern_allow([^NET_PROG_CLI$])
-m4trace:configure.ac:3126: -1- AC_SUBST([MYSQL_PROG_CLI])
-m4trace:configure.ac:3126: -1- AC_SUBST_TRACE([MYSQL_PROG_CLI])
-m4trace:configure.ac:3126: -1- m4_pattern_allow([^MYSQL_PROG_CLI$])
-m4trace:configure.ac:3127: -1- AC_SUBST([MYSQLLDFLAGS])
-m4trace:configure.ac:3127: -1- AC_SUBST_TRACE([MYSQLLDFLAGS])
-m4trace:configure.ac:3127: -1- m4_pattern_allow([^MYSQLLDFLAGS$])
-m4trace:configure.ac:3128: -1- AC_SUBST([SNMP_PROG_CLI])
-m4trace:configure.ac:3128: -1- AC_SUBST_TRACE([SNMP_PROG_CLI])
-m4trace:configure.ac:3128: -1- m4_pattern_allow([^SNMP_PROG_CLI$])
-m4trace:configure.ac:3129: -1- AC_SUBST([TESTPROGRAMS])
-m4trace:configure.ac:3129: -1- AC_SUBST_TRACE([TESTPROGRAMS])
-m4trace:configure.ac:3129: -1- m4_pattern_allow([^TESTPROGRAMS$])
-m4trace:configure.ac:3130: -1- AC_SUBST([WXCPPFLAGS])
-m4trace:configure.ac:3130: -1- AC_SUBST_TRACE([WXCPPFLAGS])
-m4trace:configure.ac:3130: -1- m4_pattern_allow([^WXCPPFLAGS$])
-m4trace:configure.ac:3131: -1- AC_SUBST([WXCXXFLAGS])
-m4trace:configure.ac:3131: -1- AC_SUBST_TRACE([WXCXXFLAGS])
-m4trace:configure.ac:3131: -1- m4_pattern_allow([^WXCXXFLAGS$])
-m4trace:configure.ac:3132: -1- AC_SUBST([WXCFLAGS])
-m4trace:configure.ac:3132: -1- AC_SUBST_TRACE([WXCFLAGS])
-m4trace:configure.ac:3132: -1- m4_pattern_allow([^WXCFLAGS$])
-m4trace:configure.ac:3133: -1- AC_SUBST([WXLDFLAGS])
-m4trace:configure.ac:3133: -1- AC_SUBST_TRACE([WXLDFLAGS])
-m4trace:configure.ac:3133: -1- m4_pattern_allow([^WXLDFLAGS$])
-m4trace:configure.ac:3134: -1- AC_SUBST([SOLIBZ])
-m4trace:configure.ac:3134: -1- AC_SUBST_TRACE([SOLIBZ])
-m4trace:configure.ac:3134: -1- m4_pattern_allow([^SOLIBZ$])
-m4trace:configure.ac:3135: -1- AC_SUBST([SOLIBBZ])
-m4trace:configure.ac:3135: -1- AC_SUBST_TRACE([SOLIBBZ])
-m4trace:configure.ac:3135: -1- m4_pattern_allow([^SOLIBBZ$])
-m4trace:configure.ac:3136: -1- AC_SUBST([SOLIBMATH])
-m4trace:configure.ac:3136: -1- AC_SUBST_TRACE([SOLIBMATH])
-m4trace:configure.ac:3136: -1- m4_pattern_allow([^SOLIBMATH$])
-m4trace:configure.ac:3137: -1- AC_SUBST([SOLIBCRYPTO])
-m4trace:configure.ac:3137: -1- AC_SUBST_TRACE([SOLIBCRYPTO])
-m4trace:configure.ac:3137: -1- m4_pattern_allow([^SOLIBCRYPTO$])
-m4trace:configure.ac:3138: -1- AC_SUBST([SOLIBNET])
-m4trace:configure.ac:3138: -1- AC_SUBST_TRACE([SOLIBNET])
-m4trace:configure.ac:3138: -1- m4_pattern_allow([^SOLIBNET$])
-m4trace:configure.ac:3139: -1- AC_SUBST([SOLIBIMG])
-m4trace:configure.ac:3139: -1- AC_SUBST_TRACE([SOLIBIMG])
-m4trace:configure.ac:3139: -1- m4_pattern_allow([^SOLIBIMG$])
-m4trace:configure.ac:3140: -1- AC_SUBST([SOLIBSDBI])
-m4trace:configure.ac:3140: -1- AC_SUBST_TRACE([SOLIBSDBI])
-m4trace:configure.ac:3140: -1- m4_pattern_allow([^SOLIBSDBI$])
-m4trace:configure.ac:3141: -1- AC_SUBST([SOLIBWX])
-m4trace:configure.ac:3141: -1- AC_SUBST_TRACE([SOLIBWX])
-m4trace:configure.ac:3141: -1- m4_pattern_allow([^SOLIBWX$])
-m4trace:configure.ac:3142: -1- AC_SUBST([SOLIBDK3PORT])
-m4trace:configure.ac:3142: -1- AC_SUBST_TRACE([SOLIBDK3PORT])
-m4trace:configure.ac:3142: -1- m4_pattern_allow([^SOLIBDK3PORT$])
-m4trace:configure.ac:3143: -1- AC_SUBST([SOLIBDK3C])
-m4trace:configure.ac:3143: -1- AC_SUBST_TRACE([SOLIBDK3C])
-m4trace:configure.ac:3143: -1- m4_pattern_allow([^SOLIBDK3C$])
-m4trace:configure.ac:3144: -1- AC_SUBST([SOLIBDK3OF])
-m4trace:configure.ac:3144: -1- AC_SUBST_TRACE([SOLIBDK3OF])
-m4trace:configure.ac:3144: -1- m4_pattern_allow([^SOLIBDK3OF$])
-m4trace:configure.ac:3145: -1- AC_SUBST([SOLIBDK3CSRND])
-m4trace:configure.ac:3145: -1- AC_SUBST_TRACE([SOLIBDK3CSRND])
-m4trace:configure.ac:3145: -1- m4_pattern_allow([^SOLIBDK3CSRND$])
-m4trace:configure.ac:3146: -1- AC_SUBST([SOLIBDK3BIF])
-m4trace:configure.ac:3146: -1- AC_SUBST_TRACE([SOLIBDK3BIF])
-m4trace:configure.ac:3146: -1- m4_pattern_allow([^SOLIBDK3BIF$])
-m4trace:configure.ac:3147: -1- AC_SUBST([SOLIBDK3DBI])
-m4trace:configure.ac:3147: -1- AC_SUBST_TRACE([SOLIBDK3DBI])
-m4trace:configure.ac:3147: -1- m4_pattern_allow([^SOLIBDK3DBI$])
-m4trace:configure.ac:3148: -1- AC_SUBST([SOLIBDK3FIG])
-m4trace:configure.ac:3148: -1- AC_SUBST_TRACE([SOLIBDK3FIG])
-m4trace:configure.ac:3148: -1- m4_pattern_allow([^SOLIBDK3FIG$])
-m4trace:configure.ac:3149: -1- AC_SUBST([SOLIBDK3BMEPS])
-m4trace:configure.ac:3149: -1- AC_SUBST_TRACE([SOLIBDK3BMEPS])
-m4trace:configure.ac:3149: -1- m4_pattern_allow([^SOLIBDK3BMEPS$])
-m4trace:configure.ac:3150: -1- AC_SUBST([SOLIBDK3NET])
-m4trace:configure.ac:3150: -1- AC_SUBST_TRACE([SOLIBDK3NET])
-m4trace:configure.ac:3150: -1- m4_pattern_allow([^SOLIBDK3NET$])
-m4trace:configure.ac:3151: -1- AC_SUBST([SOLIBDK4BASE])
-m4trace:configure.ac:3151: -1- AC_SUBST_TRACE([SOLIBDK4BASE])
-m4trace:configure.ac:3151: -1- m4_pattern_allow([^SOLIBDK4BASE$])
-m4trace:configure.ac:3152: -1- AC_SUBST([SOLIBDK4MA])
-m4trace:configure.ac:3152: -1- AC_SUBST_TRACE([SOLIBDK4MA])
-m4trace:configure.ac:3152: -1- m4_pattern_allow([^SOLIBDK4MA$])
-m4trace:configure.ac:3153: -1- AC_SUBST([SOLIBDK4MAIO8H])
-m4trace:configure.ac:3153: -1- AC_SUBST_TRACE([SOLIBDK4MAIO8H])
-m4trace:configure.ac:3153: -1- m4_pattern_allow([^SOLIBDK4MAIO8H$])
-m4trace:configure.ac:3154: -1- AC_SUBST([SOLIBDK4MAIOWH])
-m4trace:configure.ac:3154: -1- AC_SUBST_TRACE([SOLIBDK4MAIOWH])
-m4trace:configure.ac:3154: -1- m4_pattern_allow([^SOLIBDK4MAIOWH$])
-m4trace:configure.ac:3155: -1- AC_SUBST([SOLIBDK4MAIODH])
-m4trace:configure.ac:3155: -1- AC_SUBST_TRACE([SOLIBDK4MAIODH])
-m4trace:configure.ac:3155: -1- m4_pattern_allow([^SOLIBDK4MAIODH$])
-m4trace:configure.ac:3156: -1- AC_SUBST([SOLIBDK4MAIO8D])
-m4trace:configure.ac:3156: -1- AC_SUBST_TRACE([SOLIBDK4MAIO8D])
-m4trace:configure.ac:3156: -1- m4_pattern_allow([^SOLIBDK4MAIO8D$])
-m4trace:configure.ac:3157: -1- AC_SUBST([SOLIBDK4MAIOWD])
-m4trace:configure.ac:3157: -1- AC_SUBST_TRACE([SOLIBDK4MAIOWD])
-m4trace:configure.ac:3157: -1- m4_pattern_allow([^SOLIBDK4MAIOWD$])
-m4trace:configure.ac:3158: -1- AC_SUBST([SOLIBDK4MAIODD])
-m4trace:configure.ac:3158: -1- AC_SUBST_TRACE([SOLIBDK4MAIODD])
-m4trace:configure.ac:3158: -1- m4_pattern_allow([^SOLIBDK4MAIODD$])
-m4trace:configure.ac:3159: -1- AC_SUBST([SOLIBDK4C])
-m4trace:configure.ac:3159: -1- AC_SUBST_TRACE([SOLIBDK4C])
-m4trace:configure.ac:3159: -1- m4_pattern_allow([^SOLIBDK4C$])
-m4trace:configure.ac:3160: -1- AC_SUBST([SOLIBDK4MDRND])
-m4trace:configure.ac:3160: -1- AC_SUBST_TRACE([SOLIBDK4MDRND])
-m4trace:configure.ac:3160: -1- m4_pattern_allow([^SOLIBDK4MDRND$])
-m4trace:configure.ac:3161: -1- AC_SUBST([SOLIBDK4PPPT])
-m4trace:configure.ac:3161: -1- AC_SUBST_TRACE([SOLIBDK4PPPT])
-m4trace:configure.ac:3161: -1- m4_pattern_allow([^SOLIBDK4PPPT$])
-m4trace:configure.ac:3162: -1- AC_SUBST([SOLIBDK4APP])
-m4trace:configure.ac:3162: -1- AC_SUBST_TRACE([SOLIBDK4APP])
-m4trace:configure.ac:3162: -1- m4_pattern_allow([^SOLIBDK4APP$])
-m4trace:configure.ac:3163: -1- AC_SUBST([SOLIBDK4LAT])
-m4trace:configure.ac:3163: -1- AC_SUBST_TRACE([SOLIBDK4LAT])
-m4trace:configure.ac:3163: -1- m4_pattern_allow([^SOLIBDK4LAT$])
-m4trace:configure.ac:3164: -1- AC_SUBST([SOLIBDK4SOCK])
-m4trace:configure.ac:3164: -1- AC_SUBST_TRACE([SOLIBDK4SOCK])
-m4trace:configure.ac:3164: -1- m4_pattern_allow([^SOLIBDK4SOCK$])
-m4trace:configure.ac:3165: -1- AC_SUBST([SOLIBDK4SOCKA])
-m4trace:configure.ac:3165: -1- AC_SUBST_TRACE([SOLIBDK4SOCKA])
-m4trace:configure.ac:3165: -1- m4_pattern_allow([^SOLIBDK4SOCKA$])
-m4trace:configure.ac:3166: -1- AC_SUBST([SOLIBDK4DBI])
-m4trace:configure.ac:3166: -1- AC_SUBST_TRACE([SOLIBDK4DBI])
-m4trace:configure.ac:3166: -1- m4_pattern_allow([^SOLIBDK4DBI$])
-m4trace:configure.ac:3167: -1- AC_SUBST([SOLIBDK4DBIA])
-m4trace:configure.ac:3167: -1- AC_SUBST_TRACE([SOLIBDK4DBIA])
-m4trace:configure.ac:3167: -1- m4_pattern_allow([^SOLIBDK4DBIA$])
-m4trace:configure.ac:3168: -1- AC_SUBST([NETSNMP_LIBS])
-m4trace:configure.ac:3168: -1- AC_SUBST_TRACE([NETSNMP_LIBS])
-m4trace:configure.ac:3168: -1- m4_pattern_allow([^NETSNMP_LIBS$])
-m4trace:configure.ac:3169: -1- AC_SUBST([MYSQLLIB])
-m4trace:configure.ac:3169: -1- AC_SUBST_TRACE([MYSQLLIB])
-m4trace:configure.ac:3169: -1- m4_pattern_allow([^MYSQLLIB$])
-m4trace:configure.ac:3170: -1- AC_SUBST([NETSNMP_CFLAGS])
-m4trace:configure.ac:3170: -1- AC_SUBST_TRACE([NETSNMP_CFLAGS])
-m4trace:configure.ac:3170: -1- m4_pattern_allow([^NETSNMP_CFLAGS$])
-m4trace:configure.ac:3171: -1- AC_SUBST([WXDKFCSLIBF])
-m4trace:configure.ac:3171: -1- AC_SUBST_TRACE([WXDKFCSLIBF])
-m4trace:configure.ac:3171: -1- m4_pattern_allow([^WXDKFCSLIBF$])
-m4trace:configure.ac:3172: -1- AC_SUBST([WXDKFCSLIBS])
-m4trace:configure.ac:3172: -1- AC_SUBST_TRACE([WXDKFCSLIBS])
-m4trace:configure.ac:3172: -1- m4_pattern_allow([^WXDKFCSLIBS$])
-m4trace:configure.ac:3173: -1- AC_SUBST([GETSOURCE])
-m4trace:configure.ac:3173: -1- AC_SUBST_TRACE([GETSOURCE])
-m4trace:configure.ac:3173: -1- m4_pattern_allow([^GETSOURCE$])
-m4trace:configure.ac:3174: -1- AC_SUBST([MAKE])
-m4trace:configure.ac:3174: -1- AC_SUBST_TRACE([MAKE])
-m4trace:configure.ac:3174: -1- m4_pattern_allow([^MAKE$])
-m4trace:configure.ac:3175: -1- AC_SUBST([CLILIB])
-m4trace:configure.ac:3175: -1- AC_SUBST_TRACE([CLILIB])
-m4trace:configure.ac:3175: -1- m4_pattern_allow([^CLILIB$])
-m4trace:configure.ac:3176: -1- AC_SUBST([GUILIB])
-m4trace:configure.ac:3176: -1- AC_SUBST_TRACE([GUILIB])
-m4trace:configure.ac:3176: -1- m4_pattern_allow([^GUILIB$])
-m4trace:configure.ac:3177: -1- AC_SUBST([ENTRY])
-m4trace:configure.ac:3177: -1- AC_SUBST_TRACE([ENTRY])
-m4trace:configure.ac:3177: -1- m4_pattern_allow([^ENTRY$])
-m4trace:configure.ac:3178: -1- AC_SUBST([WINUNICODE])
-m4trace:configure.ac:3178: -1- AC_SUBST_TRACE([WINUNICODE])
-m4trace:configure.ac:3178: -1- m4_pattern_allow([^WINUNICODE$])
-m4trace:configure.ac:3179: -1- AC_SUBST([INSTALLMANPAGES])
-m4trace:configure.ac:3179: -1- AC_SUBST_TRACE([INSTALLMANPAGES])
-m4trace:configure.ac:3179: -1- m4_pattern_allow([^INSTALLMANPAGES$])
-m4trace:configure.ac:3180: -1- AC_SUBST([LIBSPRIVATE])
-m4trace:configure.ac:3180: -1- AC_SUBST_TRACE([LIBSPRIVATE])
-m4trace:configure.ac:3180: -1- m4_pattern_allow([^LIBSPRIVATE$])
-m4trace:configure.ac:3181: -1- AC_SUBST([RTLIB])
-m4trace:configure.ac:3181: -1- AC_SUBST_TRACE([RTLIB])
-m4trace:configure.ac:3181: -1- m4_pattern_allow([^RTLIB$])
-m4trace:configure.ac:3182: -1- AC_SUBST([LIBDK4BASELIBF])
-m4trace:configure.ac:3182: -1- AC_SUBST_TRACE([LIBDK4BASELIBF])
-m4trace:configure.ac:3182: -1- m4_pattern_allow([^LIBDK4BASELIBF$])
-m4trace:configure.ac:3183: -1- AC_SUBST([LIBDK4BASELIBS])
-m4trace:configure.ac:3183: -1- AC_SUBST_TRACE([LIBDK4BASELIBS])
-m4trace:configure.ac:3183: -1- m4_pattern_allow([^LIBDK4BASELIBS$])
-m4trace:configure.ac:3184: -1- AC_SUBST([LIBDK4MALIBF])
-m4trace:configure.ac:3184: -1- AC_SUBST_TRACE([LIBDK4MALIBF])
-m4trace:configure.ac:3184: -1- m4_pattern_allow([^LIBDK4MALIBF$])
-m4trace:configure.ac:3185: -1- AC_SUBST([LIBDK4MALIBS])
-m4trace:configure.ac:3185: -1- AC_SUBST_TRACE([LIBDK4MALIBS])
-m4trace:configure.ac:3185: -1- m4_pattern_allow([^LIBDK4MALIBS$])
-m4trace:configure.ac:3186: -1- AC_SUBST([LIBDK4MAIO8DLIBF])
-m4trace:configure.ac:3186: -1- AC_SUBST_TRACE([LIBDK4MAIO8DLIBF])
-m4trace:configure.ac:3186: -1- m4_pattern_allow([^LIBDK4MAIO8DLIBF$])
-m4trace:configure.ac:3187: -1- AC_SUBST([LIBDK4MAIO8DLIBS])
-m4trace:configure.ac:3187: -1- AC_SUBST_TRACE([LIBDK4MAIO8DLIBS])
-m4trace:configure.ac:3187: -1- m4_pattern_allow([^LIBDK4MAIO8DLIBS$])
-m4trace:configure.ac:3188: -1- AC_SUBST([LIBDK4MAIOWDLIBF])
-m4trace:configure.ac:3188: -1- AC_SUBST_TRACE([LIBDK4MAIOWDLIBF])
-m4trace:configure.ac:3188: -1- m4_pattern_allow([^LIBDK4MAIOWDLIBF$])
-m4trace:configure.ac:3189: -1- AC_SUBST([LIBDK4MAIOWDLIBS])
-m4trace:configure.ac:3189: -1- AC_SUBST_TRACE([LIBDK4MAIOWDLIBS])
-m4trace:configure.ac:3189: -1- m4_pattern_allow([^LIBDK4MAIOWDLIBS$])
-m4trace:configure.ac:3190: -1- AC_SUBST([LIBDK4MAIODDLIBF])
-m4trace:configure.ac:3190: -1- AC_SUBST_TRACE([LIBDK4MAIODDLIBF])
-m4trace:configure.ac:3190: -1- m4_pattern_allow([^LIBDK4MAIODDLIBF$])
-m4trace:configure.ac:3191: -1- AC_SUBST([LIBDK4MAIODDLIBS])
-m4trace:configure.ac:3191: -1- AC_SUBST_TRACE([LIBDK4MAIODDLIBS])
-m4trace:configure.ac:3191: -1- m4_pattern_allow([^LIBDK4MAIODDLIBS$])
-m4trace:configure.ac:3192: -1- AC_SUBST([LIBDK4MAIOXDLIBF])
-m4trace:configure.ac:3192: -1- AC_SUBST_TRACE([LIBDK4MAIOXDLIBF])
-m4trace:configure.ac:3192: -1- m4_pattern_allow([^LIBDK4MAIOXDLIBF$])
-m4trace:configure.ac:3193: -1- AC_SUBST([LIBDK4MAIOXDLIBS])
-m4trace:configure.ac:3193: -1- AC_SUBST_TRACE([LIBDK4MAIOXDLIBS])
-m4trace:configure.ac:3193: -1- m4_pattern_allow([^LIBDK4MAIOXDLIBS$])
-m4trace:configure.ac:3194: -1- AC_SUBST([LIBDK4MAIO8HLIBF])
-m4trace:configure.ac:3194: -1- AC_SUBST_TRACE([LIBDK4MAIO8HLIBF])
-m4trace:configure.ac:3194: -1- m4_pattern_allow([^LIBDK4MAIO8HLIBF$])
-m4trace:configure.ac:3195: -1- AC_SUBST([LIBDK4MAIO8HLIBS])
-m4trace:configure.ac:3195: -1- AC_SUBST_TRACE([LIBDK4MAIO8HLIBS])
-m4trace:configure.ac:3195: -1- m4_pattern_allow([^LIBDK4MAIO8HLIBS$])
-m4trace:configure.ac:3196: -1- AC_SUBST([LIBDK4MAIOWHLIBF])
-m4trace:configure.ac:3196: -1- AC_SUBST_TRACE([LIBDK4MAIOWHLIBF])
-m4trace:configure.ac:3196: -1- m4_pattern_allow([^LIBDK4MAIOWHLIBF$])
-m4trace:configure.ac:3197: -1- AC_SUBST([LIBDK4MAIOWHLIBS])
-m4trace:configure.ac:3197: -1- AC_SUBST_TRACE([LIBDK4MAIOWHLIBS])
-m4trace:configure.ac:3197: -1- m4_pattern_allow([^LIBDK4MAIOWHLIBS$])
-m4trace:configure.ac:3198: -1- AC_SUBST([LIBDK4MAIODHLIBF])
-m4trace:configure.ac:3198: -1- AC_SUBST_TRACE([LIBDK4MAIODHLIBF])
-m4trace:configure.ac:3198: -1- m4_pattern_allow([^LIBDK4MAIODHLIBF$])
-m4trace:configure.ac:3199: -1- AC_SUBST([LIBDK4MAIODHLIBS])
-m4trace:configure.ac:3199: -1- AC_SUBST_TRACE([LIBDK4MAIODHLIBS])
-m4trace:configure.ac:3199: -1- m4_pattern_allow([^LIBDK4MAIODHLIBS$])
-m4trace:configure.ac:3200: -1- AC_SUBST([LIBDK4DBILIBF])
-m4trace:configure.ac:3200: -1- AC_SUBST_TRACE([LIBDK4DBILIBF])
-m4trace:configure.ac:3200: -1- m4_pattern_allow([^LIBDK4DBILIBF$])
-m4trace:configure.ac:3201: -1- AC_SUBST([LIBDK4DBILIBS])
-m4trace:configure.ac:3201: -1- AC_SUBST_TRACE([LIBDK4DBILIBS])
-m4trace:configure.ac:3201: -1- m4_pattern_allow([^LIBDK4DBILIBS$])
-m4trace:configure.ac:3202: -1- AC_SUBST([LIBDK4CLIBF])
-m4trace:configure.ac:3202: -1- AC_SUBST_TRACE([LIBDK4CLIBF])
-m4trace:configure.ac:3202: -1- m4_pattern_allow([^LIBDK4CLIBF$])
-m4trace:configure.ac:3203: -1- AC_SUBST([LIBDK4CLIBS])
-m4trace:configure.ac:3203: -1- AC_SUBST_TRACE([LIBDK4CLIBS])
-m4trace:configure.ac:3203: -1- m4_pattern_allow([^LIBDK4CLIBS$])
-m4trace:configure.ac:3204: -1- AC_SUBST([LIBDK4LATLIBF])
-m4trace:configure.ac:3204: -1- AC_SUBST_TRACE([LIBDK4LATLIBF])
-m4trace:configure.ac:3204: -1- m4_pattern_allow([^LIBDK4LATLIBF$])
-m4trace:configure.ac:3205: -1- AC_SUBST([LIBDK4LATLIBS])
-m4trace:configure.ac:3205: -1- AC_SUBST_TRACE([LIBDK4LATLIBS])
-m4trace:configure.ac:3205: -1- m4_pattern_allow([^LIBDK4LATLIBS$])
-m4trace:configure.ac:3206: -1- AC_SUBST([LIBDK4SOCKLIBF])
-m4trace:configure.ac:3206: -1- AC_SUBST_TRACE([LIBDK4SOCKLIBF])
-m4trace:configure.ac:3206: -1- m4_pattern_allow([^LIBDK4SOCKLIBF$])
-m4trace:configure.ac:3207: -1- AC_SUBST([LIBDK4SOCKLIBS])
-m4trace:configure.ac:3207: -1- AC_SUBST_TRACE([LIBDK4SOCKLIBS])
-m4trace:configure.ac:3207: -1- m4_pattern_allow([^LIBDK4SOCKLIBS$])
-m4trace:configure.ac:3208: -1- AC_SUBST([LIBDK4MDRNDLIBF])
-m4trace:configure.ac:3208: -1- AC_SUBST_TRACE([LIBDK4MDRNDLIBF])
-m4trace:configure.ac:3208: -1- m4_pattern_allow([^LIBDK4MDRNDLIBF$])
-m4trace:configure.ac:3209: -1- AC_SUBST([LIBDK4MDRNDLIBS])
-m4trace:configure.ac:3209: -1- AC_SUBST_TRACE([LIBDK4MDRNDLIBS])
-m4trace:configure.ac:3209: -1- m4_pattern_allow([^LIBDK4MDRNDLIBS$])
-m4trace:configure.ac:3210: -1- AC_SUBST([LIBDK4PPPTLIBF])
-m4trace:configure.ac:3210: -1- AC_SUBST_TRACE([LIBDK4PPPTLIBF])
-m4trace:configure.ac:3210: -1- m4_pattern_allow([^LIBDK4PPPTLIBF$])
-m4trace:configure.ac:3211: -1- AC_SUBST([LIBDK4PPPTLIBS])
-m4trace:configure.ac:3211: -1- AC_SUBST_TRACE([LIBDK4PPPTLIBS])
-m4trace:configure.ac:3211: -1- m4_pattern_allow([^LIBDK4PPPTLIBS$])
-m4trace:configure.ac:3212: -1- AC_SUBST([LIBDK4APPLIBF])
-m4trace:configure.ac:3212: -1- AC_SUBST_TRACE([LIBDK4APPLIBF])
-m4trace:configure.ac:3212: -1- m4_pattern_allow([^LIBDK4APPLIBF$])
-m4trace:configure.ac:3213: -1- AC_SUBST([LIBDK4APPLIBS])
-m4trace:configure.ac:3213: -1- AC_SUBST_TRACE([LIBDK4APPLIBS])
-m4trace:configure.ac:3213: -1- m4_pattern_allow([^LIBDK4APPLIBS$])
-m4trace:configure.ac:3214: -1- AC_SUBST([LIBDK4PPPTALIBF])
-m4trace:configure.ac:3214: -1- AC_SUBST_TRACE([LIBDK4PPPTALIBF])
-m4trace:configure.ac:3214: -1- m4_pattern_allow([^LIBDK4PPPTALIBF$])
-m4trace:configure.ac:3215: -1- AC_SUBST([LIBDK4PPPTALIBS])
-m4trace:configure.ac:3215: -1- AC_SUBST_TRACE([LIBDK4PPPTALIBS])
-m4trace:configure.ac:3215: -1- m4_pattern_allow([^LIBDK4PPPTALIBS$])
-m4trace:configure.ac:3216: -1- AC_SUBST([LIBDK4SOCKALIBF])
-m4trace:configure.ac:3216: -1- AC_SUBST_TRACE([LIBDK4SOCKALIBF])
-m4trace:configure.ac:3216: -1- m4_pattern_allow([^LIBDK4SOCKALIBF$])
-m4trace:configure.ac:3217: -1- AC_SUBST([LIBDK4SOCKALIBS])
-m4trace:configure.ac:3217: -1- AC_SUBST_TRACE([LIBDK4SOCKALIBS])
-m4trace:configure.ac:3217: -1- m4_pattern_allow([^LIBDK4SOCKALIBS$])
-m4trace:configure.ac:3218: -1- AC_SUBST([LIBDK4DBIALIBF])
-m4trace:configure.ac:3218: -1- AC_SUBST_TRACE([LIBDK4DBIALIBF])
-m4trace:configure.ac:3218: -1- m4_pattern_allow([^LIBDK4DBIALIBF$])
-m4trace:configure.ac:3219: -1- AC_SUBST([LIBDK4DBIALIBS])
-m4trace:configure.ac:3219: -1- AC_SUBST_TRACE([LIBDK4DBIALIBS])
-m4trace:configure.ac:3219: -1- m4_pattern_allow([^LIBDK4DBIALIBS$])
-m4trace:configure.ac:3220: -1- AC_SUBST([LIBDK4WXLIBF])
-m4trace:configure.ac:3220: -1- AC_SUBST_TRACE([LIBDK4WXLIBF])
-m4trace:configure.ac:3220: -1- m4_pattern_allow([^LIBDK4WXLIBF$])
-m4trace:configure.ac:3221: -1- AC_SUBST([LIBDK4WXLIBS])
-m4trace:configure.ac:3221: -1- AC_SUBST_TRACE([LIBDK4WXLIBS])
-m4trace:configure.ac:3221: -1- m4_pattern_allow([^LIBDK4WXLIBS$])
-m4trace:configure.ac:3222: -1- AC_SUBST([LIBDK3TRACELIBF])
-m4trace:configure.ac:3222: -1- AC_SUBST_TRACE([LIBDK3TRACELIBF])
-m4trace:configure.ac:3222: -1- m4_pattern_allow([^LIBDK3TRACELIBF$])
-m4trace:configure.ac:3223: -1- AC_SUBST([LIBDK3TRACELIBS])
-m4trace:configure.ac:3223: -1- AC_SUBST_TRACE([LIBDK3TRACELIBS])
-m4trace:configure.ac:3223: -1- m4_pattern_allow([^LIBDK3TRACELIBS$])
-m4trace:configure.ac:3224: -1- AC_SUBST([LIBDK3CLIBF])
-m4trace:configure.ac:3224: -1- AC_SUBST_TRACE([LIBDK3CLIBF])
-m4trace:configure.ac:3224: -1- m4_pattern_allow([^LIBDK3CLIBF$])
-m4trace:configure.ac:3225: -1- AC_SUBST([LIBDK3CLIBS])
-m4trace:configure.ac:3225: -1- AC_SUBST_TRACE([LIBDK3CLIBS])
-m4trace:configure.ac:3225: -1- m4_pattern_allow([^LIBDK3CLIBS$])
-m4trace:configure.ac:3226: -1- AC_SUBST([LIBDK3OFLIBF])
-m4trace:configure.ac:3226: -1- AC_SUBST_TRACE([LIBDK3OFLIBF])
-m4trace:configure.ac:3226: -1- m4_pattern_allow([^LIBDK3OFLIBF$])
-m4trace:configure.ac:3227: -1- AC_SUBST([LIBDK3OFLIBS])
-m4trace:configure.ac:3227: -1- AC_SUBST_TRACE([LIBDK3OFLIBS])
-m4trace:configure.ac:3227: -1- m4_pattern_allow([^LIBDK3OFLIBS$])
-m4trace:configure.ac:3228: -1- AC_SUBST([LIBDK3CSRNDLIBF])
-m4trace:configure.ac:3228: -1- AC_SUBST_TRACE([LIBDK3CSRNDLIBF])
-m4trace:configure.ac:3228: -1- m4_pattern_allow([^LIBDK3CSRNDLIBF$])
-m4trace:configure.ac:3229: -1- AC_SUBST([LIBDK3CSRNDLIBS])
-m4trace:configure.ac:3229: -1- AC_SUBST_TRACE([LIBDK3CSRNDLIBS])
-m4trace:configure.ac:3229: -1- m4_pattern_allow([^LIBDK3CSRNDLIBS$])
-m4trace:configure.ac:3230: -1- AC_SUBST([LIBDK3BIFLIBF])
-m4trace:configure.ac:3230: -1- AC_SUBST_TRACE([LIBDK3BIFLIBF])
-m4trace:configure.ac:3230: -1- m4_pattern_allow([^LIBDK3BIFLIBF$])
-m4trace:configure.ac:3231: -1- AC_SUBST([LIBDK3BIFLIBS])
-m4trace:configure.ac:3231: -1- AC_SUBST_TRACE([LIBDK3BIFLIBS])
-m4trace:configure.ac:3231: -1- m4_pattern_allow([^LIBDK3BIFLIBS$])
-m4trace:configure.ac:3232: -1- AC_SUBST([LIBDK3DBILIBF])
-m4trace:configure.ac:3232: -1- AC_SUBST_TRACE([LIBDK3DBILIBF])
-m4trace:configure.ac:3232: -1- m4_pattern_allow([^LIBDK3DBILIBF$])
-m4trace:configure.ac:3233: -1- AC_SUBST([LIBDK3DBILIBS])
-m4trace:configure.ac:3233: -1- AC_SUBST_TRACE([LIBDK3DBILIBS])
-m4trace:configure.ac:3233: -1- m4_pattern_allow([^LIBDK3DBILIBS$])
-m4trace:configure.ac:3234: -1- AC_SUBST([LIBDK3BMEPSLIBF])
-m4trace:configure.ac:3234: -1- AC_SUBST_TRACE([LIBDK3BMEPSLIBF])
-m4trace:configure.ac:3234: -1- m4_pattern_allow([^LIBDK3BMEPSLIBF$])
-m4trace:configure.ac:3235: -1- AC_SUBST([LIBDK3BMEPSLIBS])
-m4trace:configure.ac:3235: -1- AC_SUBST_TRACE([LIBDK3BMEPSLIBS])
-m4trace:configure.ac:3235: -1- m4_pattern_allow([^LIBDK3BMEPSLIBS$])
-m4trace:configure.ac:3236: -1- AC_SUBST([LIBDK3FIGLIBF])
-m4trace:configure.ac:3236: -1- AC_SUBST_TRACE([LIBDK3FIGLIBF])
-m4trace:configure.ac:3236: -1- m4_pattern_allow([^LIBDK3FIGLIBF$])
-m4trace:configure.ac:3237: -1- AC_SUBST([LIBDK3FIGLIBS])
-m4trace:configure.ac:3237: -1- AC_SUBST_TRACE([LIBDK3FIGLIBS])
-m4trace:configure.ac:3237: -1- m4_pattern_allow([^LIBDK3FIGLIBS$])
-m4trace:configure.ac:3238: -1- AC_SUBST([LIBDK3WXLIBF])
-m4trace:configure.ac:3238: -1- AC_SUBST_TRACE([LIBDK3WXLIBF])
-m4trace:configure.ac:3238: -1- m4_pattern_allow([^LIBDK3WXLIBF$])
-m4trace:configure.ac:3239: -1- AC_SUBST([LIBDK3WXLIBS])
-m4trace:configure.ac:3239: -1- AC_SUBST_TRACE([LIBDK3WXLIBS])
-m4trace:configure.ac:3239: -1- m4_pattern_allow([^LIBDK3WXLIBS$])
-m4trace:configure.ac:3241: -1- AC_CONFIG_FILES([Makefile scripts/wr-dk3inst.sh scripts/wr-dk4inst.sh scripts/create-desktop-files.sh scripts/build-help.sh initd-printqd dktools.pc pkginfo debian/control])
-m4trace:configure.ac:3241: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
+m4trace:configure.ac:2711: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
+m4trace:configure.ac:2711: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
+m4trace:configure.ac:2711: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
+m4trace:configure.ac:2711: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
+m4trace:configure.ac:2711: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
+m4trace:configure.ac:2711: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
+m4trace:configure.ac:2711: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
+m4trace:configure.ac:2711: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
+m4trace:configure.ac:2711: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
+m4trace:configure.ac:2711: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
+m4trace:configure.ac:2711: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETSOCKNAME])
+m4trace:configure.ac:2711: -1- m4_pattern_allow([^HAVE_GETSOCKNAME$])
+m4trace:configure.ac:2731: -1- AH_OUTPUT([HAVE_SELECT], [/* Define to 1 if you have the `select\' function. */
+@%:@undef HAVE_SELECT])
+m4trace:configure.ac:2731: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SELECT])
+m4trace:configure.ac:2731: -1- m4_pattern_allow([^HAVE_SELECT$])
+m4trace:configure.ac:2731: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SELECT])
+m4trace:configure.ac:2731: -1- m4_pattern_allow([^HAVE_SELECT$])
+m4trace:configure.ac:2731: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SELECT])
+m4trace:configure.ac:2731: -1- m4_pattern_allow([^HAVE_SELECT$])
+m4trace:configure.ac:2731: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SELECT])
+m4trace:configure.ac:2731: -1- m4_pattern_allow([^HAVE_SELECT$])
+m4trace:configure.ac:2731: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SELECT])
+m4trace:configure.ac:2731: -1- m4_pattern_allow([^HAVE_SELECT$])
+m4trace:configure.ac:2731: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SELECT])
+m4trace:configure.ac:2731: -1- m4_pattern_allow([^HAVE_SELECT$])
+m4trace:configure.ac:2765: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSTEMD])
+m4trace:configure.ac:2765: -1- m4_pattern_allow([^HAVE_SYSTEMD$])
+m4trace:configure.ac:2772: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSTEMD])
+m4trace:configure.ac:2772: -1- m4_pattern_allow([^HAVE_SYSTEMD$])
+m4trace:configure.ac:2778: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSTEMD])
+m4trace:configure.ac:2778: -1- m4_pattern_allow([^HAVE_SYSTEMD$])
+m4trace:configure.ac:2785: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSTEMD])
+m4trace:configure.ac:2785: -1- m4_pattern_allow([^HAVE_SYSTEMD$])
+m4trace:configure.ac:2792: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSTEMD])
+m4trace:configure.ac:2792: -1- m4_pattern_allow([^HAVE_SYSTEMD$])
+m4trace:configure.ac:2798: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSTEMD])
+m4trace:configure.ac:2798: -1- m4_pattern_allow([^HAVE_SYSTEMD$])
+m4trace:configure.ac:2862: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2862: the top level])
+m4trace:configure.ac:2863: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2863: the top level])
+m4trace:configure.ac:2866: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NDBM_H])
+m4trace:configure.ac:2866: -1- m4_pattern_allow([^HAVE_NDBM_H$])
+m4trace:configure.ac:2870: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NDBM_H])
+m4trace:configure.ac:2870: -1- m4_pattern_allow([^HAVE_NDBM_H$])
+m4trace:configure.ac:2874: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NDBM_H])
+m4trace:configure.ac:2874: -1- m4_pattern_allow([^HAVE_NDBM_H$])
+m4trace:configure.ac:2880: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GDBM_H])
+m4trace:configure.ac:2880: -1- m4_pattern_allow([^HAVE_GDBM_H$])
+m4trace:configure.ac:2882: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2882: the top level])
+m4trace:configure.ac:2882: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DB_H])
+m4trace:configure.ac:2882: -1- m4_pattern_allow([^HAVE_DB_H$])
+m4trace:configure.ac:2888: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2888: the top level])
+m4trace:configure.ac:2888: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PNG_H])
+m4trace:configure.ac:2888: -1- m4_pattern_allow([^HAVE_PNG_H$])
+m4trace:configure.ac:2893: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2893: the top level])
+m4trace:configure.ac:2893: -1- AC_DEFINE_TRACE_LITERAL([HAVE_JPEGLIB_H])
+m4trace:configure.ac:2893: -1- m4_pattern_allow([^HAVE_JPEGLIB_H$])
+m4trace:configure.ac:2898: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2898: the top level])
+m4trace:configure.ac:2898: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TIFF_H])
+m4trace:configure.ac:2898: -1- m4_pattern_allow([^HAVE_TIFF_H$])
+m4trace:configure.ac:2955: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WXWIDGETS])
+m4trace:configure.ac:2955: -1- m4_pattern_allow([^HAVE_WXWIDGETS$])
+m4trace:configure.ac:2968: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WX_DEFS_H])
+m4trace:configure.ac:2968: -1- m4_pattern_allow([^HAVE_WX_DEFS_H$])
+m4trace:configure.ac:2969: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WX_CHARTYPE_H])
+m4trace:configure.ac:2969: -1- m4_pattern_allow([^HAVE_WX_CHARTYPE_H$])
+m4trace:configure.ac:2972: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WX_DEFS_H])
+m4trace:configure.ac:2972: -1- m4_pattern_allow([^HAVE_WX_DEFS_H$])
+m4trace:configure.ac:2973: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WX_WXCHAR_H])
+m4trace:configure.ac:2973: -1- m4_pattern_allow([^HAVE_WX_WXCHAR_H$])
+m4trace:configure.ac:2980: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2980: the top level])
+m4trace:configure.ac:2980: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MARIADB_MYSQL_H])
+m4trace:configure.ac:2980: -1- m4_pattern_allow([^HAVE_MARIADB_MYSQL_H$])
+m4trace:configure.ac:2980: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
+../../lib/autoconf/headers.m4:129: _AC_CHECK_HEADER_MONGREL is expanded from...
+../../lib/autoconf/headers.m4:67: AC_CHECK_HEADER is expanded from...
+../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2980: the top level])
+m4trace:configure.ac:2980: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MYSQL_MYSQL_H])
+m4trace:configure.ac:2980: -1- m4_pattern_allow([^HAVE_MYSQL_MYSQL_H$])
+m4trace:configure.ac:2980: -1- _m4_warn([obsolete], [The macro `AC_HEADER_CHECK' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
+../../lib/autoconf/headers.m4:129: _AC_CHECK_HEADER_MONGREL is expanded from...
+../../lib/autoconf/headers.m4:67: AC_CHECK_HEADER is expanded from...
+../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
+../../lib/autoconf/headers.m4:129: _AC_CHECK_HEADER_MONGREL is expanded from...
+../../lib/autoconf/headers.m4:67: AC_CHECK_HEADER is expanded from...
+../../lib/autoconf/oldnames.m4:36: AC_HEADER_CHECK is expanded from...
+configure.ac:2980: the top level])
+m4trace:configure.ac:2980: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MYSQL_H])
+m4trace:configure.ac:2980: -1- m4_pattern_allow([^HAVE_MYSQL_H$])
+m4trace:configure.ac:3002: -2- AC_DEFINE_TRACE_LITERAL([HAVE_PNG_GET_PIXELS_PER_INCH])
+m4trace:configure.ac:3002: -2- m4_pattern_allow([^HAVE_PNG_GET_PIXELS_PER_INCH$])
+m4trace:configure.ac:3006: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:3006: the top level])
+m4trace:configure.ac:3006: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DB_CURSOR_C_GET])
+m4trace:configure.ac:3006: -1- m4_pattern_allow([^HAVE_DB_CURSOR_C_GET$])
+m4trace:configure.ac:3021: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:3021: the top level])
+m4trace:configure.ac:3021: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RAND])
+m4trace:configure.ac:3021: -1- m4_pattern_allow([^HAVE_RAND$])
+m4trace:configure.ac:3021: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SRAND])
+m4trace:configure.ac:3021: -1- m4_pattern_allow([^HAVE_SRAND$])
+m4trace:configure.ac:3035: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:3035: the top level])
+m4trace:configure.ac:3035: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INITSTATE])
+m4trace:configure.ac:3035: -1- m4_pattern_allow([^HAVE_INITSTATE$])
+m4trace:configure.ac:3035: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSTATE])
+m4trace:configure.ac:3035: -1- m4_pattern_allow([^HAVE_SETSTATE$])
+m4trace:configure.ac:3035: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RANDOM])
+m4trace:configure.ac:3035: -1- m4_pattern_allow([^HAVE_RANDOM$])
+m4trace:configure.ac:3053: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:3053: the top level])
+m4trace:configure.ac:3053: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LRAND48])
+m4trace:configure.ac:3053: -1- m4_pattern_allow([^HAVE_LRAND48$])
+m4trace:configure.ac:3053: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NRAND48])
+m4trace:configure.ac:3053: -1- m4_pattern_allow([^HAVE_NRAND48$])
+m4trace:configure.ac:3076: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:3076: the top level])
+m4trace:configure.ac:3084: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RAND_EGD])
+m4trace:configure.ac:3084: -1- m4_pattern_allow([^HAVE_RAND_EGD$])
+m4trace:configure.ac:3092: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_URANDOM])
+m4trace:configure.ac:3092: -1- m4_pattern_allow([^HAVE_DEV_URANDOM$])
+m4trace:configure.ac:3096: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_URANDOM])
+m4trace:configure.ac:3096: -1- m4_pattern_allow([^HAVE_DEV_URANDOM$])
+m4trace:configure.ac:3100: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_RANDOM])
+m4trace:configure.ac:3100: -1- m4_pattern_allow([^HAVE_DEV_RANDOM$])
+m4trace:configure.ac:3104: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_RANDOM])
+m4trace:configure.ac:3104: -1- m4_pattern_allow([^HAVE_DEV_RANDOM$])
+m4trace:configure.ac:3111: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2775: AC_TRY_RUN is expanded from...
+configure.ac:3111: the top level])
+m4trace:configure.ac:3111: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PROC_PID_EXE])
+m4trace:configure.ac:3111: -1- m4_pattern_allow([^HAVE_PROC_PID_EXE$])
+m4trace:configure.ac:3165: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2625: AC_TRY_COMPILE is expanded from...
+configure.ac:3165: the top level])
+m4trace:configure.ac:3165: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNETSNMP])
+m4trace:configure.ac:3165: -1- m4_pattern_allow([^HAVE_LIBNETSNMP$])
+m4trace:configure.ac:3175: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNMP_ENABLE_FILELOG])
+m4trace:configure.ac:3175: -1- m4_pattern_allow([^HAVE_SNMP_ENABLE_FILELOG$])
+m4trace:configure.ac:3176: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNMP_DISABLE_SYSLOG])
+m4trace:configure.ac:3176: -1- m4_pattern_allow([^HAVE_SNMP_DISABLE_SYSLOG$])
+m4trace:configure.ac:3177: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNMP_DISABLE_STDERRLOG])
+m4trace:configure.ac:3177: -1- m4_pattern_allow([^HAVE_SNMP_DISABLE_STDERRLOG$])
+m4trace:configure.ac:3178: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNMP_DISABLE_FILELOG])
+m4trace:configure.ac:3178: -1- m4_pattern_allow([^HAVE_SNMP_DISABLE_FILELOG$])
+m4trace:configure.ac:4206: -1- AC_SUBST([DEFS])
+m4trace:configure.ac:4206: -1- AC_SUBST_TRACE([DEFS])
+m4trace:configure.ac:4206: -1- m4_pattern_allow([^DEFS$])
+m4trace:configure.ac:4207: -1- AC_SUBST([CC])
+m4trace:configure.ac:4207: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.ac:4207: -1- m4_pattern_allow([^CC$])
+m4trace:configure.ac:4208: -1- AC_SUBST([CPP])
+m4trace:configure.ac:4208: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.ac:4208: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:4209: -1- AC_SUBST([CXX])
+m4trace:configure.ac:4209: -1- AC_SUBST_TRACE([CXX])
+m4trace:configure.ac:4209: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:4210: -1- AC_SUBST([WINDRES])
+m4trace:configure.ac:4210: -1- AC_SUBST_TRACE([WINDRES])
+m4trace:configure.ac:4210: -1- m4_pattern_allow([^WINDRES$])
+m4trace:configure.ac:4211: -1- AC_SUBST([RCFLAGS])
+m4trace:configure.ac:4211: -1- AC_SUBST_TRACE([RCFLAGS])
+m4trace:configure.ac:4211: -1- m4_pattern_allow([^RCFLAGS$])
+m4trace:configure.ac:4212: -1- AC_SUBST([MKDIR_P])
+m4trace:configure.ac:4212: -1- AC_SUBST_TRACE([MKDIR_P])
+m4trace:configure.ac:4212: -1- m4_pattern_allow([^MKDIR_P$])
+m4trace:configure.ac:4213: -1- AC_SUBST([SED])
+m4trace:configure.ac:4213: -1- AC_SUBST_TRACE([SED])
+m4trace:configure.ac:4213: -1- m4_pattern_allow([^SED$])
+m4trace:configure.ac:4214: -1- AC_SUBST([INSTALL])
+m4trace:configure.ac:4214: -1- AC_SUBST_TRACE([INSTALL])
+m4trace:configure.ac:4214: -1- m4_pattern_allow([^INSTALL$])
+m4trace:configure.ac:4215: -1- AC_SUBST([LN_S])
+m4trace:configure.ac:4215: -1- AC_SUBST_TRACE([LN_S])
+m4trace:configure.ac:4215: -1- m4_pattern_allow([^LN_S$])
+m4trace:configure.ac:4216: -1- AC_SUBST([RANLIB])
+m4trace:configure.ac:4216: -1- AC_SUBST_TRACE([RANLIB])
+m4trace:configure.ac:4216: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.ac:4217: -1- AC_SUBST([AR])
+m4trace:configure.ac:4217: -1- AC_SUBST_TRACE([AR])
+m4trace:configure.ac:4217: -1- m4_pattern_allow([^AR$])
+m4trace:configure.ac:4218: -1- AC_SUBST([NM])
+m4trace:configure.ac:4218: -1- AC_SUBST_TRACE([NM])
+m4trace:configure.ac:4218: -1- m4_pattern_allow([^NM$])
+m4trace:configure.ac:4219: -1- AC_SUBST([MAKE])
+m4trace:configure.ac:4219: -1- AC_SUBST_TRACE([MAKE])
+m4trace:configure.ac:4219: -1- m4_pattern_allow([^MAKE$])
+m4trace:configure.ac:4220: -1- AC_SUBST([DELTARGET])
+m4trace:configure.ac:4220: -1- AC_SUBST_TRACE([DELTARGET])
+m4trace:configure.ac:4220: -1- m4_pattern_allow([^DELTARGET$])
+m4trace:configure.ac:4221: -1- AC_SUBST([DELTARGETSO])
+m4trace:configure.ac:4221: -1- AC_SUBST_TRACE([DELTARGETSO])
+m4trace:configure.ac:4221: -1- m4_pattern_allow([^DELTARGETSO$])
+m4trace:configure.ac:4222: -1- AC_SUBST([MKSOLIB])
+m4trace:configure.ac:4222: -1- AC_SUBST_TRACE([MKSOLIB])
+m4trace:configure.ac:4222: -1- m4_pattern_allow([^MKSOLIB$])
+m4trace:configure.ac:4223: -1- AC_SUBST([MKSOLIBCPP])
+m4trace:configure.ac:4223: -1- AC_SUBST_TRACE([MKSOLIBCPP])
+m4trace:configure.ac:4223: -1- m4_pattern_allow([^MKSOLIBCPP$])
+m4trace:configure.ac:4224: -1- AC_SUBST([RPATH])
+m4trace:configure.ac:4224: -1- AC_SUBST_TRACE([RPATH])
+m4trace:configure.ac:4224: -1- m4_pattern_allow([^RPATH$])
+m4trace:configure.ac:4225: -1- AC_SUBST([RPATHLINK])
+m4trace:configure.ac:4225: -1- AC_SUBST_TRACE([RPATHLINK])
+m4trace:configure.ac:4225: -1- m4_pattern_allow([^RPATHLINK$])
+m4trace:configure.ac:4226: -1- AC_SUBST([MKSORPATH])
+m4trace:configure.ac:4226: -1- AC_SUBST_TRACE([MKSORPATH])
+m4trace:configure.ac:4226: -1- m4_pattern_allow([^MKSORPATH$])
+m4trace:configure.ac:4227: -1- AC_SUBST([MKSORPATHLINK])
+m4trace:configure.ac:4227: -1- AC_SUBST_TRACE([MKSORPATHLINK])
+m4trace:configure.ac:4227: -1- m4_pattern_allow([^MKSORPATHLINK$])
+m4trace:configure.ac:4228: -1- AC_SUBST([MKSOCHECKSYMBOLS])
+m4trace:configure.ac:4228: -1- AC_SUBST_TRACE([MKSOCHECKSYMBOLS])
+m4trace:configure.ac:4228: -1- m4_pattern_allow([^MKSOCHECKSYMBOLS$])
+m4trace:configure.ac:4232: -1- AC_SUBST([CFL_CLI_C8])
+m4trace:configure.ac:4232: -1- AC_SUBST_TRACE([CFL_CLI_C8])
+m4trace:configure.ac:4232: -1- m4_pattern_allow([^CFL_CLI_C8$])
+m4trace:configure.ac:4233: -1- AC_SUBST([CFL_CLI_DK])
+m4trace:configure.ac:4233: -1- AC_SUBST_TRACE([CFL_CLI_DK])
+m4trace:configure.ac:4233: -1- m4_pattern_allow([^CFL_CLI_DK$])
+m4trace:configure.ac:4234: -1- AC_SUBST([CXXFL_CLI_C8])
+m4trace:configure.ac:4234: -1- AC_SUBST_TRACE([CXXFL_CLI_C8])
+m4trace:configure.ac:4234: -1- m4_pattern_allow([^CXXFL_CLI_C8$])
+m4trace:configure.ac:4235: -1- AC_SUBST([CXXFL_CLI_DK])
+m4trace:configure.ac:4235: -1- AC_SUBST_TRACE([CXXFL_CLI_DK])
+m4trace:configure.ac:4235: -1- m4_pattern_allow([^CXXFL_CLI_DK$])
+m4trace:configure.ac:4236: -1- AC_SUBST([CXXFL_CLI_WX])
+m4trace:configure.ac:4236: -1- AC_SUBST_TRACE([CXXFL_CLI_WX])
+m4trace:configure.ac:4236: -1- m4_pattern_allow([^CXXFL_CLI_WX$])
+m4trace:configure.ac:4237: -1- AC_SUBST([CXXFL_GUI])
+m4trace:configure.ac:4237: -1- AC_SUBST_TRACE([CXXFL_GUI])
+m4trace:configure.ac:4237: -1- m4_pattern_allow([^CXXFL_GUI$])
+m4trace:configure.ac:4238: -1- AC_SUBST([LDFLC_CLI_C8])
+m4trace:configure.ac:4238: -1- AC_SUBST_TRACE([LDFLC_CLI_C8])
+m4trace:configure.ac:4238: -1- m4_pattern_allow([^LDFLC_CLI_C8$])
+m4trace:configure.ac:4239: -1- AC_SUBST([LDFLC_CLI_DK])
+m4trace:configure.ac:4239: -1- AC_SUBST_TRACE([LDFLC_CLI_DK])
+m4trace:configure.ac:4239: -1- m4_pattern_allow([^LDFLC_CLI_DK$])
+m4trace:configure.ac:4240: -1- AC_SUBST([LDFLCXX_CLI_C8])
+m4trace:configure.ac:4240: -1- AC_SUBST_TRACE([LDFLCXX_CLI_C8])
+m4trace:configure.ac:4240: -1- m4_pattern_allow([^LDFLCXX_CLI_C8$])
+m4trace:configure.ac:4241: -1- AC_SUBST([LDFLCXX_CLI_DK])
+m4trace:configure.ac:4241: -1- AC_SUBST_TRACE([LDFLCXX_CLI_DK])
+m4trace:configure.ac:4241: -1- m4_pattern_allow([^LDFLCXX_CLI_DK$])
+m4trace:configure.ac:4242: -1- AC_SUBST([LDFLCXX_CLI_WX])
+m4trace:configure.ac:4242: -1- AC_SUBST_TRACE([LDFLCXX_CLI_WX])
+m4trace:configure.ac:4242: -1- m4_pattern_allow([^LDFLCXX_CLI_WX$])
+m4trace:configure.ac:4243: -1- AC_SUBST([LDFLCXX_GUI])
+m4trace:configure.ac:4243: -1- AC_SUBST_TRACE([LDFLCXX_GUI])
+m4trace:configure.ac:4243: -1- m4_pattern_allow([^LDFLCXX_GUI$])
+m4trace:configure.ac:4247: -1- AC_SUBST([BUILDHOST])
+m4trace:configure.ac:4247: -1- AC_SUBST_TRACE([BUILDHOST])
+m4trace:configure.ac:4247: -1- m4_pattern_allow([^BUILDHOST$])
+m4trace:configure.ac:4248: -1- AC_SUBST([TARGETHOST])
+m4trace:configure.ac:4248: -1- AC_SUBST_TRACE([TARGETHOST])
+m4trace:configure.ac:4248: -1- m4_pattern_allow([^TARGETHOST$])
+m4trace:configure.ac:4249: -1- AC_SUBST([BUILDCLASS])
+m4trace:configure.ac:4249: -1- AC_SUBST_TRACE([BUILDCLASS])
+m4trace:configure.ac:4249: -1- m4_pattern_allow([^BUILDCLASS$])
+m4trace:configure.ac:4250: -1- AC_SUBST([TARGETCLASS])
+m4trace:configure.ac:4250: -1- AC_SUBST_TRACE([TARGETCLASS])
+m4trace:configure.ac:4250: -1- m4_pattern_allow([^TARGETCLASS$])
+m4trace:configure.ac:4251: -1- AC_SUBST([CROSSBUILD])
+m4trace:configure.ac:4251: -1- AC_SUBST_TRACE([CROSSBUILD])
+m4trace:configure.ac:4251: -1- m4_pattern_allow([^CROSSBUILD$])
+m4trace:configure.ac:4252: -1- AC_SUBST([UNAME])
+m4trace:configure.ac:4252: -1- AC_SUBST_TRACE([UNAME])
+m4trace:configure.ac:4252: -1- m4_pattern_allow([^UNAME$])
+m4trace:configure.ac:4253: -1- AC_SUBST([TOOLCHAIN])
+m4trace:configure.ac:4253: -1- AC_SUBST_TRACE([TOOLCHAIN])
+m4trace:configure.ac:4253: -1- m4_pattern_allow([^TOOLCHAIN$])
+m4trace:configure.ac:4257: -1- AC_SUBST([VERSNO])
+m4trace:configure.ac:4257: -1- AC_SUBST_TRACE([VERSNO])
+m4trace:configure.ac:4257: -1- m4_pattern_allow([^VERSNO$])
+m4trace:configure.ac:4258: -1- AC_SUBST([SOVERS])
+m4trace:configure.ac:4258: -1- AC_SUBST_TRACE([SOVERS])
+m4trace:configure.ac:4258: -1- m4_pattern_allow([^SOVERS$])
+m4trace:configure.ac:4262: -1- AC_SUBST([LIB_SHARED_RES_NET])
+m4trace:configure.ac:4262: -1- AC_SUBST_TRACE([LIB_SHARED_RES_NET])
+m4trace:configure.ac:4262: -1- m4_pattern_allow([^LIB_SHARED_RES_NET$])
+m4trace:configure.ac:4263: -1- AC_SUBST([PRG_RES_NET])
+m4trace:configure.ac:4263: -1- AC_SUBST_TRACE([PRG_RES_NET])
+m4trace:configure.ac:4263: -1- m4_pattern_allow([^PRG_RES_NET$])
+m4trace:configure.ac:4264: -1- AC_SUBST([MAN_RES_NET])
+m4trace:configure.ac:4264: -1- AC_SUBST_TRACE([MAN_RES_NET])
+m4trace:configure.ac:4264: -1- m4_pattern_allow([^MAN_RES_NET$])
+m4trace:configure.ac:4265: -1- AC_SUBST([RES_RES_NET])
+m4trace:configure.ac:4265: -1- AC_SUBST_TRACE([RES_RES_NET])
+m4trace:configure.ac:4265: -1- m4_pattern_allow([^RES_RES_NET$])
+m4trace:configure.ac:4266: -1- AC_SUBST([RES_RES_NET_EN])
+m4trace:configure.ac:4266: -1- AC_SUBST_TRACE([RES_RES_NET_EN])
+m4trace:configure.ac:4266: -1- m4_pattern_allow([^RES_RES_NET_EN$])
+m4trace:configure.ac:4267: -1- AC_SUBST([RES_RES_NET_DE])
+m4trace:configure.ac:4267: -1- AC_SUBST_TRACE([RES_RES_NET_DE])
+m4trace:configure.ac:4267: -1- m4_pattern_allow([^RES_RES_NET_DE$])
+m4trace:configure.ac:4268: -1- AC_SUBST([PRG_CLI_NET])
+m4trace:configure.ac:4268: -1- AC_SUBST_TRACE([PRG_CLI_NET])
+m4trace:configure.ac:4268: -1- m4_pattern_allow([^PRG_CLI_NET$])
+m4trace:configure.ac:4269: -1- AC_SUBST([MAN_CLI_NET])
+m4trace:configure.ac:4269: -1- AC_SUBST_TRACE([MAN_CLI_NET])
+m4trace:configure.ac:4269: -1- m4_pattern_allow([^MAN_CLI_NET$])
+m4trace:configure.ac:4270: -1- AC_SUBST([RES_CLI_NET])
+m4trace:configure.ac:4270: -1- AC_SUBST_TRACE([RES_CLI_NET])
+m4trace:configure.ac:4270: -1- m4_pattern_allow([^RES_CLI_NET$])
+m4trace:configure.ac:4271: -1- AC_SUBST([PRG_GUI_NET])
+m4trace:configure.ac:4271: -1- AC_SUBST_TRACE([PRG_GUI_NET])
+m4trace:configure.ac:4271: -1- m4_pattern_allow([^PRG_GUI_NET$])
+m4trace:configure.ac:4272: -1- AC_SUBST([MAN_GUI_NET])
+m4trace:configure.ac:4272: -1- AC_SUBST_TRACE([MAN_GUI_NET])
+m4trace:configure.ac:4272: -1- m4_pattern_allow([^MAN_GUI_NET$])
+m4trace:configure.ac:4273: -1- AC_SUBST([RES_GUI_NET])
+m4trace:configure.ac:4273: -1- AC_SUBST_TRACE([RES_GUI_NET])
+m4trace:configure.ac:4273: -1- m4_pattern_allow([^RES_GUI_NET$])
+m4trace:configure.ac:4274: -1- AC_SUBST([PRG_CLI_NET_POSIX])
+m4trace:configure.ac:4274: -1- AC_SUBST_TRACE([PRG_CLI_NET_POSIX])
+m4trace:configure.ac:4274: -1- m4_pattern_allow([^PRG_CLI_NET_POSIX$])
+m4trace:configure.ac:4275: -1- AC_SUBST([MAN_CLI_NET_POSIX])
+m4trace:configure.ac:4275: -1- AC_SUBST_TRACE([MAN_CLI_NET_POSIX])
+m4trace:configure.ac:4275: -1- m4_pattern_allow([^MAN_CLI_NET_POSIX$])
+m4trace:configure.ac:4276: -1- AC_SUBST([RES_CLI_NET_POSIX])
+m4trace:configure.ac:4276: -1- AC_SUBST_TRACE([RES_CLI_NET_POSIX])
+m4trace:configure.ac:4276: -1- m4_pattern_allow([^RES_CLI_NET_POSIX$])
+m4trace:configure.ac:4277: -1- AC_SUBST([PRG_CLI_SNMP])
+m4trace:configure.ac:4277: -1- AC_SUBST_TRACE([PRG_CLI_SNMP])
+m4trace:configure.ac:4277: -1- m4_pattern_allow([^PRG_CLI_SNMP$])
+m4trace:configure.ac:4278: -1- AC_SUBST([MAN_CLI_SNMP])
+m4trace:configure.ac:4278: -1- AC_SUBST_TRACE([MAN_CLI_SNMP])
+m4trace:configure.ac:4278: -1- m4_pattern_allow([^MAN_CLI_SNMP$])
+m4trace:configure.ac:4279: -1- AC_SUBST([RES_CLI_SNMP])
+m4trace:configure.ac:4279: -1- AC_SUBST_TRACE([RES_CLI_SNMP])
+m4trace:configure.ac:4279: -1- m4_pattern_allow([^RES_CLI_SNMP$])
+m4trace:configure.ac:4280: -1- AC_SUBST([PRG_CLI_MYSQL])
+m4trace:configure.ac:4280: -1- AC_SUBST_TRACE([PRG_CLI_MYSQL])
+m4trace:configure.ac:4280: -1- m4_pattern_allow([^PRG_CLI_MYSQL$])
+m4trace:configure.ac:4281: -1- AC_SUBST([MAN_CLI_MYSQL])
+m4trace:configure.ac:4281: -1- AC_SUBST_TRACE([MAN_CLI_MYSQL])
+m4trace:configure.ac:4281: -1- m4_pattern_allow([^MAN_CLI_MYSQL$])
+m4trace:configure.ac:4282: -1- AC_SUBST([RES_CLI_MYSQL])
+m4trace:configure.ac:4282: -1- AC_SUBST_TRACE([RES_CLI_MYSQL])
+m4trace:configure.ac:4282: -1- m4_pattern_allow([^RES_CLI_MYSQL$])
+m4trace:configure.ac:4283: -1- AC_SUBST([PRG_CLI_SSL])
+m4trace:configure.ac:4283: -1- AC_SUBST_TRACE([PRG_CLI_SSL])
+m4trace:configure.ac:4283: -1- m4_pattern_allow([^PRG_CLI_SSL$])
+m4trace:configure.ac:4284: -1- AC_SUBST([MAN_CLI_SSL])
+m4trace:configure.ac:4284: -1- AC_SUBST_TRACE([MAN_CLI_SSL])
+m4trace:configure.ac:4284: -1- m4_pattern_allow([^MAN_CLI_SSL$])
+m4trace:configure.ac:4285: -1- AC_SUBST([RES_CLI_SSL])
+m4trace:configure.ac:4285: -1- AC_SUBST_TRACE([RES_CLI_SSL])
+m4trace:configure.ac:4285: -1- m4_pattern_allow([^RES_CLI_SSL$])
+m4trace:configure.ac:4286: -1- AC_SUBST([PRG_GUI_SSL])
+m4trace:configure.ac:4286: -1- AC_SUBST_TRACE([PRG_GUI_SSL])
+m4trace:configure.ac:4286: -1- m4_pattern_allow([^PRG_GUI_SSL$])
+m4trace:configure.ac:4287: -1- AC_SUBST([MAN_GUI_SSL])
+m4trace:configure.ac:4287: -1- AC_SUBST_TRACE([MAN_GUI_SSL])
+m4trace:configure.ac:4287: -1- m4_pattern_allow([^MAN_GUI_SSL$])
+m4trace:configure.ac:4288: -1- AC_SUBST([RES_GUI_SSL])
+m4trace:configure.ac:4288: -1- AC_SUBST_TRACE([RES_GUI_SSL])
+m4trace:configure.ac:4288: -1- m4_pattern_allow([^RES_GUI_SSL$])
+m4trace:configure.ac:4289: -1- AC_SUBST([PRG_CLI_POSIX])
+m4trace:configure.ac:4289: -1- AC_SUBST_TRACE([PRG_CLI_POSIX])
+m4trace:configure.ac:4289: -1- m4_pattern_allow([^PRG_CLI_POSIX$])
+m4trace:configure.ac:4290: -1- AC_SUBST([MAN_CLI_POSIX])
+m4trace:configure.ac:4290: -1- AC_SUBST_TRACE([MAN_CLI_POSIX])
+m4trace:configure.ac:4290: -1- m4_pattern_allow([^MAN_CLI_POSIX$])
+m4trace:configure.ac:4291: -1- AC_SUBST([RES_CLI_POSIX])
+m4trace:configure.ac:4291: -1- AC_SUBST_TRACE([RES_CLI_POSIX])
+m4trace:configure.ac:4291: -1- m4_pattern_allow([^RES_CLI_POSIX$])
+m4trace:configure.ac:4292: -1- AC_SUBST([PRG_CLI_WINDOWS])
+m4trace:configure.ac:4292: -1- AC_SUBST_TRACE([PRG_CLI_WINDOWS])
+m4trace:configure.ac:4292: -1- m4_pattern_allow([^PRG_CLI_WINDOWS$])
+m4trace:configure.ac:4293: -1- AC_SUBST([MAN_CLI_WINDOWS])
+m4trace:configure.ac:4293: -1- AC_SUBST_TRACE([MAN_CLI_WINDOWS])
+m4trace:configure.ac:4293: -1- m4_pattern_allow([^MAN_CLI_WINDOWS$])
+m4trace:configure.ac:4294: -1- AC_SUBST([RES_CLI_WINDOWS])
+m4trace:configure.ac:4294: -1- AC_SUBST_TRACE([RES_CLI_WINDOWS])
+m4trace:configure.ac:4294: -1- m4_pattern_allow([^RES_CLI_WINDOWS$])
+m4trace:configure.ac:4295: -1- AC_SUBST([PRG_GUI_WINDOWS])
+m4trace:configure.ac:4295: -1- AC_SUBST_TRACE([PRG_GUI_WINDOWS])
+m4trace:configure.ac:4295: -1- m4_pattern_allow([^PRG_GUI_WINDOWS$])
+m4trace:configure.ac:4296: -1- AC_SUBST([MAN_GUI_WINDOWS])
+m4trace:configure.ac:4296: -1- AC_SUBST_TRACE([MAN_GUI_WINDOWS])
+m4trace:configure.ac:4296: -1- m4_pattern_allow([^MAN_GUI_WINDOWS$])
+m4trace:configure.ac:4297: -1- AC_SUBST([RES_GUI_WINDOWS])
+m4trace:configure.ac:4297: -1- AC_SUBST_TRACE([RES_GUI_WINDOWS])
+m4trace:configure.ac:4297: -1- m4_pattern_allow([^RES_GUI_WINDOWS$])
+m4trace:configure.ac:4298: -1- AC_SUBST([BUILD_ARCH])
+m4trace:configure.ac:4298: -1- AC_SUBST_TRACE([BUILD_ARCH])
+m4trace:configure.ac:4298: -1- m4_pattern_allow([^BUILD_ARCH$])
+m4trace:configure.ac:4299: -1- AC_SUBST([INSTALL_PROGRAMS])
+m4trace:configure.ac:4299: -1- AC_SUBST_TRACE([INSTALL_PROGRAMS])
+m4trace:configure.ac:4299: -1- m4_pattern_allow([^INSTALL_PROGRAMS$])
+m4trace:configure.ac:4300: -1- AC_SUBST([INSTALL_LIBS])
+m4trace:configure.ac:4300: -1- AC_SUBST_TRACE([INSTALL_LIBS])
+m4trace:configure.ac:4300: -1- m4_pattern_allow([^INSTALL_LIBS$])
+m4trace:configure.ac:4301: -1- AC_SUBST([INSTALL_INDEP])
+m4trace:configure.ac:4301: -1- AC_SUBST_TRACE([INSTALL_INDEP])
+m4trace:configure.ac:4301: -1- m4_pattern_allow([^INSTALL_INDEP$])
+m4trace:configure.ac:4302: -1- AC_SUBST([FOUND_SYSTEMD])
+m4trace:configure.ac:4302: -1- AC_SUBST_TRACE([FOUND_SYSTEMD])
+m4trace:configure.ac:4302: -1- m4_pattern_allow([^FOUND_SYSTEMD$])
+m4trace:configure.ac:4306: -1- AC_SUBST([EXEEXT])
+m4trace:configure.ac:4306: -1- AC_SUBST_TRACE([EXEEXT])
+m4trace:configure.ac:4306: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.ac:4307: -1- AC_SUBST([OBJEXT])
+m4trace:configure.ac:4307: -1- AC_SUBST_TRACE([OBJEXT])
+m4trace:configure.ac:4307: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.ac:4308: -1- AC_SUBST([RCEXT])
+m4trace:configure.ac:4308: -1- AC_SUBST_TRACE([RCEXT])
+m4trace:configure.ac:4308: -1- m4_pattern_allow([^RCEXT$])
+m4trace:configure.ac:4309: -1- AC_SUBST([RESEXT])
+m4trace:configure.ac:4309: -1- AC_SUBST_TRACE([RESEXT])
+m4trace:configure.ac:4309: -1- m4_pattern_allow([^RESEXT$])
+m4trace:configure.ac:4310: -1- AC_SUBST([RESCRULE])
+m4trace:configure.ac:4310: -1- AC_SUBST_TRACE([RESCRULE])
+m4trace:configure.ac:4310: -1- m4_pattern_allow([^RESCRULE$])
+m4trace:configure.ac:4314: -1- AC_SUBST([rundir])
+m4trace:configure.ac:4314: -1- AC_SUBST_TRACE([rundir])
+m4trace:configure.ac:4314: -1- m4_pattern_allow([^rundir$])
+m4trace:configure.ac:4318: -1- AC_SUBST([ZLIB])
+m4trace:configure.ac:4318: -1- AC_SUBST_TRACE([ZLIB])
+m4trace:configure.ac:4318: -1- m4_pattern_allow([^ZLIB$])
+m4trace:configure.ac:4319: -1- AC_SUBST([BZLIB])
+m4trace:configure.ac:4319: -1- AC_SUBST_TRACE([BZLIB])
+m4trace:configure.ac:4319: -1- m4_pattern_allow([^BZLIB$])
+m4trace:configure.ac:4320: -1- AC_SUBST([LIBPNG])
+m4trace:configure.ac:4320: -1- AC_SUBST_TRACE([LIBPNG])
+m4trace:configure.ac:4320: -1- m4_pattern_allow([^LIBPNG$])
+m4trace:configure.ac:4321: -1- AC_SUBST([LIBJPEG])
+m4trace:configure.ac:4321: -1- AC_SUBST_TRACE([LIBJPEG])
+m4trace:configure.ac:4321: -1- m4_pattern_allow([^LIBJPEG$])
+m4trace:configure.ac:4322: -1- AC_SUBST([LIBTIFF])
+m4trace:configure.ac:4322: -1- AC_SUBST_TRACE([LIBTIFF])
+m4trace:configure.ac:4322: -1- m4_pattern_allow([^LIBTIFF$])
+m4trace:configure.ac:4323: -1- AC_SUBST([CRYPTO])
+m4trace:configure.ac:4323: -1- AC_SUBST_TRACE([CRYPTO])
+m4trace:configure.ac:4323: -1- m4_pattern_allow([^CRYPTO$])
+m4trace:configure.ac:4324: -1- AC_SUBST([FS64])
+m4trace:configure.ac:4324: -1- AC_SUBST_TRACE([FS64])
+m4trace:configure.ac:4324: -1- m4_pattern_allow([^FS64$])
+m4trace:configure.ac:4325: -1- AC_SUBST([SOCKLIB])
+m4trace:configure.ac:4325: -1- AC_SUBST_TRACE([SOCKLIB])
+m4trace:configure.ac:4325: -1- m4_pattern_allow([^SOCKLIB$])
+m4trace:configure.ac:4326: -1- AC_SUBST([NSLLIB])
+m4trace:configure.ac:4326: -1- AC_SUBST_TRACE([NSLLIB])
+m4trace:configure.ac:4326: -1- m4_pattern_allow([^NSLLIB$])
+m4trace:configure.ac:4327: -1- AC_SUBST([RTLIB])
+m4trace:configure.ac:4327: -1- AC_SUBST_TRACE([RTLIB])
+m4trace:configure.ac:4327: -1- m4_pattern_allow([^RTLIB$])
+m4trace:configure.ac:4328: -1- AC_SUBST([PTHREADLIB])
+m4trace:configure.ac:4328: -1- AC_SUBST_TRACE([PTHREADLIB])
+m4trace:configure.ac:4328: -1- m4_pattern_allow([^PTHREADLIB$])
+m4trace:configure.ac:4329: -1- AC_SUBST([DBLIB])
+m4trace:configure.ac:4329: -1- AC_SUBST_TRACE([DBLIB])
+m4trace:configure.ac:4329: -1- m4_pattern_allow([^DBLIB$])
+m4trace:configure.ac:4330: -1- AC_SUBST([DBLIBSOCK])
+m4trace:configure.ac:4330: -1- AC_SUBST_TRACE([DBLIBSOCK])
+m4trace:configure.ac:4330: -1- m4_pattern_allow([^DBLIBSOCK$])
+m4trace:configure.ac:4331: -1- AC_SUBST([MYSQLLIB])
+m4trace:configure.ac:4331: -1- AC_SUBST_TRACE([MYSQLLIB])
+m4trace:configure.ac:4331: -1- m4_pattern_allow([^MYSQLLIB$])
+m4trace:configure.ac:4332: -1- AC_SUBST([MYSQLLDFLAGS])
+m4trace:configure.ac:4332: -1- AC_SUBST_TRACE([MYSQLLDFLAGS])
+m4trace:configure.ac:4332: -1- m4_pattern_allow([^MYSQLLDFLAGS$])
+m4trace:configure.ac:4333: -1- AC_SUBST([NETSNMP_LIBS])
+m4trace:configure.ac:4333: -1- AC_SUBST_TRACE([NETSNMP_LIBS])
+m4trace:configure.ac:4333: -1- m4_pattern_allow([^NETSNMP_LIBS$])
+m4trace:configure.ac:4334: -1- AC_SUBST([NETSNMP_CFLAGS])
+m4trace:configure.ac:4334: -1- AC_SUBST_TRACE([NETSNMP_CFLAGS])
+m4trace:configure.ac:4334: -1- m4_pattern_allow([^NETSNMP_CFLAGS$])
+m4trace:configure.ac:4335: -1- AC_SUBST([WINCLILIB])
+m4trace:configure.ac:4335: -1- AC_SUBST_TRACE([WINCLILIB])
+m4trace:configure.ac:4335: -1- m4_pattern_allow([^WINCLILIB$])
+m4trace:configure.ac:4336: -1- AC_SUBST([WINGUILIB])
+m4trace:configure.ac:4336: -1- AC_SUBST_TRACE([WINGUILIB])
+m4trace:configure.ac:4336: -1- m4_pattern_allow([^WINGUILIB$])
+m4trace:configure.ac:4337: -1- AC_SUBST([CLILIB])
+m4trace:configure.ac:4337: -1- AC_SUBST_TRACE([CLILIB])
+m4trace:configure.ac:4337: -1- m4_pattern_allow([^CLILIB$])
+m4trace:configure.ac:4338: -1- AC_SUBST([GUILIB])
+m4trace:configure.ac:4338: -1- AC_SUBST_TRACE([GUILIB])
+m4trace:configure.ac:4338: -1- m4_pattern_allow([^GUILIB$])
+m4trace:configure.ac:4342: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:4342: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:4342: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:4343: -1- AC_SUBST([CFLAGS])
+m4trace:configure.ac:4343: -1- AC_SUBST_TRACE([CFLAGS])
+m4trace:configure.ac:4343: -1- m4_pattern_allow([^CFLAGS$])
+m4trace:configure.ac:4344: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.ac:4344: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.ac:4344: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:4345: -1- AC_SUBST([WXCPPFLAGS])
+m4trace:configure.ac:4345: -1- AC_SUBST_TRACE([WXCPPFLAGS])
+m4trace:configure.ac:4345: -1- m4_pattern_allow([^WXCPPFLAGS$])
+m4trace:configure.ac:4346: -1- AC_SUBST([WXCFLAGS])
+m4trace:configure.ac:4346: -1- AC_SUBST_TRACE([WXCFLAGS])
+m4trace:configure.ac:4346: -1- m4_pattern_allow([^WXCFLAGS$])
+m4trace:configure.ac:4347: -1- AC_SUBST([WXCXXFLAGS])
+m4trace:configure.ac:4347: -1- AC_SUBST_TRACE([WXCXXFLAGS])
+m4trace:configure.ac:4347: -1- m4_pattern_allow([^WXCXXFLAGS$])
+m4trace:configure.ac:4348: -1- AC_SUBST([WXLDFLAGS])
+m4trace:configure.ac:4348: -1- AC_SUBST_TRACE([WXLDFLAGS])
+m4trace:configure.ac:4348: -1- m4_pattern_allow([^WXLDFLAGS$])
+m4trace:configure.ac:4349: -1- AC_SUBST([WXVERSION])
+m4trace:configure.ac:4349: -1- AC_SUBST_TRACE([WXVERSION])
+m4trace:configure.ac:4349: -1- m4_pattern_allow([^WXVERSION$])
+m4trace:configure.ac:4350: -1- AC_SUBST([MOD_DK3WREG])
+m4trace:configure.ac:4350: -1- AC_SUBST_TRACE([MOD_DK3WREG])
+m4trace:configure.ac:4350: -1- m4_pattern_allow([^MOD_DK3WREG$])
+m4trace:configure.ac:4351: -1- AC_SUBST([MOD_DK4DMT])
+m4trace:configure.ac:4351: -1- AC_SUBST_TRACE([MOD_DK4DMT])
+m4trace:configure.ac:4351: -1- m4_pattern_allow([^MOD_DK4DMT$])
+m4trace:configure.ac:4352: -1- AC_SUBST([LIBDK3WXOBJ])
+m4trace:configure.ac:4352: -1- AC_SUBST_TRACE([LIBDK3WXOBJ])
+m4trace:configure.ac:4352: -1- m4_pattern_allow([^LIBDK3WXOBJ$])
+m4trace:configure.ac:4353: -1- AC_SUBST([LIBDK4WXOBJ])
+m4trace:configure.ac:4353: -1- AC_SUBST_TRACE([LIBDK4WXOBJ])
+m4trace:configure.ac:4353: -1- m4_pattern_allow([^LIBDK4WXOBJ$])
+m4trace:configure.ac:4354: -1- AC_SUBST([LPRNGUSER])
+m4trace:configure.ac:4354: -1- AC_SUBST_TRACE([LPRNGUSER])
+m4trace:configure.ac:4354: -1- m4_pattern_allow([^LPRNGUSER$])
+m4trace:configure.ac:4355: -1- AC_SUBST([LPRNGGROUP])
+m4trace:configure.ac:4355: -1- AC_SUBST_TRACE([LPRNGGROUP])
+m4trace:configure.ac:4355: -1- m4_pattern_allow([^LPRNGGROUP$])
+m4trace:configure.ac:4359: -1- AC_SUBST([SOLIBZ])
+m4trace:configure.ac:4359: -1- AC_SUBST_TRACE([SOLIBZ])
+m4trace:configure.ac:4359: -1- m4_pattern_allow([^SOLIBZ$])
+m4trace:configure.ac:4360: -1- AC_SUBST([SOLIBBZ])
+m4trace:configure.ac:4360: -1- AC_SUBST_TRACE([SOLIBBZ])
+m4trace:configure.ac:4360: -1- m4_pattern_allow([^SOLIBBZ$])
+m4trace:configure.ac:4361: -1- AC_SUBST([SOLIBMATH])
+m4trace:configure.ac:4361: -1- AC_SUBST_TRACE([SOLIBMATH])
+m4trace:configure.ac:4361: -1- m4_pattern_allow([^SOLIBMATH$])
+m4trace:configure.ac:4362: -1- AC_SUBST([SOLIBCRYPTO])
+m4trace:configure.ac:4362: -1- AC_SUBST_TRACE([SOLIBCRYPTO])
+m4trace:configure.ac:4362: -1- m4_pattern_allow([^SOLIBCRYPTO$])
+m4trace:configure.ac:4363: -1- AC_SUBST([SOLIBNET])
+m4trace:configure.ac:4363: -1- AC_SUBST_TRACE([SOLIBNET])
+m4trace:configure.ac:4363: -1- m4_pattern_allow([^SOLIBNET$])
+m4trace:configure.ac:4364: -1- AC_SUBST([SOLIBIMG])
+m4trace:configure.ac:4364: -1- AC_SUBST_TRACE([SOLIBIMG])
+m4trace:configure.ac:4364: -1- m4_pattern_allow([^SOLIBIMG$])
+m4trace:configure.ac:4365: -1- AC_SUBST([SOLIBSDBI])
+m4trace:configure.ac:4365: -1- AC_SUBST_TRACE([SOLIBSDBI])
+m4trace:configure.ac:4365: -1- m4_pattern_allow([^SOLIBSDBI$])
+m4trace:configure.ac:4366: -1- AC_SUBST([SOLIBWX])
+m4trace:configure.ac:4366: -1- AC_SUBST_TRACE([SOLIBWX])
+m4trace:configure.ac:4366: -1- m4_pattern_allow([^SOLIBWX$])
+m4trace:configure.ac:4367: -1- AC_SUBST([SOLIBDK3PORT])
+m4trace:configure.ac:4367: -1- AC_SUBST_TRACE([SOLIBDK3PORT])
+m4trace:configure.ac:4367: -1- m4_pattern_allow([^SOLIBDK3PORT$])
+m4trace:configure.ac:4368: -1- AC_SUBST([SOLIBDK3C])
+m4trace:configure.ac:4368: -1- AC_SUBST_TRACE([SOLIBDK3C])
+m4trace:configure.ac:4368: -1- m4_pattern_allow([^SOLIBDK3C$])
+m4trace:configure.ac:4369: -1- AC_SUBST([SOLIBDK3OF])
+m4trace:configure.ac:4369: -1- AC_SUBST_TRACE([SOLIBDK3OF])
+m4trace:configure.ac:4369: -1- m4_pattern_allow([^SOLIBDK3OF$])
+m4trace:configure.ac:4370: -1- AC_SUBST([SOLIBDK3CSRND])
+m4trace:configure.ac:4370: -1- AC_SUBST_TRACE([SOLIBDK3CSRND])
+m4trace:configure.ac:4370: -1- m4_pattern_allow([^SOLIBDK3CSRND$])
+m4trace:configure.ac:4371: -1- AC_SUBST([SOLIBDK3BIF])
+m4trace:configure.ac:4371: -1- AC_SUBST_TRACE([SOLIBDK3BIF])
+m4trace:configure.ac:4371: -1- m4_pattern_allow([^SOLIBDK3BIF$])
+m4trace:configure.ac:4372: -1- AC_SUBST([SOLIBDK3DBI])
+m4trace:configure.ac:4372: -1- AC_SUBST_TRACE([SOLIBDK3DBI])
+m4trace:configure.ac:4372: -1- m4_pattern_allow([^SOLIBDK3DBI$])
+m4trace:configure.ac:4373: -1- AC_SUBST([SOLIBDK3FIG])
+m4trace:configure.ac:4373: -1- AC_SUBST_TRACE([SOLIBDK3FIG])
+m4trace:configure.ac:4373: -1- m4_pattern_allow([^SOLIBDK3FIG$])
+m4trace:configure.ac:4374: -1- AC_SUBST([SOLIBDK3BMEPS])
+m4trace:configure.ac:4374: -1- AC_SUBST_TRACE([SOLIBDK3BMEPS])
+m4trace:configure.ac:4374: -1- m4_pattern_allow([^SOLIBDK3BMEPS$])
+m4trace:configure.ac:4375: -1- AC_SUBST([SOLIBDK3NET])
+m4trace:configure.ac:4375: -1- AC_SUBST_TRACE([SOLIBDK3NET])
+m4trace:configure.ac:4375: -1- m4_pattern_allow([^SOLIBDK3NET$])
+m4trace:configure.ac:4376: -1- AC_SUBST([SOLIBDK4BASE])
+m4trace:configure.ac:4376: -1- AC_SUBST_TRACE([SOLIBDK4BASE])
+m4trace:configure.ac:4376: -1- m4_pattern_allow([^SOLIBDK4BASE$])
+m4trace:configure.ac:4377: -1- AC_SUBST([SOLIBDK4MA])
+m4trace:configure.ac:4377: -1- AC_SUBST_TRACE([SOLIBDK4MA])
+m4trace:configure.ac:4377: -1- m4_pattern_allow([^SOLIBDK4MA$])
+m4trace:configure.ac:4378: -1- AC_SUBST([SOLIBDK4MAIO8H])
+m4trace:configure.ac:4378: -1- AC_SUBST_TRACE([SOLIBDK4MAIO8H])
+m4trace:configure.ac:4378: -1- m4_pattern_allow([^SOLIBDK4MAIO8H$])
+m4trace:configure.ac:4379: -1- AC_SUBST([SOLIBDK4MAIOWH])
+m4trace:configure.ac:4379: -1- AC_SUBST_TRACE([SOLIBDK4MAIOWH])
+m4trace:configure.ac:4379: -1- m4_pattern_allow([^SOLIBDK4MAIOWH$])
+m4trace:configure.ac:4380: -1- AC_SUBST([SOLIBDK4MAIODH])
+m4trace:configure.ac:4380: -1- AC_SUBST_TRACE([SOLIBDK4MAIODH])
+m4trace:configure.ac:4380: -1- m4_pattern_allow([^SOLIBDK4MAIODH$])
+m4trace:configure.ac:4381: -1- AC_SUBST([SOLIBDK4MAIO8D])
+m4trace:configure.ac:4381: -1- AC_SUBST_TRACE([SOLIBDK4MAIO8D])
+m4trace:configure.ac:4381: -1- m4_pattern_allow([^SOLIBDK4MAIO8D$])
+m4trace:configure.ac:4382: -1- AC_SUBST([SOLIBDK4MAIOWD])
+m4trace:configure.ac:4382: -1- AC_SUBST_TRACE([SOLIBDK4MAIOWD])
+m4trace:configure.ac:4382: -1- m4_pattern_allow([^SOLIBDK4MAIOWD$])
+m4trace:configure.ac:4383: -1- AC_SUBST([SOLIBDK4MAIODD])
+m4trace:configure.ac:4383: -1- AC_SUBST_TRACE([SOLIBDK4MAIODD])
+m4trace:configure.ac:4383: -1- m4_pattern_allow([^SOLIBDK4MAIODD$])
+m4trace:configure.ac:4384: -1- AC_SUBST([SOLIBDK4C])
+m4trace:configure.ac:4384: -1- AC_SUBST_TRACE([SOLIBDK4C])
+m4trace:configure.ac:4384: -1- m4_pattern_allow([^SOLIBDK4C$])
+m4trace:configure.ac:4385: -1- AC_SUBST([SOLIBDK4MDRND])
+m4trace:configure.ac:4385: -1- AC_SUBST_TRACE([SOLIBDK4MDRND])
+m4trace:configure.ac:4385: -1- m4_pattern_allow([^SOLIBDK4MDRND$])
+m4trace:configure.ac:4386: -1- AC_SUBST([SOLIBDK4PPPT])
+m4trace:configure.ac:4386: -1- AC_SUBST_TRACE([SOLIBDK4PPPT])
+m4trace:configure.ac:4386: -1- m4_pattern_allow([^SOLIBDK4PPPT$])
+m4trace:configure.ac:4387: -1- AC_SUBST([SOLIBDK4APP])
+m4trace:configure.ac:4387: -1- AC_SUBST_TRACE([SOLIBDK4APP])
+m4trace:configure.ac:4387: -1- m4_pattern_allow([^SOLIBDK4APP$])
+m4trace:configure.ac:4388: -1- AC_SUBST([SOLIBDK4LATA])
+m4trace:configure.ac:4388: -1- AC_SUBST_TRACE([SOLIBDK4LATA])
+m4trace:configure.ac:4388: -1- m4_pattern_allow([^SOLIBDK4LATA$])
+m4trace:configure.ac:4389: -1- AC_SUBST([SOLIBDK4LAT])
+m4trace:configure.ac:4389: -1- AC_SUBST_TRACE([SOLIBDK4LAT])
+m4trace:configure.ac:4389: -1- m4_pattern_allow([^SOLIBDK4LAT$])
+m4trace:configure.ac:4390: -1- AC_SUBST([SOLIBDK4SOCK])
+m4trace:configure.ac:4390: -1- AC_SUBST_TRACE([SOLIBDK4SOCK])
+m4trace:configure.ac:4390: -1- m4_pattern_allow([^SOLIBDK4SOCK$])
+m4trace:configure.ac:4391: -1- AC_SUBST([SOLIBDK4SOCKA])
+m4trace:configure.ac:4391: -1- AC_SUBST_TRACE([SOLIBDK4SOCKA])
+m4trace:configure.ac:4391: -1- m4_pattern_allow([^SOLIBDK4SOCKA$])
+m4trace:configure.ac:4392: -1- AC_SUBST([SOLIBDK4DBI])
+m4trace:configure.ac:4392: -1- AC_SUBST_TRACE([SOLIBDK4DBI])
+m4trace:configure.ac:4392: -1- m4_pattern_allow([^SOLIBDK4DBI$])
+m4trace:configure.ac:4393: -1- AC_SUBST([SOLIBDK4DBIA])
+m4trace:configure.ac:4393: -1- AC_SUBST_TRACE([SOLIBDK4DBIA])
+m4trace:configure.ac:4393: -1- m4_pattern_allow([^SOLIBDK4DBIA$])
+m4trace:configure.ac:4394: -1- AC_SUBST([LIBDK4BASELIBF])
+m4trace:configure.ac:4394: -1- AC_SUBST_TRACE([LIBDK4BASELIBF])
+m4trace:configure.ac:4394: -1- m4_pattern_allow([^LIBDK4BASELIBF$])
+m4trace:configure.ac:4395: -1- AC_SUBST([LIBDK4BASELIBS])
+m4trace:configure.ac:4395: -1- AC_SUBST_TRACE([LIBDK4BASELIBS])
+m4trace:configure.ac:4395: -1- m4_pattern_allow([^LIBDK4BASELIBS$])
+m4trace:configure.ac:4396: -1- AC_SUBST([LIBDK4MALIBF])
+m4trace:configure.ac:4396: -1- AC_SUBST_TRACE([LIBDK4MALIBF])
+m4trace:configure.ac:4396: -1- m4_pattern_allow([^LIBDK4MALIBF$])
+m4trace:configure.ac:4397: -1- AC_SUBST([LIBDK4MALIBS])
+m4trace:configure.ac:4397: -1- AC_SUBST_TRACE([LIBDK4MALIBS])
+m4trace:configure.ac:4397: -1- m4_pattern_allow([^LIBDK4MALIBS$])
+m4trace:configure.ac:4398: -1- AC_SUBST([LIBDK4MAIO8DLIBF])
+m4trace:configure.ac:4398: -1- AC_SUBST_TRACE([LIBDK4MAIO8DLIBF])
+m4trace:configure.ac:4398: -1- m4_pattern_allow([^LIBDK4MAIO8DLIBF$])
+m4trace:configure.ac:4399: -1- AC_SUBST([LIBDK4MAIO8DLIBS])
+m4trace:configure.ac:4399: -1- AC_SUBST_TRACE([LIBDK4MAIO8DLIBS])
+m4trace:configure.ac:4399: -1- m4_pattern_allow([^LIBDK4MAIO8DLIBS$])
+m4trace:configure.ac:4400: -1- AC_SUBST([LIBDK4MAIOWDLIBF])
+m4trace:configure.ac:4400: -1- AC_SUBST_TRACE([LIBDK4MAIOWDLIBF])
+m4trace:configure.ac:4400: -1- m4_pattern_allow([^LIBDK4MAIOWDLIBF$])
+m4trace:configure.ac:4401: -1- AC_SUBST([LIBDK4MAIOWDLIBS])
+m4trace:configure.ac:4401: -1- AC_SUBST_TRACE([LIBDK4MAIOWDLIBS])
+m4trace:configure.ac:4401: -1- m4_pattern_allow([^LIBDK4MAIOWDLIBS$])
+m4trace:configure.ac:4402: -1- AC_SUBST([LIBDK4MAIODDLIBF])
+m4trace:configure.ac:4402: -1- AC_SUBST_TRACE([LIBDK4MAIODDLIBF])
+m4trace:configure.ac:4402: -1- m4_pattern_allow([^LIBDK4MAIODDLIBF$])
+m4trace:configure.ac:4403: -1- AC_SUBST([LIBDK4MAIODDLIBS])
+m4trace:configure.ac:4403: -1- AC_SUBST_TRACE([LIBDK4MAIODDLIBS])
+m4trace:configure.ac:4403: -1- m4_pattern_allow([^LIBDK4MAIODDLIBS$])
+m4trace:configure.ac:4404: -1- AC_SUBST([LIBDK4MAIOXDLIBF])
+m4trace:configure.ac:4404: -1- AC_SUBST_TRACE([LIBDK4MAIOXDLIBF])
+m4trace:configure.ac:4404: -1- m4_pattern_allow([^LIBDK4MAIOXDLIBF$])
+m4trace:configure.ac:4405: -1- AC_SUBST([LIBDK4MAIOXDLIBS])
+m4trace:configure.ac:4405: -1- AC_SUBST_TRACE([LIBDK4MAIOXDLIBS])
+m4trace:configure.ac:4405: -1- m4_pattern_allow([^LIBDK4MAIOXDLIBS$])
+m4trace:configure.ac:4406: -1- AC_SUBST([LIBDK4MAIO8HLIBF])
+m4trace:configure.ac:4406: -1- AC_SUBST_TRACE([LIBDK4MAIO8HLIBF])
+m4trace:configure.ac:4406: -1- m4_pattern_allow([^LIBDK4MAIO8HLIBF$])
+m4trace:configure.ac:4407: -1- AC_SUBST([LIBDK4MAIO8HLIBS])
+m4trace:configure.ac:4407: -1- AC_SUBST_TRACE([LIBDK4MAIO8HLIBS])
+m4trace:configure.ac:4407: -1- m4_pattern_allow([^LIBDK4MAIO8HLIBS$])
+m4trace:configure.ac:4408: -1- AC_SUBST([LIBDK4MAIOWHLIBF])
+m4trace:configure.ac:4408: -1- AC_SUBST_TRACE([LIBDK4MAIOWHLIBF])
+m4trace:configure.ac:4408: -1- m4_pattern_allow([^LIBDK4MAIOWHLIBF$])
+m4trace:configure.ac:4409: -1- AC_SUBST([LIBDK4MAIOWHLIBS])
+m4trace:configure.ac:4409: -1- AC_SUBST_TRACE([LIBDK4MAIOWHLIBS])
+m4trace:configure.ac:4409: -1- m4_pattern_allow([^LIBDK4MAIOWHLIBS$])
+m4trace:configure.ac:4410: -1- AC_SUBST([LIBDK4MAIODHLIBF])
+m4trace:configure.ac:4410: -1- AC_SUBST_TRACE([LIBDK4MAIODHLIBF])
+m4trace:configure.ac:4410: -1- m4_pattern_allow([^LIBDK4MAIODHLIBF$])
+m4trace:configure.ac:4411: -1- AC_SUBST([LIBDK4MAIODHLIBS])
+m4trace:configure.ac:4411: -1- AC_SUBST_TRACE([LIBDK4MAIODHLIBS])
+m4trace:configure.ac:4411: -1- m4_pattern_allow([^LIBDK4MAIODHLIBS$])
+m4trace:configure.ac:4412: -1- AC_SUBST([LIBDK4DBILIBF])
+m4trace:configure.ac:4412: -1- AC_SUBST_TRACE([LIBDK4DBILIBF])
+m4trace:configure.ac:4412: -1- m4_pattern_allow([^LIBDK4DBILIBF$])
+m4trace:configure.ac:4413: -1- AC_SUBST([LIBDK4DBILIBS])
+m4trace:configure.ac:4413: -1- AC_SUBST_TRACE([LIBDK4DBILIBS])
+m4trace:configure.ac:4413: -1- m4_pattern_allow([^LIBDK4DBILIBS$])
+m4trace:configure.ac:4414: -1- AC_SUBST([LIBDK4CLIBF])
+m4trace:configure.ac:4414: -1- AC_SUBST_TRACE([LIBDK4CLIBF])
+m4trace:configure.ac:4414: -1- m4_pattern_allow([^LIBDK4CLIBF$])
+m4trace:configure.ac:4415: -1- AC_SUBST([LIBDK4CLIBS])
+m4trace:configure.ac:4415: -1- AC_SUBST_TRACE([LIBDK4CLIBS])
+m4trace:configure.ac:4415: -1- m4_pattern_allow([^LIBDK4CLIBS$])
+m4trace:configure.ac:4416: -1- AC_SUBST([LIBDK4LATALIBF])
+m4trace:configure.ac:4416: -1- AC_SUBST_TRACE([LIBDK4LATALIBF])
+m4trace:configure.ac:4416: -1- m4_pattern_allow([^LIBDK4LATALIBF$])
+m4trace:configure.ac:4417: -1- AC_SUBST([LIBDK4LATALIBS])
+m4trace:configure.ac:4417: -1- AC_SUBST_TRACE([LIBDK4LATALIBS])
+m4trace:configure.ac:4417: -1- m4_pattern_allow([^LIBDK4LATALIBS$])
+m4trace:configure.ac:4418: -1- AC_SUBST([LIBDK4LATLIBF])
+m4trace:configure.ac:4418: -1- AC_SUBST_TRACE([LIBDK4LATLIBF])
+m4trace:configure.ac:4418: -1- m4_pattern_allow([^LIBDK4LATLIBF$])
+m4trace:configure.ac:4419: -1- AC_SUBST([LIBDK4LATLIBS])
+m4trace:configure.ac:4419: -1- AC_SUBST_TRACE([LIBDK4LATLIBS])
+m4trace:configure.ac:4419: -1- m4_pattern_allow([^LIBDK4LATLIBS$])
+m4trace:configure.ac:4420: -1- AC_SUBST([LIBDK4SOCKLIBF])
+m4trace:configure.ac:4420: -1- AC_SUBST_TRACE([LIBDK4SOCKLIBF])
+m4trace:configure.ac:4420: -1- m4_pattern_allow([^LIBDK4SOCKLIBF$])
+m4trace:configure.ac:4421: -1- AC_SUBST([LIBDK4SOCKLIBS])
+m4trace:configure.ac:4421: -1- AC_SUBST_TRACE([LIBDK4SOCKLIBS])
+m4trace:configure.ac:4421: -1- m4_pattern_allow([^LIBDK4SOCKLIBS$])
+m4trace:configure.ac:4422: -1- AC_SUBST([LIBDK4MDRNDLIBF])
+m4trace:configure.ac:4422: -1- AC_SUBST_TRACE([LIBDK4MDRNDLIBF])
+m4trace:configure.ac:4422: -1- m4_pattern_allow([^LIBDK4MDRNDLIBF$])
+m4trace:configure.ac:4423: -1- AC_SUBST([LIBDK4MDRNDLIBS])
+m4trace:configure.ac:4423: -1- AC_SUBST_TRACE([LIBDK4MDRNDLIBS])
+m4trace:configure.ac:4423: -1- m4_pattern_allow([^LIBDK4MDRNDLIBS$])
+m4trace:configure.ac:4424: -1- AC_SUBST([LIBDK4BIFLIBF])
+m4trace:configure.ac:4424: -1- AC_SUBST_TRACE([LIBDK4BIFLIBF])
+m4trace:configure.ac:4424: -1- m4_pattern_allow([^LIBDK4BIFLIBF$])
+m4trace:configure.ac:4425: -1- AC_SUBST([LIBDK4BIFLIBS])
+m4trace:configure.ac:4425: -1- AC_SUBST_TRACE([LIBDK4BIFLIBS])
+m4trace:configure.ac:4425: -1- m4_pattern_allow([^LIBDK4BIFLIBS$])
+m4trace:configure.ac:4426: -1- AC_SUBST([LIBDK4GRALIBF])
+m4trace:configure.ac:4426: -1- AC_SUBST_TRACE([LIBDK4GRALIBF])
+m4trace:configure.ac:4426: -1- m4_pattern_allow([^LIBDK4GRALIBF$])
+m4trace:configure.ac:4427: -1- AC_SUBST([LIBDK4GRALIBS])
+m4trace:configure.ac:4427: -1- AC_SUBST_TRACE([LIBDK4GRALIBS])
+m4trace:configure.ac:4427: -1- m4_pattern_allow([^LIBDK4GRALIBS$])
+m4trace:configure.ac:4428: -1- AC_SUBST([LIBDK4PPPTLIBF])
+m4trace:configure.ac:4428: -1- AC_SUBST_TRACE([LIBDK4PPPTLIBF])
+m4trace:configure.ac:4428: -1- m4_pattern_allow([^LIBDK4PPPTLIBF$])
+m4trace:configure.ac:4429: -1- AC_SUBST([LIBDK4PPPTLIBS])
+m4trace:configure.ac:4429: -1- AC_SUBST_TRACE([LIBDK4PPPTLIBS])
+m4trace:configure.ac:4429: -1- m4_pattern_allow([^LIBDK4PPPTLIBS$])
+m4trace:configure.ac:4430: -1- AC_SUBST([LIBDK4APPLIBF])
+m4trace:configure.ac:4430: -1- AC_SUBST_TRACE([LIBDK4APPLIBF])
+m4trace:configure.ac:4430: -1- m4_pattern_allow([^LIBDK4APPLIBF$])
+m4trace:configure.ac:4431: -1- AC_SUBST([LIBDK4APPLIBS])
+m4trace:configure.ac:4431: -1- AC_SUBST_TRACE([LIBDK4APPLIBS])
+m4trace:configure.ac:4431: -1- m4_pattern_allow([^LIBDK4APPLIBS$])
+m4trace:configure.ac:4432: -1- AC_SUBST([LIBDK4BIFALIBF])
+m4trace:configure.ac:4432: -1- AC_SUBST_TRACE([LIBDK4BIFALIBF])
+m4trace:configure.ac:4432: -1- m4_pattern_allow([^LIBDK4BIFALIBF$])
+m4trace:configure.ac:4433: -1- AC_SUBST([LIBDK4BIFALIBS])
+m4trace:configure.ac:4433: -1- AC_SUBST_TRACE([LIBDK4BIFALIBS])
+m4trace:configure.ac:4433: -1- m4_pattern_allow([^LIBDK4BIFALIBS$])
+m4trace:configure.ac:4434: -1- AC_SUBST([LIBDK4GRAALIBF])
+m4trace:configure.ac:4434: -1- AC_SUBST_TRACE([LIBDK4GRAALIBF])
+m4trace:configure.ac:4434: -1- m4_pattern_allow([^LIBDK4GRAALIBF$])
+m4trace:configure.ac:4435: -1- AC_SUBST([LIBDK4GRAALIBS])
+m4trace:configure.ac:4435: -1- AC_SUBST_TRACE([LIBDK4GRAALIBS])
+m4trace:configure.ac:4435: -1- m4_pattern_allow([^LIBDK4GRAALIBS$])
+m4trace:configure.ac:4436: -1- AC_SUBST([LIBDK4PPPTALIBF])
+m4trace:configure.ac:4436: -1- AC_SUBST_TRACE([LIBDK4PPPTALIBF])
+m4trace:configure.ac:4436: -1- m4_pattern_allow([^LIBDK4PPPTALIBF$])
+m4trace:configure.ac:4437: -1- AC_SUBST([LIBDK4PPPTALIBS])
+m4trace:configure.ac:4437: -1- AC_SUBST_TRACE([LIBDK4PPPTALIBS])
+m4trace:configure.ac:4437: -1- m4_pattern_allow([^LIBDK4PPPTALIBS$])
+m4trace:configure.ac:4438: -1- AC_SUBST([LIBDK4SOCKALIBF])
+m4trace:configure.ac:4438: -1- AC_SUBST_TRACE([LIBDK4SOCKALIBF])
+m4trace:configure.ac:4438: -1- m4_pattern_allow([^LIBDK4SOCKALIBF$])
+m4trace:configure.ac:4439: -1- AC_SUBST([LIBDK4SOCKALIBS])
+m4trace:configure.ac:4439: -1- AC_SUBST_TRACE([LIBDK4SOCKALIBS])
+m4trace:configure.ac:4439: -1- m4_pattern_allow([^LIBDK4SOCKALIBS$])
+m4trace:configure.ac:4440: -1- AC_SUBST([LIBDK4DBIALIBF])
+m4trace:configure.ac:4440: -1- AC_SUBST_TRACE([LIBDK4DBIALIBF])
+m4trace:configure.ac:4440: -1- m4_pattern_allow([^LIBDK4DBIALIBF$])
+m4trace:configure.ac:4441: -1- AC_SUBST([LIBDK4DBIALIBS])
+m4trace:configure.ac:4441: -1- AC_SUBST_TRACE([LIBDK4DBIALIBS])
+m4trace:configure.ac:4441: -1- m4_pattern_allow([^LIBDK4DBIALIBS$])
+m4trace:configure.ac:4442: -1- AC_SUBST([LIBDK4WXLIBF])
+m4trace:configure.ac:4442: -1- AC_SUBST_TRACE([LIBDK4WXLIBF])
+m4trace:configure.ac:4442: -1- m4_pattern_allow([^LIBDK4WXLIBF$])
+m4trace:configure.ac:4443: -1- AC_SUBST([LIBDK4WXLIBS])
+m4trace:configure.ac:4443: -1- AC_SUBST_TRACE([LIBDK4WXLIBS])
+m4trace:configure.ac:4443: -1- m4_pattern_allow([^LIBDK4WXLIBS$])
+m4trace:configure.ac:4444: -1- AC_SUBST([LIBDK3TRACELIBF])
+m4trace:configure.ac:4444: -1- AC_SUBST_TRACE([LIBDK3TRACELIBF])
+m4trace:configure.ac:4444: -1- m4_pattern_allow([^LIBDK3TRACELIBF$])
+m4trace:configure.ac:4445: -1- AC_SUBST([LIBDK3TRACELIBS])
+m4trace:configure.ac:4445: -1- AC_SUBST_TRACE([LIBDK3TRACELIBS])
+m4trace:configure.ac:4445: -1- m4_pattern_allow([^LIBDK3TRACELIBS$])
+m4trace:configure.ac:4446: -1- AC_SUBST([LIBDK3CLIBF])
+m4trace:configure.ac:4446: -1- AC_SUBST_TRACE([LIBDK3CLIBF])
+m4trace:configure.ac:4446: -1- m4_pattern_allow([^LIBDK3CLIBF$])
+m4trace:configure.ac:4447: -1- AC_SUBST([LIBDK3CLIBS])
+m4trace:configure.ac:4447: -1- AC_SUBST_TRACE([LIBDK3CLIBS])
+m4trace:configure.ac:4447: -1- m4_pattern_allow([^LIBDK3CLIBS$])
+m4trace:configure.ac:4448: -1- AC_SUBST([LIBDK3OFLIBF])
+m4trace:configure.ac:4448: -1- AC_SUBST_TRACE([LIBDK3OFLIBF])
+m4trace:configure.ac:4448: -1- m4_pattern_allow([^LIBDK3OFLIBF$])
+m4trace:configure.ac:4449: -1- AC_SUBST([LIBDK3OFLIBS])
+m4trace:configure.ac:4449: -1- AC_SUBST_TRACE([LIBDK3OFLIBS])
+m4trace:configure.ac:4449: -1- m4_pattern_allow([^LIBDK3OFLIBS$])
+m4trace:configure.ac:4450: -1- AC_SUBST([LIBDK3CSRNDLIBF])
+m4trace:configure.ac:4450: -1- AC_SUBST_TRACE([LIBDK3CSRNDLIBF])
+m4trace:configure.ac:4450: -1- m4_pattern_allow([^LIBDK3CSRNDLIBF$])
+m4trace:configure.ac:4451: -1- AC_SUBST([LIBDK3CSRNDLIBS])
+m4trace:configure.ac:4451: -1- AC_SUBST_TRACE([LIBDK3CSRNDLIBS])
+m4trace:configure.ac:4451: -1- m4_pattern_allow([^LIBDK3CSRNDLIBS$])
+m4trace:configure.ac:4452: -1- AC_SUBST([LIBDK3BIFLIBF])
+m4trace:configure.ac:4452: -1- AC_SUBST_TRACE([LIBDK3BIFLIBF])
+m4trace:configure.ac:4452: -1- m4_pattern_allow([^LIBDK3BIFLIBF$])
+m4trace:configure.ac:4453: -1- AC_SUBST([LIBDK3BIFLIBS])
+m4trace:configure.ac:4453: -1- AC_SUBST_TRACE([LIBDK3BIFLIBS])
+m4trace:configure.ac:4453: -1- m4_pattern_allow([^LIBDK3BIFLIBS$])
+m4trace:configure.ac:4454: -1- AC_SUBST([LIBDK3DBILIBF])
+m4trace:configure.ac:4454: -1- AC_SUBST_TRACE([LIBDK3DBILIBF])
+m4trace:configure.ac:4454: -1- m4_pattern_allow([^LIBDK3DBILIBF$])
+m4trace:configure.ac:4455: -1- AC_SUBST([LIBDK3DBILIBS])
+m4trace:configure.ac:4455: -1- AC_SUBST_TRACE([LIBDK3DBILIBS])
+m4trace:configure.ac:4455: -1- m4_pattern_allow([^LIBDK3DBILIBS$])
+m4trace:configure.ac:4456: -1- AC_SUBST([LIBDK3BMEPSLIBF])
+m4trace:configure.ac:4456: -1- AC_SUBST_TRACE([LIBDK3BMEPSLIBF])
+m4trace:configure.ac:4456: -1- m4_pattern_allow([^LIBDK3BMEPSLIBF$])
+m4trace:configure.ac:4457: -1- AC_SUBST([LIBDK3BMEPSLIBS])
+m4trace:configure.ac:4457: -1- AC_SUBST_TRACE([LIBDK3BMEPSLIBS])
+m4trace:configure.ac:4457: -1- m4_pattern_allow([^LIBDK3BMEPSLIBS$])
+m4trace:configure.ac:4458: -1- AC_SUBST([LIBDK3FIGLIBF])
+m4trace:configure.ac:4458: -1- AC_SUBST_TRACE([LIBDK3FIGLIBF])
+m4trace:configure.ac:4458: -1- m4_pattern_allow([^LIBDK3FIGLIBF$])
+m4trace:configure.ac:4459: -1- AC_SUBST([LIBDK3FIGLIBS])
+m4trace:configure.ac:4459: -1- AC_SUBST_TRACE([LIBDK3FIGLIBS])
+m4trace:configure.ac:4459: -1- m4_pattern_allow([^LIBDK3FIGLIBS$])
+m4trace:configure.ac:4460: -1- AC_SUBST([LIBDK3WXLIBF])
+m4trace:configure.ac:4460: -1- AC_SUBST_TRACE([LIBDK3WXLIBF])
+m4trace:configure.ac:4460: -1- m4_pattern_allow([^LIBDK3WXLIBF$])
+m4trace:configure.ac:4461: -1- AC_SUBST([LIBDK3WXLIBS])
+m4trace:configure.ac:4461: -1- AC_SUBST_TRACE([LIBDK3WXLIBS])
+m4trace:configure.ac:4461: -1- m4_pattern_allow([^LIBDK3WXLIBS$])
+m4trace:configure.ac:4462: -1- AC_SUBST([DKCATLIBF])
+m4trace:configure.ac:4462: -1- AC_SUBST_TRACE([DKCATLIBF])
+m4trace:configure.ac:4462: -1- m4_pattern_allow([^DKCATLIBF$])
+m4trace:configure.ac:4463: -1- AC_SUBST([DKCATLIBS])
+m4trace:configure.ac:4463: -1- AC_SUBST_TRACE([DKCATLIBS])
+m4trace:configure.ac:4463: -1- m4_pattern_allow([^DKCATLIBS$])
+m4trace:configure.ac:4464: -1- AC_SUBST([DKBLKSLIBF])
+m4trace:configure.ac:4464: -1- AC_SUBST_TRACE([DKBLKSLIBF])
+m4trace:configure.ac:4464: -1- m4_pattern_allow([^DKBLKSLIBF$])
+m4trace:configure.ac:4465: -1- AC_SUBST([DKBLKSLIBS])
+m4trace:configure.ac:4465: -1- AC_SUBST_TRACE([DKBLKSLIBS])
+m4trace:configure.ac:4465: -1- m4_pattern_allow([^DKBLKSLIBS$])
+m4trace:configure.ac:4466: -1- AC_SUBST([DKSQLSPLITLIBF])
+m4trace:configure.ac:4466: -1- AC_SUBST_TRACE([DKSQLSPLITLIBF])
+m4trace:configure.ac:4466: -1- m4_pattern_allow([^DKSQLSPLITLIBF$])
+m4trace:configure.ac:4467: -1- AC_SUBST([DKSQLSPLITLIBS])
+m4trace:configure.ac:4467: -1- AC_SUBST_TRACE([DKSQLSPLITLIBS])
+m4trace:configure.ac:4467: -1- m4_pattern_allow([^DKSQLSPLITLIBS$])
+m4trace:configure.ac:4468: -1- AC_SUBST([DKERADISKLIBF])
+m4trace:configure.ac:4468: -1- AC_SUBST_TRACE([DKERADISKLIBF])
+m4trace:configure.ac:4468: -1- m4_pattern_allow([^DKERADISKLIBF$])
+m4trace:configure.ac:4469: -1- AC_SUBST([DKERADISKLIBS])
+m4trace:configure.ac:4469: -1- AC_SUBST_TRACE([DKERADISKLIBS])
+m4trace:configure.ac:4469: -1- m4_pattern_allow([^DKERADISKLIBS$])
+m4trace:configure.ac:4470: -1- AC_SUBST([DKLSLIBF])
+m4trace:configure.ac:4470: -1- AC_SUBST_TRACE([DKLSLIBF])
+m4trace:configure.ac:4470: -1- m4_pattern_allow([^DKLSLIBF$])
+m4trace:configure.ac:4471: -1- AC_SUBST([DKLSLIBS])
+m4trace:configure.ac:4471: -1- AC_SUBST_TRACE([DKLSLIBS])
+m4trace:configure.ac:4471: -1- m4_pattern_allow([^DKLSLIBS$])
+m4trace:configure.ac:4472: -1- AC_SUBST([DKSORTLIBF])
+m4trace:configure.ac:4472: -1- AC_SUBST_TRACE([DKSORTLIBF])
+m4trace:configure.ac:4472: -1- m4_pattern_allow([^DKSORTLIBF$])
+m4trace:configure.ac:4473: -1- AC_SUBST([DKSORTLIBS])
+m4trace:configure.ac:4473: -1- AC_SUBST_TRACE([DKSORTLIBS])
+m4trace:configure.ac:4473: -1- m4_pattern_allow([^DKSORTLIBS$])
+m4trace:configure.ac:4474: -1- AC_SUBST([DKLINESLIBF])
+m4trace:configure.ac:4474: -1- AC_SUBST_TRACE([DKLINESLIBF])
+m4trace:configure.ac:4474: -1- m4_pattern_allow([^DKLINESLIBF$])
+m4trace:configure.ac:4475: -1- AC_SUBST([DKLINESLIBS])
+m4trace:configure.ac:4475: -1- AC_SUBST_TRACE([DKLINESLIBS])
+m4trace:configure.ac:4475: -1- m4_pattern_allow([^DKLINESLIBS$])
+m4trace:configure.ac:4476: -1- AC_SUBST([DKFICLIBF])
+m4trace:configure.ac:4476: -1- AC_SUBST_TRACE([DKFICLIBF])
+m4trace:configure.ac:4476: -1- m4_pattern_allow([^DKFICLIBF$])
+m4trace:configure.ac:4477: -1- AC_SUBST([DKFICLIBS])
+m4trace:configure.ac:4477: -1- AC_SUBST_TRACE([DKFICLIBS])
+m4trace:configure.ac:4477: -1- m4_pattern_allow([^DKFICLIBS$])
+m4trace:configure.ac:4478: -1- AC_SUBST([DKUIDLIBF])
+m4trace:configure.ac:4478: -1- AC_SUBST_TRACE([DKUIDLIBF])
+m4trace:configure.ac:4478: -1- m4_pattern_allow([^DKUIDLIBF$])
+m4trace:configure.ac:4479: -1- AC_SUBST([DKUIDLIBS])
+m4trace:configure.ac:4479: -1- AC_SUBST_TRACE([DKUIDLIBS])
+m4trace:configure.ac:4479: -1- m4_pattern_allow([^DKUIDLIBS$])
+m4trace:configure.ac:4480: -1- AC_SUBST([DKPWGENLIBF])
+m4trace:configure.ac:4480: -1- AC_SUBST_TRACE([DKPWGENLIBF])
+m4trace:configure.ac:4480: -1- m4_pattern_allow([^DKPWGENLIBF$])
+m4trace:configure.ac:4481: -1- AC_SUBST([DKPWGENLIBS])
+m4trace:configure.ac:4481: -1- AC_SUBST_TRACE([DKPWGENLIBS])
+m4trace:configure.ac:4481: -1- m4_pattern_allow([^DKPWGENLIBS$])
+m4trace:configure.ac:4482: -1- AC_SUBST([DKRANDLIBF])
+m4trace:configure.ac:4482: -1- AC_SUBST_TRACE([DKRANDLIBF])
+m4trace:configure.ac:4482: -1- m4_pattern_allow([^DKRANDLIBF$])
+m4trace:configure.ac:4483: -1- AC_SUBST([DKRANDLIBS])
+m4trace:configure.ac:4483: -1- AC_SUBST_TRACE([DKRANDLIBS])
+m4trace:configure.ac:4483: -1- m4_pattern_allow([^DKRANDLIBS$])
+m4trace:configure.ac:4484: -1- AC_SUBST([DKT2HLIBF])
+m4trace:configure.ac:4484: -1- AC_SUBST_TRACE([DKT2HLIBF])
+m4trace:configure.ac:4484: -1- m4_pattern_allow([^DKT2HLIBF$])
+m4trace:configure.ac:4485: -1- AC_SUBST([DKT2HLIBS])
+m4trace:configure.ac:4485: -1- AC_SUBST_TRACE([DKT2HLIBS])
+m4trace:configure.ac:4485: -1- m4_pattern_allow([^DKT2HLIBS$])
+m4trace:configure.ac:4486: -1- AC_SUBST([DKT2LLIBF])
+m4trace:configure.ac:4486: -1- AC_SUBST_TRACE([DKT2LLIBF])
+m4trace:configure.ac:4486: -1- m4_pattern_allow([^DKT2LLIBF$])
+m4trace:configure.ac:4487: -1- AC_SUBST([DKT2LLIBS])
+m4trace:configure.ac:4487: -1- AC_SUBST_TRACE([DKT2LLIBS])
+m4trace:configure.ac:4487: -1- m4_pattern_allow([^DKT2LLIBS$])
+m4trace:configure.ac:4488: -1- AC_SUBST([DKBIN2CLIBF])
+m4trace:configure.ac:4488: -1- AC_SUBST_TRACE([DKBIN2CLIBF])
+m4trace:configure.ac:4488: -1- m4_pattern_allow([^DKBIN2CLIBF$])
+m4trace:configure.ac:4489: -1- AC_SUBST([DKBIN2CLIBS])
+m4trace:configure.ac:4489: -1- AC_SUBST_TRACE([DKBIN2CLIBS])
+m4trace:configure.ac:4489: -1- m4_pattern_allow([^DKBIN2CLIBS$])
+m4trace:configure.ac:4490: -1- AC_SUBST([DKHEXLIBF])
+m4trace:configure.ac:4490: -1- AC_SUBST_TRACE([DKHEXLIBF])
+m4trace:configure.ac:4490: -1- m4_pattern_allow([^DKHEXLIBF$])
+m4trace:configure.ac:4491: -1- AC_SUBST([DKHEXLIBS])
+m4trace:configure.ac:4491: -1- AC_SUBST_TRACE([DKHEXLIBS])
+m4trace:configure.ac:4491: -1- m4_pattern_allow([^DKHEXLIBS$])
+m4trace:configure.ac:4492: -1- AC_SUBST([DKBMMLIBF])
+m4trace:configure.ac:4492: -1- AC_SUBST_TRACE([DKBMMLIBF])
+m4trace:configure.ac:4492: -1- m4_pattern_allow([^DKBMMLIBF$])
+m4trace:configure.ac:4493: -1- AC_SUBST([DKBMMLIBS])
+m4trace:configure.ac:4493: -1- AC_SUBST_TRACE([DKBMMLIBS])
+m4trace:configure.ac:4493: -1- m4_pattern_allow([^DKBMMLIBS$])
+m4trace:configure.ac:4494: -1- AC_SUBST([DKPWDLIBF])
+m4trace:configure.ac:4494: -1- AC_SUBST_TRACE([DKPWDLIBF])
+m4trace:configure.ac:4494: -1- m4_pattern_allow([^DKPWDLIBF$])
+m4trace:configure.ac:4495: -1- AC_SUBST([DKPWDLIBS])
+m4trace:configure.ac:4495: -1- AC_SUBST_TRACE([DKPWDLIBS])
+m4trace:configure.ac:4495: -1- m4_pattern_allow([^DKPWDLIBS$])
+m4trace:configure.ac:4496: -1- AC_SUBST([DKRECVLIBF])
+m4trace:configure.ac:4496: -1- AC_SUBST_TRACE([DKRECVLIBF])
+m4trace:configure.ac:4496: -1- m4_pattern_allow([^DKRECVLIBF$])
+m4trace:configure.ac:4497: -1- AC_SUBST([DKRECVLIBS])
+m4trace:configure.ac:4497: -1- AC_SUBST_TRACE([DKRECVLIBS])
+m4trace:configure.ac:4497: -1- m4_pattern_allow([^DKRECVLIBS$])
+m4trace:configure.ac:4498: -1- AC_SUBST([DKSENDLIBF])
+m4trace:configure.ac:4498: -1- AC_SUBST_TRACE([DKSENDLIBF])
+m4trace:configure.ac:4498: -1- m4_pattern_allow([^DKSENDLIBF$])
+m4trace:configure.ac:4499: -1- AC_SUBST([DKSENDLIBS])
+m4trace:configure.ac:4499: -1- AC_SUBST_TRACE([DKSENDLIBS])
+m4trace:configure.ac:4499: -1- m4_pattern_allow([^DKSENDLIBS$])
+m4trace:configure.ac:4500: -1- AC_SUBST([DKDBT2LIBF])
+m4trace:configure.ac:4500: -1- AC_SUBST_TRACE([DKDBT2LIBF])
+m4trace:configure.ac:4500: -1- m4_pattern_allow([^DKDBT2LIBF$])
+m4trace:configure.ac:4501: -1- AC_SUBST([DKDBT2LIBS])
+m4trace:configure.ac:4501: -1- AC_SUBST_TRACE([DKDBT2LIBS])
+m4trace:configure.ac:4501: -1- m4_pattern_allow([^DKDBT2LIBS$])
+m4trace:configure.ac:4502: -1- AC_SUBST([DK4INFOLIBS])
+m4trace:configure.ac:4502: -1- AC_SUBST_TRACE([DK4INFOLIBS])
+m4trace:configure.ac:4502: -1- m4_pattern_allow([^DK4INFOLIBS$])
+m4trace:configure.ac:4503: -1- AC_SUBST([DK4INFOLIBF])
+m4trace:configure.ac:4503: -1- AC_SUBST_TRACE([DK4INFOLIBF])
+m4trace:configure.ac:4503: -1- m4_pattern_allow([^DK4INFOLIBF$])
+m4trace:configure.ac:4504: -1- AC_SUBST([DKCTLIBF])
+m4trace:configure.ac:4504: -1- AC_SUBST_TRACE([DKCTLIBF])
+m4trace:configure.ac:4504: -1- m4_pattern_allow([^DKCTLIBF$])
+m4trace:configure.ac:4505: -1- AC_SUBST([DKCTLIBS])
+m4trace:configure.ac:4505: -1- AC_SUBST_TRACE([DKCTLIBS])
+m4trace:configure.ac:4505: -1- m4_pattern_allow([^DKCTLIBS$])
+m4trace:configure.ac:4506: -1- AC_SUBST([ADDCTRLDLIBF])
+m4trace:configure.ac:4506: -1- AC_SUBST_TRACE([ADDCTRLDLIBF])
+m4trace:configure.ac:4506: -1- m4_pattern_allow([^ADDCTRLDLIBF$])
+m4trace:configure.ac:4507: -1- AC_SUBST([ADDCTRLDLIBS])
+m4trace:configure.ac:4507: -1- AC_SUBST_TRACE([ADDCTRLDLIBS])
+m4trace:configure.ac:4507: -1- m4_pattern_allow([^ADDCTRLDLIBS$])
+m4trace:configure.ac:4508: -1- AC_SUBST([DKDBTLIBF])
+m4trace:configure.ac:4508: -1- AC_SUBST_TRACE([DKDBTLIBF])
+m4trace:configure.ac:4508: -1- m4_pattern_allow([^DKDBTLIBF$])
+m4trace:configure.ac:4509: -1- AC_SUBST([DKDBTLIBS])
+m4trace:configure.ac:4509: -1- AC_SUBST_TRACE([DKDBTLIBS])
+m4trace:configure.ac:4509: -1- m4_pattern_allow([^DKDBTLIBS$])
+m4trace:configure.ac:4510: -1- AC_SUBST([BMPPLIBF])
+m4trace:configure.ac:4510: -1- AC_SUBST_TRACE([BMPPLIBF])
+m4trace:configure.ac:4510: -1- m4_pattern_allow([^BMPPLIBF$])
+m4trace:configure.ac:4511: -1- AC_SUBST([BMPPLIBS])
+m4trace:configure.ac:4511: -1- AC_SUBST_TRACE([BMPPLIBS])
+m4trace:configure.ac:4511: -1- m4_pattern_allow([^BMPPLIBS$])
+m4trace:configure.ac:4512: -1- AC_SUBST([FIG2LATLIBF])
+m4trace:configure.ac:4512: -1- AC_SUBST_TRACE([FIG2LATLIBF])
+m4trace:configure.ac:4512: -1- m4_pattern_allow([^FIG2LATLIBF$])
+m4trace:configure.ac:4513: -1- AC_SUBST([FIG2LATLIBS])
+m4trace:configure.ac:4513: -1- AC_SUBST_TRACE([FIG2LATLIBS])
+m4trace:configure.ac:4513: -1- m4_pattern_allow([^FIG2LATLIBS$])
+m4trace:configure.ac:4514: -1- AC_SUBST([WXD2LATLIBF])
+m4trace:configure.ac:4514: -1- AC_SUBST_TRACE([WXD2LATLIBF])
+m4trace:configure.ac:4514: -1- m4_pattern_allow([^WXD2LATLIBF$])
+m4trace:configure.ac:4515: -1- AC_SUBST([WXD2LATLIBS])
+m4trace:configure.ac:4515: -1- AC_SUBST_TRACE([WXD2LATLIBS])
+m4trace:configure.ac:4515: -1- m4_pattern_allow([^WXD2LATLIBS$])
+m4trace:configure.ac:4516: -1- AC_SUBST([HTMLBOOKLIBF])
+m4trace:configure.ac:4516: -1- AC_SUBST_TRACE([HTMLBOOKLIBF])
+m4trace:configure.ac:4516: -1- m4_pattern_allow([^HTMLBOOKLIBF$])
+m4trace:configure.ac:4517: -1- AC_SUBST([HTMLBOOKLIBS])
+m4trace:configure.ac:4517: -1- AC_SUBST_TRACE([HTMLBOOKLIBS])
+m4trace:configure.ac:4517: -1- m4_pattern_allow([^HTMLBOOKLIBS$])
+m4trace:configure.ac:4518: -1- AC_SUBST([DKWTLIBF])
+m4trace:configure.ac:4518: -1- AC_SUBST_TRACE([DKWTLIBF])
+m4trace:configure.ac:4518: -1- m4_pattern_allow([^DKWTLIBF$])
+m4trace:configure.ac:4519: -1- AC_SUBST([DKWTLIBS])
+m4trace:configure.ac:4519: -1- AC_SUBST_TRACE([DKWTLIBS])
+m4trace:configure.ac:4519: -1- m4_pattern_allow([^DKWTLIBS$])
+m4trace:configure.ac:4520: -1- AC_SUBST([WPRCLEANLIBF])
+m4trace:configure.ac:4520: -1- AC_SUBST_TRACE([WPRCLEANLIBF])
+m4trace:configure.ac:4520: -1- m4_pattern_allow([^WPRCLEANLIBF$])
+m4trace:configure.ac:4521: -1- AC_SUBST([WPRCLEANLIBS])
+m4trace:configure.ac:4521: -1- AC_SUBST_TRACE([WPRCLEANLIBS])
+m4trace:configure.ac:4521: -1- m4_pattern_allow([^WPRCLEANLIBS$])
+m4trace:configure.ac:4522: -1- AC_SUBST([DK3INFOLIBF])
+m4trace:configure.ac:4522: -1- AC_SUBST_TRACE([DK3INFOLIBF])
+m4trace:configure.ac:4522: -1- m4_pattern_allow([^DK3INFOLIBF$])
+m4trace:configure.ac:4523: -1- AC_SUBST([DK3INFOLIBS])
+m4trace:configure.ac:4523: -1- AC_SUBST_TRACE([DK3INFOLIBS])
+m4trace:configure.ac:4523: -1- m4_pattern_allow([^DK3INFOLIBS$])
+m4trace:configure.ac:4524: -1- AC_SUBST([PLPDFTEXLIBF])
+m4trace:configure.ac:4524: -1- AC_SUBST_TRACE([PLPDFTEXLIBF])
+m4trace:configure.ac:4524: -1- m4_pattern_allow([^PLPDFTEXLIBF$])
+m4trace:configure.ac:4525: -1- AC_SUBST([PLPDFTEXLIBS])
+m4trace:configure.ac:4525: -1- AC_SUBST_TRACE([PLPDFTEXLIBS])
+m4trace:configure.ac:4525: -1- m4_pattern_allow([^PLPDFTEXLIBS$])
+m4trace:configure.ac:4526: -1- AC_SUBST([DKWXWIZLIBF])
+m4trace:configure.ac:4526: -1- AC_SUBST_TRACE([DKWXWIZLIBF])
+m4trace:configure.ac:4526: -1- m4_pattern_allow([^DKWXWIZLIBF$])
+m4trace:configure.ac:4527: -1- AC_SUBST([DKWXWIZLIBS])
+m4trace:configure.ac:4527: -1- AC_SUBST_TRACE([DKWXWIZLIBS])
+m4trace:configure.ac:4527: -1- m4_pattern_allow([^DKWXWIZLIBS$])
+m4trace:configure.ac:4528: -1- AC_SUBST([DKWXPATHLIBF])
+m4trace:configure.ac:4528: -1- AC_SUBST_TRACE([DKWXPATHLIBF])
+m4trace:configure.ac:4528: -1- m4_pattern_allow([^DKWXPATHLIBF$])
+m4trace:configure.ac:4529: -1- AC_SUBST([DKWXPATHLIBS])
+m4trace:configure.ac:4529: -1- AC_SUBST_TRACE([DKWXPATHLIBS])
+m4trace:configure.ac:4529: -1- m4_pattern_allow([^DKWXPATHLIBS$])
+m4trace:configure.ac:4530: -1- AC_SUBST([WINPRINTLIBF])
+m4trace:configure.ac:4530: -1- AC_SUBST_TRACE([WINPRINTLIBF])
+m4trace:configure.ac:4530: -1- m4_pattern_allow([^WINPRINTLIBF$])
+m4trace:configure.ac:4531: -1- AC_SUBST([WINPRINTLIBS])
+m4trace:configure.ac:4531: -1- AC_SUBST_TRACE([WINPRINTLIBS])
+m4trace:configure.ac:4531: -1- m4_pattern_allow([^WINPRINTLIBS$])
+m4trace:configure.ac:4532: -1- AC_SUBST([CHSCRSZLIBF])
+m4trace:configure.ac:4532: -1- AC_SUBST_TRACE([CHSCRSZLIBF])
+m4trace:configure.ac:4532: -1- m4_pattern_allow([^CHSCRSZLIBF$])
+m4trace:configure.ac:4533: -1- AC_SUBST([CHSCRSZLIBS])
+m4trace:configure.ac:4533: -1- AC_SUBST_TRACE([CHSCRSZLIBS])
+m4trace:configure.ac:4533: -1- m4_pattern_allow([^CHSCRSZLIBS$])
+m4trace:configure.ac:4534: -1- AC_SUBST([WXDKCTLIBF])
+m4trace:configure.ac:4534: -1- AC_SUBST_TRACE([WXDKCTLIBF])
+m4trace:configure.ac:4534: -1- m4_pattern_allow([^WXDKCTLIBF$])
+m4trace:configure.ac:4535: -1- AC_SUBST([WXDKCTLIBS])
+m4trace:configure.ac:4535: -1- AC_SUBST_TRACE([WXDKCTLIBS])
+m4trace:configure.ac:4535: -1- m4_pattern_allow([^WXDKCTLIBS$])
+m4trace:configure.ac:4536: -1- AC_SUBST([WXDKDRAWLIBF])
+m4trace:configure.ac:4536: -1- AC_SUBST_TRACE([WXDKDRAWLIBF])
+m4trace:configure.ac:4536: -1- m4_pattern_allow([^WXDKDRAWLIBF$])
+m4trace:configure.ac:4537: -1- AC_SUBST([WXDKDRAWLIBS])
+m4trace:configure.ac:4537: -1- AC_SUBST_TRACE([WXDKDRAWLIBS])
+m4trace:configure.ac:4537: -1- m4_pattern_allow([^WXDKDRAWLIBS$])
+m4trace:configure.ac:4538: -1- AC_SUBST([WXBMPPLIBF])
+m4trace:configure.ac:4538: -1- AC_SUBST_TRACE([WXBMPPLIBF])
+m4trace:configure.ac:4538: -1- m4_pattern_allow([^WXBMPPLIBF$])
+m4trace:configure.ac:4539: -1- AC_SUBST([WXBMPPLIBS])
+m4trace:configure.ac:4539: -1- AC_SUBST_TRACE([WXBMPPLIBS])
+m4trace:configure.ac:4539: -1- m4_pattern_allow([^WXBMPPLIBS$])
+m4trace:configure.ac:4540: -1- AC_SUBST([WXDKFCSLIBF])
+m4trace:configure.ac:4540: -1- AC_SUBST_TRACE([WXDKFCSLIBF])
+m4trace:configure.ac:4540: -1- m4_pattern_allow([^WXDKFCSLIBF$])
+m4trace:configure.ac:4541: -1- AC_SUBST([WXDKFCSLIBS])
+m4trace:configure.ac:4541: -1- AC_SUBST_TRACE([WXDKFCSLIBS])
+m4trace:configure.ac:4541: -1- m4_pattern_allow([^WXDKFCSLIBS$])
+m4trace:configure.ac:4542: -1- AC_SUBST([WXPQDICLIBF])
+m4trace:configure.ac:4542: -1- AC_SUBST_TRACE([WXPQDICLIBF])
+m4trace:configure.ac:4542: -1- m4_pattern_allow([^WXPQDICLIBF$])
+m4trace:configure.ac:4543: -1- AC_SUBST([WXPQDICLIBS])
+m4trace:configure.ac:4543: -1- AC_SUBST_TRACE([WXPQDICLIBS])
+m4trace:configure.ac:4543: -1- m4_pattern_allow([^WXPQDICLIBS$])
+m4trace:configure.ac:4544: -1- AC_SUBST([WXIMGSZLIBF])
+m4trace:configure.ac:4544: -1- AC_SUBST_TRACE([WXIMGSZLIBF])
+m4trace:configure.ac:4544: -1- m4_pattern_allow([^WXIMGSZLIBF$])
+m4trace:configure.ac:4545: -1- AC_SUBST([WXIMGSZLIBS])
+m4trace:configure.ac:4545: -1- AC_SUBST_TRACE([WXIMGSZLIBS])
+m4trace:configure.ac:4545: -1- m4_pattern_allow([^WXIMGSZLIBS$])
+m4trace:configure.ac:4546: -1- AC_SUBST([WXDKCLOCKLIBF])
+m4trace:configure.ac:4546: -1- AC_SUBST_TRACE([WXDKCLOCKLIBF])
+m4trace:configure.ac:4546: -1- m4_pattern_allow([^WXDKCLOCKLIBF$])
+m4trace:configure.ac:4547: -1- AC_SUBST([WXDKCLOCKLIBS])
+m4trace:configure.ac:4547: -1- AC_SUBST_TRACE([WXDKCLOCKLIBS])
+m4trace:configure.ac:4547: -1- m4_pattern_allow([^WXDKCLOCKLIBS$])
+m4trace:configure.ac:4548: -1- AC_SUBST([WXDKHTBLIBF])
+m4trace:configure.ac:4548: -1- AC_SUBST_TRACE([WXDKHTBLIBF])
+m4trace:configure.ac:4548: -1- m4_pattern_allow([^WXDKHTBLIBF$])
+m4trace:configure.ac:4549: -1- AC_SUBST([WXDKHTBLIBS])
+m4trace:configure.ac:4549: -1- AC_SUBST_TRACE([WXDKHTBLIBS])
+m4trace:configure.ac:4549: -1- m4_pattern_allow([^WXDKHTBLIBS$])
+m4trace:configure.ac:4550: -1- AC_SUBST([PRINTQDLIBF])
+m4trace:configure.ac:4550: -1- AC_SUBST_TRACE([PRINTQDLIBF])
+m4trace:configure.ac:4550: -1- m4_pattern_allow([^PRINTQDLIBF$])
+m4trace:configure.ac:4551: -1- AC_SUBST([PRINTQDLIBS])
+m4trace:configure.ac:4551: -1- AC_SUBST_TRACE([PRINTQDLIBS])
+m4trace:configure.ac:4551: -1- m4_pattern_allow([^PRINTQDLIBS$])
+m4trace:configure.ac:4552: -1- AC_SUBST([PRINTQDILIBF])
+m4trace:configure.ac:4552: -1- AC_SUBST_TRACE([PRINTQDILIBF])
+m4trace:configure.ac:4552: -1- m4_pattern_allow([^PRINTQDILIBF$])
+m4trace:configure.ac:4553: -1- AC_SUBST([PRINTQDILIBS])
+m4trace:configure.ac:4553: -1- AC_SUBST_TRACE([PRINTQDILIBS])
+m4trace:configure.ac:4553: -1- m4_pattern_allow([^PRINTQDILIBS$])
+m4trace:configure.ac:4554: -1- AC_SUBST([PRINTQDALIBF])
+m4trace:configure.ac:4554: -1- AC_SUBST_TRACE([PRINTQDALIBF])
+m4trace:configure.ac:4554: -1- m4_pattern_allow([^PRINTQDALIBF$])
+m4trace:configure.ac:4555: -1- AC_SUBST([PRINTQDALIBS])
+m4trace:configure.ac:4555: -1- AC_SUBST_TRACE([PRINTQDALIBS])
+m4trace:configure.ac:4555: -1- m4_pattern_allow([^PRINTQDALIBS$])
+m4trace:configure.ac:4556: -1- AC_SUBST([PJSNMPLIBF])
+m4trace:configure.ac:4556: -1- AC_SUBST_TRACE([PJSNMPLIBF])
+m4trace:configure.ac:4556: -1- m4_pattern_allow([^PJSNMPLIBF$])
+m4trace:configure.ac:4557: -1- AC_SUBST([PJSNMPLIBS])
+m4trace:configure.ac:4557: -1- AC_SUBST_TRACE([PJSNMPLIBS])
+m4trace:configure.ac:4557: -1- m4_pattern_allow([^PJSNMPLIBS$])
+m4trace:configure.ac:4558: -1- AC_SUBST([PRMONSNMPLIBF])
+m4trace:configure.ac:4558: -1- AC_SUBST_TRACE([PRMONSNMPLIBF])
+m4trace:configure.ac:4558: -1- m4_pattern_allow([^PRMONSNMPLIBF$])
+m4trace:configure.ac:4559: -1- AC_SUBST([PRMONSNMPLIBS])
+m4trace:configure.ac:4559: -1- AC_SUBST_TRACE([PRMONSNMPLIBS])
+m4trace:configure.ac:4559: -1- m4_pattern_allow([^PRMONSNMPLIBS$])
+m4trace:configure.ac:4560: -1- AC_SUBST([PRINTQDCLIBF])
+m4trace:configure.ac:4560: -1- AC_SUBST_TRACE([PRINTQDCLIBF])
+m4trace:configure.ac:4560: -1- m4_pattern_allow([^PRINTQDCLIBF$])
+m4trace:configure.ac:4561: -1- AC_SUBST([PRINTQDCLIBS])
+m4trace:configure.ac:4561: -1- AC_SUBST_TRACE([PRINTQDCLIBS])
+m4trace:configure.ac:4561: -1- m4_pattern_allow([^PRINTQDCLIBS$])
+m4trace:configure.ac:4562: -1- AC_SUBST([RSHDOWNLIBF])
+m4trace:configure.ac:4562: -1- AC_SUBST_TRACE([RSHDOWNLIBF])
+m4trace:configure.ac:4562: -1- m4_pattern_allow([^RSHDOWNLIBF$])
+m4trace:configure.ac:4563: -1- AC_SUBST([RSHDOWNLIBS])
+m4trace:configure.ac:4563: -1- AC_SUBST_TRACE([RSHDOWNLIBS])
+m4trace:configure.ac:4563: -1- m4_pattern_allow([^RSHDOWNLIBS$])
+m4trace:configure.ac:4564: -1- AC_SUBST([LPRNGCLLIBF])
+m4trace:configure.ac:4564: -1- AC_SUBST_TRACE([LPRNGCLLIBF])
+m4trace:configure.ac:4564: -1- m4_pattern_allow([^LPRNGCLLIBF$])
+m4trace:configure.ac:4565: -1- AC_SUBST([LPRNGCLLIBS])
+m4trace:configure.ac:4565: -1- AC_SUBST_TRACE([LPRNGCLLIBS])
+m4trace:configure.ac:4565: -1- m4_pattern_allow([^LPRNGCLLIBS$])
+m4trace:configure.ac:4566: -1- AC_SUBST([ITADMINLIBF])
+m4trace:configure.ac:4566: -1- AC_SUBST_TRACE([ITADMINLIBF])
+m4trace:configure.ac:4566: -1- m4_pattern_allow([^ITADMINLIBF$])
+m4trace:configure.ac:4567: -1- AC_SUBST([ITADMINLIBS])
+m4trace:configure.ac:4567: -1- AC_SUBST_TRACE([ITADMINLIBS])
+m4trace:configure.ac:4567: -1- m4_pattern_allow([^ITADMINLIBS$])
+m4trace:configure.ac:4568: -1- AC_SUBST([GETSOURCE])
+m4trace:configure.ac:4568: -1- AC_SUBST_TRACE([GETSOURCE])
+m4trace:configure.ac:4568: -1- m4_pattern_allow([^GETSOURCE$])
+m4trace:configure.ac:4572: -1- AC_SUBST([ADDCTRLDRES])
+m4trace:configure.ac:4572: -1- AC_SUBST_TRACE([ADDCTRLDRES])
+m4trace:configure.ac:4572: -1- m4_pattern_allow([^ADDCTRLDRES$])
+m4trace:configure.ac:4573: -1- AC_SUBST([BMPPRES])
+m4trace:configure.ac:4573: -1- AC_SUBST_TRACE([BMPPRES])
+m4trace:configure.ac:4573: -1- m4_pattern_allow([^BMPPRES$])
+m4trace:configure.ac:4574: -1- AC_SUBST([DK3INFORES])
+m4trace:configure.ac:4574: -1- AC_SUBST_TRACE([DK3INFORES])
+m4trace:configure.ac:4574: -1- m4_pattern_allow([^DK3INFORES$])
+m4trace:configure.ac:4575: -1- AC_SUBST([DK4INFORES])
+m4trace:configure.ac:4575: -1- AC_SUBST_TRACE([DK4INFORES])
+m4trace:configure.ac:4575: -1- m4_pattern_allow([^DK4INFORES$])
+m4trace:configure.ac:4576: -1- AC_SUBST([DKBIN2CRES])
+m4trace:configure.ac:4576: -1- AC_SUBST_TRACE([DKBIN2CRES])
+m4trace:configure.ac:4576: -1- m4_pattern_allow([^DKBIN2CRES$])
+m4trace:configure.ac:4577: -1- AC_SUBST([DKBLKSRES])
+m4trace:configure.ac:4577: -1- AC_SUBST_TRACE([DKBLKSRES])
+m4trace:configure.ac:4577: -1- m4_pattern_allow([^DKBLKSRES$])
+m4trace:configure.ac:4578: -1- AC_SUBST([DKBMMRES])
+m4trace:configure.ac:4578: -1- AC_SUBST_TRACE([DKBMMRES])
+m4trace:configure.ac:4578: -1- m4_pattern_allow([^DKBMMRES$])
+m4trace:configure.ac:4579: -1- AC_SUBST([DKCATRES])
+m4trace:configure.ac:4579: -1- AC_SUBST_TRACE([DKCATRES])
+m4trace:configure.ac:4579: -1- m4_pattern_allow([^DKCATRES$])
+m4trace:configure.ac:4580: -1- AC_SUBST([DKCTRES])
+m4trace:configure.ac:4580: -1- AC_SUBST_TRACE([DKCTRES])
+m4trace:configure.ac:4580: -1- m4_pattern_allow([^DKCTRES$])
+m4trace:configure.ac:4581: -1- AC_SUBST([DKDB2TRES])
+m4trace:configure.ac:4581: -1- AC_SUBST_TRACE([DKDB2TRES])
+m4trace:configure.ac:4581: -1- m4_pattern_allow([^DKDB2TRES$])
+m4trace:configure.ac:4582: -1- AC_SUBST([DKDBCORES])
+m4trace:configure.ac:4582: -1- AC_SUBST_TRACE([DKDBCORES])
+m4trace:configure.ac:4582: -1- m4_pattern_allow([^DKDBCORES$])
+m4trace:configure.ac:4583: -1- AC_SUBST([DKDBTRES])
+m4trace:configure.ac:4583: -1- AC_SUBST_TRACE([DKDBTRES])
+m4trace:configure.ac:4583: -1- m4_pattern_allow([^DKDBTRES$])
+m4trace:configure.ac:4584: -1- AC_SUBST([DKERADISKRES])
+m4trace:configure.ac:4584: -1- AC_SUBST_TRACE([DKERADISKRES])
+m4trace:configure.ac:4584: -1- m4_pattern_allow([^DKERADISKRES$])
+m4trace:configure.ac:4585: -1- AC_SUBST([DKFICRES])
+m4trace:configure.ac:4585: -1- AC_SUBST_TRACE([DKFICRES])
+m4trace:configure.ac:4585: -1- m4_pattern_allow([^DKFICRES$])
+m4trace:configure.ac:4586: -1- AC_SUBST([DKHEXRES])
+m4trace:configure.ac:4586: -1- AC_SUBST_TRACE([DKHEXRES])
+m4trace:configure.ac:4586: -1- m4_pattern_allow([^DKHEXRES$])
+m4trace:configure.ac:4587: -1- AC_SUBST([DKLINESRES])
+m4trace:configure.ac:4587: -1- AC_SUBST_TRACE([DKLINESRES])
+m4trace:configure.ac:4587: -1- m4_pattern_allow([^DKLINESRES$])
+m4trace:configure.ac:4588: -1- AC_SUBST([DKLSRES])
+m4trace:configure.ac:4588: -1- AC_SUBST_TRACE([DKLSRES])
+m4trace:configure.ac:4588: -1- m4_pattern_allow([^DKLSRES$])
+m4trace:configure.ac:4589: -1- AC_SUBST([DKPWDRES])
+m4trace:configure.ac:4589: -1- AC_SUBST_TRACE([DKPWDRES])
+m4trace:configure.ac:4589: -1- m4_pattern_allow([^DKPWDRES$])
+m4trace:configure.ac:4590: -1- AC_SUBST([DKPWGENRES])
+m4trace:configure.ac:4590: -1- AC_SUBST_TRACE([DKPWGENRES])
+m4trace:configure.ac:4590: -1- m4_pattern_allow([^DKPWGENRES$])
+m4trace:configure.ac:4591: -1- AC_SUBST([DKRANDRES])
+m4trace:configure.ac:4591: -1- AC_SUBST_TRACE([DKRANDRES])
+m4trace:configure.ac:4591: -1- m4_pattern_allow([^DKRANDRES$])
+m4trace:configure.ac:4592: -1- AC_SUBST([DKRECVRES])
+m4trace:configure.ac:4592: -1- AC_SUBST_TRACE([DKRECVRES])
+m4trace:configure.ac:4592: -1- m4_pattern_allow([^DKRECVRES$])
+m4trace:configure.ac:4593: -1- AC_SUBST([DKSENDRES])
+m4trace:configure.ac:4593: -1- AC_SUBST_TRACE([DKSENDRES])
+m4trace:configure.ac:4593: -1- m4_pattern_allow([^DKSENDRES$])
+m4trace:configure.ac:4594: -1- AC_SUBST([DKSORTRES])
+m4trace:configure.ac:4594: -1- AC_SUBST_TRACE([DKSORTRES])
+m4trace:configure.ac:4594: -1- m4_pattern_allow([^DKSORTRES$])
+m4trace:configure.ac:4595: -1- AC_SUBST([DKSQLSPLITRES])
+m4trace:configure.ac:4595: -1- AC_SUBST_TRACE([DKSQLSPLITRES])
+m4trace:configure.ac:4595: -1- m4_pattern_allow([^DKSQLSPLITRES$])
+m4trace:configure.ac:4596: -1- AC_SUBST([DKT2DBRES])
+m4trace:configure.ac:4596: -1- AC_SUBST_TRACE([DKT2DBRES])
+m4trace:configure.ac:4596: -1- m4_pattern_allow([^DKT2DBRES$])
+m4trace:configure.ac:4597: -1- AC_SUBST([DKT2HRES])
+m4trace:configure.ac:4597: -1- AC_SUBST_TRACE([DKT2HRES])
+m4trace:configure.ac:4597: -1- m4_pattern_allow([^DKT2HRES$])
+m4trace:configure.ac:4598: -1- AC_SUBST([DKT2LRES])
+m4trace:configure.ac:4598: -1- AC_SUBST_TRACE([DKT2LRES])
+m4trace:configure.ac:4598: -1- m4_pattern_allow([^DKT2LRES$])
+m4trace:configure.ac:4599: -1- AC_SUBST([DKWTADMRES])
+m4trace:configure.ac:4599: -1- AC_SUBST_TRACE([DKWTADMRES])
+m4trace:configure.ac:4599: -1- m4_pattern_allow([^DKWTADMRES$])
+m4trace:configure.ac:4600: -1- AC_SUBST([DKWTRES])
+m4trace:configure.ac:4600: -1- AC_SUBST_TRACE([DKWTRES])
+m4trace:configure.ac:4600: -1- m4_pattern_allow([^DKWTRES$])
+m4trace:configure.ac:4601: -1- AC_SUBST([DKWXPATHRES])
+m4trace:configure.ac:4601: -1- AC_SUBST_TRACE([DKWXPATHRES])
+m4trace:configure.ac:4601: -1- m4_pattern_allow([^DKWXPATHRES$])
+m4trace:configure.ac:4602: -1- AC_SUBST([DKWXWIZRES])
+m4trace:configure.ac:4602: -1- AC_SUBST_TRACE([DKWXWIZRES])
+m4trace:configure.ac:4602: -1- m4_pattern_allow([^DKWXWIZRES$])
+m4trace:configure.ac:4603: -1- AC_SUBST([FIG2LATRES])
+m4trace:configure.ac:4603: -1- AC_SUBST_TRACE([FIG2LATRES])
+m4trace:configure.ac:4603: -1- m4_pattern_allow([^FIG2LATRES$])
+m4trace:configure.ac:4604: -1- AC_SUBST([HTMLBOOKRES])
+m4trace:configure.ac:4604: -1- AC_SUBST_TRACE([HTMLBOOKRES])
+m4trace:configure.ac:4604: -1- m4_pattern_allow([^HTMLBOOKRES$])
+m4trace:configure.ac:4605: -1- AC_SUBST([ITADMINRES])
+m4trace:configure.ac:4605: -1- AC_SUBST_TRACE([ITADMINRES])
+m4trace:configure.ac:4605: -1- m4_pattern_allow([^ITADMINRES$])
+m4trace:configure.ac:4606: -1- AC_SUBST([LPRNGCLRES])
+m4trace:configure.ac:4606: -1- AC_SUBST_TRACE([LPRNGCLRES])
+m4trace:configure.ac:4606: -1- m4_pattern_allow([^LPRNGCLRES$])
+m4trace:configure.ac:4607: -1- AC_SUBST([PLPDFTEXRES])
+m4trace:configure.ac:4607: -1- AC_SUBST_TRACE([PLPDFTEXRES])
+m4trace:configure.ac:4607: -1- m4_pattern_allow([^PLPDFTEXRES$])
+m4trace:configure.ac:4608: -1- AC_SUBST([WINPRINTRES])
+m4trace:configure.ac:4608: -1- AC_SUBST_TRACE([WINPRINTRES])
+m4trace:configure.ac:4608: -1- m4_pattern_allow([^WINPRINTRES$])
+m4trace:configure.ac:4609: -1- AC_SUBST([WPRCLEANRES])
+m4trace:configure.ac:4609: -1- AC_SUBST_TRACE([WPRCLEANRES])
+m4trace:configure.ac:4609: -1- m4_pattern_allow([^WPRCLEANRES$])
+m4trace:configure.ac:4610: -1- AC_SUBST([WXBMPPRES])
+m4trace:configure.ac:4610: -1- AC_SUBST_TRACE([WXBMPPRES])
+m4trace:configure.ac:4610: -1- m4_pattern_allow([^WXBMPPRES$])
+m4trace:configure.ac:4611: -1- AC_SUBST([WXDKCLOCKRES])
+m4trace:configure.ac:4611: -1- AC_SUBST_TRACE([WXDKCLOCKRES])
+m4trace:configure.ac:4611: -1- m4_pattern_allow([^WXDKCLOCKRES$])
+m4trace:configure.ac:4612: -1- AC_SUBST([WXDKCTRES])
+m4trace:configure.ac:4612: -1- AC_SUBST_TRACE([WXDKCTRES])
+m4trace:configure.ac:4612: -1- m4_pattern_allow([^WXDKCTRES$])
+m4trace:configure.ac:4613: -1- AC_SUBST([WXDKFCSRES])
+m4trace:configure.ac:4613: -1- AC_SUBST_TRACE([WXDKFCSRES])
+m4trace:configure.ac:4613: -1- m4_pattern_allow([^WXDKFCSRES$])
+m4trace:configure.ac:4614: -1- AC_SUBST([WXDKHTBRES])
+m4trace:configure.ac:4614: -1- AC_SUBST_TRACE([WXDKHTBRES])
+m4trace:configure.ac:4614: -1- m4_pattern_allow([^WXDKHTBRES$])
+m4trace:configure.ac:4615: -1- AC_SUBST([WXDKSCRSZRES])
+m4trace:configure.ac:4615: -1- AC_SUBST_TRACE([WXDKSCRSZRES])
+m4trace:configure.ac:4615: -1- m4_pattern_allow([^WXDKSCRSZRES$])
+m4trace:configure.ac:4616: -1- AC_SUBST([WXIMGSZRES])
+m4trace:configure.ac:4616: -1- AC_SUBST_TRACE([WXIMGSZRES])
+m4trace:configure.ac:4616: -1- m4_pattern_allow([^WXIMGSZRES$])
+m4trace:configure.ac:4617: -1- AC_SUBST([WXPQDICRES])
+m4trace:configure.ac:4617: -1- AC_SUBST_TRACE([WXPQDICRES])
+m4trace:configure.ac:4617: -1- m4_pattern_allow([^WXPQDICRES$])
+m4trace:configure.ac:4619: -1- AC_SUBST([LIBSPRIVATE])
+m4trace:configure.ac:4619: -1- AC_SUBST_TRACE([LIBSPRIVATE])
+m4trace:configure.ac:4619: -1- m4_pattern_allow([^LIBSPRIVATE$])
+m4trace:configure.ac:4620: -1- AC_SUBST([systemddir])
+m4trace:configure.ac:4620: -1- AC_SUBST_TRACE([systemddir])
+m4trace:configure.ac:4620: -1- m4_pattern_allow([^systemddir$])
+m4trace:configure.ac:4621: -1- AC_SUBST([SUITE])
+m4trace:configure.ac:4621: -1- AC_SUBST_TRACE([SUITE])
+m4trace:configure.ac:4621: -1- m4_pattern_allow([^SUITE$])
+m4trace:configure.ac:4622: -1- AC_SUBST([THISYEAR])
+m4trace:configure.ac:4622: -1- AC_SUBST_TRACE([THISYEAR])
+m4trace:configure.ac:4622: -1- m4_pattern_allow([^THISYEAR$])
+m4trace:configure.ac:4634: -1- AC_CONFIG_FILES([Makefile scripts/write-files.sh scripts/build-help.sh initd-printqd initd-rshdown dktools.pc pkginfo debian/control debian/control9 debian/control8 debian/printqd.postrm debian/printqd.postinst debian/rshdown.postrm])
+m4trace:configure.ac:4634: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
You should run autoupdate.], [])
-m4trace:configure.ac:3241: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
-m4trace:configure.ac:3241: -1- m4_pattern_allow([^LIB@&t@OBJS$])
-m4trace:configure.ac:3241: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([LTLIBOBJS])
-m4trace:configure.ac:3241: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([top_builddir])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([top_build_prefix])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([srcdir])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([abs_srcdir])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([top_srcdir])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([abs_top_srcdir])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([builddir])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([abs_builddir])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([abs_top_builddir])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([INSTALL])
-m4trace:configure.ac:3241: -1- AC_SUBST_TRACE([MKDIR_P])
+m4trace:configure.ac:4634: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
+m4trace:configure.ac:4634: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:4634: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([LTLIBOBJS])
+m4trace:configure.ac:4634: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([top_builddir])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([top_build_prefix])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([srcdir])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([abs_srcdir])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([top_srcdir])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([abs_top_srcdir])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([builddir])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([abs_builddir])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([abs_top_builddir])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([INSTALL])
+m4trace:configure.ac:4634: -1- AC_SUBST_TRACE([MKDIR_P])
diff --git a/support/dktools/bif.h b/support/dktools/bif.h
new file mode 100644
index 0000000000..3f809a2e8d
--- /dev/null
+++ b/support/dktools/bif.h
@@ -0,0 +1,714 @@
+/*
+Copyright 2019-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+#ifndef BIF_H_INCLUDED
+/** Protection against multiple inclusion. */
+#define BIF_H_INCLUDED 1
+
+/** @file bif.h Library-internal function prototypes.
+
+This header contains functions used cross-module within the library
+but not part of the API and thus not intended for use by a
+library consumer.
+
+Consequently this file is not installed to /usr/include or some similar
+directory.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#if DK4_HAVE_PNG_H
+#ifndef PNG_H_INCLUDED
+#include <png.h>
+#define PNG_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_JPEGLIB_H
+#ifndef JPEGLIB_H_INCLUDED
+#include <jpeglib.h>
+#define JPEGLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_TIFF_H
+#ifndef TIFF_H_INCLUDED
+#include <tiff.h>
+#define TIFF_H_INCLUDED 1
+#endif
+#ifndef TIFFIO_H_INCLUDED
+#include <tiffio.h>
+#define TIFFIO_H_INCLUDED 1
+#endif
+#endif
+
+
+
+/** NetPBM magic numbers (file types).
+*/
+enum {
+ /** Plain PBM.
+ */
+ DK4_NETPBM_P1 = 0,
+
+ /** Plain PGM.
+ */
+ DK4_NETPBM_P2 ,
+
+ /** Plain PPM (RGB).
+ */
+ DK4_NETPBM_P3 ,
+
+ /** New PBM.
+ */
+ DK4_NETPBM_P4 ,
+
+ /** New PGM.
+ */
+ DK4_NETPBM_P5 ,
+
+ /** New PPM (RGB).
+ */
+ DK4_NETPBM_P6 ,
+
+ /** PAM (any map).
+ */
+ DK4_NETPBM_P7
+};
+
+
+
+/** NetPBM P7 tuple types.
+*/
+enum {
+ /** Black and white.
+ */
+ DK4_NETPBM_TT_BLACKANDWHITE = 0 ,
+
+ /** Grayscale.
+ */
+ DK4_NETPBM_TT_GRAYSCALE ,
+
+ /** RGB.
+ */
+ DK4_NETPBM_TT_RGB ,
+
+ /** Black and white with alpha channel.
+ */
+ DK4_NETPBM_TT_BLACKANDWHITE_ALPHA ,
+
+ /** Grayscale with alpha channel.
+ */
+ DK4_NETPBM_TT_GRAYSCALE_ALPHA ,
+
+ /** RGB with alpha channel.
+ */
+ DK4_NETPBM_TT_RGB_ALPHA
+};
+
+
+
+/** Data to store per frame for PNG.
+*/
+typedef struct {
+#if DK4_HAVE_SETJMP_H
+ jmp_buf jump_buf; /**< Buffer for long jump. */
+#endif
+ png_bytep *rows; /**< Data for image rows. */
+ double dblxdpi; /**< X resolution. */
+ double dblydpi; /**< Y resolution. */
+ png_size_t rowbytes; /**< Bytes per row. */
+ png_uint_32 w; /**< Image width. */
+ png_uint_32 h; /**< Image height. */
+ png_uint_32 xdpi; /**< X resolution. */
+ png_uint_32 ydpi; /**< Y resolution. */
+ int ct; /**< Color type. */
+ int im; /**< Interlace method. */
+ int cm; /**< Compression method. */
+ int fm; /**< Filter method. */
+ int ch; /**< Number of channels. */
+ int ip; /**< Number of interlace passes. */
+ int bd; /**< Bit depth (bits per component). */
+ int had_error; /**< Error flag: 0=none, 1=warning, 2=error. */
+} dk4_bif_png_per_frame_t;
+
+
+
+/** Data to store per frame for JPEG.
+*/
+typedef struct {
+ JSAMPLE **rows; /**< Image pixel data. */
+ size_t num_comp; /**< Number of components per pixel. */
+ short is_adobe; /**< Flag: Adobe marker found. */
+} dk4_bif_jpeg_per_frame_t;
+
+
+
+/** Data to store per frame for TIFF.
+*/
+typedef struct {
+ uint32 *rows; /**< Data rows. */
+} dk4_bif_tiff_per_frame_t;
+
+
+
+/** Data to store per frame for NetPBM.
+*/
+typedef struct {
+ unsigned char **rows; /**< Data rows. */
+ dk4_bif_dim_t w; /**< Image width. */
+ dk4_bif_dim_t h; /**< Image height. */
+ size_t ch; /**< Number of channels. */
+ size_t vpr; /**< Number of values per row. */
+ size_t bpr; /**< Number of bytes per row. */
+ int magnum; /**< Magic number 1-7 (P1-P7). */
+ int tupt; /**< Tuple type for P7. */
+ dk4_px_t maxval; /**< Maximum value. */
+ dk4_px_bit_depth_t bpc; /**< Bits per component. */
+} dk4_bif_netpbm_per_frame_t;
+
+
+
+/** Structure containing values proably clobbered by longjmp for PNG.
+*/
+typedef struct {
+ dk4_bif_t *back;
+ dk4_bif_png_per_frame_t *pfrpng;
+ int ok;
+} dk4_bif_png_clobbered_t;
+
+
+/** Structure containing values probably clobbered by longjmp for JPEG.
+*/
+typedef struct {
+ dk4_bif_t *back; /**< Function result. */
+ int st; /**< Reader state. */
+ int ok; /**< Flag to indicate success. */
+} dk4_bif_jpg_clobbered_t;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Module dk4bif
+ -------------
+*/
+
+
+/** Retrieve original pixel data for one pixel in original color space
+ and bit depth, without checking arguments for validity before.
+ This function is intended for library-internal use only, application
+ programs should not use it directly.
+ @param dptr Address of destination array, must be large enough.
+ @param szdptr Size of dptr array (number of elements).
+ @param bif Bitmap image file.
+ @param rowno Row number (0 for top row).
+ @param colno Column number (0 for left column).
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+);
+
+
+/** Retrieve data for one pixel in the required output bit depth
+ and color space, without checking arguments for validity before.
+ This function is intended for library-internal use only, application
+ programs should not use it directly.
+ @param dptr Address of destination array, must be large enough.
+ @param szdptr Size of dptr array (number of elements).
+ @param bif Bitmap image file.
+ @param rowno Row number (0 for top row).
+ @param colno Column number (0 for left column).
+ @param cs Required color space.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_nc_get_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno,
+ int cs
+);
+
+
+/* Module dk4cs
+ ------------
+*/
+
+/** Convert pixel data from one color space into another, without
+ checking arguments for validity before.
+ This function is intended for library-internal use only, application
+ programs should not use it directly.
+ @param dptr Address of destination array.
+ @param dcs Destination color space.
+ @param dsz Size of destination array (number of elements).
+ @param sptr Address of source array.
+ @param scs Source color space.
+ @param ssz Source array size (number of elements).
+ @param bptr Address of background array, may be NULL.
+ @param bsz Size of background array (number of elements), may be 0.
+ @param max Maximum value for a component.
+ @param pctx Conversion context, may be NULL.
+*/
+
+void
+dk4cs_nc_px_convert(
+ dk4_px_t *dptr,
+ int dcs,
+ dk4_px_t const *sptr,
+ int scs,
+ dk4_px_t const *bptr,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx
+);
+
+
+/** Convert pixel data from one color space into another without
+ checking arguments before.
+ This function is intended for library-internal use only, application
+ programs should not use it directly.
+ @param dptr Address of destination array, values in interval [0;1].
+ @param dcs Destination color space.
+ @param dsz Size of destination array (number of elements).
+ @param sptr Address of source array, values in interval [0;1].
+ @param scs Source color space.
+ @param ssz Source array size (number of elements).
+ @param bptr Address of background array, values in [0;1], may be NULL.
+ @param bsz Size of background array (number of elements), may be 0.
+ @param pctx Conversion context, may be NULL.
+*/
+
+void
+dk4cs_nc_color_convert(
+ double *dptr,
+ int dcs,
+ double const *sptr,
+ int scs,
+ double const *bptr,
+ dk4_cs_conv_ctx_t const *pctx
+);
+
+
+/* Module dk4bifp
+ --------------
+*/
+
+#if DK4_HAVE_PNG_H
+
+/** Release per-frame data for PNG.
+ @param tsdata Data to release.
+*/
+
+void
+dk4bifpng_nc_release_per_frame_data(
+ void *tsdata
+);
+
+
+/** Release per-file data for PNG.
+ @param tsdata Data to release.
+*/
+
+void
+dk4bifpng_nc_release_per_file_data(
+ void *tsdata
+);
+
+
+/** Open PNG file.
+ @param fipo File, opened for binary reading.
+ @param fn File name containing the bitmap image.
+ @param honly Flag: Read image header only, no image data.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+*/
+
+dk4_bif_t *
+dk4bifpng_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_bif_png_clobbered_t *pngcp,
+ dk4_er_t *erp
+);
+
+
+/** Retrieve original data for one pixel, without checking arguments
+ for validity before.
+ This function is intended for library-internal use only, application
+ programs should not use it directly.
+ @param dptr Address of destination array, must be large enough.
+ @param szdptr Size of dptr array (number of elements).
+ @param bif Bitmap image file.
+ @param rowno Row number (0 for top row).
+ @param colno Column number (0 for left column).
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bifpng_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+);
+
+
+#endif
+/* if DK4_HAVE_PNG_H */
+
+
+/* Module dk4bifj
+ --------------
+*/
+
+#if DK4_HAVE_JPEGLIB_H
+
+/** Release per-frame data for JPEG.
+ @param tsdata Data to release.
+ @param frptr Frame the data belongs to.
+*/
+
+void
+dk4bifjpeg_nc_release_per_frame_data(
+ void *tsdata,
+ dk4_bif_frame_t *frptr
+);
+
+
+#if 0
+/* No per-file data stored for JPEG */
+
+/** Release per-file data for JPEG.
+ @param tsdata Data to release.
+*/
+
+void
+dk4bifjpeg_nc_release_per_file_data(
+ void *tsdata
+);
+
+#endif
+
+/** Open JPEG file.
+ @param fipo File, opened for binary reading.
+ @param fn File name containing the bitmap image.
+ @param honly Flag: Read image header only, no image data.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param jpgcp Structure containing variables which would
+ be clobbered by longjmp if they were local.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+*/
+
+dk4_bif_t *
+dk4bifjpeg_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_bif_jpg_clobbered_t *jpgcp,
+ dk4_er_t *erp
+);
+
+
+/** Retrieve original data for one pixel, without checking arguments
+ for validity before.
+ This function is intended for library-internal use only, application
+ programs should not use it directly.
+ @param dptr Address of destination array, must be large enough.
+ @param szdptr Size of dptr array (number of elements).
+ @param bif Bitmap image file.
+ @param rowno Row number (0 for top row).
+ @param colno Column number (0 for left column).
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bifjpeg_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+);
+
+#endif
+/* if DK4_HAVE_JPEGLIB_H */
+
+
+/* Module dk4bift
+ --------------
+*/
+
+#if DK4_HAVE_TIFF_H
+
+/** Release per-frame data for TIFF.
+ @param tsdata Data to release.
+*/
+
+void
+dk4biftiff_nc_release_per_frame_data(
+ void *tsdata
+);
+
+
+#if 0
+/* No per-file data stored for TIFF */
+
+/** Release per-file data for TIFF.
+ @param tsdata Data to release.
+*/
+
+void
+dk4biftiff_nc_release_per_file_data(
+ void *tsdata
+);
+
+#endif
+
+
+/** Open TIFF file.
+ @param fn File name containing the bitmap image.
+ @param honly Flag: Read image header only, no image data.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+*/
+
+dk4_bif_t *
+dk4biftiff_nc_open_type(
+ dkChar const *fn,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/** Retrieve original data for one pixel, without checking arguments
+ for validity before.
+ This function is intended for library-internal use only, application
+ programs should not use it directly.
+ @param dptr Address of destination array, must be large enough.
+ @param szdptr Size of dptr array (number of elements).
+ @param bif Bitmap image file.
+ @param rowno Row number (0 for top row).
+ @param colno Column number (0 for left column).
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4biftiff_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+);
+
+#endif
+/* if DK4_HAVE_TIFF_H */
+
+
+
+/* Module di4bifn
+ --------------
+*/
+
+/** Open NetPBM file.
+ @param fn File name containing the bitmap image.
+ @param honly Flag: Read image header only, no image data.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+*/
+
+dk4_bif_t *
+dk4bifnetpbm_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/* Module dk4bifto
+ ---------------
+*/
+
+
+/** Initialize a newly allocated image file structure.
+ @param bptr Bitmap image file structure to initialize.
+ @param fn File name, may be NULL.
+ @param ty Bitmap image type.
+ @param honly Flag: Read header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if elsize or nelem is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the
+ product of elsize and nelem,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem
+ set if there is not enough memory available.
+*/
+
+int
+dk4biftool_nc_bif_init(
+ dk4_bif_t *bptr,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/** Initialize newly allocated frame structure.
+ @param fptr Frame to initialize.
+*/
+
+void
+dk4biftool_nc_frame_init(
+ dk4_bif_frame_t *fptr
+);
+
+
+/** Add new frame to bitmap image file structure.
+ On success, make the new frame the current frame.
+ @param bptr Bitmap image file.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if elsize or nelem is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the
+ product of elsize and nelem, or if there are too many frames in the
+ image,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem
+ set if there is not enough memory available.
+*/
+
+int
+dk4biftool_nc_add_frame(
+ dk4_bif_t *bptr,
+ dk4_er_t *erp
+);
+
+
+/** Create new image file structure for a file containing one frame.
+ @param fn File name.
+ @param ty Image file type.
+ @param honly Flag: Read header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if elsize or nelem is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the
+ product of elsize and nelem, or if there are too many frames in the
+ image,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem
+ set if there is not enough memory available.
+*/
+
+dk4_bif_t *
+dk4biftool_nc_new_for_one_frame(
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/*
+ Module dk4bifbp
+ ---------------
+*/
+
+
+/** Retrieve value from a packed bits array.
+ @param buffer Array address.
+ @param elin Index of element to retrieve.
+ @param bd Bit depth of each element: 1, 2, 4, 8 or 16.
+ @param nbytes Number of bytes in the buffer.
+ @return Element value, 0 as fallback for illegal arguments.
+*/
+
+dk4_px_t
+dk4bifpackedbits_get_element(
+ unsigned char const *buffer,
+ size_t elin,
+ size_t bd,
+ size_t nbytes
+);
+
+
+/** Release per-frame data for TIFF.
+ @param tsdata Data to release.
+*/
+
+void
+dk4bifnetpbm_nc_release_per_frame_data(
+ void *tsdata
+);
+
+
+/** Retrieve original pixel data for one pixel in original color space
+ and bit depth, without checking arguments for validity before.
+ This function is intended for library-internal use only, application
+ programs should not use it directly.
+ @param dptr Address of destination array, must be large enough.
+ @param szdptr Size of dptr array (number of elements).
+ @param bif Bitmap image file.
+ @param rowno Row number (0 for top row).
+ @param colno Column number (0 for left column).
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bifnetpbm_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+#endif
+
diff --git a/support/dktools/bild-neu.pdf b/support/dktools/bild-neu.pdf
new file mode 100644
index 0000000000..65113d74e8
--- /dev/null
+++ b/support/dktools/bild-neu.pdf
Binary files differ
diff --git a/support/dktools/bild-neu.tex b/support/dktools/bild-neu.tex
new file mode 100644
index 0000000000..caefae234c
--- /dev/null
+++ b/support/dktools/bild-neu.tex
@@ -0,0 +1,25 @@
+\begin{picture}(0,0)
+\includegraphics{bild-neu.pdf}
+\end{picture}%
+\setlength{\unitlength}{1bp}%
+\begin{picture}(387,320)
+\put(58.5,36.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}TIFF}}}}%
+\put(58.5,63.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}JPEG}}}}%
+\put(58.5,90.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}PNG}}}}%
+\put(58.5,180.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}EPS}}}}%
+\put(148.5,180.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}PDF}}}}%
+\put(265.5,180.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}plain SVG}}}}%
+\put(265.5,90.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}ICO}}}}%
+\put(265.5,63.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}XPM}}}}%
+\put(328.5,279.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}Inkscape SVG}}}}%
+\put(58.5,279.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}WXD}}}}%
+\put(148.5,279.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}Fig}}}}%
+\put(238.5,279.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}GnuPlot}}}}%
+\put(63,234.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}LaTeX document}}}}%
+\put(216,234.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0,0}LaTeX image}}}}%
+\put(76.5,130.75){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0.560784,0}Web}}}}%
+\put(292.5,234.25){\makebox(0,0)[b]{\smash{{\color[rgb]{0,0.560784,0}LaTeX}}}}%
+\put(9,9.25){\makebox(0,0)[lb]{\smash{{\color[rgb]{0.690196,0,0}Bitmap graphics files}}}}%
+\put(315,36.25){\makebox(0,0)[rb]{\smash{{\color[rgb]{0.690196,0,0}Special purpose bitmap graphics files}}}}%
+\put(378,306.25){\makebox(0,0)[rb]{\smash{{\color[rgb]{0.690196,0,0}Vector graphics source files}}}}%
+\end{picture}%
diff --git a/support/dktools/blubb.wxd b/support/dktools/blubb.wxd
new file mode 100644
index 0000000000..d0b0dc041b
--- /dev/null
+++ b/support/dktools/blubb.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 130048000 0 73152000
+2 0 0 0 0
+ 0 12 0 1 40640000 48768000 0
+ Palim Palim
+ Palimchen
+2 0 0 0 0
+ 0 12 0 1 56896000 48768000 0
+ Palubb Palubb
+ Blubb
+2 0 0 0 0
+ 0 12 0 0 40640000 40640000 0
+ Puff
+
+2 0 0 0 0
+ 0 12 0 0 56896000 40640000 0
+ Paff Peng
+
diff --git a/support/dktools/bmeps3.c b/support/dktools/bmeps3.c
index 52c7fd0632..c39166aab1 100644
--- a/support/dktools/bmeps3.c
+++ b/support/dktools/bmeps3.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: bmeps3.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: bmeps3.ctr
*/
/** @file bmeps3.c The bmeps3 module.
@@ -266,11 +244,11 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net/bmpp.html"),
+dkT("http://sourceforge.net/p/dktools/wiki/bmpp%20manual/"),
dkT("\tThe DK tools and libraries homepage contains more information about"),
dkT("\tbmpp and other programs."),
dkT(""),
-dkT("http://gxhints.sourceforge.net"),
+dkT("http://sourceforge.net/p/gxhints/wiki/Home/"),
dkT("\tThe Graphics Conversion Hints page recommends programs and shows"),
dkT("\tprocedures for conversions between recent vector graphics formats."),
dkT(""),
@@ -371,20 +349,6 @@ NULL
-/** Strings, replaced by localized version.
-*/
-static dkChar const * const bmeps3_message_texts[] = {
-/* 0 */
-dkT(""),
-
-NULL
-
-
-#line 336 "bmeps3.ctr"
-};
-
-
-
/** License overview text.
*/
static dkChar const * const bmeps3_overview_license[] = {
@@ -395,7 +359,7 @@ dkT("This software uses code from the following projects either directly"),
dkT("or as a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net for information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/ for information."),
#if DK3_HAVE_PNG_H
dkT(""),
dkT("libpng\t\tPNG reference library."),
@@ -417,7 +381,7 @@ dkT("zlib\t\tCompression library."),
dkT("\t\tSee http://www.zlib.net/ for information."),
#endif
dkT(""),
-dkT("Your use of the bmpp/wxmbpp program must be in compliance with the"),
+dkT("Your use of the bmpp/wxbmpp program must be in compliance with the"),
dkT("license conditions for the dktools project and the license conditions"),
dkT("for all the libraries used by bmpp."),
dkT(""),
@@ -469,7 +433,7 @@ dkT(""),
NULL
-#line 423 "bmeps3.ctr"
+#line 413 "bmeps3.ctr"
};
#if DK3_HAVE_PNG_H
@@ -591,7 +555,7 @@ dkT("July 9, 2011"),
NULL
-#line 543 "bmeps3.ctr"
+#line 533 "bmeps3.ctr"
};
#endif
#if DK3_HAVE_JPEGLIB_H
@@ -686,7 +650,7 @@ dkT(""),
NULL
-#line 636 "bmeps3.ctr"
+#line 626 "bmeps3.ctr"
};
#endif
#if DK3_HAVE_TIFF_H
@@ -720,7 +684,7 @@ dkT(""),
NULL
-#line 668 "bmeps3.ctr"
+#line 658 "bmeps3.ctr"
};
#endif
#if DK3_HAVE_ZLIB_H
@@ -764,7 +728,7 @@ dkT(""),
NULL
-#line 710 "bmeps3.ctr"
+#line 700 "bmeps3.ctr"
};
#endif
@@ -841,7 +805,7 @@ bmeps3_process_directory(
int back = 0;
-#line 785 "bmeps3.ctr"
+#line 775 "bmeps3.ctr"
msg = dk3app_messages(
app,
dk3bmep_str_get_string_table_name(),
@@ -854,27 +818,27 @@ bmeps3_process_directory(
dir = dk3dir_open_app(fnb, app);
if(dir) {
-#line 796 "bmeps3.ctr"
+#line 786 "bmeps3.ctr"
back = 1;
-#line 797 "bmeps3.ctr"
+#line 787 "bmeps3.ctr"
while(dk3dir_get_next_file(dir)) {
-#line 798 "bmeps3.ctr"
+#line 788 "bmeps3.ctr"
en = dk3dir_get_fullname(dir);
-#line 799 "bmeps3.ctr"
+#line 789 "bmeps3.ctr"
sn = dk3dir_get_shortname(dir);
es = dk3dir_get_stat(dir);
if((en) && (es)) {
-#line 802 "bmeps3.ctr"
+#line 792 "bmeps3.ctr"
if(dk3bif_type_supported(sit = dk3bif_check_file_name(en))) {
-#line 803 "bmeps3.ctr"
+#line 793 "bmeps3.ctr"
if(((es->ft) & (~(DK3_FT_SYMLINK))) == DK3_FT_REGULAR) {
-#line 804 "bmeps3.ctr"
+#line 794 "bmeps3.ctr"
mustrun = 1;
if(bmeo->make) {
if(dk3str_len(en) < DK3_SIZEOF(fni,dkChar)) {
@@ -884,7 +848,7 @@ bmeps3_process_directory(
if(sptr) {
*sptr = dkT('\0');
-#line 812 "bmeps3.ctr"
+#line 802 "bmeps3.ctr"
if((bmeo->dr >= 0) && (bmeo->dr <= 3)) {
nsptr = bmeps3_output_suffixes[bmeo->dr];
if((dk3str_len(fno) + dk3str_len(nsptr))
@@ -893,7 +857,7 @@ bmeps3_process_directory(
{
dk3str_cpy_not_overlapped(sptr, nsptr);
-#line 819 "bmeps3.ctr"
+#line 809 "bmeps3.ctr"
if(dk3sf_stat_app(&stb, fno, NULL)) {
if(stb.mod > es->mod) {
mustrun = 0;
@@ -906,7 +870,7 @@ bmeps3_process_directory(
}
if(mustrun) {
-#line 830 "bmeps3.ctr"
+#line 820 "bmeps3.ctr"
dk3app_log_3(app, DK3_LL_PROGRESS, msg, 41, 42, ((sn) ? sn : en));
dk3app_set_source_file(app, ((sn) ? sn : en));
if(!dk3bm_process_file_name(bmeo,en,sit,0,1000,NULL)) {
@@ -916,20 +880,20 @@ bmeps3_process_directory(
dk3app_log_3(app, DK3_LL_PROGRESS, msg, 43, 44, ((sn) ? sn : en));
} else {
-#line 838 "bmeps3.ctr"
+#line 828 "bmeps3.ctr"
dk3app_log_3(app, DK3_LL_PROGRESS, msg, 45, 46, ((sn) ? sn : en));
}
} else {
-#line 841 "bmeps3.ctr"
+#line 831 "bmeps3.ctr"
}
} else {
-#line 843 "bmeps3.ctr"
+#line 833 "bmeps3.ctr"
}
} else {
-#line 845 "bmeps3.ctr"
+#line 835 "bmeps3.ctr"
back = 0;
/* BUG: Should be handled by dk3dir. */
}
@@ -937,13 +901,13 @@ bmeps3_process_directory(
dk3dir_close(dir);
} else {
-#line 851 "bmeps3.ctr"
+#line 841 "bmeps3.ctr"
/* ERROR: Failed to open directory! */
}
dk3app_set_source_file(app, oldsourcefile);
-#line 855 "bmeps3.ctr"
+#line 845 "bmeps3.ctr"
return back;
}
@@ -1014,15 +978,15 @@ bmeps3_run_with_optset(
int back = 0;
-#line 924 "bmeps3.ctr"
+#line 914 "bmeps3.ctr"
sit = DK3_BIF_IMAGE_TYPE_UNKNOWN;
dk3bmeo_init(&bmeo);
bmeo.app = app;
-#line 927 "bmeps3.ctr"
+#line 917 "bmeps3.ctr"
back = 1;
-#line 928 "bmeps3.ctr"
+#line 918 "bmeps3.ctr"
if(dk3opt_is_set(optset, dkT('l'))) {
larg = dk3opt_get_short_arg(optset, dkT('l'));
if(larg) {
@@ -1036,7 +1000,7 @@ bmeps3_run_with_optset(
}
}
-#line 940 "bmeps3.ctr"
+#line 930 "bmeps3.ctr"
if(dk3opt_is_set(optset, dkT('m'))) {
bmeo.make = 1;
}
@@ -1082,7 +1046,7 @@ bmeps3_run_with_optset(
}
}
-#line 984 "bmeps3.ctr"
+#line 974 "bmeps3.ctr"
if(back) {
if(dk3opt_is_set(optset, dkT('h'))
|| dk3opt_is_set(optset, dkT('v'))
@@ -1107,16 +1071,16 @@ bmeps3_run_with_optset(
}
if(dk3opt_is_set(optset, dkT('h'))) {
dk3sf_initialize_stdout();
- dk3app_help(app, dkT("bmpp.txt"), bmeps3_default_help_text);
+ dk3app_help(app, dkT("bmpp3.txt"), bmeps3_default_help_text);
}
} else {
- dk3bmeo_check(&bmeo, 0, app, NULL);
+ dk3bmeo_check(&bmeo, 0, NULL);
-#line 1012 "bmeps3.ctr"
+#line 1002 "bmeps3.ctr"
numargs = dk3opt_get_num_args(optset);
if(numargs > 0) {
-#line 1014 "bmeps3.ctr"
+#line 1004 "bmeps3.ctr"
for(i = 0; i < numargs; i++) {
larg = dk3opt_get_arg(optset, i);
if(larg) {
@@ -1125,7 +1089,7 @@ bmeps3_run_with_optset(
dk3str_correct_filename(fnb);
if(dk3sf_must_expand(fnb)) {
-#line 1021 "bmeps3.ctr"
+#line 1011 "bmeps3.ctr"
found = 0;
fne = dk3dir_fne_open_app(fnb, app);
if(fne) {
@@ -1160,7 +1124,7 @@ bmeps3_run_with_optset(
}
} else {
-#line 1054 "bmeps3.ctr"
+#line 1044 "bmeps3.ctr"
if(dk3sf_stat_app(&stb, fnb, app)) {
switch((stb.ft) & (~(DK3_FT_SYMLINK))) {
case DK3_FT_DIRECTORY: {
@@ -1191,13 +1155,13 @@ bmeps3_run_with_optset(
}
} else {
-#line 1083 "bmeps3.ctr"
+#line 1073 "bmeps3.ctr"
/* BUG: Option not available, should be handled by dk3opt. */
}
}
} else {
-#line 1087 "bmeps3.ctr"
+#line 1077 "bmeps3.ctr"
if(sit != DK3_BIF_IMAGE_TYPE_UNKNOWN) {
if(dk3app_get_temp_file_name(app, fnb, DK3_SIZEOF(fnb,dkChar))) {
fipo = dk3sf_fopen_app(fnb, dk3app_not_localized(53), app);
@@ -1238,7 +1202,7 @@ bmeps3_run_with_optset(
}
-#line 1126 "bmeps3.ctr"
+#line 1116 "bmeps3.ctr"
return back;
}
@@ -1257,7 +1221,7 @@ bmeps3_run_with_app(dk3_app_t *app, dkChar const * const *msg)
int back = 0;
-#line 1143 "bmeps3.ctr"
+#line 1133 "bmeps3.ctr"
optset = dk3opt_open_from_app(
bmeps3_options,
bmeps3_szoptions,
@@ -1267,23 +1231,23 @@ bmeps3_run_with_app(dk3_app_t *app, dkChar const * const *msg)
);
if(optset) {
-#line 1151 "bmeps3.ctr"
+#line 1141 "bmeps3.ctr"
if(0 == dk3opt_get_error_code(optset)) {
-#line 1152 "bmeps3.ctr"
+#line 1142 "bmeps3.ctr"
back = bmeps3_run_with_optset(app, msg, optset);
} else {
-#line 1154 "bmeps3.ctr"
+#line 1144 "bmeps3.ctr"
/* ERROR: Error in options */
}
dk3opt_close(optset);
} else {
-#line 1158 "bmeps3.ctr"
+#line 1148 "bmeps3.ctr"
}
-#line 1159 "bmeps3.ctr"
+#line 1149 "bmeps3.ctr"
return back;
}
@@ -1302,17 +1266,17 @@ DK3_MAIN
-#line 1176 "bmeps3.ctr"
+#line 1166 "bmeps3.ctr"
-#line 1177 "bmeps3.ctr"
+#line 1167 "bmeps3.ctr"
exval = 1;
app = dk3app_open_command(
argc, (dkChar const * const *)argv, bmeps3_kw[0]
);
if(app) {
-#line 1182 "bmeps3.ctr"
+#line 1172 "bmeps3.ctr"
msg = dk3app_messages(
app,
dk3bmep_str_get_string_table_name(),
@@ -1320,29 +1284,29 @@ DK3_MAIN
);
if(msg) {
-#line 1188 "bmeps3.ctr"
+#line 1178 "bmeps3.ctr"
if(bmeps3_run_with_app(app, msg)) {
exval = 0;
}
} else {
-#line 1192 "bmeps3.ctr"
+#line 1182 "bmeps3.ctr"
/* BUG: Should not happen, as the fucntion returns the default array! */
}
dk3app_close(app);
} else {
-#line 1196 "bmeps3.ctr"
+#line 1186 "bmeps3.ctr"
/* ERROR: Memory */
fputs("ERROR: Not enough memory (RAM/swap space)!\n", stderr);
fflush(stderr);
}
-#line 1201 "bmeps3.ctr"
+#line 1191 "bmeps3.ctr"
-#line 1202 "bmeps3.ctr"
+#line 1192 "bmeps3.ctr"
fflush(stdout);
exit(exval); return exval;
}
diff --git a/support/dktools/bmeps3.ctr b/support/dktools/bmeps3.ctr
index f5ba076867..a16cbc11cf 100644
--- a/support/dktools/bmeps3.ctr
+++ b/support/dktools/bmeps3.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -236,11 +236,11 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net/bmpp.html
+http://sourceforge.net/p/dktools/wiki/bmpp%20manual/
The DK tools and libraries homepage contains more information about
bmpp and other programs.
-http://gxhints.sourceforge.net
+http://sourceforge.net/p/gxhints/wiki/Home/
The Graphics Conversion Hints page recommends programs and shows
procedures for conversions between recent vector graphics formats.
@@ -327,16 +327,6 @@ $!end
-/** Strings, replaced by localized version.
-*/
-static dkChar const * const bmeps3_message_texts[] = {
-$!string-table macro=dkT
-
-$!end
-};
-
-
-
/** License overview text.
*/
static dkChar const * const bmeps3_overview_license[] = {
@@ -347,7 +337,7 @@ dkT("This software uses code from the following projects either directly"),
dkT("or as a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net for information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/ for information."),
#if DK3_HAVE_PNG_H
dkT(""),
dkT("libpng\t\tPNG reference library."),
@@ -369,7 +359,7 @@ dkT("zlib\t\tCompression library."),
dkT("\t\tSee http://www.zlib.net/ for information."),
#endif
dkT(""),
-dkT("Your use of the bmpp/wxmbpp program must be in compliance with the"),
+dkT("Your use of the bmpp/wxbmpp program must be in compliance with the"),
dkT("license conditions for the dktools project and the license conditions"),
dkT("for all the libraries used by bmpp."),
dkT(""),
@@ -1005,10 +995,10 @@ bmeps3_run_with_optset(
}
if(dk3opt_is_set(optset, dkT('h'))) {
dk3sf_initialize_stdout();
- dk3app_help(app, dkT("bmpp.txt"), bmeps3_default_help_text);
+ dk3app_help(app, dkT("bmpp3.txt"), bmeps3_default_help_text);
}
} else {
- dk3bmeo_check(&bmeo, 0, app, NULL); $? ". dr: %d", bmeo.dr
+ dk3bmeo_check(&bmeo, 0, NULL); $? ". dr: %d", bmeo.dr
numargs = dk3opt_get_num_args(optset);
if(numargs > 0) { $? ". file and/or directory names."
for(i = 0; i < numargs; i++) {
diff --git a/support/dktools/bmeps3.h b/support/dktools/bmeps3.h
index cdb3c6a61e..65219ca2d9 100644
--- a/support/dktools/bmeps3.h
+++ b/support/dktools/bmeps3.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: bmeps3.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: bmeps3.ctr
*/
/** @file bmeps3.h Header file for the bmeps3 module.
diff --git a/support/dktools/bmpp.c b/support/dktools/bmpp.c
new file mode 100644
index 0000000000..4175dfe86a
--- /dev/null
+++ b/support/dktools/bmpp.c
@@ -0,0 +1,2493 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: bmpp.ctr
+*/
+
+/** @file bmpp.c The bmpp module.
+*/
+
+
+#line 79 "bmpp.ctr"
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4FPUT_H_INCLUDED
+#include "dk4fput.h"
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef DK4AOPT_H_INCLUDED
+#include "dk4aopt.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#include "dk4dir.h"
+#endif
+
+#ifndef DK4DIRA_H_INCLUDED
+#include "dk4dira.h"
+#endif
+
+#ifndef DK4MM_H_INCLUDED
+#include "dk4mm.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4FOPDA_H_INCLUDED
+#include "dk4fopda.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#ifndef BMPP_H_INCLUDED
+#include "bmpp.h"
+#endif
+
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
+
+
+
+#line 188 "bmpp.ctr"
+
+
+
+/** Default help text, shown if help text file is not found.
+*/
+static const dkChar * const bmpp_help_text[] = {
+dkT(""),
+dkT("Convert PNG/JPEG/NetPBM/TIFF to PS/EPS/PDF"),
+dkT(""),
+dkT("bmpp -l <driver>.<purpose>,<key>=<value>... <options> [<file(s)>]"),
+dkT(""),
+dkT("Drivers:\tps\teps\tpdf\tbb"),
+dkT(""),
+dkT("Purposes:\timage\tobject\tdocument"),
+dkT(""),
+dkT("Options:"),
+dkT("-l\t\tSet driver and purpose, add key=value options."),
+dkT("-m\t\tCheck modifications times, avoid unnecessary conversions."),
+dkT("-R\t\tReset program options to builtin defaults (skip configuration files)."),
+dkT("--help\t\tShow this short help text."),
+dkT("--version\tShow version information."),
+dkT("--manual\t*** SHOW FULL MANUAL. ***"),
+dkT("--license\tShow license information."),
+dkT(""),
+dkT("See the full manual for the key=value options, run: bmpp --manual | more"),
+dkT(""),
+NULL
+
+
+#line 216 "bmpp.ctr"
+};
+
+
+
+/** License text.
+*/
+static const dkChar * const bmpp_license_text[] = {
+dkT(""),
+dkT("Overview"),
+dkT("========"),
+dkT("This software uses code from the following projects either directly"),
+dkT("or as a library:"),
+dkT(""),
+dkT("dktools\tDirk Krause's tools and libraries."),
+dkT("\tSee http://sourceforge.net/p/dktools/wiki/Home/ for information."),
+#if DK4_HAVE_PNG_H
+dkT(""),
+dkT("libpng\tPNG reference library."),
+dkT("\tSee http://www.libpng.org/pub/png/libpng.html for information."),
+#endif
+#if DK4_HAVE_JPEGLIB_H
+dkT(""),
+dkT("jpeg\tIndependent JPEG groups free JPEG library."),
+dkT("\tSee http://www.ijg.org/ for information."),
+#endif
+#if DK4_HAVE_TIFF_H
+dkT(""),
+dkT("libtiff\tTIFF library."),
+dkT("\tSee http://www.remotesensing.org/libtiff/ for information."),
+#endif
+#if DK4_HAVE_ZLIB_H
+dkT(""),
+dkT("zlib\tCompression library."),
+dkT("\tSee http://www.zlib.net/ for information."),
+#endif
+dkT(""),
+dkT("Your use of the bmpp program must be in compliance with the license conditions"),
+dkT("for the dktools project and the license conditions for all the libraries used"),
+dkT("by bmpp."),
+dkT(""),
+dkT("License for the dktools project"),
+dkT("==============================="),
+dkT("Copyright (c) 2011-2018, Dirk Krause"),
+dkT("All rights reserved."),
+dkT(""),
+dkT("Redistribution and use in source and binary forms,"),
+dkT("with or without modification, are permitted provided"),
+dkT("that the following conditions are met:"),
+dkT(""),
+dkT("* Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("* Redistributions in binary form must reproduce the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer in the documentation"),
+dkT(" and/or other materials provided with the distribution."),
+dkT("* Neither the name of the copyright holder(s) nor the names of contributors"),
+dkT(" may be used to endorse or promote products derived from this software"),
+dkT(" without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
+dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
+dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
+dkT("ARE DISCLAIMED."),
+dkT(""),
+dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;"),
+dkT("LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND"),
+dkT("ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT"),
+dkT("(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF"),
+dkT("THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+#if DK4_HAVE_PNG_H
+dkT(""),
+dkT("libpng license"),
+dkT("=============="),
+dkT(""),
+dkT("This copy of the libpng notices is provided for your convenience. In case of"),
+dkT("any discrepancy between this copy and the notices in the file png.h that is"),
+dkT("included in the libpng distribution, the latter shall prevail."),
+dkT(""),
+dkT("COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:"),
+dkT(""),
+dkT("If you modify libpng you may insert additional notices immediately following"),
+dkT("this sentence."),
+dkT(""),
+dkT("This code is released under the libpng license."),
+dkT(""),
+dkT("libpng versions 1.2.6, August 15, 2004, through 1.2.46, July 9, 2011, are"),
+dkT("Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are"),
+dkT("distributed according to the same disclaimer and license as libpng-1.2.5"),
+dkT("with the following individual added to the list of Contributing Authors"),
+dkT(""),
+dkT(" Cosmin Truta"),
+dkT(""),
+dkT("libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are"),
+dkT("Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are"),
+dkT("distributed according to the same disclaimer and license as libpng-1.0.6"),
+dkT("with the following individuals added to the list of Contributing Authors"),
+dkT(""),
+dkT(" Simon-Pierre Cadieux"),
+dkT(" Eric S. Raymond"),
+dkT(" Gilles Vollant"),
+dkT(""),
+dkT("and with the following additions to the disclaimer:"),
+dkT(""),
+dkT(" There is no warranty against interference with your enjoyment of the"),
+dkT(" library or against infringement. There is no warranty that our"),
+dkT(" efforts or the library will fulfill any of your particular purposes"),
+dkT(" or needs. This library is provided with all faults, and the entire"),
+dkT(" risk of satisfactory quality, performance, accuracy, and effort is with"),
+dkT(" the user."),
+dkT(""),
+dkT("libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are"),
+dkT("Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are"),
+dkT("distributed according to the same disclaimer and license as libpng-0.96,"),
+dkT("with the following individuals added to the list of Contributing Authors:"),
+dkT(""),
+dkT(" Tom Lane"),
+dkT(" Glenn Randers-Pehrson"),
+dkT(" Willem van Schaik"),
+dkT(""),
+dkT("libpng versions 0.89, June 1996, through 0.96, May 1997, are"),
+dkT("Copyright (c) 1996, 1997 Andreas Dilger"),
+dkT("Distributed according to the same disclaimer and license as libpng-0.88,"),
+dkT("with the following individuals added to the list of Contributing Authors:"),
+dkT(""),
+dkT(" John Bowler"),
+dkT(" Kevin Bracey"),
+dkT(" Sam Bushell"),
+dkT(" Magnus Holmgren"),
+dkT(" Greg Roelofs"),
+dkT(" Tom Tanner"),
+dkT(""),
+dkT("libpng versions 0.5, May 1995, through 0.88, January 1996, are"),
+dkT("Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc."),
+dkT(""),
+dkT("For the purposes of this copyright and license, \"Contributing Authors\""),
+dkT("is defined as the following set of individuals:"),
+dkT(""),
+dkT(" Andreas Dilger"),
+dkT(" Dave Martindale"),
+dkT(" Guy Eric Schalnat"),
+dkT(" Paul Schmidt"),
+dkT(" Tim Wegner"),
+dkT(""),
+dkT("The PNG Reference Library is supplied \"AS IS\". The Contributing Authors"),
+dkT("and Group 42, Inc. disclaim all warranties, expressed or implied,"),
+dkT("including, without limitation, the warranties of merchantability and of"),
+dkT("fitness for any purpose. The Contributing Authors and Group 42, Inc."),
+dkT("assume no liability for direct, indirect, incidental, special, exemplary,"),
+dkT("or consequential damages, which may result from the use of the PNG"),
+dkT("Reference Library, even if advised of the possibility of such damage."),
+dkT(""),
+dkT("Permission is hereby granted to use, copy, modify, and distribute this"),
+dkT("source code, or portions hereof, for any purpose, without fee, subject"),
+dkT("to the following restrictions:"),
+dkT(""),
+dkT("1. The origin of this source code must not be misrepresented."),
+dkT(""),
+dkT("2. Altered versions must be plainly marked as such and must not"),
+dkT(" be misrepresented as being the original source."),
+dkT(""),
+dkT("3. This Copyright notice may not be removed or altered from any"),
+dkT(" source or altered source distribution."),
+dkT(""),
+dkT("The Contributing Authors and Group 42, Inc. specifically permit, without"),
+dkT("fee, and encourage the use of this source code as a component to"),
+dkT("supporting the PNG file format in commercial products. If you use this"),
+dkT("source code in a product, acknowledgment is not required but would be"),
+dkT("appreciated."),
+dkT(""),
+dkT(""),
+dkT("A \"png_get_copyright\" function is available, for convenient use in \"about\""),
+dkT("boxes and the like:"),
+dkT(""),
+dkT(" printf(\"%s\",png_get_copyright(NULL));"),
+dkT(""),
+dkT("Also, the PNG logo (in PNG format, of course) is supplied in the"),
+dkT("files \"pngbar.png\" and \"pngbar.jpg (88x31) and \"pngnow.png\" (98x31)."),
+dkT(""),
+dkT("Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a"),
+dkT("certification mark of the Open Source Initiative."),
+dkT(""),
+dkT("Glenn Randers-Pehrson"),
+dkT("glennrp at users.sourceforge.net"),
+dkT("July 9, 2011"),
+#endif
+#if DK4_HAVE_JPEGLIB_H
+dkT(""),
+dkT("jpeglib license"),
+dkT("==============="),
+dkT(""),
+dkT("In plain English:"),
+dkT(""),
+dkT("1. We don't promise that this software works. (But if you find any bugs,"),
+dkT(" please let us know!)"),
+dkT("2. You can use this software for whatever you want. You don't have to pay us."),
+dkT("3. You may not pretend that you wrote this software. If you use it in a"),
+dkT(" program, you must acknowledge somewhere in your documentation that"),
+dkT(" you've used the IJG code."),
+dkT(""),
+dkT("In legalese:"),
+dkT(""),
+dkT("The authors make NO WARRANTY or representation, either express or implied,"),
+dkT("with respect to this software, its quality, accuracy, merchantability, or"),
+dkT("fitness for a particular purpose. This software is provided \"AS IS\", and you,"),
+dkT("its user, assume the entire risk as to its quality and accuracy."),
+dkT(""),
+dkT("This software is copyright (C) 1991-1998, Thomas G. Lane."),
+dkT("All Rights Reserved except as specified below."),
+dkT(""),
+dkT("Permission is hereby granted to use, copy, modify, and distribute this"),
+dkT("software (or portions thereof) for any purpose, without fee, subject to these"),
+dkT("conditions:"),
+dkT("(1) If any part of the source code for this software is distributed, then this"),
+dkT("README file must be included, with this copyright and no-warranty notice"),
+dkT("unaltered; and any additions, deletions, or changes to the original files"),
+dkT("must be clearly indicated in accompanying documentation."),
+dkT("(2) If only executable code is distributed, then the accompanying"),
+dkT("documentation must state that \"this software is based in part on the work of"),
+dkT("the Independent JPEG Group\"."),
+dkT("(3) Permission for use of this software is granted only if the user accepts"),
+dkT("full responsibility for any undesirable consequences; the authors accept"),
+dkT("NO LIABILITY for damages of any kind."),
+dkT(""),
+dkT("These conditions apply to any software derived from or based on the IJG code,"),
+dkT("not just to the unmodified library. If you use our work, you ought to"),
+dkT("acknowledge us."),
+dkT(""),
+dkT("Permission is NOT granted for the use of any IJG author's name or company name"),
+dkT("in advertising or publicity relating to this software or products derived from"),
+dkT("it. This software may be referred to only as \"the Independent JPEG Group's"),
+dkT("software\"."),
+dkT(""),
+dkT("We specifically permit and encourage the use of this software as the basis of"),
+dkT("commercial products, provided that all warranty or liability claims are"),
+dkT("assumed by the product vendor."),
+dkT(""),
+dkT("ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,"),
+dkT("sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA."),
+dkT("ansi2knr.c is NOT covered by the above copyright and conditions, but instead"),
+dkT("by the usual distribution terms of the Free Software Foundation; principally,"),
+dkT("that you must include source code if you redistribute it. (See the file"),
+dkT("ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part"),
+dkT("of any program generated from the IJG code, this does not limit you more than"),
+dkT("the foregoing paragraphs do."),
+dkT(""),
+dkT("The Unix configuration script \"configure\" was produced with GNU Autoconf."),
+dkT("It is copyright by the Free Software Foundation but is freely distributable."),
+dkT("The same holds for its supporting scripts (config.guess, config.sub,"),
+dkT("ltconfig, ltmain.sh). Another support script, install-sh, is copyright"),
+dkT("by M.I.T. but is also freely distributable."),
+dkT(""),
+dkT("It appears that the arithmetic coding option of the JPEG spec is covered by"),
+dkT("patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot"),
+dkT("legally be used without obtaining one or more licenses. For this reason,"),
+dkT("support for arithmetic coding has been removed from the free JPEG software."),
+dkT("(Since arithmetic coding provides only a marginal gain over the unpatented"),
+dkT("Huffman mode, it is unlikely that very many implementations will support it.)"),
+dkT("So far as we are aware, there are no patent restrictions on the remaining"),
+dkT("code."),
+dkT(""),
+dkT("The IJG distribution formerly included code to read and write GIF files."),
+dkT("To avoid entanglement with the Unisys LZW patent, GIF reading support has"),
+dkT("been removed altogether, and the GIF writer has been simplified to produce"),
+dkT("\"uncompressed GIFs\". This technique does not use the LZW algorithm; the"),
+dkT("resulting GIF files are larger than usual, but are readable by all standard"),
+dkT("GIF decoders."),
+dkT(""),
+dkT("We are required to state that"),
+dkT(" \"The Graphics Interchange Format(c) is the Copyright property of"),
+dkT(" CompuServe Incorporated. GIF(sm) is a Service Mark property of"),
+dkT(" CompuServe Incorporated.\""),
+#endif
+#if DK4_HAVE_TIFF_H
+dkT(""),
+dkT("libtiff license"),
+dkT("==============="),
+dkT(""),
+dkT("Copyright (c) 1988-1997 Sam Leffler"),
+dkT("Copyright (c) 1991-1997 Silicon Graphics, Inc."),
+dkT(""),
+dkT("Permission to use, copy, modify, distribute, and sell this software and "),
+dkT("its documentation for any purpose is hereby granted without fee, provided"),
+dkT("that (i) the above copyright notices and this permission notice appear in"),
+dkT("all copies of the software and related documentation, and (ii) the names of"),
+dkT("Sam Leffler and Silicon Graphics may not be used in any advertising or"),
+dkT("publicity relating to the software without the specific, prior written"),
+dkT("permission of Sam Leffler and Silicon Graphics."),
+dkT(""),
+dkT("THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, "),
+dkT("EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY "),
+dkT("WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. "),
+dkT(""),
+dkT("IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR"),
+dkT("ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,"),
+dkT("OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,"),
+dkT("WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF "),
+dkT("LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE "),
+dkT("OF THIS SOFTWARE."),
+#endif
+#if DK4_HAVE_ZLIB_H
+dkT(""),
+dkT("zlib license"),
+dkT("============"),
+dkT(""),
+dkT(" (C) 1995-2004 Jean-loup Gailly and Mark Adler"),
+dkT(""),
+dkT(" This software is provided 'as-is', without any express or implied"),
+dkT(" warranty. In no event will the authors be held liable for any damages"),
+dkT(" arising from the use of this software."),
+dkT(""),
+dkT(" Permission is granted to anyone to use this software for any purpose,"),
+dkT(" including commercial applications, and to alter it and redistribute it"),
+dkT(" freely, subject to the following restrictions:"),
+dkT(""),
+dkT(" 1. The origin of this software must not be misrepresented; you must not"),
+dkT(" claim that you wrote the original software. If you use this software"),
+dkT(" in a product, an acknowledgment in the product documentation would be"),
+dkT(" appreciated but is not required."),
+dkT(" 2. Altered source versions must be plainly marked as such, and must not be"),
+dkT(" misrepresented as being the original software."),
+dkT(" 3. This notice may not be removed or altered from any source distribution."),
+dkT(""),
+dkT(" Jean-loup Gailly Mark Adler"),
+dkT(" jloup@gzip.org madler@alumni.caltech.edu"),
+dkT(""),
+dkT("If you use the zlib library in a product, we would appreciate *not*"),
+dkT("receiving lengthy legal documents to sign. The sources are provided"),
+dkT("for free but without warranty of any kind. The library has been"),
+dkT("entirely written by Jean-loup Gailly and Mark Adler; it does not"),
+dkT("include third-party code."),
+dkT(""),
+dkT("If you redistribute modified sources, we would appreciate that you include"),
+dkT("in the file ChangeLog history information documenting your changes. Please"),
+dkT("read the FAQ for more information on the distribution of modified source"),
+dkT("versions."),
+#endif
+dkT(""),
+NULL
+
+
+#line 556 "bmpp.ctr"
+};
+
+
+/** Keywords, not localized.
+*/
+static const dkChar * const bmpp_kwnl[] = {
+/* 0 */
+dkT("dktools"),
+
+/* 1 */
+dkT("bmpp.txt"),
+
+/* 2 */
+dkT("bmpp.str"),
+
+/* 3 */
+dkT("<stdin>"),
+
+/* 4 */
+dkT(".pdf"),
+
+/* 5 */
+dkT(".eps"),
+
+/* 6 */
+dkT(".ps"),
+
+/* 7 */
+dkT(".pgf"),
+
+/* 8 */
+dkT(".bb"),
+
+/* 9 */
+dkT(".tex"),
+
+NULL
+
+
+#line 589 "bmpp.ctr"
+};
+
+
+/** Default text fragments if localized fragments are not found.
+*/
+static const dkChar * const bmpp_kw_def[] = {
+/* 0 */
+dkT("Failed to install signal handlers!"),
+
+/* 1 */
+dkT("Failed to restore signal handleres!"),
+
+/* 2 */
+dkT("The bmpp program can not produce TeX output!"),
+
+/* 3 */
+dkT("Incorrect paper size information, unusable!"),
+
+/* 4 */
+dkT("Failed to read NetPBM image from standard input!"),
+
+/* 5 */
+dkT("Failed to construct output file name!\n\tInput file name probably too long!"),
+
+/* 6 */
+dkT("Failed to construct full path name!\n\tDirectory or file name too long!"),
+
+/* 7 */
+dkT("Not a regular file!"),
+
+/* 8 */
+dkT("No such file!"),
+
+/* 9 */
+dkT("Preparing output (start)."),
+
+/* 10 */
+dkT("Preparing output (finished)."),
+
+/* 11 */
+dkT("Writing output file (start)."),
+
+/* 12 */
+dkT("Writing output file (finished)."),
+
+/* 13 */
+dkT("Processing standard input to standard output (start)."),
+
+/* 14 */
+dkT("Processing standard input to standard output (finished)."),
+
+/* 15 */
+dkT("Reading NetPBM image from standard input (start)."),
+
+/* 16 */
+dkT("Reading NetPBM image from standard input (finished)."),
+
+/* 17 */
+dkT("Writing output to standard output (start)."),
+
+/* 18 */
+dkT("Writing output to standard output (finished)."),
+
+/* 19 */
+dkT("Reading input file (start)."),
+
+/* 20 */
+dkT("Reading input file (finished)."),
+
+/* 21 */
+dkT("Processing file (start)."),
+
+/* 22 */
+dkT("Processing file (finished)."),
+
+/* 23 */
+dkT("Processing directory (start)."),
+
+/* 24 */
+dkT("Processing directory (finished)."),
+
+/* 25 */
+dkT("Not a usable input file: \""),
+
+/* 26 */
+dkT("\"."),
+
+/* 27 */
+dkT("Processing file name pattern (start)."),
+
+/* 28 */
+dkT("Processing file name pattern (finished)."),
+
+NULL
+
+
+#line 692 "bmpp.ctr"
+};
+
+
+
+static const char * const bmpp_c8_kwnl[] = {
+/* 0 */
+"%%BoundingBox: 0 0 ",
+
+/* 1 */
+" ",
+
+/* 2 */
+"\n",
+
+NULL
+
+
+#line 705 "bmpp.ctr"
+};
+
+
+/** Options used by the program.
+*/
+static const dk4_option_specification_t bmpp_options[] = {
+
+ /* Language, purpose and key=value options
+ */
+ { dkT('l'), dkT("language"), DK4_OPT_ARG_STRING },
+
+ /* Make mode to avoid unnecessary conversions when processing directories
+ */
+ { dkT('m'), dkT("make"), DK4_OPT_ARG_NONE },
+
+ /* Skip preferences
+ */
+ { dkT('R'), dkT("reset"), DK4_OPT_ARG_NONE }
+
+};
+
+
+
+/** Number of options in bmpp_options array.
+*/
+static const size_t bmpp_sz_options =
+sizeof(bmpp_options) / sizeof(dk4_option_specification_t);
+
+
+
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
+
+/** Indicator: SIGTERM signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+
+
+
+/** Pass a volatile pointer to an atomic integer.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ptr Address of atomic integer variable.
+ @return The unmodified pointer.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
+{
+ return ptr;
+}
+
+
+
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
+*/
+static
+void
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
+}
+#endif
+
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
+static
+void
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
+}
+
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
+*/
+static
+void
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
+}
+
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
+
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
+*/
+static
+int
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
+{
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
+}
+
+
+
+/** Initialize job structure.
+ @param job Structure to initialize.
+*/
+static
+void
+bmpp_job_init(bmpp_job_t *job)
+{
+
+
+#line 860 "bmpp.ctr"
+ dk4gra_conf_init(&(job->grco));
+ job->app = NULL;
+ job->msg = bmpp_kw_def;
+ job->sz_msg = ((sizeof(bmpp_kw_def)/sizeof(DK4_PDKCHAR)) - 1);
+ job->use_prefs = 1;
+ job->make_mode = 0;
+ job->exval = EXIT_FAILURE;
+ DK4_MEMRES(&(job->exbuf[0]), (DK4_MAX_PATH * sizeof(dkChar)));
+ DK4_MEMRES(&(job->dtbuf[0]), (DK4_MAX_PATH * sizeof(dkChar)));
+ DK4_MEMRES(&(job->onbuf[0]), (DK4_MAX_PATH * sizeof(dkChar)));
+
+
+#line 871 "bmpp.ctr"
+}
+
+
+
+/** Calculate bounding box dimensions for bitmap image file.
+ @param job Job structure.
+ @param pw Address of width variable.
+ @param ph Address of height variable.
+ @param bif Bitmap image file.
+*/
+static
+void
+bmpp_calculate_bounding_box(
+ bmpp_job_t *job,
+ size_t *pw,
+ size_t *ph,
+ double *cotra,
+ dk4_bif_t *bif
+)
+{
+ double xres;
+ double yres;
+ size_t w;
+ size_t h;
+ dk4_bif_dim_t orig_w;
+ dk4_bif_dim_t orig_h;
+
+
+#line 898 "bmpp.ctr"
+ orig_w = dk4bif_get_width(bif);
+ orig_h = dk4bif_get_height(bif);
+ w = (size_t)orig_w;
+ h = (size_t)orig_h;
+ if (NULL != cotra) {
+ cotra[0] = 0.0;
+ cotra[1] = 0.0;
+ cotra[2] = 0.0;
+ cotra[3] = (double)w;
+ cotra[4] = (double)h;
+ }
+ if (0 == job->grco.img_ign_res) {
+ xres = dk4bif_get_xres(bif);
+ yres = dk4bif_get_yres(bif);
+ if ((0.0 < xres) && (0.0 < yres)) {
+ if ((1.0e-5 < fabs(xres - 72.0)) || (1.0e-5 < fabs(yres - 72.0))) {
+ xres = (72.0 * (double)orig_w) / xres;
+ yres = (72.0 * (double)orig_h) / yres;
+ if (0 != dk4ma_is_finite(xres)) {
+ if (0 != dk4ma_is_finite(yres)) {
+ if ((double)(SIZE_MAX) > xres) {
+ if ((double)(SIZE_MAX) > yres) {
+ w = (size_t)ceil(xres);
+ h = (size_t)ceil(yres);
+ if (NULL != cotra) {
+ cotra[0] = ((double)w - xres) / 2.0;
+ cotra[1] = ((double)h - yres) / 2.0;
+ cotra[3] = xres;
+ cotra[4] = yres;
+ if (0.0 > cotra[0]) { cotra[0] = 0.0; }
+ if (0.0 > cotra[1]) { cotra[1] = 0.0; }
+ if (1.0e-5 > fabs(cotra[0])) {
+ cotra[0] = 0.0;
+ }
+ if (1.0e-5 > fabs(cotra[1])) {
+ cotra[1] = 0.0;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ *pw = w;
+ *ph = h;
+
+
+#line 946 "bmpp.ctr"
+}
+
+
+
+/** Produce bounding box file.
+ @param job Job structure.
+ @param bif Bitmap image file.
+ @param filename Input file name currently processed, NULL for stdin.
+*/
+static
+void
+bmpp_produce_bb(
+ bmpp_job_t *job,
+ dk4_bif_t *bif,
+ dkChar const *filename
+)
+{
+ char wbuf[16*sizeof(dk4_um_t)]; /* Buffer for width as text */
+ char hbuf[16*sizeof(dk4_um_t)]; /* Buffer for height as text */
+ FILE *fipo; /* Output file */
+ double deltares; /* Resolution difference */
+ size_t w; /* Image width */
+ size_t h; /* Image height */
+ int res; /* Operation result */
+ int tests = DK4_FOPEN_SC_USER; /* Tests for fopen */
+
+
+
+#line 973 "bmpp.ctr"
+ if (0 != dk4isadmin()) {
+ tests = DK4_FOPEN_SC_PRIVILEGED;
+ }
+
+ /*
+ Check for different resolutions and ignore res option
+ */
+ if (0 != job->grco.img_ign_res) {
+ deltares = fabs(bif->cf->res_y - bif->cf->res_x);
+ if (DK4_BIF_EPSILON_ASPECT <= deltares) {
+ dk4bif_warn_aspect_ratio_change(
+ bif, 72.0, 72.0, job->app
+ );
+ }
+ }
+ bmpp_calculate_bounding_box(job, &w, &h, NULL, bif);
+ res = dk4ma_write_c8_decimal_unsigned(
+ wbuf, sizeof(wbuf), (dk4_um_t)w, 0, NULL
+ );
+ if (0 != res) {
+ res = dk4ma_write_c8_decimal_unsigned(
+ hbuf, sizeof(hbuf), (dk4_um_t)h, 0, NULL
+ );
+ if (0 != res) {
+ if (NULL != filename) {
+ fipo = dk4fopen_app(&(job->onbuf[0]),dkT("w"),tests,job->app);
+ if (NULL != fipo) {
+ fputs(bmpp_c8_kwnl[0], fipo);
+ fputs(wbuf, fipo);
+ fputs(bmpp_c8_kwnl[1], fipo);
+ fputs(hbuf, fipo);
+ fputs(bmpp_c8_kwnl[2], fipo);
+ if (0 != fclose(fipo)) {
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to close fipo
+ */
+ dk4app_log_base1(job->app, DK4_LL_ERROR, 128);
+ }
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to open file, already reported */
+ }
+ }
+ else {
+ fputs(bmpp_c8_kwnl[0], stdout);
+ fputs(wbuf, stdout);
+ fputs(bmpp_c8_kwnl[1], stdout);
+ fputs(hbuf, stdout);
+ fputs(bmpp_c8_kwnl[2], stdout);
+ }
+ }
+ else {
+
+#line 1026 "bmpp.ctr"
+ /* ERROR: Failed to convert h to string */
+ }
+ }
+ else {
+
+#line 1030 "bmpp.ctr"
+ /* ERROR: Failed to convert w to string */
+ }
+
+
+#line 1033 "bmpp.ctr"
+}
+
+
+
+/** Check paper size in job configuration.
+ @param job Job structure.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+bmpp_check_papersize(
+ bmpp_job_t *job
+)
+{
+ double xl; /* Left x position */
+ double xr; /* Right x position */
+ double yb; /* Bottom y position */
+ double yt; /* Top y position */
+ int back = 0;
+
+ xl = job->grco.media.i;
+ xr = job->grco.media.w - job->grco.media.o;
+ yb = job->grco.media.b;
+ yt = job->grco.media.h - job->grco.media.t;
+ if ((isgreater(xr,xl)) && (isgreater(yt,yb))) {
+ back = 1;
+ }
+ if (0 == back) {
+ /*
+ ERROR: Illegal paper size
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 3);
+ job->exval = EXIT_FAILURE;
+ }
+ return back;
+}
+
+
+
+/** Produce document.
+ @param job Job structure.
+ @param bif Bitmap image file.
+ @param filename Input file name currently processed, NULL for stdin.
+*/
+static
+void
+bmpp_produce_document(
+ bmpp_job_t *job,
+ dk4_bif_t *bif,
+ dkChar const *filename
+)
+{
+ dk4_gra_t *gra = NULL; /* Graphics output structure */
+ dkChar const *osf; /* Old source file name */
+ double xl; /* Left image border */
+ double xr; /* Right image border */
+ double yb; /* Bottom image border */
+ double yt; /* Top image border */
+ double deltares; /* Resolution difference */
+ dk4_um_t osl; /* Old source line number */
+ size_t w = 0; /* Paper width */
+ size_t h = 0; /* Paper height */
+ size_t nfrm = 0; /* Number of frames in bitmap image */
+ size_t cf = 0; /* Current frame */
+ int docfl = 0; /* Document flags */
+ int imgfl = 0; /* Image flags */
+ int ok = 0; /* Flag: No error occured */
+
+
+
+#line 1102 "bmpp.ctr"
+ if (0 != bmpp_check_papersize(job)) {
+
+#line 1103 "bmpp.ctr"
+ /*
+ Retrieve document and image flag from configuration structure
+ */
+ docfl = dk4gra_conf_flags_document(&(job->grco));
+ imgfl = dk4gra_conf_flags_image(&(job->grco));
+ /*
+ Apply some corrections to the flags
+ */
+ imgfl &= (~(DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO));
+ imgfl &= (~(DK4_GRA_IMG_FLAG_ALLOW_ROTATION));
+ imgfl |= DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS;
+ if (DK4_GRA_DRIVER_PDF == job->grco.driver) {
+ imgfl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+
+#line 1116 "bmpp.ctr"
+ }
+ /* Obtain image dimensions
+ */
+ w = (size_t)ceil(job->grco.media.w);
+
+#line 1120 "bmpp.ctr"
+ h = (size_t)ceil(job->grco.media.h);
+
+#line 1121 "bmpp.ctr"
+ /*
+ Open graphics output structure
+ */
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_PDF : {
+
+#line 1126 "bmpp.ctr"
+ imgfl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+ gra = dk4gra_app_open_pdf(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, job->app
+ );
+ } break;
+ case DK4_GRA_DRIVER_PS : {
+
+#line 1133 "bmpp.ctr"
+ gra = dk4gra_app_open_ps(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, job->app
+ );
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+
+#line 1139 "bmpp.ctr"
+ gra = dk4gra_app_open_pgf(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, 0, job->app
+ );
+ } break;
+ }
+ if (NULL != gra) {
+
+#line 1146 "bmpp.ctr"
+ ok = 1;
+ /*
+ PROGRESS: Preparing output (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 9);
+ /*
+ Traverse all frames of source image
+ */
+ nfrm = dk4bif_get_number_of_frames(bif);
+
+
+#line 1156 "bmpp.ctr"
+ for (cf = 0; cf < nfrm; cf++) {
+
+
+#line 1158 "bmpp.ctr"
+ /*
+ Switch to selected frame
+ */
+ if (0 != dk4bif_set_current_frame(bif, cf)) {
+ /*
+ Check for different resolutions and ignore res option
+ */
+ if (0 != job->grco.img_ign_res) {
+ deltares = fabs(bif->cf->res_y - bif->cf->res_x);
+ if (DK4_BIF_EPSILON_ASPECT <= deltares) {
+ dk4bif_warn_aspect_ratio_change(
+ bif, 72.0, 72.0, job->app
+ );
+ }
+ }
+ /*
+ If a resolution was configured, use it
+ */
+ if ((0.0 < job->grco.xres) && (0.0 < job->grco.yres)) {
+ dk4bif_set_res_app(
+ bif, job->grco.xres, job->grco.yres, job->app
+ );
+ }
+ /*
+ Add new page to graphics output
+ */
+ dk4gra_app_page(gra, &ok, job->app);
+
+#line 1185 "bmpp.ctr"
+ /*
+ Calculate paper range available for image
+ */
+ xl = job->grco.media.i;
+ xr = job->grco.media.w - job->grco.media.o;
+ yb = job->grco.media.b;
+ yt = job->grco.media.h - job->grco.media.t;
+ if ((size_t)0U != (cf % (size_t)2U)) {
+
+#line 1193 "bmpp.ctr"
+ if (0 != job->grco.doc_tumble) {
+ yb = job->grco.media.t;
+ yt = job->grco.media.h - job->grco.media.b;
+ }
+ else {
+ if (0 != job->grco.doc_duplex) {
+
+#line 1199 "bmpp.ctr"
+ xl = job->grco.media.o;
+ xr = job->grco.media.w - job->grco.media.i;
+ }
+ }
+ }
+ /* Add image to paper range
+ */
+ dk4gra_app_bif_image(
+ gra /* gra */ ,
+ xl /* xl */ ,
+ xr /* xr */ ,
+ yb /* yb */ ,
+ yt /* yt */ ,
+ bif /* bif */ ,
+ filename /* filename */ ,
+ cf /* frameno */ ,
+ imgfl /* Image flags */ ,
+ NULL /* bbptr */ ,
+ &ok /* backptr */ ,
+ job->app /* app */
+ );
+ }
+ else {
+
+#line 1222 "bmpp.ctr"
+ ok = 0;
+ }
+
+
+#line 1225 "bmpp.ctr"
+ }
+ /* PROGRESS: Preparing output (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 10);
+ /*
+ Write output file and close graphics output if
+ succeeded so for, otherwise simply close graphics
+ */
+ if (1 == ok) {
+
+#line 1234 "bmpp.ctr"
+ /*
+ Use output file name in diagnostics,
+ save previous settings
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, &(job->onbuf[0]));
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Writing output file (start)
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_PROGRESS,11);
+ /*
+ Write output file and close graphics structure
+ */
+ dk4gra_app_write_and_close(gra, &ok, job->app);
+ gra = NULL;
+ /*
+ PROGRESS: Writing output file (finished)
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_PROGRESS,12);
+ /*
+ Restore previous settings for file and line
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ }
+ else {
+
+#line 1262 "bmpp.ctr"
+ dk4gra_close(gra);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1267 "bmpp.ctr"
+ }
+#endif
+ if (0 == ok) {
+ job->exval = EXIT_FAILURE;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1275 "bmpp.ctr"
+ }
+#endif
+
+
+#line 1278 "bmpp.ctr"
+}
+
+
+
+/** Produce image or object.
+ @param job Job structure.
+ @param bif Bitmap image file.
+ @param filename Input file name currently processed, NULL for stdin.
+*/
+static
+void
+bmpp_produce_image_or_object(
+ bmpp_job_t *job,
+ dk4_bif_t *bif,
+ dkChar const *filename
+)
+{
+ double cotra[8]; /* 5 used: xshift yshift rotation xscale yscale */
+ dkChar const *osf; /* Old source file name */
+ dk4_gra_t *gra = NULL; /* Graphics output structure */
+ double deltares; /* Resolution difference */
+ dk4_um_t osl; /* Old source line number */
+ size_t w; /* Image width */
+ size_t h; /* Image height */
+ int docfl; /* Document flags for opening graphics structure */
+ int imgfl; /* Image flags */
+ int ok = 0; /* Flag: No errors */
+
+
+
+#line 1307 "bmpp.ctr"
+ /*
+ Set flags used to open graphics output and to apply image
+ */
+ docfl = dk4gra_conf_flags_document(&(job->grco));
+ docfl |= DK4_GRA_PAGE_FLAG_NO_BG;
+ imgfl = dk4gra_conf_flags_image(&(job->grco));
+ imgfl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+ imgfl |= DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS;
+ if (DK4_GRA_DRIVER_PDF == job->grco.driver) {
+ if (DK4_GRA_PURPOSE_OBJECT == job->grco.purpose) {
+ imgfl &= (~(DK4_GRA_IMG_FLAG_FILL_BACKGROUND));
+ }
+ }
+ /* Check for different resolutions and ignore res option
+ */
+ if (0 != job->grco.img_ign_res) {
+ deltares = fabs(bif->cf->res_y - bif->cf->res_x);
+ if (DK4_BIF_EPSILON_ASPECT <= deltares) {
+ dk4bif_warn_aspect_ratio_change(bif, 72.0, 72.0, job->app);
+ }
+ }
+ /* If a resolution was configured, use it
+ */
+ if ((0.0 < job->grco.xres) && (0.0 < job->grco.yres)) {
+ dk4bif_set_res_app(bif, job->grco.xres, job->grco.yres, job->app);
+ }
+ /* Calculate bounding box and coordinates transformations
+ */
+ bmpp_calculate_bounding_box(job, &w, &h, cotra, bif);
+ /*
+ Open graphics output structure
+ */
+
+
+#line 1340 "bmpp.ctr"
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_PDF : {
+
+#line 1342 "bmpp.ctr"
+ gra = dk4gra_app_open_pdf(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, job->app
+ );
+ } break;
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+
+#line 1348 "bmpp.ctr"
+ gra = dk4gra_app_open_ps(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, job->app
+ );
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+
+#line 1354 "bmpp.ctr"
+ gra = dk4gra_app_open_pgf(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, 0, job->app
+ );
+ } break;
+ }
+ if (NULL != gra) {
+
+#line 1361 "bmpp.ctr"
+ /*
+ Add page and apply image
+ */
+ ok = 1;
+ /*
+ PROGRESS: Preparing output (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 9);
+ /*
+ Start new page
+ */
+ dk4gra_app_page(gra, &ok, job->app);
+ /*
+ Add bitmap image to page
+ */
+ dk4gra_app_bif_cotra_image(
+ gra, cotra, bif, filename, 0, imgfl, &ok, job->app
+ );
+ /* PROGRESS: Preparing output (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 10);
+ /*
+ If success so far, write output file
+ */
+ if (1 == ok) {
+
+#line 1386 "bmpp.ctr"
+ /*
+ Prepare output file name for diagnostics
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, &(job->onbuf[0]));
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Writing output file (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 11);
+ /*
+ Write output file
+ */
+
+
+#line 1401 "bmpp.ctr"
+ dk4gra_app_write_and_close(gra, &ok, job->app);
+ gra = NULL;
+ /*
+ PROGRESS: Writing output file (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 12);
+ /*
+ Restore previous source file and line
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ }
+ else {
+
+#line 1414 "bmpp.ctr"
+ dk4gra_close(gra);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1419 "bmpp.ctr"
+ }
+#endif
+ if (0 == ok) {
+ job->exval = EXIT_FAILURE;
+ }
+
+
+#line 1425 "bmpp.ctr"
+}
+
+
+
+/** Process one bitmap image file.
+ @param job Job structure.
+ @param bif Bitmap image file.
+ @param filename Input file name currently processed, NULL for stdin.
+*/
+static
+void
+bmpp_run_for_bif(
+ bmpp_job_t *job,
+ dk4_bif_t *bif,
+ dkChar const *filename
+)
+{
+
+
+#line 1443 "bmpp.ctr"
+ dk4bif_set_current_frame(bif, 0);
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_BB : {
+ bmpp_produce_bb(job, bif, filename);
+ } break;
+ default : {
+ switch (job->grco.purpose) {
+ case DK4_GRA_PURPOSE_DOCUMENT : {
+ bmpp_produce_document(job, bif, filename);
+ } break;
+ default : {
+ bmpp_produce_image_or_object(job, bif, filename);
+ } break;
+ }
+ } break;
+ }
+
+
+#line 1460 "bmpp.ctr"
+}
+
+
+
+/** Run as filter if no file names were specified on the command line.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_as_filter(bmpp_job_t *job)
+{
+ dk4_er_t er; /* Error report */
+ dkChar const *osf; /* Old source file name */
+ dk4_bif_t *bif; /* Bitmap image file */
+ dk4_um_t osl; /* Old source line number */
+#if DK4_ON_WINDOWS
+ int osm; /* Old stdin mode */
+#endif
+
+
+#line 1479 "bmpp.ctr"
+ /*
+ Save current source file name and source line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set source file name and line number
+ */
+ dk4app_set_log_source_file(job->app, bmpp_kwnl[3]);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Processing stdin to stdout (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 13);
+
+ /*
+ Read and process image
+ */
+ dk4error_init(&er);
+ /*
+ On Windows we have to set stdin to binary mode exlicitly
+ and restore previous mode when done
+ */
+#if DK4_ON_WINDOWS
+ osm = _setmode(_fileno(stdin), _O_BINARY);
+#endif
+ /* PROGRESS: Reading NetPBM from stdin (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 15);
+ bif = dk4bif_open_file(
+ stdin, NULL, DK4_BIF_TYPE_NETPBM, 0, &(job->grco.ctx), &er
+ );
+ /*
+ PROGRESS: Reading NetPBM from stdin (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 16);
+#if DK4_ON_WINDOWS
+ _setmode(_fileno(stdin), osm);
+#endif
+ if (NULL != bif) {
+ /*
+ PROGRESS: Writing output to stdout (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 17);
+ /*
+ Write the output
+ */
+ bmpp_run_for_bif(job, bif, NULL);
+ /*
+ PROGRESS: Writing output to stdout (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 18);
+ dk4bif_close(bif);
+ }
+ else {
+ /*
+ ERROR: Failed to open BIF
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 4);
+ job->exval = EXIT_FAILURE;
+ }
+ /* PROGRESS: Processing stdin to stdout (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 14);
+ /* Restore previous source file name and line number
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1548 "bmpp.ctr"
+}
+
+
+
+/** Run for one input file.
+ @param job Job structure.
+ @param filename Input file name to process.
+*/
+static
+void
+bmpp_run_for_file(
+ bmpp_job_t *job,
+ dkChar const *filename
+)
+{
+ dk4_bif_t *bif; /* Bitmap image file */
+ int ho = 0; /* Flag: Read image header only */
+
+
+#line 1566 "bmpp.ctr"
+ /*
+ To calculate the bounding box it is sufficient to read
+ image header
+ */
+ if (DK4_GRA_DRIVER_BB == job->grco.driver) {
+ ho = 1;
+ }
+ /* Read and process image
+ */
+ /* PROGRESS: Reading input file (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 19);
+ bif = dk4bif_open_app(filename, ho, &(job->grco.ctx), job->app);
+ if (NULL != bif) {
+ /*
+ PROGRESS: Reading input file (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 20);
+ /*
+ Process and close input
+ */
+ bmpp_run_for_bif(job, bif, filename);
+ dk4bif_close(bif);
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+
+
+#line 1594 "bmpp.ctr"
+}
+
+
+/** Construct output file name in job->onbuf.
+ @param job Job structure.
+ @param filename Source file name.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+bmpp_construct_output_file_name(
+ bmpp_job_t *job,
+ dkChar const *filename
+)
+{
+ dk4_er_t er;
+ dkChar const *psuf = NULL;
+ int back = 0;
+
+
+#line 1613 "bmpp.ctr"
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_PDF : { psuf = bmpp_kwnl[4]; } break;
+ case DK4_GRA_DRIVER_EPS : { psuf = bmpp_kwnl[5]; } break;
+ case DK4_GRA_DRIVER_PS : { psuf = bmpp_kwnl[6]; } break;
+ case DK4_GRA_DRIVER_PGF : {
+ psuf = bmpp_kwnl[7];
+ if (DK4_GRA_PURPOSE_DOCUMENT == job->grco.purpose) {
+ psuf = bmpp_kwnl[9];
+ }
+ } break;
+ case DK4_GRA_DRIVER_BB : { psuf = bmpp_kwnl[8]; } break;
+ }
+ if (NULL != psuf) {
+ dk4error_init(&er);
+ back = dk4path_set_suffix(
+ &(job->onbuf[0]), DK4_MAX_PATH, filename, psuf, &er
+ );
+ if (0 == back) {
+ /*
+ ERROR: Failed to construct output file name
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 5);
+ job->exval = EXIT_FAILURE;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1639 "bmpp.ctr"
+ }
+#endif
+ }
+ else {
+
+#line 1643 "bmpp.ctr"
+ /* ERROR: BUG */
+ }
+
+
+#line 1646 "bmpp.ctr"
+ return back;
+}
+
+
+
+/** Process one real file.
+ @param job Job structure.
+ @param filename File name to process.
+ @param tsc Flag: Timestamp check.
+*/
+static
+void
+bmpp_process_one_file(bmpp_job_t *job, dkChar const *filename, int tsc)
+{
+ dkChar const *osf; /* Source file name */
+ dk4_um_t osl; /* Source line number */
+ int res; /* Operation result */
+
+
+
+#line 1665 "bmpp.ctr"
+ /*
+ Save current source file name and line number settings
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set file to process as current source file
+ */
+ dk4app_set_log_source_file(job->app, filename);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Processing file (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 21);
+ /*
+ Construct output file name
+ */
+ res = bmpp_construct_output_file_name(job, filename);
+ if (0 != res) {
+
+#line 1684 "bmpp.ctr"
+ /*
+ If the -m option was specified and the file name was obtained
+ from directory traversal we must check whether to build a new
+ output file or not
+ */
+ if (0 == job->make_mode) {
+
+#line 1690 "bmpp.ctr"
+ tsc = 0;
+ }
+ if (0 != tsc) {
+
+#line 1693 "bmpp.ctr"
+ res = dk4makemode_must_rebuild(&(job->onbuf[0]), filename);
+ if (0 != res) {
+
+#line 1695 "bmpp.ctr"
+ tsc = 0;
+ }
+ }
+ if (0 == tsc) {
+
+#line 1699 "bmpp.ctr"
+ bmpp_run_for_file(job, filename);
+ }
+ else {
+
+#line 1702 "bmpp.ctr"
+ }
+ }
+ /* PROGRESS: Processing file (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 22);
+ /*
+ Restore previous source file and line number
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1713 "bmpp.ctr"
+}
+
+
+
+/** Process one directory.
+ @param job Job structure.
+ @param dirname Directory name.
+*/
+static
+void
+bmpp_process_one_directory(bmpp_job_t *job, dkChar const *dirname)
+{
+ dk4_er_t er; /* Error report */
+ dkChar const *shn; /* Short file name */
+ dk4_dir_t *dir; /* Directory traversal structure */
+ dkChar const *osf; /* Old source file name */
+ dk4_um_t osl; /* Old source line number */
+ int cc; /* Flag: Can continue */
+ int res; /* Operation result */
+
+
+
+#line 1734 "bmpp.ctr"
+ /*
+ Save current source file name and line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set current directory to process as source file name
+ */
+ dk4app_set_log_source_file(job->app, dirname);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Processing directory (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 23);
+ dir = dk4dir_open_app(dirname, DK4_DIR_OPEN_SORTED, job->app);
+ if (NULL != dir) {
+ cc = 1;
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(dir);
+ if (NULL != shn) {
+ /*
+ Check for item available
+ */
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ &(job->dtbuf[0]), DK4_MAX_PATH, dir, shn, &er
+ );
+ /*
+ If item available check file name suffix whether
+ it is an image, process the file
+ */
+ if (0 != res) {
+ if (-1 < dk4bif_type_for_suffix(&(job->dtbuf[0]))) {
+ bmpp_process_one_file(job, &(job->dtbuf[0]), 1);
+ }
+ else {
+ /* PROGRESS: Skipping unusable input file
+ */
+ dk4app_log_3(
+ job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS,
+ 25, 26, shn
+ );
+ }
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /*
+ ERROR: Failed to construct full path
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_ERROR,6);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(dir);
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ /* PROGRESS: Processing directory (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 24);
+ /*
+ Restore previous source file and line number settings
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1805 "bmpp.ctr"
+}
+
+
+
+/** Process one file name from the command line.
+ @param job Job structure.
+ @param filename File name, may be a file or a directory.
+*/
+static
+void
+bmpp_process_one_name(bmpp_job_t *job, dkChar const *filename)
+{
+ dk4_er_t er; /* Error report if check for regular file fails */
+ dkChar const *osf; /* Old source file name */
+ dk4_um_t osl; /* Old source line number */
+
+
+
+#line 1822 "bmpp.ctr"
+ /*
+ Save old source file name and line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set file name for error reporting to file name to process
+ */
+ dk4app_set_log_source_file(job->app, filename);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ Check whether to handle a directory or a regular file
+ */
+ if (0 != dk4file_is_directory(filename, NULL)) {
+ bmpp_process_one_directory(job, filename);
+ }
+ else {
+ dk4error_init(&er);
+ if (0 != dk4file_is_regular(filename, &er)) {
+ bmpp_process_one_file(job, filename, 0);
+ }
+ else {
+ /*
+ ERROR: Not a regular file
+ */
+ job->exval = EXIT_FAILURE;
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 7);
+ }
+ }
+ /*
+ Restore previous source file name and line number settings
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+
+#line 1858 "bmpp.ctr"
+}
+
+
+
+#if DK4_ON_WINDOWS
+
+/** Expand and process one file name.
+ @param job Job structure.
+ @param filename File name to expand, may be a file or a directory.
+*/
+static
+void
+bmpp_process_expand(bmpp_job_t *job, dkChar const *filename)
+{
+ dk4_er_t er; /* Error report */
+ dkChar const *shn; /* Short file name */
+ dkChar const *osf; /* Old source file name */
+ dk4_dir_t *fne; /* File name expander */
+ dk4_um_t osl; /* Old source line number */
+ int anyfound; /* Flag: Fount at least one file */
+ int cc; /* Flag: Can continue */
+ int res; /* Operation result */
+
+
+
+#line 1882 "bmpp.ctr"
+ /*
+ Save current source file name and source line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set source file name and line number
+ */
+ dk4app_set_log_source_file(job->app, filename);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ Open file name expander
+ */
+ /* PROGRESS: Processing pattern (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 27);
+ fne = dk4app_fne_open(filename, job->app);
+ if (NULL != fne) {
+ anyfound = 0;
+ /*
+ Process directories
+ */
+ cc = 1;
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_dir(fne);
+ if (NULL != shn) {
+ anyfound = 1;
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ &(job->exbuf[0]), DK4_MAX_PATH, fne, shn, &er
+ );
+ if (0 != res) {
+ bmpp_process_one_directory(job, &(job->exbuf[0]));
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /*
+ ERROR: Failed to construct full path
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_ERROR,6);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ /* Process regular files
+ */
+ cc = 1;
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(fne);
+ if (NULL != shn) {
+ anyfound = 1;
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ &(job->exbuf[0]), DK4_MAX_PATH, fne, shn, &er
+ );
+ if (0 != res) {
+ bmpp_process_one_file(job, &(job->exbuf[0]), 0);
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /*
+ ERROR: Failed to construct full path
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_ERROR,6);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(fne);
+ if ((0 != sig_can_continue(0)) && (0 == anyfound)) {
+ /*
+ ERROR: No such file
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 8);
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ /* PROGRESS: Processing pattern (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 28);
+ /* Restore previous source file name and line number
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1976 "bmpp.ctr"
+}
+
+#endif
+
+
+
+/** Process command line arguments.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_processing(bmpp_job_t *job)
+{
+ dkChar const *xargv; /* Current cmd line argument to process */
+ int xargc; /* Number of cmd line arguments */
+ int i; /* Traverse cmd line arguments */
+
+
+
+#line 1994 "bmpp.ctr"
+ /*
+ Retrieve number of command line file names
+ */
+ xargc = dk4app_get_argc(job->app);
+ if (0 < xargc) {
+ /*
+ Process command line file names, program name
+ is already stripped, so start index is 0
+ */
+ for (i = 0; ((i < xargc) && (0 != sig_can_continue(0))); i++) {
+ /*
+ For each file name: retrieve and process
+ */
+ xargv = dk4app_get_argv(job->app, i);
+ if (NULL != xargv) {
+#if DK4_ON_WINDOWS
+ /* On Windows command line arguments may use
+ wildcards (* or ?), we must expand such names
+ to real directory and file names
+ */
+ if (0 != dk4path_must_expand(xargv)) {
+ bmpp_process_expand(job, xargv);
+ }
+ else {
+ bmpp_process_one_name(job, xargv);
+ }
+#else
+ bmpp_process_one_name(job, xargv);
+#endif
+ }
+ }
+ }
+ else {
+ /* No file names specified on command line, run as filter
+ */
+ bmpp_run_as_filter(job);
+ }
+
+
+#line 2032 "bmpp.ctr"
+}
+
+
+
+#if 0
+static
+void
+bmpp_resolution_handling(
+ dk4_gra_conf_t *conf
+)
+{
+#if 0
+ if (0 != conf->img_ign_res) {
+ conf->img_ign_res = 0;
+ conf->xres = 72.0;
+ conf->yres = 72.0;
+ }
+#endif
+}
+#endif
+
+
+
+/** Run functionality after installing signal handlers:
+ Process options and configuration files, on success start processing.
+ @param job Job structure.
+*/
+static
+void
+bmpp_normal_run(bmpp_job_t *job)
+{
+ const dkChar *lpo = NULL; /* Arguments of -l options */
+ int ok = 1; /* Flag: No error occured */
+
+
+
+#line 2067 "bmpp.ctr"
+ /*
+ Process command line options
+ */
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('R'), NULL)) {
+ job->use_prefs = 0;
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('m'), NULL)) {
+ job->make_mode = 1;
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('l'), NULL)) {
+ lpo = dk4app_opt_get_string_ptr_short(job->app, dkT('l'), NULL);
+ }
+ /* Process argument of -l option, if any
+ */
+ if (NULL != lpo) {
+ ok = dk4gra_conf_setup(
+ &(job->grco), lpo, job->use_prefs, DK4_GRA_CONF_SCOPE_BMPP, job->app
+ );
+#if 0
+ bmpp_resolution_handling(&(job->grco));
+#endif
+ }
+ else {
+ if (0 != job->use_prefs) {
+ ok = dk4gra_conf_setup(
+ &(job->grco), NULL, 1, DK4_GRA_CONF_SCOPE_BMPP, job->app
+ );
+#if 0
+ bmpp_resolution_handling(&(job->grco));
+#endif
+ }
+ else {
+ ok = 1;
+ }
+ }
+ /* Do not use TeX output driver
+ */
+ if (DK4_GRA_DRIVER_PGF == job->grco.driver) {
+ ok = 0;
+ /* ERROR: Can not produce TeX output */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 2);
+ job->exval = EXIT_FAILURE;
+ }
+ /* Start processing if no errors yet
+ */
+ if (0 != ok) {
+
+#line 2113 "bmpp.ctr"
+ job->exval = EXIT_SUCCESS;
+ bmpp_run_processing(job);
+ }
+
+
+#line 2117 "bmpp.ctr"
+}
+
+
+
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_with_signal_handlers(bmpp_job_t *job)
+{
+#ifdef SIGPIPE
+ struct sigaction opipe;
+#endif
+ struct sigaction oint;
+#ifdef SIGPIPE
+ struct sigaction npipe;
+#endif
+ struct sigaction nint;
+ struct sigaction oterm;
+ struct sigaction nterm;
+ int success = 0;
+
+
+#line 2141 "bmpp.ctr"
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+#endif
+
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+
+ success = 1;
+ bmpp_normal_run(job);
+
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+ /* ERROR: Failed to restore old SIGTERM settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+#endif
+
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) { job->exval = EXIT_FAILURE; }
+
+
+#line 2242 "bmpp.ctr"
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_with_signal_handlers(bmpp_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+
+#line 2258 "bmpp.ctr"
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ bmpp_normal_run(job);
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+
+
+#line 2270 "bmpp.ctr"
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_with_signal_handlers(bmpp_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+
+#line 2286 "bmpp.ctr"
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ bmpp_normal_run(job);
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+
+
+#line 2298 "bmpp.ctr"
+}
+#else
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_with_signal_handlers(bmpp_job_t *job)
+{
+ bmpp_normal_run(job);
+}
+#endif
+#endif
+#endif
+
+
+
+/** Job structure, not on the stack because it is large.
+*/
+static bmpp_job_t job;
+
+
+
+/** Main function.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @return 0 on success, all other values indicate errors.
+*/
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
+{
+
+
+#line 2333 "bmpp.ctr"
+
+
+#line 2334 "bmpp.ctr"
+
+ /* Initialize job structure
+ */
+ bmpp_job_init(&job);
+ /*
+ Prepare stderr for diagnostic messages with dkChar strings
+ */
+ dk4fput_initialize_stderr();
+ /*
+ Create application structure
+ */
+ job.app = dk4app_open_cmd(
+ argc, argv, bmpp_options, bmpp_sz_options,
+ bmpp_kwnl[0], DKT_VERSION_DK,
+ bmpp_kwnl[1], bmpp_help_text, bmpp_license_text
+ );
+ if (NULL != job.app) {
+ /*
+ Retrieve localized string tables
+ */
+ job.sz_msg =
+ dk4app_string_table_size(bmpp_kw_def);
+ job.msg =
+ dk4app_string_table(job.app, bmpp_kwnl[2], bmpp_kw_def);
+ /*
+ Either run normally (do conversions)
+ or show help, version, and/or license information
+ */
+ if (0 != dk4app_can_run_normally(job.app)) {
+ bmpp_run_with_signal_handlers(&job);
+ }
+ else {
+ if (0 != dk4app_help_version_license(job.app)) {
+ job.exval = EXIT_SUCCESS;
+ }
+ }
+ /* Finally close application structure
+ */
+ dk4app_close(job.app);
+ }
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+
+
+#line 2377 "bmpp.ctr"
+
+
+#line 2378 "bmpp.ctr"
+ exit(job.exval); return job.exval;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/bmpp.ctr b/support/dktools/bmpp.ctr
new file mode 100644
index 0000000000..57c8e08995
--- /dev/null
+++ b/support/dktools/bmpp.ctr
@@ -0,0 +1,2383 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4PAPER_H_INCLUDED
+#include "dk4paper.h"
+#endif
+
+#ifndef DK4FILED_H_INCLUDED
+#include "dk4filed.h"
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#include "dk4dir.h"
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#include "dk4cs.h"
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef DK4DIRA_H_INCLUDED
+#include "dk4dira.h"
+#endif
+
+#ifndef DK4GRAA_H_INCLUDED
+#include "dk4graa.h"
+#endif
+
+#ifndef DK4GRCO_H_INCLUDED
+#include "dk4grco.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4BIFAP_H_INCLUDED
+#include "dk4bifap.h"
+#endif
+
+
+/** Job structure.
+*/
+typedef struct {
+ dkChar exbuf[DK4_MAX_PATH]; /**< File name expansion. */
+ dkChar dtbuf[DK4_MAX_PATH]; /**< Dir traversal. */
+ dkChar onbuf[DK4_MAX_PATH]; /**< Output file name. */
+ dk4_gra_conf_t grco; /**< Graphics configuration. */
+ dk4_app_t *app; /**< Application structure. */
+ const dkChar * const *msg; /**< Localized texts. */
+ size_t sz_msg; /**< Number of elements in msg. */
+ int use_prefs; /**< Flag: Use preferences. */
+ int make_mode; /**< Flag: Run in make mode. */
+ int exval; /**< Exit status code. */
+} bmpp_job_t;
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+%% module
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4FPUT_H_INCLUDED
+#include "dk4fput.h"
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef DK4AOPT_H_INCLUDED
+#include "dk4aopt.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#include "dk4dir.h"
+#endif
+
+#ifndef DK4DIRA_H_INCLUDED
+#include "dk4dira.h"
+#endif
+
+#ifndef DK4MM_H_INCLUDED
+#include "dk4mm.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4FOPDA_H_INCLUDED
+#include "dk4fopda.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#ifndef BMPP_H_INCLUDED
+#include "bmpp.h"
+#endif
+
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
+
+$!trace-include
+
+
+
+/** Default help text, shown if help text file is not found.
+*/
+static const dkChar * const bmpp_help_text[] = {
+$!text macro=dkT
+
+Convert PNG/JPEG/NetPBM/TIFF to PS/EPS/PDF
+
+bmpp -l <driver>.<purpose>,<key>=<value>... <options> [<file(s)>]
+
+Drivers: ps eps pdf bb
+
+Purposes: image object document
+
+Options:
+-l Set driver and purpose, add key=value options.
+-m Check modifications times, avoid unnecessary conversions.
+-R Reset program options to builtin defaults (skip configuration files).
+--help Show this short help text.
+--version Show version information.
+--manual *** SHOW FULL MANUAL. ***
+--license Show license information.
+
+See the full manual for the key=value options, run: bmpp --manual | more
+
+$!end
+};
+
+
+
+/** License text.
+*/
+static const dkChar * const bmpp_license_text[] = {
+$!text macro=dkT,preprocessor
+
+Overview
+========
+This software uses code from the following projects either directly
+or as a library:
+
+dktools Dirk Krause's tools and libraries.
+ See http://sourceforge.net/p/dktools/wiki/Home/ for information.
+#if DK4_HAVE_PNG_H
+
+libpng PNG reference library.
+ See http://www.libpng.org/pub/png/libpng.html for information.
+#endif
+#if DK4_HAVE_JPEGLIB_H
+
+jpeg Independent JPEG groups free JPEG library.
+ See http://www.ijg.org/ for information.
+#endif
+#if DK4_HAVE_TIFF_H
+
+libtiff TIFF library.
+ See http://www.remotesensing.org/libtiff/ for information.
+#endif
+#if DK4_HAVE_ZLIB_H
+
+zlib Compression library.
+ See http://www.zlib.net/ for information.
+#endif
+
+Your use of the bmpp program must be in compliance with the license conditions
+for the dktools project and the license conditions for all the libraries used
+by bmpp.
+
+License for the dktools project
+===============================
+Copyright (c) 2011-2018, Dirk Krause
+All rights reserved.
+
+Redistribution and use in source and binary forms,
+with or without modification, are permitted provided
+that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the name of the copyright holder(s) nor the names of contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.
+
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#if DK4_HAVE_PNG_H
+
+libpng license
+==============
+
+This copy of the libpng notices is provided for your convenience. In case of
+any discrepancy between this copy and the notices in the file png.h that is
+included in the libpng distribution, the latter shall prevail.
+
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+
+If you modify libpng you may insert additional notices immediately following
+this sentence.
+
+This code is released under the libpng license.
+
+libpng versions 1.2.6, August 15, 2004, through 1.2.46, July 9, 2011, are
+Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.2.5
+with the following individual added to the list of Contributing Authors
+
+ Cosmin Truta
+
+libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
+Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.0.6
+with the following individuals added to the list of Contributing Authors
+
+ Simon-Pierre Cadieux
+ Eric S. Raymond
+ Gilles Vollant
+
+and with the following additions to the disclaimer:
+
+ There is no warranty against interference with your enjoyment of the
+ library or against infringement. There is no warranty that our
+ efforts or the library will fulfill any of your particular purposes
+ or needs. This library is provided with all faults, and the entire
+ risk of satisfactory quality, performance, accuracy, and effort is with
+ the user.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-0.96,
+with the following individuals added to the list of Contributing Authors:
+
+ Tom Lane
+ Glenn Randers-Pehrson
+ Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996, 1997 Andreas Dilger
+Distributed according to the same disclaimer and license as libpng-0.88,
+with the following individuals added to the list of Contributing Authors:
+
+ John Bowler
+ Kevin Bracey
+ Sam Bushell
+ Magnus Holmgren
+ Greg Roelofs
+ Tom Tanner
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+ Andreas Dilger
+ Dave Martindale
+ Guy Eric Schalnat
+ Paul Schmidt
+ Tim Wegner
+
+The PNG Reference Library is supplied "AS IS". The Contributing Authors
+and Group 42, Inc. disclaim all warranties, expressed or implied,
+including, without limitation, the warranties of merchantability and of
+fitness for any purpose. The Contributing Authors and Group 42, Inc.
+assume no liability for direct, indirect, incidental, special, exemplary,
+or consequential damages, which may result from the use of the PNG
+Reference Library, even if advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+1. The origin of this source code must not be misrepresented.
+
+2. Altered versions must be plainly marked as such and must not
+ be misrepresented as being the original source.
+
+3. This Copyright notice may not be removed or altered from any
+ source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit, without
+fee, and encourage the use of this source code as a component to
+supporting the PNG file format in commercial products. If you use this
+source code in a product, acknowledgment is not required but would be
+appreciated.
+
+
+A "png_get_copyright" function is available, for convenient use in "about"
+boxes and the like:
+
+ printf("%s",png_get_copyright(NULL));
+
+Also, the PNG logo (in PNG format, of course) is supplied in the
+files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+
+Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
+certification mark of the Open Source Initiative.
+
+Glenn Randers-Pehrson
+glennrp at users.sourceforge.net
+July 9, 2011
+#endif
+#if DK4_HAVE_JPEGLIB_H
+
+jpeglib license
+===============
+
+In plain English:
+
+1. We don't promise that this software works. (But if you find any bugs,
+ please let us know!)
+2. You can use this software for whatever you want. You don't have to pay us.
+3. You may not pretend that you wrote this software. If you use it in a
+ program, you must acknowledge somewhere in your documentation that
+ you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose. This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library. If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it. This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it. (See the file
+ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh). Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses. For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs". This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+ "The Graphics Interchange Format(c) is the Copyright property of
+ CompuServe Incorporated. GIF(sm) is a Service Mark property of
+ CompuServe Incorporated."
+#endif
+#if DK4_HAVE_TIFF_H
+
+libtiff license
+===============
+
+Copyright (c) 1988-1997 Sam Leffler
+Copyright (c) 1991-1997 Silicon Graphics, Inc.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee, provided
+that (i) the above copyright notices and this permission notice appear in
+all copies of the software and related documentation, and (ii) the names of
+Sam Leffler and Silicon Graphics may not be used in any advertising or
+publicity relating to the software without the specific, prior written
+permission of Sam Leffler and Silicon Graphics.
+
+THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+OF THIS SOFTWARE.
+#endif
+#if DK4_HAVE_ZLIB_H
+
+zlib license
+============
+
+ (C) 1995-2004 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not*
+receiving lengthy legal documents to sign. The sources are provided
+for free but without warranty of any kind. The library has been
+entirely written by Jean-loup Gailly and Mark Adler; it does not
+include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include
+in the file ChangeLog history information documenting your changes. Please
+read the FAQ for more information on the distribution of modified source
+versions.
+#endif
+
+$!end
+};
+
+
+/** Keywords, not localized.
+*/
+static const dkChar * const bmpp_kwnl[] = {
+$!string-table macro=dkT
+#
+# 0 Program group name
+#
+dktools
+#
+# 1 Help text file name (full manual)
+#
+bmpp.txt
+#
+# 2 String table file name
+#
+bmpp.str
+#
+# 3 Dummy file name when processing standard input
+#
+<stdin>
+#
+# 4-9 File name suffixes for output files
+#
+.pdf
+.eps
+.ps
+.pgf
+.bb
+.tex
+$!end
+};
+
+
+/** Default text fragments if localized fragments are not found.
+*/
+static const dkChar * const bmpp_kw_def[] = {
+$!string-table macro=dkT
+#
+# 0-1 Signal handler installation
+#
+Failed to install signal handlers!
+Failed to restore signal handleres!
+#
+# 2 ERROR: The bmpp program can not produce TeX output!
+#
+The bmpp program can not produce TeX output!
+#
+# 3 ERROR: Illegal paper size
+#
+Incorrect paper size information, unusable!
+#
+# 4 ERROR: Failed to read NetPBM image from standard input!
+#
+Failed to read NetPBM image from standard input!
+#
+# 5
+#
+Failed to construct output file name!\n\tInput file name probably too long!
+#
+# 6
+#
+Failed to construct full path name!\n\tDirectory or file name too long!
+#
+# 7
+#
+Not a regular file!
+#
+# 8
+#
+No such file!
+#
+# 9
+#
+Preparing output (start).
+#
+# 10
+#
+Preparing output (finished).
+#
+# 11
+#
+Writing output file (start).
+#
+# 12
+#
+Writing output file (finished).
+#
+# 13
+#
+Processing standard input to standard output (start).
+#
+# 14
+#
+Processing standard input to standard output (finished).
+#
+# 15
+#
+Reading NetPBM image from standard input (start).
+#
+# 16
+#
+Reading NetPBM image from standard input (finished).
+#
+# 17-18
+#
+Writing output to standard output (start).
+Writing output to standard output (finished).
+#
+# 19-20
+#
+Reading input file (start).
+Reading input file (finished).
+#
+# 21-22
+#
+Processing file (start).
+Processing file (finished).
+#
+# 23-24
+#
+Processing directory (start).
+Processing directory (finished).
+#
+# 25-26
+#
+Not a usable input file: "
+".
+#
+# 27-28
+#
+Processing file name pattern (start).
+Processing file name pattern (finished).
+$!end
+};
+
+
+
+static const char * const bmpp_c8_kwnl[] = {
+$!string-table
+\%\%BoundingBox: 0 0
+
+\n
+#
+#
+#
+$!end
+};
+
+
+/** Options used by the program.
+*/
+static const dk4_option_specification_t bmpp_options[] = {
+
+ /* Language, purpose and key=value options
+ */
+ { dkT('l'), dkT("language"), DK4_OPT_ARG_STRING },
+
+ /* Make mode to avoid unnecessary conversions when processing directories
+ */
+ { dkT('m'), dkT("make"), DK4_OPT_ARG_NONE },
+
+ /* Skip preferences
+ */
+ { dkT('R'), dkT("reset"), DK4_OPT_ARG_NONE }
+
+};
+
+
+
+/** Number of options in bmpp_options array.
+*/
+static const size_t bmpp_sz_options =
+sizeof(bmpp_options) / sizeof(dk4_option_specification_t);
+
+
+
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
+
+/** Indicator: SIGTERM signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+
+
+
+/** Pass a volatile pointer to an atomic integer.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ptr Address of atomic integer variable.
+ @return The unmodified pointer.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
+{
+ return ptr;
+}
+
+
+
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
+*/
+static
+void
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
+}
+#endif
+
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
+static
+void
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
+}
+
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
+*/
+static
+void
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
+}
+
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
+
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
+*/
+static
+int
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
+{
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
+}
+
+
+
+/** Initialize job structure.
+ @param job Structure to initialize.
+*/
+static
+void
+bmpp_job_init(bmpp_job_t *job)
+{
+ $? "+ bmpp_job_init"
+ dk4gra_conf_init(&(job->grco));
+ job->app = NULL;
+ job->msg = bmpp_kw_def;
+ job->sz_msg = ((sizeof(bmpp_kw_def)/sizeof(DK4_PDKCHAR)) - 1);
+ job->use_prefs = 1;
+ job->make_mode = 0;
+ job->exval = EXIT_FAILURE;
+ DK4_MEMRES(&(job->exbuf[0]), (DK4_MAX_PATH * sizeof(dkChar)));
+ DK4_MEMRES(&(job->dtbuf[0]), (DK4_MAX_PATH * sizeof(dkChar)));
+ DK4_MEMRES(&(job->onbuf[0]), (DK4_MAX_PATH * sizeof(dkChar)));
+ $? "- bmpp_job_init"
+}
+
+
+
+/** Calculate bounding box dimensions for bitmap image file.
+ @param job Job structure.
+ @param pw Address of width variable.
+ @param ph Address of height variable.
+ @param bif Bitmap image file.
+*/
+static
+void
+bmpp_calculate_bounding_box(
+ bmpp_job_t *job,
+ size_t *pw,
+ size_t *ph,
+ double *cotra,
+ dk4_bif_t *bif
+)
+{
+ double xres;
+ double yres;
+ size_t w;
+ size_t h;
+ dk4_bif_dim_t orig_w;
+ dk4_bif_dim_t orig_h;
+ $? "+ bmpp_calculate_bounding_box"
+ orig_w = dk4bif_get_width(bif);
+ orig_h = dk4bif_get_height(bif);
+ w = (size_t)orig_w;
+ h = (size_t)orig_h;
+ if (NULL != cotra) {
+ cotra[0] = 0.0;
+ cotra[1] = 0.0;
+ cotra[2] = 0.0;
+ cotra[3] = (double)w;
+ cotra[4] = (double)h;
+ }
+ if (0 == job->grco.img_ign_res) {
+ xres = dk4bif_get_xres(bif);
+ yres = dk4bif_get_yres(bif);
+ if ((0.0 < xres) && (0.0 < yres)) {
+ if ((1.0e-5 < fabs(xres - 72.0)) || (1.0e-5 < fabs(yres - 72.0))) {
+ xres = (72.0 * (double)orig_w) / xres;
+ yres = (72.0 * (double)orig_h) / yres;
+ if (0 != dk4ma_is_finite(xres)) {
+ if (0 != dk4ma_is_finite(yres)) {
+ if ((double)(SIZE_MAX) > xres) {
+ if ((double)(SIZE_MAX) > yres) {
+ w = (size_t)ceil(xres);
+ h = (size_t)ceil(yres);
+ if (NULL != cotra) {
+ cotra[0] = ((double)w - xres) / 2.0;
+ cotra[1] = ((double)h - yres) / 2.0;
+ cotra[3] = xres;
+ cotra[4] = yres;
+ if (0.0 > cotra[0]) { cotra[0] = 0.0; }
+ if (0.0 > cotra[1]) { cotra[1] = 0.0; }
+ if (1.0e-5 > fabs(cotra[0])) {
+ cotra[0] = 0.0;
+ }
+ if (1.0e-5 > fabs(cotra[1])) {
+ cotra[1] = 0.0;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ *pw = w;
+ *ph = h;
+ $? "- bmpp_calculate_bounding_box"
+}
+
+
+
+/** Produce bounding box file.
+ @param job Job structure.
+ @param bif Bitmap image file.
+ @param filename Input file name currently processed, NULL for stdin.
+*/
+static
+void
+bmpp_produce_bb(
+ bmpp_job_t *job,
+ dk4_bif_t *bif,
+ dkChar const *filename
+)
+{
+ char wbuf[16*sizeof(dk4_um_t)]; /* Buffer for width as text */
+ char hbuf[16*sizeof(dk4_um_t)]; /* Buffer for height as text */
+ FILE *fipo; /* Output file */
+ double deltares; /* Resolution difference */
+ size_t w; /* Image width */
+ size_t h; /* Image height */
+ int res; /* Operation result */
+ int tests = DK4_FOPEN_SC_USER; /* Tests for fopen */
+
+ $? "+ bmpp_produce_bb \"%!ds\"", TR_STR(filename)
+ if (0 != dk4isadmin()) {
+ tests = DK4_FOPEN_SC_PRIVILEGED;
+ }
+
+ /*
+ Check for different resolutions and ignore res option
+ */
+ if (0 != job->grco.img_ign_res) {
+ deltares = fabs(bif->cf->res_y - bif->cf->res_x);
+ if (DK4_BIF_EPSILON_ASPECT <= deltares) {
+ dk4bif_warn_aspect_ratio_change(
+ bif, 72.0, 72.0, job->app
+ );
+ }
+ }
+ bmpp_calculate_bounding_box(job, &w, &h, NULL, bif);
+ res = dk4ma_write_c8_decimal_unsigned(
+ wbuf, sizeof(wbuf), (dk4_um_t)w, 0, NULL
+ );
+ if (0 != res) {
+ res = dk4ma_write_c8_decimal_unsigned(
+ hbuf, sizeof(hbuf), (dk4_um_t)h, 0, NULL
+ );
+ if (0 != res) {
+ if (NULL != filename) {
+ fipo = dk4fopen_app(&(job->onbuf[0]),dkT("w"),tests,job->app);
+ if (NULL != fipo) {
+ fputs(bmpp_c8_kwnl[0], fipo);
+ fputs(wbuf, fipo);
+ fputs(bmpp_c8_kwnl[1], fipo);
+ fputs(hbuf, fipo);
+ fputs(bmpp_c8_kwnl[2], fipo);
+ if (0 != fclose(fipo)) {
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to close fipo
+ */
+ dk4app_log_base1(job->app, DK4_LL_ERROR, 128);
+ }
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to open file, already reported */
+ }
+ }
+ else {
+ fputs(bmpp_c8_kwnl[0], stdout);
+ fputs(wbuf, stdout);
+ fputs(bmpp_c8_kwnl[1], stdout);
+ fputs(hbuf, stdout);
+ fputs(bmpp_c8_kwnl[2], stdout);
+ }
+ }
+ else { $? "! h"
+ /* ERROR: Failed to convert h to string */
+ }
+ }
+ else { $? "! w"
+ /* ERROR: Failed to convert w to string */
+ }
+ $? "- bmpp_produce_bb"
+}
+
+
+
+/** Check paper size in job configuration.
+ @param job Job structure.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+bmpp_check_papersize(
+ bmpp_job_t *job
+)
+{
+ double xl; /* Left x position */
+ double xr; /* Right x position */
+ double yb; /* Bottom y position */
+ double yt; /* Top y position */
+ int back = 0;
+
+ xl = job->grco.media.i;
+ xr = job->grco.media.w - job->grco.media.o;
+ yb = job->grco.media.b;
+ yt = job->grco.media.h - job->grco.media.t;
+ if ((isgreater(xr,xl)) && (isgreater(yt,yb))) {
+ back = 1;
+ }
+ if (0 == back) {
+ /*
+ ERROR: Illegal paper size
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 3);
+ job->exval = EXIT_FAILURE;
+ }
+ return back;
+}
+
+
+
+/** Produce document.
+ @param job Job structure.
+ @param bif Bitmap image file.
+ @param filename Input file name currently processed, NULL for stdin.
+*/
+static
+void
+bmpp_produce_document(
+ bmpp_job_t *job,
+ dk4_bif_t *bif,
+ dkChar const *filename
+)
+{
+ dk4_gra_t *gra = NULL; /* Graphics output structure */
+ dkChar const *osf; /* Old source file name */
+ double xl; /* Left image border */
+ double xr; /* Right image border */
+ double yb; /* Bottom image border */
+ double yt; /* Top image border */
+ double deltares; /* Resolution difference */
+ dk4_um_t osl; /* Old source line number */
+ size_t w = 0; /* Paper width */
+ size_t h = 0; /* Paper height */
+ size_t nfrm = 0; /* Number of frames in bitmap image */
+ size_t cf = 0; /* Current frame */
+ int docfl = 0; /* Document flags */
+ int imgfl = 0; /* Image flags */
+ int ok = 0; /* Flag: No error occured */
+
+ $? "+ bmpp_produce_document \"%!ds\"", TR_STR(filename)
+ if (0 != bmpp_check_papersize(job)) { $? ". paper size ok"
+ /*
+ Retrieve document and image flag from configuration structure
+ */
+ docfl = dk4gra_conf_flags_document(&(job->grco));
+ imgfl = dk4gra_conf_flags_image(&(job->grco));
+ /*
+ Apply some corrections to the flags
+ */
+ imgfl &= (~(DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO));
+ imgfl &= (~(DK4_GRA_IMG_FLAG_ALLOW_ROTATION));
+ imgfl |= DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS;
+ if (DK4_GRA_DRIVER_PDF == job->grco.driver) {
+ imgfl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND; $? ". fill bg"
+ }
+ /* Obtain image dimensions
+ */
+ w = (size_t)ceil(job->grco.media.w); $? ". w = %u", (unsigned)w
+ h = (size_t)ceil(job->grco.media.h); $? ". h = %u", (unsigned)h
+ /*
+ Open graphics output structure
+ */
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_PDF : { $? ". open pdf"
+ imgfl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+ gra = dk4gra_app_open_pdf(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, job->app
+ );
+ } break;
+ case DK4_GRA_DRIVER_PS : { $? ". open ps"
+ gra = dk4gra_app_open_ps(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, job->app
+ );
+ } break;
+ case DK4_GRA_DRIVER_PGF : { $? ". open pgf"
+ gra = dk4gra_app_open_pgf(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, 0, job->app
+ );
+ } break;
+ }
+ if (NULL != gra) { $? ". gra"
+ ok = 1;
+ /*
+ PROGRESS: Preparing output (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 9);
+ /*
+ Traverse all frames of source image
+ */
+ nfrm = dk4bif_get_number_of_frames(bif);
+ $? ". nfrm = %u", (unsigned)nfrm
+ for (cf = 0; cf < nfrm; cf++) {
+ $? ". frame %u / %u", (unsigned)cf, (unsigned)nfrm
+ /*
+ Switch to selected frame
+ */
+ if (0 != dk4bif_set_current_frame(bif, cf)) {
+ /*
+ Check for different resolutions and ignore res option
+ */
+ if (0 != job->grco.img_ign_res) {
+ deltares = fabs(bif->cf->res_y - bif->cf->res_x);
+ if (DK4_BIF_EPSILON_ASPECT <= deltares) {
+ dk4bif_warn_aspect_ratio_change(
+ bif, 72.0, 72.0, job->app
+ );
+ }
+ }
+ /*
+ If a resolution was configured, use it
+ */
+ if ((0.0 < job->grco.xres) && (0.0 < job->grco.yres)) {
+ dk4bif_set_res_app(
+ bif, job->grco.xres, job->grco.yres, job->app
+ );
+ }
+ /*
+ Add new page to graphics output
+ */
+ dk4gra_app_page(gra, &ok, job->app); $? ". page"
+ /*
+ Calculate paper range available for image
+ */
+ xl = job->grco.media.i;
+ xr = job->grco.media.w - job->grco.media.o;
+ yb = job->grco.media.b;
+ yt = job->grco.media.h - job->grco.media.t;
+ if ((size_t)0U != (cf % (size_t)2U)) { $? ". tumble"
+ if (0 != job->grco.doc_tumble) {
+ yb = job->grco.media.t;
+ yt = job->grco.media.h - job->grco.media.b;
+ }
+ else {
+ if (0 != job->grco.doc_duplex) { $? ". duplex"
+ xl = job->grco.media.o;
+ xr = job->grco.media.w - job->grco.media.i;
+ }
+ }
+ }
+ /* Add image to paper range
+ */
+ dk4gra_app_bif_image(
+ gra /* gra */ ,
+ xl /* xl */ ,
+ xr /* xr */ ,
+ yb /* yb */ ,
+ yt /* yt */ ,
+ bif /* bif */ ,
+ filename /* filename */ ,
+ cf /* frameno */ ,
+ imgfl /* Image flags */ ,
+ NULL /* bbptr */ ,
+ &ok /* backptr */ ,
+ job->app /* app */
+ );
+ }
+ else { $? "! failed to set frame"
+ ok = 0;
+ }
+ $? ". ok = %d at end of frame %u", ok, (unsigned)cf
+ }
+ /* PROGRESS: Preparing output (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 10);
+ /*
+ Write output file and close graphics output if
+ succeeded so for, otherwise simply close graphics
+ */
+ if (1 == ok) { $? ". write and close"
+ /*
+ Use output file name in diagnostics,
+ save previous settings
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, &(job->onbuf[0]));
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Writing output file (start)
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_PROGRESS,11);
+ /*
+ Write output file and close graphics structure
+ */
+ dk4gra_app_write_and_close(gra, &ok, job->app);
+ gra = NULL;
+ /*
+ PROGRESS: Writing output file (finished)
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_PROGRESS,12);
+ /*
+ Restore previous settings for file and line
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ }
+ else { $? ". simply close"
+ dk4gra_close(gra);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! gra"
+ }
+#endif
+ if (0 == ok) {
+ job->exval = EXIT_FAILURE;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! paper size"
+ }
+#endif
+ $? "- bmpp_produce_document"
+}
+
+
+
+/** Produce image or object.
+ @param job Job structure.
+ @param bif Bitmap image file.
+ @param filename Input file name currently processed, NULL for stdin.
+*/
+static
+void
+bmpp_produce_image_or_object(
+ bmpp_job_t *job,
+ dk4_bif_t *bif,
+ dkChar const *filename
+)
+{
+ double cotra[8]; /* 5 used: xshift yshift rotation xscale yscale */
+ dkChar const *osf; /* Old source file name */
+ dk4_gra_t *gra = NULL; /* Graphics output structure */
+ double deltares; /* Resolution difference */
+ dk4_um_t osl; /* Old source line number */
+ size_t w; /* Image width */
+ size_t h; /* Image height */
+ int docfl; /* Document flags for opening graphics structure */
+ int imgfl; /* Image flags */
+ int ok = 0; /* Flag: No errors */
+
+ $? "+ bmpp_produce_image_or_object \"%!ds\"", TR_STR(filename)
+ /*
+ Set flags used to open graphics output and to apply image
+ */
+ docfl = dk4gra_conf_flags_document(&(job->grco));
+ docfl |= DK4_GRA_PAGE_FLAG_NO_BG;
+ imgfl = dk4gra_conf_flags_image(&(job->grco));
+ imgfl |= DK4_GRA_IMG_FLAG_FILL_BACKGROUND;
+ imgfl |= DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS;
+ if (DK4_GRA_DRIVER_PDF == job->grco.driver) {
+ if (DK4_GRA_PURPOSE_OBJECT == job->grco.purpose) {
+ imgfl &= (~(DK4_GRA_IMG_FLAG_FILL_BACKGROUND));
+ }
+ }
+ /* Check for different resolutions and ignore res option
+ */
+ if (0 != job->grco.img_ign_res) {
+ deltares = fabs(bif->cf->res_y - bif->cf->res_x);
+ if (DK4_BIF_EPSILON_ASPECT <= deltares) {
+ dk4bif_warn_aspect_ratio_change(bif, 72.0, 72.0, job->app);
+ }
+ }
+ /* If a resolution was configured, use it
+ */
+ if ((0.0 < job->grco.xres) && (0.0 < job->grco.yres)) {
+ dk4bif_set_res_app(bif, job->grco.xres, job->grco.yres, job->app);
+ }
+ /* Calculate bounding box and coordinates transformations
+ */
+ bmpp_calculate_bounding_box(job, &w, &h, cotra, bif);
+ /*
+ Open graphics output structure
+ */
+ $? ". open graphics output structure"
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_PDF : { $? ". open pdf"
+ gra = dk4gra_app_open_pdf(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, job->app
+ );
+ } break;
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : { $? ". open ps"
+ gra = dk4gra_app_open_ps(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, job->app
+ );
+ } break;
+ case DK4_GRA_DRIVER_PGF : { $? ". open pgf"
+ gra = dk4gra_app_open_pgf(
+ ((NULL != filename) ? (&(job->onbuf[0])) : NULL),
+ w, h, docfl, 0, job->app
+ );
+ } break;
+ }
+ if (NULL != gra) { $? ". gra"
+ /*
+ Add page and apply image
+ */
+ ok = 1;
+ /*
+ PROGRESS: Preparing output (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 9);
+ /*
+ Start new page
+ */
+ dk4gra_app_page(gra, &ok, job->app);
+ /*
+ Add bitmap image to page
+ */
+ dk4gra_app_bif_cotra_image(
+ gra, cotra, bif, filename, 0, imgfl, &ok, job->app
+ );
+ /* PROGRESS: Preparing output (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 10);
+ /*
+ If success so far, write output file
+ */
+ if (1 == ok) { $? ". ok"
+ /*
+ Prepare output file name for diagnostics
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, &(job->onbuf[0]));
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Writing output file (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 11);
+ /*
+ Write output file
+ */
+ $? ". going to write and close graphics"
+ dk4gra_app_write_and_close(gra, &ok, job->app);
+ gra = NULL;
+ /*
+ PROGRESS: Writing output file (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 12);
+ /*
+ Restore previous source file and line
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ }
+ else { $? "! ok"
+ dk4gra_close(gra);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! gra"
+ }
+#endif
+ if (0 == ok) {
+ job->exval = EXIT_FAILURE;
+ }
+ $? "- bmpp_produce_image_or_object"
+}
+
+
+
+/** Process one bitmap image file.
+ @param job Job structure.
+ @param bif Bitmap image file.
+ @param filename Input file name currently processed, NULL for stdin.
+*/
+static
+void
+bmpp_run_for_bif(
+ bmpp_job_t *job,
+ dk4_bif_t *bif,
+ dkChar const *filename
+)
+{
+ $? "+ bmpp_run_for_bif \"%!ds\"", TR_STR(filename)
+ dk4bif_set_current_frame(bif, 0);
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_BB : {
+ bmpp_produce_bb(job, bif, filename);
+ } break;
+ default : {
+ switch (job->grco.purpose) {
+ case DK4_GRA_PURPOSE_DOCUMENT : {
+ bmpp_produce_document(job, bif, filename);
+ } break;
+ default : {
+ bmpp_produce_image_or_object(job, bif, filename);
+ } break;
+ }
+ } break;
+ }
+ $? "- bmpp_run_for_bif"
+}
+
+
+
+/** Run as filter if no file names were specified on the command line.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_as_filter(bmpp_job_t *job)
+{
+ dk4_er_t er; /* Error report */
+ dkChar const *osf; /* Old source file name */
+ dk4_bif_t *bif; /* Bitmap image file */
+ dk4_um_t osl; /* Old source line number */
+#if DK4_ON_WINDOWS
+ int osm; /* Old stdin mode */
+#endif
+ $? "+ bmpp_run_as_filter"
+ /*
+ Save current source file name and source line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set source file name and line number
+ */
+ dk4app_set_log_source_file(job->app, bmpp_kwnl[3]);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Processing stdin to stdout (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 13);
+
+ /*
+ Read and process image
+ */
+ dk4error_init(&er);
+ /*
+ On Windows we have to set stdin to binary mode exlicitly
+ and restore previous mode when done
+ */
+#if DK4_ON_WINDOWS
+ osm = _setmode(_fileno(stdin), _O_BINARY);
+#endif
+ /* PROGRESS: Reading NetPBM from stdin (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 15);
+ bif = dk4bif_open_file(
+ stdin, NULL, DK4_BIF_TYPE_NETPBM, 0, &(job->grco.ctx), &er
+ );
+ /*
+ PROGRESS: Reading NetPBM from stdin (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 16);
+#if DK4_ON_WINDOWS
+ _setmode(_fileno(stdin), osm);
+#endif
+ if (NULL != bif) {
+ /*
+ PROGRESS: Writing output to stdout (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 17);
+ /*
+ Write the output
+ */
+ bmpp_run_for_bif(job, bif, NULL);
+ /*
+ PROGRESS: Writing output to stdout (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 18);
+ dk4bif_close(bif);
+ }
+ else {
+ /*
+ ERROR: Failed to open BIF
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 4);
+ job->exval = EXIT_FAILURE;
+ }
+ /* PROGRESS: Processing stdin to stdout (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 14);
+ /* Restore previous source file name and line number
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- bmpp_run_as_filter"
+}
+
+
+
+/** Run for one input file.
+ @param job Job structure.
+ @param filename Input file name to process.
+*/
+static
+void
+bmpp_run_for_file(
+ bmpp_job_t *job,
+ dkChar const *filename
+)
+{
+ dk4_bif_t *bif; /* Bitmap image file */
+ int ho = 0; /* Flag: Read image header only */
+ $? "+ bmpp_run_for_file \"%!ds\"", filename
+ /*
+ To calculate the bounding box it is sufficient to read
+ image header
+ */
+ if (DK4_GRA_DRIVER_BB == job->grco.driver) {
+ ho = 1;
+ }
+ /* Read and process image
+ */
+ /* PROGRESS: Reading input file (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 19);
+ bif = dk4bif_open_app(filename, ho, &(job->grco.ctx), job->app);
+ if (NULL != bif) {
+ /*
+ PROGRESS: Reading input file (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 20);
+ /*
+ Process and close input
+ */
+ bmpp_run_for_bif(job, bif, filename);
+ dk4bif_close(bif);
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ $? "- bmpp_run_for_file"
+}
+
+
+/** Construct output file name in job->onbuf.
+ @param job Job structure.
+ @param filename Source file name.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+bmpp_construct_output_file_name(
+ bmpp_job_t *job,
+ dkChar const *filename
+)
+{
+ dk4_er_t er;
+ dkChar const *psuf = NULL;
+ int back = 0;
+ $? "+ bmpp_construct_output_file_name \"%!ds\"", filename
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_PDF : { psuf = bmpp_kwnl[4]; } break;
+ case DK4_GRA_DRIVER_EPS : { psuf = bmpp_kwnl[5]; } break;
+ case DK4_GRA_DRIVER_PS : { psuf = bmpp_kwnl[6]; } break;
+ case DK4_GRA_DRIVER_PGF : {
+ psuf = bmpp_kwnl[7];
+ if (DK4_GRA_PURPOSE_DOCUMENT == job->grco.purpose) {
+ psuf = bmpp_kwnl[9];
+ }
+ } break;
+ case DK4_GRA_DRIVER_BB : { psuf = bmpp_kwnl[8]; } break;
+ }
+ if (NULL != psuf) {
+ dk4error_init(&er);
+ back = dk4path_set_suffix(
+ &(job->onbuf[0]), DK4_MAX_PATH, filename, psuf, &er
+ );
+ if (0 == back) {
+ /*
+ ERROR: Failed to construct output file name
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 5);
+ job->exval = EXIT_FAILURE;
+ }
+#if TRACE_DEBUG
+ else { $? ". ofn=\"%!ds\"", &(job->onbuf[0])
+ }
+#endif
+ }
+ else { $? "! bug"
+ /* ERROR: BUG */
+ }
+ $? "- bmpp_construct_output_file_name %d", back
+ return back;
+}
+
+
+
+/** Process one real file.
+ @param job Job structure.
+ @param filename File name to process.
+ @param tsc Flag: Timestamp check.
+*/
+static
+void
+bmpp_process_one_file(bmpp_job_t *job, dkChar const *filename, int tsc)
+{
+ dkChar const *osf; /* Source file name */
+ dk4_um_t osl; /* Source line number */
+ int res; /* Operation result */
+
+ $? "+ bmpp_process_one_file \"%!ds\"", filename
+ /*
+ Save current source file name and line number settings
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set file to process as current source file
+ */
+ dk4app_set_log_source_file(job->app, filename);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Processing file (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 21);
+ /*
+ Construct output file name
+ */
+ res = bmpp_construct_output_file_name(job, filename);
+ if (0 != res) { $? ". have output file name"
+ /*
+ If the -m option was specified and the file name was obtained
+ from directory traversal we must check whether to build a new
+ output file or not
+ */
+ if (0 == job->make_mode) { $? ". make mode is 0"
+ tsc = 0;
+ }
+ if (0 != tsc) { $? ". must check timestamps"
+ res = dk4makemode_must_rebuild(&(job->onbuf[0]), filename);
+ if (0 != res) { $? ". must build new output file"
+ tsc = 0;
+ }
+ }
+ if (0 == tsc) { $? ". must run"
+ bmpp_run_for_file(job, filename);
+ }
+ else { $? ". must not run"
+ }
+ }
+ /* PROGRESS: Processing file (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 22);
+ /*
+ Restore previous source file and line number
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- bmpp_process_one_file"
+}
+
+
+
+/** Process one directory.
+ @param job Job structure.
+ @param dirname Directory name.
+*/
+static
+void
+bmpp_process_one_directory(bmpp_job_t *job, dkChar const *dirname)
+{
+ dk4_er_t er; /* Error report */
+ dkChar const *shn; /* Short file name */
+ dk4_dir_t *dir; /* Directory traversal structure */
+ dkChar const *osf; /* Old source file name */
+ dk4_um_t osl; /* Old source line number */
+ int cc; /* Flag: Can continue */
+ int res; /* Operation result */
+
+ $? "+ bmpp_process_one_directory \"%!ds\"", dirname
+ /*
+ Save current source file name and line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set current directory to process as source file name
+ */
+ dk4app_set_log_source_file(job->app, dirname);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ PROGRESS: Processing directory (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 23);
+ dir = dk4dir_open_app(dirname, DK4_DIR_OPEN_SORTED, job->app);
+ if (NULL != dir) {
+ cc = 1;
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(dir);
+ if (NULL != shn) {
+ /*
+ Check for item available
+ */
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ &(job->dtbuf[0]), DK4_MAX_PATH, dir, shn, &er
+ );
+ /*
+ If item available check file name suffix whether
+ it is an image, process the file
+ */
+ if (0 != res) {
+ if (-1 < dk4bif_type_for_suffix(&(job->dtbuf[0]))) {
+ bmpp_process_one_file(job, &(job->dtbuf[0]), 1);
+ }
+ else {
+ /* PROGRESS: Skipping unusable input file
+ */
+ dk4app_log_3(
+ job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS,
+ 25, 26, shn
+ );
+ }
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /*
+ ERROR: Failed to construct full path
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_ERROR,6);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(dir);
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ /* PROGRESS: Processing directory (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 24);
+ /*
+ Restore previous source file and line number settings
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- bmpp_process_one_directory"
+}
+
+
+
+/** Process one file name from the command line.
+ @param job Job structure.
+ @param filename File name, may be a file or a directory.
+*/
+static
+void
+bmpp_process_one_name(bmpp_job_t *job, dkChar const *filename)
+{
+ dk4_er_t er; /* Error report if check for regular file fails */
+ dkChar const *osf; /* Old source file name */
+ dk4_um_t osl; /* Old source line number */
+
+ $? "+ bmpp_process_one_name \"%!ds\"", filename
+ /*
+ Save old source file name and line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set file name for error reporting to file name to process
+ */
+ dk4app_set_log_source_file(job->app, filename);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ Check whether to handle a directory or a regular file
+ */
+ if (0 != dk4file_is_directory(filename, NULL)) {
+ bmpp_process_one_directory(job, filename);
+ }
+ else {
+ dk4error_init(&er);
+ if (0 != dk4file_is_regular(filename, &er)) {
+ bmpp_process_one_file(job, filename, 0);
+ }
+ else {
+ /*
+ ERROR: Not a regular file
+ */
+ job->exval = EXIT_FAILURE;
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 7);
+ }
+ }
+ /*
+ Restore previous source file name and line number settings
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+ $? "- bmpp_process_one_name"
+}
+
+
+
+#if DK4_ON_WINDOWS
+
+/** Expand and process one file name.
+ @param job Job structure.
+ @param filename File name to expand, may be a file or a directory.
+*/
+static
+void
+bmpp_process_expand(bmpp_job_t *job, dkChar const *filename)
+{
+ dk4_er_t er; /* Error report */
+ dkChar const *shn; /* Short file name */
+ dkChar const *osf; /* Old source file name */
+ dk4_dir_t *fne; /* File name expander */
+ dk4_um_t osl; /* Old source line number */
+ int anyfound; /* Flag: Fount at least one file */
+ int cc; /* Flag: Can continue */
+ int res; /* Operation result */
+
+ $? "+ bmpp_process_expand \"%!ds\"", filename
+ /*
+ Save current source file name and source line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ /*
+ Set source file name and line number
+ */
+ dk4app_set_log_source_file(job->app, filename);
+ dk4app_set_log_source_line(job->app, (dk4_um_t)0UL);
+ /*
+ Open file name expander
+ */
+ /* PROGRESS: Processing pattern (start)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 27);
+ fne = dk4app_fne_open(filename, job->app);
+ if (NULL != fne) {
+ anyfound = 0;
+ /*
+ Process directories
+ */
+ cc = 1;
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_dir(fne);
+ if (NULL != shn) {
+ anyfound = 1;
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ &(job->exbuf[0]), DK4_MAX_PATH, fne, shn, &er
+ );
+ if (0 != res) {
+ bmpp_process_one_directory(job, &(job->exbuf[0]));
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /*
+ ERROR: Failed to construct full path
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_ERROR,6);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ /* Process regular files
+ */
+ cc = 1;
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(fne);
+ if (NULL != shn) {
+ anyfound = 1;
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ &(job->exbuf[0]), DK4_MAX_PATH, fne, shn, &er
+ );
+ if (0 != res) {
+ bmpp_process_one_file(job, &(job->exbuf[0]), 0);
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /*
+ ERROR: Failed to construct full path
+ */
+ dk4app_log_1(job->app,job->msg,job->sz_msg,DK4_LL_ERROR,6);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(fne);
+ if ((0 != sig_can_continue(0)) && (0 == anyfound)) {
+ /*
+ ERROR: No such file
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 8);
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ /* PROGRESS: Processing pattern (finished)
+ */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 28);
+ /* Restore previous source file name and line number
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- bmpp_process_expand"
+}
+
+#endif
+
+
+
+/** Process command line arguments.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_processing(bmpp_job_t *job)
+{
+ dkChar const *xargv; /* Current cmd line argument to process */
+ int xargc; /* Number of cmd line arguments */
+ int i; /* Traverse cmd line arguments */
+
+ $? "+ bmpp_run_processing"
+ /*
+ Retrieve number of command line file names
+ */
+ xargc = dk4app_get_argc(job->app);
+ if (0 < xargc) {
+ /*
+ Process command line file names, program name
+ is already stripped, so start index is 0
+ */
+ for (i = 0; ((i < xargc) && (0 != sig_can_continue(0))); i++) {
+ /*
+ For each file name: retrieve and process
+ */
+ xargv = dk4app_get_argv(job->app, i);
+ if (NULL != xargv) {
+#if DK4_ON_WINDOWS
+ /* On Windows command line arguments may use
+ wildcards (* or ?), we must expand such names
+ to real directory and file names
+ */
+ if (0 != dk4path_must_expand(xargv)) {
+ bmpp_process_expand(job, xargv);
+ }
+ else {
+ bmpp_process_one_name(job, xargv);
+ }
+#else
+ bmpp_process_one_name(job, xargv);
+#endif
+ }
+ }
+ }
+ else {
+ /* No file names specified on command line, run as filter
+ */
+ bmpp_run_as_filter(job);
+ }
+ $? "- bmpp_run_processing"
+}
+
+
+
+#if 0
+static
+void
+bmpp_resolution_handling(
+ dk4_gra_conf_t *conf
+)
+{
+#if 0
+ if (0 != conf->img_ign_res) {
+ conf->img_ign_res = 0;
+ conf->xres = 72.0;
+ conf->yres = 72.0;
+ }
+#endif
+}
+#endif
+
+
+
+/** Run functionality after installing signal handlers:
+ Process options and configuration files, on success start processing.
+ @param job Job structure.
+*/
+static
+void
+bmpp_normal_run(bmpp_job_t *job)
+{
+ const dkChar *lpo = NULL; /* Arguments of -l options */
+ int ok = 1; /* Flag: No error occured */
+
+ $? "+ bmpp_normal_run"
+ /*
+ Process command line options
+ */
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('R'), NULL)) {
+ job->use_prefs = 0;
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('m'), NULL)) {
+ job->make_mode = 1;
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('l'), NULL)) {
+ lpo = dk4app_opt_get_string_ptr_short(job->app, dkT('l'), NULL);
+ }
+ /* Process argument of -l option, if any
+ */
+ if (NULL != lpo) {
+ ok = dk4gra_conf_setup(
+ &(job->grco), lpo, job->use_prefs, DK4_GRA_CONF_SCOPE_BMPP, job->app
+ );
+#if 0
+ bmpp_resolution_handling(&(job->grco));
+#endif
+ }
+ else {
+ if (0 != job->use_prefs) {
+ ok = dk4gra_conf_setup(
+ &(job->grco), NULL, 1, DK4_GRA_CONF_SCOPE_BMPP, job->app
+ );
+#if 0
+ bmpp_resolution_handling(&(job->grco));
+#endif
+ }
+ else {
+ ok = 1;
+ }
+ }
+ /* Do not use TeX output driver
+ */
+ if (DK4_GRA_DRIVER_PGF == job->grco.driver) {
+ ok = 0;
+ /* ERROR: Can not produce TeX output */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 2);
+ job->exval = EXIT_FAILURE;
+ }
+ /* Start processing if no errors yet
+ */
+ if (0 != ok) { $? ". can run"
+ job->exval = EXIT_SUCCESS;
+ bmpp_run_processing(job);
+ }
+ $? "- bmpp_normal_run"
+}
+
+
+
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_with_signal_handlers(bmpp_job_t *job)
+{
+#ifdef SIGPIPE
+ struct sigaction opipe;
+#endif
+ struct sigaction oint;
+#ifdef SIGPIPE
+ struct sigaction npipe;
+#endif
+ struct sigaction nint;
+ struct sigaction oterm;
+ struct sigaction nterm;
+ int success = 0;
+ $? "+ bmpp_run_with_signal_handlers (sigaction)"
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+#endif
+
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+
+ success = 1;
+ bmpp_normal_run(job);
+
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+ /* ERROR: Failed to restore old SIGTERM settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+#endif
+
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) { job->exval = EXIT_FAILURE; }
+ $? "- bmpp_run_with_signal_handlers"
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_with_signal_handlers(bmpp_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+ $? "+ bmpp_run_with_signal_handlers (sigset)"
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ bmpp_normal_run(job);
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+ $? "- bmpp_run_with_signal_handlers"
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_with_signal_handlers(bmpp_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+ $? "+ bmpp_run_with_signal_handlers (signal)"
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ bmpp_normal_run(job);
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+ $? "- bmpp_run_with_signal_handlers"
+}
+#else
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+bmpp_run_with_signal_handlers(bmpp_job_t *job)
+{
+ bmpp_normal_run(job);
+}
+#endif
+#endif
+#endif
+
+
+
+/** Job structure, not on the stack because it is large.
+*/
+static bmpp_job_t job;
+
+
+
+/** Main function.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @return 0 on success, all other values indicate errors.
+*/
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
+{
+ $!trace-init bmpp.deb
+ $? "+ main"
+
+ /* Initialize job structure
+ */
+ bmpp_job_init(&job);
+ /*
+ Prepare stderr for diagnostic messages with dkChar strings
+ */
+ dk4fput_initialize_stderr();
+ /*
+ Create application structure
+ */
+ job.app = dk4app_open_cmd(
+ argc, argv, bmpp_options, bmpp_sz_options,
+ bmpp_kwnl[0], DKT_VERSION_DK,
+ bmpp_kwnl[1], bmpp_help_text, bmpp_license_text
+ );
+ if (NULL != job.app) {
+ /*
+ Retrieve localized string tables
+ */
+ job.sz_msg =
+ dk4app_string_table_size(bmpp_kw_def);
+ job.msg =
+ dk4app_string_table(job.app, bmpp_kwnl[2], bmpp_kw_def);
+ /*
+ Either run normally (do conversions)
+ or show help, version, and/or license information
+ */
+ if (0 != dk4app_can_run_normally(job.app)) {
+ bmpp_run_with_signal_handlers(&job);
+ }
+ else {
+ if (0 != dk4app_help_version_license(job.app)) {
+ job.exval = EXIT_SUCCESS;
+ }
+ }
+ /* Finally close application structure
+ */
+ dk4app_close(job.app);
+ }
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ $? "- main %d", job.exval
+ $!trace-end
+ exit(job.exval); return job.exval;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/bmpp.h b/support/dktools/bmpp.h
new file mode 100644
index 0000000000..413689faea
--- /dev/null
+++ b/support/dktools/bmpp.h
@@ -0,0 +1,93 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: bmpp.ctr
+*/
+
+/** @file bmpp.h Header file for the bmpp module.
+*/
+
+#ifndef BMPP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define BMPP_H_INCLUDED 1
+
+
+#line 9 "bmpp.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4PAPER_H_INCLUDED
+#include "dk4paper.h"
+#endif
+
+#ifndef DK4FILED_H_INCLUDED
+#include "dk4filed.h"
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#include "dk4dir.h"
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#include "dk4cs.h"
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef DK4DIRA_H_INCLUDED
+#include "dk4dira.h"
+#endif
+
+#ifndef DK4GRAA_H_INCLUDED
+#include "dk4graa.h"
+#endif
+
+#ifndef DK4GRCO_H_INCLUDED
+#include "dk4grco.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4BIFAP_H_INCLUDED
+#include "dk4bifap.h"
+#endif
+
+
+/** Job structure.
+*/
+typedef struct {
+ dkChar exbuf[DK4_MAX_PATH]; /**< File name expansion. */
+ dkChar dtbuf[DK4_MAX_PATH]; /**< Dir traversal. */
+ dkChar onbuf[DK4_MAX_PATH]; /**< Output file name. */
+ dk4_gra_conf_t grco; /**< Graphics configuration. */
+ dk4_app_t *app; /**< Application structure. */
+ const dkChar * const *msg; /**< Localized texts. */
+ size_t sz_msg; /**< Number of elements in msg. */
+ int use_prefs; /**< Flag: Use preferences. */
+ int make_mode; /**< Flag: Run in make mode. */
+ int exval; /**< Exit status code. */
+} bmpp_job_t;
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+
+#endif
diff --git a/support/dktools/bmpp.rc b/support/dktools/bmpp.rc
index 6501936c49..e719088182 100644
--- a/support/dktools/bmpp.rc
+++ b/support/dktools/bmpp.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -19,14 +19,14 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "Comments", "Bitmap to PS/PDF converter\0"
+ VALUE "Comments", "Bitmap to PDF/(E)PS converter\0"
VALUE "CompanyName", "Dirk Krause\0"
- VALUE "FileDescription", "Bitmap to PS/PDF converter\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileDescription", "Bitmap to PDF/(E)PS converter\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "bmpp\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/bsdlic.txt b/support/dktools/bsdlic.txt
index 2bcfaf4b19..2b59c72cc8 100644
--- a/support/dktools/bsdlic.txt
+++ b/support/dktools/bsdlic.txt
@@ -1,35 +1,25 @@
-Copyright (c) 2002-2016, Dirk Krause
-All rights reserved.
+Copyright (c) 2002-2020 Dirk Krause. All rights reserved
-Redistribution and use in source and binary forms,
-with or without modification, are permitted provided
-that the following conditions are met:
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-* Redistributions in binary form must reproduce the above
- opyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of
- contributors may be used to endorse or promote
- products derived from this software without specific
- prior written permission.
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/support/dktools/choose-dir.xpm b/support/dktools/choose-dir.xpm
deleted file mode 100644
index e2e52ce4a6..0000000000
--- a/support/dktools/choose-dir.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static const char *xpm_choose_dir[] = {
-/* width height ncolors chars_per_pixel */
-"16 15 16 1",
-/* colors */
-" c #AFAFAF",
-". c #786401",
-"X c #9B8202",
-"o c #FFD400",
-"O c #ECECEC",
-"+ c #A68C05",
-"@ c #B69700",
-"# c #B0B0B0",
-"$ c #846E00",
-"% c #403502",
-"& c #6B5A01",
-"* c #FFFFFF",
-"= c #BFBFBF",
-"- c #AF9100",
-"; c #B3B3B3",
-": c None",
-/* pixels */
-"::::::::::::::::",
-"::::::::::::::::",
-"::::&++X%X++&%::",
-":::%X@@%$@@@$.::",
-"::&...&&...X-X::",
-"::-oooooooooo-::",
-"::-oooooooooo-::",
-"::-oooooooooo-::",
-"::-oooooooooo-::",
-"::-oooooooooo-::",
-"::-oooooooooo-::",
-"::-oooooooooo-::",
-"::.++++++++++.::",
-"::::::::::::::::",
-"::::::::::::::::"
-};
diff --git a/support/dktools/conf.vc b/support/dktools/conf.vc
index bb4f93b31b..a9f9b41cf3 100644
--- a/support/dktools/conf.vc
+++ b/support/dktools/conf.vc
@@ -150,10 +150,12 @@ CONF_NETSNMP_LIBDIR=/LIBPATH:"$(CONF_USEDLIBDIR)\lib"
CONF_NETSNMP_LIBFILE=netsnmp.lib
CONF_WX_AVAILABLE=1
-CONF_WX_VERSION=3.1.0
+# CONF_WX_VERSION=3.1.0
+CONF_WX_VERSION=3.0.4
# CONF_WX_VERSION=3.0.2
# CONF_WX_VERSION=2.8.12
-CONF_WX_SHORTVERSION=31
+# CONF_WX_SHORTVERSION=31
+CONF_WX_SHORTVERSION=30
# CONF_WX_SHORTVERSION=30
# CONF_WX_SHORTVERSION=28
CONF_WX_DEF=-DDK4_HAVE_WXWIDGETS=1 -DDK3_HAVE_WXWIDGETS=1 \
diff --git a/support/dktools/config.h.in b/support/dktools/config.h.in
index e12e8d3030..d420e262ce 100644
--- a/support/dktools/config.h.in
+++ b/support/dktools/config.h.in
@@ -1,3 +1,8 @@
+/*
+Copyright 2020-@THISYEAR@, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file config.h Configure script constant names.
ALL NAMES LISTED HERE MUST ALSO BE DEFINED IN THE win32/dk4conf.h FILE!
@@ -18,6 +23,14 @@ can not be run.
*/
#define HAVE_INLINE 0
+/** Flag: Use inline keyword.
+*/
+#define USE_INLINE 0
+
+/** The __attribute__((unused)) syntax from gcc is available.
+*/
+#define HAVE_ATTRIBUTE_UNUSED 0
+
/** Net-SNMP library.
*/
#define HAVE_LIBNETSNMP 0
@@ -150,6 +163,14 @@ can not be run.
*/
#define HAVE_STDLIB_H 0
+/** Header file sysexits.h.
+*/
+#define HAVE_SYSEXITS_H 0
+
+/** Init system is systemd.
+*/
+#define HAVE_SYSTEMD 0
+
/** Type generic mathematics.
*/
#define HAVE_TGMATH_H 0
@@ -200,6 +221,10 @@ can not be run.
*/
#define HAVE_SYS_TIME_H 0
+/** Include file memory.h
+*/
+#define HAVE_MEMORY_H 0
+
/** Further string functions on some systems.
*/
#define HAVE_STRINGS_H 0
@@ -278,7 +303,7 @@ can not be run.
*/
#define HAVE_NDBM_H 0
-/** Include file ntifs.h
+/** Include file ntifs.h.
*/
#define HAVE_NTIFS_H 0
@@ -286,6 +311,18 @@ can not be run.
*/
#define HAVE_WXWIDGETS 0
+/** Include file wx/chartype.h.
+*/
+#define HAVE_WX_CHARTYPE_H 0
+
+/** Include file wx/wxchar.h.
+*/
+#define HAVE_WX_WXCHAR_H 0
+
+/** Include file wx/defs.h.
+*/
+#define HAVE_WX_DEFS_H 0
+
/** Size of long long data type.
*/
#define HAVE_LONG_LONG 0
@@ -330,6 +367,10 @@ can not be run.
*/
#define SIZEOF_INTMAX_T 0
+/** Size of int32_t data type.
+*/
+#define SIZEOF_INT32_T 0
+
/** Size of double data type.
*/
#define SIZEOF_DOUBLE 0
@@ -350,14 +391,6 @@ can not be run.
*/
#define SIZEOF_INO_T 0
-/** Size of off64_t data type.
-*/
-#define SIZEOF_OFF64_T 0
-
-/** Size of ino64_t data type.
-*/
-#define SIZEOF_INO64_T 0
-
/** Flag: Use time.h and sys/time.h together.
*/
#define TIME_WITH_SYS_TIME 0
@@ -866,6 +899,22 @@ can not be run.
*/
#define HAVE_SETVBUF 0
+/** Macro isgreater().
+*/
+#define HAVE_ISGREATER 0
+
+/** Macro issgreaterequal().
+*/
+#define HAVE_ISGREATEREQUAL 0
+
+/** Macro issless().
+*/
+#define HAVE_ISLESS 0
+
+/** Macro isslessequal().
+*/
+#define HAVE_ISLESSEQUAL 0
+
/** Makro isfinite().
*/
#define HAVE_ISFINITE 0
@@ -1103,6 +1152,14 @@ can not be run.
*/
#define HAVE_SETGID 0
+/** Function setgroups().
+*/
+#define HAVE_SETGROUPS 0
+
+/** Function initgroups().
+*/
+#define HAVE_INITGROUPS 0
+
/** Function setpgrp().
*/
#define HAVE_SETPGRP 0
@@ -1143,6 +1200,18 @@ can not be run.
*/
#define HAVE_WRITE 0
+/** Include file search.h.
+*/
+#define HAVE_SEARCH_H 0
+
+/** Function qsort().
+*/
+#define HAVE_QSORT 0
+
+/** Function bsearch().
+*/
+#define HAVE_BSEARCH 0
+
/** Function have_png_get_pixels_per_inch().
*/
#define HAVE_PNG_GET_PIXELS_PER_INCH 0
@@ -1220,6 +1289,7 @@ can not be run.
#define HAVE_MPCTL 0
#define HAVE_MYSQL_LIBRARY_END 0
#define HAVE_MYSQL_LIBRARY_INIT 0
+#define HAVE_MARIADB_MYSQL_H 0
#define HAVE_MYSQL_MYSQL_H 0
#define HAVE_MYSQL_H 0
#define HAVE_MYSQL_SET_CHARACTER_SET 0
diff --git a/support/dktools/configure b/support/dktools/configure
index 1ef2e963d4..c43e0c8771 100755
--- a/support/dktools/configure
+++ b/support/dktools/configure
@@ -621,6 +621,163 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
+THISYEAR
+SUITE
+systemddir
+LIBSPRIVATE
+WXPQDICRES
+WXIMGSZRES
+WXDKSCRSZRES
+WXDKHTBRES
+WXDKFCSRES
+WXDKCTRES
+WXDKCLOCKRES
+WXBMPPRES
+WPRCLEANRES
+WINPRINTRES
+PLPDFTEXRES
+LPRNGCLRES
+ITADMINRES
+HTMLBOOKRES
+FIG2LATRES
+DKWXWIZRES
+DKWXPATHRES
+DKWTRES
+DKWTADMRES
+DKT2LRES
+DKT2HRES
+DKT2DBRES
+DKSQLSPLITRES
+DKSORTRES
+DKSENDRES
+DKRECVRES
+DKRANDRES
+DKPWGENRES
+DKPWDRES
+DKLSRES
+DKLINESRES
+DKHEXRES
+DKFICRES
+DKERADISKRES
+DKDBTRES
+DKDBCORES
+DKDB2TRES
+DKCTRES
+DKCATRES
+DKBMMRES
+DKBLKSRES
+DKBIN2CRES
+DK4INFORES
+DK3INFORES
+BMPPRES
+ADDCTRLDRES
+GETSOURCE
+ITADMINLIBS
+ITADMINLIBF
+LPRNGCLLIBS
+LPRNGCLLIBF
+RSHDOWNLIBS
+RSHDOWNLIBF
+PRINTQDCLIBS
+PRINTQDCLIBF
+PRMONSNMPLIBS
+PRMONSNMPLIBF
+PJSNMPLIBS
+PJSNMPLIBF
+PRINTQDALIBS
+PRINTQDALIBF
+PRINTQDILIBS
+PRINTQDILIBF
+PRINTQDLIBS
+PRINTQDLIBF
+WXDKHTBLIBS
+WXDKHTBLIBF
+WXDKCLOCKLIBS
+WXDKCLOCKLIBF
+WXIMGSZLIBS
+WXIMGSZLIBF
+WXPQDICLIBS
+WXPQDICLIBF
+WXDKFCSLIBS
+WXDKFCSLIBF
+WXBMPPLIBS
+WXBMPPLIBF
+WXDKDRAWLIBS
+WXDKDRAWLIBF
+WXDKCTLIBS
+WXDKCTLIBF
+CHSCRSZLIBS
+CHSCRSZLIBF
+WINPRINTLIBS
+WINPRINTLIBF
+DKWXPATHLIBS
+DKWXPATHLIBF
+DKWXWIZLIBS
+DKWXWIZLIBF
+PLPDFTEXLIBS
+PLPDFTEXLIBF
+DK3INFOLIBS
+DK3INFOLIBF
+WPRCLEANLIBS
+WPRCLEANLIBF
+DKWTLIBS
+DKWTLIBF
+HTMLBOOKLIBS
+HTMLBOOKLIBF
+WXD2LATLIBS
+WXD2LATLIBF
+FIG2LATLIBS
+FIG2LATLIBF
+BMPPLIBS
+BMPPLIBF
+DKDBTLIBS
+DKDBTLIBF
+ADDCTRLDLIBS
+ADDCTRLDLIBF
+DKCTLIBS
+DKCTLIBF
+DK4INFOLIBF
+DK4INFOLIBS
+DKDBT2LIBS
+DKDBT2LIBF
+DKSENDLIBS
+DKSENDLIBF
+DKRECVLIBS
+DKRECVLIBF
+DKPWDLIBS
+DKPWDLIBF
+DKBMMLIBS
+DKBMMLIBF
+DKHEXLIBS
+DKHEXLIBF
+DKBIN2CLIBS
+DKBIN2CLIBF
+DKT2LLIBS
+DKT2LLIBF
+DKT2HLIBS
+DKT2HLIBF
+DKRANDLIBS
+DKRANDLIBF
+DKPWGENLIBS
+DKPWGENLIBF
+DKUIDLIBS
+DKUIDLIBF
+DKFICLIBS
+DKFICLIBF
+DKLINESLIBS
+DKLINESLIBF
+DKSORTLIBS
+DKSORTLIBF
+DKLSLIBS
+DKLSLIBF
+DKERADISKLIBS
+DKERADISKLIBF
+DKSQLSPLITLIBS
+DKSQLSPLITLIBF
+DKBLKSLIBS
+DKBLKSLIBF
+DKCATLIBS
+DKCATLIBF
LIBDK3WXLIBS
LIBDK3WXLIBF
LIBDK3FIGLIBS
@@ -647,16 +804,26 @@ LIBDK4SOCKALIBS
LIBDK4SOCKALIBF
LIBDK4PPPTALIBS
LIBDK4PPPTALIBF
+LIBDK4GRAALIBS
+LIBDK4GRAALIBF
+LIBDK4BIFALIBS
+LIBDK4BIFALIBF
LIBDK4APPLIBS
LIBDK4APPLIBF
LIBDK4PPPTLIBS
LIBDK4PPPTLIBF
+LIBDK4GRALIBS
+LIBDK4GRALIBF
+LIBDK4BIFLIBS
+LIBDK4BIFLIBF
LIBDK4MDRNDLIBS
LIBDK4MDRNDLIBF
LIBDK4SOCKLIBS
LIBDK4SOCKLIBF
LIBDK4LATLIBS
LIBDK4LATLIBF
+LIBDK4LATALIBS
+LIBDK4LATALIBF
LIBDK4CLIBS
LIBDK4CLIBF
LIBDK4DBILIBS
@@ -679,25 +846,12 @@ LIBDK4MALIBS
LIBDK4MALIBF
LIBDK4BASELIBS
LIBDK4BASELIBF
-RTLIB
-LIBSPRIVATE
-INSTALLMANPAGES
-WINUNICODE
-ENTRY
-GUILIB
-CLILIB
-MAKE
-GETSOURCE
-WXDKFCSLIBS
-WXDKFCSLIBF
-NETSNMP_CFLAGS
-MYSQLLIB
-NETSNMP_LIBS
SOLIBDK4DBIA
SOLIBDK4DBI
SOLIBDK4SOCKA
SOLIBDK4SOCK
SOLIBDK4LAT
+SOLIBDK4LATA
SOLIBDK4APP
SOLIBDK4PPPT
SOLIBDK4MDRND
@@ -727,144 +881,117 @@ SOLIBCRYPTO
SOLIBMATH
SOLIBBZ
SOLIBZ
+LPRNGGROUP
+LPRNGUSER
+LIBDK4WXOBJ
+LIBDK3WXOBJ
+MOD_DK4DMT
+MOD_DK3WREG
+WXVERSION
WXLDFLAGS
-WXCFLAGS
WXCXXFLAGS
+WXCFLAGS
WXCPPFLAGS
-TESTPROGRAMS
-SNMP_PROG_CLI
+GUILIB
+CLILIB
+WINGUILIB
+WINCLILIB
+NETSNMP_CFLAGS
+NETSNMP_LIBS
MYSQLLDFLAGS
-MYSQL_PROG_CLI
-NET_PROG_CLI
-NET_PROG_RES
-LIB_SH_GUI
-LIB_SH_CLI
-LIB_SH_RES
+MYSQLLIB
+DBLIBSOCK
+DBLIB
+PTHREADLIB
+RTLIB
NSLLIB
SOCKLIB
-PROGSOPENSSL
-DK4INFOLIBF
-DK4INFOLIBS
-DKDBT2LIBS
-DKDBT2LIBF
-DKSENDLIBS
-DKSENDLIBF
-DKRECVLIBS
-DKRECVLIBF
-DKPWDLIBS
-DKPWDLIBF
-DKBMMLIBS
-DKBMMLIBF
-DKHEXLIBS
-DKHEXLIBF
-DKT2LLIBS
-DKT2LLIBF
-DKT2HLIBS
-DKT2HLIBF
-DKRANDLIBS
-DKRANDLIBF
-DKPWGENLIBS
-DKPWGENLIBF
-DKUIDLIBS
-DKUIDLIBF
-DKFICLIBS
-DKFICLIBF
-DKSORTLIBS
-DKSORTLIBF
-DKLSLIBS
-DKLSLIBF
-DKERADISKLIBS
-DKERADISKLIBF
-DKSQLSPLITLIBS
-DKSQLSPLITLIBF
-DKBLKSLIBS
-DKBLKSLIBF
-DKCATLIBS
-DKCATLIBF
+FS64
CRYPTO
-CWARN
+LIBTIFF
+LIBJPEG
+LIBPNG
+BZLIB
+ZLIB
+rundir
+RESCRULE
+RESEXT
+RCEXT
+FOUND_SYSTEMD
+INSTALL_INDEP
+INSTALL_LIBS
+INSTALL_PROGRAMS
+BUILD_ARCH
+RES_GUI_WINDOWS
+MAN_GUI_WINDOWS
+PRG_GUI_WINDOWS
+RES_CLI_WINDOWS
+MAN_CLI_WINDOWS
+PRG_CLI_WINDOWS
+RES_CLI_POSIX
+MAN_CLI_POSIX
+PRG_CLI_POSIX
+RES_GUI_SSL
+MAN_GUI_SSL
+PRG_GUI_SSL
+RES_CLI_SSL
+MAN_CLI_SSL
+PRG_CLI_SSL
+RES_CLI_MYSQL
+MAN_CLI_MYSQL
+PRG_CLI_MYSQL
+RES_CLI_SNMP
+MAN_CLI_SNMP
+PRG_CLI_SNMP
+RES_CLI_NET_POSIX
+MAN_CLI_NET_POSIX
+PRG_CLI_NET_POSIX
+RES_GUI_NET
+MAN_GUI_NET
+PRG_GUI_NET
+RES_CLI_NET
+MAN_CLI_NET
+PRG_CLI_NET
+RES_RES_NET_DE
+RES_RES_NET_EN
+RES_RES_NET
+MAN_RES_NET
+PRG_RES_NET
+LIB_SHARED_RES_NET
SOVERS
VERSNO
-SHLIBSTYLE
+TOOLCHAIN
UNAME
+CROSSBUILD
+TARGETCLASS
+BUILDCLASS
+TARGETHOST
+BUILDHOST
+LDFLCXX_GUI
+LDFLCXX_CLI_WX
+LDFLCXX_CLI_DK
+LDFLCXX_CLI_C8
+LDFLC_CLI_DK
+LDFLC_CLI_C8
+CXXFL_GUI
+CXXFL_CLI_WX
+CXXFL_CLI_DK
+CXXFL_CLI_C8
+CFL_CLI_DK
+CFL_CLI_C8
+MKSOCHECKSYMBOLS
+MKSORPATHLINK
+MKSORPATH
RPATHLINK
RPATH
+MKSOLIBCPP
MKSOLIB
-RES_INSTALL
-LIBS_INSTALL
-LIBS_SHARED
-LIBS_STATIC
-LIBRARIES
-PROGRAMS
-CFPIC
-BZLIB
-ZLIB
-FS64
-ITADMINLIBS
-ITADMINLIBF
-LPRNGCLLIBS
-LPRNGCLLIBF
-RSHDOWNLIBS
-RSHDOWNLIBF
-PRINTQDCLIBS
-PRINTQDCLIBF
-PRMONSNMPLIBS
-PRMONSNMPLIBF
-PJSNMPLIBS
-PJSNMPLIBF
-PRINTQDALIBS
-PRINTQDALIBF
-PRINTQDILIBS
-PRINTQDILIBF
-PRINTQDLIBS
-PRINTQDLIBF
-WXDKHTBLIBS
-WXDKHTBLIBF
-WXDKCLOCKLIBS
-WXDKCLOCKLIBF
-WXIMGSZLIBS
-WXIMGSZLIBF
-WXPQDICLIBS
-WXPQDICLIBF
-WXBMPPLIBS
-WXBMPPLIBF
-WXDKCTLIBS
-WXDKCTLIBF
-DKWXWIZLIBS
-DKWXWIZLIBF
-PLPDFTEXLIBS
-PLPDFTEXLIBF
-DK3INFOLIBS
-DK3INFOLIBF
-HTMLBOOKLIBS
-HTMLBOOKLIBF
-FIG2LATLIBS
-FIG2LATLIBF
-BMPPLIBS
-BMPPLIBF
-DKDBTLIBS
-DKDBTLIBF
-ADDCTRLDLIBS
-ADDCTRLDLIBF
-DKCTLIBS
-DKCTLIBF
-LIBDK4WXTOBUILD
-LIBDK4WXOBJ
-LIBDK3WXOBJ
-PTHREADLIB
-CLI_MYSQLPROG
-DBLIBSOCK
-DBLIB
-LIBTIFF
-LIBJPEG
-LIBPNG
-CLI_SNMPPROG
-ANYDB
-CURL
-WGET
-NM
-AR
-RANLIB
+DELTARGETSO
+DELTARGET
+INSTALL
+RCFLAGS
+EGREP
+GREP
host_os
host_vendor
host_cpu
@@ -873,14 +1000,21 @@ build_os
build_vendor
build_cpu
build
+CURL
+WGET
+GMAKE
+MAKE
+PKG_CONFIG
+WINDRES
+NM
+AR
+RANLIB
LN_S
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
SED
MKDIR_P
-EGREP
-GREP
ac_ct_CXX
CXXFLAGS
CXX
@@ -911,6 +1045,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -933,18 +1068,21 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
-enable_inline
+with_suite
+with_systemd
+with_windows
+enable_devel
enable_static
enable_shared
enable_packaging
-enable_ndbm
+enable_link_so_so
+enable_rpath
+enable_man_pages
+enable_debug
enable_warnings
-enable_more_warnings
-with_suite
-with_man
-with_corrections
-with_fallback_limits
-with_printf_scanf
+enable_assert
+enable_corrections
+enable_fallback
'
ac_precious_vars='build_alias
host_alias
@@ -996,6 +1134,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1248,6 +1387,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1385,7 +1533,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1538,6 +1686,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1569,22 +1718,25 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-inline Allow use of inline keyword (no / yes)
- --enable-static Allow building static libraries (yes / no)
- --enable-shared Allow building shared libraries (yes / no)
- --enable-packaging Binaries use shared libraries (no / yes)
- --enable-ndbm Explicitly enable/disable NDBM if found
- --enable-warnings Enable high warning level, gcc only (yes / no)
- --enable-more-warnings Enable yet more warnings, gcc only (no / yes)
+ --enable-devel Enable developer support (yes / no)
+ --enable-static Build static libraries (yes / no)
+ --enable-shared Build shared libraries (no / yes)
+ --enable-packaging Build for package creation (no / yes)
+ --enable-link-so-so Link so libs with so libs (no / yes)
+ --enable-rpath Use -rpath when linking executables (no / yes)
+ --enable-man-pages Install man pages (yes / no)
+ --enable-debug Allow debug information (no / yes)
+ --enable-warnings Enable additional warnings for gcc (yes / no)
+ --enable-assert Use assertions (no / yes)
+ --enable-corrections Corrections for Solaris (no / yes)
+ --enable-fallback Enable fallback values for num limits (no / yes)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-suite=name Software suite to build: auto / gui / cli / rescue
- --with-man Install man pages (auto / yes / no)
- --with-corrections Enable corrections for Solaris: no / yes
- --with-fallback-limits Allow use of fallback limits (no / yes)
- --with-printf-scanf Allow use of printf and scanf (yes / no)
+ --with-suite Software suite to build (auto / gui / cli / rescue)
+ --with-systemd=DIR Directory for service unit files / yes / no
+ --with-windows Compile for Windows version (7 / XP)
Some influential environment variables:
CC C compiler command
@@ -1791,79 +1943,6 @@ fi
} # ac_fn_cxx_try_compile
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
@@ -1951,6 +2030,125 @@ fi
} # ac_fn_c_check_header_mongrel
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
# --------------------------------------------
# Tries to find the compile-time value of EXPR in a program that includes
@@ -2134,52 +2332,6 @@ rm -f conftest.val
} # ac_fn_c_compute_int
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -2598,6 +2750,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
ac_config_headers="$ac_config_headers config.h"
ac_ext=c
@@ -3783,491 +3937,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes; then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_bigendian=no
-else
- ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
- no)
- ;; #(
- universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
- ;; #(
- *)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
@@ -4512,78 +4181,6 @@ else
$as_echo "no, using $LN_S" >&6; }
fi
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
@@ -4860,458 +4457,272 @@ else
NM="$ac_cv_prog_NM"
fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_WINDRES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$WINDRES"; then
+ ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-echo 'CC = ' $CC `which $CC`
-echo 'CXX = ' $CXX `which $CXX`
-
-
-
-FORCESOLINKING="no"
-
-USESOLINKING="no"
-
-INSTALLMANPAGES='install-manpages'
-
-LIBSPRIVATE=""
-
-MANINST='auto'
-
-EXVAL=0
-
-SOLCOR='no'
-
-CFPIC=''
-MKSOLIB=''
-SHLIBSTYLE=''
-UNAME=''
-WXCPPFLAGS=''
-WXCXXFLAGS=''
-WXCFLAGS=''
-WXLDFLAGS=''
-SUITE='auto'
-ENASTATIC='auto'
-ENASHARED='auto'
-PROGRAMS=''
-LIBRARIES=''
-LIBS_STATIC=''
-LIBS_SHARED=''
-LIBS_INSTALL=''
-RES_INSTALL=''
-RPATH=''
-RPATHLINK=''
-CWARN=''
-FOUND_GDBM='no'
-FOUND_NDBM='no'
-FOUND_BDB='no'
-USE_NDBM='auto'
-NET_PROG_RES=''
-NET_PROG_CLI=''
-MYSQL_PROG_CLI=''
-SNMP_PROG_CLI=''
-MYSQLLDFLAGS=''
-MYSQLLIB=''
-RTLIB=''
-SOLIBZ=''
-SOLIBBZ=''
-SOLIBMATH=''
-SOLIBCRYPTO=''
-SOLIBNET=''
-SOLIBIMG=''
-SOLIBSDBI=''
-SOLIBWX=''
-SOLIBDK3PORT=''
-SOLIBDK3C=''
-SOLIBDK3OF=''
-SOLIBDK3CSRND=''
-SOLIBDK3BIF=''
-SOLIBDK3DBI=''
-SOLIBDK3FIG=''
-SOLIBDK3BMEPS=''
-SOLIBDK3NET=''
-SOLIBDK4BASE=''
-SOLIBDK4MA=''
-SOLIBDK4MAIO8H=''
-SOLIBDK4MAIOWH=''
-SOLIBDK4MAIODH=''
-SOLIBDK4MAIO8D=''
-SOLIBDK4MAIOWD=''
-SOLIBDK4MAIODD=''
-SOLIBDK4C=''
-SOLIBDK4MDRND=''
-SOLIBDK4PPPT=''
-SOLIBDK4APP=''
-SOLIBDK4LAT=''
-SOLIBDK4SOCK=''
-SOLIBDK4SOCKA=''
-SOLIBDK4DBI=''
-SOLIBDK4DBIA=''
-LIBDK4BASELIBF=''
-LIBDK4BASELIBS=''
-LIBDK4MALIBF=''
-LIBDK4MALIBS=''
-LIBDK4MAIO8DLIBF=''
-LIBDK4MAIO8DLIBS=''
-LIBDK4MAIOWDLIBF=''
-LIBDK4MAIOWDLIBS=''
-LIBDK4MAIODDLIBF=''
-LIBDK4MAIODDLIBS=''
-LIBDK4MAIOXDLIBF=''
-LIBDK4MAIOXDLIBS=''
-LIBDK4MAIO8HLIBF=''
-LIBDK4MAIO8HLIBS=''
-LIBDK4MAIOWHLIBF=''
-LIBDK4MAIOWHLIBS=''
-LIBDK4MAIODHLIBF=''
-LIBDK4MAIODHLIBS=''
-LIBDK4DBILIBF=''
-LIBDK4DBILIBS=''
-LIBDK4CLIBF=''
-LIBDK4CLIBS=''
-LIBDK4LATLIBF=''
-LIBDK4LATLIBS=''
-LIBDK4SOCKLIBF=''
-LIBDK4SOCKLIBS=''
-LIBDK4MDRNDLIBF=''
-LIBDK4MDRNDLIBS=''
-LIBDK4PPPTLIBF=''
-LIBDK4PPPTLIBS=''
-LIBDK4APPLIBF=''
-LIBDK4APPLIBS=''
-LIBDK4PPPTALIBF=''
-LIBDK4PPPTALIBS=''
-LIBDK4SOCKALIBF=''
-LIBDK4SOCKALIBS=''
-LIBDK4DBIALIBF=''
-LIBDK4DBIALIBS=''
-LIBDK4WXLIBF=''
-LIBDK4WXLIBS=''
-LIBDK3TRACELIBF=''
-LIBDK3TRACELIBS=''
-LIBDK3CLIBF=''
-LIBDK3CLIBS=''
-LIBDK3OFLIBF=''
-LIBDK3OFLIBS=''
-LIBDK3CSRNDLIBF=''
-LIBDK3CSRNDLIBS=''
-LIBDK3BIFLIBF=''
-LIBDK3BIFLIBS=''
-LIBDK3DBILIBF=''
-LIBDK3DBILIBS=''
-LIBDK3BMEPSLIBF=''
-LIBDK3BMEPSLIBS=''
-LIBDK3FIGLIBF=''
-LIBDK3FIGLIBS=''
-LIBDK3WXLIBF=''
-LIBDK3WXLIBS=''
-
-
-VERSNO=`cat version.txt`
-SOVERS=`echo $VERSNO | sed -e 's/\.[01-9][01-9]*$//'`
-ENAPACKAGING="auto"
-LIB_SH_RES='$(LIB_SH_RES_NO_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_NO_PACKAGING)'
-UNAME=`uname -s`
-GETSOURCE='@echo "ERROR: Neither wget nor curl available, can not download source!" && false'
-WGET=''
-CURL=''
-CLILIB=''
-GUILIB=''
-ENTRY=''
-ONWINDOWS='no'
-WINUNICODE=''
-FOUNDINLINE="no"
-USEINLINE="no"
-CROSSCOMPILING="no"
-
-MAKE="echo No make program found to build"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking GNU make" >&5
-$as_echo_n "checking GNU make... " >&6; }
-gmake maketest > /dev/null 2>&1
-if [ "X$?" = "X0" ]
-then
- MAKE='gmake'
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+fi
+fi
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
+$as_echo "$WINDRES" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking make" >&5
-$as_echo_n "checking make... " >&6; }
-make maketest > /dev/null 2>&1
-if [ "X$?" = "X0" ]
-then
- MAKE='make'
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+
+fi
+if test -z "$ac_cv_prog_WINDRES"; then
+ ac_ct_WINDRES=$WINDRES
+ # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_WINDRES"; then
+ ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_WINDRES="windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
+if test -n "$ac_ct_WINDRES"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
+$as_echo "$ac_ct_WINDRES" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-# Check whether --enable-inline was given.
-if test "${enable_inline+set}" = set; then :
- enableval=$enable_inline; USEINLINE="$enableval"
+ if test "x$ac_ct_WINDRES" = x; then
+ WINDRES=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ WINDRES=$ac_ct_WINDRES
+ fi
+else
+ WINDRES="$ac_cv_prog_WINDRES"
fi
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; ENASTATIC="$enableval"
-fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PKG_CONFIG"; then
+ ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; ENASHARED="$enableval"
fi
-
-# Check whether --enable-packaging was given.
-if test "${enable_packaging+set}" = set; then :
- enableval=$enable_packaging; ENAPACKAGING="$enableval"
fi
-
-# Check whether --enable-ndbm was given.
-if test "${enable_ndbm+set}" = set; then :
- enableval=$enable_ndbm; USE_NDBM="$enableval"
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-# Check whether --enable-warnings was given.
-if test "${enable_warnings+set}" = set; then :
- enableval=$enable_warnings; WARNVAL="$enableval"
-fi
-# Check whether --enable-more-warnings was given.
-if test "${enable_more_warnings+set}" = set; then :
- enableval=$enable_more_warnings; WARNMOREVAL="$enableval"
fi
+if test -z "$ac_cv_prog_PKG_CONFIG"; then
+ ac_ct_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_PKG_CONFIG"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-
-# Check whether --with-suite was given.
-if test "${with_suite+set}" = set; then :
- withval=$with_suite; SUITE="$withval"
fi
-
-
-# Check whether --with-man was given.
-if test "${with_man+set}" = set; then :
- withval=$with_man; MANINST="$withval"
+fi
+ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5
+$as_echo "$ac_ct_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-# Check whether --with-corrections was given.
-if test "${with_corrections+set}" = set; then :
- withval=$with_corrections; SOLCOR="$withval"
+ if test "x$ac_ct_PKG_CONFIG" = x; then
+ PKG_CONFIG=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_ct_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_prog_PKG_CONFIG"
fi
+MAKE=''
+GMAKE=''
+# Extract the first word of "make", so it can be a program name with args.
+set dummy make; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MAKE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MAKE"; then
+ ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MAKE="make"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-if [ "X$SOLCOR" = "Xyes" -a "X$UNAME" != "XSunOS" ]
-then
- echo 'ERROR: The --with-corrections option is for Solaris/SunOS only!'
- SOLCOR='no'
fi
-
-if [ "X$host" != "X$build" ]
-then
- echo 'Building on: ' $build
- echo 'Building for:' $host
- CROSSCOMPILING="yes"
- case "X$SUITE" in
- "gui")
- echo "Warning: Cross-compiling, switching suite to cross."
- ;;
- "cli")
- echo "Warning: Cross-compiling, switching suite to cross."
- ;;
- esac
- SUITE="cross"
+fi
+MAKE=$ac_cv_prog_MAKE
+if test -n "$MAKE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
+$as_echo "$MAKE" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-case "X$ENAPACKAGING" in
- "Xauto")
- if [ "X$SUITE" = "Xrescue" ]
- then
- ENAPACKAGING="yes"
- else
- ENAPACKAGING="no"
- fi
- ;;
- "Xyes")
- ENAPACKAGING="yes"
- ;;
- *)
- ENAPACKAGING="no"
- ;;
-esac
-UNAME=`uname -s`
-if [ "X$CC" = "Xgcc" ]
-then
- SHLIBSTYLE='gcc'
- RPATHLINK="-Wl,-rpath-link,./"
-elif [ "X$UNAME" = "XSunOS" ]
-then
- SHLIBSTYLE='workshop'
-fi
+# Extract the first word of "gmake", so it can be a program name with args.
+set dummy gmake; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GMAKE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$GMAKE"; then
+ ac_cv_prog_GMAKE="$GMAKE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_GMAKE="gmake"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-if [ "X$CC" = "Xgcc" -a "X$WARNVAL" != "Xno" ]
-then
- # Enable all warnings and some extra warnings
- CWARN="-Wall"
- WARNVAL=yes
+fi
+fi
+GMAKE=$ac_cv_prog_GMAKE
+if test -n "$GMAKE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMAKE" >&5
+$as_echo "$GMAKE" >&6; }
else
- WARNVAL=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-if [ "X$CC" = "Xgcc" -a "X$WARNMOREVAL" == "Xyes" ]
-then
- # Extra warnings
- CWARN="$CWARN -Wextra"
- # Overlong strings (C89: 509 characters, C99: 4095 characters)
- CWARN="$CWARN -Woverlength-strings"
- # Padding bytes added to structures
- CWARN="$CWARN -Wpadded"
- # Redundant declarations
- CWARN="$CWARN -Wredundant-decls"
- # Suspicious logical operators in expressions
- CWARN="$CWARN -Wlogical-op"
- # Functions returning entire structures
- CWARN="$CWARN -Waggregate-return"
- # Prototypes required before function use
- CWARN="$CWARN -Wstrict-prototypes"
- # Old style function definitions
- CWARN="$CWARN -old-style-definition"
- # Prototypes missing for global functions (must be in a header)
- CWARN="$CWARN -Wmissing-prototypes"
- # Global function defined without a previous prototype
- CWARN="$CWARN -Wmissing-declarations"
- # "exern" definition in a function
- CWARN="$CWARN -Wnested-externs"
- # Unreachable code in a program
- CWARN="$CWARN -Wunreachable-code"
- # Failed to inline a function
- CWARN="$CWARN -Winline"
- # Invalid PCH file found
- CWARN="$CWARN -Winvalid-pch"
- # Variable length array
- CWARN="$CWARN -Wvla"
- # Using signed pointers
- CWARN="$CWARN -Wpointer-sign"
- # The stack protector can not handle some function
- CWARN="$CWARN -Wstack-protector"
- WARNMOREVAL="yes"
-else
- WARNMOREVAL="no"
-fi
-
-case "X$ENASHARED" in
- "Xauto")
- if [ "X$SHLIBSTYLE" = "Xgcc" -o "X$SHLIBSTYLE" = "Xworkshop" ]
- then
- ENASHARED='yes'
- else
- ENASHARED='no'
- fi
- ;;
- "Xyes")
- if [ "X$SHLIBSTYLE" = "Xgcc" -o "X$SHLIBSTYLE" = "Xworkshop" ]
- then
- ENASHARED='yes'
- else
- ENASHARED='no'
- as_fn_error $? "Can not build shared libraries!" "$LINENO" 5
- exit 1
- fi
- ;;
- *)
- ENASHARED='no'
- ;;
-esac
-if [ "X$ENASTATIC" = "Xauto" ]
-then
- case "X$ENASHARED" in
- "Xyes")
- ENASTATIC='no'
- ;;
- "Xno")
- ENASTATIC='yes'
- ;;
- esac
-fi
-if [ "X$ENASTATIC" != "Xyes" -a "X$ENASTATIC" != "Xno" ]
-then
- ENASTATIC='no'
-fi
-
-WXCPPFLAGS=`wx-config --cppflags`
-WXCXXFLAGS=`wx-config --cxxflags`
-WXVERSION=`wx-config --version`
-WXCFLAGS=`wx-config --cflags`
-WXLDFLAGS=`wx-config --libs`
-case "X$SUITE" in
- "Xauto")
- SUITE='gui'
- if [ "X$WXCPPFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXCXXFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXCFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXLDFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- ;;
- "Xgui")
- if [ "X$WXCPPFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXCXXFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXCFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$WXLDFLAGS" = "X" ]
- then
- SUITE="cli"
- fi
- if [ "X$SUITE" != "Xgui" ]
- then
- as_fn_error $? "Can not build GUI applications, wxWidgets not found!" "$LINENO" 5
- exit 1
- fi
- ;;
- "Xcli")
- SUITE='cli'
- ;;
- "Xrescue")
- SUITE='rescue'
- ;;
- "Xcross")
- SUITE='cross'
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown suite type $SUITE changed to cli." >&5
-$as_echo "$as_me: WARNING: Unknown suite type $SUITE changed to cli." >&2;}
- SUITE='cli'
- ;;
-esac
if [ "X$RANLIB" = "X:" ]
then
- RANLIB="@echo No need to run ranlib"
+ RANLIB='@echo No need to run ranlib'
fi
+
# Extract the first word of "wget", so it can be a program name with args.
set dummy wget; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5386,280 +4797,886 @@ $as_echo "no" >&6; }
fi
-
-if [ "X$SUITE" = "Xrescue" ]
+GETSOURCE='@echo "ERROR: Neither wget nor curl available!" && false'
+if [ "X$WGET" != "X" ]
then
- PROGRAMS='$(PROG_RES)'
- LIBS_STATIC='$(LIB_ST_RES)'
- LIBS_SHARED='$(LIB_SH_RES)'
- RES_INSTALL='i-r-res'
- INSTALLMANPAGES='install-rescue-man'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_RES) $(LIB_ST_RES)'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_RES)'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_RES)'
- ;;
- esac
- case "X$ENAPACKAGING" in
- "Xyes")
- LIBS_INSTALL='i-l-sh'
- ;;
- esac
- LIBRARIES=''
-elif [ "X$SUITE" = "Xgui" ]
+ GETSOURCE='wget -O dktools-$(VERSNO)'
+ GETSOURCE="$GETSOURCE"' $(SFBASE)/dktools-$(VERSNO).tar.gz/download'
+elif [ "X$CURL" != "X" ]
then
- PROGRAMS='$(PROG_GUI)'
- LIBS_STATIC='$(LIB_ST_GUI)'
- LIBS_SHARED='$(LIB_SH_GUI)'
- RES_INSTALL='i-r-gui'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_GUI) $(LIB_ST_GUI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_GUI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_GUI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
-elif [ "X$SUITE" = "Xcross" ]
+ GETSOURCE='curl -L $(SFBASE)/dktools-$(VERSNO).tar.gz'
+ GETSOURCE="$GETSOURCE "'> dktools-$(VERSNO).tar.gz'
+fi
+
+if [ "X$MAKE" = "X" -a "X$GMAKE" != "X" ]
then
- PROGRAMS='$(PROG_CROSS)'
- LIBS_STATIC='$(LIB_ST_CLI)'
- LIBS_SHARED='$(LIB_SH_CLI)'
- RES_INSTALL='i-r-cli'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_CLI) $(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_CLI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ENASHARED='no'
- ENASTATIC='yes'
- case "X$host" in
- "Xx86_64-w64-mingw32")
- ONWINDOWS="yes"
- WINUNICODE="-D_UNICODE=1 -DUNICODE=1"
- $as_echo "#define HAVE_BACKSLASH_AS_SEP 1" >>confdefs.h
+ MAKE="$GMAKE"
+fi
- $as_echo "#define HAVE_LINE_END_CR_NL 1" >>confdefs.h
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
- $as_echo "#define HAVE_CASE_INSENSITIVE_PATHNAMES 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
- ;;
- esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- PROGRAMS='$(PROG_CLI)'
- LIBS_STATIC='$(LIB_ST_CLI)'
- LIBS_SHARED='$(LIB_SH_CLI)'
- RES_INSTALL='i-r-cli'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_CLI) $(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_CLI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
-if [ "X$ENASHARED" = "Xno" ]
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+WHICHCC=`which $CC`
+WHICHCXX=`which $CXX`
+BUILDHOST="$build"
+TARGETHOST="$host"
+BUILDCLASS='posix'
+TARGETCLASS='posix'
+CROSSBUILD='no'
+UNAME=`uname -s`
+case X$TARGETHOST in
+ Xx86_64-w64-mingw32|Xx86_64-w32-mingw32)
+ TARGETCLASS='windows'
+ ;;
+esac
+case X$BUILDHOST in
+ Xx86_64-w64-mingw32|Xx86_64-w32-mingw32)
+ BUILDCLASS='windows'
+ ;;
+esac
+if [ "X$BUILDHOST" != "X$TARGETHOST" ]
then
- ENAPACKAGING="no"
+ CROSSBUILD='yes'
fi
+TOOLCHAIN='unknown'
+case X$CC in
+ Xgcc|X*gcc)
+ TOOLCHAIN='gcc'
+ ;;
+ Xclang|X*clang)
+ TOOLCHAIN='clang'
+ ;;
+ Xcc)
+ if [ "X$UNAME" = "XSunOS" ]
+ then
+ TOOLCHAIN='workshop'
+ fi
+ ;;
+ Xcl|XCL)
+ TOOLCHAIN='msvc'
+ ;;
+esac
-APPLIBF="libdk4app.so libdk4c.so"
-if [ "X$CROSSCOMPILING" = "Xyes" ]
+if [ "X$WINDRES" = "X:" -a "X$TOOLCHAIN" = "Xmsvc" ]
then
- APPLIBF="$APPLIBF libdk4ma.so libdk4maiodd.so libdk4maiowd.so libdk4maio8d.so"
-else
- APPLIBF="$APPLIBF libdk4ma.so libdk4maiodd.so libdk4maio8d.so"
+ WINDRES='RC'
+elif [ "X$WINDRES" = "X:" ]
+then
+ WINDRES='@echo "ERROR: No windows resouce compiler available!"'
fi
-APPLIBF="$APPLIBF libdk4base.so"
-APPLIBS="-ldk4app -ldk4c"
-if [ "X$CROSSCOMPILING" = "Xyes" ]
+THISYEAR=`date '+%Y'`
+
+
+
+GCCWARNFLAGS="-Wall -Wextra"
+GCXXWARNFLAGS="-Wall -Wextra"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Woverlength-strings"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Woverlength-strings"
+
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wredundant-decls"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wredundant-decls"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wlogical-op"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wlogical-op"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Waggregate-return"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wstrict-prototypes"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -old-style-definition"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wmissing-prototypes"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wmissing-declarations"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wmissing-declarations"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wnested-externs"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wunreachable-code"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wunreachable-code"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Winline"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Winvalid-pch"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Winvalid-pch"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wvla"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wvla"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wpointer-sign"
+
+GCCWARNFLAGS="$GCCWARNFLAGS -Wstack-protector"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wstack-protector"
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Options: $*" >&5
+$as_echo "$as_me: Options: $*" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CC = $CC $WHICHCC" >&5
+$as_echo "$as_me: CC = $CC $WHICHCC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CXX = $CXX $WHICHCXX" >&5
+$as_echo "$as_me: CXX = $CXX $WHICHCXX" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS: $CPPFLAGS" >&5
+$as_echo "$as_me: CPPFLAGS: $CPPFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CFLAGS: $CFLAGS" >&5
+$as_echo "$as_me: CFLAGS: $CFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS: $LDFLAGS" >&5
+$as_echo "$as_me: LDFLAGS: $LDFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Building on: $BUILDHOST $BUILDCLASS" >&5
+$as_echo "$as_me: Building on: $BUILDHOST $BUILDCLASS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Building for: $TARGETHOST $TARGETCLASS" >&5
+$as_echo "$as_me: Building for: $TARGETHOST $TARGETCLASS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Cross build: $CROSSBUILD" >&5
+$as_echo "$as_me: Cross build: $CROSSBUILD" >&6;}
+
+if [ "X$PKG_CONFIG" = "X:" -a "X$CROSSBUILD" = "Xyes" ]
then
- APPLIBS="$APPLIBS -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d"
-else
- APPLIBS="$APPLIBS -ldk4ma -ldk4maiodd -ldk4maio8d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cross building, but no pkg-config available!" >&5
+$as_echo "$as_me: WARNING: Cross building, but no pkg-config available!" >&2;}
fi
-APPLIBS="$APPLIBS -ldk4base"
-DKCTLIBF='libdk3.a'
-DKCTLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-ADDCTRLDLIBF='libdk3.a'
-ADDCTRLDLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKDBTLIBF='libdk3.a'
-DKDBTLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-ITADMINLIBF='libdk3.a'
-ITADMINLIBS='-ldk3 -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) $(RTLIB)'
-BMPPLIBF='libdk3.a'
-BMPPLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-FIG2LATLIBF='libdk3.a'
-FIG2LATLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-HTMLBOOKLIBF='libdk3.a'
-HTMLBOOKLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-DK3INFOLIBF='libdk3.a'
-DK3INFOLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-PLPDFTEXLIBF='libdk3.a'
-PLPDFTEXLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-DKWXWIZLIBF='libdk3.a'
-DKWXWIZLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKCTLIBF='libdk3.a'
-WXDKCTLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXBMPPLIBF='libdk3.a'
-WXBMPPLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXIMGSZLIBF='libdk3.a'
-WXIMGSZLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKCLOCKLIBF='libdk3.a'
-WXDKCLOCKLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKHTBLIBF='libdk3.a'
-WXDKHTBLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
-PRINTQDILIBF='libdk3.a'
-PRINTQDILIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-PRINTQDALIBF='libdk3.a'
-PRINTQDALIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-
-DKCATLIBF="libdk4.a"
-DKCATLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKBLKSLIBF="libdk4.a"
-DKBLKSLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKSQLSPLITLIBF="libdk4.a"
-DKSQLSPLITLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKERADISKLIBF="libdk4.a"
-DKERADISKLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKLSLIBF="libdk4.a"
-DKLSLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKSORTLIBF="libdk4.a"
-DKSORTLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKFICLIBF="libdk4.a"
-DKFICLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKUIDLIBF="libdk4.a"
-DKUIDLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKPWGENLIBF="libdk4.a"
-DKPWGENLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKRANDLIBF="libdk4.a"
-DKRANDLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKT2HLIBF="libdk4.a"
-DKT2HLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKT2LLIBF="libdk4.a"
-DKT2LLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKHEXLIBF="libdk4.a"
-DKHEXLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKBMMLIBF="libdk4.a"
-DKBMMLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKPWDLIBF="libdk4.a"
-DKPWDLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKRECVLIBF="libdk4.a"
-DKRECVLIBS='-ldk4 $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-DKSENDLIBF="libdk4.a"
-DKSENDLIBS='-ldk4 $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-DKDBT2LIBF="libdk4.a"
-DKDBT2LIBS='-ldk4 $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
-DK4INFOLIBF="libdk4.a"
-DK4INFOLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-LPRNGCLLIBF="libdk4.a"
-LPRNGCLLIBS='-ldk4 $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-WXDKFCSLIBF="libdk4.a"
-WXDKFCSLIBS='-ldk4 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXPQDICLIBF="libdk4.a"
-WXPQDICLIBS='-ldk4 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-PJSNMPLIBF="libdk4.a"
-PJSNMPLIBS='-ldk4 $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
-PRMONSNMPLIBF="libdk4.a"
-PRMONSNMPLIBS='-ldk4 $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
-PRINTQDLIBF="libdk4.a"
-PRINTQDLIBS='-ldk4 $(DBLIB) $(SOCKLIB) $(NSLLIB)'
-PRINTQDCLIBF="libdk4.a"
-PRINTQDCLIBS='-ldk4 $(SOCKLIB) $(NSLLIB)'
-RSHDOWNLIBF="libdk4.a"
-RSHDOWNLIBS='-ldk4 $(SOCKLIB) $(NSLLIB)'
-
-LIB_SH_RES='$(LIB_SH_RES_NO_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_NO_PACKAGING)'
-LIB_SH_GUI='$(LIB_SH_GUI_NO_PACKAGING)'
-if [ "X$ENAPACKAGING" = "Xyes" ]
+VERSNO=`cat version.txt`
+SOVERS=`echo $VERSNO | sed -e 's/\.[01-9][01-9]*$//'`
+
+
+CFL_CLI_C8='$(CPPFLAGS) $(CFLAGS)'
+
+CFL_CLI_DK='$(CPPFLAGS) $(CFLAGS)'
+
+CXXFL_CLI_C8='$(CPPFLAGS) $(CXXFLAGS)'
+
+CXXFL_CLI_DK='$(CPPFLAGS) $(CXXFLAGS)'
+
+CXXFL_CLI_WX='$(CPPFLAGS) $(CXXFLAGS)'
+
+CXXFL_GUI='$(CPPFLAGS) $(CXXFLAGS)'
+
+LDFLC_CLI_C8='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLC_CLI_DK='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLCXX_CLI_C8='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLCXX_CLI_DK='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLCXX_CLI_WX='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+LDFLCXX_GUI='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+RPATH=''
+RPATHLINK=''
+MKSORPATH=''
+MKSORPATHLINK=''
+MKSOCHECKSYMBOLS=''
+
+if [ "X$LD_LIBRARY_PATH" != "X" -a "X$TOOLCHAIN" = "Xworkshop" ]
then
-LIB_SH_RES='$(LIB_SH_RES_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_PACKAGING)'
-LIB_SH_GUI='$(LIB_SH_GUI_PACKAGING)'
+ RPATH="-R${LD_LIBRARY_PATH}"
fi
-if [ "X$CC" = "Xgcc" -a "X$UNAME" = "XLinux" ]
+
+SUITE='auto'
+
+# Check whether --with-suite was given.
+if test "${with_suite+set}" = set; then :
+ withval=$with_suite; SUITE=$withval
+fi
+
+if [ "X$SUITE" != "Xgui" -a "X$SUITE" != "Xcli" -a "X$SUITE" != "Xrescue" ]
then
- USESOLINKING="yes"
+ SUITE='auto'
+fi
+
+FOUND_SYSTEMD='no'
+ENA_SYSTEMD='auto'
+systemddir=''
+
+# Check whether --with-systemd was given.
+if test "${with_systemd+set}" = set; then :
+ withval=$with_systemd; systemddir=$withval;FOUND_SYSTEMD='yes';ENA_SYSTEMD='yes'
fi
-if [ "X$SHLIBSTYLE" = "Xworkshop" -o "X$FORCESOLINKING" = "Xyes" ]
+
+if [ "X$systemddir" = "Xyes" ]
then
- USESOLINKING="yes"
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ systemddir=''
+elif [ "X$systemddir" = "Xno" ]
+then
+ ENA_SYSTEMD='no'
+ FOUND_SYSTEMD='no'
+ systemddir=''
fi
+WIN_VER_TEXT='auto'
+WINVER=0x0601
-case "X$SHLIBSTYLE" in
- "Xgcc")
- CFPIC='-fPIC -D_REENTRANT'
- if [ "X$USESOLINKING" = "Xyes" ]
- then
- MKSOLIB='$(COMPILEC) -L. $(RPATHLINK) $(LIBRARIES) $(LDFLAGS) -shared -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
- else
- MKSOLIB='$(COMPILEC) $(LIBRARIES) $(LDFLAGS) -shared -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
+# Check whether --with-windows was given.
+if test "${with_windows+set}" = set; then :
+ withval=$with_windows;
+WIN_VER_TEXT=$withval
+if [ "X$TARGETCLASS" != "Xwindows" ]
+then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-windows=... is for Windows builds only!" >&5
+$as_echo "$as_me: WARNING: Option --with-windows=... is for Windows builds only!" >&2;}
+fi
+
+fi
+
+case X$WIN_VER_TEXT in
+ X7)
+ WINVER=0x0601
+ ;;
+ XXP)
+ WINVER=0x0501
+ ;;
+ *)
+ WINVER=0x0601
+ ;;
+esac
+if [ "X$TARGETCLASS" = "Xwindows" ]
+then
+ CPPFLAGS="$CPPFLAGS -DWINVER=$WINVER -D_WIN32_WINNT=$WINVER"
+ CFLAGS="$CFLAGS -DWINVER=$WINVER -D_WIN32_WINNT=$WINVER"
+ CFL_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CFL_CLI_C8"
+ CFL_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CFL_CLI_DK"
+ CXXFL_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_C8"
+ CXXFL_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_DK"
+ CXXFL_CLI_WX="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_WX"
+ CXXFL_GUI="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_GUI"
+ LDFLC_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLC_CLI_C8"
+ LDFLC_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLC_CLI_DK"
+ LDFLCXX_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_C8"
+ LDFLCXX_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_DK"
+ LDFLCXX_CLI_WX="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_WX"
+ LDFLCXX_GUI="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_GUI"
+fi
+
+ENA_DEVEL='yes'
+# Check whether --enable-devel was given.
+if test "${enable_devel+set}" = set; then :
+ enableval=$enable_devel; ENA_DEVEL=$enableval
+fi
+
+if [ "X$ENA_DEVEL" != "Xno" ]
+then
+ ENA_DEVEL='yes'
+fi
+
+ENA_STATIC='auto'
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; ENA_STATIC=$enableval
+fi
+
+
+ENA_SHARED='auto'
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; ENA_SHARED=$enableval
+fi
+
+
+if [ "X$ENA_STATIC" != "Xyes" -a "X$ENA_STATIC" != "Xauto" ]
+then
+ ENA_STATIC='no'
+fi
+if [ "X$ENA_SHARED" != "Xyes" -a "X$ENA_SHARED" != "Xauto" ]
+then
+ ENA_SHARED='no'
+fi
+
+ENA_PACKAGE='no'
+# Check whether --enable-packaging was given.
+if test "${enable_packaging+set}" = set; then :
+ enableval=$enable_packaging; ENA_PACKAGE=$enableval
+fi
+
+if [ "X$ENA_PACKAGE" != "Xyes" ]
+then
+ ENA_PACKAGE='no'
+fi
+
+ENA_SOSO='no'
+# Check whether --enable-link-so-so was given.
+if test "${enable_link_so_so+set}" = set; then :
+ enableval=$enable_link_so_so; ENA_SOSO=$enableval
+fi
+
+if [ "X$ENA_SOSO" != "Xyes" ]
+then
+ ENA_SOSO='no'
+fi
+
+ENA_RPATH='no'
+# Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+ enableval=$enable_rpath; ENA_RPATH=$enableval
+fi
+
+if [ "X$ENA_RPATH" != "Xyes" ]
+then
+ ENA_RPATH='no'
+fi
+
+ENA_MAN='yes'
+# Check whether --enable-man-pages was given.
+if test "${enable_man_pages+set}" = set; then :
+ enableval=$enable_man_pages; ENA_MAN=$enableval
+fi
+
+if [ "X$ENA_MAN" != "Xno" ]
+then
+ ENA_MAN='yes'
+fi
+
+ENA_DEBUG='no'
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+ enableval=$enable_debug; ENA_DEBUG=$enableval
+fi
+
+if [ "X$ENA_DEBUG" != "Xyes" ]
+then
+ ENA_DEBUG='no'
+fi
+
+ENA_WARN='no'
+# Check whether --enable-warnings was given.
+if test "${enable_warnings+set}" = set; then :
+ enableval=$enable_warnings; ENA_WARN=$enableval
+fi
+
+if [ "X$ENA_WARN" != "Xno" ]
+then
+ ENA_WARN='yes'
+fi
+
+case X$TOOLCHAIN/X$ENA_WARN/X$ENA_DEBUG in
+ Xgcc/Xyes/*)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xgcc/*/Xyes)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xclang/Xyes/*)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xclang/*/Xyes)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+esac
+
+
+
+
+ENA_ASSERT='no'
+# Check whether --enable-assert was given.
+if test "${enable_assert+set}" = set; then :
+ enableval=$enable_assert; ENA_ASSERT=$enableval
+fi
+
+if [ "X$ENA_ASSERT" != "Xyes" ]
+then
+ ENA_ASSERT='no'
+fi
+
+ENA_SUNOS_CORR='no'
+# Check whether --enable-corrections was given.
+if test "${enable_corrections+set}" = set; then :
+ enableval=$enable_corrections; ENA_SUNOS_CORR=$enableval
+fi
+
+if [ "X$ENA_SUNOS_CORR" != "Xyes" ]
+then
+ ENA_SUNOS_CORR='no'
+fi
+
+ENA_FALLBACK='no'
+# Check whether --enable-fallback was given.
+if test "${enable_fallback+set}" = set; then :
+ enableval=$enable_fallback; ENA_FALLBACK=$enableval
+fi
+
+if [ "X$ENA_FALLBACK" != "Xno" ]
+then
+ $as_echo "#define USE_FALLBACK_NUMERIC_LIMITS 1" >>confdefs.h
+
+fi
+
+$as_echo "#define USE_PRINTF_SCANF 1" >>confdefs.h
+
+
+case X$ENA_PACKAGE/X$ENA_STATIC/X$ENA_SHARED in
+ Xno/Xno/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Static linking enabled" >&5
+$as_echo "$as_me: WARNING: Static linking enabled" >&2;}
+ ;;
+ Xno/Xno/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xno/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xauto/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xauto/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xauto/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xyes/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xyes/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xyes/Xyes)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xno/Xno)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Shared linking enabled" >&5
+$as_echo "$as_me: WARNING: Shared linking enabled" >&2;}
+ ;;
+ Xyes/Xno/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xno/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xauto/Xno)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Shared linking enabled" >&5
+$as_echo "$as_me: WARNING: Shared linking enabled" >&2;}
+ ;;
+ Xyes/Xauto/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xauto/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xyes/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Shared linking enabled" >&5
+$as_echo "$as_me: WARNING: Shared linking enabled" >&2;}
+ ;;
+ Xyes/Xyes/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xyes/Xyes)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
+esac
+
+
+EXEEXT=''
+if [ "X$TARGETCLASS" = "Xwindows" ]
+then
+ EXEEXT='.exe'
+fi
+
+OBJEXT='o'
+if [ "X$TOOLCHAIN" = "Xmsvc" ]
+then
+ OBJEXT='obj'
+fi
+
+RCEXT='rc'
+RESEXT='o'
+RESCRULE='echo "ERROR: No resource compiler available!"'
+RCFLAGS='-I. -D_UNICODE=1 -DUNICODE=1 -Igui-img/icons'
+if [ "X$TOOLCHAIN" = "Xmsvc" ]
+then
+ RESEXT='res'
+fi
+if [ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]
+then
+ RESCRULE='$(RC) $(RCFLAGS) $< $@'
+elif [ "X$TOOLCHAIN" = "Xmsvc" ]
+then
+ RESCRULE='$(RC) $(RCFLAGS) -out:$@ $<'
+fi
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
fi
- ;;
- "Xworkshop")
- if [ "X$ENASHARED" != "Xno" ]
- then
- CFPIC='-Bdynamic -dy -xcode=pic32 -D_REENTRANT'
- else
- CFPIC='-xcode=pic32 -D_REENTRANT'
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
fi
- MKSOLIB='$(COMPILEC) -L. $(LIBRARIES) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
- ;;
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-if [ "X$LD_LIBRARY_PATH" != "X" -a "X$SHLIBSTYLE" = "Xworkshop" ]
-then
- RPATH="-R${LD_LIBRARY_PATH}"
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
fi
-ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
-if test "x$ac_cv_header_errno_h" = xyes; then :
- $as_echo "#define HAVE_ERRNO_H 1" >>confdefs.h
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
-ac_fn_c_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default"
-if test "x$ac_cv_header_assert_h" = xyes; then :
- $as_echo "#define HAVE_ASSERT_H 1" >>confdefs.h
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
fi
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
ac_fn_c_check_header_mongrel "$LINENO" "complex.h" "ac_cv_header_complex_h" "$ac_includes_default"
if test "x$ac_cv_header_complex_h" = xyes; then :
@@ -5787,6 +5804,13 @@ if test "x$ac_cv_header_stdlib_h" = xyes; then :
fi
+ac_fn_c_check_header_mongrel "$LINENO" "sysexits.h" "ac_cv_header_sysexits_h" "$ac_includes_default"
+if test "x$ac_cv_header_sysexits_h" = xyes; then :
+ $as_echo "#define HAVE_SYSEXITS_H 1" >>confdefs.h
+
+fi
+
+
ac_fn_c_check_header_mongrel "$LINENO" "stdnoreturn.h" "ac_cv_header_stdnoreturn_h" "$ac_includes_default"
if test "x$ac_cv_header_stdnoreturn_h" = xyes; then :
$as_echo "#define HAVE_STDNORETURN_H 1" >>confdefs.h
@@ -5843,9 +5867,36 @@ if test "x$ac_cv_header_wctype_h" = xyes; then :
fi
+ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_errno_h" = xyes; then :
+ $as_echo "#define HAVE_ERRNO_H 1" >>confdefs.h
+fi
+FOUND_ASSERT_H='no'
+ac_fn_c_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default"
+if test "x$ac_cv_header_assert_h" = xyes; then :
+ FOUND_ASSERT_H='yes';$as_echo "#define HAVE_ASSERT_H 1" >>confdefs.h
+
+fi
+
+
+if [ "X$FOUND_ASSERT_H" = "Xno" -a "X$ENA_ASSERT" = "Xyes" ]
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Assertions enabled but assert.h not found!" >&5
+$as_echo "$as_me: WARNING: Assertions enabled but assert.h not found!" >&2;}
+elif [ "X$ENA_ASSERT" = "Xyes" ]
+then
+ CFLAGS="$CFLAGS -DDK4_USE_ASSERT=1"
+ CFL_CLI_C8="$CFL_CLI_C8 -DDK4_USE_ASSERT=1"
+ CFL_CLI_DK="$CFL_CLI_DK -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -DDK4_USE_ASSERT=1"
+ CXXFL_GUI="$CXXFL_GUI -DDK4_USE_ASSERT=1"
+fi
+
ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_types_h" = xyes; then :
$as_echo "#define HAVE_SYS_TYPES_H 1" >>confdefs.h
@@ -5979,6 +6030,13 @@ if test "x$ac_cv_header_pwd_h" = xyes; then :
fi
+ac_fn_c_check_header_mongrel "$LINENO" "memory.h" "ac_cv_header_memory_h" "$ac_includes_default"
+if test "x$ac_cv_header_memory_h" = xyes; then :
+ $as_echo "#define HAVE_MEMORY_H 1" >>confdefs.h
+
+fi
+
+
ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default"
if test "x$ac_cv_header_strings_h" = xyes; then :
$as_echo "#define HAVE_STRINGS_H 1" >>confdefs.h
@@ -6000,6 +6058,13 @@ if test "x$ac_cv_header_bios_h" = xyes; then :
fi
+ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
+if test "x$ac_cv_header_search_h" = xyes; then :
+ $as_echo "#define HAVE_SEARCH_H 1" >>confdefs.h
+
+fi
+
+
ac_fn_c_check_header_mongrel "$LINENO" "dos.h" "ac_cv_header_dos_h" "$ac_includes_default"
if test "x$ac_cv_header_dos_h" = xyes; then :
$as_echo "#define HAVE_DOS_H 1" >>confdefs.h
@@ -6035,51 +6100,184 @@ if test "x$ac_cv_header_direct_h" = xyes; then :
fi
-ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = xyes; then :
- ZLIB="-lz";$as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdio_h" = xyes; then :
+ $as_echo "#define HAVE_STDIO_H 1" >>confdefs.h
fi
-ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = xyes; then :
- BZLIB="-lbz2";$as_echo "#define HAVE_BZLIB_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "conio.h" "ac_cv_header_conio_h" "$ac_includes_default"
+if test "x$ac_cv_header_conio_h" = xyes; then :
+ $as_echo "#define HAVE_CONIO_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_mongrel "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default"
+if test "x$ac_cv_header_grp_h" = xyes; then :
+ $as_echo "#define HAVE_GRP_H 1" >>confdefs.h
-CRYPTO=""
-PROGSOPENSSL=""
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/rand.h" "ac_cv_header_openssl_rand_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_rand_h" = xyes; then :
+fi
-CRYPTO="-lcrypto"
-PROGSOPENSSL='dk-fic$(EXEEXT) dk-pwgen$(EXEEXT) dk-rand$(EXEEXT)'
-$as_echo "#define HAVE_OPENSSL_RAND_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "dir.h" "ac_cv_header_dir_h" "$ac_includes_default"
+if test "x$ac_cv_header_dir_h" = xyes; then :
+ $as_echo "#define HAVE_DIR_H 1" >>confdefs.h
fi
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_md5_h" = xyes; then :
- $as_echo "#define HAVE_OPENSSL_MD5_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "err.h" "ac_cv_header_err_h" "$ac_includes_default"
+if test "x$ac_cv_header_err_h" = xyes; then :
+ $as_echo "#define HAVE_ERR_H 1" >>confdefs.h
fi
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_sha_h" = xyes; then :
- $as_echo "#define HAVE_OPENSSL_SHA_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default"
+if test "x$ac_cv_header_shadow_h" = xyes; then :
+ $as_echo "#define HAVE_SHADOW_H 1" >>confdefs.h
fi
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/ripemd.h" "ac_cv_header_openssl_ripemd_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_ripemd_h" = xyes; then :
- $as_echo "#define HAVE_OPENSSL_RIPEMD_H 1" >>confdefs.h
+ac_fn_c_check_header_mongrel "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$ac_includes_default"
+if test "x$ac_cv_header_stropts_h" = xyes; then :
+ $as_echo "#define HAVE_STROPTS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
+if test "x$ac_cv_header_syslog_h" = xyes; then :
+ $as_echo "#define HAVE_SYSLOG_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sysres.h" "ac_cv_header_sysres_h" "$ac_includes_default"
+if test "x$ac_cv_header_sysres_h" = xyes; then :
+ $as_echo "#define HAVE_SYSRES_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default"
+if test "x$ac_cv_header_termios_h" = xyes; then :
+ $as_echo "#define HAVE_TERMIOS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "vararg.h" "ac_cv_header_vararg_h" "$ac_includes_default"
+if test "x$ac_cv_header_vararg_h" = xyes; then :
+ $as_echo "#define HAVE_VARARG_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "varargs.h" "ac_cv_header_varargs_h" "$ac_includes_default"
+if test "x$ac_cv_header_varargs_h" = xyes; then :
+ $as_echo "#define HAVE_VARARGS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "ntifs.h" "ac_cv_header_ntifs_h" "$ac_includes_default"
+if test "x$ac_cv_header_ntifs_h" = xyes; then :
+ $as_echo "#define HAVE_NTIFS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_file_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_FILE_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_resource_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_statvfs_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/stropts.h" "ac_cv_header_sys_stropts_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_stropts_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_STROPTS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/sunddi.h" "ac_cv_header_sys_sunddi_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sunddi_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_SUNDDI_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_SYSCTL_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/systeminfo.h" "ac_cv_header_sys_systeminfo_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_systeminfo_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_SYSTEMINFO_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/termios.h" "ac_cv_header_sys_termios_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_termios_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_TERMIOS_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/ttold.h" "ac_cv_header_sys_ttold_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_ttold_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_TTOLD_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_uio_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_UIO_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_wait_h" = xyes; then :
+ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "lprng.h" "ac_cv_header_lprng_h" "$ac_includes_default"
+if test "x$ac_cv_header_lprng_h" = xyes; then :
+ $as_echo "#define HAVE_LPRNG_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+ PTHREADLIB='-lpthread';$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h
fi
@@ -6121,8 +6319,274 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking longlong" >&5
-$as_echo_n "checking longlong... " >&6; }
+ac_fn_c_check_header_compile "$LINENO" "winbase.h" "ac_cv_header_winbase_h" "
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+"
+if test "x$ac_cv_header_winbase_h" = xyes; then :
+ $as_echo "#define HAVE_WINBASE_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_compile "$LINENO" "winreg.h" "ac_cv_header_winreg_h" "
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+#if HAVE_WINBASE_H
+#include <winbase.h>
+#endif
+
+"
+if test "x$ac_cv_header_winreg_h" = xyes; then :
+ $as_echo "#define HAVE_WINREG_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_compile "$LINENO" "wincon.h" "ac_cv_header_wincon_h" "
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+#if HAVE_WINBASE_H
+#include <winbase.h>
+#endif
+
+"
+if test "x$ac_cv_header_wincon_h" = xyes; then :
+ $as_echo "#define HAVE_WINCON_H 1" >>confdefs.h
+
+fi
+
+
+
+FOUND_ZLIB='no'
+ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+ ZLIB='-lz';FOUND_ZLIB='yes';$as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h
+
+fi
+
+
+FOUND_BZLIB='no'
+ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
+ BZLIB='-lbz2';FOUND_BZLIB='yes';$as_echo "#define HAVE_BZLIB_H 1" >>confdefs.h
+
+fi
+
+
+
+FOUND_OPENSSL='no'
+CRYPTO=''
+ac_fn_c_check_header_mongrel "$LINENO" "openssl/rand.h" "ac_cv_header_openssl_rand_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_rand_h" = xyes; then :
+
+FOUND_OPENSSL='yes'
+CRYPTO='-lcrypto'
+PRG_CLI_SSL='$(PRG_CLI_SSL)'
+MAN_CLI_SSL='$(MAN_CLI_SSL)'
+RES_CLI_SSL='$(RES_CLI_SSL)'
+PRG_GUI_SSL='$(PRG_GUI_SSL)'
+MAN_GUI_SSL='$(MAN_GUI_SSL)'
+RES_GUI_SSL='$(RES_GUI_SSL)'
+$as_echo "#define HAVE_OPENSSL_RAND_H 1" >>confdefs.h
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_md5_h" = xyes; then :
+ $as_echo "#define HAVE_OPENSSL_MD5_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_sha_h" = xyes; then :
+ $as_echo "#define HAVE_OPENSSL_SHA_H 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "openssl/ripemd.h" "ac_cv_header_openssl_ripemd_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_ripemd_h" = xyes; then :
+ $as_echo "#define HAVE_OPENSSL_RIPEMD_H 1" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Init in -lcrypto" >&5
+$as_echo_n "checking for SHA224_Init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA224_Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA224_Init ();
+int
+main ()
+{
+return SHA224_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA224_Init=yes
+else
+ ac_cv_lib_crypto_SHA224_Init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Init" >&5
+$as_echo "$ac_cv_lib_crypto_SHA224_Init" >&6; }
+if test "x$ac_cv_lib_crypto_SHA224_Init" = xyes; then :
+ $as_echo "#define HAVE_SHA224 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Init in -lcrypto" >&5
+$as_echo_n "checking for SHA256_Init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA256_Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA256_Init ();
+int
+main ()
+{
+return SHA256_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA256_Init=yes
+else
+ ac_cv_lib_crypto_SHA256_Init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Init" >&5
+$as_echo "$ac_cv_lib_crypto_SHA256_Init" >&6; }
+if test "x$ac_cv_lib_crypto_SHA256_Init" = xyes; then :
+ $as_echo "#define HAVE_SHA256 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA384_Init in -lcrypto" >&5
+$as_echo_n "checking for SHA384_Init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA384_Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA384_Init ();
+int
+main ()
+{
+return SHA384_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA384_Init=yes
+else
+ ac_cv_lib_crypto_SHA384_Init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA384_Init" >&5
+$as_echo "$ac_cv_lib_crypto_SHA384_Init" >&6; }
+if test "x$ac_cv_lib_crypto_SHA384_Init" = xyes; then :
+ $as_echo "#define HAVE_SHA384 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Init in -lcrypto" >&5
+$as_echo_n "checking for SHA512_Init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA512_Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA512_Init ();
+int
+main ()
+{
+return SHA512_Init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA512_Init=yes
+else
+ ac_cv_lib_crypto_SHA512_Init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Init" >&5
+$as_echo "$ac_cv_lib_crypto_SHA512_Init" >&6; }
+if test "x$ac_cv_lib_crypto_SHA512_Init" = xyes; then :
+ $as_echo "#define HAVE_SHA512 1" >>confdefs.h
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking long long" >&5
+$as_echo_n "checking long long... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -6149,8 +6613,8 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking longdouble" >&5
-$as_echo_n "checking longdouble... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking long double" >&5
+$as_echo_n "checking long double... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -6177,7 +6641,7 @@ else
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-DOINTMAXSIZECHECK="no"
+DOINTMAXSIZECHECK='no'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking intmax_t" >&5
$as_echo_n "checking intmax_t... " >&6; }
@@ -6203,7 +6667,7 @@ intmax_t im;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- DOINTMAXSIZECHECK="yes";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ DOINTMAXSIZECHECK='yes';{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; };$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
else
@@ -6212,18 +6676,19 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking volatile" >&5
-$as_echo_n "checking volatile... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sig_atomic_t" >&5
+$as_echo_n "checking sig_atomic_t... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-volatile int i = 0;
+#include <sys/types.h>
+#include <signal.h>
int
main ()
{
-i = 1;
+sig_atomic_t sat;
;
return 0;
@@ -6231,7 +6696,7 @@ i = 1;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_VOLATILE 1" >>confdefs.h
+$as_echo "yes" >&6; };$as_echo "#define HAVE_SIG_ATOMIC_T 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -6239,19 +6704,291 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sig_atomic_t" >&5
-$as_echo_n "checking sig_atomic_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ssize_t" >&5
+$as_echo_n "checking ssize_t... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
#include <sys/types.h>
-#include <signal.h>
+#endif
int
main ()
{
-sig_atomic_t sat;
+ ssize_t sz;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int8_t" >&5
+$as_echo_n "checking int8_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+int8_t i8 = 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_INT8_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int16_t" >&5
+$as_echo_n "checking int16_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+int16_t i16 = 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_INT16_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int32_t" >&5
+$as_echo_n "checking int32_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+int32_t i32 = 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_INT32_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint8_t" >&5
+$as_echo_n "checking uint8_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+ uint8_t sz;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_UINT8_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint16_t" >&5
+$as_echo_n "checking uint16_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+ uint16_t sz;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_UINT16_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t" >&5
+$as_echo_n "checking uint32_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int
+main ()
+{
+
+ uint32_t sz;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_UINT32_T 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dev_t" >&5
+$as_echo_n "checking dev_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ dev_t devno;
;
return 0;
@@ -6259,7 +6996,555 @@ sig_atomic_t sat;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_SIG_ATOMIC_T 1" >>confdefs.h
+$as_echo "yes" >&6; };$as_echo "#define HAVE_DEV_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _dev_t" >&5
+$as_echo_n "checking _dev_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ _dev_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE__DEV_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ino_t" >&5
+$as_echo_n "checking ino_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ ino_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_INO_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _ino_t" >&5
+$as_echo_n "checking _ino_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ _ino_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE__INO_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ino64_t" >&5
+$as_echo_n "checking ino64_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ ino64_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_INO64_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mode_t" >&5
+$as_echo_n "checking mode_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ mode_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_MODE_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking nlink_t" >&5
+$as_echo_n "checking nlink_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ nlink_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_NLINK_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking off_t" >&5
+$as_echo_n "checking off_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ off_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_OFF_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking off64_t" >&5
+$as_echo_n "checking off64_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ off64_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_OFF64_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blksize_t" >&5
+$as_echo_n "checking blksize_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ blksize_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_BLKSIZE_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blkcnt_t" >&5
+$as_echo_n "checking blkcnt_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ blkcnt_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_BLKCNT_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fpos_t" >&5
+$as_echo_n "checking fpos_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ fpos_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_FPOS_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _fpos_t" >&5
+$as_echo_n "checking _fpos_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ _fpos_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE__FPOS_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uid_t" >&5
+$as_echo_n "checking uid_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ uid_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_UID_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gid_t" >&5
+$as_echo_n "checking gid_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+ gid_t devno;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_GID_T 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking wchar_t" >&5
+$as_echo_n "checking wchar_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <wchar.h>
+
+int
+main ()
+{
+
+ wchar_t chr;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -6432,42 +7717,39 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-if [ "X$DOINTMAXSIZECHECK" = "Xyes" ]
-then
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intmax_t" >&5
-$as_echo_n "checking size of intmax_t... " >&6; }
-if ${ac_cv_sizeof_intmax_t+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int32_t" >&5
+$as_echo_n "checking size of int32_t... " >&6; }
+if ${ac_cv_sizeof_int32_t+:} false; then :
$as_echo_n "(cached) " >&6
else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intmax_t))" "ac_cv_sizeof_intmax_t" "$ac_includes_default"; then :
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int32_t))" "ac_cv_sizeof_int32_t" "$ac_includes_default"; then :
else
- if test "$ac_cv_type_intmax_t" = yes; then
+ if test "$ac_cv_type_int32_t" = yes; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (intmax_t)
+as_fn_error 77 "cannot compute sizeof (int32_t)
See \`config.log' for more details" "$LINENO" 5; }
else
- ac_cv_sizeof_intmax_t=0
+ ac_cv_sizeof_int32_t=0
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_intmax_t" >&5
-$as_echo "$ac_cv_sizeof_intmax_t" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int32_t" >&5
+$as_echo "$ac_cv_sizeof_int32_t" >&6; }
cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+#define SIZEOF_INT32_T $ac_cv_sizeof_int32_t
_ACEOF
-fi
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -6567,6 +7849,687 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if ${ac_cv_sizeof_off_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
+$as_echo_n "checking size of ino_t... " >&6; }
+if ${ac_cv_sizeof_ino_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_ino_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ino_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_ino_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
+$as_echo "$ac_cv_sizeof_ino_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INO_T $ac_cv_sizeof_ino_t
+_ACEOF
+
+
+if [ "X$DOINTMAXSIZECHECK" = "Xyes" ]
+then
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intmax_t" >&5
+$as_echo_n "checking size of intmax_t... " >&6; }
+if ${ac_cv_sizeof_intmax_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intmax_t))" "ac_cv_sizeof_intmax_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_intmax_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (intmax_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_intmax_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_intmax_t" >&5
+$as_echo "$ac_cv_sizeof_intmax_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+_ACEOF
+
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking const" >&5
+$as_echo_n "checking const... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+static char const msg[] = { "Test" };
+
+int
+main ()
+{
+
+fputs(msg, stdout);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_CONST 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking inline" >&5
+$as_echo_n "checking inline... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+inline
+int
+summe(int a, int b)
+{
+ return (a + b);
+}
+
+int
+main ()
+{
+
+int i = 5;
+int j = 6;
+int k;
+k = summe(i, j);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };FOUNDINLINE='yes'
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if [ "X$FOUNDINLINE" = "Xyes" ]
+then
+ $as_echo "#define HAVE_INLINE 1" >>confdefs.h
+
+fi
+if [ "X$FOUNDINLINE" = "Xyes" -a "X$USEINLINE" = "Xyes" ]
+then
+ $as_echo "#define USE_INLINE 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking volatile" >&5
+$as_echo_n "checking volatile... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+volatile int i = 0;
+
+int
+main ()
+{
+
+i = 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_VOLATILE 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking __attribute__((unused))" >&5
+$as_echo_n "checking __attribute__((unused))... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+static
+int
+my_add(int a, int b, int c __attribute__((unused)) )
+{
+ return (a + b);
+}
+
+int
+main ()
+{
+
+ int i;
+ i = my_add(1, 2, 3);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking use of twos complement for negative integers" >&5
+$as_echo_n "checking use of twos complement for negative integers... " >&6; }
+if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_TWOS_COMPLEMENT 1" >>confdefs.h
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_PROCESS_H
+#include <process.h>
+#endif
+
+int i1 = -1;
+
+#if SIZEOF_INT > 2
+#if SIZEOF_INT > 4
+#if SIZEOF_INT > 8
+#error "No test available yet for integers larger than 8 bytes!"
+#else
+int i2 = 0xFFFFFFFFFFFFFFFF;
+#endif
+#else
+int i2 = 0xFFFFFFFF;
+#endif
+#else
+int i2 = 0xFFFF;
+#endif
+
+int main(int argc, char *argv[])
+{
+ int exval = 1;
+ if (i1 == i2) exval = 0;
+ exit(exval); return exval;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_TWOS_COMPLEMENT 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+IEEE_754_DOUBLE_WISHED='yes'
+IEEE_754_DOUBLE_FOUND='no'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IEEE 754 double" >&5
+$as_echo_n "checking IEEE 754 double... " >&6; }
+if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };IEEE_754_DOUBLE_FOUND='yes'
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include <math.h>
+
+static double td[] = {
+ INFINITY,
+ 1234.75,
+ 4.0,
+ 1.0,
+ 0.375,
+ 0.0,
+ -0.625,
+ -1.0,
+ -8.0,
+ -23.875,
+ -INFINITY
+};
+
+#if WORDS_BIGENDIAN
+static unsigned char tuc[] = {
+ /* INF */ 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 1234.75 */ 0x40, 0x93, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 4.0 */ 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 1.0 */ 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0.375 */ 0x3F, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -0.625 */ 0xBF, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -1.0 */ 0xBF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -8.0 */ 0xC0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -23.875 */ 0xC0, 0x37, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -INF */ 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+#else
+static unsigned char tuc[] = {
+ /* INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F,
+ /* 1234.75 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x93, 0x40,
+ /* 4.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40,
+ /* 1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F,
+ /* 0.375 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x3F,
+ /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -0.625 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xBF,
+ /* -1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF,
+ /* -8.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xC0,
+ /* -23.875 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x37, 0xC0,
+ /* -INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF
+};
+#endif
+
+static
+#ifdef __cplusplus
+int
+test_double(double *dp, unsigned char *up)
+#else
+int
+test_double(dp, up)
+ double *dp;
+ unsigned char *up;
+#endif
+{
+ int back = 0;
+#if HAVE_MEMCMP
+ if(memcmp(dp, up, 8) == 0) {
+ back = 1;
+ }
+#else
+#if HAVE_BCMP
+ if(bcmp(dp, up, 8) == 0) {
+ back = 1;
+ }
+#else
+ unsigned char *cp1;
+ unsigned char *cp2;
+ size_t i;
+ back = 1;
+ cp1 = (unsigned char *)dp; cp2 = up;
+ for(i = 0; i < 8; i++) {
+ if(*(cp1++) != *(cp2++)) {
+ back = 0;
+ }
+ }
+#endif
+#endif
+ if(1 != back) {
+ printf("ERROR: %lg not conforming to IEEE 754!\n", *dp);
+ }
+ return back;
+}
+
+#ifdef __cplusplus
+int main(int argc, char *argv[])
+#else
+int main(argc, argv)
+ int argc;
+ char *argv[];
+#endif
+{
+ unsigned char *ucp;
+ double *dp;
+ size_t i;
+ int ev = 1;
+
+ if(8 == sizeof(double)) {
+ ev = 0;
+ ucp = tuc; dp = td;
+ for(i = 0; i < (sizeof(td)/sizeof(double)); i++) {
+ if(!test_double(dp, ucp)) {
+ ev = 1;
+ }
+ dp++;
+ ucp += 8;
+ }
+ } else {
+ printf("ERROR: Size of double is not 1!\n");
+ }
+ exit(ev);
+}
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };IEEE_754_DOUBLE_FOUND='yes'
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; };IEEE_754_DOUBLE_FOUND='no'
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+if [ "X$IEEE_754_DOUBLE_FOUND$IEEE_754_DOUBLE_WISHED" = "Xyesyes" ]
+then
+ $as_echo "#define HAVE_IEEE_754_DOUBLE 1" >>confdefs.h
+
+else
+ IEEE_754_DOUBLE_FOUND='no'
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _LARGEFILE64_SOURCE" >&5
$as_echo_n "checking _LARGEFILE64_SOURCE... " >&6; }
@@ -6608,6 +8571,54 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blocksize and blockcount in stat output" >&5
+$as_echo_n "checking blocksize and blockcount in stat output... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int
+main ()
+{
+
+#if HAVE_TYPE_STAT64
+ struct stat64 stb;
+ stb.st_blksize = 0;
+ stb.st_blocks = 0;
+#else
+ struct stat stb;
+ stb.st_blksize = 0;
+ stb.st_blocks = 0;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_FILE_BLKSIZECNT 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
for ac_func in memset bzero memcpy bcopy memcmp bcmp
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -6847,7 +8858,7 @@ _ACEOF
fi
done
-for ac_func in getenv getenv_s setlocale select
+for ac_func in getenv getenv_s setlocale
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -6871,184 +8882,539 @@ _ACEOF
fi
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Init in -lcrypto" >&5
-$as_echo_n "checking for SHA224_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_SHA224_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+for ac_func in getuid setuid setgid
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in chdir chmod chown
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in opendir readdir closedir
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in getgrent getgrgid getgrnam endgrent setgrent
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in getpwuid getpwnam
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in fopen fclose feof ferror fflush fread fwrite
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _fclose _feof _ferror _fflush _fopen _fread _fwrite
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _getenv_s _wgetenv _getpid
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in fetestexcept _clearfp
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in fork getrlimit setpgrp setsid syslog
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in gethostname
+do :
+ ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname"
+if test "x$ac_cv_func_gethostname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTNAME 1
+_ACEOF
+
+fi
+done
+
+for ac_func in time localtime localtime_s
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in stat stat32 lstat32
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _stat _stat32 _stat64 _lstat _lstat32 _lstat64
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in mpctl sysconf sysctl
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in popen _popen
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in read write _read _write
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in seed48
+do :
+ ac_fn_c_check_func "$LINENO" "seed48" "ac_cv_func_seed48"
+if test "x$ac_cv_func_seed48" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SEED48 1
+_ACEOF
+
+fi
+done
+
+for ac_func in sprintf_s sscanf_s swscanf_s
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in strcat strchr strcmp strcpy strdup strlen strncmp strncpy _strdup
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in strncpy_s strrchr strtoimax strtol strtoll strtoul strtoull
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in strtoumax
+do :
+ ac_fn_c_check_func "$LINENO" "strtoumax" "ac_cv_func_strtoumax"
+if test "x$ac_cv_func_strtoumax" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRTOUMAX 1
+_ACEOF
+
+fi
+done
+
+for ac_func in wcsdup wcsncmp wcsncpy wcsncpy_s wcstoimax wcstol wcstoll
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in wcstoul wcstoull wcstoumax
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _wcscat _wcschr _wcscpy _wcsdup _wcslen _wcsncmp _wcsncpy
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in _wcsrchr
+do :
+ ac_fn_c_check_func "$LINENO" "_wcsrchr" "ac_cv_func__wcsrchr"
+if test "x$ac_cv_func__wcsrchr" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE__WCSRCHR 1
+_ACEOF
+
+fi
+done
+
+for ac_func in tcflush tcgetattr
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in umask
+do :
+ ac_fn_c_check_func "$LINENO" "umask" "ac_cv_func_umask"
+if test "x$ac_cv_func_umask" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UMASK 1
+_ACEOF
+
+fi
+done
+
+for ac_func in GetFinalPathNameByHandle
+do :
+ ac_fn_c_check_func "$LINENO" "GetFinalPathNameByHandle" "ac_cv_func_GetFinalPathNameByHandle"
+if test "x$ac_cv_func_GetFinalPathNameByHandle" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETFINALPATHNAMEBYHANDLE 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isgreater" >&5
+$as_echo_n "checking isgreater... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char SHA224_Init ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return SHA224_Init ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isgreater(x, 4.0)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_SHA224_Init=yes
-else
- ac_cv_lib_crypto_SHA224_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Init" >&5
-$as_echo "$ac_cv_lib_crypto_SHA224_Init" >&6; }
-if test "x$ac_cv_lib_crypto_SHA224_Init" = xyes; then :
- $as_echo "#define HAVE_SHA224 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_ISGREATER 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Init in -lcrypto" >&5
-$as_echo_n "checking for SHA256_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_SHA256_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isgreaterequal" >&5
+$as_echo_n "checking isgreaterequal... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char SHA256_Init ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return SHA256_Init ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isgreaterequal(x, 4.0)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_SHA256_Init=yes
-else
- ac_cv_lib_crypto_SHA256_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Init" >&5
-$as_echo "$ac_cv_lib_crypto_SHA256_Init" >&6; }
-if test "x$ac_cv_lib_crypto_SHA256_Init" = xyes; then :
- $as_echo "#define HAVE_SHA256 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_ISGREATEREQUAL 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA384_Init in -lcrypto" >&5
-$as_echo_n "checking for SHA384_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_SHA384_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isless" >&5
+$as_echo_n "checking isless... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char SHA384_Init ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return SHA384_Init ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isless(x, 6.0)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_SHA384_Init=yes
-else
- ac_cv_lib_crypto_SHA384_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA384_Init" >&5
-$as_echo "$ac_cv_lib_crypto_SHA384_Init" >&6; }
-if test "x$ac_cv_lib_crypto_SHA384_Init" = xyes; then :
- $as_echo "#define HAVE_SHA384 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_ISLESS 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Init in -lcrypto" >&5
-$as_echo_n "checking for SHA512_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_SHA512_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking islessequal" >&5
+$as_echo_n "checking islessequal... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char SHA512_Init ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return SHA512_Init ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (islessequal(x, 6.0)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_SHA512_Init=yes
-else
- ac_cv_lib_crypto_SHA512_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Init" >&5
-$as_echo "$ac_cv_lib_crypto_SHA512_Init" >&6; }
-if test "x$ac_cv_lib_crypto_SHA512_Init" = xyes; then :
- $as_echo "#define HAVE_SHA512 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_ISLESSEQUAL 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RAND_egd" >&5
-$as_echo_n "checking RAND_egd... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isfinite" >&5
+$as_echo_n "checking isfinite... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <openssl/rand.h>
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
int
main ()
{
-int i;
-i = RAND_egd("/dev/egd");
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isfinite(x)) {
+ a = 1;
+ }
;
return 0;
@@ -7056,7 +9422,7 @@ i = RAND_egd("/dev/egd");
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_RAND_EGD 1" >>confdefs.h
+$as_echo "yes" >&6; };$as_echo "#define HAVE_ISFINITE 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -7064,277 +9430,375 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
-$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if ${ac_cv_lib_rt_clock_gettime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrt $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isnormal" >&5
+$as_echo_n "checking isnormal... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char clock_gettime ();
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+
int
main ()
{
-return clock_gettime ();
+
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isnormal(x)) {
+ a = 1;
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_rt_clock_gettime=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_ISNORMAL 1" >>confdefs.h
+
else
- ac_cv_lib_rt_clock_gettime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
-$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
- RTLIB="-lrt"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _finite" >&5
+$as_echo_n "checking _finite... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-SOCKLIB=''
-NSLLIB=''
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
-for ac_func in socket
-do :
- ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
-if test "x$ac_cv_func_socket" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SOCKET 1
-_ACEOF
+int
+main ()
+{
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-$as_echo "#define HAVE_SOCKET 1" >>confdefs.h
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (_finite(x)) {
+ a = 1;
+ }
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE__FINITE 1" >>confdefs.h
else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lxnet" >&5
-$as_echo_n "checking for socket in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fpclassify" >&5
+$as_echo_n "checking fpclassify... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
#endif
-char socket ();
+
int
main ()
{
-return socket ();
+
+int cl;
+cl = fpclassify(-0.5);
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_socket=yes
-else
- ac_cv_lib_xnet_socket=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_socket" >&5
-$as_echo "$ac_cv_lib_xnet_socket" >&6; }
-if test "x$ac_cv_lib_xnet_socket" = xyes; then :
-
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-$as_echo "#define HAVE_SOCKET 1" >>confdefs.h
-
-SOCKLIB='-lxnet'
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_FPCLASSIFY 1" >>confdefs.h
else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
-$as_echo_n "checking for socket in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mkdir(path,mode);" >&5
+$as_echo_n "checking mkdir(path,mode);... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
-char socket ();
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
int
main ()
{
-return socket ();
+
+mkdir("test", 0755);
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_socket=yes
-else
- ac_cv_lib_socket_socket=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
-$as_echo "$ac_cv_lib_socket_socket" >&6; }
-if test "x$ac_cv_lib_socket_socket" = xyes; then :
-
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-$as_echo "#define HAVE_SOCKET 1" >>confdefs.h
-
-SOCKLIB='-lsocket'
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_MKDIR2 1" >>confdefs.h
else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lws2_32" >&5
-$as_echo_n "checking for socket in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking qsort" >&5
+$as_echo_n "checking qsort... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#if HAVE_STDLIB_H
+#include <stdlib.h>
#endif
-char socket ();
+
+#if HAVE_SEARCH_H
+#include <search.h>
+#endif
+
+typedef struct { int a; int b; } test_t;
+
+test_t testvar[] = {
+ { 1, 1 },
+ { 2, 2 }
+};
+
+int testcmp(const void *l, const void *r)
+{
+ int back = 0;
+ const test_t *pl;
+ const test_t *pr;
+ pl = (const test_t *)l;
+ pr = (const test_t *)r;
+ if (pl->a < pr->a) {
+ back = -1;
+ }
+ else {
+ if (pl->a > pr->a) {
+ back = 1;
+ }
+ }
+}
+
int
main ()
{
-return socket ();
+
+qsort(testvar, 2, sizeof(test_t), testcmp);
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_socket=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_QSORT 1" >>confdefs.h
+
else
- ac_cv_lib_ws2_32_socket=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_socket" >&5
-$as_echo "$ac_cv_lib_ws2_32_socket" >&6; }
-if test "x$ac_cv_lib_ws2_32_socket" = xyes; then :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-$as_echo "#define HAVE_SOCKET 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking bsearch" >&5
+$as_echo_n "checking bsearch... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-SOCKLIB='-lws2_32'
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
-fi
+#if HAVE_SEARCH_H
+#include <search.h>
+#endif
+typedef struct { int a; int b; } test_t;
-fi
+test_t testvar[] = {
+ { 1, 1 },
+ { 2, 2 }
+};
+int testcmp(const void *l, const void *r)
+{
+ int back = 0;
+ const test_t *pl;
+ const test_t *pr;
+ pl = (const test_t *)l;
+ pr = (const test_t *)r;
+ if (pl->a < pr->a) {
+ back = -1;
+ }
+ else {
+ if (pl->a > pr->a) {
+ back = 1;
+ }
+ }
+}
-fi
+int
+main ()
+{
+
+bsearch(&(testvar[0]), testvar, 2, sizeof(test_t), testcmp);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_BSEARCH 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-done
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-for ac_func in setsockopt
-do :
- ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
-if test "x$ac_cv_func_setsockopt" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SETSOCKOPT 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking setgroups" >&5
+$as_echo_n "checking setgroups... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-$as_echo "#define HAVE_SETSOCKOPT 1" >>confdefs.h
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int
+main ()
+{
-else
+ gid_t gid = 0;
+ if (0 != setgroups(1, &gid)) {
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_SETGROUPS 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lxnet" >&5
-$as_echo_n "checking for setsockopt in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_setsockopt+:} false; then :
- $as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking initgroups" >&5
+$as_echo_n "checking initgroups... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
-char setsockopt ();
+#if HAVE_GRP_H
+#include <grp.h>
+#endif
+
int
main ()
{
-return setsockopt ();
+
+ gid_t gid = 0;
+ if (0 != initgroups("abcdefg", gid)) {
+ }
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_setsockopt=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_INITGROUPS 1" >>confdefs.h
+
else
- ac_cv_lib_xnet_setsockopt=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_setsockopt" >&5
-$as_echo "$ac_cv_lib_xnet_setsockopt" >&6; }
-if test "x$ac_cv_lib_xnet_setsockopt" = xyes; then :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-$as_echo "#define HAVE_SETSOCKOPT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assert" >&5
+$as_echo_n "checking assert... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <assert.h>
+
+int
+main ()
+{
+int i = -1;
+assert(0 < i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ASSERT_FOUND='yes';{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
-$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_setsockopt+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosh in -lm" >&5
+$as_echo_n "checking for acosh in -lm... " >&6; }
+if ${ac_cv_lib_m_acosh+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7344,40 +9808,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char setsockopt ();
+char acosh ();
int
main ()
{
-return setsockopt ();
+return acosh ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_setsockopt=yes
+ ac_cv_lib_m_acosh=yes
else
- ac_cv_lib_socket_setsockopt=no
+ ac_cv_lib_m_acosh=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
-$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
-if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
-
-$as_echo "#define HAVE_SETSOCKOPT 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosh" >&5
+$as_echo "$ac_cv_lib_m_acosh" >&6; }
+if test "x$ac_cv_lib_m_acosh" = xyes; then :
+ $as_echo "#define HAVE_ACOSH 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lws2_32" >&5
-$as_echo_n "checking for setsockopt in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_setsockopt+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acoshl in -lm" >&5
+$as_echo_n "checking for acoshl in -lm... " >&6; }
+if ${ac_cv_lib_m_acoshl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7387,64 +9849,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char setsockopt ();
+char acoshl ();
int
main ()
{
-return setsockopt ();
+return acoshl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_setsockopt=yes
+ ac_cv_lib_m_acoshl=yes
else
- ac_cv_lib_ws2_32_setsockopt=no
+ ac_cv_lib_m_acoshl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_setsockopt" >&5
-$as_echo "$ac_cv_lib_ws2_32_setsockopt" >&6; }
-if test "x$ac_cv_lib_ws2_32_setsockopt" = xyes; then :
-
-$as_echo "#define HAVE_SETSOCKOPT 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acoshl" >&5
+$as_echo "$ac_cv_lib_m_acoshl" >&6; }
+if test "x$ac_cv_lib_m_acoshl" = xyes; then :
+ $as_echo "#define HAVE_ACOSHL 1" >>confdefs.h
fi
-done
-
-
-for ac_func in getaddrinfo
-do :
- ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
-if test "x$ac_cv_func_getaddrinfo" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETADDRINFO 1
-_ACEOF
-$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lxnet" >&5
-$as_echo_n "checking for getaddrinfo in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_getaddrinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosl in -lm" >&5
+$as_echo_n "checking for acosl in -lm... " >&6; }
+if ${ac_cv_lib_m_acosl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7454,41 +9890,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getaddrinfo ();
+char acosl ();
int
main ()
{
-return getaddrinfo ();
+return acosl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_getaddrinfo=yes
+ ac_cv_lib_m_acosl=yes
else
- ac_cv_lib_xnet_getaddrinfo=no
+ ac_cv_lib_m_acosl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getaddrinfo" >&5
-$as_echo "$ac_cv_lib_xnet_getaddrinfo" >&6; }
-if test "x$ac_cv_lib_xnet_getaddrinfo" = xyes; then :
-
-NSLLIB='-lxnet'
-$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosl" >&5
+$as_echo "$ac_cv_lib_m_acosl" >&6; }
+if test "x$ac_cv_lib_m_acosl" = xyes; then :
+ $as_echo "#define HAVE_ACOSL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lnsl" >&5
-$as_echo_n "checking for getaddrinfo in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_getaddrinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinh in -lm" >&5
+$as_echo_n "checking for asinh in -lm... " >&6; }
+if ${ac_cv_lib_m_asinh+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7498,41 +9931,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getaddrinfo ();
+char asinh ();
int
main ()
{
-return getaddrinfo ();
+return asinh ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_getaddrinfo=yes
+ ac_cv_lib_m_asinh=yes
else
- ac_cv_lib_nsl_getaddrinfo=no
+ ac_cv_lib_m_asinh=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getaddrinfo" >&5
-$as_echo "$ac_cv_lib_nsl_getaddrinfo" >&6; }
-if test "x$ac_cv_lib_nsl_getaddrinfo" = xyes; then :
-
-NSLLIB='-lnsl'
-$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinh" >&5
+$as_echo "$ac_cv_lib_m_asinh" >&6; }
+if test "x$ac_cv_lib_m_asinh" = xyes; then :
+ $as_echo "#define HAVE_ASINH 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lsocket" >&5
-$as_echo_n "checking for getaddrinfo in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_getaddrinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinhl in -lm" >&5
+$as_echo_n "checking for asinhl in -lm... " >&6; }
+if ${ac_cv_lib_m_asinhl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7542,41 +9972,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getaddrinfo ();
+char asinhl ();
int
main ()
{
-return getaddrinfo ();
+return asinhl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_getaddrinfo=yes
+ ac_cv_lib_m_asinhl=yes
else
- ac_cv_lib_socket_getaddrinfo=no
+ ac_cv_lib_m_asinhl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getaddrinfo" >&5
-$as_echo "$ac_cv_lib_socket_getaddrinfo" >&6; }
-if test "x$ac_cv_lib_socket_getaddrinfo" = xyes; then :
-
-NSLLIB='-lsocket'
-$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinhl" >&5
+$as_echo "$ac_cv_lib_m_asinhl" >&6; }
+if test "x$ac_cv_lib_m_asinhl" = xyes; then :
+ $as_echo "#define HAVE_ASINHL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lws2_32" >&5
-$as_echo_n "checking for getaddrinfo in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_getaddrinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinl in -lm" >&5
+$as_echo_n "checking for asinl in -lm... " >&6; }
+if ${ac_cv_lib_m_asinl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7586,67 +10013,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getaddrinfo ();
+char asinl ();
int
main ()
{
-return getaddrinfo ();
+return asinl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_getaddrinfo=yes
+ ac_cv_lib_m_asinl=yes
else
- ac_cv_lib_ws2_32_getaddrinfo=no
+ ac_cv_lib_m_asinl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getaddrinfo" >&5
-$as_echo "$ac_cv_lib_ws2_32_getaddrinfo" >&6; }
-if test "x$ac_cv_lib_ws2_32_getaddrinfo" = xyes; then :
-
-$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinl" >&5
+$as_echo "$ac_cv_lib_m_asinl" >&6; }
+if test "x$ac_cv_lib_m_asinl" = xyes; then :
+ $as_echo "#define HAVE_ASINL 1" >>confdefs.h
fi
-done
-
-
-for ac_func in getnameinfo
-do :
- ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo"
-if test "x$ac_cv_func_getnameinfo" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETNAMEINFO 1
-_ACEOF
-
-$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lxnet" >&5
-$as_echo_n "checking for getnameinfo in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_getnameinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2 in -lm" >&5
+$as_echo_n "checking for atan2 in -lm... " >&6; }
+if ${ac_cv_lib_m_atan2+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7656,40 +10054,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getnameinfo ();
+char atan2 ();
int
main ()
{
-return getnameinfo ();
+return atan2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_getnameinfo=yes
+ ac_cv_lib_m_atan2=yes
else
- ac_cv_lib_xnet_getnameinfo=no
+ ac_cv_lib_m_atan2=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getnameinfo" >&5
-$as_echo "$ac_cv_lib_xnet_getnameinfo" >&6; }
-if test "x$ac_cv_lib_xnet_getnameinfo" = xyes; then :
-
-$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2" >&5
+$as_echo "$ac_cv_lib_m_atan2" >&6; }
+if test "x$ac_cv_lib_m_atan2" = xyes; then :
+ $as_echo "#define HAVE_ATAN2 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lnsl" >&5
-$as_echo_n "checking for getnameinfo in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_getnameinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2l in -lm" >&5
+$as_echo_n "checking for atan2l in -lm... " >&6; }
+if ${ac_cv_lib_m_atan2l+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7699,40 +10095,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getnameinfo ();
+char atan2l ();
int
main ()
{
-return getnameinfo ();
+return atan2l ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_getnameinfo=yes
+ ac_cv_lib_m_atan2l=yes
else
- ac_cv_lib_nsl_getnameinfo=no
+ ac_cv_lib_m_atan2l=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getnameinfo" >&5
-$as_echo "$ac_cv_lib_nsl_getnameinfo" >&6; }
-if test "x$ac_cv_lib_nsl_getnameinfo" = xyes; then :
-
-$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2l" >&5
+$as_echo "$ac_cv_lib_m_atan2l" >&6; }
+if test "x$ac_cv_lib_m_atan2l" = xyes; then :
+ $as_echo "#define HAVE_ATAN2L 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lsocket" >&5
-$as_echo_n "checking for getnameinfo in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_getnameinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanh in -lm" >&5
+$as_echo_n "checking for atanh in -lm... " >&6; }
+if ${ac_cv_lib_m_atanh+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7742,40 +10136,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getnameinfo ();
+char atanh ();
int
main ()
{
-return getnameinfo ();
+return atanh ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_getnameinfo=yes
+ ac_cv_lib_m_atanh=yes
else
- ac_cv_lib_socket_getnameinfo=no
+ ac_cv_lib_m_atanh=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getnameinfo" >&5
-$as_echo "$ac_cv_lib_socket_getnameinfo" >&6; }
-if test "x$ac_cv_lib_socket_getnameinfo" = xyes; then :
-
-$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanh" >&5
+$as_echo "$ac_cv_lib_m_atanh" >&6; }
+if test "x$ac_cv_lib_m_atanh" = xyes; then :
+ $as_echo "#define HAVE_ATANH 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lws2_32" >&5
-$as_echo_n "checking for getnameinfo in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_getnameinfo+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanhl in -lm" >&5
+$as_echo_n "checking for atanhl in -lm... " >&6; }
+if ${ac_cv_lib_m_atanhl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7785,67 +10177,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getnameinfo ();
+char atanhl ();
int
main ()
{
-return getnameinfo ();
+return atanhl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_getnameinfo=yes
+ ac_cv_lib_m_atanhl=yes
else
- ac_cv_lib_ws2_32_getnameinfo=no
+ ac_cv_lib_m_atanhl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getnameinfo" >&5
-$as_echo "$ac_cv_lib_ws2_32_getnameinfo" >&6; }
-if test "x$ac_cv_lib_ws2_32_getnameinfo" = xyes; then :
-
-$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanhl" >&5
+$as_echo "$ac_cv_lib_m_atanhl" >&6; }
+if test "x$ac_cv_lib_m_atanhl" = xyes; then :
+ $as_echo "#define HAVE_ATANHL 1" >>confdefs.h
fi
-done
-
-for ac_func in gethostbyname
-do :
- ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETHOSTBYNAME 1
-_ACEOF
-
-$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lxnet" >&5
-$as_echo_n "checking for gethostbyname in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_gethostbyname+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanl in -lm" >&5
+$as_echo_n "checking for atanl in -lm... " >&6; }
+if ${ac_cv_lib_m_atanl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7855,40 +10218,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char atanl ();
int
main ()
{
-return gethostbyname ();
+return atanl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_gethostbyname=yes
+ ac_cv_lib_m_atanl=yes
else
- ac_cv_lib_xnet_gethostbyname=no
+ ac_cv_lib_m_atanl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_gethostbyname" >&5
-$as_echo "$ac_cv_lib_xnet_gethostbyname" >&6; }
-if test "x$ac_cv_lib_xnet_gethostbyname" = xyes; then :
-
-$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanl" >&5
+$as_echo "$ac_cv_lib_m_atanl" >&6; }
+if test "x$ac_cv_lib_m_atanl" = xyes; then :
+ $as_echo "#define HAVE_ATANL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5
+$as_echo_n "checking for ceil in -lm... " >&6; }
+if ${ac_cv_lib_m_ceil+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7898,40 +10259,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char ceil ();
int
main ()
{
-return gethostbyname ();
+return ceil ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_gethostbyname=yes
+ ac_cv_lib_m_ceil=yes
else
- ac_cv_lib_nsl_gethostbyname=no
+ ac_cv_lib_m_ceil=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
-
-$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceil" >&5
+$as_echo "$ac_cv_lib_m_ceil" >&6; }
+if test "x$ac_cv_lib_m_ceil" = xyes; then :
+ $as_echo "#define HAVE_CEIL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5
-$as_echo_n "checking for gethostbyname in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_gethostbyname+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceill in -lm" >&5
+$as_echo_n "checking for ceill in -lm... " >&6; }
+if ${ac_cv_lib_m_ceill+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7941,40 +10300,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char ceill ();
int
main ()
{
-return gethostbyname ();
+return ceill ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_gethostbyname=yes
+ ac_cv_lib_m_ceill=yes
else
- ac_cv_lib_socket_gethostbyname=no
+ ac_cv_lib_m_ceill=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5
-$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; }
-if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then :
-
-$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceill" >&5
+$as_echo "$ac_cv_lib_m_ceill" >&6; }
+if test "x$ac_cv_lib_m_ceill" = xyes; then :
+ $as_echo "#define HAVE_CEILL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lws3_32" >&5
-$as_echo_n "checking for gethostbyname in -lws3_32... " >&6; }
-if ${ac_cv_lib_ws3_32_gethostbyname+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for coshl in -lm" >&5
+$as_echo_n "checking for coshl in -lm... " >&6; }
+if ${ac_cv_lib_m_coshl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws3_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7984,255 +10341,79 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char coshl ();
int
main ()
{
-return gethostbyname ();
+return coshl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws3_32_gethostbyname=yes
+ ac_cv_lib_m_coshl=yes
else
- ac_cv_lib_ws3_32_gethostbyname=no
+ ac_cv_lib_m_coshl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws3_32_gethostbyname" >&5
-$as_echo "$ac_cv_lib_ws3_32_gethostbyname" >&6; }
-if test "x$ac_cv_lib_ws3_32_gethostbyname" = xyes; then :
-
-$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_coshl" >&5
+$as_echo "$ac_cv_lib_m_coshl" >&6; }
+if test "x$ac_cv_lib_m_coshl" = xyes; then :
+ $as_echo "#define HAVE_COSHL 1" >>confdefs.h
fi
-done
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking htons" >&5
-$as_echo_n "checking htons... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-int
-main ()
-{
-
- unsigned short s;
- s = htons(5);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "#define HAVE_HTONS 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosl in -lm" >&5
+$as_echo_n "checking for cosl in -lm... " >&6; }
+if ${ac_cv_lib_m_cosl+:} false; then :
+ $as_echo_n "(cached) " >&6
else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ntohs" >&5
-$as_echo_n "checking ntohs... " >&6; }
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char cosl ();
int
main ()
{
-
- unsigned short s;
- s = ntohs(5);
-
+return cosl ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "#define HAVE_NTOHS 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cosl=yes
else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
+ ac_cv_lib_m_cosl=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking htonl" >&5
-$as_echo_n "checking htonl... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-int
-main ()
-{
-
- unsigned long s;
- s = htonl(5);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "#define HAVE_HTONL 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ntohl" >&5
-$as_echo_n "checking ntohl... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-int
-main ()
-{
-
- unsigned long s;
- s = ntohl(5);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "#define HAVE_NTOHL 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cosl" >&5
+$as_echo "$ac_cv_lib_m_cosl" >&6; }
+if test "x$ac_cv_lib_m_cosl" = xyes; then :
+ $as_echo "#define HAVE_COSL 1" >>confdefs.h
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-for ac_func in inet_addr
-do :
- ac_fn_c_check_func "$LINENO" "inet_addr" "ac_cv_func_inet_addr"
-if test "x$ac_cv_func_inet_addr" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_INET_ADDR 1
-_ACEOF
-
-$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lxnet" >&5
-$as_echo_n "checking for inet_addr in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_inet_addr+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for expl in -lm" >&5
+$as_echo_n "checking for expl in -lm... " >&6; }
+if ${ac_cv_lib_m_expl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8242,40 +10423,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_addr ();
+char expl ();
int
main ()
{
-return inet_addr ();
+return expl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_inet_addr=yes
+ ac_cv_lib_m_expl=yes
else
- ac_cv_lib_xnet_inet_addr=no
+ ac_cv_lib_m_expl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_addr" >&5
-$as_echo "$ac_cv_lib_xnet_inet_addr" >&6; }
-if test "x$ac_cv_lib_xnet_inet_addr" = xyes; then :
-
-$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_expl" >&5
+$as_echo "$ac_cv_lib_m_expl" >&6; }
+if test "x$ac_cv_lib_m_expl" = xyes; then :
+ $as_echo "#define HAVE_EXPL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lnsl" >&5
-$as_echo_n "checking for inet_addr in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_inet_addr+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabs in -lm" >&5
+$as_echo_n "checking for fabs in -lm... " >&6; }
+if ${ac_cv_lib_m_fabs+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8285,40 +10464,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_addr ();
+char fabs ();
int
main ()
{
-return inet_addr ();
+return fabs ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_inet_addr=yes
+ ac_cv_lib_m_fabs=yes
else
- ac_cv_lib_nsl_inet_addr=no
+ ac_cv_lib_m_fabs=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_addr" >&5
-$as_echo "$ac_cv_lib_nsl_inet_addr" >&6; }
-if test "x$ac_cv_lib_nsl_inet_addr" = xyes; then :
-
-$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabs" >&5
+$as_echo "$ac_cv_lib_m_fabs" >&6; }
+if test "x$ac_cv_lib_m_fabs" = xyes; then :
+ $as_echo "#define HAVE_FABS 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lsocket" >&5
-$as_echo_n "checking for inet_addr in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_inet_addr+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsl in -lm" >&5
+$as_echo_n "checking for fabsl in -lm... " >&6; }
+if ${ac_cv_lib_m_fabsl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8328,40 +10505,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_addr ();
+char fabsl ();
int
main ()
{
-return inet_addr ();
+return fabsl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_inet_addr=yes
+ ac_cv_lib_m_fabsl=yes
else
- ac_cv_lib_socket_inet_addr=no
+ ac_cv_lib_m_fabsl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_addr" >&5
-$as_echo "$ac_cv_lib_socket_inet_addr" >&6; }
-if test "x$ac_cv_lib_socket_inet_addr" = xyes; then :
-
-$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabsl" >&5
+$as_echo "$ac_cv_lib_m_fabsl" >&6; }
+if test "x$ac_cv_lib_m_fabsl" = xyes; then :
+ $as_echo "#define HAVE_FABSL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lws2_32" >&5
-$as_echo_n "checking for inet_addr in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_inet_addr+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5
+$as_echo_n "checking for floor in -lm... " >&6; }
+if ${ac_cv_lib_m_floor+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8371,67 +10546,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_addr ();
+char floor ();
int
main ()
{
-return inet_addr ();
+return floor ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_inet_addr=yes
+ ac_cv_lib_m_floor=yes
else
- ac_cv_lib_ws2_32_inet_addr=no
+ ac_cv_lib_m_floor=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_addr" >&5
-$as_echo "$ac_cv_lib_ws2_32_inet_addr" >&6; }
-if test "x$ac_cv_lib_ws2_32_inet_addr" = xyes; then :
-
-$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5
+$as_echo "$ac_cv_lib_m_floor" >&6; }
+if test "x$ac_cv_lib_m_floor" = xyes; then :
+ $as_echo "#define HAVE_FLOOR 1" >>confdefs.h
fi
-done
-
-for ac_func in inet_aton
-do :
- ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
-if test "x$ac_cv_func_inet_aton" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_INET_ATON 1
-_ACEOF
-
-$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lxnet" >&5
-$as_echo_n "checking for inet_aton in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_inet_aton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floorl in -lm" >&5
+$as_echo_n "checking for floorl in -lm... " >&6; }
+if ${ac_cv_lib_m_floorl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8441,40 +10587,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_aton ();
+char floorl ();
int
main ()
{
-return inet_aton ();
+return floorl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_inet_aton=yes
+ ac_cv_lib_m_floorl=yes
else
- ac_cv_lib_xnet_inet_aton=no
+ ac_cv_lib_m_floorl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_aton" >&5
-$as_echo "$ac_cv_lib_xnet_inet_aton" >&6; }
-if test "x$ac_cv_lib_xnet_inet_aton" = xyes; then :
-
-$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floorl" >&5
+$as_echo "$ac_cv_lib_m_floorl" >&6; }
+if test "x$ac_cv_lib_m_floorl" = xyes; then :
+ $as_echo "#define HAVE_FLOORL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lnsl" >&5
-$as_echo_n "checking for inet_aton in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_inet_aton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for labs in -lm" >&5
+$as_echo_n "checking for labs in -lm... " >&6; }
+if ${ac_cv_lib_m_labs+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8484,40 +10628,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_aton ();
+char labs ();
int
main ()
{
-return inet_aton ();
+return labs ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_inet_aton=yes
+ ac_cv_lib_m_labs=yes
else
- ac_cv_lib_nsl_inet_aton=no
+ ac_cv_lib_m_labs=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_aton" >&5
-$as_echo "$ac_cv_lib_nsl_inet_aton" >&6; }
-if test "x$ac_cv_lib_nsl_inet_aton" = xyes; then :
-
-$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_labs" >&5
+$as_echo "$ac_cv_lib_m_labs" >&6; }
+if test "x$ac_cv_lib_m_labs" = xyes; then :
+ $as_echo "#define HAVE_LABS 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lsocket" >&5
-$as_echo_n "checking for inet_aton in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_inet_aton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for logl in -lm" >&5
+$as_echo_n "checking for logl in -lm... " >&6; }
+if ${ac_cv_lib_m_logl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8527,40 +10669,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_aton ();
+char logl ();
int
main ()
{
-return inet_aton ();
+return logl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_inet_aton=yes
+ ac_cv_lib_m_logl=yes
else
- ac_cv_lib_socket_inet_aton=no
+ ac_cv_lib_m_logl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_aton" >&5
-$as_echo "$ac_cv_lib_socket_inet_aton" >&6; }
-if test "x$ac_cv_lib_socket_inet_aton" = xyes; then :
-
-$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_logl" >&5
+$as_echo "$ac_cv_lib_m_logl" >&6; }
+if test "x$ac_cv_lib_m_logl" = xyes; then :
+ $as_echo "#define HAVE_LOGL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lws2_32" >&5
-$as_echo_n "checking for inet_aton in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_inet_aton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rint in -lm" >&5
+$as_echo_n "checking for rint in -lm... " >&6; }
+if ${ac_cv_lib_m_rint+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8570,67 +10710,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_aton ();
+char rint ();
int
main ()
{
-return inet_aton ();
+return rint ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_inet_aton=yes
+ ac_cv_lib_m_rint=yes
else
- ac_cv_lib_ws2_32_inet_aton=no
+ ac_cv_lib_m_rint=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_aton" >&5
-$as_echo "$ac_cv_lib_ws2_32_inet_aton" >&6; }
-if test "x$ac_cv_lib_ws2_32_inet_aton" = xyes; then :
-
-$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_rint" >&5
+$as_echo "$ac_cv_lib_m_rint" >&6; }
+if test "x$ac_cv_lib_m_rint" = xyes; then :
+ $as_echo "#define HAVE_RINT 1" >>confdefs.h
fi
-done
-
-for ac_func in inet_pton
-do :
- ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
-if test "x$ac_cv_func_inet_pton" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_INET_PTON 1
-_ACEOF
-
-$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lxnet" >&5
-$as_echo_n "checking for inet_pton in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_inet_pton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rintl in -lm" >&5
+$as_echo_n "checking for rintl in -lm... " >&6; }
+if ${ac_cv_lib_m_rintl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8640,40 +10751,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_pton ();
+char rintl ();
int
main ()
{
-return inet_pton ();
+return rintl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_inet_pton=yes
+ ac_cv_lib_m_rintl=yes
else
- ac_cv_lib_xnet_inet_pton=no
+ ac_cv_lib_m_rintl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_pton" >&5
-$as_echo "$ac_cv_lib_xnet_inet_pton" >&6; }
-if test "x$ac_cv_lib_xnet_inet_pton" = xyes; then :
-
-$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_rintl" >&5
+$as_echo "$ac_cv_lib_m_rintl" >&6; }
+if test "x$ac_cv_lib_m_rintl" = xyes; then :
+ $as_echo "#define HAVE_RINTL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lnsl" >&5
-$as_echo_n "checking for inet_pton in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_inet_pton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinhl in -lm" >&5
+$as_echo_n "checking for sinhl in -lm... " >&6; }
+if ${ac_cv_lib_m_sinhl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8683,40 +10792,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_pton ();
+char sinhl ();
int
main ()
{
-return inet_pton ();
+return sinhl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_inet_pton=yes
+ ac_cv_lib_m_sinhl=yes
else
- ac_cv_lib_nsl_inet_pton=no
+ ac_cv_lib_m_sinhl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_pton" >&5
-$as_echo "$ac_cv_lib_nsl_inet_pton" >&6; }
-if test "x$ac_cv_lib_nsl_inet_pton" = xyes; then :
-
-$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinhl" >&5
+$as_echo "$ac_cv_lib_m_sinhl" >&6; }
+if test "x$ac_cv_lib_m_sinhl" = xyes; then :
+ $as_echo "#define HAVE_SINHL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lsocket" >&5
-$as_echo_n "checking for inet_pton in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_inet_pton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
+$as_echo_n "checking for sqrt in -lm... " >&6; }
+if ${ac_cv_lib_m_sqrt+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8726,40 +10833,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_pton ();
+char sqrt ();
int
main ()
{
-return inet_pton ();
+return sqrt ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_inet_pton=yes
+ ac_cv_lib_m_sqrt=yes
else
- ac_cv_lib_socket_inet_pton=no
+ ac_cv_lib_m_sqrt=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_pton" >&5
-$as_echo "$ac_cv_lib_socket_inet_pton" >&6; }
-if test "x$ac_cv_lib_socket_inet_pton" = xyes; then :
-
-$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
+$as_echo "$ac_cv_lib_m_sqrt" >&6; }
+if test "x$ac_cv_lib_m_sqrt" = xyes; then :
+ $as_echo "#define HAVE_SQRT 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lws2_32" >&5
-$as_echo_n "checking for inet_pton in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_inet_pton+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtl in -lm" >&5
+$as_echo_n "checking for sqrtl in -lm... " >&6; }
+if ${ac_cv_lib_m_sqrtl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8769,67 +10874,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_pton ();
+char sqrtl ();
int
main ()
{
-return inet_pton ();
+return sqrtl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_inet_pton=yes
+ ac_cv_lib_m_sqrtl=yes
else
- ac_cv_lib_ws2_32_inet_pton=no
+ ac_cv_lib_m_sqrtl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_pton" >&5
-$as_echo "$ac_cv_lib_ws2_32_inet_pton" >&6; }
-if test "x$ac_cv_lib_ws2_32_inet_pton" = xyes; then :
-
-$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrtl" >&5
+$as_echo "$ac_cv_lib_m_sqrtl" >&6; }
+if test "x$ac_cv_lib_m_sqrtl" = xyes; then :
+ $as_echo "#define HAVE_SQRTL 1" >>confdefs.h
fi
-done
-
-
-for ac_func in inet_ntop
-do :
- ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
-if test "x$ac_cv_func_inet_ntop" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_INET_NTOP 1
-_ACEOF
-$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lxnet" >&5
-$as_echo_n "checking for inet_ntop in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_inet_ntop+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinl in -lm" >&5
+$as_echo_n "checking for sinl in -lm... " >&6; }
+if ${ac_cv_lib_m_sinl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8839,40 +10915,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntop ();
+char sinl ();
int
main ()
{
-return inet_ntop ();
+return sinl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_inet_ntop=yes
+ ac_cv_lib_m_sinl=yes
else
- ac_cv_lib_xnet_inet_ntop=no
+ ac_cv_lib_m_sinl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_ntop" >&5
-$as_echo "$ac_cv_lib_xnet_inet_ntop" >&6; }
-if test "x$ac_cv_lib_xnet_inet_ntop" = xyes; then :
-
-$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinl" >&5
+$as_echo "$ac_cv_lib_m_sinl" >&6; }
+if test "x$ac_cv_lib_m_sinl" = xyes; then :
+ $as_echo "#define HAVE_SINL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lnsl" >&5
-$as_echo_n "checking for inet_ntop in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_inet_ntop+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanhl in -lm" >&5
+$as_echo_n "checking for tanhl in -lm... " >&6; }
+if ${ac_cv_lib_m_tanhl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8882,40 +10956,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntop ();
+char tanhl ();
int
main ()
{
-return inet_ntop ();
+return tanhl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_inet_ntop=yes
+ ac_cv_lib_m_tanhl=yes
else
- ac_cv_lib_nsl_inet_ntop=no
+ ac_cv_lib_m_tanhl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntop" >&5
-$as_echo "$ac_cv_lib_nsl_inet_ntop" >&6; }
-if test "x$ac_cv_lib_nsl_inet_ntop" = xyes; then :
-
-$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanhl" >&5
+$as_echo "$ac_cv_lib_m_tanhl" >&6; }
+if test "x$ac_cv_lib_m_tanhl" = xyes; then :
+ $as_echo "#define HAVE_TANHL 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lsocket" >&5
-$as_echo_n "checking for inet_ntop in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_inet_ntop+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanl in -lm" >&5
+$as_echo_n "checking for tanl in -lm... " >&6; }
+if ${ac_cv_lib_m_tanl+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
+LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8925,40 +10997,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntop ();
+char tanl ();
int
main ()
{
-return inet_ntop ();
+return tanl ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_inet_ntop=yes
+ ac_cv_lib_m_tanl=yes
else
- ac_cv_lib_socket_inet_ntop=no
+ ac_cv_lib_m_tanl=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_ntop" >&5
-$as_echo "$ac_cv_lib_socket_inet_ntop" >&6; }
-if test "x$ac_cv_lib_socket_inet_ntop" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanl" >&5
+$as_echo "$ac_cv_lib_m_tanl" >&6; }
+if test "x$ac_cv_lib_m_tanl" = xyes; then :
+ $as_echo "#define HAVE_TANL 1" >>confdefs.h
-$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
+fi
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lws2_32" >&5
-$as_echo_n "checking for inet_ntop in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_inet_ntop+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32 $LIBS"
+LIBS="-lrt $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8968,139 +11040,91 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntop ();
+char clock_gettime ();
int
main ()
{
-return inet_ntop ();
+return clock_gettime ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ws2_32_inet_ntop=yes
+ ac_cv_lib_rt_clock_gettime=yes
else
- ac_cv_lib_ws2_32_inet_ntop=no
+ ac_cv_lib_rt_clock_gettime=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_ntop" >&5
-$as_echo "$ac_cv_lib_ws2_32_inet_ntop" >&6; }
-if test "x$ac_cv_lib_ws2_32_inet_ntop" = xyes; then :
-
-$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+ RTLIB='-lrt'
+fi
-fi
+case X$TARGETCLASS in
+ Xwindows)
+ $as_echo "#define HAVE_BACKSLASH_AS_SEP 1" >>confdefs.h
+ $as_echo "#define HAVE_LINE_END_CR_NL 1" >>confdefs.h
-fi
+ $as_echo "#define HAVE_CASE_INSENSITIVE_PATHNAMES 1" >>confdefs.h
+ $as_echo "#define HAVE_CASE_INSENSITIVE_USERNAMES 1" >>confdefs.h
-fi
+ ;;
+ *)
+ $as_echo "#define HAVE_FILE_DEVINO 1" >>confdefs.h
+ $as_echo "#define HAVE_FILE_UIDGID 1" >>confdefs.h
-fi
+ $as_echo "#define HAVE_FILE_ATIMECTIME 1" >>confdefs.h
+ ;;
+esac
-fi
-done
+$as_echo "#define HAVE_COMPATDKTOOLS3 1" >>confdefs.h
-if [ "X$SOCKLIB" = "X$NSLLIB" ]
-then
-NSLLIB=''
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking /proc/.../exe symbolic link" >&5
-$as_echo_n "checking /proc/.../exe symbolic link... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - test not possible" >&5
-$as_echo "no - test not possible" >&6; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking socklen_t" >&5
+$as_echo_n "checking socklen_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-
-/* Buffer for result */
-char prog[1024];
-
-#ifdef __cplusplus
-int main(int argc, char *argv[])
-#else
-int main(argc, argv) int argc; char *argv[];
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
#endif
-{
- char buf[64];
- struct stat stbuf;
- int exv = 1;
- ssize_t res;
-#if HAVE_STDINT_H
- sprintf(buf, "/proc/%ju/exe", (uintmax_t)getpid());
-#else
- sprintf(buf, "/proc/%lu/exe", (unsigned long)getpid());
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
#endif
- res = readlink(buf, prog, sizeof(prog));
- if ((0 < res) && (sizeof(prog) > res)) {
- prog[res] = '\0';
- if (0 == stat(prog, &stbuf)) {
- exv = 0;
- }
- }
- return exv;
-}
-
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_PROC_PID_EXE 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ssize_t" >&5
-$as_echo_n "checking ssize_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if HAVE_STDLIB_H
-#include <stdlib.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
#endif
int
main ()
{
- ssize_t sz;
+socklen_t sz;
;
return 0;
@@ -9110,35 +11134,52 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
+$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int8_t" >&5
-$as_echo_n "checking int8_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_in" >&5
+$as_echo_n "checking struct sockaddr_in... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
-int8_t i8 = 0;
+struct sockaddr_in sain;
;
return 0;
@@ -9148,35 +11189,52 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_INT8_T 1" >>confdefs.h
+$as_echo "#define HAVE_STRUCT_SOCKADDR_IN 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int16_t" >&5
-$as_echo_n "checking int16_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_in6" >&5
+$as_echo_n "checking struct sockaddr_in6... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
-int16_t i16 = 0;
+struct sockaddr_in6 sain;
;
return 0;
@@ -9186,35 +11244,55 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_INT16_T 1" >>confdefs.h
+$as_echo "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking int32_t" >&5
-$as_echo_n "checking int32_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_un" >&5
+$as_echo_n "checking struct sockaddr_un... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
-int32_t i32 = 0;
+struct sockaddr_un sain;
;
return 0;
@@ -9224,35 +11302,52 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_INT32_T 1" >>confdefs.h
+$as_echo "#define HAVE_STRUCT_SOCKADDR_UN 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint8_t" >&5
-$as_echo_n "checking uint8_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct addrinfo" >&5
+$as_echo_n "checking struct addrinfo... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
- uint8_t sz;
+struct addrinfo adi;
;
return 0;
@@ -9262,35 +11357,58 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_UINT8_T 1" >>confdefs.h
+$as_echo "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint16_t" >&5
-$as_echo_n "checking uint16_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_storage" >&5
+$as_echo_n "checking struct sockaddr_storage... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
- uint16_t sz;
+struct sockaddr_storage sain;
;
return 0;
@@ -9300,35 +11418,49 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_UINT16_T 1" >>confdefs.h
+$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t" >&5
-$as_echo_n "checking uint32_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IN_ADDR" >&5
+$as_echo_n "checking IN_ADDR... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
#endif
int
main ()
{
- uint32_t sz;
+IN_ADDR addr;
;
return 0;
@@ -9338,868 +11470,1049 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_UINT32_T 1" >>confdefs.h
+$as_echo "#define HAVE_IN_ADDR 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dev_t" >&5
-$as_echo_n "checking dev_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IN6_ADDR" >&5
+$as_echo_n "checking IN6_ADDR... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
int
main ()
{
- dev_t devno;
+IN6_ADDR addr;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_DEV_T 1" >>confdefs.h
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_IN6_ADDR 1" >>confdefs.h
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _dev_t" >&5
-$as_echo_n "checking _dev_t... " >&6; }
+SOCKLIB=''
+NSLLIB=''
+FOUND_SOCKET='no'
+for ac_func in socket
+do :
+ ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
+if test "x$ac_cv_func_socket" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKET 1
+_ACEOF
+
+LIB_SHARED_RES_NET='$(LIB_SHARED_RES_NET)'
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+$as_echo "#define HAVE_SOCKET 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lxnet" >&5
+$as_echo_n "checking for socket in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char socket ();
int
main ()
{
-
- _dev_t devno;
-
+return socket ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE__DEV_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_socket=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_xnet_socket=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_socket" >&5
+$as_echo "$ac_cv_lib_xnet_socket" >&6; }
+if test "x$ac_cv_lib_xnet_socket" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ino_t" >&5
-$as_echo_n "checking ino_t... " >&6; }
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+$as_echo "#define HAVE_SOCKET 1" >>confdefs.h
+
+SOCKLIB='-lxnet'
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char socket ();
int
main ()
{
-
- ino_t devno;
-
+return socket ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_INO_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_socket=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_socket_socket=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _ino_t" >&5
-$as_echo_n "checking _ino_t... " >&6; }
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+$as_echo "#define HAVE_SOCKET 1" >>confdefs.h
+
+SOCKLIB='-lsocket'
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lws2_32" >&5
+$as_echo_n "checking for socket in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char socket ();
int
main ()
{
-
- _ino_t devno;
-
+return socket ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE__INO_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws2_32_socket=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_ws2_32_socket=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_socket" >&5
+$as_echo "$ac_cv_lib_ws2_32_socket" >&6; }
+if test "x$ac_cv_lib_ws2_32_socket" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ino64_t" >&5
-$as_echo_n "checking ino64_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+$as_echo "#define HAVE_SOCKET 1" >>confdefs.h
-#define _LARGEFILE64_SOURCE 1
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+SOCKLIB='-lws2_32'
-int
-main ()
-{
+fi
- ino64_t devno;
- ;
- return 0;
-}
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in setsockopt
+do :
+ ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
+if test "x$ac_cv_func_setsockopt" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SETSOCKOPT 1
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_INO64_T 1" >>confdefs.h
+
+$as_echo "#define HAVE_SETSOCKOPT 1" >>confdefs.h
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mode_t" >&5
-$as_echo_n "checking mode_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lxnet" >&5
+$as_echo_n "checking for setsockopt in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char setsockopt ();
int
main ()
{
-
- mode_t devno;
-
+return setsockopt ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_MODE_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_setsockopt=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_xnet_setsockopt=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_setsockopt" >&5
+$as_echo "$ac_cv_lib_xnet_setsockopt" >&6; }
+if test "x$ac_cv_lib_xnet_setsockopt" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking nlink_t" >&5
-$as_echo_n "checking nlink_t... " >&6; }
+$as_echo "#define HAVE_SETSOCKOPT 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
+$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char setsockopt ();
int
main ()
{
-
- nlink_t devno;
-
+return setsockopt ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_NLINK_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_setsockopt=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_socket_setsockopt=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
+$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
+if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uid_t" >&5
-$as_echo_n "checking uid_t... " >&6; }
+$as_echo "#define HAVE_SETSOCKOPT 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lws2_32" >&5
+$as_echo_n "checking for setsockopt in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char setsockopt ();
int
main ()
{
-
- uid_t devno;
-
+return setsockopt ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_UID_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws2_32_setsockopt=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_ws2_32_setsockopt=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_setsockopt" >&5
+$as_echo "$ac_cv_lib_ws2_32_setsockopt" >&6; }
+if test "x$ac_cv_lib_ws2_32_setsockopt" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gid_t" >&5
-$as_echo_n "checking gid_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+$as_echo "#define HAVE_SETSOCKOPT 1" >>confdefs.h
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-int
-main ()
-{
+fi
- gid_t devno;
- ;
- return 0;
-}
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in getaddrinfo
+do :
+ ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
+if test "x$ac_cv_func_getaddrinfo" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETADDRINFO 1
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_GID_T 1" >>confdefs.h
+
+$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking off_t" >&5
-$as_echo_n "checking off_t... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lxnet" >&5
+$as_echo_n "checking for getaddrinfo in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getaddrinfo ();
int
main ()
{
-
- off_t devno;
-
+return getaddrinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_OFF_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_getaddrinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_xnet_getaddrinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getaddrinfo" >&5
+$as_echo "$ac_cv_lib_xnet_getaddrinfo" >&6; }
+if test "x$ac_cv_lib_xnet_getaddrinfo" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking off64_t" >&5
-$as_echo_n "checking off64_t... " >&6; }
+NSLLIB='-lxnet'
+$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lnsl" >&5
+$as_echo_n "checking for getaddrinfo in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define _LARGEFILE64_SOURCE 1
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getaddrinfo ();
int
main ()
{
-
- off64_t devno;
-
+return getaddrinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_OFF64_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_getaddrinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_nsl_getaddrinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getaddrinfo" >&5
+$as_echo "$ac_cv_lib_nsl_getaddrinfo" >&6; }
+if test "x$ac_cv_lib_nsl_getaddrinfo" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blksize_t" >&5
-$as_echo_n "checking blksize_t... " >&6; }
+NSLLIB='-lnsl'
+$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lsocket" >&5
+$as_echo_n "checking for getaddrinfo in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getaddrinfo ();
int
main ()
{
-
- blksize_t devno;
-
+return getaddrinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_BLKSIZE_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_getaddrinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_socket_getaddrinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getaddrinfo" >&5
+$as_echo "$ac_cv_lib_socket_getaddrinfo" >&6; }
+if test "x$ac_cv_lib_socket_getaddrinfo" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blkcnt_t" >&5
-$as_echo_n "checking blkcnt_t... " >&6; }
+NSLLIB='-lsocket'
+$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lws2_32" >&5
+$as_echo_n "checking for getaddrinfo in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getaddrinfo ();
int
main ()
{
-
- blkcnt_t devno;
-
+return getaddrinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_BLKCNT_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws2_32_getaddrinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_ws2_32_getaddrinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getaddrinfo" >&5
+$as_echo "$ac_cv_lib_ws2_32_getaddrinfo" >&6; }
+if test "x$ac_cv_lib_ws2_32_getaddrinfo" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fpos_t" >&5
-$as_echo_n "checking fpos_t... " >&6; }
+$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in getnameinfo
+do :
+ ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo"
+if test "x$ac_cv_func_getnameinfo" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETNAMEINFO 1
+_ACEOF
+
+$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lxnet" >&5
+$as_echo_n "checking for getnameinfo in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_getnameinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getnameinfo ();
int
main ()
{
-
- fpos_t devno;
-
+return getnameinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_FPOS_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_getnameinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_xnet_getnameinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getnameinfo" >&5
+$as_echo "$ac_cv_lib_xnet_getnameinfo" >&6; }
+if test "x$ac_cv_lib_xnet_getnameinfo" = xyes; then :
+$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking blocksize and blockcount in stat output" >&5
-$as_echo_n "checking blocksize and blockcount in stat output... " >&6; }
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lnsl" >&5
+$as_echo_n "checking for getnameinfo in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_getnameinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define _LARGEFILE64_SOURCE 1
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getnameinfo ();
int
main ()
{
-
-#if HAVE_TYPE_STAT64
- struct stat64 stb;
- stb.st_blksize = 0;
- stb.st_blocks = 0;
-#else
- struct stat stb;
- stb.st_blksize = 0;
- stb.st_blocks = 0;
-#endif
-
+return getnameinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_FILE_BLKSIZECNT 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_getnameinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_nsl_getnameinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getnameinfo" >&5
+$as_echo "$ac_cv_lib_nsl_getnameinfo" >&6; }
+if test "x$ac_cv_lib_nsl_getnameinfo" = xyes; then :
+$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking _fpos_t" >&5
-$as_echo_n "checking _fpos_t... " >&6; }
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lsocket" >&5
+$as_echo_n "checking for getnameinfo in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_getnameinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getnameinfo ();
int
main ()
{
-
- _fpos_t devno;
-
+return getnameinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE__FPOS_T 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_getnameinfo=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_socket_getnameinfo=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getnameinfo" >&5
+$as_echo "$ac_cv_lib_socket_getnameinfo" >&6; }
+if test "x$ac_cv_lib_socket_getnameinfo" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking socklen_t" >&5
-$as_echo_n "checking socklen_t... " >&6; }
+$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lws2_32" >&5
+$as_echo_n "checking for getnameinfo in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_getnameinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char getnameinfo ();
int
main ()
{
-
-socklen_t sz;
-
+return getnameinfo ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws2_32_getnameinfo=yes
+else
+ ac_cv_lib_ws2_32_getnameinfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getnameinfo" >&5
+$as_echo "$ac_cv_lib_ws2_32_getnameinfo" >&6; }
+if test "x$ac_cv_lib_ws2_32_getnameinfo" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
+$as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_in" >&5
-$as_echo_n "checking struct sockaddr_in... " >&6; }
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in gethostbyname
+do :
+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTBYNAME 1
+_ACEOF
+
+$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lxnet" >&5
+$as_echo_n "checking for gethostbyname in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char gethostbyname ();
int
main ()
{
-
-struct sockaddr_in sain;
-
+return gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xnet_gethostbyname=yes
+else
+ ac_cv_lib_xnet_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_gethostbyname" >&5
+$as_echo "$ac_cv_lib_xnet_gethostbyname" >&6; }
+if test "x$ac_cv_lib_xnet_gethostbyname" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_STRUCT_SOCKADDR_IN 1" >>confdefs.h
+$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_in6" >&5
-$as_echo_n "checking struct sockaddr_in6... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char gethostbyname ();
int
main ()
{
-
-struct sockaddr_in6 sain;
-
+return gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
+$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_un" >&5
-$as_echo_n "checking struct sockaddr_un... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5
+$as_echo_n "checking for gethostbyname in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char gethostbyname ();
int
main ()
{
-
-struct sockaddr_un sain;
-
+return gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_gethostbyname=yes
+else
+ ac_cv_lib_socket_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5
+$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; }
+if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_STRUCT_SOCKADDR_UN 1" >>confdefs.h
+$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct addrinfo" >&5
-$as_echo_n "checking struct addrinfo... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lws3_32" >&5
+$as_echo_n "checking for gethostbyname in -lws3_32... " >&6; }
+if ${ac_cv_lib_ws3_32_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws3_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char gethostbyname ();
int
main ()
{
-
-struct addrinfo adi;
-
+return gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ws3_32_gethostbyname=yes
+else
+ ac_cv_lib_ws3_32_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws3_32_gethostbyname" >&5
+$as_echo "$ac_cv_lib_ws3_32_gethostbyname" >&6; }
+if test "x$ac_cv_lib_ws3_32_gethostbyname" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h
+$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h
-else
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_storage" >&5
-$as_echo_n "checking struct sockaddr_storage... " >&6; }
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking htons" >&5
+$as_echo_n "checking htons... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
int
main ()
{
-struct sockaddr_storage sain;
+ unsigned short s;
+ s = htons(5);
;
return 0;
@@ -10207,10 +12520,10 @@ struct sockaddr_storage sain;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+$as_echo "#define HAVE_HTONS 1" >>confdefs.h
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
-
else
@@ -10220,28 +12533,22 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IN_ADDR" >&5
-$as_echo_n "checking IN_ADDR... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ntohs" >&5
+$as_echo_n "checking ntohs... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#if HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -10251,7 +12558,8 @@ int
main ()
{
-IN_ADDR addr;
+ unsigned short s;
+ s = ntohs(5);
;
return 0;
@@ -10259,10 +12567,10 @@ IN_ADDR addr;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+$as_echo "#define HAVE_NTOHS 1" >>confdefs.h
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_IN_ADDR 1" >>confdefs.h
-
else
@@ -10272,28 +12580,22 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IN6_ADDR" >&5
-$as_echo_n "checking IN6_ADDR... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking htonl" >&5
+$as_echo_n "checking htonl... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#if HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -10303,7 +12605,8 @@ int
main ()
{
-IN6_ADDR addr;
+ unsigned long s;
+ s = htonl(5);
;
return 0;
@@ -10311,10 +12614,10 @@ IN6_ADDR addr;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+$as_echo "#define HAVE_HTONL 1" >>confdefs.h
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_IN6_ADDR 1" >>confdefs.h
-
else
@@ -10324,660 +12627,73 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking rand srand" >&5
-$as_echo_n "checking rand srand... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ntohl" >&5
+$as_echo_n "checking ntohl... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <stdlib.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
int
main ()
{
- srand(25);
- printf("%d\n", rand());
- printf("%d\n", RAND_MAX);
+ unsigned long s;
+ s = ntohl(5);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_RAND 1" >>confdefs.h
-
-$as_echo "#define HAVE_SRAND 1" >>confdefs.h
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking initstate setstate random" >&5
-$as_echo_n "checking initstate setstate random... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main ()
-{
-
-char rs[256];
-initstate(25, rs, sizeof(rs));
-setstate(rs);
-printf("%ld\n", random());
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+$as_echo "#define HAVE_NTOHL 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-$as_echo "#define HAVE_INITSTATE 1" >>confdefs.h
-
-$as_echo "#define HAVE_SETSTATE 1" >>confdefs.h
-
-$as_echo "#define HAVE_RANDOM 1" >>confdefs.h
-
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lrand48 nrand48 seed48" >&5
-$as_echo_n "checking lrand48 nrand48 seed48... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-unsigned short sv[3];
-sv[0] = 0;
-sv[1] = 1;
-sv[2] = 2;
-seed48(sv);
-printf("%ld\n", lrand48());
-printf("%ld\n", nrand48(sv));
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_LRAND48 1" >>confdefs.h
-
-$as_echo "#define HAVE_NRAND48 1" >>confdefs.h
-
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
-$as_echo_n "checking size of off_t... " >&6; }
-if ${ac_cv_sizeof_off_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_off_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (off_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off_t=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
-$as_echo "$ac_cv_sizeof_off_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off64_t" >&5
-$as_echo_n "checking size of off64_t... " >&6; }
-if ${ac_cv_sizeof_off64_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off64_t))" "ac_cv_sizeof_off64_t" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_off64_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (off64_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off64_t=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off64_t" >&5
-$as_echo "$ac_cv_sizeof_off64_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
-$as_echo_n "checking size of ino_t... " >&6; }
-if ${ac_cv_sizeof_ino_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_ino_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (ino_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_ino_t=0
- fi
-fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
-$as_echo "$ac_cv_sizeof_ino_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INO_T $ac_cv_sizeof_ino_t
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino64_t" >&5
-$as_echo_n "checking size of ino64_t... " >&6; }
-if ${ac_cv_sizeof_ino64_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino64_t))" "ac_cv_sizeof_ino64_t" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_ino64_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (ino64_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_ino64_t=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino64_t" >&5
-$as_echo "$ac_cv_sizeof_ino64_t" >&6; }
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INO64_T $ac_cv_sizeof_ino64_t
+for ac_func in inet_addr
+do :
+ ac_fn_c_check_func "$LINENO" "inet_addr" "ac_cv_func_inet_addr"
+if test "x$ac_cv_func_inet_addr" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_ADDR 1
_ACEOF
-
-
-
-# Check whether --with-fallback-limits was given.
-if test "${with_fallback_limits+set}" = set; then :
- withval=$with_fallback_limits; $as_echo "#define USE_FALLBACK_NUMERIC_LIMITS 1" >>confdefs.h
-
-fi
-
-
-
-# Check whether --with-printf-scanf was given.
-if test "${with_printf_scanf+set}" = set; then :
- withval=$with_printf_scanf; CAN_USE_PRINTF_SCANF="$withval"
-fi
-
-
-if [ "X$CAN_USE_PRINTF_SCANF" != "Xno" ]
-then
- $as_echo "#define USE_PRINTF_SCANF 1" >>confdefs.h
-
-fi
-
-$as_echo "#define HAVE_FILE_DEVINO 1" >>confdefs.h
-
-$as_echo "#define HAVE_FILE_UIDGID 1" >>confdefs.h
-
-$as_echo "#define HAVE_FILE_ATIMECTIME 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_COMPATDKTOOLS3 1" >>confdefs.h
-
-
-SEP=`cat sep.txt`
-for i in test*.ctr
-do
-j=`echo $i | sed -e 's/\.ctr//g'`
-if [ "X$TESTPROGRAMS" = "X" ]
-then
- TESTPROGRAMS="$j"
-else
- TESTPROGRAMS="${TESTPROGRAMS} ${SEP}$j"
-fi
-done
-
-if [ "X$SUITE" = "Xgui" ]
-then
- $as_echo "#define HAVE_WXWIDGETS 1" >>confdefs.h
-
-else
- WXCPPFLAGS=''
- WXCXXFLAGS=''
- WXCFLAGS=''
- WXLDFLAGS=''
-fi
-
-WXMAJOR=''
-WXMINOR=''
-
-if [ "X$WXVERSION" != "X" ]
-then
- WXMAJOR=`echo $WXVERSION | cut -f 1 -d .`
- WXMINOR=`echo $WXVERSION | cut -f 2 -d .`
-fi
-[ "X$WXMAJOR" != "X" ] || WXMAJOR="0"
-
-if [ "$WXMAJOR" -ge 3 ]
-then
-$as_echo "#define HAVE_WX_CHARTYPE_H 1" >>confdefs.h
-
-elif [ "$WXMAJOR" -ge 2 ]
-then
-$as_echo "#define HAVE_WX_WXCHAR_H 1" >>confdefs.h
-
-fi
-
-LIBPNG=''
-LIBJPEG=''
-LIBTIFF=''
-ANYDB=''
-SNMPPROG=''
-MYSQLPROG=''
-PTHREADLIB=''
-LIBDK3WXOBJ=''
-LIBDK4WXOBJ=''
-LIBDK4WXTOBUILD=''
-DBLIB=''
-DBLIBSOCK=''
-NETSNMP_LIBS=''
-NETSNMP_CFLAGS=''
-NETSNMP_LIBS=`net-snmp-config --libs`
-NETSNMP_CFLAGS=`net-snmp-config --cflags`
-ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdio_h" = xyes; then :
- $as_echo "#define HAVE_STDIO_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "conio.h" "ac_cv_header_conio_h" "$ac_includes_default"
-if test "x$ac_cv_header_conio_h" = xyes; then :
- $as_echo "#define HAVE_CONIO_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default"
-if test "x$ac_cv_header_grp_h" = xyes; then :
- $as_echo "#define HAVE_GRP_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "gdbm.h" "ac_cv_header_gdbm_h" "$ac_includes_default"
-if test "x$ac_cv_header_gdbm_h" = xyes; then :
- FOUND_GDBM='yes'
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "ndbm.h" "ac_cv_header_ndbm_h" "$ac_includes_default"
-if test "x$ac_cv_header_ndbm_h" = xyes; then :
- FOUND_NDBM='yes'
-fi
-
-
-case "X${FOUND_NDBM}${USE_NDBM}${FOUND_GDBM}" in
- "Xyesyesyes")
- $as_echo "#define HAVE_NDBM_H 1" >>confdefs.h
-
- ANYDB='ndbm'
- ;;
- "Xyesyesno")
- $as_echo "#define HAVE_NDBM_H 1" >>confdefs.h
-
- ANYDB='ndbm'
- ;;
- "Xyesautono")
- $as_echo "#define HAVE_NDBM_H 1" >>confdefs.h
-
- ANYDB='ndbm'
- ;;
-esac
-if [ "X$ANYDB" != "Xndbm" -a "X$FOUND_GDBM" = "Xyes" ]
-then
- $as_echo "#define HAVE_GDBM_H 1" >>confdefs.h
-
-fi
-ac_fn_c_check_header_mongrel "$LINENO" "db.h" "ac_cv_header_db_h" "$ac_includes_default"
-if test "x$ac_cv_header_db_h" = xyes; then :
- FOUND_BDB='yes';ANYDB='db';DBLIB="-ldb";$as_echo "#define HAVE_DB_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "dir.h" "ac_cv_header_dir_h" "$ac_includes_default"
-if test "x$ac_cv_header_dir_h" = xyes; then :
- $as_echo "#define HAVE_DIR_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "err.h" "ac_cv_header_err_h" "$ac_includes_default"
-if test "x$ac_cv_header_err_h" = xyes; then :
- $as_echo "#define HAVE_ERR_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default"
-if test "x$ac_cv_header_shadow_h" = xyes; then :
- $as_echo "#define HAVE_SHADOW_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$ac_includes_default"
-if test "x$ac_cv_header_stropts_h" = xyes; then :
- $as_echo "#define HAVE_STROPTS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
-if test "x$ac_cv_header_syslog_h" = xyes; then :
- $as_echo "#define HAVE_SYSLOG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sysres.h" "ac_cv_header_sysres_h" "$ac_includes_default"
-if test "x$ac_cv_header_sysres_h" = xyes; then :
- $as_echo "#define HAVE_SYSRES_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default"
-if test "x$ac_cv_header_termios_h" = xyes; then :
- $as_echo "#define HAVE_TERMIOS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "vararg.h" "ac_cv_header_vararg_h" "$ac_includes_default"
-if test "x$ac_cv_header_vararg_h" = xyes; then :
- $as_echo "#define HAVE_VARARG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "varargs.h" "ac_cv_header_varargs_h" "$ac_includes_default"
-if test "x$ac_cv_header_varargs_h" = xyes; then :
- $as_echo "#define HAVE_VARARGS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "ntifs.h" "ac_cv_header_ntifs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ntifs_h" = xyes; then :
- $as_echo "#define HAVE_NTIFS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_file_h" = xyes; then :
- $as_echo "#define HAVE_SYS_FILE_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_resource_h" = xyes; then :
- $as_echo "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_statvfs_h" = xyes; then :
- $as_echo "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/stropts.h" "ac_cv_header_sys_stropts_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_stropts_h" = xyes; then :
- $as_echo "#define HAVE_SYS_STROPTS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/sunddi.h" "ac_cv_header_sys_sunddi_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sunddi_h" = xyes; then :
- $as_echo "#define HAVE_SYS_SUNDDI_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
- $as_echo "#define HAVE_SYS_SYSCTL_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/systeminfo.h" "ac_cv_header_sys_systeminfo_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_systeminfo_h" = xyes; then :
- $as_echo "#define HAVE_SYS_SYSTEMINFO_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/termios.h" "ac_cv_header_sys_termios_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_termios_h" = xyes; then :
- $as_echo "#define HAVE_SYS_TERMIOS_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/ttold.h" "ac_cv_header_sys_ttold_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_ttold_h" = xyes; then :
- $as_echo "#define HAVE_SYS_TTOLD_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_uio_h" = xyes; then :
- $as_echo "#define HAVE_SYS_UIO_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_wait_h" = xyes; then :
- $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
-
-fi
-
-
-
-ac_fn_c_check_header_compile "$LINENO" "winbase.h" "ac_cv_header_winbase_h" "
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-"
-if test "x$ac_cv_header_winbase_h" = xyes; then :
- $as_echo "#define HAVE_WINBASE_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_compile "$LINENO" "winreg.h" "ac_cv_header_winreg_h" "
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-#if HAVE_WINBASE_H
-#include <winbase.h>
-#endif
-
-"
-if test "x$ac_cv_header_winreg_h" = xyes; then :
- $as_echo "#define HAVE_WINREG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_compile "$LINENO" "wincon.h" "ac_cv_header_wincon_h" "
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-#if HAVE_WINBASE_H
-#include <winbase.h>
-#endif
-
-"
-if test "x$ac_cv_header_wincon_h" = xyes; then :
- $as_echo "#define HAVE_WINCON_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
-if test "x$ac_cv_header_png_h" = xyes; then :
- LIBPNG="-lpng";$as_echo "#define HAVE_PNG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
-if test "x$ac_cv_header_jpeglib_h" = xyes; then :
- LIBJPEG="-ljpeg";$as_echo "#define HAVE_JPEGLIB_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "tiff.h" "ac_cv_header_tiff_h" "$ac_includes_default"
-if test "x$ac_cv_header_tiff_h" = xyes; then :
- LIBTIFF="-ltiff";$as_echo "#define HAVE_TIFF_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default"
-if test "x$ac_cv_header_mysql_mysql_h" = xyes; then :
-
-MYSQLPROG='mysqlprog'
-MYSQLLIB='-lmysqlclient'
-$as_echo "#define HAVE_MYSQL_MYSQL_H 1" >>confdefs.h
+$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
else
-ac_fn_c_check_header_mongrel "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default"
-if test "x$ac_cv_header_mysql_h" = xyes; then :
-
-MYSQLPROG='mysqlprog'
-MYSQLLIB='-lmysqlclient'
-$as_echo "#define HAVE_MYSQL_H 1" >>confdefs.h
-
-
-
-fi
-
-
-
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "lprng.h" "ac_cv_header_lprng_h" "$ac_includes_default"
-if test "x$ac_cv_header_lprng_h" = xyes; then :
- $as_echo "#define HAVE_LPRNG_H 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
-if test "x$ac_cv_header_pthread_h" = xyes; then :
- PTHREADLIB='-lpthread';$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosh in -lm" >&5
-$as_echo_n "checking for acosh in -lm... " >&6; }
-if ${ac_cv_lib_m_acosh+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lxnet" >&5
+$as_echo_n "checking for inet_addr in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_inet_addr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -10987,38 +12703,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char acosh ();
+char inet_addr ();
int
main ()
{
-return acosh ();
+return inet_addr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_acosh=yes
+ ac_cv_lib_xnet_inet_addr=yes
else
- ac_cv_lib_m_acosh=no
+ ac_cv_lib_xnet_inet_addr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosh" >&5
-$as_echo "$ac_cv_lib_m_acosh" >&6; }
-if test "x$ac_cv_lib_m_acosh" = xyes; then :
- $as_echo "#define HAVE_ACOSH 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_addr" >&5
+$as_echo "$ac_cv_lib_xnet_inet_addr" >&6; }
+if test "x$ac_cv_lib_xnet_inet_addr" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acoshl in -lm" >&5
-$as_echo_n "checking for acoshl in -lm... " >&6; }
-if ${ac_cv_lib_m_acoshl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lnsl" >&5
+$as_echo_n "checking for inet_addr in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_addr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11028,38 +12746,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char acoshl ();
+char inet_addr ();
int
main ()
{
-return acoshl ();
+return inet_addr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_acoshl=yes
+ ac_cv_lib_nsl_inet_addr=yes
else
- ac_cv_lib_m_acoshl=no
+ ac_cv_lib_nsl_inet_addr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acoshl" >&5
-$as_echo "$ac_cv_lib_m_acoshl" >&6; }
-if test "x$ac_cv_lib_m_acoshl" = xyes; then :
- $as_echo "#define HAVE_ACOSHL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_addr" >&5
+$as_echo "$ac_cv_lib_nsl_inet_addr" >&6; }
+if test "x$ac_cv_lib_nsl_inet_addr" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosl in -lm" >&5
-$as_echo_n "checking for acosl in -lm... " >&6; }
-if ${ac_cv_lib_m_acosl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lsocket" >&5
+$as_echo_n "checking for inet_addr in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_inet_addr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11069,38 +12789,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char acosl ();
+char inet_addr ();
int
main ()
{
-return acosl ();
+return inet_addr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_acosl=yes
+ ac_cv_lib_socket_inet_addr=yes
else
- ac_cv_lib_m_acosl=no
+ ac_cv_lib_socket_inet_addr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acosl" >&5
-$as_echo "$ac_cv_lib_m_acosl" >&6; }
-if test "x$ac_cv_lib_m_acosl" = xyes; then :
- $as_echo "#define HAVE_ACOSL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_addr" >&5
+$as_echo "$ac_cv_lib_socket_inet_addr" >&6; }
+if test "x$ac_cv_lib_socket_inet_addr" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinh in -lm" >&5
-$as_echo_n "checking for asinh in -lm... " >&6; }
-if ${ac_cv_lib_m_asinh+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lws2_32" >&5
+$as_echo_n "checking for inet_addr in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_inet_addr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11110,79 +12832,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char asinh ();
+char inet_addr ();
int
main ()
{
-return asinh ();
+return inet_addr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_asinh=yes
+ ac_cv_lib_ws2_32_inet_addr=yes
else
- ac_cv_lib_m_asinh=no
+ ac_cv_lib_ws2_32_inet_addr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinh" >&5
-$as_echo "$ac_cv_lib_m_asinh" >&6; }
-if test "x$ac_cv_lib_m_asinh" = xyes; then :
- $as_echo "#define HAVE_ASINH 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_addr" >&5
+$as_echo "$ac_cv_lib_ws2_32_inet_addr" >&6; }
+if test "x$ac_cv_lib_ws2_32_inet_addr" = xyes; then :
+
+$as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinhl in -lm" >&5
-$as_echo_n "checking for asinhl in -lm... " >&6; }
-if ${ac_cv_lib_m_asinhl+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char asinhl ();
-int
-main ()
-{
-return asinhl ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_asinhl=yes
-else
- ac_cv_lib_m_asinhl=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinhl" >&5
-$as_echo "$ac_cv_lib_m_asinhl" >&6; }
-if test "x$ac_cv_lib_m_asinhl" = xyes; then :
- $as_echo "#define HAVE_ASINHL 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinl in -lm" >&5
-$as_echo_n "checking for asinl in -lm... " >&6; }
-if ${ac_cv_lib_m_asinl+:} false; then :
+
+fi
+done
+
+
+for ac_func in inet_aton
+do :
+ ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
+if test "x$ac_cv_func_inet_aton" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_ATON 1
+_ACEOF
+
+$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lxnet" >&5
+$as_echo_n "checking for inet_aton in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11192,38 +12902,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char asinl ();
+char inet_aton ();
int
main ()
{
-return asinl ();
+return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_asinl=yes
+ ac_cv_lib_xnet_inet_aton=yes
else
- ac_cv_lib_m_asinl=no
+ ac_cv_lib_xnet_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_asinl" >&5
-$as_echo "$ac_cv_lib_m_asinl" >&6; }
-if test "x$ac_cv_lib_m_asinl" = xyes; then :
- $as_echo "#define HAVE_ASINL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_aton" >&5
+$as_echo "$ac_cv_lib_xnet_inet_aton" >&6; }
+if test "x$ac_cv_lib_xnet_inet_aton" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2 in -lm" >&5
-$as_echo_n "checking for atan2 in -lm... " >&6; }
-if ${ac_cv_lib_m_atan2+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lnsl" >&5
+$as_echo_n "checking for inet_aton in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11233,38 +12945,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char atan2 ();
+char inet_aton ();
int
main ()
{
-return atan2 ();
+return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atan2=yes
+ ac_cv_lib_nsl_inet_aton=yes
else
- ac_cv_lib_m_atan2=no
+ ac_cv_lib_nsl_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2" >&5
-$as_echo "$ac_cv_lib_m_atan2" >&6; }
-if test "x$ac_cv_lib_m_atan2" = xyes; then :
- $as_echo "#define HAVE_ATAN2 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_aton" >&5
+$as_echo "$ac_cv_lib_nsl_inet_aton" >&6; }
+if test "x$ac_cv_lib_nsl_inet_aton" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2l in -lm" >&5
-$as_echo_n "checking for atan2l in -lm... " >&6; }
-if ${ac_cv_lib_m_atan2l+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lsocket" >&5
+$as_echo_n "checking for inet_aton in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11274,38 +12988,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char atan2l ();
+char inet_aton ();
int
main ()
{
-return atan2l ();
+return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atan2l=yes
+ ac_cv_lib_socket_inet_aton=yes
else
- ac_cv_lib_m_atan2l=no
+ ac_cv_lib_socket_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan2l" >&5
-$as_echo "$ac_cv_lib_m_atan2l" >&6; }
-if test "x$ac_cv_lib_m_atan2l" = xyes; then :
- $as_echo "#define HAVE_ATAN2L 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_aton" >&5
+$as_echo "$ac_cv_lib_socket_inet_aton" >&6; }
+if test "x$ac_cv_lib_socket_inet_aton" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanh in -lm" >&5
-$as_echo_n "checking for atanh in -lm... " >&6; }
-if ${ac_cv_lib_m_atanh+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lws2_32" >&5
+$as_echo_n "checking for inet_aton in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11315,79 +13031,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char atanh ();
+char inet_aton ();
int
main ()
{
-return atanh ();
+return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atanh=yes
+ ac_cv_lib_ws2_32_inet_aton=yes
else
- ac_cv_lib_m_atanh=no
+ ac_cv_lib_ws2_32_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanh" >&5
-$as_echo "$ac_cv_lib_m_atanh" >&6; }
-if test "x$ac_cv_lib_m_atanh" = xyes; then :
- $as_echo "#define HAVE_ATANH 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_aton" >&5
+$as_echo "$ac_cv_lib_ws2_32_inet_aton" >&6; }
+if test "x$ac_cv_lib_ws2_32_inet_aton" = xyes; then :
+
+$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanhl in -lm" >&5
-$as_echo_n "checking for atanhl in -lm... " >&6; }
-if ${ac_cv_lib_m_atanhl+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char atanhl ();
-int
-main ()
-{
-return atanhl ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atanhl=yes
-else
- ac_cv_lib_m_atanhl=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanhl" >&5
-$as_echo "$ac_cv_lib_m_atanhl" >&6; }
-if test "x$ac_cv_lib_m_atanhl" = xyes; then :
- $as_echo "#define HAVE_ATANHL 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanl in -lm" >&5
-$as_echo_n "checking for atanl in -lm... " >&6; }
-if ${ac_cv_lib_m_atanl+:} false; then :
+
+fi
+done
+
+
+for ac_func in inet_pton
+do :
+ ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
+if test "x$ac_cv_func_inet_pton" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_PTON 1
+_ACEOF
+
+$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lxnet" >&5
+$as_echo_n "checking for inet_pton in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_inet_pton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11397,38 +13101,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char atanl ();
+char inet_pton ();
int
main ()
{
-return atanl ();
+return inet_pton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_atanl=yes
+ ac_cv_lib_xnet_inet_pton=yes
else
- ac_cv_lib_m_atanl=no
+ ac_cv_lib_xnet_inet_pton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atanl" >&5
-$as_echo "$ac_cv_lib_m_atanl" >&6; }
-if test "x$ac_cv_lib_m_atanl" = xyes; then :
- $as_echo "#define HAVE_ATANL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_pton" >&5
+$as_echo "$ac_cv_lib_xnet_inet_pton" >&6; }
+if test "x$ac_cv_lib_xnet_inet_pton" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5
-$as_echo_n "checking for ceil in -lm... " >&6; }
-if ${ac_cv_lib_m_ceil+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lnsl" >&5
+$as_echo_n "checking for inet_pton in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_pton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11438,38 +13144,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char ceil ();
+char inet_pton ();
int
main ()
{
-return ceil ();
+return inet_pton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_ceil=yes
+ ac_cv_lib_nsl_inet_pton=yes
else
- ac_cv_lib_m_ceil=no
+ ac_cv_lib_nsl_inet_pton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceil" >&5
-$as_echo "$ac_cv_lib_m_ceil" >&6; }
-if test "x$ac_cv_lib_m_ceil" = xyes; then :
- $as_echo "#define HAVE_CEIL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_pton" >&5
+$as_echo "$ac_cv_lib_nsl_inet_pton" >&6; }
+if test "x$ac_cv_lib_nsl_inet_pton" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceill in -lm" >&5
-$as_echo_n "checking for ceill in -lm... " >&6; }
-if ${ac_cv_lib_m_ceill+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lsocket" >&5
+$as_echo_n "checking for inet_pton in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_inet_pton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11479,38 +13187,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char ceill ();
+char inet_pton ();
int
main ()
{
-return ceill ();
+return inet_pton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_ceill=yes
+ ac_cv_lib_socket_inet_pton=yes
else
- ac_cv_lib_m_ceill=no
+ ac_cv_lib_socket_inet_pton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceill" >&5
-$as_echo "$ac_cv_lib_m_ceill" >&6; }
-if test "x$ac_cv_lib_m_ceill" = xyes; then :
- $as_echo "#define HAVE_CEILL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_pton" >&5
+$as_echo "$ac_cv_lib_socket_inet_pton" >&6; }
+if test "x$ac_cv_lib_socket_inet_pton" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for coshl in -lm" >&5
-$as_echo_n "checking for coshl in -lm... " >&6; }
-if ${ac_cv_lib_m_coshl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lws2_32" >&5
+$as_echo_n "checking for inet_pton in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_inet_pton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11520,79 +13230,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char coshl ();
+char inet_pton ();
int
main ()
{
-return coshl ();
+return inet_pton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_coshl=yes
+ ac_cv_lib_ws2_32_inet_pton=yes
else
- ac_cv_lib_m_coshl=no
+ ac_cv_lib_ws2_32_inet_pton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_coshl" >&5
-$as_echo "$ac_cv_lib_m_coshl" >&6; }
-if test "x$ac_cv_lib_m_coshl" = xyes; then :
- $as_echo "#define HAVE_COSHL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_pton" >&5
+$as_echo "$ac_cv_lib_ws2_32_inet_pton" >&6; }
+if test "x$ac_cv_lib_ws2_32_inet_pton" = xyes; then :
+
+$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosl in -lm" >&5
-$as_echo_n "checking for cosl in -lm... " >&6; }
-if ${ac_cv_lib_m_cosl+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char cosl ();
-int
-main ()
-{
-return cosl ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_cosl=yes
-else
- ac_cv_lib_m_cosl=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cosl" >&5
-$as_echo "$ac_cv_lib_m_cosl" >&6; }
-if test "x$ac_cv_lib_m_cosl" = xyes; then :
- $as_echo "#define HAVE_COSL 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for expl in -lm" >&5
-$as_echo_n "checking for expl in -lm... " >&6; }
-if ${ac_cv_lib_m_expl+:} false; then :
+
+fi
+done
+
+
+for ac_func in inet_ntop
+do :
+ ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
+if test "x$ac_cv_func_inet_ntop" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_NTOP 1
+_ACEOF
+
+$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lxnet" >&5
+$as_echo_n "checking for inet_ntop in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_inet_ntop+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11602,38 +13300,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char expl ();
+char inet_ntop ();
int
main ()
{
-return expl ();
+return inet_ntop ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_expl=yes
+ ac_cv_lib_xnet_inet_ntop=yes
else
- ac_cv_lib_m_expl=no
+ ac_cv_lib_xnet_inet_ntop=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_expl" >&5
-$as_echo "$ac_cv_lib_m_expl" >&6; }
-if test "x$ac_cv_lib_m_expl" = xyes; then :
- $as_echo "#define HAVE_EXPL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_inet_ntop" >&5
+$as_echo "$ac_cv_lib_xnet_inet_ntop" >&6; }
+if test "x$ac_cv_lib_xnet_inet_ntop" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabs in -lm" >&5
-$as_echo_n "checking for fabs in -lm... " >&6; }
-if ${ac_cv_lib_m_fabs+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lnsl" >&5
+$as_echo_n "checking for inet_ntop in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_ntop+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11643,38 +13343,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char fabs ();
+char inet_ntop ();
int
main ()
{
-return fabs ();
+return inet_ntop ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_fabs=yes
+ ac_cv_lib_nsl_inet_ntop=yes
else
- ac_cv_lib_m_fabs=no
+ ac_cv_lib_nsl_inet_ntop=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabs" >&5
-$as_echo "$ac_cv_lib_m_fabs" >&6; }
-if test "x$ac_cv_lib_m_fabs" = xyes; then :
- $as_echo "#define HAVE_FABS 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntop" >&5
+$as_echo "$ac_cv_lib_nsl_inet_ntop" >&6; }
+if test "x$ac_cv_lib_nsl_inet_ntop" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsl in -lm" >&5
-$as_echo_n "checking for fabsl in -lm... " >&6; }
-if ${ac_cv_lib_m_fabsl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lsocket" >&5
+$as_echo_n "checking for inet_ntop in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_inet_ntop+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11684,38 +13386,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char fabsl ();
+char inet_ntop ();
int
main ()
{
-return fabsl ();
+return inet_ntop ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_fabsl=yes
+ ac_cv_lib_socket_inet_ntop=yes
else
- ac_cv_lib_m_fabsl=no
+ ac_cv_lib_socket_inet_ntop=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabsl" >&5
-$as_echo "$ac_cv_lib_m_fabsl" >&6; }
-if test "x$ac_cv_lib_m_fabsl" = xyes; then :
- $as_echo "#define HAVE_FABSL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_inet_ntop" >&5
+$as_echo "$ac_cv_lib_socket_inet_ntop" >&6; }
+if test "x$ac_cv_lib_socket_inet_ntop" = xyes; then :
-fi
+$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5
-$as_echo_n "checking for floor in -lm... " >&6; }
-if ${ac_cv_lib_m_floor+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lws2_32" >&5
+$as_echo_n "checking for inet_ntop in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_inet_ntop+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11725,38 +13429,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char floor ();
+char inet_ntop ();
int
main ()
{
-return floor ();
+return inet_ntop ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_floor=yes
+ ac_cv_lib_ws2_32_inet_ntop=yes
else
- ac_cv_lib_m_floor=no
+ ac_cv_lib_ws2_32_inet_ntop=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5
-$as_echo "$ac_cv_lib_m_floor" >&6; }
-if test "x$ac_cv_lib_m_floor" = xyes; then :
- $as_echo "#define HAVE_FLOOR 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_inet_ntop" >&5
+$as_echo "$ac_cv_lib_ws2_32_inet_ntop" >&6; }
+if test "x$ac_cv_lib_ws2_32_inet_ntop" = xyes; then :
+
+$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floorl in -lm" >&5
-$as_echo_n "checking for floorl in -lm... " >&6; }
-if ${ac_cv_lib_m_floorl+:} false; then :
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in getpeername
+do :
+ ac_fn_c_check_func "$LINENO" "getpeername" "ac_cv_func_getpeername"
+if test "x$ac_cv_func_getpeername" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETPEERNAME 1
+_ACEOF
+
+$as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lxnet" >&5
+$as_echo_n "checking for getpeername in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_getpeername+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11766,38 +13499,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char floorl ();
+char getpeername ();
int
main ()
{
-return floorl ();
+return getpeername ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_floorl=yes
+ ac_cv_lib_xnet_getpeername=yes
else
- ac_cv_lib_m_floorl=no
+ ac_cv_lib_xnet_getpeername=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floorl" >&5
-$as_echo "$ac_cv_lib_m_floorl" >&6; }
-if test "x$ac_cv_lib_m_floorl" = xyes; then :
- $as_echo "#define HAVE_FLOORL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getpeername" >&5
+$as_echo "$ac_cv_lib_xnet_getpeername" >&6; }
+if test "x$ac_cv_lib_xnet_getpeername" = xyes; then :
-fi
+$as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for labs in -lm" >&5
-$as_echo_n "checking for labs in -lm... " >&6; }
-if ${ac_cv_lib_m_labs+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lnsl" >&5
+$as_echo_n "checking for getpeername in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_getpeername+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11807,38 +13542,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char labs ();
+char getpeername ();
int
main ()
{
-return labs ();
+return getpeername ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_labs=yes
+ ac_cv_lib_nsl_getpeername=yes
else
- ac_cv_lib_m_labs=no
+ ac_cv_lib_nsl_getpeername=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_labs" >&5
-$as_echo "$ac_cv_lib_m_labs" >&6; }
-if test "x$ac_cv_lib_m_labs" = xyes; then :
- $as_echo "#define HAVE_LABS 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getpeername" >&5
+$as_echo "$ac_cv_lib_nsl_getpeername" >&6; }
+if test "x$ac_cv_lib_nsl_getpeername" = xyes; then :
-fi
+$as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for logl in -lm" >&5
-$as_echo_n "checking for logl in -lm... " >&6; }
-if ${ac_cv_lib_m_logl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lsocket" >&5
+$as_echo_n "checking for getpeername in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_getpeername+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11848,38 +13585,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char logl ();
+char getpeername ();
int
main ()
{
-return logl ();
+return getpeername ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_logl=yes
+ ac_cv_lib_socket_getpeername=yes
else
- ac_cv_lib_m_logl=no
+ ac_cv_lib_socket_getpeername=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_logl" >&5
-$as_echo "$ac_cv_lib_m_logl" >&6; }
-if test "x$ac_cv_lib_m_logl" = xyes; then :
- $as_echo "#define HAVE_LOGL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getpeername" >&5
+$as_echo "$ac_cv_lib_socket_getpeername" >&6; }
+if test "x$ac_cv_lib_socket_getpeername" = xyes; then :
-fi
+$as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rint in -lm" >&5
-$as_echo_n "checking for rint in -lm... " >&6; }
-if ${ac_cv_lib_m_rint+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lws2_32" >&5
+$as_echo_n "checking for getpeername in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_getpeername+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11889,38 +13628,65 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char rint ();
+char getpeername ();
int
main ()
{
-return rint ();
+return getpeername ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_rint=yes
+ ac_cv_lib_ws2_32_getpeername=yes
else
- ac_cv_lib_m_rint=no
+ ac_cv_lib_ws2_32_getpeername=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_rint" >&5
-$as_echo "$ac_cv_lib_m_rint" >&6; }
-if test "x$ac_cv_lib_m_rint" = xyes; then :
- $as_echo "#define HAVE_RINT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getpeername" >&5
+$as_echo "$ac_cv_lib_ws2_32_getpeername" >&6; }
+if test "x$ac_cv_lib_ws2_32_getpeername" = xyes; then :
+ $as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rintl in -lm" >&5
-$as_echo_n "checking for rintl in -lm... " >&6; }
-if ${ac_cv_lib_m_rintl+:} false; then :
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in getsockname
+do :
+ ac_fn_c_check_func "$LINENO" "getsockname" "ac_cv_func_getsockname"
+if test "x$ac_cv_func_getsockname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETSOCKNAME 1
+_ACEOF
+
+$as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lxnet" >&5
+$as_echo_n "checking for getsockname in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_getsockname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11930,38 +13696,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char rintl ();
+char getsockname ();
int
main ()
{
-return rintl ();
+return getsockname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_rintl=yes
+ ac_cv_lib_xnet_getsockname=yes
else
- ac_cv_lib_m_rintl=no
+ ac_cv_lib_xnet_getsockname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_rintl" >&5
-$as_echo "$ac_cv_lib_m_rintl" >&6; }
-if test "x$ac_cv_lib_m_rintl" = xyes; then :
- $as_echo "#define HAVE_RINTL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getsockname" >&5
+$as_echo "$ac_cv_lib_xnet_getsockname" >&6; }
+if test "x$ac_cv_lib_xnet_getsockname" = xyes; then :
-fi
+$as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinhl in -lm" >&5
-$as_echo_n "checking for sinhl in -lm... " >&6; }
-if ${ac_cv_lib_m_sinhl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lnsl" >&5
+$as_echo_n "checking for getsockname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_getsockname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11971,38 +13739,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sinhl ();
+char getsockname ();
int
main ()
{
-return sinhl ();
+return getsockname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sinhl=yes
+ ac_cv_lib_nsl_getsockname=yes
else
- ac_cv_lib_m_sinhl=no
+ ac_cv_lib_nsl_getsockname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinhl" >&5
-$as_echo "$ac_cv_lib_m_sinhl" >&6; }
-if test "x$ac_cv_lib_m_sinhl" = xyes; then :
- $as_echo "#define HAVE_SINHL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getsockname" >&5
+$as_echo "$ac_cv_lib_nsl_getsockname" >&6; }
+if test "x$ac_cv_lib_nsl_getsockname" = xyes; then :
-fi
+$as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
-$as_echo_n "checking for sqrt in -lm... " >&6; }
-if ${ac_cv_lib_m_sqrt+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lsocket" >&5
+$as_echo_n "checking for getsockname in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_getsockname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12012,38 +13782,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sqrt ();
+char getsockname ();
int
main ()
{
-return sqrt ();
+return getsockname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sqrt=yes
+ ac_cv_lib_socket_getsockname=yes
else
- ac_cv_lib_m_sqrt=no
+ ac_cv_lib_socket_getsockname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
-$as_echo "$ac_cv_lib_m_sqrt" >&6; }
-if test "x$ac_cv_lib_m_sqrt" = xyes; then :
- $as_echo "#define HAVE_SQRT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getsockname" >&5
+$as_echo "$ac_cv_lib_socket_getsockname" >&6; }
+if test "x$ac_cv_lib_socket_getsockname" = xyes; then :
-fi
+$as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtl in -lm" >&5
-$as_echo_n "checking for sqrtl in -lm... " >&6; }
-if ${ac_cv_lib_m_sqrtl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lws2_32" >&5
+$as_echo_n "checking for getsockname in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_getsockname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12053,38 +13825,65 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sqrtl ();
+char getsockname ();
int
main ()
{
-return sqrtl ();
+return getsockname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sqrtl=yes
+ ac_cv_lib_ws2_32_getsockname=yes
else
- ac_cv_lib_m_sqrtl=no
+ ac_cv_lib_ws2_32_getsockname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrtl" >&5
-$as_echo "$ac_cv_lib_m_sqrtl" >&6; }
-if test "x$ac_cv_lib_m_sqrtl" = xyes; then :
- $as_echo "#define HAVE_SQRTL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_getsockname" >&5
+$as_echo "$ac_cv_lib_ws2_32_getsockname" >&6; }
+if test "x$ac_cv_lib_ws2_32_getsockname" = xyes; then :
+ $as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinl in -lm" >&5
-$as_echo_n "checking for sinl in -lm... " >&6; }
-if ${ac_cv_lib_m_sinl+:} false; then :
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+done
+
+
+for ac_func in select
+do :
+ ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select"
+if test "x$ac_cv_func_select" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SELECT 1
+_ACEOF
+
+$as_echo "#define HAVE_SELECT 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in -lxnet" >&5
+$as_echo_n "checking for select in -lxnet... " >&6; }
+if ${ac_cv_lib_xnet_select+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lxnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12094,38 +13893,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sinl ();
+char select ();
int
main ()
{
-return sinl ();
+return select ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sinl=yes
+ ac_cv_lib_xnet_select=yes
else
- ac_cv_lib_m_sinl=no
+ ac_cv_lib_xnet_select=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sinl" >&5
-$as_echo "$ac_cv_lib_m_sinl" >&6; }
-if test "x$ac_cv_lib_m_sinl" = xyes; then :
- $as_echo "#define HAVE_SINL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_select" >&5
+$as_echo "$ac_cv_lib_xnet_select" >&6; }
+if test "x$ac_cv_lib_xnet_select" = xyes; then :
-fi
+$as_echo "#define HAVE_SELECT 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanhl in -lm" >&5
-$as_echo_n "checking for tanhl in -lm... " >&6; }
-if ${ac_cv_lib_m_tanhl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in -lnsl" >&5
+$as_echo_n "checking for select in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_select+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12135,38 +13936,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char tanhl ();
+char select ();
int
main ()
{
-return tanhl ();
+return select ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_tanhl=yes
+ ac_cv_lib_nsl_select=yes
else
- ac_cv_lib_m_tanhl=no
+ ac_cv_lib_nsl_select=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanhl" >&5
-$as_echo "$ac_cv_lib_m_tanhl" >&6; }
-if test "x$ac_cv_lib_m_tanhl" = xyes; then :
- $as_echo "#define HAVE_TANHL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_select" >&5
+$as_echo "$ac_cv_lib_nsl_select" >&6; }
+if test "x$ac_cv_lib_nsl_select" = xyes; then :
-fi
+$as_echo "#define HAVE_SELECT 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanl in -lm" >&5
-$as_echo_n "checking for tanl in -lm... " >&6; }
-if ${ac_cv_lib_m_tanl+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in -lsocket" >&5
+$as_echo_n "checking for select in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_select+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12176,38 +13979,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char tanl ();
+char select ();
int
main ()
{
-return tanl ();
+return select ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_tanl=yes
+ ac_cv_lib_socket_select=yes
else
- ac_cv_lib_m_tanl=no
+ ac_cv_lib_socket_select=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_tanl" >&5
-$as_echo "$ac_cv_lib_m_tanl" >&6; }
-if test "x$ac_cv_lib_m_tanl" = xyes; then :
- $as_echo "#define HAVE_TANL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_select" >&5
+$as_echo "$ac_cv_lib_socket_select" >&6; }
+if test "x$ac_cv_lib_socket_select" = xyes; then :
-fi
+$as_echo "#define HAVE_SELECT 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_get_pixels_per_inch in -lpng" >&5
-$as_echo_n "checking for png_get_pixels_per_inch in -lpng... " >&6; }
-if ${ac_cv_lib_png_png_get_pixels_per_inch+:} false; then :
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in -lws2_32" >&5
+$as_echo_n "checking for select in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_select+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng $LIBS"
+LIBS="-lws2_32 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12217,439 +14022,394 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char png_get_pixels_per_inch ();
+char select ();
int
main ()
{
-return png_get_pixels_per_inch ();
+return select ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_png_png_get_pixels_per_inch=yes
+ ac_cv_lib_ws2_32_select=yes
else
- ac_cv_lib_png_png_get_pixels_per_inch=no
+ ac_cv_lib_ws2_32_select=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_get_pixels_per_inch" >&5
-$as_echo "$ac_cv_lib_png_png_get_pixels_per_inch" >&6; }
-if test "x$ac_cv_lib_png_png_get_pixels_per_inch" = xyes; then :
- $as_echo "#define HAVE_PNG_GET_PIXELS_PER_INCH 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_select" >&5
+$as_echo "$ac_cv_lib_ws2_32_select" >&6; }
+if test "x$ac_cv_lib_ws2_32_select" = xyes; then :
+ $as_echo "#define HAVE_SELECT 1" >>confdefs.h
fi
-for ac_func in getuid setuid setgid
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
fi
-done
-for ac_func in chdir chmod chown
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
fi
-done
-for ac_func in opendir readdir closedir
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
fi
-done
-for ac_func in getgrent getgrgid getgrnam endgrent setgrent
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
fi
done
-for ac_func in getpwuid getpwnam
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+if [ "X$SOCKLIB" = "X$NSLLIB" ]
+then
+NSLLIB=''
fi
-done
-for ac_func in fopen fclose feof ferror fflush fread fwrite
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+rundir="$runstatedir"
-fi
-done
+if [ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" = "X" -a -d /lib/systemd/system ]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ $as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
-for ac_func in _fclose _feof _ferror _fflush _fopen _fread _fwrite
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/usr/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ $as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
-fi
-done
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" != "X" ]
+then
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ $as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
-for ac_func in _getenv_s _wgetenv _getpid
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" = "X" -a -d /lib/systemd/system ]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ $as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
-fi
-done
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/usr/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ $as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
-for ac_func in fetestexcept _clearfp
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ rundir='/run'
+elif [ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" != "X" ]
+then
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ $as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
+ rundir='/run'
+elif [ "X$systemddir" = "X" -a -d /lib/systemd/system ]
+then
+ systemddir='/lib/systemd/system'
+elif [ "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]
+then
+ systemddir='/usr/lib/systemd/system'
+elif [ "X$systemddir" = "X" ]
+then
+ systemddir='/lib/systemd/system'
fi
-done
-for ac_func in fork getrlimit setpgrp setsid syslog
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
-for ac_func in gethostname
-do :
- ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname"
-if test "x$ac_cv_func_gethostname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETHOSTNAME 1
-_ACEOF
+SEP=`cat sep.txt`
+for i in test*.ctr
+do
+j=`echo $i | sed -e 's/\.ctr//g'`
+if [ "X$TESTPROGRAMS" = "X" ]
+then
+ TESTPROGRAMS="$j"
+else
+ TESTPROGRAMS="${TESTPROGRAMS} ${SEP}$j"
fi
done
-for ac_func in time localtime localtime_s
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
+LIBPNG=''
+LIBJPEG=''
+LIBTIFF=''
+ANYDB=''
+PTHREADLIB=''
+LIBDK3WXOBJ=''
+LIBDK4WXOBJ=''
+LIBDK4WXTOBUILD=''
+DBLIB=''
+DBLIBSOCK=''
+NETSNMP_LIBS=''
+NETSNMP_CFLAGS=''
-for ac_func in stat stat32 lstat32
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+TESTSNMPCONFIG=''
+if [ "X$CROSSBUILD" != "Xyes" ]
+then
+ TESTSNMPCONFIG='net-snmp-config'
+else
+ CROSSPREFIX=`$PKG_CONFIG --variable=prefix zlib`
+ TESTSNMPCONFIG=`find $CROSSPREFIX -name 'net-snmp-config'`
+fi
+if [ "X$TESTSNMPCONFIG" != "X" ]
+then
+ NETSNMP_LIBS=`$TESTSNMPCONFIG --libs`
+ NETSNMP_CFLAGS=`$TESTSNMPCONFIG --cflags`
+fi
+ac_fn_c_check_header_mongrel "$LINENO" "gdbm.h" "ac_cv_header_gdbm_h" "$ac_includes_default"
+if test "x$ac_cv_header_gdbm_h" = xyes; then :
+ FOUND_GDBM='yes'
fi
-done
-for ac_func in _stat _stat32 _stat64 _lstat _lstat32 _lstat64
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ac_fn_c_check_header_mongrel "$LINENO" "ndbm.h" "ac_cv_header_ndbm_h" "$ac_includes_default"
+if test "x$ac_cv_header_ndbm_h" = xyes; then :
+ FOUND_NDBM='yes'
fi
-done
-for ac_func in mpctl sysconf sysctl
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
+case "X${FOUND_NDBM}${USE_NDBM}${FOUND_GDBM}" in
+ "Xyesyesyes")
+ $as_echo "#define HAVE_NDBM_H 1" >>confdefs.h
-for ac_func in popen _popen
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ ANYDB='ndbm'
+ ;;
+ "Xyesyesno")
+ $as_echo "#define HAVE_NDBM_H 1" >>confdefs.h
-fi
-done
+ ANYDB='ndbm'
+ ;;
+ "Xyesautono")
+ $as_echo "#define HAVE_NDBM_H 1" >>confdefs.h
-for ac_func in read write _read _write
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ ANYDB='ndbm'
+ ;;
+esac
+if [ "X$ANYDB" != "Xndbm" -a "X$FOUND_GDBM" = "Xyes" ]
+then
+ $as_echo "#define HAVE_GDBM_H 1" >>confdefs.h
fi
-done
-
-for ac_func in seed48
-do :
- ac_fn_c_check_func "$LINENO" "seed48" "ac_cv_func_seed48"
-if test "x$ac_cv_func_seed48" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SEED48 1
-_ACEOF
+ac_fn_c_check_header_mongrel "$LINENO" "db.h" "ac_cv_header_db_h" "$ac_includes_default"
+if test "x$ac_cv_header_db_h" = xyes; then :
+ FOUND_BDB='yes';ANYDB='db';DBLIB='-ldb';$as_echo "#define HAVE_DB_H 1" >>confdefs.h
fi
-done
-for ac_func in sprintf_s sscanf_s swscanf_s
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
-for ac_func in strcat strchr strcmp strcpy strdup strlen strncmp strncpy _strdup
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+
+FOUND_PNG='no'
+ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
+if test "x$ac_cv_header_png_h" = xyes; then :
+ LIBPNG='-lpng';FOUND_PNG='yes';$as_echo "#define HAVE_PNG_H 1" >>confdefs.h
fi
-done
-for ac_func in strncpy_s strrchr strtoimax strtol strtoll strtoul strtoull
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
+FOUND_JPG='no'
-for ac_func in strtoumax
-do :
- ac_fn_c_check_func "$LINENO" "strtoumax" "ac_cv_func_strtoumax"
-if test "x$ac_cv_func_strtoumax" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STRTOUMAX 1
-_ACEOF
+ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
+if test "x$ac_cv_header_jpeglib_h" = xyes; then :
+ LIBJPEG='-ljpeg';FOUND_JPG='yes';$as_echo "#define HAVE_JPEGLIB_H 1" >>confdefs.h
fi
-done
-for ac_func in wcsdup wcsncmp wcsncpy wcsncpy_s wcstoimax wcstol wcstoll
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
-for ac_func in wcstoul wcstoull wcstoumax
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+FOUND_TIFF='no'
+ac_fn_c_check_header_mongrel "$LINENO" "tiff.h" "ac_cv_header_tiff_h" "$ac_includes_default"
+if test "x$ac_cv_header_tiff_h" = xyes; then :
+ LIBTIFF='-ltiff';FOUND_TIFF='yes';$as_echo "#define HAVE_TIFF_H 1" >>confdefs.h
fi
-done
-for ac_func in _wcscat _wcschr _wcscpy _wcsdup _wcslen _wcsncmp _wcsncpy
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+
+WX_HEADER_FOUND='no'
+WX_HEADER_FILENAME=''
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking wx-config" >&5
+$as_echo_n "checking wx-config... " >&6; }
+TESTWXCONFIG=''
+if [ "X$CROSSBUILD" = "Xyes" -a "X$PKG_CONFIG" != "X:" ]
+then
+ CROSSPREFIX=`$PKG_CONFIG --variable=prefix zlib`
+ WX_HEADER_FILENAME=`find $CROSSPREFIX -name 'wx.h'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-3.0'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-gtk3'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-gtk2'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config'`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wxconfig'`
+elif [ "X$CROSSBUILD" != "Xyes" ]
+then
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wx-config-3.0`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wx-config-gtk3`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wx-config-gtk2`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wx-config`
+ [ "X$TESTWXCONFIG" != "X" ] || TESTWXCONFIG=`which wxconfig`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TESTWXCONFIG" >&5
+$as_echo "$TESTWXCONFIG" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking wxWidgets" >&5
+$as_echo_n "checking wxWidgets... " >&6; }
+if [ "XWX_HEADER_FILENAME" != "X" ]
+then
+ WX_HEADER_FOUND='yes'
+fi
+ac_fn_c_check_header_mongrel "$LINENO" "wx/wx.h" "ac_cv_header_wx_wx_h" "$ac_includes_default"
+if test "x$ac_cv_header_wx_wx_h" = xyes; then :
+ WX_HEADER_FOUND='yes'
fi
-done
-for ac_func in _wcsrchr
-do :
- ac_fn_c_check_func "$LINENO" "_wcsrchr" "ac_cv_func__wcsrchr"
-if test "x$ac_cv_func__wcsrchr" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE__WCSRCHR 1
-_ACEOF
+if [ "X$WX_HEADER_FOUND" = "Xyes" -a "X$TESTWXCONFIG" != "X" ]
+then
+ WXCPPFLAGS=`$TESTWXCONFIG --cppflags`
+ WXCXXFLAGS=`$TESTWXCONFIG --cxxflags`
+ WXVERSION=`$TESTWXCONFIG --version`
+ WXCFLAGS=`$TESTWXCONFIG --cflags`
+ WXLDFLAGS=`$TESTWXCONFIG --libs`
+ WXCONFIGLIBS="$WXLDFLAGS"
+elif [ "X$WX_HEADER_FOUND" = "Xyes" ]
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: wxWidgets headers found, bot no wx-config!" >&5
+$as_echo "$as_me: WARNING: wxWidgets headers found, bot no wx-config!" >&2;}
fi
-done
-
-for ac_func in tcflush tcgetattr
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+if [ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]
+then
+ WXCPPFLAGS=`echo $WXCPPFLAGS | sed -e 's/\-I/-isystem /g'`
+ WXCXXFLAGS=`echo $WXCXXFLAGS | sed -e 's/\-I/-isystem /g'`
+ WXCFLAGS=`echo $WXCFLAGS | sed -e 's/\-I/-isystem /g'`
+fi
+FOUND_WX='no'
+if [ "X$WXLDFLAGS" != "X" ]
+then
+ FOUND_WX='yes'
+ $as_echo "#define HAVE_WXWIDGETS 1" >>confdefs.h
fi
-done
+WXMAJOR=''
+WXMINOR=''
+if [ "X$WXVERSION" != "X" ]
+then
+ WXMAJOR=`echo $WXVERSION | cut -f 1 -d .`
+ WXMINOR=`echo $WXVERSION | cut -f 2 -d .`
+fi
+[ "X$WXMAJOR" != "X" ] || WXMAJOR='0'
-for ac_func in umask
-do :
- ac_fn_c_check_func "$LINENO" "umask" "ac_cv_func_umask"
-if test "x$ac_cv_func_umask" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_UMASK 1
-_ACEOF
+if [ "$WXMAJOR" -ge 3 ]
+then
+$as_echo "#define HAVE_WX_DEFS_H 1" >>confdefs.h
-fi
-done
+$as_echo "#define HAVE_WX_CHARTYPE_H 1" >>confdefs.h
-for ac_func in GetFinalPathNameByHandle
-do :
- ac_fn_c_check_func "$LINENO" "GetFinalPathNameByHandle" "ac_cv_func_GetFinalPathNameByHandle"
-if test "x$ac_cv_func_GetFinalPathNameByHandle" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETFINALPATHNAMEBYHANDLE 1
-_ACEOF
+elif [ "$WXMAJOR" -ge 2 ]
+then
+$as_echo "#define HAVE_WX_DEFS_H 1" >>confdefs.h
+
+$as_echo "#define HAVE_WX_WXCHAR_H 1" >>confdefs.h
fi
-done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOUND_WX" >&5
+$as_echo "$FOUND_WX" >&6; }
+FOUND_MYSQL='no'
+ac_fn_c_check_header_mongrel "$LINENO" "mariadb/mysql.h" "ac_cv_header_mariadb_mysql_h" "$ac_includes_default"
+if test "x$ac_cv_header_mariadb_mysql_h" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking wchar_t" >&5
-$as_echo_n "checking wchar_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+MYSQLLIB='-lmariadbclient'
+FOUND_MYSQL='yes'
+$as_echo "#define HAVE_MARIADB_MYSQL_H 1" >>confdefs.h
-#include <sys/types.h>
-#include <wchar.h>
-int
-main ()
-{
+else
- wchar_t chr;
+ac_fn_c_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default"
+if test "x$ac_cv_header_mysql_mysql_h" = xyes; then :
+
+MYSQLLIB='-lmysqlclient'
+FOUND_MYSQL='yes'
+$as_echo "#define HAVE_MYSQL_MYSQL_H 1" >>confdefs.h
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+
+ac_fn_c_check_header_mongrel "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default"
+if test "x$ac_cv_header_mysql_h" = xyes; then :
+
+MYSQLLIB='-lmysqlclient'
+FOUND_MYSQL='yes'
+$as_echo "#define HAVE_MYSQL_H 1" >>confdefs.h
+
+
+
+fi
+
+
+
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking mkdir path mode" >&5
-$as_echo_n "checking mkdir path mode... " >&6; }
+
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_get_pixels_per_inch in -lpng" >&5
+$as_echo_n "checking for png_get_pixels_per_inch in -lpng... " >&6; }
+if ${ac_cv_lib_png_png_get_pixels_per_inch+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpng $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
+char png_get_pixels_per_inch ();
int
main ()
{
-
-mkdir("test", 0755);
-
+return png_get_pixels_per_inch ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_MKDIR2 1" >>confdefs.h
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_png_png_get_pixels_per_inch=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_lib_png_png_get_pixels_per_inch=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_get_pixels_per_inch" >&5
+$as_echo "$ac_cv_lib_png_png_get_pixels_per_inch" >&6; }
+if test "x$ac_cv_lib_png_png_get_pixels_per_inch" = xyes; then :
+ $as_echo "#define HAVE_PNG_GET_PIXELS_PER_INCH 1" >>confdefs.h
+
+fi
+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12675,19 +14435,22 @@ if ac_fn_c_try_compile "$LINENO"; then :
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking const" >&5
-$as_echo_n "checking const... " >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking rand srand" >&5
+$as_echo_n "checking rand srand... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
-static char const msg[] = { "Test" };
+#include <stdlib.h>
int
main ()
{
-fputs(msg, stdout);
+ srand(25);
+ printf("%d\n", rand());
+ printf("%d\n", RAND_MAX);
;
return 0;
@@ -12695,7 +14458,10 @@ fputs(msg, stdout);
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_CONST 1" >>confdefs.h
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_RAND 1" >>confdefs.h
+
+$as_echo "#define HAVE_SRAND 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -12703,95 +14469,76 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking inline" >&5
-$as_echo_n "checking inline... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking initstate setstate random" >&5
+$as_echo_n "checking initstate setstate random... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
-
-inline
-int
-summe(int a, int b)
-{
- return (a + b);
-}
-
+#include <stdlib.h>
int
main ()
{
-int i = 5;
-int j = 6;
-int k;
-
-k = summe(i, j);
+char rs[256];
+initstate(25, rs, sizeof(rs));
+setstate(rs);
+printf("%ld\n", random());
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };FOUNDINLINE="yes"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if [ "X$FOUNDINLINE" = "Xyes" -a "X$USEINLINE" = "Xyes" ]
-then
- $as_echo "#define HAVE_INLINE 1" >>confdefs.h
-
-fi
-if test -b /dev/urandom
-then
- $as_echo "#define HAVE_DEV_URANDOM 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_INITSTATE 1" >>confdefs.h
-fi
-if test -c /dev/urandom
-then
- $as_echo "#define HAVE_DEV_URANDOM 1" >>confdefs.h
+$as_echo "#define HAVE_SETSTATE 1" >>confdefs.h
-fi
-if test -b /dev/random
-then
- $as_echo "#define HAVE_DEV_RANDOM 1" >>confdefs.h
+$as_echo "#define HAVE_RANDOM 1" >>confdefs.h
-fi
-if test -c /dev/random
-then
- $as_echo "#define HAVE_DEV_RANDOM 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fpclassify" >&5
-$as_echo_n "checking fpclassify... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lrand48 nrand48 seed48" >&5
+$as_echo_n "checking lrand48 nrand48 seed48... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <stdlib.h>
int
main ()
{
-int cl;
-cl = fpclassify(-0.5);
+unsigned short sv[3];
+sv[0] = 0;
+sv[1] = 1;
+sv[2] = 2;
+seed48(sv);
+printf("%ld\n", lrand48());
+printf("%ld\n", nrand48(sv));
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_FPCLASSIFY 1" >>confdefs.h
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+$as_echo "#define HAVE_LRAND48 1" >>confdefs.h
+
+$as_echo "#define HAVE_NRAND48 1" >>confdefs.h
+
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -12799,26 +14546,15 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-for ac_func in getpeername
-do :
- ac_fn_c_check_func "$LINENO" "getpeername" "ac_cv_func_getpeername"
-if test "x$ac_cv_func_getpeername" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPEERNAME 1
-_ACEOF
-
-$as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lxnet" >&5
-$as_echo_n "checking for getpeername in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_getpeername+:} false; then :
+COMPILE_RAND_EGD=no
+LIBCHECK_RAND_EGD=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAND_egd in -lcrypto" >&5
+$as_echo_n "checking for RAND_egd in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_RAND_egd+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
+LIBS="-lcrypto $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12828,286 +14564,160 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char getpeername ();
+char RAND_egd ();
int
main ()
{
-return getpeername ();
+return RAND_egd ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_getpeername=yes
+ ac_cv_lib_crypto_RAND_egd=yes
else
- ac_cv_lib_xnet_getpeername=no
+ ac_cv_lib_crypto_RAND_egd=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getpeername" >&5
-$as_echo "$ac_cv_lib_xnet_getpeername" >&6; }
-if test "x$ac_cv_lib_xnet_getpeername" = xyes; then :
-
-$as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
-
-
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_egd" >&5
+$as_echo "$ac_cv_lib_crypto_RAND_egd" >&6; }
+if test "x$ac_cv_lib_crypto_RAND_egd" = xyes; then :
+ LIBCHECK_RAND_EGD='yes'
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lnsl" >&5
-$as_echo_n "checking for getpeername in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_getpeername+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RAND_egd (compile test code)" >&5
+$as_echo_n "checking RAND_egd (compile test code)... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getpeername ();
+#include <openssl/rand.h>
+
int
main ()
{
-return getpeername ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_getpeername=yes
-else
- ac_cv_lib_nsl_getpeername=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getpeername" >&5
-$as_echo "$ac_cv_lib_nsl_getpeername" >&6; }
-if test "x$ac_cv_lib_nsl_getpeername" = xyes; then :
-
-$as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
+int i;
+i = RAND_egd("/dev/egd");
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lsocket" >&5
-$as_echo_n "checking for getpeername in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_getpeername+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getpeername ();
-int
-main ()
-{
-return getpeername ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_getpeername=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ COMPILE_RAND_EGD='yes';{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- ac_cv_lib_socket_getpeername=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if [ "X$COMPILE_RAND_EGD" = "Xyes" -a "X$LIBCHECK_RAND_EGD" = "Xyes" ]
+then
+$as_echo "#define HAVE_RAND_EGD 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getpeername" >&5
-$as_echo "$ac_cv_lib_socket_getpeername" >&6; }
-if test "x$ac_cv_lib_socket_getpeername" = xyes; then :
-$as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h
+if test -b /dev/urandom
+then
+ $as_echo "#define HAVE_DEV_URANDOM 1" >>confdefs.h
fi
-
+if test -c /dev/urandom
+then
+ $as_echo "#define HAVE_DEV_URANDOM 1" >>confdefs.h
fi
-
+if test -b /dev/random
+then
+ $as_echo "#define HAVE_DEV_RANDOM 1" >>confdefs.h
fi
-
+if test -c /dev/random
+then
+ $as_echo "#define HAVE_DEV_RANDOM 1" >>confdefs.h
fi
-done
-
-
-for ac_func in getsockname
-do :
- ac_fn_c_check_func "$LINENO" "getsockname" "ac_cv_func_getsockname"
-if test "x$ac_cv_func_getsockname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETSOCKNAME 1
-_ACEOF
-
-$as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking /proc/.../exe symbolic link" >&5
+$as_echo_n "checking /proc/.../exe symbolic link... " >&6; }
+if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lxnet" >&5
-$as_echo_n "checking for getsockname in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_getsockname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
#endif
-char getsockname ();
-int
-main ()
-{
-return getsockname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_getsockname=yes
-else
- ac_cv_lib_xnet_getsockname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getsockname" >&5
-$as_echo "$ac_cv_lib_xnet_getsockname" >&6; }
-if test "x$ac_cv_lib_xnet_getsockname" = xyes; then :
-
-$as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lnsl" >&5
-$as_echo_n "checking for getsockname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_getsockname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
-char getsockname ();
-int
-main ()
-{
-return getsockname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_getsockname=yes
-else
- ac_cv_lib_nsl_getsockname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getsockname" >&5
-$as_echo "$ac_cv_lib_nsl_getsockname" >&6; }
-if test "x$ac_cv_lib_nsl_getsockname" = xyes; then :
-
-$as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
-
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lsocket" >&5
-$as_echo_n "checking for getsockname in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_getsockname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+/* Buffer for result */
+char prog[1024];
#ifdef __cplusplus
-extern "C"
+int main(int argc, char *argv[])
+#else
+int main(argc, argv) int argc; char *argv[];
#endif
-char getsockname ();
-int
-main ()
{
-return getsockname ();
- ;
- return 0;
+ char buf[64];
+ struct stat stbuf;
+ int exv = 1;
+ ssize_t res;
+#if HAVE_STDINT_H
+ sprintf(buf, "/proc/%ju/exe", (uintmax_t)getpid());
+#else
+ sprintf(buf, "/proc/%lu/exe", (unsigned long)getpid());
+#endif
+ res = readlink(buf, prog, sizeof(prog));
+ if ((0 < res) && (sizeof(prog) > res)) {
+ prog[res] = '\0';
+ if (0 == stat(prog, &stbuf)) {
+ exv = 0;
+ }
+ }
+ return exv;
}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_getsockname=yes
-else
- ac_cv_lib_socket_getsockname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getsockname" >&5
-$as_echo "$ac_cv_lib_socket_getsockname" >&6; }
-if test "x$ac_cv_lib_socket_getsockname" = xyes; then :
-
-$as_echo "#define HAVE_GETSOCKNAME 1" >>confdefs.h
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };$as_echo "#define HAVE_PROC_PID_EXE 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
+if [ "X$CROSSBUILD" = "Xyes" ]
+then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Test for /proc/.../exe not possible!" >&5
+$as_echo "$as_me: WARNING: Test for /proc/.../exe not possible!" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Result is guessed and may be wrong." >&5
+$as_echo "$as_me: WARNING: Result is guessed and may be wrong." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Correct HAVE_PROC_PID_EXE in config.h if necessary." >&5
+$as_echo "$as_me: WARNING: Correct HAVE_PROC_PID_EXE in config.h if necessary." >&2;}
fi
-
-fi
-done
-
-
-
-
-
+FOUND_NETSNMP='no'
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13127,8 +14737,7 @@ netsnmp_session session, *ss;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
-SNMPPROG="snmpprog"
-SNMP_PROG_CLI='$(SNMP_PROG_CLI)'
+FOUND_NETSNMP='yes'
$as_echo "#define HAVE_LIBNETSNMP 1" >>confdefs.h
@@ -13171,7 +14780,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netsnmp_snmp_enable_filelog" >&5
$as_echo "$ac_cv_lib_netsnmp_snmp_enable_filelog" >&6; }
if test "x$ac_cv_lib_netsnmp_snmp_enable_filelog" = xyes; then :
- SNMPPROG="snmpprog";$as_echo "#define HAVE_SNMP_ENABLE_FILELOG 1" >>confdefs.h
+ $as_echo "#define HAVE_SNMP_ENABLE_FILELOG 1" >>confdefs.h
fi
@@ -13298,542 +14907,841 @@ if test "x$ac_cv_lib_netsnmp_snmp_disable_filelog" = xyes; then :
fi
-IEEE_754_DOUBLE_WISHED='yes'
-IEEE_754_DOUBLE_FOUND='no'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IEEE 754 double" >&5
-$as_echo_n "checking IEEE 754 double... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - test not possible" >&5
-$as_echo "no - test not possible" >&6; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#include <math.h>
-
-static double td[] = {
- INFINITY,
- 1234.75,
- 4.0,
- 1.0,
- 0.375,
- 0.0,
- -0.625,
- -1.0,
- -8.0,
- -23.875,
- -INFINITY
-};
-
-#if WORDS_BIGENDIAN
-static unsigned char tuc[] = {
- /* INF */ 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 1234.75 */ 0x40, 0x93, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 4.0 */ 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 1.0 */ 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0.375 */ 0x3F, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -0.625 */ 0xBF, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -1.0 */ 0xBF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -8.0 */ 0xC0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -23.875 */ 0xC0, 0x37, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -INF */ 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-#else
-static unsigned char tuc[] = {
- /* INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F,
- /* 1234.75 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x93, 0x40,
- /* 4.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40,
- /* 1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F,
- /* 0.375 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x3F,
- /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -0.625 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xBF,
- /* -1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF,
- /* -8.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xC0,
- /* -23.875 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x37, 0xC0,
- /* -INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF
-};
-#endif
-
-static
-#ifdef __cplusplus
-int
-test_double(double *dp, unsigned char *up)
-#else
-int
-test_double(dp, up)
- double *dp;
- unsigned char *up;
-#endif
-{
- int back = 0;
-#if HAVE_MEMCMP
- if(memcmp(dp, up, 8) == 0) {
- back = 1;
- }
-#else
-#if HAVE_BCMP
- if(bcmp(dp, up, 8) == 0) {
- back = 1;
- }
-#else
- unsigned char *cp1;
- unsigned char *cp2;
- size_t i;
- back = 1;
- cp1 = (unsigned char *)dp; cp2 = up;
- for(i = 0; i < 8; i++) {
- if(*(cp1++) != *(cp2++)) {
- back = 0;
- }
- }
-#endif
-#endif
- if(1 != back) {
- printf("ERROR: %lg not conforming to IEEE 754!\n", *dp);
- }
- return back;
-}
-
-#ifdef __cplusplus
-int main(int argc, char *argv[])
-#else
-int main(argc, argv)
- int argc;
- char *argv[];
-#endif
-{
- unsigned char *ucp;
- double *dp;
- size_t i;
- int ev = 1;
-
- if(8 == sizeof(double)) {
- ev = 0;
- ucp = tuc; dp = td;
- for(i = 0; i < (sizeof(td)/sizeof(double)); i++) {
- if(!test_double(dp, ucp)) {
- ev = 1;
- }
- dp++;
- ucp += 8;
- }
- } else {
- printf("ERROR: Size of double is not 1!\n");
- }
- exit(ev);
-}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking MySQL client library" >&5
+$as_echo_n "checking MySQL client library... " >&6; }
+if [ "X$FOUND_MYSQL" = "Xyes" ]
+then
+ [ ! -f /usr/lib/mysql/libmysqlclient.so ] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
+ [ ! -f /usr/lib/mysql/libmysqlclient.a ] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
+ [ ! -f /usr/lib/mysql/libmysqlclient.so ] || MYSQLLDFLAGS="-L/usr/lib/mysql"
+ [ ! -f /usr/lib/mysql/libmysqlclient.a ] || MYSQLLDFLAGS="-L/usr/lib/mysql"
+ [ ! -f /usr/lib64/mysql/libmysqlclient.so ] || LDFLAGS="$LDFLAGS -L/usr/lib64/mysql"
+ [ ! -f /usr/lib64/mysql/libmysqlclient.a ] || LDFLAGS="$LDFLAGS -L/usr/lib64/mysql"
+ [ ! -f /usr/lib64/mysql/libmysqlclient.so ] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
+ [ ! -f /usr/lib64/mysql/libmysqlclient.a ] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+SOLIBZ=''
+SOLIBBZ=''
+SOLIBMATH=''
+SOLIBCRYPTO=''
+SOLIBNET=''
+SOLIBIMG=''
+SOLIBSDBI=''
+SOLIBWX=''
+SOLIBDK3PORT=''
+SOLIBDK3C=''
+SOLIBDK3OF=''
+SOLIBDK3CSRND=''
+SOLIBDK3BIF=''
+SOLIBDK3DBI=''
+SOLIBDK3FIG=''
+SOLIBDK3BMEPS=''
+SOLIBDK3NET=''
+SOLIBDK4BASE=''
+SOLIBDK4MA=''
+SOLIBDK4MAIO8H=''
+SOLIBDK4MAIOWH=''
+SOLIBDK4MAIODH=''
+SOLIBDK4MAIO8D=''
+SOLIBDK4MAIOWD=''
+SOLIBDK4MAIODD=''
+SOLIBDK4C=''
+SOLIBDK4MDRND=''
+SOLIBDK4PPPT=''
+SOLIBDK4APP=''
+SOLIBDK4LATA=''
+SOLIBDK4LAT=''
+SOLIBDK4SOCK=''
+SOLIBDK4SOCKA=''
+SOLIBDK4DBI=''
+SOLIBDK4DBIA=''
+LIBDK4BASELIBF=''
+LIBDK4BASELIBS=''
+LIBDK4MALIBF=''
+LIBDK4MALIBS=''
+LIBDK4MAIO8DLIBF=''
+LIBDK4MAIO8DLIBS=''
+LIBDK4MAIOWDLIBF=''
+LIBDK4MAIOWDLIBS=''
+LIBDK4MAIODDLIBF=''
+LIBDK4MAIODDLIBS=''
+LIBDK4MAIOXDLIBF=''
+LIBDK4MAIOXDLIBS=''
+LIBDK4MAIO8HLIBF=''
+LIBDK4MAIO8HLIBS=''
+LIBDK4MAIOWHLIBF=''
+LIBDK4MAIOWHLIBS=''
+LIBDK4MAIODHLIBF=''
+LIBDK4MAIODHLIBS=''
+LIBDK4DBILIBF=''
+LIBDK4DBILIBS=''
+LIBDK4CLIBF=''
+LIBDK4CLIBS=''
+LIBDK4LATALIBF=''
+LIBDK4LATALIBS=''
+LIBDK4LATLIBF=''
+LIBDK4LATLIBS=''
+LIBDK4BIFLIBF=''
+LIBDK4BIFLIBS=''
+LIBDK4GRALIBF=''
+LIBDK4GRALIBS=''
+LIBDK4SOCKLIBF=''
+LIBDK4SOCKLIBS=''
+LIBDK4MDRNDLIBF=''
+LIBDK4MDRNDLIBS=''
+LIBDK4PPPTLIBF=''
+LIBDK4PPPTLIBS=''
+LIBDK4APPLIBF=''
+LIBDK4APPLIBS=''
+LIBDK4PPPTALIBF=''
+LIBDK4PPPTALIBS=''
+LIBDK4SOCKALIBF=''
+LIBDK4SOCKALIBS=''
+LIBDK4DBIALIBF=''
+LIBDK4DBIALIBS=''
+LIBDK4BIFALIBF=''
+LIBDK4BIFALIBS=''
+LIBDK4GRAALIBF=''
+LIBDK4GRAALIBS=''
+LIBDK4WXLIBF=''
+LIBDK4WXLIBS=''
+LIBDK3TRACELIBF=''
+LIBDK3TRACELIBS=''
+LIBDK3CLIBF=''
+LIBDK3CLIBS=''
+LIBDK3OFLIBF=''
+LIBDK3OFLIBS=''
+LIBDK3CSRNDLIBF=''
+LIBDK3CSRNDLIBS=''
+LIBDK3BIFLIBF=''
+LIBDK3BIFLIBS=''
+LIBDK3DBILIBF=''
+LIBDK3DBILIBS=''
+LIBDK3BMEPSLIBF=''
+LIBDK3BMEPSLIBS=''
+LIBDK3FIGLIBF=''
+LIBDK3FIGLIBS=''
+LIBDK3WXLIBF=''
+LIBDK3WXLIBS=''
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Link shared libraries against shared libraries" >&5
+$as_echo_n "checking Link shared libraries against shared libraries... " >&6; }
+if [ "X$ENA_SHARED" = "Xyes" -a "X$ENA_SOSO" = "Xyes" ]
+then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };IEEE_754_DOUBLE_FOUND="yes"
+$as_echo "yes" >&6; }
+ SOLIBZ="$ZLIB"
+ SOLIBBZ="$BZLIB"
+ SOLIBMATH='-lm'
+ SOLIBCRYPTO="$CRYPTO"
+ SOLIBNET="$NETLIB"
+ SOLIBIMG="$IMGLIBS"
+ SOLIBSDBI="$DKSDBILIBS"
+ SOLIBWX="$WXCONFIGLIBS"
+ SOLIBDK3PORT=''
+ SOLIBDK3C='-ldk3c'
+ SOLIBDK3OF='-ldk3of'
+ SOLIBDK3CSRND='-ldk3csrnd'
+ SOLIBDK3BIF='-ldk3bif'
+ SOLIBDK3DBI='-ldk3dbi'
+ SOLIBDK3FIG='-ldk3fig'
+ SOLIBDK3BMEPS='-ldk3bmeps'
+ SOLIBDK3NET='-ldk3net'
+ SOLIBDK4BASE='-ldk4base'
+ SOLIBDK4MA='-ldk4ma'
+ SOLIBDK4MAIO8H='-ldk4maio8h'
+ SOLIBDK4MAIOWH='-ldk4maiowh'
+ SOLIBDK4MAIODH='-ldk4maiodh'
+ SOLIBDK4MAIO8D='-ldk4maio8d'
+ SOLIBDK4MAIOWD='-ldk4maiowd'
+ SOLIBDK4MAIODD='-ldk4maiodd'
+ SOLIBDK4C='-ldk4c'
+ SOLIBDK4MDRND='-ldk4mdrnd'
+ SOLIBDK4PPPT='-ldk4pppt'
+ SOLIBDK4APP='-ldk4app'
+ SOLIBDK4LATA='-ldk4lata'
+ SOLIBDK4LAT='-ldk4lat'
+ SOLIBDK4SOCK='-ldk4sock'
+ SOLIBDK4SOCKA='-ldk4socka'
+ SOLIBDK4DBI='-ldk4dbi'
+ SOLIBDK4DBIA='-ldk4dbia'
+ LIBDK4BASELIBF=''
+ LIBDK4BASELIBS=''
+ LIBDK4MALIBF='libdk4base.so'
+ LIBDK4MALIBS='-ldk4base'
+ LIBDK4MAIO8DLIBF='libdk4base.so libdk4ma.so'
+ LIBDK4MAIO8DLIBS='-ldk4ma -ldk4base'
+ LIBDK4MAIOWDLIBF='libdk4base.so libdk4ma.so'
+ LIBDK4MAIOWDLIBS='-ldk4ma -ldk4base'
+ LIBDK4MAIODDLIBF='libdk4maio8d.so'
+ LIBDK4MAIODDLIBS='-ldk4maio8d'
+ LIBDK4MAIOXDLIBF='libdk4maio8d.so libdk4maiowd.so'
+ LIBDK4MAIOXDLIBS='-ldk4maiowd -ldk4maio8d'
+ LIBDK4MAIO8HLIBF='libdk4base.so'
+ LIBDK4MAIO8HLIBS='-ldk4base'
+ LIBDK4MAIOWHLIBF='libdk4base.so'
+ LIBDK4MAIOWHLIBS='-ldk4base'
+ LIBDK4MAIODHLIBF='libdk4base.so libdk4maio8h.so'
+ LIBDK4MAIODHLIBS='-ldk4maio8h -ldk4base'
+ LIBDK4CLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so'
+ LIBDK4CLIBS='-ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(BZLIB) $(ZLIB)'
+ LIBDK4DBILIBF='libdk4base.so libdk4ma.so libdk4c.so'
+ LIBDK4DBILIBS='-ldk4c -ldk4ma -ldk4base $(DBLIB) $(DBLIBSOCK)'
+ LIBDK4LATLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4c.so'
+ LIBDK4LATLIBS='-ldk4c -ldk4maio8h -ldk4ma -ldk4base'
+ LIBDK4BIFLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4c.so'
+ LIBDK4BIFLIBS='-ldk4c -ldk4maio8d -ldk4ma -ldk4base $(IMGLIBS)'
+ LIBDK4GRALIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so'
+ LIBDK4GRALIBS='-ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base -lm'
+ LIBDK4SOCKLIBF='libdk4base.so libdk4maio8d.so libdk4c.so'
+ LIBDK4SOCKLIBS='-ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ LIBDK4MDRNDLIBF='libdk4base.so libdk4c.so'
+ LIBDK4MDRNDLIBS='$(CRYPTO) -ldk4c -ldk4base $(CRYPTO)'
+ LIBDK4PPPTLIBF='libdk4base.so libdk4c.so libdk4lat.so libdk4gra.so'
+ LIBDK4PPPTLIBS='-ldk4gra -ldk4lat -ldk4c -ldk4base'
+ LIBDK4APPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so'
+ LIBDK4APPLIBS='-ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base'
+ LIBDK4LATALIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
+ LIBDK4LATALIBS='-ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base'
+ LIBDK4SOCKALIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4maiodh.so libdk4sock.so libdk4app.so'
+ LIBDK4SOCKALIBS='-ldk4app -ldk4sock -ldk4maiodh -ldk4maiodd -ldk4maio8d -ldk4base'
+ LIBDK4DBIALIBF='libdk4base.so libdk4dbi.so libdk4app.so'
+ LIBDK4DBIALIBS='-ldk4app -ldk4dbi -ldk4base'
+ LIBDK4BIFALIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4bif.so libdk4app.so'
+ LIBDK4BIFALIBS='-ldk4app -ldk4bif -ldk4c -ldk4maiodd -ldk4ma -ldk4base'
+ LIBDK4GRAALIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4bifa.so'
+ LIBDK4GRAALIBS='-ldk4bifa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maiodd -ldk4maiodh -ldk4base'
+ LIBDK4PPPTALIBF='libdk4pppt.so libdk4app.so'
+ LIBDK4PPPTALIBS='-ldk4app -ldk4pppt'
+ LIBDK4WXLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4c.so'
+ LIBDK4WXLIBS='-ldk4c -ldk4base -ldk4maiowd -ldk4maio8d $(WXLDFLAGS)'
+ LIBDK3TRACELIBF=''
+ LIBDK3TRACELIBS=''
+ LIBDK3CLIBF=''
+ LIBDK3CLIBS='$(BZLIB) $(ZLIB) -lm'
+ LIBDK3OFLIBF='libdk3c.so'
+ LIBDK3OFLIBS='-ldk3c $(BZLIB) $(ZLIB)'
+ LIBDK3CSRNDLIBF='libdk3c.so'
+ LIBDK3CSRNDLIBS='-ldk3c $(CRYPTO)'
+ LIBDK3BIFLIBF='libdk3c.so'
+ LIBDK3BIFLIBS='-ldk3c $(IMGLIBS)'
+ LIBDK3DBILIBF='libdk3c.so'
+ LIBDK3DBILIBS='-ldk3c $(DBLIB) $(DBLIBSOCK)'
+ LIBDK3BMEPSLIBF='libdk3c.so libdk3of.so libdk3bif.so'
+ LIBDK3BMEPSLIBS='-ldk3bif -ldk3of -ldk3c -lm'
+ LIBDK3FIGLIBF='libdk3c.so'
+ LIBDK3FIGLIBS='-ldk3c -lm'
+ LIBDK3WXLIBF='libdk3c.so'
+ LIBDK3WXLIBS='-ldk3c $(WXLDFLAGS)'
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; };IEEE_754_DOUBLE_FOUND="no"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+$as_echo "no" >&6; }
fi
-if [ "X$IEEE_754_DOUBLE_FOUND$IEEE_754_DOUBLE_WISHED" = "Xyesyes" ]
-then
- $as_echo "#define HAVE_IEEE_754_DOUBLE 1" >>confdefs.h
-else
- IEEE_754_DOUBLE_FOUND='no'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isfinite" >&5
-$as_echo_n "checking isfinite... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-int
-main ()
-{
- double x;
- int a = 0;
- x = 5.0;
- if (isfinite(x)) {
- a = 1;
- }
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_ISFINITE 1" >>confdefs.h
+MKSOLIB='echo "ERROR: Can not build shared libraries!" #'
+MKSOLIBCPP='echo "ERROR: Can not build shared libraries!" #'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking toolchain specific options" >&5
+$as_echo_n "checking toolchain specific options... " >&6; }
+case X$TOOLCHAIN in
+ Xgcc|Xclang)
+ CFLAGS="$CFLAGS -fPIC -D_REENTRANT"
+ CFL_CLI_C8="$CFL_CLI_C8 -fPIC -D_REENTRANT"
+ CFL_CLI_DK="$CFL_CLI_DK -fPIC -D_REENTRANT"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -fPIC -D_REENTRANT"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -fPIC -D_REENTRANT"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -fPIC -D_REENTRANT"
+ CXXFL_GUI="$CXXFL_GUI -fPIC -D_REENTRANT"
+ if [ "X$ENA_SHARED" = "Xyes" ]
+ then
+ CXXFL_GUI="$CXXFL_GUI"
+ fi
+ MKSOLIB='$(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
+ MKSOLIBCPP='$(CXX) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
+ if [ "X$ENA_SHARED" = "Xyes" -a "X$ENA_SOSO" = "Xyes" ]
+ then
+ MKSORPATHLINK='-Wl,-rpath-link,./'
+ MKSOCHECKSYMBOLS='-Wl,-z,defs'
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: gcc" >&5
+$as_echo "gcc" >&6; }
+ ;;
+ Xworkshop)
+ if [ "X$ENA_SHARED" = "Xyes" ]
+ then
+ CFLAGS="-Bdynamic -dy $CFLAGS"
+ CFL_CLI_C8="-Bdynamic -dy $CFL_CLI_C8"
+ CFL_CLI_DK="-Bdynamic -dy $CFL_CLI_DK"
+ CXXFL_CLI_C8="-Bdynamic -dy $CXXFL_CLI_C8"
+ CXXFL_CLI_DK="-Bdynamic -dy $CXXFL_CLI_DK"
+ CXXFL_CLI_WX="-Bdynamic -dy $CXXFL_CLI_WX"
+ CXXFL_GUI="-Bdynamic -dy $CXXFL_GUI"
+ LDFLAGS="-Bdynamic -dy $LDFLAGS"
+ LDFLC_CLI_C8="-Bdynamic -dy $LDFLC_CLI_C8"
+ LDFLC_CLI_DK="-Bdynamic -dy $LDFLC_CLI_DK"
+ LDFLCXX_CLI_C8="-Bdynamic -dy $LDFLCXX_CLI_C8"
+ LDFLCXX_CLI_DK="-Bdynamic -dy $LDFLCXX_CLI_DK"
+ LDFLCXX_CLI_WX="-Bdynamic -dy $LDFLCXX_CLI_WX"
+ LDFLCXX_GUI="-Bdynamic -dy $LDFLCXX_GUI"
+ fi
+ CFLAGS="$CFLAGS -xcode=pic32 -D_REENTRANT"
+ CFL_CLI_C8="$CFL_CLI_C8 -xcode=pic32 -D_REENTRANT"
+ CFL_CLI_DK="$CFL_CLI_DK -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -xcode=pic32 -D_REENTRANT"
+ CXXFL_GUI="$CXXFL_GUI -xcode=pic32 -D_REENTRANT"
+ MKSOLIB='$(CC) -L. $(MKSORPATH) $(MKSORPATHLINK) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
+ MKSOLIBCPP='$(CXX) -L. $(MKSORPATH) $(MKSORPATHLINK) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: workshop" >&5
+$as_echo "workshop" >&6; }
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: other" >&5
+$as_echo "other" >&6; }
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker requires -R option" >&5
+$as_echo_n "checking linker requires -R option... " >&6; }
+if [ "X$LD_LIBRARY_PATH" != "X" -a "X$TOOLCHAIN" = "Xworkshop" ]
+then
+ RPATH="-R${LD_LIBRARY_PATH}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking isnormal" >&5
-$as_echo_n "checking isnormal... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-int
-main ()
-{
+if [ "X$ENA_RPATH" = "Xyes" -a "X$ENA_PACKAGE" = "Xyes" -a \( "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" \) ]
+then
+ RPATH='-Wl,-rpath,$(libdir)'
+fi
- double x;
- int a = 0;
- x = 5.0;
- if (isnormal(x)) {
- a = 1;
- }
+DBLIBSOCK="$DBLIB"
+case X$TARGETHOST in
+ Xsparc-sun-solaris*)
+ if [ "X$ENA_SUNOS_CORR" = "Xyes" ]
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking corrections for Solaris" >&5
+$as_echo_n "checking corrections for Solaris... " >&6; }
+ [ "X$DBLIBSOCK" = "X" ] || DBLIBSOCK="$DBLIB -lrt "'$(SOCKLIB)'
+ [ "X$DBLIB" = "X" ] || DBLIB="$DBLIB -lrt"
+ [ "X$CRYPTO" = "X" ] || CRYPTO="$CRYPTO -lssl "'$(SOCKLIB)'
+ [ "X$MYSQLLIB" = "X" ] || MYSQLLIB="$MYSQLLIB -lrt "'$(SOCKLIB)'
+ NETSNMP_LIBS=`echo $NETSNMP_LIBS | sed -f modsnmp.sed`
+ SOCKLIB='-lsocket'
+ NSLLIB='-lnsl'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ NETSNMP_LIBS=''
+ FOUND_NETSNMP='no'
+ fi
+ ;;
+esac
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_ISNORMAL 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking availability of network functions" >&5
+$as_echo_n "checking availability of network functions... " >&6; }
+if [ "X$FOUND_SOCKET" = "Xyes" ]
+then
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+RES_RES_NET_EN='$(RES_RES_NET_EN)'
+RES_RES_NET_DE='$(RES_RES_NET_DE)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking use of twos complement for negative integers" >&5
-$as_echo_n "checking use of twos complement for negative integers... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - test not possible" >&5
-$as_echo "no - test not possible" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking both network functions and POSIX" >&5
+$as_echo_n "checking both network functions and POSIX... " >&6; }
+if [ "X$FOUND_SOCKET" = "Xyes" -a "X$TARGETCLASS" = "Xposix" ]
+then
+PRG_CLI_NET_POSIX='$(PRG_CLI_NET_POSIX)'
+MAN_CLI_NET_POSIX='$(MAN_CLI_NET_POSIX)'
+RES_CLI_NET_POSIX='$(RES_CLI_NET_POSIX)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_PROCESS_H
-#include <process.h>
-#endif
-
-int i1 = -1;
-
-#if SIZEOF_INT > 2
-#if SIZEOF_INT > 4
-#if SIZEOF_INT > 8
-#error "No test available yet for integers larger than 8 bytes!"
-#else
-int i2 = 0xFFFFFFFFFFFFFFFF;
-#endif
-#else
-int i2 = 0xFFFFFFFF;
-#endif
-#else
-int i2 = 0xFFFF;
-#endif
-
-int main(int argc, char *argv[])
-{
- int exval = 1;
- if (i1 == i2) exval = 0;
- exit(exval); return exval;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };$as_echo "#define HAVE_TWOS_COMPLEMENT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking NetSNMP support" >&5
+$as_echo_n "checking NetSNMP support... " >&6; }
+if [ "X$NETSNMP_LIBS" != "X" ]
+then
+PRG_CLI_SNMP='$(PRG_CLI_SNMP)'
+MAN_CLI_SNMP='$(MAN_CLI_SNMP)'
+RES_CLI_SNMP='$(RES_CLI_SNMP)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-CLI_SNMPPROG=''
-if [ "X$SNMPPROG" != "X" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking MySQL or MariaDB" >&5
+$as_echo_n "checking MySQL or MariaDB... " >&6; }
+if [ "X$MYSQLLIB" != "X" ]
then
- CLI_SNMPPROG='pjsnmp$(EXEEXT)'
+PRG_CLI_MYSQL='$(PRG_CLI_MYSQL)'
+MAN_CLI_MYSQL='$(MAN_CLI_MYSQL)'
+RES_CLI_MYSQL='$(RES_CLI_MYSQL)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-CLI_MYSQLPROG=''
-if [ "X$MYSQLPROG" != "X" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL" >&5
+$as_echo_n "checking OpenSSL... " >&6; }
+if [ "X$CRYPTO" != "X" ]
then
- CLI_MYSQLPROG='itadmin$(EXEEXT)'
- MYSQL_PROG_CLI='$(MYSQL_PROG_CLI)'
- [ ! -f /usr/lib/mysql/libmysqlclient.so ] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
- [ ! -f /usr/lib/mysql/libmysqlclient.a ] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
- [ ! -f /usr/lib/mysql/libmysqlclient.so ] || MYSQLLDFLAGS="-L/usr/lib/mysql"
- [ ! -f /usr/lib/mysql/libmysqlclient.a ] || MYSQLLDFLAGS="-L/usr/lib/mysql"
- [ ! -f /usr/lib64/mysql/libmysqlclient.so ] || LDFLAGS="$LDFLAGS -L/usr/lib64/mysql"
- [ ! -f /usr/lib64/mysql/libmysqlclient.a ] || LDFLAGS="$LDFLAGS -L/usr/lib64/mysql"
- [ ! -f /usr/lib64/mysql/libmysqlclient.so ] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
- [ ! -f /usr/lib64/mysql/libmysqlclient.a ] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
+PRG_CLI_SSL='$(PRG_CLI_SSL)'
+MAN_CLI_SSL='$(MAN_CLI_SSL)'
+RES_CLI_SSL='$(RES_CLI_SSL)'
+PRG_GUI_SSL='$(PRG_GUI_SSL)'
+MAN_GUI_SSL='$(MAN_GUI_SSL)'
+RES_GUI_SSL='$(RES_GUI_SSL)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-if [ "X$SUITE" = "Xgui" ]
+MOD_DK4DMT=''
+MOD_DKK3WREG=''
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target class POSIX" >&5
+$as_echo_n "checking target class POSIX... " >&6; }
+if [ "X$TARGETCLASS" = "Xposix" ]
then
- LIBDK3WXOBJ='$(LIBDK3WXOBJ)'
- LIBDK4WXOBJ='$(LIBDK4WXOBJ)'
- LIBDK4WXTOBUILD='libdk4wx.$(LIBEXT)'
+PRG_CLI_POSIX='$(PRG_CLI_POSIX)'
+MAN_CLI_POSIX='$(MAN_CLI_POSIX)'
+RES_CLI_POSIX='$(RES_CLI_POSIX)'
+MOD_DK4DMT='dk4dmt.$(OBJEXT)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-if [ "X$ENASHARED" = "Xyes" -a "X$USESOLINKING" = "Xyes" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target class Windows" >&5
+$as_echo_n "checking target class Windows... " >&6; }
+if [ "X$TARGETCLASS" = "Xwindows" ]
then
- SOLIBZ="$ZLIB"
- SOLIBBZ="$BZLIB"
- SOLIBMATH="-lm"
- SOLIBCRYPTO="$CRYPTO"
- SOLIBNET="$NETLIB"
- SOLIBIMG="$IMGLIBS"
- SOLIBSDBI="$DKSDBILIBS"
- SOLIBWX=`wx-config --libs`
- SOLIBDK3PORT=""
- SOLIBDK3C="-ldk3c"
- SOLIBDK3OF="-ldk3of"
- SOLIBDK3CSRND="-ldk3csrnd"
- SOLIBDK3BIF="-ldk3bif"
- SOLIBDK3DBI="-ldk3dbi"
- SOLIBDK3FIG="-ldk3fig"
- SOLIBDK3BMEPS="-ldk3bmeps"
- SOLIBDK3NET="-ldk3net"
- SOLIBDK4BASE="-ldk4base"
- SOLIBDK4MA="-ldk4ma"
- SOLIBDK4MAIO8H="-ldk4maio8h"
- SOLIBDK4MAIOWH="-ldk4maiowh"
- SOLIBDK4MAIODH="-ldk4maiodh"
- SOLIBDK4MAIO8D="-ldk4maio8d"
- SOLIBDK4MAIOWD="-ldk4maiowd"
- SOLIBDK4MAIODD="-ldk4maiodd"
- SOLIBDK4C="-ldk4c"
- SOLIBDK4MDRND="-ldk4mdrnd"
- SOLIBDK4PPPT="-ldk4pppt"
- SOLIBDK4APP="-ldk4app"
- SOLIBDK4LAT="-ldk4lat"
- SOLIBDK4SOCK="-ldk4sock"
- SOLIBDK4SOCKA="-ldk4socka"
- SOLIBDK4DBI="-ldk4dbi"
- SOLIBDK4DBIA="-ldk4dbia"
- LIBDK4MALIBF="libdk4base.so"
- LIBDK4MALIBS='-ldk4base'
- LIBDK4MAIO8DLIBF="libdk4base.so libdk4ma.so"
- LIBDK4MAIO8DLIBS='-ldk4ma -ldk4base'
- LIBDK4MAIOWDLIBF="libdk4base.so libdk4ma.so"
- LIBDK4MAIOWDLIBS='-ldk4ma -ldk4base'
- LIBDK4MAIODDLIBF="libdk4base.so libdk4maio8d.so"
- LIBDK4MAIODDLIBS='-ldk4maio8d -ldk4base'
- LIBDK4MAIOXDLIBF="libdk4base.so libdk4maio8d.so libdk4maiowd.so"
- LIBDK4MAIOXDLIBS='-ldk4maiowd -ldk4maio8d -ldk4base'
- LIBDK4MAIO8HLIBF="libdk4base.so"
- LIBDK4MAIO8HLIBS='-ldk4base'
- LIBDK4MAIOWHLIBF="libdk4base.so"
- LIBDK4MAIOWHLIBS='-ldk4base'
- LIBDK4MAIODHLIBF="libdk4base.so libdk4maio8h.so"
- LIBDK4MAIODHLIBS='-ldk4maio8h -ldk4base'
- LIBDK4CLIBF="libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so"
- LIBDK4CLIBS='-ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(BZLIB) $(ZLIB) -lm'
- LIBDK4DBILIBF="libdk4base.so libdk4ma.so libdk4c.so"
- LIBDK4DBILIBS='-ldk4c -ldk4ma -ldk4base $(DBLIB)'
- LIBDK4SOCKLIBF="libdk4base.so libdk4maio8d.so libdk4c.so"
- LIBDK4SOCKLIBS='-ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- LIBDK4MDRNDLIBF="libdk4base.so libdk4c.so"
- LIBDK4MDRNDLIBS='-ldk4c -ldk4base $(CRYPTO)'
- LIBDK4PPPTLIBF="libdk4base.so libdk4maiodd.so libdk4c.so"
- LIBDK4PPPTLIBS='-ldk4c -ldk4maiodd -ldk4base'
- LIBDK4APPLIBF="libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so"
- LIBDK4APPLIBS='-ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base'
- LIBDK4LATLIBF="libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4app.so"
- LIBDK4LATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maio8h -ldk4ma -ldk4base'
- LIBDK4PPPTALIBF="libdk4base.so libdk4c.so libdk4pppt.so libdk4app.so"
- LIBDK4PPPTALIBS='-ldk4app -ldk4pppt -ldk4c -ldk4base'
- LIBDK4SOCKALIBF="libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodh.so libdk4maiodd.so libdk4sock.so libdk4app.so"
- LIBDK4SOCKALIBS='-ldk4app -ldk4sock -ldk4maiodd -ldk4maiodh -ldk4maio8d -ldk4maio8h -ldk4base $(SOCKLIB) $(NSLLIB)'
- LIBDK4DBIALIBF="libdk4base.so libdk4dbi.so libdk4app.so"
- LIBDK4DBIALIBS='-ldk4dbi -ldk4app -ldk4base $(DBLIB)'
- LIBDK4WXLIBF="libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4app.so"
- LIBDK4WXLIBS='-ldk4app -ldk4c -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS)'
- LIBDK3TRACELIBF=""
- LIBDK3TRACELIBS=''
- LIBDK3CLIBF=""
- LIBDK3CLIBS='$(BZLIB) $(ZLIB) -lm'
- LIBDK3OFLIBF="libdk3c.so"
- LIBDK3OFLIBS='-ldk3c $(BZLIB) $(ZLIB)'
- LIBDK3CSRNDLIBF="libdk3c.so"
- LIBDK3CSRNDLIBS='-ldk3c $(CRYPTO)'
- LIBDK3BIFLIBF="libdk3c.so"
- LIBDK3BIFLIBS='-ldk3c $(IMGLIBS)'
- LIBDK3DBILIBF="libdk3c.so"
- LIBDK3DBILIBS='-ldk3c $(DBLIB)'
- LIBDK3BMEPSLIBF="libdk3c.so libdk3of.so libdk3bif.so"
- LIBDK3BMEPSLIBS='-ldk3bif -ldk3of -ldk3c -lm'
- LIBDK3FIGLIBF="libdk3c.so"
- LIBDK3FIGLIBS='-ldk3c -lm'
- LIBDK3WXLIBF="libdk3c.so"
- LIBDK3WXLIBS='-ldk3c $(WXLDFLAGS)'
+PRG_CLI_WINDOWS='$(PRG_CLI_WINDOWS)'
+MAN_CLI_WINDOWS='$(MAN_CLI_WINDOWS)'
+RES_CLI_WINDOWS='$(RES_CLI_WINDOWS)'
+PRG_GUI_WINDOWS='$(PRG_GUI_WINDOWS)'
+MAN_GUI_WINDOWS='$(MAN_GUI_WINDOWS)'
+RES_GUI_WINDOWS='$(RES_GUI_WINDOWS)'
+MOD_DK3WREG='dk3wreg.$(OBJEXT)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-if [ "X$ENASHARED" = "Xyes" -a "X$USESOLINKING" = "Xyes" -a "X$CROSSCOMPLING" = "Xyes" ]
+
+if [ "X$SUITE" = "Xauto" -a "X$FOUND_WX" = "Xyes" ]
+then
+ SUITE='gui'
+elif [ "X$SUITE" = "Xauto" ]
then
- LIBDK4MAIODDLIBF="$LIBDK4MAIODDLIBF libdk4maiowd.so"
- LIBDK4MAIODDLIBS='-ldk4maiowd $LIBDK4MAIODDLIBS'
- LIBDK4MAIODHLIBF="$LIBDK4MAIODHLIBF libdk4maiowh.so"
- LIBDK4MAIODHLIBS='-ldk4maiowh $LIBDK4MAIODHLIBS'
+ SUITE='cli'
fi
-case "X$ENAPACKAGING/X$USESOLINKING" in
- "Xyes/Xyes")
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking components to install" >&5
+$as_echo_n "checking components to install... " >&6; }
+INSTALL_INDEP='i-ind-cli'
+INSTALL_LIBS=''
+LIBDK3WXOBJ=''
+LIBDK4WXOBJ=''
+if [ "X$ENA_MAN" = "Xyes" ]
+then
+ INSTALL_INDEP='i-ind-cli i-man-cli'
+fi
+case X$SUITE in
+ Xrescue)
+ BUILD_ARCH='$(PRG_RES)'
+ INSTALL_INDEP='i-ind-res'
+ INSTALL_PROGRAMS='i-prg-res'
+ if [ "X$ENA_MAN" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-res"
+ fi
+ if [ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]
+ then
+ BUILD_ARCH='$(PRG_RES) $(LIB_SHARED_RES)'
+ INSTALL_LIBS='i-lib-dyn-res'
+ fi
+ ;;
+ Xcli)
+ BUILD_ARCH='$(PRG_CLI)'
+ INSTALL_INDEP='i-ind-cli'
+ if [ "X$ENA_MAN" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-cli"
+ fi
+ if [ "X$FOUND_SYSTEMD" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-sysd"
+ else
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-init"
+ fi
+ INSTALL_PROGRAMS='i-prg-cli'
+ if [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_STATIC_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli i-lib-stt-cli i-hdr-cli'
+ elif [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_SHARED" ]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli i-hdr-cli'
+ elif [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" ]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_STATIC_CLI)'
+ INSTALL_LIBS='i-lib-stt-cli i-hdr-cli'
+ elif [ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" ]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli'
+ else
+ BUILD_ARCH='$(PRG_CLI)'
+ fi
+ if [ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" ]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_DAEMON_NET_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-dae"
+ fi
+ if [ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" -a "X$FOUND_NETSNMP" = "Xyes" ]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_FILTER_SNMP_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-fil"
+ fi
+ ;;
+ *)
+ BUILD_ARCH='$(PRG_GUI)'
+ INSTALL_INDEP='i-ind-gui'
+ INSTALL_PROGRAMS='i-prg-gui'
+ if [ "X$ENA_MAN" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-gui"
+ fi
+ if [ "X$FOUND_SYSTEMD" = "Xyes" ]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-sysd"
+ else
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-init"
+ fi
+ if [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_STATIC_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui i-lib-stt-gui i-hdr-gui'
+ elif [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_SHARED" ]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui i-hdr-gui'
+ elif [ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" ]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_STATIC_GUI)'
+ INSTALL_LIBS='i-lib-stt-gui i-hdr-gui'
+ elif [ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" ]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui'
+ else
+ BUILD_ARCH='$(PRG_GUI)'
+ fi
+ LIBDK3WXOBJ='$(LIBDK3WXOBJ)'
+ LIBDK4WXOBJ='$(LIBDK4WXOBJ)'
+ if [ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" ]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_DAEMON_NET_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-dae"
+ fi
+ if [ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" -a "X$FOUND_NETSNMP" = "Xyes" ]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_FILTER_SNMP_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-fil"
+ fi
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+
+case X$TARGETCLASS/X$ENA_PACKAGE/X$TOOLCHAIN in
+ Xwindows/Xno/Xgcc)
+ CRYPTO="$CRYPTO $SOCKLIB"
+ ;;
+ Xwindows/Xno/Xclang)
+ CRYPTO="$CRYPTO $SOCKLIB"
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default elements for programs and libraries" >&5
+$as_echo_n "checking default elements for programs and libraries... " >&6; }
+DKCTLIBF='libdk3.a'
+DKCTLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+ADDCTRLDLIBF=''
+ADDCTRLDLIBS='$(CLILIB)'
+DKDBTLIBF='libdk3.a'
+DKDBTLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+ITADMINLIBF='libdk3.a'
+ITADMINLIBS='libdk3.a $(MYSQLLIB) $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) $(RTLIB)'
+FIG2LATLIBF='libdk3.a'
+FIG2LATLIBS='libdk3.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+HTMLBOOKLIBF='libdk3.a'
+HTMLBOOKLIBS='libdk3.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+DK3INFOLIBF='libdk3.a'
+DK3INFOLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWTLIBF='libdk3.a'
+DKWTLIBS='libdk3.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+WPRCLEANLIBF='libdk3.a'
+WPRCLEANLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWXWIZLIBF='libdk3.a'
+DKWXWIZLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWXPATHLIBF='libdk3.a'
+DKWXPATHLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WINPRINTLIBF='libdk3.a'
+WINPRINTLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+CHSCRSZLIBF='libdk3.a'
+CHSCRSZLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKCTLIBF='libdk3.a'
+WXDKCTLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXIMGSZLIBF='libdk4.a'
+WXIMGSZLIBS='libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKCLOCKLIBF='libdk3.a'
+WXDKCLOCKLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKHTBLIBF='libdk3.a'
+WXDKHTBLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
+PRINTQDILIBF='libdk3.a'
+PRINTQDILIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+PRINTQDALIBF='libdk3.a'
+PRINTQDALIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+
+WXDKDRAWLIBF='libdk4.a libdk4maioxd.a libdk4wx.a'
+WXDKDRAWLIBS='libdk4wx.a libdk4maioxd.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+WXBMPPLIBF='libdk4.a libdk4maioxd.a libdk4wx.a'
+WXBMPPLIBS='libdk4wx.a libdk4maioxd.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+BMPPLIBF='libdk4.a'
+BMPPLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+PLPDFTEXLIBF='libdk4.a'
+PLPDFTEXLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+DKCATLIBF='libdk4.a'
+DKCATLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBLKSLIBF='libdk4.a'
+DKBLKSLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKSQLSPLITLIBF='libdk4.a'
+DKSQLSPLITLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKERADISKLIBF='libdk4.a'
+DKERADISKLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKLSLIBF='libdk4.a'
+DKLSLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKSORTLIBF='libdk4.a'
+DKSORTLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKLINESLIBF='libdk4.a'
+DKLINESLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKFICLIBF='libdk4.a'
+DKFICLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKUIDLIBF='libdk4.a'
+DKUIDLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKPWGENLIBF='libdk4.a'
+DKPWGENLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKRANDLIBF='libdk4.a'
+DKRANDLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKT2HLIBF='libdk4.a'
+DKT2HLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKT2LLIBF='libdk4.a'
+DKT2LLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBIN2CLIBF='libdk4.a'
+DKBIN2CLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKHEXLIBF='libdk4.a'
+DKHEXLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBMMLIBF='libdk4.a'
+DKBMMLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKPWDLIBF='libdk4.a'
+DKPWDLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKRECVLIBF='libdk4.a'
+DKRECVLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+DKSENDLIBF='libdk4.a'
+DKSENDLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+DKDBT2LIBF='libdk4.a'
+DKDBT2LIBS='libdk4.a $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
+DK4INFOLIBF='libdk4.a'
+DK4INFOLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+LPRNGCLLIBF='libdk4.a'
+LPRNGCLLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+WXDKFCSLIBF='libdk4.a libdk4wx.a'
+WXDKFCSLIBS='libdk4wx.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXPQDICLIBF='libdk4.a libdk4wx.a'
+WXPQDICLIBS='libdk4wx.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+PJSNMPLIBF='libdk4.a'
+PJSNMPLIBS='libdk4.a $(CLILIB) $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+PRMONSNMPLIBF='libdk4.a'
+PRMONSNMPLIBS='libdk4.a $(CLILIB) $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+PRINTQDLIBF='libdk4.a'
+PRINTQDLIBS='libdk4.a $(DBLIB) $(SOCKLIB) $(NSLLIB)'
+PRINTQDCLIBF='libdk4.a'
+PRINTQDCLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+RSHDOWNLIBF='libdk4.a'
+RSHDOWNLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+WXD2LATLIBF='libdk4.a'
+WXD2LATLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking elements in programs and libraries" >&5
+$as_echo_n "checking elements in programs and libraries... " >&6; }
+case X$ENA_PACKAGE/X$ENA_SOSO in
+ Xyes/Xyes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: linking so with so" >&5
+$as_echo "linking so with so" >&6; }
DKCTLIBF='libdk3c.so'
- DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- ADDCTRLDLIBF='libdk3c.so'
- ADDCTRLDLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKDBTLIBF='libdk3c.so libdk3dbi.so'
- DKDBTLIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKCTLIBS='-ldk3c $(CLILIB)'
+ ADDCTRLDLIBF=''
+ ADDCTRLDLIBS='$(CLILIB)'
+ DKDBTLIBF=''
+ DKDBTLIBS=''
ITADMINLIBF='libdk3c.so libdk3of.so'
- ITADMINLIBS='-ldk3of -ldk3c -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
- BMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- BMPPLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
- FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3fig.so'
- FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
- HTMLBOOKLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- HTMLBOOKLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ ITADMINLIBS='-ldk3of -ldk3c $(MYSQLLIB) $(CLILIB) $(BZLIB) $(ZLIB)'
+ FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3bmeps.so libdk3fig.so'
+ FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3bif -ldk3c $(CLILIB) -lm'
+ HTMLBOOKLIBF='libdk3c.so libdk3bif.so'
+ HTMLBOOKLIBS='-ldk3bif -ldk3c $(CLILIB)'
DK3INFOLIBF='libdk3c.so'
- DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PLPDFTEXLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- PLPDFTEXLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK3INFOLIBS='-ldk3c $(CLILIB)'
DKWXWIZLIBF='libdk3c.so'
- DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKWXWIZLIBS='-ldk3c $(CLILIB)'
WXDKCTLIBF='libdk3c.so libdk3wx.so'
- WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXBMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3wx.so'
- WXBMPPLIBS='-ldk3wx -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXIMGSZLIBF='libdk3c.so libdk3wx.so'
- WXIMGSZLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
+ WXIMGSZLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4maioxd.so libdk4wx.so'
+ WXIMGSZLIBS='-ldk4wx -ldk4maioxd -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
WXDKCLOCKLIBF='libdk3c.so libdk3wx.so'
- WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
WXDKHTBLIBF='libdk3c.so libdk3wx.so'
- WXDKHTBLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
- PRINTQDILIBF='libdk3c.so libdk3dbi.so'
- PRINTQDILIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PRINTQDALIBF='libdk3c.so'
- PRINTQDALIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKCATLIBF='libdk4base.so libdk4c.so libdk4maiodd.so libdk4app.so'
- DKCATLIBS='-ldk4app -ldk4maiodd -ldk4maio8d -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBLKSLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKBLKSLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSQLSPLITLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKERADISKLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKERADISKLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKLSLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKLSLIBS='-ldk4app -ldk4maiodd -ldk4maiodh -ldk4ma -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKHTBLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
+ PRINTQDILIBF=''
+ PRINTQDILIBS=''
+ PRINTQDALIBF=''
+ PRINTQDALIBS=''
+ WXDKDRAWLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4wx.so'
+ WXDKDRAWLIBS='-ldk4wx -ldk4gra -ldk4lat -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXBMPPLIBF='libdk4base.so libdk4maio8h.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4graa.so libdk4maioxd.so libdk4wx.so'
+ WXBMPPLIBS='-ldk4wx -ldk4maioxd -ldk4graa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maio8h -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKCATLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKCATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB)'
+ DKBLKSLIBF='libdk4base.so libdk4app.so'
+ DKBLKSLIBS='-ldk4app -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKSQLSPLITLIBF='libdk4app.so'
+ DKSQLSPLITLIBS='-ldk4app $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKERADISKLIBF='libdk4base.so libdk4app.so'
+ DKERADISKLIBS='-ldk4app -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKLSLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodh -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
+ BMPPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4bifa.so libdk4graa.so'
+ BMPPLIBS='-ldk4graa -ldk4bifa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maio8d -ldk4maio8h -ldk4base $(CLILIB)'
+ PLPDFTEXLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4lat.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4lata.so libdk4graa.so'
+ PLPDFTEXLIBS='-ldk4graa -ldk4lata -ldk4app -ldk4pppt -ldk4gra -ldk4lat -ldk4c -ldk4maio8d -ldk4base $(IMGLIBS) $(CLILIB)'
DKSORTLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
- DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maiodh -ldk4base $(CLILIB)'
+ DKLINESLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKLINESLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB)'
+ DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRANDLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2HLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
- DKT2LLIBS='-ldk4lat -ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKHEXLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4maiodh.so'
- DKHEXLIBS='-ldk4app -ldk4maiodh -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
+ DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB)'
+ DKRANDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB)'
+ DKT2HLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4maio8h -ldk4base $(CLILIB)'
+ DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4app.so libdk4lata.so'
+ DKT2LLIBS='-ldk4lata -ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB)'
+ DKBIN2CLIBF='libdk4base.so libdk4c.so libdk4app.so'
+ DKBIN2CLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB)'
+ DKHEXLIBF='libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKHEXLIBS='-ldk4app -ldk4c -ldk4maiodh $(CLILIB)'
DKBMMLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB)'
DKPWDLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKSENDLIBS='-ldk4maiodd -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB)'
+ DKRECVLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) -lm'
+ DKSENDLIBF='libdk4base.so libdk4ma.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ DKSENDLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4ma -ldk4base $(SOCKLIB) $(CLILIB) -lm'
DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
- DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
DK4INFOLIBF='libdk4base.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- LPRNGCLLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
- LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- WXDKFCSLIBF='libdk4base.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4ma -ldk4maio8d -ldk4maio8h -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRMONSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8h -ldk4maio8d -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
+ DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB)'
+ LPRNGCLLIBF='libdk4base.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4base $(SOCKLIB) $(CLILIB) -lm'
+ WXDKFCSLIBF='libdk4ma.so libdk4maiodd.so libdk4c.so libdk4wx.so'
+ WXDKFCSLIBS='-ldk4wx -ldk4c -ldk4maiodd -ldk4ma $(WXLDFLAGS) $(CRYPTO) $(GUILIB) $(CLILIB)'
+ WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4wx.so'
+ WXPQDICLIBS='-ldk4wx -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(SOCKLIB) $(GUILIB) $(CLILIB)'
+ PJSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so'
+ PJSNMPLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ PRMONSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so'
+ PRMONSNMPLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(CLILIB)'
PRINTQDLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4dbi.so libdk4sock.so'
- PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
+ PRINTQDCLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
RSHDOWNLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
- RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ WXD2LATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4lata.so libdk4bifa.so libdk4graa.so'
+ WXD2LATLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) -lm'
;;
- "Yyes/Xno")
+ Xyes/Xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: linking programs with all required libs" >&5
+$as_echo "linking programs with all required libs" >&6; }
DKCTLIBF='libdk3c.so'
- DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- ADDCTRLDLIBF='libdk3c.so'
- ADDCTRLDLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ADDCTRLDLIBF=''
+ ADDCTRLDLIBS='$(CLILIB)'
DKDBTLIBF='libdk3c.so libdk3dbi.so'
DKDBTLIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
ITADMINLIBF='libdk3c.so libdk3of.so'
- ITADMINLIBS='-ldk3of -ldk3c -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
- BMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- BMPPLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ITADMINLIBS='-ldk3of -ldk3c $(MYSQLLIB) $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3fig.so'
FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
HTMLBOOKLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
HTMLBOOKLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
DK3INFOLIBF='libdk3c.so'
- DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PLPDFTEXLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- PLPDFTEXLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
DKWXWIZLIBF='libdk3c.so'
- DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
WXDKCTLIBF='libdk3c.so libdk3wx.so'
WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXBMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3wx.so'
- WXBMPPLIBS='-ldk3wx -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXIMGSZLIBF='libdk3c.so libdk3wx.so'
- WXIMGSZLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXIMGSZLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4maioxd.so libdk4wx.so'
+ WXIMGSZLIBS='-ldk4wx -ldk4maioxd -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
WXDKCLOCKLIBF='libdk3c.so libdk3wx.so'
WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
WXDKHTBLIBF='libdk3c.so libdk3wx.so'
@@ -13842,183 +15750,190 @@ case "X$ENAPACKAGING/X$USESOLINKING" in
PRINTQDILIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
PRINTQDALIBF='libdk3c.so'
PRINTQDALIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKCATLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKCATLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBLKSLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKBLKSLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSQLSPLITLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKERADISKLIBF='libdk4base.so libdk4c.so'
- DKERADISKLIBS='-ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKLSLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSORTLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
- DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRANDLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2HLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
- DKT2LLIBS='-ldk4lat -ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKHEXLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKHEXLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBMMLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWDLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKSENDLIBS='-ldk4maiodd -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
- DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
- DK4INFOLIBF='libdk4base.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- LPRNGCLLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
- LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- WXDKFCSLIBF='libdk4base.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4ma -ldk4maio8d -ldk4maio8h -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRMONSNMPLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8h -ldk4maio8d -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRINTQDLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4dbi.so libdk4sock.so'
- PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(DBLIB) $(SOCKLIB) $(NSLLIB)'
- PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- RSHDOWNLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
- RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ WXDKDRAWLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4wx.so'
+ WXDKDRAWLIBS='-ldk4wx -ldk4gra -ldk4lat -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXBMPPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4c.so libdk4app.so libdk4bifa.so libdk4graa.so libdk4wx.so libdk4maioxd.so'
+ WXBMPPLIBS='-ldk4maioxd -ldk4wx -ldk4graa -ldk4bifa -ldk4app -ldk4c -ldk4gra -ldk4lat -ldk4bif -ldk4maiodh -ldk4maiodd -ldk4maiowh -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ BMPPLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maio8d.so libdk4maiowh.so libdk4maiowd.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4app.so libdk4lata.so libdk4bifa.so libdk4graa.so'
+ BMPPLIBS='-ldk4graa -ldk4bifa -ldk4lata -ldk4app -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maiowh -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ PLPDFTEXLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4bifa.so libdk4lata.so libdk4graa.so'
+ PLPDFTEXLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKCATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKCATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBLKSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBLKSLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKSQLSPLITLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKERADISKLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKERADISKLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKLSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKSORTLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKLINESLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4app.so'
+ DKLINESLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKFICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKRANDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKT2HLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKT2LLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4app.so libdk4lata.so'
+ DKT2LLIBS='-ldk4lata -ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBIN2CLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBIN2CLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKHEXLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKHEXLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBMMLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKPWDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maio8d.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4ma.so'
+ DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4maiodh.so libdk4maiowh.so libdk4maio8h.so'
+ DKSENDLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4ma -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
+ DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK4INFOLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ LPRNGCLLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
+ LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ WXDKFCSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
+ WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
+ WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRMONSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4maiodd.so libdk4maiodh.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRINTQDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4sock.so'
+ PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(DBLIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRINTQDCLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maio8d.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ RSHDOWNLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4sock.so'
+ RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ WXD2LATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4bifa.so libdk4lata.so libdk4graa.so'
+ WXD2LATLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaults" >&5
+$as_echo "defaults" >&6; }
;;
esac
-if [ "X$WGET" != "X" ]
+if [ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" -o "X$TOOLCHAIN" = "msvc" ]
then
- GETSOURCE='wget -O dktools-$(VERSNO) $(SFBASE)/dktools-$(VERSNO).tar.gz/download'
-elif [ "X$CURL" != "X" ]
-then
- GETSOURCE='curl -L $(SFBASE)/dktools-$(VERSNO).tar.gz > dktools-$(VERSNO).tar.gz'
+ case X$TARGETCLASS in
+ Xwindows)
+ ADDCTRLDRES='addctrldres.$(RESEXT)'
+ BMPPRES='bmppres.$(RESEXT)'
+ DK3INFORES='dk3infores.$(RESEXT)'
+ DK4INFORES='dk4infores.$(RESEXT)'
+ DKBIN2CRES='dk-bin2cres.$(RESEXT)'
+ DKBLKSRES='dk-blksres.$(RESEXT)'
+ DKBMMRES='dk-bmmres.$(RESEXT)'
+ DKCATRES='dk-catres.$(RESEXT)'
+ DKCTRES='dkctres.$(RESEXT)'
+ DKDB2TRES='dk-db2tres.$(RESEXT)'
+ DKDBCORES='dk-dbcores.$(RESEXT)'
+ DKDBTRES='dkdbtres.$(RESEXT)'
+ DKERADISKRES='dk-eradiskres.$(RESEXT)'
+ DKFICRES='dk-ficres.$(RESEXT)'
+ DKHEXRES='dk-hexres.$(RESEXT)'
+ DKLINESRES='dk-linesres.$(RESEXT)'
+ DKLSRES='dk-lsres.$(RESEXT)'
+ DKPWDRES='dk-pwdres.$(RESEXT)'
+ DKPWGENRES='dk-pwgenres.$(RESEXT)'
+ DKRANDRES='dk-randres.$(RESEXT)'
+ DKRECVRES='dk-recvres.$(RESEXT)'
+ DKSENDRES='dk-sendres.$(RESEXT)'
+ DKSORTRES='dk-sortres.$(RESEXT)'
+ DKSQLSPLITRES='dk-sqlsplitres.$(RESEXT)'
+ DKT2DBRES='dk-t2dbres.$(RESEXT)'
+ DKT2HRES='dk-t2hres.$(RESEXT)'
+ DKT2LRES='dk-t2lres.$(RESEXT)'
+ DKWTADMRES='dkwtadmres.$(RESEXT)'
+ DKWTRES='dkwtres.$(RESEXT)'
+ DKWXPATHRES='dkwxpathres.$(RESEXT)'
+ DKWXWIZRES='dkwxwizres.$(RESEXT)'
+ FIG2LATRES='fig2latres.$(RESEXT)'
+ HTMLBOOKRES='htmlbookres.$(RESEXT)'
+ ITADMINRES='itadminres.$(RESEXT)'
+ LPRNGCLRES='lprngclres.$(RESEXT)'
+ PLPDFTEXRES='plpdftexres.$(RESEXT)'
+ WINPRINTRES='winprintres.$(RESEXT)'
+ WPRCLEANRES='wprcleanres.$(RESEXT)'
+ WXBMPPRES='wxbmppres.$(RESEXT)'
+ WXDKCLOCKRES='wxdkclockres.$(RESEXT)'
+ WXDKCTRES='wxdkctres.$(RESEXT)'
+ WXDKFCSRES='wxdkfcsres.$(RESEXT)'
+ WXDKHTBRES='wxdkhtbres.$(RESEXT)'
+ WXDKSCRSZRES='wxdkscrszres.$(RESEXT)'
+ WXIMGSZRES='wximgszres.$(RESEXT)'
+ WXPQDICRES='wxpqdicres.$(RESEXT)'
+ ;;
+ esac
fi
-if [ "X$UNAME" = "XSunOS" -a "X$SOLCOR" = "Xyes" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking options for Windows" >&5
+$as_echo_n "checking options for Windows... " >&6; }
+WINCLILIB=''
+WINGUILIB=''
+CLILIB=''
+GUILIB=''
+if [ "X$BUILDCLASS" = "Xwindows" ]
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS on Solaris" >&5
-$as_echo_n "checking CFLAGS on Solaris... " >&6; }
- NETSNMP_LIBS=`echo $NETSNMP_LIBS | sed -f modsnmp.sed`
- TMPVAR="$WXCPPFLAGS"
- WXCPPFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCPPFLAGS="$WXCPPFLAGS $i"
- ;;
- "X-I*")
- WXCPPFLAGS="$WXCPPFLAGS $i"
- ;;
- esac
- done
- TMPVAR="$WXCXXFLAGS"
- WXCXXFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- "X-I*")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- "X-pthread")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- esac
- done
- TMPVAR="$WXCFLAGS"
- WXCFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- "X-I*")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- "X-pthread")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- esac
- done
- TMPVAR="$WXLDFLAGS"
- WXLDFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-L*")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- "X-l*")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- "X-pthread")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- esac
- done
- SOCKLIB='-lsocket'
- NSLLIB='-lnsl'
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
+ DELTARGET='@-IF EXIST "$@" DEL /F /Q "$@"'
+ DELTARGETSO='@-IF EXIST "$@.$(SOVERS)" DEL /F /Q "$@.$(SOVERS)"'
+else
+ DELTARGET='@-[ ! -f "$@" ] || rm -f "$@"'
+ DELTARGETSO='@-[ ! -f "$@.$(SOVERS)" ] || rm -f "$@.$(SOVERS)"'
fi
-
-if [ "X$ONWINDOWS" != "Xno" ]
+if [ "X$TARGETCLASS" = "Xwindows" ]
then
- CLILIB='$(WINCLILIB)'
- GUILIB='$(WINGUILIB)'
- ENTRY='$(WINENTRY)'
-else
- $as_echo "#define HAVE_INODES 1" >>confdefs.h
-
+ WINCLILIB='-lkernel32 -lgdi32 -ladvapi32 -luser32 -lnetapi32 -lwinspool'
+ WINGUILIB='-lole32 -loleaut32 -lshell32 -lcomctl32 -lcomdlg32'
+ CLILIB='$(WINCLILIB)'
+ GUILIB='$(WINGUILIB)'
fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking manpage installation" >&5
-$as_echo_n "checking manpage installation... " >&6; }
-case "X$MANINST" in
- "Xauto")
- if uname -a | grep -q Debian
- then
- MANINST='no'
- else
- MANINST='yes'
- fi
- ;;
-esac
-if [ "X$MANINST" = "Xno" ]
+if [ "X$TARGETCLASS" = "Xwindows" -a "X$TOOLCHAIN" = "Xgcc" ]
then
- INSTALLMANPAGES=''
+ WINGUILIB="-lwinmm -limm32 -luuid $WINGUILIB"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -municode"
+fi
+if [ "X$TARGETCLASS" = "Xwindows" -a "X$TOOLCHAIN" = "Xclang" ]
+then
+ WINGUILIB="-lwinmm -limm32 -luuid $WINGUILIB"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -municode"
+fi
+if [ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]
+then
+ case X$CROSSBUILD/X$ENA_PACKAGE in
+ Xyes/Xno)
+ LDFLC_CLI_C8="$LDFLC_CLI_C8 -static -static-libgcc -Wl,-Bstatic"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -static -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_C8="$LDFLCXX_CLI_C8 -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_DK="$LDFLCXX_CLI_DK -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_WX="$LDFLCXX_CLI_WX -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_GUI="$LDFLCXX_GUI -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ ;;
+ esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANINST" >&5
-$as_echo "$MANINST" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
-DBLIBSOCK="$DBLIB"
-if [ "X$UNAME" = "XSunOS" -a "X$SOLCOR" = "Xyes" ]
+LPRNGUSER='lp'
+LPRNGGROUP='lp'
+if [ -f /etc/debian_version ]
then
- [ "X$DBLIBSOCK" = "X" ] || DBLIBSOCK="$DBLIBSOCK -lrt "'$(SOCKLIB)'
- [ "X$DBLIB" = "X" ] || DBLIB="$DBLIB -lrt "
- [ "X$CRYPTO" = "X" ] || CRYPTO="$CRYPTO -lssl "'$(SOCKLIB)'
- [ "X$MYSQLLIB" = "X" ] || MYSQLLIB="$MYSQLLIB -lrt "'$(SOCKLIB)'
+ LPRNGUSER='daemon'
fi
-LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
@@ -14113,6 +16028,65 @@ LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
+# File name extensions
+# --------------------
+
+
+
+
+
+
+# Detected run path
+# -----------------
+
+
+# Detected features
+# -----------------
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS substituted: $CPPFLAGS" >&5
+$as_echo "$as_me: CPPFLAGS substituted: $CPPFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CFLAGS substituted: $CFLAGS" >&5
+$as_echo "$as_me: CFLAGS substituted: $CFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS substituted: $LDFLAGS" >&5
+$as_echo "$as_me: LDFLAGS substituted: $LDFLAGS" >&6;}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14271,7 +16245,115 @@ LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
-ac_config_files="$ac_config_files Makefile scripts/wr-dk3inst.sh scripts/wr-dk4inst.sh scripts/create-desktop-files.sh scripts/build-help.sh initd-printqd dktools.pc pkginfo debian/control"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
+
+
+
+
+
+cp debian/dktools-lib.install.in debian/dktools-lib-${SOVERS}.install
+cp debian/dktools-lib-dev.install.in debian/dktools-lib-${SOVERS}-dev.install
+echo package-name-doesnt-match-sonames > debian/dktools-lib-${SOVERS}.lintian-overrides
+
+
+
+ac_config_files="$ac_config_files Makefile scripts/write-files.sh scripts/build-help.sh initd-printqd initd-rshdown dktools.pc pkginfo debian/control debian/control9 debian/control8 debian/printqd.postrm debian/printqd.postinst debian/rshdown.postrm"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -14967,14 +17049,18 @@ do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "scripts/wr-dk3inst.sh") CONFIG_FILES="$CONFIG_FILES scripts/wr-dk3inst.sh" ;;
- "scripts/wr-dk4inst.sh") CONFIG_FILES="$CONFIG_FILES scripts/wr-dk4inst.sh" ;;
- "scripts/create-desktop-files.sh") CONFIG_FILES="$CONFIG_FILES scripts/create-desktop-files.sh" ;;
+ "scripts/write-files.sh") CONFIG_FILES="$CONFIG_FILES scripts/write-files.sh" ;;
"scripts/build-help.sh") CONFIG_FILES="$CONFIG_FILES scripts/build-help.sh" ;;
"initd-printqd") CONFIG_FILES="$CONFIG_FILES initd-printqd" ;;
+ "initd-rshdown") CONFIG_FILES="$CONFIG_FILES initd-rshdown" ;;
"dktools.pc") CONFIG_FILES="$CONFIG_FILES dktools.pc" ;;
"pkginfo") CONFIG_FILES="$CONFIG_FILES pkginfo" ;;
"debian/control") CONFIG_FILES="$CONFIG_FILES debian/control" ;;
+ "debian/control9") CONFIG_FILES="$CONFIG_FILES debian/control9" ;;
+ "debian/control8") CONFIG_FILES="$CONFIG_FILES debian/control8" ;;
+ "debian/printqd.postrm") CONFIG_FILES="$CONFIG_FILES debian/printqd.postrm" ;;
+ "debian/printqd.postinst") CONFIG_FILES="$CONFIG_FILES debian/printqd.postinst" ;;
+ "debian/rshdown.postrm") CONFIG_FILES="$CONFIG_FILES debian/rshdown.postrm" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -15568,255 +17654,161 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-chmod 755 scripts/*.sh
-
-cp debian/dktools-lib.install.in debian/dktools-lib-${SOVERS}.install
-cp debian/dktools-lib.postinst.in debian/dktools-lib-${SOVERS}.postinst
-cp debian/dktools-lib.postrm.in debian/dktools-lib-${SOVERS}.postrm
-cp debian/dktools-lib-dev.install.in debian/dktools-lib-${SOVERS}-dev.install
-echo package-name-doesnt-match-sonames > debian/dktools-lib-${SOVERS}.lintian-overrides
-chmod 644 debian/dktools-lib-${SOVERS}.install
-chmod 644 debian/dktools-lib-${SOVERS}.postinst
-chmod 644 debian/dktools-lib-${SOVERS}.postrm
-chmod 644 debian/dktools-lib-${SOVERS}-dev.install
-chmod 644 debian/dktools-lib-${SOVERS}.lintian-overrides
-
-[ ! -f dk4config ] || rm -f dk4config
-[ ! -f dk4config.o ] || rm -f dk4config.o
-[ ! -f dk3config ] || rm -f dk3config
-[ ! -f dk3config.o ] || rm -fr dk3config.o
-[ ! -f wxcs ] || rm -f wxcs
-[ ! -f wxcs.o ] || rm -fr wxcs.o
-
-if [ "X$build" != "X$host" ]
-then
- cp dk3conf.cross dk3conf.h
- cp dk4conf.cross dk4conf.h
- cp dk4wxcs.cross dk4wxcs.h
- echo 'ERROR: Cross-compiling not supported!'
-elif [ "X$SUITE" = "Xgui" ]
-then
- echo 'Build dk4config (C++)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- echo 'Build wxcs (C++)'
- $MAKE wxcs
- echo 'Generating configuration files'
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
- ./wxcs > dk4wxcs.h
-elif [ "X$CXX" != "X" ]
-then
- echo 'Build dk4config (C++)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- echo 'Generating configuration files'
- cp dk4wxcs.cross dk4wxcs.h
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
-else
- sed -f mod-dkconfig.sed < dk4config.cpp > dk4config.c
- mv dk4config.cpp dk4config.cpp.bck
- echo 'Build dk4config (C)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- mv dk4config.cpp.bck dk4config.cpp
- rm dk4config.c
- echo 'Generating configuration files'
- cp dk4wxcs.cross dk4wxcs.h
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
-fi
-sed -e 's/DK4/DK3/g' < dk4wxcs.h > dk3wxcs.h
-
-chmod 755 scripts/wr-dk4inst.sh
-echo './scripts/wr-dk4inst.sh > dk4inst.c'
-./scripts/wr-dk4inst.sh
-chmod 755 scripts/wr-dk3inst.sh
-./scripts/wr-dk3inst.sh > dk3inst.c
-chmod 755 scripts/create-desktop-files.sh
-./scripts/create-desktop-files.sh
-
-VERSNO=`cat version.txt`
-cat > dk4vers.h <<EOF
-#ifndef DK4VERS_H_INCLUDED
-#define DK4VERS_H_INCLUDED 1
-
-/** @file dk4vers.h Version number as text string.
-*/
-
-/** Version number in 8 bit characters.
-*/
-#define DKT_VERSION_C8 "$VERSNO"
-
-/** Version number in dkChar.
-*/
-#define DKT_VERSION_DK dkT("$VERSNO")
-
-#endif
-EOF
-
-cat > dk4verswx.h <<EOF
-#ifndef DK4VERSWX_H_INCLUDED
-/** Protection against multiple inclusions. */
-#define DK4VERSWX_H_INCLUDED 1
-/** @file dk4verswx.h Version number as wxChar string.
-*/
-
-#ifndef WX_WXPREC_H_INCLUDED
-#include "wx/wxprec.h"
-#define WX_WXPREC_H_INCLUDED 1
-#endif
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#ifndef WX_WX_H_INCLUDED
-#include "wx/wx.h"
-#define WX_WX_H_INCLUDED 1
-#endif
-#endif
-
-/** Version number as wxChar string.
-*/
-#define DKT_VERSION_WX wxT("$VERSNO")
-
-#endif
-EOF
+export FOUND_SYSTEMD
+chmod ugo+rx scripts/*.sh initd-printqd initd-rshdown
+scripts/write-files.sh
-echo ''
-echo 'Configuration summary'
-echo '====================='
-if [ "X$ZLIB" = "X-lz" ]
-then
-echo 'zlib: found.'
-else
-echo 'zlib: NOT found! Required!'
-echo ' SL 6.x package name: zlib-devel'
-echo ' Debian package name: libz-dev'
-echo ' URL: http://www.zlib.net'
-EXVAL=1
-fi
-if [ "X-lbz2" = "X$BZLIB" ]
-then
-echo 'libbz2: found.'
-else
-echo 'libbz2: NOT found! Recommended.'
-echo ' Bzip compression not available.'
-echo ' SL 6.x package name: bzip2-devel'
-echo ' Debian package name: libbz2-dev'
-echo ' URL: http://www.bzip.org'
-fi
-if [ "X$LIBPNG" = "X-lpng" ]
-then
-echo 'libpng: found.'
-else
-echo 'libpng: NOT found! Required!'
-echo ' SL 6.x package name: libpng-devel'
-echo ' Debian package name: libpng-dev'
-echo ' URL: http://www.libpng.org'
-EXVAL=1
-fi
-if [ "X$LIBJPEG" = "X-ljpeg" ]
-then
-echo 'libjpeg: found.'
-else
-echo 'libjpeg: NOT found! Recommended.'
-echo ' No JPEG support in bmpp and fig2lat.'
-echo ' SL 6.x package name: libjpeg-turbo-devel'
-echo ' Debian package name: libjpeg-dev'
-echo ' URL: http://www.ijg.org/'
-fi
-if [ "X$LIBTIFF" = "X-ltiff" ]
-then
-echo 'libtiff: found.'
-else
-echo 'libtiff: NOT found! Recommended.'
-echo ' No TIFF support in bmpp and fig2lat.'
-echo ' SL 6.x package name: libtiff-devel'
-echo ' Debian package name: libtiff-dev'
-echo ' URL: http://www.remotesensing.org/libtiff/'
-fi
-if [ "X$ANYDB" != "X" ]
+if [ "X$CROSSBUILD" = "Xyes" -o "X$MAKE" = "X" ]
then
-echo "database: $ANYDB"
-else
-echo 'database: NOT found! Recommended.'
-echo ' Skipping printqd build!'
-echo ' SL 6.x package name: db4-devel'
-echo ' Debian package name: libdb-dev'
-echo ' URL: http://www.oracle.com/database/berkeley-db/'
-fi
-if [ "X$MYSQLPROG" = "Xmysqlprog" ]
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Fix configure results: Use sed" >&5
+$as_echo "$as_me: Fix configure results: Use sed" >&6;}
+ (
+ cat dk4conf.h.start
+ grep '#define' config.h | awk '{print $2 " " $3;}' | grep -v CONFIG_H_INCLUDED | sort | sed -e 's/^/#define DK4_/g'
+ cat dk4conf.h.large
+ cat dk4conf.h.end
+ ) > dk4conf.h
+ (
+ cat dk3conf.h.start
+ grep '#define' config.h | awk '{print $2 " " $3;}' | grep -v CONFIG_H_INCLUDED | sort | sed -e 's/^/#define DK3_/g'
+ cat dk3conf.h.large
+ cat dk3conf.h.end
+ ) > dk3conf.h
+ cp dk4wxcs.cross dk4wxcs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Fix configure results: Run programs" >&5
+$as_echo "$as_me: Fix configure results: Run programs" >&6;}
+ [ ! -f "dk4config${EXEEXT}" ] || rm -f "dk4config${EXEEXT}"
+ [ ! -f "dk4wxcs${EXEEXT}" ] || rm -f "dk4wxcs${EXEEXT}"
+ [ ! -f "dk3config${EXEEXT}" ] || rm -f "dk3config${EXEEXT}"
+ ${MAKE} dk4config${EXEEXT} dk3config${EXEEXT} dk4wxcs${EXEEXT}
+ (
+ cat dk4conf.h.start
+ ./dk4config${EXEEXT}
+ cat dk4conf.h.end
+ ) > dk4conf.h
+ ./dk3config${EXEEXT} > dk3conf.h
+ ./dk4wxcs${EXEEXT} > dk4wxcs.h
+ sed -e 's/DK4/DK3/g' < dk4wxcs.h > dk3wxcs.h
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Software suite: $SUITE" >&5
+$as_echo "$as_me: Software suite: $SUITE" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build static libraries: $ENA_STATIC" >&5
+$as_echo "$as_me: Build static libraries: $ENA_STATIC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build shared libraries: $ENA_SHARED" >&5
+$as_echo "$as_me: Build shared libraries: $ENA_SHARED" >&6;}
+if [ "X$ENA_SHARED" = "Xyes" ]
then
-echo 'MySQL: found.'
-else
-echo 'MySQL: NOT found! Recommended.'
-echo ' Skipping itadmin build.'
-echo ' SL 6.x package name: mysql-devel'
-echo ' Debian package name: libmysqlclient-dev'
-echo ' URL: http://www.mysql.com/'
-fi
-if [ "X$CRYPTO" != "X" ]
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build for package generation: $ENA_PACKAGE" >&5
+$as_echo "$as_me: Build for package generation: $ENA_PACKAGE" >&6;}
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Link shared libs with shared libs: $ENA_SOSO" >&5
+$as_echo "$as_me: Link shared libs with shared libs: $ENA_SOSO" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Install man pages: $ENA_MAN" >&5
+$as_echo "$as_me: Install man pages: $ENA_MAN" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Activate more warnings: $ENA_WARN" >&5
+$as_echo "$as_me: Activate more warnings: $ENA_WARN" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Allow debug information: $ENA_DEBUG" >&5
+$as_echo "$as_me: Allow debug information: $ENA_DEBUG" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Corrections for SunOS: $ENA_SUNOS_CORR" >&5
+$as_echo "$as_me: Corrections for SunOS: $ENA_SUNOS_CORR" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build host: $BUILDHOST" >&5
+$as_echo "$as_me: Build host: $BUILDHOST" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Build class: $BUILDCLASS" >&5
+$as_echo "$as_me: Build class: $BUILDCLASS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Target host: $TARGETHOST" >&5
+$as_echo "$as_me: Target host: $TARGETHOST" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Target class: $TARGETCLASS" >&5
+$as_echo "$as_me: Target class: $TARGETCLASS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Cross compilation build: $CROSSBUILD" >&5
+$as_echo "$as_me: Cross compilation build: $CROSSBUILD" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Tool chain: $TOOLCHAIN" >&5
+$as_echo "$as_me: Tool chain: $TOOLCHAIN" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: C compiler: $CC" >&5
+$as_echo "$as_me: C compiler: $CC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: C++ compiler: $CXX" >&5
+$as_echo "$as_me: C++ compiler: $CXX" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS: $CPPFLAGS" >&5
+$as_echo "$as_me: CPPFLAGS: $CPPFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CFLAGS: $CFLAGS" >&5
+$as_echo "$as_me: CFLAGS: $CFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS: $LDFLAGS" >&5
+$as_echo "$as_me: LDFLAGS: $LDFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Libraries and functions:" >&5
+$as_echo "$as_me: Libraries and functions:" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: socket $FOUND_SOCKET" >&5
+$as_echo "$as_me: socket $FOUND_SOCKET" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: zlib $FOUND_ZLIB" >&5
+$as_echo "$as_me: zlib $FOUND_ZLIB" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: libbz2 $FOUND_BZLIB" >&5
+$as_echo "$as_me: libbz2 $FOUND_BZLIB" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: libpng $FOUND_PNG" >&5
+$as_echo "$as_me: libpng $FOUND_PNG" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: libjpeg $FOUND_JPG" >&5
+$as_echo "$as_me: libjpeg $FOUND_JPG" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: libtiff $FOUND_TIFF" >&5
+$as_echo "$as_me: libtiff $FOUND_TIFF" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: OpenSSL $FOUND_OPENSSL" >&5
+$as_echo "$as_me: OpenSSL $FOUND_OPENSSL" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: NetSNMP $FOUND_NETSNMP" >&5
+$as_echo "$as_me: NetSNMP $FOUND_NETSNMP" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: MySQL / MariaDB $FOUND_MYSQL" >&5
+$as_echo "$as_me: MySQL / MariaDB $FOUND_MYSQL" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: wxWidgets $FOUND_WX" >&5
+$as_echo "$as_me: wxWidgets $FOUND_WX" >&6;}
+
+if [ "X$CROSSBUILD" = "Xyes" ]
then
-echo 'OpenSSL: found.'
-else
-echo 'OpenSSL: NOT found!'
-echo ' SL 6.x package name: openssl-devel'
-echo ' Debian package name: libssl-dev'
-echo ' URL: http://www.openssl.org/'
-fi
-if [ "X$WXCPPFLAGS" != "X" ]
-then
-echo 'wxWidgets: found.'
-else
-echo 'wxWidgets: NOT found!'
-echo ' SL 6.x package name: wxGTK-devel'
-echo ' Debian package name: libwxgtk3.0-dev'
-echo ' URL: http://www.wxwidgets.org/'
-fi
-case "X$SUITE" in
-"Xgui")
-echo 'Software bundle: CLI and GUI programs'
-;;
-"Xrescue")
-echo 'Software bundle: Rescue system programs'
-;;
-"*")
-echo 'Software bundle: CLI programs'
-;;
-esac
-if [ "X$ENASTATIC" = "Xyes" ]
-then
-echo 'Install static libraries: yes'
-else
-echo 'Install static libraries: no'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CROSS-COMPILATION BUILD:" >&5
+$as_echo "$as_me: CROSS-COMPILATION BUILD:" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Test for twos complement not possible!" >&5
+$as_echo "$as_me: WARNING: Test for twos complement not possible!" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Test for IEEE 754 compliant double not possible!" >&5
+$as_echo "$as_me: WARNING: Test for IEEE 754 compliant double not possible!" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Test for /proc/.../exe not possible!" >&5
+$as_echo "$as_me: WARNING: Test for /proc/.../exe not possible!" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Results for these tests are guessed and may be wrong." >&5
+$as_echo "$as_me: WARNING: Results for these tests are guessed and may be wrong." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Before you continue check the following settings," >&5
+$as_echo "$as_me: WARNING: Before you continue check the following settings," >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: apply corrections if necessary:" >&5
+$as_echo "$as_me: WARNING: apply corrections if necessary:" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - HAVE_TWOS_COMPLEMENT in file config.h" >&5
+$as_echo "$as_me: WARNING: - HAVE_TWOS_COMPLEMENT in file config.h" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - HAVE_IEEE_754_DOUBLE in file config.h" >&5
+$as_echo "$as_me: WARNING: - HAVE_IEEE_754_DOUBLE in file config.h" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - HAVE_PROC_PID_EXE in file config.h" >&5
+$as_echo "$as_me: WARNING: - HAVE_PROC_PID_EXE in file config.h" >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Run \"make confprogs\" if corrections were necessary." >&5
+$as_echo "$as_me: WARNING: Run \"make confprogs\" if corrections were necessary." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Before running \"make\" and \"make install\" transfer the programs" >&5
+$as_echo "$as_me: Before running \"make\" and \"make install\" transfer the programs" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: dk3config${EXEEXT}, dk4config${EXEEXT} and dk4wxcs${EXEEXT}" >&5
+$as_echo "$as_me: dk3config${EXEEXT}, dk4config${EXEEXT} and dk4wxcs${EXEEXT}" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: to the target system and run the commands" >&5
+$as_echo "$as_me: to the target system and run the commands" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ./dk3config > dk3conf.h" >&5
+$as_echo "$as_me: ./dk3config > dk3conf.h" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ./dk4config > dk4conf.h" >&5
+$as_echo "$as_me: ./dk4config > dk4conf.h" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ./dk4wxcs > dk4wxcs.h" >&5
+$as_echo "$as_me: ./dk4wxcs > dk4wxcs.h" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: on the target system." >&5
+$as_echo "$as_me: on the target system." >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Transfer the files dk3conf.h, dk4conf.h and dk4wxcs.h back to" >&5
+$as_echo "$as_me: Transfer the files dk3conf.h, dk4conf.h and dk4wxcs.h back to" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: here. At the start of dk4conf.h insert the dk4conf.h.start file." >&5
+$as_echo "$as_me: here. At the start of dk4conf.h insert the dk4conf.h.start file." >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: At the end of dk4conf.h insert the dk4conf.h.end file." >&5
+$as_echo "$as_me: At the end of dk4conf.h insert the dk4conf.h.end file." >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Now continue the build process." >&5
+$as_echo "$as_me: Now continue the build process." >&6;}
fi
-if [ "X$ENASHARED" = "Xyes" ]
-then
-echo 'Install shared libraries: yes'
-else
-echo 'Install shared libraries: no'
-fi
-if [ "X$USESOLINKING" = "Xyes" ]
-then
-echo 'Nested shared library linking: yes'
-else
-echo 'Nested shared library linking: no'
-fi
-if [ "X$ENAPACKAGING" = "Xyes" ]
-then
-echo 'Binaries use shared libraries: yes'
-else
-echo 'Binaries use shared libraries: no'
-fi
-echo ''
-echo The INSTALL files describes how to install via '*.rpm' or '.deb' package.
-echo ''
-exit $EXVAL
-
diff --git a/support/dktools/configure.ac b/support/dktools/configure.ac
index e296baa982..5f197bf7cd 100644
--- a/support/dktools/configure.ac
+++ b/support/dktools/configure.ac
@@ -1,709 +1,633 @@
dnl configure-script
AC_INIT(dk4.h)
+
+dnl Inspect tool chain
+dnl ==================
+
+dnl Check available tools
+dnl ---------------------
AC_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
-AC_C_BIGENDIAN
AC_PROG_MKDIR_P
AC_PROG_SED
AC_PROG_INSTALL
AC_PROG_LN_S
-AC_CANONICAL_HOST
-AC_CANONICAL_BUILD
AC_CHECK_TOOL([RANLIB],[ranlib],[:])
AC_CHECK_TOOL([AR],[ar],[ar])
AC_CHECK_TOOL([NM],[nm],[nm])
+AC_CHECK_TOOL([WINDRES],[windres],[:])
+AC_CHECK_TOOL([PKG_CONFIG],[pkg-config],[:])
+MAKE=''
+GMAKE=''
+AC_CHECK_PROG(MAKE,make,make)
+AC_CHECK_PROG(GMAKE,gmake,gmake)
+
+dnl For unavailable tools replace tool invokation by warning
+dnl --------------------------------------------------------
+if [[ "X$RANLIB" = "X:" ]]
+then
+ RANLIB='@echo No need to run ranlib'
+fi
-echo 'CC = ' $CC `which $CC`
-echo 'CXX = ' $CXX `which $CXX`
+dnl Download programs to download original source
+dnl ---------------------------------------------
+AC_CHECK_PROG(WGET,wget,wget)
+AC_CHECK_PROG(CURL,curl,curl)
+GETSOURCE='@echo "ERROR: Neither wget nor curl available!" && false'
+if [[ "X$WGET" != "X" ]]
+then
+ GETSOURCE='wget -O dktools-$(VERSNO)'
+ GETSOURCE="$GETSOURCE"' $(SFBASE)/dktools-$(VERSNO).tar.gz/download'
+elif [[ "X$CURL" != "X" ]]
+then
+ GETSOURCE='curl -L $(SFBASE)/dktools-$(VERSNO).tar.gz'
+ GETSOURCE="$GETSOURCE "'> dktools-$(VERSNO).tar.gz'
+fi
-dnl Some default values
+dnl Prefer gmake over make
+dnl -----------------------
+if [[ "X$MAKE" = "X" -a "X$GMAKE" != "X" ]]
+then
+ MAKE="$GMAKE"
+fi
-dnl If shared library A uses procedures from shared library B we can
-dnl either use -lB when building library A or build libraries indepently
-dnl one from another and use -lA -lB when building executables using
-dnl library A and probably B.
-dnl The first variant is called SOLINKING here.
+dnl Check build and target system and cross-compile
+dnl ===============================================
+AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
+WHICHCC=`which $CC`
+WHICHCXX=`which $CXX`
+BUILDHOST="$build"
+TARGETHOST="$host"
+BUILDCLASS='posix'
+TARGETCLASS='posix'
+CROSSBUILD='no'
+UNAME=`uname -s`
+case X$TARGETHOST in
+ Xx86_64-w64-mingw32|Xx86_64-w32-mingw32)
+ TARGETCLASS='windows'
+ ;;
+esac
+case X$BUILDHOST in
+ Xx86_64-w64-mingw32|Xx86_64-w32-mingw32)
+ BUILDCLASS='windows'
+ ;;
+esac
+if [[ "X$BUILDHOST" != "X$TARGETHOST" ]]
+then
+ CROSSBUILD='yes'
+fi
+TOOLCHAIN='unknown'
+case X$CC in
+ Xgcc|X*gcc)
+ TOOLCHAIN='gcc'
+ ;;
+ Xclang|X*clang)
+ TOOLCHAIN='clang'
+ ;;
+ Xcc)
+ if [[ "X$UNAME" = "XSunOS" ]]
+ then
+ TOOLCHAIN='workshop'
+ fi
+ ;;
+ Xcl|XCL)
+ TOOLCHAIN='msvc'
+ ;;
+esac
-dnl Force the SOLINKING mechanism.
-FORCESOLINKING="no"
+dnl Find resource compiler depending on tool chain
+dnl ----------------------------------------------
+if [[ "X$WINDRES" = "X:" -a "X$TOOLCHAIN" = "Xmsvc" ]]
+then
+ WINDRES='RC'
+elif [[ "X$WINDRES" = "X:" ]]
+then
+ WINDRES='@echo "ERROR: No windows resouce compiler available!"'
+fi
-dnl Default value for SOLINKING when not forced.
-USESOLINKING="no"
+dnl Current year
+dnl ============
+THISYEAR=`date '+%Y'`
-dnl Makefile target to install man pages.
-dnl We install man pages from the Makefile on non-Debian systems.
-dnl On Debian man pages are handled by the package building system.
-INSTALLMANPAGES='install-manpages'
+dnl Compiler flags for extra warnings
+dnl =================================
-LIBSPRIVATE=""
+dnl C and C++ compiler flags for gcc and clang
+dnl ------------------------------------------
-dnl Automatically find whether or not to install man pages.
-MANINST='auto'
+dnl Extra warnings
+GCCWARNFLAGS="-Wall -Wextra"
+GCXXWARNFLAGS="-Wall -Wextra"
-dnl Exit status code.
-EXVAL=0
+dnl Overlong strings
+GCCWARNFLAGS="$GCCWARNFLAGS -Woverlength-strings"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Woverlength-strings"
+
+dnl If structures are padded there is nothing we can do
+dnl GCCWARNFLAGS="$GCCWARNFLAGS -Wpadded"
+dnl GCXXWARNFLAGS="$GCXXWARNFLAGS -Wpadded"
+
+dnl Redundant declarations
+GCCWARNFLAGS="$GCCWARNFLAGS -Wredundant-decls"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wredundant-decls"
+
+dnl Suspicious logical operators in expressions
+GCCWARNFLAGS="$GCCWARNFLAGS -Wlogical-op"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wlogical-op"
+
+dnl Functions returning entire structures (used by wxWidgets)
+GCCWARNFLAGS="$GCCWARNFLAGS -Waggregate-return"
+dnl GCXXWARNFLAGS="$GCXXWARNFLAGS -Waggregate-return"
+
+dnl Prototypes required before function use
+GCCWARNFLAGS="$GCCWARNFLAGS -Wstrict-prototypes"
+
+dnl Old style (K+R) function definition
+GCCWARNFLAGS="$GCCWARNFLAGS -old-style-definition"
+dnl GCXXWARNFLAGS="$GCXXWARNFLAGS -old-style-definition"
+
+dnl Prototype missing for global function
+GCCWARNFLAGS="$GCCWARNFLAGS -Wmissing-prototypes"
+
+dnl Global function defined without a previous prototype
+GCCWARNFLAGS="$GCCWARNFLAGS -Wmissing-declarations"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wmissing-declarations"
+
+dnl "extern" definition in a function
+GCCWARNFLAGS="$GCCWARNFLAGS -Wnested-externs"
+
+dnl Unreachable code in program
+GCCWARNFLAGS="$GCCWARNFLAGS -Wunreachable-code"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wunreachable-code"
+
+dnl Failed to inline a function
+GCCWARNFLAGS="$GCCWARNFLAGS -Winline"
+
+dnl Invalid PCH file found
+GCCWARNFLAGS="$GCCWARNFLAGS -Winvalid-pch"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Winvalid-pch"
+
+dnl Variable length array
+GCCWARNFLAGS="$GCCWARNFLAGS -Wvla"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wvla"
+
+dnl Signed pointers
+GCCWARNFLAGS="$GCCWARNFLAGS -Wpointer-sign"
+
+dnl Stack protector can not handle some function
+GCCWARNFLAGS="$GCCWARNFLAGS -Wstack-protector"
+GCXXWARNFLAGS="$GCXXWARNFLAGS -Wstack-protector"
-dnl Flag: Apply corrections for Solaris.
-SOLCOR='no'
-dnl C compiler options for relocatable modules.
-CFPIC=''
-MKSOLIB=''
-SHLIBSTYLE=''
-UNAME=''
-WXCPPFLAGS=''
-WXCXXFLAGS=''
-WXCFLAGS=''
-WXLDFLAGS=''
-SUITE='auto'
-ENASTATIC='auto'
-ENASHARED='auto'
-PROGRAMS=''
-LIBRARIES=''
-LIBS_STATIC=''
-LIBS_SHARED=''
-LIBS_INSTALL=''
-RES_INSTALL=''
-RPATH=''
-RPATHLINK=''
-CWARN=''
-FOUND_GDBM='no'
-FOUND_NDBM='no'
-FOUND_BDB='no'
-USE_NDBM='auto'
-NET_PROG_RES=''
-NET_PROG_CLI=''
-MYSQL_PROG_CLI=''
-SNMP_PROG_CLI=''
-MYSQLLDFLAGS=''
-MYSQLLIB=''
-RTLIB=''
-SOLIBZ=''
-SOLIBBZ=''
-SOLIBMATH=''
-SOLIBCRYPTO=''
-SOLIBNET=''
-SOLIBIMG=''
-SOLIBSDBI=''
-SOLIBWX=''
-SOLIBDK3PORT=''
-SOLIBDK3C=''
-SOLIBDK3OF=''
-SOLIBDK3CSRND=''
-SOLIBDK3BIF=''
-SOLIBDK3DBI=''
-SOLIBDK3FIG=''
-SOLIBDK3BMEPS=''
-SOLIBDK3NET=''
-SOLIBDK4BASE=''
-SOLIBDK4MA=''
-SOLIBDK4MAIO8H=''
-SOLIBDK4MAIOWH=''
-SOLIBDK4MAIODH=''
-SOLIBDK4MAIO8D=''
-SOLIBDK4MAIOWD=''
-SOLIBDK4MAIODD=''
-SOLIBDK4C=''
-SOLIBDK4MDRND=''
-SOLIBDK4PPPT=''
-SOLIBDK4APP=''
-SOLIBDK4LAT=''
-SOLIBDK4SOCK=''
-SOLIBDK4SOCKA=''
-SOLIBDK4DBI=''
-SOLIBDK4DBIA=''
-LIBDK4BASELIBF=''
-LIBDK4BASELIBS=''
-LIBDK4MALIBF=''
-LIBDK4MALIBS=''
-LIBDK4MAIO8DLIBF=''
-LIBDK4MAIO8DLIBS=''
-LIBDK4MAIOWDLIBF=''
-LIBDK4MAIOWDLIBS=''
-LIBDK4MAIODDLIBF=''
-LIBDK4MAIODDLIBS=''
-LIBDK4MAIOXDLIBF=''
-LIBDK4MAIOXDLIBS=''
-LIBDK4MAIO8HLIBF=''
-LIBDK4MAIO8HLIBS=''
-LIBDK4MAIOWHLIBF=''
-LIBDK4MAIOWHLIBS=''
-LIBDK4MAIODHLIBF=''
-LIBDK4MAIODHLIBS=''
-LIBDK4DBILIBF=''
-LIBDK4DBILIBS=''
-LIBDK4CLIBF=''
-LIBDK4CLIBS=''
-LIBDK4LATLIBF=''
-LIBDK4LATLIBS=''
-LIBDK4SOCKLIBF=''
-LIBDK4SOCKLIBS=''
-LIBDK4MDRNDLIBF=''
-LIBDK4MDRNDLIBS=''
-LIBDK4PPPTLIBF=''
-LIBDK4PPPTLIBS=''
-LIBDK4APPLIBF=''
-LIBDK4APPLIBS=''
-LIBDK4PPPTALIBF=''
-LIBDK4PPPTALIBS=''
-LIBDK4SOCKALIBF=''
-LIBDK4SOCKALIBS=''
-LIBDK4DBIALIBF=''
-LIBDK4DBIALIBS=''
-LIBDK4WXLIBF=''
-LIBDK4WXLIBS=''
-LIBDK3TRACELIBF=''
-LIBDK3TRACELIBS=''
-LIBDK3CLIBF=''
-LIBDK3CLIBS=''
-LIBDK3OFLIBF=''
-LIBDK3OFLIBS=''
-LIBDK3CSRNDLIBF=''
-LIBDK3CSRNDLIBS=''
-LIBDK3BIFLIBF=''
-LIBDK3BIFLIBS=''
-LIBDK3DBILIBF=''
-LIBDK3DBILIBS=''
-LIBDK3BMEPSLIBF=''
-LIBDK3BMEPSLIBS=''
-LIBDK3FIGLIBF=''
-LIBDK3FIGLIBS=''
-LIBDK3WXLIBF=''
-LIBDK3WXLIBS=''
+dnl Output first summary before going into details
+dnl ==============================================
+
+dnl Show system information
+dnl -----------------------
+AC_MSG_NOTICE([Options: $*])
+AC_MSG_NOTICE([CC = $CC $WHICHCC])
+AC_MSG_NOTICE([CXX = $CXX $WHICHCXX])
+AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
+AC_MSG_NOTICE([CFLAGS: $CFLAGS])
+AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
+AC_MSG_NOTICE([Building on: $BUILDHOST $BUILDCLASS])
+AC_MSG_NOTICE([Building for: $TARGETHOST $TARGETCLASS])
+AC_MSG_NOTICE([Cross build: $CROSSBUILD])
+
+dnl Complain when pkg-config is missing for cross builds
+dnl ----------------------------------------------------
+if [[ "X$PKG_CONFIG" = "X:" -a "X$CROSSBUILD" = "Xyes" ]]
+then
+ AC_MSG_WARN([Cross building, but no pkg-config available!])
+fi
+
+dnl Package version information
+dnl ===========================
VERSNO=`cat version.txt`
SOVERS=`echo $VERSNO | sed -e 's/\.[[01-9]][[01-9]]*$//'`
-ENAPACKAGING="auto"
-LIB_SH_RES='$(LIB_SH_RES_NO_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_NO_PACKAGING)'
-UNAME=`uname -s`
-GETSOURCE='@echo "ERROR: Neither wget nor curl available, can not download source!" && false'
-WGET=''
-CURL=''
-CLILIB=''
-GUILIB=''
-ENTRY=''
-ONWINDOWS='no'
-WINUNICODE=''
-FOUNDINLINE="no"
-USEINLINE="no"
-CROSSCOMPILING="no"
-MAKE="echo No make program found to build"
+dnl Compiler and linker flags defaults
+dnl ==================================
+
+dnl C flags to compile a CLI module using char
+CFL_CLI_C8='$(CPPFLAGS) $(CFLAGS)'
+
+dnl C flags to compile a CLI module using dkChar
+CFL_CLI_DK='$(CPPFLAGS) $(CFLAGS)'
+
+dnl C++ flags to compile a CLI module using char
+CXXFL_CLI_C8='$(CPPFLAGS) $(CXXFLAGS)'
+
+dnl C++ flags to compile a CLI module using dkChar
+CXXFL_CLI_DK='$(CPPFLAGS) $(CXXFLAGS)'
+
+dnl C++ flags to compile a CLI module using wxChar
+CXXFL_CLI_WX='$(CPPFLAGS) $(CXXFLAGS)'
+
+dnl C++ flags to compile a GUI module using wxChar
+CXXFL_GUI='$(CPPFLAGS) $(CXXFLAGS)'
+
+dnl Linker flags to use CC to link a CLI program using char
+LDFLC_CLI_C8='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+dnl Linker flags to use CC to link a CLI program using dkChar
+LDFLC_CLI_DK='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+dnl Linker flags to use C++ to link a CLI program using char
+LDFLCXX_CLI_C8='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+dnl Linker flags to use C++ to link a CLI program using dkChar
+LDFLCXX_CLI_DK='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+dnl Linker flags to use C++ to link a CLI program using wxChar
+LDFLCXX_CLI_WX='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+dnl Linker flags to use C++ to link a GUI program using wxChar
+LDFLCXX_GUI='$(CPPFLAGS) -L. $(LDFLAGS) $(RPATH) $(RPATHLINK)'
+
+dnl Add RPATH to linker flags on Solaris when using workshop compiler
+RPATH=''
+RPATHLINK=''
+MKSORPATH=''
+MKSORPATHLINK=''
+MKSOCHECKSYMBOLS=''
-AC_MSG_CHECKING(GNU make)
-gmake maketest > /dev/null 2>&1
-if [[ "X$?" = "X0" ]]
+if [[ "X$LD_LIBRARY_PATH" != "X" -a "X$TOOLCHAIN" = "Xworkshop" ]]
then
- MAKE='gmake'
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
+ RPATH="-R${LD_LIBRARY_PATH}"
fi
-AC_MSG_CHECKING(make)
-make maketest > /dev/null 2>&1
-if [[ "X$?" = "X0" ]]
+dnl Options
+dnl =======
+
+dnl Suite of programs (programs for rescue system, CLI progs, GUI progs)
+dnl --------------------------------------------------------------------
+SUITE='auto'
+AC_ARG_WITH(suite,[AS_HELP_STRING([--with-suite],[Software suite to build (auto / gui / cli / rescue)])],[SUITE=$withval])
+if [[ "X$SUITE" != "Xgui" -a "X$SUITE" != "Xcli" -a "X$SUITE" != "Xrescue" ]]
then
- MAKE='make'
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
+ SUITE='auto'
fi
-dnl Check whether to build shared/static libraries
-AC_ARG_ENABLE(inline,[AS_HELP_STRING([--enable-inline],[Allow use of inline keyword (no / yes)])],[USEINLINE="$enableval"])
-AC_ARG_ENABLE(static,[AS_HELP_STRING([--enable-static],[Allow building static libraries (yes / no)])],[ENASTATIC="$enableval"])
-AC_ARG_ENABLE(shared,[AS_HELP_STRING([--enable-shared],[Allow building shared libraries (yes / no)])],[ENASHARED="$enableval"])
-AC_ARG_ENABLE(packaging,[AS_HELP_STRING([--enable-packaging],[Binaries use shared libraries (no / yes)])],[ENAPACKAGING="$enableval"])
-AC_ARG_ENABLE(ndbm,[AS_HELP_STRING([--enable-ndbm],[Explicitly enable/disable NDBM if found])],[USE_NDBM="$enableval"])
-AC_ARG_ENABLE(warnings,[AS_HELP_STRING([--enable-warnings],[Enable high warning level, gcc only (yes / no)])],[WARNVAL="$enableval"])
-AC_ARG_ENABLE(more-warnings,[AS_HELP_STRING([--enable-more-warnings],[Enable yet more warnings, gcc only (no / yes)])],[WARNMOREVAL="$enableval"])
-AC_ARG_WITH(suite,[AS_HELP_STRING([--with-suite=name],[Software suite to build: auto / gui / cli / rescue])],[SUITE="$withval"])
-AC_ARG_WITH(man,[AS_HELP_STRING([--with-man],[Install man pages (auto / yes / no)])],[MANINST="$withval"])
-AC_ARG_WITH(corrections,[AS_HELP_STRING([--with-corrections],[Enable corrections for Solaris: no / yes])],[SOLCOR="$withval"])
+dnl Directory for systemd service unit files
+dnl ----------------------------------------
+FOUND_SYSTEMD='no'
+ENA_SYSTEMD='auto'
+systemddir=''
+AC_ARG_WITH(systemd,[AS_HELP_STRING([--with-systemd=DIR],[Directory for service unit files / yes / no])],[systemddir=$withval;FOUND_SYSTEMD='yes';ENA_SYSTEMD='yes'])
+if [[ "X$systemddir" = "Xyes" ]]
+then
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ systemddir=''
+elif [[ "X$systemddir" = "Xno" ]]
+then
+ ENA_SYSTEMD='no'
+ FOUND_SYSTEMD='no'
+ systemddir=''
+fi
-if [[ "X$SOLCOR" = "Xyes" -a "X$UNAME" != "XSunOS" ]]
+dnl Compatibility for specific Windows version, Windows 7 is default
+dnl ----------------------------------------------------------------
+WIN_VER_TEXT='auto'
+WINVER=0x0601
+AC_ARG_WITH(windows,[AS_HELP_STRING([--with-windows],[Compile for Windows version (7 / XP)])],[
+WIN_VER_TEXT=$withval
+if [[ "X$TARGETCLASS" != "Xwindows" ]]
then
- echo 'ERROR: The --with-corrections option is for Solaris/SunOS only!'
- SOLCOR='no'
+AC_MSG_WARN([Option --with-windows=... is for Windows builds only!])
+fi
+])
+case X$WIN_VER_TEXT in
+ X7)
+ WINVER=0x0601
+ ;;
+ XXP)
+ WINVER=0x0501
+ ;;
+ *)
+ WINVER=0x0601
+ ;;
+esac
+if [[ "X$TARGETCLASS" = "Xwindows" ]]
+then
+ CPPFLAGS="$CPPFLAGS -DWINVER=$WINVER -D_WIN32_WINNT=$WINVER"
+ CFLAGS="$CFLAGS -DWINVER=$WINVER -D_WIN32_WINNT=$WINVER"
+ CFL_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CFL_CLI_C8"
+ CFL_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CFL_CLI_DK"
+ CXXFL_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_C8"
+ CXXFL_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_DK"
+ CXXFL_CLI_WX="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_CLI_WX"
+ CXXFL_GUI="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $CXXFL_GUI"
+ LDFLC_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLC_CLI_C8"
+ LDFLC_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLC_CLI_DK"
+ LDFLCXX_CLI_C8="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_C8"
+ LDFLCXX_CLI_DK="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_DK"
+ LDFLCXX_CLI_WX="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_CLI_WX"
+ LDFLCXX_GUI="-DWINVER=$WINVER -D_WIN32_WINNT=$WINVER $LDFLCXX_GUI"
fi
-if [[ "X$host" != "X$build" ]]
+dnl Enable developer support installation
+dnl -------------------------------------
+ENA_DEVEL='yes'
+AC_ARG_ENABLE(devel,[AS_HELP_STRING([--enable-devel],[Enable developer support (yes / no)])],[ENA_DEVEL=$enableval])
+if [[ "X$ENA_DEVEL" != "Xno" ]]
then
- echo 'Building on: ' $build
- echo 'Building for:' $host
- CROSSCOMPILING="yes"
- case "X$SUITE" in
- "gui")
- echo "Warning: Cross-compiling, switching suite to cross."
- ;;
- "cli")
- echo "Warning: Cross-compiling, switching suite to cross."
- ;;
- esac
- SUITE="cross"
+ ENA_DEVEL='yes'
fi
-case "X$ENAPACKAGING" in
- "Xauto")
- if [[ "X$SUITE" = "Xrescue" ]]
- then
- ENAPACKAGING="yes"
- else
- ENAPACKAGING="no"
- fi
- ;;
- "Xyes")
- ENAPACKAGING="yes"
- ;;
- *)
- ENAPACKAGING="no"
- ;;
-esac
+dnl Enable static linking (auto, yes, no)
+dnl -------------------------------------
+ENA_STATIC='auto'
+AC_ARG_ENABLE(static,[AS_HELP_STRING([--enable-static],[Build static libraries (yes / no)])],[ENA_STATIC=$enableval])
-dnl Check how to build shared libraries
-UNAME=`uname -s`
-if [[ "X$CC" = "Xgcc" ]]
+dnl Enable shared linking (auto, yes, no)
+dnl -------------------------------------
+ENA_SHARED='auto'
+AC_ARG_ENABLE(shared,[AS_HELP_STRING([--enable-shared],[Build shared libraries (no / yes)])],[ENA_SHARED=$enableval])
+
+if [[ "X$ENA_STATIC" != "Xyes" -a "X$ENA_STATIC" != "Xauto" ]]
then
- SHLIBSTYLE='gcc'
- RPATHLINK="-Wl,-rpath-link,./"
-elif [[ "X$UNAME" = "XSunOS" ]]
+ ENA_STATIC='no'
+fi
+if [[ "X$ENA_SHARED" != "Xyes" -a "X$ENA_SHARED" != "Xauto" ]]
then
- SHLIBSTYLE='workshop'
+ ENA_SHARED='no'
fi
-if [[ "X$CC" = "Xgcc" -a "X$WARNVAL" != "Xno" ]]
+dnl Enable package building
+dnl -----------------------
+dnl When building a package, the executables are linked against
+dnl the shared libraries.
+ENA_PACKAGE='no'
+AC_ARG_ENABLE(packaging,[AS_HELP_STRING([--enable-packaging],[Build for package creation (no / yes)])],[ENA_PACKAGE=$enableval])
+if [[ "X$ENA_PACKAGE" != "Xyes" ]]
then
- # Enable all warnings and some extra warnings
- CWARN="-Wall"
- WARNVAL=yes
-else
- WARNVAL=no
-fi
-
-if [[ "X$CC" = "Xgcc" -a "X$WARNMOREVAL" == "Xyes" ]]
-then
- # Extra warnings
- CWARN="$CWARN -Wextra"
- # Overlong strings (C89: 509 characters, C99: 4095 characters)
- CWARN="$CWARN -Woverlength-strings"
- # Padding bytes added to structures
- CWARN="$CWARN -Wpadded"
- # Redundant declarations
- CWARN="$CWARN -Wredundant-decls"
- # Suspicious logical operators in expressions
- CWARN="$CWARN -Wlogical-op"
- # Functions returning entire structures
- CWARN="$CWARN -Waggregate-return"
- # Prototypes required before function use
- CWARN="$CWARN -Wstrict-prototypes"
- # Old style function definitions
- CWARN="$CWARN -old-style-definition"
- # Prototypes missing for global functions (must be in a header)
- CWARN="$CWARN -Wmissing-prototypes"
- # Global function defined without a previous prototype
- CWARN="$CWARN -Wmissing-declarations"
- # "exern" definition in a function
- CWARN="$CWARN -Wnested-externs"
- # Unreachable code in a program
- CWARN="$CWARN -Wunreachable-code"
- # Failed to inline a function
- CWARN="$CWARN -Winline"
- # Invalid PCH file found
- CWARN="$CWARN -Winvalid-pch"
- # Variable length array
- CWARN="$CWARN -Wvla"
- # Using signed pointers
- CWARN="$CWARN -Wpointer-sign"
- # The stack protector can not handle some function
- CWARN="$CWARN -Wstack-protector"
- WARNMOREVAL="yes"
-else
- WARNMOREVAL="no"
+ ENA_PACKAGE='no'
fi
-dnl Check whether we can build shared libraries
-case "X$ENASHARED" in
- "Xauto")
- if [[ "X$SHLIBSTYLE" = "Xgcc" -o "X$SHLIBSTYLE" = "Xworkshop" ]]
- then
- ENASHARED='yes'
- else
- ENASHARED='no'
- fi
- ;;
- "Xyes")
- if [[ "X$SHLIBSTYLE" = "Xgcc" -o "X$SHLIBSTYLE" = "Xworkshop" ]]
- then
- ENASHARED='yes'
- else
- ENASHARED='no'
- AC_MSG_ERROR([Can not build shared libraries!])
- exit 1
- fi
- ;;
- *)
- ENASHARED='no'
- ;;
-esac
+dnl Enable linking shared libraries with other shared libraries
+dnl -----------------------------------------------------------
+dnl NOTE 1: This does not work properly on all platforms.
+dnl NOTE 2: You should make sure the DK libraries are not yet
+dnl installed when building the shared libraries.
+ENA_SOSO='no'
+AC_ARG_ENABLE(link-so-so,[AS_HELP_STRING([--enable-link-so-so],[Link so libs with so libs (no / yes)])],[ENA_SOSO=$enableval])
+if [[ "X$ENA_SOSO" != "Xyes" ]]
+then
+ ENA_SOSO='no'
+fi
-dnl Check whether to build static libraries
-if [[ "X$ENASTATIC" = "Xauto" ]]
-then
- case "X$ENASHARED" in
- "Xyes")
- ENASTATIC='no'
- ;;
- "Xno")
- ENASTATIC='yes'
- ;;
- esac
-fi
-if [[ "X$ENASTATIC" != "Xyes" -a "X$ENASTATIC" != "Xno" ]]
-then
- ENASTATIC='no'
-fi
-
-dnl Check software suite to build
-WXCPPFLAGS=`wx-config --cppflags`
-WXCXXFLAGS=`wx-config --cxxflags`
-WXVERSION=`wx-config --version`
-WXCFLAGS=`wx-config --cflags`
-WXLDFLAGS=`wx-config --libs`
-case "X$SUITE" in
- "Xauto")
- SUITE='gui'
- if [[ "X$WXCPPFLAGS" = "X" ]]
- then
- SUITE="cli"
- fi
- if [[ "X$WXCXXFLAGS" = "X" ]]
- then
- SUITE="cli"
- fi
- if [[ "X$WXCFLAGS" = "X" ]]
- then
- SUITE="cli"
- fi
- if [[ "X$WXLDFLAGS" = "X" ]]
- then
- SUITE="cli"
- fi
- ;;
- "Xgui")
- if [[ "X$WXCPPFLAGS" = "X" ]]
- then
- SUITE="cli"
- fi
- if [[ "X$WXCXXFLAGS" = "X" ]]
- then
- SUITE="cli"
- fi
- if [[ "X$WXCFLAGS" = "X" ]]
- then
- SUITE="cli"
- fi
- if [[ "X$WXLDFLAGS" = "X" ]]
- then
- SUITE="cli"
- fi
- if [[ "X$SUITE" != "Xgui" ]]
- then
- AC_MSG_ERROR([Can not build GUI applications, wxWidgets not found!])
- exit 1
- fi
- ;;
- "Xcli")
- SUITE='cli'
- ;;
- "Xrescue")
- SUITE='rescue'
- ;;
- "Xcross")
- SUITE='cross'
- ;;
- *)
- AC_MSG_WARN([Unknown suite type $SUITE changed to cli.])
- SUITE='cli'
- ;;
+dnl Create RPATH entry for libdir in executables
+dnl --------------------------------------------
+dnl NOTE: Normally this should not be necessary as on a reasonable
+dnl system the libdir is in the shared libraries search path.
+ENA_RPATH='no'
+AC_ARG_ENABLE(rpath,[AS_HELP_STRING([--enable-rpath],[Use -rpath when linking executables (no / yes)])],[ENA_RPATH=$enableval])
+if [[ "X$ENA_RPATH" != "Xyes" ]]
+then
+ ENA_RPATH='no'
+fi
+
+dnl Enable installation of man pages (yes / no)
+dnl -------------------------------------------
+dnl This option is for Debian package creation where man pages
+dnl installation is handled by package build scripts.
+ENA_MAN='yes'
+AC_ARG_ENABLE(man-pages,[AS_HELP_STRING([--enable-man-pages],[Install man pages (yes / no)])],[ENA_MAN=$enableval])
+if [[ "X$ENA_MAN" != "Xno" ]]
+then
+ ENA_MAN='yes'
+fi
+
+dnl Enable debugging
+dnl ----------------
+ENA_DEBUG='no'
+AC_ARG_ENABLE(debug,[AS_HELP_STRING([--enable-debug],[Allow debug information (no / yes)])],[ENA_DEBUG=$enableval])
+if [[ "X$ENA_DEBUG" != "Xyes" ]]
+then
+ ENA_DEBUG='no'
+fi
+
+dnl Enable additional warnings
+dnl --------------------------
+ENA_WARN='no'
+AC_ARG_ENABLE(warnings,[AS_HELP_STRING([--enable-warnings],[Enable additional warnings for gcc (yes / no)])],[ENA_WARN=$enableval])
+if [[ "X$ENA_WARN" != "Xno" ]]
+then
+ ENA_WARN='yes'
+fi
+
+dnl Check whether to use extra compiler flags
+dnl -----------------------------------------
+case X$TOOLCHAIN/X$ENA_WARN/X$ENA_DEBUG in
+ Xgcc/Xyes/*)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xgcc/*/Xyes)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xclang/Xyes/*)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
+ Xclang/*/Xyes)
+ CFL_CLI_C8="$CFL_CLI_C8 $GCCWARNFLAGS"
+ CFL_CLI_DK="$CFL_CLI_DK $GCCWARNFLAGS"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 $GCXXWARNFLAGS"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK $GCXXWARNFLAGS"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX $GCXXWARNFLAGS"
+ CXXFL_GUI="$CXXFL_GUI $GCXXWARNFLAGS"
+ ;;
esac
-dnl Check presence of programs
-if [[ "X$RANLIB" = "X:" ]]
+
+
+
+dnl Enable assertions
+dnl -----------------
+dnl Assertions should be turned on when using the clang static
+dnl analyzer.
+ENA_ASSERT='no'
+AC_ARG_ENABLE(assert,[AS_HELP_STRING([--enable-assert],[Use assertions (no / yes)])],[ENA_ASSERT=$enableval])
+if [[ "X$ENA_ASSERT" != "Xyes" ]]
then
- RANLIB="@echo No need to run ranlib"
+ ENA_ASSERT='no'
fi
-AC_CHECK_PROG(WGET,wget,wget)
-AC_CHECK_PROG(CURL,curl,curl)
-dnl Decide which programs and libraries to build
-if [[ "X$SUITE" = "Xrescue" ]]
-then
- PROGRAMS='$(PROG_RES)'
- LIBS_STATIC='$(LIB_ST_RES)'
- LIBS_SHARED='$(LIB_SH_RES)'
- RES_INSTALL='i-r-res'
- INSTALLMANPAGES='install-rescue-man'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_RES) $(LIB_ST_RES)'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_RES)'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_RES)'
- ;;
- esac
- case "X$ENAPACKAGING" in
- "Xyes")
- LIBS_INSTALL='i-l-sh'
- ;;
- esac
- LIBRARIES=''
-elif [[ "X$SUITE" = "Xgui" ]]
-then
- PROGRAMS='$(PROG_GUI)'
- LIBS_STATIC='$(LIB_ST_GUI)'
- LIBS_SHARED='$(LIB_SH_GUI)'
- RES_INSTALL='i-r-gui'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_GUI) $(LIB_ST_GUI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_GUI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_GUI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
-elif [[ "X$SUITE" = "Xcross" ]]
-then
- PROGRAMS='$(PROG_CROSS)'
- LIBS_STATIC='$(LIB_ST_CLI)'
- LIBS_SHARED='$(LIB_SH_CLI)'
- RES_INSTALL='i-r-cli'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_CLI) $(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_CLI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ENASHARED='no'
- ENASTATIC='yes'
- case "X$host" in
- "Xx86_64-w64-mingw32")
- ONWINDOWS="yes"
- WINUNICODE="-D_UNICODE=1 -DUNICODE=1"
- AC_DEFINE(HAVE_BACKSLASH_AS_SEP)
- AC_DEFINE(HAVE_LINE_END_CR_NL)
- AC_DEFINE(HAVE_CASE_INSENSITIVE_PATHNAMES)
- ;;
- esac
-else
- PROGRAMS='$(PROG_CLI)'
- LIBS_STATIC='$(LIB_ST_CLI)'
- LIBS_SHARED='$(LIB_SH_CLI)'
- RES_INSTALL='i-r-cli'
- case "$ENASHARED/$ENASTATIC" in
- "yes/yes")
- LIBRARIES='$(LIB_SH_CLI) $(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-sh i-l-st i-incl'
- ;;
- "yes/no")
- LIBRARIES='$(LIB_SH_CLI)'
- LIBS_INSTALL='i-l-sh i-incl'
- ;;
- "no/yes")
- LIBRARIES='$(LIB_ST_CLI)'
- LIBS_INSTALL='i-l-st i-incl'
- ;;
- esac
-fi
-
-if [[ "X$ENASHARED" = "Xno" ]]
-then
- ENAPACKAGING="no"
-fi
-
-APPLIBF="libdk4app.so libdk4c.so"
-if [[ "X$CROSSCOMPILING" = "Xyes" ]]
-then
- APPLIBF="$APPLIBF libdk4ma.so libdk4maiodd.so libdk4maiowd.so libdk4maio8d.so"
-else
- APPLIBF="$APPLIBF libdk4ma.so libdk4maiodd.so libdk4maio8d.so"
+dnl Enable corrections on old SunOS versions
+dnl ----------------------------------------
+dnl Normal users should not need these corrections.
+ENA_SUNOS_CORR='no'
+AC_ARG_ENABLE(corrections,[AS_HELP_STRING([--enable-corrections],[Corrections for Solaris (no / yes)])],[ENA_SUNOS_CORR=$enableval])
+if [[ "X$ENA_SUNOS_CORR" != "Xyes" ]]
+then
+ ENA_SUNOS_CORR='no'
fi
-APPLIBF="$APPLIBF libdk4base.so"
-APPLIBS="-ldk4app -ldk4c"
-if [[ "X$CROSSCOMPILING" = "Xyes" ]]
+dnl Enable use of fallback values for numeric limits if not defined
+dnl ---------------------------------------------------------------
+ENA_FALLBACK='no'
+AC_ARG_ENABLE(fallback,[AS_HELP_STRING([--enable-fallback],[Enable fallback values for num limits (no / yes)])],[ENA_FALLBACK=$enableval])
+if [[ "X$ENA_FALLBACK" != "Xno" ]]
then
- APPLIBS="$APPLIBS -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d"
-else
- APPLIBS="$APPLIBS -ldk4ma -ldk4maiodd -ldk4maio8d"
+ AC_DEFINE(USE_FALLBACK_NUMERIC_LIMITS)
fi
-APPLIBS="$APPLIBS -ldk4base"
-DKCTLIBF='libdk3.a'
-DKCTLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-ADDCTRLDLIBF='libdk3.a'
-ADDCTRLDLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKDBTLIBF='libdk3.a'
-DKDBTLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-ITADMINLIBF='libdk3.a'
-ITADMINLIBS='-ldk3 -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) $(RTLIB)'
-BMPPLIBF='libdk3.a'
-BMPPLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-FIG2LATLIBF='libdk3.a'
-FIG2LATLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-HTMLBOOKLIBF='libdk3.a'
-HTMLBOOKLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-DK3INFOLIBF='libdk3.a'
-DK3INFOLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-PLPDFTEXLIBF='libdk3.a'
-PLPDFTEXLIBS='-ldk3 $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
-DKWXWIZLIBF='libdk3.a'
-DKWXWIZLIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKCTLIBF='libdk3.a'
-WXDKCTLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXBMPPLIBF='libdk3.a'
-WXBMPPLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXIMGSZLIBF='libdk3.a'
-WXIMGSZLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKCLOCKLIBF='libdk3.a'
-WXDKCLOCKLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXDKHTBLIBF='libdk3.a'
-WXDKHTBLIBS='-ldk3 $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
-PRINTQDILIBF='libdk3.a'
-PRINTQDILIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-PRINTQDALIBF='libdk3.a'
-PRINTQDALIBS='-ldk3 $(CLILIB) $(BZLIB) $(ZLIB)'
-
-DKCATLIBF="libdk4.a"
-DKCATLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKBLKSLIBF="libdk4.a"
-DKBLKSLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKSQLSPLITLIBF="libdk4.a"
-DKSQLSPLITLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKERADISKLIBF="libdk4.a"
-DKERADISKLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKLSLIBF="libdk4.a"
-DKLSLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKSORTLIBF="libdk4.a"
-DKSORTLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKFICLIBF="libdk4.a"
-DKFICLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKUIDLIBF="libdk4.a"
-DKUIDLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKPWGENLIBF="libdk4.a"
-DKPWGENLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKRANDLIBF="libdk4.a"
-DKRANDLIBS='-ldk4 $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-DKT2HLIBF="libdk4.a"
-DKT2HLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKT2LLIBF="libdk4.a"
-DKT2LLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKHEXLIBF="libdk4.a"
-DKHEXLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKBMMLIBF="libdk4.a"
-DKBMMLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKPWDLIBF="libdk4.a"
-DKPWDLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-DKRECVLIBF="libdk4.a"
-DKRECVLIBS='-ldk4 $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-DKSENDLIBF="libdk4.a"
-DKSENDLIBS='-ldk4 $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-DKDBT2LIBF="libdk4.a"
-DKDBT2LIBS='-ldk4 $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
-DK4INFOLIBF="libdk4.a"
-DK4INFOLIBS='-ldk4 $(CLILIB) $(BZLIB) $(ZLIB)'
-LPRNGCLLIBF="libdk4.a"
-LPRNGCLLIBS='-ldk4 $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
-WXDKFCSLIBF="libdk4.a"
-WXDKFCSLIBS='-ldk4 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
-WXPQDICLIBF="libdk4.a"
-WXPQDICLIBS='-ldk4 $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
-PJSNMPLIBF="libdk4.a"
-PJSNMPLIBS='-ldk4 $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
-PRMONSNMPLIBF="libdk4.a"
-PRMONSNMPLIBS='-ldk4 $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
-PRINTQDLIBF="libdk4.a"
-PRINTQDLIBS='-ldk4 $(DBLIB) $(SOCKLIB) $(NSLLIB)'
-PRINTQDCLIBF="libdk4.a"
-PRINTQDCLIBS='-ldk4 $(SOCKLIB) $(NSLLIB)'
-RSHDOWNLIBF="libdk4.a"
-RSHDOWNLIBS='-ldk4 $(SOCKLIB) $(NSLLIB)'
-
-LIB_SH_RES='$(LIB_SH_RES_NO_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_NO_PACKAGING)'
-LIB_SH_GUI='$(LIB_SH_GUI_NO_PACKAGING)'
-if [[ "X$ENAPACKAGING" = "Xyes" ]]
-then
-LIB_SH_RES='$(LIB_SH_RES_PACKAGING)'
-LIB_SH_CLI='$(LIB_SH_CLI_PACKAGING)'
-LIB_SH_GUI='$(LIB_SH_GUI_PACKAGING)'
-fi
-
-dnl Check whether to link so files with so files
-if [[ "X$CC" = "Xgcc" -a "X$UNAME" = "XLinux" ]]
-then
- USESOLINKING="yes"
-fi
-if [[ "X$SHLIBSTYLE" = "Xworkshop" -o "X$FORCESOLINKING" = "Xyes" ]]
-then
- USESOLINKING="yes"
-fi
-
-
-dnl Set compiler and linker flags for shared libraries
-case "X$SHLIBSTYLE" in
- "Xgcc")
- CFPIC='-fPIC -D_REENTRANT'
- if [[ "X$USESOLINKING" = "Xyes" ]]
- then
- MKSOLIB='$(COMPILEC) -L. $(RPATHLINK) $(LIBRARIES) $(LDFLAGS) -shared -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
- else
- MKSOLIB='$(COMPILEC) $(LIBRARIES) $(LDFLAGS) -shared -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
- fi
- ;;
- "Xworkshop")
- if [[ "X$ENASHARED" != "Xno" ]]
- then
- CFPIC='-Bdynamic -dy -xcode=pic32 -D_REENTRANT'
- else
- CFPIC='-xcode=pic32 -D_REENTRANT'
- fi
- MKSOLIB='$(COMPILEC) -L. $(LIBRARIES) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
- ;;
+dnl For some modules - but not for all - we could disable use of
+dnl printf / scanf function families.
+dnl Some modules would be able to compile, but not the entire
+dnl suite of programs.
+dnl So the choice option was removed, printf and scanf are always allowed.
+dnl ----------------------------------------------------------------------
+AC_DEFINE(USE_PRINTF_SCANF)
+
+dnl Decide for static and/or shared linking
+dnl ---------------------------------------
+case X$ENA_PACKAGE/X$ENA_STATIC/X$ENA_SHARED in
+ Xno/Xno/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ AC_MSG_WARN([Static linking enabled])
+ ;;
+ Xno/Xno/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xno/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xauto/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xauto/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xauto/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xno/Xyes/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xyes/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='no'
+ ;;
+ Xno/Xyes/Xyes)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xno/Xno)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ AC_MSG_WARN([Shared linking enabled])
+ ;;
+ Xyes/Xno/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xno/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xauto/Xno)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ AC_MSG_WARN([Shared linking enabled])
+ ;;
+ Xyes/Xauto/Xauto)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xauto/Xyes)
+ ENA_STATIC='no'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xyes/Xno)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ AC_MSG_WARN([Shared linking enabled])
+ ;;
+ Xyes/Xyes/Xauto)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
+ Xyes/Xyes/Xyes)
+ ENA_STATIC='yes'
+ ENA_SHARED='yes'
+ ;;
esac
-dnl Create -R option for linker
-if [[ "X$LD_LIBRARY_PATH" != "X" -a "X$SHLIBSTYLE" = "Xworkshop" ]]
+dnl File suffixes
+dnl =============
+
+dnl Executable file to produce (.exe on Windows, none on other systems)
+dnl -------------------------------------------------------------------
+EXEEXT=''
+if [[ "X$TARGETCLASS" = "Xwindows" ]]
then
- RPATH="-R${LD_LIBRARY_PATH}"
+ EXEEXT='.exe'
+fi
+
+dnl Object files
+dnl ------------
+OBJEXT='o'
+if [[ "X$TOOLCHAIN" = "Xmsvc" ]]
+then
+ OBJEXT='obj'
fi
+dnl Resource source files and resource files
+dnl ----------------------------------------
+RCEXT='rc'
+RESEXT='o'
+RESCRULE='echo "ERROR: No resource compiler available!"'
+RCFLAGS='-I. -D_UNICODE=1 -DUNICODE=1 -Igui-img/icons'
+if [[ "X$TOOLCHAIN" = "Xmsvc" ]]
+then
+ RESEXT='res'
+fi
+if [[ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]]
+then
+ RESCRULE='$(RC) $(RCFLAGS) $< $@'
+elif [[ "X$TOOLCHAIN" = "Xmsvc" ]]
+then
+ RESCRULE='$(RC) $(RCFLAGS) -out:$@ $<'
+fi
+
+
+
+dnl FEATURE TESTS START
+
+dnl Headers
+dnl =======
+
dnl Standard headers mentioned in C coding standard
-AC_HEADER_CHECK(errno.h, AC_DEFINE(HAVE_ERRNO_H))
-AC_HEADER_CHECK(assert.h, AC_DEFINE(HAVE_ASSERT_H))
+dnl -----------------------------------------------
AC_HEADER_CHECK(complex.h, AC_DEFINE(HAVE_COMPLEX_H))
AC_HEADER_CHECK(ctype.h, AC_DEFINE(HAVE_CTYPE_H))
AC_HEADER_CHECK(fenv.h, AC_DEFINE(HAVE_FENV_H))
@@ -722,6 +646,7 @@ AC_HEADER_CHECK(stdbool.h, AC_DEFINE(HAVE_STDBOOL_H))
AC_HEADER_CHECK(stddef.h, AC_DEFINE(HAVE_STDDEF_H))
AC_HEADER_CHECK(stdint.h, AC_DEFINE(HAVE_STDINT_H))
AC_HEADER_CHECK(stdlib.h, AC_DEFINE(HAVE_STDLIB_H))
+AC_HEADER_CHECK(sysexits.h, AC_DEFINE(HAVE_SYSEXITS_H))
AC_HEADER_CHECK(stdnoreturn.h, AC_DEFINE(HAVE_STDNORETURN_H))
AC_HEADER_CHECK(string.h, AC_DEFINE(HAVE_STRING_H))
AC_HEADER_CHECK(tgmath.h, AC_DEFINE(HAVE_TGMATH_H))
@@ -730,10 +655,25 @@ AC_HEADER_CHECK(time.h, AC_DEFINE(HAVE_TIME_H))
AC_HEADER_CHECK(uchar.h, AC_DEFINE(HAVE_UCHAR_H))
AC_HEADER_CHECK(wchar.h, AC_DEFINE(HAVE_WCHAR_H))
AC_HEADER_CHECK(wctype.h, AC_DEFINE(HAVE_WCTYPE_H))
-
-
+AC_HEADER_CHECK(errno.h, AC_DEFINE(HAVE_ERRNO_H))
+FOUND_ASSERT_H='no'
+AC_HEADER_CHECK(assert.h, [FOUND_ASSERT_H='yes';AC_DEFINE(HAVE_ASSERT_H)])
+if [[ "X$FOUND_ASSERT_H" = "Xno" -a "X$ENA_ASSERT" = "Xyes" ]]
+then
+ AC_MSG_WARN([Assertions enabled but assert.h not found!])
+elif [[ "X$ENA_ASSERT" = "Xyes" ]]
+then
+ CFLAGS="$CFLAGS -DDK4_USE_ASSERT=1"
+ CFL_CLI_C8="$CFL_CLI_C8 -DDK4_USE_ASSERT=1"
+ CFL_CLI_DK="$CFL_CLI_DK -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -DDK4_USE_ASSERT=1"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -DDK4_USE_ASSERT=1"
+ CXXFL_GUI="$CXXFL_GUI -DDK4_USE_ASSERT=1"
+fi
dnl Further headers
+dnl ---------------
AC_HEADER_CHECK(sys/types.h, AC_DEFINE(HAVE_SYS_TYPES_H))
AC_HEADER_CHECK(sys/param.h, AC_DEFINE(HAVE_SYS_PARAM_H))
AC_HEADER_CHECK(sys/stat.h, AC_DEFINE(HAVE_SYS_STAT_H))
@@ -753,34 +693,107 @@ AC_HEADER_CHECK(process.h, AC_DEFINE(HAVE_PROCESS_H))
AC_HEADER_CHECK(fcntl.h, AC_DEFINE(HAVE_FCNTL_H))
AC_HEADER_CHECK(share.h, AC_DEFINE(HAVE_SHARE_H))
AC_HEADER_CHECK(pwd.h, AC_DEFINE(HAVE_PWD_H))
+AC_HEADER_CHECK(memory.h, AC_DEFINE(HAVE_MEMORY_H))
AC_HEADER_CHECK(strings.h, AC_DEFINE(HAVE_STRINGS_H))
AC_HEADER_CHECK(io.h, AC_DEFINE(HAVE_IO_H))
AC_HEADER_CHECK(bios.h, AC_DEFINE(HAVE_BIOS_H))
+AC_HEADER_CHECK(search.h, AC_DEFINE(HAVE_SEARCH_H))
AC_HEADER_CHECK(dos.h, AC_DEFINE(HAVE_DOS_H))
AC_HEADER_CHECK(alloc.h, AC_DEFINE(HAVE_ALLOC_H))
AC_HEADER_CHECK(malloc.h, AC_DEFINE(HAVE_MALLOC_H))
AC_HEADER_CHECK(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
AC_HEADER_CHECK(direct.h, AC_DEFINE(HAVE_DIRECT_H))
-AC_HEADER_CHECK(zlib.h, [ZLIB="-lz";AC_DEFINE(HAVE_ZLIB_H)])
-AC_HEADER_CHECK(bzlib.h, [BZLIB="-lbz2";AC_DEFINE(HAVE_BZLIB_H)])
+AC_HEADER_CHECK(stdio.h, AC_DEFINE(HAVE_STDIO_H))
+AC_HEADER_CHECK(conio.h, AC_DEFINE(HAVE_CONIO_H))
+AC_HEADER_CHECK(grp.h, AC_DEFINE(HAVE_GRP_H))
+AC_HEADER_CHECK(dir.h, AC_DEFINE(HAVE_DIR_H))
+AC_HEADER_CHECK(err.h, AC_DEFINE(HAVE_ERR_H))
+AC_HEADER_CHECK(shadow.h, AC_DEFINE(HAVE_SHADOW_H))
+AC_HEADER_CHECK(stropts.h, AC_DEFINE(HAVE_STROPTS_H))
+AC_HEADER_CHECK(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
+AC_HEADER_CHECK(sysres.h, AC_DEFINE(HAVE_SYSRES_H))
+AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H))
+AC_HEADER_CHECK(vararg.h, AC_DEFINE(HAVE_VARARG_H))
+AC_HEADER_CHECK(varargs.h, AC_DEFINE(HAVE_VARARGS_H))
+AC_HEADER_CHECK(ntifs.h, AC_DEFINE(HAVE_NTIFS_H))
+AC_HEADER_CHECK(sys/file.h, AC_DEFINE(HAVE_SYS_FILE_H))
+AC_HEADER_CHECK(sys/resource.h, AC_DEFINE(HAVE_SYS_RESOURCE_H))
+AC_HEADER_CHECK(sys/statvfs.h, AC_DEFINE(HAVE_SYS_STATVFS_H))
+AC_HEADER_CHECK(sys/stropts.h, AC_DEFINE(HAVE_SYS_STROPTS_H))
+AC_HEADER_CHECK(sys/sunddi.h, AC_DEFINE(HAVE_SYS_SUNDDI_H))
+AC_HEADER_CHECK(sys/sysctl.h, AC_DEFINE(HAVE_SYS_SYSCTL_H))
+AC_HEADER_CHECK(sys/systeminfo.h, AC_DEFINE(HAVE_SYS_SYSTEMINFO_H))
+AC_HEADER_CHECK(sys/termios.h, AC_DEFINE(HAVE_SYS_TERMIOS_H))
+AC_HEADER_CHECK(sys/ttold.h, AC_DEFINE(HAVE_SYS_TTOLD_H))
+AC_HEADER_CHECK(sys/uio.h, AC_DEFINE(HAVE_SYS_UIO_H))
+AC_HEADER_CHECK(sys/wait.h,AC_DEFINE(HAVE_SYS_WAIT_H))
+AC_HEADER_CHECK(lprng.h, AC_DEFINE(HAVE_LPRNG_H))
+AC_HEADER_CHECK(pthread.h, [PTHREADLIB='-lpthread';AC_DEFINE(HAVE_PTHREAD_H)])
+
+dnl Time headers, use both
+dnl ----------------------
+AC_HEADER_TIME
+
+dnl Windows headers
+dnl ---------------
+AC_HEADER_CHECK(winbase.h,[AC_DEFINE(HAVE_WINBASE_H)],[],[
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+])
+AC_HEADER_CHECK(winreg.h,[AC_DEFINE(HAVE_WINREG_H)],[],[
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+#if HAVE_WINBASE_H
+#include <winbase.h>
+#endif
+])
+AC_HEADER_CHECK(wincon.h,[AC_DEFINE(HAVE_WINCON_H)],[],[
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+#if HAVE_WINBASE_H
+#include <winbase.h>
+#endif
+])
+
+dnl Compression libraries (zlib and bzip2)
+dnl --------------------------------------
+FOUND_ZLIB='no'
+AC_HEADER_CHECK(zlib.h, [ZLIB='-lz';FOUND_ZLIB='yes';AC_DEFINE(HAVE_ZLIB_H)])
+FOUND_BZLIB='no'
+AC_HEADER_CHECK(bzlib.h, [BZLIB='-lbz2';FOUND_BZLIB='yes';AC_DEFINE(HAVE_BZLIB_H)])
dnl OpenSSL Random number generation and message digests.
-CRYPTO=""
-PROGSOPENSSL=""
+dnl -----------------------------------------------------
+FOUND_OPENSSL='no'
+CRYPTO=''
AC_HEADER_CHECK(openssl/rand.h, [
-CRYPTO="-lcrypto"
-PROGSOPENSSL='dk-fic$(EXEEXT) dk-pwgen$(EXEEXT) dk-rand$(EXEEXT)'
+FOUND_OPENSSL='yes'
+CRYPTO='-lcrypto'
+PRG_CLI_SSL='$(PRG_CLI_SSL)'
+MAN_CLI_SSL='$(MAN_CLI_SSL)'
+RES_CLI_SSL='$(RES_CLI_SSL)'
+PRG_GUI_SSL='$(PRG_GUI_SSL)'
+MAN_GUI_SSL='$(MAN_GUI_SSL)'
+RES_GUI_SSL='$(RES_GUI_SSL)'
AC_DEFINE(HAVE_OPENSSL_RAND_H)
])
AC_HEADER_CHECK(openssl/md5.h, [AC_DEFINE(HAVE_OPENSSL_MD5_H)])
AC_HEADER_CHECK(openssl/sha.h, [AC_DEFINE(HAVE_OPENSSL_SHA_H)])
AC_HEADER_CHECK(openssl/ripemd.h, [AC_DEFINE(HAVE_OPENSSL_RIPEMD_H)])
+AC_CHECK_LIB(crypto, SHA224_Init,AC_DEFINE(HAVE_SHA224))
+AC_CHECK_LIB(crypto, SHA256_Init,AC_DEFINE(HAVE_SHA256))
+AC_CHECK_LIB(crypto, SHA384_Init,AC_DEFINE(HAVE_SHA384))
+AC_CHECK_LIB(crypto, SHA512_Init,AC_DEFINE(HAVE_SHA512))
-dnl time headers, use both
-AC_HEADER_TIME
+dnl Data types
+dnl ==========
dnl Data type long long
-AC_MSG_CHECKING(longlong)
+dnl -------------------
+AC_MSG_CHECKING([long long])
AC_TRY_COMPILE([
#include <stdio.h>
],[
@@ -789,7 +802,8 @@ AC_TRY_COMPILE([
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_LONG_LONG)],[AC_MSG_RESULT(no)])
dnl Data type long double
-AC_MSG_CHECKING(longdouble)
+dnl ---------------------
+AC_MSG_CHECKING([long double])
AC_TRY_COMPILE([
#include <stdio.h>
#include <math.h>
@@ -797,9 +811,10 @@ AC_TRY_COMPILE([
long double l;
l = (long double)0.0;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_LONG_DOUBLE)],[AC_MSG_RESULT(no)])
-DOINTMAXSIZECHECK="no"
+DOINTMAXSIZECHECK='no'
dnl Data type intmax_t
+dnl ------------------
AC_MSG_CHECKING(intmax_t)
AC_TRY_COMPILE([
#include <stdio.h>
@@ -811,17 +826,10 @@ AC_TRY_COMPILE([
#endif
],[
intmax_t im;
-],[DOINTMAXSIZECHECK="yes";AC_MSG_RESULT(yes);AC_DEFINE(HAVE_INTMAX_T)],[AC_MSG_RESULT(no)])
-
-dnl Keyword volatile
-AC_MSG_CHECKING(volatile)
-AC_TRY_COMPILE([
-volatile int i = 0;
-],[
-i = 1;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_VOLATILE)],[AC_MSG_RESULT(no)])
+],[DOINTMAXSIZECHECK='yes';AC_MSG_RESULT(yes);AC_DEFINE(HAVE_INTMAX_T)],[AC_MSG_RESULT(no)])
dnl Data type sig_atomic_t
+dnl ----------------------
AC_MSG_CHECKING(sig_atomic_t)
AC_TRY_COMPILE([
#include <sys/types.h>
@@ -830,446 +838,8 @@ AC_TRY_COMPILE([
sig_atomic_t sat;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_SIG_ATOMIC_T)],[AC_MSG_RESULT(no)])
-dnl Data type sizes
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(size_t)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-if [[ "X$DOINTMAXSIZECHECK" = "Xyes" ]]
-then
-AC_CHECK_SIZEOF(intmax_t)
-fi
-AC_CHECK_SIZEOF(double)
-AC_CHECK_SIZEOF(long double)
-AC_CHECK_SIZEOF(wchar_t)
-
-dnl Feature large file functions
-AC_MSG_CHECKING(_LARGEFILE64_SOURCE)
-FS64=''
-AC_TRY_COMPILE([
-#define _LARGEFILE64_SOURCE 1
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-],[struct stat64 st;],[FS64='-D_LARGEFILE64_SOURCE=1'
-AC_DEFINE(HAVE_LARGEFILE64_SOURCE)
-AC_DEFINE(HAVE_TYPE_STAT64)
-AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
-
-dnl Check for functions
-AC_HAVE_FUNCS(memset bzero memcpy bcopy memcmp bcmp)
-AC_HAVE_FUNCS(malloc calloc free)
-AC_HAVE_FUNCS(strcpy_s strcat_s)
-AC_HAVE_FUNCS(strcasecmp stricmp _stricmp)
-AC_HAVE_FUNCS(wcslen wcscpy_s wcscpy wcscat_s wcscat wcschr wcsrchr)
-AC_HAVE_FUNCS(wcscmp _wcscmp wcscasecmp _wcscasecmp wcsicmp _wcsicmp)
-AC_HAVE_FUNCS(getpid readlink getexecname lstat stat64 lstat64 localtime_r)
-AC_HAVE_FUNCS(geteuid fopen64 fopen_s _wfopen _wfopen64 _wfopen_s)
-AC_HAVE_FUNCS(fputws fputwc)
-AC_HAVE_FUNCS(setbuffer setbuf setvbuf)
-AC_HAVE_FUNCS(fileno _fileno setmode _setmode isatty _isatty)
-AC_HAVE_FUNCS(strtod _strtod wcstod _wcstod)
-AC_HAVE_FUNCS(_snprintf_s _snprintf snprintf _snwprintf_s _snwprintf snwprintf)
-AC_HAVE_FUNCS(swprintf)
-AC_HAVE_FUNCS(unlink _unlink wunlink _wunlink)
-AC_HAVE_FUNCS(rmdir _rmdir wrmdir _wrmdir)
-AC_HAVE_FUNCS(mkdir _mkdir wmkdir _wmkdir)
-AC_HAVE_FUNCS(strerror strerror_r)
-AC_HAVE_FUNCS(sigaction sigset signal sigprocmask sigemptyset)
-AC_HAVE_FUNCS(setpwent getpwent endpwent)
-AC_HAVE_FUNCS(getenv getenv_s setlocale select)
-AC_HAVE_FUNCS(getcwd _getcwd _wgetcwd)
-AC_CHECK_LIB(crypto, SHA224_Init,AC_DEFINE(HAVE_SHA224))
-AC_CHECK_LIB(crypto, SHA256_Init,AC_DEFINE(HAVE_SHA256))
-AC_CHECK_LIB(crypto, SHA384_Init,AC_DEFINE(HAVE_SHA384))
-AC_CHECK_LIB(crypto, SHA512_Init,AC_DEFINE(HAVE_SHA512))
-
-AC_MSG_CHECKING(RAND_egd)
-AC_TRY_COMPILE([
-#include <openssl/rand.h>
-],[
-int i;
-i = RAND_egd("/dev/egd");
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_RAND_EGD)],[AC_MSG_RESULT(no)])
-
-AC_CHECK_LIB(rt,clock_gettime,[RTLIB="-lrt"])
-
-SOCKLIB=''
-NSLLIB=''
-
-dnl Function socket in standard library, -lxnet and -lsocket
-AC_CHECK_FUNCS(socket,[
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-AC_DEFINE(HAVE_SOCKET)
-],[
-AC_CHECK_LIB(xnet,socket,[
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-AC_DEFINE(HAVE_SOCKET)
-SOCKLIB='-lxnet'
-],[
-AC_CHECK_LIB(socket,socket,[
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-AC_DEFINE(HAVE_SOCKET)
-SOCKLIB='-lsocket'
-],[
-AC_CHECK_LIB(ws2_32,socket,[
-NET_PROG_RES='$(NET_PROG_RES)'
-NET_PROG_CLI='$(NET_PROG_CLI)'
-AC_DEFINE(HAVE_SOCKET)
-SOCKLIB='-lws2_32'
-])
-])
-])
-])
-
-dnl Function setsockopt
-AC_CHECK_FUNCS(setsockopt,[
-AC_DEFINE(HAVE_SETSOCKOPT)
-],[
-AC_CHECK_LIB(xnet,setsockopt,[
-AC_DEFINE(HAVE_SETSOCKOPT)
-],[
-AC_CHECK_LIB(socket,setsockopt,[
-AC_DEFINE(HAVE_SETSOCKOPT)
-],[
-AC_CHECK_LIB(ws2_32,setsockopt,[
-AC_DEFINE(HAVE_SETSOCKOPT)
-])
-])
-])
-])
-
-dnl Function getaddrinfo
-AC_CHECK_FUNCS(getaddrinfo,[
-AC_DEFINE(HAVE_GETADDRINFO)
-],[
-AC_CHECK_LIB(xnet,getaddrinfo,[
-NSLLIB='-lxnet'
-AC_DEFINE(HAVE_GETADDRINFO)
-],[
-AC_CHECK_LIB(nsl,getaddrinfo,[
-NSLLIB='-lnsl'
-AC_DEFINE(HAVE_GETADDRINFO)
-],[
-AC_CHECK_LIB(socket,getaddrinfo,[
-NSLLIB='-lsocket'
-AC_DEFINE(HAVE_GETADDRINFO)
-],[
-AC_CHECK_LIB(ws2_32,getaddrinfo,[
-AC_DEFINE(HAVE_GETADDRINFO)
-])
-])
-])
-])
-])
-
-dnl Function getnameinfo (reverse getaddrinfo)
-AC_CHECK_FUNCS(getnameinfo,[
-AC_DEFINE(HAVE_GETNAMEINFO)
-],[
-AC_CHECK_LIB(xnet,getnameinfo,[
-AC_DEFINE(HAVE_GETNAMEINFO)
-],[
-AC_CHECK_LIB(nsl,getnameinfo,[
-AC_DEFINE(HAVE_GETNAMEINFO)
-],[
-AC_CHECK_LIB(socket,getnameinfo,[
-AC_DEFINE(HAVE_GETNAMEINFO)
-],[
-AC_CHECK_LIB(ws2_32,getnameinfo,[
-AC_DEFINE(HAVE_GETNAMEINFO)
-])
-])
-])
-])
-])
-
-dnl Function gethostbyname
-AC_CHECK_FUNCS(gethostbyname,[
-AC_DEFINE(HAVE_GETHOSTBYNAME)
-],[
-AC_CHECK_LIB(xnet,gethostbyname,[
-AC_DEFINE(HAVE_GETHOSTBYNAME)
-],[
-AC_CHECK_LIB(nsl,gethostbyname,[
-AC_DEFINE(HAVE_GETHOSTBYNAME)
-],[
-AC_CHECK_LIB(socket,gethostbyname,[
-AC_DEFINE(HAVE_GETHOSTBYNAME)
-],[
-AC_CHECK_LIB(ws3_32,gethostbyname,[
-AC_DEFINE(HAVE_GETHOSTBYNAME)
-])
-])
-])
-])
-])
-
-dnl Function or macro htons
-AC_MSG_CHECKING(htons)
-AC_TRY_COMPILE([
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-],[
- unsigned short s;
- s = htons(5);
-],[
-AC_DEFINE(HAVE_HTONS)
-AC_MSG_RESULT(yes)
-],[
-AC_MSG_RESULT(no)
-])
-
-dnl Function or macro ntohs
-AC_MSG_CHECKING(ntohs)
-AC_TRY_COMPILE([
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-],[
- unsigned short s;
- s = ntohs(5);
-],[
-AC_DEFINE(HAVE_NTOHS)
-AC_MSG_RESULT(yes)
-],[
-AC_MSG_RESULT(no)
-])
-
-dnl Function or macro htonl
-AC_MSG_CHECKING(htonl)
-AC_TRY_COMPILE([
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-],[
- unsigned long s;
- s = htonl(5);
-],[
-AC_DEFINE(HAVE_HTONL)
-AC_MSG_RESULT(yes)
-],[
-AC_MSG_RESULT(no)
-])
-
-dnl Function or macro ntohl
-AC_MSG_CHECKING(ntohl)
-AC_TRY_COMPILE([
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-],[
- unsigned long s;
- s = ntohl(5);
-],[
-AC_DEFINE(HAVE_NTOHL)
-AC_MSG_RESULT(yes)
-],[
-AC_MSG_RESULT(no)
-])
-
-dnl Function inet_addr
-AC_CHECK_FUNCS(inet_addr,[
-AC_DEFINE(HAVE_INET_ADDR)
-],[
-AC_CHECK_LIB(xnet,inet_addr,[
-AC_DEFINE(HAVE_INET_ADDR)
-],[
-AC_CHECK_LIB(nsl,inet_addr,[
-AC_DEFINE(HAVE_INET_ADDR)
-],[
-AC_CHECK_LIB(socket,inet_addr,[
-AC_DEFINE(HAVE_INET_ADDR)
-],[
-AC_CHECK_LIB(ws2_32,inet_addr,[
-AC_DEFINE(HAVE_INET_ADDR)
-])
-])
-])
-])
-])
-
-dnl Function inet_aton
-AC_CHECK_FUNCS(inet_aton,[
-AC_DEFINE(HAVE_INET_ATON)
-],[
-AC_CHECK_LIB(xnet,inet_aton,[
-AC_DEFINE(HAVE_INET_ATON)
-],[
-AC_CHECK_LIB(nsl,inet_aton,[
-AC_DEFINE(HAVE_INET_ATON)
-],[
-AC_CHECK_LIB(socket,inet_aton,[
-AC_DEFINE(HAVE_INET_ATON)
-],[
-AC_CHECK_LIB(ws2_32,inet_aton,[
-AC_DEFINE(HAVE_INET_ATON)
-])
-])
-])
-])
-])
-
-dnl Function inet_pton
-AC_CHECK_FUNCS(inet_pton,[
-AC_DEFINE(HAVE_INET_PTON)
-],[
-AC_CHECK_LIB(xnet,inet_pton,[
-AC_DEFINE(HAVE_INET_PTON)
-],[
-AC_CHECK_LIB(nsl,inet_pton,[
-AC_DEFINE(HAVE_INET_PTON)
-],[
-AC_CHECK_LIB(socket,inet_pton,[
-AC_DEFINE(HAVE_INET_PTON)
-],[
-AC_CHECK_LIB(ws2_32,inet_pton,[
-AC_DEFINE(HAVE_INET_PTON)
-])
-])
-])
-])
-])
-
-dnl Function inet_ntop (reverse inet_pton)
-AC_CHECK_FUNCS(inet_ntop,[
-AC_DEFINE(HAVE_INET_NTOP)
-],[
-AC_CHECK_LIB(xnet,inet_ntop,[
-AC_DEFINE(HAVE_INET_NTOP)
-],[
-AC_CHECK_LIB(nsl,inet_ntop,[
-AC_DEFINE(HAVE_INET_NTOP)
-],[
-AC_CHECK_LIB(socket,inet_ntop,[
-AC_DEFINE(HAVE_INET_NTOP)
-],[
-AC_CHECK_LIB(ws2_32,inet_ntop,[
-AC_DEFINE(HAVE_INET_NTOP)
-])
-])
-])
-])
-])
-
-if [[ "X$SOCKLIB" = "X$NSLLIB" ]]
-then
-NSLLIB=''
-fi
-
-dnl Feature Checking for /proc/.../exe symbolic link
-dnl http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
-AC_MSG_CHECKING(/proc/.../exe symbolic link)
-AC_TRY_RUN([
-#include <stdio.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-
-/* Buffer for result */
-char prog[1024];
-
-#ifdef __cplusplus
-int main(int argc, char *argv[])
-#else
-int main(argc, argv) int argc; char *argv[];
-#endif
-{
- char buf[64];
- struct stat stbuf;
- int exv = 1;
- ssize_t res;
-#if HAVE_STDINT_H
- sprintf(buf, "/proc/%ju/exe", (uintmax_t)getpid());
-#else
- sprintf(buf, "/proc/%lu/exe", (unsigned long)getpid());
-#endif
- res = readlink(buf, prog, sizeof(prog));
- if ((0 < res) && (sizeof(prog) > res)) {
- prog[res] = '\0';
- if (0 == stat(prog, &stbuf)) {
- exv = 0;
- }
- }
- return exv;
-}
-
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_PROC_PID_EXE)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT([no - test not possible])])
-
dnl Data type ssize_t
+dnl -----------------
AC_MSG_CHECKING(ssize_t)
AC_TRY_COMPILE([
#if HAVE_STDLIB_H
@@ -1285,6 +855,8 @@ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SSIZE_T)
],[AC_MSG_RESULT(no)])
+dnl Data type int8_t
+dnl ----------------
AC_MSG_CHECKING(int8_t)
AC_TRY_COMPILE([
#if HAVE_STDLIB_H
@@ -1303,6 +875,8 @@ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_INT8_T)
],[AC_MSG_RESULT(no)])
+dnl Data type int16_t
+dnl -----------------
AC_MSG_CHECKING(int16_t)
AC_TRY_COMPILE([
#if HAVE_STDLIB_H
@@ -1321,6 +895,8 @@ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_INT16_T)
],[AC_MSG_RESULT(no)])
+dnl Data type int32_t
+dnl -----------------
AC_MSG_CHECKING(int32_t)
AC_TRY_COMPILE([
#if HAVE_STDLIB_H
@@ -1340,6 +916,7 @@ AC_DEFINE(HAVE_INT32_T)
],[AC_MSG_RESULT(no)])
dnl Data type uint8_t
+dnl -----------------
AC_MSG_CHECKING(uint8_t)
AC_TRY_COMPILE([
#if HAVE_STDLIB_H
@@ -1359,6 +936,7 @@ AC_DEFINE(HAVE_UINT8_T)
],[AC_MSG_RESULT(no)])
dnl Data type uint16_t
+dnl ------------------
AC_MSG_CHECKING(uint16_t)
AC_TRY_COMPILE([
#if HAVE_STDLIB_H
@@ -1378,6 +956,7 @@ AC_DEFINE(HAVE_UINT16_T)
],[AC_MSG_RESULT(no)])
dnl Data type uint32_t
+dnl ------------------
AC_MSG_CHECKING(uint32_t)
AC_TRY_COMPILE([
#if HAVE_STDLIB_H
@@ -1396,7 +975,8 @@ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_UINT32_T)
],[AC_MSG_RESULT(no)])
-dnl Data types for file stat
+dnl Data type dev_t
+dnl ---------------
AC_MSG_CHECKING(dev_t)
AC_TRY_COMPILE([
#include <stdio.h>
@@ -1414,6 +994,8 @@ AC_TRY_COMPILE([
dev_t devno;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_DEV_T)],[AC_MSG_RESULT(no)])
+dnl Data type _dev_t
+dnl ----------------
AC_MSG_CHECKING(_dev_t)
AC_TRY_COMPILE([
#include <stdio.h>
@@ -1431,6 +1013,8 @@ AC_TRY_COMPILE([
_dev_t devno;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE__DEV_T)],[AC_MSG_RESULT(no)])
+dnl Data type ino_t
+dnl ---------------
AC_MSG_CHECKING(ino_t)
AC_TRY_COMPILE([
#include <stdio.h>
@@ -1448,6 +1032,8 @@ AC_TRY_COMPILE([
ino_t devno;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_INO_T)],[AC_MSG_RESULT(no)])
+dnl Data type _ino_t
+dnl ----------------
AC_MSG_CHECKING(_ino_t)
AC_TRY_COMPILE([
#include <stdio.h>
@@ -1465,6 +1051,8 @@ AC_TRY_COMPILE([
_ino_t devno;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE__INO_T)],[AC_MSG_RESULT(no)])
+dnl Data type ino64_t
+dnl -----------------
AC_MSG_CHECKING(ino64_t)
AC_TRY_COMPILE([
#define _LARGEFILE64_SOURCE 1
@@ -1483,6 +1071,8 @@ AC_TRY_COMPILE([
ino64_t devno;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_INO64_T)],[AC_MSG_RESULT(no)])
+dnl Data type mode_t
+dnl ----------------
AC_MSG_CHECKING(mode_t)
AC_TRY_COMPILE([
#include <stdio.h>
@@ -1500,6 +1090,8 @@ AC_TRY_COMPILE([
mode_t devno;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_MODE_T)],[AC_MSG_RESULT(no)])
+dnl Data type nlink_t
+dnl -----------------
AC_MSG_CHECKING(nlink_t)
AC_TRY_COMPILE([
#include <stdio.h>
@@ -1517,7 +1109,9 @@ AC_TRY_COMPILE([
nlink_t devno;
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_NLINK_T)],[AC_MSG_RESULT(no)])
-AC_MSG_CHECKING(uid_t)
+dnl Data type off_t
+dnl ---------------
+AC_MSG_CHECKING(off_t)
AC_TRY_COMPILE([
#include <stdio.h>
#include <stdlib.h>
@@ -1531,11 +1125,14 @@ AC_TRY_COMPILE([
#include <unistd.h>
#endif
],[
- uid_t devno;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_UID_T)],[AC_MSG_RESULT(no)])
+ off_t devno;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_OFF_T)],[AC_MSG_RESULT(no)])
-AC_MSG_CHECKING(gid_t)
+dnl Data type off64_t
+dnl -----------------
+AC_MSG_CHECKING(off64_t)
AC_TRY_COMPILE([
+#define _LARGEFILE64_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#if HAVE_SYS_TYPES_H
@@ -1548,10 +1145,12 @@ AC_TRY_COMPILE([
#include <unistd.h>
#endif
],[
- gid_t devno;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_GID_T)],[AC_MSG_RESULT(no)])
+ off64_t devno;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_OFF64_T)],[AC_MSG_RESULT(no)])
-AC_MSG_CHECKING(off_t)
+dnl Data type blksize_t
+dnl -------------------
+AC_MSG_CHECKING(blksize_t)
AC_TRY_COMPILE([
#include <stdio.h>
#include <stdlib.h>
@@ -1565,12 +1164,13 @@ AC_TRY_COMPILE([
#include <unistd.h>
#endif
],[
- off_t devno;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_OFF_T)],[AC_MSG_RESULT(no)])
+ blksize_t devno;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_BLKSIZE_T)],[AC_MSG_RESULT(no)])
-AC_MSG_CHECKING(off64_t)
+dnl Data type blkcnt_t
+dnl ------------------
+AC_MSG_CHECKING(blkcnt_t)
AC_TRY_COMPILE([
-#define _LARGEFILE64_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#if HAVE_SYS_TYPES_H
@@ -1583,10 +1183,12 @@ AC_TRY_COMPILE([
#include <unistd.h>
#endif
],[
- off64_t devno;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_OFF64_T)],[AC_MSG_RESULT(no)])
+ blkcnt_t devno;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_BLKCNT_T)],[AC_MSG_RESULT(no)])
-AC_MSG_CHECKING(blksize_t)
+dnl Data type fpos_t
+dnl ----------------
+AC_MSG_CHECKING(fpos_t)
AC_TRY_COMPILE([
#include <stdio.h>
#include <stdlib.h>
@@ -1600,10 +1202,12 @@ AC_TRY_COMPILE([
#include <unistd.h>
#endif
],[
- blksize_t devno;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_BLKSIZE_T)],[AC_MSG_RESULT(no)])
+ fpos_t devno;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FPOS_T)],[AC_MSG_RESULT(no)])
-AC_MSG_CHECKING(blkcnt_t)
+dnl Data type _fpos_t
+dnl -----------------
+AC_MSG_CHECKING(_fpos_t)
AC_TRY_COMPILE([
#include <stdio.h>
#include <stdlib.h>
@@ -1617,10 +1221,12 @@ AC_TRY_COMPILE([
#include <unistd.h>
#endif
],[
- blkcnt_t devno;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_BLKCNT_T)],[AC_MSG_RESULT(no)])
+ _fpos_t devno;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE__FPOS_T)],[AC_MSG_RESULT(no)])
-AC_MSG_CHECKING(fpos_t)
+dnl Data type uid_t
+dnl ---------------
+AC_MSG_CHECKING(uid_t)
AC_TRY_COMPILE([
#include <stdio.h>
#include <stdlib.h>
@@ -1634,10 +1240,333 @@ AC_TRY_COMPILE([
#include <unistd.h>
#endif
],[
- fpos_t devno;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FPOS_T)],[AC_MSG_RESULT(no)])
+ uid_t devno;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_UID_T)],[AC_MSG_RESULT(no)])
+
+dnl Data type gid_t
+dnl ---------------
+AC_MSG_CHECKING(gid_t)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+],[
+ gid_t devno;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_GID_T)],[AC_MSG_RESULT(no)])
+
+dnl wchar_t data type
+dnl -----------------
+AC_MSG_CHECKING(wchar_t)
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <wchar.h>
+],[
+ wchar_t chr;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_WCHAR_T)],[AC_MSG_RESULT(no)])
+
+dnl Data type sizes
+dnl ---------------
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(int32_t)
+AC_CHECK_SIZEOF(double)
+AC_CHECK_SIZEOF(long double)
+AC_CHECK_SIZEOF(wchar_t)
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(ino_t)
+if [[ "X$DOINTMAXSIZECHECK" = "Xyes" ]]
+then
+AC_CHECK_SIZEOF(intmax_t)
+fi
+
+dnl Compiler features
+dnl =================
+
+dnl const
+dnl -----
+AC_MSG_CHECKING(const)
+AC_TRY_COMPILE([
+#include <stdio.h>
+static char const msg[] = { "Test" };
+],[
+fputs(msg, stdout);
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CONST)],[AC_MSG_RESULT(no)])
+
+dnl inline
+dnl ------
+AC_MSG_CHECKING(inline)
+AC_TRY_COMPILE([
+#include <stdio.h>
+inline
+int
+summe(int a, int b)
+{
+ return (a + b);
+}
+],[
+int i = 5;
+int j = 6;
+int k;
+k = summe(i, j);
+],[AC_MSG_RESULT(yes);FOUNDINLINE='yes'],[AC_MSG_RESULT(no)])
+if [[ "X$FOUNDINLINE" = "Xyes" ]]
+then
+ AC_DEFINE(HAVE_INLINE)
+fi
+if [[ "X$FOUNDINLINE" = "Xyes" -a "X$USEINLINE" = "Xyes" ]]
+then
+ AC_DEFINE(USE_INLINE)
+fi
+
+dnl Keyword volatile
+dnl ----------------
+AC_MSG_CHECKING(volatile)
+AC_TRY_COMPILE([
+volatile int i = 0;
+],[
+i = 1;
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_VOLATILE)],[AC_MSG_RESULT(no)])
+
+dnl __attribute__((unused))
+dnl -----------------------
+AC_MSG_CHECKING(__attribute__((unused)))
+AC_TRY_COMPILE([
+static
+int
+my_add(int a, int b, int c __attribute__((unused)) )
+{
+ return (a + b);
+}
+],[
+ int i;
+ i = my_add(1, 2, 3);
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ATTRIBUTE_UNUSED)],[AC_MSG_RESULT(no)])
+
+dnl Representation of numeric values
+dnl ================================
+
+dnl Big-endian or little-endian byte ordering
+dnl -----------------------------------------
+AC_C_BIGENDIAN
+
+dnl Twos complement for negative integers
+dnl -------------------------------------
+AC_MSG_CHECKING(use of twos complement for negative integers)
+AC_TRY_RUN([
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_PROCESS_H
+#include <process.h>
+#endif
+
+int i1 = -1;
+
+#if SIZEOF_INT > 2
+#if SIZEOF_INT > 4
+#if SIZEOF_INT > 8
+#error "No test available yet for integers larger than 8 bytes!"
+#else
+int i2 = 0xFFFFFFFFFFFFFFFF;
+#endif
+#else
+int i2 = 0xFFFFFFFF;
+#endif
+#else
+int i2 = 0xFFFF;
+#endif
+
+int main(int argc, char *argv[])
+{
+ int exval = 1;
+ if (i1 == i2) exval = 0;
+ exit(exval); return exval;
+}
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_TWOS_COMPLEMENT)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_TWOS_COMPLEMENT)])
+
+dnl IEEE 754 double
+dnl ---------------
+IEEE_754_DOUBLE_WISHED='yes'
+IEEE_754_DOUBLE_FOUND='no'
+AC_MSG_CHECKING(IEEE 754 double)
+AC_TRY_RUN([
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include <math.h>
+
+static double td[] = {
+ INFINITY,
+ 1234.75,
+ 4.0,
+ 1.0,
+ 0.375,
+ 0.0,
+ -0.625,
+ -1.0,
+ -8.0,
+ -23.875,
+ -INFINITY
+};
+
+#if WORDS_BIGENDIAN
+static unsigned char tuc[] = {
+ /* INF */ 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 1234.75 */ 0x40, 0x93, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 4.0 */ 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 1.0 */ 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0.375 */ 0x3F, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -0.625 */ 0xBF, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -1.0 */ 0xBF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -8.0 */ 0xC0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -23.875 */ 0xC0, 0x37, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -INF */ 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+#else
+static unsigned char tuc[] = {
+ /* INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F,
+ /* 1234.75 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x93, 0x40,
+ /* 4.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40,
+ /* 1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F,
+ /* 0.375 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x3F,
+ /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* -0.625 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xBF,
+ /* -1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF,
+ /* -8.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xC0,
+ /* -23.875 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x37, 0xC0,
+ /* -INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF
+};
+#endif
+
+static
+#ifdef __cplusplus
+int
+test_double(double *dp, unsigned char *up)
+#else
+int
+test_double(dp, up)
+ double *dp;
+ unsigned char *up;
+#endif
+{
+ int back = 0;
+#if HAVE_MEMCMP
+ if(memcmp(dp, up, 8) == 0) {
+ back = 1;
+ }
+#else
+#if HAVE_BCMP
+ if(bcmp(dp, up, 8) == 0) {
+ back = 1;
+ }
+#else
+ unsigned char *cp1;
+ unsigned char *cp2;
+ size_t i;
+ back = 1;
+ cp1 = (unsigned char *)dp; cp2 = up;
+ for(i = 0; i < 8; i++) {
+ if(*(cp1++) != *(cp2++)) {
+ back = 0;
+ }
+ }
+#endif
+#endif
+ if(1 != back) {
+ printf("ERROR: %lg not conforming to IEEE 754!\n", *dp);
+ }
+ return back;
+}
+#ifdef __cplusplus
+int main(int argc, char *argv[])
+#else
+int main(argc, argv)
+ int argc;
+ char *argv[];
+#endif
+{
+ unsigned char *ucp;
+ double *dp;
+ size_t i;
+ int ev = 1;
+
+ if(8 == sizeof(double)) {
+ ev = 0;
+ ucp = tuc; dp = td;
+ for(i = 0; i < (sizeof(td)/sizeof(double)); i++) {
+ if(!test_double(dp, ucp)) {
+ ev = 1;
+ }
+ dp++;
+ ucp += 8;
+ }
+ } else {
+ printf("ERROR: Size of double is not 1!\n");
+ }
+ exit(ev);
+}
+
+],[AC_MSG_RESULT(yes);IEEE_754_DOUBLE_FOUND='yes'],[AC_MSG_RESULT(no);IEEE_754_DOUBLE_FOUND='no'],[AC_MSG_RESULT(yes);IEEE_754_DOUBLE_FOUND='yes'])
+if [[ "X$IEEE_754_DOUBLE_FOUND$IEEE_754_DOUBLE_WISHED" = "Xyesyes" ]]
+then
+ AC_DEFINE(HAVE_IEEE_754_DOUBLE)
+else
+ IEEE_754_DOUBLE_FOUND='no'
+fi
+dnl Compiler and system features
+dnl ============================
+
+dnl Feature large file functions
+dnl ----------------------------
+AC_MSG_CHECKING(_LARGEFILE64_SOURCE)
+FS64=''
+AC_TRY_COMPILE([
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+],[struct stat64 st;],[FS64='-D_LARGEFILE64_SOURCE=1'
+AC_DEFINE(HAVE_LARGEFILE64_SOURCE)
+AC_DEFINE(HAVE_TYPE_STAT64)
+AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+
+dnl Block size and block count in stat data
+dnl ---------------------------------------
AC_MSG_CHECKING(blocksize and blockcount in stat output)
AC_TRY_COMPILE([
#define _LARGEFILE64_SOURCE 1
@@ -1665,25 +1594,445 @@ AC_TRY_COMPILE([
],[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_FILE_BLKSIZECNT)],[AC_MSG_RESULT(no)])
+dnl Functions
+dnl =========
-AC_MSG_CHECKING(_fpos_t)
+dnl General functions
+dnl -----------------
+AC_HAVE_FUNCS(memset bzero memcpy bcopy memcmp bcmp)
+AC_HAVE_FUNCS(malloc calloc free)
+AC_HAVE_FUNCS(strcpy_s strcat_s)
+AC_HAVE_FUNCS(strcasecmp stricmp _stricmp)
+AC_HAVE_FUNCS(wcslen wcscpy_s wcscpy wcscat_s wcscat wcschr wcsrchr)
+AC_HAVE_FUNCS(wcscmp _wcscmp wcscasecmp _wcscasecmp wcsicmp _wcsicmp)
+AC_HAVE_FUNCS(getpid readlink getexecname lstat stat64 lstat64 localtime_r)
+AC_HAVE_FUNCS(geteuid fopen64 fopen_s _wfopen _wfopen64 _wfopen_s)
+AC_HAVE_FUNCS(fputws fputwc)
+AC_HAVE_FUNCS(setbuffer setbuf setvbuf)
+AC_HAVE_FUNCS(fileno _fileno setmode _setmode isatty _isatty)
+AC_HAVE_FUNCS(strtod _strtod wcstod _wcstod)
+AC_HAVE_FUNCS(_snprintf_s _snprintf snprintf _snwprintf_s _snwprintf snwprintf)
+AC_HAVE_FUNCS(swprintf)
+AC_HAVE_FUNCS(unlink _unlink wunlink _wunlink)
+AC_HAVE_FUNCS(rmdir _rmdir wrmdir _wrmdir)
+AC_HAVE_FUNCS(mkdir _mkdir wmkdir _wmkdir)
+AC_HAVE_FUNCS(strerror strerror_r)
+AC_HAVE_FUNCS(sigaction sigset signal sigprocmask sigemptyset)
+AC_HAVE_FUNCS(setpwent getpwent endpwent)
+AC_HAVE_FUNCS(getenv getenv_s setlocale)
+AC_HAVE_FUNCS(getcwd _getcwd _wgetcwd)
+AC_HAVE_FUNCS(getuid setuid setgid)
+AC_HAVE_FUNCS(chdir chmod chown)
+AC_HAVE_FUNCS(opendir readdir closedir)
+AC_HAVE_FUNCS(getgrent getgrgid getgrnam endgrent setgrent)
+AC_HAVE_FUNCS(getpwuid getpwnam)
+AC_HAVE_FUNCS(fopen fclose feof ferror fflush fread fwrite)
+AC_HAVE_FUNCS(_fclose _feof _ferror _fflush _fopen _fread _fwrite)
+AC_HAVE_FUNCS(_getenv_s _wgetenv _getpid)
+AC_HAVE_FUNCS(fetestexcept _clearfp)
+AC_HAVE_FUNCS(fork getrlimit setpgrp setsid syslog)
+AC_HAVE_FUNCS(gethostname)
+AC_HAVE_FUNCS(time localtime localtime_s)
+AC_HAVE_FUNCS(stat stat32 lstat32)
+AC_HAVE_FUNCS(_stat _stat32 _stat64 _lstat _lstat32 _lstat64)
+AC_HAVE_FUNCS(mpctl sysconf sysctl)
+AC_HAVE_FUNCS(popen _popen)
+AC_HAVE_FUNCS(read write _read _write)
+AC_HAVE_FUNCS(seed48)
+AC_HAVE_FUNCS(sprintf_s sscanf_s swscanf_s)
+AC_HAVE_FUNCS(strcat strchr strcmp strcpy strdup strlen strncmp strncpy _strdup)
+AC_HAVE_FUNCS(strncpy_s strrchr strtoimax strtol strtoll strtoul strtoull)
+AC_HAVE_FUNCS(strtoumax)
+AC_HAVE_FUNCS(wcsdup wcsncmp wcsncpy wcsncpy_s wcstoimax wcstol wcstoll)
+AC_HAVE_FUNCS(wcstoul wcstoull wcstoumax)
+AC_HAVE_FUNCS(_wcscat _wcschr _wcscpy _wcsdup _wcslen _wcsncmp _wcsncpy)
+AC_HAVE_FUNCS(_wcsrchr)
+AC_HAVE_FUNCS(tcflush tcgetattr)
+AC_HAVE_FUNCS(umask)
+AC_HAVE_FUNCS(GetFinalPathNameByHandle)
+
+dnl isgreater
+dnl ---------
+AC_MSG_CHECKING(isgreater)
AC_TRY_COMPILE([
#include <stdio.h>
-#include <stdlib.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+],[
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isgreater(x, 4.0)) {
+ a = 1;
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ISGREATER)],[AC_MSG_RESULT(no)])
+
+dnl isgreaterequal
+dnl --------------
+AC_MSG_CHECKING(isgreaterequal)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+],[
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isgreaterequal(x, 4.0)) {
+ a = 1;
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ISGREATEREQUAL)],[AC_MSG_RESULT(no)])
+
+dnl isless
+dnl ------
+AC_MSG_CHECKING(isless)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+],[
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isless(x, 6.0)) {
+ a = 1;
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ISLESS)],[AC_MSG_RESULT(no)])
+
+dnl islessequal
+dnl -----------
+AC_MSG_CHECKING(islessequal)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+],[
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (islessequal(x, 6.0)) {
+ a = 1;
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ISLESSEQUAL)],[AC_MSG_RESULT(no)])
+
+dnl isfinite
+dnl --------
+AC_MSG_CHECKING(isfinite)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+],[
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isfinite(x)) {
+ a = 1;
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ISFINITE)],[AC_MSG_RESULT(no)])
+
+dnl isnormal
+dnl --------
+AC_MSG_CHECKING(isnormal)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+],[
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (isnormal(x)) {
+ a = 1;
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ISNORMAL)],[AC_MSG_RESULT(no)])
+
+dnl _finite
+dnl -------
+AC_MSG_CHECKING(_finite)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+#if HAVE_FENV_H
+#include <fenv.h>
+#endif
+#if HAVE_FLOAT_H
+#include <float.h>
+#endif
+],[
+ double x;
+ int a = 0;
+ x = 5.0;
+ if (_finite(x)) {
+ a = 1;
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE__FINITE)],[AC_MSG_RESULT(no)])
+
+dnl fpclassify
+dnl ----------
+AC_MSG_CHECKING(fpclassify)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#if HAVE_MATH_H
+#include <math.h>
+#endif
+],[
+int cl;
+cl = fpclassify(-0.5);
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FPCLASSIFY)],[AC_MSG_RESULT(no)])
+
+dnl mkdir with 2 arguments
+dnl ----------------------
+AC_MSG_CHECKING([mkdir(path,mode);])
+AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
],[
- _fpos_t devno;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE__FPOS_T)],[AC_MSG_RESULT(no)])
+mkdir("test", 0755);
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_MKDIR2)],[AC_MSG_RESULT(no)])
+
+dnl qsort
+dnl -----
+AC_MSG_CHECKING(qsort)
+AC_TRY_COMPILE([
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if HAVE_SEARCH_H
+#include <search.h>
+#endif
+
+typedef struct { int a; int b; } test_t;
+
+test_t testvar[] = {
+ { 1, 1 },
+ { 2, 2 }
+};
+
+int testcmp(const void *l, const void *r)
+{
+ int back = 0;
+ const test_t *pl;
+ const test_t *pr;
+ pl = (const test_t *)l;
+ pr = (const test_t *)r;
+ if (pl->a < pr->a) {
+ back = -1;
+ }
+ else {
+ if (pl->a > pr->a) {
+ back = 1;
+ }
+ }
+}
+],[
+qsort(testvar, 2, sizeof(test_t), testcmp);
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_QSORT)],[AC_MSG_RESULT(no)])
+
+dnl bsearch
+dnl -------
+AC_MSG_CHECKING(bsearch)
+AC_TRY_COMPILE([
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if HAVE_SEARCH_H
+#include <search.h>
+#endif
+
+typedef struct { int a; int b; } test_t;
+
+test_t testvar[] = {
+ { 1, 1 },
+ { 2, 2 }
+};
+
+int testcmp(const void *l, const void *r)
+{
+ int back = 0;
+ const test_t *pl;
+ const test_t *pr;
+ pl = (const test_t *)l;
+ pr = (const test_t *)r;
+ if (pl->a < pr->a) {
+ back = -1;
+ }
+ else {
+ if (pl->a > pr->a) {
+ back = 1;
+ }
+ }
+}
+],[
+bsearch(&(testvar[0]), testvar, 2, sizeof(test_t), testcmp);
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_BSEARCH)],[AC_MSG_RESULT(no)])
+
+
+dnl setgroups
+dnl ---------
+AC_MSG_CHECKING(setgroups)
+AC_TRY_COMPILE([
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+],[
+ gid_t gid = 0;
+ if (0 != setgroups(1, &gid)) {
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_SETGROUPS)],[AC_MSG_RESULT(no)])
+
+dnl initgroups
+dnl ----------
+AC_MSG_CHECKING(initgroups)
+AC_TRY_COMPILE([
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_GRP_H
+#include <grp.h>
+#endif
+],[
+ gid_t gid = 0;
+ if (0 != initgroups("abcdefg", gid)) {
+ }
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_INITGROUPS)],[AC_MSG_RESULT(no)])
+
+dnl assert
+dnl ------
+AC_MSG_CHECKING(assert)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#include <assert.h>
+],[
+int i = -1;
+assert(0 < i);
+],[ASSERT_FOUND='yes';AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+
+dnl Mathematical functions
+dnl ----------------------
+AC_CHECK_LIB(m,acosh,AC_DEFINE(HAVE_ACOSH))
+AC_CHECK_LIB(m,acoshl,AC_DEFINE(HAVE_ACOSHL))
+AC_CHECK_LIB(m,acosl,AC_DEFINE(HAVE_ACOSL))
+AC_CHECK_LIB(m,asinh,AC_DEFINE(HAVE_ASINH))
+AC_CHECK_LIB(m,asinhl,AC_DEFINE(HAVE_ASINHL))
+AC_CHECK_LIB(m,asinl,AC_DEFINE(HAVE_ASINL))
+AC_CHECK_LIB(m,atan2,AC_DEFINE(HAVE_ATAN2))
+AC_CHECK_LIB(m,atan2l,AC_DEFINE(HAVE_ATAN2L))
+AC_CHECK_LIB(m,atanh,AC_DEFINE(HAVE_ATANH))
+AC_CHECK_LIB(m,atanhl,AC_DEFINE(HAVE_ATANHL))
+AC_CHECK_LIB(m,atanl,AC_DEFINE(HAVE_ATANL))
+AC_CHECK_LIB(m,ceil,AC_DEFINE(HAVE_CEIL))
+AC_CHECK_LIB(m,ceill,AC_DEFINE(HAVE_CEILL))
+AC_CHECK_LIB(m,coshl,AC_DEFINE(HAVE_COSHL))
+AC_CHECK_LIB(m,cosl,AC_DEFINE(HAVE_COSL))
+AC_CHECK_LIB(m,expl,AC_DEFINE(HAVE_EXPL))
+AC_CHECK_LIB(m,fabs,AC_DEFINE(HAVE_FABS))
+AC_CHECK_LIB(m,fabsl,AC_DEFINE(HAVE_FABSL))
+AC_CHECK_LIB(m,floor,AC_DEFINE(HAVE_FLOOR))
+AC_CHECK_LIB(m,floorl,AC_DEFINE(HAVE_FLOORL))
+AC_CHECK_LIB(m,labs,AC_DEFINE(HAVE_LABS))
+AC_CHECK_LIB(m,logl,AC_DEFINE(HAVE_LOGL))
+AC_CHECK_LIB(m,rint,AC_DEFINE(HAVE_RINT))
+AC_CHECK_LIB(m,rintl,AC_DEFINE(HAVE_RINTL))
+AC_CHECK_LIB(m,sinhl,AC_DEFINE(HAVE_SINHL))
+AC_CHECK_LIB(m,sqrt,AC_DEFINE(HAVE_SQRT))
+AC_CHECK_LIB(m,sqrtl,AC_DEFINE(HAVE_SQRTL))
+AC_CHECK_LIB(m,sinl,AC_DEFINE(HAVE_SINL))
+AC_CHECK_LIB(m,tanhl,AC_DEFINE(HAVE_TANHL))
+AC_CHECK_LIB(m,tanl,AC_DEFINE(HAVE_TANL))
+
+dnl Specific features of used libraries
+dnl ===================================
+
+dnl Real time library required for MySQL on some systems
+dnl ----------------------------------------------------
+AC_CHECK_LIB(rt,clock_gettime,[RTLIB='-lrt'])
+
+dnl Defaults differing between POSIX and Windows
+dnl --------------------------------------------
+case X$TARGETCLASS in
+ Xwindows)
+ AC_DEFINE(HAVE_BACKSLASH_AS_SEP)
+ AC_DEFINE(HAVE_LINE_END_CR_NL)
+ AC_DEFINE(HAVE_CASE_INSENSITIVE_PATHNAMES)
+ AC_DEFINE(HAVE_CASE_INSENSITIVE_USERNAMES)
+ ;;
+ *)
+ AC_DEFINE(HAVE_FILE_DEVINO)
+ AC_DEFINE(HAVE_FILE_UIDGID)
+ AC_DEFINE(HAVE_FILE_ATIMECTIME)
+ ;;
+esac
+
+dnl As long as software from DK tools 3 and 4 coexist, allow
+dnl backward compatibility in DK tools 4.
+dnl --------------------------------------------------------
+AC_DEFINE(HAVE_COMPATDKTOOLS3)
+
+dnl Network functions and data types
+dnl ================================
dnl Data type socklen_t
+dnl -------------------
AC_MSG_CHECKING(socklen_t)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
@@ -1698,6 +2047,18 @@ AC_TRY_COMPILE([
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
],[
socklen_t sz;
],[
@@ -1708,6 +2069,7 @@ AC_MSG_RESULT(no)
])
dnl Data type struct sockaddr_in
+dnl ----------------------------
AC_MSG_CHECKING(struct sockaddr_in)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
@@ -1719,9 +2081,21 @@ AC_TRY_COMPILE([
#if HAVE_NETDB_H
#include <netdb.h>
#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
],[
struct sockaddr_in sain;
],[
@@ -1732,6 +2106,7 @@ AC_MSG_RESULT(no)
])
dnl Data type struct sockaddr_in6
+dnl -----------------------------
AC_MSG_CHECKING(struct sockaddr_in6)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
@@ -1743,9 +2118,21 @@ AC_TRY_COMPILE([
#if HAVE_NETDB_H
#include <netdb.h>
#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
],[
struct sockaddr_in6 sain;
],[
@@ -1756,6 +2143,7 @@ AC_MSG_RESULT(no)
])
dnl Data type struct sockaddr_un
+dnl ----------------------------
AC_MSG_CHECKING(struct sockaddr_un)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
@@ -1770,9 +2158,21 @@ AC_TRY_COMPILE([
#if HAVE_NETDB_H
#include <netdb.h>
#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
],[
struct sockaddr_un sain;
],[
@@ -1783,6 +2183,7 @@ AC_MSG_RESULT(no)
])
dnl Data type struct addrinfo
+dnl -------------------------
AC_MSG_CHECKING(struct addrinfo)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
@@ -1794,9 +2195,21 @@ AC_TRY_COMPILE([
#if HAVE_NETDB_H
#include <netdb.h>
#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
],[
struct addrinfo adi;
],[
@@ -1807,6 +2220,7 @@ AC_MSG_RESULT(no)
])
dnl Data type sockaddr_storage
+dnl --------------------------
AC_MSG_CHECKING(struct sockaddr_storage)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
@@ -1824,9 +2238,21 @@ AC_TRY_COMPILE([
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
],[
struct sockaddr_storage sain;
],[
@@ -1837,6 +2263,7 @@ AC_MSG_RESULT(no)
])
dnl Typedef IN_ADDR
+dnl ---------------
AC_MSG_CHECKING(IN_ADDR)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
@@ -1870,6 +2297,7 @@ AC_MSG_RESULT(no)
])
dnl Typedef IN6_ADDR
+dnl ----------------
AC_MSG_CHECKING(IN6_ADDR)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
@@ -1902,85 +2330,489 @@ AC_DEFINE(HAVE_IN6_ADDR)
AC_MSG_RESULT(no)
])
-dnl Functions rand and srand
-AC_MSG_CHECKING(rand srand)
+dnl Function socket in standard library, -lxnet and -lsocket
+dnl --------------------------------------------------------
+SOCKLIB=''
+NSLLIB=''
+FOUND_SOCKET='no'
+AC_CHECK_FUNCS(socket,[
+LIB_SHARED_RES_NET='$(LIB_SHARED_RES_NET)'
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+AC_DEFINE(HAVE_SOCKET)
+],[
+AC_CHECK_LIB(xnet,socket,[
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+AC_DEFINE(HAVE_SOCKET)
+SOCKLIB='-lxnet'
+],[
+AC_CHECK_LIB(socket,socket,[
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+AC_DEFINE(HAVE_SOCKET)
+SOCKLIB='-lsocket'
+],[
+AC_CHECK_LIB(ws2_32,socket,[
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+FOUND_SOCKET='yes'
+AC_DEFINE(HAVE_SOCKET)
+SOCKLIB='-lws2_32'
+])
+])
+])
+])
+
+dnl Function setsockopt
+dnl -------------------
+AC_CHECK_FUNCS(setsockopt,[
+AC_DEFINE(HAVE_SETSOCKOPT)
+],[
+AC_CHECK_LIB(xnet,setsockopt,[
+AC_DEFINE(HAVE_SETSOCKOPT)
+],[
+AC_CHECK_LIB(socket,setsockopt,[
+AC_DEFINE(HAVE_SETSOCKOPT)
+],[
+AC_CHECK_LIB(ws2_32,setsockopt,[
+AC_DEFINE(HAVE_SETSOCKOPT)
+])
+])
+])
+])
+
+dnl Function getaddrinfo
+dnl --------------------
+AC_CHECK_FUNCS(getaddrinfo,[
+AC_DEFINE(HAVE_GETADDRINFO)
+],[
+AC_CHECK_LIB(xnet,getaddrinfo,[
+NSLLIB='-lxnet'
+AC_DEFINE(HAVE_GETADDRINFO)
+],[
+AC_CHECK_LIB(nsl,getaddrinfo,[
+NSLLIB='-lnsl'
+AC_DEFINE(HAVE_GETADDRINFO)
+],[
+AC_CHECK_LIB(socket,getaddrinfo,[
+NSLLIB='-lsocket'
+AC_DEFINE(HAVE_GETADDRINFO)
+],[
+AC_CHECK_LIB(ws2_32,getaddrinfo,[
+AC_DEFINE(HAVE_GETADDRINFO)
+])
+])
+])
+])
+])
+
+dnl Function getnameinfo (reverse getaddrinfo)
+dnl ------------------------------------------
+AC_CHECK_FUNCS(getnameinfo,[
+AC_DEFINE(HAVE_GETNAMEINFO)
+],[
+AC_CHECK_LIB(xnet,getnameinfo,[
+AC_DEFINE(HAVE_GETNAMEINFO)
+],[
+AC_CHECK_LIB(nsl,getnameinfo,[
+AC_DEFINE(HAVE_GETNAMEINFO)
+],[
+AC_CHECK_LIB(socket,getnameinfo,[
+AC_DEFINE(HAVE_GETNAMEINFO)
+],[
+AC_CHECK_LIB(ws2_32,getnameinfo,[
+AC_DEFINE(HAVE_GETNAMEINFO)
+])
+])
+])
+])
+])
+
+dnl Function gethostbyname
+dnl ----------------------
+AC_CHECK_FUNCS(gethostbyname,[
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+],[
+AC_CHECK_LIB(xnet,gethostbyname,[
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+],[
+AC_CHECK_LIB(nsl,gethostbyname,[
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+],[
+AC_CHECK_LIB(socket,gethostbyname,[
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+],[
+AC_CHECK_LIB(ws3_32,gethostbyname,[
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+])
+])
+])
+])
+])
+
+dnl Function or macro htons
+dnl -----------------------
+AC_MSG_CHECKING(htons)
AC_TRY_COMPILE([
-#include <stdio.h>
-#include <stdlib.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
],[
- srand(25);
- printf("%d\n", rand());
- printf("%d\n", RAND_MAX);
-],[AC_MSG_RESULT(yes)
-AC_DEFINE(HAVE_RAND)
-AC_DEFINE(HAVE_SRAND)],[AC_MSG_RESULT(no)])
+ unsigned short s;
+ s = htons(5);
+],[
+AC_DEFINE(HAVE_HTONS)
+AC_MSG_RESULT(yes)
+],[
+AC_MSG_RESULT(no)
+])
-AC_MSG_CHECKING(initstate setstate random)
+dnl Function or macro ntohs
+dnl -----------------------
+AC_MSG_CHECKING(ntohs)
AC_TRY_COMPILE([
-#include <stdio.h>
-#include <stdlib.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
],[
-char rs[256];
-initstate(25, rs, sizeof(rs));
-setstate(rs);
-printf("%ld\n", random());
+ unsigned short s;
+ s = ntohs(5);
],[
+AC_DEFINE(HAVE_NTOHS)
AC_MSG_RESULT(yes)
-AC_DEFINE(HAVE_INITSTATE)
-AC_DEFINE(HAVE_SETSTATE)
-AC_DEFINE(HAVE_RANDOM)
-],[AC_MSG_RESULT(no)])
+],[
+AC_MSG_RESULT(no)
+])
-dnl Functions lrand48 nrand48 seed48
-AC_MSG_CHECKING(lrand48 nrand48 seed48)
+dnl Function or macro htonl
+dnl -----------------------
+AC_MSG_CHECKING(htonl)
AC_TRY_COMPILE([
-#include <stdio.h>
-#include <stdlib.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
],[
-unsigned short sv[3];
-sv[0] = 0;
-sv[1] = 1;
-sv[2] = 2;
-seed48(sv);
-printf("%ld\n", lrand48());
-printf("%ld\n", nrand48(sv));
+ unsigned long s;
+ s = htonl(5);
],[
+AC_DEFINE(HAVE_HTONL)
AC_MSG_RESULT(yes)
-AC_DEFINE(HAVE_LRAND48)
-AC_DEFINE(HAVE_NRAND48)
-],[AC_MSG_RESULT(no)])
+],[
+AC_MSG_RESULT(no)
+])
-dnl Size of some types
-AC_CHECK_SIZEOF(off_t)
-AC_CHECK_SIZEOF(off64_t)
-AC_CHECK_SIZEOF(ino_t)
-AC_CHECK_SIZEOF(ino64_t)
+dnl Function or macro ntohl
+dnl -----------------------
+AC_MSG_CHECKING(ntohl)
+AC_TRY_COMPILE([
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+],[
+ unsigned long s;
+ s = ntohl(5);
+],[
+AC_DEFINE(HAVE_NTOHL)
+AC_MSG_RESULT(yes)
+],[
+AC_MSG_RESULT(no)
+])
+
+dnl Function inet_addr
+dnl ------------------
+AC_CHECK_FUNCS(inet_addr,[
+AC_DEFINE(HAVE_INET_ADDR)
+],[
+AC_CHECK_LIB(xnet,inet_addr,[
+AC_DEFINE(HAVE_INET_ADDR)
+],[
+AC_CHECK_LIB(nsl,inet_addr,[
+AC_DEFINE(HAVE_INET_ADDR)
+],[
+AC_CHECK_LIB(socket,inet_addr,[
+AC_DEFINE(HAVE_INET_ADDR)
+],[
+AC_CHECK_LIB(ws2_32,inet_addr,[
+AC_DEFINE(HAVE_INET_ADDR)
+])
+])
+])
+])
+])
+
+dnl Function inet_aton
+dnl ------------------
+AC_CHECK_FUNCS(inet_aton,[
+AC_DEFINE(HAVE_INET_ATON)
+],[
+AC_CHECK_LIB(xnet,inet_aton,[
+AC_DEFINE(HAVE_INET_ATON)
+],[
+AC_CHECK_LIB(nsl,inet_aton,[
+AC_DEFINE(HAVE_INET_ATON)
+],[
+AC_CHECK_LIB(socket,inet_aton,[
+AC_DEFINE(HAVE_INET_ATON)
+],[
+AC_CHECK_LIB(ws2_32,inet_aton,[
+AC_DEFINE(HAVE_INET_ATON)
+])
+])
+])
+])
+])
+
+dnl Function inet_pton
+dnl ------------------
+AC_CHECK_FUNCS(inet_pton,[
+AC_DEFINE(HAVE_INET_PTON)
+],[
+AC_CHECK_LIB(xnet,inet_pton,[
+AC_DEFINE(HAVE_INET_PTON)
+],[
+AC_CHECK_LIB(nsl,inet_pton,[
+AC_DEFINE(HAVE_INET_PTON)
+],[
+AC_CHECK_LIB(socket,inet_pton,[
+AC_DEFINE(HAVE_INET_PTON)
+],[
+AC_CHECK_LIB(ws2_32,inet_pton,[
+AC_DEFINE(HAVE_INET_PTON)
+])
+])
+])
+])
+])
+
+dnl Function inet_ntop (reverse inet_pton)
+dnl --------------------------------------
+AC_CHECK_FUNCS(inet_ntop,[
+AC_DEFINE(HAVE_INET_NTOP)
+],[
+AC_CHECK_LIB(xnet,inet_ntop,[
+AC_DEFINE(HAVE_INET_NTOP)
+],[
+AC_CHECK_LIB(nsl,inet_ntop,[
+AC_DEFINE(HAVE_INET_NTOP)
+],[
+AC_CHECK_LIB(socket,inet_ntop,[
+AC_DEFINE(HAVE_INET_NTOP)
+],[
+AC_CHECK_LIB(ws2_32,inet_ntop,[
+AC_DEFINE(HAVE_INET_NTOP)
+])
+])
+])
+])
+])
+
+dnl Function getpeername
+dnl --------------------
+AC_CHECK_FUNCS(getpeername,[
+AC_DEFINE(HAVE_GETPEERNAME)
+],[
+AC_CHECK_LIB(xnet,getpeername,[
+AC_DEFINE(HAVE_GETPEERNAME)
+],[
+AC_CHECK_LIB(nsl,getpeername,[
+AC_DEFINE(HAVE_GETPEERNAME)
+],[
+AC_CHECK_LIB(socket,getpeername,[
+AC_DEFINE(HAVE_GETPEERNAME)
+],[
+AC_CHECK_LIB(ws2_32,getpeername,[AC_DEFINE(HAVE_GETPEERNAME)])
+])
+])
+])
+])
+
+dnl Function getsockname
+dnl --------------------
+AC_CHECK_FUNCS(getsockname,[
+AC_DEFINE(HAVE_GETSOCKNAME)
+],[
+AC_CHECK_LIB(xnet,getsockname,[
+AC_DEFINE(HAVE_GETSOCKNAME)
+],[
+AC_CHECK_LIB(nsl,getsockname,[
+AC_DEFINE(HAVE_GETSOCKNAME)
+],[
+AC_CHECK_LIB(socket,getsockname,[
+AC_DEFINE(HAVE_GETSOCKNAME)
+],[
+AC_CHECK_LIB(ws2_32,getsockname,[AC_DEFINE(HAVE_GETSOCKNAME)])
+])
+])
+])
+])
+
+dnl Function select
+dnl ---------------
+AC_CHECK_FUNCS(select,[
+AC_DEFINE(HAVE_SELECT)
+],[
+AC_CHECK_LIB(xnet,select,[
+AC_DEFINE(HAVE_SELECT)
+],[
+AC_CHECK_LIB(nsl,select,[
+AC_DEFINE(HAVE_SELECT)
+],[
+AC_CHECK_LIB(socket,select,[
+AC_DEFINE(HAVE_SELECT)
+],[
+AC_CHECK_LIB(ws2_32,select,[AC_DEFINE(HAVE_SELECT)])
+])
+])
+])
+])
-dnl Check whether to use fallback numeric limits
-dnl Not handled by configure script. Set manually if needed.
-dnl AC_ARG_WITH(fallback-limits,[ --with-fallback-limits Allow use of fallback limits (no)],[AC_DEFINE(USE_FALLBACK_NUMERIC_LIMITS)])
-AC_ARG_WITH(fallback-limits,[AS_HELP_STRING([--with-fallback-limits],[Allow use of fallback limits (no / yes)])],[AC_DEFINE(USE_FALLBACK_NUMERIC_LIMITS)])
+dnl Some systems have socket and name service functionality in one library
+dnl ----------------------------------------------------------------------
+if [[ "X$SOCKLIB" = "X$NSLLIB" ]]
+then
+NSLLIB=''
+fi
-dnl Check whether we are allowed to use printf and scanf
-dnl Not handled by configure script. Set manually if needed.
-dnl AC_ARG_WITH(printf-scanf,[ --with-printf-scanf Allow use of printf and scanf (yes)],[CAN_USE_PRINTF_SCANF="$withval"])
-AC_ARG_WITH(printf-scanf,[AS_HELP_STRING([--with-printf-scanf],[Allow use of printf and scanf (yes / no)])],[CAN_USE_PRINTF_SCANF="$withval"])
+dnl Systemd
+dnl -------
+rundir="$runstatedir"
-if [[ "X$CAN_USE_PRINTF_SCANF" != "Xno" ]]
+if [[ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" = "X" -a -d /lib/systemd/system ]]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ AC_DEFINE(HAVE_SYSTEMD)
+ rundir='/run'
+elif [[ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/usr/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ AC_DEFINE(HAVE_SYSTEMD)
+ rundir='/run'
+elif [[ "X$ENA_SYSTEMD" = "Xauto" -a "X$systemddir" != "X" ]]
+then
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ AC_DEFINE(HAVE_SYSTEMD)
+ rundir='/run'
+elif [[ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" = "X" -a -d /lib/systemd/system ]]
then
- AC_DEFINE(USE_PRINTF_SCANF)
+ ENA_SYSTEMD='yes'
+ systemddir='/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ AC_DEFINE(HAVE_SYSTEMD)
+ rundir='/run'
+elif [[ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]]
+then
+ ENA_SYSTEMD='yes'
+ systemddir='/usr/lib/systemd/system'
+ FOUND_SYSTEMD='yes'
+ AC_DEFINE(HAVE_SYSTEMD)
+ rundir='/run'
+elif [[ "X$ENA_SYSTEMD" = "Xyes" -a "X$systemddir" != "X" ]]
+then
+ ENA_SYSTEMD='yes'
+ FOUND_SYSTEMD='yes'
+ AC_DEFINE(HAVE_SYSTEMD)
+ rundir='/run'
+elif [[ "X$systemddir" = "X" -a -d /lib/systemd/system ]]
+then
+ systemddir='/lib/systemd/system'
+elif [[ "X$systemddir" = "X" -a -d /usr/lib/systemd/system ]]
+then
+ systemddir='/usr/lib/systemd/system'
+elif [[ "X$systemddir" = "X" ]]
+then
+ systemddir='/lib/systemd/system'
fi
-dnl Defaults differung between POSIX and Windows
-AC_DEFINE(HAVE_FILE_DEVINO)
-AC_DEFINE(HAVE_FILE_UIDGID)
-AC_DEFINE(HAVE_FILE_ATIMECTIME)
-dnl As long as software from DK tools 3 and 4 coexist, allow
-dnl backward compatibility in DK tools 4.
-AC_DEFINE(HAVE_COMPATDKTOOLS3)
+
dnl Find names of test programs
+dnl ===========================
SEP=`cat sep.txt`
for i in test*.ctr
do
@@ -1993,41 +2825,13 @@ else
fi
done
-if [[ "X$SUITE" = "Xgui" ]]
-then
- AC_DEFINE(HAVE_WXWIDGETS)
-else
- WXCPPFLAGS=''
- WXCXXFLAGS=''
- WXCFLAGS=''
- WXLDFLAGS=''
-fi
-
-WXMAJOR=''
-WXMINOR=''
-
-if [[ "X$WXVERSION" != "X" ]]
-then
- WXMAJOR=`echo $WXVERSION | cut -f 1 -d .`
- WXMINOR=`echo $WXVERSION | cut -f 2 -d .`
-fi
-[[ "X$WXMAJOR" != "X" ]] || WXMAJOR="0"
-if [[ "$WXMAJOR" -ge 3 ]]
-then
-AC_DEFINE(HAVE_WX_CHARTYPE_H)
-elif [[ "$WXMAJOR" -ge 2 ]]
-then
-AC_DEFINE(HAVE_WX_WXCHAR_H)
-fi
-
-dnl BACKWARD COMPATIBILITY SECTION (VERSION 3) START
+dnl Used libraries
+dnl ==============
LIBPNG=''
LIBJPEG=''
LIBTIFF=''
ANYDB=''
-SNMPPROG=''
-MYSQLPROG=''
PTHREADLIB=''
LIBDK3WXOBJ=''
LIBDK4WXOBJ=''
@@ -2036,11 +2840,25 @@ DBLIB=''
DBLIBSOCK=''
NETSNMP_LIBS=''
NETSNMP_CFLAGS=''
-NETSNMP_LIBS=`net-snmp-config --libs`
-NETSNMP_CFLAGS=`net-snmp-config --cflags`
-AC_HEADER_CHECK(stdio.h, AC_DEFINE(HAVE_STDIO_H))
-AC_HEADER_CHECK(conio.h, AC_DEFINE(HAVE_CONIO_H))
-AC_HEADER_CHECK(grp.h, AC_DEFINE(HAVE_GRP_H))
+
+dnl NetSNMP
+dnl -------
+TESTSNMPCONFIG=''
+if [[ "X$CROSSBUILD" != "Xyes" ]]
+then
+ TESTSNMPCONFIG='net-snmp-config'
+else
+ CROSSPREFIX=`$PKG_CONFIG --variable=prefix zlib`
+ TESTSNMPCONFIG=`find $CROSSPREFIX -name 'net-snmp-config'`
+fi
+if [[ "X$TESTSNMPCONFIG" != "X" ]]
+then
+ NETSNMP_LIBS=`$TESTSNMPCONFIG --libs`
+ NETSNMP_CFLAGS=`$TESTSNMPCONFIG --cflags`
+fi
+
+dnl Database libraries
+dnl ------------------
AC_HEADER_CHECK(gdbm.h, [FOUND_GDBM='yes'])
AC_HEADER_CHECK(ndbm.h, [FOUND_NDBM='yes'])
case "X${FOUND_NDBM}${USE_NDBM}${FOUND_GDBM}" in
@@ -2061,158 +2879,130 @@ if [[ "X$ANYDB" != "Xndbm" -a "X$FOUND_GDBM" = "Xyes" ]]
then
AC_DEFINE(HAVE_GDBM_H)
fi
-AC_HEADER_CHECK(db.h, [FOUND_BDB='yes';ANYDB='db';DBLIB="-ldb";AC_DEFINE(HAVE_DB_H)])
-AC_HEADER_CHECK(dir.h, AC_DEFINE(HAVE_DIR_H))
-AC_HEADER_CHECK(err.h, AC_DEFINE(HAVE_ERR_H))
-AC_HEADER_CHECK(shadow.h, AC_DEFINE(HAVE_SHADOW_H))
-AC_HEADER_CHECK(stropts.h, AC_DEFINE(HAVE_STROPTS_H))
-AC_HEADER_CHECK(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
-AC_HEADER_CHECK(sysres.h, AC_DEFINE(HAVE_SYSRES_H))
-AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H))
-AC_HEADER_CHECK(vararg.h, AC_DEFINE(HAVE_VARARG_H))
-AC_HEADER_CHECK(varargs.h, AC_DEFINE(HAVE_VARARGS_H))
-AC_HEADER_CHECK(ntifs.h, AC_DEFINE(HAVE_NTIFS_H))
-AC_HEADER_CHECK(sys/file.h, AC_DEFINE(HAVE_SYS_FILE_H))
-AC_HEADER_CHECK(sys/resource.h, AC_DEFINE(HAVE_SYS_RESOURCE_H))
-AC_HEADER_CHECK(sys/statvfs.h, AC_DEFINE(HAVE_SYS_STATVFS_H))
-AC_HEADER_CHECK(sys/stropts.h, AC_DEFINE(HAVE_SYS_STROPTS_H))
-AC_HEADER_CHECK(sys/sunddi.h, AC_DEFINE(HAVE_SYS_SUNDDI_H))
-AC_HEADER_CHECK(sys/sysctl.h, AC_DEFINE(HAVE_SYS_SYSCTL_H))
-AC_HEADER_CHECK(sys/systeminfo.h, AC_DEFINE(HAVE_SYS_SYSTEMINFO_H))
-AC_HEADER_CHECK(sys/termios.h, AC_DEFINE(HAVE_SYS_TERMIOS_H))
-AC_HEADER_CHECK(sys/ttold.h, AC_DEFINE(HAVE_SYS_TTOLD_H))
-AC_HEADER_CHECK(sys/uio.h, AC_DEFINE(HAVE_SYS_UIO_H))
-AC_HEADER_CHECK(sys/wait.h,AC_DEFINE(HAVE_SYS_WAIT_H))
+AC_HEADER_CHECK(db.h, [FOUND_BDB='yes';ANYDB='db';DBLIB='-ldb';AC_DEFINE(HAVE_DB_H)])
+
+
+dnl libpng
+dnl ------
+FOUND_PNG='no'
+AC_HEADER_CHECK(png.h, [LIBPNG='-lpng';FOUND_PNG='yes';AC_DEFINE(HAVE_PNG_H)])
+FOUND_JPG='no'
+
+dnl libjpeg
+dnl -------
+AC_HEADER_CHECK(jpeglib.h, [LIBJPEG='-ljpeg';FOUND_JPG='yes';AC_DEFINE(HAVE_JPEGLIB_H)])
+
+dnl libtiff
+dnl -------
+FOUND_TIFF='no'
+AC_HEADER_CHECK(tiff.h, [LIBTIFF='-ltiff';FOUND_TIFF='yes';AC_DEFINE(HAVE_TIFF_H)])
+
+dnl wxWidgets
+dnl ---------
+WX_HEADER_FOUND='no'
+WX_HEADER_FILENAME=''
+AC_MSG_CHECKING(wx-config)
+TESTWXCONFIG=''
+if [[ "X$CROSSBUILD" = "Xyes" -a "X$PKG_CONFIG" != "X:" ]]
+then
+ CROSSPREFIX=`$PKG_CONFIG --variable=prefix zlib`
+ WX_HEADER_FILENAME=`find $CROSSPREFIX -name 'wx.h'`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-3.0'`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-gtk3'`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config-gtk2'`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wx-config'`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`find $CROSSPREFIX -name 'wxconfig'`
+elif [[ "X$CROSSBUILD" != "Xyes" ]]
+then
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`which wx-config-3.0`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`which wx-config-gtk3`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`which wx-config-gtk2`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`which wx-config`
+ [[ "X$TESTWXCONFIG" != "X" ]] || TESTWXCONFIG=`which wxconfig`
+fi
+AC_MSG_RESULT($TESTWXCONFIG)
-AC_HEADER_CHECK(winbase.h,[AC_DEFINE(HAVE_WINBASE_H)],[],[
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-])
-AC_HEADER_CHECK(winreg.h,[AC_DEFINE(HAVE_WINREG_H)],[],[
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-#if HAVE_WINBASE_H
-#include <winbase.h>
-#endif
-])
-AC_HEADER_CHECK(wincon.h,[AC_DEFINE(HAVE_WINCON_H)],[],[
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-#if HAVE_WINBASE_H
-#include <winbase.h>
-#endif
-])
-AC_HEADER_CHECK(png.h, [LIBPNG="-lpng";AC_DEFINE(HAVE_PNG_H)])
-AC_HEADER_CHECK(jpeglib.h, [LIBJPEG="-ljpeg";AC_DEFINE(HAVE_JPEGLIB_H)])
-AC_HEADER_CHECK(tiff.h, [LIBTIFF="-ltiff";AC_DEFINE(HAVE_TIFF_H)])
+dnl Check for wxWidgets
+dnl -------------------
+AC_MSG_CHECKING(wxWidgets)
+if [[ "XWX_HEADER_FILENAME" != "X" ]]
+then
+ WX_HEADER_FOUND='yes'
+fi
+AC_CHECK_HEADER(wx/wx.h,[WX_HEADER_FOUND='yes'])
+if [[ "X$WX_HEADER_FOUND" = "Xyes" -a "X$TESTWXCONFIG" != "X" ]]
+then
+ WXCPPFLAGS=`$TESTWXCONFIG --cppflags`
+ WXCXXFLAGS=`$TESTWXCONFIG --cxxflags`
+ WXVERSION=`$TESTWXCONFIG --version`
+ WXCFLAGS=`$TESTWXCONFIG --cflags`
+ WXLDFLAGS=`$TESTWXCONFIG --libs`
+ WXCONFIGLIBS="$WXLDFLAGS"
+elif [[ "X$WX_HEADER_FOUND" = "Xyes" ]]
+then
+ AC_MSG_WARN([wxWidgets headers found, bot no wx-config!])
+fi
+if [[ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]]
+then
+ WXCPPFLAGS=`echo $WXCPPFLAGS | sed -e 's/\-I/-isystem /g'`
+ WXCXXFLAGS=`echo $WXCXXFLAGS | sed -e 's/\-I/-isystem /g'`
+ WXCFLAGS=`echo $WXCFLAGS | sed -e 's/\-I/-isystem /g'`
+fi
+FOUND_WX='no'
+if [[ "X$WXLDFLAGS" != "X" ]]
+then
+ FOUND_WX='yes'
+ AC_DEFINE(HAVE_WXWIDGETS)
+fi
+WXMAJOR=''
+WXMINOR=''
+if [[ "X$WXVERSION" != "X" ]]
+then
+ WXMAJOR=`echo $WXVERSION | cut -f 1 -d .`
+ WXMINOR=`echo $WXVERSION | cut -f 2 -d .`
+fi
+[[ "X$WXMAJOR" != "X" ]] || WXMAJOR='0'
+
+if [[ "$WXMAJOR" -ge 3 ]]
+then
+AC_DEFINE(HAVE_WX_DEFS_H)
+AC_DEFINE(HAVE_WX_CHARTYPE_H)
+elif [[ "$WXMAJOR" -ge 2 ]]
+then
+AC_DEFINE(HAVE_WX_DEFS_H)
+AC_DEFINE(HAVE_WX_WXCHAR_H)
+fi
+AC_MSG_RESULT($FOUND_WX)
+
+dnl MySQL / MariaDB
+dnl ---------------
+FOUND_MYSQL='no'
+AC_HEADER_CHECK(mariadb/mysql.h, [
+MYSQLLIB='-lmariadbclient'
+FOUND_MYSQL='yes'
+AC_DEFINE(HAVE_MARIADB_MYSQL_H)
+],[
AC_HEADER_CHECK(mysql/mysql.h, [
-MYSQLPROG='mysqlprog'
MYSQLLIB='-lmysqlclient'
+FOUND_MYSQL='yes'
AC_DEFINE(HAVE_MYSQL_MYSQL_H)
],[
AC_HEADER_CHECK(mysql.h, [
-MYSQLPROG='mysqlprog'
MYSQLLIB='-lmysqlclient'
+FOUND_MYSQL='yes'
AC_DEFINE(HAVE_MYSQL_H)
]
)
]
)
-AC_HEADER_CHECK(lprng.h, AC_DEFINE(HAVE_LPRNG_H))
-AC_HEADER_CHECK(pthread.h, [PTHREADLIB='-lpthread';AC_DEFINE(HAVE_PTHREAD_H)])
-AC_CHECK_LIB(m,acosh,AC_DEFINE(HAVE_ACOSH))
-AC_CHECK_LIB(m,acoshl,AC_DEFINE(HAVE_ACOSHL))
-AC_CHECK_LIB(m,acosl,AC_DEFINE(HAVE_ACOSL))
-AC_CHECK_LIB(m,asinh,AC_DEFINE(HAVE_ASINH))
-AC_CHECK_LIB(m,asinhl,AC_DEFINE(HAVE_ASINHL))
-AC_CHECK_LIB(m,asinl,AC_DEFINE(HAVE_ASINL))
-AC_CHECK_LIB(m,atan2,AC_DEFINE(HAVE_ATAN2))
-AC_CHECK_LIB(m,atan2l,AC_DEFINE(HAVE_ATAN2L))
-AC_CHECK_LIB(m,atanh,AC_DEFINE(HAVE_ATANH))
-AC_CHECK_LIB(m,atanhl,AC_DEFINE(HAVE_ATANHL))
-AC_CHECK_LIB(m,atanl,AC_DEFINE(HAVE_ATANL))
-AC_CHECK_LIB(m,ceil,AC_DEFINE(HAVE_CEIL))
-AC_CHECK_LIB(m,ceill,AC_DEFINE(HAVE_CEILL))
-AC_CHECK_LIB(m,coshl,AC_DEFINE(HAVE_COSHL))
-AC_CHECK_LIB(m,cosl,AC_DEFINE(HAVE_COSL))
-AC_CHECK_LIB(m,expl,AC_DEFINE(HAVE_EXPL))
-AC_CHECK_LIB(m,fabs,AC_DEFINE(HAVE_FABS))
-AC_CHECK_LIB(m,fabsl,AC_DEFINE(HAVE_FABSL))
-AC_CHECK_LIB(m,floor,AC_DEFINE(HAVE_FLOOR))
-AC_CHECK_LIB(m,floorl,AC_DEFINE(HAVE_FLOORL))
-AC_CHECK_LIB(m,labs,AC_DEFINE(HAVE_LABS))
-AC_CHECK_LIB(m,logl,AC_DEFINE(HAVE_LOGL))
-AC_CHECK_LIB(m,rint,AC_DEFINE(HAVE_RINT))
-AC_CHECK_LIB(m,rintl,AC_DEFINE(HAVE_RINTL))
-AC_CHECK_LIB(m,sinhl,AC_DEFINE(HAVE_SINHL))
-AC_CHECK_LIB(m,sqrt,AC_DEFINE(HAVE_SQRT))
-AC_CHECK_LIB(m,sqrtl,AC_DEFINE(HAVE_SQRTL))
-AC_CHECK_LIB(m,sinl,AC_DEFINE(HAVE_SINL))
-AC_CHECK_LIB(m,tanhl,AC_DEFINE(HAVE_TANHL))
-AC_CHECK_LIB(m,tanl,AC_DEFINE(HAVE_TANL))
-AC_CHECK_LIB(png, png_get_pixels_per_inch,AC_DEFINE(HAVE_PNG_GET_PIXELS_PER_INCH))
-AC_HAVE_FUNCS(getuid setuid setgid)
-AC_HAVE_FUNCS(chdir chmod chown)
-AC_HAVE_FUNCS(opendir readdir closedir)
-AC_HAVE_FUNCS(getgrent getgrgid getgrnam endgrent setgrent)
-AC_HAVE_FUNCS(getpwuid getpwnam)
-AC_HAVE_FUNCS(fopen fclose feof ferror fflush fread fwrite)
-AC_HAVE_FUNCS(_fclose _feof _ferror _fflush _fopen _fread _fwrite)
-AC_HAVE_FUNCS(_getenv_s _wgetenv _getpid)
-AC_HAVE_FUNCS(fetestexcept _clearfp)
-AC_HAVE_FUNCS(fork getrlimit setpgrp setsid syslog)
-AC_HAVE_FUNCS(gethostname)
-AC_HAVE_FUNCS(time localtime localtime_s)
-AC_HAVE_FUNCS(stat stat32 lstat32)
-AC_HAVE_FUNCS(_stat _stat32 _stat64 _lstat _lstat32 _lstat64)
-AC_HAVE_FUNCS(mpctl sysconf sysctl)
-AC_HAVE_FUNCS(popen _popen)
-AC_HAVE_FUNCS(read write _read _write)
-AC_HAVE_FUNCS(seed48)
-AC_HAVE_FUNCS(sprintf_s sscanf_s swscanf_s)
-AC_HAVE_FUNCS(strcat strchr strcmp strcpy strdup strlen strncmp strncpy _strdup)
-AC_HAVE_FUNCS(strncpy_s strrchr strtoimax strtol strtoll strtoul strtoull)
-AC_HAVE_FUNCS(strtoumax)
-AC_HAVE_FUNCS(wcsdup wcsncmp wcsncpy wcsncpy_s wcstoimax wcstol wcstoll)
-AC_HAVE_FUNCS(wcstoul wcstoull wcstoumax)
-AC_HAVE_FUNCS(_wcscat _wcschr _wcscpy _wcsdup _wcslen _wcsncmp _wcsncpy)
-AC_HAVE_FUNCS(_wcsrchr)
-AC_HAVE_FUNCS(tcflush tcgetattr)
-AC_HAVE_FUNCS(umask)
-AC_HAVE_FUNCS(GetFinalPathNameByHandle)
-
-dnl wchar_t data type
-AC_MSG_CHECKING(wchar_t)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <wchar.h>
-],[
- wchar_t chr;
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_WCHAR_T)],[AC_MSG_RESULT(no)])
+])
-dnl mkdir with 2 arguments
-AC_MSG_CHECKING(mkdir path mode)
-AC_TRY_COMPILE([
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-],[
-mkdir("test", 0755);
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_MKDIR2)],[AC_MSG_RESULT(no)])
+dnl Resolution information in PNG files
+dnl -----------------------------------
+AC_CHECK_LIB(png, png_get_pixels_per_inch,AC_DEFINE(HAVE_PNG_GET_PIXELS_PER_INCH))
dnl HAVE_DB_CURSOR_C_GET
+dnl --------------------
AC_TRY_COMPILE([
#include <db.h>
],[
@@ -2222,41 +3012,81 @@ DBC *cp;
cp->c_get(cp, &k, &v, DB_FIRST);
],[AC_DEFINE(HAVE_DB_CURSOR_C_GET)])
-dnl const
-AC_MSG_CHECKING(const)
+dnl Random number generation
+dnl ========================
+
+dnl Functions rand and srand
+dnl ------------------------
+AC_MSG_CHECKING(rand srand)
AC_TRY_COMPILE([
#include <stdio.h>
-static char const msg[] = { "Test" };
+#include <stdlib.h>
],[
-fputs(msg, stdout);
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CONST)],[AC_MSG_RESULT(no)])
+ srand(25);
+ printf("%d\n", rand());
+ printf("%d\n", RAND_MAX);
+],[AC_MSG_RESULT(yes)
+AC_DEFINE(HAVE_RAND)
+AC_DEFINE(HAVE_SRAND)],[AC_MSG_RESULT(no)])
-dnl inline
-AC_MSG_CHECKING(inline)
+dnl Function family initstate setstat random
+dnl ----------------------------------------
+AC_MSG_CHECKING(initstate setstate random)
AC_TRY_COMPILE([
#include <stdio.h>
-
-inline
-int
-summe(int a, int b)
-{
- return (a + b);
-}
-
+#include <stdlib.h>
],[
-int i = 5;
-int j = 6;
-int k;
+char rs[256];
+initstate(25, rs, sizeof(rs));
+setstate(rs);
+printf("%ld\n", random());
+],[
+AC_MSG_RESULT(yes)
+AC_DEFINE(HAVE_INITSTATE)
+AC_DEFINE(HAVE_SETSTATE)
+AC_DEFINE(HAVE_RANDOM)
+],[AC_MSG_RESULT(no)])
-k = summe(i, j);
-],[AC_MSG_RESULT(yes);FOUNDINLINE="yes"],[AC_MSG_RESULT(no)])
+dnl Functions lrand48 nrand48 seed48
+dnl --------------------------------
+AC_MSG_CHECKING(lrand48 nrand48 seed48)
+AC_TRY_COMPILE([
+#include <stdio.h>
+#include <stdlib.h>
+],[
+unsigned short sv[3];
+sv[0] = 0;
+sv[1] = 1;
+sv[2] = 2;
+seed48(sv);
+printf("%ld\n", lrand48());
+printf("%ld\n", nrand48(sv));
+],[
+AC_MSG_RESULT(yes)
+AC_DEFINE(HAVE_LRAND48)
+AC_DEFINE(HAVE_NRAND48)
+],[AC_MSG_RESULT(no)])
-if [[ "X$FOUNDINLINE" = "Xyes" -a "X$USEINLINE" = "Xyes" ]]
+dnl RAND_egd function in OpenSSL
+dnl ----------------------------
+COMPILE_RAND_EGD=no
+LIBCHECK_RAND_EGD=no
+AC_CHECK_LIB(crypto, RAND_egd,LIBCHECK_RAND_EGD='yes')
+AC_MSG_CHECKING([RAND_egd (compile test code)])
+AC_TRY_COMPILE([
+#include <openssl/rand.h>
+],[
+int i;
+i = RAND_egd("/dev/egd");
+],[COMPILE_RAND_EGD='yes';AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+if [[ "X$COMPILE_RAND_EGD" = "Xyes" -a "X$LIBCHECK_RAND_EGD" = "Xyes" ]]
then
- AC_DEFINE(HAVE_INLINE)
+AC_DEFINE(HAVE_RAND_EGD)
fi
+
dnl /dev/random and /dev/urandom
+dnl ----------------------------
if test -b /dev/urandom
then
AC_DEFINE(HAVE_DEV_URANDOM)
@@ -2274,294 +3104,84 @@ then
AC_DEFINE(HAVE_DEV_RANDOM)
fi
-dnl fpclassify
-AC_MSG_CHECKING(fpclassify)
-AC_TRY_COMPILE([
-#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-],[
-int cl;
-cl = fpclassify(-0.5);
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FPCLASSIFY)],[AC_MSG_RESULT(no)])
-
-dnl Function getpeername
-AC_CHECK_FUNCS(getpeername,[
-AC_DEFINE(HAVE_GETPEERNAME)
-],[
-AC_CHECK_LIB(xnet,getpeername,[
-AC_DEFINE(HAVE_GETPEERNAME)
-],[
-AC_CHECK_LIB(nsl,getpeername,[
-AC_DEFINE(HAVE_GETPEERNAME)
-],[
-AC_CHECK_LIB(socket,getpeername,[
-AC_DEFINE(HAVE_GETPEERNAME)
-])
-])
-])
-])
-
-dnl Function getsockname
-AC_CHECK_FUNCS(getsockname,[
-AC_DEFINE(HAVE_GETSOCKNAME)
-],[
-AC_CHECK_LIB(xnet,getsockname,[
-AC_DEFINE(HAVE_GETSOCKNAME)
-],[
-AC_CHECK_LIB(nsl,getsockname,[
-AC_DEFINE(HAVE_GETSOCKNAME)
-],[
-AC_CHECK_LIB(socket,getsockname,[
-AC_DEFINE(HAVE_GETSOCKNAME)
-])
-])
-])
-])
-
-
-
-
-dnl NetSNMP library
-AC_TRY_COMPILE([
-#include <net-snmp/net-snmp-config.h>
-#include <net-snmp/net-snmp-includes.h>
-#include <net-snmp/utilities.h>
-],[
-netsnmp_session session, *ss;
-],[
-SNMPPROG="snmpprog"
-SNMP_PROG_CLI='$(SNMP_PROG_CLI)'
-AC_DEFINE(HAVE_LIBNETSNMP)
-])
-AC_CHECK_LIB(netsnmp,snmp_enable_filelog,[SNMPPROG="snmpprog";AC_DEFINE(HAVE_SNMP_ENABLE_FILELOG)])
-AC_CHECK_LIB(netsnmp,snmp_disable_syslog,[AC_DEFINE(HAVE_SNMP_DISABLE_SYSLOG)])
-AC_CHECK_LIB(netsnmp,snmp_disable_stderrlog,[AC_DEFINE(HAVE_SNMP_DISABLE_STDERRLOG)])
-AC_CHECK_LIB(netsnmp,snmp_disable_filelog,[AC_DEFINE(HAVE_SNMP_DISABLE_FILELOG)])
-dnl IEEE 754 double
-IEEE_754_DOUBLE_WISHED='yes'
-IEEE_754_DOUBLE_FOUND='no'
-AC_MSG_CHECKING(IEEE 754 double)
+dnl Feature Checking for /proc/.../exe symbolic link
+dnl ------------------------------------------------
+dnl http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
+AC_MSG_CHECKING(/proc/.../exe symbolic link)
AC_TRY_RUN([
#include <stdio.h>
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
#endif
-#if HAVE_STRINGS_H
-#include <strings.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#include <math.h>
-
-static double td[] = {
- INFINITY,
- 1234.75,
- 4.0,
- 1.0,
- 0.375,
- 0.0,
- -0.625,
- -1.0,
- -8.0,
- -23.875,
- -INFINITY
-};
-
-#if WORDS_BIGENDIAN
-static unsigned char tuc[] = {
- /* INF */ 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 1234.75 */ 0x40, 0x93, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 4.0 */ 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 1.0 */ 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0.375 */ 0x3F, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -0.625 */ 0xBF, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -1.0 */ 0xBF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -8.0 */ 0xC0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -23.875 */ 0xC0, 0x37, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -INF */ 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-#else
-static unsigned char tuc[] = {
- /* INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F,
- /* 1234.75 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x93, 0x40,
- /* 4.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40,
- /* 1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F,
- /* 0.375 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x3F,
- /* 0.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* -0.625 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xBF,
- /* -1.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF,
- /* -8.0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xC0,
- /* -23.875 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x37, 0xC0,
- /* -INF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF
-};
+#if HAVE_STDINT_H
+#include <stdint.h>
#endif
-
-static
+/* Buffer for result */
+char prog[1024];
#ifdef __cplusplus
-int
-test_double(double *dp, unsigned char *up)
+int main(int argc, char *argv[])
#else
-int
-test_double(dp, up)
- double *dp;
- unsigned char *up;
+int main(argc, argv) int argc; char *argv[];
#endif
{
- int back = 0;
-#if HAVE_MEMCMP
- if(memcmp(dp, up, 8) == 0) {
- back = 1;
- }
-#else
-#if HAVE_BCMP
- if(bcmp(dp, up, 8) == 0) {
- back = 1;
- }
-#else
- unsigned char *cp1;
- unsigned char *cp2;
- size_t i;
- back = 1;
- cp1 = (unsigned char *)dp; cp2 = up;
- for(i = 0; i < 8; i++) {
- if(*(cp1++) != *(cp2++)) {
- back = 0;
- }
- }
-#endif
-#endif
- if(1 != back) {
- printf("ERROR: %lg not conforming to IEEE 754!\n", *dp);
- }
- return back;
-}
-
-#ifdef __cplusplus
-int main(int argc, char *argv[])
+ char buf[64];
+ struct stat stbuf;
+ int exv = 1;
+ ssize_t res;
+#if HAVE_STDINT_H
+ sprintf(buf, "/proc/%ju/exe", (uintmax_t)getpid());
#else
-int main(argc, argv)
- int argc;
- char *argv[];
+ sprintf(buf, "/proc/%lu/exe", (unsigned long)getpid());
#endif
-{
- unsigned char *ucp;
- double *dp;
- size_t i;
- int ev = 1;
-
- if(8 == sizeof(double)) {
- ev = 0;
- ucp = tuc; dp = td;
- for(i = 0; i < (sizeof(td)/sizeof(double)); i++) {
- if(!test_double(dp, ucp)) {
- ev = 1;
- }
- dp++;
- ucp += 8;
+ res = readlink(buf, prog, sizeof(prog));
+ if ((0 < res) && (sizeof(prog) > res)) {
+ prog[res] = '\0';
+ if (0 == stat(prog, &stbuf)) {
+ exv = 0;
}
- } else {
- printf("ERROR: Size of double is not 1!\n");
}
- exit(ev);
+ return exv;
}
-
-],[AC_MSG_RESULT(yes);IEEE_754_DOUBLE_FOUND="yes"],[AC_MSG_RESULT(no);IEEE_754_DOUBLE_FOUND="no"],[AC_MSG_RESULT([no - test not possible])])
-if [[ "X$IEEE_754_DOUBLE_FOUND$IEEE_754_DOUBLE_WISHED" = "Xyesyes" ]]
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_PROC_PID_EXE)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
+if [[ "X$CROSSBUILD" = "Xyes" ]]
then
- AC_DEFINE(HAVE_IEEE_754_DOUBLE)
-else
- IEEE_754_DOUBLE_FOUND='no'
+AC_MSG_WARN([Test for /proc/.../exe not possible!])
+AC_MSG_WARN([Result is guessed and may be wrong.])
+AC_MSG_WARN([Correct HAVE_PROC_PID_EXE in config.h if necessary.])
fi
-dnl isfinite isnormal
-AC_MSG_CHECKING(isfinite)
+dnl NetSNMP library
+dnl ---------------
+FOUND_NETSNMP='no'
AC_TRY_COMPILE([
-#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/utilities.h>
],[
- double x;
- int a = 0;
- x = 5.0;
- if (isfinite(x)) {
- a = 1;
- }
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ISFINITE)],[AC_MSG_RESULT(no)])
-AC_MSG_CHECKING(isnormal)
-AC_TRY_COMPILE([
-#include <stdio.h>
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+netsnmp_session session, *ss;
],[
- double x;
- int a = 0;
- x = 5.0;
- if (isnormal(x)) {
- a = 1;
- }
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_ISNORMAL)],[AC_MSG_RESULT(no)])
-
-
-dnl Twos complement for negative integers
-AC_MSG_CHECKING(use of twos complement for negative integers)
-AC_TRY_RUN([
-#include <stdio.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_PROCESS_H
-#include <process.h>
-#endif
-
-int i1 = -1;
-
-#if SIZEOF_INT > 2
-#if SIZEOF_INT > 4
-#if SIZEOF_INT > 8
-#error "No test available yet for integers larger than 8 bytes!"
-#else
-int i2 = 0xFFFFFFFFFFFFFFFF;
-#endif
-#else
-int i2 = 0xFFFFFFFF;
-#endif
-#else
-int i2 = 0xFFFF;
-#endif
-
-int main(int argc, char *argv[])
-{
- int exval = 1;
- if (i1 == i2) exval = 0;
- exit(exval); return exval;
-}
-],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_TWOS_COMPLEMENT)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT([no - test not possible])])
-
-CLI_SNMPPROG=''
-if [[ "X$SNMPPROG" != "X" ]]
-then
- CLI_SNMPPROG='pjsnmp$(EXEEXT)'
-fi
-
+FOUND_NETSNMP='yes'
+AC_DEFINE(HAVE_LIBNETSNMP)
+])
+AC_CHECK_LIB(netsnmp,snmp_enable_filelog,[AC_DEFINE(HAVE_SNMP_ENABLE_FILELOG)])
+AC_CHECK_LIB(netsnmp,snmp_disable_syslog,[AC_DEFINE(HAVE_SNMP_DISABLE_SYSLOG)])
+AC_CHECK_LIB(netsnmp,snmp_disable_stderrlog,[AC_DEFINE(HAVE_SNMP_DISABLE_STDERRLOG)])
+AC_CHECK_LIB(netsnmp,snmp_disable_filelog,[AC_DEFINE(HAVE_SNMP_DISABLE_FILELOG)])
dnl Check for MySQL client library
-CLI_MYSQLPROG=''
-if [[ "X$MYSQLPROG" != "X" ]]
+dnl ------------------------------
+AC_MSG_CHECKING(MySQL client library)
+if [[ "X$FOUND_MYSQL" = "Xyes" ]]
then
- CLI_MYSQLPROG='itadmin$(EXEEXT)'
- MYSQL_PROG_CLI='$(MYSQL_PROG_CLI)'
[[ ! -f /usr/lib/mysql/libmysqlclient.so ]] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
[[ ! -f /usr/lib/mysql/libmysqlclient.a ]] || LDFLAGS="$LDFLAGS -L/usr/lib/mysql"
[[ ! -f /usr/lib/mysql/libmysqlclient.so ]] || MYSQLLDFLAGS="-L/usr/lib/mysql"
@@ -2571,234 +3191,815 @@ then
[[ ! -f /usr/lib64/mysql/libmysqlclient.so ]] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
[[ ! -f /usr/lib64/mysql/libmysqlclient.a ]] || MYSQLLDFLAGS="-L/usr/lib64/mysql"
fi
+AC_MSG_RESULT(done)
-if [[ "X$SUITE" = "Xgui" ]]
-then
- LIBDK3WXOBJ='$(LIBDK3WXOBJ)'
- LIBDK4WXOBJ='$(LIBDK4WXOBJ)'
- LIBDK4WXTOBUILD='libdk4wx.$(LIBEXT)'
-fi
-
+SOLIBZ=''
+SOLIBBZ=''
+SOLIBMATH=''
+SOLIBCRYPTO=''
+SOLIBNET=''
+SOLIBIMG=''
+SOLIBSDBI=''
+SOLIBWX=''
+SOLIBDK3PORT=''
+SOLIBDK3C=''
+SOLIBDK3OF=''
+SOLIBDK3CSRND=''
+SOLIBDK3BIF=''
+SOLIBDK3DBI=''
+SOLIBDK3FIG=''
+SOLIBDK3BMEPS=''
+SOLIBDK3NET=''
+SOLIBDK4BASE=''
+SOLIBDK4MA=''
+SOLIBDK4MAIO8H=''
+SOLIBDK4MAIOWH=''
+SOLIBDK4MAIODH=''
+SOLIBDK4MAIO8D=''
+SOLIBDK4MAIOWD=''
+SOLIBDK4MAIODD=''
+SOLIBDK4C=''
+SOLIBDK4MDRND=''
+SOLIBDK4PPPT=''
+SOLIBDK4APP=''
+SOLIBDK4LATA=''
+SOLIBDK4LAT=''
+SOLIBDK4SOCK=''
+SOLIBDK4SOCKA=''
+SOLIBDK4DBI=''
+SOLIBDK4DBIA=''
+LIBDK4BASELIBF=''
+LIBDK4BASELIBS=''
+LIBDK4MALIBF=''
+LIBDK4MALIBS=''
+LIBDK4MAIO8DLIBF=''
+LIBDK4MAIO8DLIBS=''
+LIBDK4MAIOWDLIBF=''
+LIBDK4MAIOWDLIBS=''
+LIBDK4MAIODDLIBF=''
+LIBDK4MAIODDLIBS=''
+LIBDK4MAIOXDLIBF=''
+LIBDK4MAIOXDLIBS=''
+LIBDK4MAIO8HLIBF=''
+LIBDK4MAIO8HLIBS=''
+LIBDK4MAIOWHLIBF=''
+LIBDK4MAIOWHLIBS=''
+LIBDK4MAIODHLIBF=''
+LIBDK4MAIODHLIBS=''
+LIBDK4DBILIBF=''
+LIBDK4DBILIBS=''
+LIBDK4CLIBF=''
+LIBDK4CLIBS=''
+LIBDK4LATALIBF=''
+LIBDK4LATALIBS=''
+LIBDK4LATLIBF=''
+LIBDK4LATLIBS=''
+LIBDK4BIFLIBF=''
+LIBDK4BIFLIBS=''
+LIBDK4GRALIBF=''
+LIBDK4GRALIBS=''
+LIBDK4SOCKLIBF=''
+LIBDK4SOCKLIBS=''
+LIBDK4MDRNDLIBF=''
+LIBDK4MDRNDLIBS=''
+LIBDK4PPPTLIBF=''
+LIBDK4PPPTLIBS=''
+LIBDK4APPLIBF=''
+LIBDK4APPLIBS=''
+LIBDK4PPPTALIBF=''
+LIBDK4PPPTALIBS=''
+LIBDK4SOCKALIBF=''
+LIBDK4SOCKALIBS=''
+LIBDK4DBIALIBF=''
+LIBDK4DBIALIBS=''
+LIBDK4BIFALIBF=''
+LIBDK4BIFALIBS=''
+LIBDK4GRAALIBF=''
+LIBDK4GRAALIBS=''
+LIBDK4WXLIBF=''
+LIBDK4WXLIBS=''
+LIBDK3TRACELIBF=''
+LIBDK3TRACELIBS=''
+LIBDK3CLIBF=''
+LIBDK3CLIBS=''
+LIBDK3OFLIBF=''
+LIBDK3OFLIBS=''
+LIBDK3CSRNDLIBF=''
+LIBDK3CSRNDLIBS=''
+LIBDK3BIFLIBF=''
+LIBDK3BIFLIBS=''
+LIBDK3DBILIBF=''
+LIBDK3DBILIBS=''
+LIBDK3BMEPSLIBF=''
+LIBDK3BMEPSLIBS=''
+LIBDK3FIGLIBF=''
+LIBDK3FIGLIBS=''
+LIBDK3WXLIBF=''
+LIBDK3WXLIBS=''
-if [[ "X$ENASHARED" = "Xyes" -a "X$USESOLINKING" = "Xyes" ]]
+AC_MSG_CHECKING(Link shared libraries against shared libraries)
+if [[ "X$ENA_SHARED" = "Xyes" -a "X$ENA_SOSO" = "Xyes" ]]
then
+ AC_MSG_RESULT(yes)
SOLIBZ="$ZLIB"
SOLIBBZ="$BZLIB"
- SOLIBMATH="-lm"
+ SOLIBMATH='-lm'
SOLIBCRYPTO="$CRYPTO"
SOLIBNET="$NETLIB"
SOLIBIMG="$IMGLIBS"
SOLIBSDBI="$DKSDBILIBS"
- SOLIBWX=`wx-config --libs`
- SOLIBDK3PORT=""
- SOLIBDK3C="-ldk3c"
- SOLIBDK3OF="-ldk3of"
- SOLIBDK3CSRND="-ldk3csrnd"
- SOLIBDK3BIF="-ldk3bif"
- SOLIBDK3DBI="-ldk3dbi"
- SOLIBDK3FIG="-ldk3fig"
- SOLIBDK3BMEPS="-ldk3bmeps"
- SOLIBDK3NET="-ldk3net"
- SOLIBDK4BASE="-ldk4base"
- SOLIBDK4MA="-ldk4ma"
- SOLIBDK4MAIO8H="-ldk4maio8h"
- SOLIBDK4MAIOWH="-ldk4maiowh"
- SOLIBDK4MAIODH="-ldk4maiodh"
- SOLIBDK4MAIO8D="-ldk4maio8d"
- SOLIBDK4MAIOWD="-ldk4maiowd"
- SOLIBDK4MAIODD="-ldk4maiodd"
- SOLIBDK4C="-ldk4c"
- SOLIBDK4MDRND="-ldk4mdrnd"
- SOLIBDK4PPPT="-ldk4pppt"
- SOLIBDK4APP="-ldk4app"
- SOLIBDK4LAT="-ldk4lat"
- SOLIBDK4SOCK="-ldk4sock"
- SOLIBDK4SOCKA="-ldk4socka"
- SOLIBDK4DBI="-ldk4dbi"
- SOLIBDK4DBIA="-ldk4dbia"
- LIBDK4MALIBF="libdk4base.so"
+ SOLIBWX="$WXCONFIGLIBS"
+ SOLIBDK3PORT=''
+ SOLIBDK3C='-ldk3c'
+ SOLIBDK3OF='-ldk3of'
+ SOLIBDK3CSRND='-ldk3csrnd'
+ SOLIBDK3BIF='-ldk3bif'
+ SOLIBDK3DBI='-ldk3dbi'
+ SOLIBDK3FIG='-ldk3fig'
+ SOLIBDK3BMEPS='-ldk3bmeps'
+ SOLIBDK3NET='-ldk3net'
+ SOLIBDK4BASE='-ldk4base'
+ SOLIBDK4MA='-ldk4ma'
+ SOLIBDK4MAIO8H='-ldk4maio8h'
+ SOLIBDK4MAIOWH='-ldk4maiowh'
+ SOLIBDK4MAIODH='-ldk4maiodh'
+ SOLIBDK4MAIO8D='-ldk4maio8d'
+ SOLIBDK4MAIOWD='-ldk4maiowd'
+ SOLIBDK4MAIODD='-ldk4maiodd'
+ SOLIBDK4C='-ldk4c'
+ SOLIBDK4MDRND='-ldk4mdrnd'
+ SOLIBDK4PPPT='-ldk4pppt'
+ SOLIBDK4APP='-ldk4app'
+ SOLIBDK4LATA='-ldk4lata'
+ SOLIBDK4LAT='-ldk4lat'
+ SOLIBDK4SOCK='-ldk4sock'
+ SOLIBDK4SOCKA='-ldk4socka'
+ SOLIBDK4DBI='-ldk4dbi'
+ SOLIBDK4DBIA='-ldk4dbia'
+ LIBDK4BASELIBF=''
+ LIBDK4BASELIBS=''
+ LIBDK4MALIBF='libdk4base.so'
LIBDK4MALIBS='-ldk4base'
- LIBDK4MAIO8DLIBF="libdk4base.so libdk4ma.so"
+ LIBDK4MAIO8DLIBF='libdk4base.so libdk4ma.so'
LIBDK4MAIO8DLIBS='-ldk4ma -ldk4base'
- LIBDK4MAIOWDLIBF="libdk4base.so libdk4ma.so"
+ LIBDK4MAIOWDLIBF='libdk4base.so libdk4ma.so'
LIBDK4MAIOWDLIBS='-ldk4ma -ldk4base'
- LIBDK4MAIODDLIBF="libdk4base.so libdk4maio8d.so"
- LIBDK4MAIODDLIBS='-ldk4maio8d -ldk4base'
- LIBDK4MAIOXDLIBF="libdk4base.so libdk4maio8d.so libdk4maiowd.so"
- LIBDK4MAIOXDLIBS='-ldk4maiowd -ldk4maio8d -ldk4base'
- LIBDK4MAIO8HLIBF="libdk4base.so"
+ LIBDK4MAIODDLIBF='libdk4maio8d.so'
+ LIBDK4MAIODDLIBS='-ldk4maio8d'
+ LIBDK4MAIOXDLIBF='libdk4maio8d.so libdk4maiowd.so'
+ LIBDK4MAIOXDLIBS='-ldk4maiowd -ldk4maio8d'
+ LIBDK4MAIO8HLIBF='libdk4base.so'
LIBDK4MAIO8HLIBS='-ldk4base'
- LIBDK4MAIOWHLIBF="libdk4base.so"
+ LIBDK4MAIOWHLIBF='libdk4base.so'
LIBDK4MAIOWHLIBS='-ldk4base'
- LIBDK4MAIODHLIBF="libdk4base.so libdk4maio8h.so"
+ LIBDK4MAIODHLIBF='libdk4base.so libdk4maio8h.so'
LIBDK4MAIODHLIBS='-ldk4maio8h -ldk4base'
- LIBDK4CLIBF="libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so"
- LIBDK4CLIBS='-ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(BZLIB) $(ZLIB) -lm'
- LIBDK4DBILIBF="libdk4base.so libdk4ma.so libdk4c.so"
- LIBDK4DBILIBS='-ldk4c -ldk4ma -ldk4base $(DBLIB)'
- LIBDK4SOCKLIBF="libdk4base.so libdk4maio8d.so libdk4c.so"
+ LIBDK4CLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so'
+ LIBDK4CLIBS='-ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(BZLIB) $(ZLIB)'
+ LIBDK4DBILIBF='libdk4base.so libdk4ma.so libdk4c.so'
+ LIBDK4DBILIBS='-ldk4c -ldk4ma -ldk4base $(DBLIB) $(DBLIBSOCK)'
+ LIBDK4LATLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4c.so'
+ LIBDK4LATLIBS='-ldk4c -ldk4maio8h -ldk4ma -ldk4base'
+ LIBDK4BIFLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4c.so'
+ LIBDK4BIFLIBS='-ldk4c -ldk4maio8d -ldk4ma -ldk4base $(IMGLIBS)'
+ LIBDK4GRALIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so'
+ LIBDK4GRALIBS='-ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base -lm'
+ LIBDK4SOCKLIBF='libdk4base.so libdk4maio8d.so libdk4c.so'
LIBDK4SOCKLIBS='-ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- LIBDK4MDRNDLIBF="libdk4base.so libdk4c.so"
- LIBDK4MDRNDLIBS='-ldk4c -ldk4base $(CRYPTO)'
- LIBDK4PPPTLIBF="libdk4base.so libdk4maiodd.so libdk4c.so"
- LIBDK4PPPTLIBS='-ldk4c -ldk4maiodd -ldk4base'
- LIBDK4APPLIBF="libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so"
+ LIBDK4MDRNDLIBF='libdk4base.so libdk4c.so'
+ LIBDK4MDRNDLIBS='$(CRYPTO) -ldk4c -ldk4base $(CRYPTO)'
+ LIBDK4PPPTLIBF='libdk4base.so libdk4c.so libdk4lat.so libdk4gra.so'
+ LIBDK4PPPTLIBS='-ldk4gra -ldk4lat -ldk4c -ldk4base'
+ LIBDK4APPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so'
LIBDK4APPLIBS='-ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base'
- LIBDK4LATLIBF="libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4app.so"
- LIBDK4LATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maio8h -ldk4ma -ldk4base'
- LIBDK4PPPTALIBF="libdk4base.so libdk4c.so libdk4pppt.so libdk4app.so"
- LIBDK4PPPTALIBS='-ldk4app -ldk4pppt -ldk4c -ldk4base'
- LIBDK4SOCKALIBF="libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodh.so libdk4maiodd.so libdk4sock.so libdk4app.so"
- LIBDK4SOCKALIBS='-ldk4app -ldk4sock -ldk4maiodd -ldk4maiodh -ldk4maio8d -ldk4maio8h -ldk4base $(SOCKLIB) $(NSLLIB)'
- LIBDK4DBIALIBF="libdk4base.so libdk4dbi.so libdk4app.so"
- LIBDK4DBIALIBS='-ldk4dbi -ldk4app -ldk4base $(DBLIB)'
- LIBDK4WXLIBF="libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4app.so"
- LIBDK4WXLIBS='-ldk4app -ldk4c -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS)'
- LIBDK3TRACELIBF=""
+ LIBDK4LATALIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
+ LIBDK4LATALIBS='-ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base'
+ LIBDK4SOCKALIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4maiodh.so libdk4sock.so libdk4app.so'
+ LIBDK4SOCKALIBS='-ldk4app -ldk4sock -ldk4maiodh -ldk4maiodd -ldk4maio8d -ldk4base'
+ LIBDK4DBIALIBF='libdk4base.so libdk4dbi.so libdk4app.so'
+ LIBDK4DBIALIBS='-ldk4app -ldk4dbi -ldk4base'
+ LIBDK4BIFALIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4bif.so libdk4app.so'
+ LIBDK4BIFALIBS='-ldk4app -ldk4bif -ldk4c -ldk4maiodd -ldk4ma -ldk4base'
+ LIBDK4GRAALIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4bifa.so'
+ LIBDK4GRAALIBS='-ldk4bifa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maiodd -ldk4maiodh -ldk4base'
+ LIBDK4PPPTALIBF='libdk4pppt.so libdk4app.so'
+ LIBDK4PPPTALIBS='-ldk4app -ldk4pppt'
+ LIBDK4WXLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4c.so'
+ LIBDK4WXLIBS='-ldk4c -ldk4base -ldk4maiowd -ldk4maio8d $(WXLDFLAGS)'
+ LIBDK3TRACELIBF=''
LIBDK3TRACELIBS=''
- LIBDK3CLIBF=""
+ LIBDK3CLIBF=''
LIBDK3CLIBS='$(BZLIB) $(ZLIB) -lm'
- LIBDK3OFLIBF="libdk3c.so"
+ LIBDK3OFLIBF='libdk3c.so'
LIBDK3OFLIBS='-ldk3c $(BZLIB) $(ZLIB)'
- LIBDK3CSRNDLIBF="libdk3c.so"
+ LIBDK3CSRNDLIBF='libdk3c.so'
LIBDK3CSRNDLIBS='-ldk3c $(CRYPTO)'
- LIBDK3BIFLIBF="libdk3c.so"
+ LIBDK3BIFLIBF='libdk3c.so'
LIBDK3BIFLIBS='-ldk3c $(IMGLIBS)'
- LIBDK3DBILIBF="libdk3c.so"
- LIBDK3DBILIBS='-ldk3c $(DBLIB)'
- LIBDK3BMEPSLIBF="libdk3c.so libdk3of.so libdk3bif.so"
+ LIBDK3DBILIBF='libdk3c.so'
+ LIBDK3DBILIBS='-ldk3c $(DBLIB) $(DBLIBSOCK)'
+ LIBDK3BMEPSLIBF='libdk3c.so libdk3of.so libdk3bif.so'
LIBDK3BMEPSLIBS='-ldk3bif -ldk3of -ldk3c -lm'
- LIBDK3FIGLIBF="libdk3c.so"
+ LIBDK3FIGLIBF='libdk3c.so'
LIBDK3FIGLIBS='-ldk3c -lm'
- LIBDK3WXLIBF="libdk3c.so"
+ LIBDK3WXLIBF='libdk3c.so'
LIBDK3WXLIBS='-ldk3c $(WXLDFLAGS)'
+else
+ AC_MSG_RESULT(no)
+fi
+
+
+
+dnl FEATURE TESTS END
+
+
+dnl COMPONENTS TO BUILD AND INSTALL
+
+dnl Further compiler setup
+dnl ======================
+
+dnl Position independent code and shared libraries
+dnl ----------------------------------------------
+MKSOLIB='echo "ERROR: Can not build shared libraries!" #'
+MKSOLIBCPP='echo "ERROR: Can not build shared libraries!" #'
+AC_MSG_CHECKING(toolchain specific options)
+case X$TOOLCHAIN in
+ Xgcc|Xclang)
+ CFLAGS="$CFLAGS -fPIC -D_REENTRANT"
+ CFL_CLI_C8="$CFL_CLI_C8 -fPIC -D_REENTRANT"
+ CFL_CLI_DK="$CFL_CLI_DK -fPIC -D_REENTRANT"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -fPIC -D_REENTRANT"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -fPIC -D_REENTRANT"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -fPIC -D_REENTRANT"
+ CXXFL_GUI="$CXXFL_GUI -fPIC -D_REENTRANT"
+ if [[ "X$ENA_SHARED" = "Xyes" ]]
+ then
+ CXXFL_GUI="$CXXFL_GUI"
+ fi
+ MKSOLIB='$(CC) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
+ MKSOLIBCPP='$(CXX) -shared -L. $(MKSORPATH) $(MKSOCHECKSYMBOLS) $(MKSORPATHLINK) $(LDFLAGS) -o $@.$(SOVERS) -Wl,-soname,$@.$(SOVERS)'
+ if [[ "X$ENA_SHARED" = "Xyes" -a "X$ENA_SOSO" = "Xyes" ]]
+ then
+ MKSORPATHLINK='-Wl,-rpath-link,./'
+ MKSOCHECKSYMBOLS='-Wl,-z,defs'
+ fi
+ AC_MSG_RESULT(gcc)
+ ;;
+ Xworkshop)
+ if [[ "X$ENA_SHARED" = "Xyes" ]]
+ then
+ CFLAGS="-Bdynamic -dy $CFLAGS"
+ CFL_CLI_C8="-Bdynamic -dy $CFL_CLI_C8"
+ CFL_CLI_DK="-Bdynamic -dy $CFL_CLI_DK"
+ CXXFL_CLI_C8="-Bdynamic -dy $CXXFL_CLI_C8"
+ CXXFL_CLI_DK="-Bdynamic -dy $CXXFL_CLI_DK"
+ CXXFL_CLI_WX="-Bdynamic -dy $CXXFL_CLI_WX"
+ CXXFL_GUI="-Bdynamic -dy $CXXFL_GUI"
+ LDFLAGS="-Bdynamic -dy $LDFLAGS"
+ LDFLC_CLI_C8="-Bdynamic -dy $LDFLC_CLI_C8"
+ LDFLC_CLI_DK="-Bdynamic -dy $LDFLC_CLI_DK"
+ LDFLCXX_CLI_C8="-Bdynamic -dy $LDFLCXX_CLI_C8"
+ LDFLCXX_CLI_DK="-Bdynamic -dy $LDFLCXX_CLI_DK"
+ LDFLCXX_CLI_WX="-Bdynamic -dy $LDFLCXX_CLI_WX"
+ LDFLCXX_GUI="-Bdynamic -dy $LDFLCXX_GUI"
+ fi
+ CFLAGS="$CFLAGS -xcode=pic32 -D_REENTRANT"
+ CFL_CLI_C8="$CFL_CLI_C8 -xcode=pic32 -D_REENTRANT"
+ CFL_CLI_DK="$CFL_CLI_DK -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_C8="$CXXFL_CLI_C8 -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_DK="$CXXFL_CLI_DK -xcode=pic32 -D_REENTRANT"
+ CXXFL_CLI_WX="$CXXFL_CLI_WX -xcode=pic32 -D_REENTRANT"
+ CXXFL_GUI="$CXXFL_GUI -xcode=pic32 -D_REENTRANT"
+ MKSOLIB='$(CC) -L. $(MKSORPATH) $(MKSORPATHLINK) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
+ MKSOLIBCPP='$(CXX) -L. $(MKSORPATH) $(MKSORPATHLINK) $(LDFLAGS) -G -h $@.$(SOVERS) -o $@.$(SOVERS)'
+ AC_MSG_RESULT(workshop)
+ ;;
+ *)
+ AC_MSG_RESULT(other)
+ ;;
+esac
+
+dnl Create -R option for linker
+AC_MSG_CHECKING(linker requires -R option)
+if [[ "X$LD_LIBRARY_PATH" != "X" -a "X$TOOLCHAIN" = "Xworkshop" ]]
+then
+ RPATH="-R${LD_LIBRARY_PATH}"
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+if [[ "X$ENA_RPATH" = "Xyes" -a "X$ENA_PACKAGE" = "Xyes" -a \( "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" \) ]]
+then
+ RPATH='-Wl,-rpath,$(libdir)'
+fi
+
+dnl Corrections for Solaris
+dnl -----------------------
+DBLIBSOCK="$DBLIB"
+case X$TARGETHOST in
+ Xsparc-sun-solaris*)
+ if [[ "X$ENA_SUNOS_CORR" = "Xyes" ]]
+ then
+ AC_MSG_CHECKING(corrections for Solaris)
+ [[ "X$DBLIBSOCK" = "X" ]] || DBLIBSOCK="$DBLIB -lrt "'$(SOCKLIB)'
+ [[ "X$DBLIB" = "X" ]] || DBLIB="$DBLIB -lrt"
+ [[ "X$CRYPTO" = "X" ]] || CRYPTO="$CRYPTO -lssl "'$(SOCKLIB)'
+ [[ "X$MYSQLLIB" = "X" ]] || MYSQLLIB="$MYSQLLIB -lrt "'$(SOCKLIB)'
+ NETSNMP_LIBS=`echo $NETSNMP_LIBS | sed -f modsnmp.sed`
+ SOCKLIB='-lsocket'
+ NSLLIB='-lnsl'
+ AC_MSG_RESULT(done)
+ NETSNMP_LIBS=''
+ FOUND_NETSNMP='no'
+ fi
+ ;;
+esac
+
+dnl Programs in suite
+dnl =================
+
+dnl socket available
+dnl ----------------
+AC_MSG_CHECKING(availability of network functions)
+if [[ "X$FOUND_SOCKET" = "Xyes" ]]
+then
+PRG_RES_NET='$(PRG_RES_NET)'
+MAN_RES_NET='$(MAN_RES_NET)'
+RES_RES_NET='$(RES_RES_NET)'
+RES_RES_NET_EN='$(RES_RES_NET_EN)'
+RES_RES_NET_DE='$(RES_RES_NET_DE)'
+PRG_CLI_NET='$(PRG_CLI_NET)'
+MAN_CLI_NET='$(MAN_CLI_NET)'
+RES_CLI_NET='$(RES_CLI_NET)'
+PRG_GUI_NET='$(PRG_GUI_NET)'
+MAN_GUI_NET='$(MAN_GUI_NET)'
+RES_GUI_NET='$(RES_GUI_NET)'
+AC_MSG_RESULT(yes)
+else
+AC_MSG_RESULT(no)
+fi
+
+dnl socket available, target class posix
+dnl ------------------------------------
+AC_MSG_CHECKING(both network functions and POSIX)
+if [[ "X$FOUND_SOCKET" = "Xyes" -a "X$TARGETCLASS" = "Xposix" ]]
+then
+PRG_CLI_NET_POSIX='$(PRG_CLI_NET_POSIX)'
+MAN_CLI_NET_POSIX='$(MAN_CLI_NET_POSIX)'
+RES_CLI_NET_POSIX='$(RES_CLI_NET_POSIX)'
+AC_MSG_RESULT(yes)
+else
+AC_MSG_RESULT(no)
+fi
+
+dnl NetSNMP available
+dnl -----------------
+AC_MSG_CHECKING(NetSNMP support)
+if [[ "X$NETSNMP_LIBS" != "X" ]]
+then
+PRG_CLI_SNMP='$(PRG_CLI_SNMP)'
+MAN_CLI_SNMP='$(MAN_CLI_SNMP)'
+RES_CLI_SNMP='$(RES_CLI_SNMP)'
+AC_MSG_RESULT(yes)
+else
+AC_MSG_RESULT(no)
+fi
+
+dnl MySQL or MariaDB available
+dnl --------------------------
+AC_MSG_CHECKING(MySQL or MariaDB)
+if [[ "X$MYSQLLIB" != "X" ]]
+then
+PRG_CLI_MYSQL='$(PRG_CLI_MYSQL)'
+MAN_CLI_MYSQL='$(MAN_CLI_MYSQL)'
+RES_CLI_MYSQL='$(RES_CLI_MYSQL)'
+AC_MSG_RESULT(yes)
+else
+AC_MSG_RESULT(no)
+fi
+
+dnl OpenSSL available
+dnl -----------------
+AC_MSG_CHECKING(OpenSSL)
+if [[ "X$CRYPTO" != "X" ]]
+then
+PRG_CLI_SSL='$(PRG_CLI_SSL)'
+MAN_CLI_SSL='$(MAN_CLI_SSL)'
+RES_CLI_SSL='$(RES_CLI_SSL)'
+PRG_GUI_SSL='$(PRG_GUI_SSL)'
+MAN_GUI_SSL='$(MAN_GUI_SSL)'
+RES_GUI_SSL='$(RES_GUI_SSL)'
+AC_MSG_RESULT(yes)
+else
+AC_MSG_RESULT(no)
+fi
+
+dnl POSIX system
+dnl ------------
+MOD_DK4DMT=''
+MOD_DKK3WREG=''
+AC_MSG_CHECKING(target class POSIX)
+if [[ "X$TARGETCLASS" = "Xposix" ]]
+then
+PRG_CLI_POSIX='$(PRG_CLI_POSIX)'
+MAN_CLI_POSIX='$(MAN_CLI_POSIX)'
+RES_CLI_POSIX='$(RES_CLI_POSIX)'
+MOD_DK4DMT='dk4dmt.$(OBJEXT)'
+AC_MSG_RESULT(yes)
+else
+AC_MSG_RESULT(no)
+fi
+
+dnl Windows system
+dnl --------------
+AC_MSG_CHECKING(target class Windows)
+if [[ "X$TARGETCLASS" = "Xwindows" ]]
+then
+PRG_CLI_WINDOWS='$(PRG_CLI_WINDOWS)'
+MAN_CLI_WINDOWS='$(MAN_CLI_WINDOWS)'
+RES_CLI_WINDOWS='$(RES_CLI_WINDOWS)'
+PRG_GUI_WINDOWS='$(PRG_GUI_WINDOWS)'
+MAN_GUI_WINDOWS='$(MAN_GUI_WINDOWS)'
+RES_GUI_WINDOWS='$(RES_GUI_WINDOWS)'
+MOD_DK3WREG='dk3wreg.$(OBJEXT)'
+AC_MSG_RESULT(yes)
+else
+AC_MSG_RESULT(no)
fi
-if [[ "X$ENASHARED" = "Xyes" -a "X$USESOLINKING" = "Xyes" -a "X$CROSSCOMPLING" = "Xyes" ]]
+
+if [[ "X$SUITE" = "Xauto" -a "X$FOUND_WX" = "Xyes" ]]
+then
+ SUITE='gui'
+elif [[ "X$SUITE" = "Xauto" ]]
then
- LIBDK4MAIODDLIBF="$LIBDK4MAIODDLIBF libdk4maiowd.so"
- LIBDK4MAIODDLIBS='-ldk4maiowd $LIBDK4MAIODDLIBS'
- LIBDK4MAIODHLIBF="$LIBDK4MAIODHLIBF libdk4maiowh.so"
- LIBDK4MAIODHLIBS='-ldk4maiowh $LIBDK4MAIODHLIBS'
+ SUITE='cli'
fi
-case "X$ENAPACKAGING/X$USESOLINKING" in
- "Xyes/Xyes")
+AC_MSG_CHECKING(components to install)
+INSTALL_INDEP='i-ind-cli'
+INSTALL_LIBS=''
+LIBDK3WXOBJ=''
+LIBDK4WXOBJ=''
+if [[ "X$ENA_MAN" = "Xyes" ]]
+then
+ INSTALL_INDEP='i-ind-cli i-man-cli'
+fi
+case X$SUITE in
+ Xrescue)
+ BUILD_ARCH='$(PRG_RES)'
+ INSTALL_INDEP='i-ind-res'
+ INSTALL_PROGRAMS='i-prg-res'
+ if [[ "X$ENA_MAN" = "Xyes" ]]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-res"
+ fi
+ if [[ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]]
+ then
+ BUILD_ARCH='$(PRG_RES) $(LIB_SHARED_RES)'
+ INSTALL_LIBS='i-lib-dyn-res'
+ fi
+ ;;
+ Xcli)
+ BUILD_ARCH='$(PRG_CLI)'
+ INSTALL_INDEP='i-ind-cli'
+ if [[ "X$ENA_MAN" = "Xyes" ]]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-cli"
+ fi
+ if [[ "X$FOUND_SYSTEMD" = "Xyes" ]]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-sysd"
+ else
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-init"
+ fi
+ INSTALL_PROGRAMS='i-prg-cli'
+ if [[ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_STATIC_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli i-lib-stt-cli i-hdr-cli'
+ elif [[ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_SHARED" ]]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli i-hdr-cli'
+ elif [[ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" ]]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_STATIC_CLI)'
+ INSTALL_LIBS='i-lib-stt-cli i-hdr-cli'
+ elif [[ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" ]]
+ then
+ BUILD_ARCH='$(PRG_CLI) $(LIB_SHARED_CLI)'
+ INSTALL_LIBS='i-lib-dyn-cli'
+ else
+ BUILD_ARCH='$(PRG_CLI)'
+ fi
+ if [[ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" ]]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_DAEMON_NET_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-dae"
+ fi
+ if [[ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" -a "X$FOUND_NETSNMP" = "Xyes" ]]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_FILTER_SNMP_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-fil"
+ fi
+ ;;
+ *)
+ BUILD_ARCH='$(PRG_GUI)'
+ INSTALL_INDEP='i-ind-gui'
+ INSTALL_PROGRAMS='i-prg-gui'
+ if [[ "X$ENA_MAN" = "Xyes" ]]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-man-gui"
+ fi
+ if [[ "X$FOUND_SYSTEMD" = "Xyes" ]]
+ then
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-sysd"
+ else
+ INSTALL_INDEP="$INSTALL_INDEP i-svc-init"
+ fi
+ if [[ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" = "Xyes" -a "X$ENA_SHARED" = "Xyes" ]]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_STATIC_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui i-lib-stt-gui i-hdr-gui'
+ elif [[ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_SHARED" ]]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui i-hdr-gui'
+ elif [[ "X$ENA_DEVEL" = "Xyes" -a "X$ENA_STATIC" ]]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_STATIC_GUI)'
+ INSTALL_LIBS='i-lib-stt-gui i-hdr-gui'
+ elif [[ "X$ENA_PACKAGE" = "Xyes" -a "X$ENA_SHARED" ]]
+ then
+ BUILD_ARCH='$(PRG_GUI) $(LIB_SHARED_GUI)'
+ INSTALL_LIBS='i-lib-dyn-gui'
+ else
+ BUILD_ARCH='$(PRG_GUI)'
+ fi
+ LIBDK3WXOBJ='$(LIBDK3WXOBJ)'
+ LIBDK4WXOBJ='$(LIBDK4WXOBJ)'
+ if [[ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" ]]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_DAEMON_NET_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-dae"
+ fi
+ if [[ "X$TARGETCLASS" = "Xposix" -a "X$FOUND_SOCKET" = "Xyes" -a "X$FOUND_NETSNMP" = "Xyes" ]]
+ then
+ BUILD_ARCH="$BUILD_ARCH"' $(PRG_FILTER_SNMP_POSIX)'
+ INSTALL_PROGRAMS="$INSTALL_PROGRAMS i-prg-fil"
+ fi
+ ;;
+esac
+AC_MSG_RESULT(done)
+
+dnl OpenSSL needs socket library on Windows with gcc
+dnl ------------------------------------------------
+case X$TARGETCLASS/X$ENA_PACKAGE/X$TOOLCHAIN in
+ Xwindows/Xno/Xgcc)
+ CRYPTO="$CRYPTO $SOCKLIB"
+ ;;
+ Xwindows/Xno/Xclang)
+ CRYPTO="$CRYPTO $SOCKLIB"
+ ;;
+esac
+
+dnl Objects and libraries per program
+dnl ---------------------------------
+
+AC_MSG_CHECKING(default elements for programs and libraries)
+DKCTLIBF='libdk3.a'
+DKCTLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+ADDCTRLDLIBF=''
+ADDCTRLDLIBS='$(CLILIB)'
+DKDBTLIBF='libdk3.a'
+DKDBTLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+ITADMINLIBF='libdk3.a'
+ITADMINLIBS='libdk3.a $(MYSQLLIB) $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) $(RTLIB)'
+FIG2LATLIBF='libdk3.a'
+FIG2LATLIBS='libdk3.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+HTMLBOOKLIBF='libdk3.a'
+HTMLBOOKLIBS='libdk3.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+DK3INFOLIBF='libdk3.a'
+DK3INFOLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWTLIBF='libdk3.a'
+DKWTLIBS='libdk3.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+WPRCLEANLIBF='libdk3.a'
+WPRCLEANLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWXWIZLIBF='libdk3.a'
+DKWXWIZLIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKWXPATHLIBF='libdk3.a'
+DKWXPATHLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WINPRINTLIBF='libdk3.a'
+WINPRINTLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+CHSCRSZLIBF='libdk3.a'
+CHSCRSZLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKCTLIBF='libdk3.a'
+WXDKCTLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXIMGSZLIBF='libdk4.a'
+WXIMGSZLIBS='libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKCLOCKLIBF='libdk3.a'
+WXDKCLOCKLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXDKHTBLIBF='libdk3.a'
+WXDKHTBLIBS='libdk3.a $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
+PRINTQDILIBF='libdk3.a'
+PRINTQDILIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+PRINTQDALIBF='libdk3.a'
+PRINTQDALIBS='libdk3.a $(CLILIB) $(BZLIB) $(ZLIB)'
+
+WXDKDRAWLIBF='libdk4.a libdk4maioxd.a libdk4wx.a'
+WXDKDRAWLIBS='libdk4wx.a libdk4maioxd.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+WXBMPPLIBF='libdk4.a libdk4maioxd.a libdk4wx.a'
+WXBMPPLIBS='libdk4wx.a libdk4maioxd.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+BMPPLIBF='libdk4.a'
+BMPPLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+PLPDFTEXLIBF='libdk4.a'
+PLPDFTEXLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+DKCATLIBF='libdk4.a'
+DKCATLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBLKSLIBF='libdk4.a'
+DKBLKSLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKSQLSPLITLIBF='libdk4.a'
+DKSQLSPLITLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKERADISKLIBF='libdk4.a'
+DKERADISKLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKLSLIBF='libdk4.a'
+DKLSLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKSORTLIBF='libdk4.a'
+DKSORTLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKLINESLIBF='libdk4.a'
+DKLINESLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKFICLIBF='libdk4.a'
+DKFICLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKUIDLIBF='libdk4.a'
+DKUIDLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKPWGENLIBF='libdk4.a'
+DKPWGENLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKRANDLIBF='libdk4.a'
+DKRANDLIBS='libdk4.a $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+DKT2HLIBF='libdk4.a'
+DKT2HLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKT2LLIBF='libdk4.a'
+DKT2LLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBIN2CLIBF='libdk4.a'
+DKBIN2CLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKHEXLIBF='libdk4.a'
+DKHEXLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKBMMLIBF='libdk4.a'
+DKBMMLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKPWDLIBF='libdk4.a'
+DKPWDLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+DKRECVLIBF='libdk4.a'
+DKRECVLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+DKSENDLIBF='libdk4.a'
+DKSENDLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+DKDBT2LIBF='libdk4.a'
+DKDBT2LIBS='libdk4.a $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
+DK4INFOLIBF='libdk4.a'
+DK4INFOLIBS='libdk4.a $(CLILIB) $(BZLIB) $(ZLIB)'
+LPRNGCLLIBF='libdk4.a'
+LPRNGCLLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+WXDKFCSLIBF='libdk4.a libdk4wx.a'
+WXDKFCSLIBS='libdk4wx.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+WXPQDICLIBF='libdk4.a libdk4wx.a'
+WXPQDICLIBS='libdk4wx.a libdk4.a $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+PJSNMPLIBF='libdk4.a'
+PJSNMPLIBS='libdk4.a $(CLILIB) $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+PRMONSNMPLIBF='libdk4.a'
+PRMONSNMPLIBS='libdk4.a $(CLILIB) $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+PRINTQDLIBF='libdk4.a'
+PRINTQDLIBS='libdk4.a $(DBLIB) $(SOCKLIB) $(NSLLIB)'
+PRINTQDCLIBF='libdk4.a'
+PRINTQDCLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+RSHDOWNLIBF='libdk4.a'
+RSHDOWNLIBS='libdk4.a $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
+WXD2LATLIBF='libdk4.a'
+WXD2LATLIBS='libdk4.a $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+AC_MSG_RESULT(done)
+
+AC_MSG_CHECKING(elements in programs and libraries)
+case X$ENA_PACKAGE/X$ENA_SOSO in
+ Xyes/Xyes)
+ AC_MSG_RESULT([linking so with so])
DKCTLIBF='libdk3c.so'
- DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- ADDCTRLDLIBF='libdk3c.so'
- ADDCTRLDLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKDBTLIBF='libdk3c.so libdk3dbi.so'
- DKDBTLIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKCTLIBS='-ldk3c $(CLILIB)'
+ ADDCTRLDLIBF=''
+ ADDCTRLDLIBS='$(CLILIB)'
+ DKDBTLIBF=''
+ DKDBTLIBS=''
ITADMINLIBF='libdk3c.so libdk3of.so'
- ITADMINLIBS='-ldk3of -ldk3c -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
- BMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- BMPPLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
- FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3fig.so'
- FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
- HTMLBOOKLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- HTMLBOOKLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ ITADMINLIBS='-ldk3of -ldk3c $(MYSQLLIB) $(CLILIB) $(BZLIB) $(ZLIB)'
+ FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3bmeps.so libdk3fig.so'
+ FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3bif -ldk3c $(CLILIB) -lm'
+ HTMLBOOKLIBF='libdk3c.so libdk3bif.so'
+ HTMLBOOKLIBS='-ldk3bif -ldk3c $(CLILIB)'
DK3INFOLIBF='libdk3c.so'
- DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PLPDFTEXLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- PLPDFTEXLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK3INFOLIBS='-ldk3c $(CLILIB)'
DKWXWIZLIBF='libdk3c.so'
- DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKWXWIZLIBS='-ldk3c $(CLILIB)'
WXDKCTLIBF='libdk3c.so libdk3wx.so'
- WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXBMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3wx.so'
- WXBMPPLIBS='-ldk3wx -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXIMGSZLIBF='libdk3c.so libdk3wx.so'
- WXIMGSZLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
+ WXIMGSZLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4maioxd.so libdk4wx.so'
+ WXIMGSZLIBS='-ldk4wx -ldk4maioxd -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
WXDKCLOCKLIBF='libdk3c.so libdk3wx.so'
- WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
WXDKHTBLIBF='libdk3c.so libdk3wx.so'
- WXDKHTBLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB) $(BZLIB) $(ZLIB)'
- PRINTQDILIBF='libdk3c.so libdk3dbi.so'
- PRINTQDILIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PRINTQDALIBF='libdk3c.so'
- PRINTQDALIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKCATLIBF='libdk4base.so libdk4c.so libdk4maiodd.so libdk4app.so'
- DKCATLIBS='-ldk4app -ldk4maiodd -ldk4maio8d -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBLKSLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKBLKSLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSQLSPLITLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKERADISKLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKERADISKLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKLSLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKLSLIBS='-ldk4app -ldk4maiodd -ldk4maiodh -ldk4ma -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXDKHTBLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(CLILIB)'
+ PRINTQDILIBF=''
+ PRINTQDILIBS=''
+ PRINTQDALIBF=''
+ PRINTQDALIBS=''
+ WXDKDRAWLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4wx.so'
+ WXDKDRAWLIBS='-ldk4wx -ldk4gra -ldk4lat -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXBMPPLIBF='libdk4base.so libdk4maio8h.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4graa.so libdk4maioxd.so libdk4wx.so'
+ WXBMPPLIBS='-ldk4wx -ldk4maioxd -ldk4graa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maio8h -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKCATLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKCATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB)'
+ DKBLKSLIBF='libdk4base.so libdk4app.so'
+ DKBLKSLIBS='-ldk4app -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKSQLSPLITLIBF='libdk4app.so'
+ DKSQLSPLITLIBS='-ldk4app $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKERADISKLIBF='libdk4base.so libdk4app.so'
+ DKERADISKLIBS='-ldk4app -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKLSLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodh -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
+ BMPPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4c.so libdk4bif.so libdk4gra.so libdk4app.so libdk4bifa.so libdk4graa.so'
+ BMPPLIBS='-ldk4graa -ldk4bifa -ldk4app -ldk4gra -ldk4bif -ldk4c -ldk4maio8d -ldk4maio8h -ldk4base $(CLILIB)'
+ PLPDFTEXLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4lat.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4lata.so libdk4graa.so'
+ PLPDFTEXLIBS='-ldk4graa -ldk4lata -ldk4app -ldk4pppt -ldk4gra -ldk4lat -ldk4c -ldk4maio8d -ldk4base $(IMGLIBS) $(CLILIB)'
DKSORTLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
- DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maiodh -ldk4base $(CLILIB)'
+ DKLINESLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKLINESLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB)'
+ DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRANDLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2HLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
- DKT2LLIBS='-ldk4lat -ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKHEXLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4maiodh.so'
- DKHEXLIBS='-ldk4app -ldk4maiodh -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
+ DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB)'
+ DKRANDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4mdrnd.so libdk4app.so'
+ DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB)'
+ DKT2HLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4maio8h -ldk4base $(CLILIB)'
+ DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4app.so libdk4lata.so'
+ DKT2LLIBS='-ldk4lata -ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB)'
+ DKBIN2CLIBF='libdk4base.so libdk4c.so libdk4app.so'
+ DKBIN2CLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB)'
+ DKHEXLIBF='libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKHEXLIBS='-ldk4app -ldk4c -ldk4maiodh $(CLILIB)'
DKBMMLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB)'
DKPWDLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKSENDLIBS='-ldk4maiodd -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB)'
+ DKRECVLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) -lm'
+ DKSENDLIBF='libdk4base.so libdk4ma.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ DKSENDLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4ma -ldk4base $(SOCKLIB) $(CLILIB) -lm'
DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
- DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB)'
DK4INFOLIBF='libdk4base.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- LPRNGCLLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
- LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- WXDKFCSLIBF='libdk4base.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4ma -ldk4maio8d -ldk4maio8h -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRMONSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8h -ldk4maio8d -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
+ DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB)'
+ LPRNGCLLIBF='libdk4base.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4base $(SOCKLIB) $(CLILIB) -lm'
+ WXDKFCSLIBF='libdk4ma.so libdk4maiodd.so libdk4c.so libdk4wx.so'
+ WXDKFCSLIBS='-ldk4wx -ldk4c -ldk4maiodd -ldk4ma $(WXLDFLAGS) $(CRYPTO) $(GUILIB) $(CLILIB)'
+ WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4wx.so'
+ WXPQDICLIBS='-ldk4wx -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(SOCKLIB) $(GUILIB) $(CLILIB)'
+ PJSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so'
+ PJSNMPLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ PRMONSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so'
+ PRMONSNMPLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(CLILIB)'
PRINTQDLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4dbi.so libdk4sock.so'
- PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
+ PRINTQDCLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
RSHDOWNLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
- RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB) $(CLILIB)'
+ WXD2LATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4lata.so libdk4bifa.so libdk4graa.so'
+ WXD2LATLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) -lm'
;;
- "Yyes/Xno")
+ Xyes/Xno)
+ AC_MSG_RESULT([linking programs with all required libs])
DKCTLIBF='libdk3c.so'
- DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- ADDCTRLDLIBF='libdk3c.so'
- ADDCTRLDLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKCTLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ADDCTRLDLIBF=''
+ ADDCTRLDLIBS='$(CLILIB)'
DKDBTLIBF='libdk3c.so libdk3dbi.so'
DKDBTLIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
ITADMINLIBF='libdk3c.so libdk3of.so'
- ITADMINLIBS='-ldk3of -ldk3c -lmysqlclient $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB)'
- BMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- BMPPLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ITADMINLIBS='-ldk3of -ldk3c $(MYSQLLIB) $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
FIG2LATLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3fig.so'
FIG2LATLIBS='-ldk3fig -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
HTMLBOOKLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
HTMLBOOKLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
DK3INFOLIBF='libdk3c.so'
- DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- PLPDFTEXLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so'
- PLPDFTEXLIBS='-ldk3bmeps -ldk3of -ldk3bif -ldk3c $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK3INFOLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
DKWXWIZLIBF='libdk3c.so'
- DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
+ DKWXWIZLIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB) -lm'
WXDKCTLIBF='libdk3c.so libdk3wx.so'
WXDKCTLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXBMPPLIBF='libdk3c.so libdk3bif.so libdk3of.so libdk3bmeps.so libdk3wx.so'
- WXBMPPLIBS='-ldk3wx -ldk3bmeps -ldk3of -ldk3bif -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXIMGSZLIBF='libdk3c.so libdk3wx.so'
- WXIMGSZLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
+ WXIMGSZLIBF='libdk4base.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4maioxd.so libdk4wx.so'
+ WXIMGSZLIBS='-ldk4wx -ldk4maioxd -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
WXDKCLOCKLIBF='libdk3c.so libdk3wx.so'
WXDKCLOCKLIBS='-ldk3wx -ldk3c $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
WXDKHTBLIBF='libdk3c.so libdk3wx.so'
@@ -2807,330 +4008,354 @@ case "X$ENAPACKAGING/X$USESOLINKING" in
PRINTQDILIBS='-ldk3dbi -ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
PRINTQDALIBF='libdk3c.so'
PRINTQDALIBS='-ldk3c $(CLILIB) $(BZLIB) $(ZLIB)'
- DKCATLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKCATLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBLKSLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKBLKSLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSQLSPLITLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKERADISKLIBF='libdk4base.so libdk4c.so'
- DKERADISKLIBS='-ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKLSLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKSORTLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
- DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKFICLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRANDLIBF='libdk4base.so libdk4c.so libdk4app.so libdk4mdrnd.so'
- DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2HLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKT2LLIBF='libdk4base.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4lat.so'
- DKT2LLIBS='-ldk4lat -ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKHEXLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKHEXLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKBMMLIBF='libdk4base.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKPWDLIBF='libdk4base.so libdk4c.so libdk4app.so'
- DKPWDLIBS='-ldk4app -ldk4c -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maiodd.so'
- DKSENDLIBS='-ldk4maiodd -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
- DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4ma -ldk4base $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB)'
- DK4INFOLIBF='libdk4base.so libdk4maiodd.so libdk4c.so libdk4app.so'
- DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4base $(CLILIB) $(BZLIB) $(ZLIB)'
- LPRNGCLLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
- LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
- WXDKFCSLIBF='libdk4base.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB)'
- WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
- WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiowd -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB)'
- PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4ma -ldk4maio8d -ldk4maio8h -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRMONSNMPLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8h -ldk4maio8d -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB)'
- PRINTQDLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4dbi.so libdk4sock.so'
- PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maio8d -ldk4base $(DBLIB) $(SOCKLIB) $(NSLLIB)'
- PRINTQDCLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
- PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
- RSHDOWNLIBF='libdk4base.so libdk4maio8d.so libdk4c.so libdk4sock.so'
- RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maio8d -ldk4base $(SOCKLIB) $(NSLLIB)'
+ WXDKDRAWLIBF='libdk4base.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4c.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4wx.so'
+ WXDKDRAWLIBS='-ldk4wx -ldk4gra -ldk4lat -ldk4bif -ldk4c -ldk4ma -ldk4maiodd -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXBMPPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4bif.so libdk4lat.so libdk4gra.so libdk4c.so libdk4app.so libdk4bifa.so libdk4graa.so libdk4wx.so libdk4maioxd.so'
+ WXBMPPLIBS='-ldk4maioxd -ldk4wx -ldk4graa -ldk4bifa -ldk4app -ldk4c -ldk4gra -ldk4lat -ldk4bif -ldk4maiodh -ldk4maiodd -ldk4maiowh -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ BMPPLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maio8d.so libdk4maiowh.so libdk4maiowd.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4app.so libdk4lata.so libdk4bifa.so libdk4graa.so'
+ BMPPLIBS='-ldk4graa -ldk4bifa -ldk4lata -ldk4app -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maiowh -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ PLPDFTEXLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4bifa.so libdk4lata.so libdk4graa.so'
+ PLPDFTEXLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKCATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKCATLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBLKSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBLKSLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKSQLSPLITLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKSQLSPLITLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKERADISKLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKERADISKLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKLSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKLSLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKSORTLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKSORTLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKLINESLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4app.so'
+ DKLINESLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKFICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKFICLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKUIDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKUIDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWGENLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKPWGENLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKRANDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so libdk4mdrnd.so'
+ DKRANDLIBS='-ldk4app -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKT2HLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKT2HLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKT2LLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4app.so libdk4lata.so'
+ DKT2LLIBS='-ldk4lata -ldk4app -ldk4lat -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBIN2CLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBIN2CLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKHEXLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4app.so'
+ DKHEXLIBS='-ldk4app -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKBMMLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKBMMLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKPWDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DKPWDLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DKRECVLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maio8d.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4ma.so'
+ DKRECVLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKSENDLIBF='libdk4base.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4ma.so libdk4maiodh.so libdk4maiowh.so libdk4maio8h.so'
+ DKSENDLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4ma -ldk4base $(CLILIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ DKDBT2LIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4app.so libdk4dbia.so'
+ DKDBT2LIBS='-ldk4dbia -ldk4app -ldk4dbi -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(DBLIBSOCK) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ DK4INFOLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4app.so'
+ DK4INFOLIBS='-ldk4app -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ LPRNGCLLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4mdrnd.so libdk4app.so libdk4socka.so'
+ LPRNGCLLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiowd -ldk4maio8d -ldk4maiodh -ldk4maiowh -ldk4maio8h -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ WXDKFCSLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4mdrnd.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
+ WXDKFCSLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4mdrnd -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CRYPTO) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ WXPQDICLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4maiowd.so libdk4maiowh.so libdk4maiodd.so libdk4maiodh.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so libdk4wx.so'
+ WXPQDICLIBS='-ldk4wx -ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(WXLDFLAGS) $(GUILIB) $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ PJSNMPLIBF='libdk4base.so libdk4maio8h.so libdk4maio8d.so libdk4maiodd.so libdk4maiodh.so libdk4ma.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PJSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRMONSNMPLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maio8h.so libdk4c.so libdk4maiodd.so libdk4maiodh.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PRMONSNMPLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodh -ldk4maiodd -ldk4maio8h -ldk4maio8d -ldk4ma -ldk4base $(NETSNMP_LIBS) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRINTQDLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4dbi.so libdk4sock.so'
+ PRINTQDLIBS='-ldk4sock -ldk4dbi -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(DBLIB) $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ PRINTQDCLIBF='libdk4base.so libdk4ma.so libdk4maio8h.so libdk4maio8d.so libdk4maiodh.so libdk4maiodd.so libdk4c.so libdk4sock.so libdk4app.so libdk4socka.so'
+ PRINTQDCLIBS='-ldk4socka -ldk4app -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ RSHDOWNLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiodd.so libdk4c.so libdk4sock.so'
+ RSHDOWNLIBS='-ldk4sock -ldk4c -ldk4maiodd -ldk4maio8d -ldk4ma -ldk4base $(SOCKLIB) $(NSLLIB) $(BZLIB) $(ZLIB) -lm'
+ WXD2LATLIBF='libdk4base.so libdk4ma.so libdk4maio8d.so libdk4maiowd.so libdk4maiodd.so libdk4maio8h.so libdk4maiowh.so libdk4maiodh.so libdk4c.so libdk4lat.so libdk4bif.so libdk4gra.so libdk4pppt.so libdk4app.so libdk4bifa.so libdk4lata.so libdk4graa.so'
+ WXD2LATLIBS='-ldk4graa -ldk4lata -ldk4bifa -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4lat -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base $(IMGLIBS) $(CLILIB) $(BZLIB) $(ZLIB) -lm'
+ ;;
+ *)
+ AC_MSG_RESULT(defaults)
;;
esac
-if [[ "X$WGET" != "X" ]]
+if [[ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" -o "X$TOOLCHAIN" = "msvc" ]]
then
- GETSOURCE='wget -O dktools-$(VERSNO) $(SFBASE)/dktools-$(VERSNO).tar.gz/download'
-elif [[ "X$CURL" != "X" ]]
+ case X$TARGETCLASS in
+ Xwindows)
+ ADDCTRLDRES='addctrldres.$(RESEXT)'
+ BMPPRES='bmppres.$(RESEXT)'
+ DK3INFORES='dk3infores.$(RESEXT)'
+ DK4INFORES='dk4infores.$(RESEXT)'
+ DKBIN2CRES='dk-bin2cres.$(RESEXT)'
+ DKBLKSRES='dk-blksres.$(RESEXT)'
+ DKBMMRES='dk-bmmres.$(RESEXT)'
+ DKCATRES='dk-catres.$(RESEXT)'
+ DKCTRES='dkctres.$(RESEXT)'
+ DKDB2TRES='dk-db2tres.$(RESEXT)'
+ DKDBCORES='dk-dbcores.$(RESEXT)'
+ DKDBTRES='dkdbtres.$(RESEXT)'
+ DKERADISKRES='dk-eradiskres.$(RESEXT)'
+ DKFICRES='dk-ficres.$(RESEXT)'
+ DKHEXRES='dk-hexres.$(RESEXT)'
+ DKLINESRES='dk-linesres.$(RESEXT)'
+ DKLSRES='dk-lsres.$(RESEXT)'
+ DKPWDRES='dk-pwdres.$(RESEXT)'
+ DKPWGENRES='dk-pwgenres.$(RESEXT)'
+ DKRANDRES='dk-randres.$(RESEXT)'
+ DKRECVRES='dk-recvres.$(RESEXT)'
+ DKSENDRES='dk-sendres.$(RESEXT)'
+ DKSORTRES='dk-sortres.$(RESEXT)'
+ DKSQLSPLITRES='dk-sqlsplitres.$(RESEXT)'
+ DKT2DBRES='dk-t2dbres.$(RESEXT)'
+ DKT2HRES='dk-t2hres.$(RESEXT)'
+ DKT2LRES='dk-t2lres.$(RESEXT)'
+ DKWTADMRES='dkwtadmres.$(RESEXT)'
+ DKWTRES='dkwtres.$(RESEXT)'
+ DKWXPATHRES='dkwxpathres.$(RESEXT)'
+ DKWXWIZRES='dkwxwizres.$(RESEXT)'
+ FIG2LATRES='fig2latres.$(RESEXT)'
+ HTMLBOOKRES='htmlbookres.$(RESEXT)'
+ ITADMINRES='itadminres.$(RESEXT)'
+ LPRNGCLRES='lprngclres.$(RESEXT)'
+ PLPDFTEXRES='plpdftexres.$(RESEXT)'
+ WINPRINTRES='winprintres.$(RESEXT)'
+ WPRCLEANRES='wprcleanres.$(RESEXT)'
+ WXBMPPRES='wxbmppres.$(RESEXT)'
+ WXDKCLOCKRES='wxdkclockres.$(RESEXT)'
+ WXDKCTRES='wxdkctres.$(RESEXT)'
+ WXDKFCSRES='wxdkfcsres.$(RESEXT)'
+ WXDKHTBRES='wxdkhtbres.$(RESEXT)'
+ WXDKSCRSZRES='wxdkscrszres.$(RESEXT)'
+ WXIMGSZRES='wximgszres.$(RESEXT)'
+ WXPQDICRES='wxpqdicres.$(RESEXT)'
+ ;;
+ esac
+fi
+
+AC_MSG_CHECKING(options for Windows)
+WINCLILIB=''
+WINGUILIB=''
+CLILIB=''
+GUILIB=''
+if [[ "X$BUILDCLASS" = "Xwindows" ]]
then
- GETSOURCE='curl -L $(SFBASE)/dktools-$(VERSNO).tar.gz > dktools-$(VERSNO).tar.gz'
-fi
-
-dnl Corrections for Solaris and --with-corrections
-if [[ "X$UNAME" = "XSunOS" -a "X$SOLCOR" = "Xyes" ]]
-then
- AC_MSG_CHECKING(CFLAGS on Solaris)
- NETSNMP_LIBS=`echo $NETSNMP_LIBS | sed -f modsnmp.sed`
- dnl WXCPPFLAGS
- TMPVAR="$WXCPPFLAGS"
- WXCPPFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCPPFLAGS="$WXCPPFLAGS $i"
- ;;
- "X-I*")
- WXCPPFLAGS="$WXCPPFLAGS $i"
- ;;
- esac
- done
- dnl WXCXXFLAGS
- TMPVAR="$WXCXXFLAGS"
- WXCXXFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- "X-I*")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- "X-pthread")
- WXCXXFLAGS="$WXCXXFLAGS $i"
- ;;
- esac
- done
- dnl WXCFLAGS
- TMPVAR="$WXCFLAGS"
- WXCFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-D*")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- "X-I*")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- "X-pthread")
- WXCFLAGS="$WXCFLAGS $i"
- ;;
- esac
- done
- dnl WXLDFLAGS
- TMPVAR="$WXLDFLAGS"
- WXLDFLAGS=''
- for i in NOTHING $TMPVAR
- do
- case "X$i" in
- "X-L*")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- "X-l*")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- "X-pthread")
- WXLDFLAGS="$WXLDFLAGS $i"
- ;;
- esac
- done
- SOCKLIB='-lsocket'
- NSLLIB='-lnsl'
- AC_MSG_RESULT(done)
-fi
-
-if [[ "X$ONWINDOWS" != "Xno" ]]
-then
- CLILIB='$(WINCLILIB)'
- GUILIB='$(WINGUILIB)'
- ENTRY='$(WINENTRY)'
+ DELTARGET='@-IF EXIST "$@" DEL /F /Q "$@"'
+ DELTARGETSO='@-IF EXIST "$@.$(SOVERS)" DEL /F /Q "$@.$(SOVERS)"'
else
- AC_DEFINE(HAVE_INODES)
+ DELTARGET='@-[[ ! -f "$@" ]] || rm -f "$@"'
+ DELTARGETSO='@-[[ ! -f "$@.$(SOVERS)" ]] || rm -f "$@.$(SOVERS)"'
fi
-
-AC_MSG_CHECKING(manpage installation)
-case "X$MANINST" in
- "Xauto")
- if uname -a | grep -q Debian
- then
- MANINST='no'
- else
- MANINST='yes'
- fi
- ;;
-esac
-if [[ "X$MANINST" = "Xno" ]]
+if [[ "X$TARGETCLASS" = "Xwindows" ]]
+then
+ WINCLILIB='-lkernel32 -lgdi32 -ladvapi32 -luser32 -lnetapi32 -lwinspool'
+ WINGUILIB='-lole32 -loleaut32 -lshell32 -lcomctl32 -lcomdlg32'
+ CLILIB='$(WINCLILIB)'
+ GUILIB='$(WINGUILIB)'
+fi
+if [[ "X$TARGETCLASS" = "Xwindows" -a "X$TOOLCHAIN" = "Xgcc" ]]
then
- INSTALLMANPAGES=''
+ WINGUILIB="-lwinmm -limm32 -luuid $WINGUILIB"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -municode"
fi
-AC_MSG_RESULT($MANINST)
+if [[ "X$TARGETCLASS" = "Xwindows" -a "X$TOOLCHAIN" = "Xclang" ]]
+then
+ WINGUILIB="-lwinmm -limm32 -luuid $WINGUILIB"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -municode"
+fi
+if [[ "X$TOOLCHAIN" = "Xgcc" -o "X$TOOLCHAIN" = "Xclang" ]]
+then
+ case X$CROSSBUILD/X$ENA_PACKAGE in
+ Xyes/Xno)
+ LDFLC_CLI_C8="$LDFLC_CLI_C8 -static -static-libgcc -Wl,-Bstatic"
+ LDFLC_CLI_DK="$LDFLC_CLI_DK -static -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_C8="$LDFLCXX_CLI_C8 -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_DK="$LDFLCXX_CLI_DK -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_CLI_WX="$LDFLCXX_CLI_WX -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ LDFLCXX_GUI="$LDFLCXX_GUI -static -static-libstdc++ -static-libgcc -Wl,-Bstatic"
+ ;;
+ esac
+fi
+AC_MSG_RESULT(done)
-DBLIBSOCK="$DBLIB"
+dnl Find user and group running the LPRng lpd process
+dnl -------------------------------------------------
+dnl Normally both should be lp but the Debian LPRng package
+dnl uses daemon.lp to run lpd.
+dnl The printqd daemon should use the same account and group.
-if [[ "X$UNAME" = "XSunOS" -a "X$SOLCOR" = "Xyes" ]]
+LPRNGUSER='lp'
+LPRNGGROUP='lp'
+if [[ -f /etc/debian_version ]]
then
- [[ "X$DBLIBSOCK" = "X" ]] || DBLIBSOCK="$DBLIBSOCK -lrt "'$(SOCKLIB)'
- [[ "X$DBLIB" = "X" ]] || DBLIB="$DBLIB -lrt "
- [[ "X$CRYPTO" = "X" ]] || CRYPTO="$CRYPTO -lssl "'$(SOCKLIB)'
- [[ "X$MYSQLLIB" = "X" ]] || MYSQLLIB="$MYSQLLIB -lrt "'$(SOCKLIB)'
+ LPRNGUSER='daemon'
fi
-LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
-AC_SUBST(ANYDB)
-AC_SUBST(CLI_SNMPPROG)
-AC_SUBST(LIBPNG)
-AC_SUBST(LIBJPEG)
-AC_SUBST(LIBTIFF)
-AC_SUBST(DBLIB)
-AC_SUBST(DBLIBSOCK)
-AC_SUBST(CLI_MYSQLPROG)
-AC_SUBST(PTHREADLIB)
-AC_SUBST(LIBDK3WXOBJ)
-AC_SUBST(LIBDK4WXOBJ)
-AC_SUBST(LIBDK4WXTOBUILD)
-AC_SUBST(DKCTLIBF)
-AC_SUBST(DKCTLIBS)
-AC_SUBST(ADDCTRLDLIBF)
-AC_SUBST(ADDCTRLDLIBS)
-AC_SUBST(DKDBTLIBF)
-AC_SUBST(DKDBTLIBS)
-AC_SUBST(BMPPLIBF)
-AC_SUBST(BMPPLIBS)
-AC_SUBST(FIG2LATLIBF)
-AC_SUBST(FIG2LATLIBS)
-AC_SUBST(HTMLBOOKLIBF)
-AC_SUBST(HTMLBOOKLIBS)
-AC_SUBST(DK3INFOLIBF)
-AC_SUBST(DK3INFOLIBS)
-AC_SUBST(PLPDFTEXLIBF)
-AC_SUBST(PLPDFTEXLIBS)
-AC_SUBST(DKWXWIZLIBF)
-AC_SUBST(DKWXWIZLIBS)
-AC_SUBST(WXDKCTLIBF)
-AC_SUBST(WXDKCTLIBS)
-AC_SUBST(WXBMPPLIBF)
-AC_SUBST(WXBMPPLIBS)
-AC_SUBST(WXPQDICLIBF)
-AC_SUBST(WXPQDICLIBS)
-AC_SUBST(WXIMGSZLIBF)
-AC_SUBST(WXIMGSZLIBS)
-AC_SUBST(WXDKCLOCKLIBF)
-AC_SUBST(WXDKCLOCKLIBS)
-AC_SUBST(WXDKHTBLIBF)
-AC_SUBST(WXDKHTBLIBS)
-AC_SUBST(PRINTQDLIBF)
-AC_SUBST(PRINTQDLIBS)
-AC_SUBST(PRINTQDILIBF)
-AC_SUBST(PRINTQDILIBS)
-AC_SUBST(PRINTQDALIBF)
-AC_SUBST(PRINTQDALIBS)
-AC_SUBST(PJSNMPLIBF)
-AC_SUBST(PJSNMPLIBS)
-AC_SUBST(PRMONSNMPLIBF)
-AC_SUBST(PRMONSNMPLIBS)
-AC_SUBST(PRINTQDCLIBF)
-AC_SUBST(PRINTQDCLIBS)
-AC_SUBST(RSHDOWNLIBF)
-AC_SUBST(RSHDOWNLIBS)
-AC_SUBST(LPRNGCLLIBF)
-AC_SUBST(LPRNGCLLIBS)
-AC_SUBST(ITADMINLIBF)
-AC_SUBST(ITADMINLIBS)
-dnl BACKWARD COMPATIBILITY SECTION (VERSION 3) END
+dnl OUTPUT GENERATION
+
+dnl Substitue variables
+dnl ===================
-dnl Transfer variables to output files
+dnl Compiler toolchain
+dnl ------------------
+
+AC_SUBST(DEFS)
AC_SUBST(CC)
AC_SUBST(CPP)
AC_SUBST(CXX)
-AC_SUBST(DEFS)
-AC_SUBST(CPPFLAGS)
-AC_SUBST(CXXFLAGS)
-AC_SUBST(CFLAGS)
-AC_SUBST(LDFLAGS)
-AC_SUBST(LIBS)
-AC_SUBST(FS64)
-AC_SUBST(ZLIB)
-AC_SUBST(BZLIB)
+AC_SUBST(WINDRES)
+AC_SUBST(RCFLAGS)
+AC_SUBST(MKDIR_P)
+AC_SUBST(SED)
+AC_SUBST(INSTALL)
+AC_SUBST(LN_S)
AC_SUBST(RANLIB)
-AC_SUBST(CFPIC)
-AC_SUBST(PROGRAMS)
-AC_SUBST(LIBRARIES)
-AC_SUBST(LIBS_STATIC)
-AC_SUBST(LIBS_SHARED)
-AC_SUBST(LIBS_INSTALL)
-AC_SUBST(RES_INSTALL)
+AC_SUBST(AR)
+AC_SUBST(NM)
+AC_SUBST(MAKE)
+AC_SUBST(DELTARGET)
+AC_SUBST(DELTARGETSO)
AC_SUBST(MKSOLIB)
+AC_SUBST(MKSOLIBCPP)
AC_SUBST(RPATH)
AC_SUBST(RPATHLINK)
+AC_SUBST(MKSORPATH)
+AC_SUBST(MKSORPATHLINK)
+AC_SUBST(MKSOCHECKSYMBOLS)
+
+dnl Compiler and linker flags
+dnl -------------------------
+AC_SUBST(CFL_CLI_C8)
+AC_SUBST(CFL_CLI_DK)
+AC_SUBST(CXXFL_CLI_C8)
+AC_SUBST(CXXFL_CLI_DK)
+AC_SUBST(CXXFL_CLI_WX)
+AC_SUBST(CXXFL_GUI)
+AC_SUBST(LDFLC_CLI_C8)
+AC_SUBST(LDFLC_CLI_DK)
+AC_SUBST(LDFLCXX_CLI_C8)
+AC_SUBST(LDFLCXX_CLI_DK)
+AC_SUBST(LDFLCXX_CLI_WX)
+AC_SUBST(LDFLCXX_GUI)
+
+dnl Build system type
+dnl -----------------
+AC_SUBST(BUILDHOST)
+AC_SUBST(TARGETHOST)
+AC_SUBST(BUILDCLASS)
+AC_SUBST(TARGETCLASS)
+AC_SUBST(CROSSBUILD)
AC_SUBST(UNAME)
-AC_SUBST(SHLIBSTYLE)
+AC_SUBST(TOOLCHAIN)
+
+dnl Package version
+dnl ---------------
AC_SUBST(VERSNO)
AC_SUBST(SOVERS)
-AC_SUBST(CWARN)
+
+dnl Select components to build
+dnl --------------------------
+AC_SUBST(LIB_SHARED_RES_NET)
+AC_SUBST(PRG_RES_NET)
+AC_SUBST(MAN_RES_NET)
+AC_SUBST(RES_RES_NET)
+AC_SUBST(RES_RES_NET_EN)
+AC_SUBST(RES_RES_NET_DE)
+AC_SUBST(PRG_CLI_NET)
+AC_SUBST(MAN_CLI_NET)
+AC_SUBST(RES_CLI_NET)
+AC_SUBST(PRG_GUI_NET)
+AC_SUBST(MAN_GUI_NET)
+AC_SUBST(RES_GUI_NET)
+AC_SUBST(PRG_CLI_NET_POSIX)
+AC_SUBST(MAN_CLI_NET_POSIX)
+AC_SUBST(RES_CLI_NET_POSIX)
+AC_SUBST(PRG_CLI_SNMP)
+AC_SUBST(MAN_CLI_SNMP)
+AC_SUBST(RES_CLI_SNMP)
+AC_SUBST(PRG_CLI_MYSQL)
+AC_SUBST(MAN_CLI_MYSQL)
+AC_SUBST(RES_CLI_MYSQL)
+AC_SUBST(PRG_CLI_SSL)
+AC_SUBST(MAN_CLI_SSL)
+AC_SUBST(RES_CLI_SSL)
+AC_SUBST(PRG_GUI_SSL)
+AC_SUBST(MAN_GUI_SSL)
+AC_SUBST(RES_GUI_SSL)
+AC_SUBST(PRG_CLI_POSIX)
+AC_SUBST(MAN_CLI_POSIX)
+AC_SUBST(RES_CLI_POSIX)
+AC_SUBST(PRG_CLI_WINDOWS)
+AC_SUBST(MAN_CLI_WINDOWS)
+AC_SUBST(RES_CLI_WINDOWS)
+AC_SUBST(PRG_GUI_WINDOWS)
+AC_SUBST(MAN_GUI_WINDOWS)
+AC_SUBST(RES_GUI_WINDOWS)
+AC_SUBST(BUILD_ARCH)
+AC_SUBST(INSTALL_PROGRAMS)
+AC_SUBST(INSTALL_LIBS)
+AC_SUBST(INSTALL_INDEP)
+AC_SUBST(FOUND_SYSTEMD)
+
+# File name extensions
+# --------------------
+AC_SUBST(EXEEXT)
+AC_SUBST(OBJEXT)
+AC_SUBST(RCEXT)
+AC_SUBST(RESEXT)
+AC_SUBST(RESCRULE)
+
+# Detected run path
+# -----------------
+AC_SUBST(rundir)
+
+# Detected features
+# -----------------
+AC_SUBST(ZLIB)
+AC_SUBST(BZLIB)
+AC_SUBST(LIBPNG)
+AC_SUBST(LIBJPEG)
+AC_SUBST(LIBTIFF)
AC_SUBST(CRYPTO)
-AC_SUBST(DKCATLIBF)
-AC_SUBST(DKCATLIBS)
-AC_SUBST(DKBLKSLIBF)
-AC_SUBST(DKBLKSLIBS)
-AC_SUBST(DKSQLSPLITLIBF)
-AC_SUBST(DKSQLSPLITLIBS)
-AC_SUBST(DKERADISKLIBF)
-AC_SUBST(DKERADISKLIBS)
-AC_SUBST(DKLSLIBF)
-AC_SUBST(DKLSLIBS)
-AC_SUBST(DKSORTLIBF)
-AC_SUBST(DKSORTLIBS)
-AC_SUBST(DKFICLIBF)
-AC_SUBST(DKFICLIBS)
-AC_SUBST(DKUIDLIBF)
-AC_SUBST(DKUIDLIBS)
-AC_SUBST(DKPWGENLIBF)
-AC_SUBST(DKPWGENLIBS)
-AC_SUBST(DKRANDLIBF)
-AC_SUBST(DKRANDLIBS)
-AC_SUBST(DKT2HLIBF)
-AC_SUBST(DKT2HLIBS)
-AC_SUBST(DKT2LLIBF)
-AC_SUBST(DKT2LLIBS)
-AC_SUBST(DKHEXLIBF)
-AC_SUBST(DKHEXLIBS)
-AC_SUBST(DKBMMLIBF)
-AC_SUBST(DKBMMLIBS)
-AC_SUBST(DKPWDLIBF)
-AC_SUBST(DKPWDLIBS)
-AC_SUBST(DKRECVLIBF)
-AC_SUBST(DKRECVLIBS)
-AC_SUBST(DKSENDLIBF)
-AC_SUBST(DKSENDLIBS)
-AC_SUBST(DKDBT2LIBF)
-AC_SUBST(DKDBT2LIBS)
-AC_SUBST(DK4INFOLIBS)
-AC_SUBST(DK4INFOLIBF)
-AC_SUBST(PROGSOPENSSL)
+AC_SUBST(FS64)
AC_SUBST(SOCKLIB)
AC_SUBST(NSLLIB)
-AC_SUBST(LIB_SH_RES)
-AC_SUBST(LIB_SH_CLI)
-AC_SUBST(LIB_SH_GUI)
-AC_SUBST(NET_PROG_RES)
-AC_SUBST(NET_PROG_CLI)
-AC_SUBST(MYSQL_PROG_CLI)
+AC_SUBST(RTLIB)
+AC_SUBST(PTHREADLIB)
+AC_SUBST(DBLIB)
+AC_SUBST(DBLIBSOCK)
+AC_SUBST(MYSQLLIB)
AC_SUBST(MYSQLLDFLAGS)
-AC_SUBST(SNMP_PROG_CLI)
-AC_SUBST(TESTPROGRAMS)
+AC_SUBST(NETSNMP_LIBS)
+AC_SUBST(NETSNMP_CFLAGS)
+AC_SUBST(WINCLILIB)
+AC_SUBST(WINGUILIB)
+AC_SUBST(CLILIB)
+AC_SUBST(GUILIB)
+AC_MSG_NOTICE([CPPFLAGS substituted: $CPPFLAGS])
+AC_MSG_NOTICE([CFLAGS substituted: $CFLAGS])
+AC_MSG_NOTICE([LDFLAGS substituted: $LDFLAGS])
+AC_SUBST(CPPFLAGS)
+AC_SUBST(CFLAGS)
+AC_SUBST(LDFLAGS)
AC_SUBST(WXCPPFLAGS)
-AC_SUBST(WXCXXFLAGS)
AC_SUBST(WXCFLAGS)
+AC_SUBST(WXCXXFLAGS)
AC_SUBST(WXLDFLAGS)
+AC_SUBST(WXVERSION)
+AC_SUBST(MOD_DK3WREG)
+AC_SUBST(MOD_DK4DMT)
+AC_SUBST(LIBDK3WXOBJ)
+AC_SUBST(LIBDK4WXOBJ)
+AC_SUBST(LPRNGUSER)
+AC_SUBST(LPRNGGROUP)
+
+dnl Program objects and libraries
+dnl -----------------------------
AC_SUBST(SOLIBZ)
AC_SUBST(SOLIBBZ)
AC_SUBST(SOLIBMATH)
@@ -3160,25 +4385,12 @@ AC_SUBST(SOLIBDK4C)
AC_SUBST(SOLIBDK4MDRND)
AC_SUBST(SOLIBDK4PPPT)
AC_SUBST(SOLIBDK4APP)
+AC_SUBST(SOLIBDK4LATA)
AC_SUBST(SOLIBDK4LAT)
AC_SUBST(SOLIBDK4SOCK)
AC_SUBST(SOLIBDK4SOCKA)
AC_SUBST(SOLIBDK4DBI)
AC_SUBST(SOLIBDK4DBIA)
-AC_SUBST(NETSNMP_LIBS)
-AC_SUBST(MYSQLLIB)
-AC_SUBST(NETSNMP_CFLAGS)
-AC_SUBST(WXDKFCSLIBF)
-AC_SUBST(WXDKFCSLIBS)
-AC_SUBST(GETSOURCE)
-AC_SUBST(MAKE)
-AC_SUBST(CLILIB)
-AC_SUBST(GUILIB)
-AC_SUBST(ENTRY)
-AC_SUBST(WINUNICODE)
-AC_SUBST(INSTALLMANPAGES)
-AC_SUBST(LIBSPRIVATE)
-AC_SUBST(RTLIB)
AC_SUBST(LIBDK4BASELIBF)
AC_SUBST(LIBDK4BASELIBS)
AC_SUBST(LIBDK4MALIBF)
@@ -3201,16 +4413,26 @@ AC_SUBST(LIBDK4DBILIBF)
AC_SUBST(LIBDK4DBILIBS)
AC_SUBST(LIBDK4CLIBF)
AC_SUBST(LIBDK4CLIBS)
+AC_SUBST(LIBDK4LATALIBF)
+AC_SUBST(LIBDK4LATALIBS)
AC_SUBST(LIBDK4LATLIBF)
AC_SUBST(LIBDK4LATLIBS)
AC_SUBST(LIBDK4SOCKLIBF)
AC_SUBST(LIBDK4SOCKLIBS)
AC_SUBST(LIBDK4MDRNDLIBF)
AC_SUBST(LIBDK4MDRNDLIBS)
+AC_SUBST(LIBDK4BIFLIBF)
+AC_SUBST(LIBDK4BIFLIBS)
+AC_SUBST(LIBDK4GRALIBF)
+AC_SUBST(LIBDK4GRALIBS)
AC_SUBST(LIBDK4PPPTLIBF)
AC_SUBST(LIBDK4PPPTLIBS)
AC_SUBST(LIBDK4APPLIBF)
AC_SUBST(LIBDK4APPLIBS)
+AC_SUBST(LIBDK4BIFALIBF)
+AC_SUBST(LIBDK4BIFALIBS)
+AC_SUBST(LIBDK4GRAALIBF)
+AC_SUBST(LIBDK4GRAALIBS)
AC_SUBST(LIBDK4PPPTALIBF)
AC_SUBST(LIBDK4PPPTALIBS)
AC_SUBST(LIBDK4SOCKALIBF)
@@ -3237,262 +4459,285 @@ AC_SUBST(LIBDK3FIGLIBF)
AC_SUBST(LIBDK3FIGLIBS)
AC_SUBST(LIBDK3WXLIBF)
AC_SUBST(LIBDK3WXLIBS)
+AC_SUBST(DKCATLIBF)
+AC_SUBST(DKCATLIBS)
+AC_SUBST(DKBLKSLIBF)
+AC_SUBST(DKBLKSLIBS)
+AC_SUBST(DKSQLSPLITLIBF)
+AC_SUBST(DKSQLSPLITLIBS)
+AC_SUBST(DKERADISKLIBF)
+AC_SUBST(DKERADISKLIBS)
+AC_SUBST(DKLSLIBF)
+AC_SUBST(DKLSLIBS)
+AC_SUBST(DKSORTLIBF)
+AC_SUBST(DKSORTLIBS)
+AC_SUBST(DKLINESLIBF)
+AC_SUBST(DKLINESLIBS)
+AC_SUBST(DKFICLIBF)
+AC_SUBST(DKFICLIBS)
+AC_SUBST(DKUIDLIBF)
+AC_SUBST(DKUIDLIBS)
+AC_SUBST(DKPWGENLIBF)
+AC_SUBST(DKPWGENLIBS)
+AC_SUBST(DKRANDLIBF)
+AC_SUBST(DKRANDLIBS)
+AC_SUBST(DKT2HLIBF)
+AC_SUBST(DKT2HLIBS)
+AC_SUBST(DKT2LLIBF)
+AC_SUBST(DKT2LLIBS)
+AC_SUBST(DKBIN2CLIBF)
+AC_SUBST(DKBIN2CLIBS)
+AC_SUBST(DKHEXLIBF)
+AC_SUBST(DKHEXLIBS)
+AC_SUBST(DKBMMLIBF)
+AC_SUBST(DKBMMLIBS)
+AC_SUBST(DKPWDLIBF)
+AC_SUBST(DKPWDLIBS)
+AC_SUBST(DKRECVLIBF)
+AC_SUBST(DKRECVLIBS)
+AC_SUBST(DKSENDLIBF)
+AC_SUBST(DKSENDLIBS)
+AC_SUBST(DKDBT2LIBF)
+AC_SUBST(DKDBT2LIBS)
+AC_SUBST(DK4INFOLIBS)
+AC_SUBST(DK4INFOLIBF)
+AC_SUBST(DKCTLIBF)
+AC_SUBST(DKCTLIBS)
+AC_SUBST(ADDCTRLDLIBF)
+AC_SUBST(ADDCTRLDLIBS)
+AC_SUBST(DKDBTLIBF)
+AC_SUBST(DKDBTLIBS)
+AC_SUBST(BMPPLIBF)
+AC_SUBST(BMPPLIBS)
+AC_SUBST(FIG2LATLIBF)
+AC_SUBST(FIG2LATLIBS)
+AC_SUBST(WXD2LATLIBF)
+AC_SUBST(WXD2LATLIBS)
+AC_SUBST(HTMLBOOKLIBF)
+AC_SUBST(HTMLBOOKLIBS)
+AC_SUBST(DKWTLIBF)
+AC_SUBST(DKWTLIBS)
+AC_SUBST(WPRCLEANLIBF)
+AC_SUBST(WPRCLEANLIBS)
+AC_SUBST(DK3INFOLIBF)
+AC_SUBST(DK3INFOLIBS)
+AC_SUBST(PLPDFTEXLIBF)
+AC_SUBST(PLPDFTEXLIBS)
+AC_SUBST(DKWXWIZLIBF)
+AC_SUBST(DKWXWIZLIBS)
+AC_SUBST(DKWXPATHLIBF)
+AC_SUBST(DKWXPATHLIBS)
+AC_SUBST(WINPRINTLIBF)
+AC_SUBST(WINPRINTLIBS)
+AC_SUBST(CHSCRSZLIBF)
+AC_SUBST(CHSCRSZLIBS)
+AC_SUBST(WXDKCTLIBF)
+AC_SUBST(WXDKCTLIBS)
+AC_SUBST(WXDKDRAWLIBF)
+AC_SUBST(WXDKDRAWLIBS)
+AC_SUBST(WXBMPPLIBF)
+AC_SUBST(WXBMPPLIBS)
+AC_SUBST(WXDKFCSLIBF)
+AC_SUBST(WXDKFCSLIBS)
+AC_SUBST(WXPQDICLIBF)
+AC_SUBST(WXPQDICLIBS)
+AC_SUBST(WXIMGSZLIBF)
+AC_SUBST(WXIMGSZLIBS)
+AC_SUBST(WXDKCLOCKLIBF)
+AC_SUBST(WXDKCLOCKLIBS)
+AC_SUBST(WXDKHTBLIBF)
+AC_SUBST(WXDKHTBLIBS)
+AC_SUBST(PRINTQDLIBF)
+AC_SUBST(PRINTQDLIBS)
+AC_SUBST(PRINTQDILIBF)
+AC_SUBST(PRINTQDILIBS)
+AC_SUBST(PRINTQDALIBF)
+AC_SUBST(PRINTQDALIBS)
+AC_SUBST(PJSNMPLIBF)
+AC_SUBST(PJSNMPLIBS)
+AC_SUBST(PRMONSNMPLIBF)
+AC_SUBST(PRMONSNMPLIBS)
+AC_SUBST(PRINTQDCLIBF)
+AC_SUBST(PRINTQDCLIBS)
+AC_SUBST(RSHDOWNLIBF)
+AC_SUBST(RSHDOWNLIBS)
+AC_SUBST(LPRNGCLLIBF)
+AC_SUBST(LPRNGCLLIBS)
+AC_SUBST(ITADMINLIBF)
+AC_SUBST(ITADMINLIBS)
+AC_SUBST(GETSOURCE)
-AC_OUTPUT([Makefile scripts/wr-dk3inst.sh scripts/wr-dk4inst.sh scripts/create-desktop-files.sh scripts/build-help.sh initd-printqd dktools.pc pkginfo debian/control])
-
-chmod 755 scripts/*.sh
+dnl Resource files
+dnl --------------
+AC_SUBST(ADDCTRLDRES)
+AC_SUBST(BMPPRES)
+AC_SUBST(DK3INFORES)
+AC_SUBST(DK4INFORES)
+AC_SUBST(DKBIN2CRES)
+AC_SUBST(DKBLKSRES)
+AC_SUBST(DKBMMRES)
+AC_SUBST(DKCATRES)
+AC_SUBST(DKCTRES)
+AC_SUBST(DKDB2TRES)
+AC_SUBST(DKDBCORES)
+AC_SUBST(DKDBTRES)
+AC_SUBST(DKERADISKRES)
+AC_SUBST(DKFICRES)
+AC_SUBST(DKHEXRES)
+AC_SUBST(DKLINESRES)
+AC_SUBST(DKLSRES)
+AC_SUBST(DKPWDRES)
+AC_SUBST(DKPWGENRES)
+AC_SUBST(DKRANDRES)
+AC_SUBST(DKRECVRES)
+AC_SUBST(DKSENDRES)
+AC_SUBST(DKSORTRES)
+AC_SUBST(DKSQLSPLITRES)
+AC_SUBST(DKT2DBRES)
+AC_SUBST(DKT2HRES)
+AC_SUBST(DKT2LRES)
+AC_SUBST(DKWTADMRES)
+AC_SUBST(DKWTRES)
+AC_SUBST(DKWXPATHRES)
+AC_SUBST(DKWXWIZRES)
+AC_SUBST(FIG2LATRES)
+AC_SUBST(HTMLBOOKRES)
+AC_SUBST(ITADMINRES)
+AC_SUBST(LPRNGCLRES)
+AC_SUBST(PLPDFTEXRES)
+AC_SUBST(WINPRINTRES)
+AC_SUBST(WPRCLEANRES)
+AC_SUBST(WXBMPPRES)
+AC_SUBST(WXDKCLOCKRES)
+AC_SUBST(WXDKCTRES)
+AC_SUBST(WXDKFCSRES)
+AC_SUBST(WXDKHTBRES)
+AC_SUBST(WXDKSCRSZRES)
+AC_SUBST(WXIMGSZRES)
+AC_SUBST(WXPQDICRES)
+LIBSPRIVATE="$CRYPTO $MYSQLLIB $DBLIB $LIBTIFF $LIBJPEG $BZLIB"
+AC_SUBST(LIBSPRIVATE)
+AC_SUBST(systemddir)
+AC_SUBST(SUITE)
+AC_SUBST(THISYEAR)
-dnl For Debian packaging
+dnl Debian packaging
+dnl ----------------
cp debian/dktools-lib.install.in debian/dktools-lib-${SOVERS}.install
-cp debian/dktools-lib.postinst.in debian/dktools-lib-${SOVERS}.postinst
-cp debian/dktools-lib.postrm.in debian/dktools-lib-${SOVERS}.postrm
cp debian/dktools-lib-dev.install.in debian/dktools-lib-${SOVERS}-dev.install
echo package-name-doesnt-match-sonames > debian/dktools-lib-${SOVERS}.lintian-overrides
-chmod 644 debian/dktools-lib-${SOVERS}.install
-chmod 644 debian/dktools-lib-${SOVERS}.postinst
-chmod 644 debian/dktools-lib-${SOVERS}.postrm
-chmod 644 debian/dktools-lib-${SOVERS}-dev.install
-chmod 644 debian/dktools-lib-${SOVERS}.lintian-overrides
-
-[[ ! -f dk4config ]] || rm -f dk4config
-[[ ! -f dk4config.o ]] || rm -f dk4config.o
-[[ ! -f dk3config ]] || rm -f dk3config
-[[ ! -f dk3config.o ]] || rm -fr dk3config.o
-[[ ! -f wxcs ]] || rm -f wxcs
-[[ ! -f wxcs.o ]] || rm -fr wxcs.o
-
-if [[ "X$build" != "X$host" ]]
-then
- cp dk3conf.cross dk3conf.h
- cp dk4conf.cross dk4conf.h
- cp dk4wxcs.cross dk4wxcs.h
- echo 'ERROR: Cross-compiling not supported!'
-elif [[ "X$SUITE" = "Xgui" ]]
-then
- echo 'Build dk4config (C++)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- echo 'Build wxcs (C++)'
- $MAKE wxcs
- echo 'Generating configuration files'
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
- ./wxcs > dk4wxcs.h
-elif [[ "X$CXX" != "X" ]]
-then
- echo 'Build dk4config (C++)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- echo 'Generating configuration files'
- cp dk4wxcs.cross dk4wxcs.h
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
-else
- sed -f mod-dkconfig.sed < dk4config.cpp > dk4config.c
- mv dk4config.cpp dk4config.cpp.bck
- echo 'Build dk4config (C)'
- $MAKE dk4config
- echo 'Build dk3config (C)'
- $MAKE dk3config
- mv dk4config.cpp.bck dk4config.cpp
- rm dk4config.c
- echo 'Generating configuration files'
- cp dk4wxcs.cross dk4wxcs.h
- ./dk4config > dk4conf.h
- ./dk3config > dk3conf.h
-fi
-sed -e 's/DK4/DK3/g' < dk4wxcs.h > dk3wxcs.h
-
-dnl Produce dk4inst.c file
-chmod 755 scripts/wr-dk4inst.sh
-echo './scripts/wr-dk4inst.sh > dk4inst.c'
-./scripts/wr-dk4inst.sh
-chmod 755 scripts/wr-dk3inst.sh
-./scripts/wr-dk3inst.sh > dk3inst.c
-chmod 755 scripts/create-desktop-files.sh
-./scripts/create-desktop-files.sh
-
-dnl Produce dk4vers.h file
-VERSNO=`cat version.txt`
-cat > dk4vers.h <<EOF
-#ifndef DK4VERS_H_INCLUDED
-#define DK4VERS_H_INCLUDED 1
-/** @file dk4vers.h Version number as text string.
-*/
-/** Version number in 8 bit characters.
-*/
-#define DKT_VERSION_C8 "$VERSNO"
-/** Version number in dkChar.
-*/
-#define DKT_VERSION_DK dkT("$VERSNO")
+dnl Produce Makefile and other files
+dnl ================================
+AC_OUTPUT([Makefile scripts/write-files.sh scripts/build-help.sh initd-printqd initd-rshdown dktools.pc pkginfo debian/control debian/control9 debian/control8] debian/printqd.postrm debian/printqd.postinst debian/rshdown.postrm)
-#endif
-EOF
+dnl Correct permissions on scripts, run scripts
+dnl -------------------------------------------
+export FOUND_SYSTEMD
+chmod ugo+rx scripts/*.sh initd-printqd initd-rshdown
+scripts/write-files.sh
-cat > dk4verswx.h <<EOF
-#ifndef DK4VERSWX_H_INCLUDED
-/** Protection against multiple inclusions. */
-#define DK4VERSWX_H_INCLUDED 1
-/** @file dk4verswx.h Version number as wxChar string.
-*/
-
-#ifndef WX_WXPREC_H_INCLUDED
-#include "wx/wxprec.h"
-#define WX_WXPREC_H_INCLUDED 1
-#endif
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#ifndef WX_WX_H_INCLUDED
-#include "wx/wx.h"
-#define WX_WX_H_INCLUDED 1
-#endif
-#endif
-
-/** Version number as wxChar string.
-*/
-#define DKT_VERSION_WX wxT("$VERSNO")
-
-#endif
-EOF
-
-dnl Write summary
-echo ''
-echo 'Configuration summary'
-echo '====================='
-if [[ "X$ZLIB" = "X-lz" ]]
-then
-echo 'zlib: found.'
-else
-echo 'zlib: NOT found! Required!'
-echo ' SL 6.x package name: zlib-devel'
-echo ' Debian package name: libz-dev'
-echo ' URL: http://www.zlib.net'
-EXVAL=1
-fi
-if [[ "X-lbz2" = "X$BZLIB" ]]
+dnl Fix configure script results
+dnl ============================
+if [[ "X$CROSSBUILD" = "Xyes" -o "X$MAKE" = "X" ]]
then
-echo 'libbz2: found.'
+ AC_MSG_NOTICE([Fix configure results: Use sed])
+ (
+ cat dk4conf.h.start
+ grep '#define' config.h | awk '{print $2 " " $3;}' | grep -v CONFIG_H_INCLUDED | sort | sed -e 's/^/#define DK4_/g'
+ cat dk4conf.h.large
+ cat dk4conf.h.end
+ ) > dk4conf.h
+ (
+ cat dk3conf.h.start
+ grep '#define' config.h | awk '{print $2 " " $3;}' | grep -v CONFIG_H_INCLUDED | sort | sed -e 's/^/#define DK3_/g'
+ cat dk3conf.h.large
+ cat dk3conf.h.end
+ ) > dk3conf.h
+ cp dk4wxcs.cross dk4wxcs.h
else
-echo 'libbz2: NOT found! Recommended.'
-echo ' Bzip compression not available.'
-echo ' SL 6.x package name: bzip2-devel'
-echo ' Debian package name: libbz2-dev'
-echo ' URL: http://www.bzip.org'
+ AC_MSG_NOTICE([Fix configure results: Run programs])
+ [[ ! -f "dk4config${EXEEXT}" ]] || rm -f "dk4config${EXEEXT}"
+ [[ ! -f "dk4wxcs${EXEEXT}" ]] || rm -f "dk4wxcs${EXEEXT}"
+ [[ ! -f "dk3config${EXEEXT}" ]] || rm -f "dk3config${EXEEXT}"
+ ${MAKE} dk4config${EXEEXT} dk3config${EXEEXT} dk4wxcs${EXEEXT}
+ (
+ cat dk4conf.h.start
+ ./dk4config${EXEEXT}
+ cat dk4conf.h.end
+ ) > dk4conf.h
+ ./dk3config${EXEEXT} > dk3conf.h
+ ./dk4wxcs${EXEEXT} > dk4wxcs.h
+ sed -e 's/DK4/DK3/g' < dk4wxcs.h > dk3wxcs.h
fi
-if [[ "X$LIBPNG" = "X-lpng" ]]
-then
-echo 'libpng: found.'
-else
-echo 'libpng: NOT found! Required!'
-echo ' SL 6.x package name: libpng-devel'
-echo ' Debian package name: libpng-dev'
-echo ' URL: http://www.libpng.org'
-EXVAL=1
-fi
-if [[ "X$LIBJPEG" = "X-ljpeg" ]]
-then
-echo 'libjpeg: found.'
-else
-echo 'libjpeg: NOT found! Recommended.'
-echo ' No JPEG support in bmpp and fig2lat.'
-echo ' SL 6.x package name: libjpeg-turbo-devel'
-echo ' Debian package name: libjpeg-dev'
-echo ' URL: http://www.ijg.org/'
-fi
-if [[ "X$LIBTIFF" = "X-ltiff" ]]
-then
-echo 'libtiff: found.'
-else
-echo 'libtiff: NOT found! Recommended.'
-echo ' No TIFF support in bmpp and fig2lat.'
-echo ' SL 6.x package name: libtiff-devel'
-echo ' Debian package name: libtiff-dev'
-echo ' URL: http://www.remotesensing.org/libtiff/'
-fi
-if [[ "X$ANYDB" != "X" ]]
-then
-echo "database: $ANYDB"
-else
-echo 'database: NOT found! Recommended.'
-echo ' Skipping printqd build!'
-echo ' SL 6.x package name: db4-devel'
-echo ' Debian package name: libdb-dev'
-echo ' URL: http://www.oracle.com/database/berkeley-db/'
-fi
-if [[ "X$MYSQLPROG" = "Xmysqlprog" ]]
-then
-echo 'MySQL: found.'
-else
-echo 'MySQL: NOT found! Recommended.'
-echo ' Skipping itadmin build.'
-echo ' SL 6.x package name: mysql-devel'
-echo ' Debian package name: libmysqlclient-dev'
-echo ' URL: http://www.mysql.com/'
-fi
-if [[ "X$CRYPTO" != "X" ]]
-then
-echo 'OpenSSL: found.'
-else
-echo 'OpenSSL: NOT found!'
-echo ' SL 6.x package name: openssl-devel'
-echo ' Debian package name: libssl-dev'
-echo ' URL: http://www.openssl.org/'
-fi
-if [[ "X$WXCPPFLAGS" != "X" ]]
-then
-echo 'wxWidgets: found.'
-else
-echo 'wxWidgets: NOT found!'
-echo ' SL 6.x package name: wxGTK-devel'
-echo ' Debian package name: libwxgtk3.0-dev'
-echo ' URL: http://www.wxwidgets.org/'
-fi
-case "X$SUITE" in
-"Xgui")
-echo 'Software bundle: CLI and GUI programs'
-;;
-"Xrescue")
-echo 'Software bundle: Rescue system programs'
-;;
-"*")
-echo 'Software bundle: CLI programs'
-;;
-esac
-if [[ "X$ENASTATIC" = "Xyes" ]]
-then
-echo 'Install static libraries: yes'
-else
-echo 'Install static libraries: no'
-fi
-if [[ "X$ENASHARED" = "Xyes" ]]
-then
-echo 'Install shared libraries: yes'
-else
-echo 'Install shared libraries: no'
-fi
-if [[ "X$USESOLINKING" = "Xyes" ]]
+
+
+dnl Summary output
+dnl ==============
+AC_MSG_NOTICE([Software suite: $SUITE])
+AC_MSG_NOTICE([Build static libraries: $ENA_STATIC])
+AC_MSG_NOTICE([Build shared libraries: $ENA_SHARED])
+if [[ "X$ENA_SHARED" = "Xyes" ]]
then
-echo 'Nested shared library linking: yes'
-else
-echo 'Nested shared library linking: no'
+AC_MSG_NOTICE([Build for package generation: $ENA_PACKAGE])
fi
-if [[ "X$ENAPACKAGING" = "Xyes" ]]
+AC_MSG_NOTICE([Link shared libs with shared libs: $ENA_SOSO])
+AC_MSG_NOTICE([Install man pages: $ENA_MAN])
+AC_MSG_NOTICE([Activate more warnings: $ENA_WARN])
+AC_MSG_NOTICE([Allow debug information: $ENA_DEBUG])
+AC_MSG_NOTICE([Corrections for SunOS: $ENA_SUNOS_CORR])
+AC_MSG_NOTICE([Build host: $BUILDHOST])
+AC_MSG_NOTICE([Build class: $BUILDCLASS])
+AC_MSG_NOTICE([Target host: $TARGETHOST])
+AC_MSG_NOTICE([Target class: $TARGETCLASS])
+AC_MSG_NOTICE([Cross compilation build: $CROSSBUILD])
+AC_MSG_NOTICE([Tool chain: $TOOLCHAIN])
+AC_MSG_NOTICE([C compiler: $CC])
+AC_MSG_NOTICE([C++ compiler: $CXX])
+AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
+AC_MSG_NOTICE([CFLAGS: $CFLAGS])
+AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
+AC_MSG_NOTICE([])
+AC_MSG_NOTICE([Libraries and functions:])
+AC_MSG_NOTICE([socket $FOUND_SOCKET])
+AC_MSG_NOTICE([zlib $FOUND_ZLIB])
+AC_MSG_NOTICE([libbz2 $FOUND_BZLIB])
+AC_MSG_NOTICE([libpng $FOUND_PNG])
+AC_MSG_NOTICE([libjpeg $FOUND_JPG])
+AC_MSG_NOTICE([libtiff $FOUND_TIFF])
+AC_MSG_NOTICE([OpenSSL $FOUND_OPENSSL])
+AC_MSG_NOTICE([NetSNMP $FOUND_NETSNMP])
+AC_MSG_NOTICE([MySQL / MariaDB $FOUND_MYSQL])
+AC_MSG_NOTICE([wxWidgets $FOUND_WX])
+
+dnl Special hints for cross-compilation builds
+dnl ------------------------------------------
+if [[ "X$CROSSBUILD" = "Xyes" ]]
then
-echo 'Binaries use shared libraries: yes'
-else
-echo 'Binaries use shared libraries: no'
+AC_MSG_NOTICE([])
+AC_MSG_NOTICE([CROSS-COMPILATION BUILD:])
+AC_MSG_WARN([Test for twos complement not possible!])
+AC_MSG_WARN([Test for IEEE 754 compliant double not possible!])
+AC_MSG_WARN([Test for /proc/.../exe not possible!])
+AC_MSG_WARN([Results for these tests are guessed and may be wrong.])
+AC_MSG_WARN([Before you continue check the following settings,])
+AC_MSG_WARN([apply corrections if necessary:])
+AC_MSG_WARN([- HAVE_TWOS_COMPLEMENT in file config.h])
+AC_MSG_WARN([- HAVE_IEEE_754_DOUBLE in file config.h])
+AC_MSG_WARN([- HAVE_PROC_PID_EXE in file config.h])
+AC_MSG_WARN([Run "make confprogs" if corrections were necessary.])
+AC_MSG_NOTICE([])
+AC_MSG_NOTICE([Before running "make" and "make install" transfer the programs])
+AC_MSG_NOTICE([dk3config${EXEEXT}, dk4config${EXEEXT} and dk4wxcs${EXEEXT}])
+AC_MSG_NOTICE([to the target system and run the commands])
+AC_MSG_NOTICE([ ./dk3config > dk3conf.h])
+AC_MSG_NOTICE([ ./dk4config > dk4conf.h])
+AC_MSG_NOTICE([ ./dk4wxcs > dk4wxcs.h])
+AC_MSG_NOTICE([on the target system.])
+AC_MSG_NOTICE([Transfer the files dk3conf.h, dk4conf.h and dk4wxcs.h back to])
+AC_MSG_NOTICE([here. At the start of dk4conf.h insert the dk4conf.h.start file.])
+AC_MSG_NOTICE([At the end of dk4conf.h insert the dk4conf.h.end file.])
+AC_MSG_NOTICE([Now continue the build process.])
fi
-echo ''
-echo The INSTALL files describes how to install via '*.rpm' or '.deb' package.
-echo ''
-exit $EXVAL
-
diff --git a/support/dktools/configure.out.mingw b/support/dktools/configure.out.mingw
new file mode 100644
index 0000000000..a0acf06420
--- /dev/null
+++ b/support/dktools/configure.out.mingw
@@ -0,0 +1,762 @@
+checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
+checking whether the C compiler works... yes
+checking for C compiler default output file name... a.exe
+checking for suffix of executables... .exe
+checking whether we are cross compiling... yes
+checking for suffix of object files... o
+checking whether we are using the GNU C compiler... yes
+checking whether x86_64-w64-mingw32-gcc accepts -g... yes
+checking for x86_64-w64-mingw32-gcc option to accept ISO C89... none needed
+checking how to run the C preprocessor... /usr/bin/x86_64-w64-mingw32-cpp
+checking whether we are using the GNU C++ compiler... yes
+checking whether x86_64-w64-mingw32-g++ accepts -g... yes
+checking for grep that handles long lines and -e... /usr/bin/grep
+checking for egrep... /usr/bin/grep -E
+checking for ANSI C header files... yes
+checking for sys/types.h... yes
+checking for sys/stat.h... yes
+checking for stdlib.h... yes
+checking for string.h... yes
+checking for memory.h... yes
+checking for strings.h... yes
+checking for inttypes.h... yes
+checking for stdint.h... yes
+checking for unistd.h... yes
+checking whether byte ordering is bigendian... no
+checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
+checking for a sed that does not truncate output... /usr/bin/sed
+checking for a BSD-compatible install... /usr/bin/install -c
+checking whether ln -s works... yes
+checking build system type... x86_64-redhat-linux-gnu
+checking host system type... x86_64-w64-mingw32
+checking for x86_64-w64-mingw32-ranlib... /usr/bin/x86_64-w64-mingw32-ranlib
+checking for x86_64-w64-mingw32-ar... /usr/bin/x86_64-w64-mingw32-ar
+checking for x86_64-w64-mingw32-nm... /usr/bin/x86_64-w64-mingw32-nm
+CC = x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc
+CXX = x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++
+Building on: x86_64-redhat-linux-gnu
+Building for: x86_64-w64-mingw32
+checking GNU make... yes
+checking make... yes
+checking wxconfig... /usr/x86_64-w64-mingw32/sys-root/mingw/bin/wx-config-3.0
+checking for wget... wget
+checking for curl... curl
+checking errno.h usability... yes
+checking errno.h presence... yes
+checking for errno.h... yes
+checking assert.h usability... yes
+checking assert.h presence... yes
+checking for assert.h... yes
+checking complex.h usability... yes
+checking complex.h presence... yes
+checking for complex.h... yes
+checking ctype.h usability... yes
+checking ctype.h presence... yes
+checking for ctype.h... yes
+checking fenv.h usability... yes
+checking fenv.h presence... yes
+checking for fenv.h... yes
+checking float.h usability... yes
+checking float.h presence... yes
+checking for float.h... yes
+checking for inttypes.h... (cached) yes
+checking iso646.h usability... yes
+checking iso646.h presence... yes
+checking for iso646.h... yes
+checking limits.h usability... yes
+checking limits.h presence... yes
+checking for limits.h... yes
+checking locale.h usability... yes
+checking locale.h presence... yes
+checking for locale.h... yes
+checking math.h usability... yes
+checking math.h presence... yes
+checking for math.h... yes
+checking setjmp.h usability... yes
+checking setjmp.h presence... yes
+checking for setjmp.h... yes
+checking signal.h usability... yes
+checking signal.h presence... yes
+checking for signal.h... yes
+checking stdalign.h usability... yes
+checking stdalign.h presence... yes
+checking for stdalign.h... yes
+checking stdarg.h usability... yes
+checking stdarg.h presence... yes
+checking for stdarg.h... yes
+checking stdatomic.h usability... yes
+checking stdatomic.h presence... yes
+checking for stdatomic.h... yes
+checking stdbool.h usability... yes
+checking stdbool.h presence... yes
+checking for stdbool.h... yes
+checking stddef.h usability... yes
+checking stddef.h presence... yes
+checking for stddef.h... yes
+checking for stdint.h... (cached) yes
+checking for stdlib.h... (cached) yes
+checking stdnoreturn.h usability... yes
+checking stdnoreturn.h presence... yes
+checking for stdnoreturn.h... yes
+checking for string.h... (cached) yes
+checking tgmath.h usability... yes
+checking tgmath.h presence... yes
+checking for tgmath.h... yes
+checking threads.h usability... no
+checking threads.h presence... no
+checking for threads.h... no
+checking time.h usability... yes
+checking time.h presence... yes
+checking for time.h... yes
+checking uchar.h usability... yes
+checking uchar.h presence... yes
+checking for uchar.h... yes
+checking wchar.h usability... yes
+checking wchar.h presence... yes
+checking for wchar.h... yes
+checking wctype.h usability... yes
+checking wctype.h presence... yes
+checking for wctype.h... yes
+checking for sys/types.h... (cached) yes
+checking sys/param.h usability... yes
+checking sys/param.h presence... yes
+checking for sys/param.h... yes
+checking for sys/stat.h... (cached) yes
+checking sys/time.h usability... yes
+checking sys/time.h presence... yes
+checking for sys/time.h... yes
+checking sys/socket.h usability... no
+checking sys/socket.h presence... no
+checking for sys/socket.h... no
+checking sys/select.h usability... no
+checking sys/select.h presence... no
+checking for sys/select.h... no
+checking sys/un.h usability... no
+checking sys/un.h presence... no
+checking for sys/un.h... no
+checking netinet/in.h usability... no
+checking netinet/in.h presence... no
+checking for netinet/in.h... no
+checking netinet/in6.h usability... no
+checking netinet/in6.h presence... no
+checking for netinet/in6.h... no
+checking netdb.h usability... no
+checking netdb.h presence... no
+checking for netdb.h... no
+checking arpa/inet.h usability... no
+checking arpa/inet.h presence... no
+checking for arpa/inet.h... no
+checking winsock2.h usability... yes
+checking winsock2.h presence... yes
+checking for winsock2.h... yes
+checking ws2tcpip.h usability... yes
+checking ws2tcpip.h presence... yes
+checking for ws2tcpip.h... yes
+checking windows.h usability... yes
+checking windows.h presence... yes
+checking for windows.h... yes
+checking for unistd.h... (cached) yes
+checking process.h usability... yes
+checking process.h presence... yes
+checking for process.h... yes
+checking fcntl.h usability... yes
+checking fcntl.h presence... yes
+checking for fcntl.h... yes
+checking share.h usability... yes
+checking share.h presence... yes
+checking for share.h... yes
+checking pwd.h usability... no
+checking pwd.h presence... no
+checking for pwd.h... no
+checking for strings.h... (cached) yes
+checking io.h usability... yes
+checking io.h presence... yes
+checking for io.h... yes
+checking bios.h usability... no
+checking bios.h presence... no
+checking for bios.h... no
+checking search.h usability... yes
+checking search.h presence... yes
+checking for search.h... yes
+checking dos.h usability... yes
+checking dos.h presence... yes
+checking for dos.h... yes
+checking alloc.h usability... no
+checking alloc.h presence... no
+checking for alloc.h... no
+checking malloc.h usability... yes
+checking malloc.h presence... yes
+checking for malloc.h... yes
+checking dirent.h usability... yes
+checking dirent.h presence... yes
+checking for dirent.h... yes
+checking direct.h usability... yes
+checking direct.h presence... yes
+checking for direct.h... yes
+checking zlib.h usability... yes
+checking zlib.h presence... yes
+checking for zlib.h... yes
+checking bzlib.h usability... yes
+checking bzlib.h presence... yes
+checking for bzlib.h... yes
+checking openssl/rand.h usability... yes
+checking openssl/rand.h presence... yes
+checking for openssl/rand.h... yes
+checking openssl/md5.h usability... yes
+checking openssl/md5.h presence... yes
+checking for openssl/md5.h... yes
+checking openssl/sha.h usability... yes
+checking openssl/sha.h presence... yes
+checking for openssl/sha.h... yes
+checking openssl/ripemd.h usability... yes
+checking openssl/ripemd.h presence... yes
+checking for openssl/ripemd.h... yes
+checking whether time.h and sys/time.h may both be included... yes
+checking longlong... yes
+checking longdouble... yes
+checking intmax_t... yes
+checking volatile... yes
+checking sig_atomic_t... yes
+checking size of short... 2
+checking size of int... 4
+checking size of size_t... 8
+checking size of long... 4
+checking size of long long... 8
+checking size of intmax_t... 8
+checking size of int32_t... 4
+checking size of double... 8
+checking size of long double... 16
+checking size of wchar_t... 2
+checking _LARGEFILE64_SOURCE... yes
+checking for memset... yes
+checking for bzero... no
+checking for memcpy... yes
+checking for bcopy... no
+checking for memcmp... yes
+checking for bcmp... no
+checking for malloc... yes
+checking for calloc... yes
+checking for free... yes
+checking for strcpy_s... yes
+checking for strcat_s... yes
+checking for strcasecmp... yes
+checking for stricmp... yes
+checking for _stricmp... yes
+checking for wcslen... yes
+checking for wcscpy_s... yes
+checking for wcscpy... yes
+checking for wcscat_s... yes
+checking for wcscat... yes
+checking for wcschr... yes
+checking for wcsrchr... yes
+checking for wcscmp... yes
+checking for _wcscmp... no
+checking for wcscasecmp... no
+checking for _wcscasecmp... no
+checking for wcsicmp... yes
+checking for _wcsicmp... yes
+checking for getpid... yes
+checking for readlink... no
+checking for getexecname... no
+checking for lstat... no
+checking for stat64... no
+checking for lstat64... no
+checking for localtime_r... no
+checking for geteuid... no
+checking for fopen64... yes
+checking for fopen_s... yes
+checking for _wfopen... yes
+checking for _wfopen64... no
+checking for _wfopen_s... yes
+checking for fputws... yes
+checking for fputwc... yes
+checking for setbuffer... no
+checking for setbuf... yes
+checking for setvbuf... yes
+checking for fileno... yes
+checking for _fileno... yes
+checking for setmode... yes
+checking for _setmode... yes
+checking for isatty... yes
+checking for _isatty... yes
+checking for strtod... yes
+checking for _strtod... no
+checking for wcstod... yes
+checking for _wcstod... no
+checking for _snprintf_s... yes
+checking for _snprintf... yes
+checking for snprintf... yes
+checking for _snwprintf_s... yes
+checking for _snwprintf... yes
+checking for snwprintf... yes
+checking for swprintf... yes
+checking for unlink... yes
+checking for _unlink... yes
+checking for wunlink... no
+checking for _wunlink... yes
+checking for rmdir... yes
+checking for _rmdir... yes
+checking for wrmdir... no
+checking for _wrmdir... yes
+checking for mkdir... yes
+checking for _mkdir... yes
+checking for wmkdir... no
+checking for _wmkdir... yes
+checking for strerror... yes
+checking for strerror_r... no
+checking for sigaction... no
+checking for sigset... no
+checking for signal... yes
+checking for sigprocmask... no
+checking for sigemptyset... no
+checking for setpwent... no
+checking for getpwent... no
+checking for endpwent... no
+checking for getenv... yes
+checking for getenv_s... yes
+checking for setlocale... yes
+checking for getcwd... yes
+checking for _getcwd... yes
+checking for _wgetcwd... yes
+checking for SHA224_Init in -lcrypto... yes
+checking for SHA256_Init in -lcrypto... yes
+checking for SHA384_Init in -lcrypto... yes
+checking for SHA512_Init in -lcrypto... yes
+checking RAND_egd... checking for RAND_egd in -lcrypto... no
+no
+checking for clock_gettime in -lrt... no
+checking for socket... no
+checking for socket in -lxnet... no
+checking for socket in -lsocket... no
+checking for socket in -lws2_32... yes
+checking for setsockopt... no
+checking for setsockopt in -lxnet... no
+checking for setsockopt in -lsocket... no
+checking for setsockopt in -lws2_32... yes
+checking for getaddrinfo... no
+checking for getaddrinfo in -lxnet... no
+checking for getaddrinfo in -lnsl... no
+checking for getaddrinfo in -lsocket... no
+checking for getaddrinfo in -lws2_32... yes
+checking for getnameinfo... no
+checking for getnameinfo in -lxnet... no
+checking for getnameinfo in -lnsl... no
+checking for getnameinfo in -lsocket... no
+checking for getnameinfo in -lws2_32... yes
+checking for gethostbyname... no
+checking for gethostbyname in -lxnet... no
+checking for gethostbyname in -lnsl... no
+checking for gethostbyname in -lsocket... no
+checking for gethostbyname in -lws3_32... no
+checking htons... yes
+checking ntohs... yes
+checking htonl... yes
+checking ntohl... yes
+checking for inet_addr... no
+checking for inet_addr in -lxnet... no
+checking for inet_addr in -lnsl... no
+checking for inet_addr in -lsocket... no
+checking for inet_addr in -lws2_32... yes
+checking for inet_aton... no
+checking for inet_aton in -lxnet... no
+checking for inet_aton in -lnsl... no
+checking for inet_aton in -lsocket... no
+checking for inet_aton in -lws2_32... no
+checking for inet_pton... no
+checking for inet_pton in -lxnet... no
+checking for inet_pton in -lnsl... no
+checking for inet_pton in -lsocket... no
+checking for inet_pton in -lws2_32... yes
+checking for inet_ntop... no
+checking for inet_ntop in -lxnet... no
+checking for inet_ntop in -lnsl... no
+checking for inet_ntop in -lsocket... no
+checking for inet_ntop in -lws2_32... yes
+checking /proc/.../exe symbolic link... no - test not possible
+checking ssize_t... yes
+checking int8_t... yes
+checking int16_t... yes
+checking int32_t... yes
+checking uint8_t... yes
+checking uint16_t... yes
+checking uint32_t... yes
+checking dev_t... yes
+checking _dev_t... yes
+checking ino_t... yes
+checking _ino_t... yes
+checking ino64_t... no
+checking mode_t... yes
+checking nlink_t... no
+checking uid_t... no
+checking gid_t... no
+checking off_t... yes
+checking off64_t... yes
+checking blksize_t... no
+checking blkcnt_t... no
+checking fpos_t... yes
+checking blocksize and blockcount in stat output... no
+checking _fpos_t... no
+checking socklen_t... yes
+checking struct sockaddr_in... yes
+checking struct sockaddr_in6... yes
+checking struct sockaddr_un... no
+checking struct addrinfo... yes
+checking struct sockaddr_storage... yes
+checking IN_ADDR... yes
+checking IN6_ADDR... yes
+checking rand srand... yes
+checking initstate setstate random... yes
+checking lrand48 nrand48 seed48... yes
+checking size of off_t... 4
+checking size of ino_t... 2
+checking stdio.h usability... yes
+checking stdio.h presence... yes
+checking for stdio.h... yes
+checking conio.h usability... yes
+checking conio.h presence... yes
+checking for conio.h... yes
+checking grp.h usability... no
+checking grp.h presence... no
+checking for grp.h... no
+checking gdbm.h usability... no
+checking gdbm.h presence... no
+checking for gdbm.h... no
+checking ndbm.h usability... no
+checking ndbm.h presence... no
+checking for ndbm.h... no
+checking db.h usability... no
+checking db.h presence... no
+checking for db.h... no
+checking dir.h usability... yes
+checking dir.h presence... yes
+checking for dir.h... yes
+checking err.h usability... no
+checking err.h presence... no
+checking for err.h... no
+checking shadow.h usability... no
+checking shadow.h presence... no
+checking for shadow.h... no
+checking stropts.h usability... no
+checking stropts.h presence... no
+checking for stropts.h... no
+checking syslog.h usability... no
+checking syslog.h presence... no
+checking for syslog.h... no
+checking sysres.h usability... no
+checking sysres.h presence... no
+checking for sysres.h... no
+checking termios.h usability... no
+checking termios.h presence... no
+checking for termios.h... no
+checking vararg.h usability... no
+checking vararg.h presence... no
+checking for vararg.h... no
+checking varargs.h usability... no
+checking varargs.h presence... no
+checking for varargs.h... no
+checking ntifs.h usability... no
+checking ntifs.h presence... no
+checking for ntifs.h... no
+checking sys/file.h usability... yes
+checking sys/file.h presence... yes
+checking for sys/file.h... yes
+checking sys/resource.h usability... no
+checking sys/resource.h presence... no
+checking for sys/resource.h... no
+checking sys/statvfs.h usability... no
+checking sys/statvfs.h presence... no
+checking for sys/statvfs.h... no
+checking sys/stropts.h usability... no
+checking sys/stropts.h presence... no
+checking for sys/stropts.h... no
+checking sys/sunddi.h usability... no
+checking sys/sunddi.h presence... no
+checking for sys/sunddi.h... no
+checking sys/sysctl.h usability... no
+checking sys/sysctl.h presence... no
+checking for sys/sysctl.h... no
+checking sys/systeminfo.h usability... no
+checking sys/systeminfo.h presence... no
+checking for sys/systeminfo.h... no
+checking sys/termios.h usability... no
+checking sys/termios.h presence... no
+checking for sys/termios.h... no
+checking sys/ttold.h usability... no
+checking sys/ttold.h presence... no
+checking for sys/ttold.h... no
+checking sys/uio.h usability... no
+checking sys/uio.h presence... no
+checking for sys/uio.h... no
+checking sys/wait.h usability... no
+checking sys/wait.h presence... no
+checking for sys/wait.h... no
+checking for winbase.h... yes
+checking for winreg.h... yes
+checking for wincon.h... yes
+checking png.h usability... yes
+checking png.h presence... yes
+checking for png.h... yes
+checking jpeglib.h usability... yes
+checking jpeglib.h presence... yes
+checking for jpeglib.h... yes
+checking tiff.h usability... yes
+checking tiff.h presence... yes
+checking for tiff.h... yes
+checking mariadb/mysql.h usability... no
+checking mariadb/mysql.h presence... no
+checking for mariadb/mysql.h... no
+checking mysql/mysql.h usability... no
+checking mysql/mysql.h presence... no
+checking for mysql/mysql.h... no
+checking mysql.h usability... no
+checking mysql.h presence... no
+checking for mysql.h... no
+checking lprng.h usability... no
+checking lprng.h presence... no
+checking for lprng.h... no
+checking pthread.h usability... yes
+checking pthread.h presence... yes
+checking for pthread.h... yes
+checking for acosh in -lm... yes
+checking for acoshl in -lm... yes
+checking for acosl in -lm... yes
+checking for asinh in -lm... yes
+checking for asinhl in -lm... yes
+checking for asinl in -lm... yes
+checking for atan2 in -lm... yes
+checking for atan2l in -lm... yes
+checking for atanh in -lm... yes
+checking for atanhl in -lm... yes
+checking for atanl in -lm... yes
+checking for ceil in -lm... yes
+checking for ceill in -lm... yes
+checking for coshl in -lm... yes
+checking for cosl in -lm... yes
+checking for expl in -lm... yes
+checking for fabs in -lm... yes
+checking for fabsl in -lm... yes
+checking for floor in -lm... yes
+checking for floorl in -lm... yes
+checking for labs in -lm... yes
+checking for logl in -lm... yes
+checking for rint in -lm... yes
+checking for rintl in -lm... yes
+checking for sinhl in -lm... yes
+checking for sqrt in -lm... yes
+checking for sqrtl in -lm... yes
+checking for sinl in -lm... yes
+checking for tanhl in -lm... yes
+checking for tanl in -lm... yes
+checking for png_get_pixels_per_inch in -lpng... yes
+checking for getuid... no
+checking for setuid... no
+checking for setgid... no
+checking for chdir... yes
+checking for chmod... yes
+checking for chown... no
+checking for opendir... yes
+checking for readdir... yes
+checking for closedir... yes
+checking for getgrent... no
+checking for getgrgid... no
+checking for getgrnam... no
+checking for endgrent... no
+checking for setgrent... no
+checking for getpwuid... no
+checking for getpwnam... no
+checking for fopen... yes
+checking for fclose... yes
+checking for feof... yes
+checking for ferror... yes
+checking for fflush... yes
+checking for fread... yes
+checking for fwrite... yes
+checking for _fclose... no
+checking for _feof... no
+checking for _ferror... no
+checking for _fflush... no
+checking for _fopen... no
+checking for _fread... no
+checking for _fwrite... no
+checking for _getenv_s... no
+checking for _wgetenv... yes
+checking for _getpid... yes
+checking for fetestexcept... yes
+checking for _clearfp... yes
+checking for fork... no
+checking for getrlimit... no
+checking for setpgrp... no
+checking for setsid... no
+checking for syslog... no
+checking for gethostname... no
+checking for time... yes
+checking for localtime... yes
+checking for localtime_s... no
+checking for stat... yes
+checking for stat32... no
+checking for lstat32... no
+checking for _stat... yes
+checking for _stat32... no
+checking for _stat64... yes
+checking for _lstat... no
+checking for _lstat32... no
+checking for _lstat64... no
+checking for mpctl... no
+checking for sysconf... no
+checking for sysctl... no
+checking for popen... yes
+checking for _popen... yes
+checking for read... yes
+checking for write... yes
+checking for _read... yes
+checking for _write... yes
+checking for seed48... no
+checking for sprintf_s... yes
+checking for sscanf_s... yes
+checking for swscanf_s... yes
+checking for strcat... yes
+checking for strchr... yes
+checking for strcmp... yes
+checking for strcpy... yes
+checking for strdup... yes
+checking for strlen... yes
+checking for strncmp... yes
+checking for strncpy... yes
+checking for _strdup... yes
+checking for strncpy_s... yes
+checking for strrchr... yes
+checking for strtoimax... yes
+checking for strtol... yes
+checking for strtoll... yes
+checking for strtoul... yes
+checking for strtoull... yes
+checking for strtoumax... yes
+checking for wcsdup... yes
+checking for wcsncmp... yes
+checking for wcsncpy... yes
+checking for wcsncpy_s... yes
+checking for wcstoimax... yes
+checking for wcstol... yes
+checking for wcstoll... yes
+checking for wcstoul... yes
+checking for wcstoull... yes
+checking for wcstoumax... yes
+checking for _wcscat... no
+checking for _wcschr... no
+checking for _wcscpy... no
+checking for _wcsdup... yes
+checking for _wcslen... no
+checking for _wcsncmp... no
+checking for _wcsncpy... no
+checking for _wcsrchr... no
+checking for tcflush... no
+checking for tcgetattr... no
+checking for umask... yes
+checking for GetFinalPathNameByHandle... no
+checking wchar_t... yes
+checking mkdir path mode... no
+checking const... yes
+checking inline... yes
+checking __attribute__((unused))... yes
+checking fpclassify... yes
+checking for getpeername... no
+checking for getpeername in -lxnet... no
+checking for getpeername in -lnsl... no
+checking for getpeername in -lsocket... no
+checking for getpeername in -lws2_32... yes
+checking for getsockname... no
+checking for getsockname in -lxnet... no
+checking for getsockname in -lnsl... no
+checking for getsockname in -lsocket... no
+checking for getsockname in -lws2_32... yes
+checking for select... no
+checking for select in -lxnet... no
+checking for select in -lnsl... no
+checking for select in -lsocket... no
+checking for select in -lws2_32... yes
+checking for snmp_enable_filelog in -lnetsnmp... no
+checking for snmp_disable_syslog in -lnetsnmp... no
+checking for snmp_disable_stderrlog in -lnetsnmp... no
+checking for snmp_disable_filelog in -lnetsnmp... no
+checking IEEE 754 double... yes - test not possible
+checking qsort... yes
+checking bsearch... yes
+checking isgreater... yes
+checking isgreaterequal... yes
+checking isless... yes
+checking islessequal... yes
+checking isfinite... yes
+checking isnormal... yes
+checking _finite... yes
+checking setgroups... no
+checking initgroups... no
+checking assert... yes
+checking use of twos complement for negative integers... yes - test not possible
+checking manpage installation... yes
+configure: creating ./config.status
+config.status: creating Makefile
+config.status: creating scripts/wr-dk3inst.sh
+config.status: creating scripts/wr-dk4inst.sh
+config.status: creating scripts/create-desktop-files.sh
+config.status: creating scripts/build-help.sh
+config.status: creating initd-printqd
+config.status: creating initd-rshdown
+config.status: creating dktools.pc
+config.status: creating pkginfo
+config.status: creating debian/control
+config.status: creating debian/control9
+config.status: creating debian/control8
+config.status: creating config.h
+config.status: config.h is unchanged
+ERROR: Cross-compiling not supported!
+./scripts/wr-dk4inst.sh > dk4inst.c
+2019-10-15 13:53:05 Start scripts/create-desktop-files.sh
+2019-10-15 13:53:05 Finished scripts/create-desktop-files.sh
+
+Configuration summary
+=====================
+zlib: found.
+libbz2: found.
+libpng: found.
+libjpeg: found.
+libtiff: found.
+database: NOT found! Recommended.
+ Skipping printqd build!
+ SL 6.x package name: db4-devel
+ Debian package name: libdb-dev
+ URL: http://www.oracle.com/database/berkeley-db/
+MySQL: NOT found! Recommended.
+ Skipping itadmin build.
+ SL 6.x package name: mysql-devel
+ Debian package name: libmysqlclient-dev
+ URL: http://www.mysql.com/
+OpenSSL: found.
+wxWidgets: found.
+Install static libraries: yes
+Install shared libraries: no
+Nested shared library linking: no
+Binaries use shared libraries: no
+Build type: RELEASE
+
+The INSTALL files describes how to install via *.rpm or .deb package.
+
+CROSS-COMPILING
+Looks like you are preparing a cross-compliation.
+Some tests in this script are not suitable for cross-compiling
+as they require to run programs or scripts on the target system.
+You should check and probably correct
+- HAVE_TWOS_COMPLEMENT in config.h
+- HAVE_IEEE_754_DOUBLE in config.h
+- wxWidgets related items in config.h and Makefile
+On the build host run:
+ make dk3config dk4config
+When building for Windows, make the dk3config.exe and dk4config.exe files.
+Transfer the dk3config and dk4config programs (dk3config.exe and dk4config.exe
+for Windows) to the target system.
+On the target system run
+ dk3config > dk3conf.h
+ dk4config > dk4conf.h
+Transfer the dk3conf.h and dk4conf.h back to the build host and run
+ make
+ make DESTDIR=... install
+to build the software and create a package directory.
diff --git a/support/dktools/debian-jessie-build-deb.sh b/support/dktools/debian-build-deb.sh
index 056c075b34..fee0adcce3 100755
--- a/support/dktools/debian-jessie-build-deb.sh
+++ b/support/dktools/debian-build-deb.sh
@@ -4,6 +4,31 @@ umask 022
VERSION=`cat version.txt`
+DEBVMAJ=`cat /etc/debian_version | cut -f 1 -d .`
+case "X$DEBVMAJ" in
+"X8")
+ DEBVMAJ="jessie"
+ cp debian/control8 debian/control
+;;
+"X9")
+ DEBVMAJ="stretch"
+ cp debian/control9 debian/control
+;;
+"X10")
+ DEBVMAJ="buster"
+;;
+"X")
+ echo 'E: Not on a Debian system'
+ exit 1
+;;
+*)
+ echo 'E: Can not handle Debian major version' $DEBVMAJ
+ exit 1
+;;
+esac
+
+
+
# Make sure to run the script as unprivileged user
if [ "X$LOGNAME" = "Xroot" ]
@@ -49,14 +74,19 @@ then
exit 1
fi
+NP=`nproc`
+if [ "X" != "X$NP" -a "$NP" -gt 1 ]
+then
+ MAKEFLAGS="-j$NP"
+fi
# Build the package, save output for later inspection
if [ "X$DEB_SIGN_KEYID" != "X" ]
then
- dpkg-buildpackage 2>&1 | tee ../dpkg-buildpackage.out
+ dpkg-buildpackage $MAKEFLAGS 2>&1 | tee ../dpkg-buildpackage.out
else
- dpkg-buildpackage -us -uc 2>&1 | tee ../dpkg-buildpackage.out
+ dpkg-buildpackage -us -uc $MAKEFLAGS 2>&1 | tee ../dpkg-buildpackage.out
fi
# Finally list the created packages and show some notes
diff --git a/support/dktools/debian-build-dktoolian.sh b/support/dktools/debian-build-dktoolian.sh
new file mode 100755
index 0000000000..73aa8c9752
--- /dev/null
+++ b/support/dktools/debian-build-dktoolian.sh
@@ -0,0 +1,2 @@
+#! /bin/sh
+./mklivesys.sh dktoolian
diff --git a/support/dktools/debian-jessie-build-live.sh b/support/dktools/debian-jessie-build-live.sh
deleted file mode 100755
index 71ec977400..0000000000
--- a/support/dktools/debian-jessie-build-live.sh
+++ /dev/null
@@ -1,2037 +0,0 @@
-#! /bin/sh
-# Copyright (c) 2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of contributors may be
-# used to endorse or promote products derived from this software without
-# specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED.
-#
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-# ##### START OF CONFIGURATION SECTION #####
-#
-#
-
-# GUI or CLI live system.
-# -----------------------
-# Boolean flag, "yes" indicates a GUI live system, "no" a CLI live system.
-GUI="no"
-
-# Allow or deny installation of recommended packages
-# --------------------------------------------------
-# Boolean flag, "yes" or "no".
-# Only used if GUI=no. Recommended value: yes.
-APTRECOMMENDS="yes"
-
-# Flag: Allow to run "apt-get -y update && apt-get -y upgrade"
-# ------------------------------------------------------------
-# Set to "yes" or "no" to allow or deny a system upgrade before
-# building the live system.
-ALLOWUPGRADE="yes"
-
-# Flag: Allow installation of unsigned (self-made) packages
-# ---------------------------------------------------------
-# Set to "yes" or "no".
-# Only needed to install self-made package which are not signed.
-ALLOWUNSIGNEDPKG="no"
-
-# Flag: Allow to use firmware from "non-free" and "contrib".
-# ----------------------------------------------------------
-# Set to "yes" to place non-free firmware files in the live system,
-# "no" to build a live system without non-free firmware files.
-# Some components in computers (mostly WiFi chips, but some ethernet and other
-# chips too) require firmware files to work.
-# ----- Start of opinion section, no legal advice. -----
-# Unfortunately some firmware files are not available under a free license
-# allowing to distribute them together with GPL-licensed software.
-# If you configure the use of such non-free firmware files here, the resulting
-# live system may be undistributable (you can use it for your own purposes
-# but are not allowed to distribute it to other users).
-# ----- End of opinion section, no legal advice. -----
-# ----- Start of disclaimer -----
-# The section above is an opinion piece and does not contain legal advice.
-# You should consult a lawyer to obtain legal advice about the legal status
-# of distributing live systems containing non-free firmware files.
-# ----- End of disclaimer -----
-ALLOWNONFREE="no"
-
-# Live system type.
-# -----------------
-# One from:
-# hybrid for USB drives, CDROM or DVD
-# hdd for USB drives only
-# nfs for network boot DHCP/TFTP/NFS (requires NFSSERVER and NFSPATH).
-LIVETYPE="hybrid"
-
-# NFS server name for LIVETYPE=nfs.
-# ---------------------------------
-# Must be specified for LIVETYPE=nfs.
-# Recommendation: Use IP address.
-# NFSSERVER="nfs.my-domain.com"
-NFSSERVER=""
-
-# NFS root file system path for LIVETYPE=nfs.
-# -------------------------------------------
-# Must be specified for LIVETYPE=nfs.
-# NFSPATH="/opt/nfs/netboot"
-NFSPATH=""
-
-# Flag: Configuration done.
-# -------------------------
-# After adjusting the settings in this section, change this to "yes".
-CONFIGURED="no"
-
-# Directory for additional data
-# -----------------------------
-# Leave empty to use the default /usr/local/livesys directory.
-# Use
-# DATADIR="-"
-# to skip copying additional data into the live system.
-DATADIR=""
-
-# MIRRORS TO USE WHEN BUILDING AND RUNNING THE LIVE SYSTEM
-# ========================================================
-# Leave empty for automatic selection and/or defaults.
-
-# Mirror for bootstrapping
-# ------------------------
-# Default: http://ftp.de.debian.org/debian/
-# This is probably not a good choice for users from outside Europe.
-PARENTMIRRORBOOTSTRAP=""
-
-# Mirror used in the chroot stage
-# -------------------------------
-# Default: $PARENTMIRRORBOOTSTRAP
-PARENTMIRRORCHROOT=""
-
-# Mirror for security updates used in the chroot stage
-# ----------------------------------------------------
-# Default: http://security.debian.org/debian/
-PARENTMIRRORCHROOTSECURITY=""
-
-# Mirror for package updates used in the chroot stage
-# ---------------------------------------------------
-# Default: PARENTMIRRORCHROOT
-PARENTMIRRORCHROOTUPDATES=""
-
-# Mirror for backports used in the chroot stage.
-# ----------------------------------------------
-# Default: http://backports.debian.org/debian-backports/
-PARENTMIRRORCHROOTBACKPORTS=""
-
-# Mirror used by the live system
-# ------------------------------
-# Default: http://http.debian.net/debian/
-PARENTMIRRORBINARY=""
-
-# Mirror for security updates used by the live system
-# ---------------------------------------------------
-# Default: http://security.debian.org/
-PARENTMIRRORBINARYSECURITY=""
-
-# Mirror for packages updates used by the live system
-# ---------------------------------------------------
-# Default: PARENTMIRRORBINARY
-PARENTMIRRORBINARYUPDATES=""
-
-# Mirror for backports used by the live system
-# --------------------------------------------
-# Default: http://backports.debian.org/debian-backports/
-PARENTMIRRORBINARYBACKPORTS=""
-
-# Mirror to fetch Debian installer images from
-# --------------------------------------------
-# Default: PARENTMIRRORBOOTSTRAP
-PARENTMIRRORDEBIANINSTALLER=""
-
-# Mirror used to bootstrap the derivative from
-# --------------------------------------------
-# Default: http://ftp.de.debian.org/debian/
-MIRRORBOOTSTRAP=""
-
-# Mirror used in the chroot stage to build the derivative
-# -------------------------------------------------------
-# Default: MIRRORBOOTSTRAP
-MIRRORCHROOT=""
-
-# Mirror for security updates used in the chroot stage to build the derivative
-# ----------------------------------------------------------------------------
-# Default: http://security.debian.org/debian/
-MIRRORCHROOTSECURITY=""
-
-# Mirror for package updates used in the chroot stage to build the derivative
-# ---------------------------------------------------------------------------
-# Default: MIRRORCHROOT
-MIRRORCHROOTUPDATES=""
-
-# Mirror for backports used in the chroot stage to build the derivative
-# ---------------------------------------------------------------------
-# Default: http://backports.debian.org/debian-backports/
-MIRRORCHROOTBACKPORTS=""
-
-# Derivative package mirror used by the live system
-# -------------------------------------------------
-MIRRORBINARY=""
-
-# Derivatives security package mirror used by the live system
-# -----------------------------------------------------------
-MIRRORBINARYSECURITY=""
-
-# Derivatives update package mirror used by the live system
-# ---------------------------------------------------------
-MIRRORBINARYUPDATES=""
-
-# Derivatives backports package mirror used by the live system
-# ------------------------------------------------------------
-MIRRORBINARYBACKPORTS=""
-
-# Derivatives mirror used to fetch Debian installer images
-# --------------------------------------------------------
-# Default: $MIRRORBOOTSTRAP
-MIRRORDEBIANINSTALLER=""
-
-
-
-# Short language setting.
-# -----------------------
-# Short language definition, i.e. "en", "de", ...
-# Leave empty for automatic selection (language currently used).
-LANGSHORT=""
-
-# Full locale setting.
-# --------------------
-# Full language definition including region and encoding, i.e.
-# "en_US.utf8", "de_DE.utf8" ...
-# Leave empty for automatic selection (language currently used).
-LANGFULL=""
-
-# List of locales to append to kernel parameters.
-# -----------------------------------------------
-# Full language definition including region and encoding, i.e.
-# "en_US.utf8", "de_DE.utf8" ...
-# Leave empty for automatic selection (language currently used).
-# Set
-# LIVEAPPENDLOCALES="-"
-# to avoid appending locales.
-LIVEAPPENDLOCALES=""
-
-# Timezone to append to kernel parameters.
-# ----------------------------------------
-# Specify a continent/city combination, i.e. "Europe/Berlin"...
-# Leave empty for automatic selection (currently used timezone).
-# Set
-# LIVEAPPENDTIMEZONE="-"
-# to avoid appending a timezone
-LIVEAPPENDTIMEZONE=""
-
-# List of keyboard layouts to append to kernel parameters.
-# --------------------------------------------------------
-# Leave empty for automatic selection (short language name).
-# Set
-# LIVEAPPENDKBDLAYOUTS="-"
-# to avoid appending keyboard layouts
-LIVEAPPENDKBDLAYOUTS=""
-
-# VGA mode to append to kernel parameters.
-# ----------------------------------------
-# Only used for CLI live systems, ignored if GUI=yes.
-# Set to empty string to append no VGA setting and let the system choose one.
-# Use LIVEAPPENDVGA="0x0F00" to stay at 25 lines x 80 columns.
-# LIVEAPPENDVGA=""
-LIVEAPPENDVGA="0x0F00"
-
-# IP settings to append to kernel parameters.
-# -------------------------------------------
-# Arguments for ip=... kernel parameter.
-# Leave empty to omit the kernel parameter.
-# Normally DHCP is enabled by default (without the kernel parameter).
-# For nfsroot images DHCP is disabled by default, so you should enable
-# it here.
-#
-# Either device:address:netmask:gateway:nameserver:
-# LIVEAPPENDIP="eth0:192.0.2.42:255.255.255.0:192.0.2.1:192.0.2.50"
-# Or one from the methods below:
-# Use DHCP protocol
-# LIVEAPPENDIP="dhcp"
-# Use older BOOTP protocol
-# LIVEAPPENDIP="bootp"
-# Use older RARP protocol
-# LIVEAPPENDIP="rarp"
-# Use all three: DHCP, BOOTP, RARP
-# LIVEAPPENDIP="on"
-# LIVEAPPENDIP="any"
-# Not documented
-# LIVEAPPENDIP="both"
-# Inspect the live systems /etc/network/interfaces file
-# LIVEAPPENDIP="frommedia"
-# Disable networking (use neither DHCP, BOOTP or RARP)
-# LIVEAPPENDIP="none"
-# LIVEAPPENDIP="off"
-LIVEAPPENDIP=""
-
-# Keyboard mapping to use when booting a command line (non-GUI) live system.
-# --------------------------------------------------------------------------
-# Keyboard mapping file in subdirectories of the /usr/share/keymaps directory.
-# The keymaps are in the console-data package.
-# Run commands like:
-# for i in `find /usr/share/keymaps -name '*.kmap.gz'`
-# do
-# echo '#####' $i
-# gzip -dc $i | grep '^#'
-# echo ''
-# done
-# to see comments from the available map files.
-# Leave empty for automatic selection (depending on language).
-# NOTE: Automatic selection means guessing.
-# Set
-# CONSKEYMAP="-"
-# to avoid loading a keyboard mapping.
-CONSKEYMAP=""
-
-# NTP server to query during boot process.
-# ----------------------------------------
-# Host name or IP address of NTP server to query during boot.
-# Leave empty to omit the query.
-# If USENTPDAEMON="yes", the server is queried periodically by ntpd instead
-# of running ntpdate once at boot.
-NTPSERVER=""
-
-# Use NTP daemon.
-# ---------------
-# Boolean flag, "yes" or "no".
-USENTPDAEMON="no"
-
-# Beep when boot menu is shown.
-# -----------------------------
-# Boolean flag, use "yes" to make the boot menu beep.
-# The beep might inform visually impaired or blind people about the presence
-# of the boot menu, so they can append kernel options for screen readers...
-# When restoring one PC in a computer class while a lecture is in progress,
-# any noise disturbs.
-BOOTMENUBEEP="yes"
-
-# Live system publisher name.
-# ---------------------------
-# Use your full name here.
-# PUBLISHER="John Smith"
-PUBLISHER=""
-
-#
-#
-# ##### END OF CONFIGURATION SECTION #####
-
-
-
-# There should be no need to apply changes below this line!
-
-
-
-# ##### Automatically complete setup
-#
-#
-
-EXVAL="0"
-
-if [ "X$LANGSHORT" = "X" ]
-then
- LANGSHORT=`echo $LANG | cut -f 1 -d '.' | cut -f 1 -d _`
-fi
-if [ "X$LANGFULL" = "X" ]
-then
- LANGFULL=`grep "^LANG=" /etc/default/locale | cut -f 2 -d '"'`
-fi
-if [ "X$LANGFULL" = "X" ]
-then
- LANGFULL="$LANG"
-fi
-if [ "X$LIVEAPPENDLOCALES" = "X" -a "X$LANGFULL" != "X" ]
-then
- echo sed change UTF-8 encoding
- LIVEAPPENDLOCALES=`echo $LANGFULL | sed -e 's/UTF\-8/utf8/g'`
-fi
-if [ "X$LIVEAPPENDKBDLAYOUTS" = "X" -a "X$LANGSHORT" != "X" ]
-then
- LIVEAPPENDKBDLAYOUTS="$LANGSHORT"
-fi
-if [ "X$LIVEAPPENDTIMEZONE" = "X" -a -f /etc/timezone ]
-then
- LIVEAPPENDTIMEZONE=`cat /etc/timezone`
-fi
-LANGREG=`echo $LANGFULL | cut -f 1 -d .`
-if [ "X$PUBLISHER" = "X" ]
-then
- PUBLISHER=`getent passwd | grep "^${LOGNAME}:" | cut -f 5 -d :`
-fi
-if [ "X$PUBLISHER" = "X" ]
-then
- PUBLISHER="An Unknown Live System Creator"
-fi
-if [ "X$DATADIR" = "X" ]
-then
- DATADIR="/usr/local/livesys"
-fi
-[ "X$LIVETYPE" != "X" ] || LIVETYPE="hybrid"
-if [ "X$APTRECOMMENDS" != "Xyes" -a "X$APTRECOMMENDS" != "Xno" ]
-then
- APTRECOMMENDS="yes"
-fi
-
-
-# ----- Start of console keymapping subsection
-#
-#
-
-# Guess console keymap from language.
-# The _last_ line in each branch wins.
-# So change line order within branches to change priority.
-
-# This subsection may need correction, as I only know about keyboards
-# for german language.
-
-if [ "X$CONSKEYMAP" = "X" ]
-then
- case "X$LANGSHORT" in
- "Xar")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ar.kmap.gz"
- ;;
- "Xbe")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/by.kmap.gz"
- ;;
- "Xbg")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/bg-cp1251.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/bg.kmap.gz"
- ;;
- "Xbr")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/br-abnt2.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/br-latin1.kmap.gz"
- ;;
- "Xcs")
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-cz-us.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-us-cz.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/cz-us-qwertz.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/cz-us-qwerty.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/cz-lat2-prog.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/cz-lat2.kmap.gz"
- ;;
- "Xda")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-dk-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/dk-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/dk.kmap.gz"
- ;;
- "Xde")
- CONSKEYMAP="/usr/share/keymaps/atari/atari-de-deadkeys.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/atari/atari-de.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/amiga/amiga-de.kmap.gz"
- [ "X$LANGREG" != "Xde_CH" ] || CONSKEYMAP="/usr/share/keymaps/amiga/amiga-sg.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-de-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-de.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-de-latin1-nodeadkeys.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-de-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-ibook-de.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-ibook-de-deadkeys.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-macbook-de.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-de2-ext.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-de-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-de-latin1-nodeadkeys.kmap.gz"
- [ "X$LANGREG" != "Xde_CH" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-de_CH.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/de.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/de-latin1-nodeadkeys.kmap.gz"
- ;;
- "Xen")
- [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/atari/atari-us-deadkeys.kmap.gz"
- [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/atari/atari-us.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/atari/atari-uk-deadkeys.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/atari/atari-uk.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/amiga/amiga-us.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/sun/sunt5-uk.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/sun/sunt6-uk.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-uk.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/mac/mac-uk.kmap.gz"
- [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/mac/mac-us-ext.kmap.gz"
- [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/mac/mac-us-std.kmap.gz"
- [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/mac/mac-us.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-uk.kmap.gz"
- [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-us.kmap.gz"
- [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/us-intl.iso01.kmap.gz"
- [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/us-intl.iso15.kmap.gz"
- [ "X$LANGREG" != "Xen_CA" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/us-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/us.kmap.gz"
- [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/uk.kmap.gz"
- [ "X$LANGREG" != "Xen_CA" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ca-multi.kmap.gz"
- ;;
- "Xel")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/gr-pc.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/gr-utf8.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/gr.kmap.gz"
- ;;
- "Xes")
- CONSKEYMAP="/usr/share/keymaps/amiga/amiga-es.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sunt4-es.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-es.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-es.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-es.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/es.kmap.gz"
- ;;
- "Xet")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/et.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/et-nodeadkeys.kmap.gz"
- ;;
- "Xfa")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ar.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/fa.kmap.gz"
- ;;
- "Xfi")
- CONSKEYMAP="/usr/share/keymaps/sun/sunt4-fi-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-fi-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-fi-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-fi-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/fi-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-fi-lat6.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-fi-ir209.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/fi.kmap.gz"
- ;;
- "Xfr")
- CONSKEYMAP="/usr/share/keymaps/atari/atari-fr.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/amiga/amiga-fr.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-fr-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-fr-bepo-utf8.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-fr-bepo.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-fr.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-macbook-fr.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/mac-usb-fr.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-fr-ext.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-fr.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-fr2-ext.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-fr3.kmap.gz"
- [ "X$LANGREG" != "Xfr_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/mac-usb-be.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-pc.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-latin0.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-latin9.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-x11.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr.kmap.gz"
- [ "X$LANGREG" != "Xfr_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/wangbe.kmap.gz"
- [ "X$LANGREG" != "Xfr_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/be-latin1.kmap.gz"
- [ "X$LANGREG" != "Xfr_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/be2-latin1.kmap.gz"
- [ "X$LANGREG" != "Xfr_CH" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-fr_CH-latin1.kmap.gz"
- [ "X$LANGREG" != "Xfr_CH" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwertz/fr_CH-latin1.kmap.gz"
- [ "X$LANGREG" != "Xfr_CH" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwertz/fr_CH.kmap.gz"
- [ "X$LANGREG" != "Xfr_CA" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/cf.kmap.gz"
- [ "X$LANGREG" != "Xfr_CA" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ca-multi.kmap.gz"
- ;;
- "Xhe")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/hebrew.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/il-heb.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/il.kmap.gz"
- ;;
- "Xhr")
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/croat.kmap.gz"
- ;;
- "Xhu")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/hu101.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/hu.kmap.gz"
- ;;
- "Xis")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/is-latin1-us.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/is-latin1.kmap.gz"
- ;;
- "Xit")
- CONSKEYMAP="/usr/share/keymaps/amiga/amiga-it.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/ibook-it.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-it.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/mac-usb-it.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/it-ibm.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/it.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/it2.kmap.gz"
- ;;
- "Xja")
- CONSKEYMAP="/usr/share/keymaps/sun/sunt4-ja.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-ja.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pc110.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/jp106.kmap.gz"
- ;;
- "Xkk")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/kk.kmap.gz"
- ;;
- "Xky")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/kg.kmap.gz"
- ;;
- "Xla")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/la-latin1.kmap.gz"
- ;;
- "Xlt")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/lt.l4.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/lt.kmap.gz"
- ;;
- "Xlv")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/lv-latin4.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/lv-latin7.kmap.gz"
- ;;
- "Xmk")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mk.kmap.gz"
- ;;
- "Xnl")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/nl.kmap.gz"
- [ "X$LANGREG" != "Xnl_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/mac-usb-be.kmap.gz"
- [ "X$LANGREG" != "Xnl_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/wangbe.kmap.gz"
- [ "X$LANGREG" != "Xnl_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/be-latin1.kmap.gz"
- [ "X$LANGREG" != "Xnl_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/be2-latin1.kmap.gz"
- ;;
- "Xno")
- CONSKEYMAP="/usr/share/keymaps/sun/sunt4-no-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-no.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/no.kmap.gz"
- ;;
- "Xpl")
- CONSKEYMAP="/usr/share/keymaps/sun/sun-pl.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/sun/sun-pl-altgraph.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-pl_m-ext1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/pl-qwertz.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pl.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pl1.kmap.gz"
- ;;
- "Xpt")
- CONSKEYMAP="/usr/share/keymaps/mac/mac-pt-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-pt-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pt-old.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pt-latin1.kmap.gz"
- ;;
- "Xro")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ro-comma.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ro-academic.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ro.kmap.gz"
- ;;
- "Xru")
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-ru.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-ru.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru_win.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru-yawerty.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru-ms.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru-cp1251.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru2.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru3.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru4.kmap.gz"
- ;;
- "Xse")
- CONSKEYMAP="/usr/share/keymaps/atari/atari-se.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/atari/atari-se-deadkeys.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/amiga/amiga-se.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/mac/mac-se.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-se.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-ir209.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-fi-lat6.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-fi-ir209.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-lat6.kmap.gz"
- ;;
- "Xsg")
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sg-latin1.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sg.kmap.gz"
- ;;
- "Xsk")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sk-prog.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sk-prog-qwerty.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sk-prog-qwertz.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sk-qwerty.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sk-qwertz.kmap.gz"
- ;;
- "Xsl")
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/slovene.kmap.gz"
- ;;
- "Xsr")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sr-cy.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sr.kmap.gz"
- ;;
- "Xth")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/th-tis.kmap.gz"
- ;;
- "Xtr")
- CONSKEYMAP="/usr/share/keymaps/sun/sunt5-trqalt.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/tr_q-latin5.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/tralt.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/trq.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/fgGIod/trfu.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/fgGIod/tr_f-latin5.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/fgGIod/trf.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/trqu.kmap.gz"
- ;;
- "Xuk")
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ua.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/uaw_uni.kmap.gz"
- CONSKEYMAP="/usr/share/keymaps/i386/qwerty/uaw.kmap.gz"
- ;;
- "Xwo")
- CONSKEYMAP="/usr/share/keymaps/i386/azerty/wo.kmap.gz"
- ;;
- esac
-fi
-
-#
-#
-# ----- Start of console keymapping subsection
-
-
-
-# Check whether setup is completed.
-# ---------------------------------
-if [ "X$CONFIGURED" = "Xno" ]
-then
- echo 'ERROR: Script not configured yet!'
- echo 'Please edit the scripts configuration section.'
- echo 'The section is located at start of file, below the copyright notice.'
- exit 1
-fi
-
-
-# Check for root privileges
-# -------------------------
-if [ "X$LOGNAME" != "Xroot" ]
-then
- echo 'ERROR: Root privileges required!'
- echo 'Please run this script as user root only.'
- exit 1
-fi
-
-
-# Save current working directory.
-DIR=`pwd`
-if [ "X$DIR" = "X" ]
-then
- echo 'ERROR: Failed to find current directory name!'
- exit 1
-fi
-
-
-echo Start
-date
-
-# Inherited umask may be wrong.
-umask 022
-
-# Build live system on up-to-date host.
-if [ "X$ALLOWUPGRADE" = "Xyes" ]
-then
- apt-get -y update && apt-get -y upgrade
-fi
-
-# Make sure to have all required packages for build and live build.
-apt-get install `sed -e 's/[ \t]*#.*$//g' livesys-data/pkg_local.txt`
-
-
-# Create live system directory.
-[ ! -d livesys ] || rm -fr livesys
-mkdir -p livesys
-chmod 755 livesys
-
-# Configure and build the software, do not install yet.
-./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-shared --disable-static --enable-packaging --with-suite=rescue --with-man=yes
-make
-
-OPTCONF=""
-
-if [ "X$LIVETYPE" = "Xnfs" -a "X$NFSSERVER" != "X" -a "X$NFSPATH" != "X" ]
-then
- OPTCONF="$OPTCONF -b netboot"
- OPTCONF="$OPTCONF --net-root-server $NFSSERVER"
- OPTCONF="$OPTCONF --net-root-path $NFSPATH"
-elif [ "X$LIVETYPE" = "Xhdd" ]
-then
- OPTCONF="$OPTCONF -b hdd"
-elif [ "X$LIVETYPE" = "Xnfs" ]
-then
- echo 'ERROR: Missing NFSSERVER and/or NFSPATH configuration!'
- exit 1
-fi
-
-
-# No apt index files in live system to save disk space
-OPTCONF="$OPTCONF --apt-indices false"
-
-# Avoid installation of recommended packages to save disk space
-if [ "X$GUI" != "Xyes" -a "X$APTRECOMMENDS" != "Xyes" ]
-then
- OPTCONF="$OPTCONF --apt-recommends false"
-fi
-
-# Minimum base bootstrap
-OPTCONF="$OPTCONF --debootstrap-options --variant=minbase"
-
-# Include firmware into live system
-# It depends on the ALLOWNONFREE setting whether or not non-free firmware
-# is added to the live system:
-# no: Only free firmware files are used.
-# yes: Free and non-free firmware files are used.
-OPTCONF="$OPTCONF --firmware-chroot true"
-
-# No firmware in the binary stage, the live system does not contain installers.
-OPTCONF="$OPTCONF --firmware-binary false"
-
-# No memory test program in live system
-OPTCONF="$OPTCONF --memtest none"
-
-# Do not required valid signatures
-if [ "X$ALLOWUNSIGNEDPKG" = "Xyes" ]
-then
- OPTCONF="$OPTCONF --apt-secure false"
-fi
-
-if [ "X$PARENTMIRRORBOOTSTRAP" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-bootstrap $PARENTMIRRORBOOTSTRAP"
-fi
-
-if [ "X$PARENTMIRRORCHROOT" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-chroot $PARENTMIRRORCHROOT"
-fi
-
-if [ "X$PARENTMIRRORCHROOTSECURITY" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-chroot-security $PARENTMIRRORCHROOTSECURITY"
-fi
-
-if [ "X$PARENTMIRRORCHROOTUPDATES" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-chroot-updates $PARENTMIRRORCHROOTUPDATES"
-fi
-
-if [ "X$PARENTMIRRORCHROOTBACKPORTS" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-chroot-backports $PARENTMIRRORCHROOTBACKPORTS"
-fi
-
-if [ "X$PARENTMIRRORBINARY" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-binary $PARENTMIRRORBINARY"
-fi
-
-if [ "X$PARENTMIRRORBINARYSECURITY" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-binary-security $PARENTMIRRORBINARYSECURITY"
-fi
-
-if [ "X$PARENTMIRRORBINARYUPDATES" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-binary-updates $PARENTMIRRORBINARYUPDATES"
-fi
-
-if [ "X$PARENTMIRRORBINARYBACKPORTS" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-binary-backports $PARENTMIRRORBINARYBACKPORTS"
-fi
-
-if [ "X$PARENTMIRRORDEBIANINSTALLER" != "X" ]
-then
- OPTCONF="$OPTCONF --parent-mirror-debian-installer $PARENTMIRRORDEBIANINSTALLER"
-fi
-
-if [ "X$MIRRORBOOTSTRAP" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-bootstrap $MIRRORBOOTSTRAP"
-fi
-
-if [ "X$MIRRORCHROOT" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-chroot $MIRRORCHROOT"
-fi
-
-if [ "X$MIRRORCHROOTSECURITY" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-chroot-security $MIRRORCHROOTSECURITY"
-fi
-
-if [ "X$MIRRORCHROOTUPDATES" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-chroot-updates $MIRRORCHROOTUPDATES"
-fi
-
-if [ "X$MIRRORCHROOTBACKPORTS" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-chroot-backports $MIRRORCHROOTBACKPORTS"
-fi
-
-if [ "X$MIRRORBINARY" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-binary $MIRRORBINARY"
-fi
-
-if [ "X$MIRRORBINARYSECURITY" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-binary-security $MIRRORBINARYSECURITY"
-fi
-
-if [ "X$MIRRORBINARYUPDATES" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-binary-updates $MIRRORBINARYUPDATES"
-fi
-
-if [ "X$MIRRORBINARYBACKPORTS" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-binary-backports $MIRRORBINARYBACKPORTS"
-fi
-
-if [ "X$MIRRORDEBIANINSTALLER" != "X" ]
-then
- OPTCONF="$OPTCONF --mirror-debian-installer $MIRRORDEBIANINSTALLER"
-fi
-
-# Live system requires configuration
-OPTLIVEAPPEND="boot=live components live-config.utc=no"
-
-# Add configuration hints
-if [ "X$LIVEAPPENDLOCALES" != "X" -a "X$LIVEAPPENDLOCALES" != "X-" ]
-then
- OPTLIVEAPPEND="$OPTLIVEAPPEND live-config.locales=$LIVEAPPENDLOCALES locales=$LIVEAPPENDLOCALES"
-fi
-if [ "X$LIVEAPPENDKBDLAYOUTS" != "X" -a "X$LIVEAPPENDKBDLAYOUTS" != "X-" ]
-then
- OPTLIVEAPPEND="$OPTLIVEAPPEND live-config.keyboard-layouts=$LIVEAPPENDKBDLAYOUTS"
-fi
-if [ "X$LIVEAPPENDTIMEZONE" != "X" -a "X$LIVEAPPENDTIMEZONE" != "X-" ]
-then
- OPTLIVEAPPEND="$OPTLIVEAPPEND live-config.timezone=$LIVEAPPENDTIMEZONE"
-fi
-if [ "X$LIVEAPPENDVGA" != "X" -a "X$GUI" != "Xyes" ]
-then
- OPTLIVEAPPEND="$OPTLIVEAPPEND nomodeset vga=$LIVEAPPENDVGA"
-fi
-if [ "X$LIVEAPPENDIP" != "X" ]
-then
- OPTLIVEAPPEND="$OPTLIVEAPPEND ip=$LIVEAPPENDIP"
-fi
-if [ "X$LIVETYPE" = "Xnfs" ]
-then
- OPTLIVEAPPEND="$OPTLIVEAPPEND netboot=nfs nfsroot=${NFSSERVER}:${NFSPATH}"
-fi
-
-[ "X$PUBLISHER" != "X" ] || PUBLISHER="An Unknown Live System Builder"
-PKGLOC=""
-
-cd livesys
- lb init
- if [ "X$ALLOWNONFREE" = "Xyes" -a "X$ALLOWUNSIGNEDPKG" = "Xyes" ]
- then
- lb config \
- $OPTCONF \
- --archive-areas "main contrib non-free" \
- --apt-options "--yes --allow-unauthenticated" \
- --iso-publisher "$PUBLISHER" \
- --iso-volume DKTOOLIAN \
- --bootappend-live "$OPTLIVEAPPEND"
- elif [ "X$ALLOWNONFREE" = "Xyes" ]
- then
- lb config \
- $OPTCONF \
- --archive-areas "main contrib non-free" \
- --apt-options "--yes" \
- --iso-publisher "$PUBLISHER" \
- --iso-volume DKTOOLIAN \
- --bootappend-live "$OPTLIVEAPPEND"
- elif [ "X$ALLOWUNSIGNEDPKG" = "Xyes" ]
- then
- lb config \
- $OPTCONF \
- --apt-options "--yes --allow-unauthenticated" \
- --iso-publisher "$PUBLISHER" \
- --iso-volume DKTOOLIAN \
- --bootappend-live "$OPTLIVEAPPEND"
- else
- lb config \
- $OPTCONF \
- --apt-options "--yes" \
- --iso-publisher "$PUBLISHER" \
- --iso-volume DKTOOLIAN \
- --bootappend-live "$OPTLIVEAPPEND"
- fi
- echo sed remove comments
- if [ ! -d config/archives ]
- then
- mkdir -p config/archives
- chmod 755 config/archives
- fi
- if [ ! -d config/includes.chroot ]
- then
- mkdir -p config/includes.chroot
- chmod 755 config/includes.chroot
- fi
- if [ ! -d config/includes.chroot/usr/share/doc/dktools ]
- then
- mkdir -p config/includes.chroot/usr/share/doc/dktools
- chmod 755 config/includes.chroot/usr/share/doc/dktools
- fi
- if [ ! -d config/includes.chroot/etc/apt ]
- then
- mkdir -p config/includes.chroot/etc/apt
- chmod 755 config/includes.chroot/etc/apt
- fi
- for i in README LICENSE bsdlic.txt version.txt
- do
- cp ../$i config/includes.chroot/usr/share/doc/dktools/$i
- chmod 644 config/includes.chroot/usr/share/doc/dktools/$i
- done
- cp ../debian/copyright config/includes.chroot/usr/share/doc/copyright
- chmod 644 config/includes.chroot/usr/share/doc/copyright
- # cp ../livesys-data/apt-pinning.txt config/archives/apt-pinning.pref.chroot
- cp ../livesys-data/apt-pinning.txt config/includes.chroot/etc/apt/preferences
- if [ "X$ALLOWNONFREE" = "Xyes" ]
- then
- sed -e 's/[ \t]*#.*$//g' < ../livesys-data/pkg_firmware.txt >> config/package-lists/dktoolian.list.chroot
- fi
- echo sed remove comments
- sed -e 's/[ \t]*#.*$//g' < ../livesys-data/pkg_base.txt >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo sed remove comments
- sed -e 's/[ \t]*#.*$//g' < ../livesys-data/pkg_xfce.txt >> config/package-lists/dktoolian.list.chroot
- fi
- if [ "X$NTPSERVER" != "X" -a "X$USENTPDAEMON" = "Xyes" ]
- then
- echo ntp >> config/package-lists/dktoolian.list.chroot
- else
- echo ntpdate >> config/package-lists/dktoolian.list.chroot
- fi
- case "X$LANGSHORT" in
- "Xaf")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-af" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xam")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-amharic"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="$PKGLOC task-amharic-desktop"
- fi
- ;;
- "Xan")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-an" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xar")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-arabic"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-arabic task-arabic-desktop"
- echo "iceweasel-l10n-ar" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xast")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-asturian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-asturian task-asturian-desktop"
- echo "iceweasel-l10n-ast" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xaz")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-az" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xbe")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-belarusian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-belarusian task-belarusian-desktop"
- echo "iceweasel-l10n-be" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xbg")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-bulgarian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-bulgarian task-bulgarian-desktop"
- echo "iceweasel-l10n-bg" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xbn")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-bengali"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-bengali task-bengali-desktop"
- if [ "X$LANGREG" = "Xbn_BD" ]
- then
- echo "iceweasel-l10n-bn-bd" >> config/package-lists/dktoolian.list.chroot
- else
- echo "iceweasel-l10n-bn-in" >> config/package-lists/dktoolian.list.chroot
- fi
- fi
- ;;
- "Xbr")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-br" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xbs")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-bosnian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-bosnian task-bosnian-desktop"
- echo "iceweasel-l10n-bs" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xca")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-catalan"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-catalan task-catalan-desktop"
- echo "iceweasel-l10n-ca" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xcs")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-czech"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-czech task-czech-desktop"
- echo "iceweasel-l10n-cs" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xcy")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-welsh"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-welsh task-welsh-desktop"
- echo "iceweasel-l10n-cy" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xda")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-danish"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-danish task-danish-desktop"
- echo "iceweasel-l10n-da" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xde")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-german"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-german task-german-desktop"
- echo "iceweasel-l10n-de" >> config/package-lists/dktoolian.list.chroot
- fi
- if [ "X$GUI" = "Xyes" -a "X$LANGREG" = "Xde_DE" ]
- then
- echo "iceweasel-l10n-dsb" >> config/package-lists/dktoolian.list.chroot
- echo "iceweasel-l10n-hsb" >> config/package-lists/dktoolian.list.chroot
- fi
- if [ "X$GUI" = "Xyes" -a "X$LANGREG" = "Xde_CH" ]
- then
- echo "iceweasel-l10n-rm" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xdz")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-dzongkha"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-dzongkha task-dzongkha-desktop"
- fi
- ;;
- "Xel")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-greek"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-greek task-greek-desktop"
- echo "iceweasel-l10n-el" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xen")
- echo "locales" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-english"
- if [ "X$GUI" = "Xyes" -a "X$LANGREN" = "Xen_GB" ]
- then
- PKGLOC="task-english task-british-desktop"
- echo "iceweasel-l10n-en-gb" >> config/package-lists/dktoolian.list.chroot
- echo "iceweasel-l10n-gd" >> config/package-lists/dktoolian.list.chroot
- elif [ "X$GUI" = "Xyes" -a "X$LANGREN" = "Xen_ZA" ]
- then
- PKGLOC="task-english task-south-african-english-desktop"
- echo "iceweasel-l10n-en-za" >> config/package-lists/dktoolian.list.chroot
- echo "iceweasel-l10n-af" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xeo")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-esperanto"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-esperanto task-esperanto-desktop"
- echo "iceweasel-l10n-eo" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xes")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-spanish"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-spanish task-spanish-desktop"
- fi
- if [ "X$GUI" = "Xyes" -a "X$LANGREG" = "Xes_AR" ]
- then
- echo "iceweasel-l10n-es-ar" >> config/package-lists/dktoolian.list.chroot
- elif [ "X$GUI" = "Xyes" -a "X$LANGREG" = "Xes_CL" ]
- then
- echo "iceweasel-l10n-es-cl" >> config/package-lists/dktoolian.list.chroot
- elif [ "X$GUI" = "Xyes" -a "X$LANGREG" = "Xes_MX" ]
- then
- echo "iceweasel-l10n-es-mx" >> config/package-lists/dktoolian.list.chroot
- else
- echo "iceweasel-l10n-es-es" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xet")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-estonian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-estonian task-estonian-desktop"
- echo "iceweasel-l10n-et" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xeu")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-basque"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-basque task-basque-desktop"
- echo "iceweasel-l10n-eu" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfa")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-persian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-persian task-persian-desktop"
- echo "iceweasel-l10n-fa" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xff")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-ff" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfi")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-finnish"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-finnish task-finnish-desktop"
- echo "iceweasel-l10n-fi" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfr")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-french"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-french task-french-desktop"
- echo "iceweasel-l10n-fr" >> config/package-lists/dktoolian.list.chroot
- fi
- if [ "X$GUI" = "Xyes" -a "X$LANGREG" = "Xfr_CH" ]
- then
- echo "iceweasel-l10n-rm" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfub")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-ff" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfue")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-ff" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfuh")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-ff" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfui")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-ff" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfuq")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-ff" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfuv")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-ff" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xfy")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-fy-nl" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xga")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-irish"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-irish task-irish-desktop"
- echo "iceweasel-l10n-ga-ie" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xgl")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-galician"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-galician task-galician-desktop"
- echo "iceweasel-l10n-gl" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xgu")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-gujarati"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-gujarati task-gujarati-desktop"
- echo "iceweasel-l10n-gu-in" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xhe")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-hebrew"
- if [ "X$GUI" = "Xyes" ]
- then
- echo "task-hebrew-desktop" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-hebrew task-hebrew-desktop"
- echo "iceweasel-l10n-he" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xhi")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-hindi"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-hindi task-hindi-desktop"
- echo "iceweasel-l10n-hi-in" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xhr")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-croatian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-croatian task-croatian-desktop"
- echo "iceweasel-l10n-hr" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xhu")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-hungarian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-hungarian task-hungarian-desktop"
- echo "iceweasel-l10n-hu" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xhy")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-hy-am" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xid")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-indonesian-desktop"
- echo "iceweasel-l10n-id" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xis")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-icelandic"
- if [ "X$GUI" = "Xyes" ]
- then
- echo "task-icelandic-desktop" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-icelandic task-icelandic-desktop"
- echo "iceweasel-l10n-is" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xit")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-italian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-italian task-italian-desktop"
- echo "iceweasel-l10n-it" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xja")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-japanese"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-japanese task-japanese-desktop"
- echo "iceweasel-l10n-ja" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xka")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-cyrillic"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-cyrillic task-cyrillic-desktop task-georgian-desktop"
- echo "iceweasel-l10n-ar" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xkk")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-kazakh"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-kazakh task-kazakh-desktop"
- echo "iceweasel-l10n-kk" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xkm")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-khmer"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-khmer task-khmer-desktop"
- echo "iceweasel-l10n-km" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xkn")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-kannada-desktop"
- echo "iceweasel-l10n-kn" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xko")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-korean"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-korean task-korean-desktop"
- echo "iceweasel-l10n-ko" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xku")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-kurdish"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-kurdish task-kurdish-desktop"
- fi
- ;;
- "Xlij")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-lij" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xlt")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-lithuanian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-lithuanian task-lithuanian-desktop"
- echo "iceweasel-l10n-lt" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xlv")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-latvian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-latvian task-latvian-desktop"
- echo "iceweasel-l10n-lv" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xmai")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-mai" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xmk")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-macedonian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-macedonian task-macedonian-desktop"
- echo "iceweasel-l10n-mk" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xml")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-malayalam"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-malayalam task-malayalam-desktop"
- echo "iceweasel-l10n-ml" >> config/package-lists/dktoolian.list.chroot
- echo "iceweasel-l10n-ms" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xmr")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-marathi"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-marathi task-marathi-desktop"
- echo "iceweasel-l10n-mr" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xms")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-ms" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xne")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-nepali-desktop"
- fi
- ;;
- "Xnl")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-dutch"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-dutch task-dutch-desktop"
- echo "iceweasel-l10n-nl" >> config/package-lists/dktoolian.list.chroot
- echo "iceweasel-l10n-fy-nl" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xnb")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-norwegian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-norwegian task-norwegian-desktop"
- echo "iceweasel-l10n-nb-no" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xnn")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-norwegian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-norwegian task-norwegian-desktop"
- echo "iceweasel-l10n-nn-no" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xno")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-norwegian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-norwegian task-norwegian-desktop"
- echo "iceweasel-l10n-nb-no" >> config/package-lists/dktoolian.list.chroot
- echo "iceweasel-l10n-nn-no" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xor")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-or" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xpa")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-punjabi"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-punjabi task-punjabi-desktop"
- echo "iceweasel-l10n-pa-in" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xpl")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-polish"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-polish task-polish-desktop"
- echo "iceweasel-l10n-pl" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xpt")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$LANGREG" = "Xpt_BR" ]
- then
- PKGLOC="task-brazilian-portuguese"
- else
- PKGLOC="task-portuguese"
- fi
- if [ "X$LANGREG" = "Xpt_BR" -a "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-brazilian-portuguese task-brazilian-portuguese-desktop"
- echo "iceweasel-l10n-pt-br" >> config/package-lists/dktoolian.list.chroot
- elif [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-portuguese task-portuguese-desktop"
- echo "iceweasel-l10n-pt-pt" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xrm")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-rm" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xro")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-romanian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-romanian task-romanian-desktop"
- echo "iceweasel-l10n-ro" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xru")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-cyrillic task-russian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="$PKGLOC task-cyrillic-desktop task-russian-desktop"
- echo "iceweasel-l10n-ru" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xse")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-northern-sami"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-northern-sami task-northern-sami-desktop"
- fi
- ;;
- "Xses")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-son" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xsi")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-sinhala-desktop"
- echo "iceweasel-l10n-si" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xsk")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-slovak"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-slovak task-slovak-desktop"
- echo "iceweasel-l10n-sk" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xsl")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-slovenian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-slovenian task-slovenian-desktop"
- echo "iceweasel-l10n-sl" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xson")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-son" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xsq")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-albanian-desktop"
- echo "iceweasel-l10n-sq" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xsr")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-serbian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-serbian task-serbian-desktop"
- echo "iceweasel-l10n-sr" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xsv")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-swedish"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-swedish task-swedish-desktop"
- echo "iceweasel-l10n-sv-se" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xta")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-tamil"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-tamil task-tamil-desktop"
- echo "iceweasel-l10n-ta" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xte")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-telugu"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-telugu task-telugu-desktop"
- echo "iceweasel-l10n-te" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xth")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-thai"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-thai task-thai-desktop"
- echo "iceweasel-l10n-th" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xtr")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-turkish"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-turkish task-turkish-desktop"
- echo "iceweasel-l10n-tr" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xug")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-uyghur"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-uyghur task-uyghur-desktop"
- fi
- ;;
- "Xuk")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-ukrainian"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-ukrainian task-ukrainian-desktop"
- echo "iceweasel-l10n-uk" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xuz")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo "iceweasel-l10n-uz" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xvi")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-vietnamese-desktop"
- echo "iceweasel-l10n-vi" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xxh")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="task-xhosa-desktop"
- echo "iceweasel-l10n-xh" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "Xza")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- PKGLOC="task-chinese-s task-chinese-t"
- if [ "X$GUI" = "Xyes" ]
- then
- PKGLOC="$PKGLOC task-chinese-s-desktop task-chinese-t-desktop"
- fi
- if [ "X$GUI" = "Xyes" -a "X$LANGREG" = "Xzh_TW" ]
- then
- echo "iceweasel-l10n-zh-tw" >> config/package-lists/dktoolian.list.chroot
- else
- echo "iceweasel-l10n-zh-cn" >> config/package-lists/dktoolian.list.chroot
- fi
- ;;
- "*")
- echo "locales-all" >> config/package-lists/dktoolian.list.chroot
- echo sed remove comments
- sed -e 's/[ \t]*#.*$//g' < ../livesys-data/pkg_lang_base.txt >> config/package-lists/dktoolian.list.chroot
- if [ "X$GUI" = "Xyes" ]
- then
- echo sed remove comments
- sed -e 's/[ \t]*#.*$//g' < ../livesys-data/pkg_lang_desktop.txt >> config/package-lists/dktoolian.list.chroot
-
- fi
- ;;
- esac
- chmod 644 config/package-lists/dktoolian.list.chroot
- if [ "X$CONSKEYMAP" != "X" -a "X$CONSKEYMAP" != "X-" -a "X$GUI" != "Xyes" ]
- then
- echo sed correct console keymap name
-cat - > config/hooks/0500-console-keyboard.hook.chroot <<EOF
-#! /bin/sh
-set -e
-echo HOOK chroot 0500-console-keyboard.hook.chroot
-sed -i -e '/^[ \t]*exit.*0/cloadkeys $CONSKEYMAP\nexit 0\n' /etc/rc.local
-EOF
- chmod 755 config/hooks/0500-console-keyboard.hook.chroot
- fi
-cd ..
-
-
-
-# Create /etc/default/locale and /etc/timezone
-if [ ! -d "${DIR}/livesys/config/includes.chroot" ]
-then
- mkdir -p "${DIR}/livesys/config/includes.chroot"
- chmod 755 "${DIR}/livesys/config/includes.chroot"
-fi
-if [ ! -d "${DIR}/livesys/config/includes.chroot/etc/default" ]
-then
- mkdir -p "${DIR}/livesys/config/includes.chroot/etc/default"
- chmod 755 "${DIR}/livesys/config/includes.chroot/etc/default"
-fi
-make DESTDIR="${DIR}/livesys/config/includes.chroot" install
-if [ "X$LANGFULL" != "X" ]
-then
- echo "# File generated by update-locale" > "${DIR}/livesys/config/includes.chroot/etc/default/locale"
- echo "LANG=$LANGFULL" >> "${DIR}/livesys/config/includes.chroot/etc/default/locale"
- chmod 755 "${DIR}/livesys/config/includes.chroot/etc/default/locale"
-fi
-if [ "X$LIVEAPPENDTIMEZONE" != "X" ]
-then
- echo $LIVEAPPENDTIMEZONE > "${DIR}/livesys/config/includes.chroot/etc/timezone"
-fi
-
-
-
-# Copy additional data.
-# Step 1: Files shipped with DK tools
-[ -d ${DIR}/livesys/config/includes.chroot ] || mkdir -p ${DIR}/livesys/config/includes.chroot
-(cd "${DIR}/livesys-data/root" ; tar cf - .) | (cd ${DIR}/livesys/config/includes.chroot ; tar xf -)
-
-if [ "X$GUI" = "Xyes" -a -d "${DIR}/livesys-data/root-gui" ]
-then
- (cd "${DIR}/livesys-data/root-gui" ; tar cf - .) | (cd ${DIR}/livesys/config/includes.chroot ; tar xf -)
-fi
-
-if [ "X$GUI" != "Xyes" -a -d "${DIR}/livesys-data/root-cli" ]
-then
- (cd "${DIR}/livesys-data/root-cli" ; tar cf - .) | (cd ${DIR}/livesys/config/includes.chroot ; tar xf -)
-fi
-
-# Step 2: Files created by user
-if [ "X${DATADIR}" != "X-" -a -d "${DATADIR}" ]
-then
- (cd "${DATADIR}" ; tar cf - .) | (cd ${DIR}/livesys/config/includes.chroot ; tar xf -)
-fi
-if [ "X${DATADIR}" != "X-" -a -d "${DATADIR}-cli" -a "X$GUI" != "Xyes" ]
-then
- (cd "${DATADIR}-cli" ; tar cf - .) | (cd ${DIR}/livesys/config/includes.chroot ; tar xf -)
-fi
-if [ "X${DATADIR}" != "X-" -a -d "${DATADIR}-gui" -a "X$GUI" = "Xyes" ]
-then
- (cd "${DATADIR}-gui" ; tar cf - .) | (cd ${DIR}/livesys/config/includes.chroot ; tar xf -)
-fi
-
-# Step 3: Ownership and permissions
-chown -R root:root "${DIR}/livesys/config/includes.chroot"
-find "${DIR}/livesys/config/includes.chroot" -type d -exec chmod ugo+rx {} \;
-find "${DIR}/livesys/config/includes.chroot" -type f -exec chmod ugo+r {} \;
-
-
-
-# Hooks
-
-# chroot stage: Copy files from /usr/share/dktoolian/etc to /etc
-cp "${DIR}/livesys-data/hook_etcfiles.txt" "${DIR}/livesys/config/hooks/0501-etcfiles.hook.chroot"
-chmod 755 "${DIR}/livesys/config/hooks/0501-etcfiles.hook.chroot"
-
-# chroot stage: Modify /etc/rc.local to copy files to /etc again
-cat - > "${DIR}/livesys/config/hooks/0502-etc-files-again.hook.chroot" <<EOF
-#! /bin/sh
-echo HOOK chroot 0502-etc-files-again.hook.chroot
-sed -i -f /usr/share/dktoolian/etc-files.sed /etc/rc.local
-rm /usr/share/dktoolian/etc-files.sed
-EOF
-
-# chroot stage: Automatic login as root for CLI boot
-if [ "X$GUI" != "Xyes" ]
-then
- cp "${DIR}/livesys-data/hook_autologin.txt" "${DIR}/livesys/config/hooks/0503-autologin.hook.chroot"
- chmod 755 "${DIR}/livesys/config/hooks/0503-autologin.hook.chroot"
-fi
-
-# chroot stage: Install localization packages without recommended packages
-if [ "X$PKGLOC" != "X" ]
-then
- touch ${DIR}/livesys/config/package-lists/localize.list.chroot
- chmod 644 ${DIR}/livesys/config/package-lists/localize.list.chroot
- for locpkg in $PKGLOC
- do
- echo $locpkg >> ${DIR}/livesys/config/package-lists/localize.list.chroot
- done
- # echo "#! /bin/sh" > "${DIR}/livesys/config/hooks/0504-localize.hook.chroot"
- # echo "echo HOOK 0504-localize.hook.chroot" >> "${DIR}/livesys/config/hooks/0504-localize.hook.chroot"
- # echo "apt-get update && apt-get --no-install-recommends --yes install $PKGLOC" >> "${DIR}/livesys/config/hooks/0504-localize.hook.chroot"
- # chmod 755 "${DIR}/livesys/config/hooks/0504-localize.hook.chroot"
-fi
-
-# chroot stage: NTP query during system boot
-cat - > ${DIR}/livesys/config/includes.chroot/usr/share/dktoolian/ntpserver.sed <<EOF
-/^[ \t]*exit[ \t][ \t]*0[ \t]*$/cntpdate ${NTPSERVER} > /dev/null 2>&1\nexit 0
-
-EOF
-echo '#! /bin/sh' > "${DIR}/livesys/config/hooks/0505-ntpdate.hook.chroot"
-if [ "X$NTPSERVER" != "X" -a "X$USENTPDAEMON" != "Xyes" ]
-then
- echo "sed -i -f /usr/share/dktoolian/ntpserver.sed /etc/rc.local" >> "${DIR}/livesys/config/hooks/0505-ntpdate.hook.chroot"
-fi
-echo "# rm -fr /usr/share/dktoolian/ntpserver.sed" >> "${DIR}/livesys/config/hooks/0505-ntpdate.hook.chroot"
-echo "/usr/local/bin/dktoolian-ntp $NTPSERVER" >> "${DIR}/livesys/config/hooks/0505-ntpdate.hook.chroot"
-echo "rm -fr /usr/local/bin/dktoolian-ntp" >> "${DIR}/livesys/config/hooks/0505-ntpdate.hook.chroot"
-echo "rm -fr /usr/share/dktoolian/ntp.conf.template" >> "${DIR}/livesys/config/hooks/0505-ntpdate.hook.chroot"
-chmod 755 "${DIR}/livesys/config/hooks/0505-ntpdate.hook.chroot"
-
-# binary stage: modify boot menu, avoid installation items
-
-BOOTMENUCFG="binary/isolinux/menu.cfg"
-ISOLINUXCFG="binary/isolinux/isolinux.cfg"
-SPLASHPNG="binary/isolinux/splash.png"
-if [ "X$LIVETYPE" = "Xnfs" ]
-then
- BOOTMENUCFG="tftpboot/menu.cfg"
- ISOLINUXCFG="tftpboot/pxelinux.cfg/default"
- SPLASHPNG="tftpboot/splash.png"
-fi
-
-cat - > ${DIR}/livesys/config/hooks/0990-isolinux.hook.binary <<EOF
-#! /bin/sh
-echo HOOK binary 0990-isolinux.hook.binary
-EOF
-if [ "X$BOOTMENUBEEP" != "Xyes" ]
-then
- echo "sed -i -f \"${DIR}/livesys-data/sed_nobeep.txt\" \"${DIR}/livesys/${BOOTMENUCFG}\"" >> "${DIR}/livesys/config/hooks/0990-isolinux.hook.binary"
-fi
-cat - >> ${DIR}/livesys/config/hooks/0990-isolinux.hook.binary <<EOF
-sed -i -f "${DIR}/livesys-data/sed_isolinux.txt" "${DIR}/livesys/${ISOLINUXCFG}"
-sed -i -f "${DIR}/livesys-data/sed_menu.txt" "${DIR}/livesys/${BOOTMENUCFG}"
-cp "${DIR}/splash-dktoolian.png" "${DIR}/livesys/${SPLASHPNG}"
-chmod 644 "${DIR}/livesys/${SPLASHPNG}"
-EOF
-chmod 755 "${DIR}/livesys/config/hooks/0990-isolinux.hook.binary"
-
-# Now build live system
-cd livesys
- echo Building live system
- lb build || EXVAL="1"
-cd ..
-
-
-
-echo 'MIRROR ' $MIRROR
-echo 'LIVETYPE ' $LIVETYPE
-echo 'GUI ' $GUI
-echo 'LANGSHORT ' $LANGSHORT
-echo 'LANGFULL ' $LANGFULL
-echo 'LIVEAPPENDLOCALES ' $LIVEAPPENDLOCALES
-echo 'LIVEAPPENDTIMEZONE ' $LIVEAPPENDTIMEZONE
-echo 'LIVEAPPENDKBDLAYOUTS' $LIVEAPPENDKBDLAYOUTS
-echo 'LIVEAPPENDVGA ' $LIVEAPPENDVGA
-echo 'CONSKEYMAP ' $CONSKEYMAP
-echo 'PUBLISHER ' $PUBLISHER
-echo 'NFSSERVER ' $NFSSERVER
-echo 'NFSPATH ' $NFSPATH
-echo 'ALLOWUPGRADE ' $ALLOWUPGRADE
-echo 'CONFIGURED ' $CONFIGURED
-
-echo Finished
-date
-
-if [ "X$ALLOWNONFREE" = "Xyes" ]
-then
- cat "${DIR}/livesys-data/msg_nonfree.txt"
-fi
-
-exit $EXVAL
-
diff --git a/support/dktools/debian-jessie-prepare.sh b/support/dktools/debian-prepare.sh
index 4cac8d588e..cac12943ea 100755
--- a/support/dktools/debian-jessie-prepare.sh
+++ b/support/dktools/debian-prepare.sh
@@ -1,5 +1,26 @@
#! /bin/sh
+DEBVMAJ=`cat /etc/debian_version | cut -f 1 -d .`
+case "X$DEBVMAJ" in
+"X8")
+ DEBVMAJ="jessie"
+;;
+"X9")
+ DEBVMAJ="stretch"
+;;
+"X10")
+ DEBVMAJ="buster"
+;;
+"X")
+ echo 'E: Not on a Debian system'
+ exit 1
+;;
+*)
+ echo 'E: Can not handle Debian major version' $DEBVMAJ
+ exit 1
+;;
+esac
+
# CORRECTION: Probably the version numbers for libjpeg-turbo and
# wxWidgets need a change in later Debian versions or on non-Debian systems.
@@ -31,18 +52,28 @@ apt-get -y upgrade
# Install developer tools and DK tools library dependencies
P="aptitude build-essential autoconf automake autotools-dev"
-P="$P dh-make debhelper"
+P="$P dh-make debhelper dh-systemd"
P="$P devscripts fakeroot file gfortran git gnupg fp-compiler"
P="$P lintian patch patchutils pbuilder perl python"
P="$P quilt xutils-dev make gcc g++"
-P="$P zlib1g-dev libbz2-dev libssl-dev libdb-dev libmysqlclient-dev"
-P="$P libpng-dev libjpeg-dev libopenjpeg-dev libtiff-dev"
+P="$P zlib1g-dev libbz2-dev libssl-dev libdb-dev"
+P="$P libpng-dev libjpeg-dev"
P="$P libjpeg${LJTVERS}-turbo-dev libsnmp-dev"
P="$P wx${WXVERS}-headers"
P="$P libwxgtk${WXVERS}-dev"
P="$P libwxbase${WXVERS}-dev"
-P="$P libwxsvg-dev"
-apt-get install $P
+
+if [ "X$DEBVMAJ" != "Xjessie" ]
+then
+ echo 'I: Not jessie'
+ P="$P libtiff5-dev time libmariadb-dev libmariadbclient-dev"
+else
+ echo 'I: jessie'
+ P="$P libtiff-dev libopenjpeg-dev libmysqlclient-dev libwxsvg-dev"
+ P="$P libwxsvg-dev"
+fi
+
+apt-get -y install $P
# Finally write hint to switch back to unprivileged user
diff --git a/support/dktools/debian/README.source b/support/dktools/debian/README.source
index 60927f95ea..a1cdba9bf8 100644
--- a/support/dktools/debian/README.source
+++ b/support/dktools/debian/README.source
@@ -1,10 +1,55 @@
dktools for Debian
------------------
-<this file describes information about the source package, see Debian policy
-manual section 4.14. You WILL either need to modify or delete this file>
+CONTENTS
+- rules file
+- libexec directory
+- complaints from lintian about chm files
+RULES FILE
+
+The rules file invokes the configure script with options --enable-packaging
+and --disable-man-pages.
+
+The binaries are linked against shared library versions of DK libraries
+(--enable-packaging).
+
+The --parallel option is used to allow use of multiple cores in build
+process.
+
+The "make install" call does not install man pages (--disable-man-pages).
+Man pages are handled by the Debian package building scripts.
+
+
+LIBEXEC DIRECTORY
+
+The configure scripts creates and runs the scripts/wr-dktools.install.sh
+script generated from the scripts/wr-dktools.install.sh.in template.
+
+The scripts/wr-dktools.install.sh generates the debian/dktools.install
+file. This is necessary as the libexecdir on Debian is not the usual
+/usr/libexec, but /usr/lib/x86_64-linux-gnu instead.
+
+
+LINTIAN OVERRIDES
+
+- package-name-doesnt-match-sonames
+ 31 library files are produced from the source package, some of the libraries
+ use other libraries from this set.
+ Creating 31 library packages with package name matching the library name
+ would result in a lot of complications.
+
+- source-contains-prebuilt-ms-help-file
+ The source files for man pages and the CHM files are packaged into
+ the man-help-src.tar.gz file. This was recommended by the CTAN team,
+ because (a) these files are not needed to build and install the software and
+ (b) some multi-link files appear as duplicates when the archive is
+ unpacked on a file system not providing hard links.
+
+- maintainer-script-empty
+ For packages installing services (printqd, rshdown) the four example scripts
+ were copied to maintainer script templates for each service, with a
+ #DEBHELPER# line added to each.
- -- Dirk Krause <krause.dirk@web.de> Sun, 11 Oct 2015 17:26:12 +0200
diff --git a/support/dktools/debian/changelog b/support/dktools/debian/changelog
index bc18aa29a8..4eca01ec27 100644
--- a/support/dktools/debian/changelog
+++ b/support/dktools/debian/changelog
@@ -1,6 +1,485 @@
# DO NOT EDIT THIS FILE!
# It is generated automatically from the dktools-el6.spec.in
# file.
+dktools (4.30.2-1) unstable; urgency=low
+
+ * Added SPDX-License-Identifier tags to many files.
+ * Corrected full license terms back to original BSD-3-Clause text.
+
+ -- Dirk Krause <krause.dirk@web.de> Tue, 15 Sep 2020 20:00:00 +0200
+
+
+dktools (4.30.1-1) unstable; urgency=low
+
+ * Upgrade for dkct, can use SPDX-License-Identifier lines.
+
+ -- Dirk Krause <krause.dirk@web.de> Sun, 23 Aug 2020 20:00:00 +0200
+
+
+dktools (4.30.0-1) unstable; urgency=low
+
+ * Added the Dk4WxYesNoDialog class to the libdk4wx library because
+ the wxMessageBox from the libwxgtk3.0-0v5 package in Debian 10 does
+ not localize the button texts.
+ * Bugfix in wxdkdraw, added menu items to create arcs.
+ * Bugfix in the dk4gra module, pattern size for octagons now matches
+ the pattern size for circles.
+ * Yes / no dialogs with localized button texts in wxdkdraw.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 20 Aug 2020 20:00:00 +0200
+
+
+dktools (4.29.3-1) unstable; urgency=low
+
+ * Bugfix in wxdkdraw: Line width 0 elements are highlighted as
+ selection/copy/move/delete/grouping candidates now.
+ * Modified htmlbook again for flexbox placement of navigation menu lists
+ if the navigation menu is shown below the main content.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 16 Jul 2020 20:00:00 +0200
+
+
+dktools (4.29.2-1) unstable; urgency=low
+
+ * Modified htmlbook so we can create more responsive designs.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 16 Jul 2020 20:00:00 +0200
+
+
+dktools (4.29.1-1) unstable; urgency=low
+
+ * More markers are written by the itadmin program to the dhcpd.conf output.
+ * Modified mklivesys.sh script. We can now inject files into the
+ initramfs filesystem of a live system.
+ * Removed libreoffice-style-galaxy from package lists for live systems.
+
+ -- Dirk Krause <krause.dirk@web.de> Sat, 27 Jun 2020 20:00:00 +0200
+
+
+dktools (4.29.0-1) unstable; urgency=low
+
+ * Bugfix in wxdkdraw: Draw control sets focus on itself in mouse enter
+ events and mouse click events when compiled on Windows.
+ I hope to get the mouse wheel working on Windows.
+ * Bugfix in wximgsz: The string table in German language was completed.
+ * New function dk4uc2l_string_encoded() in dk4uc2l module.
+
+ -- Dirk Krause <krause.dirk@web.de> Mon, 13 Apr 2020 20:00:00 +0200
+
+
+dktools (4.28.1-1) unstable; urgency=low
+
+ * Bugfix in wxdkdraw: Do no longer show "Modify spline point s value"
+ dialog in move spline point operations.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 26 Mar 2020 20:00:00 +0200
+
+
+dktools (4.28.0-1) unstable; urgency=low
+
+ * New program: wxdkdraw, minimalistic drawing program for use with LaTeX.
+ * Wximgsz rewritten for DK libraries 4.
+ Uses spin controls for input instead of standard text fields.
+ * Library API change: The enum values DK4WX_AUTOSTART_REACTION_IGNORE and
+ alike were moved into a public enum in the Dk4WxAutostartController class.
+ * Library API change: The a and b parameters in the
+ dk4gratool_dist_point_point() function were changed to const, the a, b and
+ p parameters in dk4gratool_dist_point_track() too.
+ * Library API change: The new dk4bb_add_bb() function in the dk4bb module
+ allows to create a bounding box for a drawing from the object bounding
+ boxes.
+
+ -- Dirk Krause <krause.dirk@web.de> Wed, 19 Feb 2020 20:00:00 +0200
+
+
+dktools (4.27.0-1) unstable; urgency=low
+
+ * Distinction between K and k in size specifications (K=1024, k=1000),
+ M/m, G/g, T/t, P/p, E/e, Z/z, Y/y (powers of 1024, powers of 1000).
+ * Bugfix in build process, size of wxChar calculated in configure script.
+ * Bugfix in dkwxwiz, corrected name of XPM source.
+
+ -- Dirk Krause <krause.dirk@web.de> Wed, 27 Nov 2019 20:00:00 +0200
+
+
+dktools (4.26.0-1) unstable; urgency=low
+
+ * Install header files into the includedir/dktools-4 directory.
+ * Daemons rshdown and printqd are systemd compatible now.
+ * Module dk4dmt modified for systemd compatibility.
+ * PID files now in /run/... when systemd is used, /var/run/... otherwise.
+ * Build scripts check for systemd use and install systemd service unit files
+ when systemd in use, traditional start scripts otherwise.
+ * Build scripts modified for MinGW-w64 build and later probably cross-builds.
+ * Program pjsnmp is now installed into libexec directory.
+ * Packaging for RPM and DEB packages changed, separated packages for
+ printqd and rshdown.
+ * New module dk4bm for bit matrices.
+ * New module dk4bml to levelize graphs represented by bit matrices.
+ * Bugfix in the dk4apref module: Parameter pv is const, but the buffer
+ was modified.
+ * Bugfix in dk4sock25 and dk4sock31 modules: FreeAddrInfo() replaced
+ by FreeAddrInfoW(). This bug was not relevant when using MSVC to build
+ Windows binaries as the FreeAddrInfo() macro is mapped to the
+ FreeAddrInfoW() function when using makefile.vc.
+ * Modification in the dk4mem module: Fallback functions only compiled
+ if needed.
+
+ -- Dirk Krause <krause.dirk@web.de> Fri, 18 Oct 2019 20:00:00 +0200
+
+
+dktools (4.25.0-1) unstable; urgency=low
+
+ * Bugfix in the dk-cat program. The program attempted to issue a byte order
+ marker depending on the systems default encoding instead of the used
+ output encoding.
+ * Module dk4itmin added to search for a local minimum of an unimodal
+ function in an interval.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 26 Sep 2019 20:00:00 +0200
+
+
+dktools (4.24.2-1) unstable; urgency=low
+
+ * Bugfix in the dkwt/dkwtadm program. The program did not properly inform
+ all windows about environment modifications.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 15 Aug 2019 20:00:00 +0200
+
+
+dktools (4.24.1-1) unstable; urgency=low
+
+ * Added dk-bin2c program to convert binary data to C source code
+ (array of unsigned char literals).
+ * Added markdown documentation for live systems.
+ * Classes Dk4Comparable and Dk4Container modified for C++11/C++17.
+
+ -- Dirk Krause <krause.dirk@web.de> Sun, 04 Aug 2019 20:00:00 +0200
+
+
+dktools (4.24.0-1) unstable; urgency=low
+
+ * Modifications to follow the "Updating to the latest version of wxWidgets"
+ document.
+
+ -- Dirk Krause <krause.dirk@web.de> Sun, 14 Jul 2019 20:00:00 +0200
+
+
+dktools (4.23.0-1) unstable; urgency=low
+
+ * Bugfix in 32 bit Linux/Unix build process, 64 bit file size support
+ was inactive on 32 bit Linux/Unix in previous versions.
+ * Variables to store leightweight class objects returned by c_str().
+ * Font feature "script" added, font feature enumeration values changed.
+
+ -- Dirk Krause <krause.dirk@web.de> Sun, 16 Jun 2019 20:00:00 +0200
+
+
+dktools (4.22.0-1) unstable; urgency=low
+
+ * Configuration default for cosp in the fig2lat program changed to yes.
+ * Added some previously internal functions to the API.
+ * Functions to calculate 2D and 3D X-spline segment lengths.
+ * Option "x-spline sub segments" for dk4gra.conf, "xsss" for language
+ selection. This option specifies the number of Bezier spline segments
+ to draw for each X-spline segment.
+ * Parameter "rot" in the text functions in the dk4grpgf and dk4pppt modules
+ to specify the text rotation in degree.
+ * Bugfix in dk-lines program to avoid dereferencing NULL pointer.
+ * Cleanup, a new directory gui-img with subdirectories was created.
+ The *.ico and *.xpm files were moved from the source code directory
+ into the subdirectories.
+
+ -- Dirk Krause <krause.dirk@web.de> Tue, 16 Apr 2019 20:00:00 +0200
+
+
+dktools (4.21.0-1) unstable; urgency=low
+
+ * Added complaint to dkct if GUI object has no parent object
+ (is not mentioned as contents of another object).
+ * Modified Dk4WxColourView class to show difference between
+ active/inactive state and to place colour chooser over colour view.
+
+ -- Dirk Krause <krause.dirk@web.de> Sat, 17 Nov 2018 20:00:00 +0200
+
+
+dktools (4.20.0-1) unstable; urgency=low
+
+ * Function $!string added to dkct.
+ * Added functions dk4ma_int_from_double() and dk4ma_uint_from_double()
+ to convert double values to int and unsigned.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 01 Nov 2018 20:00:00 +0200
+
+
+dktools (4.19.1-1) unstable; urgency=low
+
+ * Bugfix in Makefile.in for parallel make.
+
+ -- Dirk Krause <krause.dirk@web.de> Tue, 16 Oct 2018 20:00:00 +0200
+
+
+dktools (4.19.0-1) unstable; urgency=low
+
+ * Functions to calculate greatest common divisor and least common multiple.
+ * Function for conversion to smaller integer types.
+ * Function to convert UTF-8 encoded strings to wxChar strings.
+ * Added event generation to Dk4WxColourView class.
+ * Installing printqd and rshdown to /usr/sbin now.
+ * File /etc/init.d/printqd to start and stop printqd service.
+
+ -- Dirk Krause <krause.dirk@web.de> Sat, 13 Oct 2018 20:00:00 +0200
+
+
+dktools (4.18.1-1) unstable; urgency=low
+
+ * Removed misleading warning from dkct shown when a "direction" attribute
+ was assigned to a wxScrollBar.
+
+ -- Dirk Krause <krause.dirk@web.de> Sun, 29 Jul 2018 20:00:00 +0200
+
+
+dktools (4.18.0-1) unstable; urgency=low
+
+ * Added --no-modification-warning option to dkct.
+ This option suppresses the warning at the beginning of output files
+ advising users to modify the input files processed by dkct instead
+ of the output files produced by the program.
+ * Added new modules dk4mai8du8, dk4mai8di8, dk4mai8du16, dk4mai8di16,
+ dk4mai8du32 and dk4mai8di32 to read uint8_t ... int32_t.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 26 Jul 2018 20:00:00 +0200
+
+
+dktools (4.17.0-1) unstable; urgency=low
+
+ * Added options "privacy link" and "privacy page" to htmlbook configuration.
+ * Added comments to HTML output of htmlbook.
+ * Changed to a faster iteration algorithm in fig2lat and libdk3fig.
+ * Added module dk4iter for numeric iterations to libdk4c.
+
+ -- Dirk Krause <krause.dirk@web.de> Sat, 07 Jul 2018 20:00:00 +0200
+
+
+dktools (4.16.0-1) unstable; urgency=low
+
+ * Alternative colour chooser added, uses palettes.
+ * Dk4WxColourView can be set to be inactive.
+ * Former Dk4WxColorView renamed to Dk4WxColourView for consistence,
+ some methods also renamed for consistence.
+ * Containers wxChoicebook, wxListbook, wxSimplebook, wxToolbook and
+ wxTreebook now supported by dkct.
+ * Attribute text allowed for wxPanel to add panels to book controls.
+ * Stock menu items and stock buttons allowed in dkct.
+
+ -- Dirk Krause <krause.dirk@web.de> Sun, 27 May 2018 20:00:00 +0200
+
+
+dktools (4.15.0-1) unstable; urgency=low
+
+ * Added dk4xsp module for X-spline calculations.
+ * Modified configure.ac due to warnings from Debian package building about
+ symbols not found in any library.
+ * Added new constants
+ DK4_UINT8_0, DK4_INT8_0, DK4_UINT16_0, DK4_INT16_0, DK4_UINT32_0, DK4_INT32_0
+ to dktypes.h file.
+
+ -- Dirk Krause <krause.dirk@web.de> Sun, 20 May 2018 20:00:00 +0200
+
+
+dktools (4.14.1-1) unstable; urgency=low
+
+ * Bugfix in Makefile.in and configure.ac, library libdk4ma.a
+ was not mentioned as dependency for libdk4maio8d.a.
+
+ -- Dirk Krause <krause.dirk@web.de> Sat, 05 May 2018 20:00:00 +0200
+
+
+dktools (4.14.0-1) unstable; urgency=low
+
+ * The configure script now checks the presence of the search.h include
+ file and the availability of the qsort() and bsearch() functions.
+ * Modified dkrgra, dk4graa and dk4pppt. A flags set was added to text
+ output functions, so we can order a white box and/or an oval box.
+ * Modified dk4fpe.h file, it does no longer include compiler pragmas
+ to enable access to the floating point environment.
+ Users might want to apply the pragma to portions of code only
+ and not necessarily to entire source files.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 19 Apr 2018 20:00:00 +0200
+
+
+dktools (4.13.0-1) unstable; urgency=low
+
+ * Added dk4pppt module.
+ * Added functions to configure font size and LaTeX preamble lines in
+ dk4gra and dk4graa modules.
+ * Added functions to write a char string LaTeX encoded to a stream
+ in the dk4uc2l and dk4uc2la modules.
+ * Corrected some error messages in the dk4graa module.
+ * Added dk4rec27 module containing the dk4recode_c8_to_dk() function
+ to convert char strings (plain, Win1252, UTF-8) to dkChar strings.
+
+ -- Dirk Krause <krause.dirk@web.de> Sun, 15 Apr 2018 20:00:00 +0200
+
+
+dktools (4.12.1-1) unstable; urgency=low
+
+ * Changed default for expected encoding when processing standard input
+ or input from file to DK4_FILE_ENCODING_WIN1252 to allow processing
+ of text containing the Euro currency symbol.
+ * Renamed some encodings.
+ * Release mechanism modified: Presence of the preview.txt file indicates
+ to build not an official release.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 12 Apr 2018 20:00:00 +0200
+
+
+dktools (4.12.0-1) unstable; urgency=low
+
+ * Rewrote bmpp and wxbmpp for library version 4.
+ * Modified dk4align.h for separated enum types for text and image
+ alignment.
+ * Added dk4mao8dns module to write double values without scientific notation.
+ * Packaging changed, packaging script do no longer deal with directories
+ for printqd. Printqd can only be used with the LPRng print system which
+ is not available as package. Users install that software manually
+ deciding about UID and GID to run LPRng at build time.
+ So our package postinstallation and preremoval scripts can not know
+ which UID and GID is used for LPRng.
+
+ -- Dirk Krause <krause.dirk@web.de> Fri, 06 Apr 2018 20:00:00 +0200
+
+
+dktools (4.11.4-1) unstable; urgency=low
+
+ * The dkct program now checks state machine descriptions for duplicated
+ numeric values for states, inputs and outputs.
+ State, input and output names are checked whether or not they are
+ valid identifiers in the C programming language.
+ * State, input, and output definitions are now written as enums by default
+ instead of defines. When using doxygen, this results in a more readable
+ documentation.
+
+ -- Dirk Krause <krause.dirk@web.de> Sat, 10 Feb 2018 20:00:00 +0200
+
+
+dktools (4.11.3-1) unstable; urgency=low
+
+ * Added new value 7 for co_gu field in computers database of itadmin
+ to indicate that a computer is retired.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 08 Feb 2018 20:00:00 +0200
+
+
+dktools (4.11.2-1) unstable; urgency=low
+
+ * Bugfix, corrected configure.ac and configure to properly detect
+ Debian and derivative systems.
+
+ -- Dirk Krause <krause.dirk@web.de> Fri, 02 Feb 2018 20:00:00 +0200
+
+
+dktools (4.11.1-1) unstable; urgency=low
+
+ * Bugfix, some XPM files contained named colors instead of hexadecimal values.
+ * GUI applications now restoring window position and size.
+
+ -- Dirk Krause <krause.dirk@web.de> Sat, 27 Jan 2018 20:00:00 +0200
+
+
+dktools (4.11.0-1) unstable; urgency=low
+
+ * Splitted dk4uc2l module into two modules dk4uc2la and dk4uc2l.
+ * Appropriate changes to dk-t2l program.
+
+ -- Dirk Krause <krause.dirk@web.de> Wed, 24 Jan 2018 20:00:00 +0200
+
+
+dktools (4.10.0-1) unstable; urgency=low
+
+ * Added dk-lines program.
+ * Bugfix in dkct, corrected typo.
+ * Added test for __attribute__((unused)) mechanism.
+ * Now using DK4_HAVE_INLINE and DK4_USE_INLINE (inline keyword available,
+ want to use inline functions instead of macros).
+
+ -- Dirk Krause <krause.dirk@web.de> Mon, 20 Nov 2017 20:00:00 +0200
+
+
+dktools (4.9.7-1) unstable; urgency=low
+
+ * Bugfix in htmlbook, no warning when escaping a leading raute character
+ by a backslash.
+
+ -- Dirk Krause <krause.dirk@web.de> Fri, 13 Oct 2017 20:00:00 +0200
+
+
+dktools (4.9.6-1) unstable; urgency=low
+
+ * New "html doctype" option to htmlbook.
+ * Docu update for htmlbook, requirement to encode & as &amp; in
+ a.href, img.svg and other attributes.
+ * Configuration option SHORTIFNAMES in DKtoolian build script for Debian
+ Stretch, so users can choose whether to use the new long names or the
+ traditional short names for network interfaces.
+
+ -- Dirk Krause <krause.dirk@web.de> Tue, 10 Oct 2017 20:00:00 +0200
+
+
+dktools (4.9.5-1) unstable; urgency=low
+
+ * Configuration option "svg wh" for htmlbook to set the default for
+ svgwh attributes in %%img ...%% commands.
+
+ -- Dirk Krause <krause.dirk@web.de> Thu, 05 Oct 2017 20:00:00 +0200
+
+
+dktools (4.9.4-1) unstable; urgency=low
+
+ * Bugfix in htmlbook, write correct strings for href and title
+ attribute and hyperlink text now for URLs with multiple
+ ampersand separated parameters like http://x.y.z/test.php?a=b&c=d.
+
+ -- Dirk Krause <krause.dirk@web.de> Tue, 03 Oct 2017 20:00:00 +0200
+
+
+dktools (4.9.3-1) unstable; urgency=low
+
+ * Modified htmlbook, the hyperlink title (tool tip text) can be configured
+ to preprend a globe symbol for external links (links outside the
+ current book).
+
+ -- Dirk Krause <krause.dirk@web.de> Fri, 29 Sep 2017 20:00:00 +0200
+
+
+dktools (4.9.2-1) unstable; urgency=low
+
+ * Modified debian-stretch-prepare.sh script to install packages
+ libmariadbclient-dev and libmariadb-dev, so the matching header
+ file mariadb/mysql.h and -lmariadbclient library are found.
+
+ -- Dirk Krause <krause.dirk@web.de> Wed, 20 Sep 2017 20:00:00 +0200
+
+
+dktools (4.9.1-1) unstable; urgency=low
+
+ * Changes in debian/control to build on Debian Stretch.
+ * Statistics summary output for info log level in dk-send and dk-recv.
+ * Fixed tests for RAND_egd() function.
+ * Bugfix in dk4strm module: No write attempt on closing stream if buffer empty.
+ * Correct Bezier curve bounding box calculation.
+
+ -- Dirk Krause <krause.dirk@web.de> Wed, 13 Sep 2017 20:00:00 +0200
+
+
+dktools (4.9.0-1) unstable; urgency=low
+
+ * Followed further suggestion from the CTAN team.
+
+ -- Dirk Krause <krause.dirk@web.de> Tue, 25 Apr 2017 20:00:00 +0200
+
+
dktools (4.8.3-1) unstable; urgency=low
* Followed improvement suggestions from the CTAN team.
@@ -617,7 +1096,7 @@ dktools (3.0.6-1) unstable; urgency=low
* dkct enhanced for unknown classes.
- -- Dirk Krause <krause.dirk@web.de> Thu, 20 Mar 2013 20:00:00 +0200
+ -- Dirk Krause <krause.dirk@web.de> Thu, 21 Mar 2013 20:00:00 +0200
dktools (3.0.5-1) unstable; urgency=low
@@ -689,14 +1168,14 @@ dktools (2.2.20-1) unstable; urgency=low
* Program imgsize renamed to chimgsize to avoid name conflicts
with perl-Image-Size RPM.
- -- Dirk Krause <krause.dirk@web.de> Sun, 06 Jun 2011 20:00:00 +0200
+ -- Dirk Krause <krause.dirk@web.de> Mon, 06 Jun 2011 20:00:00 +0200
dktools (2.2.19-1) unstable; urgency=low
* Bugfix in text2htm, wrong format specification.
- -- Dirk Krause <krause.dirk@web.de> Sun, 19 Apr 2011 20:00:00 +0200
+ -- Dirk Krause <krause.dirk@web.de> Tue, 19 Apr 2011 20:00:00 +0200
dktools (2.2.18-1) unstable; urgency=low
@@ -756,7 +1235,7 @@ dktools (2.2.12-1) unstable; urgency=low
* The *.jar files were missing in the Windows executable setup of
2.2.11. Here they are back.
- -- Dirk Krause <krause.dirk@web.de> Tue, 13 Sep 2010 20:00:00 +0200
+ -- Dirk Krause <krause.dirk@web.de> Mon, 13 Sep 2010 20:00:00 +0200
dktools (2.2.11-1) unstable; urgency=low
diff --git a/support/dktools/debian/control b/support/dktools/debian/control
index 6fb4f3cd0c..8c5deaea4f 100644
--- a/support/dktools/debian/control
+++ b/support/dktools/debian/control
@@ -2,22 +2,22 @@ Source: dktools
Section: misc
Priority: optional
Maintainer: Dirk Krause <krause.dirk@web.de>
-Build-Depends: debhelper (>= 9), autotools-dev, zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmysqlclient-dev, libpng-dev, libjpeg-dev, libopenjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev, libwxsvg-dev
-Standards-Version: 3.9.5
-Homepage: http://dktools.sourceforge.net
+Build-Depends: debhelper (>= 12), dh-systemd (>= 12), autotools-dev, zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmariadbclient-dev, libpng-dev, libjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev
+Standards-Version: 4.3.0
+Homepage: http://sourceforge.net/p/dktools/wiki/Home/
#Vcs-Git: git://anonscm.debian.org/collab-maint/dktools.git
#Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/dktools.git;a=summary
Package: dktools
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-data (>= 4.8.3), dktools-lib-4.8 (>= 4.8.0), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmysqlclient18, libjpeg62-turbo, libpng12-0, libtiff5, libsnmp30, libssl1.0.0, libwxbase3.0-0, libwxgtk3.0-0
-Description: DK tools - runtime
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-data (>= 4.30.2), dktools-lib-4.30 (>= 4.30.0), libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadb3, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5, shared-mime-info, mime-support, desktop-file-utils, xdg-utils, lsb-base
+Description: Executable programs for DK tools
This package contains the executable programs.
bmpp /wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
fig2lat Convert Fig to PDF+TeX
wximgsz Suggest new size pairs to rescale bitmap images
htmlbook Publish HTML like a book
- dkct / wxdkct C tracing and debugging preprocessor
+ dkct C tracing and debugging preprocessor
dkwxwiz Wizard to create DK tools + wxWidgets based applications
wxdkhtb HTB help file viewer
itadmin Use a MySQL database to manage your IT
@@ -43,27 +43,56 @@ Description: DK tools - runtime
wxdkclock Simple clock with one alert
plpdftex Output driver for octpgfpl
-Package: dktools-lib-4.8
+Package: rshdown
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-lib-data (>= 4.8.3), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmysqlclient18, libjpeg62-turbo, libpng12-0, libtiff5, libsnmp30, libssl1.0.0, libwxbase3.0-0, libwxgtk3.0-0
-Description: DK tools - shared libraries
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools (>= 4.30.2), dktools-data (>= 4.30.2), dktools-lib-4.30 (>= 4.30.0), libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadb3, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5, lsb-base
+Description: Remote shutdown over network
+ The rshdown program can be used as daemon and as sending client
+ to initiate a shutdown on remote systems.
+ A typical use case is a UPS powering two computers but having a serial
+ (control) connection to only one of them. The computer having the control
+ connection is notified by the UPS on power failure or other power events.
+ On power related shutdown it can notfiy the other computer(s) using
+ rshdown.
+
+Package: printqd
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools (>= 4.30.2), dktools-data (>= 4.30.2), dktools-lib-4.30 (>= 4.30.0), libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadb3, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5, lsb-base
+Description: Print quota daemon for LPRng
+ This package contains a print quota daemon for the LPRng print system.
+ Printqd allows or denies print jobs per user depending on the number
+ of pages the user already printed on a printer class.
+ Difference to Pykota:
+ Printqd does not analyze or process print jobs. The LPRng print system
+ feeds the printers page counter (print impression counter) before and after
+ each printed job to printqd, printqd saves the number of pages printed in
+ a database. Print permissions and accounting data is only based on the number
+ of printed pages. Printqd does not count the amount of ink used.
+
+Package: dktools-lib-4.30
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-lib-data (>= 4.30.2), libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadb3, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5
+Description: Shared libraries for DK tools
This package contains the shared libraries from the DK tools project.
Package: dktools-data
Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: DK tools - data files
+Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base
+Description: Data files for DK tools
This package contains the data files needed by dktools.
+ Configuration files and string table files for the programs.
Package: dktools-lib-data
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: DK tools - Data files for shared libraries
+Description: Data files for DK tools shared libraries
This package contains the data files for the DK tools shared libraries.
+ Configuration files for the libraries and string table files for the libraries.
-Package: dktools-lib-4.8-dev
+Package: dktools-lib-4.30-dev
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, debhelper (>= 9), autotools-dev, dktools-lib-4.8 (>= 4.8.3), dktools-lib-data (>= 4.8.3), zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmysqlclient-dev, libpng-dev, libjpeg-dev, libopenjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev, libwxsvg-dev
-Description: DK tools - developer support
+Depends: ${shlibs:Depends}, ${misc:Depends}, autotools-dev, dktools-lib-4.30 (>= 4.30.2), dktools-lib-data (>= 4.30.2), zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmariadbclient-dev, libpng-dev, libjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev
+Description: Developer support for DK tools
This package contains the DK tools developer support.
+ Header files for the libraries and *.so files.
diff --git a/support/dktools/debian/control.in b/support/dktools/debian/control.in
index ef606a83bc..6194c7dbcd 100644
--- a/support/dktools/debian/control.in
+++ b/support/dktools/debian/control.in
@@ -2,22 +2,22 @@ Source: dktools
Section: misc
Priority: optional
Maintainer: Dirk Krause <krause.dirk@web.de>
-Build-Depends: debhelper (>= 9), autotools-dev, zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmysqlclient-dev, libpng-dev, libjpeg-dev, libopenjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev, libwxsvg-dev
-Standards-Version: 3.9.5
-Homepage: http://dktools.sourceforge.net
+Build-Depends: debhelper (>= 12), dh-systemd (>= 12), autotools-dev, zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmariadbclient-dev, libpng-dev, libjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev
+Standards-Version: 4.3.0
+Homepage: http://sourceforge.net/p/dktools/wiki/Home/
#Vcs-Git: git://anonscm.debian.org/collab-maint/dktools.git
#Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/dktools.git;a=summary
Package: dktools
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-data (>= @VERSNO@), dktools-lib-@SOVERS@ (>= @SOVERS@.0), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmysqlclient18, libjpeg62-turbo, libpng12-0, libtiff5, libsnmp30, libssl1.0.0, libwxbase3.0-0, libwxgtk3.0-0
-Description: DK tools - runtime
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-data (>= @VERSNO@), dktools-lib-@SOVERS@ (>= @SOVERS@.0), libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadb3, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5, shared-mime-info, mime-support, desktop-file-utils, xdg-utils, lsb-base
+Description: Executable programs for DK tools
This package contains the executable programs.
bmpp /wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
fig2lat Convert Fig to PDF+TeX
wximgsz Suggest new size pairs to rescale bitmap images
htmlbook Publish HTML like a book
- dkct / wxdkct C tracing and debugging preprocessor
+ dkct C tracing and debugging preprocessor
dkwxwiz Wizard to create DK tools + wxWidgets based applications
wxdkhtb HTB help file viewer
itadmin Use a MySQL database to manage your IT
@@ -43,27 +43,56 @@ Description: DK tools - runtime
wxdkclock Simple clock with one alert
plpdftex Output driver for octpgfpl
+Package: rshdown
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools (>= @VERSNO@), dktools-data (>= @VERSNO@), dktools-lib-@SOVERS@ (>= @SOVERS@.0), libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadb3, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5, lsb-base
+Description: Remote shutdown over network
+ The rshdown program can be used as daemon and as sending client
+ to initiate a shutdown on remote systems.
+ A typical use case is a UPS powering two computers but having a serial
+ (control) connection to only one of them. The computer having the control
+ connection is notified by the UPS on power failure or other power events.
+ On power related shutdown it can notfiy the other computer(s) using
+ rshdown.
+
+Package: printqd
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools (>= @VERSNO@), dktools-data (>= @VERSNO@), dktools-lib-@SOVERS@ (>= @SOVERS@.0), libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadb3, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5, lsb-base
+Description: Print quota daemon for LPRng
+ This package contains a print quota daemon for the LPRng print system.
+ Printqd allows or denies print jobs per user depending on the number
+ of pages the user already printed on a printer class.
+ Difference to Pykota:
+ Printqd does not analyze or process print jobs. The LPRng print system
+ feeds the printers page counter (print impression counter) before and after
+ each printed job to printqd, printqd saves the number of pages printed in
+ a database. Print permissions and accounting data is only based on the number
+ of printed pages. Printqd does not count the amount of ink used.
+
Package: dktools-lib-@SOVERS@
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-lib-data (>= @VERSNO@), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmysqlclient18, libjpeg62-turbo, libpng12-0, libtiff5, libsnmp30, libssl1.0.0, libwxbase3.0-0, libwxgtk3.0-0
-Description: DK tools - shared libraries
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-lib-data (>= @VERSNO@), libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadb3, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5
+Description: Shared libraries for DK tools
This package contains the shared libraries from the DK tools project.
Package: dktools-data
Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: DK tools - data files
+Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base
+Description: Data files for DK tools
This package contains the data files needed by dktools.
+ Configuration files and string table files for the programs.
Package: dktools-lib-data
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: DK tools - Data files for shared libraries
+Description: Data files for DK tools shared libraries
This package contains the data files for the DK tools shared libraries.
+ Configuration files for the libraries and string table files for the libraries.
Package: dktools-lib-@SOVERS@-dev
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, debhelper (>= 9), autotools-dev, dktools-lib-@SOVERS@ (>= @VERSNO@), dktools-lib-data (>= @VERSNO@), zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmysqlclient-dev, libpng-dev, libjpeg-dev, libopenjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev, libwxsvg-dev
-Description: DK tools - developer support
+Depends: ${shlibs:Depends}, ${misc:Depends}, autotools-dev, dktools-lib-@SOVERS@ (>= @VERSNO@), dktools-lib-data (>= @VERSNO@), zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmariadbclient-dev, libpng-dev, libjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev
+Description: Developer support for DK tools
This package contains the DK tools developer support.
+ Header files for the libraries and *.so files.
diff --git a/support/dktools/debian/control8 b/support/dktools/debian/control8
new file mode 100644
index 0000000000..f5f6d4d822
--- /dev/null
+++ b/support/dktools/debian/control8
@@ -0,0 +1,69 @@
+Source: dktools
+Section: misc
+Priority: optional
+Maintainer: Dirk Krause <krause.dirk@web.de>
+Build-Depends: debhelper (>= 9), autotools-dev, zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmysqlclient-dev, libpng-dev, libjpeg-dev, libopenjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev, libwxsvg-dev
+Standards-Version: 3.9.5
+Homepage: http://sourceforge.net/p/dktools/wiki/Home/
+#Vcs-Git: git://anonscm.debian.org/collab-maint/dktools.git
+#Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/dktools.git;a=summary
+
+Package: dktools
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-data (>= 4.30.2), dktools-lib-4.30 (>= 4.30.0), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmysqlclient18, libjpeg62-turbo, libpng12-0, libtiff5, libsnmp30, libssl1.0.0, libwxbase3.0-0, libwxgtk3.0-0
+Description: DK tools - runtime
+ This package contains the executable programs.
+ bmpp /wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
+ fig2lat Convert Fig to PDF+TeX
+ wximgsz Suggest new size pairs to rescale bitmap images
+ htmlbook Publish HTML like a book
+ dkct C tracing and debugging preprocessor
+ dkwxwiz Wizard to create DK tools + wxWidgets based applications
+ wxdkhtb HTB help file viewer
+ itadmin Use a MySQL database to manage your IT
+ dk-ls ls clone, configurable output column order
+ dk-fic File integrity checker
+ dk-bmm Backup media management (10 tape rotation scheme)
+ dk-blks Blocksize corrector (to pass a data stream to dd)
+ dk-eradisk Produce data stream to erase a disk or partition
+ dk-hex Show file contents in hexadecimal or octal notation
+ dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-sort sort clone, handles ASCII/UTF-8/UTF-16, unsigned/signed/float
+ dk-t2h Text to HTML conversion
+ dk-t2l Text to LaTeX conversion
+ dk-sqlsplit Split overlong SQL lines i.e. from mysqldump
+ dkdbt Convert simple databases to text and vice versa
+ dk-uid Find free user ID in given range
+ dk-pwgen Create passwords, PINs or WiFi keys
+ dk-send Send a data stream to one or multiple recipients
+ dk-recv Receive data stream from a dk-send process
+ printqd Print quota daemon for use with LPRng
+ wxpqdic GUI client to check print quota in printqd
+ addctrld Add final CTRL-D to data stream if not yet present
+ wxdkclock Simple clock with one alert
+ plpdftex Output driver for octpgfpl
+
+Package: dktools-lib-4.30
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-lib-data (>= 4.30.2), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmysqlclient18, libjpeg62-turbo, libpng12-0, libtiff5, libsnmp30, libssl1.0.0, libwxbase3.0-0, libwxgtk3.0-0
+Description: DK tools - shared libraries
+ This package contains the shared libraries from the DK tools project.
+
+Package: dktools-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DK tools - data files
+ This package contains the data files needed by dktools.
+
+Package: dktools-lib-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DK tools - Data files for shared libraries
+ This package contains the data files for the DK tools shared libraries.
+
+Package: dktools-lib-4.30-dev
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, debhelper (>= 9), autotools-dev, dktools-lib-4.30 (>= 4.30.2), dktools-lib-data (>= 4.30.2), zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmysqlclient-dev, libpng-dev, libjpeg-dev, libopenjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev, libwxsvg-dev
+Description: DK tools - developer support
+ This package contains the DK tools developer support.
+
diff --git a/support/dktools/debian/control8.in b/support/dktools/debian/control8.in
new file mode 100644
index 0000000000..9b953c6b50
--- /dev/null
+++ b/support/dktools/debian/control8.in
@@ -0,0 +1,69 @@
+Source: dktools
+Section: misc
+Priority: optional
+Maintainer: Dirk Krause <krause.dirk@web.de>
+Build-Depends: debhelper (>= 9), autotools-dev, zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmysqlclient-dev, libpng-dev, libjpeg-dev, libopenjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev, libwxsvg-dev
+Standards-Version: 3.9.5
+Homepage: http://sourceforge.net/p/dktools/wiki/Home/
+#Vcs-Git: git://anonscm.debian.org/collab-maint/dktools.git
+#Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/dktools.git;a=summary
+
+Package: dktools
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-data (>= @VERSNO@), dktools-lib-@SOVERS@ (>= @SOVERS@.0), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmysqlclient18, libjpeg62-turbo, libpng12-0, libtiff5, libsnmp30, libssl1.0.0, libwxbase3.0-0, libwxgtk3.0-0
+Description: DK tools - runtime
+ This package contains the executable programs.
+ bmpp /wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
+ fig2lat Convert Fig to PDF+TeX
+ wximgsz Suggest new size pairs to rescale bitmap images
+ htmlbook Publish HTML like a book
+ dkct C tracing and debugging preprocessor
+ dkwxwiz Wizard to create DK tools + wxWidgets based applications
+ wxdkhtb HTB help file viewer
+ itadmin Use a MySQL database to manage your IT
+ dk-ls ls clone, configurable output column order
+ dk-fic File integrity checker
+ dk-bmm Backup media management (10 tape rotation scheme)
+ dk-blks Blocksize corrector (to pass a data stream to dd)
+ dk-eradisk Produce data stream to erase a disk or partition
+ dk-hex Show file contents in hexadecimal or octal notation
+ dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-sort sort clone, handles ASCII/UTF-8/UTF-16, unsigned/signed/float
+ dk-t2h Text to HTML conversion
+ dk-t2l Text to LaTeX conversion
+ dk-sqlsplit Split overlong SQL lines i.e. from mysqldump
+ dkdbt Convert simple databases to text and vice versa
+ dk-uid Find free user ID in given range
+ dk-pwgen Create passwords, PINs or WiFi keys
+ dk-send Send a data stream to one or multiple recipients
+ dk-recv Receive data stream from a dk-send process
+ printqd Print quota daemon for use with LPRng
+ wxpqdic GUI client to check print quota in printqd
+ addctrld Add final CTRL-D to data stream if not yet present
+ wxdkclock Simple clock with one alert
+ plpdftex Output driver for octpgfpl
+
+Package: dktools-lib-@SOVERS@
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-lib-data (>= @VERSNO@), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmysqlclient18, libjpeg62-turbo, libpng12-0, libtiff5, libsnmp30, libssl1.0.0, libwxbase3.0-0, libwxgtk3.0-0
+Description: DK tools - shared libraries
+ This package contains the shared libraries from the DK tools project.
+
+Package: dktools-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DK tools - data files
+ This package contains the data files needed by dktools.
+
+Package: dktools-lib-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DK tools - Data files for shared libraries
+ This package contains the data files for the DK tools shared libraries.
+
+Package: dktools-lib-@SOVERS@-dev
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, debhelper (>= 9), autotools-dev, dktools-lib-@SOVERS@ (>= @VERSNO@), dktools-lib-data (>= @VERSNO@), zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmysqlclient-dev, libpng-dev, libjpeg-dev, libopenjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev, libwxsvg-dev
+Description: DK tools - developer support
+ This package contains the DK tools developer support.
+
diff --git a/support/dktools/debian/control9 b/support/dktools/debian/control9
new file mode 100644
index 0000000000..fefc8f96f1
--- /dev/null
+++ b/support/dktools/debian/control9
@@ -0,0 +1,69 @@
+Source: dktools
+Section: misc
+Priority: optional
+Maintainer: Dirk Krause <krause.dirk@web.de>
+Build-Depends: debhelper (>= 9), autotools-dev, zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmariadbclient-dev, libpng-dev, libjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev
+Standards-Version: 3.9.5
+Homepage: http://sourceforge.net/p/dktools/wiki/Home/
+#Vcs-Git: git://anonscm.debian.org/collab-maint/dktools.git
+#Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/dktools.git;a=summary
+
+Package: dktools
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-data (>= 4.30.2), dktools-lib-4.30 (>= 4.30.0), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadbclient18, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5
+Description: DK tools - runtime
+ This package contains the executable programs.
+ bmpp /wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
+ fig2lat Convert Fig to PDF+TeX
+ wximgsz Suggest new size pairs to rescale bitmap images
+ htmlbook Publish HTML like a book
+ dkct C tracing and debugging preprocessor
+ dkwxwiz Wizard to create DK tools + wxWidgets based applications
+ wxdkhtb HTB help file viewer
+ itadmin Use a MySQL database to manage your IT
+ dk-ls ls clone, configurable output column order
+ dk-fic File integrity checker
+ dk-bmm Backup media management (10 tape rotation scheme)
+ dk-blks Blocksize corrector (to pass a data stream to dd)
+ dk-eradisk Produce data stream to erase a disk or partition
+ dk-hex Show file contents in hexadecimal or octal notation
+ dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-sort sort clone, handles ASCII/UTF-8/UTF-16, unsigned/signed/float
+ dk-t2h Text to HTML conversion
+ dk-t2l Text to LaTeX conversion
+ dk-sqlsplit Split overlong SQL lines i.e. from mysqldump
+ dkdbt Convert simple databases to text and vice versa
+ dk-uid Find free user ID in given range
+ dk-pwgen Create passwords, PINs or WiFi keys
+ dk-send Send a data stream to one or multiple recipients
+ dk-recv Receive data stream from a dk-send process
+ printqd Print quota daemon for use with LPRng
+ wxpqdic GUI client to check print quota in printqd
+ addctrld Add final CTRL-D to data stream if not yet present
+ wxdkclock Simple clock with one alert
+ plpdftex Output driver for octpgfpl
+
+Package: dktools-lib-4.30
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-lib-data (>= 4.30.2), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadbclient18, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5
+Description: DK tools - shared libraries
+ This package contains the shared libraries from the DK tools project.
+
+Package: dktools-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DK tools - data files
+ This package contains the data files needed by dktools.
+
+Package: dktools-lib-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DK tools - Data files for shared libraries
+ This package contains the data files for the DK tools shared libraries.
+
+Package: dktools-lib-4.30-dev
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, debhelper (>= 9), autotools-dev, dktools-lib-4.30 (>= 4.30.2), dktools-lib-data (>= 4.30.2), zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmariadbclient-dev, libpng-dev, libjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev
+Description: DK tools - developer support
+ This package contains the DK tools developer support.
+
diff --git a/support/dktools/debian/control9.in b/support/dktools/debian/control9.in
new file mode 100644
index 0000000000..6d15b91cf8
--- /dev/null
+++ b/support/dktools/debian/control9.in
@@ -0,0 +1,69 @@
+Source: dktools
+Section: misc
+Priority: optional
+Maintainer: Dirk Krause <krause.dirk@web.de>
+Build-Depends: debhelper (>= 9), autotools-dev, zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmariadbclient-dev, libpng-dev, libjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev
+Standards-Version: 3.9.5
+Homepage: http://sourceforge.net/p/dktools/wiki/Home/
+#Vcs-Git: git://anonscm.debian.org/collab-maint/dktools.git
+#Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/dktools.git;a=summary
+
+Package: dktools
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-data (>= @VERSNO@), dktools-lib-@SOVERS@ (>= @SOVERS@.0), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadbclient18, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5
+Description: DK tools - runtime
+ This package contains the executable programs.
+ bmpp /wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
+ fig2lat Convert Fig to PDF+TeX
+ wximgsz Suggest new size pairs to rescale bitmap images
+ htmlbook Publish HTML like a book
+ dkct C tracing and debugging preprocessor
+ dkwxwiz Wizard to create DK tools + wxWidgets based applications
+ wxdkhtb HTB help file viewer
+ itadmin Use a MySQL database to manage your IT
+ dk-ls ls clone, configurable output column order
+ dk-fic File integrity checker
+ dk-bmm Backup media management (10 tape rotation scheme)
+ dk-blks Blocksize corrector (to pass a data stream to dd)
+ dk-eradisk Produce data stream to erase a disk or partition
+ dk-hex Show file contents in hexadecimal or octal notation
+ dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-sort sort clone, handles ASCII/UTF-8/UTF-16, unsigned/signed/float
+ dk-t2h Text to HTML conversion
+ dk-t2l Text to LaTeX conversion
+ dk-sqlsplit Split overlong SQL lines i.e. from mysqldump
+ dkdbt Convert simple databases to text and vice versa
+ dk-uid Find free user ID in given range
+ dk-pwgen Create passwords, PINs or WiFi keys
+ dk-send Send a data stream to one or multiple recipients
+ dk-recv Receive data stream from a dk-send process
+ printqd Print quota daemon for use with LPRng
+ wxpqdic GUI client to check print quota in printqd
+ addctrld Add final CTRL-D to data stream if not yet present
+ wxdkclock Simple clock with one alert
+ plpdftex Output driver for octpgfpl
+
+Package: dktools-lib-@SOVERS@
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dktools-lib-data (>= @VERSNO@), libc6, libgcc1, libstdc++6, zlib1g, libbz2-1.0, libdb5.3, libmariadbclient18, libjpeg62-turbo, libpng16-16, libtiff5, libsnmp30, libssl1.1, libwxbase3.0-0v5, libwxgtk3.0-0v5
+Description: DK tools - shared libraries
+ This package contains the shared libraries from the DK tools project.
+
+Package: dktools-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DK tools - data files
+ This package contains the data files needed by dktools.
+
+Package: dktools-lib-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DK tools - Data files for shared libraries
+ This package contains the data files for the DK tools shared libraries.
+
+Package: dktools-lib-@SOVERS@-dev
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, debhelper (>= 9), autotools-dev, dktools-lib-@SOVERS@ (>= @VERSNO@), dktools-lib-data (>= @VERSNO@), zlib1g-dev, libbz2-dev, libssl-dev, libdb-dev, libmariadbclient-dev, libpng-dev, libjpeg-dev, libtiff-dev, libsnmp-dev, wx3.0-headers, libwxgtk3.0-dev, libwxbase3.0-dev
+Description: DK tools - developer support
+ This package contains the DK tools developer support.
+
diff --git a/support/dktools/debian/copyright b/support/dktools/debian/copyright
index 2de1bdf3ef..eec1cc64de 100644
--- a/support/dktools/debian/copyright
+++ b/support/dktools/debian/copyright
@@ -1,41 +1,33 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: dktools
-Source: http://dktools.sourceforge.net
+Source: http://sourceforge.net/p/dktools/wiki/Home/
Files: *
-Copyright: 2015 Dirk Krause <krause.dirk@web.de>
-License: BSD
- All rights reserved.
+Copyright: 2015-2019 Dirk Krause <krause.dirk@web.de>
+License: BSD-3-Clause
+ All rights reserved
.
- Redistribution and use in source and binary forms,
- with or without modification, are permitted provided
- that the following conditions are met:
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
.
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
- * Redistributions in binary form must reproduce the above
- opyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
- * Neither the name of the Dirk Krause nor the names of
- contributors may be used to endorse or promote
- products derived from this software without specific
- prior written permission.
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE.
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/support/dktools/debian/dktools-data.install b/support/dktools/debian/dktools-data.install
index e629daa95c..7d430c8dbd 100644
--- a/support/dktools/debian/dktools-data.install
+++ b/support/dktools/debian/dktools-data.install
@@ -1,4 +1 @@
-etc/dk3app
-etc/printqd
-etc/rshdown
-usr/share/dktools
+usr/local/share/dktools
diff --git a/support/dktools/debian/dktools-lib-4.8-dev.install b/support/dktools/debian/dktools-lib-4.26-dev.install
index 951b0df296..6d2a287778 100644
--- a/support/dktools/debian/dktools-lib-4.8-dev.install
+++ b/support/dktools/debian/dktools-lib-4.26-dev.install
@@ -1,3 +1,3 @@
-usr/include
+usr/include/dktools-4
usr/lib/*/lib*.so
usr/lib/*/pkgconfig/*.pc
diff --git a/support/dktools/debian/dktools-lib-4.8.install b/support/dktools/debian/dktools-lib-4.26.install
index 3ddde58419..3ddde58419 100644
--- a/support/dktools/debian/dktools-lib-4.8.install
+++ b/support/dktools/debian/dktools-lib-4.26.install
diff --git a/support/dktools/debian/dktools-lib-4.8.lintian-overrides b/support/dktools/debian/dktools-lib-4.26.lintian-overrides
index 8675979362..8675979362 100644
--- a/support/dktools/debian/dktools-lib-4.8.lintian-overrides
+++ b/support/dktools/debian/dktools-lib-4.26.lintian-overrides
diff --git a/support/dktools/debian/dktools-lib-4.27-dev.install b/support/dktools/debian/dktools-lib-4.27-dev.install
new file mode 100644
index 0000000000..6d2a287778
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.27-dev.install
@@ -0,0 +1,3 @@
+usr/include/dktools-4
+usr/lib/*/lib*.so
+usr/lib/*/pkgconfig/*.pc
diff --git a/support/dktools/debian/dktools-lib-4.27.install b/support/dktools/debian/dktools-lib-4.27.install
new file mode 100644
index 0000000000..3ddde58419
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.27.install
@@ -0,0 +1 @@
+usr/lib/*/lib*.so.*
diff --git a/support/dktools/debian/dktools-lib-4.27.lintian-overrides b/support/dktools/debian/dktools-lib-4.27.lintian-overrides
new file mode 100644
index 0000000000..8675979362
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.27.lintian-overrides
@@ -0,0 +1 @@
+package-name-doesnt-match-sonames
diff --git a/support/dktools/debian/dktools-lib-4.28-dev.install b/support/dktools/debian/dktools-lib-4.28-dev.install
new file mode 100644
index 0000000000..6d2a287778
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.28-dev.install
@@ -0,0 +1,3 @@
+usr/include/dktools-4
+usr/lib/*/lib*.so
+usr/lib/*/pkgconfig/*.pc
diff --git a/support/dktools/debian/dktools-lib-4.28.install b/support/dktools/debian/dktools-lib-4.28.install
new file mode 100644
index 0000000000..3ddde58419
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.28.install
@@ -0,0 +1 @@
+usr/lib/*/lib*.so.*
diff --git a/support/dktools/debian/dktools-lib-4.28.lintian-overrides b/support/dktools/debian/dktools-lib-4.28.lintian-overrides
new file mode 100644
index 0000000000..8675979362
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.28.lintian-overrides
@@ -0,0 +1 @@
+package-name-doesnt-match-sonames
diff --git a/support/dktools/debian/dktools-lib-4.29-dev.install b/support/dktools/debian/dktools-lib-4.29-dev.install
new file mode 100644
index 0000000000..6d2a287778
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.29-dev.install
@@ -0,0 +1,3 @@
+usr/include/dktools-4
+usr/lib/*/lib*.so
+usr/lib/*/pkgconfig/*.pc
diff --git a/support/dktools/debian/dktools-lib-4.29.install b/support/dktools/debian/dktools-lib-4.29.install
new file mode 100644
index 0000000000..3ddde58419
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.29.install
@@ -0,0 +1 @@
+usr/lib/*/lib*.so.*
diff --git a/support/dktools/debian/dktools-lib-4.29.lintian-overrides b/support/dktools/debian/dktools-lib-4.29.lintian-overrides
new file mode 100644
index 0000000000..8675979362
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.29.lintian-overrides
@@ -0,0 +1 @@
+package-name-doesnt-match-sonames
diff --git a/support/dktools/debian/dktools-lib-4.30-dev.install b/support/dktools/debian/dktools-lib-4.30-dev.install
new file mode 100644
index 0000000000..6d2a287778
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.30-dev.install
@@ -0,0 +1,3 @@
+usr/include/dktools-4
+usr/lib/*/lib*.so
+usr/lib/*/pkgconfig/*.pc
diff --git a/support/dktools/debian/dktools-lib-4.30.install b/support/dktools/debian/dktools-lib-4.30.install
new file mode 100644
index 0000000000..3ddde58419
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.30.install
@@ -0,0 +1 @@
+usr/lib/*/lib*.so.*
diff --git a/support/dktools/debian/dktools-lib-4.30.lintian-overrides b/support/dktools/debian/dktools-lib-4.30.lintian-overrides
new file mode 100644
index 0000000000..8675979362
--- /dev/null
+++ b/support/dktools/debian/dktools-lib-4.30.lintian-overrides
@@ -0,0 +1 @@
+package-name-doesnt-match-sonames
diff --git a/support/dktools/debian/dktools-lib-data.install b/support/dktools/debian/dktools-lib-data.install
index 5b3bf665e8..6e7b26d64e 100644
--- a/support/dktools/debian/dktools-lib-data.install
+++ b/support/dktools/debian/dktools-lib-data.install
@@ -1 +1,3 @@
+etc/dk3app
+etc/dk4app
usr/share/dk4app
diff --git a/support/dktools/debian/dktools-lib-dev.install.in b/support/dktools/debian/dktools-lib-dev.install.in
index 951b0df296..6d2a287778 100644
--- a/support/dktools/debian/dktools-lib-dev.install.in
+++ b/support/dktools/debian/dktools-lib-dev.install.in
@@ -1,3 +1,3 @@
-usr/include
+usr/include/dktools-4
usr/lib/*/lib*.so
usr/lib/*/pkgconfig/*.pc
diff --git a/support/dktools/debian/dktools.install b/support/dktools/debian/dktools.install
index e0b64c8aea..df2acb6b76 100644
--- a/support/dktools/debian/dktools.install
+++ b/support/dktools/debian/dktools.install
@@ -1,2 +1,3 @@
-usr/bin
-usr/share/applications/*.desktop
+usr/local/bin
+usr/local/libexec/dktools
+usr/local/share/applications/*.desktop
diff --git a/support/dktools/debian/dktools.manpages b/support/dktools/debian/dktools.manpages
index ddf7abb0d5..9ccd753921 100644
--- a/support/dktools/debian/dktools.manpages
+++ b/support/dktools/debian/dktools.manpages
@@ -2,6 +2,7 @@ man/man1/addctrld.1
man/man1/bmpp.1
man/man1/dk3info.1
man/man1/dk4info.1
+man/man1/dk-bin2c.1
man/man1/dk-blks.1
man/man1/dk-bmm.1
man/man1/dk-cat.1
@@ -12,6 +13,7 @@ man/man1/dkdbt.1
man/man1/dk-eradisk.1
man/man1/dk-fic.1
man/man1/dk-hex.1
+man/man1/dk-lines.1
man/man1/dk-ls.1
man/man1/dk-pwd.1
man/man1/dk-pwgen.1
@@ -33,24 +35,22 @@ man/man1/itadmin.1
man/man1/lprngcl.1
man/man1/pjsnmp.1
man/man1/plpdftex.1
-man/man1/printqd.1
man/man1/printqda.1
man/man1/printqdc.1
man/man1/printqdi.1
man/man1/prmonsnmp.1
-man/man1/rshdown.1
man/man1/wxbmpp.1
+man/man1/wxd2lat.1
man/man1/wxdkclock.1
-man/man1/wxdkct.1
+man/man1/wxdkdraw.1
man/man1/wxdkfcs.1
man/man1/wxdkhtb.1
man/man1/wximgsz.1
man/man1/wxpqdic.1
+man/man5/dk3paper.conf.5
+man/man5/dk4gra.conf.5
man/man5/dkct.5
man/man5/dkct-wxgui.5
man/man5/htmlbook-project.5
man/man5/htmlbook-template.5
man/man5/htmlbook-text.5
-man/man5/printqd.conf.5
-man/man5/printqd.db.5
-man/man5/printqd.protocol.5
diff --git a/support/dktools/debian/dktools-lib.postinst.in b/support/dktools/debian/postinst
index 73da26cc9f..dd381656e8 100644
--- a/support/dktools/debian/dktools-lib.postinst.in
+++ b/support/dktools/debian/postinst
@@ -20,22 +20,10 @@ set -e
case "$1" in
configure)
- # ##### LINUX DISTRIBUTION PACKAGERS #####
- # ##### If your distribution contains the LPRng software, please
- # ##### check LPUSER and LPGROUP to meet the user and group used
- # ##### to run the LPRng lpd daemon on your distribution.
- # ##### Correct the lines if necessary.
- #
- LPUSER="daemon"
- LPGROUP="daemon"
- #
- # #####
- for i in /var/run/printqd /var/log/printqd /var/printqd
- do
- [ -d $i ] || mkdir $i
- chown -R ${LPUSER}:${LPGROUP} $i
- chmod 770 $i
- done
+ xdg-mime install --mode system /usr/share/dktools/mime/dkrause-wxdkdraw.xml
+ xdg-icon-resource install --mode system --context mimetypes --size 64 /usr/share/dktools/mime/wxdkdraw_64.png image-x-wxdkdraw
+ update-mime-database /usr/share/mime
+ update-desktop-database /usr/share/applications
;;
abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/support/dktools/debian/prerm b/support/dktools/debian/prerm
new file mode 100644
index 0000000000..bb1326a8ce
--- /dev/null
+++ b/support/dktools/debian/prerm
@@ -0,0 +1,42 @@
+#!/bin/sh
+# prerm script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ xdg-mime uninstall --mode system /usr/share/dktools/mime/dkrause-wxdkdraw.xml
+ xdg-icon-resource uninstall --mode system --context mimetypes --size 64 image-x-wxdkdraw
+ update-mime-database /usr/share/mime
+ update-desktop-database /usr/share/applications
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/support/dktools/debian/printqd.install b/support/dktools/debian/printqd.install
new file mode 100644
index 0000000000..0b55498ef9
--- /dev/null
+++ b/support/dktools/debian/printqd.install
@@ -0,0 +1,4 @@
+usr/local/sbin/printqd
+usr/local/etc/printqd/printqd.conf
+usr/local/etc/printqd/printqd.conf.sample
+lib/systemd/system/printqd.service
diff --git a/support/dktools/debian/printqd.lintian-overrides b/support/dktools/debian/printqd.lintian-overrides
new file mode 100644
index 0000000000..79bd451a60
--- /dev/null
+++ b/support/dktools/debian/printqd.lintian-overrides
@@ -0,0 +1 @@
+maintainer-script-empty
diff --git a/support/dktools/debian/printqd.manpages b/support/dktools/debian/printqd.manpages
new file mode 100644
index 0000000000..27484824d6
--- /dev/null
+++ b/support/dktools/debian/printqd.manpages
@@ -0,0 +1,4 @@
+man/man1/printqd.1
+man/man5/printqd.conf.5
+man/man5/printqd.db.5
+man/man5/printqd.protocol.5
diff --git a/support/dktools/debian/printqd.postinst b/support/dktools/debian/printqd.postinst
new file mode 100644
index 0000000000..9522a12df2
--- /dev/null
+++ b/support/dktools/debian/printqd.postinst
@@ -0,0 +1,64 @@
+#!/bin/sh
+# postinst script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+prefix=/usr/local
+sysconfdir=${prefix}/etc
+localstatedir=${prefix}/var
+runstatedir=${localstatedir}/run
+LPRNGUSER=daemon
+LPRNGGROUP=lp
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+ if [ ! -d ${localstatedir}/log/printqd ]
+ then
+ mkdir -p ${localstatedir}/log/printqd
+ chown ${LPRNGUSER}:${LPRNGGROUP} ${localstatedir}/log/printqd
+ chmod 775 ${localstatedir}/log/printqd
+ fi
+ if [ ! -d ${localstatedir}/lib/printqd ]
+ then
+ mkdir -p ${localstatedir}/lib/printqd
+ chown ${LPRNGUSER}:${LPRNGGROUP} ${localstatedir}/lib/printqd
+ chmod 775 ${localstatedir}/lib/printqd
+ fi
+ if [ ! -d /run/printqd ]
+ then
+ mkdir -p /run/printqd
+ chown ${LPRNGUSER}:${LPRNGGROUP} /run/printqd
+ chmod 775 /run/printqd
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/support/dktools/debian/printqd.postinst.in b/support/dktools/debian/printqd.postinst.in
new file mode 100644
index 0000000000..887a9f31be
--- /dev/null
+++ b/support/dktools/debian/printqd.postinst.in
@@ -0,0 +1,64 @@
+#!/bin/sh
+# postinst script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+prefix=@prefix@
+sysconfdir=@sysconfdir@
+localstatedir=@localstatedir@
+runstatedir=@runstatedir@
+LPRNGUSER=@LPRNGUSER@
+LPRNGGROUP=@LPRNGGROUP@
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+ if [ ! -d ${localstatedir}/log/printqd ]
+ then
+ mkdir -p ${localstatedir}/log/printqd
+ chown ${LPRNGUSER}:${LPRNGGROUP} ${localstatedir}/log/printqd
+ chmod 775 ${localstatedir}/log/printqd
+ fi
+ if [ ! -d ${localstatedir}/lib/printqd ]
+ then
+ mkdir -p ${localstatedir}/lib/printqd
+ chown ${LPRNGUSER}:${LPRNGGROUP} ${localstatedir}/lib/printqd
+ chmod 775 ${localstatedir}/lib/printqd
+ fi
+ if [ ! -d /run/printqd ]
+ then
+ mkdir -p /run/printqd
+ chown ${LPRNGUSER}:${LPRNGGROUP} /run/printqd
+ chmod 775 /run/printqd
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/support/dktools/debian/printqd.postrm b/support/dktools/debian/printqd.postrm
new file mode 100644
index 0000000000..19b5940128
--- /dev/null
+++ b/support/dktools/debian/printqd.postrm
@@ -0,0 +1,62 @@
+#!/bin/sh
+# postrm script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+prefix=/usr/local
+sysconfdir=${prefix}/etc
+localstatedir=${prefix}/var
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+case "$1" in
+ purge)
+ if [ -d /run/printqd ]
+ then
+ rm -fr /run/printqd
+ fi
+ if [ -d ${sysconfdir}/printqd ]
+ then
+ rm -fr ${sysconfdir}/printqd
+ fi
+ if [ -d ${localstatedir}/log/printqd ]
+ then
+ echo 'I: Directory' ${localstatedir}/log/printqd 'not deleted.'
+ fi
+ if [ -d ${localstatedir}/lib/printqd ]
+ then
+ echo 'I: Directory' ${localstatedir}/lib/printqd 'not deleted.'
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/support/dktools/debian/printqd.postrm.in b/support/dktools/debian/printqd.postrm.in
new file mode 100644
index 0000000000..91bd504cc3
--- /dev/null
+++ b/support/dktools/debian/printqd.postrm.in
@@ -0,0 +1,62 @@
+#!/bin/sh
+# postrm script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+prefix=@prefix@
+sysconfdir=@sysconfdir@
+localstatedir=@localstatedir@
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+case "$1" in
+ purge)
+ if [ -d /run/printqd ]
+ then
+ rm -fr /run/printqd
+ fi
+ if [ -d ${sysconfdir}/printqd ]
+ then
+ rm -fr ${sysconfdir}/printqd
+ fi
+ if [ -d ${localstatedir}/log/printqd ]
+ then
+ echo 'I: Directory' ${localstatedir}/log/printqd 'not deleted.'
+ fi
+ if [ -d ${localstatedir}/lib/printqd ]
+ then
+ echo 'I: Directory' ${localstatedir}/lib/printqd 'not deleted.'
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/support/dktools/debian/printqd.preinst b/support/dktools/debian/printqd.preinst
new file mode 100644
index 0000000000..857fd08339
--- /dev/null
+++ b/support/dktools/debian/printqd.preinst
@@ -0,0 +1,35 @@
+#!/bin/sh
+# preinst script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <new-preinst> `install'
+# * <new-preinst> `install' <old-version>
+# * <new-preinst> `upgrade' <old-version>
+# * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ install|upgrade)
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/support/dktools/debian/printqd.prerm b/support/dktools/debian/printqd.prerm
new file mode 100644
index 0000000000..333430eb29
--- /dev/null
+++ b/support/dktools/debian/printqd.prerm
@@ -0,0 +1,38 @@
+#!/bin/sh
+# prerm script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/support/dktools/debian/printqd.printqd.service b/support/dktools/debian/printqd.printqd.service
new file mode 100644
index 0000000000..473be26ea4
--- /dev/null
+++ b/support/dktools/debian/printqd.printqd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Print quota daemon
+After=network.target
+StartLimitIntervalSec=10
+Documentation=man:printqd(1) man:printqd.protocol(5)
+
+[Service]
+Type=forking
+ExecStart=/usr/local/sbin/printqd
+Restart=always
+RestartSec=2
+PIDFile=/run/printqd/printqd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/support/dktools/debian/rshdown.install b/support/dktools/debian/rshdown.install
new file mode 100644
index 0000000000..b765d0a488
--- /dev/null
+++ b/support/dktools/debian/rshdown.install
@@ -0,0 +1,5 @@
+usr/local/sbin/rshdown
+usr/local/sbin/rshdown-init
+usr/local/etc/rshdown/rshdown.conf
+usr/local/etc/rshdown/rshdown.conf.sample
+lib/systemd/system/rshdown.service
diff --git a/support/dktools/debian/rshdown.lintian-overrides b/support/dktools/debian/rshdown.lintian-overrides
new file mode 100644
index 0000000000..79bd451a60
--- /dev/null
+++ b/support/dktools/debian/rshdown.lintian-overrides
@@ -0,0 +1 @@
+maintainer-script-empty
diff --git a/support/dktools/debian/rshdown.manpages b/support/dktools/debian/rshdown.manpages
new file mode 100644
index 0000000000..cb8ebd99f1
--- /dev/null
+++ b/support/dktools/debian/rshdown.manpages
@@ -0,0 +1,2 @@
+man/man1/rshdown.1
+man/man1/rshdown-init.1
diff --git a/support/dktools/debian/dktools-lib-4.8.postinst b/support/dktools/debian/rshdown.postinst
index 73da26cc9f..9395e5b011 100644
--- a/support/dktools/debian/dktools-lib-4.8.postinst
+++ b/support/dktools/debian/rshdown.postinst
@@ -20,22 +20,6 @@ set -e
case "$1" in
configure)
- # ##### LINUX DISTRIBUTION PACKAGERS #####
- # ##### If your distribution contains the LPRng software, please
- # ##### check LPUSER and LPGROUP to meet the user and group used
- # ##### to run the LPRng lpd daemon on your distribution.
- # ##### Correct the lines if necessary.
- #
- LPUSER="daemon"
- LPGROUP="daemon"
- #
- # #####
- for i in /var/run/printqd /var/log/printqd /var/printqd
- do
- [ -d $i ] || mkdir $i
- chown -R ${LPUSER}:${LPGROUP} $i
- chmod 770 $i
- done
;;
abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/support/dktools/debian/dktools-lib.postrm.in b/support/dktools/debian/rshdown.postrm
index 783d414cdc..b5c938533f 100644
--- a/support/dktools/debian/dktools-lib.postrm.in
+++ b/support/dktools/debian/rshdown.postrm
@@ -5,6 +5,10 @@
set -e
+prefix=/usr/local
+sysconfdir=${prefix}/etc
+localstatedir=${prefix}/var
+
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
@@ -20,17 +24,7 @@ set -e
case "$1" in
- remove)
- [ ! -d /var/run/printqd ] || rm -fr /var/run/printqd
- [ ! -d /var/log/printqd ] || rm -fr /var/log/printqd
- ;;
- purge)
- [ ! -d /var/run/printqd ] || rm -fr /var/run/printqd
- [ ! -d /var/log/printqd ] || rm -fr /var/log/printqd
- [ ! -d /etc/printqd ] || rm -fr /etc/printqd
- [ ! -d /var/printqd ] || rm -fr /var/printqd
- ;;
- upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
@@ -44,4 +38,17 @@ esac
#DEBHELPER#
+case "$1" in
+ purge)
+ if [ -d /run/rshdown ]
+ then
+ rm -fr /run/rshdown
+ fi
+ if [ -d ${sysconfdir}/rshdown ]
+ then
+ rm -fr ${sysconfdir}/rshdown
+ fi
+ ;;
+esac
+
exit 0
diff --git a/support/dktools/debian/dktools-lib-4.8.postrm b/support/dktools/debian/rshdown.postrm.in
index 783d414cdc..fdbdcc0692 100644
--- a/support/dktools/debian/dktools-lib-4.8.postrm
+++ b/support/dktools/debian/rshdown.postrm.in
@@ -5,6 +5,10 @@
set -e
+prefix=@prefix@
+sysconfdir=@sysconfdir@
+localstatedir=@localstatedir@
+
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
@@ -20,17 +24,7 @@ set -e
case "$1" in
- remove)
- [ ! -d /var/run/printqd ] || rm -fr /var/run/printqd
- [ ! -d /var/log/printqd ] || rm -fr /var/log/printqd
- ;;
- purge)
- [ ! -d /var/run/printqd ] || rm -fr /var/run/printqd
- [ ! -d /var/log/printqd ] || rm -fr /var/log/printqd
- [ ! -d /etc/printqd ] || rm -fr /etc/printqd
- [ ! -d /var/printqd ] || rm -fr /var/printqd
- ;;
- upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
@@ -44,4 +38,17 @@ esac
#DEBHELPER#
+case "$1" in
+ purge)
+ if [ -d /run/rshdown ]
+ then
+ rm -fr /run/rshdown
+ fi
+ if [ -d ${sysconfdir}/rshdown ]
+ then
+ rm -fr ${sysconfdir}/rshdown
+ fi
+ ;;
+esac
+
exit 0
diff --git a/support/dktools/debian/rshdown.preinst b/support/dktools/debian/rshdown.preinst
new file mode 100644
index 0000000000..857fd08339
--- /dev/null
+++ b/support/dktools/debian/rshdown.preinst
@@ -0,0 +1,35 @@
+#!/bin/sh
+# preinst script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <new-preinst> `install'
+# * <new-preinst> `install' <old-version>
+# * <new-preinst> `upgrade' <old-version>
+# * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ install|upgrade)
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/support/dktools/debian/rshdown.prerm b/support/dktools/debian/rshdown.prerm
new file mode 100644
index 0000000000..333430eb29
--- /dev/null
+++ b/support/dktools/debian/rshdown.prerm
@@ -0,0 +1,38 @@
+#!/bin/sh
+# prerm script for dktools
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/support/dktools/debian/rshdown.rshdown.service b/support/dktools/debian/rshdown.rshdown.service
new file mode 100644
index 0000000000..798152cbf5
--- /dev/null
+++ b/support/dktools/debian/rshdown.rshdown.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Remote shutdown daemon
+After=network.target
+StartLimitIntervalSec=10
+Documentation=man:rshdown(1)
+
+[Service]
+Type=forking
+ExecStartPre=/usr/local/sbin/rshdown-init
+ExecStart=/usr/local/sbin/rshdown
+Restart=always
+RestartSec=2
+PIDFile=/run/rshdown/rshdown.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/support/dktools/debian/rules b/support/dktools/debian/rules
index b079e9cb56..845db25b97 100644..100755
--- a/support/dktools/debian/rules
+++ b/support/dktools/debian/rules
@@ -5,10 +5,11 @@ DH_VERBOSE = 1
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/default.mk
+# include /usr/share/dpkg/default.mk
+include /usr/share/dpkg/buildflags.mk
# see FEATURE AREAS in dpkg-buildflags(1)
-#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
@@ -16,10 +17,13 @@ include /usr/share/dpkg/default.mk
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+export DH_OPTIONS
+# Removed --with autotools-dev from rule below
# main packaging script based on dh7 syntax
+# dh $@ --parallel --with systemd
%:
- dh $@ --with autotools-dev
+ dh $@ --parallel --with systemd
# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
@@ -30,4 +34,5 @@ include /usr/share/dpkg/default.mk
override_dh_auto_configure:
- dh_auto_configure -- --enable-packaging
+ dh_auto_configure -- --enable-packaging --disable-man-pages --disable-services --with-systemd=/lib/systemd/system
+
diff --git a/support/dktools/debian/upstream/metadata b/support/dktools/debian/upstream/metadata
new file mode 100644
index 0000000000..1de86e9db3
--- /dev/null
+++ b/support/dktools/debian/upstream/metadata
@@ -0,0 +1,6 @@
+Archive: SourceForge
+Bug-Submit: https://sourceforge.net/p/dktools/discussion/
+Changelog: https://sourceforge.net/p/dktools/wiki/change%20log/
+Documentation: https://sourceforge.net/p/dktools/wiki/Home/
+Repository: https://sourceforge.net/projects/dktools/files/dktools/
+Security: https://sourceforge.net/p/dktools/discussion/
diff --git a/support/dktools/dk-bin2c.c b/support/dktools/dk-bin2c.c
new file mode 100644
index 0000000000..8daed166cc
--- /dev/null
+++ b/support/dktools/dk-bin2c.c
@@ -0,0 +1,1208 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-bin2c.ctr
+*/
+
+
+#line 10 "dk-bin2c.ctr"
+
+/** @file dk-bin2c The dk-bin2c program.
+ See dk_bin2c_help_text for details.
+*/
+
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_UNISTD_H
+#ifndef UNISTD_H_INCLUDED
+#include <unistd.h>
+#define UNISTD_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_SYS_TYPES_H
+#ifndef SYS_TYPES_H_INCLUDED
+#include <sys/types.h>
+#define SYS_TYPES_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_SIGNAL_H
+#ifndef SIGNAL_H_INCLUDED
+#include <signal.h>
+#define SIGNAL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_PROCESS_H
+#ifndef PROCESS_H_INCLUDED
+#include <process.h>
+#define PROCESS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4types.h"
+#include "dk4const.h"
+#include "dk4mem.h"
+#include "dk4app.h"
+#include "dk4aopt.h"
+#include "dk4fopda.h"
+#include "dk4fput.h"
+#include "dk4vers.h"
+#include "dk4mpl.h"
+#include "dk4unused.h"
+#include "dk4str8.h"
+#include "dk4strw.h"
+#include "dk4strd.h"
+#include "dk4pathd.h"
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
+
+
+
+#line 97 "dk-bin2c.ctr"
+
+
+
+/** Buffer for data from file.
+*/
+static unsigned char buffer[4096];
+
+
+
+/** Localized dkChar text fragments, overwritten by string table if found.
+*/
+static const dkChar * const dk_bin2c_kw_def[] = {
+/* 0 */
+dkT("Failed to set up signal handlers!"),
+
+/* 1 */
+dkT("Failed to restore signal handlers!"),
+
+/* 2 */
+dkT("Path or file name too long!"),
+
+/* 3 */
+dkT("Path too long!"),
+
+/* 4 */
+dkT("No matching file found!"),
+
+/* 5 */
+dkT("Interrupted by SIGINT!"),
+
+/* 6 */
+dkT("Interrupted by SIGTERM!"),
+
+/* 7 */
+dkT("Interrupted by SIGPIPE!"),
+
+/* 8 */
+dkT("Failed to write to stdout!"),
+
+NULL
+
+
+#line 147 "dk-bin2c.ctr"
+};
+
+
+
+/** Constant text fragments, not localized.
+*/
+static const dkChar * const dk_bin2c_kwnl[] = {
+/* 0 */
+dkT("dktools"),
+
+/* 1 */
+dkT("dk-bin2c.txt"),
+
+/* 2 */
+dkT("dk-bin2c.str"),
+
+/* 3 */
+dkT("rb"),
+
+/* 4 */
+dkT("\\"),
+
+/* 5 */
+dkT("<STDIN>"),
+
+NULL
+
+
+#line 183 "dk-bin2c.ctr"
+};
+
+
+
+/** Help text shown by --help option.
+*/
+static const dkChar * const dk_bin2c_help_text[] = {
+dkT(""),
+dkT("dk-bin2c - Convert binary data to C source code"),
+dkT(""),
+dkT("dk-bin2c [<options>] [<file(s)>]"),
+dkT(""),
+dkT("Options:"),
+dkT("-o --octal Octal output (default: hexadecimal)."),
+dkT("-i <uint> --indent=<uint> Indent (spaces at start of line)."),
+dkT("-s <uint> --spaces=<uint> Spaces between items on line."),
+dkT("-b <uint> --bytes-per-line=<uint> Number of bytes to print per line."),
+dkT("--help Show help text."),
+dkT("--manual *** SHOW FULL MANUAL. ***"),
+dkT("--version Show version information."),
+dkT("--license Show license information."),
+dkT(""),
+NULL
+
+
+#line 207 "dk-bin2c.ctr"
+};
+
+
+
+/** License text shown by --license option.
+*/
+static const dkChar * const dk_bin2c_license_text[] = {
+dkT(""),
+dkT("This software uses code from the following projects, either directly or as"),
+dkT("a library:"),
+dkT(""),
+dkT("dktools\t\tDirk Krause's tools and libraries."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
+#if DK4_HAVE_ZLIB_H
+dkT(""),
+dkT("zlib\t\tData compression library."),
+dkT("\t\tSee http://www.zlib.net/ for more information."),
+#endif
+#if DK4_HAVE_BZLIB_H
+dkT(""),
+dkT("bzip2\t\tData compression program and library."),
+dkT("\t\tSee http://www.bzip.org/ for more information."),
+#endif
+dkT(""),
+dkT("All the licenses below apply to the program."),
+dkT("Licenses for used libraries are shown as found on my Scientific Linux 6.x"),
+dkT("computer in the /usr/share/doc directory on 2015-04-01. Check the project"),
+dkT("homepages of the used libraries for additional information and/or updated"),
+dkT("license terms."),
+dkT(""),
+dkT(""),
+dkT("DK tools and libraries license"),
+dkT("=============================="),
+dkT("Copyright (c) 2015-2019, Dirk Krause. All rights reserved."),
+dkT(""),
+dkT("Redistribution and use in source and binary forms, with or without"),
+dkT("modification, are permitted provided that the following conditions are met:"),
+dkT(""),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
+dkT(""),
+#if DK4_HAVE_ZLIB_H
+dkT(""),
+dkT(""),
+dkT("Zlib license"),
+dkT("============"),
+dkT("(C) 1995-2004 Jean-loup Gailly and Mark Adler"),
+dkT(""),
+dkT("This software is provided 'as-is', without any express or implied"),
+dkT("warranty. In no event will the authors be held liable for any damages"),
+dkT("arising from the use of this software."),
+dkT(""),
+dkT("Permission is granted to anyone to use this software for any purpose,"),
+dkT("including commercial applications, and to alter it and redistribute it"),
+dkT("freely, subject to the following restrictions:"),
+dkT(""),
+dkT("1. The origin of this software must not be misrepresented; you must not"),
+dkT(" claim that you wrote the original software. If you use this software"),
+dkT(" in a product, an acknowledgment in the product documentation would be"),
+dkT(" appreciated but is not required."),
+dkT("2. Altered source versions must be plainly marked as such, and must not be"),
+dkT(" misrepresented as being the original software."),
+dkT("3. This notice may not be removed or altered from any source distribution."),
+dkT(""),
+dkT("Jean-loup Gailly Mark Adler"),
+dkT("jloup@gzip.org madler@alumni.caltech.edu"),
+#endif
+#if DK4_HAVE_BZLIB_H
+dkT(""),
+dkT(""),
+dkT("Bzip2 and libbzip2 library license"),
+dkT("=================================="),
+dkT("This program, \"bzip2\", the associated library \"libbzip2\", and all"),
+dkT("documentation, are copyright (C) 1996-2007 Julian R Seward. All"),
+dkT("rights reserved."),
+dkT(""),
+dkT("Redistribution and use in source and binary forms, with or without"),
+dkT("modification, are permitted provided that the following conditions"),
+dkT("are met:"),
+dkT(""),
+dkT("1. Redistributions of source code must retain the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer."),
+dkT(""),
+dkT("2. The origin of this software must not be misrepresented; you must "),
+dkT(" not claim that you wrote the original software. If you use this "),
+dkT(" software in a product, an acknowledgment in the product "),
+dkT(" documentation would be appreciated but is not required."),
+dkT(""),
+dkT("3. Altered source versions must be plainly marked as such, and must"),
+dkT(" not be misrepresented as being the original software."),
+dkT(""),
+dkT("4. The name of the author may not be used to endorse or promote "),
+dkT(" products derived from this software without specific prior written "),
+dkT(" permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS"),
+dkT("OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED"),
+dkT("WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
+dkT("ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
+dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE"),
+dkT("GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS"),
+dkT("INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,"),
+dkT("WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
+dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS"),
+dkT("SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT(""),
+dkT("Julian Seward, jseward@bzip.org"),
+dkT("bzip2/libbzip2 version 1.0.5 of 10 December 2007"),
+#endif
+dkT(""),
+NULL
+
+
+#line 340 "dk-bin2c.ctr"
+};
+
+
+
+/** Program options.
+*/
+static const dk4_option_specification_t dk_bin2c_options[] = {
+ { dkT('o'), dkT("octal"), DK4_OPT_ARG_NONE },
+ { dkT('i'), dkT("indent"), DK4_OPT_ARG_UNSIGNED },
+ { dkT('s'), dkT("spaces"), DK4_OPT_ARG_UNSIGNED },
+ { dkT('b'), dkT("bytes-per-line"), DK4_OPT_ARG_UNSIGNED },
+ { dkT('v'), dkT("verbose"), DK4_OPT_ARG_NONE }
+};
+
+
+
+/** Array of localized message text fragments.
+*/
+static const dkChar * const *dk_bin2c_msg = dk_bin2c_kw_def;
+
+
+
+/** Indent at beginning of lines.
+*/
+static dk4_um_t indent = (dk4_um_t)0UL;
+
+
+
+/** Number of spaces between items.
+*/
+static dk4_um_t spaces = (dk4_um_t)0UL;
+
+
+
+/** Number of bytes t print per line.
+*/
+static dk4_um_t bpl = (dk4_um_t)15UL;
+
+
+
+/** Current position in line.
+*/
+static dk4_um_t position = (dk4_um_t)0UL;
+
+
+
+/** Number of options in the options array.
+*/
+static size_t const sz_dk_bin2c_options =
+sizeof(dk_bin2c_options)/sizeof(dk4_option_specification_t);
+
+
+
+/** Number of elements in localized text fragments array.
+*/
+static size_t dk_bin2c_sz_msg =
+sizeof(dk_bin2c_kw_def)/sizeof(DK4_PCDKCHAR) - 1;
+
+
+
+/** Size of input buffer.
+*/
+static size_t const sz_buffer = sizeof(buffer);
+
+
+
+/** Produce octal output instead of hexadecimal output.
+*/
+static int octal = 0;
+
+
+
+/** Verbose mode, issue extra diagnostics.
+*/
+static int verbose = 0;
+
+
+
+/** Exit status code returned by the program.
+*/
+static int exval = EXIT_FAILURE;
+
+
+
+/** Flag: Output error occured in printf(), fputs() or fputc().
+*/
+static int output_error = 0;
+
+
+
+/** Flag: Already found data.
+*/
+static int have_data = 0;
+
+
+
+/** Application structure for diagnostics.
+*/
+static dk4_app_t *app = NULL;
+
+
+
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+
+
+
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
+
+
+
+/** Indicator: SIGTERM signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+
+
+
+/** Pass a volatile pointer to an atomic integer.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ptr Address of atomic integer variable.
+ @return The unmodified pointer.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
+{
+ return ptr;
+}
+
+
+
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
+*/
+static
+void
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
+}
+#endif
+
+
+
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
+static
+void
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
+}
+
+
+
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
+*/
+static
+void
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
+}
+
+
+
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
+
+
+
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
+*/
+static
+int
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
+{
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
+}
+
+
+
+/** Process one file contents.
+ @param fipo Input file, opened for binary reading.
+ @param infname Name of the file to process.
+*/
+static
+void
+dk_bin2c_process_file(FILE *fipo)
+{
+ char buf[32]; /* Buffer for byte representation */
+ dk4_um_t iu; /* Count spaces */
+ size_t rdb; /* Number of bytes read from file */
+ size_t i; /* Index to traverse bytes in buffer */
+ int cc = 1; /* Flag: Can continue */
+
+
+#line 585 "dk-bin2c.ctr"
+ while ((1 == cc) && (0 != sig_can_continue(1))) {
+ rdb = fread(buffer, 1, sz_buffer, fipo);
+ if (0 < rdb) {
+ for (i = 0; ((i < rdb) && (0 != sig_can_continue(1))); i++) {
+ if (0 != have_data) {
+ if (EOF == fputc(',', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ if (position >= bpl) {
+ position = (dk4_um_t)0UL;
+ if (EOF == fputc('\n', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ for (iu = (dk4_um_t)0UL; iu < indent; iu++) {
+ if (EOF == fputc(' ', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ }
+ }
+ else {
+ for (iu = (dk4_um_t)0UL; iu < spaces; iu++) {
+ if (EOF == fputc(' ', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ }
+ }
+ }
+ else {
+ for (iu = (dk4_um_t)0UL; iu < indent; iu++) {
+ if (EOF == fputc(' ', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ }
+ }
+ if (0 != octal) {
+ sprintf(buf, "0%03o", (unsigned)(buffer[i]));
+ }
+ else {
+ sprintf(buf, "0x%02x", (unsigned)(buffer[i]));
+ }
+ if (EOF == fputs(buf, stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ have_data = 1;
+ position++;
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+
+
+#line 643 "dk-bin2c.ctr"
+}
+
+
+
+/** Run as pipe, process standard input.
+*/
+static
+void
+dk_bin2c_process_stdin(void)
+{
+#if DK4_ON_WINDOWS
+ int oldmode;
+#endif
+
+
+#line 657 "dk-bin2c.ctr"
+#if DK4_ON_WINDOWS
+ oldmode = _setmode(_fileno(stdin), _O_BINARY);
+#endif
+ dk_bin2c_process_file(stdin);
+#if DK4_ON_WINDOWS
+ _setmode(_fileno(stdin), oldmode);
+#endif
+
+
+#line 665 "dk-bin2c.ctr"
+}
+
+
+
+/** Process one file name.
+ @param infname Input file name (real file name, no expansion).
+*/
+static
+void
+dk_bin2c_process_file_name(const dkChar *infname)
+{
+ FILE *fipo;
+ dkChar const *oldsourcefile; /* Source file name */
+ dk4_um_t oldsourceline; /* Source line number */
+ int tests = DK4_FOPEN_SC_IS_REGULAR;
+
+
+#line 681 "dk-bin2c.ctr"
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, infname);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ fipo = dk4fopen_app(infname, dk_bin2c_kwnl[3], tests, app);
+ if (NULL != fipo) {
+ dk_bin2c_process_file(fipo);
+ fclose(fipo);
+ }
+ else {
+ exval = EXIT_FAILURE;
+ }
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+
+
+#line 696 "dk-bin2c.ctr"
+}
+
+
+
+#if DK4_ON_WINDOWS
+
+/** Expand one file name.
+ @param pattern Input file name pattern containing wildcards.
+*/
+static
+void
+dk_bin2c_expand_and_process(const dkChar *pattern)
+{
+ dkChar buf[DK4_MAX_PATH]; /* Buffer to construct file name */
+ dk4_dir_t *fne; /* File name expander */
+ dkChar const *shf; /* Short file name */
+ dkChar const *pth; /* Path name */
+ dkChar const *oldsourcefile; /* Source file name */
+ dk4_um_t oldsourceline; /* Source line number */
+ size_t szbuf; /* Size of buffer */
+ int cc; /* Flag: Can continue */
+ int res; /* String concat result */
+ int found; /* Flag: File(s) found */
+
+
+#line 720 "dk-bin2c.ctr"
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, pattern);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ found = 0;
+ szbuf = DK4_SIZEOF(buf,dkChar);
+ fne = dk4app_fne_open(pattern, app);
+ if (NULL != fne) {
+ cc = 1;
+ while ((1 == cc) && (sig_can_continue(1))) {
+ shf = dk4dir_next_file(fne);
+ if (NULL != shf) {
+ found = 1;
+ pth = dk4dir_get_path(fne);
+ if (NULL != pth) {
+ /*
+ Construct full file name in buf,
+ process this file name
+ */
+ res = dk4str_cpy_s(buf, szbuf, pth, NULL);
+ if (0 != res) {
+ res = dk4str_cat_s(buf, szbuf, dk_bin2c_kwnl[4], NULL);
+ if (0 != res) {
+ res = dk4str_cat_s(buf, szbuf, shf, NULL);
+ if (0 != res) {
+ dk_bin2c_process_file_name(buf);
+ }
+ else {
+ /* ERROR: Path or file name too long */
+ dk4app_log_1(
+ app, dk_bin2c_msg, dk_bin2c_sz_msg,
+ DK4_LL_ERROR, 2
+ );
+ exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /* ERROR: Path too long */
+ exval = EXIT_FAILURE;
+ dk4app_log_1(
+ app, dk_bin2c_msg, dk_bin2c_sz_msg,
+ DK4_LL_ERROR, 3
+ );
+ }
+ }
+ else {
+ /* ERROR: Path too long */
+ dk4app_log_1(
+ app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 3
+ );
+ exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /*
+ No path specified, process short file name as is
+ */
+ dk_bin2c_process_file_name(shf);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(fne);
+ if (0 == found) {
+ /* ERROR: No matching file found */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 4);
+ exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /* ERROR: Failed to open file name expander */
+ exval = EXIT_FAILURE;
+ }
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+
+
+#line 798 "dk-bin2c.ctr"
+}
+
+#endif
+
+
+
+/** Process one file name.
+ @param infname File name to process, may be a pattern with wildcards.
+*/
+static
+void
+dk_bin2c_process_one_argv(const dkChar *infname)
+{
+
+
+#line 812 "dk-bin2c.ctr"
+#if DK4_ON_WINDOWS
+ if (0 != dk4path_must_expand(infname)) {
+ dk_bin2c_expand_and_process(infname);
+ }
+ else {
+#endif
+ dk_bin2c_process_file_name(infname);
+#if DK4_ON_WINDOWS
+ }
+#endif
+
+
+#line 823 "dk-bin2c.ctr"
+}
+
+
+
+/** Run functionality after setting up signal handlers.
+*/
+static
+void
+dk_bin2c_normal_run(void)
+{
+ int argc; /* Number of command line arguments */
+ int i; /* Current command line argument index */
+
+
+#line 836 "dk-bin2c.ctr"
+ /*
+ Indicate success so far
+ */
+ exval = EXIT_SUCCESS;
+ /*
+ Process command line arguments
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('o'), NULL)) {
+ octal = 1;
+ }
+ if (0 != dk4app_opt_is_set_short(app, dkT('v'), NULL)) {
+ verbose = 1;
+ }
+ if (0 != dk4app_opt_is_set_short(app, dkT('i'), NULL)) {
+ if (0 == dk4app_opt_get_unsigned_short(&indent, app, dkT('i'), NULL)) {
+ indent = (dk4_um_t)0UL;
+ }
+ }
+ if (0 != dk4app_opt_is_set_short(app, dkT('s'), NULL)) {
+ if (0 == dk4app_opt_get_unsigned_short(&spaces, app, dkT('s'), NULL)) {
+ spaces = (dk4_um_t)0UL;
+ }
+ }
+ if (0 != dk4app_opt_is_set_short(app, dkT('b'), NULL)) {
+ if (0 == dk4app_opt_get_unsigned_short(&bpl, app, dkT('b'), NULL)) {
+ bpl = (dk4_um_t)15UL;
+ }
+ }
+ /*
+ Start normal processing
+ */
+ argc = dk4app_get_argc(app);
+ if (0 < argc) {
+ /*
+ Process named files
+ */
+ for (i = 0; ((i < argc) && (0 != sig_can_continue(1))); i++) {
+ dk_bin2c_process_one_argv(dk4app_get_argv(app, i));
+ }
+ }
+ else {
+ /*
+ Process standard input
+ */
+ dk_bin2c_process_stdin();
+ }
+ if (0 != have_data) {
+ if (EOF == fputc('\n', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ }
+
+
+#line 889 "dk-bin2c.ctr"
+}
+
+
+
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
+*/
+static
+void
+dk_bin2c_run_with_signal_handlers(void)
+{
+#ifdef SIGPIPE
+ struct sigaction opipe;
+ struct sigaction npipe;
+#endif
+ struct sigaction oint;
+ struct sigaction nint;
+ struct sigaction oterm;
+ struct sigaction nterm;
+ int success = 0;
+
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+#endif
+
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+
+ success = 1;
+ dk_bin2c_normal_run();
+
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+ /* ERROR: Failed to restore old SIGTERM settings */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+ /* ERROR: Failed to restore old SIGINT settings */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+#endif
+
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) { exval = EXIT_FAILURE; }
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+*/
+static
+void
+dk_bin2c_run_with_signal_handlers(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ dk_bin2c_normal_run();
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
+*/
+static
+void
+dk_bin2c_run_with_signal_handlers(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ dk_bin2c_normal_run();
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+}
+#else
+/** Set signal handlers and run.
+*/
+static
+void
+dk_bin2c_run_with_signal_handlers(void)
+{
+ dk_bin2c_normal_run();
+}
+#endif
+#endif
+#endif
+
+
+
+/** Main function.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @return 0 on success, all other values indicate errors.
+*/
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
+{
+ int silent = 0; /* Flag: Run silently in vim */
+ int shp = 0; /* Flag: SIGPIPE occured */
+
+
+#line 1092 "dk-bin2c.ctr"
+
+
+#line 1093 "dk-bin2c.ctr"
+ /*
+ Check for running within vim
+ */
+#if DK4_CHAR_SIZE > 1
+ if (NULL != getenv("VIM")) { silent = 1; }
+ if (NULL != getenv("VIMRUNTIME")) { silent = 1; }
+#endif
+ /*
+ Open application
+ */
+ if (0 != silent) {
+ app = dk4app_open_silent(
+ argc, argv, dk_bin2c_options, sz_dk_bin2c_options,
+ dk_bin2c_kwnl[0], DKT_VERSION_DK,
+ dk_bin2c_kwnl[1], dk_bin2c_help_text, dk_bin2c_license_text
+ );
+ }
+ else {
+ dk4fput_initialize_stderr();
+ app = dk4app_open_cmd(
+ argc, argv, dk_bin2c_options, sz_dk_bin2c_options,
+ dk_bin2c_kwnl[0], DKT_VERSION_DK,
+ dk_bin2c_kwnl[1], dk_bin2c_help_text, dk_bin2c_license_text
+ );
+ }
+ if (NULL != app) {
+ dk_bin2c_sz_msg = dk4app_string_table_size(dk_bin2c_kw_def);
+ dk_bin2c_msg = dk4app_string_table(
+ app, dk_bin2c_kwnl[2], dk_bin2c_kw_def
+ );
+ if (0 != dk4app_can_run_normally(app)) {
+ dk_bin2c_run_with_signal_handlers();
+ }
+ else {
+ dk4fput_initialize_stdout();
+ if (0 != dk4app_help_version_license(app)) {
+ exval = EXIT_SUCCESS;
+ }
+ fflush(stdout);
+ fflush(stderr);
+ dk4fput_cleanup_stdout();
+ }
+ if (0 != sig_read_atomic(&sig_had_int )) {
+ exval = EXIT_FAILURE;
+ /* ERROR: Interrupted by SIGINT */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 5);
+ }
+ if (0 != sig_read_atomic(&sig_had_term)) {
+ exval = EXIT_FAILURE;
+ /* ERROR: Interrupted by SIGTERM */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 6);
+ }
+#ifdef SIGPIPE
+ if (0 != sig_read_atomic(&sig_had_pipe)) {
+ exval = EXIT_FAILURE;
+ shp = 1;
+ if (0 != verbose) {
+ /* ERROR: Interrupted by SIGPIPE */
+ dk4app_log_1(app,dk_bin2c_msg,dk_bin2c_sz_msg,DK4_LL_ERROR,7);
+ }
+ }
+#endif
+ if ((0 == shp) && (0 != output_error)) {
+ exval = EXIT_FAILURE;
+ /* ERROR: Output to stdout failed */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 8);
+ }
+ dk4app_close(app);
+ }
+ else {
+ }
+ if (0 != have_data) {
+ fflush(stdout);
+ }
+ if (0 == silent) {
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ }
+
+
+#line 1172 "dk-bin2c.ctr"
+
+
+#line 1173 "dk-bin2c.ctr"
+ exit(exval); return exval;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk-bin2c.ctr b/support/dktools/dk-bin2c.ctr
new file mode 100644
index 0000000000..2b3e622229
--- /dev/null
+++ b/support/dktools/dk-bin2c.ctr
@@ -0,0 +1,1178 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% module
+
+/** @file dk-bin2c The dk-bin2c program.
+ See dk_bin2c_help_text for details.
+*/
+
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_UNISTD_H
+#ifndef UNISTD_H_INCLUDED
+#include <unistd.h>
+#define UNISTD_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_SYS_TYPES_H
+#ifndef SYS_TYPES_H_INCLUDED
+#include <sys/types.h>
+#define SYS_TYPES_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_SIGNAL_H
+#ifndef SIGNAL_H_INCLUDED
+#include <signal.h>
+#define SIGNAL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_PROCESS_H
+#ifndef PROCESS_H_INCLUDED
+#include <process.h>
+#define PROCESS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4types.h"
+#include "dk4const.h"
+#include "dk4mem.h"
+#include "dk4app.h"
+#include "dk4aopt.h"
+#include "dk4fopda.h"
+#include "dk4fput.h"
+#include "dk4vers.h"
+#include "dk4mpl.h"
+#include "dk4unused.h"
+#include "dk4str8.h"
+#include "dk4strw.h"
+#include "dk4strd.h"
+#include "dk4pathd.h"
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
+
+$!trace-include
+
+
+
+/** Buffer for data from file.
+*/
+static unsigned char buffer[4096];
+
+
+
+/** Localized dkChar text fragments, overwritten by string table if found.
+*/
+static const dkChar * const dk_bin2c_kw_def[] = {
+$!string-table macro=dkT
+#
+# 0 Error: Failed to set up signal handlers!
+#
+Failed to set up signal handlers!
+#
+# 1 Error: Failed to restore signal handlers!
+#
+Failed to restore signal handlers!
+#
+# 2 Error: Path or file name too long!
+#
+Path or file name too long!
+#
+# 3 Error: Path too long!
+#
+Path too long!
+#
+# 4 Error: No matching file found!
+#
+No matching file found!
+#
+# 5 Error: Interrupted by SIGINT!
+#
+Interrupted by SIGINT!
+#
+# 6 Error: Interrupted by SIGTERM!
+#
+Interrupted by SIGTERM!
+#
+# 7 Error: Interrupted by SIGPIPE!
+#
+Interrupted by SIGPIPE!
+#
+# 8 Error: Failed to write to stdout!
+#
+Failed to write to stdout!
+$!end
+};
+
+
+
+/** Constant text fragments, not localized.
+*/
+static const dkChar * const dk_bin2c_kwnl[] = {
+$!string-table macro=dkT
+#
+# 0 Program group name
+#
+dktools
+#
+# 1 Help text file name
+#
+dk-bin2c.txt
+#
+# 2 String table file name
+#
+dk-bin2c.str
+#
+# 3 File opening mode, read binary
+#
+rb
+#
+# 4 Windows path separator
+#
+\\
+#
+# 5 Special file name for standard input
+#
+<STDIN>
+#
+#
+#
+$!end
+};
+
+
+
+/** Help text shown by --help option.
+*/
+static const dkChar * const dk_bin2c_help_text[] = {
+$!text macro=dkT,preprocessor
+
+dk-bin2c - Convert binary data to C source code
+
+dk-bin2c [<options>] [<file(s)>]
+
+Options:
+-o --octal Octal output (default: hexadecimal).
+-i <uint> --indent=<uint> Indent (spaces at start of line).
+-s <uint> --spaces=<uint> Spaces between items on line.
+-b <uint> --bytes-per-line=<uint> Number of bytes to print per line.
+--help Show help text.
+--manual *** SHOW FULL MANUAL. ***
+--version Show version information.
+--license Show license information.
+
+$!end
+};
+
+
+
+/** License text shown by --license option.
+*/
+static const dkChar * const dk_bin2c_license_text[] = {
+$!text macro=dkT,preprocessor
+
+This software uses code from the following projects, either directly or as
+a library:
+
+dktools Dirk Krause's tools and libraries.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
+#if DK4_HAVE_ZLIB_H
+
+zlib Data compression library.
+ See http://www.zlib.net/ for more information.
+#endif
+#if DK4_HAVE_BZLIB_H
+
+bzip2 Data compression program and library.
+ See http://www.bzip.org/ for more information.
+#endif
+
+All the licenses below apply to the program.
+Licenses for used libraries are shown as found on my Scientific Linux 6.x
+computer in the /usr/share/doc directory on 2015-04-01. Check the project
+homepages of the used libraries for additional information and/or updated
+license terms.
+
+
+DK tools and libraries license
+==============================
+Copyright (c) 2015-2019, Dirk Krause. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+#if DK4_HAVE_ZLIB_H
+
+
+Zlib license
+============
+(C) 1995-2004 Jean-loup Gailly and Mark Adler
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Jean-loup Gailly Mark Adler
+jloup@gzip.org madler@alumni.caltech.edu
+#endif
+#if DK4_HAVE_BZLIB_H
+
+
+Bzip2 and libbzip2 library license
+==================================
+This program, "bzip2", the associated library "libbzip2", and all
+documentation, are copyright (C) 1996-2007 Julian R Seward. All
+rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Julian Seward, jseward@bzip.org
+bzip2/libbzip2 version 1.0.5 of 10 December 2007
+#endif
+
+$!end
+};
+
+
+
+/** Program options.
+*/
+static const dk4_option_specification_t dk_bin2c_options[] = {
+ { dkT('o'), dkT("octal"), DK4_OPT_ARG_NONE },
+ { dkT('i'), dkT("indent"), DK4_OPT_ARG_UNSIGNED },
+ { dkT('s'), dkT("spaces"), DK4_OPT_ARG_UNSIGNED },
+ { dkT('b'), dkT("bytes-per-line"), DK4_OPT_ARG_UNSIGNED },
+ { dkT('v'), dkT("verbose"), DK4_OPT_ARG_NONE }
+};
+
+
+
+/** Array of localized message text fragments.
+*/
+static const dkChar * const *dk_bin2c_msg = dk_bin2c_kw_def;
+
+
+
+/** Indent at beginning of lines.
+*/
+static dk4_um_t indent = (dk4_um_t)0UL;
+
+
+
+/** Number of spaces between items.
+*/
+static dk4_um_t spaces = (dk4_um_t)0UL;
+
+
+
+/** Number of bytes t print per line.
+*/
+static dk4_um_t bpl = (dk4_um_t)15UL;
+
+
+
+/** Current position in line.
+*/
+static dk4_um_t position = (dk4_um_t)0UL;
+
+
+
+/** Number of options in the options array.
+*/
+static size_t const sz_dk_bin2c_options =
+sizeof(dk_bin2c_options)/sizeof(dk4_option_specification_t);
+
+
+
+/** Number of elements in localized text fragments array.
+*/
+static size_t dk_bin2c_sz_msg =
+sizeof(dk_bin2c_kw_def)/sizeof(DK4_PCDKCHAR) - 1;
+
+
+
+/** Size of input buffer.
+*/
+static size_t const sz_buffer = sizeof(buffer);
+
+
+
+/** Produce octal output instead of hexadecimal output.
+*/
+static int octal = 0;
+
+
+
+/** Verbose mode, issue extra diagnostics.
+*/
+static int verbose = 0;
+
+
+
+/** Exit status code returned by the program.
+*/
+static int exval = EXIT_FAILURE;
+
+
+
+/** Flag: Output error occured in printf(), fputs() or fputc().
+*/
+static int output_error = 0;
+
+
+
+/** Flag: Already found data.
+*/
+static int have_data = 0;
+
+
+
+/** Application structure for diagnostics.
+*/
+static dk4_app_t *app = NULL;
+
+
+
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+
+
+
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
+
+
+
+/** Indicator: SIGTERM signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+
+
+
+/** Pass a volatile pointer to an atomic integer.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ptr Address of atomic integer variable.
+ @return The unmodified pointer.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
+{
+ return ptr;
+}
+
+
+
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
+*/
+static
+void
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
+}
+#endif
+
+
+
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
+static
+void
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
+}
+
+
+
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
+*/
+static
+void
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
+}
+
+
+
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
+
+
+
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
+*/
+static
+int
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
+{
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
+}
+
+
+
+/** Process one file contents.
+ @param fipo Input file, opened for binary reading.
+ @param infname Name of the file to process.
+*/
+static
+void
+dk_bin2c_process_file(FILE *fipo)
+{
+ char buf[32]; /* Buffer for byte representation */
+ dk4_um_t iu; /* Count spaces */
+ size_t rdb; /* Number of bytes read from file */
+ size_t i; /* Index to traverse bytes in buffer */
+ int cc = 1; /* Flag: Can continue */
+ $? "+ dk_bin2c_process_file"
+ while ((1 == cc) && (0 != sig_can_continue(1))) {
+ rdb = fread(buffer, 1, sz_buffer, fipo);
+ if (0 < rdb) {
+ for (i = 0; ((i < rdb) && (0 != sig_can_continue(1))); i++) {
+ if (0 != have_data) {
+ if (EOF == fputc(',', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ if (position >= bpl) {
+ position = (dk4_um_t)0UL;
+ if (EOF == fputc('\n', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ for (iu = (dk4_um_t)0UL; iu < indent; iu++) {
+ if (EOF == fputc(' ', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ }
+ }
+ else {
+ for (iu = (dk4_um_t)0UL; iu < spaces; iu++) {
+ if (EOF == fputc(' ', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ }
+ }
+ }
+ else {
+ for (iu = (dk4_um_t)0UL; iu < indent; iu++) {
+ if (EOF == fputc(' ', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ }
+ }
+ if (0 != octal) {
+ sprintf(buf, "0%03o", (unsigned)(buffer[i]));
+ }
+ else {
+ sprintf(buf, "0x%02x", (unsigned)(buffer[i]));
+ }
+ if (EOF == fputs(buf, stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ have_data = 1;
+ position++;
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ $? "- dk_bin2c_process_file"
+}
+
+
+
+/** Run as pipe, process standard input.
+*/
+static
+void
+dk_bin2c_process_stdin(void)
+{
+#if DK4_ON_WINDOWS
+ int oldmode;
+#endif
+ $? "+ dk_bin2c_process_stdin"
+#if DK4_ON_WINDOWS
+ oldmode = _setmode(_fileno(stdin), _O_BINARY);
+#endif
+ dk_bin2c_process_file(stdin);
+#if DK4_ON_WINDOWS
+ _setmode(_fileno(stdin), oldmode);
+#endif
+ $? "- dk_bin2c_process_stdin"
+}
+
+
+
+/** Process one file name.
+ @param infname Input file name (real file name, no expansion).
+*/
+static
+void
+dk_bin2c_process_file_name(const dkChar *infname)
+{
+ FILE *fipo;
+ dkChar const *oldsourcefile; /* Source file name */
+ dk4_um_t oldsourceline; /* Source line number */
+ int tests = DK4_FOPEN_SC_IS_REGULAR;
+ $? "+ dk_bin2c_process_file_name"
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, infname);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ fipo = dk4fopen_app(infname, dk_bin2c_kwnl[3], tests, app);
+ if (NULL != fipo) {
+ dk_bin2c_process_file(fipo);
+ fclose(fipo);
+ }
+ else {
+ exval = EXIT_FAILURE;
+ }
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ $? "- dk_bin2c_process_file_name"
+}
+
+
+
+#if DK4_ON_WINDOWS
+
+/** Expand one file name.
+ @param pattern Input file name pattern containing wildcards.
+*/
+static
+void
+dk_bin2c_expand_and_process(const dkChar *pattern)
+{
+ dkChar buf[DK4_MAX_PATH]; /* Buffer to construct file name */
+ dk4_dir_t *fne; /* File name expander */
+ dkChar const *shf; /* Short file name */
+ dkChar const *pth; /* Path name */
+ dkChar const *oldsourcefile; /* Source file name */
+ dk4_um_t oldsourceline; /* Source line number */
+ size_t szbuf; /* Size of buffer */
+ int cc; /* Flag: Can continue */
+ int res; /* String concat result */
+ int found; /* Flag: File(s) found */
+ $? "+ dk_bin2c_expand_and_process"
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, pattern);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ found = 0;
+ szbuf = DK4_SIZEOF(buf,dkChar);
+ fne = dk4app_fne_open(pattern, app);
+ if (NULL != fne) {
+ cc = 1;
+ while ((1 == cc) && (sig_can_continue(1))) {
+ shf = dk4dir_next_file(fne);
+ if (NULL != shf) {
+ found = 1;
+ pth = dk4dir_get_path(fne);
+ if (NULL != pth) {
+ /*
+ Construct full file name in buf,
+ process this file name
+ */
+ res = dk4str_cpy_s(buf, szbuf, pth, NULL);
+ if (0 != res) {
+ res = dk4str_cat_s(buf, szbuf, dk_bin2c_kwnl[4], NULL);
+ if (0 != res) {
+ res = dk4str_cat_s(buf, szbuf, shf, NULL);
+ if (0 != res) {
+ dk_bin2c_process_file_name(buf);
+ }
+ else {
+ /* ERROR: Path or file name too long */
+ dk4app_log_1(
+ app, dk_bin2c_msg, dk_bin2c_sz_msg,
+ DK4_LL_ERROR, 2
+ );
+ exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /* ERROR: Path too long */
+ exval = EXIT_FAILURE;
+ dk4app_log_1(
+ app, dk_bin2c_msg, dk_bin2c_sz_msg,
+ DK4_LL_ERROR, 3
+ );
+ }
+ }
+ else {
+ /* ERROR: Path too long */
+ dk4app_log_1(
+ app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 3
+ );
+ exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /*
+ No path specified, process short file name as is
+ */
+ dk_bin2c_process_file_name(shf);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(fne);
+ if (0 == found) {
+ /* ERROR: No matching file found */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 4);
+ exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /* ERROR: Failed to open file name expander */
+ exval = EXIT_FAILURE;
+ }
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ $? "- dk_bin2c_expand_and_process"
+}
+
+#endif
+
+
+
+/** Process one file name.
+ @param infname File name to process, may be a pattern with wildcards.
+*/
+static
+void
+dk_bin2c_process_one_argv(const dkChar *infname)
+{
+ $? "+ dk_bin2c_process_one_argv"
+#if DK4_ON_WINDOWS
+ if (0 != dk4path_must_expand(infname)) {
+ dk_bin2c_expand_and_process(infname);
+ }
+ else {
+#endif
+ dk_bin2c_process_file_name(infname);
+#if DK4_ON_WINDOWS
+ }
+#endif
+ $? "- dk_bin2c_process_one_argv"
+}
+
+
+
+/** Run functionality after setting up signal handlers.
+*/
+static
+void
+dk_bin2c_normal_run(void)
+{
+ int argc; /* Number of command line arguments */
+ int i; /* Current command line argument index */
+ $? "+ dk_bin2c_normal_run"
+ /*
+ Indicate success so far
+ */
+ exval = EXIT_SUCCESS;
+ /*
+ Process command line arguments
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('o'), NULL)) {
+ octal = 1;
+ }
+ if (0 != dk4app_opt_is_set_short(app, dkT('v'), NULL)) {
+ verbose = 1;
+ }
+ if (0 != dk4app_opt_is_set_short(app, dkT('i'), NULL)) {
+ if (0 == dk4app_opt_get_unsigned_short(&indent, app, dkT('i'), NULL)) {
+ indent = (dk4_um_t)0UL;
+ }
+ }
+ if (0 != dk4app_opt_is_set_short(app, dkT('s'), NULL)) {
+ if (0 == dk4app_opt_get_unsigned_short(&spaces, app, dkT('s'), NULL)) {
+ spaces = (dk4_um_t)0UL;
+ }
+ }
+ if (0 != dk4app_opt_is_set_short(app, dkT('b'), NULL)) {
+ if (0 == dk4app_opt_get_unsigned_short(&bpl, app, dkT('b'), NULL)) {
+ bpl = (dk4_um_t)15UL;
+ }
+ }
+ /*
+ Start normal processing
+ */
+ argc = dk4app_get_argc(app);
+ if (0 < argc) {
+ /*
+ Process named files
+ */
+ for (i = 0; ((i < argc) && (0 != sig_can_continue(1))); i++) {
+ dk_bin2c_process_one_argv(dk4app_get_argv(app, i));
+ }
+ }
+ else {
+ /*
+ Process standard input
+ */
+ dk_bin2c_process_stdin();
+ }
+ if (0 != have_data) {
+ if (EOF == fputc('\n', stdout)) {
+ output_error = 1;
+ exval = EXIT_FAILURE;
+ }
+ }
+ $? "- dk_bin2c_normal_run"
+}
+
+
+
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
+*/
+static
+void
+dk_bin2c_run_with_signal_handlers(void)
+{
+#ifdef SIGPIPE
+ struct sigaction opipe;
+ struct sigaction npipe;
+#endif
+ struct sigaction oint;
+ struct sigaction nint;
+ struct sigaction oterm;
+ struct sigaction nterm;
+ int success = 0;
+
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+#endif
+
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_pipe;
+ }
+
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 0);
+ goto restore_old_int;
+ }
+
+ success = 1;
+ dk_bin2c_normal_run();
+
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+ /* ERROR: Failed to restore old SIGTERM settings */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+ /* ERROR: Failed to restore old SIGINT settings */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 1);
+ success = 0;
+ }
+#endif
+
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) { exval = EXIT_FAILURE; }
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+*/
+static
+void
+dk_bin2c_run_with_signal_handlers(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ dk_bin2c_normal_run();
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
+*/
+static
+void
+dk_bin2c_run_with_signal_handlers(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ dk_bin2c_normal_run();
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+}
+#else
+/** Set signal handlers and run.
+*/
+static
+void
+dk_bin2c_run_with_signal_handlers(void)
+{
+ dk_bin2c_normal_run();
+}
+#endif
+#endif
+#endif
+
+
+
+/** Main function.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @return 0 on success, all other values indicate errors.
+*/
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
+{
+ int silent = 0; /* Flag: Run silently in vim */
+ int shp = 0; /* Flag: SIGPIPE occured */
+ $!trace-init dk-bin2c.deb
+ $? "+ main"
+ /*
+ Check for running within vim
+ */
+#if DK4_CHAR_SIZE > 1
+ if (NULL != getenv("VIM")) { silent = 1; }
+ if (NULL != getenv("VIMRUNTIME")) { silent = 1; }
+#endif
+ /*
+ Open application
+ */
+ if (0 != silent) {
+ app = dk4app_open_silent(
+ argc, argv, dk_bin2c_options, sz_dk_bin2c_options,
+ dk_bin2c_kwnl[0], DKT_VERSION_DK,
+ dk_bin2c_kwnl[1], dk_bin2c_help_text, dk_bin2c_license_text
+ );
+ }
+ else {
+ dk4fput_initialize_stderr();
+ app = dk4app_open_cmd(
+ argc, argv, dk_bin2c_options, sz_dk_bin2c_options,
+ dk_bin2c_kwnl[0], DKT_VERSION_DK,
+ dk_bin2c_kwnl[1], dk_bin2c_help_text, dk_bin2c_license_text
+ );
+ }
+ if (NULL != app) {
+ dk_bin2c_sz_msg = dk4app_string_table_size(dk_bin2c_kw_def);
+ dk_bin2c_msg = dk4app_string_table(
+ app, dk_bin2c_kwnl[2], dk_bin2c_kw_def
+ );
+ if (0 != dk4app_can_run_normally(app)) {
+ dk_bin2c_run_with_signal_handlers();
+ }
+ else {
+ dk4fput_initialize_stdout();
+ if (0 != dk4app_help_version_license(app)) {
+ exval = EXIT_SUCCESS;
+ }
+ fflush(stdout);
+ fflush(stderr);
+ dk4fput_cleanup_stdout();
+ }
+ if (0 != sig_read_atomic(&sig_had_int )) {
+ exval = EXIT_FAILURE;
+ /* ERROR: Interrupted by SIGINT */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 5);
+ }
+ if (0 != sig_read_atomic(&sig_had_term)) {
+ exval = EXIT_FAILURE;
+ /* ERROR: Interrupted by SIGTERM */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 6);
+ }
+#ifdef SIGPIPE
+ if (0 != sig_read_atomic(&sig_had_pipe)) {
+ exval = EXIT_FAILURE;
+ shp = 1;
+ if (0 != verbose) {
+ /* ERROR: Interrupted by SIGPIPE */
+ dk4app_log_1(app,dk_bin2c_msg,dk_bin2c_sz_msg,DK4_LL_ERROR,7);
+ }
+ }
+#endif
+ if ((0 == shp) && (0 != output_error)) {
+ exval = EXIT_FAILURE;
+ /* ERROR: Output to stdout failed */
+ dk4app_log_1(app, dk_bin2c_msg, dk_bin2c_sz_msg, DK4_LL_ERROR, 8);
+ }
+ dk4app_close(app);
+ }
+ else {
+ }
+ if (0 != have_data) {
+ fflush(stdout);
+ }
+ if (0 == silent) {
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ }
+ $? "- main %d", exval
+ $!trace-end
+ exit(exval); return exval;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk-bin2c.rc b/support/dktools/dk-bin2c.rc
new file mode 100644
index 0000000000..21a9c45c9c
--- /dev/null
+++ b/support/dktools/dk-bin2c.rc
@@ -0,0 +1,37 @@
+aaaaa ICON dkicon.ico
+
+#include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Binary data to C source converter\0"
+ VALUE "CompanyName", "Dirk Krause\0"
+ VALUE "FileDescription", "Binary data to C source converter\0"
+ VALUE "FileVersion", "4.30.2\0"
+ VALUE "InternalName", "dk-bin2c\0"
+ VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
+ VALUE "ProductName", "Dirk Krause's tools\0"
+ VALUE "ProductVersion", "4.30.2\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
diff --git a/support/dktools/dk-blks.c b/support/dktools/dk-blks.c
index 80a5ae9a9b..1aa17e421c 100644
--- a/support/dktools/dk-blks.c
+++ b/support/dktools/dk-blks.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-blks.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-blks.ctr
*/
@@ -119,12 +97,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4numco.h"
#include "dk4fdrde.h"
#include "dk4fdwre.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 98 "dk-blks.ctr"
+#line 102 "dk-blks.ctr"
@@ -154,12 +136,12 @@ dkT("--manual\t*** SHOW FULL MANUAL. ***"),
dkT("--version\tShow version information."),
dkT("--license\tShow license information."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-blks/"),
dkT(""),
NULL
-#line 131 "dk-blks.ctr"
+#line 135 "dk-blks.ctr"
};
@@ -170,7 +152,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -197,27 +180,28 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
+dkT(""),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -291,7 +275,7 @@ dkT(""),
NULL
-#line 261 "dk-blks.ctr"
+#line 267 "dk-blks.ctr"
};
@@ -330,7 +314,7 @@ dkT("stdout"),
NULL
-#line 300 "dk-blks.ctr"
+#line 306 "dk-blks.ctr"
};
@@ -372,7 +356,7 @@ dkT("\" ignored!"),
NULL
-#line 347 "dk-blks.ctr"
+#line 353 "dk-blks.ctr"
};
@@ -464,8 +448,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -475,8 +460,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -485,8 +471,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -510,10 +497,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -546,7 +541,7 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
dk4_sig_atomic_t shp; /* Had pipe */
-#line 519 "dk-blks.ctr"
+#line 536 "dk-blks.ctr"
/* Process input
*/
exval = EXIT_SUCCESS;
@@ -554,7 +549,7 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
if (1 == sig_can_continue(0)) {
errno = 0;
-#line 525 "dk-blks.ctr"
+#line 542 "dk-blks.ctr"
#if DK4_ON_WINDOWS
rdres = _read(0, ib, (unsigned)bs);
#else
@@ -562,7 +557,7 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
#endif
if (0 < rdres) {
-#line 531 "dk-blks.ctr"
+#line 548 "dk-blks.ctr"
irdb = rdres;
iused = 0;
while(iused < irdb) {
@@ -594,7 +589,7 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
wrres = write(1, ob, bs);
#endif
if (0 <= wrres) {
- if (wrres < bs) {
+ if (((size_t)wrres) < bs) {
/* ERROR: Not all bytes written */
dk4app_log_1(app, dk_blks_msg, sz_msg, DK4_LL_ERROR, 0);
exval = EXIT_FAILURE;
@@ -613,11 +608,11 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
} else {
if (0 == rdres) {
-#line 580 "dk-blks.ctr"
+#line 597 "dk-blks.ctr"
cc = 0;
} else {
-#line 582 "dk-blks.ctr"
+#line 599 "dk-blks.ctr"
/* ERROR: Read operation failed */
dk4fd_read_error_msg(app, kwnl[3], errno);
cc = 0;
@@ -650,7 +645,7 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
wrres = write(1, ob, oused);
#endif
if (0 <= wrres) {
- if (wrres < oused) {
+ if (((size_t)wrres) < oused) {
/* ERROR: Not all bytes written */
dk4app_log_1(app, dk_blks_msg, sz_msg, DK4_LL_ERROR, 0);
exval = EXIT_FAILURE;
@@ -679,7 +674,7 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
-#line 642 "dk-blks.ctr"
+#line 659 "dk-blks.ctr"
}
@@ -722,7 +717,7 @@ dk_blks_normal_run(void)
int res = 0;
-#line 683 "dk-blks.ctr"
+#line 700 "dk-blks.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('b'), NULL)) {
res = dk4app_opt_get_size_short(&mybs, app, dkT('b'), NULL);
if (0 == res) {
@@ -753,7 +748,7 @@ dk_blks_normal_run(void)
}
-#line 712 "dk-blks.ctr"
+#line 729 "dk-blks.ctr"
}
@@ -960,10 +955,10 @@ int main(int argc, char *argv[])
int i;
-#line 917 "dk-blks.ctr"
+#line 934 "dk-blks.ctr"
-#line 918 "dk-blks.ctr"
+#line 935 "dk-blks.ctr"
app = dk4app_open_cmd(
argc, argv, options, sz_options, kwnl[0], DKT_VERSION_DK,
kwnl[1], help_text, license_text
@@ -1003,10 +998,10 @@ int main(int argc, char *argv[])
}
-#line 956 "dk-blks.ctr"
+#line 973 "dk-blks.ctr"
-#line 957 "dk-blks.ctr"
+#line 974 "dk-blks.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-blks.ctr b/support/dktools/dk-blks.ctr
index 12829bc381..9136930bd7 100644
--- a/support/dktools/dk-blks.ctr
+++ b/support/dktools/dk-blks.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -91,7 +91,11 @@ license = bsd
#include "dk4numco.h"
#include "dk4fdrde.h"
#include "dk4fdwre.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -125,7 +129,7 @@ Options:
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-blks/
$!end
};
@@ -139,7 +143,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -166,27 +171,28 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
#if DK4_HAVE_ZLIB_H
@@ -435,8 +441,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -446,8 +453,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -456,8 +464,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -481,10 +490,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -559,7 +576,7 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
wrres = write(1, ob, bs);
#endif
if (0 <= wrres) {
- if (wrres < bs) {
+ if (((size_t)wrres) < bs) {
/* ERROR: Not all bytes written */
dk4app_log_1(app, dk_blks_msg, sz_msg, DK4_LL_ERROR, 0);
exval = EXIT_FAILURE;
@@ -611,7 +628,7 @@ dk_blks_transfer(char *ib, char *ob, size_t bs)
wrres = write(1, ob, oused);
#endif
if (0 <= wrres) {
- if (wrres < oused) {
+ if (((size_t)wrres) < oused) {
/* ERROR: Not all bytes written */
dk4app_log_1(app, dk_blks_msg, sz_msg, DK4_LL_ERROR, 0);
exval = EXIT_FAILURE;
diff --git a/support/dktools/dk-blks.rc b/support/dktools/dk-blks.rc
index 809f56dcc9..90eae50661 100644
--- a/support/dktools/dk-blks.rc
+++ b/support/dktools/dk-blks.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Blocksize corrector, creates sequence of fixed size blocks\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Blocksize corrector, creates sequence of fixed size blocks\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-blks\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-bmm.c b/support/dktools/dk-bmm.c
index 701155d934..1feb022514 100644
--- a/support/dktools/dk-bmm.c
+++ b/support/dktools/dk-bmm.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-bmm.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-bmm.ctr
*/
/** @file dk-bmm.c The dk-bmm module.
@@ -155,12 +133,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4aopt.h"
#include "dk4mpl.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 131 "dk-bmm.ctr"
+#line 135 "dk-bmm.ctr"
@@ -210,12 +192,12 @@ dkT("dk-bmm <media-file>\t\tFind number of current media in set."),
dkT("dk-bmm -c <media-file>\t\tConfirm successful backup to current media."),
dkT("dk-bmm -c -s <set-names-file>\tConfirm successful backup for current set."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-bmm/"),
dkT(""),
NULL
-#line 184 "dk-bmm.ctr"
+#line 188 "dk-bmm.ctr"
};
@@ -228,7 +210,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -255,27 +238,28 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -349,7 +333,7 @@ dkT(""),
NULL
-#line 316 "dk-bmm.ctr"
+#line 322 "dk-bmm.ctr"
};
@@ -396,7 +380,7 @@ dkT("w"),
NULL
-#line 367 "dk-bmm.ctr"
+#line 373 "dk-bmm.ctr"
};
@@ -449,7 +433,7 @@ dkT("Not a set names file!"),
NULL
-#line 432 "dk-bmm.ctr"
+#line 438 "dk-bmm.ctr"
};
@@ -633,8 +617,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -644,8 +629,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -654,8 +640,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -679,10 +666,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -728,7 +723,7 @@ dk_bmm_sets_line_handler(
void *obj,
dkChar *line,
dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk_bmm_lh_obj_t *lhoptr;
@@ -741,11 +736,12 @@ dk_bmm_sets_line_handler(
int back = DK4_TSP_RES_FATAL;
-#line 722 "dk-bmm.ctr"
+#line 739 "dk-bmm.ctr"
+ DK4_UNUSED_ARG(erp)
lhoptr = (dk_bmm_lh_obj_t *)obj;
if ((dk4_um_t)1UL == lineno) {
-#line 724 "dk-bmm.ctr"
+#line 742 "dk-bmm.ctr"
dk4str_delnl(line);
res = dk4str_cpy_s(
dk_bmm_set_line, DK4_SIZEOF(dk_bmm_set_line,dkChar), line, NULL
@@ -762,7 +758,7 @@ dk_bmm_sets_line_handler(
} else {
if ((dk4_um_t)2UL == lineno) {
-#line 739 "dk-bmm.ctr"
+#line 757 "dk-bmm.ctr"
dk4str_delnl(line);
p1 = dk4str_start(line, NULL);
if (NULL != p1) {
@@ -774,7 +770,7 @@ dk_bmm_sets_line_handler(
if (0 != res) {
if ((dk4_um_t)INT_MAX >= um) {
dk_bmm_day_in_cycle = (int)um;
- if ((dk4_um_t)dk_bmm_n_set_names > dk_bmm_day_in_cycle) {
+ if ((dk4_um_t)dk_bmm_n_set_names > um) {
back = DK4_TSP_RES_OK;
}
}
@@ -784,14 +780,14 @@ dk_bmm_sets_line_handler(
}
} else {
-#line 759 "dk-bmm.ctr"
+#line 777 "dk-bmm.ctr"
}
}
if ((DK4_TSP_RES_FATAL == back) || (DK4_TSP_RES_ERROR == back)) {
*(lhoptr->backptr) = 0;
}
-#line 764 "dk-bmm.ctr"
+#line 782 "dk-bmm.ctr"
return back;
}
@@ -815,7 +811,7 @@ dk_bmm_read_sets_file(const dkChar *filename)
int back = 0;
-#line 786 "dk-bmm.ctr"
+#line 804 "dk-bmm.ctr"
fipo = dk4fopen_app(filename, dk_bmm_kwnl[4], DK4_FOPEN_SC_IS_REGULAR, app);
if (NULL != fipo) {
lhoptr.backptr = &back;
@@ -863,7 +859,7 @@ dk_bmm_read_sets_file(const dkChar *filename)
fclose(fipo);
}
-#line 832 "dk-bmm.ctr"
+#line 850 "dk-bmm.ctr"
return back;
}
@@ -898,52 +894,52 @@ dk_bmm_data_line(dk_bmm_media_t *mptr, char *line)
int back = 0;
-#line 865 "dk-bmm.ctr"
+#line 883 "dk-bmm.ctr"
if (21 > dk4str8_len(line)) {
-#line 867 "dk-bmm.ctr"
+#line 885 "dk-bmm.ctr"
goto finished;
}
if ('-' != line[4]) {
-#line 871 "dk-bmm.ctr"
+#line 889 "dk-bmm.ctr"
goto finished;
}
line[4] = '\0';
if ('-' != line[7]) {
-#line 876 "dk-bmm.ctr"
+#line 894 "dk-bmm.ctr"
goto finished;
}
line[7] = '\0';
if (' ' != line[10]) {
-#line 881 "dk-bmm.ctr"
+#line 899 "dk-bmm.ctr"
goto finished;
}
line[10] = '\0';
if (':' != line[13]) {
-#line 886 "dk-bmm.ctr"
+#line 904 "dk-bmm.ctr"
goto finished;
}
line[13] = '\0';
if (':' != line[16]) {
-#line 891 "dk-bmm.ctr"
+#line 909 "dk-bmm.ctr"
goto finished;
}
line[16] = '\0';
if (' ' != line[19]) {
-#line 896 "dk-bmm.ctr"
+#line 914 "dk-bmm.ctr"
goto finished;
}
line[19] = '\0';
@@ -951,50 +947,50 @@ dk_bmm_data_line(dk_bmm_media_t *mptr, char *line)
if (0 == dk4ma_input_c8_dec_ushort(&(mptr->year), line, &ep, 0, NULL)) {
-#line 902 "dk-bmm.ctr"
+#line 920 "dk-bmm.ctr"
goto finished;
}
if (0 == dk4ma_input_c8_dec_ushort(&(mptr->month),&(line[5]),&ep,0,NULL)) {
-#line 906 "dk-bmm.ctr"
+#line 924 "dk-bmm.ctr"
goto finished;
}
if (0 == dk4ma_input_c8_dec_ushort(&(mptr->day),&(line[8]),&ep,0,NULL)) {
-#line 910 "dk-bmm.ctr"
+#line 928 "dk-bmm.ctr"
goto finished;
}
if (0 == dk4ma_input_c8_dec_ushort(&(mptr->hour),&(line[11]),&ep,0,NULL)) {
-#line 914 "dk-bmm.ctr"
+#line 932 "dk-bmm.ctr"
goto finished;
}
if (0 == dk4ma_input_c8_dec_ushort(&(mptr->minute),&(line[14]),&ep,0,NULL)) {
-#line 918 "dk-bmm.ctr"
+#line 936 "dk-bmm.ctr"
goto finished;
}
if (0 == dk4ma_input_c8_dec_ushort(&(mptr->second),&(line[17]),&ep,0,NULL)) {
-#line 922 "dk-bmm.ctr"
+#line 940 "dk-bmm.ctr"
goto finished;
}
if (0 == dk4ma_input_c8_dec_ushort(&(mptr->times),(&line[20]),&ep,0,NULL)) {
-#line 926 "dk-bmm.ctr"
+#line 944 "dk-bmm.ctr"
goto finished;
}
back = 1;
finished:
-#line 931 "dk-bmm.ctr"
+#line 949 "dk-bmm.ctr"
return back;
}
@@ -1018,7 +1014,7 @@ dk_bmm_media_line_handler(
void *obj,
char *line,
dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_er_t er;
@@ -1029,12 +1025,13 @@ dk_bmm_media_line_handler(
int back = DK4_TSP_RES_FATAL;
-#line 964 "dk-bmm.ctr"
+#line 982 "dk-bmm.ctr"
+ DK4_UNUSED_ARG(erp)
lhoptr = (dk_bmm_lh_obj_t *)obj;
dk4str8_delnl(line);
if ((dk4_um_t)1UL == lineno) {
-#line 967 "dk-bmm.ctr"
+#line 986 "dk-bmm.ctr"
/*
Process first line
*/
@@ -1057,7 +1054,7 @@ dk_bmm_media_line_handler(
*/
lineno -= (dk4_um_t)2UL;
-#line 988 "dk-bmm.ctr"
+#line 1007 "dk-bmm.ctr"
if (0 != dk_bmm_data_line(&(media_info[(size_t)lineno]), line)) {
back = DK4_TSP_RES_OK;
} else {
@@ -1065,14 +1062,14 @@ dk_bmm_media_line_handler(
}
} else {
-#line 994 "dk-bmm.ctr"
+#line 1013 "dk-bmm.ctr"
/* ERROR: Syntax, too many lines */
}
}
if (DK4_TSP_RES_OK != back) { *(lhoptr->backptr) = 0; }
-#line 999 "dk-bmm.ctr"
+#line 1018 "dk-bmm.ctr"
return back;
}
@@ -1097,14 +1094,14 @@ dk_bmm_read_media_file(const dkChar *filename)
int back = 0;
-#line 1022 "dk-bmm.ctr"
+#line 1041 "dk-bmm.ctr"
obj.backptr = &back;
fipo = dk4fopen_app(filename, dk_bmm_kwnl[4], DK4_FOPEN_SC_IS_REGULAR, app);
if (NULL != fipo) {
dk4error_init(&er);
res = dk4tsp08_setup_line(
&tsp08, &obj, dk_bmm_media_line_handler, inb, sizeof(inb),
- DK4_ENCODING_ASCII, dk4app_get_file_in_encoding(app), &er
+ DK4_ENCODING_PLAIN, dk4app_get_file_in_encoding(app), &er
);
if (0 != res) {
back = 1;
@@ -1146,7 +1143,7 @@ dk_bmm_read_media_file(const dkChar *filename)
back = 1;
}
-#line 1069 "dk-bmm.ctr"
+#line 1088 "dk-bmm.ctr"
return back;
}
@@ -1220,15 +1217,15 @@ dk_bmm_switch_to_next(const dkChar *filename)
int back = 0;
-#line 1141 "dk-bmm.ctr"
+#line 1160 "dk-bmm.ctr"
mediano = (size_t)(dk_bmm_media_numbers[dk_bmm_day_in_cycle]);
-#line 1143 "dk-bmm.ctr"
+#line 1162 "dk-bmm.ctr"
dk_bmm_update_media_info(&(media_info[mediano - 1]));
if (++dk_bmm_day_in_cycle >= 200) {
-#line 1145 "dk-bmm.ctr"
+#line 1164 "dk-bmm.ctr"
dk_bmm_day_in_cycle = 0;
dk_bmm_cycle_completed = 1;
for (mediano = 0; mediano < 10; mediano++) {
@@ -1240,14 +1237,14 @@ dk_bmm_switch_to_next(const dkChar *filename)
fipo = dk4fopen_app(filename, dk_bmm_kwnl[5], tests, app);
if (NULL != fipo) {
-#line 1155 "dk-bmm.ctr"
+#line 1174 "dk-bmm.ctr"
back = 1;
res = dk4ma_write_c8_decimal_signed(
buf, sizeof(buf), (dk4_im_t)dk_bmm_day_in_cycle, 0, NULL
);
if (0 != res) {
-#line 1160 "dk-bmm.ctr"
+#line 1179 "dk-bmm.ctr"
if (EOF == fputs(buf, fipo)) { back = 0; }
if (EOF == fputc('\n', fipo)) { back = 0; }
} else {
@@ -1266,7 +1263,7 @@ dk_bmm_switch_to_next(const dkChar *filename)
);
if (0 != res) {
-#line 1177 "dk-bmm.ctr"
+#line 1196 "dk-bmm.ctr"
if (EOF == fputs(buf, fipo)) { back = 0; }
if (EOF == fputc(' ', fipo)) { back = 0; }
res = dk4ma_write_c8_decimal_unsigned(
@@ -1288,11 +1285,11 @@ dk_bmm_switch_to_next(const dkChar *filename)
}
} else {
-#line 1197 "dk-bmm.ctr"
+#line 1216 "dk-bmm.ctr"
exval = EXIT_FAILURE;
}
-#line 1199 "dk-bmm.ctr"
+#line 1218 "dk-bmm.ctr"
return back;
}
@@ -1323,7 +1320,7 @@ dk_bmm_report_media(void)
media_found[mediano - 1] = nextlevel++;
-#line 1228 "dk-bmm.ctr"
+#line 1247 "dk-bmm.ctr"
}
}
}
@@ -1334,12 +1331,12 @@ dk_bmm_report_media(void)
media_found[mediano - 1] = nextlevel++;
-#line 1237 "dk-bmm.ctr"
+#line 1256 "dk-bmm.ctr"
}
}
dk_bmm_mod_stdout = 1;
-#line 1240 "dk-bmm.ctr"
+#line 1259 "dk-bmm.ctr"
dk4fput_initialize_stdout();
res = dk4ma_write_decimal_unsigned(
b1, DK4_SIZEOF(b1,dkChar),
@@ -1433,30 +1430,30 @@ dk4_bmm_write_set_file(const dkChar *filename)
int tests = DK4_FOPEN_SC_USER;
-#line 1332 "dk-bmm.ctr"
+#line 1351 "dk-bmm.ctr"
if (1 == dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
fipo = dk4fopen_app(filename, dk_bmm_kwnl[5], tests, app);
if (NULL != fipo) {
-#line 1335 "dk-bmm.ctr"
+#line 1354 "dk-bmm.ctr"
dk4fput_initialize_file(fipo);
for (i = 0; i < dk_bmm_n_set_names; i++) {
if (0 != i) {
if (0 == dk4fputc(dkT(' '), fipo, NULL)) {
we = 1;
-#line 1340 "dk-bmm.ctr"
+#line 1359 "dk-bmm.ctr"
}
}
if (0 == dk4fputs(dk_bmm_set_names[i], fipo, NULL)) {
we = 1;
-#line 1344 "dk-bmm.ctr"
+#line 1363 "dk-bmm.ctr"
}
}
if (0 == dk4fputc(dkT('\n'), fipo, NULL)) {
-#line 1347 "dk-bmm.ctr"
+#line 1366 "dk-bmm.ctr"
we = 1;
}
res = dk4ma_write_decimal_unsigned(
@@ -1465,23 +1462,23 @@ dk4_bmm_write_set_file(const dkChar *filename)
if (0 != res) {
if (0 == dk4fputs(buf, fipo, NULL)) {
-#line 1354 "dk-bmm.ctr"
+#line 1373 "dk-bmm.ctr"
we = 1;
}
if (0 == dk4fputc(dkT('\n'), fipo, NULL)) {
-#line 1357 "dk-bmm.ctr"
+#line 1376 "dk-bmm.ctr"
we = 1;
}
} else {
-#line 1360 "dk-bmm.ctr"
+#line 1379 "dk-bmm.ctr"
/* ERROR: Number conversion failed, bug */
exval = EXIT_FAILURE;
}
if (0 != fclose(fipo)) {
-#line 1364 "dk-bmm.ctr"
+#line 1383 "dk-bmm.ctr"
we = 1;
}
if (0 != we) {
@@ -1500,7 +1497,7 @@ dk4_bmm_write_set_file(const dkChar *filename)
}
-#line 1381 "dk-bmm.ctr"
+#line 1400 "dk-bmm.ctr"
}
@@ -1520,7 +1517,7 @@ dk_bmm_can_write_8bit(const dkChar *str)
int back = 1;
-#line 1399 "dk-bmm.ctr"
+#line 1418 "dk-bmm.ctr"
while ((dkT('\0') != *str) && (1 == back)) {
if (dkC32(0xFF) < *str) {
back = 0;
@@ -1528,7 +1525,7 @@ dk_bmm_can_write_8bit(const dkChar *str)
str++;
}
-#line 1405 "dk-bmm.ctr"
+#line 1424 "dk-bmm.ctr"
return back;
#else
dk4_utf16_decoder_t dec;
@@ -1536,7 +1533,7 @@ dk_bmm_can_write_8bit(const dkChar *str)
int back = 1;
-#line 1411 "dk-bmm.ctr"
+#line 1430 "dk-bmm.ctr"
dk4utf16_init(&dec);
while((dkT('\0') != *str) && (1 == back)) {
switch (dk4utf16_add(&dec, *str)) {
@@ -1556,13 +1553,13 @@ dk_bmm_can_write_8bit(const dkChar *str)
if (0 == dk4utf16_is_empty(&dec)) { back = 0; }
}
-#line 1429 "dk-bmm.ctr"
+#line 1448 "dk-bmm.ctr"
return back;
#endif
#else
-#line 1433 "dk-bmm.ctr"
+#line 1452 "dk-bmm.ctr"
return 1;
#endif
}
@@ -1579,7 +1576,7 @@ dk_bmm_write_8bit(const dkChar *str)
#if DK4_CHAR_SIZE > 2
-#line 1448 "dk-bmm.ctr"
+#line 1467 "dk-bmm.ctr"
while (dkT('\0') != *str) {
if (EOF == fputc((char)((unsigned char)(*(str++))), stdout)) {
output_error = 1;
@@ -1591,7 +1588,7 @@ dk_bmm_write_8bit(const dkChar *str)
int back = 1;
-#line 1458 "dk-bmm.ctr"
+#line 1477 "dk-bmm.ctr"
dk4utf16_init(&dec);
while((dkT('\0') != *str) && (1 == back)) {
switch (dk4utf16_add(&dec, *str)) {
@@ -1611,7 +1608,7 @@ dk_bmm_write_8bit(const dkChar *str)
str++;
}
-#line 1476 "dk-bmm.ctr"
+#line 1495 "dk-bmm.ctr"
#endif
}
@@ -1628,7 +1625,7 @@ dk_bmm_write_set_name(void)
const dkChar *sn = NULL;
-#line 1491 "dk-bmm.ctr"
+#line 1510 "dk-bmm.ctr"
if ((dk4_um_t)dk_bmm_day_in_cycle < (dk4_um_t)dk_bmm_n_set_names) {
sn = dk_bmm_set_names[(size_t)dk_bmm_day_in_cycle];
}
@@ -1636,18 +1633,18 @@ dk_bmm_write_set_name(void)
#if DK4_CHAR_SIZE > 1
-#line 1497 "dk-bmm.ctr"
+#line 1516 "dk-bmm.ctr"
if (0 != dk_bmm_can_write_8bit(sn)) {
-#line 1498 "dk-bmm.ctr"
+#line 1517 "dk-bmm.ctr"
dk_bmm_write_8bit(sn);
if (EOF == fputc('\n', stdout)) { output_error = 1; }
} else {
-#line 1501 "dk-bmm.ctr"
+#line 1520 "dk-bmm.ctr"
dk_bmm_mod_stdout = 1;
-#line 1502 "dk-bmm.ctr"
+#line 1521 "dk-bmm.ctr"
dk4fput_initialize_stdout();
if (0 == dk4fputs(sn, stdout, NULL)) { output_error = 1; }
if (0 == dk4fputc(dkT('\n'), stdout, NULL)) { output_error = 1; }
@@ -1655,7 +1652,7 @@ dk_bmm_write_set_name(void)
#else
-#line 1508 "dk-bmm.ctr"
+#line 1527 "dk-bmm.ctr"
if (EOF == fputs(sn, stdout)) { output_error = 1; }
if (EOF == fputc('\n', stdout)) { output_error = 1; }
#endif
@@ -1663,7 +1660,7 @@ dk_bmm_write_set_name(void)
}
-#line 1514 "dk-bmm.ctr"
+#line 1533 "dk-bmm.ctr"
}
@@ -1679,7 +1676,7 @@ dk_bmm_run_for_file(const dkChar *filename)
dk4_um_t oldsourceline;
-#line 1528 "dk-bmm.ctr"
+#line 1547 "dk-bmm.ctr"
if (0 != dk_bmm_handle_set) {
if (0 != dk_bmm_do_report) {
/* ERROR: Option -r not available for sets */
@@ -1734,7 +1731,7 @@ dk_bmm_run_for_file(const dkChar *filename)
}
-#line 1581 "dk-bmm.ctr"
+#line 1600 "dk-bmm.ctr"
}
@@ -1752,7 +1749,7 @@ dk_bmm_expand_pattern(const dkChar *pattern)
int back = 0;
-#line 1597 "dk-bmm.ctr"
+#line 1616 "dk-bmm.ctr"
fne = dk4app_fne_open(pattern, app);
if (NULL != fne) {
shf = dk4dir_next_file(fne);
@@ -1792,7 +1789,7 @@ dk_bmm_expand_pattern(const dkChar *pattern)
}
-#line 1635 "dk-bmm.ctr"
+#line 1654 "dk-bmm.ctr"
return back;
}
@@ -1809,7 +1806,7 @@ dk_bmm_normal_run(void)
const dkChar *xargv;
-#line 1650 "dk-bmm.ctr"
+#line 1669 "dk-bmm.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('c'), NULL)) {
dk_bmm_do_confirm = 1;
}
@@ -1841,7 +1838,7 @@ dk_bmm_normal_run(void)
}
-#line 1680 "dk-bmm.ctr"
+#line 1699 "dk-bmm.ctr"
}
@@ -2048,10 +2045,10 @@ int main(int argc, char *argv[])
int oldfilelevel;
-#line 1885 "dk-bmm.ctr"
+#line 1904 "dk-bmm.ctr"
-#line 1886 "dk-bmm.ctr"
+#line 1905 "dk-bmm.ctr"
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
argc, argv, dk_bmm_options, dk_bmm_sz_options,
@@ -2095,7 +2092,7 @@ int main(int argc, char *argv[])
dk4fput_initialize_stdout();
dk_bmm_mod_stdout = 1;
-#line 1928 "dk-bmm.ctr"
+#line 1947 "dk-bmm.ctr"
if (0 != dk4app_help_version_license(app)) {
exval = EXIT_SUCCESS;
}
@@ -2110,10 +2107,10 @@ int main(int argc, char *argv[])
}
-#line 1941 "dk-bmm.ctr"
+#line 1960 "dk-bmm.ctr"
-#line 1942 "dk-bmm.ctr"
+#line 1961 "dk-bmm.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-bmm.ctr b/support/dktools/dk-bmm.ctr
index a4fd766c76..5a509251b4 100644
--- a/support/dktools/dk-bmm.ctr
+++ b/support/dktools/dk-bmm.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -124,7 +124,11 @@ license = bsd
#include "dk4aopt.h"
#include "dk4mpl.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -178,7 +182,7 @@ dk-bmm <media-file> Find number of current media in set.
dk-bmm -c <media-file> Confirm successful backup to current media.
dk-bmm -c -s <set-names-file> Confirm successful backup for current set.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-bmm/
$!end
};
@@ -194,7 +198,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -221,27 +226,28 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
#if DK4_HAVE_ZLIB_H
@@ -612,8 +618,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -623,8 +630,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -633,8 +641,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -658,10 +667,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -707,7 +724,7 @@ dk_bmm_sets_line_handler(
void *obj,
dkChar *line,
dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk_bmm_lh_obj_t *lhoptr;
@@ -719,6 +736,7 @@ dk_bmm_sets_line_handler(
int res;
int back = DK4_TSP_RES_FATAL;
$? "+ dk_bmm_sets_line_handler %lu", (unsigned long)lineno
+ DK4_UNUSED_ARG(erp)
lhoptr = (dk_bmm_lh_obj_t *)obj;
if ((dk4_um_t)1UL == lineno) { $? ". first line"
dk4str_delnl(line);
@@ -747,7 +765,7 @@ dk_bmm_sets_line_handler(
if (0 != res) {
if ((dk4_um_t)INT_MAX >= um) {
dk_bmm_day_in_cycle = (int)um;
- if ((dk4_um_t)dk_bmm_n_set_names > dk_bmm_day_in_cycle) {
+ if ((dk4_um_t)dk_bmm_n_set_names > um) {
back = DK4_TSP_RES_OK;
}
}
@@ -951,7 +969,7 @@ dk_bmm_media_line_handler(
void *obj,
char *line,
dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_er_t er;
@@ -961,6 +979,7 @@ dk_bmm_media_line_handler(
int res;
int back = DK4_TSP_RES_FATAL;
$? "+ dk_bmm_media_line_handler %lu \"%!8s\"", (unsigned long)lineno, line
+ DK4_UNUSED_ARG(erp)
lhoptr = (dk_bmm_lh_obj_t *)obj;
dk4str8_delnl(line);
if ((dk4_um_t)1UL == lineno) { $? ". first line"
@@ -1025,7 +1044,7 @@ dk_bmm_read_media_file(const dkChar *filename)
dk4error_init(&er);
res = dk4tsp08_setup_line(
&tsp08, &obj, dk_bmm_media_line_handler, inb, sizeof(inb),
- DK4_ENCODING_ASCII, dk4app_get_file_in_encoding(app), &er
+ DK4_ENCODING_PLAIN, dk4app_get_file_in_encoding(app), &er
);
if (0 != res) {
back = 1;
diff --git a/support/dktools/dk-bmm.rc b/support/dktools/dk-bmm.rc
index 40d61c3eb9..cfcbc1a23c 100644
--- a/support/dktools/dk-bmm.rc
+++ b/support/dktools/dk-bmm.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Backup media manager\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Backup media manager\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-bmm\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-cat.c b/support/dktools/dk-cat.c
index 63b35118ff..7173878eb8 100644
--- a/support/dktools/dk-cat.c
+++ b/support/dktools/dk-cat.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-cat.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-cat.ctr
*/
@@ -115,12 +93,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maodd.h"
#include "dk4mpl.h"
#include "dk4isadm.h"
+#include "dk4rec26.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 94 "dk-cat.ctr"
+#line 99 "dk-cat.ctr"
@@ -143,7 +126,7 @@ dkT(""),
dkT("Options:"),
dkT("-c <bool> Enable CR/NL -n Write line numbers"),
dkT("-i <encoding> Expected input encoding -w Normalize text lines"),
-dkT("-o <encoding> Output encoding -p No unneccessary decoding/encoding"),
+dkT("-o <encoding> Output encoding -p No unnecessary decoding/encoding"),
dkT("--help Show this short help text. --manual *** SHOW FULL MANUAL. ***"),
dkT("--version Show version information. --license Show license information."),
dkT("--verbose Error message on SIGPIPE"),
@@ -153,12 +136,12 @@ dkT("Encoding names: plain (ASCII text), ascii (synonym for plain), ansi, utf-8,
dkT("utf-16, utf-16le (little-endian) utf-16be (big-endian),"),
dkT("c32 (32 bit characters), c32le, c32be."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-cat/"),
dkT(""),
NULL
-#line 130 "dk-cat.ctr"
+#line 135 "dk-cat.ctr"
};
@@ -171,7 +154,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -198,27 +182,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -292,7 +276,7 @@ dkT(""),
NULL
-#line 262 "dk-cat.ctr"
+#line 268 "dk-cat.ctr"
};
@@ -324,7 +308,7 @@ dkT("verbose"),
NULL
-#line 299 "dk-cat.ctr"
+#line 305 "dk-cat.ctr"
};
@@ -414,7 +398,7 @@ dkT("Signal received: SIGINT!"),
NULL
-#line 377 "dk-cat.ctr"
+#line 383 "dk-cat.ctr"
};
@@ -465,6 +449,12 @@ static const dk4_option_specification_t dk_cat_options[] = {
+/** Byte order marker.
+*/
+static const dk4_c32_t dk_cat_bom = (dk4_c32_t)(0xFEFFUL);
+
+
+
#ifdef SIGPIPE
/** Indicator: SIGPIPE signal received.
*/
@@ -503,8 +493,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -514,8 +505,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -524,8 +516,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -549,10 +542,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -606,18 +607,36 @@ static int use_stream = 1;
/** System output encoding.
*/
-static int oenc_sys = DK4_FILE_ENCODING_ASCII;
+static int oenc_sys =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Default output encoding on the system.
*/
-static int oenc_def = DK4_FILE_ENCODING_ASCII;
+static int oenc_def =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Output encoding specified on command line.
*/
-static int oenc = DK4_FILE_ENCODING_ASCII;
+static int oenc =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** System setting whether or not to write a BOM.
@@ -642,7 +661,13 @@ static int crnl = DK4_HAVE_LINE_END_CR_NL;
/** Input encoding specified on the command line.
*/
-static int ienc_def = DK4_FILE_ENCODING_ASCII;
+static int ienc_def =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Flag: Show line numbers (from options).
@@ -750,24 +775,24 @@ initialize_from_app(void)
int back = 1;
-#line 711 "dk-cat.ctr"
+#line 758 "dk-cat.ctr"
/* String tables and defaults.
*/
-#line 715 "dk-cat.ctr"
+#line 762 "dk-cat.ctr"
oenc_sys = dk4app_get_stdout_encoding(app);
oenc_def = oenc_sys;
ienc_def = dk4app_get_stdin_encoding(app);
-#line 719 "dk-cat.ctr"
+#line 766 "dk-cat.ctr"
if (0 < dk4app_get_argc(app)) {
ienc_def = dk4app_get_file_in_encoding(app);
-#line 722 "dk-cat.ctr"
+#line 769 "dk-cat.ctr"
}
/* Set verbose flag if -v was used.
@@ -780,27 +805,27 @@ initialize_from_app(void)
*/
-#line 733 "dk-cat.ctr"
+#line 780 "dk-cat.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('o'), NULL)) {
-#line 734 "dk-cat.ctr"
+#line 781 "dk-cat.ctr"
res = dk4app_opt_get_string_short(
buf, DK4_SIZEOF(buf,dkChar), app, dkT('o'), NULL
);
if (0 != res) {
-#line 738 "dk-cat.ctr"
+#line 785 "dk-cat.ctr"
res = dk4enc_find(&oenc_def, &obom, buf, NULL);
if (0 == res) {
-#line 740 "dk-cat.ctr"
+#line 787 "dk-cat.ctr"
/* ERROR: Illegal output encoding */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 17, 18, buf);
back = 0;
}
} else {
-#line 745 "dk-cat.ctr"
+#line 792 "dk-cat.ctr"
/* ERROR: BUG, No option argument */
back = 0;
}
@@ -810,27 +835,27 @@ initialize_from_app(void)
*/
-#line 753 "dk-cat.ctr"
+#line 800 "dk-cat.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('i'), NULL)) {
-#line 754 "dk-cat.ctr"
+#line 801 "dk-cat.ctr"
res = dk4app_opt_get_string_short(
buf, DK4_SIZEOF(buf,dkChar), app, dkT('i'), NULL
);
if (0 != res) {
-#line 758 "dk-cat.ctr"
+#line 805 "dk-cat.ctr"
res = dk4enc_find(&ienc_def, NULL, buf, NULL);
if (0 == res) {
-#line 760 "dk-cat.ctr"
+#line 807 "dk-cat.ctr"
/* ERROR: Illegal input encoding */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 15, 16, buf);
back = 0;
}
} else {
-#line 765 "dk-cat.ctr"
+#line 812 "dk-cat.ctr"
/* ERROR: BUG, No option argument */
back = 0;
}
@@ -840,15 +865,15 @@ initialize_from_app(void)
*/
-#line 773 "dk-cat.ctr"
+#line 820 "dk-cat.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('c'), NULL)) {
-#line 774 "dk-cat.ctr"
+#line 821 "dk-cat.ctr"
if (0 == dk4app_opt_get_bool_short(&crnl, app, dkT('c'), NULL)) {
/* ERROR: BUG, No option argument */
back = 0;
-#line 777 "dk-cat.ctr"
+#line 824 "dk-cat.ctr"
}
}
@@ -856,10 +881,10 @@ initialize_from_app(void)
*/
-#line 783 "dk-cat.ctr"
+#line 830 "dk-cat.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('n'), NULL)) {
-#line 784 "dk-cat.ctr"
+#line 831 "dk-cat.ctr"
line_numbers = 1;
}
@@ -867,19 +892,19 @@ initialize_from_app(void)
*/
-#line 790 "dk-cat.ctr"
+#line 837 "dk-cat.ctr"
if (0 != dk4app_opt_is_set_long(app, dk_cat_kwnl[3], NULL)) {
-#line 791 "dk-cat.ctr"
+#line 838 "dk-cat.ctr"
if (0 == dk4app_opt_get_size_long(&line_number_width, app, dk_cat_kwnl[3], NULL)) {
/* ERROR: BUG, No option argument */
back = 0;
-#line 794 "dk-cat.ctr"
+#line 841 "dk-cat.ctr"
} else {
if (0 == line_number_width) {
-#line 796 "dk-cat.ctr"
+#line 843 "dk-cat.ctr"
/* ERROR: Illegal line number width */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 19);
back = 0;
@@ -891,19 +916,19 @@ initialize_from_app(void)
*/
-#line 806 "dk-cat.ctr"
+#line 853 "dk-cat.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('w'), NULL)) {
-#line 807 "dk-cat.ctr"
+#line 854 "dk-cat.ctr"
normalize_lines = 1;
}
-#line 811 "dk-cat.ctr"
+#line 858 "dk-cat.ctr"
switch (oenc_sys) {
- case DK4_FILE_ENCODING_ASCII :
- case DK4_FILE_ENCODING_ANSI :
+ case DK4_FILE_ENCODING_PLAIN :
+ case DK4_FILE_ENCODING_WIN1252 :
case DK4_FILE_ENCODING_UTF8 :
{
obom_sys = 0;
@@ -919,7 +944,7 @@ initialize_from_app(void)
-#line 828 "dk-cat.ctr"
+#line 875 "dk-cat.ctr"
return back;
}
@@ -951,7 +976,7 @@ initialize_output(void)
dk4_er_t er;
-#line 858 "dk-cat.ctr"
+#line 905 "dk-cat.ctr"
if (0 == output_initialized) {
output_initialized = 1;
if (0 != use_stream) {
@@ -959,7 +984,7 @@ initialize_output(void)
#if DK4_ON_WINDOWS
-#line 864 "dk-cat.ctr"
+#line 911 "dk-cat.ctr"
old_output_mode = _setmode(_fileno(stdout), _O_BINARY);
#endif
output_stream = dk4stream_open_for_file(
@@ -967,24 +992,23 @@ initialize_output(void)
);
if (NULL != output_stream) {
dk4stream_set_output_encoding(output_stream, oenc);
- switch (obom) {
- case 1: {
- if(0 == dk4stream_c32_putc(output_stream, dkC32(0xFEFF), NULL)) {
- /* ERROR: Failed to write BOM */
- dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 20);
- exval = EXIT_FAILURE;
- }
- } break;
- case -1: {
- if (1 == obom_sys) {
- if(0 == dk4stream_c32_putc(output_stream,dkC32(0xFEFF),NULL)) {
- /* ERROR: Failed to write BOM */
- dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 20);
- exval = EXIT_FAILURE;
- }
- }
- } break;
- }
+ /*
+ 2019-09-27
+ Attempt to write byte order marker (BOM) if either
+ - BOM explicitly required or
+ - no BOM information, output encoding is system encoding and
+ system encoding indicates BOM.
+ */
+ if (
+ (1 == obom)
+ || ((-1 == obom) && (1 == obom_sys) && (oenc == oenc_sys))
+ ) {
+ if(0 == dk4stream_c32_putc(output_stream, dk_cat_bom, NULL)) {
+ /* ERROR: Failed to write BOM */
+ dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 20);
+ exval = EXIT_FAILURE;
+ }
+ }
} else {
/* ERROR: Failed to create stream */
dk4app_log_base1(app, DK4_LL_ERROR, 90);
@@ -994,7 +1018,7 @@ initialize_output(void)
}
}
-#line 897 "dk-cat.ctr"
+#line 943 "dk-cat.ctr"
}
@@ -1008,7 +1032,7 @@ cleanup_output(void)
dk4_er_t er;
-#line 909 "dk-cat.ctr"
+#line 955 "dk-cat.ctr"
if (0 != output_initialized) {
if (0 != use_stream) {
if (NULL != output_stream) {
@@ -1026,7 +1050,7 @@ cleanup_output(void)
*/
-#line 925 "dk-cat.ctr"
+#line 971 "dk-cat.ctr"
_setmode(_fileno(stdout), old_output_mode);
#endif
} else {
@@ -1034,7 +1058,7 @@ cleanup_output(void)
}
}
-#line 931 "dk-cat.ctr"
+#line 977 "dk-cat.ctr"
}
@@ -1128,11 +1152,8 @@ error_while_writing_c32(dk4_er_t *erp, dk4_text_stream_position_t *pos)
/** Write one 32 bit character to output.
If the character is a newline, convert to carriage return and
newline sequence if required by crnl settings.
- @param obj Object to modify while processing the character
- (NULL here).
@param c Character to process.
@param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1142,10 +1163,8 @@ error_while_writing_c32(dk4_er_t *erp, dk4_text_stream_position_t *pos)
static
int
c32_real_output(
- void *obj,
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t *pos
)
{
dk4_er_t er;
@@ -1154,7 +1173,7 @@ c32_real_output(
-#line 1049 "dk-cat.ctr"
+#line 1090 "dk-cat.ctr"
initialize_output();
if (0 != use_stream) {
if (NULL != output_stream) {
@@ -1192,7 +1211,7 @@ c32_real_output(
there_was_text = 1;
-#line 1085 "dk-cat.ctr"
+#line 1126 "dk-cat.ctr"
return back;
}
@@ -1200,11 +1219,8 @@ c32_real_output(
/** Check whether a character is the first character in a line,
write line number if necessary and write the character.
- @param obj Object to modify while processing the character
- (NULL here).
@param c Character to process.
@param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1214,10 +1230,8 @@ c32_real_output(
static
int
c32_after_normalize(
- void *obj,
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t *pos
)
{
char buf[8*(1+sizeof(dk4_um_t))];
@@ -1227,7 +1241,7 @@ c32_after_normalize(
int back = DK4_TSP_RES_OK;
-#line 1118 "dk-cat.ctr"
+#line 1154 "dk-cat.ctr"
if (0 != line_numbers) {
if (0 == line_number_printed) {
line_number_printed = 1;
@@ -1239,7 +1253,7 @@ c32_after_normalize(
*/
i = dk4str8_len(buf);
while (i < line_number_width) {
- switch (c32_real_output(obj, dkC32(0x20), pos, erp)) {
+ switch (c32_real_output(dkC32(0x20), pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1256,7 +1270,7 @@ c32_after_normalize(
ptr = buf;
while ('\0' != *ptr) {
res = c32_real_output(
- obj, (dk4_c32_t)((unsigned char)(*(ptr++))), pos, erp
+ (dk4_c32_t)((unsigned char)(*(ptr++))), pos
);
switch (res) {
case DK4_TSP_RES_FATAL: {
@@ -1271,7 +1285,7 @@ c32_after_normalize(
}
/* Trailing space after line number
*/
- switch (c32_real_output(obj, dkC32(0x20), pos, erp)) {
+ switch (c32_real_output(dkC32(0x20), pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1287,7 +1301,7 @@ c32_after_normalize(
back = DK4_TSP_RES_FATAL;
}
}
- switch (c32_real_output(obj, c, pos, erp)) {
+ switch (c32_real_output(c, pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1298,21 +1312,18 @@ c32_after_normalize(
} break;
}
} else {
- back = c32_real_output(obj, c, pos, erp);
+ back = c32_real_output(c, pos);
}
-#line 1190 "dk-cat.ctr"
+#line 1226 "dk-cat.ctr"
return back;
}
/** Normalize the text if required and pass characters downwards.
- @param obj Object to modify while processing the character
- (NULL here).
@param c Character to process.
@param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1322,29 +1333,27 @@ c32_after_normalize(
static
int
c32_after_cr_nl(
- void *obj,
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t *pos
)
{
int back = DK4_TSP_RES_OK;
-#line 1218 "dk-cat.ctr"
+#line 1249 "dk-cat.ctr"
if (0 != normalize_lines) {
if ((dkC32(0x09) == c) || (dkC32(0x20) == c) || (dkC32(0x0D) == c)) {
previous_was_text = 0;
} else {
if (dkC32(0x0A) == c) {
previous_was_text = 0;
- back = c32_after_normalize(obj, c, pos, erp);
+ back = c32_after_normalize(c, pos);
text_in_line = 0;
} else {
if ((0 == previous_was_text) && (0 != text_in_line)) {
- back = c32_after_normalize(obj, dkC32(0x20), pos, erp);
+ back = c32_after_normalize(dkC32(0x20), pos);
}
- switch (c32_after_normalize(obj, c, pos, erp)) {
+ switch (c32_after_normalize(c, pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1359,10 +1368,10 @@ c32_after_cr_nl(
}
}
} else {
- back = c32_after_normalize(obj, c, pos, erp);
+ back = c32_after_normalize(c, pos);
}
-#line 1247 "dk-cat.ctr"
+#line 1278 "dk-cat.ctr"
return back;
}
@@ -1382,40 +1391,42 @@ c32_after_cr_nl(
static
int
c32_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dk4_c32_t c,
dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
-#line 1274 "dk-cat.ctr"
+#line 1305 "dk-cat.ctr"
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(erp)
dk4app_set_log_source_line(app, line_number);
if (dkC32(0x0D) == c) {
-#line 1276 "dk-cat.ctr"
+#line 1309 "dk-cat.ctr"
if (0 != previous_was_cr) {
- back = c32_after_cr_nl(obj, dkC32(0x0D), pos, erp);
+ back = c32_after_cr_nl(dkC32(0x0D), pos);
}
previous_was_cr = 1;
} else {
if (dkC32(0x0A) == c) {
-#line 1282 "dk-cat.ctr"
- back = c32_after_cr_nl(obj, c, pos, erp);
+#line 1315 "dk-cat.ctr"
+ back = c32_after_cr_nl(c, pos);
line_number++;
dk4app_set_log_source_line(app, line_number);
line_number_printed = 0;
text_in_line = 0;
} else {
-#line 1288 "dk-cat.ctr"
+#line 1321 "dk-cat.ctr"
if (0 != previous_was_cr) {
- back = c32_after_cr_nl(obj, dkC32(0x0D), pos, erp);
+ back = c32_after_cr_nl(dkC32(0x0D), pos);
}
- switch (c32_after_cr_nl(obj, c, pos, erp)) {
+ switch (c32_after_cr_nl(c, pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1429,7 +1440,7 @@ c32_handler(
previous_was_cr = 0;
}
-#line 1304 "dk-cat.ctr"
+#line 1337 "dk-cat.ctr"
return back;
}
@@ -1437,11 +1448,7 @@ c32_handler(
/** Write one dkChar to output (for a newline write a carriage
return, newline sequence if required).
- @param obj Object to modify while processing the character
- (NULL here).
@param c Character to process.
- @param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1450,19 +1457,14 @@ c32_handler(
*/
static
int
-dkc_real_output(
- void *obj,
- dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
-)
+dkc_real_output(dkChar c)
{
dk4_er_t er;
int back = DK4_TSP_RES_OK;
dk4_sig_atomic_t shp;
-#line 1335 "dk-cat.ctr"
+#line 1359 "dk-cat.ctr"
initialize_output();
dk4error_init(&er);
#ifdef SIGPIPE
@@ -1489,7 +1491,7 @@ dkc_real_output(
there_was_text = 1;
-#line 1360 "dk-cat.ctr"
+#line 1384 "dk-cat.ctr"
return back;
}
@@ -1511,12 +1513,7 @@ dkc_real_output(
*/
static
int
-dkc_after_normalize(
- void *obj,
- dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
-)
+dkc_after_normalize(dkChar c)
{
char buf[8*(1+sizeof(dk4_um_t))];
char *ptr = NULL;
@@ -1525,7 +1522,7 @@ dkc_after_normalize(
int back = DK4_TSP_RES_OK;
-#line 1394 "dk-cat.ctr"
+#line 1413 "dk-cat.ctr"
if (0 != line_numbers) {
if (0 == line_number_printed) {
line_number_printed = 1;
@@ -1537,7 +1534,7 @@ dkc_after_normalize(
*/
i = dk4str8_len(buf);
while (i < line_number_width) {
- switch (dkc_real_output(obj, dkT(' '), pos, erp)) {
+ switch (dkc_real_output(dkT(' '))) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1553,9 +1550,7 @@ dkc_after_normalize(
*/
ptr = buf;
while ('\0' != *ptr) {
- res = dkc_real_output(
- obj, (dkChar)((unsigned char)(*(ptr++))), pos, erp
- );
+ res = dkc_real_output((dkChar)((unsigned char)(*(ptr++))));
switch (res) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
@@ -1569,7 +1564,7 @@ dkc_after_normalize(
}
/* Trailing space after line number
*/
- switch (dkc_real_output(obj, dkT(' '), pos, erp)) {
+ switch (dkc_real_output(dkT(' '))) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1585,7 +1580,7 @@ dkc_after_normalize(
back = DK4_TSP_RES_FATAL;
}
}
- switch (dkc_real_output(obj, c, pos, erp)) {
+ switch (dkc_real_output(c)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1596,10 +1591,10 @@ dkc_after_normalize(
} break;
}
} else {
- back = dkc_real_output(obj, c, pos, erp);
+ back = dkc_real_output(c);
}
-#line 1466 "dk-cat.ctr"
+#line 1483 "dk-cat.ctr"
return back;
}
@@ -1609,8 +1604,6 @@ dkc_after_normalize(
@param obj Object to modify while processing the character
(NULL here).
@param c Character to process.
- @param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1620,29 +1613,26 @@ dkc_after_normalize(
static
int
dkc_after_cr_nl(
- void *obj,
- dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dkChar c
)
{
int back = DK4_TSP_RES_OK;
-#line 1494 "dk-cat.ctr"
+#line 1506 "dk-cat.ctr"
if (0 != normalize_lines) {
if ((dkT('\t') == c) || (dkT(' ') == c) || (dkT('\r') == c)) {
previous_was_text = 0;
} else {
if (dkT('\n') == c) {
previous_was_text = 0;
- back = dkc_after_normalize(obj, c, pos, erp);
+ back = dkc_after_normalize(c);
text_in_line = 0;
} else {
if ((0 == previous_was_text) && (0 != text_in_line)) {
- back = dkc_after_normalize(obj, dkT(' '), pos, erp);
+ back = dkc_after_normalize(dkT(' '));
}
- switch (dkc_after_normalize(obj, c, pos, erp)) {
+ switch (dkc_after_normalize(c)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1657,10 +1647,10 @@ dkc_after_cr_nl(
}
}
} else {
- back = dkc_after_normalize(obj, c, pos, erp);
+ back = dkc_after_normalize(c);
}
-#line 1523 "dk-cat.ctr"
+#line 1535 "dk-cat.ctr"
return back;
}
@@ -1681,34 +1671,37 @@ dkc_after_cr_nl(
static
int
dkc_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
-#line 1551 "dk-cat.ctr"
+#line 1563 "dk-cat.ctr"
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
dk4app_set_log_source_line(app, line_number);
if (dkT('\r') == c) {
if (0 != previous_was_cr) {
- back = dkc_after_cr_nl(obj, dkT('\r'), pos, erp);
+ back = dkc_after_cr_nl(dkT('\r'));
}
previous_was_cr = 1;
} else {
if (dkT('\n') == c) {
- back = dkc_after_cr_nl(obj, c, pos, erp);
+ back = dkc_after_cr_nl(c);
line_number++;
dk4app_set_log_source_line(app, line_number);
line_number_printed = 0;
text_in_line = 0;
} else {
if (0 != previous_was_cr) {
- back = dkc_after_cr_nl(obj, dkT('\r'), pos, erp);
+ back = dkc_after_cr_nl(dkT('\r'));
}
- switch (dkc_after_cr_nl(obj, c, pos, erp)) {
+ switch (dkc_after_cr_nl(c)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1723,7 +1716,7 @@ dkc_handler(
}
-#line 1582 "dk-cat.ctr"
+#line 1597 "dk-cat.ctr"
return back;
}
@@ -1737,7 +1730,7 @@ initialize_for_one_file(void)
{
-#line 1594 "dk-cat.ctr"
+#line 1609 "dk-cat.ctr"
line_number = (dk4_um_t)1UL;
previous_was_cr = 0;
previous_was_nl = 0;
@@ -1750,7 +1743,7 @@ initialize_for_one_file(void)
text_in_line = 0;
-#line 1605 "dk-cat.ctr"
+#line 1620 "dk-cat.ctr"
}
@@ -1843,19 +1836,19 @@ process_one_file(FILE *fipo)
-#line 1696 "dk-cat.ctr"
+#line 1711 "dk-cat.ctr"
cc = 1;
initialize_for_one_file();
dk4error_init(&er);
if (0 != use_stream) {
-#line 1700 "dk-cat.ctr"
+#line 1715 "dk-cat.ctr"
res = dk4tsp32_setup_char(
&tsp32, NULL, c32_handler, ienc_def, &er
);
if (0 != res) {
-#line 1704 "dk-cat.ctr"
+#line 1719 "dk-cat.ctr"
do {
if (0 != sig_can_continue(0)) {
c = fgetc(fipo);
@@ -1886,19 +1879,19 @@ process_one_file(FILE *fipo)
} while (1 == cc);
if (0 == cc) {
-#line 1733 "dk-cat.ctr"
+#line 1748 "dk-cat.ctr"
res = dk4tsp32_finish(&tsp32);
switch (res) {
case DK4_TSP_RES_ERROR: {
-#line 1736 "dk-cat.ctr"
+#line 1751 "dk-cat.ctr"
exval = EXIT_FAILURE;
dk4tsp32_get_errors(&er_en, &er_pr, &tsp32);
report_errors(&er_en, &er_pr);
} break;
case DK4_TSP_RES_FATAL: {
-#line 1741 "dk-cat.ctr"
+#line 1756 "dk-cat.ctr"
exval = EXIT_FAILURE;
dk4tsp32_get_errors(&er_en, &er_pr, &tsp32);
report_errors(&er_en, &er_pr);
@@ -1907,16 +1900,16 @@ process_one_file(FILE *fipo)
}
if (0 != sig_can_continue(0)) {
if ((0 != there_was_text) && (0 == previous_was_nl)) {
- res = c32_real_output(NULL, dkC32(0x0A), NULL, NULL);
+ res = c32_real_output(dkC32(0x0A), NULL);
switch (res) {
case DK4_TSP_RES_ERROR: {
-#line 1752 "dk-cat.ctr"
+#line 1767 "dk-cat.ctr"
exval = EXIT_FAILURE;
} break;
case DK4_TSP_RES_FATAL: {
-#line 1755 "dk-cat.ctr"
+#line 1770 "dk-cat.ctr"
exval = EXIT_FAILURE;
} break;
}
@@ -1924,13 +1917,13 @@ process_one_file(FILE *fipo)
}
} else {
-#line 1761 "dk-cat.ctr"
+#line 1776 "dk-cat.ctr"
/* BUG, Should not happen */
exval = EXIT_FAILURE;
}
} else {
-#line 1765 "dk-cat.ctr"
+#line 1780 "dk-cat.ctr"
res = dk4tspdk_setup_char(
&tspdk, NULL, dkc_handler, oenc_sys, ienc_def, &er
);
@@ -1938,7 +1931,7 @@ process_one_file(FILE *fipo)
if (0 != dk4app_opt_is_set_short(app, dkT('p'), NULL)) {
-#line 1771 "dk-cat.ctr"
+#line 1786 "dk-cat.ctr"
dk4tspdk_enable_utf8_pass_through(&tspdk, 1);
}
do {
@@ -1981,7 +1974,7 @@ process_one_file(FILE *fipo)
}
}
if ((0 != there_was_text) && (0 == previous_was_nl)) {
- res = dkc_real_output(NULL, dkT('\n'), NULL, NULL);
+ res = dkc_real_output(dkT('\n'));
switch (res) {
case DK4_TSP_RES_ERROR: {
exval = EXIT_FAILURE;
@@ -1995,7 +1988,7 @@ process_one_file(FILE *fipo)
}
-#line 1826 "dk-cat.ctr"
+#line 1841 "dk-cat.ctr"
}
@@ -2014,7 +2007,7 @@ process_one_file_name(const dkChar *filename)
int tests = DK4_FOPEN_SC_USER;
-#line 1843 "dk-cat.ctr"
+#line 1858 "dk-cat.ctr"
dk4error_init(&er);
oldsourcefile = dk4app_get_log_source_file(app);
oldsourceline = dk4app_get_log_source_line(app);
@@ -2040,7 +2033,7 @@ process_one_file_name(const dkChar *filename)
dk4app_set_log_source_line(app, oldsourceline);
-#line 1867 "dk-cat.ctr"
+#line 1882 "dk-cat.ctr"
}
@@ -2123,11 +2116,11 @@ process_files(void)
#endif
-#line 1948 "dk-cat.ctr"
+#line 1963 "dk-cat.ctr"
argc = dk4app_get_argc(app);
if (0 < argc) {
-#line 1950 "dk-cat.ctr"
+#line 1965 "dk-cat.ctr"
for (i = 0; ((i < argc) && (0 != sig_can_continue(1))); i++) {
fn = dk4app_get_argv(app, i);
if (NULL != fn) {
@@ -2144,11 +2137,11 @@ process_files(void)
}
} else {
-#line 1965 "dk-cat.ctr"
+#line 1980 "dk-cat.ctr"
#if DK4_ON_WINDOWS
-#line 1967 "dk-cat.ctr"
+#line 1982 "dk-cat.ctr"
oldmode = _setmode(_fileno(stdin), _O_BINARY);
#endif
input_file_name = dk_cat_kwnl[4];
@@ -2156,13 +2149,13 @@ process_files(void)
#if DK4_ON_WINDOWS
-#line 1973 "dk-cat.ctr"
+#line 1988 "dk-cat.ctr"
_setmode(_fileno(stdin), oldmode);
#endif
}
-#line 1977 "dk-cat.ctr"
+#line 1992 "dk-cat.ctr"
}
@@ -2378,10 +2371,10 @@ int main(int argc, char *argv[])
dk4_sig_atomic_t shp;
-#line 2191 "dk-cat.ctr"
+#line 2206 "dk-cat.ctr"
-#line 2192 "dk-cat.ctr"
+#line 2207 "dk-cat.ctr"
app = dk4app_open_cmd(
argc, argv, dk_cat_options, dk_cat_sz_options,
dk_cat_kwnl[0], DKT_VERSION_DK,
@@ -2424,10 +2417,10 @@ int main(int argc, char *argv[])
}
-#line 2233 "dk-cat.ctr"
+#line 2248 "dk-cat.ctr"
-#line 2234 "dk-cat.ctr"
+#line 2249 "dk-cat.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-cat.ctr b/support/dktools/dk-cat.ctr
index 11b0eca270..a897889ec3 100644
--- a/support/dktools/dk-cat.ctr
+++ b/support/dktools/dk-cat.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -87,7 +87,12 @@ license = bsd
#include "dk4maodd.h"
#include "dk4mpl.h"
#include "dk4isadm.h"
+#include "dk4rec26.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -114,7 +119,7 @@ dk-cat [<options>] [<files>]
Options:
-c <bool> Enable CR/NL -n Write line numbers
-i <encoding> Expected input encoding -w Normalize text lines
--o <encoding> Output encoding -p No unneccessary decoding/encoding
+-o <encoding> Output encoding -p No unnecessary decoding/encoding
--help Show this short help text. --manual *** SHOW FULL MANUAL. ***
--version Show version information. --license Show license information.
--verbose Error message on SIGPIPE
@@ -124,7 +129,7 @@ Encoding names: plain (ASCII text), ascii (synonym for plain), ansi, utf-8,
utf-16, utf-16le (little-endian) utf-16be (big-endian),
c32 (32 bit characters), c32le, c32be.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-cat/
$!end
};
@@ -140,7 +145,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -167,27 +173,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -424,6 +430,12 @@ static const dk4_option_specification_t dk_cat_options[] = {
+/** Byte order marker.
+*/
+static const dk4_c32_t dk_cat_bom = (dk4_c32_t)(0xFEFFUL);
+
+
+
#ifdef SIGPIPE
/** Indicator: SIGPIPE signal received.
*/
@@ -462,8 +474,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -473,8 +486,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -483,8 +497,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -508,10 +523,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -565,18 +588,36 @@ static int use_stream = 1;
/** System output encoding.
*/
-static int oenc_sys = DK4_FILE_ENCODING_ASCII;
+static int oenc_sys =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Default output encoding on the system.
*/
-static int oenc_def = DK4_FILE_ENCODING_ASCII;
+static int oenc_def =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Output encoding specified on command line.
*/
-static int oenc = DK4_FILE_ENCODING_ASCII;
+static int oenc =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** System setting whether or not to write a BOM.
@@ -601,7 +642,13 @@ static int crnl = DK4_HAVE_LINE_END_CR_NL;
/** Input encoding specified on the command line.
*/
-static int ienc_def = DK4_FILE_ENCODING_ASCII;
+static int ienc_def =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Flag: Show line numbers (from options).
@@ -809,8 +856,8 @@ initialize_from_app(void)
$? ". check for bom writing"
switch (oenc_sys) {
- case DK4_FILE_ENCODING_ASCII :
- case DK4_FILE_ENCODING_ANSI :
+ case DK4_FILE_ENCODING_PLAIN :
+ case DK4_FILE_ENCODING_WIN1252 :
case DK4_FILE_ENCODING_UTF8 :
{
obom_sys = 0;
@@ -868,24 +915,23 @@ initialize_output(void)
);
if (NULL != output_stream) {
dk4stream_set_output_encoding(output_stream, oenc);
- switch (obom) {
- case 1: {
- if(0 == dk4stream_c32_putc(output_stream, dkC32(0xFEFF), NULL)) {
- /* ERROR: Failed to write BOM */
- dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 20);
- exval = EXIT_FAILURE;
- }
- } break;
- case -1: {
- if (1 == obom_sys) {
- if(0 == dk4stream_c32_putc(output_stream,dkC32(0xFEFF),NULL)) {
- /* ERROR: Failed to write BOM */
- dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 20);
- exval = EXIT_FAILURE;
- }
- }
- } break;
- }
+ /*
+ 2019-09-27
+ Attempt to write byte order marker (BOM) if either
+ - BOM explicitly required or
+ - no BOM information, output encoding is system encoding and
+ system encoding indicates BOM.
+ */
+ if (
+ (1 == obom)
+ || ((-1 == obom) && (1 == obom_sys) && (oenc == oenc_sys))
+ ) {
+ if(0 == dk4stream_c32_putc(output_stream, dk_cat_bom, NULL)) {
+ /* ERROR: Failed to write BOM */
+ dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 20);
+ exval = EXIT_FAILURE;
+ }
+ }
} else {
/* ERROR: Failed to create stream */
dk4app_log_base1(app, DK4_LL_ERROR, 90);
@@ -1021,11 +1067,8 @@ error_while_writing_c32(dk4_er_t *erp, dk4_text_stream_position_t *pos)
/** Write one 32 bit character to output.
If the character is a newline, convert to carriage return and
newline sequence if required by crnl settings.
- @param obj Object to modify while processing the character
- (NULL here).
@param c Character to process.
@param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1035,10 +1078,8 @@ error_while_writing_c32(dk4_er_t *erp, dk4_text_stream_position_t *pos)
static
int
c32_real_output(
- void *obj,
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t *pos
)
{
dk4_er_t er;
@@ -1089,11 +1130,8 @@ c32_real_output(
/** Check whether a character is the first character in a line,
write line number if necessary and write the character.
- @param obj Object to modify while processing the character
- (NULL here).
@param c Character to process.
@param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1103,10 +1141,8 @@ c32_real_output(
static
int
c32_after_normalize(
- void *obj,
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t *pos
)
{
char buf[8*(1+sizeof(dk4_um_t))];
@@ -1126,7 +1162,7 @@ c32_after_normalize(
*/
i = dk4str8_len(buf);
while (i < line_number_width) {
- switch (c32_real_output(obj, dkC32(0x20), pos, erp)) {
+ switch (c32_real_output(dkC32(0x20), pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1143,7 +1179,7 @@ c32_after_normalize(
ptr = buf;
while ('\0' != *ptr) {
res = c32_real_output(
- obj, (dk4_c32_t)((unsigned char)(*(ptr++))), pos, erp
+ (dk4_c32_t)((unsigned char)(*(ptr++))), pos
);
switch (res) {
case DK4_TSP_RES_FATAL: {
@@ -1158,7 +1194,7 @@ c32_after_normalize(
}
/* Trailing space after line number
*/
- switch (c32_real_output(obj, dkC32(0x20), pos, erp)) {
+ switch (c32_real_output(dkC32(0x20), pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1174,7 +1210,7 @@ c32_after_normalize(
back = DK4_TSP_RES_FATAL;
}
}
- switch (c32_real_output(obj, c, pos, erp)) {
+ switch (c32_real_output(c, pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1185,7 +1221,7 @@ c32_after_normalize(
} break;
}
} else {
- back = c32_real_output(obj, c, pos, erp);
+ back = c32_real_output(c, pos);
} $? "- c32_after_normalize %d", back
return back;
}
@@ -1193,11 +1229,8 @@ c32_after_normalize(
/** Normalize the text if required and pass characters downwards.
- @param obj Object to modify while processing the character
- (NULL here).
@param c Character to process.
@param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1207,10 +1240,8 @@ c32_after_normalize(
static
int
c32_after_cr_nl(
- void *obj,
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t *pos
)
{
int back = DK4_TSP_RES_OK;
@@ -1221,13 +1252,13 @@ c32_after_cr_nl(
} else {
if (dkC32(0x0A) == c) {
previous_was_text = 0;
- back = c32_after_normalize(obj, c, pos, erp);
+ back = c32_after_normalize(c, pos);
text_in_line = 0;
} else {
if ((0 == previous_was_text) && (0 != text_in_line)) {
- back = c32_after_normalize(obj, dkC32(0x20), pos, erp);
+ back = c32_after_normalize(dkC32(0x20), pos);
}
- switch (c32_after_normalize(obj, c, pos, erp)) {
+ switch (c32_after_normalize(c, pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1242,7 +1273,7 @@ c32_after_cr_nl(
}
}
} else {
- back = c32_after_normalize(obj, c, pos, erp);
+ back = c32_after_normalize(c, pos);
} $? "- c32_after_cr_nl %d", back
return back;
}
@@ -1263,32 +1294,34 @@ c32_after_cr_nl(
static
int
c32_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dk4_c32_t c,
dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
$? "+ c32_handler"
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(erp)
dk4app_set_log_source_line(app, line_number);
if (dkC32(0x0D) == c) { $? ". carriage return"
if (0 != previous_was_cr) {
- back = c32_after_cr_nl(obj, dkC32(0x0D), pos, erp);
+ back = c32_after_cr_nl(dkC32(0x0D), pos);
}
previous_was_cr = 1;
} else {
if (dkC32(0x0A) == c) { $? ". newline"
- back = c32_after_cr_nl(obj, c, pos, erp);
+ back = c32_after_cr_nl(c, pos);
line_number++;
dk4app_set_log_source_line(app, line_number);
line_number_printed = 0;
text_in_line = 0;
} else { $? ". other character"
if (0 != previous_was_cr) {
- back = c32_after_cr_nl(obj, dkC32(0x0D), pos, erp);
+ back = c32_after_cr_nl(dkC32(0x0D), pos);
}
- switch (c32_after_cr_nl(obj, c, pos, erp)) {
+ switch (c32_after_cr_nl(c, pos)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1308,11 +1341,7 @@ c32_handler(
/** Write one dkChar to output (for a newline write a carriage
return, newline sequence if required).
- @param obj Object to modify while processing the character
- (NULL here).
@param c Character to process.
- @param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1321,17 +1350,12 @@ c32_handler(
*/
static
int
-dkc_real_output(
- void *obj,
- dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
-)
+dkc_real_output(dkChar c)
{
dk4_er_t er;
int back = DK4_TSP_RES_OK;
dk4_sig_atomic_t shp;
- $? "+ dkc_real_output %lx", (unsigned long)c
+ $? "+ dkc_real_output %lx", dk4recode_dk_to_ul(c)
initialize_output();
dk4error_init(&er);
#ifdef SIGPIPE
@@ -1378,19 +1402,14 @@ dkc_real_output(
*/
static
int
-dkc_after_normalize(
- void *obj,
- dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
-)
+dkc_after_normalize(dkChar c)
{
char buf[8*(1+sizeof(dk4_um_t))];
char *ptr = NULL;
size_t i = 0;
int res = 0;
int back = DK4_TSP_RES_OK;
- $? "+ dkc_after_normalize %lx", (unsigned long)c
+ $? "+ dkc_after_normalize %lx", dk4recode_dk_to_ul(c)
if (0 != line_numbers) {
if (0 == line_number_printed) {
line_number_printed = 1;
@@ -1402,7 +1421,7 @@ dkc_after_normalize(
*/
i = dk4str8_len(buf);
while (i < line_number_width) {
- switch (dkc_real_output(obj, dkT(' '), pos, erp)) {
+ switch (dkc_real_output(dkT(' '))) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1418,9 +1437,7 @@ dkc_after_normalize(
*/
ptr = buf;
while ('\0' != *ptr) {
- res = dkc_real_output(
- obj, (dkChar)((unsigned char)(*(ptr++))), pos, erp
- );
+ res = dkc_real_output((dkChar)((unsigned char)(*(ptr++))));
switch (res) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
@@ -1434,7 +1451,7 @@ dkc_after_normalize(
}
/* Trailing space after line number
*/
- switch (dkc_real_output(obj, dkT(' '), pos, erp)) {
+ switch (dkc_real_output(dkT(' '))) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1450,7 +1467,7 @@ dkc_after_normalize(
back = DK4_TSP_RES_FATAL;
}
}
- switch (dkc_real_output(obj, c, pos, erp)) {
+ switch (dkc_real_output(c)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1461,7 +1478,7 @@ dkc_after_normalize(
} break;
}
} else {
- back = dkc_real_output(obj, c, pos, erp);
+ back = dkc_real_output(c);
} $? "- dkc_after_normalize %d", back
return back;
}
@@ -1472,8 +1489,6 @@ dkc_after_normalize(
@param obj Object to modify while processing the character
(NULL here).
@param c Character to process.
- @param pos Current position in file or data stream.
- @param erp Error report, may be NULL.
@return Result code:
- DK4_TSP_RES_OK if the character was processed successfully,
- DK4_TSP_RES_ERROR if there was an error but we can continue,
@@ -1483,27 +1498,24 @@ dkc_after_normalize(
static
int
dkc_after_cr_nl(
- void *obj,
- dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dkChar c
)
{
int back = DK4_TSP_RES_OK;
- $? "+ dkc_after_cr_nl %lx", (unsigned long)c
+ $? "+ dkc_after_cr_nl %lx", dk4recode_dk_to_ul(c)
if (0 != normalize_lines) {
if ((dkT('\t') == c) || (dkT(' ') == c) || (dkT('\r') == c)) {
previous_was_text = 0;
} else {
if (dkT('\n') == c) {
previous_was_text = 0;
- back = dkc_after_normalize(obj, c, pos, erp);
+ back = dkc_after_normalize(c);
text_in_line = 0;
} else {
if ((0 == previous_was_text) && (0 != text_in_line)) {
- back = dkc_after_normalize(obj, dkT(' '), pos, erp);
+ back = dkc_after_normalize(dkT(' '));
}
- switch (dkc_after_normalize(obj, c, pos, erp)) {
+ switch (dkc_after_normalize(c)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1518,7 +1530,7 @@ dkc_after_cr_nl(
}
}
} else {
- back = dkc_after_normalize(obj, c, pos, erp);
+ back = dkc_after_normalize(c);
} $? "- dkc_after_cr_nl %d", back
return back;
}
@@ -1540,32 +1552,35 @@ dkc_after_cr_nl(
static
int
dkc_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
- $? "+ dkc_handler %lx", (unsigned long)c
+ $? "+ dkc_handler %lx", dk4recode_dk_to_ul(c)
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
dk4app_set_log_source_line(app, line_number);
if (dkT('\r') == c) {
if (0 != previous_was_cr) {
- back = dkc_after_cr_nl(obj, dkT('\r'), pos, erp);
+ back = dkc_after_cr_nl(dkT('\r'));
}
previous_was_cr = 1;
} else {
if (dkT('\n') == c) {
- back = dkc_after_cr_nl(obj, c, pos, erp);
+ back = dkc_after_cr_nl(c);
line_number++;
dk4app_set_log_source_line(app, line_number);
line_number_printed = 0;
text_in_line = 0;
} else {
if (0 != previous_was_cr) {
- back = dkc_after_cr_nl(obj, dkT('\r'), pos, erp);
+ back = dkc_after_cr_nl(dkT('\r'));
}
- switch (dkc_after_cr_nl(obj, c, pos, erp)) {
+ switch (dkc_after_cr_nl(c)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1746,7 +1761,7 @@ process_one_file(FILE *fipo)
}
if (0 != sig_can_continue(0)) {
if ((0 != there_was_text) && (0 == previous_was_nl)) {
- res = c32_real_output(NULL, dkC32(0x0A), NULL, NULL);
+ res = c32_real_output(dkC32(0x0A), NULL);
switch (res) {
case DK4_TSP_RES_ERROR: { $? "! newline finalizer error"
exval = EXIT_FAILURE;
@@ -1810,7 +1825,7 @@ process_one_file(FILE *fipo)
}
}
if ((0 != there_was_text) && (0 == previous_was_nl)) {
- res = dkc_real_output(NULL, dkT('\n'), NULL, NULL);
+ res = dkc_real_output(dkT('\n'));
switch (res) {
case DK4_TSP_RES_ERROR: {
exval = EXIT_FAILURE;
diff --git a/support/dktools/dk-cat.rc b/support/dktools/dk-cat.rc
index 3750eecb1a..7c56e937c4 100644
--- a/support/dktools/dk-cat.rc
+++ b/support/dktools/dk-cat.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "A cat clone, shows text file contents\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "A cat clone, shows text file contents\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-cat\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-db2t.c b/support/dktools/dk-db2t.c
index faa556471d..a51bb28b7f 100644
--- a/support/dktools/dk-db2t.c
+++ b/support/dktools/dk-db2t.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-db2t.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-db2t.ctr
*/
/** @file dk-db2t.c The dk-db2t module.
@@ -113,12 +91,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4dbit.h"
#include "dk4dbia.h"
#include "dk4maasz.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 89 "dk-db2t.ctr"
+#line 93 "dk-db2t.ctr"
@@ -160,28 +142,11 @@ dkT("verbose"),
NULL
-#line 133 "dk-db2t.ctr"
+#line 137 "dk-db2t.ctr"
};
-static const dkChar * const dk_db2t_type_names[] = {
-/* 0 */
-dkT("bdb"),
-
-/* 1 */
-dkT("ndbm"),
-
-/* 2 */
-dkT("mem"),
-
-NULL
-
-
-#line 143 "dk-db2t.ctr"
-};
-
-
static const dkChar * const dk_db2t_kw_def[] = {
/* 0 */
dkT("Failed to set up signal handlers!"),
@@ -207,7 +172,7 @@ dkT("Failed to write text to standard output!"),
NULL
-#line 177 "dk-db2t.ctr"
+#line 172 "dk-db2t.ctr"
};
@@ -251,7 +216,7 @@ dkT(""),
NULL
-#line 219 "dk-db2t.ctr"
+#line 214 "dk-db2t.ctr"
};
@@ -264,7 +229,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
dkT(""),
dkT("Berkeley DB\tDatabase library."),
@@ -295,27 +261,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
dkT(""),
dkT(""),
@@ -528,7 +494,7 @@ dkT("bzip2/libbzip2 version 1.0.5 of 10 December 2007"),
NULL
-#line 494 "dk-db2t.ctr"
+#line 490 "dk-db2t.ctr"
};
@@ -663,8 +629,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -676,8 +643,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -688,8 +656,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -717,9 +686,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#endif
#ifdef SIGPIPE
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
@@ -742,12 +720,14 @@ sig_can_continue(int check_pipe)
static
int
dk_db2t_traverse(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
const dkChar *k,
const dkChar *v
)
{
int back = 1;
+
+ DK4_UNUSED_ARG(obj)
if (NULL != k) {
if (NULL != v) {
if (0 == dk4fputs(k, stdout, NULL)) {
@@ -1112,10 +1092,10 @@ int main(int argc, char *argv[])
dk4_sig_atomic_t shp = 0; /* Flag: Had SIGPIPE */
-#line 1076 "dk-db2t.ctr"
+#line 1086 "dk-db2t.ctr"
-#line 1077 "dk-db2t.ctr"
+#line 1087 "dk-db2t.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
@@ -1127,13 +1107,13 @@ int main(int argc, char *argv[])
if (NULL != app) {
-#line 1087 "dk-db2t.ctr"
+#line 1097 "dk-db2t.ctr"
dk_db2t_sz_msg = dk4app_string_table_size(dk_db2t_kw_def);
dk_db2t_msg = dk4app_string_table(app, dk_db2t_kwnl[2], dk_db2t_kw_def);
if (0 != dk4app_can_run_normally(app)) {
-#line 1091 "dk-db2t.ctr"
+#line 1101 "dk-db2t.ctr"
dk_db2t_run_with_signal_handlers();
#ifdef SIGPIPE
shp = sig_read_atomic(&sig_had_pipe);
@@ -1162,7 +1142,7 @@ int main(int argc, char *argv[])
} else {
-#line 1118 "dk-db2t.ctr"
+#line 1128 "dk-db2t.ctr"
if (0 != dk4app_help_version_license(app)) {
exval = EXIT_SUCCESS;
}
@@ -1171,7 +1151,7 @@ int main(int argc, char *argv[])
} else {
-#line 1125 "dk-db2t.ctr"
+#line 1135 "dk-db2t.ctr"
dk4fputs(dk_db2t_kwnl[3], stderr, NULL);
}
fflush(stdout);
@@ -1180,10 +1160,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 1132 "dk-db2t.ctr"
+#line 1142 "dk-db2t.ctr"
-#line 1133 "dk-db2t.ctr"
- return (exval); exit(exval);
+#line 1143 "dk-db2t.ctr"
+ exit(exval); return (exval);
}
diff --git a/support/dktools/dk-db2t.ctr b/support/dktools/dk-db2t.ctr
index b5dc522dad..30ce708623 100644
--- a/support/dktools/dk-db2t.ctr
+++ b/support/dktools/dk-db2t.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -82,7 +82,11 @@ license = bsd
#include "dk4dbit.h"
#include "dk4dbia.h"
#include "dk4maasz.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -134,15 +138,6 @@ $!end
-static const dkChar * const dk_db2t_type_names[] = {
-$!string-table macro=dkT
-bdb
-ndbm
-mem
-$!end
-};
-
-
static const dkChar * const dk_db2t_kw_def[] = {
$!string-table macro=dkT
#
@@ -229,7 +224,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
Berkeley DB Database library.
@@ -260,27 +256,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
@@ -625,8 +621,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -638,8 +635,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -650,8 +648,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -679,9 +678,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#endif
#ifdef SIGPIPE
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
@@ -704,12 +712,14 @@ sig_can_continue(int check_pipe)
static
int
dk_db2t_traverse(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
const dkChar *k,
const dkChar *v
)
{
int back = 1;
+
+ DK4_UNUSED_ARG(obj)
if (NULL != k) {
if (NULL != v) {
if (0 == dk4fputs(k, stdout, NULL)) {
@@ -1130,6 +1140,6 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
$? "- main %d", exval
$!trace-end
- return (exval); exit(exval);
+ exit(exval); return (exval);
}
diff --git a/support/dktools/dk-db2t.rc b/support/dktools/dk-db2t.rc
index 4bf2d29ec6..91427300fd 100644
--- a/support/dktools/dk-db2t.rc
+++ b/support/dktools/dk-db2t.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Write simple text database to standard output\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Write simple text database to standard output\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-db2t\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-dbco.c b/support/dktools/dk-dbco.c
index c5111d01e9..ebba05b46c 100644
--- a/support/dktools/dk-dbco.c
+++ b/support/dktools/dk-dbco.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-dbco.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-dbco.ctr
*/
/** @file dk-dbco.c The dk-dbco module.
@@ -103,12 +81,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4dbi.h"
#include "dk4dbia.h"
#include "dk4fput.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 79 "dk-dbco.ctr"
+#line 83 "dk-dbco.ctr"
@@ -120,7 +102,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
dkT(""),
dkT("Berkeley DB\tDatabase library."),
@@ -151,27 +134,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
dkT(""),
dkT(""),
@@ -384,7 +367,7 @@ dkT("bzip2/libbzip2 version 1.0.5 of 10 December 2007"),
NULL
-#line 353 "dk-dbco.ctr"
+#line 358 "dk-dbco.ctr"
};
@@ -413,7 +396,7 @@ dkT(""),
NULL
-#line 380 "dk-dbco.ctr"
+#line 385 "dk-dbco.ctr"
};
@@ -455,7 +438,7 @@ dkT("db.value.max-size"),
NULL
-#line 423 "dk-dbco.ctr"
+#line 428 "dk-dbco.ctr"
};
@@ -491,7 +474,7 @@ dkT("Aborted by signal!"),
NULL
-#line 465 "dk-dbco.ctr"
+#line 470 "dk-dbco.ctr"
};
@@ -629,8 +612,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -641,8 +625,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -705,35 +690,35 @@ dk_dbco_traverse_fct(
-#line 677 "dk-dbco.ctr"
+#line 684 "dk-dbco.ctr"
dbidst = (dk4_dbi_t *)obj;
if (0 != sig_can_continue()) {
if ((NULL != mykb) && (NULL != myvb) && (0 < myks) && (0 < myvs)) {
-#line 681 "dk-dbco.ctr"
+#line 688 "dk-dbco.ctr"
back = dk4dbi_set(dbidst, mykb, myks, myvb, myvs, NULL);
if (1 != back) {
-#line 683 "dk-dbco.ctr"
+#line 690 "dk-dbco.ctr"
/* ERROR: Failed to set entry */
dk4app_log_1(app, dk_dbco_msg, dk_dbco_sz_msg, DK4_LL_ERROR, 2);
}
#if TRACE_DEBUG
else {
-#line 688 "dk-dbco.ctr"
+#line 695 "dk-dbco.ctr"
}
#endif
}
} else {
back = -1;
-#line 693 "dk-dbco.ctr"
+#line 700 "dk-dbco.ctr"
}
-#line 695 "dk-dbco.ctr"
+#line 702 "dk-dbco.ctr"
return back;
}
@@ -746,15 +731,15 @@ dk_dbco_copy_all_entries(dk4_dbi_t *dbisrc, dk4_dbi_t *dbidst)
int res;
-#line 706 "dk-dbco.ctr"
+#line 713 "dk-dbco.ctr"
res = dk4dbi_traverse(dbisrc, (void *)dbidst, dk_dbco_traverse_fct);
if (1 == res) {
exval = EXIT_SUCCESS;
-#line 709 "dk-dbco.ctr"
+#line 716 "dk-dbco.ctr"
}
-#line 710 "dk-dbco.ctr"
+#line 717 "dk-dbco.ctr"
}
@@ -771,7 +756,7 @@ dk_dbco_run_with_filenames(void)
size_t i;
-#line 725 "dk-dbco.ctr"
+#line 732 "dk-dbco.ctr"
/* Process preferences and options
*/
if (0 != dk4app_opt_is_set_short(app, dkT('R'), NULL)) {
@@ -797,7 +782,7 @@ dk_dbco_run_with_filenames(void)
}
-#line 749 "dk-dbco.ctr"
+#line 756 "dk-dbco.ctr"
/* Allocate memory if necessary
*/
@@ -819,7 +804,7 @@ dk_dbco_run_with_filenames(void)
}
-#line 769 "dk-dbco.ctr"
+#line 776 "dk-dbco.ctr"
/* Open databases
*/
@@ -837,7 +822,7 @@ dk_dbco_run_with_filenames(void)
}
-#line 785 "dk-dbco.ctr"
+#line 792 "dk-dbco.ctr"
dbisrc = dk4dbi_open_sizes_app(fnsrc, 0, 0, ks, vs, NULL, app);
if (NULL == dbisrc) {
goto finished;
@@ -851,7 +836,7 @@ dk_dbco_run_with_filenames(void)
}
-#line 797 "dk-dbco.ctr"
+#line 804 "dk-dbco.ctr"
/* Run processing
*/
@@ -875,7 +860,7 @@ dk_dbco_run_with_filenames(void)
dk4mem_release(akb) ;
-#line 819 "dk-dbco.ctr"
+#line 826 "dk-dbco.ctr"
}
@@ -886,7 +871,7 @@ dk_dbco_normal_run(void)
{
-#line 828 "dk-dbco.ctr"
+#line 835 "dk-dbco.ctr"
if (2 == dk4app_get_argc(app)) {
dk_dbco_run_with_filenames();
} else {
@@ -895,7 +880,7 @@ dk_dbco_normal_run(void)
}
-#line 835 "dk-dbco.ctr"
+#line 842 "dk-dbco.ctr"
}
@@ -1043,10 +1028,10 @@ int main(int argc, char *argv[])
int hvl = 0; /* Flag: Help, version, license */
-#line 981 "dk-dbco.ctr"
+#line 988 "dk-dbco.ctr"
-#line 982 "dk-dbco.ctr"
+#line 989 "dk-dbco.ctr"
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
argc, argv,
@@ -1088,10 +1073,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stderr();
-#line 1022 "dk-dbco.ctr"
+#line 1029 "dk-dbco.ctr"
-#line 1023 "dk-dbco.ctr"
+#line 1030 "dk-dbco.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-dbco.ctr b/support/dktools/dk-dbco.ctr
index 6bca35ec5b..5cca8b20be 100644
--- a/support/dktools/dk-dbco.ctr
+++ b/support/dktools/dk-dbco.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -72,7 +72,11 @@ license = bsd
#include "dk4dbi.h"
#include "dk4dbia.h"
#include "dk4fput.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -88,7 +92,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
Berkeley DB Database library.
@@ -119,27 +124,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
@@ -599,8 +604,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -611,8 +617,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
diff --git a/support/dktools/dk-dbco.rc b/support/dktools/dk-dbco.rc
index 6c85246c51..533a67b3d0 100644
--- a/support/dktools/dk-dbco.rc
+++ b/support/dktools/dk-dbco.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Copy and convert simple databases\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Copy and convert simple databases\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-dbco\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-eradisk.c b/support/dktools/dk-eradisk.c
index 4fd431a1d0..b51728bd97 100644
--- a/support/dktools/dk-eradisk.c
+++ b/support/dktools/dk-eradisk.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-eradisk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-eradisk.ctr
*/
/** @file dk-eradisk.c The dk-eradisk module.
@@ -114,12 +92,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mem.h"
#include "dk4numco.h"
#include "dk4fdwre.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 89 "dk-eradisk.ctr"
+#line 93 "dk-eradisk.ctr"
@@ -138,7 +120,7 @@ dkT("dk-eradisk.str"),
NULL
-#line 109 "dk-eradisk.ctr"
+#line 113 "dk-eradisk.ctr"
};
@@ -174,7 +156,7 @@ dkT("Block size must not be 0!"),
NULL
-#line 151 "dk-eradisk.ctr"
+#line 155 "dk-eradisk.ctr"
};
@@ -197,7 +179,7 @@ dkT("The program generates a data stream to erase a disk."),
dkT("Before retiring a disk or handing a disk over to another user one"),
dkT("should remove all contents."),
dkT("The output from dk-eradisk can be used as input for the ``dd'' program"),
-dkT("to savely clean a disk."),
+dkT("to safely clean a disk."),
dkT(""),
dkT("OPTIONS"),
dkT(""),
@@ -236,12 +218,12 @@ dkT("to see license information."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-eradisk/"),
dkT(""),
NULL
-#line 216 "dk-eradisk.ctr"
+#line 220 "dk-eradisk.ctr"
};
@@ -253,7 +235,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -280,27 +263,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -374,7 +357,7 @@ dkT(""),
NULL
-#line 347 "dk-eradisk.ctr"
+#line 352 "dk-eradisk.ctr"
};
@@ -508,8 +491,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -519,8 +503,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -529,8 +514,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -556,10 +542,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -604,7 +598,7 @@ produce_output(void)
if (sizeof(default_buffer) >= blks) {
buffer = default_buffer;
} else {
- allocated_buffer = dk4mem_malloc_bytes(blks, NULL);
+ allocated_buffer = (char *)dk4mem_malloc_bytes(blks, NULL);
if (NULL != allocated_buffer) {
buffer = allocated_buffer;
} else {
@@ -885,10 +879,10 @@ int main(int argc, char *argv[])
size_t sz;
-#line 856 "dk-eradisk.ctr"
+#line 872 "dk-eradisk.ctr"
-#line 857 "dk-eradisk.ctr"
+#line 873 "dk-eradisk.ctr"
app = dk4app_open_cmd(
argc, argv, dk_eradisk_options, dk_eradisk_sz_options,
@@ -950,10 +944,10 @@ int main(int argc, char *argv[])
}
-#line 917 "dk-eradisk.ctr"
+#line 933 "dk-eradisk.ctr"
-#line 918 "dk-eradisk.ctr"
+#line 934 "dk-eradisk.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-eradisk.ctr b/support/dktools/dk-eradisk.ctr
index da4069a92f..c7eac33acc 100644
--- a/support/dktools/dk-eradisk.ctr
+++ b/support/dktools/dk-eradisk.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -82,7 +82,11 @@ license = bsd
#include "dk4mem.h"
#include "dk4numco.h"
#include "dk4fdwre.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -171,7 +175,7 @@ The program generates a data stream to erase a disk.
Before retiring a disk or handing a disk over to another user one
should remove all contents.
The output from dk-eradisk can be used as input for the ``dd'' program
-to savely clean a disk.
+to safely clean a disk.
OPTIONS
@@ -210,7 +214,7 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-eradisk/
$!end
};
@@ -225,7 +229,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -252,27 +257,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -477,8 +482,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -488,8 +494,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -498,8 +505,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -525,10 +533,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -573,7 +589,7 @@ produce_output(void)
if (sizeof(default_buffer) >= blks) {
buffer = default_buffer;
} else {
- allocated_buffer = dk4mem_malloc_bytes(blks, NULL);
+ allocated_buffer = (char *)dk4mem_malloc_bytes(blks, NULL);
if (NULL != allocated_buffer) {
buffer = allocated_buffer;
} else {
diff --git a/support/dktools/dk-eradisk.rc b/support/dktools/dk-eradisk.rc
index d1d466fe56..4bef3402fd 100644
--- a/support/dktools/dk-eradisk.rc
+++ b/support/dktools/dk-eradisk.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Create data stream to erase a disk\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Create data stream to erase a disk\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-eradisk\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-fic.c b/support/dktools/dk-fic.c
index 9d51298960..d4d84225e2 100644
--- a/support/dktools/dk-fic.c
+++ b/support/dktools/dk-fic.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-fic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-fic.ctr
*/
@@ -101,18 +79,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4md.h"
#include "dk4maodd.h"
#include "dk4filed.h"
-#include "dk4fileid.h"
#include "dk4filei.h"
#include "dk4fileia.h"
#include "dk4strd.h"
#include "dk4numl.h"
#include "dk4maidddu.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 84 "dk-fic.ctr"
+#line 87 "dk-fic.ctr"
@@ -142,12 +123,12 @@ dkT("find <directory> -type f | dk-fic > checklist.txt\t\tCreate check-"),
dkT("dk-ls -r -tf -pn <directory> | dk-fic > checklist.txt\t\tsum list."),
dkT("dk-fic -c < checklist.txt\t\t\t\t\tVerify files."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-fic/"),
dkT(""),
NULL
-#line 117 "dk-fic.ctr"
+#line 120 "dk-fic.ctr"
};
@@ -160,7 +141,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -187,27 +169,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -281,7 +263,7 @@ dkT(""),
NULL
-#line 249 "dk-fic.ctr"
+#line 253 "dk-fic.ctr"
};
@@ -322,7 +304,7 @@ dkT("dk-fic"),
NULL
-#line 298 "dk-fic.ctr"
+#line 302 "dk-fic.ctr"
};
@@ -456,7 +438,7 @@ dkT("."),
NULL
-#line 423 "dk-fic.ctr"
+#line 427 "dk-fic.ctr"
};
/* VARIABLES */
@@ -598,13 +580,25 @@ static int dk_fic_verbosity = 1;
/** Input encoding expected on standard input.
*/
-static int dk_fic_ie_stdin = DK4_FILE_ENCODING_ASCII;
+static int dk_fic_ie_stdin =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Input encoding expected on files.
*/
-static int dk_fic_ie_file = DK4_FILE_ENCODING_ASCII;
+static int dk_fic_ie_file =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -662,8 +656,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -673,8 +668,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -683,8 +679,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -708,10 +705,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -1069,10 +1074,10 @@ dk_fic_checksum_file(const dkChar *filename, dk4_um_t filesize)
static
int
dk_fic_create_line_handler(
- void *obj,
+ void *DK4_ARG_UNUSED(obj),
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_file_info_t fi;
@@ -1080,6 +1085,10 @@ dk_fic_create_line_handler(
dk4_um_t filesize;
int res;
int back = DK4_TSP_RES_OK;
+
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
dk4str_delnl(line);
dk4path_correct_sep(line);
filesize = (dk4_um_t)0UL;
@@ -1132,7 +1141,7 @@ dk_fic_compare_checksums(
int back = 0;
-#line 1097 "dk-fic.ctr"
+#line 1128 "dk-fic.ctr"
if ((NULL != curcs) && (NULL != orics) && (0 < curlen)) {
back = 1;
while ((1 == back) && (0 < curlen--)) {
@@ -1142,7 +1151,7 @@ dk_fic_compare_checksums(
}
}
-#line 1105 "dk-fic.ctr"
+#line 1136 "dk-fic.ctr"
return back;
}
@@ -1158,10 +1167,10 @@ dk_fic_compare_checksums(
static
int
dk_fic_verify_line_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_file_info_t fi; /* File information */
@@ -1196,30 +1205,33 @@ dk_fic_verify_line_handler(
dk4str_delnl(line);
-#line 1157 "dk-fic.ctr"
+#line 1188 "dk-fic.ctr"
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
/* dk4path_correct_sep(line); Correct file name only! */
for (i = 0; i < 16; i++) { tok[i] = NULL; }
if (0 != dk_fic_first_line) {
-#line 1160 "dk-fic.ctr"
+#line 1194 "dk-fic.ctr"
dk_fic_first_line = 0;
ntok = dk4str_tokenize(tok, 16, line, NULL, NULL);
if (3 == ntok) {
-#line 1163 "dk-fic.ctr"
+#line 1197 "dk-fic.ctr"
if (dkT('#') == *(tok[0])) {
if (0 == dk4str_cmp(dk_fic_kwnl[9], tok[1])) {
endptr = NULL;
if (0 != dk4ma_input_dk_dec_dk4_um_t(&um, tok[2], &endptr, 1, NULL)) {
if ((dk4_um_t)3UL == um) {
-#line 1168 "dk-fic.ctr"
+#line 1202 "dk-fic.ctr"
dk_fic_num_mds = 3;
back = DK4_TSP_RES_OK;
} else {
if ((dk4_um_t)4UL == um) {
-#line 1172 "dk-fic.ctr"
+#line 1206 "dk-fic.ctr"
dk_fic_num_mds = 4;
back = DK4_TSP_RES_OK;
#if !DK4_HAVE_SHA512
@@ -1230,24 +1242,24 @@ dk_fic_verify_line_handler(
#endif
} else {
-#line 1181 "dk-fic.ctr"
+#line 1215 "dk-fic.ctr"
}
}
} else {
-#line 1184 "dk-fic.ctr"
+#line 1218 "dk-fic.ctr"
}
} else {
-#line 1186 "dk-fic.ctr"
+#line 1220 "dk-fic.ctr"
}
} else {
-#line 1188 "dk-fic.ctr"
+#line 1222 "dk-fic.ctr"
}
} else {
-#line 1190 "dk-fic.ctr"
+#line 1224 "dk-fic.ctr"
}
if (DK4_TSP_RES_ERROR == back) {
/* ERROR: Syntax error */
@@ -1258,25 +1270,25 @@ dk_fic_verify_line_handler(
}
} else {
-#line 1199 "dk-fic.ctr"
+#line 1233 "dk-fic.ctr"
ntok = dk4str_tokenize(tok, 16, line, NULL, NULL);
-#line 1201 "dk-fic.ctr"
+#line 1235 "dk-fic.ctr"
if ((5 == ntok) && (3 == dk_fic_num_mds)) {
-#line 1202 "dk-fic.ctr"
+#line 1236 "dk-fic.ctr"
back = DK4_TSP_RES_OK;
} else {
if ((6 == ntok) && (4 == dk_fic_num_mds)) {
-#line 1205 "dk-fic.ctr"
+#line 1239 "dk-fic.ctr"
back = DK4_TSP_RES_OK;
}
}
if (DK4_TSP_RES_OK == back) {
-#line 1209 "dk-fic.ctr"
+#line 1243 "dk-fic.ctr"
#if VERSION_BEFORE_20150821
back = DK4_TSP_RES_ERROR;
#endif
@@ -1285,21 +1297,21 @@ dk_fic_verify_line_handler(
dk4fileinfo_init(&fi);
if (0 != dk4fileinfo_app(&fi, tok[ntok - 1], app)) {
-#line 1216 "dk-fic.ctr"
+#line 1250 "dk-fic.ctr"
filesize = (dk4_um_t)0UL;
res = dk4fileinfo_size(
&filesize, &fi, DK4_FILE_INFO_CONTENTS_DATA_TARGET, &er
);
if (0 != res) {
-#line 1221 "dk-fic.ctr"
+#line 1255 "dk-fic.ctr"
res = dk4ma_input_dk_dec_dk4_um_t(&um, tok[ntok-2], &endptr, 1, NULL);
if (0 != res) {
-#line 1223 "dk-fic.ctr"
+#line 1257 "dk-fic.ctr"
if (um == filesize) {
-#line 1224 "dk-fic.ctr"
+#line 1258 "dk-fic.ctr"
ok = 1;
/* Initialize message digest contexts.
*/
@@ -1316,37 +1328,37 @@ dk_fic_verify_line_handler(
#if DK4_HAVE_SHA512
if (6 == ntok) {
-#line 1239 "dk-fic.ctr"
+#line 1273 "dk-fic.ctr"
res = dk4md_ctx_init(
&ctx_sha512,DK4_MD_SHA512,DK4_BINARY_TO_TEXT_ENCODING_A85,NULL
);
if (0 == res) {
-#line 1243 "dk-fic.ctr"
+#line 1277 "dk-fic.ctr"
ok = 0;
}
}
#endif
if (0 != ok) {
-#line 1248 "dk-fic.ctr"
+#line 1282 "dk-fic.ctr"
ok = 0;
fipo = dk4fopen_app(tok[ntok-1], dk_fic_kwnl[5], tests, app);
if (NULL != fipo) {
-#line 1251 "dk-fic.ctr"
+#line 1285 "dk-fic.ctr"
ok = 1;
cc = 1;
while (1 == cc) {
-#line 1254 "dk-fic.ctr"
+#line 1288 "dk-fic.ctr"
if (dk_fic_can_continue()) {
-#line 1255 "dk-fic.ctr"
+#line 1289 "dk-fic.ctr"
rdb = fread(data_buf, 1, sizeof(data_buf), fipo);
if (0 < rdb) {
-#line 1257 "dk-fic.ctr"
+#line 1291 "dk-fic.ctr"
/* Add data from file to message digest contexts.
*/
res = dk4md_ctx_add(&ctx_md5, data_buf, rdb, NULL);
@@ -1369,11 +1381,11 @@ dk_fic_verify_line_handler(
}
} else {
-#line 1278 "dk-fic.ctr"
+#line 1312 "dk-fic.ctr"
cc = 0;
if (0 != ferror(fipo)) {
-#line 1280 "dk-fic.ctr"
+#line 1314 "dk-fic.ctr"
cc = -1;
/* ERROR Read attempt failed */
oldsourcename = dk4app_get_log_source_file(app);
@@ -1390,14 +1402,14 @@ dk_fic_verify_line_handler(
}
} else {
-#line 1295 "dk-fic.ctr"
+#line 1329 "dk-fic.ctr"
cc = -1;
}
}
fclose(fipo);
if (0 == cc) {
-#line 1300 "dk-fic.ctr"
+#line 1334 "dk-fic.ctr"
/* Retrieve results from message digest contexts.
*/
md5ptr = NULL; sha1ptr = NULL; ripemd160ptr = NULL;
@@ -1405,7 +1417,7 @@ dk_fic_verify_line_handler(
#if DK4_HAVE_SHA512
sha512ptr = NULL;
-#line 1306 "dk-fic.ctr"
+#line 1340 "dk-fic.ctr"
sha512sz = 0;
#endif
res = dk4md_ctx_finish(&md5ptr, &md5sz, &ctx_md5, NULL);
@@ -1434,12 +1446,12 @@ dk_fic_verify_line_handler(
#if DK4_HAVE_SHA512
if (6 == ntok) {
-#line 1333 "dk-fic.ctr"
+#line 1367 "dk-fic.ctr"
res = dk4md_ctx_finish(
&sha512ptr, &sha512sz, &ctx_sha512, NULL
);
-#line 1336 "dk-fic.ctr"
+#line 1370 "dk-fic.ctr"
if (0 == res) {
ok = 0;
#if VERSION_BEFORE_20150821
@@ -1458,33 +1470,33 @@ dk_fic_verify_line_handler(
*/
if (0 != ok) {
-#line 1353 "dk-fic.ctr"
+#line 1387 "dk-fic.ctr"
res = dk_fic_compare_checksums(md5ptr, tok[0], md5sz);
if (0 == res) {
-#line 1355 "dk-fic.ctr"
+#line 1389 "dk-fic.ctr"
ok = 0;
}
}
if (0 != ok) {
-#line 1359 "dk-fic.ctr"
+#line 1393 "dk-fic.ctr"
res = dk_fic_compare_checksums(sha1ptr, tok[1], sha1sz);
if (0 == res) {
-#line 1361 "dk-fic.ctr"
+#line 1395 "dk-fic.ctr"
ok = 0;
}
}
if (0 != ok) {
-#line 1365 "dk-fic.ctr"
+#line 1399 "dk-fic.ctr"
res = dk_fic_compare_checksums(
ripemd160ptr, tok[2], ripemd160sz
);
if (0 == res) {
-#line 1369 "dk-fic.ctr"
+#line 1403 "dk-fic.ctr"
ok = 0;
}
}
@@ -1492,16 +1504,16 @@ dk_fic_verify_line_handler(
#if DK4_HAVE_SHA512
if (6 == ntok) {
-#line 1375 "dk-fic.ctr"
+#line 1409 "dk-fic.ctr"
if (0 != ok) {
-#line 1376 "dk-fic.ctr"
+#line 1410 "dk-fic.ctr"
res = dk_fic_compare_checksums(
sha512ptr, tok[3], sha512sz
);
if (0 == res) {
-#line 1380 "dk-fic.ctr"
+#line 1414 "dk-fic.ctr"
ok = 0;
}
}
@@ -1509,16 +1521,16 @@ dk_fic_verify_line_handler(
#endif
} else {
-#line 1386 "dk-fic.ctr"
+#line 1420 "dk-fic.ctr"
ok = 0;
}
} else {
-#line 1389 "dk-fic.ctr"
+#line 1423 "dk-fic.ctr"
}
} else {
-#line 1391 "dk-fic.ctr"
+#line 1425 "dk-fic.ctr"
/* ERROR Failed to initialize MD contexts */
dk4app_log_3(
app, dk_fic_msg, dk_fic_sz_msg, DK4_LL_ERROR, 11, 12,
@@ -1527,11 +1539,11 @@ dk_fic_verify_line_handler(
}
} else {
-#line 1398 "dk-fic.ctr"
+#line 1432 "dk-fic.ctr"
}
if (0 != ok) {
-#line 1400 "dk-fic.ctr"
+#line 1434 "dk-fic.ctr"
if (2 <= dk_fic_verbosity) {
if (0 == dk4fputs(dk_fic_msg[2], stdout, NULL)) {
exval = EXIT_FAILURE; dk_fic_write_error = 1;
@@ -1545,7 +1557,7 @@ dk_fic_verify_line_handler(
}
} else {
-#line 1412 "dk-fic.ctr"
+#line 1446 "dk-fic.ctr"
exval = EXIT_FAILURE;
if (1 <= dk_fic_verbosity) {
if (0 == dk4fputs(dk_fic_msg[3], stdout, NULL)) {
@@ -1561,7 +1573,7 @@ dk_fic_verify_line_handler(
}
} else {
-#line 1426 "dk-fic.ctr"
+#line 1460 "dk-fic.ctr"
/* Syntax error */
dk4app_log_3(
app, dk_fic_msg, dk_fic_sz_msg, DK4_LL_ERROR, 21, 22, tok[ntok-2]
@@ -1570,7 +1582,7 @@ dk_fic_verify_line_handler(
}
} else {
-#line 1433 "dk-fic.ctr"
+#line 1467 "dk-fic.ctr"
/* ERROR: Failed to retrieve file size */
dk4app_log_3(
app, dk_fic_msg, dk_fic_sz_msg, DK4_LL_ERROR, 15, 16, line
@@ -1579,7 +1591,7 @@ dk_fic_verify_line_handler(
}
} else {
-#line 1440 "dk-fic.ctr"
+#line 1474 "dk-fic.ctr"
/* ERROR: Failed to information about file, already reported */
exval = EXIT_FAILURE;
}
@@ -1588,7 +1600,7 @@ dk_fic_verify_line_handler(
#endif
} else {
-#line 1447 "dk-fic.ctr"
+#line 1481 "dk-fic.ctr"
/* Syntax error */
if (3 == dk_fic_num_mds) {
dk4app_log_1(app, dk_fic_msg, dk_fic_sz_msg, DK4_LL_ERROR, 20);
@@ -1600,7 +1612,7 @@ dk_fic_verify_line_handler(
}
-#line 1457 "dk-fic.ctr"
+#line 1491 "dk-fic.ctr"
return back;
}
@@ -1625,7 +1637,7 @@ dk_fic_process_file(FILE *fipo, const dkChar *fn, int ie)
unsigned char ub;
-#line 1480 "dk-fic.ctr"
+#line 1514 "dk-fic.ctr"
dk4error_init(&er_en);
dk4error_init(&er_pr);
dk4error_init(&er);
@@ -1693,7 +1705,7 @@ dk_fic_process_file(FILE *fipo, const dkChar *fn, int ie)
}
-#line 1546 "dk-fic.ctr"
+#line 1580 "dk-fic.ctr"
}
@@ -1760,7 +1772,7 @@ dk_fic_expand_filename(const dkChar *pattern)
int can_continue;
-#line 1611 "dk-fic.ctr"
+#line 1645 "dk-fic.ctr"
fne = dk4app_fne_open(pattern, app);
if (NULL != fne) {
do {
@@ -1791,7 +1803,7 @@ dk_fic_expand_filename(const dkChar *pattern)
}
-#line 1640 "dk-fic.ctr"
+#line 1674 "dk-fic.ctr"
}
#endif
@@ -2146,10 +2158,10 @@ int main(int argc, char *argv[])
{
-#line 1993 "dk-fic.ctr"
+#line 2027 "dk-fic.ctr"
-#line 1994 "dk-fic.ctr"
+#line 2028 "dk-fic.ctr"
dk_fic_num_len = dk4numlength(sizeof(dk4_um_t), 0);
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
@@ -2200,10 +2212,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 2043 "dk-fic.ctr"
+#line 2077 "dk-fic.ctr"
-#line 2044 "dk-fic.ctr"
+#line 2078 "dk-fic.ctr"
exit (exval); return exval;
}
diff --git a/support/dktools/dk-fic.ctr b/support/dktools/dk-fic.ctr
index bb9251480f..baf1e14c55 100644
--- a/support/dktools/dk-fic.ctr
+++ b/support/dktools/dk-fic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -71,13 +71,16 @@ license = bsd
#include "dk4md.h"
#include "dk4maodd.h"
#include "dk4filed.h"
-#include "dk4fileid.h"
#include "dk4filei.h"
#include "dk4fileia.h"
#include "dk4strd.h"
#include "dk4numl.h"
#include "dk4maidddu.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -111,7 +114,7 @@ find <directory> -type f | dk-fic > checklist.txt Create check-
dk-ls -r -tf -pn <directory> | dk-fic > checklist.txt sum list.
dk-fic -c < checklist.txt Verify files.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-fic/
$!end
};
@@ -127,7 +130,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -154,27 +158,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -561,13 +565,25 @@ static int dk_fic_verbosity = 1;
/** Input encoding expected on standard input.
*/
-static int dk_fic_ie_stdin = DK4_FILE_ENCODING_ASCII;
+static int dk_fic_ie_stdin =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Input encoding expected on files.
*/
-static int dk_fic_ie_file = DK4_FILE_ENCODING_ASCII;
+static int dk_fic_ie_file =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -625,8 +641,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -636,8 +653,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -646,8 +664,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -671,10 +690,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -1032,10 +1059,10 @@ dk_fic_checksum_file(const dkChar *filename, dk4_um_t filesize)
static
int
dk_fic_create_line_handler(
- void *obj,
+ void *DK4_ARG_UNUSED(obj),
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_file_info_t fi;
@@ -1043,6 +1070,10 @@ dk_fic_create_line_handler(
dk4_um_t filesize;
int res;
int back = DK4_TSP_RES_OK;
+
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
dk4str_delnl(line);
dk4path_correct_sep(line);
filesize = (dk4_um_t)0UL;
@@ -1117,10 +1148,10 @@ dk_fic_compare_checksums(
static
int
dk_fic_verify_line_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_file_info_t fi; /* File information */
@@ -1154,6 +1185,9 @@ dk_fic_verify_line_handler(
int ok = 0; /* Flag: Check passed */
dk4str_delnl(line);
$? "+ verify_line_handler \"%!ds\"", line
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
/* dk4path_correct_sep(line); Correct file name only! */
for (i = 0; i < 16; i++) { tok[i] = NULL; }
if (0 != dk_fic_first_line) { $? ". first line"
diff --git a/support/dktools/dk-fic.rc b/support/dktools/dk-fic.rc
index e286a64b49..f35be7cde7 100644
--- a/support/dktools/dk-fic.rc
+++ b/support/dktools/dk-fic.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "File integrity check\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "File integrity check\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-fic\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-hex.c b/support/dktools/dk-hex.c
index 5773acc675..ad10419f82 100644
--- a/support/dktools/dk-hex.c
+++ b/support/dktools/dk-hex.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-hex.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-hex.ctr
*/
@@ -124,12 +102,16 @@ See dk_hex_help_text for details.
#include "dk4mpl.h"
#include "dk4strd.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 103 "dk-hex.ctr"
+#line 107 "dk-hex.ctr"
@@ -160,7 +142,7 @@ dkT("verbose"),
NULL
-#line 139 "dk-hex.ctr"
+#line 143 "dk-hex.ctr"
};
@@ -184,12 +166,12 @@ dkT("--manual\t\t*** SHOW FULL MANUAL. ***"),
dkT("--version\t\tShow version information."),
dkT("--license\t\tShow license information."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-hex/"),
dkT(""),
NULL
-#line 166 "dk-hex.ctr"
+#line 170 "dk-hex.ctr"
};
@@ -201,7 +183,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -228,27 +211,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -322,7 +305,7 @@ dkT(""),
NULL
-#line 297 "dk-hex.ctr"
+#line 302 "dk-hex.ctr"
};
@@ -351,7 +334,7 @@ dkT("Write attempts to standard output failed!"),
NULL
-#line 330 "dk-hex.ctr"
+#line 335 "dk-hex.ctr"
};
@@ -527,8 +510,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-dk_hex_sig_handler_pipe(int signo)
+dk_hex_sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&dk_hex_sig_had_pipe) = 1;
}
#endif
@@ -538,8 +522,9 @@ dk_hex_sig_handler_pipe(int signo)
*/
static
void
-dk_hex_sig_handler_int(int signo)
+dk_hex_sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&dk_hex_sig_had_int) = 1;
}
@@ -548,8 +533,9 @@ dk_hex_sig_handler_int(int signo)
*/
static
void
-dk_hex_sig_handler_term(int signo)
+dk_hex_sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&dk_hex_sig_had_term) = 1;
}
@@ -573,10 +559,18 @@ dk_hex_sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != dk_hex_sig_read_atomic(&dk_hex_sig_had_pipe)) { back = 0; }
}
@@ -895,13 +889,13 @@ dk_hex_run_the_functions(void)
}
-#line 872 "dk-hex.ctr"
+#line 888 "dk-hex.ctr"
-#line 873 "dk-hex.ctr"
+#line 889 "dk-hex.ctr"
-#line 874 "dk-hex.ctr"
+#line 890 "dk-hex.ctr"
/*
Process input files or standard input
*/
@@ -1138,10 +1132,10 @@ int main(int argc, char *argv[])
int shp;
-#line 1109 "dk-hex.ctr"
+#line 1125 "dk-hex.ctr"
-#line 1110 "dk-hex.ctr"
+#line 1126 "dk-hex.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
@@ -1192,10 +1186,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 1159 "dk-hex.ctr"
+#line 1175 "dk-hex.ctr"
-#line 1160 "dk-hex.ctr"
+#line 1176 "dk-hex.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-hex.ctr b/support/dktools/dk-hex.ctr
index 441d3bfcc1..69c67c9541 100644
--- a/support/dktools/dk-hex.ctr
+++ b/support/dktools/dk-hex.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -96,7 +96,11 @@ See dk_hex_help_text for details.
#include "dk4mpl.h"
#include "dk4strd.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -160,7 +164,7 @@ Options:
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-hex/
$!end
};
@@ -175,7 +179,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -202,27 +207,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -502,8 +507,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-dk_hex_sig_handler_pipe(int signo)
+dk_hex_sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&dk_hex_sig_had_pipe) = 1;
}
#endif
@@ -513,8 +519,9 @@ dk_hex_sig_handler_pipe(int signo)
*/
static
void
-dk_hex_sig_handler_int(int signo)
+dk_hex_sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&dk_hex_sig_had_int) = 1;
}
@@ -523,8 +530,9 @@ dk_hex_sig_handler_int(int signo)
*/
static
void
-dk_hex_sig_handler_term(int signo)
+dk_hex_sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&dk_hex_sig_had_term) = 1;
}
@@ -548,10 +556,18 @@ dk_hex_sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != dk_hex_sig_read_atomic(&dk_hex_sig_had_pipe)) { back = 0; }
}
diff --git a/support/dktools/dk-hex.rc b/support/dktools/dk-hex.rc
index 37c2aef850..cca19fd4fa 100644
--- a/support/dktools/dk-hex.rc
+++ b/support/dktools/dk-hex.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Show file contents in hexadecimal notation\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Show file contents in hexadecimal notation\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-hex\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-lines.c b/support/dktools/dk-lines.c
new file mode 100644
index 0000000000..1f0f162341
--- /dev/null
+++ b/support/dktools/dk-lines.c
@@ -0,0 +1,2769 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-lines.ctr
+*/
+
+
+#line 9 "dk-lines.ctr"
+
+/** @file dk-lines.c The dk-lines program.
+ The dk_lines_help_text array below shows details.
+
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#include <stdio.h>
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_UNISTD_H
+#ifndef UNISTD_H_INCLUDED
+#include <unistd.h>
+#define UNISTD_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_PROCESS_H
+#ifndef PROCESS_H_INCLUDED
+#include <process.h>
+#define PROCESS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_SYS_TYPES_H
+#ifndef SYS_TYPES_H_INCLUDED
+#include <sys/types.h>
+#define SYS_TYPES_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_SIGNAL_H
+#ifndef SIGNAL_H_INCLUDED
+#include <signal.h>
+#define SIGNAL_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#include "dk4enc.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRDA_H_INCLUDED
+#include "dk4strda.h"
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#include "dk4dir.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef DK4AOPT_H_INCLUDED
+#include "dk4aopt.h"
+#endif
+
+#ifndef DK4MEMA_H_INCLUDED
+#include "dk4mema.h"
+#endif
+
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
+
+#ifndef DK4MAADU_H_INCLUDED
+#include "dk4maadu.h"
+#endif
+
+#ifndef DK4MAIDDDU_H_INCLUDED
+#include "dk4maidddu.h"
+#endif
+
+#ifndef DK4MAODD_H_INCLUDED
+#include "dk4maodd.h"
+#endif
+
+#ifndef DK4FPUT_H_INCLUDED
+#include "dk4fput.h"
+#endif
+
+#ifndef DK4TSPDK_H_INCLUDED
+#include "dk4tspdk.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4FOPDA_H_INCLUDED
+#include "dk4fopda.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#ifndef DK4TIME_H_INCLUDED
+#include "dk4time.h"
+#endif
+
+#ifndef DK4TIMEDK_H_INCLUDED
+#include "dk4timedk.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
+
+
+
+
+#line 168 "dk-lines.ctr"
+
+
+
+#ifndef DK_LINES_BUFFER_SIZE
+/** Text buffer size.
+*/
+#define DK_LINES_BUFFER_SIZE 4096
+#endif
+
+
+
+/** Ring buffer element.
+*/
+typedef struct {
+ dkChar *str; /**< Line text. */
+ dk4_um_t lineno; /**< Line number. */
+ size_t buflen; /**< Length of str buffer (number of dkChar). */
+} rbe_t;
+
+
+
+/** Range specification types.
+*/
+enum {
+ RANGE_NONE_NONE = 0 , /**< No ranges specified. */
+ RANGE_NONE_POS , /**< No start, positive end. */
+ RANGE_NONE_NEG , /**< No start, negative end. */
+ RANGE_POS_NONE , /**< Positive start, no end. */
+ RANGE_POS_POS , /**< Positive start, positive end. */
+ RANGE_POS_NEG , /**< Positive start, negative end. */
+ RANGE_NEG_NONE , /**< Negative start, no end. */
+ RANGE_NEG_POS , /**< Negative start, positive end. */
+ RANGE_NEG_NEG , /**< Negative start, negative end. */
+};
+
+
+
+/** Input line buffer.
+*/
+static dkChar default_input_line_buffer[DK_LINES_BUFFER_SIZE];
+
+
+
+/** Buffer to store current date and time.
+*/
+static dkChar date_buffer[64];
+
+
+
+/** Default text, used if help text file is not found.
+*/
+static const dkChar * const dk_lines_help_text[] = {
+dkT(""),
+dkT("Select lines from text"),
+dkT(""),
+dkT("dk-lines [<options>] [<files>]"),
+dkT(""),
+dkT("Options:"),
+dkT("-i encoding Expected input encoding, one from: plain, ascii, ansi, utf-8,"),
+dkT(" utf-16, utf-16le, utf-16be, c32, c32le, c32be."),
+dkT("-f string Show lines lexicographically equal or larger than string."),
+dkT("-t string Show lines lexicographically equal or smaller than string."),
+dkT("-l spec Specification of line numbers in format <start>/<end> (inclusive)"),
+dkT(" to pass through, applied after -f and -t processing. Examples:"),
+dkT(" 5 (5 and following), 5/8 (5, 6, 7, 8), /8 (1...8), 5/-3 (5 and"),
+dkT(" following except final 2 lines), -5 (final 5 lines), -5/-3 (3 lines"),
+dkT(" before the final 2 lines), /-3 (all lines except the final 2),"),
+dkT(" 5/-3 (5 and following except final 2 lines),"),
+dkT(" -5/8 (final 5 lines but not above line 8)."),
+dkT("-v Verbose mode: Error message on SIGPIPE."),
+dkT("--help Show this short help text. --manual *** SHOW FULL MANUAL. ***"),
+dkT("--version Show version information. --license Show license information."),
+dkT(""),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-lines/"),
+dkT(""),
+NULL
+
+
+#line 245 "dk-lines.ctr"
+};
+
+
+
+/** License conditions.
+*/
+static const dkChar * const dk_lines_license_text[] = {
+dkT(""),
+dkT("This software uses code from the following projects, either directly or as"),
+dkT("a library:"),
+dkT(""),
+dkT("dktools\t\tDirk Krause's tools and libraries."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
+#if DK4_HAVE_ZLIB_H
+dkT(""),
+dkT("zlib\t\tData compression library."),
+dkT("\t\tSee http://www.zlib.net/ for more information."),
+#endif
+#if DK4_HAVE_BZLIB_H
+dkT(""),
+dkT("bzip2\t\tData compression program and library."),
+dkT("\t\tSee http://www.bzip.org/ for more information."),
+#endif
+dkT(""),
+dkT("All the licenses below apply to the program."),
+dkT("Licenses for used libraries are shown as found on my Scientific Linux 6.x"),
+dkT("computer in the /usr/share/doc directory on 2015-04-01. Check the project"),
+dkT("homepages of the used libraries for additional information and/or updated"),
+dkT("license terms."),
+dkT(""),
+dkT(""),
+dkT("DK tools and libraries license"),
+dkT("=============================="),
+dkT("Copyright (c) 2015-2016, Dirk Krause"),
+dkT("All rights reserved."),
+dkT(""),
+dkT("Redistribution and use in source and binary forms, with or without"),
+dkT("modification, are permitted provided that the following conditions are met:"),
+dkT(""),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
+#if DK4_HAVE_ZLIB_H
+dkT(""),
+dkT(""),
+dkT("Zlib license"),
+dkT("============"),
+dkT("(C) 1995-2004 Jean-loup Gailly and Mark Adler"),
+dkT(""),
+dkT("This software is provided 'as-is', without any express or implied"),
+dkT("warranty. In no event will the authors be held liable for any damages"),
+dkT("arising from the use of this software."),
+dkT(""),
+dkT("Permission is granted to anyone to use this software for any purpose,"),
+dkT("including commercial applications, and to alter it and redistribute it"),
+dkT("freely, subject to the following restrictions:"),
+dkT(""),
+dkT("1. The origin of this software must not be misrepresented; you must not"),
+dkT(" claim that you wrote the original software. If you use this software"),
+dkT(" in a product, an acknowledgment in the product documentation would be"),
+dkT(" appreciated but is not required."),
+dkT("2. Altered source versions must be plainly marked as such, and must not be"),
+dkT(" misrepresented as being the original software."),
+dkT("3. This notice may not be removed or altered from any source distribution."),
+dkT(""),
+dkT("Jean-loup Gailly Mark Adler"),
+dkT("jloup@gzip.org madler@alumni.caltech.edu"),
+#endif
+#if DK4_HAVE_BZLIB_H
+dkT(""),
+dkT(""),
+dkT("Bzip2 and libbzip2 library license"),
+dkT("=================================="),
+dkT("This program, \"bzip2\", the associated library \"libbzip2\", and all"),
+dkT("documentation, are copyright (C) 1996-2007 Julian R Seward. All"),
+dkT("rights reserved."),
+dkT(""),
+dkT("Redistribution and use in source and binary forms, with or without"),
+dkT("modification, are permitted provided that the following conditions"),
+dkT("are met:"),
+dkT(""),
+dkT("1. Redistributions of source code must retain the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer."),
+dkT(""),
+dkT("2. The origin of this software must not be misrepresented; you must "),
+dkT(" not claim that you wrote the original software. If you use this "),
+dkT(" software in a product, an acknowledgment in the product "),
+dkT(" documentation would be appreciated but is not required."),
+dkT(""),
+dkT("3. Altered source versions must be plainly marked as such, and must"),
+dkT(" not be misrepresented as being the original software."),
+dkT(""),
+dkT("4. The name of the author may not be used to endorse or promote "),
+dkT(" products derived from this software without specific prior written "),
+dkT(" permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS"),
+dkT("OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED"),
+dkT("WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
+dkT("ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
+dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE"),
+dkT("GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS"),
+dkT("INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,"),
+dkT("WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
+dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS"),
+dkT("SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT(""),
+dkT("Julian Seward, jseward@bzip.org"),
+dkT("bzip2/libbzip2 version 1.0.5 of 10 December 2007"),
+#endif
+dkT(""),
+NULL
+
+
+#line 378 "dk-lines.ctr"
+};
+
+
+
+/** Constant texts used by program, not localized.
+*/
+static const dkChar * const dk_lines_kwnl[] = {
+/* 0 */
+dkT("dktools"),
+
+/* 1 */
+dkT("dk-lines.txt"),
+
+/* 2 */
+dkT("dk-lines.str"),
+
+/* 3 */
+dkT("line-size"),
+
+/* 4 */
+dkT("today"),
+
+/* 5 */
+dkT("/"),
+
+/* 6 */
+dkT("rb"),
+
+/* 7 */
+dkT("<stdin>"),
+
+NULL
+
+
+#line 422 "dk-lines.ctr"
+};
+
+
+
+/** Constant texts used by program, replaced by localized texts
+ if available.
+*/
+static const dkChar * const dk_lines_kw_def[] = {
+/* 0 */
+dkT("Failed to set up masked signal set for SIGPIPE!"),
+
+/* 1 */
+dkT("Failed to set up masked signal set for SIGINT!"),
+
+/* 2 */
+dkT("Failed to set up masked signal set for SIGTERM!"),
+
+/* 3 */
+dkT("Failed to restore SIGTERM settings!"),
+
+/* 4 */
+dkT("Failed to restore SIGTERM settings!"),
+
+/* 5 */
+dkT("Failed to restore SIGPIPE settings!"),
+
+/* 6 */
+dkT("Illegal line number 0!"),
+
+/* 7 */
+dkT("Number too large: \""),
+
+/* 8 */
+dkT("\"!"),
+
+/* 9 */
+dkT("Not a number: \""),
+
+/* 10 */
+dkT("\"!"),
+
+/* 11 */
+dkT("Start line number larger than end number!"),
+
+/* 12 */
+dkT("Invalid line range specification (empty string)!"),
+
+/* 13 */
+dkT("Missing line range specification!"),
+
+/* 14 */
+dkT("Illegal input encoding: \""),
+
+/* 15 */
+dkT("\"!"),
+
+/* 16 */
+dkT("Missing input encoding!"),
+
+/* 17 */
+dkT("Invalid line size 0!"),
+
+/* 18 */
+dkT("Missing line size specification!"),
+
+/* 19 */
+dkT("Can not use --today with both --from and --to!"),
+
+/* 20 */
+dkT("Input line too long!"),
+
+/* 21 */
+dkT("Too many lines, overflow in line number!"),
+
+/* 22 */
+dkT("Overflow in line range calculation!"),
+
+/* 23 */
+dkT("End line number is 1 (should not happen, bug)!"),
+
+/* 24 */
+dkT("End line number too large, numeric overflow!"),
+
+/* 25 */
+dkT("Start line number too large, numeric overflow!"),
+
+/* 26 */
+dkT("Ring buffer size is 0 (should not happen, bug)!"),
+
+/* 27 */
+dkT("Failed to obtain file name (should not happen, bug)!"),
+
+/* 28 */
+dkT("Program stopped by SIGPIPE!"),
+
+/* 29 */
+dkT("I/O errors while writing output!"),
+
+/* 30 */
+dkT("Program stopped by interrupt!"),
+
+/* 31 */
+dkT("Encoding error!"),
+
+/* 32 */
+dkT("Decoding error!"),
+
+/* 33 */
+dkT("Processing error!"),
+
+/* 34 */
+dkT("Encoding error!\n\tByte: "),
+
+/* 35 */
+dkT("Decoding error!\n\tByte: "),
+
+/* 36 */
+dkT("Processing error!\n\tByte: "),
+
+/* 37 */
+dkT(",\n\tCharacter: "),
+
+/* 38 */
+dkT(",\n\tPosition in line: "),
+
+/* 39 */
+dkT("."),
+
+NULL
+
+
+#line 562 "dk-lines.ctr"
+};
+
+
+
+/** Options used by program.
+*/
+static const dk4_option_specification_t dk_lines_options[] = {
+
+ /* Input encoding.
+ */
+ { dkT('i'), dkT("input-encoding"), DK4_OPT_ARG_STRING },
+
+ /* Only lines matching start text or lexicagraphically after text.
+ */
+ { dkT('f'), dkT("from"), DK4_OPT_ARG_STRING },
+
+ /* Only lines matching end text or lexicographically before text.
+ */
+ { dkT('t'), dkT("to"), DK4_OPT_ARG_STRING },
+
+ /* Line number selection _after_ applying from and to rules.
+ First line is line 1, final line is line -1.
+ dk-lines -l 5/8 Lines 5, 6, 7 and 8
+ dk-lines -l 5 Lines 5, ...
+ dk-lines -l /8 Lines 1, ... 8
+ dk-lines -l -8/-5 8 before last ... 5 before last
+ dk-lines -l -8 Final 8 lines
+ dk-lines -l /-5 Skip final 5 lines
+ dk-lines -l -8/125 Final 8 lines but not above line 125
+ dk-lines -l 125/-8 Lines from 125 but skip final 8 lines
+ dk-lines without -l option All lines
+ */
+ { dkT('l'), dkT("lines"), DK4_OPT_ARG_STRING },
+
+ /* Verbose flag (write notification on SIGPIPE).
+ */
+ { dkT('v'), dkT("verbose"), DK4_OPT_ARG_NONE },
+
+ /* Treat multiple files as one stream.
+ */
+ { dkT('o'), dkT("one-stream"), DK4_OPT_ARG_NONE },
+
+ /* Line buffer size.
+ */
+ { dkT('\0'), dkT("line-size"), DK4_OPT_ARG_SIZE },
+
+ /** Use current date to filter lines.
+ */
+ { dkT('\0'), dkT("today"), DK4_OPT_ARG_NONE }
+};
+
+
+#if DK4_ON_WINDOWS
+
+/** File name separator.
+*/
+static const dkChar fnsep[] = {
+#if DK4_HAVE_BACKSLASH_AS_SEP
+dkT("\\")
+#else
+dkT("/")
+#endif
+};
+
+#endif
+
+
+
+/** Ring buffer used for negative line numbers.
+*/
+static rbe_t *pribu = NULL;
+
+
+
+/** Application structure.
+*/
+static dk4_app_t *app = NULL;
+
+
+/** Pointer to localized messages array.
+*/
+static const dkChar * const *msgs = dk_lines_kw_def;
+
+
+
+/** Start range.
+*/
+static const dkChar *t_from = NULL;
+
+
+
+/** End of range.
+*/
+static const dkChar *t_to = NULL;
+
+
+/** Input line buffer to use.
+*/
+static dkChar *ilb = default_input_line_buffer;
+
+
+
+/** Start line number.
+*/
+static dk4_um_t l_start = (dk4_um_t)0UL;
+
+
+
+/** End line number.
+*/
+static dk4_um_t l_end = (dk4_um_t)0UL;
+
+
+
+/** Current line number.
+*/
+static dk4_um_t lineno = (dk4_um_t)0UL;
+
+
+
+/** Length of --from text.
+*/
+static size_t sz_t_from = 0;
+
+
+
+/** Length of --to text.
+*/
+static size_t sz_t_to = 0;
+
+
+
+/** Ring buffer size (number of elements).
+*/
+static size_t sz_ribu = 0;
+
+
+
+/** Current position in ring buffer.
+*/
+static size_t pos_ribu = 0;
+
+
+
+/** Size of input line buffer.
+*/
+static size_t sz_ilb = DK4_SIZEOF(default_input_line_buffer,dkChar);
+
+
+
+/** Number of usable elements in the dk_lines_kw_def array and in msg.
+*/
+static size_t sz_msg = (sizeof(dk_lines_kw_def)/sizeof(DK4_PDKCHAR) - 1);
+
+
+
+/** Number of elements in the dk_lines_options array.
+*/
+static const size_t dk_lines_sz_options =
+sizeof(dk_lines_options)/sizeof(dk4_option_specification_t);
+
+
+
+/** Line handling type.
+*/
+static int l_type = RANGE_NONE_NONE;
+
+
+
+/** Exit status code.
+*/
+static int exval = EXIT_FAILURE;
+
+
+
+/** Flag: Write errors.
+*/
+static int had_write_error = 0;
+
+
+
+/** Expected input encoding when reading from file.
+*/
+static int eie_file =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
+
+
+
+/** Expected input encoding on standard input.
+*/
+static int eie_stdin =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
+
+
+
+/** Verbose flag (report SIGPIPE or unusual large line buffer size).
+*/
+static int verbose = 0;
+
+
+
+/** Flag: At least one cyle in the ring buffer was completed.
+*/
+static int cycle_completed = 0;
+
+
+
+/** Flag: Treat multiple files as one stream.
+*/
+static int one_stream = 0;
+
+
+
+/** Number of decoding errors already reported.
+*/
+static int num_r_decoding_e = 0;
+
+
+
+/** Maximum number of decoding errors to report unless verbose output required.
+*/
+static const int max_r_decoding_e = 3;
+
+
+
+/** Number of encoding errors already reported.
+*/
+static int num_r_encoding_e = 0;
+
+
+
+/** Maximum number of encoding errors to report unless verbose output required.
+*/
+static const int max_r_encoding_e = 3;
+
+
+
+/** Number of processing errors already reported.
+*/
+static int num_r_processing_e = 0;
+
+
+
+/** Maximum number of processing errors to report unless
+ verbose output required.
+*/
+static const int max_r_processing_e = 3;
+
+
+
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
+
+/** Indicator: SIGTERM signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+
+
+
+/** Special function to pass a volatile pointer.
+ Some C compiler does not handle direct assignments to volatile variables
+ correctly.
+ @param ptr Address of volatile variable.
+ @return Same address.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
+{
+ return ptr;
+}
+
+
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
+*/
+static
+void
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
+}
+#endif
+
+
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
+static
+void
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
+}
+
+
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
+*/
+static
+void
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
+}
+
+
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
+
+
+
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
+*/
+static
+int
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
+{
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
+}
+
+
+
+/** Retrieve value from text.
+ @param pdest Address of result variable to fill.
+ @param vtxt Text containing the value.
+ @param pback Address of success variable to reset on error.
+*/
+static
+void
+retrieve_number(dk4_um_t *pdest, const dkChar *vtxt, int *pback)
+{
+ dk4_er_t er;
+ dk4_um_t u = (dk4_um_t)0UL;
+ const dkChar *pe = NULL;
+
+
+#line 955 "dk-lines.ctr"
+ dk4error_init(&er);
+ if (0 != dk4ma_input_dk_dec_dk4_um_t(&u, vtxt, &pe, 1, &er)) {
+ if ((dk4_um_t)0UL < u) {
+ *pdest = u;
+ }
+ else {
+
+#line 961 "dk-lines.ctr"
+ *pback = 0;
+ /* ERROR: Illegal line number 0 */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 6);
+ }
+ }
+ else {
+ *pback = 0;
+ switch (er.ec) {
+ case DK4_E_MATH_OVERFLOW : {
+
+#line 970 "dk-lines.ctr"
+ /* ERROR: Number too large */
+ dk4app_log_3(app, msgs, sz_msg, DK4_LL_ERROR, 7, 8, vtxt);
+ } break;
+ default : {
+
+#line 974 "dk-lines.ctr"
+ /* ERROR: Not a number */
+ dk4app_log_3(app, msgs, sz_msg, DK4_LL_ERROR, 9, 10, vtxt);
+ } break;
+ }
+ }
+
+
+#line 980 "dk-lines.ctr"
+}
+
+
+
+#if TRACE_DEBUG
+
+static
+void
+trace_type_start_end(int t, unsigned long s, unsigned long e)
+{
+
+
+#line 991 "dk-lines.ctr"
+}
+
+#endif
+
+
+
+/** Process line number range.
+ @param ps Text containing start line number.
+ @param pe Text containing end line number.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+process_line_range_items(const dkChar *ps, const dkChar *pe)
+{
+ int back = 1;
+
+
+#line 1008 "dk-lines.ctr"
+
+ /* Retrieve pure data from texts
+ */
+ if (NULL != ps) {
+
+#line 1012 "dk-lines.ctr"
+ if (NULL != pe) {
+
+#line 1013 "dk-lines.ctr"
+ if (dkT('-') != *ps) {
+
+#line 1014 "dk-lines.ctr"
+ if (dkT('-') != *pe) {
+
+#line 1015 "dk-lines.ctr"
+ l_type = RANGE_POS_POS;
+ retrieve_number(&l_start, ps, &back);
+ retrieve_number(&l_end, pe, &back);
+ if (l_start > l_end) {
+
+#line 1019 "dk-lines.ctr"
+ back = 0;
+ /* ERROR: start line number larger than end */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 11);
+ }
+ }
+ else {
+
+#line 1025 "dk-lines.ctr"
+ pe++;
+ l_type = RANGE_POS_NEG;
+ retrieve_number(&l_start, ps, &back);
+ retrieve_number(&l_end, pe, &back);
+ }
+ }
+ else {
+
+#line 1032 "dk-lines.ctr"
+ ps++;
+ if (dkT('-') != *pe) {
+
+#line 1034 "dk-lines.ctr"
+ l_type = RANGE_NEG_POS;
+ retrieve_number(&l_start, ps, &back);
+ retrieve_number(&l_end, pe, &back);
+ }
+ else {
+
+#line 1039 "dk-lines.ctr"
+ pe++;
+ l_type = RANGE_NEG_NEG;
+ retrieve_number(&l_start, ps, &back);
+ retrieve_number(&l_end, pe, &back);
+ if (l_end > l_start) {
+
+#line 1044 "dk-lines.ctr"
+ back = 0;
+ /* ERROR: End line number larger than start */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 11);
+ }
+ }
+ }
+ }
+ else {
+
+#line 1052 "dk-lines.ctr"
+ if (dkT('-') != *ps) {
+
+#line 1053 "dk-lines.ctr"
+ l_type = RANGE_POS_NONE;
+ retrieve_number(&l_start, ps, &back);
+ }
+ else {
+
+#line 1057 "dk-lines.ctr"
+ ps++;
+ l_type = RANGE_NEG_NONE;
+ retrieve_number(&l_start, ps, &back);
+ }
+ }
+ }
+ else {
+
+#line 1064 "dk-lines.ctr"
+ if (NULL != pe) {
+
+#line 1065 "dk-lines.ctr"
+ if (dkT('-') != *pe) {
+
+#line 1066 "dk-lines.ctr"
+ l_type = RANGE_NONE_POS;
+ retrieve_number(&l_end, pe, &back);
+ }
+ else {
+
+#line 1070 "dk-lines.ctr"
+ pe++;
+ l_type = RANGE_NONE_NEG;
+ retrieve_number(&l_end, pe, &back);
+ }
+ }
+ else {
+
+#line 1076 "dk-lines.ctr"
+ }
+ }
+
+ /* Corrections for full ranges
+ */
+ if (0 != back) {
+
+
+#line 1083 "dk-lines.ctr"
+
+
+#line 1084 "dk-lines.ctr"
+ switch (l_type) {
+ case RANGE_NONE_NEG : {
+ if ((dk4_um_t)1UL == l_end) {
+ l_type = RANGE_NONE_NONE;
+ l_end = (dk4_um_t)0UL;
+
+
+#line 1090 "dk-lines.ctr"
+ }
+ } break;
+ case RANGE_POS_NEG : {
+ if ((dk4_um_t)1UL == l_end) {
+ l_type = RANGE_POS_NONE;
+ l_end = (dk4_um_t)0UL;
+
+
+#line 1097 "dk-lines.ctr"
+ if ((dk4_um_t)1UL == l_start) {
+ l_type = RANGE_NONE_NONE;
+ l_start = (dk4_um_t)0UL;
+
+
+#line 1101 "dk-lines.ctr"
+ }
+ }
+ else {
+ if ((dk4_um_t)1UL == l_start) {
+ l_type = RANGE_NONE_NEG;
+ l_start = (dk4_um_t)0UL;
+
+
+#line 1108 "dk-lines.ctr"
+ }
+ }
+ } break;
+ case RANGE_NEG_NEG : {
+ if ((dk4_um_t)1UL == l_end) {
+ l_type = RANGE_NEG_NONE;
+ l_end = (dk4_um_t)0UL;
+
+
+#line 1116 "dk-lines.ctr"
+ }
+ } break;
+ case RANGE_POS_NONE : {
+ if ((dk4_um_t)1UL == l_start) {
+ l_start = (dk4_um_t)0UL;
+ l_type = RANGE_NONE_NONE;
+
+
+#line 1123 "dk-lines.ctr"
+ }
+ } break;
+ case RANGE_POS_POS : {
+ if ((dk4_um_t)1UL == l_start) {
+ l_start = (dk4_um_t)0UL;
+ l_type = RANGE_NONE_POS;
+
+
+#line 1130 "dk-lines.ctr"
+ }
+ } break;
+ default : {
+ /* Empty by intent */
+
+
+#line 1135 "dk-lines.ctr"
+ } break;
+ }
+ }
+
+
+#line 1139 "dk-lines.ctr"
+ return back;
+}
+
+
+
+/** Process line number range.
+ @param range Text containing the line number range.
+*/
+static
+int
+process_line_range(const dkChar *range)
+{
+ dkChar buf[64*sizeof(dk4_um_t)];
+ dkChar *p1 = NULL;
+ dkChar *p2 = NULL;
+ int back = 0;
+
+
+#line 1156 "dk-lines.ctr"
+ back = dk4str_cpy_s(buf, DK4_SIZEOF(buf,dkChar), range, NULL);
+ if (0 != back) {
+ p1 = dk4str_start(buf, NULL);
+ if (NULL != p1) {
+
+#line 1160 "dk-lines.ctr"
+ p2 = dk4str_chr(p1, dkT('/'));
+ if (NULL != p2) {
+
+#line 1162 "dk-lines.ctr"
+ *(p2++) = dkT('\0');
+ p2 = dk4str_start(p2, NULL);
+
+#line 1164 "dk-lines.ctr"
+ p1 = dk4str_start(p1, NULL);
+
+#line 1165 "dk-lines.ctr"
+ }
+
+#line 1166 "dk-lines.ctr"
+ back = process_line_range_items(p1, p2);
+ }
+ else {
+
+#line 1169 "dk-lines.ctr"
+ /* ERROR: Empty string */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 12);
+ back = 0;
+ }
+ }
+
+
+#line 1175 "dk-lines.ctr"
+ return back;
+}
+
+
+
+/** Retrieve configuration from command line arguments.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+process_command_line_arguments(void)
+{
+ dk4_time_t timer = (dk4_time_t)0UL;
+ const dkChar *ptr = NULL;
+ size_t sz = 0;
+ int back = 1;
+ int res = 0;
+ int iec = 0;
+
+
+#line 1194 "dk-lines.ctr"
+
+ /* --verbose
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('v'), NULL)) {
+ verbose = 1;
+ }
+
+ /* --one-stream
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('o'), NULL)) {
+ one_stream = 1;
+ }
+
+ /* --from
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('f'), NULL)) {
+ t_from = dk4app_opt_get_string_ptr_short(app, dkT('f'), NULL);
+ sz_t_from = dk4str_len(t_from);
+ }
+
+ /* --to
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('t'), NULL)) {
+ t_to = dk4app_opt_get_string_ptr_short(app, dkT('t'), NULL);
+ sz_t_to = dk4str_len(t_to);
+ }
+
+ /* --lines
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('l'), NULL)) {
+ ptr = dk4app_opt_get_string_ptr_short(app, dkT('l'), NULL);
+ if (NULL != ptr) {
+ back = process_line_range(ptr);
+ }
+ else {
+
+#line 1229 "dk-lines.ctr"
+ /* ERROR: Failed to retrieve line range argument */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 13);
+ back = 0;
+ }
+ }
+
+ /* --input-encoding
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('i'), NULL)) {
+ ptr = dk4app_opt_get_string_ptr_short(app, dkT('i'), NULL);
+ if (NULL != ptr) {
+ res = dk4enc_find(&iec, NULL, ptr, NULL);
+ if (0 != res) {
+ eie_stdin = iec;
+ eie_file = iec;
+ }
+ else {
+ /* ERROR: Illegal input encoding */
+ dk4app_log_3(app, msgs, sz_msg, DK4_LL_ERROR, 14, 15, ptr);
+ }
+ }
+ else {
+ back = 0;
+ /* ERROR: Failed to retrieve input encoding */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 16);
+ }
+ }
+
+ /* --line-size
+ */
+ if (0 != dk4app_opt_is_set_long(app, dk_lines_kwnl[3], NULL)) {
+ if (0 != dk4app_opt_get_size_long(&sz, app, dk_lines_kwnl[3], NULL)) {
+ if (0 < sz) {
+ if (DK4_SIZEOF(default_input_line_buffer,dkChar) < sz) {
+ sz_ilb = sz;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1267 "dk-lines.ctr"
+ }
+#endif
+ }
+ else {
+
+#line 1271 "dk-lines.ctr"
+ /* ERROR: Line size 0 */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 17);
+ back = 0;
+ }
+ }
+ else {
+
+#line 1277 "dk-lines.ctr"
+ /* ERROR: Failed to retrieve line size */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 18);
+ back = 0;
+ }
+ }
+
+ /* --today
+ */
+ if (0 != dk4app_opt_is_set_long(app, dk_lines_kwnl[4], NULL)) {
+ if ((NULL == t_from) || (NULL == t_to)) {
+ dk4time_get(&timer);
+ res = dk4time_as_text(
+ date_buffer, DK4_SIZEOF(date_buffer,dkChar), &timer, NULL
+ );
+ if (0 != res) {
+ date_buffer[10] = dkT('\0');
+ if (NULL == t_from) {
+ t_from = date_buffer;
+ sz_t_from = dk4str_len(t_from);
+ }
+ if (NULL == t_to ) {
+ t_to = date_buffer;
+ sz_t_to = dk4str_len(t_to);
+ }
+ }
+ }
+ else {
+ /* ERROR: --today used with --from and --to */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 19);
+ }
+ }
+
+
+#line 1309 "dk-lines.ctr"
+ return back;
+}
+
+
+
+/** Report an error with position.
+ @param i1 Index of first message part in array.
+ @param i2 Index of alternative first message part.
+ @param bno Current byte number.
+ @param lno Current line number.
+ @param cno Current character number.
+ @param cil Current character number within line.
+ @param fn File name processed.
+*/
+static
+void
+report_with_position(
+ size_t i1,
+ size_t i2,
+ dk4_um_t bno,
+ dk4_um_t lno,
+ dk4_um_t cno,
+ dk4_um_t cil,
+ const dkChar *fn
+)
+{
+ dkChar b1[8*(1+sizeof(dk4_um_t))+16];
+ dkChar b2[8*(1+sizeof(dk4_um_t))+16];
+ dkChar b3[8*(1+sizeof(dk4_um_t))+16];
+ const dkChar *oldlogname = NULL;
+ dk4_um_t oldlogline = (dk4_um_t)0UL;
+ const size_t szb3 = DK4_SIZEOF(b3,dkChar);
+ const size_t szb2 = DK4_SIZEOF(b2,dkChar);
+ const size_t szb1 = DK4_SIZEOF(b1,dkChar);
+ int allbuffersok = 0;
+
+ oldlogname = dk4app_get_log_source_file(app);
+ oldlogline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, lno);
+ if (0 != dk4ma_write_decimal_unsigned(b3, szb3, cil, 0, NULL)) {
+ if (0 != dk4ma_write_decimal_unsigned(b2, szb2, cno, 0, NULL)) {
+ if (0 != dk4ma_write_decimal_unsigned(b1, szb1, bno, 0, NULL)) {
+ allbuffersok = 1;
+ }
+ }
+ }
+ if (0 != allbuffersok) {
+ dk4app_log_7(
+ app, msgs, sz_msg, DK4_LL_ERROR, i1, 37, 38, 39, b1, b2, b3
+ );
+ }
+ else {
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, i2);
+ }
+ dk4app_set_log_source_line(app, oldlogline);
+ dk4app_set_log_source_file(app, oldlogname);
+}
+
+
+
+static
+void
+report_errors_from_tsp(
+ dk4_er_t *er_en,
+ dk4_er_t *er_pr,
+ const dkChar *fn
+)
+{
+ if (NULL != er_en) {
+ switch (er_en->ec) {
+ case DK4_E_DECODING_FAILED : {
+ if ((0 != verbose) || (max_r_decoding_e > num_r_decoding_e)) {
+ report_with_position(
+ 35, 32,
+ er_en->dt.fpos.byteno, er_en->dt.fpos.lineno,
+ er_en->dt.fpos.charno, er_en->dt.fpos.charinline,
+ fn
+ );
+ num_r_decoding_e++;
+ if (num_r_decoding_e > max_r_decoding_e) {
+ num_r_decoding_e = max_r_decoding_e;
+ }
+ }
+ } break;
+ case DK4_E_ENCODING_FAILED : {
+ if ((0 != verbose) || (max_r_encoding_e > num_r_encoding_e)) {
+ report_with_position(
+ 34, 31,
+ er_en->dt.fpos.byteno, er_en->dt.fpos.lineno,
+ er_en->dt.fpos.charno, er_en->dt.fpos.charinline,
+ fn
+ );
+ num_r_encoding_e++;
+ if (num_r_encoding_e > max_r_encoding_e) {
+ num_r_encoding_e = max_r_encoding_e;
+ }
+ }
+ } break;
+ }
+ }
+ if (NULL != er_pr) {
+ if (DK4_E_NONE != er_pr->ec) {
+ if ((0 != verbose) || (max_r_processing_e > num_r_processing_e)) {
+ report_with_position(
+ 36, 33,
+ er_pr->dt.fpos.byteno, er_pr->dt.fpos.lineno,
+ er_pr->dt.fpos.charno, er_pr->dt.fpos.charinline,
+ fn
+ );
+ num_r_processing_e++;
+ if (num_r_processing_e > max_r_processing_e) {
+ num_r_processing_e = max_r_processing_e;
+ }
+ }
+ }
+ }
+}
+
+
+
+static
+int
+write_text_line(const dkChar *line, dk4_er_t *erp)
+{
+ int back = DK4_TSP_RES_OK;
+ if (0 == dk4fputs(line, stdout, erp)) {
+ had_write_error = 1;
+ back = DK4_TSP_RES_ERROR;
+ }
+ if (0 == dk4fputc(dkT('\n'), stdout, erp)) {
+ had_write_error = 1;
+ back = DK4_TSP_RES_ERROR;
+ }
+ return back;
+}
+
+
+
+/** Add new line to ring buffer, write line stored previously.
+ @param line New line to add.
+ @param erp Error report.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on error.
+*/
+static
+int
+ribu_add_and_print(const dkChar *line, dk4_er_t *erp)
+{
+ dkChar *ptr;
+ size_t sz;
+ int back = DK4_TSP_RES_OK;
+
+
+#line 1461 "dk-lines.ctr"
+ sz = dk4str_len(line);
+ if ((SIZE_MAX) > sz) {
+ if ((NULL != pribu) && (0 < sz_ribu)) {
+ if (NULL != pribu[pos_ribu].str) {
+
+
+#line 1466 "dk-lines.ctr"
+
+
+#line 1467 "dk-lines.ctr"
+ if (0 != cycle_completed) {
+ back = write_text_line(pribu[pos_ribu].str, erp);
+ }
+ if (sz > pribu[pos_ribu].buflen) {
+
+#line 1471 "dk-lines.ctr"
+ ptr = dk4str_dup_app(line, app);
+ if (NULL != ptr) {
+ dk4mem_free(pribu[pos_ribu].str);
+ pribu[pos_ribu].str = ptr;
+ pribu[pos_ribu].buflen = sz;
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ /* ERROR: Memory allocation failed */
+ }
+ }
+ else {
+
+#line 1486 "dk-lines.ctr"
+ (void)dk4str_cpy_s(
+ pribu[pos_ribu].str, (1 + pribu[pos_ribu].buflen),
+ line, NULL
+ );
+ }
+ }
+ else {
+
+#line 1493 "dk-lines.ctr"
+ pribu[pos_ribu].str = dk4str_dup_app(line, app);
+ pribu[pos_ribu].buflen = sz;
+ if (NULL == pribu[pos_ribu].str) {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ pribu[pos_ribu].buflen = 0;
+ /* ERROR: Memory allocation failed */
+ }
+ }
+
+
+#line 1505 "dk-lines.ctr"
+
+
+#line 1506 "dk-lines.ctr"
+ pribu[pos_ribu].lineno = lineno;
+ pos_ribu++;
+ if (pos_ribu >= sz_ribu) {
+ pos_ribu = 0;
+ cycle_completed = 1;
+ }
+
+#line 1512 "dk-lines.ctr"
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ /* ERROR: No ring buffer */
+ }
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ /* ERROR: Line too long */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 20);
+ }
+
+
+#line 1526 "dk-lines.ctr"
+ return back;
+}
+
+
+
+/** Add new line to ring buffer, do not print line previously stored.
+ @param line New line to add.
+ @param erp Error report.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on error.
+*/
+static
+int
+ribu_add_silently(const dkChar *line, dk4_er_t *erp)
+{
+ dkChar *ptr;
+ size_t sz;
+ int back = DK4_TSP_RES_OK;
+
+
+#line 1544 "dk-lines.ctr"
+
+ sz = dk4str_len(line);
+ if ((SIZE_MAX) > sz) {
+ if ((NULL != pribu) && (0 < sz_ribu)) {
+
+#line 1548 "dk-lines.ctr"
+ if (NULL != pribu[pos_ribu].str) {
+
+#line 1549 "dk-lines.ctr"
+
+
+#line 1550 "dk-lines.ctr"
+
+
+#line 1551 "dk-lines.ctr"
+
+
+#line 1552 "dk-lines.ctr"
+
+
+#line 1553 "dk-lines.ctr"
+ if (sz > pribu[pos_ribu].buflen) {
+
+#line 1554 "dk-lines.ctr"
+ ptr = dk4str_dup_app(line, app);
+ if (NULL != ptr) {
+
+#line 1556 "dk-lines.ctr"
+ dk4mem_free(pribu[pos_ribu].str);
+ pribu[pos_ribu].str = ptr;
+ pribu[pos_ribu].buflen = sz;
+ }
+ else {
+
+#line 1561 "dk-lines.ctr"
+ dk4mem_release(pribu[pos_ribu].str);
+ pribu[pos_ribu].buflen = 0;
+ pribu[pos_ribu].lineno = (dk4_um_t)0UL;
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ /* ERROR: Memory allocation failed */
+ }
+ }
+ else {
+
+#line 1572 "dk-lines.ctr"
+ (void)dk4str_cpy_s(
+ pribu[pos_ribu].str, (1 + pribu[pos_ribu].buflen),
+ line, NULL
+ );
+ }
+ }
+ else {
+
+#line 1579 "dk-lines.ctr"
+ pribu[pos_ribu].str = dk4str_dup_app(line, app);
+ pribu[pos_ribu].buflen = sz;
+ if (NULL == pribu[pos_ribu].str) {
+
+#line 1582 "dk-lines.ctr"
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ pribu[pos_ribu].buflen = 0;
+ /* ERROR: Memory allocation failed */
+ }
+ }
+
+
+#line 1591 "dk-lines.ctr"
+
+
+#line 1592 "dk-lines.ctr"
+ pribu[pos_ribu].lineno = lineno;
+ pos_ribu++;
+ if (pos_ribu >= sz_ribu) {
+ pos_ribu = 0;
+ }
+ }
+ else {
+
+#line 1599 "dk-lines.ctr"
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ /* ERROR: No ring buffer */
+ }
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ /* ERROR: Line too long */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 20);
+ }
+
+
+#line 1611 "dk-lines.ctr"
+ return back;
+}
+
+
+
+static
+int
+dk_lines_line_handler(
+ void *DK4_ARG_UNUSED(obj),
+ dkChar *line,
+ dk4_um_t xlineno,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ size_t sz = 0;
+ int back = DK4_TSP_RES_OK;
+ int ok = 1;
+
+ DK4_UNUSED_ARG(obj)
+
+
+#line 1632 "dk-lines.ctr"
+ dk4app_set_log_source_line(app, xlineno);
+ dk4str_delnl(line);
+
+
+#line 1635 "dk-lines.ctr"
+ if ((NULL != t_from) && (0 < sz_t_from)) {
+#if VERSION_BEFORE_2017_11_20
+ sz = dk4str_len(line);
+ if (sz < sz_t_from) {
+ ok = 0;
+ }
+ else {
+ if (0 > dk4str_ncmp(line, t_from, sz_t_from)) { ok = 0; }
+ }
+#endif
+ if (0 > dk4str_cmp(line, t_from)) { ok = 0; }
+ }
+ if ((0 != ok) && (NULL != t_to) && (0 < sz_t_to)) {
+#if VERSION_BEFORE_2017_11_20
+ if (0 == sz) { sz = dk4str_len(line); }
+ if (sz < sz_t_to) {
+ if (0 < dk4str_ncmp(line, t_to, sz)) { ok = 0; }
+ }
+ else {
+ if (0 < dk4str_ncmp(line, t_to, sz_t_to)) { ok = 0; }
+ }
+#endif
+ sz = dk4str_len(line);
+ if (sz < sz_t_to) {
+ if (0 < dk4str_cmp(line, t_to)) { ok = 0; }
+ }
+ else {
+ if (0 < dk4str_ncmp(line, t_to, sz_t_to)) { ok = 0; }
+ }
+ }
+ if (0 != ok) {
+ dk4error_init(&er);
+ lineno = dk4ma_um_add(lineno, (dk4_um_t)1UL, &er);
+ if (DK4_E_NONE == er.ec) {
+
+
+#line 1670 "dk-lines.ctr"
+ switch (l_type) {
+ case RANGE_NONE_NONE : {
+ back = write_text_line(line, erp);
+ } break;
+ case RANGE_NONE_POS : {
+ if (lineno <= l_end) {
+ back = write_text_line(line, erp);
+ }
+ } break;
+ case RANGE_NONE_NEG : {
+ back = ribu_add_and_print(line, erp);
+ } break;
+ case RANGE_POS_NONE : {
+ if (l_start <= lineno) {
+ back = write_text_line(line, erp);
+ }
+ } break;
+ case RANGE_POS_POS : {
+ if ((l_start <= lineno) && (lineno <= l_end)) {
+ back = write_text_line(line, erp);
+ }
+ } break;
+ case RANGE_POS_NEG : {
+ if (l_start <= lineno) {
+ back = ribu_add_and_print(line, erp);
+ }
+ } break;
+ case RANGE_NEG_NONE : {
+ back = ribu_add_silently(line, erp);
+ } break;
+ case RANGE_NEG_POS : {
+ back = ribu_add_silently(line, erp);
+ } break;
+ case RANGE_NEG_NEG : {
+ back = ribu_add_silently(line, erp);
+ } break;
+ }
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_copy(erp, &er);
+ /* ERROR: Overflow in line number */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 21);
+ }
+ }
+
+
+
+#line 1717 "dk-lines.ctr"
+ return back;
+}
+
+
+
+/** Flush the ring buffer after finishing file or stream.
+*/
+static
+void
+flush_ring_buffer(void)
+{
+ dk4_er_t er;
+ dk4_um_t umax;
+ size_t i;
+ size_t idx;
+ size_t max;
+
+ switch (l_type) {
+ case RANGE_NONE_NONE : {
+ /* Empty by intent, ring buffer not used */
+ } break;
+ case RANGE_NONE_POS : {
+ /* Empty by intent, ring buffer not used */
+ } break;
+ case RANGE_NONE_NEG : case RANGE_POS_NEG : {
+ /* Empty by intent, lines of interest already printed */
+ } break;
+ case RANGE_POS_NONE : {
+ /* Empty by intent, ring buffer not used */
+ } break;
+ case RANGE_POS_POS : {
+ /* Empty by intent, ring buffer not used */
+ } break;
+ case RANGE_NEG_NONE : {
+ idx = pos_ribu;
+ for (i = 0; i < sz_ribu; i++) {
+
+
+#line 1754 "dk-lines.ctr"
+ if (NULL != pribu[idx].str) {
+
+#line 1755 "dk-lines.ctr"
+
+
+#line 1756 "dk-lines.ctr"
+ if (0 == dk4fputs(pribu[idx].str, stdout, NULL)) {
+ had_write_error = 1;
+ }
+ if (0 == dk4fputc(dkT('\n'), stdout, NULL)) {
+ had_write_error = 1;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1765 "dk-lines.ctr"
+ }
+#endif
+ idx++; if (idx >= sz_ribu) { idx = 0; }
+ }
+ } break;
+ case RANGE_NEG_POS : {
+ idx = pos_ribu;
+ for (i = 0; i < sz_ribu; i++) {
+ if ((NULL != pribu[idx].str) && (pribu[idx].lineno <= l_end)) {
+ if (0 == dk4fputs(pribu[idx].str, stdout, NULL)) {
+ had_write_error = 1;
+ }
+ if (0 == dk4fputc(dkT('\n'), stdout, NULL)) {
+ had_write_error = 1;
+ }
+ }
+ idx++; if (idx >= sz_ribu) { idx = 0; }
+ }
+ } break;
+ case RANGE_NEG_NEG : {
+ dk4error_init(&er);
+ umax = dk4ma_um_add(
+ dk4ma_um_sub(l_start, l_end, &er),
+ (dk4_um_t)1UL,
+ &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ if ((dk4_um_t)(SIZE_MAX) >= umax) {
+ max = (size_t)umax;
+ idx = pos_ribu;
+ for (i = 0; i < max; i++) {
+ if (NULL != pribu[idx].str) {
+ if (0 == dk4fputs(pribu[idx].str, stdout, NULL)) {
+ had_write_error = 1;
+ }
+ if (0 == dk4fputc(dkT('\n'), stdout, NULL)) {
+ had_write_error = 1;
+ }
+ }
+ idx++; if (idx >= sz_ribu) { idx = 0; }
+ }
+ }
+ else {
+ exval = EXIT_FAILURE;
+ /* ERROR: Overflow in line range calculation */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 22);
+ }
+ }
+ else {
+ exval = EXIT_FAILURE;
+ /* ERROR: Overflow in line range calculation */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 22);
+ }
+ } break;
+ }
+}
+
+
+
+/** Process file contents.
+ @param fipo File, opened for binary read access.
+ @param fn File name (for diagnostics).
+ @param eie Expected input encoding.
+*/
+static
+void
+run_for_file_with_name(FILE *fipo, const dkChar *fn, int eie)
+{
+ dk4_tspdk_t tsp; /* Text stream processor */
+ dk4_er_t er_en; /* Error report for enc/decoding */
+ dk4_er_t er_pr; /* Error report for processing */
+ dk4_er_t er; /* General error report */
+ const dkChar *oldlogname = NULL; /* Old source file */
+ dk4_um_t oldlogline = 0UL; /* Old source line */
+ size_t i; /* Traverse ring buffer elements */
+ int c; /* Current character retrieved */
+ int res; /* Operation result */
+ int cc; /* Flag: Can continue */
+ unsigned char uc; /* Byte added to processor */
+
+
+#line 1845 "dk-lines.ctr"
+
+ oldlogname = dk4app_get_log_source_file(app);
+ oldlogline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ /* Initialize handling of one file
+ */
+ if (0 == one_stream) {
+ lineno = (dk4_um_t)0UL;
+ pos_ribu = 0;
+ if (NULL != pribu) {
+ for (i = 0; i < sz_ribu; i++) {
+ pribu[i].str = NULL;
+ pribu[i].lineno = (dk4_um_t)0UL;
+ pribu[i].buflen = 0;
+ }
+ }
+ }
+
+ /* Process file contents in loop
+ */
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ dk4error_init(&er);
+ res = dk4tspdk_setup_line(
+ &tsp, NULL, dk_lines_line_handler, ilb, sz_ilb,
+ dk4app_get_encoding(app), eie, &er
+ );
+ if (0 != res) {
+ cc = 1;
+ while(1 == cc) {
+ cc = -1;
+ if (0 != sig_can_continue(1)) {
+ c = fgetc(fipo);
+ if (EOF != c) {
+ cc = 1;
+ uc = (unsigned char)c;
+ switch (dk4tspdk_add_one_byte(&tsp, uc)) {
+ case DK4_TSP_RES_FATAL : {
+ cc = -1;
+ exval = EXIT_FAILURE;
+ dk4tspdk_get_errors(&er_en, &er_pr, &tsp);
+ report_errors_from_tsp(&er_en, &er_pr, fn);
+ } break;
+ case DK4_TSP_RES_ERROR : {
+ exval = EXIT_FAILURE;
+ dk4tspdk_get_errors(&er_en, &er_pr, &tsp);
+ report_errors_from_tsp(&er_en, &er_pr, fn);
+ } break;
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ }
+ /* Flush data from text processor
+ */
+ if (0 == cc) {
+ switch (dk4tspdk_finish(&tsp)) {
+ case DK4_TSP_RES_FATAL : case DK4_TSP_RES_ERROR : {
+ exval = EXIT_FAILURE;
+ dk4tspdk_get_errors(&er_en, &er_pr, &tsp);
+ report_errors_from_tsp(&er_en, &er_pr, fn);
+ } break;
+ }
+ }
+ }
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+
+ /* Flush data from ring buffer
+ */
+ if (0 == one_stream) {
+ flush_ring_buffer();
+ }
+
+ /* Clean up resources
+ */
+ if (0 == one_stream) {
+ cycle_completed = 0;
+ if (NULL != pribu) {
+ for (i = 0; i < sz_ribu; i++) {
+ dk4mem_release(pribu[i].str);
+ pribu[i].lineno = (dk4_um_t)0UL;
+ pribu[i].buflen = 0;
+ }
+ }
+ }
+ dk4app_set_log_source_line(app, oldlogline);
+ dk4app_set_log_source_file(app, oldlogname);
+
+
+#line 1936 "dk-lines.ctr"
+}
+
+
+
+/** Open and process a file.
+ @param fn File name to process.
+*/
+static
+void
+run_for_filename(const dkChar *fn)
+{
+ const dkChar *oldlogname = NULL;
+ FILE *fipo = NULL;
+ dk4_um_t oldlogline = (dk4_um_t)0UL;
+ int tests = DK4_FOPEN_SC_USER;
+
+
+#line 1952 "dk-lines.ctr"
+ oldlogname = dk4app_get_log_source_file(app);
+ oldlogline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ if (dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
+
+
+#line 1958 "dk-lines.ctr"
+ fipo = dk4fopen_app(fn, dk_lines_kwnl[6], tests, app);
+ if (NULL != fipo) {
+ run_for_file_with_name(fipo, fn, eie_file);
+ fclose(fipo);
+ }
+ else {
+ exval = EXIT_FAILURE;
+ }
+ dk4app_set_log_source_line(app, oldlogline);
+ dk4app_set_log_source_file(app, oldlogname);
+
+
+#line 1969 "dk-lines.ctr"
+}
+
+
+
+#if DK4_ON_WINDOWS
+
+static
+void
+expand_filename_and_run(const dkChar *pattern)
+{
+ dkChar buf[DK4_MAX_PATH];
+ dk4_dir_t *fne;
+ const dkChar *shf;
+ const dkChar *pth;
+ const size_t szbuf = DK4_SIZEOF(buf,dkChar);
+ int any_file_found = 0;
+ int cc;
+ int ok;
+
+
+#line 1988 "dk-lines.ctr"
+ fne = dk4app_fne_open(pattern, app);
+ if (NULL != fne) {
+ pth = dk4dir_get_path(fne);
+ cc = 1;
+ while (1 == cc) {
+ if (0 != sig_can_continue(1)) {
+ shf = dk4dir_next_file(fne);
+ if (NULL != shf) {
+
+#line 1996 "dk-lines.ctr"
+ any_file_found = 1;
+ if (NULL != pth) {
+
+#line 1998 "dk-lines.ctr"
+ ok = 1;
+ if (0 == dk4str_cpy_s(buf, szbuf, pth, NULL)) {
+ ok = 0;
+ }
+ if(0 != dk4str_cat_s(buf, szbuf, fnsep, NULL)) {
+ ok = 0;
+ }
+ if(0 != dk4str_cat_s(buf, szbuf, shf, NULL)) {
+ ok = 0;
+ }
+ if (1 == ok) {
+
+#line 2009 "dk-lines.ctr"
+ run_for_filename(buf);
+ }
+ else {
+
+#line 2012 "dk-lines.ctr"
+ /* ERROR: Path too long */
+ exval = EXIT_FAILURE;
+ dk4app_log_base3(app,DK4_LL_ERROR,100,105,pattern);
+ }
+ }
+ else {
+
+#line 2018 "dk-lines.ctr"
+ run_for_filename(shf);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ }
+ dk4dir_close(fne);
+ if (0 == any_file_found) {
+ exval = EXIT_FAILURE;
+ dk4app_log_base3(app, DK4_LL_ERROR, 100, 107, pattern);
+ }
+ }
+ else {
+
+#line 2036 "dk-lines.ctr"
+ exval = EXIT_FAILURE;
+ /* ERROR: Failed to open file name expander (already reported) */
+ }
+
+
+#line 2040 "dk-lines.ctr"
+}
+
+#endif
+
+
+
+/** Allocate ring buffer used for negative line numbers.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+allocate_ring_buffer(void)
+{
+ size_t i;
+ int back = 1;
+
+
+#line 2056 "dk-lines.ctr"
+ switch (l_type) {
+ case RANGE_NONE_NEG : case RANGE_POS_NEG : case RANGE_NEG_NONE :
+ case RANGE_NEG_POS : case RANGE_NEG_NEG : {
+
+#line 2059 "dk-lines.ctr"
+ back = 0;
+ switch (l_type) {
+ case RANGE_NONE_NEG : case RANGE_POS_NEG : {
+ if ((dk4_um_t)(SIZE_MAX) >= l_end) {
+ if ((dk4_um_t)1UL < l_end) {
+ sz_ribu = (size_t)(l_end - (dk4_um_t)1UL);
+ }
+ else {
+
+#line 2067 "dk-lines.ctr"
+ /* BUG: l_end is 1, should not happen */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 23);
+ }
+ }
+ else {
+
+#line 2072 "dk-lines.ctr"
+ /* ERROR: Numeric overflow */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 24);
+ }
+ } break;
+ default : {
+ if ((dk4_um_t)(SIZE_MAX) >= l_start) {
+ sz_ribu = (size_t)l_start;
+ }
+ else {
+
+#line 2081 "dk-lines.ctr"
+ /* ERROR: Numeric overflow */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 25);
+ }
+ } break;
+ }
+ if (0 < sz_ribu) {
+
+#line 2087 "dk-lines.ctr"
+ pribu = dk4mem_new_app(rbe_t,sz_ribu,app);
+ if (NULL != pribu) {
+
+#line 2089 "dk-lines.ctr"
+ back = 1;
+ for (i = 0; i < sz_ribu; i++) {
+ pribu[i].str = NULL;
+ pribu[i].lineno = (dk4_um_t)0UL;
+ pribu[i].buflen = 0;
+ }
+ }
+ else {
+
+#line 2097 "dk-lines.ctr"
+ /* ERROR: Memory allocation failed (already reported) */
+ }
+ }
+ else {
+
+#line 2101 "dk-lines.ctr"
+ /* Invalid ring buffer size */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 26);
+ }
+ } break;
+ default : {
+
+#line 2106 "dk-lines.ctr"
+ /* Empty by intent */
+ } break;
+ }
+
+
+#line 2110 "dk-lines.ctr"
+ return back;
+}
+
+
+
+/** Allocate ring buffer if necessary and process input.
+*/
+static
+void
+run_for_input(void)
+{
+ const dkChar *fnptr;
+ size_t xi;
+ int argc;
+ int i;
+
+
+#line 2126 "dk-lines.ctr"
+ if (0 != allocate_ring_buffer()) {
+ /*
+ Initialize handling of one large data stream
+ */
+ if (0 != one_stream) {
+ lineno = (dk4_um_t)0UL;
+ pos_ribu = 0;
+ if (NULL != pribu) {
+ for (xi = 0; xi < sz_ribu; xi++) {
+ pribu[xi].str = NULL;
+ pribu[xi].lineno = (dk4_um_t)0UL;
+ pribu[xi].buflen = 0;
+ }
+ }
+ }
+ argc = dk4app_get_argc(app);
+ if (0 < argc) {
+
+#line 2143 "dk-lines.ctr"
+ for (i = 0; ((i < argc) && (0 != sig_can_continue(1))); i++) {
+ fnptr = dk4app_get_argv(app, i);
+ if (NULL != fnptr) {
+
+#line 2146 "dk-lines.ctr"
+#if DK4_ON_WINDOWS
+ if (0 != dk4path_must_expand(fnptr)) {
+ expand_filename_and_run(fnptr);
+ }
+ else {
+#endif
+ run_for_filename(fnptr);
+#if DK4_ON_WINDOWS
+ }
+#endif
+ }
+ else {
+
+#line 2158 "dk-lines.ctr"
+ exval = EXIT_FAILURE;
+ /* ERROR: Did not obtain file name */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 27);
+ }
+ }
+ }
+ else {
+
+#line 2165 "dk-lines.ctr"
+ run_for_file_with_name(stdin, dk_lines_kwnl[7], eie_stdin);
+ }
+ /* Flush ring buffer and clean up resources for large data stream
+ */
+ if (0 != one_stream) {
+ /*
+ Flush ring buffer
+ */
+ flush_ring_buffer();
+ /*
+ Release ring buffer resources
+ */
+ cycle_completed = 0;
+ if (NULL != pribu) {
+ for (xi = 0; xi < sz_ribu; xi++) {
+ dk4mem_release(pribu[xi].str);
+ pribu[xi].lineno = (dk4_um_t)0UL;
+ pribu[xi].buflen = 0;
+ }
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2189 "dk-lines.ctr"
+ }
+#endif
+ if (NULL != pribu) {
+ dk4mem_free(pribu);
+ }
+
+
+#line 2195 "dk-lines.ctr"
+}
+
+
+
+/** Run the functionality.
+*/
+static
+void
+run_the_functions(void)
+{
+ dkChar *mybuf = NULL;
+
+
+#line 2207 "dk-lines.ctr"
+
+
+#line 2208 "dk-lines.ctr"
+ if (0 != process_command_line_arguments()) {
+ /*
+ If a line buffer larger than default is required,
+ allocate the buffer and run
+ */
+ if (DK4_SIZEOF(default_input_line_buffer,dkChar) < sz_ilb) {
+ mybuf = dk4mem_new_app(dkChar,sz_ilb,app);
+ if (NULL != mybuf) {
+ ilb = mybuf;
+ run_for_input();
+ dk4mem_free(mybuf);
+ }
+ else {
+
+#line 2221 "dk-lines.ctr"
+ exval = EXIT_FAILURE;
+ }
+ }
+ /* Otherwise run with default buffer
+ */
+ else {
+ run_for_input();
+ }
+ }
+ else {
+ exval = EXIT_FAILURE;
+ }
+
+
+#line 2234 "dk-lines.ctr"
+}
+
+
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
+*/
+static
+void
+run_with_signals(void)
+{
+#ifdef SIGPIPE
+ struct sigaction opipe;
+#endif
+ struct sigaction oint;
+ struct sigaction oterm;
+#ifdef SIGPIPE
+ struct sigaction npipe;
+#endif
+ struct sigaction nint;
+ struct sigaction nterm;
+ int success = 0;
+
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+
+#line 2263 "dk-lines.ctr"
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+
+#line 2268 "dk-lines.ctr"
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+
+#line 2273 "dk-lines.ctr"
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+#endif
+
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+
+#line 2285 "dk-lines.ctr"
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+
+#line 2290 "dk-lines.ctr"
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+
+#line 2295 "dk-lines.ctr"
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+
+#line 2306 "dk-lines.ctr"
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 2);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+
+#line 2311 "dk-lines.ctr"
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 2);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+
+#line 2316 "dk-lines.ctr"
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 2);
+ goto restore_old_int;
+ }
+
+ success = 1;
+ run_the_functions();
+
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+
+#line 2327 "dk-lines.ctr"
+ /* ERROR: Failed to restore old SIGTERM settings */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 3);
+ success = 0;
+ }
+
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+
+#line 2336 "dk-lines.ctr"
+ /* ERROR: Failed to restore old SIGINT settings */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 4);
+ success = 0;
+ }
+
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+
+#line 2346 "dk-lines.ctr"
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 5);
+ success = 0;
+ }
+#endif
+
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) {
+
+#line 2356 "dk-lines.ctr"
+ exval = EXIT_FAILURE;
+ }
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+*/
+static
+void
+run_with_signals(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ run_the_functions();
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
+*/
+static
+void
+run_with_signals(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ run_the_functions();
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+}
+#else
+/** Set signal handlers and run.
+*/
+static
+void
+run_with_signals(void)
+{
+ run_the_functions();
+}
+#endif
+#endif
+#endif
+
+
+/** Main function.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @return 0 on success, all other values indicate errors.
+*/
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
+{
+ dk4_sig_atomic_t shp;
+
+
+#line 2437 "dk-lines.ctr"
+
+
+#line 2438 "dk-lines.ctr"
+ dk4fput_initialize_stdout();
+ dk4fput_initialize_stderr();
+ app = dk4app_open_cmd(
+ argc, argv, dk_lines_options, dk_lines_sz_options,
+ dk_lines_kwnl[0], DKT_VERSION_DK,
+ dk_lines_kwnl[1], dk_lines_help_text, dk_lines_license_text
+ );
+ if (NULL != app) {
+ sz_msg = dk4app_string_table_size(dk_lines_kw_def);
+ msgs = dk4app_string_table(app, dk_lines_kwnl[2], dk_lines_kw_def);
+ eie_file = dk4app_get_file_in_encoding(app);
+ eie_stdin = dk4app_get_stdin_encoding(app);
+ if (0 != dk4app_can_run_normally(app)) {
+ exval = EXIT_SUCCESS;
+ run_with_signals();
+#ifdef SIGPIPE
+ shp = sig_read_atomic(&sig_had_pipe);
+#else
+ shp = 0;
+#endif
+ if (0 != shp) {
+ if (0 != verbose) {
+
+#line 2460 "dk-lines.ctr"
+ /* ERROR: Stopped by SIGPIPE */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 28);
+ }
+ exval = EXIT_FAILURE;
+ }
+ else {
+ if (0 != had_write_error) {
+
+#line 2467 "dk-lines.ctr"
+ /* ERROR: Had write error */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 29);
+ exval = EXIT_FAILURE;
+ }
+ }
+ if (0 != sig_read_atomic(&sig_had_int)) {
+
+#line 2473 "dk-lines.ctr"
+ /* ERROR: Stopped by interrupt */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 30);
+ }
+ }
+ else {
+ if (0 != dk4app_help_version_license(app)) {
+ exval = EXIT_SUCCESS;
+ }
+ }
+ dk4app_close(app);
+ }
+ fflush(stdout);
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ dk4fput_cleanup_stdout();
+
+
+#line 2489 "dk-lines.ctr"
+
+
+#line 2490 "dk-lines.ctr"
+ exit(exval); return exval;
+}
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk-lines.ctr b/support/dktools/dk-lines.ctr
new file mode 100644
index 0000000000..e05ca2581c
--- /dev/null
+++ b/support/dktools/dk-lines.ctr
@@ -0,0 +1,2493 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+
+/** @file dk-lines.c The dk-lines program.
+ The dk_lines_help_text array below shows details.
+
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#include <stdio.h>
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_UNISTD_H
+#ifndef UNISTD_H_INCLUDED
+#include <unistd.h>
+#define UNISTD_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_PROCESS_H
+#ifndef PROCESS_H_INCLUDED
+#include <process.h>
+#define PROCESS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_SYS_TYPES_H
+#ifndef SYS_TYPES_H_INCLUDED
+#include <sys/types.h>
+#define SYS_TYPES_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_SIGNAL_H
+#ifndef SIGNAL_H_INCLUDED
+#include <signal.h>
+#define SIGNAL_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#include "dk4enc.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRDA_H_INCLUDED
+#include "dk4strda.h"
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#include "dk4dir.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef DK4AOPT_H_INCLUDED
+#include "dk4aopt.h"
+#endif
+
+#ifndef DK4MEMA_H_INCLUDED
+#include "dk4mema.h"
+#endif
+
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
+
+#ifndef DK4MAADU_H_INCLUDED
+#include "dk4maadu.h"
+#endif
+
+#ifndef DK4MAIDDDU_H_INCLUDED
+#include "dk4maidddu.h"
+#endif
+
+#ifndef DK4MAODD_H_INCLUDED
+#include "dk4maodd.h"
+#endif
+
+#ifndef DK4FPUT_H_INCLUDED
+#include "dk4fput.h"
+#endif
+
+#ifndef DK4TSPDK_H_INCLUDED
+#include "dk4tspdk.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4FOPDA_H_INCLUDED
+#include "dk4fopda.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#ifndef DK4TIME_H_INCLUDED
+#include "dk4time.h"
+#endif
+
+#ifndef DK4TIMEDK_H_INCLUDED
+#include "dk4timedk.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
+
+
+$!trace-include
+
+
+
+#ifndef DK_LINES_BUFFER_SIZE
+/** Text buffer size.
+*/
+#define DK_LINES_BUFFER_SIZE 4096
+#endif
+
+
+
+/** Ring buffer element.
+*/
+typedef struct {
+ dkChar *str; /**< Line text. */
+ dk4_um_t lineno; /**< Line number. */
+ size_t buflen; /**< Length of str buffer (number of dkChar). */
+} rbe_t;
+
+
+
+/** Range specification types.
+*/
+enum {
+ RANGE_NONE_NONE = 0 , /**< No ranges specified. */
+ RANGE_NONE_POS , /**< No start, positive end. */
+ RANGE_NONE_NEG , /**< No start, negative end. */
+ RANGE_POS_NONE , /**< Positive start, no end. */
+ RANGE_POS_POS , /**< Positive start, positive end. */
+ RANGE_POS_NEG , /**< Positive start, negative end. */
+ RANGE_NEG_NONE , /**< Negative start, no end. */
+ RANGE_NEG_POS , /**< Negative start, positive end. */
+ RANGE_NEG_NEG , /**< Negative start, negative end. */
+};
+
+
+
+/** Input line buffer.
+*/
+static dkChar default_input_line_buffer[DK_LINES_BUFFER_SIZE];
+
+
+
+/** Buffer to store current date and time.
+*/
+static dkChar date_buffer[64];
+
+
+
+/** Default text, used if help text file is not found.
+*/
+static const dkChar * const dk_lines_help_text[] = {
+$!text macro=dkT,preprocessor
+
+Select lines from text
+
+dk-lines [<options>] [<files>]
+
+Options:
+-i encoding Expected input encoding, one from: plain, ascii, ansi, utf-8,
+ utf-16, utf-16le, utf-16be, c32, c32le, c32be.
+-f string Show lines lexicographically equal or larger than string.
+-t string Show lines lexicographically equal or smaller than string.
+-l spec Specification of line numbers in format <start>/<end> (inclusive)
+ to pass through, applied after -f and -t processing. Examples:
+ 5 (5 and following), 5/8 (5, 6, 7, 8), /8 (1...8), 5/-3 (5 and
+ following except final 2 lines), -5 (final 5 lines), -5/-3 (3 lines
+ before the final 2 lines), /-3 (all lines except the final 2),
+ 5/-3 (5 and following except final 2 lines),
+ -5/8 (final 5 lines but not above line 8).
+-v Verbose mode: Error message on SIGPIPE.
+--help Show this short help text. --manual *** SHOW FULL MANUAL. ***
+--version Show version information. --license Show license information.
+
+http://sourceforge.net/p/dktools/wiki/dk-lines/
+
+$!end
+};
+
+
+
+/** License conditions.
+*/
+static const dkChar * const dk_lines_license_text[] = {
+$!text macro=dkT,preprocessor
+
+This software uses code from the following projects, either directly or as
+a library:
+
+dktools Dirk Krause's tools and libraries.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
+#if DK4_HAVE_ZLIB_H
+
+zlib Data compression library.
+ See http://www.zlib.net/ for more information.
+#endif
+#if DK4_HAVE_BZLIB_H
+
+bzip2 Data compression program and library.
+ See http://www.bzip.org/ for more information.
+#endif
+
+All the licenses below apply to the program.
+Licenses for used libraries are shown as found on my Scientific Linux 6.x
+computer in the /usr/share/doc directory on 2015-04-01. Check the project
+homepages of the used libraries for additional information and/or updated
+license terms.
+
+
+DK tools and libraries license
+==============================
+Copyright (c) 2015-2016, Dirk Krause
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+#if DK4_HAVE_ZLIB_H
+
+
+Zlib license
+============
+(C) 1995-2004 Jean-loup Gailly and Mark Adler
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Jean-loup Gailly Mark Adler
+jloup@gzip.org madler@alumni.caltech.edu
+#endif
+#if DK4_HAVE_BZLIB_H
+
+
+Bzip2 and libbzip2 library license
+==================================
+This program, "bzip2", the associated library "libbzip2", and all
+documentation, are copyright (C) 1996-2007 Julian R Seward. All
+rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Julian Seward, jseward@bzip.org
+bzip2/libbzip2 version 1.0.5 of 10 December 2007
+#endif
+
+$!end
+};
+
+
+
+/** Constant texts used by program, not localized.
+*/
+static const dkChar * const dk_lines_kwnl[] = {
+$!string-table macro=dkT
+#
+# 0 Program group name
+#
+dktools
+#
+# 1 Help text file name
+#
+dk-lines.txt
+#
+# 2 String table file
+#
+dk-lines.str
+#
+# 3 Long option for line size
+#
+line-size
+#
+# 4 Long option to use current date
+#
+today
+#
+# 5 File name separator
+#
+/
+#
+# 6 File open mode
+#
+rb
+#
+# 7 File name when processing stdin
+#
+<stdin>
+#
+#
+#
+$!end
+};
+
+
+
+/** Constant texts used by program, replaced by localized texts
+ if available.
+*/
+static const dkChar * const dk_lines_kw_def[] = {
+$!string-table macro=dkT
+#
+# 0 ERROR: Failed to set up masked signal set for SIGPIPE
+#
+Failed to set up masked signal set for SIGPIPE!
+#
+# 1 ERROR: Failed to set up masked signal set for SIGINT
+#
+Failed to set up masked signal set for SIGINT!
+#
+# 2 ERROR: Failed to set up masked signal set for SIGTERM
+#
+Failed to set up masked signal set for SIGTERM!
+#
+# 3 ERROR: Failed to restore SIGTERM settings!
+#
+Failed to restore SIGTERM settings!
+#
+# 4 ERROR: Failed to restore SIGINT settings
+#
+Failed to restore SIGTERM settings!
+#
+# 5 ERROR: Failed to restore SIGPIPE settings
+#
+Failed to restore SIGPIPE settings!
+#
+# 6 ERROR: Illegal line number 0!
+#
+Illegal line number 0!
+#
+# 7 8 ERROR: Number ... too large!
+#
+Number too large: "
+"!
+#
+# 9 10 ERROR: Not a number: ...!
+#
+Not a number: "
+"!
+#
+# 11 ERROR: Start line number larger than end number!
+#
+Start line number larger than end number!
+#
+# 12 ERROR: Invalid line range specification (empty string)!
+#
+Invalid line range specification (empty string)!
+#
+# 13 ERROR: Missing line range specification!
+#
+Missing line range specification!
+#
+# 14 15 ERROR: Illegal input encoding!
+#
+Illegal input encoding: "
+"!
+#
+# 16 ERROR: Missing input encoding!
+#
+Missing input encoding!
+#
+# 17 ERROR: Invalid line size 0!
+#
+Invalid line size 0!
+#
+# 18 ERROR: Missing line size specification!
+#
+Missing line size specification!
+#
+# 19 ERROR: Can not use --today with both --from and --to!
+#
+Can not use --today with both --from and --to!
+#
+# 20 ERROR: Input line too long!
+#
+Input line too long!
+#
+# 21 ERROR: Overflow in line number!
+#
+Too many lines, overflow in line number!
+#
+# 22 ERROR: Overflow in line range calculation!
+#
+Overflow in line range calculation!
+#
+# 23 ERROR: End line number is 1 (bug)!
+#
+End line number is 1 (should not happen, bug)!
+#
+# 24 ERROR: End line number too large!
+#
+End line number too large, numeric overflow!
+#
+# 25 ERROR: Start line number too large!
+#
+Start line number too large, numeric overflow!
+#
+# 26 ERROR: Ring buffer size 0!
+#
+Ring buffer size is 0 (should not happen, bug)!
+#
+# 27 ERROR: Failed to obtain file name!
+#
+Failed to obtain file name (should not happen, bug)!
+#
+# 28 ERROR: Stopped by SIGPIPE!
+#
+Program stopped by SIGPIPE!
+#
+# 29 ERROR: I/O errors while writing output!
+#
+I/O errors while writing output!
+#
+# 30 ERROR: Stopped by interrupt!
+#
+Program stopped by interrupt!
+#
+# 31 32 33 Error messages for encoding/decoding/processing errors
+#
+Encoding error!
+Decoding error!
+Processing error!
+#
+# 34 ... 39 Error messages with detailed position
+#
+Encoding error!\n\tByte:
+Decoding error!\n\tByte:
+Processing error!\n\tByte:
+,\n\tCharacter:
+,\n\tPosition in line:
+.
+$!end
+};
+
+
+
+/** Options used by program.
+*/
+static const dk4_option_specification_t dk_lines_options[] = {
+
+ /* Input encoding.
+ */
+ { dkT('i'), dkT("input-encoding"), DK4_OPT_ARG_STRING },
+
+ /* Only lines matching start text or lexicagraphically after text.
+ */
+ { dkT('f'), dkT("from"), DK4_OPT_ARG_STRING },
+
+ /* Only lines matching end text or lexicographically before text.
+ */
+ { dkT('t'), dkT("to"), DK4_OPT_ARG_STRING },
+
+ /* Line number selection _after_ applying from and to rules.
+ First line is line 1, final line is line -1.
+ dk-lines -l 5/8 Lines 5, 6, 7 and 8
+ dk-lines -l 5 Lines 5, ...
+ dk-lines -l /8 Lines 1, ... 8
+ dk-lines -l -8/-5 8 before last ... 5 before last
+ dk-lines -l -8 Final 8 lines
+ dk-lines -l /-5 Skip final 5 lines
+ dk-lines -l -8/125 Final 8 lines but not above line 125
+ dk-lines -l 125/-8 Lines from 125 but skip final 8 lines
+ dk-lines without -l option All lines
+ */
+ { dkT('l'), dkT("lines"), DK4_OPT_ARG_STRING },
+
+ /* Verbose flag (write notification on SIGPIPE).
+ */
+ { dkT('v'), dkT("verbose"), DK4_OPT_ARG_NONE },
+
+ /* Treat multiple files as one stream.
+ */
+ { dkT('o'), dkT("one-stream"), DK4_OPT_ARG_NONE },
+
+ /* Line buffer size.
+ */
+ { dkT('\0'), dkT("line-size"), DK4_OPT_ARG_SIZE },
+
+ /** Use current date to filter lines.
+ */
+ { dkT('\0'), dkT("today"), DK4_OPT_ARG_NONE }
+};
+
+
+#if DK4_ON_WINDOWS
+
+/** File name separator.
+*/
+static const dkChar fnsep[] = {
+#if DK4_HAVE_BACKSLASH_AS_SEP
+dkT("\\")
+#else
+dkT("/")
+#endif
+};
+
+#endif
+
+
+
+/** Ring buffer used for negative line numbers.
+*/
+static rbe_t *pribu = NULL;
+
+
+
+/** Application structure.
+*/
+static dk4_app_t *app = NULL;
+
+
+/** Pointer to localized messages array.
+*/
+static const dkChar * const *msgs = dk_lines_kw_def;
+
+
+
+/** Start range.
+*/
+static const dkChar *t_from = NULL;
+
+
+
+/** End of range.
+*/
+static const dkChar *t_to = NULL;
+
+
+/** Input line buffer to use.
+*/
+static dkChar *ilb = default_input_line_buffer;
+
+
+
+/** Start line number.
+*/
+static dk4_um_t l_start = (dk4_um_t)0UL;
+
+
+
+/** End line number.
+*/
+static dk4_um_t l_end = (dk4_um_t)0UL;
+
+
+
+/** Current line number.
+*/
+static dk4_um_t lineno = (dk4_um_t)0UL;
+
+
+
+/** Length of --from text.
+*/
+static size_t sz_t_from = 0;
+
+
+
+/** Length of --to text.
+*/
+static size_t sz_t_to = 0;
+
+
+
+/** Ring buffer size (number of elements).
+*/
+static size_t sz_ribu = 0;
+
+
+
+/** Current position in ring buffer.
+*/
+static size_t pos_ribu = 0;
+
+
+
+/** Size of input line buffer.
+*/
+static size_t sz_ilb = DK4_SIZEOF(default_input_line_buffer,dkChar);
+
+
+
+/** Number of usable elements in the dk_lines_kw_def array and in msg.
+*/
+static size_t sz_msg = (sizeof(dk_lines_kw_def)/sizeof(DK4_PDKCHAR) - 1);
+
+
+
+/** Number of elements in the dk_lines_options array.
+*/
+static const size_t dk_lines_sz_options =
+sizeof(dk_lines_options)/sizeof(dk4_option_specification_t);
+
+
+
+/** Line handling type.
+*/
+static int l_type = RANGE_NONE_NONE;
+
+
+
+/** Exit status code.
+*/
+static int exval = EXIT_FAILURE;
+
+
+
+/** Flag: Write errors.
+*/
+static int had_write_error = 0;
+
+
+
+/** Expected input encoding when reading from file.
+*/
+static int eie_file =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
+
+
+
+/** Expected input encoding on standard input.
+*/
+static int eie_stdin =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
+
+
+
+/** Verbose flag (report SIGPIPE or unusual large line buffer size).
+*/
+static int verbose = 0;
+
+
+
+/** Flag: At least one cyle in the ring buffer was completed.
+*/
+static int cycle_completed = 0;
+
+
+
+/** Flag: Treat multiple files as one stream.
+*/
+static int one_stream = 0;
+
+
+
+/** Number of decoding errors already reported.
+*/
+static int num_r_decoding_e = 0;
+
+
+
+/** Maximum number of decoding errors to report unless verbose output required.
+*/
+static const int max_r_decoding_e = 3;
+
+
+
+/** Number of encoding errors already reported.
+*/
+static int num_r_encoding_e = 0;
+
+
+
+/** Maximum number of encoding errors to report unless verbose output required.
+*/
+static const int max_r_encoding_e = 3;
+
+
+
+/** Number of processing errors already reported.
+*/
+static int num_r_processing_e = 0;
+
+
+
+/** Maximum number of processing errors to report unless
+ verbose output required.
+*/
+static const int max_r_processing_e = 3;
+
+
+
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
+
+/** Indicator: SIGTERM signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+
+
+
+/** Special function to pass a volatile pointer.
+ Some C compiler does not handle direct assignments to volatile variables
+ correctly.
+ @param ptr Address of volatile variable.
+ @return Same address.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
+{
+ return ptr;
+}
+
+
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
+*/
+static
+void
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
+}
+#endif
+
+
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
+static
+void
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
+}
+
+
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
+*/
+static
+void
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
+}
+
+
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
+
+
+
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
+*/
+static
+int
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
+{
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
+}
+
+
+
+/** Retrieve value from text.
+ @param pdest Address of result variable to fill.
+ @param vtxt Text containing the value.
+ @param pback Address of success variable to reset on error.
+*/
+static
+void
+retrieve_number(dk4_um_t *pdest, const dkChar *vtxt, int *pback)
+{
+ dk4_er_t er;
+ dk4_um_t u = (dk4_um_t)0UL;
+ const dkChar *pe = NULL;
+ $? "+ retrieve_number \"%!ds\"", TR_STR(vtxt)
+ dk4error_init(&er);
+ if (0 != dk4ma_input_dk_dec_dk4_um_t(&u, vtxt, &pe, 1, &er)) {
+ if ((dk4_um_t)0UL < u) {
+ *pdest = u;
+ }
+ else { $? "! 0"
+ *pback = 0;
+ /* ERROR: Illegal line number 0 */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 6);
+ }
+ }
+ else {
+ *pback = 0;
+ switch (er.ec) {
+ case DK4_E_MATH_OVERFLOW : { $? "! overflow"
+ /* ERROR: Number too large */
+ dk4app_log_3(app, msgs, sz_msg, DK4_LL_ERROR, 7, 8, vtxt);
+ } break;
+ default : { $? "! not a number"
+ /* ERROR: Not a number */
+ dk4app_log_3(app, msgs, sz_msg, DK4_LL_ERROR, 9, 10, vtxt);
+ } break;
+ }
+ }
+ $? "- retrieve_number"
+}
+
+
+
+#if TRACE_DEBUG
+
+static
+void
+trace_type_start_end(int t, unsigned long s, unsigned long e)
+{
+ $? ". type=%d start=%lu end=%lu", t, s, e
+}
+
+#endif
+
+
+
+/** Process line number range.
+ @param ps Text containing start line number.
+ @param pe Text containing end line number.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+process_line_range_items(const dkChar *ps, const dkChar *pe)
+{
+ int back = 1;
+ $? "+ process_line_range_items \"%!ds\" \"%!ds\"", TR_STR(ps), TR_STR(pe)
+
+ /* Retrieve pure data from texts
+ */
+ if (NULL != ps) { $? ". ps != NULL"
+ if (NULL != pe) { $? ". ps != NULL, pe != NULL"
+ if (dkT('-') != *ps) { $? ". ps pos"
+ if (dkT('-') != *pe) { $? ". ps pos, pe pos"
+ l_type = RANGE_POS_POS;
+ retrieve_number(&l_start, ps, &back);
+ retrieve_number(&l_end, pe, &back);
+ if (l_start > l_end) { $? "! start > end"
+ back = 0;
+ /* ERROR: start line number larger than end */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 11);
+ }
+ }
+ else { $? ". ps pos, pe neg"
+ pe++;
+ l_type = RANGE_POS_NEG;
+ retrieve_number(&l_start, ps, &back);
+ retrieve_number(&l_end, pe, &back);
+ }
+ }
+ else { $? ". ps neg"
+ ps++;
+ if (dkT('-') != *pe) { $? ". ps neg, pe pos"
+ l_type = RANGE_NEG_POS;
+ retrieve_number(&l_start, ps, &back);
+ retrieve_number(&l_end, pe, &back);
+ }
+ else { $? ". ps neg, pe neg"
+ pe++;
+ l_type = RANGE_NEG_NEG;
+ retrieve_number(&l_start, ps, &back);
+ retrieve_number(&l_end, pe, &back);
+ if (l_end > l_start) { $? "! end > start"
+ back = 0;
+ /* ERROR: End line number larger than start */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 11);
+ }
+ }
+ }
+ }
+ else { $? ". ps != NULL, pe == NULL"
+ if (dkT('-') != *ps) { $? ". ps pos, pe none"
+ l_type = RANGE_POS_NONE;
+ retrieve_number(&l_start, ps, &back);
+ }
+ else { $? ". ps neg, pe none"
+ ps++;
+ l_type = RANGE_NEG_NONE;
+ retrieve_number(&l_start, ps, &back);
+ }
+ }
+ }
+ else { $? ". ps == NULL"
+ if (NULL != pe) { $? ". ps == NULL, pe != NULL"
+ if (dkT('-') != *pe) { $? ". ps none, pe pos"
+ l_type = RANGE_NONE_POS;
+ retrieve_number(&l_end, pe, &back);
+ }
+ else { $? ". ps none, pe neg"
+ pe++;
+ l_type = RANGE_NONE_NEG;
+ retrieve_number(&l_end, pe, &back);
+ }
+ }
+ else { $? ". ps == NULL, pe == NULL"
+ }
+ }
+
+ /* Corrections for full ranges
+ */
+ if (0 != back) {
+ $? ". t=%d s=%lu e=%lu", l_type, (unsigned long)l_start, (unsigned long)l_end
+ $!trace-code trace_type_start_end(l_type, l_start, l_end);
+ switch (l_type) {
+ case RANGE_NONE_NEG : {
+ if ((dk4_um_t)1UL == l_end) {
+ l_type = RANGE_NONE_NONE;
+ l_end = (dk4_um_t)0UL;
+ $!trace-code trace_type_start_end(l_type, l_start, l_end);
+ }
+ } break;
+ case RANGE_POS_NEG : {
+ if ((dk4_um_t)1UL == l_end) {
+ l_type = RANGE_POS_NONE;
+ l_end = (dk4_um_t)0UL;
+ $!trace-code trace_type_start_end(l_type, l_start, l_end);
+ if ((dk4_um_t)1UL == l_start) {
+ l_type = RANGE_NONE_NONE;
+ l_start = (dk4_um_t)0UL;
+ $!trace-code trace_type_start_end(l_type,l_start,l_end);
+ }
+ }
+ else {
+ if ((dk4_um_t)1UL == l_start) {
+ l_type = RANGE_NONE_NEG;
+ l_start = (dk4_um_t)0UL;
+ $!trace-code trace_type_start_end(l_type,l_start,l_end);
+ }
+ }
+ } break;
+ case RANGE_NEG_NEG : {
+ if ((dk4_um_t)1UL == l_end) {
+ l_type = RANGE_NEG_NONE;
+ l_end = (dk4_um_t)0UL;
+ $!trace-code trace_type_start_end(l_type, l_start, l_end);
+ }
+ } break;
+ case RANGE_POS_NONE : {
+ if ((dk4_um_t)1UL == l_start) {
+ l_start = (dk4_um_t)0UL;
+ l_type = RANGE_NONE_NONE;
+ $!trace-code trace_type_start_end(l_type, l_start, l_end);
+ }
+ } break;
+ case RANGE_POS_POS : {
+ if ((dk4_um_t)1UL == l_start) {
+ l_start = (dk4_um_t)0UL;
+ l_type = RANGE_NONE_POS;
+ $!trace-code trace_type_start_end(l_type, l_start, l_end);
+ }
+ } break;
+ default : {
+ /* Empty by intent */
+ $!trace-code trace_type_start_end(l_type, l_start, l_end);
+ } break;
+ }
+ }
+ $? "- process_line_range_items %d", back
+ return back;
+}
+
+
+
+/** Process line number range.
+ @param range Text containing the line number range.
+*/
+static
+int
+process_line_range(const dkChar *range)
+{
+ dkChar buf[64*sizeof(dk4_um_t)];
+ dkChar *p1 = NULL;
+ dkChar *p2 = NULL;
+ int back = 0;
+ $? "+ process_line_range \"%!ds\"", range
+ back = dk4str_cpy_s(buf, DK4_SIZEOF(buf,dkChar), range, NULL);
+ if (0 != back) {
+ p1 = dk4str_start(buf, NULL);
+ if (NULL != p1) { $? ". p1=\"%!ds\"", p1
+ p2 = dk4str_chr(p1, dkT('/'));
+ if (NULL != p2) { $? ". p2=\"%!ds\"", p2
+ *(p2++) = dkT('\0');
+ p2 = dk4str_start(p2, NULL); $? ". p2=\"%!ds\"", TR_STR(p2)
+ p1 = dk4str_start(p1, NULL); $? ". p1=\"%!ds\"", TR_STR(p1)
+ } $? ". p1=\"%!ds\" p2=\"%!ds\"", TR_STR(p1), TR_STR(p2)
+ back = process_line_range_items(p1, p2);
+ }
+ else { $? "! empty string"
+ /* ERROR: Empty string */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 12);
+ back = 0;
+ }
+ }
+ $? "- process_line_range %d", back
+ return back;
+}
+
+
+
+/** Retrieve configuration from command line arguments.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+process_command_line_arguments(void)
+{
+ dk4_time_t timer = (dk4_time_t)0UL;
+ const dkChar *ptr = NULL;
+ size_t sz = 0;
+ int back = 1;
+ int res = 0;
+ int iec = 0;
+ $? "+ process_command_line_arguments"
+
+ /* --verbose
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('v'), NULL)) {
+ verbose = 1;
+ }
+
+ /* --one-stream
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('o'), NULL)) {
+ one_stream = 1;
+ }
+
+ /* --from
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('f'), NULL)) {
+ t_from = dk4app_opt_get_string_ptr_short(app, dkT('f'), NULL);
+ sz_t_from = dk4str_len(t_from);
+ }
+
+ /* --to
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('t'), NULL)) {
+ t_to = dk4app_opt_get_string_ptr_short(app, dkT('t'), NULL);
+ sz_t_to = dk4str_len(t_to);
+ }
+
+ /* --lines
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('l'), NULL)) {
+ ptr = dk4app_opt_get_string_ptr_short(app, dkT('l'), NULL);
+ if (NULL != ptr) {
+ back = process_line_range(ptr);
+ }
+ else { $? "! missing arg for --lines"
+ /* ERROR: Failed to retrieve line range argument */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 13);
+ back = 0;
+ }
+ }
+
+ /* --input-encoding
+ */
+ if (0 != dk4app_opt_is_set_short(app, dkT('i'), NULL)) {
+ ptr = dk4app_opt_get_string_ptr_short(app, dkT('i'), NULL);
+ if (NULL != ptr) {
+ res = dk4enc_find(&iec, NULL, ptr, NULL);
+ if (0 != res) {
+ eie_stdin = iec;
+ eie_file = iec;
+ }
+ else {
+ /* ERROR: Illegal input encoding */
+ dk4app_log_3(app, msgs, sz_msg, DK4_LL_ERROR, 14, 15, ptr);
+ }
+ }
+ else {
+ back = 0;
+ /* ERROR: Failed to retrieve input encoding */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 16);
+ }
+ }
+
+ /* --line-size
+ */
+ if (0 != dk4app_opt_is_set_long(app, dk_lines_kwnl[3], NULL)) {
+ if (0 != dk4app_opt_get_size_long(&sz, app, dk_lines_kwnl[3], NULL)) {
+ if (0 < sz) {
+ if (DK4_SIZEOF(default_input_line_buffer,dkChar) < sz) {
+ sz_ilb = sz;
+ }
+#if TRACE_DEBUG
+ else { $? ". not larger than existing"
+ }
+#endif
+ }
+ else { $? "! line size 0"
+ /* ERROR: Line size 0 */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 17);
+ back = 0;
+ }
+ }
+ else { $? "! missing arg for --line-size"
+ /* ERROR: Failed to retrieve line size */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 18);
+ back = 0;
+ }
+ }
+
+ /* --today
+ */
+ if (0 != dk4app_opt_is_set_long(app, dk_lines_kwnl[4], NULL)) {
+ if ((NULL == t_from) || (NULL == t_to)) {
+ dk4time_get(&timer);
+ res = dk4time_as_text(
+ date_buffer, DK4_SIZEOF(date_buffer,dkChar), &timer, NULL
+ );
+ if (0 != res) {
+ date_buffer[10] = dkT('\0');
+ if (NULL == t_from) {
+ t_from = date_buffer;
+ sz_t_from = dk4str_len(t_from);
+ }
+ if (NULL == t_to ) {
+ t_to = date_buffer;
+ sz_t_to = dk4str_len(t_to);
+ }
+ }
+ }
+ else {
+ /* ERROR: --today used with --from and --to */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 19);
+ }
+ }
+ $? "- process_command_line_arguments %d", back
+ return back;
+}
+
+
+
+/** Report an error with position.
+ @param i1 Index of first message part in array.
+ @param i2 Index of alternative first message part.
+ @param bno Current byte number.
+ @param lno Current line number.
+ @param cno Current character number.
+ @param cil Current character number within line.
+ @param fn File name processed.
+*/
+static
+void
+report_with_position(
+ size_t i1,
+ size_t i2,
+ dk4_um_t bno,
+ dk4_um_t lno,
+ dk4_um_t cno,
+ dk4_um_t cil,
+ const dkChar *fn
+)
+{
+ dkChar b1[8*(1+sizeof(dk4_um_t))+16];
+ dkChar b2[8*(1+sizeof(dk4_um_t))+16];
+ dkChar b3[8*(1+sizeof(dk4_um_t))+16];
+ const dkChar *oldlogname = NULL;
+ dk4_um_t oldlogline = (dk4_um_t)0UL;
+ const size_t szb3 = DK4_SIZEOF(b3,dkChar);
+ const size_t szb2 = DK4_SIZEOF(b2,dkChar);
+ const size_t szb1 = DK4_SIZEOF(b1,dkChar);
+ int allbuffersok = 0;
+
+ oldlogname = dk4app_get_log_source_file(app);
+ oldlogline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, lno);
+ if (0 != dk4ma_write_decimal_unsigned(b3, szb3, cil, 0, NULL)) {
+ if (0 != dk4ma_write_decimal_unsigned(b2, szb2, cno, 0, NULL)) {
+ if (0 != dk4ma_write_decimal_unsigned(b1, szb1, bno, 0, NULL)) {
+ allbuffersok = 1;
+ }
+ }
+ }
+ if (0 != allbuffersok) {
+ dk4app_log_7(
+ app, msgs, sz_msg, DK4_LL_ERROR, i1, 37, 38, 39, b1, b2, b3
+ );
+ }
+ else {
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, i2);
+ }
+ dk4app_set_log_source_line(app, oldlogline);
+ dk4app_set_log_source_file(app, oldlogname);
+}
+
+
+
+static
+void
+report_errors_from_tsp(
+ dk4_er_t *er_en,
+ dk4_er_t *er_pr,
+ const dkChar *fn
+)
+{
+ if (NULL != er_en) {
+ switch (er_en->ec) {
+ case DK4_E_DECODING_FAILED : {
+ if ((0 != verbose) || (max_r_decoding_e > num_r_decoding_e)) {
+ report_with_position(
+ 35, 32,
+ er_en->dt.fpos.byteno, er_en->dt.fpos.lineno,
+ er_en->dt.fpos.charno, er_en->dt.fpos.charinline,
+ fn
+ );
+ num_r_decoding_e++;
+ if (num_r_decoding_e > max_r_decoding_e) {
+ num_r_decoding_e = max_r_decoding_e;
+ }
+ }
+ } break;
+ case DK4_E_ENCODING_FAILED : {
+ if ((0 != verbose) || (max_r_encoding_e > num_r_encoding_e)) {
+ report_with_position(
+ 34, 31,
+ er_en->dt.fpos.byteno, er_en->dt.fpos.lineno,
+ er_en->dt.fpos.charno, er_en->dt.fpos.charinline,
+ fn
+ );
+ num_r_encoding_e++;
+ if (num_r_encoding_e > max_r_encoding_e) {
+ num_r_encoding_e = max_r_encoding_e;
+ }
+ }
+ } break;
+ }
+ }
+ if (NULL != er_pr) {
+ if (DK4_E_NONE != er_pr->ec) {
+ if ((0 != verbose) || (max_r_processing_e > num_r_processing_e)) {
+ report_with_position(
+ 36, 33,
+ er_pr->dt.fpos.byteno, er_pr->dt.fpos.lineno,
+ er_pr->dt.fpos.charno, er_pr->dt.fpos.charinline,
+ fn
+ );
+ num_r_processing_e++;
+ if (num_r_processing_e > max_r_processing_e) {
+ num_r_processing_e = max_r_processing_e;
+ }
+ }
+ }
+ }
+}
+
+
+
+static
+int
+write_text_line(const dkChar *line, dk4_er_t *erp)
+{
+ int back = DK4_TSP_RES_OK;
+ if (0 == dk4fputs(line, stdout, erp)) {
+ had_write_error = 1;
+ back = DK4_TSP_RES_ERROR;
+ }
+ if (0 == dk4fputc(dkT('\n'), stdout, erp)) {
+ had_write_error = 1;
+ back = DK4_TSP_RES_ERROR;
+ }
+ return back;
+}
+
+
+
+/** Add new line to ring buffer, write line stored previously.
+ @param line New line to add.
+ @param erp Error report.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on error.
+*/
+static
+int
+ribu_add_and_print(const dkChar *line, dk4_er_t *erp)
+{
+ dkChar *ptr;
+ size_t sz;
+ int back = DK4_TSP_RES_OK;
+ $? "+ ribu_add_and_print"
+ sz = dk4str_len(line);
+ if ((SIZE_MAX) > sz) {
+ if ((NULL != pribu) && (0 < sz_ribu)) {
+ if (NULL != pribu[pos_ribu].str) {
+ $? ". ring buffer [%u] used =", (unsigned)pos_ribu
+ $? ". \"%!ds\"", pribu[pos_ribu].str
+ if (0 != cycle_completed) {
+ back = write_text_line(pribu[pos_ribu].str, erp);
+ }
+ if (sz > pribu[pos_ribu].buflen) { $? ". allocate new buffer"
+ ptr = dk4str_dup_app(line, app);
+ if (NULL != ptr) {
+ dk4mem_free(pribu[pos_ribu].str);
+ pribu[pos_ribu].str = ptr;
+ pribu[pos_ribu].buflen = sz;
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ /* ERROR: Memory allocation failed */
+ }
+ }
+ else { $? ". reuse existing buffer"
+ (void)dk4str_cpy_s(
+ pribu[pos_ribu].str, (1 + pribu[pos_ribu].buflen),
+ line, NULL
+ );
+ }
+ }
+ else { $? ". ring buffer [%u] empty", (unsigned)pos_ribu
+ pribu[pos_ribu].str = dk4str_dup_app(line, app);
+ pribu[pos_ribu].buflen = sz;
+ if (NULL == pribu[pos_ribu].str) {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ pribu[pos_ribu].buflen = 0;
+ /* ERROR: Memory allocation failed */
+ }
+ }
+ $? ". ring buffer [%u] now =", (unsigned)pos_ribu
+ $? ". \"%!ds\"", pribu[pos_ribu].str
+ pribu[pos_ribu].lineno = lineno;
+ pos_ribu++;
+ if (pos_ribu >= sz_ribu) {
+ pos_ribu = 0;
+ cycle_completed = 1;
+ } $? ". next position %u", (unsigned)pos_ribu
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ /* ERROR: No ring buffer */
+ }
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ /* ERROR: Line too long */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 20);
+ }
+ $? "- ribu_add_and_print %d", back
+ return back;
+}
+
+
+
+/** Add new line to ring buffer, do not print line previously stored.
+ @param line New line to add.
+ @param erp Error report.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on error.
+*/
+static
+int
+ribu_add_silently(const dkChar *line, dk4_er_t *erp)
+{
+ dkChar *ptr;
+ size_t sz;
+ int back = DK4_TSP_RES_OK;
+ $? "+ ribu_add_silently \"%!ds\"", line
+
+ sz = dk4str_len(line);
+ if ((SIZE_MAX) > sz) {
+ if ((NULL != pribu) && (0 < sz_ribu)) { $? ". pribu"
+ if (NULL != pribu[pos_ribu].str) { $? ". have existing string"
+ $? ". ring buffer [%u] old =", (unsigned)pos_ribu
+ $? ". \"%!ds\"", pribu[pos_ribu].str
+ $? ". buf lgt = %lu", (unsigned long)(pribu[pos_ribu].buflen)
+ $? ". line = \"%!ds\"", line
+ if (sz > pribu[pos_ribu].buflen) { $? ". need new string"
+ ptr = dk4str_dup_app(line, app);
+ if (NULL != ptr) { $? ". memory allocated"
+ dk4mem_free(pribu[pos_ribu].str);
+ pribu[pos_ribu].str = ptr;
+ pribu[pos_ribu].buflen = sz;
+ }
+ else { $? "! memory"
+ dk4mem_release(pribu[pos_ribu].str);
+ pribu[pos_ribu].buflen = 0;
+ pribu[pos_ribu].lineno = (dk4_um_t)0UL;
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ /* ERROR: Memory allocation failed */
+ }
+ }
+ else { $? ". use existing buffer"
+ (void)dk4str_cpy_s(
+ pribu[pos_ribu].str, (1 + pribu[pos_ribu].buflen),
+ line, NULL
+ );
+ }
+ }
+ else { $? ". no existing string"
+ pribu[pos_ribu].str = dk4str_dup_app(line, app);
+ pribu[pos_ribu].buflen = sz;
+ if (NULL == pribu[pos_ribu].str) { $? "! memory"
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ pribu[pos_ribu].buflen = 0;
+ /* ERROR: Memory allocation failed */
+ }
+ }
+ $? ". ring buffer [%u] now =", (unsigned)pos_ribu
+ $? ". \"%!ds\"", pribu[pos_ribu].str
+ pribu[pos_ribu].lineno = lineno;
+ pos_ribu++;
+ if (pos_ribu >= sz_ribu) {
+ pos_ribu = 0;
+ }
+ }
+ else { $? "! pribu"
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ /* ERROR: No ring buffer */
+ }
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ /* ERROR: Line too long */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 20);
+ }
+ $? "- ribu_add_silently %d", back
+ return back;
+}
+
+
+
+static
+int
+dk_lines_line_handler(
+ void *DK4_ARG_UNUSED(obj),
+ dkChar *line,
+ dk4_um_t xlineno,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ size_t sz = 0;
+ int back = DK4_TSP_RES_OK;
+ int ok = 1;
+
+ DK4_UNUSED_ARG(obj)
+ $? "+ dk_lines_line_handler"
+ dk4app_set_log_source_line(app, xlineno);
+ dk4str_delnl(line);
+ $? ". line = \"%!ds\"", line
+ if ((NULL != t_from) && (0 < sz_t_from)) {
+#if VERSION_BEFORE_2017_11_20
+ sz = dk4str_len(line);
+ if (sz < sz_t_from) {
+ ok = 0;
+ }
+ else {
+ if (0 > dk4str_ncmp(line, t_from, sz_t_from)) { ok = 0; }
+ }
+#endif
+ if (0 > dk4str_cmp(line, t_from)) { ok = 0; }
+ }
+ if ((0 != ok) && (NULL != t_to) && (0 < sz_t_to)) {
+#if VERSION_BEFORE_2017_11_20
+ if (0 == sz) { sz = dk4str_len(line); }
+ if (sz < sz_t_to) {
+ if (0 < dk4str_ncmp(line, t_to, sz)) { ok = 0; }
+ }
+ else {
+ if (0 < dk4str_ncmp(line, t_to, sz_t_to)) { ok = 0; }
+ }
+#endif
+ sz = dk4str_len(line);
+ if (sz < sz_t_to) {
+ if (0 < dk4str_cmp(line, t_to)) { ok = 0; }
+ }
+ else {
+ if (0 < dk4str_ncmp(line, t_to, sz_t_to)) { ok = 0; }
+ }
+ }
+ if (0 != ok) {
+ dk4error_init(&er);
+ lineno = dk4ma_um_add(lineno, (dk4_um_t)1UL, &er);
+ if (DK4_E_NONE == er.ec) {
+ $? ". adding line %lu \"%!ds\"", (unsigned long)lineno, line
+ switch (l_type) {
+ case RANGE_NONE_NONE : {
+ back = write_text_line(line, erp);
+ } break;
+ case RANGE_NONE_POS : {
+ if (lineno <= l_end) {
+ back = write_text_line(line, erp);
+ }
+ } break;
+ case RANGE_NONE_NEG : {
+ back = ribu_add_and_print(line, erp);
+ } break;
+ case RANGE_POS_NONE : {
+ if (l_start <= lineno) {
+ back = write_text_line(line, erp);
+ }
+ } break;
+ case RANGE_POS_POS : {
+ if ((l_start <= lineno) && (lineno <= l_end)) {
+ back = write_text_line(line, erp);
+ }
+ } break;
+ case RANGE_POS_NEG : {
+ if (l_start <= lineno) {
+ back = ribu_add_and_print(line, erp);
+ }
+ } break;
+ case RANGE_NEG_NONE : {
+ back = ribu_add_silently(line, erp);
+ } break;
+ case RANGE_NEG_POS : {
+ back = ribu_add_silently(line, erp);
+ } break;
+ case RANGE_NEG_NEG : {
+ back = ribu_add_silently(line, erp);
+ } break;
+ }
+ }
+ else {
+ back = DK4_TSP_RES_ERROR;
+ dk4error_copy(erp, &er);
+ /* ERROR: Overflow in line number */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 21);
+ }
+ }
+
+ $? "- dk_lines_line_handler %d", back
+ return back;
+}
+
+
+
+/** Flush the ring buffer after finishing file or stream.
+*/
+static
+void
+flush_ring_buffer(void)
+{
+ dk4_er_t er;
+ dk4_um_t umax;
+ size_t i;
+ size_t idx;
+ size_t max;
+
+ switch (l_type) {
+ case RANGE_NONE_NONE : {
+ /* Empty by intent, ring buffer not used */
+ } break;
+ case RANGE_NONE_POS : {
+ /* Empty by intent, ring buffer not used */
+ } break;
+ case RANGE_NONE_NEG : case RANGE_POS_NEG : {
+ /* Empty by intent, lines of interest already printed */
+ } break;
+ case RANGE_POS_NONE : {
+ /* Empty by intent, ring buffer not used */
+ } break;
+ case RANGE_POS_POS : {
+ /* Empty by intent, ring buffer not used */
+ } break;
+ case RANGE_NEG_NONE : {
+ idx = pos_ribu;
+ for (i = 0; i < sz_ribu; i++) {
+ $? ". loop pass %u / %u", (unsigned)i, (unsigned)sz_ribu
+ if (NULL != pribu[idx].str) { $? ". have string"
+ $? ". line number %lu", (unsigned long)(pribu[idx].lineno)
+ if (0 == dk4fputs(pribu[idx].str, stdout, NULL)) {
+ had_write_error = 1;
+ }
+ if (0 == dk4fputc(dkT('\n'), stdout, NULL)) {
+ had_write_error = 1;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". no string"
+ }
+#endif
+ idx++; if (idx >= sz_ribu) { idx = 0; }
+ }
+ } break;
+ case RANGE_NEG_POS : {
+ idx = pos_ribu;
+ for (i = 0; i < sz_ribu; i++) {
+ if ((NULL != pribu[idx].str) && (pribu[idx].lineno <= l_end)) {
+ if (0 == dk4fputs(pribu[idx].str, stdout, NULL)) {
+ had_write_error = 1;
+ }
+ if (0 == dk4fputc(dkT('\n'), stdout, NULL)) {
+ had_write_error = 1;
+ }
+ }
+ idx++; if (idx >= sz_ribu) { idx = 0; }
+ }
+ } break;
+ case RANGE_NEG_NEG : {
+ dk4error_init(&er);
+ umax = dk4ma_um_add(
+ dk4ma_um_sub(l_start, l_end, &er),
+ (dk4_um_t)1UL,
+ &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ if ((dk4_um_t)(SIZE_MAX) >= umax) {
+ max = (size_t)umax;
+ idx = pos_ribu;
+ for (i = 0; i < max; i++) {
+ if (NULL != pribu[idx].str) {
+ if (0 == dk4fputs(pribu[idx].str, stdout, NULL)) {
+ had_write_error = 1;
+ }
+ if (0 == dk4fputc(dkT('\n'), stdout, NULL)) {
+ had_write_error = 1;
+ }
+ }
+ idx++; if (idx >= sz_ribu) { idx = 0; }
+ }
+ }
+ else {
+ exval = EXIT_FAILURE;
+ /* ERROR: Overflow in line range calculation */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 22);
+ }
+ }
+ else {
+ exval = EXIT_FAILURE;
+ /* ERROR: Overflow in line range calculation */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 22);
+ }
+ } break;
+ }
+}
+
+
+
+/** Process file contents.
+ @param fipo File, opened for binary read access.
+ @param fn File name (for diagnostics).
+ @param eie Expected input encoding.
+*/
+static
+void
+run_for_file_with_name(FILE *fipo, const dkChar *fn, int eie)
+{
+ dk4_tspdk_t tsp; /* Text stream processor */
+ dk4_er_t er_en; /* Error report for enc/decoding */
+ dk4_er_t er_pr; /* Error report for processing */
+ dk4_er_t er; /* General error report */
+ const dkChar *oldlogname = NULL; /* Old source file */
+ dk4_um_t oldlogline = 0UL; /* Old source line */
+ size_t i; /* Traverse ring buffer elements */
+ int c; /* Current character retrieved */
+ int res; /* Operation result */
+ int cc; /* Flag: Can continue */
+ unsigned char uc; /* Byte added to processor */
+ $? "+ run_for_file_with_name"
+
+ oldlogname = dk4app_get_log_source_file(app);
+ oldlogline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ /* Initialize handling of one file
+ */
+ if (0 == one_stream) {
+ lineno = (dk4_um_t)0UL;
+ pos_ribu = 0;
+ if (NULL != pribu) {
+ for (i = 0; i < sz_ribu; i++) {
+ pribu[i].str = NULL;
+ pribu[i].lineno = (dk4_um_t)0UL;
+ pribu[i].buflen = 0;
+ }
+ }
+ }
+
+ /* Process file contents in loop
+ */
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ dk4error_init(&er);
+ res = dk4tspdk_setup_line(
+ &tsp, NULL, dk_lines_line_handler, ilb, sz_ilb,
+ dk4app_get_encoding(app), eie, &er
+ );
+ if (0 != res) {
+ cc = 1;
+ while(1 == cc) {
+ cc = -1;
+ if (0 != sig_can_continue(1)) {
+ c = fgetc(fipo);
+ if (EOF != c) {
+ cc = 1;
+ uc = (unsigned char)c;
+ switch (dk4tspdk_add_one_byte(&tsp, uc)) {
+ case DK4_TSP_RES_FATAL : {
+ cc = -1;
+ exval = EXIT_FAILURE;
+ dk4tspdk_get_errors(&er_en, &er_pr, &tsp);
+ report_errors_from_tsp(&er_en, &er_pr, fn);
+ } break;
+ case DK4_TSP_RES_ERROR : {
+ exval = EXIT_FAILURE;
+ dk4tspdk_get_errors(&er_en, &er_pr, &tsp);
+ report_errors_from_tsp(&er_en, &er_pr, fn);
+ } break;
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ }
+ /* Flush data from text processor
+ */
+ if (0 == cc) {
+ switch (dk4tspdk_finish(&tsp)) {
+ case DK4_TSP_RES_FATAL : case DK4_TSP_RES_ERROR : {
+ exval = EXIT_FAILURE;
+ dk4tspdk_get_errors(&er_en, &er_pr, &tsp);
+ report_errors_from_tsp(&er_en, &er_pr, fn);
+ } break;
+ }
+ }
+ }
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+
+ /* Flush data from ring buffer
+ */
+ if (0 == one_stream) {
+ flush_ring_buffer();
+ }
+
+ /* Clean up resources
+ */
+ if (0 == one_stream) {
+ cycle_completed = 0;
+ if (NULL != pribu) {
+ for (i = 0; i < sz_ribu; i++) {
+ dk4mem_release(pribu[i].str);
+ pribu[i].lineno = (dk4_um_t)0UL;
+ pribu[i].buflen = 0;
+ }
+ }
+ }
+ dk4app_set_log_source_line(app, oldlogline);
+ dk4app_set_log_source_file(app, oldlogname);
+ $? "- run_for_file_with_name"
+}
+
+
+
+/** Open and process a file.
+ @param fn File name to process.
+*/
+static
+void
+run_for_filename(const dkChar *fn)
+{
+ const dkChar *oldlogname = NULL;
+ FILE *fipo = NULL;
+ dk4_um_t oldlogline = (dk4_um_t)0UL;
+ int tests = DK4_FOPEN_SC_USER;
+ $? "+ run_for_filename \"%!ds\"", fn
+ oldlogname = dk4app_get_log_source_file(app);
+ oldlogline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ if (dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
+ $? ". going to open \"%!ds\" \"%!ds\"", fn, dk_lines_kwnl[6]
+ fipo = dk4fopen_app(fn, dk_lines_kwnl[6], tests, app);
+ if (NULL != fipo) {
+ run_for_file_with_name(fipo, fn, eie_file);
+ fclose(fipo);
+ }
+ else {
+ exval = EXIT_FAILURE;
+ }
+ dk4app_set_log_source_line(app, oldlogline);
+ dk4app_set_log_source_file(app, oldlogname);
+ $? "- run_for_filename"
+}
+
+
+
+#if DK4_ON_WINDOWS
+
+static
+void
+expand_filename_and_run(const dkChar *pattern)
+{
+ dkChar buf[DK4_MAX_PATH];
+ dk4_dir_t *fne;
+ const dkChar *shf;
+ const dkChar *pth;
+ const size_t szbuf = DK4_SIZEOF(buf,dkChar);
+ int any_file_found = 0;
+ int cc;
+ int ok;
+ $? "+ expand_filename_and_run \"%!ds\"", pattern
+ fne = dk4app_fne_open(pattern, app);
+ if (NULL != fne) {
+ pth = dk4dir_get_path(fne);
+ cc = 1;
+ while (1 == cc) {
+ if (0 != sig_can_continue(1)) {
+ shf = dk4dir_next_file(fne);
+ if (NULL != shf) { $? ". file name \"%!ds\"", shf
+ any_file_found = 1;
+ if (NULL != pth) { $? ". must constract full path"
+ ok = 1;
+ if (0 == dk4str_cpy_s(buf, szbuf, pth, NULL)) {
+ ok = 0;
+ }
+ if(0 != dk4str_cat_s(buf, szbuf, fnsep, NULL)) {
+ ok = 0;
+ }
+ if(0 != dk4str_cat_s(buf, szbuf, shf, NULL)) {
+ ok = 0;
+ }
+ if (1 == ok) { $? ". process \"%!ds\"", buf
+ run_for_filename(buf);
+ }
+ else { $? ". path too long"
+ /* ERROR: Path too long */
+ exval = EXIT_FAILURE;
+ dk4app_log_base3(app,DK4_LL_ERROR,100,105,pattern);
+ }
+ }
+ else { $? ". run for short file name"
+ run_for_filename(shf);
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ }
+ dk4dir_close(fne);
+ if (0 == any_file_found) {
+ exval = EXIT_FAILURE;
+ dk4app_log_base3(app, DK4_LL_ERROR, 100, 107, pattern);
+ }
+ }
+ else { $? "! failed to open fne"
+ exval = EXIT_FAILURE;
+ /* ERROR: Failed to open file name expander (already reported) */
+ }
+ $? "- expand_filename_and_run"
+}
+
+#endif
+
+
+
+/** Allocate ring buffer used for negative line numbers.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+allocate_ring_buffer(void)
+{
+ size_t i;
+ int back = 1;
+ $? "+ allocate_ring_buffer"
+ switch (l_type) {
+ case RANGE_NONE_NEG : case RANGE_POS_NEG : case RANGE_NEG_NONE :
+ case RANGE_NEG_POS : case RANGE_NEG_NEG : { $? ". need ring buffer"
+ back = 0;
+ switch (l_type) {
+ case RANGE_NONE_NEG : case RANGE_POS_NEG : {
+ if ((dk4_um_t)(SIZE_MAX) >= l_end) {
+ if ((dk4_um_t)1UL < l_end) {
+ sz_ribu = (size_t)(l_end - (dk4_um_t)1UL);
+ }
+ else { $? "! BUG l_end == 1"
+ /* BUG: l_end is 1, should not happen */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 23);
+ }
+ }
+ else { $? "! numeric overflow"
+ /* ERROR: Numeric overflow */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 24);
+ }
+ } break;
+ default : {
+ if ((dk4_um_t)(SIZE_MAX) >= l_start) {
+ sz_ribu = (size_t)l_start;
+ }
+ else { $? "! numeric overflow"
+ /* ERROR: Numeric overflow */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 25);
+ }
+ } break;
+ }
+ if (0 < sz_ribu) { $? ". size %lu", (unsigned long)sz_ribu
+ pribu = dk4mem_new_app(rbe_t,sz_ribu,app);
+ if (NULL != pribu) { $? ". buffer allocated"
+ back = 1;
+ for (i = 0; i < sz_ribu; i++) {
+ pribu[i].str = NULL;
+ pribu[i].lineno = (dk4_um_t)0UL;
+ pribu[i].buflen = 0;
+ }
+ }
+ else { $? "! allocation failed"
+ /* ERROR: Memory allocation failed (already reported) */
+ }
+ }
+ else { $? "! invalid size 0"
+ /* Invalid ring buffer size */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 26);
+ }
+ } break;
+ default : { $? ". no ring buffer needed"
+ /* Empty by intent */
+ } break;
+ }
+ $? "- allocate_ring_buffer %d", back
+ return back;
+}
+
+
+
+/** Allocate ring buffer if necessary and process input.
+*/
+static
+void
+run_for_input(void)
+{
+ const dkChar *fnptr;
+ size_t xi;
+ int argc;
+ int i;
+ $? "+ run_for_input"
+ if (0 != allocate_ring_buffer()) {
+ /*
+ Initialize handling of one large data stream
+ */
+ if (0 != one_stream) {
+ lineno = (dk4_um_t)0UL;
+ pos_ribu = 0;
+ if (NULL != pribu) {
+ for (xi = 0; xi < sz_ribu; xi++) {
+ pribu[xi].str = NULL;
+ pribu[xi].lineno = (dk4_um_t)0UL;
+ pribu[xi].buflen = 0;
+ }
+ }
+ }
+ argc = dk4app_get_argc(app);
+ if (0 < argc) { $? ". have file names"
+ for (i = 0; ((i < argc) && (0 != sig_can_continue(1))); i++) {
+ fnptr = dk4app_get_argv(app, i);
+ if (NULL != fnptr) { $? ". file name \"%!ds\"", fnptr
+#if DK4_ON_WINDOWS
+ if (0 != dk4path_must_expand(fnptr)) {
+ expand_filename_and_run(fnptr);
+ }
+ else {
+#endif
+ run_for_filename(fnptr);
+#if DK4_ON_WINDOWS
+ }
+#endif
+ }
+ else { $? "! failed to obtain file name"
+ exval = EXIT_FAILURE;
+ /* ERROR: Did not obtain file name */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 27);
+ }
+ }
+ }
+ else { $? ". no file names specified"
+ run_for_file_with_name(stdin, dk_lines_kwnl[7], eie_stdin);
+ }
+ /* Flush ring buffer and clean up resources for large data stream
+ */
+ if (0 != one_stream) {
+ /*
+ Flush ring buffer
+ */
+ flush_ring_buffer();
+ /*
+ Release ring buffer resources
+ */
+ cycle_completed = 0;
+ if (NULL != pribu) {
+ for (xi = 0; xi < sz_ribu; xi++) {
+ dk4mem_release(pribu[xi].str);
+ pribu[xi].lineno = (dk4_um_t)0UL;
+ pribu[xi].buflen = 0;
+ }
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! failed to allocate ring buf"
+ }
+#endif
+ if (NULL != pribu) {
+ dk4mem_free(pribu);
+ }
+ $? "- run_for_input"
+}
+
+
+
+/** Run the functionality.
+*/
+static
+void
+run_the_functions(void)
+{
+ dkChar *mybuf = NULL;
+ $? "+ run_the_functions"
+ $? ". running"
+ if (0 != process_command_line_arguments()) {
+ /*
+ If a line buffer larger than default is required,
+ allocate the buffer and run
+ */
+ if (DK4_SIZEOF(default_input_line_buffer,dkChar) < sz_ilb) {
+ mybuf = dk4mem_new_app(dkChar,sz_ilb,app);
+ if (NULL != mybuf) {
+ ilb = mybuf;
+ run_for_input();
+ dk4mem_free(mybuf);
+ }
+ else { $? "! memory allocation failed"
+ exval = EXIT_FAILURE;
+ }
+ }
+ /* Otherwise run with default buffer
+ */
+ else {
+ run_for_input();
+ }
+ }
+ else {
+ exval = EXIT_FAILURE;
+ }
+ $? "- run_the_functions"
+}
+
+
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
+*/
+static
+void
+run_with_signals(void)
+{
+#ifdef SIGPIPE
+ struct sigaction opipe;
+#endif
+ struct sigaction oint;
+ struct sigaction oterm;
+#ifdef SIGPIPE
+ struct sigaction npipe;
+#endif
+ struct sigaction nint;
+ struct sigaction nterm;
+ int success = 0;
+
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) { $? "! sigemptyset SIGPIPE"
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) { $? "! sigaddset SIGPIPE"
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) { $? "! sigaction SIGPIPE"
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+#endif
+
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) { $? "! sigemptyset SIGINT"
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) { $? "! sigaddset SIGINT"
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) { $? "! sigaction SIGINT"
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) { $? "! sigemptyset SIGTERM"
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 2);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) { $? "! sigaddset SIGTERM"
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 2);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) { $? "! sigaction SIGTERM"
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 2);
+ goto restore_old_int;
+ }
+
+ success = 1;
+ run_the_functions();
+
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) { $? "! sigaction SIGTERM"
+ /* ERROR: Failed to restore old SIGTERM settings */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 3);
+ success = 0;
+ }
+
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) { $? "! sigaction SIGINT"
+ /* ERROR: Failed to restore old SIGINT settings */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 4);
+ success = 0;
+ }
+
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) { $? "! sigaction SIGPIPE"
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 5);
+ success = 0;
+ }
+#endif
+
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) { $? "! failure ins signal handling"
+ exval = EXIT_FAILURE;
+ }
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+*/
+static
+void
+run_with_signals(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ run_the_functions();
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
+*/
+static
+void
+run_with_signals(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ run_the_functions();
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+}
+#else
+/** Set signal handlers and run.
+*/
+static
+void
+run_with_signals(void)
+{
+ run_the_functions();
+}
+#endif
+#endif
+#endif
+
+
+/** Main function.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @return 0 on success, all other values indicate errors.
+*/
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
+{
+ dk4_sig_atomic_t shp;
+ $!trace-init dk-lines.deb
+ $? "+ main"
+ dk4fput_initialize_stdout();
+ dk4fput_initialize_stderr();
+ app = dk4app_open_cmd(
+ argc, argv, dk_lines_options, dk_lines_sz_options,
+ dk_lines_kwnl[0], DKT_VERSION_DK,
+ dk_lines_kwnl[1], dk_lines_help_text, dk_lines_license_text
+ );
+ if (NULL != app) {
+ sz_msg = dk4app_string_table_size(dk_lines_kw_def);
+ msgs = dk4app_string_table(app, dk_lines_kwnl[2], dk_lines_kw_def);
+ eie_file = dk4app_get_file_in_encoding(app);
+ eie_stdin = dk4app_get_stdin_encoding(app);
+ if (0 != dk4app_can_run_normally(app)) {
+ exval = EXIT_SUCCESS;
+ run_with_signals();
+#ifdef SIGPIPE
+ shp = sig_read_atomic(&sig_had_pipe);
+#else
+ shp = 0;
+#endif
+ if (0 != shp) {
+ if (0 != verbose) { $? "! stopped by SIGPIPE"
+ /* ERROR: Stopped by SIGPIPE */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 28);
+ }
+ exval = EXIT_FAILURE;
+ }
+ else {
+ if (0 != had_write_error) { $? "! write error occured"
+ /* ERROR: Had write error */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 29);
+ exval = EXIT_FAILURE;
+ }
+ }
+ if (0 != sig_read_atomic(&sig_had_int)) { $? "! stopped by SIGINT"
+ /* ERROR: Stopped by interrupt */
+ dk4app_log_1(app, msgs, sz_msg, DK4_LL_ERROR, 30);
+ }
+ }
+ else {
+ if (0 != dk4app_help_version_license(app)) {
+ exval = EXIT_SUCCESS;
+ }
+ }
+ dk4app_close(app);
+ }
+ fflush(stdout);
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ dk4fput_cleanup_stdout();
+ $? "- main %d", exval
+ $!trace-end
+ exit(exval); return exval;
+}
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk-lines.rc b/support/dktools/dk-lines.rc
new file mode 100644
index 0000000000..66d818cf76
--- /dev/null
+++ b/support/dktools/dk-lines.rc
@@ -0,0 +1,37 @@
+aaaaa ICON dkicon.ico
+
+#include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Extract specific lines from text\0"
+ VALUE "CompanyName", "Dirk Krause\0"
+ VALUE "FileDescription", "Extract specific lines from text\0"
+ VALUE "FileVersion", "4.30.2\0"
+ VALUE "InternalName", "dk-lines\0"
+ VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
+ VALUE "ProductName", "Dirk Krause's tools\0"
+ VALUE "ProductVersion", "4.30.2\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
diff --git a/support/dktools/dk-ls-to.c b/support/dktools/dk-ls-to.c
index 1edfecfc45..377fbd06ea 100644
--- a/support/dktools/dk-ls-to.c
+++ b/support/dktools/dk-ls-to.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-ls-to.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-ls-to.ctr
*/
/** @file dk-ls-to.c The dk-ls-to module.
diff --git a/support/dktools/dk-ls-to.ctr b/support/dktools/dk-ls-to.ctr
index 2caf8925a9..cd32b94273 100644
--- a/support/dktools/dk-ls-to.ctr
+++ b/support/dktools/dk-ls-to.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk-ls.c b/support/dktools/dk-ls.c
index 6ec01d987c..b37d0ff356 100644
--- a/support/dktools/dk-ls.c
+++ b/support/dktools/dk-ls.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-ls.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-ls.ctr
*/
/** @file dk-ls.c The dk-ls module.
*/
-#line 87 "dk-ls.ctr"
+#line 97 "dk-ls.ctr"
#include "dk4conf.h"
@@ -115,12 +93,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4pathd.h"
#include "dk4fopda.h"
#include "dk4symlink.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 168 "dk-ls.ctr"
+#line 182 "dk-ls.ctr"
@@ -149,12 +131,12 @@ dkT(""),
dkT("Message digest types: md5, sha-1, sha-224, sha-256, sha-384, sha-512,"),
dkT("ripemd-160. Optionally add encoding hex or a85, i.e. ``sha-1.hex''."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-ls/"),
dkT(""),
NULL
-#line 200 "dk-ls.ctr"
+#line 214 "dk-ls.ctr"
};
@@ -166,7 +148,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -204,27 +187,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -427,7 +410,7 @@ dkT(""),
NULL
-#line 471 "dk-ls.ctr"
+#line 486 "dk-ls.ctr"
};
@@ -474,7 +457,7 @@ dkT("ERROR: Application startup failed!\n"),
NULL
-#line 529 "dk-ls.ctr"
+#line 544 "dk-ls.ctr"
};
@@ -585,7 +568,7 @@ dkT("# Total number of bytes: "),
NULL
-#line 632 "dk-ls.ctr"
+#line 647 "dk-ls.ctr"
};
@@ -844,8 +827,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -855,8 +839,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -865,8 +850,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -890,10 +876,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -944,7 +938,7 @@ dk_ls_delete_node(dk_ls_node_t *cn)
{
-#line 989 "dk-ls.ctr"
+#line 1015 "dk-ls.ctr"
if (NULL != cn) {
cn->parent = NULL;
cn->child = NULL;
@@ -955,7 +949,7 @@ dk_ls_delete_node(dk_ls_node_t *cn)
dk4mem_free(cn);
}
-#line 998 "dk-ls.ctr"
+#line 1024 "dk-ls.ctr"
}
@@ -976,7 +970,7 @@ dk_ls_new_node(const dkChar *dn, dk_ls_node_t *pa, int level)
int ch = DK4_FILE_INFO_CONTENTS_DATA_TARGET;
-#line 1017 "dk-ls.ctr"
+#line 1043 "dk-ls.ctr"
back = dk4mem_new_app(dk_ls_node_t,1,app);
if (NULL != back) {
DK4_MEMRES(back, sizeof(dk_ls_node_t));
@@ -992,45 +986,45 @@ dk_ls_new_node(const dkChar *dn, dk_ls_node_t *pa, int level)
back->dirptr = dk4dir_open_app(dn, om, app);
if (NULL == back->dirptr) {
-#line 1031 "dk-ls.ctr"
+#line 1057 "dk-ls.ctr"
exval = EXIT_FAILURE;
dk_ls_delete_node(back);
back = NULL;
}
if (NULL != back) {
-#line 1036 "dk-ls.ctr"
+#line 1062 "dk-ls.ctr"
dk4fileinfo_init(&(back->fi));
if (0 != dk4fileinfo_app(&(back->fi), dn, app)) {
if (0 == dk4fileinfo_size(&(back->size), &(back->fi), ch, NULL)) {
back->size = (dk4_um_t)0UL;
-#line 1040 "dk-ls.ctr"
+#line 1066 "dk-ls.ctr"
/* ERROR: Failed to retrieve directory size */
dk_ls_report_fileinfo_size_error(app,dn,ch,dk_ls_msg,dk_ls_sz_msg);
exval = EXIT_FAILURE;
}
} else {
-#line 1045 "dk-ls.ctr"
+#line 1071 "dk-ls.ctr"
/* ERROR: Failed to retrieve file information, already reported */
exval = EXIT_FAILURE;
}
} else {
-#line 1049 "dk-ls.ctr"
+#line 1075 "dk-ls.ctr"
/* ERROR: Failed to open directory, already reported */
exval = EXIT_FAILURE;
}
} else {
-#line 1053 "dk-ls.ctr"
+#line 1079 "dk-ls.ctr"
/* ERROR: Allocation failed, already reported */
exval = EXIT_FAILURE;
}
-#line 1057 "dk-ls.ctr"
+#line 1083 "dk-ls.ctr"
return back;
}
@@ -1058,7 +1052,7 @@ dk_ls_dir_and_file(
int nsep = 1; /* Flag: Separator needed */
-#line 1083 "dk-ls.ctr"
+#line 1109 "dk-ls.ctr"
if (NULL != dirname) {
if (0 != dk4str_cpy_s(bufptr, szbuf, dirname, NULL)) {
while(dkT('\0') != *dirname) {
@@ -1092,19 +1086,19 @@ dk_ls_dir_and_file(
back = 1;
} else {
-#line 1115 "dk-ls.ctr"
+#line 1141 "dk-ls.ctr"
/* BUG: Buffer too small */
exval = EXIT_FAILURE;
}
} else {
-#line 1119 "dk-ls.ctr"
+#line 1145 "dk-ls.ctr"
/* BUG: Buffer too small */
exval = EXIT_FAILURE;
}
} else {
-#line 1123 "dk-ls.ctr"
+#line 1149 "dk-ls.ctr"
/* BUG: Buffer too small */
exval = EXIT_FAILURE;
}
@@ -1112,13 +1106,13 @@ dk_ls_dir_and_file(
back = dk4str_cpy_s(bufptr, szbuf, filename, NULL);
if (0 == back) {
-#line 1129 "dk-ls.ctr"
+#line 1155 "dk-ls.ctr"
/* BUG: Buffer too small */
exval = EXIT_FAILURE;
}
}
-#line 1133 "dk-ls.ctr"
+#line 1159 "dk-ls.ctr"
return back;
}
@@ -1147,7 +1141,7 @@ dk_ls_construct_path(
int back = 0;
-#line 1160 "dk-ls.ctr"
+#line 1186 "dk-ls.ctr"
dk4error_init(&er);
lgt = dk4str_len(filename);
if (NULL != dirname) {
@@ -1161,7 +1155,7 @@ dk_ls_construct_path(
*/
-#line 1172 "dk-ls.ctr"
+#line 1198 "dk-ls.ctr"
back = dk_ls_dir_and_file(*bufptr, *szbufptr, dirname, filename);
} else {
if (dk_ls_max_path > lgt) {
@@ -1170,18 +1164,18 @@ dk_ls_construct_path(
*/
-#line 1179 "dk-ls.ctr"
+#line 1205 "dk-ls.ctr"
nb = dk4mem_new_app(dkChar, lgt, app);
if (NULL != nb) {
-#line 1181 "dk-ls.ctr"
+#line 1207 "dk-ls.ctr"
dk4mem_release(*bufptr);
*bufptr = nb;
*szbufptr = lgt;
back = dk_ls_dir_and_file(*bufptr, *szbufptr, dirname, filename);
} else {
-#line 1186 "dk-ls.ctr"
+#line 1212 "dk-ls.ctr"
/* ERROR: Memory allocation failed, already reported */
exval = EXIT_FAILURE;
}
@@ -1198,7 +1192,7 @@ dk_ls_construct_path(
}
-#line 1201 "dk-ls.ctr"
+#line 1227 "dk-ls.ctr"
return back;
}
@@ -1228,7 +1222,7 @@ dk_ls_write_decimal_number(dk4_um_t value, size_t width)
}
} else {
-#line 1229 "dk-ls.ctr"
+#line 1255 "dk-ls.ctr"
/* ERROR: Failed to write decimal number to buffer (bug) */
exval = EXIT_FAILURE;
}
@@ -1246,36 +1240,36 @@ dk_ls_write_hexadecimal_number(dk4_um_t value, size_t width)
int res;
-#line 1245 "dk-ls.ctr"
+#line 1271 "dk-ls.ctr"
dk4error_init(&er);
res = dk4ma_write_hex_unsigned(
buf, DK4_SIZEOF(buf,dkChar), value, width, &er
);
if (0 != res) {
-#line 1250 "dk-ls.ctr"
+#line 1276 "dk-ls.ctr"
sl = dk4str_len(buf);
while (sl++ < width) {
-#line 1252 "dk-ls.ctr"
+#line 1278 "dk-ls.ctr"
if (0 == dk4fputc(dkT('0'), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
}
}
if (0 == dk4fputs(buf, stdout, NULL)) {
-#line 1257 "dk-ls.ctr"
+#line 1283 "dk-ls.ctr"
write_error = 1; exval = EXIT_FAILURE;
}
} else {
-#line 1260 "dk-ls.ctr"
+#line 1286 "dk-ls.ctr"
/* BUG: Failed to write hexadecimal number to buffer */
exval = EXIT_FAILURE;
}
-#line 1264 "dk-ls.ctr"
+#line 1290 "dk-ls.ctr"
}
@@ -1320,14 +1314,14 @@ dk_ls_write_timestamp(
/** Write indicator for unkown data.
- @param width Field width.
- @param compl Fill complete field.
+ @param width Field width.
+ @param complete Fill complete field.
*/
static
void
-dk_ls_write_unknown(size_t width, int compl)
+dk_ls_write_unknown(size_t width, int complete)
{
- if (0 != compl) {
+ if (0 != complete) {
while (0 < width--) {
if (0 == dk4fputc(dkT('?'), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1349,7 +1343,7 @@ dk_ls_write_unknown(size_t width, int compl)
static
int
-dk_ls_can_create_md(const dkChar *fn, dk4_file_info_t *fiptr)
+dk_ls_can_create_md(dk4_file_info_t *fiptr)
{
int back = 0;
if (0 == dk4fileinfo_is_symlink(fiptr)) {
@@ -1402,30 +1396,30 @@ dk_ls_write_md(
const char *resptr; /* Pointer to encoded digest buffer */
size_t rdbytes; /* Number of bytes read */
int mdok = 0; /* Flag: Digesting ok so far */
- if (0 != dk_ls_can_create_md(fn, fiptr)) {
+ if (0 != dk_ls_can_create_md(fiptr)) {
-#line 1391 "dk-ls.ctr"
+#line 1417 "dk-ls.ctr"
dk4error_init(&er);
if (0 != dk4md_ctx_init(&ctx, digest_type, digest_enco, &er)) {
-#line 1394 "dk-ls.ctr"
+#line 1420 "dk-ls.ctr"
fipo = dk4fopen_app(fn, dkT("rb"), DK4_FOPEN_SC_IS_REGULAR, app);
if (NULL != fipo) {
-#line 1396 "dk-ls.ctr"
+#line 1422 "dk-ls.ctr"
mdok = 1;
do {
if (0 != dk_ls_can_continue()) {
rdbytes = fread(buf, 1, sizeof(buf), fipo);
if (0 < rdbytes) {
-#line 1401 "dk-ls.ctr"
+#line 1427 "dk-ls.ctr"
dk4error_init(&er);
if (1 != dk4md_ctx_add(&ctx, buf, rdbytes, &er)) {
mdok = 0;
-#line 1404 "dk-ls.ctr"
+#line 1430 "dk-ls.ctr"
/* ERROR: Digest failed */
switch (er.ec) {
case DK4_E_NOT_SUPPORTED : {
@@ -1445,49 +1439,49 @@ dk_ls_write_md(
fclose(fipo);
if (1 == mdok) {
-#line 1422 "dk-ls.ctr"
+#line 1448 "dk-ls.ctr"
resptr = NULL; rdbytes = 0;
dk4error_init(&er);
if (1 == dk4md_ctx_finish(&resptr, &rdbytes, &ctx, &er)) {
-#line 1426 "dk-ls.ctr"
+#line 1452 "dk-ls.ctr"
if ((NULL != resptr) && (0 < rdbytes)) {
-#line 1427 "dk-ls.ctr"
+#line 1453 "dk-ls.ctr"
while(rdbytes--) {
if (0 == dk4fputc((dkChar)(*(resptr++)), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
-#line 1430 "dk-ls.ctr"
+#line 1456 "dk-ls.ctr"
}
}
} else {
-#line 1433 "dk-ls.ctr"
+#line 1459 "dk-ls.ctr"
mdok = 0;
/* ERROR: No digest obtained */
dk4app_log_1(app, dk_ls_msg, dk_ls_sz_msg, DK4_LL_ERROR, 29);
}
} else {
-#line 1438 "dk-ls.ctr"
+#line 1464 "dk-ls.ctr"
mdok = 0;
/* ERROR: Failed to obtain digest */
dk4app_log_1(app, dk_ls_msg, dk_ls_sz_msg, DK4_LL_ERROR, 29);
}
} else {
-#line 1443 "dk-ls.ctr"
+#line 1469 "dk-ls.ctr"
}
} else {
-#line 1445 "dk-ls.ctr"
+#line 1471 "dk-ls.ctr"
/* ERROR: Failed to open file, already reported */
}
} else {
-#line 1448 "dk-ls.ctr"
+#line 1474 "dk-ls.ctr"
/* ERROR: Failed to initialize digest ctx */
switch (er.ec) {
case DK4_E_NOT_SUPPORTED : {
@@ -1503,7 +1497,7 @@ dk_ls_write_md(
}
} else {
-#line 1462 "dk-ls.ctr"
+#line 1488 "dk-ls.ctr"
}
if (0 == mdok) {
rdbytes = dk4md_size(digest_type, digest_enco, NULL);
@@ -1537,7 +1531,7 @@ dk_ls_process_item_information(
dkChar buf[8*sizeof(dk4_um_t) + 16]; /* Numbers */
dk4_er_t er; /* Error report */
const dkChar *piptr; /* Print order */
- dk4_um_t fs; /* File size */
+ dk4_um_t fs = (dk4_um_t)0UL; /* File size */
size_t numl; /* Number length */
size_t slen; /* String length */
size_t tlen; /* First part length */
@@ -1550,11 +1544,11 @@ dk_ls_process_item_information(
dkChar lasti; /* Last information printed */
-#line 1507 "dk-ls.ctr"
+#line 1533 "dk-ls.ctr"
last_was_n = habuf = 0;
if ((NULL != fn) && (NULL != fiptr)) {
-#line 1509 "dk-ls.ctr"
+#line 1535 "dk-ls.ctr"
showi = 1;
res = dk4fileinfo_type_attributes(
buf, DK4_SIZEOF(buf,dkChar), fiptr, &er
@@ -1578,28 +1572,31 @@ dk_ls_process_item_information(
}
} else {
-#line 1531 "dk-ls.ctr"
+#line 1557 "dk-ls.ctr"
/* BUG: Failed to write file attributes to buffer */
dk4app_log_1(app, dk_ls_msg, dk_ls_sz_msg, DK4_LL_ERROR, 10);
exval = EXIT_FAILURE;
}
if (0 != showi) {
-#line 1536 "dk-ls.ctr"
+#line 1562 "dk-ls.ctr"
issl = dk4fileinfo_is_symlink(fiptr);
lasti = dkT('\0');
piptr = print_order;
while (dkT('\0') != *piptr) {
-#line 1540 "dk-ls.ctr"
+#line 1566 "dk-ls.ctr"
last_was_n = 0;
+
+#if DK4_CHAR_SIZE > 1
if ((int)(*piptr) <= 255) {
-#line 1542 "dk-ls.ctr"
+#line 1570 "dk-ls.ctr"
+#endif
switch ((char)(*piptr)) {
case 'n' : {
-#line 1544 "dk-ls.ctr"
+#line 1573 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1612,7 +1609,7 @@ dk_ls_process_item_information(
} break;
case 'N' : {
-#line 1555 "dk-ls.ctr"
+#line 1584 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1624,7 +1621,7 @@ dk_ls_process_item_information(
} break;
case 's' : {
-#line 1565 "dk-ls.ctr"
+#line 1594 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1671,7 +1668,7 @@ dk_ls_process_item_information(
/* ERROR: Failed to obtain size */
-#line 1610 "dk-ls.ctr"
+#line 1639 "dk-ls.ctr"
dk_ls_report_fileinfo_size_error(
app, fn,
(
@@ -1693,7 +1690,7 @@ dk_ls_process_item_information(
} break;
case 't' : {
-#line 1630 "dk-ls.ctr"
+#line 1659 "dk-ls.ctr"
dk4error_init(&er);
if (0 == habuf) {
habuf = dk4fileinfo_type_attributes(
@@ -1739,7 +1736,7 @@ dk_ls_process_item_information(
} break;
case 'l' : {
-#line 1674 "dk-ls.ctr"
+#line 1703 "dk-ls.ctr"
fs = (dk4_um_t)1UL;
if (0 != issl) {
if (0 != (DK4_FILE_INFO_CONTENTS_DATA_LINK & fiptr->contents))
@@ -1787,7 +1784,7 @@ dk_ls_process_item_information(
} break;
case 'c' : {
-#line 1720 "dk-ls.ctr"
+#line 1749 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1797,7 +1794,7 @@ dk_ls_process_item_information(
} break;
case 'm' : {
-#line 1728 "dk-ls.ctr"
+#line 1757 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1807,7 +1804,7 @@ dk_ls_process_item_information(
} break;
case 'a' : {
-#line 1736 "dk-ls.ctr"
+#line 1765 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1818,7 +1815,7 @@ dk_ls_process_item_information(
#if !DK4_ON_WINDOWS
case 'u' : {
-#line 1745 "dk-ls.ctr"
+#line 1774 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1854,7 +1851,7 @@ dk_ls_process_item_information(
#if !DK4_ON_WINDOWS
case 'g' : {
-#line 1779 "dk-ls.ctr"
+#line 1808 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1889,7 +1886,7 @@ dk_ls_process_item_information(
#endif
case 'd' : {
-#line 1812 "dk-ls.ctr"
+#line 1841 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1955,7 +1952,7 @@ dk_ls_process_item_information(
} break;
case 'r' : {
-#line 1876 "dk-ls.ctr"
+#line 1905 "dk-ls.ctr"
#if DK4_ON_WINDOWS
if (0 != issl) {
if (0 != (DK4_FILE_INFO_CONTENTS_DATA_LINK & fiptr->contents))
@@ -2016,7 +2013,7 @@ dk_ls_process_item_information(
} break;
case 'i' : {
-#line 1935 "dk-ls.ctr"
+#line 1964 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (dkT('d') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
@@ -2095,7 +2092,7 @@ dk_ls_process_item_information(
#if DK4_ON_WINDOWS
case 'w' : {
-#line 2012 "dk-ls.ctr"
+#line 2041 "dk-ls.ctr"
if (dkT('\0') != lasti) {
if (0 == dk4fputc(dkT(' '), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -2134,7 +2131,8 @@ dk_ls_process_item_information(
exval = EXIT_FAILURE;
} break;
}
- } else {
+#if DK4_CHAR_SIZE > 1
+ } else {
/* ERROR (once): Invalid text in -p argument */
if (0 == print_order_error_reported) {
dk4app_log_1(app, dk_ls_msg, dk_ls_sz_msg, DK4_LL_ERROR, 11);
@@ -2142,6 +2140,7 @@ dk_ls_process_item_information(
}
exval = EXIT_FAILURE;
}
+#endif
lasti = *(piptr++);
}
if (0 != last_was_n) {
@@ -2168,27 +2167,26 @@ dk_ls_process_item_information(
}
} else {
-#line 2083 "dk-ls.ctr"
+#line 2114 "dk-ls.ctr"
}
} else {
-#line 2085 "dk-ls.ctr"
+#line 2116 "dk-ls.ctr"
}
-#line 2087 "dk-ls.ctr"
+#line 2118 "dk-ls.ctr"
}
/** Process non-directory file.
@param fn File name.
- @param level Processing level (0=cmd line arg, 1=direct child,
2 and above=further indicrect siblings).
*/
static
void
-dk_ls_process_non_directory(const dkChar *fn, int level)
+dk_ls_process_non_directory(const dkChar *fn)
{
dk4_file_info_t fili;
@@ -2220,7 +2218,7 @@ dk_ls_process_item_for_node(
int ch = DK4_FILE_INFO_CONTENTS_DATA_TARGET;
-#line 2129 "dk-ls.ctr"
+#line 2159 "dk-ls.ctr"
if ((0 >= dirnode->level) || (0 != recursive) || (0 != size_wanted))
{
dk4error_init(&er);
@@ -2238,7 +2236,7 @@ dk_ls_process_item_for_node(
/* ERROR: Failed to retrieve size */
-#line 2145 "dk-ls.ctr"
+#line 2175 "dk-ls.ctr"
dk_ls_report_fileinfo_size_error(
app, filename, ch, dk_ls_msg, dk_ls_sz_msg
);
@@ -2258,7 +2256,7 @@ dk_ls_process_item_for_node(
}
-#line 2163 "dk-ls.ctr"
+#line 2193 "dk-ls.ctr"
}
@@ -2290,7 +2288,7 @@ dk_ls_process_directory(const dkChar *dn, int level)
int ufich; /* Channel to retrieve UFI */
-#line 2193 "dk-ls.ctr"
+#line 2223 "dk-ls.ctr"
/*
Allocate path name construction buffer.
*/
@@ -2308,10 +2306,10 @@ dk_ls_process_directory(const dkChar *dn, int level)
#endif
while (NULL != cn) {
-#line 2209 "dk-ls.ctr"
+#line 2239 "dk-ls.ctr"
if (0 != dk_ls_can_continue()) {
-#line 2210 "dk-ls.ctr"
+#line 2240 "dk-ls.ctr"
ndn = dk4dir_next_dir(cn->dirptr);
if (NULL != ndn) {
/*
@@ -2439,7 +2437,7 @@ dk_ls_process_directory(const dkChar *dn, int level)
ndn = dk4dir_next_file(cn->dirptr);
if (NULL != ndn) {
-#line 2336 "dk-ls.ctr"
+#line 2366 "dk-ls.ctr"
pa = dk4dir_get_path(cn->dirptr);
if (0 != dk_ls_construct_path(&mybu, &szmb, pa, ndn)) {
dk_ls_process_item_for_node(cn, mybu);
@@ -2453,7 +2451,7 @@ dk_ls_process_directory(const dkChar *dn, int level)
}
if (0 != dk_ls_can_continue()) {
-#line 2348 "dk-ls.ctr"
+#line 2378 "dk-ls.ctr"
if ((0 != size_wanted) || (0 != show_dirs)) {
if ((1 >= cn->level) || (0 != recursive)) {
dk_ls_process_item_information(
@@ -2467,7 +2465,7 @@ dk_ls_process_directory(const dkChar *dn, int level)
if (NULL != on) {
on->child = NULL;
dk4error_init(&er);
- on->size = dk4ma_size_t_add(on->size, cn->size, &er);
+ on->size = dk4ma_um_add(on->size, cn->size, &er);
if (DK4_E_NONE != er.ec) {
on->ovsize = 1;
}
@@ -2484,7 +2482,7 @@ dk_ls_process_directory(const dkChar *dn, int level)
*/
-#line 2377 "dk-ls.ctr"
+#line 2407 "dk-ls.ctr"
on = cn->parent;
if (NULL != on) { on->child = NULL; }
dk_ls_delete_node(cn);
@@ -2493,7 +2491,7 @@ dk_ls_process_directory(const dkChar *dn, int level)
}
} else {
-#line 2384 "dk-ls.ctr"
+#line 2414 "dk-ls.ctr"
/* ERROR: Allocation failed, already reported */
exval = EXIT_FAILURE;
}
@@ -2505,7 +2503,7 @@ dk_ls_process_directory(const dkChar *dn, int level)
}
-#line 2394 "dk-ls.ctr"
+#line 2424 "dk-ls.ctr"
}
@@ -2535,7 +2533,7 @@ dk_ls_is_directory(const dkChar *fn)
int back = -1;
-#line 2422 "dk-ls.ctr"
+#line 2452 "dk-ls.ctr"
if (NULL != fn) {
#if DK4_ON_WINDOWS
#if DK4_CHAR_SIZE > 1
@@ -2585,7 +2583,7 @@ dk_ls_is_directory(const dkChar *fn)
#endif
}
-#line 2470 "dk-ls.ctr"
+#line 2500 "dk-ls.ctr"
return back;
}
@@ -2605,30 +2603,30 @@ run_for_one_name(const dkChar *arg)
{
-#line 2488 "dk-ls.ctr"
+#line 2518 "dk-ls.ctr"
switch (dk_ls_is_directory(arg)) {
case 1 : {
-#line 2490 "dk-ls.ctr"
+#line 2520 "dk-ls.ctr"
dk_ls_process_directory(arg, 0);
} break;
case 0 : {
-#line 2493 "dk-ls.ctr"
+#line 2523 "dk-ls.ctr"
if (0 != show_files) {
- dk_ls_process_non_directory(arg, 0);
+ dk_ls_process_non_directory(arg);
}
} break;
default : {
-#line 2498 "dk-ls.ctr"
+#line 2528 "dk-ls.ctr"
/* ERROR: Failed to obtain information about file, already reported */
exval = EXIT_FAILURE;
} break;
}
-#line 2503 "dk-ls.ctr"
+#line 2533 "dk-ls.ctr"
}
@@ -2652,16 +2650,16 @@ run_for_command_line_arguments(int xargc)
int cc = 1;
-#line 2525 "dk-ls.ctr"
+#line 2555 "dk-ls.ctr"
for (i = 0; ((i < xargc) && (1 == cc)); i++) {
-#line 2526 "dk-ls.ctr"
+#line 2556 "dk-ls.ctr"
if (0 != dk_ls_can_continue()) {
-#line 2527 "dk-ls.ctr"
+#line 2557 "dk-ls.ctr"
xargv = dk4app_get_argv(app, i);
-#line 2528 "dk-ls.ctr"
+#line 2558 "dk-ls.ctr"
#if DK4_ON_WINDOWS
if (0 != dk4path_must_expand(xargv)) {
/* !!!!!
@@ -2721,7 +2719,7 @@ run_for_command_line_arguments(int xargc)
if (0!=dk4str_cat_s(buf,DK4_SIZEOF(buf,dkChar),dk_ls_kwnl[5],NULL))
{
if (0 != dk4str_cat_s(buf,DK4_SIZEOF(buf,dkChar),fn,NULL)) {
- dk_ls_process_non_directory(buf, 0);
+ dk_ls_process_non_directory(buf);
} else {
/* ERROR: File name too long! */
dk4app_log_5(
@@ -2759,7 +2757,7 @@ run_for_command_line_arguments(int xargc)
#endif
-#line 2624 "dk-ls.ctr"
+#line 2654 "dk-ls.ctr"
run_for_one_name(xargv);
#if DK4_ON_WINDOWS
}
@@ -2770,7 +2768,7 @@ run_for_command_line_arguments(int xargc)
}
-#line 2633 "dk-ls.ctr"
+#line 2663 "dk-ls.ctr"
}
@@ -2793,7 +2791,7 @@ run_for_current_dir_contents(void)
int om;
-#line 2654 "dk-ls.ctr"
+#line 2684 "dk-ls.ctr"
dk4error_init(&er);
om = DK4_DIR_OPEN_SORTED | DK4_DIR_SYMLINK_DIR_AS_FILE;
dirptr = dk4dir_open_app(dk_ls_kwnl[4], om, app);
@@ -2807,7 +2805,7 @@ run_for_current_dir_contents(void)
if ((0 != recursive) || (0 != size_wanted)) {
dk_ls_process_directory(fn, 1);
} else {
- dk_ls_process_non_directory(fn, 1);
+ dk_ls_process_non_directory(fn);
}
} else {
cc = 0;
@@ -2823,7 +2821,7 @@ run_for_current_dir_contents(void)
if (0 != dk_ls_can_continue()) {
fn = dk4dir_next_file(dirptr);
if (NULL != fn) {
- dk_ls_process_non_directory(fn, 1);
+ dk_ls_process_non_directory(fn);
} else {
cc = 0;
}
@@ -2839,7 +2837,7 @@ run_for_current_dir_contents(void)
}
-#line 2698 "dk-ls.ctr"
+#line 2728 "dk-ls.ctr"
}
@@ -2857,7 +2855,7 @@ dk_ls_normal_run(void)
int mdset;
-#line 2714 "dk-ls.ctr"
+#line 2744 "dk-ls.ctr"
exval = EXIT_SUCCESS;
/* Process options.
@@ -2946,11 +2944,11 @@ dk_ls_normal_run(void)
xargc = dk4app_get_argc(app);
if (0 < xargc) {
-#line 2801 "dk-ls.ctr"
+#line 2831 "dk-ls.ctr"
run_for_command_line_arguments(xargc);
} else {
-#line 2803 "dk-ls.ctr"
+#line 2833 "dk-ls.ctr"
run_for_current_dir_contents();
}
if (0 != show_summary) {
@@ -2984,7 +2982,7 @@ dk_ls_normal_run(void)
}
-#line 2835 "dk-ls.ctr"
+#line 2865 "dk-ls.ctr"
}
@@ -3190,10 +3188,10 @@ int main(int argc, char *argv[])
{
-#line 3039 "dk-ls.ctr"
+#line 3069 "dk-ls.ctr"
-#line 3040 "dk-ls.ctr"
+#line 3070 "dk-ls.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
dk4error_init(&er_dirs);
@@ -3206,24 +3204,24 @@ int main(int argc, char *argv[])
);
if (NULL != app) {
-#line 3051 "dk-ls.ctr"
+#line 3081 "dk-ls.ctr"
dk_ls_sz_msg = dk4app_string_table_size(dk_ls_kw_def);
dk_ls_msg = dk4app_string_table(app, dk_ls_kwnl[2], dk_ls_kw_def);
if (0 != dk4app_can_run_normally(app)) {
-#line 3054 "dk-ls.ctr"
+#line 3084 "dk-ls.ctr"
dk_ls_run_with_signal_handlers();
} else {
if (0 != dk4app_help_version_license(app)) {
-#line 3057 "dk-ls.ctr"
+#line 3087 "dk-ls.ctr"
exval = EXIT_SUCCESS;
}
}
dk4app_close(app);
} else {
-#line 3062 "dk-ls.ctr"
+#line 3092 "dk-ls.ctr"
dk4fputs(dk_ls_kwnl[11], stdout, NULL);
fflush(stdout);
}
@@ -3233,10 +3231,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 3070 "dk-ls.ctr"
+#line 3100 "dk-ls.ctr"
-#line 3071 "dk-ls.ctr"
+#line 3101 "dk-ls.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-ls.ctr b/support/dktools/dk-ls.ctr
index 57786e6fa9..ffcdfa1db4 100644
--- a/support/dktools/dk-ls.ctr
+++ b/support/dktools/dk-ls.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,18 @@ license = bsd
/** @file dk-ls.h Header file for dk-ls program.
*/
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4MD_H_INCLUDED
#include "dk4md.h"
+#endif
+
+#ifndef DK4FILEIT_H_INCLUDED
#include "dk4fileit.h"
+#endif
+
#ifdef __cplusplus
@@ -161,7 +171,11 @@ dk_ls_report_fileinfo_timestamp_error(
#include "dk4pathd.h"
#include "dk4fopda.h"
#include "dk4symlink.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -194,7 +208,7 @@ File type characters: d=directories, f=non-directory entries.
Message digest types: md5, sha-1, sha-224, sha-256, sha-384, sha-512,
ripemd-160. Optionally add encoding hex or a85, i.e. ``sha-1.hex''.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-ls/
$!end
};
@@ -209,7 +223,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -247,27 +262,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -887,8 +902,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -898,8 +914,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -908,8 +925,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -933,10 +951,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -1305,14 +1331,14 @@ dk_ls_write_timestamp(
/** Write indicator for unkown data.
- @param width Field width.
- @param compl Fill complete field.
+ @param width Field width.
+ @param complete Fill complete field.
*/
static
void
-dk_ls_write_unknown(size_t width, int compl)
+dk_ls_write_unknown(size_t width, int complete)
{
- if (0 != compl) {
+ if (0 != complete) {
while (0 < width--) {
if (0 == dk4fputc(dkT('?'), stdout, NULL)) {
write_error = 1; exval = EXIT_FAILURE;
@@ -1334,7 +1360,7 @@ dk_ls_write_unknown(size_t width, int compl)
static
int
-dk_ls_can_create_md(const dkChar *fn, dk4_file_info_t *fiptr)
+dk_ls_can_create_md(dk4_file_info_t *fiptr)
{
int back = 0;
if (0 == dk4fileinfo_is_symlink(fiptr)) {
@@ -1387,7 +1413,7 @@ dk_ls_write_md(
const char *resptr; /* Pointer to encoded digest buffer */
size_t rdbytes; /* Number of bytes read */
int mdok = 0; /* Flag: Digesting ok so far */
- if (0 != dk_ls_can_create_md(fn, fiptr)) { $? ". can create md"
+ if (0 != dk_ls_can_create_md(fiptr)) { $? ". can create md"
dk4error_init(&er);
if (0 != dk4md_ctx_init(&ctx, digest_type, digest_enco, &er)) {
$? ". ctx initialized"
@@ -1492,7 +1518,7 @@ dk_ls_process_item_information(
dkChar buf[8*sizeof(dk4_um_t) + 16]; /* Numbers */
dk4_er_t er; /* Error report */
const dkChar *piptr; /* Print order */
- dk4_um_t fs; /* File size */
+ dk4_um_t fs = (dk4_um_t)0UL; /* File size */
size_t numl; /* Number length */
size_t slen; /* String length */
size_t tlen; /* First part length */
@@ -1538,7 +1564,10 @@ dk_ls_process_item_information(
piptr = print_order;
while (dkT('\0') != *piptr) { $? ". piptr %!dc", *piptr
last_was_n = 0;
+
+#if DK4_CHAR_SIZE > 1
if ((int)(*piptr) <= 255) { $? ". ok"
+#endif
switch ((char)(*piptr)) {
case 'n' : { $? ". name"
if (dkT('\0') != lasti) {
@@ -2047,7 +2076,8 @@ dk_ls_process_item_information(
exval = EXIT_FAILURE;
} break;
}
- } else {
+#if DK4_CHAR_SIZE > 1
+ } else {
/* ERROR (once): Invalid text in -p argument */
if (0 == print_order_error_reported) {
dk4app_log_1(app, dk_ls_msg, dk_ls_sz_msg, DK4_LL_ERROR, 11);
@@ -2055,6 +2085,7 @@ dk_ls_process_item_information(
}
exval = EXIT_FAILURE;
}
+#endif
lasti = *(piptr++);
}
if (0 != last_was_n) {
@@ -2090,12 +2121,11 @@ dk_ls_process_item_information(
/** Process non-directory file.
@param fn File name.
- @param level Processing level (0=cmd line arg, 1=direct child,
2 and above=further indicrect siblings).
*/
static
void
-dk_ls_process_non_directory(const dkChar *fn, int level)
+dk_ls_process_non_directory(const dkChar *fn)
{
dk4_file_info_t fili;
@@ -2358,7 +2388,7 @@ dk_ls_process_directory(const dkChar *dn, int level)
if (NULL != on) {
on->child = NULL;
dk4error_init(&er);
- on->size = dk4ma_size_t_add(on->size, cn->size, &er);
+ on->size = dk4ma_um_add(on->size, cn->size, &er);
if (DK4_E_NONE != er.ec) {
on->ovsize = 1;
}
@@ -2491,7 +2521,7 @@ run_for_one_name(const dkChar *arg)
} break;
case 0 : { $? ". not a directory"
if (0 != show_files) {
- dk_ls_process_non_directory(arg, 0);
+ dk_ls_process_non_directory(arg);
}
} break;
default : { $? "! no information"
@@ -2584,7 +2614,7 @@ run_for_command_line_arguments(int xargc)
if (0!=dk4str_cat_s(buf,DK4_SIZEOF(buf,dkChar),dk_ls_kwnl[5],NULL))
{
if (0 != dk4str_cat_s(buf,DK4_SIZEOF(buf,dkChar),fn,NULL)) {
- dk_ls_process_non_directory(buf, 0);
+ dk_ls_process_non_directory(buf);
} else {
/* ERROR: File name too long! */
dk4app_log_5(
@@ -2664,7 +2694,7 @@ run_for_current_dir_contents(void)
if ((0 != recursive) || (0 != size_wanted)) {
dk_ls_process_directory(fn, 1);
} else {
- dk_ls_process_non_directory(fn, 1);
+ dk_ls_process_non_directory(fn);
}
} else {
cc = 0;
@@ -2680,7 +2710,7 @@ run_for_current_dir_contents(void)
if (0 != dk_ls_can_continue()) {
fn = dk4dir_next_file(dirptr);
if (NULL != fn) {
- dk_ls_process_non_directory(fn, 1);
+ dk_ls_process_non_directory(fn);
} else {
cc = 0;
}
diff --git a/support/dktools/dk-ls.h b/support/dktools/dk-ls.h
index 36e2509625..fe98deccf5 100644
--- a/support/dktools/dk-ls.h
+++ b/support/dktools/dk-ls.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-ls.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-ls.ctr
*/
#ifndef DK_LS_H_INCLUDED
@@ -43,8 +21,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk-ls.h Header file for dk-ls program.
*/
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4MD_H_INCLUDED
#include "dk4md.h"
+#endif
+
+#ifndef DK4FILEIT_H_INCLUDED
#include "dk4fileit.h"
+#endif
+
#ifdef __cplusplus
diff --git a/support/dktools/dk-ls.rc b/support/dktools/dk-ls.rc
index 8d6e4497c5..4deffed578 100644
--- a/support/dktools/dk-ls.rc
+++ b/support/dktools/dk-ls.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "An ls clone, configurable output column order\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "An ls clone, configurable output column order\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-ls\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-pwd.c b/support/dktools/dk-pwd.c
index a98df244f7..f76403d172 100644
--- a/support/dktools/dk-pwd.c
+++ b/support/dktools/dk-pwd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-pwd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-pwd.ctr
*/
/** @file dk-pwd.c The dk-pwd module.
@@ -52,11 +30,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mem.h"
#include "dk4fput.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 27 "dk-pwd.ctr"
+#line 30 "dk-pwd.ctr"
/** Default help text, used if help text file is not found.
@@ -80,7 +61,7 @@ dkT(""),
NULL
-#line 49 "dk-pwd.ctr"
+#line 52 "dk-pwd.ctr"
};
@@ -92,7 +73,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -119,27 +101,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -213,7 +195,7 @@ dkT(""),
NULL
-#line 180 "dk-pwd.ctr"
+#line 184 "dk-pwd.ctr"
};
@@ -239,7 +221,7 @@ dkT("dk-pwd.str"),
NULL
-#line 207 "dk-pwd.ctr"
+#line 211 "dk-pwd.ctr"
};
@@ -253,7 +235,7 @@ dkT("Failed to find current directory!"),
NULL
-#line 220 "dk-pwd.ctr"
+#line 224 "dk-pwd.ctr"
};
diff --git a/support/dktools/dk-pwd.ctr b/support/dktools/dk-pwd.ctr
index 3c74fb1cd3..5910dd1af5 100644
--- a/support/dktools/dk-pwd.ctr
+++ b/support/dktools/dk-pwd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -21,6 +21,9 @@ license = bsd
#include "dk4mem.h"
#include "dk4fput.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -58,7 +61,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -85,27 +89,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
diff --git a/support/dktools/dk-pwd.rc b/support/dktools/dk-pwd.rc
new file mode 100644
index 0000000000..ddca423d97
--- /dev/null
+++ b/support/dktools/dk-pwd.rc
@@ -0,0 +1,37 @@
+aaaaa ICON dkicon.ico
+
+#include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Show current working directory\0"
+ VALUE "CompanyName", "Dirk Krause\0"
+ VALUE "FileDescription", "Show current working directory\0"
+ VALUE "FileVersion", "4.30.2\0"
+ VALUE "InternalName", "dk-pwd\0"
+ VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
+ VALUE "ProductName", "Dirk Krause's tools\0"
+ VALUE "ProductVersion", "4.30.2\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
diff --git a/support/dktools/dk-pwg-rnd.c b/support/dktools/dk-pwg-rnd.c
index d60117937b..802693a665 100644
--- a/support/dktools/dk-pwg-rnd.c
+++ b/support/dktools/dk-pwg-rnd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-pwg-rnd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-pwg-rnd.ctr
*/
/** @file dk-pwg-rnd.c The dk-pwg-rnd module.
diff --git a/support/dktools/dk-pwg-rnd.ctr b/support/dktools/dk-pwg-rnd.ctr
index 114b9042e1..2447a0d949 100644
--- a/support/dktools/dk-pwg-rnd.ctr
+++ b/support/dktools/dk-pwg-rnd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk-pwg-rnd.h b/support/dktools/dk-pwg-rnd.h
index 4140297103..a0e016a150 100644
--- a/support/dktools/dk-pwg-rnd.h
+++ b/support/dktools/dk-pwg-rnd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-pwg-rnd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-pwg-rnd.ctr
*/
#ifndef DK_PWG_RND_H_INCLUDED
diff --git a/support/dktools/dk-pwgen.c b/support/dktools/dk-pwgen.c
index b5ef2d4f14..83b025d2c9 100644
--- a/support/dktools/dk-pwgen.c
+++ b/support/dktools/dk-pwgen.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-pwgen.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-pwgen.ctr
*/
/** @file dk-pwgen.c The dk-pwgen module.
@@ -121,12 +99,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maasz.h"
#include "dk4mpl.h"
#include "dk4svbufa.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 97 "dk-pwgen.ctr"
+#line 101 "dk-pwgen.ctr"
@@ -194,7 +176,7 @@ dkT("verbose"),
NULL
-#line 167 "dk-pwgen.ctr"
+#line 171 "dk-pwgen.ctr"
};
@@ -224,12 +206,12 @@ dkT("\t\t--manual\t\t*** SHOW FULL MANUAL. ***"),
dkT("\t\t--version\t\tShow version information."),
dkT("\t\t--license\t\tShow license information."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-pwgen/"),
dkT(""),
NULL
-#line 200 "dk-pwgen.ctr"
+#line 204 "dk-pwgen.ctr"
};
@@ -239,7 +221,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -277,27 +260,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -500,7 +483,7 @@ dkT(""),
NULL
-#line 469 "dk-pwgen.ctr"
+#line 474 "dk-pwgen.ctr"
};
@@ -605,7 +588,7 @@ dkT("The -b option is not supported on Windows!"),
NULL
-#line 586 "dk-pwgen.ctr"
+#line 591 "dk-pwgen.ctr"
};
@@ -643,7 +626,9 @@ static char stdout_buffer[BUFSIZ];
/** Use an explicitly specified buffer when reading seed file
so we can securely reset the memory before exiting.
*/
+#if (!(DK4_ON_WINDOWS))
static char seed_file_buf[BUFSIZ];
+#endif
@@ -817,8 +802,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -828,8 +814,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -838,8 +825,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -863,10 +851,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -907,7 +903,7 @@ dk_pwgen_opt_range(size_t *minptr, size_t *maxptr, dkChar option)
dkChar buf[32*sizeof(dk4_um_t)];
dk4_er_t er;
const dkChar *endptr;
- dkChar *p1;
+ dkChar *p1 = NULL;
size_t val;
int res;
int rdf = 0;
@@ -915,7 +911,8 @@ dk_pwgen_opt_range(size_t *minptr, size_t *maxptr, dkChar option)
int passno = 0;
-#line 894 "dk-pwgen.ctr"
+#line 912 "dk-pwgen.ctr"
+ dk4error_init(&er);
if (0 != dk4app_opt_is_set_long(app, dk_pwgen_kwnl[8], NULL)) {
verbose = 1;
}
@@ -925,27 +922,26 @@ dk_pwgen_opt_range(size_t *minptr, size_t *maxptr, dkChar option)
);
if (0 != res) {
-#line 902 "dk-pwgen.ctr"
+#line 921 "dk-pwgen.ctr"
p1 = dk4str_chr(buf, dkT('-'));
if (NULL != p1) {
-#line 904 "dk-pwgen.ctr"
+#line 923 "dk-pwgen.ctr"
*(p1++) = dkT('\0');
p1 = dk4str_start(p1, NULL);
} else {
-#line 907 "dk-pwgen.ctr"
+#line 926 "dk-pwgen.ctr"
}
val = 0;
endptr = NULL;
- dk4error_init(&er);
if (0 != dk4ma_input_dk_dec_size_t(&val, buf, &endptr, 1, &er)) {
*minptr = val;
*maxptr = val;
back = 1;
if (NULL != p1) {
-#line 916 "dk-pwgen.ctr"
+#line 934 "dk-pwgen.ctr"
passno = 1;
back = 0;
val = 0;
@@ -960,38 +956,38 @@ dk_pwgen_opt_range(size_t *minptr, size_t *maxptr, dkChar option)
}
} else {
-#line 929 "dk-pwgen.ctr"
+#line 947 "dk-pwgen.ctr"
/* ERROR: Failed to read size */
rdf = 1;
}
}
} else {
-#line 934 "dk-pwgen.ctr"
+#line 952 "dk-pwgen.ctr"
/* ERROR: Failed to read size */
rdf = 1;
}
} else {
-#line 938 "dk-pwgen.ctr"
+#line 956 "dk-pwgen.ctr"
/* ERROR: Failed to obtain option argument, probably bug */
}
} else {
-#line 941 "dk-pwgen.ctr"
+#line 959 "dk-pwgen.ctr"
back = 1;
}
if ((0 == back) && (0 != rdf)) {
switch (er.ec) {
case DK4_E_MATH_OVERFLOW : {
-#line 946 "dk-pwgen.ctr"
+#line 964 "dk-pwgen.ctr"
/* ERROR: Numeric overflow while reading number */
dk4app_log_1(app, dk_pwgen_msg, dk_pwgen_sz_msg, DK4_LL_ERROR, 3);
} break;
case DK4_E_SYNTAX : {
-#line 950 "dk-pwgen.ctr"
+#line 968 "dk-pwgen.ctr"
/* ERROR: Not a size specification */
dk4app_log_3(
app, dk_pwgen_msg, dk_pwgen_sz_msg, DK4_LL_ERROR, 4, 5,
@@ -1000,7 +996,7 @@ dk_pwgen_opt_range(size_t *minptr, size_t *maxptr, dkChar option)
} break;
default: {
-#line 957 "dk-pwgen.ctr"
+#line 975 "dk-pwgen.ctr"
/* ERROR: Failed to read size */
dk4app_log_3(
app, dk_pwgen_msg, dk_pwgen_sz_msg, DK4_LL_ERROR, 6, 7,
@@ -1010,7 +1006,7 @@ dk_pwgen_opt_range(size_t *minptr, size_t *maxptr, dkChar option)
}
}
-#line 965 "dk-pwgen.ctr"
+#line 983 "dk-pwgen.ctr"
return back;
}
@@ -1028,7 +1024,7 @@ dk_pwgen_check_options(void)
int back = 0;
-#line 981 "dk-pwgen.ctr"
+#line 999 "dk-pwgen.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('b'), NULL)) {
output_type = DK_PWGEN_MODE_BINARY;
@@ -1161,7 +1157,7 @@ dk_pwgen_check_options(void)
finished:
-#line 1112 "dk-pwgen.ctr"
+#line 1130 "dk-pwgen.ctr"
return back;
}
@@ -1175,10 +1171,14 @@ int
dk_pwgen_seed_prng(void)
{
#if DK4_CHAR_SIZE == 1
+#if DK4_HAVE_RAND_EGD && DK4_HAVE_STRUCT_SOCKADDR_UN
dkChar snb[DK4_MAX_PATH];
#endif
+#endif
char buffer[64];
+#if DK4_HAVE_RAND_EGD && DK4_HAVE_STRUCT_SOCKADDR_UN
char *envptr;
+#endif
#if DK4_ON_WINDOWS
HCRYPTPROV hcp;
BOOL res;
@@ -1189,10 +1189,12 @@ dk_pwgen_seed_prng(void)
int cc;
int rounds = 0;
int back = 0;
+#if (!(DK4_ON_WINDOWS))
int svbres = 0;
+#endif
-#line 1141 "dk-pwgen.ctr"
+#line 1165 "dk-pwgen.ctr"
/* Let OpenSSL library functions try to initialize.
*/
@@ -1243,7 +1245,7 @@ dk_pwgen_seed_prng(void)
cc = 1;
do {
if (0 != dk_pwgen_can_continue()) {
- res = CryptGenRandom(hcp, (DWORD)sizeof(buffer), buffer);
+ res = CryptGenRandom(hcp, (DWORD)sizeof(buffer), (BYTE *)buffer);
if (res) {
RAND_seed(buffer, sizeof(buffer));
if (1 == RAND_status()) {
@@ -1322,7 +1324,7 @@ dk_pwgen_seed_prng(void)
finished:
-#line 1269 "dk-pwgen.ctr"
+#line 1293 "dk-pwgen.ctr"
return back;
}
@@ -1343,14 +1345,14 @@ dk_pwgen_value_in_range(size_t *dptr, size_t min, size_t max)
int back = 0;
-#line 1288 "dk-pwgen.ctr"
+#line 1312 "dk-pwgen.ctr"
if (max > min) {
width = max - min;
if (0 != (width + 1)) { width++ ; }
if (0 < RAND_bytes((unsigned char *)(&rval), (int)sizeof(rval))) {
-#line 1293 "dk-pwgen.ctr"
+#line 1317 "dk-pwgen.ctr"
*dptr = min + (rval % width);
back = 1;
} else {
@@ -1363,7 +1365,7 @@ dk_pwgen_value_in_range(size_t *dptr, size_t min, size_t max)
}
-#line 1304 "dk-pwgen.ctr"
+#line 1328 "dk-pwgen.ctr"
return back;
}
@@ -1384,7 +1386,7 @@ dk_pwgen_output_hex(int upper)
dkChar dc; /* Current character to write */
-#line 1323 "dk-pwgen.ctr"
+#line 1347 "dk-pwgen.ctr"
cc = 1;
i = 0;
bi = 0;
@@ -1434,7 +1436,7 @@ dk_pwgen_output_hex(int upper)
}
-#line 1371 "dk-pwgen.ctr"
+#line 1395 "dk-pwgen.ctr"
}
@@ -1613,7 +1615,7 @@ dk_pwgen_output_normal(void)
ti = dk4mem_new_app(char,length,app);
if (NULL != ti) {
-#line 1548 "dk-pwgen.ctr"
+#line 1572 "dk-pwgen.ctr"
DK4_MEMRES(ti, length);
cc = 1;
if (0 == dk_pwgen_value_in_range(&upper, upper_min, upper_max)) {
@@ -1630,7 +1632,7 @@ dk_pwgen_output_normal(void)
avail = length;
while (3 > passno) {
-#line 1563 "dk-pwgen.ctr"
+#line 1587 "dk-pwgen.ctr"
switch (passno) {
case 2 : {
max = specials;
@@ -1649,7 +1651,7 @@ dk_pwgen_output_normal(void)
while (curel < max) {
-#line 1580 "dk-pwgen.ctr"
+#line 1604 "dk-pwgen.ctr"
if (0 != dk_pwgen_can_continue()) {
res = RAND_bytes(
(unsigned char *)(&ind_to_set), (int)sizeof(size_t)
@@ -1659,18 +1661,18 @@ dk_pwgen_output_normal(void)
ind_to_set = ind_to_set % avail;
-#line 1588 "dk-pwgen.ctr"
+#line 1612 "dk-pwgen.ctr"
res = 0;
i = 0;
while (i < length) {
-#line 1592 "dk-pwgen.ctr"
+#line 1616 "dk-pwgen.ctr"
if ('\0' == ti[i]) {
if (0 == ind_to_set) {
-#line 1595 "dk-pwgen.ctr"
+#line 1619 "dk-pwgen.ctr"
res = 1;
ti[i] = ic;
i = length - 1;
@@ -1680,14 +1682,14 @@ dk_pwgen_output_normal(void)
}
} else {
-#line 1603 "dk-pwgen.ctr"
+#line 1627 "dk-pwgen.ctr"
}
i++;
}
curel++;
if (0 == res) {
-#line 1608 "dk-pwgen.ctr"
+#line 1632 "dk-pwgen.ctr"
/* No free cell found */
curel = max; passno = 3; cc = 0;
dk4app_log_1(
@@ -1715,16 +1717,16 @@ dk_pwgen_output_normal(void)
}
if ((1 == cc) && (0 != dk_pwgen_can_continue())) {
-#line 1634 "dk-pwgen.ctr"
+#line 1658 "dk-pwgen.ctr"
i = 0;
speclen = dk4str_len(dk_pwgen_kwnl[6]);
-#line 1637 "dk-pwgen.ctr"
+#line 1661 "dk-pwgen.ctr"
while (i < length) {
-#line 1639 "dk-pwgen.ctr"
+#line 1663 "dk-pwgen.ctr"
if (0 != dk_pwgen_can_continue()) {
res = RAND_bytes(
(unsigned char *)(&val), (int)sizeof(dk4_um_t)
@@ -1732,13 +1734,13 @@ dk_pwgen_output_normal(void)
if (0 < res) {
-#line 1645 "dk-pwgen.ctr"
+#line 1669 "dk-pwgen.ctr"
switch (ti[i]) {
case 's': {
val = val % (dk4_um_t)speclen;
-#line 1649 "dk-pwgen.ctr"
+#line 1673 "dk-pwgen.ctr"
dc = (dk_pwgen_kwnl[6])[(size_t)val];
} break;
case 'd': {
@@ -1787,7 +1789,7 @@ dk_pwgen_output_normal(void)
}
} else {
-#line 1696 "dk-pwgen.ctr"
+#line 1720 "dk-pwgen.ctr"
exval = EXIT_FAILURE;
/* ERROR: Memory, already reported */
}
@@ -1803,38 +1805,38 @@ dk_pwgen_produce_output(void)
{
-#line 1710 "dk-pwgen.ctr"
+#line 1734 "dk-pwgen.ctr"
if (0 != dk_pwgen_value_in_range(&length, length_min, length_max)) {
exval = EXIT_SUCCESS;
switch (output_type) {
case DK_PWGEN_MODE_BINARY : {
-#line 1714 "dk-pwgen.ctr"
+#line 1738 "dk-pwgen.ctr"
dk_pwgen_output_binary();
} break;
case DK_PWGEN_MODE_HARD : {
-#line 1717 "dk-pwgen.ctr"
+#line 1741 "dk-pwgen.ctr"
dk_pwgen_output_hard();
} break;
case DK_PWGEN_MODE_HEX_LOWER : {
-#line 1720 "dk-pwgen.ctr"
+#line 1744 "dk-pwgen.ctr"
dk_pwgen_output_hex(0);
} break;
case DK_PWGEN_MODE_HEX_UPPER : {
-#line 1723 "dk-pwgen.ctr"
+#line 1747 "dk-pwgen.ctr"
dk_pwgen_output_hex(1);
} break;
case DK_PWGEN_MODE_PIN : {
-#line 1726 "dk-pwgen.ctr"
+#line 1750 "dk-pwgen.ctr"
dk_pwgen_output_pin();
} break;
default : {
-#line 1729 "dk-pwgen.ctr"
+#line 1753 "dk-pwgen.ctr"
dk_pwgen_output_normal();
} break;
}
@@ -1848,7 +1850,7 @@ dk_pwgen_produce_output(void)
}
-#line 1741 "dk-pwgen.ctr"
+#line 1765 "dk-pwgen.ctr"
}
@@ -1861,7 +1863,7 @@ dk_pwgen_normal_run(void)
{
-#line 1752 "dk-pwgen.ctr"
+#line 1776 "dk-pwgen.ctr"
if (0 < dk_pwgen_check_options()) {
if (0 < dk_pwgen_seed_prng()) {
dk_pwgen_produce_output();
@@ -1873,7 +1875,7 @@ dk_pwgen_normal_run(void)
}
-#line 1762 "dk-pwgen.ctr"
+#line 1786 "dk-pwgen.ctr"
}
@@ -2088,10 +2090,10 @@ int main(int argc, char *argv[])
);
-#line 1975 "dk-pwgen.ctr"
+#line 1999 "dk-pwgen.ctr"
-#line 1976 "dk-pwgen.ctr"
+#line 2000 "dk-pwgen.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
@@ -2170,10 +2172,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 2053 "dk-pwgen.ctr"
+#line 2077 "dk-pwgen.ctr"
-#line 2054 "dk-pwgen.ctr"
+#line 2078 "dk-pwgen.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-pwgen.ctr b/support/dktools/dk-pwgen.ctr
index c9e1e0dc7a..a57fcd7b33 100644
--- a/support/dktools/dk-pwgen.ctr
+++ b/support/dktools/dk-pwgen.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -90,7 +90,11 @@ license = bsd
#include "dk4maasz.h"
#include "dk4mpl.h"
#include "dk4svbufa.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -194,7 +198,7 @@ Options:
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-pwgen/
$!end
};
@@ -207,7 +211,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -245,27 +250,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -620,7 +625,9 @@ static char stdout_buffer[BUFSIZ];
/** Use an explicitly specified buffer when reading seed file
so we can securely reset the memory before exiting.
*/
+#if (!(DK4_ON_WINDOWS))
static char seed_file_buf[BUFSIZ];
+#endif
@@ -794,8 +801,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -805,8 +813,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -815,8 +824,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -840,10 +850,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -884,13 +902,14 @@ dk_pwgen_opt_range(size_t *minptr, size_t *maxptr, dkChar option)
dkChar buf[32*sizeof(dk4_um_t)];
dk4_er_t er;
const dkChar *endptr;
- dkChar *p1;
+ dkChar *p1 = NULL;
size_t val;
int res;
int rdf = 0;
int back = 0;
int passno = 0;
$? "+ dk_pwgen_opt_range"
+ dk4error_init(&er);
if (0 != dk4app_opt_is_set_long(app, dk_pwgen_kwnl[8], NULL)) {
verbose = 1;
}
@@ -907,7 +926,6 @@ dk_pwgen_opt_range(size_t *minptr, size_t *maxptr, dkChar option)
}
val = 0;
endptr = NULL;
- dk4error_init(&er);
if (0 != dk4ma_input_dk_dec_size_t(&val, buf, &endptr, 1, &er)) {
*minptr = val;
*maxptr = val;
@@ -1122,10 +1140,14 @@ int
dk_pwgen_seed_prng(void)
{
#if DK4_CHAR_SIZE == 1
+#if DK4_HAVE_RAND_EGD && DK4_HAVE_STRUCT_SOCKADDR_UN
dkChar snb[DK4_MAX_PATH];
#endif
+#endif
char buffer[64];
+#if DK4_HAVE_RAND_EGD && DK4_HAVE_STRUCT_SOCKADDR_UN
char *envptr;
+#endif
#if DK4_ON_WINDOWS
HCRYPTPROV hcp;
BOOL res;
@@ -1136,7 +1158,9 @@ dk_pwgen_seed_prng(void)
int cc;
int rounds = 0;
int back = 0;
+#if (!(DK4_ON_WINDOWS))
int svbres = 0;
+#endif
$? "+ dk_pwgen_seed_prng"
/* Let OpenSSL library functions try to initialize.
@@ -1188,7 +1212,7 @@ dk_pwgen_seed_prng(void)
cc = 1;
do {
if (0 != dk_pwgen_can_continue()) {
- res = CryptGenRandom(hcp, (DWORD)sizeof(buffer), buffer);
+ res = CryptGenRandom(hcp, (DWORD)sizeof(buffer), (BYTE *)buffer);
if (res) {
RAND_seed(buffer, sizeof(buffer));
if (1 == RAND_status()) {
diff --git a/support/dktools/dk-pwgen.rc b/support/dktools/dk-pwgen.rc
index 36b551c4ab..10eabcb138 100644
--- a/support/dktools/dk-pwgen.rc
+++ b/support/dktools/dk-pwgen.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Generator for passwords, PINs and hexadecimal keys\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Generator for passwords, PINs and hexadecimal keys\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-pwgen\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-rand.c b/support/dktools/dk-rand.c
index 1eecf01f42..463d6f2b17 100644
--- a/support/dktools/dk-rand.c
+++ b/support/dktools/dk-rand.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-rand.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-rand.ctr
*/
/** @file dk-rand.c The dk-rand module.
@@ -120,12 +98,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maasz.h"
#include "dk4mpl.h"
#include "dk4svbuf.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 95 "dk-rand.ctr"
+#line 99 "dk-rand.ctr"
@@ -148,7 +130,9 @@ static char stdout_buffer[BUFSIZ];
/** Buffer to read seed file.
*/
+#if (!(DK4_ON_WINDOWS))
static char seed_file_buffer[BUFSIZ];
+#endif
@@ -166,12 +150,12 @@ static const char * const help_text[] = {
"--version\tShow version information.",
"--license\tShow license information.",
"",
-"http://dktools.sourceforge.net",
+"http://sourceforge.net/p/dktools/wiki/dk-rand/",
"",
NULL
-#line 139 "dk-rand.ctr"
+#line 145 "dk-rand.ctr"
};
@@ -183,7 +167,8 @@ static const char * const license_text[] = {
"a library:",
"",
"dktools\t\tDirk Krause's tools and libraries.",
-"\t\tSee http://dktools.sourceforge.net/ for more information.",
+"\t\tSee http://sourceforge.net/p/dktools/wiki/Home/",
+"\t\tfor more information.",
#if DK4_HAVE_OPENSSL_RAND_H
"",
"OpenSSL\t\tCryptographic toolkit, used to build file checksums here.",
@@ -211,27 +196,27 @@ static const char * const license_text[] = {
"Redistribution and use in source and binary forms, with or without",
"modification, are permitted provided that the following conditions are met:",
"",
-"* Redistributions of source code must retain the above copyright notice,",
-" this list of conditions and the following disclaimer.",
-"* Redistributions in binary form must reproduce the above copyright",
-" notice, this list of conditions and the following disclaimer in the",
-" documentation and/or other materials provided with the distribution.",
-"* Neither the name of the Dirk Krause nor the names of contributors may be",
-" used to endorse or promote products derived from this software without",
-" specific prior written permission.",
-"",
-"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"",
-"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
-"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE",
-"ARE DISCLAIMED.",
+"1. Redistributions of source code must retain the above copyright notice,",
+" this list of conditions and the following disclaimer.",
+"2. Redistributions in binary form must reproduce the above copyright",
+" notice, this list of conditions and the following disclaimer in the",
+" documentation and/or other materials provided with the distribution.",
+"3. Neither the name of the copyright holder nor the names of its",
+" contributors may be used to endorse or promote products derived from",
+" this software without specific prior written permission.",
"",
-"IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,",
-"INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,",
-"BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,",
-"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY",
-"OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING",
-"NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,",
-"EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS",
+"``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT",
+"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR",
+"A PARTICULAR PURPOSE ARE DISCLAIMED.",
+"IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY",
+"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
+"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR",
+"SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER",
+"CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT",
+"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY",
+"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF",
+"SUCH DAMAGE.",
#if DK4_HAVE_OPENSSL_RAND_H
"",
"",
@@ -365,7 +350,7 @@ static const char * const license_text[] = {
NULL
-#line 331 "dk-rand.ctr"
+#line 338 "dk-rand.ctr"
};
@@ -432,7 +417,7 @@ static const char * dk_rand_kw[] = {
NULL
-#line 405 "dk-rand.ctr"
+#line 412 "dk-rand.ctr"
};
@@ -502,8 +487,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -514,8 +500,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -525,8 +512,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -552,9 +540,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-can_continue(int dopipe)
+can_continue(
+#ifdef SIGPIPE
+int dopipe
+#else
+int DK4_ARG_UNUSED(dopipe)
+#endif
+)
{
int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(dopipe)
+#endif
if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
if (0 != sig_read_atomic(&sig_had_int)) { back = 0; }
#ifdef SIGPIPE
@@ -589,7 +586,9 @@ int
seed_prng(void)
{
char buffer[64];
+#if DK4_HAVE_RAND_EGD && DK4_HAVE_STRUCT_SOCKADDR_UN
char *envptr;
+#endif
#if DK4_ON_WINDOWS
HCRYPTPROV hcp;
BOOL res;
@@ -600,10 +599,12 @@ seed_prng(void)
int cc;
int rounds = 0;
int back = 0;
+#if (!(DK4_ON_WINDOWS))
int svbres = 0;
+#endif
-#line 574 "dk-rand.ctr"
+#line 597 "dk-rand.ctr"
/* Let OpenSSL library functions try to initialize.
*/
@@ -636,7 +637,7 @@ seed_prng(void)
cc = 1;
do {
if (0 != can_continue(0)) {
- res = CryptGenRandom(hcp, (DWORD)sizeof(buffer), buffer);
+ res = CryptGenRandom(hcp, (DWORD)sizeof(buffer), (BYTE *)buffer);
if (res) {
RAND_seed(buffer, sizeof(buffer));
if (1 == RAND_status()) {
@@ -711,7 +712,7 @@ seed_prng(void)
finished:
-#line 680 "dk-rand.ctr"
+#line 703 "dk-rand.ctr"
return back;
}
diff --git a/support/dktools/dk-rand.ctr b/support/dktools/dk-rand.ctr
index b308de5f9c..9a225a93b0 100644
--- a/support/dktools/dk-rand.ctr
+++ b/support/dktools/dk-rand.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -88,7 +88,11 @@ license = bsd
#include "dk4maasz.h"
#include "dk4mpl.h"
#include "dk4svbuf.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -114,7 +118,9 @@ static char stdout_buffer[BUFSIZ];
/** Buffer to read seed file.
*/
+#if (!(DK4_ON_WINDOWS))
static char seed_file_buffer[BUFSIZ];
+#endif
@@ -133,7 +139,7 @@ dk-rand [-b bytes]
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-rand/
$!end
};
@@ -148,7 +154,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_OPENSSL_RAND_H
OpenSSL Cryptographic toolkit, used to build file checksums here.
@@ -176,27 +183,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_OPENSSL_RAND_H
@@ -471,8 +478,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -483,8 +491,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -494,8 +503,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -521,9 +531,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-can_continue(int dopipe)
+can_continue(
+#ifdef SIGPIPE
+int dopipe
+#else
+int DK4_ARG_UNUSED(dopipe)
+#endif
+)
{
int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(dopipe)
+#endif
if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
if (0 != sig_read_atomic(&sig_had_int)) { back = 0; }
#ifdef SIGPIPE
@@ -558,7 +577,9 @@ int
seed_prng(void)
{
char buffer[64];
+#if DK4_HAVE_RAND_EGD && DK4_HAVE_STRUCT_SOCKADDR_UN
char *envptr;
+#endif
#if DK4_ON_WINDOWS
HCRYPTPROV hcp;
BOOL res;
@@ -569,7 +590,9 @@ seed_prng(void)
int cc;
int rounds = 0;
int back = 0;
+#if (!(DK4_ON_WINDOWS))
int svbres = 0;
+#endif
$? "+ dk_pwgen_seed_prng"
/* Let OpenSSL library functions try to initialize.
@@ -603,7 +626,7 @@ seed_prng(void)
cc = 1;
do {
if (0 != can_continue(0)) {
- res = CryptGenRandom(hcp, (DWORD)sizeof(buffer), buffer);
+ res = CryptGenRandom(hcp, (DWORD)sizeof(buffer), (BYTE *)buffer);
if (res) {
RAND_seed(buffer, sizeof(buffer));
if (1 == RAND_status()) {
diff --git a/support/dktools/dk-rand.rc b/support/dktools/dk-rand.rc
index b6d392121a..4b7b302842 100644
--- a/support/dktools/dk-rand.rc
+++ b/support/dktools/dk-rand.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Random data generator\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Random data generator\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-rand\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-recv.c b/support/dktools/dk-recv.c
index 6ff288b381..c5fdc4a102 100644
--- a/support/dktools/dk-recv.c
+++ b/support/dktools/dk-recv.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-recv.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-recv.ctr
*/
/** @file dk-recv.c The dk-recv module.
@@ -41,8 +19,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4conf.h"
-#if DK4_HAVE_MATH_H
+#if DK4_HAVE_MATH_H
#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -83,12 +66,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mema.h"
#include "dk4strd.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#include "dk4time.h"
+#include "dk4maadu.h"
+#include "dk4maodd.h"
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 59 "dk-recv.ctr"
+#line 72 "dk-recv.ctr"
@@ -118,7 +109,7 @@ dkT(""),
NULL
-#line 87 "dk-recv.ctr"
+#line 100 "dk-recv.ctr"
};
@@ -130,7 +121,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -157,27 +149,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -251,7 +243,7 @@ dkT(""),
NULL
-#line 218 "dk-recv.ctr"
+#line 232 "dk-recv.ctr"
};
@@ -277,7 +269,7 @@ dkT("wb"),
NULL
-#line 247 "dk-recv.ctr"
+#line 261 "dk-recv.ctr"
};
@@ -319,10 +311,25 @@ dkT("Interrupted by SIGTERM signal!"),
/* 10 */
dkT("Interrupted by SIGPIPE signal!"),
+/* 11 */
+dkT("Connect time: "),
+
+/* 12 */
+dkT("Transfer time: "),
+
+/* 13 */
+dkT("Transfer size: "),
+
+/* 14 */
+dkT(" seconds."),
+
+/* 15 */
+dkT(" bytes."),
+
NULL
-#line 292 "dk-recv.ctr"
+#line 320 "dk-recv.ctr"
};
@@ -346,6 +353,12 @@ static const dk4_option_specification_t dk_recv_options[] = {
+/** Error report for size calculations and statistics.
+*/
+static dk4_er_t ernb;
+
+
+
/** Array of localized texts, loaded in the main() function.
Usable as long as the app pointer below is usable.
*/
@@ -364,6 +377,10 @@ static const dkChar *dk_recv_portno = NULL;
static dk4_app_t *app = NULL;
+/** Number of bytes received.
+*/
+dk4_um_t numbytes = (dk4_um_t)0UL;
+
/** Number of elements in the dk_recv_options array.
*/
@@ -372,11 +389,12 @@ sizeof(dk_recv_options)/sizeof(dk4_option_specification_t);
+#if 0
/** Number of elements in the dk_recv_kw_def array.
*/
static const size_t dk_recv_sz_def =
sizeof(dk_recv_kw_def)/sizeof(DK4_PCDKCHAR) - 1;
-
+#endif
/** Number of elements in the dk_recv_kw_def array.
@@ -385,6 +403,20 @@ static size_t dk_recv_sz_loc =
sizeof(dk_recv_kw_def)/sizeof(DK4_PCDKCHAR) - 1;
+/** Timestamp for start of connection attempt.
+*/
+static dk4_time_t time_stamp_1 = (dk4_time_t)0UL;
+
+
+/** Timestamp start of data transfer.
+*/
+static dk4_time_t time_stamp_2 = (dk4_time_t)0UL;
+
+
+/** Timestamp end of data transfer.
+*/
+static dk4_time_t time_stamp_3 = (dk4_time_t)0UL;
+
/** Seconds for timeout.
*/
@@ -455,8 +487,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -466,8 +499,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -476,8 +510,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -501,10 +536,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -550,6 +593,81 @@ static char bu[1048576];
static char bu[16384];
#endif
+
+
+/** Log statistical data (connect wait time, transfer time, transfer size).
+*/
+static
+void
+log_statistics(void)
+{
+ dkChar b1[8*sizeof(dk4_um_t)]; /* Connect wait time */
+ dkChar b2[8*sizeof(dk4_um_t)]; /* Transfer time */
+ dkChar b3[8*sizeof(dk4_um_t)]; /* Transfer size */
+ dkChar b4[8*sizeof(dk4_um_t)]; /* Space before number */
+ const dkChar *msg[5];
+ size_t sl1;
+ size_t sl2;
+ size_t sl3;
+ size_t slm;
+ size_t i;
+
+ if ((time_stamp_2 >= time_stamp_1) && (time_stamp_3 >= time_stamp_2)) {
+ dk4ma_write_decimal_unsigned(
+ b1, DK4_SIZEOF(b1,dkChar), (time_stamp_2 - time_stamp_1), 0, &ernb
+ );
+ dk4ma_write_decimal_unsigned(
+ b2, DK4_SIZEOF(b2,dkChar), (time_stamp_3 - time_stamp_2), 0, &ernb
+ );
+ dk4ma_write_decimal_unsigned(
+ b3, DK4_SIZEOF(b3,dkChar), numbytes, 0, &ernb
+ );
+ if (DK4_E_NONE == ernb.ec) {
+ sl1 = dk4str_len(b1);
+ sl2 = dk4str_len(b2);
+ sl3 = dk4str_len(b3);
+ slm = sl1;
+ if (sl2 > slm) slm = sl2;
+ if (sl3 > slm) slm = sl3;
+ /*
+ Number of connection seconds
+ */
+ for (i = 0; i < (slm - sl1); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl1)] = dkT('\0');
+ msg[0] = dk_recv_kw_loc[11];
+ msg[1] = b4;
+ msg[2] = b1;
+ msg[3] = dk_recv_kw_loc[14];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ /*
+ Number of transfer seconds
+ */
+ for (i = 0; i < (slm - sl2); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl2)] = dkT('\0');
+ msg[0] = dk_recv_kw_loc[12];
+ msg[1] = b4;
+ msg[2] = b2;
+ msg[3] = dk_recv_kw_loc[14];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ /*
+ Number of transferred bytes
+ */
+ for (i = 0; i < (slm - sl3); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl3)] = dkT('\0');
+ msg[0] = dk_recv_kw_loc[13];
+ msg[1] = b4;
+ msg[2] = b3;
+ msg[3] = dk_recv_kw_loc[15];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ }
+ }
+}
+
+
+
/** Run for hostname, port specification and real file name
(wildcards * and ? resolved on Windows).
@param hostname Host to connect to (name or address).
@@ -585,14 +703,14 @@ dk_recv_run_with_real_file_name(
-#line 553 "dk-recv.ctr"
+#line 692 "dk-recv.ctr"
/* Check for signals.
*/
if (0 == sig_can_continue(1)) {
goto finished;
}
-#line 558 "dk-recv.ctr"
+#line 697 "dk-recv.ctr"
/* Bring socket subsystem up (Windows).
*/
@@ -601,10 +719,11 @@ dk_recv_run_with_real_file_name(
goto finished;
}
-#line 565 "dk-recv.ctr"
+#line 704 "dk-recv.ctr"
/* Open TCP client socket.
*/
+ dk4time_get(&time_stamp_1);
sock = dk4socket_tcp_client_for_host_service_app(
hostname, portspec, dk_recv_portno,
dk_recv_timeout_secs, dk_recv_timeout_usecs, app
@@ -614,12 +733,12 @@ dk_recv_run_with_real_file_name(
goto tcpip_down;
}
-#line 576 "dk-recv.ctr"
+#line 716 "dk-recv.ctr"
if (0 == sig_can_continue(1)) {
goto close_socket;
}
-#line 579 "dk-recv.ctr"
+#line 719 "dk-recv.ctr"
/* Send start-of-transmission byte and shutdown socket for writing.
*/
@@ -629,23 +748,23 @@ dk_recv_run_with_real_file_name(
goto close_socket;
}
-#line 587 "dk-recv.ctr"
+#line 727 "dk-recv.ctr"
if (0 == sig_can_continue(1)) {
goto close_socket;
}
-#line 590 "dk-recv.ctr"
+#line 730 "dk-recv.ctr"
res = dk4socket_shutdown_app(sock, DK4_SOCKET_SHUT_WRITE, app);
if (DK4_SOCKET_RESULT_SUCCESS != res) {
goto close_socket;
}
-#line 594 "dk-recv.ctr"
+#line 734 "dk-recv.ctr"
if (0 == sig_can_continue(1)) {
goto close_socket;
}
-#line 597 "dk-recv.ctr"
+#line 737 "dk-recv.ctr"
/* Indicate success so far.
*/
@@ -656,32 +775,34 @@ dk_recv_run_with_real_file_name(
do {
if (0 != sig_can_continue(1)) {
-#line 606 "dk-recv.ctr"
+#line 746 "dk-recv.ctr"
sz = sizeof(bu);
res = dk4socket_recv_app(sock, bu, &sz, 0, 0L, 0L, app);
+ if ((dk4_time_t)0UL == time_stamp_2) { dk4time_get(&time_stamp_2); }
if (DK4_SOCKET_RESULT_SUCCESS == res) {
if (0 < sz) {
-#line 610 "dk-recv.ctr"
+#line 751 "dk-recv.ctr"
+ numbytes = dk4ma_um_add(numbytes, sz, &ernb);
if (0 != sig_can_continue(1)) {
if (0 != first) {
-#line 612 "dk-recv.ctr"
+#line 754 "dk-recv.ctr"
first = 0;
if (NULL != filename) {
-#line 614 "dk-recv.ctr"
+#line 756 "dk-recv.ctr"
tests = DK4_FOPEN_SC_USER;
if (0 != dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
fipo = dk4fopen_app(filename, dk_recv_kwnl[4], tests, app);
if (NULL == fipo) {
-#line 618 "dk-recv.ctr"
+#line 760 "dk-recv.ctr"
exval = EXIT_FAILURE;
}
} else {
-#line 621 "dk-recv.ctr"
+#line 763 "dk-recv.ctr"
/* MODE FOR WINDOWS */
#if DK4_ON_WINDOWS
oldmode = _setmode(_fileno(stdout), _O_BINARY);
@@ -691,17 +812,17 @@ dk_recv_run_with_real_file_name(
}
if (NULL != fipo) {
-#line 629 "dk-recv.ctr"
+#line 771 "dk-recv.ctr"
if (0 == we) {
-#line 630 "dk-recv.ctr"
+#line 772 "dk-recv.ctr"
errno = 0;
-#line 631 "dk-recv.ctr"
+#line 773 "dk-recv.ctr"
wrb = fwrite(bu, 1, sz, fipo);
if (wrb != sz) {
-#line 633 "dk-recv.ctr"
+#line 775 "dk-recv.ctr"
we = 1;
exval = EXIT_FAILURE;
/* ERROR: Write attempt failed */
@@ -715,40 +836,43 @@ dk_recv_run_with_real_file_name(
}
} else {
-#line 645 "dk-recv.ctr"
+#line 787 "dk-recv.ctr"
cc = -1;
}
} else {
-#line 648 "dk-recv.ctr"
+#line 790 "dk-recv.ctr"
cc = 0;
}
} else {
-#line 651 "dk-recv.ctr"
+#line 793 "dk-recv.ctr"
cc = -1;
}
} else {
-#line 654 "dk-recv.ctr"
+#line 796 "dk-recv.ctr"
cc = -1;
}
} while (1 == cc);
+ if ((dk4_time_t)0UL == time_stamp_2) { dk4time_get(&time_stamp_2); }
+ dk4time_get(&time_stamp_3);
+
/* Cleanup
*/
if (0 == first) {
-#line 661 "dk-recv.ctr"
+#line 806 "dk-recv.ctr"
if (NULL != filename) {
-#line 662 "dk-recv.ctr"
+#line 807 "dk-recv.ctr"
if (NULL != fipo) {
-#line 663 "dk-recv.ctr"
+#line 808 "dk-recv.ctr"
if (0 != fclose(fipo)) {
-#line 664 "dk-recv.ctr"
+#line 809 "dk-recv.ctr"
/* ERROR: Failed to close file */
dk4app_log_1(app, dk_recv_kw_loc, dk_recv_sz_loc, DK4_LL_ERROR, 3);
exval = EXIT_FAILURE;
@@ -756,10 +880,10 @@ dk_recv_run_with_real_file_name(
}
} else {
-#line 670 "dk-recv.ctr"
+#line 815 "dk-recv.ctr"
if (0 != fflush(stdout)) {
-#line 671 "dk-recv.ctr"
+#line 816 "dk-recv.ctr"
exval = EXIT_FAILURE;
}
#if DK4_ON_WINDOWS
@@ -767,13 +891,14 @@ dk_recv_run_with_real_file_name(
#endif
}
}
+ if (0 != dk4app_log_do(app, DK4_LL_INFO)) { log_statistics(); }
/* Close socket if open.
*/
close_socket:
if (INVALID_SOCKET != sock) {
-#line 683 "dk-recv.ctr"
+#line 829 "dk-recv.ctr"
dk4socket_close_app(sock, app);
}
@@ -782,12 +907,12 @@ dk_recv_run_with_real_file_name(
tcpip_down:
dk4socket_down_app(app);
-#line 690 "dk-recv.ctr"
+#line 836 "dk-recv.ctr"
finished: ;
-#line 693 "dk-recv.ctr"
+#line 839 "dk-recv.ctr"
}
@@ -892,7 +1017,7 @@ dk_recv_normal_run(void)
int canrun;
-#line 796 "dk-recv.ctr"
+#line 942 "dk-recv.ctr"
canrun = 1;
/* Timeout specified?
*/
@@ -955,7 +1080,7 @@ dk_recv_normal_run(void)
}
-#line 857 "dk-recv.ctr"
+#line 1003 "dk-recv.ctr"
}
@@ -1160,10 +1285,11 @@ int main(int argc, char *argv[])
{
-#line 1060 "dk-recv.ctr"
+#line 1206 "dk-recv.ctr"
-#line 1061 "dk-recv.ctr"
+#line 1207 "dk-recv.ctr"
+ dk4error_init(&ernb);
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
argc, argv, dk_recv_options, dk_recv_sz_options,
@@ -1172,7 +1298,7 @@ int main(int argc, char *argv[])
);
if (NULL != app) {
-#line 1068 "dk-recv.ctr"
+#line 1215 "dk-recv.ctr"
dk_recv_sz_loc = dk4app_string_table_size(dk_recv_kw_def);
dk_recv_kw_loc = dk4app_string_table(app, dk_recv_kwnl[2], dk_recv_kw_def);
dk_recv_sz_loc = dk4app_string_table_size(dk_recv_kw_loc);
@@ -1200,7 +1326,7 @@ int main(int argc, char *argv[])
dk4app_close(app); app = NULL;
} else {
-#line 1094 "dk-recv.ctr"
+#line 1241 "dk-recv.ctr"
}
fflush(stderr);
dk4fput_cleanup_stderr();
@@ -1217,10 +1343,10 @@ int main(int argc, char *argv[])
#endif
-#line 1109 "dk-recv.ctr"
+#line 1256 "dk-recv.ctr"
-#line 1110 "dk-recv.ctr"
+#line 1257 "dk-recv.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-recv.ctr b/support/dktools/dk-recv.ctr
index c00d3c458c..e538024226 100644
--- a/support/dktools/dk-recv.ctr
+++ b/support/dktools/dk-recv.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -10,8 +10,13 @@ license = bsd
#include "dk4conf.h"
-#if DK4_HAVE_MATH_H
+#if DK4_HAVE_MATH_H
#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -52,6 +57,14 @@ license = bsd
#include "dk4mema.h"
#include "dk4strd.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#include "dk4time.h"
+#include "dk4maadu.h"
+#include "dk4maodd.h"
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
@@ -96,7 +109,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -123,27 +137,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -288,6 +302,20 @@ Wrong number of arguments!\n\thost port [filename]
Interrupted by SIGINT signal!
Interrupted by SIGTERM signal!
Interrupted by SIGPIPE signal!
+#
+# 11 12 13
+#
+Connect time:
+Transfer time:
+Transfer size:
+#
+# 14 15
+#
+ seconds.
+ bytes.
+#
+#
+#
$!end
};
@@ -312,6 +340,12 @@ static const dk4_option_specification_t dk_recv_options[] = {
+/** Error report for size calculations and statistics.
+*/
+static dk4_er_t ernb;
+
+
+
/** Array of localized texts, loaded in the main() function.
Usable as long as the app pointer below is usable.
*/
@@ -330,6 +364,10 @@ static const dkChar *dk_recv_portno = NULL;
static dk4_app_t *app = NULL;
+/** Number of bytes received.
+*/
+dk4_um_t numbytes = (dk4_um_t)0UL;
+
/** Number of elements in the dk_recv_options array.
*/
@@ -338,11 +376,12 @@ sizeof(dk_recv_options)/sizeof(dk4_option_specification_t);
+#if 0
/** Number of elements in the dk_recv_kw_def array.
*/
static const size_t dk_recv_sz_def =
sizeof(dk_recv_kw_def)/sizeof(DK4_PCDKCHAR) - 1;
-
+#endif
/** Number of elements in the dk_recv_kw_def array.
@@ -351,6 +390,20 @@ static size_t dk_recv_sz_loc =
sizeof(dk_recv_kw_def)/sizeof(DK4_PCDKCHAR) - 1;
+/** Timestamp for start of connection attempt.
+*/
+static dk4_time_t time_stamp_1 = (dk4_time_t)0UL;
+
+
+/** Timestamp start of data transfer.
+*/
+static dk4_time_t time_stamp_2 = (dk4_time_t)0UL;
+
+
+/** Timestamp end of data transfer.
+*/
+static dk4_time_t time_stamp_3 = (dk4_time_t)0UL;
+
/** Seconds for timeout.
*/
@@ -421,8 +474,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -432,8 +486,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -442,8 +497,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -467,10 +523,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -516,6 +580,81 @@ static char bu[1048576];
static char bu[16384];
#endif
+
+
+/** Log statistical data (connect wait time, transfer time, transfer size).
+*/
+static
+void
+log_statistics(void)
+{
+ dkChar b1[8*sizeof(dk4_um_t)]; /* Connect wait time */
+ dkChar b2[8*sizeof(dk4_um_t)]; /* Transfer time */
+ dkChar b3[8*sizeof(dk4_um_t)]; /* Transfer size */
+ dkChar b4[8*sizeof(dk4_um_t)]; /* Space before number */
+ const dkChar *msg[5];
+ size_t sl1;
+ size_t sl2;
+ size_t sl3;
+ size_t slm;
+ size_t i;
+
+ if ((time_stamp_2 >= time_stamp_1) && (time_stamp_3 >= time_stamp_2)) {
+ dk4ma_write_decimal_unsigned(
+ b1, DK4_SIZEOF(b1,dkChar), (time_stamp_2 - time_stamp_1), 0, &ernb
+ );
+ dk4ma_write_decimal_unsigned(
+ b2, DK4_SIZEOF(b2,dkChar), (time_stamp_3 - time_stamp_2), 0, &ernb
+ );
+ dk4ma_write_decimal_unsigned(
+ b3, DK4_SIZEOF(b3,dkChar), numbytes, 0, &ernb
+ );
+ if (DK4_E_NONE == ernb.ec) {
+ sl1 = dk4str_len(b1);
+ sl2 = dk4str_len(b2);
+ sl3 = dk4str_len(b3);
+ slm = sl1;
+ if (sl2 > slm) slm = sl2;
+ if (sl3 > slm) slm = sl3;
+ /*
+ Number of connection seconds
+ */
+ for (i = 0; i < (slm - sl1); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl1)] = dkT('\0');
+ msg[0] = dk_recv_kw_loc[11];
+ msg[1] = b4;
+ msg[2] = b1;
+ msg[3] = dk_recv_kw_loc[14];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ /*
+ Number of transfer seconds
+ */
+ for (i = 0; i < (slm - sl2); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl2)] = dkT('\0');
+ msg[0] = dk_recv_kw_loc[12];
+ msg[1] = b4;
+ msg[2] = b2;
+ msg[3] = dk_recv_kw_loc[14];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ /*
+ Number of transferred bytes
+ */
+ for (i = 0; i < (slm - sl3); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl3)] = dkT('\0');
+ msg[0] = dk_recv_kw_loc[13];
+ msg[1] = b4;
+ msg[2] = b3;
+ msg[3] = dk_recv_kw_loc[15];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ }
+ }
+}
+
+
+
/** Run for hostname, port specification and real file name
(wildcards * and ? resolved on Windows).
@param hostname Host to connect to (name or address).
@@ -565,6 +704,7 @@ dk_recv_run_with_real_file_name(
/* Open TCP client socket.
*/
+ dk4time_get(&time_stamp_1);
sock = dk4socket_tcp_client_for_host_service_app(
hostname, portspec, dk_recv_portno,
dk_recv_timeout_secs, dk_recv_timeout_usecs, app
@@ -605,8 +745,10 @@ dk_recv_run_with_real_file_name(
if (0 != sig_can_continue(1)) { $? ". can continue"
sz = sizeof(bu);
res = dk4socket_recv_app(sock, bu, &sz, 0, 0L, 0L, app);
+ if ((dk4_time_t)0UL == time_stamp_2) { dk4time_get(&time_stamp_2); }
if (DK4_SOCKET_RESULT_SUCCESS == res) {
if (0 < sz) { $? ". %u bytes found", (unsigned)sz
+ numbytes = dk4ma_um_add(numbytes, sz, &ernb);
if (0 != sig_can_continue(1)) {
if (0 != first) { $? ". first data packet"
first = 0;
@@ -654,6 +796,9 @@ dk_recv_run_with_real_file_name(
cc = -1;
}
} while (1 == cc);
+ if ((dk4_time_t)0UL == time_stamp_2) { dk4time_get(&time_stamp_2); }
+ dk4time_get(&time_stamp_3);
+
/* Cleanup
*/
@@ -675,6 +820,7 @@ dk_recv_run_with_real_file_name(
#endif
}
}
+ if (0 != dk4app_log_do(app, DK4_LL_INFO)) { log_statistics(); }
/* Close socket if open.
*/
@@ -1058,6 +1204,7 @@ int main(int argc, char *argv[])
{
$!trace-init dk-recv.deb
$? "+ main"
+ dk4error_init(&ernb);
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
argc, argv, dk_recv_options, dk_recv_sz_options,
diff --git a/support/dktools/dk-recv.rc b/support/dktools/dk-recv.rc
index e63ed5e247..735f6d0764 100644
--- a/support/dktools/dk-recv.rc
+++ b/support/dktools/dk-recv.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Receive data transmission\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Receive data transmission\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-recv\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-send.c b/support/dktools/dk-send.c
index 07dc0ed6e8..2bf337317e 100644
--- a/support/dktools/dk-send.c
+++ b/support/dktools/dk-send.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-send.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-send.ctr
*/
/** @file dk-send.c The dk-send module.
@@ -41,8 +19,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4conf.h"
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -72,7 +55,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4app.h"
#include "dk4aopt.h"
#include "dk4socka.h"
+#include "dk4maadu.h"
#include "dk4maidddu.h"
+#include "dk4maodd.h"
#include "dk4mpl.h"
#include "dk4vers.h"
#include "dk4isadm.h"
@@ -82,12 +67,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mema.h"
#include "dk4fopda.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#include "dk4time.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 58 "dk-send.ctr"
+#line 70 "dk-send.ctr"
@@ -126,7 +116,7 @@ dkT("rb"),
NULL
-#line 101 "dk-send.ctr"
+#line 113 "dk-send.ctr"
};
@@ -194,10 +184,25 @@ dkT("Timeout value not found!"),
/* 19 */
dkT("Stop processing as all clients are disconnected!"),
+/* 20 */
+dkT("Connect time: "),
+
+/* 21 */
+dkT("Transfer time: "),
+
+/* 22 */
+dkT("Transfer size: "),
+
+/* 23 */
+dkT(" seconds."),
+
+/* 24 */
+dkT(" bytes."),
+
NULL
-#line 181 "dk-send.ctr"
+#line 207 "dk-send.ctr"
};
@@ -229,7 +234,7 @@ dkT(""),
NULL
-#line 211 "dk-send.ctr"
+#line 237 "dk-send.ctr"
};
@@ -241,7 +246,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -279,27 +285,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -502,7 +508,7 @@ dkT(""),
NULL
-#line 482 "dk-send.ctr"
+#line 509 "dk-send.ctr"
};
@@ -530,6 +536,11 @@ static char dk_send_buf[16384];
#endif
+/** Error report for counting number of bytes.
+*/
+static dk4_er_t ernb;
+
+
/** Application structure for diagnostics.
*/
static dk4_app_t *app = NULL;
@@ -559,6 +570,10 @@ static dk4_sto_it_t *i_allowed = NULL;
static dk4_um_t numclients = (dk4_um_t)1UL;
+/** Number of bytes transmitted.
+*/
+static dk4_um_t numbytes = (dk4_um_t)0UL;
+
/** Number of elements in the dk_send_msg array.
*/
@@ -573,6 +588,20 @@ static size_t dk_send_sz_options =
sizeof(dk_send_options)/sizeof(dk4_option_specification_t);
+/** Timestamp of first client connection.
+*/
+static dk4_time_t time_stamp_1 = (dk4_time_t)0UL;
+
+
+/** Timestamp start of transmission.
+*/
+static dk4_time_t time_stamp_2 = (dk4_time_t)0UL;
+
+
+/** Timestamp end of transmission.
+*/
+static dk4_time_t time_stamp_3 = (dk4_time_t)0UL;
+
/** Seconds for read timeout.
*/
@@ -655,8 +684,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -666,8 +696,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -676,8 +707,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -701,10 +733,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -726,13 +766,13 @@ dk_send_can_continue(void)
int back = 1;
-#line 704 "dk-send.ctr"
+#line 765 "dk-send.ctr"
if (0 == sig_can_continue(0)) {
back = 0;
}
-#line 708 "dk-send.ctr"
+#line 769 "dk-send.ctr"
return back;
}
@@ -746,11 +786,12 @@ dk_send_can_continue(void)
*/
static
int
-dk_send_compare_clients(const void *l, const void *r, int cr)
+dk_send_compare_clients(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
const dk_send_client_t *pl;
const dk_send_client_t *pr;
int back = 0;
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (const dk_send_client_t *)l;
@@ -796,7 +837,7 @@ dk_send_get_allowed_clients(dkChar *argcpy)
int res = 0;
-#line 770 "dk-send.ctr"
+#line 832 "dk-send.ctr"
s_allowed = dk4sto_open(NULL);
if (NULL != s_allowed) {
dk4sto_set_comp(s_allowed, dk4socket_allowed_peer_compare, 0);
@@ -844,7 +885,7 @@ dk_send_get_allowed_clients(dkChar *argcpy)
}
-#line 816 "dk-send.ctr"
+#line 878 "dk-send.ctr"
return back;
}
@@ -878,17 +919,88 @@ dk_send_check_peer_address(dk4_sockaddr_storage_t *sasto, size_t soalen)
+/** Log statistical data (connect wait time, transfer time, transfer size).
+*/
+static
+void
+log_statistics(void)
+{
+ dkChar b1[8*sizeof(dk4_um_t)]; /* Connect wait time */
+ dkChar b2[8*sizeof(dk4_um_t)]; /* Transfer time */
+ dkChar b3[8*sizeof(dk4_um_t)]; /* Transfer size */
+ dkChar b4[8*sizeof(dk4_um_t)]; /* Space before number */
+ const dkChar *msg[5];
+ size_t sl1;
+ size_t sl2;
+ size_t sl3;
+ size_t slm;
+ size_t i;
+
+ if ((time_stamp_2 >= time_stamp_1) && (time_stamp_3 >= time_stamp_2)) {
+ dk4ma_write_decimal_unsigned(
+ b1, DK4_SIZEOF(b1,dkChar), (time_stamp_2 - time_stamp_1), 0, &ernb
+ );
+ dk4ma_write_decimal_unsigned(
+ b2, DK4_SIZEOF(b2,dkChar), (time_stamp_3 - time_stamp_2), 0, &ernb
+ );
+ dk4ma_write_decimal_unsigned(
+ b3, DK4_SIZEOF(b3,dkChar), numbytes, 0, &ernb
+ );
+ if (DK4_E_NONE == ernb.ec) {
+ sl1 = dk4str_len(b1);
+ sl2 = dk4str_len(b2);
+ sl3 = dk4str_len(b3);
+ slm = sl1;
+ if (sl2 > slm) slm = sl2;
+ if (sl3 > slm) slm = sl3;
+ /*
+ Number of connection seconds
+ */
+ for (i = 0; i < (slm - sl1); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl1)] = dkT('\0');
+ msg[0] = dk_send_msg[20];
+ msg[1] = b4;
+ msg[2] = b1;
+ msg[3] = dk_send_msg[23];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ /*
+ Number of transfer seconds
+ */
+ for (i = 0; i < (slm - sl2); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl2)] = dkT('\0');
+ msg[0] = dk_send_msg[21];
+ msg[1] = b4;
+ msg[2] = b2;
+ msg[3] = dk_send_msg[23];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ /*
+ Number of transferred bytes
+ */
+ for (i = 0; i < (slm - sl3); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl3)] = dkT('\0');
+ msg[0] = dk_send_msg[22];
+ msg[1] = b4;
+ msg[2] = b3;
+ msg[3] = dk_send_msg[24];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ }
+ }
+}
+
+
+
/** Accept incoming connections and transfer data.
@param portname Port name to listen.
@param infile Input file to read data from.
- @param filename Input file name.
*/
static
void
dk_send_do_networking(
const dkChar *portname,
- FILE *infile,
- const dkChar *filename
+ FILE *infile
)
{
dkChar peerbuf[1072];
@@ -918,7 +1030,7 @@ dk_send_do_networking(
-#line 888 "dk-send.ctr"
+#line 1021 "dk-send.ctr"
/* Create storage and iterator for connected clients.
*/
s_clients = dk4sto_open(NULL);
@@ -952,6 +1064,7 @@ dk_send_do_networking(
if (max < (listeners->pSockets)[i]) { max = (listeners->pSockets)[i]; }
}
}
+ dk4time_get(&time_stamp_1);
while (1 == cc) {
if (0 != dk_send_can_continue()) {
/* Prepare read file descriptor set */
@@ -972,27 +1085,27 @@ dk_send_do_networking(
allowed = 1;
if ((NULL != s_allowed) && (NULL != i_allowed)) {
-#line 940 "dk-send.ctr"
+#line 1074 "dk-send.ctr"
/* Check peer address */
if (0 != dk_send_check_peer_address(&sasto, soalen)) {
if (NULL == dk4sto_it_find_like(i_allowed, &sasto, 1)) {
allowed = 0;
-#line 944 "dk-send.ctr"
+#line 1078 "dk-send.ctr"
} else {
-#line 945 "dk-send.ctr"
+#line 1079 "dk-send.ctr"
}
} else {
-#line 947 "dk-send.ctr"
+#line 1081 "dk-send.ctr"
/* ERROR: Peer address length problem */
dk4app_log_1(app,dk_send_msg,dk_send_sz_msg,DK4_LL_ERROR,4);
allowed = 0;
}
} else {
-#line 952 "dk-send.ctr"
+#line 1086 "dk-send.ctr"
}
if (1 == allowed) {
pcl = dk4mem_new_app(dk_send_client_t,1,app);
@@ -1026,7 +1139,7 @@ dk_send_do_networking(
*/
if (0 != dk4app_log_do(app, DK4_LL_PROGRESS)) {
-#line 984 "dk-send.ctr"
+#line 1118 "dk-send.ctr"
psoa = (struct sockaddr *)(&sasto);
res = dk4socket_addr_port_to_text(
peerbuf, DK4_SIZEOF(peerbuf,dkChar),
@@ -1036,21 +1149,21 @@ dk_send_do_networking(
);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 992 "dk-send.ctr"
+#line 1126 "dk-send.ctr"
msgparts[0] = dk_send_msg[5];
msgparts[1] = peerbuf;
dk4app_log_msg(
app, DK4_LL_PROGRESS, msgparts, 2
);
-#line 997 "dk-send.ctr"
+#line 1131 "dk-send.ctr"
} else {
-#line 998 "dk-send.ctr"
+#line 1132 "dk-send.ctr"
}
} else {
-#line 1000 "dk-send.ctr"
+#line 1134 "dk-send.ctr"
}
} else {
/* ERROR: Nothing was read from socket */
@@ -1145,6 +1258,7 @@ dk_send_do_networking(
}
}
if (0 != cc) { goto finished; }
+ dk4time_get(&time_stamp_2);
/* All preparations succeeded.
*/
@@ -1163,15 +1277,16 @@ dk_send_do_networking(
rdbytes = fread(dk_send_buf, 1, sizeof(dk_send_buf), infile);
if (0 < rdbytes) {
-#line 1111 "dk-send.ctr"
+#line 1246 "dk-send.ctr"
anya = 0;
+ numbytes = dk4ma_um_add(numbytes, rdbytes, &ernb);
dk4sto_it_reset(i_clients);
do {
pcl = (dk_send_client_t *)dk4sto_it_next(i_clients);
if (NULL != pcl) {
if (INVALID_SOCKET != pcl->sock) {
-#line 1117 "dk-send.ctr"
+#line 1253 "dk-send.ctr"
bufstart = dk_send_buf;
wrbytes = 0;
ccwr = 1;
@@ -1180,7 +1295,7 @@ dk_send_do_networking(
wrpart = rdbytes - wrbytes;
-#line 1124 "dk-send.ctr"
+#line 1260 "dk-send.ctr"
res = dk4socket_send_app(
pcl->sock, bufstart, &wrpart, 0, 0L, 0L, app
);
@@ -1189,24 +1304,24 @@ dk_send_do_networking(
case DK4_SOCKET_RESULT_IN_PROGRESS : {
-#line 1131 "dk-send.ctr"
+#line 1267 "dk-send.ctr"
wrbytes += wrpart;
-#line 1133 "dk-send.ctr"
+#line 1269 "dk-send.ctr"
if (wrbytes >= rdbytes) {
ccwr = 0;
-#line 1135 "dk-send.ctr"
+#line 1271 "dk-send.ctr"
} else {
-#line 1136 "dk-send.ctr"
+#line 1272 "dk-send.ctr"
bufstart = &(bufstart[wrpart]);
}
} break;
default : {
-#line 1140 "dk-send.ctr"
+#line 1276 "dk-send.ctr"
/* ERROR: Failure on socket */
ccwr = -1;
exval = EXIT_FAILURE;
@@ -1240,7 +1355,7 @@ dk_send_do_networking(
}
-#line 1172 "dk-send.ctr"
+#line 1308 "dk-send.ctr"
}
}
if (0 == dk_send_can_continue()) {
@@ -1258,12 +1373,16 @@ dk_send_do_networking(
cc = -1;
}
}
+ dk4time_get(&time_stamp_3);
if ((1 == cc) && (0 == anya)) {
/* Warning: All clients disconnected */
dk4app_log_1(app, dk_send_msg, dk_send_sz_msg, DK4_LL_WARNING, 19);
}
/* PROGRESS: Finished data transfer */
dk4app_log_1(app, dk_send_msg, dk_send_sz_msg, DK4_LL_PROGRESS, 8);
+ if (0 != dk4app_log_do(app, DK4_LL_INFO)) {
+ log_statistics();
+ }
if (0 != cc) {
exval = EXIT_FAILURE;
goto finished;
@@ -1359,7 +1478,7 @@ dk_send_do_networking(
}
-#line 1289 "dk-send.ctr"
+#line 1429 "dk-send.ctr"
}
@@ -1367,14 +1486,12 @@ dk_send_do_networking(
/** Process command line arguments, and continue.
@param portname Port name to listen.
@param infile Input file to read data from.
- @param filename Input file name.
*/
static
void
dk_send_process_cmdline_args(
const dkChar *portname,
- FILE *infile,
- const dkChar *filename
+ FILE *infile
)
{
const dkChar *argptr = NULL;
@@ -1389,7 +1506,7 @@ dk_send_process_cmdline_args(
int res = 0;
-#line 1317 "dk-send.ctr"
+#line 1455 "dk-send.ctr"
/* Check whether to allow local connections only.
*/
if (0 != dk4app_opt_is_set_short(app, dkT('l'), NULL)) {
@@ -1463,7 +1580,7 @@ dk_send_process_cmdline_args(
}
}
-#line 1389 "dk-send.ctr"
+#line 1527 "dk-send.ctr"
/* Find allowed client addresses.
*/
if (0 != dk4app_opt_is_set_short(app, dkT('a'), NULL)) {
@@ -1472,7 +1589,7 @@ dk_send_process_cmdline_args(
/* ERROR: Failed to obtain Argument */
-#line 1396 "dk-send.ctr"
+#line 1534 "dk-send.ctr"
goto finished;
}
argcpy = dk4str_dup_app(argptr, app);
@@ -1480,13 +1597,13 @@ dk_send_process_cmdline_args(
if (0 == dk_send_get_allowed_clients(argcpy)) { goto finished; }
}
-#line 1402 "dk-send.ctr"
+#line 1540 "dk-send.ctr"
/* Do the network transmission.
*/
- dk_send_do_networking(portname, infile, filename);
+ dk_send_do_networking(portname, infile);
-#line 1406 "dk-send.ctr"
+#line 1544 "dk-send.ctr"
/* Finally release resources.
*/
finished:
@@ -1510,7 +1627,7 @@ dk_send_process_cmdline_args(
}
-#line 1428 "dk-send.ctr"
+#line 1566 "dk-send.ctr"
}
@@ -1518,18 +1635,16 @@ dk_send_process_cmdline_args(
/** Bring Winsock up before performing other steps.
@param portname Port name to listen.
@param infile Input file to read data from.
- @param filename Input file name.
*/
static
void
dk_send_run_for_file(
const dkChar *portname,
- FILE *infile,
- const dkChar *filename
+ FILE *infile
)
{
if (dk4socket_up_app(app)) {
- dk_send_process_cmdline_args(portname, infile, filename);
+ dk_send_process_cmdline_args(portname, infile);
dk4socket_down_app(app);
}
}
@@ -1549,7 +1664,7 @@ dk_send_run_for_real_file_name(const dkChar *portname, const dkChar *filename)
if (dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
inf = dk4fopen_app(filename, dk_send_kwnl[5], tests, app);
if (NULL != inf) {
- dk_send_run_for_file(portname, inf, filename);
+ dk_send_run_for_file(portname, inf);
fclose(inf);
}
}
@@ -1614,7 +1729,7 @@ dk_send_expand_filename(const dkChar *portname, const dkChar *filename)
static
void
-dk_send_normal_run()
+dk_send_normal_run(void)
{
const dkChar *filename = NULL;
int xargc = 0;
@@ -1627,7 +1742,7 @@ dk_send_normal_run()
#if DK4_ON_WINDOWS
oldmode = _setmode(_fileno(stdin), _O_BINARY);
#endif
- dk_send_run_for_file(dk4app_get_argv(app, 0), stdin, dk_send_msg[2]);
+ dk_send_run_for_file(dk4app_get_argv(app, 0), stdin);
#if DK4_ON_WINDOWS
_setmode(_fileno(stdin), oldmode);
#endif
@@ -1853,10 +1968,11 @@ int main(int argc, char *argv[])
{
-#line 1769 "dk-send.ctr"
+#line 1905 "dk-send.ctr"
-#line 1770 "dk-send.ctr"
+#line 1906 "dk-send.ctr"
+ dk4error_init(&ernb);
app = dk4app_open_cmd(
argc, argv, dk_send_options, dk_send_sz_options,
dk_send_kwnl[0], DKT_VERSION_DK,
@@ -1891,10 +2007,10 @@ int main(int argc, char *argv[])
}
-#line 1803 "dk-send.ctr"
+#line 1940 "dk-send.ctr"
-#line 1804 "dk-send.ctr"
+#line 1941 "dk-send.ctr"
exit(exval);
return exval;
}
diff --git a/support/dktools/dk-send.ctr b/support/dktools/dk-send.ctr
index adf0cf6532..be7c352d4d 100644
--- a/support/dktools/dk-send.ctr
+++ b/support/dktools/dk-send.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -10,8 +10,13 @@ license = bsd
#include "dk4conf.h"
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -41,7 +46,9 @@ license = bsd
#include "dk4app.h"
#include "dk4aopt.h"
#include "dk4socka.h"
+#include "dk4maadu.h"
#include "dk4maidddu.h"
+#include "dk4maodd.h"
#include "dk4mpl.h"
#include "dk4vers.h"
#include "dk4isadm.h"
@@ -51,7 +58,12 @@ license = bsd
#include "dk4mema.h"
#include "dk4fopda.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#include "dk4time.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -177,6 +189,20 @@ Timeout value not found!
# 19
#
Stop processing as all clients are disconnected!
+#
+# 20 21 22
+#
+Connect time:
+Transfer time:
+Transfer size:
+#
+# 23 24
+#
+ seconds.
+ bytes.
+#
+#
+#
$!end
};
@@ -220,7 +246,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -258,27 +285,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -506,6 +533,11 @@ static char dk_send_buf[16384];
#endif
+/** Error report for counting number of bytes.
+*/
+static dk4_er_t ernb;
+
+
/** Application structure for diagnostics.
*/
static dk4_app_t *app = NULL;
@@ -535,6 +567,10 @@ static dk4_sto_it_t *i_allowed = NULL;
static dk4_um_t numclients = (dk4_um_t)1UL;
+/** Number of bytes transmitted.
+*/
+static dk4_um_t numbytes = (dk4_um_t)0UL;
+
/** Number of elements in the dk_send_msg array.
*/
@@ -549,6 +585,20 @@ static size_t dk_send_sz_options =
sizeof(dk_send_options)/sizeof(dk4_option_specification_t);
+/** Timestamp of first client connection.
+*/
+static dk4_time_t time_stamp_1 = (dk4_time_t)0UL;
+
+
+/** Timestamp start of transmission.
+*/
+static dk4_time_t time_stamp_2 = (dk4_time_t)0UL;
+
+
+/** Timestamp end of transmission.
+*/
+static dk4_time_t time_stamp_3 = (dk4_time_t)0UL;
+
/** Seconds for read timeout.
*/
@@ -631,8 +681,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -642,8 +693,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -652,8 +704,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -677,10 +730,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -718,11 +779,12 @@ dk_send_can_continue(void)
*/
static
int
-dk_send_compare_clients(const void *l, const void *r, int cr)
+dk_send_compare_clients(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
const dk_send_client_t *pl;
const dk_send_client_t *pr;
int back = 0;
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (const dk_send_client_t *)l;
@@ -846,17 +908,88 @@ dk_send_check_peer_address(dk4_sockaddr_storage_t *sasto, size_t soalen)
+/** Log statistical data (connect wait time, transfer time, transfer size).
+*/
+static
+void
+log_statistics(void)
+{
+ dkChar b1[8*sizeof(dk4_um_t)]; /* Connect wait time */
+ dkChar b2[8*sizeof(dk4_um_t)]; /* Transfer time */
+ dkChar b3[8*sizeof(dk4_um_t)]; /* Transfer size */
+ dkChar b4[8*sizeof(dk4_um_t)]; /* Space before number */
+ const dkChar *msg[5];
+ size_t sl1;
+ size_t sl2;
+ size_t sl3;
+ size_t slm;
+ size_t i;
+
+ if ((time_stamp_2 >= time_stamp_1) && (time_stamp_3 >= time_stamp_2)) {
+ dk4ma_write_decimal_unsigned(
+ b1, DK4_SIZEOF(b1,dkChar), (time_stamp_2 - time_stamp_1), 0, &ernb
+ );
+ dk4ma_write_decimal_unsigned(
+ b2, DK4_SIZEOF(b2,dkChar), (time_stamp_3 - time_stamp_2), 0, &ernb
+ );
+ dk4ma_write_decimal_unsigned(
+ b3, DK4_SIZEOF(b3,dkChar), numbytes, 0, &ernb
+ );
+ if (DK4_E_NONE == ernb.ec) {
+ sl1 = dk4str_len(b1);
+ sl2 = dk4str_len(b2);
+ sl3 = dk4str_len(b3);
+ slm = sl1;
+ if (sl2 > slm) slm = sl2;
+ if (sl3 > slm) slm = sl3;
+ /*
+ Number of connection seconds
+ */
+ for (i = 0; i < (slm - sl1); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl1)] = dkT('\0');
+ msg[0] = dk_send_msg[20];
+ msg[1] = b4;
+ msg[2] = b1;
+ msg[3] = dk_send_msg[23];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ /*
+ Number of transfer seconds
+ */
+ for (i = 0; i < (slm - sl2); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl2)] = dkT('\0');
+ msg[0] = dk_send_msg[21];
+ msg[1] = b4;
+ msg[2] = b2;
+ msg[3] = dk_send_msg[23];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ /*
+ Number of transferred bytes
+ */
+ for (i = 0; i < (slm - sl3); i++) { b4[i] = dkT(' '); }
+ b4[(slm - sl3)] = dkT('\0');
+ msg[0] = dk_send_msg[22];
+ msg[1] = b4;
+ msg[2] = b3;
+ msg[3] = dk_send_msg[24];
+ msg[4] = NULL;
+ dk4app_log_msg(app, DK4_LL_INFO, msg, 4);
+ }
+ }
+}
+
+
+
/** Accept incoming connections and transfer data.
@param portname Port name to listen.
@param infile Input file to read data from.
- @param filename Input file name.
*/
static
void
dk_send_do_networking(
const dkChar *portname,
- FILE *infile,
- const dkChar *filename
+ FILE *infile
)
{
dkChar peerbuf[1072];
@@ -918,6 +1051,7 @@ dk_send_do_networking(
if (max < (listeners->pSockets)[i]) { max = (listeners->pSockets)[i]; }
}
}
+ dk4time_get(&time_stamp_1);
while (1 == cc) {
if (0 != dk_send_can_continue()) {
/* Prepare read file descriptor set */
@@ -1091,6 +1225,7 @@ dk_send_do_networking(
}
}
if (0 != cc) { goto finished; }
+ dk4time_get(&time_stamp_2);
/* All preparations succeeded.
*/
@@ -1109,6 +1244,7 @@ dk_send_do_networking(
rdbytes = fread(dk_send_buf, 1, sizeof(dk_send_buf), infile);
if (0 < rdbytes) { $? ". fread -> %u bytes", (unsigned)rdbytes
anya = 0;
+ numbytes = dk4ma_um_add(numbytes, rdbytes, &ernb);
dk4sto_it_reset(i_clients);
do {
pcl = (dk_send_client_t *)dk4sto_it_next(i_clients);
@@ -1186,12 +1322,16 @@ dk_send_do_networking(
cc = -1;
}
}
+ dk4time_get(&time_stamp_3);
if ((1 == cc) && (0 == anya)) {
/* Warning: All clients disconnected */
dk4app_log_1(app, dk_send_msg, dk_send_sz_msg, DK4_LL_WARNING, 19);
}
/* PROGRESS: Finished data transfer */
dk4app_log_1(app, dk_send_msg, dk_send_sz_msg, DK4_LL_PROGRESS, 8);
+ if (0 != dk4app_log_do(app, DK4_LL_INFO)) {
+ log_statistics();
+ }
if (0 != cc) {
exval = EXIT_FAILURE;
goto finished;
@@ -1293,14 +1433,12 @@ dk_send_do_networking(
/** Process command line arguments, and continue.
@param portname Port name to listen.
@param infile Input file to read data from.
- @param filename Input file name.
*/
static
void
dk_send_process_cmdline_args(
const dkChar *portname,
- FILE *infile,
- const dkChar *filename
+ FILE *infile
)
{
const dkChar *argptr = NULL;
@@ -1401,7 +1539,7 @@ dk_send_process_cmdline_args(
} $? ". remote address ok"
/* Do the network transmission.
*/
- dk_send_do_networking(portname, infile, filename);
+ dk_send_do_networking(portname, infile);
$? ". going to release resources"
/* Finally release resources.
*/
@@ -1432,18 +1570,16 @@ dk_send_process_cmdline_args(
/** Bring Winsock up before performing other steps.
@param portname Port name to listen.
@param infile Input file to read data from.
- @param filename Input file name.
*/
static
void
dk_send_run_for_file(
const dkChar *portname,
- FILE *infile,
- const dkChar *filename
+ FILE *infile
)
{
if (dk4socket_up_app(app)) {
- dk_send_process_cmdline_args(portname, infile, filename);
+ dk_send_process_cmdline_args(portname, infile);
dk4socket_down_app(app);
}
}
@@ -1463,7 +1599,7 @@ dk_send_run_for_real_file_name(const dkChar *portname, const dkChar *filename)
if (dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
inf = dk4fopen_app(filename, dk_send_kwnl[5], tests, app);
if (NULL != inf) {
- dk_send_run_for_file(portname, inf, filename);
+ dk_send_run_for_file(portname, inf);
fclose(inf);
}
}
@@ -1528,7 +1664,7 @@ dk_send_expand_filename(const dkChar *portname, const dkChar *filename)
static
void
-dk_send_normal_run()
+dk_send_normal_run(void)
{
const dkChar *filename = NULL;
int xargc = 0;
@@ -1541,7 +1677,7 @@ dk_send_normal_run()
#if DK4_ON_WINDOWS
oldmode = _setmode(_fileno(stdin), _O_BINARY);
#endif
- dk_send_run_for_file(dk4app_get_argv(app, 0), stdin, dk_send_msg[2]);
+ dk_send_run_for_file(dk4app_get_argv(app, 0), stdin);
#if DK4_ON_WINDOWS
_setmode(_fileno(stdin), oldmode);
#endif
@@ -1767,6 +1903,7 @@ int main(int argc, char *argv[])
{
$!trace-init dk-send.deb
$? "+ main"
+ dk4error_init(&ernb);
app = dk4app_open_cmd(
argc, argv, dk_send_options, dk_send_sz_options,
dk_send_kwnl[0], DKT_VERSION_DK,
diff --git a/support/dktools/dk-send.rc b/support/dktools/dk-send.rc
index 2699f0f80c..d8570fdfd5 100644
--- a/support/dktools/dk-send.rc
+++ b/support/dktools/dk-send.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Send data transmission\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Send data transmission\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-send\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-sort.c b/support/dktools/dk-sort.c
index 87a55cda5c..dbad5f1806 100644
--- a/support/dktools/dk-sort.c
+++ b/support/dktools/dk-sort.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-sort.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-sort.ctr
*/
/** @file dk-sort.c The dk-sort module.
@@ -95,12 +73,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4fopda.h"
#include "dk4pathd.h"
#include "dk4filed.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 69 "dk-sort.ctr"
+#line 73 "dk-sort.ctr"
@@ -149,12 +131,12 @@ dkT("--manual\t\t\t\t\t*** SHOW FULL MANUAL. ***"),
dkT("--version\t\t\t\t\tShow version information."),
dkT("--license\t\t\t\t\tShow license information."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-sort/"),
dkT(""),
NULL
-#line 121 "dk-sort.ctr"
+#line 125 "dk-sort.ctr"
};
@@ -166,7 +148,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -193,27 +176,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -287,7 +270,7 @@ dkT(""),
NULL
-#line 252 "dk-sort.ctr"
+#line 257 "dk-sort.ctr"
};
@@ -349,7 +332,7 @@ dkT("line.size"),
NULL
-#line 319 "dk-sort.ctr"
+#line 324 "dk-sort.ctr"
};
@@ -405,7 +388,7 @@ dkT("Failed to initialize text stream processing!"),
NULL
-#line 364 "dk-sort.ctr"
+#line 369 "dk-sort.ctr"
};
@@ -528,7 +511,13 @@ static int suppress_empty = 0;
/** Expected input encoding.
*/
-static int input_encoding = DK4_FILE_ENCODING_ASCII;
+static int input_encoding =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -601,8 +590,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo))
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -612,8 +602,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -622,8 +613,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -647,10 +639,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -687,14 +687,14 @@ dk_sort_delete_node(dk_sort_line_t *ptr)
{
-#line 644 "dk-sort.ctr"
+#line 666 "dk-sort.ctr"
if (NULL != ptr) {
dk4mem_release(ptr->line);
dk4mem_free(ptr);
}
-#line 649 "dk-sort.ctr"
+#line 671 "dk-sort.ctr"
}
@@ -715,7 +715,7 @@ dk_sort_new_node(dkChar *line)
dk4_im_t i; /* Evaluation integer */
-#line 668 "dk-sort.ctr"
+#line 690 "dk-sort.ctr"
/* Normalize or remove leading and trailing whitespace if required.
*/
if (NULL != line) {
@@ -804,7 +804,7 @@ dk_sort_new_node(dkChar *line)
}
-#line 755 "dk-sort.ctr"
+#line 777 "dk-sort.ctr"
return back;
}
@@ -819,7 +819,7 @@ dk_sort_is_dot_file(const dkChar *fn)
int back = 0;
-#line 768 "dk-sort.ctr"
+#line 790 "dk-sort.ctr"
ptr = fn;
while (dkT('\0') != *ptr) {
#if DK4_HAVE_BACKSLASH_AS_SEP
@@ -833,7 +833,7 @@ dk_sort_is_dot_file(const dkChar *fn)
else { fns++; }
-#line 780 "dk-sort.ctr"
+#line 802 "dk-sort.ctr"
if (dkT('.') == *fns) {
back = 1;
}
@@ -844,7 +844,7 @@ dk_sort_is_dot_file(const dkChar *fn)
#endif
-#line 789 "dk-sort.ctr"
+#line 811 "dk-sort.ctr"
return back;
}
@@ -858,7 +858,7 @@ dk_sort_is_dot_file(const dkChar *fn)
*/
static
int
-dk_sort_compare_nodes(const void *l, const void *r, int cr)
+dk_sort_compare_nodes(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
int back = 0;
dk_sort_line_t *pl;
@@ -867,7 +867,8 @@ dk_sort_compare_nodes(const void *l, const void *r, int cr)
const dkChar *fnright;
-#line 810 "dk-sort.ctr"
+#line 832 "dk-sort.ctr"
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (dk_sort_line_t *)l;
@@ -880,10 +881,10 @@ dk_sort_compare_nodes(const void *l, const void *r, int cr)
fnright = dk4str_skip(pr->line, skip_words);
if (NULL != fnleft) {
-#line 821 "dk-sort.ctr"
+#line 844 "dk-sort.ctr"
if (NULL != fnright) {
-#line 822 "dk-sort.ctr"
+#line 845 "dk-sort.ctr"
if (0 != dk4file_is_directory(fnleft, NULL)) {
if (0 == dk4file_is_directory(fnright, NULL)) {
back = -1;
@@ -1003,7 +1004,7 @@ dk_sort_compare_nodes(const void *l, const void *r, int cr)
}
}
-#line 940 "dk-sort.ctr"
+#line 963 "dk-sort.ctr"
return back;
}
@@ -1012,17 +1013,20 @@ dk_sort_compare_nodes(const void *l, const void *r, int cr)
static
int
dk_sort_line_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk_sort_line_t *nptr;
int back = DK4_TSP_RES_OK;
-#line 957 "dk-sort.ctr"
+#line 980 "dk-sort.ctr"
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
nptr = dk_sort_new_node(line);
if (NULL != nptr) {
if (0 == dk4sto_add(lsto, nptr, NULL)) {
@@ -1033,7 +1037,7 @@ dk_sort_line_handler(
}
}
-#line 966 "dk-sort.ctr"
+#line 992 "dk-sort.ctr"
return back;
}
@@ -1106,7 +1110,7 @@ dk_sort_report_errors(
{
-#line 1037 "dk-sort.ctr"
+#line 1063 "dk-sort.ctr"
if (NULL != er_en) {
switch (er_en->ec) {
case DK4_E_DECODING_FAILED : {
@@ -1154,7 +1158,7 @@ dk_sort_report_errors(
}
-#line 1083 "dk-sort.ctr"
+#line 1109 "dk-sort.ctr"
}
@@ -1177,7 +1181,7 @@ dk_sort_process_file(FILE *fipo, const dkChar *filename)
unsigned char ub;
-#line 1104 "dk-sort.ctr"
+#line 1130 "dk-sort.ctr"
dk4error_init(&er_en);
dk4error_init(&er_pr);
dk4error_init(&er);
@@ -1236,7 +1240,7 @@ dk_sort_process_file(FILE *fipo, const dkChar *filename)
}
-#line 1161 "dk-sort.ctr"
+#line 1187 "dk-sort.ctr"
}
@@ -1252,7 +1256,7 @@ dk_sort_process_stdin(void)
#endif
-#line 1175 "dk-sort.ctr"
+#line 1201 "dk-sort.ctr"
#if DK4_ON_WINDOWS
oldmode = _setmode(_fileno(stdin), _O_BINARY);
#endif
@@ -1262,7 +1266,7 @@ dk_sort_process_stdin(void)
#endif
-#line 1183 "dk-sort.ctr"
+#line 1209 "dk-sort.ctr"
}
@@ -1275,7 +1279,7 @@ dk_sort_process_one_file_name(const dkChar *fn)
int tests = DK4_FOPEN_SC_IS_REGULAR;
-#line 1194 "dk-sort.ctr"
+#line 1220 "dk-sort.ctr"
fipo = dk4fopen_app(fn, dk_sort_kwnl[4], tests, app);
if (NULL != fipo) {
dk_sort_process_file(fipo, fn);
@@ -1286,7 +1290,7 @@ dk_sort_process_one_file_name(const dkChar *fn)
}
-#line 1203 "dk-sort.ctr"
+#line 1229 "dk-sort.ctr"
}
@@ -1304,7 +1308,7 @@ dk_sort_expand_one_file_name(const dkChar *pattern)
int can_continue;
-#line 1219 "dk-sort.ctr"
+#line 1245 "dk-sort.ctr"
fne = dk4app_fne_open(pattern, app);
if (NULL != fne) {
can_continue = 1;
@@ -1352,7 +1356,7 @@ dk_sort_expand_one_file_name(const dkChar *pattern)
}
-#line 1265 "dk-sort.ctr"
+#line 1291 "dk-sort.ctr"
}
#endif
@@ -1370,7 +1374,7 @@ dk_sort_process_files(void)
int i; /* Current file index */
-#line 1281 "dk-sort.ctr"
+#line 1307 "dk-sort.ctr"
xargc = dk4app_get_argc(app);
if (0 < xargc) {
for (
@@ -1397,7 +1401,7 @@ dk_sort_process_files(void)
}
-#line 1306 "dk-sort.ctr"
+#line 1332 "dk-sort.ctr"
}
@@ -1413,7 +1417,7 @@ dk_sort_write_output(void)
int printthis;
-#line 1320 "dk-sort.ctr"
+#line 1346 "dk-sort.ctr"
if ((0 != dk_sort_can_continue()) && (EXIT_SUCCESS == exval)) {
dk4sto_it_reset(lsti);
prevtext = NULL;
@@ -1448,7 +1452,7 @@ dk_sort_write_output(void)
}
-#line 1353 "dk-sort.ctr"
+#line 1379 "dk-sort.ctr"
}
@@ -1468,7 +1472,7 @@ dk_sort_normal_run(void)
int res = 0; /* Operations result */
-#line 1371 "dk-sort.ctr"
+#line 1397 "dk-sort.ctr"
/* Process command line options
*/
if (0 != dk4app_opt_is_set_short(app, dkT('c'), NULL)) {
@@ -1590,7 +1594,7 @@ dk_sort_normal_run(void)
}
-#line 1491 "dk-sort.ctr"
+#line 1517 "dk-sort.ctr"
}
@@ -1615,7 +1619,7 @@ dk_sort_run_with_signal_handlers(void)
int success = 0;
-#line 1514 "dk-sort.ctr"
+#line 1540 "dk-sort.ctr"
#ifdef SIGPIPE
/* Set up signal handling for SIGPIPE.
*/
@@ -1718,7 +1722,7 @@ dk_sort_run_with_signal_handlers(void)
if (0 == success) { exval = EXIT_FAILURE; }
-#line 1615 "dk-sort.ctr"
+#line 1641 "dk-sort.ctr"
}
#else
#if DK4_HAVE_SIGSET
@@ -1735,7 +1739,7 @@ dk_sort_run_with_signal_handlers(void)
dk4_sig_handler_t *oldterm = NULL;
-#line 1630 "dk-sort.ctr"
+#line 1656 "dk-sort.ctr"
#ifdef SIGPIPE
oldpipe = sigset(SIGPIPE, sig_handler_pipe);
#endif
@@ -1749,7 +1753,7 @@ dk_sort_run_with_signal_handlers(void)
#endif
-#line 1642 "dk-sort.ctr"
+#line 1668 "dk-sort.ctr"
}
#else
#if DK4_HAVE_SIGNAL
@@ -1766,7 +1770,7 @@ dk_sort_run_with_signal_handlers(void)
dk4_sig_handler_t *oldterm = NULL;
-#line 1657 "dk-sort.ctr"
+#line 1683 "dk-sort.ctr"
#ifdef SIGPIPE
oldpipe = signal(SIGPIPE, sig_handler_pipe);
#endif
@@ -1780,7 +1784,7 @@ dk_sort_run_with_signal_handlers(void)
#endif
-#line 1669 "dk-sort.ctr"
+#line 1695 "dk-sort.ctr"
}
#else
/** Set signal handlers and run.
@@ -1810,10 +1814,10 @@ int main(int argc, char *argv[])
{
-#line 1697 "dk-sort.ctr"
+#line 1723 "dk-sort.ctr"
-#line 1698 "dk-sort.ctr"
+#line 1724 "dk-sort.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
@@ -1827,12 +1831,12 @@ int main(int argc, char *argv[])
if (0 != dk4app_can_run_normally(app)) {
-#line 1710 "dk-sort.ctr"
+#line 1736 "dk-sort.ctr"
dk_sort_run_with_signal_handlers();
} else {
-#line 1713 "dk-sort.ctr"
+#line 1739 "dk-sort.ctr"
if (0 != dk4app_help_version_license(app)) {
exval = EXIT_SUCCESS;
}
@@ -1846,10 +1850,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 1725 "dk-sort.ctr"
+#line 1751 "dk-sort.ctr"
-#line 1726 "dk-sort.ctr"
+#line 1752 "dk-sort.ctr"
return exval;
}
diff --git a/support/dktools/dk-sort.ctr b/support/dktools/dk-sort.ctr
index 68c89a40e9..f0bb1cfdc9 100644
--- a/support/dktools/dk-sort.ctr
+++ b/support/dktools/dk-sort.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -62,7 +62,11 @@ license = bsd
#include "dk4fopda.h"
#include "dk4pathd.h"
#include "dk4filed.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -115,7 +119,7 @@ Options:
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-sort/
$!end
};
@@ -130,7 +134,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -157,27 +162,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -483,7 +488,13 @@ static int suppress_empty = 0;
/** Expected input encoding.
*/
-static int input_encoding = DK4_FILE_ENCODING_ASCII;
+static int input_encoding =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -556,8 +567,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo))
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -567,8 +579,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -577,8 +590,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -602,10 +616,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -799,7 +821,7 @@ dk_sort_is_dot_file(const dkChar *fn)
*/
static
int
-dk_sort_compare_nodes(const void *l, const void *r, int cr)
+dk_sort_compare_nodes(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
int back = 0;
dk_sort_line_t *pl;
@@ -807,6 +829,7 @@ dk_sort_compare_nodes(const void *l, const void *r, int cr)
const dkChar *fnleft;
const dkChar *fnright;
$? "+ dk_sort_compare_nodes"
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (dk_sort_line_t *)l;
@@ -945,15 +968,18 @@ dk_sort_compare_nodes(const void *l, const void *r, int cr)
static
int
dk_sort_line_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk_sort_line_t *nptr;
int back = DK4_TSP_RES_OK;
$? "+ dk_sort_line_handler"
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
nptr = dk_sort_new_node(line);
if (NULL != nptr) {
if (0 == dk4sto_add(lsto, nptr, NULL)) {
diff --git a/support/dktools/dk-sort.rc b/support/dktools/dk-sort.rc
index 7ec023feff..c785c47715 100644
--- a/support/dktools/dk-sort.rc
+++ b/support/dktools/dk-sort.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "A sort clone, mainly intended for Windows\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "A sort clone, mainly intended for Windows\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-sort\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-sqlsplit.c b/support/dktools/dk-sqlsplit.c
index c24f0246c6..5968d7f491 100644
--- a/support/dktools/dk-sqlsplit.c
+++ b/support/dktools/dk-sqlsplit.c
@@ -1,294 +1,167 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk-sqlsplit.ctr
*/
-/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/** States for state machine find_line_end.
*/
-
-/** @defgroup dkct_state_machine_find_line_end The find_line_end state machine. */
-/**@{*/
-
-#ifndef ST_BQ
-/** State: In back-tick quoted string */
+enum {
+ /** State: In back-tick quoted string
+ */
#line 22 "dk-sqlsplit.ctr"
-#define ST_BQ 0
-#else
-#line 22 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_BQ"
-#endif
+ ST_BQ = 0,
-#ifndef ST_BQ_BS
-/** State: In back-tick quoted string after backslash */
-#line 23 "dk-sqlsplit.ctr"
-#define ST_BQ_BS 1
-#else
+ /** State: In back-tick quoted string after backslash
+ */
#line 23 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_BQ_BS"
-#endif
+ ST_BQ_BS = 1,
-#ifndef ST_CLBR
-/** State: In normal state after closing bracket */
+ /** State: In normal state after closing bracket
+ */
#line 28 "dk-sqlsplit.ctr"
-#define ST_CLBR 2
-#else
-#line 28 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_CLBR"
-#endif
+ ST_CLBR = 2,
-#ifndef ST_CLBRCO
-/** State: In normal state after closing bracket and comma */
-#line 29 "dk-sqlsplit.ctr"
-#define ST_CLBRCO 3
-#else
+ /** State: In normal state after closing bracket and comma
+ */
#line 29 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_CLBRCO"
-#endif
+ ST_CLBRCO = 3,
-#ifndef ST_CO
-/** State: In normal comment */
-#line 26 "dk-sqlsplit.ctr"
-#define ST_CO 4
-#else
+ /** State: In normal comment
+ */
#line 26 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_CO"
-#endif
+ ST_CO = 4,
-#ifndef ST_CO_AST
-/** State: In normal comment after asterisk */
-#line 27 "dk-sqlsplit.ctr"
-#define ST_CO_AST 5
-#else
+ /** State: In normal comment after asterisk
+ */
#line 27 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_CO_AST"
-#endif
+ ST_CO_AST = 5,
-#ifndef ST_DQ
-/** State: In double quotes string */
+ /** State: In double quotes string
+ */
#line 20 "dk-sqlsplit.ctr"
-#define ST_DQ 6
-#else
-#line 20 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_DQ"
-#endif
+ ST_DQ = 6,
-#ifndef ST_DQ_BS
-/** State: In double quotes string after back */
-#line 21 "dk-sqlsplit.ctr"
-#define ST_DQ_BS 7
-#else
+ /** State: In double quotes string after back
+ */
#line 21 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_DQ_BS"
-#endif
+ ST_DQ_BS = 7,
-#ifndef ST_ERROR
-/** State: Undefined state */
-#line 30 "dk-sqlsplit.ctr"
-#define ST_ERROR 8
-#else
+ /** State: Undefined state
+ */
#line 30 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_ERROR"
-#endif
+ ST_ERROR = 8,
-#ifndef ST_SL
-/** State: Normal state after slash */
-#line 24 "dk-sqlsplit.ctr"
-#define ST_SL 9
-#else
+ /** State: Normal state after slash
+ */
#line 24 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_SL"
-#endif
+ ST_SL = 9,
-#ifndef ST_SL_CO
-/** State: In double slash comment */
-#line 25 "dk-sqlsplit.ctr"
-#define ST_SL_CO 10
-#else
+ /** State: In double slash comment
+ */
#line 25 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_SL_CO"
-#endif
+ ST_SL_CO = 10,
-#ifndef ST_SQ
-/** State: In single quotes string */
-#line 18 "dk-sqlsplit.ctr"
-#define ST_SQ 11
-#else
+ /** State: In single quotes string
+ */
#line 18 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_SQ"
-#endif
+ ST_SQ = 11,
-#ifndef ST_SQ_BS
-/** State: In single quotes string after backslash */
-#line 19 "dk-sqlsplit.ctr"
-#define ST_SQ_BS 12
-#else
+ /** State: In single quotes string after backslash
+ */
#line 19 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_SQ_BS"
-#endif
+ ST_SQ_BS = 12,
-#ifndef ST_START
-/** State: Normal state */
-#line 16 "dk-sqlsplit.ctr"
-#define ST_START 13
-#else
+ /** State: Normal state
+ */
#line 16 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_START"
-#endif
+ ST_START = 13,
-#ifndef ST_START_BS
-/** State: Backslash found in normal state */
-#line 17 "dk-sqlsplit.ctr"
-#define ST_START_BS 14
-#else
+ /** State: Backslash found in normal state
+ */
#line 17 "dk-sqlsplit.ctr"
-#error "Redefinition of ST_START_BS"
-#endif
+ ST_START_BS = 14
+};
-#ifndef I_ANY
-/** State machine input: Anything else */
-#line 43 "dk-sqlsplit.ctr"
-#define I_ANY 0
-#else
+/** Inputs for state machine find_line_end.
+*/
+enum {
+ /** State machine input: Anything else
+ */
#line 43 "dk-sqlsplit.ctr"
-#error "Redefinition of I_ANY"
-#endif
+ I_ANY = 0,
-#ifndef I_AST
-/** State machine input: Asterisk */
+ /** State machine input: Asterisk
+ */
#line 38 "dk-sqlsplit.ctr"
-#define I_AST 1
-#else
-#line 38 "dk-sqlsplit.ctr"
-#error "Redefinition of I_AST"
-#endif
+ I_AST = 1,
-#ifndef I_BS
-/** State machine input: Backslash */
+ /** State machine input: Backslash
+ */
#line 36 "dk-sqlsplit.ctr"
-#define I_BS 2
-#else
-#line 36 "dk-sqlsplit.ctr"
-#error "Redefinition of I_BS"
-#endif
+ I_BS = 2,
-#ifndef I_BT
-/** State machine input: Backtick */
+ /** State machine input: Backtick
+ */
#line 41 "dk-sqlsplit.ctr"
-#define I_BT 3
-#else
-#line 41 "dk-sqlsplit.ctr"
-#error "Redefinition of I_BT"
-#endif
+ I_BT = 3,
-#ifndef I_CLBR
-/** State machine input: Closing bracket */
+ /** State machine input: Closing bracket
+ */
#line 35 "dk-sqlsplit.ctr"
-#define I_CLBR 4
-#else
-#line 35 "dk-sqlsplit.ctr"
-#error "Redefinition of I_CLBR"
-#endif
+ I_CLBR = 4,
-#ifndef I_COMMA
-/** State machine input: Comma */
+ /** State machine input: Comma
+ */
#line 42 "dk-sqlsplit.ctr"
-#define I_COMMA 5
-#else
-#line 42 "dk-sqlsplit.ctr"
-#error "Redefinition of I_COMMA"
-#endif
+ I_COMMA = 5,
-#ifndef I_DQ
-/** State machine input: Double quote */
+ /** State machine input: Double quote
+ */
#line 40 "dk-sqlsplit.ctr"
-#define I_DQ 6
-#else
-#line 40 "dk-sqlsplit.ctr"
-#error "Redefinition of I_DQ"
-#endif
+ I_DQ = 6,
-#ifndef I_NL
-/** State machine input: Newline */
+ /** State machine input: Newline
+ */
#line 33 "dk-sqlsplit.ctr"
-#define I_NL 7
-#else
-#line 33 "dk-sqlsplit.ctr"
-#error "Redefinition of I_NL"
-#endif
+ I_NL = 7,
-#ifndef I_OPBR
-/** State machine input: Opening bracket */
+ /** State machine input: Opening bracket
+ */
#line 34 "dk-sqlsplit.ctr"
-#define I_OPBR 8
-#else
-#line 34 "dk-sqlsplit.ctr"
-#error "Redefinition of I_OPBR"
-#endif
+ I_OPBR = 8,
-#ifndef I_SL
-/** State machine input: Slash */
+ /** State machine input: Slash
+ */
#line 37 "dk-sqlsplit.ctr"
-#define I_SL 9
-#else
-#line 37 "dk-sqlsplit.ctr"
-#error "Redefinition of I_SL"
-#endif
+ I_SL = 9,
-#ifndef I_SQ
-/** State machine input: Single quote */
+ /** State machine input: Single quote
+ */
#line 39 "dk-sqlsplit.ctr"
-#define I_SQ 10
-#else
-#line 39 "dk-sqlsplit.ctr"
-#error "Redefinition of I_SQ"
-#endif
+ I_SQ = 10
+};
-#ifndef O_NL
-/** State machine output: Print newline and character */
-#line 47 "dk-sqlsplit.ctr"
-#define O_NL 0
-#else
+/** Outputs for state machine find_line_end.
+*/
+enum {
+ /** State machine output: Print newline and character
+ */
#line 47 "dk-sqlsplit.ctr"
-#error "Redefinition of O_NL"
-#endif
+ O_NL = 0,
-#ifndef O_NORMAL
-/** State machine output: Print character */
-#line 46 "dk-sqlsplit.ctr"
-#define O_NORMAL 1
-#else
+ /** State machine output: Print character
+ */
#line 46 "dk-sqlsplit.ctr"
-#error "Redefinition of O_NORMAL"
-#endif
-
-/**@}*/
+ O_NORMAL = 1
+};
/** Reset find_line_end state machine.
@param st Pointer to state variable.
@@ -544,6 +417,9 @@ find_line_end_step(int *st, int in)
#include "dk4pathd.h"
#endif
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
/** Default help text, shown if help file is not found.
*/
@@ -559,12 +435,12 @@ dkT("--manual\t*** SHOW FULL MANUAL. ***"),
dkT("--version\tShow version information."),
dkT("--license\tShow license information."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-sqlsplit/"),
dkT(""),
NULL
-#line 178 "dk-sqlsplit.ctr"
+#line 181 "dk-sqlsplit.ctr"
};
@@ -576,7 +452,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -603,27 +480,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -697,7 +574,7 @@ dkT(""),
NULL
-#line 309 "dk-sqlsplit.ctr"
+#line 313 "dk-sqlsplit.ctr"
};
@@ -720,7 +597,7 @@ dkT("\\"),
NULL
-#line 334 "dk-sqlsplit.ctr"
+#line 338 "dk-sqlsplit.ctr"
};
@@ -923,10 +800,10 @@ int main(int argc, char *argv[])
int i;
-#line 535 "dk-sqlsplit.ctr"
+#line 539 "dk-sqlsplit.ctr"
-#line 536 "dk-sqlsplit.ctr"
+#line 540 "dk-sqlsplit.ctr"
app = dk4app_open_cmd(
argc, argv, NULL, 0, kwnl[0], DKT_VERSION_DK,
@@ -950,7 +827,7 @@ int main(int argc, char *argv[])
#endif
} else {
-#line 558 "dk-sqlsplit.ctr"
+#line 562 "dk-sqlsplit.ctr"
/* BUG: Should not happen */
}
}
@@ -973,10 +850,10 @@ int main(int argc, char *argv[])
}
-#line 579 "dk-sqlsplit.ctr"
+#line 583 "dk-sqlsplit.ctr"
-#line 580 "dk-sqlsplit.ctr"
+#line 584 "dk-sqlsplit.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-sqlsplit.ctr b/support/dktools/dk-sqlsplit.ctr
index 81463eea94..3af4e53dde 100644
--- a/support/dktools/dk-sqlsplit.ctr
+++ b/support/dktools/dk-sqlsplit.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -156,6 +156,9 @@ ST_CLBRCO * ST_START O_NORMAL
#include "dk4pathd.h"
#endif
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
/** Default help text, shown if help file is not found.
*/
@@ -172,7 +175,7 @@ Options:
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-sqlsplit/
$!end
};
@@ -187,7 +190,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -214,27 +218,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
diff --git a/support/dktools/dk-sqlsplit.rc b/support/dktools/dk-sqlsplit.rc
index 955c266208..c3bb626746 100644
--- a/support/dktools/dk-sqlsplit.rc
+++ b/support/dktools/dk-sqlsplit.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Split overlong SQL lines\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Split overlong SQL lines\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-sqlsplit\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-t2db.c b/support/dktools/dk-t2db.c
index 8f8d6b66c8..7f20e640ce 100644
--- a/support/dktools/dk-t2db.c
+++ b/support/dktools/dk-t2db.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-t2db.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-t2db.ctr
*/
/** @file dk-t2db.c The dk-t2db module.
@@ -120,12 +98,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maodd.h"
#include "dk4mpl.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 96 "dk-t2db.ctr"
+#line 100 "dk-t2db.ctr"
@@ -152,7 +134,7 @@ dkT(""),
NULL
-#line 121 "dk-t2db.ctr"
+#line 125 "dk-t2db.ctr"
};
@@ -164,7 +146,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -191,27 +174,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
dkT(""),
dkT(""),
@@ -424,7 +407,7 @@ dkT("bzip2/libbzip2 version 1.0.5 of 10 December 2007"),
NULL
-#line 391 "dk-t2db.ctr"
+#line 396 "dk-t2db.ctr"
};
@@ -477,7 +460,7 @@ dkT("\\"),
NULL
-#line 445 "dk-t2db.ctr"
+#line 450 "dk-t2db.ctr"
};
@@ -582,7 +565,7 @@ dkT("Aborted by signal!"),
NULL
-#line 531 "dk-t2db.ctr"
+#line 536 "dk-t2db.ctr"
};
@@ -684,14 +667,25 @@ static int trunc = 1;
/** Expected encoding when processing an input file.
*/
-static int efe = DK4_FILE_ENCODING_ASCII;
+static int efe =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Expected encoding when processing standard input.
*/
-static int ese = DK4_FILE_ENCODING_ASCII;
-
+static int ese =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Number of decoding errors already occured.
@@ -750,8 +744,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -762,8 +757,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -830,11 +826,12 @@ dk_t2db_remove_crnl(dkChar *lptr)
- DK4_TSP_RES_ERROR on errors we can recover from,
- DK4_TSP_RES_FATAL on errors requiring to abort processing.
*/
+static
int
dk_t2db_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
+ dk4_um_t DK4_ARG_UNUSED(lineno),
dk4_er_t *erp
)
{
@@ -846,23 +843,24 @@ dk_t2db_line_handler(
int must = 1; /* Must process line */
-#line 793 "dk-t2db.ctr"
+#line 812 "dk-t2db.ctr"
+ DK4_UNUSED_ARG(lineno)
p1 = dk4str_start(line, NULL);
if (NULL != p1) {
-#line 795 "dk-t2db.ctr"
+#line 815 "dk-t2db.ctr"
if (NULL != comment) {
-#line 796 "dk-t2db.ctr"
+#line 816 "dk-t2db.ctr"
if (*comment == *p1) {
must = 0;
-#line 798 "dk-t2db.ctr"
+#line 818 "dk-t2db.ctr"
}
#if TRACE_DEBUG
else {
-#line 801 "dk-t2db.ctr"
+#line 821 "dk-t2db.ctr"
}
#endif
}
@@ -874,12 +872,12 @@ dk_t2db_line_handler(
p2 = dk4str_next(p1, NULL);
if (NULL != p2) {
-#line 811 "dk-t2db.ctr"
+#line 831 "dk-t2db.ctr"
/* Add or change entry */
if (0 == dk4dbi_text_set(dbiptr, p1, p2, &er)) {
dk4error_copy(erp, &er);
-#line 814 "dk-t2db.ctr"
+#line 834 "dk-t2db.ctr"
back = DK4_TSP_RES_ERROR;
exval = EXIT_FAILURE;
dk4app_log_5(
@@ -888,12 +886,12 @@ dk_t2db_line_handler(
}
} else {
-#line 821 "dk-t2db.ctr"
+#line 841 "dk-t2db.ctr"
/* Delete entry */
if (0 == dk4dbi_text_del(dbiptr, p1, &er)) {
dk4error_copy(erp, &er);
-#line 824 "dk-t2db.ctr"
+#line 844 "dk-t2db.ctr"
back = DK4_TSP_RES_ERROR;
exval = EXIT_FAILURE;
dk4app_log_3(
@@ -905,7 +903,7 @@ dk_t2db_line_handler(
}
-#line 834 "dk-t2db.ctr"
+#line 854 "dk-t2db.ctr"
return back;
}
@@ -1037,7 +1035,6 @@ dk_t2db_report_errors(dk4_er_t *er_en, dk4_er_t *er_pr)
/** Process one input file.
@param dbiptr Database to modify.
@param infile Input file to process, must be in binary mode.
- @param filename File name of input file.
@param eie Expected input encoding.
*/
static
@@ -1045,7 +1042,6 @@ void
dk_t2db_run_for_file(
dk4_dbi_t *dbiptr,
FILE *infile,
- const dkChar *filename,
int eie
)
{
@@ -1173,7 +1169,7 @@ dk_t2db_process_name(dk4_dbi_t *dbiptr, const dkChar *filename)
buf, dk_t2db_kwnl[7], DK4_FOPEN_SC_IS_REGULAR, app
);
if (NULL != fipo) {
- dk_t2db_run_for_file(dbiptr, fipo, buf, efe);
+ dk_t2db_run_for_file(dbiptr, fipo, efe);
fclose(fipo);
} else {
exval = EXIT_FAILURE;
@@ -1207,7 +1203,7 @@ dk_t2db_process_name(dk4_dbi_t *dbiptr, const dkChar *filename)
expfn, dk_t2db_kwnl[7], DK4_FOPEN_SC_IS_REGULAR, app
);
if (NULL != fipo) {
- dk_t2db_run_for_file(dbiptr, fipo, expfn, efe);
+ dk_t2db_run_for_file(dbiptr, fipo, efe);
fclose(fipo);
} else {
exval = EXIT_FAILURE;
@@ -1238,7 +1234,7 @@ dk_t2db_process_name(dk4_dbi_t *dbiptr, const dkChar *filename)
filename, dk_t2db_kwnl[7], DK4_FOPEN_SC_IS_REGULAR, app
);
if (NULL != fipo) {
- dk_t2db_run_for_file(dbiptr, fipo, filename, efe);
+ dk_t2db_run_for_file(dbiptr, fipo, efe);
fclose(fipo);
} else {
exval = EXIT_FAILURE;
@@ -1273,7 +1269,7 @@ dk_t2db_run_with_dbi(dk4_dbi_t *dbiptr)
#if DK4_ON_WINDOWS
oldmode = _setmode(_fileno(stdin), _O_BINARY);
#endif
- dk_t2db_run_for_file(dbiptr, stdin, dk_t2db_msg[2], ese);
+ dk_t2db_run_for_file(dbiptr, stdin, ese);
#if DK4_ON_WINDOWS
_setmode(_fileno(stdin), oldmode);
#endif
@@ -1322,9 +1318,12 @@ dk_t2db_normal_run(void)
dk4_er_t er;
const dkChar *oaptr;
size_t i;
- int enc = DK4_FILE_ENCODING_ASCII;
+ int enc = DK4_FILE_ENCODING_PLAIN;
int bom = 0;
+#if DK4_ON_WINDOWS
+ enc = DK4_FILE_ENCODING_WIN1252;
+#endif
/* Check cmd line arguments, must have at least a database name.
*/
if (0 == dk4app_get_argc(app)) {
@@ -1383,19 +1382,19 @@ dk_t2db_normal_run(void)
if (0 != dk4app_opt_is_set_short(app, dkT('c'), NULL)) {
-#line 1310 "dk-t2db.ctr"
+#line 1331 "dk-t2db.ctr"
oaptr = dk4app_opt_get_string_ptr_short(app, dkT('c'), NULL);
if (NULL != oaptr) {
-#line 1312 "dk-t2db.ctr"
+#line 1333 "dk-t2db.ctr"
comment = oaptr;
-#line 1313 "dk-t2db.ctr"
+#line 1334 "dk-t2db.ctr"
}
#if TRACE_DEBUG
else {
-#line 1316 "dk-t2db.ctr"
+#line 1337 "dk-t2db.ctr"
}
#endif
}
@@ -1579,10 +1578,10 @@ int main(int argc, char *argv[])
{
-#line 1498 "dk-t2db.ctr"
+#line 1519 "dk-t2db.ctr"
-#line 1499 "dk-t2db.ctr"
+#line 1520 "dk-t2db.ctr"
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
argc, argv,
@@ -1620,10 +1619,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stderr();
-#line 1535 "dk-t2db.ctr"
+#line 1556 "dk-t2db.ctr"
-#line 1536 "dk-t2db.ctr"
+#line 1557 "dk-t2db.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-t2db.ctr b/support/dktools/dk-t2db.ctr
index ab13c0e9e5..703ba5cd2a 100644
--- a/support/dktools/dk-t2db.ctr
+++ b/support/dktools/dk-t2db.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -89,7 +89,11 @@ license = bsd
#include "dk4maodd.h"
#include "dk4mpl.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -130,7 +134,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -157,27 +162,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
@@ -629,14 +634,25 @@ static int trunc = 1;
/** Expected encoding when processing an input file.
*/
-static int efe = DK4_FILE_ENCODING_ASCII;
+static int efe =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Expected encoding when processing standard input.
*/
-static int ese = DK4_FILE_ENCODING_ASCII;
-
+static int ese =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Number of decoding errors already occured.
@@ -695,8 +711,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -707,8 +724,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -775,11 +793,12 @@ dk_t2db_remove_crnl(dkChar *lptr)
- DK4_TSP_RES_ERROR on errors we can recover from,
- DK4_TSP_RES_FATAL on errors requiring to abort processing.
*/
+static
int
dk_t2db_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
+ dk4_um_t DK4_ARG_UNUSED(lineno),
dk4_er_t *erp
)
{
@@ -790,6 +809,7 @@ dk_t2db_line_handler(
int back = DK4_TSP_RES_OK;
int must = 1; /* Must process line */
$? "+ dk_t2db_line_handler \"%!ds\"", line
+ DK4_UNUSED_ARG(lineno)
p1 = dk4str_start(line, NULL);
if (NULL != p1) { $? ". have text"
if (NULL != comment) { $? ". have comment \"%!ds\"", comment
@@ -962,7 +982,6 @@ dk_t2db_report_errors(dk4_er_t *er_en, dk4_er_t *er_pr)
/** Process one input file.
@param dbiptr Database to modify.
@param infile Input file to process, must be in binary mode.
- @param filename File name of input file.
@param eie Expected input encoding.
*/
static
@@ -970,7 +989,6 @@ void
dk_t2db_run_for_file(
dk4_dbi_t *dbiptr,
FILE *infile,
- const dkChar *filename,
int eie
)
{
@@ -1098,7 +1116,7 @@ dk_t2db_process_name(dk4_dbi_t *dbiptr, const dkChar *filename)
buf, dk_t2db_kwnl[7], DK4_FOPEN_SC_IS_REGULAR, app
);
if (NULL != fipo) {
- dk_t2db_run_for_file(dbiptr, fipo, buf, efe);
+ dk_t2db_run_for_file(dbiptr, fipo, efe);
fclose(fipo);
} else {
exval = EXIT_FAILURE;
@@ -1132,7 +1150,7 @@ dk_t2db_process_name(dk4_dbi_t *dbiptr, const dkChar *filename)
expfn, dk_t2db_kwnl[7], DK4_FOPEN_SC_IS_REGULAR, app
);
if (NULL != fipo) {
- dk_t2db_run_for_file(dbiptr, fipo, expfn, efe);
+ dk_t2db_run_for_file(dbiptr, fipo, efe);
fclose(fipo);
} else {
exval = EXIT_FAILURE;
@@ -1163,7 +1181,7 @@ dk_t2db_process_name(dk4_dbi_t *dbiptr, const dkChar *filename)
filename, dk_t2db_kwnl[7], DK4_FOPEN_SC_IS_REGULAR, app
);
if (NULL != fipo) {
- dk_t2db_run_for_file(dbiptr, fipo, filename, efe);
+ dk_t2db_run_for_file(dbiptr, fipo, efe);
fclose(fipo);
} else {
exval = EXIT_FAILURE;
@@ -1198,7 +1216,7 @@ dk_t2db_run_with_dbi(dk4_dbi_t *dbiptr)
#if DK4_ON_WINDOWS
oldmode = _setmode(_fileno(stdin), _O_BINARY);
#endif
- dk_t2db_run_for_file(dbiptr, stdin, dk_t2db_msg[2], ese);
+ dk_t2db_run_for_file(dbiptr, stdin, ese);
#if DK4_ON_WINDOWS
_setmode(_fileno(stdin), oldmode);
#endif
@@ -1247,9 +1265,12 @@ dk_t2db_normal_run(void)
dk4_er_t er;
const dkChar *oaptr;
size_t i;
- int enc = DK4_FILE_ENCODING_ASCII;
+ int enc = DK4_FILE_ENCODING_PLAIN;
int bom = 0;
+#if DK4_ON_WINDOWS
+ enc = DK4_FILE_ENCODING_WIN1252;
+#endif
/* Check cmd line arguments, must have at least a database name.
*/
if (0 == dk4app_get_argc(app)) {
diff --git a/support/dktools/dk-t2db.rc b/support/dktools/dk-t2db.rc
index e865f1a107..041d031ad9 100644
--- a/support/dktools/dk-t2db.rc
+++ b/support/dktools/dk-t2db.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Convert text to simple text database\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Convert text to simple text database\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-t2db\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-t2h.c b/support/dktools/dk-t2h.c
index 89c0b64e03..b5e2f81146 100644
--- a/support/dktools/dk-t2h.c
+++ b/support/dktools/dk-t2h.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-t2h.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-t2h.ctr
*/
@@ -124,12 +102,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mpl.h"
#include "dk4strd.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 102 "dk-t2h.ctr"
+#line 106 "dk-t2h.ctr"
@@ -154,12 +136,12 @@ dkT("--manual\t\t\t\t\t*** SHOW FULL MANUAL. ***"),
dkT("--version\t\t\t\t\tShow version information."),
dkT("--license\t\t\t\t\tShow license information."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-t2h/"),
dkT(""),
NULL
-#line 130 "dk-t2h.ctr"
+#line 134 "dk-t2h.ctr"
};
@@ -172,7 +154,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -199,27 +182,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -293,7 +276,7 @@ dkT(""),
NULL
-#line 262 "dk-t2h.ctr"
+#line 267 "dk-t2h.ctr"
};
@@ -325,7 +308,7 @@ dkT("verbose"),
NULL
-#line 299 "dk-t2h.ctr"
+#line 304 "dk-t2h.ctr"
};
@@ -417,7 +400,7 @@ dkT("Further processing failures!"),
NULL
-#line 374 "dk-t2h.ctr"
+#line 379 "dk-t2h.ctr"
};
@@ -435,7 +418,7 @@ static const char * const dk_t2h_kw8[] = {
"<head>\n",
/* 3 */
-"<meta name=\"generator\" content=\"dk-t2h, see http://dktools.sourceforge.net\">\n",
+"<meta name=\"generator\" content=\"dk-t2h, see http://sourceforge.net/p/dktools/wiki/dk-t2h/\">\n",
/* 4 */
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\">\n",
@@ -569,7 +552,7 @@ static const char * const dk_t2h_kw8[] = {
NULL
-#line 457 "dk-t2h.ctr"
+#line 462 "dk-t2h.ctr"
};
@@ -924,13 +907,25 @@ static int dk_t2h_code = 0;
/** Input encoding expected when processing stdin.
*/
-static int dk_t2h_i_std = DK4_FILE_ENCODING_ASCII;
+static int dk_t2h_i_std =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Input encoding expected when processing files.
*/
-static int dk_t2h_i_file = DK4_FILE_ENCODING_ASCII;
+static int dk_t2h_i_file =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -1016,8 +1011,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -1027,8 +1023,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -1037,8 +1034,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -1062,10 +1060,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -1119,7 +1125,7 @@ dk_t2h_process_options(void)
}
} else {
-#line 1005 "dk-t2h.ctr"
+#line 1033 "dk-t2h.ctr"
/* ERROR: Failed to obtain option argument, bug! */
}
}
@@ -1168,16 +1174,16 @@ dk_t2h_c32_after_cr_nl_check(
int done = 0;
-#line 1052 "dk-t2h.ctr"
+#line 1080 "dk-t2h.ctr"
if (dkC32(0x0A) == c) {
-#line 1053 "dk-t2h.ctr"
+#line 1081 "dk-t2h.ctr"
/*
Newline, finish line and write newline to output.
*/
if (0 != dk_t2h_code) {
-#line 1057 "dk-t2h.ctr"
+#line 1085 "dk-t2h.ctr"
if (0 == dk_t2h_lhtx) {
if (EOF == fputs(dk_t2h_kw8[42], stdout)) { output_error = 1; }
res = dk4ma_write_c8_decimal_unsigned(
@@ -1195,26 +1201,26 @@ dk_t2h_c32_after_cr_nl_check(
}
if (0 != dk_t2h_lhtx) {
-#line 1073 "dk-t2h.ctr"
+#line 1101 "dk-t2h.ctr"
if (EOF == fputs(dk_t2h_kw8[44], stdout)) { output_error = 1; }
} else {
-#line 1075 "dk-t2h.ctr"
+#line 1103 "dk-t2h.ctr"
}
} else {
-#line 1077 "dk-t2h.ctr"
+#line 1105 "dk-t2h.ctr"
}
if (EOF == fputc('\n', stdout)) { output_error = 1; }
} else {
-#line 1080 "dk-t2h.ctr"
+#line 1108 "dk-t2h.ctr"
if (0 != dk_t2h_code) {
-#line 1081 "dk-t2h.ctr"
+#line 1109 "dk-t2h.ctr"
if (0 == dk_t2h_lhtx) {
-#line 1082 "dk-t2h.ctr"
+#line 1110 "dk-t2h.ctr"
/*
Start new line.
*/
@@ -1233,11 +1239,11 @@ dk_t2h_c32_after_cr_nl_check(
dk_t2h_lhtx = 1;
} else {
-#line 1099 "dk-t2h.ctr"
+#line 1127 "dk-t2h.ctr"
}
} else {
-#line 1101 "dk-t2h.ctr"
+#line 1129 "dk-t2h.ctr"
}
/*
Write character to output.
@@ -1272,7 +1278,7 @@ dk_t2h_c32_after_cr_nl_check(
}
}
-#line 1134 "dk-t2h.ctr"
+#line 1162 "dk-t2h.ctr"
return back;
}
@@ -1457,7 +1463,7 @@ dk_t2h_output_dkstring(const dkChar *str)
case DK4_FILE_ENCODING_UTF8 : {
dk_t2h_output_utf8(str);
} break;
- case DK4_FILE_ENCODING_ANSI : {
+ case DK4_FILE_ENCODING_WIN1252 : {
dk_t2h_output_ansi(str);
} break;
default : {
@@ -1522,7 +1528,7 @@ dk_t2h_output_start_file(void)
{
-#line 1382 "dk-t2h.ctr"
+#line 1410 "dk-t2h.ctr"
/* No errors in this file yet.
*/
dk_t2h_dec_err = 0;
@@ -1535,20 +1541,20 @@ dk_t2h_output_start_file(void)
dk4app_set_log_source_line(app, dk_t2h_lineno);
if (0 != dk_t2h_full) {
-#line 1393 "dk-t2h.ctr"
+#line 1421 "dk-t2h.ctr"
if (0 != dk_t2h_code) {
-#line 1394 "dk-t2h.ctr"
+#line 1422 "dk-t2h.ctr"
if (EOF == fputs(dk_t2h_kw8[40], stdout)) { output_error = 1; }
} else {
-#line 1396 "dk-t2h.ctr"
+#line 1424 "dk-t2h.ctr"
if (EOF == fputs(dk_t2h_kw8[38], stdout)) { output_error = 1; }
}
}
-#line 1400 "dk-t2h.ctr"
+#line 1428 "dk-t2h.ctr"
}
@@ -1561,23 +1567,23 @@ dk_t2h_output_finish_file(void)
{
-#line 1411 "dk-t2h.ctr"
+#line 1439 "dk-t2h.ctr"
if (0 != dk_t2h_full) {
-#line 1412 "dk-t2h.ctr"
+#line 1440 "dk-t2h.ctr"
if (0 != dk_t2h_code) {
-#line 1413 "dk-t2h.ctr"
+#line 1441 "dk-t2h.ctr"
if (EOF == fputs(dk_t2h_kw8[41], stdout)) { output_error = 1; }
} else {
-#line 1415 "dk-t2h.ctr"
+#line 1443 "dk-t2h.ctr"
if (EOF == fputs(dk_t2h_kw8[39], stdout)) { output_error = 1; }
}
}
-#line 1419 "dk-t2h.ctr"
+#line 1447 "dk-t2h.ctr"
}
@@ -1596,13 +1602,17 @@ dk_t2h_output_finish_file(void)
static
int
dk_t2h_c32_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
+
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
if (dkC32(0x0A) == c) {
/*
For a newline clear CR and TXT flag, set NL flag.
@@ -2261,19 +2271,35 @@ int wmain(int argc, wchar_t *argv[])
int main(int argc, char *argv[])
#endif
{
+ int silent = 0;
int shp;
-#line 2104 "dk-t2h.ctr"
+#line 2137 "dk-t2h.ctr"
-#line 2105 "dk-t2h.ctr"
+#line 2138 "dk-t2h.ctr"
+#if DK4_CHAR_SIZE > 1
+ if (NULL != getenv("VIM")) { silent = 1; }
+ if (NULL != getenv("VIMRUNTIME")) { silent = 1; }
+#endif
+#if 0
dk4fput_initialize_stderr();
- app = dk4app_open_cmd(
- argc, argv, dk_t2h_options, dk_t2h_sz_options,
- dk_t2h_kwnl[0], DKT_VERSION_DK,
- dk_t2h_kwnl[1], dk_t2h_help_text, dk_t2h_license_text
- );
+#endif
+ if (0 != silent) {
+ app = dk4app_open_silent(
+ argc, argv, dk_t2h_options, dk_t2h_sz_options,
+ dk_t2h_kwnl[0], DKT_VERSION_DK,
+ dk_t2h_kwnl[1], dk_t2h_help_text, dk_t2h_license_text
+ );
+ }
+ else {
+ app = dk4app_open_cmd(
+ argc, argv, dk_t2h_options, dk_t2h_sz_options,
+ dk_t2h_kwnl[0], DKT_VERSION_DK,
+ dk_t2h_kwnl[1], dk_t2h_help_text, dk_t2h_license_text
+ );
+ }
if (NULL != app) {
dk_t2h_i_std = dk4app_get_stdin_encoding(app);
dk_t2h_i_file = dk4app_get_file_in_encoding(app);
@@ -2328,14 +2354,16 @@ int main(int argc, char *argv[])
if (0 != sig_read_atomic(&sig_had_pipe)) { exval = EXIT_FAILURE; }
#endif
if (0 != output_error) { exval = EXIT_FAILURE; }
- fflush(stderr);
- dk4fput_cleanup_stderr();
+ if (0 == silent) {
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ }
-#line 2168 "dk-t2h.ctr"
+#line 2218 "dk-t2h.ctr"
-#line 2169 "dk-t2h.ctr"
+#line 2219 "dk-t2h.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-t2h.ctr b/support/dktools/dk-t2h.ctr
index e49df93963..b4af8553a8 100644
--- a/support/dktools/dk-t2h.ctr
+++ b/support/dktools/dk-t2h.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -95,7 +95,11 @@ license = bsd
#include "dk4mpl.h"
#include "dk4strd.h"
#include "dk4pathd.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -124,7 +128,7 @@ Options:
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-t2h/
$!end
};
@@ -140,7 +144,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -167,27 +172,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -385,7 +390,7 @@ $!string-table
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n
<html>\n
<head>\n
-<meta name="generator" content="dk-t2h, see http://dktools.sourceforge.net">\n
+<meta name="generator" content="dk-t2h, see http://sourceforge.net/p/dktools/wiki/dk-t2h/">\n
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">\n
#
# 5 Title line
@@ -808,13 +813,25 @@ static int dk_t2h_code = 0;
/** Input encoding expected when processing stdin.
*/
-static int dk_t2h_i_std = DK4_FILE_ENCODING_ASCII;
+static int dk_t2h_i_std =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Input encoding expected when processing files.
*/
-static int dk_t2h_i_file = DK4_FILE_ENCODING_ASCII;
+static int dk_t2h_i_file =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -900,8 +917,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -911,8 +929,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -921,8 +940,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -946,10 +966,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -1315,7 +1343,7 @@ dk_t2h_output_dkstring(const dkChar *str)
case DK4_FILE_ENCODING_UTF8 : {
dk_t2h_output_utf8(str);
} break;
- case DK4_FILE_ENCODING_ANSI : {
+ case DK4_FILE_ENCODING_WIN1252 : {
dk_t2h_output_ansi(str);
} break;
default : {
@@ -1434,13 +1462,17 @@ dk_t2h_output_finish_file(void)
static
int
dk_t2h_c32_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
+
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
if (dkC32(0x0A) == c) {
/*
For a newline clear CR and TXT flag, set NL flag.
@@ -2099,15 +2131,31 @@ int wmain(int argc, wchar_t *argv[])
int main(int argc, char *argv[])
#endif
{
+ int silent = 0;
int shp;
$!trace-init dk-t2h.deb
$? "+ main"
+#if DK4_CHAR_SIZE > 1
+ if (NULL != getenv("VIM")) { silent = 1; }
+ if (NULL != getenv("VIMRUNTIME")) { silent = 1; }
+#endif
+#if 0
dk4fput_initialize_stderr();
- app = dk4app_open_cmd(
- argc, argv, dk_t2h_options, dk_t2h_sz_options,
- dk_t2h_kwnl[0], DKT_VERSION_DK,
- dk_t2h_kwnl[1], dk_t2h_help_text, dk_t2h_license_text
- );
+#endif
+ if (0 != silent) {
+ app = dk4app_open_silent(
+ argc, argv, dk_t2h_options, dk_t2h_sz_options,
+ dk_t2h_kwnl[0], DKT_VERSION_DK,
+ dk_t2h_kwnl[1], dk_t2h_help_text, dk_t2h_license_text
+ );
+ }
+ else {
+ app = dk4app_open_cmd(
+ argc, argv, dk_t2h_options, dk_t2h_sz_options,
+ dk_t2h_kwnl[0], DKT_VERSION_DK,
+ dk_t2h_kwnl[1], dk_t2h_help_text, dk_t2h_license_text
+ );
+ }
if (NULL != app) {
dk_t2h_i_std = dk4app_get_stdin_encoding(app);
dk_t2h_i_file = dk4app_get_file_in_encoding(app);
@@ -2162,8 +2210,10 @@ int main(int argc, char *argv[])
if (0 != sig_read_atomic(&sig_had_pipe)) { exval = EXIT_FAILURE; }
#endif
if (0 != output_error) { exval = EXIT_FAILURE; }
- fflush(stderr);
- dk4fput_cleanup_stderr();
+ if (0 == silent) {
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ }
$? "- main %d", exval
$!trace-end
exit(exval); return exval;
diff --git a/support/dktools/dk-t2h.rc b/support/dktools/dk-t2h.rc
index e95fbd358a..21c354f114 100644
--- a/support/dktools/dk-t2h.rc
+++ b/support/dktools/dk-t2h.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Text to HTML converter\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Text to HTML converter\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-t2h\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-t2l.c b/support/dktools/dk-t2l.c
index 52ae36a00e..c064ca8124 100644
--- a/support/dktools/dk-t2l.c
+++ b/support/dktools/dk-t2l.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-t2l.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-t2l.ctr
*/
@@ -111,6 +89,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4vers.h"
#include "dk4tsp32.h"
#include "dk4uc2l.h"
+#include "dk4uc2la.h"
#include "dk4maidhdu.h"
#include "dk4maidddu.h"
#include "dk4maodh.h"
@@ -118,6 +97,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mpl.h"
#include "dk4strd.h"
#include "dk4pathd.h"
+#include "dk4strm.h"
+#include "dk4strmf.h"
+#include "dk4strmo32.h"
+
+
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE == 2
@@ -127,12 +111,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4ansi.h"
#include "dk4utf8.h"
#endif
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 105 "dk-t2l.ctr"
+#line 115 "dk-t2l.ctr"
@@ -156,18 +144,19 @@ dkT("-l\t\t--line-feed\t\t\tWrite \\\\ sequence for newline."),
dkT("-t\t\t--tabulator\t\t\tWrite LaTeX sequence for"),
dkT("\t\t\t\t\t\ttabulators"),
dkT("\t\t--verbose\t\t\tShow error message on SIGPIPE."),
+dkT("\t\t--check\t\t\t\tSyntax check for all data files."),
dkT(""),
dkT("--help\t\t\t\t\t\tShow this short help text."),
dkT("--manual\t\t\t\t\t*** SHOW FULL MANUAL. ***"),
dkT("--version\t\t\t\t\tShow version information."),
dkT("--license\t\t\t\t\tShow license information."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-t2l/"),
dkT(""),
NULL
-#line 138 "dk-t2l.ctr"
+#line 149 "dk-t2l.ctr"
};
@@ -180,7 +169,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -207,27 +197,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -301,7 +291,7 @@ dkT(""),
NULL
-#line 270 "dk-t2l.ctr"
+#line 282 "dk-t2l.ctr"
};
@@ -321,7 +311,7 @@ static const char * const dk_t2l_kw8[] = {
NULL
-#line 288 "dk-t2l.ctr"
+#line 300 "dk-t2l.ctr"
};
@@ -350,10 +340,13 @@ dkT("\\"),
/* 6 */
dkT("verbose"),
+/* 7 */
+dkT("check"),
+
NULL
-#line 325 "dk-t2l.ctr"
+#line 341 "dk-t2l.ctr"
};
@@ -460,7 +453,7 @@ dkT("\"!"),
NULL
-#line 405 "dk-t2l.ctr"
+#line 421 "dk-t2l.ctr"
};
@@ -483,7 +476,7 @@ static const dk4_option_specification_t dk_t2l_options[] = {
/* Command line arguments are hexadecimal character numbers.
*/
- { dkT('x'), dkT("hex"), DK4_OPT_ARG_NONE },
+ { dkT('h'), dkT("hex"), DK4_OPT_ARG_NONE },
/* Write recommendations about font encodings and packages.
*/
@@ -499,7 +492,11 @@ static const dk4_option_specification_t dk_t2l_options[] = {
/* Verbose output.
*/
- { dkT('\0'), dkT("verbose"), DK4_OPT_ARG_NONE }
+ { dkT('\0'), dkT("verbose"), DK4_OPT_ARG_NONE },
+
+ /* Immediately load all data files for syntax check.
+ */
+ { dkT('\0'), dkT("check"), DK4_OPT_ARG_NONE }
};
@@ -576,13 +573,25 @@ static int dk_t2l_numeric = 0;
/** Input encoding expected when processing stdin.
*/
-static int dk_t2l_i_std = DK4_FILE_ENCODING_ASCII;
+static int dk_t2l_i_std =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Input encoding expected when processing files.
*/
-static int dk_t2l_i_file = DK4_FILE_ENCODING_ASCII;
+static int dk_t2l_i_file =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -639,6 +648,11 @@ static int dk_t2l_tabs = 0;
static int dk_t2l_linef = 0;
+/** Flag: Syntax check on all data files.
+*/
+static int dk_t2l_synchk = 0;
+
+
#ifdef SIGPIPE
/** Indicator: SIGPIPE signal received.
@@ -685,8 +699,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -696,8 +711,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -706,8 +722,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -731,10 +748,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -795,7 +820,7 @@ dk_t2l_process_options(void)
}
} else {
-#line 738 "dk-t2l.ctr"
+#line 786 "dk-t2l.ctr"
/* ERROR: Failed to obtain option argument, bug! */
}
}
@@ -806,11 +831,14 @@ dk_t2l_process_options(void)
dk_t2l_echo = 1;
dk_t2l_numeric = 1;
}
- if (0 != dk4app_opt_is_set_short(app, dkT('x'), NULL)) {
+ if (0 != dk4app_opt_is_set_short(app, dkT('h'), NULL)) {
dk_t2l_echo = 1;
dk_t2l_numeric = 2;
}
- uc2l = dk4uc2l_open_from_app(app);
+ if (0 != dk4app_opt_is_set_long(app, dk_t2l_kwnl[7], NULL)) {
+ dk_t2l_synchk = 1;
+ }
+ uc2l = dk4uc2l_open_from_app_ex1(app, dk_t2l_synchk);
if (NULL == uc2l) {
back = 0;
}
@@ -914,9 +942,7 @@ dk_t2l_end_math_mode(void)
static
int
dk_t2l_c32_after_cr_nl_check(
- dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_c32_t c
)
{
dkChar buf[16*sizeof(dk4_um_t)];
@@ -946,12 +972,12 @@ dk_t2l_c32_after_cr_nl_check(
dk_t2l_end_math_mode();
if (EOF == fputc(' ', stdout)) { output_error = 1; }
} else {
- lseq = dk4uc2l_find(uc2l, c, 0, app);
+ lseq = dk4uc2l_find_app(uc2l, c, 0, app);
if (NULL != lseq) {
dk_t2l_end_math_mode();
if (EOF == fputs(lseq, stdout)) { output_error = 1; }
} else {
- lseq = dk4uc2l_find(uc2l, c, 1, app);
+ lseq = dk4uc2l_find_app(uc2l, c, 1, app);
if (NULL != lseq) {
dk_t2l_begin_math_mode();
if (EOF == fputs(lseq, stdout)) { output_error = 1; }
@@ -987,18 +1013,21 @@ dk_t2l_c32_after_cr_nl_check(
static
int
dk_t2l_c32_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
if (dkC32(0x0A) == c) {
/*
For a newline clear CR and TXT flag, set NL flag.
*/
- back = dk_t2l_c32_after_cr_nl_check(c, pos, erp);
+ back = dk_t2l_c32_after_cr_nl_check(c);
dk_t2l_lineno++;
if ((dk4_um_t)0UL == dk_t2l_lineno) {
/* ERROR: Overflow in line number counting */
@@ -1016,7 +1045,7 @@ dk_t2l_c32_handler(
Otherwise simply set CR flag.
*/
if (0 != dk_t2l_last_cr) {
- back = dk_t2l_c32_after_cr_nl_check(dkC32(0x0D), pos, erp);
+ back = dk_t2l_c32_after_cr_nl_check(dkC32(0x0D));
dk_t2l_lhtx = 1;
dk_t2l_last_nl = 0;
} else {
@@ -1030,8 +1059,8 @@ dk_t2l_c32_handler(
Reset NL and CR flag, set TXT flag.
*/
if (0 != dk_t2l_last_cr) {
- back = dk_t2l_c32_after_cr_nl_check(dkC32(0x0D), pos, erp);
- switch (dk_t2l_c32_after_cr_nl_check(c, pos, erp)) {
+ back = dk_t2l_c32_after_cr_nl_check(dkC32(0x0D));
+ switch (dk_t2l_c32_after_cr_nl_check(c)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -1042,7 +1071,7 @@ dk_t2l_c32_handler(
} break;
}
} else {
- back = dk_t2l_c32_after_cr_nl_check(c, pos, erp);
+ back = dk_t2l_c32_after_cr_nl_check(c);
}
dk_t2l_lhtx = 1;
dk_t2l_last_nl = 0;
@@ -1175,7 +1204,7 @@ dk_t2l_report_errors(dk4_er_t *er_en, dk4_er_t *er_pr)
static
void
-dk_t2l_echo_hex(const dkChar *txt, int argno)
+dk_t2l_echo_hex(const dkChar *txt)
{
const dkChar *endptr = NULL;
dk4_um_t um = (dk4_um_t)0UL;
@@ -1190,7 +1219,7 @@ dk_t2l_echo_hex(const dkChar *txt, int argno)
);
if (0 != res) {
if ((dk4_um_t)0xFFFFFFFFUL >= um) {
- (void)dk_t2l_c32_after_cr_nl_check((dk4_c32_t)um, NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check((dk4_c32_t)um);
} else {
dk4app_log_3(app, dk_t2l_msg, dk_t2l_sz_msg, DK4_LL_ERROR, 28, 29, txt);
}
@@ -1204,7 +1233,7 @@ dk_t2l_echo_hex(const dkChar *txt, int argno)
static
void
-dk_t2l_echo_numeric(const dkChar *txt, int argno)
+dk_t2l_echo_numeric(const dkChar *txt)
{
const dkChar *endptr = NULL;
dk4_um_t um = (dk4_um_t)0UL;
@@ -1222,7 +1251,7 @@ dk_t2l_echo_numeric(const dkChar *txt, int argno)
);
if (0 != res) {
if ((dk4_um_t)0xFFFFFFFFUL >= um) {
- (void)dk_t2l_c32_after_cr_nl_check((dk4_c32_t)um, NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check((dk4_c32_t)um);
} else {
dk4app_log_3(app, dk_t2l_msg, dk_t2l_sz_msg, DK4_LL_ERROR, 28, 29, txt);
}
@@ -1231,7 +1260,7 @@ dk_t2l_echo_numeric(const dkChar *txt, int argno)
dk4app_log_3(app, dk_t2l_msg, dk_t2l_sz_msg, DK4_LL_ERROR, 30, 31, txt);
}
} else {
- dk_t2l_echo_hex(&(txt[2]), argno);
+ dk_t2l_echo_hex(&(txt[2]));
}
}
@@ -1253,7 +1282,7 @@ dk_t2l_echo_c32(const dkChar *txt, int argno)
if (EOF == fputc(' ', stdout)) { output_error = 1; }
}
isfirst = 0;
- (void)dk_t2l_c32_after_cr_nl_check(*(txt++), NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(*(txt++));
}
}
@@ -1284,7 +1313,7 @@ dk_t2l_echo_utf16(const dkChar *txt, int argno)
if (EOF == fputc(' ', stdout)) { output_error = 1; }
}
isfirst = 0;
- (void)dk_t2l_c32_after_cr_nl_check(dk4utf16_get(&dec), NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(dk4utf16_get(&dec));
} break;
}
} else {
@@ -1319,7 +1348,7 @@ dk_t2l_echo_ascii(const dkChar *txt, int argno)
}
isfirst = 0;
c32 = dkC32(0xFF) & ((dk4_c32_t)((unsigned char)(*(txt++))));
- (void)dk_t2l_c32_after_cr_nl_check(c32, NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(c32);
}
}
@@ -1349,7 +1378,7 @@ dk_t2l_echo_utf8(const dkChar *txt, int argno)
if (EOF == fputc(' ', stdout)) { output_error = 1; }
}
isfirst = 0;
- (void)dk_t2l_c32_after_cr_nl_check(dk4utf8_get(&dec), NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(dk4utf8_get(&dec));
} break;
}
} else {
@@ -1382,7 +1411,7 @@ dk_t2l_echo_ansi(const dkChar *txt, int argno)
if (EOF == fputc(' ', stdout)) { output_error = 1; }
}
isfirst = 0;
- (void)dk_t2l_c32_after_cr_nl_check(c32, NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(c32);
} else {
/* !!!!! ERROR: Decoding */
exval = EXIT_FAILURE;
@@ -1413,7 +1442,7 @@ dk_t2l_echo_text(const dkChar *txt, int argno)
case DK4_ENCODING_UTF8 : {
dk_t2l_echo_utf8(txt, argno);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
dk_t2l_echo_ansi(txt, argno);
} break;
default : {
@@ -1444,7 +1473,7 @@ dk_t2l_process_cmdline(void)
for (i = 0; i < argc; i++) {
xargv = dk4app_get_argv(app, i);
if (NULL != xargv) {
- dk_t2l_echo_hex(xargv, i);
+ dk_t2l_echo_hex(xargv);
}
}
dk_t2l_end_math_mode();
@@ -1453,7 +1482,7 @@ dk_t2l_process_cmdline(void)
for (i = 0; i < argc; i++) {
xargv = dk4app_get_argv(app, i);
if (NULL != xargv) {
- dk_t2l_echo_numeric(xargv, i);
+ dk_t2l_echo_numeric(xargv);
}
}
dk_t2l_end_math_mode();
@@ -1710,8 +1739,10 @@ static
void
dk_t2l_normal_run(void)
{
- int argc;
- int i;
+ dk4_er_t er;
+ dk4_stream_t *wstrm;
+ int argc;
+ int i;
if (0 != dk_t2l_process_options()) {
exval = EXIT_SUCCESS;
dk_t2l_output_start_page();
@@ -1724,16 +1755,31 @@ dk_t2l_normal_run(void)
dk_t2l_process_filename(dk4app_get_argv(app, i));
}
} else {
- dk_t2l_process_stdin();
+ if (0 == dk_t2l_synchk) {
+ dk_t2l_process_stdin();
+ }
}
}
dk_t2l_output_finish_page();
if (0 != dk4app_opt_is_set_short(app, dkT('r'), NULL)) {
- dk4uc2l_recommendations(uc2l, stdout);
+ dk4error_init(&er);
+ wstrm = dk4stream_open_for_file(stdout, DK4_STREAM_WRITE, 0, 0, &er);
+ if (NULL != wstrm) {
+ dk4stream_set_output_encoding(wstrm, DK4_FILE_ENCODING_PLAIN);
+ dk4uc2l_recommendations(uc2l, wstrm, &er);
+ if (0 == dk4stream_close(wstrm, NULL)) {
+ /* ERROR: Incomplete output */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ else {
+ /* ERROR: Failed to create stream writer */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ }
}
if (0 != dk4uc2l_retrieve_errors(uc2l)) {
-#line 1674 "dk-t2l.ctr"
+#line 1743 "dk-t2l.ctr"
/* ERROR: Probably incorrect output due to problems */
dk4app_log_1(app, dk_t2l_msg, dk_t2l_sz_msg, DK4_LL_ERROR, 11);
exval = EXIT_FAILURE;
@@ -1945,19 +1991,35 @@ int wmain(int argc, wchar_t *argv[])
int main(int argc, char *argv[])
#endif
{
+ int silent = 0;
int shp;
-#line 1887 "dk-t2l.ctr"
+#line 1957 "dk-t2l.ctr"
-#line 1888 "dk-t2l.ctr"
+#line 1958 "dk-t2l.ctr"
+#if DK4_CHAR_SIZE > 1
+ if (NULL != getenv("VIM")) { silent = 1; }
+ if (NULL != getenv("VIMRUNTIME")) { silent = 1; }
+#endif
+#if 0
dk4fput_initialize_stderr();
- app = dk4app_open_cmd(
- argc, argv, dk_t2l_options, dk_t2l_sz_options,
- dk_t2l_kwnl[0], DKT_VERSION_DK,
- dk_t2l_kwnl[1], dk_t2l_help_text, dk_t2l_license_text
- );
+#endif
+ if (0 != silent) {
+ app = dk4app_open_silent(
+ argc, argv, dk_t2l_options, dk_t2l_sz_options,
+ dk_t2l_kwnl[0], DKT_VERSION_DK,
+ dk_t2l_kwnl[1], dk_t2l_help_text, dk_t2l_license_text
+ );
+ }
+ else {
+ app = dk4app_open_cmd(
+ argc, argv, dk_t2l_options, dk_t2l_sz_options,
+ dk_t2l_kwnl[0], DKT_VERSION_DK,
+ dk_t2l_kwnl[1], dk_t2l_help_text, dk_t2l_license_text
+ );
+ }
if (NULL != app) {
dk_t2l_i_std = dk4app_get_stdin_encoding(app);
dk_t2l_i_file = dk4app_get_file_in_encoding(app);
@@ -2012,14 +2074,16 @@ int main(int argc, char *argv[])
if (0 != sig_read_atomic(&sig_had_pipe)) { exval = EXIT_FAILURE; }
#endif
if (0 != output_error) { exval = EXIT_FAILURE; }
- fflush(stderr);
- dk4fput_cleanup_stderr();
+ if (0 == silent) {
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ }
-#line 1951 "dk-t2l.ctr"
+#line 2038 "dk-t2l.ctr"
-#line 1952 "dk-t2l.ctr"
+#line 2039 "dk-t2l.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-t2l.ctr b/support/dktools/dk-t2l.ctr
index 8a1bcbeb9b..e240ba59ab 100644
--- a/support/dktools/dk-t2l.ctr
+++ b/support/dktools/dk-t2l.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -82,6 +82,7 @@ license = bsd
#include "dk4vers.h"
#include "dk4tsp32.h"
#include "dk4uc2l.h"
+#include "dk4uc2la.h"
#include "dk4maidhdu.h"
#include "dk4maidddu.h"
#include "dk4maodh.h"
@@ -89,6 +90,11 @@ license = bsd
#include "dk4mpl.h"
#include "dk4strd.h"
#include "dk4pathd.h"
+#include "dk4strm.h"
+#include "dk4strmf.h"
+#include "dk4strmo32.h"
+
+
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE == 2
@@ -98,7 +104,11 @@ license = bsd
#include "dk4ansi.h"
#include "dk4utf8.h"
#endif
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -126,13 +136,14 @@ Options:
-t --tabulator Write LaTeX sequence for
tabulators
--verbose Show error message on SIGPIPE.
+ --check Syntax check for all data files.
--help Show this short help text.
--manual *** SHOW FULL MANUAL. ***
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-t2l/
$!end
};
@@ -148,7 +159,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -175,27 +187,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -321,6 +333,10 @@ stdin
# 6 Long option for verbose mode
#
verbose
+#
+# 7 Long option for syntax check
+#
+check
$!end
};
@@ -424,7 +440,7 @@ static const dk4_option_specification_t dk_t2l_options[] = {
/* Command line arguments are hexadecimal character numbers.
*/
- { dkT('x'), dkT("hex"), DK4_OPT_ARG_NONE },
+ { dkT('h'), dkT("hex"), DK4_OPT_ARG_NONE },
/* Write recommendations about font encodings and packages.
*/
@@ -440,7 +456,11 @@ static const dk4_option_specification_t dk_t2l_options[] = {
/* Verbose output.
*/
- { dkT('\0'), dkT("verbose"), DK4_OPT_ARG_NONE }
+ { dkT('\0'), dkT("verbose"), DK4_OPT_ARG_NONE },
+
+ /* Immediately load all data files for syntax check.
+ */
+ { dkT('\0'), dkT("check"), DK4_OPT_ARG_NONE }
};
@@ -517,13 +537,25 @@ static int dk_t2l_numeric = 0;
/** Input encoding expected when processing stdin.
*/
-static int dk_t2l_i_std = DK4_FILE_ENCODING_ASCII;
+static int dk_t2l_i_std =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Input encoding expected when processing files.
*/
-static int dk_t2l_i_file = DK4_FILE_ENCODING_ASCII;
+static int dk_t2l_i_file =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -580,6 +612,11 @@ static int dk_t2l_tabs = 0;
static int dk_t2l_linef = 0;
+/** Flag: Syntax check on all data files.
+*/
+static int dk_t2l_synchk = 0;
+
+
#ifdef SIGPIPE
/** Indicator: SIGPIPE signal received.
@@ -626,8 +663,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -637,8 +675,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -647,8 +686,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -672,10 +712,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -745,11 +793,14 @@ dk_t2l_process_options(void)
dk_t2l_echo = 1;
dk_t2l_numeric = 1;
}
- if (0 != dk4app_opt_is_set_short(app, dkT('x'), NULL)) {
+ if (0 != dk4app_opt_is_set_short(app, dkT('h'), NULL)) {
dk_t2l_echo = 1;
dk_t2l_numeric = 2;
}
- uc2l = dk4uc2l_open_from_app(app);
+ if (0 != dk4app_opt_is_set_long(app, dk_t2l_kwnl[7], NULL)) {
+ dk_t2l_synchk = 1;
+ }
+ uc2l = dk4uc2l_open_from_app_ex1(app, dk_t2l_synchk);
if (NULL == uc2l) {
back = 0;
}
@@ -853,9 +904,7 @@ dk_t2l_end_math_mode(void)
static
int
dk_t2l_c32_after_cr_nl_check(
- dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_c32_t c
)
{
dkChar buf[16*sizeof(dk4_um_t)];
@@ -885,12 +934,12 @@ dk_t2l_c32_after_cr_nl_check(
dk_t2l_end_math_mode();
if (EOF == fputc(' ', stdout)) { output_error = 1; }
} else {
- lseq = dk4uc2l_find(uc2l, c, 0, app);
+ lseq = dk4uc2l_find_app(uc2l, c, 0, app);
if (NULL != lseq) {
dk_t2l_end_math_mode();
if (EOF == fputs(lseq, stdout)) { output_error = 1; }
} else {
- lseq = dk4uc2l_find(uc2l, c, 1, app);
+ lseq = dk4uc2l_find_app(uc2l, c, 1, app);
if (NULL != lseq) {
dk_t2l_begin_math_mode();
if (EOF == fputs(lseq, stdout)) { output_error = 1; }
@@ -926,18 +975,21 @@ dk_t2l_c32_after_cr_nl_check(
static
int
dk_t2l_c32_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dk4_c32_t c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
if (dkC32(0x0A) == c) {
/*
For a newline clear CR and TXT flag, set NL flag.
*/
- back = dk_t2l_c32_after_cr_nl_check(c, pos, erp);
+ back = dk_t2l_c32_after_cr_nl_check(c);
dk_t2l_lineno++;
if ((dk4_um_t)0UL == dk_t2l_lineno) {
/* ERROR: Overflow in line number counting */
@@ -955,7 +1007,7 @@ dk_t2l_c32_handler(
Otherwise simply set CR flag.
*/
if (0 != dk_t2l_last_cr) {
- back = dk_t2l_c32_after_cr_nl_check(dkC32(0x0D), pos, erp);
+ back = dk_t2l_c32_after_cr_nl_check(dkC32(0x0D));
dk_t2l_lhtx = 1;
dk_t2l_last_nl = 0;
} else {
@@ -969,8 +1021,8 @@ dk_t2l_c32_handler(
Reset NL and CR flag, set TXT flag.
*/
if (0 != dk_t2l_last_cr) {
- back = dk_t2l_c32_after_cr_nl_check(dkC32(0x0D), pos, erp);
- switch (dk_t2l_c32_after_cr_nl_check(c, pos, erp)) {
+ back = dk_t2l_c32_after_cr_nl_check(dkC32(0x0D));
+ switch (dk_t2l_c32_after_cr_nl_check(c)) {
case DK4_TSP_RES_FATAL: {
back = DK4_TSP_RES_FATAL;
} break;
@@ -981,7 +1033,7 @@ dk_t2l_c32_handler(
} break;
}
} else {
- back = dk_t2l_c32_after_cr_nl_check(c, pos, erp);
+ back = dk_t2l_c32_after_cr_nl_check(c);
}
dk_t2l_lhtx = 1;
dk_t2l_last_nl = 0;
@@ -1114,7 +1166,7 @@ dk_t2l_report_errors(dk4_er_t *er_en, dk4_er_t *er_pr)
static
void
-dk_t2l_echo_hex(const dkChar *txt, int argno)
+dk_t2l_echo_hex(const dkChar *txt)
{
const dkChar *endptr = NULL;
dk4_um_t um = (dk4_um_t)0UL;
@@ -1129,7 +1181,7 @@ dk_t2l_echo_hex(const dkChar *txt, int argno)
);
if (0 != res) {
if ((dk4_um_t)0xFFFFFFFFUL >= um) {
- (void)dk_t2l_c32_after_cr_nl_check((dk4_c32_t)um, NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check((dk4_c32_t)um);
} else {
dk4app_log_3(app, dk_t2l_msg, dk_t2l_sz_msg, DK4_LL_ERROR, 28, 29, txt);
}
@@ -1143,7 +1195,7 @@ dk_t2l_echo_hex(const dkChar *txt, int argno)
static
void
-dk_t2l_echo_numeric(const dkChar *txt, int argno)
+dk_t2l_echo_numeric(const dkChar *txt)
{
const dkChar *endptr = NULL;
dk4_um_t um = (dk4_um_t)0UL;
@@ -1161,7 +1213,7 @@ dk_t2l_echo_numeric(const dkChar *txt, int argno)
);
if (0 != res) {
if ((dk4_um_t)0xFFFFFFFFUL >= um) {
- (void)dk_t2l_c32_after_cr_nl_check((dk4_c32_t)um, NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check((dk4_c32_t)um);
} else {
dk4app_log_3(app, dk_t2l_msg, dk_t2l_sz_msg, DK4_LL_ERROR, 28, 29, txt);
}
@@ -1170,7 +1222,7 @@ dk_t2l_echo_numeric(const dkChar *txt, int argno)
dk4app_log_3(app, dk_t2l_msg, dk_t2l_sz_msg, DK4_LL_ERROR, 30, 31, txt);
}
} else {
- dk_t2l_echo_hex(&(txt[2]), argno);
+ dk_t2l_echo_hex(&(txt[2]));
}
}
@@ -1192,7 +1244,7 @@ dk_t2l_echo_c32(const dkChar *txt, int argno)
if (EOF == fputc(' ', stdout)) { output_error = 1; }
}
isfirst = 0;
- (void)dk_t2l_c32_after_cr_nl_check(*(txt++), NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(*(txt++));
}
}
@@ -1223,7 +1275,7 @@ dk_t2l_echo_utf16(const dkChar *txt, int argno)
if (EOF == fputc(' ', stdout)) { output_error = 1; }
}
isfirst = 0;
- (void)dk_t2l_c32_after_cr_nl_check(dk4utf16_get(&dec), NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(dk4utf16_get(&dec));
} break;
}
} else {
@@ -1258,7 +1310,7 @@ dk_t2l_echo_ascii(const dkChar *txt, int argno)
}
isfirst = 0;
c32 = dkC32(0xFF) & ((dk4_c32_t)((unsigned char)(*(txt++))));
- (void)dk_t2l_c32_after_cr_nl_check(c32, NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(c32);
}
}
@@ -1288,7 +1340,7 @@ dk_t2l_echo_utf8(const dkChar *txt, int argno)
if (EOF == fputc(' ', stdout)) { output_error = 1; }
}
isfirst = 0;
- (void)dk_t2l_c32_after_cr_nl_check(dk4utf8_get(&dec), NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(dk4utf8_get(&dec));
} break;
}
} else {
@@ -1321,7 +1373,7 @@ dk_t2l_echo_ansi(const dkChar *txt, int argno)
if (EOF == fputc(' ', stdout)) { output_error = 1; }
}
isfirst = 0;
- (void)dk_t2l_c32_after_cr_nl_check(c32, NULL, NULL);
+ (void)dk_t2l_c32_after_cr_nl_check(c32);
} else {
/* !!!!! ERROR: Decoding */
exval = EXIT_FAILURE;
@@ -1352,7 +1404,7 @@ dk_t2l_echo_text(const dkChar *txt, int argno)
case DK4_ENCODING_UTF8 : {
dk_t2l_echo_utf8(txt, argno);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
dk_t2l_echo_ansi(txt, argno);
} break;
default : {
@@ -1383,7 +1435,7 @@ dk_t2l_process_cmdline(void)
for (i = 0; i < argc; i++) {
xargv = dk4app_get_argv(app, i);
if (NULL != xargv) {
- dk_t2l_echo_hex(xargv, i);
+ dk_t2l_echo_hex(xargv);
}
}
dk_t2l_end_math_mode();
@@ -1392,7 +1444,7 @@ dk_t2l_process_cmdline(void)
for (i = 0; i < argc; i++) {
xargv = dk4app_get_argv(app, i);
if (NULL != xargv) {
- dk_t2l_echo_numeric(xargv, i);
+ dk_t2l_echo_numeric(xargv);
}
}
dk_t2l_end_math_mode();
@@ -1649,8 +1701,10 @@ static
void
dk_t2l_normal_run(void)
{
- int argc;
- int i;
+ dk4_er_t er;
+ dk4_stream_t *wstrm;
+ int argc;
+ int i;
if (0 != dk_t2l_process_options()) {
exval = EXIT_SUCCESS;
dk_t2l_output_start_page();
@@ -1663,12 +1717,27 @@ dk_t2l_normal_run(void)
dk_t2l_process_filename(dk4app_get_argv(app, i));
}
} else {
- dk_t2l_process_stdin();
+ if (0 == dk_t2l_synchk) {
+ dk_t2l_process_stdin();
+ }
}
}
dk_t2l_output_finish_page();
if (0 != dk4app_opt_is_set_short(app, dkT('r'), NULL)) {
- dk4uc2l_recommendations(uc2l, stdout);
+ dk4error_init(&er);
+ wstrm = dk4stream_open_for_file(stdout, DK4_STREAM_WRITE, 0, 0, &er);
+ if (NULL != wstrm) {
+ dk4stream_set_output_encoding(wstrm, DK4_FILE_ENCODING_PLAIN);
+ dk4uc2l_recommendations(uc2l, wstrm, &er);
+ if (0 == dk4stream_close(wstrm, NULL)) {
+ /* ERROR: Incomplete output */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ else {
+ /* ERROR: Failed to create stream writer */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ }
}
if (0 != dk4uc2l_retrieve_errors(uc2l)) { $? "! ERROR"
/* ERROR: Probably incorrect output due to problems */
@@ -1882,15 +1951,31 @@ int wmain(int argc, wchar_t *argv[])
int main(int argc, char *argv[])
#endif
{
+ int silent = 0;
int shp;
$!trace-init dk-t2l.deb
$? "+ main"
+#if DK4_CHAR_SIZE > 1
+ if (NULL != getenv("VIM")) { silent = 1; }
+ if (NULL != getenv("VIMRUNTIME")) { silent = 1; }
+#endif
+#if 0
dk4fput_initialize_stderr();
- app = dk4app_open_cmd(
- argc, argv, dk_t2l_options, dk_t2l_sz_options,
- dk_t2l_kwnl[0], DKT_VERSION_DK,
- dk_t2l_kwnl[1], dk_t2l_help_text, dk_t2l_license_text
- );
+#endif
+ if (0 != silent) {
+ app = dk4app_open_silent(
+ argc, argv, dk_t2l_options, dk_t2l_sz_options,
+ dk_t2l_kwnl[0], DKT_VERSION_DK,
+ dk_t2l_kwnl[1], dk_t2l_help_text, dk_t2l_license_text
+ );
+ }
+ else {
+ app = dk4app_open_cmd(
+ argc, argv, dk_t2l_options, dk_t2l_sz_options,
+ dk_t2l_kwnl[0], DKT_VERSION_DK,
+ dk_t2l_kwnl[1], dk_t2l_help_text, dk_t2l_license_text
+ );
+ }
if (NULL != app) {
dk_t2l_i_std = dk4app_get_stdin_encoding(app);
dk_t2l_i_file = dk4app_get_file_in_encoding(app);
@@ -1945,8 +2030,10 @@ int main(int argc, char *argv[])
if (0 != sig_read_atomic(&sig_had_pipe)) { exval = EXIT_FAILURE; }
#endif
if (0 != output_error) { exval = EXIT_FAILURE; }
- fflush(stderr);
- dk4fput_cleanup_stderr();
+ if (0 == silent) {
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ }
$? "- main %d", exval
$!trace-end
exit(exval); return exval;
diff --git a/support/dktools/dk-t2l.rc b/support/dktools/dk-t2l.rc
index 0f4571cece..9f24c01caa 100644
--- a/support/dktools/dk-t2l.rc
+++ b/support/dktools/dk-t2l.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Text to LaTeX converter\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Text to LaTeX converter\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk-t2l\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk-uid.c b/support/dktools/dk-uid.c
index 2263382aa5..a884c33712 100644
--- a/support/dktools/dk-uid.c
+++ b/support/dktools/dk-uid.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk-uid.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk-uid.ctr
*/
@@ -83,12 +61,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maadu.h"
#include "dk4maodd.h"
#include "dk4bf.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 61 "dk-uid.ctr"
+#line 65 "dk-uid.ctr"
@@ -107,7 +89,7 @@ dkT("dk-uid.str"),
NULL
-#line 81 "dk-uid.ctr"
+#line 85 "dk-uid.ctr"
};
@@ -129,12 +111,12 @@ dkT("--manual\t*** SHOW FULL MANUAL. ***"),
dkT("--version\tShow version information."),
dkT("--license\tShow license information."),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dk-uid/"),
dkT(""),
NULL
-#line 106 "dk-uid.ctr"
+#line 110 "dk-uid.ctr"
};
@@ -146,7 +128,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -173,27 +156,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -267,7 +250,7 @@ dkT(""),
NULL
-#line 237 "dk-uid.ctr"
+#line 242 "dk-uid.ctr"
};
@@ -317,7 +300,7 @@ dkT("UID range too large!"),
NULL
-#line 295 "dk-uid.ctr"
+#line 300 "dk-uid.ctr"
};
@@ -405,8 +388,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -416,8 +400,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -426,8 +411,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -553,7 +539,7 @@ dk_uid_run_with_range_size(dk4_um_t rs)
}
} else {
-#line 529 "dk-uid.ctr"
+#line 537 "dk-uid.ctr"
cc = -1;
/* ERROR: Failed to convert value to string, bug */
dk4app_log_1(
@@ -572,7 +558,7 @@ dk_uid_run_with_range_size(dk4_um_t rs)
}
} else {
-#line 546 "dk-uid.ctr"
+#line 554 "dk-uid.ctr"
cc = -1;
/* ERROR: Failed to retrieve bit, bug */
dk4app_log_1(
@@ -630,14 +616,14 @@ dk_uid_normal_run(void)
int res;
-#line 602 "dk-uid.ctr"
+#line 610 "dk-uid.ctr"
numargs = dk4app_get_argc(app);
if (2 == numargs) {
str1 = dk4app_get_argv(app, 0);
str2 = dk4app_get_argv(app, 1);
if ((NULL != str1) && (NULL != str2)) {
-#line 607 "dk-uid.ctr"
+#line 615 "dk-uid.ctr"
res = dk4ma_input_dk_dec_dk4_um_t(&dk_uid_min, str1, &ep1, 1, NULL);
if (0 != res) {
res = dk4ma_input_dk_dec_dk4_um_t(&dk_uid_max, str2, &ep2, 1, NULL);
@@ -679,7 +665,7 @@ dk_uid_normal_run(void)
}
} else {
-#line 647 "dk-uid.ctr"
+#line 655 "dk-uid.ctr"
/* ERROR: Failed to obtain command line arguments, bug! */
dk4app_log_1(
app, dk_uid_msg, dk_uid_sz_msg, DK4_LL_ERROR, 9
@@ -689,7 +675,7 @@ dk_uid_normal_run(void)
dk4app_log_1(app, dk_uid_msg, dk_uid_sz_msg, DK4_LL_ERROR, 2);
}
-#line 655 "dk-uid.ctr"
+#line 663 "dk-uid.ctr"
}
@@ -894,10 +880,10 @@ int main(int argc, char *argv[])
{
-#line 858 "dk-uid.ctr"
+#line 866 "dk-uid.ctr"
-#line 859 "dk-uid.ctr"
+#line 867 "dk-uid.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
@@ -928,10 +914,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 888 "dk-uid.ctr"
+#line 896 "dk-uid.ctr"
-#line 889 "dk-uid.ctr"
+#line 897 "dk-uid.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk-uid.ctr b/support/dktools/dk-uid.ctr
index 18dc14d287..58378a6dcb 100644
--- a/support/dktools/dk-uid.ctr
+++ b/support/dktools/dk-uid.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -54,7 +54,11 @@ license = bsd
#include "dk4maadu.h"
#include "dk4maodd.h"
#include "dk4bf.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -100,7 +104,7 @@ Options:
--version Show version information.
--license Show license information.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dk-uid/
$!end
};
@@ -115,7 +119,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -142,27 +147,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -379,8 +384,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -390,8 +396,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -400,8 +407,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
diff --git a/support/dktools/dk3.h b/support/dktools/dk3.h
index bb49ac3c71..430469d74d 100644
--- a/support/dktools/dk3.h
+++ b/support/dktools/dk3.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
/** @file dk3.h Include minimum headers for dk3 library.
*/
diff --git a/support/dktools/dk3all.h b/support/dktools/dk3all.h
index 517c63a091..bb3c58caf5 100644
--- a/support/dktools/dk3all.h
+++ b/support/dktools/dk3all.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
/** @file dk3all.h Main include file for the dk3 libraries.
Applications using the dk3 libraries should include this file.
diff --git a/support/dktools/dk3app.c b/support/dktools/dk3app.c
index df9806462a..f3fd96d028 100644
--- a/support/dktools/dk3app.c
+++ b/support/dktools/dk3app.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3app.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3app.ctr
*/
/** @file dk3app.c The dk3app module.
@@ -40,6 +18,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 701 "dk3app.ctr"
#include "dk3all.h"
+#include "dk3unused.h"
+
+
#if DK3_HAVE_OPENSSL_RAND_H
#include <openssl/rand.h>
@@ -49,7 +30,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 710 "dk3app.ctr"
+#line 713 "dk3app.ctr"
@@ -182,7 +163,7 @@ dkT("libexec"),
NULL
-#line 833 "dk3app.ctr"
+#line 836 "dk3app.ctr"
};
@@ -1473,7 +1454,7 @@ dkT("\"!"),
NULL
-#line 2444 "dk3app.ctr"
+#line 2447 "dk3app.ctr"
};
@@ -1507,7 +1488,7 @@ dk3app_pref_delete(dk3app_pref_t *p)
{
if(p) {
-#line 2476 "dk3app.ctr"
+#line 2479 "dk3app.ctr"
dk3_release(p->k);
dk3_release(p->v);
dk3_delete(p);
@@ -1528,7 +1509,7 @@ dk3app_pref_new(dkChar const *k, dkChar const *v)
dk3app_pref_t *back = NULL;
-#line 2495 "dk3app.ctr"
+#line 2498 "dk3app.ctr"
if((k) && (v)) {
back = dk3_new(dk3app_pref_t,1);
if(back) {
@@ -1540,7 +1521,7 @@ dk3app_pref_new(dkChar const *k, dkChar const *v)
}
}
-#line 2505 "dk3app.ctr"
+#line 2508 "dk3app.ctr"
return back;
}
@@ -1554,11 +1535,13 @@ dk3app_pref_new(dkChar const *k, dkChar const *v)
*/
static
int
-dk3app_compare_pref(void const *l, void const *r, int crit)
+dk3app_compare_pref(void const *l, void const *r, int DK3_ARG_UNUSED(crit) )
{
int back = 0;
dk3app_pref_t const *pl = NULL; /* Left object. */
dk3app_pref_t const *pr = NULL; /* Right object. */
+
+ DK3_UNUSED_ARG(crit)
if(l) {
if(r) {
pl = (dk3app_pref_t const *)l; pr = (dk3app_pref_t const *)r;
@@ -1590,21 +1573,21 @@ dk3app_mc_table_delete(dkChar const **ta, size_t n)
size_t i = 0; /* Index of current element to process. */
-#line 2553 "dk3app.ctr"
+#line 2558 "dk3app.ctr"
ptr = ta;
for(i = 0; i < n; i++) {
-#line 2555 "dk3app.ctr"
+#line 2560 "dk3app.ctr"
if(*ptr) {
-#line 2556 "dk3app.ctr"
+#line 2561 "dk3app.ctr"
dk3_delete(*ptr);
}
*(ptr++) = NULL;
}
dk3_delete(ta);
-#line 2561 "dk3app.ctr"
+#line 2566 "dk3app.ctr"
}
@@ -1618,10 +1601,10 @@ dk3app_mc_delete(dk3app_mc_t *mc)
{
-#line 2573 "dk3app.ctr"
+#line 2578 "dk3app.ctr"
if(mc) {
-#line 2574 "dk3app.ctr"
+#line 2579 "dk3app.ctr"
dk3_release(mc->n);
if(mc->f) {
if(mc->msg) {
@@ -1631,7 +1614,7 @@ dk3app_mc_delete(dk3app_mc_t *mc)
dk3_delete(mc);
}
-#line 2582 "dk3app.ctr"
+#line 2587 "dk3app.ctr"
}
@@ -1653,7 +1636,7 @@ dk3app_mc_new(
dk3app_mc_t *back = NULL;
-#line 2602 "dk3app.ctr"
+#line 2607 "dk3app.ctr"
back = dk3_new_app(dk3app_mc_t,1,app);
if(back) {
back->n = NULL; back->msg = NULL; back->f = f; back->nmsg = nmsg;
@@ -1665,7 +1648,7 @@ dk3app_mc_new(
}
}
-#line 2612 "dk3app.ctr"
+#line 2617 "dk3app.ctr"
return back;
}
@@ -1679,11 +1662,13 @@ dk3app_mc_new(
*/
static
int
-dk3app_mc_compare(void const *l, void const *r, int cr)
+dk3app_mc_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
dk3app_mc_t const *pl = NULL; /* Left message catalog. */
dk3app_mc_t const *pr = NULL; /* Right message catalog. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3app_mc_t const *)l; pr = (dk3app_mc_t const *)r;
@@ -1727,7 +1712,7 @@ dk3app_log_to_file(
size_t i = 0; /* Index of current string to process. */
-#line 2672 "dk3app.ctr"
+#line 2679 "dk3app.ctr"
if(dk3sf_time(&time_now)) {
if(time_now != *last_time) {
if(dk3sf_time_convert_app(tb, DK3_SIZEOF(tb,dkChar), &time_now, NULL)) {
@@ -1761,7 +1746,7 @@ dk3app_log_to_file(
}
dk3sf_fputs(((app->msg) ? app->msg : dk3app_kw)[0], fipo);
-#line 2704 "dk3app.ctr"
+#line 2711 "dk3app.ctr"
}
@@ -1836,10 +1821,10 @@ dk3app_log_file(dk3_app_t *app, int ll, dkChar const * const * msg, size_t nmsg)
dk3_stat_t stb; /* File stat buffer. */
-#line 2777 "dk3app.ctr"
+#line 2784 "dk3app.ctr"
if(app->n_logfilename) {
-#line 2778 "dk3app.ctr"
+#line 2785 "dk3app.ctr"
if (0 == app->cr_log) {
/*
Create ${HOME}/log directory if not yet done.
@@ -1862,10 +1847,12 @@ dk3app_log_file(dk3_app_t *app, int ll, dkChar const * const * msg, size_t nmsg)
/* WRITE */
if(fipo) {
-#line 2799 "dk3app.ctr"
+#line 2806 "dk3app.ctr"
#if DK3_ON_WINDOWS && (DK3_CHAR_SIZE > 1)
/* Switch to 16 bit characters. */
+#if defined(_MSC_VER)
(void)_setmode(_fileno(fipo), _O_U16TEXT);
+#endif
/* Write byte order marker. */
if(app->f_first_file_log) {
fputwc(0xFEFF, fipo);
@@ -1878,11 +1865,11 @@ dk3app_log_file(dk3_app_t *app, int ll, dkChar const * const * msg, size_t nmsg)
fclose(fipo);
} else {
-#line 2813 "dk3app.ctr"
+#line 2822 "dk3app.ctr"
}
}
-#line 2815 "dk3app.ctr"
+#line 2824 "dk3app.ctr"
}
@@ -1909,66 +1896,66 @@ dk3app_log_msg(dk3_app_t *app, int ll, dkChar const * const * msg, size_t nmsg)
{
-#line 2840 "dk3app.ctr"
+#line 2849 "dk3app.ctr"
if((app) && (msg) && (nmsg)) {
-#line 2841 "dk3app.ctr"
+#line 2850 "dk3app.ctr"
if(app->f_readytolog) {
-#line 2842 "dk3app.ctr"
+#line 2851 "dk3app.ctr"
if(ll < app->ll_highest) {
-#line 2843 "dk3app.ctr"
+#line 2852 "dk3app.ctr"
app->ll_highest = ll;
}
switch(app->app_type) {
case DK3_APP_TYPE_COMMAND: {
-#line 2847 "dk3app.ctr"
+#line 2856 "dk3app.ctr"
if(app->ll_file >= ll) {
-#line 2848 "dk3app.ctr"
+#line 2857 "dk3app.ctr"
dk3app_log_file(app, ll, msg, nmsg);
} else {
-#line 2850 "dk3app.ctr"
+#line 2859 "dk3app.ctr"
}
if(app->ll_stderr >= ll) {
-#line 2852 "dk3app.ctr"
+#line 2861 "dk3app.ctr"
dk3sf_initialize_stderr();
dk3app_log_to_file(
app, ll, msg, nmsg, stderr, &(app->t_last_log_stderr)
);
} else {
-#line 2857 "dk3app.ctr"
+#line 2866 "dk3app.ctr"
}
} break;
case DK3_APP_TYPE_GUI:
case DK3_APP_TYPE_DAEMON:
-#line 2861 "dk3app.ctr"
+#line 2870 "dk3app.ctr"
{
-#line 2862 "dk3app.ctr"
+#line 2871 "dk3app.ctr"
if(app->ll_file >= ll) {
-#line 2863 "dk3app.ctr"
+#line 2872 "dk3app.ctr"
dk3app_log_file(app, ll, msg, nmsg);
}
} break;
}
} else {
-#line 2868 "dk3app.ctr"
+#line 2877 "dk3app.ctr"
}
} else {
-#line 2870 "dk3app.ctr"
+#line 2879 "dk3app.ctr"
}
-#line 2871 "dk3app.ctr"
+#line 2880 "dk3app.ctr"
}
@@ -1979,14 +1966,14 @@ dk3app_log_1(dk3_app_t *app, int ll, dkChar const * const * msg, size_t i1)
dkChar const *m[2]; /* Message parts. */
-#line 2880 "dk3app.ctr"
+#line 2889 "dk3app.ctr"
if((app) && (msg)) {
m[0] = msg[i1];
m[1] = NULL;
dk3app_log_msg(app, ll, (dkChar const * const *)m, 1);
}
-#line 2885 "dk3app.ctr"
+#line 2894 "dk3app.ctr"
}
@@ -2016,7 +2003,7 @@ dk3app_log_3(
dkChar const *m[4]; /* Message parts. */
-#line 2913 "dk3app.ctr"
+#line 2922 "dk3app.ctr"
if((app) && (msg)) {
m[0] = msg[i1];
m[1] = st;
@@ -2025,7 +2012,7 @@ dk3app_log_3(
dk3app_log_msg(app, ll, (dkChar const * const *)m, 3);
}
-#line 2920 "dk3app.ctr"
+#line 2929 "dk3app.ctr"
}
@@ -2039,7 +2026,7 @@ dk3app_log_5(
dkChar const *m[6]; /* Message parts. */
-#line 2932 "dk3app.ctr"
+#line 2941 "dk3app.ctr"
if((app) && (msg)) {
m[0] = msg[i1];
m[1] = st1;
@@ -2050,7 +2037,7 @@ dk3app_log_5(
dk3app_log_msg(app, ll, (dkChar const * const *)m, 5);
}
-#line 2941 "dk3app.ctr"
+#line 2950 "dk3app.ctr"
}
@@ -2060,12 +2047,12 @@ dk3app_log_i1(dk3_app_t *app, int ll, size_t i1)
{
-#line 2949 "dk3app.ctr"
+#line 2958 "dk3app.ctr"
if(app) {
dk3app_log_1(app, ll, ((app->msg) ? app->msg : dk3app_kw), i1);
}
-#line 2952 "dk3app.ctr"
+#line 2961 "dk3app.ctr"
}
@@ -2095,12 +2082,12 @@ dk3app_log_i3(
{
-#line 2980 "dk3app.ctr"
+#line 2989 "dk3app.ctr"
if(app) {
dk3app_log_3(app, ll, ((app->msg) ? app->msg : dk3app_kw), i1, i2, st);
}
-#line 2983 "dk3app.ctr"
+#line 2992 "dk3app.ctr"
}
@@ -2113,14 +2100,14 @@ dk3app_log_i5(
{
-#line 2994 "dk3app.ctr"
+#line 3003 "dk3app.ctr"
if(app) {
dk3app_log_5(
app, ll, ((app->msg) ? app->msg : dk3app_kw), i1, i2, i3, st1, st2
);
}
-#line 2999 "dk3app.ctr"
+#line 3008 "dk3app.ctr"
}
@@ -2130,7 +2117,7 @@ dk3app_set_source_file(dk3_app_t *app, dkChar const *fn)
{
if(app) {
-#line 3007 "dk3app.ctr"
+#line 3016 "dk3app.ctr"
app->n_sourcefile = fn;
}
}
@@ -2142,7 +2129,7 @@ dk3app_set_source_line(dk3_app_t *app, unsigned long li)
{
if(app) {
-#line 3017 "dk3app.ctr"
+#line 3026 "dk3app.ctr"
app->sourceline = li;
}
}
@@ -2157,7 +2144,7 @@ dk3app_get_source_file(dk3_app_t const *app)
back = app->n_sourcefile;
}
-#line 3030 "dk3app.ctr"
+#line 3039 "dk3app.ctr"
return back;
}
@@ -2171,7 +2158,7 @@ dk3app_get_source_line(dk3_app_t const *app)
back = app->sourceline;
}
-#line 3042 "dk3app.ctr"
+#line 3051 "dk3app.ctr"
return back;
}
@@ -2206,7 +2193,7 @@ dk3app_my_find_data_file(
int j = 0; /* Pass: 0=app, 1=appgroup, 2=dk3app, 3=base. */
-#line 3075 "dk3app.ctr"
+#line 3084 "dk3app.ctr"
if((app) && (fn) && (db) && (sz)) {
if(app->n_sharedir) {
sz1 = dk3str_len(app->n_sharedir);
@@ -2214,7 +2201,7 @@ dk3app_my_find_data_file(
for(i = 0; ((back == 0) && (i < 4)); i++) {
for(j = 0; ((back == 0) && (j < 4)); j++) {
-#line 3081 "dk3app.ctr"
+#line 3090 "dk3app.ctr"
p1 = NULL; p2 = NULL; p3 = NULL; cc = 0;
switch(i) {
case 1: {
@@ -2278,13 +2265,13 @@ dk3app_my_find_data_file(
dk3str_cat(db, dk3app_no_loc[20]);
dk3str_cat(db, fn);
-#line 3143 "dk3app.ctr"
+#line 3152 "dk3app.ctr"
if(dk3sf_stat_app(&stb, db, NULL)) {
switch((stb.ft) & (~(DK3_FT_SYMLINK))) {
case DK3_FT_REGULAR: {
back = 1;
-#line 3147 "dk3app.ctr"
+#line 3156 "dk3app.ctr"
} break;
}
}
@@ -2307,7 +2294,7 @@ dk3app_my_find_data_file(
}
}
-#line 3168 "dk3app.ctr"
+#line 3177 "dk3app.ctr"
return back;
}
@@ -2328,18 +2315,18 @@ dk3app_remove_file_app(dkChar *n, dk3_app_t *app)
dk3_stat_t stb; /* Stat buffer to test existance of file. */
-#line 3187 "dk3app.ctr"
+#line 3196 "dk3app.ctr"
if(dk3sf_stat_app(&stb,n,app)) {
-#line 3188 "dk3app.ctr"
+#line 3197 "dk3app.ctr"
back = dk3sf_remove_file_app(n, app);
} else {
-#line 3190 "dk3app.ctr"
+#line 3199 "dk3app.ctr"
back = 1; /* File does not exist. */
}
-#line 3192 "dk3app.ctr"
+#line 3201 "dk3app.ctr"
return back;
}
@@ -2362,7 +2349,7 @@ dk3app_delete_one_temp_file(dk3_app_t *app, unsigned long n, unsigned s, int *f)
size_t sz = 0; /* Length needed for complete file name. */
-#line 3213 "dk3app.ctr"
+#line 3222 "dk3app.ctr"
sprintf(fnb, "/%08lx.%03x", n, s);
ra = app;
if((*f) & 1) { ra = NULL; }
@@ -2389,7 +2376,7 @@ dk3app_delete_one_temp_file(dk3_app_t *app, unsigned long n, unsigned s, int *f)
*f = ((*f) | 1);
}
-#line 3238 "dk3app.ctr"
+#line 3247 "dk3app.ctr"
}
@@ -2406,12 +2393,12 @@ dk3app_delete_all_temp_files_for(dk3_app_t *app, unsigned long n, int *f)
unsigned u; /* Used for file name suffix. */
-#line 3253 "dk3app.ctr"
+#line 3262 "dk3app.ctr"
for(u = 0; u < 0x1000U; u++) {
dk3app_delete_one_temp_file(app, n, u, f);
}
-#line 3256 "dk3app.ctr"
+#line 3265 "dk3app.ctr"
}
@@ -2428,7 +2415,7 @@ dk3app_remove_temporary_files(dk3_app_t *app)
int f = 0; /* Error checking variable. */
-#line 3271 "dk3app.ctr"
+#line 3280 "dk3app.ctr"
if(app->n_tmpdir) {
f = 0;
if(app->i_tmpcarry) {
@@ -2448,7 +2435,7 @@ dk3app_remove_temporary_files(dk3_app_t *app)
dk3sf_remove_dir_app(app->n_tmpdir, NULL);
}
-#line 3289 "dk3app.ctr"
+#line 3298 "dk3app.ctr"
}
@@ -2480,7 +2467,7 @@ dk3app_config_name(
size_t mysz = 0; /* Buffer size needed for all components. */
-#line 3319 "dk3app.ctr"
+#line 3328 "dk3app.ctr"
ptr1 = NULL; ptr2 = NULL; ptr3 = NULL;
switch(passno) {
@@ -2592,7 +2579,7 @@ dk3app_config_name(
dk3str_cat(db, fn);
back = 1;
-#line 3429 "dk3app.ctr"
+#line 3438 "dk3app.ctr"
} else {
if(verb) {
/* Internal error, some directory not set! */
@@ -2604,7 +2591,7 @@ dk3app_config_name(
}
}
-#line 3439 "dk3app.ctr"
+#line 3448 "dk3app.ctr"
return back;
}
@@ -2640,27 +2627,29 @@ dk3app_do_save_config(dk3_app_t *app)
dk3app_pref_t *p2 = NULL; /* Check in higher priorized storage. */
-#line 3473 "dk3app.ctr"
+#line 3482 "dk3app.ctr"
if(dk3app_config_name(app, dk3app_no_loc[21], fnb, DK3_MAX_PATH, 14, 0)) {
-#line 3475 "dk3app.ctr"
+#line 3484 "dk3app.ctr"
ptr = dk3str_rchr(fnb, DK3_CHAR_SEP);
if(ptr) {
*ptr = dkT('\0');
-#line 3479 "dk3app.ctr"
+#line 3488 "dk3app.ctr"
dk3sf_mkdir_app(fnb, 0700, NULL);
*ptr = DK3_CHAR_SEP;
}
fipo = dk3sf_fopen_app(fnb, dk3app_no_loc[24], app); /* WRITE */
if(fipo) {
-#line 3484 "dk3app.ctr"
+#line 3493 "dk3app.ctr"
#if DK3_ON_WINDOWS && (DK3_CHAR_SIZE > 1)
/* Switch to 16 bit characters. */
+#if defined(_MSC_VER)
(void)_setmode(_fileno(fipo), _O_U16TEXT);
+#endif
/* Write byte order marker. */
fputwc(0xFEFF, fipo);
#endif
@@ -2691,14 +2680,14 @@ dk3app_do_save_config(dk3_app_t *app)
fclose(fipo);
} else {
-#line 3516 "dk3app.ctr"
+#line 3527 "dk3app.ctr"
}
} else {
-#line 3518 "dk3app.ctr"
+#line 3529 "dk3app.ctr"
}
-#line 3519 "dk3app.ctr"
+#line 3530 "dk3app.ctr"
}
@@ -2713,23 +2702,23 @@ dk3app_close(dk3_app_t *app)
dk3app_mc_t *mcptr = NULL; /* Used to delete message catalogs. */
-#line 3532 "dk3app.ctr"
+#line 3543 "dk3app.ctr"
if(app) {
if(app->f_unconfigure) {
-#line 3535 "dk3app.ctr"
+#line 3546 "dk3app.ctr"
dk3app_do_unconfigure(app);
} else {
if(app->f_prefschanged) {
-#line 3538 "dk3app.ctr"
+#line 3549 "dk3app.ctr"
dk3app_do_save_config(app);
}
}
/* Clean up preferences system. */
-#line 3542 "dk3app.ctr"
+#line 3553 "dk3app.ctr"
if(app->s_selfprefs) {
if(app->i_selfprefs) {
dk3sto_it_reset(app->i_selfprefs);
@@ -2785,13 +2774,13 @@ dk3app_close(dk3_app_t *app)
} app->s_varprefs = NULL; app->i_varprefs = NULL;
/* Clean up temporary directory. */
-#line 3596 "dk3app.ctr"
+#line 3607 "dk3app.ctr"
if(app->ll_highest > app->ll_tmp_keep) {
dk3app_remove_temporary_files(app);
}
/* Remove log file if no longer needed. */
-#line 3600 "dk3app.ctr"
+#line 3611 "dk3app.ctr"
if(DK3_APP_TYPE_DAEMON != app->app_type) {
dk3app_log_i3(app, DK3_LL_DEBUG, 21, 22, app->n_app);
if(app->ll_highest > app->ll_file_keep) {
@@ -2805,7 +2794,7 @@ dk3app_close(dk3_app_t *app)
app->n_sourcefile = NULL;
app->sourceline = 0UL;
-#line 3612 "dk3app.ctr"
+#line 3623 "dk3app.ctr"
if(app->s_mc) {
if(app->i_mc) {
dk3sto_it_reset(app->i_mc);
@@ -2818,7 +2807,7 @@ dk3app_close(dk3_app_t *app)
dk3sto_close(app->s_mc);
} app->s_mc = NULL; app->i_mc = NULL;
-#line 3623 "dk3app.ctr"
+#line 3634 "dk3app.ctr"
if(app->argv) {
dkChar const **ptr;
ptr = (dkChar const **)(app->argv);
@@ -2828,7 +2817,7 @@ dk3app_close(dk3_app_t *app)
}
}
-#line 3631 "dk3app.ctr"
+#line 3642 "dk3app.ctr"
dk3_release(app->n_app);
dk3_release(app->n_execfile);
dk3_release(app->n_bindir);
@@ -2847,7 +2836,7 @@ dk3app_close(dk3_app_t *app)
dk3_delete(app);
}
-#line 3648 "dk3app.ctr"
+#line 3659 "dk3app.ctr"
}
@@ -2896,7 +2885,7 @@ dk3app_init(dk3_app_t *app)
{
-#line 3695 "dk3app.ctr"
+#line 3706 "dk3app.ctr"
app->app_type = 0;
app->msg = NULL;
app->n_sourcefile = NULL;
@@ -2940,11 +2929,11 @@ dk3app_init(dk3_app_t *app)
app->i_stdin_input_encoding = dk3app_get_default_stdin_encoding(app);
-#line 3737 "dk3app.ctr"
+#line 3748 "dk3app.ctr"
app->i_file_input_encoding = dk3app_get_default_file_encoding(app);
app->de = 0; /* No error found yet. */
-#line 3739 "dk3app.ctr"
+#line 3750 "dk3app.ctr"
app->s_mc = NULL;
app->i_mc = NULL;
app->s_cmdprefs = NULL;
@@ -2981,7 +2970,7 @@ dk3app_copy_bin_to_others(dk3_app_t *app)
{
-#line 3774 "dk3app.ctr"
+#line 3785 "dk3app.ctr"
app->n_etcdir = dk3str_dup_app(app->n_bindir, NULL);
if(app->n_etcdir) {
app->n_sharedir = dk3str_dup_app(app->n_bindir, NULL);
@@ -2997,7 +2986,7 @@ dk3app_copy_bin_to_others(dk3_app_t *app)
app->de = 7;
}
-#line 3788 "dk3app.ctr"
+#line 3799 "dk3app.ctr"
}
@@ -3096,14 +3085,22 @@ dk3app_reg_query_str(HKEY k, dkChar const *n, dkChar *b, size_t sz)
*/
static
int
-dk3app_get_language_string(dk3_app_t *app, dkChar *db, size_t sz)
+dk3app_get_language_string(
+#if (!(DK3_ON_WINDOWS)) && (DK3_CHAR_SIZE == 1)
+ dk3_app_t *app,
+#else
+ dk3_app_t * DK3_ARG_UNUSED(app),
+#endif
+ dkChar *db,
+ size_t sz
+)
{
int back = 0;
-#line 3890 "dk3app.ctr"
+#line 3909 "dk3app.ctr"
#if DK3_ON_WINDOWS
-
+ DK3_UNUSED_ARG(app)
#if VERSION_BEFORE_20131022
{
LONG res = 0L; /* Registry operation result. */
@@ -3156,11 +3153,13 @@ dk3app_get_language_string(dk3_app_t *app, dkChar *db, size_t sz)
}
}
}
+#else
+ DK3_UNUSED_ARG(app)
#endif
#endif
-#line 3947 "dk3app.ctr"
+#line 3968 "dk3app.ctr"
return back;
}
@@ -3168,29 +3167,27 @@ dk3app_get_language_string(dk3_app_t *app, dkChar *db, size_t sz)
/** Find language, region and encoding.
@param app Application structure.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
*/
static
void
-dk3app_language_and_region(dk3_app_t *app, int argc, dkChar const * const *argv)
+dk3app_language_and_region(dk3_app_t *app)
{
dkChar buffer[DK3_MAX_PATH]; /* Buffer to store language/region name. */
dkChar *ptr; /* Used to find region. */
dkChar *p2; /* Used to convert to lower characters. */
-#line 3965 "dk3app.ctr"
+#line 3984 "dk3app.ctr"
if(dk3app_get_language_string(app, buffer, DK3_SIZEOF(buffer,dkChar))) {
app->n_langstr = dk3str_dup_app(buffer, NULL);
-#line 3967 "dk3app.ctr"
+#line 3986 "dk3app.ctr"
if(app->n_langstr) {
ptr = dk3str_chr(buffer, dkT('.'));
if(ptr) {
*(ptr++) = dkT('\0');
-#line 3971 "dk3app.ctr"
+#line 3990 "dk3app.ctr"
#if DK3_CHAR_SIZE == 1
if(dk3str_casecmp(ptr, dk3app_no_loc[15]) == 0) {
app->i_encoding = DK3_ENCODING_UTF8;
@@ -3208,37 +3205,37 @@ dk3app_language_and_region(dk3_app_t *app, int argc, dkChar const * const *argv)
#endif
if(ptr) {
-#line 3987 "dk3app.ctr"
+#line 4006 "dk3app.ctr"
*(ptr++) = dkT('\0');
-#line 3988 "dk3app.ctr"
+#line 4007 "dk3app.ctr"
p2 = ptr; while(*p2) { *p2 = dk3str_tolower(*p2); p2++; }
app->n_region = dk3str_dup_app(ptr, NULL);
if(!(app->n_region)) {
-#line 3991 "dk3app.ctr"
+#line 4010 "dk3app.ctr"
app->de = 29;
}
}
if(!(app->de)) {
-#line 3995 "dk3app.ctr"
+#line 4014 "dk3app.ctr"
p2 = buffer; while(*p2) { *p2 = dk3str_tolower(*p2); p2++; }
app->n_language = dk3str_dup_app(buffer, NULL);
if(!(app->n_language)) {
-#line 3998 "dk3app.ctr"
+#line 4017 "dk3app.ctr"
app->de = 30;
}
}
} else {
-#line 4002 "dk3app.ctr"
+#line 4021 "dk3app.ctr"
app->de = 28;
}
}
-#line 4005 "dk3app.ctr"
+#line 4024 "dk3app.ctr"
}
@@ -3308,28 +3305,28 @@ dk3app_reduce_bindir_name(dkChar *dirname)
int back = 0;
-#line 4073 "dk3app.ctr"
+#line 4092 "dk3app.ctr"
if(dk3str_len(dirname) < DK3_SIZEOF(buffer,dkChar)) {
dk3str_cpy_not_overlapped(buffer, dirname);
pCurrent = NULL; pPrevious = NULL;
cc = 1;
while(cc) {
-#line 4078 "dk3app.ctr"
+#line 4097 "dk3app.ctr"
cc = 0;
if(dk3str_len(buffer) > 1) {
-#line 4080 "dk3app.ctr"
+#line 4099 "dk3app.ctr"
if(!dk3app_is_root_directory(buffer)) {
-#line 4081 "dk3app.ctr"
+#line 4100 "dk3app.ctr"
pCurrent = dk3str_rchr(buffer, DK3_CHAR_SEP);
if(pCurrent) {
-#line 4083 "dk3app.ctr"
+#line 4102 "dk3app.ctr"
cc = 1;
-#line 4084 "dk3app.ctr"
+#line 4103 "dk3app.ctr"
#if DK3_ON_WINDOWS
ai = dk3str_array_index(dk3app_bindir_candidates,&(pCurrent[1]),0);
#else
@@ -3337,14 +3334,14 @@ dk3app_reduce_bindir_name(dkChar *dirname)
#endif
if(-1 < ai) {
-#line 4090 "dk3app.ctr"
+#line 4109 "dk3app.ctr"
cc = 0;
sz = dk3str_len(buffer);
dirname[sz] = dkT('\0');
back = 1;
} else {
-#line 4095 "dk3app.ctr"
+#line 4114 "dk3app.ctr"
if(pPrevious) { *pPrevious = DK3_CHAR_SEP; }
pPrevious = pCurrent;
*pCurrent = dkT('\0');
@@ -3355,7 +3352,7 @@ dk3app_reduce_bindir_name(dkChar *dirname)
}
}
-#line 4104 "dk3app.ctr"
+#line 4123 "dk3app.ctr"
return back;
}
@@ -3364,14 +3361,13 @@ dk3app_reduce_bindir_name(dkChar *dirname)
/** Find all the names. Set app->de on errors, don't report directly.
@param app Application to configure.
@param wd Current working directory.
- @param argc Number of command line arguments.
@param argv Command line arguments array.
*/
static
void
dk3app_find_names(
dk3_app_t *app, dkChar const *wd,
- int argc, dkChar const * const *argv
+ dkChar const * const *argv
)
{
int must_relocate = 0; /* Flag: Must relocate. */
@@ -3389,18 +3385,18 @@ dk3app_find_names(
size_t tsl = 0; /* Buffer size needed. */
-#line 4136 "dk3app.ctr"
+#line 4154 "dk3app.ctr"
p = dk3str_rchr(argv[0], DK3_CHAR_SEP);
if(p) { p++; } else { p = (dkChar *)(argv[0]); }
n_app = dk3str_dup_app(p, NULL);
-#line 4139 "dk3app.ctr"
+#line 4157 "dk3app.ctr"
if(n_app) {
-#line 4140 "dk3app.ctr"
+#line 4158 "dk3app.ctr"
app->n_app = (dkChar const *)n_app;
-#line 4141 "dk3app.ctr"
+#line 4159 "dk3app.ctr"
p = dk3str_chr(n_app, DK3_CHAR_DOT);
if(p) { *p = DK3_CHAR_0; }
if(dk3sf_find_exec_app(buffer,DK3_SIZEOF(buffer,dkChar),wd,argv[0], NULL)) {
@@ -3551,7 +3547,7 @@ dk3app_find_names(
dk3str_correct_filename(buffer);
-#line 4290 "dk3app.ctr"
+#line 4308 "dk3app.ctr"
#if VERSION_BEFORE_20160128
if(dk3sf_mkdir_app(buffer, 0700, NULL)) {
dk3str_cat(buffer, dk3app_no_loc[20]);
@@ -3606,13 +3602,13 @@ dk3app_find_names(
dk3str_cat(buffer, dk3app_no_loc[4]);
-#line 4343 "dk3app.ctr"
+#line 4361 "dk3app.ctr"
if(dk3sf_mkdir_app(buffer, 0755, NULL)) {
dk3str_cat(buffer, dk3app_no_loc[20]);
dk3str_cat(buffer, app->n_app);
-#line 4347 "dk3app.ctr"
+#line 4365 "dk3app.ctr"
if(dk3sf_mkdir_app(buffer, 0755, NULL)) {
app->cr_log = 1;
dk3str_cat(buffer, dk3app_no_loc[20]);
@@ -3624,12 +3620,12 @@ dk3app_find_names(
}
} else {
-#line 4357 "dk3app.ctr"
+#line 4375 "dk3app.ctr"
app->de = 20;
}
} else {
-#line 4360 "dk3app.ctr"
+#line 4378 "dk3app.ctr"
app->de = 20;
}
} else {
@@ -3643,7 +3639,7 @@ dk3app_find_names(
}
if(!(app->de)) {
-#line 4372 "dk3app.ctr"
+#line 4390 "dk3app.ctr"
switch(app->app_type) {
case DK3_APP_TYPE_DAEMON: {
if(app->n_vardir) {
@@ -3670,23 +3666,23 @@ dk3app_find_names(
dk3str_correct_filename(buffer);
-#line 4397 "dk3app.ctr"
+#line 4415 "dk3app.ctr"
(void)dk3sf_mkdir_app(buffer,0700,NULL);
dk3str_cat(buffer, dk3app_no_loc[20]);
dk3str_cat(buffer, app->n_app);
dk3str_correct_filename(buffer);
-#line 4402 "dk3app.ctr"
+#line 4420 "dk3app.ctr"
(void)dk3sf_mkdir_app(buffer,0700,NULL);
dk3str_cat(buffer, dk3app_no_loc[20]);
dk3str_cat(buffer, dkpidbuffer);
-#line 4406 "dk3app.ctr"
+#line 4424 "dk3app.ctr"
-#line 4407 "dk3app.ctr"
+#line 4425 "dk3app.ctr"
if(dk3sf_mkdir_app(buffer,0700,NULL)) {
app->cr_tmp = 1;
app->n_tmpdir = dk3str_dup_app(buffer, NULL);
@@ -3735,7 +3731,7 @@ dk3app_find_names(
#if VERSION_BEFORE_20160128
-#line 4454 "dk3app.ctr"
+#line 4472 "dk3app.ctr"
if(dk3sf_mkdir_app(buffer,0700,NULL)) {
dk3str_cat(buffer, dk3app_no_loc[20]);
dk3str_cat(buffer, app->n_app);
@@ -3745,7 +3741,7 @@ dk3app_find_names(
#if VERSION_BEFORE_20150318
-#line 4462 "dk3app.ctr"
+#line 4480 "dk3app.ctr"
if(dk3sf_mkdir_app(buffer,0700,NULL)) {
app->n_tmpdir = dk3str_dup_app(buffer, NULL);
if(!(app->n_tmpdir)) {
@@ -3808,7 +3804,7 @@ dk3app_find_names(
app->de = 2;
}
-#line 4523 "dk3app.ctr"
+#line 4541 "dk3app.ctr"
}
@@ -3832,7 +3828,7 @@ dk3app_check_config_file(
dk3_stat_t stb; /* Stat buffer used to check existance of files. */
-#line 4545 "dk3app.ctr"
+#line 4563 "dk3app.ctr"
if(dk3app_config_name(app, fn, db, sz, passno, verb)) {
if(dk3sf_stat_app(&stb, db, NULL)) {
switch((stb.ft) & (~(DK3_FT_SYMLINK))) {
@@ -3848,7 +3844,7 @@ dk3app_check_config_file(
}
}
-#line 4559 "dk3app.ctr"
+#line 4577 "dk3app.ctr"
return back;
}
@@ -3875,7 +3871,7 @@ dk3app_add_pref(
dkChar *nv = NULL; /* New value string for preference. */
-#line 4584 "dk3app.ctr"
+#line 4602 "dk3app.ctr"
p.k = k; p.v = v;
pref = (dk3app_pref_t *)dk3sto_it_find_like(i, &p, 0);
if(pref) {
@@ -3907,7 +3903,7 @@ dk3app_add_pref(
}
}
-#line 4614 "dk3app.ctr"
+#line 4632 "dk3app.ctr"
return back;
}
@@ -3926,7 +3922,7 @@ dk3app_save_one_preference(dk3_app_t *app, dkChar const *pt)
dkChar *p1 = NULL; /* Value position. */
-#line 4631 "dk3app.ctr"
+#line 4649 "dk3app.ctr"
if(dk3str_len(pt) < DK3_SIZEOF(b,dkChar)) {
dk3str_cpy_not_overlapped(b, pt);
p1 = dk3str_chr(b, dkT('='));
@@ -3943,7 +3939,7 @@ dk3app_save_one_preference(dk3_app_t *app, dkChar const *pt)
} else {
app->de = 36;
-#line 4646 "dk3app.ctr"
+#line 4664 "dk3app.ctr"
}
}
if(!(app->i_cmdprefs)) {
@@ -3952,33 +3948,33 @@ dk3app_save_one_preference(dk3_app_t *app, dkChar const *pt)
} else {
app->de = 35;
-#line 4653 "dk3app.ctr"
+#line 4671 "dk3app.ctr"
}
}
if((app->s_cmdprefs) && (app->i_cmdprefs)) {
if(!dk3app_add_pref(NULL,app->s_cmdprefs,app->i_cmdprefs,b,p1)) {
app->de = 33;
-#line 4658 "dk3app.ctr"
+#line 4676 "dk3app.ctr"
}
}
} else {
app->de = 32;
-#line 4662 "dk3app.ctr"
+#line 4680 "dk3app.ctr"
}
} else {
app->de = 32;
-#line 4665 "dk3app.ctr"
+#line 4683 "dk3app.ctr"
}
} else {
app->de = 31;
-#line 4668 "dk3app.ctr"
+#line 4686 "dk3app.ctr"
}
-#line 4669 "dk3app.ctr"
+#line 4687 "dk3app.ctr"
}
@@ -4071,7 +4067,7 @@ dk3app_save_arguments(dk3_app_t *app, int argc, dkChar const * const *argv)
int i = 0; /* Index of current argv. */
-#line 4760 "dk3app.ctr"
+#line 4778 "dk3app.ctr"
myargv = dk3_new_app(DK3_PCDKCHAR,(argc+1),app);
if(myargv) {
ptr = myargv;
@@ -4080,14 +4076,14 @@ dk3app_save_arguments(dk3_app_t *app, int argc, dkChar const * const *argv)
for(i = 0; i < argc; i++) {
tptr = *(sptr++);
-#line 4767 "dk3app.ctr"
+#line 4785 "dk3app.ctr"
ispref = 0;
if(*tptr == DK3_CHAR_MINUS) {
if(tptr[1] == DK3_CHAR_MINUS) {
if(tptr[2] == DK3_CHAR_SLASH) {
ispref = 1;
-#line 4772 "dk3app.ctr"
+#line 4790 "dk3app.ctr"
}
}
}
@@ -4106,7 +4102,7 @@ dk3app_save_arguments(dk3_app_t *app, int argc, dkChar const * const *argv)
app->argc = myargc; app->argv = myargv;
}
-#line 4789 "dk3app.ctr"
+#line 4807 "dk3app.ctr"
}
@@ -4121,13 +4117,13 @@ dk3app_save_group_name(dk3_app_t *app, dkChar const *gn)
{
-#line 4802 "dk3app.ctr"
+#line 4820 "dk3app.ctr"
app->n_appgroup = dk3str_dup_app(gn,NULL);
if(!(app->n_appgroup)) {
app->de = 18;
}
-#line 4806 "dk3app.ctr"
+#line 4824 "dk3app.ctr"
}
@@ -4150,7 +4146,7 @@ dk3app_sto_pref(
dk3app_pref_t *pref = NULL; /* Entry found. */
-#line 4827 "dk3app.ctr"
+#line 4845 "dk3app.ctr"
if(p) {
pr.k = k; pr.v = NULL;
pref = (dk3app_pref_t *)dk3sto_it_find_like(p, &pr, 0);
@@ -4169,7 +4165,7 @@ dk3app_sto_pref(
}
}
-#line 4844 "dk3app.ctr"
+#line 4862 "dk3app.ctr"
return back;
}
@@ -4187,14 +4183,14 @@ dk3app_mc_array_size(dkChar const * const *dv)
dkChar const * const *ptr = NULL; /* Traverse the dv array. */
-#line 4860 "dk3app.ctr"
+#line 4878 "dk3app.ctr"
if(dv) {
ptr = dv;
while(*(ptr++)) { back++; }
back++;
}
-#line 4865 "dk3app.ctr"
+#line 4883 "dk3app.ctr"
return back;
}
@@ -4209,7 +4205,7 @@ dk3app_squeeze_line(char *lb)
ps = lb;
-#line 4878 "dk3app.ctr"
+#line 4896 "dk3app.ctr"
/* Remove trailing newline. */
while(*ps) {
if((*ps == '\r') || (*ps == '\n')) {
@@ -4248,7 +4244,7 @@ dk3app_squeeze_line(char *lb)
}
}
-#line 4915 "dk3app.ctr"
+#line 4933 "dk3app.ctr"
}
@@ -4282,58 +4278,58 @@ dk3app_my_messages(
FILE *fipo; /* Input file. */
-#line 4947 "dk3app.ctr"
+#line 4965 "dk3app.ctr"
if((app) && (fn) && (dv)) {
-#line 4948 "dk3app.ctr"
+#line 4966 "dk3app.ctr"
/* Find array size. */
sz_defaults = dk3app_mc_array_size(dv);
if(sz_defaults) {
-#line 4951 "dk3app.ctr"
+#line 4969 "dk3app.ctr"
if((app->s_mc) && (app->i_mc)) {
-#line 4952 "dk3app.ctr"
+#line 4970 "dk3app.ctr"
mc.n = fn; mc.msg = NULL; mc.f = 0; mc.nmsg = sz_defaults;
mcptr = (dk3app_mc_t *)dk3sto_it_find_like(app->i_mc, &mc, 0);
if(mcptr) {
-#line 4955 "dk3app.ctr"
+#line 4973 "dk3app.ctr"
if(mcptr->nmsg >= sz_defaults) {
back = mcptr->msg;
-#line 4957 "dk3app.ctr"
+#line 4975 "dk3app.ctr"
} else {
-#line 4958 "dk3app.ctr"
+#line 4976 "dk3app.ctr"
errors_occured = 1; /* Too short */
}
} else {
-#line 4961 "dk3app.ctr"
+#line 4979 "dk3app.ctr"
}
} else {
-#line 4963 "dk3app.ctr"
+#line 4981 "dk3app.ctr"
}
if((!(back)) && (errors_occured == 0)) {
-#line 4965 "dk3app.ctr"
+#line 4983 "dk3app.ctr"
if(dk3app_my_find_data_file(app, fn, fnb, DK3_MAX_PATH, verb)) {
source_file = dk3app_get_source_file(app);
-#line 4967 "dk3app.ctr"
+#line 4985 "dk3app.ctr"
source_line = dk3app_get_source_line(app);
dk3app_set_source_file(app, fnb);
dk3app_set_source_line(app, 0UL);
/* UTF8 */ fipo = dk3sf_fopen_app(fnb, dk3app_no_loc[22], (verb ? app : NULL));
if(fipo) {
-#line 4972 "dk3app.ctr"
+#line 4990 "dk3app.ctr"
rb = dk3_new_app(DK3_PCDKCHAR,sz_defaults,(verb ? app : NULL));
if(rb) {
-#line 4974 "dk3app.ctr"
+#line 4992 "dk3app.ctr"
for(i = 0; i < sz_defaults; i++) { rb[i] = NULL; }
current_index = 0;
/* We explicitly used 8-bit characters, the file is UTF-8 */
@@ -4385,69 +4381,69 @@ dk3app_my_messages(
}
}
-#line 5024 "dk3app.ctr"
+#line 5042 "dk3app.ctr"
dk3app_set_source_line(app, 0UL);
if((current_index >= (sz_defaults - 1)) && (!(errors_occured))) {
if(!(app->s_mc)) {
-#line 5027 "dk3app.ctr"
+#line 5045 "dk3app.ctr"
app->s_mc = dk3sto_open_app(verb ? app : NULL);
if(app->s_mc) {
-#line 5029 "dk3app.ctr"
+#line 5047 "dk3app.ctr"
dk3sto_set_comp(app->s_mc, dk3app_mc_compare, 0);
} else {
-#line 5031 "dk3app.ctr"
+#line 5049 "dk3app.ctr"
}
}
if(!(app->i_mc)) {
-#line 5034 "dk3app.ctr"
+#line 5052 "dk3app.ctr"
if(app->s_mc) {
-#line 5035 "dk3app.ctr"
+#line 5053 "dk3app.ctr"
app->i_mc = dk3sto_it_open(app->s_mc);
} else {
-#line 5037 "dk3app.ctr"
+#line 5055 "dk3app.ctr"
}
}
if((app->s_mc) && (app->i_mc)) {
-#line 5040 "dk3app.ctr"
+#line 5058 "dk3app.ctr"
mcptr =
dk3app_mc_new(fn, rb, sz_defaults, 1, (verb ? app: NULL));
if(mcptr) {
-#line 5043 "dk3app.ctr"
+#line 5061 "dk3app.ctr"
if(dk3sto_add(app->s_mc, mcptr)) {
-#line 5044 "dk3app.ctr"
+#line 5062 "dk3app.ctr"
back = rb;
} else {
dk3app_mc_table_delete(rb, sz_defaults); rb = NULL;
}
} else {
-#line 5049 "dk3app.ctr"
+#line 5067 "dk3app.ctr"
dk3app_mc_table_delete(rb, sz_defaults); rb = NULL;
}
} else {
-#line 5052 "dk3app.ctr"
+#line 5070 "dk3app.ctr"
dk3app_mc_table_delete(rb, sz_defaults); rb = NULL;
}
} else { /* Error occured or not enough strings. */
if(errors_occured) {
-#line 5056 "dk3app.ctr"
+#line 5074 "dk3app.ctr"
if(verb) {
/* Errors while reading file! */
}
} else {
-#line 5060 "dk3app.ctr"
+#line 5078 "dk3app.ctr"
if(verb) {
/* Too few entries in file! */
}
@@ -4457,38 +4453,38 @@ dk3app_my_messages(
}
} else {
-#line 5068 "dk3app.ctr"
+#line 5086 "dk3app.ctr"
}
fclose(fipo);
} else {
-#line 5071 "dk3app.ctr"
+#line 5089 "dk3app.ctr"
}
dk3app_set_source_file(app, source_file);
dk3app_set_source_line(app, source_line);
} else {
-#line 5075 "dk3app.ctr"
+#line 5093 "dk3app.ctr"
}
} else {
-#line 5077 "dk3app.ctr"
+#line 5095 "dk3app.ctr"
}
} else {
-#line 5079 "dk3app.ctr"
+#line 5097 "dk3app.ctr"
}
if(!(back)) {
-#line 5081 "dk3app.ctr"
+#line 5099 "dk3app.ctr"
back = dv;
}
} else {
-#line 5084 "dk3app.ctr"
+#line 5102 "dk3app.ctr"
}
-#line 5085 "dk3app.ctr"
+#line 5103 "dk3app.ctr"
return back;
}
@@ -4538,7 +4534,7 @@ dk3app_rd_pref_file(
lineno++;
dk3app_set_source_line(app, lineno);
-#line 5133 "dk3app.ctr"
+#line 5151 "dk3app.ctr"
p1 = dk3str_start(buffer, NULL);
if(p1) {
if(*p1 != dkT('#')) {
@@ -4566,7 +4562,7 @@ dk3app_rd_pref_file(
dk3str_chomp(p1, NULL);
dk3str_chomp(p3, NULL);
-#line 5159 "dk3app.ctr"
+#line 5177 "dk3app.ctr"
switch(dk3str_array_index(dk3app_scope_attributes, p1, 0))
{
case 0: { /* user */
@@ -4697,13 +4693,13 @@ dk3app_read_preference_files(dk3_app_t *app)
int i = 0; /* Pass. */
-#line 5288 "dk3app.ctr"
+#line 5306 "dk3app.ctr"
for(i = 0; i < 16; i++) {
if(dk3app_config_name(app, dk3app_no_loc[21], fnb, DK3_MAX_PATH, i, 0)) {
switch(i) {
case 14: {
-#line 5292 "dk3app.ctr"
+#line 5310 "dk3app.ctr"
if(!(app->s_varprefs)) {
app->s_varprefs = dk3sto_open_app(NULL);
if(app->s_varprefs) {
@@ -4724,7 +4720,7 @@ dk3app_read_preference_files(dk3_app_t *app)
} break;
case 12: case 13: case 15: {
-#line 5311 "dk3app.ctr"
+#line 5329 "dk3app.ctr"
if(!(app->s_constprefs)) {
app->s_constprefs = dk3sto_open_app(NULL);
if(app->s_constprefs) {
@@ -4745,7 +4741,7 @@ dk3app_read_preference_files(dk3_app_t *app)
} break;
default: {
-#line 5330 "dk3app.ctr"
+#line 5348 "dk3app.ctr"
if(!(app->s_sysprefs)) {
app->s_sysprefs = dk3sto_open_app(NULL);
if(app->s_sysprefs) {
@@ -4766,7 +4762,7 @@ dk3app_read_preference_files(dk3_app_t *app)
}
}
-#line 5349 "dk3app.ctr"
+#line 5367 "dk3app.ctr"
}
@@ -4789,42 +4785,42 @@ dk3app_find_ll(dk3_app_t *app, int ind, dkChar *buffer, size_t sz, int dv)
back = dv;
-#line 5370 "dk3app.ctr"
+#line 5388 "dk3app.ctr"
if(dk3app_get_pref(app, dk3app_no_loc[ind], buffer, sz)) {
-#line 5371 "dk3app.ctr"
+#line 5389 "dk3app.ctr"
p1 = dk3str_start(buffer, NULL);
if(p1) {
-#line 5374 "dk3app.ctr"
+#line 5392 "dk3app.ctr"
dk3str_chomp(p1, NULL);
-#line 5376 "dk3app.ctr"
+#line 5394 "dk3app.ctr"
i = dk3str_array_abbr(dk3app_log_levels, p1, dkT('$'), 0);
if(i >= 0) {
-#line 5378 "dk3app.ctr"
+#line 5396 "dk3app.ctr"
if(i <= DK3_LL_IGNORE) {
back = i;
-#line 5380 "dk3app.ctr"
+#line 5398 "dk3app.ctr"
}
} else {
-#line 5382 "dk3app.ctr"
+#line 5400 "dk3app.ctr"
}
} else {
-#line 5384 "dk3app.ctr"
+#line 5402 "dk3app.ctr"
}
} else {
-#line 5386 "dk3app.ctr"
+#line 5404 "dk3app.ctr"
}
-#line 5387 "dk3app.ctr"
+#line 5405 "dk3app.ctr"
return back;
}
@@ -4888,7 +4884,7 @@ dk3app_process_preferences(dk3_app_t *app)
app->i_stdin_input_encoding = dk3app_get_default_stdin_encoding(app);
-#line 5449 "dk3app.ctr"
+#line 5467 "dk3app.ctr"
app->i_file_input_encoding = dk3app_get_default_file_encoding(app);
if(dk3app_get_pref(app,dk3app_no_loc[51],buffer,DK3_SIZEOF(buffer,dkChar)))
{
@@ -4911,7 +4907,7 @@ dk3app_process_preferences(dk3_app_t *app)
app->i_stdin_input_encoding = i;
-#line 5470 "dk3app.ctr"
+#line 5488 "dk3app.ctr"
}
}
}
@@ -4940,7 +4936,7 @@ dk3app_open(
dk3_app_t *back = NULL;
-#line 5497 "dk3app.ctr"
+#line 5515 "dk3app.ctr"
back = dk3_new(dk3_app_t,1);
if(back) {
dk3app_init(back);
@@ -4952,8 +4948,8 @@ dk3app_open(
back->app_type = tp;
if(!(back->de)) { dk3app_save_group_name(back, gn); }
if(!(back->de)) { dk3app_first_silence_check(back, argc, argv); }
- if(!(back->de)) { dk3app_language_and_region(back, argc, argv); }
- if(!(back->de)) { dk3app_find_names(back, wd, argc, argv); }
+ if(!(back->de)) { dk3app_language_and_region(back); }
+ if(!(back->de)) { dk3app_find_names(back, wd, argv); }
if(!(back->de)) { dk3app_save_arguments(back, argc, argv); }
if(!(back->de)) { dk3app_read_preference_files(back); }
if(!(back->de)) { dk3app_process_preferences(back); }
@@ -4996,7 +4992,7 @@ dk3app_open(
{
/* No separator in executable file name! */
dk3app_log_i1(back, DK3_LL_ERROR, 40);
- }
+ } break;
case 10: /* Program is started from root directory. */
{
/* Too few directories in hierarchy! */
@@ -5061,7 +5057,7 @@ dk3app_open(
back = NULL;
} else {
-#line 5616 "dk3app.ctr"
+#line 5634 "dk3app.ctr"
dk3app_log_i3(back, DK3_LL_DEBUG, 19, 20, back->n_app);
dk3app_log_i2(
back, DK3_LL_DEBUG, 23,
@@ -5130,7 +5126,7 @@ dk3app_open(
}
}
-#line 5683 "dk3app.ctr"
+#line 5701 "dk3app.ctr"
return back;
}
@@ -5238,7 +5234,7 @@ dk3app_get_appname(dk3_app_t const *app)
back = app->n_app;
}
-#line 5789 "dk3app.ctr"
+#line 5807 "dk3app.ctr"
return back;
}
@@ -5361,7 +5357,7 @@ dk3app_get_temp_file_name(dk3_app_t *app, dkChar *db, size_t sz)
size_t s = 0; /* Buffer length needed. */
-#line 5910 "dk3app.ctr"
+#line 5928 "dk3app.ctr"
if((app) && (db) && (sz)) {
if(app->n_tmpdir) {
if ((DK3_APP_TYPE_DAEMON != app->app_type) && (0 == app->cr_tmp)) {
@@ -5375,10 +5371,10 @@ dk3app_get_temp_file_name(dk3_app_t *app, dkChar *db, size_t sz)
if (DK3_APP_TYPE_DAEMON != app->app_type) {
-#line 5922 "dk3app.ctr"
+#line 5940 "dk3app.ctr"
-#line 5923 "dk3app.ctr"
+#line 5941 "dk3app.ctr"
if (0 == dk3sf_mkdir_app(app->n_tmpdir, 0700, NULL)) {
back = 0;
}
@@ -5431,7 +5427,7 @@ dk3app_get_temp_file_name(dk3_app_t *app, dkChar *db, size_t sz)
}
}
-#line 5974 "dk3app.ctr"
+#line 5992 "dk3app.ctr"
return back;
}
@@ -5533,11 +5529,11 @@ dk3app_get_pref(dk3_app_t *app, dkChar const *k, dkChar *d, size_t s)
int back = 0;
-#line 6074 "dk3app.ctr"
+#line 6092 "dk3app.ctr"
if((app) && (k) && (d) && (s)) {
-#line 6076 "dk3app.ctr"
+#line 6094 "dk3app.ctr"
back = dk3app_sto_pref(app, app->i_selfprefs, k, d, s);
if(back == 0) {
back = dk3app_sto_pref(app, app->i_cmdprefs, k, d, s);
@@ -5553,16 +5549,16 @@ dk3app_get_pref(dk3_app_t *app, dkChar const *k, dkChar *d, size_t s)
}
-#line 6090 "dk3app.ctr"
+#line 6108 "dk3app.ctr"
-#line 6091 "dk3app.ctr"
+#line 6109 "dk3app.ctr"
-#line 6092 "dk3app.ctr"
+#line 6110 "dk3app.ctr"
}
-#line 6093 "dk3app.ctr"
+#line 6111 "dk3app.ctr"
return back;
}
@@ -5784,11 +5780,11 @@ dk3app_messages(dk3_app_t *app, dkChar const *fn, dkChar const * const *dv)
dkChar const * const *back;
-#line 6313 "dk3app.ctr"
+#line 6331 "dk3app.ctr"
back = dk3app_my_messages(app, fn, dv, 0);
-#line 6315 "dk3app.ctr"
+#line 6333 "dk3app.ctr"
return back;
}
@@ -5805,7 +5801,7 @@ dk3app_help(dk3_app_t *app, dkChar const *fn, dkChar const * const *dt)
dkChar const * const *ptr = NULL; /* Help text line. */
-#line 6330 "dk3app.ctr"
+#line 6348 "dk3app.ctr"
if((app) && (fn) && (dt)) {
dk3sf_initialize_stdout();
if(dk3app_my_find_data_file(app, fn, buffer, DK3_SIZEOF(buffer,dkChar), 0))
@@ -5815,7 +5811,7 @@ dk3app_help(dk3_app_t *app, dkChar const *fn, dkChar const * const *dt)
had_success = 1;
while(fgets(lb, sizeof(lb), fipo)) {
-#line 6338 "dk3app.ctr"
+#line 6356 "dk3app.ctr"
#if DK3_CHAR_SIZE == 2
if(dk3str_cnv_c8u_to_c16_app(db, DK3_SIZEOF(db,dkChar), lb, app)) {
dk3sf_fputs(db, stdout);
@@ -5846,7 +5842,7 @@ dk3app_help(dk3_app_t *app, dkChar const *fn, dkChar const * const *dt)
}
}
-#line 6367 "dk3app.ctr"
+#line 6385 "dk3app.ctr"
}
@@ -5879,17 +5875,11 @@ dk3app_log_write_error(dk3_app_t *app, int ll, size_t wished, size_t written)
dkChar b1[128]; /* Number of bytes wished to write. */
dkChar b2[128]; /* Number of bytes really written. */
-#if VERSION_BEFORE_20140716
- dk3sf_sprintf3(b1,dk3app_no_loc[35],((unsigned long)wished));
- dk3sf_sprintf3(b2,dk3app_no_loc[35],((unsigned long)written));
- dk3app_log_i5(app, ll, 170, 171, 172, b2, b1);
-#else
if (dk3ma_um_to_string(b1, DK3_SIZEOF(b1,dkChar), (dk3_um_t)wished)) {
if (dk3ma_um_to_string(b2, DK3_SIZEOF(b2,dkChar), (dk3_um_t)written)) {
dk3app_log_i5(app, ll, 170, 171, 172, b2, b1);
}
}
-#endif
}
@@ -5899,17 +5889,11 @@ dk3app_log_fwrite_error(dk3_app_t *app, int ll, size_t wished, size_t written)
{
dkChar b1[128]; /* Number of bytes wished to write. */
dkChar b2[128]; /* Number of bytes really written. */
-#if VERSION_BEFORE_20140716
- dk3sf_sprintf3(b1,dk3app_no_loc[35],((unsigned long)wished));
- dk3sf_sprintf3(b2,dk3app_no_loc[35],((unsigned long)written));
- dk3app_log_i5(app, ll, 174, 175, 176, b2, b1);
-#else
if (dk3ma_um_to_string(b1, DK3_SIZEOF(b1,dkChar), (dk3_um_t)wished)) {
if (dk3ma_um_to_string(b2, DK3_SIZEOF(b2,dkChar), (dk3_um_t)written)) {
dk3app_log_i5(app, ll, 174, 175, 176, b2, b1);
}
}
-#endif
}
@@ -5972,7 +5956,7 @@ dk3app_get_pref_int(dk3_app_t *app, dkChar const * name, int dv)
dkChar *p1;
-#line 6491 "dk3app.ctr"
+#line 6497 "dk3app.ctr"
back = dv;
if(app) {
if(dk3app_get_pref(app, name, buffer, DK3_SIZEOF(buffer,dkChar))) {
@@ -5990,7 +5974,7 @@ dk3app_get_pref_int(dk3_app_t *app, dkChar const * name, int dv)
}
}
-#line 6507 "dk3app.ctr"
+#line 6513 "dk3app.ctr"
return back;
}
@@ -6079,16 +6063,16 @@ dk3app_rand_find_allowed_types(dk3_app_t *app)
dkChar buffer[256];
-#line 6594 "dk3app.ctr"
+#line 6600 "dk3app.ctr"
if(dk3app_get_pref(app,dk3app_no_loc[37],buffer,DK3_SIZEOF(buffer,dkChar)))
{
-#line 6596 "dk3app.ctr"
+#line 6602 "dk3app.ctr"
back = dk3app_get_allowed_prng_types(app, buffer);
}
-#line 6599 "dk3app.ctr"
+#line 6605 "dk3app.ctr"
return back;
}
@@ -6140,12 +6124,12 @@ dk3app_get_seed_from_source(dk3_app_t *app,void *dp,size_t sz,dkChar const *fn)
int mode_denied;
-#line 6649 "dk3app.ctr"
+#line 6655 "dk3app.ctr"
/* DEBUG: Attempting to get seed data from ... */
dk3app_log_i3(app, DK3_LL_DEBUG, 196, 197, fn);
if(dk3sf_stat_app(&stb, fn, NULL)) {
-#line 6652 "dk3app.ctr"
+#line 6658 "dk3app.ctr"
switch((stb.ft) & (~(DK3_FT_SYMLINK))) {
case DK3_FT_DIRECTORY: {
/* Ignore it. */
@@ -6191,7 +6175,7 @@ dk3app_get_seed_from_source(dk3_app_t *app,void *dp,size_t sz,dkChar const *fn)
}
}
-#line 6696 "dk3app.ctr"
+#line 6702 "dk3app.ctr"
/* DEBUG: Seed data: ... bytes. */
{
char b1[64];
@@ -6523,9 +6507,15 @@ dk3app_rand_bytes_internal(dk3_app_t *app, void *db, size_t sz, int f_crypto)
back = sz;
}
} else {
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x1010000FL
+ if(RAND_bytes(ucptr, (int)sz) == 1) {
+ back = sz;
+ }
+#else
if(RAND_pseudo_bytes(ucptr, (int)sz) > -1) {
back = sz;
}
+#endif
}
#else
/* BUG: Not available! */
@@ -6727,16 +6717,16 @@ dk3app_process_stdin_chars(
#endif
-#line 7230 "dk3app.ctr"
+#line 7242 "dk3app.ctr"
if((app) && (hf)) {
-#line 7231 "dk3app.ctr"
+#line 7243 "dk3app.ctr"
ie = de;
if(ie < 0) {
ie = app->i_stdin_input_encoding;
}
-#line 7235 "dk3app.ctr"
+#line 7247 "dk3app.ctr"
if(dk3app_get_temp_file_name(app, tfn, DK3_SIZEOF(tfn,dkChar))) {
fipo = dk3sf_fopen_app(tfn, dk3app_no_loc[53], app);
if(fipo) {
@@ -6769,7 +6759,7 @@ dk3app_process_stdin_chars(
}
}
-#line 7266 "dk3app.ctr"
+#line 7278 "dk3app.ctr"
return back;
}
@@ -6803,49 +6793,49 @@ dk3app_change_owner_for_file(
int back = 1;
-#line 7298 "dk3app.ctr"
+#line 7310 "dk3app.ctr"
sprintf(tmb, "/%08lx.%03x", ul1, ul2);
if(dk3str_c8_to_str_simple_app(smb,DK3_SIZEOF(smb,dkChar),tmb,app)) {
if(dk3str_len(app->n_tmpdir) < DK3_SIZEOF(fnb,dkChar)) {
-#line 7301 "dk3app.ctr"
+#line 7313 "dk3app.ctr"
dk3str_cpy_not_overlapped(fnb, app->n_tmpdir);
if((dk3str_len(fnb) + dk3str_len(smb)) < DK3_SIZEOF(fnb,dkChar)) {
dk3str_cat(fnb, smb);
dk3str_correct_filename(fnb);
if(dk3sf_stat_app(&stb, fnb, NULL)) {
-#line 7306 "dk3app.ctr"
+#line 7318 "dk3app.ctr"
if(0 != chown(fnb, uid, gid)) {
-#line 7307 "dk3app.ctr"
+#line 7319 "dk3app.ctr"
back = 0;
} else {
-#line 7309 "dk3app.ctr"
+#line 7321 "dk3app.ctr"
}
} else {
-#line 7311 "dk3app.ctr"
+#line 7323 "dk3app.ctr"
/* If there is no such file, there is no need to change owner. */
}
} else {
-#line 7314 "dk3app.ctr"
+#line 7326 "dk3app.ctr"
back = 0;
}
} else {
-#line 7317 "dk3app.ctr"
+#line 7329 "dk3app.ctr"
back = 0;
}
} else {
-#line 7320 "dk3app.ctr"
+#line 7332 "dk3app.ctr"
}
-#line 7322 "dk3app.ctr"
+#line 7334 "dk3app.ctr"
return back;
}
@@ -6858,13 +6848,13 @@ dk3app_change_user(dk3_app_t *app, uid_t uid, gid_t gid)
int back = 1;
-#line 7333 "dk3app.ctr"
+#line 7345 "dk3app.ctr"
if((app) && ((uid) || (gid))) {
-#line 7334 "dk3app.ctr"
+#line 7346 "dk3app.ctr"
if(app->n_logfilename) {
-#line 7335 "dk3app.ctr"
+#line 7347 "dk3app.ctr"
if (0 == app->cr_log) {
dk3app_create_log_directory(app);
app->cr_log = 1;
@@ -6875,31 +6865,31 @@ dk3app_change_user(dk3_app_t *app, uid_t uid, gid_t gid)
}
if(0 != chown(app->n_logfilename, uid, gid)) {
-#line 7344 "dk3app.ctr"
+#line 7356 "dk3app.ctr"
back = 0;
} else {
-#line 7346 "dk3app.ctr"
+#line 7358 "dk3app.ctr"
}
} else {
-#line 7348 "dk3app.ctr"
+#line 7360 "dk3app.ctr"
}
if(app->n_tmpdir) {
-#line 7350 "dk3app.ctr"
+#line 7362 "dk3app.ctr"
if(0 != chown(app->n_tmpdir, uid, gid)) {
back = 0;
}
if(app->i_tmpcarry) {
-#line 7354 "dk3app.ctr"
+#line 7366 "dk3app.ctr"
for(ul1 = 0UL; ul1 < 0xFFFFFFFFUL; ul1++) {
for(ul2 = 0U; ul2 < 0x00001000U; ul2++) {
if(!dk3app_change_owner_for_file(app, ul1, ul2, uid, gid)) {
back = 0;
-#line 7358 "dk3app.ctr"
+#line 7370 "dk3app.ctr"
}
}
}
@@ -6907,7 +6897,7 @@ dk3app_change_user(dk3_app_t *app, uid_t uid, gid_t gid)
if(!dk3app_change_owner_for_file(app, 0xFFFFFFFFUL, ul2, uid, gid)) {
back = 0;
-#line 7364 "dk3app.ctr"
+#line 7376 "dk3app.ctr"
}
}
} else {
@@ -6916,7 +6906,7 @@ dk3app_change_user(dk3_app_t *app, uid_t uid, gid_t gid)
if(!dk3app_change_owner_for_file(app, ul1, ul2, uid, gid)) {
back = 0;
-#line 7371 "dk3app.ctr"
+#line 7383 "dk3app.ctr"
}
}
}
@@ -6924,20 +6914,20 @@ dk3app_change_user(dk3_app_t *app, uid_t uid, gid_t gid)
if(!dk3app_change_owner_for_file(app,app->ul_tmpname,ul2,uid,gid)) {
back = 0;
-#line 7377 "dk3app.ctr"
+#line 7389 "dk3app.ctr"
}
}
}
} else {
-#line 7381 "dk3app.ctr"
+#line 7393 "dk3app.ctr"
}
} else {
-#line 7383 "dk3app.ctr"
+#line 7395 "dk3app.ctr"
}
-#line 7384 "dk3app.ctr"
+#line 7396 "dk3app.ctr"
return back;
}
#endif
diff --git a/support/dktools/dk3app.ctr b/support/dktools/dk3app.ctr
index 5af2002ec1..290f4873ce 100644
--- a/support/dktools/dk3app.ctr
+++ b/support/dktools/dk3app.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -700,6 +700,9 @@ dk3app_get_dir_from_pref(
%% module
#include "dk3all.h"
+#include "dk3unused.h"
+
+
#if DK3_HAVE_OPENSSL_RAND_H
#include <openssl/rand.h>
@@ -2515,11 +2518,13 @@ dk3app_pref_new(dkChar const *k, dkChar const *v)
*/
static
int
-dk3app_compare_pref(void const *l, void const *r, int crit)
+dk3app_compare_pref(void const *l, void const *r, int DK3_ARG_UNUSED(crit) )
{
int back = 0;
dk3app_pref_t const *pl = NULL; /* Left object. */
dk3app_pref_t const *pr = NULL; /* Right object. */
+
+ DK3_UNUSED_ARG(crit)
if(l) {
if(r) {
pl = (dk3app_pref_t const *)l; pr = (dk3app_pref_t const *)r;
@@ -2622,11 +2627,13 @@ dk3app_mc_new(
*/
static
int
-dk3app_mc_compare(void const *l, void const *r, int cr)
+dk3app_mc_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
dk3app_mc_t const *pl = NULL; /* Left message catalog. */
dk3app_mc_t const *pr = NULL; /* Right message catalog. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3app_mc_t const *)l; pr = (dk3app_mc_t const *)r;
@@ -2798,7 +2805,9 @@ dk3app_log_file(dk3_app_t *app, int ll, dkChar const * const * msg, size_t nmsg)
if(fipo) { $? ". file opened"
#if DK3_ON_WINDOWS && (DK3_CHAR_SIZE > 1)
/* Switch to 16 bit characters. */
+#if defined(_MSC_VER)
(void)_setmode(_fileno(fipo), _O_U16TEXT);
+#endif
/* Write byte order marker. */
if(app->f_first_file_log) {
fputwc(0xFEFF, fipo);
@@ -3483,7 +3492,9 @@ dk3app_do_save_config(dk3_app_t *app)
if(fipo) { $? ". file opened"
#if DK3_ON_WINDOWS && (DK3_CHAR_SIZE > 1)
/* Switch to 16 bit characters. */
+#if defined(_MSC_VER)
(void)_setmode(_fileno(fipo), _O_U16TEXT);
+#endif
/* Write byte order marker. */
fputwc(0xFEFF, fipo);
#endif
@@ -3883,12 +3894,20 @@ dk3app_reg_query_str(HKEY k, dkChar const *n, dkChar *b, size_t sz)
*/
static
int
-dk3app_get_language_string(dk3_app_t *app, dkChar *db, size_t sz)
+dk3app_get_language_string(
+#if (!(DK3_ON_WINDOWS)) && (DK3_CHAR_SIZE == 1)
+ dk3_app_t *app,
+#else
+ dk3_app_t * DK3_ARG_UNUSED(app),
+#endif
+ dkChar *db,
+ size_t sz
+)
{
int back = 0;
$? "+ dk3app_get_language_string"
#if DK3_ON_WINDOWS
-
+ DK3_UNUSED_ARG(app)
#if VERSION_BEFORE_20131022
{
LONG res = 0L; /* Registry operation result. */
@@ -3941,6 +3960,8 @@ dk3app_get_language_string(dk3_app_t *app, dkChar *db, size_t sz)
}
}
}
+#else
+ DK3_UNUSED_ARG(app)
#endif
#endif
$? "- dk3app_get_language_string %d", back
@@ -3951,12 +3972,10 @@ dk3app_get_language_string(dk3_app_t *app, dkChar *db, size_t sz)
/** Find language, region and encoding.
@param app Application structure.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
*/
static
void
-dk3app_language_and_region(dk3_app_t *app, int argc, dkChar const * const *argv)
+dk3app_language_and_region(dk3_app_t *app)
{
dkChar buffer[DK3_MAX_PATH]; /* Buffer to store language/region name. */
dkChar *ptr; /* Used to find region. */
@@ -4109,14 +4128,13 @@ dk3app_reduce_bindir_name(dkChar *dirname)
/** Find all the names. Set app->de on errors, don't report directly.
@param app Application to configure.
@param wd Current working directory.
- @param argc Number of command line arguments.
@param argv Command line arguments array.
*/
static
void
dk3app_find_names(
dk3_app_t *app, dkChar const *wd,
- int argc, dkChar const * const *argv
+ dkChar const * const *argv
)
{
int must_relocate = 0; /* Flag: Must relocate. */
@@ -5505,8 +5523,8 @@ dk3app_open(
back->app_type = tp;
if(!(back->de)) { dk3app_save_group_name(back, gn); }
if(!(back->de)) { dk3app_first_silence_check(back, argc, argv); }
- if(!(back->de)) { dk3app_language_and_region(back, argc, argv); }
- if(!(back->de)) { dk3app_find_names(back, wd, argc, argv); }
+ if(!(back->de)) { dk3app_language_and_region(back); }
+ if(!(back->de)) { dk3app_find_names(back, wd, argv); }
if(!(back->de)) { dk3app_save_arguments(back, argc, argv); }
if(!(back->de)) { dk3app_read_preference_files(back); }
if(!(back->de)) { dk3app_process_preferences(back); }
@@ -5549,7 +5567,7 @@ dk3app_open(
{
/* No separator in executable file name! */
dk3app_log_i1(back, DK3_LL_ERROR, 40);
- }
+ } break;
case 10: /* Program is started from root directory. */
{
/* Too few directories in hierarchy! */
@@ -6396,17 +6414,11 @@ dk3app_log_write_error(dk3_app_t *app, int ll, size_t wished, size_t written)
dkChar b1[128]; /* Number of bytes wished to write. */
dkChar b2[128]; /* Number of bytes really written. */
-#if VERSION_BEFORE_20140716
- dk3sf_sprintf3(b1,dk3app_no_loc[35],((unsigned long)wished));
- dk3sf_sprintf3(b2,dk3app_no_loc[35],((unsigned long)written));
- dk3app_log_i5(app, ll, 170, 171, 172, b2, b1);
-#else
if (dk3ma_um_to_string(b1, DK3_SIZEOF(b1,dkChar), (dk3_um_t)wished)) {
if (dk3ma_um_to_string(b2, DK3_SIZEOF(b2,dkChar), (dk3_um_t)written)) {
dk3app_log_i5(app, ll, 170, 171, 172, b2, b1);
}
}
-#endif
}
@@ -6416,17 +6428,11 @@ dk3app_log_fwrite_error(dk3_app_t *app, int ll, size_t wished, size_t written)
{
dkChar b1[128]; /* Number of bytes wished to write. */
dkChar b2[128]; /* Number of bytes really written. */
-#if VERSION_BEFORE_20140716
- dk3sf_sprintf3(b1,dk3app_no_loc[35],((unsigned long)wished));
- dk3sf_sprintf3(b2,dk3app_no_loc[35],((unsigned long)written));
- dk3app_log_i5(app, ll, 174, 175, 176, b2, b1);
-#else
if (dk3ma_um_to_string(b1, DK3_SIZEOF(b1,dkChar), (dk3_um_t)wished)) {
if (dk3ma_um_to_string(b2, DK3_SIZEOF(b2,dkChar), (dk3_um_t)written)) {
dk3app_log_i5(app, ll, 174, 175, 176, b2, b1);
}
}
-#endif
}
@@ -7024,9 +7030,15 @@ dk3app_rand_bytes_internal(dk3_app_t *app, void *db, size_t sz, int f_crypto)
back = sz;
}
} else {
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x1010000FL
+ if(RAND_bytes(ucptr, (int)sz) == 1) {
+ back = sz;
+ }
+#else
if(RAND_pseudo_bytes(ucptr, (int)sz) > -1) {
back = sz;
}
+#endif
}
#else
/* BUG: Not available! */
diff --git a/support/dktools/dk3app.h b/support/dktools/dk3app.h
index e85083fe56..59c7ee0ac8 100644
--- a/support/dktools/dk3app.h
+++ b/support/dktools/dk3app.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3app.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3app.ctr
*/
#ifndef DK3APP_H_INCLUDED
diff --git a/support/dktools/dk3appr.c b/support/dktools/dk3appr.c
index ae661e85c4..31fd8098f3 100644
--- a/support/dktools/dk3appr.c
+++ b/support/dktools/dk3appr.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3appr.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3appr.ctr
*/
/** @file dk3appr.c The dk3appr module.
@@ -652,12 +630,11 @@ dk3app_rand_init(dk3_app_t *app, dkChar const *il)
@param app Application structure.
@param db Destination buffer.
@param sz Size of \a db (number of bytes).
- @param f_crypto Flag: For cryptographic purposes.
@return Number of bytes written to \a db.
*/
static
size_t
-dk3app_rand_bytes_internal(dk3_app_t *app, void *db, size_t sz, int f_crypto)
+dk3app_rand_bytes_internal(dk3_app_t *app, void *db, size_t sz)
{
size_t back = 0;
unsigned char *ucptr = NULL;
@@ -672,14 +649,8 @@ dk3app_rand_bytes_internal(dk3_app_t *app, void *db, size_t sz, int f_crypto)
switch(app->rand_type) {
case DK3_PRNG_OPENSSL: {
#if DK3_HAVE_OPENSSL_RAND_H
- if(f_crypto) {
- if(RAND_bytes(ucptr, (int)sz) == 1) {
- back = sz;
- }
- } else {
- if(RAND_pseudo_bytes(ucptr, (int)sz) > -1) {
- back = sz;
- }
+ if(RAND_bytes(ucptr, (int)sz) == 1) {
+ back = sz;
}
#else
/* BUG: Not available! */
@@ -763,7 +734,7 @@ size_t
dk3app_rand_bytes(dk3_app_t *app, void *db, size_t sz)
{
size_t back;
- back = dk3app_rand_bytes_internal(app, db, sz, 1);
+ back = dk3app_rand_bytes_internal(app, db, sz);
return back;
}
@@ -771,9 +742,7 @@ dk3app_rand_bytes(dk3_app_t *app, void *db, size_t sz)
size_t
dk3app_rand_bytes_non_crypto(dk3_app_t *app, void *db, size_t sz)
{
- size_t back;
- back = dk3app_rand_bytes_internal(app, db, sz, 0);
- return back;
+ return ( dk3app_rand_bytes(app, db, sz) );
}
@@ -795,10 +764,10 @@ dk3app_rand_end(dk3_app_t *app)
#endif
-#line 709 "dk3appr.ctr"
+#line 700 "dk3appr.ctr"
if((app->f_rand_initialized) && (app->f_rand_success)) {
-#line 710 "dk3appr.ctr"
+#line 701 "dk3appr.ctr"
switch(app->rand_type) {
case DK3_PRNG_OPENSSL: {
#if DK3_HAVE_OPENSSL_RAND_H
@@ -821,7 +790,7 @@ dk3app_rand_end(dk3_app_t *app)
dk3str_cat(fnb, p4);
dk3str_cat(fnb, p5);
-#line 731 "dk3appr.ctr"
+#line 722 "dk3appr.ctr"
fipo = dk3sf_fopen_app(fnb, dk3app_not_localized(24), app);
if(fipo) {
fclose(fipo); fipo = NULL;
@@ -845,10 +814,10 @@ dk3app_rand_end(dk3_app_t *app)
}
} else {
-#line 753 "dk3appr.ctr"
+#line 744 "dk3appr.ctr"
}
-#line 754 "dk3appr.ctr"
+#line 745 "dk3appr.ctr"
}
diff --git a/support/dktools/dk3appr.ctr b/support/dktools/dk3appr.ctr
index b96268979d..5d47cc66b6 100644
--- a/support/dktools/dk3appr.ctr
+++ b/support/dktools/dk3appr.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -564,12 +564,11 @@ dk3app_rand_init(dk3_app_t *app, dkChar const *il)
@param app Application structure.
@param db Destination buffer.
@param sz Size of \a db (number of bytes).
- @param f_crypto Flag: For cryptographic purposes.
@return Number of bytes written to \a db.
*/
static
size_t
-dk3app_rand_bytes_internal(dk3_app_t *app, void *db, size_t sz, int f_crypto)
+dk3app_rand_bytes_internal(dk3_app_t *app, void *db, size_t sz)
{
size_t back = 0;
unsigned char *ucptr = NULL;
@@ -584,14 +583,8 @@ dk3app_rand_bytes_internal(dk3_app_t *app, void *db, size_t sz, int f_crypto)
switch(app->rand_type) {
case DK3_PRNG_OPENSSL: {
#if DK3_HAVE_OPENSSL_RAND_H
- if(f_crypto) {
- if(RAND_bytes(ucptr, (int)sz) == 1) {
- back = sz;
- }
- } else {
- if(RAND_pseudo_bytes(ucptr, (int)sz) > -1) {
- back = sz;
- }
+ if(RAND_bytes(ucptr, (int)sz) == 1) {
+ back = sz;
}
#else
/* BUG: Not available! */
@@ -675,7 +668,7 @@ size_t
dk3app_rand_bytes(dk3_app_t *app, void *db, size_t sz)
{
size_t back;
- back = dk3app_rand_bytes_internal(app, db, sz, 1);
+ back = dk3app_rand_bytes_internal(app, db, sz);
return back;
}
@@ -683,9 +676,7 @@ dk3app_rand_bytes(dk3_app_t *app, void *db, size_t sz)
size_t
dk3app_rand_bytes_non_crypto(dk3_app_t *app, void *db, size_t sz)
{
- size_t back;
- back = dk3app_rand_bytes_internal(app, db, sz, 0);
- return back;
+ return ( dk3app_rand_bytes(app, db, sz) );
}
diff --git a/support/dktools/dk3bb.c b/support/dktools/dk3bb.c
index 31ada4f682..96c648f23f 100644
--- a/support/dktools/dk3bb.c
+++ b/support/dktools/dk3bb.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bb.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bb.ctr
*/
/** @file dk3bb.c The dk3bb module.
diff --git a/support/dktools/dk3bb.ctr b/support/dktools/dk3bb.ctr
index 9316c415ad..1d5eb50b97 100644
--- a/support/dktools/dk3bb.ctr
+++ b/support/dktools/dk3bb.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3bb.h b/support/dktools/dk3bb.h
index bae6f7c485..a408b5d34a 100644
--- a/support/dktools/dk3bb.h
+++ b/support/dktools/dk3bb.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bb.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bb.ctr
*/
/** @file dk3bb.h Header file for the dk3bb module.
diff --git a/support/dktools/dk3bezcu.c b/support/dktools/dk3bezcu.c
index ecd25a27a9..cf1e26dc04 100644
--- a/support/dktools/dk3bezcu.c
+++ b/support/dktools/dk3bezcu.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bezcu.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bezcu.ctr
*/
/** @file dk3bezcu.c The dk3bezcu module.
@@ -51,6 +29,40 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#if !(defined(isgreaterequal))
+#if DK3_HAVE_ISFINITE
+/** Test whether a is greater than or equal to b. */
+#define isgreaterequal(a,b) ((isfinite(a)) && (isfinite(b)) && (a >= b))
+#else
+#if DK3_HAVE__FINITE
+/** Test whether a is greater than or equal to b. */
+#define isgreaterequal(a,b) ((_finite(a)) && (_finite(b)) && (a >= b))
+#else
+/** Test whether a is greater than or equal to b. */
+#define isgreaterequal(a,b) (a >= b)
+#endif
+#endif
+#endif
+
+
+
+#if !(defined(islessequal))
+#if DK3_HAVE_ISFINITE
+/** Test whether a is less than or equal to b. */
+#define islessequal(a,b) ((isfinite(a)) && (isfinite(b)) && (a <= b))
+#else
+#if DK3_HAVE__FINITE
+/** Test whether a is less than or equal to b. */
+#define islessequal(a,b) ((_finite(a)) && (_finite(b)) && (a <= b))
+#else
+/** Test whether a is less than or equal to b. */
+#define islessequal(a,b) (a <= b)
+#endif
+#endif
+#endif
+
+
+
double
dk3bezier_value(
double x0, double xp, double xm, double x1, double t, int *ec
@@ -60,7 +72,7 @@ dk3bezier_value(
double back;
-#line 81 "dk3bezcu.ctr"
+#line 115 "dk3bezcu.ctr"
back = dk3ma_d_add_ok(
x0,
dk3ma_d_mul_ok(
@@ -107,13 +119,13 @@ dk3bezier_value(
&mec
);
-#line 126 "dk3bezcu.ctr"
+#line 160 "dk3bezcu.ctr"
if(mec) {
if(ec) { *ec = mec; }
}
-#line 130 "dk3bezcu.ctr"
+#line 164 "dk3bezcu.ctr"
return back;
}
@@ -150,12 +162,12 @@ dk3bezier_t_dimension(
int mec = 0;
-#line 165 "dk3bezcu.ctr"
+#line 199 "dk3bezcu.ctr"
if(tv > 0.0) {
if(tv < 1.0) {
val = dk3bezier_value(x0, xp, xm, x1, tv, &mec);
-#line 168 "dk3bezcu.ctr"
+#line 202 "dk3bezcu.ctr"
if(isy) {
if(!dk3bb_add_y_width(bb, val, ra)) { back = 0; }
} else {
@@ -165,12 +177,12 @@ dk3bezier_t_dimension(
}
if(mec) {
-#line 176 "dk3bezcu.ctr"
+#line 210 "dk3bezcu.ctr"
back = 0;
if(ec) { *ec = mec; }
}
-#line 179 "dk3bezcu.ctr"
+#line 213 "dk3bezcu.ctr"
return back;
}
@@ -209,21 +221,21 @@ dk3bezier_bb_dimension(
int mec = 0;
-#line 216 "dk3bezcu.ctr"
+#line 250 "dk3bezcu.ctr"
n = dk3ma_d_add_ok(
dk3ma_d_sub_ok(x1, x0, &mec),
dk3ma_d_mul_ok(3.0, dk3ma_d_sub_ok(xp, xm, &mec), &mec),
&mec
);
-#line 221 "dk3bezcu.ctr"
+#line 255 "dk3bezcu.ctr"
z1 = dk3ma_d_sub_ok(
dk3ma_d_sub_ok(dk3ma_d_mul_ok(2.0, xp, &mec), xm, &mec),
x0,
&mec
);
-#line 226 "dk3bezcu.ctr"
+#line 260 "dk3bezcu.ctr"
z2 = dk3ma_d_add_ok(
dk3ma_d_sub_ok(
xm,
@@ -234,7 +246,7 @@ dk3bezier_bb_dimension(
&mec
);
-#line 235 "dk3bezcu.ctr"
+#line 269 "dk3bezcu.ctr"
z2 = dk3ma_d_mul_ok(z2, z2, &mec);
z2 = dk3ma_d_sub_ok(
z2,
@@ -246,47 +258,48 @@ dk3bezier_bb_dimension(
&mec
);
-#line 245 "dk3bezcu.ctr"
+#line 279 "dk3bezcu.ctr"
if(z2 >= 0.0) {
z2 = sqrt(z2);
-#line 247 "dk3bezcu.ctr"
+#line 281 "dk3bezcu.ctr"
t = dk3ma_d_div_ok(
dk3ma_d_add_ok(z1, z2, &mec),
n,
&mec
);
-#line 252 "dk3bezcu.ctr"
+#line 286 "dk3bezcu.ctr"
if(!dk3bezier_t_dimension(bb, x0, xp, xm, x1, ra, t, isy, &mec)) {
back = 0;
}
-#line 255 "dk3bezcu.ctr"
+#line 289 "dk3bezcu.ctr"
t = dk3ma_d_div_ok(
dk3ma_d_sub_ok(z1, z2, &mec),
n,
&mec
);
-#line 260 "dk3bezcu.ctr"
+#line 294 "dk3bezcu.ctr"
if(!dk3bezier_t_dimension(bb, x0, xp, xm, x1, ra, t, isy, &mec)) {
back = 0;
}
-#line 263 "dk3bezcu.ctr"
+#line 297 "dk3bezcu.ctr"
}
if(mec) {
-#line 265 "dk3bezcu.ctr"
+#line 299 "dk3bezcu.ctr"
back = 0;
if(ec) { *ec = mec; }
}
-#line 268 "dk3bezcu.ctr"
+#line 302 "dk3bezcu.ctr"
return back;
}
#else
+#if VERSION_BEFORE_20170609
/** Apply one dimension to a bounding box.
@param bb Bounding box to modify.
@param x0 Start value.
@@ -320,21 +333,21 @@ dk3bezier_bb_dimension(
int testmec;
-#line 303 "dk3bezcu.ctr"
+#line 338 "dk3bezcu.ctr"
n = dk3ma_d_add_ok(
dk3ma_d_sub_ok(x1, x0, &mec),
dk3ma_d_mul_ok(3.0, dk3ma_d_sub_ok(xp, xm, &mec), &mec),
&mec
);
-#line 308 "dk3bezcu.ctr"
+#line 343 "dk3bezcu.ctr"
z1 = dk3ma_d_sub_ok(
dk3ma_d_sub_ok(dk3ma_d_mul_ok(2.0, xp, &mec), xm, &mec),
x0,
&mec
);
-#line 313 "dk3bezcu.ctr"
+#line 348 "dk3bezcu.ctr"
z2 = dk3ma_d_add_ok(
dk3ma_d_sub_ok(
xm,
@@ -345,7 +358,7 @@ dk3bezier_bb_dimension(
&mec
);
-#line 322 "dk3bezcu.ctr"
+#line 357 "dk3bezcu.ctr"
z2 = dk3ma_d_mul_ok(z2, z2, &mec);
z2 = dk3ma_d_sub_ok(
z2,
@@ -357,11 +370,11 @@ dk3bezier_bb_dimension(
&mec
);
-#line 332 "dk3bezcu.ctr"
+#line 367 "dk3bezcu.ctr"
if(z2 >= 0.0) {
z2 = sqrt(z2);
-#line 334 "dk3bezcu.ctr"
+#line 369 "dk3bezcu.ctr"
testmec = 0;
t = dk3ma_d_div_ok(
dk3ma_d_add_ok(z1, z2, &mec),
@@ -369,13 +382,13 @@ dk3bezier_bb_dimension(
&testmec
);
-#line 340 "dk3bezcu.ctr"
+#line 375 "dk3bezcu.ctr"
if(0 == testmec) {
if(!dk3bezier_t_dimension(bb, x0, xp, xm, x1, ra, t, isy, &mec)) {
back = 0;
}
-#line 344 "dk3bezcu.ctr"
+#line 379 "dk3bezcu.ctr"
}
testmec = 0;
t = dk3ma_d_div_ok(
@@ -384,25 +397,147 @@ dk3bezier_bb_dimension(
&testmec
);
-#line 351 "dk3bezcu.ctr"
+#line 386 "dk3bezcu.ctr"
if(0 == testmec) {
if(!dk3bezier_t_dimension(bb, x0, xp, xm, x1, ra, t, isy, &mec)) {
back = 0;
}
-#line 355 "dk3bezcu.ctr"
+#line 390 "dk3bezcu.ctr"
}
}
if(mec) {
-#line 358 "dk3bezcu.ctr"
+#line 393 "dk3bezcu.ctr"
back = 0;
if(ec) { *ec = mec; }
}
-#line 361 "dk3bezcu.ctr"
+#line 396 "dk3bezcu.ctr"
return back;
}
+#else
+/** Apply one dimension to a bounding box.
+ @param bb Bounding box to modify.
+ @param x0 Start value.
+ @param xp Control value for start.
+ @param xm Control value for end.
+ @param x1 End value.
+ @param ra Point radius (half line width).
+ @param isy Flag: Y direction.
+ @param ec Pointer to error code variable, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk3bezier_bb_dimension(
+ dk3_bb_t *bb,
+ double x0,
+ double xp,
+ double xm,
+ double x1,
+ double ra,
+ int isy,
+ int *ec
+)
+{
+ double a;
+ double b;
+ double c;
+ double t1;
+ double t2;
+ double sqop;
+ double sqv;
+ double denom;
+ int back = 1;
+ int mec = 0;
+
+
+#line 434 "dk3bezcu.ctr"
+ a = x1 - 3.0 * xm + 3.0 * xp - x0;
+ b = 3.0 * x0 - 6.0 * xp + 3.0 * xm;
+ c = 3.0 * (xp - x0);
+ sqop = b * b - 3.0 * a * c;
+ sqv = sqrt(sqop);
+ denom = 3.0 * a;
+ t1 = (0.0 - b + sqv) / (denom);
+ t2 = (0.0 - b - sqv) / (denom);
+#if DK3_HAVE_ISFINITE
+ if ((isfinite(t1)) && (isfinite(t2)))
+#else
+#if DK3_HAVE__FINITE
+ if ((_finite(t1)) && (_finite(t2)))
+#else
+#error "Neither isfinite() nor _finite() available!"
+ if (1)
+#endif
+#endif
+ {
+
+#line 453 "dk3bezcu.ctr"
+ if ((isgreaterequal(t1, 0.0)) && (islessequal(t1, 1.0))) {
+ if(!dk3bezier_t_dimension(
+ bb, x0, xp, xm, x1, ra, t1, isy, &mec
+ )
+ ) {
+ back = 0;
+ }
+
+#line 460 "dk3bezcu.ctr"
+ }
+ if ((isgreaterequal(t2, 0.0)) && (islessequal(t2, 1.0))) {
+ if(!dk3bezier_t_dimension(
+ bb, x0, xp, xm, x1, ra, t2, isy, &mec
+ )
+ ) {
+ back = 0;
+ }
+
+#line 468 "dk3bezcu.ctr"
+ }
+ }
+ else {
+
+#line 471 "dk3bezcu.ctr"
+ t1 = (0.0 - c) / (2.0 * b);
+#if DK3_HAVE_ISFINITE
+ if (isfinite(t1))
+#else
+#if DK3_HAVE__FINITE
+ if (_finite(t1))
+#else
+#error "Neither isfinite() nor _finite() available!"
+ if (1)
+#endif
+#endif
+ {
+ if ((isgreaterequal(t1,0.0)) && (islessequal(t1,1.0))) {
+ if(!dk3bezier_t_dimension(
+ bb, x0, xp, xm, x1, ra, t1, isy, &mec
+ )
+ ) {
+ back = 0;
+ }
+
+#line 490 "dk3bezcu.ctr"
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 494 "dk3bezcu.ctr"
+ }
+#endif
+ }
+ if (0 != mec) {
+ if (NULL != ec) { *ec = mec; }
+ back = 0;
+ }
+
+#line 501 "dk3bezcu.ctr"
+ return back;
+}
+#endif
#endif
@@ -425,7 +560,7 @@ dk3bezier_bb(
int mec = 0;
-#line 384 "dk3bezcu.ctr"
+#line 525 "dk3bezcu.ctr"
if(bb) {
back = 1;
if(!dk3bb_point_width(bb, x0, y0, ra)) {
@@ -448,7 +583,7 @@ dk3bezier_bb(
if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 405 "dk3bezcu.ctr"
+#line 546 "dk3bezcu.ctr"
return back;
}
diff --git a/support/dktools/dk3bezcu.ctr b/support/dktools/dk3bezcu.ctr
index f5ff1b6955..25d002a854 100644
--- a/support/dktools/dk3bezcu.ctr
+++ b/support/dktools/dk3bezcu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -70,6 +70,40 @@ $!trace-include
+#if !(defined(isgreaterequal))
+#if DK3_HAVE_ISFINITE
+/** Test whether a is greater than or equal to b. */
+#define isgreaterequal(a,b) ((isfinite(a)) && (isfinite(b)) && (a >= b))
+#else
+#if DK3_HAVE__FINITE
+/** Test whether a is greater than or equal to b. */
+#define isgreaterequal(a,b) ((_finite(a)) && (_finite(b)) && (a >= b))
+#else
+/** Test whether a is greater than or equal to b. */
+#define isgreaterequal(a,b) (a >= b)
+#endif
+#endif
+#endif
+
+
+
+#if !(defined(islessequal))
+#if DK3_HAVE_ISFINITE
+/** Test whether a is less than or equal to b. */
+#define islessequal(a,b) ((isfinite(a)) && (isfinite(b)) && (a <= b))
+#else
+#if DK3_HAVE__FINITE
+/** Test whether a is less than or equal to b. */
+#define islessequal(a,b) ((_finite(a)) && (_finite(b)) && (a <= b))
+#else
+/** Test whether a is less than or equal to b. */
+#define islessequal(a,b) (a <= b)
+#endif
+#endif
+#endif
+
+
+
double
dk3bezier_value(
double x0, double xp, double xm, double x1, double t, int *ec
@@ -268,6 +302,7 @@ dk3bezier_bb_dimension(
return back;
}
#else
+#if VERSION_BEFORE_20170609
/** Apply one dimension to a bounding box.
@param bb Bounding box to modify.
@param x0 Start value.
@@ -360,6 +395,112 @@ dk3bezier_bb_dimension(
} $? "- dk3bezier_bb_dimension %d", back
return back;
}
+#else
+/** Apply one dimension to a bounding box.
+ @param bb Bounding box to modify.
+ @param x0 Start value.
+ @param xp Control value for start.
+ @param xm Control value for end.
+ @param x1 End value.
+ @param ra Point radius (half line width).
+ @param isy Flag: Y direction.
+ @param ec Pointer to error code variable, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk3bezier_bb_dimension(
+ dk3_bb_t *bb,
+ double x0,
+ double xp,
+ double xm,
+ double x1,
+ double ra,
+ int isy,
+ int *ec
+)
+{
+ double a;
+ double b;
+ double c;
+ double t1;
+ double t2;
+ double sqop;
+ double sqv;
+ double denom;
+ int back = 1;
+ int mec = 0;
+ $? "+ dk3bezier_bb_dimension"
+ a = x1 - 3.0 * xm + 3.0 * xp - x0;
+ b = 3.0 * x0 - 6.0 * xp + 3.0 * xm;
+ c = 3.0 * (xp - x0);
+ sqop = b * b - 3.0 * a * c;
+ sqv = sqrt(sqop);
+ denom = 3.0 * a;
+ t1 = (0.0 - b + sqv) / (denom);
+ t2 = (0.0 - b - sqv) / (denom);
+#if DK3_HAVE_ISFINITE
+ if ((isfinite(t1)) && (isfinite(t2)))
+#else
+#if DK3_HAVE__FINITE
+ if ((_finite(t1)) && (_finite(t2)))
+#else
+#error "Neither isfinite() nor _finite() available!"
+ if (1)
+#endif
+#endif
+ { $? ". 3rd degree polynomial"
+ if ((isgreaterequal(t1, 0.0)) && (islessequal(t1, 1.0))) {
+ if(!dk3bezier_t_dimension(
+ bb, x0, xp, xm, x1, ra, t1, isy, &mec
+ )
+ ) {
+ back = 0;
+ } $? ". mec = %d", mec
+ }
+ if ((isgreaterequal(t2, 0.0)) && (islessequal(t2, 1.0))) {
+ if(!dk3bezier_t_dimension(
+ bb, x0, xp, xm, x1, ra, t2, isy, &mec
+ )
+ ) {
+ back = 0;
+ } $? ". mec = %d", mec
+ }
+ }
+ else { $? ". 2nd degree polynomial"
+ t1 = (0.0 - c) / (2.0 * b);
+#if DK3_HAVE_ISFINITE
+ if (isfinite(t1))
+#else
+#if DK3_HAVE__FINITE
+ if (_finite(t1))
+#else
+#error "Neither isfinite() nor _finite() available!"
+ if (1)
+#endif
+#endif
+ {
+ if ((isgreaterequal(t1,0.0)) && (islessequal(t1,1.0))) {
+ if(!dk3bezier_t_dimension(
+ bb, x0, xp, xm, x1, ra, t1, isy, &mec
+ )
+ ) {
+ back = 0;
+ } $? ". mec = %d", mec
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". simple line"
+ }
+#endif
+ }
+ if (0 != mec) {
+ if (NULL != ec) { *ec = mec; }
+ back = 0;
+ } $? "- dk3bezier_bb_dimension %d", back
+ return back;
+}
+#endif
#endif
diff --git a/support/dktools/dk3bezcu.h b/support/dktools/dk3bezcu.h
index cc8ebdb8eb..e0243197ee 100644
--- a/support/dktools/dk3bezcu.h
+++ b/support/dktools/dk3bezcu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bezcu.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bezcu.ctr
*/
/** @file dk3bezcu.h Header file for the dk3bezcu module.
diff --git a/support/dktools/dk3bf.c b/support/dktools/dk3bf.c
index 409200533e..99d85ee5b9 100644
--- a/support/dktools/dk3bf.c
+++ b/support/dktools/dk3bf.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bf.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bf.ctr
*/
/** @file dk3bf.c The dk3bf module.
diff --git a/support/dktools/dk3bf.ctr b/support/dktools/dk3bf.ctr
index 5f85ecfdb7..6a7f0c404c 100644
--- a/support/dktools/dk3bf.ctr
+++ b/support/dktools/dk3bf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3bf.h b/support/dktools/dk3bf.h
index 2d81db7d80..671400e035 100644
--- a/support/dktools/dk3bf.h
+++ b/support/dktools/dk3bf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bf.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bf.ctr
*/
/** @file dk3bf.h Header file for the dk3bf module.
diff --git a/support/dktools/dk3bif.c b/support/dktools/dk3bif.c
index 35a8df4b17..800528905a 100644
--- a/support/dktools/dk3bif.c
+++ b/support/dktools/dk3bif.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bif.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bif.ctr
*/
/** @file dk3bif.c The dk3bif module.
@@ -165,13 +143,9 @@ static unsigned long dk3bif_temp_number = 0UL;
-static
-dk3_bif_frame_t *
-dk3bif_frame_new(dk3_bif_t *bp);
-
+#if DK3_HAVE_PNG_H
-#if DK3_HAVE_PNG_H
/** Per frame data, PNG-specific.
*/
typedef struct {
@@ -185,6 +159,7 @@ typedef struct {
int paln;
} dk3_bif_frame_png_t;
+
/** Per file data, PNG-specific.
*/
typedef struct {
@@ -198,6 +173,7 @@ typedef struct {
int np; /* Number of interlace passes. */
} dk3_bif_png_t;
+
/** Release type-specific information for PNG file.
@param is Bitmap-type specific data.
*/
@@ -209,14 +185,14 @@ dk3bif_frame_release_implspec_png(void *is)
dk3_bif_coord_t i;
-#line 555 "dk3bif.ctr"
+#line 553 "dk3bif.ctr"
fdis = (dk3_bif_frame_png_t *)is;
if(fdis->rows) {
-#line 557 "dk3bif.ctr"
+#line 555 "dk3bif.ctr"
for(i = 0L; i < fdis->h; i++) {
-#line 558 "dk3bif.ctr"
+#line 556 "dk3bif.ctr"
dk3_delete((fdis->rows)[i]);
}
dk3_delete(fdis->rows);
@@ -224,9 +200,228 @@ dk3bif_frame_release_implspec_png(void *is)
dk3_release(fdis);
-#line 564 "dk3bif.ctr"
+#line 562 "dk3bif.ctr"
+}
+
+
+#endif
+/* if DK3_HAVE_PNG_H */
+
+
+
+#if DK3_HAVE_JPEGLIB_H
+
+
+/*
+ JPEGLIB error management.
+*/
+
+/** JPEGLIB error manager.
+*/
+typedef struct {
+ struct jpeg_error_mgr pub; /**< Default error manager. */
+#if DK3_HAVE_SETJMP_H
+ jmp_buf setjmp_buffer; /**< Buffer for setjmp. */
+#endif
+} dk3_bif_jpg_error_mgr;
+
+
+/** Per frame data, JPEG-specific.
+*/
+typedef struct {
+ JSAMPLE **rows; /**< Sample buffer. */
+ JDIMENSION w; /**< Image width. */
+ JDIMENSION h; /**< Image height. */
+ int is_adobe; /**< Flag: Adobe marker found. */
+ int num_comp; /**< Number of components found. */
+} dk3_bif_frame_jpeg_t;
+
+
+/** Per file data, JPEG-specific.
+*/
+typedef struct {
+ int st;
+ struct jpeg_decompress_struct cinfo; /**< Decompression struct. */
+ dk3_bif_jpg_error_mgr errmgr; /**< Error manager. */
+} dk3_bif_jpeg_t;
+
+
+/** Error exit replacement function.
+ @param cinfo JPEG decompression structure.
+*/
+static
+void
+dk3bif_jpeg_error_exit(j_common_ptr cinfo)
+{
+ dk3_bif_jpg_error_mgr *myerr = (dk3_bif_jpg_error_mgr *)(cinfo->err);
+ if(myerr) {
+ longjmp(myerr->setjmp_buffer, 1);
+ }
+}
+
+
+/** Release type-specific information for JPEG file (frame).
+ @param is Bitmap-type specific data.
+*/
+static
+void
+dk3bif_frame_release_implspec_jpeg(void *is)
+{
+ dk3_bif_frame_jpeg_t *fdis;
+ JSAMPLE **ptr;
+ JDIMENSION i;
+ fdis = (dk3_bif_frame_jpeg_t *)is;
+ if(fdis->rows) {
+ ptr = fdis->rows;
+ for(i = 0; i < fdis->h; i++) {
+ dk3_release(*ptr);
+ ptr++;
+ }
+ dk3_delete(fdis->rows);
+ }
+ dk3_delete(is);
+}
+
+
+#endif
+/* if DK3_HAVE_JPEGLIB_H */
+
+
+
+#if DK3_HAVE_TIFF_H
+
+
+/** Per frame data, TIFF-specific.
+*/
+typedef struct {
+ uint32 *r; /**< Raster image data. */
+ uint32 w; /**< Image width. */
+ uint32 h; /**< Image height. */
+ uint16 cps;
+ uint16 spp;
+ uint16 ori; /**< Orientation. */
+} dk3_bif_frame_tiff_t;
+
+
+/** Per file data, TIFF-specific.
+*/
+typedef struct {
+ TIFF *tiff;
+} dk3_bif_tiff_t;
+
+
+/** Release type-specific information for TIFF file.
+ @param is Bitmap-type specific data.
+*/
+static
+void
+dk3bif_frame_release_implspec_tiff(void *is)
+{
+ dk3_bif_frame_tiff_t *fdis;
+ fdis = (dk3_bif_frame_tiff_t *)is;
+ if(fdis->r) {
+ _TIFFfree(fdis->r);
+ fdis->r = NULL;
+ }
+ fdis->w = fdis->h = 0UL; fdis->spp = fdis->cps = 0U;
+ dk3_delete(fdis);
+}
+
+
+#endif
+/* if DK3_HAVE_TIFF_H */
+
+
+
+/** Delete BIF frame, release memory.
+ @param tp Image type.
+ @param fp Frame to delete.
+*/
+static
+void
+dk3bif_frame_delete(dk3_bif_frame_t *fp, int tp)
+{
+
+
+#line 703 "dk3bif.ctr"
+ if(fp) {
+ /*
+ Release type-depending components.
+ */
+ if(fp->implspec) {
+ switch(tp) {
+ case DK3_BIF_IMAGE_TYPE_PNG: {
+#if DK3_HAVE_PNG_H
+ dk3bif_frame_release_implspec_png(fp->implspec);
+#endif
+ } break;
+ case DK3_BIF_IMAGE_TYPE_JPEG: {
+#if DK3_HAVE_JPEGLIB_H
+ dk3bif_frame_release_implspec_jpeg(fp->implspec);
+#endif
+ } break;
+ case DK3_BIF_IMAGE_TYPE_TIFF: {
+#if DK3_HAVE_TIFF_H
+ dk3bif_frame_release_implspec_tiff(fp->implspec);
+#endif
+ } break;
+ }
+ }
+ fp->implspec = NULL;
+ /*
+ Release type-independent components.
+ */
+ fp->w = fp->h = 0L; fp->realbits = fp->bits = fp->n = 0; fp->cs = 0;
+ /*
+ Release frame itself.
+ */
+ dk3_delete(fp);
+ }
+
+#line 736 "dk3bif.ctr"
}
+
+
+#if (DK3_HAVE_PNG_H) || (DK3_HAVE_JPEGLIB_H) || (DK3_HAVE_TIFF_H)
+
+/** Allocate memory for new frame.
+ @param bp Bitmap image file.
+ @return Pointer to new frame on success, NULL on error.
+*/
+static
+dk3_bif_frame_t *
+dk3bif_frame_new(dk3_bif_t *bp)
+{
+ dk3_bif_frame_t *back = NULL;
+ back = dk3_new_app(dk3_bif_frame_t,1,bp->app);
+ if(back) {
+ back->implspec = NULL;
+ back->xres = -1.0;
+ back->yres = -1.0;
+ back->w = 0L;
+ back->h = 0L;
+ back->realbits = back->bits = 0;
+ back->realcolor = 1;
+ back->realalpha = 1;
+ back->n = bp->n_frames;
+ back->cs = 0;
+ back->bg = 0; back->bgr = back->bgg = back->bgb = back->bggr = 0U;
+ if(dk3sto_add(bp->s_frames, (void *)back)) {
+ bp->n_frames += 1;
+ } else {
+ dk3bif_frame_delete(back, bp->bt); back = NULL;
+ }
+ }
+ return back;
+}
+
+#endif
+
+
+
+#if DK3_HAVE_PNG_H
+
/** Release type specific information for PNG file (image).
@param is Bitmap-type specific data.
*/
@@ -237,23 +432,23 @@ dk3bif_release_implspec_png(void *is)
dk3_bif_png_t *dis;
-#line 575 "dk3bif.ctr"
+#line 788 "dk3bif.ctr"
dis = (dk3_bif_png_t *)is;
if(dis->pp) {
if(dis->pi) {
-#line 578 "dk3bif.ctr"
+#line 791 "dk3bif.ctr"
png_destroy_info_struct(dis->pp, &(dis->pi));
}
-#line 580 "dk3bif.ctr"
+#line 793 "dk3bif.ctr"
png_destroy_read_struct(&(dis->pp), (png_infopp)NULL, (png_infopp)NULL);
}
dis->pp = NULL; dis->pi = NULL;
dk3_release(dis);
-#line 585 "dk3bif.ctr"
+#line 798 "dk3bif.ctr"
}
/** Read header for PNG image.
@@ -284,21 +479,21 @@ dk3bif_read_png_header(dk3_bif_t *bp)
int cm; /* Compression method. */
int fm; /* Filter method. */
int ch; /* Number of channels. */
- int np = 1; /* Number of interlace passes. */
+ volatile int np = 1; /* Number of interlace passes. */
size_t szh; /* Number of header bytes read. */
int back = 0;
-#line 619 "dk3bif.ctr"
+#line 832 "dk3bif.ctr"
szh = fread(header, 1, 8, bp->tmpfipo);
if(szh > 0) {
-#line 621 "dk3bif.ctr"
+#line 834 "dk3bif.ctr"
if(png_sig_cmp(header, 0, szh) == 0) {
dis = dk3_new_app(dk3_bif_png_t,1,bp->app);
if(dis) {
-#line 624 "dk3bif.ctr"
+#line 837 "dk3bif.ctr"
bp->implspec = (void *)dis;
dis->pp = NULL; dis->pi = NULL; dis->ct = 0;
dis->pp = png_create_read_struct(
@@ -309,22 +504,22 @@ dk3bif_read_png_header(dk3_bif_t *bp)
);
if(dis->pp) {
-#line 633 "dk3bif.ctr"
+#line 846 "dk3bif.ctr"
#if DK3_HAVE_SETJMP_H
if(setjmp(png_jmpbuf(dis->pp)) == 0) {
#endif
dis->pi = png_create_info_struct(dis->pp);
if(dis->pi) {
-#line 638 "dk3bif.ctr"
+#line 851 "dk3bif.ctr"
bp->cf = dk3bif_frame_new(bp);
if(bp->cf) {
-#line 640 "dk3bif.ctr"
+#line 853 "dk3bif.ctr"
fdis = dk3_new_app(dk3_bif_frame_png_t,1,bp->app);
if(fdis) {
-#line 642 "dk3bif.ctr"
+#line 855 "dk3bif.ctr"
fdis->rows = NULL;
fdis->rowbytes = 0;
fdis->palp = NULL;
@@ -351,7 +546,7 @@ dk3bif_read_png_header(dk3_bif_t *bp)
ch = png_get_channels(dis->pp, dis->pi);
-#line 667 "dk3bif.ctr"
+#line 880 "dk3bif.ctr"
#endif
if(png_get_valid(dis->pp, dis->pi, PNG_INFO_pHYs)) {
#if VERSION_BEFORE_20150821
@@ -393,7 +588,7 @@ dk3bif_read_png_header(dk3_bif_t *bp)
}
-#line 707 "dk3bif.ctr"
+#line 920 "dk3bif.ctr"
}
/*
Establish transformations.
@@ -435,7 +630,7 @@ dk3bif_read_png_header(dk3_bif_t *bp)
ch = png_get_channels(dis->pp, dis->pi);
-#line 747 "dk3bif.ctr"
+#line 960 "dk3bif.ctr"
(bp->cf)->w = (dk3_bif_coord_t)w;
(bp->cf)->h = (dk3_bif_coord_t)h;
(bp->cf)->realbits = (bp->cf)->bits = (size_t)bd;
@@ -470,15 +665,15 @@ dk3bif_read_png_header(dk3_bif_t *bp)
}
} else {
-#line 780 "dk3bif.ctr"
+#line 993 "dk3bif.ctr"
}
} else {
-#line 782 "dk3bif.ctr"
+#line 995 "dk3bif.ctr"
}
} else {
-#line 784 "dk3bif.ctr"
+#line 997 "dk3bif.ctr"
}
#if DK3_HAVE_SETJMP_H
} else {
@@ -487,23 +682,23 @@ dk3bif_read_png_header(dk3_bif_t *bp)
#endif
} else {
-#line 791 "dk3bif.ctr"
+#line 1004 "dk3bif.ctr"
}
} else {
-#line 793 "dk3bif.ctr"
+#line 1006 "dk3bif.ctr"
}
} else {
-#line 795 "dk3bif.ctr"
+#line 1008 "dk3bif.ctr"
}
} else {
-#line 797 "dk3bif.ctr"
+#line 1010 "dk3bif.ctr"
}
-#line 799 "dk3bif.ctr"
+#line 1012 "dk3bif.ctr"
return back;
}
@@ -523,7 +718,7 @@ dk3bif_read_png_data(dk3_bif_t *bp)
dk3_bif_frame_png_t *fdis;
png_bytep *rp;
dk3_bif_coord_t i;
- int back = 0;
+ volatile int back = 0;
dis = (dk3_bif_png_t *)(bp->implspec);
fdis = (dk3_bif_frame_png_t *)((bp->cf)->implspec);
#if DK3_HAVE_SETJMP_H
@@ -550,7 +745,7 @@ dk3bif_read_png_data(dk3_bif_t *bp)
fdis->bggreen = bgp->green;
fdis->bgblue = bgp->blue;
-#line 844 "dk3bif.ctr"
+#line 1057 "dk3bif.ctr"
}
if(dis->ct == PNG_COLOR_TYPE_PALETTE) {
back = 0;
@@ -562,7 +757,7 @@ dk3bif_read_png_data(dk3_bif_t *bp)
}
} else {
-#line 854 "dk3bif.ctr"
+#line 1067 "dk3bif.ctr"
}
#if DK3_HAVE_SETJMP_H
} else {
@@ -642,76 +837,12 @@ dk3bif_get_png_pixel_component(
}
return back;
}
-#endif
-/* if DK3_HAVE_PNG_H */
-
-
-#if DK3_HAVE_JPEGLIB_H
-/*
- JPEGLIB error management.
-*/
-/** JPEGLIB error manager.
-*/
-typedef struct {
- struct jpeg_error_mgr pub; /**< Default error manager. */
-#if DK3_HAVE_SETJMP_H
- jmp_buf setjmp_buffer; /**< Buffer for setjmp. */
#endif
-} dk3_bif_jpg_error_mgr;
-/** Per frame data, JPEG-specific.
-*/
-typedef struct {
- JSAMPLE **rows; /**< Sample buffer. */
- JDIMENSION w; /**< Image width. */
- JDIMENSION h; /**< Image height. */
- int is_adobe; /**< Flag: Adobe marker found. */
- int num_comp; /**< Number of components found. */
-} dk3_bif_frame_jpeg_t;
-/** Per file data, JPEG-specific.
-*/
-typedef struct {
- int st;
- struct jpeg_decompress_struct cinfo; /**< Decompression struct. */
- dk3_bif_jpg_error_mgr errmgr; /**< Error manager. */
-} dk3_bif_jpeg_t;
-/** Error exit replacement function.
- @param cinfo JPEG decompression structure.
-*/
-static
-void
-dk3bif_jpeg_error_exit(j_common_ptr cinfo)
-{
- dk3_bif_jpg_error_mgr *myerr = (dk3_bif_jpg_error_mgr *)(cinfo->err);
- if(myerr) {
- longjmp(myerr->setjmp_buffer, 1);
- }
-}
-
-/** Release type-specific information for JPEG file (frame).
- @param is Bitmap-type specific data.
-*/
-static
-void
-dk3bif_frame_release_implspec_jpeg(void *is)
-{
- dk3_bif_frame_jpeg_t *fdis;
- JSAMPLE **ptr;
- JDIMENSION i;
- fdis = (dk3_bif_frame_jpeg_t *)is;
- if(fdis->rows) {
- ptr = fdis->rows;
- for(i = 0; i < fdis->h; i++) {
- dk3_release(*ptr);
- ptr++;
- }
- dk3_delete(fdis->rows);
- }
- dk3_delete(is);
-}
+#if DK3_HAVE_JPEGLIB_H
/** Release type specific information for JPEG file (image).
@param is Bitmap-type specific data.
@@ -747,7 +878,7 @@ dk3bif_read_jpeg_header(dk3_bif_t *bp)
int back = 0;
-#line 1037 "dk3bif.ctr"
+#line 1186 "dk3bif.ctr"
bp->cf = dk3bif_frame_new(bp);
if(bp->cf) {
dis = dk3_new_app(dk3_bif_jpeg_t,1,bp->app);
@@ -774,7 +905,7 @@ dk3bif_read_jpeg_header(dk3_bif_t *bp)
fdis->num_comp = (dis->cinfo).num_components;
-#line 1062 "dk3bif.ctr"
+#line 1211 "dk3bif.ctr"
fdis->rows = NULL;
fdis->w = (dis->cinfo).image_width;
fdis->h = (dis->cinfo).image_height;
@@ -784,27 +915,27 @@ dk3bif_read_jpeg_header(dk3_bif_t *bp)
switch((dis->cinfo).jpeg_color_space) {
case JCS_GRAYSCALE: {
-#line 1070 "dk3bif.ctr"
+#line 1219 "dk3bif.ctr"
(bp->cf)->cs = DK3_COLOR_SPACE_GRAY;
} break;
case JCS_RGB: {
-#line 1073 "dk3bif.ctr"
+#line 1222 "dk3bif.ctr"
(bp->cf)->cs = DK3_COLOR_SPACE_RGB;
} break;
case JCS_CMYK: {
-#line 1076 "dk3bif.ctr"
+#line 1225 "dk3bif.ctr"
(bp->cf)->cs = DK3_COLOR_SPACE_CMYK;
} break;
case JCS_YCCK: {
-#line 1079 "dk3bif.ctr"
+#line 1228 "dk3bif.ctr"
(bp->cf)->cs = DK3_COLOR_SPACE_CMYK;
} break;
case JCS_YCbCr: {
-#line 1082 "dk3bif.ctr"
+#line 1231 "dk3bif.ctr"
(bp->cf)->cs = DK3_COLOR_SPACE_YCbCr;
} break;
default: {
@@ -841,7 +972,7 @@ dk3bif_read_jpeg_header(dk3_bif_t *bp)
}
-#line 1117 "dk3bif.ctr"
+#line 1266 "dk3bif.ctr"
return back;
}
@@ -862,27 +993,27 @@ dk3bif_read_jpeg_data(dk3_bif_t *bp)
int occ;
-#line 1136 "dk3bif.ctr"
+#line 1285 "dk3bif.ctr"
if(bp->implspec) {
-#line 1137 "dk3bif.ctr"
+#line 1286 "dk3bif.ctr"
if(bp->cf) {
-#line 1138 "dk3bif.ctr"
+#line 1287 "dk3bif.ctr"
if((bp->cf)->implspec) {
-#line 1139 "dk3bif.ctr"
+#line 1288 "dk3bif.ctr"
dis = (dk3_bif_jpeg_t *)(bp->implspec);
fdis = (dk3_bif_frame_jpeg_t *)((bp->cf)->implspec);
-#line 1141 "dk3bif.ctr"
+#line 1290 "dk3bif.ctr"
if(dis->st == 3) {
-#line 1142 "dk3bif.ctr"
+#line 1291 "dk3bif.ctr"
#if DK3_HAVE_SETJMP_H
if(setjmp((dis->errmgr).setjmp_buffer) == 0) {
-#line 1144 "dk3bif.ctr"
+#line 1293 "dk3bif.ctr"
#endif
dis->st = 4; /* We attempted to continue. */
jpeg_start_decompress(&(dis->cinfo));
@@ -890,62 +1021,62 @@ dk3bif_read_jpeg_data(dk3_bif_t *bp)
fdis->rows = dk3_new_app(JSAMPROW,fdis->h,bp->app);
if(fdis->rows) {
-#line 1150 "dk3bif.ctr"
+#line 1299 "dk3bif.ctr"
occ = (dis->cinfo).out_color_components;
ok = 1;
-#line 1152 "dk3bif.ctr"
+#line 1301 "dk3bif.ctr"
rp = fdis->rows;
-#line 1153 "dk3bif.ctr"
+#line 1302 "dk3bif.ctr"
for(y = 0; y < fdis->h; y++) { *(rp++) = NULL; }
occ = occ * fdis->w;
-#line 1155 "dk3bif.ctr"
+#line 1304 "dk3bif.ctr"
rp = fdis->rows;
for(y = 0; y < fdis->h; y++) {
-#line 1157 "dk3bif.ctr"
+#line 1306 "dk3bif.ctr"
*rp = dk3_new_app(JSAMPLE,occ,bp->app);
if(!(*rp)) {
ok = 0;
-#line 1160 "dk3bif.ctr"
+#line 1309 "dk3bif.ctr"
}
rp++;
}
if(ok) {
-#line 1164 "dk3bif.ctr"
+#line 1313 "dk3bif.ctr"
dis->st = 6; /* Decompression started. */
rp = fdis->rows;
-#line 1166 "dk3bif.ctr"
+#line 1315 "dk3bif.ctr"
for(y = 0; y < fdis->h; y++) {
-#line 1167 "dk3bif.ctr"
+#line 1316 "dk3bif.ctr"
jpeg_read_scanlines(&(dis->cinfo), rp, 1);
rp++;
-#line 1169 "dk3bif.ctr"
+#line 1318 "dk3bif.ctr"
}
-#line 1170 "dk3bif.ctr"
+#line 1319 "dk3bif.ctr"
dis->st = 7; /* Data was read successfully. */
jpeg_finish_decompress(&(dis->cinfo));
-#line 1172 "dk3bif.ctr"
+#line 1321 "dk3bif.ctr"
dis->st = 8; /* Decompression finished. */
switch((dis->cinfo).out_color_space) {
case JCS_GRAYSCALE: {
-#line 1175 "dk3bif.ctr"
+#line 1324 "dk3bif.ctr"
(bp->cf)->cs = DK3_COLOR_SPACE_GRAY;
back = 1;
} break;
case JCS_RGB: {
-#line 1179 "dk3bif.ctr"
+#line 1328 "dk3bif.ctr"
(bp->cf)->cs = DK3_COLOR_SPACE_RGB;
back = 1;
} break;
@@ -957,7 +1088,7 @@ dk3bif_read_jpeg_data(dk3_bif_t *bp)
}
} else {
-#line 1189 "dk3bif.ctr"
+#line 1338 "dk3bif.ctr"
}
#if DK3_HAVE_SETJMP_H
} else {
@@ -965,19 +1096,19 @@ dk3bif_read_jpeg_data(dk3_bif_t *bp)
#endif
} else {
-#line 1195 "dk3bif.ctr"
+#line 1344 "dk3bif.ctr"
}
} else {
-#line 1197 "dk3bif.ctr"
+#line 1346 "dk3bif.ctr"
}
} else {
-#line 1199 "dk3bif.ctr"
+#line 1348 "dk3bif.ctr"
}
}
-#line 1201 "dk3bif.ctr"
+#line 1350 "dk3bif.ctr"
return back;
}
@@ -1048,45 +1179,12 @@ dk3bif_get_jpeg_pixel_component(
}
return back;
}
+
#endif
-/* if DK3_HAVE_JPEGLIB_H */
#if DK3_HAVE_TIFF_H
-/** Per frame data, TIFF-specific.
-*/
-typedef struct {
- uint32 *r; /**< Raster image data. */
- uint32 w; /**< Image width. */
- uint32 h; /**< Image height. */
- uint16 cps;
- uint16 spp;
- uint16 ori; /**< Orientation. */
-} dk3_bif_frame_tiff_t;
-
-/** Per file data, TIFF-specific.
-*/
-typedef struct {
- TIFF *tiff;
-} dk3_bif_tiff_t;
-
-/** Release type-specific information for TIFF file.
- @param is Bitmap-type specific data.
-*/
-static
-void
-dk3bif_frame_release_implspec_tiff(void *is)
-{
- dk3_bif_frame_tiff_t *fdis;
- fdis = (dk3_bif_frame_tiff_t *)is;
- if(fdis->r) {
- _TIFFfree(fdis->r);
- fdis->r = NULL;
- }
- fdis->w = fdis->h = 0UL; fdis->spp = fdis->cps = 0U;
- dk3_delete(fdis);
-}
/** Release type specific information for TIFF file (image).
@param is Bitmap-type specific data.
@@ -1135,14 +1233,14 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
uint16 orient;
-#line 1357 "dk3bif.ctr"
+#line 1473 "dk3bif.ctr"
if(bp->tmpfn) {
-#line 1358 "dk3bif.ctr"
+#line 1474 "dk3bif.ctr"
dis = dk3_new_app(dk3_bif_tiff_t,1,bp->app);
if(dis) {
-#line 1360 "dk3bif.ctr"
+#line 1476 "dk3bif.ctr"
/*
Initialization of TIFF per file.
*/
@@ -1151,11 +1249,11 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
dis->tiff = TIFFOpen(bp->tmpfn, "rb");
if(dis->tiff) {
-#line 1367 "dk3bif.ctr"
+#line 1483 "dk3bif.ctr"
back = 1;
do {
-#line 1369 "dk3bif.ctr"
+#line 1485 "dk3bif.ctr"
w = h = 0UL; rv = 0.0; ru = 0;
#if VERSION_BEFORE_20150821
cps = spp = 0U;
@@ -1163,13 +1261,13 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
bp->cf = dk3bif_frame_new(bp);
if(bp->cf) {
-#line 1375 "dk3bif.ctr"
+#line 1491 "dk3bif.ctr"
(bp->cf)->realbits = (bp->cf)->bits = 8;
(bp->cf)->cs = DK3_COLOR_SPACE_RGBA;
fdis = dk3_new_app(dk3_bif_frame_tiff_t,1,bp->app);
if(fdis) {
-#line 1379 "dk3bif.ctr"
+#line 1495 "dk3bif.ctr"
/*
Initialize TIFF per frame.
*/
@@ -1180,40 +1278,40 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
if(TIFFGetField(dis->tiff, TIFFTAG_IMAGEWIDTH, &w) == 1) {
fdis->w = w;
-#line 1388 "dk3bif.ctr"
+#line 1504 "dk3bif.ctr"
(bp->cf)->w = (dk3_bif_coord_t)w;
if(TIFFGetField(dis->tiff, TIFFTAG_IMAGELENGTH, &h) == 1) {
fdis->h = h;
-#line 1391 "dk3bif.ctr"
+#line 1507 "dk3bif.ctr"
(bp->cf)->h = (dk3_bif_coord_t)h;
rv = 0.0;
if(TIFFGetField(dis->tiff, TIFFTAG_XRESOLUTION, &rv) == 1) {
(bp->cf)->xres = (double)rv;
-#line 1395 "dk3bif.ctr"
+#line 1511 "dk3bif.ctr"
}
rv = 0.0;
if(TIFFGetField(dis->tiff, TIFFTAG_YRESOLUTION, &rv) == 1) {
(bp->cf)->yres = (double)rv;
-#line 1399 "dk3bif.ctr"
+#line 1515 "dk3bif.ctr"
}
ru = 0;
if(TIFFGetField(dis->tiff, TIFFTAG_RESOLUTIONUNIT, &ru) == 1)
{
-#line 1403 "dk3bif.ctr"
+#line 1519 "dk3bif.ctr"
switch(ru) {
case RESUNIT_CENTIMETER: {
-#line 1405 "dk3bif.ctr"
+#line 1521 "dk3bif.ctr"
(bp->cf)->xres = 2.54 * (bp->cf)->xres;
(bp->cf)->yres = 2.54 * (bp->cf)->yres;
} break;
case RESUNIT_NONE: {
-#line 1409 "dk3bif.ctr"
+#line 1525 "dk3bif.ctr"
(bp->cf)->xres = (bp->cf)->yres = -1.0;
} break;
}
@@ -1225,12 +1323,12 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
)
{
-#line 1419 "dk3bif.ctr"
+#line 1535 "dk3bif.ctr"
fdis->ori = orient;
switch(orient) {
case 5: case 6: case 7: case 8: {
-#line 1422 "dk3bif.ctr"
+#line 1538 "dk3bif.ctr"
fdis->h = w;
(bp->cf)->h = w;
fdis->w = h;
@@ -1253,10 +1351,10 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
if(me) {
back = 0;
-#line 1443 "dk3bif.ctr"
+#line 1559 "dk3bif.ctr"
} else {
-#line 1444 "dk3bif.ctr"
+#line 1560 "dk3bif.ctr"
#if VERSION_BEFORE_20140809
sz = (size_t)wh;
if(wh == (unsigned long)sz)
@@ -1266,11 +1364,11 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
#endif
{
-#line 1452 "dk3bif.ctr"
+#line 1568 "dk3bif.ctr"
fdis->r = (uint32 *)_TIFFmalloc(sz);
if(fdis->r) {
-#line 1454 "dk3bif.ctr"
+#line 1570 "dk3bif.ctr"
if(TIFFReadRGBAImageOriented(
dis->tiff, w, h, fdis->r, orient, 0
)
@@ -1279,43 +1377,43 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
#if TRACE_DEBUG || VERSION_BEFORE_20150821
back = 1;
-#line 1461 "dk3bif.ctr"
+#line 1577 "dk3bif.ctr"
#endif
} else {
-#line 1463 "dk3bif.ctr"
+#line 1579 "dk3bif.ctr"
back = 0;
}
} else {
-#line 1466 "dk3bif.ctr"
+#line 1582 "dk3bif.ctr"
back = 0;
}
} else {
back = 0;
-#line 1470 "dk3bif.ctr"
+#line 1586 "dk3bif.ctr"
}
}
} else {
-#line 1473 "dk3bif.ctr"
+#line 1589 "dk3bif.ctr"
back = 0;
}
} else {
-#line 1476 "dk3bif.ctr"
+#line 1592 "dk3bif.ctr"
back = 0;
}
} else {
back = 0;
-#line 1480 "dk3bif.ctr"
+#line 1596 "dk3bif.ctr"
}
} else {
back = 0;
-#line 1483 "dk3bif.ctr"
+#line 1599 "dk3bif.ctr"
}
w = h = 0UL;
#if VERSION_BEFORE_20150821
@@ -1323,39 +1421,39 @@ dk3bif_read_tiff_header(dk3_bif_t *bp)
#endif
-#line 1489 "dk3bif.ctr"
+#line 1605 "dk3bif.ctr"
} while((back == 1) && TIFFReadDirectory(dis->tiff));
TIFFClose(dis->tiff); dis->tiff = NULL;
-#line 1491 "dk3bif.ctr"
+#line 1607 "dk3bif.ctr"
if(bp->i_frames) {
-#line 1492 "dk3bif.ctr"
+#line 1608 "dk3bif.ctr"
dk3sto_it_reset(bp->i_frames);
bp->cf = (dk3_bif_frame_t *)dk3sto_it_next(bp->i_frames);
if(!(bp->cf)) {
-#line 1495 "dk3bif.ctr"
+#line 1611 "dk3bif.ctr"
back = 0;
}
} else {
-#line 1498 "dk3bif.ctr"
+#line 1614 "dk3bif.ctr"
}
} else {
-#line 1500 "dk3bif.ctr"
+#line 1616 "dk3bif.ctr"
}
} else {
-#line 1502 "dk3bif.ctr"
+#line 1618 "dk3bif.ctr"
}
} else {
-#line 1504 "dk3bif.ctr"
+#line 1620 "dk3bif.ctr"
}
-#line 1505 "dk3bif.ctr"
+#line 1621 "dk3bif.ctr"
return back;
}
@@ -1432,8 +1530,8 @@ dk3bif_get_tiff_pixel_component(
}
return back;
}
+
#endif
-/* if DK3_HAVE_TIFF_H */
@@ -1460,89 +1558,6 @@ dk3bif_ntsc(dk3_bif_pixel_t r, dk3_bif_pixel_t g, dk3_bif_pixel_t b)
-/** Delete BIF frame, release memory.
- @param tp Image type.
- @param fp Frame to delete.
-*/
-static
-void
-dk3bif_frame_delete(dk3_bif_frame_t *fp, int tp)
-{
-
-
-#line 1618 "dk3bif.ctr"
- if(fp) {
- /*
- Release type-depending components.
- */
- if(fp->implspec) {
- switch(tp) {
- case DK3_BIF_IMAGE_TYPE_PNG: {
-#if DK3_HAVE_PNG_H
- dk3bif_frame_release_implspec_png(fp->implspec);
-#endif
- } break;
- case DK3_BIF_IMAGE_TYPE_JPEG: {
-#if DK3_HAVE_JPEGLIB_H
- dk3bif_frame_release_implspec_jpeg(fp->implspec);
-#endif
- } break;
- case DK3_BIF_IMAGE_TYPE_TIFF: {
-#if DK3_HAVE_TIFF_H
- dk3bif_frame_release_implspec_tiff(fp->implspec);
-#endif
- } break;
- }
- }
- fp->implspec = NULL;
- /*
- Release type-independent components.
- */
- fp->w = fp->h = 0L; fp->realbits = fp->bits = fp->n = 0; fp->cs = 0;
- /*
- Release frame itself.
- */
- dk3_delete(fp);
- }
-
-#line 1651 "dk3bif.ctr"
-}
-
-
-
-/** Allocate memory for new frame.
- @param bp Bitmap image file.
- @return Pointer to new frame on success, NULL on error.
-*/
-static
-dk3_bif_frame_t *
-dk3bif_frame_new(dk3_bif_t *bp)
-{
- dk3_bif_frame_t *back = NULL;
- back = dk3_new_app(dk3_bif_frame_t,1,bp->app);
- if(back) {
- back->implspec = NULL;
- back->xres = -1.0;
- back->yres = -1.0;
- back->w = 0L;
- back->h = 0L;
- back->realbits = back->bits = 0;
- back->realcolor = 1;
- back->realalpha = 1;
- back->n = bp->n_frames;
- back->cs = 0;
- back->bg = 0; back->bgr = back->bgg = back->bgb = back->bggr = 0U;
- if(dk3sto_add(bp->s_frames, (void *)back)) {
- bp->n_frames += 1;
- } else {
- dk3bif_frame_delete(back, bp->bt); back = NULL;
- }
- }
- return back;
-}
-
-
-
dk3_bif_pixel_t
dk3bif_get_pixel_component_not_resampled(
dk3_bif_t *bp,
@@ -1554,10 +1569,10 @@ dk3bif_get_pixel_component_not_resampled(
dk3_bif_pixel_t back = (dk3_bif_pixel_t)0;
-#line 1698 "dk3bif.ctr"
+#line 1735 "dk3bif.ctr"
if(c == 3) {
-#line 1699 "dk3bif.ctr"
+#line 1736 "dk3bif.ctr"
back = dk3pixre_get_max_value(&(bp->pr));
}
if((x >= 0L) && (x < (bp->cf)->w)) {
@@ -1583,7 +1598,7 @@ dk3bif_get_pixel_component_not_resampled(
}
-#line 1723 "dk3bif.ctr"
+#line 1760 "dk3bif.ctr"
return back;
}
@@ -1608,7 +1623,7 @@ dk3bif_get_pixel_component(
dk3_bif_pixel_t back;
-#line 1746 "dk3bif.ctr"
+#line 1783 "dk3bif.ctr"
/*
Get unresampled value.
*/
@@ -1618,7 +1633,7 @@ dk3bif_get_pixel_component(
*/
-#line 1754 "dk3bif.ctr"
+#line 1791 "dk3bif.ctr"
back = dk3pixre_convert(&(bp->pr), back);
return back;
}
@@ -1685,23 +1700,23 @@ dk3bif_set_pixel_sampling(dk3_bif_t *bp)
{
-#line 1819 "dk3bif.ctr"
+#line 1856 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
if(bp->bits) {
-#line 1822 "dk3bif.ctr"
+#line 1859 "dk3bif.ctr"
dk3pixre_set(&(bp->pr), (bp->cf)->bits, bp->bits);
} else {
-#line 1824 "dk3bif.ctr"
+#line 1861 "dk3bif.ctr"
dk3pixre_set(&(bp->pr), (bp->cf)->bits, (bp->cf)->bits);
}
}
}
-#line 1829 "dk3bif.ctr"
+#line 1866 "dk3bif.ctr"
}
@@ -1719,7 +1734,7 @@ dk3bif_allocate_app(int tp, dk3_app_t *app)
int ok = 0;
-#line 1845 "dk3bif.ctr"
+#line 1882 "dk3bif.ctr"
if(app) {
back = dk3_new_app(dk3_bif_t,1,app);
if(back) {
@@ -1753,7 +1768,7 @@ dk3bif_allocate_app(int tp, dk3_app_t *app)
}
}
-#line 1877 "dk3bif.ctr"
+#line 1914 "dk3bif.ctr"
return back;
}
@@ -1771,7 +1786,7 @@ dk3bif_read_header(dk3_bif_t *bp)
int back = 0;
-#line 1893 "dk3bif.ctr"
+#line 1930 "dk3bif.ctr"
switch(bp->bt) {
case DK3_BIF_IMAGE_TYPE_PNG: {
#if DK3_HAVE_PNG_H
@@ -1792,7 +1807,7 @@ dk3bif_read_header(dk3_bif_t *bp)
dk3bif_set_pixel_sampling(bp);
-#line 1912 "dk3bif.ctr"
+#line 1949 "dk3bif.ctr"
return back;
}
@@ -1808,7 +1823,7 @@ dk3bif_create_tmpfilename(char *fnb, dk3_bif_t *bp)
{
-#line 1926 "dk3bif.ctr"
+#line 1963 "dk3bif.ctr"
#if DK3_ON_WINDOWS
sprintf(fnb, dk3bif_kw_c8[1], _getpid(), bp->n);
#else
@@ -1822,7 +1837,7 @@ dk3bif_create_tmpfilename(char *fnb, dk3_bif_t *bp)
#endif
-#line 1938 "dk3bif.ctr"
+#line 1975 "dk3bif.ctr"
}
@@ -1845,7 +1860,7 @@ dk3bif_copy_to_temp(dk3_bif_t *bp, FILE *fipos, dk3_app_t *app)
size_t rdb; /* Bytes read. */
-#line 1959 "dk3bif.ctr"
+#line 1996 "dk3bif.ctr"
fipod = dk3sf_c8_fopen_app(bp->tmpfn, "wb", app);
if(fipod) {
back = 1;
@@ -1871,7 +1886,7 @@ dk3bif_copy_to_temp(dk3_bif_t *bp, FILE *fipos, dk3_app_t *app)
#endif
}
-#line 1983 "dk3bif.ctr"
+#line 2020 "dk3bif.ctr"
return back;
}
@@ -1890,7 +1905,7 @@ dk3bif_correct_type(int tp)
back = tp;
-#line 2000 "dk3bif.ctr"
+#line 2037 "dk3bif.ctr"
if(tp != DK3_BIF_IMAGE_TYPE_PNG) {
if(tp != DK3_BIF_IMAGE_TYPE_JPEG) {
if(tp != DK3_BIF_IMAGE_TYPE_TIFF) {
@@ -1900,7 +1915,7 @@ dk3bif_correct_type(int tp)
}
}
-#line 2008 "dk3bif.ctr"
+#line 2045 "dk3bif.ctr"
return back;
}
@@ -1916,7 +1931,7 @@ dk3bif_open_filename_app(dkChar const *fn, int tp, dk3_app_t *app)
int ok = 0; /* Flag: Success. */
-#line 2022 "dk3bif.ctr"
+#line 2059 "dk3bif.ctr"
mytp = dk3bif_correct_type(tp);
if((fn) && (app)) {
if(mytp == DK3_BIF_IMAGE_TYPE_UNKNOWN) {
@@ -1960,7 +1975,7 @@ dk3bif_open_filename_app(dkChar const *fn, int tp, dk3_app_t *app)
}
}
-#line 2064 "dk3bif.ctr"
+#line 2101 "dk3bif.ctr"
return back;
}
@@ -1973,7 +1988,7 @@ dk3bif_open_c8_filename_app(char const *fn, int tp, dk3_app_t *app)
int ok = 0; /* Flag: Success. */
-#line 2075 "dk3bif.ctr"
+#line 2112 "dk3bif.ctr"
mytp = dk3bif_correct_type(tp);
if((fn) && (app)) {
if(mytp == DK3_BIF_IMAGE_TYPE_UNKNOWN) {
@@ -2008,7 +2023,7 @@ dk3bif_open_c8_filename_app(char const *fn, int tp, dk3_app_t *app)
}
}
-#line 2108 "dk3bif.ctr"
+#line 2145 "dk3bif.ctr"
return back;
}
@@ -2023,7 +2038,7 @@ dk3bif_open_file_app(FILE *fipo, int tp, dk3_app_t *app)
int mytp;
-#line 2121 "dk3bif.ctr"
+#line 2158 "dk3bif.ctr"
mytp = dk3bif_correct_type(tp);
if((fipo) && (app) && (mytp != DK3_BIF_IMAGE_TYPE_UNKNOWN)) {
if(dk3bif_type_supported(mytp)) {
@@ -2049,7 +2064,7 @@ dk3bif_open_file_app(FILE *fipo, int tp, dk3_app_t *app)
}
}
-#line 2145 "dk3bif.ctr"
+#line 2182 "dk3bif.ctr"
return back;
}
@@ -2061,7 +2076,7 @@ dk3bif_close(dk3_bif_t *bp)
dk3_bif_frame_t *fp;
-#line 2155 "dk3bif.ctr"
+#line 2192 "dk3bif.ctr"
if(bp) {
/*
Release image type specific data per frame.
@@ -2110,7 +2125,7 @@ dk3bif_close(dk3_bif_t *bp)
*/
if(bp->tmpfipo) {
-#line 2202 "dk3bif.ctr"
+#line 2239 "dk3bif.ctr"
fclose(bp->tmpfipo); bp->tmpfipo = NULL;
}
/*
@@ -2118,7 +2133,7 @@ dk3bif_close(dk3_bif_t *bp)
*/
if(bp->tmpfn) {
-#line 2208 "dk3bif.ctr"
+#line 2245 "dk3bif.ctr"
if(bp->remtmpf) {
dk3sf_c8_remove_file_app(bp->tmpfn, bp->app);
}
@@ -2128,7 +2143,7 @@ dk3bif_close(dk3_bif_t *bp)
dk3_delete(bp);
}
-#line 2216 "dk3bif.ctr"
+#line 2253 "dk3bif.ctr"
}
@@ -2140,31 +2155,31 @@ dk3bif_check_suffix_without_dot(dkChar const *sn)
int tp = -1;
-#line 2226 "dk3bif.ctr"
+#line 2263 "dk3bif.ctr"
if(sn) {
tp = dk3str_array_index(dk3bif_dk_type_names, sn, 0);
-#line 2228 "dk3bif.ctr"
+#line 2265 "dk3bif.ctr"
switch(tp) {
case 0: {
-#line 2230 "dk3bif.ctr"
+#line 2267 "dk3bif.ctr"
back = DK3_BIF_IMAGE_TYPE_PNG;
} break;
case 1: case 2: {
-#line 2233 "dk3bif.ctr"
+#line 2270 "dk3bif.ctr"
back = DK3_BIF_IMAGE_TYPE_JPEG;
} break;
case 3: case 4: {
-#line 2236 "dk3bif.ctr"
+#line 2273 "dk3bif.ctr"
back = DK3_BIF_IMAGE_TYPE_TIFF;
} break;
}
}
-#line 2240 "dk3bif.ctr"
+#line 2277 "dk3bif.ctr"
return back;
}
@@ -2195,7 +2210,7 @@ dk3bif_check_file_name(dkChar const *fn)
dkChar const *sp;
-#line 2269 "dk3bif.ctr"
+#line 2306 "dk3bif.ctr"
if(fn) {
sp = dk3str_get_suffix(fn);
if(sp) {
@@ -2204,7 +2219,7 @@ dk3bif_check_file_name(dkChar const *fn)
}
}
-#line 2276 "dk3bif.ctr"
+#line 2313 "dk3bif.ctr"
return back;
}
@@ -2227,11 +2242,11 @@ dk3bif_check_c8_file_name(char const *fn)
-
/** Transfer background color from image to frame.
@param bp Bitmap image file (source).
@param fr Frame (destination).
*/
+static
void
dk3_bif_transfer_background(dk3_bif_t *bp, dk3_bif_frame_t *fr)
{
@@ -2251,7 +2266,7 @@ dk3bif_read_data(dk3_bif_t *bp)
dk3_bif_frame_t *fr = NULL;
-#line 2321 "dk3bif.ctr"
+#line 2358 "dk3bif.ctr"
if(bp) {
switch(bp->bt) {
case DK3_BIF_IMAGE_TYPE_PNG: {
@@ -2263,11 +2278,11 @@ dk3bif_read_data(dk3_bif_t *bp)
#if DK3_HAVE_JPEGLIB_H
-#line 2331 "dk3bif.ctr"
+#line 2368 "dk3bif.ctr"
back = dk3bif_read_jpeg_data(bp);
-#line 2333 "dk3bif.ctr"
+#line 2370 "dk3bif.ctr"
#endif
} break;
case DK3_BIF_IMAGE_TYPE_TIFF: {
@@ -2321,7 +2336,7 @@ dk3bif_read_data(dk3_bif_t *bp)
dk3bif_set_pixel_sampling(bp);
-#line 2385 "dk3bif.ctr"
+#line 2422 "dk3bif.ctr"
return back;
}
@@ -2333,12 +2348,12 @@ dk3bif_number_of_frames(dk3_bif_t *bp)
size_t back = 0;
-#line 2395 "dk3bif.ctr"
+#line 2432 "dk3bif.ctr"
if(bp) {
back = bp->n_frames;
}
-#line 2398 "dk3bif.ctr"
+#line 2435 "dk3bif.ctr"
return back;
}
@@ -2350,7 +2365,7 @@ dk3bif_set_frame(dk3_bif_t *bp, size_t fn)
int back = 0;
-#line 2408 "dk3bif.ctr"
+#line 2445 "dk3bif.ctr"
if(bp) {
bp->cf =
(dk3_bif_frame_t *)dk3sto_it_find_like(bp->i_frames, (void *)(&fn), 1);
@@ -2362,7 +2377,7 @@ dk3bif_set_frame(dk3_bif_t *bp, size_t fn)
}
}
-#line 2418 "dk3bif.ctr"
+#line 2455 "dk3bif.ctr"
return back;
}
@@ -2374,14 +2389,14 @@ dk3bif_get_bits_per_pixel(dk3_bif_t *bp)
size_t back = 0;
-#line 2428 "dk3bif.ctr"
+#line 2465 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
back = (bp->cf)->bits;
}
}
-#line 2433 "dk3bif.ctr"
+#line 2470 "dk3bif.ctr"
return back;
}
@@ -2393,14 +2408,14 @@ dk3bif_real_bits_per_pixel(dk3_bif_t *bp)
size_t back = 0;
-#line 2443 "dk3bif.ctr"
+#line 2480 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
back = (bp->cf)->realbits;
}
}
-#line 2448 "dk3bif.ctr"
+#line 2485 "dk3bif.ctr"
return back;
}
@@ -2440,7 +2455,7 @@ dk3bif_set_bits_per_pixel(dk3_bif_t *bp, size_t sz)
int back = 0;
-#line 2486 "dk3bif.ctr"
+#line 2523 "dk3bif.ctr"
if((bp) && (sz)) {
if(sz < 17) {
bp->bits = sz;
@@ -2456,7 +2471,7 @@ dk3bif_set_bits_per_pixel(dk3_bif_t *bp, size_t sz)
}
}
-#line 2500 "dk3bif.ctr"
+#line 2537 "dk3bif.ctr"
return back;
}
@@ -2468,14 +2483,14 @@ dk3bif_get_width(dk3_bif_t *bp)
dk3_bif_coord_t back = 0L;
-#line 2510 "dk3bif.ctr"
+#line 2547 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
back = (bp->cf)->w;
}
}
-#line 2515 "dk3bif.ctr"
+#line 2552 "dk3bif.ctr"
return back;
}
@@ -2487,14 +2502,14 @@ dk3bif_get_height(dk3_bif_t *bp)
dk3_bif_coord_t back = 0L;
-#line 2525 "dk3bif.ctr"
+#line 2562 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
back = (bp->cf)->h;
}
}
-#line 2530 "dk3bif.ctr"
+#line 2567 "dk3bif.ctr"
return back;
}
@@ -2507,7 +2522,7 @@ dk3bif_get_largest_width(dk3_bif_t *bp)
dk3_bif_coord_t back = 0L;
-#line 2541 "dk3bif.ctr"
+#line 2578 "dk3bif.ctr"
if(bp) {
dk3sto_it_reset(bp->i_frames);
while((fp = (dk3_bif_frame_t *)dk3sto_it_next(bp->i_frames)) != NULL) {
@@ -2515,7 +2530,7 @@ dk3bif_get_largest_width(dk3_bif_t *bp)
}
}
-#line 2547 "dk3bif.ctr"
+#line 2584 "dk3bif.ctr"
return back;
}
@@ -2528,7 +2543,7 @@ dk3bif_get_largest_height(dk3_bif_t *bp)
dk3_bif_coord_t back = 0L;
-#line 2558 "dk3bif.ctr"
+#line 2595 "dk3bif.ctr"
if(bp) {
dk3sto_it_reset(bp->i_frames);
while((fp = (dk3_bif_frame_t *)dk3sto_it_next(bp->i_frames)) != NULL) {
@@ -2537,7 +2552,7 @@ dk3bif_get_largest_height(dk3_bif_t *bp)
}
-#line 2565 "dk3bif.ctr"
+#line 2602 "dk3bif.ctr"
return back;
}
@@ -2549,7 +2564,7 @@ dk3bif_get_red(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = (dk3_bif_pixel_t)0;
-#line 2575 "dk3bif.ctr"
+#line 2612 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
switch((bp->cf)->cs) {
@@ -2567,7 +2582,7 @@ dk3bif_get_red(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
}
}
-#line 2591 "dk3bif.ctr"
+#line 2628 "dk3bif.ctr"
return back;
}
@@ -2579,7 +2594,7 @@ dk3bif_get_green(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = (dk3_bif_pixel_t)0;
-#line 2601 "dk3bif.ctr"
+#line 2638 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
switch((bp->cf)->cs) {
@@ -2597,7 +2612,7 @@ dk3bif_get_green(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
}
}
-#line 2617 "dk3bif.ctr"
+#line 2654 "dk3bif.ctr"
return back;
}
@@ -2609,7 +2624,7 @@ dk3bif_get_blue(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = (dk3_bif_pixel_t)0;
-#line 2627 "dk3bif.ctr"
+#line 2664 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
switch((bp->cf)->cs) {
@@ -2627,7 +2642,7 @@ dk3bif_get_blue(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
}
}
-#line 2643 "dk3bif.ctr"
+#line 2680 "dk3bif.ctr"
return back;
}
@@ -2639,7 +2654,7 @@ dk3bif_get_gray(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = (dk3_bif_pixel_t)0;
-#line 2653 "dk3bif.ctr"
+#line 2690 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
switch((bp->cf)->cs) {
@@ -2659,13 +2674,13 @@ dk3bif_get_gray(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
back &= dk3pixre_get_max_value(&(bp->pr));
-#line 2671 "dk3bif.ctr"
+#line 2708 "dk3bif.ctr"
} break;
}
}
}
-#line 2675 "dk3bif.ctr"
+#line 2712 "dk3bif.ctr"
return back;
}
@@ -2677,7 +2692,7 @@ dk3bif_get_alpha(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = (dk3_bif_pixel_t)0;
-#line 2685 "dk3bif.ctr"
+#line 2722 "dk3bif.ctr"
if(bp) {
back = dk3pixre_get_max_value(&(bp->pr));
if(bp->cf) {
@@ -2698,7 +2713,7 @@ dk3bif_get_alpha(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
}
}
-#line 2704 "dk3bif.ctr"
+#line 2741 "dk3bif.ctr"
return back;
}
@@ -2755,7 +2770,7 @@ dk3bif_get_mixed_red(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = 0U;
-#line 2759 "dk3bif.ctr"
+#line 2796 "dk3bif.ctr"
back = dk3bif_get_red(bp, x, y);
if(bp->cf) {
switch((bp->cf)->cs) {
@@ -2770,7 +2785,7 @@ dk3bif_get_mixed_red(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
}
}
-#line 2772 "dk3bif.ctr"
+#line 2809 "dk3bif.ctr"
return back;
}
@@ -2782,7 +2797,7 @@ dk3bif_get_mixed_green(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = 0U;
-#line 2782 "dk3bif.ctr"
+#line 2819 "dk3bif.ctr"
back = dk3bif_get_green(bp, x, y);
if(bp->cf) {
switch((bp->cf)->cs) {
@@ -2797,7 +2812,7 @@ dk3bif_get_mixed_green(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
}
}
-#line 2795 "dk3bif.ctr"
+#line 2832 "dk3bif.ctr"
return back;
}
@@ -2809,7 +2824,7 @@ dk3bif_get_mixed_blue(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = 0U;
-#line 2805 "dk3bif.ctr"
+#line 2842 "dk3bif.ctr"
back = dk3bif_get_blue(bp, x, y);
if(bp->cf) {
switch((bp->cf)->cs) {
@@ -2824,7 +2839,7 @@ dk3bif_get_mixed_blue(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
}
}
-#line 2818 "dk3bif.ctr"
+#line 2855 "dk3bif.ctr"
return back;
}
@@ -2836,13 +2851,13 @@ dk3bif_get_mixed_gray(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
dk3_bif_pixel_t back = 0U;
-#line 2828 "dk3bif.ctr"
+#line 2865 "dk3bif.ctr"
back = dk3bif_get_gray(bp, x, y);
if(bp->cf) {
switch((bp->cf)->cs) {
case DK3_COLOR_SPACE_GRAY_ALPHA: case DK3_COLOR_SPACE_RGBA: {
-#line 2832 "dk3bif.ctr"
+#line 2869 "dk3bif.ctr"
back = dk3bif_mix(
back,
(bp->cf)->bggr,
@@ -2853,7 +2868,7 @@ dk3bif_get_mixed_gray(dk3_bif_t *bp, dk3_bif_coord_t x, dk3_bif_coord_t y)
}
}
-#line 2841 "dk3bif.ctr"
+#line 2878 "dk3bif.ctr"
return back;
}
@@ -2865,7 +2880,7 @@ dk3bif_type_supported(int tp)
int back = 0;
-#line 2851 "dk3bif.ctr"
+#line 2888 "dk3bif.ctr"
switch(tp) {
case DK3_BIF_IMAGE_TYPE_PNG: {
#if DK3_HAVE_PNG_H
@@ -2884,7 +2899,7 @@ dk3bif_type_supported(int tp)
} break;
}
-#line 2868 "dk3bif.ctr"
+#line 2905 "dk3bif.ctr"
return back;
}
@@ -2896,12 +2911,12 @@ dk3bif_get_file(dk3_bif_t *bp)
FILE *back = NULL;
-#line 2878 "dk3bif.ctr"
+#line 2915 "dk3bif.ctr"
if(bp) {
back = bp->tmpfipo;
}
-#line 2881 "dk3bif.ctr"
+#line 2918 "dk3bif.ctr"
return back;
}
@@ -2946,14 +2961,14 @@ dk3bif_get_xres(dk3_bif_t *bp)
double back = -1.0;
-#line 2924 "dk3bif.ctr"
+#line 2961 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
back = (bp->cf)->xres;
}
}
-#line 2929 "dk3bif.ctr"
+#line 2966 "dk3bif.ctr"
return back;
}
@@ -2965,14 +2980,14 @@ dk3bif_get_yres(dk3_bif_t *bp)
double back = -1.0;
-#line 2939 "dk3bif.ctr"
+#line 2976 "dk3bif.ctr"
if(bp) {
if(bp->cf) {
back = (bp->cf)->yres;
}
}
-#line 2944 "dk3bif.ctr"
+#line 2981 "dk3bif.ctr"
return back;
}
@@ -3051,7 +3066,7 @@ dk3bif_get_type(dk3_bif_t *bp)
-#line 3021 "dk3bif.ctr"
+#line 3058 "dk3bif.ctr"
int
dk3bif_jpeg_get_num_components(dk3_bif_t *bif)
@@ -3061,46 +3076,46 @@ dk3bif_jpeg_get_num_components(dk3_bif_t *bif)
dk3_bif_frame_jpeg_t *jpf;
-#line 3029 "dk3bif.ctr"
+#line 3066 "dk3bif.ctr"
if(bif) {
-#line 3030 "dk3bif.ctr"
+#line 3067 "dk3bif.ctr"
if(bif->cf) {
-#line 3031 "dk3bif.ctr"
+#line 3068 "dk3bif.ctr"
if(bif->bt == DK3_BIF_IMAGE_TYPE_JPEG) {
-#line 3032 "dk3bif.ctr"
+#line 3069 "dk3bif.ctr"
jpf = (dk3_bif_frame_jpeg_t *)((bif->cf)->implspec);
if(jpf) {
-#line 3034 "dk3bif.ctr"
+#line 3071 "dk3bif.ctr"
back = jpf->num_comp;
} else {
-#line 3036 "dk3bif.ctr"
+#line 3073 "dk3bif.ctr"
}
} else {
-#line 3038 "dk3bif.ctr"
+#line 3075 "dk3bif.ctr"
}
} else {
-#line 3040 "dk3bif.ctr"
+#line 3077 "dk3bif.ctr"
}
} else {
-#line 3042 "dk3bif.ctr"
+#line 3079 "dk3bif.ctr"
}
-#line 3043 "dk3bif.ctr"
+#line 3080 "dk3bif.ctr"
#endif
return back;
}
-#line 3048 "dk3bif.ctr"
+#line 3085 "dk3bif.ctr"
int
diff --git a/support/dktools/dk3bif.ctr b/support/dktools/dk3bif.ctr
index afc5e90634..8a1d8e0e3a 100644
--- a/support/dktools/dk3bif.ctr
+++ b/support/dktools/dk3bif.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -169,7 +169,7 @@ dk3bif_next_frame(dk3_bif_t *bp);
/** Check whether a bitmap image is really colored.
@param bp Bitmap image file.
- @return 1 for colored image, 0 for grey.
+ @return 1 for colored image, 0 for gray.
*/
int
dk3bif_is_colored(dk3_bif_t *bp);
@@ -509,13 +509,9 @@ static unsigned long dk3bif_temp_number = 0UL;
-static
-dk3_bif_frame_t *
-dk3bif_frame_new(dk3_bif_t *bp);
-
+#if DK3_HAVE_PNG_H
-#if DK3_HAVE_PNG_H
/** Per frame data, PNG-specific.
*/
typedef struct {
@@ -529,6 +525,7 @@ typedef struct {
int paln;
} dk3_bif_frame_png_t;
+
/** Per file data, PNG-specific.
*/
typedef struct {
@@ -542,6 +539,7 @@ typedef struct {
int np; /* Number of interlace passes. */
} dk3_bif_png_t;
+
/** Release type-specific information for PNG file.
@param is Bitmap-type specific data.
*/
@@ -563,6 +561,221 @@ dk3bif_frame_release_implspec_png(void *is)
$? "- dk3bif_frame_release_implspec_png"
}
+
+#endif
+/* if DK3_HAVE_PNG_H */
+
+
+
+#if DK3_HAVE_JPEGLIB_H
+
+
+/*
+ JPEGLIB error management.
+*/
+
+/** JPEGLIB error manager.
+*/
+typedef struct {
+ struct jpeg_error_mgr pub; /**< Default error manager. */
+#if DK3_HAVE_SETJMP_H
+ jmp_buf setjmp_buffer; /**< Buffer for setjmp. */
+#endif
+} dk3_bif_jpg_error_mgr;
+
+
+/** Per frame data, JPEG-specific.
+*/
+typedef struct {
+ JSAMPLE **rows; /**< Sample buffer. */
+ JDIMENSION w; /**< Image width. */
+ JDIMENSION h; /**< Image height. */
+ int is_adobe; /**< Flag: Adobe marker found. */
+ int num_comp; /**< Number of components found. */
+} dk3_bif_frame_jpeg_t;
+
+
+/** Per file data, JPEG-specific.
+*/
+typedef struct {
+ int st;
+ struct jpeg_decompress_struct cinfo; /**< Decompression struct. */
+ dk3_bif_jpg_error_mgr errmgr; /**< Error manager. */
+} dk3_bif_jpeg_t;
+
+
+/** Error exit replacement function.
+ @param cinfo JPEG decompression structure.
+*/
+static
+void
+dk3bif_jpeg_error_exit(j_common_ptr cinfo)
+{
+ dk3_bif_jpg_error_mgr *myerr = (dk3_bif_jpg_error_mgr *)(cinfo->err);
+ if(myerr) {
+ longjmp(myerr->setjmp_buffer, 1);
+ }
+}
+
+
+/** Release type-specific information for JPEG file (frame).
+ @param is Bitmap-type specific data.
+*/
+static
+void
+dk3bif_frame_release_implspec_jpeg(void *is)
+{
+ dk3_bif_frame_jpeg_t *fdis;
+ JSAMPLE **ptr;
+ JDIMENSION i;
+ fdis = (dk3_bif_frame_jpeg_t *)is;
+ if(fdis->rows) {
+ ptr = fdis->rows;
+ for(i = 0; i < fdis->h; i++) {
+ dk3_release(*ptr);
+ ptr++;
+ }
+ dk3_delete(fdis->rows);
+ }
+ dk3_delete(is);
+}
+
+
+#endif
+/* if DK3_HAVE_JPEGLIB_H */
+
+
+
+#if DK3_HAVE_TIFF_H
+
+
+/** Per frame data, TIFF-specific.
+*/
+typedef struct {
+ uint32 *r; /**< Raster image data. */
+ uint32 w; /**< Image width. */
+ uint32 h; /**< Image height. */
+ uint16 cps;
+ uint16 spp;
+ uint16 ori; /**< Orientation. */
+} dk3_bif_frame_tiff_t;
+
+
+/** Per file data, TIFF-specific.
+*/
+typedef struct {
+ TIFF *tiff;
+} dk3_bif_tiff_t;
+
+
+/** Release type-specific information for TIFF file.
+ @param is Bitmap-type specific data.
+*/
+static
+void
+dk3bif_frame_release_implspec_tiff(void *is)
+{
+ dk3_bif_frame_tiff_t *fdis;
+ fdis = (dk3_bif_frame_tiff_t *)is;
+ if(fdis->r) {
+ _TIFFfree(fdis->r);
+ fdis->r = NULL;
+ }
+ fdis->w = fdis->h = 0UL; fdis->spp = fdis->cps = 0U;
+ dk3_delete(fdis);
+}
+
+
+#endif
+/* if DK3_HAVE_TIFF_H */
+
+
+
+/** Delete BIF frame, release memory.
+ @param tp Image type.
+ @param fp Frame to delete.
+*/
+static
+void
+dk3bif_frame_delete(dk3_bif_frame_t *fp, int tp)
+{
+ $? "+ dk3bif_frame_delete %!8s", TR_8PTR(fp)
+ if(fp) {
+ /*
+ Release type-depending components.
+ */
+ if(fp->implspec) {
+ switch(tp) {
+ case DK3_BIF_IMAGE_TYPE_PNG: {
+#if DK3_HAVE_PNG_H
+ dk3bif_frame_release_implspec_png(fp->implspec);
+#endif
+ } break;
+ case DK3_BIF_IMAGE_TYPE_JPEG: {
+#if DK3_HAVE_JPEGLIB_H
+ dk3bif_frame_release_implspec_jpeg(fp->implspec);
+#endif
+ } break;
+ case DK3_BIF_IMAGE_TYPE_TIFF: {
+#if DK3_HAVE_TIFF_H
+ dk3bif_frame_release_implspec_tiff(fp->implspec);
+#endif
+ } break;
+ }
+ }
+ fp->implspec = NULL;
+ /*
+ Release type-independent components.
+ */
+ fp->w = fp->h = 0L; fp->realbits = fp->bits = fp->n = 0; fp->cs = 0;
+ /*
+ Release frame itself.
+ */
+ dk3_delete(fp);
+ } $? "- dk3bif_frame_delete"
+}
+
+
+
+#if (DK3_HAVE_PNG_H) || (DK3_HAVE_JPEGLIB_H) || (DK3_HAVE_TIFF_H)
+
+/** Allocate memory for new frame.
+ @param bp Bitmap image file.
+ @return Pointer to new frame on success, NULL on error.
+*/
+static
+dk3_bif_frame_t *
+dk3bif_frame_new(dk3_bif_t *bp)
+{
+ dk3_bif_frame_t *back = NULL;
+ back = dk3_new_app(dk3_bif_frame_t,1,bp->app);
+ if(back) {
+ back->implspec = NULL;
+ back->xres = -1.0;
+ back->yres = -1.0;
+ back->w = 0L;
+ back->h = 0L;
+ back->realbits = back->bits = 0;
+ back->realcolor = 1;
+ back->realalpha = 1;
+ back->n = bp->n_frames;
+ back->cs = 0;
+ back->bg = 0; back->bgr = back->bgg = back->bgb = back->bggr = 0U;
+ if(dk3sto_add(bp->s_frames, (void *)back)) {
+ bp->n_frames += 1;
+ } else {
+ dk3bif_frame_delete(back, bp->bt); back = NULL;
+ }
+ }
+ return back;
+}
+
+#endif
+
+
+
+#if DK3_HAVE_PNG_H
+
/** Release type specific information for PNG file (image).
@param is Bitmap-type specific data.
*/
@@ -612,7 +825,7 @@ dk3bif_read_png_header(dk3_bif_t *bp)
int cm; /* Compression method. */
int fm; /* Filter method. */
int ch; /* Number of channels. */
- int np = 1; /* Number of interlace passes. */
+ volatile int np = 1; /* Number of interlace passes. */
size_t szh; /* Number of header bytes read. */
int back = 0;
$? "+ dk3bif_read_png_header"
@@ -815,7 +1028,7 @@ dk3bif_read_png_data(dk3_bif_t *bp)
dk3_bif_frame_png_t *fdis;
png_bytep *rp;
dk3_bif_coord_t i;
- int back = 0;
+ volatile int back = 0;
dis = (dk3_bif_png_t *)(bp->implspec);
fdis = (dk3_bif_frame_png_t *)((bp->cf)->implspec);
#if DK3_HAVE_SETJMP_H
@@ -930,76 +1143,12 @@ dk3bif_get_png_pixel_component(
}
return back;
}
-#endif
-/* if DK3_HAVE_PNG_H */
-
-
-#if DK3_HAVE_JPEGLIB_H
-/*
- JPEGLIB error management.
-*/
-/** JPEGLIB error manager.
-*/
-typedef struct {
- struct jpeg_error_mgr pub; /**< Default error manager. */
-#if DK3_HAVE_SETJMP_H
- jmp_buf setjmp_buffer; /**< Buffer for setjmp. */
#endif
-} dk3_bif_jpg_error_mgr;
-/** Per frame data, JPEG-specific.
-*/
-typedef struct {
- JSAMPLE **rows; /**< Sample buffer. */
- JDIMENSION w; /**< Image width. */
- JDIMENSION h; /**< Image height. */
- int is_adobe; /**< Flag: Adobe marker found. */
- int num_comp; /**< Number of components found. */
-} dk3_bif_frame_jpeg_t;
-/** Per file data, JPEG-specific.
-*/
-typedef struct {
- int st;
- struct jpeg_decompress_struct cinfo; /**< Decompression struct. */
- dk3_bif_jpg_error_mgr errmgr; /**< Error manager. */
-} dk3_bif_jpeg_t;
-/** Error exit replacement function.
- @param cinfo JPEG decompression structure.
-*/
-static
-void
-dk3bif_jpeg_error_exit(j_common_ptr cinfo)
-{
- dk3_bif_jpg_error_mgr *myerr = (dk3_bif_jpg_error_mgr *)(cinfo->err);
- if(myerr) {
- longjmp(myerr->setjmp_buffer, 1);
- }
-}
-
-/** Release type-specific information for JPEG file (frame).
- @param is Bitmap-type specific data.
-*/
-static
-void
-dk3bif_frame_release_implspec_jpeg(void *is)
-{
- dk3_bif_frame_jpeg_t *fdis;
- JSAMPLE **ptr;
- JDIMENSION i;
- fdis = (dk3_bif_frame_jpeg_t *)is;
- if(fdis->rows) {
- ptr = fdis->rows;
- for(i = 0; i < fdis->h; i++) {
- dk3_release(*ptr);
- ptr++;
- }
- dk3_delete(fdis->rows);
- }
- dk3_delete(is);
-}
+#if DK3_HAVE_JPEGLIB_H
/** Release type specific information for JPEG file (image).
@param is Bitmap-type specific data.
@@ -1171,7 +1320,7 @@ dk3bif_read_jpeg_data(dk3_bif_t *bp)
jpeg_finish_decompress(&(dis->cinfo)); $? ". finished"
dis->st = 8; /* Decompression finished. */
switch((dis->cinfo).out_color_space) {
- case JCS_GRAYSCALE: { $? ". now grey"
+ case JCS_GRAYSCALE: { $? ". now gray"
(bp->cf)->cs = DK3_COLOR_SPACE_GRAY;
back = 1;
} break;
@@ -1268,45 +1417,12 @@ dk3bif_get_jpeg_pixel_component(
}
return back;
}
+
#endif
-/* if DK3_HAVE_JPEGLIB_H */
#if DK3_HAVE_TIFF_H
-/** Per frame data, TIFF-specific.
-*/
-typedef struct {
- uint32 *r; /**< Raster image data. */
- uint32 w; /**< Image width. */
- uint32 h; /**< Image height. */
- uint16 cps;
- uint16 spp;
- uint16 ori; /**< Orientation. */
-} dk3_bif_frame_tiff_t;
-
-/** Per file data, TIFF-specific.
-*/
-typedef struct {
- TIFF *tiff;
-} dk3_bif_tiff_t;
-
-/** Release type-specific information for TIFF file.
- @param is Bitmap-type specific data.
-*/
-static
-void
-dk3bif_frame_release_implspec_tiff(void *is)
-{
- dk3_bif_frame_tiff_t *fdis;
- fdis = (dk3_bif_frame_tiff_t *)is;
- if(fdis->r) {
- _TIFFfree(fdis->r);
- fdis->r = NULL;
- }
- fdis->w = fdis->h = 0UL; fdis->spp = fdis->cps = 0U;
- dk3_delete(fdis);
-}
/** Release type specific information for TIFF file (image).
@param is Bitmap-type specific data.
@@ -1578,8 +1694,8 @@ dk3bif_get_tiff_pixel_component(
}
return back;
}
+
#endif
-/* if DK3_HAVE_TIFF_H */
@@ -1606,85 +1722,6 @@ dk3bif_ntsc(dk3_bif_pixel_t r, dk3_bif_pixel_t g, dk3_bif_pixel_t b)
-/** Delete BIF frame, release memory.
- @param tp Image type.
- @param fp Frame to delete.
-*/
-static
-void
-dk3bif_frame_delete(dk3_bif_frame_t *fp, int tp)
-{
- $? "+ dk3bif_frame_delete %!8s", TR_8PTR(fp)
- if(fp) {
- /*
- Release type-depending components.
- */
- if(fp->implspec) {
- switch(tp) {
- case DK3_BIF_IMAGE_TYPE_PNG: {
-#if DK3_HAVE_PNG_H
- dk3bif_frame_release_implspec_png(fp->implspec);
-#endif
- } break;
- case DK3_BIF_IMAGE_TYPE_JPEG: {
-#if DK3_HAVE_JPEGLIB_H
- dk3bif_frame_release_implspec_jpeg(fp->implspec);
-#endif
- } break;
- case DK3_BIF_IMAGE_TYPE_TIFF: {
-#if DK3_HAVE_TIFF_H
- dk3bif_frame_release_implspec_tiff(fp->implspec);
-#endif
- } break;
- }
- }
- fp->implspec = NULL;
- /*
- Release type-independent components.
- */
- fp->w = fp->h = 0L; fp->realbits = fp->bits = fp->n = 0; fp->cs = 0;
- /*
- Release frame itself.
- */
- dk3_delete(fp);
- } $? "- dk3bif_frame_delete"
-}
-
-
-
-/** Allocate memory for new frame.
- @param bp Bitmap image file.
- @return Pointer to new frame on success, NULL on error.
-*/
-static
-dk3_bif_frame_t *
-dk3bif_frame_new(dk3_bif_t *bp)
-{
- dk3_bif_frame_t *back = NULL;
- back = dk3_new_app(dk3_bif_frame_t,1,bp->app);
- if(back) {
- back->implspec = NULL;
- back->xres = -1.0;
- back->yres = -1.0;
- back->w = 0L;
- back->h = 0L;
- back->realbits = back->bits = 0;
- back->realcolor = 1;
- back->realalpha = 1;
- back->n = bp->n_frames;
- back->cs = 0;
- back->bg = 0; back->bgr = back->bgg = back->bgb = back->bggr = 0U;
- if(dk3sto_add(bp->s_frames, (void *)back)) {
- bp->n_frames += 1;
- } else {
- dk3bif_frame_delete(back, bp->bt); back = NULL;
- }
- }
- return back;
-}
-
-
-
dk3_bif_pixel_t
dk3bif_get_pixel_component_not_resampled(
dk3_bif_t *bp,
@@ -2295,11 +2332,11 @@ dk3bif_check_c8_file_name(char const *fn)
-
/** Transfer background color from image to frame.
@param bp Bitmap image file (source).
@param fr Frame (destination).
*/
+static
void
dk3_bif_transfer_background(dk3_bif_t *bp, dk3_bif_frame_t *fr)
{
diff --git a/support/dktools/dk3bif.h b/support/dktools/dk3bif.h
index 000c0df05a..fcdee94b1c 100644
--- a/support/dktools/dk3bif.h
+++ b/support/dktools/dk3bif.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bif.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bif.ctr
*/
/** @file dk3bif.h Header file for the dk3bif module.
@@ -204,7 +182,7 @@ dk3bif_next_frame(dk3_bif_t *bp);
/** Check whether a bitmap image is really colored.
@param bp Bitmap image file.
- @return 1 for colored image, 0 for grey.
+ @return 1 for colored image, 0 for gray.
*/
int
dk3bif_is_colored(dk3_bif_t *bp);
diff --git a/support/dktools/dk3bifa.c b/support/dktools/dk3bifa.c
index 859e385c54..139f8c01d2 100644
--- a/support/dktools/dk3bifa.c
+++ b/support/dktools/dk3bifa.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bifa.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bifa.ctr
*/
/** @file dk3bifa.c The dk3bifa module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 49 "dk3bifa.ctr"
+#include "dk3conf.h"
#include "dk3const.h"
#include "dk3mem.h"
#include "dk3str.h"
@@ -59,11 +38,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "DkWxCommunicator.h"
#endif
+#include "dk3unused.h"
-#line 73 "dk3bifa.ctr"
+
+#line 76 "dk3bifa.ctr"
@@ -74,10 +55,10 @@ static dkChar const * const dk3bif_analysis_msg[] = {
dkT("Image analysis: Original image is color image."),
/* 1 */
-dkT("Image analysis: Original image is greyscaled image."),
+dkT("Image analysis: Original image is grayscaled image."),
/* 2 */
-dkT("Image analysis: Can reduce image to greyscaled image."),
+dkT("Image analysis: Can reduce image to grayscaled image."),
/* 3 */
dkT("Image analysis: Really a color image."),
@@ -109,7 +90,7 @@ dkT(" bits per component."),
NULL
-#line 123 "dk3bifa.ctr"
+#line 126 "dk3bifa.ctr"
};
@@ -130,7 +111,7 @@ dk3bif_real_bits(dk3_bif_pixel_t v, size_t nbits)
size_t j;
-#line 142 "dk3bifa.ctr"
+#line 145 "dk3bifa.ctr"
for(i = 0; i < nbits; i++) {
j = nbits - i - 1;
if(i == 0) {
@@ -155,7 +136,7 @@ dk3bif_real_bits(dk3_bif_pixel_t v, size_t nbits)
}
}
-#line 165 "dk3bifa.ctr"
+#line 168 "dk3bifa.ctr"
return back;
}
#endif
@@ -247,7 +228,6 @@ static
void
dk3bif_analyze_setup_structure(
dk3_bif_analyze_bitdepth_t *p,
- int at,
size_t srcw
)
{
@@ -322,9 +302,9 @@ void
dk3bif_analyze_progress(
dk3_bif_t *bp,
int at,
- void *pcomm,
- int minpb,
- int maxpb
+ void *DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
)
{
dk3_bif_analyze_bitdepth_t ana;
@@ -340,6 +320,10 @@ dk3bif_analyze_progress(
dk3_bif_pixel_t g;
dk3_bif_pixel_t b;
dk3_bif_pixel_t a;
+
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
if (bp) {
if (bp->cf) {
/* Default values for all color space types.
@@ -394,7 +378,7 @@ dk3bif_analyze_progress(
/* Do analysis
*/
- dk3bif_analyze_setup_structure(&ana, at, (bp->cf)->bits);
+ dk3bif_analyze_setup_structure(&ana, (bp->cf)->bits);
maxval = dk3pixre_maximum_for_width((bp->cf)->bits);
found_color = 0;
found_alpha = 0;
diff --git a/support/dktools/dk3bifa.ctr b/support/dktools/dk3bifa.ctr
index 018fcfb68a..7ef910674a 100644
--- a/support/dktools/dk3bifa.ctr
+++ b/support/dktools/dk3bifa.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -47,6 +47,7 @@ dk3bif_analyze(dk3_bif_t *bp, int at);
%% module
+#include "dk3conf.h"
#include "dk3const.h"
#include "dk3mem.h"
#include "dk3str.h"
@@ -67,6 +68,8 @@ dk3bif_analyze(dk3_bif_t *bp, int at);
#include "DkWxCommunicator.h"
#endif
+#include "dk3unused.h"
+
$!trace-include
@@ -84,11 +87,11 @@ Image analysis: Original image is color image.
#
# 1
#
-Image analysis: Original image is greyscaled image.
+Image analysis: Original image is grayscaled image.
#
# 2
#
-Image analysis: Can reduce image to greyscaled image.
+Image analysis: Can reduce image to grayscaled image.
#
# 3
#
@@ -253,7 +256,6 @@ static
void
dk3bif_analyze_setup_structure(
dk3_bif_analyze_bitdepth_t *p,
- int at,
size_t srcw
)
{
@@ -328,9 +330,9 @@ void
dk3bif_analyze_progress(
dk3_bif_t *bp,
int at,
- void *pcomm,
- int minpb,
- int maxpb
+ void *DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
)
{
dk3_bif_analyze_bitdepth_t ana;
@@ -346,6 +348,10 @@ dk3bif_analyze_progress(
dk3_bif_pixel_t g;
dk3_bif_pixel_t b;
dk3_bif_pixel_t a;
+
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
if (bp) {
if (bp->cf) {
/* Default values for all color space types.
@@ -400,7 +406,7 @@ dk3bif_analyze_progress(
/* Do analysis
*/
- dk3bif_analyze_setup_structure(&ana, at, (bp->cf)->bits);
+ dk3bif_analyze_setup_structure(&ana, (bp->cf)->bits);
maxval = dk3pixre_maximum_for_width((bp->cf)->bits);
found_color = 0;
found_alpha = 0;
diff --git a/support/dktools/dk3bifa.h b/support/dktools/dk3bifa.h
index 290887a5dd..bcf1b75781 100644
--- a/support/dktools/dk3bifa.h
+++ b/support/dktools/dk3bifa.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bifa.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bifa.ctr
*/
/** @file dk3bifa.h Header file for the dk3bifa module.
diff --git a/support/dktools/dk3bits.c b/support/dktools/dk3bits.c
index 26158ecc40..bc57fc763d 100644
--- a/support/dktools/dk3bits.c
+++ b/support/dktools/dk3bits.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bits.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bits.ctr
*/
/** @file dk3bits.c The dk3bits module.
diff --git a/support/dktools/dk3bits.ctr b/support/dktools/dk3bits.ctr
index 85cac7a012..67bcae2293 100644
--- a/support/dktools/dk3bits.ctr
+++ b/support/dktools/dk3bits.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3bits.h b/support/dktools/dk3bits.h
index a38fd7c75d..cd8d1ebc86 100644
--- a/support/dktools/dk3bits.h
+++ b/support/dktools/dk3bits.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bits.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bits.ctr
*/
/** @file dk3bits.h Header file for the dk3bits module.
diff --git a/support/dktools/dk3bm.c b/support/dktools/dk3bm.c
index 09fffa6699..57d73d7483 100644
--- a/support/dktools/dk3bm.c
+++ b/support/dktools/dk3bm.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bm.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bm.ctr
*/
/** @file dk3bm.c The dk3bm module.
@@ -54,10 +32,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <wxbmeps.h>
#endif
+#include "dk3unused.h"
-#line 124 "dk3bm.ctr"
+
+
+#line 127 "dk3bm.ctr"
@@ -213,7 +194,7 @@ dk3bm_correct_output_buffer(char *s)
char *ptr; /* Temporary pointer to traverse string. */
-#line 278 "dk3bm.ctr"
+#line 281 "dk3bm.ctr"
if(s) {
ptr = s;
while(*ptr) {
@@ -222,7 +203,7 @@ dk3bm_correct_output_buffer(char *s)
}
}
-#line 285 "dk3bm.ctr"
+#line 288 "dk3bm.ctr"
}
@@ -242,14 +223,14 @@ dk3bm_ps_document_header(dk3_bm_conversion_job_t *job, size_t pages)
int ie; /* Input encoding. */
-#line 303 "dk3bm.ctr"
+#line 306 "dk3bm.ctr"
fputs(dk3bm_c8_kw[((job->opt)->psl == 3) ? 14 : 13], job->dfile);
if((job->opt)->dr == DK3_BMEPS_DRIVER_EPS) {
fputs(dk3bm_c8_kw[((job->opt)->psl == 3) ? 16 : 15], job->dfile);
}
fputs(dk3bm_c8_kw[0], job->dfile);
-#line 308 "dk3bm.ctr"
+#line 311 "dk3bm.ctr"
fprintf(job->dfile, dk3bm_c8_kw[31], job->x_size, job->y_size);
fputs(dk3bm_c8_kw[((job->opt)->psl == 3) ? 33 : 32], job->dfile);
if((job->opt)->dsc) {
@@ -316,7 +297,7 @@ dk3bm_ps_document_header(dk3_bm_conversion_job_t *job, size_t pages)
}
}
-#line 373 "dk3bm.ctr"
+#line 376 "dk3bm.ctr"
}
@@ -330,7 +311,7 @@ dk3bm_ps_document_footer(dk3_bm_conversion_job_t *job)
{
-#line 385 "dk3bm.ctr"
+#line 388 "dk3bm.ctr"
if((job->opt)->dsc) {
fputs(dk3bm_c8_kw[61], job->dfile);
fputs(dk3bm_c8_kw[62], job->dfile);
@@ -345,7 +326,7 @@ dk3bm_ps_document_footer(dk3_bm_conversion_job_t *job)
} break;
}
-#line 398 "dk3bm.ctr"
+#line 401 "dk3bm.ctr"
}
@@ -370,7 +351,7 @@ dk3bm_copy_dct_data(
int cc; /* Flag: Can continue. */
-#line 421 "dk3bm.ctr"
+#line 424 "dk3bm.ctr"
cc = 1;
while(cc) {
cc = 0;
@@ -388,7 +369,7 @@ dk3bm_copy_dct_data(
}
}
-#line 437 "dk3bm.ctr"
+#line 440 "dk3bm.ctr"
return back;
}
@@ -405,7 +386,7 @@ dk3bm_define_flate_with_predictor(dk3_bm_conversion_job_t *job)
int i = 0; /* Predictor ID in PS and PDF. */
-#line 452 "dk3bm.ctr"
+#line 455 "dk3bm.ctr"
fputs(dk3bm_c8_kw[80], job->dfile);
/* Predictor Columns Colors BitsPerComponent */
switch((job->opt)->pred) {
@@ -438,7 +419,7 @@ dk3bm_define_flate_with_predictor(dk3_bm_conversion_job_t *job)
}
fputs(dk3bm_c8_kw[81], job->dfile);
-#line 483 "dk3bm.ctr"
+#line 486 "dk3bm.ctr"
}
@@ -454,11 +435,11 @@ dk3bm_write_uc(dk3_of_t *of, dk3_bif_pixel_t v)
unsigned char ucv; /* Byte to write. */
-#line 497 "dk3bm.ctr"
+#line 500 "dk3bm.ctr"
ucv = (unsigned char)v;
dk3of_write_bytes(of, &ucv, 1);
-#line 499 "dk3bm.ctr"
+#line 502 "dk3bm.ctr"
}
@@ -494,7 +475,7 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
int use_dct = 0; /* Flag: DCT used. */
int me = 0; /* Flag: Math error. */
int alphain = 0; /* Flag: Alpha channel. */
-#if TRACE_DEBUG || VERSION_BEFORE_20150821
+#if VERSION_BEFORE_20150821
int colorin = 0; /* Flag: Color image. */
#endif
#if DK3_USE_WX
@@ -505,14 +486,14 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
#endif
-#line 544 "dk3bm.ctr"
+#line 547 "dk3bm.ctr"
#if DK3_USE_WX
minpb = job->minpb;
maxpb = job->maxpb;
#endif
if(job->dfile) {
-#line 549 "dk3bm.ctr"
+#line 552 "dk3bm.ctr"
alphain = 0;
switch(dk3bif_get_color_space(job->bif)) {
case DK3_COLOR_SPACE_GRAY_ALPHA:
@@ -520,7 +501,7 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
{
alphain = 1;
-#line 555 "dk3bm.ctr"
+#line 558 "dk3bm.ctr"
} break;
}
#if VERSION_BEFORE_20150821
@@ -537,7 +518,7 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
#if VERSION_BEFORE_20150821
colorin = 1;
-#line 570 "dk3bm.ctr"
+#line 573 "dk3bm.ctr"
#endif
} break;
}
@@ -555,39 +536,39 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
switch(dk3bif_get_type(job->bif)) {
case DK3_BIF_IMAGE_TYPE_JPEG: {
-#line 586 "dk3bm.ctr"
+#line 589 "dk3bm.ctr"
if((job->opt)->dct) {
-#line 587 "dk3bm.ctr"
+#line 590 "dk3bm.ctr"
switch(dk3bif_get_bits_per_pixel(job->bif)) {
case 8: case 4: case 2: case 1: {
-#line 589 "dk3bm.ctr"
+#line 592 "dk3bm.ctr"
switch(dk3bif_jpeg_get_num_components(job->bif)) {
case 1: {
-#line 591 "dk3bm.ctr"
+#line 594 "dk3bm.ctr"
job->procedure = DK3_BMEPS_GRAY_DCT;
job->bpc = dk3bif_get_bits_per_pixel(job->bif);
use_dct = 1;
} break;
case 3: {
-#line 596 "dk3bm.ctr"
+#line 599 "dk3bm.ctr"
job->procedure = DK3_BMEPS_RGB_DCT;
job->bpc = dk3bif_get_bits_per_pixel(job->bif);
use_dct = 1;
} break;
case 4: {
-#line 601 "dk3bm.ctr"
+#line 604 "dk3bm.ctr"
job->procedure = DK3_BMEPS_CMYK_DCT;
job->bpc = dk3bif_get_bits_per_pixel(job->bif);
use_dct = 1;
} break;
default: {
-#line 606 "dk3bm.ctr"
+#line 609 "dk3bm.ctr"
} break;
}
} break;
@@ -772,7 +753,7 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
#if DK3_USE_WX
-#line 789 "dk3bm.ctr"
+#line 792 "dk3bm.ctr"
dk3bmj_progress(job->pComm, ((maxpb + minpb)/2));
job->minpb = ((maxpb + minpb) / 2);
pbmin = job->minpb;
@@ -1369,7 +1350,7 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
if(job->bpc == 8) {
if(alphain) {
-#line 1384 "dk3bm.ctr"
+#line 1387 "dk3bm.ctr"
switch((job->opt)->pred) {
case DK3_COMPRESSION_PREDICTOR_TIFF: {
for(y = 0UL; y < h; y++) {
@@ -1403,15 +1384,15 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
dk3bm_write_uc(of, 2);
for(x = 0UL; x < w; x++) {
-#line 1416 "dk3bm.ctr"
+#line 1419 "dk3bm.ctr"
v = dk3bif_get_mixed_gray(job->bif, x, y);
pu = dk3bif_get_mixed_gray(job->bif, x, (y - 1L));
-#line 1419 "dk3bm.ctr"
+#line 1422 "dk3bm.ctr"
v = v - pu;
-#line 1420 "dk3bm.ctr"
+#line 1423 "dk3bm.ctr"
dk3bm_write_uc(of, v);
}
#if DK3_USE_WX
@@ -2034,7 +2015,7 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
}
} else {
-#line 2041 "dk3bm.ctr"
+#line 2044 "dk3bm.ctr"
/* BUG: No output file! */
}
#if DK3_USE_WX
@@ -2043,7 +2024,7 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
#endif
-#line 2048 "dk3bm.ctr"
+#line 2051 "dk3bm.ctr"
return back;
}
@@ -2080,22 +2061,22 @@ dk3bm_find_transformation(
int back = 0;
-#line 2083 "dk3bm.ctr"
+#line 2086 "dk3bm.ctr"
if((dst) && (outbb)) {
back = 1;
w = imw;
-#line 2086 "dk3bm.ctr"
+#line 2089 "dk3bm.ctr"
h = imh;
-#line 2087 "dk3bm.ctr"
+#line 2090 "dk3bm.ctr"
if((xres > 0.0) && (yres > 0.0)) {
w = dk3ma_d_div_ok(w, xres, &mec);
-#line 2089 "dk3bm.ctr"
+#line 2092 "dk3bm.ctr"
h = dk3ma_d_div_ok(h, yres, &mec);
-#line 2090 "dk3bm.ctr"
+#line 2093 "dk3bm.ctr"
}
#if VERSION_BEFORE_20150821
sx = sy = sf = 0.0;
@@ -2200,22 +2181,22 @@ dk3bm_find_transformation(
dst->y_scale = yused;
-#line 2193 "dk3bm.ctr"
+#line 2196 "dk3bm.ctr"
-#line 2194 "dk3bm.ctr"
+#line 2197 "dk3bm.ctr"
-#line 2195 "dk3bm.ctr"
+#line 2198 "dk3bm.ctr"
-#line 2196 "dk3bm.ctr"
+#line 2199 "dk3bm.ctr"
-#line 2197 "dk3bm.ctr"
+#line 2200 "dk3bm.ctr"
-#line 2198 "dk3bm.ctr"
+#line 2201 "dk3bm.ctr"
dst->rot = 0;
switch(drawdir) {
case DK3_IMAGE_ORIGIN_LEFT_BOTTOM: { /* 1 */
@@ -2271,25 +2252,25 @@ dk3bm_find_transformation(
}
-#line 2252 "dk3bm.ctr"
+#line 2255 "dk3bm.ctr"
-#line 2253 "dk3bm.ctr"
+#line 2256 "dk3bm.ctr"
-#line 2254 "dk3bm.ctr"
+#line 2257 "dk3bm.ctr"
-#line 2255 "dk3bm.ctr"
+#line 2258 "dk3bm.ctr"
-#line 2256 "dk3bm.ctr"
+#line 2259 "dk3bm.ctr"
}
if(mec) {
if(ec) { *ec = mec; }
}
-#line 2260 "dk3bm.ctr"
+#line 2263 "dk3bm.ctr"
return back;
}
@@ -2313,7 +2294,7 @@ dk3bm_find_bif_transformation(
int back = 0;
-#line 2282 "dk3bm.ctr"
+#line 2285 "dk3bm.ctr"
if((dst) && (bif) && (outbb)) {
imw = dk3bif_get_width(bif);
imh = dk3bif_get_height(bif);
@@ -2324,7 +2305,7 @@ dk3bm_find_bif_transformation(
back = dk3bm_find_transformation(dst, outbb, drawdir, w, h, xres, yres, ec);
}
-#line 2291 "dk3bm.ctr"
+#line 2294 "dk3bm.ctr"
return back;
}
@@ -2347,12 +2328,12 @@ dk3bm_ps_place_object(
int back = 0;
-#line 2312 "dk3bm.ctr"
+#line 2315 "dk3bm.ctr"
if((dfile) && (outbb) && (sfn) && (app)) {
dk3bmj_init(&job, app);
dk3bmeo_init(&bmeo);
-#line 2315 "dk3bm.ctr"
+#line 2318 "dk3bm.ctr"
job.opt = &bmeo;
job.sfn = NULL;
job.dfile = dfile;
@@ -2370,7 +2351,7 @@ dk3bm_ps_place_object(
bmeo.mode = DK3_BMEPS_MODE_OBJECT;
bmeo.szmode = DK3_BMEPS_SIZE_1_1;
-#line 2331 "dk3bm.ctr"
+#line 2334 "dk3bm.ctr"
bmeo.dr = DK3_BMEPS_DRIVER_EPS;
#endif
bmeo.io = drawdir;
@@ -2378,11 +2359,11 @@ dk3bm_ps_place_object(
job.bif = dk3bif_open_c8_filename_app(sfn,DK3_BIF_IMAGE_TYPE_UNKNOWN,app);
if(job.bif) {
-#line 2337 "dk3bm.ctr"
+#line 2340 "dk3bm.ctr"
job.biftype = dk3bif_get_type(job.bif);
/* job.procedure = */
-#line 2339 "dk3bm.ctr"
+#line 2342 "dk3bm.ctr"
/* job->x_size */
/* job->y_size */
/* job->x_0 */
@@ -2396,7 +2377,7 @@ dk3bm_ps_place_object(
if(dk3bm_find_bif_transformation(&trans, job.bif, outbb, drawdir, ec)) {
/* FIG2LAT */
-#line 2351 "dk3bm.ctr"
+#line 2354 "dk3bm.ctr"
job.x_translate = trans.x_translate;
job.y_translate = trans.y_translate;
job.x_scale = trans.x_scale;
@@ -2405,7 +2386,7 @@ dk3bm_ps_place_object(
job.do_translate = 1;
job.do_float_scale = 1;
-#line 2358 "dk3bm.ctr"
+#line 2361 "dk3bm.ctr"
if(dk3bif_read_data(job.bif)) {
back = dk3bm_job_produce_img_job_real_ps(&job);
} else {
@@ -2417,15 +2398,15 @@ dk3bm_ps_place_object(
dk3bif_close(job.bif);
} else {
-#line 2368 "dk3bm.ctr"
+#line 2371 "dk3bm.ctr"
/* ##### ERROR: Failed to open image */
}
} else {
-#line 2371 "dk3bm.ctr"
+#line 2374 "dk3bm.ctr"
}
-#line 2372 "dk3bm.ctr"
+#line 2375 "dk3bm.ctr"
return back;
}
@@ -2442,14 +2423,14 @@ dk3bm_check_paper_size(dk3_paper_size_t *ps)
int back = 0;
-#line 2387 "dk3bm.ctr"
+#line 2390 "dk3bm.ctr"
if(ps->w > (ps->i + ps->o)) {
if(ps->h > (ps->t + ps->b)) {
back = 1;
}
}
-#line 2392 "dk3bm.ctr"
+#line 2395 "dk3bm.ctr"
return back;
}
@@ -2470,7 +2451,7 @@ dk3bm_job_produce_img_job_draft_ps(dk3_bm_conversion_job_t *job)
int back = 0;
-#line 2411 "dk3bm.ctr"
+#line 2414 "dk3bm.ctr"
dk3bm_ps_document_header(job, job->nPages);
fputs(dk3bm_c8_kw[4], job->dfile);
fputs(dk3bm_c8_kw[21], job->dfile);
@@ -2552,7 +2533,7 @@ dk3bm_job_produce_img_job_draft_ps(dk3_bm_conversion_job_t *job)
dk3bm_ps_document_footer(job);
-#line 2491 "dk3bm.ctr"
+#line 2494 "dk3bm.ctr"
return back;
}
@@ -2590,7 +2571,7 @@ dk3bm_job_produce_doc_real_ps(dk3_bm_conversion_job_t *job)
#endif
-#line 2527 "dk3bm.ctr"
+#line 2530 "dk3bm.ctr"
#if DK3_USE_WX
minpb = job->minpb;
maxpb = job->maxpb;
@@ -2598,17 +2579,17 @@ dk3bm_job_produce_doc_real_ps(dk3_bm_conversion_job_t *job)
switch((job->opt)->szmode) {
case DK3_BMEPS_SIZE_1_1: {
-#line 2533 "dk3bm.ctr"
+#line 2536 "dk3bm.ctr"
workmode = 0;
} break;
case DK3_BMEPS_SIZE_CHUNK: case DK3_BMEPS_SIZE_SPECIFIED: {
workmode = 1;
-#line 2537 "dk3bm.ctr"
+#line 2540 "dk3bm.ctr"
} break;
case DK3_BMEPS_SIZE_PAPER: {
-#line 2539 "dk3bm.ctr"
+#line 2542 "dk3bm.ctr"
workmode = 2;
if(!dk3bm_check_paper_size(&(((job->opt)->ima).ps))) {
back = 0;
@@ -2632,12 +2613,12 @@ dk3bm_job_produce_doc_real_ps(dk3_bm_conversion_job_t *job)
switch((job->opt)->szmode) {
case DK3_BMEPS_SIZE_SPECIFIED: {
-#line 2561 "dk3bm.ctr"
+#line 2564 "dk3bm.ctr"
xres = yres = (job->opt)->resolution;
} break;
default: {
-#line 2564 "dk3bm.ctr"
+#line 2567 "dk3bm.ctr"
xres = dk3bif_get_xres(job->bif);
yres = dk3bif_get_yres(job->bif);
} break;
@@ -2734,12 +2715,12 @@ dk3bm_job_produce_doc_real_ps(dk3_bm_conversion_job_t *job)
switch((job->opt)->szmode) {
case DK3_BMEPS_SIZE_SPECIFIED: {
-#line 2659 "dk3bm.ctr"
+#line 2662 "dk3bm.ctr"
xres = yres = (job->opt)->resolution;
} break;
default: {
-#line 2662 "dk3bm.ctr"
+#line 2665 "dk3bm.ctr"
xres = dk3bif_get_xres(job->bif);
yres = dk3bif_get_yres(job->bif);
} break;
@@ -2865,19 +2846,19 @@ dk3bm_job_produce_doc_real_ps(dk3_bm_conversion_job_t *job)
}
-#line 2786 "dk3bm.ctr"
+#line 2789 "dk3bm.ctr"
-#line 2787 "dk3bm.ctr"
+#line 2790 "dk3bm.ctr"
-#line 2788 "dk3bm.ctr"
+#line 2791 "dk3bm.ctr"
-#line 2789 "dk3bm.ctr"
+#line 2792 "dk3bm.ctr"
-#line 2790 "dk3bm.ctr"
+#line 2793 "dk3bm.ctr"
} break;
}
/*
@@ -2901,7 +2882,7 @@ dk3bm_job_produce_doc_real_ps(dk3_bm_conversion_job_t *job)
#endif
-#line 2812 "dk3bm.ctr"
+#line 2815 "dk3bm.ctr"
return back;
}
@@ -2923,7 +2904,7 @@ dk3bm_job_produce_doc_ps(dk3_bm_conversion_job_t *job)
/* PROGRESS: Reading image. */
-#line 2832 "dk3bm.ctr"
+#line 2835 "dk3bm.ctr"
dk3app_log_1((job->opt)->app, DK3_LL_PROGRESS, job->msg, 47);
#if DK3_USE_WX
min = job->minpb;
@@ -2931,11 +2912,11 @@ dk3bm_job_produce_doc_ps(dk3_bm_conversion_job_t *job)
#endif
if(dk3bif_read_data(job->bif)) {
-#line 2838 "dk3bm.ctr"
+#line 2841 "dk3bm.ctr"
#if DK3_USE_WX
-#line 2840 "dk3bm.ctr"
+#line 2843 "dk3bm.ctr"
dk3bmj_progress(job->pComm, job->minpb + (job->maxpb - job->minpb)/3);
job->minpb = job->minpb + ((job->maxpb - job->minpb)/3);
#endif
@@ -2962,7 +2943,7 @@ dk3bm_job_produce_doc_ps(dk3_bm_conversion_job_t *job)
}
} else {
-#line 2865 "dk3bm.ctr"
+#line 2868 "dk3bm.ctr"
/* ERROR: Failed to read image data! */
dk3bmj_log_1(
(job->opt)->app, DK3_LL_ERROR, job->msg, 61, DK3_BMJ_LOG_BOTH, job
@@ -2974,7 +2955,7 @@ dk3bm_job_produce_doc_ps(dk3_bm_conversion_job_t *job)
#endif
-#line 2875 "dk3bm.ctr"
+#line 2878 "dk3bm.ctr"
return back;
}
@@ -2997,7 +2978,7 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
int ec = 0; /* Math error code. */
-#line 2896 "dk3bm.ctr"
+#line 2899 "dk3bm.ctr"
/*
Prepare for size 1:1.
*/
@@ -3007,28 +2988,28 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
job->y_1 = dk3bm_l_to_d(job->y_size);
-#line 2904 "dk3bm.ctr"
+#line 2907 "dk3bm.ctr"
/*
Attempt to use other size/resolution if required.
*/
switch((job->opt)->szmode) {
case DK3_BMEPS_SIZE_CHUNK: {
-#line 2909 "dk3bm.ctr"
+#line 2912 "dk3bm.ctr"
xr = dk3bif_get_xres(job->bif);
yr = dk3bif_get_yres(job->bif);
-#line 2911 "dk3bm.ctr"
+#line 2914 "dk3bm.ctr"
if((xr > 0.0) && (yr > 0.0)) {
-#line 2913 "dk3bm.ctr"
+#line 2916 "dk3bm.ctr"
if(fabs(xr - 72.0) > dk3bm_epsilon) {
ur = 1;
}
-#line 2917 "dk3bm.ctr"
+#line 2920 "dk3bm.ctr"
if(fabs(yr - 72.0) > dk3bm_epsilon) {
ur = 1;
}
@@ -3036,15 +3017,15 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
} break;
case DK3_BMEPS_SIZE_SPECIFIED: {
-#line 2923 "dk3bm.ctr"
+#line 2926 "dk3bm.ctr"
if((job->opt)->resolution > 0.0) {
-#line 2925 "dk3bm.ctr"
+#line 2928 "dk3bm.ctr"
if(fabs((job->opt)->resolution - 72.0) > dk3bm_epsilon) {
xr = yr = (job->opt)->resolution;
-#line 2927 "dk3bm.ctr"
+#line 2930 "dk3bm.ctr"
ur = 1;
}
}
@@ -3055,24 +3036,24 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
*/
if(ur) {
-#line 2936 "dk3bm.ctr"
+#line 2939 "dk3bm.ctr"
w = dk3bm_l_to_d(job->x_size);
-#line 2937 "dk3bm.ctr"
+#line 2940 "dk3bm.ctr"
h = dk3bm_l_to_d(job->y_size);
-#line 2938 "dk3bm.ctr"
+#line 2941 "dk3bm.ctr"
w = dk3ma_d_mul_ok(72.0, dk3ma_d_div_ok(w, xr, &ec), &ec);
h = dk3ma_d_mul_ok(72.0, dk3ma_d_div_ok(h, yr, &ec), &ec);
job->x_1 = ceil(w);
-#line 2941 "dk3bm.ctr"
+#line 2944 "dk3bm.ctr"
job->y_1 = ceil(h);
job->x_size = dk3ma_d_to_l_ok(job->x_1, &ec);
job->y_size = dk3ma_d_to_l_ok(job->y_1, &ec);
-#line 2945 "dk3bm.ctr"
+#line 2948 "dk3bm.ctr"
job->x_translate = 0.5 * (job->x_1 - w);
job->y_translate = 0.5 * (job->y_1 - h);
if(job->x_translate < 0.0) { job->x_translate = 0.0; }
@@ -3093,15 +3074,6 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
job->do_float_scale = 1;
-#line 2964 "dk3bm.ctr"
-
-
-#line 2965 "dk3bm.ctr"
-
-
-#line 2966 "dk3bm.ctr"
-
-
#line 2967 "dk3bm.ctr"
@@ -3121,9 +3093,18 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
#line 2973 "dk3bm.ctr"
- if(ec) {
+
#line 2974 "dk3bm.ctr"
+
+
+#line 2975 "dk3bm.ctr"
+
+
+#line 2976 "dk3bm.ctr"
+ if(ec) {
+
+#line 2977 "dk3bm.ctr"
back = 0;
dk3bmj_log_i1(
(job->opt)->app, DK3_LL_ERROR, 260, DK3_BMJ_LOG_BOTH, job
@@ -3136,14 +3117,14 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
if(back) {
if((job->opt)->draft) {
-#line 2985 "dk3bm.ctr"
+#line 2988 "dk3bm.ctr"
if(job->dfile) {
-#line 2986 "dk3bm.ctr"
+#line 2989 "dk3bm.ctr"
back = dk3bm_job_produce_img_job_draft_ps(job);
} else {
-#line 2988 "dk3bm.ctr"
+#line 2991 "dk3bm.ctr"
job->dfile = dk3sf_fopen_app(
job->dfn,
dk3app_not_localized(24),
@@ -3151,7 +3132,7 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
);
if(job->dfile) {
-#line 2994 "dk3bm.ctr"
+#line 2997 "dk3bm.ctr"
back = dk3bm_job_produce_img_job_draft_ps(job);
if(!dk3sf_fclose_fn_app(job->dfile, job->dfn, (job->opt)->app)) {
back = 0;
@@ -3159,7 +3140,7 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
job->dfile = NULL;
} else {
-#line 3000 "dk3bm.ctr"
+#line 3003 "dk3bm.ctr"
back = 0;
/* ERROR: Failed to open output file! */
dk3bmj_log_i3(
@@ -3170,26 +3151,26 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
}
} else {
-#line 3009 "dk3bm.ctr"
+#line 3012 "dk3bm.ctr"
/* PROGRESS: Reading image. */
dk3app_log_1((job->opt)->app, DK3_LL_PROGRESS, job->msg, 47);
if(dk3bif_read_data(job->bif)) {
-#line 3012 "dk3bm.ctr"
+#line 3015 "dk3bm.ctr"
#if DK3_USE_WX
-#line 3014 "dk3bm.ctr"
+#line 3017 "dk3bm.ctr"
dk3bmj_progress(job->pComm, job->minpb + (job->maxpb - job->minpb)/3);
job->minpb = job->minpb + ((job->maxpb - job->minpb)/3);
#endif
if(job->dfile) {
-#line 3018 "dk3bm.ctr"
+#line 3021 "dk3bm.ctr"
back = dk3bm_job_produce_img_job_real_ps(job);
} else {
-#line 3020 "dk3bm.ctr"
+#line 3023 "dk3bm.ctr"
job->dfile = dk3sf_fopen_app(
job->dfn,
dk3app_not_localized(24),
@@ -3197,7 +3178,7 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
);
if(job->dfile) {
-#line 3026 "dk3bm.ctr"
+#line 3029 "dk3bm.ctr"
back = dk3bm_job_produce_img_job_real_ps(job);
if(!dk3sf_fclose_fn_app(job->dfile, job->dfn, (job->opt)->app)) {
back = 0;
@@ -3205,7 +3186,7 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
job->dfile = NULL;
} else {
-#line 3032 "dk3bm.ctr"
+#line 3035 "dk3bm.ctr"
back = 0;
/* ERROR: Failed to open output file! */
dk3bmj_log_i3(
@@ -3216,7 +3197,7 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
}
} else {
-#line 3041 "dk3bm.ctr"
+#line 3044 "dk3bm.ctr"
back = 0;
/* ERROR: Failed to read image data! */
dk3bmj_log_1(
@@ -3226,7 +3207,7 @@ dk3bm_job_produce_img_obj_ps(dk3_bm_conversion_job_t *job)
}
}
-#line 3049 "dk3bm.ctr"
+#line 3052 "dk3bm.ctr"
return back;
}
@@ -3243,21 +3224,21 @@ dk3bm_job_produce_ps(dk3_bm_conversion_job_t *job)
int back = 0;
-#line 3064 "dk3bm.ctr"
+#line 3067 "dk3bm.ctr"
switch((job->opt)->mode) {
case DK3_BMEPS_MODE_DOCUMENT: {
-#line 3066 "dk3bm.ctr"
+#line 3069 "dk3bm.ctr"
back = dk3bm_job_produce_doc_ps(job);
} break;
default: {
-#line 3069 "dk3bm.ctr"
+#line 3072 "dk3bm.ctr"
back = dk3bm_job_produce_img_obj_ps(job);
} break;
}
-#line 3072 "dk3bm.ctr"
+#line 3075 "dk3bm.ctr"
return back;
}
@@ -3295,7 +3276,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
int me = 0; /* Flag: Math error. */
-#line 3108 "dk3bm.ctr"
+#line 3111 "dk3bm.ctr"
/*
Re-initialize (we probably have to handle multiple frames in one job.
*/
@@ -3324,7 +3305,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
switch((job->opt)->szmode) {
case DK3_BMEPS_SIZE_CHUNK: {
-#line 3135 "dk3bm.ctr"
+#line 3138 "dk3bm.ctr"
xres = dk3bif_get_xres(job->bif);
yres = dk3bif_get_yres(job->bif);
if(xres > 0.0) {
@@ -3339,7 +3320,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
} break;
case DK3_BMEPS_SIZE_SPECIFIED: {
-#line 3148 "dk3bm.ctr"
+#line 3151 "dk3bm.ctr"
xres = yres = (job->opt)->resolution;
if(xres > 0.0) {
if(fabs(xres - 72.0) > dk3bm_epsilon) {
@@ -3349,7 +3330,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
} break;
case DK3_BMEPS_SIZE_PAPER: {
-#line 3156 "dk3bm.ctr"
+#line 3159 "dk3bm.ctr"
workmode = 2;
xres = dk3bif_get_xres(job->bif);
yres = dk3bif_get_yres(job->bif);
@@ -3364,7 +3345,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
} break;
default: {
-#line 3169 "dk3bm.ctr"
+#line 3172 "dk3bm.ctr"
workmode = 0;
} break;
}
@@ -3381,16 +3362,16 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
&me
);
-#line 3184 "dk3bm.ctr"
+#line 3187 "dk3bm.ctr"
if(dk3bm_check_paper_size(&(((job->opt)->ima).ps))) {
width = floor(((job->opt)->ima).ps.w);
height = floor(((job->opt)->ima).ps.h);
-#line 3188 "dk3bm.ctr"
+#line 3191 "dk3bm.ctr"
-#line 3189 "dk3bm.ctr"
+#line 3192 "dk3bm.ctr"
mbx1 = dk3ma_d_to_l_ok(width, &me);
mby1 = dk3ma_d_to_l_ok(height, &me);
if((job->opt)->duplex) {
@@ -3428,24 +3409,24 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
if((px1 > px0) && (py1 > py0)) {
if((py1 - py0) > (px1 - px0)) {
-#line 3225 "dk3bm.ctr"
+#line 3228 "dk3bm.ctr"
if(dw > dh) {
-#line 3226 "dk3bm.ctr"
+#line 3229 "dk3bm.ctr"
job->do_rotate = 1;
} else {
-#line 3228 "dk3bm.ctr"
+#line 3231 "dk3bm.ctr"
}
} else {
-#line 3230 "dk3bm.ctr"
+#line 3233 "dk3bm.ctr"
if((py1 - py0) < (px1 - px0)) {
-#line 3231 "dk3bm.ctr"
+#line 3234 "dk3bm.ctr"
if(dh > dw) {
-#line 3232 "dk3bm.ctr"
+#line 3235 "dk3bm.ctr"
job->do_rotate = 1;
} else {
}
@@ -3453,24 +3434,24 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
}
-#line 3238 "dk3bm.ctr"
+#line 3241 "dk3bm.ctr"
-#line 3239 "dk3bm.ctr"
+#line 3242 "dk3bm.ctr"
-#line 3240 "dk3bm.ctr"
+#line 3243 "dk3bm.ctr"
-#line 3241 "dk3bm.ctr"
+#line 3244 "dk3bm.ctr"
if(job->do_rotate) {
-#line 3242 "dk3bm.ctr"
+#line 3245 "dk3bm.ctr"
sx = dk3ma_d_div_ok((py1 - py0), dw, &me);
sy = dk3ma_d_div_ok((px1 - px0), dh, &me);
if(sx > sy) {
-#line 3245 "dk3bm.ctr"
+#line 3248 "dk3bm.ctr"
job->y_scale = (px1 - px0);
job->x_scale = sy * dw;
job->x_translate = px1;
@@ -3478,7 +3459,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
if(job->y_translate < py0) { job->y_translate = py0; }
} else {
-#line 3251 "dk3bm.ctr"
+#line 3254 "dk3bm.ctr"
job->x_scale = (py1 - py0);
job->y_scale = sx * dh;
job->x_translate = px1 - 0.5 * (px1 - px0 - job->y_scale);
@@ -3487,12 +3468,12 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
}
} else {
-#line 3258 "dk3bm.ctr"
+#line 3261 "dk3bm.ctr"
sx = dk3ma_d_div_ok((px1 - px0), dw, &me);
sy = dk3ma_d_div_ok((py1 - py0), dh, &me);
if(sx > sy) {
-#line 3261 "dk3bm.ctr"
+#line 3264 "dk3bm.ctr"
job->y_scale = py1 - py0;
job->x_scale = sy * dw;
job->x_translate = px0 + 0.5 * (px1 - px0 - job->x_scale);
@@ -3500,7 +3481,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
job->y_translate = py0;
} else {
-#line 3267 "dk3bm.ctr"
+#line 3270 "dk3bm.ctr"
job->x_scale = px1 - px0;
job->y_scale = sx * dh;
job->y_translate = py0 + 0.5 * (py1 - py0 - job->y_scale);
@@ -3512,7 +3493,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
job->do_float_scale = 1;
} else {
-#line 3277 "dk3bm.ctr"
+#line 3280 "dk3bm.ctr"
back = 0;
/* ERROR Page setup incorrect */
dk3bmj_log_i1(
@@ -3525,19 +3506,19 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
}
-#line 3288 "dk3bm.ctr"
+#line 3291 "dk3bm.ctr"
-#line 3289 "dk3bm.ctr"
+#line 3292 "dk3bm.ctr"
-#line 3290 "dk3bm.ctr"
+#line 3293 "dk3bm.ctr"
-#line 3291 "dk3bm.ctr"
+#line 3294 "dk3bm.ctr"
-#line 3292 "dk3bm.ctr"
+#line 3295 "dk3bm.ctr"
} break;
case 1: {
dw = dk3ma_d_mul_ok(
@@ -3565,7 +3546,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
} break;
default: {
-#line 3318 "dk3bm.ctr"
+#line 3321 "dk3bm.ctr"
mbx0 = 0L; mby0 = 0L; mbx1 = w; mby1 = h;
job->x_size = w; job->y_size = h;
} break;
@@ -3573,15 +3554,15 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
dk3pdf_set_next_mediabox(job->pdf, mbx0, mbx1, mby0, mby1);
if(me) {
-#line 3324 "dk3bm.ctr"
+#line 3327 "dk3bm.ctr"
back = 0;
}
if(back == 1) {
-#line 3327 "dk3bm.ctr"
+#line 3330 "dk3bm.ctr"
if(dk3pdf_open_page(job->pdf)) {
-#line 3328 "dk3bm.ctr"
+#line 3331 "dk3bm.ctr"
if(job->do_translate) {
dk3pdf_translate_double(job->pdf, job->x_translate, job->y_translate);
}
@@ -3600,11 +3581,11 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
{
back = 1;
-#line 3345 "dk3bm.ctr"
+#line 3348 "dk3bm.ctr"
} else {
back = 0;
-#line 3347 "dk3bm.ctr"
+#line 3350 "dk3bm.ctr"
dk3bmj_log_1(
(job->opt)->app, DK3_LL_ERROR, job->msg, 73,
DK3_BMJ_LOG_BOTH, job
@@ -3613,7 +3594,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
dk3pdf_close_page(job->pdf);
} else {
-#line 3354 "dk3bm.ctr"
+#line 3357 "dk3bm.ctr"
dk3bmj_log_1(
(job->opt)->app, DK3_LL_ERROR, job->msg, 71,
DK3_BMJ_LOG_JOB, job
@@ -3628,7 +3609,7 @@ dk3bm_job_add_pdf_frame(dk3_bm_conversion_job_t *job, size_t pageno)
);
}
-#line 3367 "dk3bm.ctr"
+#line 3370 "dk3bm.ctr"
return back;
}
@@ -3652,7 +3633,7 @@ dk3bm_job_produce_file_pdf(dk3_bm_conversion_job_t *job)
#endif
-#line 3389 "dk3bm.ctr"
+#line 3392 "dk3bm.ctr"
#if DK3_USE_WX
min = job->minpb;
max = job->maxpb;
@@ -3663,11 +3644,11 @@ dk3bm_job_produce_file_pdf(dk3_bm_conversion_job_t *job)
back = 1;
-#line 3398 "dk3bm.ctr"
+#line 3401 "dk3bm.ctr"
switch((job->opt)->mode) {
case DK3_BMEPS_MODE_DOCUMENT: {
-#line 3400 "dk3bm.ctr"
+#line 3403 "dk3bm.ctr"
nFrames = dk3bif_number_of_frames(job->bif);
for(i = 0; i < nFrames; i++) {
#if DK3_USE_WX
@@ -3688,14 +3669,14 @@ dk3bm_job_produce_file_pdf(dk3_bm_conversion_job_t *job)
#if DK3_USE_WX
-#line 3419 "dk3bm.ctr"
+#line 3422 "dk3bm.ctr"
dk3bmj_progress(job->pComm, job->maxpb);
#endif
}
} break;
default: {
-#line 3424 "dk3bm.ctr"
+#line 3427 "dk3bm.ctr"
if(!dk3bm_job_add_pdf_frame(job, 0)) {
back = 0;
}
@@ -3704,7 +3685,7 @@ dk3bm_job_produce_file_pdf(dk3_bm_conversion_job_t *job)
#if DK3_USE_WX
-#line 3431 "dk3bm.ctr"
+#line 3434 "dk3bm.ctr"
dk3bmj_progress(job->pComm, job->maxpb);
job->minpb = job->maxpb;
job->maxpb = max;
@@ -3733,7 +3714,7 @@ dk3bm_job_produce_file_pdf(dk3_bm_conversion_job_t *job)
#endif
-#line 3458 "dk3bm.ctr"
+#line 3461 "dk3bm.ctr"
return back;
}
@@ -3768,7 +3749,7 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
int back = 1;
-#line 3491 "dk3bm.ctr"
+#line 3494 "dk3bm.ctr"
mbx0 = mby0 = 0L;
mbx1 = dk3bif_get_width(job->bif);
mby1 = dk3bif_get_height(job->bif);
@@ -3779,7 +3760,7 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
switch((job->opt)->szmode) {
case DK3_BMEPS_SIZE_CHUNK: {
-#line 3500 "dk3bm.ctr"
+#line 3503 "dk3bm.ctr"
xres = dk3bif_get_xres(job->bif);
yres = dk3bif_get_yres(job->bif);
if((xres > 0.0) || (yres > 0.0)) {
@@ -3795,7 +3776,7 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
} break;
case DK3_BMEPS_SIZE_SPECIFIED: {
-#line 3514 "dk3bm.ctr"
+#line 3517 "dk3bm.ctr"
xres = yres = (job->opt)->resolution;
if(xres > 0.0) {
if(fabs(xres - 72.0) > dk3bm_epsilon) {
@@ -3805,7 +3786,7 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
} break;
case DK3_BMEPS_SIZE_PAPER: {
-#line 3522 "dk3bm.ctr"
+#line 3525 "dk3bm.ctr"
workmode = 2;
xres = dk3bif_get_xres(job->bif);
yres = dk3bif_get_yres(job->bif);
@@ -3819,43 +3800,43 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
case 2: { /* Fit to page */
w = dk3ma_d_div_ok(dk3bm_l_to_d(mbx1), xres, &me);
-#line 3534 "dk3bm.ctr"
+#line 3537 "dk3bm.ctr"
h = dk3ma_d_div_ok(dk3bm_l_to_d(mby1), yres, &me);
-#line 3535 "dk3bm.ctr"
+#line 3538 "dk3bm.ctr"
mbx1 = dk3ma_d_to_l_ok(floor(((job->opt)->ima).ps.w), &me);
mby1 = dk3ma_d_to_l_ok(floor(((job->opt)->ima).ps.h), &me);
-#line 3538 "dk3bm.ctr"
+#line 3541 "dk3bm.ctr"
x0 = ((job->opt)->ima).ps.i;
y0 = ((job->opt)->ima).ps.b;
x1 = dk3ma_d_sub_ok(((job->opt)->ima).ps.w, ((job->opt)->ima).ps.o, &me);
y1 = dk3ma_d_sub_ok(((job->opt)->ima).ps.h, ((job->opt)->ima).ps.t, &me);
-#line 3543 "dk3bm.ctr"
+#line 3546 "dk3bm.ctr"
if((x1 > x0) && (y1 > y0)) {
-#line 3544 "dk3bm.ctr"
+#line 3547 "dk3bm.ctr"
if((x1 - x0) > (y1 - y0)) {
if(h > w) {
-#line 3546 "dk3bm.ctr"
+#line 3549 "dk3bm.ctr"
do_rotate = 1;
}
} else {
if((x1 - x0) < (y1 - y0)) {
if(h < w) {
-#line 3551 "dk3bm.ctr"
+#line 3554 "dk3bm.ctr"
do_rotate = 1;
}
}
}
if(do_rotate) {
-#line 3556 "dk3bm.ctr"
+#line 3559 "dk3bm.ctr"
dx = dk3ma_d_div_ok((x1 - x0), h, &me);
dy = dk3ma_d_div_ok((y1 - y0), w, &me);
if(dx > dy) {
@@ -3881,12 +3862,12 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
}
} else {
-#line 3580 "dk3bm.ctr"
+#line 3583 "dk3bm.ctr"
dx = dk3ma_d_div_ok((x1 - x0), w, &me);
dy = dk3ma_d_div_ok((y1 - y0), h, &me);
if(dx > dy) {
-#line 3583 "dk3bm.ctr"
+#line 3586 "dk3bm.ctr"
w = dk3ma_d_mul_ok(dy, w, &me);
dx = dk3ma_d_add_ok(
x0,
@@ -3898,7 +3879,7 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
if(dy <= x1) { x1 = dy; }
} else {
-#line 3593 "dk3bm.ctr"
+#line 3596 "dk3bm.ctr"
h = dk3ma_d_mul_ok(dx, h, &me);
dx = dk3ma_d_add_ok(
y0,
@@ -3911,7 +3892,7 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
}
}
-#line 3604 "dk3bm.ctr"
+#line 3607 "dk3bm.ctr"
} else {
back = 0;
/* ERROR: Incorrect page setup. */
@@ -4014,7 +3995,7 @@ dk3bm_job_draft_pdf(dk3_bm_conversion_job_t *job)
}
-#line 3705 "dk3bm.ctr"
+#line 3708 "dk3bm.ctr"
return back;
}
@@ -4035,7 +4016,7 @@ dk3bm_job_produce_pdf(dk3_bm_conversion_job_t *job)
#endif
-#line 3724 "dk3bm.ctr"
+#line 3727 "dk3bm.ctr"
#if DK3_USE_WX
min = job->minpb;
max = job->maxpb;
@@ -4070,7 +4051,7 @@ dk3bm_job_produce_pdf(dk3_bm_conversion_job_t *job)
if((job->pComm) && (job->maxpb > job->minpb)) {
-#line 3757 "dk3bm.ctr"
+#line 3760 "dk3bm.ctr"
dk3bmj_progress(job->pComm, job->minpb);
}
#endif
@@ -4109,7 +4090,7 @@ dk3bm_job_produce_pdf(dk3_bm_conversion_job_t *job)
#endif
-#line 3794 "dk3bm.ctr"
+#line 3797 "dk3bm.ctr"
return back;
}
@@ -4126,13 +4107,13 @@ dk3bm_produce_bb(dk3_bm_conversion_job_t *job)
dk3_bif_coord_t h; /* Image height. */
-#line 3809 "dk3bm.ctr"
+#line 3812 "dk3bm.ctr"
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
fprintf(job->dfile, dk3bm_c8_kw[31], w, h);
-#line 3813 "dk3bm.ctr"
+#line 3816 "dk3bm.ctr"
}
@@ -4185,7 +4166,7 @@ dk3bm_job_from_program_with_output(dk3_bm_conversion_job_t *job)
int back = 0;
-#line 3864 "dk3bm.ctr"
+#line 3867 "dk3bm.ctr"
job->bif = dk3bif_open_filename_app(job->sfn, job->biftype, (job->opt)->app);
if(job->bif) {
switch((job->opt)->dr) {
@@ -4210,7 +4191,7 @@ dk3bm_job_from_program_with_output(dk3_bm_conversion_job_t *job)
}
-#line 3887 "dk3bm.ctr"
+#line 3890 "dk3bm.ctr"
return back;
}
@@ -4231,7 +4212,7 @@ dk3bm_job_from_program_construct_name(dk3_bm_conversion_job_t *job)
int back = 0;
-#line 3906 "dk3bm.ctr"
+#line 3909 "dk3bm.ctr"
dk3str_cpy_not_overlapped(fno, job->sfn);
sptr = dk3str_get_suffix(fno);
if(sptr) { *sptr = dkT('\0'); }
@@ -4250,7 +4231,7 @@ dk3bm_job_from_program_construct_name(dk3_bm_conversion_job_t *job)
if((dk3str_len(ns) + dk3str_len(fno)) < DK3_SIZEOF(fno,dkChar)) {
dk3str_cat(fno, ns);
-#line 3923 "dk3bm.ctr"
+#line 3926 "dk3bm.ctr"
job->dfn = fno;
back = dk3bm_job_from_program_with_output(job);
} else {
@@ -4260,7 +4241,7 @@ dk3bm_job_from_program_construct_name(dk3_bm_conversion_job_t *job)
);
}
-#line 3931 "dk3bm.ctr"
+#line 3934 "dk3bm.ctr"
return back;
}
@@ -4271,9 +4252,15 @@ dk3bm_process_file_name(
dk3_bm_eps_options_t *opt,
dkChar const *sfn,
int biftype,
+#if DK3_USE_WX
int min,
int max,
void *comm
+#else
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ void * DK3_ARG_UNUSED(comm)
+#endif
)
{
dk3_bm_eps_options_t bmeo; /* Conversion options. */
@@ -4284,18 +4271,23 @@ dk3bm_process_file_name(
int back = 0;
-#line 3953 "dk3bm.ctr"
+#line 3962 "dk3bm.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(comm)
+#endif
if((opt) && (sfn)) {
-#line 3954 "dk3bm.ctr"
+#line 3968 "dk3bm.ctr"
if(opt->app) {
-#line 3955 "dk3bm.ctr"
+#line 3969 "dk3bm.ctr"
dk3bmj_init(&job, opt->app);
dk3mem_cpy((void *)(&bmeo), (void *)opt, sizeof(dk3_bm_eps_options_t));
job.opt = &bmeo;
-#line 3958 "dk3bm.ctr"
+#line 3972 "dk3bm.ctr"
job.sfn = sfn;
job.biftype = biftype;
#if DK3_USE_WX
@@ -4303,17 +4295,17 @@ dk3bm_process_file_name(
job.minpb = min;
job.maxpb = max;
#endif
- if(dk3bmeo_check(&bmeo, 0, opt->app, &job)) {
+ if(dk3bmeo_check(&bmeo, 0, &job)) {
-#line 3966 "dk3bm.ctr"
+#line 3980 "dk3bm.ctr"
if(opt->to_stdout) {
-#line 3967 "dk3bm.ctr"
+#line 3981 "dk3bm.ctr"
job.dfile = stdout;
switch(opt->dr) {
case DK3_BMEPS_DRIVER_PDF: {
-#line 3970 "dk3bm.ctr"
+#line 3984 "dk3bm.ctr"
#if DK3_ON_WINDOWS
oldmode = _setmode(_fileno(stdout), _O_BINARY);
#endif
@@ -4324,19 +4316,19 @@ dk3bm_process_file_name(
} break;
default: {
-#line 3979 "dk3bm.ctr"
+#line 3993 "dk3bm.ctr"
back = dk3bm_job_from_program_with_output(&job);
} break;
}
} else {
-#line 3983 "dk3bm.ctr"
+#line 3997 "dk3bm.ctr"
job.dfile = NULL;
back = dk3bm_job_from_program_construct_name(&job);
}
} else {
-#line 3987 "dk3bm.ctr"
+#line 4001 "dk3bm.ctr"
/* ERROR: Inconsistent options, reported by dk3bmeo_check(). */
dk3bmj_log_1(
opt->app, DK3_LL_ERROR, job.msg, 68, DK3_BMJ_LOG_JOB, &job
@@ -4344,7 +4336,7 @@ dk3bm_process_file_name(
}
} else {
-#line 3993 "dk3bm.ctr"
+#line 4007 "dk3bm.ctr"
/* ERROR: Application structure not set! */
}
}
@@ -4352,13 +4344,13 @@ dk3bm_process_file_name(
if((comm) && (max > min)) {
-#line 3999 "dk3bm.ctr"
+#line 4013 "dk3bm.ctr"
dk3bmj_progress(comm, max);
}
#endif
-#line 4003 "dk3bm.ctr"
+#line 4017 "dk3bm.ctr"
return back;
}
diff --git a/support/dktools/dk3bm.ctr b/support/dktools/dk3bm.ctr
index 93baeb6e7c..f40afc4c2a 100644
--- a/support/dktools/dk3bm.ctr
+++ b/support/dktools/dk3bm.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -119,6 +119,9 @@ dk3bm_find_bif_transformation(
#include <wxbmeps.h>
#endif
+#include "dk3unused.h"
+
+
$!trace-include
@@ -531,7 +534,7 @@ dk3bm_job_produce_img_job_real_ps(dk3_bm_conversion_job_t *job)
int use_dct = 0; /* Flag: DCT used. */
int me = 0; /* Flag: Math error. */
int alphain = 0; /* Flag: Alpha channel. */
-#if TRACE_DEBUG || VERSION_BEFORE_20150821
+#if VERSION_BEFORE_20150821
int colorin = 0; /* Flag: Color image. */
#endif
#if DK3_USE_WX
@@ -3938,9 +3941,15 @@ dk3bm_process_file_name(
dk3_bm_eps_options_t *opt,
dkChar const *sfn,
int biftype,
+#if DK3_USE_WX
int min,
int max,
void *comm
+#else
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ void * DK3_ARG_UNUSED(comm)
+#endif
)
{
dk3_bm_eps_options_t bmeo; /* Conversion options. */
@@ -3950,6 +3959,11 @@ dk3bm_process_file_name(
#endif
int back = 0;
$? "+ dk3bm_process_file_name \"%!ds\" dr = %d", TR_STR(sfn), opt->dr
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(comm)
+#endif
if((opt) && (sfn)) { $? ". dr = %d", opt->dr
if(opt->app) { $? ". app"
dk3bmj_init(&job, opt->app);
@@ -3962,7 +3976,7 @@ dk3bm_process_file_name(
job.minpb = min;
job.maxpb = max;
#endif
- if(dk3bmeo_check(&bmeo, 0, opt->app, &job)) { $? ". check"
+ if(dk3bmeo_check(&bmeo, 0, &job)) { $? ". check"
if(opt->to_stdout) { $? ". write output to stdout"
job.dfile = stdout;
switch(opt->dr) {
diff --git a/support/dktools/dk3bm.h b/support/dktools/dk3bm.h
index e7d5fe65b6..aa38f676ec 100644
--- a/support/dktools/dk3bm.h
+++ b/support/dktools/dk3bm.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bm.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bm.ctr
*/
/** @file dk3bm.h Header file for the dk3bm module.
diff --git a/support/dktools/dk3bmeo.c b/support/dktools/dk3bmeo.c
index f2981f8e3c..bbd3edfc39 100644
--- a/support/dktools/dk3bmeo.c
+++ b/support/dktools/dk3bmeo.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bmeo.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bmeo.ctr
*/
/** @file dk3bmeo.c The dk3bmeo module.
*/
-#line 321 "dk3bmeo.ctr"
+#line 319 "dk3bmeo.ctr"
#include "dk3all.h"
@@ -49,7 +27,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 331 "dk3bmeo.ctr"
+#line 329 "dk3bmeo.ctr"
@@ -77,7 +55,7 @@ dkT("%ld"),
NULL
-#line 363 "dk3bmeo.ctr"
+#line 361 "dk3bmeo.ctr"
};
@@ -136,7 +114,7 @@ dkT("bpc"),
NULL
-#line 436 "dk3bmeo.ctr"
+#line 434 "dk3bmeo.ctr"
};
@@ -159,7 +137,7 @@ dkT("bb"),
NULL
-#line 449 "dk3bmeo.ctr"
+#line 447 "dk3bmeo.ctr"
};
@@ -179,7 +157,7 @@ dkT("d$ocument"),
NULL
-#line 470 "dk3bmeo.ctr"
+#line 468 "dk3bmeo.ctr"
};
@@ -207,7 +185,7 @@ dkT("paeth"),
NULL
-#line 486 "dk3bmeo.ctr"
+#line 484 "dk3bmeo.ctr"
};
@@ -218,7 +196,7 @@ dk3bmeo_init(dk3_bm_eps_options_t *opt)
{
-#line 495 "dk3bmeo.ctr"
+#line 493 "dk3bmeo.ctr"
if(opt) {
(opt->ima).ps.w = 595.0;
(opt->ima).ps.h = 842.0;
@@ -231,7 +209,7 @@ dk3bmeo_init(dk3_bm_eps_options_t *opt)
opt->mode = DK3_BMEPS_MODE_OBJECT;
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 506 "dk3bmeo.ctr"
+#line 504 "dk3bmeo.ctr"
opt->dr = DK3_BMEPS_DRIVER_PDF;
opt->pred = 0;
opt->io = 0;
@@ -250,7 +228,7 @@ dk3bmeo_init(dk3_bm_eps_options_t *opt)
opt->rbpc = 1;
}
-#line 523 "dk3bmeo.ctr"
+#line 521 "dk3bmeo.ctr"
}
@@ -261,14 +239,14 @@ dk3bmeo_new_app(dk3_app_t *app)
dk3_bm_eps_options_t *back = NULL;
-#line 532 "dk3bmeo.ctr"
+#line 530 "dk3bmeo.ctr"
back = dk3_new_app(dk3_bm_eps_options_t,1,app);
if(back) {
dk3bmeo_init(back);
back->app = app;
}
-#line 537 "dk3bmeo.ctr"
+#line 535 "dk3bmeo.ctr"
return back;
}
@@ -279,13 +257,13 @@ dk3bmeo_delete(dk3_bm_eps_options_t *opt)
{
-#line 546 "dk3bmeo.ctr"
+#line 544 "dk3bmeo.ctr"
if(opt) {
opt->app = NULL;
dk3_delete(opt);
}
-#line 550 "dk3bmeo.ctr"
+#line 548 "dk3bmeo.ctr"
}
@@ -296,12 +274,12 @@ dk3bmeo_get_mode(dk3_bm_eps_options_t *opt)
int back = DK3_BMEPS_MODE_IMAGE;
-#line 559 "dk3bmeo.ctr"
+#line 557 "dk3bmeo.ctr"
if(opt) {
back = opt->mode;
}
-#line 562 "dk3bmeo.ctr"
+#line 560 "dk3bmeo.ctr"
return back;
}
@@ -325,7 +303,7 @@ dk3bmeo_set_paper_size_complain(
int back = 0;
-#line 584 "dk3bmeo.ctr"
+#line 582 "dk3bmeo.ctr"
msg = dk3app_messages(
opt->app,
dk3bmep_str_get_string_table_name(),
@@ -336,18 +314,18 @@ dk3bmeo_set_paper_size_complain(
}
if((opt) && (psn)) {
-#line 593 "dk3bmeo.ctr"
+#line 591 "dk3bmeo.ctr"
if(opt->app) {
-#line 594 "dk3bmeo.ctr"
+#line 592 "dk3bmeo.ctr"
psc = dk3paper_open_app(opt->app);
if(psc) {
-#line 596 "dk3bmeo.ctr"
+#line 594 "dk3bmeo.ctr"
pap = dk3paper_find(psc, psn);
if(pap) {
-#line 598 "dk3bmeo.ctr"
+#line 596 "dk3bmeo.ctr"
(opt->ima).ps.w = pap->w;
(opt->ima).ps.h = pap->h;
(opt->ima).ps.i = pap->i;
@@ -357,7 +335,7 @@ dk3bmeo_set_paper_size_complain(
back = 1;
} else {
-#line 606 "dk3bmeo.ctr"
+#line 604 "dk3bmeo.ctr"
/* ERROR: No such paper size. */
dk3bmj_log_3(
opt->app, DK3_LL_ERROR,msg,39,40,psn,DK3_BMJ_LOG_BOTH,NULL
@@ -366,11 +344,11 @@ dk3bmeo_set_paper_size_complain(
dk3paper_close(psc);
} else {
-#line 613 "dk3bmeo.ctr"
+#line 611 "dk3bmeo.ctr"
}
if(!(opt->mode == DK3_BMEPS_MODE_DOCUMENT)) {
-#line 615 "dk3bmeo.ctr"
+#line 613 "dk3bmeo.ctr"
/* ERROR: Not a document */
if(cond) {
dk3bmj_log_1(opt->app, DK3_LL_ERROR,msg,38,DK3_BMJ_LOG_BOTH,NULL);
@@ -378,15 +356,15 @@ dk3bmeo_set_paper_size_complain(
}
} else {
-#line 621 "dk3bmeo.ctr"
+#line 619 "dk3bmeo.ctr"
/* ERROR: No app! */
}
} else {
-#line 624 "dk3bmeo.ctr"
+#line 622 "dk3bmeo.ctr"
}
-#line 625 "dk3bmeo.ctr"
+#line 623 "dk3bmeo.ctr"
return back;
}
@@ -399,7 +377,7 @@ dk3bmeo_apply_preferences(dk3_bm_eps_options_t *opt)
int psl; /* PS level. */
-#line 636 "dk3bmeo.ctr"
+#line 634 "dk3bmeo.ctr"
if(opt->app) {
if(dk3app_get_pref(opt->app,dk3bmeo_kw[0],psn,DK3_SIZEOF(psn,dkChar)))
{
@@ -421,7 +399,7 @@ dk3bmeo_apply_preferences(dk3_bm_eps_options_t *opt)
}
-#line 656 "dk3bmeo.ctr"
+#line 654 "dk3bmeo.ctr"
}
@@ -448,16 +426,16 @@ dk3bmeo_initialize_for_driver_and_mode(dk3_bm_eps_options_t *opt)
case DK3_BMEPS_MODE_IMAGE: {
opt->szmode = DK3_BMEPS_SIZE_CHUNK;
-#line 681 "dk3bmeo.ctr"
+#line 679 "dk3bmeo.ctr"
} break;
case DK3_BMEPS_MODE_OBJECT: {
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 684 "dk3bmeo.ctr"
+#line 682 "dk3bmeo.ctr"
} break;
case DK3_BMEPS_MODE_DOCUMENT: {
-#line 686 "dk3bmeo.ctr"
+#line 684 "dk3bmeo.ctr"
opt->szmode = DK3_BMEPS_SIZE_PAPER;
if(opt->dr == DK3_BMEPS_DRIVER_PS) {
opt->dsc = 1;
@@ -477,7 +455,7 @@ dk3bmeo_initialize_for_driver_and_mode(dk3_bm_eps_options_t *opt)
(opt->ima).ps.b = 0.0;
opt->szmode = DK3_BMEPS_SIZE_PAPER;
-#line 704 "dk3bmeo.ctr"
+#line 702 "dk3bmeo.ctr"
} else {
(opt->ima).ps.i = 56.0;
(opt->ima).ps.o = 28.0;
@@ -495,14 +473,14 @@ dk3bmeo_set_driver_and_mode(dk3_bm_eps_options_t *opt, int driver, int mode)
{
-#line 720 "dk3bmeo.ctr"
+#line 718 "dk3bmeo.ctr"
if(opt) {
opt->dr = driver;
opt->mode = mode;
dk3bmeo_initialize_for_driver_and_mode(opt);
}
-#line 725 "dk3bmeo.ctr"
+#line 723 "dk3bmeo.ctr"
}
@@ -523,12 +501,12 @@ dk3bmeo_get_driver(dk3_bm_eps_options_t *opt)
int back = DK3_BMEPS_DRIVER_PS;
-#line 744 "dk3bmeo.ctr"
+#line 742 "dk3bmeo.ctr"
if(opt) {
back = opt->dr;
}
-#line 747 "dk3bmeo.ctr"
+#line 745 "dk3bmeo.ctr"
return back;
}
@@ -539,12 +517,12 @@ dk3bmeo_set_draft(dk3_bm_eps_options_t *opt, int drflag)
{
-#line 756 "dk3bmeo.ctr"
+#line 754 "dk3bmeo.ctr"
if(opt) {
opt->draft = drflag;
}
-#line 759 "dk3bmeo.ctr"
+#line 757 "dk3bmeo.ctr"
}
@@ -555,12 +533,12 @@ dk3bmeo_get_draft(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 768 "dk3bmeo.ctr"
+#line 766 "dk3bmeo.ctr"
if(opt) {
back = ((opt->draft) ? 1 : 0);
}
-#line 771 "dk3bmeo.ctr"
+#line 769 "dk3bmeo.ctr"
return back;
}
@@ -571,12 +549,12 @@ dk3bmeo_set_duplex(dk3_bm_eps_options_t *opt, int duplex)
{
-#line 780 "dk3bmeo.ctr"
+#line 778 "dk3bmeo.ctr"
if(opt) {
opt->duplex = duplex;
}
-#line 783 "dk3bmeo.ctr"
+#line 781 "dk3bmeo.ctr"
}
@@ -587,12 +565,12 @@ dk3bmeo_get_duplex(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 792 "dk3bmeo.ctr"
+#line 790 "dk3bmeo.ctr"
if(opt) {
back = ((opt->duplex) ? 1 : 0);
}
-#line 795 "dk3bmeo.ctr"
+#line 793 "dk3bmeo.ctr"
return back;
}
@@ -603,12 +581,12 @@ dk3bmeo_set_predictor(dk3_bm_eps_options_t *opt, int pred)
{
-#line 804 "dk3bmeo.ctr"
+#line 802 "dk3bmeo.ctr"
if(opt) {
opt->pred = pred;
}
-#line 807 "dk3bmeo.ctr"
+#line 805 "dk3bmeo.ctr"
}
@@ -619,12 +597,12 @@ dk3bmeo_get_predictor(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 816 "dk3bmeo.ctr"
+#line 814 "dk3bmeo.ctr"
if(opt) {
back = opt->pred;
}
-#line 819 "dk3bmeo.ctr"
+#line 817 "dk3bmeo.ctr"
return back;
}
@@ -635,12 +613,12 @@ dk3bmeo_set_origin(dk3_bm_eps_options_t *opt, int io)
{
-#line 828 "dk3bmeo.ctr"
+#line 826 "dk3bmeo.ctr"
if(opt) {
opt->io = io;
}
-#line 831 "dk3bmeo.ctr"
+#line 829 "dk3bmeo.ctr"
}
@@ -651,12 +629,12 @@ dk3bmeo_get_origin(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 840 "dk3bmeo.ctr"
+#line 838 "dk3bmeo.ctr"
if(opt) {
back = opt->io;
}
-#line 843 "dk3bmeo.ctr"
+#line 841 "dk3bmeo.ctr"
return back;
}
@@ -667,14 +645,14 @@ dk3bmeo_set_ps_level(dk3_bm_eps_options_t *opt, int psl)
{
-#line 852 "dk3bmeo.ctr"
+#line 850 "dk3bmeo.ctr"
if(opt) {
opt->psl = psl;
if(psl < 2) opt->psl = 2;
if(psl > 3) opt->psl = 3;
}
-#line 857 "dk3bmeo.ctr"
+#line 855 "dk3bmeo.ctr"
}
@@ -685,12 +663,12 @@ dk3bmeo_get_ps_level(dk3_bm_eps_options_t *opt)
int back = 3;
-#line 866 "dk3bmeo.ctr"
+#line 864 "dk3bmeo.ctr"
if(opt) {
back = opt->psl;
}
-#line 869 "dk3bmeo.ctr"
+#line 867 "dk3bmeo.ctr"
return back;
}
@@ -701,12 +679,12 @@ dk3bmeo_set_dct(dk3_bm_eps_options_t *opt, int dct)
{
-#line 878 "dk3bmeo.ctr"
+#line 876 "dk3bmeo.ctr"
if(opt) {
opt->dct = dct;
}
-#line 881 "dk3bmeo.ctr"
+#line 879 "dk3bmeo.ctr"
}
@@ -717,12 +695,12 @@ dk3bmeo_get_dct(dk3_bm_eps_options_t *opt)
int back = 1;
-#line 890 "dk3bmeo.ctr"
+#line 888 "dk3bmeo.ctr"
if(opt) {
back = ((opt->dct) ? 1 : 0);
}
-#line 893 "dk3bmeo.ctr"
+#line 891 "dk3bmeo.ctr"
return back;
}
@@ -732,12 +710,12 @@ dk3bmeo_set_keep_aspect_ratio(dk3_bm_eps_options_t *opt, int kar)
{
-#line 901 "dk3bmeo.ctr"
+#line 899 "dk3bmeo.ctr"
if(opt) {
opt->kar = kar;
}
-#line 904 "dk3bmeo.ctr"
+#line 902 "dk3bmeo.ctr"
}
@@ -748,12 +726,12 @@ dk3bmeo_get_keep_aspect_ratio(dk3_bm_eps_options_t *opt)
int back = 1;
-#line 913 "dk3bmeo.ctr"
+#line 911 "dk3bmeo.ctr"
if(opt) {
back = ((opt->kar) ? 1 : 0);
}
-#line 916 "dk3bmeo.ctr"
+#line 914 "dk3bmeo.ctr"
return back;
}
@@ -764,12 +742,12 @@ dk3bmeo_set_background(dk3_bm_eps_options_t *opt, int r, int g, int b, int f)
{
-#line 925 "dk3bmeo.ctr"
+#line 923 "dk3bmeo.ctr"
if(opt) {
opt->bgr = r; opt->bgg = g; opt->bgb = b; opt->fbg = f;
}
-#line 928 "dk3bmeo.ctr"
+#line 926 "dk3bmeo.ctr"
}
@@ -780,12 +758,12 @@ dk3bmeo_get_background_red(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 937 "dk3bmeo.ctr"
+#line 935 "dk3bmeo.ctr"
if(opt) {
back = opt->bgr;
}
-#line 940 "dk3bmeo.ctr"
+#line 938 "dk3bmeo.ctr"
return back;
}
@@ -798,12 +776,12 @@ dk3bmeo_get_background_green(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 951 "dk3bmeo.ctr"
+#line 949 "dk3bmeo.ctr"
if(opt) {
back = opt->bgg;
}
-#line 954 "dk3bmeo.ctr"
+#line 952 "dk3bmeo.ctr"
return back;
}
@@ -815,12 +793,12 @@ dk3bmeo_get_background_blue(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 964 "dk3bmeo.ctr"
+#line 962 "dk3bmeo.ctr"
if(opt) {
back = opt->bgb;
}
-#line 967 "dk3bmeo.ctr"
+#line 965 "dk3bmeo.ctr"
return back;
}
@@ -832,12 +810,12 @@ dk3bmeo_get_background_force(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 977 "dk3bmeo.ctr"
+#line 975 "dk3bmeo.ctr"
if(opt) {
back = ((opt->fbg) ? 1 : 0);
}
-#line 980 "dk3bmeo.ctr"
+#line 978 "dk3bmeo.ctr"
return back;
}
@@ -848,12 +826,12 @@ dk3bmeo_set_interpolation(dk3_bm_eps_options_t *opt, int iip)
{
-#line 989 "dk3bmeo.ctr"
+#line 987 "dk3bmeo.ctr"
if(opt) {
opt->ip = iip;
}
-#line 992 "dk3bmeo.ctr"
+#line 990 "dk3bmeo.ctr"
}
@@ -864,12 +842,12 @@ dk3bmeo_get_interpolation(dk3_bm_eps_options_t *opt)
int back = 1;
-#line 1001 "dk3bmeo.ctr"
+#line 999 "dk3bmeo.ctr"
if(opt) {
back = ((opt->ip) ? 1 : 0);
}
-#line 1004 "dk3bmeo.ctr"
+#line 1002 "dk3bmeo.ctr"
return back;
}
@@ -880,12 +858,12 @@ dk3bmeo_set_jpeg_interpolation(dk3_bm_eps_options_t *opt, int iip)
{
-#line 1013 "dk3bmeo.ctr"
+#line 1011 "dk3bmeo.ctr"
if(opt) {
opt->jip = iip;
}
-#line 1016 "dk3bmeo.ctr"
+#line 1014 "dk3bmeo.ctr"
}
@@ -896,12 +874,12 @@ dk3bmeo_get_jpeg_interpolation(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 1025 "dk3bmeo.ctr"
+#line 1023 "dk3bmeo.ctr"
if(opt) {
back = ((opt->jip) ? 1 : 0);
}
-#line 1028 "dk3bmeo.ctr"
+#line 1026 "dk3bmeo.ctr"
return back;
}
@@ -912,16 +890,16 @@ dk3bmeo_set_szmode(dk3_bm_eps_options_t *opt, int newmode)
{
-#line 1037 "dk3bmeo.ctr"
+#line 1035 "dk3bmeo.ctr"
if(opt) {
if((newmode >= 0) && (newmode <= 2)) {
opt->szmode = newmode;
-#line 1040 "dk3bmeo.ctr"
+#line 1038 "dk3bmeo.ctr"
}
}
-#line 1042 "dk3bmeo.ctr"
+#line 1040 "dk3bmeo.ctr"
}
@@ -931,12 +909,12 @@ dk3bmeo_set_resolution(dk3_bm_eps_options_t *opt, double dpi)
{
-#line 1050 "dk3bmeo.ctr"
+#line 1048 "dk3bmeo.ctr"
if(opt) {
opt->resolution = dpi;
}
-#line 1053 "dk3bmeo.ctr"
+#line 1051 "dk3bmeo.ctr"
}
@@ -947,13 +925,13 @@ dk3bmeo_get_resolution(dk3_bm_eps_options_t *opt)
double back = 72.0;
-#line 1062 "dk3bmeo.ctr"
+#line 1060 "dk3bmeo.ctr"
if(opt) {
back = opt->resolution;
if(back < 0.0) { back = 0.0; }
}
-#line 1066 "dk3bmeo.ctr"
+#line 1064 "dk3bmeo.ctr"
return back;
}
@@ -965,12 +943,12 @@ dk3bmeo_get_szmode(dk3_bm_eps_options_t *opt)
int back = 0;
-#line 1076 "dk3bmeo.ctr"
+#line 1074 "dk3bmeo.ctr"
if(opt) {
back = opt->szmode;
}
-#line 1079 "dk3bmeo.ctr"
+#line 1077 "dk3bmeo.ctr"
return back;
}
@@ -994,7 +972,7 @@ dk3bmeo_option_pslevel(
int i; /* Number obtained from val. */
-#line 1101 "dk3bmeo.ctr"
+#line 1099 "dk3bmeo.ctr"
if(val) {
#if VERSION_BEFORE_20140716
if(dk3sf_sscanf3(val, dkT("%d"), &i))
@@ -1021,7 +999,7 @@ dk3bmeo_option_pslevel(
/* ERROR: Missing argument! */
}
-#line 1126 "dk3bmeo.ctr"
+#line 1124 "dk3bmeo.ctr"
return back;
}
@@ -1047,7 +1025,7 @@ dk3bmeo_set_boolean(
int back = 0;
-#line 1150 "dk3bmeo.ctr"
+#line 1148 "dk3bmeo.ctr"
if(val) {
if(dk3str_is_bool(val)) {
back = 1;
@@ -1064,7 +1042,7 @@ dk3bmeo_set_boolean(
*dest = 1; back = 1;
}
-#line 1165 "dk3bmeo.ctr"
+#line 1163 "dk3bmeo.ctr"
return back;
}
@@ -1087,7 +1065,7 @@ dk3bmeo_option_predictor(
int back = 0;
-#line 1186 "dk3bmeo.ctr"
+#line 1184 "dk3bmeo.ctr"
if(val) {
back = dk3str_array_index(dk3bmeo_predictor_names, val, 0);
if(back > -1) {
@@ -1101,7 +1079,7 @@ dk3bmeo_option_predictor(
opt->pred = DK3_COMPRESSION_PREDICTOR_TIFF; back = 1;
}
-#line 1198 "dk3bmeo.ctr"
+#line 1196 "dk3bmeo.ctr"
return back;
}
@@ -1127,7 +1105,7 @@ dk3bmeo_option_background(
dkChar *pn; /* Next word pointer. */
-#line 1222 "dk3bmeo.ctr"
+#line 1220 "dk3bmeo.ctr"
if(val) {
pc = dk3str_start(val, NULL);
if(pc) {
@@ -1211,7 +1189,7 @@ dk3bmeo_option_background(
opt->bgr = 255; opt->bgg = 255; opt->bgb = 255; opt->fbg = 1;
}
-#line 1304 "dk3bmeo.ctr"
+#line 1302 "dk3bmeo.ctr"
return back;
}
@@ -1235,24 +1213,24 @@ dk3bmeo_option_resolution(
double d; /* Temporary conversion result. */
-#line 1326 "dk3bmeo.ctr"
+#line 1324 "dk3bmeo.ctr"
if(val) {
if(dk3str_casecmp(dk3bmeo_kw[1], val) == 0) {
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 1329 "dk3bmeo.ctr"
+#line 1327 "dk3bmeo.ctr"
back = 1;
} else {
if(dk3str_casecmp(dk3bmeo_kw[2], val) == 0) {
opt->szmode = DK3_BMEPS_SIZE_CHUNK;
-#line 1333 "dk3bmeo.ctr"
+#line 1331 "dk3bmeo.ctr"
back = 1;
} else {
if(dk3str_casecmp(dk3bmeo_kw[3], val) == 0) {
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 1337 "dk3bmeo.ctr"
+#line 1335 "dk3bmeo.ctr"
back = 1;
} else {
#if VERSION_BEFORE_20140716
@@ -1263,7 +1241,7 @@ dk3bmeo_option_resolution(
{
opt->szmode = DK3_BMEPS_SIZE_SPECIFIED;
-#line 1346 "dk3bmeo.ctr"
+#line 1344 "dk3bmeo.ctr"
opt->resolution = d;
back = 1;
} else {
@@ -1281,7 +1259,7 @@ dk3bmeo_option_resolution(
}
-#line 1362 "dk3bmeo.ctr"
+#line 1360 "dk3bmeo.ctr"
return back;
}
@@ -1304,18 +1282,18 @@ dk3bmeo_option_paper(
int back = 0;
-#line 1383 "dk3bmeo.ctr"
+#line 1381 "dk3bmeo.ctr"
if(val) {
back = dk3bmeo_set_paper_size_complain(opt, val, 1);
opt->szmode = DK3_BMEPS_SIZE_PAPER;
-#line 1386 "dk3bmeo.ctr"
+#line 1384 "dk3bmeo.ctr"
} else {
/* ERROR: Missing value! */
dk3bmj_log_1(opt->app, DK3_LL_ERROR,msg,37,DK3_BMJ_LOG_BOTH,NULL);
}
-#line 1390 "dk3bmeo.ctr"
+#line 1388 "dk3bmeo.ctr"
return back;
}
@@ -1334,7 +1312,7 @@ dk3bmeo_apply_option(
int back = 0;
-#line 1407 "dk3bmeo.ctr"
+#line 1405 "dk3bmeo.ctr"
if((opt) && (str)) {
p1 = dk3str_start(str, NULL);
if(p1) {
@@ -1395,7 +1373,7 @@ dk3bmeo_apply_option(
case 15: { /* Reduce bits per component if possible. */
-#line 1466 "dk3bmeo.ctr"
+#line 1464 "dk3bmeo.ctr"
back = dk3bmeo_set_boolean(opt, &(opt->rbpc), p1, msg);
} break;
default: {
@@ -1407,19 +1385,19 @@ dk3bmeo_apply_option(
}
} else {
-#line 1476 "dk3bmeo.ctr"
+#line 1474 "dk3bmeo.ctr"
/* ERROR: Configuration string too long! */
dk3bmj_log_3(opt->app, DK3_LL_ERROR,msg,20,21,p1,DK3_BMJ_LOG_BOTH,NULL);
}
} else {
-#line 1480 "dk3bmeo.ctr"
+#line 1478 "dk3bmeo.ctr"
/* ERROR: Empty configuration string! */
dk3bmj_log_1(opt->app, DK3_LL_ERROR,msg,19,DK3_BMJ_LOG_BOTH,NULL);
}
}
-#line 1484 "dk3bmeo.ctr"
+#line 1482 "dk3bmeo.ctr"
return back;
}
@@ -1441,7 +1419,7 @@ dk3bmeo_set_language(
int mode = -1; /* Mode. */
-#line 1504 "dk3bmeo.ctr"
+#line 1502 "dk3bmeo.ctr"
msg = dk3app_messages(
opt->app,
dk3bmep_str_get_string_table_name(),
@@ -1524,7 +1502,7 @@ dk3bmeo_set_language(
}
}
-#line 1585 "dk3bmeo.ctr"
+#line 1583 "dk3bmeo.ctr"
return back;
}
#else
@@ -1543,7 +1521,7 @@ dk3bmeo_set_language(
int back = 0;
-#line 1602 "dk3bmeo.ctr"
+#line 1600 "dk3bmeo.ctr"
msg = dk3app_messages(
opt->app,
dk3bmep_str_get_string_table_name(),
@@ -1554,56 +1532,56 @@ dk3bmeo_set_language(
}
if((opt) && (str)) {
-#line 1611 "dk3bmeo.ctr"
+#line 1609 "dk3bmeo.ctr"
dk3bmeo_init(opt);
opt->app = app;
if(dk3str_len(str) < DK3_SIZEOF(bu,dkChar)) {
-#line 1614 "dk3bmeo.ctr"
+#line 1612 "dk3bmeo.ctr"
dk3str_cpy_not_overlapped(bu, str);
pc = dk3str_start(bu, NULL);
if(pc) {
-#line 1617 "dk3bmeo.ctr"
+#line 1615 "dk3bmeo.ctr"
pn = dk3str_chr(pc, dkT(','));
if(pn) { *(pn++) = dkT('\0'); pn = dk3str_start(pn, NULL); }
pt = dk3str_chr(pc, dkT('.'));
if(pt) { *(pt++) = dkT('\0'); pt = dk3str_start(pt, NULL); }
back = 1;
-#line 1622 "dk3bmeo.ctr"
+#line 1620 "dk3bmeo.ctr"
opt->mode = DK3_BMEPS_MODE_OBJECT;
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 1624 "dk3bmeo.ctr"
+#line 1622 "dk3bmeo.ctr"
switch(dk3str_array_index(dk3bmeo_driver_names, pc, 0)) {
case 0: {
opt->dr = DK3_BMEPS_DRIVER_PS;
-#line 1627 "dk3bmeo.ctr"
+#line 1625 "dk3bmeo.ctr"
} break;
case 1: {
opt->dr = DK3_BMEPS_DRIVER_EPS;
-#line 1630 "dk3bmeo.ctr"
+#line 1628 "dk3bmeo.ctr"
} break;
case 2: {
opt->dr = DK3_BMEPS_DRIVER_PDF;
-#line 1633 "dk3bmeo.ctr"
+#line 1631 "dk3bmeo.ctr"
} break;
case 3: {
opt->dr = DK3_BMEPS_DRIVER_BB;
-#line 1636 "dk3bmeo.ctr"
+#line 1634 "dk3bmeo.ctr"
opt->mode = DK3_BMEPS_MODE_OBJECT;
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 1638 "dk3bmeo.ctr"
+#line 1636 "dk3bmeo.ctr"
} break;
default: {
-#line 1640 "dk3bmeo.ctr"
+#line 1638 "dk3bmeo.ctr"
back = 0;
dk3bmj_log_3(
opt->app, DK3_LL_ERROR,msg,15,16,pc,DK3_BMJ_LOG_BOTH,NULL
@@ -1612,38 +1590,38 @@ dk3bmeo_set_language(
}
if(back) {
-#line 1647 "dk3bmeo.ctr"
+#line 1645 "dk3bmeo.ctr"
if(pt) {
-#line 1648 "dk3bmeo.ctr"
+#line 1646 "dk3bmeo.ctr"
switch(dk3str_array_abbr(dk3bmeo_mode_names, pt, dkT('$'), 0)) {
case 0: {
-#line 1650 "dk3bmeo.ctr"
+#line 1648 "dk3bmeo.ctr"
opt->mode = DK3_BMEPS_MODE_IMAGE;
opt->szmode = DK3_BMEPS_SIZE_CHUNK;
-#line 1652 "dk3bmeo.ctr"
+#line 1650 "dk3bmeo.ctr"
} break;
case 1: {
-#line 1654 "dk3bmeo.ctr"
+#line 1652 "dk3bmeo.ctr"
opt->mode = DK3_BMEPS_MODE_OBJECT;
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 1656 "dk3bmeo.ctr"
+#line 1654 "dk3bmeo.ctr"
} break;
case 2: {
opt->mode = DK3_BMEPS_MODE_DOCUMENT;
-#line 1659 "dk3bmeo.ctr"
+#line 1657 "dk3bmeo.ctr"
opt->szmode = DK3_BMEPS_SIZE_PAPER;
-#line 1660 "dk3bmeo.ctr"
+#line 1658 "dk3bmeo.ctr"
} break;
default: {
-#line 1662 "dk3bmeo.ctr"
+#line 1660 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal mode! */
dk3bmj_log_3(
@@ -1653,10 +1631,10 @@ dk3bmeo_set_language(
}
if(opt->dr == DK3_BMEPS_DRIVER_BB) {
-#line 1670 "dk3bmeo.ctr"
+#line 1668 "dk3bmeo.ctr"
if(opt->mode != DK3_BMEPS_MODE_OBJECT) {
-#line 1671 "dk3bmeo.ctr"
+#line 1669 "dk3bmeo.ctr"
back = 0;
/* ERROR: BB driver can only produce objects! */
dk3bmj_log_1(opt->app, DK3_LL_ERROR,msg,8,DK3_BMJ_LOG_BOTH,NULL);
@@ -1664,16 +1642,16 @@ dk3bmeo_set_language(
}
} else {
-#line 1677 "dk3bmeo.ctr"
+#line 1675 "dk3bmeo.ctr"
}
dk3bmeo_initialize_for_driver_and_mode(opt);
if(back) {
-#line 1680 "dk3bmeo.ctr"
+#line 1678 "dk3bmeo.ctr"
pc = pn;
while(pc) {
-#line 1682 "dk3bmeo.ctr"
+#line 1680 "dk3bmeo.ctr"
pn = dk3str_chr(pc, dkT(','));
if(pn) { *(pn++) = dkT('\0'); pn = dk3str_start(pn, NULL); }
if(!dk3bmeo_apply_option(opt, pc, msg)) { back = 0; }
@@ -1683,22 +1661,22 @@ dk3bmeo_set_language(
}
} else {
-#line 1690 "dk3bmeo.ctr"
+#line 1688 "dk3bmeo.ctr"
/* ERROR: Empty string! */
dk3bmj_log_1(opt->app, DK3_LL_ERROR,msg,14,DK3_BMJ_LOG_BOTH,NULL);
}
} else {
-#line 1694 "dk3bmeo.ctr"
+#line 1692 "dk3bmeo.ctr"
/* ERROR: String too long! */
dk3bmj_log_3(opt->app, DK3_LL_ERROR,msg,12,13,str,DK3_BMJ_LOG_BOTH,NULL);
}
} else {
-#line 1698 "dk3bmeo.ctr"
+#line 1696 "dk3bmeo.ctr"
}
-#line 1699 "dk3bmeo.ctr"
+#line 1697 "dk3bmeo.ctr"
return back;
}
#endif
@@ -1709,7 +1687,6 @@ int
dk3bmeo_check(
dk3_bm_eps_options_t *opt,
int type,
- dk3_app_t *app,
dk3_bm_conversion_job_t *job
)
{
@@ -1717,7 +1694,7 @@ dk3bmeo_check(
int back = 1; /* No error found (yet). */
-#line 1716 "dk3bmeo.ctr"
+#line 1713 "dk3bmeo.ctr"
/*
Check driver.
*/
@@ -1731,18 +1708,18 @@ dk3bmeo_check(
}
if(type) {
-#line 1728 "dk3bmeo.ctr"
+#line 1725 "dk3bmeo.ctr"
switch(opt->dr) {
case DK3_BMEPS_DRIVER_PS:
case DK3_BMEPS_DRIVER_PDF:
{
-#line 1732 "dk3bmeo.ctr"
+#line 1729 "dk3bmeo.ctr"
}
break;
default: {
-#line 1735 "dk3bmeo.ctr"
+#line 1732 "dk3bmeo.ctr"
back = 0;
/* ERROR: Placed objects can use the PS or PDF driver only! */
opt->dr = DK3_BMEPS_DRIVER_PS;
@@ -1751,7 +1728,7 @@ dk3bmeo_check(
}
} else {
-#line 1742 "dk3bmeo.ctr"
+#line 1739 "dk3bmeo.ctr"
switch(opt->dr) {
case DK3_BMEPS_DRIVER_PS:
case DK3_BMEPS_DRIVER_EPS:
@@ -1759,12 +1736,12 @@ dk3bmeo_check(
case DK3_BMEPS_DRIVER_BB:
{
-#line 1748 "dk3bmeo.ctr"
+#line 1745 "dk3bmeo.ctr"
}
break;
default: {
-#line 1751 "dk3bmeo.ctr"
+#line 1748 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal driver, must be PS, EPS, PDF, BB! */
opt->dr = DK3_BMEPS_DRIVER_PDF;
@@ -1777,39 +1754,39 @@ dk3bmeo_check(
*/
if(type) {
-#line 1762 "dk3bmeo.ctr"
+#line 1759 "dk3bmeo.ctr"
if(opt->mode != DK3_BMEPS_MODE_PLACED_OBJECT) {
back = 0;
-#line 1764 "dk3bmeo.ctr"
+#line 1761 "dk3bmeo.ctr"
/* ERROR: Illegal mode, must be placed object! */
opt->mode = DK3_BMEPS_MODE_PLACED_OBJECT;
dk3bmj_log_1(opt->app, DK3_LL_ERROR, msg, 4, DK3_BMJ_LOG_BOTH, job);
}
} else {
-#line 1769 "dk3bmeo.ctr"
+#line 1766 "dk3bmeo.ctr"
if(opt->mode == DK3_BMEPS_MODE_PLACED_OBJECT) {
-#line 1770 "dk3bmeo.ctr"
+#line 1767 "dk3bmeo.ctr"
dk3bmj_log_1(opt->app, DK3_LL_ERROR, msg, 5, DK3_BMJ_LOG_BOTH, job);
} else {
switch(opt->dr) {
case DK3_BMEPS_DRIVER_PS: {
-#line 1774 "dk3bmeo.ctr"
+#line 1771 "dk3bmeo.ctr"
switch(opt->mode) {
case DK3_BMEPS_MODE_IMAGE:
case DK3_BMEPS_MODE_OBJECT:
case DK3_BMEPS_MODE_DOCUMENT:
{
-#line 1779 "dk3bmeo.ctr"
+#line 1776 "dk3bmeo.ctr"
}
break;
default: {
-#line 1782 "dk3bmeo.ctr"
+#line 1779 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal mode, must be image, object, document! */
opt->mode = DK3_BMEPS_MODE_IMAGE;
@@ -1819,18 +1796,18 @@ dk3bmeo_check(
} break;
case DK3_BMEPS_DRIVER_EPS: {
-#line 1790 "dk3bmeo.ctr"
+#line 1787 "dk3bmeo.ctr"
switch(opt->mode) {
case DK3_BMEPS_MODE_IMAGE:
case DK3_BMEPS_MODE_OBJECT:
{
-#line 1794 "dk3bmeo.ctr"
+#line 1791 "dk3bmeo.ctr"
}
break;
default: {
-#line 1797 "dk3bmeo.ctr"
+#line 1794 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal mode, must be image or object! */
opt->mode = DK3_BMEPS_MODE_OBJECT;
@@ -1840,19 +1817,19 @@ dk3bmeo_check(
} break;
case DK3_BMEPS_DRIVER_PDF: {
-#line 1805 "dk3bmeo.ctr"
+#line 1802 "dk3bmeo.ctr"
switch(opt->mode) {
case DK3_BMEPS_MODE_IMAGE:
case DK3_BMEPS_MODE_OBJECT:
case DK3_BMEPS_MODE_DOCUMENT:
{
-#line 1810 "dk3bmeo.ctr"
+#line 1807 "dk3bmeo.ctr"
}
break;
default: {
-#line 1813 "dk3bmeo.ctr"
+#line 1810 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal mode, must be image, object, document! */
opt->mode = DK3_BMEPS_MODE_OBJECT;
@@ -1862,17 +1839,17 @@ dk3bmeo_check(
} break;
case DK3_BMEPS_DRIVER_BB: {
-#line 1821 "dk3bmeo.ctr"
+#line 1818 "dk3bmeo.ctr"
switch(opt->mode) {
case DK3_BMEPS_MODE_OBJECT:
{
-#line 1824 "dk3bmeo.ctr"
+#line 1821 "dk3bmeo.ctr"
}
break;
default: {
-#line 1827 "dk3bmeo.ctr"
+#line 1824 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal mode, BB requires object! */
opt->mode = DK3_BMEPS_MODE_OBJECT;
@@ -1892,66 +1869,66 @@ dk3bmeo_check(
*/
if(type) {
-#line 1845 "dk3bmeo.ctr"
+#line 1842 "dk3bmeo.ctr"
} else {
-#line 1846 "dk3bmeo.ctr"
+#line 1843 "dk3bmeo.ctr"
switch(opt->mode) {
case DK3_BMEPS_MODE_IMAGE: {
-#line 1848 "dk3bmeo.ctr"
+#line 1845 "dk3bmeo.ctr"
switch(opt->szmode) {
case DK3_BMEPS_SIZE_1_1: {
-#line 1850 "dk3bmeo.ctr"
+#line 1847 "dk3bmeo.ctr"
} break;
case DK3_BMEPS_SIZE_CHUNK: {
-#line 1852 "dk3bmeo.ctr"
+#line 1849 "dk3bmeo.ctr"
} break;
case DK3_BMEPS_SIZE_SPECIFIED: {
-#line 1854 "dk3bmeo.ctr"
+#line 1851 "dk3bmeo.ctr"
} break;
case DK3_BMEPS_SIZE_PAPER: {
-#line 1856 "dk3bmeo.ctr"
+#line 1853 "dk3bmeo.ctr"
} break;
default: {
-#line 1858 "dk3bmeo.ctr"
+#line 1855 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal size mode! */
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 1861 "dk3bmeo.ctr"
+#line 1858 "dk3bmeo.ctr"
dk3bmj_log_1(opt->app, DK3_LL_ERROR,msg,9,DK3_BMJ_LOG_BOTH,job);
} break;
}
} break;
case DK3_BMEPS_MODE_OBJECT: {
-#line 1866 "dk3bmeo.ctr"
+#line 1863 "dk3bmeo.ctr"
switch(opt->szmode) {
case DK3_BMEPS_SIZE_1_1: {
-#line 1868 "dk3bmeo.ctr"
+#line 1865 "dk3bmeo.ctr"
} break;
default: {
-#line 1870 "dk3bmeo.ctr"
+#line 1867 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal size mode, must be 1:1! */
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 1873 "dk3bmeo.ctr"
+#line 1870 "dk3bmeo.ctr"
dk3bmj_log_1(opt->app, DK3_LL_ERROR,msg,10,DK3_BMJ_LOG_BOTH,job);
} break;
}
} break;
case DK3_BMEPS_MODE_DOCUMENT: {
-#line 1878 "dk3bmeo.ctr"
+#line 1875 "dk3bmeo.ctr"
if(opt->draft) {
opt->draft = 0;
/* ERROR: Draft can not be used with documents! */
@@ -1960,28 +1937,28 @@ dk3bmeo_check(
switch(opt->szmode) {
case DK3_BMEPS_SIZE_1_1: {
-#line 1885 "dk3bmeo.ctr"
+#line 1882 "dk3bmeo.ctr"
} break;
case DK3_BMEPS_SIZE_CHUNK: {
-#line 1887 "dk3bmeo.ctr"
+#line 1884 "dk3bmeo.ctr"
} break;
case DK3_BMEPS_SIZE_SPECIFIED: {
-#line 1889 "dk3bmeo.ctr"
+#line 1886 "dk3bmeo.ctr"
} break;
case DK3_BMEPS_SIZE_PAPER: {
-#line 1891 "dk3bmeo.ctr"
+#line 1888 "dk3bmeo.ctr"
} break;
default: {
-#line 1893 "dk3bmeo.ctr"
+#line 1890 "dk3bmeo.ctr"
back = 0;
/* ERROR: Illegal size mode! */
opt->szmode = DK3_BMEPS_SIZE_1_1;
-#line 1896 "dk3bmeo.ctr"
+#line 1893 "dk3bmeo.ctr"
dk3bmj_log_1(opt->app, DK3_LL_ERROR,msg,9,DK3_BMJ_LOG_BOTH,job);
} break;
}
@@ -1989,7 +1966,7 @@ dk3bmeo_check(
}
}
-#line 1902 "dk3bmeo.ctr"
+#line 1899 "dk3bmeo.ctr"
return back;
}
diff --git a/support/dktools/dk3bmeo.ctr b/support/dktools/dk3bmeo.ctr
index 785d33cb0e..013a5fc59e 100644
--- a/support/dktools/dk3bmeo.ctr
+++ b/support/dktools/dk3bmeo.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -264,7 +264,6 @@ dk3bmeo_set_language(
a second check will return 1.
@param opt Option set.
@param type Invokation type (0=bmeps/wxbmeps, 1=placed object).
- @param app Application structure for diagnostics, may be NULL.
@param job Conversion job structure.
@return 1 on success, 0 on error (corrections applied).
*/
@@ -272,7 +271,6 @@ int
dk3bmeo_check(
dk3_bm_eps_options_t *opt,
int type,
- dk3_app_t *app,
dk3_bm_conversion_job_t *job
);
@@ -1706,7 +1704,6 @@ int
dk3bmeo_check(
dk3_bm_eps_options_t *opt,
int type,
- dk3_app_t *app,
dk3_bm_conversion_job_t *job
)
{
diff --git a/support/dktools/dk3bmeo.h b/support/dktools/dk3bmeo.h
index d506acc00e..141c017014 100644
--- a/support/dktools/dk3bmeo.h
+++ b/support/dktools/dk3bmeo.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bmeo.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bmeo.ctr
*/
/** @file dk3bmeo.h Header file for the dk3bmeo module.
@@ -299,7 +277,6 @@ dk3bmeo_set_language(
a second check will return 1.
@param opt Option set.
@param type Invokation type (0=bmeps/wxbmeps, 1=placed object).
- @param app Application structure for diagnostics, may be NULL.
@param job Conversion job structure.
@return 1 on success, 0 on error (corrections applied).
*/
@@ -307,7 +284,6 @@ int
dk3bmeo_check(
dk3_bm_eps_options_t *opt,
int type,
- dk3_app_t *app,
dk3_bm_conversion_job_t *job
);
diff --git a/support/dktools/dk3bmep.c b/support/dktools/dk3bmep.c
index 4e816ef94f..a03df9f8f5 100644
--- a/support/dktools/dk3bmep.c
+++ b/support/dktools/dk3bmep.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bmep.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bmep.ctr
*/
/** @file dk3bmep.c The dk3bmep module.
diff --git a/support/dktools/dk3bmep.ctr b/support/dktools/dk3bmep.ctr
index ff195e3967..a55313a688 100644
--- a/support/dktools/dk3bmep.ctr
+++ b/support/dktools/dk3bmep.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3bmep.h b/support/dktools/dk3bmep.h
index f7ae4eccb9..0a55cc883a 100644
--- a/support/dktools/dk3bmep.h
+++ b/support/dktools/dk3bmep.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bmep.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bmep.ctr
*/
/** @file dk3bmep.h Header file for the dk3bmep module.
diff --git a/support/dktools/dk3bmeps.c b/support/dktools/dk3bmeps.c
index 71905ebdbe..49ef68e792 100644
--- a/support/dktools/dk3bmeps.c
+++ b/support/dktools/dk3bmeps.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bmeps.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bmeps.ctr
*/
/** @file dk3bmeps.c The dk3bmeps module.
diff --git a/support/dktools/dk3bmeps.ctr b/support/dktools/dk3bmeps.ctr
index f2dc9759e9..2108dbd332 100644
--- a/support/dktools/dk3bmeps.ctr
+++ b/support/dktools/dk3bmeps.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3bmeps.h b/support/dktools/dk3bmeps.h
index 522e7da682..4d906f98a5 100644
--- a/support/dktools/dk3bmeps.h
+++ b/support/dktools/dk3bmeps.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bmeps.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bmeps.ctr
*/
/** @file dk3bmeps.h Header file for the dk3bmeps module.
diff --git a/support/dktools/dk3bmj.c b/support/dktools/dk3bmj.c
index ee0ef2ccf3..d8b7c66de7 100644
--- a/support/dktools/dk3bmj.c
+++ b/support/dktools/dk3bmj.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bmj.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bmj.ctr
*/
/** @file dk3bmj.c The dk3bmj module.
@@ -39,6 +17,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 303 "dk3bmj.ctr"
+#include "dk3conf.h"
+
#if DK3_USE_WX
#include "wxbmeps.h"
#else
@@ -47,18 +27,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3bmeps.h"
#endif
+#include "dk3unused.h"
-#line 315 "dk3bmj.ctr"
+#line 319 "dk3bmj.ctr"
+#if DK3_USE_WX
/** Log level required for writing to the log text field in wxbmeps.
*/
static int const dk3bmj_required_log_level = DK3_LL_PROGRESS;
-
+#endif
void
@@ -66,7 +48,7 @@ dk3bmj_init(dk3_bm_conversion_job_t *job, dk3_app_t *app)
{
-#line 328 "dk3bmj.ctr"
+#line 332 "dk3bmj.ctr"
job->opt = NULL;
if(app) {
job->msg = dk3app_messages(
@@ -108,55 +90,72 @@ dk3bmj_init(dk3_bm_conversion_job_t *job, dk3_app_t *app)
job->currentPage = 1;
job->pdf = NULL;
-#line 368 "dk3bmj.ctr"
+#line 372 "dk3bmj.ctr"
}
void
-dk3bmj_progress(void *pc, int val)
+dk3bmj_progress(
+#if DK3_USE_WX
+ void *pc, int val
+#else
+ void * DK3_ARG_UNUSED(pc), int DK3_ARG_UNUSED(val)
+#endif
+)
{
-#line 376 "dk3bmj.ctr"
+#line 386 "dk3bmj.ctr"
#if DK3_USE_WX
DkWxCommunicator *pComm;
if(pc) {
-#line 379 "dk3bmj.ctr"
+#line 389 "dk3bmj.ctr"
pComm = (DkWxCommunicator *)pc;
pComm->updateGauge(val);
}
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(val)
#endif
-#line 384 "dk3bmj.ctr"
+#line 397 "dk3bmj.ctr"
}
void
dk3bmj_lines_do_progress(
+#if DK3_USE_WX
void *pc,
int min,
int max,
dk3_bif_coord_t h,
dk3_bif_coord_t y
+#else
+ void * DK3_ARG_UNUSED(pc),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ dk3_bif_coord_t DK3_ARG_UNUSED(h),
+ dk3_bif_coord_t DK3_ARG_UNUSED(y)
+#endif
)
{
-#line 398 "dk3bmj.ctr"
+#line 419 "dk3bmj.ctr"
#if DK3_USE_WX
{
unsigned long ul;
int i;
-#line 403 "dk3bmj.ctr"
+#line 424 "dk3bmj.ctr"
if((pc) && (max > min)) {
-#line 404 "dk3bmj.ctr"
+#line 425 "dk3bmj.ctr"
ul = (unsigned long)min
+ (((unsigned long)y + 1UL) * ((unsigned long)(max - min)))
/(unsigned long)h;
@@ -166,28 +165,48 @@ dk3bmj_lines_do_progress(
dk3bmj_progress(pc, i);
} else {
-#line 412 "dk3bmj.ctr"
+#line 433 "dk3bmj.ctr"
}
}
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(h)
+ DK3_UNUSED_ARG(y)
#endif
-#line 416 "dk3bmj.ctr"
+#line 443 "dk3bmj.ctr"
}
void
dk3bmj_lines_progress(
+#if DK3_USE_WX
void *pc,
int min,
int max,
dk3_bif_coord_t h,
dk3_bif_coord_t y
+#else
+ void * DK3_ARG_UNUSED(pc),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ dk3_bif_coord_t DK3_ARG_UNUSED(h),
+ dk3_bif_coord_t DK3_ARG_UNUSED(y)
+#endif
)
{
#if DK3_USE_WX
dk3bmj_lines_do_progress(pc, min, max, h, y);
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(h)
+ DK3_UNUSED_ARG(y)
#endif
}
@@ -195,23 +214,31 @@ dk3bmj_lines_progress(
void
dk3bmj_objects_do_progress(
+#if DK3_USE_WX
void *pc,
int min,
int max,
unsigned long nObjects,
unsigned long co
+#else
+ void * DK3_ARG_UNUSED(pc),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ unsigned long DK3_ARG_UNUSED(nObjects),
+ unsigned long DK3_ARG_UNUSED(co)
+#endif
)
{
-#line 446 "dk3bmj.ctr"
+#line 495 "dk3bmj.ctr"
#if DK3_USE_WX
unsigned long ul; /* Temporary value. */
int i; /* New progress bar value. */
if((pc) && (max > min)) {
-#line 451 "dk3bmj.ctr"
+#line 500 "dk3bmj.ctr"
ul = (unsigned long)min
+ ((co + 1UL) * ((unsigned long)(max - min))) / nObjects;
i = (int)ul;
@@ -220,26 +247,47 @@ dk3bmj_objects_do_progress(
dk3bmj_progress(pc, i);
} else {
-#line 458 "dk3bmj.ctr"
+#line 507 "dk3bmj.ctr"
}
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(nObjects)
+ DK3_UNUSED_ARG(co)
#endif
-#line 461 "dk3bmj.ctr"
+#line 516 "dk3bmj.ctr"
}
+
void
dk3bmj_obj_progress(
+#if DK3_USE_WX
void *pc,
int min,
int max,
unsigned long nObjects,
unsigned long co
+#else
+ void * DK3_ARG_UNUSED(pc),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ unsigned long DK3_ARG_UNUSED(nObjects),
+ unsigned long DK3_ARG_UNUSED(co)
+#endif
)
{
#if DK3_USE_WX
dk3bmj_objects_do_progress(pc, min, max, nObjects, co);
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(nObjects)
+ DK3_UNUSED_ARG(co)
#endif
}
@@ -251,7 +299,11 @@ dk3bmj_log_i1(
int ll,
size_t i,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -279,6 +331,8 @@ dk3bmj_log_i1(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
@@ -292,7 +346,11 @@ dk3bmj_log_i3(
size_t i2,
dkChar const *txt,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -326,6 +384,8 @@ dk3bmj_log_i3(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
@@ -342,7 +402,11 @@ dk3bmj_log_i5(
dkChar const *txt1,
dkChar const *txt2,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -382,6 +446,8 @@ dk3bmj_log_i5(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
@@ -394,7 +460,11 @@ dk3bmj_log_1(
dkChar const * const *txta,
size_t i,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -403,73 +473,75 @@ dk3bmj_log_1(
#endif
-#line 637 "dk3bmj.ctr"
+#line 729 "dk3bmj.ctr"
if(txta) {
-#line 638 "dk3bmj.ctr"
+#line 730 "dk3bmj.ctr"
if(dest & DK3_BMJ_LOG_APP) {
-#line 639 "dk3bmj.ctr"
+#line 731 "dk3bmj.ctr"
if(app) {
-#line 640 "dk3bmj.ctr"
+#line 732 "dk3bmj.ctr"
dk3app_log_1(app, ll, txta, i);
} else {
-#line 642 "dk3bmj.ctr"
+#line 734 "dk3bmj.ctr"
}
} else {
-#line 644 "dk3bmj.ctr"
+#line 736 "dk3bmj.ctr"
}
#if DK3_USE_WX
if((dest & DK3_BMJ_LOG_JOB) && (ll <= dk3bmj_required_log_level)) {
-#line 647 "dk3bmj.ctr"
+#line 739 "dk3bmj.ctr"
if(job) {
-#line 648 "dk3bmj.ctr"
+#line 740 "dk3bmj.ctr"
if(app) {
-#line 649 "dk3bmj.ctr"
+#line 741 "dk3bmj.ctr"
pComm = (DkWxCommunicator *)(job->pComm);
if(pComm) {
-#line 651 "dk3bmj.ctr"
+#line 743 "dk3bmj.ctr"
pComm->setLogLevel(ll);
p1 = txta[i];
if(p1) {
-#line 654 "dk3bmj.ctr"
+#line 746 "dk3bmj.ctr"
pComm->addDkText(p1);
pComm->nl();
} else {
-#line 657 "dk3bmj.ctr"
+#line 749 "dk3bmj.ctr"
}
} else {
-#line 659 "dk3bmj.ctr"
+#line 751 "dk3bmj.ctr"
}
} else {
-#line 661 "dk3bmj.ctr"
+#line 753 "dk3bmj.ctr"
}
} else {
-#line 663 "dk3bmj.ctr"
+#line 755 "dk3bmj.ctr"
}
} else {
-#line 665 "dk3bmj.ctr"
+#line 757 "dk3bmj.ctr"
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
} else {
-#line 668 "dk3bmj.ctr"
+#line 762 "dk3bmj.ctr"
}
-#line 669 "dk3bmj.ctr"
+#line 763 "dk3bmj.ctr"
}
@@ -483,7 +555,11 @@ dk3bmj_log_3(
size_t i2,
dkChar const *txt,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -518,6 +594,8 @@ dk3bmj_log_3(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
}
@@ -536,7 +614,11 @@ dk3bmj_log_5(
dkChar const *txt1,
dkChar const *txt2,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -577,6 +659,8 @@ dk3bmj_log_5(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
}
diff --git a/support/dktools/dk3bmj.ctr b/support/dktools/dk3bmj.ctr
index 84f8f182c9..c9065b4a07 100644
--- a/support/dktools/dk3bmj.ctr
+++ b/support/dktools/dk3bmj.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -301,6 +301,8 @@ dk3bmj_obj_progress(
%% module
+#include "dk3conf.h"
+
#if DK3_USE_WX
#include "wxbmeps.h"
#else
@@ -309,16 +311,18 @@ dk3bmj_obj_progress(
#include "dk3bmeps.h"
#endif
+#include "dk3unused.h"
-$!trace-include
+$!trace-include
+#if DK3_USE_WX
/** Log level required for writing to the log text field in wxbmeps.
*/
static int const dk3bmj_required_log_level = DK3_LL_PROGRESS;
-
+#endif
void
@@ -370,7 +374,13 @@ dk3bmj_init(dk3_bm_conversion_job_t *job, dk3_app_t *app)
void
-dk3bmj_progress(void *pc, int val)
+dk3bmj_progress(
+#if DK3_USE_WX
+ void *pc, int val
+#else
+ void * DK3_ARG_UNUSED(pc), int DK3_ARG_UNUSED(val)
+#endif
+)
{
$? "+ dk3bmj_progress %d", val
#if DK3_USE_WX
@@ -379,6 +389,9 @@ dk3bmj_progress(void *pc, int val)
pComm = (DkWxCommunicator *)pc;
pComm->updateGauge(val);
}
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(val)
#endif
$? "- dk3bmj_progress"
}
@@ -387,11 +400,19 @@ dk3bmj_progress(void *pc, int val)
void
dk3bmj_lines_do_progress(
+#if DK3_USE_WX
void *pc,
int min,
int max,
dk3_bif_coord_t h,
dk3_bif_coord_t y
+#else
+ void * DK3_ARG_UNUSED(pc),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ dk3_bif_coord_t DK3_ARG_UNUSED(h),
+ dk3_bif_coord_t DK3_ARG_UNUSED(y)
+#endif
)
{
$? "+ dk3bmj_lines_do_progress %d %d %lu %lu", min, max, (unsigned long)h, (unsigned long)y
@@ -411,6 +432,12 @@ dk3bmj_lines_do_progress(
} else { $? "! args"
}
}
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(h)
+ DK3_UNUSED_ARG(y)
#endif
$? "- dk3bmj_lines_do_progress"
}
@@ -419,15 +446,29 @@ dk3bmj_lines_do_progress(
void
dk3bmj_lines_progress(
+#if DK3_USE_WX
void *pc,
int min,
int max,
dk3_bif_coord_t h,
dk3_bif_coord_t y
+#else
+ void * DK3_ARG_UNUSED(pc),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ dk3_bif_coord_t DK3_ARG_UNUSED(h),
+ dk3_bif_coord_t DK3_ARG_UNUSED(y)
+#endif
)
{
#if DK3_USE_WX
dk3bmj_lines_do_progress(pc, min, max, h, y);
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(h)
+ DK3_UNUSED_ARG(y)
#endif
}
@@ -435,11 +476,19 @@ dk3bmj_lines_progress(
void
dk3bmj_objects_do_progress(
+#if DK3_USE_WX
void *pc,
int min,
int max,
unsigned long nObjects,
unsigned long co
+#else
+ void * DK3_ARG_UNUSED(pc),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ unsigned long DK3_ARG_UNUSED(nObjects),
+ unsigned long DK3_ARG_UNUSED(co)
+#endif
)
{
$? "+ dk3bmj_objects_do_progress %d %d %lu %lu", min, max, nObjects, co
@@ -456,22 +505,43 @@ dk3bmj_objects_do_progress(
dk3bmj_progress(pc, i);
} else { $? "! args"
}
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(nObjects)
+ DK3_UNUSED_ARG(co)
#endif
$? "- dk3bmj_objects_do_progress"
}
+
void
dk3bmj_obj_progress(
+#if DK3_USE_WX
void *pc,
int min,
int max,
unsigned long nObjects,
unsigned long co
+#else
+ void * DK3_ARG_UNUSED(pc),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max),
+ unsigned long DK3_ARG_UNUSED(nObjects),
+ unsigned long DK3_ARG_UNUSED(co)
+#endif
)
{
#if DK3_USE_WX
dk3bmj_objects_do_progress(pc, min, max, nObjects, co);
+#else
+ DK3_UNUSED_ARG(pc)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+ DK3_UNUSED_ARG(nObjects)
+ DK3_UNUSED_ARG(co)
#endif
}
@@ -483,7 +553,11 @@ dk3bmj_log_i1(
int ll,
size_t i,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -511,6 +585,8 @@ dk3bmj_log_i1(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
@@ -524,7 +600,11 @@ dk3bmj_log_i3(
size_t i2,
dkChar const *txt,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -558,6 +638,8 @@ dk3bmj_log_i3(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
@@ -574,7 +656,11 @@ dk3bmj_log_i5(
dkChar const *txt1,
dkChar const *txt2,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -614,6 +700,8 @@ dk3bmj_log_i5(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
@@ -626,7 +714,11 @@ dk3bmj_log_1(
dkChar const * const *txta,
size_t i,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -663,6 +755,8 @@ dk3bmj_log_1(
}
} else { $? ". no need to write to wx"
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
} else { $? "! txta"
} $? "- dk3bmj_log_1"
@@ -679,7 +773,11 @@ dk3bmj_log_3(
size_t i2,
dkChar const *txt,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -714,6 +812,8 @@ dk3bmj_log_3(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
}
@@ -732,7 +832,11 @@ dk3bmj_log_5(
dkChar const *txt1,
dkChar const *txt2,
int dest,
+#if DK3_USE_WX
dk3_bm_conversion_job_t *job
+#else
+ dk3_bm_conversion_job_t * DK3_ARG_UNUSED(job)
+#endif
)
{
#if DK3_USE_WX
@@ -773,6 +877,8 @@ dk3bmj_log_5(
}
}
}
+#else
+ DK3_UNUSED_ARG(job)
#endif
}
}
diff --git a/support/dktools/dk3bmj.h b/support/dktools/dk3bmj.h
index 8b5e9f7c94..a4e881f060 100644
--- a/support/dktools/dk3bmj.h
+++ b/support/dktools/dk3bmj.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bmj.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bmj.ctr
*/
/** @file dk3bmj.h Header file for the dk3bmj module.
diff --git a/support/dktools/dk3bom.c b/support/dktools/dk3bom.c
index 1927989b3c..628e82158c 100644
--- a/support/dktools/dk3bom.c
+++ b/support/dktools/dk3bom.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bom.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bom.ctr
*/
/** @file dk3bom.c The dk3bom module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 76 "dk3bom.ctr"
+#include "dk3conf.h"
#include "dk3const.h"
#include "dk3stm.h"
#include "dk3bom.h"
diff --git a/support/dktools/dk3bom.ctr b/support/dktools/dk3bom.ctr
index 83a7517a90..a635b2ca14 100644
--- a/support/dktools/dk3bom.ctr
+++ b/support/dktools/dk3bom.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -74,6 +74,7 @@ dk3bom_detect_results(
%% module
+#include "dk3conf.h"
#include "dk3const.h"
#include "dk3stm.h"
#include "dk3bom.h"
diff --git a/support/dktools/dk3bom.h b/support/dktools/dk3bom.h
index 316b6d356c..6cc8ea5c00 100644
--- a/support/dktools/dk3bom.h
+++ b/support/dktools/dk3bom.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3bom.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3bom.ctr
*/
#ifndef DK3BOM_H_INCLUDED
diff --git a/support/dktools/dk3chks.c b/support/dktools/dk3chks.c
index 28dcf30bd2..7f361076a3 100644
--- a/support/dktools/dk3chks.c
+++ b/support/dktools/dk3chks.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3chks.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3chks.ctr
*/
/** @file dk3chks.c The dk3chks module.
@@ -158,7 +136,6 @@ dk3chksum_min_length(int cst)
/** Build binary checksum from file.
@param db Destination buffer.
- @param sz Size of \a db.
@param fipo File pointer for read access.
@param cst Checksum type.
@param app Application structure for diagnostics, may be NULL.
@@ -166,7 +143,7 @@ dk3chksum_min_length(int cst)
*/
static
int
-dk3checksum_binary(char *db, size_t sz, FILE *fipo, int cst, dk3_app_t *app)
+dk3checksum_binary(char *db, FILE *fipo, int cst, dk3_app_t *app)
{
int back = 0;
#if DK3_HAVE_OPENSSL_SHA_H
@@ -184,8 +161,11 @@ dk3checksum_binary(char *db, size_t sz, FILE *fipo, int cst, dk3_app_t *app)
#if DK3_HAVE_OPENSSL_RIPEMD_H
RIPEMD160_CTX ripemd160_ctx; /* RIPEMD-160 context. */
#endif
+#if DK3_HAVE_OPENSSL_RIPEMD_H || DK3_HAVE_OPENSSL_MD5_H \
+ || DK3_HAVE_OPENSSL_SHA_H
char buffer[4096]; /* Buffer for input. */
size_t rb = 0; /* Number of bytes read. */
+#endif
switch(cst) {
case DK3_MD_TYPE_MD5: {
#if DK3_HAVE_OPENSSL_MD5_H
@@ -331,7 +311,7 @@ dk3checksum_build_app(
if(((stb.ft) & (~(DK3_FT_SYMLINK))) == DK3_FT_REGULAR) {
fipo = dk3sf_fopen_app(fn, kw[0], app);
if(fipo) {
- if(dk3checksum_binary(mybuffer,sizeof(mybuffer),fipo, cst,app))
+ if(dk3checksum_binary(mybuffer,fipo, cst,app))
{
switch(cse) {
case DK3_DATA_ENCODING_HEX: {
diff --git a/support/dktools/dk3chks.ctr b/support/dktools/dk3chks.ctr
index 5d1c48c477..452d484660 100644
--- a/support/dktools/dk3chks.ctr
+++ b/support/dktools/dk3chks.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -177,7 +177,6 @@ dk3chksum_min_length(int cst)
/** Build binary checksum from file.
@param db Destination buffer.
- @param sz Size of \a db.
@param fipo File pointer for read access.
@param cst Checksum type.
@param app Application structure for diagnostics, may be NULL.
@@ -185,7 +184,7 @@ dk3chksum_min_length(int cst)
*/
static
int
-dk3checksum_binary(char *db, size_t sz, FILE *fipo, int cst, dk3_app_t *app)
+dk3checksum_binary(char *db, FILE *fipo, int cst, dk3_app_t *app)
{
int back = 0;
#if DK3_HAVE_OPENSSL_SHA_H
@@ -203,8 +202,11 @@ dk3checksum_binary(char *db, size_t sz, FILE *fipo, int cst, dk3_app_t *app)
#if DK3_HAVE_OPENSSL_RIPEMD_H
RIPEMD160_CTX ripemd160_ctx; /* RIPEMD-160 context. */
#endif
+#if DK3_HAVE_OPENSSL_RIPEMD_H || DK3_HAVE_OPENSSL_MD5_H \
+ || DK3_HAVE_OPENSSL_SHA_H
char buffer[4096]; /* Buffer for input. */
size_t rb = 0; /* Number of bytes read. */
+#endif
switch(cst) {
case DK3_MD_TYPE_MD5: {
#if DK3_HAVE_OPENSSL_MD5_H
@@ -350,7 +352,7 @@ dk3checksum_build_app(
if(((stb.ft) & (~(DK3_FT_SYMLINK))) == DK3_FT_REGULAR) {
fipo = dk3sf_fopen_app(fn, kw[0], app);
if(fipo) {
- if(dk3checksum_binary(mybuffer,sizeof(mybuffer),fipo, cst,app))
+ if(dk3checksum_binary(mybuffer,fipo, cst,app))
{
switch(cse) {
case DK3_DATA_ENCODING_HEX: {
diff --git a/support/dktools/dk3chks.h b/support/dktools/dk3chks.h
index 50cc0ab853..8730a2199c 100644
--- a/support/dktools/dk3chks.h
+++ b/support/dktools/dk3chks.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3chks.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3chks.ctr
*/
/** @file dk3chks.h Header file for the dk3chks module.
diff --git a/support/dktools/dk3conf.cross b/support/dktools/dk3conf.cross
index 62727a718a..54f586e2e2 100644
--- a/support/dktools/dk3conf.cross
+++ b/support/dktools/dk3conf.cross
@@ -11,7 +11,7 @@
#include "config.h"
#ifndef DK3_ON_WINDOWS
-#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#if _WIN32
/** On a Windows system. */
#define DK3_ON_WINDOWS 1
#else
diff --git a/support/dktools/dk3conf.cross.in b/support/dktools/dk3conf.cross.in
index 400f1d8124..befeb84a05 100644
--- a/support/dktools/dk3conf.cross.in
+++ b/support/dktools/dk3conf.cross.in
@@ -8,7 +8,7 @@
#define DK3_CONF_H_INCLUDED 1
#ifndef DK3_ON_WINDOWS
-#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#if _WIN32
/** On a Windows system. */
#define DK3_ON_WINDOWS 1
#else
diff --git a/support/dktools/dk3conf.h b/support/dktools/dk3conf.h
index 660e76fd09..21837a963c 100644
--- a/support/dktools/dk3conf.h
+++ b/support/dktools/dk3conf.h
@@ -8,7 +8,7 @@
#define DK3_CONF_H_INCLUDED 1
#ifndef DK3_ON_WINDOWS
-#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#if _WIN32
/** On a Windows system. */
#define DK3_ON_WINDOWS 1
#else
@@ -585,16 +585,82 @@
#endif
#ifndef DK3_HAVE_ISFINITE
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+/** DK3 version of HAVE_ISFINITE.
+*/
+#define DK3_HAVE_ISFINITE 1
+#else
/** DK3 version of HAVE_ISFINITE.
*/
#define DK3_HAVE_ISFINITE 0
#endif
+#endif
+
+#ifndef DK3_HAVE__FINITE
+/** DK3 version of HAVE__FINITE.
+*/
+#define DK3_HAVE__FINITE 1
+#endif
#ifndef DK3_HAVE_ISNORMAL
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+/** DK3 version of HAVE_ISNORMAL.
+*/
+#define DK3_HAVE_ISNORMAL 1
+#else
/** DK3 version of HAVE_ISNORMAL.
*/
#define DK3_HAVE_ISNORMAL 0
#endif
+#endif
+
+#ifndef DK3_HAVE_ISGREATEREQUAL
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+/** DK3 version of HAVE_ISGREATEREQUAL.
+*/
+#define DK3_HAVE_ISGREATEREQUAL 1
+#else
+/** DK3 version of HAVE_ISGREATEREQUAL.
+*/
+#define DK3_HAVE_ISGREATEREQUAL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_ISGREATER
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+/** DK3 version of HAVE_ISGREATER.
+*/
+#define DK3_HAVE_ISGREATER 1
+#else
+/** DK3 version of HAVE_ISGREATER.
+*/
+#define DK3_HAVE_ISGREATER 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_ISLESSEQUAL
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+/** DK3 version of HAVE_ISLESSEQUAL.
+*/
+#define DK3_HAVE_ISLESSEQUAL 1
+#else
+/** DK3 version of HAVE_ISLESSEQUAL.
+*/
+#define DK3_HAVE_ISLESSEQUAL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_ISLESS
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+/** DK3 version of HAVE_ISLESS.
+*/
+#define DK3_HAVE_ISLESS 0
+#else
+/** DK3 version of HAVE_ISLESS.
+*/
+#define DK3_HAVE_ISLESS 0
+#endif
+#endif
#ifndef DK3_HAVE_LABS
/** DK3 version of HAVE_LABS.
@@ -1510,6 +1576,7 @@
#ifndef DK3_HAVE_TWOS_COMPLEMENT
/** DK3 version of HAVE_TWOS_COMPLEMENT.
+CROSS-COMPILE: Correct if necessary.
*/
#define DK3_HAVE_TWOS_COMPLEMENT 1
#endif
@@ -2632,6 +2699,7 @@
#ifndef DK3_HAVE_IEEE_754_DOUBLE
/** DK3 version of HAVE_IEEE_754_DOUBLE.
+CROSS-COMPILE: Correct if necessary.
*/
#define DK3_HAVE_IEEE_754_DOUBLE 1
#endif
@@ -2669,7 +2737,7 @@
#ifndef DK3_HAVE_INODES
/** DK3 version of HAVE_INODES.
*/
-#define DK3_HAVE_INODES 1
+#define DK3_HAVE_INODES 0
#endif
#ifndef DK3_HAVE_INTMAX_T
@@ -2708,12 +2776,42 @@
#define DK3_HAVE_ISFINITE 1
#endif
+#ifndef DK3_HAVE__FINITE
+/** DK3 version of HAVE__FINITE.
+*/
+#define DK3_HAVE__FINITE 1
+#endif
+
#ifndef DK3_HAVE_ISNORMAL
/** DK3 version of HAVE_ISNORMAL.
*/
#define DK3_HAVE_ISNORMAL 1
#endif
+#ifndef DK3_HAVE_ISGREATEREQUAL
+/** DK3 version of HAVE_ISGREATEREQUAL.
+*/
+#define DK3_HAVE_ISGREATEREQUAL 1
+#endif
+
+#ifndef DK3_HAVE_ISGREATER
+/** DK3 version of HAVE_ISGREATER.
+*/
+#define DK3_HAVE_ISGREATER 1
+#endif
+
+#ifndef DK3_HAVE_ISLESSEQUAL
+/** DK3 version of HAVE_ISLESSEQUAL.
+*/
+#define DK3_HAVE_ISLESSEQUAL 1
+#endif
+
+#ifndef DK3_HAVE_ISLESS
+/** DK3 version of HAVE_ISLESS.
+*/
+#define DK3_HAVE_ISLESS 1
+#endif
+
#ifndef DK3_HAVE_JPEGLIB_H
/** DK3 version of HAVE_JPEGLIB_H.
*/
@@ -2729,7 +2827,7 @@
#ifndef DK3_HAVE_LARGEFILE64_SOURCE
/** DK3 version of HAVE_LARGEFILE64_SOURCE.
*/
-#define DK3_HAVE_LARGEFILE64_SOURCE 1
+#define DK3_HAVE_LARGEFILE64_SOURCE 0
#endif
#ifndef DK3_HAVE_LIBNETSNMP
@@ -2888,10 +2986,16 @@
#define DK3_HAVE_MYSQL_LIBRARY_INIT 0
#endif
+#ifndef DK3_HAVE_MARIADB_MYSQL_H
+/** DK3 version of HAVE_MARIADB_MYSQL_H.
+*/
+#define DK3_HAVE_MARIADB_MYSQL_H 1
+#endif
+
#ifndef DK3_HAVE_MYSQL_MYSQL_H
/** DK3 version of HAVE_MYSQL_MYSQL_H.
*/
-#define DK3_HAVE_MYSQL_MYSQL_H 1
+#define DK3_HAVE_MYSQL_MYSQL_H 0
#endif
#ifndef DK3_HAVE_MYSQL_H
@@ -2969,7 +3073,7 @@
#ifndef DK3_HAVE_PNG_GET_PIXELS_PER_INCH
/** DK3 version of HAVE_PNG_GET_PIXELS_PER_INCH.
*/
-#define DK3_HAVE_PNG_GET_PIXELS_PER_INCH 0
+#define DK3_HAVE_PNG_GET_PIXELS_PER_INCH 1
#endif
#ifndef DK3_HAVE_PNG_H
@@ -4151,7 +4255,7 @@
#ifndef DK3_HAVE_WX_CHARTYPE_H
/** DK3 version of HAVE_WX_CHARTYPE_H.
*/
-#define DK3_HAVE_WX_CHARTYPE_H 0
+#define DK3_HAVE_WX_CHARTYPE_H 1
#endif
#ifndef DK3_HAVE_WX_WXCHAR_H
@@ -4229,6 +4333,14 @@
#define DK3_MAX_PATH 4097
#endif
+#if DK3_HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+/** Use 64 bit file support.
+*/
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
#endif
/* ifndef DK3_CONF_H_INCLUDED */
diff --git a/support/dktools/dk3conf.h.end b/support/dktools/dk3conf.h.end
new file mode 100644
index 0000000000..0e083bf5ad
--- /dev/null
+++ b/support/dktools/dk3conf.h.end
@@ -0,0 +1,4 @@
+
+#endif
+/* ifndef DK3CONF_H_INCLUDED */
+
diff --git a/support/dktools/dk3conf.h.large b/support/dktools/dk3conf.h.large
new file mode 100644
index 0000000000..46e38d7b8c
--- /dev/null
+++ b/support/dktools/dk3conf.h.large
@@ -0,0 +1,9 @@
+
+#if DK3_HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+/** Use 64 bit file support.
+*/
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
diff --git a/support/dktools/dk3conf.h.start b/support/dktools/dk3conf.h.start
new file mode 100644
index 0000000000..9d45b98519
--- /dev/null
+++ b/support/dktools/dk3conf.h.start
@@ -0,0 +1,21 @@
+/*
+Copyright 2020-@THISYEAR@, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/** @file dk3conf.h Fixed configure results.
+*/
+
+#ifndef DK3CONF_H_INCLUDED
+/** Protection against multiple inclusion.
+*/
+#define DK3CONF_H_INCLUDED 1
+
+#ifndef DK3_ON_WINDOWS
+#if _WIN32
+#define DK3_ON_WINDOWS 1
+#else
+#define DK3_ON_WINDOWS 0
+#endif
+#endif
+
diff --git a/support/dktools/dk3conf.new b/support/dktools/dk3conf.new
new file mode 100644
index 0000000000..b78eef11ed
--- /dev/null
+++ b/support/dktools/dk3conf.new
@@ -0,0 +1,4248 @@
+/** @file dk3conf.h Configuration for DK3 libraries.
+ Features: Include files, functions, sizes,
+ and endianness.
+*/
+
+#ifndef DK3_CONF_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK3_CONF_H_INCLUDED 1
+
+#ifndef DK3_ON_WINDOWS
+#if _WIN32
+/** On a Windows system. */
+#define DK3_ON_WINDOWS 1
+#else
+/** Not on a Windows system. */
+#define DK3_ON_WINDOWS 0
+#endif
+#endif
+/** ifndef DK3_ON_WINDOWS */
+
+#if DK3_ON_WINDOWS
+
+#ifndef DK3_HAVE_ACOSH
+/** DK3 version of HAVE_ACOSH.
+*/
+#define DK3_HAVE_ACOSH 0
+#endif
+
+#ifndef DK3_HAVE_ACOSHL
+/** DK3 version of HAVE_ACOSHL.
+*/
+#define DK3_HAVE_ACOSHL 1
+#endif
+
+#ifndef DK3_HAVE_ACOSL
+/** DK3 version of HAVE_ACOSL.
+*/
+#define DK3_HAVE_ACOSL 1
+#endif
+
+#ifndef DK3_HAVE_ALLOC_H
+/** DK3 version of HAVE_ALLOC_H.
+*/
+#define DK3_HAVE_ALLOC_H 0
+#endif
+
+#ifndef DK3_HAVE_ARPA_INET_H
+/** DK3 version of HAVE_ARPA_INET_H.
+*/
+#define DK3_HAVE_ARPA_INET_H 0
+#endif
+
+#ifndef DK3_HAVE_ASINH
+/** DK3 version of HAVE_ASINH.
+*/
+#define DK3_HAVE_ASINH 0
+#endif
+
+#ifndef DK3_HAVE_ASINHL
+/** DK3 version of HAVE_ASINHL.
+*/
+#define DK3_HAVE_ASINHL 1
+#endif
+
+#ifndef DK3_HAVE_ASINL
+/** DK3 version of HAVE_ASINL.
+*/
+#define DK3_HAVE_ASINL 1
+#endif
+
+#ifndef DK3_HAVE_ATAN2
+/** DK3 version of HAVE_ATAN2.
+*/
+#define DK3_HAVE_ATAN2 1
+#endif
+
+#ifndef DK3_HAVE_ATAN2L
+/** DK3 version of HAVE_ATAN2L.
+*/
+#define DK3_HAVE_ATAN2L 1
+#endif
+
+#ifndef DK3_HAVE_ATANH
+/** DK3 version of HAVE_ATANH.
+*/
+#define DK3_HAVE_ATANH 0
+#endif
+
+#ifndef DK3_HAVE_ATANHL
+/** DK3 version of HAVE_ATANHL.
+*/
+#define DK3_HAVE_ATANHL 1
+#endif
+
+#ifndef DK3_HAVE_ATANL
+/** DK3 version of HAVE_ATANL.
+*/
+#define DK3_HAVE_ATANL 1
+#endif
+
+#ifndef DK3_HAVE_BACKSLASH
+/** DK3 version of HAVE_BACKSLASH.
+*/
+#define DK3_HAVE_BACKSLASH 1
+#endif
+
+#ifndef DK3_HAVE_BCMP
+/** DK3 version of HAVE_BCMP.
+*/
+#define DK3_HAVE_BCMP 0
+#endif
+
+#ifndef DK3_HAVE_BCOPY
+/** DK3 version of HAVE_BCOPY.
+*/
+#define DK3_HAVE_BCOPY 0
+#endif
+
+#ifndef DK3_HAVE_BZERO
+/** DK3 version of HAVE_BZERO.
+*/
+#define DK3_HAVE_BZERO 0
+#endif
+
+#ifndef DK3_HAVE_CEIL
+/** DK3 version of HAVE_CEIL.
+*/
+#define DK3_HAVE_CEIL 1
+#endif
+
+#ifndef DK3_HAVE_CEILL
+/** DK3 version of HAVE_CEILL.
+*/
+#define DK3_HAVE_CEILL 1
+#endif
+
+#ifndef DK3_HAVE_CHDIR
+/** DK3 version of HAVE_CHDIR.
+*/
+#define DK3_HAVE_CHDIR 1
+#endif
+
+#ifndef DK3_HAVE_CHMOD
+/** DK3 version of HAVE_CHMOD.
+*/
+#define DK3_HAVE_CHMOD 0
+#endif
+
+#ifndef DK3_HAVE_CHOWN
+/** DK3 version of HAVE_CHOWN.
+*/
+#define DK3_HAVE_CHOWN 0
+#endif
+
+#ifndef DK3_HAVE_CLOSEDIR
+/** DK3 version of HAVE_CLOSEDIR.
+*/
+#define DK3_HAVE_CLOSEDIR 0
+#endif
+
+#ifndef DK3_HAVE_CONIO_H
+/** DK3 version of HAVE_CONIO_H.
+*/
+#define DK3_HAVE_CONIO_H 1
+#endif
+
+#ifndef DK3_HAVE_CONST
+/** DK3 version of HAVE_CONST.
+*/
+#define DK3_HAVE_CONST 1
+#endif
+
+#ifndef DK3_HAVE_COSHL
+/** DK3 version of HAVE_COSHL.
+*/
+#define DK3_HAVE_COSHL 1
+#endif
+
+#ifndef DK3_HAVE_COSL
+/** DK3 version of HAVE_COSL.
+*/
+#define DK3_HAVE_COSL 1
+#endif
+
+#ifndef DK3_HAVE_CTYPE_H
+/** DK3 version of HAVE_CTYPE_H.
+*/
+#define DK3_HAVE_CTYPE_H 1
+#endif
+
+#ifndef DK3_HAVE_DEV_RANDOM
+/** DK3 version of HAVE_DEV_RANDOM.
+*/
+#define DK3_HAVE_DEV_RANDOM 0
+#endif
+
+#ifndef DK3_HAVE_DEV_URANDOM
+/** DK3 version of HAVE_DEV_URANDOM.
+*/
+#define DK3_HAVE_DEV_URANDOM 0
+#endif
+
+#ifndef DK3_HAVE_DIRECT_H
+/** DK3 version of HAVE_DIRECT_H.
+*/
+#define DK3_HAVE_DIRECT_H 1
+#endif
+
+#ifndef DK3_HAVE_DIRENT_H
+/** DK3 version of HAVE_DIRENT_H.
+*/
+#define DK3_HAVE_DIRENT_H 0
+#endif
+
+#ifndef DK3_HAVE_DIR_H
+/** DK3 version of HAVE_DIR_H.
+*/
+#define DK3_HAVE_DIR_H 0
+#endif
+
+#ifndef DK3_HAVE_DOS_H
+/** DK3 version of HAVE_DOS_H.
+*/
+#define DK3_HAVE_DOS_H 1
+#endif
+
+#ifndef DK3_HAVE_ENDGRENT
+/** DK3 version of HAVE_ENDGRENT.
+*/
+#define DK3_HAVE_ENDGRENT 0
+#endif
+
+#ifndef DK3_HAVE_ENDPWENT
+/** DK3 version of HAVE_ENDPWENT.
+*/
+#define DK3_HAVE_ENDPWENT 0
+#endif
+
+#ifndef DK3_HAVE_ERRNO_H
+/** DK3 version of HAVE_ERRNO_H.
+*/
+#define DK3_HAVE_ERRNO_H 1
+#endif
+
+#ifndef DK3_HAVE_ERR_H
+/** DK3 version of HAVE_ERR_H.
+*/
+#define DK3_HAVE_ERR_H 0
+#endif
+
+#ifndef DK3_HAVE_EXPL
+/** DK3 version of HAVE_EXPL.
+*/
+#define DK3_HAVE_EXPL 1
+#endif
+
+#ifndef DK3_HAVE_FABS
+/** DK3 version of HAVE_FABS.
+*/
+#define DK3_HAVE_FABS 1
+#endif
+
+#ifndef DK3_HAVE_FABSL
+/** DK3 version of HAVE_FABSL.
+*/
+#define DK3_HAVE_FABSL 1
+#endif
+
+#ifndef DK3_HAVE_FCLOSE
+/** DK3 version of HAVE_FCLOSE.
+*/
+#define DK3_HAVE_FCLOSE 1
+#endif
+
+#ifndef DK3_HAVE_FCNTL_H
+/** DK3 version of HAVE_FCNTL_H.
+*/
+#define DK3_HAVE_FCNTL_H 1
+#endif
+
+#ifndef DK3_HAVE_FENV_H
+/** DK3 version of HAVE_FENV_H.
+*/
+#define DK3_HAVE_FENV_H 0
+#endif
+
+#ifndef DK3_HAVE_FEOF
+/** DK3 version of HAVE_FEOF.
+*/
+#define DK3_HAVE_FEOF 1
+#endif
+
+#ifndef DK3_HAVE_FERROR
+/** DK3 version of HAVE_FERROR.
+*/
+#define DK3_HAVE_FERROR 1
+#endif
+
+#ifndef DK3_HAVE_FETESTEXCEPT
+/** DK3 version of HAVE_FETESTEXCEPT.
+*/
+#define DK3_HAVE_FETESTEXCEPT 0
+#endif
+
+#ifndef DK3_HAVE_FFLUSH
+/** DK3 version of HAVE_FFLUSH.
+*/
+#define DK3_HAVE_FFLUSH 1
+#endif
+
+#ifndef DK3_HAVE_FLOAT_H
+/** DK3 version of HAVE_FLOAT_H.
+*/
+#define DK3_HAVE_FLOAT_H 1
+#endif
+
+#ifndef DK3_HAVE_FLOOR
+/** DK3 version of HAVE_FLOOR.
+*/
+#define DK3_HAVE_FLOOR 1
+#endif
+
+#ifndef DK3_HAVE_FLOORL
+/** DK3 version of HAVE_FLOORL.
+*/
+#define DK3_HAVE_FLOORL 1
+#endif
+
+#ifndef DK3_HAVE_FNCASEINS
+/** DK3 version of HAVE_FNCASEINS.
+*/
+#define DK3_HAVE_FNCASEINS 1
+#endif
+
+#ifndef DK3_HAVE_FOPEN
+/** DK3 version of HAVE_FOPEN.
+*/
+#define DK3_HAVE_FOPEN 1
+#endif
+
+#ifndef DK3_HAVE_FOPEN64
+/** DK3 version of HAVE_FOPEN64.
+*/
+#define DK3_HAVE_FOPEN64 0
+#endif
+
+#ifndef DK3_HAVE_FOPEN_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_FOPEN_S.
+*/
+#define DK3_HAVE_FOPEN_S 1
+#else
+/** DK3 version of HAVE_FOPEN_S.
+*/
+#define DK3_HAVE_FOPEN_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_FORK
+/** DK3 version of HAVE_FORK.
+*/
+#define DK3_HAVE_FORK 0
+#endif
+
+#ifndef DK3_HAVE_FPCLASSIFY
+/** DK3 version of HAVE_FPCLASSIFY.
+*/
+#define DK3_HAVE_FPCLASSIFY 0
+#endif
+
+#ifndef DK3_HAVE_FREAD
+/** DK3 version of HAVE_FREAD.
+*/
+#define DK3_HAVE_FREAD 0
+#endif
+
+#ifndef DK3_HAVE_FREE
+/** DK3 version of HAVE_FREE.
+*/
+#define DK3_HAVE_FREE 1
+#endif
+
+#ifndef DK3_HAVE_FWRITE
+/** DK3 version of HAVE_FWRITE.
+*/
+#define DK3_HAVE_FWRITE 0
+#endif
+
+#ifndef DK3_HAVE_GDBM_H
+/** DK3 version of HAVE_GDBM_H.
+*/
+#define DK3_HAVE_GDBM_H 0
+#endif
+
+#ifndef DK3_HAVE_GETADDRINFO
+/** DK3 version of HAVE_GETADDRINFO.
+*/
+#define DK3_HAVE_GETADDRINFO 1
+#endif
+
+#ifndef DK3_HAVE_GETCWD
+/** DK3 version of HAVE_GETCWD.
+*/
+#define DK3_HAVE_GETCWD 1
+#endif
+
+#ifndef DK3_HAVE_GETENV
+/** DK3 version of HAVE_GETENV.
+*/
+#define DK3_HAVE_GETENV 1
+#endif
+
+#ifndef DK3_HAVE_GETEUID
+/** DK3 version of HAVE_GETEUID.
+*/
+#define DK3_HAVE_GETEUID 0
+#endif
+
+#ifndef DK3_HAVE_GETGRENT
+/** DK3 version of HAVE_GETGRENT.
+*/
+#define DK3_HAVE_GETGRENT 0
+#endif
+
+#ifndef DK3_HAVE_GETGRGID
+/** DK3 version of HAVE_GETGRGID.
+*/
+#define DK3_HAVE_GETGRGID 0
+#endif
+
+#ifndef DK3_HAVE_GETGRNAM
+/** DK3 version of HAVE_GETGRNAM.
+*/
+#define DK3_HAVE_GETGRNAM 0
+#endif
+
+#ifndef DK3_HAVE_GETHOSTBYNAME
+/** DK3 version of HAVE_GETHOSTBYNAME.
+*/
+#define DK3_HAVE_GETHOSTBYNAME 1
+#endif
+
+#ifndef DK3_HAVE_GETHOSTNAME
+/** DK3 version of HAVE_GETHOSTNAME.
+*/
+#define DK3_HAVE_GETHOSTNAME 0
+#endif
+
+#ifndef DK3_HAVE_GETPEERNAME
+/** DK3 version of HAVE_GETPEERNAME.
+*/
+#define DK3_HAVE_GETPEERNAME 1
+#endif
+
+#ifndef DK3_HAVE_GETPID
+/** DK3 version of HAVE_GETPID.
+*/
+#define DK3_HAVE_GETPID 1
+#endif
+
+#ifndef DK3_HAVE_GETPWENT
+/** DK3 version of HAVE_GETPWENT.
+*/
+#define DK3_HAVE_GETPWENT 0
+#endif
+
+#ifndef DK3_HAVE_GETPWNAM
+/** DK3 version of HAVE_GETPWNAM.
+*/
+#define DK3_HAVE_GETPWNAM 0
+#endif
+
+#ifndef DK3_HAVE_GETPWUID
+/** DK3 version of HAVE_GETPWUID.
+*/
+#define DK3_HAVE_GETPWUID 0
+#endif
+
+#ifndef DK3_HAVE_GETRLIMIT
+/** DK3 version of HAVE_GETRLIMIT.
+*/
+#define DK3_HAVE_GETRLIMIT 0
+#endif
+
+#ifndef DK3_HAVE_GETSOCKNAME
+/** DK3 version of HAVE_GETSOCKNAME.
+*/
+#define DK3_HAVE_GETSOCKNAME 1
+#endif
+
+#ifndef DK3_HAVE_GETUID
+/** DK3 version of HAVE_GETUID.
+*/
+#define DK3_HAVE_GETUID 0
+#endif
+
+#ifndef DK3_HAVE_GRP_H
+/** DK3 version of HAVE_GRP_H.
+*/
+#define DK3_HAVE_GRP_H 0
+#endif
+
+#ifndef DK3_HAVE_HTONL
+/** DK3 version of HAVE_HTONL.
+*/
+#define DK3_HAVE_HTONL 1
+#endif
+
+#ifndef DK3_HAVE_IEEE_754_DOUBLE
+/** DK3 version of HAVE_IEEE_754_DOUBLE.
+*/
+#define DK3_HAVE_IEEE_754_DOUBLE 1
+#endif
+
+#ifndef DK3_HAVE_IN6_ADDR
+/** DK3 version of HAVE_IN6_ADDR.
+*/
+#define DK3_HAVE_IN6_ADDR 1
+#endif
+
+#ifndef DK3_HAVE_INET_ADDR
+/** DK3 version of HAVE_INET_ADDR.
+*/
+#define DK3_HAVE_INET_ADDR 0
+#endif
+
+#ifndef DK3_HAVE_INET_ATON
+/** DK3 version of HAVE_INET_ATON.
+*/
+#define DK3_HAVE_INET_ATON 0
+#endif
+
+#ifndef DK3_HAVE_INET_PTON
+/** DK3 version of HAVE_INET_PTON.
+*/
+#define DK3_HAVE_INET_PTON 0
+#endif
+
+#ifndef DK3_HAVE_INITSTATE
+/** DK3 version of HAVE_INITSTATE.
+*/
+#define DK3_HAVE_INITSTATE 0
+#endif
+
+#ifndef DK3_HAVE_INODES
+/** DK3 version of HAVE_INODES.
+*/
+#define DK3_HAVE_INODES 0
+#endif
+
+#ifndef DK3_HAVE_INTMAX_T
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_INTMAX_T.
+*/
+#define DK3_HAVE_INTMAX_T 1
+#else
+/** DK3 version of HAVE_INTMAX_T.
+*/
+#define DK3_HAVE_INTMAX_T 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_INTTYPES_H
+/** DK3 version of HAVE_INTTYPES_H.
+*/
+#define DK3_HAVE_INTTYPES_H 0
+#endif
+
+#ifndef DK3_HAVE_IN_ADDR
+/** DK3 version of HAVE_IN_ADDR.
+*/
+#define DK3_HAVE_IN_ADDR 1
+#endif
+
+#ifndef DK3_HAVE_IO_H
+/** DK3 version of HAVE_IO_H.
+*/
+#define DK3_HAVE_IO_H 1
+#endif
+
+#ifndef DK3_HAVE_ISATTY
+/** DK3 version of HAVE_ISATTY.
+*/
+#define DK3_HAVE_ISATTY 1
+#endif
+
+#ifndef DK3_HAVE_ISFINITE
+/** DK3 version of HAVE_ISFINITE.
+*/
+#define DK3_HAVE_ISFINITE 0
+#endif
+
+#ifndef DK3_HAVE_ISNORMAL
+/** DK3 version of HAVE_ISNORMAL.
+*/
+#define DK3_HAVE_ISNORMAL 0
+#endif
+
+#ifndef DK3_HAVE_LABS
+/** DK3 version of HAVE_LABS.
+*/
+#define DK3_HAVE_LABS 1
+#endif
+
+#ifndef DK3_HAVE_LARGEFILE64_SOURCE
+/** DK3 version of HAVE_LARGEFILE64_SOURCE.
+*/
+#define DK3_HAVE_LARGEFILE64_SOURCE 0
+#endif
+
+#ifndef DK3_HAVE_LIMITS_H
+/** DK3 version of HAVE_LIMITS_H.
+*/
+#define DK3_HAVE_LIMITS_H 1
+#endif
+
+#ifndef DK3_HAVE_LOCALE_H
+/** DK3 version of HAVE_LOCALE_H.
+*/
+#define DK3_HAVE_LOCALE_H 1
+#endif
+
+#ifndef DK3_HAVE_LOCALTIME
+/** DK3 version of HAVE_LOCALTIME.
+*/
+#define DK3_HAVE_LOCALTIME 1
+#endif
+
+#ifndef DK3_HAVE_LOCALTIME
+/** DK3 version of HAVE_LOCALTIME.
+*/
+#define DK3_HAVE_LOCALTIME 1
+#endif
+
+#ifndef DK3_HAVE_LOCALTIME_R
+/** DK3 version of HAVE_LOCALTIME_R.
+*/
+#define DK3_HAVE_LOCALTIME_R 0
+#endif
+
+#ifndef DK3_HAVE_LOCALTIME_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_LOCALTIME_S.
+*/
+#define DK3_HAVE_LOCALTIME_S 1
+#else
+/** DK3 version of HAVE_LOCALTIME_S.
+*/
+#define DK3_HAVE_LOCALTIME_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_LOGL
+/** DK3 version of HAVE_LOGL.
+*/
+#define DK3_HAVE_LOGL 1
+#endif
+
+#ifndef DK3_HAVE_LONG_DOUBLE
+/** DK3 version of HAVE_LONG_DOUBLE.
+*/
+#define DK3_HAVE_LONG_DOUBLE 1
+#endif
+
+#ifndef DK3_HAVE_LONG_LONG
+/** DK3 version of HAVE_LONG_LONG.
+*/
+#define DK3_HAVE_LONG_LONG 1
+#endif
+
+#ifndef DK3_HAVE_LRAND48
+/** DK3 version of HAVE_LRAND48.
+*/
+#define DK3_HAVE_LRAND48 0
+#endif
+
+#ifndef DK3_HAVE_LSTAT
+/** DK3 version of HAVE_LSTAT.
+*/
+#define DK3_HAVE_LSTAT 1
+#endif
+
+#ifndef DK3_HAVE_LSTAT32
+/** DK3 version of HAVE_LSTAT32.
+*/
+#define DK3_HAVE_LSTAT32 1
+#endif
+
+#ifndef DK3_HAVE_LSTAT64
+/** DK3 version of HAVE_LSTAT64.
+*/
+#define DK3_HAVE_LSTAT64 1
+#endif
+
+#ifndef DK3_HAVE_MALLOC
+/** DK3 version of HAVE_MALLOC.
+*/
+#define DK3_HAVE_MALLOC 1
+#endif
+
+#ifndef DK3_HAVE_MALLOC_H
+/** DK3 version of HAVE_MALLOC_H.
+*/
+#define DK3_HAVE_MALLOC_H 1
+#endif
+
+#ifndef DK3_HAVE_MATH_H
+/** DK3 version of HAVE_MATH_H.
+*/
+#define DK3_HAVE_MATH_H 1
+#endif
+
+#ifndef DK3_HAVE_MEMCMP
+/** DK3 version of HAVE_MEMCMP.
+*/
+#define DK3_HAVE_MEMCMP 1
+#endif
+
+#ifndef DK3_HAVE_MEMCPY
+/** DK3 version of HAVE_MEMCPY.
+*/
+#define DK3_HAVE_MEMCPY 1
+#endif
+
+#ifndef DK3_HAVE_MEMSET
+/** DK3 version of HAVE_MEMSET.
+*/
+#define DK3_HAVE_MEMSET 1
+#endif
+
+#ifndef DK3_HAVE_MKDIR
+/** DK3 version of HAVE_MKDIR.
+*/
+#define DK3_HAVE_MKDIR 0
+#endif
+
+#ifndef DK3_HAVE_MKDIR2
+/** DK3 version of HAVE_MKDIR2.
+*/
+#define DK3_HAVE_MKDIR2 0
+#endif
+
+#ifndef DK3_HAVE_MPCTL
+/** DK3 version of HAVE_MPCTL.
+*/
+#define DK3_HAVE_MPCTL 0
+#endif
+
+#ifndef DK3_HAVE_NDBM_H
+/** DK3 version of HAVE_NDBM_H.
+*/
+#define DK3_HAVE_NDBM_H 0
+#endif
+
+#ifndef DK3_HAVE_NETDB_H
+/** DK3 version of HAVE_NETDB_H.
+*/
+#define DK3_HAVE_NETDB_H 0
+#endif
+
+#ifndef DK3_HAVE_NETINET_IN_H
+/** DK3 version of HAVE_NETINET_IN_H.
+*/
+#define DK3_HAVE_NETINET_IN_H 0
+#endif
+
+#ifndef DK3_HAVE_NRAND48
+/** DK3 version of HAVE_NRAND48.
+*/
+#define DK3_HAVE_NRAND48 0
+#endif
+
+#ifndef DK3_HAVE_OPENDIR
+/** DK3 version of HAVE_OPENDIR.
+*/
+#define DK3_HAVE_OPENDIR 0
+#endif
+
+#ifndef DK3_HAVE_PNG_GET_PIXELS_PER_INCH
+/** DK3 version of HAVE_PNG_GET_PIXELS_PER_INCH.
+*/
+#define DK3_HAVE_PNG_GET_PIXELS_PER_INCH 1
+#endif
+
+#ifndef DK3_HAVE_POPEN
+/** DK3 version of HAVE_POPEN.
+*/
+#define DK3_HAVE_POPEN 0
+#endif
+
+#ifndef DK3_HAVE_PROCESS_H
+/** DK3 version of HAVE_PROCESS_H.
+*/
+#define DK3_HAVE_PROCESS_H 1
+#endif
+
+#ifndef DK3_HAVE_PTHREAD_H
+/** DK3 version of HAVE_PTHREAD_H.
+*/
+#define DK3_HAVE_PTHREAD_H 0
+#endif
+
+#ifndef DK3_HAVE_PWD_H
+/** DK3 version of HAVE_PWD_H.
+*/
+#define DK3_HAVE_PWD_H 0
+#endif
+
+#ifndef DK3_HAVE_RAND
+/** DK3 version of HAVE_RAND.
+*/
+#define DK3_HAVE_RAND 0
+#endif
+
+#ifndef DK3_HAVE_RANDOM
+/** DK3 version of HAVE_RANDOM.
+*/
+#define DK3_HAVE_RANDOM 0
+#endif
+
+#ifndef DK3_HAVE_READ
+/** DK3 version of HAVE_READ.
+*/
+#define DK3_HAVE_READ 1
+#endif
+
+#ifndef DK3_HAVE_READDIR
+/** DK3 version of HAVE_READDIR.
+*/
+#define DK3_HAVE_READDIR 0
+#endif
+
+#ifndef DK3_HAVE_RFC_2249
+/** DK3 version of HAVE_RFC_2249.
+*/
+#define DK3_HAVE_RFC_2249 0
+#endif
+
+#ifndef DK3_HAVE_RINT
+/** DK3 version of HAVE_RINT.
+*/
+#define DK3_HAVE_RINT 0
+#endif
+
+#ifndef DK3_HAVE_RINTL
+/** DK3 version of HAVE_RINTL.
+*/
+#define DK3_HAVE_RINTL 1
+#endif
+
+#ifndef DK3_HAVE_RMDIR
+/** DK3 version of HAVE_RMDIR.
+*/
+#define DK3_HAVE_RMDIR 0
+#endif
+
+#ifndef DK3_HAVE_SEED48
+/** DK3 version of HAVE_SEED48.
+*/
+#define DK3_HAVE_SEED48 0
+#endif
+
+#ifndef DK3_HAVE_SELECT
+/** DK3 version of HAVE_SELECT.
+*/
+#define DK3_HAVE_SELECT 1
+#endif
+
+#ifndef DK3_HAVE_SETGID
+/** DK3 version of HAVE_SETGID.
+*/
+#define DK3_HAVE_SETGID 0
+#endif
+
+#ifndef DK3_HAVE_SETGRENT
+/** DK3 version of HAVE_SETGRENT.
+*/
+#define DK3_HAVE_SETGRENT 0
+#endif
+
+#ifndef DK3_HAVE_SETJMP_H
+/** DK3 version of HAVE_SETJMP_H.
+*/
+#define DK3_HAVE_SETJMP_H 1
+#endif
+
+#ifndef DK3_HAVE_SETPGRP
+/** DK3 version of HAVE_SETPGRP.
+*/
+#define DK3_HAVE_SETPGRP 0
+#endif
+
+#ifndef DK3_HAVE_SETPWENT
+/** DK3 version of HAVE_SETPWENT.
+*/
+#define DK3_HAVE_SETPWENT 0
+#endif
+
+#ifndef DK3_HAVE_SETSID
+/** DK3 version of HAVE_SETSID.
+*/
+#define DK3_HAVE_SETSID 0
+#endif
+
+#ifndef DK3_HAVE_SETSOCKOPT
+/** DK3 version of HAVE_SETSOCKOPT.
+*/
+#define DK3_HAVE_SETSOCKOPT 1
+#endif
+
+#ifndef DK3_HAVE_SETSTATE
+/** DK3 version of HAVE_SETSTATE.
+*/
+#define DK3_HAVE_SETSTATE 0
+#endif
+
+#ifndef DK3_HAVE_SETUID
+/** DK3 version of HAVE_SETUID.
+*/
+#define DK3_HAVE_SETUID 0
+#endif
+
+#ifndef DK3_HAVE_SETVBUF
+/** DK3 version of HAVE_SETVBUF.
+*/
+#define DK3_HAVE_SETVBUF 1
+#endif
+
+#ifndef DK3_HAVE_SHADOW_H
+/** DK3 version of HAVE_SHADOW_H.
+*/
+#define DK3_HAVE_SHADOW_H 0
+#endif
+
+#ifndef DK3_HAVE_SIGACTION
+/** DK3 version of HAVE_SIGACTION.
+*/
+#define DK3_HAVE_SIGACTION 0
+#endif
+
+#ifndef DK3_HAVE_SIGNAL
+/** DK3 version of HAVE_SIGNAL.
+*/
+#define DK3_HAVE_SIGNAL 1
+#endif
+
+#ifndef DK3_HAVE_SIGNAL_H
+/** DK3 version of HAVE_SIGNAL_H.
+*/
+#define DK3_HAVE_SIGNAL_H 1
+#endif
+
+#ifndef DK3_HAVE_SIGSET
+/** DK3 version of HAVE_SIGSET.
+*/
+#define DK3_HAVE_SIGSET 0
+#endif
+
+#ifndef DK3_HAVE_SIG_ATOMIC_T
+/** DK3 version of HAVE_SIG_ATOMIC_T.
+*/
+#define DK3_HAVE_SIG_ATOMIC_T 0
+#endif
+
+#ifndef DK3_HAVE_SINHL
+/** DK3 version of HAVE_SINHL.
+*/
+#define DK3_HAVE_SINHL 1
+#endif
+
+#ifndef DK3_HAVE_SINL
+/** DK3 version of HAVE_SINL.
+*/
+#define DK3_HAVE_SINL 1
+#endif
+
+#ifndef DK3_HAVE_SNPRINTF
+/** DK3 version of HAVE_SNPRINTF.
+*/
+#define DK3_HAVE_SNPRINTF 0
+#endif
+
+#ifndef DK3_HAVE_SOCKET
+/** DK3 version of HAVE_SOCKET.
+*/
+#define DK3_HAVE_SOCKET 1
+#endif
+
+#ifndef DK3_HAVE_SOCKLEN_T
+/** DK3 version of HAVE_SOCKLEN_T.
+*/
+#define DK3_HAVE_SOCKLEN_T 0
+#endif
+
+#ifndef DK3_HAVE_SPRINTF_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_SPRINTF_S.
+*/
+#define DK3_HAVE_SPRINTF_S 1
+#else
+/** DK3 version of HAVE_SPRINTF_S.
+*/
+#define DK3_HAVE_SPRINTF_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_SQRTL
+/** DK3 version of HAVE_SQRTL.
+*/
+#define DK3_HAVE_SQRTL 1
+#endif
+
+#ifndef DK3_HAVE_SRAND
+/** DK3 version of HAVE_SRAND.
+*/
+#define DK3_HAVE_SRAND 0
+#endif
+
+#ifndef DK3_HAVE_SSCANF_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_SSCANF_S.
+*/
+#define DK3_HAVE_SSCANF_S 1
+#else
+/** DK3 version of HAVE_SSCANF_S.
+*/
+#define DK3_HAVE_SSCANF_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_SSIZE_T
+/** DK3 version of HAVE_SSIZE_T.
+*/
+#define DK3_HAVE_SSIZE_T 0
+#endif
+
+#ifndef DK3_HAVE_STAT
+/** DK3 version of HAVE_STAT.
+*/
+#define DK3_HAVE_STAT 1
+#endif
+
+#ifndef DK3_HAVE_STAT32
+/** DK3 version of HAVE_STAT32.
+*/
+#define DK3_HAVE_STAT32 1
+#endif
+
+#ifndef DK3_HAVE_STAT64
+/** DK3 version of HAVE_STAT64.
+*/
+#define DK3_HAVE_STAT64 1
+#endif
+
+#ifndef DK3_HAVE_STDARG_H
+/** DK3 version of HAVE_STDARG_H.
+*/
+#define DK3_HAVE_STDARG_H 1
+#endif
+
+#ifndef DK3_HAVE_STDDEF_H
+/** DK3 version of HAVE_STDDEF_H.
+*/
+#define DK3_HAVE_STDDEF_H 1
+#endif
+
+#ifndef DK3_HAVE_STDINT_H
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_STDINT_H.
+*/
+#define DK3_HAVE_STDINT_H 1
+#else
+/** DK3 version of HAVE_STDINT_H.
+*/
+#define DK3_HAVE_STDINT_H 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STDIO_H
+/** DK3 version of HAVE_STDIO_H.
+*/
+#define DK3_HAVE_STDIO_H 1
+#endif
+
+#ifndef DK3_HAVE_STDLIB_H
+/** DK3 version of HAVE_STDLIB_H.
+*/
+#define DK3_HAVE_STDLIB_H 1
+#endif
+
+#ifndef DK3_HAVE_STRCASECMP
+/** DK3 version of HAVE_STRCASECMP.
+*/
+#define DK3_HAVE_STRCASECMP 0
+#endif
+
+#ifndef DK3_HAVE_STRCAT
+/** DK3 version of HAVE_STRCAT.
+*/
+#define DK3_HAVE_STRCAT 1
+#endif
+
+#ifndef DK3_HAVE_STRCAT_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_STRCAT_S.
+*/
+#define DK3_HAVE_STRCAT_S 1
+#else
+/** DK3 version of HAVE_STRCAT_S.
+*/
+#define DK3_HAVE_STRCAT_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STRCHR
+/** DK3 version of HAVE_STRCHR.
+*/
+#define DK3_HAVE_STRCHR 1
+#endif
+
+#ifndef DK3_HAVE_STRCMP
+/** DK3 version of HAVE_STRCMP.
+*/
+#define DK3_HAVE_STRCMP 1
+#endif
+
+#ifndef DK3_HAVE_STRCPY
+/** DK3 version of HAVE_STRCPY.
+*/
+#define DK3_HAVE_STRCPY 1
+#endif
+
+#ifndef DK3_HAVE_STRCPY_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_STRCPY_S.
+*/
+#define DK3_HAVE_STRCPY_S 1
+#else
+/** DK3 version of HAVE_STRCPY_S.
+*/
+#define DK3_HAVE_STRCPY_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STRDUP
+/** DK3 version of HAVE_STRDUP.
+*/
+#define DK3_HAVE_STRDUP 0
+#endif
+
+#ifndef DK3_HAVE_STRERROR
+/** DK3 version of HAVE_STRERROR.
+*/
+#define DK3_HAVE_STRERROR 1
+#endif
+
+#ifndef DK3_HAVE_STRICMP
+/** DK3 version of HAVE_STRICMP.
+*/
+#define DK3_HAVE_STRICMP 0
+#endif
+
+#ifndef DK3_HAVE_STRINGS_H
+/** DK3 version of HAVE_STRINGS_H.
+*/
+#define DK3_HAVE_STRINGS_H 0
+#endif
+
+#ifndef DK3_HAVE_STRING_H
+/** DK3 version of HAVE_STRING_H.
+*/
+#define DK3_HAVE_STRING_H 1
+#endif
+
+#ifndef DK3_HAVE_STRLEN
+/** DK3 version of HAVE_STRLEN.
+*/
+#define DK3_HAVE_STRLEN 1
+#endif
+
+#ifndef DK3_HAVE_STRNCMP
+/** DK3 version of HAVE_STRNCMP.
+*/
+#define DK3_HAVE_STRNCMP 1
+#endif
+
+#ifndef DK3_HAVE_STRNCPY
+/** DK3 version of HAVE_STRNCPY.
+*/
+#define DK3_HAVE_STRNCPY 1
+#endif
+
+#ifndef DK3_HAVE_STRNCPY_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_STRNCPY_S.
+*/
+#define DK3_HAVE_STRNCPY_S 1
+#else
+/** DK3 version of HAVE_STRNCPY_S.
+*/
+#define DK3_HAVE_STRNCPY_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STROPTS_H
+/** DK3 version of HAVE_STROPTS_H.
+*/
+#define DK3_HAVE_STROPTS_H 0
+#endif
+
+#ifndef DK3_HAVE_STRRCHR
+/** DK3 version of HAVE_STRRCHR.
+*/
+#define DK3_HAVE_STRRCHR 1
+#endif
+
+#ifndef DK3_HAVE_STRTOD
+/** DK3 version of HAVE_STRTOD.
+*/
+#define DK3_HAVE_STRTOD 1
+#endif
+
+#ifndef DK3_HAVE_STRTOIMAX
+#if _MSC_VER >= 1800
+/** DK3 version of HAVE_STRTOIMAX.
+*/
+#define DK3_HAVE_STRTOIMAX 1
+#else
+/** DK3 version of HAVE_STRTOIMAX.
+*/
+#define DK3_HAVE_STRTOIMAX 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STRTOL
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_STRTOL.
+*/
+#define DK3_HAVE_STRTOL 1
+#else
+/** DK3 version of HAVE_STRTOL.
+*/
+#define DK3_HAVE_STRTOL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STRTOLL
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_STRTOLL.
+*/
+#define DK3_HAVE_STRTOLL 1
+#else
+/** DK3 version of HAVE_STRTOLL.
+*/
+#define DK3_HAVE_STRTOLL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STRTOUL
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_STRTOUL.
+*/
+#define DK3_HAVE_STRTOUL 1
+#else
+/** DK3 version of HAVE_STRTOUL.
+*/
+#define DK3_HAVE_STRTOUL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STRTOULL
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_STRTOULL.
+*/
+#define DK3_HAVE_STRTOULL 1
+#else
+/** DK3 version of HAVE_STRTOULL.
+*/
+#define DK3_HAVE_STRTOULL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STRTOUMAX
+#if _MSC_VER >= 1800
+/** DK3 version of HAVE_STRTOUMAX.
+*/
+#define DK3_HAVE_STRTOUMAX 1
+#else
+/** DK3 version of HAVE_STRTOUMAX.
+*/
+#define DK3_HAVE_STRTOUMAX 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_STRUCT_ADDRINFO
+/** DK3 version of HAVE_STRUCT_ADDRINFO.
+*/
+#define DK3_HAVE_STRUCT_ADDRINFO 0
+#endif
+
+#ifndef DK3_HAVE_STRUCT_SOCKADDR_IN
+/** DK3 version of HAVE_STRUCT_SOCKADDR_IN.
+*/
+#define DK3_HAVE_STRUCT_SOCKADDR_IN 1
+#endif
+
+#ifndef DK3_HAVE_STRUCT_SOCKADDR_IN6
+/** DK3 version of HAVE_STRUCT_SOCKADDR_IN6.
+*/
+#define DK3_HAVE_STRUCT_SOCKADDR_IN6 1
+#endif
+
+#ifndef DK3_HAVE_STRUCT_SOCKADDR_STORAGE
+/** DK3 version of HAVE_STRUCT_SOCKADDR_STORAGE.
+*/
+#define DK3_HAVE_STRUCT_SOCKADDR_STORAGE 0
+#endif
+
+#ifndef DK3_HAVE_STRUCT_SOCKADDR_UN
+/** DK3 version of HAVE_STRUCT_SOCKADDR_UN.
+*/
+#define DK3_HAVE_STRUCT_SOCKADDR_UN 0
+#endif
+
+#ifndef DK3_HAVE_SWSCANF_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_SWSCANF_S.
+*/
+#define DK3_HAVE_SWSCANF_S 1
+#else
+/** DK3 version of HAVE_SWSCANF_S.
+*/
+#define DK3_HAVE_SWSCANF_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_SYSCONF
+/** DK3 version of HAVE_SYSCONF.
+*/
+#define DK3_HAVE_SYSCONF 0
+#endif
+
+#ifndef DK3_HAVE_SYSCTL
+/** DK3 version of HAVE_SYSCTL.
+*/
+#define DK3_HAVE_SYSCTL 0
+#endif
+
+#ifndef DK3_HAVE_SYSLOG
+/** DK3 version of HAVE_SYSLOG.
+*/
+#define DK3_HAVE_SYSLOG 0
+#endif
+
+#ifndef DK3_HAVE_SYSLOG_H
+/** DK3 version of HAVE_SYSLOG_H.
+*/
+#define DK3_HAVE_SYSLOG_H 0
+#endif
+
+#ifndef DK3_HAVE_SYSRES_H
+/** DK3 version of HAVE_SYSRES_H.
+*/
+#define DK3_HAVE_SYSRES_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_FILE_H
+/** DK3 version of HAVE_SYS_FILE_H.
+*/
+#define DK3_HAVE_SYS_FILE_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_PARAM_H
+/** DK3 version of HAVE_SYS_PARAM_H.
+*/
+#define DK3_HAVE_SYS_PARAM_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_RESOURCE_H
+/** DK3 version of HAVE_SYS_RESOURCE_H.
+*/
+#define DK3_HAVE_SYS_RESOURCE_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_SOCKET_H
+/** DK3 version of HAVE_SYS_SOCKET_H.
+*/
+#define DK3_HAVE_SYS_SOCKET_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_STATVFS_H
+/** DK3 version of HAVE_SYS_STATVFS_H.
+*/
+#define DK3_HAVE_SYS_STATVFS_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_STAT_H
+/** DK3 version of HAVE_SYS_STAT_H.
+*/
+#define DK3_HAVE_SYS_STAT_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_STROPTS_H
+/** DK3 version of HAVE_SYS_STROPTS_H.
+*/
+#define DK3_HAVE_SYS_STROPTS_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_SUNDDI_H
+/** DK3 version of HAVE_SYS_SUNDDI_H.
+*/
+#define DK3_HAVE_SYS_SUNDDI_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_SYSCTL_H
+/** DK3 version of HAVE_SYS_SYSCTL_H.
+*/
+#define DK3_HAVE_SYS_SYSCTL_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_SYSTEMINFO_H
+/** DK3 version of HAVE_SYS_SYSTEMINFO_H.
+*/
+#define DK3_HAVE_SYS_SYSTEMINFO_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_TERMIOS_H
+/** DK3 version of HAVE_SYS_TERMIOS_H.
+*/
+#define DK3_HAVE_SYS_TERMIOS_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_TIME_H
+/** DK3 version of HAVE_SYS_TIME_H.
+*/
+#define DK3_HAVE_SYS_TIME_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_TTOLD_H
+/** DK3 version of HAVE_SYS_TTOLD_H.
+*/
+#define DK3_HAVE_SYS_TTOLD_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_TYPES_H
+/** DK3 version of HAVE_SYS_TYPES_H.
+*/
+#define DK3_HAVE_SYS_TYPES_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_UIO_H
+/** DK3 version of HAVE_SYS_UIO_H.
+*/
+#define DK3_HAVE_SYS_UIO_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_UN_H
+/** DK3 version of HAVE_SYS_UN_H.
+*/
+#define DK3_HAVE_SYS_UN_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_WAIT_H
+/** DK3 version of HAVE_SYS_WAIT_H.
+*/
+#define DK3_HAVE_SYS_WAIT_H 0
+#endif
+
+#ifndef DK3_HAVE_TANHL
+/** DK3 version of HAVE_TANHL.
+*/
+#define DK3_HAVE_TANHL 1
+#endif
+
+#ifndef DK3_HAVE_TANL
+/** DK3 version of HAVE_TANL.
+*/
+#define DK3_HAVE_TANL 1
+#endif
+
+#ifndef DK3_HAVE_TCFLUSH
+/** DK3 version of HAVE_TCFLUSH.
+*/
+#define DK3_HAVE_TCFLUSH 0
+#endif
+
+#ifndef DK3_HAVE_TCGETATTR
+/** DK3 version of HAVE_TCGETATTR.
+*/
+#define DK3_HAVE_TCGETATTR 0
+#endif
+
+#ifndef DK3_HAVE_TERMIOS_H
+/** DK3 version of HAVE_TERMIOS_H.
+*/
+#define DK3_HAVE_TERMIOS_H 0
+#endif
+
+#ifndef DK3_HAVE_TIME
+/** DK3 version of HAVE_TIME.
+*/
+#define DK3_HAVE_TIME 1
+#endif
+
+#ifndef DK3_HAVE_TIME_H
+/** DK3 version of HAVE_TIME_H.
+*/
+#define DK3_HAVE_TIME_H 1
+#endif
+
+#ifndef DK3_HAVE_TWOS_COMPLEMENT
+/** DK3 version of HAVE_TWOS_COMPLEMENT.
+*/
+#define DK3_HAVE_TWOS_COMPLEMENT 1
+#endif
+
+#ifndef DK3_HAVE_UMASK
+/** DK3 version of HAVE_UMASK.
+*/
+#define DK3_HAVE_UMASK 0
+#endif
+
+#ifndef DK3_HAVE_UNISTD_H
+/** DK3 version of HAVE_UNISTD_H.
+*/
+#define DK3_HAVE_UNISTD_H 0
+#endif
+
+#ifndef DK3_HAVE_UNLINK
+/** DK3 version of HAVE_UNLINK.
+*/
+#define DK3_HAVE_UNLINK 0
+#endif
+
+#ifndef DK3_HAVE_USER_NAMES_CASE_INSENSITIVE
+/** DK3 version of HAVE_USER_NAMES_CASE_INSENSITIVE.
+*/
+#define DK3_HAVE_USER_NAMES_CASE_INSENSITIVE 1
+#endif
+
+#ifndef DK3_HAVE_VARARGS_H
+/** DK3 version of HAVE_VARARGS_H.
+*/
+#define DK3_HAVE_VARARGS_H 0
+#endif
+
+#ifndef DK3_HAVE_VARARG_H
+/** DK3 version of HAVE_VARARG_H.
+*/
+#define DK3_HAVE_VARARG_H 0
+#endif
+
+#ifndef DK3_HAVE_VOLATILE
+/** DK3 version of HAVE_VOLATILE.
+*/
+#define DK3_HAVE_VOLATILE 1
+#endif
+
+#ifndef DK3_HAVE_WCHAR_H
+/** DK3 version of HAVE_WCHAR_H.
+*/
+#define DK3_HAVE_WCHAR_H 1
+#endif
+
+#ifndef DK3_HAVE_WCHAR_T
+/** DK3 version of HAVE_WCHAR_T.
+*/
+#define DK3_HAVE_WCHAR_T 1
+#endif
+
+#ifndef DK3_HAVE_WCSCAT
+/** DK3 version of HAVE_WCSCAT.
+*/
+#define DK3_HAVE_WCSCAT 1
+#endif
+
+#ifndef DK3_HAVE_WCSCAT_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_WCSCAT_S.
+*/
+#define DK3_HAVE_WCSCAT_S 1
+#else
+/** DK3 version of HAVE_WCSCAT_S.
+*/
+#define DK3_HAVE_WCSCAT_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WCSCHR
+/** DK3 version of HAVE_WCSCHR.
+*/
+#define DK3_HAVE_WCSCHR 1
+#endif
+
+#ifndef DK3_HAVE_WCSCMP
+/** DK3 version of HAVE_WCSCMP.
+*/
+#define DK3_HAVE_WCSCMP 1
+#endif
+
+#ifndef DK3_HAVE_WCSCPY
+/** DK3 version of HAVE_WCSCPY.
+*/
+#define DK3_HAVE_WCSCPY 1
+#endif
+
+#ifndef DK3_HAVE_WCSCPY_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_WCSCPY_S.
+*/
+#define DK3_HAVE_WCSCPY_S 1
+#else
+/** DK3 version of HAVE_WCSCPY_S.
+*/
+#define DK3_HAVE_WCSCPY_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WCSDUP
+/** DK3 version of HAVE_WCSDUP.
+*/
+#define DK3_HAVE_WCSDUP 0
+#endif
+
+#ifndef DK3_HAVE_WCSICMP
+/** DK3 version of HAVE_WCSICMP.
+*/
+#define DK3_HAVE_WCSICMP 0
+#endif
+
+#ifndef DK3_HAVE_WCSLEN
+/** DK3 version of HAVE_WCSLEN.
+*/
+#define DK3_HAVE_WCSLEN 1
+#endif
+
+#ifndef DK3_HAVE_WCSNCMP
+/** DK3 version of HAVE_WCSNCMP.
+*/
+#define DK3_HAVE_WCSNCMP 1
+#endif
+
+#ifndef DK3_HAVE_WCSNCPY
+/** DK3 version of HAVE_WCSNCPY.
+*/
+#define DK3_HAVE_WCSNCPY 1
+#endif
+
+#ifndef DK3_HAVE_WCSNCPY_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_WCSNCPY_S.
+*/
+#define DK3_HAVE_WCSNCPY_S 1
+#else
+/** DK3 version of HAVE_WCSNCPY_S.
+*/
+#define DK3_HAVE_WCSNCPY_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WCSRCHR
+/** DK3 version of HAVE_WCSRCHR.
+*/
+#define DK3_HAVE_WCSRCHR 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOD
+/** DK3 version of HAVE_WCSTOD.
+*/
+#define DK3_HAVE_WCSTOD 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOIMAX
+#if _MSC_VER >= 1800
+/** DK3 version of HAVE_WCSTOIMAX.
+*/
+#define DK3_HAVE_WCSTOIMAX 1
+#else
+/** DK3 version of HAVE_WCSTOIMAX.
+*/
+#define DK3_HAVE_WCSTOIMAX 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WCSTOL
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_WCSTOL.
+*/
+#define DK3_HAVE_WCSTOL 1
+#else
+/** DK3 version of HAVE_WCSTOL.
+*/
+#define DK3_HAVE_WCSTOL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WCSTOLL
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_WCSTOLL.
+*/
+#define DK3_HAVE_WCSTOLL 1
+#else
+/** DK3 version of HAVE_WCSTOLL.
+*/
+#define DK3_HAVE_WCSTOLL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WCSTOUL
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_WCSTOUL.
+*/
+#define DK3_HAVE_WCSTOUL 1
+#else
+/** DK3 version of HAVE_WCSTOUL.
+*/
+#define DK3_HAVE_WCSTOUL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WCSTOULL
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE_WCSTOULL.
+*/
+#define DK3_HAVE_WCSTOULL 1
+#else
+/** DK3 version of HAVE_WCSTOULL.
+*/
+#define DK3_HAVE_WCSTOULL 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WCSTOUMAX
+#if _MSC_VER >= 1800
+/** DK3 version of HAVE_WCSTOUMAX.
+*/
+#define DK3_HAVE_WCSTOUMAX 1
+#else
+/** DK3 version of HAVE_WCSTOUMAX.
+*/
+#define DK3_HAVE_WCSTOUMAX 0
+#endif
+#endif
+
+#ifndef DK3_HAVE_WINBASE_H
+/** DK3 version of HAVE_WINBASE_H.
+*/
+#define DK3_HAVE_WINBASE_H 1
+#endif
+
+#ifndef DK3_HAVE_WINCON_H
+/** DK3 version of HAVE_WINCON_H.
+*/
+#define DK3_HAVE_WINCON_H 1
+#endif
+
+#ifndef DK3_HAVE_WINDOWS_H
+/** DK3 version of HAVE_WINDOWS_H.
+*/
+#define DK3_HAVE_WINDOWS_H 1
+#endif
+
+#ifndef DK3_HAVE_WINREG_H
+/** DK3 version of HAVE_WINREG_H.
+*/
+#define DK3_HAVE_WINREG_H 1
+#endif
+
+#ifndef DK3_HAVE_WINSOCK2_H
+/** DK3 version of HAVE_WINSOCK2_H.
+*/
+#define DK3_HAVE_WINSOCK2_H 1
+#endif
+
+#ifndef DK3_HAVE_WRITE
+/** DK3 version of HAVE_WRITE.
+*/
+#define DK3_HAVE_WRITE 1
+#endif
+
+#ifndef DK3_HAVE_WS2TCPIP_H
+/** DK3 version of HAVE_WS2TCPIP_H.
+*/
+#define DK3_HAVE_WS2TCPIP_H 1
+#endif
+
+#ifndef DK3_HAVE__CLEARFP
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE__CLEARFP.
+*/
+#define DK3_HAVE__CLEARFP 1
+#else
+/** DK3 version of HAVE__CLEARFP.
+*/
+#define DK3_HAVE__CLEARFP 0
+#endif
+#endif
+
+#ifndef DK3_HAVE__FCLOSE
+/** DK3 version of HAVE__FCLOSE.
+*/
+#define DK3_HAVE__FCLOSE 0
+#endif
+
+#ifndef DK3_HAVE__FEOF
+/** DK3 version of HAVE__FEOF.
+*/
+#define DK3_HAVE__FEOF 0
+#endif
+
+#ifndef DK3_HAVE__FERROR
+/** DK3 version of HAVE__FERROR.
+*/
+#define DK3_HAVE__FERROR 0
+#endif
+
+#ifndef DK3_HAVE__FFLUSH
+/** DK3 version of HAVE__FFLUSH.
+*/
+#define DK3_HAVE__FFLUSH 0
+#endif
+
+#ifndef DK3_HAVE__FOPEN
+/** DK3 version of HAVE__FOPEN.
+*/
+#define DK3_HAVE__FOPEN 0
+#endif
+
+#ifndef DK3_HAVE__FREAD
+/** DK3 version of HAVE__FREAD.
+*/
+#define DK3_HAVE__FREAD 1
+#endif
+
+#ifndef DK3_HAVE__FWRITE
+/** DK3 version of HAVE__FWRITE.
+*/
+#define DK3_HAVE__FWRITE 1
+#endif
+
+#ifndef DK3_HAVE__GETCWD
+/** DK3 version of HAVE__GETCWD.
+*/
+#define DK3_HAVE__GETCWD 0
+#endif
+
+#ifndef DK3_HAVE__GETENV_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE__GETENV_S.
+*/
+#define DK3_HAVE__GETENV_S 1
+#else
+/** DK3 version of HAVE__GETENV_S.
+*/
+#define DK3_HAVE__GETENV_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE__GETPID
+/** DK3 version of HAVE__GETPID.
+*/
+#define DK3_HAVE__GETPID 0
+#endif
+
+#ifndef DK3_HAVE__LSTAT
+/** DK3 version of HAVE__LSTAT.
+*/
+#define DK3_HAVE__LSTAT 0
+#endif
+
+#ifndef DK3_HAVE__LSTAT32
+/** DK3 version of HAVE__LSTAT32.
+*/
+#define DK3_HAVE__LSTAT32 0
+#endif
+
+#ifndef DK3_HAVE__LSTAT64
+/** DK3 version of HAVE__LSTAT64.
+*/
+#define DK3_HAVE__LSTAT64 0
+#endif
+
+#ifndef DK3_HAVE__MKDIR
+/** DK3 version of HAVE__MKDIR.
+*/
+#define DK3_HAVE__MKDIR 1
+#endif
+
+#ifndef DK3_HAVE__POPEN
+/** DK3 version of HAVE__POPEN.
+*/
+#define DK3_HAVE__POPEN 1
+#endif
+
+#ifndef DK3_HAVE__READ
+/** DK3 version of HAVE__READ.
+*/
+#define DK3_HAVE__READ 0
+#endif
+
+#ifndef DK3_HAVE__RMDIR
+/** DK3 version of HAVE__RMDIR.
+*/
+#define DK3_HAVE__RMDIR 1
+#endif
+
+#ifndef DK3_HAVE__SNPRINTF
+/** DK3 version of HAVE__SNPRINTF.
+*/
+#define DK3_HAVE__SNPRINTF 1
+#endif
+
+#ifndef DK3_HAVE__SNPRINTF_S
+#if _MSC_VER >= 1
+/** DK3 version of HAVE__SNPRINTF_S.
+*/
+#define DK3_HAVE__SNPRINTF_S 1
+#else
+/** DK3 version of HAVE__SNPRINTF_S.
+*/
+#define DK3_HAVE__SNPRINTF_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE__STAT
+/** DK3 version of HAVE__STAT.
+*/
+#define DK3_HAVE__STAT 0
+#endif
+
+#ifndef DK3_HAVE__STAT32
+/** DK3 version of HAVE__STAT32.
+*/
+#define DK3_HAVE__STAT32 0
+#endif
+
+#ifndef DK3_HAVE__STAT64
+/** DK3 version of HAVE__STAT64.
+*/
+#define DK3_HAVE__STAT64 0
+#endif
+
+#ifndef DK3_HAVE__STRDUP
+/** DK3 version of HAVE__STRDUP.
+*/
+#define DK3_HAVE__STRDUP 1
+#endif
+
+#ifndef DK3_HAVE__STRICMP
+/** DK3 version of HAVE__STRICMP.
+*/
+#define DK3_HAVE__STRICMP 1
+#endif
+
+#ifndef DK3_HAVE__UNLINK
+/** DK3 version of HAVE__UNLINK.
+*/
+#define DK3_HAVE__UNLINK 1
+#endif
+
+#ifndef DK3_HAVE__WCSCAT
+/** DK3 version of HAVE__WCSCAT.
+*/
+#define DK3_HAVE__WCSCAT 0
+#endif
+
+#ifndef DK3_HAVE__WCSCHR
+/** DK3 version of HAVE__WCSCHR.
+*/
+#define DK3_HAVE__WCSCHR 0
+#endif
+
+#ifndef DK3_HAVE__WCSCMP
+/** DK3 version of HAVE__WCSCMP.
+*/
+#define DK3_HAVE__WCSCMP 0
+#endif
+
+#ifndef DK3_HAVE__WCSCPY
+/** DK3 version of HAVE__WCSCPY.
+*/
+#define DK3_HAVE__WCSCPY 0
+#endif
+
+#ifndef DK3_HAVE__WCSDUP
+/** DK3 version of HAVE__WCSDUP.
+*/
+#define DK3_HAVE__WCSDUP 1
+#endif
+
+#ifndef DK3_HAVE__WCSICMP
+/** DK3 version of HAVE__WCSICMP.
+*/
+#define DK3_HAVE__WCSICMP 1
+#endif
+
+#ifndef DK3_HAVE__WCSLEN
+/** DK3 version of HAVE__WCSLEN.
+*/
+#define DK3_HAVE__WCSLEN 0
+#endif
+
+#ifndef DK3_HAVE__WCSNCMP
+/** DK3 version of HAVE__WCSNCMP.
+*/
+#define DK3_HAVE__WCSNCMP 0
+#endif
+
+#ifndef DK3_HAVE__WCSNCPY
+/** DK3 version of HAVE__WCSNCPY.
+*/
+#define DK3_HAVE__WCSNCPY 0
+#endif
+
+#ifndef DK3_HAVE__WCSRCHR
+/** DK3 version of HAVE__WCSRCHR.
+*/
+#define DK3_HAVE__WCSRCHR 0
+#endif
+
+#ifndef DK3_HAVE__WFOPEN_S
+#if _MSC_VER >= 1700
+/** DK3 version of HAVE__WFOPEN_S.
+*/
+#define DK3_HAVE__WFOPEN_S 1
+#else
+/** DK3 version of HAVE__WFOPEN_S.
+*/
+#define DK3_HAVE__WFOPEN_S 0
+#endif
+#endif
+
+#ifndef DK3_HAVE__WGETENV
+/** DK3 version of HAVE__WGETENV.
+*/
+#define DK3_HAVE__WGETENV 1
+#endif
+
+#ifndef DK3_HAVE__WRITE
+/** DK3 version of HAVE__WRITE.
+*/
+#define DK3_HAVE__WRITE 0
+#endif
+
+#ifndef DK3_TIME_WITH_SYS_TIME
+/** DK3 version of TIME_WITH_SYS_TIME.
+*/
+#define DK3_TIME_WITH_SYS_TIME 0
+#endif
+
+#ifndef DK3_SIZEOF_DOUBLE
+/** DK3 version of SIZEOF_DOUBLE.
+*/
+#define DK3_SIZEOF_DOUBLE 8
+#endif
+
+#ifndef DK3_SIZEOF_INT
+/** DK3 version of SIZEOF_INT.
+*/
+#define DK3_SIZEOF_INT 4
+#endif
+
+#ifndef DK3_SIZEOF_INTMAX_T
+#if _MSC_VER >= 1700
+/** DK3 version of SIZEOF_INTMAX_T.
+*/
+#define DK3_SIZEOF_INTMAX_T 8
+#else
+/** DK3 version of SIZEOF_INTMAX_T.
+*/
+#define DK3_SIZEOF_INTMAX_T 0
+#endif
+#endif
+
+#ifndef DK3_SIZEOF_LONG
+/** DK3 version of SIZEOF_LONG.
+*/
+#define DK3_SIZEOF_LONG 4
+#endif
+
+#ifndef DK3_SIZEOF_LONG_DOUBLE
+/** DK3 version of SIZEOF_LONG_DOUBLE.
+*/
+#define DK3_SIZEOF_LONG_DOUBLE 8
+#endif
+
+#ifndef DK3_SIZEOF_LONG_LONG
+/** DK3 version of SIZEOF_LONG_LONG.
+*/
+#define DK3_SIZEOF_LONG_LONG 8
+#endif
+
+#ifndef DK3_SIZEOF_SHORT
+/** DK3 version of SIZEOF_SHORT.
+*/
+#define DK3_SIZEOF_SHORT 2
+#endif
+
+#if defined(WIN64) || defined(_WIN64)
+#ifndef DK3_SIZEOF_SIZE_T
+/** DK3 version of SIZEOF_SIZE_T.
+*/
+#define DK3_SIZEOF_SIZE_T 8
+#endif
+#else
+#ifndef DK3_SIZEOF_SIZE_T
+/** DK3 version of SIZEOF_SIZE_T.
+*/
+#define DK3_SIZEOF_SIZE_T 4
+#endif
+#endif
+
+#ifndef DK3_SIZEOF_WCHAR_T
+/** DK3 version of SIZEOF_WCHAR_T.
+*/
+#define DK3_SIZEOF_WCHAR_T 2
+#endif
+
+#ifndef DK3_HAVE_RFC_2279
+/** DK3 version of HAVE_RFC_2279.
+*/
+#define DK3_HAVE_RFC_2279 0
+#endif
+
+#ifndef DK3_WORDS_BIGENDIAN
+/** DK3 version of WORDS_BIGENDIAN.
+*/
+#define DK3_WORDS_BIGENDIAN 0
+#endif
+
+#else
+/* if DK3_ON_WINDOWS */
+
+
+#ifndef DK3_HAVE_ACOSH
+/** DK3 version of HAVE_ACOSH.
+*/
+#define DK3_HAVE_ACOSH 1
+#endif
+
+#ifndef DK3_HAVE_ACOSHL
+/** DK3 version of HAVE_ACOSHL.
+*/
+#define DK3_HAVE_ACOSHL 1
+#endif
+
+#ifndef DK3_HAVE_ACOSL
+/** DK3 version of HAVE_ACOSL.
+*/
+#define DK3_HAVE_ACOSL 1
+#endif
+
+#ifndef DK3_HAVE_ALLOC_H
+/** DK3 version of HAVE_ALLOC_H.
+*/
+#define DK3_HAVE_ALLOC_H 0
+#endif
+
+#ifndef DK3_HAVE_ARPA_INET_H
+/** DK3 version of HAVE_ARPA_INET_H.
+*/
+#define DK3_HAVE_ARPA_INET_H 1
+#endif
+
+#ifndef DK3_HAVE_ASINH
+/** DK3 version of HAVE_ASINH.
+*/
+#define DK3_HAVE_ASINH 1
+#endif
+
+#ifndef DK3_HAVE_ASINHL
+/** DK3 version of HAVE_ASINHL.
+*/
+#define DK3_HAVE_ASINHL 1
+#endif
+
+#ifndef DK3_HAVE_ASINL
+/** DK3 version of HAVE_ASINL.
+*/
+#define DK3_HAVE_ASINL 1
+#endif
+
+#ifndef DK3_HAVE_ATAN2
+/** DK3 version of HAVE_ATAN2.
+*/
+#define DK3_HAVE_ATAN2 1
+#endif
+
+#ifndef DK3_HAVE_ATAN2L
+/** DK3 version of HAVE_ATAN2L.
+*/
+#define DK3_HAVE_ATAN2L 1
+#endif
+
+#ifndef DK3_HAVE_ATANH
+/** DK3 version of HAVE_ATANH.
+*/
+#define DK3_HAVE_ATANH 1
+#endif
+
+#ifndef DK3_HAVE_ATANHL
+/** DK3 version of HAVE_ATANHL.
+*/
+#define DK3_HAVE_ATANHL 1
+#endif
+
+#ifndef DK3_HAVE_ATANL
+/** DK3 version of HAVE_ATANL.
+*/
+#define DK3_HAVE_ATANL 1
+#endif
+
+#ifndef DK3_HAVE_BACKSLASH
+/** DK3 version of HAVE_BACKSLASH.
+*/
+#define DK3_HAVE_BACKSLASH 0
+#endif
+
+#ifndef DK3_HAVE_BCMP
+/** DK3 version of HAVE_BCMP.
+*/
+#define DK3_HAVE_BCMP 1
+#endif
+
+#ifndef DK3_HAVE_BCOPY
+/** DK3 version of HAVE_BCOPY.
+*/
+#define DK3_HAVE_BCOPY 1
+#endif
+
+#ifndef DK3_HAVE_BZERO
+/** DK3 version of HAVE_BZERO.
+*/
+#define DK3_HAVE_BZERO 1
+#endif
+
+#ifndef DK3_HAVE_BZLIB_H
+/** DK3 version of HAVE_BZLIB_H.
+*/
+#define DK3_HAVE_BZLIB_H 1
+#endif
+
+#ifndef DK3_HAVE_CEIL
+/** DK3 version of HAVE_CEIL.
+*/
+#define DK3_HAVE_CEIL 1
+#endif
+
+#ifndef DK3_HAVE_CEILL
+/** DK3 version of HAVE_CEILL.
+*/
+#define DK3_HAVE_CEILL 1
+#endif
+
+#ifndef DK3_HAVE_CHDIR
+/** DK3 version of HAVE_CHDIR.
+*/
+#define DK3_HAVE_CHDIR 1
+#endif
+
+#ifndef DK3_HAVE_CHMOD
+/** DK3 version of HAVE_CHMOD.
+*/
+#define DK3_HAVE_CHMOD 1
+#endif
+
+#ifndef DK3_HAVE_CHOWN
+/** DK3 version of HAVE_CHOWN.
+*/
+#define DK3_HAVE_CHOWN 1
+#endif
+
+#ifndef DK3_HAVE_CLOSEDIR
+/** DK3 version of HAVE_CLOSEDIR.
+*/
+#define DK3_HAVE_CLOSEDIR 1
+#endif
+
+#ifndef DK3_HAVE_CONIO_H
+/** DK3 version of HAVE_CONIO_H.
+*/
+#define DK3_HAVE_CONIO_H 0
+#endif
+
+#ifndef DK3_HAVE_CONST
+/** DK3 version of HAVE_CONST.
+*/
+#define DK3_HAVE_CONST 1
+#endif
+
+#ifndef DK3_HAVE_COSHL
+/** DK3 version of HAVE_COSHL.
+*/
+#define DK3_HAVE_COSHL 1
+#endif
+
+#ifndef DK3_HAVE_COSL
+/** DK3 version of HAVE_COSL.
+*/
+#define DK3_HAVE_COSL 1
+#endif
+
+#ifndef DK3_HAVE_CTYPE_H
+/** DK3 version of HAVE_CTYPE_H.
+*/
+#define DK3_HAVE_CTYPE_H 1
+#endif
+
+#ifndef DK3_HAVE_DB_CURSOR_C_GET
+/** DK3 version of HAVE_DB_CURSOR_C_GET.
+*/
+#define DK3_HAVE_DB_CURSOR_C_GET 1
+#endif
+
+#ifndef DK3_HAVE_DB_H
+/** DK3 version of HAVE_DB_H.
+*/
+#define DK3_HAVE_DB_H 1
+#endif
+
+#ifndef DK3_HAVE_DEV_RANDOM
+/** DK3 version of HAVE_DEV_RANDOM.
+*/
+#define DK3_HAVE_DEV_RANDOM 1
+#endif
+
+#ifndef DK3_HAVE_DEV_URANDOM
+/** DK3 version of HAVE_DEV_URANDOM.
+*/
+#define DK3_HAVE_DEV_URANDOM 1
+#endif
+
+#ifndef DK3_HAVE_DIRECT_H
+/** DK3 version of HAVE_DIRECT_H.
+*/
+#define DK3_HAVE_DIRECT_H 0
+#endif
+
+#ifndef DK3_HAVE_DIRENT_H
+/** DK3 version of HAVE_DIRENT_H.
+*/
+#define DK3_HAVE_DIRENT_H 1
+#endif
+
+#ifndef DK3_HAVE_DIR_H
+/** DK3 version of HAVE_DIR_H.
+*/
+#define DK3_HAVE_DIR_H 0
+#endif
+
+#ifndef DK3_HAVE_DOS_H
+/** DK3 version of HAVE_DOS_H.
+*/
+#define DK3_HAVE_DOS_H 0
+#endif
+
+#ifndef DK3_HAVE_ENDGRENT
+/** DK3 version of HAVE_ENDGRENT.
+*/
+#define DK3_HAVE_ENDGRENT 1
+#endif
+
+#ifndef DK3_HAVE_ENDPWENT
+/** DK3 version of HAVE_ENDPWENT.
+*/
+#define DK3_HAVE_ENDPWENT 1
+#endif
+
+#ifndef DK3_HAVE_ERRNO_H
+/** DK3 version of HAVE_ERRNO_H.
+*/
+#define DK3_HAVE_ERRNO_H 1
+#endif
+
+#ifndef DK3_HAVE_ERR_H
+/** DK3 version of HAVE_ERR_H.
+*/
+#define DK3_HAVE_ERR_H 1
+#endif
+
+#ifndef DK3_HAVE_EXPL
+/** DK3 version of HAVE_EXPL.
+*/
+#define DK3_HAVE_EXPL 1
+#endif
+
+#ifndef DK3_HAVE_FABS
+/** DK3 version of HAVE_FABS.
+*/
+#define DK3_HAVE_FABS 1
+#endif
+
+#ifndef DK3_HAVE_FABSL
+/** DK3 version of HAVE_FABSL.
+*/
+#define DK3_HAVE_FABSL 1
+#endif
+
+#ifndef DK3_HAVE_FCLOSE
+/** DK3 version of HAVE_FCLOSE.
+*/
+#define DK3_HAVE_FCLOSE 1
+#endif
+
+#ifndef DK3_HAVE_FCNTL_H
+/** DK3 version of HAVE_FCNTL_H.
+*/
+#define DK3_HAVE_FCNTL_H 1
+#endif
+
+#ifndef DK3_HAVE_FENV_H
+/** DK3 version of HAVE_FENV_H.
+*/
+#define DK3_HAVE_FENV_H 1
+#endif
+
+#ifndef DK3_HAVE_FEOF
+/** DK3 version of HAVE_FEOF.
+*/
+#define DK3_HAVE_FEOF 1
+#endif
+
+#ifndef DK3_HAVE_FERROR
+/** DK3 version of HAVE_FERROR.
+*/
+#define DK3_HAVE_FERROR 1
+#endif
+
+#ifndef DK3_HAVE_FETESTEXCEPT
+/** DK3 version of HAVE_FETESTEXCEPT.
+*/
+#define DK3_HAVE_FETESTEXCEPT 0
+#endif
+
+#ifndef DK3_HAVE_FFLUSH
+/** DK3 version of HAVE_FFLUSH.
+*/
+#define DK3_HAVE_FFLUSH 1
+#endif
+
+#ifndef DK3_HAVE_FLOAT_H
+/** DK3 version of HAVE_FLOAT_H.
+*/
+#define DK3_HAVE_FLOAT_H 1
+#endif
+
+#ifndef DK3_HAVE_FLOOR
+/** DK3 version of HAVE_FLOOR.
+*/
+#define DK3_HAVE_FLOOR 1
+#endif
+
+#ifndef DK3_HAVE_FLOORL
+/** DK3 version of HAVE_FLOORL.
+*/
+#define DK3_HAVE_FLOORL 1
+#endif
+
+#ifndef DK3_HAVE_FNCASEINS
+/** DK3 version of HAVE_FNCASEINS.
+*/
+#define DK3_HAVE_FNCASEINS 0
+#endif
+
+#ifndef DK3_HAVE_FOPEN
+/** DK3 version of HAVE_FOPEN.
+*/
+#define DK3_HAVE_FOPEN 1
+#endif
+
+#ifndef DK3_HAVE_FOPEN64
+/** DK3 version of HAVE_FOPEN64.
+*/
+#define DK3_HAVE_FOPEN64 1
+#endif
+
+#ifndef DK3_HAVE_FOPEN_S
+/** DK3 version of HAVE_FOPEN_S.
+*/
+#define DK3_HAVE_FOPEN_S 0
+#endif
+
+#ifndef DK3_HAVE_FORK
+/** DK3 version of HAVE_FORK.
+*/
+#define DK3_HAVE_FORK 1
+#endif
+
+#ifndef DK3_HAVE_FPCLASSIFY
+/** DK3 version of HAVE_FPCLASSIFY.
+*/
+#define DK3_HAVE_FPCLASSIFY 1
+#endif
+
+#ifndef DK3_HAVE_FREAD
+/** DK3 version of HAVE_FREAD.
+*/
+#define DK3_HAVE_FREAD 1
+#endif
+
+#ifndef DK3_HAVE_FREE
+/** DK3 version of HAVE_FREE.
+*/
+#define DK3_HAVE_FREE 1
+#endif
+
+#ifndef DK3_HAVE_FWRITE
+/** DK3 version of HAVE_FWRITE.
+*/
+#define DK3_HAVE_FWRITE 1
+#endif
+
+#ifndef DK3_HAVE_GDBM_H
+/** DK3 version of HAVE_GDBM_H.
+*/
+#define DK3_HAVE_GDBM_H 1
+#endif
+
+#ifndef DK3_HAVE_GETADDRINFO
+/** DK3 version of HAVE_GETADDRINFO.
+*/
+#define DK3_HAVE_GETADDRINFO 1
+#endif
+
+#ifndef DK3_HAVE_GETCWD
+/** DK3 version of HAVE_GETCWD.
+*/
+#define DK3_HAVE_GETCWD 1
+#endif
+
+#ifndef DK3_HAVE_GETENV
+/** DK3 version of HAVE_GETENV.
+*/
+#define DK3_HAVE_GETENV 1
+#endif
+
+#ifndef DK3_HAVE_GETEUID
+/** DK3 version of HAVE_GETEUID.
+*/
+#define DK3_HAVE_GETEUID 1
+#endif
+
+#ifndef DK3_HAVE_GETGRENT
+/** DK3 version of HAVE_GETGRENT.
+*/
+#define DK3_HAVE_GETGRENT 1
+#endif
+
+#ifndef DK3_HAVE_GETGRGID
+/** DK3 version of HAVE_GETGRGID.
+*/
+#define DK3_HAVE_GETGRGID 1
+#endif
+
+#ifndef DK3_HAVE_GETGRNAM
+/** DK3 version of HAVE_GETGRNAM.
+*/
+#define DK3_HAVE_GETGRNAM 1
+#endif
+
+#ifndef DK3_HAVE_GETHOSTBYNAME
+/** DK3 version of HAVE_GETHOSTBYNAME.
+*/
+#define DK3_HAVE_GETHOSTBYNAME 1
+#endif
+
+#ifndef DK3_HAVE_GETHOSTNAME
+/** DK3 version of HAVE_GETHOSTNAME.
+*/
+#define DK3_HAVE_GETHOSTNAME 1
+#endif
+
+#ifndef DK3_HAVE_GETPEERNAME
+/** DK3 version of HAVE_GETPEERNAME.
+*/
+#define DK3_HAVE_GETPEERNAME 1
+#endif
+
+#ifndef DK3_HAVE_GETPID
+/** DK3 version of HAVE_GETPID.
+*/
+#define DK3_HAVE_GETPID 1
+#endif
+
+#ifndef DK3_HAVE_GETPWENT
+/** DK3 version of HAVE_GETPWENT.
+*/
+#define DK3_HAVE_GETPWENT 1
+#endif
+
+#ifndef DK3_HAVE_GETPWNAM
+/** DK3 version of HAVE_GETPWNAM.
+*/
+#define DK3_HAVE_GETPWNAM 1
+#endif
+
+#ifndef DK3_HAVE_GETPWUID
+/** DK3 version of HAVE_GETPWUID.
+*/
+#define DK3_HAVE_GETPWUID 1
+#endif
+
+#ifndef DK3_HAVE_GETRLIMIT
+/** DK3 version of HAVE_GETRLIMIT.
+*/
+#define DK3_HAVE_GETRLIMIT 1
+#endif
+
+#ifndef DK3_HAVE_GETSOCKNAME
+/** DK3 version of HAVE_GETSOCKNAME.
+*/
+#define DK3_HAVE_GETSOCKNAME 1
+#endif
+
+#ifndef DK3_HAVE_GETUID
+/** DK3 version of HAVE_GETUID.
+*/
+#define DK3_HAVE_GETUID 1
+#endif
+
+#ifndef DK3_HAVE_GRP_H
+/** DK3 version of HAVE_GRP_H.
+*/
+#define DK3_HAVE_GRP_H 1
+#endif
+
+#ifndef DK3_HAVE_HTONL
+/** DK3 version of HAVE_HTONL.
+*/
+#define DK3_HAVE_HTONL 1
+#endif
+
+#ifndef DK3_HAVE_IEEE_754_DOUBLE
+/** DK3 version of HAVE_IEEE_754_DOUBLE.
+*/
+#define DK3_HAVE_IEEE_754_DOUBLE 1
+#endif
+
+#ifndef DK3_HAVE_IN6_ADDR
+/** DK3 version of HAVE_IN6_ADDR.
+*/
+#define DK3_HAVE_IN6_ADDR 0
+#endif
+
+#ifndef DK3_HAVE_INET_ADDR
+/** DK3 version of HAVE_INET_ADDR.
+*/
+#define DK3_HAVE_INET_ADDR 1
+#endif
+
+#ifndef DK3_HAVE_INET_ATON
+/** DK3 version of HAVE_INET_ATON.
+*/
+#define DK3_HAVE_INET_ATON 1
+#endif
+
+#ifndef DK3_HAVE_INET_PTON
+/** DK3 version of HAVE_INET_PTON.
+*/
+#define DK3_HAVE_INET_PTON 1
+#endif
+
+#ifndef DK3_HAVE_INITSTATE
+/** DK3 version of HAVE_INITSTATE.
+*/
+#define DK3_HAVE_INITSTATE 1
+#endif
+
+#ifndef DK3_HAVE_INODES
+/** DK3 version of HAVE_INODES.
+*/
+#define DK3_HAVE_INODES 1
+#endif
+
+#ifndef DK3_HAVE_INTMAX_T
+/** DK3 version of HAVE_INTMAX_T.
+*/
+#define DK3_HAVE_INTMAX_T 1
+#endif
+
+#ifndef DK3_HAVE_INTTYPES_H
+/** DK3 version of HAVE_INTTYPES_H.
+*/
+#define DK3_HAVE_INTTYPES_H 1
+#endif
+
+#ifndef DK3_HAVE_IN_ADDR
+/** DK3 version of HAVE_IN_ADDR.
+*/
+#define DK3_HAVE_IN_ADDR 0
+#endif
+
+#ifndef DK3_HAVE_IO_H
+/** DK3 version of HAVE_IO_H.
+*/
+#define DK3_HAVE_IO_H 0
+#endif
+
+#ifndef DK3_HAVE_ISATTY
+/** DK3 version of HAVE_ISATTY.
+*/
+#define DK3_HAVE_ISATTY 1
+#endif
+
+#ifndef DK3_HAVE_ISFINITE
+/** DK3 version of HAVE_ISFINITE.
+*/
+#define DK3_HAVE_ISFINITE 1
+#endif
+
+#ifndef DK3_HAVE_ISNORMAL
+/** DK3 version of HAVE_ISNORMAL.
+*/
+#define DK3_HAVE_ISNORMAL 1
+#endif
+
+#ifndef DK3_HAVE_JPEGLIB_H
+/** DK3 version of HAVE_JPEGLIB_H.
+*/
+#define DK3_HAVE_JPEGLIB_H 1
+#endif
+
+#ifndef DK3_HAVE_LABS
+/** DK3 version of HAVE_LABS.
+*/
+#define DK3_HAVE_LABS 1
+#endif
+
+#ifndef DK3_HAVE_LARGEFILE64_SOURCE
+/** DK3 version of HAVE_LARGEFILE64_SOURCE.
+*/
+#define DK3_HAVE_LARGEFILE64_SOURCE 0
+#endif
+
+#ifndef DK3_HAVE_LIBNETSNMP
+/** DK3 version of HAVE_LIBNETSNMP.
+*/
+#define DK3_HAVE_LIBNETSNMP 1
+#endif
+
+#ifndef DK3_HAVE_LIMITS_H
+/** DK3 version of HAVE_LIMITS_H.
+*/
+#define DK3_HAVE_LIMITS_H 1
+#endif
+
+#ifndef DK3_HAVE_LOCALE_H
+/** DK3 version of HAVE_LOCALE_H.
+*/
+#define DK3_HAVE_LOCALE_H 1
+#endif
+
+#ifndef DK3_HAVE_LOCALTIME
+/** DK3 version of HAVE_LOCALTIME.
+*/
+#define DK3_HAVE_LOCALTIME 1
+#endif
+
+#ifndef DK3_HAVE_LOCALTIME
+/** DK3 version of HAVE_LOCALTIME.
+*/
+#define DK3_HAVE_LOCALTIME 1
+#endif
+
+#ifndef DK3_HAVE_LOCALTIME_R
+/** DK3 version of HAVE_LOCALTIME_R.
+*/
+#define DK3_HAVE_LOCALTIME_R 1
+#endif
+
+#ifndef DK3_HAVE_LOCALTIME_S
+/** DK3 version of HAVE_LOCALTIME_S.
+*/
+#define DK3_HAVE_LOCALTIME_S 0
+#endif
+
+#ifndef DK3_HAVE_LOGL
+/** DK3 version of HAVE_LOGL.
+*/
+#define DK3_HAVE_LOGL 1
+#endif
+
+#ifndef DK3_HAVE_LONG_DOUBLE
+/** DK3 version of HAVE_LONG_DOUBLE.
+*/
+#define DK3_HAVE_LONG_DOUBLE 1
+#endif
+
+#ifndef DK3_HAVE_LONG_LONG
+/** DK3 version of HAVE_LONG_LONG.
+*/
+#define DK3_HAVE_LONG_LONG 1
+#endif
+
+#ifndef DK3_HAVE_LPRNG_H
+/** DK3 version of HAVE_LPRNG_H.
+*/
+#define DK3_HAVE_LPRNG_H 0
+#endif
+
+#ifndef DK3_HAVE_LRAND48
+/** DK3 version of HAVE_LRAND48.
+*/
+#define DK3_HAVE_LRAND48 1
+#endif
+
+#ifndef DK3_HAVE_LSTAT
+/** DK3 version of HAVE_LSTAT.
+*/
+#define DK3_HAVE_LSTAT 1
+#endif
+
+#ifndef DK3_HAVE_LSTAT32
+/** DK3 version of HAVE_LSTAT32.
+*/
+#define DK3_HAVE_LSTAT32 0
+#endif
+
+#ifndef DK3_HAVE_LSTAT64
+/** DK3 version of HAVE_LSTAT64.
+*/
+#define DK3_HAVE_LSTAT64 1
+#endif
+
+#ifndef DK3_HAVE_MALLOC
+/** DK3 version of HAVE_MALLOC.
+*/
+#define DK3_HAVE_MALLOC 1
+#endif
+
+#ifndef DK3_HAVE_MALLOC_H
+/** DK3 version of HAVE_MALLOC_H.
+*/
+#define DK3_HAVE_MALLOC_H 1
+#endif
+
+#ifndef DK3_HAVE_MATH_H
+/** DK3 version of HAVE_MATH_H.
+*/
+#define DK3_HAVE_MATH_H 1
+#endif
+
+#ifndef DK3_HAVE_MEMCMP
+/** DK3 version of HAVE_MEMCMP.
+*/
+#define DK3_HAVE_MEMCMP 1
+#endif
+
+#ifndef DK3_HAVE_MEMCPY
+/** DK3 version of HAVE_MEMCPY.
+*/
+#define DK3_HAVE_MEMCPY 1
+#endif
+
+#ifndef DK3_HAVE_MEMSET
+/** DK3 version of HAVE_MEMSET.
+*/
+#define DK3_HAVE_MEMSET 1
+#endif
+
+#ifndef DK3_HAVE_MKDIR
+/** DK3 version of HAVE_MKDIR.
+*/
+#define DK3_HAVE_MKDIR 1
+#endif
+
+#ifndef DK3_HAVE_MKDIR2
+/** DK3 version of HAVE_MKDIR2.
+*/
+#define DK3_HAVE_MKDIR2 1
+#endif
+
+#ifndef DK3_HAVE_MPCTL
+/** DK3 version of HAVE_MPCTL.
+*/
+#define DK3_HAVE_MPCTL 0
+#endif
+
+#ifndef DK3_HAVE_MYSQL_LIBRARY_END
+/** DK3 version of HAVE_MYSQL_LIBRARY_END.
+*/
+#define DK3_HAVE_MYSQL_LIBRARY_END 0
+#endif
+
+#ifndef DK3_HAVE_MYSQL_LIBRARY_INIT
+/** DK3 version of HAVE_MYSQL_LIBRARY_INIT.
+*/
+#define DK3_HAVE_MYSQL_LIBRARY_INIT 0
+#endif
+
+#ifndef DK3_HAVE_MARIADB_MYSQL_H
+/** DK3 version of HAVE_MARIADB_MYSQL_H.
+*/
+#define DK3_HAVE_MARIADB_MYSQL_H 0
+#endif
+
+#ifndef DK3_HAVE_MYSQL_MYSQL_H
+/** DK3 version of HAVE_MYSQL_MYSQL_H.
+*/
+#define DK3_HAVE_MYSQL_MYSQL_H 1
+#endif
+
+#ifndef DK3_HAVE_MYSQL_H
+/** DK3 version of HAVE_MYSQL_H.
+*/
+#define DK3_HAVE_MYSQL_H 0
+#endif
+
+#ifndef DK3_HAVE_MYSQL_SET_CHARACTER_SET
+/** DK3 version of HAVE_MYSQL_SET_CHARACTER_SET.
+*/
+#define DK3_HAVE_MYSQL_SET_CHARACTER_SET 0
+#endif
+
+#ifndef DK3_HAVE_NDBM_H
+/** DK3 version of HAVE_NDBM_H.
+*/
+#define DK3_HAVE_NDBM_H 0
+#endif
+
+#ifndef DK3_HAVE_NETDB_H
+/** DK3 version of HAVE_NETDB_H.
+*/
+#define DK3_HAVE_NETDB_H 1
+#endif
+
+#ifndef DK3_HAVE_NETINET_IN_H
+/** DK3 version of HAVE_NETINET_IN_H.
+*/
+#define DK3_HAVE_NETINET_IN_H 1
+#endif
+
+#ifndef DK3_HAVE_NETSNMP_ENABLE_FILELOG
+/** DK3 version of HAVE_NETSNMP_ENABLE_FILELOG.
+*/
+#define DK3_HAVE_NETSNMP_ENABLE_FILELOG 0
+#endif
+
+#ifndef DK3_HAVE_NRAND48
+/** DK3 version of HAVE_NRAND48.
+*/
+#define DK3_HAVE_NRAND48 1
+#endif
+
+#ifndef DK3_HAVE_OPENDIR
+/** DK3 version of HAVE_OPENDIR.
+*/
+#define DK3_HAVE_OPENDIR 1
+#endif
+
+#ifndef DK3_HAVE_OPENSSL_MD5_H
+/** DK3 version of HAVE_OPENSSL_MD5_H.
+*/
+#define DK3_HAVE_OPENSSL_MD5_H 1
+#endif
+
+#ifndef DK3_HAVE_OPENSSL_RAND_H
+/** DK3 version of HAVE_OPENSSL_RAND_H.
+*/
+#define DK3_HAVE_OPENSSL_RAND_H 1
+#endif
+
+#ifndef DK3_HAVE_OPENSSL_RIPEMD_H
+/** DK3 version of HAVE_OPENSSL_RIPEMD_H.
+*/
+#define DK3_HAVE_OPENSSL_RIPEMD_H 1
+#endif
+
+#ifndef DK3_HAVE_OPENSSL_SHA_H
+/** DK3 version of HAVE_OPENSSL_SHA_H.
+*/
+#define DK3_HAVE_OPENSSL_SHA_H 1
+#endif
+
+#ifndef DK3_HAVE_PNG_GET_PIXELS_PER_INCH
+/** DK3 version of HAVE_PNG_GET_PIXELS_PER_INCH.
+*/
+#define DK3_HAVE_PNG_GET_PIXELS_PER_INCH 1
+#endif
+
+#ifndef DK3_HAVE_PNG_H
+/** DK3 version of HAVE_PNG_H.
+*/
+#define DK3_HAVE_PNG_H 1
+#endif
+
+#ifndef DK3_HAVE_POPEN
+/** DK3 version of HAVE_POPEN.
+*/
+#define DK3_HAVE_POPEN 1
+#endif
+
+#ifndef DK3_HAVE_PROCESS_H
+/** DK3 version of HAVE_PROCESS_H.
+*/
+#define DK3_HAVE_PROCESS_H 0
+#endif
+
+#ifndef DK3_HAVE_PTHREAD_H
+/** DK3 version of HAVE_PTHREAD_H.
+*/
+#define DK3_HAVE_PTHREAD_H 1
+#endif
+
+#ifndef DK3_HAVE_PWD_H
+/** DK3 version of HAVE_PWD_H.
+*/
+#define DK3_HAVE_PWD_H 1
+#endif
+
+#ifndef DK3_HAVE_RAND
+/** DK3 version of HAVE_RAND.
+*/
+#define DK3_HAVE_RAND 1
+#endif
+
+#ifndef DK3_HAVE_RANDOM
+/** DK3 version of HAVE_RANDOM.
+*/
+#define DK3_HAVE_RANDOM 1
+#endif
+
+#ifndef DK3_HAVE_READ
+/** DK3 version of HAVE_READ.
+*/
+#define DK3_HAVE_READ 1
+#endif
+
+#ifndef DK3_HAVE_READDIR
+/** DK3 version of HAVE_READDIR.
+*/
+#define DK3_HAVE_READDIR 1
+#endif
+
+#ifndef DK3_HAVE_RFC_2249
+/** DK3 version of HAVE_RFC_2249.
+*/
+#define DK3_HAVE_RFC_2249 0
+#endif
+
+#ifndef DK3_HAVE_RINT
+/** DK3 version of HAVE_RINT.
+*/
+#define DK3_HAVE_RINT 1
+#endif
+
+#ifndef DK3_HAVE_RINTL
+/** DK3 version of HAVE_RINTL.
+*/
+#define DK3_HAVE_RINTL 1
+#endif
+
+#ifndef DK3_HAVE_RMDIR
+/** DK3 version of HAVE_RMDIR.
+*/
+#define DK3_HAVE_RMDIR 1
+#endif
+
+#ifndef DK3_HAVE_SEED48
+/** DK3 version of HAVE_SEED48.
+*/
+#define DK3_HAVE_SEED48 1
+#endif
+
+#ifndef DK3_HAVE_SELECT
+/** DK3 version of HAVE_SELECT.
+*/
+#define DK3_HAVE_SELECT 1
+#endif
+
+#ifndef DK3_HAVE_SETGID
+/** DK3 version of HAVE_SETGID.
+*/
+#define DK3_HAVE_SETGID 1
+#endif
+
+#ifndef DK3_HAVE_SETGRENT
+/** DK3 version of HAVE_SETGRENT.
+*/
+#define DK3_HAVE_SETGRENT 1
+#endif
+
+#ifndef DK3_HAVE_SETJMP_H
+/** DK3 version of HAVE_SETJMP_H.
+*/
+#define DK3_HAVE_SETJMP_H 1
+#endif
+
+#ifndef DK3_HAVE_SETLOCALE
+/** DK3 version of HAVE_SETLOCALE.
+*/
+#define DK3_HAVE_SETLOCALE 1
+#endif
+
+#ifndef DK3_HAVE_SETPGRP
+/** DK3 version of HAVE_SETPGRP.
+*/
+#define DK3_HAVE_SETPGRP 1
+#endif
+
+#ifndef DK3_HAVE_SETPWENT
+/** DK3 version of HAVE_SETPWENT.
+*/
+#define DK3_HAVE_SETPWENT 1
+#endif
+
+#ifndef DK3_HAVE_SETSID
+/** DK3 version of HAVE_SETSID.
+*/
+#define DK3_HAVE_SETSID 1
+#endif
+
+#ifndef DK3_HAVE_SETSOCKOPT
+/** DK3 version of HAVE_SETSOCKOPT.
+*/
+#define DK3_HAVE_SETSOCKOPT 1
+#endif
+
+#ifndef DK3_HAVE_SETSTATE
+/** DK3 version of HAVE_SETSTATE.
+*/
+#define DK3_HAVE_SETSTATE 1
+#endif
+
+#ifndef DK3_HAVE_SETUID
+/** DK3 version of HAVE_SETUID.
+*/
+#define DK3_HAVE_SETUID 1
+#endif
+
+#ifndef DK3_HAVE_SETVBUF
+/** DK3 version of HAVE_SETVBUF.
+*/
+#define DK3_HAVE_SETVBUF 1
+#endif
+
+#ifndef DK3_HAVE_SHA224
+/** DK3 version of HAVE_SHA224.
+*/
+#define DK3_HAVE_SHA224 1
+#endif
+
+#ifndef DK3_HAVE_SHA256
+/** DK3 version of HAVE_SHA256.
+*/
+#define DK3_HAVE_SHA256 1
+#endif
+
+#ifndef DK3_HAVE_SHA384
+/** DK3 version of HAVE_SHA384.
+*/
+#define DK3_HAVE_SHA384 1
+#endif
+
+#ifndef DK3_HAVE_SHA512
+/** DK3 version of HAVE_SHA512.
+*/
+#define DK3_HAVE_SHA512 1
+#endif
+
+#ifndef DK3_HAVE_SHADOW_H
+/** DK3 version of HAVE_SHADOW_H.
+*/
+#define DK3_HAVE_SHADOW_H 1
+#endif
+
+#ifndef DK3_HAVE_SIGACTION
+/** DK3 version of HAVE_SIGACTION.
+*/
+#define DK3_HAVE_SIGACTION 1
+#endif
+
+#ifndef DK3_HAVE_SIGNAL
+/** DK3 version of HAVE_SIGNAL.
+*/
+#define DK3_HAVE_SIGNAL 1
+#endif
+
+#ifndef DK3_HAVE_SIGNAL_H
+/** DK3 version of HAVE_SIGNAL_H.
+*/
+#define DK3_HAVE_SIGNAL_H 1
+#endif
+
+#ifndef DK3_HAVE_SIGSET
+/** DK3 version of HAVE_SIGSET.
+*/
+#define DK3_HAVE_SIGSET 1
+#endif
+
+#ifndef DK3_HAVE_SIG_ATOMIC_T
+/** DK3 version of HAVE_SIG_ATOMIC_T.
+*/
+#define DK3_HAVE_SIG_ATOMIC_T 1
+#endif
+
+#ifndef DK3_HAVE_SINHL
+/** DK3 version of HAVE_SINHL.
+*/
+#define DK3_HAVE_SINHL 1
+#endif
+
+#ifndef DK3_HAVE_SINL
+/** DK3 version of HAVE_SINL.
+*/
+#define DK3_HAVE_SINL 1
+#endif
+
+#ifndef DK3_HAVE_SNPRINTF
+/** DK3 version of HAVE_SNPRINTF.
+*/
+#define DK3_HAVE_SNPRINTF 1
+#endif
+
+#ifndef DK3_HAVE_SNWPRINTF
+/** DK3 version of HAVE_SNWPRINTF.
+*/
+#define DK3_HAVE_SNWPRINTF 0
+#endif
+
+#ifndef DK3_HAVE_SOCKET
+/** DK3 version of HAVE_SOCKET.
+*/
+#define DK3_HAVE_SOCKET 1
+#endif
+
+#ifndef DK3_HAVE_SOCKLEN_T
+/** DK3 version of HAVE_SOCKLEN_T.
+*/
+#define DK3_HAVE_SOCKLEN_T 1
+#endif
+
+#ifndef DK3_HAVE_SPRINTF_S
+/** DK3 version of HAVE_SPRINTF_S.
+*/
+#define DK3_HAVE_SPRINTF_S 0
+#endif
+
+#ifndef DK3_HAVE_SQRTL
+/** DK3 version of HAVE_SQRTL.
+*/
+#define DK3_HAVE_SQRTL 1
+#endif
+
+#ifndef DK3_HAVE_SRAND
+/** DK3 version of HAVE_SRAND.
+*/
+#define DK3_HAVE_SRAND 1
+#endif
+
+#ifndef DK3_HAVE_SSCANF_S
+/** DK3 version of HAVE_SSCANF_S.
+*/
+#define DK3_HAVE_SSCANF_S 0
+#endif
+
+#ifndef DK3_HAVE_SSIZE_T
+/** DK3 version of HAVE_SSIZE_T.
+*/
+#define DK3_HAVE_SSIZE_T 1
+#endif
+
+#ifndef DK3_HAVE_STAT
+/** DK3 version of HAVE_STAT.
+*/
+#define DK3_HAVE_STAT 1
+#endif
+
+#ifndef DK3_HAVE_STAT32
+/** DK3 version of HAVE_STAT32.
+*/
+#define DK3_HAVE_STAT32 0
+#endif
+
+#ifndef DK3_HAVE_STAT64
+/** DK3 version of HAVE_STAT64.
+*/
+#define DK3_HAVE_STAT64 1
+#endif
+
+#ifndef DK3_HAVE_STDARG_H
+/** DK3 version of HAVE_STDARG_H.
+*/
+#define DK3_HAVE_STDARG_H 1
+#endif
+
+#ifndef DK3_HAVE_STDDEF_H
+/** DK3 version of HAVE_STDDEF_H.
+*/
+#define DK3_HAVE_STDDEF_H 1
+#endif
+
+#ifndef DK3_HAVE_STDINT_H
+/** DK3 version of HAVE_STDINT_H.
+*/
+#define DK3_HAVE_STDINT_H 1
+#endif
+
+#ifndef DK3_HAVE_STDIO_H
+/** DK3 version of HAVE_STDIO_H.
+*/
+#define DK3_HAVE_STDIO_H 1
+#endif
+
+#ifndef DK3_HAVE_STDLIB_H
+/** DK3 version of HAVE_STDLIB_H.
+*/
+#define DK3_HAVE_STDLIB_H 1
+#endif
+
+#ifndef DK3_HAVE_STRCASECMP
+/** DK3 version of HAVE_STRCASECMP.
+*/
+#define DK3_HAVE_STRCASECMP 1
+#endif
+
+#ifndef DK3_HAVE_STRCAT
+/** DK3 version of HAVE_STRCAT.
+*/
+#define DK3_HAVE_STRCAT 1
+#endif
+
+#ifndef DK3_HAVE_STRCAT_S
+/** DK3 version of HAVE_STRCAT_S.
+*/
+#define DK3_HAVE_STRCAT_S 0
+#endif
+
+#ifndef DK3_HAVE_STRCHR
+/** DK3 version of HAVE_STRCHR.
+*/
+#define DK3_HAVE_STRCHR 1
+#endif
+
+#ifndef DK3_HAVE_STRCMP
+/** DK3 version of HAVE_STRCMP.
+*/
+#define DK3_HAVE_STRCMP 1
+#endif
+
+#ifndef DK3_HAVE_STRCPY
+/** DK3 version of HAVE_STRCPY.
+*/
+#define DK3_HAVE_STRCPY 1
+#endif
+
+#ifndef DK3_HAVE_STRCPY_S
+/** DK3 version of HAVE_STRCPY_S.
+*/
+#define DK3_HAVE_STRCPY_S 0
+#endif
+
+#ifndef DK3_HAVE_STRDUP
+/** DK3 version of HAVE_STRDUP.
+*/
+#define DK3_HAVE_STRDUP 1
+#endif
+
+#ifndef DK3_HAVE_STRERROR
+/** DK3 version of HAVE_STRERROR.
+*/
+#define DK3_HAVE_STRERROR 1
+#endif
+
+#ifndef DK3_HAVE_STRICMP
+/** DK3 version of HAVE_STRICMP.
+*/
+#define DK3_HAVE_STRICMP 0
+#endif
+
+#ifndef DK3_HAVE_STRINGS_H
+/** DK3 version of HAVE_STRINGS_H.
+*/
+#define DK3_HAVE_STRINGS_H 1
+#endif
+
+#ifndef DK3_HAVE_STRING_H
+/** DK3 version of HAVE_STRING_H.
+*/
+#define DK3_HAVE_STRING_H 1
+#endif
+
+#ifndef DK3_HAVE_STRLEN
+/** DK3 version of HAVE_STRLEN.
+*/
+#define DK3_HAVE_STRLEN 1
+#endif
+
+#ifndef DK3_HAVE_STRNCMP
+/** DK3 version of HAVE_STRNCMP.
+*/
+#define DK3_HAVE_STRNCMP 1
+#endif
+
+#ifndef DK3_HAVE_STRNCPY
+/** DK3 version of HAVE_STRNCPY.
+*/
+#define DK3_HAVE_STRNCPY 1
+#endif
+
+#ifndef DK3_HAVE_STRNCPY_S
+/** DK3 version of HAVE_STRNCPY_S.
+*/
+#define DK3_HAVE_STRNCPY_S 0
+#endif
+
+#ifndef DK3_HAVE_STROPTS_H
+/** DK3 version of HAVE_STROPTS_H.
+*/
+#define DK3_HAVE_STROPTS_H 0
+#endif
+
+#ifndef DK3_HAVE_STRRCHR
+/** DK3 version of HAVE_STRRCHR.
+*/
+#define DK3_HAVE_STRRCHR 1
+#endif
+
+#ifndef DK3_HAVE_STRTOD
+/** DK3 version of HAVE_STRTOD.
+*/
+#define DK3_HAVE_STRTOD 1
+#endif
+
+#ifndef DK3_HAVE_STRTOIMAX
+/** DK3 version of HAVE_STRTOIMAX.
+*/
+#define DK3_HAVE_STRTOIMAX 1
+#endif
+
+#ifndef DK3_HAVE_STRTOL
+/** DK3 version of HAVE_STRTOL.
+*/
+#define DK3_HAVE_STRTOL 1
+#endif
+
+#ifndef DK3_HAVE_STRTOLL
+/** DK3 version of HAVE_STRTOLL.
+*/
+#define DK3_HAVE_STRTOLL 1
+#endif
+
+#ifndef DK3_HAVE_STRTOUL
+/** DK3 version of HAVE_STRTOUL.
+*/
+#define DK3_HAVE_STRTOUL 1
+#endif
+
+#ifndef DK3_HAVE_STRTOULL
+/** DK3 version of HAVE_STRTOULL.
+*/
+#define DK3_HAVE_STRTOULL 1
+#endif
+
+#ifndef DK3_HAVE_STRTOUMAX
+/** DK3 version of HAVE_STRTOUMAX.
+*/
+#define DK3_HAVE_STRTOUMAX 1
+#endif
+
+#ifndef DK3_HAVE_STRUCT_ADDRINFO
+/** DK3 version of HAVE_STRUCT_ADDRINFO.
+*/
+#define DK3_HAVE_STRUCT_ADDRINFO 1
+#endif
+
+#ifndef DK3_HAVE_STRUCT_SOCKADDR_IN
+/** DK3 version of HAVE_STRUCT_SOCKADDR_IN.
+*/
+#define DK3_HAVE_STRUCT_SOCKADDR_IN 1
+#endif
+
+#ifndef DK3_HAVE_STRUCT_SOCKADDR_IN6
+/** DK3 version of HAVE_STRUCT_SOCKADDR_IN6.
+*/
+#define DK3_HAVE_STRUCT_SOCKADDR_IN6 1
+#endif
+
+#ifndef DK3_HAVE_STRUCT_SOCKADDR_STORAGE
+/** DK3 version of HAVE_STRUCT_SOCKADDR_STORAGE.
+*/
+#define DK3_HAVE_STRUCT_SOCKADDR_STORAGE 1
+#endif
+
+#ifndef DK3_HAVE_STRUCT_SOCKADDR_UN
+/** DK3 version of HAVE_STRUCT_SOCKADDR_UN.
+*/
+#define DK3_HAVE_STRUCT_SOCKADDR_UN 1
+#endif
+
+#ifndef DK3_HAVE_SWSCANF_S
+/** DK3 version of HAVE_SWSCANF_S.
+*/
+#define DK3_HAVE_SWSCANF_S 0
+#endif
+
+#ifndef DK3_HAVE_SYSCONF
+/** DK3 version of HAVE_SYSCONF.
+*/
+#define DK3_HAVE_SYSCONF 1
+#endif
+
+#ifndef DK3_HAVE_SYSCTL
+/** DK3 version of HAVE_SYSCTL.
+*/
+#define DK3_HAVE_SYSCTL 1
+#endif
+
+#ifndef DK3_HAVE_SYSLOG
+/** DK3 version of HAVE_SYSLOG.
+*/
+#define DK3_HAVE_SYSLOG 1
+#endif
+
+#ifndef DK3_HAVE_SYSLOG_H
+/** DK3 version of HAVE_SYSLOG_H.
+*/
+#define DK3_HAVE_SYSLOG_H 1
+#endif
+
+#ifndef DK3_HAVE_SYSRES_H
+/** DK3 version of HAVE_SYSRES_H.
+*/
+#define DK3_HAVE_SYSRES_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_FILE_H
+/** DK3 version of HAVE_SYS_FILE_H.
+*/
+#define DK3_HAVE_SYS_FILE_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_PARAM_H
+/** DK3 version of HAVE_SYS_PARAM_H.
+*/
+#define DK3_HAVE_SYS_PARAM_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_RESOURCE_H
+/** DK3 version of HAVE_SYS_RESOURCE_H.
+*/
+#define DK3_HAVE_SYS_RESOURCE_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_SOCKET_H
+/** DK3 version of HAVE_SYS_SOCKET_H.
+*/
+#define DK3_HAVE_SYS_SOCKET_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_STATVFS_H
+/** DK3 version of HAVE_SYS_STATVFS_H.
+*/
+#define DK3_HAVE_SYS_STATVFS_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_STAT_H
+/** DK3 version of HAVE_SYS_STAT_H.
+*/
+#define DK3_HAVE_SYS_STAT_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_STROPTS_H
+/** DK3 version of HAVE_SYS_STROPTS_H.
+*/
+#define DK3_HAVE_SYS_STROPTS_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_SUNDDI_H
+/** DK3 version of HAVE_SYS_SUNDDI_H.
+*/
+#define DK3_HAVE_SYS_SUNDDI_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_SYSCTL_H
+/** DK3 version of HAVE_SYS_SYSCTL_H.
+*/
+#define DK3_HAVE_SYS_SYSCTL_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_SYSTEMINFO_H
+/** DK3 version of HAVE_SYS_SYSTEMINFO_H.
+*/
+#define DK3_HAVE_SYS_SYSTEMINFO_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_TERMIOS_H
+/** DK3 version of HAVE_SYS_TERMIOS_H.
+*/
+#define DK3_HAVE_SYS_TERMIOS_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_TIME_H
+/** DK3 version of HAVE_SYS_TIME_H.
+*/
+#define DK3_HAVE_SYS_TIME_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_TTOLD_H
+/** DK3 version of HAVE_SYS_TTOLD_H.
+*/
+#define DK3_HAVE_SYS_TTOLD_H 0
+#endif
+
+#ifndef DK3_HAVE_SYS_TYPES_H
+/** DK3 version of HAVE_SYS_TYPES_H.
+*/
+#define DK3_HAVE_SYS_TYPES_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_UIO_H
+/** DK3 version of HAVE_SYS_UIO_H.
+*/
+#define DK3_HAVE_SYS_UIO_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_UN_H
+/** DK3 version of HAVE_SYS_UN_H.
+*/
+#define DK3_HAVE_SYS_UN_H 1
+#endif
+
+#ifndef DK3_HAVE_SYS_WAIT_H
+/** DK3 version of HAVE_SYS_WAIT_H.
+*/
+#define DK3_HAVE_SYS_WAIT_H 1
+#endif
+
+#ifndef DK3_HAVE_TANHL
+/** DK3 version of HAVE_TANHL.
+*/
+#define DK3_HAVE_TANHL 1
+#endif
+
+#ifndef DK3_HAVE_TANL
+/** DK3 version of HAVE_TANL.
+*/
+#define DK3_HAVE_TANL 1
+#endif
+
+#ifndef DK3_HAVE_TCFLUSH
+/** DK3 version of HAVE_TCFLUSH.
+*/
+#define DK3_HAVE_TCFLUSH 1
+#endif
+
+#ifndef DK3_HAVE_TCGETATTR
+/** DK3 version of HAVE_TCGETATTR.
+*/
+#define DK3_HAVE_TCGETATTR 1
+#endif
+
+#ifndef DK3_HAVE_TERMIOS_H
+/** DK3 version of HAVE_TERMIOS_H.
+*/
+#define DK3_HAVE_TERMIOS_H 1
+#endif
+
+#ifndef DK3_HAVE_TIFF_H
+/** DK3 version of HAVE_TIFF_H.
+*/
+#define DK3_HAVE_TIFF_H 1
+#endif
+
+#ifndef DK3_HAVE_TIME
+/** DK3 version of HAVE_TIME.
+*/
+#define DK3_HAVE_TIME 1
+#endif
+
+#ifndef DK3_HAVE_TIME_H
+/** DK3 version of HAVE_TIME_H.
+*/
+#define DK3_HAVE_TIME_H 1
+#endif
+
+#ifndef DK3_HAVE_TWOS_COMPLEMENT
+/** DK3 version of HAVE_TWOS_COMPLEMENT.
+*/
+#define DK3_HAVE_TWOS_COMPLEMENT 1
+#endif
+
+#ifndef DK3_HAVE_UMASK
+/** DK3 version of HAVE_UMASK.
+*/
+#define DK3_HAVE_UMASK 1
+#endif
+
+#ifndef DK3_HAVE_UNISTD_H
+/** DK3 version of HAVE_UNISTD_H.
+*/
+#define DK3_HAVE_UNISTD_H 1
+#endif
+
+#ifndef DK3_HAVE_UNLINK
+/** DK3 version of HAVE_UNLINK.
+*/
+#define DK3_HAVE_UNLINK 1
+#endif
+
+#ifndef DK3_HAVE_USER_NAMES_CASE_INSENSITIVE
+/** DK3 version of HAVE_USER_NAMES_CASE_INSENSITIVE.
+*/
+#define DK3_HAVE_USER_NAMES_CASE_INSENSITIVE 0
+#endif
+
+#ifndef DK3_HAVE_VARARGS_H
+/** DK3 version of HAVE_VARARGS_H.
+*/
+#define DK3_HAVE_VARARGS_H 0
+#endif
+
+#ifndef DK3_HAVE_VARARG_H
+/** DK3 version of HAVE_VARARG_H.
+*/
+#define DK3_HAVE_VARARG_H 0
+#endif
+
+#ifndef DK3_HAVE_VOLATILE
+/** DK3 version of HAVE_VOLATILE.
+*/
+#define DK3_HAVE_VOLATILE 1
+#endif
+
+#ifndef DK3_HAVE_WCHAR_H
+/** DK3 version of HAVE_WCHAR_H.
+*/
+#define DK3_HAVE_WCHAR_H 1
+#endif
+
+#ifndef DK3_HAVE_WCHAR_T
+/** DK3 version of HAVE_WCHAR_T.
+*/
+#define DK3_HAVE_WCHAR_T 1
+#endif
+
+#ifndef DK3_HAVE_WCSCAT
+/** DK3 version of HAVE_WCSCAT.
+*/
+#define DK3_HAVE_WCSCAT 1
+#endif
+
+#ifndef DK3_HAVE_WCSCAT_S
+/** DK3 version of HAVE_WCSCAT_S.
+*/
+#define DK3_HAVE_WCSCAT_S 0
+#endif
+
+#ifndef DK3_HAVE_WCSCHR
+/** DK3 version of HAVE_WCSCHR.
+*/
+#define DK3_HAVE_WCSCHR 1
+#endif
+
+#ifndef DK3_HAVE_WCSCMP
+/** DK3 version of HAVE_WCSCMP.
+*/
+#define DK3_HAVE_WCSCMP 1
+#endif
+
+#ifndef DK3_HAVE_WCSCPY
+/** DK3 version of HAVE_WCSCPY.
+*/
+#define DK3_HAVE_WCSCPY 1
+#endif
+
+#ifndef DK3_HAVE_WCSCPY_S
+/** DK3 version of HAVE_WCSCPY_S.
+*/
+#define DK3_HAVE_WCSCPY_S 0
+#endif
+
+#ifndef DK3_HAVE_WCSDUP
+/** DK3 version of HAVE_WCSDUP.
+*/
+#define DK3_HAVE_WCSDUP 1
+#endif
+
+#ifndef DK3_HAVE_WCSICMP
+/** DK3 version of HAVE_WCSICMP.
+*/
+#define DK3_HAVE_WCSICMP 0
+#endif
+
+#ifndef DK3_HAVE_WCSLEN
+/** DK3 version of HAVE_WCSLEN.
+*/
+#define DK3_HAVE_WCSLEN 1
+#endif
+
+#ifndef DK3_HAVE_WCSNCMP
+/** DK3 version of HAVE_WCSNCMP.
+*/
+#define DK3_HAVE_WCSNCMP 1
+#endif
+
+#ifndef DK3_HAVE_WCSNCPY
+/** DK3 version of HAVE_WCSNCPY.
+*/
+#define DK3_HAVE_WCSNCPY 1
+#endif
+
+#ifndef DK3_HAVE_WCSNCPY_S
+/** DK3 version of HAVE_WCSNCPY_S.
+*/
+#define DK3_HAVE_WCSNCPY_S 0
+#endif
+
+#ifndef DK3_HAVE_WCSRCHR
+/** DK3 version of HAVE_WCSRCHR.
+*/
+#define DK3_HAVE_WCSRCHR 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOD
+/** DK3 version of HAVE_WCSTOD.
+*/
+#define DK3_HAVE_WCSTOD 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOIMAX
+/** DK3 version of HAVE_WCSTOIMAX.
+*/
+#define DK3_HAVE_WCSTOIMAX 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOL
+/** DK3 version of HAVE_WCSTOL.
+*/
+#define DK3_HAVE_WCSTOL 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOLL
+/** DK3 version of HAVE_WCSTOLL.
+*/
+#define DK3_HAVE_WCSTOLL 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOUL
+/** DK3 version of HAVE_WCSTOUL.
+*/
+#define DK3_HAVE_WCSTOUL 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOULL
+/** DK3 version of HAVE_WCSTOULL.
+*/
+#define DK3_HAVE_WCSTOULL 1
+#endif
+
+#ifndef DK3_HAVE_WCSTOUMAX
+/** DK3 version of HAVE_WCSTOUMAX.
+*/
+#define DK3_HAVE_WCSTOUMAX 1
+#endif
+
+#ifndef DK3_HAVE_WINBASE_H
+/** DK3 version of HAVE_WINBASE_H.
+*/
+#define DK3_HAVE_WINBASE_H 0
+#endif
+
+#ifndef DK3_HAVE_WINCON_H
+/** DK3 version of HAVE_WINCON_H.
+*/
+#define DK3_HAVE_WINCON_H 0
+#endif
+
+#ifndef DK3_HAVE_WINDOWS_H
+/** DK3 version of HAVE_WINDOWS_H.
+*/
+#define DK3_HAVE_WINDOWS_H 0
+#endif
+
+#ifndef DK3_HAVE_WINREG_H
+/** DK3 version of HAVE_WINREG_H.
+*/
+#define DK3_HAVE_WINREG_H 0
+#endif
+
+#ifndef DK3_HAVE_WINSOCK2_H
+/** DK3 version of HAVE_WINSOCK2_H.
+*/
+#define DK3_HAVE_WINSOCK2_H 0
+#endif
+
+#ifndef DK3_HAVE_WRITE
+/** DK3 version of HAVE_WRITE.
+*/
+#define DK3_HAVE_WRITE 1
+#endif
+
+#ifndef DK3_HAVE_WS2TCPIP_H
+/** DK3 version of HAVE_WS2TCPIP_H.
+*/
+#define DK3_HAVE_WS2TCPIP_H 0
+#endif
+
+#ifndef DK3_HAVE_ZLIB_H
+/** DK3 version of HAVE_ZLIB_H.
+*/
+#define DK3_HAVE_ZLIB_H 1
+#endif
+
+#ifndef DK3_HAVE__CLEARFP
+/** DK3 version of HAVE__CLEARFP.
+*/
+#define DK3_HAVE__CLEARFP 0
+#endif
+
+#ifndef DK3_HAVE__FCLOSE
+/** DK3 version of HAVE__FCLOSE.
+*/
+#define DK3_HAVE__FCLOSE 0
+#endif
+
+#ifndef DK3_HAVE__FEOF
+/** DK3 version of HAVE__FEOF.
+*/
+#define DK3_HAVE__FEOF 0
+#endif
+
+#ifndef DK3_HAVE__FERROR
+/** DK3 version of HAVE__FERROR.
+*/
+#define DK3_HAVE__FERROR 0
+#endif
+
+#ifndef DK3_HAVE__FFLUSH
+/** DK3 version of HAVE__FFLUSH.
+*/
+#define DK3_HAVE__FFLUSH 0
+#endif
+
+#ifndef DK3_HAVE__FOPEN
+/** DK3 version of HAVE__FOPEN.
+*/
+#define DK3_HAVE__FOPEN 0
+#endif
+
+#ifndef DK3_HAVE__FREAD
+/** DK3 version of HAVE__FREAD.
+*/
+#define DK3_HAVE__FREAD 0
+#endif
+
+#ifndef DK3_HAVE__FWRITE
+/** DK3 version of HAVE__FWRITE.
+*/
+#define DK3_HAVE__FWRITE 0
+#endif
+
+#ifndef DK3_HAVE__GETCWD
+/** DK3 version of HAVE__GETCWD.
+*/
+#define DK3_HAVE__GETCWD 0
+#endif
+
+#ifndef DK3_HAVE__GETENV_S
+/** DK3 version of HAVE__GETENV_S.
+*/
+#define DK3_HAVE__GETENV_S 0
+#endif
+
+#ifndef DK3_HAVE__GETPID
+/** DK3 version of HAVE__GETPID.
+*/
+#define DK3_HAVE__GETPID 0
+#endif
+
+#ifndef DK3_HAVE__LSTAT
+/** DK3 version of HAVE__LSTAT.
+*/
+#define DK3_HAVE__LSTAT 0
+#endif
+
+#ifndef DK3_HAVE__LSTAT32
+/** DK3 version of HAVE__LSTAT32.
+*/
+#define DK3_HAVE__LSTAT32 0
+#endif
+
+#ifndef DK3_HAVE__LSTAT64
+/** DK3 version of HAVE__LSTAT64.
+*/
+#define DK3_HAVE__LSTAT64 0
+#endif
+
+#ifndef DK3_HAVE__MKDIR
+/** DK3 version of HAVE__MKDIR.
+*/
+#define DK3_HAVE__MKDIR 0
+#endif
+
+#ifndef DK3_HAVE__POPEN
+/** DK3 version of HAVE__POPEN.
+*/
+#define DK3_HAVE__POPEN 0
+#endif
+
+#ifndef DK3_HAVE__READ
+/** DK3 version of HAVE__READ.
+*/
+#define DK3_HAVE__READ 0
+#endif
+
+#ifndef DK3_HAVE__RMDIR
+/** DK3 version of HAVE__RMDIR.
+*/
+#define DK3_HAVE__RMDIR 0
+#endif
+
+#ifndef DK3_HAVE__SNPRINTF
+/** DK3 version of HAVE__SNPRINTF.
+*/
+#define DK3_HAVE__SNPRINTF 0
+#endif
+
+#ifndef DK3_HAVE__SNPRINTF_S
+/** DK3 version of HAVE__SNPRINTF_S.
+*/
+#define DK3_HAVE__SNPRINTF_S 0
+#endif
+
+#ifndef DK3_HAVE__SNWPRINTF
+/** DK3 version of HAVE__SNWPRINTF.
+*/
+#define DK3_HAVE__SNWPRINTF 0
+#endif
+
+#ifndef DK3_HAVE__SNWPRINTF_S
+/** DK3 version of HAVE__SNWPRINTF_S.
+*/
+#define DK3_HAVE__SNWPRINTF_S 0
+#endif
+
+#ifndef DK3_HAVE__STAT
+/** DK3 version of HAVE__STAT.
+*/
+#define DK3_HAVE__STAT 0
+#endif
+
+#ifndef DK3_HAVE__STAT32
+/** DK3 version of HAVE__STAT32.
+*/
+#define DK3_HAVE__STAT32 0
+#endif
+
+#ifndef DK3_HAVE__STAT64
+/** DK3 version of HAVE__STAT64.
+*/
+#define DK3_HAVE__STAT64 0
+#endif
+
+#ifndef DK3_HAVE__STRDUP
+/** DK3 version of HAVE__STRDUP.
+*/
+#define DK3_HAVE__STRDUP 0
+#endif
+
+#ifndef DK3_HAVE__STRICMP
+/** DK3 version of HAVE__STRICMP.
+*/
+#define DK3_HAVE__STRICMP 0
+#endif
+
+#ifndef DK3_HAVE__UNLINK
+/** DK3 version of HAVE__UNLINK.
+*/
+#define DK3_HAVE__UNLINK 0
+#endif
+
+#ifndef DK3_HAVE__WCSCAT
+/** DK3 version of HAVE__WCSCAT.
+*/
+#define DK3_HAVE__WCSCAT 0
+#endif
+
+#ifndef DK3_HAVE__WCSCHR
+/** DK3 version of HAVE__WCSCHR.
+*/
+#define DK3_HAVE__WCSCHR 0
+#endif
+
+#ifndef DK3_HAVE__WCSCMP
+/** DK3 version of HAVE__WCSCMP.
+*/
+#define DK3_HAVE__WCSCMP 0
+#endif
+
+#ifndef DK3_HAVE__WCSCPY
+/** DK3 version of HAVE__WCSCPY.
+*/
+#define DK3_HAVE__WCSCPY 0
+#endif
+
+#ifndef DK3_HAVE__WCSDUP
+/** DK3 version of HAVE__WCSDUP.
+*/
+#define DK3_HAVE__WCSDUP 0
+#endif
+
+#ifndef DK3_HAVE__WCSICMP
+/** DK3 version of HAVE__WCSICMP.
+*/
+#define DK3_HAVE__WCSICMP 0
+#endif
+
+#ifndef DK3_HAVE__WCSLEN
+/** DK3 version of HAVE__WCSLEN.
+*/
+#define DK3_HAVE__WCSLEN 0
+#endif
+
+#ifndef DK3_HAVE__WCSNCMP
+/** DK3 version of HAVE__WCSNCMP.
+*/
+#define DK3_HAVE__WCSNCMP 0
+#endif
+
+#ifndef DK3_HAVE__WCSNCPY
+/** DK3 version of HAVE__WCSNCPY.
+*/
+#define DK3_HAVE__WCSNCPY 0
+#endif
+
+#ifndef DK3_HAVE__WCSRCHR
+/** DK3 version of HAVE__WCSRCHR.
+*/
+#define DK3_HAVE__WCSRCHR 0
+#endif
+
+#ifndef DK3_HAVE__WFOPEN_S
+/** DK3 version of HAVE__WFOPEN_S.
+*/
+#define DK3_HAVE__WFOPEN_S 0
+#endif
+
+#ifndef DK3_HAVE__WGETENV
+/** DK3 version of HAVE__WGETENV.
+*/
+#define DK3_HAVE__WGETENV 0
+#endif
+
+#ifndef DK3_HAVE__WRITE
+/** DK3 version of HAVE__WRITE.
+*/
+#define DK3_HAVE__WRITE 0
+#endif
+
+#ifndef DK3_TIME_WITH_SYS_TIME
+/** DK3 version of TIME_WITH_SYS_TIME.
+*/
+#define DK3_TIME_WITH_SYS_TIME 1
+#endif
+
+#ifndef DK3_HAVE_WX_CHARTYPE_H
+/** DK3 version of HAVE_WX_CHARTYPE_H.
+*/
+#define DK3_HAVE_WX_CHARTYPE_H 1
+#endif
+
+#ifndef DK3_HAVE_WX_WXCHAR_H
+/** DK3 version of HAVE_WX_WXCHAR_H.
+*/
+#define DK3_HAVE_WX_WXCHAR_H 0
+#endif
+
+#ifndef DK3_SIZEOF_DOUBLE
+/** DK3 version of SIZEOF_DOUBLE.
+*/
+#define DK3_SIZEOF_DOUBLE 8
+#endif
+
+#ifndef DK3_SIZEOF_INT
+/** DK3 version of SIZEOF_INT.
+*/
+#define DK3_SIZEOF_INT 4
+#endif
+
+#ifndef DK3_SIZEOF_INTMAX_T
+/** DK3 version of SIZEOF_INTMAX_T.
+*/
+#define DK3_SIZEOF_INTMAX_T 8
+#endif
+
+#ifndef DK3_SIZEOF_LONG
+/** DK3 version of SIZEOF_LONG.
+*/
+#define DK3_SIZEOF_LONG 8
+#endif
+
+#ifndef DK3_SIZEOF_LONG_DOUBLE
+/** DK3 version of SIZEOF_LONG_DOUBLE.
+*/
+#define DK3_SIZEOF_LONG_DOUBLE 16
+#endif
+
+#ifndef DK3_SIZEOF_LONG_LONG
+/** DK3 version of SIZEOF_LONG_LONG.
+*/
+#define DK3_SIZEOF_LONG_LONG 8
+#endif
+
+#ifndef DK3_SIZEOF_SHORT
+/** DK3 version of SIZEOF_SHORT.
+*/
+#define DK3_SIZEOF_SHORT 2
+#endif
+
+#ifndef DK3_SIZEOF_SIZE_T
+/** DK3 version of SIZEOF_SIZE_T.
+*/
+#define DK3_SIZEOF_SIZE_T 8
+#endif
+
+#ifndef DK3_SIZEOF_WCHAR_T
+/** DK3 version of SIZEOF_WCHAR_T.
+*/
+#define DK3_SIZEOF_WCHAR_T 4
+#endif
+
+#endif
+/* if DK3_ON_WINDOWS */
+
+#ifndef DK3_WORDS_BIGENDIAN
+/** Little-endian.
+*/
+#define DK3_WORDS_BIGENDIAN 0
+#endif
+
+#ifndef DK3_MAX_PATH
+/** Maximum path length.
+*/
+#define DK3_MAX_PATH 4097
+#endif
+
+#if DK3_HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+/** Use 64 bit file support.
+*/
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
+#endif
+/* ifndef DK3_CONF_H_INCLUDED */
+
diff --git a/support/dktools/dk3confd.h b/support/dktools/dk3confd.h
index afcfa65112..b5e5cab6da 100644
--- a/support/dktools/dk3confd.h
+++ b/support/dktools/dk3confd.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
/** @file dk3confd.h Configuration defaults.
* This file contains default settings for systems where the
@@ -8,7 +12,7 @@
#define DK3_CONFD_H_INCLUDED 1
#ifndef DK3_ON_WINDOWS
-#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#if _WIN32
/** On a Windows system. */
#define DK3_ON_WINDOWS 1
#else
diff --git a/support/dktools/dk3config.c b/support/dktools/dk3config.c
index e647d7b538..357b43c8ae 100644
--- a/support/dktools/dk3config.c
+++ b/support/dktools/dk3config.c
@@ -1,4 +1,7 @@
-#include <stdio.h>
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -6,6 +9,14 @@
#include "dk3confd.h"
#endif
+#if HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
+#include <stdio.h>
+
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
@@ -30,6 +41,9 @@
#if HAVE_ERR_H
#include <err.h>
#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
@@ -247,14 +261,62 @@
#endif
#endif
-int main(int argc, char *argv[])
+
+#if HAVE_LARGEFILE64_SOURCE
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int
+check_largefile64(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+int
+check_largefile64(void)
+{
+ int back = 0;
+#if (HAVE_INO64_T) && (HAVE_INO_T)
+ if (sizeof(ino64_t) > sizeof(ino_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE__INO64_T) && (HAVE__INO_T)
+ if (sizeof(_ino64_t) > sizeof(_ino_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE_OFF64_T) && (HAVE_OFF_T)
+ if (sizeof(off64_t) > sizeof(off_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE__OFF64_T) && (HAVE__OFF_T)
+ if (sizeof(_off64_t) > sizeof(_off_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE_STAT64) && (HAVE_STAT)
+ if (sizeof(struct stat64) > sizeof(struct stat)) {
+ back = 1;
+ }
+#endif
+ return back;
+}
+#endif
+
+
+int main(void)
{
printf("/**\t@file dk3conf.h\tConfiguration for DK3 libraries.\n\tFeatures: Include files, functions, sizes,\n\tand endianness.\n*/\n\n");
printf("#ifndef DK3_CONF_H_INCLUDED\n");
printf("/** Avoid multiple inclusions. */\n");
printf("#define DK3_CONF_H_INCLUDED 1\n\n");
printf("#ifndef DK3_ON_WINDOWS\n");
- printf("#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)\n");
+ printf("#if _WIN32\n");
printf("/** On a Windows system. */\n");
printf("#define DK3_ON_WINDOWS\t1\n");
printf("#else\n");
@@ -645,13 +707,66 @@ int main(int argc, char *argv[])
printf("#define DK3_HAVE_ISATTY 1\n");
printf("#endif\n");
printf("\n#ifndef DK3_HAVE_ISFINITE\n");
+ printf("#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)\n");
+ printf("/**\tDK3 version of HAVE_ISFINITE.\n*/\n");
+ printf("#define DK3_HAVE_ISFINITE 1\n");
+ printf("#else\n");
printf("/**\tDK3 version of HAVE_ISFINITE.\n*/\n");
printf("#define DK3_HAVE_ISFINITE 0\n");
printf("#endif\n");
+ printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE__FINITE\n");
+ printf("/**\tDK3 version of HAVE__FINITE.\n*/\n");
+ printf("#define DK3_HAVE__FINITE 1\n");
+ printf("#endif\n");
printf("\n#ifndef DK3_HAVE_ISNORMAL\n");
+ printf("#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)\n");
+ printf("/**\tDK3 version of HAVE_ISNORMAL.\n*/\n");
+ printf("#define DK3_HAVE_ISNORMAL 1\n");
+ printf("#else\n");
printf("/**\tDK3 version of HAVE_ISNORMAL.\n*/\n");
printf("#define DK3_HAVE_ISNORMAL 0\n");
printf("#endif\n");
+ printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE_ISGREATEREQUAL\n");
+ printf("#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)\n");
+ printf("/**\tDK3 version of HAVE_ISGREATEREQUAL.\n*/\n");
+ printf("#define DK3_HAVE_ISGREATEREQUAL 1\n");
+ printf("#else\n");
+ printf("/**\tDK3 version of HAVE_ISGREATEREQUAL.\n*/\n");
+ printf("#define DK3_HAVE_ISGREATEREQUAL 0\n");
+ printf("#endif\n");
+ printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE_ISGREATER\n");
+ printf("#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)\n");
+ printf("/**\tDK3 version of HAVE_ISGREATER.\n*/\n");
+ printf("#define DK3_HAVE_ISGREATER 1\n");
+ printf("#else\n");
+ printf("/**\tDK3 version of HAVE_ISGREATER.\n*/\n");
+ printf("#define DK3_HAVE_ISGREATER 0\n");
+ printf("#endif\n");
+ printf("#endif\n");
+
+ printf("\n#ifndef DK3_HAVE_ISLESSEQUAL\n");
+ printf("#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)\n");
+ printf("/**\tDK3 version of HAVE_ISLESSEQUAL.\n*/\n");
+ printf("#define DK3_HAVE_ISLESSEQUAL 1\n");
+ printf("#else\n");
+ printf("/**\tDK3 version of HAVE_ISLESSEQUAL.\n*/\n");
+ printf("#define DK3_HAVE_ISLESSEQUAL 0\n");
+ printf("#endif\n");
+ printf("#endif\n");
+
+ printf("\n#ifndef DK3_HAVE_ISLESS\n");
+ printf("#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)\n");
+ printf("/**\tDK3 version of HAVE_ISLESS.\n*/\n");
+ printf("#define DK3_HAVE_ISLESS 0\n");
+ printf("#else\n");
+ printf("/**\tDK3 version of HAVE_ISLESS.\n*/\n");
+ printf("#define DK3_HAVE_ISLESS 0\n");
+ printf("#endif\n");
+ printf("#endif\n");
+
/* WARNING: HAVE_JPEGLIB_H not defined for Windows! */
printf("\n#ifndef DK3_HAVE_LABS\n");
printf("/**\tDK3 version of HAVE_LABS.\n*/\n");
@@ -1295,7 +1410,7 @@ int main(int argc, char *argv[])
printf("#define DK3_HAVE_TIME_H 1\n");
printf("#endif\n");
printf("\n#ifndef DK3_HAVE_TWOS_COMPLEMENT\n");
- printf("/**\tDK3 version of HAVE_TWOS_COMPLEMENT.\n*/\n");
+ printf("/**\tDK3 version of HAVE_TWOS_COMPLEMENT.\nCROSS-COMPILE: Correct if necessary.\n*/\n");
printf("#define DK3_HAVE_TWOS_COMPLEMENT 1\n");
printf("#endif\n");
printf("\n#ifndef DK3_HAVE_UMASK\n");
@@ -2392,7 +2507,7 @@ int main(int argc, char *argv[])
#endif
printf("#endif\n");
printf("\n#ifndef DK3_HAVE_IEEE_754_DOUBLE\n");
- printf("/**\tDK3 version of HAVE_IEEE_754_DOUBLE.\n*/\n");
+ printf("/**\tDK3 version of HAVE_IEEE_754_DOUBLE.\nCROSS-COMPILE: Correct if necessary.\n*/\n");
#if HAVE_IEEE_754_DOUBLE
printf("#define DK3_HAVE_IEEE_754_DOUBLE 1\n");
#else
@@ -2495,6 +2610,14 @@ int main(int argc, char *argv[])
printf("#define DK3_HAVE_ISFINITE 0\n");
#endif
printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE__FINITE\n");
+ printf("/**\tDK3 version of HAVE__FINITE.\n*/\n");
+#if HAVE__FINITE
+ printf("#define DK3_HAVE__FINITE 1\n");
+#else
+ printf("#define DK3_HAVE__FINITE 0\n");
+#endif
+ printf("#endif\n");
printf("\n#ifndef DK3_HAVE_ISNORMAL\n");
printf("/**\tDK3 version of HAVE_ISNORMAL.\n*/\n");
#if HAVE_ISNORMAL
@@ -2503,6 +2626,38 @@ int main(int argc, char *argv[])
printf("#define DK3_HAVE_ISNORMAL 0\n");
#endif
printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE_ISGREATEREQUAL\n");
+ printf("/**\tDK3 version of HAVE_ISGREATEREQUAL.\n*/\n");
+#if HAVE_ISGREATEREQUAL
+ printf("#define DK3_HAVE_ISGREATEREQUAL 1\n");
+#else
+ printf("#define DK3_HAVE_ISGREATEREQUAL 0\n");
+#endif
+ printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE_ISGREATER\n");
+ printf("/**\tDK3 version of HAVE_ISGREATER.\n*/\n");
+#if HAVE_ISGREATER
+ printf("#define DK3_HAVE_ISGREATER 1\n");
+#else
+ printf("#define DK3_HAVE_ISGREATER 0\n");
+#endif
+ printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE_ISLESSEQUAL\n");
+ printf("/**\tDK3 version of HAVE_ISLESSEQUAL.\n*/\n");
+#if HAVE_ISLESSEQUAL
+ printf("#define DK3_HAVE_ISLESSEQUAL 1\n");
+#else
+ printf("#define DK3_HAVE_ISLESSEQUAL 0\n");
+#endif
+ printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE_ISLESS\n");
+ printf("/**\tDK3 version of HAVE_ISLESS.\n*/\n");
+#if HAVE_ISLESS
+ printf("#define DK3_HAVE_ISLESS 1\n");
+#else
+ printf("#define DK3_HAVE_ISLESS 0\n");
+#endif
+ printf("#endif\n");
printf("\n#ifndef DK3_HAVE_JPEGLIB_H\n");
printf("/**\tDK3 version of HAVE_JPEGLIB_H.\n*/\n");
#if HAVE_JPEGLIB_H
@@ -2522,7 +2677,11 @@ int main(int argc, char *argv[])
printf("\n#ifndef DK3_HAVE_LARGEFILE64_SOURCE\n");
printf("/**\tDK3 version of HAVE_LARGEFILE64_SOURCE.\n*/\n");
#if HAVE_LARGEFILE64_SOURCE
- printf("#define DK3_HAVE_LARGEFILE64_SOURCE 1\n");
+ if (0 != check_largefile64()) {
+ printf("#define DK3_HAVE_LARGEFILE64_SOURCE 1\n");
+ } else {
+ printf("#define DK3_HAVE_LARGEFILE64_SOURCE 0\n");
+ }
#else
printf("#define DK3_HAVE_LARGEFILE64_SOURCE 0\n");
#endif
@@ -2735,6 +2894,14 @@ int main(int argc, char *argv[])
printf("#define DK3_HAVE_MYSQL_LIBRARY_INIT 0\n");
#endif
printf("#endif\n");
+ printf("\n#ifndef DK3_HAVE_MARIADB_MYSQL_H\n");
+ printf("/**\tDK3 version of HAVE_MARIADB_MYSQL_H.\n*/\n");
+#if HAVE_MARIADB_MYSQL_H
+ printf("#define DK3_HAVE_MARIADB_MYSQL_H 1\n");
+#else
+ printf("#define DK3_HAVE_MARIADB_MYSQL_H 0\n");
+#endif
+ printf("#endif\n");
printf("\n#ifndef DK3_HAVE_MYSQL_MYSQL_H\n");
printf("/**\tDK3 version of HAVE_MYSQL_MYSQL_H.\n*/\n");
#if HAVE_MYSQL_MYSQL_H
@@ -4480,7 +4647,19 @@ int main(int argc, char *argv[])
printf("\n#ifndef DK3_MAX_PATH\n");
printf("/**\tMaximum path length.\n*/\n");
printf("#define DK3_MAX_PATH %d\n", (MPL + 1));
- printf("#endif\n");
+ printf("#endif\n\n");
+
+/* Large file support start */
+#if HAVE_LARGEFILE64_SOURCE
+ fputs("#if DK3_HAVE_LARGEFILE64_SOURCE\n", stdout);
+ fputs("#ifndef _LARGEFILE64_SOURCE\n", stdout);
+ fputs("/**\tUse 64 bit file support.\n*/\n", stdout);
+ fputs("#define _LARGEFILE64_SOURCE 1\n", stdout);
+ fputs("#endif\n", stdout);
+ fputs("#endif\n", stdout);
+#endif
+/* Large file support end */
+
printf("\n#endif\n/* ifndef DK3_CONF_H_INCLUDED */\n\n");
exit(0); return 0;
}
diff --git a/support/dktools/dk3const.h b/support/dktools/dk3const.h
index 6ac065cd44..333fbac225 100644
--- a/support/dktools/dk3const.h
+++ b/support/dktools/dk3const.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
/** @file dk3const.h Constants for the dk3 libraries.
*/
diff --git a/support/dktools/dk3cores.c b/support/dktools/dk3cores.c
index 2a393830a6..526d2762fb 100644
--- a/support/dktools/dk3cores.c
+++ b/support/dktools/dk3cores.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2002-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk3cores.ctr
@@ -9,7 +15,7 @@
*/
-#line 67 "dk3cores.ctr"
+#line 70 "dk3cores.ctr"
#ifndef _WIN32_WINNT
/** On Windows use minimum Windows version required for functions
@@ -23,12 +29,13 @@
#include <sys/sysctl.h>
#endif
#include "dk3cores.h"
+#include "dk3unused.h"
-#line 84 "dk3cores.ctr"
+#line 88 "dk3cores.ctr"
@@ -76,11 +83,13 @@ dk3cores_is_wow64(void)
*/
static
int
-dk3cores_compare_lu(void const *l, void const *r, int cr)
+dk3cores_compare_lu(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
unsigned long const *ull;
unsigned long const *ulr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
ull = (unsigned long const *)l;
@@ -120,7 +129,7 @@ dk3cores_from_proc_cpuinfo(int *src)
size_t back = 0;
-#line 174 "dk3cores.ctr"
+#line 180 "dk3cores.ctr"
scores = dk3sto_open_app(NULL);
if(scores) {
dk3sto_set_comp(scores, dk3cores_compare_lu, 0);
@@ -133,7 +142,7 @@ dk3cores_from_proc_cpuinfo(int *src)
if(pc) {
dk3str_c8_delnl(line);
-#line 185 "dk3cores.ctr"
+#line 191 "dk3cores.ctr"
pn = dk3str_c8_next(pc, NULL);
if(0 == strcmp(pc, "core")) {
pc = pn;
@@ -151,7 +160,7 @@ dk3cores_from_proc_cpuinfo(int *src)
#endif
{
-#line 201 "dk3cores.ctr"
+#line 207 "dk3cores.ctr"
if(ul > maxul) { maxul = ul; }
if (NULL != src) { *src = DK3_CORES_SRC_CPUINFO; }
ulp = (unsigned long *)dk3sto_it_find_like(
@@ -178,43 +187,43 @@ dk3cores_from_proc_cpuinfo(int *src)
fclose(fipo);
} else {
-#line 226 "dk3cores.ctr"
+#line 232 "dk3cores.ctr"
}
dk3sto_it_reset(icores);
while(NULL != (ulp = (unsigned long *)dk3sto_it_next(icores))) {
back++;
-#line 230 "dk3cores.ctr"
+#line 236 "dk3cores.ctr"
dk3_delete(ulp);
}
dk3sto_it_close(icores);
} else {
-#line 234 "dk3cores.ctr"
+#line 240 "dk3cores.ctr"
memerr = 1;
}
dk3sto_close(scores);
} else {
-#line 238 "dk3cores.ctr"
+#line 244 "dk3cores.ctr"
memerr = 1;
}
if(memerr) {
-#line 241 "dk3cores.ctr"
+#line 247 "dk3cores.ctr"
if(back < (size_t)(maxul + 1UL)) {
-#line 242 "dk3cores.ctr"
+#line 248 "dk3cores.ctr"
back = (size_t)(maxul + 1UL);
}
}
if(back < 1) {
-#line 246 "dk3cores.ctr"
+#line 252 "dk3cores.ctr"
back = 1;
}
-#line 248 "dk3cores.ctr"
+#line 254 "dk3cores.ctr"
return back;
}
#endif
@@ -240,11 +249,11 @@ dk3cores_get_num(int *src)
#endif
-#line 272 "dk3cores.ctr"
+#line 278 "dk3cores.ctr"
#if DK3_ON_WINDOWS
if(dk3cores_is_wow64()) {
-#line 274 "dk3cores.ctr"
+#line 280 "dk3cores.ctr"
#if DK3_CHAR_SIZE > 1
fngetsysteminfo = (LPFN_GETSYSTEMINFO)GetProcAddress(
GetModuleHandleW( L"kernel32" ), "GetNativeSystemInfo"
@@ -256,13 +265,13 @@ dk3cores_get_num(int *src)
#endif
if(NULL != fngetsysteminfo) {
-#line 284 "dk3cores.ctr"
+#line 290 "dk3cores.ctr"
fngetsysteminfo(&si);
found = DK3_CORES_SRC_SYSTEM;
back = (size_t)(si.dwNumberOfProcessors);
} else {
-#line 288 "dk3cores.ctr"
+#line 294 "dk3cores.ctr"
#if DK3_CHAR_SIZE > 1
fngetsysteminfo = (LPFN_GETSYSTEMINFO)GetProcAddress(
GetModuleHandleW( L"kernel32" ), "GetSystemInfo"
@@ -274,18 +283,18 @@ dk3cores_get_num(int *src)
#endif
if(NULL != fngetsysteminfo) {
-#line 298 "dk3cores.ctr"
+#line 304 "dk3cores.ctr"
fngetsysteminfo(&si);
found = DK3_CORES_SRC_SYSTEM;
back = (size_t)(si.dwNumberOfProcessors);
} else {
-#line 302 "dk3cores.ctr"
+#line 308 "dk3cores.ctr"
}
}
} else {
-#line 305 "dk3cores.ctr"
+#line 311 "dk3cores.ctr"
#if DK3_CHAR_SIZE > 1
fngetsysteminfo = (LPFN_GETSYSTEMINFO)GetProcAddress(
GetModuleHandleW( L"kernel32" ), "GetSystemInfo"
@@ -297,22 +306,22 @@ dk3cores_get_num(int *src)
#endif
if(NULL != fngetsysteminfo) {
-#line 315 "dk3cores.ctr"
+#line 321 "dk3cores.ctr"
fngetsysteminfo(&si);
found = DK3_CORES_SRC_SYSTEM;
back = (size_t)(si.dwNumberOfProcessors);
} else {
-#line 319 "dk3cores.ctr"
+#line 325 "dk3cores.ctr"
}
}
if((DK3_CORES_SRC_NONE == found) || (back < 1)) {
-#line 322 "dk3cores.ctr"
+#line 328 "dk3cores.ctr"
ptr = getenv("NUMBER_OF_PROCESSORS");
if(ptr) {
-#line 324 "dk3cores.ctr"
+#line 330 "dk3cores.ctr"
#if VERSION_BEFORE_20140716
if(1 == sscanf(ptr, "%u", &u))
#else
@@ -320,62 +329,62 @@ dk3cores_get_num(int *src)
#endif
{
-#line 330 "dk3cores.ctr"
+#line 336 "dk3cores.ctr"
back = (size_t)u;
found = DK3_CORES_SRC_ENVIRONMENT;
} else {
-#line 333 "dk3cores.ctr"
+#line 339 "dk3cores.ctr"
}
} else {
-#line 335 "dk3cores.ctr"
+#line 341 "dk3cores.ctr"
}
}
#elif DK3_HAVE_SYSCONF && defined(_SC_NPROCESSORS_ONLN)
-#line 339 "dk3cores.ctr"
+#line 345 "dk3cores.ctr"
back = (size_t)sysconf(_SC_NPROCESSORS_ONLN);
found = DK3_CORES_SRC_SYSTEM;
#elif DK3_HAVE_SYSCONF && defined(_SC_NPROC_ONLN)
-#line 343 "dk3cores.ctr"
+#line 349 "dk3cores.ctr"
back = (size_t)sysconf(_SC_NPROC_ONLN);
found = DK3_CORES_SRC_SYSTEM;
#elif DK3_HAVE_MPCTL && defined(MPC_GETNUMSPUS)
-#line 347 "dk3cores.ctr"
+#line 353 "dk3cores.ctr"
back = (size_t)mpctl(MPC_GETNUMSPUS, NULL, NULL);
found = DK3_CORES_SRC_SYSTEM;
#elif DK3_HAVE_MPCTL && defined(MPC_GETNUMCPUS)
-#line 351 "dk3cores.ctr"
+#line 357 "dk3cores.ctr"
back = (size_t)mpctl(MPC_GETNUMCPUS, NULL, NULL);
found = DK3_CORES_SRC_SYSTEM;
#elif MACOS || (DK3_HAVE_SYSCTL && defined(CTL_HW) && defined(HW_AVAILCPU) && defined(HW_NCPU))
-#line 355 "dk3cores.ctr"
+#line 361 "dk3cores.ctr"
mib[0] = CTL_HW; mib[1] = HW_AVAILCPU; len = sizeof(count);
scres = sysctl(mib, 2, &count, &len, NULL, 0);
if((0 != scres) || (count < 1)) {
-#line 358 "dk3cores.ctr"
+#line 364 "dk3cores.ctr"
mib[0] = CTL_HW; mib[1] = HW_NCPU; len = sizeof(count);
scres = sysctl(mib, 2, &count, &len, NULL, 0);
if((0 == scres) && (count > 0)) {
-#line 361 "dk3cores.ctr"
+#line 367 "dk3cores.ctr"
back = (size_t)count;
found = DK3_CORES_SRC_SYSTEM;
}
} else {
-#line 365 "dk3cores.ctr"
+#line 371 "dk3cores.ctr"
back = (size_t)count;
found = DK3_CORES_SRC_SYSTEM;
}
@@ -383,19 +392,19 @@ dk3cores_get_num(int *src)
#if !DK3_ON_WINDOWS
if((DK3_CORES_SRC_NONE == found)) {
-#line 371 "dk3cores.ctr"
+#line 377 "dk3cores.ctr"
back = dk3cores_from_proc_cpuinfo(&found);
}
#endif
if(back < 1) {
-#line 375 "dk3cores.ctr"
+#line 381 "dk3cores.ctr"
back = 1;
}
if (NULL != src) { *src = found; }
-#line 379 "dk3cores.ctr"
+#line 385 "dk3cores.ctr"
return back;
}
@@ -412,7 +421,7 @@ dk3cores_max_threads(dk3_app_t *app, int *src)
int found = DK3_CORES_SRC_NONE; /* Information source. */
-#line 394 "dk3cores.ctr"
+#line 400 "dk3cores.ctr"
/*
Derive number of threads from number of cores.
*/
@@ -453,7 +462,7 @@ dk3cores_max_threads(dk3_app_t *app, int *src)
if (NULL != src) { *src = found; }
-#line 433 "dk3cores.ctr"
+#line 439 "dk3cores.ctr"
return back;
}
diff --git a/support/dktools/dk3cores.ctr b/support/dktools/dk3cores.ctr
index 64eb9149fa..cadedb100f 100644
--- a/support/dktools/dk3cores.ctr
+++ b/support/dktools/dk3cores.ctr
@@ -1,4 +1,7 @@
%% options
+copyright owner = Dirk Krause
+copyright year = 2002-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -77,6 +80,7 @@ dk3cores_max_threads(dk3_app_t *app, int *src);
#include <sys/sysctl.h>
#endif
#include "dk3cores.h"
+#include "dk3unused.h"
@@ -128,11 +132,13 @@ dk3cores_is_wow64(void)
*/
static
int
-dk3cores_compare_lu(void const *l, void const *r, int cr)
+dk3cores_compare_lu(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
unsigned long const *ull;
unsigned long const *ulr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
ull = (unsigned long const *)l;
diff --git a/support/dktools/dk3cores.h b/support/dktools/dk3cores.h
index 36b0db0c7e..e0804d5a5a 100644
--- a/support/dktools/dk3cores.h
+++ b/support/dktools/dk3cores.h
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2002-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk3cores.ctr
@@ -13,7 +19,7 @@
#define DK3CORES_H_INCLUDED 1
-#line 4 "dk3cores.ctr"
+#line 7 "dk3cores.ctr"
/** @defgroup coressrc Source for cores information
*/
diff --git a/support/dktools/dk3ct.c b/support/dktools/dk3ct.c
index 9ace2a196f..7418b4a397 100644
--- a/support/dktools/dk3ct.c
+++ b/support/dktools/dk3ct.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3ct.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3ct.ctr
*/
/** @file dk3ct.c The dk3ct module.
diff --git a/support/dktools/dk3ct.ctr b/support/dktools/dk3ct.ctr
index 060f8011f0..c1568692c5 100644
--- a/support/dktools/dk3ct.ctr
+++ b/support/dktools/dk3ct.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3ct.h b/support/dktools/dk3ct.h
index a69bba0390..a2c4e11bcc 100644
--- a/support/dktools/dk3ct.h
+++ b/support/dktools/dk3ct.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3ct.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3ct.ctr
*/
/** @file dk3ct.h Header file for the dk3ct module.
diff --git a/support/dktools/dk3dbi.c b/support/dktools/dk3dbi.c
index bd84766e4f..dbb316e8be 100644
--- a/support/dktools/dk3dbi.c
+++ b/support/dktools/dk3dbi.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3dbi.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3dbi.ctr
*/
/** @file dk3dbi.c The dk3dbi module.
diff --git a/support/dktools/dk3dbi.ctr b/support/dktools/dk3dbi.ctr
index 1887ce2522..bdb214c2b2 100644
--- a/support/dktools/dk3dbi.ctr
+++ b/support/dktools/dk3dbi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3dbi.h b/support/dktools/dk3dbi.h
index 3bbc97c0db..5ba48975b8 100644
--- a/support/dktools/dk3dbi.h
+++ b/support/dktools/dk3dbi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3dbi.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3dbi.ctr
*/
/** @file dk3dbi.h Header file for the dk3dbi module.
diff --git a/support/dktools/dk3dir.c b/support/dktools/dk3dir.c
index 777dc8540b..38d2084ada 100644
--- a/support/dktools/dk3dir.c
+++ b/support/dktools/dk3dir.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3dir.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3dir.ctr
*/
/** @file dk3dir.c The dk3dir module.
@@ -40,12 +18,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 124 "dk3dir.ctr"
#include "dk3all.h"
+#include "dk3unused.h"
-#line 130 "dk3dir.ctr"
+#line 131 "dk3dir.ctr"
@@ -83,9 +62,11 @@ NULL
*/
static
int
-dk3dir_compare_by_name(void const *l, void const *r, int cr)
+dk3dir_compare_by_name(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
#if DK3_ON_WINDOWS || DK3_HAVE_FNCASEINS
@@ -113,14 +94,14 @@ dk3dir_release_entries(dk3_sto_t *s, dk3_sto_it_t *i)
dkChar *p = NULL; /* Current name to release. */
-#line 196 "dk3dir.ctr"
+#line 199 "dk3dir.ctr"
if(s) {
if(i) {
dk3sto_it_reset(i);
while((p = (dkChar *)dk3sto_it_next(i)) != NULL) {
-#line 201 "dk3dir.ctr"
+#line 204 "dk3dir.ctr"
dk3_delete(p);
}
dk3sto_it_close(i);
@@ -128,7 +109,7 @@ dk3dir_release_entries(dk3_sto_t *s, dk3_sto_it_t *i)
dk3sto_close(s);
}
-#line 207 "dk3dir.ctr"
+#line 210 "dk3dir.ctr"
}
@@ -141,7 +122,7 @@ dk3dir_close(dk3_dir_t *dp)
{
-#line 218 "dk3dir.ctr"
+#line 221 "dk3dir.ctr"
if(dp) {
dk3dir_release_entries(dp->sdi, dp->idi);
dk3dir_release_entries(dp->sfi, dp->ifi);
@@ -153,7 +134,7 @@ dk3dir_close(dk3_dir_t *dp)
dk3_delete(dp);
}
-#line 228 "dk3dir.ctr"
+#line 231 "dk3dir.ctr"
}
@@ -171,7 +152,7 @@ dk3dir_new(dkChar const *dn, dk3_app_t *app)
int ok = 0; /* Flag: Success. */
-#line 244 "dk3dir.ctr"
+#line 247 "dk3dir.ctr"
back = dk3_new_app(dk3_dir_t,1,app);
if(back) {
back->sdi = NULL; back->sfi = NULL; back->idi = NULL; back->ifi = NULL;
@@ -203,7 +184,7 @@ dk3dir_new(dkChar const *dn, dk3_app_t *app)
}
}
-#line 274 "dk3dir.ctr"
+#line 277 "dk3dir.ctr"
return back;
}
@@ -215,12 +196,12 @@ dk3dir_get_directory_name(dk3_dir_t const *dir)
dkChar const *back = NULL;
-#line 284 "dk3dir.ctr"
+#line 287 "dk3dir.ctr"
if(dir) {
back = dir->dirname;
}
-#line 287 "dk3dir.ctr"
+#line 290 "dk3dir.ctr"
return back;
}
@@ -231,14 +212,14 @@ dk3dir_reset(dk3_dir_t *d)
{
-#line 296 "dk3dir.ctr"
+#line 299 "dk3dir.ctr"
if(d) {
dk3sto_it_reset(d->idi);
dk3sto_it_reset(d->ifi);
d->shortname = NULL;
}
-#line 301 "dk3dir.ctr"
+#line 304 "dk3dir.ctr"
}
@@ -251,7 +232,7 @@ dk3dir_get_number_of_directories(dk3_dir_t const *d)
back = d->ndir;
}
-#line 312 "dk3dir.ctr"
+#line 315 "dk3dir.ctr"
return back;
}
@@ -265,7 +246,7 @@ dk3dir_get_number_of_files(dk3_dir_t const *d)
back = d->nfi;
}
-#line 324 "dk3dir.ctr"
+#line 327 "dk3dir.ctr"
return back;
}
@@ -277,12 +258,12 @@ dk3dir_get_fullname(dk3_dir_t const *d)
dkChar const *back = NULL;
-#line 334 "dk3dir.ctr"
+#line 337 "dk3dir.ctr"
if(d) {
back = (dkChar const *)(d->fullname);
}
-#line 337 "dk3dir.ctr"
+#line 340 "dk3dir.ctr"
return back;
}
@@ -294,12 +275,12 @@ dk3dir_get_stat(dk3_dir_t *d)
dk3_stat_t *back = NULL;
-#line 347 "dk3dir.ctr"
+#line 350 "dk3dir.ctr"
if(d) {
back = &(d->stb);
}
-#line 350 "dk3dir.ctr"
+#line 353 "dk3dir.ctr"
return back;
}
@@ -311,12 +292,12 @@ dk3dir_get_shortname(dk3_dir_t const *d)
dkChar const *back = NULL;
-#line 360 "dk3dir.ctr"
+#line 363 "dk3dir.ctr"
if(d) {
back = (dkChar const *)(d->shortname);
}
-#line 363 "dk3dir.ctr"
+#line 366 "dk3dir.ctr"
return back;
}
@@ -337,13 +318,13 @@ dk3dir_get_next_entry(dk3_dir_t *d, dk3_sto_it_t *s, int isdir)
size_t sz = 0; /* Directory name length. */
-#line 382 "dk3dir.ctr"
+#line 385 "dk3dir.ctr"
do {
cc = 0;
d->shortname = (dkChar *)dk3sto_it_next(s);
if(d->shortname) {
-#line 386 "dk3dir.ctr"
+#line 389 "dk3dir.ctr"
cc = 1;
if(d->dirname) {
if(dk3str_len(d->dirname)) {
@@ -379,10 +360,10 @@ dk3dir_get_next_entry(dk3_dir_t *d, dk3_sto_it_t *s, int isdir)
}
}
-#line 420 "dk3dir.ctr"
+#line 423 "dk3dir.ctr"
} while(cc);
-#line 421 "dk3dir.ctr"
+#line 424 "dk3dir.ctr"
return back;
}
@@ -394,12 +375,12 @@ dk3dir_get_next_directory(dk3_dir_t *d)
int back = 0;
-#line 431 "dk3dir.ctr"
+#line 434 "dk3dir.ctr"
if(d) {
back = dk3dir_get_next_entry(d, d->idi, 1);
}
-#line 434 "dk3dir.ctr"
+#line 437 "dk3dir.ctr"
return back;
}
@@ -411,12 +392,12 @@ dk3dir_get_next_file(dk3_dir_t *d)
int back = 0;
-#line 444 "dk3dir.ctr"
+#line 447 "dk3dir.ctr"
if(d) {
back = dk3dir_get_next_entry(d, d->ifi, 0);
}
-#line 447 "dk3dir.ctr"
+#line 450 "dk3dir.ctr"
return back;
}
@@ -437,7 +418,7 @@ dk3dir_add(dk3_sto_t *s, dkChar const *n, dk3_um_t *c, int *ec, dk3_app_t *app)
dk3_um_t mu = DK3_UM_0; /* Number of entries. */
-#line 466 "dk3dir.ctr"
+#line 469 "dk3dir.ctr"
newname = dk3str_dup_app(n,(((*ec) & 1) ? NULL : app));
if(newname) {
if(dk3sto_add(s, newname)) {
@@ -448,15 +429,15 @@ dk3dir_add(dk3_sto_t *s, dkChar const *n, dk3_um_t *c, int *ec, dk3_app_t *app)
dk3_delete(newname);
*ec |= 2;
-#line 475 "dk3dir.ctr"
+#line 478 "dk3dir.ctr"
}
} else {
*ec |= 1;
-#line 478 "dk3dir.ctr"
+#line 481 "dk3dir.ctr"
}
-#line 479 "dk3dir.ctr"
+#line 482 "dk3dir.ctr"
}
@@ -538,7 +519,7 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
struct _wfinddata64_t ffdata; /* Find data. */
-#line 559 "dk3dir.ctr"
+#line 562 "dk3dir.ctr"
if(fn) {
if(dk3str_len(fn) < DK3_MAX_PATH) {
dk3str_cpy_not_overlapped(mybuffer, fn);
@@ -553,25 +534,25 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
}
if(back) {
-#line 572 "dk3dir.ctr"
+#line 575 "dk3dir.ctr"
ffres = _wfindfirst64(mybuffer, &ffdata);
if(ffres != -1) {
do {
-#line 575 "dk3dir.ctr"
+#line 578 "dk3dir.ctr"
if(dk3str_cmp(ffdata.name, kw[0])) {
-#line 576 "dk3dir.ctr"
+#line 579 "dk3dir.ctr"
if(dk3str_cmp(ffdata.name, kw[1])) {
-#line 577 "dk3dir.ctr"
+#line 580 "dk3dir.ctr"
if((ffdata.attrib) & _A_SUBDIR) {
-#line 578 "dk3dir.ctr"
+#line 581 "dk3dir.ctr"
dk3dir_add(back->sdi, ffdata.name, &(back->ndir), &ec, app);
} else {
-#line 580 "dk3dir.ctr"
+#line 583 "dk3dir.ctr"
dk3dir_add(back->sfi, ffdata.name, &(back->nfi), &ec, app);
}
}
@@ -600,7 +581,7 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
}
}
-#line 607 "dk3dir.ctr"
+#line 610 "dk3dir.ctr"
return back;
}
@@ -624,7 +605,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
int isDir; /* Flag: Entry is dir. */
-#line 629 "dk3dir.ctr"
+#line 632 "dk3dir.ctr"
ec = 0;
if(dn) {
ok = 0;
@@ -632,7 +613,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
if(dk3str_len(dn) < DK3_SIZEOF(b1,dkChar)) {
ok = 1;
-#line 635 "dk3dir.ctr"
+#line 638 "dk3dir.ctr"
dk3str_cpy_not_overlapped(b1, dn);
dk3str_cpy_not_overlapped(b2, dn);
p1 = dk3str_rchr(b1, DK3_CHAR_SEP);
@@ -643,7 +624,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
} else {
-#line 644 "dk3dir.ctr"
+#line 647 "dk3dir.ctr"
/* ERROR: Name too long! */
if(app) {
dk3app_log_i3(app, DK3_LL_ERROR, 65, 66, dn);
@@ -654,7 +635,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
if(sz < DK3_SIZEOF(b1,dkChar)) {
ok = 1;
-#line 653 "dk3dir.ctr"
+#line 656 "dk3dir.ctr"
dk3str_cpy_not_overlapped(b1, dn);
dk3str_cpy_not_overlapped(b2, dn);
sz = dk3str_len(b2);
@@ -665,7 +646,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
} else {
-#line 662 "dk3dir.ctr"
+#line 665 "dk3dir.ctr"
/* Name too long! */
if(app) {
dk3app_log_i3(app, DK3_LL_ERROR, 59, 60, dn);
@@ -674,23 +655,23 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
if(ok) {
-#line 669 "dk3dir.ctr"
+#line 672 "dk3dir.ctr"
back = dk3dir_new(b1, app);
if(back) {
-#line 671 "dk3dir.ctr"
+#line 674 "dk3dir.ctr"
hSearch = FindFirstFileW(b2, &wfd);
if(INVALID_HANDLE_VALUE != hSearch) {
-#line 673 "dk3dir.ctr"
+#line 676 "dk3dir.ctr"
do {
isDir = 0;
-#line 675 "dk3dir.ctr"
+#line 678 "dk3dir.ctr"
if(dk3str_cmp(wfd.cFileName, kw[0])) {
if(dk3str_cmp(wfd.cFileName, kw[1])) {
-#line 677 "dk3dir.ctr"
+#line 680 "dk3dir.ctr"
if((wfd.dwFileAttributes) & FILE_ATTRIBUTE_DIRECTORY) {
isDir = 1;
#if 0
@@ -705,11 +686,11 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
if(isDir) {
-#line 690 "dk3dir.ctr"
+#line 693 "dk3dir.ctr"
dk3dir_add(back->sdi, wfd.cFileName, &(back->ndir), &ec, app);
} else {
-#line 692 "dk3dir.ctr"
+#line 695 "dk3dir.ctr"
dk3dir_add(back->sfi, wfd.cFileName, &(back->nfi), &ec, app);
}
}
@@ -718,7 +699,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
FindClose(hSearch);
} else {
-#line 699 "dk3dir.ctr"
+#line 702 "dk3dir.ctr"
/* ERROR: Failed to search for pattern! */
ec |= 16;
if(app) {
@@ -739,15 +720,15 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
} else {
-#line 718 "dk3dir.ctr"
+#line 721 "dk3dir.ctr"
}
}
} else {
-#line 721 "dk3dir.ctr"
+#line 724 "dk3dir.ctr"
}
-#line 722 "dk3dir.ctr"
+#line 725 "dk3dir.ctr"
return back;
}
@@ -759,11 +740,11 @@ dk3dir_open_app(dkChar const *dn, dk3_app_t *app)
dk3_dir_t *back;
-#line 732 "dk3dir.ctr"
+#line 735 "dk3dir.ctr"
back = dk3dir_my_open_app(dn, 0, app);
-#line 734 "dk3dir.ctr"
+#line 737 "dk3dir.ctr"
return back;
}
@@ -774,11 +755,11 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
dk3_dir_t *back;
-#line 743 "dk3dir.ctr"
+#line 746 "dk3dir.ctr"
back = dk3dir_my_open_app(fn, 1, app);
-#line 745 "dk3dir.ctr"
+#line 748 "dk3dir.ctr"
return back;
}
@@ -864,7 +845,7 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
struct __finddata64_t ffdata; /* Find data. */
-#line 829 "dk3dir.ctr"
+#line 832 "dk3dir.ctr"
if(fn) {
if(dk3str_len(fn) < DK3_MAX_PATH) {
dk3str_cpy_not_overlapped(mybuffer, fn);
@@ -916,7 +897,7 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
}
}
-#line 879 "dk3dir.ctr"
+#line 882 "dk3dir.ctr"
return back;
}
@@ -941,7 +922,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
int isDir; /* Flag: Entry is dir. */
-#line 902 "dk3dir.ctr"
+#line 905 "dk3dir.ctr"
ec = 0;
if(dn) {
ok = 0;
@@ -949,7 +930,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
if(dk3str_len(dn) < DK3_SIZEOF(b1,dkChar)) {
ok = 1;
-#line 908 "dk3dir.ctr"
+#line 911 "dk3dir.ctr"
dk3str_cpy_not_overlapped(b1, dn);
dk3str_cpy_not_overlapped(b2, dn);
p1 = dk3str_rchr(b1, DK3_CHAR_SEP);
@@ -960,7 +941,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
} else {
-#line 917 "dk3dir.ctr"
+#line 920 "dk3dir.ctr"
/* ERROR: Name too long! */
if(app) {
dk3app_log_i3(app, DK3_LL_ERROR, 65, 66, dn);
@@ -971,7 +952,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
if(sz < DK3_SIZEOF(b1,dkChar)) {
ok = 1;
-#line 926 "dk3dir.ctr"
+#line 929 "dk3dir.ctr"
dk3str_cpy_not_overlapped(b1, dn);
dk3str_cpy_not_overlapped(b2, dn);
sz = dk3str_len(b2);
@@ -982,7 +963,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
} else {
-#line 935 "dk3dir.ctr"
+#line 938 "dk3dir.ctr"
/* ERROR: Name too long! */
if(app) {
dk3app_log_i3(app, DK3_LL_ERROR, 59, 60, dn);
@@ -991,23 +972,23 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
if(ok) {
-#line 942 "dk3dir.ctr"
+#line 945 "dk3dir.ctr"
back = dk3dir_new(b1, app);
if(back) {
-#line 944 "dk3dir.ctr"
+#line 947 "dk3dir.ctr"
hSearch = FindFirstFileA(b2, &wfd);
if(INVALID_HANDLE_VALUE != hSearch) {
-#line 946 "dk3dir.ctr"
+#line 949 "dk3dir.ctr"
do {
isDir = 0;
-#line 948 "dk3dir.ctr"
+#line 951 "dk3dir.ctr"
if(dk3str_cmp(wfd.cFileName, kw[0])) {
if(dk3str_cmp(wfd.cFileName, kw[1])) {
-#line 950 "dk3dir.ctr"
+#line 953 "dk3dir.ctr"
if((wfd.dwFileAttributes) & FILE_ATTRIBUTE_DIRECTORY) {
isDir = 1;
#if 0
@@ -1022,11 +1003,11 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
if(isDir) {
-#line 963 "dk3dir.ctr"
+#line 966 "dk3dir.ctr"
dk3dir_add(back->sdi, wfd.cFileName, &(back->ndir), &ec, app);
} else {
-#line 965 "dk3dir.ctr"
+#line 968 "dk3dir.ctr"
dk3dir_add(back->sfi, wfd.cFileName, &(back->nfi), &ec, app);
}
}
@@ -1035,7 +1016,7 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
FindClose(hSearch);
} else {
-#line 972 "dk3dir.ctr"
+#line 975 "dk3dir.ctr"
/* ERROR: Failed to search for pattern! */
ec |= 16;
if(app) {
@@ -1056,15 +1037,15 @@ dk3dir_my_open_app(dkChar const *dn, int usefne, dk3_app_t *app)
}
} else {
-#line 991 "dk3dir.ctr"
+#line 994 "dk3dir.ctr"
}
}
} else {
-#line 994 "dk3dir.ctr"
+#line 997 "dk3dir.ctr"
}
-#line 995 "dk3dir.ctr"
+#line 998 "dk3dir.ctr"
return back;
}
@@ -1076,11 +1057,11 @@ dk3dir_open_app(dkChar const *dn, dk3_app_t *app)
dk3_dir_t *back;
-#line 1005 "dk3dir.ctr"
+#line 1008 "dk3dir.ctr"
back = dk3dir_my_open_app(dn, 0, app);
-#line 1007 "dk3dir.ctr"
+#line 1010 "dk3dir.ctr"
return back;
}
@@ -1091,11 +1072,11 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
dk3_dir_t *back;
-#line 1016 "dk3dir.ctr"
+#line 1019 "dk3dir.ctr"
back = dk3dir_my_open_app(fn, 1, app);
-#line 1018 "dk3dir.ctr"
+#line 1021 "dk3dir.ctr"
return back;
}
@@ -1126,7 +1107,7 @@ dkT("opendir: "),
NULL
-#line 1048 "dk3dir.ctr"
+#line 1051 "dk3dir.ctr"
};
@@ -1148,7 +1129,7 @@ dk3dir_open_app(dkChar const *dn, dk3_app_t *app)
dk3_stat_t stb; /* Buffer for stat() result. */
-#line 1068 "dk3dir.ctr"
+#line 1071 "dk3dir.ctr"
if(dn) {
back = dk3dir_new(dn, app);
if(back) {
@@ -1211,7 +1192,7 @@ dk3dir_open_app(dkChar const *dn, dk3_app_t *app)
}
}
-#line 1129 "dk3dir.ctr"
+#line 1132 "dk3dir.ctr"
return back;
}
@@ -1228,7 +1209,7 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
dkChar *ptr; /* Last separator in pattern. */
-#line 1144 "dk3dir.ctr"
+#line 1147 "dk3dir.ctr"
if(fn) {
if(dk3str_len(fn) < DK3_MAX_PATH) {
dk3str_cpy_not_overlapped(mybuffer, fn);
@@ -1269,7 +1250,7 @@ dk3dir_fne_open_app(dkChar const *fn, dk3_app_t *app)
}
}
-#line 1183 "dk3dir.ctr"
+#line 1186 "dk3dir.ctr"
return back;
}
diff --git a/support/dktools/dk3dir.ctr b/support/dktools/dk3dir.ctr
index 18b2b1d5f3..f50e8c90d8 100644
--- a/support/dktools/dk3dir.ctr
+++ b/support/dktools/dk3dir.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -123,6 +123,7 @@ dk3dir_remove_app(dkChar const *dn, dk3_app_t *app);
%% module
#include "dk3all.h"
+#include "dk3unused.h"
@@ -164,9 +165,11 @@ NULL
*/
static
int
-dk3dir_compare_by_name(void const *l, void const *r, int cr)
+dk3dir_compare_by_name(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
#if DK3_ON_WINDOWS || DK3_HAVE_FNCASEINS
diff --git a/support/dktools/dk3dir.h b/support/dktools/dk3dir.h
index 68eb9c7630..621281df9c 100644
--- a/support/dktools/dk3dir.h
+++ b/support/dktools/dk3dir.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3dir.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3dir.ctr
*/
/** @file dk3dir.h Header file for the dk3dir module.
diff --git a/support/dktools/dk3echo.c b/support/dktools/dk3echo.c
index 43f454eebc..ca5991cbc3 100644
--- a/support/dktools/dk3echo.c
+++ b/support/dktools/dk3echo.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3echo.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3echo.ctr
*/
/** @file dk3echo.c The dk3echo module.
@@ -42,11 +20,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "dk3echo.h"
+#include "dk3unused.h"
-#line 175 "dk3echo.ctr"
+
+#line 177 "dk3echo.ctr"
@@ -267,9 +247,11 @@ dk3echo_is_tty(dk3_echo_t *ep)
int
-dk3echo_is_tty_app(dk3_echo_t const *ep, dk3_app_t *app)
+dk3echo_is_tty_app(dk3_echo_t const *ep, dk3_app_t * DK3_ARG_UNUSED(app) )
{
int back = 0;
+
+ DK3_UNUSED_ARG(app)
if(ep) {
back = ep->is_tty;
}
diff --git a/support/dktools/dk3echo.ctr b/support/dktools/dk3echo.ctr
index 709d7cdbc6..91b514994b 100644
--- a/support/dktools/dk3echo.ctr
+++ b/support/dktools/dk3echo.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -169,6 +169,8 @@ dk3echo_test_tty(dk3_echo_t *ep);
#include "dk3all.h"
#include "dk3echo.h"
+#include "dk3unused.h"
+
$!trace-include
@@ -392,9 +394,11 @@ dk3echo_is_tty(dk3_echo_t *ep)
int
-dk3echo_is_tty_app(dk3_echo_t const *ep, dk3_app_t *app)
+dk3echo_is_tty_app(dk3_echo_t const *ep, dk3_app_t * DK3_ARG_UNUSED(app) )
{
int back = 0;
+
+ DK3_UNUSED_ARG(app)
if(ep) {
back = ep->is_tty;
}
diff --git a/support/dktools/dk3echo.h b/support/dktools/dk3echo.h
index 3de87ed4a1..9502a0785d 100644
--- a/support/dktools/dk3echo.h
+++ b/support/dktools/dk3echo.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3echo.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3echo.ctr
*/
/** @file dk3echo.h Header file for the dk3echo module.
diff --git a/support/dktools/dk3enc.c b/support/dktools/dk3enc.c
index 384db91bd5..8d09e0c664 100644
--- a/support/dktools/dk3enc.c
+++ b/support/dktools/dk3enc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3enc.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3enc.ctr
*/
/** @file dk3enc.c The dk3enc module.
*/
-#line 312 "dk3enc.ctr"
+#line 326 "dk3enc.ctr"
#include "dk3all.h"
@@ -45,7 +23,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 317 "dk3enc.ctr"
+#line 331 "dk3enc.ctr"
@@ -119,7 +97,7 @@ static char const * const dk3enc_utf8_names[] = {
NULL
-#line 385 "dk3enc.ctr"
+#line 399 "dk3enc.ctr"
};
@@ -236,6 +214,31 @@ dk3enc_htons(unsigned short x)
+unsigned long
+dk3enc_uc_to_ul(unsigned long c)
+{
+ c &= 0xFFFFFFFFUL;
+ return c;
+}
+
+
+
+unsigned long
+dk3enc_dk_to_ul(unsigned long c)
+{
+#if DK3_CHAR_SIZE > 1
+#if DK3_CHAR_SIZE > 2
+ c &= 0xFFFFFFFFUL;
+#else
+ c &= 0x0000FFFFUL;
+#endif
+#else
+ c &= 0x000000FFUL;
+#endif
+ return c;
+}
+
+
/** Convert 32-bit character to UTF-8 following RFC2279.
@param c 32-bit character to convert.
@param u8p Destination buffer.
@@ -250,7 +253,7 @@ dk3enc_uc2utf8_rfc2279(dk3_c32_t c, unsigned char *u8p, size_t u8l)
dk3_c32_t x = 0UL; /* Variable for temporary results. */
-#line 514 "dk3enc.ctr"
+#line 553 "dk3enc.ctr"
if(u8p) {
if(u8l > 0) {
if(c > (dk3_c32_t)0x7FUL) {
@@ -351,7 +354,7 @@ dk3enc_uc2utf8_rfc2279(dk3_c32_t c, unsigned char *u8p, size_t u8l)
}
}
-#line 613 "dk3enc.ctr"
+#line 652 "dk3enc.ctr"
return back;
}
@@ -382,7 +385,7 @@ dk3enc_utf82uc_rfc2279(
size_t needed_length = 0; /* Number of btes needed. */
-#line 642 "dk3enc.ctr"
+#line 681 "dk3enc.ctr"
needed_length = 0;
if(ucp) {
if(u8p) {
@@ -520,7 +523,7 @@ dk3enc_utf82uc_rfc2279(
*ucp = res;
}
-#line 778 "dk3enc.ctr"
+#line 817 "dk3enc.ctr"
return back;
}
@@ -539,11 +542,11 @@ dk3enc_uc2utf8(dk3_c32_t c, unsigned char *u8p, size_t u8l)
size_t back;
-#line 795 "dk3enc.ctr"
+#line 834 "dk3enc.ctr"
back = dk3enc_uc2utf8_rfc2279(c, u8p, u8l);
-#line 797 "dk3enc.ctr"
+#line 836 "dk3enc.ctr"
return back;
}
@@ -570,12 +573,12 @@ dk3enc_uc2utf8(dk3_c32_t c, unsigned char *u8p, size_t u8l)
size_t back = 0;
-#line 822 "dk3enc.ctr"
+#line 861 "dk3enc.ctr"
if(c <= (dk3_c32_t)0x0010FFFFUL) {
back = dk3enc_uc2utf8_rfc2279(c, u8p, u8l);
}
-#line 825 "dk3enc.ctr"
+#line 864 "dk3enc.ctr"
return back;
}
@@ -624,7 +627,9 @@ dk3enc_uc2utf16(dk3_c32_t c, dk3_c16_t *u16p, size_t u16l)
}
}
#else
- if ((0x0000D800UL > c) || (0x0000DFFF < c)) {
+ if ((0x0000D800UL > (0xFFFFFFFFUL & ((unsigned long)c)))
+ || (0x0000DFFFUL < (0xFFFFFFFFUL & ((unsigned long)c)))
+ ) {
*u16p = (dk3_c16_t)c; back = 1;
}
#endif
@@ -733,18 +738,18 @@ dk3enc_ipaddr_to_ul_app(dkChar const *str, unsigned long *ul, dk3_app_t *app)
int back = 0;
-#line 981 "dk3enc.ctr"
+#line 1022 "dk3enc.ctr"
if((str) && (ul)) {
if(dk3str_string_to_c8_simple_app(bu, sizeof(bu), str, app)) {
-#line 983 "dk3enc.ctr"
+#line 1024 "dk3enc.ctr"
back = dk3enc_c8_ipaddr_to_ul_app(bu, ul, app);
} else {
/* ERROR: Conversion failed! */
}
}
-#line 988 "dk3enc.ctr"
+#line 1029 "dk3enc.ctr"
return back;
}
@@ -762,7 +767,7 @@ dk3enc_c8_ipaddr_to_ul_app(char const *str, unsigned long *ul, dk3_app_t *app)
unsigned long ulval = 0UL; /* Resulting IP address. */
-#line 1004 "dk3enc.ctr"
+#line 1045 "dk3enc.ctr"
if(str && ul) {
state = 0; ptr = str; back = 1;
ul1 = ul2 = ul3 = ulval = 0UL;
@@ -842,7 +847,7 @@ dk3enc_c8_ipaddr_to_ul_app(char const *str, unsigned long *ul, dk3_app_t *app)
}
-#line 1082 "dk3enc.ctr"
+#line 1123 "dk3enc.ctr"
return back;
}
@@ -859,7 +864,7 @@ dk3enc_size_bin_to_a85(size_t s)
unsigned long ul3 = 0UL; /* Result division by 4. */
-#line 1097 "dk3enc.ctr"
+#line 1138 "dk3enc.ctr"
ul1 = (unsigned long)s;
ul2 = ul1 % 4UL;
ul3 = ul1 / 4UL;
@@ -875,7 +880,7 @@ dk3enc_size_bin_to_a85(size_t s)
if((unsigned long)back != ul1) back = 0;
-#line 1111 "dk3enc.ctr"
+#line 1152 "dk3enc.ctr"
return back;
#else
size_t back = 0;
@@ -884,7 +889,7 @@ dk3enc_size_bin_to_a85(size_t s)
int ec = 0; /* Error code */
-#line 1118 "dk3enc.ctr"
+#line 1159 "dk3enc.ctr"
rem = s % 4;
res = s / 4;
if (rem) { rem++; }
@@ -894,7 +899,7 @@ dk3enc_size_bin_to_a85(size_t s)
if (ec) { back = 0; }
-#line 1126 "dk3enc.ctr"
+#line 1167 "dk3enc.ctr"
return back;
#endif
}
@@ -903,13 +908,12 @@ dk3enc_size_bin_to_a85(size_t s)
/** Convert binary data to ASCII-85 encoded string.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
*/
static
void
-dk3enc_do_bin_to_ra85(char *dp, size_t ds, char const *sp, size_t ss)
+dk3enc_do_bin_to_ra85(char *dp, char const *sp, size_t ss)
{
register char const *mysp = NULL; /* Source pointer. */
register unsigned char *mydp = NULL; /* Destination pointer. */
@@ -918,7 +922,7 @@ dk3enc_do_bin_to_ra85(char *dp, size_t ds, char const *sp, size_t ss)
register short vused = 0; /* Flag: v is used. */
-#line 1148 "dk3enc.ctr"
+#line 1188 "dk3enc.ctr"
mydp = (unsigned char *)dp; mysp = sp; v = 0UL; vused = 0;
for(i = 0; i < ss; i++) {
switch(vused++) {
@@ -961,7 +965,7 @@ dk3enc_do_bin_to_ra85(char *dp, size_t ds, char const *sp, size_t ss)
}
*mydp = '\0';
-#line 1189 "dk3enc.ctr"
+#line 1229 "dk3enc.ctr"
}
@@ -975,12 +979,12 @@ dk3enc_bin_to_ra85_app(
size_t needed_size = 0; /* Destination buffer minimum size. */
-#line 1201 "dk3enc.ctr"
+#line 1241 "dk3enc.ctr"
if((dp) && (sp) && (ds) && (ss)) {
needed_size = dk3enc_size_bin_to_a85(ss);
if(needed_size) {
if(ds >= needed_size) {
- dk3enc_do_bin_to_ra85(dp, ds, sp, ss);
+ dk3enc_do_bin_to_ra85(dp, sp, ss);
back = 1;
} else {
if(app) {
@@ -991,7 +995,7 @@ dk3enc_bin_to_ra85_app(
}
}
-#line 1215 "dk3enc.ctr"
+#line 1255 "dk3enc.ctr"
return back;
}
@@ -1006,7 +1010,7 @@ dk3enc_size_a85_to_bin(size_t s)
unsigned long ul3 = 0UL; /* Result of division by 5. */
-#line 1228 "dk3enc.ctr"
+#line 1268 "dk3enc.ctr"
ul1 = (unsigned long)s;
ul2 = ul1 % 5UL;
ul3 = ul1 / 5UL;
@@ -1014,7 +1018,7 @@ dk3enc_size_a85_to_bin(size_t s)
back = (size_t)ul1;
-#line 1234 "dk3enc.ctr"
+#line 1274 "dk3enc.ctr"
return back;
}
@@ -1043,7 +1047,6 @@ dk3enc_c8_is_a85(char c)
/** Convert reverse ASCII-85 encoded data to binary data.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
@param app Application structure for diagnostics, may be NULL.
@@ -1051,7 +1054,7 @@ dk3enc_c8_is_a85(char c)
*/
static
size_t
-dk3enc_do_ra85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *app)
+dk3enc_do_ra85_to_bin(char *dp, char const *sp, size_t ss, dk3_app_t *app)
{
size_t back = 0;
unsigned char *mydp = NULL; /* Destination pointer. */
@@ -1062,7 +1065,7 @@ dk3enc_do_ra85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t
int reported_illegal_char = 0; /* Flag: Error already reported. */
-#line 1280 "dk3enc.ctr"
+#line 1319 "dk3enc.ctr"
mydp = (unsigned char *)dp; mysp = sp; v = 0UL; vused = 0;
for(i = 0; i < ss; i++) {
if(dk3enc_c8_is_a85(*mysp)) {
@@ -1095,7 +1098,7 @@ dk3enc_do_ra85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t
}
}
-#line 1311 "dk3enc.ctr"
+#line 1350 "dk3enc.ctr"
return back;
}
@@ -1110,12 +1113,12 @@ dk3enc_ra85_to_bin_app(
size_t needed_size = 0; /* Minimum output buffer size. */
-#line 1324 "dk3enc.ctr"
+#line 1363 "dk3enc.ctr"
if((dp) && (sp) && (ds) && (ss)) {
needed_size = dk3enc_size_a85_to_bin(ss);
if(needed_size) {
if(ds >= needed_size) {
- back = dk3enc_do_ra85_to_bin(dp, ds, sp, ss, app);
+ back = dk3enc_do_ra85_to_bin(dp, sp, ss, app);
} else {
if(app) {
/* Destination buffer too small! */
@@ -1125,7 +1128,7 @@ dk3enc_ra85_to_bin_app(
}
}
-#line 1337 "dk3enc.ctr"
+#line 1376 "dk3enc.ctr"
return back;
}
@@ -1139,7 +1142,7 @@ dk3enc_ra85string_to_bin_app(
size_t back = 0;
-#line 1349 "dk3enc.ctr"
+#line 1388 "dk3enc.ctr"
if(sp) {
back = dk3enc_ra85_to_bin_app(dp, ds, sp, dk3str_c8_len(sp), app);
}
@@ -1150,13 +1153,12 @@ dk3enc_ra85string_to_bin_app(
/** Convert binary data to ASCII-85 string.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
*/
static
void
-dk3enc_do_bin_to_a85(char *dp, size_t ds, char const *sp, size_t ss)
+dk3enc_do_bin_to_a85(char *dp, char const *sp, size_t ss)
{
register unsigned char *mydp = NULL; /* Destination pointer. */
register unsigned char *mysp = NULL; /* Source pointer. */
@@ -1166,7 +1168,7 @@ dk3enc_do_bin_to_a85(char *dp, size_t ds, char const *sp, size_t ss)
register size_t i = 0; /* Index of current source byte. */
-#line 1374 "dk3enc.ctr"
+#line 1412 "dk3enc.ctr"
mydp = (unsigned char *)dp;
mysp = (unsigned char *)sp;
v = 0UL;
@@ -1204,7 +1206,7 @@ dk3enc_do_bin_to_a85(char *dp, size_t ds, char const *sp, size_t ss)
}
*mydp = '\0';
-#line 1410 "dk3enc.ctr"
+#line 1448 "dk3enc.ctr"
}
@@ -1218,12 +1220,12 @@ dk3enc_bin_to_a85_app(
size_t needed_size = 0; /* Minimum output buffer size. */
-#line 1422 "dk3enc.ctr"
+#line 1460 "dk3enc.ctr"
if((dp) && (sp) && (ds) && (ss)) {
needed_size = dk3enc_size_bin_to_a85(ss);
if(needed_size) {
if(ds >= needed_size) {
- dk3enc_do_bin_to_a85(dp, ds, sp, ss);
+ dk3enc_do_bin_to_a85(dp, sp, ss);
back = 1;
} else {
if(app) {
@@ -1234,7 +1236,7 @@ dk3enc_bin_to_a85_app(
}
}
-#line 1436 "dk3enc.ctr"
+#line 1474 "dk3enc.ctr"
return back;
}
@@ -1242,7 +1244,6 @@ dk3enc_bin_to_a85_app(
/** Convert ASCII-85 encoded data to binary data.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
@param app Application structure for diagnostics, may be NULL.
@@ -1250,7 +1251,7 @@ dk3enc_bin_to_a85_app(
*/
static
size_t
-dk3enc_do_a85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *app)
+dk3enc_do_a85_to_bin(char *dp, char const *sp, size_t ss, dk3_app_t *app)
{
register size_t back = 0;
register unsigned char *mydp = NULL; /* Destination pointer. */
@@ -1264,7 +1265,7 @@ dk3enc_do_a85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *
int reported_illegal_character = 0;
-#line 1464 "dk3enc.ctr"
+#line 1501 "dk3enc.ctr"
mydp = (unsigned char *)dp; mysp = (unsigned char *)sp;
v = 0UL; vused = 0;
for(i = 0; i < ss; i++) {
@@ -1333,7 +1334,7 @@ dk3enc_do_a85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *
}
}
-#line 1531 "dk3enc.ctr"
+#line 1568 "dk3enc.ctr"
return back;
}
@@ -1348,12 +1349,12 @@ dk3enc_a85_to_bin_app(
size_t needed_size = 0; /* Minimum output buffer size. */
-#line 1544 "dk3enc.ctr"
+#line 1581 "dk3enc.ctr"
if((dp) && (sp) && (ds) && (ss)) {
needed_size = dk3enc_size_a85_to_bin(ss);
if(needed_size) {
if(ds >= needed_size) {
- back = dk3enc_do_a85_to_bin(dp, ds, sp, ss, app);
+ back = dk3enc_do_a85_to_bin(dp, sp, ss, app);
} else {
if(app) {
/* Destination buffer too small! */
@@ -1363,7 +1364,7 @@ dk3enc_a85_to_bin_app(
}
}
-#line 1557 "dk3enc.ctr"
+#line 1594 "dk3enc.ctr"
return back;
}
@@ -1375,12 +1376,12 @@ dk3enc_a85string_to_bin_app(char *dp, size_t ds, char const *sp, dk3_app_t *app)
size_t back = 0;
-#line 1567 "dk3enc.ctr"
+#line 1604 "dk3enc.ctr"
if(sp) {
back = dk3enc_a85_to_bin_app(dp, ds, sp, dk3str_c8_len(sp), app);
}
-#line 1570 "dk3enc.ctr"
+#line 1607 "dk3enc.ctr"
return back;
}
@@ -1395,7 +1396,7 @@ dk3enc_size_bin_to_hex(size_t s)
unsigned long ul1 = 0UL; /* Temporary value for calculation. */
-#line 1583 "dk3enc.ctr"
+#line 1620 "dk3enc.ctr"
ul1 = (unsigned long)s;
ul1 = dk3ma_ul_mul_ok(ul1, 2UL, &ec);
ul1 = dk3ma_ul_add_ok(ul1, 1UL, &ec);
@@ -1404,19 +1405,19 @@ dk3enc_size_bin_to_hex(size_t s)
if((unsigned long)back != ul1) back = 0;
-#line 1590 "dk3enc.ctr"
+#line 1627 "dk3enc.ctr"
return back;
#else
size_t back = 0;
int ec = 0; /* Error code */
-#line 1595 "dk3enc.ctr"
+#line 1632 "dk3enc.ctr"
back = dk3mem_add_size_t(1, dk3mem_mul_size_t(2, s, &ec), &ec);
if (ec) { back = 0; }
-#line 1598 "dk3enc.ctr"
+#line 1635 "dk3enc.ctr"
return back;
#endif
}
@@ -1429,11 +1430,11 @@ dk3enc_size_hex_to_bin(size_t s)
size_t back;
-#line 1609 "dk3enc.ctr"
+#line 1646 "dk3enc.ctr"
back = s / 2;
back++;
-#line 1611 "dk3enc.ctr"
+#line 1648 "dk3enc.ctr"
return back;
}
@@ -1471,21 +1472,19 @@ dk3enc_c8_low_nibble_hex(char c)
/** Convert binary data to hexadecimal string.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
- @param app Application structure for diagnostics, may be NULL.
*/
static
void
-dk3enc_do_bin_to_hex(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *app)
+dk3enc_do_bin_to_hex(char *dp, char const *sp, size_t ss)
{
register char *mydp = NULL; /* Destination pointer. */
register char const *mysp = NULL; /* Source pointer. */
register size_t i = 0; /* Current source byte index. */
-#line 1661 "dk3enc.ctr"
+#line 1696 "dk3enc.ctr"
mydp = dp; mysp = sp;
for(i = 0; i < ss; i++) {
*(mydp++) = dk3enc_c8_high_nibble_hex(*mysp);
@@ -1493,7 +1492,7 @@ dk3enc_do_bin_to_hex(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *
}
*mydp = '\0';
-#line 1667 "dk3enc.ctr"
+#line 1702 "dk3enc.ctr"
}
@@ -1507,12 +1506,12 @@ dk3enc_bin_to_hex_app(
size_t needed_bytes = 0; /* Minimum output buffer size. */
-#line 1679 "dk3enc.ctr"
+#line 1714 "dk3enc.ctr"
if((dp) && (ds) && (sp) && (ss)) {
needed_bytes = dk3enc_size_bin_to_hex(ss);
if(needed_bytes) {
if(ds >= needed_bytes) {
- dk3enc_do_bin_to_hex(dp, ds, sp, ss, app); back = 1;
+ dk3enc_do_bin_to_hex(dp, sp, ss); back = 1;
} else {
if(app) {
/* Destination buffer too small1 */
@@ -1522,7 +1521,7 @@ dk3enc_bin_to_hex_app(
}
}
-#line 1692 "dk3enc.ctr"
+#line 1727 "dk3enc.ctr"
return back;
}
@@ -1530,7 +1529,6 @@ dk3enc_bin_to_hex_app(
/** Convert hexadecimal data to binary data.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
@param app Application structure for diagnostics, may be NULL.
@@ -1538,7 +1536,7 @@ dk3enc_bin_to_hex_app(
*/
static
size_t
-dk3enc_do_hex_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *app)
+dk3enc_do_hex_to_bin(char *dp, char const *sp, size_t ss, dk3_app_t *app)
{
register size_t back = 0;
register char const *mysp = NULL; /* Source pointer. */
@@ -1549,7 +1547,7 @@ dk3enc_do_hex_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *
int reported_illegal_character = 0; /* Flag: Error already reported. */
-#line 1717 "dk3enc.ctr"
+#line 1751 "dk3enc.ctr"
mydp = (unsigned char *)dp;
mysp = sp; v = 0x00; vused = 0U;
for(i = 0; i < ss; i++) {
@@ -1647,7 +1645,7 @@ dk3enc_do_hex_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *
*mydp = v; back++;
}
-#line 1813 "dk3enc.ctr"
+#line 1847 "dk3enc.ctr"
return back;
}
@@ -1662,12 +1660,12 @@ dk3enc_hex_to_bin_app(
size_t needed_bytes = 0; /* Minimum output buffer size. */
-#line 1826 "dk3enc.ctr"
+#line 1860 "dk3enc.ctr"
if((dp) && (ds) && (sp) && (ss)) {
needed_bytes = dk3enc_size_hex_to_bin(ss);
if(needed_bytes) {
if(ds >= needed_bytes) {
- back = dk3enc_do_hex_to_bin(dp, ds, sp, ss, app);
+ back = dk3enc_do_hex_to_bin(dp, sp, ss, app);
} else {
if(app) {
/* Destination buffer too small! */
@@ -1677,7 +1675,7 @@ dk3enc_hex_to_bin_app(
}
}
-#line 1839 "dk3enc.ctr"
+#line 1873 "dk3enc.ctr"
return back;
}
@@ -1691,12 +1689,12 @@ dk3enc_hexstring_to_bin_app(
size_t back = 0;
-#line 1851 "dk3enc.ctr"
+#line 1885 "dk3enc.ctr"
if(sp) {
back = dk3enc_hex_to_bin_app(dp, ds, sp, dk3str_c8_len(sp), app);
}
-#line 1854 "dk3enc.ctr"
+#line 1888 "dk3enc.ctr"
return back;
}
@@ -1708,13 +1706,13 @@ dk3enc_size_hexstring_to_bin(char const *s)
size_t back = 0;
-#line 1864 "dk3enc.ctr"
+#line 1898 "dk3enc.ctr"
if(s) {
back = dk3str_c8_len(s);
back = dk3enc_size_hex_to_bin(back);
}
-#line 1868 "dk3enc.ctr"
+#line 1902 "dk3enc.ctr"
return back;
}
@@ -1726,13 +1724,13 @@ dk3enc_size_a85string_to_bin(char const *s)
size_t back = 0;
-#line 1878 "dk3enc.ctr"
+#line 1912 "dk3enc.ctr"
if(s) {
back = dk3str_c8_len(s);
back = dk3enc_size_a85_to_bin(back);
}
-#line 1882 "dk3enc.ctr"
+#line 1916 "dk3enc.ctr"
return back;
}
@@ -1785,12 +1783,12 @@ dk3enc_get_text_encoding_app(dkChar const *en, dk3_app_t *app)
int i;
-#line 1933 "dk3enc.ctr"
+#line 1967 "dk3enc.ctr"
if(app) { back = dk3app_get_output_encoding(app); }
if(en) {
i = dk3str_array_index(dk3enc_text_encoding_names, en, 0);
-#line 1936 "dk3enc.ctr"
+#line 1970 "dk3enc.ctr"
switch(i) {
case 0: case 8: case 9: {
back = DK3_FILE_ENCODING_ASCII;
@@ -1833,7 +1831,7 @@ dk3enc_get_text_encoding_app(dkChar const *en, dk3_app_t *app)
}
}
-#line 1977 "dk3enc.ctr"
+#line 2011 "dk3enc.ctr"
return back;
}
diff --git a/support/dktools/dk3enc.ctr b/support/dktools/dk3enc.ctr
index 0c80cf3bda..a3286ee812 100644
--- a/support/dktools/dk3enc.ctr
+++ b/support/dktools/dk3enc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -302,6 +302,20 @@ dk3enc_get_text_encoding_app(dkChar const *en, dk3_app_t *app);
int
dk3enc_get_encoding(dk3_app_t *app);
+/** Convert 32 bit character to unsigned long.
+ @param c dk3_c32_t character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk3enc_uc_to_ul(unsigned long c);
+
+/** Convert dkChar character to unsigned long.
+ @param c dkChar character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk3enc_dk_to_ul(unsigned long c);
+
#ifdef __cplusplus
}
#endif
@@ -498,6 +512,31 @@ dk3enc_htons(unsigned short x)
+unsigned long
+dk3enc_uc_to_ul(unsigned long c)
+{
+ c &= 0xFFFFFFFFUL;
+ return c;
+}
+
+
+
+unsigned long
+dk3enc_dk_to_ul(unsigned long c)
+{
+#if DK3_CHAR_SIZE > 1
+#if DK3_CHAR_SIZE > 2
+ c &= 0xFFFFFFFFUL;
+#else
+ c &= 0x0000FFFFUL;
+#endif
+#else
+ c &= 0x000000FFUL;
+#endif
+ return c;
+}
+
+
/** Convert 32-bit character to UTF-8 following RFC2279.
@param c 32-bit character to convert.
@param u8p Destination buffer.
@@ -510,7 +549,7 @@ dk3enc_uc2utf8_rfc2279(dk3_c32_t c, unsigned char *u8p, size_t u8l)
{
size_t back = 0;
dk3_c32_t x = 0UL; /* Variable for temporary results. */
- $? "+ dk3enc_uc2utf8_rfc2279 0x%lx=%lu %lu", (unsigned long)c, (unsigned long)c, (unsigned long)u8l
+ $? "+ dk3enc_uc2utf8_rfc2279 0x%lx=%lu %lu", dk3enc_uc_to_ul(c), dk3enc_uc_to_ul(c), (unsigned long)u8l
if(u8p) {
if(u8l > 0) {
if(c > (dk3_c32_t)0x7FUL) {
@@ -818,7 +857,7 @@ size_t
dk3enc_uc2utf8(dk3_c32_t c, unsigned char *u8p, size_t u8l)
{
size_t back = 0;
- $? "+ dk3enc_uc2utf8 (RFC 3629) %lu=0x%lx",(unsigned long)c,(unsigned long)c
+ $? "+ dk3enc_uc2utf8 (RFC 3629) %lu=0x%lx",dk3enc_uc_to_ul(c),dk3enc_uc_to_ul(c)
if(c <= (dk3_c32_t)0x0010FFFFUL) {
back = dk3enc_uc2utf8_rfc2279(c, u8p, u8l);
} $? "- dk3enc_uc2utf8 (RFC 3629) %u", (unsigned)back
@@ -870,7 +909,9 @@ dk3enc_uc2utf16(dk3_c32_t c, dk3_c16_t *u16p, size_t u16l)
}
}
#else
- if ((0x0000D800UL > c) || (0x0000DFFF < c)) {
+ if ((0x0000D800UL > (0xFFFFFFFFUL & ((unsigned long)c)))
+ || (0x0000DFFFUL < (0xFFFFFFFFUL & ((unsigned long)c)))
+ ) {
*u16p = (dk3_c16_t)c; back = 1;
}
#endif
@@ -1131,13 +1172,12 @@ dk3enc_size_bin_to_a85(size_t s)
/** Convert binary data to ASCII-85 encoded string.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
*/
static
void
-dk3enc_do_bin_to_ra85(char *dp, size_t ds, char const *sp, size_t ss)
+dk3enc_do_bin_to_ra85(char *dp, char const *sp, size_t ss)
{
register char const *mysp = NULL; /* Source pointer. */
register unsigned char *mydp = NULL; /* Destination pointer. */
@@ -1202,7 +1242,7 @@ dk3enc_bin_to_ra85_app(
needed_size = dk3enc_size_bin_to_a85(ss);
if(needed_size) {
if(ds >= needed_size) {
- dk3enc_do_bin_to_ra85(dp, ds, sp, ss);
+ dk3enc_do_bin_to_ra85(dp, sp, ss);
back = 1;
} else {
if(app) {
@@ -1259,7 +1299,6 @@ dk3enc_c8_is_a85(char c)
/** Convert reverse ASCII-85 encoded data to binary data.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
@param app Application structure for diagnostics, may be NULL.
@@ -1267,7 +1306,7 @@ dk3enc_c8_is_a85(char c)
*/
static
size_t
-dk3enc_do_ra85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *app)
+dk3enc_do_ra85_to_bin(char *dp, char const *sp, size_t ss, dk3_app_t *app)
{
size_t back = 0;
unsigned char *mydp = NULL; /* Destination pointer. */
@@ -1276,7 +1315,7 @@ dk3enc_do_ra85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t
short vused = 0; /* Flag: v is used. */
size_t i = 0; /* Index of current source byte. */
int reported_illegal_char = 0; /* Flag: Error already reported. */
- $? "+ dk3enc_do_ra85_to_bin %lu %lu", (unsigned long)ds, (unsigned long)ss
+ $? "+ dk3enc_do_ra85_to_bin %lu", (unsigned long)ss
mydp = (unsigned char *)dp; mysp = sp; v = 0UL; vused = 0;
for(i = 0; i < ss; i++) {
if(dk3enc_c8_is_a85(*mysp)) {
@@ -1325,7 +1364,7 @@ dk3enc_ra85_to_bin_app(
needed_size = dk3enc_size_a85_to_bin(ss);
if(needed_size) {
if(ds >= needed_size) {
- back = dk3enc_do_ra85_to_bin(dp, ds, sp, ss, app);
+ back = dk3enc_do_ra85_to_bin(dp, sp, ss, app);
} else {
if(app) {
/* Destination buffer too small! */
@@ -1356,13 +1395,12 @@ dk3enc_ra85string_to_bin_app(
/** Convert binary data to ASCII-85 string.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
*/
static
void
-dk3enc_do_bin_to_a85(char *dp, size_t ds, char const *sp, size_t ss)
+dk3enc_do_bin_to_a85(char *dp, char const *sp, size_t ss)
{
register unsigned char *mydp = NULL; /* Destination pointer. */
register unsigned char *mysp = NULL; /* Source pointer. */
@@ -1370,7 +1408,7 @@ dk3enc_do_bin_to_a85(char *dp, size_t ds, char const *sp, size_t ss)
register short vused = 0; /* Flag: v used. */
register short addval = 0; /* Value to add. */
register size_t i = 0; /* Index of current source byte. */
- $? "+ dk3enc_do_bin_to_a85 %lu %lu", (unsigned long)ds, (unsigned long)ss
+ $? "+ dk3enc_do_bin_to_a85 %lu", (unsigned long)ss
mydp = (unsigned char *)dp;
mysp = (unsigned char *)sp;
v = 0UL;
@@ -1423,7 +1461,7 @@ dk3enc_bin_to_a85_app(
needed_size = dk3enc_size_bin_to_a85(ss);
if(needed_size) {
if(ds >= needed_size) {
- dk3enc_do_bin_to_a85(dp, ds, sp, ss);
+ dk3enc_do_bin_to_a85(dp, sp, ss);
back = 1;
} else {
if(app) {
@@ -1440,7 +1478,6 @@ dk3enc_bin_to_a85_app(
/** Convert ASCII-85 encoded data to binary data.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
@param app Application structure for diagnostics, may be NULL.
@@ -1448,7 +1485,7 @@ dk3enc_bin_to_a85_app(
*/
static
size_t
-dk3enc_do_a85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *app)
+dk3enc_do_a85_to_bin(char *dp, char const *sp, size_t ss, dk3_app_t *app)
{
register size_t back = 0;
register unsigned char *mydp = NULL; /* Destination pointer. */
@@ -1460,7 +1497,7 @@ dk3enc_do_a85_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *
unsigned long u2 = 0UL; /* Temporary value. */
unsigned long u3 = 0UL; /* Temporary value. */
int reported_illegal_character = 0;
- $? "+ dk3enc_do_a85_to_bin %lu %lu", (unsigned long)ds, (unsigned long)ss
+ $? "+ dk3enc_do_a85_to_bin %lu", (unsigned long)ss
mydp = (unsigned char *)dp; mysp = (unsigned char *)sp;
v = 0UL; vused = 0;
for(i = 0; i < ss; i++) {
@@ -1545,7 +1582,7 @@ dk3enc_a85_to_bin_app(
needed_size = dk3enc_size_a85_to_bin(ss);
if(needed_size) {
if(ds >= needed_size) {
- back = dk3enc_do_a85_to_bin(dp, ds, sp, ss, app);
+ back = dk3enc_do_a85_to_bin(dp, sp, ss, app);
} else {
if(app) {
/* Destination buffer too small! */
@@ -1645,19 +1682,17 @@ dk3enc_c8_low_nibble_hex(char c)
/** Convert binary data to hexadecimal string.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
- @param app Application structure for diagnostics, may be NULL.
*/
static
void
-dk3enc_do_bin_to_hex(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *app)
+dk3enc_do_bin_to_hex(char *dp, char const *sp, size_t ss)
{
register char *mydp = NULL; /* Destination pointer. */
register char const *mysp = NULL; /* Source pointer. */
register size_t i = 0; /* Current source byte index. */
- $? "+ dk3enc_do_bin_to_hex %lu %lu", (unsigned long)ds, (unsigned long)ss
+ $? "+ dk3enc_do_bin_to_hex %lu", (unsigned long)ss
mydp = dp; mysp = sp;
for(i = 0; i < ss; i++) {
*(mydp++) = dk3enc_c8_high_nibble_hex(*mysp);
@@ -1680,7 +1715,7 @@ dk3enc_bin_to_hex_app(
needed_bytes = dk3enc_size_bin_to_hex(ss);
if(needed_bytes) {
if(ds >= needed_bytes) {
- dk3enc_do_bin_to_hex(dp, ds, sp, ss, app); back = 1;
+ dk3enc_do_bin_to_hex(dp, sp, ss); back = 1;
} else {
if(app) {
/* Destination buffer too small1 */
@@ -1696,7 +1731,6 @@ dk3enc_bin_to_hex_app(
/** Convert hexadecimal data to binary data.
@param dp Destination pointer.
- @param ds Destination size.
@param sp Source pointer.
@param ss Source size.
@param app Application structure for diagnostics, may be NULL.
@@ -1704,7 +1738,7 @@ dk3enc_bin_to_hex_app(
*/
static
size_t
-dk3enc_do_hex_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *app)
+dk3enc_do_hex_to_bin(char *dp, char const *sp, size_t ss, dk3_app_t *app)
{
register size_t back = 0;
register char const *mysp = NULL; /* Source pointer. */
@@ -1713,7 +1747,7 @@ dk3enc_do_hex_to_bin(char *dp, size_t ds, char const *sp, size_t ss, dk3_app_t *
register short int vused = 0; /* Flag: v used. */
register size_t i = 0; /* Current source byte index. */
int reported_illegal_character = 0; /* Flag: Error already reported. */
- $? "+ dk3enc_do_hex_to_bin %lu %lu", (unsigned long)ds, (unsigned long)ss
+ $? "+ dk3enc_do_hex_to_bin %lu", (unsigned long)ss
mydp = (unsigned char *)dp;
mysp = sp; v = 0x00; vused = 0U;
for(i = 0; i < ss; i++) {
@@ -1827,7 +1861,7 @@ dk3enc_hex_to_bin_app(
needed_bytes = dk3enc_size_hex_to_bin(ss);
if(needed_bytes) {
if(ds >= needed_bytes) {
- back = dk3enc_do_hex_to_bin(dp, ds, sp, ss, app);
+ back = dk3enc_do_hex_to_bin(dp, sp, ss, app);
} else {
if(app) {
/* Destination buffer too small! */
diff --git a/support/dktools/dk3enc.h b/support/dktools/dk3enc.h
index 14aa7514cf..2164f38fb4 100644
--- a/support/dktools/dk3enc.h
+++ b/support/dktools/dk3enc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3enc.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3enc.ctr
*/
/** @file dk3enc.h Header file for the dk3enc module.
@@ -337,6 +315,20 @@ dk3enc_get_text_encoding_app(dkChar const *en, dk3_app_t *app);
int
dk3enc_get_encoding(dk3_app_t *app);
+/** Convert 32 bit character to unsigned long.
+ @param c dk3_c32_t character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk3enc_uc_to_ul(unsigned long c);
+
+/** Convert dkChar character to unsigned long.
+ @param c dkChar character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk3enc_dk_to_ul(unsigned long c);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk3fig.c b/support/dktools/dk3fig.c
index e6d57cc080..713d4a4998 100644
--- a/support/dktools/dk3fig.c
+++ b/support/dktools/dk3fig.c
@@ -1,52 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3fig.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3fig.ctr
*/
/** @file dk3fig.c The dk3fig module.
*/
-#line 1110 "dk3fig.ctr"
+#line 1118 "dk3fig.ctr"
#include "dk3all.h"
#include "dk3fig.h"
+#include "dk3unused.h"
-#line 1117 "dk3fig.ctr"
+
+#line 1127 "dk3fig.ctr"
@@ -89,7 +69,7 @@ dkT("Converted to closed graphics path for filling."),
NULL
-#line 1169 "dk3fig.ctr"
+#line 1179 "dk3fig.ctr"
};
@@ -292,11 +272,13 @@ dk3fig_obj_path_compare(dk3_fig_obj_t const *pl, dk3_fig_obj_t const *pr)
*/
static
int
-dk3fig_obj_compare(void const *l, void const *r, int cr)
+dk3fig_obj_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
dk3_fig_obj_t const *pl;
dk3_fig_obj_t const *pr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3_fig_obj_t const *)l;
@@ -349,22 +331,22 @@ dk3fig_ah_delete(dk3_fig_ah_t *ah)
{
-#line 1427 "dk3fig.ctr"
+#line 1439 "dk3fig.ctr"
if(ah) {
if(ah->o1) {
-#line 1429 "dk3fig.ctr"
+#line 1441 "dk3fig.ctr"
dk3fig_obj_delete((dk3_fig_obj_t *)(ah->o1));
}
if(ah->o2) {
-#line 1432 "dk3fig.ctr"
+#line 1444 "dk3fig.ctr"
dk3fig_obj_delete((dk3_fig_obj_t *)(ah->o2));
}
dk3_delete(ah);
}
-#line 1436 "dk3fig.ctr"
+#line 1448 "dk3fig.ctr"
}
@@ -397,29 +379,29 @@ dk3fig_obj_delete(dk3_fig_obj_t *obj)
{
-#line 1467 "dk3fig.ctr"
+#line 1479 "dk3fig.ctr"
if(obj) {
if(obj->af) {
-#line 1469 "dk3fig.ctr"
+#line 1481 "dk3fig.ctr"
dk3fig_ah_delete(obj->af);
}
if(obj->ab) {
-#line 1472 "dk3fig.ctr"
+#line 1484 "dk3fig.ctr"
dk3fig_ah_delete(obj->ab);
}
switch(obj->ot) {
case DK3_FIG_OBJ_TEXT: {
-#line 1476 "dk3fig.ctr"
+#line 1488 "dk3fig.ctr"
if((obj->dt).txt.st) {
dk3_release((obj->dt).txt.st);
}
} break;
case DK3_FIG_OBJ_SPLINE: {
-#line 1481 "dk3fig.ctr"
+#line 1493 "dk3fig.ctr"
if((obj->dt).spl.po) {
dk3_release((obj->dt).spl.po);
}
@@ -429,7 +411,7 @@ dk3fig_obj_delete(dk3_fig_obj_t *obj)
} break;
case DK3_FIG_OBJ_POLYLINE: {
-#line 1489 "dk3fig.ctr"
+#line 1501 "dk3fig.ctr"
if((obj->dt).pol.po) {
dk3_release((obj->dt).pol.po);
}
@@ -443,7 +425,7 @@ dk3fig_obj_delete(dk3_fig_obj_t *obj)
dk3_delete(obj);
}
-#line 1501 "dk3fig.ctr"
+#line 1513 "dk3fig.ctr"
}
@@ -457,7 +439,7 @@ dk3fig_initialize_empty_drawing(dk3_fig_drawing_t *drw)
{
-#line 1513 "dk3fig.ctr"
+#line 1525 "dk3fig.ctr"
dk3bb_reset(&(drw->bb));
drw->msg = NULL;
drw->app = NULL;
@@ -482,6 +464,7 @@ dk3fig_initialize_empty_drawing(dk3_fig_drawing_t *drw)
drw->xsah = 0;
drw->cosp = 0;
drw->cofop = 1;
+ drw->ahbs = 0;
drw->bbts = 0;
drw->arcspp = 8.0;
drw->splspp = 8.0;
@@ -491,7 +474,7 @@ dk3fig_initialize_empty_drawing(dk3_fig_drawing_t *drw)
drw->lwbp = 0.9; /* 1/80 inch */
-#line 1545 "dk3fig.ctr"
+#line 1558 "dk3fig.ctr"
}
@@ -549,7 +532,7 @@ dk3fig_drawing_new(dk3_app_t *app, dkChar const * const *msg)
dk3_fig_drawing_t *back = NULL;
-#line 1601 "dk3fig.ctr"
+#line 1614 "dk3fig.ctr"
if(app) {
back = dk3_new_app(dk3_fig_drawing_t,1,app);
if(back) {
@@ -569,35 +552,35 @@ dk3fig_drawing_new(dk3_app_t *app, dkChar const * const *msg)
/* Place for further initialization here */
} else {
-#line 1619 "dk3fig.ctr"
+#line 1632 "dk3fig.ctr"
dk3fig_drawing_delete(back);
back = NULL;
}
} else {
-#line 1623 "dk3fig.ctr"
+#line 1636 "dk3fig.ctr"
dk3fig_drawing_delete(back);
back = NULL;
}
} else {
-#line 1627 "dk3fig.ctr"
+#line 1640 "dk3fig.ctr"
dk3fig_drawing_delete(back);
back = NULL;
}
} else {
-#line 1631 "dk3fig.ctr"
+#line 1644 "dk3fig.ctr"
dk3fig_drawing_delete(back);
back = NULL;
}
} else {
-#line 1635 "dk3fig.ctr"
+#line 1648 "dk3fig.ctr"
}
}
-#line 1637 "dk3fig.ctr"
+#line 1650 "dk3fig.ctr"
return back;
}
@@ -610,7 +593,7 @@ dk3fig_drawing_delete(dk3_fig_drawing_t *drw)
dk3_fig_obj_t *po; /* Current Fig object to release. */
-#line 1648 "dk3fig.ctr"
+#line 1661 "dk3fig.ctr"
if(drw) {
/*
Remove all objects.
@@ -634,7 +617,7 @@ dk3fig_drawing_delete(dk3_fig_drawing_t *drw)
while(NULL != (co = (dk3_fig_color_t *)dk3sto_it_next(drw->icol))) {
-#line 1670 "dk3fig.ctr"
+#line 1683 "dk3fig.ctr"
dk3_delete(co);
}
dk3sto_it_close(drw->icol);
@@ -653,7 +636,7 @@ dk3fig_drawing_delete(dk3_fig_drawing_t *drw)
dk3_delete(drw);
}
-#line 1687 "dk3fig.ctr"
+#line 1700 "dk3fig.ctr"
}
@@ -703,11 +686,11 @@ dk3fig_obj_internal_new(
dk3_fig_obj_t *back = NULL;
-#line 1735 "dk3fig.ctr"
+#line 1748 "dk3fig.ctr"
back = dk3_new_app(dk3_fig_obj_t,1,app);
if(back) {
-#line 1737 "dk3fig.ctr"
+#line 1750 "dk3fig.ctr"
back->af = NULL;
back->ab = NULL;
back->dsd = NULL;
@@ -725,18 +708,18 @@ dk3fig_obj_internal_new(
back->ls = ls;
back->cl = ((cl) ? 0x01 : 0x00);
-#line 1753 "dk3fig.ctr"
+#line 1766 "dk3fig.ctr"
if(back->lw < 0) {
back->lw = 0;
if(po) {
-#line 1756 "dk3fig.ctr"
+#line 1769 "dk3fig.ctr"
/* +++++ Warning: Illegal line width corrected! */
}
}
if(back->pc < -1) {
-#line 1760 "dk3fig.ctr"
+#line 1773 "dk3fig.ctr"
back->pc = -1;
/* +++++ Warning: Illegal pen color definition corrected! */
}
@@ -744,7 +727,7 @@ dk3fig_obj_internal_new(
back->fc = DK3_FIG_COLOR_DEFAULT;
if((po) && (cl)) {
-#line 1766 "dk3fig.ctr"
+#line 1779 "dk3fig.ctr"
/* +++++ Warning: Illegal fill color definition corrected! */
}
}
@@ -752,7 +735,7 @@ dk3fig_obj_internal_new(
back->fi = DK3_FIG_COLOR_DEFAULT;
if((po) && (cl)) {
-#line 1772 "dk3fig.ctr"
+#line 1785 "dk3fig.ctr"
/* +++++ Warning: Illegal fill style corrected! */
}
} else {
@@ -760,7 +743,7 @@ dk3fig_obj_internal_new(
back->fi = 62;
if((po) && (cl)) {
-#line 1778 "dk3fig.ctr"
+#line 1791 "dk3fig.ctr"
/* +++++ Warning: Illegal fill style corrected! */
}
} else {
@@ -769,7 +752,7 @@ dk3fig_obj_internal_new(
back->fi = 20;
if((po) && (cl)) {
-#line 1785 "dk3fig.ctr"
+#line 1798 "dk3fig.ctr"
/* +++++ Warning: Illegal fill style corrected! */
}
}
@@ -782,7 +765,7 @@ dk3fig_obj_internal_new(
back->cs = DK3_FIG_LC_BUTT;
if(po) {
-#line 1796 "dk3fig.ctr"
+#line 1809 "dk3fig.ctr"
/* +++++ Warning: Illegal line cap style corrected! */
}
}
@@ -794,7 +777,7 @@ dk3fig_obj_internal_new(
back->js = DK3_FIG_LJ_MITER;
if(po) {
-#line 1806 "dk3fig.ctr"
+#line 1819 "dk3fig.ctr"
/* +++++ Warning: Illegal line join style corrected! */
}
}
@@ -805,7 +788,7 @@ dk3fig_obj_internal_new(
if(ls < DK3_FIG_LS_DEFAULT) {
if(po) {
-#line 1815 "dk3fig.ctr"
+#line 1828 "dk3fig.ctr"
/* +++++ Warning: Illegal line style corrected! */
}
}
@@ -814,22 +797,22 @@ dk3fig_obj_internal_new(
back->ls = DK3_FIG_LS_SOLID;
if(po) {
-#line 1822 "dk3fig.ctr"
+#line 1835 "dk3fig.ctr"
/* +++++ Warning: Illegal line style corrected! */
}
}
}
} else {
-#line 1827 "dk3fig.ctr"
+#line 1840 "dk3fig.ctr"
}
if((po) && (!(cl))) {
-#line 1829 "dk3fig.ctr"
+#line 1842 "dk3fig.ctr"
if(NULL != back) {
if(af) {
-#line 1831 "dk3fig.ctr"
+#line 1844 "dk3fig.ctr"
back->af = dk3fig_ah_new(app);
if(!(back->af)) {
dk3fig_obj_delete(back);
@@ -840,7 +823,7 @@ dk3fig_obj_internal_new(
if (NULL != back) {
if(ab) {
-#line 1840 "dk3fig.ctr"
+#line 1853 "dk3fig.ctr"
back->ab = dk3fig_ah_new(app);
if(!(back->ab)) {
dk3fig_obj_delete(back);
@@ -850,15 +833,15 @@ dk3fig_obj_internal_new(
}
} else {
-#line 1848 "dk3fig.ctr"
+#line 1861 "dk3fig.ctr"
if((af) || (ab)) {
-#line 1849 "dk3fig.ctr"
+#line 1862 "dk3fig.ctr"
/* +++++ Warning: Arrowhead ignored for closed path! */
}
}
-#line 1852 "dk3fig.ctr"
+#line 1865 "dk3fig.ctr"
return back;
}
@@ -1027,32 +1010,32 @@ dk3fig_obj_new(
dk3_fig_obj_t *back = NULL;
-#line 2019 "dk3fig.ctr"
+#line 2032 "dk3fig.ctr"
if((la < 0) || (la > 999)) {
/* +++++ Warning: Illegal layer number! */
}
switch(ot) {
case DK3_FIG_OBJ_ARC: {
-#line 2024 "dk3fig.ctr"
+#line 2037 "dk3fig.ctr"
switch(st) {
case DK3_FIG_OBJ_SUB_ARC_OPEN: {
-#line 2026 "dk3fig.ctr"
+#line 2039 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 0, app
);
} break;
case DK3_FIG_OBJ_SUB_ARC_CLOSED: {
-#line 2031 "dk3fig.ctr"
+#line 2044 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case 0: {
-#line 2036 "dk3fig.ctr"
+#line 2049 "dk3fig.ctr"
/* +++++ Warning: jFig closed arc bug. */
back = dk3fig_obj_internal_new(
li, la, ot, DK3_FIG_OBJ_SUB_ARC_CLOSED,
@@ -1061,7 +1044,7 @@ dk3fig_obj_new(
} break;
default: {
-#line 2043 "dk3fig.ctr"
+#line 2056 "dk3fig.ctr"
/* +++++ Warning: Illegal sub type corrected! */
back = dk3fig_obj_internal_new(
li, la, ot, DK3_FIG_OBJ_SUB_ARC_CLOSED,
@@ -1075,39 +1058,39 @@ dk3fig_obj_new(
} break;
case DK3_FIG_OBJ_ELLIPSE: {
-#line 2055 "dk3fig.ctr"
+#line 2068 "dk3fig.ctr"
switch(st) {
case DK3_FIG_OBJ_SUB_ELL_RADII: {
-#line 2057 "dk3fig.ctr"
+#line 2070 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case DK3_FIG_OBJ_SUB_ELL_DIAMETERS: {
-#line 2062 "dk3fig.ctr"
+#line 2075 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case DK3_FIG_OBJ_SUB_CIR_RADIUS: {
-#line 2067 "dk3fig.ctr"
+#line 2080 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case DK3_FIG_OBJ_SUB_CIR_DIAMETER: {
-#line 2072 "dk3fig.ctr"
+#line 2085 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
default: {
-#line 2077 "dk3fig.ctr"
+#line 2090 "dk3fig.ctr"
/* +++++ Warning: Illegal sub type corrected! */
back = dk3fig_obj_internal_new(
li, la, ot, DK3_FIG_OBJ_SUB_ELL_RADII,
@@ -1121,46 +1104,46 @@ dk3fig_obj_new(
} break;
case DK3_FIG_OBJ_POLYLINE: {
-#line 2089 "dk3fig.ctr"
+#line 2102 "dk3fig.ctr"
switch(st) {
case DK3_FIG_OBJ_SUB_POLYLINE: {
-#line 2091 "dk3fig.ctr"
+#line 2104 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 0, app
);
} break;
case DK3_FIG_OBJ_SUB_BOX: {
-#line 2096 "dk3fig.ctr"
+#line 2109 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case DK3_FIG_OBJ_SUB_POLYGON: {
-#line 2101 "dk3fig.ctr"
+#line 2114 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case DK3_FIG_OBJ_SUB_ARCBOX: {
-#line 2106 "dk3fig.ctr"
+#line 2119 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case DK3_FIG_OBJ_SUB_IMAGE: {
-#line 2111 "dk3fig.ctr"
+#line 2124 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
default: {
-#line 2116 "dk3fig.ctr"
+#line 2129 "dk3fig.ctr"
/* +++++ Warning: Illegal sub type corrected! */
back = dk3fig_obj_internal_new(
li, la, ot, DK3_FIG_OBJ_SUB_POLYLINE,
@@ -1177,53 +1160,53 @@ dk3fig_obj_new(
} break;
case DK3_FIG_OBJ_SPLINE: {
-#line 2131 "dk3fig.ctr"
+#line 2144 "dk3fig.ctr"
switch(st) {
case DK3_FIG_OBJ_SUB_OPEN_APPRO: {
-#line 2133 "dk3fig.ctr"
+#line 2146 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 0, app
);
} break;
case DK3_FIG_OBJ_SUB_CLOSED_APPRO: {
-#line 2138 "dk3fig.ctr"
+#line 2151 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case DK3_FIG_OBJ_SUB_OPEN_INT: {
-#line 2143 "dk3fig.ctr"
+#line 2156 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 0, app
);
} break;
case DK3_FIG_OBJ_SUB_CLOSED_INT: {
-#line 2148 "dk3fig.ctr"
+#line 2161 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
case DK3_FIG_OBJ_SUB_OPEN_X: {
-#line 2153 "dk3fig.ctr"
+#line 2166 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 0, app
);
} break;
case DK3_FIG_OBJ_SUB_CLOSED_X: {
-#line 2158 "dk3fig.ctr"
+#line 2171 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 1, 1, app
);
} break;
default: {
-#line 2163 "dk3fig.ctr"
+#line 2176 "dk3fig.ctr"
/* +++++ Warning: Illegal sub type corrected! */
back = dk3fig_obj_internal_new(
li, la, ot, DK3_FIG_OBJ_SUB_OPEN_X,
@@ -1240,10 +1223,10 @@ dk3fig_obj_new(
} break;
case DK3_FIG_OBJ_TEXT: {
-#line 2178 "dk3fig.ctr"
+#line 2191 "dk3fig.ctr"
if(txt) {
-#line 2179 "dk3fig.ctr"
+#line 2192 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, st, lw, pc, fc, fi, cs, js, ls, sv, af, ab, 0, 0, app
);
@@ -1255,13 +1238,13 @@ dk3fig_obj_new(
}
} else {
-#line 2189 "dk3fig.ctr"
+#line 2202 "dk3fig.ctr"
/* +++++ ERROR: No text specified! */
}
} break;
case DK3_FIG_OBJ_PSEUDO_HALF_CIRCLE: {
-#line 2193 "dk3fig.ctr"
+#line 2206 "dk3fig.ctr"
back = dk3fig_obj_internal_new(
li, la, ot, ((st) ? 1 : 0),
lw, pc, fc, fi, cs, js, ls, sv, af, ab, 0,
@@ -1271,12 +1254,12 @@ dk3fig_obj_new(
} break;
default: {
-#line 2201 "dk3fig.ctr"
+#line 2214 "dk3fig.ctr"
/* +++++ ERROR: Can not create object! */
} break;
}
-#line 2204 "dk3fig.ctr"
+#line 2217 "dk3fig.ctr"
return back;
}
@@ -1369,6 +1352,16 @@ dk3fig_set_options_cofop(dk3_fig_drawing_t *drw, int val)
void
+dk3fig_set_options_ah_bisection(dk3_fig_drawing_t *drw, int val)
+{
+ if(drw) {
+ drw->ahbs = ((val) ? 1 : 0);
+ }
+}
+
+
+
+void
dk3fig_set_options_srctype(dk3_fig_drawing_t *drw, int val)
{
if(drw) {
diff --git a/support/dktools/dk3fig.ctr b/support/dktools/dk3fig.ctr
index 67938e1c6b..e1041de58b 100644
--- a/support/dktools/dk3fig.ctr
+++ b/support/dktools/dk3fig.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -864,6 +864,7 @@ typedef struct {
int cosp; /**< Flag: Compatible splines. */
int cofop; /**< Flag: Compat filled open paths. */
int bbts; /**< Flag: Use text size for bb. */
+ int ahbs; /**< Flag: Bisection for spline arrow */
} dk3_fig_drawing_t;
@@ -987,6 +988,13 @@ dk3fig_set_options_bbts(dk3_fig_drawing_t *drw, int val);
void
dk3fig_set_options_cofop(dk3_fig_drawing_t *drw, int val);
+/** Set flag for bisection iteration on arrowheads.
+ @param drw Drawing to set up.
+ @param val Flag value.
+*/
+void
+dk3fig_set_options_ah_bisection(dk3_fig_drawing_t *drw, int val);
+
/** Set source type.
@param drw Drawing to set up.
@param val New source type value.
@@ -1111,6 +1119,8 @@ dk3fig_set_ec(dk3_fig_drawing_t *drw, int ec);
#include "dk3all.h"
#include "dk3fig.h"
+#include "dk3unused.h"
+
$!trace-include
@@ -1368,11 +1378,13 @@ dk3fig_obj_path_compare(dk3_fig_obj_t const *pl, dk3_fig_obj_t const *pr)
*/
static
int
-dk3fig_obj_compare(void const *l, void const *r, int cr)
+dk3fig_obj_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
dk3_fig_obj_t const *pl;
dk3_fig_obj_t const *pr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3_fig_obj_t const *)l;
@@ -1534,6 +1546,7 @@ dk3fig_initialize_empty_drawing(dk3_fig_drawing_t *drw)
drw->xsah = 0;
drw->cosp = 0;
drw->cofop = 1;
+ drw->ahbs = 0;
drw->bbts = 0;
drw->arcspp = 8.0;
drw->splspp = 8.0;
@@ -2293,6 +2306,16 @@ dk3fig_set_options_cofop(dk3_fig_drawing_t *drw, int val)
void
+dk3fig_set_options_ah_bisection(dk3_fig_drawing_t *drw, int val)
+{
+ if(drw) {
+ drw->ahbs = ((val) ? 1 : 0);
+ }
+}
+
+
+
+void
dk3fig_set_options_srctype(dk3_fig_drawing_t *drw, int val)
{
if(drw) {
diff --git a/support/dktools/dk3fig.h b/support/dktools/dk3fig.h
index 62012559e5..b3582d681e 100644
--- a/support/dktools/dk3fig.h
+++ b/support/dktools/dk3fig.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3fig.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3fig.ctr
*/
/** @file dk3fig.h Header file for the dk3fig module.
@@ -900,6 +878,7 @@ typedef struct {
int cosp; /**< Flag: Compatible splines. */
int cofop; /**< Flag: Compat filled open paths. */
int bbts; /**< Flag: Use text size for bb. */
+ int ahbs; /**< Flag: Bisection for spline arrow */
} dk3_fig_drawing_t;
@@ -1023,6 +1002,13 @@ dk3fig_set_options_bbts(dk3_fig_drawing_t *drw, int val);
void
dk3fig_set_options_cofop(dk3_fig_drawing_t *drw, int val);
+/** Set flag for bisection iteration on arrowheads.
+ @param drw Drawing to set up.
+ @param val Flag value.
+*/
+void
+dk3fig_set_options_ah_bisection(dk3_fig_drawing_t *drw, int val);
+
/** Set source type.
@param drw Drawing to set up.
@param val New source type value.
diff --git a/support/dktools/dk3figah.c b/support/dktools/dk3figah.c
index 8690ba7aca..e560d4d0a3 100644
--- a/support/dktools/dk3figah.c
+++ b/support/dktools/dk3figah.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figah.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figah.ctr
*/
/** @file dk3figah.c The dk3figah module.
*/
-#line 40 "dk3figah.ctr"
+#line 39 "dk3figah.ctr"
#include "dk3all.h"
#include "dk3fig.h"
@@ -50,7 +28,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 51 "dk3figah.ctr"
+#line 50 "dk3figah.ctr"
@@ -76,7 +54,7 @@ dk3figah_cmin(
double lw; /* Line width. */
-#line 75 "dk3figah.ctr"
+#line 74 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
h = ah->he;
w = ah->wi;
@@ -96,7 +74,7 @@ dk3figah_cmin(
back = dk3ma_d_div_ok(dk3ma_d_mul_ok(lw, h, ec), w, ec);
-#line 93 "dk3figah.ctr"
+#line 92 "dk3figah.ctr"
return back;
}
@@ -124,7 +102,7 @@ dk3figah_s(
double w; /* Arrow width. */
-#line 119 "dk3figah.ctr"
+#line 118 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
h = ah->he;
w = ah->wi;
@@ -134,17 +112,17 @@ dk3figah_s(
{
h = dk3ma_d_mul_ok(1.25, h, ec);
-#line 127 "dk3figah.ctr"
+#line 126 "dk3figah.ctr"
} break;
case DK3_FIG_AS_POINTED: {
h = 0.75 * h;
-#line 130 "dk3figah.ctr"
+#line 129 "dk3figah.ctr"
} break;
case DK3_FIG_AS_RHOMBUS: {
h = 0.5 * h;
-#line 133 "dk3figah.ctr"
+#line 132 "dk3figah.ctr"
} break;
}
back = dk3ma_d_mul_ok(
@@ -163,7 +141,7 @@ dk3figah_s(
ec
);
-#line 150 "dk3figah.ctr"
+#line 149 "dk3figah.ctr"
return back;
}
@@ -191,7 +169,7 @@ dk3figah_half_arrow_s(
double w; /* Arrow width. */
-#line 176 "dk3figah.ctr"
+#line 175 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
h = ah->he;
w = ah->wi;
@@ -200,12 +178,12 @@ dk3figah_half_arrow_s(
{
h = dk3ma_d_mul_ok(1.25, h, ec);
-#line 183 "dk3figah.ctr"
+#line 182 "dk3figah.ctr"
} break;
case DK3_FIG_AS_BUTTED_HALF: {
h = 0.75 * h;
-#line 186 "dk3figah.ctr"
+#line 185 "dk3figah.ctr"
} break;
}
back = dk3ma_d_div_ok(
@@ -213,7 +191,7 @@ dk3figah_half_arrow_s(
);
-#line 192 "dk3figah.ctr"
+#line 191 "dk3figah.ctr"
return back;
}
@@ -239,14 +217,14 @@ dk3figah_cmax(
double back;
-#line 216 "dk3figah.ctr"
+#line 215 "dk3figah.ctr"
back = dk3ma_d_mul_ok(
2.0,
dk3figah_s(drw, obj, ah, ec),
ec
);
-#line 221 "dk3figah.ctr"
+#line 220 "dk3figah.ctr"
return back;
}
#endif
@@ -274,7 +252,7 @@ dk3figah_normal_arrow_length_correction(
double s;
-#line 247 "dk3figah.ctr"
+#line 246 "dk3figah.ctr"
cmin = dk3figah_cmin(drw, obj, ah, ec);
s = dk3figah_s(drw, obj, ah, ec);
switch(obj->cs) {
@@ -291,7 +269,7 @@ dk3figah_normal_arrow_length_correction(
} break;
}
-#line 262 "dk3figah.ctr"
+#line 261 "dk3figah.ctr"
return back;
}
@@ -319,7 +297,7 @@ dk3figah_normal_arrow_length_correction_tolerance(
double s;
-#line 288 "dk3figah.ctr"
+#line 287 "dk3figah.ctr"
cmin = dk3figah_cmin(drw, obj, ah, ec);
s = dk3figah_s(drw, obj, ah, ec);
switch(obj->cs) {
@@ -332,7 +310,7 @@ dk3figah_normal_arrow_length_correction_tolerance(
} break;
}
-#line 299 "dk3figah.ctr"
+#line 298 "dk3figah.ctr"
return back;
}
@@ -341,7 +319,6 @@ dk3figah_normal_arrow_length_correction_tolerance(
/** Calculate length correction for blocking line arrowhead.
@param drw Drawing structure.
@param obj Object to modify.
- @param ah Arrowhead to calculate length correction for.
@param ec Pointer to error code variable, may be NULL.
@return Length correction value.
*/
@@ -350,14 +327,13 @@ double
dk3figah_block_line_length_correction(
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- dk3_fig_ah_t *ah,
int *ec
)
{
double back = 0.0;
-#line 322 "dk3figah.ctr"
+#line 319 "dk3figah.ctr"
switch(obj->cs) {
case DK3_FIG_LC_PROJECTING:
case DK3_FIG_LC_ROUND: {
@@ -368,7 +344,7 @@ dk3figah_block_line_length_correction(
} break;
}
-#line 331 "dk3figah.ctr"
+#line 328 "dk3figah.ctr"
return back;
}
@@ -377,7 +353,6 @@ dk3figah_block_line_length_correction(
/** Calculate length correction tolerance for blocking line arrowhead.
@param drw Drawing structure.
@param obj Object to modify.
- @param ah Arrowhead to calculate length correction for.
@param ec Pointer to error code variable, may be NULL.
@return Length correction value.
*/
@@ -386,14 +361,13 @@ double
dk3figah_block_line_length_correction_tolerance(
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- dk3_fig_ah_t *ah,
int *ec
)
{
double back = 0.0;
-#line 354 "dk3figah.ctr"
+#line 349 "dk3figah.ctr"
switch(obj->cs) {
case DK3_FIG_LC_PROJECTING:
case DK3_FIG_LC_ROUND: {
@@ -404,7 +378,7 @@ dk3figah_block_line_length_correction_tolerance(
} break;
}
-#line 363 "dk3figah.ctr"
+#line 358 "dk3figah.ctr"
return back;
}
@@ -433,7 +407,7 @@ dk3figah_anti_arrow_length_correction(
double cmax;
-#line 390 "dk3figah.ctr"
+#line 385 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
sqv = sqrt(
dk3ma_d_add_ok(
@@ -479,7 +453,7 @@ dk3figah_anti_arrow_length_correction(
} break;
}
-#line 434 "dk3figah.ctr"
+#line 429 "dk3figah.ctr"
return back;
}
@@ -508,7 +482,7 @@ dk3figah_anti_arrow_length_correction_tolerance(
double cmax;
-#line 461 "dk3figah.ctr"
+#line 456 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
sqv = sqrt(
dk3ma_d_add_ok(
@@ -549,7 +523,7 @@ dk3figah_anti_arrow_length_correction_tolerance(
} break;
}
-#line 500 "dk3figah.ctr"
+#line 495 "dk3figah.ctr"
return back;
}
@@ -577,7 +551,7 @@ dk3figah_full_circle_length_correction(
double cmax;
-#line 526 "dk3figah.ctr"
+#line 521 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
cmin = 0.5 * dk3ma_d_mul_ok(
dk3ma_d_add_ok(ah->he, lw, ec),
@@ -615,7 +589,7 @@ dk3figah_full_circle_length_correction(
} break;
}
-#line 562 "dk3figah.ctr"
+#line 557 "dk3figah.ctr"
return back;
}
@@ -643,7 +617,7 @@ dk3figah_full_circle_length_correction_tolerance(
double cmax;
-#line 588 "dk3figah.ctr"
+#line 583 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
cmin = 0.5 * dk3ma_d_mul_ok(
dk3ma_d_add_ok(ah->he, lw, ec),
@@ -681,7 +655,7 @@ dk3figah_full_circle_length_correction_tolerance(
} break;
}
-#line 624 "dk3figah.ctr"
+#line 619 "dk3figah.ctr"
return back;
}
@@ -711,7 +685,7 @@ dk3figah_half_circle_length_correction(
#endif
-#line 652 "dk3figah.ctr"
+#line 647 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
#if VERSION_BEFORE_20150821
cmin = dk3ma_d_sub_ok(
@@ -738,7 +712,7 @@ dk3figah_half_circle_length_correction(
} break;
}
-#line 677 "dk3figah.ctr"
+#line 672 "dk3figah.ctr"
return back;
}
@@ -771,7 +745,7 @@ dk3figah_half_arrow_length_correction(
double cmax;
-#line 708 "dk3figah.ctr"
+#line 703 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
cmin = dk3ma_d_div_ok(
dk3ma_d_mul_ok(
@@ -825,7 +799,7 @@ dk3figah_half_arrow_length_correction(
} break;
}
-#line 760 "dk3figah.ctr"
+#line 755 "dk3figah.ctr"
return back;
}
#else
@@ -857,7 +831,7 @@ dk3figah_half_arrow_length_correction(
-#line 790 "dk3figah.ctr"
+#line 785 "dk3figah.ctr"
w = ah->wi;
h = ah->he;
switch(incr) {
@@ -871,7 +845,7 @@ dk3figah_half_arrow_length_correction(
lw = dk3fig_tool_get_lw(drw, obj, ec);
-#line 802 "dk3figah.ctr"
+#line 797 "dk3figah.ctr"
cmin = dk3ma_d_div_ok(
dk3ma_d_mul_ok(2.0, dk3ma_d_mul_ok(h, lw, ec), ec), w, ec
);
@@ -885,7 +859,7 @@ dk3figah_half_arrow_length_correction(
cmax = dk3ma_d_mul_ok(2.0, d, ec);
-#line 814 "dk3figah.ctr"
+#line 809 "dk3figah.ctr"
switch(obj->cs) {
case DK3_FIG_LC_PROJECTING: case DK3_FIG_LC_ROUND: {
back = dk3ma_d_sub_ok(
@@ -899,7 +873,7 @@ dk3figah_half_arrow_length_correction(
} break;
}
-#line 826 "dk3figah.ctr"
+#line 821 "dk3figah.ctr"
return back;
}
#endif
@@ -931,7 +905,7 @@ dk3figah_half_arrow_length_correction_tolerance(
double cmax;
-#line 856 "dk3figah.ctr"
+#line 851 "dk3figah.ctr"
lw = dk3fig_tool_get_lw(drw, obj, ec);
cmin = dk3ma_d_div_ok(
dk3ma_d_mul_ok(
@@ -981,7 +955,7 @@ dk3figah_half_arrow_length_correction_tolerance(
} break;
}
-#line 904 "dk3figah.ctr"
+#line 899 "dk3figah.ctr"
return back;
}
#else
@@ -1014,7 +988,7 @@ dk3figah_half_arrow_length_correction_tolerance(
-#line 935 "dk3figah.ctr"
+#line 930 "dk3figah.ctr"
w = ah->wi;
h = ah->he;
switch(incr) {
@@ -1028,7 +1002,7 @@ dk3figah_half_arrow_length_correction_tolerance(
lw = dk3fig_tool_get_lw(drw, obj, ec);
-#line 947 "dk3figah.ctr"
+#line 942 "dk3figah.ctr"
cmin = dk3ma_d_div_ok(
dk3ma_d_mul_ok(2.0, dk3ma_d_mul_ok(h, lw, ec), ec), w, ec
);
@@ -1042,11 +1016,11 @@ dk3figah_half_arrow_length_correction_tolerance(
cmax = dk3ma_d_mul_ok(2.0, d, ec);
-#line 959 "dk3figah.ctr"
+#line 954 "dk3figah.ctr"
back = 0.25 * fabs(dk3ma_d_sub_ok(cmax, cmin, ec));
-#line 961 "dk3figah.ctr"
+#line 956 "dk3figah.ctr"
return back;
}
#endif
@@ -1073,7 +1047,7 @@ dk3figah_length_correction(
double back = 0.0;
-#line 986 "dk3figah.ctr"
+#line 981 "dk3figah.ctr"
switch(ah->as) {
case DK3_FIG_AS_RHOMBUS: { /* 4 */
if((1 == ah->af) && (DK3_FIG_SRCTYPE_JFIG == drw->srctype)) {
@@ -1088,11 +1062,11 @@ dk3figah_length_correction(
case DK3_FIG_AS_RECTANGLE: /* 7 */
case DK3_FIG_AS_INVERSE: /* 8 */
{
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
} break;
case DK3_FIG_AS_HALF_CIRCLE_END: { /* 6 */
if(1 == ah->af) {
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
} else {
back = dk3figah_half_circle_length_correction(drw, obj, ah, ec);
}
@@ -1108,21 +1082,21 @@ dk3figah_length_correction(
} break;
case DK3_FIG_AS_TRIANGLE_FORK: { /* 13 */
if(1 == ah->af) {
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
} else {
back = dk3figah_anti_arrow_length_correction(drw, obj, ah, ec);
}
} break;
case DK3_FIG_AS_RECTANGLE_FORK: { /* 14 */
if(1 == ah->af) {
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
} else {
#if 0
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
#endif
back = dk3ma_d_add_ok(back, ah->he, ec);
-#line 1033 "dk3figah.ctr"
+#line 1028 "dk3figah.ctr"
}
} break;
default: {
@@ -1130,7 +1104,7 @@ dk3figah_length_correction(
} break;
}
-#line 1039 "dk3figah.ctr"
+#line 1034 "dk3figah.ctr"
return back;
}
@@ -1155,7 +1129,7 @@ dk3figah_length_correction_tolerance(
double back;
-#line 1062 "dk3figah.ctr"
+#line 1057 "dk3figah.ctr"
switch(ah->as) {
case DK3_FIG_AS_RHOMBUS: { /* 4 */
if((1 == ah->af) && (DK3_FIG_SRCTYPE_JFIG == drw->srctype)) {
@@ -1170,10 +1144,10 @@ dk3figah_length_correction_tolerance(
case DK3_FIG_AS_RECTANGLE: /* 7 */
case DK3_FIG_AS_INVERSE: /* 8 */
{
- back = dk3figah_block_line_length_correction_tolerance(drw,obj,ah,ec);
+ back = dk3figah_block_line_length_correction_tolerance(drw,obj,ec);
} break;
case DK3_FIG_AS_HALF_CIRCLE_END: { /* 6 */
- back = dk3figah_block_line_length_correction_tolerance(drw,obj,ah,ec);
+ back = dk3figah_block_line_length_correction_tolerance(drw,obj,ec);
} break;
case DK3_FIG_AS_CLOSED_HALF: { /* 10 */
back = dk3figah_half_arrow_length_correction_tolerance(drw,obj,ah,ec,0);
@@ -1186,20 +1160,20 @@ dk3figah_length_correction_tolerance(
} break;
case DK3_FIG_AS_TRIANGLE_FORK: { /* 13 */
if(1 == ah->af) {
- back = dk3figah_block_line_length_correction_tolerance(drw,obj,ah,ec);
+ back = dk3figah_block_line_length_correction_tolerance(drw,obj,ec);
} else {
back = dk3figah_anti_arrow_length_correction_tolerance(drw,obj,ah,ec);
}
} break;
case DK3_FIG_AS_RECTANGLE_FORK: { /* 14 */
- back = dk3figah_block_line_length_correction_tolerance(drw,obj,ah,ec);
+ back = dk3figah_block_line_length_correction_tolerance(drw,obj,ec);
} break;
default: {
back = dk3figah_normal_arrow_length_correction_tolerance(drw,obj,ah,ec);
} break;
}
-#line 1104 "dk3figah.ctr"
+#line 1099 "dk3figah.ctr"
return back;
}
@@ -1211,7 +1185,7 @@ dk3figah_candidate(dk3_fig_obj_t *obj)
int back = 0;
-#line 1114 "dk3figah.ctr"
+#line 1109 "dk3figah.ctr"
if(obj) {
switch(obj->ot) {
case DK3_FIG_OBJ_POLYLINE: {
@@ -1237,7 +1211,7 @@ dk3figah_candidate(dk3_fig_obj_t *obj)
}
}
-#line 1138 "dk3figah.ctr"
+#line 1133 "dk3figah.ctr"
return back;
}
@@ -1262,7 +1236,7 @@ dk3figah_find_shift_length(
double back = 0.0;
-#line 1161 "dk3figah.ctr"
+#line 1156 "dk3figah.ctr"
switch(ah->as) {
case DK3_FIG_AS_TRIANGLE_FORK: {
if(ah->af) {
@@ -1298,7 +1272,7 @@ dk3figah_find_shift_length(
} break;
}
-#line 1195 "dk3figah.ctr"
+#line 1190 "dk3figah.ctr"
return back;
}
@@ -1331,7 +1305,7 @@ dk3figah_straight_arrowhead(
int back = 0;
-#line 1226 "dk3figah.ctr"
+#line 1221 "dk3figah.ctr"
dk3mem_cpy((void *)(&aep), (void *)ep, sizeof(dk3_fig_poly_point_t));
switch(ah->as) {
case DK3_FIG_AS_STICK: {
@@ -1727,7 +1701,7 @@ dk3figah_straight_arrowhead(
}
if(ah->o1) {
-#line 1620 "dk3figah.ctr"
+#line 1615 "dk3figah.ctr"
(((dk3_fig_obj_t *)(ah->o1))->dt).hci.cx = aep.x;
(((dk3_fig_obj_t *)(ah->o1))->dt).hci.cy = aep.y;
(((dk3_fig_obj_t *)(ah->o1))->dt).hci.ra = 0.5 * ah->he;
@@ -1735,7 +1709,7 @@ dk3figah_straight_arrowhead(
back = 1;
} else {
-#line 1626 "dk3figah.ctr"
+#line 1621 "dk3figah.ctr"
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
}
} break;
@@ -2329,7 +2303,7 @@ dk3figah_straight_arrowhead(
}
-#line 2218 "dk3figah.ctr"
+#line 2213 "dk3figah.ctr"
return back;
}
@@ -2338,15 +2312,13 @@ dk3figah_straight_arrowhead(
/** Calculate arrowheads for polyline.
@param drw Drawing to modify.
@param obj Object to modify.
- @param objno Object number.
@return 1 on success, 0 on error.
*/
static
int
dk3figah_calculate_polyline(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
)
{
dk3_fig_poly_point_t *po; /* Points of the polyline. */
@@ -2360,7 +2332,7 @@ dk3figah_calculate_polyline(
int back = 1;
-#line 2247 "dk3figah.ctr"
+#line 2240 "dk3figah.ctr"
np = (obj->dt).pol.np;
po = (obj->dt).pol.po;
if((1 < np) && (po)) {
@@ -2374,7 +2346,7 @@ dk3figah_calculate_polyline(
cuts = dk3figah_length_correction(drw, obj, obj->ab, &mec);
}
-#line 2259 "dk3figah.ctr"
+#line 2252 "dk3figah.ctr"
/*
Create arrowhead objects.
*/
@@ -2429,7 +2401,7 @@ dk3figah_calculate_polyline(
}
-#line 2312 "dk3figah.ctr"
+#line 2305 "dk3figah.ctr"
return back;
}
@@ -2438,7 +2410,6 @@ dk3figah_calculate_polyline(
/** Calculate values for a given t.
@param drw Drawing object.
@param obj Fig object.
- @param ah Arrowhead to modify.
@param xpos Pointer to x position variable.
@param ypos Pointer to y position variable.
@param phi Pointer to direction variable.
@@ -2452,7 +2423,6 @@ int
dk3figah_spline_values(
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- dk3_fig_ah_t *ah,
double *xpos,
double *ypos,
double *phi,
@@ -2567,7 +2537,7 @@ dk3figah_one_spline_arrowhead(
int back = 0;
-#line 2448 "dk3figah.ctr"
+#line 2439 "dk3figah.ctr"
osp = (obj->dt).spl.po;
onp = (obj->dt).spl.np;
t0 = ((ab) ? 0.0 : (double)(onp - 1));
@@ -2577,18 +2547,31 @@ dk3figah_one_spline_arrowhead(
case DK3_FIG_AS_STICK:
case DK3_FIG_AS_CLOSED: {
-#line 2456 "dk3figah.ctr"
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+#line 2447 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t0) {
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t1) {
-#line 2465 "dk3figah.ctr"
+#line 2469 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
);
@@ -2614,16 +2597,16 @@ dk3figah_one_spline_arrowhead(
);
if(res) {
-#line 2489 "dk3figah.ctr"
+#line 2493 "dk3figah.ctr"
sp[n1].x = dk3xsp_get_x(&seg);
sp[n1].y = dk3xsp_get_y(&seg);
sp[n1].s = 0.0;
-#line 2492 "dk3figah.ctr"
+#line 2496 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
-#line 2494 "dk3figah.ctr"
+#line 2498 "dk3figah.ctr"
if(j == n1) {
t = t1;
} else {
@@ -2631,23 +2614,32 @@ dk3figah_one_spline_arrowhead(
s, (((double)j / (double)n1) * ah->he), &mec
);
-#line 2500 "dk3figah.ctr"
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
-
#line 2504 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+
+#line 2509 "dk3figah.ctr"
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+
+#line 2514 "dk3figah.ctr"
+ }
-#line 2505 "dk3figah.ctr"
+#line 2516 "dk3figah.ctr"
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
-#line 2510 "dk3figah.ctr"
+#line 2521 "dk3figah.ctr"
if(res) {
pp[0].x = pp[1].x = 0.0;
if(j == n1) {
@@ -2662,10 +2654,10 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_shift_point(&pp[1], xpos, ypos, &mec);
sp[n1 - j].x = pp[0].x;
-#line 2523 "dk3figah.ctr"
+#line 2534 "dk3figah.ctr"
sp[n1 - j].y = pp[0].y;
-#line 2524 "dk3figah.ctr"
+#line 2535 "dk3figah.ctr"
sp[n1 + j].x = pp[1].x;
sp[n1 + j].y = pp[1].y;
sp[n1 - j].s = sp[n1 + j].s =
@@ -2673,24 +2665,24 @@ dk3figah_one_spline_arrowhead(
} else {
back = 0; i = n1;
-#line 2530 "dk3figah.ctr"
+#line 2541 "dk3figah.ctr"
/* ##### ERROR: Spline calculation failed! */
}
} else {
-#line 2533 "dk3figah.ctr"
+#line 2544 "dk3figah.ctr"
back = 0; i = n1;
/* ##### ERROR: Spline calculation failed! */
}
}
} else {
-#line 2538 "dk3figah.ctr"
+#line 2549 "dk3figah.ctr"
back = 0;
/* ##### ERROR: Spline calculation failed! */
}
-#line 2541 "dk3figah.ctr"
+#line 2552 "dk3figah.ctr"
}
} else {
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
@@ -2701,28 +2693,42 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_INDENTED: {
-#line 2550 "dk3figah.ctr"
+#line 2561 "dk3figah.ctr"
l1 = dk3ma_d_mul_ok(1.25, ah->he, &mec);
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) {
-#line 2564 "dk3figah.ctr"
+#line 2589 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
);
-#line 2567 "dk3figah.ctr"
+#line 2592 "dk3figah.ctr"
n2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t2), &mec)), &mec
);
@@ -2731,7 +2737,7 @@ dk3figah_one_spline_arrowhead(
np = dk3mem_mul_size_t(2, dk3mem_add_size_t(n1, n2, &mec), &mec);
if(0 == mec) {
-#line 2574 "dk3figah.ctr"
+#line 2599 "dk3figah.ctr"
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_SPLINE, 5,
obj->lw, obj->pc, ((ah->af) ? obj->pc : 7), 20,
@@ -2748,12 +2754,12 @@ dk3figah_one_spline_arrowhead(
);
if(res) {
-#line 2589 "dk3figah.ctr"
+#line 2614 "dk3figah.ctr"
sp[n1 + n2 - 1].x = dk3xsp_get_x(&seg);
sp[n1 + n2 - 1].y = dk3xsp_get_y(&seg);
sp[n1 + n2 - 1].s = 0.0;
-#line 2592 "dk3figah.ctr"
+#line 2617 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
if(j == n1) {
@@ -2762,14 +2768,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * l1), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2787,12 +2800,12 @@ dk3figah_one_spline_arrowhead(
sp[n1 + n2 - 1 - j].y = pp[0].y;
-#line 2624 "dk3figah.ctr"
+#line 2656 "dk3figah.ctr"
sp[n1 + n2 - 1 + j].x = pp[1].x;
sp[n1 + n2 - 1 + j].y = pp[1].y;
-#line 2627 "dk3figah.ctr"
+#line 2659 "dk3figah.ctr"
sp[n1 + n2 - 1 - j].s = sp[n1 + n2 - 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -2812,13 +2825,20 @@ dk3figah_one_spline_arrowhead(
(l2 * ((double)j / (double)n2)),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2832,12 +2852,12 @@ dk3figah_one_spline_arrowhead(
sp[n2 - 1 - j].y = pp[0].y;
-#line 2665 "dk3figah.ctr"
+#line 2704 "dk3figah.ctr"
sp[2 * n1 + n2 - 1 + j].x = pp[1].x;
sp[2 * n1 + n2 - 1 + j].y = pp[1].y;
-#line 2668 "dk3figah.ctr"
+#line 2707 "dk3figah.ctr"
sp[n2 - 1 - j].s = sp[2 * n1 + n2 - 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -2850,14 +2870,14 @@ dk3figah_one_spline_arrowhead(
}
}
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t2, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t2, &mec
);
if(res) {
sp[np - 1].x = xpos;
sp[np - 1].y = ypos;
sp[np - 1].s = 0.0;
-#line 2686 "dk3figah.ctr"
+#line 2725 "dk3figah.ctr"
} else {
back = 0;
/* ##### ERROR: Spline calculation failed! */
@@ -2868,7 +2888,7 @@ dk3figah_one_spline_arrowhead(
/* ##### ERROR: Spline calculation failed! */
}
-#line 2695 "dk3figah.ctr"
+#line 2734 "dk3figah.ctr"
}
} else {
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
@@ -2882,28 +2902,42 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_POINTED: {
-#line 2707 "dk3figah.ctr"
+#line 2746 "dk3figah.ctr"
l1 = 0.75 * ah->he;
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) {
-#line 2721 "dk3figah.ctr"
+#line 2774 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
);
-#line 2724 "dk3figah.ctr"
+#line 2777 "dk3figah.ctr"
n2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t2), &mec)), &mec
);
@@ -2912,7 +2946,7 @@ dk3figah_one_spline_arrowhead(
np = dk3mem_mul_size_t(2, dk3mem_add_size_t(n1, n2, &mec), &mec);
if(0 == mec) {
-#line 2731 "dk3figah.ctr"
+#line 2784 "dk3figah.ctr"
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_SPLINE, 5,
obj->lw, obj->pc, ((ah->af) ? obj->pc : 7), 20,
@@ -2929,12 +2963,12 @@ dk3figah_one_spline_arrowhead(
);
if(res) {
-#line 2746 "dk3figah.ctr"
+#line 2799 "dk3figah.ctr"
sp[n1 + n2 - 1].x = dk3xsp_get_x(&seg);
sp[n1 + n2 - 1].y = dk3xsp_get_y(&seg);
sp[n1 + n2 - 1].s = 0.0;
-#line 2749 "dk3figah.ctr"
+#line 2802 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
if(j == n1) {
@@ -2943,14 +2977,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * l1), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2968,12 +3009,12 @@ dk3figah_one_spline_arrowhead(
sp[n1 + n2 - 1 - j].y = pp[0].y;
-#line 2781 "dk3figah.ctr"
+#line 2841 "dk3figah.ctr"
sp[n1 + n2 - 1 + j].x = pp[1].x;
sp[n1 + n2 - 1 + j].y = pp[1].y;
-#line 2784 "dk3figah.ctr"
+#line 2844 "dk3figah.ctr"
sp[n1 + n2 - 1 - j].s = sp[n1 + n2 - 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -2993,13 +3034,20 @@ dk3figah_one_spline_arrowhead(
(l2 * ((double)j / (double)n2)),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3013,12 +3061,12 @@ dk3figah_one_spline_arrowhead(
sp[n2 - 1 - j].y = pp[0].y;
-#line 2822 "dk3figah.ctr"
+#line 2889 "dk3figah.ctr"
sp[2 * n1 + n2 - 1 + j].x = pp[1].x;
sp[2 * n1 + n2 - 1 + j].y = pp[1].y;
-#line 2825 "dk3figah.ctr"
+#line 2892 "dk3figah.ctr"
sp[n2 - 1 - j].s = sp[2 * n1 + n2 - 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -3031,14 +3079,14 @@ dk3figah_one_spline_arrowhead(
}
}
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t2, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t2, &mec
);
if(res) {
sp[np - 1].x = xpos;
sp[np - 1].y = ypos;
sp[np - 1].s = 0.0;
-#line 2843 "dk3figah.ctr"
+#line 2910 "dk3figah.ctr"
} else {
back = 0;
/* ##### ERROR: Spline calculation failed! */
@@ -3049,7 +3097,7 @@ dk3figah_one_spline_arrowhead(
/* ##### ERROR: Spline calculation failed! */
}
-#line 2852 "dk3figah.ctr"
+#line 2919 "dk3figah.ctr"
}
} else {
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
@@ -3064,7 +3112,7 @@ dk3figah_one_spline_arrowhead(
case DK3_FIG_AS_RHOMBUS: {
if((1 == ah->af) && (DK3_FIG_SRCTYPE_JFIG == drw->srctype)) {
-#line 2865 "dk3figah.ctr"
+#line 2932 "dk3figah.ctr"
if(dk3xsp_calculate_position(&seg, osp, onp, t0, drw->cosp, 0, &mec)) {
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_ELLIPSE, 3,
@@ -3085,33 +3133,47 @@ dk3figah_one_spline_arrowhead(
}
} else {
-#line 2884 "dk3figah.ctr"
+#line 2951 "dk3figah.ctr"
/* ##### ERROR: Spline calculation failed! */
}
} else {
-#line 2887 "dk3figah.ctr"
+#line 2954 "dk3figah.ctr"
l1 = 0.5 * ah->he;
l2 = l1;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) {
-#line 2901 "dk3figah.ctr"
+#line 2982 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
);
-#line 2904 "dk3figah.ctr"
+#line 2985 "dk3figah.ctr"
n2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t2), &mec)), &mec
);
@@ -3120,7 +3182,7 @@ dk3figah_one_spline_arrowhead(
np = dk3mem_mul_size_t(2, dk3mem_add_size_t(n1, n2, &mec), &mec);
if(0 == mec) {
-#line 2911 "dk3figah.ctr"
+#line 2992 "dk3figah.ctr"
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_SPLINE, 5,
obj->lw, obj->pc, ((ah->af) ? obj->pc : 7), 20,
@@ -3137,12 +3199,12 @@ dk3figah_one_spline_arrowhead(
);
if(res) {
-#line 2926 "dk3figah.ctr"
+#line 3007 "dk3figah.ctr"
sp[n1 + n2 - 1].x = dk3xsp_get_x(&seg);
sp[n1 + n2 - 1].y = dk3xsp_get_y(&seg);
sp[n1 + n2 - 1].s = 0.0;
-#line 2929 "dk3figah.ctr"
+#line 3010 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
if(j == n1) {
@@ -3151,14 +3213,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * l1), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3176,12 +3245,12 @@ dk3figah_one_spline_arrowhead(
sp[n1 + n2 - 1 - j].y = pp[0].y;
-#line 2961 "dk3figah.ctr"
+#line 3049 "dk3figah.ctr"
sp[n1 + n2 - 1 + j].x = pp[1].x;
sp[n1 + n2 - 1 + j].y = pp[1].y;
-#line 2964 "dk3figah.ctr"
+#line 3052 "dk3figah.ctr"
sp[n1 + n2 - 1 - j].s = sp[n1 + n2 - 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -3201,13 +3270,20 @@ dk3figah_one_spline_arrowhead(
(l2 * ((double)j / (double)n2)),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3221,12 +3297,12 @@ dk3figah_one_spline_arrowhead(
sp[n2 - 1 - j].y = pp[0].y;
-#line 3002 "dk3figah.ctr"
+#line 3097 "dk3figah.ctr"
sp[2 * n1 + n2 - 1 + j].x = pp[1].x;
sp[2 * n1 + n2 - 1 + j].y = pp[1].y;
-#line 3005 "dk3figah.ctr"
+#line 3100 "dk3figah.ctr"
sp[n2 - 1 - j].s = sp[2 * n1 + n2 - 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -3239,14 +3315,14 @@ dk3figah_one_spline_arrowhead(
}
}
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t2, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t2, &mec
);
if(res) {
sp[np - 1].x = xpos;
sp[np - 1].y = ypos;
sp[np - 1].s = 0.0;
-#line 3023 "dk3figah.ctr"
+#line 3118 "dk3figah.ctr"
} else {
back = 0;
/* ##### ERROR: Spline calculation failed! */
@@ -3257,7 +3333,7 @@ dk3figah_one_spline_arrowhead(
/* ##### ERROR: Spline calculation failed! */
}
-#line 3032 "dk3figah.ctr"
+#line 3127 "dk3figah.ctr"
}
} else {
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
@@ -3272,9 +3348,9 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_FULL_CIRCLE_END: {
-#line 3045 "dk3figah.ctr"
+#line 3140 "dk3figah.ctr"
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) {
#if VERSION_BEFORE_20121220
@@ -3323,10 +3399,10 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_HALF_CIRCLE_END: {
-#line 3094 "dk3figah.ctr"
+#line 3189 "dk3figah.ctr"
if(ah->af) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) {
xpos = dk3ma_d_sub_ok(xpos, (0.5 * lw * cos(phi)), &mec);
@@ -3351,36 +3427,43 @@ dk3figah_one_spline_arrowhead(
}
}
} else {
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, (0.5 * ah->he),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, (0.5 * ah->he),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, (0.5 * ah->he),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t1) {
dist = fabs(dk3ma_d_sub_ok(t1, t0, &mec));
-#line 3127 "dk3figah.ctr"
+#line 3229 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(dist, drw->splspp, &mec)),
&mec
);
-#line 3131 "dk3figah.ctr"
+#line 3233 "dk3figah.ctr"
/* 2013-11-23
If we want to correct n1, we have to use ceil() in
the comparison too.
*/
if(n1 < dk3ma_d_to_sz_ok(ceil(drw->arcspp), &mec)) {
-#line 3136 "dk3figah.ctr"
+#line 3238 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(ceil(drw->arcspp), &mec);
}
-#line 3138 "dk3figah.ctr"
+#line 3240 "dk3figah.ctr"
if(n1 < drw->minspp) {
n1 = drw->minspp;
}
-#line 3141 "dk3figah.ctr"
+#line 3243 "dk3figah.ctr"
np = dk3mem_add_size_t(dk3mem_mul_size_t(2, n1, &mec), 1, &mec);
if(0 == mec) {
ao1 = dk3fig_obj_new(
@@ -3399,22 +3482,30 @@ dk3figah_one_spline_arrowhead(
);
if(res) {
-#line 3158 "dk3figah.ctr"
+#line 3260 "dk3figah.ctr"
sp[n1].x = dk3xsp_get_x(&seg);
sp[n1].y = dk3xsp_get_y(&seg);
sp[n1].s = -1.0;
-#line 3161 "dk3figah.ctr"
+#line 3263 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
- t1 = dk3xsp_get_t_for_distance(
- osp, onp,
- (0.5 * ah->he * cos(M_PI_2 * ((double)j / (double)n1))),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp,
+ (0.5 * ah->he * cos(M_PI_2 * ((double)j / (double)n1))),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp,
+ (0.5 * ah->he * cos(M_PI_2 * ((double)j / (double)n1))),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t1) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t1, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t1, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -3429,10 +3520,10 @@ dk3figah_one_spline_arrowhead(
sp[n1 - j].x = pp[0].x;
sp[n1 - j].y = pp[0].y;
-#line 3184 "dk3figah.ctr"
+#line 3294 "dk3figah.ctr"
sp[n1 + j].x = pp[1].x;
-#line 3185 "dk3figah.ctr"
+#line 3295 "dk3figah.ctr"
sp[n1 + j].y = pp[1].y;
sp[n1 - j].s = sp[n1 + j].s =
((j == n1) ? 0.0 : (-1.0));
@@ -3460,17 +3551,27 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_RECTANGLE: {
-#line 3211 "dk3figah.ctr"
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+#line 3321 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1)) {
-#line 3219 "dk3figah.ctr"
+#line 3339 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
);
@@ -3489,11 +3590,11 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) {
-#line 3240 "dk3figah.ctr"
+#line 3360 "dk3figah.ctr"
pp[0].x = pp[1].x = 0;
pp[0].y = 0.5 * ah->wi;
pp[1].y = -0.5 * ah->wi;
@@ -3503,10 +3604,10 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_shift_point(&pp[1], xpos, ypos, &mec);
sp[n1].x = pp[0].x;
-#line 3248 "dk3figah.ctr"
+#line 3368 "dk3figah.ctr"
sp[n1].y = pp[0].y;
-#line 3249 "dk3figah.ctr"
+#line 3369 "dk3figah.ctr"
sp[n1 + 1].x = pp[1].x;
sp[n1 + 1].y = pp[1].y;
sp[n1].s = sp[n1 + 1].s = 0.0;
@@ -3518,14 +3619,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (ah->he * ((double)j / (double)n1)), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3539,12 +3647,12 @@ dk3figah_one_spline_arrowhead(
sp[n1 - j].y = pp[0].y;
-#line 3280 "dk3figah.ctr"
+#line 3407 "dk3figah.ctr"
sp[n1 + 1 + j].x = pp[1].x;
sp[n1 + 1 + j].y = pp[1].y;
-#line 3283 "dk3figah.ctr"
+#line 3410 "dk3figah.ctr"
sp[n1 - j].s = sp[n1 + 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
@@ -3569,17 +3677,27 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_INVERSE: {
-#line 3306 "dk3figah.ctr"
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+#line 3433 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1)) {
-#line 3314 "dk3figah.ctr"
+#line 3451 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
);
@@ -3598,16 +3716,16 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t1, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t1, &mec
);
if(res) {
-#line 3335 "dk3figah.ctr"
+#line 3472 "dk3figah.ctr"
sp[n1].x = xpos;
sp[n1].y = ypos;
sp[n1].s = 0.0;
-#line 3338 "dk3figah.ctr"
+#line 3475 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
if(j == n1) {
@@ -3616,14 +3734,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, ((1.0 - ((double)j / (double)n1)) * ah->he), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3637,10 +3762,10 @@ dk3figah_one_spline_arrowhead(
sp[n1 + j].x = pp[1].x; sp[n1 + j].y = pp[1].y;
-#line 3366 "dk3figah.ctr"
+#line 3510 "dk3figah.ctr"
-#line 3367 "dk3figah.ctr"
+#line 3511 "dk3figah.ctr"
sp[n1 - j].s = sp[n1 + j].s = ((j == n1) ? 0.0 : (-1.0));
} else {
}
@@ -3660,33 +3785,47 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_INDENTED_FILLED_HALF: {
-#line 3385 "dk3figah.ctr"
+#line 3529 "dk3figah.ctr"
l1 = dk3ma_d_mul_ok(1.25, ah->he, &mec);
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) {
-#line 3399 "dk3figah.ctr"
+#line 3557 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
);
-#line 3402 "dk3figah.ctr"
+#line 3560 "dk3figah.ctr"
n2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t2), &mec)), &mec
);
-#line 3405 "dk3figah.ctr"
+#line 3563 "dk3figah.ctr"
n3 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t2 - t0), &mec)), &mec
);
@@ -3697,7 +3836,7 @@ dk3figah_one_spline_arrowhead(
nq = dk3mem_add_size_t(dk3mem_add_size_t(n1, n2, &mec), n3, &mec);
if(0 == mec) {
-#line 3414 "dk3figah.ctr"
+#line 3572 "dk3figah.ctr"
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_SPLINE, 5,
obj->lw, obj->pc, 7, 20,
@@ -3723,17 +3862,17 @@ dk3figah_one_spline_arrowhead(
);
if(res) {
-#line 3438 "dk3figah.ctr"
+#line 3596 "dk3figah.ctr"
sp[n1 + n2 - 1].x = dk3xsp_get_x(&seg);
sp[n1 + n2 - 1].y = dk3xsp_get_y(&seg);
sp[n1 + n2 - 1].s = 0.0;
-#line 3441 "dk3figah.ctr"
+#line 3599 "dk3figah.ctr"
sp2[0].x = dk3xsp_get_x(&seg);
sp2[0].y = dk3xsp_get_y(&seg);
sp2[0].s = 0.0;
-#line 3444 "dk3figah.ctr"
+#line 3602 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
if(j == n1) {
@@ -3742,14 +3881,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * l1), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3775,12 +3921,12 @@ dk3figah_one_spline_arrowhead(
sp[n1 + n2 - 1 - j].y = pp[0].y;
-#line 3484 "dk3figah.ctr"
+#line 3649 "dk3figah.ctr"
sp[n1 + n2 - 1 + j].x = pp[1].x;
sp[n1 + n2 - 1 + j].y = pp[1].y;
-#line 3487 "dk3figah.ctr"
+#line 3652 "dk3figah.ctr"
sp[n1 + n2 - 1 - j].s = sp[n1 + n2 - 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
sp2[j].x = pp[0].x;
@@ -3788,7 +3934,7 @@ dk3figah_one_spline_arrowhead(
sp2[j].s = ((j == n1) ? 0.0 : (-1.0));
-#line 3493 "dk3figah.ctr"
+#line 3658 "dk3figah.ctr"
} else {
back = 0; i = n1;
/* ##### ERROR: Spline calculation failed! */
@@ -3806,13 +3952,20 @@ dk3figah_one_spline_arrowhead(
(l2 * ((double)j / (double)n2)),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3832,12 +3985,12 @@ dk3figah_one_spline_arrowhead(
sp[n2 - 1 - j].y = pp[0].y;
-#line 3535 "dk3figah.ctr"
+#line 3707 "dk3figah.ctr"
sp[2 * n1 + n2 - 1 + j].x = pp[1].x;
sp[2 * n1 + n2 - 1 + j].y = pp[1].y;
-#line 3538 "dk3figah.ctr"
+#line 3710 "dk3figah.ctr"
sp[n2 - 1 - j].s = sp[2 * n1 + n2 - 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
sp2[n1 + j].x = pp[0].x;
@@ -3845,7 +3998,7 @@ dk3figah_one_spline_arrowhead(
sp2[n1 + j].s = ((j == n1) ? 0.0 : (-1.0));
-#line 3544 "dk3figah.ctr"
+#line 3716 "dk3figah.ctr"
} else {
back = 0; i = n2;
/* ##### ERROR: Spline calculation failed! */
@@ -3856,19 +4009,19 @@ dk3figah_one_spline_arrowhead(
}
}
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t2, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t2, &mec
);
if(res) {
sp[np - 1].x = xpos;
sp[np - 1].y = ypos;
sp[np - 1].s = 0.0;
-#line 3560 "dk3figah.ctr"
+#line 3732 "dk3figah.ctr"
sp2[n1 + n2].x = xpos;
sp2[n1 + n2].y = ypos;
sp2[n1 + n2].s = 0.0;
-#line 3563 "dk3figah.ctr"
+#line 3735 "dk3figah.ctr"
} else {
back = 0;
/* ##### ERROR: Spline calculation failed! */
@@ -3880,13 +4033,20 @@ dk3figah_one_spline_arrowhead(
((1.0 - ((double)j / (double)n3)) * ah->he),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
sp2[n1 + n2 + j].x = xpos;
@@ -3894,7 +4054,7 @@ dk3figah_one_spline_arrowhead(
sp2[n1 + n2 + j].s = -1.0;
-#line 3587 "dk3figah.ctr"
+#line 3766 "dk3figah.ctr"
} else {
back = 0; i = n3;
}
@@ -3908,7 +4068,7 @@ dk3figah_one_spline_arrowhead(
/* ##### ERROR: Spline calculation failed! */
}
-#line 3599 "dk3figah.ctr"
+#line 3778 "dk3figah.ctr"
}
} else {
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
@@ -3925,18 +4085,31 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_CLOSED_HALF: {
-#line 3614 "dk3figah.ctr"
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+#line 3793 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t0) {
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t1) {
-#line 3623 "dk3figah.ctr"
+#line 3815 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
);
@@ -3960,16 +4133,16 @@ dk3figah_one_spline_arrowhead(
);
if(res) {
-#line 3645 "dk3figah.ctr"
+#line 3837 "dk3figah.ctr"
sp[n1].x = dk3xsp_get_x(&seg);
sp[n1].y = dk3xsp_get_y(&seg);
sp[n1].s = 0.0;
-#line 3648 "dk3figah.ctr"
+#line 3840 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
-#line 3650 "dk3figah.ctr"
+#line 3842 "dk3figah.ctr"
if(j == n1) {
t = t1;
} else {
@@ -3977,23 +4150,30 @@ dk3figah_one_spline_arrowhead(
s, (((double)j / (double)n1) * ah->he), &mec
);
-#line 3656 "dk3figah.ctr"
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+#line 3848 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
-#line 3660 "dk3figah.ctr"
+#line 3859 "dk3figah.ctr"
-#line 3661 "dk3figah.ctr"
+#line 3860 "dk3figah.ctr"
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
-#line 3666 "dk3figah.ctr"
+#line 3865 "dk3figah.ctr"
if(res) {
pp[0].x = pp[1].x = 0.0;
if(j == n1) {
@@ -4008,10 +4188,10 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_shift_point(&pp[1], xpos, ypos, &mec);
sp[n1 - j].x = pp[0].x;
-#line 3679 "dk3figah.ctr"
+#line 3878 "dk3figah.ctr"
sp[n1 - j].y = pp[0].y;
-#line 3680 "dk3figah.ctr"
+#line 3879 "dk3figah.ctr"
sp[n1 + j].x = pp[1].x;
sp[n1 + j].y = pp[1].y;
sp[n1 - j].s = sp[n1 + j].s =
@@ -4019,24 +4199,24 @@ dk3figah_one_spline_arrowhead(
} else {
back = 0; i = n1;
-#line 3686 "dk3figah.ctr"
+#line 3885 "dk3figah.ctr"
/* ##### ERROR: Spline calculation failed! */
}
} else {
-#line 3689 "dk3figah.ctr"
+#line 3888 "dk3figah.ctr"
back = 0; i = n1;
/* ##### ERROR: Spline calculation failed! */
}
}
} else {
-#line 3694 "dk3figah.ctr"
+#line 3893 "dk3figah.ctr"
back = 0;
/* ##### ERROR: Spline calculation failed! */
}
-#line 3697 "dk3figah.ctr"
+#line 3896 "dk3figah.ctr"
}
} else {
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
@@ -4047,33 +4227,47 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_INDENTED_HALF: {
-#line 3706 "dk3figah.ctr"
+#line 3905 "dk3figah.ctr"
l1 = dk3ma_d_mul_ok(1.25, ah->he, &mec);
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) {
-#line 3720 "dk3figah.ctr"
+#line 3933 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
);
-#line 3723 "dk3figah.ctr"
+#line 3936 "dk3figah.ctr"
n2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t2), &mec)), &mec
);
-#line 3726 "dk3figah.ctr"
+#line 3939 "dk3figah.ctr"
n3 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t2 - t0), &mec)), &mec
);
@@ -4094,7 +4288,7 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
-#line 3745 "dk3figah.ctr"
+#line 3958 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
if(0 == i) {
t = t0;
@@ -4102,14 +4296,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (l1 * ((double)i / (double)(n1))), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -4118,7 +4319,7 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_shift_point(&pp[0], xpos, ypos, &mec);
sp[i].x = pp[0].x;
-#line 3767 "dk3figah.ctr"
+#line 3987 "dk3figah.ctr"
sp[i].y = pp[0].y;
sp[i].s = ((i == 0) ? 0.0 : (-1.0));
} else {
@@ -4145,14 +4346,21 @@ dk3figah_one_spline_arrowhead(
),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -4161,7 +4369,7 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_shift_point(&pp[0], xpos, ypos, &mec);
sp[n1 + i].x = pp[0].x;
-#line 3808 "dk3figah.ctr"
+#line 4035 "dk3figah.ctr"
sp[n1 + i].y = pp[0].y;
sp[n1 + i].s = ((0 == i) ? 0.0 : (-1.0));
} else {
@@ -4180,14 +4388,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (ah->he * (1.0 - ((double)i / (double)n3))), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
sp[n1 + n2 + i].x = xpos;
@@ -4195,7 +4410,7 @@ dk3figah_one_spline_arrowhead(
sp[n1 + n2 + i].s = ((0 == i) ? 0.0 : (-1.0));
-#line 3840 "dk3figah.ctr"
+#line 4074 "dk3figah.ctr"
} else {
back = 0; i = n3;
}
@@ -4213,33 +4428,47 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_BUTTED_HALF: {
-#line 3856 "dk3figah.ctr"
+#line 4090 "dk3figah.ctr"
l1 = 0.75 * ah->he;
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) {
-#line 3870 "dk3figah.ctr"
+#line 4118 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
);
-#line 3873 "dk3figah.ctr"
+#line 4121 "dk3figah.ctr"
n2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t2), &mec)), &mec
);
-#line 3876 "dk3figah.ctr"
+#line 4124 "dk3figah.ctr"
n3 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t2 - t0), &mec)), &mec
);
@@ -4260,7 +4489,7 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
-#line 3895 "dk3figah.ctr"
+#line 4143 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
if(0 == i) {
t = t0;
@@ -4268,14 +4497,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (l1 * ((double)i / (double)(n1))), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -4284,7 +4520,7 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_shift_point(&pp[0], xpos, ypos, &mec);
sp[i].x = pp[0].x;
-#line 3917 "dk3figah.ctr"
+#line 4172 "dk3figah.ctr"
sp[i].y = pp[0].y;
sp[i].s = ((i == 0) ? 0.0 : (-1.0));
} else {
@@ -4311,14 +4547,21 @@ dk3figah_one_spline_arrowhead(
),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -4327,7 +4570,7 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_shift_point(&pp[0], xpos, ypos, &mec);
sp[n1 + i].x = pp[0].x;
-#line 3958 "dk3figah.ctr"
+#line 4220 "dk3figah.ctr"
sp[n1 + i].y = pp[0].y;
sp[n1 + i].s = ((0 == i) ? 0.0 : (-1.0));
} else {
@@ -4346,14 +4589,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (ah->he * (1.0 - ((double)i / (double)n3))), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
sp[n1 + n2 + i].x = xpos;
@@ -4361,7 +4611,7 @@ dk3figah_one_spline_arrowhead(
sp[n1 + n2 + i].s = ((0 == i) ? 0.0 : (-1.0));
-#line 3990 "dk3figah.ctr"
+#line 4259 "dk3figah.ctr"
} else {
back = 0; i = n3;
}
@@ -4379,11 +4629,17 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_TRIANGLE_FORK: {
-#line 4006 "dk3figah.ctr"
+#line 4275 "dk3figah.ctr"
if(ah->af) {
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t0) {
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_POLYLINE, 1,
@@ -4400,7 +4656,7 @@ dk3figah_one_spline_arrowhead(
pp[0].y = 0.5 * ah->wi;
pp[1].y = -0.5 * ah->wi;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) {
dk3fig_tool_rotate_point(&pp[0], phi, &mec);
@@ -4418,16 +4674,26 @@ dk3figah_one_spline_arrowhead(
}
}
} else {
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1)) {
-#line 4052 "dk3figah.ctr"
+#line 4337 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
);
@@ -4446,16 +4712,16 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t1, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t1, &mec
);
if(res) {
-#line 4073 "dk3figah.ctr"
+#line 4358 "dk3figah.ctr"
sp[n1].x = xpos;
sp[n1].y = ypos;
sp[n1].s = 0.0;
-#line 4076 "dk3figah.ctr"
+#line 4361 "dk3figah.ctr"
for(i = 0; i < n1; i++) {
j = i + 1;
if(j == n1) {
@@ -4464,14 +4730,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, ((1.0 - ((double)j / (double)n1)) * ah->he), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -4485,10 +4758,10 @@ dk3figah_one_spline_arrowhead(
sp[n1 + j].x = pp[1].x; sp[n1 + j].y = pp[1].y;
-#line 4104 "dk3figah.ctr"
+#line 4396 "dk3figah.ctr"
-#line 4105 "dk3figah.ctr"
+#line 4397 "dk3figah.ctr"
sp[n1 - j].s = sp[n1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -4510,18 +4783,28 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_RECTANGLE_FORK: {
-#line 4125 "dk3figah.ctr"
+#line 4417 "dk3figah.ctr"
if(ah->af) {
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- l1 = dk3ma_d_add_ok(s, ah->he, &mec);
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, l1, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ l1 = dk3ma_d_add_ok(s, ah->he, &mec);
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, l1, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ l1 = dk3ma_d_add_ok(s, ah->he, &mec);
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, l1, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1)) {
-#line 4134 "dk3figah.ctr"
+#line 4436 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
);
@@ -4540,11 +4823,11 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) {
-#line 4155 "dk3figah.ctr"
+#line 4457 "dk3figah.ctr"
pp[0].x = 0.0; pp[1].x = 0.0;
pp[0].y = 0.5 * ah->wi;
pp[1].y = -0.5 * ah->wi;
@@ -4556,12 +4839,12 @@ dk3figah_one_spline_arrowhead(
sp[n1].y = pp[0].y;
-#line 4165 "dk3figah.ctr"
+#line 4467 "dk3figah.ctr"
sp[n1 + 1].x = pp[1].x;
sp[n1 + 1].y = pp[1].y;
-#line 4168 "dk3figah.ctr"
+#line 4470 "dk3figah.ctr"
sp[n1].s = sp[n1 + 1].s = 0.0;
for(i = 0; i < n1; i++) {
j = i + 1;
@@ -4572,20 +4855,27 @@ dk3figah_one_spline_arrowhead(
s, (((double)j / (double)n1) * ah->he), &mec
);
-#line 4177 "dk3figah.ctr"
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+#line 4479 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
-#line 4181 "dk3figah.ctr"
+#line 4490 "dk3figah.ctr"
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
-#line 4186 "dk3figah.ctr"
+#line 4495 "dk3figah.ctr"
if(res) {
pp[0].x = 0.0; pp[1].x = 0.0;
pp[0].y = 0.5 * ah->wi;
@@ -4593,29 +4883,29 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_rotate_point(&pp[0], phi, &mec);
-#line 4192 "dk3figah.ctr"
+#line 4501 "dk3figah.ctr"
dk3fig_tool_rotate_point(&pp[1], phi, &mec);
-#line 4194 "dk3figah.ctr"
+#line 4503 "dk3figah.ctr"
dk3fig_tool_shift_point(&pp[0], xpos, ypos, &mec);
-#line 4196 "dk3figah.ctr"
+#line 4505 "dk3figah.ctr"
dk3fig_tool_shift_point(&pp[1], xpos, ypos, &mec);
-#line 4198 "dk3figah.ctr"
+#line 4507 "dk3figah.ctr"
sp[n1 - j].x = pp[0].x;
sp[n1 - j].y = pp[0].y;
-#line 4201 "dk3figah.ctr"
+#line 4510 "dk3figah.ctr"
sp[n1 + 1 + j].x = pp[1].x;
sp[n1 + 1 + j].y = pp[1].y;
-#line 4204 "dk3figah.ctr"
+#line 4513 "dk3figah.ctr"
sp[n1 - j].s = sp[n1 + 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -4636,26 +4926,32 @@ dk3figah_one_spline_arrowhead(
}
} else {
-#line 4223 "dk3figah.ctr"
+#line 4532 "dk3figah.ctr"
t0 = ((ab) ? 0.0 : ((obj->dt).spl.np - 1));
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, ah->he, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp,onp,ah->he,drw->xsprec,(obj->dt).spl.fslc,ab,drw->cosp,&mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp,onp,ah->he,drw->xsprec,(obj->dt).spl.fslc,ab,drw->cosp,&mec
+ );
+ }
-#line 4227 "dk3figah.ctr"
+#line 4542 "dk3figah.ctr"
if((0.0 <= t0) && (0.0 <= t1)) {
-#line 4228 "dk3figah.ctr"
+#line 4543 "dk3figah.ctr"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
);
-#line 4231 "dk3figah.ctr"
+#line 4546 "dk3figah.ctr"
if(n1 < drw->minspp) { n1 = drw->minspp; }
np = dk3mem_mul_size_t(2, dk3mem_add_size_t(n1, 1, &mec), &mec);
-#line 4234 "dk3figah.ctr"
+#line 4549 "dk3figah.ctr"
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_SPLINE, 4,
obj->lw, obj->pc, obj->pc, -1,
@@ -4664,52 +4960,52 @@ dk3figah_one_spline_arrowhead(
);
if(ao1) {
-#line 4241 "dk3figah.ctr"
+#line 4556 "dk3figah.ctr"
ah->o1 = (void *)ao1;
sp = (ao1->dt).spl.po;
if(sp) {
-#line 4244 "dk3figah.ctr"
+#line 4559 "dk3figah.ctr"
back = 1;
-#line 4245 "dk3figah.ctr"
+#line 4560 "dk3figah.ctr"
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t1, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t1, &mec
);
-#line 4248 "dk3figah.ctr"
+#line 4563 "dk3figah.ctr"
if(res) {
-#line 4249 "dk3figah.ctr"
+#line 4564 "dk3figah.ctr"
pp[0].x = 0.0; pp[1].x = 0.0;
pp[0].y = 0.5 * ah->wi;
pp[1].y = -0.5 * ah->wi;
dk3fig_tool_rotate_point(&pp[0], phi, &mec);
-#line 4254 "dk3figah.ctr"
+#line 4569 "dk3figah.ctr"
dk3fig_tool_rotate_point(&pp[1], phi, &mec);
-#line 4256 "dk3figah.ctr"
+#line 4571 "dk3figah.ctr"
dk3fig_tool_shift_point(&pp[0], xpos, ypos, &mec);
-#line 4258 "dk3figah.ctr"
+#line 4573 "dk3figah.ctr"
dk3fig_tool_shift_point(&pp[1], xpos, ypos, &mec);
-#line 4260 "dk3figah.ctr"
+#line 4575 "dk3figah.ctr"
sp[n1].x = pp[0].x;
sp[n1].y = pp[0].y;
-#line 4263 "dk3figah.ctr"
+#line 4578 "dk3figah.ctr"
sp[n1 + 1].x = pp[1].x;
sp[n1 + 1].y = pp[1].y;
-#line 4266 "dk3figah.ctr"
+#line 4581 "dk3figah.ctr"
sp[n1].s = sp[n1 + 1].s = 0.0;
for(i = 0; i < n1; i++) {
j = i + 1;
@@ -4717,19 +5013,26 @@ dk3figah_one_spline_arrowhead(
t = t0;
} else {
dist = (1.0 - ((double)j / (double)n1)) * ah->he;
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
-#line 4277 "dk3figah.ctr"
+#line 4599 "dk3figah.ctr"
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
-#line 4282 "dk3figah.ctr"
+#line 4604 "dk3figah.ctr"
if(res) {
pp[0].x = 0.0; pp[1].x = 0.0;
pp[0].y = 0.5 * ah->wi;
@@ -4737,29 +5040,29 @@ dk3figah_one_spline_arrowhead(
dk3fig_tool_rotate_point(&pp[0], phi, &mec);
-#line 4288 "dk3figah.ctr"
+#line 4610 "dk3figah.ctr"
dk3fig_tool_rotate_point(&pp[1], phi, &mec);
-#line 4290 "dk3figah.ctr"
+#line 4612 "dk3figah.ctr"
dk3fig_tool_shift_point(&pp[0], xpos, ypos, &mec);
-#line 4292 "dk3figah.ctr"
+#line 4614 "dk3figah.ctr"
dk3fig_tool_shift_point(&pp[1], xpos, ypos, &mec);
-#line 4294 "dk3figah.ctr"
+#line 4616 "dk3figah.ctr"
sp[n1 - j].x = pp[0].x;
sp[n1 - j].y = pp[0].y;
-#line 4297 "dk3figah.ctr"
+#line 4619 "dk3figah.ctr"
sp[n1 + 1 + j].x = pp[1].x;
sp[n1 + 1 + j].y = pp[1].y;
-#line 4300 "dk3figah.ctr"
+#line 4622 "dk3figah.ctr"
sp[n1 - j].s = sp[n1 + 1 + j].s =
((j == n1) ? 0.0 : (-1.0));
} else {
@@ -4771,28 +5074,28 @@ dk3figah_one_spline_arrowhead(
}
} else {
-#line 4310 "dk3figah.ctr"
+#line 4632 "dk3figah.ctr"
back = 0;
}
} else {
-#line 4313 "dk3figah.ctr"
+#line 4635 "dk3figah.ctr"
}
} else {
-#line 4315 "dk3figah.ctr"
+#line 4637 "dk3figah.ctr"
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
}
} else {
-#line 4318 "dk3figah.ctr"
+#line 4640 "dk3figah.ctr"
}
}
} break;
}
if(mec) {
-#line 4323 "dk3figah.ctr"
+#line 4645 "dk3figah.ctr"
back = 0;
if(ec) { *ec = mec; }
/* ##### ERROR: Mathematical error occured! */
@@ -4802,7 +5105,7 @@ dk3figah_one_spline_arrowhead(
}
}
-#line 4331 "dk3figah.ctr"
+#line 4653 "dk3figah.ctr"
return back;
}
@@ -4811,15 +5114,13 @@ dk3figah_one_spline_arrowhead(
/** Calculate arrowheads for spline.
@param drw Drawing to modify.
@param obj Object to modify.
- @param objno Object number.
@return 1 on success, 0 on error.
*/
static
int
dk3figah_calculate_spline(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
)
{
dk3_xspline_segment_t seg;
@@ -4834,7 +5135,7 @@ dk3figah_calculate_spline(
int res = 0;
-#line 4361 "dk3figah.ctr"
+#line 4681 "dk3figah.ctr"
if((1 < (obj->dt).spl.np) && ((obj->dt).spl.po)) {
/*
Defaults for start and end.
@@ -4846,19 +5147,19 @@ dk3figah_calculate_spline(
*/
if(!(drw->coah)) {
-#line 4371 "dk3figah.ctr"
+#line 4691 "dk3figah.ctr"
if(obj->af) {
-#line 4372 "dk3figah.ctr"
+#line 4692 "dk3figah.ctr"
cute = dk3figah_length_correction(drw, obj, obj->af, &mec);
}
if(obj->ab) {
-#line 4375 "dk3figah.ctr"
+#line 4695 "dk3figah.ctr"
cuts = dk3figah_length_correction(drw, obj, obj->ab, &mec);
}
-#line 4377 "dk3figah.ctr"
+#line 4697 "dk3figah.ctr"
}
/*
Construct arrowhead objects.
@@ -4875,7 +5176,7 @@ dk3figah_calculate_spline(
(obj->dt).spl.po, (obj->dt).spl.np, t, drw->cosp, &mec
);
-#line 4392 "dk3figah.ctr"
+#line 4712 "dk3figah.ctr"
if((alphaf >= 0.0) && (0 == mec)) {
sp.x = dk3xsp_get_x(&seg);
sp.y = dk3xsp_get_y(&seg);
@@ -4883,7 +5184,7 @@ dk3figah_calculate_spline(
drw, obj, obj->af, &sp, alphaf, &mec
);
-#line 4398 "dk3figah.ctr"
+#line 4718 "dk3figah.ctr"
if(!(res)) { back = 0; }
} else {
/* ##### ERROR: Arrowhead calculation failed! */
@@ -4899,13 +5200,13 @@ dk3figah_calculate_spline(
&seg, (obj->dt).spl.po, (obj->dt).spl.np, 0.0, drw->cosp, 0, &mec
);
-#line 4412 "dk3figah.ctr"
+#line 4732 "dk3figah.ctr"
if((res) && (0 == mec)) {
alphab = dk3xsp_direction(
(obj->dt).spl.po, (obj->dt).spl.np, 0.0, drw->cosp, &mec
);
-#line 4416 "dk3figah.ctr"
+#line 4736 "dk3figah.ctr"
if((alphab >= 0.0) && (0 == mec)) {
alphab += M_PI;
sp.x = dk3xsp_get_x(&seg);
@@ -4914,7 +5215,7 @@ dk3figah_calculate_spline(
drw, obj, obj->ab, &sp, alphab, &mec
);
-#line 4423 "dk3figah.ctr"
+#line 4743 "dk3figah.ctr"
if(!(res)) { back = 0; }
} else {
/* ##### ERROR: Arrowhead calculation failed! */
@@ -4931,14 +5232,14 @@ dk3figah_calculate_spline(
back = 0;
}
-#line 4438 "dk3figah.ctr"
+#line 4758 "dk3figah.ctr"
}
if(obj->ab) {
if(!dk3figah_one_spline_arrowhead(drw, obj, obj->ab, 1, &mec)) {
back = 0;
}
-#line 4443 "dk3figah.ctr"
+#line 4763 "dk3figah.ctr"
}
}
/*
@@ -4952,59 +5253,85 @@ dk3figah_calculate_spline(
#endif
if(!(drw->coah)) {
-#line 4455 "dk3figah.ctr"
+#line 4775 "dk3figah.ctr"
if((0.0 < cuts) && (NULL != obj->ab)) {
-#line 4456 "dk3figah.ctr"
- (obj->dt).spl.ts = dk3xsp_get_t_for_distance(
- (obj->dt).spl.po,
- (obj->dt).spl.np,
- cuts,
- dk3figah_length_correction_tolerance(drw, obj, obj->ab, &mec),
- (obj->dt).spl.fslc,
- 1,
- drw->cosp,
- &mec
- );
+#line 4776 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ (obj->dt).spl.ts = dk3xsp_get_t_for_distance_bisection(
+ (obj->dt).spl.po,
+ (obj->dt).spl.np,
+ cuts,
+ dk3figah_length_correction_tolerance(drw, obj, obj->ab, &mec),
+ (obj->dt).spl.fslc,
+ 1,
+ drw->cosp,
+ &mec
+ );
+ } else {
+ (obj->dt).spl.ts = dk3xsp_get_t_for_distance(
+ (obj->dt).spl.po,
+ (obj->dt).spl.np,
+ cuts,
+ dk3figah_length_correction_tolerance(drw, obj, obj->ab, &mec),
+ (obj->dt).spl.fslc,
+ 1,
+ drw->cosp,
+ &mec
+ );
+ }
-#line 4466 "dk3figah.ctr"
+#line 4799 "dk3figah.ctr"
if(0.0 > (obj->dt).spl.ts) {
-#line 4467 "dk3figah.ctr"
+#line 4800 "dk3figah.ctr"
back = 0;
}
} else {
-#line 4470 "dk3figah.ctr"
+#line 4803 "dk3figah.ctr"
}
if((0.0 < cute) && (NULL != obj->af)) {
-#line 4472 "dk3figah.ctr"
- (obj->dt).spl.te = dk3xsp_get_t_for_distance(
- (obj->dt).spl.po,
- (obj->dt).spl.np,
- cute,
- dk3figah_length_correction_tolerance(drw, obj, obj->af, &mec),
- (obj->dt).spl.fslc,
- 0,
- drw->cosp,
- &mec
- );
+#line 4805 "dk3figah.ctr"
+ if (0 != drw->ahbs) {
+ (obj->dt).spl.te = dk3xsp_get_t_for_distance_bisection(
+ (obj->dt).spl.po,
+ (obj->dt).spl.np,
+ cute,
+ dk3figah_length_correction_tolerance(drw, obj, obj->af, &mec),
+ (obj->dt).spl.fslc,
+ 0,
+ drw->cosp,
+ &mec
+ );
+ } else {
+ (obj->dt).spl.te = dk3xsp_get_t_for_distance(
+ (obj->dt).spl.po,
+ (obj->dt).spl.np,
+ cute,
+ dk3figah_length_correction_tolerance(drw, obj, obj->af, &mec),
+ (obj->dt).spl.fslc,
+ 0,
+ drw->cosp,
+ &mec
+ );
+ }
-#line 4482 "dk3figah.ctr"
+#line 4828 "dk3figah.ctr"
if(0.0 > (obj->dt).spl.te) {
-#line 4483 "dk3figah.ctr"
+#line 4829 "dk3figah.ctr"
back = 0;
}
} else {
-#line 4486 "dk3figah.ctr"
+#line 4832 "dk3figah.ctr"
}
}
if(mec) {
-#line 4489 "dk3figah.ctr"
+#line 4835 "dk3figah.ctr"
back = 0;
/* ERROR: Math error */
dk3app_log_i1(drw->app, DK3_LL_ERROR, 260);
@@ -5012,7 +5339,7 @@ dk3figah_calculate_spline(
}
-#line 4495 "dk3figah.ctr"
+#line 4841 "dk3figah.ctr"
return back;
}
@@ -5118,7 +5445,7 @@ dk3figah_one_arc_arrowhead(
int mustadd = 0;
-#line 4599 "dk3figah.ctr"
+#line 4945 "dk3figah.ctr"
if(ab) {
a0 = (obj->dt).arc.as;
if((obj->dt).arc.ae > (obj->dt).arc.as) {
@@ -5136,16 +5463,16 @@ dk3figah_one_arc_arrowhead(
}
-#line 4615 "dk3figah.ctr"
+#line 4961 "dk3figah.ctr"
-#line 4616 "dk3figah.ctr"
+#line 4962 "dk3figah.ctr"
a1 = a0;
-#line 4617 "dk3figah.ctr"
+#line 4963 "dk3figah.ctr"
phi = a1 - f * M_PI_2;
-#line 4618 "dk3figah.ctr"
+#line 4964 "dk3figah.ctr"
s = dk3figah_find_shift_length(drw, obj, ah, &mec);
a0 = dk3ma_d_add_ok(
a0,
@@ -5153,30 +5480,30 @@ dk3figah_one_arc_arrowhead(
&mec
);
-#line 4624 "dk3figah.ctr"
+#line 4970 "dk3figah.ctr"
-#line 4625 "dk3figah.ctr"
+#line 4971 "dk3figah.ctr"
switch(ah->as) {
case DK3_FIG_AS_STICK:
case DK3_FIG_AS_CLOSED: {
-#line 4628 "dk3figah.ctr"
+#line 4974 "dk3figah.ctr"
b1 = dk3ma_d_div_ok(ah->he, (obj->dt).arc.ra, &mec);
if(b1 < (2.0 * M_PI)) {
-#line 4630 "dk3figah.ctr"
+#line 4976 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 4634 "dk3figah.ctr"
+#line 4980 "dk3figah.ctr"
if(drw->minspp > nsegs) { nsegs = drw->minspp; }
#if TRACE_DEBUG
np = 2 * nsegs + 1;
-#line 4637 "dk3figah.ctr"
+#line 4983 "dk3figah.ctr"
#endif
np = dk3mem_add_size_t(dk3mem_mul_size_t(2, nsegs, &mec), 1, &mec);
if(0 == mec) {
@@ -5193,51 +5520,51 @@ dk3figah_one_arc_arrowhead(
sp = (ao1->dt).spl.po;
if(sp) {
-#line 4652 "dk3figah.ctr"
+#line 4998 "dk3figah.ctr"
back = 1;
sp[nsegs].x = (obj->dt).arc.ra * cos(a0);
sp[nsegs].y = (obj->dt).arc.ra * sin(a0);
sp[nsegs].s = 0.0;
for(i = 0; i < nsegs; i++) {
-#line 4657 "dk3figah.ctr"
+#line 5003 "dk3figah.ctr"
j = i + 1;
if(j == nsegs) {
ga = a0 + f * b1;
-#line 4661 "dk3figah.ctr"
+#line 5007 "dk3figah.ctr"
r1 = dk3ma_d_sub_ok(
(obj->dt).arc.ra, (0.5 * ah->wi), &mec
);
-#line 4664 "dk3figah.ctr"
+#line 5010 "dk3figah.ctr"
r2 = dk3ma_d_add_ok(
(obj->dt).arc.ra, (0.5 * ah->wi), &mec
);
-#line 4667 "dk3figah.ctr"
+#line 5013 "dk3figah.ctr"
sp[nsegs - j].s = 0.0;
sp[nsegs + j].s = 0.0;
} else {
ga = a0 + f * b1 * ((double)j / (double)nsegs);
-#line 4672 "dk3figah.ctr"
+#line 5018 "dk3figah.ctr"
r1 = dk3ma_d_sub_ok(
(obj->dt).arc.ra,
(0.5 * ah->wi * ((double)j / (double)nsegs)),
&mec
);
-#line 4677 "dk3figah.ctr"
+#line 5023 "dk3figah.ctr"
r2 = dk3ma_d_add_ok(
(obj->dt).arc.ra,
(0.5 * ah->wi * ((double)j / (double)nsegs)),
&mec
);
-#line 4682 "dk3figah.ctr"
+#line 5028 "dk3figah.ctr"
sp[nsegs - j].s = -1.0;
sp[nsegs + j].s = -1.0;
}
@@ -5251,7 +5578,7 @@ dk3figah_one_arc_arrowhead(
&(sp[i]), (obj->dt).arc.xc, (obj->dt).arc.yc, &mec
);
-#line 4694 "dk3figah.ctr"
+#line 5040 "dk3figah.ctr"
}
if(DK3_FIG_AS_CLOSED == ah->as) {
ao1->st = 5;
@@ -5264,7 +5591,7 @@ dk3figah_one_arc_arrowhead(
ao1->cl = 1;
}
-#line 4705 "dk3figah.ctr"
+#line 5051 "dk3figah.ctr"
}
}
} else {
@@ -5283,25 +5610,25 @@ dk3figah_one_arc_arrowhead(
b2 = dk3ma_d_div_ok((0.25 * ah->he), (obj->dt).arc.ra, &mec);
if((b1 < (2.0 * M_PI)) && (b2 < (2.0 * M_PI))) {
-#line 4722 "dk3figah.ctr"
+#line 5068 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 4726 "dk3figah.ctr"
+#line 5072 "dk3figah.ctr"
ns2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b2, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 4730 "dk3figah.ctr"
+#line 5076 "dk3figah.ctr"
if(drw->minspp > nsegs) { nsegs = drw->minspp; }
if(drw->minspp > ns2) { ns2 = drw->minspp; }
#if TRACE_DEBUG
np = 2 * (nsegs + ns2);
-#line 4734 "dk3figah.ctr"
+#line 5080 "dk3figah.ctr"
#endif
np = dk3mem_mul_size_t(2, dk3mem_add_size_t(nsegs, ns2, &mec), &mec);
if(0 == mec) {
@@ -5322,7 +5649,7 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + ns2 - 1].s = 0.0;
-#line 4753 "dk3figah.ctr"
+#line 5099 "dk3figah.ctr"
/* Outer edges of arrowhead */
for(i = 0; i < nsegs; i++) {
j = i + 1;
@@ -5357,10 +5684,10 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + ns2 - 1 + j].y = r2 * sin(ga);
-#line 4786 "dk3figah.ctr"
+#line 5132 "dk3figah.ctr"
-#line 4787 "dk3figah.ctr"
+#line 5133 "dk3figah.ctr"
}
/* Inner edges of arrowhead */
for(i = 0; i < (ns2 - 1); i++) {
@@ -5384,10 +5711,10 @@ dk3figah_one_arc_arrowhead(
sp[2 * nsegs + ns2 - 1 + j].s = -1.0;
-#line 4809 "dk3figah.ctr"
+#line 5155 "dk3figah.ctr"
-#line 4810 "dk3figah.ctr"
+#line 5156 "dk3figah.ctr"
}
/* Inner arrowhead front point */
ga = a0 + f * (b1 - b2);
@@ -5397,7 +5724,7 @@ dk3figah_one_arc_arrowhead(
sp[2 * (nsegs + ns2) - 1].s = 0.0;
-#line 4818 "dk3figah.ctr"
+#line 5164 "dk3figah.ctr"
/* Shift all points */
for(i = 0; i < np; i++) {
dk3fig_tool_shift_spoint(
@@ -5408,7 +5735,7 @@ dk3figah_one_arc_arrowhead(
ao1->fc = obj->pc;
}
-#line 4827 "dk3figah.ctr"
+#line 5173 "dk3figah.ctr"
}
} else {
dk3fig_set_ec(drw, DK3_ERROR_MEMORY);
@@ -5426,25 +5753,25 @@ dk3figah_one_arc_arrowhead(
b2 = dk3ma_d_div_ok((0.25 * ah->he), (obj->dt).arc.ra, &mec);
if((b1 < (2.0 * M_PI)) && (b2 < (2.0 * M_PI))) {
-#line 4843 "dk3figah.ctr"
+#line 5189 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 4847 "dk3figah.ctr"
+#line 5193 "dk3figah.ctr"
ns2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b2, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 4851 "dk3figah.ctr"
+#line 5197 "dk3figah.ctr"
if(drw->minspp > nsegs) { nsegs = drw->minspp; }
if(drw->minspp > ns2) { ns2 = drw->minspp; }
#if TRACE_DEBUG
np = 2 * (nsegs + ns2);
-#line 4855 "dk3figah.ctr"
+#line 5201 "dk3figah.ctr"
#endif
np = dk3mem_mul_size_t(2, dk3mem_add_size_t(nsegs, ns2, &mec), &mec);
if(0 == mec) {
@@ -5466,7 +5793,7 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + ns2 - 1].s = 0.0;
-#line 4875 "dk3figah.ctr"
+#line 5221 "dk3figah.ctr"
/* Outer edges of arrowhead */
for(i = 0; i < nsegs; i++) {
j = i + 1;
@@ -5501,10 +5828,10 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + ns2 - 1 + j].y = r2 * sin(ga);
-#line 4908 "dk3figah.ctr"
+#line 5254 "dk3figah.ctr"
-#line 4909 "dk3figah.ctr"
+#line 5255 "dk3figah.ctr"
}
/* Inner edges of arrowhead */
for(i = 0; i < (ns2 - 1); i++) {
@@ -5528,10 +5855,10 @@ dk3figah_one_arc_arrowhead(
sp[2 * nsegs + ns2 - 1 + j].s = -1.0;
-#line 4931 "dk3figah.ctr"
+#line 5277 "dk3figah.ctr"
-#line 4932 "dk3figah.ctr"
+#line 5278 "dk3figah.ctr"
}
/* Inner arrowhead front point */
ga = a0 + f * (b1 + b2);
@@ -5541,7 +5868,7 @@ dk3figah_one_arc_arrowhead(
sp[2 * (nsegs + ns2) - 1].s = 0.0;
-#line 4940 "dk3figah.ctr"
+#line 5286 "dk3figah.ctr"
/* Shift all points */
for(i = 0; i < np; i++) {
dk3fig_tool_shift_spoint(
@@ -5552,7 +5879,7 @@ dk3figah_one_arc_arrowhead(
ao1->fc = obj->pc;
}
-#line 4949 "dk3figah.ctr"
+#line 5295 "dk3figah.ctr"
}
}
}
@@ -5594,25 +5921,25 @@ dk3figah_one_arc_arrowhead(
b2 = b1;
if((b1 < (2.0 * M_PI)) && (b2 < (2.0 * M_PI))) {
-#line 4989 "dk3figah.ctr"
+#line 5335 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 4993 "dk3figah.ctr"
+#line 5339 "dk3figah.ctr"
ns2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b2, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 4997 "dk3figah.ctr"
+#line 5343 "dk3figah.ctr"
if(drw->minspp > nsegs) { nsegs = drw->minspp; }
if(drw->minspp > ns2) { ns2 = drw->minspp; }
#if TRACE_DEBUG
np = 2 * (nsegs + ns2);
-#line 5001 "dk3figah.ctr"
+#line 5347 "dk3figah.ctr"
#endif
np = dk3mem_mul_size_t(2, dk3mem_add_size_t(nsegs, ns2, &mec), &mec);
if(0 == mec) {
@@ -5634,7 +5961,7 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + ns2 - 1].s = 0.0;
-#line 5021 "dk3figah.ctr"
+#line 5367 "dk3figah.ctr"
/* Outer edges of arrowhead */
for(i = 0; i < nsegs; i++) {
j = i + 1;
@@ -5669,10 +5996,10 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + ns2 - 1 + j].y = r2 * sin(ga);
-#line 5054 "dk3figah.ctr"
+#line 5400 "dk3figah.ctr"
-#line 5055 "dk3figah.ctr"
+#line 5401 "dk3figah.ctr"
}
/* Inner edges of arrowhead */
for(i = 0; i < (ns2 - 1); i++) {
@@ -5696,10 +6023,10 @@ dk3figah_one_arc_arrowhead(
sp[2 * nsegs + ns2 - 1 + j].s = -1.0;
-#line 5077 "dk3figah.ctr"
+#line 5423 "dk3figah.ctr"
-#line 5078 "dk3figah.ctr"
+#line 5424 "dk3figah.ctr"
}
/* Inner arrowhead front point */
ga = a0 + f * (b1 + b2);
@@ -5709,7 +6036,7 @@ dk3figah_one_arc_arrowhead(
sp[2 * (nsegs + ns2) - 1].s = 0.0;
-#line 5086 "dk3figah.ctr"
+#line 5432 "dk3figah.ctr"
/* Shift all points */
for(i = 0; i < np; i++) {
dk3fig_tool_shift_spoint(
@@ -5720,7 +6047,7 @@ dk3figah_one_arc_arrowhead(
ao1->fc = obj->pc;
}
-#line 5095 "dk3figah.ctr"
+#line 5441 "dk3figah.ctr"
}
}
}
@@ -5814,7 +6141,7 @@ dk3figah_one_arc_arrowhead(
b1 = dk3ma_d_div_ok(ah->he, (obj->dt).arc.ra, &mec);
if(b1 < (2.0 * M_PI)) {
-#line 5187 "dk3figah.ctr"
+#line 5533 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
@@ -5823,11 +6150,11 @@ dk3figah_one_arc_arrowhead(
nsegs = drw->minspp;
}
-#line 5194 "dk3figah.ctr"
+#line 5540 "dk3figah.ctr"
#if TRACE_DEBUG
np = 2 * nsegs + 2;
-#line 5196 "dk3figah.ctr"
+#line 5542 "dk3figah.ctr"
#endif
np = dk3mem_add_size_t(dk3mem_mul_size_t(2, nsegs, &mec), 2, &mec);
if(0 == mec) {
@@ -5869,10 +6196,10 @@ dk3figah_one_arc_arrowhead(
);
-#line 5236 "dk3figah.ctr"
+#line 5582 "dk3figah.ctr"
-#line 5237 "dk3figah.ctr"
+#line 5583 "dk3figah.ctr"
}
ga = a0 + f * b1;
sp[nsegs].x = dk3ma_d_add_ok(
@@ -5891,13 +6218,13 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + 1].s = 0.0;
-#line 5254 "dk3figah.ctr"
+#line 5600 "dk3figah.ctr"
-#line 5255 "dk3figah.ctr"
+#line 5601 "dk3figah.ctr"
-#line 5256 "dk3figah.ctr"
+#line 5602 "dk3figah.ctr"
}
}
}
@@ -5909,13 +6236,13 @@ dk3figah_one_arc_arrowhead(
b1 = dk3ma_d_div_ok(ah->he, (obj->dt).arc.ra, &mec);
if(b1 < (2.0 * M_PI)) {
-#line 5266 "dk3figah.ctr"
+#line 5612 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 5270 "dk3figah.ctr"
+#line 5616 "dk3figah.ctr"
if(drw->minspp > nsegs) { nsegs = drw->minspp; }
np = dk3mem_add_size_t(dk3mem_mul_size_t(2, nsegs, &mec), 1, &mec);
if(0 == mec) {
@@ -5938,7 +6265,7 @@ dk3figah_one_arc_arrowhead(
);
sp[0].s = 0.0;
-#line 5291 "dk3figah.ctr"
+#line 5637 "dk3figah.ctr"
for(i = 0; i < nsegs; i++) {
j = i + 1;
r1 = dk3ma_d_add_ok(
@@ -5963,7 +6290,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 5314 "dk3figah.ctr"
+#line 5660 "dk3figah.ctr"
sp[j].s = ((j == nsegs) ? 0.0 : (-1.0));
sp[np - 1 - i].x = dk3ma_d_add_ok(
(obj->dt).arc.xc, (r2 * cos(ga)), &mec
@@ -5972,11 +6299,11 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r2 * sin(ga)), &mec
);
-#line 5321 "dk3figah.ctr"
+#line 5667 "dk3figah.ctr"
sp[np - 1 - i].s = ((j == nsegs) ? 0.0 : (-1.0));
}
-#line 5323 "dk3figah.ctr"
+#line 5669 "dk3figah.ctr"
}
}
}
@@ -5999,19 +6326,19 @@ dk3figah_one_arc_arrowhead(
if((b1 < (2.0 * M_PI)) && (b2 < (2.0 * M_PI)) && (b3 < (2.0 * M_PI))) {
-#line 5344 "dk3figah.ctr"
+#line 5690 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 5348 "dk3figah.ctr"
+#line 5694 "dk3figah.ctr"
ns2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b2, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 5352 "dk3figah.ctr"
+#line 5698 "dk3figah.ctr"
ns3 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b3, drw->arcspp, &mec) / M_PI_2),
&mec
@@ -6038,7 +6365,7 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + ns2 - 1].s = 0.0;
-#line 5377 "dk3figah.ctr"
+#line 5723 "dk3figah.ctr"
/* Outer edges of arrowhead */
for(i = 0; i < nsegs; i++) {
j = i + 1;
@@ -6073,10 +6400,10 @@ dk3figah_one_arc_arrowhead(
sp[nsegs + ns2 - 1 + j].y = r2 * sin(ga);
-#line 5410 "dk3figah.ctr"
+#line 5756 "dk3figah.ctr"
-#line 5411 "dk3figah.ctr"
+#line 5757 "dk3figah.ctr"
}
/* Inner edges of arrowhead */
for(i = 0; i < (ns2 - 1); i++) {
@@ -6100,10 +6427,10 @@ dk3figah_one_arc_arrowhead(
sp[2 * nsegs + ns2 - 1 + j].s = -1.0;
-#line 5433 "dk3figah.ctr"
+#line 5779 "dk3figah.ctr"
-#line 5434 "dk3figah.ctr"
+#line 5780 "dk3figah.ctr"
}
/* Inner arrowhead front point */
ga = a0 + f * (b1 - b2);
@@ -6113,7 +6440,7 @@ dk3figah_one_arc_arrowhead(
sp[2 * (nsegs + ns2) - 1].s = 0.0;
-#line 5442 "dk3figah.ctr"
+#line 5788 "dk3figah.ctr"
/* Shift all points */
for(i = 0; i < np; i++) {
dk3fig_tool_shift_spoint(
@@ -6121,7 +6448,7 @@ dk3figah_one_arc_arrowhead(
);
}
-#line 5448 "dk3figah.ctr"
+#line 5794 "dk3figah.ctr"
np = dk3mem_add_size_t(nsegs, dk3mem_add_size_t(ns2, ns3, &mec), &mec);
if(0 == mec) {
ao2 = dk3fig_obj_new(
@@ -6132,7 +6459,7 @@ dk3figah_one_arc_arrowhead(
);
if(ao2) {
-#line 5457 "dk3figah.ctr"
+#line 5803 "dk3figah.ctr"
ah->o2 = (void *)ao2;
sp = (ao2->dt).spl.po;
if(sp) {
@@ -6145,7 +6472,7 @@ dk3figah_one_arc_arrowhead(
);
sp[0].s = 0.0;
-#line 5468 "dk3figah.ctr"
+#line 5814 "dk3figah.ctr"
/* Outer edge */
for(i = 0; i < nsegs; i++) {
j = i + 1;
@@ -6183,7 +6510,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 5504 "dk3figah.ctr"
+#line 5850 "dk3figah.ctr"
sp[j].s = ((j == nsegs) ? 0.0 : (-1.0));
}
/* Indention edge */
@@ -6215,7 +6542,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 5534 "dk3figah.ctr"
+#line 5880 "dk3figah.ctr"
sp[nsegs + j].s = ((j == ns2) ? 0.0 : (-1.0));
}
/* Inner edge */
@@ -6229,11 +6556,11 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, ((obj->dt).arc.ra * sin(ga)), &mec
);
-#line 5546 "dk3figah.ctr"
+#line 5892 "dk3figah.ctr"
sp[nsegs + ns2 + j].s = -1.0;
}
-#line 5548 "dk3figah.ctr"
+#line 5894 "dk3figah.ctr"
}
}
}
@@ -6248,7 +6575,7 @@ dk3figah_one_arc_arrowhead(
b1 = dk3ma_d_div_ok(ah->he, (obj->dt).arc.ra, &mec);
if(b1 < (2.0 * M_PI)) {
-#line 5561 "dk3figah.ctr"
+#line 5907 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
@@ -6315,7 +6642,7 @@ dk3figah_one_arc_arrowhead(
sp[np - 1 - i].s = ((j == nsegs) ? 0.0 : (-1.0));
}
-#line 5626 "dk3figah.ctr"
+#line 5972 "dk3figah.ctr"
}
}
}
@@ -6332,19 +6659,19 @@ dk3figah_one_arc_arrowhead(
if((b1 < (2.0 * M_PI)) && (b2 < (2.0 * M_PI)) && (b3 < (2.0 * M_PI))) {
-#line 5641 "dk3figah.ctr"
+#line 5987 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 5645 "dk3figah.ctr"
+#line 5991 "dk3figah.ctr"
ns2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b2, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 5649 "dk3figah.ctr"
+#line 5995 "dk3figah.ctr"
ns3 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b3, drw->arcspp, &mec) / M_PI_2),
&mec
@@ -6365,7 +6692,7 @@ dk3figah_one_arc_arrowhead(
sp = (ao1->dt).spl.po;
if(sp) {
-#line 5668 "dk3figah.ctr"
+#line 6014 "dk3figah.ctr"
back = 1;
/* front point */
sp[0].x = dk3ma_d_add_ok(
@@ -6375,7 +6702,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, ((obj->dt).arc.ra * sin(a0)), &mec
);
-#line 5676 "dk3figah.ctr"
+#line 6022 "dk3figah.ctr"
sp[0].s = 0.0;
/* outer edge */
for(i = 0; i < nsegs; i++) {
@@ -6409,7 +6736,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 5708 "dk3figah.ctr"
+#line 6054 "dk3figah.ctr"
sp[j].s = ((j == nsegs) ? 0.0 : (-1.0));
}
/* indention edge */
@@ -6440,7 +6767,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 5737 "dk3figah.ctr"
+#line 6083 "dk3figah.ctr"
sp[nsegs + j].s = ((j == ns2) ? 0.0 : (-1.0));
}
/* inner edge */
@@ -6454,11 +6781,11 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, ((obj->dt).arc.ra * sin(ga)), &mec
);
-#line 5749 "dk3figah.ctr"
+#line 6095 "dk3figah.ctr"
sp[nsegs + ns2 + j].s = -1.0;
}
-#line 5751 "dk3figah.ctr"
+#line 6097 "dk3figah.ctr"
}
}
}
@@ -6475,19 +6802,19 @@ dk3figah_one_arc_arrowhead(
if((b1 < (2.0 * M_PI)) && (b2 < (2.0 * M_PI)) && (b3 < (2.0 * M_PI))) {
-#line 5766 "dk3figah.ctr"
+#line 6112 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 5770 "dk3figah.ctr"
+#line 6116 "dk3figah.ctr"
ns2 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b2, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 5774 "dk3figah.ctr"
+#line 6120 "dk3figah.ctr"
ns3 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b3, drw->arcspp, &mec) / M_PI_2),
&mec
@@ -6508,7 +6835,7 @@ dk3figah_one_arc_arrowhead(
sp = (ao1->dt).spl.po;
if(sp) {
-#line 5793 "dk3figah.ctr"
+#line 6139 "dk3figah.ctr"
back = 1;
/* front point */
sp[0].x = dk3ma_d_add_ok(
@@ -6518,7 +6845,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, ((obj->dt).arc.ra * sin(a0)), &mec
);
-#line 5801 "dk3figah.ctr"
+#line 6147 "dk3figah.ctr"
sp[0].s = 0.0;
/* outer edge */
for(i = 0; i < nsegs; i++) {
@@ -6552,7 +6879,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 5833 "dk3figah.ctr"
+#line 6179 "dk3figah.ctr"
sp[j].s = ((j == nsegs) ? 0.0 : (-1.0));
}
/* indention edge */
@@ -6583,7 +6910,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 5862 "dk3figah.ctr"
+#line 6208 "dk3figah.ctr"
sp[nsegs + j].s = ((j == ns2) ? 0.0 : (-1.0));
}
/* inner edge */
@@ -6597,11 +6924,11 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, ((obj->dt).arc.ra * sin(ga)), &mec
);
-#line 5874 "dk3figah.ctr"
+#line 6220 "dk3figah.ctr"
sp[nsegs + ns2 + j].s = -1.0;
}
-#line 5876 "dk3figah.ctr"
+#line 6222 "dk3figah.ctr"
}
}
}
@@ -6612,7 +6939,7 @@ dk3figah_one_arc_arrowhead(
case DK3_FIG_AS_TRIANGLE_FORK: {
if(ah->af) {
-#line 5885 "dk3figah.ctr"
+#line 6231 "dk3figah.ctr"
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_POLYLINE, 1,
obj->lw, obj->pc, obj->pc, -1,
@@ -6621,12 +6948,12 @@ dk3figah_one_arc_arrowhead(
);
if(ao1) {
-#line 5892 "dk3figah.ctr"
+#line 6238 "dk3figah.ctr"
ah->o1 = (void *)ao1;
po = (ao1->dt).pol.po;
if(po) {
-#line 5895 "dk3figah.ctr"
+#line 6241 "dk3figah.ctr"
back = 1;
r1 = dk3ma_d_add_ok((obj->dt).arc.ra, (0.5 * ah->wi), &mec);
r2 = dk3ma_d_sub_ok((obj->dt).arc.ra, (0.5 * ah->wi), &mec);
@@ -6636,17 +6963,17 @@ dk3figah_one_arc_arrowhead(
po[1].y = dk3ma_d_add_ok((obj->dt).arc.yc, (r2 * sin(a0)), &mec);
-#line 5903 "dk3figah.ctr"
+#line 6249 "dk3figah.ctr"
-#line 5904 "dk3figah.ctr"
+#line 6250 "dk3figah.ctr"
}
}
} else {
b1 = dk3ma_d_div_ok(ah->he, (obj->dt).arc.ra, &mec);
if(b1 < (2.0 * M_PI)) {
-#line 5909 "dk3figah.ctr"
+#line 6255 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
@@ -6722,18 +7049,18 @@ dk3figah_one_arc_arrowhead(
b1 = dk3ma_d_div_ok(ah->he, (obj->dt).arc.ra, &mec);
if(b1 < (2.0 * M_PI)) {
-#line 5983 "dk3figah.ctr"
+#line 6329 "dk3figah.ctr"
nsegs = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(b1, drw->arcspp, &mec) / M_PI_2),
&mec
);
-#line 5987 "dk3figah.ctr"
+#line 6333 "dk3figah.ctr"
if(drw->minspp > nsegs) { nsegs = drw->minspp; }
np = dk3mem_mul_size_t(2, dk3mem_add_size_t(nsegs, 1, &mec), &mec);
if(0 == mec) {
-#line 5990 "dk3figah.ctr"
+#line 6336 "dk3figah.ctr"
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_SPLINE, 4,
obj->lw, obj->pc, obj->pc, -1,
@@ -6749,11 +7076,11 @@ dk3figah_one_arc_arrowhead(
r2 = dk3ma_d_sub_ok((obj->dt).arc.ra, (0.5 * ah->wi), &mec);
if(ah->af) {
-#line 6004 "dk3figah.ctr"
+#line 6350 "dk3figah.ctr"
ga = a0;
} else {
-#line 6006 "dk3figah.ctr"
+#line 6352 "dk3figah.ctr"
ga = a0 + f * b1;
}
sp[nsegs].x = dk3ma_d_add_ok(
@@ -6763,7 +7090,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 6014 "dk3figah.ctr"
+#line 6360 "dk3figah.ctr"
sp[nsegs].s = 0.0;
sp[nsegs + 1].x = dk3ma_d_add_ok(
(obj->dt).arc.xc, (r2 * cos(ga)), &mec
@@ -6772,7 +7099,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r2 * sin(ga)), &mec
);
-#line 6021 "dk3figah.ctr"
+#line 6367 "dk3figah.ctr"
sp[nsegs + 1].s = 0.0;
for(i = 0; i < nsegs; i++) {
j = i + 1;
@@ -6788,7 +7115,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r1 * sin(ga)), &mec
);
-#line 6035 "dk3figah.ctr"
+#line 6381 "dk3figah.ctr"
sp[nsegs - j].s = 0.0;
sp[nsegs + 1 + j].x = dk3ma_d_add_ok(
(obj->dt).arc.xc, (r2 * cos(ga)), &mec
@@ -6797,7 +7124,7 @@ dk3figah_one_arc_arrowhead(
(obj->dt).arc.yc, (r2 * sin(ga)), &mec
);
-#line 6042 "dk3figah.ctr"
+#line 6388 "dk3figah.ctr"
sp[nsegs + 1 + j].s = 0.0;
}
}
@@ -6812,13 +7139,13 @@ dk3figah_one_arc_arrowhead(
}
if(mec) {
-#line 6055 "dk3figah.ctr"
+#line 6401 "dk3figah.ctr"
back = 0;
if(ec) { *ec = mec; }
}
-#line 6059 "dk3figah.ctr"
+#line 6405 "dk3figah.ctr"
return back;
}
@@ -6827,15 +7154,13 @@ dk3figah_one_arc_arrowhead(
/** Calculate arrowheads for arc.
@param drw Drawing to modify.
@param obj Object to modify.
- @param objno Object number.
@return 1 on success, 0 on error.
*/
static
int
dk3figah_calculate_arc(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
)
{
dk3_fig_poly_point_t sp;
@@ -6852,7 +7177,7 @@ dk3figah_calculate_arc(
int res = 0;
-#line 6091 "dk3figah.ctr"
+#line 6435 "dk3figah.ctr"
/*
Construct arrowhead objects.
*/
@@ -6863,7 +7188,7 @@ dk3figah_calculate_arc(
cuts = dk3figah_length_correction(drw, obj, obj->ab, &mec);
}
-#line 6100 "dk3figah.ctr"
+#line 6444 "dk3figah.ctr"
/*
Create arrowhead objects.
*/
@@ -6895,7 +7220,7 @@ dk3figah_calculate_arc(
&mec
);
-#line 6130 "dk3figah.ctr"
+#line 6474 "dk3figah.ctr"
res = dk3figah_straight_arrowhead(
drw, obj, obj->af, &sp, alphaf, &mec
);
@@ -6913,7 +7238,7 @@ dk3figah_calculate_arc(
&mec
);
-#line 6146 "dk3figah.ctr"
+#line 6490 "dk3figah.ctr"
res = dk3figah_straight_arrowhead(
drw, obj, obj->ab, &sp, alphab, &mec
);
@@ -6940,17 +7265,17 @@ dk3figah_calculate_arc(
newae = (obj->dt).arc.ae;
if(0.0 < cuts) {
-#line 6171 "dk3figah.ctr"
+#line 6515 "dk3figah.ctr"
if(dk3figah_must_use_arc_correction(obj->ab)) {
das = dk3figah_arc_correction((obj->dt).arc.ra, cuts, &mec);
if(0.0 <= das) {
if((obj->dt).arc.di) {
-#line 6175 "dk3figah.ctr"
+#line 6519 "dk3figah.ctr"
newas = dk3ma_d_add_ok(newas, das, &mec);
} else {
-#line 6177 "dk3figah.ctr"
+#line 6521 "dk3figah.ctr"
newas = dk3ma_d_sub_ok(newas, das, &mec);
}
} else {
@@ -6960,31 +7285,31 @@ dk3figah_calculate_arc(
das = dk3ma_d_div_ok(cuts, (obj->dt).arc.ra, &mec);
-#line 6185 "dk3figah.ctr"
+#line 6529 "dk3figah.ctr"
if((obj->dt).arc.di) {
-#line 6186 "dk3figah.ctr"
+#line 6530 "dk3figah.ctr"
newas = dk3ma_d_add_ok(newas, das, &mec);
} else {
-#line 6188 "dk3figah.ctr"
+#line 6532 "dk3figah.ctr"
newas = dk3ma_d_sub_ok(newas, das, &mec);
}
}
}
if(0.0 < cute) {
-#line 6193 "dk3figah.ctr"
+#line 6537 "dk3figah.ctr"
if(dk3figah_must_use_arc_correction(obj->af)) {
dae = dk3figah_arc_correction((obj->dt).arc.ra, cute, &mec);
if(0.0 <= dae) {
if((obj->dt).arc.di) {
-#line 6197 "dk3figah.ctr"
+#line 6541 "dk3figah.ctr"
newae = dk3ma_d_sub_ok(newae, dae, &mec);
} else {
-#line 6199 "dk3figah.ctr"
+#line 6543 "dk3figah.ctr"
newae = dk3ma_d_add_ok(newae, dae, &mec);
}
} else {
@@ -6994,14 +7319,14 @@ dk3figah_calculate_arc(
dae = dk3ma_d_div_ok(cute, (obj->dt).arc.ra, &mec);
-#line 6207 "dk3figah.ctr"
+#line 6551 "dk3figah.ctr"
if((obj->dt).arc.di) {
-#line 6208 "dk3figah.ctr"
+#line 6552 "dk3figah.ctr"
newae = dk3ma_d_sub_ok(newae, dae, &mec);
} else {
-#line 6210 "dk3figah.ctr"
+#line 6554 "dk3figah.ctr"
newae = dk3ma_d_add_ok(newae, dae, &mec);
}
}
@@ -7009,28 +7334,28 @@ dk3figah_calculate_arc(
if(0 == mec) {
-#line 6216 "dk3figah.ctr"
+#line 6560 "dk3figah.ctr"
-#line 6217 "dk3figah.ctr"
+#line 6561 "dk3figah.ctr"
-#line 6218 "dk3figah.ctr"
+#line 6562 "dk3figah.ctr"
-#line 6219 "dk3figah.ctr"
+#line 6563 "dk3figah.ctr"
-#line 6220 "dk3figah.ctr"
+#line 6564 "dk3figah.ctr"
-#line 6221 "dk3figah.ctr"
+#line 6565 "dk3figah.ctr"
-#line 6222 "dk3figah.ctr"
+#line 6566 "dk3figah.ctr"
-#line 6223 "dk3figah.ctr"
+#line 6567 "dk3figah.ctr"
(obj->dt).arc.as = newas; (obj->dt).arc.ae = newae;
} else {
/* ##### ERROR: Math error */
@@ -7044,7 +7369,7 @@ dk3figah_calculate_arc(
}
-#line 6235 "dk3figah.ctr"
+#line 6579 "dk3figah.ctr"
return back;
}
@@ -7053,15 +7378,14 @@ dk3figah_calculate_arc(
int
dk3figah_calculate_arrowheads(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
)
{
int back = 0;
int failed = 0;
-#line 6250 "dk3figah.ctr"
+#line 6593 "dk3figah.ctr"
if((drw) && (obj)) {
back = 1;
if(dk3figah_candidate(obj)) {
@@ -7071,15 +7395,15 @@ dk3figah_calculate_arrowheads(
if((obj->af) && (obj->ab)) { obj->cs = DK3_FIG_LC_BUTT; }
switch(obj->ot) {
case DK3_FIG_OBJ_POLYLINE: {
- back = dk3figah_calculate_polyline(drw, obj, objno);
+ back = dk3figah_calculate_polyline(drw, obj);
if(!(back)) { failed = 1; }
} break;
case DK3_FIG_OBJ_SPLINE: {
- back = dk3figah_calculate_spline(drw, obj, objno);
+ back = dk3figah_calculate_spline(drw, obj);
if(!(back)) { failed = 1; }
} break;
case DK3_FIG_OBJ_ARC: {
- back = dk3figah_calculate_arc(drw, obj, objno);
+ back = dk3figah_calculate_arc(drw, obj);
if(!(back)) { failed = 1; }
} break;
}
@@ -7092,7 +7416,7 @@ dk3figah_calculate_arrowheads(
dk3app_log_1(drw->app, DK3_LL_ERROR, drw->msg, 5);
}
-#line 6279 "dk3figah.ctr"
+#line 6622 "dk3figah.ctr"
return back;
}
diff --git a/support/dktools/dk3figah.ctr b/support/dktools/dk3figah.ctr
index 609941aa98..4571924347 100644
--- a/support/dktools/dk3figah.ctr
+++ b/support/dktools/dk3figah.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -28,8 +28,7 @@ dk3figah_candidate(dk3_fig_obj_t *obj);
int
dk3figah_calculate_arrowheads(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
);
#ifdef __cplusplus
@@ -304,7 +303,6 @@ dk3figah_normal_arrow_length_correction_tolerance(
/** Calculate length correction for blocking line arrowhead.
@param drw Drawing structure.
@param obj Object to modify.
- @param ah Arrowhead to calculate length correction for.
@param ec Pointer to error code variable, may be NULL.
@return Length correction value.
*/
@@ -313,7 +311,6 @@ double
dk3figah_block_line_length_correction(
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- dk3_fig_ah_t *ah,
int *ec
)
{
@@ -336,7 +333,6 @@ dk3figah_block_line_length_correction(
/** Calculate length correction tolerance for blocking line arrowhead.
@param drw Drawing structure.
@param obj Object to modify.
- @param ah Arrowhead to calculate length correction for.
@param ec Pointer to error code variable, may be NULL.
@return Length correction value.
*/
@@ -345,7 +341,6 @@ double
dk3figah_block_line_length_correction_tolerance(
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- dk3_fig_ah_t *ah,
int *ec
)
{
@@ -997,11 +992,11 @@ dk3figah_length_correction(
case DK3_FIG_AS_RECTANGLE: /* 7 */
case DK3_FIG_AS_INVERSE: /* 8 */
{
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
} break;
case DK3_FIG_AS_HALF_CIRCLE_END: { /* 6 */
if(1 == ah->af) {
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
} else {
back = dk3figah_half_circle_length_correction(drw, obj, ah, ec);
}
@@ -1017,17 +1012,17 @@ dk3figah_length_correction(
} break;
case DK3_FIG_AS_TRIANGLE_FORK: { /* 13 */
if(1 == ah->af) {
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
} else {
back = dk3figah_anti_arrow_length_correction(drw, obj, ah, ec);
}
} break;
case DK3_FIG_AS_RECTANGLE_FORK: { /* 14 */
if(1 == ah->af) {
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
} else {
#if 0
- back = dk3figah_block_line_length_correction(drw, obj, ah, ec);
+ back = dk3figah_block_line_length_correction(drw, obj, ec);
#endif
back = dk3ma_d_add_ok(back, ah->he, ec); $? ". open block"
}
@@ -1073,10 +1068,10 @@ dk3figah_length_correction_tolerance(
case DK3_FIG_AS_RECTANGLE: /* 7 */
case DK3_FIG_AS_INVERSE: /* 8 */
{
- back = dk3figah_block_line_length_correction_tolerance(drw,obj,ah,ec);
+ back = dk3figah_block_line_length_correction_tolerance(drw,obj,ec);
} break;
case DK3_FIG_AS_HALF_CIRCLE_END: { /* 6 */
- back = dk3figah_block_line_length_correction_tolerance(drw,obj,ah,ec);
+ back = dk3figah_block_line_length_correction_tolerance(drw,obj,ec);
} break;
case DK3_FIG_AS_CLOSED_HALF: { /* 10 */
back = dk3figah_half_arrow_length_correction_tolerance(drw,obj,ah,ec,0);
@@ -1089,13 +1084,13 @@ dk3figah_length_correction_tolerance(
} break;
case DK3_FIG_AS_TRIANGLE_FORK: { /* 13 */
if(1 == ah->af) {
- back = dk3figah_block_line_length_correction_tolerance(drw,obj,ah,ec);
+ back = dk3figah_block_line_length_correction_tolerance(drw,obj,ec);
} else {
back = dk3figah_anti_arrow_length_correction_tolerance(drw,obj,ah,ec);
}
} break;
case DK3_FIG_AS_RECTANGLE_FORK: { /* 14 */
- back = dk3figah_block_line_length_correction_tolerance(drw,obj,ah,ec);
+ back = dk3figah_block_line_length_correction_tolerance(drw,obj,ec);
} break;
default: {
back = dk3figah_normal_arrow_length_correction_tolerance(drw,obj,ah,ec);
@@ -2223,15 +2218,13 @@ dk3figah_straight_arrowhead(
/** Calculate arrowheads for polyline.
@param drw Drawing to modify.
@param obj Object to modify.
- @param objno Object number.
@return 1 on success, 0 on error.
*/
static
int
dk3figah_calculate_polyline(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
)
{
dk3_fig_poly_point_t *po; /* Points of the polyline. */
@@ -2317,7 +2310,6 @@ dk3figah_calculate_polyline(
/** Calculate values for a given t.
@param drw Drawing object.
@param obj Fig object.
- @param ah Arrowhead to modify.
@param xpos Pointer to x position variable.
@param ypos Pointer to y position variable.
@param phi Pointer to direction variable.
@@ -2331,7 +2323,6 @@ int
dk3figah_spline_values(
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- dk3_fig_ah_t *ah,
double *xpos,
double *ypos,
double *phi,
@@ -2453,14 +2444,27 @@ dk3figah_one_spline_arrowhead(
switch(ah->as) {
case DK3_FIG_AS_STICK:
case DK3_FIG_AS_CLOSED: { $? ". closed or stick"
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t0) {
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t1) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
@@ -2497,15 +2501,22 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * ah->he), &mec
); $? ". dist = %lg", dist
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- ); $? ". t = %lg", t
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ ); $? ". t = %lg", t
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ ); $? ". t = %lg", t
+ }
$? ". dist = %lg", dk3xsp_open_spline_partial_length(osp, onp, drw->xsprec, t, (obj->dt).spl.fslc, ab, drw->cosp, &mec)
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
); $? ". xpos = %lg ypos = %lg phi = %lg",xpos,ypos,phi
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2549,17 +2560,31 @@ dk3figah_one_spline_arrowhead(
case DK3_FIG_AS_INDENTED: { $? ". indented"
l1 = dk3ma_d_mul_ok(1.25, ah->he, &mec);
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
@@ -2597,14 +2622,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * l1), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2643,13 +2675,20 @@ dk3figah_one_spline_arrowhead(
(l2 * ((double)j / (double)n2)),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2677,7 +2716,7 @@ dk3figah_one_spline_arrowhead(
}
}
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t2, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t2, &mec
);
if(res) {
sp[np - 1].x = xpos;
@@ -2706,17 +2745,31 @@ dk3figah_one_spline_arrowhead(
case DK3_FIG_AS_POINTED: { $? ". butted"
l1 = 0.75 * ah->he;
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
@@ -2754,14 +2807,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * l1), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2800,13 +2860,20 @@ dk3figah_one_spline_arrowhead(
(l2 * ((double)j / (double)n2)),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2834,7 +2901,7 @@ dk3figah_one_spline_arrowhead(
}
}
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t2, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t2, &mec
);
if(res) {
sp[np - 1].x = xpos;
@@ -2886,17 +2953,31 @@ dk3figah_one_spline_arrowhead(
} else { $? ". rhombus"
l1 = 0.5 * ah->he;
l2 = l1;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
@@ -2934,14 +3015,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * l1), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -2980,13 +3068,20 @@ dk3figah_one_spline_arrowhead(
(l2 * ((double)j / (double)n2)),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3014,7 +3109,7 @@ dk3figah_one_spline_arrowhead(
}
}
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t2, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t2, &mec
);
if(res) {
sp[np - 1].x = xpos;
@@ -3043,7 +3138,7 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_FULL_CIRCLE_END: { $? ". full circle"
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) {
#if VERSION_BEFORE_20121220
@@ -3093,7 +3188,7 @@ dk3figah_one_spline_arrowhead(
case DK3_FIG_AS_HALF_CIRCLE_END: { $? ". half-circle"
if(ah->af) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) {
xpos = dk3ma_d_sub_ok(xpos, (0.5 * lw * cos(phi)), &mec);
@@ -3118,10 +3213,17 @@ dk3figah_one_spline_arrowhead(
}
}
} else {
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, (0.5 * ah->he),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, (0.5 * ah->he),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, (0.5 * ah->he),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t1) {
dist = fabs(dk3ma_d_sub_ok(t1, t0, &mec)); $? ". n1"
n1 = dk3ma_d_to_sz_ok(
@@ -3160,14 +3262,22 @@ dk3figah_one_spline_arrowhead(
sp[n1].s = -1.0; $? ". point %u", (unsigned)n1
for(i = 0; i < n1; i++) {
j = i + 1;
- t1 = dk3xsp_get_t_for_distance(
- osp, onp,
- (0.5 * ah->he * cos(M_PI_2 * ((double)j / (double)n1))),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp,
+ (0.5 * ah->he * cos(M_PI_2 * ((double)j / (double)n1))),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp,
+ (0.5 * ah->he * cos(M_PI_2 * ((double)j / (double)n1))),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t1) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t1, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t1, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -3208,13 +3318,23 @@ dk3figah_one_spline_arrowhead(
}
} break;
case DK3_FIG_AS_RECTANGLE: { $? ". rectangle"
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
@@ -3234,7 +3354,7 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) { $? ". points %u", (unsigned)np
pp[0].x = pp[1].x = 0;
@@ -3257,14 +3377,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (ah->he * ((double)j / (double)n1)), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3303,13 +3430,23 @@ dk3figah_one_spline_arrowhead(
}
} break;
case DK3_FIG_AS_INVERSE: { $? ". inverse"
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
@@ -3329,7 +3466,7 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t1, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t1, &mec
);
if(res) { $? ". points %u", (unsigned)np
sp[n1].x = xpos;
@@ -3343,14 +3480,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, ((1.0 - ((double)j / (double)n1)) * ah->he), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3384,17 +3528,31 @@ dk3figah_one_spline_arrowhead(
case DK3_FIG_AS_INDENTED_FILLED_HALF: { $? ". indented, half-filled"
l1 = dk3ma_d_mul_ok(1.25, ah->he, &mec);
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
@@ -3449,14 +3607,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * l1), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3507,13 +3672,20 @@ dk3figah_one_spline_arrowhead(
(l2 * ((double)j / (double)n2)),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3551,7 +3723,7 @@ dk3figah_one_spline_arrowhead(
}
}
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t2, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t2, &mec
);
if(res) {
sp[np - 1].x = xpos;
@@ -3571,13 +3743,20 @@ dk3figah_one_spline_arrowhead(
((1.0 - ((double)j / (double)n3)) * ah->he),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
sp2[n1 + n2 + j].x = xpos;
@@ -3611,14 +3790,27 @@ dk3figah_one_spline_arrowhead(
}
} break;
case DK3_FIG_AS_CLOSED_HALF: { $? ". closed half-arrow"
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t0) {
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t1) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
@@ -3653,15 +3845,22 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * ah->he), &mec
); $? ". dist = %lg", dist
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- ); $? ". t = %lg", t
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } $? ". t = %lg", t
$? ". dist = %lg", dk3xsp_open_spline_partial_length(osp, onp, drw->xsprec, t, (obj->dt).spl.fslc, ab, drw->cosp, &mec)
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
); $? ". xpos = %lg ypos = %lg phi = %lg",xpos,ypos,phi
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -3705,17 +3904,31 @@ dk3figah_one_spline_arrowhead(
case DK3_FIG_AS_INDENTED_HALF: { $? ". indented half-arrow"
l1 = dk3ma_d_mul_ok(1.25, ah->he, &mec);
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
@@ -3749,14 +3962,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (l1 * ((double)i / (double)(n1))), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -3790,14 +4010,21 @@ dk3figah_one_spline_arrowhead(
),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -3823,14 +4050,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (ah->he * (1.0 - ((double)i / (double)n3))), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
sp[n1 + n2 + i].x = xpos;
@@ -3855,17 +4089,31 @@ dk3figah_one_spline_arrowhead(
case DK3_FIG_AS_BUTTED_HALF: { $? ". butted half-arrow"
l1 = 0.75 * ah->he;
l2 = 0.25 * ah->he;
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, l1, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t2 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, l1, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t2 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1) && (0.0 <= t2)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
@@ -3899,14 +4147,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (l1 * ((double)i / (double)(n1))), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -3940,14 +4195,21 @@ dk3figah_one_spline_arrowhead(
),
&mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = 0.0;
@@ -3973,14 +4235,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (ah->he * (1.0 - ((double)i / (double)n3))), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
sp[n1 + n2 + i].x = xpos;
@@ -4004,9 +4273,15 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_TRIANGLE_FORK: { $? ". triangle fork"
if(ah->af) {
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if(0.0 <= t0) {
ao1 = dk3fig_obj_new(
obj->li, obj->la, DK3_FIG_OBJ_POLYLINE, 1,
@@ -4023,7 +4298,7 @@ dk3figah_one_spline_arrowhead(
pp[0].y = 0.5 * ah->wi;
pp[1].y = -0.5 * ah->wi;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) {
dk3fig_tool_rotate_point(&pp[0], phi, &mec);
@@ -4041,13 +4316,23 @@ dk3figah_one_spline_arrowhead(
}
}
} else {
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, dk3ma_d_add_ok(s, ah->he, &mec),
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(fabs(t1 - t0), drw->splspp, &mec)), &mec
@@ -4067,7 +4352,7 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t1, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t1, &mec
);
if(res) { $? ". points %u", (unsigned)np
sp[n1].x = xpos;
@@ -4081,14 +4366,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, ((1.0 - ((double)j / (double)n1)) * ah->he), &mec
);
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
);
if(res) {
pp[0].x = pp[1].x = 0.0;
@@ -4123,13 +4415,23 @@ dk3figah_one_spline_arrowhead(
} break;
case DK3_FIG_AS_RECTANGLE_FORK: { $? ". rectangle fork"
if(ah->af) {
- t0 = dk3xsp_get_t_for_distance(
- osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
- l1 = dk3ma_d_add_ok(s, ah->he, &mec);
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, l1, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- );
+ if (0 != drw->ahbs) {
+ t0 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ l1 = dk3ma_d_add_ok(s, ah->he, &mec);
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, l1, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t0 = dk3xsp_get_t_for_distance(
+ osp, onp, s, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ l1 = dk3ma_d_add_ok(s, ah->he, &mec);
+ t1 = dk3xsp_get_t_for_distance(
+ osp, onp, l1, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ }
if((0.0 <= t0) && (0.0 <= t1)) { $? ". n1"
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
@@ -4149,7 +4451,7 @@ dk3figah_one_spline_arrowhead(
if(sp) {
back = 1;
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t0, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t0, &mec
);
if(res) { $? ". points = %u", (unsigned)np
pp[0].x = 0.0; pp[1].x = 0.0;
@@ -4174,14 +4476,21 @@ dk3figah_one_spline_arrowhead(
dist = dk3ma_d_add_ok(
s, (((double)j / (double)n1) * ah->he), &mec
); $? ". mec = %d", mec
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- ); $? ". mec = %d", mec
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } $? ". mec = %d", mec
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
); $? ". mec = %d", mec
if(res) {
pp[0].x = 0.0; pp[1].x = 0.0;
@@ -4221,9 +4530,15 @@ dk3figah_one_spline_arrowhead(
}
} else { $? ". not filled"
t0 = ((ab) ? 0.0 : ((obj->dt).spl.np - 1));
- t1 = dk3xsp_get_t_for_distance(
- osp, onp, ah->he, drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- ); $? ". mec = %d", mec
+ if (0 != drw->ahbs) {
+ t1 = dk3xsp_get_t_for_distance_bisection(
+ osp,onp,ah->he,drw->xsprec,(obj->dt).spl.fslc,ab,drw->cosp,&mec
+ );
+ } else {
+ t1 = dk3xsp_get_t_for_distance(
+ osp,onp,ah->he,drw->xsprec,(obj->dt).spl.fslc,ab,drw->cosp,&mec
+ );
+ } $? ". mec = %d", mec
if((0.0 <= t0) && (0.0 <= t1)) { $? ". t0=%lg t1=%lg", t0, t1
n1 = dk3ma_d_to_sz_ok(
ceil(dk3ma_d_mul_ok(drw->splspp, fabs(t1 - t0), &mec)), &mec
@@ -4243,7 +4558,7 @@ dk3figah_one_spline_arrowhead(
if(sp) { $? ". sp"
back = 1; $? ". points %u", (unsigned)np
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t1, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t1, &mec
); $? ". mec = %d", mec
if(res) { $? ". res"
pp[0].x = 0.0; pp[1].x = 0.0;
@@ -4270,14 +4585,21 @@ dk3figah_one_spline_arrowhead(
t = t0;
} else {
dist = (1.0 - ((double)j / (double)n1)) * ah->he;
- t = dk3xsp_get_t_for_distance(
- osp, onp, dist,
- drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
- ); $? ". mec = %d", mec
+ if (0 != drw->ahbs) {
+ t = dk3xsp_get_t_for_distance_bisection(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } else {
+ t = dk3xsp_get_t_for_distance(
+ osp, onp, dist,
+ drw->xsprec, (obj->dt).spl.fslc, ab, drw->cosp, &mec
+ );
+ } $? ". mec = %d", mec
}
if(0.0 <= t) {
res = dk3figah_spline_values(
- drw, obj, ah, &xpos, &ypos, &phi, ab, t, &mec
+ drw, obj, &xpos, &ypos, &phi, ab, t, &mec
); $? ". mec = %d", mec
if(res) {
pp[0].x = 0.0; pp[1].x = 0.0;
@@ -4336,15 +4658,13 @@ dk3figah_one_spline_arrowhead(
/** Calculate arrowheads for spline.
@param drw Drawing to modify.
@param obj Object to modify.
- @param objno Object number.
@return 1 on success, 0 on error.
*/
static
int
dk3figah_calculate_spline(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
)
{
dk3_xspline_segment_t seg;
@@ -4453,32 +4773,58 @@ dk3figah_calculate_spline(
#endif
if(!(drw->coah)) { $? ". fig2lat arrowheads"
if((0.0 < cuts) && (NULL != obj->ab)) { $? ". cut at start"
- (obj->dt).spl.ts = dk3xsp_get_t_for_distance(
- (obj->dt).spl.po,
- (obj->dt).spl.np,
- cuts,
- dk3figah_length_correction_tolerance(drw, obj, obj->ab, &mec),
- (obj->dt).spl.fslc,
- 1,
- drw->cosp,
- &mec
- ); $? ". mec = %d", mec
+ if (0 != drw->ahbs) {
+ (obj->dt).spl.ts = dk3xsp_get_t_for_distance_bisection(
+ (obj->dt).spl.po,
+ (obj->dt).spl.np,
+ cuts,
+ dk3figah_length_correction_tolerance(drw, obj, obj->ab, &mec),
+ (obj->dt).spl.fslc,
+ 1,
+ drw->cosp,
+ &mec
+ );
+ } else {
+ (obj->dt).spl.ts = dk3xsp_get_t_for_distance(
+ (obj->dt).spl.po,
+ (obj->dt).spl.np,
+ cuts,
+ dk3figah_length_correction_tolerance(drw, obj, obj->ab, &mec),
+ (obj->dt).spl.fslc,
+ 1,
+ drw->cosp,
+ &mec
+ );
+ } $? ". mec = %d", mec
if(0.0 > (obj->dt).spl.ts) { $? "! negative start"
back = 0;
}
} else { $? ". no need to cut at start"
}
if((0.0 < cute) && (NULL != obj->af)) { $? ". cut at end"
- (obj->dt).spl.te = dk3xsp_get_t_for_distance(
- (obj->dt).spl.po,
- (obj->dt).spl.np,
- cute,
- dk3figah_length_correction_tolerance(drw, obj, obj->af, &mec),
- (obj->dt).spl.fslc,
- 0,
- drw->cosp,
- &mec
- ); $? ". mec = %d", mec
+ if (0 != drw->ahbs) {
+ (obj->dt).spl.te = dk3xsp_get_t_for_distance_bisection(
+ (obj->dt).spl.po,
+ (obj->dt).spl.np,
+ cute,
+ dk3figah_length_correction_tolerance(drw, obj, obj->af, &mec),
+ (obj->dt).spl.fslc,
+ 0,
+ drw->cosp,
+ &mec
+ );
+ } else {
+ (obj->dt).spl.te = dk3xsp_get_t_for_distance(
+ (obj->dt).spl.po,
+ (obj->dt).spl.np,
+ cute,
+ dk3figah_length_correction_tolerance(drw, obj, obj->af, &mec),
+ (obj->dt).spl.fslc,
+ 0,
+ drw->cosp,
+ &mec
+ );
+ } $? ". mec = %d", mec
if(0.0 > (obj->dt).spl.te) { $? "! negative end"
back = 0;
}
@@ -6064,15 +6410,13 @@ dk3figah_one_arc_arrowhead(
/** Calculate arrowheads for arc.
@param drw Drawing to modify.
@param obj Object to modify.
- @param objno Object number.
@return 1 on success, 0 on error.
*/
static
int
dk3figah_calculate_arc(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
)
{
dk3_fig_poly_point_t sp;
@@ -6240,8 +6584,7 @@ dk3figah_calculate_arc(
int
dk3figah_calculate_arrowheads(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
)
{
int back = 0;
@@ -6256,15 +6599,15 @@ dk3figah_calculate_arrowheads(
if((obj->af) && (obj->ab)) { obj->cs = DK3_FIG_LC_BUTT; }
switch(obj->ot) {
case DK3_FIG_OBJ_POLYLINE: {
- back = dk3figah_calculate_polyline(drw, obj, objno);
+ back = dk3figah_calculate_polyline(drw, obj);
if(!(back)) { failed = 1; }
} break;
case DK3_FIG_OBJ_SPLINE: {
- back = dk3figah_calculate_spline(drw, obj, objno);
+ back = dk3figah_calculate_spline(drw, obj);
if(!(back)) { failed = 1; }
} break;
case DK3_FIG_OBJ_ARC: {
- back = dk3figah_calculate_arc(drw, obj, objno);
+ back = dk3figah_calculate_arc(drw, obj);
if(!(back)) { failed = 1; }
} break;
}
diff --git a/support/dktools/dk3figah.h b/support/dktools/dk3figah.h
index 7eff19d024..a1fb6ce8a8 100644
--- a/support/dktools/dk3figah.h
+++ b/support/dktools/dk3figah.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figah.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figah.ctr
*/
/** @file dk3figah.h Header file for the dk3figah module.
@@ -63,8 +41,7 @@ dk3figah_candidate(dk3_fig_obj_t *obj);
int
dk3figah_calculate_arrowheads(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long objno
+ dk3_fig_obj_t *obj
);
#ifdef __cplusplus
diff --git a/support/dktools/dk3figbb.c b/support/dktools/dk3figbb.c
index 718de84ca6..0b160ebf99 100644
--- a/support/dktools/dk3figbb.c
+++ b/support/dktools/dk3figbb.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figbb.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figbb.ctr
*/
/** @file dk3figbb.c The dk3figbb module.
diff --git a/support/dktools/dk3figbb.ctr b/support/dktools/dk3figbb.ctr
index ef90e983f3..dcecaa5597 100644
--- a/support/dktools/dk3figbb.ctr
+++ b/support/dktools/dk3figbb.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3figbb.h b/support/dktools/dk3figbb.h
index 168e970cb0..f7a7c2e693 100644
--- a/support/dktools/dk3figbb.h
+++ b/support/dktools/dk3figbb.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figbb.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figbb.ctr
*/
/** @file dk3figbb.h Header file for the dk3figbb module.
diff --git a/support/dktools/dk3figpr.c b/support/dktools/dk3figpr.c
index b39fc07474..5542201c36 100644
--- a/support/dktools/dk3figpr.c
+++ b/support/dktools/dk3figpr.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figpr.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figpr.ctr
*/
/** @file dk3figpr.c The dk3figpr module.
@@ -125,7 +103,7 @@ dk3fig_prepare_point_distance(
static
int
dk3fig_prepare_initialize_arc(
- dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj, unsigned long objno, int primobj
+ dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj
)
{
dk3_fig_poly_point_t *points;
@@ -371,14 +349,12 @@ dk3fig_prepare_initialize_arc(
/** Convert polyline to circle or squara if necessary.
@param drw Drawing.
@param obj Object.
- @param objno Object number (0 for first object).
- @param primobj Flag: Primary object (1=object, 0=arrowhead).
@return 1 on success, 0 on error.
*/
static
int
dk3fig_prepare_initialize_polyline(
- dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj, unsigned long objno, int primobj
+ dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj
)
{
dk3_fig_poly_point_t *newpoints;
@@ -395,7 +371,7 @@ dk3fig_prepare_initialize_polyline(
int ec = 0;
-#line 366 "dk3figpr.ctr"
+#line 364 "dk3figpr.ctr"
if(1 == (obj->dt).pol.np) {
mc = 1;
} else {
@@ -411,7 +387,7 @@ dk3fig_prepare_initialize_polyline(
switch(obj->cs) {
case DK3_FIG_LC_ROUND: {
-#line 380 "dk3figpr.ctr"
+#line 378 "dk3figpr.ctr"
cx = ((obj->dt).pol.po)[0].x;
cy = ((obj->dt).pol.po)[0].y;
r = 0.5 * dk3fig_tool_get_lw(drw, obj, &ec);
@@ -437,7 +413,7 @@ dk3fig_prepare_initialize_polyline(
} break;
default: {
-#line 404 "dk3figpr.ctr"
+#line 402 "dk3figpr.ctr"
cx = ((obj->dt).pol.po)[0].x;
cy = ((obj->dt).pol.po)[0].y;
r = 0.5 * dk3fig_tool_get_lw(drw, obj, &ec);
@@ -484,14 +460,14 @@ dk3fig_prepare_initialize_polyline(
}
if(ec) {
-#line 449 "dk3figpr.ctr"
+#line 447 "dk3figpr.ctr"
/* ERROR: Math */
dk3fig_set_ec(drw, DK3_ERROR_MATH_OVERFLOW);
back = 0;
dk3app_log_i1(drw->app, DK3_LL_ERROR, 260);
}
-#line 454 "dk3figpr.ctr"
+#line 452 "dk3figpr.ctr"
return back;
}
@@ -528,7 +504,7 @@ dk3fig_prepare_initialize_spline(
int ec = 0;
-#line 489 "dk3figpr.ctr"
+#line 487 "dk3figpr.ctr"
if(1 == (obj->dt).spl.np) {
mc = 1;
} else {
@@ -544,7 +520,7 @@ dk3fig_prepare_initialize_spline(
switch(obj->cs) {
case DK3_FIG_LC_ROUND: {
-#line 503 "dk3figpr.ctr"
+#line 501 "dk3figpr.ctr"
cx = ((obj->dt).spl.po)[0].x;
cy = ((obj->dt).spl.po)[0].y;
r = 0.5 * dk3fig_tool_get_lw(drw, obj, &ec);
@@ -569,7 +545,7 @@ dk3fig_prepare_initialize_spline(
} break;
default: {
-#line 526 "dk3figpr.ctr"
+#line 524 "dk3figpr.ctr"
cx = ((obj->dt).spl.po)[0].x;
cy = ((obj->dt).spl.po)[0].y;
r = 0.5 * dk3fig_tool_get_lw(drw, obj, &ec);
@@ -614,13 +590,13 @@ dk3fig_prepare_initialize_spline(
}
if(ec) {
-#line 569 "dk3figpr.ctr"
+#line 567 "dk3figpr.ctr"
dk3fig_set_ec(drw, DK3_ERROR_MATH_OVERFLOW);
/* ERROR: Math */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
}
-#line 573 "dk3figpr.ctr"
+#line 571 "dk3figpr.ctr"
return back;
}
#endif
@@ -631,23 +607,21 @@ dk3fig_prepare_initialize_spline(
/** Object type specific initialization.
@param drw Drawing.
@param obj Object.
- @param objno Object number (0 for first object).
- @param primobj Flag: Primary object (1=object, 0=arrowhead).
@return 1 on success, 0 on error.
*/
static
int
dk3fig_prepare_initialize_object(
- dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj, unsigned long objno, int primobj
+ dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj
)
{
int back = 1;
-#line 595 "dk3figpr.ctr"
+#line 591 "dk3figpr.ctr"
switch(obj->ot) {
case DK3_FIG_OBJ_POLYLINE: {
- back = dk3fig_prepare_initialize_polyline(drw, obj, objno, primobj);
+ back = dk3fig_prepare_initialize_polyline(drw, obj);
} break;
#if 0
/*
@@ -658,11 +632,11 @@ dk3fig_prepare_initialize_object(
} break;
#endif
case DK3_FIG_OBJ_ARC: {
- back = dk3fig_prepare_initialize_arc(drw, obj, objno, primobj);
+ back = dk3fig_prepare_initialize_arc(drw, obj);
} break;
}
-#line 611 "dk3figpr.ctr"
+#line 607 "dk3figpr.ctr"
return back;
}
@@ -686,7 +660,6 @@ dk3fig_prepare_add_to_bb(
/** Add objects for one arrowhead to bounding box.
@param drw
- @param obj
@param ah
@return 1 on success, 0 on error.
*/
@@ -694,14 +667,13 @@ static
int
dk3fig_prepare_arrowhead_object(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t const *obj,
dk3_fig_ah_t const *ah
)
{
int back = 1;
-#line 648 "dk3figpr.ctr"
+#line 642 "dk3figpr.ctr"
if(ah) {
if(ah->o1) {
if(!dk3fig_prepare_add_to_bb(drw, (dk3_fig_obj_t *)(ah->o1), 0)) {
@@ -719,7 +691,7 @@ dk3fig_prepare_arrowhead_object(
}
}
-#line 664 "dk3figpr.ctr"
+#line 658 "dk3figpr.ctr"
return back;
}
@@ -738,21 +710,21 @@ dk3fig_prepare_obj_bb(
switch(obj->ot) {
case DK3_FIG_OBJ_ELLIPSE: {
-#line 681 "dk3figpr.ctr"
+#line 675 "dk3figpr.ctr"
back = dk3fig_bb_add_ellipse(
dbb, &((obj->dt).ell), (0.5 * dk3fig_tool_get_lw(drw, obj, NULL))
);
} break;
case DK3_FIG_OBJ_POLYLINE: {
-#line 686 "dk3figpr.ctr"
+#line 680 "dk3figpr.ctr"
back = dk3fig_bb_add_polyline(
dbb, &((obj->dt).pol), (0.5 * dk3fig_tool_get_lw(drw, obj, NULL))
);
} break;
case DK3_FIG_OBJ_SPLINE: {
-#line 691 "dk3figpr.ctr"
+#line 685 "dk3figpr.ctr"
back = dk3fig_bb_add_spline(
drw,
dbb, &((obj->dt).spl),
@@ -762,14 +734,14 @@ dk3fig_prepare_obj_bb(
} break;
case DK3_FIG_OBJ_TEXT: {
-#line 699 "dk3figpr.ctr"
+#line 693 "dk3figpr.ctr"
back = dk3fig_bb_add_text(
dbb, &((obj->dt).txt), drw->res, drw->bbts
);
} break;
case DK3_FIG_OBJ_ARC: {
-#line 704 "dk3figpr.ctr"
+#line 698 "dk3figpr.ctr"
back = dk3fig_bb_add_arc(
dbb, &((obj->dt).arc),
((1 != obj->st) ? 1 : 0),
@@ -778,7 +750,7 @@ dk3fig_prepare_obj_bb(
} break;
default: {
-#line 711 "dk3figpr.ctr"
+#line 705 "dk3figpr.ctr"
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Unknown object type! */
dk3app_log_1(drw->app, DK3_LL_ERROR, drw->msg, 8);
@@ -809,26 +781,26 @@ dk3fig_prepare_add_to_bb(
dk3_bb_t mybb;
-#line 740 "dk3figpr.ctr"
+#line 734 "dk3figpr.ctr"
dk3bb_reset(&mybb);
switch(obj->ot) {
case DK3_FIG_OBJ_ELLIPSE: {
-#line 743 "dk3figpr.ctr"
+#line 737 "dk3figpr.ctr"
back = dk3fig_bb_add_ellipse(
&mybb, &((obj->dt).ell), (0.5 * dk3fig_tool_get_lw(drw, obj, NULL))
);
} break;
case DK3_FIG_OBJ_POLYLINE: {
-#line 748 "dk3figpr.ctr"
+#line 742 "dk3figpr.ctr"
back = dk3fig_bb_add_polyline(
&mybb, &((obj->dt).pol), (0.5 * dk3fig_tool_get_lw(drw, obj, NULL))
);
} break;
case DK3_FIG_OBJ_SPLINE: {
-#line 753 "dk3figpr.ctr"
+#line 747 "dk3figpr.ctr"
back = dk3fig_bb_add_spline(
drw,
&mybb, &((obj->dt).spl),
@@ -838,14 +810,14 @@ dk3fig_prepare_add_to_bb(
} break;
case DK3_FIG_OBJ_TEXT: {
-#line 761 "dk3figpr.ctr"
+#line 755 "dk3figpr.ctr"
back = dk3fig_bb_add_text(
&mybb, &((obj->dt).txt), drw->res, drw->bbts
);
} break;
case DK3_FIG_OBJ_ARC: {
-#line 766 "dk3figpr.ctr"
+#line 760 "dk3figpr.ctr"
back = dk3fig_bb_add_arc(
&mybb, &((obj->dt).arc),
((1 != obj->st) ? 1 : 0),
@@ -859,15 +831,15 @@ dk3fig_prepare_add_to_bb(
} break;
default: {
-#line 778 "dk3figpr.ctr"
+#line 772 "dk3figpr.ctr"
} break;
}
-#line 780 "dk3figpr.ctr"
+#line 774 "dk3figpr.ctr"
dk3bb_merge(&(drw->bb), &mybb);
if(primobj) {
- if(!dk3fig_prepare_arrowhead_object(drw, obj, obj->af)) { back = 0; }
- if(!dk3fig_prepare_arrowhead_object(drw, obj, obj->ab)) { back = 0; }
+ if(!dk3fig_prepare_arrowhead_object(drw, obj->af)) { back = 0; }
+ if(!dk3fig_prepare_arrowhead_object(drw, obj->ab)) { back = 0; }
}
if(!(back)) {
/* ERROR: Math overflow */
@@ -876,31 +848,31 @@ dk3fig_prepare_add_to_bb(
}
-#line 791 "dk3figpr.ctr"
+#line 785 "dk3figpr.ctr"
return back;
#else
int back = 0;
-#line 795 "dk3figpr.ctr"
+#line 789 "dk3figpr.ctr"
switch(obj->ot) {
case DK3_FIG_OBJ_ELLIPSE: {
-#line 797 "dk3figpr.ctr"
+#line 791 "dk3figpr.ctr"
back = dk3fig_bb_add_ellipse(
&(drw->bb), &((obj->dt).ell), (0.5 * dk3fig_tool_get_lw(drw, obj, NULL))
);
} break;
case DK3_FIG_OBJ_POLYLINE: {
-#line 802 "dk3figpr.ctr"
+#line 796 "dk3figpr.ctr"
back = dk3fig_bb_add_polyline(
&(drw->bb), &((obj->dt).pol), (0.5 * dk3fig_tool_get_lw(drw, obj, NULL))
);
} break;
case DK3_FIG_OBJ_SPLINE: {
-#line 807 "dk3figpr.ctr"
+#line 801 "dk3figpr.ctr"
back = dk3fig_bb_add_spline(
drw,
&(drw->bb), &((obj->dt).spl),
@@ -910,14 +882,14 @@ dk3fig_prepare_add_to_bb(
} break;
case DK3_FIG_OBJ_TEXT: {
-#line 815 "dk3figpr.ctr"
+#line 809 "dk3figpr.ctr"
back = dk3fig_bb_add_text(
&(drw->bb), &((obj->dt).txt), drw->res, drw->bbts
);
} break;
case DK3_FIG_OBJ_ARC: {
-#line 820 "dk3figpr.ctr"
+#line 814 "dk3figpr.ctr"
back = dk3fig_bb_add_arc(
&(drw->bb), &((obj->dt).arc),
((1 != obj->st) ? 1 : 0),
@@ -931,12 +903,12 @@ dk3fig_prepare_add_to_bb(
} break;
default: {
-#line 832 "dk3figpr.ctr"
+#line 826 "dk3figpr.ctr"
} break;
}
if(primobj) {
- if(!dk3fig_prepare_arrowhead_object(drw, obj, obj->af)) { back = 0; }
- if(!dk3fig_prepare_arrowhead_object(drw, obj, obj->ab)) { back = 0; }
+ if(!dk3fig_prepare_arrowhead_object(drw, obj->af)) { back = 0; }
+ if(!dk3fig_prepare_arrowhead_object(drw, obj->ab)) { back = 0; }
}
if(!(back)) {
/* ERROR: Math overflow */
@@ -945,7 +917,7 @@ dk3fig_prepare_add_to_bb(
}
-#line 844 "dk3figpr.ctr"
+#line 838 "dk3figpr.ctr"
return back;
#endif
}
@@ -971,7 +943,7 @@ dk3fig_prepare_report_ah(dk3_fig_ah_t *ah)
if(ah) {
-#line 868 "dk3figpr.ctr"
+#line 862 "dk3figpr.ctr"
if(ah->o1) {
dk3fig_prepare_report_object((dk3_fig_obj_t *)(ah->o1), 0);
}
@@ -980,7 +952,7 @@ dk3fig_prepare_report_ah(dk3_fig_ah_t *ah)
}
-#line 875 "dk3figpr.ctr"
+#line 869 "dk3figpr.ctr"
}
}
@@ -996,7 +968,7 @@ dk3fig_prepare_report_object(dk3_fig_obj_t *obj, int primobj)
size_t i;
-#line 889 "dk3figpr.ctr"
+#line 883 "dk3figpr.ctr"
fipo = dktrace_file();
if(fipo) {
switch(obj->ot) {
@@ -1202,7 +1174,7 @@ dk3fig_prepare_report_object(dk3_fig_obj_t *obj, int primobj)
}
}
-#line 1093 "dk3figpr.ctr"
+#line 1087 "dk3figpr.ctr"
}
#endif
@@ -1302,7 +1274,7 @@ dk3fig_prepare_object(
int back = 1;
-#line 1191 "dk3figpr.ctr"
+#line 1185 "dk3figpr.ctr"
/*
For object 0 check whether it is a background rectangle.
Set srctype.
@@ -1315,20 +1287,20 @@ dk3fig_prepare_object(
Object type specific initialization.
For arcs calculate center point and radius.
*/
- if(!dk3fig_prepare_initialize_object(drw, obj, objno, 1)) {
+ if(!dk3fig_prepare_initialize_object(drw, obj)) {
back = 0;
-#line 1205 "dk3figpr.ctr"
+#line 1199 "dk3figpr.ctr"
}
/*
For open objects calculate arrowheads.
*/
if(back) {
- if(!dk3figah_calculate_arrowheads(drw, obj, objno)) {
+ if(!dk3figah_calculate_arrowheads(drw, obj)) {
back = 0;
-#line 1213 "dk3figpr.ctr"
+#line 1207 "dk3figpr.ctr"
}
}
/*
@@ -1337,16 +1309,16 @@ dk3fig_prepare_object(
*/
if(back) {
-#line 1220 "dk3figpr.ctr"
+#line 1214 "dk3figpr.ctr"
if(!dk3fig_prepare_add_to_bb(drw, obj, 1)) {
back = 0;
-#line 1222 "dk3figpr.ctr"
+#line 1216 "dk3figpr.ctr"
dk3app_log_1(drw->app, DK3_LL_ERROR, drw->msg, 4);
}
}
-#line 1225 "dk3figpr.ctr"
+#line 1219 "dk3figpr.ctr"
return back;
}
@@ -1361,7 +1333,7 @@ dk3fig_prepare(dk3_fig_drawing_t *drw)
int back = 1;
-#line 1238 "dk3figpr.ctr"
+#line 1232 "dk3figpr.ctr"
/*
Reset bounding box.
*/
@@ -1380,10 +1352,10 @@ dk3fig_prepare(dk3_fig_drawing_t *drw)
dk3app_set_source_line(drw->app, oldsourceline);
-#line 1255 "dk3figpr.ctr"
+#line 1249 "dk3figpr.ctr"
-#line 1256 "dk3figpr.ctr"
+#line 1250 "dk3figpr.ctr"
return back;
}
diff --git a/support/dktools/dk3figpr.ctr b/support/dktools/dk3figpr.ctr
index 36669133d5..f701f77955 100644
--- a/support/dktools/dk3figpr.ctr
+++ b/support/dktools/dk3figpr.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -122,7 +122,7 @@ dk3fig_prepare_point_distance(
static
int
dk3fig_prepare_initialize_arc(
- dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj, unsigned long objno, int primobj
+ dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj
)
{
dk3_fig_poly_point_t *points;
@@ -340,14 +340,12 @@ dk3fig_prepare_initialize_arc(
/** Convert polyline to circle or squara if necessary.
@param drw Drawing.
@param obj Object.
- @param objno Object number (0 for first object).
- @param primobj Flag: Primary object (1=object, 0=arrowhead).
@return 1 on success, 0 on error.
*/
static
int
dk3fig_prepare_initialize_polyline(
- dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj, unsigned long objno, int primobj
+ dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj
)
{
dk3_fig_poly_point_t *newpoints;
@@ -580,21 +578,19 @@ dk3fig_prepare_initialize_spline(
/** Object type specific initialization.
@param drw Drawing.
@param obj Object.
- @param objno Object number (0 for first object).
- @param primobj Flag: Primary object (1=object, 0=arrowhead).
@return 1 on success, 0 on error.
*/
static
int
dk3fig_prepare_initialize_object(
- dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj, unsigned long objno, int primobj
+ dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj
)
{
int back = 1;
$? "+ dk3fig_prepare_initialize_object"
switch(obj->ot) {
case DK3_FIG_OBJ_POLYLINE: {
- back = dk3fig_prepare_initialize_polyline(drw, obj, objno, primobj);
+ back = dk3fig_prepare_initialize_polyline(drw, obj);
} break;
#if 0
/*
@@ -605,7 +601,7 @@ dk3fig_prepare_initialize_object(
} break;
#endif
case DK3_FIG_OBJ_ARC: {
- back = dk3fig_prepare_initialize_arc(drw, obj, objno, primobj);
+ back = dk3fig_prepare_initialize_arc(drw, obj);
} break;
} $? "- dk3fig_prepare_initialize_object %d", back
return back;
@@ -631,7 +627,6 @@ dk3fig_prepare_add_to_bb(
/** Add objects for one arrowhead to bounding box.
@param drw
- @param obj
@param ah
@return 1 on success, 0 on error.
*/
@@ -639,7 +634,6 @@ static
int
dk3fig_prepare_arrowhead_object(
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t const *obj,
dk3_fig_ah_t const *ah
)
{
@@ -779,8 +773,8 @@ dk3fig_prepare_add_to_bb(
} $? ". bb x = %lg %lg y = %lg %lg",mybb.xmin,mybb.xmax,mybb.ymin,mybb.ymax
dk3bb_merge(&(drw->bb), &mybb);
if(primobj) {
- if(!dk3fig_prepare_arrowhead_object(drw, obj, obj->af)) { back = 0; }
- if(!dk3fig_prepare_arrowhead_object(drw, obj, obj->ab)) { back = 0; }
+ if(!dk3fig_prepare_arrowhead_object(drw, obj->af)) { back = 0; }
+ if(!dk3fig_prepare_arrowhead_object(drw, obj->ab)) { back = 0; }
}
if(!(back)) {
/* ERROR: Math overflow */
@@ -832,8 +826,8 @@ dk3fig_prepare_add_to_bb(
} break;
}
if(primobj) {
- if(!dk3fig_prepare_arrowhead_object(drw, obj, obj->af)) { back = 0; }
- if(!dk3fig_prepare_arrowhead_object(drw, obj, obj->ab)) { back = 0; }
+ if(!dk3fig_prepare_arrowhead_object(drw, obj->af)) { back = 0; }
+ if(!dk3fig_prepare_arrowhead_object(drw, obj->ab)) { back = 0; }
}
if(!(back)) {
/* ERROR: Math overflow */
@@ -1200,14 +1194,14 @@ dk3fig_prepare_object(
Object type specific initialization.
For arcs calculate center point and radius.
*/
- if(!dk3fig_prepare_initialize_object(drw, obj, objno, 1)) {
+ if(!dk3fig_prepare_initialize_object(drw, obj)) {
back = 0; $? "! initialization failed"
}
/*
For open objects calculate arrowheads.
*/
if(back) {
- if(!dk3figah_calculate_arrowheads(drw, obj, objno)) {
+ if(!dk3figah_calculate_arrowheads(drw, obj)) {
back = 0;
$? "! arrowhead calculation failed"
}
diff --git a/support/dktools/dk3figpr.h b/support/dktools/dk3figpr.h
index 3e22e1b80a..a8d4e9ca78 100644
--- a/support/dktools/dk3figpr.h
+++ b/support/dktools/dk3figpr.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figpr.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figpr.ctr
*/
/** @file dk3figpr.h Header file for the dk3figpr module.
diff --git a/support/dktools/dk3figrd.c b/support/dktools/dk3figrd.c
index 67d1a26fee..2f020ef532 100644
--- a/support/dktools/dk3figrd.c
+++ b/support/dktools/dk3figrd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figrd.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figrd.ctr
*/
/** @file dk3figrd.c The dk3figrd module.
@@ -44,11 +22,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3figrd.h"
#include "fig2lat.h"
+#include "dk4unused.h"
-#line 54 "dk3figrd.ctr"
+
+#line 56 "dk3figrd.ctr"
@@ -61,7 +41,7 @@ dkT("r"),
NULL
-#line 66 "dk3figrd.ctr"
+#line 68 "dk3figrd.ctr"
};
@@ -83,7 +63,7 @@ static char const * const dk3figrd_c8_kw[] = {
NULL
-#line 84 "dk3figrd.ctr"
+#line 86 "dk3figrd.ctr"
};
@@ -134,7 +114,7 @@ dk3figrd_expect_start(dk3_fig_drawing_t *drw, char *lp)
int back = 0;
-#line 133 "dk3figrd.ctr"
+#line 135 "dk3figrd.ctr"
if('#' == *lp) {
back = 1;
if(7 < dk3str_c8_len(lp)) {
@@ -142,22 +122,22 @@ dk3figrd_expect_start(dk3_fig_drawing_t *drw, char *lp)
drw->state = DK3_FIG_RD_STATE_EXPECT_ORIENTATION;
} else {
-#line 139 "dk3figrd.ctr"
+#line 141 "dk3figrd.ctr"
}
} else {
-#line 141 "dk3figrd.ctr"
+#line 143 "dk3figrd.ctr"
}
} else {
-#line 143 "dk3figrd.ctr"
+#line 145 "dk3figrd.ctr"
}
if(!(back)) {
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
dk3app_log_1(drw->app, DK3_LL_ERROR, drw->msg, 1);
}
-#line 148 "dk3figrd.ctr"
+#line 150 "dk3figrd.ctr"
return back;
}
@@ -179,7 +159,7 @@ dk3figrd_expect_transparent(dk3_fig_drawing_t *drw, char *lp)
drw->state = DK3_FIG_RD_STATE_EXPECT_RESOLUTION;
drw->transcol = i;
-#line 168 "dk3figrd.ctr"
+#line 170 "dk3figrd.ctr"
} else {
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Not a number! */
@@ -276,7 +256,7 @@ dk3figrd_color_object(dk3_fig_drawing_t *drw, char *args)
int ec = 1; /* 1=syntax, 2=memory, 3=redef */
-#line 263 "dk3figrd.ctr"
+#line 265 "dk3figrd.ctr"
if(args) {
pn = dk3str_c8_next(args, NULL);
if(pn) {
@@ -337,7 +317,7 @@ dk3figrd_color_object(dk3_fig_drawing_t *drw, char *args)
dk3figrd_report_error_code(drw, back, ec);
-#line 322 "dk3figrd.ctr"
+#line 324 "dk3figrd.ctr"
return back;
}
@@ -363,7 +343,7 @@ dk3figrd_arc_complete(dk3_fig_drawing_t *drw, dk3_fig_obj_t *tobj, char *args)
int back = 1;
-#line 346 "dk3figrd.ctr"
+#line 348 "dk3figrd.ctr"
pc = args;
for(i = 0; ((back) && (pc) && (i < 12)); i++) {
pn = dk3str_c8_next(pc, NULL);
@@ -371,7 +351,7 @@ dk3figrd_arc_complete(dk3_fig_drawing_t *drw, dk3_fig_obj_t *tobj, char *args)
case 0: { /* int cap style */
if(1 != sscanf(pc, "%d", &(tobj->cs))) {
-#line 352 "dk3figrd.ctr"
+#line 354 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -380,70 +360,70 @@ dk3figrd_arc_complete(dk3_fig_drawing_t *drw, dk3_fig_obj_t *tobj, char *args)
case 2: { /* int arrow forward */
if(1 != sscanf(pc, "%d", &af)) {
-#line 359 "dk3figrd.ctr"
+#line 361 "dk3figrd.ctr"
back = 0;
}
} break;
case 3: { /* int arrow backward */
if(1 != sscanf(pc, "%d", &ab)) {
-#line 364 "dk3figrd.ctr"
+#line 366 "dk3figrd.ctr"
back = 0;
}
} break;
case 4: { /* double cx */
if(1 != sscanf(pc, "%lg", &((tobj->dt).arc.xc))) {
-#line 369 "dk3figrd.ctr"
+#line 371 "dk3figrd.ctr"
back = 0;
}
} break;
case 5: { /* double cy */
if(1 != sscanf(pc, "%lg", &((tobj->dt).arc.yc))) {
-#line 374 "dk3figrd.ctr"
+#line 376 "dk3figrd.ctr"
back = 0;
}
} break;
case 6: { /* double x1 */
if(1 != sscanf(pc, "%lg", &((tobj->dt).arc.x1))) {
-#line 379 "dk3figrd.ctr"
+#line 381 "dk3figrd.ctr"
back = 0;
}
} break;
case 7: { /* double y1 */
if(1 != sscanf(pc, "%lg", &((tobj->dt).arc.y1))) {
-#line 384 "dk3figrd.ctr"
+#line 386 "dk3figrd.ctr"
back = 0;
}
} break;
case 8: { /* double x2 */
if(1 != sscanf(pc, "%lg", &((tobj->dt).arc.x2))) {
-#line 389 "dk3figrd.ctr"
+#line 391 "dk3figrd.ctr"
back = 0;
}
} break;
case 9: { /* double y2 */
if(1 != sscanf(pc, "%lg", &((tobj->dt).arc.y2))) {
-#line 394 "dk3figrd.ctr"
+#line 396 "dk3figrd.ctr"
back = 0;
}
} break;
case 10: { /* double x3 */
if(1 != sscanf(pc, "%lg", &((tobj->dt).arc.x3))) {
-#line 399 "dk3figrd.ctr"
+#line 401 "dk3figrd.ctr"
back = 0;
}
} break;
case 11: { /* double y3 */
if(1 != sscanf(pc, "%lg", &((tobj->dt).arc.y3))) {
-#line 404 "dk3figrd.ctr"
+#line 406 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -451,7 +431,7 @@ dk3figrd_arc_complete(dk3_fig_drawing_t *drw, dk3_fig_obj_t *tobj, char *args)
if(!(pc)) {
if(i < 11) {
-#line 410 "dk3figrd.ctr"
+#line 412 "dk3figrd.ctr"
back = 0;
}
}
@@ -459,7 +439,7 @@ dk3figrd_arc_complete(dk3_fig_drawing_t *drw, dk3_fig_obj_t *tobj, char *args)
}
if(back) {
-#line 416 "dk3figrd.ctr"
+#line 418 "dk3figrd.ctr"
pobj = dk3fig_obj_new(
drw->lineno, tobj->la, tobj->ot, tobj->st, tobj->lw, tobj->pc, tobj->fc,
tobj->fi, tobj->cs, tobj->js, tobj->ls, tobj->sv, af, ab,
@@ -468,10 +448,10 @@ dk3figrd_arc_complete(dk3_fig_drawing_t *drw, dk3_fig_obj_t *tobj, char *args)
if(pobj) {
-#line 423 "dk3figrd.ctr"
+#line 425 "dk3figrd.ctr"
-#line 424 "dk3figrd.ctr"
+#line 426 "dk3figrd.ctr"
if(dk3sto_add(drw->sobj, (void *)pobj)) {
dk3mem_cpy(
(void *)(&((pobj->dt).arc)),
@@ -488,13 +468,13 @@ dk3figrd_arc_complete(dk3_fig_drawing_t *drw, dk3_fig_obj_t *tobj, char *args)
} else {
back = 0; ec = 2;
-#line 439 "dk3figrd.ctr"
+#line 441 "dk3figrd.ctr"
dk3fig_obj_delete(pobj);
}
} else {
back = 0; ec = 2;
-#line 443 "dk3figrd.ctr"
+#line 445 "dk3figrd.ctr"
}
}
if(!(back)) {
@@ -506,7 +486,7 @@ dk3figrd_arc_complete(dk3_fig_drawing_t *drw, dk3_fig_obj_t *tobj, char *args)
dk3figrd_report_error_code(drw, back, ec);
-#line 453 "dk3figrd.ctr"
+#line 455 "dk3figrd.ctr"
return back;
}
@@ -532,7 +512,7 @@ dk3figrd_ellipse_complete(
int back = 1;
-#line 477 "dk3figrd.ctr"
+#line 479 "dk3figrd.ctr"
pc = args;
for(i = 0; ((back) && (pc) && (i < 10)); i++) {
pn = dk3str_c8_next(pc, NULL);
@@ -542,37 +522,37 @@ dk3figrd_ellipse_complete(
case 1: { /* angle */
if(1 != sscanf(pc, "%lg", &((tobj->dt).ell.an))) {
-#line 485 "dk3figrd.ctr"
+#line 487 "dk3figrd.ctr"
back = 0;
}
-#line 487 "dk3figrd.ctr"
+#line 489 "dk3figrd.ctr"
} break;
case 2: { /* cx */
if(1 != sscanf(pc, "%lg", &((tobj->dt).ell.cx))) {
-#line 490 "dk3figrd.ctr"
+#line 492 "dk3figrd.ctr"
back = 0;
}
} break;
case 3: { /* cy */
if(1 != sscanf(pc, "%lg", &((tobj->dt).ell.cy))) {
-#line 495 "dk3figrd.ctr"
+#line 497 "dk3figrd.ctr"
back = 0;
}
} break;
case 4: { /* rx */
if(1 != sscanf(pc, "%lg", &((tobj->dt).ell.rx))) {
-#line 500 "dk3figrd.ctr"
+#line 502 "dk3figrd.ctr"
back = 0;
}
} break;
case 5: { /* ry */
if(1 != sscanf(pc, "%lg", &((tobj->dt).ell.ry))) {
-#line 505 "dk3figrd.ctr"
+#line 507 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -589,7 +569,7 @@ dk3figrd_ellipse_complete(
if(!(pc)) {
if(i < 9) {
-#line 520 "dk3figrd.ctr"
+#line 522 "dk3figrd.ctr"
back = 0;
}
}
@@ -624,7 +604,7 @@ dk3figrd_ellipse_complete(
dk3figrd_report_error_code(drw, back, ec);
-#line 553 "dk3figrd.ctr"
+#line 555 "dk3figrd.ctr"
return back;
}
@@ -655,7 +635,7 @@ dk3figrd_polyline_complete(
int back = 1;
-#line 582 "dk3figrd.ctr"
+#line 584 "dk3figrd.ctr"
pc = args;
for(i = 0; ((back) && (pc) && (i < 6)); i++) {
pn = dk3str_c8_next(pc, NULL);
@@ -663,35 +643,35 @@ dk3figrd_polyline_complete(
case 0: { /* js, join style */
if(1 != sscanf(pc, "%d", &(tobj->js))) {
-#line 588 "dk3figrd.ctr"
+#line 590 "dk3figrd.ctr"
back = 0;
}
} break;
case 1: { /* cs, cap style */
if(1 != sscanf(pc, "%d", &(tobj->cs))) {
-#line 593 "dk3figrd.ctr"
+#line 595 "dk3figrd.ctr"
back = 0;
}
} break;
case 2: { /* radius */
if(1 != sscanf(pc, "%lg", &((tobj->dt).pol.ra))) {
-#line 598 "dk3figrd.ctr"
+#line 600 "dk3figrd.ctr"
back = 0;
}
} break;
case 3: { /* af, array forward */
if(1 != sscanf(pc, "%d", &af)) {
-#line 603 "dk3figrd.ctr"
+#line 605 "dk3figrd.ctr"
back = 0;
}
} break;
case 4: { /* ab, array backward */
if(1 != sscanf(pc, "%d", &ab)) {
-#line 608 "dk3figrd.ctr"
+#line 610 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -701,12 +681,12 @@ dk3figrd_polyline_complete(
(tobj->dt).pol.np = (size_t)u;
if(u != (unsigned)((tobj->dt).pol.np)) {
-#line 616 "dk3figrd.ctr"
+#line 618 "dk3figrd.ctr"
back = 0;
}
} else {
-#line 619 "dk3figrd.ctr"
+#line 621 "dk3figrd.ctr"
back = 0;
}
#else
@@ -727,7 +707,7 @@ dk3figrd_polyline_complete(
if(!(pc)) {
if(i < 5) {
-#line 638 "dk3figrd.ctr"
+#line 640 "dk3figrd.ctr"
back = 0;
}
}
@@ -742,10 +722,10 @@ dk3figrd_polyline_complete(
(pobj->dt).pol.ra = (tobj->dt).pol.ra;
-#line 651 "dk3figrd.ctr"
+#line 653 "dk3figrd.ctr"
-#line 652 "dk3figrd.ctr"
+#line 654 "dk3figrd.ctr"
if(dk3sto_add(drw->sobj, (void *)pobj)) {
drw->cobj = pobj;
drw->cind = 0;
@@ -763,13 +743,13 @@ dk3figrd_polyline_complete(
} else {
back = 0; ec = 2;
-#line 668 "dk3figrd.ctr"
+#line 670 "dk3figrd.ctr"
dk3fig_obj_delete(pobj);
}
} else {
back = 0; ec = 2;
-#line 672 "dk3figrd.ctr"
+#line 674 "dk3figrd.ctr"
}
}
if(!(back)) {
@@ -781,7 +761,7 @@ dk3figrd_polyline_complete(
dk3figrd_report_error_code(drw, back, ec);
-#line 682 "dk3figrd.ctr"
+#line 684 "dk3figrd.ctr"
return back;
}
@@ -810,7 +790,7 @@ dk3figrd_spline_complete(dk3_fig_drawing_t *drw,dk3_fig_obj_t *tobj,char *args)
int back = 1;
-#line 709 "dk3figrd.ctr"
+#line 711 "dk3figrd.ctr"
pc = args;
for(i = 0; ((back) && (pc) && (i < 4)); i++) {
pn = dk3str_c8_next(pc, NULL);
@@ -818,21 +798,21 @@ dk3figrd_spline_complete(dk3_fig_drawing_t *drw,dk3_fig_obj_t *tobj,char *args)
case 0: { /* cs, cap style */
if(1 != sscanf(pc, "%d", &(tobj->cs))) {
-#line 715 "dk3figrd.ctr"
+#line 717 "dk3figrd.ctr"
back = 0;
}
} break;
case 1: { /* af, arrowhead forward */
if(1 != sscanf(pc, "%d", &af)) {
-#line 720 "dk3figrd.ctr"
+#line 722 "dk3figrd.ctr"
back = 0;
}
} break;
case 2: { /* ab, arrowhead backward */
if(1 != sscanf(pc, "%d", &ab)) {
-#line 725 "dk3figrd.ctr"
+#line 727 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -842,7 +822,7 @@ dk3figrd_spline_complete(dk3_fig_drawing_t *drw,dk3_fig_obj_t *tobj,char *args)
(tobj->dt).pol.np = (size_t)u;
if(u != (unsigned)((tobj->dt).pol.np)) {
-#line 733 "dk3figrd.ctr"
+#line 735 "dk3figrd.ctr"
back = 0;
}
} else {
@@ -878,10 +858,10 @@ dk3figrd_spline_complete(dk3_fig_drawing_t *drw,dk3_fig_obj_t *tobj,char *args)
if(pobj) {
-#line 767 "dk3figrd.ctr"
+#line 769 "dk3figrd.ctr"
-#line 768 "dk3figrd.ctr"
+#line 770 "dk3figrd.ctr"
if(dk3sto_add(drw->sobj, (void *)pobj)) {
drw->cobj = pobj;
drw->cind = 0;
@@ -895,13 +875,13 @@ dk3figrd_spline_complete(dk3_fig_drawing_t *drw,dk3_fig_obj_t *tobj,char *args)
}
} else {
-#line 780 "dk3figrd.ctr"
+#line 782 "dk3figrd.ctr"
back = 0; ec = 2;
dk3fig_obj_delete(pobj);
}
} else {
-#line 784 "dk3figrd.ctr"
+#line 786 "dk3figrd.ctr"
back = 0; ec = 2;
}
}
@@ -914,7 +894,7 @@ dk3figrd_spline_complete(dk3_fig_drawing_t *drw,dk3_fig_obj_t *tobj,char *args)
dk3figrd_report_error_code(drw, back, ec);
-#line 795 "dk3figrd.ctr"
+#line 797 "dk3figrd.ctr"
return back;
}
@@ -937,7 +917,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
int back = 0;
-#line 816 "dk3figrd.ctr"
+#line 818 "dk3figrd.ctr"
if(args) {
dk3fig_obj_init(&tobj);
tobj.ot = ot;
@@ -949,19 +929,19 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
case 0: { /* st: sub type */
if(1 != sscanf(pc, "%d", &(tobj.st))) {
-#line 826 "dk3figrd.ctr"
+#line 828 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
dk3app_log_1(drw->app, DK3_LL_ERROR, drw->msg, 1);
}
-#line 831 "dk3figrd.ctr"
+#line 833 "dk3figrd.ctr"
} break;
case 1: { /* ls: line style: int */
if(1 != sscanf(pc, "%d", &(tobj.ls))) {
-#line 834 "dk3figrd.ctr"
+#line 836 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
@@ -971,7 +951,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
case 2: { /* lw: line thickness: int */
if(1 != sscanf(pc, "%d", &(tobj.lw))) {
-#line 842 "dk3figrd.ctr"
+#line 844 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
@@ -981,7 +961,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
case 3: { /* pc: pen color: int */
if(1 != sscanf(pc, "%d", &(tobj.pc))) {
-#line 850 "dk3figrd.ctr"
+#line 852 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
@@ -991,7 +971,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
case 4: { /* fc: fill color: int */
if(1 != sscanf(pc, "%d", &(tobj.fc))) {
-#line 858 "dk3figrd.ctr"
+#line 860 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
@@ -1001,7 +981,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
case 5: { /* la: depth: int */
if(1 != sscanf(pc, "%d", &(tobj.la))) {
-#line 866 "dk3figrd.ctr"
+#line 868 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
@@ -1013,7 +993,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
case 7: { /* fi: area fill: int */
if(1 != sscanf(pc, "%d", &(tobj.fi))) {
-#line 876 "dk3figrd.ctr"
+#line 878 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
@@ -1023,7 +1003,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
case 8: { /* sv: style value: double */
if(1 != sscanf(pc, "%lg", &(tobj.sv))) {
-#line 884 "dk3figrd.ctr"
+#line 886 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
@@ -1034,7 +1014,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
pc = pn;
if(!(pc)) {
-#line 893 "dk3figrd.ctr"
+#line 895 "dk3figrd.ctr"
back = 0;
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
/* ERROR: Syntax */
@@ -1044,7 +1024,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
if((back) && (pc)) {
-#line 901 "dk3figrd.ctr"
+#line 903 "dk3figrd.ctr"
switch(ot) {
case DK3_FIG_OBJ_ARC: {
back = dk3figrd_arc_complete(drw, &tobj, pc);
@@ -1070,7 +1050,7 @@ dk3figrd_path_object(dk3_fig_drawing_t *drw, int ot, char *args)
dk3app_log_1(drw->app, DK3_LL_ERROR, drw->msg, 1);
}
-#line 925 "dk3figrd.ctr"
+#line 927 "dk3figrd.ctr"
return back;
}
@@ -1110,32 +1090,32 @@ dk3figrd_squeeze_string(char *str)
int back = 1;
-#line 963 "dk3figrd.ctr"
+#line 965 "dk3figrd.ctr"
ptr = str;
while((back) && (*ptr)) {
-#line 965 "dk3figrd.ctr"
+#line 967 "dk3figrd.ctr"
if('\\' == *ptr) {
-#line 966 "dk3figrd.ctr"
+#line 968 "dk3figrd.ctr"
if((ptr[1] >= '0') && (ptr[1] <= '3')) {
if((ptr[2] >= '0') && (ptr[2] <= '7')) {
if((ptr[3] >= '0') && (ptr[3] <= '7')) {
-#line 969 "dk3figrd.ctr"
+#line 971 "dk3figrd.ctr"
i1 = i2 = i3 = 0;
(void)dk3figrd_hex_digit(ptr[1], &i1);
-#line 971 "dk3figrd.ctr"
+#line 973 "dk3figrd.ctr"
(void)dk3figrd_hex_digit(ptr[2], &i2);
-#line 972 "dk3figrd.ctr"
+#line 974 "dk3figrd.ctr"
(void)dk3figrd_hex_digit(ptr[3], &i3);
-#line 973 "dk3figrd.ctr"
+#line 975 "dk3figrd.ctr"
-#line 974 "dk3figrd.ctr"
+#line 976 "dk3figrd.ctr"
*ptr = (char)(64 * i1 + 8 * i2 + i3);
dk3figrd_string_copy_to_left(&(ptr[1]), &(ptr[4]));
if(0x01 == *ptr) {
@@ -1145,13 +1125,13 @@ dk3figrd_squeeze_string(char *str)
}
} else {
-#line 982 "dk3figrd.ctr"
+#line 984 "dk3figrd.ctr"
back = 0;
}
} else {
back = 0;
-#line 986 "dk3figrd.ctr"
+#line 988 "dk3figrd.ctr"
}
} else {
switch(ptr[1]) {
@@ -1181,14 +1161,14 @@ dk3figrd_squeeze_string(char *str)
}
} else {
-#line 1014 "dk3figrd.ctr"
+#line 1016 "dk3figrd.ctr"
ptr++;
}
}
if(!(back)) {
}
-#line 1019 "dk3figrd.ctr"
+#line 1021 "dk3figrd.ctr"
return back;
}
@@ -1212,7 +1192,7 @@ dk3figrd_text_object(dk3_fig_drawing_t *drw, char *args)
int i; /* Index of current text word. */
-#line 1041 "dk3figrd.ctr"
+#line 1043 "dk3figrd.ctr"
if(args) {
dk3fig_obj_init(&tobj);
tobj.ot = DK3_FIG_OBJ_TEXT;
@@ -1224,21 +1204,21 @@ dk3figrd_text_object(dk3_fig_drawing_t *drw, char *args)
case 0: { /* sub type */
if(1 != sscanf(pc, "%d", &(tobj.st))) {
-#line 1051 "dk3figrd.ctr"
+#line 1053 "dk3figrd.ctr"
back = 0;
}
} break;
case 1: { /* color */
if(1 != sscanf(pc, "%d", &(tobj.pc))) {
-#line 1056 "dk3figrd.ctr"
+#line 1058 "dk3figrd.ctr"
back = 0;
}
} break;
case 2: { /* depth (layer) */
if(1 != sscanf(pc, "%d", &(tobj.la))) {
-#line 1061 "dk3figrd.ctr"
+#line 1063 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -1247,36 +1227,36 @@ dk3figrd_text_object(dk3_fig_drawing_t *drw, char *args)
case 4: { /* font */
if(1 != sscanf(pc, "%d", &(tobj.dt.txt.fo))) {
-#line 1068 "dk3figrd.ctr"
+#line 1070 "dk3figrd.ctr"
back = 0;
}
} break;
case 5: { /* font size */
if(1 == sscanf(pc, "%lg", &(tobj.dt.txt.fs))) {
-#line 1073 "dk3figrd.ctr"
+#line 1075 "dk3figrd.ctr"
if(tobj.dt.txt.fs < 0.0) {
-#line 1074 "dk3figrd.ctr"
+#line 1076 "dk3figrd.ctr"
back = 0;
}
} else {
-#line 1077 "dk3figrd.ctr"
+#line 1079 "dk3figrd.ctr"
back = 0;
}
} break;
case 6: { /* angle */
if(1 != sscanf(pc, "%lg", &(tobj.dt.txt.an))) {
-#line 1082 "dk3figrd.ctr"
+#line 1084 "dk3figrd.ctr"
back = 0;
}
} break;
case 7: { /* font flags */
if(1 != sscanf(pc, "%d", &(tobj.dt.txt.ff))) {
-#line 1087 "dk3figrd.ctr"
+#line 1089 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -1287,14 +1267,14 @@ dk3figrd_text_object(dk3_fig_drawing_t *drw, char *args)
case 10: { /* x */
if(1 != sscanf(pc, "%lg", &(tobj.dt.txt.x))) {
-#line 1096 "dk3figrd.ctr"
+#line 1098 "dk3figrd.ctr"
back = 0;
}
} break;
case 11: { /* y */
if(1 != sscanf(pc, "%lg", &(tobj.dt.txt.y))) {
-#line 1101 "dk3figrd.ctr"
+#line 1103 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -1302,7 +1282,7 @@ dk3figrd_text_object(dk3_fig_drawing_t *drw, char *args)
pc = pn;
if(!(pc)) {
-#line 1107 "dk3figrd.ctr"
+#line 1109 "dk3figrd.ctr"
back = 0;
}
}
@@ -1325,19 +1305,19 @@ dk3figrd_text_object(dk3_fig_drawing_t *drw, char *args)
} else {
back = 0; ec = 2;
-#line 1128 "dk3figrd.ctr"
+#line 1130 "dk3figrd.ctr"
dk3fig_obj_delete(pobj);
}
} else {
back = 0; ec = 2;
-#line 1132 "dk3figrd.ctr"
+#line 1134 "dk3figrd.ctr"
}
} else {
dk3fig_set_ec(drw, DK3_ERROR_SYNTAX);
back = 0;
-#line 1136 "dk3figrd.ctr"
+#line 1138 "dk3figrd.ctr"
}
}
}
@@ -1350,7 +1330,7 @@ dk3figrd_text_object(dk3_fig_drawing_t *drw, char *args)
dk3figrd_report_error_code(drw, back, ec);
-#line 1147 "dk3figrd.ctr"
+#line 1149 "dk3figrd.ctr"
return back;
}
@@ -1371,7 +1351,7 @@ dk3figrd_start_object(dk3_fig_drawing_t *drw, char *lp)
int back = 0;
-#line 1166 "dk3figrd.ctr"
+#line 1168 "dk3figrd.ctr"
pn = dk3str_c8_next(lp, NULL);
if(1 == sscanf(lp, "%d", &ot)) {
switch(ot) {
@@ -1402,15 +1382,13 @@ dk3figrd_start_object(dk3_fig_drawing_t *drw, char *lp)
}
-#line 1195 "dk3figrd.ctr"
+#line 1197 "dk3figrd.ctr"
return back;
}
/** Read arrowhead line.
- @param drw Drawing.
- @param obj Current object.
@param ah Arrowhead structure to fill.
@param lp Text containing arrowhead information.
@return 1 on success, 0 on error.
@@ -1418,8 +1396,6 @@ dk3figrd_start_object(dk3_fig_drawing_t *drw, char *lp)
static
int
dk3figrd_arrowhead(
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
dk3_fig_ah_t *ah,
char *lp
)
@@ -1430,7 +1406,7 @@ dk3figrd_arrowhead(
int back = 1;
-#line 1221 "dk3figrd.ctr"
+#line 1219 "dk3figrd.ctr"
pc = dk3str_c8_start(lp, NULL);
for(i = 0; ((back) && (pc) && (i < 5)); i++) {
pn = dk3str_c8_next(pc, NULL);
@@ -1438,14 +1414,14 @@ dk3figrd_arrowhead(
case 0: { /* arrow type */
if(1 != sscanf(pc, "%d", &(ah->as))) {
-#line 1227 "dk3figrd.ctr"
+#line 1225 "dk3figrd.ctr"
back = 0;
}
} break;
case 1: { /* arrow style */
if(1 != sscanf(pc, "%d", &(ah->af))) {
-#line 1232 "dk3figrd.ctr"
+#line 1230 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -1454,14 +1430,14 @@ dk3figrd_arrowhead(
case 3: { /* width */
if(1 != sscanf(pc, "%lg", &(ah->wi))) {
-#line 1239 "dk3figrd.ctr"
+#line 1237 "dk3figrd.ctr"
back = 0;
}
} break;
case 4: { /* height */
if(1 != sscanf(pc, "%lg", &(ah->he))) {
-#line 1244 "dk3figrd.ctr"
+#line 1242 "dk3figrd.ctr"
back = 0;
}
} break;
@@ -1470,13 +1446,13 @@ dk3figrd_arrowhead(
if(!(pc)) {
if(i < 4) {
-#line 1251 "dk3figrd.ctr"
+#line 1249 "dk3figrd.ctr"
back = 0;
}
}
}
-#line 1255 "dk3figrd.ctr"
+#line 1253 "dk3figrd.ctr"
return back;
}
@@ -1496,24 +1472,24 @@ dk3figrd_arc_arrow(dk3_fig_drawing_t *drw, char *lp)
int back = 0;
-#line 1273 "dk3figrd.ctr"
+#line 1271 "dk3figrd.ctr"
ostate = drw->state;
if(drw->cobj) {
switch(ostate) {
case DK3_FIG_RD_STATE_ARC_ARROW_BACKWARD: {
if((drw->cobj)->ab) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->ab, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->ab, lp);
} else {
-#line 1280 "dk3figrd.ctr"
+#line 1278 "dk3figrd.ctr"
}
} break;
default: {
if((drw->cobj)->af) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->af, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->af, lp);
} else {
-#line 1286 "dk3figrd.ctr"
+#line 1284 "dk3figrd.ctr"
}
} break;
}
@@ -1527,7 +1503,7 @@ dk3figrd_arc_arrow(dk3_fig_drawing_t *drw, char *lp)
}
} else {
-#line 1298 "dk3figrd.ctr"
+#line 1296 "dk3figrd.ctr"
}
if(!(back)) {
switch(ec) {
@@ -1537,7 +1513,7 @@ dk3figrd_arc_arrow(dk3_fig_drawing_t *drw, char *lp)
}
dk3figrd_report_error_code(drw, back, ec);
-#line 1306 "dk3figrd.ctr"
+#line 1304 "dk3figrd.ctr"
return back;
}
@@ -1557,24 +1533,24 @@ dk3figrd_polyline_arrow(dk3_fig_drawing_t *drw, char *lp)
int back = 0;
-#line 1324 "dk3figrd.ctr"
+#line 1322 "dk3figrd.ctr"
ostate = drw->state;
if(drw->cobj) {
switch(ostate) {
case DK3_FIG_RD_STATE_PL_ARROW_BACKWARD: {
if((drw->cobj)->ab) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->ab, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->ab, lp);
} else {
-#line 1331 "dk3figrd.ctr"
+#line 1329 "dk3figrd.ctr"
}
} break;
default: {
if((drw->cobj)->af) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->af, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->af, lp);
} else {
-#line 1337 "dk3figrd.ctr"
+#line 1335 "dk3figrd.ctr"
}
} break;
}
@@ -1591,7 +1567,7 @@ dk3figrd_polyline_arrow(dk3_fig_drawing_t *drw, char *lp)
}
} else {
-#line 1352 "dk3figrd.ctr"
+#line 1350 "dk3figrd.ctr"
}
if(!(back)) {
switch(ec) {
@@ -1602,7 +1578,7 @@ dk3figrd_polyline_arrow(dk3_fig_drawing_t *drw, char *lp)
dk3figrd_report_error_code(drw, back, ec);
-#line 1361 "dk3figrd.ctr"
+#line 1359 "dk3figrd.ctr"
return back;
}
@@ -1622,24 +1598,24 @@ dk3figrd_spline_arrow(dk3_fig_drawing_t *drw, char *lp)
int back = 0;
-#line 1379 "dk3figrd.ctr"
+#line 1377 "dk3figrd.ctr"
ostate = drw->state;
if(drw->cobj) {
switch(ostate) {
case DK3_FIG_RD_STATE_SP_ARROW_BACKWARD: {
if((drw->cobj)->ab) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->ab, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->ab, lp);
} else {
-#line 1386 "dk3figrd.ctr"
+#line 1384 "dk3figrd.ctr"
}
} break;
default: {
if((drw->cobj)->af) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->af, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->af, lp);
} else {
-#line 1392 "dk3figrd.ctr"
+#line 1390 "dk3figrd.ctr"
}
} break;
}
@@ -1653,7 +1629,7 @@ dk3figrd_spline_arrow(dk3_fig_drawing_t *drw, char *lp)
}
} else {
-#line 1404 "dk3figrd.ctr"
+#line 1402 "dk3figrd.ctr"
}
if(!(back)) {
switch(ec) {
@@ -1664,7 +1640,7 @@ dk3figrd_spline_arrow(dk3_fig_drawing_t *drw, char *lp)
dk3figrd_report_error_code(drw, back, ec);
-#line 1413 "dk3figrd.ctr"
+#line 1411 "dk3figrd.ctr"
return back;
}
@@ -1686,7 +1662,7 @@ dk3figrd_polyline_image(dk3_fig_drawing_t *drw, char *lp)
int back = 0;
-#line 1433 "dk3figrd.ctr"
+#line 1431 "dk3figrd.ctr"
if(drw->cobj) {
p1 = dk3str_c8_start(lp, NULL);
if(p1) {
@@ -1708,7 +1684,7 @@ dk3figrd_polyline_image(dk3_fig_drawing_t *drw, char *lp)
}
} else {
-#line 1453 "dk3figrd.ctr"
+#line 1451 "dk3figrd.ctr"
}
if(!(back)) {
switch(ec) {
@@ -1719,7 +1695,7 @@ dk3figrd_polyline_image(dk3_fig_drawing_t *drw, char *lp)
dk3figrd_report_error_code(drw, back, ec);
-#line 1462 "dk3figrd.ctr"
+#line 1460 "dk3figrd.ctr"
return back;
}
@@ -1744,7 +1720,7 @@ dk3figrd_point_data(dk3_fig_drawing_t *drw, char *lp)
int back = 1;
-#line 1485 "dk3figrd.ctr"
+#line 1483 "dk3figrd.ctr"
if(drw->cobj) {
switch((drw->cobj)->ot) {
case DK3_FIG_OBJ_POLYLINE: {
@@ -1758,7 +1734,7 @@ dk3figrd_point_data(dk3_fig_drawing_t *drw, char *lp)
default: {
back = 0; dk3fig_set_ec(drw, DK3_ERROR_DATA_DAMAGED);
-#line 1497 "dk3figrd.ctr"
+#line 1495 "dk3figrd.ctr"
} break;
}
if(back) {
@@ -1766,20 +1742,20 @@ dk3figrd_point_data(dk3_fig_drawing_t *drw, char *lp)
while((cc) && (back) && (pc)) {
pn = dk3str_c8_next(pc, NULL);
-#line 1503 "dk3figrd.ctr"
+#line 1501 "dk3figrd.ctr"
if(1 == sscanf(pc, "%lg", &d)) {
switch((drw->cobj)->ot) {
case DK3_FIG_OBJ_POLYLINE: {
if(drw->cind < ((drw->cobj)->dt).pol.np) {
if(drw->cxy) {
-#line 1508 "dk3figrd.ctr"
+#line 1506 "dk3figrd.ctr"
pp[drw->cind].y = d;
drw->cxy = 0;
drw->cind += 1;
} else {
-#line 1512 "dk3figrd.ctr"
+#line 1510 "dk3figrd.ctr"
pp[drw->cind].x = d;
drw->cxy = 1;
}
@@ -1794,7 +1770,7 @@ dk3figrd_point_data(dk3_fig_drawing_t *drw, char *lp)
if(drw->cind < ((drw->cobj)->dt).spl.np) {
sp[drw->cind].s = d;
-#line 1525 "dk3figrd.ctr"
+#line 1523 "dk3figrd.ctr"
drw->cind += 1;
}
if(drw->cind >= ((drw->cobj)->dt).spl.np) {
@@ -1805,13 +1781,13 @@ dk3figrd_point_data(dk3_fig_drawing_t *drw, char *lp)
if(drw->cind < ((drw->cobj)->dt).spl.np) {
if(drw->cxy) {
-#line 1534 "dk3figrd.ctr"
+#line 1532 "dk3figrd.ctr"
sp[drw->cind].y = d;
drw->cxy = 0;
drw->cind += 1;
} else {
-#line 1538 "dk3figrd.ctr"
+#line 1536 "dk3figrd.ctr"
sp[drw->cind].x = d;
drw->cxy = 1;
}
@@ -1821,7 +1797,7 @@ dk3figrd_point_data(dk3_fig_drawing_t *drw, char *lp)
drw->cind = 0;
drw->cxy = 0;
-#line 1546 "dk3figrd.ctr"
+#line 1544 "dk3figrd.ctr"
}
}
} break;
@@ -1835,12 +1811,12 @@ dk3figrd_point_data(dk3_fig_drawing_t *drw, char *lp)
}
} else {
-#line 1558 "dk3figrd.ctr"
+#line 1556 "dk3figrd.ctr"
}
dk3figrd_report_error_code(drw, back, ec);
-#line 1561 "dk3figrd.ctr"
+#line 1559 "dk3figrd.ctr"
return back;
}
@@ -1859,7 +1835,7 @@ dk3figrd_process_comment(dk3_fig_drawing_t *drw, char *lp)
size_t ncp;
-#line 1578 "dk3figrd.ctr"
+#line 1576 "dk3figrd.ctr"
switch(drw->state) {
case DK3_FIG_RD_STATE_EXPECT_ORIENTATION: {
if(DK3_FIG_SRCTYPE_UNKNOWN == drw->srctype) {
@@ -1873,7 +1849,7 @@ dk3figrd_process_comment(dk3_fig_drawing_t *drw, char *lp)
if(dk3str_c8_casecmp(cp[2], dk3figrd_c8_kw[3]) == 0) {
drw->srctype = DK3_FIG_SRCTYPE_WINFIG;
-#line 1590 "dk3figrd.ctr"
+#line 1588 "dk3figrd.ctr"
}
}
}
@@ -1883,7 +1859,7 @@ dk3figrd_process_comment(dk3_fig_drawing_t *drw, char *lp)
} break;
}
-#line 1598 "dk3figrd.ctr"
+#line 1596 "dk3figrd.ctr"
}
@@ -1901,7 +1877,7 @@ dk3fig_read_my_apply_line(dk3_fig_drawing_t *drw, char *lp)
int back = 0;
-#line 1614 "dk3figrd.ctr"
+#line 1612 "dk3figrd.ctr"
if((drw) && (lp)) {
drw->lineno += 1UL;
if(drw->app) { dk3app_set_source_line(drw->app, drw->lineno); }
@@ -1974,14 +1950,14 @@ dk3fig_read_my_apply_line(dk3_fig_drawing_t *drw, char *lp)
} else {
back = 1;
-#line 1685 "dk3figrd.ctr"
+#line 1683 "dk3figrd.ctr"
dk3figrd_process_comment(drw, p1);
}
}
} else {
back = 1;
-#line 1690 "dk3figrd.ctr"
+#line 1688 "dk3figrd.ctr"
}
if(!(back)) {
drw->state = DK3_FIG_RD_STATE_ERROR;
@@ -1997,10 +1973,10 @@ dk3fig_read_my_apply_line(dk3_fig_drawing_t *drw, char *lp)
}
} else {
-#line 1704 "dk3figrd.ctr"
+#line 1702 "dk3figrd.ctr"
}
-#line 1705 "dk3figrd.ctr"
+#line 1703 "dk3figrd.ctr"
return back;
}
@@ -2016,14 +1992,14 @@ dk3fig_read_apply_line(dk3_fig_drawing_t *drw, char *lp)
#if DK3_HAVE_SETLOCALE && defined(LC_NUMERIC) && DK3_HAVE_LOCALE_H
-#line 1719 "dk3figrd.ctr"
+#line 1717 "dk3figrd.ctr"
oldlocale = setlocale(LC_NUMERIC, "C");
#endif
back = dk3fig_read_my_apply_line(drw, lp);
#if DK3_HAVE_SETLOCALE && defined(LC_NUMERIC) && DK3_HAVE_LOCALE_H
if(oldlocale) {
-#line 1724 "dk3figrd.ctr"
+#line 1722 "dk3figrd.ctr"
setlocale(LC_NUMERIC, oldlocale);
}
#endif
@@ -2043,12 +2019,12 @@ dk3fig_read_file(dk3_fig_drawing_t *drw, FILE *fipo)
int back = 0;
-#line 1742 "dk3figrd.ctr"
+#line 1740 "dk3figrd.ctr"
if((drw) && (fipo)) {
#if DK3_HAVE_SETLOCALE && defined(LC_NUMERIC) && DK3_HAVE_LOCALE_H
-#line 1745 "dk3figrd.ctr"
+#line 1743 "dk3figrd.ctr"
oldlocale = setlocale(LC_NUMERIC, "C");
#endif
back = 1;
@@ -2057,28 +2033,28 @@ dk3fig_read_file(dk3_fig_drawing_t *drw, FILE *fipo)
if(fgets(il, sizeof(il), fipo)) {
if(!dk3fig_read_my_apply_line(drw, il)) {
-#line 1752 "dk3figrd.ctr"
+#line 1750 "dk3figrd.ctr"
back = 0;
}
} else {
-#line 1755 "dk3figrd.ctr"
+#line 1753 "dk3figrd.ctr"
cc = 0;
}
}
#if DK3_HAVE_SETLOCALE && defined(LC_NUMERIC) && DK3_HAVE_LOCALE_H
if(oldlocale) {
-#line 1760 "dk3figrd.ctr"
+#line 1758 "dk3figrd.ctr"
setlocale(LC_NUMERIC, oldlocale);
}
#endif
} else {
-#line 1764 "dk3figrd.ctr"
+#line 1762 "dk3figrd.ctr"
}
-#line 1765 "dk3figrd.ctr"
+#line 1763 "dk3figrd.ctr"
return back;
}
@@ -2093,7 +2069,7 @@ dk3fig_read_file_name(dk3_fig_drawing_t *drw, dkChar const *fn)
int back = 0;
-#line 1778 "dk3figrd.ctr"
+#line 1776 "dk3figrd.ctr"
if((drw) && (fn)) {
if(drw->app) {
oldsrcname = dk3app_get_source_file(drw->app);
@@ -2107,7 +2083,7 @@ dk3fig_read_file_name(dk3_fig_drawing_t *drw, dkChar const *fn)
fclose(fipo);
} else {
-#line 1790 "dk3figrd.ctr"
+#line 1788 "dk3figrd.ctr"
dk3fig_set_ec(drw, DK3_ERROR_SYSTEM);
}
if(drw->app) {
@@ -2116,11 +2092,11 @@ dk3fig_read_file_name(dk3_fig_drawing_t *drw, dkChar const *fn)
}
} else {
-#line 1797 "dk3figrd.ctr"
+#line 1795 "dk3figrd.ctr"
if(drw) { dk3fig_set_ec(drw, DK3_ERROR_INVALID_ARGS); }
}
-#line 1799 "dk3figrd.ctr"
+#line 1797 "dk3figrd.ctr"
return back;
}
diff --git a/support/dktools/dk3figrd.ctr b/support/dktools/dk3figrd.ctr
index e79d3db200..ffba4d6545 100644
--- a/support/dktools/dk3figrd.ctr
+++ b/support/dktools/dk3figrd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -48,6 +48,8 @@ dk3fig_read_file(dk3_fig_drawing_t *drw, FILE *fipo);
#include "dk3figrd.h"
#include "fig2lat.h"
+#include "dk4unused.h"
+
$!trace-include
@@ -1198,8 +1200,6 @@ dk3figrd_start_object(dk3_fig_drawing_t *drw, char *lp)
/** Read arrowhead line.
- @param drw Drawing.
- @param obj Current object.
@param ah Arrowhead structure to fill.
@param lp Text containing arrowhead information.
@return 1 on success, 0 on error.
@@ -1207,8 +1207,6 @@ dk3figrd_start_object(dk3_fig_drawing_t *drw, char *lp)
static
int
dk3figrd_arrowhead(
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
dk3_fig_ah_t *ah,
char *lp
)
@@ -1275,13 +1273,13 @@ dk3figrd_arc_arrow(dk3_fig_drawing_t *drw, char *lp)
switch(ostate) {
case DK3_FIG_RD_STATE_ARC_ARROW_BACKWARD: {
if((drw->cobj)->ab) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->ab, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->ab, lp);
} else { $? "! bug ab"
}
} break;
default: {
if((drw->cobj)->af) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->af, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->af, lp);
} else { $? "! bug af"
}
} break;
@@ -1326,13 +1324,13 @@ dk3figrd_polyline_arrow(dk3_fig_drawing_t *drw, char *lp)
switch(ostate) {
case DK3_FIG_RD_STATE_PL_ARROW_BACKWARD: {
if((drw->cobj)->ab) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->ab, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->ab, lp);
} else { $? "! bug ab"
}
} break;
default: {
if((drw->cobj)->af) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->af, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->af, lp);
} else { $? "! bug af"
}
} break;
@@ -1381,13 +1379,13 @@ dk3figrd_spline_arrow(dk3_fig_drawing_t *drw, char *lp)
switch(ostate) {
case DK3_FIG_RD_STATE_SP_ARROW_BACKWARD: {
if((drw->cobj)->ab) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->ab, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->ab, lp);
} else { $? "! bug ab"
}
} break;
default: {
if((drw->cobj)->af) {
- back = dk3figrd_arrowhead(drw, drw->cobj, (drw->cobj)->af, lp);
+ back = dk3figrd_arrowhead((drw->cobj)->af, lp);
} else { $? "! bug af"
}
} break;
diff --git a/support/dktools/dk3figrd.h b/support/dktools/dk3figrd.h
index 722fefe32e..8347d95257 100644
--- a/support/dktools/dk3figrd.h
+++ b/support/dktools/dk3figrd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figrd.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figrd.ctr
*/
/** @file dk3figrd.h Header file for the dk3figrd module.
diff --git a/support/dktools/dk3figto.c b/support/dktools/dk3figto.c
index 2dd8ed4158..2141763f85 100644
--- a/support/dktools/dk3figto.c
+++ b/support/dktools/dk3figto.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figto.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figto.ctr
*/
/** @file dk3figto.c The dk3figto module.
@@ -44,12 +22,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3fig.h"
#include "dk3figto.h"
#include "fig2lat.h"
+#include "dk3unused.h"
-#line 294 "dk3figto.ctr"
+#line 295 "dk3figto.ctr"
@@ -133,18 +112,18 @@ dk3fig_tool_get_lw(
double back = 0.0;
-#line 376 "dk3figto.ctr"
+#line 377 "dk3figto.ctr"
#if VERSION_BEFORE_20140330
if((drw) && (obj)) {
lw = (double)(obj->lw);
-#line 379 "dk3figto.ctr"
+#line 380 "dk3figto.ctr"
back = dk3ma_d_mul_ok(lw, drw->res, &mec) / 80.0;
-#line 380 "dk3figto.ctr"
+#line 381 "dk3figto.ctr"
if(drw->lighten) { back = back / 2.0; }
-#line 381 "dk3figto.ctr"
+#line 382 "dk3figto.ctr"
if(mec) {
back = 0.0;
if(ec) { *ec = mec; }
@@ -166,7 +145,7 @@ dk3fig_tool_get_lw(
#endif
-#line 401 "dk3figto.ctr"
+#line 402 "dk3figto.ctr"
return back;
}
@@ -200,7 +179,7 @@ dk3fig_tool_arc_kappa(double alpha, int *ec)
int mec = 0; /* Mathematical error code. */
-#line 433 "dk3figto.ctr"
+#line 434 "dk3figto.ctr"
emcosa = 1.0 - cos(alpha);
back = dk3ma_d_div_ok(
((2.0 * sqrt(8.0 * emcosa)) - (4.0 * sin(alpha))),
@@ -212,7 +191,7 @@ dk3fig_tool_arc_kappa(double alpha, int *ec)
if(ec) { *ec = mec; }
}
-#line 443 "dk3figto.ctr"
+#line 444 "dk3figto.ctr"
return back;
}
@@ -224,13 +203,13 @@ dk3fig_tool_xssbs(dk3_fig_drawing_t *drw, int primobj)
size_t back = 8;
-#line 453 "dk3figto.ctr"
+#line 454 "dk3figto.ctr"
if(drw) { back = drw->xssbs; }
if(!(primobj)) { back = back / 2; }
if(back < 2) { back = 2; }
-#line 457 "dk3figto.ctr"
+#line 458 "dk3figto.ctr"
return back;
}
@@ -246,7 +225,7 @@ dk3fig_tool_point_distance(
double back = 0.0;
-#line 471 "dk3figto.ctr"
+#line 472 "dk3figto.ctr"
if((p1) && (p2)) {
back = sqrt(
dk3ma_d_add_ok(
@@ -263,7 +242,7 @@ dk3fig_tool_point_distance(
);
}
-#line 486 "dk3figto.ctr"
+#line 487 "dk3figto.ctr"
return back;
}
@@ -281,13 +260,13 @@ dk3fig_tool_poly_point_move_left(
size_t i; /* Index to traverse all elements. */
-#line 502 "dk3figto.ctr"
+#line 503 "dk3figto.ctr"
if((dst) && (src) && (np)) {
dptr = dst; sptr = src; i = np;
while(i--) { *(dptr++) = *(sptr++); }
}
-#line 506 "dk3figto.ctr"
+#line 507 "dk3figto.ctr"
}
@@ -308,16 +287,16 @@ dk3fig_tool_cut_segment(
int mec = 0; /* Mathematical error code. */
-#line 525 "dk3figto.ctr"
+#line 526 "dk3figto.ctr"
if((endpoint) && (innerpoint)) {
-#line 526 "dk3figto.ctr"
+#line 527 "dk3figto.ctr"
-#line 527 "dk3figto.ctr"
+#line 528 "dk3figto.ctr"
if(0.0 < distance) {
-#line 528 "dk3figto.ctr"
+#line 529 "dk3figto.ctr"
delta = sqrt(
dk3ma_d_add_ok(
dk3ma_d_square_ok(
@@ -332,13 +311,13 @@ dk3fig_tool_cut_segment(
)
);
-#line 541 "dk3figto.ctr"
+#line 542 "dk3figto.ctr"
if(delta > distance) {
-#line 542 "dk3figto.ctr"
+#line 543 "dk3figto.ctr"
q = dk3ma_d_div_ok(distance, delta, &mec);
-#line 543 "dk3figto.ctr"
+#line 544 "dk3figto.ctr"
newx = dk3ma_d_add_ok(
endpoint->x,
dk3ma_d_mul_ok(
@@ -359,25 +338,25 @@ dk3fig_tool_cut_segment(
);
if(0 == mec) {
-#line 562 "dk3figto.ctr"
+#line 563 "dk3figto.ctr"
endpoint->x = newx; endpoint->y = newy;
back = 1;
}
} else {
-#line 566 "dk3figto.ctr"
+#line 567 "dk3figto.ctr"
}
} else {
-#line 568 "dk3figto.ctr"
+#line 569 "dk3figto.ctr"
}
} else {
-#line 570 "dk3figto.ctr"
+#line 571 "dk3figto.ctr"
}
if(mec) { if(ec) { *ec = mec; } }
-#line 572 "dk3figto.ctr"
+#line 573 "dk3figto.ctr"
return back;
}
@@ -389,7 +368,7 @@ dk3fig_tool_get_operation(dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj)
int back = 0;
-#line 582 "dk3figto.ctr"
+#line 583 "dk3figto.ctr"
if((drw) && (obj)) {
if(0 < obj->lw) {
if(obj->pc != drw->transcol) {
@@ -410,7 +389,7 @@ dk3fig_tool_get_operation(dk3_fig_drawing_t *drw, dk3_fig_obj_t *obj)
}
}
-#line 601 "dk3figto.ctr"
+#line 602 "dk3figto.ctr"
return back;
}
@@ -430,14 +409,14 @@ dk3fig_tool_color_alpha(double x, double y, double alpha, int *ec)
double back;
-#line 619 "dk3figto.ctr"
+#line 620 "dk3figto.ctr"
back = dk3ma_d_add_ok(
dk3ma_d_mul_ok(x, alpha, ec),
dk3ma_d_mul_ok(y, dk3ma_d_sub_ok(20.0, alpha, ec), ec),
ec
) / 20.0;
-#line 624 "dk3figto.ctr"
+#line 625 "dk3figto.ctr"
return back;
}
@@ -461,7 +440,7 @@ dk3fig_tool_mix_color(
int ec = 0; /* Mathematical error code. */
-#line 646 "dk3figto.ctr"
+#line 647 "dk3figto.ctr"
myrgb.r = rgb->r;
myrgb.g = rgb->g;
myrgb.b = rgb->b;
@@ -473,7 +452,7 @@ dk3fig_tool_mix_color(
rgb->r = myrgb.r; rgb->g = myrgb.g; rgb->b = myrgb.b;
}
-#line 656 "dk3figto.ctr"
+#line 657 "dk3figto.ctr"
}
@@ -527,26 +506,26 @@ dk3fig_tool_find_color(
int mycolno; /* Color number. */
-#line 708 "dk3figto.ctr"
+#line 709 "dk3figto.ctr"
mycolno = 0;
if(rgb) {
rgb->r = rgb->g = rgb->b = 0.0;
if(drw) {
-#line 712 "dk3figto.ctr"
+#line 713 "dk3figto.ctr"
if(drw->scol) {
-#line 713 "dk3figto.ctr"
+#line 714 "dk3figto.ctr"
if(drw->icol) {
-#line 714 "dk3figto.ctr"
+#line 715 "dk3figto.ctr"
if((0 <= colno) && (colno <= 31)) {
-#line 715 "dk3figto.ctr"
+#line 716 "dk3figto.ctr"
pfc = &(dk3fig_tool_low_rgb[colno]);
} else {
-#line 717 "dk3figto.ctr"
+#line 718 "dk3figto.ctr"
pfc = (dk3_fig_color_t *)dk3sto_it_find_like(
drw->icol, (void *)(&colno), 1
);
@@ -558,7 +537,7 @@ dk3fig_tool_find_color(
mycolno = colno;
} else {
-#line 727 "dk3figto.ctr"
+#line 728 "dk3figto.ctr"
if(-1 != colno) {
/* ERROR: Color not found, using black as default! */
dk3app_log_1(drw->app, DK3_LL_WARNING, drw->msg, 7);
@@ -566,20 +545,20 @@ dk3fig_tool_find_color(
}
} else {
-#line 733 "dk3figto.ctr"
+#line 734 "dk3figto.ctr"
}
} else {
-#line 735 "dk3figto.ctr"
+#line 736 "dk3figto.ctr"
}
} else {
-#line 737 "dk3figto.ctr"
+#line 738 "dk3figto.ctr"
}
if(-1 < fs) {
if(20 > fs) {
-#line 740 "dk3figto.ctr"
+#line 741 "dk3figto.ctr"
switch(mycolno) {
case 0: {
dk3fig_tool_mix_color(rgb, 1.0, fs);
@@ -595,7 +574,7 @@ dk3fig_tool_find_color(
if(41 > fs) {
if(20 < fs) {
-#line 754 "dk3figto.ctr"
+#line 755 "dk3figto.ctr"
switch(mycolno) {
case 0: {
} break;
@@ -618,7 +597,7 @@ dk3fig_tool_find_color(
}
}
-#line 775 "dk3figto.ctr"
+#line 776 "dk3figto.ctr"
}
@@ -662,7 +641,7 @@ dk3fig_tool_find_int_color(
if(-1 < fs) {
if(20 > fs) {
-#line 817 "dk3figto.ctr"
+#line 818 "dk3figto.ctr"
switch(mycolno) {
case 0: {
dk3fig_tool_mix_int_color(dst, 255, fs);
@@ -677,7 +656,7 @@ dk3fig_tool_find_int_color(
} else {
if((20 < fs) && (41 > fs)) {
-#line 830 "dk3figto.ctr"
+#line 831 "dk3figto.ctr"
switch(mycolno) {
case 0: {
} break;
@@ -781,11 +760,13 @@ dk3fig_tool_shift_spoint(
int
-dk3fig_tool_font_compare(void const *l, void const *r, int cr)
+dk3fig_tool_font_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
dk3_fig_font_t const *pl; /* Left pointer. */
dk3_fig_font_t const *pr; /* Right pointer. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3_fig_font_t const *)l;
@@ -920,12 +901,15 @@ dk3fig_tool_must_set_font(
@return Comparison result.
*/
int
-dk3fig_tool_text_handling_compare(void const *l, void const *r, int cr)
+dk3fig_tool_text_handling_compare(
+ void const *l, void const *r, int DK3_ARG_UNUSED(cr)
+)
{
f2l_text_handling_t const *pl; /* Left pointer. */
f2l_text_handling_t const *pr; /* Right pointer. */
int back = 0;
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (f2l_text_handling_t const *)l;
@@ -968,7 +952,7 @@ dk3fig_tool_short_output_file_name(
int res = 0; /* Operation result. */
-#line 1119 "dk3figto.ctr"
+#line 1125 "dk3figto.ctr"
if(fullName) {
snptr = NULL; ptr = fullName;
while(*ptr) {
@@ -1001,7 +985,7 @@ dk3fig_tool_short_output_file_name(
}
}
-#line 1150 "dk3figto.ctr"
+#line 1156 "dk3figto.ctr"
return back;
}
diff --git a/support/dktools/dk3figto.ctr b/support/dktools/dk3figto.ctr
index d071e4b7a6..b5197123ce 100644
--- a/support/dktools/dk3figto.ctr
+++ b/support/dktools/dk3figto.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -287,6 +287,7 @@ dk3fig_tool_text_handling_compare(void const *l, void const *r, int cr);
#include "dk3fig.h"
#include "dk3figto.h"
#include "fig2lat.h"
+#include "dk3unused.h"
@@ -930,11 +931,13 @@ dk3fig_tool_shift_spoint(
int
-dk3fig_tool_font_compare(void const *l, void const *r, int cr)
+dk3fig_tool_font_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
dk3_fig_font_t const *pl; /* Left pointer. */
dk3_fig_font_t const *pr; /* Right pointer. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3_fig_font_t const *)l;
@@ -1069,12 +1072,15 @@ dk3fig_tool_must_set_font(
@return Comparison result.
*/
int
-dk3fig_tool_text_handling_compare(void const *l, void const *r, int cr)
+dk3fig_tool_text_handling_compare(
+ void const *l, void const *r, int DK3_ARG_UNUSED(cr)
+)
{
f2l_text_handling_t const *pl; /* Left pointer. */
f2l_text_handling_t const *pr; /* Right pointer. */
int back = 0;
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (f2l_text_handling_t const *)l;
diff --git a/support/dktools/dk3figto.h b/support/dktools/dk3figto.h
index 9b794547f7..0a506bfc1b 100644
--- a/support/dktools/dk3figto.h
+++ b/support/dktools/dk3figto.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3figto.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3figto.ctr
*/
/** @file dk3figto.h Header file for the dk3figto module.
diff --git a/support/dktools/dk3font.c b/support/dktools/dk3font.c
index 2d7b952c9b..09770469d5 100644
--- a/support/dktools/dk3font.c
+++ b/support/dktools/dk3font.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3font.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3font.ctr
*/
/** @file dk3font.c The dk3font module.
diff --git a/support/dktools/dk3font.ctr b/support/dktools/dk3font.ctr
index d0544037df..183ce59b5f 100644
--- a/support/dktools/dk3font.ctr
+++ b/support/dktools/dk3font.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3font.h b/support/dktools/dk3font.h
index 046ac94795..cd567e15ba 100644
--- a/support/dktools/dk3font.h
+++ b/support/dktools/dk3font.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3font.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3font.ctr
*/
/** @file dk3font.h Header file for the dk3font module.
diff --git a/support/dktools/dk3info.c b/support/dktools/dk3info.c
index b26e719268..8297c871a5 100644
--- a/support/dktools/dk3info.c
+++ b/support/dktools/dk3info.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk3info.ctr
@@ -9,13 +15,28 @@
*/
-#line 5 "dk3info.ctr"
+#line 8 "dk3info.ctr"
#include "dk3all.h"
#include "dk3sf.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void show_defines(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
#include "dk3info1.c"
+
+
/** Option names for configure.
*/
static dkChar const *option_names[] = {
@@ -55,7 +76,7 @@ dkT("--libexecdir="),
NULL
-#line 27 "dk3info.ctr"
+#line 45 "dk3info.ctr"
};
diff --git a/support/dktools/dk3info.ctr b/support/dktools/dk3info.ctr
index 36e4ebc8cc..d5b0feb253 100644
--- a/support/dktools/dk3info.ctr
+++ b/support/dktools/dk3info.ctr
@@ -1,13 +1,31 @@
%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% module
#include "dk3all.h"
#include "dk3sf.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void show_defines(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
#include "dk3info1.c"
+
+
/** Option names for configure.
*/
static dkChar const *option_names[] = {
diff --git a/support/dktools/dk3info.rc b/support/dktools/dk3info.rc
index 0ad30eccb2..cb7c1904c5 100644
--- a/support/dktools/dk3info.rc
+++ b/support/dktools/dk3info.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Show setup information\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Show setup information\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk3info\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk3info1.c b/support/dktools/dk3info1.c
index 1b0690d8d6..99cd76d9e2 100644
--- a/support/dktools/dk3info1.c
+++ b/support/dktools/dk3info1.c
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
void show_defines(void)
{
dkChar buf[64];
diff --git a/support/dktools/dk3inst.c b/support/dktools/dk3inst.c
index 4de3e751e2..e805716cd1 100644
--- a/support/dktools/dk3inst.c
+++ b/support/dktools/dk3inst.c
@@ -36,13 +36,11 @@ dkChar const * const dk3inst_directories[] = {
dkChar const *
dk3inst_get_directory(size_t i)
-/* {{{ */
{
dkChar const *back = NULL;
if(i <= 10) { back = dk3inst_directories[i]; }
return back;
}
-/* }}} */
diff --git a/support/dktools/dk3inst.h b/support/dktools/dk3inst.h
index ef346ae7fa..413e073ed0 100644
--- a/support/dktools/dk3inst.h
+++ b/support/dktools/dk3inst.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
/** @file dk3inst.h Get installation directory names.
*/
@@ -5,6 +9,9 @@
#ifndef DK3_INST_H_INCLUDED
#define DK3_INST_H_INCLUDED 1
+#ifndef DK3CONF_H_INCLUDED
+#include "dk3conf.h"
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk3kv.c b/support/dktools/dk3kv.c
index b623a15eed..86f1d78172 100644
--- a/support/dktools/dk3kv.c
+++ b/support/dktools/dk3kv.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3kv.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3kv.ctr
*/
/** @file dk3kv.c The dk3kv module.
@@ -41,7 +19,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
-
+#include "dk3kv.h"
int
diff --git a/support/dktools/dk3kv.ctr b/support/dktools/dk3kv.ctr
index f7b929a215..480530fd9a 100644
--- a/support/dktools/dk3kv.ctr
+++ b/support/dktools/dk3kv.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -43,7 +43,7 @@ dk3kv_new_app(dkChar const *k, dkChar const *v, dk3_app_t *app);
#include "dk3all.h"
-
+#include "dk3kv.h"
int
diff --git a/support/dktools/dk3kv.h b/support/dktools/dk3kv.h
index 196312819f..373720c5c0 100644
--- a/support/dktools/dk3kv.h
+++ b/support/dktools/dk3kv.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3kv.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3kv.ctr
*/
/** @file dk3kv.h Header file for the dk3kv module.
diff --git a/support/dktools/dk3ma.h b/support/dktools/dk3ma.h
index d0c87c8816..a2e1bbf886 100644
--- a/support/dktools/dk3ma.h
+++ b/support/dktools/dk3ma.h
@@ -1,8 +1,14 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK3MA_H_INCLUDED
#define DK3MA_H_INCLUDED 1
+#ifndef DK3CONF_H_INCLUDED
#include <dk3conf.h>
+#endif
#include <stdio.h>
#if DK3_HAVE_SYS_TYPES_H
diff --git a/support/dktools/dk3mad.c b/support/dktools/dk3mad.c
index bcc688aee4..e8f2ef7d4f 100644
--- a/support/dktools/dk3mad.c
+++ b/support/dktools/dk3mad.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mad.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mad.ctr
*/
/** @file dk3mad.c The dk3mad module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 161 "dk3mad.ctr"
+#include "dk3conf.h"
#include "dk3ma.h"
#include "dk3const.h"
@@ -46,7 +25,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 168 "dk3mad.ctr"
+#line 169 "dk3mad.ctr"
@@ -110,13 +89,13 @@ dk3ma_d_add_ok(double a, double b, int *ec)
{
-#line 230 "dk3mad.ctr"
+#line 231 "dk3mad.ctr"
if (NULL != ec) {
if ((0.0 < a) && (0.0 < b)) {
if ((dk3ma_i_max_double - a) < b) {
-#line 234 "dk3mad.ctr"
+#line 235 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
} else {
@@ -124,14 +103,14 @@ dk3ma_d_add_ok(double a, double b, int *ec)
if ( ( (-1.0 * dk3ma_i_max_double) - a ) > b ) {
-#line 240 "dk3mad.ctr"
+#line 241 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
}
}
-#line 245 "dk3mad.ctr"
+#line 246 "dk3mad.ctr"
return (a + b);
}
@@ -142,13 +121,13 @@ dk3ma_d_sub_ok(double a, double b, int *ec)
{
-#line 254 "dk3mad.ctr"
+#line 255 "dk3mad.ctr"
if (NULL != ec) {
if ((0.0 < a) && (0.0 > b)) {
if( (dk3ma_i_max_double + b) < a ) {
-#line 258 "dk3mad.ctr"
+#line 259 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
} else {
@@ -156,14 +135,14 @@ dk3ma_d_sub_ok(double a, double b, int *ec)
if ( ( (-1.0 * dk3ma_i_max_double) + b ) > a ) {
-#line 264 "dk3mad.ctr"
+#line 265 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
}
}
-#line 269 "dk3mad.ctr"
+#line 270 "dk3mad.ctr"
return (a - b);
}
@@ -174,19 +153,19 @@ dk3ma_d_mul_ok(double a, double b, int *ec)
{
-#line 278 "dk3mad.ctr"
+#line 279 "dk3mad.ctr"
if (ec) {
if (dk3ma_d_abs(a) > 1.0) {
if ( (dk3ma_i_max_double / dk3ma_d_abs(a)) < dk3ma_d_abs(b) ) {
-#line 282 "dk3mad.ctr"
+#line 283 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
}
-#line 286 "dk3mad.ctr"
+#line 287 "dk3mad.ctr"
return (a * b);
}
@@ -214,7 +193,7 @@ dk3ma_d_div_ok(double a, double b, int *ec)
if ((dk3ma_i_max_double * dk3ma_d_abs(b)) < dk3ma_d_abs(a)) {
if (ec) {
-#line 312 "dk3mad.ctr"
+#line 313 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
if (((0.0 <= a) && (0.0 <= b)) || ((0.0 > a) && (0.0 > b))) {
@@ -234,7 +213,7 @@ dk3ma_d_div_ok(double a, double b, int *ec)
case _FPCLASS_PZ: {
if (ec) {
-#line 330 "dk3mad.ctr"
+#line 331 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_DIVZERO;
}
switch(_fpclass(a)) {
@@ -262,7 +241,7 @@ dk3ma_d_div_ok(double a, double b, int *ec)
if ((dk3ma_i_max_double * dk3ma_d_abs(b)) < dk3ma_d_abs(a)) {
if (ec) {
-#line 356 "dk3mad.ctr"
+#line 357 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
if (((0.0 <= a) && (0.0 <= b)) || ((0.0 > a) && (0.0 > b))) {
@@ -283,7 +262,7 @@ dk3ma_d_div_ok(double a, double b, int *ec)
if ((dk3ma_i_max_double * dk3ma_d_abs(b)) < dk3ma_d_abs(a)) {
if (ec) {
-#line 375 "dk3mad.ctr"
+#line 376 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
if (((0.0 <= a) && (0.0 <= b)) || ((0.0 > a) && (0.0 > b))) {
@@ -324,18 +303,18 @@ dk3ma_d_square_ok(double x, int *ec)
double back = -1.0;
-#line 414 "dk3mad.ctr"
+#line 415 "dk3mad.ctr"
if (0.0 <= x) {
back = sqrt(x);
} else {
if (NULL != ec) {
-#line 418 "dk3mad.ctr"
+#line 419 "dk3mad.ctr"
*ec = DK3_ERROR_MATH_OUT_OF_RANGE;
}
}
-#line 421 "dk3mad.ctr"
+#line 422 "dk3mad.ctr"
return back;
#else
return (dk3ma_d_mul_ok(x, x, ec));
@@ -366,52 +345,52 @@ dk3ma_d_atan2(double y, double x)
double back;
-#line 450 "dk3mad.ctr"
+#line 451 "dk3mad.ctr"
back = atan2(y, x);
-#line 451 "dk3mad.ctr"
+#line 452 "dk3mad.ctr"
while (back < 0.0) { back += (2.0 * M_PI); }
while (back > (2.0 * M_PI)) { back -= (2.0 * M_PI); }
-#line 454 "dk3mad.ctr"
+#line 455 "dk3mad.ctr"
return back;
#else
double back = -5.0 * M_PI;
double v;
-#line 459 "dk3mad.ctr"
+#line 460 "dk3mad.ctr"
v = dk3ma_d_div_ok(y, x, &mec);
if (mec) {
-#line 461 "dk3mad.ctr"
+#line 462 "dk3mad.ctr"
if(y < 0.0) {
-#line 462 "dk3mad.ctr"
+#line 463 "dk3mad.ctr"
back = 1.5 * M_PI;
} else {
-#line 464 "dk3mad.ctr"
+#line 465 "dk3mad.ctr"
back = 0.5 * M_PI;
}
} else {
-#line 467 "dk3mad.ctr"
+#line 468 "dk3mad.ctr"
back = atan(v);
if (x < 0.0) {
-#line 469 "dk3mad.ctr"
+#line 470 "dk3mad.ctr"
back += M_PI;
}
}
-#line 472 "dk3mad.ctr"
+#line 473 "dk3mad.ctr"
while (back < 0.0) { back += (2.0 * M_PI); }
while (back > (2.0 * M_PI)) { back -= (2.0 * M_PI); }
-#line 475 "dk3mad.ctr"
+#line 476 "dk3mad.ctr"
return back;
#endif
}
diff --git a/support/dktools/dk3mad.ctr b/support/dktools/dk3mad.ctr
index c4fc603930..5f5e41ab57 100644
--- a/support/dktools/dk3mad.ctr
+++ b/support/dktools/dk3mad.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -159,6 +159,7 @@ dk3ma_d_restrict_digits_ceil(double x, size_t n);
%% module
+#include "dk3conf.h"
#include "dk3ma.h"
#include "dk3const.h"
diff --git a/support/dktools/dk3mad.h b/support/dktools/dk3mad.h
index e32f2e690e..7116cea42f 100644
--- a/support/dktools/dk3mad.h
+++ b/support/dktools/dk3mad.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mad.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mad.ctr
*/
#ifndef DK3MAD_H_INCLUDED
diff --git a/support/dktools/dk3madfo.c b/support/dktools/dk3madfo.c
index 667ac924c2..c357f17fac 100644
--- a/support/dktools/dk3madfo.c
+++ b/support/dktools/dk3madfo.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madfo.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madfo.ctr
*/
/** @file dk3madfo.c The dk3madfo module.
@@ -40,6 +18,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 67 "dk3madfo.ctr"
+#include "dk3conf.h"
#include "dk3ma.h"
#if DK3_HAVE_STDLIB_H
@@ -57,7 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 85 "dk3madfo.ctr"
+#line 86 "dk3madfo.ctr"
@@ -73,7 +52,7 @@ dk3ma_print_double_c8_str_no_sci(FILE *of, char *buffer)
int i; /* Traverse the string. */
-#line 99 "dk3madfo.ctr"
+#line 100 "dk3madfo.ctr"
if((of) && (buffer)) {
eptr = NULL;
start = buffer;
@@ -204,7 +183,7 @@ dk3ma_print_double_c8_str_no_sci(FILE *of, char *buffer)
}
}
-#line 228 "dk3madfo.ctr"
+#line 229 "dk3madfo.ctr"
}
@@ -215,13 +194,13 @@ dk3ma_print_double_c8_no_sci(FILE *of, double x)
char buffer[64];
-#line 237 "dk3madfo.ctr"
+#line 238 "dk3madfo.ctr"
if(of) {
sprintf(buffer, "%g", x);
dk3ma_print_double_c8_str_no_sci(of, buffer);
}
-#line 241 "dk3madfo.ctr"
+#line 242 "dk3madfo.ctr"
}
diff --git a/support/dktools/dk3madfo.ctr b/support/dktools/dk3madfo.ctr
index ff2f98eb6d..d374908fe4 100644
--- a/support/dktools/dk3madfo.ctr
+++ b/support/dktools/dk3madfo.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -66,6 +66,7 @@ dk3ma_print_double_c8_no_sci(FILE *of, double x);
%% module
+#include "dk3conf.h"
#include "dk3ma.h"
#if DK3_HAVE_STDLIB_H
diff --git a/support/dktools/dk3madfo.h b/support/dktools/dk3madfo.h
index b6049f6b27..698df3e9be 100644
--- a/support/dktools/dk3madfo.h
+++ b/support/dktools/dk3madfo.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madfo.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madfo.ctr
*/
#ifndef DK3MADFO_H_INCLUDED
diff --git a/support/dktools/dk3madic.c b/support/dktools/dk3madic.c
index 8168f0748e..fabac4878f 100644
--- a/support/dktools/dk3madic.c
+++ b/support/dktools/dk3madic.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madic.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madic.ctr
*/
/** @file dk3madic.c The dk3madic module.
diff --git a/support/dktools/dk3madic.ctr b/support/dktools/dk3madic.ctr
index cc3360658d..3d84f2ad7b 100644
--- a/support/dktools/dk3madic.ctr
+++ b/support/dktools/dk3madic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3madic.h b/support/dktools/dk3madic.h
index 30fe041b7a..35cbf3b72a 100644
--- a/support/dktools/dk3madic.h
+++ b/support/dktools/dk3madic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madic.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madic.ctr
*/
#ifndef DK3MADIC_H_INCLUDED
diff --git a/support/dktools/dk3madlc.c b/support/dktools/dk3madlc.c
index 88257f1a07..cbcaf88582 100644
--- a/support/dktools/dk3madlc.c
+++ b/support/dktools/dk3madlc.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madlc.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madlc.ctr
*/
/** @file dk3madlc.c The dk3madlc module.
diff --git a/support/dktools/dk3madlc.ctr b/support/dktools/dk3madlc.ctr
index 4417aa426a..928893db51 100644
--- a/support/dktools/dk3madlc.ctr
+++ b/support/dktools/dk3madlc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3madlc.h b/support/dktools/dk3madlc.h
index 8f1f139b0b..24cfc70206 100644
--- a/support/dktools/dk3madlc.h
+++ b/support/dktools/dk3madlc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madlc.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madlc.ctr
*/
#ifndef DK3MADLC_H_INCLUDED
diff --git a/support/dktools/dk3madsc.c b/support/dktools/dk3madsc.c
index 06e502b2b7..b60266f308 100644
--- a/support/dktools/dk3madsc.c
+++ b/support/dktools/dk3madsc.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madsc.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madsc.ctr
*/
/** @file dk3madsc.c The dk3madsc module.
diff --git a/support/dktools/dk3madsc.ctr b/support/dktools/dk3madsc.ctr
index be4ccbf67b..9507dbf892 100644
--- a/support/dktools/dk3madsc.ctr
+++ b/support/dktools/dk3madsc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3madsc.h b/support/dktools/dk3madsc.h
index c5fc905446..9f5a82b460 100644
--- a/support/dktools/dk3madsc.h
+++ b/support/dktools/dk3madsc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madsc.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madsc.ctr
*/
#ifndef DK3MADSC_H_INCLUDED
diff --git a/support/dktools/dk3madsi.c b/support/dktools/dk3madsi.c
index 6929acc5e2..d60414abc9 100644
--- a/support/dktools/dk3madsi.c
+++ b/support/dktools/dk3madsi.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madsi.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madsi.ctr
*/
/** @file dk3madsi.c The dk3madsi module.
diff --git a/support/dktools/dk3madsi.ctr b/support/dktools/dk3madsi.ctr
index d180255699..8b98450e92 100644
--- a/support/dktools/dk3madsi.ctr
+++ b/support/dktools/dk3madsi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3madsi.h b/support/dktools/dk3madsi.h
index 99512bc5d8..1be7a94b1f 100644
--- a/support/dktools/dk3madsi.h
+++ b/support/dktools/dk3madsi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madsi.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madsi.ctr
*/
#ifndef DK3MADSI_H_INCLUDED
diff --git a/support/dktools/dk3madso.c b/support/dktools/dk3madso.c
index 04bbcb39be..255e2ff7b4 100644
--- a/support/dktools/dk3madso.c
+++ b/support/dktools/dk3madso.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madso.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madso.ctr
*/
/** @file dk3madso.c The dk3madso module.
diff --git a/support/dktools/dk3madso.ctr b/support/dktools/dk3madso.ctr
index 75d204c01e..638e1e697a 100644
--- a/support/dktools/dk3madso.ctr
+++ b/support/dktools/dk3madso.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3madso.h b/support/dktools/dk3madso.h
index 3f684d335f..560d5a057f 100644
--- a/support/dktools/dk3madso.h
+++ b/support/dktools/dk3madso.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3madso.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3madso.ctr
*/
#ifndef DK3MADSO_H_INCLUDED
diff --git a/support/dktools/dk3mafpe.c b/support/dktools/dk3mafpe.c
index 3c6c3858af..79560afe08 100644
--- a/support/dktools/dk3mafpe.c
+++ b/support/dktools/dk3mafpe.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mafpe.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mafpe.ctr
*/
/** @file dk3mafpe.c The dk3mafpe module.
diff --git a/support/dktools/dk3mafpe.ctr b/support/dktools/dk3mafpe.ctr
index cb6b6c3337..69e8f1a717 100644
--- a/support/dktools/dk3mafpe.ctr
+++ b/support/dktools/dk3mafpe.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3mafpe.h b/support/dktools/dk3mafpe.h
index 4ee576ed46..d2226b4e50 100644
--- a/support/dktools/dk3mafpe.h
+++ b/support/dktools/dk3mafpe.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mafpe.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mafpe.ctr
*/
#ifndef DK3MAFPE_H_INCLUDED
diff --git a/support/dktools/dk3mai.c b/support/dktools/dk3mai.c
index b515018885..e343bd8950 100644
--- a/support/dktools/dk3mai.c
+++ b/support/dktools/dk3mai.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mai.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mai.ctr
*/
/** @file dk3mai.c The dk3mai module.
diff --git a/support/dktools/dk3mai.ctr b/support/dktools/dk3mai.ctr
index 549310259f..061640e405 100644
--- a/support/dktools/dk3mai.ctr
+++ b/support/dktools/dk3mai.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3mai.h b/support/dktools/dk3mai.h
index ebb748ee51..0991d404f0 100644
--- a/support/dktools/dk3mai.h
+++ b/support/dktools/dk3mai.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mai.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mai.ctr
*/
#ifndef DK3MAI_H_INCLUDED
diff --git a/support/dktools/dk3maid8.c b/support/dktools/dk3maid8.c
index ab5ab1a7d4..7a6b2646b7 100644
--- a/support/dktools/dk3maid8.c
+++ b/support/dktools/dk3maid8.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maid8.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maid8.ctr
*/
/** @file dk3maid8.c The dk3maid8 module.
diff --git a/support/dktools/dk3maid8.ctr b/support/dktools/dk3maid8.ctr
index 77c799dcae..642c432eb2 100644
--- a/support/dktools/dk3maid8.ctr
+++ b/support/dktools/dk3maid8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3maid8.h b/support/dktools/dk3maid8.h
index 2ff3b8a2b0..f3ddb3e939 100644
--- a/support/dktools/dk3maid8.h
+++ b/support/dktools/dk3maid8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maid8.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maid8.ctr
*/
#ifndef DK3MAID8_H_INCLUDED
diff --git a/support/dktools/dk3maidd.c b/support/dktools/dk3maidd.c
index 341984107d..774570e2f5 100644
--- a/support/dktools/dk3maidd.c
+++ b/support/dktools/dk3maidd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maidd.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maidd.ctr
*/
/** @file dk3maidd.c The dk3maidd module.
@@ -48,7 +26,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 229 "dk3maidd.ctr"
-
+#if DK3_CHAR_SIZE > 1
/** Constant numeric values.
*/
static dk3_um_t const dk3maidd_um_array[] = {
@@ -89,8 +67,10 @@ static dk3_um_t const dk3maidd_um_array[] = {
/* 15 */ (dk3_um_t)15UL,
/* 16 */ (dk3_um_t)16UL
#endif
+/* if DK3_HAVE_LONG_LONG */
};
-
+#endif
+/* if DK3_CHAR_SIZE > 1 */
#if DK3_CHAR_SIZE > 1
@@ -132,7 +112,7 @@ dk3ma_um_from_string(dk3_um_t *rp, dkChar const *src, int *ec)
int action = 0; /* Action to take */
-#line 314 "dk3maidd.ctr"
+#line 316 "dk3maidd.ctr"
if ((NULL != rp) && (NULL != src)) {
ptr = dk3maidd_str_start(src);
if (NULL != ptr) {
@@ -192,10 +172,10 @@ dk3ma_um_from_string(dk3_um_t *rp, dkChar const *src, int *ec)
dk3ma_um_mul_ok(val, dk3maidd_um_array[0], &mec), op, &mec
);
-#line 372 "dk3maidd.ctr"
+#line 374 "dk3maidd.ctr"
if (0 != mec) {
-#line 373 "dk3maidd.ctr"
+#line 375 "dk3maidd.ctr"
cc = 0;
val = DK3_UM_MAX;
if (NULL != ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
@@ -204,7 +184,7 @@ dk3ma_um_from_string(dk3_um_t *rp, dkChar const *src, int *ec)
}
}
-#line 380 "dk3maidd.ctr"
+#line 382 "dk3maidd.ctr"
}
} else {
if (NULL != ec) { *ec = DK3_ERROR_SYNTAX; }
@@ -213,21 +193,21 @@ dk3ma_um_from_string(dk3_um_t *rp, dkChar const *src, int *ec)
#if DK3_ON_WINDOWS
-#line 387 "dk3maidd.ctr"
+#line 389 "dk3maidd.ctr"
#else
#if DK3_HAVE_INTMAX_T
-#line 390 "dk3maidd.ctr"
+#line 392 "dk3maidd.ctr"
#else
#if DK3_HAVE_LONG_LONG
-#line 393 "dk3maidd.ctr"
+#line 395 "dk3maidd.ctr"
#else
-#line 395 "dk3maidd.ctr"
+#line 397 "dk3maidd.ctr"
#endif
#endif
#endif
@@ -235,7 +215,7 @@ dk3ma_um_from_string(dk3_um_t *rp, dkChar const *src, int *ec)
if (NULL != ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 401 "dk3maidd.ctr"
+#line 403 "dk3maidd.ctr"
return back;
#else
return (dk3ma_um_from_c8_string(rp, src, ec));
diff --git a/support/dktools/dk3maidd.ctr b/support/dktools/dk3maidd.ctr
index 30563b4e44..67f0a509a4 100644
--- a/support/dktools/dk3maidd.ctr
+++ b/support/dktools/dk3maidd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -228,7 +228,7 @@ dk3ma_uintmax_t_from_string(uintmax_t *rp, dkChar const *src, int *ec);
$!trace-include
-
+#if DK3_CHAR_SIZE > 1
/** Constant numeric values.
*/
static dk3_um_t const dk3maidd_um_array[] = {
@@ -269,8 +269,10 @@ static dk3_um_t const dk3maidd_um_array[] = {
/* 15 */ (dk3_um_t)15UL,
/* 16 */ (dk3_um_t)16UL
#endif
+/* if DK3_HAVE_LONG_LONG */
};
-
+#endif
+/* if DK3_CHAR_SIZE > 1 */
#if DK3_CHAR_SIZE > 1
diff --git a/support/dktools/dk3maidd.h b/support/dktools/dk3maidd.h
index ad4db9f280..c022b35efd 100644
--- a/support/dktools/dk3maidd.h
+++ b/support/dktools/dk3maidd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maidd.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maidd.ctr
*/
#ifndef DK3MAIDD_H_INCLUDED
diff --git a/support/dktools/dk3maih8.c b/support/dktools/dk3maih8.c
index d50c8f0385..f37ec6e4f7 100644
--- a/support/dktools/dk3maih8.c
+++ b/support/dktools/dk3maih8.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maih8.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maih8.ctr
*/
/** @file dk3maih8.c The dk3maih8 module.
diff --git a/support/dktools/dk3maih8.ctr b/support/dktools/dk3maih8.ctr
index 29ecec837a..b52924e6cc 100644
--- a/support/dktools/dk3maih8.ctr
+++ b/support/dktools/dk3maih8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3maih8.h b/support/dktools/dk3maih8.h
index b08818e6a3..a734ad9179 100644
--- a/support/dktools/dk3maih8.h
+++ b/support/dktools/dk3maih8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maih8.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maih8.ctr
*/
#ifndef DK3MAIH8_H_INCLUDED
diff --git a/support/dktools/dk3maihd.c b/support/dktools/dk3maihd.c
index 09a4b16ce1..518f3a49df 100644
--- a/support/dktools/dk3maihd.c
+++ b/support/dktools/dk3maihd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maihd.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maihd.ctr
*/
/** @file dk3maihd.c The dk3maihd module.
@@ -48,7 +26,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 230 "dk3maihd.ctr"
-
+#if DK3_CHAR_SIZE > 1
/** Constant numeric values.
*/
static dk3_um_t const dk3maihd_um_array[] = {
@@ -89,7 +67,10 @@ static dk3_um_t const dk3maihd_um_array[] = {
/* 15 */ (dk3_um_t)15UL,
/* 16 */ (dk3_um_t)16UL
#endif
+/* if DK3_HAVE_LONG_LONG */
};
+#endif
+/* if DK3_CHAR_SIZE > 1 */
@@ -132,7 +113,7 @@ dk3ma_um_from_hex_string(dk3_um_t *rp, dkChar const *src, int *ec)
int action = 0; /* Action to take */
-#line 315 "dk3maihd.ctr"
+#line 318 "dk3maihd.ctr"
if ((NULL != rp) && (NULL != src)) {
ptr = dk3maihd_str_start(src);
if (NULL != ptr) {
@@ -210,10 +191,10 @@ dk3ma_um_from_hex_string(dk3_um_t *rp, dkChar const *src, int *ec)
dk3ma_um_mul_ok(val, dk3maihd_um_array[16], &mec), op, &mec
);
-#line 391 "dk3maihd.ctr"
+#line 394 "dk3maihd.ctr"
if (0 != mec) {
-#line 392 "dk3maihd.ctr"
+#line 395 "dk3maihd.ctr"
cc = 0;
val = DK3_UM_MAX;
if (NULL != ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
@@ -222,7 +203,7 @@ dk3ma_um_from_hex_string(dk3_um_t *rp, dkChar const *src, int *ec)
}
}
-#line 399 "dk3maihd.ctr"
+#line 402 "dk3maihd.ctr"
}
} else {
if (NULL != ec) { *ec = DK3_ERROR_SYNTAX; }
@@ -231,21 +212,21 @@ dk3ma_um_from_hex_string(dk3_um_t *rp, dkChar const *src, int *ec)
#if DK3_ON_WINDOWS
-#line 406 "dk3maihd.ctr"
+#line 409 "dk3maihd.ctr"
#else
#if DK3_HAVE_INTMAX_T
-#line 409 "dk3maihd.ctr"
+#line 412 "dk3maihd.ctr"
#else
#if DK3_HAVE_LONG_LONG
-#line 412 "dk3maihd.ctr"
+#line 415 "dk3maihd.ctr"
#else
-#line 414 "dk3maihd.ctr"
+#line 417 "dk3maihd.ctr"
#endif
#endif
#endif
@@ -253,7 +234,7 @@ dk3ma_um_from_hex_string(dk3_um_t *rp, dkChar const *src, int *ec)
if (NULL != ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 420 "dk3maihd.ctr"
+#line 423 "dk3maihd.ctr"
return back;
#else
return (dk3ma_um_from_c8_hex_string(rp, src, ec));
diff --git a/support/dktools/dk3maihd.ctr b/support/dktools/dk3maihd.ctr
index a3093beb5f..281877859d 100644
--- a/support/dktools/dk3maihd.ctr
+++ b/support/dktools/dk3maihd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -229,7 +229,7 @@ dk3ma_uintmax_t_from_hex_string(uintmax_t *rp, dkChar const *src, int *ec);
$!trace-include
-
+#if DK3_CHAR_SIZE > 1
/** Constant numeric values.
*/
static dk3_um_t const dk3maihd_um_array[] = {
@@ -270,7 +270,10 @@ static dk3_um_t const dk3maihd_um_array[] = {
/* 15 */ (dk3_um_t)15UL,
/* 16 */ (dk3_um_t)16UL
#endif
+/* if DK3_HAVE_LONG_LONG */
};
+#endif
+/* if DK3_CHAR_SIZE > 1 */
diff --git a/support/dktools/dk3maihd.h b/support/dktools/dk3maihd.h
index 6bb5615b31..d358b6dbff 100644
--- a/support/dktools/dk3maihd.h
+++ b/support/dktools/dk3maihd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maihd.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maihd.ctr
*/
#ifndef DK3MAIHD_H_INCLUDED
diff --git a/support/dktools/dk3mal.c b/support/dktools/dk3mal.c
index 8a12f8f8aa..d1e490f180 100644
--- a/support/dktools/dk3mal.c
+++ b/support/dktools/dk3mal.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mal.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mal.ctr
*/
/** @file dk3mal.c The dk3mal module.
diff --git a/support/dktools/dk3mal.ctr b/support/dktools/dk3mal.ctr
index 730cbf7b4e..1870c34422 100644
--- a/support/dktools/dk3mal.ctr
+++ b/support/dktools/dk3mal.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3mal.h b/support/dktools/dk3mal.h
index 3529255da7..d9e9344c27 100644
--- a/support/dktools/dk3mal.h
+++ b/support/dktools/dk3mal.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mal.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mal.ctr
*/
#ifndef DK3MAL_H_INCLUDED
diff --git a/support/dktools/dk3maod8.c b/support/dktools/dk3maod8.c
index afa4de204c..e3ae37daa8 100644
--- a/support/dktools/dk3maod8.c
+++ b/support/dktools/dk3maod8.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maod8.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maod8.ctr
*/
/** @file dk3maod8.c The dk3maod8 module.
diff --git a/support/dktools/dk3maod8.ctr b/support/dktools/dk3maod8.ctr
index 188845e042..c2f8cd24fa 100644
--- a/support/dktools/dk3maod8.ctr
+++ b/support/dktools/dk3maod8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3maod8.h b/support/dktools/dk3maod8.h
index da0e5b892c..eea610480c 100644
--- a/support/dktools/dk3maod8.h
+++ b/support/dktools/dk3maod8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maod8.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maod8.ctr
*/
#ifndef DK3MAOD8_H_INCLUDED
diff --git a/support/dktools/dk3maodd.c b/support/dktools/dk3maodd.c
index ef55e8ce7b..29f5095f63 100644
--- a/support/dktools/dk3maodd.c
+++ b/support/dktools/dk3maodd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maodd.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maodd.ctr
*/
/** @file dk3maodd.c The dk3maodd module.
diff --git a/support/dktools/dk3maodd.ctr b/support/dktools/dk3maodd.ctr
index 011bc04723..97cf46b35a 100644
--- a/support/dktools/dk3maodd.ctr
+++ b/support/dktools/dk3maodd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3maodd.h b/support/dktools/dk3maodd.h
index 5e02f404da..6918134ab1 100644
--- a/support/dktools/dk3maodd.h
+++ b/support/dktools/dk3maodd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maodd.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maodd.ctr
*/
#ifndef DK3MAODD_H_INCLUDED
diff --git a/support/dktools/dk3maoh8.c b/support/dktools/dk3maoh8.c
index 8e7a21e59d..d52077a7d8 100644
--- a/support/dktools/dk3maoh8.c
+++ b/support/dktools/dk3maoh8.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maoh8.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maoh8.ctr
*/
/** @file dk3maoh8.c The dk3maoh8 module.
diff --git a/support/dktools/dk3maoh8.ctr b/support/dktools/dk3maoh8.ctr
index b2aa479dc9..983ae9ea44 100644
--- a/support/dktools/dk3maoh8.ctr
+++ b/support/dktools/dk3maoh8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3maoh8.h b/support/dktools/dk3maoh8.h
index addf331dc9..b0bd9578b1 100644
--- a/support/dktools/dk3maoh8.h
+++ b/support/dktools/dk3maoh8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maoh8.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maoh8.ctr
*/
#ifndef DK3MAOH8_H_INCLUDED
diff --git a/support/dktools/dk3maohd.c b/support/dktools/dk3maohd.c
index 7d4f3f92b8..66438db779 100644
--- a/support/dktools/dk3maohd.c
+++ b/support/dktools/dk3maohd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maohd.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maohd.ctr
*/
/** @file dk3maohd.c The dk3maohd module.
diff --git a/support/dktools/dk3maohd.ctr b/support/dktools/dk3maohd.ctr
index cb87f0fc4e..5dac4dba2f 100644
--- a/support/dktools/dk3maohd.ctr
+++ b/support/dktools/dk3maohd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3maohd.h b/support/dktools/dk3maohd.h
index 57c713a9fc..f0bce17b8a 100644
--- a/support/dktools/dk3maohd.h
+++ b/support/dktools/dk3maohd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maohd.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maohd.ctr
*/
#ifndef DK3MAOHD_H_INCLUDED
diff --git a/support/dktools/dk3mas.c b/support/dktools/dk3mas.c
index 4482aa85bf..1406a4b3bd 100644
--- a/support/dktools/dk3mas.c
+++ b/support/dktools/dk3mas.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mas.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mas.ctr
*/
/** @file dk3mas.c The dk3mas module.
diff --git a/support/dktools/dk3mas.ctr b/support/dktools/dk3mas.ctr
index 2f1cf52714..1b44a38512 100644
--- a/support/dktools/dk3mas.ctr
+++ b/support/dktools/dk3mas.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3mas.h b/support/dktools/dk3mas.h
index b79bc872b0..6022fe1484 100644
--- a/support/dktools/dk3mas.h
+++ b/support/dktools/dk3mas.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mas.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mas.ctr
*/
#ifndef DK3MAS_H_INCLUDED
diff --git a/support/dktools/dk3masts.c b/support/dktools/dk3masts.c
index fe21a8c6d5..bbf1f67185 100644
--- a/support/dktools/dk3masts.c
+++ b/support/dktools/dk3masts.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3masts.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3masts.ctr
*/
/** @file dk3masts.c The dk3masts module.
@@ -43,12 +21,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
#include "dk3mem.h"
#include "dk3str.h"
+#include "dk3masts.h"
-#line 48 "dk3masts.ctr"
+#line 49 "dk3masts.ctr"
@@ -66,7 +45,7 @@ dk3ma_sz_from_string(size_t *rp, dkChar const *src, int *ec)
int done = 0; /* Flag: No conversion necessary */
-#line 64 "dk3masts.ctr"
+#line 65 "dk3masts.ctr"
if ((NULL != rp) && (NULL != src)) {
ptr = dk3str_start(src, NULL);
if (NULL != ptr) {
@@ -98,11 +77,11 @@ dk3ma_sz_from_string(size_t *rp, dkChar const *src, int *ec)
if (0 == myec) {
if (0 == done) {
-#line 94 "dk3masts.ctr"
+#line 95 "dk3masts.ctr"
if (0 != dk3ma_um_from_string(&convres, buffer, ec)) {
-#line 96 "dk3masts.ctr"
+#line 97 "dk3masts.ctr"
convres = dk3ma_um_mul_ok(convres, factor, &myec);
if ((dk3_um_t)DK3_SIZE_T_MAX >= convres) {
*rp = (size_t)convres;
@@ -110,80 +89,80 @@ dk3ma_sz_from_string(size_t *rp, dkChar const *src, int *ec)
#if DK3_ON_WINDOWS
-#line 102 "dk3masts.ctr"
+#line 103 "dk3masts.ctr"
#else
-#line 104 "dk3masts.ctr"
+#line 105 "dk3masts.ctr"
#endif
} else {
-#line 106 "dk3masts.ctr"
+#line 107 "dk3masts.ctr"
if (NULL != ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
}
} else {
-#line 109 "dk3masts.ctr"
+#line 110 "dk3masts.ctr"
}
} else {
-#line 111 "dk3masts.ctr"
+#line 112 "dk3masts.ctr"
convres = dk3ma_um_mul_ok(convres, factor, &myec);
if ((dk3_um_t)DK3_SIZE_T_MAX >= convres) {
*rp = (size_t)convres;
back = 1;
-#line 115 "dk3masts.ctr"
+#line 116 "dk3masts.ctr"
#if DK3_ON_WINDOWS
-#line 117 "dk3masts.ctr"
+#line 118 "dk3masts.ctr"
#else
-#line 119 "dk3masts.ctr"
+#line 120 "dk3masts.ctr"
#endif
} else {
-#line 121 "dk3masts.ctr"
+#line 122 "dk3masts.ctr"
if (NULL != ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
}
}
if (1 == back) {
if (0 != myec) {
-#line 126 "dk3masts.ctr"
+#line 127 "dk3masts.ctr"
back = 0;
if (NULL != ec) { *ec = myec; }
}
}
} else {
-#line 131 "dk3masts.ctr"
+#line 132 "dk3masts.ctr"
if (NULL != ec) { *ec = myec; }
}
} else {
-#line 134 "dk3masts.ctr"
+#line 135 "dk3masts.ctr"
if (NULL != ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
} else {
-#line 137 "dk3masts.ctr"
+#line 138 "dk3masts.ctr"
if (NULL != ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
} else {
-#line 140 "dk3masts.ctr"
+#line 141 "dk3masts.ctr"
if (NULL != ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
} else {
-#line 143 "dk3masts.ctr"
+#line 144 "dk3masts.ctr"
if (NULL != ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 145 "dk3masts.ctr"
+#line 146 "dk3masts.ctr"
return back;
}
diff --git a/support/dktools/dk3masts.ctr b/support/dktools/dk3masts.ctr
index 556d0f9b43..597b5c357d 100644
--- a/support/dktools/dk3masts.ctr
+++ b/support/dktools/dk3masts.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -41,6 +41,7 @@ dk3ma_sz_from_string(size_t *rp, dkChar const *src, int *ec);
#include <stdio.h>
#include "dk3mem.h"
#include "dk3str.h"
+#include "dk3masts.h"
diff --git a/support/dktools/dk3masts.h b/support/dktools/dk3masts.h
index 8e54363335..d8ab9ecab4 100644
--- a/support/dktools/dk3masts.h
+++ b/support/dktools/dk3masts.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3masts.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3masts.ctr
*/
#ifndef DK3MASTS_H_INCLUDED
diff --git a/support/dktools/dk3maui.c b/support/dktools/dk3maui.c
index 6e56eddc8e..aa7ef73795 100644
--- a/support/dktools/dk3maui.c
+++ b/support/dktools/dk3maui.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maui.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maui.ctr
*/
/** @file dk3maui.c The dk3maui module.
diff --git a/support/dktools/dk3maui.ctr b/support/dktools/dk3maui.ctr
index da637fd464..029f01169b 100644
--- a/support/dktools/dk3maui.ctr
+++ b/support/dktools/dk3maui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3maui.h b/support/dktools/dk3maui.h
index 032f00b733..c78fcfa3f0 100644
--- a/support/dktools/dk3maui.h
+++ b/support/dktools/dk3maui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maui.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maui.ctr
*/
#ifndef DK3MAUI_H_INCLUDED
diff --git a/support/dktools/dk3maul.c b/support/dktools/dk3maul.c
index 104f5902cd..d035f5b986 100644
--- a/support/dktools/dk3maul.c
+++ b/support/dktools/dk3maul.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maul.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maul.ctr
*/
/** @file dk3maul.c The dk3maul module.
@@ -42,12 +20,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3ma.h"
+#include "dk3unused.h"
-#line 279 "dk3maul.ctr"
+#line 280 "dk3maul.ctr"
@@ -56,14 +35,14 @@ dk3ma_ul_add_ok(unsigned long a, unsigned long b, int *ec)
{
-#line 286 "dk3maul.ctr"
+#line 287 "dk3maul.ctr"
if (NULL != ec) {
-#line 287 "dk3maul.ctr"
+#line 288 "dk3maul.ctr"
if ((DK3_UL_MAX - a) < b) { *ec = DK3_ERROR_MATH_OVERFLOW; }
}
-#line 289 "dk3maul.ctr"
+#line 290 "dk3maul.ctr"
return (a + b);
}
@@ -74,11 +53,11 @@ dk3ma_ul_sub_ok(unsigned long a, unsigned long b, int *ec)
{
-#line 298 "dk3maul.ctr"
+#line 299 "dk3maul.ctr"
if (NULL != ec) {
if (b > a) {
-#line 300 "dk3maul.ctr"
+#line 301 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
@@ -92,18 +71,18 @@ dk3ma_ul_mul_ok(unsigned long a, unsigned long b, int *ec)
{
-#line 312 "dk3maul.ctr"
+#line 313 "dk3maul.ctr"
if (NULL != ec) {
if (0UL != a) {
if ((DK3_UL_MAX / a) < b) {
-#line 315 "dk3maul.ctr"
+#line 316 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
}
-#line 319 "dk3maul.ctr"
+#line 320 "dk3maul.ctr"
return (a * b);
}
@@ -112,22 +91,22 @@ dk3ma_ul_mul_ok(unsigned long a, unsigned long b, int *ec)
unsigned long
dk3ma_ul_div_ok(unsigned long a, unsigned long b, int *ec)
{
- unsigned long back = (unsigned long)0;
+ unsigned long back = 0UL;
-#line 329 "dk3maul.ctr"
+#line 330 "dk3maul.ctr"
if (0UL != b) {
back = a / b;
} else {
if (NULL != ec) {
-#line 333 "dk3maul.ctr"
+#line 334 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_DIVZERO;
}
back = DK3_UL_MAX;
}
-#line 337 "dk3maul.ctr"
+#line 338 "dk3maul.ctr"
return back;
}
@@ -139,7 +118,7 @@ dk3ma_ul_gcd(unsigned long a, unsigned long b)
unsigned long h;
-#line 347 "dk3maul.ctr"
+#line 348 "dk3maul.ctr"
while (0UL < b) {
h = a % b;
a = b;
@@ -147,7 +126,7 @@ dk3ma_ul_gcd(unsigned long a, unsigned long b)
}
if (0UL == a) { a = 1UL; }
-#line 353 "dk3maul.ctr"
+#line 354 "dk3maul.ctr"
return a;
}
@@ -161,27 +140,27 @@ dk3ma_ull_add_ok(unsigned long long a, unsigned long long b, int *ec)
#if DK3_ON_WINDOWS
-#line 365 "dk3maul.ctr"
+#line 366 "dk3maul.ctr"
#else
-#line 367 "dk3maul.ctr"
+#line 368 "dk3maul.ctr"
#endif
if (NULL != ec) {
if ((DK3_ULL_MAX - a) < b) {
-#line 370 "dk3maul.ctr"
+#line 371 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
#if DK3_ON_WINDOWS
-#line 375 "dk3maul.ctr"
+#line 376 "dk3maul.ctr"
#else
-#line 377 "dk3maul.ctr"
+#line 378 "dk3maul.ctr"
#endif
return (a + b);
}
@@ -194,27 +173,27 @@ dk3ma_ull_sub_ok(unsigned long long a, unsigned long long b, int *ec)
#if DK3_ON_WINDOWS
-#line 388 "dk3maul.ctr"
+#line 389 "dk3maul.ctr"
#else
-#line 390 "dk3maul.ctr"
+#line 391 "dk3maul.ctr"
#endif
if (NULL != ec) {
if (b > a) {
-#line 393 "dk3maul.ctr"
+#line 394 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
#if DK3_ON_WINDOWS
-#line 398 "dk3maul.ctr"
+#line 399 "dk3maul.ctr"
#else
-#line 400 "dk3maul.ctr"
+#line 401 "dk3maul.ctr"
#endif
return (a - b);
}
@@ -227,27 +206,27 @@ dk3ma_ull_mul_ok(unsigned long long a, unsigned long long b, int *ec)
#if DK3_ON_WINDOWS
-#line 411 "dk3maul.ctr"
+#line 412 "dk3maul.ctr"
#else
-#line 413 "dk3maul.ctr"
+#line 414 "dk3maul.ctr"
#endif
if (NULL != ec) {
if (0ULL != a) {
-#line 416 "dk3maul.ctr"
+#line 417 "dk3maul.ctr"
if ((DK3_ULL_MAX / a) < b) { *ec = DK3_ERROR_MATH_OVERFLOW; }
}
}
#if DK3_ON_WINDOWS
-#line 421 "dk3maul.ctr"
+#line 422 "dk3maul.ctr"
#else
-#line 423 "dk3maul.ctr"
+#line 424 "dk3maul.ctr"
#endif
return (a * b);
}
@@ -261,18 +240,18 @@ dk3ma_ull_div_ok(unsigned long long a, unsigned long long b, int *ec)
#if DK3_ON_WINDOWS
-#line 435 "dk3maul.ctr"
+#line 436 "dk3maul.ctr"
#else
-#line 437 "dk3maul.ctr"
+#line 438 "dk3maul.ctr"
#endif
if (0ULL != b) {
back = a / b;
} else {
if (NULL != ec) {
-#line 442 "dk3maul.ctr"
+#line 443 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_DIVZERO;
}
back = DK3_ULL_MAX;
@@ -280,11 +259,11 @@ dk3ma_ull_div_ok(unsigned long long a, unsigned long long b, int *ec)
#if DK3_ON_WINDOWS
-#line 448 "dk3maul.ctr"
+#line 449 "dk3maul.ctr"
#else
-#line 450 "dk3maul.ctr"
+#line 451 "dk3maul.ctr"
#endif
return back;
}
@@ -298,11 +277,11 @@ dk3ma_ull_gcd(unsigned long long a, unsigned long long b)
#if DK3_ON_WINDOWS
-#line 462 "dk3maul.ctr"
+#line 463 "dk3maul.ctr"
#else
-#line 464 "dk3maul.ctr"
+#line 465 "dk3maul.ctr"
#endif
while (0ULL < b) {
h = a % b;
@@ -313,11 +292,11 @@ dk3ma_ull_gcd(unsigned long long a, unsigned long long b)
#if DK3_ON_WINDOWS
-#line 473 "dk3maul.ctr"
+#line 474 "dk3maul.ctr"
#else
-#line 475 "dk3maul.ctr"
+#line 476 "dk3maul.ctr"
#endif
return a;
}
@@ -335,27 +314,27 @@ dk3ma_uintmax_t_add_ok(uintmax_t a, uintmax_t b, int *ec)
#if DK3_ON_WINDOWS
-#line 491 "dk3maul.ctr"
+#line 492 "dk3maul.ctr"
#else
-#line 493 "dk3maul.ctr"
+#line 494 "dk3maul.ctr"
#endif
if (NULL != ec) {
if ((DK3_UINTMAX_T_MAX - a) < b) {
-#line 496 "dk3maul.ctr"
+#line 497 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
#if DK3_ON_WINDOWS
-#line 501 "dk3maul.ctr"
+#line 502 "dk3maul.ctr"
#else
-#line 503 "dk3maul.ctr"
+#line 504 "dk3maul.ctr"
#endif
return (a + b);
}
@@ -368,27 +347,27 @@ dk3ma_uintmax_t_sub_ok(uintmax_t a, uintmax_t b, int *ec)
#if DK3_ON_WINDOWS
-#line 514 "dk3maul.ctr"
+#line 515 "dk3maul.ctr"
#else
-#line 516 "dk3maul.ctr"
+#line 517 "dk3maul.ctr"
#endif
if (NULL != ec) {
if (b > a) {
-#line 519 "dk3maul.ctr"
+#line 520 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
#if DK3_ON_WINDOWS
-#line 524 "dk3maul.ctr"
+#line 525 "dk3maul.ctr"
#else
-#line 526 "dk3maul.ctr"
+#line 527 "dk3maul.ctr"
#endif
return (a - b);
}
@@ -401,17 +380,17 @@ dk3ma_uintmax_t_mul_ok(uintmax_t a, uintmax_t b, int *ec)
#if DK3_ON_WINDOWS
-#line 537 "dk3maul.ctr"
+#line 538 "dk3maul.ctr"
#else
-#line 539 "dk3maul.ctr"
+#line 540 "dk3maul.ctr"
#endif
if (NULL != ec) {
if (DK3_UINTMAX_T_0 != a) {
if ((DK3_UINTMAX_T_MAX / a) < b) {
-#line 543 "dk3maul.ctr"
+#line 544 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_OVERFLOW;
}
}
@@ -419,11 +398,11 @@ dk3ma_uintmax_t_mul_ok(uintmax_t a, uintmax_t b, int *ec)
#if DK3_ON_WINDOWS
-#line 549 "dk3maul.ctr"
+#line 550 "dk3maul.ctr"
#else
-#line 551 "dk3maul.ctr"
+#line 552 "dk3maul.ctr"
#endif
return (a * b);
}
@@ -437,18 +416,18 @@ dk3ma_uintmax_t_div_ok(uintmax_t a, uintmax_t b, int *ec)
#if DK3_ON_WINDOWS
-#line 563 "dk3maul.ctr"
+#line 564 "dk3maul.ctr"
#else
-#line 565 "dk3maul.ctr"
+#line 566 "dk3maul.ctr"
#endif
if (DK3_UINTMAX_T_0 != b) {
back = a / b;
} else {
if (NULL != ec) {
-#line 570 "dk3maul.ctr"
+#line 571 "dk3maul.ctr"
*ec = DK3_ERROR_MATH_DIVZERO;
}
back = DK3_UINTMAX_T_MAX;
@@ -456,11 +435,11 @@ dk3ma_uintmax_t_div_ok(uintmax_t a, uintmax_t b, int *ec)
#if DK3_ON_WINDOWS
-#line 576 "dk3maul.ctr"
+#line 577 "dk3maul.ctr"
#else
-#line 578 "dk3maul.ctr"
+#line 579 "dk3maul.ctr"
#endif
return back;
}
@@ -474,11 +453,11 @@ dk3ma_uintmax_t_gcd(uintmax_t a, uintmax_t b)
#if DK3_ON_WINDOWS
-#line 590 "dk3maul.ctr"
+#line 591 "dk3maul.ctr"
#else
-#line 592 "dk3maul.ctr"
+#line 593 "dk3maul.ctr"
#endif
while (DK3_UINTMAX_T_0 < b) {
h = a % b;
@@ -489,11 +468,11 @@ dk3ma_uintmax_t_gcd(uintmax_t a, uintmax_t b)
#if DK3_ON_WINDOWS
-#line 601 "dk3maul.ctr"
+#line 602 "dk3maul.ctr"
#else
-#line 603 "dk3maul.ctr"
+#line 604 "dk3maul.ctr"
#endif
return a;
}
@@ -584,9 +563,11 @@ dk3ma_um_gcd(dk3_um_t a, dk3_um_t b)
size_t
-dk3ma_um_to_sz(dk3_um_t um, int *ec)
+dk3ma_um_to_sz(dk3_um_t um, int * DK3_ARG_UNUSED(ec) )
{
size_t back = 0;
+
+ DK3_UNUSED_ARG(ec)
#if DK3_SIZEOF_SIZE_T >= DK3_SIZEOF_UM
back = (size_t)um;
#else
diff --git a/support/dktools/dk3maul.ctr b/support/dktools/dk3maul.ctr
index 72d803d1cd..2462c97dab 100644
--- a/support/dktools/dk3maul.ctr
+++ b/support/dktools/dk3maul.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -272,6 +272,7 @@ dk3ma_um_to_sz(dk3_um_t um, int *ec);
#include "dk3ma.h"
+#include "dk3unused.h"
@@ -324,7 +325,7 @@ dk3ma_ul_mul_ok(unsigned long a, unsigned long b, int *ec)
unsigned long
dk3ma_ul_div_ok(unsigned long a, unsigned long b, int *ec)
{
- unsigned long back = (unsigned long)0;
+ unsigned long back = 0UL;
$? "+ dk3ma_ul_div_ok %lu %lu", a, b
if (0UL != b) {
back = a / b;
@@ -690,9 +691,11 @@ dk3ma_um_gcd(dk3_um_t a, dk3_um_t b)
size_t
-dk3ma_um_to_sz(dk3_um_t um, int *ec)
+dk3ma_um_to_sz(dk3_um_t um, int * DK3_ARG_UNUSED(ec) )
{
size_t back = 0;
+
+ DK3_UNUSED_ARG(ec)
#if DK3_SIZEOF_SIZE_T >= DK3_SIZEOF_UM
back = (size_t)um;
#else
diff --git a/support/dktools/dk3maul.h b/support/dktools/dk3maul.h
index 809bcdd255..1a0034f08a 100644
--- a/support/dktools/dk3maul.h
+++ b/support/dktools/dk3maul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maul.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maul.ctr
*/
#ifndef DK3MAUL_H_INCLUDED
diff --git a/support/dktools/dk3maus.c b/support/dktools/dk3maus.c
index 97fc88e944..76445ff576 100644
--- a/support/dktools/dk3maus.c
+++ b/support/dktools/dk3maus.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maus.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maus.ctr
*/
/** @file dk3maus.c The dk3maus module.
diff --git a/support/dktools/dk3maus.ctr b/support/dktools/dk3maus.ctr
index cfbb8cff15..eacbd3a364 100644
--- a/support/dktools/dk3maus.ctr
+++ b/support/dktools/dk3maus.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3maus.h b/support/dktools/dk3maus.h
index 3f6f91b984..9415d28b36 100644
--- a/support/dktools/dk3maus.h
+++ b/support/dktools/dk3maus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3maus.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3maus.ctr
*/
#ifndef DK3MAUS_H_INCLUDED
diff --git a/support/dktools/dk3md.c b/support/dktools/dk3md.c
index 1be6062877..32d223d240 100644
--- a/support/dktools/dk3md.c
+++ b/support/dktools/dk3md.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3md.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3md.ctr
*/
/** @file dk3md.c The dk3md module.
diff --git a/support/dktools/dk3md.ctr b/support/dktools/dk3md.ctr
index 28f3b52605..aa69322934 100644
--- a/support/dktools/dk3md.ctr
+++ b/support/dktools/dk3md.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3md.h b/support/dktools/dk3md.h
index ddbd24514d..5d765f02ab 100644
--- a/support/dktools/dk3md.h
+++ b/support/dktools/dk3md.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3md.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3md.ctr
*/
/** @file dk3md.h Header file for the dk3md module.
diff --git a/support/dktools/dk3mem.c b/support/dktools/dk3mem.c
index 43681a09b1..ee033ae176 100644
--- a/support/dktools/dk3mem.c
+++ b/support/dktools/dk3mem.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mem.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mem.ctr
*/
/** @file dk3mem.c The dk3mem module.
@@ -153,7 +131,7 @@ dk3mem_malloc_app(size_t sz, dk3_app_t *app)
#line 275 "dk3mem.ctr"
if(0 != sz) {
-#if DK3_ON_WINDOWS && (_MSC_VER > 1100)
+#if DK3_ON_WINDOWS && (defined(_MSC_VER)) && (_MSC_VER > 1100)
#line 278 "dk3mem.ctr"
@@ -309,7 +287,7 @@ dk3mem_free (void *po)
/* {{{ */
{
if(NULL != po) {
-#if DK3_ON_WINDOWS && (_MSC_VER > 1100)
+#if DK3_ON_WINDOWS && (defined(_MSC_VER)) && (_MSC_VER > 1100)
LocalFree((HLOCAL)po);
#else
#if DK3_HAVE_MALLOC && DK3_HAVE_FREE
@@ -323,7 +301,9 @@ dk3mem_free (void *po)
int
dk3mem_reset_secure(void *mp, size_t sz)
{
+#if !DK3_ON_WINDOWS
char *ptr;
+#endif
int back = 0;
if ((NULL != mp) && (0 < sz)) {
#if DK3_ON_WINDOWS
diff --git a/support/dktools/dk3mem.ctr b/support/dktools/dk3mem.ctr
index 87037412af..b5b4a50948 100644
--- a/support/dktools/dk3mem.ctr
+++ b/support/dktools/dk3mem.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -143,22 +143,22 @@ dk3mem_add_size_t(size_t a, size_t b, int *ec);
#define dk3_new_app(t,s,a) ((t *)dk3mem_alloc_app(sizeof(t),(size_t)(s),(a)))
/** Release memory.
- * @param po Pointer to memory to release.
+ * @param ptr Pointer to memory to release.
*/
-#define dk3_delete(po) \
-do { if(po) { dk3mem_free((void *)(po)); } } while(0)
+#define dk3_delete(ptr) \
+do { if(ptr) { dk3mem_free((void *)(ptr)); } } while(0)
/** Release memory.
- * @param po Pointer to memory to release.
+ * @param ptr Pointer to memory to release.
*/
-#define dk3_release(po) \
-do { if(po) { dk3mem_free((void *)(po)); } po = NULL; } while(0)
+#define dk3_release(ptr) \
+do { if(NULL != ptr) { dk3mem_free((void *)(ptr)); } ptr = NULL; } while(0)
/** Release C++ object.
- * @param po Object pointer.
+ * @param ptr Object pointer.
*/
-#define dk3_cpp_release(po) \
-do { if(po) { delete(po); } po = NULL; } while(0)
+#define dk3_cpp_release(ptr) \
+do { if(NULL != ptr) { delete(ptr); } ptr = NULL; } while(0)
@@ -273,7 +273,7 @@ dk3mem_malloc_app(size_t sz, dk3_app_t *app)
dkChar dkbuffer[64]; /* Buffer to show number of bytes. */
$? "+ dk3mem_malloc %u", (unsigned)sz
if(0 != sz) {
-#if DK3_ON_WINDOWS && (_MSC_VER > 1100)
+#if DK3_ON_WINDOWS && (defined(_MSC_VER)) && (_MSC_VER > 1100)
$? ". use LocalAlloc"
back = (void *)LocalAlloc((LMEM_FIXED | LMEM_ZEROINIT), sz);
#else
@@ -411,7 +411,7 @@ dk3mem_free (void *po)
/* {{{ */
{
if(NULL != po) {
-#if DK3_ON_WINDOWS && (_MSC_VER > 1100)
+#if DK3_ON_WINDOWS && (defined(_MSC_VER)) && (_MSC_VER > 1100)
LocalFree((HLOCAL)po);
#else
#if DK3_HAVE_MALLOC && DK3_HAVE_FREE
@@ -425,7 +425,9 @@ dk3mem_free (void *po)
int
dk3mem_reset_secure(void *mp, size_t sz)
{
+#if !DK3_ON_WINDOWS
char *ptr;
+#endif
int back = 0;
if ((NULL != mp) && (0 < sz)) {
#if DK3_ON_WINDOWS
diff --git a/support/dktools/dk3mem.h b/support/dktools/dk3mem.h
index aa6b231ecb..ac60c47e4c 100644
--- a/support/dktools/dk3mem.h
+++ b/support/dktools/dk3mem.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3mem.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3mem.ctr
*/
/** @file dk3mem.h Header file for the dk3mem module.
@@ -178,22 +156,22 @@ dk3mem_add_size_t(size_t a, size_t b, int *ec);
#define dk3_new_app(t,s,a) ((t *)dk3mem_alloc_app(sizeof(t),(size_t)(s),(a)))
/** Release memory.
- * @param po Pointer to memory to release.
+ * @param ptr Pointer to memory to release.
*/
-#define dk3_delete(po) \
-do { if(po) { dk3mem_free((void *)(po)); } } while(0)
+#define dk3_delete(ptr) \
+do { if(ptr) { dk3mem_free((void *)(ptr)); } } while(0)
/** Release memory.
- * @param po Pointer to memory to release.
+ * @param ptr Pointer to memory to release.
*/
-#define dk3_release(po) \
-do { if(po) { dk3mem_free((void *)(po)); } po = NULL; } while(0)
+#define dk3_release(ptr) \
+do { if(NULL != ptr) { dk3mem_free((void *)(ptr)); } ptr = NULL; } while(0)
/** Release C++ object.
- * @param po Object pointer.
+ * @param ptr Object pointer.
*/
-#define dk3_cpp_release(po) \
-do { if(po) { delete(po); } po = NULL; } while(0)
+#define dk3_cpp_release(ptr) \
+do { if(NULL != ptr) { delete(ptr); } ptr = NULL; } while(0)
diff --git a/support/dktools/dk3nettp.h b/support/dktools/dk3nettp.h
index 90867028fd..33288798c2 100644
--- a/support/dktools/dk3nettp.h
+++ b/support/dktools/dk3nettp.h
@@ -1,9 +1,14 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK3NETTP_H_INCLUDED
#define DK3NETTP_H_INCLUDED 1
-
+#ifndef DK3_ALL_H_INCLUDED
#include <dk3all.h>
+#endif
diff --git a/support/dktools/dk3numco.h b/support/dktools/dk3numco.h
index b5b1e1c4ab..5ec004d146 100644
--- a/support/dktools/dk3numco.h
+++ b/support/dktools/dk3numco.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK3NUMCO_H_INCLUDED
#define DK3NUMCO_H_INCLUDED 1
diff --git a/support/dktools/dk3of.c b/support/dktools/dk3of.c
index 1e6171f4c5..18b4d1415a 100644
--- a/support/dktools/dk3of.c
+++ b/support/dktools/dk3of.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3of.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3of.ctr
*/
/** @file dk3of.c The dk3of module.
@@ -456,20 +434,19 @@ dk3of_nl_from_cell(dk3_of_t *of, dk3_of_cell_t *cellptr)
/** Write data from ASCII85 encoding cell downwards.
- @param of Output filter.
@param cp Pointer to cell.
@return 1 on success, 0 on error.
*/
static
int
-dk3of_write_a85_cell(dk3_of_t *of, dk3_of_cell_t *cp)
+dk3of_write_a85_cell(dk3_of_cell_t *cp)
{
int back = 0;
unsigned long v;
unsigned char bu[5];
-#line 538 "dk3of.ctr"
+#line 537 "dk3of.ctr"
if((cp->data).a85.nc > 0) {
v = (cp->data).a85.val;
bu[0] = (unsigned char)(33UL + v / dk3of_a85_factors[0]);
@@ -482,26 +459,25 @@ dk3of_write_a85_cell(dk3_of_t *of, dk3_of_cell_t *cp)
v = v % dk3of_a85_factors[3];
bu[4] = (unsigned char)(33UL + v);
-#line 549 "dk3of.ctr"
+#line 548 "dk3of.ctr"
back = dk3of_bytes_from_cell(cp, bu, (1 + (cp->data).a85.nc));
} else {
back = 1;
}
-#line 553 "dk3of.ctr"
+#line 552 "dk3of.ctr"
return back;
}
/** Save a run.
- @param of Output filter.
@param cp Filter cell.
@return 1 on success, 0 on error.
*/
static
int
-dk3of_psrl_save_run(dk3_of_t *of, dk3_of_cell_t *cp)
+dk3of_psrl_save_run(dk3_of_cell_t *cp)
{
int back = 0;
size_t sz;
@@ -537,7 +513,7 @@ dk3of_psrl_save_data(dk3_of_t *of, dk3_of_cell_t *cp, int final)
size_t lgt;
-#line 600 "dk3of.ctr"
+#line 598 "dk3of.ctr"
if(final) {
/*
Save data as is.
@@ -561,7 +537,7 @@ dk3of_psrl_save_data(dk3_of_t *of, dk3_of_cell_t *cp, int final)
if(((cp->data).psrl.same) < ((cp->data).psrl.used)) {
lgt = (cp->data).psrl.used - (cp->data).psrl.same - 1;
-#line 622 "dk3of.ctr"
+#line 620 "dk3of.ctr"
if(lgt > 0) {
c = (unsigned char)(lgt - 1);
if(dk3of_bytes_from_cell(cp, &c, 1)) {
@@ -576,26 +552,26 @@ dk3of_psrl_save_data(dk3_of_t *of, dk3_of_cell_t *cp, int final)
if((cp->data).psrl.same >= 1) {
(cp->data).psrl.run = 0x01;
-#line 635 "dk3of.ctr"
+#line 633 "dk3of.ctr"
}
} else {
back = 1; /* Nothing to do here. */
if((cp->data).psrl.same > 1) {
(cp->data).psrl.run = 0x01;
-#line 640 "dk3of.ctr"
+#line 638 "dk3of.ctr"
}
}
} else {
-#line 643 "dk3of.ctr"
+#line 641 "dk3of.ctr"
}
} else {
back = dk3of_psrl_save_data(of, cp, 1);
}
}
-#line 648 "dk3of.ctr"
+#line 646 "dk3of.ctr"
return back;
}
@@ -612,7 +588,7 @@ dk3of_end_chunk(dk3_of_t *of)
int res;
-#line 663 "dk3of.ctr"
+#line 661 "dk3of.ctr"
if(of) {
if(of->top) {
back = dk3of_flush_bits(of);
@@ -631,7 +607,7 @@ dk3of_end_chunk(dk3_of_t *of)
}
} break;
case DK3_OF_CELL_TYPE_A85: {
- if(!dk3of_write_a85_cell(of, cellptr)) {
+ if(!dk3of_write_a85_cell(cellptr)) {
back = 0;
}
if((of->flags) & DK3_OF_FLAG_FINALIZE) {
@@ -647,7 +623,7 @@ dk3of_end_chunk(dk3_of_t *of)
case DK3_OF_CELL_TYPE_RUN_LENGTH: {
if((cellptr->data).psrl.bu) {
if((cellptr->data).psrl.run) {
- if(!dk3of_psrl_save_run(of, cellptr)) {
+ if(!dk3of_psrl_save_run(cellptr)) {
back = 0;
}
} else {
@@ -732,7 +708,7 @@ dk3of_end_chunk(dk3_of_t *of)
}
}
-#line 781 "dk3of.ctr"
+#line 779 "dk3of.ctr"
return back;
}
@@ -749,7 +725,7 @@ dk3of_bytes_from_cell(dk3_of_cell_t *cp, unsigned char const *bu, size_t sz)
size_t bw;
-#line 796 "dk3of.ctr"
+#line 794 "dk3of.ctr"
if((cp) && (bu) && (sz)) {
#if VERSION_BEFORE_20150821
of = NULL; app = NULL;
@@ -761,11 +737,11 @@ dk3of_bytes_from_cell(dk3_of_cell_t *cp, unsigned char const *bu, size_t sz)
#endif
if(cp->down) {
-#line 806 "dk3of.ctr"
+#line 804 "dk3of.ctr"
back = dk3of_bytes_to_cell(cp->down, bu, sz);
} else {
-#line 808 "dk3of.ctr"
+#line 806 "dk3of.ctr"
if(of->os) {
bw = dk3stream_write_bytes(of->os, (char const *)bu, sz);
if(bw == sz) {
@@ -773,18 +749,18 @@ dk3of_bytes_from_cell(dk3_of_cell_t *cp, unsigned char const *bu, size_t sz)
}
} else {
-#line 814 "dk3of.ctr"
+#line 812 "dk3of.ctr"
/* BUG: Output filter has no destination stream! */
}
}
} else {
-#line 818 "dk3of.ctr"
+#line 816 "dk3of.ctr"
/* BUG: Missing output filter pointer! */
}
}
-#line 821 "dk3of.ctr"
+#line 819 "dk3of.ctr"
return back;
}
@@ -812,12 +788,12 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
unsigned char b[5];
-#line 847 "dk3of.ctr"
+#line 845 "dk3of.ctr"
of = (dk3_of_t *)(cp->of);
switch(cp->type) {
case DK3_OF_CELL_TYPE_HEX: {
-#line 850 "dk3of.ctr"
+#line 848 "dk3of.ctr"
u1 = (size_t)uc;
u2 = (size_t)uc;
u1 = (u1 >> 4) & 0x000FU;
@@ -839,8 +815,9 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
} break;
case DK3_OF_CELL_TYPE_A85: {
-#line 870 "dk3of.ctr"
+#line 868 "dk3of.ctr"
ul = (unsigned long)uc;
+ ul &= 0x000000FFUL;
switch((cp->data).a85.nc) {
case 0: {
ul = ((ul << 24) & 0xFF000000UL);
@@ -859,7 +836,7 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
(cp->data).a85.nc += 1;
back = 1;
if((cp->data).a85.nc >= 4) {
- back = dk3of_write_a85_cell(of, cp);
+ back = dk3of_write_a85_cell(cp);
(cp->data).a85.nc = 0;
(cp->data).a85.val = 0UL;
(cp->data).a85.nl += 1;
@@ -873,26 +850,26 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
} break;
case DK3_OF_CELL_TYPE_RUN_LENGTH: {
-#line 902 "dk3of.ctr"
+#line 901 "dk3of.ctr"
back = 1;
if((cp->data).psrl.run) {
-#line 904 "dk3of.ctr"
+#line 903 "dk3of.ctr"
if(uc == (cp->data).psrl.pc) {
-#line 905 "dk3of.ctr"
+#line 904 "dk3of.ctr"
((cp->data).psrl.bu)[(cp->data).psrl.used] = uc;
(cp->data).psrl.used += 1;
(cp->data).psrl.same += 1;
if((cp->data).psrl.used >= 127) {
- if(!dk3of_psrl_save_run(of, cp)) {
+ if(!dk3of_psrl_save_run(cp)) {
back = 0;
}
}
} else {
-#line 914 "dk3of.ctr"
- if(!dk3of_psrl_save_run(of, cp)) {
+#line 913 "dk3of.ctr"
+ if(!dk3of_psrl_save_run(cp)) {
back = 0;
}
((cp->data).psrl.bu)[0] = uc;
@@ -902,26 +879,26 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
}
} else {
-#line 923 "dk3of.ctr"
+#line 922 "dk3of.ctr"
((cp->data).psrl.bu)[(cp->data).psrl.used] = uc;
(cp->data).psrl.used += 1;
if((cp->data).psrl.hc) {
-#line 926 "dk3of.ctr"
+#line 925 "dk3of.ctr"
if(uc == (cp->data).psrl.pc) {
-#line 927 "dk3of.ctr"
+#line 926 "dk3of.ctr"
(cp->data).psrl.same += 1;
-#line 928 "dk3of.ctr"
+#line 927 "dk3of.ctr"
} else {
-#line 929 "dk3of.ctr"
+#line 928 "dk3of.ctr"
(cp->data).psrl.same = 0;
}
} else {
-#line 932 "dk3of.ctr"
+#line 931 "dk3of.ctr"
(cp->data).psrl.same = 0;
}
(cp->data).psrl.hc = 0x01;
@@ -933,11 +910,11 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
}
}
-#line 942 "dk3of.ctr"
+#line 941 "dk3of.ctr"
} break;
case DK3_OF_CELL_TYPE_FLATE: {
-#line 944 "dk3of.ctr"
+#line 943 "dk3of.ctr"
#if DK3_HAVE_ZLIB_H
if((cp->data).flate.ok) {
back = 1;
@@ -987,7 +964,7 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
} break;
}
-#line 992 "dk3of.ctr"
+#line 991 "dk3of.ctr"
return back;
}
@@ -1001,7 +978,7 @@ dk3of_bytes_to_cell(dk3_of_cell_t *cp, unsigned char const *bu, size_t sz)
unsigned char const *ptr;
-#line 1004 "dk3of.ctr"
+#line 1003 "dk3of.ctr"
if((NULL != cp) && (NULL != bu) && (0 < sz)) {
back = 1;
ptr = bu;
@@ -1017,7 +994,7 @@ dk3of_bytes_to_cell(dk3_of_cell_t *cp, unsigned char const *bu, size_t sz)
}
}
-#line 1018 "dk3of.ctr"
+#line 1017 "dk3of.ctr"
return back;
}
@@ -1031,7 +1008,7 @@ dk3of_write_bits(dk3_of_t *of, unsigned short bv, size_t sz)
int bit;
-#line 1030 "dk3of.ctr"
+#line 1029 "dk3of.ctr"
if((of) && (sz)) {
if(sz <= 16) {
back = 1;
@@ -1040,22 +1017,22 @@ dk3of_write_bits(dk3_of_t *of, unsigned short bv, size_t sz)
if(bv & dk3of_bits_in_short[sz - i - 1]) { bit = 1; }
if(bit) {
-#line 1037 "dk3of.ctr"
+#line 1036 "dk3of.ctr"
of->bits = (of->bits) | (dk3of_bits_in_char[of->nBits]);
} else {
-#line 1039 "dk3of.ctr"
+#line 1038 "dk3of.ctr"
of->bits = (of->bits) & (~(dk3of_bits_in_char[of->nBits]));
}
of->nBits += 1;
-#line 1042 "dk3of.ctr"
+#line 1041 "dk3of.ctr"
if(of->nBits >= 8) {
-#line 1043 "dk3of.ctr"
+#line 1042 "dk3of.ctr"
if(!dk3of_flush_bits(of)) {
-#line 1044 "dk3of.ctr"
+#line 1043 "dk3of.ctr"
back = 0;
}
}
@@ -1063,7 +1040,7 @@ dk3of_write_bits(dk3_of_t *of, unsigned short bv, size_t sz)
}
}
-#line 1050 "dk3of.ctr"
+#line 1049 "dk3of.ctr"
return back;
}
@@ -1079,11 +1056,11 @@ dk3of_write_bytes(dk3_of_t *of, unsigned char const *bu, size_t sz)
size_t i;
-#line 1064 "dk3of.ctr"
+#line 1063 "dk3of.ctr"
if((NULL != of) && (NULL != bu) && (0 < sz)) {
if(of->nBits) {
-#line 1066 "dk3of.ctr"
+#line 1065 "dk3of.ctr"
back = 1;
ptr = bu;
for(i = 0; i < sz; i++) {
@@ -1101,14 +1078,14 @@ dk3of_write_bytes(dk3_of_t *of, unsigned char const *bu, size_t sz)
}
} else {
-#line 1082 "dk3of.ctr"
+#line 1081 "dk3of.ctr"
if(of->top) {
back = dk3of_bytes_to_cell(of->top, bu, sz);
}
}
}
-#line 1087 "dk3of.ctr"
+#line 1086 "dk3of.ctr"
return back;
}
@@ -1134,22 +1111,22 @@ dk3of_flush_bits(dk3_of_t *of)
int back = 0;
-#line 1111 "dk3of.ctr"
+#line 1110 "dk3of.ctr"
if(of) {
if(of->nBits) {
-#line 1113 "dk3of.ctr"
+#line 1112 "dk3of.ctr"
back = dk3of_bytes_to_cell(of->top, &(of->bits), 1);
of->bits = 0x00;
of->nBits = 0;
} else {
-#line 1117 "dk3of.ctr"
+#line 1116 "dk3of.ctr"
back = 1;
}
}
-#line 1120 "dk3of.ctr"
+#line 1119 "dk3of.ctr"
return back;
}
@@ -1160,7 +1137,7 @@ dk3of_set_crnl(dk3_of_t *of, int fl)
{
-#line 1129 "dk3of.ctr"
+#line 1128 "dk3of.ctr"
if(of) {
if(fl) {
of->flags |= DK3_OF_FLAG_CRNL;
@@ -1169,7 +1146,7 @@ dk3of_set_crnl(dk3_of_t *of, int fl)
}
}
-#line 1136 "dk3of.ctr"
+#line 1135 "dk3of.ctr"
}
@@ -1179,7 +1156,7 @@ dk3of_set_finalize(dk3_of_t *of, int fl)
{
-#line 1144 "dk3of.ctr"
+#line 1143 "dk3of.ctr"
if(of) {
if(fl) {
of->flags |= DK3_OF_FLAG_FINALIZE;
@@ -1188,7 +1165,7 @@ dk3of_set_finalize(dk3_of_t *of, int fl)
}
}
-#line 1151 "dk3of.ctr"
+#line 1150 "dk3of.ctr"
}
@@ -1203,7 +1180,7 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
int dp; /* Decimal dot position. */
int exponent; /* Exponent. */
int i; /* Traverse the string. */
- char chr[2];
+ unsigned char chr[2];
int back = 0;
chr[1] = '\0';
@@ -1218,7 +1195,7 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
switch(*start) {
case '-': {
chr[0] = '-';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
start++;
} break;
case '+': {
@@ -1309,7 +1286,7 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
*/
for(i = 0; i < (dp - (int)lgt); i++) {
chr[0] = '0';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
} else {
if(dp <= 0) {
@@ -1317,12 +1294,12 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
Decimal dot is before the string.
*/
chr[0] = '0';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
chr[0] = '.';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
while(dp++ < 0) {
chr[0] = '0';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
if (0 == dk3of_write_c8_string(of, start)) { back = 0; }
} else {
@@ -1332,10 +1309,10 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
for(i = 0; i < (int)lgt; i++) {
if(dp == i) {
chr[0] = '.';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
- chr[0] = start[i];
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ chr[0] = ((unsigned char)start[i]);
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
}
}
@@ -1344,7 +1321,7 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
No non-zero digits in string.
*/
chr[0] = '0';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
#if VERSION_BEFORE_20150821
back = 1;
diff --git a/support/dktools/dk3of.ctr b/support/dktools/dk3of.ctr
index d11e1e8c89..e2e8c22576 100644
--- a/support/dktools/dk3of.ctr
+++ b/support/dktools/dk3of.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -523,13 +523,12 @@ dk3of_nl_from_cell(dk3_of_t *of, dk3_of_cell_t *cellptr)
/** Write data from ASCII85 encoding cell downwards.
- @param of Output filter.
@param cp Pointer to cell.
@return 1 on success, 0 on error.
*/
static
int
-dk3of_write_a85_cell(dk3_of_t *of, dk3_of_cell_t *cp)
+dk3of_write_a85_cell(dk3_of_cell_t *cp)
{
int back = 0;
unsigned long v;
@@ -556,13 +555,12 @@ dk3of_write_a85_cell(dk3_of_t *of, dk3_of_cell_t *cp)
/** Save a run.
- @param of Output filter.
@param cp Filter cell.
@return 1 on success, 0 on error.
*/
static
int
-dk3of_psrl_save_run(dk3_of_t *of, dk3_of_cell_t *cp)
+dk3of_psrl_save_run(dk3_of_cell_t *cp)
{
int back = 0;
size_t sz;
@@ -678,7 +676,7 @@ dk3of_end_chunk(dk3_of_t *of)
}
} break;
case DK3_OF_CELL_TYPE_A85: {
- if(!dk3of_write_a85_cell(of, cellptr)) {
+ if(!dk3of_write_a85_cell(cellptr)) {
back = 0;
}
if((of->flags) & DK3_OF_FLAG_FINALIZE) {
@@ -694,7 +692,7 @@ dk3of_end_chunk(dk3_of_t *of)
case DK3_OF_CELL_TYPE_RUN_LENGTH: {
if((cellptr->data).psrl.bu) {
if((cellptr->data).psrl.run) {
- if(!dk3of_psrl_save_run(of, cellptr)) {
+ if(!dk3of_psrl_save_run(cellptr)) {
back = 0;
}
} else {
@@ -868,6 +866,7 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
} break;
case DK3_OF_CELL_TYPE_A85: { $? ". a85"
ul = (unsigned long)uc;
+ ul &= 0x000000FFUL;
switch((cp->data).a85.nc) {
case 0: {
ul = ((ul << 24) & 0xFF000000UL);
@@ -886,7 +885,7 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
(cp->data).a85.nc += 1;
back = 1;
if((cp->data).a85.nc >= 4) {
- back = dk3of_write_a85_cell(of, cp);
+ back = dk3of_write_a85_cell(cp);
(cp->data).a85.nc = 0;
(cp->data).a85.val = 0UL;
(cp->data).a85.nl += 1;
@@ -906,12 +905,12 @@ dk3of_one_byte_to_cell(dk3_of_cell_t *cp, unsigned char uc)
(cp->data).psrl.used += 1;
(cp->data).psrl.same += 1;
if((cp->data).psrl.used >= 127) {
- if(!dk3of_psrl_save_run(of, cp)) {
+ if(!dk3of_psrl_save_run(cp)) {
back = 0;
}
}
} else { $? ". finished run"
- if(!dk3of_psrl_save_run(of, cp)) {
+ if(!dk3of_psrl_save_run(cp)) {
back = 0;
}
((cp->data).psrl.bu)[0] = uc;
@@ -1162,7 +1161,7 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
int dp; /* Decimal dot position. */
int exponent; /* Exponent. */
int i; /* Traverse the string. */
- char chr[2];
+ unsigned char chr[2];
int back = 0;
chr[1] = '\0';
@@ -1177,7 +1176,7 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
switch(*start) {
case '-': {
chr[0] = '-';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
start++;
} break;
case '+': {
@@ -1268,7 +1267,7 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
*/
for(i = 0; i < (dp - (int)lgt); i++) {
chr[0] = '0';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
} else {
if(dp <= 0) {
@@ -1276,12 +1275,12 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
Decimal dot is before the string.
*/
chr[0] = '0';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
chr[0] = '.';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
while(dp++ < 0) {
chr[0] = '0';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
if (0 == dk3of_write_c8_string(of, start)) { back = 0; }
} else {
@@ -1291,10 +1290,10 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
for(i = 0; i < (int)lgt; i++) {
if(dp == i) {
chr[0] = '.';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
- chr[0] = start[i];
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ chr[0] = ((unsigned char)start[i]);
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
}
}
@@ -1303,7 +1302,7 @@ dk3of_double_str_no_sci(dk3_of_t *of, char *buffer)
No non-zero digits in string.
*/
chr[0] = '0';
- if (0 == dk3of_write_c8_string(of, chr)) { back = 0; }
+ if (0 == dk3of_write_bytes(of, chr, 1)) { back = 0; }
}
#if VERSION_BEFORE_20150821
back = 1;
diff --git a/support/dktools/dk3of.h b/support/dktools/dk3of.h
index 9c44dfb868..2ab5fe5743 100644
--- a/support/dktools/dk3of.h
+++ b/support/dktools/dk3of.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3of.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3of.ctr
*/
/** @file dk3of.h Header file for the dk3of module.
diff --git a/support/dktools/dk3opt.c b/support/dktools/dk3opt.c
index e7e72f2f80..3a1ccdae7f 100644
--- a/support/dktools/dk3opt.c
+++ b/support/dktools/dk3opt.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3opt.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3opt.ctr
*/
/** @file dk3opt.c The dk3opt module.
diff --git a/support/dktools/dk3opt.ctr b/support/dktools/dk3opt.ctr
index 941c4c1644..e642aab685 100644
--- a/support/dktools/dk3opt.ctr
+++ b/support/dktools/dk3opt.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3opt.h b/support/dktools/dk3opt.h
index 826019559e..75396665f4 100644
--- a/support/dktools/dk3opt.h
+++ b/support/dktools/dk3opt.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3opt.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3opt.ctr
*/
/** @file dk3opt.h Header file for the dk3opt module.
diff --git a/support/dktools/dk3paper.c b/support/dktools/dk3paper.c
index e62f58e52c..96f29e1c94 100644
--- a/support/dktools/dk3paper.c
+++ b/support/dktools/dk3paper.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3paper.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3paper.ctr
*/
/** @file dk3paper.c The dk3paper module.
diff --git a/support/dktools/dk3paper.ctr b/support/dktools/dk3paper.ctr
index 8028257945..d8097e4328 100644
--- a/support/dktools/dk3paper.ctr
+++ b/support/dktools/dk3paper.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3paper.h b/support/dktools/dk3paper.h
index ade14d6422..66a8f75ad0 100644
--- a/support/dktools/dk3paper.h
+++ b/support/dktools/dk3paper.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3paper.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3paper.ctr
*/
/** @file dk3paper.h Header file for the dk3paper module.
diff --git a/support/dktools/dk3pdf.c b/support/dktools/dk3pdf.c
index 44de63ad35..e032407863 100644
--- a/support/dktools/dk3pdf.c
+++ b/support/dktools/dk3pdf.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3pdf.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3pdf.ctr
*/
/** @file dk3pdf.c The dk3pdf module.
@@ -60,11 +38,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3bmj.h"
#include "dk3bif.h"
#include "dk3bifa.h"
+#include "dk3unused.h"
-#line 418 "dk3pdf.ctr"
+#line 419 "dk3pdf.ctr"
@@ -185,7 +164,7 @@ static char const * dk3pdf_c8_kw[] = {
/* 7 */ "%PDF-1.4\n",
/* 8 */ " 0 obj\n",
/* 9 */ "endobj\n",
-/* 10 */ "<<\n/Producer (http://dktools.sourceforge.net)\n",
+/* 10 */ "<<\n/Producer (http://sourceforge.net/p/dktools/wiki/Home/)\n",
/* 11 */ "<<\n",
/* 12 */ ">>\n",
/* 13 */ "/Type /Catalog\n",
@@ -297,12 +276,12 @@ dk3pdf_to_range(double min, double max, double val)
double back;
-#line 649 "dk3pdf.ctr"
+#line 650 "dk3pdf.ctr"
back = val;
if(back < min) { back = min; }
if(back > max) { back = max; }
-#line 652 "dk3pdf.ctr"
+#line 653 "dk3pdf.ctr"
return back;
}
@@ -368,11 +347,17 @@ dk3pdf_compare_pages(void const *l, void const *r, int cr)
*/
static
int
-dk3pdf_compare_object_start(void const *l, void const *r, int cr)
+dk3pdf_compare_object_start(
+ void const *l,
+ void const *r,
+ int DK3_ARG_UNUSED(cr)
+)
{
int back = 0;
dk3_pdf_object_start_t const *pl; /* Left object start. */
dk3_pdf_object_start_t const *pr; /* Right object start. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3_pdf_object_start_t const *)l;
@@ -462,7 +447,7 @@ dk3pdf_job_init(dk3_pdf_writer_job_t *job, dk3_pdf_t *pdf, FILE *of)
int back = 0;
-#line 810 "dk3pdf.ctr"
+#line 817 "dk3pdf.ctr"
job->of = NULL;
job->os = NULL;
job->s_objstart = NULL;
@@ -481,26 +466,26 @@ dk3pdf_job_init(dk3_pdf_writer_job_t *job, dk3_pdf_t *pdf, FILE *of)
job->i_objstart = dk3sto_it_open(job->s_objstart);
if(job->i_objstart) {
-#line 827 "dk3pdf.ctr"
+#line 834 "dk3pdf.ctr"
back = 1;
} else {
-#line 829 "dk3pdf.ctr"
+#line 836 "dk3pdf.ctr"
}
} else {
-#line 831 "dk3pdf.ctr"
+#line 838 "dk3pdf.ctr"
}
} else {
-#line 833 "dk3pdf.ctr"
+#line 840 "dk3pdf.ctr"
}
} else {
-#line 835 "dk3pdf.ctr"
+#line 842 "dk3pdf.ctr"
}
-#line 836 "dk3pdf.ctr"
+#line 843 "dk3pdf.ctr"
return back;
}
@@ -516,7 +501,7 @@ dk3pdf_job_end(dk3_pdf_writer_job_t *job)
dk3_pdf_position_t *pos; /* Traverse start position collection. */
-#line 850 "dk3pdf.ctr"
+#line 857 "dk3pdf.ctr"
if(job->os) {
dk3stream_close(job->os);
}
@@ -535,7 +520,7 @@ dk3pdf_job_end(dk3_pdf_writer_job_t *job)
}
job->s_objstart = NULL;
-#line 867 "dk3pdf.ctr"
+#line 874 "dk3pdf.ctr"
}
@@ -549,10 +534,10 @@ dk3pdf_xobject_delete(dk3_pdf_xobject_t *xo)
{
-#line 879 "dk3pdf.ctr"
+#line 886 "dk3pdf.ctr"
if(xo) {
-#line 880 "dk3pdf.ctr"
+#line 887 "dk3pdf.ctr"
if(xo->tempfilename) {
dk3sf_remove_file_app(xo->tempfilename, NULL);
dk3_delete(xo->tempfilename);
@@ -570,7 +555,7 @@ dk3pdf_xobject_delete(dk3_pdf_xobject_t *xo)
dk3_delete(xo);
}
-#line 896 "dk3pdf.ctr"
+#line 903 "dk3pdf.ctr"
}
@@ -588,7 +573,7 @@ dk3pdf_xobject_new(dk3_pdf_t *pdf)
int ok = 0; /* Flag: Success so far. */
-#line 912 "dk3pdf.ctr"
+#line 919 "dk3pdf.ctr"
back = dk3_new_app(dk3_pdf_xobject_t,1,pdf->app);
if(back) {
back->tempfilename = NULL;
@@ -616,7 +601,7 @@ dk3pdf_xobject_new(dk3_pdf_t *pdf)
}
}
-#line 938 "dk3pdf.ctr"
+#line 945 "dk3pdf.ctr"
return back;
}
@@ -625,15 +610,16 @@ dk3pdf_xobject_new(dk3_pdf_t *pdf)
/** Destroy page object, release memory.
@param pa Page object to destroy.
*/
+static
void
dk3pdf_page_delete(dk3_pdf_page_t *pa)
{
-#line 950 "dk3pdf.ctr"
+#line 958 "dk3pdf.ctr"
if(pa) {
-#line 951 "dk3pdf.ctr"
+#line 959 "dk3pdf.ctr"
if(pa->tempof) {
dk3of_close(pa->tempof);
}
@@ -668,7 +654,7 @@ dk3pdf_page_delete(dk3_pdf_page_t *pa)
dk3_delete(pa);
}
-#line 984 "dk3pdf.ctr"
+#line 992 "dk3pdf.ctr"
}
@@ -686,7 +672,7 @@ dk3pdf_page_new(dk3_pdf_t *pdf)
int ok = 0; /* Flag: OK so far. */
-#line 1000 "dk3pdf.ctr"
+#line 1008 "dk3pdf.ctr"
if(dk3app_get_temp_file_name(pdf->app, fnb, DK3_SIZEOF(fnb,dkChar))) {
back = dk3_new_app(dk3_pdf_page_t,1,pdf->app);
if(back) {
@@ -739,7 +725,7 @@ dk3pdf_page_new(dk3_pdf_t *pdf)
}
}
-#line 1051 "dk3pdf.ctr"
+#line 1059 "dk3pdf.ctr"
return back;
}
@@ -753,7 +739,7 @@ dk3pdf_open_app(dk3_app_t *app)
int ok = 0; /* Flag: Success. */
-#line 1063 "dk3pdf.ctr"
+#line 1071 "dk3pdf.ctr"
if(app) {
back = dk3_new_app(dk3_pdf_t,1,app);
if(back) {
@@ -796,7 +782,7 @@ dk3pdf_open_app(dk3_app_t *app)
}
}
-#line 1104 "dk3pdf.ctr"
+#line 1112 "dk3pdf.ctr"
return back;
}
@@ -809,7 +795,7 @@ dk3pdf_close(dk3_pdf_t *pdf)
dk3_pdf_page_t *pa; /* Traverse page collection to clean up. */
-#line 1115 "dk3pdf.ctr"
+#line 1123 "dk3pdf.ctr"
if(pdf) {
if(pdf->s_xobjects) {
if(pdf->i_xobjects) {
@@ -842,7 +828,7 @@ dk3pdf_close(dk3_pdf_t *pdf)
dk3_delete(pdf);
}
-#line 1146 "dk3pdf.ctr"
+#line 1154 "dk3pdf.ctr"
}
@@ -864,7 +850,7 @@ dk3pdf_set_next_mediabox(
pdf->mby1 = y1;
}
-#line 1166 "dk3pdf.ctr"
+#line 1174 "dk3pdf.ctr"
}
@@ -881,7 +867,7 @@ dk3pdf_write_long(dk3_of_t *of, long x)
sprintf(buf, dk3pdf_c8_kw[95], x);
dk3of_write_c8_string(of, buf);
-#line 1181 "dk3pdf.ctr"
+#line 1189 "dk3pdf.ctr"
}
@@ -899,7 +885,7 @@ dk3pdf_open_page_with_clip(dk3_pdf_t *pdf, int wc)
#endif
-#line 1197 "dk3pdf.ctr"
+#line 1205 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
dk3pdf_close_page(pdf);
@@ -941,7 +927,7 @@ dk3pdf_open_page_with_clip(dk3_pdf_t *pdf, int wc)
}
}
-#line 1237 "dk3pdf.ctr"
+#line 1245 "dk3pdf.ctr"
return back;
}
@@ -964,7 +950,7 @@ dk3pdf_close_page(dk3_pdf_t *pdf)
int back = 0;
-#line 1258 "dk3pdf.ctr"
+#line 1266 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -999,7 +985,7 @@ dk3pdf_close_page(dk3_pdf_t *pdf)
pdf->cp = NULL;
}
-#line 1291 "dk3pdf.ctr"
+#line 1299 "dk3pdf.ctr"
return back;
}
@@ -1011,7 +997,7 @@ dk3pdf_gsave(dk3_pdf_t *pdf)
int back = 0;
-#line 1301 "dk3pdf.ctr"
+#line 1309 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -1021,7 +1007,7 @@ dk3pdf_gsave(dk3_pdf_t *pdf)
}
}
-#line 1309 "dk3pdf.ctr"
+#line 1317 "dk3pdf.ctr"
return back;
}
@@ -1033,7 +1019,7 @@ dk3pdf_grestore(dk3_pdf_t *pdf)
int back = 0;
-#line 1319 "dk3pdf.ctr"
+#line 1327 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -1043,7 +1029,7 @@ dk3pdf_grestore(dk3_pdf_t *pdf)
}
}
-#line 1327 "dk3pdf.ctr"
+#line 1335 "dk3pdf.ctr"
return back;
}
@@ -1060,7 +1046,7 @@ dk3pdf_cm_long(dk3_of_t *of, long *cmv)
char buf[64]; /* Conversion buffer. */
-#line 1342 "dk3pdf.ctr"
+#line 1350 "dk3pdf.ctr"
sprintf(buf, "%ld", cmv[0]);
dk3of_write_c8_string(of, buf);
dk3of_write_c8_string(of, dk3pdf_c8_kw[1]);
@@ -1082,7 +1068,7 @@ dk3pdf_cm_long(dk3_of_t *of, long *cmv)
dk3of_write_c8_string(of, dk3pdf_c8_kw[4]);
dk3of_write_c8_string(of, dk3pdf_c8_kw[0]);
-#line 1362 "dk3pdf.ctr"
+#line 1370 "dk3pdf.ctr"
}
@@ -1103,7 +1089,7 @@ dk3pdf_write_double(dk3_of_t *of, double x)
while(*ptr) { if(*ptr == ',') { *ptr = '.'; } ptr++; }
dk3of_write_c8_string(of, buf);
-#line 1381 "dk3pdf.ctr"
+#line 1389 "dk3pdf.ctr"
#else
if (1.0e-8 <= fabs(x)) {
(void)dk3of_double_to_c8_no_sci(of, x);
@@ -1125,7 +1111,7 @@ dk3pdf_cm_double(dk3_of_t *of, double *cmv)
{
-#line 1401 "dk3pdf.ctr"
+#line 1409 "dk3pdf.ctr"
dk3pdf_write_double(of, cmv[0]);
dk3of_write_c8_string(of, dk3pdf_c8_kw[1]);
dk3pdf_write_double(of, cmv[1]);
@@ -1140,7 +1126,7 @@ dk3pdf_cm_double(dk3_of_t *of, double *cmv)
dk3of_write_c8_string(of, dk3pdf_c8_kw[1]);
dk3of_write_c8_string(of, dk3pdf_c8_kw[4]);
-#line 1414 "dk3pdf.ctr"
+#line 1422 "dk3pdf.ctr"
}
@@ -1152,7 +1138,7 @@ dk3pdf_translate_long(dk3_pdf_t *pdf, long x, long y)
int back = 0;
-#line 1424 "dk3pdf.ctr"
+#line 1432 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -1166,7 +1152,7 @@ dk3pdf_translate_long(dk3_pdf_t *pdf, long x, long y)
}
}
-#line 1436 "dk3pdf.ctr"
+#line 1444 "dk3pdf.ctr"
return back;
}
@@ -1179,7 +1165,7 @@ dk3pdf_translate_double(dk3_pdf_t *pdf, double x, double y)
int back = 0;
-#line 1447 "dk3pdf.ctr"
+#line 1455 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -1193,7 +1179,7 @@ dk3pdf_translate_double(dk3_pdf_t *pdf, double x, double y)
}
}
-#line 1459 "dk3pdf.ctr"
+#line 1467 "dk3pdf.ctr"
return back;
}
@@ -1217,7 +1203,7 @@ dk3pdf_rotate_int(dk3_pdf_t *pdf, int angle)
int back = 0;
-#line 1481 "dk3pdf.ctr"
+#line 1489 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -1247,7 +1233,7 @@ dk3pdf_rotate_int(dk3_pdf_t *pdf, int angle)
}
}
-#line 1509 "dk3pdf.ctr"
+#line 1517 "dk3pdf.ctr"
return back;
}
@@ -1260,7 +1246,7 @@ dk3pdf_rotate_double(dk3_pdf_t *pdf, double angle)
int back = 0;
-#line 1520 "dk3pdf.ctr"
+#line 1528 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -1274,7 +1260,7 @@ dk3pdf_rotate_double(dk3_pdf_t *pdf, double angle)
}
}
-#line 1532 "dk3pdf.ctr"
+#line 1540 "dk3pdf.ctr"
return back;
}
@@ -1287,7 +1273,7 @@ dk3pdf_scale_long(dk3_pdf_t *pdf, long x, long y)
int back = 0;
-#line 1543 "dk3pdf.ctr"
+#line 1551 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -1299,7 +1285,7 @@ dk3pdf_scale_long(dk3_pdf_t *pdf, long x, long y)
}
}
-#line 1553 "dk3pdf.ctr"
+#line 1561 "dk3pdf.ctr"
return back;
}
@@ -1312,7 +1298,7 @@ dk3pdf_scale_double(dk3_pdf_t *pdf, double x, double y)
int back = 0;
-#line 1564 "dk3pdf.ctr"
+#line 1572 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -1324,7 +1310,7 @@ dk3pdf_scale_double(dk3_pdf_t *pdf, double x, double y)
}
}
-#line 1574 "dk3pdf.ctr"
+#line 1582 "dk3pdf.ctr"
return back;
}
@@ -1337,16 +1323,16 @@ dk3pdf_add_xobject_to_page(dk3_pdf_t *pdf, dk3_pdf_xobject_t *xo)
int back = 0;
-#line 1585 "dk3pdf.ctr"
+#line 1593 "dk3pdf.ctr"
if((pdf) && (xo)) {
-#line 1586 "dk3pdf.ctr"
+#line 1594 "dk3pdf.ctr"
if(pdf->cp) {
-#line 1587 "dk3pdf.ctr"
+#line 1595 "dk3pdf.ctr"
if((pdf->cp)->tempof) {
-#line 1588 "dk3pdf.ctr"
+#line 1596 "dk3pdf.ctr"
sprintf(buf, "%lu", xo->objno);
dk3of_write_c8_string((pdf->cp)->tempof, dk3pdf_c8_kw[5]);
dk3of_write_c8_string((pdf->cp)->tempof, buf);
@@ -1361,27 +1347,27 @@ dk3pdf_add_xobject_to_page(dk3_pdf_t *pdf, dk3_pdf_xobject_t *xo)
}
if(((pdf->cp)->s_xobjects) && ((pdf->cp)->i_xobjects)) {
-#line 1601 "dk3pdf.ctr"
+#line 1609 "dk3pdf.ctr"
if(dk3sto_add((pdf->cp)->s_xobjects, (void *)xo)) {
-#line 1602 "dk3pdf.ctr"
+#line 1610 "dk3pdf.ctr"
back = 1;
}
}
} else {
-#line 1606 "dk3pdf.ctr"
+#line 1614 "dk3pdf.ctr"
}
} else {
-#line 1608 "dk3pdf.ctr"
+#line 1616 "dk3pdf.ctr"
}
} else {
-#line 1610 "dk3pdf.ctr"
+#line 1618 "dk3pdf.ctr"
}
-#line 1611 "dk3pdf.ctr"
+#line 1619 "dk3pdf.ctr"
return back;
}
@@ -1404,7 +1390,7 @@ dk3pdf_image_job_init(
{
-#line 1632 "dk3pdf.ctr"
+#line 1640 "dk3pdf.ctr"
job->pdf = pdf;
job->bif = bif;
job->of = NULL;
@@ -1416,7 +1402,7 @@ dk3pdf_image_job_init(
job->use_dct = 0;
job->xo = NULL;
-#line 1642 "dk3pdf.ctr"
+#line 1650 "dk3pdf.ctr"
}
@@ -1437,7 +1423,7 @@ dk3pdf_transfer_dct_data(FILE *ofile, dk3_bif_t *bif, dk3_app_t *app)
int cc; /* Flag: Can continue. */
-#line 1661 "dk3pdf.ctr"
+#line 1669 "dk3pdf.ctr"
ifile = dk3bif_get_file(bif);
if(ifile) {
rewind(ifile);
@@ -1451,7 +1437,7 @@ dk3pdf_transfer_dct_data(FILE *ofile, dk3_bif_t *bif, dk3_app_t *app)
} while(cc);
}
-#line 1673 "dk3pdf.ctr"
+#line 1681 "dk3pdf.ctr"
}
@@ -1466,10 +1452,17 @@ dk3pdf_transfer_dct_data(FILE *ofile, dk3_bif_t *bif, dk3_app_t *app)
static
void
dk3pdf_out_col_8_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -1481,7 +1474,12 @@ dk3pdf_out_col_8_mixed(
unsigned char r, g, b; /* RGB values. */
-#line 1701 "dk3pdf.ctr"
+#line 1716 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -1619,7 +1617,7 @@ dk3pdf_out_col_8_mixed(
} break;
}
-#line 1837 "dk3pdf.ctr"
+#line 1857 "dk3pdf.ctr"
}
@@ -1633,10 +1631,17 @@ dk3pdf_out_col_8_mixed(
static
void
dk3pdf_out_col_8_not_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void *DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -1648,7 +1653,12 @@ dk3pdf_out_col_8_not_mixed(
unsigned char r, g, b; /* RGB values. */
-#line 1864 "dk3pdf.ctr"
+#line 1891 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -1786,7 +1796,7 @@ dk3pdf_out_col_8_not_mixed(
} break;
}
-#line 2000 "dk3pdf.ctr"
+#line 2032 "dk3pdf.ctr"
}
@@ -1800,10 +1810,17 @@ dk3pdf_out_col_8_not_mixed(
static
void
dk3pdf_out_gray_8_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -1813,7 +1830,12 @@ dk3pdf_out_gray_8_mixed(
unsigned char v, p, q; /* Value and predictor(s). */
-#line 2025 "dk3pdf.ctr"
+#line 2064 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -1912,7 +1934,7 @@ dk3pdf_out_gray_8_mixed(
} break;
}
-#line 2122 "dk3pdf.ctr"
+#line 2166 "dk3pdf.ctr"
}
@@ -1926,10 +1948,17 @@ dk3pdf_out_gray_8_mixed(
static
void
dk3pdf_out_gray_8_not_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -1939,20 +1968,25 @@ dk3pdf_out_gray_8_not_mixed(
unsigned char v, p, q; /* Value and predictors. */
-#line 2147 "dk3pdf.ctr"
+#line 2198 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
case DK3_COMPRESSION_PREDICTOR_TIFF: {
-#line 2151 "dk3pdf.ctr"
+#line 2207 "dk3pdf.ctr"
for(y = 0L; y < h; y++) {
p = 0x00;
for(x = 0L; x < w; x++) {
v = (unsigned char)dk3bif_get_gray(job->bif, x, y);
q = v - p;
-#line 2156 "dk3pdf.ctr"
+#line 2212 "dk3pdf.ctr"
dk3of_write_bytes(job->of, &q, 1);
p = v;
}
@@ -2033,7 +2067,7 @@ dk3pdf_out_gray_8_not_mixed(
} break;
default: {
-#line 2235 "dk3pdf.ctr"
+#line 2291 "dk3pdf.ctr"
for(y = 0L; y < h; y++) {
for(x = 0L; x < w; x++) {
v = (unsigned char)dk3bif_get_gray(job->bif, x, y);
@@ -2046,7 +2080,7 @@ dk3pdf_out_gray_8_not_mixed(
} break;
}
-#line 2246 "dk3pdf.ctr"
+#line 2302 "dk3pdf.ctr"
}
@@ -2060,10 +2094,17 @@ dk3pdf_out_gray_8_not_mixed(
static
void
dk3pdf_out_col_not8_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2078,7 +2119,12 @@ dk3pdf_out_col_not8_mixed(
dk3_bif_pixel_t ob; /* Previous blue. */
-#line 2276 "dk3pdf.ctr"
+#line 2339 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2120,7 +2166,7 @@ dk3pdf_out_col_not8_mixed(
} break;
}
-#line 2316 "dk3pdf.ctr"
+#line 2384 "dk3pdf.ctr"
}
@@ -2134,10 +2180,17 @@ dk3pdf_out_col_not8_mixed(
static
void
dk3pdf_out_col_not8_not_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2152,7 +2205,12 @@ dk3pdf_out_col_not8_not_mixed(
dk3_bif_pixel_t ob; /* Previous blue. */
-#line 2346 "dk3pdf.ctr"
+#line 2421 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2194,7 +2252,7 @@ dk3pdf_out_col_not8_not_mixed(
} break;
}
-#line 2386 "dk3pdf.ctr"
+#line 2466 "dk3pdf.ctr"
}
@@ -2208,10 +2266,17 @@ dk3pdf_out_col_not8_not_mixed(
static
void
dk3pdf_out_gray_not8_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void *DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2222,7 +2287,12 @@ dk3pdf_out_gray_not8_mixed(
dk3_bif_pixel_t og; /* Previous gray. */
-#line 2412 "dk3pdf.ctr"
+#line 2499 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2254,7 +2324,7 @@ dk3pdf_out_gray_not8_mixed(
} break;
}
-#line 2442 "dk3pdf.ctr"
+#line 2534 "dk3pdf.ctr"
}
@@ -2268,10 +2338,17 @@ dk3pdf_out_gray_not8_mixed(
static
void
dk3pdf_out_gray_not8_not_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2282,7 +2359,12 @@ dk3pdf_out_gray_not8_not_mixed(
dk3_bif_pixel_t og; /* Previous gray. */
-#line 2468 "dk3pdf.ctr"
+#line 2567 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2314,7 +2396,7 @@ dk3pdf_out_gray_not8_not_mixed(
} break;
}
-#line 2498 "dk3pdf.ctr"
+#line 2602 "dk3pdf.ctr"
}
@@ -2330,10 +2412,17 @@ dk3pdf_out_gray_not8_not_mixed(
static
int
dk3pdf_add_alpha_xobject(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int min,
int max
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max)
+#endif
)
{
dk3_stat_t stb; /* Stat buffer. */
@@ -2353,7 +2442,12 @@ dk3pdf_add_alpha_xobject(
unsigned char wc; /* Predictor as byte. */
-#line 2535 "dk3pdf.ctr"
+#line 2646 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+#endif
mo = dk3pdf_xobject_new(job->pdf);
if(mo) {
mo->objno = (job->pdf)->nextobject;
@@ -2550,7 +2644,7 @@ dk3pdf_add_alpha_xobject(
}
}
-#line 2730 "dk3pdf.ctr"
+#line 2846 "dk3pdf.ctr"
return back;
}
@@ -2579,7 +2673,7 @@ dk3pdf_xobject_data(
int xmax; /* Centered progress bar value. */
-#line 2757 "dk3pdf.ctr"
+#line 2873 "dk3pdf.ctr"
xmax = max;
if(!(job->use_dct)) {
switch(job->procedure) {
@@ -2589,7 +2683,7 @@ dk3pdf_xobject_data(
}
}
-#line 2765 "dk3pdf.ctr"
+#line 2881 "dk3pdf.ctr"
(job->xo)->width = dk3bif_get_width(job->bif);
(job->xo)->height = dk3bif_get_height(job->bif);
(job->xo)->xot = DK3_PDF_XO_TYPE_IMAGE;
@@ -2604,10 +2698,10 @@ dk3pdf_xobject_data(
);
if(fipo) {
-#line 2778 "dk3pdf.ctr"
+#line 2894 "dk3pdf.ctr"
if(job->use_dct) {
-#line 2779 "dk3pdf.ctr"
+#line 2895 "dk3pdf.ctr"
back = 1;
dk3pdf_transfer_dct_data(fipo, job->bif, (job->pdf)->app);
} else {
@@ -2709,10 +2803,10 @@ dk3pdf_xobject_data(
}
} else {
-#line 2879 "dk3pdf.ctr"
+#line 2995 "dk3pdf.ctr"
}
-#line 2880 "dk3pdf.ctr"
+#line 2996 "dk3pdf.ctr"
return back;
}
@@ -2734,7 +2828,7 @@ dk3pdf_create_ixobject_progress(
size_t nbits; /* Bits per component. */
-#line 2900 "dk3pdf.ctr"
+#line 3016 "dk3pdf.ctr"
nbits = dk3bif_get_bits_per_pixel(bif);
dk3pdf_image_job_init(&job, opt, pdf, bif);
switch(dk3bif_get_color_space(bif)) {
@@ -2750,18 +2844,18 @@ dk3pdf_create_ixobject_progress(
} break;
}
-#line 2914 "dk3pdf.ctr"
+#line 3030 "dk3pdf.ctr"
switch(dk3bif_get_type(bif)) {
case DK3_BIF_IMAGE_TYPE_JPEG: {
-#line 2916 "dk3pdf.ctr"
+#line 3032 "dk3pdf.ctr"
if(opt->dct) {
-#line 2917 "dk3pdf.ctr"
+#line 3033 "dk3pdf.ctr"
switch(dk3bif_get_bits_per_pixel(bif)) {
case 1: case 2: case 4: case 8: {
-#line 2919 "dk3pdf.ctr"
+#line 3035 "dk3pdf.ctr"
switch(dk3bif_jpeg_get_num_components(bif)) {
case 1: {
job.procedure = DK3_BMEPS_GRAY_DCT;
@@ -2780,13 +2874,13 @@ dk3pdf_create_ixobject_progress(
} break;
default: {
-#line 2936 "dk3pdf.ctr"
+#line 3052 "dk3pdf.ctr"
} break;
}
} break;
default: {
-#line 2940 "dk3pdf.ctr"
+#line 3056 "dk3pdf.ctr"
} break;
}
}
@@ -2860,7 +2954,7 @@ dk3pdf_create_ixobject_progress(
#if DK3_USE_WX
-#line 3012 "dk3pdf.ctr"
+#line 3128 "dk3pdf.ctr"
dk3bmj_progress(pc, (min + max)/2);
#endif
back = dk3pdf_xobject_new(pdf);
@@ -2897,12 +2991,12 @@ dk3pdf_create_ixobject_progress(
#if DK3_USE_WX
-#line 3047 "dk3pdf.ctr"
+#line 3163 "dk3pdf.ctr"
dk3bmj_progress(pc, max);
#endif
-#line 3050 "dk3pdf.ctr"
+#line 3166 "dk3pdf.ctr"
return back;
}
@@ -2927,11 +3021,11 @@ dk3pdf_create_ixobject(
dk3_pdf_xobject_t *back;
-#line 3073 "dk3pdf.ctr"
+#line 3189 "dk3pdf.ctr"
back = dk3pdf_create_ixobject_progress(pdf, bif, opt, NULL, 0, 1000);
-#line 3075 "dk3pdf.ctr"
+#line 3191 "dk3pdf.ctr"
return back;
}
#endif
@@ -2951,20 +3045,20 @@ dk3pdf_add_image_progress(
dk3_pdf_xobject_t *back = NULL;
-#line 3093 "dk3pdf.ctr"
+#line 3209 "dk3pdf.ctr"
if((pdf) && (bif)) {
-#line 3094 "dk3pdf.ctr"
+#line 3210 "dk3pdf.ctr"
if(pdf->cp) {
-#line 3095 "dk3pdf.ctr"
+#line 3211 "dk3pdf.ctr"
if((pdf->cp)->tempof) {
-#line 3096 "dk3pdf.ctr"
+#line 3212 "dk3pdf.ctr"
back = dk3pdf_create_ixobject_progress(pdf, bif, opt, pc, min, max);
if(back) {
-#line 3098 "dk3pdf.ctr"
+#line 3214 "dk3pdf.ctr"
if(!dk3pdf_add_xobject_to_page(pdf, back)) {
back = NULL;
}
@@ -2973,7 +3067,7 @@ dk3pdf_add_image_progress(
}
}
-#line 3105 "dk3pdf.ctr"
+#line 3221 "dk3pdf.ctr"
return back;
}
@@ -2989,11 +3083,11 @@ dk3pdf_add_image(
dk3_pdf_xobject_t *back = NULL;
-#line 3119 "dk3pdf.ctr"
+#line 3235 "dk3pdf.ctr"
back = dk3pdf_add_image_progress(pdf, bif, opt, NULL, 0, 1000);
-#line 3121 "dk3pdf.ctr"
+#line 3237 "dk3pdf.ctr"
return back;
}
@@ -3014,41 +3108,41 @@ dk3pdf_begin_object(dk3_pdf_writer_job_t *job, unsigned long on)
int back = 0;
-#line 3140 "dk3pdf.ctr"
+#line 3256 "dk3pdf.ctr"
pos = dk3stream_bytes_written(job->os);
-#line 3141 "dk3pdf.ctr"
+#line 3257 "dk3pdf.ctr"
if(on > job->largestObjectNumber) { job->largestObjectNumber = on; }
start = dk3_new_app(dk3_pdf_object_start_t,1,(job->pdf)->app);
if(start) {
-#line 3144 "dk3pdf.ctr"
+#line 3260 "dk3pdf.ctr"
start->objno = on;
start->startpos = pos;
if(dk3sto_add(job->s_objstart, (void *)start)) {
-#line 3147 "dk3pdf.ctr"
+#line 3263 "dk3pdf.ctr"
back = 1;
sprintf(buf, "%lu", on);
-#line 3149 "dk3pdf.ctr"
+#line 3265 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, buf);
-#line 3150 "dk3pdf.ctr"
+#line 3266 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[8]);
-#line 3151 "dk3pdf.ctr"
+#line 3267 "dk3pdf.ctr"
} else {
-#line 3152 "dk3pdf.ctr"
+#line 3268 "dk3pdf.ctr"
dk3_delete(start);
}
} else {
-#line 3155 "dk3pdf.ctr"
+#line 3271 "dk3pdf.ctr"
}
-#line 3156 "dk3pdf.ctr"
+#line 3272 "dk3pdf.ctr"
return back;
}
@@ -3064,7 +3158,7 @@ dk3pdf_end_object(dk3_pdf_writer_job_t *job)
{
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[9]);
-#line 3170 "dk3pdf.ctr"
+#line 3286 "dk3pdf.ctr"
}
@@ -3086,7 +3180,7 @@ dk3pdf_write_file_start(dk3_pdf_writer_job_t *job)
int back = 1;
-#line 3190 "dk3pdf.ctr"
+#line 3306 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[7]);
if(dk3pdf_begin_object(job, 1UL)) {
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[10]);
@@ -3150,21 +3244,21 @@ dk3pdf_write_file_start(dk3_pdf_writer_job_t *job)
dk3pdf_end_object(job);
} else {
-#line 3252 "dk3pdf.ctr"
+#line 3368 "dk3pdf.ctr"
back = 0;
}
} else {
-#line 3255 "dk3pdf.ctr"
+#line 3371 "dk3pdf.ctr"
back = 0;
}
} else {
-#line 3258 "dk3pdf.ctr"
+#line 3374 "dk3pdf.ctr"
back = 0;
}
-#line 3260 "dk3pdf.ctr"
+#line 3376 "dk3pdf.ctr"
return back;
}
@@ -3191,7 +3285,7 @@ dk3pdf_decode_parms(
char buf[256]; /* Conversion buffer. */
-#line 3285 "dk3pdf.ctr"
+#line 3401 "dk3pdf.ctr"
dk3stream_c8_fputs(os, dk3pdf_c8_kw[64]);
dk3stream_c8_fputs(os, dk3pdf_c8_kw[predictorline]);
sprintf(buf, "%d", bpc);
@@ -3221,7 +3315,7 @@ dk3pdf_decode_parms(
dk3stream_c8_fputs(os, dk3pdf_c8_kw[0]);
dk3stream_c8_fputs(os, dk3pdf_c8_kw[12]);
-#line 3313 "dk3pdf.ctr"
+#line 3429 "dk3pdf.ctr"
}
@@ -3236,10 +3330,17 @@ dk3pdf_decode_parms(
static
int
dk3pdf_write_file_xobjects(
+#if DK3_USE_WX
dk3_pdf_writer_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_writer_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
char buf[64]; /* Conversion buffer. */
@@ -3252,7 +3353,12 @@ dk3pdf_write_file_xobjects(
int cc; /* Flag: Can continue transfer. */
-#line 3342 "dk3pdf.ctr"
+#line 3465 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
dk3sto_it_reset((job->pdf)->i_xobjects);
while((xo = (dk3_pdf_xobject_t *)dk3sto_it_next((job->pdf)->i_xobjects))
!= NULL
@@ -3385,7 +3491,7 @@ dk3pdf_write_file_xobjects(
#endif
}
-#line 3473 "dk3pdf.ctr"
+#line 3601 "dk3pdf.ctr"
return back;
}
@@ -3401,10 +3507,17 @@ dk3pdf_write_file_xobjects(
static
int
dk3pdf_write_file_pages(
+#if DK3_USE_WX
dk3_pdf_writer_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_writer_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
char buf[4096]; /* Data transfer buffer. */
@@ -3417,12 +3530,17 @@ dk3pdf_write_file_pages(
int cc; /* Flag: Can continue transfer. */
-#line 3503 "dk3pdf.ctr"
+#line 3638 "dk3pdf.ctr"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
dk3sto_it_reset((job->pdf)->i_pages);
while((cp = (dk3_pdf_page_t *)dk3sto_it_next((job->pdf)->i_pages)) != NULL) {
-#line 3506 "dk3pdf.ctr"
+#line 3646 "dk3pdf.ctr"
/*
Mark all Xobjects as unused.
*/
@@ -3434,7 +3552,7 @@ dk3pdf_write_file_pages(
xo->used = 0;
}
-#line 3516 "dk3pdf.ctr"
+#line 3656 "dk3pdf.ctr"
/*
Mark Xobjects used by this page.
*/
@@ -3445,74 +3563,74 @@ dk3pdf_write_file_pages(
{
xo->used = 1;
-#line 3525 "dk3pdf.ctr"
+#line 3665 "dk3pdf.ctr"
if(xo->mask) {
-#line 3526 "dk3pdf.ctr"
+#line 3666 "dk3pdf.ctr"
have_mask = 1;
}
}
}
-#line 3530 "dk3pdf.ctr"
+#line 3670 "dk3pdf.ctr"
/*
Write page object.
*/
-#line 3534 "dk3pdf.ctr"
+#line 3674 "dk3pdf.ctr"
if(dk3pdf_begin_object(job, cp->objno)) {
-#line 3535 "dk3pdf.ctr"
+#line 3675 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[11]); /* << */
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[48]);
-#line 3537 "dk3pdf.ctr"
+#line 3677 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[49]);
-#line 3538 "dk3pdf.ctr"
+#line 3678 "dk3pdf.ctr"
sprintf(buf, dk3pdf_c8_kw[50], cp->mbx0, cp->mby0, cp->mbx1, cp->mby1);
dk3stream_c8_fputs(job->os, buf);
-#line 3540 "dk3pdf.ctr"
+#line 3680 "dk3pdf.ctr"
sprintf(buf, dk3pdf_c8_kw[100], cp->mbx0, cp->mby0, cp->mbx1, cp->mby1);
dk3stream_c8_fputs(job->os, buf);
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[51]); /* /Resources << */
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[11]);
-#line 3544 "dk3pdf.ctr"
+#line 3684 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[52]);
-#line 3545 "dk3pdf.ctr"
+#line 3685 "dk3pdf.ctr"
if((cp->s_xobjects) && (cp->i_xobjects)) {
-#line 3546 "dk3pdf.ctr"
+#line 3686 "dk3pdf.ctr"
sprintf(buf, dk3pdf_c8_kw[53], (cp->objno + 2UL));
-#line 3547 "dk3pdf.ctr"
+#line 3687 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, buf);
-#line 3548 "dk3pdf.ctr"
+#line 3688 "dk3pdf.ctr"
}
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[12]); /* >> */
sprintf(buf, dk3pdf_c8_kw[54], (cp->objno + 1UL));
-#line 3551 "dk3pdf.ctr"
+#line 3691 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, buf);
-#line 3552 "dk3pdf.ctr"
+#line 3692 "dk3pdf.ctr"
/* Group (for alpha) */
if(have_mask) {
-#line 3554 "dk3pdf.ctr"
+#line 3694 "dk3pdf.ctr"
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[55]);
-#line 3555 "dk3pdf.ctr"
+#line 3695 "dk3pdf.ctr"
}
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[12]); /* >> */
dk3pdf_end_object(job);
-#line 3558 "dk3pdf.ctr"
+#line 3698 "dk3pdf.ctr"
/*
Write content stream object.
*/
@@ -3557,7 +3675,7 @@ dk3pdf_write_file_pages(
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[26]);
dk3pdf_end_object(job);
-#line 3601 "dk3pdf.ctr"
+#line 3741 "dk3pdf.ctr"
/*
Write XObjects dictionary.
*/
@@ -3577,7 +3695,7 @@ dk3pdf_write_file_pages(
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[12]);
dk3pdf_end_object(job);
-#line 3619 "dk3pdf.ctr"
+#line 3759 "dk3pdf.ctr"
} else {
back = 0;
/* ERROR: Memory */
@@ -3589,7 +3707,7 @@ dk3pdf_write_file_pages(
}
} else {
-#line 3629 "dk3pdf.ctr"
+#line 3769 "dk3pdf.ctr"
back = 0;
/* ERROR: Memory */
}
@@ -3598,7 +3716,7 @@ dk3pdf_write_file_pages(
#endif
}
-#line 3636 "dk3pdf.ctr"
+#line 3776 "dk3pdf.ctr"
return back;
}
@@ -3620,7 +3738,7 @@ dk3pdf_write_file_end(dk3_pdf_writer_job_t *job)
int back = 1;
-#line 3656 "dk3pdf.ctr"
+#line 3796 "dk3pdf.ctr"
startxref = dk3stream_bytes_written(job->os);
sprintf(buf, "%lu", (job->largestObjectNumber + 1UL));
dk3stream_c8_fputs(job->os, dk3pdf_c8_kw[18]);
@@ -3657,7 +3775,7 @@ dk3pdf_write_file_end(dk3_pdf_writer_job_t *job)
/* ERROR: Failed to convert number! */
}
-#line 3691 "dk3pdf.ctr"
+#line 3831 "dk3pdf.ctr"
return back;
}
@@ -3673,7 +3791,7 @@ dk3pdf_enumerate_pages(dk3_pdf_writer_job_t *job)
unsigned long on; /* Next object number. */
-#line 3705 "dk3pdf.ctr"
+#line 3845 "dk3pdf.ctr"
on = (job->pdf)->nextobject;
dk3sto_it_reset((job->pdf)->i_pages);
while((pa = (dk3_pdf_page_t *)dk3sto_it_next((job->pdf)->i_pages)) != NULL)
@@ -3697,7 +3815,7 @@ dk3pdf_enumerate_pages(dk3_pdf_writer_job_t *job)
(job->pdf)->nextobject = on;
-#line 3727 "dk3pdf.ctr"
+#line 3867 "dk3pdf.ctr"
}
@@ -3715,10 +3833,10 @@ dk3pdf_write_file_progress(
int back = 0;
-#line 3743 "dk3pdf.ctr"
+#line 3883 "dk3pdf.ctr"
if((pdf) && (ofile)) {
-#line 3744 "dk3pdf.ctr"
+#line 3884 "dk3pdf.ctr"
if(pdf->cp) { dk3pdf_close_page(pdf); }
if(dk3pdf_job_init(&job, pdf, ofile)) {
back = 1;
@@ -3732,15 +3850,15 @@ dk3pdf_write_file_progress(
} else {
if(!(pdf)) {
-#line 3756 "dk3pdf.ctr"
+#line 3896 "dk3pdf.ctr"
}
if(!(ofile)) {
-#line 3758 "dk3pdf.ctr"
+#line 3898 "dk3pdf.ctr"
}
}
-#line 3760 "dk3pdf.ctr"
+#line 3900 "dk3pdf.ctr"
return back;
}
@@ -3752,11 +3870,11 @@ dk3pdf_write_file(dk3_pdf_t *pdf, FILE *ofile)
int back;
-#line 3770 "dk3pdf.ctr"
+#line 3910 "dk3pdf.ctr"
back = dk3pdf_write_file_progress(pdf, ofile, NULL, 0, 1000);
-#line 3772 "dk3pdf.ctr"
+#line 3912 "dk3pdf.ctr"
return back;
}
@@ -3777,7 +3895,7 @@ dk3pdf_write_point(dk3_of_t *of, double x, double y)
dk3of_write_c8_string(of, dk3pdf_c8_kw[1]);
-#line 3791 "dk3pdf.ctr"
+#line 3931 "dk3pdf.ctr"
}
@@ -3788,7 +3906,7 @@ dk3pdf_newpath_moveto(dk3_pdf_t *pdf, double x, double y)
int back = 0;
-#line 3800 "dk3pdf.ctr"
+#line 3940 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -3799,7 +3917,7 @@ dk3pdf_newpath_moveto(dk3_pdf_t *pdf, double x, double y)
}
}
-#line 3809 "dk3pdf.ctr"
+#line 3949 "dk3pdf.ctr"
return back;
}
@@ -3811,7 +3929,7 @@ dk3pdf_lineto(dk3_pdf_t *pdf, double x, double y)
int back = 0;
-#line 3819 "dk3pdf.ctr"
+#line 3959 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -3822,7 +3940,7 @@ dk3pdf_lineto(dk3_pdf_t *pdf, double x, double y)
}
}
-#line 3828 "dk3pdf.ctr"
+#line 3968 "dk3pdf.ctr"
return back;
}
@@ -3839,7 +3957,7 @@ dk3pdf_curveto(
int back = 0;
-#line 3843 "dk3pdf.ctr"
+#line 3983 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -3854,7 +3972,7 @@ dk3pdf_curveto(
}
}
-#line 3856 "dk3pdf.ctr"
+#line 3996 "dk3pdf.ctr"
return back;
}
@@ -3866,7 +3984,7 @@ dk3pdf_set_nonstroking_gray(dk3_pdf_t *pdf, double g)
double ng; /* Corrected gray value. */
-#line 3866 "dk3pdf.ctr"
+#line 4006 "dk3pdf.ctr"
ng = dk3pdf_to_range(0.0, 1.0, g);
if(pdf) {
if(pdf->cp) {
@@ -3879,7 +3997,7 @@ dk3pdf_set_nonstroking_gray(dk3_pdf_t *pdf, double g)
}
}
-#line 3877 "dk3pdf.ctr"
+#line 4017 "dk3pdf.ctr"
return back;
}
@@ -3892,7 +4010,7 @@ dk3pdf_set_stroking_gray(dk3_pdf_t *pdf, double g)
double ng; /* Corrected gray value. */
-#line 3888 "dk3pdf.ctr"
+#line 4028 "dk3pdf.ctr"
ng = dk3pdf_to_range(0.0, 1.0, g);
if(pdf) {
if(pdf->cp) {
@@ -3905,7 +4023,7 @@ dk3pdf_set_stroking_gray(dk3_pdf_t *pdf, double g)
}
}
-#line 3899 "dk3pdf.ctr"
+#line 4039 "dk3pdf.ctr"
return back;
}
@@ -3917,7 +4035,7 @@ dk3pdf_closepath_fill_stroke_nz(dk3_pdf_t *pdf)
int back = 0;
-#line 3909 "dk3pdf.ctr"
+#line 4049 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -3927,7 +4045,7 @@ dk3pdf_closepath_fill_stroke_nz(dk3_pdf_t *pdf)
}
}
-#line 3917 "dk3pdf.ctr"
+#line 4057 "dk3pdf.ctr"
return back;
}
@@ -3940,7 +4058,7 @@ dk3pdf_closepath_fill_stroke_eo(dk3_pdf_t *pdf)
int back = 0;
-#line 3928 "dk3pdf.ctr"
+#line 4068 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -3950,7 +4068,7 @@ dk3pdf_closepath_fill_stroke_eo(dk3_pdf_t *pdf)
}
}
-#line 3936 "dk3pdf.ctr"
+#line 4076 "dk3pdf.ctr"
return back;
}
@@ -3962,7 +4080,7 @@ dk3pdf_closepath(dk3_pdf_t *pdf)
int back = 0;
-#line 3946 "dk3pdf.ctr"
+#line 4086 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -3972,7 +4090,7 @@ dk3pdf_closepath(dk3_pdf_t *pdf)
}
}
-#line 3954 "dk3pdf.ctr"
+#line 4094 "dk3pdf.ctr"
return back;
}
@@ -3984,7 +4102,7 @@ dk3pdf_fill_nz(dk3_pdf_t *pdf)
int back = 0;
-#line 3964 "dk3pdf.ctr"
+#line 4104 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -3994,7 +4112,7 @@ dk3pdf_fill_nz(dk3_pdf_t *pdf)
}
}
-#line 3972 "dk3pdf.ctr"
+#line 4112 "dk3pdf.ctr"
return back;
}
@@ -4006,7 +4124,7 @@ dk3pdf_fill_eo(dk3_pdf_t *pdf)
int back = 0;
-#line 3982 "dk3pdf.ctr"
+#line 4122 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -4016,7 +4134,7 @@ dk3pdf_fill_eo(dk3_pdf_t *pdf)
}
}
-#line 3990 "dk3pdf.ctr"
+#line 4130 "dk3pdf.ctr"
return back;
}
@@ -4028,7 +4146,7 @@ dk3pdf_clip_eo(dk3_pdf_t *pdf)
int back = 0;
-#line 4000 "dk3pdf.ctr"
+#line 4140 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -4038,7 +4156,7 @@ dk3pdf_clip_eo(dk3_pdf_t *pdf)
}
}
-#line 4008 "dk3pdf.ctr"
+#line 4148 "dk3pdf.ctr"
return back;
}
@@ -4050,7 +4168,7 @@ dk3pdf_clip_nz(dk3_pdf_t *pdf)
int back = 0;
-#line 4018 "dk3pdf.ctr"
+#line 4158 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -4060,7 +4178,7 @@ dk3pdf_clip_nz(dk3_pdf_t *pdf)
}
}
-#line 4026 "dk3pdf.ctr"
+#line 4166 "dk3pdf.ctr"
return back;
}
@@ -4074,7 +4192,7 @@ dk3pdf_nonstroking_rgb(dk3_pdf_t *pdf, double r, double g, double b)
double nb; /* Corrected blue. */
-#line 4038 "dk3pdf.ctr"
+#line 4178 "dk3pdf.ctr"
nr = dk3pdf_to_range(0.0, 1.0, r);
ng = dk3pdf_to_range(0.0, 1.0, g);
nb = dk3pdf_to_range(0.0, 1.0, b);
@@ -4093,7 +4211,7 @@ dk3pdf_nonstroking_rgb(dk3_pdf_t *pdf, double r, double g, double b)
}
}
-#line 4055 "dk3pdf.ctr"
+#line 4195 "dk3pdf.ctr"
return back;
}
@@ -4108,7 +4226,7 @@ dk3pdf_stroking_rgb(dk3_pdf_t *pdf, double r, double g, double b)
double nb; /* Corrected blue. */
-#line 4068 "dk3pdf.ctr"
+#line 4208 "dk3pdf.ctr"
nr = dk3pdf_to_range(0.0, 1.0, r);
ng = dk3pdf_to_range(0.0, 1.0, g);
nb = dk3pdf_to_range(0.0, 1.0, b);
@@ -4127,7 +4245,7 @@ dk3pdf_stroking_rgb(dk3_pdf_t *pdf, double r, double g, double b)
}
}
-#line 4085 "dk3pdf.ctr"
+#line 4225 "dk3pdf.ctr"
return back;
}
@@ -4139,7 +4257,7 @@ dk3pdf_set_linecap(dk3_pdf_t *pdf, int lc)
int back = 0;
-#line 4095 "dk3pdf.ctr"
+#line 4235 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -4160,7 +4278,7 @@ dk3pdf_set_linecap(dk3_pdf_t *pdf, int lc)
}
}
-#line 4114 "dk3pdf.ctr"
+#line 4254 "dk3pdf.ctr"
return back;
}
@@ -4172,7 +4290,7 @@ dk3pdf_set_linejoin(dk3_pdf_t *pdf, int lj)
int back = 0;
-#line 4124 "dk3pdf.ctr"
+#line 4264 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -4193,7 +4311,7 @@ dk3pdf_set_linejoin(dk3_pdf_t *pdf, int lj)
}
}
-#line 4143 "dk3pdf.ctr"
+#line 4283 "dk3pdf.ctr"
return back;
}
@@ -4204,7 +4322,7 @@ dk3pdf_stroke(dk3_pdf_t *pdf)
int back = 0;
-#line 4152 "dk3pdf.ctr"
+#line 4292 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -4214,7 +4332,7 @@ dk3pdf_stroke(dk3_pdf_t *pdf)
}
}
-#line 4160 "dk3pdf.ctr"
+#line 4300 "dk3pdf.ctr"
return back;
}
@@ -4227,7 +4345,7 @@ dk3pdf_set_linewidth(dk3_pdf_t *pdf, double lw)
int back = 0;
-#line 4171 "dk3pdf.ctr"
+#line 4311 "dk3pdf.ctr"
if(pdf) {
if(pdf->cp) {
if((pdf->cp)->tempof) {
@@ -4238,7 +4356,7 @@ dk3pdf_set_linewidth(dk3_pdf_t *pdf, double lw)
}
}
-#line 4180 "dk3pdf.ctr"
+#line 4320 "dk3pdf.ctr"
return back;
}
diff --git a/support/dktools/dk3pdf.ctr b/support/dktools/dk3pdf.ctr
index afcab2fd66..31fd3fb7a6 100644
--- a/support/dktools/dk3pdf.ctr
+++ b/support/dktools/dk3pdf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -412,6 +412,7 @@ dk3pdf_write_debug_line(dk3_pdf_t *pdf, char const *txt);
#include "dk3bmj.h"
#include "dk3bif.h"
#include "dk3bifa.h"
+#include "dk3unused.h"
$!trace-include
@@ -535,7 +536,7 @@ static char const * dk3pdf_c8_kw[] = {
/* 7 */ "%PDF-1.4\n",
/* 8 */ " 0 obj\n",
/* 9 */ "endobj\n",
-/* 10 */ "<<\n/Producer (http://dktools.sourceforge.net)\n",
+/* 10 */ "<<\n/Producer (http://sourceforge.net/p/dktools/wiki/Home/)\n",
/* 11 */ "<<\n",
/* 12 */ ">>\n",
/* 13 */ "/Type /Catalog\n",
@@ -714,11 +715,17 @@ dk3pdf_compare_pages(void const *l, void const *r, int cr)
*/
static
int
-dk3pdf_compare_object_start(void const *l, void const *r, int cr)
+dk3pdf_compare_object_start(
+ void const *l,
+ void const *r,
+ int DK3_ARG_UNUSED(cr)
+)
{
int back = 0;
dk3_pdf_object_start_t const *pl; /* Left object start. */
dk3_pdf_object_start_t const *pr; /* Right object start. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3_pdf_object_start_t const *)l;
@@ -943,6 +950,7 @@ dk3pdf_xobject_new(dk3_pdf_t *pdf)
/** Destroy page object, release memory.
@param pa Page object to destroy.
*/
+static
void
dk3pdf_page_delete(dk3_pdf_page_t *pa)
{
@@ -1684,10 +1692,17 @@ dk3pdf_transfer_dct_data(FILE *ofile, dk3_bif_t *bif, dk3_app_t *app)
static
void
dk3pdf_out_col_8_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -1698,6 +1713,11 @@ dk3pdf_out_col_8_mixed(
unsigned char ored, og, ob; /* Previous RGB values. */
unsigned char r, g, b; /* RGB values. */
$? "+ dk3pdf_out_col_8_mixed %!8s min=%d max=%d", TR_8PTR(pcomm), minpb, maxpb
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -1847,10 +1867,17 @@ dk3pdf_out_col_8_mixed(
static
void
dk3pdf_out_col_8_not_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void *DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -1861,6 +1888,11 @@ dk3pdf_out_col_8_not_mixed(
unsigned char ored, og, ob; /* Previous RGB values. */
unsigned char r, g, b; /* RGB values. */
$? "+ dk3pdf_out_col_8_not_mixed"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2010,10 +2042,17 @@ dk3pdf_out_col_8_not_mixed(
static
void
dk3pdf_out_gray_8_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2022,6 +2061,11 @@ dk3pdf_out_gray_8_mixed(
dk3_bif_coord_t w; /* Image width. */
unsigned char v, p, q; /* Value and predictor(s). */
$? "+ dk3pdf_out_gray_8_mixed"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2132,10 +2176,17 @@ dk3pdf_out_gray_8_mixed(
static
void
dk3pdf_out_gray_8_not_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2144,6 +2195,11 @@ dk3pdf_out_gray_8_not_mixed(
dk3_bif_coord_t w; /* Image width. */
unsigned char v, p, q; /* Value and predictors. */
$? "+ dk3pdf_out_gray_8_not_mixed"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2256,10 +2312,17 @@ dk3pdf_out_gray_8_not_mixed(
static
void
dk3pdf_out_col_not8_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2273,6 +2336,11 @@ dk3pdf_out_col_not8_mixed(
dk3_bif_pixel_t og; /* Previous green. */
dk3_bif_pixel_t ob; /* Previous blue. */
$? "+ dk3pdf_out_col_not8_mixed"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2326,10 +2394,17 @@ dk3pdf_out_col_not8_mixed(
static
void
dk3pdf_out_col_not8_not_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2343,6 +2418,11 @@ dk3pdf_out_col_not8_not_mixed(
dk3_bif_pixel_t og; /* Previous green. */
dk3_bif_pixel_t ob; /* Previous blue. */
$? "+ dk3pdf_out_col_not8_not_mixed"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2396,10 +2476,17 @@ dk3pdf_out_col_not8_not_mixed(
static
void
dk3pdf_out_gray_not8_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void *DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2409,6 +2496,11 @@ dk3pdf_out_gray_not8_mixed(
dk3_bif_pixel_t g; /* Current gray. */
dk3_bif_pixel_t og; /* Previous gray. */
$? "+ dk3pdf_out_gray_not8_mixed"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2452,10 +2544,17 @@ dk3pdf_out_gray_not8_mixed(
static
void
dk3pdf_out_gray_not8_not_mixed(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
dk3_bif_coord_t y; /* Current line. */
@@ -2465,6 +2564,11 @@ dk3pdf_out_gray_not8_not_mixed(
dk3_bif_pixel_t g; /* Current point gray. */
dk3_bif_pixel_t og; /* Previous gray. */
$? "+ dk3pdf_out_gray_not8_not_mixed"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
w = dk3bif_get_width(job->bif);
h = dk3bif_get_height(job->bif);
switch((job->opt)->pred) {
@@ -2510,10 +2614,17 @@ dk3pdf_out_gray_not8_not_mixed(
static
int
dk3pdf_add_alpha_xobject(
+#if DK3_USE_WX
dk3_pdf_image_job_t *job,
void *pcomm,
int min,
int max
+#else
+ dk3_pdf_image_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(min),
+ int DK3_ARG_UNUSED(max)
+#endif
)
{
dk3_stat_t stb; /* Stat buffer. */
@@ -2532,6 +2643,11 @@ dk3pdf_add_alpha_xobject(
unsigned char pc; /* Predictor as byte. */
unsigned char wc; /* Predictor as byte. */
$? "+ dk3pdf_add_alpha_xobject"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(min)
+ DK3_UNUSED_ARG(max)
+#endif
mo = dk3pdf_xobject_new(job->pdf);
if(mo) {
mo->objno = (job->pdf)->nextobject;
@@ -3324,10 +3440,17 @@ dk3pdf_decode_parms(
static
int
dk3pdf_write_file_xobjects(
+#if DK3_USE_WX
dk3_pdf_writer_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_writer_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
char buf[64]; /* Conversion buffer. */
@@ -3339,6 +3462,11 @@ dk3pdf_write_file_xobjects(
int back = 1;
int cc; /* Flag: Can continue transfer. */
$? "+ dk3pdf_write_file_xobjects"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
dk3sto_it_reset((job->pdf)->i_xobjects);
while((xo = (dk3_pdf_xobject_t *)dk3sto_it_next((job->pdf)->i_xobjects))
!= NULL
@@ -3485,10 +3613,17 @@ dk3pdf_write_file_xobjects(
static
int
dk3pdf_write_file_pages(
+#if DK3_USE_WX
dk3_pdf_writer_job_t *job,
void *pcomm,
int minpb,
int maxpb
+#else
+ dk3_pdf_writer_job_t *job,
+ void * DK3_ARG_UNUSED(pcomm),
+ int DK3_ARG_UNUSED(minpb),
+ int DK3_ARG_UNUSED(maxpb)
+#endif
)
{
char buf[4096]; /* Data transfer buffer. */
@@ -3500,6 +3635,11 @@ dk3pdf_write_file_pages(
int have_mask; /* Flag: Have alpha mask. */
int cc; /* Flag: Can continue transfer. */
$? "+ dk3pdf_write_file_pages"
+#if !DK3_USE_WX
+ DK3_UNUSED_ARG(pcomm)
+ DK3_UNUSED_ARG(minpb)
+ DK3_UNUSED_ARG(maxpb)
+#endif
dk3sto_it_reset((job->pdf)->i_pages);
while((cp = (dk3_pdf_page_t *)dk3sto_it_next((job->pdf)->i_pages)) != NULL) {
$? ". page found"
diff --git a/support/dktools/dk3pdf.h b/support/dktools/dk3pdf.h
index 5a9e03e575..fc19e3bad5 100644
--- a/support/dktools/dk3pdf.h
+++ b/support/dktools/dk3pdf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3pdf.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3pdf.ctr
*/
/** @file dk3pdf.h Header file for the dk3pdf module.
diff --git a/support/dktools/dk3pixre.c b/support/dktools/dk3pixre.c
index 75dc922d85..96d5379be5 100644
--- a/support/dktools/dk3pixre.c
+++ b/support/dktools/dk3pixre.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3pixre.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3pixre.ctr
*/
/** @file dk3pixre.c The dk3pixre module.
diff --git a/support/dktools/dk3pixre.ctr b/support/dktools/dk3pixre.ctr
index d5fb73866e..16e8963155 100644
--- a/support/dktools/dk3pixre.ctr
+++ b/support/dktools/dk3pixre.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3pixre.h b/support/dktools/dk3pixre.h
index 695c91ded0..8cb612dfb2 100644
--- a/support/dktools/dk3pixre.h
+++ b/support/dktools/dk3pixre.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3pixre.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3pixre.ctr
*/
/** @file dk3pixre.h Header file for the dk3pixre module.
diff --git a/support/dktools/dk3prcfg.c b/support/dktools/dk3prcfg.c
index 6ae9c17cbb..6c7a6e62eb 100644
--- a/support/dktools/dk3prcfg.c
+++ b/support/dktools/dk3prcfg.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3prcfg.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3prcfg.ctr
*/
/** @file dk3prcfg.c The dk3prcfg module.
@@ -1492,7 +1470,6 @@ dk3print_lh_pr_receive_timeout(
/** Set orderly release.
@param pc Print configuration to set up.
- @param pr Printer to set up.
@param det Details for current printer.
@param tp Current printer type.
@param vptr Value text.
@@ -1502,7 +1479,6 @@ static
int
dk3print_lh_pr_set_orderly_release(
dk3_print_conf_t *pc,
- dk3_printer_t *pr,
dk3_printer_details_t *det,
int tp,
dkChar const *vptr
@@ -1511,7 +1487,7 @@ dk3print_lh_pr_set_orderly_release(
int back = -1;
-#line 1384 "dk3prcfg.ctr"
+#line 1382 "dk3prcfg.ctr"
if(DK3_PRINTER_TYPE_SOCKET == tp) {
if(vptr) {
if(dk3str_is_bool(vptr)) {
@@ -1527,7 +1503,7 @@ dk3print_lh_pr_set_orderly_release(
}
}
-#line 1398 "dk3prcfg.ctr"
+#line 1396 "dk3prcfg.ctr"
return back;
}
@@ -1550,13 +1526,13 @@ dk3print_lh_pr_orderly_release(
int back = -1;
-#line 1419 "dk3prcfg.ctr"
+#line 1417 "dk3prcfg.ctr"
switch(pr->t_p) {
case DK3_PRINTER_TYPE_WINDOWS: {
switch(pr->t_s) {
case DK3_PRINTER_TYPE_SOCKET: {
back =
- dk3print_lh_pr_set_orderly_release(pc,pr,&(pr->det_s),pr->t_s,vptr);
+ dk3print_lh_pr_set_orderly_release(pc,&(pr->det_s),pr->t_s,vptr);
} break;
default: {
/* ERROR: Option not available */
@@ -1569,7 +1545,7 @@ dk3print_lh_pr_orderly_release(
} break;
case DK3_PRINTER_TYPE_SOCKET: {
back =
- dk3print_lh_pr_set_orderly_release(pc,pr,&(pr->det_p),pr->t_p,vptr);
+ dk3print_lh_pr_set_orderly_release(pc,&(pr->det_p),pr->t_p,vptr);
} break;
default: {
/* ERROR: Option not available */
@@ -1580,14 +1556,13 @@ dk3print_lh_pr_orderly_release(
} break;
}
-#line 1447 "dk3prcfg.ctr"
+#line 1445 "dk3prcfg.ctr"
return back;
}
/** Process configuration line for current printer.
- @param proc Configuration processor.
@param pc Print configuration to set up.
@param pr Current printer to modify.
@param il Input line to process.
@@ -1597,7 +1572,6 @@ dk3print_lh_pr_orderly_release(
static
int
dk3print_lh_printer_line(
- dk3_print_config_processor_t *proc,
dk3_print_conf_t *pc,
dk3_printer_t *pr,
dkChar *il
@@ -1608,7 +1582,7 @@ dk3print_lh_printer_line(
int back = -1;
-#line 1473 "dk3prcfg.ctr"
+#line 1469 "dk3prcfg.ctr"
kptr = vptr = NULL;
kptr = dk3str_start(il, NULL);
if(kptr) {
@@ -1621,72 +1595,72 @@ dk3print_lh_printer_line(
switch(dk3str_array_index(dk3prcfg_printer_keywords, kptr, 0)) {
case 0: {
-#line 1484 "dk3prcfg.ctr"
+#line 1480 "dk3prcfg.ctr"
back = dk3print_lh_pr_alias(pc, pr, vptr);
} break;
case 1: {
-#line 1487 "dk3prcfg.ctr"
+#line 1483 "dk3prcfg.ctr"
back = dk3print_lh_pr_type(pc, pr, vptr);
} break;
case 2: {
-#line 1490 "dk3prcfg.ctr"
+#line 1486 "dk3prcfg.ctr"
back = dk3print_lh_pr_host(pc, pr, vptr);
} break;
case 3: {
-#line 1493 "dk3prcfg.ctr"
+#line 1489 "dk3prcfg.ctr"
back = dk3print_lh_pr_queue(pc, pr, vptr);
} break;
case 4: {
-#line 1496 "dk3prcfg.ctr"
+#line 1492 "dk3prcfg.ctr"
back = dk3print_lh_pr_port(pc, pr, vptr);
} break;
case 5: {
-#line 1499 "dk3prcfg.ctr"
+#line 1495 "dk3prcfg.ctr"
back = dk3print_lh_pr_ps(pc, pr, vptr);
} break;
case 6: {
-#line 1502 "dk3prcfg.ctr"
+#line 1498 "dk3prcfg.ctr"
back = dk3print_lh_pr_psl(pc, pr, vptr);
} break;
case 7: {
-#line 1505 "dk3prcfg.ctr"
+#line 1501 "dk3prcfg.ctr"
back = dk3print_lh_pr_default(pc, pr, vptr);
} break;
case 8: {
-#line 1508 "dk3prcfg.ctr"
+#line 1504 "dk3prcfg.ctr"
back = dk3print_lh_pr_snmp_host(pc, pr, vptr);
} break;
case 9: {
-#line 1511 "dk3prcfg.ctr"
+#line 1507 "dk3prcfg.ctr"
back = dk3print_lh_pr_snmp_community(pc, pr, vptr);
} break;
case 10: {
-#line 1514 "dk3prcfg.ctr"
+#line 1510 "dk3prcfg.ctr"
back = dk3print_lh_pr_snmp_version(pc, pr, vptr);
} break;
case 11: {
-#line 1517 "dk3prcfg.ctr"
+#line 1513 "dk3prcfg.ctr"
back = dk3print_lh_pr_connect_timeout(pc, pr, vptr);
} break;
case 12: {
-#line 1520 "dk3prcfg.ctr"
+#line 1516 "dk3prcfg.ctr"
back = dk3print_lh_pr_send_timeout(pc, pr, vptr);
} break;
case 13: {
-#line 1523 "dk3prcfg.ctr"
+#line 1519 "dk3prcfg.ctr"
back = dk3print_lh_pr_receive_timeout(pc, pr, vptr);
} break;
case 14: {
@@ -1701,7 +1675,7 @@ dk3print_lh_printer_line(
back = 1;
}
-#line 1536 "dk3prcfg.ctr"
+#line 1532 "dk3prcfg.ctr"
return back;
}
@@ -1726,7 +1700,7 @@ dk3print_lh_ho_alias(
int back = -1;
-#line 1559 "dk3prcfg.ctr"
+#line 1555 "dk3prcfg.ctr"
if(vptr) {
ptr = dk3sto_it_find_like(pc->iPrintHosts, (void *)vptr, 1);
if(ptr) {
@@ -1762,7 +1736,7 @@ dk3print_lh_ho_alias(
);
}
-#line 1593 "dk3prcfg.ctr"
+#line 1589 "dk3prcfg.ctr"
return back;
}
@@ -1786,7 +1760,7 @@ dk3print_lh_ho_encoding(
int enc; /* Encoding used on host. */
-#line 1615 "dk3prcfg.ctr"
+#line 1611 "dk3prcfg.ctr"
if(vptr) {
enc = dk3enc_get_text_encoding_app(vptr, pc->app);
if(-1 != enc) {
@@ -1811,7 +1785,7 @@ dk3print_lh_ho_encoding(
);
}
-#line 1638 "dk3prcfg.ctr"
+#line 1634 "dk3prcfg.ctr"
return back;
}
@@ -1839,7 +1813,7 @@ dk3print_lh_ho_timeout(
int back = -1;
-#line 1664 "dk3prcfg.ctr"
+#line 1660 "dk3prcfg.ctr"
if(vptr) {
#if VERSION_BEFORE_20140716
if(dk3sf_sscanf3(vptr,dk3prcfg_nl[3],&d))
@@ -1915,7 +1889,7 @@ dk3print_lh_ho_timeout(
);
}
-#line 1738 "dk3prcfg.ctr"
+#line 1734 "dk3prcfg.ctr"
return back;
}
@@ -1956,7 +1930,6 @@ dk3print_lh_ho_default(
/** Process configuration line for current host.
- @param proc Configuration processor.
@param pc Print configuration to set up.
@param ho Current host.
@param il Input line to process.
@@ -1966,7 +1939,6 @@ dk3print_lh_ho_default(
static
int
dk3print_lh_host_line(
- dk3_print_config_processor_t *proc,
dk3_print_conf_t *pc,
dk3_print_host_t *ho,
dkChar *il
@@ -1977,7 +1949,7 @@ dk3print_lh_host_line(
int back = -1;
-#line 1798 "dk3prcfg.ctr"
+#line 1792 "dk3prcfg.ctr"
kptr = vptr = NULL;
kptr = dk3str_start(il, NULL);
if(kptr) {
@@ -1990,27 +1962,27 @@ dk3print_lh_host_line(
switch(dk3str_array_index(dk3prcfg_host_keywords, kptr, 0)) {
case 0: {
-#line 1809 "dk3prcfg.ctr"
+#line 1803 "dk3prcfg.ctr"
back = dk3print_lh_ho_alias(pc, ho, vptr);
} break;
case 1: {
-#line 1812 "dk3prcfg.ctr"
+#line 1806 "dk3prcfg.ctr"
back = dk3print_lh_ho_encoding(pc, ho, vptr);
} break;
case 2: {
-#line 1815 "dk3prcfg.ctr"
+#line 1809 "dk3prcfg.ctr"
back = dk3print_lh_ho_timeout(pc, ho, vptr, 0);
} break;
case 3: {
-#line 1818 "dk3prcfg.ctr"
+#line 1812 "dk3prcfg.ctr"
back = dk3print_lh_ho_timeout(pc, ho, vptr, 1);
} break;
case 4: {
-#line 1821 "dk3prcfg.ctr"
+#line 1815 "dk3prcfg.ctr"
back = dk3print_lh_ho_timeout(pc, ho, vptr, 2);
} break;
case 5: {
@@ -2018,7 +1990,7 @@ dk3print_lh_host_line(
} break;
default: {
-#line 1827 "dk3prcfg.ctr"
+#line 1821 "dk3prcfg.ctr"
/* ERROR: Unknown option! */
dk3app_log_3(pc->app, DK3_LL_ERROR, pc->msg, 64, 65, vptr);
} break;
@@ -2027,7 +1999,7 @@ dk3print_lh_host_line(
back = 1;
}
-#line 1834 "dk3prcfg.ctr"
+#line 1828 "dk3prcfg.ctr"
return back;
}
@@ -2049,38 +2021,38 @@ dk3print_config_line_handler(void *obj, dkChar *il)
int back = 1;
-#line 1854 "dk3prcfg.ctr"
+#line 1848 "dk3prcfg.ctr"
pr = (dk3_print_config_processor_t *)obj;
pc = pr->pc;
p1 = dk3str_start(il, NULL);
if(p1) {
dk3str_delnl(p1);
-#line 1859 "dk3prcfg.ctr"
+#line 1853 "dk3prcfg.ctr"
if(dkT('#') != *p1) {
-#line 1860 "dk3prcfg.ctr"
+#line 1854 "dk3prcfg.ctr"
if(dkT('[') == *p1) {
-#line 1861 "dk3prcfg.ctr"
+#line 1855 "dk3prcfg.ctr"
pr->pr = NULL;
pr->ho = NULL;
back = dk3print_lh_printer_or_host(pr, pc, p1);
} else {
-#line 1865 "dk3prcfg.ctr"
+#line 1859 "dk3prcfg.ctr"
if(pr->pr) {
-#line 1866 "dk3prcfg.ctr"
- back = dk3print_lh_printer_line(pr, pc, pr->pr, p1);
+#line 1860 "dk3prcfg.ctr"
+ back = dk3print_lh_printer_line(pc, pr->pr, p1);
} else {
if(pr->ho) {
-#line 1869 "dk3prcfg.ctr"
- back = dk3print_lh_host_line(pr, pc, pr->ho, p1);
+#line 1863 "dk3prcfg.ctr"
+ back = dk3print_lh_host_line(pc, pr->ho, p1);
} else {
-#line 1871 "dk3prcfg.ctr"
+#line 1865 "dk3prcfg.ctr"
/* WARNING: Line not belonging to printer or host! */
dk3app_log_1(pc->app, DK3_LL_WARNING, pc->msg, 72);
}
@@ -2089,10 +2061,10 @@ dk3print_config_line_handler(void *obj, dkChar *il)
}
} else {
-#line 1878 "dk3prcfg.ctr"
+#line 1872 "dk3prcfg.ctr"
}
-#line 1879 "dk3prcfg.ctr"
+#line 1873 "dk3prcfg.ctr"
return back;
}
@@ -2116,7 +2088,7 @@ dk3print_process_one_config_file(dk3_print_conf_t *pc, dkChar const *fn)
int back = 0;
-#line 1901 "dk3prcfg.ctr"
+#line 1895 "dk3prcfg.ctr"
if(pc->app) {
oldsrcname = dk3app_get_source_file(pc->app);
oldsrcline = dk3app_get_source_line(pc->app);
@@ -2148,7 +2120,7 @@ dk3print_process_one_config_file(dk3_print_conf_t *pc, dkChar const *fn)
dk3app_set_source_line(pc->app, oldsrcline);
}
-#line 1931 "dk3prcfg.ctr"
+#line 1925 "dk3prcfg.ctr"
return back;
}
@@ -2162,7 +2134,7 @@ dk3print_read_config_files(dk3_print_conf_t *pc)
int back = 1;
-#line 1943 "dk3prcfg.ctr"
+#line 1937 "dk3prcfg.ctr"
if(pc) {
if(pc->app) {
srch = dk3app_find_config_file(pc->app, dk3prcfg_nl[0], 0);
@@ -2170,7 +2142,7 @@ dk3print_read_config_files(dk3_print_conf_t *pc)
dk3search_reset(srch);
while(NULL != (fn = dk3search_next(srch))) {
-#line 1949 "dk3prcfg.ctr"
+#line 1943 "dk3prcfg.ctr"
if(!dk3print_process_one_config_file(pc, fn)) {
back = 0;
}
@@ -2180,7 +2152,7 @@ dk3print_read_config_files(dk3_print_conf_t *pc)
}
}
-#line 1957 "dk3prcfg.ctr"
+#line 1951 "dk3prcfg.ctr"
return back;
}
diff --git a/support/dktools/dk3prcfg.ctr b/support/dktools/dk3prcfg.ctr
index e99e0e1761..24df230508 100644
--- a/support/dktools/dk3prcfg.ctr
+++ b/support/dktools/dk3prcfg.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -1363,7 +1363,6 @@ dk3print_lh_pr_receive_timeout(
/** Set orderly release.
@param pc Print configuration to set up.
- @param pr Printer to set up.
@param det Details for current printer.
@param tp Current printer type.
@param vptr Value text.
@@ -1373,7 +1372,6 @@ static
int
dk3print_lh_pr_set_orderly_release(
dk3_print_conf_t *pc,
- dk3_printer_t *pr,
dk3_printer_details_t *det,
int tp,
dkChar const *vptr
@@ -1421,7 +1419,7 @@ dk3print_lh_pr_orderly_release(
switch(pr->t_s) {
case DK3_PRINTER_TYPE_SOCKET: {
back =
- dk3print_lh_pr_set_orderly_release(pc,pr,&(pr->det_s),pr->t_s,vptr);
+ dk3print_lh_pr_set_orderly_release(pc,&(pr->det_s),pr->t_s,vptr);
} break;
default: {
/* ERROR: Option not available */
@@ -1434,7 +1432,7 @@ dk3print_lh_pr_orderly_release(
} break;
case DK3_PRINTER_TYPE_SOCKET: {
back =
- dk3print_lh_pr_set_orderly_release(pc,pr,&(pr->det_p),pr->t_p,vptr);
+ dk3print_lh_pr_set_orderly_release(pc,&(pr->det_p),pr->t_p,vptr);
} break;
default: {
/* ERROR: Option not available */
@@ -1450,7 +1448,6 @@ dk3print_lh_pr_orderly_release(
/** Process configuration line for current printer.
- @param proc Configuration processor.
@param pc Print configuration to set up.
@param pr Current printer to modify.
@param il Input line to process.
@@ -1460,7 +1457,6 @@ dk3print_lh_pr_orderly_release(
static
int
dk3print_lh_printer_line(
- dk3_print_config_processor_t *proc,
dk3_print_conf_t *pc,
dk3_printer_t *pr,
dkChar *il
@@ -1775,7 +1771,6 @@ dk3print_lh_ho_default(
/** Process configuration line for current host.
- @param proc Configuration processor.
@param pc Print configuration to set up.
@param ho Current host.
@param il Input line to process.
@@ -1785,7 +1780,6 @@ dk3print_lh_ho_default(
static
int
dk3print_lh_host_line(
- dk3_print_config_processor_t *proc,
dk3_print_conf_t *pc,
dk3_print_host_t *ho,
dkChar *il
@@ -1863,10 +1857,10 @@ dk3print_config_line_handler(void *obj, dkChar *il)
back = dk3print_lh_printer_or_host(pr, pc, p1);
} else { $? ". printer or host details"
if(pr->pr) { $? ". configure printer"
- back = dk3print_lh_printer_line(pr, pc, pr->pr, p1);
+ back = dk3print_lh_printer_line(pc, pr->pr, p1);
} else {
if(pr->ho) { $? ". configure host"
- back = dk3print_lh_host_line(pr, pc, pr->ho, p1);
+ back = dk3print_lh_host_line(pc, pr->ho, p1);
} else { $? ". no printer or host open"
/* WARNING: Line not belonging to printer or host! */
dk3app_log_1(pc->app, DK3_LL_WARNING, pc->msg, 72);
diff --git a/support/dktools/dk3prcfg.h b/support/dktools/dk3prcfg.h
index 9fd8860f72..26fab757a7 100644
--- a/support/dktools/dk3prcfg.h
+++ b/support/dktools/dk3prcfg.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3prcfg.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3prcfg.ctr
*/
/** @file dk3prcfg.h Header file for the dk3prcfg module.
diff --git a/support/dktools/dk3print.c b/support/dktools/dk3print.c
index f9c489ceb5..f39c12ddca 100644
--- a/support/dktools/dk3print.c
+++ b/support/dktools/dk3print.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3print.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3print.ctr
*/
/** @file dk3print.c The dk3print module.
@@ -45,12 +23,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3print.h"
#include "dk3prcfg.h"
#include "dk3prreq.h"
+#include "dk3unused.h"
-#line 147 "dk3print.ctr"
+#line 148 "dk3print.ctr"
@@ -81,7 +60,7 @@ dkT("%d"),
NULL
-#line 183 "dk3print.ctr"
+#line 184 "dk3print.ctr"
};
@@ -311,7 +290,7 @@ dkT("Line outside scope, not belonging to printer or host!"),
NULL
-#line 415 "dk3print.ctr"
+#line 416 "dk3print.ctr"
};
@@ -321,12 +300,12 @@ dk3print_win_det_cleanup(dk3_printer_windows_details_t *ptr)
{
-#line 423 "dk3print.ctr"
+#line 424 "dk3print.ctr"
if(ptr) {
}
-#line 426 "dk3print.ctr"
+#line 427 "dk3print.ctr"
}
@@ -336,14 +315,14 @@ dk3print_lprng_det_cleanup(dk3_printer_lprng_details_t *ptr)
{
-#line 434 "dk3print.ctr"
+#line 435 "dk3print.ctr"
if(ptr) {
dk3_release(ptr->hostname);
dk3_release(ptr->queuename);
}
-#line 439 "dk3print.ctr"
+#line 440 "dk3print.ctr"
}
@@ -353,7 +332,7 @@ dk3print_socket_det_cleanup(dk3_printer_socket_t *ptr)
{
-#line 447 "dk3print.ctr"
+#line 448 "dk3print.ctr"
if(ptr) {
dk3_release(ptr->hostname);
ptr->portno = 0;
@@ -361,7 +340,7 @@ dk3print_socket_det_cleanup(dk3_printer_socket_t *ptr)
}
-#line 453 "dk3print.ctr"
+#line 454 "dk3print.ctr"
}
@@ -371,7 +350,7 @@ dk3print_det_cleanup(int tp, dk3_printer_details_t *ptr)
{
-#line 461 "dk3print.ctr"
+#line 462 "dk3print.ctr"
if(ptr) {
switch(tp) {
case DK3_PRINTER_TYPE_WINDOWS: {
@@ -390,7 +369,7 @@ dk3print_det_cleanup(int tp, dk3_printer_details_t *ptr)
}
-#line 478 "dk3print.ctr"
+#line 479 "dk3print.ctr"
}
@@ -400,7 +379,7 @@ dk3print_printer_delete(dk3_printer_t *ptr)
{
-#line 486 "dk3print.ctr"
+#line 487 "dk3print.ctr"
if(ptr) {
dk3print_det_cleanup(ptr->t_p, &(ptr->det_p));
dk3print_det_cleanup(ptr->t_s, &(ptr->det_s));
@@ -410,7 +389,7 @@ dk3print_printer_delete(dk3_printer_t *ptr)
dk3_delete(ptr);
}
-#line 494 "dk3print.ctr"
+#line 495 "dk3print.ctr"
}
@@ -460,7 +439,7 @@ dk3print_alias_delete(dk3_printer_alias_t *ptr)
{
-#line 542 "dk3print.ctr"
+#line 543 "dk3print.ctr"
if(ptr) {
dk3_release(ptr->name);
ptr->printer = NULL;
@@ -468,7 +447,7 @@ dk3print_alias_delete(dk3_printer_alias_t *ptr)
}
-#line 548 "dk3print.ctr"
+#line 549 "dk3print.ctr"
}
@@ -478,14 +457,14 @@ dk3print_host_delete(dk3_print_host_t *ptr)
{
-#line 556 "dk3print.ctr"
+#line 557 "dk3print.ctr"
if(ptr) {
dk3_release(ptr->name);
dk3_delete(ptr);
}
-#line 561 "dk3print.ctr"
+#line 562 "dk3print.ctr"
}
@@ -536,7 +515,7 @@ dk3print_host_alias_delete(dk3_print_host_alias_t *ptr)
{
-#line 610 "dk3print.ctr"
+#line 611 "dk3print.ctr"
if(ptr) {
dk3_release(ptr->name);
ptr->host = NULL;
@@ -544,7 +523,7 @@ dk3print_host_alias_delete(dk3_print_host_alias_t *ptr)
}
-#line 616 "dk3print.ctr"
+#line 617 "dk3print.ctr"
}
@@ -556,7 +535,7 @@ dk3print_conf_delete(dk3_print_conf_t *pc)
-#line 626 "dk3print.ctr"
+#line 627 "dk3print.ctr"
if(pc) {
pc->defPrinter = NULL;
pc->defHost = NULL;
@@ -605,7 +584,7 @@ dk3print_conf_delete(dk3_print_conf_t *pc)
dk3_delete(pc);
}
-#line 673 "dk3print.ctr"
+#line 674 "dk3print.ctr"
}
@@ -849,7 +828,7 @@ dk3print_config_new(dk3_app_t *app)
int ok = 0; /* Flag: Success. */
-#line 915 "dk3print.ctr"
+#line 916 "dk3print.ctr"
if(app) {
back = dk3_new_app(dk3_print_conf_t,1,app);
if(back) {
@@ -903,7 +882,7 @@ dk3print_config_new(dk3_app_t *app)
}
}
-#line 967 "dk3print.ctr"
+#line 968 "dk3print.ctr"
return back;
}
@@ -984,7 +963,7 @@ dk3print_read_system(dk3_print_conf_t *pc)
int back = 1;
-#line 1046 "dk3print.ctr"
+#line 1047 "dk3print.ctr"
cbNeeded = cbReturned = szPeb = (DWORD)0UL;
#if DK3_CHAR_SIZE > 1
EnumPrintersW(PRINTER_ENUM_LOCAL,NULL,2,NULL,szPeb,&cbNeeded,&cbReturned);
@@ -1007,7 +986,11 @@ dk3print_read_system(dk3_print_conf_t *pc)
#endif
if(res) {
if((DWORD)0UL < cbReturned) {
- pi2 = (PRINTER_INFO_2 *)peb;
+#if DK3_CHAR_SIZE > 1
+ pi2 = (PRINTER_INFO_2W *)peb;
+#else
+ pi2 = (PRINTER_INFO_2A *)peb;
+#endif
for(i = (DWORD)0UL; i < cbReturned; i++) {
printer = dk3print_printer_new(pc, pi2->pPrinterName);
if(printer) {
@@ -1025,17 +1008,17 @@ dk3print_read_system(dk3_print_conf_t *pc)
}
} else {
-#line 1085 "dk3print.ctr"
+#line 1090 "dk3print.ctr"
}
} else {
-#line 1087 "dk3print.ctr"
+#line 1092 "dk3print.ctr"
back = 0;
}
dk3_delete(peb);
} else {
-#line 1091 "dk3print.ctr"
+#line 1096 "dk3print.ctr"
back = 0;
}
if(back) {
@@ -1060,11 +1043,11 @@ dk3print_read_system(dk3_print_conf_t *pc)
}
} else {
-#line 1114 "dk3print.ctr"
+#line 1119 "dk3print.ctr"
}
-#line 1116 "dk3print.ctr"
+#line 1121 "dk3print.ctr"
return back;
}
@@ -1079,16 +1062,17 @@ dk3print_read_system(dk3_print_conf_t *pc)
*/
static
int
-dk3print_read_system(dk3_print_conf_t *pc)
+dk3print_read_system(dk3_print_conf_t * DK3_ARG_UNUSED(pc) )
{
int back = 1;
-#line 1134 "dk3print.ctr"
+#line 1139 "dk3print.ctr"
+ DK3_UNUSED_ARG(pc)
/* ##### Read /etc/printcap */
-#line 1136 "dk3print.ctr"
+#line 1142 "dk3print.ctr"
return back;
}
@@ -1111,7 +1095,7 @@ dk3print_read_configuration(dk3_print_conf_t *pc, int useConfigFiles)
-#line 1157 "dk3print.ctr"
+#line 1163 "dk3print.ctr"
/* Find default PS level from preferences */
if(pc->app) {
if(dk3app_get_pref(pc->app, dk3print_nl[5], buf, DK3_SIZEOF(buf,dkChar))) {
@@ -1144,7 +1128,7 @@ dk3print_read_configuration(dk3_print_conf_t *pc, int useConfigFiles)
}
}
-#line 1188 "dk3print.ctr"
+#line 1194 "dk3print.ctr"
return back;
}
@@ -1156,7 +1140,7 @@ dk3print_conf_open(dk3_app_t *app, int useConfigFiles)
dk3_print_conf_t *back = NULL;
-#line 1198 "dk3print.ctr"
+#line 1204 "dk3print.ctr"
if(app) {
back = dk3print_config_new(app);
if(back) {
@@ -1167,7 +1151,7 @@ dk3print_conf_open(dk3_app_t *app, int useConfigFiles)
}
}
-#line 1207 "dk3print.ctr"
+#line 1213 "dk3print.ctr"
return back;
}
@@ -1178,12 +1162,12 @@ dk3print_conf_close(dk3_print_conf_t *pc)
{
-#line 1216 "dk3print.ctr"
+#line 1222 "dk3print.ctr"
if(pc) {
dk3print_conf_delete(pc);
}
-#line 1219 "dk3print.ctr"
+#line 1225 "dk3print.ctr"
}
@@ -1193,7 +1177,7 @@ dk3print_set_det(dk3_printer_details_t *det, int tp)
{
-#line 1227 "dk3print.ctr"
+#line 1233 "dk3print.ctr"
if(det) {
switch(tp) {
case DK3_PRINTER_TYPE_WINDOWS: {
@@ -1219,7 +1203,7 @@ dk3print_set_det(dk3_printer_details_t *det, int tp)
}
}
-#line 1251 "dk3print.ctr"
+#line 1257 "dk3print.ctr"
}
diff --git a/support/dktools/dk3print.ctr b/support/dktools/dk3print.ctr
index d979b0191d..9e0118209d 100644
--- a/support/dktools/dk3print.ctr
+++ b/support/dktools/dk3print.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -140,6 +140,7 @@ dk3print_get_host(dk3_print_conf_t *pc, dkChar const *hn);
#include "dk3print.h"
#include "dk3prcfg.h"
#include "dk3prreq.h"
+#include "dk3unused.h"
@@ -1065,7 +1066,11 @@ dk3print_read_system(dk3_print_conf_t *pc)
#endif
if(res) {
if((DWORD)0UL < cbReturned) {
- pi2 = (PRINTER_INFO_2 *)peb;
+#if DK3_CHAR_SIZE > 1
+ pi2 = (PRINTER_INFO_2W *)peb;
+#else
+ pi2 = (PRINTER_INFO_2A *)peb;
+#endif
for(i = (DWORD)0UL; i < cbReturned; i++) {
printer = dk3print_printer_new(pc, pi2->pPrinterName);
if(printer) {
@@ -1127,10 +1132,11 @@ dk3print_read_system(dk3_print_conf_t *pc)
*/
static
int
-dk3print_read_system(dk3_print_conf_t *pc)
+dk3print_read_system(dk3_print_conf_t * DK3_ARG_UNUSED(pc) )
{
int back = 1;
$? "+ dk3print_read_system (UNIX)"
+ DK3_UNUSED_ARG(pc)
/* ##### Read /etc/printcap */
$? "- dk3print_read_system %d", back
return back;
diff --git a/support/dktools/dk3print.h b/support/dktools/dk3print.h
index 47fcd15b80..c0f436be9a 100644
--- a/support/dktools/dk3print.h
+++ b/support/dktools/dk3print.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3print.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3print.ctr
*/
/** @file dk3print.h Header file for the dk3print module.
diff --git a/support/dktools/dk3prreq.c b/support/dktools/dk3prreq.c
index 5c12f7a039..327306423c 100644
--- a/support/dktools/dk3prreq.c
+++ b/support/dktools/dk3prreq.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk3prreq.ctr
@@ -9,7 +15,7 @@
*/
-#line 20 "dk3prreq.ctr"
+#line 23 "dk3prreq.ctr"
#include "dk3all.h"
@@ -37,7 +43,9 @@ dk3prreq_details_report(
)
{
dkChar buf[16]; /* Buffer for numeric values. */
+#if VERSION_BEFORE_2019_10_20
int isdefault = 0; /* Flag: This is the default printer. */
+#endif
int res; /* Result from conv to string. */
/* Type */
@@ -64,7 +72,9 @@ dk3prreq_details_report(
if(isprim) {
if(pc->defPrinter) {
if(dk3str_cmp((pc->defPrinter)->name, pr->name) == 0) {
+#if VERSION_BEFORE_2019_10_20
isdefault = 1;
+#endif
dk3sf_fputs((pc->msg)[11], stdout);
dk3sf_fputs((pc->msg)[21], stdout);
dk3sf_fputc(dkT('\n'), stdout);
diff --git a/support/dktools/dk3prreq.ctr b/support/dktools/dk3prreq.ctr
index 8fb1a04944..808c108146 100644
--- a/support/dktools/dk3prreq.ctr
+++ b/support/dktools/dk3prreq.ctr
@@ -1,4 +1,7 @@
%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -44,7 +47,9 @@ dk3prreq_details_report(
)
{
dkChar buf[16]; /* Buffer for numeric values. */
+#if VERSION_BEFORE_2019_10_20
int isdefault = 0; /* Flag: This is the default printer. */
+#endif
int res; /* Result from conv to string. */
/* Type */
@@ -71,7 +76,9 @@ dk3prreq_details_report(
if(isprim) {
if(pc->defPrinter) {
if(dk3str_cmp((pc->defPrinter)->name, pr->name) == 0) {
+#if VERSION_BEFORE_2019_10_20
isdefault = 1;
+#endif
dk3sf_fputs((pc->msg)[11], stdout);
dk3sf_fputs((pc->msg)[21], stdout);
dk3sf_fputc(dkT('\n'), stdout);
diff --git a/support/dktools/dk3prreq.h b/support/dktools/dk3prreq.h
index a0a357b4e8..1cabeefaf9 100644
--- a/support/dktools/dk3prreq.h
+++ b/support/dktools/dk3prreq.h
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk3prreq.ctr
@@ -13,7 +19,7 @@
#define DK3PRREQ_H_INCLUDED 1
-#line 4 "dk3prreq.ctr"
+#line 7 "dk3prreq.ctr"
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk3range.h b/support/dktools/dk3range.h
index 8b4666e1a4..09d0a4aa18 100644
--- a/support/dktools/dk3range.h
+++ b/support/dktools/dk3range.h
@@ -1,4 +1,7 @@
-
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK3_RANGE_H_INCLUDED
#define DK3_RANGE_H_INCLUDED 1
diff --git a/support/dktools/dk3se.c b/support/dktools/dk3se.c
index db3d0a2960..7cbbb0420f 100644
--- a/support/dktools/dk3se.c
+++ b/support/dktools/dk3se.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3se.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3se.ctr
*/
/** @file dk3se.c The dk3se module.
@@ -43,12 +21,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "dk3se.h"
+#include "dk3enc.h"
+#include "dk3unused.h"
-
-#line 106 "dk3se.ctr"
+#line 107 "dk3se.ctr"
@@ -67,7 +46,7 @@ dk3se_find_ansi_char(char *dp, dk3_c32_t c32)
char c = '\0';
-#line 123 "dk3se.ctr"
+#line 124 "dk3se.ctr"
if((dk3_c32_t)0x00010000UL > c32) {
u = (unsigned)c32;
if(((dk3_c32_t)0x00000019UL < c32) && ((dk3_c32_t)0x00000080UL > c32)) {
@@ -79,49 +58,49 @@ dk3se_find_ansi_char(char *dp, dk3_c32_t c32)
back = 1;
} else {
switch(u) {
- case 0x20AC: { c = (char)0x80; back = 1; } break;
- case 0x0081: { c = (char)0x81; back = 1; } break;
- case 0x201A: { c = (char)0x82; back = 1; } break;
- case 0x0192: { c = (char)0x83; back = 1; } break;
- case 0x201E: { c = (char)0x84; back = 1; } break;
- case 0x2026: { c = (char)0x85; back = 1; } break;
- case 0x2020: { c = (char)0x86; back = 1; } break;
- case 0x2021: { c = (char)0x87; back = 1; } break;
- case 0x02C6: { c = (char)0x88; back = 1; } break;
- case 0x2030: { c = (char)0x89; back = 1; } break;
- case 0x0160: { c = (char)0x8A; back = 1; } break;
- case 0x2039: { c = (char)0x8B; back = 1; } break;
- case 0x0152: { c = (char)0x8C; back = 1; } break;
- case 0x008D: { c = (char)0x8D; back = 1; } break;
- case 0x017D: { c = (char)0x8E; back = 1; } break;
- case 0x008F: { c = (char)0x8F; back = 1; } break;
- case 0x0090: { c = (char)0x90; back = 1; } break;
- case 0x2018: { c = (char)0x91; back = 1; } break;
- case 0x2019: { c = (char)0x92; back = 1; } break;
- case 0x201C: { c = (char)0x93; back = 1; } break;
- case 0x201D: { c = (char)0x94; back = 1; } break;
- case 0x2022: { c = (char)0x95; back = 1; } break;
- case 0x2013: { c = (char)0x96; back = 1; } break;
- case 0x2014: { c = (char)0x97; back = 1; } break;
- case 0x02DC: { c = (char)0x98; back = 1; } break;
- case 0x2122: { c = (char)0x99; back = 1; } break;
- case 0x0161: { c = (char)0x9A; back = 1; } break;
- case 0x203A: { c = (char)0x9B; back = 1; } break;
- case 0x0153: { c = (char)0x9C; back = 1; } break;
- case 0x009D: { c = (char)0x9D; back = 1; } break;
- case 0x017E: { c = (char)0x9E; back = 1; } break;
- case 0x0178: { c = (char)0x9F; back = 1; } break;
+ case 0x20AC: { c = '\x80'; back = 1; } break;
+ case 0x0081: { c = '\x81'; back = 1; } break;
+ case 0x201A: { c = '\x82'; back = 1; } break;
+ case 0x0192: { c = '\x83'; back = 1; } break;
+ case 0x201E: { c = '\x84'; back = 1; } break;
+ case 0x2026: { c = '\x85'; back = 1; } break;
+ case 0x2020: { c = '\x86'; back = 1; } break;
+ case 0x2021: { c = '\x87'; back = 1; } break;
+ case 0x02C6: { c = '\x88'; back = 1; } break;
+ case 0x2030: { c = '\x89'; back = 1; } break;
+ case 0x0160: { c = '\x8A'; back = 1; } break;
+ case 0x2039: { c = '\x8B'; back = 1; } break;
+ case 0x0152: { c = '\x8C'; back = 1; } break;
+ case 0x008D: { c = '\x8D'; back = 1; } break;
+ case 0x017D: { c = '\x8E'; back = 1; } break;
+ case 0x008F: { c = '\x8F'; back = 1; } break;
+ case 0x0090: { c = '\x90'; back = 1; } break;
+ case 0x2018: { c = '\x91'; back = 1; } break;
+ case 0x2019: { c = '\x92'; back = 1; } break;
+ case 0x201C: { c = '\x93'; back = 1; } break;
+ case 0x201D: { c = '\x94'; back = 1; } break;
+ case 0x2022: { c = '\x95'; back = 1; } break;
+ case 0x2013: { c = '\x96'; back = 1; } break;
+ case 0x2014: { c = '\x97'; back = 1; } break;
+ case 0x02DC: { c = '\x98'; back = 1; } break;
+ case 0x2122: { c = '\x99'; back = 1; } break;
+ case 0x0161: { c = '\x9A'; back = 1; } break;
+ case 0x203A: { c = '\x9B'; back = 1; } break;
+ case 0x0153: { c = '\x9C'; back = 1; } break;
+ case 0x009D: { c = '\x9D'; back = 1; } break;
+ case 0x017E: { c = '\x9E'; back = 1; } break;
+ case 0x0178: { c = '\x9F'; back = 1; } break;
}
}
}
}
if(back) {
-#line 171 "dk3se.ctr"
+#line 172 "dk3se.ctr"
*dp = c;
}
-#line 173 "dk3se.ctr"
+#line 174 "dk3se.ctr"
return back;
}
@@ -139,7 +118,7 @@ dk3se_must_encode_for_url(char c)
int back = 1;
-#line 189 "dk3se.ctr"
+#line 190 "dk3se.ctr"
if(('a' <= c) && ('z' >= c)) {
back = 0;
} else {
@@ -158,7 +137,7 @@ dk3se_must_encode_for_url(char c)
}
}
-#line 206 "dk3se.ctr"
+#line 207 "dk3se.ctr"
return back;
}
@@ -191,10 +170,10 @@ dk3se_fputc_checked(
char c = '\0';
-#line 237 "dk3se.ctr"
+#line 238 "dk3se.ctr"
if(se & DK3SE_ANSI) {
-#line 238 "dk3se.ctr"
+#line 239 "dk3se.ctr"
back = dk3se_find_ansi_char(&c, c32);
if(!(back)) {
if(ev) { *ev = ((*ev) | DK3SE_ANSI); }
@@ -203,7 +182,7 @@ dk3se_fputc_checked(
}
} else {
-#line 245 "dk3se.ctr"
+#line 246 "dk3se.ctr"
if((dk3_c32_t)0x00000100UL > c32) {
u = (unsigned)c32; uc = (unsigned char)u; c = (char)uc;
back = 1;
@@ -215,23 +194,23 @@ dk3se_fputc_checked(
}
if(back) {
-#line 255 "dk3se.ctr"
+#line 256 "dk3se.ctr"
if(fipo) {
if(se & DK3SE_URL) {
-#line 257 "dk3se.ctr"
+#line 258 "dk3se.ctr"
if(dk3se_must_encode_for_url(c)) {
buf[0] = '%';
-#line 259 "dk3se.ctr"
- sprintf(&(buf[1]), "%02lx", (unsigned long)c32);
+#line 260 "dk3se.ctr"
+ sprintf(&(buf[1]), "%02lx", dk3enc_uc_to_ul(c32));
if(EOF == fputs(buf, fipo)) {
back = 0;
if(we) { *we = 1;}
}
} else {
-#line 265 "dk3se.ctr"
+#line 266 "dk3se.ctr"
if(EOF == fputc(c, fipo)) {
back = 0;
if(we) { *we = 1; }
@@ -239,7 +218,7 @@ dk3se_fputc_checked(
}
} else {
-#line 271 "dk3se.ctr"
+#line 272 "dk3se.ctr"
if(EOF == fputc(c, fipo)) {
back = 0;
if(we) { *we = 1; }
@@ -248,7 +227,7 @@ dk3se_fputc_checked(
}
}
-#line 278 "dk3se.ctr"
+#line 279 "dk3se.ctr"
return back;
}
@@ -310,9 +289,17 @@ int
dk3se_fct
(
dkChar const *str,
+#if DK3_CHAR_SIZE == 1
int enc,
+#else
+ int DK3_ARG_UNUSED(enc),
+#endif
FILE *fipo,
+#if DK3_CHAR_SIZE == 1
int se,
+#else
+ int DK3_ARG_UNUSED(se),
+#endif
int *ev,
int *we,
dk3_app_t *app
@@ -324,9 +311,11 @@ dk3se_fct
int back = 1;
int myev = 0;
int mywe = 0;
+ DK3_UNUSED_ARG(enc)
+ DK3_UNUSED_ARG(se)
-#line 354 "dk3se.ctr"
+#line 365 "dk3se.ctr"
ptr = str;
while(*ptr) {
if(!dk3se_fputc_checked(*ptr, fipo, se, &myev, &mywe, app)) { back = 0; }
@@ -336,7 +325,7 @@ dk3se_fct
dk3se_show_results(str, ev, we, myev, mywe, 0, app);
}
-#line 362 "dk3se.ctr"
+#line 373 "dk3se.ctr"
return back;
#else
dk3_c16_t const *sp;
@@ -347,9 +336,11 @@ dk3se_fct
int myev = 0;
int mywe = 0;
int myde = 0;
+ DK3_UNUSED_ARG(enc)
+ DK3_UNUSED_ARG(se)
-#line 373 "dk3se.ctr"
+#line 386 "dk3se.ctr"
sp = (dk3_c16_t const *)str;
sl = dk3str_len(str);
while(sl > 0) {
@@ -380,7 +371,7 @@ dk3se_fct
dk3se_show_results(str, ev, we, myev, mywe, myde, app);
}
-#line 402 "dk3se.ctr"
+#line 415 "dk3se.ctr"
return back;
#endif
#else
@@ -395,7 +386,7 @@ dk3se_fct
char c;
-#line 415 "dk3se.ctr"
+#line 428 "dk3se.ctr"
sp = (unsigned char const *)str;
sl = dk3str_c8_len((char const *)sp);
if(DK3_ENCODING_UTF8 == enc) {
@@ -438,7 +429,7 @@ dk3se_fct
}
}
-#line 456 "dk3se.ctr"
+#line 469 "dk3se.ctr"
return back;
#endif
}
diff --git a/support/dktools/dk3se.ctr b/support/dktools/dk3se.ctr
index 115f02d881..056470392d 100644
--- a/support/dktools/dk3se.ctr
+++ b/support/dktools/dk3se.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -99,7 +99,8 @@ dk3se_check(dkChar const *str,int enc,int se,int *ev,int *we,dk3_app_t *app);
#include "dk3all.h"
#include "dk3se.h"
-
+#include "dk3enc.h"
+#include "dk3unused.h"
$!trace-include
@@ -119,7 +120,7 @@ dk3se_find_ansi_char(char *dp, dk3_c32_t c32)
unsigned u;
unsigned char uc;
char c = '\0';
- $? "+ dk3se_find_ansi_char 0x%lx %lu", (unsigned long)c32, (unsigned long)c32
+ $? "+ dk3se_find_ansi_char 0x%lx %lu", dk3enc_uc_to_ul(c32), dk3enc_uc_to_ul(c32)
if((dk3_c32_t)0x00010000UL > c32) {
u = (unsigned)c32;
if(((dk3_c32_t)0x00000019UL < c32) && ((dk3_c32_t)0x00000080UL > c32)) {
@@ -131,38 +132,38 @@ dk3se_find_ansi_char(char *dp, dk3_c32_t c32)
back = 1;
} else {
switch(u) {
- case 0x20AC: { c = (char)0x80; back = 1; } break;
- case 0x0081: { c = (char)0x81; back = 1; } break;
- case 0x201A: { c = (char)0x82; back = 1; } break;
- case 0x0192: { c = (char)0x83; back = 1; } break;
- case 0x201E: { c = (char)0x84; back = 1; } break;
- case 0x2026: { c = (char)0x85; back = 1; } break;
- case 0x2020: { c = (char)0x86; back = 1; } break;
- case 0x2021: { c = (char)0x87; back = 1; } break;
- case 0x02C6: { c = (char)0x88; back = 1; } break;
- case 0x2030: { c = (char)0x89; back = 1; } break;
- case 0x0160: { c = (char)0x8A; back = 1; } break;
- case 0x2039: { c = (char)0x8B; back = 1; } break;
- case 0x0152: { c = (char)0x8C; back = 1; } break;
- case 0x008D: { c = (char)0x8D; back = 1; } break;
- case 0x017D: { c = (char)0x8E; back = 1; } break;
- case 0x008F: { c = (char)0x8F; back = 1; } break;
- case 0x0090: { c = (char)0x90; back = 1; } break;
- case 0x2018: { c = (char)0x91; back = 1; } break;
- case 0x2019: { c = (char)0x92; back = 1; } break;
- case 0x201C: { c = (char)0x93; back = 1; } break;
- case 0x201D: { c = (char)0x94; back = 1; } break;
- case 0x2022: { c = (char)0x95; back = 1; } break;
- case 0x2013: { c = (char)0x96; back = 1; } break;
- case 0x2014: { c = (char)0x97; back = 1; } break;
- case 0x02DC: { c = (char)0x98; back = 1; } break;
- case 0x2122: { c = (char)0x99; back = 1; } break;
- case 0x0161: { c = (char)0x9A; back = 1; } break;
- case 0x203A: { c = (char)0x9B; back = 1; } break;
- case 0x0153: { c = (char)0x9C; back = 1; } break;
- case 0x009D: { c = (char)0x9D; back = 1; } break;
- case 0x017E: { c = (char)0x9E; back = 1; } break;
- case 0x0178: { c = (char)0x9F; back = 1; } break;
+ case 0x20AC: { c = '\x80'; back = 1; } break;
+ case 0x0081: { c = '\x81'; back = 1; } break;
+ case 0x201A: { c = '\x82'; back = 1; } break;
+ case 0x0192: { c = '\x83'; back = 1; } break;
+ case 0x201E: { c = '\x84'; back = 1; } break;
+ case 0x2026: { c = '\x85'; back = 1; } break;
+ case 0x2020: { c = '\x86'; back = 1; } break;
+ case 0x2021: { c = '\x87'; back = 1; } break;
+ case 0x02C6: { c = '\x88'; back = 1; } break;
+ case 0x2030: { c = '\x89'; back = 1; } break;
+ case 0x0160: { c = '\x8A'; back = 1; } break;
+ case 0x2039: { c = '\x8B'; back = 1; } break;
+ case 0x0152: { c = '\x8C'; back = 1; } break;
+ case 0x008D: { c = '\x8D'; back = 1; } break;
+ case 0x017D: { c = '\x8E'; back = 1; } break;
+ case 0x008F: { c = '\x8F'; back = 1; } break;
+ case 0x0090: { c = '\x90'; back = 1; } break;
+ case 0x2018: { c = '\x91'; back = 1; } break;
+ case 0x2019: { c = '\x92'; back = 1; } break;
+ case 0x201C: { c = '\x93'; back = 1; } break;
+ case 0x201D: { c = '\x94'; back = 1; } break;
+ case 0x2022: { c = '\x95'; back = 1; } break;
+ case 0x2013: { c = '\x96'; back = 1; } break;
+ case 0x2014: { c = '\x97'; back = 1; } break;
+ case 0x02DC: { c = '\x98'; back = 1; } break;
+ case 0x2122: { c = '\x99'; back = 1; } break;
+ case 0x0161: { c = '\x9A'; back = 1; } break;
+ case 0x203A: { c = '\x9B'; back = 1; } break;
+ case 0x0153: { c = '\x9C'; back = 1; } break;
+ case 0x009D: { c = '\x9D'; back = 1; } break;
+ case 0x017E: { c = '\x9E'; back = 1; } break;
+ case 0x0178: { c = '\x9F'; back = 1; } break;
}
}
}
@@ -233,7 +234,7 @@ dk3se_fputc_checked(
unsigned u;
unsigned char uc = '\0';
char c = '\0';
- $? "+ dk3se_fputc_checked 0x%lx %lu", (unsigned long)c32, (unsigned long)c32
+ $? "+ dk3se_fputc_checked 0x%lx %lu", dk3enc_uc_to_ul(c32), dk3enc_uc_to_ul(c32)
if(se & DK3SE_ANSI) { $? ". ANSI required"
back = dk3se_find_ansi_char(&c, c32);
if(!(back)) {
@@ -256,7 +257,7 @@ dk3se_fputc_checked(
if(se & DK3SE_URL) { $? ". output as URL"
if(dk3se_must_encode_for_url(c)) {
buf[0] = '%'; $? ". percent/hex encoding"
- sprintf(&(buf[1]), "%02lx", (unsigned long)c32);
+ sprintf(&(buf[1]), "%02lx", dk3enc_uc_to_ul(c32));
if(EOF == fputs(buf, fipo)) {
back = 0;
if(we) { *we = 1;}
@@ -336,9 +337,17 @@ int
dk3se_fct
(
dkChar const *str,
+#if DK3_CHAR_SIZE == 1
int enc,
+#else
+ int DK3_ARG_UNUSED(enc),
+#endif
FILE *fipo,
+#if DK3_CHAR_SIZE == 1
int se,
+#else
+ int DK3_ARG_UNUSED(se),
+#endif
int *ev,
int *we,
dk3_app_t *app
@@ -350,6 +359,8 @@ dk3se_fct
int back = 1;
int myev = 0;
int mywe = 0;
+ DK3_UNUSED_ARG(enc)
+ DK3_UNUSED_ARG(se)
$? "+ dk3se_fct (32 bit)"
ptr = str;
while(*ptr) {
@@ -369,6 +380,8 @@ dk3se_fct
int myev = 0;
int mywe = 0;
int myde = 0;
+ DK3_UNUSED_ARG(enc)
+ DK3_UNUSED_ARG(se)
$? "+ dk3se_fct (16 bit)"
sp = (dk3_c16_t const *)str;
sl = dk3str_len(str);
diff --git a/support/dktools/dk3se.h b/support/dktools/dk3se.h
index 7b1c7b5e22..818fbf3ebd 100644
--- a/support/dktools/dk3se.h
+++ b/support/dktools/dk3se.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3se.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3se.ctr
*/
/** @file dk3se.h Header file for the dk3se module.
diff --git a/support/dktools/dk3sf.c b/support/dktools/dk3sf.c
index bc00c1e947..cbd881076a 100644
--- a/support/dktools/dk3sf.c
+++ b/support/dktools/dk3sf.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3sf.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3sf.ctr
*/
/** @file dk3sf.c The dk3sf module.
@@ -40,13 +18,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 748 "dk3sf.ctr"
#include "dk3all.h"
+#include "dk3unused.h"
-#line 754 "dk3sf.ctr"
+#line 755 "dk3sf.ctr"
@@ -164,13 +143,21 @@ dkT("fgets: "),
NULL
-#line 896 "dk3sf.ctr"
+#line 897 "dk3sf.ctr"
};
void
+#if (DK3_CHAR_SIZE == 1) && DK3_HAVE_STRERROR && (!DK3_ON_WINDOWS)
dk3sf_report_errno(dk3_app_t *app, int err, dkChar const *fctn)
+#else
+dk3sf_report_errno(
+ dk3_app_t * DK3_ARG_UNUSED(app),
+ int DK3_ARG_UNUSED(err),
+ dkChar const * DK3_ARG_UNUSED(fctn)
+)
+#endif
{
#if (DK3_CHAR_SIZE == 1) && DK3_HAVE_STRERROR && (!DK3_ON_WINDOWS)
dkChar const *msgarray[2];
@@ -197,6 +184,10 @@ dk3sf_report_errno(dk3_app_t *app, int err, dkChar const *fctn)
}
#endif
}
+#else
+ DK3_UNUSED_ARG(app)
+ DK3_UNUSED_ARG(err)
+ DK3_UNUSED_ARG(fctn)
#endif
}
@@ -387,7 +378,7 @@ dk3sf_c8_attempt_home(
p2 = NULL;
-#line 1117 "dk3sf.ctr"
+#line 1130 "dk3sf.ctr"
p1 = getenv(n1);
if(p1) {
if(n2) { p2 = getenv(n2); }
@@ -412,24 +403,25 @@ dk3sf_c8_attempt_home(
}
-#line 1140 "dk3sf.ctr"
+#line 1153 "dk3sf.ctr"
-#line 1141 "dk3sf.ctr"
+#line 1154 "dk3sf.ctr"
-#line 1142 "dk3sf.ctr"
+#line 1155 "dk3sf.ctr"
}
-#line 1143 "dk3sf.ctr"
+#line 1156 "dk3sf.ctr"
return back;
}
int
-dk3sf_c8_get_home_app(char *d, size_t s, dk3_app_t *app)
+dk3sf_c8_get_home_app(char *d, size_t s, dk3_app_t * DK3_ARG_UNUSED(app))
{
int back = 0;
+ DK3_UNUSED_ARG(app)
if((d) && (s)) {
back = dk3sf_c8_attempt_home(d, s, dk3sf_kw_win_c8[0], dk3sf_kw_win_c8[1], NULL);
if(!back) {
@@ -461,13 +453,13 @@ dk3sf_c8_get_home_app(char *d, size_t s, dk3_app_t *app)
}
-#line 1181 "dk3sf.ctr"
+#line 1195 "dk3sf.ctr"
-#line 1182 "dk3sf.ctr"
+#line 1196 "dk3sf.ctr"
-#line 1183 "dk3sf.ctr"
+#line 1197 "dk3sf.ctr"
}
return back;
}
@@ -497,7 +489,7 @@ dk3sf_c16_attempt_home(
p2 = NULL;
-#line 1211 "dk3sf.ctr"
+#line 1225 "dk3sf.ctr"
p1 = _wgetenv(n1);
if(p1) {
if(n2) { p2 = _wgetenv(n2); }
@@ -522,25 +514,26 @@ dk3sf_c16_attempt_home(
}
-#line 1234 "dk3sf.ctr"
+#line 1248 "dk3sf.ctr"
-#line 1235 "dk3sf.ctr"
+#line 1249 "dk3sf.ctr"
-#line 1236 "dk3sf.ctr"
+#line 1250 "dk3sf.ctr"
}
-#line 1237 "dk3sf.ctr"
+#line 1251 "dk3sf.ctr"
return back;
}
int
-dk3sf_c16_get_home_app(dk3_c16_t *d, size_t s, dk3_app_t *app)
+dk3sf_c16_get_home_app(dk3_c16_t *d, size_t s, dk3_app_t * DK3_ARG_UNUSED(app))
{
int back = 0;
+ DK3_UNUSED_ARG(app)
if((d) && (s)) {
back = dk3sf_c16_attempt_home(d, s, dk3sf_kw_win_c16[0], dk3sf_kw_win_c16[1], NULL);
if(!back) {
@@ -572,13 +565,13 @@ dk3sf_c16_get_home_app(dk3_c16_t *d, size_t s, dk3_app_t *app)
}
-#line 1276 "dk3sf.ctr"
+#line 1291 "dk3sf.ctr"
-#line 1277 "dk3sf.ctr"
+#line 1292 "dk3sf.ctr"
-#line 1278 "dk3sf.ctr"
+#line 1293 "dk3sf.ctr"
}
return back;
}
@@ -680,6 +673,7 @@ dk3sf_convert_file_permissions(int m)
}
+#if (1 == DK3_CHAR_SIZE) || (VERSION_BEFORE_2019_10_20)
/** Convert file permissions back from dktools to system values.
@param m File permissions in dktools notation.
@@ -696,7 +690,10 @@ dk3sf_convert_back_file_permissions(int m)
return back;
}
+#endif
+
+#if VERSION_BEFORE_2012_04_14
static
void
@@ -710,6 +707,7 @@ dk3sf_convert_filetime(dk3_time_t *pd, FILETIME *ps)
*pd = (dk3_time_t)i1;
}
+#endif
int
@@ -718,12 +716,14 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
WIN32_FIND_DATAA wfd;
DWORD dwFileAttributes;
HANDLE hFFF;
+#if VERSION_BEFORE_2012_04_14
int ec = 0;
+#endif
int back = 0;
struct __stat64 stb; /* Internal buffer for _stat64(). */
-#line 1421 "dk3sf.ctr"
+#line 1443 "dk3sf.ctr"
if((st) && (fn)) {
dk3mem_res((void *)st, sizeof(dk3_stat_t));
st->cReparse = 0x00;
@@ -762,7 +762,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
HANDLE hFileSearch;
-#line 1458 "dk3sf.ctr"
+#line 1480 "dk3sf.ctr"
hFileSearch = FindFirstFileA(fn, &wfdFileDetails);
if(INVALID_HANDLE_VALUE != hFileSearch) {
if(FILE_ATTRIBUTE_REPARSE_POINT & (wfdFileDetails.dwFileAttributes)) {
@@ -830,7 +830,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
}
}
-#line 1524 "dk3sf.ctr"
+#line 1546 "dk3sf.ctr"
return back;
}
@@ -877,7 +877,7 @@ dk3sf_c8_fopen_app(char const *fn, char const *mo, dk3_app_t *app)
int want_to_write = 0; /* Flag: Write access wanted. */
-#line 1569 "dk3sf.ctr"
+#line 1591 "dk3sf.ctr"
if((fn) && (mo)) {
moptr = mo;
while(*moptr) {
@@ -909,7 +909,7 @@ dk3sf_c8_fopen_app(char const *fn, char const *mo, dk3_app_t *app)
}
}
-#line 1599 "dk3sf.ctr"
+#line 1621 "dk3sf.ctr"
return back;
}
@@ -1015,10 +1015,16 @@ dk3sf_c8_getcwd_app(char *dest, size_t sz, dk3_app_t *app)
int
dk3sf_c8_find_exec_app(
- char *d, size_t s, char const *w, char const *c, dk3_app_t *app
+ char *d,
+ size_t s,
+ char const * DK3_ARG_UNUSED(w),
+ char const * DK3_ARG_UNUSED(c),
+ dk3_app_t *app
)
{
int back = 0;
+ DK3_UNUSED_ARG(w)
+ DK3_UNUSED_ARG(c)
if((d) && (s)) {
if(GetModuleFileNameA(GetModuleHandle(NULL),d,(DWORD)s)) {
back = 1;
@@ -1041,7 +1047,7 @@ dk3sf_c8_is_drive(char const *p)
int back = 0;
-#line 1729 "dk3sf.ctr"
+#line 1757 "dk3sf.ctr"
if(dk3str_c8_len(p) == 2) {
if((*p >= 'a') && (*p <= 'z')) {
back = 1;
@@ -1055,46 +1061,61 @@ dk3sf_c8_is_drive(char const *p)
}
}
-#line 1741 "dk3sf.ctr"
+#line 1769 "dk3sf.ctr"
return back;
}
int
-dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
+dk3sf_c8_mkdir_app(
+ char const *p,
+#if VERSION_BEFORE_2019_10_20
+ int mo,
+#else
+ int DK3_ARG_UNUSED(mo),
+#endif
+ dk3_app_t *app
+)
{
int back = 0;
char buffer[DK3_MAX_PATH]; /* Path name for parent directories. */
char *ptr = NULL; /* Slash/backslash position. */
int cc = 1; /* Flag: Can continue. */
+#if VERSION_BEFORE_2019_10_20
int m = 0; /* File permissions. */
+#endif
dk3_stat_t stb;
+#if (!(VERSION_BEFORE_2019_10_20))
+ DK3_UNUSED_ARG(mo)
+#endif
-#line 1755 "dk3sf.ctr"
+#line 1796 "dk3sf.ctr"
if(p) {
+#if VERSION_BEFORE_2019_10_20
m = dk3sf_convert_back_file_permissions(mo);
+#endif
if(dk3str_c8_len(p) < sizeof(buffer)) {
-#line 1758 "dk3sf.ctr"
+#line 1801 "dk3sf.ctr"
dk3str_c8_cpy_not_overlapped(buffer, p);
ptr = buffer; cc = 1;
while((cc) && (ptr)) {
-#line 1761 "dk3sf.ctr"
+#line 1804 "dk3sf.ctr"
ptr = dk3str_c8_chr(ptr, '\\');
if(ptr) {
*ptr = '\0';
-#line 1764 "dk3sf.ctr"
+#line 1807 "dk3sf.ctr"
if((dk3str_c8_len(buffer) > 0) && (!dk3sf_c8_is_drive(buffer))) {
if(dk3sf_c8_stat_app(&stb, buffer, NULL)) {
-#line 1766 "dk3sf.ctr"
+#line 1809 "dk3sf.ctr"
if(((stb.ft) & (~(DK3_FT_SYMLINK))) != DK3_FT_DIRECTORY) {
cc = 0;
-#line 1768 "dk3sf.ctr"
+#line 1811 "dk3sf.ctr"
if(app) {
/* Not a directory! */
#if DK3_CHAR_SIZE == 1
@@ -1106,10 +1127,10 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
} else {
-#line 1778 "dk3sf.ctr"
+#line 1821 "dk3sf.ctr"
if(_mkdir(buffer) != 0) {
-#line 1779 "dk3sf.ctr"
+#line 1822 "dk3sf.ctr"
cc = 0;
if(app) {
/* Failed to create directory! */
@@ -1128,17 +1149,17 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
if(cc) {
-#line 1796 "dk3sf.ctr"
+#line 1839 "dk3sf.ctr"
if(dk3sf_c8_stat_app(&stb, buffer, NULL)) {
-#line 1797 "dk3sf.ctr"
+#line 1840 "dk3sf.ctr"
if(((stb.ft) & (~(DK3_FT_SYMLINK))) == DK3_FT_DIRECTORY) {
back = 1;
-#line 1799 "dk3sf.ctr"
+#line 1842 "dk3sf.ctr"
} else {
-#line 1800 "dk3sf.ctr"
+#line 1843 "dk3sf.ctr"
if(app) {
/* Not a directory! */
#if DK3_CHAR_SIZE == 1
@@ -1150,12 +1171,12 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
} else {
-#line 1810 "dk3sf.ctr"
+#line 1853 "dk3sf.ctr"
if(_mkdir(buffer) == 0) {
back = 1;
} else {
-#line 1813 "dk3sf.ctr"
+#line 1856 "dk3sf.ctr"
#if DK3_CHAR_SIZE == 1
dk3app_log_i3(app, DK3_LL_ERROR, 84, 85, buffer);
#else
@@ -1166,7 +1187,7 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
} else {
-#line 1822 "dk3sf.ctr"
+#line 1865 "dk3sf.ctr"
if(app) {
/* Path too long! */
#if DK3_CHAR_SIZE == 1
@@ -1178,7 +1199,7 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
}
-#line 1832 "dk3sf.ctr"
+#line 1875 "dk3sf.ctr"
return back;
}
@@ -1190,12 +1211,14 @@ dk3sf_c16_stat_app(dk3_stat_t *st, dk3_c16_t const *fn, dk3_app_t *app)
WIN32_FIND_DATAW wfd;
DWORD dwFileAttributes;
HANDLE hFFF;
+#if VERSION_BEFORE_2012_04_14
int ec = 0;
+#endif
int back = 0;
struct __stat64 stb; /* Result from _wstat64(). */
-#line 1847 "dk3sf.ctr"
+#line 1892 "dk3sf.ctr"
if((st) && (fn)) {
dk3mem_res((void *)st, sizeof(dk3_stat_t));
st->cReparse = 0x00;
@@ -1234,25 +1257,25 @@ dk3sf_c16_stat_app(dk3_stat_t *st, dk3_c16_t const *fn, dk3_app_t *app)
HANDLE hFileSearch;
-#line 1884 "dk3sf.ctr"
+#line 1929 "dk3sf.ctr"
hFileSearch = FindFirstFileW(fn, &wfdFileDetails);
if(INVALID_HANDLE_VALUE != hFileSearch) {
-#line 1886 "dk3sf.ctr"
+#line 1931 "dk3sf.ctr"
if(FILE_ATTRIBUTE_REPARSE_POINT & (wfdFileDetails.dwFileAttributes)) {
-#line 1888 "dk3sf.ctr"
+#line 1933 "dk3sf.ctr"
if(IO_REPARSE_TAG_MOUNT_POINT == wfdFileDetails.dwReserved0) {
-#line 1890 "dk3sf.ctr"
+#line 1935 "dk3sf.ctr"
/* ##### st->ft = DK3_FT_WINDOWS_MOUNT_POINT; */
} else {
if(IO_REPARSE_TAG_SYMLINK == wfdFileDetails.dwReserved0) {
-#line 1894 "dk3sf.ctr"
+#line 1939 "dk3sf.ctr"
/* Symbolic link */
st->lsz = dk3ma_um_add_ok(
dk3ma_um_mul_ok(
@@ -1313,7 +1336,7 @@ dk3sf_c16_stat_app(dk3_stat_t *st, dk3_c16_t const *fn, dk3_app_t *app)
}
}
-#line 1953 "dk3sf.ctr"
+#line 1998 "dk3sf.ctr"
return back;
}
@@ -1433,10 +1456,16 @@ dk3sf_c16_getcwd_app(dk3_c16_t *dest, size_t sz, dk3_app_t *app)
int
dk3sf_c16_find_exec_app(
- dk3_c16_t *d, size_t s, dk3_c16_t const *w, dk3_c16_t const *c, dk3_app_t *app
+ dk3_c16_t *d,
+ size_t s,
+ dk3_c16_t const * DK3_ARG_UNUSED(w),
+ dk3_c16_t const * DK3_ARG_UNUSED(c),
+ dk3_app_t *app
)
{
int back = 0;
+ DK3_UNUSED_ARG(w)
+ DK3_UNUSED_ARG(c)
if((d) && (s)) {
if(GetModuleFileNameW(GetModuleHandle(NULL),d,(DWORD)s)) {
back = 1;
@@ -1475,16 +1504,31 @@ dk3sf_c16_is_drive(dk3_c16_t const *p)
int
-dk3sf_c16_mkdir_app(dk3_c16_t const *p, int mo, dk3_app_t *app)
+dk3sf_c16_mkdir_app(
+ dk3_c16_t const *p,
+#if VERSION_BEFORE_2019_10_20
+ int mo,
+#else
+ int DK3_ARG_UNUSED(mo),
+#endif
+ dk3_app_t *app
+)
{
int back = 0;
dk3_c16_t buffer[DK3_MAX_PATH]; /* File names of parent directories. */
dk3_c16_t *ptr = NULL; /* Current slash/backslash position. */
int cc = 1; /* Flag: Can continue. */
+#if VERSION_BEFORE_2019_10_20
int m = 0; /* Permissions. */
+#endif
dk3_stat_t stb; /* Test whether file/dir exists. */
+#if (!(VERSION_BEFORE_2019_10_20))
+ DK3_UNUSED_ARG(mo)
+#endif
if(p) {
+#if VERSION_BEFORE_2019_10_20
m = dk3sf_convert_back_file_permissions(mo);
+#endif
if(dk3str_c16_len(p) < sizeof(buffer)) {
dk3str_c16_cpy(buffer, p);
ptr = buffer; cc = 1;
@@ -1633,12 +1677,12 @@ dk3sf_fgets_fn_app(
int back = 0;
-#line 2271 "dk3sf.ctr"
+#line 2337 "dk3sf.ctr"
if((db) && (sz) && (fi)) {
if(fgetws(db, (int)sz, fi)) {
if(db[0] == DK3_CHAR_BOM) {
-#line 2274 "dk3sf.ctr"
+#line 2340 "dk3sf.ctr"
dk3str_c16_cpy(db, &(db[1]));
}
back = 1;
@@ -1655,7 +1699,7 @@ dk3sf_fgets_fn_app(
}
}
-#line 2289 "dk3sf.ctr"
+#line 2355 "dk3sf.ctr"
return back;
}
@@ -1711,7 +1755,9 @@ dk3sf_initialize_stdout(void)
static int not_bom_written_to_stdout = 1;
if(not_bom_written_to_stdout) {
not_bom_written_to_stdout = 0;
+#if defined(_MSC_VER)
(void)_setmode(_fileno(stdout), _O_U16TEXT);
+#endif
if(!_isatty(_fileno(stdout))) {
fputwc(0xFEFF, stdout);
}
@@ -1726,7 +1772,9 @@ dk3sf_initialize_stdout_no_bom(void)
static int not_bom_written_to_stdout = 1;
if(not_bom_written_to_stdout) {
not_bom_written_to_stdout = 0;
+#if defined(_MSC_VER)
(void)_setmode(_fileno(stdout), _O_U16TEXT);
+#endif
}
}
@@ -1738,7 +1786,9 @@ dk3sf_initialize_stderr(void)
static int not_bom_written_to_stderr = 1;
if(not_bom_written_to_stderr) {
not_bom_written_to_stderr = 0;
+#if defined(_MSC_VER)
(void)_setmode(_fileno(stderr), _O_U16TEXT);
+#endif
if(!_isatty(_fileno(stderr))) {
fputwc(0xFEFF, stderr);
}
@@ -1750,7 +1800,9 @@ dk3sf_initialize_stderr(void)
void
dk3sf_initialize_file(FILE *fipo)
{
+#if defined(_MSC_VER)
(void)_setmode(_fileno(fipo), _O_U16TEXT);
+#endif
fputwc(0xFEFF, fipo);
}
@@ -1968,21 +2020,21 @@ dk3sf_c8_copy_logname(char *d, size_t s, struct passwd *p, dk3_app_t *app)
int back = 0;
-#line 2600 "dk3sf.ctr"
+#line 2674 "dk3sf.ctr"
if(p) {
-#line 2601 "dk3sf.ctr"
+#line 2675 "dk3sf.ctr"
if(p->pw_name) {
-#line 2602 "dk3sf.ctr"
+#line 2676 "dk3sf.ctr"
if(dk3str_c8_len(p->pw_name) < s) {
-#line 2603 "dk3sf.ctr"
+#line 2677 "dk3sf.ctr"
dk3str_c8_cpy_not_overlapped(d, p->pw_name);
back = 1;
} else {
-#line 2606 "dk3sf.ctr"
+#line 2680 "dk3sf.ctr"
if(app) {
/* Destination buffer too small! */
dk3app_log_i1(app, DK3_LL_ERROR, 38);
@@ -1996,7 +2048,7 @@ dk3sf_c8_copy_logname(char *d, size_t s, struct passwd *p, dk3_app_t *app)
}
}
-#line 2618 "dk3sf.ctr"
+#line 2692 "dk3sf.ctr"
return back;
}
@@ -2011,20 +2063,20 @@ dk3sf_c8_get_logname_app(char *d, size_t s, dk3_app_t *app)
char uidbuffer[128]; /* Text buffer to store UID. */
-#line 2631 "dk3sf.ctr"
+#line 2705 "dk3sf.ctr"
if((d) && (s)) {
u = getuid();
#if DK3_HAVE_GETPWUID
p = getpwuid(u);
-#line 2635 "dk3sf.ctr"
+#line 2709 "dk3sf.ctr"
if(p) {
-#line 2636 "dk3sf.ctr"
+#line 2710 "dk3sf.ctr"
back = dk3sf_c8_copy_logname(d, s, p, app);
} else {
-#line 2638 "dk3sf.ctr"
+#line 2712 "dk3sf.ctr"
if(app) {
/* No passwd record for UID! */
#if DK3_CHAR_SIZE == 1
@@ -2044,7 +2096,7 @@ dk3sf_c8_get_logname_app(char *d, size_t s, dk3_app_t *app)
int cc;
int found;
-#line 2656 "dk3sf.ctr"
+#line 2730 "dk3sf.ctr"
cc = 1; found = 0;
while(cc) {
p = getpwent();
@@ -2053,14 +2105,14 @@ dk3sf_c8_get_logname_app(char *d, size_t s, dk3_app_t *app)
cc = 0;
found = 1;
-#line 2663 "dk3sf.ctr"
+#line 2737 "dk3sf.ctr"
back = dk3sf_c8_copy_logname(d, s, p, app);
}
} else { cc = 0; }
}
if(!found) {
-#line 2668 "dk3sf.ctr"
+#line 2742 "dk3sf.ctr"
if(app) {
/* No passwd record for UID! */
#if DK3_CHAR_SIZE == 1
@@ -2078,7 +2130,7 @@ dk3sf_c8_get_logname_app(char *d, size_t s, dk3_app_t *app)
#endif
}
-#line 2684 "dk3sf.ctr"
+#line 2758 "dk3sf.ctr"
return back;
}
@@ -2266,6 +2318,8 @@ dk3sf_convert_file_permissions(mode_t m)
+#if (1 == DK3_CHAR_SIZE) || (VERSION_BEFORE_2019_10_20)
+
/** Convert file permissions back from dktools to system values.
@param m File permissions in dktools notation.
@return File permissions in system notation.
@@ -2290,6 +2344,8 @@ dk3sf_convert_back_file_permissions(int m)
return back;
}
+#endif
+
int
dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
@@ -2297,7 +2353,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
int back = 0;
-#line 2901 "dk3sf.ctr"
+#line 2979 "dk3sf.ctr"
if((st) && (fn)) {
#if DK3_HAVE_LARGEFILE64_SOURCE && DK3_HAVE_STAT64
struct stat64 stb; /* Result from stat64(). */
@@ -2306,10 +2362,10 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
#endif
-#line 2908 "dk3sf.ctr"
+#line 2986 "dk3sf.ctr"
if(stat64(fn, &stb) == 0) {
-#line 2909 "dk3sf.ctr"
+#line 2987 "dk3sf.ctr"
st->u = (dk3_um_t)(stb.st_uid);
st->g = (dk3_um_t)(stb.st_gid);
st->device = (dk3_um_t)(stb.st_dev);
@@ -2352,10 +2408,10 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
}
}
-#line 2950 "dk3sf.ctr"
+#line 3028 "dk3sf.ctr"
} else {
-#line 2951 "dk3sf.ctr"
+#line 3029 "dk3sf.ctr"
if(app) {
/* lstat() failed! */
#if DK3_CHAR_SIZE == 1
@@ -2370,7 +2426,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
#endif
} else {
-#line 2964 "dk3sf.ctr"
+#line 3042 "dk3sf.ctr"
#if DK3_HAVE_LSTAT64
if(lstat64(fn, &lstb) == 0) {
back = 1;
@@ -2430,10 +2486,10 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
#endif
-#line 3022 "dk3sf.ctr"
+#line 3100 "dk3sf.ctr"
if(stat(fn, &stb) == 0) {
-#line 3023 "dk3sf.ctr"
+#line 3101 "dk3sf.ctr"
st->u = (dk3_um_t)(stb.st_uid);
st->g = (dk3_um_t)(stb.st_gid);
st->device = (dk3_um_t)(stb.st_dev);
@@ -2446,7 +2502,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
st->ft = dk3sf_convert_file_type(stb.st_mode);
st->perm = dk3sf_convert_file_permissions(stb.st_mode);
st->sz = (dk3_um_t)(stb.st_size);
- sz->lsz = st->sz;
+ st->lsz = st->sz;
st->ai = 0x00;
#if DK3_HAVE_LSTAT
if(lstat(fn, &lstb) == 0) {
@@ -2464,7 +2520,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
st->lacc = (dk3_time_t)(lstb.st_atime);
st->lft = dk3sf_convert_file_type(lstb.st_mode);
st->lperm = dk3sf_convert_file_permissions(lstb.st_mode);
- sz->lsz = (dk3_um_t)(lstb.st_size);
+ st->lsz = (dk3_um_t)(lstb.st_size);
if(lstb.st_uid != stb.st_uid) {
st->ai |= DK3_STAT_AI_USER_DIFFERS;
}
@@ -2476,10 +2532,10 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
}
}
-#line 3064 "dk3sf.ctr"
+#line 3142 "dk3sf.ctr"
} else {
-#line 3065 "dk3sf.ctr"
+#line 3143 "dk3sf.ctr"
if(app) {
/* lstat() failed! */
#if DK3_CHAR_SIZE == 1
@@ -2494,7 +2550,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
#endif
} else {
-#line 3078 "dk3sf.ctr"
+#line 3156 "dk3sf.ctr"
#if DK3_HAVE_LSTAT
if(lstat(fn,&lstb) == 0) {
back = 1;
@@ -2552,7 +2608,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
#endif
}
-#line 3134 "dk3sf.ctr"
+#line 3212 "dk3sf.ctr"
return back;
}
@@ -2609,7 +2665,7 @@ dk3sf_c8_fopen_app(char const *fn, char const *mo, dk3_app_t *app)
int want_to_write = 0; /* Flag: Write access wanted. */
-#line 3189 "dk3sf.ctr"
+#line 3267 "dk3sf.ctr"
if((fn) && (mo)) {
moptr = mo;
while(*moptr) {
@@ -2622,11 +2678,11 @@ dk3sf_c8_fopen_app(char const *fn, char const *mo, dk3_app_t *app)
#if DK3_HAVE_LARGEFILE64_SOURCE && DK3_HAVE_FOPEN64
back = fopen64(fn, mo);
-#line 3200 "dk3sf.ctr"
+#line 3278 "dk3sf.ctr"
#else
back = fopen(fn, mo);
-#line 3202 "dk3sf.ctr"
+#line 3280 "dk3sf.ctr"
#endif
if(!(back)) {
if(app) {
@@ -2650,7 +2706,7 @@ dk3sf_c8_fopen_app(char const *fn, char const *mo, dk3_app_t *app)
}
}
-#line 3224 "dk3sf.ctr"
+#line 3302 "dk3sf.ctr"
return back;
}
@@ -2782,32 +2838,32 @@ dk3sf_c8_check_exec(char const *f)
dk3_stat_t stb; /* stat() result to check for file. */
-#line 3354 "dk3sf.ctr"
+#line 3432 "dk3sf.ctr"
if(dk3sf_c8_stat_app(&stb, f, NULL)) {
-#line 3355 "dk3sf.ctr"
+#line 3433 "dk3sf.ctr"
if(((stb.ft) & (~(DK3_FT_SYMLINK))) == DK3_FT_REGULAR) {
-#line 3356 "dk3sf.ctr"
+#line 3434 "dk3sf.ctr"
testperm = (DK3_FPERM_U_EXEC | DK3_FPERM_G_EXEC | DK3_FPERM_O_EXEC);
if((stb.perm) & testperm) {
-#line 3358 "dk3sf.ctr"
+#line 3436 "dk3sf.ctr"
back = 1;
} else {
-#line 3360 "dk3sf.ctr"
+#line 3438 "dk3sf.ctr"
}
} else {
-#line 3362 "dk3sf.ctr"
+#line 3440 "dk3sf.ctr"
}
} else {
-#line 3364 "dk3sf.ctr"
+#line 3442 "dk3sf.ctr"
}
-#line 3365 "dk3sf.ctr"
+#line 3443 "dk3sf.ctr"
return back;
}
@@ -2826,26 +2882,26 @@ dk3sf_c8_find_exec_app(
size_t tsl = 0; /* Needed buffer length. */
-#line 3382 "dk3sf.ctr"
+#line 3460 "dk3sf.ctr"
if((d) && (s) && (w) && (c)) {
-#line 3383 "dk3sf.ctr"
+#line 3461 "dk3sf.ctr"
if(dk3str_c8_chr(c, DK3_C8_SEP)) {
-#line 3384 "dk3sf.ctr"
+#line 3462 "dk3sf.ctr"
if(dk3str_c8_is_abs_path(c)) {
-#line 3385 "dk3sf.ctr"
+#line 3463 "dk3sf.ctr"
if(dk3str_c8_len(c) < s) {
-#line 3386 "dk3sf.ctr"
+#line 3464 "dk3sf.ctr"
dk3str_c8_cpy_not_overlapped(d, c);
back = 1;
-#line 3388 "dk3sf.ctr"
+#line 3466 "dk3sf.ctr"
} else {
-#line 3389 "dk3sf.ctr"
+#line 3467 "dk3sf.ctr"
if(app) {
/* c too long! */
#if DK3_CHAR_SIZE == 1
@@ -2857,17 +2913,17 @@ dk3sf_c8_find_exec_app(
}
} else {
-#line 3399 "dk3sf.ctr"
+#line 3477 "dk3sf.ctr"
if(dk3str_c8_len(w) < s) {
dk3str_c8_cpy_not_overlapped(d, w);
back = dk3str_c8_append_path_app(d, s, c, app);
if(back) {
-#line 3403 "dk3sf.ctr"
+#line 3481 "dk3sf.ctr"
}
} else {
-#line 3405 "dk3sf.ctr"
+#line 3483 "dk3sf.ctr"
if(app) {
/* w too long! */
#if DK3_CHAR_SIZE == 1
@@ -2880,35 +2936,35 @@ dk3sf_c8_find_exec_app(
}
} else {
-#line 3416 "dk3sf.ctr"
+#line 3494 "dk3sf.ctr"
p = getenv(kw_c8_no_win[1]);
if(p) {
-#line 3418 "dk3sf.ctr"
+#line 3496 "dk3sf.ctr"
pathcopy = dk3str_dup_app(p, app);
if(pathcopy) {
-#line 3420 "dk3sf.ctr"
+#line 3498 "dk3sf.ctr"
p = pathcopy; cc = 1;
while((p) && (cc) && (back == 0)) {
pn = dk3str_c8_chr(p, ':');
if(pn) { *(pn++) = '\0'; }
if(dk3str_c8_len(p)) {
-#line 3425 "dk3sf.ctr"
+#line 3503 "dk3sf.ctr"
tsl = dk3str_c8_len(p);
tsl += dk3str_c8_len(kw_c8_no_win[0]);
tsl += dk3str_c8_len(c);
if(tsl < s) {
-#line 3429 "dk3sf.ctr"
+#line 3507 "dk3sf.ctr"
dk3str_c8_cpy_not_overlapped(d, p);
dk3str_c8_cat(d, kw_c8_no_win[0]);
dk3str_c8_cat(d, c);
back = dk3sf_c8_check_exec(d);
} else {
-#line 3434 "dk3sf.ctr"
+#line 3512 "dk3sf.ctr"
cc = 0;
if(app) {
/* Destination buffer too small! */
@@ -2917,20 +2973,20 @@ dk3sf_c8_find_exec_app(
}
} else {
-#line 3441 "dk3sf.ctr"
+#line 3519 "dk3sf.ctr"
tsl = dk3str_c8_len(w);
tsl += dk3str_c8_len(kw_c8_no_win[0]);
tsl += dk3str_c8_len(c);
if(tsl < s) {
-#line 3445 "dk3sf.ctr"
+#line 3523 "dk3sf.ctr"
dk3str_c8_cpy_not_overlapped(d, w);
dk3str_c8_cat(d, kw_c8_no_win[0]);
dk3str_c8_cat(d, c);
back = dk3sf_c8_check_exec(d);
} else {
-#line 3450 "dk3sf.ctr"
+#line 3528 "dk3sf.ctr"
cc = 0;
if(app) {
/* Destination buffer too small! */
@@ -2943,11 +2999,11 @@ dk3sf_c8_find_exec_app(
dk3_delete(pathcopy);
} else {
-#line 3461 "dk3sf.ctr"
+#line 3539 "dk3sf.ctr"
}
} else {
-#line 3463 "dk3sf.ctr"
+#line 3541 "dk3sf.ctr"
if(app) {
/* PATH environment variable not defined. */
dk3app_log_i1(app, DK3_LL_ERROR, 106);
@@ -2956,7 +3012,7 @@ dk3sf_c8_find_exec_app(
}
}
-#line 3470 "dk3sf.ctr"
+#line 3548 "dk3sf.ctr"
return back;
}
@@ -2973,32 +3029,32 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
dk3_stat_t stb; /* Check for existance of file or directory. */
-#line 3485 "dk3sf.ctr"
+#line 3563 "dk3sf.ctr"
if(p) {
-#line 3486 "dk3sf.ctr"
+#line 3564 "dk3sf.ctr"
m = dk3sf_convert_back_file_permissions(mo);
if(dk3str_c8_len(p) < sizeof(buffer)) {
-#line 3488 "dk3sf.ctr"
+#line 3566 "dk3sf.ctr"
dk3str_c8_cpy_not_overlapped(buffer, p);
ptr = buffer; cc = 1;
while((cc) && (ptr)) {
-#line 3491 "dk3sf.ctr"
+#line 3569 "dk3sf.ctr"
ptr = dk3str_c8_chr(ptr, DK3_C8_SEP);
if(ptr) {
*ptr = '\0';
-#line 3494 "dk3sf.ctr"
+#line 3572 "dk3sf.ctr"
if(dk3str_c8_len(buffer) > 0) {
if(dk3sf_c8_stat_app(&stb, buffer, NULL)) {
-#line 3496 "dk3sf.ctr"
+#line 3574 "dk3sf.ctr"
if(((stb.ft) & (~(DK3_FT_SYMLINK))) != DK3_FT_DIRECTORY) {
cc = 0;
-#line 3498 "dk3sf.ctr"
+#line 3576 "dk3sf.ctr"
if(app) {
/* Not a directory! */
#if DK3_CHAR_SIZE == 1
@@ -3010,7 +3066,7 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
} else {
-#line 3508 "dk3sf.ctr"
+#line 3586 "dk3sf.ctr"
#if DK3_HAVE_MKDIR
#if DK3_HAVE_MKDIR2
if(mkdir(buffer, m) == 0)
@@ -3021,12 +3077,12 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
#if DK3_HAVE_CHMOD
(void)chmod(buffer, m);
-#line 3517 "dk3sf.ctr"
+#line 3595 "dk3sf.ctr"
#endif
} else {
cc = 0;
-#line 3520 "dk3sf.ctr"
+#line 3598 "dk3sf.ctr"
if(app) {
/* Failed to create directory! */
#if DK3_CHAR_SIZE == 1
@@ -3041,7 +3097,7 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
cc = 0;
if(app) {
-#line 3533 "dk3sf.ctr"
+#line 3611 "dk3sf.ctr"
/* No mkdir() function available! */
dk3app_log_i1(app, DK3_LL_ERROR, 107);
}
@@ -3054,17 +3110,17 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
if(cc) {
-#line 3544 "dk3sf.ctr"
+#line 3622 "dk3sf.ctr"
if(dk3sf_c8_stat_app(&stb, buffer, NULL)) {
-#line 3545 "dk3sf.ctr"
+#line 3623 "dk3sf.ctr"
if(((stb.ft) & (~(DK3_FT_SYMLINK))) == DK3_FT_DIRECTORY) {
back = 1;
-#line 3547 "dk3sf.ctr"
+#line 3625 "dk3sf.ctr"
} else {
-#line 3548 "dk3sf.ctr"
+#line 3626 "dk3sf.ctr"
if(app) {
/* Not a directory! */
#if DK3_CHAR_SIZE == 1
@@ -3076,7 +3132,7 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
} else {
-#line 3558 "dk3sf.ctr"
+#line 3636 "dk3sf.ctr"
#if DK3_HAVE_MKDIR
#if DK3_HAVE_MKDIR2
if(mkdir(buffer, m) == 0)
@@ -3086,15 +3142,15 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
{
back = 1;
-#line 3566 "dk3sf.ctr"
+#line 3644 "dk3sf.ctr"
#if DK3_HAVE_CHMOD
(void)chmod(buffer, m);
-#line 3568 "dk3sf.ctr"
+#line 3646 "dk3sf.ctr"
#endif
} else {
-#line 3570 "dk3sf.ctr"
+#line 3648 "dk3sf.ctr"
#if DK3_CHAR_SIZE == 1
dk3app_log_i3(app, DK3_LL_ERROR, 84, 85, buffer);
#else
@@ -3105,7 +3161,7 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
#else
if(app) {
-#line 3579 "dk3sf.ctr"
+#line 3657 "dk3sf.ctr"
/* No mkdir() function available! */
dk3app_log_i1(app, DK3_LL_ERROR, 107);
}
@@ -3114,7 +3170,7 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
} else {
-#line 3586 "dk3sf.ctr"
+#line 3664 "dk3sf.ctr"
if(app) {
/* Path too long! */
#if DK3_CHAR_SIZE == 1
@@ -3126,7 +3182,7 @@ dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
}
}
-#line 3596 "dk3sf.ctr"
+#line 3674 "dk3sf.ctr"
return back;
}
@@ -3251,8 +3307,9 @@ dk3sf_initialize_stderr(void)
void
-dk3sf_initialize_file(FILE *fipo)
+dk3sf_initialize_file(FILE * DK3_ARG_UNUSED(fipo) )
{
+ DK3_UNUSED_ARG(fipo)
}
@@ -3271,7 +3328,7 @@ dk3sf_must_expand(dkChar const *fn)
int back = 0;
-#line 3739 "dk3sf.ctr"
+#line 3818 "dk3sf.ctr"
if(fn) {
#if DK3_ON_WINDOWS
dkChar const *ptr;
@@ -3290,7 +3347,7 @@ dk3sf_must_expand(dkChar const *fn)
#endif
}
-#line 3756 "dk3sf.ctr"
+#line 3835 "dk3sf.ctr"
return back;
}
@@ -3347,13 +3404,13 @@ dk3sf_read_app(int fd, void *buf, size_t s, dk3_app_t *app)
size_t back = 0;
-#line 3811 "dk3sf.ctr"
+#line 3890 "dk3sf.ctr"
if((buf) && (s)) {
#if DK3_ON_WINDOWS
int rb;
-#line 3815 "dk3sf.ctr"
+#line 3894 "dk3sf.ctr"
rb = _read(fd, buf, (unsigned int)s);
if(rb >= 0) {
back = (size_t)rb;
@@ -3363,16 +3420,16 @@ dk3sf_read_app(int fd, void *buf, size_t s, dk3_app_t *app)
}
-#line 3823 "dk3sf.ctr"
+#line 3902 "dk3sf.ctr"
#else
-#line 3825 "dk3sf.ctr"
+#line 3904 "dk3sf.ctr"
#if DK3_HAVE_READ
ssize_t rb = 0; /* Number of bytes read. */
-#line 3828 "dk3sf.ctr"
+#line 3907 "dk3sf.ctr"
rb = read(fd, buf, s);
if(rb >= (ssize_t)0) {
back = (size_t)rb;
@@ -3384,13 +3441,13 @@ dk3sf_read_app(int fd, void *buf, size_t s, dk3_app_t *app)
}
}
-#line 3838 "dk3sf.ctr"
+#line 3917 "dk3sf.ctr"
#else
#if DK3_HAVE__READ
ssize_t rb = 0; /* Number of bytes read. */
-#line 3842 "dk3sf.ctr"
+#line 3921 "dk3sf.ctr"
rb = _read(fd, buf, s);
if(rb >= (ssize_t)0) {
back = (size_t)rb;
@@ -3402,18 +3459,18 @@ dk3sf_read_app(int fd, void *buf, size_t s, dk3_app_t *app)
}
}
-#line 3852 "dk3sf.ctr"
+#line 3931 "dk3sf.ctr"
#else
#error "No read() function available!"
#endif
#endif
-#line 3857 "dk3sf.ctr"
+#line 3936 "dk3sf.ctr"
#endif
}
-#line 3859 "dk3sf.ctr"
+#line 3938 "dk3sf.ctr"
return back;
}
@@ -3605,7 +3662,7 @@ dk3sf_inspect_bom_skip_app(
size_t rb = 0; /* Number of bytes read. */
-#line 4049 "dk3sf.ctr"
+#line 4128 "dk3sf.ctr"
if(skb) { *skb = 0; }
back = dv;
if(fn) {
@@ -3617,7 +3674,7 @@ dk3sf_inspect_bom_skip_app(
if((bb[0] == 0xEF) && (bb[1] == 0xBB) && (bb[2] == 0xBF)) {
found = 1; back = DK3_FILE_ENCODING_UTF8;
-#line 4059 "dk3sf.ctr"
+#line 4138 "dk3sf.ctr"
if(skb) { *skb = 3; }
}
}
@@ -3626,19 +3683,19 @@ dk3sf_inspect_bom_skip_app(
if((bb[0] == 0xFE) && (bb[1] == 0xFF)) {
found = 1; back = DK3_FILE_ENCODING_UTF16_MSB_FIRST;
-#line 4066 "dk3sf.ctr"
+#line 4145 "dk3sf.ctr"
if(skb) { *skb = 2; }
} else {
if((bb[0] == 0xFF) && (bb[1] == 0xFE)) {
found = 1; back = DK3_FILE_ENCODING_UTF16_LSB_FIRST;
-#line 4070 "dk3sf.ctr"
+#line 4149 "dk3sf.ctr"
if(skb) { *skb = 2; }
if(rb >= 4) {
if((bb[2] == 0x00) && (bb[3] == 0x00)) {
back = DK3_FILE_ENCODING_UNICODE_LSB_FIRST;
-#line 4074 "dk3sf.ctr"
+#line 4153 "dk3sf.ctr"
if(skb) { *skb = 4; }
}
}
@@ -3654,7 +3711,7 @@ dk3sf_inspect_bom_skip_app(
{
found = 1; back = DK3_FILE_ENCODING_UNICODE_MSB_FIRST;
-#line 4088 "dk3sf.ctr"
+#line 4167 "dk3sf.ctr"
if(skb) { *skb = 4; }
}
}
@@ -3667,7 +3724,7 @@ dk3sf_inspect_bom_skip_app(
}
}
-#line 4099 "dk3sf.ctr"
+#line 4178 "dk3sf.ctr"
return back;
}
@@ -3689,25 +3746,29 @@ dk3sf_apply_bom_to_file_app(FILE *fipo, int enc, dk3_app_t *app)
int back = 0;
-#line 4119 "dk3sf.ctr"
+#line 4198 "dk3sf.ctr"
#if DK3_ON_WINDOWS
if(fipo) {
switch(enc) {
case DK3_FILE_ENCODING_ASCII: {
back = 1;
-#line 4124 "dk3sf.ctr"
+#line 4203 "dk3sf.ctr"
} break;
case DK3_FILE_ENCODING_UTF8: {
back = 1;
+#if defined(_MSC_VER)
_setmode(_fileno(fipo), _O_U8TEXT);
-#line 4128 "dk3sf.ctr"
+#line 4208 "dk3sf.ctr"
+#endif
} break;
case DK3_FILE_ENCODING_UTF16_LSB_FIRST: {
+#if defined(_MSC_VER)
_setmode(_fileno(fipo), _O_U16TEXT);
-#line 4131 "dk3sf.ctr"
+#line 4213 "dk3sf.ctr"
+#endif
} break;
default: {
/* ERROR: Encoding can not be handled directly by file! */
@@ -3721,7 +3782,7 @@ dk3sf_apply_bom_to_file_app(FILE *fipo, int enc, dk3_app_t *app)
case DK3_FILE_ENCODING_ASCII: case DK3_FILE_ENCODING_UTF8: {
back = 1;
-#line 4143 "dk3sf.ctr"
+#line 4226 "dk3sf.ctr"
} break;
default: {
/* ERROR: Encoding can not be handled direcly by file! */
@@ -3732,7 +3793,7 @@ dk3sf_apply_bom_to_file_app(FILE *fipo, int enc, dk3_app_t *app)
#endif
-#line 4152 "dk3sf.ctr"
+#line 4235 "dk3sf.ctr"
return back;
}
@@ -3865,23 +3926,23 @@ dk3sf_scan_double_app(dkChar const *txt, double *v, dk3_app_t *app)
int back = 0;
-#line 4283 "dk3sf.ctr"
+#line 4366 "dk3sf.ctr"
if((txt) && (v)) {
-#line 4284 "dk3sf.ctr"
+#line 4367 "dk3sf.ctr"
#if DK3_HAVE_SETLOCALE
char oldlocale[64];
char *lcptr;
lcptr = setlocale(LC_NUMERIC, NULL);
-#line 4289 "dk3sf.ctr"
+#line 4372 "dk3sf.ctr"
if(lcptr) {
-#line 4290 "dk3sf.ctr"
+#line 4373 "dk3sf.ctr"
if(dk3str_c8_len(lcptr) < sizeof(oldlocale)) {
-#line 4291 "dk3sf.ctr"
+#line 4374 "dk3sf.ctr"
dk3str_c8_cpy_not_overlapped(oldlocale, lcptr);
setlocale(LC_NUMERIC, "C");
#if VERSION_BEFORE_20140716
@@ -3892,7 +3953,7 @@ dk3sf_scan_double_app(dkChar const *txt, double *v, dk3_app_t *app)
setlocale(LC_NUMERIC, oldlocale);
} else {
-#line 4300 "dk3sf.ctr"
+#line 4383 "dk3sf.ctr"
#if VERSION_BEFORE_20140716
dk3sf_sscanf3(txt,dkT("%lf"),v);
#else
@@ -3905,7 +3966,7 @@ dk3sf_scan_double_app(dkChar const *txt, double *v, dk3_app_t *app)
}
} else {
-#line 4311 "dk3sf.ctr"
+#line 4394 "dk3sf.ctr"
#if VERSION_BEFORE_20140716
dk3sf_sscanf3(txt,dkT("%lf"),v);
#else
@@ -3920,14 +3981,14 @@ dk3sf_scan_double_app(dkChar const *txt, double *v, dk3_app_t *app)
#if VERSION_BEFORE_20140716
back = dk3sf_sscanf3(txt,dkT("%lf"),v);
-#line 4324 "dk3sf.ctr"
+#line 4407 "dk3sf.ctr"
#else
back = dk3ma_d_from_string(v, txt, NULL);
#endif
#endif
}
-#line 4329 "dk3sf.ctr"
+#line 4412 "dk3sf.ctr"
return back;
}
diff --git a/support/dktools/dk3sf.ctr b/support/dktools/dk3sf.ctr
index b12b4621cd..6f61fdb89b 100644
--- a/support/dktools/dk3sf.ctr
+++ b/support/dktools/dk3sf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -747,6 +747,7 @@ dk3sf_getenv(dkChar const *name);
%% module
#include "dk3all.h"
+#include "dk3unused.h"
@@ -898,7 +899,15 @@ $!end
void
+#if (DK3_CHAR_SIZE == 1) && DK3_HAVE_STRERROR && (!DK3_ON_WINDOWS)
dk3sf_report_errno(dk3_app_t *app, int err, dkChar const *fctn)
+#else
+dk3sf_report_errno(
+ dk3_app_t * DK3_ARG_UNUSED(app),
+ int DK3_ARG_UNUSED(err),
+ dkChar const * DK3_ARG_UNUSED(fctn)
+)
+#endif
{
#if (DK3_CHAR_SIZE == 1) && DK3_HAVE_STRERROR && (!DK3_ON_WINDOWS)
dkChar const *msgarray[2];
@@ -925,6 +934,10 @@ dk3sf_report_errno(dk3_app_t *app, int err, dkChar const *fctn)
}
#endif
}
+#else
+ DK3_UNUSED_ARG(app)
+ DK3_UNUSED_ARG(err)
+ DK3_UNUSED_ARG(fctn)
#endif
}
@@ -1145,9 +1158,10 @@ dk3sf_c8_attempt_home(
int
-dk3sf_c8_get_home_app(char *d, size_t s, dk3_app_t *app)
+dk3sf_c8_get_home_app(char *d, size_t s, dk3_app_t * DK3_ARG_UNUSED(app))
{
int back = 0;
+ DK3_UNUSED_ARG(app)
if((d) && (s)) {
back = dk3sf_c8_attempt_home(d, s, dk3sf_kw_win_c8[0], dk3sf_kw_win_c8[1], NULL);
if(!back) {
@@ -1240,9 +1254,10 @@ dk3sf_c16_attempt_home(
int
-dk3sf_c16_get_home_app(dk3_c16_t *d, size_t s, dk3_app_t *app)
+dk3sf_c16_get_home_app(dk3_c16_t *d, size_t s, dk3_app_t * DK3_ARG_UNUSED(app))
{
int back = 0;
+ DK3_UNUSED_ARG(app)
if((d) && (s)) {
back = dk3sf_c16_attempt_home(d, s, dk3sf_kw_win_c16[0], dk3sf_kw_win_c16[1], NULL);
if(!back) {
@@ -1376,6 +1391,7 @@ dk3sf_convert_file_permissions(int m)
}
+#if (1 == DK3_CHAR_SIZE) || (VERSION_BEFORE_2019_10_20)
/** Convert file permissions back from dktools to system values.
@param m File permissions in dktools notation.
@@ -1392,7 +1408,10 @@ dk3sf_convert_back_file_permissions(int m)
return back;
}
+#endif
+
+#if VERSION_BEFORE_2012_04_14
static
void
@@ -1406,6 +1425,7 @@ dk3sf_convert_filetime(dk3_time_t *pd, FILETIME *ps)
*pd = (dk3_time_t)i1;
}
+#endif
int
@@ -1414,7 +1434,9 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
WIN32_FIND_DATAA wfd;
DWORD dwFileAttributes;
HANDLE hFFF;
+#if VERSION_BEFORE_2012_04_14
int ec = 0;
+#endif
int back = 0;
struct __stat64 stb; /* Internal buffer for _stat64(). */
$? "+ dk3sf_c8_stat_app \"%!8s\"", fn
@@ -1701,10 +1723,16 @@ dk3sf_c8_getcwd_app(char *dest, size_t sz, dk3_app_t *app)
int
dk3sf_c8_find_exec_app(
- char *d, size_t s, char const *w, char const *c, dk3_app_t *app
+ char *d,
+ size_t s,
+ char const * DK3_ARG_UNUSED(w),
+ char const * DK3_ARG_UNUSED(c),
+ dk3_app_t *app
)
{
int back = 0;
+ DK3_UNUSED_ARG(w)
+ DK3_UNUSED_ARG(c)
if((d) && (s)) {
if(GetModuleFileNameA(GetModuleHandle(NULL),d,(DWORD)s)) {
back = 1;
@@ -1743,17 +1771,32 @@ dk3sf_c8_is_drive(char const *p)
int
-dk3sf_c8_mkdir_app(char const *p, int mo, dk3_app_t *app)
+dk3sf_c8_mkdir_app(
+ char const *p,
+#if VERSION_BEFORE_2019_10_20
+ int mo,
+#else
+ int DK3_ARG_UNUSED(mo),
+#endif
+ dk3_app_t *app
+)
{
int back = 0;
char buffer[DK3_MAX_PATH]; /* Path name for parent directories. */
char *ptr = NULL; /* Slash/backslash position. */
int cc = 1; /* Flag: Can continue. */
+#if VERSION_BEFORE_2019_10_20
int m = 0; /* File permissions. */
+#endif
dk3_stat_t stb;
+#if (!(VERSION_BEFORE_2019_10_20))
+ DK3_UNUSED_ARG(mo)
+#endif
$? "+ dk3sf_c8_mkdir_app \"%!8s\"", TR_8STR(p)
if(p) {
+#if VERSION_BEFORE_2019_10_20
m = dk3sf_convert_back_file_permissions(mo);
+#endif
if(dk3str_c8_len(p) < sizeof(buffer)) { $? ". length ok"
dk3str_c8_cpy_not_overlapped(buffer, p);
ptr = buffer; cc = 1;
@@ -1840,7 +1883,9 @@ dk3sf_c16_stat_app(dk3_stat_t *st, dk3_c16_t const *fn, dk3_app_t *app)
WIN32_FIND_DATAW wfd;
DWORD dwFileAttributes;
HANDLE hFFF;
+#if VERSION_BEFORE_2012_04_14
int ec = 0;
+#endif
int back = 0;
struct __stat64 stb; /* Result from _wstat64(). */
$? "+ dk3sf_c16_stat_app \"%ls\"", fn
@@ -2069,10 +2114,16 @@ dk3sf_c16_getcwd_app(dk3_c16_t *dest, size_t sz, dk3_app_t *app)
int
dk3sf_c16_find_exec_app(
- dk3_c16_t *d, size_t s, dk3_c16_t const *w, dk3_c16_t const *c, dk3_app_t *app
+ dk3_c16_t *d,
+ size_t s,
+ dk3_c16_t const * DK3_ARG_UNUSED(w),
+ dk3_c16_t const * DK3_ARG_UNUSED(c),
+ dk3_app_t *app
)
{
int back = 0;
+ DK3_UNUSED_ARG(w)
+ DK3_UNUSED_ARG(c)
if((d) && (s)) {
if(GetModuleFileNameW(GetModuleHandle(NULL),d,(DWORD)s)) {
back = 1;
@@ -2111,16 +2162,31 @@ dk3sf_c16_is_drive(dk3_c16_t const *p)
int
-dk3sf_c16_mkdir_app(dk3_c16_t const *p, int mo, dk3_app_t *app)
+dk3sf_c16_mkdir_app(
+ dk3_c16_t const *p,
+#if VERSION_BEFORE_2019_10_20
+ int mo,
+#else
+ int DK3_ARG_UNUSED(mo),
+#endif
+ dk3_app_t *app
+)
{
int back = 0;
dk3_c16_t buffer[DK3_MAX_PATH]; /* File names of parent directories. */
dk3_c16_t *ptr = NULL; /* Current slash/backslash position. */
int cc = 1; /* Flag: Can continue. */
+#if VERSION_BEFORE_2019_10_20
int m = 0; /* Permissions. */
+#endif
dk3_stat_t stb; /* Test whether file/dir exists. */
+#if (!(VERSION_BEFORE_2019_10_20))
+ DK3_UNUSED_ARG(mo)
+#endif
if(p) {
+#if VERSION_BEFORE_2019_10_20
m = dk3sf_convert_back_file_permissions(mo);
+#endif
if(dk3str_c16_len(p) < sizeof(buffer)) {
dk3str_c16_cpy(buffer, p);
ptr = buffer; cc = 1;
@@ -2341,7 +2407,9 @@ dk3sf_initialize_stdout(void)
static int not_bom_written_to_stdout = 1;
if(not_bom_written_to_stdout) {
not_bom_written_to_stdout = 0;
+#if defined(_MSC_VER)
(void)_setmode(_fileno(stdout), _O_U16TEXT);
+#endif
if(!_isatty(_fileno(stdout))) {
fputwc(0xFEFF, stdout);
}
@@ -2356,7 +2424,9 @@ dk3sf_initialize_stdout_no_bom(void)
static int not_bom_written_to_stdout = 1;
if(not_bom_written_to_stdout) {
not_bom_written_to_stdout = 0;
+#if defined(_MSC_VER)
(void)_setmode(_fileno(stdout), _O_U16TEXT);
+#endif
}
}
@@ -2368,7 +2438,9 @@ dk3sf_initialize_stderr(void)
static int not_bom_written_to_stderr = 1;
if(not_bom_written_to_stderr) {
not_bom_written_to_stderr = 0;
+#if defined(_MSC_VER)
(void)_setmode(_fileno(stderr), _O_U16TEXT);
+#endif
if(!_isatty(_fileno(stderr))) {
fputwc(0xFEFF, stderr);
}
@@ -2380,7 +2452,9 @@ dk3sf_initialize_stderr(void)
void
dk3sf_initialize_file(FILE *fipo)
{
+#if defined(_MSC_VER)
(void)_setmode(_fileno(fipo), _O_U16TEXT);
+#endif
fputwc(0xFEFF, fipo);
}
@@ -2868,6 +2942,8 @@ dk3sf_convert_file_permissions(mode_t m)
+#if (1 == DK3_CHAR_SIZE) || (VERSION_BEFORE_2019_10_20)
+
/** Convert file permissions back from dktools to system values.
@param m File permissions in dktools notation.
@return File permissions in system notation.
@@ -2892,6 +2968,8 @@ dk3sf_convert_back_file_permissions(int m)
return back;
}
+#endif
+
int
dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
@@ -3032,7 +3110,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
st->ft = dk3sf_convert_file_type(stb.st_mode);
st->perm = dk3sf_convert_file_permissions(stb.st_mode);
st->sz = (dk3_um_t)(stb.st_size);
- sz->lsz = st->sz;
+ st->lsz = st->sz;
st->ai = 0x00;
#if DK3_HAVE_LSTAT
if(lstat(fn, &lstb) == 0) {
@@ -3050,7 +3128,7 @@ dk3sf_c8_stat_app(dk3_stat_t *st, char const *fn, dk3_app_t *app)
st->lacc = (dk3_time_t)(lstb.st_atime);
st->lft = dk3sf_convert_file_type(lstb.st_mode);
st->lperm = dk3sf_convert_file_permissions(lstb.st_mode);
- sz->lsz = (dk3_um_t)(lstb.st_size);
+ st->lsz = (dk3_um_t)(lstb.st_size);
if(lstb.st_uid != stb.st_uid) {
st->ai |= DK3_STAT_AI_USER_DIFFERS;
}
@@ -3717,8 +3795,9 @@ dk3sf_initialize_stderr(void)
void
-dk3sf_initialize_file(FILE *fipo)
+dk3sf_initialize_file(FILE * DK3_ARG_UNUSED(fipo) )
{
+ DK3_UNUSED_ARG(fipo)
}
@@ -4124,10 +4203,14 @@ dk3sf_apply_bom_to_file_app(FILE *fipo, int enc, dk3_app_t *app)
} break;
case DK3_FILE_ENCODING_UTF8: {
back = 1;
+#if defined(_MSC_VER)
_setmode(_fileno(fipo), _O_U8TEXT); $? ". 8"
+#endif
} break;
case DK3_FILE_ENCODING_UTF16_LSB_FIRST: {
+#if defined(_MSC_VER)
_setmode(_fileno(fipo), _O_U16TEXT); $? ". 16 L"
+#endif
} break;
default: {
/* ERROR: Encoding can not be handled directly by file! */
diff --git a/support/dktools/dk3sf.h b/support/dktools/dk3sf.h
index dbd2905927..84bcd62d34 100644
--- a/support/dktools/dk3sf.h
+++ b/support/dktools/dk3sf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3sf.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3sf.ctr
*/
/** @file dk3sf.h Header file for the dk3sf module.
diff --git a/support/dktools/dk3signl.c b/support/dktools/dk3signl.c
index c09096c651..cec1e78a66 100644
--- a/support/dktools/dk3signl.c
+++ b/support/dktools/dk3signl.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3signl.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3signl.ctr
*/
/** @file dk3signl.c The dk3signl module.
@@ -40,12 +18,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 47 "dk3signl.ctr"
#include "dk3all.h"
+#include "dk3unused.h"
-#line 53 "dk3signl.ctr"
+#line 54 "dk3signl.ctr"
@@ -112,11 +91,18 @@ dk3signal_set(int signo, dk3_signal_disp_t fct)
void
-dk3signal_refresh(int signo, dk3_signal_disp_t fct)
+dk3signal_refresh(
+ int DK3_ARG_UNUSED(signo),
+ dk3_signal_disp_t DK3_ARG_UNUSED(fct)
+)
{
#if DK3_HAVE_SIGACTION
+ DK3_UNUSED_ARG(signo)
+ DK3_UNUSED_ARG(fct)
#else
#if DK3_HAVE_SIGSET
+ DK3_UNUSED_ARG(signo)
+ DK3_UNUSED_ARG(fct)
#else
#if DK3_HAVE_SIGNAL
(void)signal(signo, fct);
diff --git a/support/dktools/dk3signl.ctr b/support/dktools/dk3signl.ctr
index a518c3aff5..a61830df35 100644
--- a/support/dktools/dk3signl.ctr
+++ b/support/dktools/dk3signl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -46,6 +46,7 @@ dk3signal_available(void);
%% module
#include "dk3all.h"
+#include "dk3unused.h"
@@ -116,11 +117,18 @@ dk3signal_set(int signo, dk3_signal_disp_t fct)
void
-dk3signal_refresh(int signo, dk3_signal_disp_t fct)
+dk3signal_refresh(
+ int DK3_ARG_UNUSED(signo),
+ dk3_signal_disp_t DK3_ARG_UNUSED(fct)
+)
{
#if DK3_HAVE_SIGACTION
+ DK3_UNUSED_ARG(signo)
+ DK3_UNUSED_ARG(fct)
#else
#if DK3_HAVE_SIGSET
+ DK3_UNUSED_ARG(signo)
+ DK3_UNUSED_ARG(fct)
#else
#if DK3_HAVE_SIGNAL
(void)signal(signo, fct);
diff --git a/support/dktools/dk3signl.h b/support/dktools/dk3signl.h
index cbe9e9f8fb..f5137c9e8b 100644
--- a/support/dktools/dk3signl.h
+++ b/support/dktools/dk3signl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3signl.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3signl.ctr
*/
/** @file dk3signl.h Header file for the dk3signl module.
diff --git a/support/dktools/dk3srch.c b/support/dktools/dk3srch.c
index 31b2c9ff48..71d2514669 100644
--- a/support/dktools/dk3srch.c
+++ b/support/dktools/dk3srch.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3srch.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3srch.ctr
*/
/** @file dk3srch.c The dk3srch module.
diff --git a/support/dktools/dk3srch.ctr b/support/dktools/dk3srch.ctr
index f80a2c5700..3b55b29675 100644
--- a/support/dktools/dk3srch.ctr
+++ b/support/dktools/dk3srch.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3srch.h b/support/dktools/dk3srch.h
index d800c3aa48..2058d2cc52 100644
--- a/support/dktools/dk3srch.h
+++ b/support/dktools/dk3srch.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3srch.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3srch.ctr
*/
/** @file dk3srch.h Header file for the dk3srch module.
diff --git a/support/dktools/dk3stm.h b/support/dktools/dk3stm.h
index 0974e1114f..aacdcc7be0 100644
--- a/support/dktools/dk3stm.h
+++ b/support/dktools/dk3stm.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK3STM_H_INCLUDED
/** Protection against multiple inclusions. */
diff --git a/support/dktools/dk3sto.c b/support/dktools/dk3sto.c
index 0b2dec7a73..3864ece157 100644
--- a/support/dktools/dk3sto.c
+++ b/support/dktools/dk3sto.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3sto.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3sto.ctr
*/
/** @file dk3sto.c The dk3sto module.
@@ -537,14 +515,15 @@ dk3sto_left_deleted(dk3_sto_node_t *p, short *h)
#line 669 "dk3sto.ctr"
switch(p->b) {
case 0: *h = - *h;
+ /* fall-through */
case 3:
-#line 673 "dk3sto.ctr"
+#line 674 "dk3sto.ctr"
dk3sto_inc_balance(p);
-#line 675 "dk3sto.ctr"
+#line 676 "dk3sto.ctr"
break;
case 1: {
switch((p->r)->b) {
@@ -570,7 +549,7 @@ dk3sto_left_deleted(dk3_sto_node_t *p, short *h)
}
-#line 699 "dk3sto.ctr"
+#line 700 "dk3sto.ctr"
return p;
}
@@ -586,9 +565,10 @@ dk3sto_right_deleted(dk3_sto_node_t *p, short *h)
{
-#line 713 "dk3sto.ctr"
+#line 714 "dk3sto.ctr"
switch(p->b) {
case 0: *h = - *h;
+ /* fall-through */
case 1: dk3sto_dec_balance(p);
break;
case 3: {
@@ -615,7 +595,7 @@ dk3sto_right_deleted(dk3_sto_node_t *p, short *h)
}
-#line 740 "dk3sto.ctr"
+#line 742 "dk3sto.ctr"
return p;
}
@@ -637,7 +617,7 @@ dk3sto_avlt_add(dk3_sto_node_t *root, dk3_sto_node_t *newnode, dk3_sto_t *st)
dk3_sto_node_t *s = NULL; /* Father of r. */
-#line 760 "dk3sto.ctr"
+#line 762 "dk3sto.ctr"
back = root;
p = r = root; q = s = NULL;
/*
@@ -751,7 +731,7 @@ dk3sto_avlt_add(dk3_sto_node_t *root, dk3_sto_node_t *newnode, dk3_sto_t *st)
}
-#line 872 "dk3sto.ctr"
+#line 874 "dk3sto.ctr"
return back;
}
@@ -784,7 +764,7 @@ dk3sto_avlt_delete(
todel = node;
-#line 903 "dk3sto.ctr"
+#line 905 "dk3sto.ctr"
/*
Make sure the node to delete has max.
1 subtree.
@@ -792,14 +772,14 @@ dk3sto_avlt_delete(
if((todel->l) && (todel->r)) {
-#line 909 "dk3sto.ctr"
+#line 911 "dk3sto.ctr"
todel = todel->l;
while(todel->r) todel = todel->r;
dk3sto_node_data_copy(node,todel,st);
}
if(!(todel->p)) {
-#line 914 "dk3sto.ctr"
+#line 916 "dk3sto.ctr"
delroot = 1;
}
/*
@@ -811,12 +791,12 @@ dk3sto_avlt_delete(
if((todel->p)->l == todel) {
-#line 924 "dk3sto.ctr"
+#line 926 "dk3sto.ctr"
(todel->p)->w = DK3STO_WALK_LEFT;
} else {
-#line 927 "dk3sto.ctr"
+#line 929 "dk3sto.ctr"
(todel->p)->w = DK3STO_WALK_RIGHT;
}
todel = todel->p;
@@ -828,49 +808,49 @@ dk3sto_avlt_delete(
while(can_continue) {
-#line 937 "dk3sto.ctr"
+#line 939 "dk3sto.ctr"
#if VERSION_BEFORE_20151002
if(p) {
-#line 939 "dk3sto.ctr"
+#line 941 "dk3sto.ctr"
#endif
if(p->w) {
-#line 941 "dk3sto.ctr"
+#line 943 "dk3sto.ctr"
if(p->b == 0) {
x1 = 0;
-#line 943 "dk3sto.ctr"
+#line 945 "dk3sto.ctr"
}
delpath[x1++] = p;
-#line 945 "dk3sto.ctr"
+#line 947 "dk3sto.ctr"
if(x1 >= st->l) {
-#line 946 "dk3sto.ctr"
+#line 948 "dk3sto.ctr"
/* x1 too large */
*success_indicator = 0;
goto error_mark;
}
if(p->w == DK3STO_WALK_LEFT) {
-#line 951 "dk3sto.ctr"
+#line 953 "dk3sto.ctr"
p = p->l;
} else {
-#line 953 "dk3sto.ctr"
+#line 955 "dk3sto.ctr"
p = p->r;
}
} else {
can_continue = 0;
-#line 957 "dk3sto.ctr"
+#line 959 "dk3sto.ctr"
}
#if VERSION_BEFORE_20151002
} else {
can_continue = 0;
-#line 961 "dk3sto.ctr"
+#line 963 "dk3sto.ctr"
}
#endif
}
@@ -884,48 +864,48 @@ dk3sto_avlt_delete(
if(x1 == 0) {
if(delroot) {
-#line 973 "dk3sto.ctr"
+#line 975 "dk3sto.ctr"
back = q;
}
}
while(x1 > 0) {
-#line 977 "dk3sto.ctr"
+#line 979 "dk3sto.ctr"
x1--;
p = delpath[x1];
if(p->w == DK3STO_WALK_LEFT) {
-#line 981 "dk3sto.ctr"
+#line 983 "dk3sto.ctr"
p->l = q; if(q) q->p = p;
q = dk3sto_left_deleted(p, &x1);
-#line 984 "dk3sto.ctr"
+#line 986 "dk3sto.ctr"
} else {
-#line 986 "dk3sto.ctr"
+#line 988 "dk3sto.ctr"
p->r = q; if(q) q->p = p;
q = dk3sto_right_deleted(p, &x1);
-#line 989 "dk3sto.ctr"
+#line 991 "dk3sto.ctr"
}
if(x1 == 0) {
-#line 992 "dk3sto.ctr"
+#line 994 "dk3sto.ctr"
if(delpath[x1] == back) {
-#line 994 "dk3sto.ctr"
+#line 996 "dk3sto.ctr"
back = q;
}
}
if(x1 < 0) {
-#line 998 "dk3sto.ctr"
+#line 1000 "dk3sto.ctr"
p = delpath[0 - x1 - 1];
if(p->w == DK3STO_WALK_LEFT) {
p->l = q;
@@ -941,7 +921,7 @@ error_mark:
}
-#line 1012 "dk3sto.ctr"
+#line 1014 "dk3sto.ctr"
return back;
}
@@ -966,7 +946,7 @@ dk3sto_tree_find_like(
int testval = 0; /* Comparison result. */
-#line 1035 "dk3sto.ctr"
+#line 1037 "dk3sto.ctr"
c = root;
while(c) {
testval = dk3sto_node_compare(c,testnode,st,crit);
@@ -984,7 +964,7 @@ dk3sto_tree_find_like(
}
}
-#line 1051 "dk3sto.ctr"
+#line 1053 "dk3sto.ctr"
return back;
}
@@ -1014,7 +994,7 @@ dk3sto_tree_release_all_nodes(dk3_sto_node_t *r)
{
-#line 1079 "dk3sto.ctr"
+#line 1081 "dk3sto.ctr"
if(r) {
dk3sto_tree_release_all_nodes(r->l);
dk3sto_tree_release_all_nodes(r->r);
@@ -1024,7 +1004,7 @@ dk3sto_tree_release_all_nodes(dk3_sto_node_t *r)
dk3_delete(r) ;
}
-#line 1087 "dk3sto.ctr"
+#line 1089 "dk3sto.ctr"
}
@@ -1042,7 +1022,7 @@ dk3sto_tree_find_next_node(dk3_sto_node_t *n, dk3_sto_node_t *r)
dk3_sto_node_t *p = NULL; /* Parent of c. */
-#line 1103 "dk3sto.ctr"
+#line 1105 "dk3sto.ctr"
/*
if(n) {
if(n->r) {
@@ -1085,7 +1065,7 @@ dk3sto_tree_find_next_node(dk3_sto_node_t *n, dk3_sto_node_t *r)
}
-#line 1144 "dk3sto.ctr"
+#line 1146 "dk3sto.ctr"
return back;
}
@@ -1103,7 +1083,7 @@ dk3sto_tree_find_last_node(dk3_sto_node_t *n)
dk3_sto_node_t *p; /* Father of c. */
-#line 1160 "dk3sto.ctr"
+#line 1162 "dk3sto.ctr"
if(n->l) {
back = n->l;
while(back->r) { back = back->r; }
@@ -1118,7 +1098,7 @@ dk3sto_tree_find_last_node(dk3_sto_node_t *n)
}
}
-#line 1173 "dk3sto.ctr"
+#line 1175 "dk3sto.ctr"
return back;
}
@@ -1140,7 +1120,7 @@ dk3sto_tree_find_exact(dk3_sto_node_t *r, void const *o, dk3_sto_t *s)
int testval = 0; /* Comparison result. */
-#line 1193 "dk3sto.ctr"
+#line 1195 "dk3sto.ctr"
dk3sto_node_init_for_object(&testnode, (void *)o, s, s->c);
c = dk3sto_tree_find_like(r, &testnode, s, s->c, &candidate);
while(c && (!back)) {
@@ -1156,7 +1136,7 @@ dk3sto_tree_find_exact(dk3_sto_node_t *r, void const *o, dk3_sto_t *s)
}
}
-#line 1207 "dk3sto.ctr"
+#line 1209 "dk3sto.ctr"
return back;
}
@@ -1206,7 +1186,7 @@ dk3sto_list_find_like(
int testval = 0; /* Comparison result. */
-#line 1255 "dk3sto.ctr"
+#line 1257 "dk3sto.ctr"
c = root;
while(c && (!back)) {
testval = dk3sto_node_compare(c,testnode,st,crit);
@@ -1224,7 +1204,7 @@ dk3sto_list_find_like(
}
}
-#line 1271 "dk3sto.ctr"
+#line 1273 "dk3sto.ctr"
return back;
}
@@ -1233,20 +1213,20 @@ dk3sto_list_find_like(
/** Find node for an object (exact search).
@param r Root node.
@param o Object.
- @param s Storage.
@return Pointer to the objects node or NULL.
*/
-static dk3_sto_node_t *
-dk3sto_list_find_exact(dk3_sto_node_t *r, void const *o, dk3_sto_t *s)
+static
+dk3_sto_node_t *
+dk3sto_list_find_exact(dk3_sto_node_t *r, void const *o)
{
dk3_sto_node_t *back;
-#line 1287 "dk3sto.ctr"
+#line 1289 "dk3sto.ctr"
back = dk3sto_unsorted_find_exact(r,o);
-#line 1289 "dk3sto.ctr"
+#line 1291 "dk3sto.ctr"
return back;
}
@@ -1268,7 +1248,7 @@ dk3sto_list_add(dk3_sto_node_t *r, dk3_sto_node_t *n, dk3_sto_t *s)
int ende;
-#line 1309 "dk3sto.ctr"
+#line 1311 "dk3sto.ctr"
back = r;
if(r) {
larger = smaller = NULL;
@@ -1305,7 +1285,7 @@ dk3sto_list_add(dk3_sto_node_t *r, dk3_sto_node_t *n, dk3_sto_t *s)
back = n;
}
-#line 1344 "dk3sto.ctr"
+#line 1346 "dk3sto.ctr"
return back;
}
@@ -1319,11 +1299,11 @@ dk3sto_list_release_all_nodes(dk3_sto_node_t *r)
{
-#line 1356 "dk3sto.ctr"
+#line 1358 "dk3sto.ctr"
dk3sto_unsorted_release_all_nodes(r);
-#line 1358 "dk3sto.ctr"
+#line 1360 "dk3sto.ctr"
}
@@ -1339,11 +1319,11 @@ dk3sto_list_find_next_node(dk3_sto_node_t *n, dk3_sto_node_t *r)
dk3_sto_node_t *back;
-#line 1372 "dk3sto.ctr"
+#line 1374 "dk3sto.ctr"
back = dk3sto_unsorted_find_next_node(n,r);
-#line 1374 "dk3sto.ctr"
+#line 1376 "dk3sto.ctr"
return back;
}
@@ -1359,11 +1339,11 @@ dk3sto_list_find_last_node(dk3_sto_node_t *n)
dk3_sto_node_t *back;
-#line 1388 "dk3sto.ctr"
+#line 1390 "dk3sto.ctr"
back = dk3sto_unsorted_find_last_node(n);
-#line 1390 "dk3sto.ctr"
+#line 1392 "dk3sto.ctr"
return back;
}
@@ -1372,24 +1352,19 @@ dk3sto_list_find_last_node(dk3_sto_node_t *n)
/** Remove storage node from list storage.
@param ro Root node.
@param n Node to remove.
- @param st Storage.
- @param sci ???
- @param toremove ???
*/
-static dk3_sto_node_t *
-dk3sto_list_remove(
- dk3_sto_node_t *ro, dk3_sto_node_t *n, dk3_sto_t *st, int *sci,
- dk3_sto_node_t **toremove
-)
+static
+dk3_sto_node_t *
+dk3sto_list_remove( dk3_sto_node_t *ro, dk3_sto_node_t *n)
{
dk3_sto_node_t *back;
-#line 1410 "dk3sto.ctr"
+#line 1407 "dk3sto.ctr"
back = dk3sto_unsorted_remove(ro,n);
-#line 1412 "dk3sto.ctr"
+#line 1409 "dk3sto.ctr"
return back;
}
@@ -1411,7 +1386,7 @@ dk3sto_traverse_iterators_for(void *it, void *o)
dk3_sto_it_t *c = NULL; /* Current node. */
-#line 1432 "dk3sto.ctr"
+#line 1429 "dk3sto.ctr"
if(it) {
c = (dk3_sto_it_t *)it;
while(c && (!back)) {
@@ -1424,7 +1399,7 @@ dk3sto_traverse_iterators_for(void *it, void *o)
}
}
-#line 1443 "dk3sto.ctr"
+#line 1440 "dk3sto.ctr"
return back;
}
@@ -1441,7 +1416,7 @@ dk3sto_find_last_node(dk3_sto_node_t *n, dk3_sto_t *st)
dk3_sto_node_t *back = NULL;
-#line 1458 "dk3sto.ctr"
+#line 1455 "dk3sto.ctr"
if(st->h) {
if(st->t) {
back = dk3sto_tree_find_last_node(n);
@@ -1453,7 +1428,7 @@ dk3sto_find_last_node(dk3_sto_node_t *n, dk3_sto_t *st)
}
-#line 1468 "dk3sto.ctr"
+#line 1465 "dk3sto.ctr"
return back;
}
@@ -1471,7 +1446,7 @@ dk3sto_storage_init(dk3_sto_t *st, dk3_app_t *app)
short l = 0; /* Critical path length. */
-#line 1484 "dk3sto.ctr"
+#line 1481 "dk3sto.ctr"
/* delpath begin address and length */
st->d = NULL; st->l = 0;
/* root node */
@@ -1490,7 +1465,7 @@ dk3sto_storage_init(dk3_sto_t *st, dk3_app_t *app)
back = 1;
}
-#line 1501 "dk3sto.ctr"
+#line 1498 "dk3sto.ctr"
return back;
}
@@ -1504,7 +1479,7 @@ dk3sto_storage_end(dk3_sto_t *st)
{
-#line 1513 "dk3sto.ctr"
+#line 1510 "dk3sto.ctr"
/* release iterators */
{
dk3_sto_it_t *c = NULL; /* Current iterator. */
@@ -1514,7 +1489,7 @@ dk3sto_storage_end(dk3_sto_t *st)
while(c) {
-#line 1521 "dk3sto.ctr"
+#line 1518 "dk3sto.ctr"
n = c->r;
c->r = NULL;
c->l = NULL;
@@ -1527,7 +1502,7 @@ dk3sto_storage_end(dk3_sto_t *st)
}
-#line 1532 "dk3sto.ctr"
+#line 1529 "dk3sto.ctr"
/* release nodes */
{
if(st->h) {
@@ -1543,7 +1518,7 @@ dk3sto_storage_end(dk3_sto_t *st)
}
-#line 1546 "dk3sto.ctr"
+#line 1543 "dk3sto.ctr"
/* release delpath */
{
dk3_sto_node_p *p;
@@ -1553,7 +1528,7 @@ dk3sto_storage_end(dk3_sto_t *st)
}
-#line 1554 "dk3sto.ctr"
+#line 1551 "dk3sto.ctr"
/* set pointers to NULL */
{
st->h = 0;
@@ -1561,10 +1536,10 @@ dk3sto_storage_end(dk3_sto_t *st)
}
-#line 1560 "dk3sto.ctr"
+#line 1557 "dk3sto.ctr"
-#line 1561 "dk3sto.ctr"
+#line 1558 "dk3sto.ctr"
}
@@ -1580,7 +1555,7 @@ dk3sto_open_app(dk3_app_t *app)
dk3_sto_t *back = NULL;
-#line 1575 "dk3sto.ctr"
+#line 1572 "dk3sto.ctr"
back = dk3_new_app(dk3_sto_t,1,app) ;
if(back) {
if(!dk3sto_storage_init(back,app)) {
@@ -1589,7 +1564,7 @@ dk3sto_open_app(dk3_app_t *app)
}
}
-#line 1582 "dk3sto.ctr"
+#line 1579 "dk3sto.ctr"
return back;
}
@@ -1600,13 +1575,13 @@ dk3sto_close(dk3_sto_t *st)
{
-#line 1591 "dk3sto.ctr"
+#line 1588 "dk3sto.ctr"
if(st) {
dk3sto_storage_end(st);
dk3_delete(st) ;
}
-#line 1595 "dk3sto.ctr"
+#line 1592 "dk3sto.ctr"
}
@@ -1651,7 +1626,7 @@ dk3sto_remove(dk3_sto_t *st, void *o)
dk3_sto_it_t *iterator = NULL; /* Traverse all iterators. */
-#line 1638 "dk3sto.ctr"
+#line 1635 "dk3sto.ctr"
if(st && o) {
node_to_remove = dk3sto_traverse_iterators_for(st->i, o);
if(!node_to_remove) {
@@ -1659,7 +1634,7 @@ dk3sto_remove(dk3_sto_t *st, void *o)
if(st->t) {
node_to_remove = dk3sto_tree_find_exact(st->r,o,st);
} else {
- node_to_remove = dk3sto_list_find_exact(st->r,o,st);
+ node_to_remove = dk3sto_list_find_exact(st->r,o);
}
} else {
node_to_remove = dk3sto_unsorted_find_exact(st->r,o);
@@ -1679,7 +1654,7 @@ dk3sto_remove(dk3_sto_t *st, void *o)
if(st->t) {
st->r = dk3sto_tree_remove(st->r,node_to_remove,st,&back,&node_to_remove);
} else {
- st->r = dk3sto_list_remove(st->r,node_to_remove,st,&back,&node_to_remove);
+ st->r = dk3sto_list_remove(st->r,node_to_remove);
}
} else {
st->r = dk3sto_unsorted_remove(st->r,node_to_remove);
@@ -1690,7 +1665,7 @@ dk3sto_remove(dk3_sto_t *st, void *o)
}
}
-#line 1675 "dk3sto.ctr"
+#line 1672 "dk3sto.ctr"
return back;
}
@@ -1703,7 +1678,7 @@ dk3sto_add(dk3_sto_t *st, void *o)
dk3_sto_node_t *n = NULL; /* New node. */
-#line 1686 "dk3sto.ctr"
+#line 1683 "dk3sto.ctr"
if(st && o) {
if(st->app) {
n = dk3_new_app(dk3_sto_node_t,1,((dk3_app_t *)(st->app))) ;
@@ -1725,7 +1700,7 @@ dk3sto_add(dk3_sto_t *st, void *o)
}
}
-#line 1706 "dk3sto.ctr"
+#line 1703 "dk3sto.ctr"
return back;
}
@@ -1737,7 +1712,7 @@ dk3sto_it_open(dk3_sto_t *st)
dk3_sto_it_t *back = NULL;
-#line 1716 "dk3sto.ctr"
+#line 1713 "dk3sto.ctr"
if(st) {
if(st->app) {
back = dk3_new_app(dk3_sto_it_t,1,((dk3_app_t *)(st->app))) ;
@@ -1753,7 +1728,7 @@ dk3sto_it_open(dk3_sto_t *st)
}
}
-#line 1730 "dk3sto.ctr"
+#line 1727 "dk3sto.ctr"
return back;
}
@@ -1767,7 +1742,7 @@ dk3sto_it_close(dk3_sto_it_t *it)
dk3_sto_t *s = NULL; /* The storage. */
-#line 1742 "dk3sto.ctr"
+#line 1739 "dk3sto.ctr"
if(it) {
s = it->s;
l = it->l;
@@ -1786,7 +1761,7 @@ dk3sto_it_close(dk3_sto_it_t *it)
dk3_delete(it) ;
}
-#line 1759 "dk3sto.ctr"
+#line 1756 "dk3sto.ctr"
}
@@ -1796,12 +1771,12 @@ dk3sto_it_reset(dk3_sto_it_t *it)
{
-#line 1767 "dk3sto.ctr"
+#line 1764 "dk3sto.ctr"
if(it) {
it->c = NULL;
}
-#line 1770 "dk3sto.ctr"
+#line 1767 "dk3sto.ctr"
}
@@ -1812,7 +1787,7 @@ dk3sto_it_next(dk3_sto_it_t *it)
void *back = NULL;
-#line 1779 "dk3sto.ctr"
+#line 1776 "dk3sto.ctr"
if(it) {
if(it->s) {
if((it->s)->h) {
@@ -1830,7 +1805,7 @@ dk3sto_it_next(dk3_sto_it_t *it)
}
}
-#line 1795 "dk3sto.ctr"
+#line 1792 "dk3sto.ctr"
return back;
}
@@ -1842,14 +1817,14 @@ dk3sto_it_find_exact(dk3_sto_it_t *i, void const *o)
void *back = NULL;
-#line 1805 "dk3sto.ctr"
+#line 1802 "dk3sto.ctr"
if(i && o) {
if(i->s) {
if((i->s)->h) {
if((i->s)->t) {
i->c = dk3sto_tree_find_exact((i->s)->r, o, i->s);
} else {
- i->c = dk3sto_list_find_exact((i->s)->r, o, i->s);
+ i->c = dk3sto_list_find_exact((i->s)->r, o);
}
} else {
i->c = dk3sto_unsorted_find_exact((i->s)->r, o);
@@ -1860,7 +1835,7 @@ dk3sto_it_find_exact(dk3_sto_it_t *i, void const *o)
}
}
-#line 1821 "dk3sto.ctr"
+#line 1818 "dk3sto.ctr"
return back;
}
@@ -1874,7 +1849,7 @@ dk3sto_it_find_like(dk3_sto_it_t *i, void const *o, int cr)
dk3_sto_node_t *candidate = NULL; /* Candicate node. */
-#line 1833 "dk3sto.ctr"
+#line 1830 "dk3sto.ctr"
if(i && o) {
if(i->s) {
candidate = NULL;
@@ -1896,7 +1871,7 @@ dk3sto_it_find_like(dk3_sto_it_t *i, void const *o, int cr)
}
}
-#line 1853 "dk3sto.ctr"
+#line 1850 "dk3sto.ctr"
return back;
}
@@ -1908,7 +1883,7 @@ dk3sto_set_eval_c(dk3_sto_t *st, dk3_fct_eval_c_t *f, int cr)
int back = 0;
-#line 1863 "dk3sto.ctr"
+#line 1860 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -1918,7 +1893,7 @@ dk3sto_set_eval_c(dk3_sto_t *st, dk3_fct_eval_c_t *f, int cr)
}
}
-#line 1871 "dk3sto.ctr"
+#line 1868 "dk3sto.ctr"
return back;
}
@@ -1930,7 +1905,7 @@ dk3sto_set_eval_uc(dk3_sto_t *st, dk3_fct_eval_uc_t *f, int cr)
int back = 0;
-#line 1881 "dk3sto.ctr"
+#line 1878 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -1940,7 +1915,7 @@ dk3sto_set_eval_uc(dk3_sto_t *st, dk3_fct_eval_uc_t *f, int cr)
}
}
-#line 1889 "dk3sto.ctr"
+#line 1886 "dk3sto.ctr"
return back;
}
@@ -1952,7 +1927,7 @@ dk3sto_set_eval_s(dk3_sto_t *st, dk3_fct_eval_s_t *f, int cr)
int back = 0;
-#line 1899 "dk3sto.ctr"
+#line 1896 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -1962,7 +1937,7 @@ dk3sto_set_eval_s(dk3_sto_t *st, dk3_fct_eval_s_t *f, int cr)
}
}
-#line 1907 "dk3sto.ctr"
+#line 1904 "dk3sto.ctr"
return back;
}
@@ -1974,7 +1949,7 @@ dk3sto_set_eval_us(dk3_sto_t *st, dk3_fct_eval_us_t *f, int cr)
int back = 0;
-#line 1917 "dk3sto.ctr"
+#line 1914 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -1984,7 +1959,7 @@ dk3sto_set_eval_us(dk3_sto_t *st, dk3_fct_eval_us_t *f, int cr)
}
}
-#line 1925 "dk3sto.ctr"
+#line 1922 "dk3sto.ctr"
return back;
}
@@ -1996,7 +1971,7 @@ dk3sto_set_eval_i(dk3_sto_t *st, dk3_fct_eval_i_t *f, int cr)
int back = 0;
-#line 1935 "dk3sto.ctr"
+#line 1932 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -2006,7 +1981,7 @@ dk3sto_set_eval_i(dk3_sto_t *st, dk3_fct_eval_i_t *f, int cr)
}
}
-#line 1943 "dk3sto.ctr"
+#line 1940 "dk3sto.ctr"
return back;
}
@@ -2018,7 +1993,7 @@ dk3sto_set_eval_ui(dk3_sto_t *st, dk3_fct_eval_ui_t *f, int cr)
int back = 0;
-#line 1953 "dk3sto.ctr"
+#line 1950 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -2028,7 +2003,7 @@ dk3sto_set_eval_ui(dk3_sto_t *st, dk3_fct_eval_ui_t *f, int cr)
}
}
-#line 1961 "dk3sto.ctr"
+#line 1958 "dk3sto.ctr"
return back;
}
@@ -2040,7 +2015,7 @@ dk3sto_set_eval_l(dk3_sto_t *st, dk3_fct_eval_l_t *f, int cr)
int back = 0;
-#line 1971 "dk3sto.ctr"
+#line 1968 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -2050,7 +2025,7 @@ dk3sto_set_eval_l(dk3_sto_t *st, dk3_fct_eval_l_t *f, int cr)
}
}
-#line 1979 "dk3sto.ctr"
+#line 1976 "dk3sto.ctr"
return back;
}
@@ -2062,7 +2037,7 @@ dk3sto_set_eval_ul(dk3_sto_t *st, dk3_fct_eval_ul_t *f, int cr)
int back = 0;
-#line 1989 "dk3sto.ctr"
+#line 1986 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -2072,7 +2047,7 @@ dk3sto_set_eval_ul(dk3_sto_t *st, dk3_fct_eval_ul_t *f, int cr)
}
}
-#line 1997 "dk3sto.ctr"
+#line 1994 "dk3sto.ctr"
return back;
}
@@ -2084,7 +2059,7 @@ dk3sto_set_eval_f(dk3_sto_t *st, dk3_fct_eval_f_t *f, int cr)
int back = 0;
-#line 2007 "dk3sto.ctr"
+#line 2004 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -2094,7 +2069,7 @@ dk3sto_set_eval_f(dk3_sto_t *st, dk3_fct_eval_f_t *f, int cr)
}
}
-#line 2015 "dk3sto.ctr"
+#line 2012 "dk3sto.ctr"
return back;
}
@@ -2106,7 +2081,7 @@ dk3sto_set_eval_d(dk3_sto_t *st, dk3_fct_eval_d_t *f, int cr)
int back = 0;
-#line 2025 "dk3sto.ctr"
+#line 2022 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -2116,7 +2091,7 @@ dk3sto_set_eval_d(dk3_sto_t *st, dk3_fct_eval_d_t *f, int cr)
}
}
-#line 2033 "dk3sto.ctr"
+#line 2030 "dk3sto.ctr"
return back;
}
@@ -2128,7 +2103,7 @@ dk3sto_set_comp(dk3_sto_t *st, dk3_fct_comp_t *f, int cr)
int back = 0;
-#line 2043 "dk3sto.ctr"
+#line 2040 "dk3sto.ctr"
if(st) {
if(!(st->r)) {
back = 1;
@@ -2138,7 +2113,7 @@ dk3sto_set_comp(dk3_sto_t *st, dk3_fct_comp_t *f, int cr)
}
}
-#line 2051 "dk3sto.ctr"
+#line 2048 "dk3sto.ctr"
return back;
}
diff --git a/support/dktools/dk3sto.ctr b/support/dktools/dk3sto.ctr
index 5c160687d3..d1d32b6078 100644
--- a/support/dktools/dk3sto.ctr
+++ b/support/dktools/dk3sto.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -668,6 +668,7 @@ dk3sto_left_deleted(dk3_sto_node_t *p, short *h)
$? "+ dk3sto_left_deleted %!8s %!8s", TR_8PTR(p), TR_8PTR(h)
switch(p->b) {
case 0: *h = - *h;
+ /* fall-through */
case 3:
$? ". going to increment balance field of %!8s", TR_8PTR(p)
dk3sto_inc_balance(p);
@@ -712,6 +713,7 @@ dk3sto_right_deleted(dk3_sto_node_t *p, short *h)
$? "+ dk3sto_right_deleted %!8s %!8s", TR_8PTR(p), TR_8PTR(h)
switch(p->b) {
case 0: *h = - *h;
+ /* fall-through */
case 1: dk3sto_dec_balance(p);
break;
case 3: {
@@ -1276,14 +1278,14 @@ dk3sto_list_find_like(
/** Find node for an object (exact search).
@param r Root node.
@param o Object.
- @param s Storage.
@return Pointer to the objects node or NULL.
*/
-static dk3_sto_node_t *
-dk3sto_list_find_exact(dk3_sto_node_t *r, void const *o, dk3_sto_t *s)
+static
+dk3_sto_node_t *
+dk3sto_list_find_exact(dk3_sto_node_t *r, void const *o)
{
dk3_sto_node_t *back;
- $? "+ sorted_find_exact %!8s %!8s %!8s", TR_8PTR(r), TR_8PTR(o), TR_8PTR(s)
+ $? "+ sorted_find_exact %!8s %!8s", TR_8PTR(r), TR_8PTR(o)
back = dk3sto_unsorted_find_exact(r,o);
$? "- sorted_find_exact %!8s", TR_8PTR(back)
return back;
@@ -1395,18 +1397,13 @@ dk3sto_list_find_last_node(dk3_sto_node_t *n)
/** Remove storage node from list storage.
@param ro Root node.
@param n Node to remove.
- @param st Storage.
- @param sci ???
- @param toremove ???
*/
-static dk3_sto_node_t *
-dk3sto_list_remove(
- dk3_sto_node_t *ro, dk3_sto_node_t *n, dk3_sto_t *st, int *sci,
- dk3_sto_node_t **toremove
-)
+static
+dk3_sto_node_t *
+dk3sto_list_remove( dk3_sto_node_t *ro, dk3_sto_node_t *n)
{
dk3_sto_node_t *back;
- $? "+ sorted_remove %!8s %!8s %!8s", TR_8PTR(ro), TR_8PTR(n), TR_8PTR(st)
+ $? "+ sorted_remove %!8s %!8s", TR_8PTR(ro), TR_8PTR(n)
back = dk3sto_unsorted_remove(ro,n);
$? "- sorted_remove %!8s", TR_8PTR(back)
return back;
@@ -1642,7 +1639,7 @@ dk3sto_remove(dk3_sto_t *st, void *o)
if(st->t) {
node_to_remove = dk3sto_tree_find_exact(st->r,o,st);
} else {
- node_to_remove = dk3sto_list_find_exact(st->r,o,st);
+ node_to_remove = dk3sto_list_find_exact(st->r,o);
}
} else {
node_to_remove = dk3sto_unsorted_find_exact(st->r,o);
@@ -1662,7 +1659,7 @@ dk3sto_remove(dk3_sto_t *st, void *o)
if(st->t) {
st->r = dk3sto_tree_remove(st->r,node_to_remove,st,&back,&node_to_remove);
} else {
- st->r = dk3sto_list_remove(st->r,node_to_remove,st,&back,&node_to_remove);
+ st->r = dk3sto_list_remove(st->r,node_to_remove);
}
} else {
st->r = dk3sto_unsorted_remove(st->r,node_to_remove);
@@ -1808,7 +1805,7 @@ dk3sto_it_find_exact(dk3_sto_it_t *i, void const *o)
if((i->s)->t) {
i->c = dk3sto_tree_find_exact((i->s)->r, o, i->s);
} else {
- i->c = dk3sto_list_find_exact((i->s)->r, o, i->s);
+ i->c = dk3sto_list_find_exact((i->s)->r, o);
}
} else {
i->c = dk3sto_unsorted_find_exact((i->s)->r, o);
diff --git a/support/dktools/dk3sto.h b/support/dktools/dk3sto.h
index 4a07a573a3..a59c0397da 100644
--- a/support/dktools/dk3sto.h
+++ b/support/dktools/dk3sto.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3sto.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3sto.ctr
*/
/** @file dk3sto.h Header file for the dk3sto module.
diff --git a/support/dktools/dk3str.c b/support/dktools/dk3str.c
index 4b6067158f..5d86250ff9 100644
--- a/support/dktools/dk3str.c
+++ b/support/dktools/dk3str.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3str.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3str.ctr
*/
/** @file dk3str.c The dk3str module.
@@ -40,11 +18,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 1426 "dk3str.ctr"
#include "dk3all.h"
+#include "dk3unused.h"
-#line 1431 "dk3str.ctr"
+
+#line 1433 "dk3str.ctr"
/* ************************************************************************ */
@@ -54,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* ************************************************************************ */
-#line 1436 "dk3str.ctr"
+#line 1438 "dk3str.ctr"
/** The set of whitespace characters.
@@ -470,7 +450,7 @@ dk3str_c16_casecmp(dk3_c16_t const *s1, dk3_c16_t const *s2)
register int cc; /* Flag: Can continue. */
-#line 1850 "dk3str.ctr"
+#line 1852 "dk3str.ctr"
back = 0; p1 = s1; p2 = s2; cc = 1;
while((cc) && (back == 0)) {
c1 = *p1; c2 = *p2;
@@ -491,7 +471,7 @@ dk3str_c16_casecmp(dk3_c16_t const *s1, dk3_c16_t const *s2)
}
}
-#line 1869 "dk3str.ctr"
+#line 1871 "dk3str.ctr"
#endif
#endif
return back;
@@ -702,7 +682,11 @@ dk3str_c8_chr(char const *s, char c)
{
register char *back; /* Function result. */
#if DK3_HAVE_STRCHR
+#ifdef __cplusplus
+ back = (char *)strchr(s, c);
+#else
back = strchr(s, c);
+#endif
#else
register char const *ptr; /* Pointer to traverse s. */
register char chr; /* Register copy of c. */
@@ -744,7 +728,11 @@ dk3str_c32_chr(dk3_c32_t const *s, dk3_c32_t c)
{
register dk3_c32_t *back;
#if (DK3_HAVE_WCSCHR) && (DK3_SIZEOF_WCHAR_T == 4)
+#ifdef __cplusplus
+ back = (dk3_c32_t *)wcschr(s, c);
+#else
back = wcschr(s, c);
+#endif
#else
#if (DK3_HAVE__WCSCHR) && (DK3_SIZEOF_WCHAR_T == 4)
back = _wcschr(s, c);
@@ -783,7 +771,11 @@ dk3str_c8_rchr(char const *s, char c)
{
register char *back; /* Function result. */
#if DK3_HAVE_STRRCHR
+#ifdef __cplusplus
+ back = (char *)strrchr(s, c);
+#else
back = strrchr(s, c);
+#endif
#else
register char const *ptr; /* Pointer to traverse s. */
register char chr; /* Register copy of c. */
@@ -828,10 +820,18 @@ dk3str_c32_rchr(dk3_c32_t const *s, dk3_c32_t c)
{
register dk3_c32_t *back;
#if (DK3_HAVE_WCSRCHR) && (DK3_SIZEOF_WCHAR_T == 4)
+#ifdef __cplusplus
+ back = (dk3_c32_t *)wcsrchr(s, c);
+#else
back = wcsrchr(s, c);
+#endif
#else
#if (DK3_HAVE__WCSRCHR) && (DK3_SIZEOF_WCHAR_T == 4)
+#ifdef __cplusplus
+ back = (dk4_c32_t *)_wcsrchr(s, c);
+#else
back = _wcsrchr(s, c);
+#endif
#else
register dk3_c32_t const *ptr; /* Traverse source string. */
register dk3_c32_t chr; /* Character to search for. */
@@ -1479,7 +1479,7 @@ dk3str_c8_start(char const *str, char const *whsp)
char const *wh; /* Whitespaces set. */
-#line 2855 "dk3str.ctr"
+#line 2877 "dk3str.ctr"
if(str) {
wh = (whsp ? whsp : dk3str_c8_def_whsp);
ptr = str;
@@ -1492,7 +1492,7 @@ dk3str_c8_start(char const *str, char const *whsp)
}
}
-#line 2866 "dk3str.ctr"
+#line 2888 "dk3str.ctr"
return back;
}
@@ -1529,7 +1529,7 @@ dk3str_c32_start(dk3_c32_t const *str, dk3_c32_t const *whsp)
dk3_c32_t const *wh = NULL; /* Whitespaces set. */
-#line 2901 "dk3str.ctr"
+#line 2923 "dk3str.ctr"
if(str) {
wh = (whsp ? whsp : c32_def_whsp);
ptr = str;
@@ -1542,7 +1542,7 @@ dk3str_c32_start(dk3_c32_t const *str, dk3_c32_t const *whsp)
}
}
-#line 2912 "dk3str.ctr"
+#line 2934 "dk3str.ctr"
return back;
}
@@ -1573,7 +1573,7 @@ dk3str_c8_next(char *str, char const *whsp)
int state = 0; /* Current processing state. */
-#line 2941 "dk3str.ctr"
+#line 2963 "dk3str.ctr"
if(str) {
ptr = str;
wh = (whsp ? whsp : dk3str_c8_def_whsp);
@@ -1594,7 +1594,7 @@ dk3str_c8_next(char *str, char const *whsp)
}
}
-#line 2960 "dk3str.ctr"
+#line 2982 "dk3str.ctr"
return back;
}
@@ -1640,7 +1640,7 @@ dk3str_c32_next(dk3_c32_t *str, dk3_c32_t const *whsp)
int state = 0; /* Current processing state. */
-#line 3004 "dk3str.ctr"
+#line 3026 "dk3str.ctr"
if(str) {
ptr = str;
wh = (whsp ? whsp : c32_def_whsp);
@@ -1648,7 +1648,7 @@ dk3str_c32_next(dk3_c32_t *str, dk3_c32_t const *whsp)
while((state < 2) && (*ptr)) {
if(dk3str_c32_chr(wh, *ptr)) {
-#line 3010 "dk3str.ctr"
+#line 3032 "dk3str.ctr"
if(state == 1) {
state = 2;
*(ptr++) = 0UL;
@@ -1662,7 +1662,7 @@ dk3str_c32_next(dk3_c32_t *str, dk3_c32_t const *whsp)
}
}
-#line 3022 "dk3str.ctr"
+#line 3044 "dk3str.ctr"
return back;
}
@@ -1692,7 +1692,7 @@ dk3str_c8_chomp(char *str, char const *whsp)
char *x; /* Start position of final space sequence. */
-#line 3050 "dk3str.ctr"
+#line 3072 "dk3str.ctr"
if(str) {
wh = (whsp ? whsp : dk3str_c8_def_whsp);
x = NULL; ptr = str;
@@ -1708,7 +1708,7 @@ dk3str_c8_chomp(char *str, char const *whsp)
}
-#line 3064 "dk3str.ctr"
+#line 3086 "dk3str.ctr"
}
@@ -1966,7 +1966,7 @@ dk3str_c8_is_abbr(char const *line,char const *pattern,char spec,int cs)
int cc = 0; /* Flag: Can continue. */
-#line 3320 "dk3str.ctr"
+#line 3342 "dk3str.ctr"
if((line) && (pattern)) {
lptr = line; pptr = pattern; afterspec = 0; cc = 1;
while(cc) {
@@ -2000,7 +2000,7 @@ dk3str_c8_is_abbr(char const *line,char const *pattern,char spec,int cs)
}
-#line 3352 "dk3str.ctr"
+#line 3374 "dk3str.ctr"
return back;
}
@@ -2122,13 +2122,13 @@ dk3str_c8_array_abbr(char const * const *ar, char const *str, char sp, int cs)
int i; /* Current index of ptr in ar. */
-#line 3472 "dk3str.ctr"
+#line 3494 "dk3str.ctr"
if((ar) && (str)) {
i = 0; ptr = ar;
while((*ptr) && (back == -1)) {
-#line 3476 "dk3str.ctr"
+#line 3498 "dk3str.ctr"
if(dk3str_c8_is_abbr(str, *ptr, sp, cs)) {
back = i;
}
@@ -2137,11 +2137,11 @@ dk3str_c8_array_abbr(char const * const *ar, char const *str, char sp, int cs)
}
-#line 3483 "dk3str.ctr"
+#line 3505 "dk3str.ctr"
}
}
-#line 3485 "dk3str.ctr"
+#line 3507 "dk3str.ctr"
return back;
}
@@ -2155,33 +2155,33 @@ dk3str_c16_array_abbr(dk3_c16_t const * const *arr, dk3_c16_t const *str, dk3_c1
int i; /* Current index. */
-#line 3497 "dk3str.ctr"
+#line 3519 "dk3str.ctr"
if((arr) && (str)) {
-#line 3498 "dk3str.ctr"
+#line 3520 "dk3str.ctr"
i = 0; ptr = arr;
while((*ptr) && (back == -1)) {
-#line 3500 "dk3str.ctr"
+#line 3522 "dk3str.ctr"
if(dk3str_c16_is_abbr(str, *ptr, sp, cs)) {
-#line 3501 "dk3str.ctr"
+#line 3523 "dk3str.ctr"
back = i;
} else {
-#line 3503 "dk3str.ctr"
+#line 3525 "dk3str.ctr"
}
if(back == -1) {
ptr++; i++;
}
-#line 3507 "dk3str.ctr"
+#line 3529 "dk3str.ctr"
}
-#line 3508 "dk3str.ctr"
+#line 3530 "dk3str.ctr"
}
-#line 3509 "dk3str.ctr"
+#line 3531 "dk3str.ctr"
return back;
}
@@ -2232,14 +2232,14 @@ dk3str_c8_is_bool(char const *str)
int back = 0; /* Function result. */
-#line 3558 "dk3str.ctr"
+#line 3580 "dk3str.ctr"
if(str) {
if(dk3str_c8_array_abbr(dk3str_c8_bool_kw,str,'$',0) >= 0) {
back = 1;
}
}
-#line 3563 "dk3str.ctr"
+#line 3585 "dk3str.ctr"
return back;
}
@@ -2309,14 +2309,14 @@ dk3str_c8_is_on(char const *str)
int back = 0; /* Function result. */
-#line 3631 "dk3str.ctr"
+#line 3653 "dk3str.ctr"
if(str) {
if(dk3str_c8_array_abbr(dk3str_c8_bool_kw,str,'$',0) >= INDEX_OF_FIRST_BOOLEAN_TRUE) {
back = 1;
}
}
-#line 3636 "dk3str.ctr"
+#line 3658 "dk3str.ctr"
return back;
}
@@ -2666,7 +2666,7 @@ dk3str_c32_is_abs_path(dk3_c32_t const *n)
int back = 0;
-#line 3984 "dk3str.ctr"
+#line 4006 "dk3str.ctr"
if(n) {
if(*n == FNS_C32) {
back = 1;
@@ -2685,7 +2685,7 @@ dk3str_c32_is_abs_path(dk3_c32_t const *n)
}
}
-#line 4001 "dk3str.ctr"
+#line 4023 "dk3str.ctr"
return back;
}
@@ -2864,11 +2864,11 @@ dk3str_c32_append_path_app(dk3_c32_t *d, size_t sz, dk3_c32_t const *n, dk3_app_
-#line 4178 "dk3str.ctr"
+#line 4200 "dk3str.ctr"
if((d) && (sz) && (n)) {
if(dk3str_c32_is_abs_path(n)) {
-#line 4180 "dk3str.ctr"
+#line 4202 "dk3str.ctr"
if(dk3str_c32_len(n) < sz) {
dk3str_c32_cpy(d,n) ;
back = 1;
@@ -2880,7 +2880,7 @@ dk3str_c32_append_path_app(dk3_c32_t *d, size_t sz, dk3_c32_t const *n, dk3_app_
}
} else {
-#line 4190 "dk3str.ctr"
+#line 4212 "dk3str.ctr"
if(dk3str_c32_len(n) < DK3_SIZEOF(myn,dk3_c32_t)) {
back = 1;
dk3str_c32_cpy(myn,n) ;
@@ -2925,10 +2925,10 @@ dk3str_c32_append_path_app(dk3_c32_t *d, size_t sz, dk3_c32_t const *n, dk3_app_
}
if(back) {
-#line 4233 "dk3str.ctr"
+#line 4255 "dk3str.ctr"
}
-#line 4234 "dk3str.ctr"
+#line 4256 "dk3str.ctr"
return back;
}
@@ -3107,7 +3107,7 @@ dk3str_i_cnv_c8p(void *d, char const *s, dk3_app_t *app, int enc)
size_t i = 0; /* Copy converted characters to destination. */
-#line 4411 "dk3str.ctr"
+#line 4433 "dk3str.ctr"
if(s) {
sptr = s; sl = dk3str_c8_len(s);
if(d) {
@@ -3156,7 +3156,7 @@ dk3str_i_cnv_c8p(void *d, char const *s, dk3_app_t *app, int enc)
if(0 == error) {
if(app) {
-#line 4458 "dk3str.ctr"
+#line 4480 "dk3str.ctr"
/* ERROR: Conversion to UTF-16 failed! */
dk3app_log_i1(app, DK3_LL_ERROR, 116);
}
@@ -3188,7 +3188,7 @@ dk3str_i_cnv_c8p(void *d, char const *s, dk3_app_t *app, int enc)
}
}
-#line 4488 "dk3str.ctr"
+#line 4510 "dk3str.ctr"
return back;
}
@@ -3395,7 +3395,7 @@ dk3str_i_cnv_c8u(void *d, char const *s, dk3_app_t *app, int enc)
size_t sl = 0; /* Remaining source string length. */
-#line 4693 "dk3str.ctr"
+#line 4715 "dk3str.ctr"
if(s) {
/* Initialize variables */
sptr = (unsigned char const *)s; sl = dk3str_c8_len(s);
@@ -3448,7 +3448,7 @@ dk3str_i_cnv_c8u(void *d, char const *s, dk3_app_t *app, int enc)
if(0 == error) {
if(app) {
-#line 4744 "dk3str.ctr"
+#line 4766 "dk3str.ctr"
/* ERROR: Conversion to UTF-16 failed! */
dk3app_log_i1(app, DK3_LL_ERROR, 116);
}
@@ -3503,7 +3503,7 @@ dk3str_i_cnv_c8u(void *d, char const *s, dk3_app_t *app, int enc)
}
}
-#line 4797 "dk3str.ctr"
+#line 4819 "dk3str.ctr"
return back;
}
@@ -3631,12 +3631,12 @@ dk3str_cnvsz_c8u_to_c32_app(char const *s, dk3_app_t *app)
size_t back = 0;
-#line 4923 "dk3str.ctr"
+#line 4945 "dk3str.ctr"
if(s) {
back = dk3str_i_cnv_c8u(NULL, s, app, DK3_ENCODING_UNICODE);
}
-#line 4926 "dk3str.ctr"
+#line 4948 "dk3str.ctr"
return back;
}
@@ -4060,7 +4060,7 @@ dk3str_i_cnv_c32(void *d, dk3_c32_t const *s, dk3_app_t *app, int enc)
size_t i = 0; /* Copy buffer to destination. */
-#line 5348 "dk3str.ctr"
+#line 5370 "dk3str.ctr"
if(s) {
/* Initialize variables */
sptr = s; sl = dk3str_c32_len(s);
@@ -4126,7 +4126,7 @@ dk3str_i_cnv_c32(void *d, dk3_c32_t const *s, dk3_app_t *app, int enc)
if(0 == error) {
if(app) {
-#line 5412 "dk3str.ctr"
+#line 5434 "dk3str.ctr"
/* ERROR: Conversion to UTF-16 failed! */
dk3app_log_i1(app, DK3_LL_ERROR, 116);
}
@@ -4155,7 +4155,7 @@ dk3str_i_cnv_c32(void *d, dk3_c32_t const *s, dk3_app_t *app, int enc)
}
}
-#line 5439 "dk3str.ctr"
+#line 5461 "dk3str.ctr"
return back;
}
@@ -4449,10 +4449,21 @@ dk3str_c8_to_str_simple_app(
int
dk3str_to_c8p_app(
- char *dp, size_t sz, dkChar const *src, int ie, dk3_app_t *app
+ char *dp,
+ size_t sz,
+ dkChar const *src,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(ie),
+#else
+ int ie,
+#endif
+ dk3_app_t *app
)
{
int back = 0;
+#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(ie)
+#endif
if((dp) && (sz) && (src)) {
#if DK3_CHAR_SIZE > 1
#if DK3_CHAR_SIZE > 2
@@ -4478,10 +4489,21 @@ dk3str_to_c8p_app(
int
dk3str_to_c8u_app(
- char *dp, size_t sz, dkChar const *src, int ie, dk3_app_t *app
+ char *dp,
+ size_t sz,
+ dkChar const *src,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(ie),
+#else
+ int ie,
+#endif
+ dk3_app_t *app
)
{
int back = 0;
+#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(ie)
+#endif
if((dp) && (sz) && (src)) {
#if DK3_CHAR_SIZE > 1
#if DK3_CHAR_SIZE > 2
@@ -4510,12 +4532,17 @@ dk3str_str_to_c8u_app(
char *d,
size_t dsz,
dkChar const *s,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(se),
+#else
int se,
+#endif
dk3_app_t *app
)
{
int back = 0;
#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(se)
#if DK3_CHAR_SIZE > 2
back = dk3str_cnv_c32_to_c8u_app(d, dsz, s, app);
#else
@@ -4548,7 +4575,11 @@ int
dk3str_c8u_to_str_app(
dkChar *d,
size_t dsz,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(de),
+#else
int de,
+#endif
char const *s,
dk3_app_t *app
)
@@ -4556,18 +4587,21 @@ dk3str_c8u_to_str_app(
int back = 0;
-#line 5838 "dk3str.ctr"
+#line 5891 "dk3str.ctr"
+#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(de)
+#endif
if((d) && (dsz) && (s)) {
#if DK3_CHAR_SIZE > 1
#if DK3_CHAR_SIZE > 2
-#line 5842 "dk3str.ctr"
+#line 5898 "dk3str.ctr"
back = dk3str_cnv_c8u_to_c32_app(d, dsz, s, app);
#else
-#line 5845 "dk3str.ctr"
+#line 5901 "dk3str.ctr"
back = dk3str_cnv_c8u_to_c16_app(d, dsz, s, app);
#endif
#else
@@ -4575,7 +4609,7 @@ dk3str_c8u_to_str_app(
case DK3_ENCODING_UTF8: {
-#line 5851 "dk3str.ctr"
+#line 5907 "dk3str.ctr"
if(dsz > dk3str_c8_len(s)) {
dk3str_c8_cpy(d, s);
back = 1;
@@ -4589,14 +4623,14 @@ dk3str_c8u_to_str_app(
default: {
-#line 5863 "dk3str.ctr"
+#line 5919 "dk3str.ctr"
back = dk3str_cnv_c8u_to_c8p_app(d, dsz, s, app);
} break;
}
#endif
}
-#line 5868 "dk3str.ctr"
+#line 5924 "dk3str.ctr"
return back;
}
@@ -4608,7 +4642,7 @@ dk3str_to_c8_app(char *dp, size_t szdp, dkChar const *src, dk3_app_t *app)
int back = 0;
-#line 5878 "dk3str.ctr"
+#line 5934 "dk3str.ctr"
if((dp) && (szdp) && (src)) {
#if DK3_CHAR_SIZE > 1
#if DK3_CHAR_SIZE > 2
@@ -4627,7 +4661,7 @@ dk3str_to_c8_app(char *dp, size_t szdp, dkChar const *src, dk3_app_t *app)
#endif
}
-#line 5895 "dk3str.ctr"
+#line 5951 "dk3str.ctr"
return back;
}
diff --git a/support/dktools/dk3str.ctr b/support/dktools/dk3str.ctr
index 063198c42d..425f51f95d 100644
--- a/support/dktools/dk3str.ctr
+++ b/support/dktools/dk3str.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -1425,6 +1425,8 @@ dk3str_to_c8_app(char *dp, size_t szdp, dkChar const *src, dk3_app_t *app);
%% module
#include "dk3all.h"
+#include "dk3unused.h"
+
$!trace-include
@@ -2076,7 +2078,11 @@ dk3str_c8_chr(char const *s, char c)
{
register char *back; /* Function result. */
#if DK3_HAVE_STRCHR
+#ifdef __cplusplus
+ back = (char *)strchr(s, c);
+#else
back = strchr(s, c);
+#endif
#else
register char const *ptr; /* Pointer to traverse s. */
register char chr; /* Register copy of c. */
@@ -2118,7 +2124,11 @@ dk3str_c32_chr(dk3_c32_t const *s, dk3_c32_t c)
{
register dk3_c32_t *back;
#if (DK3_HAVE_WCSCHR) && (DK3_SIZEOF_WCHAR_T == 4)
+#ifdef __cplusplus
+ back = (dk3_c32_t *)wcschr(s, c);
+#else
back = wcschr(s, c);
+#endif
#else
#if (DK3_HAVE__WCSCHR) && (DK3_SIZEOF_WCHAR_T == 4)
back = _wcschr(s, c);
@@ -2157,7 +2167,11 @@ dk3str_c8_rchr(char const *s, char c)
{
register char *back; /* Function result. */
#if DK3_HAVE_STRRCHR
+#ifdef __cplusplus
+ back = (char *)strrchr(s, c);
+#else
back = strrchr(s, c);
+#endif
#else
register char const *ptr; /* Pointer to traverse s. */
register char chr; /* Register copy of c. */
@@ -2202,10 +2216,18 @@ dk3str_c32_rchr(dk3_c32_t const *s, dk3_c32_t c)
{
register dk3_c32_t *back;
#if (DK3_HAVE_WCSRCHR) && (DK3_SIZEOF_WCHAR_T == 4)
+#ifdef __cplusplus
+ back = (dk3_c32_t *)wcsrchr(s, c);
+#else
back = wcsrchr(s, c);
+#endif
#else
#if (DK3_HAVE__WCSRCHR) && (DK3_SIZEOF_WCHAR_T == 4)
+#ifdef __cplusplus
+ back = (dk4_c32_t *)_wcsrchr(s, c);
+#else
back = _wcsrchr(s, c);
+#endif
#else
register dk3_c32_t const *ptr; /* Traverse source string. */
register dk3_c32_t chr; /* Character to search for. */
@@ -5729,10 +5751,21 @@ dk3str_c8_to_str_simple_app(
int
dk3str_to_c8p_app(
- char *dp, size_t sz, dkChar const *src, int ie, dk3_app_t *app
+ char *dp,
+ size_t sz,
+ dkChar const *src,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(ie),
+#else
+ int ie,
+#endif
+ dk3_app_t *app
)
{
int back = 0;
+#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(ie)
+#endif
if((dp) && (sz) && (src)) {
#if DK3_CHAR_SIZE > 1
#if DK3_CHAR_SIZE > 2
@@ -5758,10 +5791,21 @@ dk3str_to_c8p_app(
int
dk3str_to_c8u_app(
- char *dp, size_t sz, dkChar const *src, int ie, dk3_app_t *app
+ char *dp,
+ size_t sz,
+ dkChar const *src,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(ie),
+#else
+ int ie,
+#endif
+ dk3_app_t *app
)
{
int back = 0;
+#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(ie)
+#endif
if((dp) && (sz) && (src)) {
#if DK3_CHAR_SIZE > 1
#if DK3_CHAR_SIZE > 2
@@ -5790,12 +5834,17 @@ dk3str_str_to_c8u_app(
char *d,
size_t dsz,
dkChar const *s,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(se),
+#else
int se,
+#endif
dk3_app_t *app
)
{
int back = 0;
#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(se)
#if DK3_CHAR_SIZE > 2
back = dk3str_cnv_c32_to_c8u_app(d, dsz, s, app);
#else
@@ -5828,13 +5877,20 @@ int
dk3str_c8u_to_str_app(
dkChar *d,
size_t dsz,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(de),
+#else
int de,
+#endif
char const *s,
dk3_app_t *app
)
{
int back = 0;
$? "+ dk3str_c8u_to_str_app"
+#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(de)
+#endif
if((d) && (dsz) && (s)) {
#if DK3_CHAR_SIZE > 1
#if DK3_CHAR_SIZE > 2
diff --git a/support/dktools/dk3str.h b/support/dktools/dk3str.h
index 163cb30738..937ed15bae 100644
--- a/support/dktools/dk3str.h
+++ b/support/dktools/dk3str.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3str.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3str.ctr
*/
/** @file dk3str.h Header file for the dk3str module.
diff --git a/support/dktools/dk3strkv.c b/support/dktools/dk3strkv.c
index 1f89f03519..663cc4970e 100644
--- a/support/dktools/dk3strkv.c
+++ b/support/dktools/dk3strkv.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk3strkv.ctr
@@ -8,235 +14,142 @@
/** @file dk3strkv.c The dk3strkv module.
*/
-/** @defgroup dkct_state_machine_dk3strkv_stm The dk3strkv_stm state machine. */
-/**@{*/
-
-#ifndef ST_DQ_EXPECT
-/** State: Expect double quoted value */
-#line 41 "dk3strkv.ctr"
-#define ST_DQ_EXPECT 0
-#else
-#line 41 "dk3strkv.ctr"
-#error "Redefinition of ST_DQ_EXPECT"
-#endif
-
-#ifndef ST_DQ_VALUE
-/** State: Having double quoted value */
-#line 43 "dk3strkv.ctr"
-#define ST_DQ_VALUE 1
-#else
-#line 43 "dk3strkv.ctr"
-#error "Redefinition of ST_DQ_VALUE"
-#endif
-
-#ifndef ST_ERROR
-/** State: Error occured */
-#line 44 "dk3strkv.ctr"
-#define ST_ERROR 2
-#else
+/** States for state machine dk3strkv_stm.
+*/
+enum {
+ /** State: Expect double quoted value
+ */
#line 44 "dk3strkv.ctr"
-#error "Redefinition of ST_ERROR"
-#endif
+ ST_DQ_EXPECT = 0,
-#ifndef ST_EXPECT
-/** State: Expect value */
-#line 38 "dk3strkv.ctr"
-#define ST_EXPECT 3
-#else
-#line 38 "dk3strkv.ctr"
-#error "Redefinition of ST_EXPECT"
-#endif
+ /** State: Having double quoted value
+ */
+#line 46 "dk3strkv.ctr"
+ ST_DQ_VALUE = 1,
-#ifndef ST_KEY
-/** State: In a key */
-#line 37 "dk3strkv.ctr"
-#define ST_KEY 4
-#else
-#line 37 "dk3strkv.ctr"
-#error "Redefinition of ST_KEY"
-#endif
+ /** State: Error occured
+ */
+#line 47 "dk3strkv.ctr"
+ ST_ERROR = 2,
-#ifndef ST_SQ_EXPECT
-/** State: Expect single quoted value */
-#line 40 "dk3strkv.ctr"
-#define ST_SQ_EXPECT 5
-#else
+ /** State: Expect value
+ */
+#line 41 "dk3strkv.ctr"
+ ST_EXPECT = 3,
+
+ /** State: In a key
+ */
#line 40 "dk3strkv.ctr"
-#error "Redefinition of ST_SQ_EXPECT"
-#endif
+ ST_KEY = 4,
-#ifndef ST_SQ_VALUE
-/** State: Having single quoted value */
-#line 42 "dk3strkv.ctr"
-#define ST_SQ_VALUE 6
-#else
-#line 42 "dk3strkv.ctr"
-#error "Redefinition of ST_SQ_VALUE"
-#endif
+ /** State: Expect single quoted value
+ */
+#line 43 "dk3strkv.ctr"
+ ST_SQ_EXPECT = 5,
-#ifndef ST_START
-/** State: Waiting for anything to happen */
-#line 36 "dk3strkv.ctr"
-#define ST_START 7
-#else
-#line 36 "dk3strkv.ctr"
-#error "Redefinition of ST_START"
-#endif
+ /** State: Having single quoted value
+ */
+#line 45 "dk3strkv.ctr"
+ ST_SQ_VALUE = 6,
-#ifndef ST_VALUE
-/** State: Having value */
-#line 39 "dk3strkv.ctr"
-#define ST_VALUE 8
-#else
+ /** State: Waiting for anything to happen
+ */
#line 39 "dk3strkv.ctr"
-#error "Redefinition of ST_VALUE"
-#endif
-
-#ifndef I_BS
-/** State machine input: Backslash */
-#line 50 "dk3strkv.ctr"
-#define I_BS 0
-#else
-#line 50 "dk3strkv.ctr"
-#error "Redefinition of I_BS"
-#endif
-
-#ifndef I_DQ
-/** State machine input: Double quote */
-#line 49 "dk3strkv.ctr"
-#define I_DQ 1
-#else
-#line 49 "dk3strkv.ctr"
-#error "Redefinition of I_DQ"
-#endif
+ ST_START = 7,
-#ifndef I_EQ
-/** State machine input: Equal sign */
-#line 51 "dk3strkv.ctr"
-#define I_EQ 2
-#else
-#line 51 "dk3strkv.ctr"
-#error "Redefinition of I_EQ"
-#endif
+ /** State: Having value
+ */
+#line 42 "dk3strkv.ctr"
+ ST_VALUE = 8
+};
-#ifndef I_OT
-/** State machine input: Any other character */
-#line 46 "dk3strkv.ctr"
-#define I_OT 3
-#else
-#line 46 "dk3strkv.ctr"
-#error "Redefinition of I_OT"
-#endif
+/** Inputs for state machine dk3strkv_stm.
+*/
+enum {
+ /** State machine input: Backslash
+ */
+#line 53 "dk3strkv.ctr"
+ I_BS = 0,
-#ifndef I_SQ
-/** State machine input: Single quote */
-#line 48 "dk3strkv.ctr"
-#define I_SQ 4
-#else
-#line 48 "dk3strkv.ctr"
-#error "Redefinition of I_SQ"
-#endif
+ /** State machine input: Double quote
+ */
+#line 52 "dk3strkv.ctr"
+ I_DQ = 1,
-#ifndef I_WH
-/** State machine input: White space */
-#line 47 "dk3strkv.ctr"
-#define I_WH 5
-#else
-#line 47 "dk3strkv.ctr"
-#error "Redefinition of I_WH"
-#endif
+ /** State machine input: Equal sign
+ */
+#line 54 "dk3strkv.ctr"
+ I_EQ = 2,
-#ifndef O_ENDCOUNT
-/** State machine output: End key string and count upwards */
-#line 58 "dk3strkv.ctr"
-#define O_ENDCOUNT 0
-#else
-#line 58 "dk3strkv.ctr"
-#error "Redefinition of O_ENDCOUNT"
-#endif
+ /** State machine input: Any other character
+ */
+#line 49 "dk3strkv.ctr"
+ I_OT = 3,
-#ifndef O_ENDKEY
-/** State machine output: End key string (change to finalizer) */
-#line 57 "dk3strkv.ctr"
-#define O_ENDKEY 1
-#else
-#line 57 "dk3strkv.ctr"
-#error "Redefinition of O_ENDKEY"
-#endif
+ /** State machine input: Single quote
+ */
+#line 51 "dk3strkv.ctr"
+ I_SQ = 4,
-#ifndef O_ENDVAL
-/** State machine output: End value string (change to finalizer) */
-#line 59 "dk3strkv.ctr"
-#define O_ENDVAL 2
-#else
-#line 59 "dk3strkv.ctr"
-#error "Redefinition of O_ENDVAL"
-#endif
+ /** State machine input: White space
+ */
+#line 50 "dk3strkv.ctr"
+ I_WH = 5
+};
-#ifndef O_ERROR
-/** State machine output: Error occured */
-#line 53 "dk3strkv.ctr"
-#define O_ERROR 3
-#else
-#line 53 "dk3strkv.ctr"
-#error "Redefinition of O_ERROR"
-#endif
+/** Outputs for state machine dk3strkv_stm.
+*/
+enum {
+ /** State machine output: End key string and count upwards
+ */
+#line 61 "dk3strkv.ctr"
+ O_ENDCOUNT = 0,
-#ifndef O_NO
-/** State machine output: Do nothing */
-#line 54 "dk3strkv.ctr"
-#define O_NO 4
-#else
-#line 54 "dk3strkv.ctr"
-#error "Redefinition of O_NO"
-#endif
+ /** State machine output: End key string (change to finalizer)
+ */
+#line 60 "dk3strkv.ctr"
+ O_ENDKEY = 1,
-#ifndef O_SEVAL
-/** State machine output: Start and end value */
-#line 62 "dk3strkv.ctr"
-#define O_SEVAL 5
-#else
+ /** State machine output: End value string (change to finalizer)
+ */
#line 62 "dk3strkv.ctr"
-#error "Redefinition of O_SEVAL"
-#endif
+ O_ENDVAL = 2,
-#ifndef O_SKEY
-/** State machine output: Start key */
-#line 56 "dk3strkv.ctr"
-#define O_SKEY 6
-#else
+ /** State machine output: Error occured
+ */
#line 56 "dk3strkv.ctr"
-#error "Redefinition of O_SKEY"
-#endif
+ O_ERROR = 3,
-#ifndef O_SQ
-/** State machine output: Squeeze */
-#line 55 "dk3strkv.ctr"
-#define O_SQ 7
-#else
-#line 55 "dk3strkv.ctr"
-#error "Redefinition of O_SQ"
-#endif
+ /** State machine output: Do nothing
+ */
+#line 57 "dk3strkv.ctr"
+ O_NO = 4,
-#ifndef O_SQ_SVAL
-/** State machine output: Squeeze and start value */
-#line 61 "dk3strkv.ctr"
-#define O_SQ_SVAL 8
-#else
-#line 61 "dk3strkv.ctr"
-#error "Redefinition of O_SQ_SVAL"
-#endif
+ /** State machine output: Start and end value
+ */
+#line 65 "dk3strkv.ctr"
+ O_SEVAL = 5,
-#ifndef O_SVAL
-/** State machine output: Start value */
-#line 60 "dk3strkv.ctr"
-#define O_SVAL 9
-#else
-#line 60 "dk3strkv.ctr"
-#error "Redefinition of O_SVAL"
-#endif
+ /** State machine output: Start key
+ */
+#line 59 "dk3strkv.ctr"
+ O_SKEY = 6,
+
+ /** State machine output: Squeeze
+ */
+#line 58 "dk3strkv.ctr"
+ O_SQ = 7,
-/**@}*/
+ /** State machine output: Squeeze and start value
+ */
+#line 64 "dk3strkv.ctr"
+ O_SQ_SVAL = 8,
+
+ /** State machine output: Start value
+ */
+#line 63 "dk3strkv.ctr"
+ O_SVAL = 9
+};
/** Reset dk3strkv_stm state machine.
@param st Pointer to state variable.
@@ -388,7 +301,7 @@ dk3strkv_stm_step(int *st, int in)
}
-#line 100 "dk3strkv.ctr"
+#line 103 "dk3strkv.ctr"
#include "dk3all.h"
@@ -407,7 +320,7 @@ dk3strkv_classify(dkChar c)
int back = I_OT;
-#line 117 "dk3strkv.ctr"
+#line 120 "dk3strkv.ctr"
switch(c) {
case dkT(' '): case dkT('\t'): {
back = I_WH;
@@ -426,7 +339,7 @@ dk3strkv_classify(dkChar c)
} break;
}
-#line 134 "dk3strkv.ctr"
+#line 137 "dk3strkv.ctr"
return back;
}
@@ -505,7 +418,7 @@ dk3str_to_key_value(
int back = 0;
-#line 211 "dk3strkv.ctr"
+#line 214 "dk3strkv.ctr"
if((kvp) && (szp)) {
for(i = 0; i < *szp; i++) { kvp[i].key = NULL; kvp[i].val = NULL; }
}
@@ -518,22 +431,22 @@ dk3str_to_key_value(
while(cc) {
if(*ptr) {
-#line 222 "dk3strkv.ctr"
+#line 225 "dk3strkv.ctr"
icl = dk3strkv_classify(*ptr);
-#line 223 "dk3strkv.ctr"
+#line 226 "dk3strkv.ctr"
act = dk3strkv_stm_step(&stm, icl);
-#line 224 "dk3strkv.ctr"
+#line 227 "dk3strkv.ctr"
switch(act) {
case O_ERROR: {
-#line 226 "dk3strkv.ctr"
+#line 229 "dk3strkv.ctr"
error = 1;
} break;
case O_SQ: {
-#line 229 "dk3strkv.ctr"
+#line 232 "dk3strkv.ctr"
dk3str_cpy(ptr, &(ptr[1]));
if(*ptr) {
charno++;
@@ -545,7 +458,7 @@ dk3str_to_key_value(
} break;
case O_SKEY: {
-#line 239 "dk3strkv.ctr"
+#line 242 "dk3strkv.ctr"
if(i < (*szp)) {
kvp[i].key = ptr;
} else {
@@ -558,24 +471,24 @@ dk3str_to_key_value(
} break;
case O_ENDKEY: {
-#line 250 "dk3strkv.ctr"
+#line 253 "dk3strkv.ctr"
*ptr = dkT('\0');
} break;
case O_ENDCOUNT: {
-#line 253 "dk3strkv.ctr"
+#line 256 "dk3strkv.ctr"
*ptr = dkT('\0');
i++;
} break;
case O_ENDVAL: {
-#line 257 "dk3strkv.ctr"
+#line 260 "dk3strkv.ctr"
*ptr = dkT('\0');
i++;
} break;
case O_SVAL: {
-#line 261 "dk3strkv.ctr"
+#line 264 "dk3strkv.ctr"
if(i < (*szp)) {
kvp[i].val = ptr;
} else {
@@ -588,7 +501,7 @@ dk3str_to_key_value(
} break;
case O_SQ_SVAL: {
-#line 272 "dk3strkv.ctr"
+#line 275 "dk3strkv.ctr"
dk3str_cpy(ptr, &(ptr[1]));
if(*ptr) {
charno++;
@@ -609,7 +522,7 @@ dk3str_to_key_value(
} break;
case O_SEVAL: {
-#line 291 "dk3strkv.ctr"
+#line 294 "dk3strkv.ctr"
*ptr = dkT('\0');
if(i < (*szp)) {
kvp[i].val = ptr;
@@ -632,7 +545,7 @@ dk3str_to_key_value(
switch(stm) {
case ST_START: {
-#line 312 "dk3strkv.ctr"
+#line 315 "dk3strkv.ctr"
if(0 == error) {
back = 1;
*szp = i;
@@ -640,7 +553,7 @@ dk3str_to_key_value(
} break;
case ST_KEY: {
-#line 318 "dk3strkv.ctr"
+#line 321 "dk3strkv.ctr"
if(0 == error) {
i++;
back = 1;
@@ -649,7 +562,7 @@ dk3str_to_key_value(
} break;
case ST_VALUE: {
-#line 325 "dk3strkv.ctr"
+#line 328 "dk3strkv.ctr"
if(0 == error) {
i++;
back = 1;
@@ -666,7 +579,7 @@ dk3str_to_key_value(
}
}
-#line 340 "dk3strkv.ctr"
+#line 343 "dk3strkv.ctr"
return back;
}
diff --git a/support/dktools/dk3strkv.ctr b/support/dktools/dk3strkv.ctr
index 027836fbff..836c590b3c 100644
--- a/support/dktools/dk3strkv.ctr
+++ b/support/dktools/dk3strkv.ctr
@@ -1,4 +1,7 @@
%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/dk3strkv.h b/support/dktools/dk3strkv.h
index 0e1ded43b4..0b215021e3 100644
--- a/support/dktools/dk3strkv.h
+++ b/support/dktools/dk3strkv.h
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk3strkv.ctr
@@ -13,7 +19,7 @@
#define DK3STRKV_H_INCLUDED 1
-#line 4 "dk3strkv.ctr"
+#line 7 "dk3strkv.ctr"
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk3strm.c b/support/dktools/dk3strm.c
index 2e465f5710..f51ca6963e 100644
--- a/support/dktools/dk3strm.c
+++ b/support/dktools/dk3strm.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3strm.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3strm.ctr
*/
/** @file dk3strm.c The dk3strm module.
@@ -2038,12 +2016,12 @@ dk3stream_process_chars(
if(cc) {
#line 2225 "dk3strm.ctr"
- if(c32 != 0x0000FEFFUL) {
+ if(dkC32(0x0000FEFF) != c32) {
#line 2226 "dk3strm.ctr"
switch(myie) {
case DK3_FILE_ENCODING_UTF16_MSB_FIRST: {
- if(c32 == 0x0000FFFEUL) {
+ if(dkC32(0x0000FFFE) == c32) {
#line 2229 "dk3strm.ctr"
myie = DK3_FILE_ENCODING_UTF16_LSB_FIRST;
@@ -2053,7 +2031,7 @@ dk3stream_process_chars(
}
} break;
case DK3_FILE_ENCODING_UTF16_LSB_FIRST: {
- if(c32 == 0x0000FFFEUL) {
+ if(dkC32(0x0000FFFE) == c32) {
#line 2235 "dk3strm.ctr"
myie = DK3_FILE_ENCODING_UTF16_MSB_FIRST;
@@ -2063,7 +2041,7 @@ dk3stream_process_chars(
}
} break;
case DK3_FILE_ENCODING_UNICODE_MSB_FIRST: {
- if((unsigned long)c32 == 0xFFFE0000UL) {
+ if(dkC32(0xFFFE0000) == c32) {
#line 2241 "dk3strm.ctr"
myie = DK3_FILE_ENCODING_UNICODE_LSB_FIRST;
@@ -2073,7 +2051,7 @@ dk3stream_process_chars(
}
} break;
case DK3_FILE_ENCODING_UNICODE_LSB_FIRST: {
- if((unsigned long)c32 == 0xFFFE0000UL) {
+ if(dkC32(0xFFFE0000) == c32) {
#line 2247 "dk3strm.ctr"
myie = DK3_FILE_ENCODING_UNICODE_MSB_FIRST;
@@ -2089,7 +2067,7 @@ dk3stream_process_chars(
res = (*hf)(obj, c32);
if(res < 1) { back = 0; if(res < 0) { cc = 0; } }
}
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
#line 2257 "dk3strm.ctr"
lineno++;
@@ -2238,7 +2216,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = dkT('\0');
lh->cp = cp;
lh->bufus += used;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
/* FLUSH OUTPUT */
(lh->buf)[lh->szbuf - 1] = dkT('\0');
res = (*(lh->hf))(lh->obj, lh->buf);
@@ -2268,7 +2246,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = dkT('\0');
lh->cp = cp;
lh->bufus = used;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
lh->cp = lh->buf;
*(lh->buf) = dkT('\0');
lh->bufus = 0;
@@ -2306,7 +2284,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
lh->bufus += used;
#line 2439 "dk3strm.ctr"
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
#line 2440 "dk3strm.ctr"
/* FLUSH OUTPUT */
@@ -2344,7 +2322,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = '\0';
lh->cp = cp;
lh->bufus = used;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
*(lh->buf) = '\0';
lh->cp = lh->buf;
lh->bufus = 0;
@@ -2364,7 +2342,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
} else {
#line 2485 "dk3strm.ctr"
- if((unsigned long)c32 > 0x000000FFUL) {
+ if(dkC32(0x000000FF) < c32) {
/* Warning: Character out of range. */
if(lh->app) {
dk3app_log_i1(lh->app, DK3_LL_WARNING, 219);
@@ -2378,7 +2356,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = '\0';
lh->cp = cp;
lh->bufus += 1;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
/* FLUSH OUTPUT */
(lh->buf)[lh->szbuf - 1] = dkT('\0');
res = (*(lh->hf))(lh->obj, lh->buf);
@@ -2409,7 +2387,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = '\0';
lh->cp = cp;
lh->bufus = 1;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
*(lh->buf) = '\0';
lh->cp = lh->buf;
lh->bufus = 0;
diff --git a/support/dktools/dk3strm.ctr b/support/dktools/dk3strm.ctr
index 506551f461..aafad0f17f 100644
--- a/support/dktools/dk3strm.ctr
+++ b/support/dktools/dk3strm.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -2070,7 +2070,7 @@ dk3stream_process_chars(
uc1 = (((dk3_c32_t)c2) << 8) & 0x0000FF00UL;
uc2 = ((dk3_c32_t)c1) & 0x000000FFUL;
}
- c32 = (uc1 | uc2); $? ". c32=%08lx", (unsigned long)c32
+ c32 = (uc1 | uc2); $? ". c32=%08lx", dk3enc_uc_to_ul(c32)
#if 0
if((c32 & 0x0000DC00UL) == 0x0000DC00UL)
#else
@@ -2222,38 +2222,38 @@ dk3stream_process_chars(
break;
}
if(cc) { $? ". character found"
- if(c32 != 0x0000FEFFUL) { $? ". not BOM"
+ if(dkC32(0x0000FEFF) != c32) { $? ". not BOM"
switch(myie) {
case DK3_FILE_ENCODING_UTF16_MSB_FIRST: {
- if(c32 == 0x0000FFFEUL) { $? ". BOM inverted"
+ if(dkC32(0x0000FFFE) == c32) { $? ". BOM inverted"
myie = DK3_FILE_ENCODING_UTF16_LSB_FIRST;
done = 1; $? ". myie = %d", myie
}
} break;
case DK3_FILE_ENCODING_UTF16_LSB_FIRST: {
- if(c32 == 0x0000FFFEUL) { $? ". BOM inverted"
+ if(dkC32(0x0000FFFE) == c32) { $? ". BOM inverted"
myie = DK3_FILE_ENCODING_UTF16_MSB_FIRST;
done = 1; $? ". myie = %d", myie
}
} break;
case DK3_FILE_ENCODING_UNICODE_MSB_FIRST: {
- if((unsigned long)c32 == 0xFFFE0000UL) { $? ". BOM inverted"
+ if(dkC32(0xFFFE0000) == c32) { $? ". BOM inverted"
myie = DK3_FILE_ENCODING_UNICODE_LSB_FIRST;
done = 1; $? ". myie = %d", myie
}
} break;
case DK3_FILE_ENCODING_UNICODE_LSB_FIRST: {
- if((unsigned long)c32 == 0xFFFE0000UL) { $? ". BOM inverted"
+ if(dkC32(0xFFFE0000) == c32) { $? ". BOM inverted"
myie = DK3_FILE_ENCODING_UNICODE_MSB_FIRST;
done = 1; $? ". myie = %d", myie
}
} break;
}
- if(!done) { $? ". process character 0x%08lx=%lu (%!8c)", (unsigned long)c32, (unsigned long)c32, (char)c32
+ if(!done) { $? ". process character 0x%08lx=%lu (%!8c)", dk3enc_uc_to_ul(c32), dk3enc_uc_to_ul(c32), (char)c32
res = (*hf)(obj, c32);
if(res < 1) { back = 0; if(res < 0) { cc = 0; } }
}
- if(c32 == 0x0000000AUL) { $? ". new line"
+ if(dkC32(0x0000000A) == c32) { $? ". new line"
lineno++;
/* Set line number */
if(st->app) {
@@ -2382,7 +2382,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = dkT('\0');
lh->cp = cp;
lh->bufus += used;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
/* FLUSH OUTPUT */
(lh->buf)[lh->szbuf - 1] = dkT('\0');
res = (*(lh->hf))(lh->obj, lh->buf);
@@ -2412,7 +2412,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = dkT('\0');
lh->cp = cp;
lh->bufus = used;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
lh->cp = lh->buf;
*(lh->buf) = dkT('\0');
lh->bufus = 0;
@@ -2436,7 +2436,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = '\0';
lh->cp = cp;
lh->bufus += used; $? ". buffer used %u", (unsigned)(lh->bufus)
- if(c32 == 0x0000000AUL) { $? ". newline"
+ if(dkC32(0x0000000A) == c32) { $? ". newline"
/* FLUSH OUTPUT */
(lh->buf)[lh->szbuf - 1] = dkT('\0');
res = (*(lh->hf))(lh->obj, lh->buf);
@@ -2468,7 +2468,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = '\0';
lh->cp = cp;
lh->bufus = used;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
*(lh->buf) = '\0';
lh->cp = lh->buf;
lh->bufus = 0;
@@ -2482,7 +2482,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
}
}
} else { $? ". process plain character"
- if((unsigned long)c32 > 0x000000FFUL) {
+ if(dkC32(0x000000FF) < c32) {
/* Warning: Character out of range. */
if(lh->app) {
dk3app_log_i1(lh->app, DK3_LL_WARNING, 219);
@@ -2496,7 +2496,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = '\0';
lh->cp = cp;
lh->bufus += 1;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
/* FLUSH OUTPUT */
(lh->buf)[lh->szbuf - 1] = dkT('\0');
res = (*(lh->hf))(lh->obj, lh->buf);
@@ -2527,7 +2527,7 @@ dk3stream_add_character_to_line(void *lhv, dk3_c32_t c32)
*cp = '\0';
lh->cp = cp;
lh->bufus = 1;
- if(c32 == 0x0000000AUL) {
+ if(dkC32(0x0000000A) == c32) {
*(lh->buf) = '\0';
lh->cp = lh->buf;
lh->bufus = 0;
diff --git a/support/dktools/dk3strm.h b/support/dktools/dk3strm.h
index 1d1688cdca..0c0c2fb037 100644
--- a/support/dktools/dk3strm.h
+++ b/support/dktools/dk3strm.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3strm.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3strm.ctr
*/
/** @file dk3strm.h Header file for the dk3strm module.
diff --git a/support/dktools/dk3strmb.c b/support/dktools/dk3strmb.c
index 669ea64611..abe9b4b8b8 100644
--- a/support/dktools/dk3strmb.c
+++ b/support/dktools/dk3strmb.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3strmb.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3strmb.ctr
*/
/** @file dk3strmb.c The dk3strmb module.
diff --git a/support/dktools/dk3strmb.ctr b/support/dktools/dk3strmb.ctr
index 4bae0cd06c..38f3cb6b41 100644
--- a/support/dktools/dk3strmb.ctr
+++ b/support/dktools/dk3strmb.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3strmg.c b/support/dktools/dk3strmg.c
index 4258926c1d..315860fb6b 100644
--- a/support/dktools/dk3strmg.c
+++ b/support/dktools/dk3strmg.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3strmg.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3strmg.ctr
*/
/** @file dk3strmg.c The dk3strmg module.
diff --git a/support/dktools/dk3strmg.ctr b/support/dktools/dk3strmg.ctr
index 304991c3c5..4fb3706e75 100644
--- a/support/dktools/dk3strmg.ctr
+++ b/support/dktools/dk3strmg.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk3trace.c b/support/dktools/dk3trace.c
index 6ae5a8112f..598cba42bc 100644
--- a/support/dktools/dk3trace.c
+++ b/support/dktools/dk3trace.c
@@ -1,47 +1,25 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3trace.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3trace.ctr
*/
/** @file dk3trace.c The dk3trace module.
*/
-#line 164 "dk3trace.ctr"
+#line 170 "dk3trace.ctr"
#include "dk4conf.h"
-#ifdef _WIN32
+#if _WIN32
#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
#define WINDOWS_H_INCLUDED 1
@@ -107,7 +85,7 @@ dktrace_init(char const *filename)
{
FILE *x = NULL;
if(filename) {
-#ifdef _WIN32
+#if _WIN32
if (0 != fopen_s(&x, filename, "w")) {
x = NULL;
}
@@ -167,7 +145,7 @@ void
dk3trace_i_time(FILE *f)
/* {{{ */
{
-#ifdef _WIN32
+#if _WIN32
SYSTEMTIME st;
if (NULL != f) {
GetLocalTime(&st);
@@ -212,7 +190,7 @@ dk3trace_i_time(FILE *f)
-#if DK3_ON_WINDOWS
+#if _WIN32
/** Write time to output file.
@param f Output file.
*/
@@ -271,7 +249,7 @@ dktrace_stdout_time(void)
-#if DK3_ON_WINDOWS
+#if _WIN32
void
dktrace_wtime(void)
/* {{{ */
diff --git a/support/dktools/dk3trace.ctr b/support/dktools/dk3trace.ctr
index e0d2ae3968..e44509839e 100644
--- a/support/dktools/dk3trace.ctr
+++ b/support/dktools/dk3trace.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -93,6 +93,12 @@ dktrace_stdout_time(void);
#if DK4_ON_WINDOWS
+
+/** Write time to trace output.
+*/
+void
+dktrace_wtime(void);
+
/** Write time to trace output.
*/
void
@@ -164,7 +170,7 @@ dktrace_stdout_wtime(void);
#include "dk4conf.h"
-#ifdef _WIN32
+#if _WIN32
#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
#define WINDOWS_H_INCLUDED 1
@@ -230,7 +236,7 @@ dktrace_init(char const *filename)
{
FILE *x = NULL;
if(filename) {
-#ifdef _WIN32
+#if _WIN32
if (0 != fopen_s(&x, filename, "w")) {
x = NULL;
}
@@ -290,7 +296,7 @@ void
dk3trace_i_time(FILE *f)
/* {{{ */
{
-#ifdef _WIN32
+#if _WIN32
SYSTEMTIME st;
if (NULL != f) {
GetLocalTime(&st);
@@ -335,7 +341,7 @@ dk3trace_i_time(FILE *f)
-#if DK3_ON_WINDOWS
+#if _WIN32
/** Write time to output file.
@param f Output file.
*/
@@ -394,7 +400,7 @@ dktrace_stdout_time(void)
-#if DK3_ON_WINDOWS
+#if _WIN32
void
dktrace_wtime(void)
/* {{{ */
diff --git a/support/dktools/dk3trace.h b/support/dktools/dk3trace.h
index 4dd6bd2909..3e39f336e8 100644
--- a/support/dktools/dk3trace.h
+++ b/support/dktools/dk3trace.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3trace.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3trace.ctr
*/
/** @file dk3trace.h Header file for the dk3trace module.
@@ -128,6 +106,12 @@ dktrace_stdout_time(void);
#if DK4_ON_WINDOWS
+
+/** Write time to trace output.
+*/
+void
+dktrace_wtime(void);
+
/** Write time to trace output.
*/
void
diff --git a/support/dktools/dk3types.h b/support/dktools/dk3types.h
index 1e2a80816c..230fb345af 100644
--- a/support/dktools/dk3types.h
+++ b/support/dktools/dk3types.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
/** @file dk3types.h Type definitions for the dk3 library.
*/
@@ -37,7 +41,8 @@
#endif
#ifndef DK3_CHAR_SIZE
-#if DK3_ON_WINDOWS && (defined(_UNICODE))
+/* previously: if DK3_ON_WINDOWS && (defined(_UNICODE)) */
+#if _WIN32
/** Specify default character size 16 bit.
*/
#define DK3_CHAR_SIZE 2
@@ -77,8 +82,10 @@ typedef short dk3_i16_t;
*/
#if DK3_SIZEOF_WCHAR_T == 2
typedef wchar_t /*^unsignedintegraltype^*/ dk3_c16_t;
+#define dkC16(x) ((dk3_c16_t)(x ## U))
#else
typedef unsigned short /*^unsignedintegraltype^*/ dk3_c16_t;
+#define dkC16(x) ((dk3_c16_t)(x ## U))
#endif
/** A 32-bit character/unsigned int type (wchar_t on UNIX, not used).
@@ -93,11 +100,14 @@ typedef long dk3_i32_t;
*/
#if DK3_SIZEOF_WCHAR_T == 4
typedef wchar_t /*^unsignedintegraltype^*/ dk3_c32_t;
+#define dkC32(x) ((dk3_c32_t)(x ## U))
#else
#if DK3_SIZEOF_INT >= 4
typedef unsigned /*^unsignedintegraltype^*/ dk3_c32_t;
+#define dkC32(x) ((dk3_c32_t)(x ## U))
#else
typedef unsigned long /*^unsignedintegraltype^*/ dk3_c32_t;
+#define dkC32(x) ((dk3_c32_t)(x ## UL))
#endif
#endif
@@ -106,6 +116,12 @@ typedef unsigned long /*^unsignedintegraltype^*/ dk3_c32_t;
#if DK3_CHAR_SIZE > 1
#if defined(DK3_SIZEOF_WCHAR_T)
#if DK3_CHAR_SIZE == DK3_SIZEOF_WCHAR_T
+
+#ifndef DK3_WMAIN_DEFINED
+#define DK3_WMAIN_DEFINED 1
+int wmain(int argc, wchar_t *argv[]);
+#endif
+
/** Text character type.
*/
typedef wchar_t /*^unsignedintegraltype^*/ dkChar;
diff --git a/support/dktools/dk3uc2l.c b/support/dktools/dk3uc2l.c
index 56236d21c6..9049c6fd30 100644
--- a/support/dktools/dk3uc2l.c
+++ b/support/dktools/dk3uc2l.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3uc2l.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3uc2l.ctr
*/
/** @file dk3uc2l.c The dk3uc2l module.
*/
-#line 162 "dk3uc2l.ctr"
+#line 159 "dk3uc2l.ctr"
/** Enable or disable support for dk3_uc2l_pkg_t.
*/
@@ -46,11 +24,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "dk3maih8.h"
+#include "dk3unused.h"
-#line 173 "dk3uc2l.ctr"
+
+#line 172 "dk3uc2l.ctr"
@@ -83,8 +63,9 @@ NULL
#endif
-
+#if 0
/** Font encoding names, used in error messages.
+ Why unused ?!
*/
static dkChar const * const dk3uc2l_font_encoding_names[] = {
dkT("OT1"),
@@ -93,7 +74,7 @@ dkT("T4"),
dkT("T5"),
NULL
};
-
+#endif
/** Font encoding names written at end of output file.
@@ -814,15 +795,15 @@ dk3uc2l_add_char_to_dir(
#line 854 "dk3uc2l.ctr"
- prange = dk3sto_it_find_like(uptr->i_ran, &chr, 1);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(uptr->i_ran, &chr, 1);
if (NULL == prange) {
- prange = dk3sto_it_find_like(pdir->i_ran, &chr, 1);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(pdir->i_ran, &chr, 1);
if (NULL == prange) {
if ((dk3_c32_t)0UL < chr) {
#line 859 "dk3uc2l.ctr"
tchr = chr - 1;
- prange = dk3sto_it_find_like(pdir->i_ran, &tchr, 1);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(pdir->i_ran,&tchr,1);
if (NULL != prange) {
#line 862 "dk3uc2l.ctr"
@@ -830,50 +811,54 @@ dk3uc2l_add_char_to_dir(
back = 1;
#line 864 "dk3uc2l.ctr"
- if (0xFFFFFFFFUL > (unsigned long)chr) {
+ if (dkC32(0xFFFFFFFF) > chr) {
tchr = chr + (dk3_c32_t)1UL;
- pr2 = dk3sto_it_find_like(pdir->i_ran, &tchr, 1);
+ pr2 = (dk3_uc2lat_range_t *)dk3sto_it_find_like(
+ pdir->i_ran, &tchr, 1
+ );
if (NULL != pr2) {
-#line 868 "dk3uc2l.ctr"
+#line 870 "dk3uc2l.ctr"
tchr = pr2->end;
dk3sto_remove(pdir->s_ran, pr2);
dk3uc2lat_range_delete(pr2);
prange->end = tchr;
-#line 873 "dk3uc2l.ctr"
+#line 875 "dk3uc2l.ctr"
}
}
}
}
if (0 == back) {
-#line 878 "dk3uc2l.ctr"
- if (0xFFFFFFFFUL > (unsigned long)chr) {
+#line 880 "dk3uc2l.ctr"
+ if (dkC32(0xFFFFFFFF) > chr) {
-#line 879 "dk3uc2l.ctr"
+#line 881 "dk3uc2l.ctr"
tchr = chr + (dk3_c32_t)1UL;
- prange = dk3sto_it_find_like(pdir->i_ran, &tchr, 1);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(
+ pdir->i_ran, &tchr, 1
+ );
if (NULL != prange) {
-#line 882 "dk3uc2l.ctr"
+#line 886 "dk3uc2l.ctr"
prange->start = chr;
back = 1;
-#line 884 "dk3uc2l.ctr"
+#line 888 "dk3uc2l.ctr"
}
}
}
if (0 == back) {
-#line 888 "dk3uc2l.ctr"
+#line 892 "dk3uc2l.ctr"
prange = dk3uc2lat_range_new(chr, chr, pdir, app);
if (NULL != prange) {
if (dk3sto_add(pdir->s_ran, prange)) {
back = 1;
-#line 892 "dk3uc2l.ctr"
+#line 896 "dk3uc2l.ctr"
} else {
dk3uc2lat_range_delete(prange);
}
@@ -881,7 +866,7 @@ dk3uc2l_add_char_to_dir(
}
} else {
-#line 898 "dk3uc2l.ctr"
+#line 902 "dk3uc2l.ctr"
/* ERROR: Already found! */
if (0 != dk3ma_um_to_hex_string(cbuf, szcbuf, (dk3_um_t)chr, 8)) {
dk3app_log_i3(uptr->app, DK3_LL_ERROR, 395, 396, cbuf);
@@ -891,7 +876,7 @@ dk3uc2l_add_char_to_dir(
}
} else {
-#line 906 "dk3uc2l.ctr"
+#line 910 "dk3uc2l.ctr"
/* ERROR: Already found ! */
if (0 != dk3ma_um_to_hex_string(cbuf, szcbuf, (dk3_um_t)chr, 8)) {
dk3app_log_i3(uptr->app, DK3_LL_ERROR, 395, 396, cbuf);
@@ -900,7 +885,7 @@ dk3uc2l_add_char_to_dir(
}
}
-#line 913 "dk3uc2l.ctr"
+#line 917 "dk3uc2l.ctr"
return back;
}
@@ -910,8 +895,6 @@ dk3uc2l_add_char_to_dir(
@param uptr Conversion structure to set up.
@param pdir File directory entry to configure.
@param istrm Input stream for file (normal or compressed).
- @param fn Full path name.
- @param sn Short file name.
@param app Application structure for diagnostics, may be NULL.
@return 1 on success, 0 on error.
*/
@@ -921,8 +904,6 @@ dk3uc2l_apply_1(
dk3_uc2lat_t *uptr,
dk3_uc2lat_dir_t *pdir,
dk3_stream_t *istrm,
- const dkChar *fn,
- const dkChar *sn,
dk3_app_t *app
)
{
@@ -969,7 +950,7 @@ dk3uc2l_apply_1(
#line 971 "dk3uc2l.ctr"
dk3sto_it_reset(pdir->i_ran);
do {
- prange = dk3sto_it_next(pdir->i_ran);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_next(pdir->i_ran);
if (NULL != prange) {
#line 975 "dk3uc2l.ctr"
@@ -986,7 +967,7 @@ dk3uc2l_apply_1(
#line 982 "dk3uc2l.ctr"
dk3sto_it_reset(pdir->i_ran);
do {
- prange = dk3sto_it_next(pdir->i_ran);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_next(pdir->i_ran);
if (NULL != prange) {
dk3uc2lat_range_delete(prange);
}
@@ -1047,7 +1028,7 @@ dk3uc2lat_pass_1(
if (NULL != gzf) {
istrm = dk3stream_open_gz_app(gzf, DK3_STREAM_FLAG_READ, app);
if (NULL != istrm) {
- back = dk3uc2l_apply_1(uptr, pdir, istrm, fn, sn, app);
+ back = dk3uc2l_apply_1(uptr, pdir, istrm, app);
(void)dk3stream_close(istrm);
}
gzclose(gzf);
@@ -1066,7 +1047,7 @@ dk3uc2lat_pass_1(
if (NULL != bzf) {
istrm = dk3stream_open_bz2_app(bzf, DK3_STREAM_FLAG_READ, app);
if (NULL != istrm) {
- back = dk3uc2l_apply_1(uptr, pdir, istrm, fn, sn, app);
+ back = dk3uc2l_apply_1(uptr, pdir, istrm, app);
(void)dk3stream_close(istrm);
}
BZ2_bzclose(bzf);
@@ -1084,7 +1065,7 @@ dk3uc2lat_pass_1(
if (NULL != fipo) {
istrm = dk3stream_open_file_app(fipo, DK3_STREAM_FLAG_READ, app);
if (NULL != istrm) {
- back = dk3uc2l_apply_1(uptr, pdir, istrm, fn, sn, app);
+ back = dk3uc2l_apply_1(uptr, pdir, istrm, app);
(void)dk3stream_close(istrm);
}
fclose(fipo);
@@ -1216,7 +1197,9 @@ dk3uc2l_allocate_memory(
if (NULL == prange->f) {
prange->f = dk3_new_app(dk3_font_encoding_t,sz,uptr->app);
if (NULL != prange->f) {
- for(i = 0; i < sz; i++) { (prange->f)[i] = allenc; }
+ for(i = 0; i < sz; i++) {
+ (prange->f)[i] = (dk3_font_encoding_t)allenc;
+ }
} else {
back = 0;
}
@@ -1233,8 +1216,7 @@ void
dk3uc2l_apply_2(
dk3_uc2lat_t *uptr,
dk3_uc2lat_dir_t *pdir,
- dk3_stream_t *istrm,
- const dkChar *filename
+ dk3_stream_t *istrm
)
{
char buf[512]; /* Input line buffer */
@@ -1263,30 +1245,30 @@ dk3uc2l_apply_2(
int encod; /* Encodings selection */
-#line 1250 "dk3uc2l.ctr"
+#line 1251 "dk3uc2l.ctr"
while ((1 == cc) && (1 == dk3stream_c8_fgets(istrm, buf, sizeof(buf)))) {
dk3app_set_source_line(uptr->app, ++lineno);
buf[sizeof(buf) - 1] = '\0';
-#line 1254 "dk3uc2l.ctr"
+#line 1255 "dk3uc2l.ctr"
p1 = dk3str_c8_start(buf, NULL);
if (NULL != p1) {
-#line 1256 "dk3uc2l.ctr"
+#line 1257 "dk3uc2l.ctr"
if ('#' != *p1) {
-#line 1257 "dk3uc2l.ctr"
+#line 1258 "dk3uc2l.ctr"
p2 = dk3str_c8_next(p1, NULL);
if (NULL != p2) {
-#line 1259 "dk3uc2l.ctr"
+#line 1260 "dk3uc2l.ctr"
if (0 != dk3ma_ul_from_c8_hex_string(&chr, p1, NULL)) {
prange =
(dk3_uc2lat_range_t *)dk3sto_it_find_like(pdir->i_ran, &chr, 1);
if (NULL != prange) {
-#line 1263 "dk3uc2l.ctr"
+#line 1264 "dk3uc2l.ctr"
ind = (size_t)(chr - prange->start);
while (NULL != p2) {
p1 = dk3str_c8_next(p2, NULL);
@@ -1300,15 +1282,15 @@ dk3uc2l_apply_2(
p3 = dk3str_c8_start(p3, NULL);
if (NULL != p3) {
-#line 1275 "dk3uc2l.ctr"
+#line 1276 "dk3uc2l.ctr"
action = dk3str_c8_array_abbr(dk3uc2l_kw, p2, '$', 0);
-#line 1277 "dk3uc2l.ctr"
+#line 1278 "dk3uc2l.ctr"
switch (action) {
case 0: { /* both */
-#line 1279 "dk3uc2l.ctr"
+#line 1280 "dk3uc2l.ctr"
if (NULL != prange->a) {
p4 = dk3str_c8_dup_app(p3, uptr->app);
if (NULL != p4) {
@@ -1319,7 +1301,7 @@ dk3uc2l_apply_2(
} break;
case 1: { /* text */
-#line 1288 "dk3uc2l.ctr"
+#line 1289 "dk3uc2l.ctr"
if (NULL != prange->t) {
p4 = dk3str_c8_dup_app(p3, uptr->app);
if (NULL != p4) {
@@ -1330,7 +1312,7 @@ dk3uc2l_apply_2(
} break;
case 2: { /* math */
-#line 1297 "dk3uc2l.ctr"
+#line 1298 "dk3uc2l.ctr"
if (NULL != prange->m) {
p4 = dk3str_c8_dup_app(p3, uptr->app);
if (NULL != p4) {
@@ -1341,7 +1323,7 @@ dk3uc2l_apply_2(
} break;
case 3: { /* encoding */
-#line 1306 "dk3uc2l.ctr"
+#line 1307 "dk3uc2l.ctr"
if (NULL != prange->f) {
isneg = 0; encod = 0;
if ('!' == *p3) {
@@ -1375,12 +1357,12 @@ dk3uc2l_apply_2(
p3 = p4;
}
if (0 != isneg) { encod = (~(encod)); }
- (prange->f)[ind] = encod;
+ (prange->f)[ind] = (dk3_font_encoding_t)encod;
}
} break;
case 4: { /* packages */
-#line 1343 "dk3uc2l.ctr"
+#line 1344 "dk3uc2l.ctr"
#if HAVE_PACKAGES
if (NULL != prange->p) {
nparts = dk3str_c8_explode(parts, 15, p3, ",");
@@ -1420,18 +1402,18 @@ dk3uc2l_apply_2(
} break;
default: {
-#line 1381 "dk3uc2l.ctr"
+#line 1382 "dk3uc2l.ctr"
} break;
}
} else {
-#line 1384 "dk3uc2l.ctr"
+#line 1385 "dk3uc2l.ctr"
/* ERROR: Value missing */
dk3app_log_i1(uptr->app, DK3_LL_DEBUG, 406);
}
} else {
-#line 1388 "dk3uc2l.ctr"
+#line 1389 "dk3uc2l.ctr"
/* ERROR: Syntax, not a key value pair */
dk3app_log_i1(uptr->app, DK3_LL_DEBUG, 406);
}
@@ -1439,7 +1421,7 @@ dk3uc2l_apply_2(
}
} else {
-#line 1394 "dk3uc2l.ctr"
+#line 1395 "dk3uc2l.ctr"
/* BUG or file changed */
}
} else {
@@ -1448,21 +1430,21 @@ dk3uc2l_apply_2(
}
} else {
-#line 1401 "dk3uc2l.ctr"
+#line 1402 "dk3uc2l.ctr"
/* ERROR: Syntax error, missing configuration */
dk3app_log_i1(uptr->app, DK3_LL_ERROR, 401);
}
} else {
-#line 1405 "dk3uc2l.ctr"
+#line 1406 "dk3uc2l.ctr"
}
} else {
-#line 1407 "dk3uc2l.ctr"
+#line 1408 "dk3uc2l.ctr"
}
}
-#line 1409 "dk3uc2l.ctr"
+#line 1410 "dk3uc2l.ctr"
}
@@ -1491,13 +1473,13 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
size_t sz;
-#line 1436 "dk3uc2l.ctr"
+#line 1437 "dk3uc2l.ctr"
sz = dk3str_len(u->dir);
sz += dk3str_len(pdir->sn);
sz += 1;
if (sizeof(fnb) > sz) {
-#line 1440 "dk3uc2l.ctr"
+#line 1441 "dk3uc2l.ctr"
dk3str_cpy(fnb, u->dir);
dk3str_cat(fnb, dk3app_not_localized(20));
dk3str_cat(fnb, pdir->sn);
@@ -1508,18 +1490,18 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
dk3app_set_source_line(u->app, 0UL);
if (0 != dk3uc2l_allocate_memory(u, pdir)) {
-#line 1449 "dk3uc2l.ctr"
+#line 1450 "dk3uc2l.ctr"
fsuf = dk3str_get_suffix(fnb);
switch (dk3str_array_index(dk3uc2l_co_suf, fsuf, fncs)) {
case 0: {
-#line 1452 "dk3uc2l.ctr"
+#line 1453 "dk3uc2l.ctr"
#if DK3_HAVE_ZLIB_H && (DK3_CHAR_SIZE == 1)
gzf = gzopen(fnb, "r");
if (NULL != gzf) {
istrm = dk3stream_open_gz_app(gzf, DK3_STREAM_FLAG_READ, u->app);
if (NULL != istrm) {
- dk3uc2l_apply_2(u, pdir, istrm, fnb);
+ dk3uc2l_apply_2(u, pdir, istrm);
(void)dk3stream_close(istrm);
}
gzclose(gzf);
@@ -1534,13 +1516,13 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
} break;
case 1: {
-#line 1471 "dk3uc2l.ctr"
+#line 1472 "dk3uc2l.ctr"
#if DK3_HAVE_BZLIB_H && (DK3_CHAR_SIZE == 1)
bzf = BZ2_bzopen(fnb, "r");
if (NULL != bzf) {
istrm = dk3stream_open_bz2_app(bzf, DK3_STREAM_FLAG_READ, u->app);
if (NULL != istrm) {
- dk3uc2l_apply_2(u, pdir, istrm, fnb);
+ dk3uc2l_apply_2(u, pdir, istrm);
(void)dk3stream_close(istrm);
}
BZ2_bzclose(bzf);
@@ -1555,12 +1537,12 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
} break;
default: {
-#line 1490 "dk3uc2l.ctr"
+#line 1491 "dk3uc2l.ctr"
fipo = dk3sf_fopen_app(fnb, dkT("r"), u->app);
if (NULL != fipo) {
istrm = dk3stream_open_file_app(fipo, DK3_STREAM_FLAG_READ, u->app);
if (NULL != istrm) {
- dk3uc2l_apply_2(u, pdir, istrm, fnb);
+ dk3uc2l_apply_2(u, pdir, istrm);
(void)dk3stream_close(istrm);
}
fclose(fipo);
@@ -1569,20 +1551,20 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
}
} else {
-#line 1502 "dk3uc2l.ctr"
+#line 1503 "dk3uc2l.ctr"
}
dk3app_set_source_file(u->app, oldsrc);
dk3app_set_source_line(u->app, oldln);
} else {
-#line 1506 "dk3uc2l.ctr"
+#line 1507 "dk3uc2l.ctr"
/* ERROR: Name too long */
dk3app_log_i3(u->app, DK3_LL_ERROR, 65, 66, pdir->sn);
}
pdir->loaded = 0x01;
-#line 1511 "dk3uc2l.ctr"
+#line 1512 "dk3uc2l.ctr"
}
@@ -1596,12 +1578,16 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
*/
static
dk3_uc2lat_t *
-dk3uc2lat_i_open_app(const dkChar *d, int f_desc, int f_utf8, dk3_app_t *app)
+dk3uc2lat_i_open_app(
+ const dkChar *d,
+ int f_utf8,
+ dk3_app_t *app
+)
{
dk3_uc2lat_t *back = NULL;
-#line 1528 "dk3uc2l.ctr"
+#line 1533 "dk3uc2l.ctr"
if (0 != dk3sf_is_dir_app(d, NULL)) {
back = dk3uc2lat_t_new(d, f_utf8, app);
if (NULL != back) {
@@ -1616,14 +1602,14 @@ dk3uc2lat_i_open_app(const dkChar *d, int f_desc, int f_utf8, dk3_app_t *app)
}
-#line 1541 "dk3uc2l.ctr"
+#line 1546 "dk3uc2l.ctr"
return back;
}
dk3_uc2lat_t *
-dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app)
+dk3uc2lat_open_app(dkChar const *d, int f_utf8, dk3_app_t *app)
{
dkChar fnb[DK3_MAX_PATH];
dk3_uc2lat_t *back = NULL;
@@ -1633,15 +1619,15 @@ dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app)
size_t szshd = 0;
-#line 1556 "dk3uc2l.ctr"
+#line 1561 "dk3uc2l.ctr"
if (NULL != d) {
- back = dk3uc2lat_i_open_app(d, f_desc, f_utf8, app);
+ back = dk3uc2lat_i_open_app(d, f_utf8, app);
} else {
if (NULL != app) {
if (dk3app_get_dir_from_pref(app,dk3app_not_localized(48),fnb,szfnb,1))
{
dk3str_correct_filename(fnb);
- back = dk3uc2lat_i_open_app(fnb, f_desc, f_utf8, app);
+ back = dk3uc2lat_i_open_app(fnb, f_utf8, app);
} else
{
shd = dk3app_get_sharedir(app);
@@ -1653,7 +1639,7 @@ dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app)
if (szfnb > (szshd + dk3str_len(dirn))) {
dk3str_cat(fnb, dirn);
dk3str_correct_filename(fnb);
- back = dk3uc2lat_i_open_app(fnb, f_desc, f_utf8, app);
+ back = dk3uc2lat_i_open_app(fnb, f_utf8, app);
} else {
/* ERROR: Directory name too long! */
dk3app_log_i3(app, DK3_LL_ERROR, 64, 66, dirn);
@@ -1670,7 +1656,7 @@ dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app)
}
}
-#line 1591 "dk3uc2l.ctr"
+#line 1596 "dk3uc2l.ctr"
return back;
}
@@ -1686,86 +1672,86 @@ dk3uc2lat_get(dk3_uc2lat_t *u, dk3_c32_t c32, int ismath)
size_t szcbuf = DK3_SIZEOF(cbuf,dkChar);
-#line 1605 "dk3uc2l.ctr"
+#line 1610 "dk3uc2l.ctr"
if (NULL != u) {
if (NULL != u->rca) {
-#line 1607 "dk3uc2l.ctr"
+#line 1612 "dk3uc2l.ctr"
if ((u->rca)->start <= c32) {
-#line 1608 "dk3uc2l.ctr"
+#line 1613 "dk3uc2l.ctr"
if ((u->rca)->end >= c32) {
-#line 1609 "dk3uc2l.ctr"
+#line 1614 "dk3uc2l.ctr"
prange = u->rca;
-#line 1610 "dk3uc2l.ctr"
+#line 1615 "dk3uc2l.ctr"
}
}
}
if (NULL == prange) {
-#line 1614 "dk3uc2l.ctr"
- prange = dk3sto_it_find_like(u->i_ran, &c32, 1);
+#line 1619 "dk3uc2l.ctr"
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(u->i_ran, &c32, 1);
if (NULL != prange) {
-#line 1616 "dk3uc2l.ctr"
+#line 1621 "dk3uc2l.ctr"
u->rca = prange;
if (NULL != prange->p) {
-#line 1618 "dk3uc2l.ctr"
+#line 1623 "dk3uc2l.ctr"
pkgpp = (prange->p)[(size_t)(c32 - prange->start)];
if (NULL != pkgpp) {
while (NULL != *pkgpp) {
(*(pkgpp++))->used = 0x01;
}
-#line 1623 "dk3uc2l.ctr"
+#line 1628 "dk3uc2l.ctr"
}
}
} else {
-#line 1626 "dk3uc2l.ctr"
+#line 1631 "dk3uc2l.ctr"
}
}
if (NULL != prange) {
-#line 1629 "dk3uc2l.ctr"
+#line 1634 "dk3uc2l.ctr"
if (NULL != prange->dir) {
-#line 1630 "dk3uc2l.ctr"
+#line 1635 "dk3uc2l.ctr"
if (0x00 == (prange->dir)->loaded) {
-#line 1631 "dk3uc2l.ctr"
+#line 1636 "dk3uc2l.ctr"
dk3uc2lat_load_file(u, prange->dir);
}
}
if (0 != ismath) {
-#line 1635 "dk3uc2l.ctr"
+#line 1640 "dk3uc2l.ctr"
if (NULL != prange->m) {
-#line 1636 "dk3uc2l.ctr"
+#line 1641 "dk3uc2l.ctr"
back = (prange->m)[(size_t)(c32 - prange->start)];
}
if (NULL == back) {
if (NULL != prange->a) {
-#line 1640 "dk3uc2l.ctr"
+#line 1645 "dk3uc2l.ctr"
back = (prange->a)[(size_t)(c32 - prange->start)];
}
}
} else {
-#line 1644 "dk3uc2l.ctr"
+#line 1649 "dk3uc2l.ctr"
if (NULL != prange->t) {
-#line 1645 "dk3uc2l.ctr"
+#line 1650 "dk3uc2l.ctr"
back = (prange->t)[(size_t)(c32 - prange->start)];
}
if (NULL == back) {
-#line 1648 "dk3uc2l.ctr"
+#line 1653 "dk3uc2l.ctr"
if (NULL != prange->a) {
back = (prange->a)[(size_t)(c32 - prange->start)];
}
@@ -1784,7 +1770,7 @@ dk3uc2lat_get(dk3_uc2lat_t *u, dk3_c32_t c32, int ismath)
}
}
-#line 1665 "dk3uc2l.ctr"
+#line 1670 "dk3uc2l.ctr"
return back;
}
@@ -1817,7 +1803,7 @@ dk3uc2lat_package_next(dk3_uc2lat_t *u)
void
-dk3uc2lat_font_encoding_reset(dk3_uc2lat_t *u)
+dk3uc2lat_font_encoding_reset(void)
{
/* UNUSED */
}
@@ -1825,7 +1811,7 @@ dk3uc2lat_font_encoding_reset(dk3_uc2lat_t *u)
int
-dk3uc2lat_font_encoding_conflict(dk3_uc2lat_t *u)
+dk3uc2lat_font_encoding_conflict(void)
{
int back = 0;
/* UNUSED */
@@ -1894,8 +1880,8 @@ dk3uc2lat_direct(dk3_c32_t c32)
char c; /* 8-bit character version of c32. */
-#line 1773 "dk3uc2l.ctr"
- if((unsigned long)c32 < 128UL) {
+#line 1778 "dk3uc2l.ctr"
+ if(128UL > dk3enc_uc_to_ul(c32)) {
c = (char)c32;
switch(c) {
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g':
@@ -1917,7 +1903,7 @@ dk3uc2lat_direct(dk3_c32_t c32)
}
}
-#line 1794 "dk3uc2l.ctr"
+#line 1799 "dk3uc2l.ctr"
return back;
}
@@ -1982,7 +1968,7 @@ dk3uc2lat_c8_plain_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, char const *t)
char c; /* Current character. */
-#line 1857 "dk3uc2l.ctr"
+#line 1862 "dk3uc2l.ctr"
if((u) && (st) && (t)) {
ptr = t; back = 1;
while(*ptr) {
@@ -1998,7 +1984,7 @@ dk3uc2lat_c8_plain_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, char const *t)
}
-#line 1871 "dk3uc2l.ctr"
+#line 1876 "dk3uc2l.ctr"
return back;
}
@@ -2015,7 +2001,7 @@ dk3uc2lat_c8_utf8_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, char const *t)
dk3_c32_t c32; /* Current character. */
-#line 1886 "dk3uc2l.ctr"
+#line 1891 "dk3uc2l.ctr"
if((u) && (st) && (t)) {
sp = (unsigned char const *)t; sl = dk3str_c8_len(t); back = 1;
while(sl) {
@@ -2048,7 +2034,7 @@ dk3uc2lat_c8_utf8_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, char const *t)
}
-#line 1917 "dk3uc2l.ctr"
+#line 1922 "dk3uc2l.ctr"
return back;
}
@@ -2065,7 +2051,7 @@ dk3uc2lat_c16_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, dk3_c16_t const *t)
dk3_c32_t c32; /* Current output character. */
-#line 1932 "dk3uc2l.ctr"
+#line 1937 "dk3uc2l.ctr"
if((u) && (st) && (t)) {
sp = t; sl = dk3str_c16_len(t); back = 1;
while(sl) {
@@ -2100,7 +2086,7 @@ dk3uc2lat_c16_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, dk3_c16_t const *t)
}
-#line 1965 "dk3uc2l.ctr"
+#line 1970 "dk3uc2l.ctr"
return back;
}
@@ -2114,7 +2100,7 @@ dk3uc2lat_c32_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, dk3_c32_t const *t)
dk3_c32_t const *ptr; /* Current position. */
-#line 1977 "dk3uc2l.ctr"
+#line 1982 "dk3uc2l.ctr"
if((u) && (st) && (t)) {
back = 1;
ptr = t;
@@ -2129,20 +2115,30 @@ dk3uc2lat_c32_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, dk3_c32_t const *t)
}
-#line 1990 "dk3uc2l.ctr"
+#line 1995 "dk3uc2l.ctr"
return back;
}
int
-dk3uc2lat_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, dkChar const *t, int e)
+dk3uc2lat_stputs(
+ dk3_uc2lat_t *u,
+ dk3_stream_t *st,
+ dkChar const *t,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(e)
+#else
+ int e
+#endif
+)
{
int back = 0;
-#line 2000 "dk3uc2l.ctr"
+#line 2014 "dk3uc2l.ctr"
#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(e)
#if DK3_CHAR_SIZE > 2
back = dk3uc2lat_c32_stputs(u, st, t);
#else
@@ -2160,7 +2156,7 @@ dk3uc2lat_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, dkChar const *t, int e)
#endif
-#line 2017 "dk3uc2l.ctr"
+#line 2032 "dk3uc2l.ctr"
return back;
}
@@ -2190,25 +2186,25 @@ dk3uc2lat_final_report(dk3_uc2lat_t *u, dk3_stream_t *st)
if (NULL != pkgp) {
-#line 2045 "dk3uc2l.ctr"
+#line 2060 "dk3uc2l.ctr"
-#line 2046 "dk3uc2l.ctr"
+#line 2061 "dk3uc2l.ctr"
-#line 2047 "dk3uc2l.ctr"
+#line 2062 "dk3uc2l.ctr"
-#line 2048 "dk3uc2l.ctr"
+#line 2063 "dk3uc2l.ctr"
-#line 2049 "dk3uc2l.ctr"
+#line 2064 "dk3uc2l.ctr"
-#line 2050 "dk3uc2l.ctr"
+#line 2065 "dk3uc2l.ctr"
-#line 2051 "dk3uc2l.ctr"
+#line 2066 "dk3uc2l.ctr"
if ((0x00 != pkgp->used) && (NULL != pkgp->name)) {
dk3stream_c8_fputs(st, dk3uc2lat_mm[3]);
dk3stream_c8_fputs(st, pkgp->name);
diff --git a/support/dktools/dk3uc2l.ctr b/support/dktools/dk3uc2l.ctr
index 772373aa4a..11202a1723 100644
--- a/support/dktools/dk3uc2l.ctr
+++ b/support/dktools/dk3uc2l.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -26,13 +26,12 @@ extern "C" {
/** Open LaTeX encoder.
@param d Directory containing the tables.
- @param f_desc Flag: Attempt to load glyph descriptions.
@param f_utf8 Flag: UTF-8 output encoding.
@param app Application structure for diagnostics, may be NULL.
@return Pointer to new encoder on success, NULL on error.
*/
dk3_uc2lat_t *
-dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app);
+dk3uc2lat_open_app(dkChar const *d, int f_utf8, dk3_app_t *app);
/** Close LaTeX encoder.
@param u Encoder to close.
@@ -120,17 +119,15 @@ dk3uc2lat_package_next(dk3_uc2lat_t *u);
#endif
/** Reset font encoding information.
- @param u LaTeX encoder.
*/
void
-dk3uc2lat_font_encoding_reset(dk3_uc2lat_t *u);
+dk3uc2lat_font_encoding_reset(void);
/** Check for font encoding conflicts.
- @param u LaTeX encoder.
@return 1 on conflicts, 0 otherwise (no problems).
*/
int
-dk3uc2lat_font_encoding_conflict(dk3_uc2lat_t *u);
+dk3uc2lat_font_encoding_conflict(void);
/** Report font encoding requirement conflicts.
@param u LaTeX encoder.
@@ -167,6 +164,8 @@ dk3uc2lat_final_report(dk3_uc2lat_t *u, dk3_stream_t *st);
#include "dk3all.h"
#include "dk3maih8.h"
+#include "dk3unused.h"
+
$!trace-include
@@ -202,8 +201,9 @@ NULL
#endif
-
+#if 0
/** Font encoding names, used in error messages.
+ Why unused ?!
*/
static dkChar const * const dk3uc2l_font_encoding_names[] = {
dkT("OT1"),
@@ -212,7 +212,7 @@ dkT("T4"),
dkT("T5"),
NULL
};
-
+#endif
/** Font encoding names written at end of output file.
@@ -313,7 +313,7 @@ dk3uc2lat_range_delete(dk3_uc2lat_range_t *rp)
dkChar const **ptr; /* Release all descriptions. */
dk3_uc2lat_pkg_t ***pkgppp;
size_t i; /* Number of descriptions to release. */
- $? "+ dk3uc2lat_range_delete %lx %lx", (unsigned long)(rp->start), (unsigned long)(rp->end)
+ $? "+ dk3uc2lat_range_delete %lx %lx", dk3enc_uc_to_ul(rp->start), dk3enc_uc_to_ul(rp->end)
if(rp) {
numchar = (size_t)(rp->end - rp->start + 1);
if(numchar > 0) {
@@ -652,7 +652,7 @@ dk3uc2lat_range_new(
dk3_uc2lat_range_t *back = NULL;
char range_text[32]; /* Buffer for number range. */
dkChar dk_range_text[32]; /* Buffer for number range. */
- $? "+ dk3uc2lat_range_new %lx %lx", (unsigned long)(start), (unsigned long)(end)
+ $? "+ dk3uc2lat_range_new %lx %lx", dk3enc_uc_to_ul(start), dk3enc_uc_to_ul(end)
if(dk3app_max_log_level(app) >= DK3_LL_DEBUG) {
sprintf(range_text, "%lx-%lx", (long)start, (long)end);
(void)dk3str_c8_to_str_simple_app(dk_range_text, 32, range_text, app);
@@ -850,37 +850,41 @@ dk3uc2l_add_char_to_dir(
size_t szcbuf = DK3_SIZEOF(cbuf,dkChar);
dk3_c32_t tchr;
int back = 0;
- $? "+ dk3uc2l_add_char_to_dir %lx", (unsigned long)chr
- prange = dk3sto_it_find_like(uptr->i_ran, &chr, 1);
+ $? "+ dk3uc2l_add_char_to_dir %lx", dk3enc_uc_to_ul(chr)
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(uptr->i_ran, &chr, 1);
if (NULL == prange) {
- prange = dk3sto_it_find_like(pdir->i_ran, &chr, 1);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(pdir->i_ran, &chr, 1);
if (NULL == prange) {
if ((dk3_c32_t)0UL < chr) { $? ". try to append"
tchr = chr - 1;
- prange = dk3sto_it_find_like(pdir->i_ran, &tchr, 1);
- if (NULL != prange) { $? ". found %lx-%lx", (unsigned long)(prange->start), (unsigned long)(prange->end)
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(pdir->i_ran,&tchr,1);
+ if (NULL != prange) { $? ". found %lx-%lx", dk3enc_uc_to_ul(prange->start), dk3enc_uc_to_ul(prange->end)
prange->end = chr;
- back = 1; $? ". changed to %lx-%lx", (unsigned long)(prange->start), (unsigned long)(prange->end)
- if (0xFFFFFFFFUL > (unsigned long)chr) {
+ back = 1; $? ". changed to %lx-%lx", dk3enc_uc_to_ul(prange->start), dk3enc_uc_to_ul(prange->end)
+ if (dkC32(0xFFFFFFFF) > chr) {
tchr = chr + (dk3_c32_t)1UL;
- pr2 = dk3sto_it_find_like(pdir->i_ran, &tchr, 1);
- if (NULL != pr2) { $? ". found %lx-%lx", (unsigned long)(pr2->start), (unsigned long)(pr2->end)
+ pr2 = (dk3_uc2lat_range_t *)dk3sto_it_find_like(
+ pdir->i_ran, &tchr, 1
+ );
+ if (NULL != pr2) { $? ". found %lx-%lx", dk3enc_uc_to_ul(pr2->start), dk3enc_uc_to_ul(pr2->end)
tchr = pr2->end;
dk3sto_remove(pdir->s_ran, pr2);
dk3uc2lat_range_delete(pr2);
prange->end = tchr;
- $? ". changed %lx-%lx", (unsigned long)(prange->start), (unsigned long)(prange->end)
+ $? ". changed %lx-%lx", dk3enc_uc_to_ul(prange->start), dk3enc_uc_to_ul(prange->end)
}
}
}
}
if (0 == back) { $? ". try to prepend"
- if (0xFFFFFFFFUL > (unsigned long)chr) { $? ". can"
+ if (dkC32(0xFFFFFFFF) > chr) { $? ". can"
tchr = chr + (dk3_c32_t)1UL;
- prange = dk3sto_it_find_like(pdir->i_ran, &tchr, 1);
- if (NULL != prange) { $? ". found %lx-%lx", (unsigned long)(prange->start), (unsigned long)(prange->end)
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(
+ pdir->i_ran, &tchr, 1
+ );
+ if (NULL != prange) { $? ". found %lx-%lx", dk3enc_uc_to_ul(prange->start), dk3enc_uc_to_ul(prange->end)
prange->start = chr;
- back = 1; $? ". changed to %lx-%lx", (unsigned long)(prange->start), (unsigned long)(prange->end)
+ back = 1; $? ". changed to %lx-%lx", dk3enc_uc_to_ul(prange->start), dk3enc_uc_to_ul(prange->end)
}
}
}
@@ -888,7 +892,7 @@ dk3uc2l_add_char_to_dir(
prange = dk3uc2lat_range_new(chr, chr, pdir, app);
if (NULL != prange) {
if (dk3sto_add(pdir->s_ran, prange)) {
- back = 1; $? ". added %lx-%lx", (unsigned long)(prange->start), (unsigned long)(prange->end)
+ back = 1; $? ". added %lx-%lx", dk3enc_uc_to_ul(prange->start), dk3enc_uc_to_ul(prange->end)
} else {
dk3uc2lat_range_delete(prange);
}
@@ -919,8 +923,6 @@ dk3uc2l_add_char_to_dir(
@param uptr Conversion structure to set up.
@param pdir File directory entry to configure.
@param istrm Input stream for file (normal or compressed).
- @param fn Full path name.
- @param sn Short file name.
@param app Application structure for diagnostics, may be NULL.
@return 1 on success, 0 on error.
*/
@@ -930,8 +932,6 @@ dk3uc2l_apply_1(
dk3_uc2lat_t *uptr,
dk3_uc2lat_dir_t *pdir,
dk3_stream_t *istrm,
- const dkChar *fn,
- const dkChar *sn,
dk3_app_t *app
)
{
@@ -970,8 +970,8 @@ dk3uc2l_apply_1(
if (1 == back) { $? ". copying ranges to global container"
dk3sto_it_reset(pdir->i_ran);
do {
- prange = dk3sto_it_next(pdir->i_ran);
- if (NULL != prange) { $? ". range %lx-%lx", (unsigned long)(prange->start), (unsigned long)(prange->end)
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_next(pdir->i_ran);
+ if (NULL != prange) { $? ". range %lx-%lx", dk3enc_uc_to_ul(prange->start), dk3enc_uc_to_ul(prange->end)
if (0 == dk3sto_add(uptr->s_ran, prange)) {
dk3uc2lat_range_delete(prange);
back = 0; $? "! failed to copy range"
@@ -981,7 +981,7 @@ dk3uc2l_apply_1(
} else { $? "! deleting ranges due to error"
dk3sto_it_reset(pdir->i_ran);
do {
- prange = dk3sto_it_next(pdir->i_ran);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_next(pdir->i_ran);
if (NULL != prange) {
dk3uc2lat_range_delete(prange);
}
@@ -1038,7 +1038,7 @@ dk3uc2lat_pass_1(
if (NULL != gzf) {
istrm = dk3stream_open_gz_app(gzf, DK3_STREAM_FLAG_READ, app);
if (NULL != istrm) {
- back = dk3uc2l_apply_1(uptr, pdir, istrm, fn, sn, app);
+ back = dk3uc2l_apply_1(uptr, pdir, istrm, app);
(void)dk3stream_close(istrm);
}
gzclose(gzf);
@@ -1057,7 +1057,7 @@ dk3uc2lat_pass_1(
if (NULL != bzf) {
istrm = dk3stream_open_bz2_app(bzf, DK3_STREAM_FLAG_READ, app);
if (NULL != istrm) {
- back = dk3uc2l_apply_1(uptr, pdir, istrm, fn, sn, app);
+ back = dk3uc2l_apply_1(uptr, pdir, istrm, app);
(void)dk3stream_close(istrm);
}
BZ2_bzclose(bzf);
@@ -1075,7 +1075,7 @@ dk3uc2lat_pass_1(
if (NULL != fipo) {
istrm = dk3stream_open_file_app(fipo, DK3_STREAM_FLAG_READ, app);
if (NULL != istrm) {
- back = dk3uc2l_apply_1(uptr, pdir, istrm, fn, sn, app);
+ back = dk3uc2l_apply_1(uptr, pdir, istrm, app);
(void)dk3stream_close(istrm);
}
fclose(fipo);
@@ -1201,7 +1201,9 @@ dk3uc2l_allocate_memory(
if (NULL == prange->f) {
prange->f = dk3_new_app(dk3_font_encoding_t,sz,uptr->app);
if (NULL != prange->f) {
- for(i = 0; i < sz; i++) { (prange->f)[i] = allenc; }
+ for(i = 0; i < sz; i++) {
+ (prange->f)[i] = (dk3_font_encoding_t)allenc;
+ }
} else {
back = 0;
}
@@ -1218,8 +1220,7 @@ void
dk3uc2l_apply_2(
dk3_uc2lat_t *uptr,
dk3_uc2lat_dir_t *pdir,
- dk3_stream_t *istrm,
- const dkChar *filename
+ dk3_stream_t *istrm
)
{
char buf[512]; /* Input line buffer */
@@ -1336,7 +1337,7 @@ dk3uc2l_apply_2(
p3 = p4;
}
if (0 != isneg) { encod = (~(encod)); }
- (prange->f)[ind] = encod;
+ (prange->f)[ind] = (dk3_font_encoding_t)encod;
}
} break;
case 4: { /* packages */ $? ". packages"
@@ -1454,7 +1455,7 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
if (NULL != gzf) {
istrm = dk3stream_open_gz_app(gzf, DK3_STREAM_FLAG_READ, u->app);
if (NULL != istrm) {
- dk3uc2l_apply_2(u, pdir, istrm, fnb);
+ dk3uc2l_apply_2(u, pdir, istrm);
(void)dk3stream_close(istrm);
}
gzclose(gzf);
@@ -1473,7 +1474,7 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
if (NULL != bzf) {
istrm = dk3stream_open_bz2_app(bzf, DK3_STREAM_FLAG_READ, u->app);
if (NULL != istrm) {
- dk3uc2l_apply_2(u, pdir, istrm, fnb);
+ dk3uc2l_apply_2(u, pdir, istrm);
(void)dk3stream_close(istrm);
}
BZ2_bzclose(bzf);
@@ -1491,7 +1492,7 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
if (NULL != fipo) {
istrm = dk3stream_open_file_app(fipo, DK3_STREAM_FLAG_READ, u->app);
if (NULL != istrm) {
- dk3uc2l_apply_2(u, pdir, istrm, fnb);
+ dk3uc2l_apply_2(u, pdir, istrm);
(void)dk3stream_close(istrm);
}
fclose(fipo);
@@ -1521,7 +1522,11 @@ dk3uc2lat_load_file(dk3_uc2lat_t *u, dk3_uc2lat_dir_t *pdir)
*/
static
dk3_uc2lat_t *
-dk3uc2lat_i_open_app(const dkChar *d, int f_desc, int f_utf8, dk3_app_t *app)
+dk3uc2lat_i_open_app(
+ const dkChar *d,
+ int f_utf8,
+ dk3_app_t *app
+)
{
dk3_uc2lat_t *back = NULL;
$? "+ dk3uc2lat_i_open_app %!ds", d
@@ -1544,7 +1549,7 @@ dk3uc2lat_i_open_app(const dkChar *d, int f_desc, int f_utf8, dk3_app_t *app)
dk3_uc2lat_t *
-dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app)
+dk3uc2lat_open_app(dkChar const *d, int f_utf8, dk3_app_t *app)
{
dkChar fnb[DK3_MAX_PATH];
dk3_uc2lat_t *back = NULL;
@@ -1554,13 +1559,13 @@ dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app)
size_t szshd = 0;
$? "+ dk3uc2lat_open_app %!ds", TR_DKSTR(d)
if (NULL != d) {
- back = dk3uc2lat_i_open_app(d, f_desc, f_utf8, app);
+ back = dk3uc2lat_i_open_app(d, f_utf8, app);
} else {
if (NULL != app) {
if (dk3app_get_dir_from_pref(app,dk3app_not_localized(48),fnb,szfnb,1))
{
dk3str_correct_filename(fnb);
- back = dk3uc2lat_i_open_app(fnb, f_desc, f_utf8, app);
+ back = dk3uc2lat_i_open_app(fnb, f_utf8, app);
} else
{
shd = dk3app_get_sharedir(app);
@@ -1572,7 +1577,7 @@ dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app)
if (szfnb > (szshd + dk3str_len(dirn))) {
dk3str_cat(fnb, dirn);
dk3str_correct_filename(fnb);
- back = dk3uc2lat_i_open_app(fnb, f_desc, f_utf8, app);
+ back = dk3uc2lat_i_open_app(fnb, f_utf8, app);
} else {
/* ERROR: Directory name too long! */
dk3app_log_i3(app, DK3_LL_ERROR, 64, 66, dirn);
@@ -1611,7 +1616,7 @@ dk3uc2lat_get(dk3_uc2lat_t *u, dk3_c32_t c32, int ismath)
}
}
if (NULL == prange) { $? ". find character"
- prange = dk3sto_it_find_like(u->i_ran, &c32, 1);
+ prange = (dk3_uc2lat_range_t *)dk3sto_it_find_like(u->i_ran, &c32, 1);
if (NULL != prange) { $? ". range found"
u->rca = prange;
if (NULL != prange->p) { $? ". range->package"
@@ -1694,7 +1699,7 @@ dk3uc2lat_package_next(dk3_uc2lat_t *u)
void
-dk3uc2lat_font_encoding_reset(dk3_uc2lat_t *u)
+dk3uc2lat_font_encoding_reset(void)
{
/* UNUSED */
}
@@ -1702,7 +1707,7 @@ dk3uc2lat_font_encoding_reset(dk3_uc2lat_t *u)
int
-dk3uc2lat_font_encoding_conflict(dk3_uc2lat_t *u)
+dk3uc2lat_font_encoding_conflict(void)
{
int back = 0;
/* UNUSED */
@@ -1769,8 +1774,8 @@ dk3uc2lat_direct(dk3_c32_t c32)
{
int back = 0;
char c; /* 8-bit character version of c32. */
- $? "+ dk3uc2lat_direct %lx", (unsigned long)c32
- if((unsigned long)c32 < 128UL) {
+ $? "+ dk3uc2lat_direct %lx", dk3enc_uc_to_ul(c32)
+ if(128UL > dk3enc_uc_to_ul(c32)) {
c = (char)c32;
switch(c) {
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g':
@@ -1993,11 +1998,21 @@ dk3uc2lat_c32_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, dk3_c32_t const *t)
int
-dk3uc2lat_stputs(dk3_uc2lat_t *u, dk3_stream_t *st, dkChar const *t, int e)
+dk3uc2lat_stputs(
+ dk3_uc2lat_t *u,
+ dk3_stream_t *st,
+ dkChar const *t,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(e)
+#else
+ int e
+#endif
+)
{
int back = 0;
$? "+ dk3uc2lat_stputs \"%!ds\"", TR_STR(t)
#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(e)
#if DK3_CHAR_SIZE > 2
back = dk3uc2lat_c32_stputs(u, st, t);
#else
diff --git a/support/dktools/dk3uc2l.h b/support/dktools/dk3uc2l.h
index 2331e88d66..455dc88a3f 100644
--- a/support/dktools/dk3uc2l.h
+++ b/support/dktools/dk3uc2l.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3uc2l.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3uc2l.ctr
*/
#ifndef DK3UC2L_H_INCLUDED
@@ -58,13 +36,12 @@ extern "C" {
/** Open LaTeX encoder.
@param d Directory containing the tables.
- @param f_desc Flag: Attempt to load glyph descriptions.
@param f_utf8 Flag: UTF-8 output encoding.
@param app Application structure for diagnostics, may be NULL.
@return Pointer to new encoder on success, NULL on error.
*/
dk3_uc2lat_t *
-dk3uc2lat_open_app(dkChar const *d, int f_desc, int f_utf8, dk3_app_t *app);
+dk3uc2lat_open_app(dkChar const *d, int f_utf8, dk3_app_t *app);
/** Close LaTeX encoder.
@param u Encoder to close.
@@ -152,17 +129,15 @@ dk3uc2lat_package_next(dk3_uc2lat_t *u);
#endif
/** Reset font encoding information.
- @param u LaTeX encoder.
*/
void
-dk3uc2lat_font_encoding_reset(dk3_uc2lat_t *u);
+dk3uc2lat_font_encoding_reset(void);
/** Check for font encoding conflicts.
- @param u LaTeX encoder.
@return 1 on conflicts, 0 otherwise (no problems).
*/
int
-dk3uc2lat_font_encoding_conflict(dk3_uc2lat_t *u);
+dk3uc2lat_font_encoding_conflict(void);
/** Report font encoding requirement conflicts.
@param u LaTeX encoder.
diff --git a/support/dktools/dk3ufi.c b/support/dktools/dk3ufi.c
index 9ece4051a9..f519efb448 100644
--- a/support/dktools/dk3ufi.c
+++ b/support/dktools/dk3ufi.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3ufi.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3ufi.ctr
*/
/** @file dk3ufi.c The dk3ufi module.
@@ -41,12 +19,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "dk3ufi.h"
+#include "dk3unused.h"
-#line 89 "dk3ufi.ctr"
+#line 90 "dk3ufi.ctr"
@@ -64,7 +43,7 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
int back = 0;
-#line 105 "dk3ufi.ctr"
+#line 106 "dk3ufi.ctr"
if((pd) && (fn)) {
if(dk3sf_stat_app(&stb, fn, app)) {
switch(stb.ft & (~(DK3_FT_SYMLINK))) {
@@ -77,7 +56,7 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
#if DK3_CHAR_SIZE > 1
-#line 116 "dk3ufi.ctr"
+#line 117 "dk3ufi.ctr"
hFile = CreateFileW(
fn,
((0 == i) ? (FILE_READ_ATTRIBUTES) : 0),
@@ -90,7 +69,7 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
#else
-#line 127 "dk3ufi.ctr"
+#line 128 "dk3ufi.ctr"
hFile = CreateFileA(
fn,
((0 == i) ? (FILE_READ_ATTRIBUTES) : 0),
@@ -106,7 +85,7 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
if(GetFileInformationByHandle(hFile, &bhfi)) {
back = 1;
-#line 141 "dk3ufi.ctr"
+#line 142 "dk3ufi.ctr"
i = 2;
pd->volser = bhfi.dwVolumeSerialNumber;
pd->indhigh = bhfi.nFileIndexHigh;
@@ -129,7 +108,7 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
} break;
case DK3_FT_DIRECTORY: {
-#line 162 "dk3ufi.ctr"
+#line 163 "dk3ufi.ctr"
#if DK3_ON_WINDOWS
for(i = 0; ((i < 2) && (0 == back)); i++) {
#if DK3_CHAR_SIZE > 2
@@ -138,7 +117,7 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
#if DK3_CHAR_SIZE > 1
-#line 169 "dk3ufi.ctr"
+#line 170 "dk3ufi.ctr"
hFile = CreateFileW(
fn,
((0 == i) ? (FILE_READ_ATTRIBUTES) : 0),
@@ -151,7 +130,7 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
#else
-#line 180 "dk3ufi.ctr"
+#line 181 "dk3ufi.ctr"
hFile = CreateFileA(
fn,
((0 == i) ? (FILE_READ_ATTRIBUTES) : 0),
@@ -167,21 +146,21 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
if(GetFileInformationByHandle(hFile, &bhfi)) {
back = 1;
-#line 194 "dk3ufi.ctr"
+#line 195 "dk3ufi.ctr"
i = 2;
pd->volser = bhfi.dwVolumeSerialNumber;
pd->indhigh = bhfi.nFileIndexHigh;
pd->indlow = bhfi.nFileIndexLow;
} else {
-#line 199 "dk3ufi.ctr"
+#line 200 "dk3ufi.ctr"
/* ERROR: Failed to obtain file information! */
dk3app_log_i3(app, DK3_LL_ERROR, 366, 367, fn);
}
CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE;
} else {
-#line 204 "dk3ufi.ctr"
+#line 205 "dk3ufi.ctr"
/* ERROR: Failed to obtain file information */
dk3app_log_i3(app, DK3_LL_ERROR, 366, 367, fn);
}
@@ -194,19 +173,19 @@ dk3ufi_get_app(dk3_ufi_t *pd, dkChar const *fn, dk3_app_t *app)
} break;
default: {
-#line 215 "dk3ufi.ctr"
+#line 216 "dk3ufi.ctr"
} break;
}
} else {
-#line 218 "dk3ufi.ctr"
+#line 219 "dk3ufi.ctr"
}
} else {
-#line 220 "dk3ufi.ctr"
+#line 221 "dk3ufi.ctr"
}
-#line 221 "dk3ufi.ctr"
+#line 222 "dk3ufi.ctr"
return back;
}
@@ -226,7 +205,7 @@ dk3ufi_c8_get_app(dk3_ufi_t *pd, char const *fn, dk3_app_t *app)
int back = 0;
-#line 239 "dk3ufi.ctr"
+#line 240 "dk3ufi.ctr"
if((pd) && (fn)) {
if(dk3sf_c8_stat_app(&stb, fn, app)) {
switch(stb.ft & (~(DK3_FT_SYMLINK))) {
@@ -235,7 +214,7 @@ dk3ufi_c8_get_app(dk3_ufi_t *pd, char const *fn, dk3_app_t *app)
for(i = 0; ((i < 2) && (0 == back)); i++) {
-#line 246 "dk3ufi.ctr"
+#line 247 "dk3ufi.ctr"
hFile = CreateFileA(
fn,
((0 == i) ? (FILE_READ_ATTRIBUTES) : 0),
@@ -249,7 +228,7 @@ dk3ufi_c8_get_app(dk3_ufi_t *pd, char const *fn, dk3_app_t *app)
if(GetFileInformationByHandle(hFile, &bhfi)) {
back = 1;
-#line 258 "dk3ufi.ctr"
+#line 259 "dk3ufi.ctr"
i = 2;
pd->volser = bhfi.dwVolumeSerialNumber;
pd->indhigh = bhfi.nFileIndexHigh;
@@ -280,12 +259,12 @@ dk3ufi_c8_get_app(dk3_ufi_t *pd, char const *fn, dk3_app_t *app)
} break;
case DK3_FT_DIRECTORY: {
-#line 287 "dk3ufi.ctr"
+#line 288 "dk3ufi.ctr"
#if DK3_ON_WINDOWS
for(i = 0; ((i < 2) && (0 == back)); i++) {
-#line 290 "dk3ufi.ctr"
+#line 291 "dk3ufi.ctr"
hFile = CreateFileA(
fn,
((0 == i) ? (FILE_READ_ATTRIBUTES) : 0),
@@ -299,14 +278,14 @@ dk3ufi_c8_get_app(dk3_ufi_t *pd, char const *fn, dk3_app_t *app)
if(GetFileInformationByHandle(hFile, &bhfi)) {
back = 1;
-#line 302 "dk3ufi.ctr"
+#line 303 "dk3ufi.ctr"
i = 2;
pd->volser = bhfi.dwVolumeSerialNumber;
pd->indhigh = bhfi.nFileIndexHigh;
pd->indlow = bhfi.nFileIndexLow;
} else {
-#line 307 "dk3ufi.ctr"
+#line 308 "dk3ufi.ctr"
/* ERROR: Failed to obtain file information! */
#if DK3_CHAR_SIZE == 1
dk3app_log_i3(app, DK3_LL_ERROR, 366, 367, fn);
@@ -317,7 +296,7 @@ dk3ufi_c8_get_app(dk3_ufi_t *pd, char const *fn, dk3_app_t *app)
CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE;
} else {
-#line 316 "dk3ufi.ctr"
+#line 317 "dk3ufi.ctr"
/* ERROR: Failed to obtain file information! */
#if DK3_CHAR_SIZE == 1
dk3app_log_i3(app, DK3_LL_ERROR, 366, 367, fn);
@@ -334,22 +313,22 @@ dk3ufi_c8_get_app(dk3_ufi_t *pd, char const *fn, dk3_app_t *app)
} break;
default: {
-#line 331 "dk3ufi.ctr"
+#line 332 "dk3ufi.ctr"
} break;
}
} else {
-#line 334 "dk3ufi.ctr"
+#line 335 "dk3ufi.ctr"
}
} else {
-#line 336 "dk3ufi.ctr"
+#line 337 "dk3ufi.ctr"
}
-#line 337 "dk3ufi.ctr"
+#line 338 "dk3ufi.ctr"
-#line 338 "dk3ufi.ctr"
+#line 339 "dk3ufi.ctr"
return back;
}
@@ -376,11 +355,13 @@ dk3ufi_c8_get(dk3_ufi_t *pd, char const *fn)
int
-dk3ufi_compare(void const *l, void const *r, int cr)
+dk3ufi_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
dk3_ufi_t const *pl;
dk3_ufi_t const *pr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3_ufi_t const *)l; pr = (dk3_ufi_t const *)r;
diff --git a/support/dktools/dk3ufi.ctr b/support/dktools/dk3ufi.ctr
index fad652192e..9c52530af1 100644
--- a/support/dktools/dk3ufi.ctr
+++ b/support/dktools/dk3ufi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -82,6 +82,7 @@ dk3ufi_compare(void const *l, void const *r, int cr);
#include "dk3all.h"
#include "dk3ufi.h"
+#include "dk3unused.h"
@@ -361,11 +362,13 @@ dk3ufi_c8_get(dk3_ufi_t *pd, char const *fn)
int
-dk3ufi_compare(void const *l, void const *r, int cr)
+dk3ufi_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
dk3_ufi_t const *pl;
dk3_ufi_t const *pr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dk3_ufi_t const *)l; pr = (dk3_ufi_t const *)r;
diff --git a/support/dktools/dk3ufi.h b/support/dktools/dk3ufi.h
index 527914391d..85be0624ef 100644
--- a/support/dktools/dk3ufi.h
+++ b/support/dktools/dk3ufi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3ufi.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3ufi.ctr
*/
/** @file dk3ufi.h Header file for the dk3ufi module.
diff --git a/support/dktools/dk3unused.h b/support/dktools/dk3unused.h
new file mode 100644
index 0000000000..5dcd847047
--- /dev/null
+++ b/support/dktools/dk3unused.h
@@ -0,0 +1,116 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef DK3UNUSED_H_INCLUDED
+
+/** Protection against multiple inclusions.
+*/
+#define DK3UNUSED_H_INCLUDED 1
+
+/*
+ Unused arguments can occur in callback functions which
+ must follow a given prototype.
+ ------------------------------------------------------
+*/
+#if __GNUC__
+/** Mark function argument x as intentionally unused.
+*/
+#define DK3_ARG_UNUSED(x) x __attribute__((unused))
+#else
+#if __clang__
+/** Mark function argument x as intentionally unused.
+*/
+#define DK3_ARG_UNUSED(x) x __attribute__((unused))
+#else
+#if 1
+/** Mark function argument x as intentionally unused.
+*/
+#define DK3_ARG_UNUSED(x) x
+#else
+/** Mark function argument x as intentionally unused.
+*/
+#define DK3_ARG_UNUSED(x) x
+#endif
+#endif
+#endif
+
+/*
+ For some functions I used an equal style prototype.
+ There is no need for the unused arguments in the prototype.
+ Removing the unused arguments from the function declaration would mean
+ removing the appropriate arguments from all function calls.
+ The involved arguments are typically items in lists of same type arguments.
+ Accidently removing a wrong argument from the call would not result in
+ compiler warnings, so there would be a high risk of introducing
+ new bugs.
+ ---------------------------------------------------------------------------
+*/
+#if __GNUC__
+/** Mark function argument x as intentionally unused.
+*/
+#define DK3_SILENCE_ARG_UNUSED(x) x __attribute__((unused))
+#else
+#if __clang__
+/** Mark function argument x as intentionally unused.
+*/
+#define DK3_SILENCE_ARG_UNUSED(x) x __attribute__((unused))
+#else
+#if 1
+/** Mark function argument x as intentionally unused.
+*/
+#define DK3_SILENCE_ARG_UNUSED(x) x
+#else
+/** Mark function argument x as intentionally unused.
+*/
+#define DK3_SILENCE_ARG_UNUSED(x) x
+#endif
+#endif
+#endif
+
+
+#if __GNUC__
+/** Mark variable x as intentionally unused.
+*/
+#define DK3_VAR_UNUSED(x) x __attribute__((unused))
+#else
+#if __clang__
+/** Mark variable x as intentionally unused.
+*/
+#define DK3_VAR_UNUSED(x) x __attribute__((unused))
+#else
+#if defined(_MSC_VER) && (_MSC_VER >= 1700)
+#define DK3_VAR_UNUSED(x) __pragma(warning(suppress: 4100)) x
+#else
+#if 1
+/** Mark variable x as intentionally unused.
+*/
+#define DK3_VAR_UNUSED(x) x
+#else
+/** Mark variable x as intentionally unused.
+*/
+#define DK3_VAR_UNUSED(x) x
+#endif
+#endif
+#endif
+#endif
+
+#if (__GNUC__) || (__clang__)
+/** Do anything with unused arguments to suppress compiler warnings.
+*/
+#define DK3_UNUSED_ARG(x)
+#else
+/** Do anything with unused arguments to suppress compiler warnings.
+*/
+#if (_WIN32) && defined(_MSC_VER)
+/* define DK3_UNUSED_ARG(x) UNREFERENCED_PARAMETER(x); */
+#define DK3_UNUSED_ARG(x) (void)(x);
+#else
+#define DK3_UNUSED_ARG(x) (void)(x);
+#endif
+#endif
+
+
+
+#endif
diff --git a/support/dktools/dk3use.ctr b/support/dktools/dk3use.ctr
new file mode 100644
index 0000000000..441afe1fe8
--- /dev/null
+++ b/support/dktools/dk3use.ctr
@@ -0,0 +1,46 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk3use.h Define constants which feature to use.
+*/
+
+#ifndef DK3CONF_H_INCLUDED
+#include <dk3conf.h>
+#endif
+
+/*
+ For cross-compiled programs wchar_t string output failed
+ after _setmode(_fileno(stdout), _O_U16TEXT);
+*/
+#ifndef DK3_USE_SETMODE_UTF16
+#if DK3_ON_WINDOWS && (DK3_CHAR_SIZE > 1) && defined(_MSC_VER)
+/** Use _setmode() before writing wchar_t strings on Windows.
+*/
+#define DK3_USE_SETMODE_UTF16 1
+#else
+/** Do not use _setmode() before writing wchar_t strings on Windows.
+*/
+#define DK3_USE_SETMODE_UTF16 0
+#endif
+#endif
+
+/*
+ Here we keep the possibility to select more detailed
+ where to use _setmode(_fileno(stdout), _O_BINARY); and back.
+*/
+#ifndef DK3_USE_SETMODE_BINARY
+#if DK3_ON_WINDOWS
+ /*
+ && defined(_MSC_VER)
+ */
+#define DK3_USE_SETMODE_BINARY 1
+#else
+#define DK3_USE_SETMODE_BINARY 0
+#endif
+#endif
+
diff --git a/support/dktools/dk3use.h b/support/dktools/dk3use.h
new file mode 100644
index 0000000000..63835f9220
--- /dev/null
+++ b/support/dktools/dk3use.h
@@ -0,0 +1,60 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3use.ctr
+*/
+
+#ifndef DK3USE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK3USE_H_INCLUDED 1
+
+
+#line 8 "dk3use.ctr"
+
+/** @file dk3use.h Define constants which feature to use.
+*/
+
+#ifndef DK3CONF_H_INCLUDED
+#include <dk3conf.h>
+#endif
+
+/*
+ For cross-compiled programs wchar_t string output failed
+ after _setmode(_fileno(stdout), _O_U16TEXT);
+*/
+#ifndef DK3_USE_SETMODE_UTF16
+#if DK3_ON_WINDOWS && (DK3_CHAR_SIZE > 1) && defined(_MSC_VER)
+/** Use _setmode() before writing wchar_t strings on Windows.
+*/
+#define DK3_USE_SETMODE_UTF16 1
+#else
+/** Do not use _setmode() before writing wchar_t strings on Windows.
+*/
+#define DK3_USE_SETMODE_UTF16 0
+#endif
+#endif
+
+/*
+ Here we keep the possibility to select more detailed
+ where to use _setmode(_fileno(stdout), _O_BINARY); and back.
+*/
+#ifndef DK3_USE_SETMODE_BINARY
+#if DK3_ON_WINDOWS
+ /*
+ && defined(_MSC_VER)
+ */
+#define DK3_USE_SETMODE_BINARY 1
+#else
+#define DK3_USE_SETMODE_BINARY 0
+#endif
+#endif
+
+
+#endif
diff --git a/support/dktools/dk3usewx.c b/support/dktools/dk3usewx.c
index 56740b9e3b..ae0a6e9aa8 100644
--- a/support/dktools/dk3usewx.c
+++ b/support/dktools/dk3usewx.c
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifdef DK3_USE_WX
#undef DK3_USE_WX
#endif
diff --git a/support/dktools/dk3wreg.c b/support/dktools/dk3wreg.c
index 7dd8ee7d28..216c2eb817 100644
--- a/support/dktools/dk3wreg.c
+++ b/support/dktools/dk3wreg.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3wreg.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3wreg.ctr
*/
/** @file dk3wreg.c The dk3wreg module.
@@ -373,7 +351,7 @@ int
dk3wreg_key_delete(HKEY b, dkChar const *n, dk3_app_t *app)
{
int back = 0;
-#if _MSC_VER >= 1700 && (!(DK4_WINDOWS_LEGACY))
+#if (_WIN32) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0601)
long res;
@@ -658,7 +636,11 @@ dk3wreg_get_expanded_sz(
fe = REG_SZ;
if(dk3wreg_get_expand_sz(k, n, tp, ts, &fe, app)) {
if(REG_EXPAND_SZ == fe) {
- res = ExpandEnvironmentStrings(tp, dp, (DWORD)ds);
+#if DK3_CHAR_SIZE > 1
+ res = ExpandEnvironmentStringsW(tp, dp, (DWORD)ds);
+#else
+ res = ExpandEnvironmentStringsA(tp, dp, (DWORD)ds);
+#endif
if(0 < res) {
if((size_t)res < ds) {
back = 1;
@@ -683,16 +665,16 @@ dk3wreg_get_expanded_sz(
}
-#line 754 "dk3wreg.ctr"
+#line 758 "dk3wreg.ctr"
-#line 755 "dk3wreg.ctr"
+#line 759 "dk3wreg.ctr"
-#line 756 "dk3wreg.ctr"
+#line 760 "dk3wreg.ctr"
-#line 757 "dk3wreg.ctr"
+#line 761 "dk3wreg.ctr"
return back;
}
@@ -708,7 +690,7 @@ dk3wreg_get_dword(HKEY k, dkChar const *n, DWORD *b, dk3_app_t *app)
long res;
-#line 771 "dk3wreg.ctr"
+#line 775 "dk3wreg.ctr"
if((n) && (b)) {
dws = (DWORD)sizeof(DWORD);
dwres = (DWORD)0UL;
@@ -743,7 +725,7 @@ dk3wreg_get_dword(HKEY k, dkChar const *n, DWORD *b, dk3_app_t *app)
}
}
-#line 804 "dk3wreg.ctr"
+#line 808 "dk3wreg.ctr"
return back;
}
@@ -756,7 +738,7 @@ dk3wreg_entry_delete(HKEY k, dkChar const *n, dk3_app_t *app)
long res;
-#line 815 "dk3wreg.ctr"
+#line 819 "dk3wreg.ctr"
if(n) {
#if 2 == DK3_CHAR_SIZE
res = RegDeleteValueW(k, n);
@@ -770,7 +752,7 @@ dk3wreg_entry_delete(HKEY k, dkChar const *n, dk3_app_t *app)
}
}
-#line 827 "dk3wreg.ctr"
+#line 831 "dk3wreg.ctr"
return back;
}
diff --git a/support/dktools/dk3wreg.ctr b/support/dktools/dk3wreg.ctr
index ee587daf07..2c58e572c1 100644
--- a/support/dktools/dk3wreg.ctr
+++ b/support/dktools/dk3wreg.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -474,7 +474,7 @@ int
dk3wreg_key_delete(HKEY b, dkChar const *n, dk3_app_t *app)
{
int back = 0;
-#if _MSC_VER >= 1700 && (!(DK4_WINDOWS_LEGACY))
+#if (_WIN32) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0601)
long res;
$? "+ dk3wreg_key_delete \"%!ds\"", TR_STR(n)
if(n) {
@@ -727,7 +727,11 @@ dk3wreg_get_expanded_sz(
fe = REG_SZ;
if(dk3wreg_get_expand_sz(k, n, tp, ts, &fe, app)) {
if(REG_EXPAND_SZ == fe) {
- res = ExpandEnvironmentStrings(tp, dp, (DWORD)ds);
+#if DK3_CHAR_SIZE > 1
+ res = ExpandEnvironmentStringsW(tp, dp, (DWORD)ds);
+#else
+ res = ExpandEnvironmentStringsA(tp, dp, (DWORD)ds);
+#endif
if(0 < res) {
if((size_t)res < ds) {
back = 1;
diff --git a/support/dktools/dk3wreg.h b/support/dktools/dk3wreg.h
index d3f0bf2bcf..d45c0e81fa 100644
--- a/support/dktools/dk3wreg.h
+++ b/support/dktools/dk3wreg.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3wreg.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3wreg.ctr
*/
/** @file dk3wreg.h Header file for the dk3wreg module.
diff --git a/support/dktools/dk3wxcs.h b/support/dktools/dk3wxcs.h
index d00580c3d0..62b7e09b23 100644
--- a/support/dktools/dk3wxcs.h
+++ b/support/dktools/dk3wxcs.h
@@ -1,12 +1,21 @@
-/** @file dk4wxcs.h Configure size of wide characters.
+/*
+Copyright (C) 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef DK3WXCSZ_H_INCLUDED
-/** Protection against multiple inclusions. */
-#define DK3WXCSZ_H_INCLUDED 1
+#ifndef DK3WXCS_H_INCLUDED
+/** Multiple inclusion protection.*/
+#define DK3WXCS_H_INCLUDED 1
-/** Size of wxChar.
+/** Size of wxChar.
*/
#define DK3_SIZEOF_WXCHAR 4
+/** Size of wxStringCharType.
+*/
+#define DK3_SIZEOF_WXSTRINGCHARTYPE 4
+
+
+
#endif
+
diff --git a/support/dktools/dk3wxs.cpp b/support/dktools/dk3wxs.cpp
index 4b7e429a44..33d13eecd8 100644
--- a/support/dktools/dk3wxs.cpp
+++ b/support/dktools/dk3wxs.cpp
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3wxs.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3wxs.cpt
*/
/** @file dk3wxs.cpp The dk3wxs module.
*/
-#line 333 "dk3wxs.cpt"
+#line 345 "dk3wxs.cpt"
#ifdef DK3_USE_WX
#undef DK3_USE_WX
@@ -54,7 +32,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 348 "dk3wxs.cpt"
+#line 360 "dk3wxs.cpt"
void
@@ -463,44 +441,44 @@ dk3wxs_from_utf8(wxChar *d, size_t sz, char const *s)
int back = 0;
-#line 755 "dk3wxs.cpt"
+#line 767 "dk3wxs.cpt"
if((d) && (sz) && (s)) {
#if DK3_SIZEOF_WXCHAR > 1
#if DK3_SIZEOF_WXCHAR > 2
-#line 759 "dk3wxs.cpt"
+#line 771 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c8u_to_c32_app(s, NULL)) {
-#line 761 "dk3wxs.cpt"
+#line 773 "dk3wxs.cpt"
back = dk3str_cnv_c8u_to_c32_app( (dk3_c32_t *)d, sz, s, NULL);
}
#else
-#line 765 "dk3wxs.cpt"
+#line 777 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c8u_to_c16_app(s, NULL)) {
-#line 767 "dk3wxs.cpt"
+#line 779 "dk3wxs.cpt"
back = dk3str_cnv_c8u_to_c16_app( (dk3_c16_t *)d, sz, s, NULL);
}
#endif
#else
-#line 772 "dk3wxs.cpt"
+#line 784 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c8u_to_c8p_app(s, NULL)) {
-#line 774 "dk3wxs.cpt"
+#line 786 "dk3wxs.cpt"
back = dk3str_cnv_c8u_to_c8p_app((char *)d, sz, s, NULL);
}
#endif
}
-#line 778 "dk3wxs.cpt"
+#line 790 "dk3wxs.cpt"
return back;
}
@@ -561,7 +539,21 @@ dk3wxs_from_utf16(wxChar *d, size_t sz, dk3_c16_t const *s)
int
-dk3wxs_from_dkstr(wxChar *dp, size_t sz, int wxe, dkChar const *src, int dke)
+dk3wxs_from_dkstr(
+ wxChar *dp,
+ size_t sz,
+#if DK3_SIZEOF_WXCHAR == 1
+ int wxe,
+#else
+ int WXUNUSED(wxe),
+#endif
+ dkChar const *src,
+#if DK3_CHAR_SIZE == 1
+ int dke
+#else
+ int WXUNUSED(dke)
+#endif
+)
{
int back = 0;
if((dp) && (sz) && (src)) {
@@ -708,7 +700,21 @@ dk3wxs_from_dkstr(wxChar *dp, size_t sz, int wxe, dkChar const *src, int dke)
int
-dk3wxs_to_dkstr(dkChar *dp, size_t sz, int dke, wxChar const *src, int wxe)
+dk3wxs_to_dkstr(
+ dkChar *dp,
+ size_t sz,
+#if DK3_CHAR_SIZE == 1
+ int dke,
+#else
+ int WXUNUSED(dke),
+#endif
+ wxChar const *src,
+#if DK3_SIZEOF_WXCHAR == 1
+ int wxe
+#else
+ int WXUNUSED(wxe)
+#endif
+)
{
int back = 0;
if((dp) && (sz) && (src)) {
@@ -856,18 +862,28 @@ dk3wxs_to_dkstr(dkChar *dp, size_t sz, int dke, wxChar const *src, int wxe)
int
-dk3wxs_to_c8(char *dp, size_t sz, int c8e, wxChar const *src, int wxe)
+dk3wxs_to_c8(
+ char *dp,
+ size_t sz,
+ int c8e,
+ wxChar const *src,
+#if DK3_SIZEOF_WXCHAR == 1
+ int wxe
+#else
+ int WXUNUSED(wxe)
+#endif
+)
{
int back = 0;
-#line 1137 "dk3wxs.cpt"
+#line 1187 "dk3wxs.cpt"
if((dp) && (sz) && (src)) {
#if DK3_SIZEOF_WXCHAR > 1
#if DK3_SIZEOF_WXCHAR > 2
if(DK3_ENCODING_UTF8 == c8e) {
-#line 1141 "dk3wxs.cpt"
+#line 1191 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c32_to_c8u_app((const dk3_c32_t *)src, NULL)) {
back = dk3str_cnv_c32_to_c8u_app(
dp, sz, (const dk3_c32_t *)src, NULL
@@ -875,7 +891,7 @@ dk3wxs_to_c8(char *dp, size_t sz, int c8e, wxChar const *src, int wxe)
}
} else {
-#line 1147 "dk3wxs.cpt"
+#line 1197 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c32_to_c8p_app((const dk3_c32_t *)src, NULL)) {
back = dk3str_cnv_c32_to_c8p_app(
dp, sz, (const dk3_c32_t *)src, NULL
@@ -885,7 +901,7 @@ dk3wxs_to_c8(char *dp, size_t sz, int c8e, wxChar const *src, int wxe)
#else
if(DK3_ENCODING_UTF8 == c8e) {
-#line 1155 "dk3wxs.cpt"
+#line 1205 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c16_to_c8u_app((const dk3_c16_t *)src, NULL)) {
back = dk3str_cnv_c16_to_c8u_app(
dp, sz, (const dk3_c16_t *)src, NULL
@@ -893,7 +909,7 @@ dk3wxs_to_c8(char *dp, size_t sz, int c8e, wxChar const *src, int wxe)
}
} else {
-#line 1161 "dk3wxs.cpt"
+#line 1211 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c16_to_c8p_app((const dk3_c16_t *)src, NULL)) {
back = dk3str_cnv_c16_to_c8p_app(
dp, sz, (const dk3_c16_t *)src, NULL
@@ -904,20 +920,20 @@ dk3wxs_to_c8(char *dp, size_t sz, int c8e, wxChar const *src, int wxe)
#else
if(c8e == wxe) {
-#line 1170 "dk3wxs.cpt"
+#line 1220 "dk3wxs.cpt"
if(sz > strlen((const char *)src)) {
strcpy(dp, (const char *)src);
}
} else {
if(DK3_ENCODING_UTF8 == c8e) {
-#line 1175 "dk3wxs.cpt"
+#line 1225 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c8p_to_c8u_app((const char *)src, NULL)) {
back = dk3str_cnv_c8p_to_c8u_app(dp, sz, (const char *)src, NULL);
}
} else {
-#line 1179 "dk3wxs.cpt"
+#line 1229 "dk3wxs.cpt"
if(sz >= dk3str_cnvsz_c8u_to_c8p_app((const char *)src, NULL)) {
back = dk3str_cnv_c8u_to_c8p_app(dp, sz, (const char *)src, NULL);
}
@@ -926,7 +942,7 @@ dk3wxs_to_c8(char *dp, size_t sz, int c8e, wxChar const *src, int wxe)
#endif
}
-#line 1186 "dk3wxs.cpt"
+#line 1236 "dk3wxs.cpt"
return back;
}
diff --git a/support/dktools/dk3wxs.cpt b/support/dktools/dk3wxs.cpt
index e0781471a9..975901e62b 100644
--- a/support/dktools/dk3wxs.cpt
+++ b/support/dktools/dk3wxs.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -33,12 +33,24 @@ license = bsd
#endif
#ifndef WX_PRECOMP
#if DK4_HAVE_WX_CHARTYPE_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_CHARTYPE_H_INCLUDED
#include <wx/chartype.h>
#define WX_CHARTYPE_H_INCLUDED 1
#endif
#else
#if DK4_HAVE_WX_WXCHAR_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_WXCHAR_H_INCLUDED
#include <wx/wxchar.h>
#define WX_WXCHAR_H_INCLUDED 1
@@ -835,7 +847,21 @@ dk3wxs_from_utf16(wxChar *d, size_t sz, dk3_c16_t const *s)
int
-dk3wxs_from_dkstr(wxChar *dp, size_t sz, int wxe, dkChar const *src, int dke)
+dk3wxs_from_dkstr(
+ wxChar *dp,
+ size_t sz,
+#if DK3_SIZEOF_WXCHAR == 1
+ int wxe,
+#else
+ int WXUNUSED(wxe),
+#endif
+ dkChar const *src,
+#if DK3_CHAR_SIZE == 1
+ int dke
+#else
+ int WXUNUSED(dke)
+#endif
+)
{
int back = 0;
if((dp) && (sz) && (src)) {
@@ -982,7 +1008,21 @@ dk3wxs_from_dkstr(wxChar *dp, size_t sz, int wxe, dkChar const *src, int dke)
int
-dk3wxs_to_dkstr(dkChar *dp, size_t sz, int dke, wxChar const *src, int wxe)
+dk3wxs_to_dkstr(
+ dkChar *dp,
+ size_t sz,
+#if DK3_CHAR_SIZE == 1
+ int dke,
+#else
+ int WXUNUSED(dke),
+#endif
+ wxChar const *src,
+#if DK3_SIZEOF_WXCHAR == 1
+ int wxe
+#else
+ int WXUNUSED(wxe)
+#endif
+)
{
int back = 0;
if((dp) && (sz) && (src)) {
@@ -1130,7 +1170,17 @@ dk3wxs_to_dkstr(dkChar *dp, size_t sz, int dke, wxChar const *src, int wxe)
int
-dk3wxs_to_c8(char *dp, size_t sz, int c8e, wxChar const *src, int wxe)
+dk3wxs_to_c8(
+ char *dp,
+ size_t sz,
+ int c8e,
+ wxChar const *src,
+#if DK3_SIZEOF_WXCHAR == 1
+ int wxe
+#else
+ int WXUNUSED(wxe)
+#endif
+)
{
int back = 0;
$? "+ dk3wxs_to_c8str"
diff --git a/support/dktools/dk3wxs.h b/support/dktools/dk3wxs.h
index f1768d4398..35f2947c7f 100644
--- a/support/dktools/dk3wxs.h
+++ b/support/dktools/dk3wxs.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3wxs.cpt
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3wxs.cpt
*/
/** @file dk3wxs.h Header file for the dk3wxs module.
@@ -69,12 +47,24 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef WX_PRECOMP
#if DK4_HAVE_WX_CHARTYPE_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_CHARTYPE_H_INCLUDED
#include <wx/chartype.h>
#define WX_CHARTYPE_H_INCLUDED 1
#endif
#else
#if DK4_HAVE_WX_WXCHAR_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_WXCHAR_H_INCLUDED
#include <wx/wxchar.h>
#define WX_WXCHAR_H_INCLUDED 1
diff --git a/support/dktools/dk3xsp.c b/support/dktools/dk3xsp.c
index 8d731aeb32..c84f570e9d 100644
--- a/support/dktools/dk3xsp.c
+++ b/support/dktools/dk3xsp.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3xsp.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3xsp.ctr
*/
/** @file dk3xsp.c The dk3xsp module.
*/
-#line 260 "dk3xsp.ctr"
+#line 285 "dk3xsp.ctr"
#include "dk3all.h"
#include "dk3fig.h"
@@ -45,7 +23,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 266 "dk3xsp.ctr"
+#line 291 "dk3xsp.ctr"
+
@@ -56,13 +35,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* ************************************************************************ */
-#line 272 "dk3xsp.ctr"
-
-
+#line 298 "dk3xsp.ctr"
-#line 276 "dk3xsp.ctr"
@@ -141,7 +117,7 @@ dk3xsp_f(double u, double p)
back = u * u * u *(10.0 - p + u * (2.0 * p - 15.0 + u * (6.0 - p)));
-#line 353 "dk3xsp.ctr"
+#line 378 "dk3xsp.ctr"
return back;
}
@@ -160,7 +136,7 @@ dk3xsp_dfdu(double u, double p)
back = u * u * (30.0 - 3.0*p + u * (8.0*p - 60.0 + u * (30.0 - 5.0*p)));
-#line 370 "dk3xsp.ctr"
+#line 395 "dk3xsp.ctr"
return back;
}
@@ -180,7 +156,7 @@ dk3xsp_g(double u, double p, double q)
back = u*(q+u*(2.0*q+u*(10.0-12.0*q-p+u*(2.0*p+14.0*q-15+u*(6.0-5.0*q-p)))));
-#line 388 "dk3xsp.ctr"
+#line 413 "dk3xsp.ctr"
return back;
}
@@ -201,7 +177,7 @@ dk3xsp_dgdu(double u, double p, double q)
q+u*(4.0*q+u*(30.0-3.0*p-36.0*q+u*(56.0*q+8.0*p-60.0+u*(30.0-5.0*p-25.0*q))));
-#line 407 "dk3xsp.ctr"
+#line 432 "dk3xsp.ctr"
return back;
}
@@ -220,7 +196,7 @@ dk3xsp_h(double u, double q)
back = u*(q+u*(2.0*q-u*u*(q*(u+2.0))));
-#line 424 "dk3xsp.ctr"
+#line 449 "dk3xsp.ctr"
return back;
}
@@ -239,7 +215,7 @@ dk3xsp_dhdu(double u, double q)
back = q+u*(4.0*q-u*u*(q*(8.0+5.0*u)));
-#line 441 "dk3xsp.ctr"
+#line 466 "dk3xsp.ctr"
return back;
}
@@ -304,7 +280,7 @@ dk3xsp_set(
{
-#line 504 "dk3xsp.ctr"
+#line 529 "dk3xsp.ctr"
if(pseg) {
pseg->ha = ((a) ? 1 : 0);
pseg->hd = ((d) ? 1 : 0);
@@ -341,19 +317,19 @@ dk3xsp_set(
}
-#line 539 "dk3xsp.ctr"
+#line 564 "dk3xsp.ctr"
-#line 540 "dk3xsp.ctr"
+#line 565 "dk3xsp.ctr"
-#line 541 "dk3xsp.ctr"
+#line 566 "dk3xsp.ctr"
-#line 542 "dk3xsp.ctr"
+#line 567 "dk3xsp.ctr"
}
-#line 543 "dk3xsp.ctr"
+#line 568 "dk3xsp.ctr"
}
@@ -388,7 +364,7 @@ dk3xsp_calculate(
int back = 0;
-#line 576 "dk3xsp.ctr"
+#line 601 "dk3xsp.ctr"
if(pseg) {
back = 1;
/*
@@ -416,16 +392,16 @@ dk3xsp_calculate(
}
-#line 602 "dk3xsp.ctr"
+#line 627 "dk3xsp.ctr"
-#line 603 "dk3xsp.ctr"
+#line 628 "dk3xsp.ctr"
-#line 604 "dk3xsp.ctr"
+#line 629 "dk3xsp.ctr"
-#line 605 "dk3xsp.ctr"
+#line 630 "dk3xsp.ctr"
/*
Calculate fa, fb, fc, fd.
*/
@@ -449,16 +425,16 @@ dk3xsp_calculate(
}
-#line 627 "dk3xsp.ctr"
+#line 652 "dk3xsp.ctr"
-#line 628 "dk3xsp.ctr"
+#line 653 "dk3xsp.ctr"
-#line 629 "dk3xsp.ctr"
+#line 654 "dk3xsp.ctr"
-#line 630 "dk3xsp.ctr"
+#line 655 "dk3xsp.ctr"
/*
Calculate counters and denominator.
*/
@@ -495,13 +471,13 @@ dk3xsp_calculate(
);
-#line 665 "dk3xsp.ctr"
+#line 690 "dk3xsp.ctr"
-#line 666 "dk3xsp.ctr"
+#line 691 "dk3xsp.ctr"
-#line 667 "dk3xsp.ctr"
+#line 692 "dk3xsp.ctr"
/*
Calculate x and y value.
*/
@@ -509,10 +485,10 @@ dk3xsp_calculate(
pseg->y = dk3ma_d_div_ok(zy, n, &ec);
-#line 673 "dk3xsp.ctr"
+#line 698 "dk3xsp.ctr"
-#line 674 "dk3xsp.ctr"
+#line 699 "dk3xsp.ctr"
/*
Calculate derivatives if required.
*/
@@ -552,16 +528,16 @@ dk3xsp_calculate(
}
-#line 712 "dk3xsp.ctr"
+#line 737 "dk3xsp.ctr"
-#line 713 "dk3xsp.ctr"
+#line 738 "dk3xsp.ctr"
-#line 714 "dk3xsp.ctr"
+#line 739 "dk3xsp.ctr"
-#line 715 "dk3xsp.ctr"
+#line 740 "dk3xsp.ctr"
/*
Calculate counters and denominator.
*/
@@ -599,16 +575,16 @@ dk3xsp_calculate(
nsq = n * n;
-#line 751 "dk3xsp.ctr"
+#line 776 "dk3xsp.ctr"
-#line 752 "dk3xsp.ctr"
+#line 777 "dk3xsp.ctr"
-#line 753 "dk3xsp.ctr"
+#line 778 "dk3xsp.ctr"
-#line 754 "dk3xsp.ctr"
+#line 779 "dk3xsp.ctr"
pseg->dxdt = dk3ma_d_div_ok(
dk3ma_d_sub_ok(
dk3ma_d_mul_ok(n, zxder, &ec),
@@ -629,17 +605,17 @@ dk3xsp_calculate(
);
-#line 773 "dk3xsp.ctr"
+#line 798 "dk3xsp.ctr"
-#line 774 "dk3xsp.ctr"
+#line 799 "dk3xsp.ctr"
}
if(ec) {
back = 0;
}
}
-#line 779 "dk3xsp.ctr"
+#line 804 "dk3xsp.ctr"
return back;
}
@@ -652,7 +628,7 @@ dk3xsp_calculate(
/* ************************************************************************ */
-#line 787 "dk3xsp.ctr"
+#line 812 "dk3xsp.ctr"
@@ -668,12 +644,6 @@ dk3xsp_is_null(double s)
-
-
-#line 803 "dk3xsp.ctr"
-
-
-
/** Convert long to double.
@param l Long value to convert.
@return Conversion result.
@@ -710,7 +680,7 @@ dk3xsp_segment_length(
int cc = 1; /* Flag: Can continue. */
-#line 841 "dk3xsp.ctr"
+#line 862 "dk3xsp.ctr"
if((pseg) && (prec > 0.0)) {
if(dk3xsp_is_null((pseg->b).s) && dk3xsp_is_null((pseg->c).s)) {
/*
@@ -726,10 +696,10 @@ dk3xsp_segment_length(
)
);
-#line 855 "dk3xsp.ctr"
+#line 876 "dk3xsp.ctr"
} else {
-#line 856 "dk3xsp.ctr"
+#line 877 "dk3xsp.ctr"
/*
Spline calculation really necessary.
*/
@@ -737,7 +707,7 @@ dk3xsp_segment_length(
if(lastpassres > -1.0) { lastpassres = -1.0; }
while((cc) && (mc) && (!(mec))) {
-#line 862 "dk3xsp.ctr"
+#line 883 "dk3xsp.ctr"
passres = 0.0;
if(dk3xsp_calculate(pseg, 0.0, 0)) {
lastx = dk3xsp_get_x(pseg);
@@ -774,20 +744,23 @@ dk3xsp_segment_length(
}
}
-#line 897 "dk3xsp.ctr"
+#line 918 "dk3xsp.ctr"
if(fabs(passres - lastpassres) < prec) {
-#line 898 "dk3xsp.ctr"
+#line 919 "dk3xsp.ctr"
mc = 0; /* Finished successfully. */
back = passres;
+
+
+#line 922 "dk3xsp.ctr"
} else {
-#line 901 "dk3xsp.ctr"
+#line 923 "dk3xsp.ctr"
lastpassres = passres;
segs = segs * 2L;
if(segs > DK3XSP_MAX_ITERATION_SEGMENTS) {
-#line 904 "dk3xsp.ctr"
+#line 926 "dk3xsp.ctr"
cc = 0;
if(ec) { *ec = DK3_ERROR_ITERATION; }
}
@@ -803,7 +776,7 @@ dk3xsp_segment_length(
if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 918 "dk3xsp.ctr"
+#line 940 "dk3xsp.ctr"
return back;
}
@@ -837,17 +810,17 @@ dk3xsp_segment_partial_length(
int cc = 1; /* Flag: Can continue. */
-#line 950 "dk3xsp.ctr"
+#line 972 "dk3xsp.ctr"
if((pseg) && (prec > 0.0) && (tstart >= 0.0) && (tstart<= 1.0)) {
-#line 951 "dk3xsp.ctr"
+#line 973 "dk3xsp.ctr"
if(dk3xsp_is_null((pseg->b).s) && dk3xsp_is_null((pseg->c).s)) {
/*
Simple line.
*/
-#line 956 "dk3xsp.ctr"
+#line 978 "dk3xsp.ctr"
if(dk3xsp_calculate(pseg, tstart, 0)) {
x = dk3xsp_get_x(pseg);
y = dk3xsp_get_y(pseg);
@@ -877,10 +850,10 @@ dk3xsp_segment_partial_length(
*/
-#line 984 "dk3xsp.ctr"
+#line 1006 "dk3xsp.ctr"
if(dir) {
-#line 985 "dk3xsp.ctr"
+#line 1007 "dk3xsp.ctr"
lastpassres = 0.0 - 2.0 * prec;
if(lastpassres > -1.0) { lastpassres = -1.0; }
while((cc) && (mc) && (!(mec))) {
@@ -896,29 +869,29 @@ dk3xsp_segment_partial_length(
t = (tstart * dk3xsp_l_to_d(i)) / dsegs;
}
-#line 999 "dk3xsp.ctr"
+#line 1021 "dk3xsp.ctr"
if(dk3xsp_calculate(pseg, t, 0)) {
-#line 1001 "dk3xsp.ctr"
+#line 1023 "dk3xsp.ctr"
-#line 1002 "dk3xsp.ctr"
+#line 1024 "dk3xsp.ctr"
x = dk3xsp_get_x(pseg);
-#line 1003 "dk3xsp.ctr"
+#line 1025 "dk3xsp.ctr"
y = dk3xsp_get_y(pseg);
-#line 1004 "dk3xsp.ctr"
+#line 1026 "dk3xsp.ctr"
deltax = dk3ma_d_sub_ok(x, lastx, &mec);
-#line 1005 "dk3xsp.ctr"
+#line 1027 "dk3xsp.ctr"
deltay = dk3ma_d_sub_ok(y, lasty, &mec);
-#line 1006 "dk3xsp.ctr"
+#line 1028 "dk3xsp.ctr"
-#line 1007 "dk3xsp.ctr"
+#line 1029 "dk3xsp.ctr"
passres = dk3ma_d_add_ok(
passres,
sqrt(
@@ -931,7 +904,7 @@ dk3xsp_segment_partial_length(
&mec
);
-#line 1018 "dk3xsp.ctr"
+#line 1040 "dk3xsp.ctr"
lastx = x; lasty = y;
} else {
cc = 0;
@@ -956,7 +929,7 @@ dk3xsp_segment_partial_length(
}
} else {
-#line 1041 "dk3xsp.ctr"
+#line 1063 "dk3xsp.ctr"
tdiff = 1.0 - tstart;
lastpassres = 0.0 - 2.0 * prec;
if(lastpassres > -1.0) { lastpassres = -1.0; }
@@ -969,47 +942,47 @@ dk3xsp_segment_partial_length(
for(i = 1L; i <= segs; i++) {
if(i == segs) {
-#line 1052 "dk3xsp.ctr"
+#line 1074 "dk3xsp.ctr"
t = 1.0;
} else {
t = tstart + ((tdiff * dk3xsp_l_to_d(i)) / dsegs);
}
-#line 1057 "dk3xsp.ctr"
+#line 1079 "dk3xsp.ctr"
if(dk3xsp_calculate(pseg, t, 0)) {
x = dk3xsp_get_x(pseg);
y = dk3xsp_get_y(pseg);
} else {
-#line 1061 "dk3xsp.ctr"
+#line 1083 "dk3xsp.ctr"
cc = 0;
mec = DK3_ERROR_MATH_OVERFLOW;
}
if(cc) {
-#line 1066 "dk3xsp.ctr"
+#line 1088 "dk3xsp.ctr"
-#line 1067 "dk3xsp.ctr"
+#line 1089 "dk3xsp.ctr"
-#line 1068 "dk3xsp.ctr"
+#line 1090 "dk3xsp.ctr"
-#line 1069 "dk3xsp.ctr"
+#line 1091 "dk3xsp.ctr"
deltax = dk3ma_d_sub_ok(x, lastx, &mec);
deltay = dk3ma_d_sub_ok(y, lasty, &mec);
-#line 1072 "dk3xsp.ctr"
+#line 1094 "dk3xsp.ctr"
-#line 1073 "dk3xsp.ctr"
+#line 1095 "dk3xsp.ctr"
-#line 1074 "dk3xsp.ctr"
+#line 1096 "dk3xsp.ctr"
passres = dk3ma_d_add_ok(
passres,
sqrt(
@@ -1022,7 +995,7 @@ dk3xsp_segment_partial_length(
&mec
);
-#line 1085 "dk3xsp.ctr"
+#line 1107 "dk3xsp.ctr"
lastx = x; lasty = y;
}
}
@@ -1050,7 +1023,7 @@ dk3xsp_segment_partial_length(
}
-#line 1111 "dk3xsp.ctr"
+#line 1133 "dk3xsp.ctr"
return back;
}
@@ -1063,7 +1036,7 @@ dk3xsp_segment_partial_length(
/* ************************************************************************ */
-#line 1119 "dk3xsp.ctr"
+#line 1141 "dk3xsp.ctr"
@@ -1084,14 +1057,14 @@ dk3xsp_open_spline_length(
int mec = 0;
-#line 1138 "dk3xsp.ctr"
+#line 1160 "dk3xsp.ctr"
if((points) && (1 < np) && (prec > 0.0)) {
dk3xsp_reset(&seg);
if(cb) { dk3xsp_set_cb(&seg, 1); }
for(i = 0; ((i < (np - 1)) && (back > -1.0)); i++) {
-#line 1143 "dk3xsp.ctr"
+#line 1165 "dk3xsp.ctr"
val = -1.0;
if(fslc) {
val = fslc[i];
@@ -1125,7 +1098,7 @@ dk3xsp_open_spline_length(
if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 1175 "dk3xsp.ctr"
+#line 1197 "dk3xsp.ctr"
return back;
}
@@ -1146,7 +1119,7 @@ dk3xsp_find_segment_start(double tstart, int *ec)
int mec = 0;
-#line 1194 "dk3xsp.ctr"
+#line 1216 "dk3xsp.ctr"
ul = dk3ma_d_to_ul_ok(floor(tstart), &mec);
if(mec) {
*ec = mec;
@@ -1157,19 +1130,19 @@ dk3xsp_find_segment_start(double tstart, int *ec)
}
}
-#line 1203 "dk3xsp.ctr"
+#line 1225 "dk3xsp.ctr"
return back;
#else
size_t back = 0;
int mec = 0;
-#line 1208 "dk3xsp.ctr"
+#line 1230 "dk3xsp.ctr"
back = dk3ma_d_to_sz_ok(floor(tstart), &mec);
if (mec) { if (ec) { *ec = mec; } }
-#line 1211 "dk3xsp.ctr"
+#line 1233 "dk3xsp.ctr"
return back;
#endif
}
@@ -1250,7 +1223,7 @@ dk3xsp_open_spline_partial_length(
int mec = 0;
-#line 1290 "dk3xsp.ctr"
+#line 1312 "dk3xsp.ctr"
if((points) && (1 < np) && (prec > 0.0)) {
if((tstart >= 0.0) && (tstart <= ((double)(np - 1)))) {
dk3xsp_reset(&seg);
@@ -1258,14 +1231,14 @@ dk3xsp_open_spline_partial_length(
startseg = dk3xsp_find_segment_start(tstart, &mec);
if(mec) {
-#line 1296 "dk3xsp.ctr"
+#line 1318 "dk3xsp.ctr"
if(ec) { *ec = mec; }
} else {
-#line 1298 "dk3xsp.ctr"
+#line 1320 "dk3xsp.ctr"
if(startseg == (np - 1)) {
-#line 1299 "dk3xsp.ctr"
+#line 1321 "dk3xsp.ctr"
/*
tstart points to the final point.
So we have 0 for forward length or the full
@@ -1273,19 +1246,19 @@ dk3xsp_open_spline_partial_length(
*/
if(dir) {
-#line 1305 "dk3xsp.ctr"
+#line 1327 "dk3xsp.ctr"
back = dk3xsp_open_spline_length(points, np, prec, fslc, cb, ec);
} else {
-#line 1307 "dk3xsp.ctr"
+#line 1329 "dk3xsp.ctr"
back = 0.0;
}
} else {
-#line 1310 "dk3xsp.ctr"
+#line 1332 "dk3xsp.ctr"
if(tstart > 0.0) {
-#line 1311 "dk3xsp.ctr"
+#line 1333 "dk3xsp.ctr"
/*
tstart points to somewhere in the spline.
We have to calculate one segment partially, all other
@@ -1303,7 +1276,7 @@ dk3xsp_open_spline_partial_length(
);
if(val >= 0.0) {
-#line 1327 "dk3xsp.ctr"
+#line 1349 "dk3xsp.ctr"
back = val;
/*
Partial segment calculated successfully.
@@ -1311,14 +1284,14 @@ dk3xsp_open_spline_partial_length(
*/
if(dir) {
-#line 1333 "dk3xsp.ctr"
+#line 1355 "dk3xsp.ctr"
/*
Calculate all segments before the partial one.
*/
for(i = 0; ((i < startseg) && (back > -1.0)); i++) {
val = -1.0;
-#line 1338 "dk3xsp.ctr"
+#line 1360 "dk3xsp.ctr"
if(fslc) {
val = fslc[i];
}
@@ -1341,7 +1314,7 @@ dk3xsp_open_spline_partial_length(
}
if(val >= 0.0) {
-#line 1359 "dk3xsp.ctr"
+#line 1381 "dk3xsp.ctr"
back = dk3ma_d_add_ok(back, val, &mec);
if(mec) {
back = -1.0; i = np;
@@ -1353,14 +1326,14 @@ dk3xsp_open_spline_partial_length(
}
} else {
-#line 1369 "dk3xsp.ctr"
+#line 1391 "dk3xsp.ctr"
/*
Calculate all segments after the partial one.
*/
for(i = (startseg + 1); ((i < (np - 1)) && (back > -1)); i++) {
val = -1.0;
-#line 1374 "dk3xsp.ctr"
+#line 1396 "dk3xsp.ctr"
if(fslc) {
val = fslc[i];
}
@@ -1383,7 +1356,7 @@ dk3xsp_open_spline_partial_length(
}
if(val >= 0.0) {
-#line 1395 "dk3xsp.ctr"
+#line 1417 "dk3xsp.ctr"
back = dk3ma_d_add_ok(back, val, &mec);
if(mec) {
back = -1.0; i = np;
@@ -1391,20 +1364,20 @@ dk3xsp_open_spline_partial_length(
}
} else {
-#line 1401 "dk3xsp.ctr"
+#line 1423 "dk3xsp.ctr"
back = -1.0; i = np;
}
}
}
-#line 1405 "dk3xsp.ctr"
+#line 1427 "dk3xsp.ctr"
} else {
-#line 1406 "dk3xsp.ctr"
+#line 1428 "dk3xsp.ctr"
}
} else {
-#line 1408 "dk3xsp.ctr"
+#line 1430 "dk3xsp.ctr"
/*
tstart points to the start point.
So we have the full spline length for forward length,
@@ -1412,11 +1385,11 @@ dk3xsp_open_spline_partial_length(
*/
if(0 == dir) {
-#line 1414 "dk3xsp.ctr"
+#line 1436 "dk3xsp.ctr"
back = dk3xsp_open_spline_length(points, np, prec, fslc, cb, ec);
} else {
-#line 1416 "dk3xsp.ctr"
+#line 1438 "dk3xsp.ctr"
back = 0.0;
}
}
@@ -1429,14 +1402,14 @@ dk3xsp_open_spline_partial_length(
if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 1427 "dk3xsp.ctr"
+#line 1449 "dk3xsp.ctr"
return back;
}
double
-dk3xsp_get_t_for_distance(
+dk3xsp_get_t_for_distance_bisection(
dk3_fig_spline_point_t const *points,
size_t np,
double dist,
@@ -1464,13 +1437,13 @@ dk3xsp_get_t_for_distance(
int mc = 1; /* Flag: Must continue. */
-#line 1460 "dk3xsp.ctr"
+#line 1482 "dk3xsp.ctr"
fprec = 0.2 * prec;
if((points) && (1 < np) && (prec > 0.0) && (dist >= 0.0)) {
l = dk3xsp_open_spline_length(points, np, fprec, fslc, cb, &mec);
-#line 1464 "dk3xsp.ctr"
+#line 1486 "dk3xsp.ctr"
if(l > dist) {
xl = 0.0;
xr = (double)(np - 1);
@@ -1478,18 +1451,18 @@ dk3xsp_get_t_for_distance(
yl = 0.0 - dist;
yr = dk3ma_d_sub_ok(l, dist, &mec);
-#line 1470 "dk3xsp.ctr"
+#line 1492 "dk3xsp.ctr"
} else {
yl = dk3ma_d_sub_ok(l, dist, &mec);
-#line 1472 "dk3xsp.ctr"
+#line 1494 "dk3xsp.ctr"
yr = 0.0 - dist;
}
while((cc) && (mc) && (!(mec))) {
xc = 0.5 * dk3ma_d_add_ok(xl, xr, &mec);
-#line 1477 "dk3xsp.ctr"
+#line 1499 "dk3xsp.ctr"
yc = dk3ma_d_sub_ok(
dk3xsp_open_spline_partial_length(
points, np, fprec, xc, fslc, dir, cb, ec
@@ -1498,16 +1471,16 @@ dk3xsp_get_t_for_distance(
&mec
);
-#line 1484 "dk3xsp.ctr"
+#line 1506 "dk3xsp.ctr"
-#line 1485 "dk3xsp.ctr"
+#line 1507 "dk3xsp.ctr"
-#line 1486 "dk3xsp.ctr"
+#line 1508 "dk3xsp.ctr"
-#line 1487 "dk3xsp.ctr"
+#line 1509 "dk3xsp.ctr"
if(dir) {
if(yc > 0.0) {
xr = xc; yr = yc;
@@ -1528,10 +1501,10 @@ dk3xsp_get_t_for_distance(
} else {
passno++;
-#line 1506 "dk3xsp.ctr"
+#line 1528 "dk3xsp.ctr"
if(passno > 1000UL) {
-#line 1507 "dk3xsp.ctr"
+#line 1529 "dk3xsp.ctr"
mec = DK3_ERROR_ITERATION;
} else {
}
@@ -1539,12 +1512,12 @@ dk3xsp_get_t_for_distance(
}
if((cc) && (!(mec))) {
-#line 1513 "dk3xsp.ctr"
+#line 1535 "dk3xsp.ctr"
back = xl + ((xr - xl) * ayl)/(ayl + ayr);
}
if(mec) {
-#line 1516 "dk3xsp.ctr"
+#line 1538 "dk3xsp.ctr"
back = -1.0;
if(ec) { *ec = mec; }
}
@@ -1555,12 +1528,227 @@ dk3xsp_get_t_for_distance(
if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 1525 "dk3xsp.ctr"
+#line 1547 "dk3xsp.ctr"
+ return back;
+}
+
+
+
+#if DK3_HAVE_ISFINITE
+#define MY_ISFINITE(x) (isfinite(x))
+#else
+#if DK3_HAVE__FINITE
+#define MY_ISFINITE(x) (_finite(x))
+#else
+#define MY_ISFINITE(x) (1)
+#endif
+#endif
+
+#if DK3_HAVE_ISLESS
+#define MY_ISLESS(a,b) (isless((a),(b)))
+#else
+#define MY_ISLESS(a,b) (((MY_ISFINITE(a)) && (MY_ISFINITE(b))) && ((a) < (b)))
+#endif
+
+
+static
+double
+dk3xsp_gamma(double fg, double fx)
+{
+ double back;
+ back = 1.0 - fx / fg;
+ if (!(MY_ISFINITE(back))) {
+ back = 0.5;
+ } else {
+ if (0.0 >= back) {
+ back = 0.5;
+ } else {
+ if (1.0 < back) {
+ back = 1.0;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+double
+dk3xsp_get_t_for_distance(
+ dk3_fig_spline_point_t const *points,
+ size_t np,
+ double dist,
+ double prec,
+ double *fslc,
+ int dir,
+ int cb,
+ int *ec
+)
+{
+ double back = -1.0;
+ double x = 0.0;
+ double xo;
+ double a;
+ double b;
+ double ya;
+ double yb;
+ double yx;
+ double fprec;
+ double l;
+ double gamma;
+ unsigned long passno = 0UL;
+ int ls = 0;
+ int mec = 0;
+ int cc = 1;
+
+
+#line 1619 "dk3xsp.ctr"
+ fprec = prec / 8.0;
+ if((points) && (1 < np) && (prec > 0.0) && (dist >= 0.0)) {
+ l = dk3xsp_open_spline_length(points, np, fprec, fslc, cb, &mec);
+ if ((l > dist) && (0 == mec)) {
+ a = 0.0;
+ b = (double)(np - 1);
+ if(dir) {
+ ya = 0.0 - dist;
+ yb = dk3ma_d_sub_ok(l, dist, &mec);
+ } else {
+ ya = dk3ma_d_sub_ok(l, dist, &mec);
+ yb = 0.0 - dist;
+ }
+ if (0 == mec) {
+ while (1 == cc) {
+
+
+#line 1635 "dk3xsp.ctr"
+
+
+#line 1636 "dk3xsp.ctr"
+
+
+#line 1637 "dk3xsp.ctr"
+ xo = x;
+ x = (a * yb - b * ya) / (yb - ya);
+
+
+#line 1640 "dk3xsp.ctr"
+ if (MY_ISFINITE(x)) {
+ yx = dk3ma_d_sub_ok(
+ dk3xsp_open_spline_partial_length(
+ points, np, fprec, x, fslc, dir, cb, ec
+ ), dist, &mec
+ );
+
+
+#line 1647 "dk3xsp.ctr"
+ if (MY_ISFINITE(yx)) {
+ if ((passno > 0UL) && (MY_ISLESS((x-xo),prec)) && (fabs(yx) < prec))
+ {
+ cc = 0;
+
+#line 1651 "dk3xsp.ctr"
+ back = x;
+ }
+ else
+ {
+ if (passno >= 1000UL) {
+
+#line 1656 "dk3xsp.ctr"
+ cc = -1;
+ /* ##### ERROR: TOO MANY PASSES */
+ } else {
+ if (dir) {
+ if (yx > 0.0) {
+
+#line 1661 "dk3xsp.ctr"
+ if (1 == ls) {
+
+#line 1662 "dk3xsp.ctr"
+ gamma = dk3xsp_gamma(yb, yx);
+ ya *= gamma;
+ }
+ b = x; yb = yx;
+ ls = 1;
+ } else {
+
+#line 1668 "dk3xsp.ctr"
+ if (-1 == ls) {
+
+#line 1669 "dk3xsp.ctr"
+ gamma = dk3xsp_gamma(ya, yx);
+ yb *= gamma;
+ }
+ a = x; ya = yx;
+ ls = -1;
+ }
+ } else {
+ if (yx > 0.0) {
+
+#line 1677 "dk3xsp.ctr"
+ if (-1 == ls) {
+
+#line 1678 "dk3xsp.ctr"
+ gamma = dk3xsp_gamma(ya, yx);
+ yb *= gamma;
+ }
+ a = x; ya = yx;
+ ls = -1;
+ } else {
+
+#line 1684 "dk3xsp.ctr"
+ if (1 == ls) {
+
+#line 1685 "dk3xsp.ctr"
+ gamma = dk3xsp_gamma(yb, yx);
+ ya *= gamma;
+ }
+ b = x; yb = yx;
+ ls = 1;
+ }
+ }
+ }
+ }
+ } else {
+
+#line 1695 "dk3xsp.ctr"
+ cc = -1;
+ /* ##### MATH ERROR */
+ }
+ } else {
+
+#line 1699 "dk3xsp.ctr"
+ cc = -1;
+ /* ##### MATH ERROR */
+ }
+ if (ULONG_MAX > passno) { passno++; }
+ }
+ } else {
+
+#line 1705 "dk3xsp.ctr"
+ /* ##### ERROR: Math error */
+ }
+ } else {
+
+#line 1708 "dk3xsp.ctr"
+ if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
+ }
+ } else {
+
+#line 1711 "dk3xsp.ctr"
+ if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
+ }
+
+
+#line 1714 "dk3xsp.ctr"
return back;
}
+
+#line 1719 "dk3xsp.ctr"
+
+
double
dk3xsp_direction(
dk3_fig_spline_point_t const *points,
@@ -1584,7 +1772,7 @@ dk3xsp_direction(
int mec = 0;
-#line 1552 "dk3xsp.ctr"
+#line 1743 "dk3xsp.ctr"
if((points) && (1 < np)) {
if((t >= 0.0) && (t <= ((double)(np - 1)))) {
dk3xsp_reset(&seg);
@@ -1596,7 +1784,7 @@ dk3xsp_direction(
back = dk3ma_d_atan2(dydt, dxdt);
} else {
-#line 1562 "dk3xsp.ctr"
+#line 1753 "dk3xsp.ctr"
delta = 0.001;
tleft = tright = t;
if(t > delta) { tleft = t - delta; }
@@ -1612,16 +1800,16 @@ dk3xsp_direction(
back = dk3ma_d_atan2(dydt, dxdt);
} else {
-#line 1576 "dk3xsp.ctr"
+#line 1767 "dk3xsp.ctr"
}
} else {
-#line 1578 "dk3xsp.ctr"
+#line 1769 "dk3xsp.ctr"
}
}
} else {
-#line 1581 "dk3xsp.ctr"
+#line 1772 "dk3xsp.ctr"
}
if(mec) { if(ec) { *ec = mec; } }
} else {
@@ -1631,7 +1819,7 @@ dk3xsp_direction(
if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 1589 "dk3xsp.ctr"
+#line 1780 "dk3xsp.ctr"
return back;
}
@@ -1662,7 +1850,7 @@ dk3xsp_direction_and_position(
int mec = 0;
-#line 1618 "dk3xsp.ctr"
+#line 1809 "dk3xsp.ctr"
if((points) && (1 < np) && (xpos) && (ypos)) {
if((t >= 0.0) && (t <= ((double)(np - 1)))) {
dk3xsp_reset(&seg);
@@ -1673,14 +1861,14 @@ dk3xsp_direction_and_position(
dxdt = dk3xsp_get_dxdt(&seg);
dydt = dk3xsp_get_dydt(&seg);
-#line 1627 "dk3xsp.ctr"
+#line 1818 "dk3xsp.ctr"
if((fabs(dxdt) > 1.0e-6) || (fabs(dydt) > 1.0e-6)) {
back = dk3ma_d_atan2(dydt, dxdt);
-#line 1629 "dk3xsp.ctr"
+#line 1820 "dk3xsp.ctr"
} else {
-#line 1630 "dk3xsp.ctr"
+#line 1821 "dk3xsp.ctr"
delta = 0.001;
tleft = tright = t;
if(t > delta) { tleft = t - delta; }
@@ -1696,16 +1884,16 @@ dk3xsp_direction_and_position(
back = dk3ma_d_atan2(dydt, dxdt);
} else {
-#line 1644 "dk3xsp.ctr"
+#line 1835 "dk3xsp.ctr"
}
} else {
-#line 1646 "dk3xsp.ctr"
+#line 1837 "dk3xsp.ctr"
}
}
} else {
-#line 1649 "dk3xsp.ctr"
+#line 1840 "dk3xsp.ctr"
}
if(mec) { if(ec) { *ec = mec; } }
} else {
@@ -1715,7 +1903,7 @@ dk3xsp_direction_and_position(
if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
}
-#line 1657 "dk3xsp.ctr"
+#line 1848 "dk3xsp.ctr"
return back;
}
diff --git a/support/dktools/dk3xsp.ctr b/support/dktools/dk3xsp.ctr
index fbaafb8738..6224d0be0b 100644
--- a/support/dktools/dk3xsp.ctr
+++ b/support/dktools/dk3xsp.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -162,6 +162,31 @@ dk3xsp_open_spline_partial_length(
int *ec
);
+/** Calculate t value for given distance to end point,
+ use bisection iteration (typically slowlier than
+ Anderson-Bjoerck variant of regula falsi).
+ @param points X-spline points.
+ @param np Number of x-spline points.
+ @param dist Distance to endpoint.
+ @param prec Precision.
+ @param fslc Cache for full segment lengths.
+ @param dir End-point type: 0=end of spline, 1=start of spline.
+ @param cb Flag: Compatibility with spline bug.
+ @param ec Pointer to error code variable.
+ @return Non-negative value on success, negative value on error.
+*/
+double
+dk3xsp_get_t_for_distance_bisection(
+ dk3_fig_spline_point_t const *points,
+ size_t np,
+ double dist,
+ double prec,
+ double *fslc,
+ int dir,
+ int cb,
+ int *ec
+);
+
/** Calculate t value for given distance to end point.
@param points X-spline points.
@param np Number of x-spline points.
@@ -266,13 +291,13 @@ $!trace-include
+
$*
Basic X-spline functions.
$*
-$!trace-off
@@ -799,10 +824,6 @@ dk3xsp_is_null(double s)
-$!trace-on
-
-
-
/** Convert long to double.
@param l Long value to convert.
@return Conversion result.
@@ -897,10 +918,11 @@ dk3xsp_segment_length(
if(fabs(passres - lastpassres) < prec) { $? ". success"
mc = 0; /* Finished successfully. */
back = passres;
+ $? ". stopped at %lu segments", segs
} else { $? ". diff = %lg", fabs(passres - lastpassres)
lastpassres = passres;
segs = segs * 2L;
- if(segs > DK3XSP_MAX_ITERATION_SEGMENTS) { $? ". too many passes"
+ if(segs > DK3XSP_MAX_ITERATION_SEGMENTS) { $? "! too many passes"
cc = 0;
if(ec) { *ec = DK3_ERROR_ITERATION; }
}
@@ -1430,7 +1452,7 @@ dk3xsp_open_spline_partial_length(
double
-dk3xsp_get_t_for_distance(
+dk3xsp_get_t_for_distance_bisection(
dk3_fig_spline_point_t const *points,
size_t np,
double dist,
@@ -1527,6 +1549,175 @@ dk3xsp_get_t_for_distance(
+#if DK3_HAVE_ISFINITE
+#define MY_ISFINITE(x) (isfinite(x))
+#else
+#if DK3_HAVE__FINITE
+#define MY_ISFINITE(x) (_finite(x))
+#else
+#define MY_ISFINITE(x) (1)
+#endif
+#endif
+
+#if DK3_HAVE_ISLESS
+#define MY_ISLESS(a,b) (isless((a),(b)))
+#else
+#define MY_ISLESS(a,b) (((MY_ISFINITE(a)) && (MY_ISFINITE(b))) && ((a) < (b)))
+#endif
+
+
+static
+double
+dk3xsp_gamma(double fg, double fx)
+{
+ double back;
+ back = 1.0 - fx / fg;
+ if (!(MY_ISFINITE(back))) {
+ back = 0.5;
+ } else {
+ if (0.0 >= back) {
+ back = 0.5;
+ } else {
+ if (1.0 < back) {
+ back = 1.0;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+double
+dk3xsp_get_t_for_distance(
+ dk3_fig_spline_point_t const *points,
+ size_t np,
+ double dist,
+ double prec,
+ double *fslc,
+ int dir,
+ int cb,
+ int *ec
+)
+{
+ double back = -1.0;
+ double x = 0.0;
+ double xo;
+ double a;
+ double b;
+ double ya;
+ double yb;
+ double yx;
+ double fprec;
+ double l;
+ double gamma;
+ unsigned long passno = 0UL;
+ int ls = 0;
+ int mec = 0;
+ int cc = 1;
+ $? "+ dk3xsp_get_t_for_distance"
+ fprec = prec / 8.0;
+ if((points) && (1 < np) && (prec > 0.0) && (dist >= 0.0)) {
+ l = dk3xsp_open_spline_length(points, np, fprec, fslc, cb, &mec);
+ if ((l > dist) && (0 == mec)) {
+ a = 0.0;
+ b = (double)(np - 1);
+ if(dir) {
+ ya = 0.0 - dist;
+ yb = dk3ma_d_sub_ok(l, dist, &mec);
+ } else {
+ ya = dk3ma_d_sub_ok(l, dist, &mec);
+ yb = 0.0 - dist;
+ }
+ if (0 == mec) {
+ while (1 == cc) {
+ $? ". begin pass %lu", passno
+ $? ". a = %lg ya = %lg", a, ya
+ $? ". b = %lg yb = %lg", b, yb
+ xo = x;
+ x = (a * yb - b * ya) / (yb - ya);
+ $? ". x = %lg", x
+ if (MY_ISFINITE(x)) {
+ yx = dk3ma_d_sub_ok(
+ dk3xsp_open_spline_partial_length(
+ points, np, fprec, x, fslc, dir, cb, ec
+ ), dist, &mec
+ );
+ $? ". yx = %lg", yx
+ if (MY_ISFINITE(yx)) {
+ if ((passno > 0UL) && (MY_ISLESS((x-xo),prec)) && (fabs(yx) < prec))
+ {
+ cc = 0; $? ". SUCCESS"
+ back = x;
+ }
+ else
+ {
+ if (passno >= 1000UL) { $? "! too many passes"
+ cc = -1;
+ /* ##### ERROR: TOO MANY PASSES */
+ } else {
+ if (dir) {
+ if (yx > 0.0) { $? ". new b"
+ if (1 == ls) { $? ". b multiple times"
+ gamma = dk3xsp_gamma(yb, yx);
+ ya *= gamma;
+ }
+ b = x; yb = yx;
+ ls = 1;
+ } else { $? ". new a"
+ if (-1 == ls) { $? ". a multiple times"
+ gamma = dk3xsp_gamma(ya, yx);
+ yb *= gamma;
+ }
+ a = x; ya = yx;
+ ls = -1;
+ }
+ } else {
+ if (yx > 0.0) { $? ". new a"
+ if (-1 == ls) { $? ". a multiple times"
+ gamma = dk3xsp_gamma(ya, yx);
+ yb *= gamma;
+ }
+ a = x; ya = yx;
+ ls = -1;
+ } else { $? ". new b"
+ if (1 == ls) { $? ". b multiple times"
+ gamma = dk3xsp_gamma(yb, yx);
+ ya *= gamma;
+ }
+ b = x; yb = yx;
+ ls = 1;
+ }
+ }
+ }
+ }
+ } else { $? "! math error"
+ cc = -1;
+ /* ##### MATH ERROR */
+ }
+ } else { $? "! math error"
+ cc = -1;
+ /* ##### MATH ERROR */
+ }
+ if (ULONG_MAX > passno) { passno++; }
+ }
+ } else { $? "! math error"
+ /* ##### ERROR: Math error */
+ }
+ } else { $? "! arguments"
+ if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
+ }
+ } else { $? "! arguments"
+ if(ec) { *ec = DK3_ERROR_INVALID_ARGS; }
+ }
+ $? "- dk3xsp_get_t_for_distance %lg", back
+ return back;
+}
+
+
+$!trace-off
+
+
double
dk3xsp_direction(
dk3_fig_spline_point_t const *points,
diff --git a/support/dktools/dk3xsp.h b/support/dktools/dk3xsp.h
index 0b87888137..643c9aab5b 100644
--- a/support/dktools/dk3xsp.h
+++ b/support/dktools/dk3xsp.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk3xsp.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk3xsp.ctr
*/
/** @file dk3xsp.h Header file for the dk3xsp module.
@@ -199,6 +177,31 @@ dk3xsp_open_spline_partial_length(
int *ec
);
+/** Calculate t value for given distance to end point,
+ use bisection iteration (typically slowlier than
+ Anderson-Bjoerck variant of regula falsi).
+ @param points X-spline points.
+ @param np Number of x-spline points.
+ @param dist Distance to endpoint.
+ @param prec Precision.
+ @param fslc Cache for full segment lengths.
+ @param dir End-point type: 0=end of spline, 1=start of spline.
+ @param cb Flag: Compatibility with spline bug.
+ @param ec Pointer to error code variable.
+ @return Non-negative value on success, negative value on error.
+*/
+double
+dk3xsp_get_t_for_distance_bisection(
+ dk3_fig_spline_point_t const *points,
+ size_t np,
+ double dist,
+ double prec,
+ double *fslc,
+ int dir,
+ int cb,
+ int *ec
+);
+
/** Calculate t value for given distance to end point.
@param points X-spline points.
@param np Number of x-spline points.
diff --git a/support/dktools/dk4.dox b/support/dktools/dk4.dox
index 18f4a8fb9d..7b3d9c6879 100644
--- a/support/dktools/dk4.dox
+++ b/support/dktools/dk4.dox
@@ -35,14 +35,15 @@ These libraries convert integer and double numbers to text and vice versa.
Data types char, wchar_t and dkChar are supported, use either decimal
or hexadecimal notation.
-Data type | Notation | Library
-:-------: | :------: | :-----:
+Character type | Notation | Library
+:------------: | :------: | :-----:
char | decimal | @ref libdk4maio8d
char | hexadecimal | @ref libdk4maio8h
wchar_t | decimal | @ref libdk4maiowd
wchar_t | hexadecimal | @ref libdk4maiowh
dkChar | decimal | @ref libdk4maiodd
dkChar | hexadecimal | @ref libdk4maiodh
+wxChar | decimal | @ref libdk4maioxd
@section seclibdk4c libdk4c
@@ -88,27 +89,45 @@ The @ref libdk4dbi library provides a generic
interface to Berkeley DB, NDBM and in-memory databases and allows
to store text in these databases.
-
-@section seclibdk4mdrnd libdk4mdrnd
-
-The @ref libdk4mdrnd library generates message digests and random
-numbers.
-
@section seclibdk4sock libdk4sock
The @ref libdk4sock library contains functions for socket operations
both for networking and local UNIX domain sockets.
-@section seclibdk4app libdk4app
+@section seclibdk4bif libdk4bif
-The @ref libdk4app library provides some equivalents for libdk4c functions
-with included localized diagnostics and other application support.
+The @ref libdk4bif library provides a unique API to read PNG, JPEG, NetPBM
+and tiff images hiding the details of libpng, libjpeg and libtiff.
+Additionally there are functions to convert pixels to other color spaces
+and functions to resample pixels (change the number of bits per component).
+
+@section seclibdk4gra libdk4gra
+
+The @ref libdk4gra library creates PDF, (E)PS and PGF graphics.
+For PDF, PS and EPS it provides only non-text operations, for PGF output
+text operations are available.
@section seclibdk4lab libdk4lat
The @ref libdk4lat library contains code to
find LaTeX representations for 32 bit characters.
+@section seclibdk4pppt libdk4pppt
+
+The libdk4pppt library creates file pairs PDF+TeX, (E)PS+TeX, or TeX
+files. The libdk4gra library is used to place non-text graphics elements
+in the PDF, (E)PS and TeX files, text labels are placed in the TeX files.
+
+@section seclibdk4mdrnd libdk4mdrnd
+
+The @ref libdk4mdrnd library generates message digests and random
+numbers.
+
+@section seclibdk4app libdk4app
+
+The @ref libdk4app library provides some equivalents for libdk4c functions
+with included localized diagnostics and other application support.
+
@section seclibdk4dbia libdk4dbia
The @ref libdk4dbia provides some equivalents for libdk4dbi functions with
@@ -119,6 +138,30 @@ included localized diagnostics.
The @ref libdk4socka library provides some equivalents for libdk4sock functions
with included localized diagnostics.
+@section seclibdk4bifa libdk4bifa
+
+The libdk4bifap library provides some replacement functions for
+libdk4bif functions containing dk4_app_t support, so the functions
+can write diagnostic messages when an error occurs.
+
+@section seclibdk4graa libdk4graa
+
+The libdk4graa library provides some replacement functions for
+libdk4gra functions containing dk4_app_t support, so the functions
+can write diagnostic messages when an error occurs.
+
+@section seclibdk4lata libdk4lata
+
+The libdk4lata library provides some replacement functions for
+libdk4lat functions containing dk4_app_t support, so the functions
+can write diagnostic messages when an error occurs.
+
+@section seclibdk4pppta libdk4pppta
+
+The libdk4pppta library provides some replacement functions for
+libdk4lat functions containing dk4_app_t support, so the functions
+can write diagnostic messages when an error occurs.
+
@section seclibdk4wx libdk4wx
The @ref libdk4wx library provides helper classes to build
diff --git a/support/dktools/dk4.h b/support/dktools/dk4.h
index 2e8f26d3b5..c08f7c06dd 100644
--- a/support/dktools/dk4.h
+++ b/support/dktools/dk4.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4_H_INCLUDED
#define DK4_H_INCLUDED 1
@@ -5,11 +10,19 @@
*/
#ifndef DK4CONF_H_INCLUDED
-#include <dk4conf.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
-#include <dk4types.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#endif
diff --git a/support/dktools/dk4a85d.c b/support/dktools/dk4a85d.c
index 611255b73f..7bf7e1999b 100644
--- a/support/dktools/dk4a85d.c
+++ b/support/dktools/dk4a85d.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4a85d.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4a85d.ctr
*/
/** @file dk4a85d.c The dk4a85d module.
*/
-#line 119 "dk4a85d.ctr"
+#line 137 "dk4a85d.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4a85d.h"
#include "dk4mem.h"
@@ -47,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 127 "dk4a85d.ctr"
+#line 154 "dk4a85d.ctr"
@@ -65,6 +52,9 @@ static const unsigned long dk4a85e_pow_85[] = {
void
dk4a85_dec_init(dk4_a85_dec_t *dec, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
DK4_MEMRES(dec, sizeof(dk4_a85_dec_t));
dec->os = 0;
@@ -82,6 +72,9 @@ dk4a85_dec_add(dk4_a85_dec_t *dec, char input, dk4_er_t *erp)
{
unsigned long val;
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
if (0 != dec->tf) {
if ('>' == input) {
@@ -191,7 +184,10 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
int back = DK4_EDSTM_ERROR;
-#line 269 "dk4a85d.ctr"
+#line 302 "dk4a85d.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
if (0 == dec->is) {
back = DK4_EDSTM_ACCEPT;
@@ -199,7 +195,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
switch (dec->is) {
case 4: {
-#line 275 "dk4a85d.ctr"
+#line 311 "dk4a85d.ctr"
/* Calculate 32 bit value from encoded values.
*/
val =
@@ -217,7 +213,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
;
-#line 291 "dk4a85d.ctr"
+#line 327 "dk4a85d.ctr"
/* Check whether truncation of a5 modified the 32 bit
value, correct least significant used byte if necessary.
*/
@@ -228,7 +224,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
*/
-#line 300 "dk4a85d.ctr"
+#line 336 "dk4a85d.ctr"
dec->ob[0] = (unsigned char)((val >> 24) & 0xFFUL);
dec->ob[1] = (unsigned char)((val >> 16) & 0xFFUL);
dec->ob[2] = (unsigned char)((val >> 8) & 0xFFUL);
@@ -240,7 +236,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
} break;
case 3: {
-#line 310 "dk4a85d.ctr"
+#line 346 "dk4a85d.ctr"
/* Calculate 32 bit value from encoded values.
*/
val =
@@ -255,7 +251,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
;
-#line 323 "dk4a85d.ctr"
+#line 359 "dk4a85d.ctr"
/* Check whether truncation of a4 and a5 modified the 32 bit
value, correct least significant used byte if necessary.
*/
@@ -264,7 +260,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
}
-#line 330 "dk4a85d.ctr"
+#line 366 "dk4a85d.ctr"
/* Split 32 bit value into bytes.
*/
dec->ob[0] = (unsigned char)((val >> 24) & 0xFFUL);
@@ -277,7 +273,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
} break;
case 2: {
-#line 341 "dk4a85d.ctr"
+#line 377 "dk4a85d.ctr"
/* Calculate 32 bit value from encoded values.
*/
val =
@@ -289,7 +285,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
;
-#line 351 "dk4a85d.ctr"
+#line 387 "dk4a85d.ctr"
/* Check whether truncation of a3, a4, and a5 modified the 32 bit
value, correct least significant used byte if necessary.
*/
@@ -298,7 +294,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
}
-#line 358 "dk4a85d.ctr"
+#line 394 "dk4a85d.ctr"
/* Split 32 bit value into bytes.
*/
dec->ob[0] = (unsigned char)((val >> 24) & 0xFFUL);
@@ -317,7 +313,7 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 375 "dk4a85d.ctr"
+#line 411 "dk4a85d.ctr"
return back;
}
@@ -325,10 +321,18 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
int
dk4a85_dec_output(
- const unsigned char **dptr, size_t *szptr, dk4_a85_dec_t *dec, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_a85_dec_t const *dec,
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+#endif
if ((NULL != dec) && (NULL != dptr) && (NULL != szptr)) {
if (0 < dec->os) {
*dptr = &(dec->ob[0]);
diff --git a/support/dktools/dk4a85d.ctr b/support/dktools/dk4a85d.ctr
index ac17417f27..cf64aefc44 100644
--- a/support/dktools/dk4a85d.ctr
+++ b/support/dktools/dk4a85d.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -34,8 +34,23 @@ DK4_EDSTM_STOP from dk4a85_dec_add(), the call to dk4a85_dec_finish()
is required.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
/** ASCII 85 decoder.
*/
@@ -105,7 +120,10 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp);
*/
int
dk4a85_dec_output(
- const unsigned char **dptr, size_t *szptr, dk4_a85_dec_t *dec, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_a85_dec_t const *dec,
+ dk4_er_t *erp
);
@@ -117,6 +135,15 @@ dk4a85_dec_output(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4a85d.h"
#include "dk4mem.h"
#include "dk4edstm.h"
@@ -141,6 +168,9 @@ static const unsigned long dk4a85e_pow_85[] = {
void
dk4a85_dec_init(dk4_a85_dec_t *dec, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
DK4_MEMRES(dec, sizeof(dk4_a85_dec_t));
dec->os = 0;
@@ -158,6 +188,9 @@ dk4a85_dec_add(dk4_a85_dec_t *dec, char input, dk4_er_t *erp)
{
unsigned long val;
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
if (0 != dec->tf) {
if ('>' == input) {
@@ -266,6 +299,9 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
unsigned long val; /* 32 bit value */
int back = DK4_EDSTM_ERROR;
$? "+ dk4a85_dec_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
if (0 == dec->is) {
back = DK4_EDSTM_ACCEPT;
@@ -379,10 +415,18 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp)
int
dk4a85_dec_output(
- const unsigned char **dptr, size_t *szptr, dk4_a85_dec_t *dec, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_a85_dec_t const *dec,
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+#endif
if ((NULL != dec) && (NULL != dptr) && (NULL != szptr)) {
if (0 < dec->os) {
*dptr = &(dec->ob[0]);
diff --git a/support/dktools/dk4a85d.h b/support/dktools/dk4a85d.h
index 0ab7ceadf9..ca249cf674 100644
--- a/support/dktools/dk4a85d.h
+++ b/support/dktools/dk4a85d.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4a85d.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4a85d.ctr
*/
#ifndef DK4A85D_H_INCLUDED
@@ -66,8 +44,23 @@ DK4_EDSTM_STOP from dk4a85_dec_add(), the call to dk4a85_dec_finish()
is required.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
/** ASCII 85 decoder.
*/
@@ -137,7 +130,10 @@ dk4a85_dec_finish(dk4_a85_dec_t *dec, dk4_er_t *erp);
*/
int
dk4a85_dec_output(
- const unsigned char **dptr, size_t *szptr, dk4_a85_dec_t *dec, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_a85_dec_t const *dec,
+ dk4_er_t *erp
);
diff --git a/support/dktools/dk4a85e.c b/support/dktools/dk4a85e.c
index 93580db8a7..abe2a5ddfd 100644
--- a/support/dktools/dk4a85e.c
+++ b/support/dktools/dk4a85e.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4a85e.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4a85e.ctr
*/
/** @file dk4a85e.c The dk4a85e module.
*/
-#line 127 "dk4a85e.ctr"
+#line 150 "dk4a85e.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4a85e.h"
#include "dk4edstm.h"
@@ -47,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 135 "dk4a85e.ctr"
+#line 167 "dk4a85e.ctr"
@@ -63,6 +50,9 @@ static const unsigned long dk4a85e_pow_85[] = {
void
dk4a85_enc_init(dk4_a85_enc_t *enc, int az, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
DK4_MEMRES(enc, sizeof(dk4_a85_enc_t));
enc->ob[5] = '\0';
@@ -82,6 +72,9 @@ dk4a85_enc_add(dk4_a85_enc_t *enc, unsigned char input, dk4_er_t *erp)
unsigned long val;
unsigned long v1;
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
back = DK4_EDSTM_ACCEPT;
enc->ib[enc->ci] = input;
@@ -130,7 +123,10 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp)
int back = DK4_EDSTM_ERROR;
-#line 216 "dk4a85e.ctr"
+#line 254 "dk4a85e.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
if (0 == enc->ci) {
back = DK4_EDSTM_ACCEPT;
@@ -141,97 +137,97 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp)
case 1: {
-#line 225 "dk4a85e.ctr"
+#line 266 "dk4a85e.ctr"
back = DK4_EDSTM_FINISHED;
val = (((unsigned long)(enc->ib[0]) << 24) & 0xFF000000UL);
-#line 228 "dk4a85e.ctr"
+#line 269 "dk4a85e.ctr"
v1 = val / dk4a85e_pow_85[0];
enc->ob[0] = (char)33 + (char)v1;
-#line 231 "dk4a85e.ctr"
+#line 272 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[0];
v1 = val / dk4a85e_pow_85[1];
enc->ob[1] = (char)33 + (char)v1;
-#line 235 "dk4a85e.ctr"
+#line 276 "dk4a85e.ctr"
enc->os = 2;
enc->ci = 0;
} break;
case 2: {
-#line 240 "dk4a85e.ctr"
+#line 281 "dk4a85e.ctr"
back = DK4_EDSTM_FINISHED;
val = (((unsigned long)(enc->ib[0]) << 24) & 0xFF000000UL)
| (((unsigned long)(enc->ib[1]) << 16) & 0x00FF0000UL);
-#line 244 "dk4a85e.ctr"
+#line 285 "dk4a85e.ctr"
v1 = val / dk4a85e_pow_85[0];
enc->ob[0] = (char)33 + (char)v1;
-#line 247 "dk4a85e.ctr"
+#line 288 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[0];
v1 = val / dk4a85e_pow_85[1];
enc->ob[1] = (char)33 + (char)v1;
-#line 251 "dk4a85e.ctr"
+#line 292 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[1];
v1 = val / dk4a85e_pow_85[2];
enc->ob[2] = (char)33 + (char)v1;
-#line 255 "dk4a85e.ctr"
+#line 296 "dk4a85e.ctr"
enc->os = 3;
enc->ci = 0;
} break;
case 3: {
-#line 260 "dk4a85e.ctr"
+#line 301 "dk4a85e.ctr"
back = DK4_EDSTM_FINISHED;
val = (((unsigned long)(enc->ib[0]) << 24) & 0xFF000000UL)
| (((unsigned long)(enc->ib[1]) << 16) & 0x00FF0000UL)
| (((unsigned long)(enc->ib[2]) << 8) & 0x0000FF00UL);
-#line 265 "dk4a85e.ctr"
+#line 306 "dk4a85e.ctr"
v1 = val / dk4a85e_pow_85[0];
enc->ob[0] = (char)33 + (char)v1;
-#line 268 "dk4a85e.ctr"
+#line 309 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[0];
v1 = val / dk4a85e_pow_85[1];
enc->ob[1] = (char)33 + (char)v1;
-#line 272 "dk4a85e.ctr"
+#line 313 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[1];
v1 = val / dk4a85e_pow_85[2];
enc->ob[2] = (char)33 + (char)v1;
-#line 276 "dk4a85e.ctr"
+#line 317 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[2];
v1 = val / dk4a85e_pow_85[3];
enc->ob[3] = (char)33 + (char)v1;
-#line 280 "dk4a85e.ctr"
+#line 321 "dk4a85e.ctr"
enc->os = 4;
enc->ci = 0;
} break;
default: {
-#line 285 "dk4a85e.ctr"
+#line 326 "dk4a85e.ctr"
back = DK4_EDSTM_FINISHED;
val = (((unsigned long)(enc->ib[0]) << 24) & 0xFF000000UL)
| (((unsigned long)(enc->ib[1]) << 16) & 0x00FF0000UL)
@@ -239,7 +235,7 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp)
| (((unsigned long)(enc->ib[3]) ) & 0x000000FFUL);
-#line 291 "dk4a85e.ctr"
+#line 332 "dk4a85e.ctr"
if ((0UL == val) && (0 != enc->az)) {
enc->ob[0] = 'z';
enc->ob[1] = '\0';
@@ -249,30 +245,30 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp)
enc->ob[0] = (char)33 + (char)v1;
-#line 299 "dk4a85e.ctr"
+#line 340 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[0];
v1 = val / dk4a85e_pow_85[1];
enc->ob[1] = (char)33 + (char)v1;
-#line 303 "dk4a85e.ctr"
+#line 344 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[1];
v1 = val / dk4a85e_pow_85[2];
enc->ob[2] = (char)33 + (char)v1;
-#line 307 "dk4a85e.ctr"
+#line 348 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[2];
v1 = val / dk4a85e_pow_85[3];
enc->ob[3] = (char)33 + (char)v1;
-#line 311 "dk4a85e.ctr"
+#line 352 "dk4a85e.ctr"
val = val % dk4a85e_pow_85[3];
enc->ob[4] = (char)33 + (char)val;
-#line 314 "dk4a85e.ctr"
+#line 355 "dk4a85e.ctr"
enc->os = 5;
}
enc->ci = 0;
@@ -283,7 +279,7 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 323 "dk4a85e.ctr"
+#line 364 "dk4a85e.ctr"
return back;
}
@@ -291,10 +287,18 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp)
int
dk4a85_enc_output(
- const char **dptr, size_t *szptr, dk4_a85_enc_t *enc, dk4_er_t *erp
+ const char **dptr,
+ size_t *szptr,
+ dk4_a85_enc_t const *enc,
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+#endif
if ((NULL != dptr) && (NULL != szptr) && (NULL != enc)) {
*dptr = &(enc->ob[0]);
*szptr = enc->os;
diff --git a/support/dktools/dk4a85e.ctr b/support/dktools/dk4a85e.ctr
index 82421cc1d8..f3e26669e5 100644
--- a/support/dktools/dk4a85e.ctr
+++ b/support/dktools/dk4a85e.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -31,9 +31,29 @@ dk4a85_enc_output() to obtain the text characters for the final bytes.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4EDSTM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4edstm.h"
+#else
+#include <dktools-4/dk4edstm.h>
+#endif
+#endif
@@ -116,7 +136,10 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp);
*/
int
dk4a85_enc_output(
- const char **dptr, size_t *szptr, dk4_a85_enc_t *enc, dk4_er_t *erp
+ const char **dptr,
+ size_t *szptr,
+ dk4_a85_enc_t const *enc,
+ dk4_er_t *erp
);
#ifdef __cplusplus
@@ -125,6 +148,15 @@ dk4a85_enc_output(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4a85e.h"
#include "dk4edstm.h"
#include "dk4mem.h"
@@ -147,6 +179,9 @@ static const unsigned long dk4a85e_pow_85[] = {
void
dk4a85_enc_init(dk4_a85_enc_t *enc, int az, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
DK4_MEMRES(enc, sizeof(dk4_a85_enc_t));
enc->ob[5] = '\0';
@@ -166,6 +201,9 @@ dk4a85_enc_add(dk4_a85_enc_t *enc, unsigned char input, dk4_er_t *erp)
unsigned long val;
unsigned long v1;
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
back = DK4_EDSTM_ACCEPT;
enc->ib[enc->ci] = input;
@@ -213,6 +251,9 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp)
unsigned long v1;
int back = DK4_EDSTM_ERROR;
$? "+ dk4a85_enc_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
if (0 == enc->ci) {
back = DK4_EDSTM_ACCEPT;
@@ -327,10 +368,18 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp)
int
dk4a85_enc_output(
- const char **dptr, size_t *szptr, dk4_a85_enc_t *enc, dk4_er_t *erp
+ const char **dptr,
+ size_t *szptr,
+ dk4_a85_enc_t const *enc,
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+#endif
if ((NULL != dptr) && (NULL != szptr) && (NULL != enc)) {
*dptr = &(enc->ob[0]);
*szptr = enc->os;
diff --git a/support/dktools/dk4a85e.h b/support/dktools/dk4a85e.h
index 372a0d1ad6..f35feaea27 100644
--- a/support/dktools/dk4a85e.h
+++ b/support/dktools/dk4a85e.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4a85e.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4a85e.ctr
*/
#ifndef DK4A85E_H_INCLUDED
@@ -63,9 +41,29 @@ dk4a85_enc_output() to obtain the text characters for the final bytes.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4EDSTM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4edstm.h"
+#else
+#include <dktools-4/dk4edstm.h>
+#endif
+#endif
@@ -148,7 +146,10 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp);
*/
int
dk4a85_enc_output(
- const char **dptr, size_t *szptr, dk4_a85_enc_t *enc, dk4_er_t *erp
+ const char **dptr,
+ size_t *szptr,
+ dk4_a85_enc_t const *enc,
+ dk4_er_t *erp
);
#ifdef __cplusplus
diff --git a/support/dktools/dk4ahd.c b/support/dktools/dk4ahd.c
index d3684e16af..060b25384b 100644
--- a/support/dktools/dk4ahd.c
+++ b/support/dktools/dk4ahd.c
@@ -1,44 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ahd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ahd.ctr
*/
/** @file dk4ahd.c The dk4ahd module.
*/
-#line 102 "dk4ahd.ctr"
+#line 118 "dk4ahd.ctr"
+
+#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4ahd.h"
#include "dk4mem.h"
@@ -48,13 +34,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 111 "dk4ahd.ctr"
+#line 135 "dk4ahd.ctr"
void
dk4ahex_dec_init(dk4_ahex_dec_t *dec, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
DK4_MEMRES(dec, sizeof(dk4_ahex_dec_t));
dec->cpos = 0;
@@ -70,6 +59,9 @@ int
dk4ahex_dec_add(dk4_ahex_dec_t *dec, char tc, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
switch (tc) {
case ' ' : case '\t' : case '\r' : case '\n' : case 0x00 : case 0x0C : {
@@ -208,6 +200,9 @@ int
dk4ahex_finish(dk4_ahex_dec_t *dec, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
switch (dec->cpos) {
case 1: {
@@ -226,9 +221,12 @@ dk4ahex_finish(dk4_ahex_dec_t *dec, dk4_er_t *erp)
unsigned char
-dk4ahex_output(dk4_ahex_dec_t *dec, dk4_er_t *erp)
+dk4ahex_output(dk4_ahex_dec_t const *dec, dk4_er_t *erp)
{
unsigned char back = 0x00;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
back = dec->obyte;
} else {
diff --git a/support/dktools/dk4ahd.ctr b/support/dktools/dk4ahd.ctr
index 1fdef1ad24..59cbcada6a 100644
--- a/support/dktools/dk4ahd.ctr
+++ b/support/dktools/dk4ahd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -30,8 +30,24 @@ obtaining DK4_EDSTM_STOP from dk4ahex_dec_add().
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
/** ASCII-Hex decoder.
*/
@@ -92,7 +108,7 @@ dk4ahex_finish(dk4_ahex_dec_t *dec, dk4_er_t *erp);
@return The current byte stored in the decoder.
*/
unsigned char
-dk4ahex_output(dk4_ahex_dec_t *dec, dk4_er_t *erp);
+dk4ahex_output(dk4_ahex_dec_t const *dec, dk4_er_t *erp);
#ifdef __cplusplus
}
@@ -100,6 +116,14 @@ dk4ahex_output(dk4_ahex_dec_t *dec, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4ahd.h"
#include "dk4mem.h"
@@ -114,6 +138,9 @@ $!trace-include
void
dk4ahex_dec_init(dk4_ahex_dec_t *dec, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
DK4_MEMRES(dec, sizeof(dk4_ahex_dec_t));
dec->cpos = 0;
@@ -129,6 +156,9 @@ int
dk4ahex_dec_add(dk4_ahex_dec_t *dec, char tc, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
switch (tc) {
case ' ' : case '\t' : case '\r' : case '\n' : case 0x00 : case 0x0C : {
@@ -267,6 +297,9 @@ int
dk4ahex_finish(dk4_ahex_dec_t *dec, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
switch (dec->cpos) {
case 1: {
@@ -285,9 +318,12 @@ dk4ahex_finish(dk4_ahex_dec_t *dec, dk4_er_t *erp)
unsigned char
-dk4ahex_output(dk4_ahex_dec_t *dec, dk4_er_t *erp)
+dk4ahex_output(dk4_ahex_dec_t const *dec, dk4_er_t *erp)
{
unsigned char back = 0x00;
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
back = dec->obyte;
} else {
diff --git a/support/dktools/dk4ahd.h b/support/dktools/dk4ahd.h
index 78923cae73..e1d777db39 100644
--- a/support/dktools/dk4ahd.h
+++ b/support/dktools/dk4ahd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ahd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ahd.ctr
*/
#ifndef DK4AHD_H_INCLUDED
@@ -62,8 +40,24 @@ obtaining DK4_EDSTM_STOP from dk4ahex_dec_add().
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
/** ASCII-Hex decoder.
*/
@@ -124,7 +118,7 @@ dk4ahex_finish(dk4_ahex_dec_t *dec, dk4_er_t *erp);
@return The current byte stored in the decoder.
*/
unsigned char
-dk4ahex_output(dk4_ahex_dec_t *dec, dk4_er_t *erp);
+dk4ahex_output(dk4_ahex_dec_t const *dec, dk4_er_t *erp);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4align.h b/support/dktools/dk4align.h
index 6b8e71c5a3..1c1c03b919 100644
--- a/support/dktools/dk4align.h
+++ b/support/dktools/dk4align.h
@@ -1,50 +1,98 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4ALIGN_H_INCLUDED
/** Protection against multiple inclusions. */
#define DK4ALIGN_H_INCLUDED 1
-/** How to align an object horizontally in the available room.
+/** @file dk4align.h Definitions for horizontal and vertical
+ alignment.
+*/
+
+/** How to align a text horizontally.
+*/
+typedef enum {
+ /** Text origin is at left side of text.
+ */
+ DK4_TEXT_ALIGN_H_LEFT = 0,
+
+ /** Text origin is at center of text.
+ */
+ DK4_TEXT_ALIGN_H_CENTERED ,
+
+ /** Text origin is at right side of text.
+ */
+ DK4_TEXT_ALIGN_H_RIGHT ,
+
+} dk4_text_align_h_t;
+
+
+/** How to align a text vertically.
*/
typedef enum {
- /** Horizontal alignment: align object left in room.
- */
- DK4_ALIGN_H_LEFT = 0,
+ /** Text origin is at top of text.
+ */
+ DK4_TEXT_ALIGN_V_TOP = 0,
- /** Horizontal alignment: align object centered in room.
- */
- DK4_ALIGN_H_CENTERED ,
+ /** Text origin is at center of text.
+ */
+ DK4_TEXT_ALIGN_V_CENTERED ,
- /** Horizontal alignment: align object right in room.
- */
- DK4_ALIGN_H_RIGHT ,
+ /** Text origin is at bottom of text.
+ */
+ DK4_TEXT_ALIGN_V_BOTTOM ,
- /** Horizontal alignment: stretch object to use
- available room completely.
- */
- DK4_ALIGN_H_STRETCH
+ /** Text origin is at text base line.
+ */
+ DK4_TEXT_ALIGN_V_BASELINE
-} dk4_align_h_t;
+} dk4_text_align_v_t;
-/** How to align an object vertically in the available room.
+/** How to align an image horizontally within the available room.
*/
typedef enum {
- /** Vertical alignment: align object on top of room.
- */
- DK4_ALIGN_V_TOP = 0,
-
- /** Vertical alignment: align object centered in room.
- */
- DK4_ALIGN_V_CENTERED ,
-
- /** Vertical alignment: align object on bottom.
- */
- DK4_ALIGN_V_BOTTOM ,
-
- /** Vertical alignment: stretch object to use available
- room completely.
- */
- DK4_ALIGN_V_STRETCH
-} dk4_align_v_t;
+ /** Place image on the left.
+ */
+ DK4_IMAGE_ALIGN_H_LEFT = DK4_TEXT_ALIGN_H_LEFT ,
+
+ /** Place image centered.
+ */
+ DK4_IMAGE_ALIGN_H_CENTERED = DK4_TEXT_ALIGN_H_CENTERED ,
+
+ /** Place image on the right.
+ */
+ DK4_IMAGE_ALIGN_H_RIGHT = DK4_TEXT_ALIGN_H_RIGHT ,
+
+ /** Stretch image to use room completely.
+ */
+ DK4_IMAGE_ALIGN_H_STRETCH = (DK4_IMAGE_ALIGN_H_RIGHT + 1)
+
+} dk4_image_align_h_t;
+
+
+/** How to align an image vertically in the available room.
+*/
+typedef enum {
+ /** Place image on top.
+ */
+ DK4_IMAGE_ALIGN_V_TOP = DK4_TEXT_ALIGN_V_TOP ,
+
+ /** Place image centered.
+ */
+ DK4_IMAGE_ALIGN_V_CENTERED = DK4_TEXT_ALIGN_V_CENTERED ,
+
+ /** Place image on bottom.
+ */
+ DK4_IMAGE_ALIGN_V_BOTTOM = DK4_TEXT_ALIGN_V_BOTTOM ,
+
+ /** Stretch image to fill room.
+ */
+ DK4_IMAGE_ALIGN_V_STRETCH = DK4_TEXT_ALIGN_V_BASELINE
+
+} dk4_image_align_v_t;
/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4ansi.c b/support/dktools/dk4ansi.c
index 436d16a98e..9da0eb8023 100644
--- a/support/dktools/dk4ansi.c
+++ b/support/dktools/dk4ansi.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ansi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ansi.ctr
*/
/** @file dk4ansi.c The dk4ansi module.
*/
-#line 57 "dk4ansi.ctr"
+#line 69 "dk4ansi.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4ansi.h"
#include "dk4numco.h"
@@ -47,12 +34,15 @@ int
dk4ansi_encode(unsigned char *dptr, dk4_c32_t c32)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
- if ((dk4_c32_t)0x80 > c32) {
+ if (dkC32(0x80) > c32) {
*dptr = (unsigned char)c32;
back = 1;
} else {
- if (((dk4_c32_t)0x9F < c32) && ((dk4_c32_t)0x0100 > c32)) {
+ if ((dkC32(0x9F) < c32) && (dkC32(0x0100) > c32)) {
*dptr = (unsigned char)c32;
back = 1;
} else {
@@ -104,6 +94,9 @@ int
dk4ansi_decode(dk4_c32_t *dptr, unsigned char uc)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0x80 > uc) {
*dptr = (dk4_c32_t)uc;
@@ -114,38 +107,38 @@ dk4ansi_decode(dk4_c32_t *dptr, unsigned char uc)
back = 1;
} else {
switch ((int)uc) {
- case 0x80: { *dptr = (dk4_c32_t)0x20AC; back = 1; } break;
- case 0x81: { *dptr = (dk4_c32_t)0x0081; back = 1; } break;
- case 0x82: { *dptr = (dk4_c32_t)0x201A; back = 1; } break;
- case 0x83: { *dptr = (dk4_c32_t)0x0192; back = 1; } break;
- case 0x84: { *dptr = (dk4_c32_t)0x201E; back = 1; } break;
- case 0x85: { *dptr = (dk4_c32_t)0x2026; back = 1; } break;
- case 0x86: { *dptr = (dk4_c32_t)0x2020; back = 1; } break;
- case 0x87: { *dptr = (dk4_c32_t)0x2021; back = 1; } break;
- case 0x88: { *dptr = (dk4_c32_t)0x02C6; back = 1; } break;
- case 0x89: { *dptr = (dk4_c32_t)0x2030; back = 1; } break;
- case 0x8A: { *dptr = (dk4_c32_t)0x0160; back = 1; } break;
- case 0x8B: { *dptr = (dk4_c32_t)0x2039; back = 1; } break;
- case 0x8C: { *dptr = (dk4_c32_t)0x0152; back = 1; } break;
- case 0x8D: { *dptr = (dk4_c32_t)0x008D; back = 1; } break;
- case 0x8E: { *dptr = (dk4_c32_t)0x017D; back = 1; } break;
- case 0x8F: { *dptr = (dk4_c32_t)0x008F; back = 1; } break;
- case 0x90: { *dptr = (dk4_c32_t)0x0090; back = 1; } break;
- case 0x91: { *dptr = (dk4_c32_t)0x2018; back = 1; } break;
- case 0x92: { *dptr = (dk4_c32_t)0x2019; back = 1; } break;
- case 0x93: { *dptr = (dk4_c32_t)0x201C; back = 1; } break;
- case 0x94: { *dptr = (dk4_c32_t)0x201D; back = 1; } break;
- case 0x95: { *dptr = (dk4_c32_t)0x2022; back = 1; } break;
- case 0x96: { *dptr = (dk4_c32_t)0x2013; back = 1; } break;
- case 0x97: { *dptr = (dk4_c32_t)0x2014; back = 1; } break;
- case 0x98: { *dptr = (dk4_c32_t)0x02DC; back = 1; } break;
- case 0x99: { *dptr = (dk4_c32_t)0x2122; back = 1; } break;
- case 0x9A: { *dptr = (dk4_c32_t)0x0161; back = 1; } break;
- case 0x9B: { *dptr = (dk4_c32_t)0x203A; back = 1; } break;
- case 0x9C: { *dptr = (dk4_c32_t)0x0153; back = 1; } break;
- case 0x9D: { *dptr = (dk4_c32_t)0x009D; back = 1; } break;
- case 0x9E: { *dptr = (dk4_c32_t)0x017E; back = 1; } break;
- case 0x9F: { *dptr = (dk4_c32_t)0x0178; back = 1; } break;
+ case 0x80: { *dptr = dkC32(0x20AC); back = 1; } break;
+ case 0x81: { *dptr = dkC32(0x0081); back = 1; } break;
+ case 0x82: { *dptr = dkC32(0x201A); back = 1; } break;
+ case 0x83: { *dptr = dkC32(0x0192); back = 1; } break;
+ case 0x84: { *dptr = dkC32(0x201E); back = 1; } break;
+ case 0x85: { *dptr = dkC32(0x2026); back = 1; } break;
+ case 0x86: { *dptr = dkC32(0x2020); back = 1; } break;
+ case 0x87: { *dptr = dkC32(0x2021); back = 1; } break;
+ case 0x88: { *dptr = dkC32(0x02C6); back = 1; } break;
+ case 0x89: { *dptr = dkC32(0x2030); back = 1; } break;
+ case 0x8A: { *dptr = dkC32(0x0160); back = 1; } break;
+ case 0x8B: { *dptr = dkC32(0x2039); back = 1; } break;
+ case 0x8C: { *dptr = dkC32(0x0152); back = 1; } break;
+ case 0x8D: { *dptr = dkC32(0x008D); back = 1; } break;
+ case 0x8E: { *dptr = dkC32(0x017D); back = 1; } break;
+ case 0x8F: { *dptr = dkC32(0x008F); back = 1; } break;
+ case 0x90: { *dptr = dkC32(0x0090); back = 1; } break;
+ case 0x91: { *dptr = dkC32(0x2018); back = 1; } break;
+ case 0x92: { *dptr = dkC32(0x2019); back = 1; } break;
+ case 0x93: { *dptr = dkC32(0x201C); back = 1; } break;
+ case 0x94: { *dptr = dkC32(0x201D); back = 1; } break;
+ case 0x95: { *dptr = dkC32(0x2022); back = 1; } break;
+ case 0x96: { *dptr = dkC32(0x2013); back = 1; } break;
+ case 0x97: { *dptr = dkC32(0x2014); back = 1; } break;
+ case 0x98: { *dptr = dkC32(0x02DC); back = 1; } break;
+ case 0x99: { *dptr = dkC32(0x2122); back = 1; } break;
+ case 0x9A: { *dptr = dkC32(0x0161); back = 1; } break;
+ case 0x9B: { *dptr = dkC32(0x203A); back = 1; } break;
+ case 0x9C: { *dptr = dkC32(0x0153); back = 1; } break;
+ case 0x9D: { *dptr = dkC32(0x009D); back = 1; } break;
+ case 0x9E: { *dptr = dkC32(0x017E); back = 1; } break;
+ case 0x9F: { *dptr = dkC32(0x0178); back = 1; } break;
}
}
}
diff --git a/support/dktools/dk4ansi.ctr b/support/dktools/dk4ansi.ctr
index 552a5769a8..938e00b8e8 100644
--- a/support/dktools/dk4ansi.ctr
+++ b/support/dktools/dk4ansi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -55,6 +67,15 @@ dk4ansi_decode(dk4_c32_t *dptr, unsigned char uc);
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ansi.h"
#include "dk4numco.h"
@@ -63,12 +84,15 @@ int
dk4ansi_encode(unsigned char *dptr, dk4_c32_t c32)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
- if ((dk4_c32_t)0x80 > c32) {
+ if (dkC32(0x80) > c32) {
*dptr = (unsigned char)c32;
back = 1;
} else {
- if (((dk4_c32_t)0x9F < c32) && ((dk4_c32_t)0x0100 > c32)) {
+ if ((dkC32(0x9F) < c32) && (dkC32(0x0100) > c32)) {
*dptr = (unsigned char)c32;
back = 1;
} else {
@@ -120,6 +144,9 @@ int
dk4ansi_decode(dk4_c32_t *dptr, unsigned char uc)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0x80 > uc) {
*dptr = (dk4_c32_t)uc;
@@ -130,38 +157,38 @@ dk4ansi_decode(dk4_c32_t *dptr, unsigned char uc)
back = 1;
} else {
switch ((int)uc) {
- case 0x80: { *dptr = (dk4_c32_t)0x20AC; back = 1; } break;
- case 0x81: { *dptr = (dk4_c32_t)0x0081; back = 1; } break;
- case 0x82: { *dptr = (dk4_c32_t)0x201A; back = 1; } break;
- case 0x83: { *dptr = (dk4_c32_t)0x0192; back = 1; } break;
- case 0x84: { *dptr = (dk4_c32_t)0x201E; back = 1; } break;
- case 0x85: { *dptr = (dk4_c32_t)0x2026; back = 1; } break;
- case 0x86: { *dptr = (dk4_c32_t)0x2020; back = 1; } break;
- case 0x87: { *dptr = (dk4_c32_t)0x2021; back = 1; } break;
- case 0x88: { *dptr = (dk4_c32_t)0x02C6; back = 1; } break;
- case 0x89: { *dptr = (dk4_c32_t)0x2030; back = 1; } break;
- case 0x8A: { *dptr = (dk4_c32_t)0x0160; back = 1; } break;
- case 0x8B: { *dptr = (dk4_c32_t)0x2039; back = 1; } break;
- case 0x8C: { *dptr = (dk4_c32_t)0x0152; back = 1; } break;
- case 0x8D: { *dptr = (dk4_c32_t)0x008D; back = 1; } break;
- case 0x8E: { *dptr = (dk4_c32_t)0x017D; back = 1; } break;
- case 0x8F: { *dptr = (dk4_c32_t)0x008F; back = 1; } break;
- case 0x90: { *dptr = (dk4_c32_t)0x0090; back = 1; } break;
- case 0x91: { *dptr = (dk4_c32_t)0x2018; back = 1; } break;
- case 0x92: { *dptr = (dk4_c32_t)0x2019; back = 1; } break;
- case 0x93: { *dptr = (dk4_c32_t)0x201C; back = 1; } break;
- case 0x94: { *dptr = (dk4_c32_t)0x201D; back = 1; } break;
- case 0x95: { *dptr = (dk4_c32_t)0x2022; back = 1; } break;
- case 0x96: { *dptr = (dk4_c32_t)0x2013; back = 1; } break;
- case 0x97: { *dptr = (dk4_c32_t)0x2014; back = 1; } break;
- case 0x98: { *dptr = (dk4_c32_t)0x02DC; back = 1; } break;
- case 0x99: { *dptr = (dk4_c32_t)0x2122; back = 1; } break;
- case 0x9A: { *dptr = (dk4_c32_t)0x0161; back = 1; } break;
- case 0x9B: { *dptr = (dk4_c32_t)0x203A; back = 1; } break;
- case 0x9C: { *dptr = (dk4_c32_t)0x0153; back = 1; } break;
- case 0x9D: { *dptr = (dk4_c32_t)0x009D; back = 1; } break;
- case 0x9E: { *dptr = (dk4_c32_t)0x017E; back = 1; } break;
- case 0x9F: { *dptr = (dk4_c32_t)0x0178; back = 1; } break;
+ case 0x80: { *dptr = dkC32(0x20AC); back = 1; } break;
+ case 0x81: { *dptr = dkC32(0x0081); back = 1; } break;
+ case 0x82: { *dptr = dkC32(0x201A); back = 1; } break;
+ case 0x83: { *dptr = dkC32(0x0192); back = 1; } break;
+ case 0x84: { *dptr = dkC32(0x201E); back = 1; } break;
+ case 0x85: { *dptr = dkC32(0x2026); back = 1; } break;
+ case 0x86: { *dptr = dkC32(0x2020); back = 1; } break;
+ case 0x87: { *dptr = dkC32(0x2021); back = 1; } break;
+ case 0x88: { *dptr = dkC32(0x02C6); back = 1; } break;
+ case 0x89: { *dptr = dkC32(0x2030); back = 1; } break;
+ case 0x8A: { *dptr = dkC32(0x0160); back = 1; } break;
+ case 0x8B: { *dptr = dkC32(0x2039); back = 1; } break;
+ case 0x8C: { *dptr = dkC32(0x0152); back = 1; } break;
+ case 0x8D: { *dptr = dkC32(0x008D); back = 1; } break;
+ case 0x8E: { *dptr = dkC32(0x017D); back = 1; } break;
+ case 0x8F: { *dptr = dkC32(0x008F); back = 1; } break;
+ case 0x90: { *dptr = dkC32(0x0090); back = 1; } break;
+ case 0x91: { *dptr = dkC32(0x2018); back = 1; } break;
+ case 0x92: { *dptr = dkC32(0x2019); back = 1; } break;
+ case 0x93: { *dptr = dkC32(0x201C); back = 1; } break;
+ case 0x94: { *dptr = dkC32(0x201D); back = 1; } break;
+ case 0x95: { *dptr = dkC32(0x2022); back = 1; } break;
+ case 0x96: { *dptr = dkC32(0x2013); back = 1; } break;
+ case 0x97: { *dptr = dkC32(0x2014); back = 1; } break;
+ case 0x98: { *dptr = dkC32(0x02DC); back = 1; } break;
+ case 0x99: { *dptr = dkC32(0x2122); back = 1; } break;
+ case 0x9A: { *dptr = dkC32(0x0161); back = 1; } break;
+ case 0x9B: { *dptr = dkC32(0x203A); back = 1; } break;
+ case 0x9C: { *dptr = dkC32(0x0153); back = 1; } break;
+ case 0x9D: { *dptr = dkC32(0x009D); back = 1; } break;
+ case 0x9E: { *dptr = dkC32(0x017E); back = 1; } break;
+ case 0x9F: { *dptr = dkC32(0x0178); back = 1; } break;
}
}
}
diff --git a/support/dktools/dk4ansi.h b/support/dktools/dk4ansi.h
index 4943002e30..e7f4a9386a 100644
--- a/support/dktools/dk4ansi.h
+++ b/support/dktools/dk4ansi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ansi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ansi.ctr
*/
#ifndef DK4ANSI_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4aopt.h b/support/dktools/dk4aopt.h
index ada76714e5..98f1ce9a22 100644
--- a/support/dktools/dk4aopt.h
+++ b/support/dktools/dk4aopt.h
@@ -1,4 +1,9 @@
/*
+Copyright 2014-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
@@ -6,7 +11,7 @@
*/
/*
-Copyright (C) 2014, Dirk Krause
+Copyright (C) 2014-2020, Dirk Krause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -55,23 +60,43 @@ was found on the command line.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
#ifndef DK4OPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4opt.h"
+#else
+#include <dktools-4/dk4opt.h>
+#endif
#endif
diff --git a/support/dktools/dk4aopt01.c b/support/dktools/dk4aopt01.c
index daaca33eb2..a7df8fdbcb 100644
--- a/support/dktools/dk4aopt01.c
+++ b/support/dktools/dk4aopt01.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt01.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt01.ctr
*/
/** @file dk4aopt01.c The dk4aopt01 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -49,6 +33,9 @@ dk4app_opt_is_set_short(dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt01.ctr b/support/dktools/dk4aopt01.ctr
index e12a28fe0a..66f3460657 100644
--- a/support/dktools/dk4aopt01.ctr
+++ b/support/dktools/dk4aopt01.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -18,6 +24,9 @@ dk4app_opt_is_set_short(dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt02.c b/support/dktools/dk4aopt02.c
index d24ca25365..78c16e1446 100644
--- a/support/dktools/dk4aopt02.c
+++ b/support/dktools/dk4aopt02.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt02.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt02.ctr
*/
/** @file dk4aopt02.c The dk4aopt02 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -49,6 +33,10 @@ dk4app_opt_is_set_long(dk4_app_t *app, const dkChar *n, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+#endif
if ((NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt02.ctr b/support/dktools/dk4aopt02.ctr
index 2dea13ae66..61242eed4b 100644
--- a/support/dktools/dk4aopt02.ctr
+++ b/support/dktools/dk4aopt02.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -18,6 +24,10 @@ dk4app_opt_is_set_long(dk4_app_t *app, const dkChar *n, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+#endif
if ((NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt03.c b/support/dktools/dk4aopt03.c
index 401a642979..8e10afd195 100644
--- a/support/dktools/dk4aopt03.c
+++ b/support/dktools/dk4aopt03.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt03.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt03.ctr
*/
/** @file dk4aopt03.c The dk4aopt03 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -51,6 +35,11 @@ dk4app_opt_get_string_short(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt03.ctr b/support/dktools/dk4aopt03.ctr
index cc7c4110c9..35ef3d9a11 100644
--- a/support/dktools/dk4aopt03.ctr
+++ b/support/dktools/dk4aopt03.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -20,6 +26,11 @@ dk4app_opt_get_string_short(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt04.c b/support/dktools/dk4aopt04.c
index 400d951be0..09086ea182 100644
--- a/support/dktools/dk4aopt04.c
+++ b/support/dktools/dk4aopt04.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt04.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt04.ctr
*/
/** @file dk4aopt04.c The dk4aopt04 module.
@@ -42,11 +20,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 17 "dk4aopt04.ctr"
+#line 23 "dk4aopt04.ctr"
@@ -59,44 +43,50 @@ dk4app_opt_get_string_long(
int back = 0;
-#line 28 "dk4aopt04.ctr"
+#line 34 "dk4aopt04.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != n)) {
-#line 30 "dk4aopt04.ctr"
+#line 42 "dk4aopt04.ctr"
if (NULL != app->i_opt_long) {
-#line 31 "dk4aopt04.ctr"
+#line 43 "dk4aopt04.ctr"
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
if (NULL != optr) {
-#line 33 "dk4aopt04.ctr"
+#line 45 "dk4aopt04.ctr"
if (0 != optr->found) {
-#line 34 "dk4aopt04.ctr"
+#line 46 "dk4aopt04.ctr"
back = dk4opt_get_string(dptr, szdptr, optr, NULL);
} else {
-#line 36 "dk4aopt04.ctr"
+#line 48 "dk4aopt04.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
} else {
-#line 39 "dk4aopt04.ctr"
+#line 51 "dk4aopt04.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} else {
-#line 42 "dk4aopt04.ctr"
+#line 54 "dk4aopt04.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 45 "dk4aopt04.ctr"
+#line 57 "dk4aopt04.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 47 "dk4aopt04.ctr"
+#line 59 "dk4aopt04.ctr"
return back;
}
diff --git a/support/dktools/dk4aopt04.ctr b/support/dktools/dk4aopt04.ctr
index 69eb8c805a..7f6e9fc158 100644
--- a/support/dktools/dk4aopt04.ctr
+++ b/support/dktools/dk4aopt04.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -25,6 +31,12 @@ dk4app_opt_get_string_long(
dk4_option_t *optr;
int back = 0;
$? "+ dk4app_opt_get_string_long"
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != n)) {
$? ". args ok"
if (NULL != app->i_opt_long) { $? ". long opt iterator ok"
diff --git a/support/dktools/dk4aopt05.c b/support/dktools/dk4aopt05.c
index 87bdd3f39b..5b4544ae30 100644
--- a/support/dktools/dk4aopt05.c
+++ b/support/dktools/dk4aopt05.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt05.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt05.ctr
*/
/** @file dk4aopt05.c The dk4aopt05 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -49,6 +33,10 @@ dk4app_opt_get_double_short(double *rp, dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt05.ctr b/support/dktools/dk4aopt05.ctr
index 48302a94f8..8c33d1acff 100644
--- a/support/dktools/dk4aopt05.ctr
+++ b/support/dktools/dk4aopt05.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -18,6 +24,10 @@ dk4app_opt_get_double_short(double *rp, dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt06.c b/support/dktools/dk4aopt06.c
index a7712effca..9896378280 100644
--- a/support/dktools/dk4aopt06.c
+++ b/support/dktools/dk4aopt06.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt06.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt06.ctr
*/
/** @file dk4aopt06.c The dk4aopt06 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -51,6 +35,11 @@ dk4app_opt_get_double_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt06.ctr b/support/dktools/dk4aopt06.ctr
index f3eae95095..d4904e8328 100644
--- a/support/dktools/dk4aopt06.ctr
+++ b/support/dktools/dk4aopt06.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -20,6 +26,11 @@ dk4app_opt_get_double_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt07.c b/support/dktools/dk4aopt07.c
index 45d6ff54ff..78311d8c98 100644
--- a/support/dktools/dk4aopt07.c
+++ b/support/dktools/dk4aopt07.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt07.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt07.ctr
*/
/** @file dk4aopt07.c The dk4aopt07 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -49,6 +33,10 @@ dk4app_opt_get_int_short(dk4_im_t *rp, dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt07.ctr b/support/dktools/dk4aopt07.ctr
index 8685316131..19c835be54 100644
--- a/support/dktools/dk4aopt07.ctr
+++ b/support/dktools/dk4aopt07.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -18,6 +24,10 @@ dk4app_opt_get_int_short(dk4_im_t *rp, dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt08.c b/support/dktools/dk4aopt08.c
index 62bea0ee2a..63b1d6ee70 100644
--- a/support/dktools/dk4aopt08.c
+++ b/support/dktools/dk4aopt08.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt08.ctr
*/
/** @file dk4aopt08.c The dk4aopt08 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -51,6 +35,11 @@ dk4app_opt_get_int_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt08.ctr b/support/dktools/dk4aopt08.ctr
index 9b1813e935..d2925429bf 100644
--- a/support/dktools/dk4aopt08.ctr
+++ b/support/dktools/dk4aopt08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -20,6 +26,11 @@ dk4app_opt_get_int_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt09.c b/support/dktools/dk4aopt09.c
index 91ffd32f94..16499bbd34 100644
--- a/support/dktools/dk4aopt09.c
+++ b/support/dktools/dk4aopt09.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt09.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt09.ctr
*/
/** @file dk4aopt09.c The dk4aopt09 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -51,6 +35,10 @@ dk4app_opt_get_unsigned_short(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt09.ctr b/support/dktools/dk4aopt09.ctr
index 01f60e8813..af03689c3a 100644
--- a/support/dktools/dk4aopt09.ctr
+++ b/support/dktools/dk4aopt09.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -20,6 +26,10 @@ dk4app_opt_get_unsigned_short(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt10.c b/support/dktools/dk4aopt10.c
index b0c6abea09..6aa1cc21ea 100644
--- a/support/dktools/dk4aopt10.c
+++ b/support/dktools/dk4aopt10.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt10.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt10.ctr
*/
/** @file dk4aopt10.c The dk4aopt10 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -51,6 +35,11 @@ dk4app_opt_get_unsigned_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt10.ctr b/support/dktools/dk4aopt10.ctr
index ba7a89811b..8ef20fbfe5 100644
--- a/support/dktools/dk4aopt10.ctr
+++ b/support/dktools/dk4aopt10.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -20,6 +26,11 @@ dk4app_opt_get_unsigned_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt11.c b/support/dktools/dk4aopt11.c
index 0e676e1278..794d5e7738 100644
--- a/support/dktools/dk4aopt11.c
+++ b/support/dktools/dk4aopt11.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt11.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt11.ctr
*/
/** @file dk4aopt11.c The dk4aopt11 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -49,6 +33,10 @@ dk4app_opt_get_size_short(size_t *rp, dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt11.ctr b/support/dktools/dk4aopt11.ctr
index 0265af2cd6..2479030936 100644
--- a/support/dktools/dk4aopt11.ctr
+++ b/support/dktools/dk4aopt11.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -18,6 +24,10 @@ dk4app_opt_get_size_short(size_t *rp, dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt12.c b/support/dktools/dk4aopt12.c
index 6c35031502..29e4b986e2 100644
--- a/support/dktools/dk4aopt12.c
+++ b/support/dktools/dk4aopt12.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt12.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt12.ctr
*/
/** @file dk4aopt12.c The dk4aopt12 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -51,6 +35,11 @@ dk4app_opt_get_size_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt12.ctr b/support/dktools/dk4aopt12.ctr
index 0d7f62d89b..0ce96bfd12 100644
--- a/support/dktools/dk4aopt12.ctr
+++ b/support/dktools/dk4aopt12.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -20,6 +26,11 @@ dk4app_opt_get_size_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt13.c b/support/dktools/dk4aopt13.c
index 18c6098912..7201b0d717 100644
--- a/support/dktools/dk4aopt13.c
+++ b/support/dktools/dk4aopt13.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt13.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt13.ctr
*/
/** @file dk4aopt13.c The dk4aopt13 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -49,6 +33,10 @@ dk4app_opt_get_bool_short(int *rp, dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt13.ctr b/support/dktools/dk4aopt13.ctr
index 945dc65b65..c4111fe2d1 100644
--- a/support/dktools/dk4aopt13.ctr
+++ b/support/dktools/dk4aopt13.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -18,6 +24,10 @@ dk4app_opt_get_bool_short(int *rp, dk4_app_t *app, dkChar c, dk4_er_t *erp)
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt14.c b/support/dktools/dk4aopt14.c
index 04c4325d4b..8ddd068f8b 100644
--- a/support/dktools/dk4aopt14.c
+++ b/support/dktools/dk4aopt14.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt14.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt14.ctr
*/
/** @file dk4aopt14.c The dk4aopt14 module.
@@ -42,6 +20,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -51,6 +35,11 @@ dk4app_opt_get_bool_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt14.ctr b/support/dktools/dk4aopt14.ctr
index e06bc511e4..4b9700eac6 100644
--- a/support/dktools/dk4aopt14.ctr
+++ b/support/dktools/dk4aopt14.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,12 @@ license = bsd
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -20,6 +26,11 @@ dk4app_opt_get_bool_long(
{
dk4_option_t *optr;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+ assert(NULL != rp);
+#endif
if ((NULL != rp) && (NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_long) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3);
diff --git a/support/dktools/dk4aopt15.c b/support/dktools/dk4aopt15.c
index 0f29ce15e9..8a464e9b8d 100644
--- a/support/dktools/dk4aopt15.c
+++ b/support/dktools/dk4aopt15.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt15.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt15.ctr
*/
/** @file dk4aopt15.c The dk4aopt15 module.
@@ -42,11 +20,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 15 "dk4aopt15.ctr"
+#line 21 "dk4aopt15.ctr"
@@ -57,7 +41,10 @@ dk4app_opt_get_string_ptr_short(dk4_app_t *app, dkChar c, dk4_er_t *erp)
dk4_option_t *optr = NULL;
-#line 24 "dk4aopt15.ctr"
+#line 30 "dk4aopt15.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
@@ -88,7 +75,7 @@ dk4app_opt_get_string_ptr_short(dk4_app_t *app, dkChar c, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 53 "dk4aopt15.ctr"
+#line 62 "dk4aopt15.ctr"
return back;
}
diff --git a/support/dktools/dk4aopt15.ctr b/support/dktools/dk4aopt15.ctr
index b01134d0e2..7b1f9d3be8 100644
--- a/support/dktools/dk4aopt15.ctr
+++ b/support/dktools/dk4aopt15.ctr
@@ -2,13 +2,19 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -21,6 +27,9 @@ dk4app_opt_get_string_ptr_short(dk4_app_t *app, dkChar c, dk4_er_t *erp)
const dkChar *back = NULL;
dk4_option_t *optr = NULL;
$? "+ dk4app_opt_get_string_ptr_short"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, &c, 1);
diff --git a/support/dktools/dk4aopt16.c b/support/dktools/dk4aopt16.c
index eae933ad09..c9ce9e6a08 100644
--- a/support/dktools/dk4aopt16.c
+++ b/support/dktools/dk4aopt16.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aopt16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aopt16.ctr
*/
/** @file dk4aopt16.c The dk4aopt16 module.
@@ -42,12 +20,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 16 "dk4aopt16.ctr"
+#line 22 "dk4aopt16.ctr"
@@ -58,7 +42,11 @@ dk4app_opt_get_string_ptr_long(dk4_app_t *app, const dkChar *n, dk4_er_t *erp)
dk4_option_t *optr = NULL;
-#line 25 "dk4aopt16.ctr"
+#line 31 "dk4aopt16.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+#endif
if ((NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, n, 3);
@@ -89,7 +77,7 @@ dk4app_opt_get_string_ptr_long(dk4_app_t *app, const dkChar *n, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 54 "dk4aopt16.ctr"
+#line 64 "dk4aopt16.ctr"
return back;
}
diff --git a/support/dktools/dk4aopt16.ctr b/support/dktools/dk4aopt16.ctr
index 353fc52bb7..adeb0fc4de 100644
--- a/support/dktools/dk4aopt16.ctr
+++ b/support/dktools/dk4aopt16.ctr
@@ -2,13 +2,19 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
#include "dk4opt.h"
#include "dk4aopt.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
@@ -22,6 +28,10 @@ dk4app_opt_get_string_ptr_long(dk4_app_t *app, const dkChar *n, dk4_er_t *erp)
const dkChar *back = NULL;
dk4_option_t *optr = NULL;
$? "+ dk4app_opt_get_string_ptr_long"
+#if DK4_USE_ASSERT
+ assert(NULL != n);
+ assert(NULL != app);
+#endif
if ((NULL != app) && (NULL != n)) {
if (NULL != app->i_opt_short) {
optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_short, n, 3);
diff --git a/support/dktools/dk4app.h b/support/dktools/dk4app.h
index 98d04c387d..ac921c9f86 100644
--- a/support/dktools/dk4app.h
+++ b/support/dktools/dk4app.h
@@ -1,5 +1,10 @@
/*
-Copyright (C) 2014, Dirk Krause
+Copyright 2014-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+Copyright (C) 2014-2020, Dirk Krause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -36,35 +41,67 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4OPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4opt.h"
+#else
+#include <dktools-4/dk4opt.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
#ifndef DK4DIR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir.h"
+#else
+#include <dktools-4/dk4dir.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
/** Application structure.
@@ -468,7 +505,7 @@ dk4app_set_fast_close(dk4_app_t *app);
@return 1 for normal run, 0 if dk4app_can_run_normally() should be run.
*/
int
-dk4app_can_run_normally(dk4_app_t *app);
+dk4app_can_run_normally(dk4_app_t const *app);
/** Respond to --help, --version, or --license.
CRT on Windows: Required.
@@ -486,7 +523,7 @@ dk4app_help_version_license(dk4_app_t *app);
@return 1 if the log level requires processing, 0 otherwise.
*/
int
-dk4app_log_do(dk4_app_t *app, int ll);
+dk4app_log_do(dk4_app_t const *app, int ll);
/** Log multi part message.
CRT on Windows: Optional,
@@ -1040,42 +1077,42 @@ dk4app_string_table(
dk4fputc() functions.
*/
int
-dk4app_get_encoding(dk4_app_t *app);
+dk4app_get_encoding(dk4_app_t const *app);
/** Retrieve encoding expected on stdin.
@param app Application structure.
@return Encoding expected on stdin.
*/
int
-dk4app_get_stdin_encoding(dk4_app_t *app);
+dk4app_get_stdin_encoding(dk4_app_t const *app);
/** Retrieve encoding expected when reading files.
@param app Application structure.
@return Encoding expected when reading files.
*/
int
-dk4app_get_file_in_encoding(dk4_app_t *app);
+dk4app_get_file_in_encoding(dk4_app_t const *app);
/** Retrieve encoding to use on stdout.
@param app Application structure.
@return Encoding to use when writing to stdout.
*/
int
-dk4app_get_stdout_encoding(dk4_app_t *app);
+dk4app_get_stdout_encoding(dk4_app_t const *app);
/** Retrieve encoding to use when writing to files.
@param app Application structure.
@return Encoding to use when writing to files.
*/
int
-dk4app_get_file_out_encoding(dk4_app_t *app);
+dk4app_get_file_out_encoding(dk4_app_t const *app);
/** Retrieve number of command line arguments.
@param app Application structure.
@return Number of command line arguments (program name not included).
*/
int
-dk4app_get_argc(dk4_app_t *app);
+dk4app_get_argc(dk4_app_t const *app);
/** Retrieve n-th command line argument.
@param app Application structure.
@@ -1085,7 +1122,7 @@ dk4app_get_argc(dk4_app_t *app);
NULL on error.
*/
const dkChar *
-dk4app_get_argv(dk4_app_t *app, int n);
+dk4app_get_argv(dk4_app_t const *app, int n);
/** Remove file.
CRT on Windows: Optional,
@@ -1160,160 +1197,19 @@ dk4app_fne_one_file(
dk4_app_t *app
);
-/** Retrieve preference value.
- CRT on Windows: Optional.
- @param dptr Result buffer address.
- @param szdptr Buffer size (number of dkChar).
- @param app Application structure.
- @param name Preference name.
- @param excl Preference sources to exclude, one
- from DK4_APP_PREF_SRC_SELF,
- DK4_APP_PREF_SRC_CMD,
- DK4_APP_PREF_SRC_USER,
- DK4_APP_PREF_SRC_SYSTEM
- or bitwise or-combination.
- @return 1 on success, 0 on error.
-*/
-int
-dk4app_pref_get(
- dkChar *dptr,
- size_t szdptr,
- dk4_app_t *app,
- const dkChar *name,
- int excl
-);
-
-/** Retrieve integer value from preferences.
- CRT on Windows: Optional.
- @param dptr Pointer to result variable.
- @param app Application structure.
- @param name Preference name.
- @param excl Preference sources to exclude, one
- from DK4_APP_PREF_SRC_SELF,
- DK4_APP_PREF_SRC_CMD,
- DK4_APP_PREF_SRC_USER,
- DK4_APP_PREF_SRC_SYSTEM
- or bitwise or-combination.
- @return 1 on success, 0 on error.
-*/
-int
-dk4app_pref_get_int(
- dk4_im_t *dptr,
- dk4_app_t *app,
- const dkChar *name,
- int excl
-);
-
-/** Retrieve unsigned integer value from preferences.
- CRT on Windows: Optional.
- @param dptr Pointer to result variable.
- @param app Application structure.
- @param name Preference name.
- @param excl Preference sources to exclude, one
- from DK4_APP_PREF_SRC_SELF,
- DK4_APP_PREF_SRC_CMD,
- DK4_APP_PREF_SRC_USER,
- DK4_APP_PREF_SRC_SYSTEM
- or bitwise or-combination.
- @return 1 on success, 0 on error.
-*/
-int
-dk4app_pref_get_unsigned(
- dk4_um_t *dptr,
- dk4_app_t *app,
- const dkChar *name,
- int excl
-);
-
-/** Retrieve boolean value from preferences.
- CRT on Windows: Optional.
- @param dptr Pointer to result variable.
- @param app Application structure.
- @param name Preference name.
- @param excl Preference sources to exclude, one
- from DK4_APP_PREF_SRC_SELF,
- DK4_APP_PREF_SRC_CMD,
- DK4_APP_PREF_SRC_USER,
- DK4_APP_PREF_SRC_SYSTEM
- or bitwise or-combination.
- @return 1 on success, 0 on error.
-*/
-int
-dk4app_pref_get_bool(
- int *dptr,
- dk4_app_t *app,
- const dkChar *name,
- int excl
-);
-
-/** Retrieve size value from preferences.
- CRT on Windows: Optional.
- @param dptr Pointer to result variable.
- @param app Application structure.
- @param name Preference name.
- @param excl Preference sources to exclude, one
- from DK4_APP_PREF_SRC_SELF,
- DK4_APP_PREF_SRC_CMD,
- DK4_APP_PREF_SRC_USER,
- DK4_APP_PREF_SRC_SYSTEM
- or bitwise or-combination.
- @return 1 on success, 0 on error.
-*/
-int
-dk4app_pref_get_size(
- size_t *dptr,
- dk4_app_t *app,
- const dkChar *name,
- int excl
-);
-
-/** Set preferences value.
- CRT on Windows: Optional.
- @param app Application structure.
- @param name Preference name.
- @param value Preference value.
- @return 1 on success, 0 on error.
-*/
-int
-dk4app_pref_set(
- dk4_app_t *app,
- const dkChar *name,
- const dkChar *value
-);
-
-/** Set preferences integer value.
- CRT on Windows: Optional.
- @param app Application structure.
- @param name Preference name.
- @param value Preference value.
- @return 1 on success, 0 on error.
-*/
-int
-dk4app_pref_set_int(dk4_app_t *app, const dkChar *name, dk4_im_t value);
-
-/** Set preferences unsigned integer value.
- CRT on Windows: Optional.
- @param app Application structure.
- @param name Preference name.
- @param value Preference value.
- @return 1 on success, 0 on error.
-*/
-int
-dk4app_pref_set_unsigned(dk4_app_t *app, const dkChar *name, dk4_um_t value);
-
/** Retrieve source file name.
@param app Application structure.
@return Source file name if defined, NULL otherwise.
*/
const dkChar *
-dk4app_get_log_source_file(dk4_app_t *app);
+dk4app_get_log_source_file(dk4_app_t const *app);
/** Retrieve source line number.
@param app Application structure.
@return Source line number if defined, 0 otherwise.
*/
dk4_um_t
-dk4app_get_log_source_line(dk4_app_t *app);
+dk4app_get_log_source_line(dk4_app_t const *app);
/** Set source file name, reported in diagnostic messages.
The structure does not keep a private copy of the name,
diff --git a/support/dktools/dk4app/de/dk4base.str b/support/dktools/dk4app/de/dk4base.str
index e7bfd58dda..a30a8ac9d2 100644
--- a/support/dktools/dk4app/de/dk4base.str
+++ b/support/dktools/dk4app/de/dk4base.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Log level: Never reached.
#
diff --git a/support/dktools/dk4app/de/dk4bif.str b/support/dktools/dk4app/de/dk4bif.str
new file mode 100644
index 0000000000..e0900c133d
--- /dev/null
+++ b/support/dktools/dk4app/de/dk4bif.str
@@ -0,0 +1,42 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0 File suffix doest not indicate a known image type
+#
+Datei nicht verarbeitbar (laut Dateiendung)!
+#
+# 1 Failed to open image
+#
+Bild konnte nicht geöffnet werden!
+#
+# 2 Syntax error, file probably damaged!
+#
+Syntax-Fehler, Datei möglicherweise beschädigt!
+#
+# 3 Failed to open file for reading!
+#
+Öffnen bzw. Lesen der Datei fehlgeschlagen!
+#
+# 4 File type not supported!
+#
+Dateityp wird nicht unterstützt!
+#
+# 5 Invalid arguments provided to function call, probably bug!
+#
+Ungültige Argumente in Funktionsaufruf, möglicherweise Bug!
+#
+# 6-7 Unusual maxval ... may result in color distorsion!
+#
+Unüblicher maxval
+!\n\tDies kann zu Farbverzerrungen führen!
+#
+# 8-12
+#
+Seitenverhältnis wurde geändert!\n\tÄnderung der Auflösung von
+/
+ zu
+/
+ dpi.\n\tDies kann zu einer verzerrten Darstellung des Bildes führen!
+#
+#
+#
diff --git a/support/dktools/dk4app/de/dk4colpal.str b/support/dktools/dk4app/de/dk4colpal.str
new file mode 100644
index 0000000000..1f8e5f9f81
--- /dev/null
+++ b/support/dktools/dk4app/de/dk4colpal.str
@@ -0,0 +1,70 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0 Window title
+#
+Farbpaletten
+#
+# 1 Tip for choice book
+#
+Palette auswählen
+#
+# 2 Tip for palette item
+#
+Paletteneintrag klicken, um Grundfarbe auszuwählen
+#
+# 3-7 Special shading levels
+#
+schwarz
+pur
+weiß
+Schattierung
+Schattierung ändern (zu schwarz oder weiß mischen)
+#
+# 8 Tip for list
+#
+Eintrag klicken, um Farbe auszuwählen
+#
+# 9-11 Labels for RGB sliders
+#
+Rot
+Grün
+Blau
+#
+# 12-14 Tips for RGB sliders
+#
+Rot-Komponente bearbeiten
+Grün-Komponente bearbeiten
+Blau-Komponente bearbeiten
+#
+# 15-16 Initial label value
+#
+Abbrechen
+Dialog verlassen, Einstellungen nicht übernehmen
+#
+# 17-19 Tips for labels
+#
+Rot-Komponente, hexadezimal 00...FF
+Grün-Komponente, hexadezimal 00...FF
+Blau-Komponente, hexadezimal 00...FF
+#
+# 20-22 Tips for labels
+#
+Rot-Komponente, dezimal 0...255
+Grün-Komponente, dezimal 0...255
+Blau-Komponente, dezimal 0...255
+#
+# 23 Tip for result colour view
+#
+Ausgewählte Farbe
+#
+# 24-25 Button texts and tips
+#
+OK
+Dialog verlassen, Einstellungen übernehmen
+#
+# 26-28 Palette types
+#
+XFig
+HTML
+Web216
diff --git a/support/dktools/dktools/de/dk4dbia.str b/support/dktools/dk4app/de/dk4dbia.str
index 1b56c298b9..3f386bbea0 100644
--- a/support/dktools/dktools/de/dk4dbia.str
+++ b/support/dktools/dk4app/de/dk4dbia.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to open database
#
diff --git a/support/dktools/dk4app/de/dk4debug.str b/support/dktools/dk4app/de/dk4debug.str
index 693c2cd7af..a8c062519a 100644
--- a/support/dktools/dk4app/de/dk4debug.str
+++ b/support/dktools/dk4app/de/dk4debug.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 ... 20 Log texts to show at startup
#
diff --git a/support/dktools/dk4app/de/dk4gra.str b/support/dktools/dk4app/de/dk4gra.str
new file mode 100644
index 0000000000..1634fc99a6
--- /dev/null
+++ b/support/dktools/dk4app/de/dk4gra.str
@@ -0,0 +1,215 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0 1 ERROR: Not a boolean value.
+#
+Kein Boolean-Wert: "
+"!
+#
+# 2 3 ERROR: Not a resolution value.
+#
+Keine Auflösungs-Angabe: "
+"!
+#
+# 4 5 ERROR: Color value out of range.
+#
+Farbwert "
+" außerhalb von 0...255!
+#
+# 6 7 ERROR: Not a number!
+#
+Kein Zahlenwert: "
+"!
+#
+# 8 9 ERROR: Not a boolean
+#
+Kein Boolean-Wert: "
+"!
+#
+# 10 11 ERROR: Not a hexadecimal digit!
+#
+Keine Hexadezimalziffer: "
+"!
+#
+# 12 13 ERROR: Hexadecimal number to short!
+#
+Hexadezimalzahl "
+" zu kurz, 6 Stellen erforderlich!
+#
+# 14 ERROR: Wrong number of components in background specification!
+#
+Falsche Komponenten-Anzahl für Hintergrund!
+#
+# 15 ERROR: Negative number not allowed in resolution specification!
+#
+Die Auflösung muss positiv sein!
+#
+# 16 17 ERROR: Paper size not found
+#
+Papiergröße nicht gefunden: "
+"!
+#
+# 18
+#
+Größenangabe muss positiv sein!
+#
+# 19
+#
+Ungültige Werte-Anzahl für Papiergröße!
+#
+# 20 21 ERROR: Option requires a value!
+#
+Option "
+" benötigt Wert!
+#
+# 22 23 ERROR: Invalid tsize value!
+#
+Unbrauchbarer tsize-Wert: "
+"!
+#
+# 24 25 ERROR: Invalid PS level
+#
+Ungültiges PS-Level: "
+", muss "2" oder "3" sein!
+#
+# 26 ERROR: Text size must not be negative
+#
+Negative Textgröße nicht erlaubt!
+#
+# 27 28 ERROR: Illegal purpose!
+#
+Ungültiger Modus: "
+"!
+#
+# 29 30 ERROR: No such driver!
+#
+Ungültiger Treiber: "
+"!
+#
+# 31 32 ERROR: Illegal configuration key!
+#
+Ungültiger Key-Name: "
+"!
+#
+# 33 ERROR: Empty configuration string!
+#
+Konfigurations-String ist leer!
+#
+# 34 35 ERROR: Unknown RGB to gray conversion method name "..."!
+#
+Ungültiger Wert!\n\tName für RGB-zu-Grau-Konvertierungsmethode: "
+"!
+#
+# 36 37 ERROR: Unknown RGB to gray conversion method name "..."!
+#
+Ungültiger Wert!\n\tName für RGB-zu-Grau-Konvertierungsmethode: "
+"!
+#
+# 38 39 ERROR: Not an alpha handling method: "..."!
+#
+Ungültiger Wert!\n\tKeine Methode für Alpha-Kanal-Verwendung: "
+"!
+#
+# 40 ERROR: Failed to set up text stream processing!
+#
+Text-Verarbeitung konnte nicht eingerichtet werden!
+#
+# 41 ERROR: Failed to read file!
+#
+Datei kann nicht gelesen werden!
+#
+# 42 43 Warning: Ignoring configuration key "..."!
+#
+Unbekannter Konfiguration-Key wird ignoriert: "
+"!
+#
+# 44 45 ERROR: No such driver or purpose: "..."!
+#
+Kein Treiber oder Modus: "
+"!
+#
+# 46 ERROR: Line does not contain a value!
+#
+Zeile enthält keinen Wert!
+#
+# 47 ERROR: Purpose "document" only available for "ps", "pdf", "tex"!
+#
+Modus "document" nur für Treiber "ps", "pdf", "tex" verfügbar!
+#
+# 48-49
+#
+Konfigurationsdateien werden verarbeitet.
+Konfigurationsdateien wurden verarbeitet.
+#
+# 50-51
+#
+Datei wird vearbeitet.
+Datei wurde vearbeitet.
+#
+# 52 ERROR: Failed to create graphics output structure!
+#
+Graphikausgabe konnte nicht geöffnet werden!
+#
+# 53 ERROR: Invalid function arguments, probably bug!
+#
+Fehlerhafte Argumente in Funktion (evtl. Bug)!
+#
+# 54 ERROR: Numeric overflow
+#
+Numerischer Überlauf in Größenberechnung!\n\tBilddimensionen zu groß?
+#
+# 55 ERROR: Failed to write data!
+#
+Daten konnten nicht geschrieben werden!
+#
+# 56 ERROR: Failed to flush write buffers!
+#
+Puffer konnten nicht geschrieben werden!
+#
+# 57 ERROR: Failed to add graphics details!
+#
+Graphikoperation konnte nicht ausgeführt werden!
+#
+# 58 ERROR: Failed to change graphics setup!
+#
+Graphik-Setup konnte nicht geändert werden!
+#
+# 59 ERROR: Failed to write graphics to file!
+#
+Graphik konnte nicht in Datei geschrieben werden!
+#
+# 60 ERROR: Only PNG/JPEG allowed in PGF output!
+#
+Falscher Dateityp!\n\tFür PGF-Ausgabe sind nur PNG und JPEG erlaubt!
+#
+# 61 62 Error: Not an unsigned number: ...!
+#
+Keine vorzeichenlose ganze Zahl: "
+"!
+#
+# 63 ERROR: Illegal value: 0!
+#
+Wert 0 nicht erlaubt!
+#
+# 64 Warning: Unusual large number of x-spline sub segments.
+#
+Ungewöhnlich große Anzahl Subsegmente für X-Splines!\n\tDamit werden große Ausgabedateien erzeugt.
+#
+# 65 Warning: Unusual low number of x-spline sub segments.
+#
+Ungewöhnlich kleine Anzahl Subsegmente für X-Splines!\n\tDamit werden X-Splines ungenau dargestellt.
+#
+# 66 67 Warning: Option ... requires a value!
+#
+Option "
+" erfordert Wert!
+#
+# 68 69 ERROR: Not a floating point number: "..."!
+#
+Keine Gleitkommazahl: "
+"!
+#
+# 70 71 ERROR: Positive value required for "..."!
+#
+Wert für "
+" muss positiv sein!
diff --git a/support/dktools/dk4app/de/dk4sock.str b/support/dktools/dk4app/de/dk4sock.str
index 96654fbe38..020a517bae 100644
--- a/support/dktools/dk4app/de/dk4sock.str
+++ b/support/dktools/dk4app/de/dk4sock.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to initialize Winsock subsystem!
#
diff --git a/support/dktools/dktools/de/dk4uc2l.str b/support/dktools/dk4app/de/dk4uc2l.str
index 76047dfd4d..fe30e8883b 100644
--- a/support/dktools/dktools/de/dk4uc2l.str
+++ b/support/dktools/dk4app/de/dk4uc2l.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Syntax
#
@@ -9,9 +11,9 @@ Syntax-Fehler!\n\tHexadezimal-Zahl außerhalb des 32-Bit-Bereiches!
#
# 2 3 4 Error: Syntax-Fehler! Redefintion of character!
#
-Syntax-Fehler!\n\tErneute Definition von
+Syntax-Fehler!\n\tIgnoriere erneute Definition von 0x
!
-Syntax-Fehler! Erneute Definition für Zeichen!
+Syntax-Fehler! Ignoriere erneute Definition für Zeichen!
#
# 5 Error: Failed to set up text processing!
#
@@ -65,3 +67,17 @@ Verarbeitung fehlgeschlagen!
Weitere Decodierungs-Fehler!
Weitere Codierungs-Fehler!
Weitere Verarbeitungs-Fehler!
+#
+# 28 29 30 Ignoriere erneute Definition
+#
+Syntax-Fehler!\n\tIgnoriere erneute Definition von 0x
+,\n\tzuvor in "
+" definiert!
+#
+# 31 32 Kein LaTeX-Encoding gefunden
+#
+Kein LaTeX-Encoding für U+
+gefunden!
+#
+#
+#
diff --git a/support/dktools/dk4app/de/dk4wxbase.str b/support/dktools/dk4app/de/dk4wxbase.str
index df9cad6443..1ba7c330e0 100644
--- a/support/dktools/dk4app/de/dk4wxbase.str
+++ b/support/dktools/dk4app/de/dk4wxbase.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Dialog box title: Help file not found
#
@@ -22,3 +24,19 @@ Abbruch eingeleitet, bitte warten.
Fehler
Zu wenig Speicher (RAM)!
Fehlerhafte Argumente im Konstruktor von Dk4WxHelpController (Bug)!
+#
+# 9 10
+#
+Datei nicht gefunden
+Die anzuzeigende Datei wurde nicht gefunden!
+#
+# 11 12 13
+#
+Fehler
+Der Browser bzw. das Programm für die Datei\n"
+"\nkonnte nicht gestartet werden!
+#
+# 14 15
+#
+Ja
+Nein
diff --git a/support/dktools/dk4appargs.c b/support/dktools/dk4appargs.c
index 1342c76ed5..d0ffa2d64a 100644
--- a/support/dktools/dk4appargs.c
+++ b/support/dktools/dk4appargs.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appargs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appargs.ctr
*/
/** @file dk4appargs.c The dk4appargs module.
@@ -41,12 +19,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4app.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
-dk4app_get_argc(dk4_app_t *app)
+dk4app_get_argc(dk4_app_t const *app)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
back = app->my_argc;
}
@@ -56,9 +43,12 @@ dk4app_get_argc(dk4_app_t *app)
const dkChar *
-dk4app_get_argv(dk4_app_t *app, int n)
+dk4app_get_argv(dk4_app_t const *app, int n)
{
const dkChar *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
if (n < app->my_argc) {
back = (app->my_argv)[n];
diff --git a/support/dktools/dk4appargs.ctr b/support/dktools/dk4appargs.ctr
index 8dd2b259c8..0db9996c2f 100644
--- a/support/dktools/dk4appargs.ctr
+++ b/support/dktools/dk4appargs.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,12 +11,21 @@ license = bsd
#include "dk4app.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
-dk4app_get_argc(dk4_app_t *app)
+dk4app_get_argc(dk4_app_t const *app)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
back = app->my_argc;
}
@@ -26,9 +35,12 @@ dk4app_get_argc(dk4_app_t *app)
const dkChar *
-dk4app_get_argv(dk4_app_t *app, int n)
+dk4app_get_argv(dk4_app_t const *app, int n)
{
const dkChar *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
if (n < app->my_argc) {
back = (app->my_argv)[n];
diff --git a/support/dktools/dk4appdeldir.c b/support/dktools/dk4appdeldir.c
index 108a977496..41f3dde9d0 100644
--- a/support/dktools/dk4appdeldir.c
+++ b/support/dktools/dk4appdeldir.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appdeldir.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appdeldir.ctr
*/
/** @file dk4appdeldir.c The dk4appdeldir module.
@@ -89,11 +67,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 64 "dk4appdeldir.ctr"
+#line 70 "dk4appdeldir.ctr"
@@ -223,10 +207,13 @@ dk4app_del_dir(const dkChar *fn, dk4_app_t *app)
int back = 0;
-#line 192 "dk4appdeldir.ctr"
+#line 198 "dk4appdeldir.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
-#line 193 "dk4appdeldir.ctr"
+#line 202 "dk4appdeldir.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, DK4_LL_DEBUG)) {
if ((NULL != app->msg_debug) && (25 < app->sz_msg_debug)) {
@@ -241,19 +228,19 @@ dk4app_del_dir(const dkChar *fn, dk4_app_t *app)
back = dk4delete_directory(fn, &er);
if (0 == back) {
-#line 206 "dk4appdeldir.ctr"
+#line 215 "dk4appdeldir.ctr"
if (0 != dk4file_exists(fn, NULL)) {
dk4app_del_dir_report(fn, &er, app);
} else {
-#line 209 "dk4appdeldir.ctr"
+#line 218 "dk4appdeldir.ctr"
back = 1; /* File does not exist */
}
}
}
-#line 214 "dk4appdeldir.ctr"
+#line 223 "dk4appdeldir.ctr"
return back;
}
diff --git a/support/dktools/dk4appdeldir.ctr b/support/dktools/dk4appdeldir.ctr
index fb442fa168..4308d1d320 100644
--- a/support/dktools/dk4appdeldir.ctr
+++ b/support/dktools/dk4appdeldir.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -58,6 +58,12 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -189,6 +195,9 @@ dk4app_del_dir(const dkChar *fn, dk4_app_t *app)
dk4_er_t er;
int back = 0;
$? "+ dk4app_del_dir %!ds", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) { $? ". arg ok"
if (NULL != app) {
if (0 != dk4app_log_do(app, DK4_LL_DEBUG)) {
diff --git a/support/dktools/dk4appdelfile.c b/support/dktools/dk4appdelfile.c
index 26b14ecf1c..a9e695d181 100644
--- a/support/dktools/dk4appdelfile.c
+++ b/support/dktools/dk4appdelfile.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appdelfile.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appdelfile.ctr
*/
/** @file dk4appdelfile.c The dk4appdelfile module.
@@ -89,6 +67,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
void
@@ -217,6 +201,9 @@ dk4app_del_file(const dkChar *fn, dk4_app_t *app)
const dkChar *msg[3];
dk4_er_t er;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
if (NULL != app) {
if (0 != dk4app_log_do(app, DK4_LL_DEBUG)) {
diff --git a/support/dktools/dk4appdelfile.ctr b/support/dktools/dk4appdelfile.ctr
index f99564b0aa..9e5eb66a96 100644
--- a/support/dktools/dk4appdelfile.ctr
+++ b/support/dktools/dk4appdelfile.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -58,6 +58,12 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
void
@@ -186,6 +192,9 @@ dk4app_del_file(const dkChar *fn, dk4_app_t *app)
const dkChar *msg[3];
dk4_er_t er;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
if (NULL != app) {
if (0 != dk4app_log_do(app, DK4_LL_DEBUG)) {
diff --git a/support/dktools/dk4appdeltree.c b/support/dktools/dk4appdeltree.c
index 5a38b49b0e..b36646ed08 100644
--- a/support/dktools/dk4appdeltree.c
+++ b/support/dktools/dk4appdeltree.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appdeltree.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appdeltree.ctr
*/
/** @file dk4appdeltree.c The dk4appdeltree module.
@@ -117,10 +95,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 91 "dk4appdeltree.ctr"
+#line 98 "dk4appdeltree.ctr"
@@ -301,11 +286,11 @@ dk4app_del_tree_node_open(
#endif
-#line 270 "dk4appdeltree.ctr"
+#line 277 "dk4appdeltree.ctr"
back = dk4mem_new_app(dk4_del_tree_node_t,1,app);
if (NULL != back) {
-#line 272 "dk4appdeltree.ctr"
+#line 279 "dk4appdeltree.ctr"
back->parent = par;
back->ne = NE_NO_ERROR;
back->dplen = dk4str_len(dn);
@@ -313,7 +298,7 @@ dk4app_del_tree_node_open(
back->dir = dk4dir_open_app(dn, DK4_DIR_OPEN_DELTREE, app);
if (NULL != back->dir) {
-#line 278 "dk4appdeltree.ctr"
+#line 285 "dk4appdeltree.ctr"
dk4error_init(&er);
lgt = dk4ma_size_t_add(
dk4ma_size_t_add(
@@ -324,26 +309,26 @@ dk4app_del_tree_node_open(
);
if (DK4_E_NONE == er.ec) {
-#line 287 "dk4appdeltree.ctr"
+#line 294 "dk4appdeltree.ctr"
if ((lgt > job->sbsz) && (lgt > job->dbsz)) {
-#line 289 "dk4appdeltree.ctr"
+#line 296 "dk4appdeltree.ctr"
nbptr = dk4mem_new_app(dkChar,lgt,app);
if (NULL != nbptr) {
-#line 291 "dk4appdeltree.ctr"
+#line 298 "dk4appdeltree.ctr"
if (job->dbptr) {
dk4mem_free(job->dbptr);
-#line 293 "dk4appdeltree.ctr"
+#line 300 "dk4appdeltree.ctr"
}
job->dbptr = nbptr; job->dbsz = lgt;
-#line 295 "dk4appdeltree.ctr"
+#line 302 "dk4appdeltree.ctr"
} else {
-#line 296 "dk4appdeltree.ctr"
+#line 303 "dk4appdeltree.ctr"
dk4app_del_tree_node_close(back);
back = NULL;
job->result = 0;
@@ -353,36 +338,36 @@ dk4app_del_tree_node_open(
if ((NULL != job->dbptr) && (0 < job->dbsz)) {
nbptr = job->dbptr;
-#line 304 "dk4appdeltree.ctr"
+#line 311 "dk4appdeltree.ctr"
lgt = job->dbsz;
} else {
-#line 306 "dk4appdeltree.ctr"
+#line 313 "dk4appdeltree.ctr"
nbptr = job->sbptr;
lgt = job->sbsz;
}
-#line 309 "dk4appdeltree.ctr"
+#line 316 "dk4appdeltree.ctr"
do {
fn = dk4dir_next_file(back->dir);
if (NULL != fn) {
-#line 312 "dk4appdeltree.ctr"
+#line 319 "dk4appdeltree.ctr"
if (dk4str_cpy_s(nbptr,lgt,dk4dir_get_path(back->dir),NULL)) {
-#line 314 "dk4appdeltree.ctr"
+#line 321 "dk4appdeltree.ctr"
if (dk4str_cat_s(nbptr, lgt, dk4appdeltree_fnsep, NULL)) {
-#line 316 "dk4appdeltree.ctr"
+#line 323 "dk4appdeltree.ctr"
if (dk4str_cat_s(nbptr, lgt, fn, NULL)) {
-#line 318 "dk4appdeltree.ctr"
+#line 325 "dk4appdeltree.ctr"
-#line 319 "dk4appdeltree.ctr"
+#line 326 "dk4appdeltree.ctr"
switch (back->ne) {
case NE_NO_ERROR : {
if (0 == dk4app_del_file(nbptr, app)) {
@@ -390,7 +375,7 @@ dk4app_del_tree_node_open(
job->result = 0;
-#line 325 "dk4appdeltree.ctr"
+#line 332 "dk4appdeltree.ctr"
}
} break;
case NE_ONE_FILE_REMOVAL_FAILED : {
@@ -402,7 +387,7 @@ dk4app_del_tree_node_open(
);
-#line 335 "dk4appdeltree.ctr"
+#line 342 "dk4appdeltree.ctr"
}
} break;
default : {
@@ -410,7 +395,7 @@ dk4app_del_tree_node_open(
dfres = dk4app_del_file(nbptr, NULL);
if (0 == dfres) {
-#line 341 "dk4appdeltree.ctr"
+#line 348 "dk4appdeltree.ctr"
}
#else
dk4app_del_file(nbptr, NULL);
@@ -419,7 +404,7 @@ dk4app_del_tree_node_open(
}
} else {
-#line 348 "dk4appdeltree.ctr"
+#line 355 "dk4appdeltree.ctr"
if (NE_ONE_FILE_REMOVAL_FAILED < back->ne) {
back->ne = NE_ONE_FILE_REMOVAL_FAILED;
}
@@ -430,7 +415,7 @@ dk4app_del_tree_node_open(
}
} else {
-#line 357 "dk4appdeltree.ctr"
+#line 364 "dk4appdeltree.ctr"
if (NE_ONE_FILE_REMOVAL_FAILED < back->ne) {
back->ne = NE_ONE_FILE_REMOVAL_FAILED;
}
@@ -441,7 +426,7 @@ dk4app_del_tree_node_open(
}
} else {
-#line 366 "dk4appdeltree.ctr"
+#line 373 "dk4appdeltree.ctr"
if (NE_ONE_FILE_REMOVAL_FAILED < back->ne) {
back->ne = NE_ONE_FILE_REMOVAL_FAILED;
}
@@ -455,11 +440,11 @@ dk4app_del_tree_node_open(
dk4dir_skip_files(back->dir);
} else {
-#line 378 "dk4appdeltree.ctr"
+#line 385 "dk4appdeltree.ctr"
}
} else {
-#line 380 "dk4appdeltree.ctr"
+#line 387 "dk4appdeltree.ctr"
/* ERROR: Math error in size calculation */
dk4app_log_base1(app, DK4_LL_ERROR, 82);
dk4app_del_tree_node_close(back);
@@ -468,7 +453,7 @@ dk4app_del_tree_node_open(
}
} else {
-#line 387 "dk4appdeltree.ctr"
+#line 394 "dk4appdeltree.ctr"
dk4app_del_tree_node_close(back);
back = NULL;
job->result = 0;
@@ -477,11 +462,11 @@ dk4app_del_tree_node_open(
}
} else {
-#line 394 "dk4appdeltree.ctr"
+#line 401 "dk4appdeltree.ctr"
}
-#line 396 "dk4appdeltree.ctr"
+#line 403 "dk4appdeltree.ctr"
return back;
}
@@ -528,7 +513,10 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
-#line 441 "dk4appdeltree.ctr"
+#line 448 "dk4appdeltree.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
job.sbptr = sb;
job.sbsz = DK4_SIZEOF(sb,dkChar);
job.dbptr = NULL;
@@ -536,32 +524,32 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
job.result = 1;
if (NULL != fn) {
-#line 447 "dk4appdeltree.ctr"
+#line 457 "dk4appdeltree.ctr"
cn = dk4app_del_tree_node_open(fn, NULL, &job, app);
if (NULL != cn) {
-#line 449 "dk4appdeltree.ctr"
+#line 459 "dk4appdeltree.ctr"
while (NULL != cn) {
-#line 450 "dk4appdeltree.ctr"
+#line 460 "dk4appdeltree.ctr"
if ((NULL != job.dbptr) && (0 < job.dbsz)) {
fnb = job.dbptr; fnbsz = job.dbsz;
-#line 452 "dk4appdeltree.ctr"
+#line 462 "dk4appdeltree.ctr"
} else {
-#line 453 "dk4appdeltree.ctr"
+#line 463 "dk4appdeltree.ctr"
fnb = job.sbptr; fnbsz = job.sbsz;
}
dn = dk4dir_next_dir(cn->dir);
if (NULL != dn) {
-#line 457 "dk4appdeltree.ctr"
+#line 467 "dk4appdeltree.ctr"
if (0 != dk4str_cpy_s(fnb, fnbsz, dk4dir_get_path(cn->dir), NULL)) {
if (0 != dk4str_cat_s(fnb, fnbsz, dk4appdeltree_fnsep, NULL)) {
if (0 != dk4str_cat_s(fnb, fnbsz, dn, NULL)) {
-#line 460 "dk4appdeltree.ctr"
+#line 470 "dk4appdeltree.ctr"
#if DK4_ON_WINDOWS
res = dk4app_del_tree_process_dir(fnb);
#else
@@ -569,7 +557,7 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
#endif
if (0 != res) {
-#line 466 "dk4appdeltree.ctr"
+#line 476 "dk4appdeltree.ctr"
nn = dk4app_del_tree_node_open(fnb, cn, &job, app);
if (NULL != nn) {
cn = nn;
@@ -578,7 +566,7 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
}
} else {
-#line 473 "dk4appdeltree.ctr"
+#line 483 "dk4appdeltree.ctr"
switch (cn->ne) {
case NE_NO_ERROR:
case NE_ONE_FILE_REMOVAL_FAILED:
@@ -591,7 +579,7 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
dk4app_log_base3(app, DK4_LL_ERROR, 66, 77, fnb);
-#line 484 "dk4appdeltree.ctr"
+#line 494 "dk4appdeltree.ctr"
}
}
} break;
@@ -606,7 +594,7 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
);
-#line 497 "dk4appdeltree.ctr"
+#line 507 "dk4appdeltree.ctr"
}
}
} break;
@@ -617,7 +605,7 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
dfres = dk4app_del_file(fnb, NULL);
if (0 == dfres) {
-#line 506 "dk4appdeltree.ctr"
+#line 516 "dk4appdeltree.ctr"
}
#else
dk4app_del_file(fnb, NULL);
@@ -628,32 +616,32 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
}
} else {
-#line 515 "dk4appdeltree.ctr"
+#line 525 "dk4appdeltree.ctr"
/* ERROR: Directory name too long! */
dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, dn);
job.result = 0;
}
} else {
-#line 520 "dk4appdeltree.ctr"
+#line 530 "dk4appdeltree.ctr"
/* ERROR: Directory name too long! */
dk4app_log_base3(app,DK4_LL_ERROR,98,99,dk4dir_get_path(cn->dir));
job.result = 0;
}
} else {
-#line 525 "dk4appdeltree.ctr"
+#line 535 "dk4appdeltree.ctr"
/* ERROR: Directory name too long! */
dk4app_log_base3(app,DK4_LL_ERROR,98,99,dk4dir_get_path(cn->dir));
job.result = 0;
}
} else {
-#line 530 "dk4appdeltree.ctr"
+#line 540 "dk4appdeltree.ctr"
nn = cn->parent;
if (NULL != nn) {
-#line 532 "dk4appdeltree.ctr"
+#line 542 "dk4appdeltree.ctr"
switch (nn->ne) {
case NE_NO_ERROR:
case NE_ONE_FILE_REMOVAL_FAILED:
@@ -684,7 +672,7 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
}
} else {
-#line 561 "dk4appdeltree.ctr"
+#line 571 "dk4appdeltree.ctr"
if (0 == dk4app_del_dir(dk4dir_get_path(cn->dir), app)) {
job.result = 0;
}
@@ -695,21 +683,21 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
}
} else {
-#line 570 "dk4appdeltree.ctr"
+#line 580 "dk4appdeltree.ctr"
}
} else {
-#line 572 "dk4appdeltree.ctr"
+#line 582 "dk4appdeltree.ctr"
}
if ((NULL != job.dbptr) && (0 < job.dbsz)) {
dk4mem_free(job.dbptr);
-#line 575 "dk4appdeltree.ctr"
+#line 585 "dk4appdeltree.ctr"
}
back = job.result;
-#line 578 "dk4appdeltree.ctr"
+#line 588 "dk4appdeltree.ctr"
return back;
}
diff --git a/support/dktools/dk4appdeltree.ctr b/support/dktools/dk4appdeltree.ctr
index a9d65c42c3..d26adac8e6 100644
--- a/support/dktools/dk4appdeltree.ctr
+++ b/support/dktools/dk4appdeltree.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -86,6 +86,13 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -438,6 +445,9 @@ dk4app_del_tree(const dkChar *fn, dk4_app_t *app)
int back = 0;
$? "+ dk4app_del_tree \"%!ds\"", TR_DKSTR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
job.sbptr = sb;
job.sbsz = DK4_SIZEOF(sb,dkChar);
job.dbptr = NULL;
diff --git a/support/dktools/dk4appenc.c b/support/dktools/dk4appenc.c
index 466ab4e08d..b52a4da247 100644
--- a/support/dktools/dk4appenc.c
+++ b/support/dktools/dk4appenc.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appenc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appenc.ctr
*/
/** @file dk4appenc.c The dk4appenc module.
@@ -76,14 +54,18 @@ dk4app_get_encoding_without_app(int *dptr)
int
-dk4app_get_encoding(dk4_app_t *app)
+dk4app_get_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->encoding;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
@@ -92,14 +74,18 @@ dk4app_get_encoding(dk4_app_t *app)
int
-dk4app_get_stdin_encoding(dk4_app_t *app)
+dk4app_get_stdin_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->enc_in_std;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
@@ -108,14 +94,18 @@ dk4app_get_stdin_encoding(dk4_app_t *app)
int
-dk4app_get_file_in_encoding(dk4_app_t *app)
+dk4app_get_file_in_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->enc_in_file;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
@@ -124,14 +114,18 @@ dk4app_get_file_in_encoding(dk4_app_t *app)
int
-dk4app_get_stdout_encoding(dk4_app_t *app)
+dk4app_get_stdout_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->enc_out_std;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
@@ -140,14 +134,18 @@ dk4app_get_stdout_encoding(dk4_app_t *app)
int
-dk4app_get_file_out_encoding(dk4_app_t *app)
+dk4app_get_file_out_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->enc_out_file;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
diff --git a/support/dktools/dk4appenc.ctr b/support/dktools/dk4appenc.ctr
index 99314a5930..e7d7b95bb3 100644
--- a/support/dktools/dk4appenc.ctr
+++ b/support/dktools/dk4appenc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -43,14 +43,18 @@ dk4app_get_encoding_without_app(int *dptr)
int
-dk4app_get_encoding(dk4_app_t *app)
+dk4app_get_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->encoding;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
@@ -59,14 +63,18 @@ dk4app_get_encoding(dk4_app_t *app)
int
-dk4app_get_stdin_encoding(dk4_app_t *app)
+dk4app_get_stdin_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->enc_in_std;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
@@ -75,14 +83,18 @@ dk4app_get_stdin_encoding(dk4_app_t *app)
int
-dk4app_get_file_in_encoding(dk4_app_t *app)
+dk4app_get_file_in_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->enc_in_file;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
@@ -91,14 +103,18 @@ dk4app_get_file_in_encoding(dk4_app_t *app)
int
-dk4app_get_stdout_encoding(dk4_app_t *app)
+dk4app_get_stdout_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->enc_out_std;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
@@ -107,14 +123,18 @@ dk4app_get_stdout_encoding(dk4_app_t *app)
int
-dk4app_get_file_out_encoding(dk4_app_t *app)
+dk4app_get_file_out_encoding(dk4_app_t const *app)
{
int back;
if (NULL != app) {
back = app->enc_out_file;
} else {
if (0 == dk4app_get_encoding_without_app(&back)) {
- back = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back = DK4_FILE_ENCODING_WIN1252;
+#else
+ back = DK4_FILE_ENCODING_PLAIN;
+#endif
}
}
return back;
diff --git a/support/dktools/dk4appfne.c b/support/dktools/dk4appfne.c
index a8853505af..bf1ce837c9 100644
--- a/support/dktools/dk4appfne.c
+++ b/support/dktools/dk4appfne.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appfne.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appfne.ctr
*/
/** @file dk4appfne.c The dk4appfne module.
@@ -57,6 +35,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4strd.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
dk4_dir_t *
@@ -64,6 +48,10 @@ dk4app_fne_open(const dkChar *pattern, dk4_app_t *app)
{
dk4_er_t er;
dk4_dir_t *back = NULL;
+
+#if DK4_USE_ASSERT
+ assert(NULL != pattern);
+#endif
if (NULL != pattern) {
dk4error_init(&er);
back = dk4fne_open(pattern, &er);
@@ -105,6 +93,12 @@ dk4app_fne_one_file(
const dkChar *dirname;
const dkChar *filename;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fne);
+ assert(NULL != pattern);
+#endif
if ((NULL != dptr) && (NULL != fne) && (0 < szdptr)) {
dirname = dk4dir_get_path(fne);
filename = dk4dir_next_file(fne);
diff --git a/support/dktools/dk4appfne.ctr b/support/dktools/dk4appfne.ctr
index afb9538690..40579ef189 100644
--- a/support/dktools/dk4appfne.ctr
+++ b/support/dktools/dk4appfne.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -26,6 +26,12 @@ license = bsd
#include "dk4strd.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
dk4_dir_t *
@@ -33,6 +39,10 @@ dk4app_fne_open(const dkChar *pattern, dk4_app_t *app)
{
dk4_er_t er;
dk4_dir_t *back = NULL;
+
+#if DK4_USE_ASSERT
+ assert(NULL != pattern);
+#endif
if (NULL != pattern) {
dk4error_init(&er);
back = dk4fne_open(pattern, &er);
@@ -74,6 +84,12 @@ dk4app_fne_one_file(
const dkChar *dirname;
const dkChar *filename;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fne);
+ assert(NULL != pattern);
+#endif
if ((NULL != dptr) && (NULL != fne) && (0 < szdptr)) {
dirname = dk4dir_get_path(fne);
filename = dk4dir_next_file(fne);
diff --git a/support/dktools/dk4appfs01.c b/support/dktools/dk4appfs01.c
index 17fe53ba04..c7eb4c8b43 100644
--- a/support/dktools/dk4appfs01.c
+++ b/support/dktools/dk4appfs01.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appfs01.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appfs01.ctr
*/
/** @file dk4appfs01.c The dk4appfs01 module.
@@ -47,6 +25,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4fs.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +46,12 @@ dk4app_search_one_config_file(
{
#if VERSION_BEFORE_2017_03_09
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
back = dk4fs_config_one(
dptr, szdptr, shortname,
@@ -73,8 +63,14 @@ dk4app_search_one_config_file(
}
return back;
#else
- const char *msg[3];
+ const dkChar *msg[3];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
back = dk4fs_config_construct_compat_one(
dptr, szdptr, shortname,
diff --git a/support/dktools/dk4appfs01.ctr b/support/dktools/dk4appfs01.ctr
index 388d495215..4e0ac02365 100644
--- a/support/dktools/dk4appfs01.ctr
+++ b/support/dktools/dk4appfs01.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,6 +16,12 @@ license = bsd
#include "dk4fs.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -31,6 +37,12 @@ dk4app_search_one_config_file(
{
#if VERSION_BEFORE_2017_03_09
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
back = dk4fs_config_one(
dptr, szdptr, shortname,
@@ -42,8 +54,14 @@ dk4app_search_one_config_file(
}
return back;
#else
- const char *msg[3];
+ const dkChar *msg[3];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
back = dk4fs_config_construct_compat_one(
dptr, szdptr, shortname,
diff --git a/support/dktools/dk4appfs02.c b/support/dktools/dk4appfs02.c
index 442e5abc1d..d7f0aab538 100644
--- a/support/dktools/dk4appfs02.c
+++ b/support/dktools/dk4appfs02.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appfs02.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appfs02.ctr
*/
/** @file dk4appfs02.c The dk4appfs02 module.
@@ -47,11 +25,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4fs.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 22 "dk4appfs02.ctr"
+#line 28 "dk4appfs02.ctr"
@@ -70,14 +54,20 @@ dk4app_search_one_data_file(
int back = 0;
-#line 39 "dk4appfs02.ctr"
+#line 45 "dk4appfs02.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
-#line 41 "dk4appfs02.ctr"
+#line 53 "dk4appfs02.ctr"
-#line 42 "dk4appfs02.ctr"
+#line 54 "dk4appfs02.ctr"
back = dk4fs_data_one(
dptr, szdptr, shortname,
app->dir_share, app->user_home,
@@ -89,21 +79,27 @@ dk4app_search_one_data_file(
}
-#line 52 "dk4appfs02.ctr"
+#line 64 "dk4appfs02.ctr"
return back;
#else
- const char *msg[3];
+ const dkChar *msg[3];
int back = 0;
-#line 57 "dk4appfs02.ctr"
+#line 69 "dk4appfs02.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
-#line 59 "dk4appfs02.ctr"
+#line 77 "dk4appfs02.ctr"
-#line 60 "dk4appfs02.ctr"
+#line 78 "dk4appfs02.ctr"
back = dk4fs_data_construct_one(
dptr, szdptr, shortname,
app->dir_share, app->language, app->region, app->user_home,
@@ -136,7 +132,7 @@ dk4app_search_one_data_file(
}
-#line 91 "dk4appfs02.ctr"
+#line 109 "dk4appfs02.ctr"
return back;
#endif
}
diff --git a/support/dktools/dk4appfs02.ctr b/support/dktools/dk4appfs02.ctr
index 4ef2443c3e..5690aeccdb 100644
--- a/support/dktools/dk4appfs02.ctr
+++ b/support/dktools/dk4appfs02.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,6 +16,12 @@ license = bsd
#include "dk4fs.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -36,6 +42,12 @@ dk4app_search_one_data_file(
#if VERSION_BEFORE_2017_03_09
int back = 0;
$? "+ dk4app_search_one_data_file \"%!ds\"", TR_DKSTR(shortname)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
$? ". language = \"%!ds\"", app->language
$? ". region = \"%!ds\"", app->region
@@ -51,9 +63,15 @@ dk4app_search_one_data_file(
$? "- dk4app_search_one_data_file %d", back
return back;
#else
- const char *msg[3];
+ const dkChar *msg[3];
int back = 0;
$? "+ dk4app_search_one_data_file \"%!ds\"", TR_DKSTR(shortname)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
$? ". language = \"%!ds\"", app->language
$? ". region = \"%!ds\"", app->region
diff --git a/support/dktools/dk4appfs03.c b/support/dktools/dk4appfs03.c
index 0e93541847..cc4c46cd15 100644
--- a/support/dktools/dk4appfs03.c
+++ b/support/dktools/dk4appfs03.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appfs03.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appfs03.ctr
*/
/** @file dk4appfs03.c The dk4appfs03 module.
@@ -51,11 +29,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4const.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 26 "dk4appfs03.ctr"
+#line 32 "dk4appfs03.ctr"
@@ -74,6 +58,12 @@ dk4app_search_i_data_file(
int back = 0;
int nPasses;
int i;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
nPasses = maxpass;
for (i = 0; ((0 == back) && (i <= nPasses)); i++) {
@@ -105,7 +95,13 @@ dk4app_search_data_file(
int back = 0;
-#line 74 "dk4appfs03.ctr"
+#line 86 "dk4appfs03.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if (NULL != app) {
if ((NULL != app->msg_debug) && (39 < app->sz_msg_debug)) {
do_log = dk4app_log_do(app, DK4_LL_DEBUG);
@@ -113,10 +109,10 @@ dk4app_search_data_file(
}
if (0 != do_log) {
-#line 80 "dk4appfs03.ctr"
+#line 98 "dk4appfs03.ctr"
-#line 81 "dk4appfs03.ctr"
+#line 99 "dk4appfs03.ctr"
msg[0] = (app->msg_debug)[32];
msg[1] = shortname;
msg[2] = (app->msg_debug)[35];
@@ -142,10 +138,10 @@ dk4app_search_data_file(
dptr, szdptr, app, shortname, maxpass, compressed, erp
);
-#line 105 "dk4appfs03.ctr"
+#line 123 "dk4appfs03.ctr"
if (0 != back) {
-#line 106 "dk4appfs03.ctr"
+#line 124 "dk4appfs03.ctr"
msg[0] = (app->msg_debug)[21];
msg[1] = shortname;
msg[2] = (app->msg_debug)[23];
@@ -154,7 +150,7 @@ dk4app_search_data_file(
dk4app_log_msg(app, DK4_LL_DEBUG, msg, 4);
} else {
-#line 113 "dk4appfs03.ctr"
+#line 131 "dk4appfs03.ctr"
msg[0] = (app->msg_debug)[21];
msg[1] = shortname;
msg[2] = (app->msg_debug)[22];
@@ -163,13 +159,13 @@ dk4app_search_data_file(
}
} else {
-#line 120 "dk4appfs03.ctr"
+#line 138 "dk4appfs03.ctr"
back = dk4app_search_i_data_file(
dptr, szdptr, app, shortname, maxpass, compressed, erp
);
}
-#line 124 "dk4appfs03.ctr"
+#line 142 "dk4appfs03.ctr"
return back;
}
diff --git a/support/dktools/dk4appfs03.ctr b/support/dktools/dk4appfs03.ctr
index 1fd8d26a74..781397d481 100644
--- a/support/dktools/dk4appfs03.ctr
+++ b/support/dktools/dk4appfs03.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -20,6 +20,12 @@ license = bsd
#include "dk4const.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -41,6 +47,12 @@ dk4app_search_i_data_file(
int back = 0;
int nPasses;
int i;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
nPasses = maxpass;
for (i = 0; ((0 == back) && (i <= nPasses)); i++) {
@@ -71,6 +83,12 @@ dk4app_search_data_file(
int do_log = 0;
int back = 0;
$? "+ dk4app_search_data_file"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if (NULL != app) {
if ((NULL != app->msg_debug) && (39 < app->sz_msg_debug)) {
do_log = dk4app_log_do(app, DK4_LL_DEBUG);
diff --git a/support/dktools/dk4appfs04.c b/support/dktools/dk4appfs04.c
index 26a372621c..af1e5fa9ca 100644
--- a/support/dktools/dk4appfs04.c
+++ b/support/dktools/dk4appfs04.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appfs04.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appfs04.ctr
*/
/** @file dk4appfs04.c The dk4appfs04 module.
@@ -59,6 +37,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+static
int
dk4app_search_i_config_file(
dkChar *dptr,
@@ -73,6 +52,12 @@ dk4app_search_i_config_file(
int back = 0;
int nPasses;
int i;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
nPasses = maxpass;
for (i = 0; ((0 == back) && (i <= nPasses)); i++) {
@@ -102,6 +87,12 @@ dk4app_search_config_file(
const dkChar *msg[5];
int do_log = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if (NULL != app) {
if ((NULL != app->msg_debug) && (39 < app->sz_msg_debug)) {
do_log = dk4app_log_do(app, DK4_LL_DEBUG);
diff --git a/support/dktools/dk4appfs04.ctr b/support/dktools/dk4appfs04.ctr
index d0b58d58a1..d02f6549eb 100644
--- a/support/dktools/dk4appfs04.ctr
+++ b/support/dktools/dk4appfs04.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -26,6 +26,7 @@ $!trace-include
+static
int
dk4app_search_i_config_file(
dkChar *dptr,
@@ -40,6 +41,12 @@ dk4app_search_i_config_file(
int back = 0;
int nPasses;
int i;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != shortname)) {
nPasses = maxpass;
for (i = 0; ((0 == back) && (i <= nPasses)); i++) {
@@ -69,6 +76,12 @@ dk4app_search_config_file(
const dkChar *msg[5];
int do_log = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szdptr);
+ assert(NULL != shortname);
+ assert(NULL != app);
+#endif
if (NULL != app) {
if ((NULL != app->msg_debug) && (39 < app->sz_msg_debug)) {
do_log = dk4app_log_do(app, DK4_LL_DEBUG);
diff --git a/support/dktools/dk4apphlv.c b/support/dktools/dk4apphlv.c
index 054fbb96cf..0402f3b2f7 100644
--- a/support/dktools/dk4apphlv.c
+++ b/support/dktools/dk4apphlv.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4apphlv.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4apphlv.ctr
*/
/** @file dk4apphlv.c The dk4apphlv module.
@@ -51,17 +29,24 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4strmr.h"
#include "dk4enc.h"
#include "dk4const.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 27 "dk4apphlv.ctr"
+#line 34 "dk4apphlv.ctr"
int
-dk4app_can_run_normally(dk4_app_t *app)
+dk4app_can_run_normally(dk4_app_t const *app)
{
int back = 0;
if (NULL != app) {
@@ -77,12 +62,11 @@ dk4app_can_run_normally(dk4_app_t *app)
/** Show all strings in a text array, line by line.
CRT on Windows: Required.
- @param app Application structure.
@param array Array containing texts to show.
*/
static
void
-dk4app_show_text_array(dk4_app_t *app, const dkChar * const *array)
+dk4app_show_text_array(const dkChar * const *array)
{
while(*array) {
dk4fputs(*(array++), stdout, NULL);
@@ -118,11 +102,14 @@ int
dk4app_help_show_char_handler(
void *obj,
dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_help_shower_t *helpshow;
+
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
if (dkT('\r') != c) {
helpshow = (dk4_help_shower_t *)obj;
dk4fputc(c, helpshow->outfile, NULL);
@@ -141,10 +128,13 @@ dk4app_help_show_char_handler(
*/
static
void
-dk4app_show_help(dk4_app_t *app)
+dk4app_show_help(dk4_app_t const *app)
{
const dkChar * const *ptr;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app->help_text) {
ptr = app->help_text;
if (0 != (DK4_APP_CMD_ERROR & (app->hvl_cmd))) {
@@ -186,6 +176,9 @@ dk4app_show_manual(dk4_app_t *app)
int res;
int done = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app->help_file_name) {
res = dk4app_search_data_file(
fnb, DK4_SIZEOF(fnb,dkChar), app, app->help_file_name,
@@ -234,6 +227,10 @@ int
dk4app_help_version_license(dk4_app_t *app)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
+
if (NULL != app) {
back = 1;
if (0 != app->hvl_cmd) {
@@ -258,7 +255,7 @@ dk4app_help_version_license(dk4_app_t *app)
case DK4_APP_CMD_LICENSE: {
if (NULL != app->lic_text) {
dk4fput_initialize_stdout();
- dk4app_show_text_array(app, app->lic_text);
+ dk4app_show_text_array(app->lic_text);
}
} break;
default: {
diff --git a/support/dktools/dk4apphlv.ctr b/support/dktools/dk4apphlv.ctr
index aec00122f8..c66da8202e 100644
--- a/support/dktools/dk4apphlv.ctr
+++ b/support/dktools/dk4apphlv.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -20,7 +20,14 @@ license = bsd
#include "dk4strmr.h"
#include "dk4enc.h"
#include "dk4const.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -28,7 +35,7 @@ $!trace-include
int
-dk4app_can_run_normally(dk4_app_t *app)
+dk4app_can_run_normally(dk4_app_t const *app)
{
int back = 0;
if (NULL != app) {
@@ -44,12 +51,11 @@ dk4app_can_run_normally(dk4_app_t *app)
/** Show all strings in a text array, line by line.
CRT on Windows: Required.
- @param app Application structure.
@param array Array containing texts to show.
*/
static
void
-dk4app_show_text_array(dk4_app_t *app, const dkChar * const *array)
+dk4app_show_text_array(const dkChar * const *array)
{
while(*array) {
dk4fputs(*(array++), stdout, NULL);
@@ -85,11 +91,14 @@ int
dk4app_help_show_char_handler(
void *obj,
dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_help_shower_t *helpshow;
+
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
if (dkT('\r') != c) {
helpshow = (dk4_help_shower_t *)obj;
dk4fputc(c, helpshow->outfile, NULL);
@@ -108,10 +117,13 @@ dk4app_help_show_char_handler(
*/
static
void
-dk4app_show_help(dk4_app_t *app)
+dk4app_show_help(dk4_app_t const *app)
{
const dkChar * const *ptr;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app->help_text) {
ptr = app->help_text;
if (0 != (DK4_APP_CMD_ERROR & (app->hvl_cmd))) {
@@ -153,6 +165,9 @@ dk4app_show_manual(dk4_app_t *app)
int res;
int done = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app->help_file_name) {
res = dk4app_search_data_file(
fnb, DK4_SIZEOF(fnb,dkChar), app, app->help_file_name,
@@ -201,6 +216,10 @@ int
dk4app_help_version_license(dk4_app_t *app)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
+
if (NULL != app) {
back = 1;
if (0 != app->hvl_cmd) {
@@ -225,7 +244,7 @@ dk4app_help_version_license(dk4_app_t *app)
case DK4_APP_CMD_LICENSE: {
if (NULL != app->lic_text) {
dk4fput_initialize_stdout();
- dk4app_show_text_array(app, app->lic_text);
+ dk4app_show_text_array(app->lic_text);
}
} break;
default: {
diff --git a/support/dktools/dk4appi.c b/support/dktools/dk4appi.c
index 5310f92a33..c1ea50d7df 100644
--- a/support/dktools/dk4appi.c
+++ b/support/dktools/dk4appi.c
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK4APPI_C_INCLUDED
#define DK4APPI_C_INCLUDED 1
diff --git a/support/dktools/dk4applog.c b/support/dktools/dk4applog.c
index c066252d0e..b831b57195 100644
--- a/support/dktools/dk4applog.c
+++ b/support/dktools/dk4applog.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4applog.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4applog.ctr
*/
/** @file dk4applog.c The dk4applog module.
@@ -96,11 +74,31 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4fs.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+/** Log at application startup.
+ @param app Application structure.
+*/
+void
+dk4app_log_startup_debug(dk4_app_t *app);
+
+#ifdef __cplusplus
+}
+#endif
-#line 70 "dk4applog.ctr"
+
+
+#line 90 "dk4applog.ctr"
@@ -158,7 +156,7 @@ dkT("dk4pref.conf"),
NULL
-#line 109 "dk4applog.ctr"
+#line 129 "dk4applog.ctr"
};
@@ -673,7 +671,7 @@ dkT("\"!"),
NULL
-#line 574 "dk4applog.ctr"
+#line 594 "dk4applog.ctr"
};
@@ -832,7 +830,7 @@ dkT("Not a size specification!"),
NULL
-#line 673 "dk4applog.ctr"
+#line 693 "dk4applog.ctr"
};
@@ -847,28 +845,31 @@ dk4app_log_load_base_texts(dk4_app_t *app)
{
-#line 686 "dk4applog.ctr"
+#line 706 "dk4applog.ctr"
if (NULL != app) {
-#line 687 "dk4applog.ctr"
+#line 707 "dk4applog.ctr"
if ((NULL == app->msg_base) || (0 == app->sz_msg_base)) {
-#line 689 "dk4applog.ctr"
+#line 709 "dk4applog.ctr"
app->sz_msg_base = dk4app_string_table_size(dk4app_def_msg_base);
app->msg_base = dk4app_string_table(
app, dkT("dk4base.str"), dk4app_def_msg_base
);
- } else {
+ }
+#if TRACE_DEBUG
+ else {
-#line 694 "dk4applog.ctr"
+#line 716 "dk4applog.ctr"
}
+#endif
} else {
-#line 696 "dk4applog.ctr"
+#line 719 "dk4applog.ctr"
}
-#line 697 "dk4applog.ctr"
+#line 720 "dk4applog.ctr"
}
@@ -894,9 +895,12 @@ dk4app_log_any_non_null(const dkChar * const *msg, size_t sz)
int
-dk4app_log_do(dk4_app_t *app, int ll)
+dk4app_log_do(dk4_app_t const *app, int ll)
{
int back = 0;
+
+
+#line 749 "dk4applog.ctr"
if (NULL != app) {
#if (!(DK4_ON_WINDOWS && DK4_WIN_DENY_CRT))
if (0 != app->log_enabled) {
@@ -909,6 +913,9 @@ dk4app_log_do(dk4_app_t *app, int ll)
}
#endif
}
+
+
+#line 762 "dk4applog.ctr"
return back;
}
@@ -928,7 +935,7 @@ dk4app_log_do(dk4_app_t *app, int ll)
static
void
dk4app_log_msg_to_file(
- dk4_app_t *app,
+ dk4_app_t const *app,
int priority,
const dkChar * const *msg,
size_t sz,
@@ -1001,7 +1008,9 @@ dk4app_log_msg(
)
{
FILE *fipo;
+
+#line 855 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1048,6 +1057,9 @@ dk4app_log_msg(
}
}
}
+
+
+#line 902 "dk4applog.ctr"
}
@@ -1062,6 +1074,9 @@ dk4app_log_1(
)
{
const dkChar *msgtext;
+
+
+#line 917 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1071,6 +1086,9 @@ dk4app_log_1(
}
}
}
+
+
+#line 927 "dk4applog.ctr"
}
@@ -1086,6 +1104,9 @@ dk4app_log_2(
)
{
const dkChar *msgtext[3];
+
+
+#line 943 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1096,6 +1117,9 @@ dk4app_log_2(
}
}
}
+
+
+#line 954 "dk4applog.ctr"
}
@@ -1112,6 +1136,9 @@ dk4app_log_3(
)
{
const dkChar *msgtext[3];
+
+
+#line 971 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1123,6 +1150,9 @@ dk4app_log_3(
}
}
}
+
+
+#line 983 "dk4applog.ctr"
}
@@ -1141,6 +1171,9 @@ dk4app_log_5(
)
{
const dkChar *msgtext[5];
+
+
+#line 1002 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1154,6 +1187,9 @@ dk4app_log_5(
}
}
}
+
+
+#line 1016 "dk4applog.ctr"
}
@@ -1174,6 +1210,9 @@ dk4app_log_7(
)
{
const dkChar *msgtext[7];
+
+
+#line 1037 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1193,6 +1232,9 @@ dk4app_log_7(
}
}
}
+
+
+#line 1057 "dk4applog.ctr"
}
@@ -1204,12 +1246,18 @@ dk4app_log_base1(
size_t msgind
)
{
+
+
+#line 1069 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
dk4app_log_1(app, app->msg_base, app->sz_msg_base, priority, msgind);
}
}
+
+
+#line 1076 "dk4applog.ctr"
}
@@ -1222,12 +1270,18 @@ dk4app_log_base2(
const dkChar *t1
)
{
+
+
+#line 1089 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
dk4app_log_2(app,app->msg_base,app->sz_msg_base,priority,i1,t1);
}
}
+
+
+#line 1096 "dk4applog.ctr"
}
@@ -1241,6 +1295,9 @@ dk4app_log_base2c(
)
{
const dkChar *msgptr[2];
+
+
+#line 1110 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
if ((app->sz_msg_base > i1) && (app->sz_msg_base > i2)) {
@@ -1251,6 +1308,9 @@ dk4app_log_base2c(
}
}
}
+
+
+#line 1121 "dk4applog.ctr"
}
@@ -1264,12 +1324,18 @@ dk4app_log_base3(
const dkChar *t1
)
{
+
+
+#line 1135 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
dk4app_log_3(app,app->msg_base,app->sz_msg_base,priority,i1,i2,t1);
}
}
+
+
+#line 1142 "dk4applog.ctr"
}
@@ -1285,12 +1351,18 @@ dk4app_log_base5(
const dkChar *t2
)
{
+
+
+#line 1158 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
dk4app_log_5(app,app->msg_base,app->sz_msg_base,priority,i1,i2,i3,t1,t2);
}
}
+
+
+#line 1165 "dk4applog.ctr"
}
@@ -1308,6 +1380,9 @@ dk4app_log_base7(
const dkChar *t3
)
{
+
+
+#line 1183 "dk4applog.ctr"
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1316,6 +1391,9 @@ dk4app_log_base7(
);
}
}
+
+
+#line 1192 "dk4applog.ctr"
}
@@ -1335,6 +1413,9 @@ dk4app_log_with_errno(
{
dkChar enb[64];
int res;
+
+
+#line 1212 "dk4applog.ctr"
if (NULL != app) {
res = dk4ma_write_decimal_signed(
enb, DK4_SIZEOF(enb,dkChar), (dk4_im_t)errn, 0, NULL
@@ -1345,29 +1426,44 @@ dk4app_log_with_errno(
dk4app_log_base3(app, priority, i4, i5, t1);
}
}
+
+
+#line 1223 "dk4applog.ctr"
}
const dkChar *
-dk4app_get_log_source_file(dk4_app_t *app)
+dk4app_get_log_source_file(dk4_app_t const *app)
{
const dkChar *back = NULL;
+
+
+#line 1232 "dk4applog.ctr"
if (NULL != app) {
back = app->source_file_name;
}
+
+
+#line 1236 "dk4applog.ctr"
return back;
}
dk4_um_t
-dk4app_get_log_source_line(dk4_app_t *app)
+dk4app_get_log_source_line(dk4_app_t const *app)
{
dk4_um_t back = (dk4_um_t)0UL;
+
+
+#line 1246 "dk4applog.ctr"
if (NULL != app) {
back = app->source_file_line;
}
+
+
+#line 1250 "dk4applog.ctr"
return back;
}
@@ -1376,6 +1472,9 @@ dk4app_get_log_source_line(dk4_app_t *app)
void
dk4app_set_log_source_file(dk4_app_t *app, const dkChar *fn)
{
+
+
+#line 1259 "dk4applog.ctr"
if (NULL != app) {
app->source_file_name = fn;
}
@@ -1386,6 +1485,9 @@ dk4app_set_log_source_file(dk4_app_t *app, const dkChar *fn)
void
dk4app_set_log_source_line(dk4_app_t *app, dk4_um_t lineno)
{
+
+
+#line 1270 "dk4applog.ctr"
if (NULL != app) {
app->source_file_line = lineno;
}
@@ -1399,18 +1501,18 @@ dk4app_log_debug_texts(dk4_app_t *app, size_t *szptr)
const dkChar * const *back = NULL;
-#line 1226 "dk4applog.ctr"
+#line 1282 "dk4applog.ctr"
if (NULL != app) {
-#line 1227 "dk4applog.ctr"
+#line 1283 "dk4applog.ctr"
dk4app_log_load_base_texts(app);
if ((NULL != app->msg_debug) && (0 < app->sz_msg_debug)) {
back = app->msg_debug;
-#line 1230 "dk4applog.ctr"
+#line 1286 "dk4applog.ctr"
} else {
-#line 1231 "dk4applog.ctr"
+#line 1287 "dk4applog.ctr"
app->msg_debug = dk4app_string_table(
app, dk4app_log_kwnl[2], dk4app_def_msg_debug
);
@@ -1419,7 +1521,7 @@ dk4app_log_debug_texts(dk4_app_t *app, size_t *szptr)
}
} else {
-#line 1238 "dk4applog.ctr"
+#line 1294 "dk4applog.ctr"
back = dk4app_def_msg_debug;
}
if (NULL != szptr) {
@@ -1427,7 +1529,7 @@ dk4app_log_debug_texts(dk4_app_t *app, size_t *szptr)
}
-#line 1244 "dk4applog.ctr"
+#line 1300 "dk4applog.ctr"
return back;
}
@@ -1442,6 +1544,9 @@ dk4app_log_two_strings_at_startup(
)
{
const dkChar *msg[3];
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
msg[0] = title;
msg[1] = value;
if (NULL == value) {
@@ -1462,6 +1567,9 @@ dk4app_log_startup_log_level(
)
{
const dkChar *llstr = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if ((DK4_LL_NONE <= ll) && (DK4_LL_IGNORE >= ll)) {
llstr = (app->msg_base)[(size_t)ll];
}
@@ -1480,12 +1588,15 @@ dk4app_log_startup_encoding(
)
{
const dkChar *encstr = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (0 != isfileenc) {
switch (enc) {
- case DK4_FILE_ENCODING_ASCII : {
+ case DK4_FILE_ENCODING_PLAIN : {
encstr = dk4app_log_kwnl[5];
} break;
- case DK4_FILE_ENCODING_ANSI : {
+ case DK4_FILE_ENCODING_WIN1252 : {
encstr = dk4app_log_kwnl[6];
} break;
case DK4_FILE_ENCODING_UTF8 : {
@@ -1506,10 +1617,10 @@ dk4app_log_startup_encoding(
}
} else {
switch (enc) {
- case DK4_ENCODING_ASCII : {
+ case DK4_ENCODING_PLAIN : {
encstr = dk4app_log_kwnl[5];
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
encstr = dk4app_log_kwnl[6];
} break;
case DK4_ENCODING_UTF8 : {
@@ -1540,7 +1651,10 @@ dk4app_log_startup_debug(dk4_app_t *app)
int pn = 0;
-#line 1355 "dk4applog.ctr"
+#line 1420 "dk4applog.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
if (0 != dk4app_log_do(app, DK4_LL_DEBUG)) {
/* Obtain localized texts */
@@ -1661,6 +1775,6 @@ dk4app_log_startup_debug(dk4_app_t *app)
}
-#line 1474 "dk4applog.ctr"
+#line 1542 "dk4applog.ctr"
}
diff --git a/support/dktools/dk4applog.ctr b/support/dktools/dk4applog.ctr
index 10c7d32416..1b5d7d50ba 100644
--- a/support/dktools/dk4applog.ctr
+++ b/support/dktools/dk4applog.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -64,6 +64,26 @@ license = bsd
#include "dk4fs.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Log at application startup.
+ @param app Application structure.
+*/
+void
+dk4app_log_startup_debug(dk4_app_t *app);
+
+#ifdef __cplusplus
+}
+#endif
$!trace-include
@@ -690,8 +710,11 @@ dk4app_log_load_base_texts(dk4_app_t *app)
app->msg_base = dk4app_string_table(
app, dkT("dk4base.str"), dk4app_def_msg_base
);
- } else { $? ". already available"
}
+#if TRACE_DEBUG
+ else { $? ". already available"
+ }
+#endif
} else { $? "! app"
} $? "- dk4app_log_load_base_texts"
}
@@ -719,9 +742,10 @@ dk4app_log_any_non_null(const dkChar * const *msg, size_t sz)
int
-dk4app_log_do(dk4_app_t *app, int ll)
+dk4app_log_do(dk4_app_t const *app, int ll)
{
int back = 0;
+ $? "+ dk4app_log_do ll=%d", ll
if (NULL != app) {
#if (!(DK4_ON_WINDOWS && DK4_WIN_DENY_CRT))
if (0 != app->log_enabled) {
@@ -734,6 +758,7 @@ dk4app_log_do(dk4_app_t *app, int ll)
}
#endif
}
+ $? "- dk4app_log_do %d", back
return back;
}
@@ -753,7 +778,7 @@ dk4app_log_do(dk4_app_t *app, int ll)
static
void
dk4app_log_msg_to_file(
- dk4_app_t *app,
+ dk4_app_t const *app,
int priority,
const dkChar * const *msg,
size_t sz,
@@ -826,7 +851,7 @@ dk4app_log_msg(
)
{
FILE *fipo;
-
+ $? "+ dk4app_log_msg ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -873,6 +898,7 @@ dk4app_log_msg(
}
}
}
+ $? "- dk4app_log_msg"
}
@@ -887,6 +913,7 @@ dk4app_log_1(
)
{
const dkChar *msgtext;
+ $? "+ dk4app_log_1 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -896,6 +923,7 @@ dk4app_log_1(
}
}
}
+ $? "- dk4app_log_1"
}
@@ -911,6 +939,7 @@ dk4app_log_2(
)
{
const dkChar *msgtext[3];
+ $? "+ dk4app_log_2 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -921,6 +950,7 @@ dk4app_log_2(
}
}
}
+ $? "- dk4app_log_2"
}
@@ -937,6 +967,7 @@ dk4app_log_3(
)
{
const dkChar *msgtext[3];
+ $? "+ dk4app_log_3 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -948,6 +979,7 @@ dk4app_log_3(
}
}
}
+ $? "- dk4app_log_3"
}
@@ -966,6 +998,7 @@ dk4app_log_5(
)
{
const dkChar *msgtext[5];
+ $? "+ dk4app_log_5 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -979,6 +1012,7 @@ dk4app_log_5(
}
}
}
+ $? "- dk4app_log_5"
}
@@ -999,6 +1033,7 @@ dk4app_log_7(
)
{
const dkChar *msgtext[7];
+ $? "+ dk4app_log_7 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1018,6 +1053,7 @@ dk4app_log_7(
}
}
}
+ $? "- dk4app_log_7"
}
@@ -1029,12 +1065,14 @@ dk4app_log_base1(
size_t msgind
)
{
+ $? "+ dk4app_log_base1 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
dk4app_log_1(app, app->msg_base, app->sz_msg_base, priority, msgind);
}
}
+ $? "- dk4app_log_base1"
}
@@ -1047,12 +1085,14 @@ dk4app_log_base2(
const dkChar *t1
)
{
+ $? "+ dk4app_log_base2 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
dk4app_log_2(app,app->msg_base,app->sz_msg_base,priority,i1,t1);
}
}
+ $? "- dk4app_log_base2"
}
@@ -1066,6 +1106,7 @@ dk4app_log_base2c(
)
{
const dkChar *msgptr[2];
+ $? "+ dk4app_log_base2c ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
if ((app->sz_msg_base > i1) && (app->sz_msg_base > i2)) {
@@ -1076,6 +1117,7 @@ dk4app_log_base2c(
}
}
}
+ $? "- dk4app_log_base2c"
}
@@ -1089,12 +1131,14 @@ dk4app_log_base3(
const dkChar *t1
)
{
+ $? "+ dk4app_log_base3 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
dk4app_log_3(app,app->msg_base,app->sz_msg_base,priority,i1,i2,t1);
}
}
+ $? "- dk4app_log_base3"
}
@@ -1110,12 +1154,14 @@ dk4app_log_base5(
const dkChar *t2
)
{
+ $? "+ dk4app_log_base5 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
dk4app_log_5(app,app->msg_base,app->sz_msg_base,priority,i1,i2,i3,t1,t2);
}
}
+ $? "- dk4app_log_base5"
}
@@ -1133,6 +1179,7 @@ dk4app_log_base7(
const dkChar *t3
)
{
+ $? "+ dk4app_log_base7 ll=%d", priority
if (NULL != app) {
if (0 != dk4app_log_do(app, priority)) {
dk4app_log_load_base_texts(app);
@@ -1141,6 +1188,7 @@ dk4app_log_base7(
);
}
}
+ $? "- dk4app_log_base7"
}
@@ -1160,6 +1208,7 @@ dk4app_log_with_errno(
{
dkChar enb[64];
int res;
+ $? "+ dk4app_log_with_errno ll=%d errno=%d", priority, errno
if (NULL != app) {
res = dk4ma_write_decimal_signed(
enb, DK4_SIZEOF(enb,dkChar), (dk4_im_t)errn, 0, NULL
@@ -1170,29 +1219,34 @@ dk4app_log_with_errno(
dk4app_log_base3(app, priority, i4, i5, t1);
}
}
+ $? "- dk4app_log_with_errno"
}
const dkChar *
-dk4app_get_log_source_file(dk4_app_t *app)
+dk4app_get_log_source_file(dk4_app_t const *app)
{
const dkChar *back = NULL;
+ $? "+ dk4app_get_log_source_file"
if (NULL != app) {
back = app->source_file_name;
}
+ $? "- dk4app_get_log_source_file %!ds", TR_STR(back)
return back;
}
dk4_um_t
-dk4app_get_log_source_line(dk4_app_t *app)
+dk4app_get_log_source_line(dk4_app_t const *app)
{
dk4_um_t back = (dk4_um_t)0UL;
+ $? "+ dk4app_get_log_source_line"
if (NULL != app) {
back = app->source_file_line;
}
+ $? "- dk4app_get_log_source_line %lu", (unsigned long)back
return back;
}
@@ -1201,6 +1255,7 @@ dk4app_get_log_source_line(dk4_app_t *app)
void
dk4app_set_log_source_file(dk4_app_t *app, const dkChar *fn)
{
+ $? "= dk4app_set_log_source_file \"%!ds\"", TR_STR(fn)
if (NULL != app) {
app->source_file_name = fn;
}
@@ -1211,6 +1266,7 @@ dk4app_set_log_source_file(dk4_app_t *app, const dkChar *fn)
void
dk4app_set_log_source_line(dk4_app_t *app, dk4_um_t lineno)
{
+ $? "= dk4app_set_log_source_line %lu", (unsigned long)lineno
if (NULL != app) {
app->source_file_line = lineno;
}
@@ -1255,6 +1311,9 @@ dk4app_log_two_strings_at_startup(
)
{
const dkChar *msg[3];
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
msg[0] = title;
msg[1] = value;
if (NULL == value) {
@@ -1275,6 +1334,9 @@ dk4app_log_startup_log_level(
)
{
const dkChar *llstr = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if ((DK4_LL_NONE <= ll) && (DK4_LL_IGNORE >= ll)) {
llstr = (app->msg_base)[(size_t)ll];
}
@@ -1293,12 +1355,15 @@ dk4app_log_startup_encoding(
)
{
const dkChar *encstr = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (0 != isfileenc) {
switch (enc) {
- case DK4_FILE_ENCODING_ASCII : {
+ case DK4_FILE_ENCODING_PLAIN : {
encstr = dk4app_log_kwnl[5];
} break;
- case DK4_FILE_ENCODING_ANSI : {
+ case DK4_FILE_ENCODING_WIN1252 : {
encstr = dk4app_log_kwnl[6];
} break;
case DK4_FILE_ENCODING_UTF8 : {
@@ -1319,10 +1384,10 @@ dk4app_log_startup_encoding(
}
} else {
switch (enc) {
- case DK4_ENCODING_ASCII : {
+ case DK4_ENCODING_PLAIN : {
encstr = dk4app_log_kwnl[5];
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
encstr = dk4app_log_kwnl[6];
} break;
case DK4_ENCODING_UTF8 : {
@@ -1352,6 +1417,9 @@ dk4app_log_startup_debug(dk4_app_t *app)
int res = 0;
int pn = 0;
$? "+ dk4app_log_startup_debug"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
if (0 != dk4app_log_do(app, DK4_LL_DEBUG)) {
/* Obtain localized texts */
diff --git a/support/dktools/dk4appmkdh.c b/support/dktools/dk4appmkdh.c
index 87ecc95aca..5d496b01b9 100644
--- a/support/dktools/dk4appmkdh.c
+++ b/support/dktools/dk4appmkdh.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appmkdh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appmkdh.ctr
*/
/** @file dk4appmkdh.c The dk4appmkdh module.
*/
-#line 54 "dk4appmkdh.ctr"
+#line 70 "dk4appmkdh.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -146,11 +124,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 165 "dk4appmkdh.ctr"
+#line 187 "dk4appmkdh.ctr"
@@ -373,7 +357,10 @@ dk4app_mkdir_hierarchy(const dkChar *fn, int lc, dk4_app_t *app)
int back = 0;
-#line 386 "dk4appmkdh.ctr"
+#line 408 "dk4appmkdh.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS || (1 == DK4_CHAR_SIZE)
sz = dk4str_len(fn);
@@ -392,10 +379,10 @@ dk4app_mkdir_hierarchy(const dkChar *fn, int lc, dk4_app_t *app)
#endif
} else {
-#line 403 "dk4appmkdh.ctr"
+#line 428 "dk4appmkdh.ctr"
}
-#line 404 "dk4appmkdh.ctr"
+#line 429 "dk4appmkdh.ctr"
return back;
}
diff --git a/support/dktools/dk4appmkdh.ctr b/support/dktools/dk4appmkdh.ctr
index c490b9b119..fa582d996c 100644
--- a/support/dktools/dk4appmkdh.ctr
+++ b/support/dktools/dk4appmkdh.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,19 +13,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
@@ -159,6 +175,12 @@ dk4app_mkdir_hierarchy(const dkChar *fn, int lc, dk4_app_t *app);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -383,6 +405,9 @@ dk4app_mkdir_hierarchy(const dkChar *fn, int lc, dk4_app_t *app)
size_t sz;
int back = 0;
$? "+ dk4app_mkdir_hierarchy PTR=%d", TR_IPTR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS || (1 == DK4_CHAR_SIZE)
sz = dk4str_len(fn);
diff --git a/support/dktools/dk4appmkdh.h b/support/dktools/dk4appmkdh.h
index 19939599ec..c5235b6eb5 100644
--- a/support/dktools/dk4appmkdh.h
+++ b/support/dktools/dk4appmkdh.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appmkdh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appmkdh.ctr
*/
#ifndef DK4APPMKDH_H_INCLUDED
@@ -45,19 +23,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
diff --git a/support/dktools/dk4appop.c b/support/dktools/dk4appop.c
index a760d2c49d..42aaa5554b 100644
--- a/support/dktools/dk4appop.c
+++ b/support/dktools/dk4appop.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appop.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appop.ctr
*/
@@ -204,10 +182,19 @@ dk4app_log_startup_debug(dk4_app_t *app);
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 181 "dk4appop.ctr"
+#line 190 "dk4appop.ctr"
@@ -230,7 +217,7 @@ dkT("manual"),
NULL
-#line 207 "dk4appop.ctr"
+#line 216 "dk4appop.ctr"
};
@@ -263,7 +250,7 @@ dkT("region"),
NULL
-#line 246 "dk4appop.ctr"
+#line 255 "dk4appop.ctr"
};
@@ -283,7 +270,7 @@ static const char * const dk4app_open_c8_kw[] = {
NULL
-#line 258 "dk4appop.ctr"
+#line 267 "dk4appop.ctr"
};
@@ -342,7 +329,7 @@ dkT("*"),
NULL
-#line 313 "dk4appop.ctr"
+#line 322 "dk4appop.ctr"
};
@@ -381,7 +368,7 @@ dkT(".cpl"),
NULL
-#line 340 "dk4appop.ctr"
+#line 349 "dk4appop.ctr"
};
#endif
@@ -396,7 +383,7 @@ dk4app_open_initialize(dk4_app_t *ptr)
{
-#line 353 "dk4appop.ctr"
+#line 362 "dk4appop.ctr"
ptr->s_opt_all = NULL;
ptr->i_opt_all = NULL;
ptr->s_opt_short = NULL;
@@ -452,18 +439,26 @@ dk4app_open_initialize(dk4_app_t *ptr)
ptr->log_stderr_time = 1;
ptr->log_file_time = 1;
ptr->log_enabled = 0;
+#if DK4_ON_WINDOWS
ptr->encoding =
ptr->enc_in_std =
ptr->enc_in_file =
ptr->enc_out_std =
- ptr->enc_out_file = DK4_FILE_ENCODING_ASCII;
+ ptr->enc_out_file = DK4_FILE_ENCODING_WIN1252;
+#else
+ ptr->encoding =
+ ptr->enc_in_std =
+ ptr->enc_in_file =
+ ptr->enc_out_std =
+ ptr->enc_out_file = DK4_FILE_ENCODING_PLAIN;
+#endif
ptr->hvl_cmd = 0;
ptr->have_self_pref = 0;
ptr->fast_close = 0;
ptr->tmp_dir_used = 0;
-#line 418 "dk4appop.ctr"
+#line 435 "dk4appop.ctr"
}
@@ -481,14 +476,14 @@ dk4app_open_silence_check(int argc, dkChar **argv)
int back = 0; /* Function result */
-#line 434 "dk4appop.ctr"
+#line 451 "dk4appop.ctr"
for (i = 1; i < (size_t)argc; i++) {
if (0 == dk4str_cmp(argv[i], dk4app_open_kw[0])) {
back = 1;
}
}
-#line 439 "dk4appop.ctr"
+#line 456 "dk4appop.ctr"
return back;
}
@@ -504,11 +499,14 @@ dk4app_open_find_language_region(dk4_app_t *app, dk4_app_error_t *ae)
{
dkChar lbuf[16];
dkChar rbuf[16];
- int enc = DK4_ENCODING_ASCII;
+ int enc = DK4_ENCODING_PLAIN;
int res;
-#line 457 "dk4appop.ctr"
+#line 474 "dk4appop.ctr"
+#if DK4_ON_WINDOWS
+ enc = DK4_ENCODING_WIN1252;
+#endif
lbuf[0] = dkT('\0'); rbuf[0] = dkT('\0');
res = dk4loc_get_settings(
lbuf, DK4_SIZEOF(lbuf,dkChar),
@@ -517,7 +515,7 @@ dk4app_open_find_language_region(dk4_app_t *app, dk4_app_error_t *ae)
);
if (0 != res) {
-#line 464 "dk4appop.ctr"
+#line 484 "dk4appop.ctr"
if (0 < dk4str_len(lbuf)) {
app->language = dk4str_dup(lbuf, NULL);
if (NULL == app->language) {
@@ -537,14 +535,19 @@ dk4app_open_find_language_region(dk4_app_t *app, dk4_app_error_t *ae)
app->enc_out_file = enc;
#if DK4_CHAR_SIZE > 1
/* Multi-byte input (UTF-16, C32) typically has a BOM at start */
- app->enc_in_std = DK4_FILE_ENCODING_ASCII;
- app->enc_in_file = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ app->enc_in_std = DK4_FILE_ENCODING_WIN1252;
+ app->enc_in_file = DK4_FILE_ENCODING_WIN1252;
+#else
+ app->enc_in_std = DK4_FILE_ENCODING_PLAIN;
+ app->enc_in_file = DK4_FILE_ENCODING_PLAIN;
+#endif
#endif
} else {
ae->error_found = E_LOCALE;
}
-#line 489 "dk4appop.ctr"
+#line 514 "dk4appop.ctr"
}
@@ -554,9 +557,13 @@ dk4app_open_find_language_region(dk4_app_t *app, dk4_app_error_t *ae)
*/
static
void
-dk4app_open_report_error(dk4_app_t *app, dk4_app_error_t *ae)
+dk4app_open_report_error(
+ dk4_app_t * DK4_ARG_UNUSED(app),
+ dk4_app_error_t *ae
+)
{
/* !!!!! */
+ DK4_UNUSED_ARG(app)
switch (ae->error_found) {
case E_LOCALE: {
} break;
@@ -595,16 +602,16 @@ dk4app_open_check_directory_name(dk4_app_error_t *ae, dkChar *dirname)
{
-#line 538 "dk4appop.ctr"
+#line 567 "dk4appop.ctr"
if (NULL == dirname) {
if (0 == ae->error_found) {
-#line 540 "dk4appop.ctr"
+#line 569 "dk4appop.ctr"
ae->error_found = E_MEMORY;
}
}
-#line 543 "dk4appop.ctr"
+#line 572 "dk4appop.ctr"
}
@@ -620,7 +627,7 @@ dk4app_open_find_exec_from_inst(dk4_app_t *app, dk4_app_error_t *ae)
{
-#line 557 "dk4appop.ctr"
+#line 586 "dk4appop.ctr"
app->dir_etc = dk4str_dup(dk4inst_get_directory(1), NULL);
app->dir_share = dk4str_dup(dk4inst_get_directory(2), NULL);
app->dir_lib = dk4str_dup(dk4inst_get_directory(6), NULL);
@@ -631,13 +638,12 @@ dk4app_open_find_exec_from_inst(dk4_app_t *app, dk4_app_error_t *ae)
dk4app_open_check_directory_name(ae, app->dir_var);
-#line 566 "dk4appop.ctr"
+#line 595 "dk4appop.ctr"
}
/** Create one new directory name replacing the final path component.
- @param app Application structure to set up.
@param buf Buffer containing old directory name,
changed to the new directory name.
@param szbuf Size of buffer.
@@ -649,7 +655,6 @@ dk4app_open_find_exec_from_inst(dk4_app_t *app, dk4_app_error_t *ae)
static
dkChar *
dk4app_open_find_exec_replace_one(
- dk4_app_t *app,
dk4_app_error_t *ae,
dkChar *buf,
size_t szbuf,
@@ -660,7 +665,7 @@ dk4app_open_find_exec_replace_one(
dkChar *back = NULL;
-#line 593 "dk4appop.ctr"
+#line 620 "dk4appop.ctr"
*p1 = dkT('\0');
if (0 != dk4str_cat_s(buf, szbuf, nn, NULL)) {
back = dk4str_dup(buf, NULL);
@@ -675,7 +680,7 @@ dk4app_open_find_exec_replace_one(
}
}
-#line 606 "dk4appop.ctr"
+#line 633 "dk4appop.ctr"
return back;
}
@@ -700,22 +705,22 @@ dk4app_open_find_exec_replace_final(
{
-#line 629 "dk4appop.ctr"
+#line 656 "dk4appop.ctr"
app->dir_etc = dk4app_open_find_exec_replace_one(
- app, ae, buf, szbuf, p1, dk4app_open_kw[3]
+ ae, buf, szbuf, p1, dk4app_open_kw[3]
);
app->dir_share = dk4app_open_find_exec_replace_one(
- app, ae, buf, szbuf, p1, dk4app_open_kw[4]
+ ae, buf, szbuf, p1, dk4app_open_kw[4]
);
app->dir_lib = dk4app_open_find_exec_replace_one(
- app, ae, buf, szbuf, p1, dk4app_open_kw[5]
+ ae, buf, szbuf, p1, dk4app_open_kw[5]
);
app->dir_var = dk4app_open_find_exec_replace_one(
- app, ae, buf, szbuf, p1, dk4app_open_kw[6]
+ ae, buf, szbuf, p1, dk4app_open_kw[6]
);
-#line 642 "dk4appop.ctr"
+#line 669 "dk4appop.ctr"
}
@@ -733,7 +738,7 @@ dk4app_open_is_dkinst_libexec(dkChar *buf)
int back = 0;
-#line 658 "dk4appop.ctr"
+#line 685 "dk4appop.ctr"
sz = dk4str_len(dk4inst_get_directory(10));
if (0 < sz) {
if (dk4str_len(buf) > sz) {
@@ -748,7 +753,7 @@ dk4app_open_is_dkinst_libexec(dkChar *buf)
}
}
-#line 671 "dk4appop.ctr"
+#line 698 "dk4appop.ctr"
return back;
}
@@ -770,7 +775,7 @@ dk4app_open_is_any_libexec(dkChar *buf, size_t szbuf)
int back = 0;
-#line 691 "dk4appop.ctr"
+#line 718 "dk4appop.ctr"
if (0 != dk4str_cpy_s(mybuf, DK4_SIZEOF(mybuf,dkChar), buf, NULL)) {
p1 = dk4str_rchr(mybuf, dk4app_filename_sep[0]);
while ((0 == back) && (NULL != p1)) {
@@ -788,7 +793,7 @@ dk4app_open_is_any_libexec(dkChar *buf, size_t szbuf)
}
}
-#line 707 "dk4appop.ctr"
+#line 734 "dk4appop.ctr"
return back;
}
@@ -800,7 +805,7 @@ dk4app_open_find_copy_bindir(dk4_app_t *app, dk4_app_error_t *ae)
{
-#line 717 "dk4appop.ctr"
+#line 744 "dk4appop.ctr"
if (NULL != app->dir_bin) {
app->dir_etc = dk4str_dup(app->dir_bin, NULL);
app->dir_share = dk4str_dup(app->dir_bin, NULL);
@@ -813,7 +818,7 @@ dk4app_open_find_copy_bindir(dk4_app_t *app, dk4_app_error_t *ae)
dk4app_open_check_directory_name(ae, app->dir_var);
-#line 728 "dk4appop.ctr"
+#line 755 "dk4appop.ctr"
}
@@ -836,7 +841,7 @@ dk4app_open_find_executable(
size_t const szbuf = DK4_SIZEOF(buf,dkChar);
-#line 749 "dk4appop.ctr"
+#line 776 "dk4appop.ctr"
if (0 != dk4execpath(buf, szbuf, arg0, NULL)) {
p1 = dk4str_rchr(buf, dk4app_filename_sep[0]);
if (NULL != p1) {
@@ -859,32 +864,32 @@ dk4app_open_find_executable(
}
-#line 770 "dk4appop.ctr"
+#line 797 "dk4appop.ctr"
/* Save bindir name */
app->dir_bin = dk4str_dup(buf, NULL);
-#line 773 "dk4appop.ctr"
+#line 800 "dk4appop.ctr"
if (NULL == app->dir_bin) { ae->error_found = E_MEMORY; }
/* Find other directories */
if (0 == dk4str_pathcmp(buf, dk4inst_get_directory(4))) {
-#line 777 "dk4appop.ctr"
+#line 804 "dk4appop.ctr"
/* In .../bin, use directories from dk4inst */
dk4app_open_find_exec_from_inst(app, ae);
} else {
if (0 == dk4str_pathcmp(buf, dk4inst_get_directory(5))) {
-#line 782 "dk4appop.ctr"
+#line 809 "dk4appop.ctr"
/* In .../sbin, use directories from dk4inst */
dk4app_open_find_exec_from_inst(app, ae);
} else {
if (dk4app_open_is_dkinst_libexec(buf)) {
-#line 787 "dk4appop.ctr"
+#line 814 "dk4appop.ctr"
/* In .../libexec/..., use directories from dk4inst */
dk4app_open_find_exec_from_inst(app, ae);
} else {
@@ -894,7 +899,7 @@ dk4app_open_find_executable(
if (0 == dk4str_pathcmp(p1, dk4app_open_kw[1])) {
-#line 795 "dk4appop.ctr"
+#line 822 "dk4appop.ctr"
/* Replace final path component by etc, lib... */
dk4app_open_find_exec_replace_final(
app, ae, buf, szbuf, p1
@@ -903,7 +908,7 @@ dk4app_open_find_executable(
if (0 == dk4str_pathcmp(p1, dk4app_open_kw[2])) {
-#line 802 "dk4appop.ctr"
+#line 829 "dk4appop.ctr"
/* Replace final path component by etc, lib... */
dk4app_open_find_exec_replace_final(
app, ae, buf, szbuf, p1
@@ -917,7 +922,7 @@ dk4app_open_find_executable(
*/
-#line 814 "dk4appop.ctr"
+#line 841 "dk4appop.ctr"
p1 = buf;
while(dkT('\0') != *p1) { p1++; }
*(p1++) = dk4app_filename_sep[0];
@@ -927,14 +932,14 @@ dk4app_open_find_executable(
);
} else {
-#line 822 "dk4appop.ctr"
+#line 849 "dk4appop.ctr"
dk4app_open_find_copy_bindir(app, ae);
}
}
}
} else {
-#line 827 "dk4appop.ctr"
+#line 854 "dk4appop.ctr"
dk4app_open_find_copy_bindir(app, ae);
}
}
@@ -942,34 +947,34 @@ dk4app_open_find_executable(
}
-#line 833 "dk4appop.ctr"
+#line 860 "dk4appop.ctr"
-#line 834 "dk4appop.ctr"
+#line 861 "dk4appop.ctr"
-#line 835 "dk4appop.ctr"
+#line 862 "dk4appop.ctr"
-#line 836 "dk4appop.ctr"
+#line 863 "dk4appop.ctr"
} else {
-#line 837 "dk4appop.ctr"
+#line 864 "dk4appop.ctr"
ae->error_found = E_EXECNAME_TOO_LONG;
}
} else {
-#line 840 "dk4appop.ctr"
+#line 867 "dk4appop.ctr"
ae->error_found = E_NO_DIR_IN_EXENAME;
}
} else {
-#line 843 "dk4appop.ctr"
+#line 870 "dk4appop.ctr"
ae->error_found = E_EXEFILE;
}
-#line 846 "dk4appop.ctr"
+#line 873 "dk4appop.ctr"
}
@@ -1004,7 +1009,10 @@ dk4app_close(dk4_app_t *app)
int back = 0;
-#line 879 "dk4appop.ctr"
+#line 906 "dk4appop.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
/* Remove temporary files */
if (0 == app->fast_close) {
@@ -1070,7 +1078,7 @@ dk4app_close(dk4_app_t *app)
for (i = 0; i < app->my_argc; i++) {
-#line 943 "dk4appop.ctr"
+#line 973 "dk4appop.ctr"
}
}
}
@@ -1134,7 +1142,7 @@ dk4app_close(dk4_app_t *app)
dk4mem_free(app);
}
-#line 1005 "dk4appop.ctr"
+#line 1035 "dk4appop.ctr"
return back;
}
@@ -1158,7 +1166,7 @@ dk4app_open_process_optspec(
dk4_option_t *optptr;
-#line 1027 "dk4appop.ctr"
+#line 1057 "dk4appop.ctr"
while(szoptspec--) {
if ((NULL != optspec->longopt) || (dkT('\0') != optspec->c)) {
optptr = dk4opt_open(optspec, NULL);
@@ -1175,7 +1183,7 @@ dk4app_open_process_optspec(
else
{
-#line 1042 "dk4appop.ctr"
+#line 1072 "dk4appop.ctr"
if (0 == ae->error_found) {
ae->error_found = E_OPTION_LONG_SPEC_MULT;
ae->longopt = optspec->longopt;
@@ -1194,7 +1202,7 @@ dk4app_open_process_optspec(
else
{
-#line 1059 "dk4appop.ctr"
+#line 1089 "dk4appop.ctr"
if (0 == ae->error_found) {
ae->error_found = E_OPTION_SHORT_SPEC_MULT;
ae->longopt = optspec->longopt;
@@ -1204,27 +1212,27 @@ dk4app_open_process_optspec(
}
} else {
-#line 1067 "dk4appop.ctr"
+#line 1097 "dk4appop.ctr"
if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
szoptspec = 0;
dk4opt_close(optptr); optptr = NULL;
}
} else {
-#line 1072 "dk4appop.ctr"
+#line 1102 "dk4appop.ctr"
if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
szoptspec = 0;
}
} else {
-#line 1076 "dk4appop.ctr"
+#line 1106 "dk4appop.ctr"
if (0 == ae->error_found) { ae->error_found = E_EMPTY_OPTION_SPEC; }
szoptspec = 0;
}
optspec++;
}
-#line 1081 "dk4appop.ctr"
+#line 1111 "dk4appop.ctr"
}
@@ -1246,7 +1254,7 @@ dk4app_open_create_options_storages(
{
-#line 1101 "dk4appop.ctr"
+#line 1131 "dk4appop.ctr"
if ((NULL != optspec) && (0 < szoptspec)) {
app->s_opt_all = dk4sto_open(NULL);
if (NULL != app->s_opt_all) {
@@ -1265,37 +1273,37 @@ dk4app_open_create_options_storages(
dk4app_open_process_optspec(app, ae, optspec, szoptspec);
} else {
-#line 1118 "dk4appop.ctr"
+#line 1148 "dk4appop.ctr"
ae->error_found = E_MEMORY;
}
} else {
-#line 1121 "dk4appop.ctr"
+#line 1151 "dk4appop.ctr"
ae->error_found = E_MEMORY;
}
} else {
-#line 1124 "dk4appop.ctr"
+#line 1154 "dk4appop.ctr"
ae->error_found = E_MEMORY;
}
} else {
-#line 1127 "dk4appop.ctr"
+#line 1157 "dk4appop.ctr"
ae->error_found = E_MEMORY;
}
} else {
-#line 1130 "dk4appop.ctr"
+#line 1160 "dk4appop.ctr"
ae->error_found = E_MEMORY;
}
} else {
-#line 1133 "dk4appop.ctr"
+#line 1163 "dk4appop.ctr"
ae->error_found = E_MEMORY;
}
}
-#line 1136 "dk4appop.ctr"
+#line 1166 "dk4appop.ctr"
}
@@ -1387,7 +1395,7 @@ dk4app_open_find_user_name_and_home(dk4_app_t *app, dk4_app_error_t *ae)
dk4_er_t er;
-#line 1226 "dk4appop.ctr"
+#line 1256 "dk4appop.ctr"
dk4error_init(&er);
if (0 != dk4user_get_logname(buf, DK4_SIZEOF(buf,dkChar), 1, &er)) {
app->user_name = dk4str_dup(buf, &er);
@@ -1408,13 +1416,13 @@ dk4app_open_find_user_name_and_home(dk4_app_t *app, dk4_app_error_t *ae)
}
-#line 1245 "dk4appop.ctr"
+#line 1275 "dk4appop.ctr"
-#line 1246 "dk4appop.ctr"
+#line 1276 "dk4appop.ctr"
-#line 1247 "dk4appop.ctr"
+#line 1277 "dk4appop.ctr"
}
@@ -1449,7 +1457,6 @@ dk4app_open_pref_reader_init_for_one_file(dk4_app_pref_rd_t *ptr)
/** Check one scope line entry.
@param app Application.
- @param ae Application open error structure.
@param pn Pointer to entry name.
@param pv Pointer to entry value.
@return 1 if condition is true, 0 otherwise.
@@ -1458,7 +1465,6 @@ static
int
dk4app_open_check_one_scope_entry(
dk4_app_t *app,
- dk4_app_error_t *ae,
const dkChar *pn,
const dkChar *pv
)
@@ -1466,13 +1472,13 @@ dk4app_open_check_one_scope_entry(
int back = 0;
-#line 1297 "dk4appop.ctr"
+#line 1325 "dk4appop.ctr"
switch (dk4str_array_index(dk4app_open_scope_names, pn, 0)) {
case 0: {
if ((NULL != pv) && (NULL != app->user_name)) {
-#line 1301 "dk4appop.ctr"
+#line 1329 "dk4appop.ctr"
#if DK4_HAVE_CASE_INSENSITIVE_USERNAMES
if (0 == dk4str_casecmp(pv, app->user_name))
#else
@@ -1493,7 +1499,7 @@ dk4app_open_check_one_scope_entry(
if ((NULL != pv) && (NULL != app->prog_name)) {
-#line 1320 "dk4appop.ctr"
+#line 1348 "dk4appop.ctr"
#if DK4_HAVE_CASE_INSENSITIVE_PATHNAMES
if (0 == dk4str_casecmp(pv, app->prog_name))
#else
@@ -1512,11 +1518,11 @@ dk4app_open_check_one_scope_entry(
} break;
case 2: {
-#line 1337 "dk4appop.ctr"
+#line 1365 "dk4appop.ctr"
if ((NULL != pv) && (NULL != app->group_name)) {
-#line 1339 "dk4appop.ctr"
+#line 1367 "dk4appop.ctr"
#if DK4_HAVE_CASE_INSENSITIVE_PATHNAMES
if (0 == dk4str_casecmp(pv, app->group_name))
#else
@@ -1535,11 +1541,11 @@ dk4app_open_check_one_scope_entry(
} break;
case 3: {
-#line 1356 "dk4appop.ctr"
+#line 1384 "dk4appop.ctr"
if ((NULL != pv) && (NULL != app->host_name)) {
-#line 1358 "dk4appop.ctr"
+#line 1386 "dk4appop.ctr"
if (0 == dk4str_casecmp(pv, app->host_name)) {
back = 1;
} else {
@@ -1551,7 +1557,7 @@ dk4app_open_check_one_scope_entry(
} break;
case 4: {
-#line 1368 "dk4appop.ctr"
+#line 1396 "dk4appop.ctr"
if (NULL != pv) {
#if DK4_ON_WINDOWS
if (0 != dk4str_is_on(pv)) {
@@ -1570,7 +1576,7 @@ dk4app_open_check_one_scope_entry(
} break;
case 5: {
-#line 1385 "dk4appop.ctr"
+#line 1413 "dk4appop.ctr"
if (NULL != pv) {
#if DK4_ON_WINDOWS
if (0 == dk4str_is_on(pv)) {
@@ -1591,7 +1597,7 @@ dk4app_open_check_one_scope_entry(
} break;
case 6 : {
-#line 1404 "dk4appop.ctr"
+#line 1432 "dk4appop.ctr"
if ((NULL != pv) && (NULL != app->language)) {
if (0 == dk4str_casecmp(pv, app->language)) {
back =1;
@@ -1604,7 +1610,7 @@ dk4app_open_check_one_scope_entry(
} break;
case 7 : {
-#line 1415 "dk4appop.ctr"
+#line 1443 "dk4appop.ctr"
if ((NULL != pv) && (NULL != app->region)) {
if (0 == dk4str_casecmp(pv, app->region)) {
back =1;
@@ -1617,16 +1623,16 @@ dk4app_open_check_one_scope_entry(
} break;
default: {
-#line 1426 "dk4appop.ctr"
+#line 1454 "dk4appop.ctr"
if (0 == dk4str_len(pn)) {
-#line 1427 "dk4appop.ctr"
+#line 1455 "dk4appop.ctr"
back = 1;
}
} break;
}
-#line 1431 "dk4appop.ctr"
+#line 1459 "dk4appop.ctr"
return back;
}
@@ -1655,11 +1661,11 @@ dk4app_open_add_preference(
dkChar *npv;
-#line 1458 "dk4appop.ctr"
- prefptr = dk4sto_it_find_like(it, pn, 1);
+#line 1486 "dk4appop.ctr"
+ prefptr = (dk4_pref_t *)dk4sto_it_find_like(it, pn, 1);
if (NULL != prefptr) {
-#line 1460 "dk4appop.ctr"
+#line 1488 "dk4appop.ctr"
npv = dk4str_dup(pv, NULL);
if (NULL != npv) {
#if 0
@@ -1674,7 +1680,7 @@ dk4app_open_add_preference(
}
} else {
-#line 1473 "dk4appop.ctr"
+#line 1501 "dk4appop.ctr"
prefptr = dk4pref_open(pn, pv, NULL);
if (NULL != prefptr) {
if (0 == dk4sto_add(st, (void *)prefptr, NULL)) {
@@ -1688,13 +1694,13 @@ dk4app_open_add_preference(
dk4app_pref_apply(app, ae, pn, pv);
-#line 1485 "dk4appop.ctr"
+#line 1513 "dk4appop.ctr"
}
/** Modify a preference value from DK tools 3 to 4 syntax.
- Change "/print/ps/level" to "print.ps.level".
+ Change "/log/stderr/level" to "log.stderr.level".
@param Preference name pointer.
*/
static
@@ -1732,8 +1738,8 @@ int
dk4app_open_pref_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dkChar *p1; /* Name text */
@@ -1745,35 +1751,37 @@ dk4app_open_pref_line_handler(
int ok; /* Flag: No test failed yet */
-#line 1540 "dk4appop.ctr"
+#line 1568 "dk4appop.ctr"
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
dk4str_delnl(line);
ptr = (dk4_app_pref_rd_t *)obj;
p1 = dk4str_start(line, NULL);
if (NULL != p1) {
if (dkT('#') != *p1) {
-#line 1545 "dk4appop.ctr"
+#line 1575 "dk4appop.ctr"
if (dkT('[' == *p1)) {
-#line 1546 "dk4appop.ctr"
+#line 1576 "dk4appop.ctr"
if (0 == ptr->lasc) {
-#line 1547 "dk4appop.ctr"
+#line 1577 "dk4appop.ctr"
ptr->insc = 0;
} else {
-#line 1549 "dk4appop.ctr"
+#line 1579 "dk4appop.ctr"
}
p2 = dk4str_chr(p1, dkT(']'));
if (NULL != p2) {
-#line 1552 "dk4appop.ctr"
+#line 1582 "dk4appop.ctr"
*p2 = dkT('\0');
}
p1++;
if (dkT('-') == *p1) {
-#line 1556 "dk4appop.ctr"
+#line 1586 "dk4appop.ctr"
isneg = 1;
p1++;
}
@@ -1785,34 +1793,34 @@ dk4app_open_pref_line_handler(
if (NULL != pv) { *(pv++) = dkT('\0'); pv = dk4str_start(pv, NULL); }
dk4str_normalize(p1, NULL);
if (NULL != pv) { dk4str_rtwh(pv, NULL); }
- if (0 == dk4app_open_check_one_scope_entry(ptr->app,ptr->ae,p1,pv)) {
+ if (0 == dk4app_open_check_one_scope_entry(ptr->app,p1,pv)) {
ok = 0;
}
p1 = p2;
}
if (1 == ok) {
-#line 1573 "dk4appop.ctr"
+#line 1603 "dk4appop.ctr"
if (0 != isneg) {
ptr->insc = 0;
-#line 1575 "dk4appop.ctr"
+#line 1605 "dk4appop.ctr"
} else {
ptr->insc = 1;
-#line 1577 "dk4appop.ctr"
+#line 1607 "dk4appop.ctr"
}
} else {
-#line 1579 "dk4appop.ctr"
+#line 1609 "dk4appop.ctr"
}
ptr->lasc = 1;
} else {
-#line 1582 "dk4appop.ctr"
+#line 1612 "dk4appop.ctr"
if (ptr->insc) {
-#line 1583 "dk4appop.ctr"
+#line 1613 "dk4appop.ctr"
p2 = dk4str_chr(p1, dkT('='));
if (NULL != p2) { *(p2++) = dkT('\0'); p2 = dk4str_start(p2, NULL); }
if ((NULL != p1) && (NULL != p2)) {
@@ -1820,33 +1828,33 @@ dk4app_open_pref_line_handler(
dk4str_rtwh(p2, NULL);
if (0 < ptr->co3) {
-#line 1589 "dk4appop.ctr"
+#line 1619 "dk4appop.ctr"
dk4app_open_modify_prefname_3_to_4(p1);
-#line 1591 "dk4appop.ctr"
+#line 1621 "dk4appop.ctr"
} else {
-#line 1592 "dk4appop.ctr"
+#line 1622 "dk4appop.ctr"
}
dk4app_open_add_preference(ptr->app,ptr->ae,ptr->st,ptr->it,p1,p2);
}
} else {
-#line 1596 "dk4appop.ctr"
+#line 1626 "dk4appop.ctr"
}
ptr->lasc = 0;
}
} else {
-#line 1600 "dk4appop.ctr"
+#line 1630 "dk4appop.ctr"
}
} else {
-#line 1602 "dk4appop.ctr"
+#line 1632 "dk4appop.ctr"
}
-#line 1603 "dk4appop.ctr"
+#line 1633 "dk4appop.ctr"
return back;
}
@@ -1874,7 +1882,7 @@ dk4app_open_read_preference_files(dk4_app_t *app, dk4_app_error_t *ae)
int cc; /* Flag: Can continue */
-#line 1629 "dk4appop.ctr"
+#line 1659 "dk4appop.ctr"
rdobj.app = app;
rdobj.ae = ae;
for (pn = 0; ((0 == ae->error_found) && (pn <= DK4_FS_CONF_MAX)); pn++) {
@@ -1895,11 +1903,11 @@ dk4app_open_read_preference_files(dk4_app_t *app, dk4_app_error_t *ae)
if (0 != res) {
-#line 1648 "dk4appop.ctr"
+#line 1678 "dk4appop.ctr"
istrm = dk4stream_open_file_reader(fnb, &er);
if (NULL != istrm) {
-#line 1650 "dk4appop.ctr"
+#line 1680 "dk4appop.ctr"
dk4app_open_pref_reader_init_for_one_file(&rdobj);
rdobj.co3 = 1;
res = dk4tspdk_setup_line(
@@ -1909,7 +1917,7 @@ dk4app_open_read_preference_files(dk4_app_t *app, dk4_app_error_t *ae)
);
if (0 != res) {
-#line 1658 "dk4appop.ctr"
+#line 1688 "dk4appop.ctr"
res = DK4_TSP_RES_OK;
do {
cc = 0;
@@ -1933,12 +1941,12 @@ dk4app_open_read_preference_files(dk4_app_t *app, dk4_app_error_t *ae)
}
} else {
-#line 1680 "dk4appop.ctr"
+#line 1710 "dk4appop.ctr"
}
dk4stream_close(istrm, NULL);
} else {
-#line 1683 "dk4appop.ctr"
+#line 1713 "dk4appop.ctr"
if (0 == ae->error_found) { ae->error_found = E_PREF_FILE_OPEN; }
}
}
@@ -1952,11 +1960,11 @@ dk4app_open_read_preference_files(dk4_app_t *app, dk4_app_error_t *ae)
if (0 != res) {
-#line 1695 "dk4appop.ctr"
+#line 1725 "dk4appop.ctr"
istrm = dk4stream_open_file_reader(fnb, &er);
if (NULL != istrm) {
-#line 1697 "dk4appop.ctr"
+#line 1727 "dk4appop.ctr"
dk4app_open_pref_reader_init_for_one_file(&rdobj);
res = dk4tspdk_setup_line(
&tsp, &rdobj, dk4app_open_pref_line_handler,
@@ -1965,7 +1973,7 @@ dk4app_open_read_preference_files(dk4_app_t *app, dk4_app_error_t *ae)
);
if (0 != res) {
-#line 1704 "dk4appop.ctr"
+#line 1734 "dk4appop.ctr"
res = DK4_TSP_RES_OK;
do {
cc = 0;
@@ -1989,18 +1997,18 @@ dk4app_open_read_preference_files(dk4_app_t *app, dk4_app_error_t *ae)
}
} else {
-#line 1726 "dk4appop.ctr"
+#line 1756 "dk4appop.ctr"
}
dk4stream_close(istrm, NULL);
} else {
-#line 1729 "dk4appop.ctr"
+#line 1759 "dk4appop.ctr"
if (0 == ae->error_found) { ae->error_found = E_PREF_FILE_OPEN; }
}
}
}
-#line 1733 "dk4appop.ctr"
+#line 1763 "dk4appop.ctr"
}
@@ -2056,9 +2064,15 @@ dk4app_open_options_check(dk4_app_t *app)
*/
static
int
-dk4app_open_check_long_opt(dk4_app_t *app, dk4_app_error_t *ae, dkChar *arg)
+dk4app_open_check_long_opt(
+ dk4_app_t *app,
+ dk4_app_error_t * DK4_ARG_UNUSED(ae),
+ dkChar *arg
+)
{
int back = 0;
+
+ DK4_UNUSED_ARG(ae)
switch (dk4str_array_index(dk4app_open_long_opt, arg, 1)) {
case 0: { /* help */
app->hvl_cmd |= DK4_APP_CMD_HELP;
@@ -2108,7 +2122,7 @@ dk4app_open_prepare_file_logging(dk4_app_t *app, dk4_app_error_t *ae)
int ok = 0;
-#line 1839 "dk4appop.ctr"
+#line 1875 "dk4appop.ctr"
sz = DK4_SIZEOF(fnb,dkChar);
dk4time_get(&timer);
if (dk4str_cpy_s(fnb, sz, app->user_home, NULL)) {
@@ -2165,7 +2179,7 @@ dk4app_open_prepare_file_logging(dk4_app_t *app, dk4_app_error_t *ae)
dk4path_correct_sep(app->log_file_name);
ok = 1;
-#line 1894 "dk4appop.ctr"
+#line 1930 "dk4appop.ctr"
}
}
}
@@ -2193,7 +2207,7 @@ dk4app_open_prepare_file_logging(dk4_app_t *app, dk4_app_error_t *ae)
#endif
-#line 1920 "dk4appop.ctr"
+#line 1956 "dk4appop.ctr"
}
}
}
@@ -2210,7 +2224,7 @@ dk4app_open_prepare_file_logging(dk4_app_t *app, dk4_app_error_t *ae)
}
-#line 1935 "dk4appop.ctr"
+#line 1971 "dk4appop.ctr"
}
@@ -2250,35 +2264,35 @@ dk4app_open_process_argc_argv(
int oi; /* Output index */
-#line 1973 "dk4appop.ctr"
+#line 2009 "dk4appop.ctr"
if (0 < argc) {
-#line 1974 "dk4appop.ctr"
+#line 2010 "dk4appop.ctr"
app->my_argv = dk4mem_new(DK4_PDKCHAR,argc,NULL);
if (NULL != app->my_argv) {
-#line 1976 "dk4appop.ctr"
+#line 2012 "dk4appop.ctr"
for (i = 0; i < argc; i++) { (app->my_argv)[i] = NULL; }
if (dk4app_open_options_check(app)) {
-#line 1978 "dk4appop.ctr"
+#line 2014 "dk4appop.ctr"
argsused = 0;
for (i = 1; i < argc; i++) {
argptr = argv[i];
-#line 1981 "dk4appop.ctr"
+#line 2017 "dk4appop.ctr"
if (dkT('-') == *argptr) {
-#line 1982 "dk4appop.ctr"
+#line 2018 "dk4appop.ctr"
if (dkT('-') == argptr[1]) {
-#line 1983 "dk4appop.ctr"
+#line 2019 "dk4appop.ctr"
if (0 == dk4app_open_check_long_opt(app, ae, &(argptr[2]))) {
if (0 != dk4str_cpy_s(b,DK4_SIZEOF(b,dkChar),&(argptr[2]),NULL))
{
-#line 1987 "dk4appop.ctr"
+#line 2023 "dk4appop.ctr"
opv = NULL;
pv = dk4str_chr(b, dkT('='));
if (NULL != pv) {
@@ -2289,14 +2303,14 @@ dk4app_open_process_argc_argv(
opv = dk4str_chr(&(argptr[2]), dkT('='));
if (NULL != opv) { opv = dk4str_start(++opv, NULL); }
}
- ospec = dk4sto_it_find_like(
+ ospec = (dk4_option_t *)dk4sto_it_find_like(
app->i_opt_long, (void *)b, 3
);
-#line 2000 "dk4appop.ctr"
+#line 2036 "dk4appop.ctr"
if (NULL != ospec) {
-#line 2001 "dk4appop.ctr"
+#line 2037 "dk4appop.ctr"
ospec->found = 1;
switch ((ospec->spec).argtype) {
case DK4_OPT_ARG_BOOL:
@@ -2306,29 +2320,29 @@ dk4app_open_process_argc_argv(
case DK4_OPT_ARG_DOUBLE:
case DK4_OPT_ARG_STRING: {
-#line 2009 "dk4appop.ctr"
+#line 2045 "dk4appop.ctr"
if (NULL == opv) {
-#line 2010 "dk4appop.ctr"
+#line 2046 "dk4appop.ctr"
if ((1 + i) < argc) {
-#line 2011 "dk4appop.ctr"
+#line 2047 "dk4appop.ctr"
opv = argv[++i];
}
}
if (NULL != opv) {
-#line 2015 "dk4appop.ctr"
+#line 2051 "dk4appop.ctr"
switch ((ospec->spec).argtype) {
case DK4_OPT_ARG_BOOL: {
(ospec->val).b = 0;
if (dk4str_is_bool(opv)) {
-#line 2019 "dk4appop.ctr"
+#line 2055 "dk4appop.ctr"
(ospec->val).b = dk4str_is_on(opv);
} else {
-#line 2021 "dk4appop.ctr"
+#line 2057 "dk4appop.ctr"
/* ERROR: Not a boolean argument */
dk4app_log_base5(
app, DK4_LL_ERROR, 33, 14, 15,
@@ -2348,11 +2362,11 @@ dk4app_open_process_argc_argv(
);
if (0 != res) {
-#line 2039 "dk4appop.ctr"
+#line 2075 "dk4appop.ctr"
(ospec->val).s = szval;
} else {
-#line 2041 "dk4appop.ctr"
+#line 2077 "dk4appop.ctr"
/* ERROR: Not a size specification */
dk4app_log_base7(
app, DK4_LL_ERROR, 32, 17, 154, 18,
@@ -2372,11 +2386,11 @@ dk4app_open_process_argc_argv(
);
if (0 != res) {
-#line 2059 "dk4appop.ctr"
+#line 2095 "dk4appop.ctr"
(ospec->val).i = ival;
} else {
-#line 2061 "dk4appop.ctr"
+#line 2097 "dk4appop.ctr"
/* ERROR: Not an integer value */
dk4app_log_base7(
app, DK4_LL_ERROR, 31, 20, 154, 21,
@@ -2396,11 +2410,11 @@ dk4app_open_process_argc_argv(
);
if (0 != res) {
-#line 2079 "dk4appop.ctr"
+#line 2115 "dk4appop.ctr"
(ospec->val).u = uval;
} else {
-#line 2081 "dk4appop.ctr"
+#line 2117 "dk4appop.ctr"
/* ERROR: Not an unsigned integer value */
dk4app_log_base7(
app, DK4_LL_ERROR, 30, 23, 154, 24,
@@ -2413,7 +2427,7 @@ dk4app_open_process_argc_argv(
} break;
case DK4_OPT_ARG_DOUBLE: {
-#line 2092 "dk4appop.ctr"
+#line 2128 "dk4appop.ctr"
dval = 0.0;
(ospec->val).d = 0.0;
endptr = NULL;
@@ -2422,11 +2436,11 @@ dk4app_open_process_argc_argv(
);
if (0 != res) {
-#line 2099 "dk4appop.ctr"
+#line 2135 "dk4appop.ctr"
(ospec->val).d = dval;
} else {
-#line 2101 "dk4appop.ctr"
+#line 2137 "dk4appop.ctr"
dk4app_log_base7(
app, DK4_LL_ERROR, 29, 26, 154, 27,
b, endptr, opv
@@ -2438,13 +2452,13 @@ dk4app_open_process_argc_argv(
} break;
case DK4_OPT_ARG_STRING: {
-#line 2111 "dk4appop.ctr"
+#line 2147 "dk4appop.ctr"
(ospec->val).t = opv;
} break;
}
} else {
-#line 2115 "dk4appop.ctr"
+#line 2151 "dk4appop.ctr"
/* ERROR: Option requires argument */
dk4app_log_base3(
app, DK4_LL_ERROR, 28, 12, b
@@ -2457,19 +2471,21 @@ dk4app_open_process_argc_argv(
}
} else {
-#line 2126 "dk4appop.ctr"
+#line 2162 "dk4appop.ctr"
/* Handle preference */
if (NULL != pv) {
-#line 2128 "dk4appop.ctr"
- prefptr = dk4sto_it_find_like(app->i_pref_cmd, b, 1);
+#line 2164 "dk4appop.ctr"
+ prefptr = (dk4_pref_t *)dk4sto_it_find_like(
+ app->i_pref_cmd, b, 1
+ );
if (NULL != prefptr) {
-#line 2130 "dk4appop.ctr"
+#line 2168 "dk4appop.ctr"
opv = dk4str_dup(pv, NULL);
if (NULL != opv) {
-#line 2132 "dk4appop.ctr"
+#line 2170 "dk4appop.ctr"
#if 0
dk4mem_release(prefptr->value);
#endif
@@ -2479,7 +2495,7 @@ dk4app_open_process_argc_argv(
prefptr->value = opv;
} else {
-#line 2140 "dk4appop.ctr"
+#line 2178 "dk4appop.ctr"
/* ERROR: Failed to save preference value */
dk4app_log_base5(
app, DK4_LL_ERROR, 34, 35, 36, b, pv
@@ -2490,18 +2506,18 @@ dk4app_open_process_argc_argv(
}
} else {
-#line 2149 "dk4appop.ctr"
+#line 2187 "dk4appop.ctr"
prefptr = dk4pref_open(b, pv, NULL);
if (NULL != prefptr) {
-#line 2151 "dk4appop.ctr"
+#line 2189 "dk4appop.ctr"
if (0 != dk4sto_add(app->s_pref_cmd, prefptr, NULL)) {
-#line 2153 "dk4appop.ctr"
+#line 2191 "dk4appop.ctr"
} else {
-#line 2154 "dk4appop.ctr"
+#line 2192 "dk4appop.ctr"
/* ERROR: Failed to save preference value */
dk4app_log_base5(
app, DK4_LL_ERROR, 34, 35, 36,
@@ -2514,7 +2530,7 @@ dk4app_open_process_argc_argv(
}
} else {
-#line 2165 "dk4appop.ctr"
+#line 2203 "dk4appop.ctr"
/* ERROR: Failed to save preference value */
dk4app_log_base5(
app, DK4_LL_ERROR, 34, 35, 36,
@@ -2528,7 +2544,7 @@ dk4app_open_process_argc_argv(
dk4app_pref_apply(app, ae, b, pv);
} else {
-#line 2177 "dk4appop.ctr"
+#line 2215 "dk4appop.ctr"
/* ERROR: Missing preference value */
dk4app_log_base3(app, DK4_LL_ERROR, 37, 38, b);
if (0 == ae->error_found) {
@@ -2538,7 +2554,7 @@ dk4app_open_process_argc_argv(
}
} else {
-#line 2185 "dk4appop.ctr"
+#line 2223 "dk4appop.ctr"
/* ERROR: Option too long! */
dk4app_log_base3(app, DK4_LL_ERROR, 39, 40, argptr);
if (0 == ae->error_found) {
@@ -2548,13 +2564,13 @@ dk4app_open_process_argc_argv(
}
} else {
-#line 2193 "dk4appop.ctr"
- ospec = dk4sto_it_find_like(
+#line 2231 "dk4appop.ctr"
+ ospec = (dk4_option_t *)dk4sto_it_find_like(
app->i_opt_short, (void *)(&(argptr[1])), 1
);
if (NULL != ospec) {
-#line 2197 "dk4appop.ctr"
+#line 2235 "dk4appop.ctr"
ospec->found = 1;
pv = NULL;
switch ((ospec->spec).argtype) {
@@ -2565,14 +2581,14 @@ dk4app_open_process_argc_argv(
case DK4_OPT_ARG_DOUBLE:
case DK4_OPT_ARG_STRING: {
-#line 2206 "dk4appop.ctr"
+#line 2244 "dk4appop.ctr"
pv = dk4str_start(&(argptr[2]), NULL);
if (NULL == pv) {
-#line 2208 "dk4appop.ctr"
+#line 2246 "dk4appop.ctr"
if ((1 + i) < argc) {
-#line 2209 "dk4appop.ctr"
+#line 2247 "dk4appop.ctr"
pv = argv[++i];
}
}
@@ -2582,11 +2598,11 @@ dk4app_open_process_argc_argv(
(ospec->val).b = 0;
if (dk4str_is_bool(pv)) {
-#line 2217 "dk4appop.ctr"
+#line 2255 "dk4appop.ctr"
(ospec->val).b = dk4str_is_on(pv);
} else {
-#line 2219 "dk4appop.ctr"
+#line 2257 "dk4appop.ctr"
/* ERROR: Not a boolean argument */
dk4app_log_base5(
app, DK4_LL_ERROR, 13, 14, 15,
@@ -2606,11 +2622,11 @@ dk4app_open_process_argc_argv(
);
if (0 != res) {
-#line 2237 "dk4appop.ctr"
+#line 2275 "dk4appop.ctr"
(ospec->val).s = szval;
} else {
-#line 2239 "dk4appop.ctr"
+#line 2277 "dk4appop.ctr"
/* ERROR: Not a size specification */
dk4app_log_base7(
app, DK4_LL_ERROR, 16, 17, 154, 18,
@@ -2630,11 +2646,11 @@ dk4app_open_process_argc_argv(
);
if (0 != res) {
-#line 2257 "dk4appop.ctr"
+#line 2295 "dk4appop.ctr"
(ospec->val).i = ival;
} else {
-#line 2259 "dk4appop.ctr"
+#line 2297 "dk4appop.ctr"
/* ERROR: Not an integer value */
dk4app_log_base7(
app, DK4_LL_ERROR, 19, 20, 154, 21,
@@ -2654,11 +2670,11 @@ dk4app_open_process_argc_argv(
);
if (0 != res) {
-#line 2277 "dk4appop.ctr"
+#line 2315 "dk4appop.ctr"
(ospec->val).u = uval;
} else {
-#line 2279 "dk4appop.ctr"
+#line 2317 "dk4appop.ctr"
/* ERROR: Not an unsigned integer value */
dk4app_log_base7(
app, DK4_LL_ERROR, 22, 23, 154, 24,
@@ -2671,7 +2687,7 @@ dk4app_open_process_argc_argv(
} break;
case DK4_OPT_ARG_DOUBLE: {
-#line 2290 "dk4appop.ctr"
+#line 2328 "dk4appop.ctr"
dval = 0.0;
(ospec->val).d = 0.0;
endptr = NULL;
@@ -2680,11 +2696,11 @@ dk4app_open_process_argc_argv(
);
if (0 != res) {
-#line 2297 "dk4appop.ctr"
+#line 2335 "dk4appop.ctr"
(ospec->val).d = dval;
} else {
-#line 2299 "dk4appop.ctr"
+#line 2337 "dk4appop.ctr"
dk4app_log_base7(
app, DK4_LL_ERROR, 25, 26, 154, 27,
argptr, endptr, pv
@@ -2696,13 +2712,13 @@ dk4app_open_process_argc_argv(
} break;
case DK4_OPT_ARG_STRING: {
-#line 2309 "dk4appop.ctr"
+#line 2347 "dk4appop.ctr"
(ospec->val).t = pv;
} break;
}
} else {
-#line 2313 "dk4appop.ctr"
+#line 2351 "dk4appop.ctr"
/* ERROR: Option requires argument */
dk4app_log_base3(
app, DK4_LL_ERROR, 11, 12, argptr
@@ -2715,7 +2731,7 @@ dk4app_open_process_argc_argv(
}
} else {
-#line 2324 "dk4appop.ctr"
+#line 2362 "dk4appop.ctr"
/* ERROR: Unexpected option */
dk4app_log_base3(app, DK4_LL_ERROR, 9, 10, argptr);
if (0 == ae->error_found) {
@@ -2725,14 +2741,14 @@ dk4app_open_process_argc_argv(
}
} else {
-#line 2332 "dk4appop.ctr"
+#line 2370 "dk4appop.ctr"
(app->my_argv)[argsused++] = argptr;
}
}
app->my_argc = argsused;
} else {
-#line 2337 "dk4appop.ctr"
+#line 2375 "dk4appop.ctr"
oi = 0;
for (i = 0; (i + 1) < argc; i++) {
must_add = 1;
@@ -2763,7 +2779,9 @@ dk4app_open_process_argc_argv(
#endif
}
if (NULL != pv) {
- prefptr = dk4sto_it_find_like(app->i_pref_cmd, b, 1);
+ prefptr = (dk4_pref_t *)dk4sto_it_find_like(
+ app->i_pref_cmd, b, 1
+ );
if (NULL != prefptr) {
opv = dk4str_dup(pv, NULL);
if (NULL != opv) {
@@ -2827,20 +2845,20 @@ dk4app_open_process_argc_argv(
}
app->my_argc = oi;
-#line 2430 "dk4appop.ctr"
+#line 2470 "dk4appop.ctr"
}
} else {
-#line 2432 "dk4appop.ctr"
+#line 2472 "dk4appop.ctr"
if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
}
} else {
-#line 2435 "dk4appop.ctr"
+#line 2475 "dk4appop.ctr"
if (0 == ae->error_found) { ae->error_found = E_ARGC; }
}
-#line 2437 "dk4appop.ctr"
+#line 2477 "dk4appop.ctr"
}
@@ -2923,7 +2941,7 @@ dk4app_open_internally(
-#line 2518 "dk4appop.ctr"
+#line 2558 "dk4appop.ctr"
DK4_MEMRES(&ae, sizeof(dk4_app_error_t));
ae.error_found = 0;
if (NULL != groupname) {
@@ -3012,7 +3030,7 @@ dk4app_open_internally(
}
} else {
-#line 2605 "dk4appop.ctr"
+#line 2645 "dk4appop.ctr"
if (0 == quiet) {
char buf[64];
int res;
@@ -3032,24 +3050,24 @@ dk4app_open_internally(
}
} else {
-#line 2623 "dk4appop.ctr"
+#line 2663 "dk4appop.ctr"
}
} else {
-#line 2625 "dk4appop.ctr"
+#line 2665 "dk4appop.ctr"
}
if (NULL != back) {
-#line 2627 "dk4appop.ctr"
+#line 2667 "dk4appop.ctr"
if (0 != dk4app_log_do(back, DK4_LL_DEBUG)) {
-#line 2628 "dk4appop.ctr"
+#line 2668 "dk4appop.ctr"
(void)dk4app_log_debug_texts(back, NULL);
dk4app_log_startup_debug(back);
}
}
-#line 2632 "dk4appop.ctr"
+#line 2672 "dk4appop.ctr"
return back;
}
@@ -3106,6 +3124,9 @@ dk4app_open_silent(
void
dk4app_set_fast_close(dk4_app_t *app)
{
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
app->fast_close = 1;
}
diff --git a/support/dktools/dk4appop.ctr b/support/dktools/dk4appop.ctr
index a5e523b3df..7460baba93 100644
--- a/support/dktools/dk4appop.ctr
+++ b/support/dktools/dk4appop.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -176,6 +176,15 @@ dk4app_log_startup_debug(dk4_app_t *app);
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -405,11 +414,19 @@ dk4app_open_initialize(dk4_app_t *ptr)
ptr->log_stderr_time = 1;
ptr->log_file_time = 1;
ptr->log_enabled = 0;
+#if DK4_ON_WINDOWS
ptr->encoding =
ptr->enc_in_std =
ptr->enc_in_file =
ptr->enc_out_std =
- ptr->enc_out_file = DK4_FILE_ENCODING_ASCII;
+ ptr->enc_out_file = DK4_FILE_ENCODING_WIN1252;
+#else
+ ptr->encoding =
+ ptr->enc_in_std =
+ ptr->enc_in_file =
+ ptr->enc_out_std =
+ ptr->enc_out_file = DK4_FILE_ENCODING_PLAIN;
+#endif
ptr->hvl_cmd = 0;
ptr->have_self_pref = 0;
ptr->fast_close = 0;
@@ -451,9 +468,12 @@ dk4app_open_find_language_region(dk4_app_t *app, dk4_app_error_t *ae)
{
dkChar lbuf[16];
dkChar rbuf[16];
- int enc = DK4_ENCODING_ASCII;
+ int enc = DK4_ENCODING_PLAIN;
int res;
$? "+ dk4app_open_find_language_region"
+#if DK4_ON_WINDOWS
+ enc = DK4_ENCODING_WIN1252;
+#endif
lbuf[0] = dkT('\0'); rbuf[0] = dkT('\0');
res = dk4loc_get_settings(
lbuf, DK4_SIZEOF(lbuf,dkChar),
@@ -480,8 +500,13 @@ dk4app_open_find_language_region(dk4_app_t *app, dk4_app_error_t *ae)
app->enc_out_file = enc;
#if DK4_CHAR_SIZE > 1
/* Multi-byte input (UTF-16, C32) typically has a BOM at start */
- app->enc_in_std = DK4_FILE_ENCODING_ASCII;
- app->enc_in_file = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ app->enc_in_std = DK4_FILE_ENCODING_WIN1252;
+ app->enc_in_file = DK4_FILE_ENCODING_WIN1252;
+#else
+ app->enc_in_std = DK4_FILE_ENCODING_PLAIN;
+ app->enc_in_file = DK4_FILE_ENCODING_PLAIN;
+#endif
#endif
} else {
ae->error_found = E_LOCALE;
@@ -495,9 +520,13 @@ dk4app_open_find_language_region(dk4_app_t *app, dk4_app_error_t *ae)
*/
static
void
-dk4app_open_report_error(dk4_app_t *app, dk4_app_error_t *ae)
+dk4app_open_report_error(
+ dk4_app_t * DK4_ARG_UNUSED(app),
+ dk4_app_error_t *ae
+)
{
/* !!!!! */
+ DK4_UNUSED_ARG(app)
switch (ae->error_found) {
case E_LOCALE: {
} break;
@@ -568,7 +597,6 @@ dk4app_open_find_exec_from_inst(dk4_app_t *app, dk4_app_error_t *ae)
/** Create one new directory name replacing the final path component.
- @param app Application structure to set up.
@param buf Buffer containing old directory name,
changed to the new directory name.
@param szbuf Size of buffer.
@@ -580,7 +608,6 @@ dk4app_open_find_exec_from_inst(dk4_app_t *app, dk4_app_error_t *ae)
static
dkChar *
dk4app_open_find_exec_replace_one(
- dk4_app_t *app,
dk4_app_error_t *ae,
dkChar *buf,
size_t szbuf,
@@ -627,16 +654,16 @@ dk4app_open_find_exec_replace_final(
{
$? "+ dk4app_open_find_exec_replace_final"
app->dir_etc = dk4app_open_find_exec_replace_one(
- app, ae, buf, szbuf, p1, dk4app_open_kw[3]
+ ae, buf, szbuf, p1, dk4app_open_kw[3]
);
app->dir_share = dk4app_open_find_exec_replace_one(
- app, ae, buf, szbuf, p1, dk4app_open_kw[4]
+ ae, buf, szbuf, p1, dk4app_open_kw[4]
);
app->dir_lib = dk4app_open_find_exec_replace_one(
- app, ae, buf, szbuf, p1, dk4app_open_kw[5]
+ ae, buf, szbuf, p1, dk4app_open_kw[5]
);
app->dir_var = dk4app_open_find_exec_replace_one(
- app, ae, buf, szbuf, p1, dk4app_open_kw[6]
+ ae, buf, szbuf, p1, dk4app_open_kw[6]
);
$? "- dk4app_open_find_exec_replace_final"
}
@@ -876,6 +903,9 @@ dk4app_close(dk4_app_t *app)
dk4_string_table_t *ptrstt;
int back = 0;
$? "+ dk4app_close PTR=%d", TR_IPTR(app)
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
/* Remove temporary files */
if (0 == app->fast_close) {
@@ -1278,7 +1308,6 @@ dk4app_open_pref_reader_init_for_one_file(dk4_app_pref_rd_t *ptr)
/** Check one scope line entry.
@param app Application.
- @param ae Application open error structure.
@param pn Pointer to entry name.
@param pv Pointer to entry value.
@return 1 if condition is true, 0 otherwise.
@@ -1287,7 +1316,6 @@ static
int
dk4app_open_check_one_scope_entry(
dk4_app_t *app,
- dk4_app_error_t *ae,
const dkChar *pn,
const dkChar *pv
)
@@ -1455,7 +1483,7 @@ dk4app_open_add_preference(
dk4_pref_t *prefptr;
dkChar *npv;
$? "+ dk4app_open_add_preference \"%!ds\"=\"%!ds\"", TR_DKSTR(pn), TR_DKSTR(pv)
- prefptr = dk4sto_it_find_like(it, pn, 1);
+ prefptr = (dk4_pref_t *)dk4sto_it_find_like(it, pn, 1);
if (NULL != prefptr) { $? ". replace existing value"
npv = dk4str_dup(pv, NULL);
if (NULL != npv) {
@@ -1487,7 +1515,7 @@ dk4app_open_add_preference(
/** Modify a preference value from DK tools 3 to 4 syntax.
- Change "/print/ps/level" to "print.ps.level".
+ Change "/log/stderr/level" to "log.stderr.level".
@param Preference name pointer.
*/
static
@@ -1525,8 +1553,8 @@ int
dk4app_open_pref_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dkChar *p1; /* Name text */
@@ -1537,6 +1565,8 @@ dk4app_open_pref_line_handler(
int isneg = 0; /* Flag: Exclude scope */
int ok; /* Flag: No test failed yet */
$? "+ dk4app_open_pref_line_handler \"%!ds\"", line
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
dk4str_delnl(line);
ptr = (dk4_app_pref_rd_t *)obj;
p1 = dk4str_start(line, NULL);
@@ -1564,7 +1594,7 @@ dk4app_open_pref_line_handler(
if (NULL != pv) { *(pv++) = dkT('\0'); pv = dk4str_start(pv, NULL); }
dk4str_normalize(p1, NULL);
if (NULL != pv) { dk4str_rtwh(pv, NULL); }
- if (0 == dk4app_open_check_one_scope_entry(ptr->app,ptr->ae,p1,pv)) {
+ if (0 == dk4app_open_check_one_scope_entry(ptr->app,p1,pv)) {
ok = 0;
}
p1 = p2;
@@ -1785,9 +1815,15 @@ dk4app_open_options_check(dk4_app_t *app)
*/
static
int
-dk4app_open_check_long_opt(dk4_app_t *app, dk4_app_error_t *ae, dkChar *arg)
+dk4app_open_check_long_opt(
+ dk4_app_t *app,
+ dk4_app_error_t * DK4_ARG_UNUSED(ae),
+ dkChar *arg
+)
{
int back = 0;
+
+ DK4_UNUSED_ARG(ae)
switch (dk4str_array_index(dk4app_open_long_opt, arg, 1)) {
case 0: { /* help */
app->hvl_cmd |= DK4_APP_CMD_HELP;
@@ -1994,7 +2030,7 @@ dk4app_open_process_argc_argv(
opv = dk4str_chr(&(argptr[2]), dkT('='));
if (NULL != opv) { opv = dk4str_start(++opv, NULL); }
}
- ospec = dk4sto_it_find_like(
+ ospec = (dk4_option_t *)dk4sto_it_find_like(
app->i_opt_long, (void *)b, 3
); $? "b=\"%!ds\" pv=\"%!ds\" opv=\"%!ds\"",b,TR_DKSTR(pv),TR_DKSTR(opv)
if (NULL != ospec) { $? ". long option"
@@ -2125,7 +2161,9 @@ dk4app_open_process_argc_argv(
} else { $? ". preference"
/* Handle preference */
if (NULL != pv) { $? ". b=\"%!ds\" pv=\"%!ds\"", b, pv
- prefptr = dk4sto_it_find_like(app->i_pref_cmd, b, 1);
+ prefptr = (dk4_pref_t *)dk4sto_it_find_like(
+ app->i_pref_cmd, b, 1
+ );
if (NULL != prefptr) { $? ". entry already exists"
opv = dk4str_dup(pv, NULL);
if (NULL != opv) { $? ". new value allocated"
@@ -2190,7 +2228,7 @@ dk4app_open_process_argc_argv(
}
}
} else { $? ". short option"
- ospec = dk4sto_it_find_like(
+ ospec = (dk4_option_t *)dk4sto_it_find_like(
app->i_opt_short, (void *)(&(argptr[1])), 1
);
if (NULL != ospec) { $? ". option expected"
@@ -2364,7 +2402,9 @@ dk4app_open_process_argc_argv(
#endif
}
if (NULL != pv) {
- prefptr = dk4sto_it_find_like(app->i_pref_cmd, b, 1);
+ prefptr = (dk4_pref_t *)dk4sto_it_find_like(
+ app->i_pref_cmd, b, 1
+ );
if (NULL != prefptr) {
opv = dk4str_dup(pv, NULL);
if (NULL != opv) {
@@ -2685,6 +2725,9 @@ dk4app_open_silent(
void
dk4app_set_fast_close(dk4_app_t *app)
{
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL != app) {
app->fast_close = 1;
}
diff --git a/support/dktools/dk4appstt.c b/support/dktools/dk4appstt.c
index 5b8cf37ed9..5cceeae26d 100644
--- a/support/dktools/dk4appstt.c
+++ b/support/dktools/dk4appstt.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4appstt.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4appstt.ctr
*/
/** @file dk4appstt.c The dk4appstt module.
@@ -65,11 +43,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4fs.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 40 "dk4appstt.ctr"
+#line 46 "dk4appstt.ctr"
@@ -79,12 +63,12 @@ dk4app_string_table_size(const dkChar * const *texts)
size_t back = 0;
-#line 48 "dk4appstt.ctr"
+#line 54 "dk4appstt.ctr"
if (NULL != texts) {
while (NULL != *(texts++)) { back++; }
}
-#line 51 "dk4appstt.ctr"
+#line 57 "dk4appstt.ctr"
return back;
}
@@ -106,55 +90,60 @@ dk4app_string_table(
int ok;
-#line 71 "dk4appstt.ctr"
+#line 77 "dk4appstt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != shortname);
+ assert(NULL != deftexts);
+#endif
back = deftexts;
if ((NULL != app) && (NULL != shortname)) {
-#line 73 "dk4appstt.ctr"
+#line 84 "dk4appstt.ctr"
back = NULL;
rqlen = dk4app_string_table_size(deftexts);
-#line 75 "dk4appstt.ctr"
+#line 86 "dk4appstt.ctr"
sttptr = (dk4_string_table_t *)dk4sto_it_find_like(app->i_stt,shortname,1);
if (NULL == sttptr) {
-#line 77 "dk4appstt.ctr"
+#line 88 "dk4appstt.ctr"
res = dk4app_search_data_file(
buffer, DK4_SIZEOF(buffer,dkChar), app, shortname,
DK4_FS_DATA_MAX_SYS, 1, NULL
);
if (0 < res) {
-#line 82 "dk4appstt.ctr"
+#line 93 "dk4appstt.ctr"
sttptr = dk4stt_open(shortname, rqlen, NULL);
if (NULL != sttptr) {
-#line 84 "dk4appstt.ctr"
+#line 95 "dk4appstt.ctr"
ok = 0;
istrm = dk4stream_open_file_reader(buffer, NULL);
if (NULL != istrm) {
-#line 87 "dk4appstt.ctr"
- res = dk4stt_apply_stream(sttptr, istrm, app->encoding, NULL, NULL);
+#line 98 "dk4appstt.ctr"
+ res = dk4stt_apply_stream(sttptr, istrm, app->encoding, NULL);
if (0 < res) {
-#line 89 "dk4appstt.ctr"
+#line 100 "dk4appstt.ctr"
if (0 < dk4sto_add(app->s_stt, (void *)sttptr, NULL)) {
ok = 1;
-#line 91 "dk4appstt.ctr"
+#line 102 "dk4appstt.ctr"
} else {
-#line 92 "dk4appstt.ctr"
+#line 103 "dk4appstt.ctr"
}
} else {
-#line 94 "dk4appstt.ctr"
+#line 105 "dk4appstt.ctr"
}
dk4stream_close(istrm, NULL);
} else {
-#line 97 "dk4appstt.ctr"
+#line 108 "dk4appstt.ctr"
}
if (0 == ok) {
dk4stt_close(sttptr);
@@ -162,28 +151,28 @@ dk4app_string_table(
}
} else {
-#line 103 "dk4appstt.ctr"
+#line 114 "dk4appstt.ctr"
}
} else {
-#line 105 "dk4appstt.ctr"
+#line 116 "dk4appstt.ctr"
}
}
if (NULL != sttptr) {
-#line 108 "dk4appstt.ctr"
+#line 119 "dk4appstt.ctr"
if (sttptr->nstrings >= rqlen) {
back = (const dkChar * const *)(sttptr->strings);
}
}
if (NULL == back) {
-#line 113 "dk4appstt.ctr"
+#line 124 "dk4appstt.ctr"
back = deftexts;
}
}
-#line 116 "dk4appstt.ctr"
+#line 127 "dk4appstt.ctr"
return back;
}
diff --git a/support/dktools/dk4appstt.ctr b/support/dktools/dk4appstt.ctr
index 17628ea5c4..045de8bfe5 100644
--- a/support/dktools/dk4appstt.ctr
+++ b/support/dktools/dk4appstt.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -34,6 +34,12 @@ license = bsd
#include "dk4fs.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -68,6 +74,11 @@ dk4app_string_table(
int res;
int ok;
$? "+ dk4app_string_table \"%!ds\"", TR_STR(shortname)
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != shortname);
+ assert(NULL != deftexts);
+#endif
back = deftexts;
if ((NULL != app) && (NULL != shortname)) { $? ". args ok"
back = NULL;
@@ -84,7 +95,7 @@ dk4app_string_table(
ok = 0;
istrm = dk4stream_open_file_reader(buffer, NULL);
if (NULL != istrm) { $? ". input stream ok"
- res = dk4stt_apply_stream(sttptr, istrm, app->encoding, NULL, NULL);
+ res = dk4stt_apply_stream(sttptr, istrm, app->encoding, NULL);
if (0 < res) { $? ". stream applied"
if (0 < dk4sto_add(app->s_stt, (void *)sttptr, NULL)) {
ok = 1; $? ". added to storage"
diff --git a/support/dktools/dk4apref.c b/support/dktools/dk4apref.c
index 536d315bdb..3eb06a0e84 100644
--- a/support/dktools/dk4apref.c
+++ b/support/dktools/dk4apref.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4apref.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4apref.ctr
*/
/** @file dk4apref.c The dk4apref module.
@@ -48,11 +26,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mem.h"
#include "dk4enc.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 22 "dk4apref.ctr"
+#line 28 "dk4apref.ctr"
@@ -95,7 +79,7 @@ dkT("ui.lang"),
NULL
-#line 71 "dk4apref.ctr"
+#line 77 "dk4apref.ctr"
};
@@ -133,7 +117,7 @@ dkT("ignore"),
NULL
-#line 89 "dk4apref.ctr"
+#line 95 "dk4apref.ctr"
};
@@ -146,20 +130,25 @@ dk4app_pref_apply(
const dkChar *pv
)
{
+ dkChar buf[64];
dkChar *newval;
int pi;
int ll;
int bom;
-#line 106 "dk4apref.ctr"
+#line 113 "dk4apref.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != pn);
+#endif
if ((NULL != app) && (NULL != ae) && (NULL != pn) && (NULL != pv)) {
pi = dk4str_array_index(dk4apref_names, pn, 1);
if (-1 < pi) {
switch (pi) {
case 0: {
-#line 111 "dk4apref.ctr"
+#line 122 "dk4apref.ctr"
newval = dk4str_dup(pv, NULL);
if (NULL != newval) {
dk4mem_release(app->language);
@@ -170,7 +159,7 @@ dk4app_pref_apply(
} break;
case 1: {
-#line 120 "dk4apref.ctr"
+#line 131 "dk4apref.ctr"
newval = dk4str_dup(pv, NULL);
if (NULL != newval) {
dk4mem_release(app->region);
@@ -181,7 +170,7 @@ dk4app_pref_apply(
} break;
case 2: {
-#line 129 "dk4apref.ctr"
+#line 140 "dk4apref.ctr"
ll = dk4str_array_index(dk4apref_log_level_names, pv, 0);
if (-1 < ll) {
app->ll_stderr = ll;
@@ -189,7 +178,7 @@ dk4app_pref_apply(
} break;
case 3: {
-#line 135 "dk4apref.ctr"
+#line 146 "dk4apref.ctr"
ll = dk4str_array_index(dk4apref_log_level_names, pv, 0);
if (-1 < ll) {
app->ll_file = ll;
@@ -197,7 +186,7 @@ dk4app_pref_apply(
} break;
case 4: {
-#line 141 "dk4apref.ctr"
+#line 152 "dk4apref.ctr"
ll = dk4str_array_index(dk4apref_log_level_names, pv, 0);
if (-1 < ll) {
app->ll_file_keep = ll;
@@ -205,7 +194,7 @@ dk4app_pref_apply(
} break;
case 5: case 9: {
-#line 147 "dk4apref.ctr"
+#line 158 "dk4apref.ctr"
ll = app->enc_in_std;
bom = 0;
if (dk4enc_find(&ll, &bom, pv, NULL)) {
@@ -214,7 +203,7 @@ dk4app_pref_apply(
} break;
case 6: {
-#line 154 "dk4apref.ctr"
+#line 165 "dk4apref.ctr"
ll = app->enc_in_file;
bom = 0;
if (dk4enc_find(&ll, &bom, pv, NULL)) {
@@ -223,7 +212,7 @@ dk4app_pref_apply(
} break;
case 7: {
-#line 161 "dk4apref.ctr"
+#line 172 "dk4apref.ctr"
if (dk4str_is_on(pv)) {
app->log_stderr_time = 1;
} else {
@@ -232,7 +221,7 @@ dk4app_pref_apply(
} break;
case 8: {
-#line 168 "dk4apref.ctr"
+#line 179 "dk4apref.ctr"
if (dk4str_is_on(pv)) {
app->log_file_time = 1;
} else {
@@ -241,38 +230,43 @@ dk4app_pref_apply(
} break;
case 10: {
-#line 175 "dk4apref.ctr"
+#line 186 "dk4apref.ctr"
if (NULL != pv) {
- dkChar *plang;
- dkChar *preg;
- dkChar *nlang;
- dkChar *nreg;
- /* Remove encoding stuff */
- plang = dk4str_chr(pv, dkT('.'));
- if (NULL != plang) { *plang = dkT('\0'); }
- plang = dk4str_start(pv, NULL);
- if (NULL != plang) {
- preg = dk4str_chr(plang, dkT('_'));
- if (NULL != preg) {
- *(preg++) = dkT('\0');
- preg = dk4str_start(preg, NULL);
- }
- nlang = dk4str_dup(plang, NULL);
- if (NULL != nlang) {
- dk4mem_release(app->language);
- app->language = nlang;
- } else {
- if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
- }
- if (NULL != preg) {
- nreg = dk4str_dup(preg, NULL);
- if (NULL != nreg) {
- dk4mem_release(app->region);
- app->region = nreg;
- } else {
- if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
- }
+ if (0 != dk4str_cpy_s(buf, DK4_SIZEOF(buf,dkChar), pv, NULL)) {
+ dkChar *plang;
+ dkChar *preg;
+ dkChar *nlang;
+ dkChar *nreg;
+ /* Remove encoding stuff */
+ plang = dk4str_chr(buf, dkT('.'));
+ if (NULL != plang) { *plang = dkT('\0'); }
+ plang = dk4str_start(buf, NULL);
+ if (NULL != plang) {
+ preg = dk4str_chr(plang, dkT('_'));
+ if (NULL != preg) {
+ *(preg++) = dkT('\0');
+ preg = dk4str_start(preg, NULL);
+ }
+ nlang = dk4str_dup(plang, NULL);
+ if (NULL != nlang) {
+ dk4mem_release(app->language);
+ app->language = nlang;
+ } else {
+ if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
+ }
+ if (NULL != preg) {
+ nreg = dk4str_dup(preg, NULL);
+ if (NULL != nreg) {
+ dk4mem_release(app->region);
+ app->region = nreg;
+ } else {
+ if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
+ }
+ }
}
+ } else {
+ /* ERROR: Buffer too small */
+ if (0 == ae->error_found) { ae->error_found = E_OPTION_TOO_LONG; }
}
}
} break;
@@ -280,7 +274,7 @@ dk4app_pref_apply(
}
}
-#line 212 "dk4apref.ctr"
+#line 228 "dk4apref.ctr"
}
diff --git a/support/dktools/dk4apref.ctr b/support/dktools/dk4apref.ctr
index 14a644f132..5d55c0b95d 100644
--- a/support/dktools/dk4apref.ctr
+++ b/support/dktools/dk4apref.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -16,6 +16,12 @@ license = bsd
#include "dk4mem.h"
#include "dk4enc.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -98,11 +104,16 @@ dk4app_pref_apply(
const dkChar *pv
)
{
+ dkChar buf[64];
dkChar *newval;
int pi;
int ll;
int bom;
$? "+ dk4app_pref_apply"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != pn);
+#endif
if ((NULL != app) && (NULL != ae) && (NULL != pn) && (NULL != pv)) {
pi = dk4str_array_index(dk4apref_names, pn, 1);
if (-1 < pi) {
@@ -173,36 +184,41 @@ dk4app_pref_apply(
} break;
case 10: { $? ". ui lang"
if (NULL != pv) {
- dkChar *plang;
- dkChar *preg;
- dkChar *nlang;
- dkChar *nreg;
- /* Remove encoding stuff */
- plang = dk4str_chr(pv, dkT('.'));
- if (NULL != plang) { *plang = dkT('\0'); }
- plang = dk4str_start(pv, NULL);
- if (NULL != plang) {
- preg = dk4str_chr(plang, dkT('_'));
- if (NULL != preg) {
- *(preg++) = dkT('\0');
- preg = dk4str_start(preg, NULL);
- }
- nlang = dk4str_dup(plang, NULL);
- if (NULL != nlang) {
- dk4mem_release(app->language);
- app->language = nlang;
- } else {
- if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
- }
- if (NULL != preg) {
- nreg = dk4str_dup(preg, NULL);
- if (NULL != nreg) {
- dk4mem_release(app->region);
- app->region = nreg;
- } else {
- if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
- }
+ if (0 != dk4str_cpy_s(buf, DK4_SIZEOF(buf,dkChar), pv, NULL)) {
+ dkChar *plang;
+ dkChar *preg;
+ dkChar *nlang;
+ dkChar *nreg;
+ /* Remove encoding stuff */
+ plang = dk4str_chr(buf, dkT('.'));
+ if (NULL != plang) { *plang = dkT('\0'); }
+ plang = dk4str_start(buf, NULL);
+ if (NULL != plang) {
+ preg = dk4str_chr(plang, dkT('_'));
+ if (NULL != preg) {
+ *(preg++) = dkT('\0');
+ preg = dk4str_start(preg, NULL);
+ }
+ nlang = dk4str_dup(plang, NULL);
+ if (NULL != nlang) {
+ dk4mem_release(app->language);
+ app->language = nlang;
+ } else {
+ if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
+ }
+ if (NULL != preg) {
+ nreg = dk4str_dup(preg, NULL);
+ if (NULL != nreg) {
+ dk4mem_release(app->region);
+ app->region = nreg;
+ } else {
+ if (0 == ae->error_found) { ae->error_found = E_MEMORY; }
+ }
+ }
}
+ } else {
+ /* ERROR: Buffer too small */
+ if (0 == ae->error_found) { ae->error_found = E_OPTION_TOO_LONG; }
}
}
} break;
diff --git a/support/dktools/dk4aprgs.c b/support/dktools/dk4aprgs.c
index a101598795..d5fef47677 100644
--- a/support/dktools/dk4aprgs.c
+++ b/support/dktools/dk4aprgs.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4aprgs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4aprgs.ctr
*/
/** @file dk4aprgs.c The dk4aprgs module.
@@ -52,11 +30,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maiddsz.h"
#include "dk4maodd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 27 "dk4aprgs.ctr"
+#line 33 "dk4aprgs.ctr"
@@ -73,19 +57,25 @@ dk4app_pref_get(
int back = 0;
-#line 42 "dk4aprgs.ctr"
+#line 48 "dk4aprgs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != name)) {
if (0 == (excl & DK4_APP_PREF_SRC_SELF)) {
- pptr = dk4sto_it_find_like(app->i_pref_self, name, 1);
+ pptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_self, name, 1);
}
if ((NULL == pptr) && (0 == (excl & DK4_APP_PREF_SRC_CMD))) {
- pptr = dk4sto_it_find_like(app->i_pref_cmd, name, 1);
+ pptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_cmd, name, 1);
}
if ((NULL == pptr) && (0 == (excl & DK4_APP_PREF_SRC_USER))) {
- pptr = dk4sto_it_find_like(app->i_pref_user, name, 1);
+ pptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_user, name, 1);
}
if ((NULL == pptr) && (0 == (excl & DK4_APP_PREF_SRC_SYSTEM))) {
- pptr = dk4sto_it_find_like(app->i_pref_sys, name, 1);
+ pptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_sys, name, 1);
}
if (NULL != pptr) {
if (0 != dk4str_cpy_s(dptr, szdptr, pptr->value, NULL)) {
@@ -105,7 +95,7 @@ dk4app_pref_get(
}
}
-#line 72 "dk4aprgs.ctr"
+#line 84 "dk4aprgs.ctr"
return back;
}
@@ -125,7 +115,12 @@ dk4app_pref_get_int(
int back = 0;
-#line 90 "dk4aprgs.ctr"
+#line 102 "dk4aprgs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != dk4app_pref_get(buf, DK4_SIZEOF(buf,dkChar), app, name, excl)) {
endptr = NULL;
@@ -145,7 +140,7 @@ dk4app_pref_get_int(
}
}
-#line 108 "dk4aprgs.ctr"
+#line 125 "dk4aprgs.ctr"
return back;
}
@@ -165,7 +160,12 @@ dk4app_pref_get_unsigned(
int back = 0;
-#line 126 "dk4aprgs.ctr"
+#line 143 "dk4aprgs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != dk4app_pref_get(buf, DK4_SIZEOF(buf,dkChar), app, name, excl)) {
endptr = NULL;
@@ -186,7 +186,7 @@ dk4app_pref_get_unsigned(
}
}
-#line 145 "dk4aprgs.ctr"
+#line 167 "dk4aprgs.ctr"
return back;
}
@@ -204,7 +204,12 @@ dk4app_pref_get_bool(
int back = 0;
-#line 161 "dk4aprgs.ctr"
+#line 183 "dk4aprgs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != dk4app_pref_get(buf, DK4_SIZEOF(buf,dkChar), app, name, excl)) {
if (0 != dk4str_is_bool(buf)) {
@@ -228,7 +233,7 @@ dk4app_pref_get_bool(
}
}
-#line 183 "dk4aprgs.ctr"
+#line 210 "dk4aprgs.ctr"
return back;
}
@@ -248,7 +253,12 @@ dk4app_pref_get_size(
int back = 0;
-#line 201 "dk4aprgs.ctr"
+#line 228 "dk4aprgs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != dk4app_pref_get(buf, DK4_SIZEOF(buf,dkChar), app, name, excl)) {
endptr = NULL;
@@ -268,7 +278,7 @@ dk4app_pref_get_size(
}
}
-#line 219 "dk4aprgs.ctr"
+#line 251 "dk4aprgs.ctr"
return back;
}
@@ -286,9 +296,13 @@ dk4app_pref_set(
int back = 0;
-#line 235 "dk4aprgs.ctr"
+#line 267 "dk4aprgs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+#endif
if ((NULL != app) && (NULL != name) && (NULL != value)) {
- prefptr = dk4sto_it_find_like(app->i_pref_self, name, 1);
+ prefptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_self, name, 1);
if (NULL != prefptr) {
newval = dk4str_dup(value, NULL);
if (NULL != newval) {
@@ -310,7 +324,7 @@ dk4app_pref_set(
}
}
-#line 257 "dk4aprgs.ctr"
+#line 293 "dk4aprgs.ctr"
return back;
}
@@ -323,14 +337,18 @@ dk4app_pref_set_int(dk4_app_t *app, const dkChar *name, dk4_im_t value)
int back = 0;
-#line 268 "dk4aprgs.ctr"
+#line 304 "dk4aprgs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+#endif
if ((NULL != app) && (NULL != name)) {
if (dk4ma_write_decimal_signed(buf,DK4_SIZEOF(buf,dkChar),value,0,NULL)) {
back = dk4app_pref_set(app, name, buf);
}
}
-#line 273 "dk4aprgs.ctr"
+#line 313 "dk4aprgs.ctr"
return back;
}
@@ -343,7 +361,11 @@ dk4app_pref_set_unsigned(dk4_app_t *app, const dkChar *name, dk4_um_t value)
int back = 0;
-#line 284 "dk4aprgs.ctr"
+#line 324 "dk4aprgs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+#endif
if ((NULL != app) && (NULL != name)) {
if (dk4ma_write_decimal_unsigned(buf,DK4_SIZEOF(buf,dkChar),value,0,NULL))
{
@@ -351,7 +373,7 @@ dk4app_pref_set_unsigned(dk4_app_t *app, const dkChar *name, dk4_um_t value)
}
}
-#line 290 "dk4aprgs.ctr"
+#line 334 "dk4aprgs.ctr"
return back;
}
diff --git a/support/dktools/dk4aprgs.ctr b/support/dktools/dk4aprgs.ctr
index 4224683506..534e0210fe 100644
--- a/support/dktools/dk4aprgs.ctr
+++ b/support/dktools/dk4aprgs.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -21,6 +21,12 @@ license = bsd
#include "dk4maiddsz.h"
#include "dk4maodd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -39,18 +45,24 @@ dk4app_pref_get(
dk4_pref_t *pptr = NULL;
int back = 0;
$? "+ dk4app_pref_get \"%!ds\"", TR_DKSTR(name)
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != name)) {
if (0 == (excl & DK4_APP_PREF_SRC_SELF)) {
- pptr = dk4sto_it_find_like(app->i_pref_self, name, 1);
+ pptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_self, name, 1);
}
if ((NULL == pptr) && (0 == (excl & DK4_APP_PREF_SRC_CMD))) {
- pptr = dk4sto_it_find_like(app->i_pref_cmd, name, 1);
+ pptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_cmd, name, 1);
}
if ((NULL == pptr) && (0 == (excl & DK4_APP_PREF_SRC_USER))) {
- pptr = dk4sto_it_find_like(app->i_pref_user, name, 1);
+ pptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_user, name, 1);
}
if ((NULL == pptr) && (0 == (excl & DK4_APP_PREF_SRC_SYSTEM))) {
- pptr = dk4sto_it_find_like(app->i_pref_sys, name, 1);
+ pptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_sys, name, 1);
}
if (NULL != pptr) {
if (0 != dk4str_cpy_s(dptr, szdptr, pptr->value, NULL)) {
@@ -87,6 +99,11 @@ dk4app_pref_get_int(
dk4_im_t val;
int back = 0;
$? "+ dk4app_pref_get_int"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != dk4app_pref_get(buf, DK4_SIZEOF(buf,dkChar), app, name, excl)) {
endptr = NULL;
@@ -123,6 +140,11 @@ dk4app_pref_get_unsigned(
dk4_um_t val;
int back = 0;
$? "+ dk4app_pref_get_unsigned"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != dk4app_pref_get(buf, DK4_SIZEOF(buf,dkChar), app, name, excl)) {
endptr = NULL;
@@ -158,6 +180,11 @@ dk4app_pref_get_bool(
dkChar buf[64];
int back = 0;
$? "+ dk4app_pref_get_bool"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != dk4app_pref_get(buf, DK4_SIZEOF(buf,dkChar), app, name, excl)) {
if (0 != dk4str_is_bool(buf)) {
@@ -198,6 +225,11 @@ dk4app_pref_get_size(
size_t val;
int back = 0;
$? "+ dk4app_pref_get_size"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != dk4app_pref_get(buf, DK4_SIZEOF(buf,dkChar), app, name, excl)) {
endptr = NULL;
@@ -232,8 +264,12 @@ dk4app_pref_set(
dkChar *newval;
int back = 0;
$? "+ dk4app_pref_set"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+#endif
if ((NULL != app) && (NULL != name) && (NULL != value)) {
- prefptr = dk4sto_it_find_like(app->i_pref_self, name, 1);
+ prefptr = (dk4_pref_t *)dk4sto_it_find_like(app->i_pref_self, name, 1);
if (NULL != prefptr) {
newval = dk4str_dup(value, NULL);
if (NULL != newval) {
@@ -265,6 +301,10 @@ dk4app_pref_set_int(dk4_app_t *app, const dkChar *name, dk4_im_t value)
dkChar buf[16*sizeof(dk4_im_t)];
int back = 0;
$? "+ dk4app_pref_set_int"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+#endif
if ((NULL != app) && (NULL != name)) {
if (dk4ma_write_decimal_signed(buf,DK4_SIZEOF(buf,dkChar),value,0,NULL)) {
back = dk4app_pref_set(app, name, buf);
@@ -281,6 +321,10 @@ dk4app_pref_set_unsigned(dk4_app_t *app, const dkChar *name, dk4_um_t value)
dkChar buf[16*sizeof(dk4_um_t)];
int back = 0;
$? "+ dk4app_pref_set_unsigned"
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+ assert(NULL != name);
+#endif
if ((NULL != app) && (NULL != name)) {
if (dk4ma_write_decimal_unsigned(buf,DK4_SIZEOF(buf,dkChar),value,0,NULL))
{
diff --git a/support/dktools/dk4bb.c b/support/dktools/dk4bb.c
new file mode 100644
index 0000000000..96c437c05c
--- /dev/null
+++ b/support/dktools/dk4bb.c
@@ -0,0 +1,879 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bb.ctr
+*/
+
+/** @file dk4bb.c The dk4bb module.
+*/
+
+
+#line 241 "dk4bb.ctr"
+
+#include "dk4conf.h"
+#include "dk4bb.h"
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 280 "dk4bb.ctr"
+
+
+/** Flag value to indicate information not present.
+*/
+static const unsigned char have_not = ((unsigned char)0U);
+
+/** Flag value to indicate X information presence.
+*/
+static const unsigned char have_x = ((unsigned char)1U);
+
+/** Flag value to indicate Y information presence.
+*/
+static const unsigned char have_y = ((unsigned char)2U);
+
+/** Flag value to check for information about both directions.
+*/
+static const unsigned char have_both = ((unsigned char)3U);
+
+
+/** Internally add an x value to bounding box.
+ @param bbptr Bounding box to modify.
+ @param x X value to add.
+*/
+
+static
+void
+dk4bb_i_add_x(
+ dk4_bb_t *bbptr,
+ double x
+)
+{
+
+
+#line 312 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (have_not != (have_x & (bbptr->fl))) {
+
+
+#line 317 "dk4bb.ctr"
+ if (x < bbptr->xmin) {
+ bbptr->xmin = x;
+
+#line 319 "dk4bb.ctr"
+ }
+ if (x > bbptr->xmax) {
+ bbptr->xmax = x;
+
+#line 322 "dk4bb.ctr"
+ }
+ }
+ else {
+
+#line 325 "dk4bb.ctr"
+ bbptr->xmin = bbptr->xmax = x;
+ bbptr->fl |= have_x;
+ }
+
+
+#line 329 "dk4bb.ctr"
+}
+
+
+
+/** Internally add an y value to bounding box.
+ @param bbptr Bounding box to modify.
+ @param y Y value to add.
+*/
+
+static
+void
+dk4bb_i_add_y(
+ dk4_bb_t *bbptr,
+ double y
+)
+{
+
+
+#line 346 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (have_not != (have_y & (bbptr->fl))) {
+
+
+#line 351 "dk4bb.ctr"
+ if (y < bbptr->ymin) {
+
+#line 352 "dk4bb.ctr"
+ bbptr->ymin = y;
+ }
+ if (y > bbptr->ymax) {
+
+#line 355 "dk4bb.ctr"
+ bbptr->ymax = y;
+ }
+ }
+ else {
+
+#line 359 "dk4bb.ctr"
+ bbptr->ymin = bbptr->ymax = y;
+ bbptr->fl |= have_y;
+ }
+
+
+#line 363 "dk4bb.ctr"
+}
+
+
+
+/*
+ The formula to calculate x for a given t in range 0 to 1 is
+ x(t) = (1-t)^3*x0 + 3*(1-t)^2*t*x0c + 3*(1-t)*t^2*x1c + t^3*x1
+ with
+ x0 Left point coordinate
+ x0c Left control point coordinate
+ x1c Right control point coordinate
+ x1 Right point coordinate.
+ The ^ operator is used as power here (t^3 is t*t*t).
+
+ The formula for y is similar.
+*/
+
+/** Calculate coordinate value for a t value, save to minimum and/or
+ maximum if necessary.
+ @param pmin Address of bounding box minimum component.
+ @param pmax Address of bounding box maximum component.
+ @param pflags Address of bounding box flags component.
+ @param flval Flag bit for test (1=x, 2=y).
+ @param x0 Left point value.
+ @param x0c Left control point value.
+ @param x1c Right control point value.
+ @param x1 Right point value.
+ @param t Variable t value.
+*/
+
+static
+void
+dk4bb_i_apply_t_bezier(
+ double *pmin,
+ double *pmax,
+ unsigned char *pflags,
+ unsigned char flval,
+ double x0,
+ double x0c,
+ double x1c,
+ double x1,
+ double t
+)
+{
+ double omt; /* 1 - t */
+ double x; /* x value */
+
+
+#line 410 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pmin);
+ assert(NULL != pmax);
+ assert(NULL != pflags);
+#endif
+#if TRACE_DEBUG
+ if (isfinite(t)) {
+
+#line 417 "dk4bb.ctr"
+ }
+ else {
+
+#line 419 "dk4bb.ctr"
+ }
+#endif
+ if ( isgreaterequal(t, 0.0) ) {
+ if ( islessequal(t, 1.0) ) {
+
+#line 423 "dk4bb.ctr"
+ omt = 1.0 - t;
+ x = omt * omt * omt * x0
+ + 3.0 * omt * omt * t * x0c
+ + 3.0 * omt * t * t * x1c
+ + t * t * t * x1;
+
+#line 428 "dk4bb.ctr"
+ if (0 != ((*pflags) & flval)) {
+
+#line 429 "dk4bb.ctr"
+ if (isless(x, *pmin)) {
+
+#line 430 "dk4bb.ctr"
+ *pmin = x;
+ }
+ if (isgreater(x, *pmax)) {
+
+#line 433 "dk4bb.ctr"
+ *pmax = x;
+ }
+ }
+ else {
+
+#line 437 "dk4bb.ctr"
+ *pmin = x;
+ *pmax = x;
+ *pflags |= flval;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 444 "dk4bb.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 449 "dk4bb.ctr"
+ }
+#endif
+
+
+#line 452 "dk4bb.ctr"
+}
+
+
+
+/*
+ The formula used here was found using wxMaxima, input was
+
+ x: (1-t)^3*x0 + 3*(1-t)^2*t*x0c + 3*(1-t)*t^2*x1c + t^3*x1;
+ solve([diff(x, t)=0],[t]);
+
+ To find minima and maxima values we derive the Bezier curve
+ formula and search for zeroes of the derived function.
+*/
+
+/** Check minimum and maximum coordinate value of a Bezier curve,
+ save values in bounding box if necessary.
+ @param pmin Address of bounding box minimum component.
+ @param pmax Address of bounding box maximum component.
+ @param pflags Address of bounding box flags component.
+ @param flval Flag bit for test (1=x, 2=y).
+ @param x0 Left point value.
+ @param x0c Left control point value.
+ @param x1c Right control point value.
+ @param x1 Right point value.
+*/
+
+static
+void
+dk4bb_i_apply_bezier(
+ double *pmin,
+ double *pmax,
+ unsigned char *pflags,
+ unsigned char flval,
+ double x0,
+ double x0c,
+ double x1c,
+ double x1
+)
+{
+ double a; /* Coefficient to third power of t */
+ double b; /* Coefficient to second power of t */
+ double c; /* Coefficient to t */
+ double denom; /* Denominator */
+ double sqop; /* Operand to square root */
+ double sqv; /* Square root result */
+ double t1; /* First extremum */
+ double t2; /* Second extremum */
+
+#if DK4_USE_ASSERT
+ assert(NULL != pmin);
+ assert(NULL != pmax);
+ assert(NULL != pflags);
+#endif
+ a = x1 - 3.0 * x1c + 3.0 * x0c - x0;
+ b = 3.0 * x0 - 6.0 * x0c + 3.0 * x1c;
+ c = 3.0 * (x0c - x0);
+ denom = 3.0 * a;
+ sqop = b * b - 3.0 * a * c;
+ sqv = sqrt(sqop);
+ t1 = (0.0 - b + sqv) / denom;
+ t2 = (0.0 - b - sqv) / denom;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(t1)) && (isfinite(t2)))
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(t1)) && (_finite(t2)))
+#else
+#error "Neither isfinite() nor _finite() available!"
+ if(1)
+#endif
+#endif
+ {
+
+#line 524 "dk4bb.ctr"
+ dk4bb_i_apply_t_bezier(pmin, pmax, pflags, flval, x0, x0c, x1c, x1, t1);
+ dk4bb_i_apply_t_bezier(pmin, pmax, pflags, flval, x0, x0c, x1c, x1, t2);
+ }
+ else {
+
+#line 528 "dk4bb.ctr"
+ t1 = (0.0 - c) / (2.0 * b);
+#if DK4_HAVE_ISFINITE
+ if (isfinite(t1))
+#else
+#if DK4_HAVE__FINITE
+ if (_finite(t1))
+#else
+#error "Neither isfinite() nor _finite() available!"
+ if(1)
+#endif
+#endif
+ {
+
+#line 540 "dk4bb.ctr"
+ dk4bb_i_apply_t_bezier(pmin,pmax,pflags,flval,x0,x0c,x1c,x1,t1);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 544 "dk4bb.ctr"
+ }
+#endif
+ }
+
+
+#line 548 "dk4bb.ctr"
+}
+
+
+
+/** Internal function to add Bezier spline segment to bounding box.
+ The bbptr pointer is already checked to be not NULL.
+ @param bbptr Bounding box to modify.
+ @param x0 Start point, x coordinate.
+ @param y0 Start point, y coordinate.
+ @param c0x Control point next to start point, x coordinate.
+ @param c0y Control point next to start point, y coordinate.
+ @param c1x Control point next to end point, x coordinate.
+ @param c1y Control point next to end point, y coordinate.
+ @param x1 End point, x coordinate.
+ @param y1 End point, y coordinate.
+*/
+
+static
+void
+dk4bb_i_bezier(
+ dk4_bb_t *bbptr,
+ double x0,
+ double y0,
+ double c0x,
+ double c0y,
+ double c1x,
+ double c1y,
+ double x1,
+ double y1
+)
+{
+
+
+#line 580 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ dk4bb_i_add_x(bbptr, x0);
+ dk4bb_i_add_y(bbptr, y0);
+ dk4bb_i_add_x(bbptr, x1);
+ dk4bb_i_add_y(bbptr, y1);
+ dk4bb_i_apply_bezier(
+ &(bbptr->xmin), &(bbptr->xmax), &(bbptr->fl), have_x,
+ x0, c0x, c1x, x1
+ );
+ dk4bb_i_apply_bezier(
+ &(bbptr->ymin), &(bbptr->ymax), &(bbptr->fl), have_y,
+ y0, c0y, c1y, y1
+ );
+
+
+#line 596 "dk4bb.ctr"
+}
+
+
+
+static
+double
+dk4bb_sq(double x)
+{
+ return (x * x);
+}
+
+
+static
+void
+dk4bb_i_add_rotated_ellipse(
+ dk4_bb_t *bbptr,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot
+)
+{
+ double th;
+ double tw;
+ double xw;
+ double yw;
+ double xh;
+ double yh;
+ double h;
+ double w;
+ double beta;
+
+
+#line 629 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ th = atan2((-1.0 * ry), (rx * tan(M_PI - rot)));
+ tw = atan2((-1.0 * ry), (rx * tan(M_PI_2 - rot)));
+
+
+#line 635 "dk4bb.ctr"
+ xh = rx * cos(th);
+ yh = ry * sin(th);
+
+
+#line 638 "dk4bb.ctr"
+ xw = rx * cos(tw);
+ yw = ry * sin(tw);
+
+
+#line 641 "dk4bb.ctr"
+ beta = 0.0 - rot;
+ h = sqrt(
+ dk4bb_sq(yh - (yh*sin(beta)+xh*cos(beta))*sin(beta))
+ + dk4bb_sq(xh - (yh*sin(beta)+xh*cos(beta))*cos(beta))
+ );
+
+#line 646 "dk4bb.ctr"
+ beta += M_PI_2;
+ w = sqrt(
+ dk4bb_sq(yw - (yw*sin(beta)+xw*cos(beta))*sin(beta))
+ + dk4bb_sq(xw - (yw*sin(beta)+xw*cos(beta))*cos(beta))
+ );
+
+#line 651 "dk4bb.ctr"
+ dk4bb_i_add_x(bbptr, xc + w);
+ dk4bb_i_add_x(bbptr, xc - w);
+ dk4bb_i_add_y(bbptr, yc + h);
+ dk4bb_i_add_y(bbptr, yc - h);
+
+
+#line 656 "dk4bb.ctr"
+}
+
+
+
+void
+dk4bb_init(
+ dk4_bb_t *bbptr
+)
+{
+
+
+#line 666 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ DK4_MEMRES(bbptr, sizeof(dk4_bb_t));
+ bbptr->xmin = bbptr->xmax = bbptr->ymin = bbptr->ymax = 0.0;
+ bbptr->fl = have_not;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 676 "dk4bb.ctr"
+ }
+#endif
+
+
+#line 679 "dk4bb.ctr"
+}
+
+
+
+void
+dk4bb_add_x(
+ dk4_bb_t *bbptr,
+ double x
+)
+{
+
+
+#line 690 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_add_x(bbptr, x);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 698 "dk4bb.ctr"
+ }
+#endif
+
+
+#line 701 "dk4bb.ctr"
+}
+
+
+
+void
+dk4bb_add_y(
+ dk4_bb_t *bbptr,
+ double y
+)
+{
+
+
+#line 712 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_add_y(bbptr, y);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 720 "dk4bb.ctr"
+ }
+#endif
+
+
+#line 723 "dk4bb.ctr"
+}
+
+
+
+void
+dk4bb_add_point(
+ dk4_bb_t *bbptr,
+ double x,
+ double y
+)
+{
+
+
+#line 735 "dk4bb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_add_x(bbptr, x);
+ dk4bb_i_add_y(bbptr, y);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 744 "dk4bb.ctr"
+ }
+#endif
+
+
+#line 747 "dk4bb.ctr"
+}
+
+
+
+void
+dk4bb_add_bezier(
+ dk4_bb_t *bbptr,
+ double x0,
+ double y0,
+ double c0x,
+ double c0y,
+ double c1x,
+ double c1y,
+ double x1,
+ double y1
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_bezier(bbptr, x0, y0, c0x, c0y, c1x, c1y, x1, y1);
+ }
+}
+
+
+void
+dk4bb_add_rotated_ellipse(
+ dk4_bb_t *bbptr,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_add_rotated_ellipse(bbptr, xc, yc, rx, ry, rot);
+ }
+}
+
+
+
+void
+dk4bb_add_bb(
+ dk4_bb_t *pdst,
+ dk4_bb_t const *psrc
+)
+{
+ if ((NULL != pdst) && (NULL != psrc)) {
+ if (have_not != (have_x & (psrc->fl))) {
+ dk4bb_i_add_x(pdst, psrc->xmin);
+ dk4bb_i_add_x(pdst, psrc->xmax);
+ }
+ if (have_not != (have_y & (psrc->fl))) {
+ dk4bb_i_add_y(pdst, psrc->ymin);
+ dk4bb_i_add_y(pdst, psrc->ymax);
+ }
+ }
+}
+
+
+
+int
+dk4bb_have_x(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return ((have_not != (have_x & (bbptr->fl))) ? (1) : (0));
+ }
+ return 0;
+}
+
+
+
+int
+dk4bb_have_y(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return ((have_not != (have_y & (bbptr->fl))) ? (1) : (0));
+ }
+ return 0;
+}
+
+
+
+double
+dk4bb_get_xmin(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return bbptr->xmin;
+ }
+ return 0.0;
+}
+
+
+
+double
+dk4bb_get_xmax(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return bbptr->xmax;
+ }
+ return 0.0;
+}
+
+
+
+double
+dk4bb_get_ymin(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return bbptr->ymin;
+ }
+ return 0.0;
+}
+
+
+
+double
+dk4bb_get_ymax(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return bbptr->ymax;
+ }
+ return 0.0;
+}
+
+
+
+#if TRACE_DEBUG
+static
+void
+dk4bb_report_bb(const dk4_bb_t *p)
+{
+
+
+#line 915 "dk4bb.ctr"
+
+
+#line 916 "dk4bb.ctr"
+}
+#endif
+
+
+int
+dk4bb_contains_bb(
+ const dk4_bb_t *pouter,
+ const dk4_bb_t *pinner,
+ int aborder
+)
+{
+ int back = 0;
+
+
+#line 929 "dk4bb.ctr"
+
+
+#line 930 "dk4bb.ctr"
+
+
+#line 931 "dk4bb.ctr"
+
+
+#line 932 "dk4bb.ctr"
+
+
+#line 933 "dk4bb.ctr"
+ if ((NULL != pouter) && (NULL != pinner)) {
+
+#line 934 "dk4bb.ctr"
+ if (
+ (have_both == (have_both & (pouter->fl)))
+ && (have_both == (have_both & (pinner->fl)))
+ ) {
+
+#line 938 "dk4bb.ctr"
+ if (0 != aborder) {
+
+#line 939 "dk4bb.ctr"
+ if (
+ (pinner->xmin >= pouter->xmin)
+ && (pinner->xmax <= pouter->xmax)
+ && (pinner->ymin >= pouter->ymin)
+ && (pinner->ymax <= pouter->ymax)
+ ) {
+ back = 1;
+ }
+ }
+ else {
+
+#line 949 "dk4bb.ctr"
+ if (
+ (pinner->xmin > pouter->xmin)
+ && (pinner->xmax < pouter->xmax)
+ && (pinner->ymin > pouter->ymin)
+ && (pinner->ymax < pouter->ymax)
+ ) {
+ back = 1;
+ }
+ }
+ }
+ else {
+
+#line 960 "dk4bb.ctr"
+ }
+ }
+ else {
+
+#line 963 "dk4bb.ctr"
+ }
+
+
+#line 965 "dk4bb.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bb.ctr b/support/dktools/dk4bb.ctr
new file mode 100644
index 0000000000..ce3815681c
--- /dev/null
+++ b/support/dktools/dk4bb.ctr
@@ -0,0 +1,971 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4bb.h Bounding box for drawing operations.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+
+
+/** Bounding box.
+*/
+typedef struct {
+ double xmin; /**< Minimum x value. */
+ double xmax; /**< Maximum x value. */
+ double ymin; /**< Minimum y value. */
+ double ymax; /**< Maximum y value. */
+ unsigned char fl; /**< Flags: Have x (bit 0), have y (bit 1). */
+} dk4_bb_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Initialize bounding box.
+ @param bbptr Bounding box to initialize.
+*/
+
+void
+dk4bb_init(
+ dk4_bb_t *bbptr
+);
+
+
+/** Add x coordinate to bounding box.
+ @param bbptr Bounding box to modify.
+ @param x Coordinate value to add.
+*/
+
+void
+dk4bb_add_x(
+ dk4_bb_t *bbptr,
+ double x
+);
+
+
+/** Add y coordinate to bounding box.
+ @param bbptr Bounding box to modify.
+ @param y Coordinate value to add.
+*/
+
+void
+dk4bb_add_y(
+ dk4_bb_t *bbptr,
+ double y
+);
+
+
+/** Add point to bounding box.
+ @param bbptr Bounding box to modify.
+ @param x X coordinate of point.
+ @param y Y coordinate of point.
+*/
+
+void
+dk4bb_add_point(
+ dk4_bb_t *bbptr,
+ double x,
+ double y
+);
+
+
+/** Add Bezier spline segment to bounding box.
+ @param bbptr Bounding box to modify.
+ @param x0 Start point, x coordinate.
+ @param y0 Start point, y coordinate.
+ @param c0x Control point next to start point, x coordinate.
+ @param c0y Control point next to start point, y coordinate.
+ @param c1x Control point next to end point, x coordinate.
+ @param c1y Control point next to end point, y coordinate.
+ @param x1 End point, x coordinate.
+ @param y1 End point, y coordinate.
+*/
+
+void
+dk4bb_add_bezier(
+ dk4_bb_t *bbptr,
+ double x0,
+ double y0,
+ double c0x,
+ double c0y,
+ double c1x,
+ double c1y,
+ double x1,
+ double y1
+);
+
+
+/** Add bounding box for a rotated ellipse.
+ @param bbptr Bounding box to modify.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx X radius.
+ @param ry Y radius.
+ @param rot Rotation counterclockwise in radians.
+*/
+
+void
+dk4bb_add_rotated_ellipse(
+ dk4_bb_t *bbptr,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot
+);
+
+
+/** Add one bounding box to another one.
+ @param pdest Destination bounding box.
+ @param psrc Source bounding box.
+*/
+
+void
+dk4bb_add_bb(
+ dk4_bb_t *pdest,
+ dk4_bb_t const *psrc
+);
+
+
+/** Check whether an x value is saved in the bounding box.
+ @param bbptr Bounding box to query.
+ @return 1 if x value available, 0 otherwise.
+*/
+
+int
+dk4bb_have_x(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Check whether an y value is saved in the bounding box.
+ @param bbptr Bounding box to query.
+ @return 1 if y value available, 0 otherwise.
+*/
+
+int
+dk4bb_have_y(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Retrieve minimum x value.
+ @param bbptr Bounding box to query.
+ @return Minimum x value saved in the bounding box.
+*/
+
+double
+dk4bb_get_xmin(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Retrieve maximum x value.
+ @param bbptr Bounding box to query.
+ @return Maximum x value saved in the bounding box.
+*/
+
+double
+dk4bb_get_xmax(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Retrieve minimum y value.
+ @param bbptr Bounding box to query.
+ @return Minimum y value saved in the bounding box.
+*/
+
+double
+dk4bb_get_ymin(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Retrieve maximum y value.
+ @param bbptr Bounding box to query.
+ @return Maximum y value saved in the bounding box.
+*/
+
+double
+dk4bb_get_ymax(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Check whether an outer box contains an inner box candidate.
+ Both boxes must have both x and y information.
+ @param pouter Outer box.
+ @param pinner Inner box candidate.
+ @param aborder Flag: Allow overlapping borders.
+ @return 1 if pouter contains pinner, 0 otherwise.
+*/
+
+int
+dk4bb_contains_bb(
+ const dk4_bb_t *pouter,
+ const dk4_bb_t *pinner,
+ int aborder
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#include "dk4conf.h"
+#include "dk4bb.h"
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+/** Flag value to indicate information not present.
+*/
+static const unsigned char have_not = ((unsigned char)0U);
+
+/** Flag value to indicate X information presence.
+*/
+static const unsigned char have_x = ((unsigned char)1U);
+
+/** Flag value to indicate Y information presence.
+*/
+static const unsigned char have_y = ((unsigned char)2U);
+
+/** Flag value to check for information about both directions.
+*/
+static const unsigned char have_both = ((unsigned char)3U);
+
+
+/** Internally add an x value to bounding box.
+ @param bbptr Bounding box to modify.
+ @param x X value to add.
+*/
+
+static
+void
+dk4bb_i_add_x(
+ dk4_bb_t *bbptr,
+ double x
+)
+{
+ $? "+ dk4bb_i_add_x %g", x
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (have_not != (have_x & (bbptr->fl))) {
+ $? ". compare against saved values"
+ if (x < bbptr->xmin) {
+ bbptr->xmin = x; $? ". save new xmin=%g", x
+ }
+ if (x > bbptr->xmax) {
+ bbptr->xmax = x; $? ". save new xmax=%g", x
+ }
+ }
+ else { $? ". save values"
+ bbptr->xmin = bbptr->xmax = x;
+ bbptr->fl |= have_x;
+ }
+ $? "- dk4bb_i_add_x"
+}
+
+
+
+/** Internally add an y value to bounding box.
+ @param bbptr Bounding box to modify.
+ @param y Y value to add.
+*/
+
+static
+void
+dk4bb_i_add_y(
+ dk4_bb_t *bbptr,
+ double y
+)
+{
+ $? "+ dk4bb_i_add_y %g", y
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (have_not != (have_y & (bbptr->fl))) {
+ $? ". compare against saved values"
+ if (y < bbptr->ymin) { $? ". save new ymin=%g", y
+ bbptr->ymin = y;
+ }
+ if (y > bbptr->ymax) { $? ". save new ymax=%g", y
+ bbptr->ymax = y;
+ }
+ }
+ else { $? ". save values"
+ bbptr->ymin = bbptr->ymax = y;
+ bbptr->fl |= have_y;
+ }
+ $? "- dk4bb_i_add_y"
+}
+
+
+
+/*
+ The formula to calculate x for a given t in range 0 to 1 is
+ x(t) = (1-t)^3*x0 + 3*(1-t)^2*t*x0c + 3*(1-t)*t^2*x1c + t^3*x1
+ with
+ x0 Left point coordinate
+ x0c Left control point coordinate
+ x1c Right control point coordinate
+ x1 Right point coordinate.
+ The ^ operator is used as power here (t^3 is t*t*t).
+
+ The formula for y is similar.
+*/
+
+/** Calculate coordinate value for a t value, save to minimum and/or
+ maximum if necessary.
+ @param pmin Address of bounding box minimum component.
+ @param pmax Address of bounding box maximum component.
+ @param pflags Address of bounding box flags component.
+ @param flval Flag bit for test (1=x, 2=y).
+ @param x0 Left point value.
+ @param x0c Left control point value.
+ @param x1c Right control point value.
+ @param x1 Right point value.
+ @param t Variable t value.
+*/
+
+static
+void
+dk4bb_i_apply_t_bezier(
+ double *pmin,
+ double *pmax,
+ unsigned char *pflags,
+ unsigned char flval,
+ double x0,
+ double x0c,
+ double x1c,
+ double x1,
+ double t
+)
+{
+ double omt; /* 1 - t */
+ double x; /* x value */
+ $? "+ dk4bb_i_apply_t_bezier %g %g %g %g t=%g", x0, x0c, x1c, x1, t
+#if DK4_USE_ASSERT
+ assert(NULL != pmin);
+ assert(NULL != pmax);
+ assert(NULL != pflags);
+#endif
+#if TRACE_DEBUG
+ if (isfinite(t)) { $? ". t is finite"
+ }
+ else { $? "! t is not finite"
+ }
+#endif
+ if ( isgreaterequal(t, 0.0) ) {
+ if ( islessequal(t, 1.0) ) { $? ". valid t"
+ omt = 1.0 - t;
+ x = omt * omt * omt * x0
+ + 3.0 * omt * omt * t * x0c
+ + 3.0 * omt * t * t * x1c
+ + t * t * t * x1; $? ". x=%g", x
+ if (0 != ((*pflags) & flval)) { $? ". check with existing extrema"
+ if (isless(x, *pmin)) { $? ". new minimum (former %g)",*pmin
+ *pmin = x;
+ }
+ if (isgreater(x, *pmax)) { $? ". new maximum (forger %g)",*pmax
+ *pmax = x;
+ }
+ }
+ else { $? ". no existing extrema"
+ *pmin = x;
+ *pmax = x;
+ *pflags |= flval;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". t=%g out of range", t
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? ". t=%g out of range", t
+ }
+#endif
+ $? "- dk4bb_i_apply_t_bezier"
+}
+
+
+
+/*
+ The formula used here was found using wxMaxima, input was
+
+ x: (1-t)^3*x0 + 3*(1-t)^2*t*x0c + 3*(1-t)*t^2*x1c + t^3*x1;
+ solve([diff(x, t)=0],[t]);
+
+ To find minima and maxima values we derive the Bezier curve
+ formula and search for zeroes of the derived function.
+*/
+
+/** Check minimum and maximum coordinate value of a Bezier curve,
+ save values in bounding box if necessary.
+ @param pmin Address of bounding box minimum component.
+ @param pmax Address of bounding box maximum component.
+ @param pflags Address of bounding box flags component.
+ @param flval Flag bit for test (1=x, 2=y).
+ @param x0 Left point value.
+ @param x0c Left control point value.
+ @param x1c Right control point value.
+ @param x1 Right point value.
+*/
+
+static
+void
+dk4bb_i_apply_bezier(
+ double *pmin,
+ double *pmax,
+ unsigned char *pflags,
+ unsigned char flval,
+ double x0,
+ double x0c,
+ double x1c,
+ double x1
+)
+{
+ double a; /* Coefficient to third power of t */
+ double b; /* Coefficient to second power of t */
+ double c; /* Coefficient to t */
+ double denom; /* Denominator */
+ double sqop; /* Operand to square root */
+ double sqv; /* Square root result */
+ double t1; /* First extremum */
+ double t2; /* Second extremum */
+
+#if DK4_USE_ASSERT
+ assert(NULL != pmin);
+ assert(NULL != pmax);
+ assert(NULL != pflags);
+#endif
+ a = x1 - 3.0 * x1c + 3.0 * x0c - x0;
+ b = 3.0 * x0 - 6.0 * x0c + 3.0 * x1c;
+ c = 3.0 * (x0c - x0);
+ denom = 3.0 * a;
+ sqop = b * b - 3.0 * a * c;
+ sqv = sqrt(sqop);
+ t1 = (0.0 - b + sqv) / denom;
+ t2 = (0.0 - b - sqv) / denom;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(t1)) && (isfinite(t2)))
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(t1)) && (_finite(t2)))
+#else
+#error "Neither isfinite() nor _finite() available!"
+ if(1)
+#endif
+#endif
+ { $? ". 3rd degree polynomial"
+ dk4bb_i_apply_t_bezier(pmin, pmax, pflags, flval, x0, x0c, x1c, x1, t1);
+ dk4bb_i_apply_t_bezier(pmin, pmax, pflags, flval, x0, x0c, x1c, x1, t2);
+ }
+ else { $? ". not a 3rd degree polynomial"
+ t1 = (0.0 - c) / (2.0 * b);
+#if DK4_HAVE_ISFINITE
+ if (isfinite(t1))
+#else
+#if DK4_HAVE__FINITE
+ if (_finite(t1))
+#else
+#error "Neither isfinite() nor _finite() available!"
+ if(1)
+#endif
+#endif
+ { $? ". 2nd degree polynomial"
+ dk4bb_i_apply_t_bezier(pmin,pmax,pflags,flval,x0,x0c,x1c,x1,t1);
+ }
+#if TRACE_DEBUG
+ else { $? "! not a polynomial"
+ }
+#endif
+ }
+ $? "- dk4bb_i_apply_bezier"
+}
+
+
+
+/** Internal function to add Bezier spline segment to bounding box.
+ The bbptr pointer is already checked to be not NULL.
+ @param bbptr Bounding box to modify.
+ @param x0 Start point, x coordinate.
+ @param y0 Start point, y coordinate.
+ @param c0x Control point next to start point, x coordinate.
+ @param c0y Control point next to start point, y coordinate.
+ @param c1x Control point next to end point, x coordinate.
+ @param c1y Control point next to end point, y coordinate.
+ @param x1 End point, x coordinate.
+ @param y1 End point, y coordinate.
+*/
+
+static
+void
+dk4bb_i_bezier(
+ dk4_bb_t *bbptr,
+ double x0,
+ double y0,
+ double c0x,
+ double c0y,
+ double c1x,
+ double c1y,
+ double x1,
+ double y1
+)
+{
+ $? "+ dk4bb_i_bezier %g %g %g %g %g %g %g %g", x0, y0, c0x, c0y, c1x, c1y, x1, y1
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ dk4bb_i_add_x(bbptr, x0);
+ dk4bb_i_add_y(bbptr, y0);
+ dk4bb_i_add_x(bbptr, x1);
+ dk4bb_i_add_y(bbptr, y1);
+ dk4bb_i_apply_bezier(
+ &(bbptr->xmin), &(bbptr->xmax), &(bbptr->fl), have_x,
+ x0, c0x, c1x, x1
+ );
+ dk4bb_i_apply_bezier(
+ &(bbptr->ymin), &(bbptr->ymax), &(bbptr->fl), have_y,
+ y0, c0y, c1y, y1
+ );
+ $? "- dk4bb_i_bezier"
+}
+
+
+
+static
+double
+dk4bb_sq(double x)
+{
+ return (x * x);
+}
+
+
+static
+void
+dk4bb_i_add_rotated_ellipse(
+ dk4_bb_t *bbptr,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot
+)
+{
+ double th;
+ double tw;
+ double xw;
+ double yw;
+ double xh;
+ double yh;
+ double h;
+ double w;
+ double beta;
+ $? "+ dk4bb_i_add_rotated_ellipse %g %g %g %g %g", xc, yc, rx, ry, rot
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ th = atan2((-1.0 * ry), (rx * tan(M_PI - rot)));
+ tw = atan2((-1.0 * ry), (rx * tan(M_PI_2 - rot)));
+ $? ". th=%g tw=%g", th, tw
+ xh = rx * cos(th);
+ yh = ry * sin(th);
+ $? ". xh=%g yh=%g", xh, yh
+ xw = rx * cos(tw);
+ yw = ry * sin(tw);
+ $? ". xw=%g yw=%g", xw, yw
+ beta = 0.0 - rot;
+ h = sqrt(
+ dk4bb_sq(yh - (yh*sin(beta)+xh*cos(beta))*sin(beta))
+ + dk4bb_sq(xh - (yh*sin(beta)+xh*cos(beta))*cos(beta))
+ ); $? ". h=%g", h
+ beta += M_PI_2;
+ w = sqrt(
+ dk4bb_sq(yw - (yw*sin(beta)+xw*cos(beta))*sin(beta))
+ + dk4bb_sq(xw - (yw*sin(beta)+xw*cos(beta))*cos(beta))
+ ); $? ". w=%g", w
+ dk4bb_i_add_x(bbptr, xc + w);
+ dk4bb_i_add_x(bbptr, xc - w);
+ dk4bb_i_add_y(bbptr, yc + h);
+ dk4bb_i_add_y(bbptr, yc - h);
+ $? "- dk4bb_i_add_rotated_ellipse"
+}
+
+
+
+void
+dk4bb_init(
+ dk4_bb_t *bbptr
+)
+{
+ $? "+ dk4bb_init"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ DK4_MEMRES(bbptr, sizeof(dk4_bb_t));
+ bbptr->xmin = bbptr->xmax = bbptr->ymin = bbptr->ymax = 0.0;
+ bbptr->fl = have_not;
+ }
+#if TRACE_DEBUG
+ else { $? "! invalid pointer"
+ }
+#endif
+ $? "- dk4bb_init"
+}
+
+
+
+void
+dk4bb_add_x(
+ dk4_bb_t *bbptr,
+ double x
+)
+{
+ $? "+ dk4bb_add_x"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_add_x(bbptr, x);
+ }
+#if TRACE_DEBUG
+ else { $? "! invalid pointer"
+ }
+#endif
+ $? "- dk4bb_add_x"
+}
+
+
+
+void
+dk4bb_add_y(
+ dk4_bb_t *bbptr,
+ double y
+)
+{
+ $? "+ dk4bb_add_y"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_add_y(bbptr, y);
+ }
+#if TRACE_DEBUG
+ else { $? "! invalid pointer"
+ }
+#endif
+ $? "- dk4bb_add_y"
+}
+
+
+
+void
+dk4bb_add_point(
+ dk4_bb_t *bbptr,
+ double x,
+ double y
+)
+{
+ $? "+ dk4bb_add_point"
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_add_x(bbptr, x);
+ dk4bb_i_add_y(bbptr, y);
+ }
+#if TRACE_DEBUG
+ else { $? "! invalid pointer"
+ }
+#endif
+ $? "- dk4bb_add_point"
+}
+
+
+
+void
+dk4bb_add_bezier(
+ dk4_bb_t *bbptr,
+ double x0,
+ double y0,
+ double c0x,
+ double c0y,
+ double c1x,
+ double c1y,
+ double x1,
+ double y1
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_bezier(bbptr, x0, y0, c0x, c0y, c1x, c1y, x1, y1);
+ }
+}
+
+
+void
+dk4bb_add_rotated_ellipse(
+ dk4_bb_t *bbptr,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ dk4bb_i_add_rotated_ellipse(bbptr, xc, yc, rx, ry, rot);
+ }
+}
+
+
+
+void
+dk4bb_add_bb(
+ dk4_bb_t *pdst,
+ dk4_bb_t const *psrc
+)
+{
+ if ((NULL != pdst) && (NULL != psrc)) {
+ if (have_not != (have_x & (psrc->fl))) {
+ dk4bb_i_add_x(pdst, psrc->xmin);
+ dk4bb_i_add_x(pdst, psrc->xmax);
+ }
+ if (have_not != (have_y & (psrc->fl))) {
+ dk4bb_i_add_y(pdst, psrc->ymin);
+ dk4bb_i_add_y(pdst, psrc->ymax);
+ }
+ }
+}
+
+
+
+int
+dk4bb_have_x(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return ((have_not != (have_x & (bbptr->fl))) ? (1) : (0));
+ }
+ return 0;
+}
+
+
+
+int
+dk4bb_have_y(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return ((have_not != (have_y & (bbptr->fl))) ? (1) : (0));
+ }
+ return 0;
+}
+
+
+
+double
+dk4bb_get_xmin(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return bbptr->xmin;
+ }
+ return 0.0;
+}
+
+
+
+double
+dk4bb_get_xmax(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return bbptr->xmax;
+ }
+ return 0.0;
+}
+
+
+
+double
+dk4bb_get_ymin(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return bbptr->ymin;
+ }
+ return 0.0;
+}
+
+
+
+double
+dk4bb_get_ymax(
+ const dk4_bb_t *bbptr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ return bbptr->ymax;
+ }
+ return 0.0;
+}
+
+
+
+#if TRACE_DEBUG
+static
+void
+dk4bb_report_bb(const dk4_bb_t *p)
+{
+ $? ". xmin=%g xmax=%g ymin=%g ymax=%g", p->xmin, p->xmax, p->ymin, p->ymax
+ $? ". flags = %u", (unsigned)(p->fl)
+}
+#endif
+
+
+int
+dk4bb_contains_bb(
+ const dk4_bb_t *pouter,
+ const dk4_bb_t *pinner,
+ int aborder
+)
+{
+ int back = 0;
+ $? "+ dk4bb_contains_bb"
+ $? ". outer box"
+ $!trace-code dk4bb_report_bb(pouter);
+ $? ". inner box"
+ $!trace-code dk4bb_report_bb(pinner);
+ if ((NULL != pouter) && (NULL != pinner)) { $? ". boxes ok"
+ if (
+ (have_both == (have_both & (pouter->fl)))
+ && (have_both == (have_both & (pinner->fl)))
+ ) { $? ". flags ok"
+ if (0 != aborder) { $? ". allow border"
+ if (
+ (pinner->xmin >= pouter->xmin)
+ && (pinner->xmax <= pouter->xmax)
+ && (pinner->ymin >= pouter->ymin)
+ && (pinner->ymax <= pouter->ymax)
+ ) {
+ back = 1;
+ }
+ }
+ else { $? ". border not allowed"
+ if (
+ (pinner->xmin > pouter->xmin)
+ && (pinner->xmax < pouter->xmax)
+ && (pinner->ymin > pouter->ymin)
+ && (pinner->ymax < pouter->ymax)
+ ) {
+ back = 1;
+ }
+ }
+ }
+ else { $? "! flags"
+ }
+ }
+ else { $? "! boxes"
+ }
+ $? "- dk4bb_contains_bb %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bb.h b/support/dktools/dk4bb.h
new file mode 100644
index 0000000000..f90cf58d01
--- /dev/null
+++ b/support/dktools/dk4bb.h
@@ -0,0 +1,252 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bb.ctr
+*/
+
+#ifndef DK4BB_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4BB_H_INCLUDED 1
+
+
+#line 9 "dk4bb.ctr"
+
+/** @file dk4bb.h Bounding box for drawing operations.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+
+
+/** Bounding box.
+*/
+typedef struct {
+ double xmin; /**< Minimum x value. */
+ double xmax; /**< Maximum x value. */
+ double ymin; /**< Minimum y value. */
+ double ymax; /**< Maximum y value. */
+ unsigned char fl; /**< Flags: Have x (bit 0), have y (bit 1). */
+} dk4_bb_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Initialize bounding box.
+ @param bbptr Bounding box to initialize.
+*/
+
+void
+dk4bb_init(
+ dk4_bb_t *bbptr
+);
+
+
+/** Add x coordinate to bounding box.
+ @param bbptr Bounding box to modify.
+ @param x Coordinate value to add.
+*/
+
+void
+dk4bb_add_x(
+ dk4_bb_t *bbptr,
+ double x
+);
+
+
+/** Add y coordinate to bounding box.
+ @param bbptr Bounding box to modify.
+ @param y Coordinate value to add.
+*/
+
+void
+dk4bb_add_y(
+ dk4_bb_t *bbptr,
+ double y
+);
+
+
+/** Add point to bounding box.
+ @param bbptr Bounding box to modify.
+ @param x X coordinate of point.
+ @param y Y coordinate of point.
+*/
+
+void
+dk4bb_add_point(
+ dk4_bb_t *bbptr,
+ double x,
+ double y
+);
+
+
+/** Add Bezier spline segment to bounding box.
+ @param bbptr Bounding box to modify.
+ @param x0 Start point, x coordinate.
+ @param y0 Start point, y coordinate.
+ @param c0x Control point next to start point, x coordinate.
+ @param c0y Control point next to start point, y coordinate.
+ @param c1x Control point next to end point, x coordinate.
+ @param c1y Control point next to end point, y coordinate.
+ @param x1 End point, x coordinate.
+ @param y1 End point, y coordinate.
+*/
+
+void
+dk4bb_add_bezier(
+ dk4_bb_t *bbptr,
+ double x0,
+ double y0,
+ double c0x,
+ double c0y,
+ double c1x,
+ double c1y,
+ double x1,
+ double y1
+);
+
+
+/** Add bounding box for a rotated ellipse.
+ @param bbptr Bounding box to modify.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx X radius.
+ @param ry Y radius.
+ @param rot Rotation counterclockwise in radians.
+*/
+
+void
+dk4bb_add_rotated_ellipse(
+ dk4_bb_t *bbptr,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot
+);
+
+
+/** Add one bounding box to another one.
+ @param pdest Destination bounding box.
+ @param psrc Source bounding box.
+*/
+
+void
+dk4bb_add_bb(
+ dk4_bb_t *pdest,
+ dk4_bb_t const *psrc
+);
+
+
+/** Check whether an x value is saved in the bounding box.
+ @param bbptr Bounding box to query.
+ @return 1 if x value available, 0 otherwise.
+*/
+
+int
+dk4bb_have_x(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Check whether an y value is saved in the bounding box.
+ @param bbptr Bounding box to query.
+ @return 1 if y value available, 0 otherwise.
+*/
+
+int
+dk4bb_have_y(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Retrieve minimum x value.
+ @param bbptr Bounding box to query.
+ @return Minimum x value saved in the bounding box.
+*/
+
+double
+dk4bb_get_xmin(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Retrieve maximum x value.
+ @param bbptr Bounding box to query.
+ @return Maximum x value saved in the bounding box.
+*/
+
+double
+dk4bb_get_xmax(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Retrieve minimum y value.
+ @param bbptr Bounding box to query.
+ @return Minimum y value saved in the bounding box.
+*/
+
+double
+dk4bb_get_ymin(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Retrieve maximum y value.
+ @param bbptr Bounding box to query.
+ @return Maximum y value saved in the bounding box.
+*/
+
+double
+dk4bb_get_ymax(
+ const dk4_bb_t *bbptr
+);
+
+
+/** Check whether an outer box contains an inner box candidate.
+ Both boxes must have both x and y information.
+ @param pouter Outer box.
+ @param pinner Inner box candidate.
+ @param aborder Flag: Allow overlapping borders.
+ @return 1 if pouter contains pinner, 0 otherwise.
+*/
+
+int
+dk4bb_contains_bb(
+ const dk4_bb_t *pouter,
+ const dk4_bb_t *pinner,
+ int aborder
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4bb32.c b/support/dktools/dk4bb32.c
new file mode 100644
index 0000000000..87918e0a92
--- /dev/null
+++ b/support/dktools/dk4bb32.c
@@ -0,0 +1,190 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bb32.ctr
+*/
+
+/** @file dk4bb32.c The dk4bb32 module.
+*/
+
+
+#line 146 "dk4bb32.ctr"
+
+#ifndef DK4BB32_H_INCLUDED
+#include "dk4bb32.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+void
+dk4bb32_init(dk4_bb32_t *bbptr)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ DK4_MEMRES(bbptr,sizeof(dk4_bb32_t));
+ bbptr->xmin = bbptr->xmax = bbptr->ymin = bbptr->ymax = (int32_t)0L;
+ bbptr->hx = bbptr->hy = 0x00;
+ }
+}
+
+
+
+void
+dk4bb32_add_x(dk4_bb32_t *bbptr, int32_t x)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ if (0x00 != bbptr->hx) {
+ if (bbptr->xmin > x) {
+ bbptr->xmin = x;
+ }
+ if (bbptr->xmax < x) {
+ bbptr->xmax = x;
+ }
+ }
+ else {
+ bbptr->xmin = bbptr->xmax = x;
+ bbptr->hx = 0x01;
+ }
+ }
+}
+
+
+
+void
+dk4bb32_add_y(dk4_bb32_t *bbptr, int32_t y)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ if (0x00 != bbptr->hy) {
+ if (bbptr->ymin > y) {
+ bbptr->ymin = y;
+ }
+ if (bbptr->ymax < y) {
+ bbptr->ymax = y;
+ }
+ }
+ else {
+ bbptr->ymin = bbptr->ymax = y;
+ bbptr->hy = 0x01;
+ }
+ }
+}
+
+
+
+void
+dk4bb32_add_point(dk4_bb32_t *bbptr, int32_t x, int32_t y)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ dk4bb32_add_x(bbptr, x);
+ dk4bb32_add_y(bbptr, y);
+}
+
+
+
+int
+dk4bb32_have_x(dk4_bb32_t const *bbptr)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { if (0x00 != bbptr->hx) { back = 1; } }
+ return back;
+}
+
+
+
+int
+dk4bb32_have_y(dk4_bb32_t const *bbptr)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { if (0x00 != bbptr->hy) { back = 1; } }
+ return back;
+}
+
+
+
+int32_t
+dk4bb32_get_x_min(dk4_bb32_t const *bbptr)
+{
+ int32_t back = (int32_t)0L;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { back = bbptr->xmin; }
+ return back;
+}
+
+
+
+int32_t
+dk4bb32_get_x_max(dk4_bb32_t const *bbptr)
+{
+ int32_t back = (int32_t)0L;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { back = bbptr->xmax; }
+ return back;
+}
+
+
+
+int32_t
+dk4bb32_get_y_min(dk4_bb32_t const *bbptr)
+{
+ int32_t back = (int32_t)0L;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { back = bbptr->ymin; }
+ return back;
+}
+
+
+
+int32_t
+dk4bb32_get_y_max(dk4_bb32_t const *bbptr)
+{
+ int32_t back = (int32_t)0L;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { back = bbptr->ymax; }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bb32.ctr b/support/dktools/dk4bb32.ctr
new file mode 100644
index 0000000000..99bea95ddb
--- /dev/null
+++ b/support/dktools/dk4bb32.ctr
@@ -0,0 +1,317 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4bb32.h Bounding box for int32_t coordinates.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+
+
+/** Bounding box for int32_t coordinates.
+*/
+typedef struct {
+ int32_t xmin; /**< Minimum x value. */
+ int32_t xmax; /**< Maximum x value. */
+ int32_t ymin; /**< Minimum y value. */
+ int32_t ymax; /**< Maximum y value. */
+ unsigned char hx; /**< Flag: Have x values. */
+ unsigned char hy; /**< Flag: Have y values. */
+} dk4_bb32_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Initialize bounding box structure.
+ @param bbptr Structure to initialize.
+*/
+
+void
+dk4bb32_init(dk4_bb32_t *bbptr);
+
+
+/** Add x value to bounding box.
+ @param bbptr Structure to modify.
+ @param x Value to add.
+*/
+
+void
+dk4bb32_add_x(dk4_bb32_t *bbptr, int32_t x);
+
+
+/** Add y value to bounding box.
+ @param bbptr Structure to modify.
+ @param y Value to add.
+*/
+
+void
+dk4bb32_add_y(dk4_bb32_t *bbptr, int32_t y);
+
+
+/** Add x and y value of a point to bounding box.
+ @param bbptr Structure to modify.
+ @param x X value to add.
+ @param y Y value to add.
+*/
+
+void
+dk4bb32_add_point(dk4_bb32_t *bbptr, int32_t x, int32_t y);
+
+
+/** Check whether a bounding box contains x information.
+ @param bbptr Structure to check.
+ @return 1 if x information available, 0 otherwise.
+*/
+
+int
+dk4bb32_have_x(dk4_bb32_t const *bbptr);
+
+
+/** Check whether a bounding box contains y information.
+ @param bbptr Structure to check.
+ @return 1 if y information available, 0 otherwise.
+*/
+
+int
+dk4bb32_have_y(dk4_bb32_t const *bbptr);
+
+
+/** Get minimum x value from bounding box structure.
+ @param bbptr Structure to use.
+ @return Minimum x value if x information available, random value otherwise.
+*/
+
+int32_t
+dk4bb32_get_x_min(dk4_bb32_t const *bbptr);
+
+
+/** Get maximum x value from bounding box structure.
+ @param bbptr Structure to use.
+ @return Maximum x value if x information available, random value otherwise.
+*/
+
+int32_t
+dk4bb32_get_x_max(dk4_bb32_t const *bbptr);
+
+
+/** Get minimum y value from bounding box structure.
+ @param bbptr Structure to use.
+ @return Minimum y value if y information available, random value otherwise.
+*/
+
+int32_t
+dk4bb32_get_y_min(dk4_bb32_t const *bbptr);
+
+
+/** Get maximum y value from bounding box structure.
+ @param bbptr Structure to use.
+ @return Maximum y value if y information available, random value otherwise.
+*/
+
+int32_t
+dk4bb32_get_y_max(dk4_bb32_t const *bbptr);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#ifndef DK4BB32_H_INCLUDED
+#include "dk4bb32.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+void
+dk4bb32_init(dk4_bb32_t *bbptr)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ DK4_MEMRES(bbptr,sizeof(dk4_bb32_t));
+ bbptr->xmin = bbptr->xmax = bbptr->ymin = bbptr->ymax = (int32_t)0L;
+ bbptr->hx = bbptr->hy = 0x00;
+ }
+}
+
+
+
+void
+dk4bb32_add_x(dk4_bb32_t *bbptr, int32_t x)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ if (0x00 != bbptr->hx) {
+ if (bbptr->xmin > x) {
+ bbptr->xmin = x;
+ }
+ if (bbptr->xmax < x) {
+ bbptr->xmax = x;
+ }
+ }
+ else {
+ bbptr->xmin = bbptr->xmax = x;
+ bbptr->hx = 0x01;
+ }
+ }
+}
+
+
+
+void
+dk4bb32_add_y(dk4_bb32_t *bbptr, int32_t y)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) {
+ if (0x00 != bbptr->hy) {
+ if (bbptr->ymin > y) {
+ bbptr->ymin = y;
+ }
+ if (bbptr->ymax < y) {
+ bbptr->ymax = y;
+ }
+ }
+ else {
+ bbptr->ymin = bbptr->ymax = y;
+ bbptr->hy = 0x01;
+ }
+ }
+}
+
+
+
+void
+dk4bb32_add_point(dk4_bb32_t *bbptr, int32_t x, int32_t y)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ dk4bb32_add_x(bbptr, x);
+ dk4bb32_add_y(bbptr, y);
+}
+
+
+
+int
+dk4bb32_have_x(dk4_bb32_t const *bbptr)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { if (0x00 != bbptr->hx) { back = 1; } }
+ return back;
+}
+
+
+
+int
+dk4bb32_have_y(dk4_bb32_t const *bbptr)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { if (0x00 != bbptr->hy) { back = 1; } }
+ return back;
+}
+
+
+
+int32_t
+dk4bb32_get_x_min(dk4_bb32_t const *bbptr)
+{
+ int32_t back = (int32_t)0L;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { back = bbptr->xmin; }
+ return back;
+}
+
+
+
+int32_t
+dk4bb32_get_x_max(dk4_bb32_t const *bbptr)
+{
+ int32_t back = (int32_t)0L;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { back = bbptr->xmax; }
+ return back;
+}
+
+
+
+int32_t
+dk4bb32_get_y_min(dk4_bb32_t const *bbptr)
+{
+ int32_t back = (int32_t)0L;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { back = bbptr->ymin; }
+ return back;
+}
+
+
+
+int32_t
+dk4bb32_get_y_max(dk4_bb32_t const *bbptr)
+{
+ int32_t back = (int32_t)0L;
+#if DK4_USE_ASSERT
+ assert(NULL != bbptr);
+#endif
+ if (NULL != bbptr) { back = bbptr->ymax; }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bb32.h b/support/dktools/dk4bb32.h
new file mode 100644
index 0000000000..2fa79ebaa4
--- /dev/null
+++ b/support/dktools/dk4bb32.h
@@ -0,0 +1,157 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bb32.ctr
+*/
+
+#ifndef DK4BB32_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4BB32_H_INCLUDED 1
+
+
+#line 9 "dk4bb32.ctr"
+
+/** @file dk4bb32.h Bounding box for int32_t coordinates.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+
+
+/** Bounding box for int32_t coordinates.
+*/
+typedef struct {
+ int32_t xmin; /**< Minimum x value. */
+ int32_t xmax; /**< Maximum x value. */
+ int32_t ymin; /**< Minimum y value. */
+ int32_t ymax; /**< Maximum y value. */
+ unsigned char hx; /**< Flag: Have x values. */
+ unsigned char hy; /**< Flag: Have y values. */
+} dk4_bb32_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Initialize bounding box structure.
+ @param bbptr Structure to initialize.
+*/
+
+void
+dk4bb32_init(dk4_bb32_t *bbptr);
+
+
+/** Add x value to bounding box.
+ @param bbptr Structure to modify.
+ @param x Value to add.
+*/
+
+void
+dk4bb32_add_x(dk4_bb32_t *bbptr, int32_t x);
+
+
+/** Add y value to bounding box.
+ @param bbptr Structure to modify.
+ @param y Value to add.
+*/
+
+void
+dk4bb32_add_y(dk4_bb32_t *bbptr, int32_t y);
+
+
+/** Add x and y value of a point to bounding box.
+ @param bbptr Structure to modify.
+ @param x X value to add.
+ @param y Y value to add.
+*/
+
+void
+dk4bb32_add_point(dk4_bb32_t *bbptr, int32_t x, int32_t y);
+
+
+/** Check whether a bounding box contains x information.
+ @param bbptr Structure to check.
+ @return 1 if x information available, 0 otherwise.
+*/
+
+int
+dk4bb32_have_x(dk4_bb32_t const *bbptr);
+
+
+/** Check whether a bounding box contains y information.
+ @param bbptr Structure to check.
+ @return 1 if y information available, 0 otherwise.
+*/
+
+int
+dk4bb32_have_y(dk4_bb32_t const *bbptr);
+
+
+/** Get minimum x value from bounding box structure.
+ @param bbptr Structure to use.
+ @return Minimum x value if x information available, random value otherwise.
+*/
+
+int32_t
+dk4bb32_get_x_min(dk4_bb32_t const *bbptr);
+
+
+/** Get maximum x value from bounding box structure.
+ @param bbptr Structure to use.
+ @return Maximum x value if x information available, random value otherwise.
+*/
+
+int32_t
+dk4bb32_get_x_max(dk4_bb32_t const *bbptr);
+
+
+/** Get minimum y value from bounding box structure.
+ @param bbptr Structure to use.
+ @return Minimum y value if y information available, random value otherwise.
+*/
+
+int32_t
+dk4bb32_get_y_min(dk4_bb32_t const *bbptr);
+
+
+/** Get maximum y value from bounding box structure.
+ @param bbptr Structure to use.
+ @return Maximum y value if y information available, random value otherwise.
+*/
+
+int32_t
+dk4bb32_get_y_max(dk4_bb32_t const *bbptr);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4bf.c b/support/dktools/dk4bf.c
index 8fba829e7e..4146798621 100644
--- a/support/dktools/dk4bf.c
+++ b/support/dktools/dk4bf.c
@@ -1,44 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4bf.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bf.ctr
*/
/** @file dk4bf.c The dk4bf module.
*/
-#line 85 "dk4bf.ctr"
+#line 97 "dk4bf.ctr"
+
+#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4bf.h"
#include "dk4mem.h"
@@ -47,7 +33,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 93 "dk4bf.ctr"
+#line 113 "dk4bf.ctr"
@@ -64,6 +50,9 @@ dk4bf_open(size_t sz, dk4_er_t *erp)
{
dk4_bit_field_t *back = NULL;
size_t bsz;
+#if DK4_USE_ASSERT
+ assert(0 < sz);
+#endif
if (0 < sz) {
back = dk4mem_new(dk4_bit_field_t,1,erp);
if (NULL != back) {
@@ -92,6 +81,9 @@ dk4bf_set(dk4_bit_field_t *dptr, size_t bitno, int val, dk4_er_t *erp)
size_t bytei; /* Byte index */
size_t biti; /* Bit index */
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (bitno < dptr->s) {
bytei = bitno / 8;
@@ -114,11 +106,15 @@ dk4bf_set(dk4_bit_field_t *dptr, size_t bitno, int val, dk4_er_t *erp)
int
-dk4bf_get(int *dptr, dk4_bit_field_t *bfptr, size_t bitno, dk4_er_t *erp)
+dk4bf_get(int *dptr, dk4_bit_field_t const *bfptr, size_t bitno, dk4_er_t *erp)
{
size_t bytei; /* Byte index */
size_t biti; /* Bit index within byte */
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bfptr);
+#endif
if ((NULL != dptr) && (NULL != bfptr)) {
if (bitno < bfptr->s) {
bytei = bitno / 8;
@@ -143,6 +139,9 @@ dk4bf_get(int *dptr, dk4_bit_field_t *bfptr, size_t bitno, dk4_er_t *erp)
void
dk4bf_close(dk4_bit_field_t *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4mem_release(ptr->d);
dk4mem_free(ptr);
diff --git a/support/dktools/dk4bf.ctr b/support/dktools/dk4bf.ctr
index 917f76185e..d51df41ead 100644
--- a/support/dktools/dk4bf.ctr
+++ b/support/dktools/dk4bf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,20 @@ license = bsd
/** @file dk4bf.h Bit fields.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** Bit field structure.
@@ -66,7 +78,7 @@ dk4bf_set(dk4_bit_field_t *dptr, size_t bitno, int val, dk4_er_t *erp);
if dptr or bfptr is NULL or bitno is outside the bit field size.
*/
int
-dk4bf_get(int *dptr, dk4_bit_field_t *bfptr, size_t bitno, dk4_er_t *erp);
+dk4bf_get(int *dptr, dk4_bit_field_t const *bfptr, size_t bitno, dk4_er_t *erp);
/** Close bit field.
@param ptr Pointer to bit field previously opened using
@@ -83,6 +95,14 @@ dk4bf_close(dk4_bit_field_t *ptr);
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4bf.h"
#include "dk4mem.h"
@@ -106,6 +126,9 @@ dk4bf_open(size_t sz, dk4_er_t *erp)
{
dk4_bit_field_t *back = NULL;
size_t bsz;
+#if DK4_USE_ASSERT
+ assert(0 < sz);
+#endif
if (0 < sz) {
back = dk4mem_new(dk4_bit_field_t,1,erp);
if (NULL != back) {
@@ -134,6 +157,9 @@ dk4bf_set(dk4_bit_field_t *dptr, size_t bitno, int val, dk4_er_t *erp)
size_t bytei; /* Byte index */
size_t biti; /* Bit index */
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (bitno < dptr->s) {
bytei = bitno / 8;
@@ -156,11 +182,15 @@ dk4bf_set(dk4_bit_field_t *dptr, size_t bitno, int val, dk4_er_t *erp)
int
-dk4bf_get(int *dptr, dk4_bit_field_t *bfptr, size_t bitno, dk4_er_t *erp)
+dk4bf_get(int *dptr, dk4_bit_field_t const *bfptr, size_t bitno, dk4_er_t *erp)
{
size_t bytei; /* Byte index */
size_t biti; /* Bit index within byte */
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bfptr);
+#endif
if ((NULL != dptr) && (NULL != bfptr)) {
if (bitno < bfptr->s) {
bytei = bitno / 8;
@@ -185,6 +215,9 @@ dk4bf_get(int *dptr, dk4_bit_field_t *bfptr, size_t bitno, dk4_er_t *erp)
void
dk4bf_close(dk4_bit_field_t *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4mem_release(ptr->d);
dk4mem_free(ptr);
diff --git a/support/dktools/dk4bf.h b/support/dktools/dk4bf.h
index 4d96a8adfa..4847cb60a7 100644
--- a/support/dktools/dk4bf.h
+++ b/support/dktools/dk4bf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4bf.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bf.ctr
*/
#ifndef DK4BF_H_INCLUDED
@@ -43,8 +21,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4bf.h Bit fields.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** Bit field structure.
@@ -98,7 +88,7 @@ dk4bf_set(dk4_bit_field_t *dptr, size_t bitno, int val, dk4_er_t *erp);
if dptr or bfptr is NULL or bitno is outside the bit field size.
*/
int
-dk4bf_get(int *dptr, dk4_bit_field_t *bfptr, size_t bitno, dk4_er_t *erp);
+dk4bf_get(int *dptr, dk4_bit_field_t const *bfptr, size_t bitno, dk4_er_t *erp);
/** Close bit field.
@param ptr Pointer to bit field previously opened using
diff --git a/support/dktools/dk4bif.c b/support/dktools/dk4bif.c
new file mode 100644
index 0000000000..e151d48537
--- /dev/null
+++ b/support/dktools/dk4bif.c
@@ -0,0 +1,1315 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bif.ctr
+*/
+
+/** @file dk4bif.c The dk4bif module.
+*/
+
+
+#line 371 "dk4bif.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 409 "dk4bif.ctr"
+
+
+/** File name suffixes for bitmap image files.
+*/
+static const dkChar * const dk4bif_suffixes[] = {
+/* 0 */
+dkT(".png"),
+
+/* 1 */
+dkT(".jpg"),
+
+/* 2 */
+dkT(".jpeg"),
+
+/* 3 */
+dkT(".tif"),
+
+/* 4 */
+dkT(".tiff"),
+
+/* 5 */
+dkT(".pbm"),
+
+/* 6 */
+dkT(".pgm"),
+
+/* 7 */
+dkT(".ppm"),
+
+/* 8 */
+dkT(".pnm"),
+
+/* 9 */
+dkT(".pam"),
+
+NULL
+
+
+#line 426 "dk4bif.ctr"
+};
+
+
+/** Keywords used by the module.
+*/
+static const dkChar * const dk4bif_kw[] = {
+/* 0 */
+dkT("rb"),
+
+NULL
+
+
+#line 438 "dk4bif.ctr"
+};
+
+
+
+void
+dk4bif_frame_close(
+ dk4_bif_frame_t *frptr,
+ int imgtype
+)
+{
+
+
+#line 449 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != frptr);
+#endif
+ if (NULL != frptr) {
+ if (NULL != frptr->tsdata) {
+ switch (imgtype) {
+ case DK4_BIF_TYPE_PNG : {
+#if DK4_HAVE_PNG_H
+ dk4bifpng_nc_release_per_frame_data(frptr->tsdata);
+#else
+ dk4mem_release(frptr->tsdata);
+#endif
+ } break;
+ case DK4_BIF_TYPE_JPEG : {
+#if DK4_HAVE_JPEGLIB_H
+ dk4bifjpeg_nc_release_per_frame_data(frptr->tsdata, frptr);
+#else
+ dk4mem_release(frptr->tsdata);
+#endif
+ } break;
+ case DK4_BIF_TYPE_TIFF : {
+#if DK4_HAVE_TIFF_H
+ dk4biftiff_nc_release_per_frame_data(frptr->tsdata);
+#else
+ dk4mem_release(frptr->tsdata);
+#endif
+ } break;
+ case DK4_BIF_TYPE_NETPBM : {
+ dk4bifnetpbm_nc_release_per_frame_data(frptr->tsdata);
+ } break;
+ default : {
+ dk4mem_release(frptr->tsdata);
+ } break;
+ }
+ frptr->tsdata = NULL;
+ }
+ dk4mem_free(frptr);
+ }
+
+
+#line 488 "dk4bif.ctr"
+}
+
+
+
+void
+dk4bif_close(
+ dk4_bif_t *bif
+)
+{
+ dk4_bif_frame_t *frptr; /* Traverse all frames */
+
+
+#line 499 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if (NULL != bif) {
+ if (NULL != bif->s_frames) {
+ if (NULL != bif->i_frames) {
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ frptr = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL != frptr) {
+ dk4bif_frame_close(frptr, bif->imgtype);
+ }
+ } while(NULL != frptr);
+ dk4sto_it_close(bif->i_frames);
+ bif->i_frames = NULL;
+ }
+ dk4sto_close(bif->s_frames);
+ bif->s_frames = NULL;
+ }
+ bif->cf = NULL;
+ if (NULL != bif->tsdata) {
+ switch (bif->imgtype) {
+ case DK4_BIF_TYPE_PNG : {
+#if DK4_HAVE_PNG_H
+ dk4bifpng_nc_release_per_file_data(bif->tsdata);
+#else
+ dk4mem_release(bif->tsdata);
+#endif
+ } break;
+ case DK4_BIF_TYPE_JPEG : {
+#if 0
+/* No per-file data stored for JPEG file */
+#if DK4_HAVE_JPEGLIB_H
+ dk4bifjpeg_nc_release_per_file_data(bif->tsdata);
+#else
+ dk4mem_release(bif->tsdata);
+#endif
+#endif
+ } break;
+ case DK4_BIF_TYPE_TIFF : {
+#if 0
+/* No per-file data stored for TIFF */
+#if DK4_HAVE_TIFF_H
+ dk4biftiff_nc_release_per_file_data(bif->tsdata);
+#else
+ dk4mem_release(bif->tsdata);
+#endif
+#endif
+ } break;
+ case DK4_BIF_TYPE_NETPBM : {
+ /*
+ No per-file data stored for NetPBM.
+ */
+ } break;
+ default : {
+ dk4mem_release(bif->tsdata);
+ } break;
+ }
+ }
+ dk4mem_release(bif->filename);
+ bif->n_frames = 0;
+ bif->imgtype = 0;
+ dk4mem_free(bif);
+ }
+
+
+#line 564 "dk4bif.ctr"
+}
+
+
+
+int
+dk4bif_type_for_suffix(
+ dkChar const *fn
+)
+{
+ const dkChar *sptr; /* Pointer to dot of file name suffix */
+ int back = -1;
+
+
+#line 576 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL != fn) {
+ sptr = dk4path_get_suffix(fn, NULL);
+
+
+#line 582 "dk4bif.ctr"
+ if (NULL != sptr) {
+ switch (dk4str_array_index(dk4bif_suffixes, sptr, 0)) {
+ case 0 : {
+ back = DK4_BIF_TYPE_PNG;
+ } break;
+ case 1 : case 2 : {
+ back = DK4_BIF_TYPE_JPEG;
+ } break;
+ case 3 : case 4 : {
+ back = DK4_BIF_TYPE_TIFF;
+ } break;
+ case 5 : case 6 : case 7 : case 8 : case 9 : {
+ back = DK4_BIF_TYPE_NETPBM;
+ } break;
+ }
+ }
+ }
+
+
+#line 600 "dk4bif.ctr"
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bif_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_png_clobbered_t pngcp; /* Clobber protected variables */
+ dk4_bif_jpg_clobbered_t jpgcp; /* Clobber protected variables */
+ dk4_bif_t *back = NULL;
+
+
+#line 619 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ if (NULL == fipo) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (ty) {
+ case DK4_BIF_TYPE_PNG : {
+#if DK4_HAVE_PNG_H
+ pngcp.back = NULL;
+ pngcp.pfrpng = NULL;
+ pngcp.ok = 0;
+ back = dk4bifpng_nc_open_file(fipo, fn, honly, pcsctx, &pngcp, erp);
+#else
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+ } break;
+ case DK4_BIF_TYPE_JPEG : {
+#if DK4_HAVE_JPEGLIB_H
+ jpgcp.st = 0;
+ jpgcp.ok = 0;
+ jpgcp.back = NULL;
+ back = dk4bifjpeg_nc_open_file(fipo,fn,honly,pcsctx,&jpgcp,erp);
+#else
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+ } break;
+ case DK4_BIF_TYPE_NETPBM : {
+
+
+#line 649 "dk4bif.ctr"
+ back = dk4bifnetpbm_nc_open_file(fipo, fn, honly, pcsctx, erp);
+
+
+#line 651 "dk4bif.ctr"
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } break;
+ }
+ finished:
+
+
+#line 658 "dk4bif.ctr"
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bif_open_type(
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ FILE *inputfile; /* Input file */
+ dk4_bif_t *back = NULL;
+ int tests = DK4_FOPEN_SC_IS_REGULAR; /* Tests for fopen */
+
+
+#line 676 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL == fn) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_BIF_TYPE_MIN > ty) || (DK4_BIF_TYPE_MAX < ty)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (ty) {
+ case DK4_BIF_TYPE_PNG :
+ case DK4_BIF_TYPE_JPEG :
+ case DK4_BIF_TYPE_NETPBM : {
+ inputfile = dk4fopen(fn, dk4bif_kw[0], tests, erp);
+ if (NULL != inputfile) {
+ back = dk4bif_open_file(inputfile, fn, ty, honly, pcsctx, erp);
+ fclose(inputfile);
+ }
+ } break;
+ case DK4_BIF_TYPE_TIFF : {
+#if DK4_HAVE_TIFF_H
+ back = dk4biftiff_nc_open_type(fn, pcsctx, erp);
+#else
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+ } break;
+ }
+ finished:
+
+
+#line 707 "dk4bif.ctr"
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bif_open(
+ dkChar const *fn,
+ int hdronly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *back = NULL;
+ int tp; /* Bitmap image file type */
+
+
+#line 723 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL != fn) {
+ tp = dk4bif_type_for_suffix(fn);
+ if ((DK4_BIF_TYPE_MIN <= tp) && (DK4_BIF_TYPE_MAX >= tp)) {
+ back = dk4bif_open_type(fn, tp, hdronly, pcsctx, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 739 "dk4bif.ctr"
+ return back;
+}
+
+
+
+size_t
+dk4bif_get_number_of_frames(
+ dk4_bif_t const *bif
+)
+{
+ size_t back = 0;
+
+
+#line 751 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if (NULL != bif) {
+ back = bif->n_frames;
+ }
+
+
+#line 758 "dk4bif.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_set_current_frame(
+ dk4_bif_t *bif,
+ size_t fno
+)
+{
+ int back = 0;
+
+
+#line 771 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if ((NULL == bif->s_frames) || (NULL == bif->i_frames)) {
+ goto finished;
+ }
+ /* Retrieve frames from storage iterator until found
+ */
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ bif->cf = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ } while(0 < fno--);
+ if (NULL != bif->cf) { back = 1; }
+
+ /* Return
+ */
+ finished:
+
+
+#line 798 "dk4bif.ctr"
+ return back;
+}
+
+
+
+dk4_px_bit_depth_t
+dk4bif_get_original_bit_depth(
+ dk4_bif_t const *bif
+)
+{
+ dk4_px_bit_depth_t back = 0;
+
+
+#line 810 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve bit depth from current frame
+ */
+ back = (bif->cf)->l_bdepth;
+
+ /* Return
+ */
+ finished:
+
+
+#line 830 "dk4bif.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_get_color_space(
+ dk4_bif_t const *bif
+)
+{
+ int back = -1;
+
+
+#line 842 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve library color space from current frame
+ */
+ back = (bif->cf)->l_cs;
+
+ /* Return
+ */
+ finished:
+
+
+#line 862 "dk4bif.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_get_file_color_space(
+ dk4_bif_t const *bif
+)
+{
+ int back = -1;
+
+
+#line 874 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve file color space from current frame
+ */
+ back = (bif->cf)->f_cs;
+
+ /* Return
+ */
+ finished:
+
+
+#line 894 "dk4bif.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_set_output_bit_depth(
+ dk4_bif_t *bif,
+ dk4_px_bit_depth_t bd
+)
+{
+ dk4_bif_frame_t *fptr; /* Traverse all frames in storage */
+ int back = 0;
+
+
+#line 908 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if ((NULL == bif->s_frames) || (NULL == bif->i_frames)) {
+ goto finished;
+ }
+ if (0 != bif->hdronly) {
+ goto finished;
+ }
+ /* Traverse all frames, set required bit depth and resampler in frame
+ */
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ fptr = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL != fptr) {
+
+#line 929 "dk4bif.ctr"
+ if (0 != fptr->fmres) {
+ dk4pxres_setup_from_maxval(&(fptr->resampler), fptr->fmrmv, bd);
+ }
+ else {
+ dk4pxres_setup(&(fptr->resampler), fptr->l_bdepth, bd);
+ }
+ fptr->r_bdepth = bd;
+
+
+#line 937 "dk4bif.ctr"
+
+
+#line 938 "dk4bif.ctr"
+
+
+#line 939 "dk4bif.ctr"
+ dk4mem_cpy(
+ &(fptr->bg[0]), &(fptr->bglbd[0]), 4*sizeof(dk4_px_t), NULL
+ );
+ if ((fptr->l_bdepth != bd) || (0 != fptr->fmres)) {
+ dk4pxres_multiple(&(fptr->bg[0]), 4, &(fptr->resampler));
+ }
+
+
+#line 946 "dk4bif.ctr"
+
+
+#line 947 "dk4bif.ctr"
+
+
+#line 948 "dk4bif.ctr"
+ }
+ } while (NULL != fptr);
+ /*
+ Indicate success
+ */
+ back = 1;
+
+ /* Return
+ */
+ finished:
+
+
+#line 959 "dk4bif.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_set_background(
+ dk4_bif_t *bif,
+ dk4_px_t const *bg,
+ size_t szbg,
+ dk4_px_bit_depth_t bd,
+ int force
+)
+{
+ dk4_px_resample_t bgres; /* Resample bg data to required bit depth */
+ dk4_bif_frame_t *fptr; /* Traverse all frames */
+ size_t i; /* Current bg component index */
+ int back = 0;
+
+
+#line 978 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if ((NULL == bif) || (NULL == bg)) {
+ goto finished;
+ }
+ if ((NULL == bif->s_frames) || (NULL == bif->i_frames)) {
+ goto finished;
+ }
+ if (0 != bif->hdronly) {
+ goto finished;
+ }
+ /* Correct number of background arguments
+ */
+ if (szbg > 4) {
+ szbg = 4;
+ }
+ /* Traverse all frames, set background in the frames bit depth
+ */
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ fptr = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL != fptr) {
+ if ((0 != force) || (0 == (bif->cf)->hbg)) {
+ if (0 != fptr->fmres) {
+ dk4pxres_setup_to_maxval(&bgres, bd, fptr->fmrmv);
+ }
+ else {
+ dk4pxres_setup(&bgres, bd, (fptr->l_bdepth));
+ }
+ for (i = 0; i < szbg; i++) {
+ fptr->bg[i] = dk4pxres_get(&bgres, bg[i]);
+ fptr->bglbd[i] = bg[i];
+ }
+ }
+ }
+ } while (NULL != fptr);
+ /*
+ Indicate success
+ */
+ back = 1;
+
+ /* Return
+ */
+ finished:
+
+
+#line 1027 "dk4bif.ctr"
+ return back;
+}
+
+
+
+double
+dk4bif_get_xres(
+ dk4_bif_t const *bif
+)
+{
+ double back = -1.0;
+
+
+#line 1039 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve x resolution from current frame
+ */
+ back = (bif->cf)->res_x;
+
+ /* Return
+ */
+ finished:
+
+
+#line 1056 "dk4bif.ctr"
+ return back;
+}
+
+
+
+double
+dk4bif_get_yres(
+ dk4_bif_t const *bif
+)
+{
+ double back = -1.0;
+
+
+#line 1068 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve y resolution from current frame
+ */
+ back = (bif->cf)->res_y;
+
+ /* Return
+ */
+ finished:
+
+
+#line 1088 "dk4bif.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_set_res(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 1103 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if ((NULL != bif) && (0.0 < xres) && (0.0 < yres)) {
+ if (NULL != bif->cf) {
+
+#line 1108 "dk4bif.ctr"
+ bif->cf->res_x = xres;
+ bif->cf->res_y = yres;
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1120 "dk4bif.ctr"
+ return back;
+}
+
+
+
+dk4_bif_dim_t
+dk4bif_get_width(
+ dk4_bif_t const *bif
+)
+{
+ dk4_bif_dim_t back = -1L;
+
+
+#line 1132 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve width of current frame
+ */
+ back = (bif->cf)->dim_x;
+
+ /* Return
+ */
+ finished:
+
+
+#line 1152 "dk4bif.ctr"
+ return back;
+}
+
+
+
+dk4_bif_dim_t
+dk4bif_get_height(
+ dk4_bif_t const *bif
+)
+{
+ dk4_bif_dim_t back = -1L;
+
+
+#line 1164 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve width from current frame
+ */
+ back = (bif->cf)->dim_y;
+
+ /* Return
+ */
+ finished:
+
+
+#line 1184 "dk4bif.ctr"
+ return back;
+}
+
+
+
+const
+dk4_cs_conv_ctx_t *
+dk4bif_get_cs_conv_ctx(
+ dk4_bif_t const *bif
+)
+{
+ const dk4_cs_conv_ctx_t *back = NULL;
+
+
+#line 1197 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ /* Retrieve address of color space conversion context
+ */
+ back = &(bif->cs_ctx);
+
+ /* Return
+ */
+ finished:
+
+
+#line 1214 "dk4bif.ctr"
+ return back;
+}
+
+
+
+void
+dk4bif_set_cs_conv_ctx(
+ dk4_bif_t *bif,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+
+
+#line 1226 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if ((NULL != bif) && (NULL != pctx)) {
+ DK4_MEMCPY(&(bif->cs_ctx), pctx, sizeof(dk4_cs_conv_ctx_t));
+ }
+
+
+#line 1233 "dk4bif.ctr"
+}
+
+
+
+int
+dk4bif_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ int back = 0;
+
+
+#line 1248 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
+ switch (bif->imgtype) {
+ case DK4_BIF_TYPE_PNG : {
+#if DK4_HAVE_PNG_H
+ back = dk4bifpng_nc_get_original_pixel(dptr, bif, rowno, colno);
+#endif
+ } break;
+ case DK4_BIF_TYPE_JPEG : {
+#if DK4_HAVE_JPEGLIB_H
+ back = dk4bifjpeg_nc_get_original_pixel(
+ dptr, szdptr, bif, rowno, colno
+ );
+#endif
+ } break;
+ case DK4_BIF_TYPE_TIFF : {
+#if DK4_HAVE_TIFF_H
+ back = dk4biftiff_nc_get_original_pixel(dptr, bif, rowno, colno);
+#endif
+ } break;
+ case DK4_BIF_TYPE_NETPBM : {
+ back = dk4bifnetpbm_nc_get_original_pixel(dptr, bif, rowno, colno);
+ } break;
+ /* ##### FURTHER IMAGE TYPES HERE */
+ }
+
+
+#line 1277 "dk4bif.ctr"
+ return back;
+}
+
+
+
+#if TRACE_DEBUG
+static
+void
+show_pixel_data(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ int cs
+)
+{
+ size_t i; /* Index of current component to process */
+ size_t max; /* Number of components in color space */
+
+ max = dk4cs_color_space_size(cs);
+ if (max > szdptr) { max = szdptr; }
+ for (i = 0; i < max; i++) {
+
+
+#line 1298 "dk4bif.ctr"
+ }
+}
+#endif
+
+
+
+int
+dk4bif_nc_get_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno,
+ int cs
+)
+{
+ dk4_px_t tmp[4]; /* Temporary pixel data */
+ size_t sztmp = DK4_SIZEOF(tmp,dk4_px_t);
+ int back = 0;
+
+
+#line 1318 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
+ if ((bif->cf)->l_cs == cs) {
+
+#line 1324 "dk4bif.ctr"
+ /*
+ Same color space
+ */
+ back = dk4bif_nc_get_original_pixel(dptr, szdptr, bif, rowno, colno);
+
+
+#line 1329 "dk4bif.ctr"
+ if (0 != back) {
+ if (
+ ((bif->cf)->l_bdepth != (bif->cf)->r_bdepth)
+ || (0 != bif->cf->fmres)
+ ) {
+ /*
+ Bit depth correction required
+ */
+
+
+#line 1338 "dk4bif.ctr"
+ dk4pxres_multiple(
+ dptr, dk4cs_color_space_size(cs), &((bif->cf)->resampler)
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1345 "dk4bif.ctr"
+ }
+#endif
+ }
+ else {
+
+#line 1349 "dk4bif.ctr"
+ /*
+ Color space conversion required
+ */
+ back = dk4bif_nc_get_original_pixel(tmp, sztmp, bif, rowno, colno);
+
+
+#line 1354 "dk4bif.ctr"
+ if (0 != back) {
+ if (
+ ((bif->cf)->l_bdepth != (bif->cf)->r_bdepth)
+ || (0 != bif->cf->fmres)
+ )
+ {
+
+
+#line 1361 "dk4bif.ctr"
+ /*
+ Bit depth correction required
+ */
+ if ((bif->cf)->l_bdepth > (bif->cf)->r_bdepth) {
+
+
+#line 1366 "dk4bif.ctr"
+ /*
+ Color space conversion first, bit depth later
+ */
+ dk4cs_nc_px_convert(
+ dptr, cs, tmp, (bif->cf)->l_cs, &((bif->cf)->bglbd[0]),
+ (dk4_px_t)((bif->cf)->resampler.denom), &(bif->cs_ctx)
+ );
+ dk4pxres_multiple(
+ dptr, dk4cs_color_space_size(cs),
+ &((bif->cf)->resampler)
+ );
+ }
+ else {
+
+
+#line 1380 "dk4bif.ctr"
+ /*
+ Bit depth conversion first, color space later
+ */
+ dk4pxres_multiple(
+ tmp, dk4cs_color_space_size((bif->cf)->l_cs),
+ &((bif->cf)->resampler)
+ );
+ dk4cs_nc_px_convert(
+ dptr, cs, tmp, (bif->cf)->l_cs, &((bif->cf)->bg[0]),
+ (dk4_px_t)((bif->cf)->resampler.nom), &(bif->cs_ctx)
+ );
+ }
+ }
+ else {
+
+#line 1394 "dk4bif.ctr"
+ /* No bit depth correction, just change color space
+ */
+ dk4cs_nc_px_convert(
+ dptr, cs, tmp, (bif->cf)->l_cs, &((bif->cf)->bg[0]),
+ (dk4_px_t)((bif->cf)->resampler.denom), &(bif->cs_ctx)
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1404 "dk4bif.ctr"
+ }
+#endif
+ }
+
+
+#line 1408 "dk4bif.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_get_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno,
+ int cs
+)
+{
+ int back = 0;
+
+
+#line 1425 "dk4bif.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
+ /*
+ Check arguments
+ */
+ if ((NULL == dptr) || (NULL == bif)) {
+
+#line 1434 "dk4bif.ctr"
+ goto finished;
+ }
+ if (0 != bif->hdronly) {
+
+#line 1437 "dk4bif.ctr"
+ goto finished;
+ }
+ if (0 == dk4cs_check(cs)) {
+
+#line 1440 "dk4bif.ctr"
+ goto finished;
+ }
+ if (szdptr < dk4cs_color_space_size(cs)) {
+
+#line 1443 "dk4bif.ctr"
+ goto finished;
+ }
+ if (((dk4_bif_dim_t)0L > rowno) || ((bif->cf)->dim_y <= rowno)) {
+
+#line 1446 "dk4bif.ctr"
+ goto finished;
+ }
+ if (((dk4_bif_dim_t)0L > colno) || ((bif->cf)->dim_x <= colno)) {
+
+#line 1449 "dk4bif.ctr"
+ goto finished;
+ }
+ back = dk4bif_nc_get_pixel(dptr, szdptr, bif, rowno, colno, cs);
+
+
+#line 1453 "dk4bif.ctr"
+
+ /* Return, fill default value 0 if there was any problem
+ */
+ finished:
+ if (0 == back) {
+ if (NULL != dptr) {
+
+#line 1459 "dk4bif.ctr"
+ while(0 < szdptr--) {
+ *(dptr++) = 0;
+ }
+ }
+ }
+
+
+#line 1465 "dk4bif.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_get_image_type(
+ dk4_bif_t const *bif
+)
+{
+ int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if (NULL != bif) {
+ back = bif->imgtype;
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bif.ctr b/support/dktools/dk4bif.ctr
new file mode 100644
index 0000000000..09e2d4bbc6
--- /dev/null
+++ b/support/dktools/dk4bif.ctr
@@ -0,0 +1,1488 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4bif.h Bitmap image files.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bifty.h"
+#else
+#include <dktools-4/dk4bifty.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Find bitmap image file type for file name.
+ @param fn File name to check.
+ @return Non-negative dk4_bif_type_t value on success,
+ -1 on error (NULL file name or file name suffix does not indicate
+ a graphics type the function can handle).
+*/
+
+int
+dk4bif_type_for_suffix(
+ dkChar const *fn
+);
+
+
+/** Open bitmap image file.
+ @param fn File name containing the bitmap image.
+ @param hdronly Flag: Read header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL,
+ - DK4_E_NOT_FOUND<br>
+ if the file name does not contain a suffix or the suffix does
+ not indicate a bitmap image file type the function can handle,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation failed,
+ - DK4_E_SYNTAX<br>
+ if the file contents is incorrect (not matching the specified file
+ type),
+ - DK4_E_READ_FAILED<br>
+ if the function failed to read from file fn.
+*/
+
+dk4_bif_t *
+dk4bif_open(
+ dkChar const *fn,
+ int hdronly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/** Open bitmap image file.
+ @param fn File name containing the bitmap image.
+ @param ty Image file type (PNG, JPEG or TIFF).
+ @param honly Flag: Read header information only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL or an unknown bitmap type is requested,
+ - DK4_E_READ_FAILED<br>
+ if the function failed to read from file fn,
+ - DK4_E_NOT_SUPPORTED<br>
+ if the operation is not supported (i.e. compiled without a
+ required library).
+*/
+
+dk4_bif_t *
+dk4bif_open_type(
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/** Open bitmap image file.
+ @param fipo File, opened for binary reading.
+ @param fn File name containing the bitmap image.
+ @param ty Image file type (PNG, JPEG or TIFF).
+ @param honly Flag: Read image header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fipo or fn is NULL,
+ - DK4_E_NOT_SUPPORTED<br>
+ if the operation is not supported (i.e. compiled without a
+ required library).
+*/
+
+dk4_bif_t *
+dk4bif_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/** Close bitmap image file and release resources.
+ @param bif Bitmap image file to close.
+*/
+
+void
+dk4bif_close(
+ dk4_bif_t *bif
+);
+
+
+/** Find number of frames in bitmap image file.
+ @param bif Bitmap image file to query.
+ @return Positive value on success, 0 on error.
+*/
+
+size_t
+dk4bif_get_number_of_frames(
+ dk4_bif_t const *bif
+);
+
+
+/** Set current frame in a bitmap image file.
+ @param bif Bitmap image file.
+ @param fno Index of new current frame (0 for first frame).
+ @return 1 on success, 0 on error (out of range).
+*/
+
+int
+dk4bif_set_current_frame(
+ dk4_bif_t *bif,
+ size_t fno
+);
+
+
+/** Retrieve low level bit depth of current frame bitmap image file.
+ @param bif Bitmap image file
+ @return Positive value on success, 0 on error.
+*/
+
+dk4_px_bit_depth_t
+dk4bif_get_original_bit_depth(
+ dk4_bif_t const *bif
+);
+
+
+/** Retrieve color space of current frame returned from low-level library.
+ @param bif Bitmap image file.
+ @return Non-negative dk4_bif_cs_t value on success, -1 on error.
+*/
+
+int
+dk4bif_get_color_space(
+ dk4_bif_t const *bif
+);
+
+
+/** Retrieve color space of current frame contained in the file.
+ @param bif Bitmap image file.
+ @return Non-negative dk4_bif_cs_t value on success, -1 on error.
+*/
+
+int
+dk4bif_get_file_color_space(
+ dk4_bif_t const *bif
+);
+
+
+/** Set required output bit depth for pixel data to retrieve for
+ all frames.
+ @param bif Bitmap image file.
+ @param bd Required output bit depth.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_set_output_bit_depth(
+ dk4_bif_t *bif,
+ dk4_px_bit_depth_t bd
+);
+
+
+/** Set default background or enforced background for bitmap image file
+ for all frames.
+ @param bif Bitmap image file.
+ @param bg Array containing background values.
+ @param szbg Size of bg array (number of elements).
+ @param bd Bit depth used in the bg array.
+ @param force Flag: Enforce this background. Without this flag the
+ background information from here is used only if no
+ background information was found in the file.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_set_background(
+ dk4_bif_t *bif,
+ dk4_px_t const *bg,
+ size_t szbg,
+ dk4_px_bit_depth_t bd,
+ int force
+);
+
+
+/** Get image type.
+ @param bif Bitmap image file.
+ @return Non-negative image type on success, negative value on error.
+*/
+
+int
+dk4bif_get_image_type(
+ dk4_bif_t const *bif
+);
+
+
+/** Retrieve data for one pixel in the required output bit depth
+ and color space.
+ @param dptr Address of destination array, must be large enough.
+ @param szdptr Size of dptr array (number of elements).
+ @param bif Bitmap image file.
+ @param rowno Row number (0 for top row).
+ @param colno Column number (0 for left column).
+ @param cs Required color space.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_get_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno,
+ int cs
+);
+
+
+/** Get the current frames x resolution in dpi.
+ @param bif Bitmap image file.
+ @return Positive number on success, negative value on error or if
+ not found.
+*/
+
+double
+dk4bif_get_xres(
+ dk4_bif_t const *bif
+);
+
+
+/** Get the current frames y resolution in dpi.
+ @param bif Bitmap image file.
+ @return Positive number on success, negative value on error or if
+ not found.
+*/
+
+double
+dk4bif_get_yres(
+ dk4_bif_t const *bif
+);
+
+
+/** Set resolution explicitly.
+ @param bif Bitmap image file.
+ @param xres X resolution, must be positive.
+ @param yres Y resolution, must be positive.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error
+*/
+
+int
+dk4bif_set_res(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_er_t *erp
+);
+
+/** Get current frame width.
+ @param bif Bitmap image file.
+ @return Positive number on success, negative value on error.
+*/
+
+dk4_bif_dim_t
+dk4bif_get_width(
+ dk4_bif_t const *bif
+);
+
+
+/** Get current frame height.
+ @param bif Bitmap image file.
+ @return Positive number on success, negative value on error.
+*/
+
+dk4_bif_dim_t
+dk4bif_get_height(
+ dk4_bif_t const *bif
+);
+
+
+/** Get color space conversion context for bitmap image.
+ @param bif Bitmap image file.
+ @return Valid pointer on success, NULL on error.
+*/
+
+const
+dk4_cs_conv_ctx_t *
+dk4bif_get_cs_conv_ctx(
+ dk4_bif_t const *bif
+);
+
+
+/** Set color space conversion context for bitmap image.
+ @param bif Bitmap image file.
+ @param pctx Color space conversion context to use.
+*/
+
+void
+dk4bif_set_cs_conv_ctx(
+ dk4_bif_t *bif,
+ dk4_cs_conv_ctx_t const *pctx
+);
+
+
+/** Close a bitmap image frame, release ressources.
+ @param frptr Frame to close.
+ @param imgtype Bitmap image file type.
+*/
+
+void
+dk4bif_frame_close(
+ dk4_bif_frame_t *frptr,
+ int imgtype
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+/** File name suffixes for bitmap image files.
+*/
+static const dkChar * const dk4bif_suffixes[] = {
+$!string-table macro=dkT
+.png
+.jpg
+.jpeg
+.tif
+.tiff
+.pbm
+.pgm
+.ppm
+.pnm
+.pam
+$!end
+};
+
+
+/** Keywords used by the module.
+*/
+static const dkChar * const dk4bif_kw[] = {
+$!string-table macro=dkT
+#
+# File open mode: read binary
+#
+rb
+$!end
+};
+
+
+
+void
+dk4bif_frame_close(
+ dk4_bif_frame_t *frptr,
+ int imgtype
+)
+{
+ $? "+ dk4bif_frame_close frptr=%d", TR_IPTR(frptr)
+#if DK4_USE_ASSERT
+ assert(NULL != frptr);
+#endif
+ if (NULL != frptr) {
+ if (NULL != frptr->tsdata) {
+ switch (imgtype) {
+ case DK4_BIF_TYPE_PNG : {
+#if DK4_HAVE_PNG_H
+ dk4bifpng_nc_release_per_frame_data(frptr->tsdata);
+#else
+ dk4mem_release(frptr->tsdata);
+#endif
+ } break;
+ case DK4_BIF_TYPE_JPEG : {
+#if DK4_HAVE_JPEGLIB_H
+ dk4bifjpeg_nc_release_per_frame_data(frptr->tsdata, frptr);
+#else
+ dk4mem_release(frptr->tsdata);
+#endif
+ } break;
+ case DK4_BIF_TYPE_TIFF : {
+#if DK4_HAVE_TIFF_H
+ dk4biftiff_nc_release_per_frame_data(frptr->tsdata);
+#else
+ dk4mem_release(frptr->tsdata);
+#endif
+ } break;
+ case DK4_BIF_TYPE_NETPBM : {
+ dk4bifnetpbm_nc_release_per_frame_data(frptr->tsdata);
+ } break;
+ default : {
+ dk4mem_release(frptr->tsdata);
+ } break;
+ }
+ frptr->tsdata = NULL;
+ }
+ dk4mem_free(frptr);
+ }
+ $? "- dk4bif_frame_close"
+}
+
+
+
+void
+dk4bif_close(
+ dk4_bif_t *bif
+)
+{
+ dk4_bif_frame_t *frptr; /* Traverse all frames */
+ $? "+ dk4bif_close ptr=%d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if (NULL != bif) {
+ if (NULL != bif->s_frames) {
+ if (NULL != bif->i_frames) {
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ frptr = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL != frptr) {
+ dk4bif_frame_close(frptr, bif->imgtype);
+ }
+ } while(NULL != frptr);
+ dk4sto_it_close(bif->i_frames);
+ bif->i_frames = NULL;
+ }
+ dk4sto_close(bif->s_frames);
+ bif->s_frames = NULL;
+ }
+ bif->cf = NULL;
+ if (NULL != bif->tsdata) {
+ switch (bif->imgtype) {
+ case DK4_BIF_TYPE_PNG : {
+#if DK4_HAVE_PNG_H
+ dk4bifpng_nc_release_per_file_data(bif->tsdata);
+#else
+ dk4mem_release(bif->tsdata);
+#endif
+ } break;
+ case DK4_BIF_TYPE_JPEG : {
+#if 0
+/* No per-file data stored for JPEG file */
+#if DK4_HAVE_JPEGLIB_H
+ dk4bifjpeg_nc_release_per_file_data(bif->tsdata);
+#else
+ dk4mem_release(bif->tsdata);
+#endif
+#endif
+ } break;
+ case DK4_BIF_TYPE_TIFF : {
+#if 0
+/* No per-file data stored for TIFF */
+#if DK4_HAVE_TIFF_H
+ dk4biftiff_nc_release_per_file_data(bif->tsdata);
+#else
+ dk4mem_release(bif->tsdata);
+#endif
+#endif
+ } break;
+ case DK4_BIF_TYPE_NETPBM : {
+ /*
+ No per-file data stored for NetPBM.
+ */
+ } break;
+ default : {
+ dk4mem_release(bif->tsdata);
+ } break;
+ }
+ }
+ dk4mem_release(bif->filename);
+ bif->n_frames = 0;
+ bif->imgtype = 0;
+ dk4mem_free(bif);
+ }
+ $? "- dk4bif_close"
+}
+
+
+
+int
+dk4bif_type_for_suffix(
+ dkChar const *fn
+)
+{
+ const dkChar *sptr; /* Pointer to dot of file name suffix */
+ int back = -1;
+ $? "+ dk4bif_type_for_suffix \"%!ds\"", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL != fn) {
+ sptr = dk4path_get_suffix(fn, NULL);
+ $? ". sptr = \"%!ds\"", TR_STR(sptr)
+ if (NULL != sptr) {
+ switch (dk4str_array_index(dk4bif_suffixes, sptr, 0)) {
+ case 0 : {
+ back = DK4_BIF_TYPE_PNG;
+ } break;
+ case 1 : case 2 : {
+ back = DK4_BIF_TYPE_JPEG;
+ } break;
+ case 3 : case 4 : {
+ back = DK4_BIF_TYPE_TIFF;
+ } break;
+ case 5 : case 6 : case 7 : case 8 : case 9 : {
+ back = DK4_BIF_TYPE_NETPBM;
+ } break;
+ }
+ }
+ }
+ $? "- dk4bif_type_for_suffix %d", back
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bif_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_png_clobbered_t pngcp; /* Clobber protected variables */
+ dk4_bif_jpg_clobbered_t jpgcp; /* Clobber protected variables */
+ dk4_bif_t *back = NULL;
+ $? "+ dk4bif_open_file ptr=%d \"%!ds\"", TR_IPTR(fipo), TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ if (NULL == fipo) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (ty) {
+ case DK4_BIF_TYPE_PNG : {
+#if DK4_HAVE_PNG_H
+ pngcp.back = NULL;
+ pngcp.pfrpng = NULL;
+ pngcp.ok = 0;
+ back = dk4bifpng_nc_open_file(fipo, fn, honly, pcsctx, &pngcp, erp);
+#else
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+ } break;
+ case DK4_BIF_TYPE_JPEG : {
+#if DK4_HAVE_JPEGLIB_H
+ jpgcp.st = 0;
+ jpgcp.ok = 0;
+ jpgcp.back = NULL;
+ back = dk4bifjpeg_nc_open_file(fipo,fn,honly,pcsctx,&jpgcp,erp);
+#else
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+ } break;
+ case DK4_BIF_TYPE_NETPBM : {
+ $? ". before dk4bifnetpbm_nc_open_file honly=%d", honly
+ back = dk4bifnetpbm_nc_open_file(fipo, fn, honly, pcsctx, erp);
+ $? ". after dk4bifnetpbm_nc_open_file"
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } break;
+ }
+ finished:
+ $? "- dk4bif_open_file %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bif_open_type(
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ FILE *inputfile; /* Input file */
+ dk4_bif_t *back = NULL;
+ int tests = DK4_FOPEN_SC_IS_REGULAR; /* Tests for fopen */
+ $? "+ dk4bif_open_type \"%!ds\"", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL == fn) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_BIF_TYPE_MIN > ty) || (DK4_BIF_TYPE_MAX < ty)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (ty) {
+ case DK4_BIF_TYPE_PNG :
+ case DK4_BIF_TYPE_JPEG :
+ case DK4_BIF_TYPE_NETPBM : {
+ inputfile = dk4fopen(fn, dk4bif_kw[0], tests, erp);
+ if (NULL != inputfile) {
+ back = dk4bif_open_file(inputfile, fn, ty, honly, pcsctx, erp);
+ fclose(inputfile);
+ }
+ } break;
+ case DK4_BIF_TYPE_TIFF : {
+#if DK4_HAVE_TIFF_H
+ back = dk4biftiff_nc_open_type(fn, pcsctx, erp);
+#else
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+ } break;
+ }
+ finished:
+ $? "- dk4bif_open_type %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bif_open(
+ dkChar const *fn,
+ int hdronly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *back = NULL;
+ int tp; /* Bitmap image file type */
+ $? "+ dk4bif_open \"%!ds\"", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL != fn) {
+ tp = dk4bif_type_for_suffix(fn);
+ if ((DK4_BIF_TYPE_MIN <= tp) && (DK4_BIF_TYPE_MAX >= tp)) {
+ back = dk4bif_open_type(fn, tp, hdronly, pcsctx, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4bif_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+size_t
+dk4bif_get_number_of_frames(
+ dk4_bif_t const *bif
+)
+{
+ size_t back = 0;
+ $? "+ dk4bif_get_number_of_frames %d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if (NULL != bif) {
+ back = bif->n_frames;
+ }
+ $? "- dk4bif_get_number_of_frames %lu", (unsigned long)back
+ return back;
+}
+
+
+
+int
+dk4bif_set_current_frame(
+ dk4_bif_t *bif,
+ size_t fno
+)
+{
+ int back = 0;
+ $? "+ dk4bif_set_current_frame ptr=%d frame=%lu", TR_IPTR(bif), (unsigned long)fno
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if ((NULL == bif->s_frames) || (NULL == bif->i_frames)) {
+ goto finished;
+ }
+ /* Retrieve frames from storage iterator until found
+ */
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ bif->cf = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ } while(0 < fno--);
+ if (NULL != bif->cf) { back = 1; }
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_set_current_frame %d", back
+ return back;
+}
+
+
+
+dk4_px_bit_depth_t
+dk4bif_get_original_bit_depth(
+ dk4_bif_t const *bif
+)
+{
+ dk4_px_bit_depth_t back = 0;
+ $? "+ dk4_px_bit_depth_t ptr=%d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve bit depth from current frame
+ */
+ back = (bif->cf)->l_bdepth;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4_px_bit_depth_t %u", (unsigned)back
+ return back;
+}
+
+
+
+int
+dk4bif_get_color_space(
+ dk4_bif_t const *bif
+)
+{
+ int back = -1;
+ $? "+ dk4bif_get_color_space ptr=%d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve library color space from current frame
+ */
+ back = (bif->cf)->l_cs;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_get_color_space %d", back
+ return back;
+}
+
+
+
+int
+dk4bif_get_file_color_space(
+ dk4_bif_t const *bif
+)
+{
+ int back = -1;
+ $? "+ dk4bif_get_file_color_space ptr=%d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve file color space from current frame
+ */
+ back = (bif->cf)->f_cs;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_get_file_color_space %d", back
+ return back;
+}
+
+
+
+int
+dk4bif_set_output_bit_depth(
+ dk4_bif_t *bif,
+ dk4_px_bit_depth_t bd
+)
+{
+ dk4_bif_frame_t *fptr; /* Traverse all frames in storage */
+ int back = 0;
+ $? "+ dk4bif_set_output_bit_depth ptr=%d bd=%u", TR_IPTR(bif), (unsigned)bd
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if ((NULL == bif->s_frames) || (NULL == bif->i_frames)) {
+ goto finished;
+ }
+ if (0 != bif->hdronly) {
+ goto finished;
+ }
+ /* Traverse all frames, set required bit depth and resampler in frame
+ */
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ fptr = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL != fptr) { $? ". set bit depth for frame"
+ if (0 != fptr->fmres) {
+ dk4pxres_setup_from_maxval(&(fptr->resampler), fptr->fmrmv, bd);
+ }
+ else {
+ dk4pxres_setup(&(fptr->resampler), fptr->l_bdepth, bd);
+ }
+ fptr->r_bdepth = bd;
+ $? ". bglbd[0]=%u", (unsigned)(fptr->bglbd[0])
+ $? ". bglbd[1]=%u", (unsigned)(fptr->bglbd[1])
+ $? ". bglbd[2]=%u", (unsigned)(fptr->bglbd[2])
+ dk4mem_cpy(
+ &(fptr->bg[0]), &(fptr->bglbd[0]), 4*sizeof(dk4_px_t), NULL
+ );
+ if ((fptr->l_bdepth != bd) || (0 != fptr->fmres)) {
+ dk4pxres_multiple(&(fptr->bg[0]), 4, &(fptr->resampler));
+ }
+ $? ". bg[0]=%u", (unsigned)(fptr->bg[0])
+ $? ". bg[1]=%u", (unsigned)(fptr->bg[1])
+ $? ". bg[2]=%u", (unsigned)(fptr->bg[2])
+ }
+ } while (NULL != fptr);
+ /*
+ Indicate success
+ */
+ back = 1;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_set_output_bit_depth %d", back
+ return back;
+}
+
+
+
+int
+dk4bif_set_background(
+ dk4_bif_t *bif,
+ dk4_px_t const *bg,
+ size_t szbg,
+ dk4_px_bit_depth_t bd,
+ int force
+)
+{
+ dk4_px_resample_t bgres; /* Resample bg data to required bit depth */
+ dk4_bif_frame_t *fptr; /* Traverse all frames */
+ size_t i; /* Current bg component index */
+ int back = 0;
+ $? "+ dk4bif_set_background ptr=%d bg=%d", TR_IPTR(bif), TR_IPTR(bg)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if ((NULL == bif) || (NULL == bg)) {
+ goto finished;
+ }
+ if ((NULL == bif->s_frames) || (NULL == bif->i_frames)) {
+ goto finished;
+ }
+ if (0 != bif->hdronly) {
+ goto finished;
+ }
+ /* Correct number of background arguments
+ */
+ if (szbg > 4) {
+ szbg = 4;
+ }
+ /* Traverse all frames, set background in the frames bit depth
+ */
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ fptr = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL != fptr) {
+ if ((0 != force) || (0 == (bif->cf)->hbg)) {
+ if (0 != fptr->fmres) {
+ dk4pxres_setup_to_maxval(&bgres, bd, fptr->fmrmv);
+ }
+ else {
+ dk4pxres_setup(&bgres, bd, (fptr->l_bdepth));
+ }
+ for (i = 0; i < szbg; i++) {
+ fptr->bg[i] = dk4pxres_get(&bgres, bg[i]);
+ fptr->bglbd[i] = bg[i];
+ }
+ }
+ }
+ } while (NULL != fptr);
+ /*
+ Indicate success
+ */
+ back = 1;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_set_background %d", back
+ return back;
+}
+
+
+
+double
+dk4bif_get_xres(
+ dk4_bif_t const *bif
+)
+{
+ double back = -1.0;
+ $? "+ dk4bif_get_xres %d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve x resolution from current frame
+ */
+ back = (bif->cf)->res_x;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_get_xres %g", back
+ return back;
+}
+
+
+
+double
+dk4bif_get_yres(
+ dk4_bif_t const *bif
+)
+{
+ double back = -1.0;
+ $? "+ dk4bif_get_yres %d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve y resolution from current frame
+ */
+ back = (bif->cf)->res_y;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_get_yres %g", back
+ return back;
+}
+
+
+
+int
+dk4bif_set_res(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4bif_set_res %lg %lg", xres, yres
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if ((NULL != bif) && (0.0 < xres) && (0.0 < yres)) {
+ if (NULL != bif->cf) { $? ". settings applied"
+ bif->cf->res_x = xres;
+ bif->cf->res_y = yres;
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4bif_set_res %d", back
+ return back;
+}
+
+
+
+dk4_bif_dim_t
+dk4bif_get_width(
+ dk4_bif_t const *bif
+)
+{
+ dk4_bif_dim_t back = -1L;
+ $? "+ dk4_bif_dim_t %d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve width of current frame
+ */
+ back = (bif->cf)->dim_x;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4_bif_dim_t %ld", (long)back
+ return back;
+}
+
+
+
+dk4_bif_dim_t
+dk4bif_get_height(
+ dk4_bif_t const *bif
+)
+{
+ dk4_bif_dim_t back = -1L;
+ $? "+ dk4bif_get_height %d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ /* Retrieve width from current frame
+ */
+ back = (bif->cf)->dim_y;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_get_height %ld", (long)back
+ return back;
+}
+
+
+
+const
+dk4_cs_conv_ctx_t *
+dk4bif_get_cs_conv_ctx(
+ dk4_bif_t const *bif
+)
+{
+ const dk4_cs_conv_ctx_t *back = NULL;
+ $? "+ dk4bif_get_cs_conv_ctx %d", TR_IPTR(bif)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ goto finished;
+ }
+ /* Retrieve address of color space conversion context
+ */
+ back = &(bif->cs_ctx);
+
+ /* Return
+ */
+ finished:
+ $? "- dk4bif_get_cs_conv_ctx %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+dk4bif_set_cs_conv_ctx(
+ dk4_bif_t *bif,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ $? "+ dk4bif_set_cs_conv_ctx bif=%d pctx=%d", TR_IPTR(bif), TR_IPTR(pctx)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if ((NULL != bif) && (NULL != pctx)) {
+ DK4_MEMCPY(&(bif->cs_ctx), pctx, sizeof(dk4_cs_conv_ctx_t));
+ }
+ $? "- dk4bif_set_cs_conv_ctx"
+}
+
+
+
+int
+dk4bif_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ int back = 0;
+ $? "+ dk4bif_nc_get_original_pixel"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
+ switch (bif->imgtype) {
+ case DK4_BIF_TYPE_PNG : {
+#if DK4_HAVE_PNG_H
+ back = dk4bifpng_nc_get_original_pixel(dptr, bif, rowno, colno);
+#endif
+ } break;
+ case DK4_BIF_TYPE_JPEG : {
+#if DK4_HAVE_JPEGLIB_H
+ back = dk4bifjpeg_nc_get_original_pixel(
+ dptr, szdptr, bif, rowno, colno
+ );
+#endif
+ } break;
+ case DK4_BIF_TYPE_TIFF : {
+#if DK4_HAVE_TIFF_H
+ back = dk4biftiff_nc_get_original_pixel(dptr, bif, rowno, colno);
+#endif
+ } break;
+ case DK4_BIF_TYPE_NETPBM : {
+ back = dk4bifnetpbm_nc_get_original_pixel(dptr, bif, rowno, colno);
+ } break;
+ /* ##### FURTHER IMAGE TYPES HERE */
+ }
+ $? "- dk4bif_nc_get_original_pixel %d", back
+ return back;
+}
+
+
+
+#if TRACE_DEBUG
+static
+void
+show_pixel_data(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ int cs
+)
+{
+ size_t i; /* Index of current component to process */
+ size_t max; /* Number of components in color space */
+
+ max = dk4cs_color_space_size(cs);
+ if (max > szdptr) { max = szdptr; }
+ for (i = 0; i < max; i++) {
+ $? ". component[%u] = %lu", (unsigned)i, (unsigned long)(dptr[i])
+ }
+}
+#endif
+
+
+
+int
+dk4bif_nc_get_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno,
+ int cs
+)
+{
+ dk4_px_t tmp[4]; /* Temporary pixel data */
+ size_t sztmp = DK4_SIZEOF(tmp,dk4_px_t);
+ int back = 0;
+ $? "+ dk4bif_nc_get_pixel szdptr=%u", (unsigned)szdptr
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
+ if ((bif->cf)->l_cs == cs) { $? ". same color space"
+ /*
+ Same color space
+ */
+ back = dk4bif_nc_get_original_pixel(dptr, szdptr, bif, rowno, colno);
+ $!trace-code show_pixel_data(dptr, szdptr, (bif->cf)->l_cs);
+ if (0 != back) {
+ if (
+ ((bif->cf)->l_bdepth != (bif->cf)->r_bdepth)
+ || (0 != bif->cf->fmres)
+ ) {
+ /*
+ Bit depth correction required
+ */
+ $? ". change bit depth"
+ dk4pxres_multiple(
+ dptr, dk4cs_color_space_size(cs), &((bif->cf)->resampler)
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! dk4bif_nc_get_original_pixel"
+ }
+#endif
+ }
+ else { $? ". different color spaces"
+ /*
+ Color space conversion required
+ */
+ back = dk4bif_nc_get_original_pixel(tmp, sztmp, bif, rowno, colno);
+ $!trace-code show_pixel_data(tmp, szdptr, (bif->cf)->l_cs);
+ if (0 != back) {
+ if (
+ ((bif->cf)->l_bdepth != (bif->cf)->r_bdepth)
+ || (0 != bif->cf->fmres)
+ )
+ {
+ $? ". different bit depths"
+ /*
+ Bit depth correction required
+ */
+ if ((bif->cf)->l_bdepth > (bif->cf)->r_bdepth) {
+ $? ". color space conversion before bit depth change"
+ /*
+ Color space conversion first, bit depth later
+ */
+ dk4cs_nc_px_convert(
+ dptr, cs, tmp, (bif->cf)->l_cs, &((bif->cf)->bglbd[0]),
+ (dk4_px_t)((bif->cf)->resampler.denom), &(bif->cs_ctx)
+ );
+ dk4pxres_multiple(
+ dptr, dk4cs_color_space_size(cs),
+ &((bif->cf)->resampler)
+ );
+ }
+ else {
+ $? ". bit depth change before color space conversion"
+ /*
+ Bit depth conversion first, color space later
+ */
+ dk4pxres_multiple(
+ tmp, dk4cs_color_space_size((bif->cf)->l_cs),
+ &((bif->cf)->resampler)
+ );
+ dk4cs_nc_px_convert(
+ dptr, cs, tmp, (bif->cf)->l_cs, &((bif->cf)->bg[0]),
+ (dk4_px_t)((bif->cf)->resampler.nom), &(bif->cs_ctx)
+ );
+ }
+ }
+ else { $? ". same bit depth"
+ /* No bit depth correction, just change color space
+ */
+ dk4cs_nc_px_convert(
+ dptr, cs, tmp, (bif->cf)->l_cs, &((bif->cf)->bg[0]),
+ (dk4_px_t)((bif->cf)->resampler.denom), &(bif->cs_ctx)
+ );
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! dk4bif_nc_get_original_pixel"
+ }
+#endif
+ }
+ $? "- dk4bif_nc_get_pixel %d", back
+ return back;
+}
+
+
+
+int
+dk4bif_get_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno,
+ int cs
+)
+{
+ int back = 0;
+ $? "+ dk4bif_get_pixel ptr=%d", TR_IPTR(dptr)
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
+ /*
+ Check arguments
+ */
+ if ((NULL == dptr) || (NULL == bif)) { $? "! dptr/bif"
+ goto finished;
+ }
+ if (0 != bif->hdronly) { $? "! hdronly"
+ goto finished;
+ }
+ if (0 == dk4cs_check(cs)) { $? "! cs"
+ goto finished;
+ }
+ if (szdptr < dk4cs_color_space_size(cs)) { $? "! szdptr"
+ goto finished;
+ }
+ if (((dk4_bif_dim_t)0L > rowno) || ((bif->cf)->dim_y <= rowno)) { $? "! row"
+ goto finished;
+ }
+ if (((dk4_bif_dim_t)0L > colno) || ((bif->cf)->dim_x <= colno)) { $? "! col"
+ goto finished;
+ }
+ back = dk4bif_nc_get_pixel(dptr, szdptr, bif, rowno, colno, cs);
+ $!trace-code show_pixel_data(dptr, szdptr, cs);
+
+ /* Return, fill default value 0 if there was any problem
+ */
+ finished:
+ if (0 == back) {
+ if (NULL != dptr) { $? "! zero fill on error"
+ while(0 < szdptr--) {
+ *(dptr++) = 0;
+ }
+ }
+ }
+ $? "- dk4bif_get_pixel %d", back
+ return back;
+}
+
+
+
+int
+dk4bif_get_image_type(
+ dk4_bif_t const *bif
+)
+{
+ int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ if (NULL != bif) {
+ back = bif->imgtype;
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bif.h b/support/dktools/dk4bif.h
new file mode 100644
index 0000000000..8336ba59f6
--- /dev/null
+++ b/support/dktools/dk4bif.h
@@ -0,0 +1,384 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bif.ctr
+*/
+
+#ifndef DK4BIF_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4BIF_H_INCLUDED 1
+
+
+#line 7 "dk4bif.ctr"
+
+/** @file dk4bif.h Bitmap image files.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bifty.h"
+#else
+#include <dktools-4/dk4bifty.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Find bitmap image file type for file name.
+ @param fn File name to check.
+ @return Non-negative dk4_bif_type_t value on success,
+ -1 on error (NULL file name or file name suffix does not indicate
+ a graphics type the function can handle).
+*/
+
+int
+dk4bif_type_for_suffix(
+ dkChar const *fn
+);
+
+
+/** Open bitmap image file.
+ @param fn File name containing the bitmap image.
+ @param hdronly Flag: Read header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL,
+ - DK4_E_NOT_FOUND<br>
+ if the file name does not contain a suffix or the suffix does
+ not indicate a bitmap image file type the function can handle,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation failed,
+ - DK4_E_SYNTAX<br>
+ if the file contents is incorrect (not matching the specified file
+ type),
+ - DK4_E_READ_FAILED<br>
+ if the function failed to read from file fn.
+*/
+
+dk4_bif_t *
+dk4bif_open(
+ dkChar const *fn,
+ int hdronly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/** Open bitmap image file.
+ @param fn File name containing the bitmap image.
+ @param ty Image file type (PNG, JPEG or TIFF).
+ @param honly Flag: Read header information only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL or an unknown bitmap type is requested,
+ - DK4_E_READ_FAILED<br>
+ if the function failed to read from file fn,
+ - DK4_E_NOT_SUPPORTED<br>
+ if the operation is not supported (i.e. compiled without a
+ required library).
+*/
+
+dk4_bif_t *
+dk4bif_open_type(
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/** Open bitmap image file.
+ @param fipo File, opened for binary reading.
+ @param fn File name containing the bitmap image.
+ @param ty Image file type (PNG, JPEG or TIFF).
+ @param honly Flag: Read image header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fipo or fn is NULL,
+ - DK4_E_NOT_SUPPORTED<br>
+ if the operation is not supported (i.e. compiled without a
+ required library).
+*/
+
+dk4_bif_t *
+dk4bif_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+);
+
+
+/** Close bitmap image file and release resources.
+ @param bif Bitmap image file to close.
+*/
+
+void
+dk4bif_close(
+ dk4_bif_t *bif
+);
+
+
+/** Find number of frames in bitmap image file.
+ @param bif Bitmap image file to query.
+ @return Positive value on success, 0 on error.
+*/
+
+size_t
+dk4bif_get_number_of_frames(
+ dk4_bif_t const *bif
+);
+
+
+/** Set current frame in a bitmap image file.
+ @param bif Bitmap image file.
+ @param fno Index of new current frame (0 for first frame).
+ @return 1 on success, 0 on error (out of range).
+*/
+
+int
+dk4bif_set_current_frame(
+ dk4_bif_t *bif,
+ size_t fno
+);
+
+
+/** Retrieve low level bit depth of current frame bitmap image file.
+ @param bif Bitmap image file
+ @return Positive value on success, 0 on error.
+*/
+
+dk4_px_bit_depth_t
+dk4bif_get_original_bit_depth(
+ dk4_bif_t const *bif
+);
+
+
+/** Retrieve color space of current frame returned from low-level library.
+ @param bif Bitmap image file.
+ @return Non-negative dk4_bif_cs_t value on success, -1 on error.
+*/
+
+int
+dk4bif_get_color_space(
+ dk4_bif_t const *bif
+);
+
+
+/** Retrieve color space of current frame contained in the file.
+ @param bif Bitmap image file.
+ @return Non-negative dk4_bif_cs_t value on success, -1 on error.
+*/
+
+int
+dk4bif_get_file_color_space(
+ dk4_bif_t const *bif
+);
+
+
+/** Set required output bit depth for pixel data to retrieve for
+ all frames.
+ @param bif Bitmap image file.
+ @param bd Required output bit depth.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_set_output_bit_depth(
+ dk4_bif_t *bif,
+ dk4_px_bit_depth_t bd
+);
+
+
+/** Set default background or enforced background for bitmap image file
+ for all frames.
+ @param bif Bitmap image file.
+ @param bg Array containing background values.
+ @param szbg Size of bg array (number of elements).
+ @param bd Bit depth used in the bg array.
+ @param force Flag: Enforce this background. Without this flag the
+ background information from here is used only if no
+ background information was found in the file.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_set_background(
+ dk4_bif_t *bif,
+ dk4_px_t const *bg,
+ size_t szbg,
+ dk4_px_bit_depth_t bd,
+ int force
+);
+
+
+/** Get image type.
+ @param bif Bitmap image file.
+ @return Non-negative image type on success, negative value on error.
+*/
+
+int
+dk4bif_get_image_type(
+ dk4_bif_t const *bif
+);
+
+
+/** Retrieve data for one pixel in the required output bit depth
+ and color space.
+ @param dptr Address of destination array, must be large enough.
+ @param szdptr Size of dptr array (number of elements).
+ @param bif Bitmap image file.
+ @param rowno Row number (0 for top row).
+ @param colno Column number (0 for left column).
+ @param cs Required color space.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_get_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno,
+ int cs
+);
+
+
+/** Get the current frames x resolution in dpi.
+ @param bif Bitmap image file.
+ @return Positive number on success, negative value on error or if
+ not found.
+*/
+
+double
+dk4bif_get_xres(
+ dk4_bif_t const *bif
+);
+
+
+/** Get the current frames y resolution in dpi.
+ @param bif Bitmap image file.
+ @return Positive number on success, negative value on error or if
+ not found.
+*/
+
+double
+dk4bif_get_yres(
+ dk4_bif_t const *bif
+);
+
+
+/** Set resolution explicitly.
+ @param bif Bitmap image file.
+ @param xres X resolution, must be positive.
+ @param yres Y resolution, must be positive.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error
+*/
+
+int
+dk4bif_set_res(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_er_t *erp
+);
+
+/** Get current frame width.
+ @param bif Bitmap image file.
+ @return Positive number on success, negative value on error.
+*/
+
+dk4_bif_dim_t
+dk4bif_get_width(
+ dk4_bif_t const *bif
+);
+
+
+/** Get current frame height.
+ @param bif Bitmap image file.
+ @return Positive number on success, negative value on error.
+*/
+
+dk4_bif_dim_t
+dk4bif_get_height(
+ dk4_bif_t const *bif
+);
+
+
+/** Get color space conversion context for bitmap image.
+ @param bif Bitmap image file.
+ @return Valid pointer on success, NULL on error.
+*/
+
+const
+dk4_cs_conv_ctx_t *
+dk4bif_get_cs_conv_ctx(
+ dk4_bif_t const *bif
+);
+
+
+/** Set color space conversion context for bitmap image.
+ @param bif Bitmap image file.
+ @param pctx Color space conversion context to use.
+*/
+
+void
+dk4bif_set_cs_conv_ctx(
+ dk4_bif_t *bif,
+ dk4_cs_conv_ctx_t const *pctx
+);
+
+
+/** Close a bitmap image frame, release ressources.
+ @param frptr Frame to close.
+ @param imgtype Bitmap image file type.
+*/
+
+void
+dk4bif_frame_close(
+ dk4_bif_frame_t *frptr,
+ int imgtype
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/dk4bifa.c b/support/dktools/dk4bifa.c
new file mode 100644
index 0000000000..b3ecc6e504
--- /dev/null
+++ b/support/dktools/dk4bifa.c
@@ -0,0 +1,514 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifa.ctr
+*/
+
+/** @file dk4bifa.c The dk4bifa module.
+*/
+
+
+#line 86 "dk4bifa.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4BIFA_H_INCLUDED
+#include "dk4bifa.h"
+#endif
+
+#ifndef DK4PXBIT_H_INCLUDED
+#include "dk4pxbit.h"
+#endif
+
+#ifndef DK4PXRES_H_INCLUDED
+#include "dk4pxres.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 120 "dk4bifa.ctr"
+
+
+
+/** Test for various resamplers whether the value can be resampled
+ without quality loss.
+ @param pxr Array of pixel resamplers to 1, 2, 4, 8 and 12 bit.
+ @param pxo Array of can-use flags for the pixel resamplers.
+ @param changed Address of change flag.
+ @param value Pixel sample value to test.
+ @param ori_bd Original bit depth.
+*/
+static
+void
+dk4bif_ana_bd(
+ dk4_px_resample_t *pxr,
+ int *pxo,
+ int *changed,
+ dk4_px_t value,
+ dk4_px_bit_depth_t ori_bd
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pxr);
+ assert(NULL != pxo);
+ assert(NULL != changed);
+#endif
+ if (1 < ori_bd) {
+ if (0 != pxo[0]) {
+ if (0 == dk4pxres_check(&(pxr[0]), value)) {
+ pxo[0] = 0;
+ *changed = 1;
+ }
+ }
+ if (2 < ori_bd) {
+ if (0 != pxo[1]) {
+ if (0 == dk4pxres_check(&(pxr[1]), value)) {
+ pxo[1] = 0;
+ *changed = 1;
+ }
+ }
+ if (4 < ori_bd) {
+ if (0 != pxo[2]) {
+ if (0 == dk4pxres_check(&(pxr[2]), value)) {
+ pxo[2] = 0;
+ *changed = 1;
+ }
+ }
+ if (8 < ori_bd) {
+ if (0 != pxo[3]) {
+ if (0 == dk4pxres_check(&(pxr[3]), value)) {
+ pxo[3] = 0;
+ *changed = 1;
+ }
+ }
+ if (12 < ori_bd) {
+ if (0 != pxo[4]) {
+ if (0 == dk4pxres_check(&(pxr[4]), value)) {
+ pxo[4] = 0;
+ *changed = 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+
+int
+dk4bif_analyze(
+ int *pcs,
+ dk4_px_bit_depth_t *pbd,
+ dk4_bif_t const *bif,
+ int anb,
+ int anc,
+ int ana,
+ dk4_er_t *erp
+)
+{
+ dk4_px_resample_t pxr[8]; /* Pixel resampling structures */
+ dk4_px_t pix[8]; /* Pixel component values */
+ int pxo[8]; /* Pixel resampling ok */
+ size_t i; /* Traverse resampling structures */
+ dk4_bif_dim_t x; /* Current column number */
+ dk4_bif_dim_t y; /* Current row number */
+ dk4_bif_dim_t w; /* Image width */
+ dk4_bif_dim_t h; /* Image height */
+ dk4_px_t max = 1; /* Maximum value for bit depth */
+ int ori_cs = 0; /* Original color space */
+ int back = 0; /* Function result */
+ int f_col = 0; /* Flag: Found colored pixel */
+ int f_alp = 0; /* Flag: Found pixel with alpha */
+ int cc = 1; /* Flag: Can continue */
+ int changed = 0; /* Flag: Change in loop pass */
+ dk4_px_bit_depth_t ori_bd = 8; /* Original bit depth */
+
+
+
+#line 219 "dk4bifa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == pcs) && ((0 != anc) || (0 != ana))) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == pbd) && (0 != anb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ /* All arguments ok
+ */
+ back = 1;
+
+ /* Correct analysis for color space
+ (i.e. no need to check for colors if color space is gray)
+ */
+ ori_cs = dk4bif_get_color_space(bif);
+ ori_bd = dk4bif_get_original_bit_depth(bif);
+
+
+#line 248 "dk4bifa.ctr"
+
+
+#line 249 "dk4bifa.ctr"
+ max = dk4pxbit_get_max(ori_bd);
+ switch (ori_cs) {
+ case DK4_CS_GRAY : {
+ anc = 0;
+ ana = 0;
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ anc = 0;
+ } break;
+ case DK4_CS_RGB : {
+ ana = 0;
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ ana = 0;
+ } break;
+ case DK4_CS_CMYK : {
+ ana = 0;
+ } break;
+ }
+
+ /* If no analysis to execute, skip processing
+ */
+ if ((0 == anb) && (0 == anc) && (0 == ana)) {
+ if (NULL != pcs) { *pcs = ori_cs; }
+ if (NULL != pbd) { *pbd = ori_bd; }
+ goto finished;
+ }
+
+ /* Mark all bit depths as available
+ */
+ for (i = 0; i < 5; i++) {
+ dk4pxres_init(&(pxr[i]));
+ pxo[i] = 1;
+ }
+
+ /* Set up pixel resampling structures to test bit depth conversions
+ */
+ (void)dk4pxres_setup(&(pxr[0]), ori_bd, 1);
+ (void)dk4pxres_setup(&(pxr[1]), ori_bd, 2);
+ (void)dk4pxres_setup(&(pxr[2]), ori_bd, 4);
+ (void)dk4pxres_setup(&(pxr[3]), ori_bd, 8);
+ (void)dk4pxres_setup(&(pxr[4]), ori_bd, 12);
+ if (NULL != bif->cf) {
+ if (0 != bif->cf->fmres) {
+ (void)dk4pxres_setup_from_maxval(&(pxr[0]), bif->cf->fmrmv, 1);
+ (void)dk4pxres_setup_from_maxval(&(pxr[1]), bif->cf->fmrmv, 2);
+ (void)dk4pxres_setup_from_maxval(&(pxr[2]), bif->cf->fmrmv, 4);
+ (void)dk4pxres_setup_from_maxval(&(pxr[3]), bif->cf->fmrmv, 8);
+ (void)dk4pxres_setup_from_maxval(&(pxr[4]), bif->cf->fmrmv, 12);
+ }
+ }
+
+ /* Obtain image dimensions
+ */
+ w = dk4bif_get_width(bif);
+ h = dk4bif_get_height(bif);
+
+ /* Traverse image
+ */
+ for (y = 0; ((0 != cc) && (y < h)); y++) {
+ for (x = 0; ((0 != cc) && (x < w)); x++) {
+ changed = 0;
+ if (0 != dk4bif_get_pixel(pix, 8, bif, y, x, ori_cs)) {
+ /* Implementation, do the checks */
+ switch (ori_cs) {
+ case DK4_CS_GRAY : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ }
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[1], ori_bd);
+ }
+ if (0 != ana) {
+ if (0 == f_alp) {
+ if (max > pix[1]) {
+ f_alp = 1;
+ changed = 1;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_RGB : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[1], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[2], ori_bd);
+ }
+ if (0 != anc) {
+ if (0 == f_col) {
+ if (pix[0] != pix[1]) {
+ f_col = 1; changed = 1;
+ }
+ if (pix[0] != pix[2]) {
+ f_col = 1; changed = 1;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[1], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[2], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[3], ori_bd);
+ }
+ if (0 != anc) {
+ if (0 == f_col) {
+ if (pix[0] != pix[1]) {
+ f_col = 1; changed = 1;
+ }
+ if (pix[0] != pix[2]) {
+ f_col = 1; changed = 1;
+ }
+ }
+ }
+ if (0 != ana) {
+ if (0 == f_alp) {
+ if (max > pix[3]) {
+ f_alp = 1;
+ changed = 1;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_CMYK : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[1], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[2], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[3], ori_bd);
+ }
+ if (0 != anc) {
+ if (0 == f_col) {
+ if (0 < pix[0]) { f_col = 1; changed = 1; }
+ if (0 < pix[1]) { f_col = 1; changed = 1; }
+ if (0 < pix[2]) { f_col = 1; changed = 1; }
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ cc = 0;
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ /* Check whether we must continue */
+ if (0 != changed) {
+ cc = 0;
+ if ((0 != ana) && (0 == f_alp)) {
+ cc = 1;
+ }
+ else {
+ if ((0 != anc) && (0 == f_col)) {
+ cc = 1;
+ }
+ else {
+ if (12 < ori_bd) {
+ if (0 != pxo[4]) { cc = 1; }
+ if (0 != pxo[3]) { cc = 1; }
+ if (0 != pxo[2]) { cc = 1; }
+ if (0 != pxo[1]) { cc = 1; }
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ else {
+ if (8 < ori_bd) {
+ if (0 != pxo[3]) { cc = 1; }
+ if (0 != pxo[2]) { cc = 1; }
+ if (0 != pxo[1]) { cc = 1; }
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ else {
+ if (4 < ori_bd) {
+ if (0 != pxo[2]) { cc = 1; }
+ if (0 != pxo[1]) { cc = 1; }
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ else {
+ if (2 < ori_bd) {
+ if (0 != pxo[1]) { cc = 1; }
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ else {
+ if (1 < ori_bd) {
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* Transfer results to result variables
+ */
+ if (0 != back) {
+ if (NULL != pcs) {
+ /* Set result color space */
+ switch (ori_cs) {
+ case DK4_CS_GRAY : {
+ *pcs = DK4_CS_GRAY;
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ if ((0 != f_alp) || (0 == ana)) {
+ *pcs = DK4_CS_GRAY_ALPHA;
+ }
+ else {
+ *pcs = DK4_CS_GRAY;
+ }
+ } break;
+ case DK4_CS_RGB : {
+ if (0 != f_col) {
+ *pcs = DK4_CS_RGB;
+ }
+ else {
+ *pcs = DK4_CS_GRAY;
+ }
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ if ((0 != f_alp) || (0 == ana)) {
+ if (0 != f_col) {
+ *pcs = DK4_CS_RGB_ALPHA;
+ }
+ else {
+ *pcs = DK4_CS_GRAY_ALPHA;
+ }
+ }
+ else {
+ if (0 != f_col) {
+ *pcs = DK4_CS_RGB;
+ }
+ else {
+ *pcs = DK4_CS_GRAY;
+ }
+ }
+ } break;
+ case DK4_CS_CMYK : {
+ if (0 != f_col) {
+ *pcs = DK4_CS_CMYK;
+ }
+ else {
+ *pcs = DK4_CS_GRAY;
+ }
+ } break;
+ }
+ }
+ if (NULL != pbd) {
+ /* Set result bit depth */
+ if (0 != pxo[0]) {
+ *pbd = 1;
+ }
+ else {
+ if (0 != pxo[1]) {
+ *pbd = 2;
+ }
+ else {
+ if (0 != pxo[2]) {
+ *pbd = 4;
+ }
+ else {
+ if (0 != pxo[3]) {
+ *pbd = 8;
+ }
+ else {
+ if (0 != pxo[4]) {
+ *pbd = 12;
+ }
+ else {
+ if (1 < ori_bd) {
+ if (2 < ori_bd) {
+ if (4 < ori_bd) {
+ if (8 < ori_bd) {
+ *pbd = 12;
+ }
+ else {
+ *pbd = 8;
+ }
+ }
+ else {
+ *pbd = 4;
+ }
+ }
+ else {
+ *pbd = 2;
+ }
+ }
+ else {
+ *pbd = 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ finished:
+#if TRACE_DEBUG
+ if (NULL != pcs) {
+
+
+#line 556 "dk4bifa.ctr"
+ }
+ if (NULL != pbd) {
+
+
+#line 559 "dk4bifa.ctr"
+ }
+#endif
+
+
+#line 562 "dk4bifa.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4bifa.ctr b/support/dktools/dk4bifa.ctr
new file mode 100644
index 0000000000..244bbbbf63
--- /dev/null
+++ b/support/dktools/dk4bifa.ctr
@@ -0,0 +1,567 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4bifa.h Bitmap image file analysis.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bifty.h"
+#else
+#include <dktools-4/dk4bifty.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Analyze bitmap image file, apply the following tests:
+ - If the image is RGB or CMYK, if R=G=B or C=M=Y for each pixel,
+ writing gray output is sufficient.
+ - If the image contains an alpha channel and alpha data indicates
+ full opacity for all pixels, we can ignore the alpha channel.
+ - If we can reduce the number of bits per component (bits per sample)
+ for all samples of all pixels without quality loss, do so.
+
+ @param pcs Address of color space variable (in/out).
+ @param pbd Address of bit depth (in/out).
+ @param bif Bitmap image file.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze color usage.
+ @param ana Flag: Analyze alpha channel usage.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if:
+ - bif is NULL,
+ - pcs is NULL while color or alpha analysis is requested, or
+ - pbd is NULL while bit depth analysis is requested.
+ - DK4_E_SYNTAX<br>
+ if an error occured while retrieving a pixel.
+*/
+
+int
+dk4bif_analyze(
+ int *pcs,
+ dk4_px_bit_depth_t *pbd,
+ dk4_bif_t const *bif,
+ int anb,
+ int anc,
+ int ana,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4BIFA_H_INCLUDED
+#include "dk4bifa.h"
+#endif
+
+#ifndef DK4PXBIT_H_INCLUDED
+#include "dk4pxbit.h"
+#endif
+
+#ifndef DK4PXRES_H_INCLUDED
+#include "dk4pxres.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Test for various resamplers whether the value can be resampled
+ without quality loss.
+ @param pxr Array of pixel resamplers to 1, 2, 4, 8 and 12 bit.
+ @param pxo Array of can-use flags for the pixel resamplers.
+ @param changed Address of change flag.
+ @param value Pixel sample value to test.
+ @param ori_bd Original bit depth.
+*/
+static
+void
+dk4bif_ana_bd(
+ dk4_px_resample_t *pxr,
+ int *pxo,
+ int *changed,
+ dk4_px_t value,
+ dk4_px_bit_depth_t ori_bd
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pxr);
+ assert(NULL != pxo);
+ assert(NULL != changed);
+#endif
+ if (1 < ori_bd) {
+ if (0 != pxo[0]) {
+ if (0 == dk4pxres_check(&(pxr[0]), value)) {
+ pxo[0] = 0;
+ *changed = 1;
+ }
+ }
+ if (2 < ori_bd) {
+ if (0 != pxo[1]) {
+ if (0 == dk4pxres_check(&(pxr[1]), value)) {
+ pxo[1] = 0;
+ *changed = 1;
+ }
+ }
+ if (4 < ori_bd) {
+ if (0 != pxo[2]) {
+ if (0 == dk4pxres_check(&(pxr[2]), value)) {
+ pxo[2] = 0;
+ *changed = 1;
+ }
+ }
+ if (8 < ori_bd) {
+ if (0 != pxo[3]) {
+ if (0 == dk4pxres_check(&(pxr[3]), value)) {
+ pxo[3] = 0;
+ *changed = 1;
+ }
+ }
+ if (12 < ori_bd) {
+ if (0 != pxo[4]) {
+ if (0 == dk4pxres_check(&(pxr[4]), value)) {
+ pxo[4] = 0;
+ *changed = 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+
+int
+dk4bif_analyze(
+ int *pcs,
+ dk4_px_bit_depth_t *pbd,
+ dk4_bif_t const *bif,
+ int anb,
+ int anc,
+ int ana,
+ dk4_er_t *erp
+)
+{
+ dk4_px_resample_t pxr[8]; /* Pixel resampling structures */
+ dk4_px_t pix[8]; /* Pixel component values */
+ int pxo[8]; /* Pixel resampling ok */
+ size_t i; /* Traverse resampling structures */
+ dk4_bif_dim_t x; /* Current column number */
+ dk4_bif_dim_t y; /* Current row number */
+ dk4_bif_dim_t w; /* Image width */
+ dk4_bif_dim_t h; /* Image height */
+ dk4_px_t max = 1; /* Maximum value for bit depth */
+ int ori_cs = 0; /* Original color space */
+ int back = 0; /* Function result */
+ int f_col = 0; /* Flag: Found colored pixel */
+ int f_alp = 0; /* Flag: Found pixel with alpha */
+ int cc = 1; /* Flag: Can continue */
+ int changed = 0; /* Flag: Change in loop pass */
+ dk4_px_bit_depth_t ori_bd = 8; /* Original bit depth */
+
+ $? "+ dk4bif_analyze"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == bif) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == pcs) && ((0 != anc) || (0 != ana))) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == pbd) && (0 != anb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ /* All arguments ok
+ */
+ back = 1;
+
+ /* Correct analysis for color space
+ (i.e. no need to check for colors if color space is gray)
+ */
+ ori_cs = dk4bif_get_color_space(bif);
+ ori_bd = dk4bif_get_original_bit_depth(bif);
+ $? ". ori cs = %d", ori_cs
+ $? ". ori bd = %u", (unsigned)ori_bd
+ max = dk4pxbit_get_max(ori_bd);
+ switch (ori_cs) {
+ case DK4_CS_GRAY : {
+ anc = 0;
+ ana = 0;
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ anc = 0;
+ } break;
+ case DK4_CS_RGB : {
+ ana = 0;
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ ana = 0;
+ } break;
+ case DK4_CS_CMYK : {
+ ana = 0;
+ } break;
+ }
+
+ /* If no analysis to execute, skip processing
+ */
+ if ((0 == anb) && (0 == anc) && (0 == ana)) {
+ if (NULL != pcs) { *pcs = ori_cs; }
+ if (NULL != pbd) { *pbd = ori_bd; }
+ goto finished;
+ }
+
+ /* Mark all bit depths as available
+ */
+ for (i = 0; i < 5; i++) {
+ dk4pxres_init(&(pxr[i]));
+ pxo[i] = 1;
+ }
+
+ /* Set up pixel resampling structures to test bit depth conversions
+ */
+ (void)dk4pxres_setup(&(pxr[0]), ori_bd, 1);
+ (void)dk4pxres_setup(&(pxr[1]), ori_bd, 2);
+ (void)dk4pxres_setup(&(pxr[2]), ori_bd, 4);
+ (void)dk4pxres_setup(&(pxr[3]), ori_bd, 8);
+ (void)dk4pxres_setup(&(pxr[4]), ori_bd, 12);
+ if (NULL != bif->cf) {
+ if (0 != bif->cf->fmres) {
+ (void)dk4pxres_setup_from_maxval(&(pxr[0]), bif->cf->fmrmv, 1);
+ (void)dk4pxres_setup_from_maxval(&(pxr[1]), bif->cf->fmrmv, 2);
+ (void)dk4pxres_setup_from_maxval(&(pxr[2]), bif->cf->fmrmv, 4);
+ (void)dk4pxres_setup_from_maxval(&(pxr[3]), bif->cf->fmrmv, 8);
+ (void)dk4pxres_setup_from_maxval(&(pxr[4]), bif->cf->fmrmv, 12);
+ }
+ }
+
+ /* Obtain image dimensions
+ */
+ w = dk4bif_get_width(bif);
+ h = dk4bif_get_height(bif);
+
+ /* Traverse image
+ */
+ for (y = 0; ((0 != cc) && (y < h)); y++) {
+ for (x = 0; ((0 != cc) && (x < w)); x++) {
+ changed = 0;
+ if (0 != dk4bif_get_pixel(pix, 8, bif, y, x, ori_cs)) {
+ /* Implementation, do the checks */
+ switch (ori_cs) {
+ case DK4_CS_GRAY : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ }
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[1], ori_bd);
+ }
+ if (0 != ana) {
+ if (0 == f_alp) {
+ if (max > pix[1]) {
+ f_alp = 1;
+ changed = 1;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_RGB : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[1], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[2], ori_bd);
+ }
+ if (0 != anc) {
+ if (0 == f_col) {
+ if (pix[0] != pix[1]) {
+ f_col = 1; changed = 1;
+ }
+ if (pix[0] != pix[2]) {
+ f_col = 1; changed = 1;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[1], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[2], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[3], ori_bd);
+ }
+ if (0 != anc) {
+ if (0 == f_col) {
+ if (pix[0] != pix[1]) {
+ f_col = 1; changed = 1;
+ }
+ if (pix[0] != pix[2]) {
+ f_col = 1; changed = 1;
+ }
+ }
+ }
+ if (0 != ana) {
+ if (0 == f_alp) {
+ if (max > pix[3]) {
+ f_alp = 1;
+ changed = 1;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_CMYK : {
+ if (0 != anb) {
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[0], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[1], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[2], ori_bd);
+ dk4bif_ana_bd(pxr, pxo, &changed, pix[3], ori_bd);
+ }
+ if (0 != anc) {
+ if (0 == f_col) {
+ if (0 < pix[0]) { f_col = 1; changed = 1; }
+ if (0 < pix[1]) { f_col = 1; changed = 1; }
+ if (0 < pix[2]) { f_col = 1; changed = 1; }
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ cc = 0;
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ /* Check whether we must continue */
+ if (0 != changed) {
+ cc = 0;
+ if ((0 != ana) && (0 == f_alp)) {
+ cc = 1;
+ }
+ else {
+ if ((0 != anc) && (0 == f_col)) {
+ cc = 1;
+ }
+ else {
+ if (12 < ori_bd) {
+ if (0 != pxo[4]) { cc = 1; }
+ if (0 != pxo[3]) { cc = 1; }
+ if (0 != pxo[2]) { cc = 1; }
+ if (0 != pxo[1]) { cc = 1; }
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ else {
+ if (8 < ori_bd) {
+ if (0 != pxo[3]) { cc = 1; }
+ if (0 != pxo[2]) { cc = 1; }
+ if (0 != pxo[1]) { cc = 1; }
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ else {
+ if (4 < ori_bd) {
+ if (0 != pxo[2]) { cc = 1; }
+ if (0 != pxo[1]) { cc = 1; }
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ else {
+ if (2 < ori_bd) {
+ if (0 != pxo[1]) { cc = 1; }
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ else {
+ if (1 < ori_bd) {
+ if (0 != pxo[0]) { cc = 1; }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* Transfer results to result variables
+ */
+ if (0 != back) {
+ if (NULL != pcs) {
+ /* Set result color space */
+ switch (ori_cs) {
+ case DK4_CS_GRAY : {
+ *pcs = DK4_CS_GRAY;
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ if ((0 != f_alp) || (0 == ana)) {
+ *pcs = DK4_CS_GRAY_ALPHA;
+ }
+ else {
+ *pcs = DK4_CS_GRAY;
+ }
+ } break;
+ case DK4_CS_RGB : {
+ if (0 != f_col) {
+ *pcs = DK4_CS_RGB;
+ }
+ else {
+ *pcs = DK4_CS_GRAY;
+ }
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ if ((0 != f_alp) || (0 == ana)) {
+ if (0 != f_col) {
+ *pcs = DK4_CS_RGB_ALPHA;
+ }
+ else {
+ *pcs = DK4_CS_GRAY_ALPHA;
+ }
+ }
+ else {
+ if (0 != f_col) {
+ *pcs = DK4_CS_RGB;
+ }
+ else {
+ *pcs = DK4_CS_GRAY;
+ }
+ }
+ } break;
+ case DK4_CS_CMYK : {
+ if (0 != f_col) {
+ *pcs = DK4_CS_CMYK;
+ }
+ else {
+ *pcs = DK4_CS_GRAY;
+ }
+ } break;
+ }
+ }
+ if (NULL != pbd) {
+ /* Set result bit depth */
+ if (0 != pxo[0]) {
+ *pbd = 1;
+ }
+ else {
+ if (0 != pxo[1]) {
+ *pbd = 2;
+ }
+ else {
+ if (0 != pxo[2]) {
+ *pbd = 4;
+ }
+ else {
+ if (0 != pxo[3]) {
+ *pbd = 8;
+ }
+ else {
+ if (0 != pxo[4]) {
+ *pbd = 12;
+ }
+ else {
+ if (1 < ori_bd) {
+ if (2 < ori_bd) {
+ if (4 < ori_bd) {
+ if (8 < ori_bd) {
+ *pbd = 12;
+ }
+ else {
+ *pbd = 8;
+ }
+ }
+ else {
+ *pbd = 4;
+ }
+ }
+ else {
+ *pbd = 2;
+ }
+ }
+ else {
+ *pbd = 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ finished:
+#if TRACE_DEBUG
+ if (NULL != pcs) {
+ $? ". new cs = %d", *pcs
+ }
+ if (NULL != pbd) {
+ $? ". new bd = %u", (unsigned)(*pbd)
+ }
+#endif
+ $? "- dk4bif_analyze"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4bifa.h b/support/dktools/dk4bifa.h
new file mode 100644
index 0000000000..60c73fabee
--- /dev/null
+++ b/support/dktools/dk4bifa.h
@@ -0,0 +1,97 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifa.ctr
+*/
+
+#ifndef DK4BIFA_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4BIFA_H_INCLUDED 1
+
+
+#line 9 "dk4bifa.ctr"
+
+/** @file dk4bifa.h Bitmap image file analysis.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bifty.h"
+#else
+#include <dktools-4/dk4bifty.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Analyze bitmap image file, apply the following tests:
+ - If the image is RGB or CMYK, if R=G=B or C=M=Y for each pixel,
+ writing gray output is sufficient.
+ - If the image contains an alpha channel and alpha data indicates
+ full opacity for all pixels, we can ignore the alpha channel.
+ - If we can reduce the number of bits per component (bits per sample)
+ for all samples of all pixels without quality loss, do so.
+
+ @param pcs Address of color space variable (in/out).
+ @param pbd Address of bit depth (in/out).
+ @param bif Bitmap image file.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze color usage.
+ @param ana Flag: Analyze alpha channel usage.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if:
+ - bif is NULL,
+ - pcs is NULL while color or alpha analysis is requested, or
+ - pbd is NULL while bit depth analysis is requested.
+ - DK4_E_SYNTAX<br>
+ if an error occured while retrieving a pixel.
+*/
+
+int
+dk4bif_analyze(
+ int *pcs,
+ dk4_px_bit_depth_t *pbd,
+ dk4_bif_t const *bif,
+ int anb,
+ int anc,
+ int ana,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4bifap.c b/support/dktools/dk4bifap.c
new file mode 100644
index 0000000000..7eab24b9a8
--- /dev/null
+++ b/support/dktools/dk4bifap.c
@@ -0,0 +1,493 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifap.ctr
+*/
+
+/** @file dk4bifap.c The dk4bifap module.
+*/
+
+
+#line 130 "dk4bifap.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4BIFAP_H_INCLUDED
+#include "dk4bifap.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4MAODD_H_INCLUDED
+#include "dk4maodd.h"
+#endif
+
+#ifndef DK4MAODDBL_H_INCLUDED
+#include "dk4maoddbl.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+#line 177 "dk4bifap.ctr"
+
+
+
+/** File name dummy to use when processing standard input.
+*/
+static const dkChar dk4bifap_def_fn[] = { dkT("<stdin>") };
+
+
+
+/** File name of string table for localizted texts.
+*/
+static const dkChar dk4bifap_str[] = { dkT("dk4bif.str") };
+
+
+
+/** Default texts for diagnostic messages if localized texts are not found.
+*/
+static const dkChar * const dk4bifap_kw[] = {
+/* 0 */
+dkT("File suffix does not inidicate a known image type!"),
+
+/* 1 */
+dkT("Failed to open image!"),
+
+/* 2 */
+dkT("Syntax error, file probably damaged!"),
+
+/* 3 */
+dkT("Failed to open and/or read file!"),
+
+/* 4 */
+dkT("File type not supported!"),
+
+/* 5 */
+dkT("Invalid arguments provided to function call, probably bug!"),
+
+/* 6 */
+dkT("Unusual maxval "),
+
+/* 7 */
+dkT("!\n\tMay result in color distorsion!"),
+
+/* 8 */
+dkT("Aspect ratio changed!\n\tChanging resolution from "),
+
+/* 9 */
+dkT("/"),
+
+/* 10 */
+dkT(" to "),
+
+/* 11 */
+dkT("/"),
+
+/* 12 */
+dkT(" dpi.\n\tThis will probably result in an image distorsion."),
+
+NULL
+
+
+#line 237 "dk4bifap.ctr"
+};
+
+
+
+/** Report error using one text fragment.
+ @param app Application structure.
+ @param si Index of text fragment in dk4bifap_kw or
+ list of localized texts.
+*/
+static
+void
+dk4bifap_error_1(
+ dk4_app_t *app,
+ size_t si
+)
+{
+ const dkChar * const *msg = dk4bifap_kw; /* Localized texs */
+ size_t sz_msg; /* Size of msg array */
+
+ sz_msg = dk4app_string_table_size(dk4bifap_kw);
+ msg = dk4app_string_table(app, dk4bifap_str, dk4bifap_kw);
+ dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, si);
+}
+
+
+
+/** Report errors from attempt to open a bitmap image file.
+ @param fn File name to read.
+ @param erp Error report containing error information.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+static
+void
+dk4bif_error_open_app(
+ dkChar const *fn,
+ dk4_er_t *erp,
+ dk4_app_t *app
+)
+{
+ dkChar const *oldsourcefile; /* Previous source file name to save */
+ dk4_um_t oldsourceline; /* Previous source line no to save */
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ if (NULL == fn) { fn = dk4bifap_def_fn; }
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, 0UL);
+ dk4bifap_error_1(app, 1);
+ switch (erp->ec) {
+ case DK4_E_MEMORY_ALLOCATION_FAILED : {
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ } break;
+ case DK4_E_SYNTAX : {
+ dk4bifap_error_1(app, 2);
+ } break;
+ case DK4_E_MATH_OVERFLOW : {
+ dk4app_log_base1(app, DK4_LL_ERROR, 82);
+ } break;
+ case DK4_E_NOT_FOUND : {
+ dk4bifap_error_1(app, 0);
+ } break;
+ case DK4_E_READ_FAILED : {
+ dk4bifap_error_1(app, 3);
+ } break;
+ case DK4_E_NOT_SUPPORTED : {
+ dk4bifap_error_1(app, 4);
+ } break;
+ case DK4_E_INVALID_ARGUMENTS : {
+ dk4bifap_error_1(app, 5);
+ } break;
+ }
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+}
+
+
+
+/** Check whether the bitmap image file is NetPBM type and has an
+ unusual maxval, report unusual maxval.
+ @param bif Bitmap image file to check.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+static
+void
+dk4bifap_check_netpbm_maxval(
+ dk4_bif_t *bif,
+ dk4_app_t *app
+)
+{
+ dkChar buf[16*sizeof(dk4_um_t)]; /* Buffer */
+ dkChar const * const *msg = dk4bifap_kw; /* Localized */
+ dkChar const *oldsourcefile; /* Previous src file */
+ dk4_bif_netpbm_per_frame_t *npfd; /* Per-frame data */
+ dk4_bif_frame_t *frptr; /* Current frame */
+ dkChar const *fn = NULL; /* File name */
+ dk4_um_t oldsourceline; /* Previous src line */
+ size_t sz_msg; /* Size of msg array */
+ int res; /* Operation result */
+ dk4_px_t bdspec; /* Maximum value for bpc */
+ dk4_px_t bdmaxv; /* Maxval */
+
+
+#line 337 "dk4bifap.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(NULL != app);
+#endif
+ if ((NULL != bif) && (NULL != app)) {
+ switch (bif->imgtype) {
+ case DK4_BIF_TYPE_NETPBM : {
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ frptr = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL != frptr) {
+ npfd = (dk4_bif_netpbm_per_frame_t *)(frptr->tsdata);
+ bdspec = dk4pxbit_get_max(npfd->bpc);
+ bdmaxv = npfd->maxval;
+ if (bdspec != bdmaxv) {
+ fn = bif->filename;
+ res = dk4ma_write_decimal_unsigned(
+ buf, DK4_SIZEOF(buf,dkChar), bdmaxv, 0, NULL
+ );
+ if (0 != res) {
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ sz_msg = dk4app_string_table_size(dk4bifap_kw);
+ msg = dk4app_string_table(
+ app, dk4bifap_str, dk4bifap_kw
+ );
+ dk4app_log_3(
+ app, msg, sz_msg, DK4_LL_WARNING, 6, 7, buf
+ );
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ }
+ }
+ }
+ } while (NULL != frptr);
+ dk4sto_it_reset(bif->i_frames);
+ } break;
+ }
+ }
+
+
+#line 379 "dk4bifap.ctr"
+}
+
+
+
+dk4_bif_t *
+dk4bif_open_app(
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er; /* Error report */
+ dk4_bif_t *back = NULL; /* Function result */
+
+
+#line 394 "dk4bifap.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ dk4error_init(&er);
+ back = dk4bif_open(fn, honly, pcsctx, &er);
+ if ((NULL == back) && (NULL != app)) {
+
+
+#line 401 "dk4bifap.ctr"
+ dk4bif_error_open_app(fn, &er, app);
+ }
+ if (NULL != back) {
+
+
+#line 405 "dk4bifap.ctr"
+ dk4bifap_check_netpbm_maxval(back, app);
+ }
+
+
+#line 408 "dk4bifap.ctr"
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bif_open_file_app(
+ FILE *fipo,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_bif_t *back = NULL;
+
+
+#line 426 "dk4bifap.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ dk4error_init(&er);
+ back = dk4bif_open_file(fipo, fn, ty, honly, pcsctx, &er);
+ if ((NULL == back) && (NULL != app)) {
+
+
+#line 433 "dk4bifap.ctr"
+ dk4bif_error_open_app(fn, &er, app);
+ }
+ if (NULL != back) {
+
+
+#line 437 "dk4bifap.ctr"
+ dk4bifap_check_netpbm_maxval(back, app);
+ }
+
+
+#line 440 "dk4bifap.ctr"
+ return back;
+}
+
+
+
+int
+dk4bif_type_for_suffix_app(
+ dkChar const *fn,
+ dk4_app_t *app
+)
+{
+ const dkChar *oldsourcefile = NULL; /* Previous source file name */
+ dk4_um_t oldsourceline = 0UL; /* Previous source line no */
+ int back = -1;
+
+
+#line 455 "dk4bifap.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL != fn) {
+ back = dk4bif_type_for_suffix(fn);
+ if ((0 > back) && (NULL != app)) {
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, 0UL);
+ /* ##### ERROR: Not a known bitmap image file type */
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ }
+ }
+
+
+#line 471 "dk4bifap.ctr"
+ return back;
+}
+
+
+
+void
+dk4bif_warn_aspect_ratio_change(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_app_t *app
+)
+{
+ dkChar b1[64];
+ dkChar b2[64];
+ dkChar b3[64];
+ dkChar b4[64];
+ const dkChar *p[16];
+ const dkChar * const *msg = dk4bifap_kw;
+
+
+#line 491 "dk4bifap.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ dk4ma_write_double(b1, 64, bif->cf->res_x, 0, 1, NULL);
+ dk4ma_write_double(b2, 64, bif->cf->res_y, 0, 1, NULL);
+ dk4ma_write_double(b3, 64, xres, 0, 1, NULL);
+ dk4ma_write_double(b4, 64, yres, 0, 1, NULL);
+ /* WARNING: Resolution setting changes aspect ratio */
+ msg = dk4app_string_table(app, dk4bifap_str, dk4bifap_kw);
+ p[0] = msg[8];
+ p[1] = b1;
+ p[2] = msg[9];
+ p[3] = b2;
+ p[4] = msg[10];
+ p[5] = b3;
+ p[6] = msg[11];
+ p[7] = b4;
+ p[8] = msg[12];
+ dk4app_log_msg(app, DK4_LL_WARNING, p, 9);
+
+
+#line 511 "dk4bifap.ctr"
+}
+
+
+
+int
+dk4bif_set_res_app(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_app_t *app
+)
+{
+ double qo; /* Quotient of old resolutions */
+ double qn; /* Quotient of new resolutions */
+ int back = 0;
+
+
+#line 527 "dk4bifap.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(0.0 < xres);
+ assert(0.0 < yres);
+#endif
+ if ((NULL != bif) && (0.0 < xres) && (0.0 < yres)) {
+
+#line 533 "dk4bifap.ctr"
+ if (NULL != bif->cf) {
+
+#line 534 "dk4bifap.ctr"
+ if ((0.0 < bif->cf->res_x) && (0.0 < bif->cf->res_y)) {
+
+
+#line 536 "dk4bifap.ctr"
+ qo = bif->cf->res_y / bif->cf->res_x;
+ qn = yres / xres;
+ if ((0 != dk4ma_is_finite(qo)) && (0 != dk4ma_is_finite(qn))) {
+ if (DK4_BIF_EPSILON_ASPECT <= fabs(qn - qo)) {
+
+#line 540 "dk4bifap.ctr"
+ dk4bif_warn_aspect_ratio_change(
+ bif, xres, yres, app
+ );
+ }
+ }
+ }
+ bif->cf->res_x = xres;
+ bif->cf->res_y = yres;
+ back = 1;
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ }
+
+
+#line 555 "dk4bifap.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifap.ctr b/support/dktools/dk4bifap.ctr
new file mode 100644
index 0000000000..277bdb7bd1
--- /dev/null
+++ b/support/dktools/dk4bifap.ctr
@@ -0,0 +1,561 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+
+/** @file dk4bifap.h Bitmap image file handling with application support.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bif.h"
+#else
+#include <dktools-4/dk4bif.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open bitmap image file by name.
+ @param fn Input file name.
+ @param honly Flag: Read image header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+*/
+
+dk4_bif_t *
+dk4bif_open_app(
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_app_t *app
+);
+
+
+/** Open bitmap image file by opened FILE.
+ @param fipo File, opened for binary reading.
+ @param fn File name containing the bitmap image.
+ Provide a dummy file name here when processing stdin.
+ @param ty Image file type (PNG, JPEG or TIFF).
+ @param honly Flag: Read image header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+*/
+
+dk4_bif_t *
+dk4bif_open_file_app(
+ FILE *fipo,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_app_t *app
+);
+
+
+/** Find bitmap image file type for file name based on suffix.
+ @param fn File name to find type for.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+int
+dk4bif_type_for_suffix_app(
+ dkChar const *fn,
+ dk4_app_t *app
+);
+
+
+/** Issue warning about aspect ratio change.
+ @param bif Bitmap image file containing data about old resolution.
+ @param xres New x resolution.
+ @param yres New y resolution.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4bif_warn_aspect_ratio_change(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_app_t *app
+);
+
+
+/** Set image resolution.
+ @param bif Bitmap image file.
+ @param xres New x resolution.
+ @param yres New y resolution.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_set_res_app(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_app_t *app
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4BIFAP_H_INCLUDED
+#include "dk4bifap.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4MAODD_H_INCLUDED
+#include "dk4maodd.h"
+#endif
+
+#ifndef DK4MAODDBL_H_INCLUDED
+#include "dk4maoddbl.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+$!trace-include
+
+
+
+/** File name dummy to use when processing standard input.
+*/
+static const dkChar dk4bifap_def_fn[] = { dkT("<stdin>") };
+
+
+
+/** File name of string table for localizted texts.
+*/
+static const dkChar dk4bifap_str[] = { dkT("dk4bif.str") };
+
+
+
+/** Default texts for diagnostic messages if localized texts are not found.
+*/
+static const dkChar * const dk4bifap_kw[] = {
+$!string-table macro=dkT
+#
+# 0 File suffix doest not indicate a known image type
+#
+File suffix does not inidicate a known image type!
+#
+# 1 Failed to open image
+#
+Failed to open image!
+#
+# 2 Syntax error, file probably damaged!
+#
+Syntax error, file probably damaged!
+#
+# 3 Failed to open file for reading!
+#
+Failed to open and/or read file!
+#
+# 4 File type not supported!
+#
+File type not supported!
+#
+# 5 Invalid arguments provided to function call, probably bug!
+#
+Invalid arguments provided to function call, probably bug!
+#
+# 6-7 Unusual maxval ... may result in color distorsion!
+#
+Unusual maxval
+!\n\tMay result in color distorsion!
+#
+# 8-12
+#
+Aspect ratio changed!\n\tChanging resolution from
+/
+ to
+/
+ dpi.\n\tThis will probably result in an image distorsion.
+#
+#
+#
+$!end
+};
+
+
+
+/** Report error using one text fragment.
+ @param app Application structure.
+ @param si Index of text fragment in dk4bifap_kw or
+ list of localized texts.
+*/
+static
+void
+dk4bifap_error_1(
+ dk4_app_t *app,
+ size_t si
+)
+{
+ const dkChar * const *msg = dk4bifap_kw; /* Localized texs */
+ size_t sz_msg; /* Size of msg array */
+
+ sz_msg = dk4app_string_table_size(dk4bifap_kw);
+ msg = dk4app_string_table(app, dk4bifap_str, dk4bifap_kw);
+ dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, si);
+}
+
+
+
+/** Report errors from attempt to open a bitmap image file.
+ @param fn File name to read.
+ @param erp Error report containing error information.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+static
+void
+dk4bif_error_open_app(
+ dkChar const *fn,
+ dk4_er_t *erp,
+ dk4_app_t *app
+)
+{
+ dkChar const *oldsourcefile; /* Previous source file name to save */
+ dk4_um_t oldsourceline; /* Previous source line no to save */
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ if (NULL == fn) { fn = dk4bifap_def_fn; }
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, 0UL);
+ dk4bifap_error_1(app, 1);
+ switch (erp->ec) {
+ case DK4_E_MEMORY_ALLOCATION_FAILED : {
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ } break;
+ case DK4_E_SYNTAX : {
+ dk4bifap_error_1(app, 2);
+ } break;
+ case DK4_E_MATH_OVERFLOW : {
+ dk4app_log_base1(app, DK4_LL_ERROR, 82);
+ } break;
+ case DK4_E_NOT_FOUND : {
+ dk4bifap_error_1(app, 0);
+ } break;
+ case DK4_E_READ_FAILED : {
+ dk4bifap_error_1(app, 3);
+ } break;
+ case DK4_E_NOT_SUPPORTED : {
+ dk4bifap_error_1(app, 4);
+ } break;
+ case DK4_E_INVALID_ARGUMENTS : {
+ dk4bifap_error_1(app, 5);
+ } break;
+ }
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+}
+
+
+
+/** Check whether the bitmap image file is NetPBM type and has an
+ unusual maxval, report unusual maxval.
+ @param bif Bitmap image file to check.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+static
+void
+dk4bifap_check_netpbm_maxval(
+ dk4_bif_t *bif,
+ dk4_app_t *app
+)
+{
+ dkChar buf[16*sizeof(dk4_um_t)]; /* Buffer */
+ dkChar const * const *msg = dk4bifap_kw; /* Localized */
+ dkChar const *oldsourcefile; /* Previous src file */
+ dk4_bif_netpbm_per_frame_t *npfd; /* Per-frame data */
+ dk4_bif_frame_t *frptr; /* Current frame */
+ dkChar const *fn = NULL; /* File name */
+ dk4_um_t oldsourceline; /* Previous src line */
+ size_t sz_msg; /* Size of msg array */
+ int res; /* Operation result */
+ dk4_px_t bdspec; /* Maximum value for bpc */
+ dk4_px_t bdmaxv; /* Maxval */
+ $? "+ dk4bifap_check_netpbm_maxval"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(NULL != app);
+#endif
+ if ((NULL != bif) && (NULL != app)) {
+ switch (bif->imgtype) {
+ case DK4_BIF_TYPE_NETPBM : {
+ dk4sto_it_reset(bif->i_frames);
+ do {
+ frptr = (dk4_bif_frame_t *)dk4sto_it_next(bif->i_frames);
+ if (NULL != frptr) {
+ npfd = (dk4_bif_netpbm_per_frame_t *)(frptr->tsdata);
+ bdspec = dk4pxbit_get_max(npfd->bpc);
+ bdmaxv = npfd->maxval;
+ if (bdspec != bdmaxv) {
+ fn = bif->filename;
+ res = dk4ma_write_decimal_unsigned(
+ buf, DK4_SIZEOF(buf,dkChar), bdmaxv, 0, NULL
+ );
+ if (0 != res) {
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ sz_msg = dk4app_string_table_size(dk4bifap_kw);
+ msg = dk4app_string_table(
+ app, dk4bifap_str, dk4bifap_kw
+ );
+ dk4app_log_3(
+ app, msg, sz_msg, DK4_LL_WARNING, 6, 7, buf
+ );
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ }
+ }
+ }
+ } while (NULL != frptr);
+ dk4sto_it_reset(bif->i_frames);
+ } break;
+ }
+ }
+ $? "- dk4bifap_check_netpbm_maxval"
+}
+
+
+
+dk4_bif_t *
+dk4bif_open_app(
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er; /* Error report */
+ dk4_bif_t *back = NULL; /* Function result */
+ $? "+ dk4bif_open_app \"%!ds\"", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ dk4error_init(&er);
+ back = dk4bif_open(fn, honly, pcsctx, &er);
+ if ((NULL == back) && (NULL != app)) {
+ $? "! failed to open bif"
+ dk4bif_error_open_app(fn, &er, app);
+ }
+ if (NULL != back) {
+ $? ". going to check maxval"
+ dk4bifap_check_netpbm_maxval(back, app);
+ }
+ $? "- dk4bif_open_app %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bif_open_file_app(
+ FILE *fipo,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_bif_t *back = NULL;
+ $? "+ dk4bif_open_file_app %d", TR_IPTR(fipo)
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ dk4error_init(&er);
+ back = dk4bif_open_file(fipo, fn, ty, honly, pcsctx, &er);
+ if ((NULL == back) && (NULL != app)) {
+ $? "! failed to open bif"
+ dk4bif_error_open_app(fn, &er, app);
+ }
+ if (NULL != back) {
+ $? ". going to check maxval"
+ dk4bifap_check_netpbm_maxval(back, app);
+ }
+ $? "- dk4bif_open_file_app %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+dk4bif_type_for_suffix_app(
+ dkChar const *fn,
+ dk4_app_t *app
+)
+{
+ const dkChar *oldsourcefile = NULL; /* Previous source file name */
+ dk4_um_t oldsourceline = 0UL; /* Previous source line no */
+ int back = -1;
+ $? "+ dk4bif_type_for_suffix_app"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL != fn) {
+ back = dk4bif_type_for_suffix(fn);
+ if ((0 > back) && (NULL != app)) {
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, 0UL);
+ /* ##### ERROR: Not a known bitmap image file type */
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ }
+ }
+ $? "- dk4bif_type_for_suffix_app %d", back
+ return back;
+}
+
+
+
+void
+dk4bif_warn_aspect_ratio_change(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_app_t *app
+)
+{
+ dkChar b1[64];
+ dkChar b2[64];
+ dkChar b3[64];
+ dkChar b4[64];
+ const dkChar *p[16];
+ const dkChar * const *msg = dk4bifap_kw;
+ $? "+ dk4bif_warn_aspect_ratio_change"
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+#endif
+ dk4ma_write_double(b1, 64, bif->cf->res_x, 0, 1, NULL);
+ dk4ma_write_double(b2, 64, bif->cf->res_y, 0, 1, NULL);
+ dk4ma_write_double(b3, 64, xres, 0, 1, NULL);
+ dk4ma_write_double(b4, 64, yres, 0, 1, NULL);
+ /* WARNING: Resolution setting changes aspect ratio */
+ msg = dk4app_string_table(app, dk4bifap_str, dk4bifap_kw);
+ p[0] = msg[8];
+ p[1] = b1;
+ p[2] = msg[9];
+ p[3] = b2;
+ p[4] = msg[10];
+ p[5] = b3;
+ p[6] = msg[11];
+ p[7] = b4;
+ p[8] = msg[12];
+ dk4app_log_msg(app, DK4_LL_WARNING, p, 9);
+ $? "- dk4bif_warn_aspect_ratio_change"
+}
+
+
+
+int
+dk4bif_set_res_app(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_app_t *app
+)
+{
+ double qo; /* Quotient of old resolutions */
+ double qn; /* Quotient of new resolutions */
+ int back = 0;
+ $? "+ dk4bif_set_res_app %lg %lg", xres, yres
+#if DK4_USE_ASSERT
+ assert(NULL != bif);
+ assert(0.0 < xres);
+ assert(0.0 < yres);
+#endif
+ if ((NULL != bif) && (0.0 < xres) && (0.0 < yres)) { $? ". args ok"
+ if (NULL != bif->cf) { $? ". have bif"
+ if ((0.0 < bif->cf->res_x) && (0.0 < bif->cf->res_y)) {
+ $? ". res old=%lg/%lg", bif->cf->res_x, bif->cf->res_y
+ qo = bif->cf->res_y / bif->cf->res_x;
+ qn = yres / xres;
+ if ((0 != dk4ma_is_finite(qo)) && (0 != dk4ma_is_finite(qn))) {
+ if (DK4_BIF_EPSILON_ASPECT <= fabs(qn - qo)) { $? ". diff"
+ dk4bif_warn_aspect_ratio_change(
+ bif, xres, yres, app
+ );
+ }
+ }
+ }
+ bif->cf->res_x = xres;
+ bif->cf->res_y = yres;
+ back = 1;
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ }
+ $? "- dk4bif_set_res_app %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifap.h b/support/dktools/dk4bifap.h
new file mode 100644
index 0000000000..c2afcb8b39
--- /dev/null
+++ b/support/dktools/dk4bifap.h
@@ -0,0 +1,143 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifap.ctr
+*/
+
+#ifndef DK4BIFAP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4BIFAP_H_INCLUDED 1
+
+
+#line 7 "dk4bifap.ctr"
+
+
+/** @file dk4bifap.h Bitmap image file handling with application support.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bif.h"
+#else
+#include <dktools-4/dk4bif.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open bitmap image file by name.
+ @param fn Input file name.
+ @param honly Flag: Read image header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+*/
+
+dk4_bif_t *
+dk4bif_open_app(
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_app_t *app
+);
+
+
+/** Open bitmap image file by opened FILE.
+ @param fipo File, opened for binary reading.
+ @param fn File name containing the bitmap image.
+ Provide a dummy file name here when processing stdin.
+ @param ty Image file type (PNG, JPEG or TIFF).
+ @param honly Flag: Read image header only.
+ @param pcsctx Color space conversion context, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to bitmap image file on success, NULL on error.
+*/
+
+dk4_bif_t *
+dk4bif_open_file_app(
+ FILE *fipo,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_app_t *app
+);
+
+
+/** Find bitmap image file type for file name based on suffix.
+ @param fn File name to find type for.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+int
+dk4bif_type_for_suffix_app(
+ dkChar const *fn,
+ dk4_app_t *app
+);
+
+
+/** Issue warning about aspect ratio change.
+ @param bif Bitmap image file containing data about old resolution.
+ @param xres New x resolution.
+ @param yres New y resolution.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4bif_warn_aspect_ratio_change(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_app_t *app
+);
+
+
+/** Set image resolution.
+ @param bif Bitmap image file.
+ @param xres New x resolution.
+ @param yres New y resolution.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4bif_set_res_app(
+ dk4_bif_t *bif,
+ double xres,
+ double yres,
+ dk4_app_t *app
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/dk4bifj.c b/support/dktools/dk4bifj.c
new file mode 100644
index 0000000000..260372dc18
--- /dev/null
+++ b/support/dktools/dk4bifj.c
@@ -0,0 +1,540 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifj.ctr
+*/
+
+/** @file dk4bifj.c The dk4bifj module.
+*/
+
+
+#line 7 "dk4bifj.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_JPEGLIB_H
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef JPEGLIB_H_INCLUDED
+#include <jpeglib.h>
+#define JPEGLIB_H_INCLUDED 1
+#endif
+
+#if DK4_HAVE_SETJMP_H
+#ifndef SETJMP_H_INCLUDED
+#include <setjmp.h>
+#define SETJMP_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 53 "dk4bifj.ctr"
+
+
+
+/** Error manager for jpeglib.
+*/
+typedef struct {
+ struct jpeg_error_mgr errmgr; /**< Default error manager. */
+#if DK4_HAVE_SETJMP_H
+ jmp_buf jump_buf; /**< Longjump buffer. */
+#endif
+} dk4_bif_jpeg_error_mgr;
+
+
+
+/** Routine called instead of simple exit on failures.
+ @param cinfo Object containing address of error manager.
+*/
+static
+void
+dk4bifjpb_error_exit(j_common_ptr cinfo)
+{
+ dk4_bif_jpeg_error_mgr *errmgr; /* Error manager structure */
+
+
+#line 76 "dk4bifj.ctr"
+ errmgr = (dk4_bif_jpeg_error_mgr *)(cinfo->err);
+ if (NULL != errmgr) {
+ longjmp(errmgr->jump_buf, 1);
+ }
+
+
+#line 81 "dk4bifj.ctr"
+}
+
+
+
+void
+dk4bifjpeg_nc_release_per_frame_data(
+ void *tsdata,
+ dk4_bif_frame_t *frptr
+)
+{
+ JSAMPLE **rptr; /* Array of row pointers */
+ dk4_bif_jpeg_per_frame_t *jfptr; /* Per-frame data */
+ JDIMENSION i; /* Traverse all lines */
+
+
+
+#line 96 "dk4bifj.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+ assert(NULL != frptr);
+#endif
+ jfptr = (dk4_bif_jpeg_per_frame_t *)tsdata;
+ if (NULL != jfptr) {
+ rptr = jfptr->rows;
+ if (NULL != rptr) {
+
+#line 104 "dk4bifj.ctr"
+ for (i = 0; (dk4_bif_dim_t)i < frptr->dim_y; i++) {
+
+
+#line 106 "dk4bifj.ctr"
+ if (NULL != *rptr) { dk4mem_free(*rptr); }
+ rptr++;
+ }
+
+
+#line 110 "dk4bifj.ctr"
+ dk4mem_free(jfptr->rows);
+ }
+
+
+#line 113 "dk4bifj.ctr"
+ dk4mem_free(jfptr);
+ }
+
+
+#line 116 "dk4bifj.ctr"
+}
+
+
+
+/** Transfer information from JPEG structures into BIF structures.
+ @param bifp Bitmap image file to modify.
+ @param pfd Per-frame data structure to modify.
+ @param cinfo JPEG decompression structure (data source).
+ @param sov Flag: Set output variables in cinfo.
+*/
+static
+void
+dk4bifjpeg_transfer_header_data(
+ dk4_bif_t *bifp,
+ dk4_bif_jpeg_per_frame_t *pfd,
+ struct jpeg_decompress_struct *cinfo,
+ int sov
+)
+{
+
+
+#line 136 "dk4bifj.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bifp);
+ assert(NULL != pfd);
+ assert(NULL != cinfo);
+#endif
+ bifp->cf->dim_x = cinfo->image_width;
+
+
+#line 143 "dk4bifj.ctr"
+ bifp->cf->dim_y = cinfo->image_height;
+
+
+#line 145 "dk4bifj.ctr"
+ bifp->cf->l_bdepth = BITS_IN_JSAMPLE;
+
+
+#line 147 "dk4bifj.ctr"
+ bifp->cf->r_bdepth = BITS_IN_JSAMPLE;
+
+
+#line 149 "dk4bifj.ctr"
+
+
+#line 150 "dk4bifj.ctr"
+ bifp->cf->bg[0] = MAXJSAMPLE;
+ bifp->cf->bg[1] = MAXJSAMPLE;
+ bifp->cf->bg[2] = MAXJSAMPLE;
+ bifp->cf->bg[3] = MAXJSAMPLE;
+ bifp->cf->bglbd[0] = MAXJSAMPLE;
+ bifp->cf->bglbd[1] = MAXJSAMPLE;
+ bifp->cf->bglbd[2] = MAXJSAMPLE;
+ bifp->cf->bglbd[3] = MAXJSAMPLE;
+ dk4pxres_setup(&(bifp->cf->resampler), MAXJSAMPLE, MAXJSAMPLE);
+ bifp->cf->n_comp = cinfo->out_color_components;
+
+
+#line 161 "dk4bifj.ctr"
+ bifp->cf->hbg = 0;
+ bifp->cf->res_x = -1.0;
+ bifp->cf->res_y = -1.0;
+ if (0 != cinfo->saw_JFIF_marker) {
+ if ((0 < cinfo->X_density) && (0 < cinfo->Y_density)) {
+ bifp->cf->res_x = (double)(cinfo->X_density);
+ bifp->cf->res_y = (double)(cinfo->Y_density);
+
+
+#line 169 "dk4bifj.ctr"
+
+
+#line 170 "dk4bifj.ctr"
+ if (2 == cinfo->density_unit) {
+
+#line 171 "dk4bifj.ctr"
+ bifp->cf->res_x *= 2.54;
+ bifp->cf->res_y *= 2.54;
+
+
+#line 174 "dk4bifj.ctr"
+
+
+#line 175 "dk4bifj.ctr"
+ }
+ if (1 != cinfo->density_unit) {
+ bifp->cf->res_x = -1.0;
+ bifp->cf->res_y = -1.0;
+ }
+ }
+ }
+ switch (cinfo->jpeg_color_space) {
+ case JCS_GRAYSCALE: {
+
+#line 184 "dk4bifj.ctr"
+ bifp->cf->l_cs = DK4_CS_GRAY;
+ bifp->cf->f_cs = DK4_CS_GRAY;
+ if (0 != sov) {
+ cinfo->out_color_space = JCS_GRAYSCALE;
+ }
+ } break;
+ case JCS_CMYK: {
+
+#line 191 "dk4bifj.ctr"
+ bifp->cf->l_cs = DK4_CS_CMYK;
+ bifp->cf->f_cs = DK4_CS_CMYK;
+ if (0 != sov) {
+ cinfo->out_color_space = JCS_CMYK;
+ }
+ } break;
+ /*
+ 2018-03-20
+ If the library internal color space is JCS_YCCK or JCS_YCbCr
+ the library functions to access pixel data deliver RGB values.
+ So the default branch sets the color space to RGB.
+ */
+#if 0
+ case JCS_RGB: {
+
+#line 205 "dk4bifj.ctr"
+ bifp->cf->l_cs = DK4_CS_RGB;
+ bifp->cf->f_cs = DK4_CS_RGB;
+ } break;
+ case JCS_YCCK: {
+
+#line 209 "dk4bifj.ctr"
+ bifp->cf->l_cs = DK4_CS_CMYK;
+ bifp->cf->f_cs = DK4_CS_CMYK;
+ } break;
+ case JCS_YCbCr: {
+
+#line 213 "dk4bifj.ctr"
+ bifp->cf->l_cs = DK4_CS_CMYK;
+ bifp->cf->f_cs = DK4_CS_CMYK;
+ } break;
+#endif
+ default: {
+
+#line 218 "dk4bifj.ctr"
+ bifp->cf->l_cs = DK4_CS_RGB;
+ bifp->cf->f_cs = DK4_CS_RGB;
+ if (0 != sov) {
+ cinfo->out_color_space = JCS_RGB;
+ }
+ } break;
+ }
+ pfd->num_comp = cinfo->out_color_components;
+
+
+#line 227 "dk4bifj.ctr"
+ pfd->is_adobe = ((0 != cinfo->saw_Adobe_marker) ? 1 : 0);
+
+
+#line 229 "dk4bifj.ctr"
+
+
+#line 230 "dk4bifj.ctr"
+}
+
+
+
+dk4_bif_t *
+dk4bifjpeg_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_bif_jpg_clobbered_t *jpgcp,
+ dk4_er_t *erp
+)
+{
+ struct jpeg_decompress_struct cinfo; /* Jpeglib reader */
+ dk4_bif_jpeg_error_mgr errmgr; /* Jpeglib error man */
+ dk4_er_t er; /* Error report */
+ JSAMPLE **xrptr = NULL; /* Travers rows */
+ dk4_bif_jpeg_per_frame_t *pfd = NULL; /* Per-frame data */
+ size_t bpl = 0; /* Bits per line */
+ size_t i = 0; /* Traverse rows */
+
+
+#line 252 "dk4bifj.ctr"
+
+ /* Create bif and frame for one-frame image
+ */
+ jpgcp->back = dk4biftool_nc_new_for_one_frame(
+ fn, DK4_BIF_TYPE_JPEG, honly, pcsctx, erp
+ );
+ if (NULL == jpgcp->back) { goto finished; }
+
+
+#line 260 "dk4bifj.ctr"
+
+ /* Allocate per-frame data structure
+ */
+ pfd = dk4mem_new(dk4_bif_jpeg_per_frame_t,1,NULL);
+ if (NULL == pfd) { goto finished; }
+ (jpgcp->back->cf)->tsdata = pfd;
+
+
+#line 267 "dk4bifj.ctr"
+
+ /* Initialize per-frame data structure components
+ */
+ pfd->rows = NULL;
+ pfd->num_comp = 0;
+ pfd->is_adobe = 0;
+
+ /* Set up error management
+ */
+ cinfo.err = jpeg_std_error(&(errmgr.errmgr));
+ errmgr.errmgr.error_exit = dk4bifjpb_error_exit;
+
+
+#line 279 "dk4bifj.ctr"
+
+ /* Code below calls setjmp on error
+ */
+ if (0 != setjmp(errmgr.jump_buf)) {
+
+#line 283 "dk4bifj.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+
+ /* Create decompression structure
+ */
+ jpgcp->st = 1;
+ jpeg_create_decompress(&cinfo);
+
+
+#line 292 "dk4bifj.ctr"
+
+ /* Specify data source
+ */
+ jpeg_stdio_src(&cinfo, fipo);
+
+
+#line 297 "dk4bifj.ctr"
+
+ /* Read JPEG header data
+ */
+ jpeg_read_header(&cinfo, TRUE);
+
+
+#line 302 "dk4bifj.ctr"
+
+ /* Transfer header data to bif structures.
+ */
+ dk4bifjpeg_transfer_header_data(jpgcp->back, pfd, &cinfo, 1);
+
+
+#line 307 "dk4bifj.ctr"
+
+ /* When reading just the header we are done here
+ */
+ if (0 != honly) {
+ jpgcp->ok = 1;
+
+
+#line 313 "dk4bifj.ctr"
+ goto finished;
+ }
+
+ /* Start decompression
+ */
+ jpeg_start_decompress(&cinfo);
+
+
+#line 320 "dk4bifj.ctr"
+
+ /* Header data are now corrected if necessary, read information again
+ */
+ dk4bifjpeg_transfer_header_data(jpgcp->back, pfd, &cinfo, 0);
+
+
+#line 325 "dk4bifj.ctr"
+
+ /* Allocate memory for image data
+ */
+ dk4error_init(&er);
+ bpl = dk4ma_size_t_mul(jpgcp->back->cf->dim_x, jpgcp->back->cf->n_comp, &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ goto finished;
+ }
+ pfd->rows = dk4mem_new(JSAMPROW,jpgcp->back->cf->dim_y,erp);
+ if (NULL == pfd->rows) { goto finished; }
+ xrptr = pfd->rows;
+ for (i = 0; i < (size_t)(jpgcp->back->cf->dim_y); i++) { *(xrptr++) = NULL; }
+ xrptr = pfd->rows;
+ for (i = 0; i < (size_t)(jpgcp->back->cf->dim_y); i++) {
+ *xrptr = dk4mem_new(JSAMPLE,bpl,erp);
+ if (NULL == *xrptr) {
+ goto finished;
+ }
+ xrptr++;
+ }
+
+
+#line 347 "dk4bifj.ctr"
+
+ /* Read and decompress data
+ */
+ xrptr = pfd->rows;
+ for (i = 0; i < (size_t)(jpgcp->back->cf->dim_y); i++) {
+ jpeg_read_scanlines(&cinfo, xrptr, 1);
+ xrptr++;
+ }
+
+
+#line 356 "dk4bifj.ctr"
+
+ /* Finish decompression
+ */
+ jpeg_finish_decompress(&cinfo);
+
+
+#line 361 "dk4bifj.ctr"
+
+ /* Everything done, success
+ */
+ jpgcp->ok = 1;
+
+ finished:
+ /*
+ Destroy decompression structure
+ */
+ if (0 < jpgcp->st) {
+ jpeg_destroy_decompress(&cinfo);
+ }
+ if (0 == jpgcp->ok) {
+ if (NULL != jpgcp->back) {
+ dk4bif_close(jpgcp->back);
+ jpgcp->back = NULL;
+ }
+ }
+
+
+
+#line 381 "dk4bifj.ctr"
+ return jpgcp->back;
+}
+
+
+
+int
+dk4bifjpeg_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ dk4_er_t er; /* Error report for math op */
+ dk4_bif_jpeg_per_frame_t *pfd = NULL; /* Per-frame data */
+ size_t spos; /* Number of values per row */
+ size_t i; /* Traverse all components */
+ int back = 0;
+
+
+#line 401 "dk4bifj.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != bif);
+#endif
+ pfd = (dk4_bif_jpeg_per_frame_t *)((bif->cf)->tsdata);
+ if (NULL != pfd) {
+ if (NULL != pfd->rows) {
+ dk4error_init(&er);
+ spos = dk4ma_size_t_mul(colno, pfd->num_comp, &er);
+ (void)dk4ma_size_t_add(spos, pfd->num_comp, &er);
+ if (DK4_E_NONE == er.ec) {
+ if (szdptr >= pfd->num_comp) {
+ for (i = 0; i < pfd->num_comp; i++) {
+ dptr[i] = ((pfd->rows)[rowno])[spos + i];
+ }
+ back = 1;
+ }
+ }
+ }
+ }
+
+
+#line 423 "dk4bifj.ctr"
+ return back;
+}
+
+
+#endif
+/* if DK4_HAVE_JPEGLIB_H */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifj.ctr b/support/dktools/dk4bifj.ctr
new file mode 100644
index 0000000000..59638e2091
--- /dev/null
+++ b/support/dktools/dk4bifj.ctr
@@ -0,0 +1,432 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_JPEGLIB_H
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef JPEGLIB_H_INCLUDED
+#include <jpeglib.h>
+#define JPEGLIB_H_INCLUDED 1
+#endif
+
+#if DK4_HAVE_SETJMP_H
+#ifndef SETJMP_H_INCLUDED
+#include <setjmp.h>
+#define SETJMP_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Error manager for jpeglib.
+*/
+typedef struct {
+ struct jpeg_error_mgr errmgr; /**< Default error manager. */
+#if DK4_HAVE_SETJMP_H
+ jmp_buf jump_buf; /**< Longjump buffer. */
+#endif
+} dk4_bif_jpeg_error_mgr;
+
+
+
+/** Routine called instead of simple exit on failures.
+ @param cinfo Object containing address of error manager.
+*/
+static
+void
+dk4bifjpb_error_exit(j_common_ptr cinfo)
+{
+ dk4_bif_jpeg_error_mgr *errmgr; /* Error manager structure */
+ $? "+ dk4bifjpb_error_exit"
+ errmgr = (dk4_bif_jpeg_error_mgr *)(cinfo->err);
+ if (NULL != errmgr) {
+ longjmp(errmgr->jump_buf, 1);
+ }
+ $? "- dk4bifjpb_error_exit"
+}
+
+
+
+void
+dk4bifjpeg_nc_release_per_frame_data(
+ void *tsdata,
+ dk4_bif_frame_t *frptr
+)
+{
+ JSAMPLE **rptr; /* Array of row pointers */
+ dk4_bif_jpeg_per_frame_t *jfptr; /* Per-frame data */
+ JDIMENSION i; /* Traverse all lines */
+
+ $? "+ dk4bifjpeg_nc_release_per_frame_data"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+ assert(NULL != frptr);
+#endif
+ jfptr = (dk4_bif_jpeg_per_frame_t *)tsdata;
+ if (NULL != jfptr) {
+ rptr = jfptr->rows;
+ if (NULL != rptr) { $? ". have rows"
+ for (i = 0; (dk4_bif_dim_t)i < frptr->dim_y; i++) {
+ $? ". release row %u", (unsigned)i
+ if (NULL != *rptr) { dk4mem_free(*rptr); }
+ rptr++;
+ }
+ $? ". release rows"
+ dk4mem_free(jfptr->rows);
+ }
+ $? ". release jfptr"
+ dk4mem_free(jfptr);
+ }
+ $? "- dk4bifjpeg_nc_release_per_frame_data"
+}
+
+
+
+/** Transfer information from JPEG structures into BIF structures.
+ @param bifp Bitmap image file to modify.
+ @param pfd Per-frame data structure to modify.
+ @param cinfo JPEG decompression structure (data source).
+ @param sov Flag: Set output variables in cinfo.
+*/
+static
+void
+dk4bifjpeg_transfer_header_data(
+ dk4_bif_t *bifp,
+ dk4_bif_jpeg_per_frame_t *pfd,
+ struct jpeg_decompress_struct *cinfo,
+ int sov
+)
+{
+ $? "+ dk4bifjpeg_transfer_header_data"
+#if DK4_USE_ASSERT
+ assert(NULL != bifp);
+ assert(NULL != pfd);
+ assert(NULL != cinfo);
+#endif
+ bifp->cf->dim_x = cinfo->image_width;
+ $? ". w = %u", (unsigned)(bifp->cf->dim_x)
+ bifp->cf->dim_y = cinfo->image_height;
+ $? ". h = %u", (unsigned)(bifp->cf->dim_y)
+ bifp->cf->l_bdepth = BITS_IN_JSAMPLE;
+ $? ". library bit depth = %u", (unsigned)(bifp->cf->l_bdepth)
+ bifp->cf->r_bdepth = BITS_IN_JSAMPLE;
+ $? ". requested bit depth = %u", (unsigned)(bifp->cf->r_bdepth)
+ $? ". background = %u", (unsigned)(MAXJSAMPLE)
+ bifp->cf->bg[0] = MAXJSAMPLE;
+ bifp->cf->bg[1] = MAXJSAMPLE;
+ bifp->cf->bg[2] = MAXJSAMPLE;
+ bifp->cf->bg[3] = MAXJSAMPLE;
+ bifp->cf->bglbd[0] = MAXJSAMPLE;
+ bifp->cf->bglbd[1] = MAXJSAMPLE;
+ bifp->cf->bglbd[2] = MAXJSAMPLE;
+ bifp->cf->bglbd[3] = MAXJSAMPLE;
+ dk4pxres_setup(&(bifp->cf->resampler), MAXJSAMPLE, MAXJSAMPLE);
+ bifp->cf->n_comp = cinfo->out_color_components;
+ $? ". color components = %u", (unsigned)(bifp->cf->n_comp)
+ bifp->cf->hbg = 0;
+ bifp->cf->res_x = -1.0;
+ bifp->cf->res_y = -1.0;
+ if (0 != cinfo->saw_JFIF_marker) {
+ if ((0 < cinfo->X_density) && (0 < cinfo->Y_density)) {
+ bifp->cf->res_x = (double)(cinfo->X_density);
+ bifp->cf->res_y = (double)(cinfo->Y_density);
+ $? ". x resolution = %g", bifp->cf->res_x
+ $? ". y resolution = %g", bifp->cf->res_y
+ if (2 == cinfo->density_unit) { $? ". resolution is in cm"
+ bifp->cf->res_x *= 2.54;
+ bifp->cf->res_y *= 2.54;
+ $? ". x resolution = %g", bifp->cf->res_x
+ $? ". y resolution = %g", bifp->cf->res_y
+ }
+ if (1 != cinfo->density_unit) {
+ bifp->cf->res_x = -1.0;
+ bifp->cf->res_y = -1.0;
+ }
+ }
+ }
+ switch (cinfo->jpeg_color_space) {
+ case JCS_GRAYSCALE: { $? ". color space = JCS_GRAYSCALE"
+ bifp->cf->l_cs = DK4_CS_GRAY;
+ bifp->cf->f_cs = DK4_CS_GRAY;
+ if (0 != sov) {
+ cinfo->out_color_space = JCS_GRAYSCALE;
+ }
+ } break;
+ case JCS_CMYK: { $? ". color space = JCS_CMYK"
+ bifp->cf->l_cs = DK4_CS_CMYK;
+ bifp->cf->f_cs = DK4_CS_CMYK;
+ if (0 != sov) {
+ cinfo->out_color_space = JCS_CMYK;
+ }
+ } break;
+ /*
+ 2018-03-20
+ If the library internal color space is JCS_YCCK or JCS_YCbCr
+ the library functions to access pixel data deliver RGB values.
+ So the default branch sets the color space to RGB.
+ */
+#if 0
+ case JCS_RGB: { $? ". color space = JCS_RGB"
+ bifp->cf->l_cs = DK4_CS_RGB;
+ bifp->cf->f_cs = DK4_CS_RGB;
+ } break;
+ case JCS_YCCK: { $? ". color space = JCS_YCCK"
+ bifp->cf->l_cs = DK4_CS_CMYK;
+ bifp->cf->f_cs = DK4_CS_CMYK;
+ } break;
+ case JCS_YCbCr: { $? ". color space = JCS_YCbCr"
+ bifp->cf->l_cs = DK4_CS_CMYK;
+ bifp->cf->f_cs = DK4_CS_CMYK;
+ } break;
+#endif
+ default: { $? ". color space = UNKNOWN"
+ bifp->cf->l_cs = DK4_CS_RGB;
+ bifp->cf->f_cs = DK4_CS_RGB;
+ if (0 != sov) {
+ cinfo->out_color_space = JCS_RGB;
+ }
+ } break;
+ }
+ pfd->num_comp = cinfo->out_color_components;
+ $? ". color components = %u", (unsigned)(pfd->num_comp)
+ pfd->is_adobe = ((0 != cinfo->saw_Adobe_marker) ? 1 : 0);
+ $? ". adobe marker = %u", (unsigned)(pfd->is_adobe)
+ $? "- dk4bifjpeg_transfer_header_data"
+}
+
+
+
+dk4_bif_t *
+dk4bifjpeg_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_bif_jpg_clobbered_t *jpgcp,
+ dk4_er_t *erp
+)
+{
+ struct jpeg_decompress_struct cinfo; /* Jpeglib reader */
+ dk4_bif_jpeg_error_mgr errmgr; /* Jpeglib error man */
+ dk4_er_t er; /* Error report */
+ JSAMPLE **xrptr = NULL; /* Travers rows */
+ dk4_bif_jpeg_per_frame_t *pfd = NULL; /* Per-frame data */
+ size_t bpl = 0; /* Bits per line */
+ size_t i = 0; /* Traverse rows */
+ $? "+ dk4bifjpeg_nc_open_file \"%!ds\" honly=%d", TR_STR(fn), honly
+
+ /* Create bif and frame for one-frame image
+ */
+ jpgcp->back = dk4biftool_nc_new_for_one_frame(
+ fn, DK4_BIF_TYPE_JPEG, honly, pcsctx, erp
+ );
+ if (NULL == jpgcp->back) { goto finished; }
+ $? ". bif structure for one frame created"
+
+ /* Allocate per-frame data structure
+ */
+ pfd = dk4mem_new(dk4_bif_jpeg_per_frame_t,1,NULL);
+ if (NULL == pfd) { goto finished; }
+ (jpgcp->back->cf)->tsdata = pfd;
+ $? ". Per-frame data structure created"
+
+ /* Initialize per-frame data structure components
+ */
+ pfd->rows = NULL;
+ pfd->num_comp = 0;
+ pfd->is_adobe = 0;
+
+ /* Set up error management
+ */
+ cinfo.err = jpeg_std_error(&(errmgr.errmgr));
+ errmgr.errmgr.error_exit = dk4bifjpb_error_exit;
+ $? ". error management setup done"
+
+ /* Code below calls setjmp on error
+ */
+ if (0 != setjmp(errmgr.jump_buf)) { $? "! setjmp return from error"
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+
+ /* Create decompression structure
+ */
+ jpgcp->st = 1;
+ jpeg_create_decompress(&cinfo);
+ $? ". decompression structure created"
+
+ /* Specify data source
+ */
+ jpeg_stdio_src(&cinfo, fipo);
+ $? ". data source is input file"
+
+ /* Read JPEG header data
+ */
+ jpeg_read_header(&cinfo, TRUE);
+ $? ". header was read"
+
+ /* Transfer header data to bif structures.
+ */
+ dk4bifjpeg_transfer_header_data(jpgcp->back, pfd, &cinfo, 1);
+ $? ". data transfered from JPEG to BIF structures"
+
+ /* When reading just the header we are done here
+ */
+ if (0 != honly) {
+ jpgcp->ok = 1;
+ $? ". just reading header, we are done"
+ goto finished;
+ }
+
+ /* Start decompression
+ */
+ jpeg_start_decompress(&cinfo);
+ $? ". decompression started"
+
+ /* Header data are now corrected if necessary, read information again
+ */
+ dk4bifjpeg_transfer_header_data(jpgcp->back, pfd, &cinfo, 0);
+ $? ". data transferred from JPEG to BIF structures again"
+
+ /* Allocate memory for image data
+ */
+ dk4error_init(&er);
+ bpl = dk4ma_size_t_mul(jpgcp->back->cf->dim_x, jpgcp->back->cf->n_comp, &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ goto finished;
+ }
+ pfd->rows = dk4mem_new(JSAMPROW,jpgcp->back->cf->dim_y,erp);
+ if (NULL == pfd->rows) { goto finished; }
+ xrptr = pfd->rows;
+ for (i = 0; i < (size_t)(jpgcp->back->cf->dim_y); i++) { *(xrptr++) = NULL; }
+ xrptr = pfd->rows;
+ for (i = 0; i < (size_t)(jpgcp->back->cf->dim_y); i++) {
+ *xrptr = dk4mem_new(JSAMPLE,bpl,erp);
+ if (NULL == *xrptr) {
+ goto finished;
+ }
+ xrptr++;
+ }
+ $? ". memory for rows allocated"
+
+ /* Read and decompress data
+ */
+ xrptr = pfd->rows;
+ for (i = 0; i < (size_t)(jpgcp->back->cf->dim_y); i++) {
+ jpeg_read_scanlines(&cinfo, xrptr, 1);
+ xrptr++;
+ }
+ $? ". input data was read"
+
+ /* Finish decompression
+ */
+ jpeg_finish_decompress(&cinfo);
+ $? ". decompression was finished, success"
+
+ /* Everything done, success
+ */
+ jpgcp->ok = 1;
+
+ finished:
+ /*
+ Destroy decompression structure
+ */
+ if (0 < jpgcp->st) {
+ jpeg_destroy_decompress(&cinfo);
+ }
+ if (0 == jpgcp->ok) {
+ if (NULL != jpgcp->back) {
+ dk4bif_close(jpgcp->back);
+ jpgcp->back = NULL;
+ }
+ }
+
+ $? "- dk4bifjpeg_nc_open_file %d", TR_IPTR(jpgcp->back)
+ return jpgcp->back;
+}
+
+
+
+int
+dk4bifjpeg_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ size_t szdptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ dk4_er_t er; /* Error report for math op */
+ dk4_bif_jpeg_per_frame_t *pfd = NULL; /* Per-frame data */
+ size_t spos; /* Number of values per row */
+ size_t i; /* Traverse all components */
+ int back = 0;
+ $? "+ dk4bifjpeg_nc_get_original_pixel"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != bif);
+#endif
+ pfd = (dk4_bif_jpeg_per_frame_t *)((bif->cf)->tsdata);
+ if (NULL != pfd) {
+ if (NULL != pfd->rows) {
+ dk4error_init(&er);
+ spos = dk4ma_size_t_mul(colno, pfd->num_comp, &er);
+ (void)dk4ma_size_t_add(spos, pfd->num_comp, &er);
+ if (DK4_E_NONE == er.ec) {
+ if (szdptr >= pfd->num_comp) {
+ for (i = 0; i < pfd->num_comp; i++) {
+ dptr[i] = ((pfd->rows)[rowno])[spos + i];
+ }
+ back = 1;
+ }
+ }
+ }
+ }
+ $? "- dk4bifjpeg_nc_get_original_pixel %d", back
+ return back;
+}
+
+
+#endif
+/* if DK4_HAVE_JPEGLIB_H */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifn.c b/support/dktools/dk4bifn.c
new file mode 100644
index 0000000000..770b46e688
--- /dev/null
+++ b/support/dktools/dk4bifn.c
@@ -0,0 +1,2169 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifn.ctr
+*/
+
+/** @file dk4bifn.c The dk4bifn module.
+*/
+
+
+#line 8 "dk4bifn.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_SYS_TYPES_H
+#ifndef SYS_TYPES_H_INCLUDED
+#include <sys/types.h>
+#define SYS_TYPES_H_INCLUDED1
+#endif
+#endif
+#if DK4_HAVE_STDINT_H
+#ifndef STDINT_H_INCLUDED
+#include <stdint.h>
+#define STDINT_H_INCLUDED 1
+#endif
+#endif
+#if DK4_HAVE_LIMITS_H
+#ifndef LIMITS_H_INCLUDED
+#include <limits.h>
+#define LIMITS_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4MAI8DSZ_H_INCLUDED
+#include "dk4mai8dsz.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 70 "dk4bifn.ctr"
+
+
+
+/** Data to save between applying bytes.
+*/
+typedef struct {
+ dk4_bif_t *bif; /**< The result. */
+ size_t nums[4]; /**< Width, height, maxval. */
+ int magnum; /**< Magic number. */
+ int tupt; /**< Tuple type for DK4_NETPBM_P7. */
+} dk4_bif_netpbm_builder_t;
+
+
+
+/** Pointer to unsigned character.
+*/
+typedef unsigned char *dk4_puchar_t;
+
+
+
+static const char * const dk4netpbm_p7_kw[] = {
+/* 0 */
+"WIDTH",
+
+/* 1 */
+"HEIGHT",
+
+/* 2 */
+"DEPTH",
+
+/* 3 */
+"MAXVAL",
+
+/* 4 */
+"TUPLTYPE",
+
+/* 5 */
+"ENDHDR",
+
+NULL
+
+
+#line 117 "dk4bifn.ctr"
+};
+
+
+
+/** Tuple types.
+*/
+static const char * const dk4netpbm_p7_tut[] = {
+/* 0 */
+"BLACKANDWHITE",
+
+/* 1 */
+"GRAYSCALE",
+
+/* 2 */
+"RGB",
+
+/* 3 */
+"BLACKANDWHITE_ALPHA",
+
+/* 4 */
+"GRAYSCALE_ALPHA",
+
+/* 5 */
+"RGB_ALPHA",
+
+NULL
+
+
+#line 132 "dk4bifn.ctr"
+};
+
+
+
+void
+dk4bifnetpbm_nc_release_per_frame_data(
+ void *tsdata
+)
+{
+ dk4_bif_netpbm_per_frame_t *pfd; /* Per-frame data */
+ size_t i; /* Traverse all rows */
+
+
+#line 144 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+#endif
+ if (NULL != tsdata) {
+ pfd = (dk4_bif_netpbm_per_frame_t *)tsdata;
+ if (NULL != pfd->rows) {
+
+#line 150 "dk4bifn.ctr"
+ for (i = 0; i < (size_t)(pfd->h); i++) {
+
+
+#line 152 "dk4bifn.ctr"
+ dk4mem_release((pfd->rows)[i]);
+ }
+ dk4mem_free(pfd->rows);
+ }
+ pfd->rows = NULL;
+
+#line 157 "dk4bifn.ctr"
+ pfd->w = 0;
+
+#line 158 "dk4bifn.ctr"
+ pfd->h = 0;
+
+#line 159 "dk4bifn.ctr"
+ pfd->ch = 0;
+
+#line 160 "dk4bifn.ctr"
+ pfd->bpr = 0;
+
+#line 161 "dk4bifn.ctr"
+ pfd->tupt = 0;
+
+#line 162 "dk4bifn.ctr"
+ pfd->maxval = 0;
+
+#line 163 "dk4bifn.ctr"
+ pfd->bpc = 0;
+
+#line 164 "dk4bifn.ctr"
+ pfd->magnum = 0;
+ dk4mem_free(tsdata);
+ }
+
+
+#line 168 "dk4bifn.ctr"
+}
+
+
+
+static
+int
+dk4_bif_netpbm_check_input(
+ size_t w,
+ size_t h,
+ size_t maxval,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 183 "dk4bifn.ctr"
+
+
+#line 184 "dk4bifn.ctr"
+
+
+#line 185 "dk4bifn.ctr"
+
+
+#line 186 "dk4bifn.ctr"
+ if ((0 < w) && (0 < h) && (0 < maxval)) {
+ if ((dk4_um_t)(LONG_MAX) >= (dk4_um_t)w) {
+ if ((dk4_um_t)(LONG_MAX) >= (dk4_um_t)h) {
+ if ((dk4_um_t)(DK4_U16_MAX) >= (dk4_um_t)maxval) {
+ back = 1;
+ }
+ }
+ }
+ }
+ if (0 == back) {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+
+
+#line 199 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+static
+dk4_bif_netpbm_per_frame_t *
+dk4bifnetpbm_tsdata_new(
+ int magnum,
+ int tupt,
+ size_t ch,
+ size_t w,
+ size_t h,
+ size_t maxval,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report for math op */
+ dk4_bif_netpbm_per_frame_t *back = NULL;
+ size_t i = 0; /* Traverse all rows */
+ int ok = 0; /* Flag: Success, no errors */
+
+
+#line 221 "dk4bifn.ctr"
+ if (0 != dk4_bif_netpbm_check_input(w, h, maxval, erp)) {
+ back = dk4mem_new(dk4_bif_netpbm_per_frame_t,1,erp);
+ if (NULL != back) {
+
+#line 224 "dk4bifn.ctr"
+ dk4error_init(&er);
+ back->rows = NULL;
+ back->w = (dk4_bif_dim_t)w;
+
+#line 227 "dk4bifn.ctr"
+ back->h = (dk4_bif_dim_t)h;
+
+#line 228 "dk4bifn.ctr"
+ back->ch = 0; /* Number of channels */
+ back->vpr = 0; /* Values per row */
+ back->bpr = 0; /* Bytes per row */
+ back->magnum = magnum;
+
+#line 232 "dk4bifn.ctr"
+ back->tupt = tupt;
+
+#line 233 "dk4bifn.ctr"
+ back->maxval = (dk4_px_t)maxval;
+
+#line 234 "dk4bifn.ctr"
+ back->bpc = (dk4_px_bit_depth_t)dk4pxbit_get_bitno((dk4_px_t)maxval);
+
+
+#line 236 "dk4bifn.ctr"
+ switch (magnum) {
+ case DK4_NETPBM_P1 : case DK4_NETPBM_P4 : {
+ back->ch = 1;
+ back->vpr = w;
+ back->bpr = w / 8;
+ if (0 != (w % 8)) { back->bpr += 1; }
+ } break;
+ case DK4_NETPBM_P2 : case DK4_NETPBM_P5 : {
+ back->ch = 1;
+ back->vpr = w;
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_P3 : case DK4_NETPBM_P6 : {
+ back->ch = 3;
+ back->vpr = dk4ma_size_t_mul(3, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_P7 : {
+ switch (tupt) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ back->ch = 1;
+ back->vpr = w;
+ back->bpr = w;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ back->ch = 1;
+ back->vpr = w;
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ back->ch = 3;
+ back->vpr = dk4ma_size_t_mul(3, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ back->ch = 2;
+ back->vpr = dk4ma_size_t_mul(2, w, &er);
+ back->bpr = back->vpr;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ back->ch = 2;
+ back->vpr = dk4ma_size_t_mul(2, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ back->ch = 4;
+ back->vpr = dk4ma_size_t_mul(4, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ default : {
+
+#line 304 "dk4bifn.ctr"
+ back->ch = ch;
+ back->vpr = dk4ma_size_t_mul(ch, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ }
+ } break;
+ }
+ (void)dk4ma_size_t_mul(h,sizeof(dk4_puchar_t),&er);
+ if (DK4_E_NONE == er.ec) {
+
+#line 316 "dk4bifn.ctr"
+ if (0 < back->bpr) {
+ back->rows = dk4mem_new(dk4_puchar_t,h,erp);
+ if (NULL != back->rows) {
+
+#line 319 "dk4bifn.ctr"
+ for (i = 0; i < h; i++) { (back->rows)[i] = NULL; }
+ ok = 1;
+ for (i = 0; i < h; i++) {
+ (back->rows)[i] =
+ dk4mem_new(unsigned char,back->bpr,erp);
+ if (NULL != (back->rows)[i]) {
+ DK4_MEMRES((back->rows)[i],back->bpr);
+
+
+#line 327 "dk4bifn.ctr"
+ }
+ else {
+
+#line 329 "dk4bifn.ctr"
+ ok = 0;
+ }
+ }
+ }
+ }
+ }
+ else {
+
+#line 336 "dk4bifn.ctr"
+ dk4error_copy(erp, &er);
+ }
+ if (0 == ok) {
+
+#line 339 "dk4bifn.ctr"
+ dk4bifnetpbm_nc_release_per_frame_data(back);
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+
+
+#line 345 "dk4bifn.ctr"
+
+
+#line 346 "dk4bifn.ctr"
+
+
+#line 347 "dk4bifn.ctr"
+
+
+#line 348 "dk4bifn.ctr"
+
+
+#line 349 "dk4bifn.ctr"
+
+
+#line 350 "dk4bifn.ctr"
+
+
+#line 351 "dk4bifn.ctr"
+
+
+#line 352 "dk4bifn.ctr"
+
+
+#line 353 "dk4bifn.ctr"
+
+
+#line 354 "dk4bifn.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 359 "dk4bifn.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 364 "dk4bifn.ctr"
+ }
+#endif
+
+
+#line 367 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Copy original data to frame information.
+ @param cf Frame data to fill.
+ @param pfd Original per frame data.
+*/
+static
+void
+dk4bifnetpbm_fill_frame(
+ dk4_bif_frame_t *cf,
+ void const *voptr
+)
+{
+ dk4_bif_netpbm_per_frame_t const *pfd;
+
+
+#line 385 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != cf);
+#endif
+ pfd = (dk4_bif_netpbm_per_frame_t *)voptr;
+ cf->n_comp =
+ cf->dim_x = pfd->w;
+ cf->dim_y = pfd->h;
+ switch (pfd->magnum) {
+ case DK4_NETPBM_P1 : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = 1;
+ } break;
+ case DK4_NETPBM_P2 : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P3 : {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P4 : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P5 : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P6 : {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P7 : {
+ switch (pfd->tupt) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ default : {
+
+
+#line 445 "dk4bifn.ctr"
+ switch (pfd->ch) {
+ case 1: {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case 2: {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case 3: {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case 4: {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ }
+ } break;
+ }
+ } break;
+ }
+ cf->bglbd[0] = pfd->maxval;
+ cf->bglbd[1] = pfd->maxval;
+ cf->bglbd[2] = pfd->maxval;
+ cf->bglbd[3] = pfd->maxval;
+ if (pfd->maxval != dk4pxbit_get_max(pfd->bpc)) {
+ cf->fmres = 1;
+ cf->fmrmv = pfd->maxval;
+ dk4pxres_setup_from_maxval(&(cf->resampler), pfd->maxval, pfd->bpc);
+ cf->bg[0] = dk4pxbit_get_max(pfd->bpc);
+ cf->bg[1] = cf->bg[2] = cf->bg[3] = cf->bg[0];
+ }
+ else {
+ dk4pxres_setup(&(cf->resampler), cf->l_bdepth, cf->l_bdepth);
+ cf->bg[0] = pfd->maxval;
+ cf->bg[1] = pfd->maxval;
+ cf->bg[2] = pfd->maxval;
+ cf->bg[3] = pfd->maxval;
+ }
+#if TRACE_DEBUG
+
+
+#line 487 "dk4bifn.ctr"
+
+
+#line 488 "dk4bifn.ctr"
+
+
+#line 489 "dk4bifn.ctr"
+
+
+#line 490 "dk4bifn.ctr"
+
+
+#line 491 "dk4bifn.ctr"
+
+
+#line 492 "dk4bifn.ctr"
+
+
+#line 493 "dk4bifn.ctr"
+
+
+#line 494 "dk4bifn.ctr"
+
+
+#line 495 "dk4bifn.ctr"
+
+
+#line 496 "dk4bifn.ctr"
+
+
+#line 497 "dk4bifn.ctr"
+
+
+#line 498 "dk4bifn.ctr"
+
+
+#line 499 "dk4bifn.ctr"
+
+
+#line 500 "dk4bifn.ctr"
+
+
+#line 501 "dk4bifn.ctr"
+
+
+#line 502 "dk4bifn.ctr"
+
+
+#line 503 "dk4bifn.ctr"
+
+
+#line 504 "dk4bifn.ctr"
+
+
+#line 505 "dk4bifn.ctr"
+
+
+#line 506 "dk4bifn.ctr"
+
+
+#line 507 "dk4bifn.ctr"
+
+
+#line 508 "dk4bifn.ctr"
+#endif
+
+
+#line 510 "dk4bifn.ctr"
+}
+
+
+
+/** Initialize builder before applying any data.
+ @param pbuilder Builder to initialize.
+ @return 1 on success, 0 on error (memory).
+*/
+static
+int
+dk4_bif_netpbm_builder_initialize(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ const dkChar *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 530 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+#endif
+ pbuilder->bif = NULL;
+ pbuilder->magnum = 0;
+
+ pbuilder->bif = dk4biftool_nc_new_for_one_frame(
+ fn, DK4_BIF_TYPE_NETPBM, honly, pcsctx, erp
+ );
+ if (NULL != pbuilder->bif) {
+ back = 1;
+ }
+
+
+#line 543 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Clean up builder.
+ @param pbuilder Builder to clean up.
+*/
+static
+void
+dk4_bif_netpbm_builder_cleanup(dk4_bif_netpbm_builder_t *pbuilder)
+{
+
+
+#line 556 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+#endif
+ if (NULL != pbuilder->bif) {
+ dk4bif_close(pbuilder->bif);
+ pbuilder->bif = NULL;
+ }
+
+
+#line 564 "dk4bifn.ctr"
+}
+
+
+
+/** Attempt to read magic number and one whitespace from file.
+ For a sequence of frames (sequence of NetPBM images) we might
+ have white spaces between frame data and the magic number of the
+ following frame, so we ignore leading white spaces if the
+ havefr flag is set.
+ @param pbuilder Image builder structure.
+ @param fipo Input file, opened for binary reading.
+ @param havefr Flag: Already have previous frame.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on end of file, -1 on error.
+*/
+static
+int
+dk4bifnetpbm_read_magic_number(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ FILE *fipo,
+ int havefr,
+ dk4_er_t *erp
+)
+{
+ int cc = 1; /* Flag: Can continue */
+ int c = 0; /* Input character */
+ int inco = 0; /* Flag: In comment */
+ int back = -1;
+
+
+
+#line 594 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+ assert(NULL != fipo);
+#endif
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ cc = -1;
+ back = 0;
+ } break;
+ case 'P' : {
+ cc = 0;
+ } break;
+ case '#' : {
+ inco = 1;
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ inco = 0;
+ cc = -1;
+ back = 0;
+ } break;
+ case '\n' : {
+ inco = 0;
+ } break;
+ }
+ } while (1 == inco);
+ } break;
+ case ' ' :
+ case '\t' :
+ case '\r' :
+ case '\n' :
+ case '\v' :
+ case '\f' : {
+ if (0 == havefr) {
+ cc = -1;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ } break;
+ default : {
+ cc = -1;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ } break;
+ }
+ } while (1 == cc);
+ switch (cc) {
+ case 0 : { /* P was read */
+ back = 1;
+ c = fgetc(fipo);
+ switch (c) {
+ case '1' : {
+ pbuilder->magnum = DK4_NETPBM_P1;
+ } break;
+ case '2' : {
+ pbuilder->magnum = DK4_NETPBM_P2;
+ } break;
+ case '3' : {
+ pbuilder->magnum = DK4_NETPBM_P3;
+ } break;
+ case '4' : {
+ pbuilder->magnum = DK4_NETPBM_P4;
+ } break;
+ case '5' : {
+ pbuilder->magnum = DK4_NETPBM_P5;
+ } break;
+ case '6' : {
+ pbuilder->magnum = DK4_NETPBM_P6;
+ } break;
+ case '7' : {
+ pbuilder->magnum = DK4_NETPBM_P7;
+ } break;
+ default : {
+ back = -1;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ } break;
+ }
+ if (1 == back) {
+ c = fgetc(fipo);
+ back = -1;
+ switch (c) {
+ case ' ' :
+ case '\t' :
+ case '\r' :
+ case '\n' :
+ case '\v' :
+ case '\f' : {
+ back = 1;
+ } break;
+ }
+ }
+ } break;
+ default : { /* Failed */
+ /* Empty by intent. */
+ } break;
+ }
+
+
+#line 692 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+static
+size_t
+dk4bifnetpbm_digit(char c)
+{
+ size_t back = 0;
+
+
+#line 703 "dk4bifn.ctr"
+ switch (c) {
+ case '1' : { back = 1; } break;
+ case '2' : { back = 2; } break;
+ case '3' : { back = 3; } break;
+ case '4' : { back = 4; } break;
+ case '5' : { back = 5; } break;
+ case '6' : { back = 6; } break;
+ case '7' : { back = 7; } break;
+ case '8' : { back = 8; } break;
+ case '9' : { back = 9; } break;
+ }
+
+
+#line 715 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Read NetPBM header (2 or 3 decimal numbers), optionally containing
+ a comment.
+ We must have
+ - white space(s),
+ - 2 or 3 decimal numbers separated by white space(s),
+ - one white space at end as separator between header and data.
+ @param fipo Input file, opened for binary reading.
+ @param numbuf Destination buffer for decimal numbers.
+ @param sznb Buffer size (number of numbers).
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_header_16(
+ FILE *fipo,
+ size_t *numbuf,
+ size_t sznb,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report */
+ size_t i; /* Traverse all numbers */
+ size_t val = 0; /* Value to store in current number */
+ size_t found = 0; /* Number of completed numbers */
+ int back = 0;
+ int inco = 0; /* Flag: In comment */
+ int st = 0; /* State: 0=in space, 1=in number */
+ int c = 0; /* Current character to process */
+ int cc = 1; /* Flag: 1=can continue, 0=finished, -1=error */
+
+
+#line 751 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != numbuf);
+ assert(0 < sznb);
+#endif
+ for (i = 0; i < sznb; i++) { numbuf[i] = 0; }
+ dk4error_init(&er);
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ cc = -1;
+ if (0 != st) {
+ numbuf[found++] = val;
+ val = 0;
+ }
+ } break;
+ case '#' : {
+ if (0 != st) {
+ numbuf[found++] = val;
+ val = 0;
+ st = 0;
+ }
+ inco = 1;
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ inco = 0; cc = -1;
+ } break;
+ case '\n' : {
+ inco = 0;
+ } break;
+ }
+ } while (1 == inco);
+ } break;
+ case '0' : case '1' : case '2' : case '3' : case '4' :
+ case '5' : case '6' : case '7' : case '8' : case '9' : {
+ if (0 != st) {
+ val = dk4ma_size_t_add(
+ dk4ma_size_t_mul(val, 10, &er),
+ dk4bifnetpbm_digit(c), &er
+ );
+ }
+ else {
+ val = dk4bifnetpbm_digit(c);
+ st = 1;
+ }
+ } break;
+ case ' ': case '\t': case '\r': case '\n': case '\v': case '\f': {
+ if (0 != st) {
+ numbuf[found++] = val;
+ val = 0;
+ if (found == sznb) {
+ cc = 0;
+ back = 1;
+ }
+ }
+ else {
+ if (found == sznb) {
+ cc = 0;
+ back = 1;
+ }
+ }
+ st = 0;
+ } break;
+ default : {
+ cc = -1;
+ } break;
+ }
+ } while (1 == cc);
+ if (DK4_E_NONE != er.ec) {
+ back = 0;
+ }
+#if TRACE_DEBUG
+ for (i = 0; i < found; i++) {
+
+
+#line 828 "dk4bifn.ctr"
+ }
+#endif
+ if (1 == back) {
+ for (i = 0; i < found; i++) {
+ if (0 == numbuf[i]) {
+ back = 0;
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+
+
+#line 841 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Check configuration data from P7 lines.
+ @param w Image width.
+ @param h Image height.
+ @param ch Number of channels in image.
+ @param maxval Maximum component value.
+ @param tuptp Address of tuple type variable.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_check_p7(
+ size_t w,
+ size_t h,
+ size_t ch,
+ size_t maxval,
+ int *tuptp,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 868 "dk4bifn.ctr"
+
+
+#line 869 "dk4bifn.ctr"
+
+
+#line 870 "dk4bifn.ctr"
+
+
+#line 871 "dk4bifn.ctr"
+
+
+#line 872 "dk4bifn.ctr"
+
+
+#line 873 "dk4bifn.ctr"
+ if ((0 == ch) && (0 <= *tuptp)) {
+ switch (*tuptp) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ ch = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ ch = 1;
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ ch = 3;
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ ch = 2;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ ch = 2;
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ ch = 4;
+ } break;
+#if TRACE_DEBUG
+ default : {
+
+
+#line 896 "dk4bifn.ctr"
+ } break;
+#endif
+ }
+ }
+ else {
+ if ((0 < ch) && (0 > *tuptp)) {
+ switch (ch) {
+ case 1 : {
+ *tuptp = DK4_NETPBM_TT_GRAYSCALE;
+ } break;
+ case 2 : {
+ *tuptp = DK4_NETPBM_TT_GRAYSCALE_ALPHA;
+ } break;
+ case 3 : {
+ *tuptp = DK4_NETPBM_TT_RGB;
+ } break;
+ case 4 : {
+ *tuptp = DK4_NETPBM_TT_RGB_ALPHA;
+ } break;
+ }
+ }
+ }
+ if (0 != dk4_bif_netpbm_check_input(w, h, maxval, erp)) {
+ if ((0 != ch) && (0 <= *tuptp)) {
+ switch (*tuptp) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ if (1 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ if (1 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ if (3 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ if (2 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ if (2 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ if (4 == ch) { back = 1; }
+ } break;
+#if TRACE_DEBUG
+ default : {
+
+
+#line 942 "dk4bifn.ctr"
+ } break;
+#endif
+ }
+ }
+ }
+
+
+#line 948 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Read binary data for one row.
+ @param row Address of row buffer to fill.
+ @param fipo Input file, opened for binary reading.
+ @param nbytes Number of bytes for row.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_row(
+ unsigned char *row,
+ FILE *fipo,
+ size_t nbytes,
+ dk4_er_t *erp
+)
+{
+ size_t rdbytes = 0; /* Number of bytes read */
+ int back = 1;
+
+
+#line 972 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != row);
+ assert(NULL != fipo);
+#endif
+ /*
+ Normally one fread attempt should be sufficient.
+ But sometimes multiple attempts are needed if
+ an fread returns a small portion of data only.
+ Reading 0 bytes means either end of file or read error.
+ */
+ do {
+ rdbytes = fread(row, 1, nbytes, fipo);
+ if (0 < rdbytes) {
+ if (rdbytes >= nbytes) {
+ nbytes = 0;
+ }
+ else {
+ nbytes -= rdbytes;
+ row = &(row[rdbytes]);
+ }
+ }
+ else {
+ back = 0;
+ }
+ } while ((0 < nbytes) && (1 == back));
+ if (0 == back) {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+
+
+#line 1001 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Read binary raster data.
+ @param tsdata Per-frame NetPBM data.
+ @param fipo Input file, opened for binary reading.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_binary(
+ void *tsdata,
+ FILE *fipo,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_netpbm_per_frame_t *pfd = NULL; /* Per-frame data */
+ unsigned char **row = NULL; /* Array of row pointers */
+ size_t i; /* Traverse all rows */
+ int back = 0;
+
+
+#line 1025 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+ assert(NULL != fipo);
+#endif
+ pfd = (dk4_bif_netpbm_per_frame_t *)tsdata;
+ row = pfd->rows;
+ back = 1;
+ for (i = 0; i < (size_t)(pfd->h); i++) {
+ if (0 == dk4bifnetpbm_read_row(*(row++), fipo, pfd->bpr, erp)) {
+ back = 0; i = pfd->h;
+ }
+ }
+
+
+#line 1038 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+
+/** Read frame contents (NetPBM image) after magic number P7.
+ @param pbuilder Image builder structure.
+ @param fipo Input file, opened for binary reading.
+ @param havefr Flag: Already have frame.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_p7(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ FILE *fipo,
+ int havefr,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report */
+ char *tok[256]; /* Tokens in input line */
+ char il[256]; /* Input line */
+ const char *ep = NULL; /* End pointer */
+ size_t ilp = 0; /* Current position in input line */
+ size_t ntok = 0; /* Number of tokens in line */
+ size_t w = 0; /* Image width */
+ size_t h = 0; /* Image height */
+ size_t ch = 0; /* Number of channels */
+ size_t maxval = 0; /* Maximum component value */
+ int back = 0; /* Function result */
+ int cc = 1; /* Can continue (1=yes, 0=no, -1=error) */
+ int hdt = 0; /* Header line type */
+ int res = 0; /* Operation result */
+ int tupt = -1; /* Tuple type */
+ int c;
+
+
+#line 1077 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+ assert(NULL != fipo);
+#endif
+ DK4_MEMRES(il,sizeof(il));
+ dk4error_init(&er);
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ cc = -1;
+ } break;
+ case '\n' : {
+ il[ilp] = '\0';
+ ntok = dk4str8_tokenize(tok, 256, il, NULL, erp);
+
+
+#line 1093 "dk4bifn.ctr"
+ if (0 < ntok) {
+ hdt = dk4str8_array_index(dk4netpbm_p7_kw, tok[0], 0);
+
+
+#line 1096 "dk4bifn.ctr"
+ switch (hdt) {
+ case 0: { /* WIDTH */
+ if (1 < ntok) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t_simple(
+ &w, tok[1], &ep, 1, erp
+ );
+ if (0 == res) {
+ cc = -1;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 1: { /* HEIGHT */
+ if (1 < ntok) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t_simple(
+ &h, tok[1], &ep, 1, erp
+ );
+ if (0 == res) {
+ cc = -1;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 2: { /* DEPTH */
+ if (1 < ntok) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t_simple(
+ &ch, tok[1], &ep, 1, erp
+ );
+ if (0 == res) {
+ cc = -1;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 3: { /* MAXVAL */
+ if (1 < ntok) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t_simple(
+ &maxval, tok[1], &ep, 1, erp
+ );
+ if (0 == res) {
+ cc = -1;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 4: { /* TUPLTYPE */
+ if (1 < ntok) {
+ tupt = dk4str8_array_index(
+ dk4netpbm_p7_tut, tok[1], 0
+ );
+ if (0 > tupt) {
+
+
+#line 1160 "dk4bifn.ctr"
+
+
+#line 1161 "dk4bifn.ctr"
+ /* 2018-03-14
+ Simply ignore unkown tuple types.
+ */
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 5: { /* ENDHDR */
+ cc = -1;
+ res = dk4bifnetpbm_check_p7(
+ w, h, ch, maxval, &tupt, erp
+ );
+ if (0 != res) {
+ back = 1;
+ if (0 != havefr) {
+ back = dk4biftool_nc_add_frame(
+ pbuilder->bif, erp
+ );
+ }
+ if (1 == back) {
+ back = 0;
+ pbuilder->bif->cf->tsdata =
+ dk4bifnetpbm_tsdata_new(
+ DK4_NETPBM_P7,tupt,ch,w,h,maxval,erp
+ );
+ if (NULL != pbuilder->bif->cf->tsdata) {
+ cc = 0;
+ dk4bifnetpbm_fill_frame(
+ pbuilder->bif->cf,
+ pbuilder->bif->cf->tsdata
+ );
+ }
+ }
+ }
+ } break;
+ default : {
+ cc = -1;
+ } break;
+ }
+ }
+ else {
+ /* Empty line is ok */
+ }
+ DK4_MEMRES(il,sizeof(il));
+ ilp = 0;
+ } break;
+ default : {
+ il[ilp++] = (char)c;
+ if (sizeof(il) <= ilp) {
+ cc = -1;
+ }
+ } break;
+ }
+ } while (1 == cc);
+
+
+#line 1218 "dk4bifn.ctr"
+
+
+#line 1219 "dk4bifn.ctr"
+
+
+#line 1220 "dk4bifn.ctr"
+
+
+#line 1221 "dk4bifn.ctr"
+
+
+#line 1222 "dk4bifn.ctr"
+ if (0 == cc) {
+ /*
+ Read raster data
+ */
+ back = dk4bifnetpbm_read_binary(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ }
+
+
+#line 1231 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Read bit values as text.
+ @param tsdata Per-frame NetPBM data.
+ @param fipo Input file, opened for binary reading.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_bits_text(
+ void *tsdata,
+ FILE *fipo,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_netpbm_per_frame_t *pfd; /* Per-frame data */
+ size_t rowno = 0; /* Current row number */
+ size_t valno = 0; /* Current value number */
+ size_t byteno = 0; /* Byte number within row */
+ size_t bitno = 0; /* Bit number within byte */
+ int back = 1;
+ int cc = 1; /* Flag: Can continue */
+ int c; /* Current input character */
+ unsigned char uc; /* Byte to save */
+
+
+#line 1260 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+ assert(NULL != fipo);
+#endif
+ pfd = (dk4_bif_netpbm_per_frame_t *)tsdata;
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ cc = -1;
+ back = 0;
+ } break;
+ case '0' : case '1' : {
+ if ('1' == c) {
+ byteno = valno / 8;
+ bitno = valno % 8;
+ uc = (unsigned char)dk4pxbit_get_bit(7 - bitno);
+ ((pfd->rows)[rowno])[byteno] |= uc;
+ }
+ valno++;
+ if (valno >= pfd->vpr) {
+ valno = 0;
+ rowno++;
+ if (rowno >= (size_t)(pfd->h)) {
+ cc = 0;
+ }
+ }
+ } break;
+ case ' ' :
+ case '\t' :
+ case '\r' :
+ case '\n' :
+ case '\v' :
+ case '\f' : {
+ } break;
+ default : {
+ cc = -1;
+ } break;
+ }
+ } while (1 == cc);
+ if (0 == cc) {
+ do {
+ c = fgetc(fipo);
+ } while ((EOF != c) && (0 == feof(fipo)) && (0 == ferror(fipo)));
+ }
+ if (0 == back) {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+
+
+#line 1309 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Read pixel component values as text.
+ @param tsdata Per-frame NetPBM data.
+ @param fipo Input file, opened for binary reading.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_values_from_text(
+ void *tsdata,
+ FILE *fipo,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report for math */
+ dk4_bif_netpbm_per_frame_t *pfd = NULL; /* Per-frame data */
+ size_t rowno = 0; /* Current row number */
+ size_t valno = 0; /* Current value number */
+ size_t value = 0; /* Sample value */
+ int back = 1;
+ int st = 0; /* State: 1=in number */
+ int cc = 1; /* Flag: Can continue */
+ int c; /* Current character */
+ unsigned char uc; /* Byte to save */
+
+
+#line 1339 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+ assert(NULL != fipo);
+#endif
+ pfd = (dk4_bif_netpbm_per_frame_t *)tsdata;
+ dk4error_init(&er);
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ if (0 != st) {
+ cc = -1;
+ back = 0;
+ if (value <= pfd->maxval) {
+ if (256 > pfd->maxval) {
+ uc = (unsigned char)value;
+ ((pfd->rows)[rowno])[valno] = uc;
+ }
+ else {
+ uc = (value >> 8) & 0x00FFU;
+ ((pfd->rows)[rowno])[2 * valno] = uc;
+ uc = value & 0x00FFU;
+ ((pfd->rows)[rowno])[2 * valno + 1] = uc;
+ }
+ valno++;
+ if (valno >= pfd->vpr) {
+ valno = 0;
+ rowno++;
+ if (rowno >= (size_t)(pfd->h)) {
+ back = 1;
+ }
+ }
+ }
+ }
+ else {
+ cc = -1;
+ back = 0;
+ }
+ } break;
+ case '0' : case '1' : case '2' : case '3' : case '4' :
+ case '5' : case '6' : case '7' : case '8' : case '9' : {
+ if (0 != st) {
+ value = dk4ma_size_t_add(
+ dk4ma_size_t_mul(value, 10, &er),
+ dk4bifnetpbm_digit(c), &er
+ );
+ }
+ else {
+ value = dk4bifnetpbm_digit(c);
+ }
+ st = 1;
+ } break;
+ case ' ' :
+ case '\t' :
+ case '\r' :
+ case '\n' :
+ case '\v' :
+ case '\f' : {
+ if (0 != st) {
+ if (value <= pfd->maxval) {
+ if (256 > pfd->maxval) {
+ uc = (unsigned char)value;
+ ((pfd->rows)[rowno])[valno] = uc;
+ }
+ else {
+ uc = (value >> 8) & 0x00FFU;
+ ((pfd->rows)[rowno])[2 * valno] = uc;
+ uc = value & 0x00FFU;
+ ((pfd->rows)[rowno])[2 * valno + 1] = uc;
+ }
+ valno++;
+ if (valno >= pfd->vpr) {
+ valno = 0;
+ rowno++;
+ if (rowno >= (size_t)(pfd->h)) {
+ back = 1;
+ cc = 0;
+ }
+ }
+ }
+ else {
+ cc = -1;
+ back = 0;
+ }
+ }
+ st = 0;
+ } break;
+ default : {
+ cc = -1;
+ back = 0;
+ } break;
+ }
+ } while (1 == cc);
+ if (0 == cc) {
+ do {
+ c = fgetc(fipo);
+ } while ((EOF != c) && (0 == feof(fipo)) && (0 == ferror(fipo)));
+ }
+ if (DK4_E_NONE != er.ec) {
+ back = 0;
+ }
+ if (0 == back) {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+
+
+#line 1444 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Read frame contents (NetPBM image) after magic number.
+ @param pbuilder Image builder structure.
+ @param fipo Input file, opened for binary reading.
+ @param havefr Flag: Already have a frame.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_frame_contents(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ FILE *fipo,
+ int havefr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 1467 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+ assert(NULL != fipo);
+#endif
+ switch (pbuilder->magnum) {
+ case DK4_NETPBM_P1 :
+ case DK4_NETPBM_P4 :
+ {
+ back = dk4bifnetpbm_read_header_16(
+ fipo, &(pbuilder->nums[0]), 2, erp
+ );
+ if (1 == back) {
+
+#line 1479 "dk4bifn.ctr"
+ back = 0;
+ if (0 != havefr) {
+ if (0 != dk4biftool_nc_add_frame(pbuilder->bif, erp)) {
+ back = 1;
+ }
+ }
+ else {
+ back = 1;
+ }
+ if (0 != back) {
+ back = 0;
+ pbuilder->bif->cf->tsdata = dk4bifnetpbm_tsdata_new(
+ pbuilder->magnum, pbuilder->tupt, 1,
+ pbuilder->nums[0], pbuilder->nums[1], 1,
+ erp
+ );
+ if (NULL != pbuilder->bif->cf->tsdata) {
+ dk4bifnetpbm_fill_frame(
+ pbuilder->bif->cf,
+ pbuilder->bif->cf->tsdata
+ );
+ if (DK4_NETPBM_P4 == pbuilder->magnum) {
+ back = dk4bifnetpbm_read_binary(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ }
+ else {
+ back = dk4bifnetpbm_read_bits_text(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ }
+ }
+ }
+ }
+ } break;
+ case DK4_NETPBM_P2 :
+ case DK4_NETPBM_P3 :
+ case DK4_NETPBM_P5 :
+ case DK4_NETPBM_P6 :
+ {
+ back = dk4bifnetpbm_read_header_16(
+ fipo, &(pbuilder->nums[0]), 3, erp
+ );
+ if (1 == back) {
+
+#line 1523 "dk4bifn.ctr"
+ back = 0;
+ if (0 != havefr) {
+ if (0 != dk4biftool_nc_add_frame(pbuilder->bif, erp)) {
+ back = 1;
+ }
+ }
+ else {
+ back = 1;
+ }
+ if (0 != back) {
+ back = 0;
+ switch (pbuilder->magnum) {
+ case DK4_NETPBM_P2 : case DK4_NETPBM_P5 : {
+ pbuilder->bif->cf->tsdata = dk4bifnetpbm_tsdata_new(
+ pbuilder->magnum, pbuilder->tupt, 1,
+ pbuilder->nums[0], pbuilder->nums[1],
+ pbuilder->nums[2], erp
+ );
+ } break;
+ default : {
+ pbuilder->bif->cf->tsdata = dk4bifnetpbm_tsdata_new(
+ pbuilder->magnum, pbuilder->tupt, 3,
+ pbuilder->nums[0], pbuilder->nums[1],
+ pbuilder->nums[2], erp
+ );
+ } break;
+ }
+ if (NULL != pbuilder->bif->cf->tsdata) {
+ dk4bifnetpbm_fill_frame(
+ pbuilder->bif->cf,
+ pbuilder->bif->cf->tsdata
+ );
+ switch (pbuilder->magnum) {
+ case DK4_NETPBM_P5 : case DK4_NETPBM_P6 : {
+ back = dk4bifnetpbm_read_binary(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ } break;
+ default : {
+ back = dk4bifnetpbm_read_values_from_text(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ } break;
+ }
+ }
+ }
+ }
+ } break;
+ case DK4_NETPBM_P7 :
+ {
+ back = dk4bifnetpbm_read_p7(pbuilder, fipo, havefr, erp);
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ } break;
+ }
+
+
+#line 1580 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Read one frame (one image) from the input file and add it to builder.
+ @param pbuilder Image builder structure.
+ @param fipo Input file, opened for binary reading.
+ @param havefr Flag: Already have previous frame.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on end of file, -1 on error.
+*/
+static
+int
+dk4bifnetpbm_read_frame(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ FILE *fipo,
+ int havefr,
+ dk4_er_t *erp
+)
+{
+ int back = -1;
+
+
+#line 1603 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+ assert(NULL != fipo);
+#endif
+ back = dk4bifnetpbm_read_magic_number(pbuilder, fipo, havefr, erp);
+ if (1 == back) {
+ back = dk4bifnetpbm_read_frame_contents(pbuilder, fipo, havefr, erp);
+ if (1 != back) {
+ back = -1;
+ }
+ }
+
+
+#line 1615 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bifnetpbm_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *back = NULL;
+ int res = 0; /* Operation result */
+ int havefr = 0; /* Flag: frames found */
+ dk4_bif_netpbm_builder_t builder; /* Builder structure */
+
+
+#line 1634 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ /* Initialize the builder
+ */
+ if (0 != dk4_bif_netpbm_builder_initialize(&builder,fn,honly,pcsctx,erp)) {
+
+ /* Attempt to read all frames from input
+ */
+ do {
+ res = dk4bifnetpbm_read_frame(&builder, fipo, havefr, erp);
+ switch (res) {
+ case 1: {
+ havefr = 1;
+ } break;
+ }
+ } while (0 < res);
+
+ /* On success (at least one frame was read, end of file
+ was found after last frame) return the builders collected data
+ */
+ if ((-1 != res) && (0 != havefr)) {
+ back = builder.bif;
+ builder.bif = NULL;
+ }
+
+ /* Finally clean up the builder
+ */
+ dk4_bif_netpbm_builder_cleanup(&builder);
+
+ }
+
+
+#line 1666 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+/** Combine two bytes into one 16 bit unsigned integer for pixel component.
+ @param msb Most significant byte.
+ @param lsb Least significant byte.
+ @return Pixel component value.
+*/
+static
+dk4_px_t
+dk4bifnetpbm_combine_bytes(unsigned char msb, unsigned char lsb)
+{
+ dk4_px_t back;
+
+
+#line 1682 "dk4bifn.ctr"
+ back = ((((dk4_px_t)msb) << 8) & ((dk4_px_t)0xFF00U))
+ | (((dk4_px_t)lsb) & ((dk4_px_t)0x00FFU));
+
+
+#line 1685 "dk4bifn.ctr"
+ return back;
+}
+
+
+int
+dk4bifnetpbm_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ dk4_bif_netpbm_per_frame_t *pfd = NULL; /* Per-frame data */
+ size_t byteno; /* Byte number to retrieve */
+ size_t bitno; /* Bit number within byte */
+ size_t i; /* Traverse components */
+ int back = 0;
+ unsigned char uc; /* Byte read from buffer */
+
+
+#line 1704 "dk4bifn.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bif);
+#endif
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ if (NULL == bif->cf->tsdata) {
+ goto finished;
+ }
+ pfd = (dk4_bif_netpbm_per_frame_t *)(bif->cf->tsdata);
+ if (NULL == pfd->rows) {
+ goto finished;
+ }
+ switch (pfd->magnum) {
+ case DK4_NETPBM_P1 : case DK4_NETPBM_P4 : {
+ byteno = (size_t)colno / 8;
+ bitno = (size_t)colno % 8;
+ uc = ((pfd->rows)[rowno])[byteno];
+ if (0 != (dk4pxbit_get_bit(7 - bitno) & uc)) {
+ *dptr = 0;
+ }
+ else {
+ *dptr = 1;
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_P2 : case DK4_NETPBM_P5 : {
+ if (256 > pfd->maxval) {
+ *dptr = (dk4_px_t)(((pfd->rows)[rowno])[colno]);
+ }
+ else {
+ *dptr = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[2 * colno],
+ ((pfd->rows)[rowno])[2 * colno + 1]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_P3 : case DK4_NETPBM_P6 : {
+ if (256 > pfd->maxval) {
+ dptr[0] = (dk4_px_t)(((pfd->rows)[rowno])[3 * colno]);
+ dptr[1] = (dk4_px_t)(((pfd->rows)[rowno])[3 * colno + 1]);
+ dptr[2] = (dk4_px_t)(((pfd->rows)[rowno])[3 * colno + 2]);
+ }
+ else {
+ dptr[0] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno],
+ ((pfd->rows)[rowno])[6 * colno + 1]
+ );
+ dptr[1] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno + 2],
+ ((pfd->rows)[rowno])[6 * colno + 3]
+ );
+ dptr[2] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno + 4],
+ ((pfd->rows)[rowno])[6 * colno + 5]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_P7 : {
+ switch (pfd->tupt) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ if (0 != ((pfd->rows)[rowno])[colno]) {
+ *dptr = 1;
+ }
+ else {
+ *dptr = 0;
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ if (256 > pfd->maxval) {
+ *dptr = (dk4_px_t)(((pfd->rows)[rowno])[colno]);
+ }
+ else {
+ *dptr = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[2 * colno],
+ ((pfd->rows)[rowno])[2 * colno + 1]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ if (256 > pfd->maxval) {
+ dptr[0] = (dk4_px_t)(((pfd->rows)[rowno])[3*colno]);
+ dptr[1] = (dk4_px_t)(((pfd->rows)[rowno])[3*colno+1]);
+ dptr[2] = (dk4_px_t)(((pfd->rows)[rowno])[3*colno+2]);
+ }
+ else {
+ dptr[0] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno],
+ ((pfd->rows)[rowno])[6 * colno + 1]
+ );
+ dptr[1] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno + 2],
+ ((pfd->rows)[rowno])[6 * colno + 3]
+ );
+ dptr[2] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno + 4],
+ ((pfd->rows)[rowno])[6 * colno + 5]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ if (0 != ((pfd->rows)[rowno])[2 * colno]) {
+ dptr[0] = 1;
+ }
+ else {
+ dptr[0] = 0;
+ }
+ if (0 != ((pfd->rows)[rowno])[2 * colno + 1]) {
+ dptr[1] = 1;
+ }
+ else {
+ dptr[1] = 0;
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ if (256 > pfd->maxval) {
+ dptr[0] = (dk4_px_t)(((pfd->rows)[rowno])[2*colno]);
+ dptr[1] = (dk4_px_t)(((pfd->rows)[rowno])[2*colno+1]);
+ }
+ else {
+ dptr[0] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[4 * colno],
+ ((pfd->rows)[rowno])[4 * colno + 1]
+ );
+ dptr[1] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[4 * colno + 2],
+ ((pfd->rows)[rowno])[4 * colno + 3]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ if (256 > pfd->maxval) {
+ dptr[0] = (dk4_px_t)(((pfd->rows)[rowno])[4*colno]);
+ dptr[1] = (dk4_px_t)(((pfd->rows)[rowno])[4*colno+1]);
+ dptr[2] = (dk4_px_t)(((pfd->rows)[rowno])[4*colno+2]);
+ dptr[3] = (dk4_px_t)(((pfd->rows)[rowno])[4*colno+3]);
+ }
+ else {
+ dptr[0] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[8 * colno],
+ ((pfd->rows)[rowno])[8 * colno + 1]
+ );
+ dptr[1] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[8 * colno + 2],
+ ((pfd->rows)[rowno])[8 * colno + 3]
+ );
+ dptr[2] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[8 * colno + 4],
+ ((pfd->rows)[rowno])[8 * colno + 5]
+ );
+ dptr[3] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[8 * colno + 6],
+ ((pfd->rows)[rowno])[8 * colno + 7]
+ );
+ }
+ back = 1;
+ } break;
+ default : {
+
+
+#line 1871 "dk4bifn.ctr"
+ if (256 > pfd->maxval) {
+ for (i = 0; i < pfd->ch; i++) {
+ dptr[i] =
+ (dk4_px_t)(
+ ((pfd->rows)[rowno])[pfd->ch * colno + i]
+ );
+ }
+ }
+ else {
+ for (i = 0; i < pfd->ch; i++) {
+ dptr[i] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[2*(pfd->ch * colno + i)],
+ ((pfd->rows)[rowno])[2*(pfd->ch * colno + i)+1]
+ );
+ }
+ }
+ back = 1;
+ } break;
+ }
+ } break;
+ }
+
+ finished:
+
+
+#line 1895 "dk4bifn.ctr"
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifn.ctr b/support/dktools/dk4bifn.ctr
new file mode 100644
index 0000000000..e463e383d7
--- /dev/null
+++ b/support/dktools/dk4bifn.ctr
@@ -0,0 +1,1902 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_SYS_TYPES_H
+#ifndef SYS_TYPES_H_INCLUDED
+#include <sys/types.h>
+#define SYS_TYPES_H_INCLUDED1
+#endif
+#endif
+#if DK4_HAVE_STDINT_H
+#ifndef STDINT_H_INCLUDED
+#include <stdint.h>
+#define STDINT_H_INCLUDED 1
+#endif
+#endif
+#if DK4_HAVE_LIMITS_H
+#ifndef LIMITS_H_INCLUDED
+#include <limits.h>
+#define LIMITS_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4MAI8DSZ_H_INCLUDED
+#include "dk4mai8dsz.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Data to save between applying bytes.
+*/
+typedef struct {
+ dk4_bif_t *bif; /**< The result. */
+ size_t nums[4]; /**< Width, height, maxval. */
+ int magnum; /**< Magic number. */
+ int tupt; /**< Tuple type for DK4_NETPBM_P7. */
+} dk4_bif_netpbm_builder_t;
+
+
+
+/** Pointer to unsigned character.
+*/
+typedef unsigned char *dk4_puchar_t;
+
+
+
+static const char * const dk4netpbm_p7_kw[] = {
+$!string-table
+#
+# 0
+#
+WIDTH
+#
+# 1
+#
+HEIGHT
+#
+# 2
+#
+DEPTH
+#
+# 3
+#
+MAXVAL
+#
+# 4
+#
+TUPLTYPE
+#
+# 5
+#
+ENDHDR
+$!end
+};
+
+
+
+/** Tuple types.
+*/
+static const char * const dk4netpbm_p7_tut[] = {
+$!string-table
+BLACKANDWHITE
+GRAYSCALE
+RGB
+BLACKANDWHITE_ALPHA
+GRAYSCALE_ALPHA
+RGB_ALPHA
+$!end
+};
+
+
+
+void
+dk4bifnetpbm_nc_release_per_frame_data(
+ void *tsdata
+)
+{
+ dk4_bif_netpbm_per_frame_t *pfd; /* Per-frame data */
+ size_t i; /* Traverse all rows */
+ $? "+ dk4bifnetpbm_nc_release_per_frame_data"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+#endif
+ if (NULL != tsdata) {
+ pfd = (dk4_bif_netpbm_per_frame_t *)tsdata;
+ if (NULL != pfd->rows) { $? ". release rows"
+ for (i = 0; i < (size_t)(pfd->h); i++) {
+ $? ". release row %u", (unsigned)i
+ dk4mem_release((pfd->rows)[i]);
+ }
+ dk4mem_free(pfd->rows);
+ }
+ pfd->rows = NULL; $? ". w = %u", (unsigned)(pfd->w)
+ pfd->w = 0; $? ". h = %u", (unsigned)(pfd->h)
+ pfd->h = 0; $? ". ch = %u", (unsigned)(pfd->ch)
+ pfd->ch = 0; $? ". bpr = %u", (unsigned)(pfd->bpr)
+ pfd->bpr = 0; $? ". tupt = %d", (int)(pfd->tupt)
+ pfd->tupt = 0; $? ". maxval = %u", (unsigned)(pfd->maxval)
+ pfd->maxval = 0; $? ". bpc = %u", (unsigned)(pfd->bpc)
+ pfd->bpc = 0; $? ". magnum = %d", (int)(pfd->magnum)
+ pfd->magnum = 0;
+ dk4mem_free(tsdata);
+ }
+ $? "- dk4bifnetpbm_nc_release_per_frame_data"
+}
+
+
+
+static
+int
+dk4_bif_netpbm_check_input(
+ size_t w,
+ size_t h,
+ size_t maxval,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4_bif_netpbm_check_input"
+ $? ". w = %u", (unsigned)w
+ $? ". h = %u", (unsigned)h
+ $? ". maxval = %u", (unsigned)maxval
+ if ((0 < w) && (0 < h) && (0 < maxval)) {
+ if ((dk4_um_t)(LONG_MAX) >= (dk4_um_t)w) {
+ if ((dk4_um_t)(LONG_MAX) >= (dk4_um_t)h) {
+ if ((dk4_um_t)(DK4_U16_MAX) >= (dk4_um_t)maxval) {
+ back = 1;
+ }
+ }
+ }
+ }
+ if (0 == back) {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ $? "- dk4_bif_netpbm_check_input %d", back
+ return back;
+}
+
+
+
+static
+dk4_bif_netpbm_per_frame_t *
+dk4bifnetpbm_tsdata_new(
+ int magnum,
+ int tupt,
+ size_t ch,
+ size_t w,
+ size_t h,
+ size_t maxval,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report for math op */
+ dk4_bif_netpbm_per_frame_t *back = NULL;
+ size_t i = 0; /* Traverse all rows */
+ int ok = 0; /* Flag: Success, no errors */
+ $? "+ dk4bifnetpbm_tsdata_new"
+ if (0 != dk4_bif_netpbm_check_input(w, h, maxval, erp)) {
+ back = dk4mem_new(dk4_bif_netpbm_per_frame_t,1,erp);
+ if (NULL != back) { $? ". allocation ok"
+ dk4error_init(&er);
+ back->rows = NULL;
+ back->w = (dk4_bif_dim_t)w; $? ". w = %u", (unsigned)w
+ back->h = (dk4_bif_dim_t)h; $? ". h = %u", (unsigned)h
+ back->ch = 0; /* Number of channels */
+ back->vpr = 0; /* Values per row */
+ back->bpr = 0; /* Bytes per row */
+ back->magnum = magnum; $? ". magic number = %d", magnum
+ back->tupt = tupt; $? ". tuple type = %d", tupt
+ back->maxval = (dk4_px_t)maxval; $? ". maxval = %u", (unsigned)maxval
+ back->bpc = (dk4_px_bit_depth_t)dk4pxbit_get_bitno((dk4_px_t)maxval);
+ $? ". bpc = %u", (unsigned)(back->bpc)
+ switch (magnum) {
+ case DK4_NETPBM_P1 : case DK4_NETPBM_P4 : {
+ back->ch = 1;
+ back->vpr = w;
+ back->bpr = w / 8;
+ if (0 != (w % 8)) { back->bpr += 1; }
+ } break;
+ case DK4_NETPBM_P2 : case DK4_NETPBM_P5 : {
+ back->ch = 1;
+ back->vpr = w;
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_P3 : case DK4_NETPBM_P6 : {
+ back->ch = 3;
+ back->vpr = dk4ma_size_t_mul(3, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_P7 : {
+ switch (tupt) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ back->ch = 1;
+ back->vpr = w;
+ back->bpr = w;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ back->ch = 1;
+ back->vpr = w;
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ back->ch = 3;
+ back->vpr = dk4ma_size_t_mul(3, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ back->ch = 2;
+ back->vpr = dk4ma_size_t_mul(2, w, &er);
+ back->bpr = back->vpr;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ back->ch = 2;
+ back->vpr = dk4ma_size_t_mul(2, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ back->ch = 4;
+ back->vpr = dk4ma_size_t_mul(4, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ default : { $? ". no tuple type, using ch"
+ back->ch = ch;
+ back->vpr = dk4ma_size_t_mul(ch, w, &er);
+ back->bpr = back->vpr;
+ if (255 < maxval) {
+ back->bpr = dk4ma_size_t_mul(2, back->vpr, &er);
+ }
+ } break;
+ }
+ } break;
+ }
+ (void)dk4ma_size_t_mul(h,sizeof(dk4_puchar_t),&er);
+ if (DK4_E_NONE == er.ec) { $? ". no numeric overflows"
+ if (0 < back->bpr) {
+ back->rows = dk4mem_new(dk4_puchar_t,h,erp);
+ if (NULL != back->rows) { $? ". rows array allocated"
+ for (i = 0; i < h; i++) { (back->rows)[i] = NULL; }
+ ok = 1;
+ for (i = 0; i < h; i++) {
+ (back->rows)[i] =
+ dk4mem_new(unsigned char,back->bpr,erp);
+ if (NULL != (back->rows)[i]) {
+ DK4_MEMRES((back->rows)[i],back->bpr);
+ $? ". row allocation ok %u", (unsigned)i
+ }
+ else { $? "! row allocation failed %u", (unsigned)i
+ ok = 0;
+ }
+ }
+ }
+ }
+ }
+ else { $? "! at least one numeric overflow"
+ dk4error_copy(erp, &er);
+ }
+ if (0 == ok) { $? "! can not recover from previous errors"
+ dk4bifnetpbm_nc_release_per_frame_data(back);
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+ $? ". rows = %d", TR_IPTR(back->rows)
+ $? ". w = %u", (unsigned)(back->w)
+ $? ". h = %u", (unsigned)(back->h)
+ $? ". ch = %u", (unsigned)(back->ch)
+ $? ". maxval = %u", (unsigned)(back->maxval)
+ $? ". bpc = %u", (unsigned)(back->bpc)
+ $? ". vpr = %u", (unsigned)(back->vpr)
+ $? ". bpr = %u", (unsigned)(back->bpr)
+ $? ". magnum = %d", back->magnum
+ $? ". tupt = %d", back->tupt
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! allocation failed"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! check failed"
+ }
+#endif
+ $? "- dk4bifnetpbm_tsdata_new %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Copy original data to frame information.
+ @param cf Frame data to fill.
+ @param pfd Original per frame data.
+*/
+static
+void
+dk4bifnetpbm_fill_frame(
+ dk4_bif_frame_t *cf,
+ void const *voptr
+)
+{
+ dk4_bif_netpbm_per_frame_t const *pfd;
+ $? "+ dk4bifnetpbm_fill_frame"
+#if DK4_USE_ASSERT
+ assert(NULL != cf);
+#endif
+ pfd = (dk4_bif_netpbm_per_frame_t *)voptr;
+ cf->n_comp =
+ cf->dim_x = pfd->w;
+ cf->dim_y = pfd->h;
+ switch (pfd->magnum) {
+ case DK4_NETPBM_P1 : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = 1;
+ } break;
+ case DK4_NETPBM_P2 : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P3 : {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P4 : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P5 : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P6 : {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_P7 : {
+ switch (pfd->tupt) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ default : {
+ $? ". no tuple type, using ch"
+ switch (pfd->ch) {
+ case 1: {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case 2: {
+ cf->l_cs = cf->f_cs = DK4_CS_GRAY_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case 3: {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ case 4: {
+ cf->l_cs = cf->f_cs = DK4_CS_RGB_ALPHA;
+ cf->l_bdepth = cf->r_bdepth = pfd->bpc;
+ } break;
+ }
+ } break;
+ }
+ } break;
+ }
+ cf->bglbd[0] = pfd->maxval;
+ cf->bglbd[1] = pfd->maxval;
+ cf->bglbd[2] = pfd->maxval;
+ cf->bglbd[3] = pfd->maxval;
+ if (pfd->maxval != dk4pxbit_get_max(pfd->bpc)) {
+ cf->fmres = 1;
+ cf->fmrmv = pfd->maxval;
+ dk4pxres_setup_from_maxval(&(cf->resampler), pfd->maxval, pfd->bpc);
+ cf->bg[0] = dk4pxbit_get_max(pfd->bpc);
+ cf->bg[1] = cf->bg[2] = cf->bg[3] = cf->bg[0];
+ }
+ else {
+ dk4pxres_setup(&(cf->resampler), cf->l_bdepth, cf->l_bdepth);
+ cf->bg[0] = pfd->maxval;
+ cf->bg[1] = pfd->maxval;
+ cf->bg[2] = pfd->maxval;
+ cf->bg[3] = pfd->maxval;
+ }
+#if TRACE_DEBUG
+ $? ". bg[0] = %u", (unsigned)(cf->bg[0])
+ $? ". bg[1] = %u", (unsigned)(cf->bg[1])
+ $? ". bg[2] = %u", (unsigned)(cf->bg[2])
+ $? ". bg[3] = %u", (unsigned)(cf->bg[3])
+ $? ". bglbd[0] = %u", (unsigned)(cf->bglbd[0])
+ $? ". bglbd[1] = %u", (unsigned)(cf->bglbd[1])
+ $? ". bglbd[2] = %u", (unsigned)(cf->bglbd[2])
+ $? ". bglbd[3] = %u", (unsigned)(cf->bglbd[3])
+ $? ". hbg = %d", cf->hbg
+ $? ". res_x = %lg", cf->res_x
+ $? ". res_y = %lg", cf->res_y
+ $? ". fno = %u", (unsigned)(cf->fno)
+ $? ". n_comp = %u", (unsigned)(cf->n_comp)
+ $? ". dim_x = %u", (unsigned)(cf->dim_x)
+ $? ". dim_y = %u", (unsigned)(cf->dim_y)
+ $? ". l_cs = %d", cf->l_cs
+ $? ". f_cs = %d", cf->f_cs
+ $? ". l_bdepth = %u", (unsigned)(cf->l_bdepth)
+ $? ". r_bdepth = %u", (unsigned)(cf->r_bdepth)
+ $? ". r.nom = %lu", cf->resampler.nom
+ $? ". r.denom = %lu", cf->resampler.denom
+ $? ". r.denom2 = %lu", cf->resampler.denom2
+#endif
+ $? "- dk4bifnetpbm_fill_frame"
+}
+
+
+
+/** Initialize builder before applying any data.
+ @param pbuilder Builder to initialize.
+ @return 1 on success, 0 on error (memory).
+*/
+static
+int
+dk4_bif_netpbm_builder_initialize(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ const dkChar *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4_bif_netpbm_builder_initialize"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+#endif
+ pbuilder->bif = NULL;
+ pbuilder->magnum = 0;
+
+ pbuilder->bif = dk4biftool_nc_new_for_one_frame(
+ fn, DK4_BIF_TYPE_NETPBM, honly, pcsctx, erp
+ );
+ if (NULL != pbuilder->bif) {
+ back = 1;
+ }
+ $? "- dk4_bif_netpbm_builder_initialize %d", back
+ return back;
+}
+
+
+
+/** Clean up builder.
+ @param pbuilder Builder to clean up.
+*/
+static
+void
+dk4_bif_netpbm_builder_cleanup(dk4_bif_netpbm_builder_t *pbuilder)
+{
+ $? "+ dk4_bif_netpbm_builder_cleanup"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+#endif
+ if (NULL != pbuilder->bif) {
+ dk4bif_close(pbuilder->bif);
+ pbuilder->bif = NULL;
+ }
+ $? "- dk4_bif_netpbm_builder_cleanup"
+}
+
+
+
+/** Attempt to read magic number and one whitespace from file.
+ For a sequence of frames (sequence of NetPBM images) we might
+ have white spaces between frame data and the magic number of the
+ following frame, so we ignore leading white spaces if the
+ havefr flag is set.
+ @param pbuilder Image builder structure.
+ @param fipo Input file, opened for binary reading.
+ @param havefr Flag: Already have previous frame.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on end of file, -1 on error.
+*/
+static
+int
+dk4bifnetpbm_read_magic_number(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ FILE *fipo,
+ int havefr,
+ dk4_er_t *erp
+)
+{
+ int cc = 1; /* Flag: Can continue */
+ int c = 0; /* Input character */
+ int inco = 0; /* Flag: In comment */
+ int back = -1;
+
+ $? "+ dk4bifnetpbm_read_magic_number"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+ assert(NULL != fipo);
+#endif
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ cc = -1;
+ back = 0;
+ } break;
+ case 'P' : {
+ cc = 0;
+ } break;
+ case '#' : {
+ inco = 1;
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ inco = 0;
+ cc = -1;
+ back = 0;
+ } break;
+ case '\n' : {
+ inco = 0;
+ } break;
+ }
+ } while (1 == inco);
+ } break;
+ case ' ' :
+ case '\t' :
+ case '\r' :
+ case '\n' :
+ case '\v' :
+ case '\f' : {
+ if (0 == havefr) {
+ cc = -1;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ } break;
+ default : {
+ cc = -1;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ } break;
+ }
+ } while (1 == cc);
+ switch (cc) {
+ case 0 : { /* P was read */
+ back = 1;
+ c = fgetc(fipo);
+ switch (c) {
+ case '1' : {
+ pbuilder->magnum = DK4_NETPBM_P1;
+ } break;
+ case '2' : {
+ pbuilder->magnum = DK4_NETPBM_P2;
+ } break;
+ case '3' : {
+ pbuilder->magnum = DK4_NETPBM_P3;
+ } break;
+ case '4' : {
+ pbuilder->magnum = DK4_NETPBM_P4;
+ } break;
+ case '5' : {
+ pbuilder->magnum = DK4_NETPBM_P5;
+ } break;
+ case '6' : {
+ pbuilder->magnum = DK4_NETPBM_P6;
+ } break;
+ case '7' : {
+ pbuilder->magnum = DK4_NETPBM_P7;
+ } break;
+ default : {
+ back = -1;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ } break;
+ }
+ if (1 == back) {
+ c = fgetc(fipo);
+ back = -1;
+ switch (c) {
+ case ' ' :
+ case '\t' :
+ case '\r' :
+ case '\n' :
+ case '\v' :
+ case '\f' : {
+ back = 1;
+ } break;
+ }
+ }
+ } break;
+ default : { /* Failed */
+ /* Empty by intent. */
+ } break;
+ }
+ $? "- dk4bifnetpbm_read_magic_number %d", back
+ return back;
+}
+
+
+
+static
+size_t
+dk4bifnetpbm_digit(char c)
+{
+ size_t back = 0;
+ $? "+ dk4bifnetpbm_digit %c", c
+ switch (c) {
+ case '1' : { back = 1; } break;
+ case '2' : { back = 2; } break;
+ case '3' : { back = 3; } break;
+ case '4' : { back = 4; } break;
+ case '5' : { back = 5; } break;
+ case '6' : { back = 6; } break;
+ case '7' : { back = 7; } break;
+ case '8' : { back = 8; } break;
+ case '9' : { back = 9; } break;
+ }
+ $? "- dk4bifnetpbm_digit %u", (unsigned)back
+ return back;
+}
+
+
+
+/** Read NetPBM header (2 or 3 decimal numbers), optionally containing
+ a comment.
+ We must have
+ - white space(s),
+ - 2 or 3 decimal numbers separated by white space(s),
+ - one white space at end as separator between header and data.
+ @param fipo Input file, opened for binary reading.
+ @param numbuf Destination buffer for decimal numbers.
+ @param sznb Buffer size (number of numbers).
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_header_16(
+ FILE *fipo,
+ size_t *numbuf,
+ size_t sznb,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report */
+ size_t i; /* Traverse all numbers */
+ size_t val = 0; /* Value to store in current number */
+ size_t found = 0; /* Number of completed numbers */
+ int back = 0;
+ int inco = 0; /* Flag: In comment */
+ int st = 0; /* State: 0=in space, 1=in number */
+ int c = 0; /* Current character to process */
+ int cc = 1; /* Flag: 1=can continue, 0=finished, -1=error */
+ $? "+ dk4bifnetpbm_read_header_16"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != numbuf);
+ assert(0 < sznb);
+#endif
+ for (i = 0; i < sznb; i++) { numbuf[i] = 0; }
+ dk4error_init(&er);
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ cc = -1;
+ if (0 != st) {
+ numbuf[found++] = val;
+ val = 0;
+ }
+ } break;
+ case '#' : {
+ if (0 != st) {
+ numbuf[found++] = val;
+ val = 0;
+ st = 0;
+ }
+ inco = 1;
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ inco = 0; cc = -1;
+ } break;
+ case '\n' : {
+ inco = 0;
+ } break;
+ }
+ } while (1 == inco);
+ } break;
+ case '0' : case '1' : case '2' : case '3' : case '4' :
+ case '5' : case '6' : case '7' : case '8' : case '9' : {
+ if (0 != st) {
+ val = dk4ma_size_t_add(
+ dk4ma_size_t_mul(val, 10, &er),
+ dk4bifnetpbm_digit(c), &er
+ );
+ }
+ else {
+ val = dk4bifnetpbm_digit(c);
+ st = 1;
+ }
+ } break;
+ case ' ': case '\t': case '\r': case '\n': case '\v': case '\f': {
+ if (0 != st) {
+ numbuf[found++] = val;
+ val = 0;
+ if (found == sznb) {
+ cc = 0;
+ back = 1;
+ }
+ }
+ else {
+ if (found == sznb) {
+ cc = 0;
+ back = 1;
+ }
+ }
+ st = 0;
+ } break;
+ default : {
+ cc = -1;
+ } break;
+ }
+ } while (1 == cc);
+ if (DK4_E_NONE != er.ec) {
+ back = 0;
+ }
+#if TRACE_DEBUG
+ for (i = 0; i < found; i++) {
+ $? ". num[%u] = %lu", (unsigned)i, (unsigned long)(numbuf[i])
+ }
+#endif
+ if (1 == back) {
+ for (i = 0; i < found; i++) {
+ if (0 == numbuf[i]) {
+ back = 0;
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ $? "- dk4bifnetpbm_read_header_16 %d", back
+ return back;
+}
+
+
+
+/** Check configuration data from P7 lines.
+ @param w Image width.
+ @param h Image height.
+ @param ch Number of channels in image.
+ @param maxval Maximum component value.
+ @param tuptp Address of tuple type variable.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_check_p7(
+ size_t w,
+ size_t h,
+ size_t ch,
+ size_t maxval,
+ int *tuptp,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4bifnetpbm_check_p7"
+ $? ". w = %u", (unsigned)w
+ $? ". h = %u", (unsigned)h
+ $? ". ch = %u", (unsigned)ch
+ $? ". maxval = %u", (unsigned)maxval
+ $? ". tupt = %d", *tuptp
+ if ((0 == ch) && (0 <= *tuptp)) {
+ switch (*tuptp) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ ch = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ ch = 1;
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ ch = 3;
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ ch = 2;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ ch = 2;
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ ch = 4;
+ } break;
+#if TRACE_DEBUG
+ default : {
+ $? "! can not retrieve channel number from tuple type"
+ } break;
+#endif
+ }
+ }
+ else {
+ if ((0 < ch) && (0 > *tuptp)) {
+ switch (ch) {
+ case 1 : {
+ *tuptp = DK4_NETPBM_TT_GRAYSCALE;
+ } break;
+ case 2 : {
+ *tuptp = DK4_NETPBM_TT_GRAYSCALE_ALPHA;
+ } break;
+ case 3 : {
+ *tuptp = DK4_NETPBM_TT_RGB;
+ } break;
+ case 4 : {
+ *tuptp = DK4_NETPBM_TT_RGB_ALPHA;
+ } break;
+ }
+ }
+ }
+ if (0 != dk4_bif_netpbm_check_input(w, h, maxval, erp)) {
+ if ((0 != ch) && (0 <= *tuptp)) {
+ switch (*tuptp) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ if (1 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ if (1 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ if (3 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ if (2 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ if (2 == ch) { back = 1; }
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ if (4 == ch) { back = 1; }
+ } break;
+#if TRACE_DEBUG
+ default : {
+ $? ". Unknown tuple type, skipping check"
+ } break;
+#endif
+ }
+ }
+ }
+ $? "- dk4bifnetpbm_check_p7 %d", back
+ return back;
+}
+
+
+
+/** Read binary data for one row.
+ @param row Address of row buffer to fill.
+ @param fipo Input file, opened for binary reading.
+ @param nbytes Number of bytes for row.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_row(
+ unsigned char *row,
+ FILE *fipo,
+ size_t nbytes,
+ dk4_er_t *erp
+)
+{
+ size_t rdbytes = 0; /* Number of bytes read */
+ int back = 1;
+ $? "+ dk4bifnetpbm_read_row %u", (unsigned)nbytes
+#if DK4_USE_ASSERT
+ assert(NULL != row);
+ assert(NULL != fipo);
+#endif
+ /*
+ Normally one fread attempt should be sufficient.
+ But sometimes multiple attempts are needed if
+ an fread returns a small portion of data only.
+ Reading 0 bytes means either end of file or read error.
+ */
+ do {
+ rdbytes = fread(row, 1, nbytes, fipo);
+ if (0 < rdbytes) {
+ if (rdbytes >= nbytes) {
+ nbytes = 0;
+ }
+ else {
+ nbytes -= rdbytes;
+ row = &(row[rdbytes]);
+ }
+ }
+ else {
+ back = 0;
+ }
+ } while ((0 < nbytes) && (1 == back));
+ if (0 == back) {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ $? "- dk4bifnetpbm_read_row %d", back
+ return back;
+}
+
+
+
+/** Read binary raster data.
+ @param tsdata Per-frame NetPBM data.
+ @param fipo Input file, opened for binary reading.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_binary(
+ void *tsdata,
+ FILE *fipo,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_netpbm_per_frame_t *pfd = NULL; /* Per-frame data */
+ unsigned char **row = NULL; /* Array of row pointers */
+ size_t i; /* Traverse all rows */
+ int back = 0;
+ $? "+ dk4bifnetpbm_read_binary"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+ assert(NULL != fipo);
+#endif
+ pfd = (dk4_bif_netpbm_per_frame_t *)tsdata;
+ row = pfd->rows;
+ back = 1;
+ for (i = 0; i < (size_t)(pfd->h); i++) {
+ if (0 == dk4bifnetpbm_read_row(*(row++), fipo, pfd->bpr, erp)) {
+ back = 0; i = pfd->h;
+ }
+ }
+ $? "- dk4bifnetpbm_read_binary %d", back
+ return back;
+}
+
+
+
+
+/** Read frame contents (NetPBM image) after magic number P7.
+ @param pbuilder Image builder structure.
+ @param fipo Input file, opened for binary reading.
+ @param havefr Flag: Already have frame.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_p7(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ FILE *fipo,
+ int havefr,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report */
+ char *tok[256]; /* Tokens in input line */
+ char il[256]; /* Input line */
+ const char *ep = NULL; /* End pointer */
+ size_t ilp = 0; /* Current position in input line */
+ size_t ntok = 0; /* Number of tokens in line */
+ size_t w = 0; /* Image width */
+ size_t h = 0; /* Image height */
+ size_t ch = 0; /* Number of channels */
+ size_t maxval = 0; /* Maximum component value */
+ int back = 0; /* Function result */
+ int cc = 1; /* Can continue (1=yes, 0=no, -1=error) */
+ int hdt = 0; /* Header line type */
+ int res = 0; /* Operation result */
+ int tupt = -1; /* Tuple type */
+ int c;
+ $? "+ dk4bifnetpbm_read_p7"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+ assert(NULL != fipo);
+#endif
+ DK4_MEMRES(il,sizeof(il));
+ dk4error_init(&er);
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ cc = -1;
+ } break;
+ case '\n' : {
+ il[ilp] = '\0';
+ ntok = dk4str8_tokenize(tok, 256, il, NULL, erp);
+ $? ". ntok = %u", (unsigned)ntok
+ if (0 < ntok) {
+ hdt = dk4str8_array_index(dk4netpbm_p7_kw, tok[0], 0);
+ $? ". hdt = %d", hdt
+ switch (hdt) {
+ case 0: { /* WIDTH */
+ if (1 < ntok) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t_simple(
+ &w, tok[1], &ep, 1, erp
+ );
+ if (0 == res) {
+ cc = -1;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 1: { /* HEIGHT */
+ if (1 < ntok) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t_simple(
+ &h, tok[1], &ep, 1, erp
+ );
+ if (0 == res) {
+ cc = -1;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 2: { /* DEPTH */
+ if (1 < ntok) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t_simple(
+ &ch, tok[1], &ep, 1, erp
+ );
+ if (0 == res) {
+ cc = -1;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 3: { /* MAXVAL */
+ if (1 < ntok) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t_simple(
+ &maxval, tok[1], &ep, 1, erp
+ );
+ if (0 == res) {
+ cc = -1;
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 4: { /* TUPLTYPE */
+ if (1 < ntok) {
+ tupt = dk4str8_array_index(
+ dk4netpbm_p7_tut, tok[1], 0
+ );
+ if (0 > tupt) {
+ $? ". ignore unknown tuple type"
+ $? ". type=\"%!8s\"", tok[1]
+ /* 2018-03-14
+ Simply ignore unkown tuple types.
+ */
+ }
+ }
+ else {
+ cc = -1;
+ }
+ } break;
+ case 5: { /* ENDHDR */
+ cc = -1;
+ res = dk4bifnetpbm_check_p7(
+ w, h, ch, maxval, &tupt, erp
+ );
+ if (0 != res) {
+ back = 1;
+ if (0 != havefr) {
+ back = dk4biftool_nc_add_frame(
+ pbuilder->bif, erp
+ );
+ }
+ if (1 == back) {
+ back = 0;
+ pbuilder->bif->cf->tsdata =
+ dk4bifnetpbm_tsdata_new(
+ DK4_NETPBM_P7,tupt,ch,w,h,maxval,erp
+ );
+ if (NULL != pbuilder->bif->cf->tsdata) {
+ cc = 0;
+ dk4bifnetpbm_fill_frame(
+ pbuilder->bif->cf,
+ pbuilder->bif->cf->tsdata
+ );
+ }
+ }
+ }
+ } break;
+ default : {
+ cc = -1;
+ } break;
+ }
+ }
+ else {
+ /* Empty line is ok */
+ }
+ DK4_MEMRES(il,sizeof(il));
+ ilp = 0;
+ } break;
+ default : {
+ il[ilp++] = (char)c;
+ if (sizeof(il) <= ilp) {
+ cc = -1;
+ }
+ } break;
+ }
+ } while (1 == cc);
+ $? ". w = %u", (unsigned)w
+ $? ". h = %u", (unsigned)h
+ $? ". ch = %u", (unsigned)ch
+ $? ". maxval = %u", (unsigned)maxval
+ $? ". tupt = %d", tupt
+ if (0 == cc) {
+ /*
+ Read raster data
+ */
+ back = dk4bifnetpbm_read_binary(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ }
+ $? "- dk4bifnetpbm_read_p7 %d", back
+ return back;
+}
+
+
+
+/** Read bit values as text.
+ @param tsdata Per-frame NetPBM data.
+ @param fipo Input file, opened for binary reading.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_bits_text(
+ void *tsdata,
+ FILE *fipo,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_netpbm_per_frame_t *pfd; /* Per-frame data */
+ size_t rowno = 0; /* Current row number */
+ size_t valno = 0; /* Current value number */
+ size_t byteno = 0; /* Byte number within row */
+ size_t bitno = 0; /* Bit number within byte */
+ int back = 1;
+ int cc = 1; /* Flag: Can continue */
+ int c; /* Current input character */
+ unsigned char uc; /* Byte to save */
+ $? "+ dk4bifnetpbm_read_bits_text"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+ assert(NULL != fipo);
+#endif
+ pfd = (dk4_bif_netpbm_per_frame_t *)tsdata;
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ cc = -1;
+ back = 0;
+ } break;
+ case '0' : case '1' : {
+ if ('1' == c) {
+ byteno = valno / 8;
+ bitno = valno % 8;
+ uc = (unsigned char)dk4pxbit_get_bit(7 - bitno);
+ ((pfd->rows)[rowno])[byteno] |= uc;
+ }
+ valno++;
+ if (valno >= pfd->vpr) {
+ valno = 0;
+ rowno++;
+ if (rowno >= (size_t)(pfd->h)) {
+ cc = 0;
+ }
+ }
+ } break;
+ case ' ' :
+ case '\t' :
+ case '\r' :
+ case '\n' :
+ case '\v' :
+ case '\f' : {
+ } break;
+ default : {
+ cc = -1;
+ } break;
+ }
+ } while (1 == cc);
+ if (0 == cc) {
+ do {
+ c = fgetc(fipo);
+ } while ((EOF != c) && (0 == feof(fipo)) && (0 == ferror(fipo)));
+ }
+ if (0 == back) {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ $? "- dk4bifnetpbm_read_bits_text"
+ return back;
+}
+
+
+
+/** Read pixel component values as text.
+ @param tsdata Per-frame NetPBM data.
+ @param fipo Input file, opened for binary reading.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_values_from_text(
+ void *tsdata,
+ FILE *fipo,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report for math */
+ dk4_bif_netpbm_per_frame_t *pfd = NULL; /* Per-frame data */
+ size_t rowno = 0; /* Current row number */
+ size_t valno = 0; /* Current value number */
+ size_t value = 0; /* Sample value */
+ int back = 1;
+ int st = 0; /* State: 1=in number */
+ int cc = 1; /* Flag: Can continue */
+ int c; /* Current character */
+ unsigned char uc; /* Byte to save */
+ $? "+ dk4bifnetpbm_read_values_from_text"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+ assert(NULL != fipo);
+#endif
+ pfd = (dk4_bif_netpbm_per_frame_t *)tsdata;
+ dk4error_init(&er);
+ do {
+ c = fgetc(fipo);
+ switch (c) {
+ case EOF : {
+ if (0 != st) {
+ cc = -1;
+ back = 0;
+ if (value <= pfd->maxval) {
+ if (256 > pfd->maxval) {
+ uc = (unsigned char)value;
+ ((pfd->rows)[rowno])[valno] = uc;
+ }
+ else {
+ uc = (value >> 8) & 0x00FFU;
+ ((pfd->rows)[rowno])[2 * valno] = uc;
+ uc = value & 0x00FFU;
+ ((pfd->rows)[rowno])[2 * valno + 1] = uc;
+ }
+ valno++;
+ if (valno >= pfd->vpr) {
+ valno = 0;
+ rowno++;
+ if (rowno >= (size_t)(pfd->h)) {
+ back = 1;
+ }
+ }
+ }
+ }
+ else {
+ cc = -1;
+ back = 0;
+ }
+ } break;
+ case '0' : case '1' : case '2' : case '3' : case '4' :
+ case '5' : case '6' : case '7' : case '8' : case '9' : {
+ if (0 != st) {
+ value = dk4ma_size_t_add(
+ dk4ma_size_t_mul(value, 10, &er),
+ dk4bifnetpbm_digit(c), &er
+ );
+ }
+ else {
+ value = dk4bifnetpbm_digit(c);
+ }
+ st = 1;
+ } break;
+ case ' ' :
+ case '\t' :
+ case '\r' :
+ case '\n' :
+ case '\v' :
+ case '\f' : {
+ if (0 != st) {
+ if (value <= pfd->maxval) {
+ if (256 > pfd->maxval) {
+ uc = (unsigned char)value;
+ ((pfd->rows)[rowno])[valno] = uc;
+ }
+ else {
+ uc = (value >> 8) & 0x00FFU;
+ ((pfd->rows)[rowno])[2 * valno] = uc;
+ uc = value & 0x00FFU;
+ ((pfd->rows)[rowno])[2 * valno + 1] = uc;
+ }
+ valno++;
+ if (valno >= pfd->vpr) {
+ valno = 0;
+ rowno++;
+ if (rowno >= (size_t)(pfd->h)) {
+ back = 1;
+ cc = 0;
+ }
+ }
+ }
+ else {
+ cc = -1;
+ back = 0;
+ }
+ }
+ st = 0;
+ } break;
+ default : {
+ cc = -1;
+ back = 0;
+ } break;
+ }
+ } while (1 == cc);
+ if (0 == cc) {
+ do {
+ c = fgetc(fipo);
+ } while ((EOF != c) && (0 == feof(fipo)) && (0 == ferror(fipo)));
+ }
+ if (DK4_E_NONE != er.ec) {
+ back = 0;
+ }
+ if (0 == back) {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ $? "- dk4bifnetpbm_read_values_from_text %d", back
+ return back;
+}
+
+
+
+/** Read frame contents (NetPBM image) after magic number.
+ @param pbuilder Image builder structure.
+ @param fipo Input file, opened for binary reading.
+ @param havefr Flag: Already have a frame.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4bifnetpbm_read_frame_contents(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ FILE *fipo,
+ int havefr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4bifnetpbm_read_frame_contents"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+ assert(NULL != fipo);
+#endif
+ switch (pbuilder->magnum) {
+ case DK4_NETPBM_P1 :
+ case DK4_NETPBM_P4 :
+ {
+ back = dk4bifnetpbm_read_header_16(
+ fipo, &(pbuilder->nums[0]), 2, erp
+ );
+ if (1 == back) { $? ". read header ok"
+ back = 0;
+ if (0 != havefr) {
+ if (0 != dk4biftool_nc_add_frame(pbuilder->bif, erp)) {
+ back = 1;
+ }
+ }
+ else {
+ back = 1;
+ }
+ if (0 != back) {
+ back = 0;
+ pbuilder->bif->cf->tsdata = dk4bifnetpbm_tsdata_new(
+ pbuilder->magnum, pbuilder->tupt, 1,
+ pbuilder->nums[0], pbuilder->nums[1], 1,
+ erp
+ );
+ if (NULL != pbuilder->bif->cf->tsdata) {
+ dk4bifnetpbm_fill_frame(
+ pbuilder->bif->cf,
+ pbuilder->bif->cf->tsdata
+ );
+ if (DK4_NETPBM_P4 == pbuilder->magnum) {
+ back = dk4bifnetpbm_read_binary(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ }
+ else {
+ back = dk4bifnetpbm_read_bits_text(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ }
+ }
+ }
+ }
+ } break;
+ case DK4_NETPBM_P2 :
+ case DK4_NETPBM_P3 :
+ case DK4_NETPBM_P5 :
+ case DK4_NETPBM_P6 :
+ {
+ back = dk4bifnetpbm_read_header_16(
+ fipo, &(pbuilder->nums[0]), 3, erp
+ );
+ if (1 == back) { $? ". read header ok"
+ back = 0;
+ if (0 != havefr) {
+ if (0 != dk4biftool_nc_add_frame(pbuilder->bif, erp)) {
+ back = 1;
+ }
+ }
+ else {
+ back = 1;
+ }
+ if (0 != back) {
+ back = 0;
+ switch (pbuilder->magnum) {
+ case DK4_NETPBM_P2 : case DK4_NETPBM_P5 : {
+ pbuilder->bif->cf->tsdata = dk4bifnetpbm_tsdata_new(
+ pbuilder->magnum, pbuilder->tupt, 1,
+ pbuilder->nums[0], pbuilder->nums[1],
+ pbuilder->nums[2], erp
+ );
+ } break;
+ default : {
+ pbuilder->bif->cf->tsdata = dk4bifnetpbm_tsdata_new(
+ pbuilder->magnum, pbuilder->tupt, 3,
+ pbuilder->nums[0], pbuilder->nums[1],
+ pbuilder->nums[2], erp
+ );
+ } break;
+ }
+ if (NULL != pbuilder->bif->cf->tsdata) {
+ dk4bifnetpbm_fill_frame(
+ pbuilder->bif->cf,
+ pbuilder->bif->cf->tsdata
+ );
+ switch (pbuilder->magnum) {
+ case DK4_NETPBM_P5 : case DK4_NETPBM_P6 : {
+ back = dk4bifnetpbm_read_binary(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ } break;
+ default : {
+ back = dk4bifnetpbm_read_values_from_text(
+ pbuilder->bif->cf->tsdata, fipo, erp
+ );
+ } break;
+ }
+ }
+ }
+ }
+ } break;
+ case DK4_NETPBM_P7 :
+ {
+ back = dk4bifnetpbm_read_p7(pbuilder, fipo, havefr, erp);
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ } break;
+ }
+ $? "- dk4bifnetpbm_read_frame_contents %d", back
+ return back;
+}
+
+
+
+/** Read one frame (one image) from the input file and add it to builder.
+ @param pbuilder Image builder structure.
+ @param fipo Input file, opened for binary reading.
+ @param havefr Flag: Already have previous frame.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on end of file, -1 on error.
+*/
+static
+int
+dk4bifnetpbm_read_frame(
+ dk4_bif_netpbm_builder_t *pbuilder,
+ FILE *fipo,
+ int havefr,
+ dk4_er_t *erp
+)
+{
+ int back = -1;
+ $? "+ dk4bifnetpbm_read_frame"
+#if DK4_USE_ASSERT
+ assert(NULL != pbuilder);
+ assert(NULL != fipo);
+#endif
+ back = dk4bifnetpbm_read_magic_number(pbuilder, fipo, havefr, erp);
+ if (1 == back) {
+ back = dk4bifnetpbm_read_frame_contents(pbuilder, fipo, havefr, erp);
+ if (1 != back) {
+ back = -1;
+ }
+ }
+ $? "- dk4bifnetpbm_read_frame %d", back
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4bifnetpbm_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *back = NULL;
+ int res = 0; /* Operation result */
+ int havefr = 0; /* Flag: frames found */
+ dk4_bif_netpbm_builder_t builder; /* Builder structure */
+ $? "+ dk4bifnetpbm_nc_open_file"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ /* Initialize the builder
+ */
+ if (0 != dk4_bif_netpbm_builder_initialize(&builder,fn,honly,pcsctx,erp)) {
+
+ /* Attempt to read all frames from input
+ */
+ do {
+ res = dk4bifnetpbm_read_frame(&builder, fipo, havefr, erp);
+ switch (res) {
+ case 1: {
+ havefr = 1;
+ } break;
+ }
+ } while (0 < res);
+
+ /* On success (at least one frame was read, end of file
+ was found after last frame) return the builders collected data
+ */
+ if ((-1 != res) && (0 != havefr)) {
+ back = builder.bif;
+ builder.bif = NULL;
+ }
+
+ /* Finally clean up the builder
+ */
+ dk4_bif_netpbm_builder_cleanup(&builder);
+
+ }
+ $? "- dk4bifnetpbm_nc_open_file %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Combine two bytes into one 16 bit unsigned integer for pixel component.
+ @param msb Most significant byte.
+ @param lsb Least significant byte.
+ @return Pixel component value.
+*/
+static
+dk4_px_t
+dk4bifnetpbm_combine_bytes(unsigned char msb, unsigned char lsb)
+{
+ dk4_px_t back;
+ $? "+ dk4bifnetpbm_combine_bytes %x %x", (unsigned)msb, (unsigned)lsb
+ back = ((((dk4_px_t)msb) << 8) & ((dk4_px_t)0xFF00U))
+ | (((dk4_px_t)lsb) & ((dk4_px_t)0x00FFU));
+ $? "- dk4bifnetpbm_combine_bytes %x", back
+ return back;
+}
+
+
+int
+dk4bifnetpbm_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ dk4_bif_netpbm_per_frame_t *pfd = NULL; /* Per-frame data */
+ size_t byteno; /* Byte number to retrieve */
+ size_t bitno; /* Bit number within byte */
+ size_t i; /* Traverse components */
+ int back = 0;
+ unsigned char uc; /* Byte read from buffer */
+ $? "+ dk4bifnetpbm_nc_get_original_pixel"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bif);
+#endif
+ if (NULL == bif->cf) {
+ goto finished;
+ }
+ if (NULL == bif->cf->tsdata) {
+ goto finished;
+ }
+ pfd = (dk4_bif_netpbm_per_frame_t *)(bif->cf->tsdata);
+ if (NULL == pfd->rows) {
+ goto finished;
+ }
+ switch (pfd->magnum) {
+ case DK4_NETPBM_P1 : case DK4_NETPBM_P4 : {
+ byteno = (size_t)colno / 8;
+ bitno = (size_t)colno % 8;
+ uc = ((pfd->rows)[rowno])[byteno];
+ if (0 != (dk4pxbit_get_bit(7 - bitno) & uc)) {
+ *dptr = 0;
+ }
+ else {
+ *dptr = 1;
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_P2 : case DK4_NETPBM_P5 : {
+ if (256 > pfd->maxval) {
+ *dptr = (dk4_px_t)(((pfd->rows)[rowno])[colno]);
+ }
+ else {
+ *dptr = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[2 * colno],
+ ((pfd->rows)[rowno])[2 * colno + 1]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_P3 : case DK4_NETPBM_P6 : {
+ if (256 > pfd->maxval) {
+ dptr[0] = (dk4_px_t)(((pfd->rows)[rowno])[3 * colno]);
+ dptr[1] = (dk4_px_t)(((pfd->rows)[rowno])[3 * colno + 1]);
+ dptr[2] = (dk4_px_t)(((pfd->rows)[rowno])[3 * colno + 2]);
+ }
+ else {
+ dptr[0] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno],
+ ((pfd->rows)[rowno])[6 * colno + 1]
+ );
+ dptr[1] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno + 2],
+ ((pfd->rows)[rowno])[6 * colno + 3]
+ );
+ dptr[2] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno + 4],
+ ((pfd->rows)[rowno])[6 * colno + 5]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_P7 : {
+ switch (pfd->tupt) {
+ case DK4_NETPBM_TT_BLACKANDWHITE : {
+ if (0 != ((pfd->rows)[rowno])[colno]) {
+ *dptr = 1;
+ }
+ else {
+ *dptr = 0;
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE : {
+ if (256 > pfd->maxval) {
+ *dptr = (dk4_px_t)(((pfd->rows)[rowno])[colno]);
+ }
+ else {
+ *dptr = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[2 * colno],
+ ((pfd->rows)[rowno])[2 * colno + 1]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_RGB : {
+ if (256 > pfd->maxval) {
+ dptr[0] = (dk4_px_t)(((pfd->rows)[rowno])[3*colno]);
+ dptr[1] = (dk4_px_t)(((pfd->rows)[rowno])[3*colno+1]);
+ dptr[2] = (dk4_px_t)(((pfd->rows)[rowno])[3*colno+2]);
+ }
+ else {
+ dptr[0] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno],
+ ((pfd->rows)[rowno])[6 * colno + 1]
+ );
+ dptr[1] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno + 2],
+ ((pfd->rows)[rowno])[6 * colno + 3]
+ );
+ dptr[2] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[6 * colno + 4],
+ ((pfd->rows)[rowno])[6 * colno + 5]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_BLACKANDWHITE_ALPHA : {
+ if (0 != ((pfd->rows)[rowno])[2 * colno]) {
+ dptr[0] = 1;
+ }
+ else {
+ dptr[0] = 0;
+ }
+ if (0 != ((pfd->rows)[rowno])[2 * colno + 1]) {
+ dptr[1] = 1;
+ }
+ else {
+ dptr[1] = 0;
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_GRAYSCALE_ALPHA : {
+ if (256 > pfd->maxval) {
+ dptr[0] = (dk4_px_t)(((pfd->rows)[rowno])[2*colno]);
+ dptr[1] = (dk4_px_t)(((pfd->rows)[rowno])[2*colno+1]);
+ }
+ else {
+ dptr[0] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[4 * colno],
+ ((pfd->rows)[rowno])[4 * colno + 1]
+ );
+ dptr[1] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[4 * colno + 2],
+ ((pfd->rows)[rowno])[4 * colno + 3]
+ );
+ }
+ back = 1;
+ } break;
+ case DK4_NETPBM_TT_RGB_ALPHA : {
+ if (256 > pfd->maxval) {
+ dptr[0] = (dk4_px_t)(((pfd->rows)[rowno])[4*colno]);
+ dptr[1] = (dk4_px_t)(((pfd->rows)[rowno])[4*colno+1]);
+ dptr[2] = (dk4_px_t)(((pfd->rows)[rowno])[4*colno+2]);
+ dptr[3] = (dk4_px_t)(((pfd->rows)[rowno])[4*colno+3]);
+ }
+ else {
+ dptr[0] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[8 * colno],
+ ((pfd->rows)[rowno])[8 * colno + 1]
+ );
+ dptr[1] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[8 * colno + 2],
+ ((pfd->rows)[rowno])[8 * colno + 3]
+ );
+ dptr[2] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[8 * colno + 4],
+ ((pfd->rows)[rowno])[8 * colno + 5]
+ );
+ dptr[3] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[8 * colno + 6],
+ ((pfd->rows)[rowno])[8 * colno + 7]
+ );
+ }
+ back = 1;
+ } break;
+ default : {
+ $? ". Unknown tuple type, using ch"
+ if (256 > pfd->maxval) {
+ for (i = 0; i < pfd->ch; i++) {
+ dptr[i] =
+ (dk4_px_t)(
+ ((pfd->rows)[rowno])[pfd->ch * colno + i]
+ );
+ }
+ }
+ else {
+ for (i = 0; i < pfd->ch; i++) {
+ dptr[i] = dk4bifnetpbm_combine_bytes(
+ ((pfd->rows)[rowno])[2*(pfd->ch * colno + i)],
+ ((pfd->rows)[rowno])[2*(pfd->ch * colno + i)+1]
+ );
+ }
+ }
+ back = 1;
+ } break;
+ }
+ } break;
+ }
+
+ finished:
+ $? "- dk4bifnetpbm_nc_get_original_pixel %d", back
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifp.c b/support/dktools/dk4bifp.c
new file mode 100644
index 0000000000..1c7dec78c3
--- /dev/null
+++ b/support/dktools/dk4bifp.c
@@ -0,0 +1,631 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifp.ctr
+*/
+
+/** @file dk4bifp.c The dk4bifp module.
+*/
+
+
+#line 8 "dk4bifp.ctr"
+#include "dk4conf.h"
+
+
+#if DK4_HAVE_PNG_H
+
+
+#ifndef PNG_H_INCLUDED
+#include <png.h>
+#define PNG_H_INCLUDED 1
+#endif
+
+#if DK4_HAVE_SETJMP_H
+#ifndef SETJMP_H_INCLUDED
+#include <setjmp.h>
+#define SETJMP_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 63 "dk4bifp.ctr"
+
+
+
+/** User defined error handler for libpng functions.
+ @param pfptr Pointer to per-frame structure containing a jump buffer.
+ @param error_msg Libpng error message, ignored here.
+*/
+static
+void
+dk4bifpng_i_error_fn(
+ dk4_bif_png_per_frame_t *pfptr,
+ png_const_charp DK4_ARG_UNUSED(error_msg)
+)
+{
+ DK4_UNUSED_ARG(error_msg)
+ if (NULL != pfptr) {
+ if (2 > pfptr->had_error) {
+ pfptr->had_error = 2;
+ }
+ longjmp(pfptr->jump_buf, 1);
+ }
+}
+
+
+
+/** User defined error handler for libpng functions.
+ @param pfptr Pointer to per-frame structure containing a jump buffer.
+ @param error_msg Libpng error message, ignored here.
+*/
+static
+void
+dk4bifpng_i_warning_fn(
+ dk4_bif_png_per_frame_t *pfptr,
+ png_const_charp DK4_ARG_UNUSED(error_msg)
+)
+{
+ DK4_UNUSED_ARG(error_msg)
+ if (NULL != pfptr) {
+ if (1 > pfptr->had_error) {
+ pfptr->had_error = 1;
+ }
+ }
+}
+
+
+
+/** Allocate new per-frame data structure.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+static
+dk4_bif_png_per_frame_t *
+dk4bifpng_tsdata_new(dk4_er_t *erp)
+{
+ dk4_bif_png_per_frame_t *back = NULL;
+
+
+#line 120 "dk4bifp.ctr"
+ back = dk4mem_new(dk4_bif_png_per_frame_t,1,erp);
+ if (NULL != back) {
+ back->rows = NULL;
+ back->dblxdpi = -1.0;
+ back->dblydpi = -1.0;
+ back->rowbytes = 0UL;
+ back->w = 0UL;
+ back->h = 0UL;
+ back->xdpi = 0UL;
+ back->ydpi = 0UL;
+ back->ct = 0;
+ back->im = 0;
+ back->cm = 0;
+ back->fm = 0;
+ back->ch = 0;
+ back->ip = 0;
+ back->bd = 0;
+ back->had_error = 0;
+ }
+
+
+#line 140 "dk4bifp.ctr"
+ return back;
+}
+
+
+
+void
+dk4bifpng_nc_release_per_frame_data(
+ void *tsdata
+)
+{
+ png_bytep *rp; /* Current row to release */
+ dk4_bif_png_per_frame_t *ppngfr; /* Per-frame data */
+ png_uint_32 i; /* Current row index */
+
+
+#line 154 "dk4bifp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+#endif
+ ppngfr = (dk4_bif_png_per_frame_t *)tsdata;
+ if (NULL != ppngfr->rows) {
+ rp = ppngfr->rows;
+ for (i = 0UL; i < ppngfr->h; i++) {
+ dk4mem_release(*rp);
+ rp++;
+ }
+ dk4mem_release(ppngfr->rows);
+ }
+ dk4mem_release(ppngfr);
+
+
+#line 168 "dk4bifp.ctr"
+}
+
+
+
+void
+dk4bifpng_nc_release_per_file_data(
+ void *tsdata
+)
+{
+
+
+#line 178 "dk4bifp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+#endif
+ dk4mem_release(tsdata);
+
+
+#line 183 "dk4bifp.ctr"
+}
+
+
+
+dk4_bif_t *
+dk4bifpng_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_bif_png_clobbered_t *pngcp,
+ dk4_er_t *erp
+)
+{
+ unsigned char pngsig[8]; /* Buffer for PNG signature */
+ dk4_px_resample_t pxres; /* Pixel resampler */
+ png_color_16p bgp = NULL; /* Background data */
+ png_structp ppngread = NULL; /* PNG reader structure */
+ png_infop ppnginfo = NULL; /* PNG info structure */
+ size_t i;
+
+
+#line 204 "dk4bifp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ /*
+ Create bif and frame for one-frame image
+ */
+ pngcp->back = dk4biftool_nc_new_for_one_frame(
+ fn, DK4_BIF_TYPE_PNG, honly, pcsctx, erp
+ );
+ if (NULL == pngcp->back) {
+ goto finished;
+ }
+ /* Allocate per-frame data structure
+ */
+ (pngcp->back->cf)->tsdata = dk4bifpng_tsdata_new(erp);
+ if (NULL == (pngcp->back->cf)->tsdata) {
+ goto finished;
+ }
+ pngcp->pfrpng = (dk4_bif_png_per_frame_t *)((pngcp->back->cf)->tsdata);
+ /*
+ Check PNG signature
+ */
+ if (8 != fread(pngsig, 1, 8, fipo)) {
+ goto finished;
+ }
+ if (!png_check_sig(pngsig, 8)) {
+ goto finished;
+ }
+ /* Create PNG reader structure
+ */
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+ ppngread = png_create_read_struct(
+ PNG_LIBPNG_VER_STRING,
+ (png_voidp)pngcp->pfrpng,
+ (png_error_ptr)dk4bifpng_i_error_fn,
+ (png_error_ptr)dk4bifpng_i_warning_fn
+ );
+ if (NULL == ppngread) {
+ dk4error_set_elsize_nelem(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED, sizeof(png_structp), 1
+ );
+ goto finished;
+ }
+ }
+ else {
+ pngcp->pfrpng->had_error = 2;
+ goto finished;
+ }
+ /* Create PNG info structure
+ */
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+ ppnginfo = png_create_info_struct(ppngread);
+ if (NULL == ppnginfo) {
+ dk4error_set_elsize_nelem(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED, sizeof(png_infop), 1
+ );
+ goto finished;
+ }
+ }
+ else {
+ pngcp->pfrpng->had_error = 2;
+ goto finished;
+ }
+ /* First reading pass (header information)
+ */
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+ /*
+ Initialize PNG IO with file
+ */
+ png_init_io(ppngread, fipo);
+ /*
+ Set number of bytes used in signature check
+ */
+ png_set_sig_bytes(ppngread, 8);
+ /*
+ Read information from file header
+ */
+ png_read_info(ppngread, ppnginfo);
+ png_get_IHDR(
+ ppngread, ppnginfo,
+ &(pngcp->pfrpng->w), &(pngcp->pfrpng->h), &(pngcp->pfrpng->bd), &(pngcp->pfrpng->ct),
+ &(pngcp->pfrpng->im), &(pngcp->pfrpng->cm), &(pngcp->pfrpng->fm)
+ );
+ (pngcp->back->cf)->bg[0] = dk4pxbit_get_max(pngcp->pfrpng->bd);
+ (pngcp->back->cf)->bg[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bg[2] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[0];
+ pngcp->pfrpng->ch = png_get_channels(ppngread, ppnginfo);
+ /*
+ Read resolution
+ */
+ if (png_get_valid(ppngread, ppnginfo, PNG_INFO_pHYs)) {
+#if DK4_HAVE_PNG_GET_PIXELS_PER_INCH
+ pngcp->pfrpng->xdpi = pngcp->pfrpng->ydpi = png_get_pixels_per_inch(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->xdpi = png_get_x_pixels_per_inch(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->ydpi = png_get_y_pixels_per_inch(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->dblxdpi = (double)(pngcp->pfrpng->xdpi);
+ pngcp->pfrpng->dblydpi = (double)(pngcp->pfrpng->ydpi);
+#else
+ pngcp->pfrpng->xdpi = pngcp->pfrpng->ydpi = png_get_pixels_per_meter(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->xdpi = png_get_x_pixels_per_meter(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->ydpi = png_get_y_pixels_per_meter(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->dblxdpi = 0.0254 * (double)(pngcp->pfrpng->xdpi);
+ pngcp->pfrpng->dblydpi = 0.0254 * (double)(pngcp->pfrpng->ydpi);
+ pngcp->pfrpng->xdpi = (png_uint_32)(pngcp->pfrpng->dblxdpi);
+ pngcp->pfrpng->ydpi = (png_uint_32)(pngcp->pfrpng->dblydpi);
+#endif
+ }
+ /* Require palette to RGB conversion if necessary
+ */
+ if (PNG_COLOR_TYPE_PALETTE == pngcp->pfrpng->ct) {
+ png_set_palette_to_rgb(ppngread);
+ }
+ /* Require mask to alpha conversion if necessary
+ */
+ if(png_get_valid(ppngread, ppnginfo, PNG_INFO_tRNS)) {
+ png_set_tRNS_to_alpha(ppngread);
+ }
+ /* Set up automatic interlace handling
+ */
+ if (PNG_INTERLACE_ADAM7 == pngcp->pfrpng->im) {
+ pngcp->pfrpng->ip = png_set_interlace_handling(ppngread);
+ }
+ /* Update information
+ */
+ png_read_update_info(ppngread, ppnginfo);
+ png_get_IHDR(
+ ppngread, ppnginfo,
+ &(pngcp->pfrpng->w), &(pngcp->pfrpng->h), &(pngcp->pfrpng->bd), &(pngcp->pfrpng->ct),
+ &(pngcp->pfrpng->im), &(pngcp->pfrpng->cm), &(pngcp->pfrpng->fm)
+ );
+ (pngcp->back->cf)->bg[0] = dk4pxbit_get_max(pngcp->pfrpng->bd);
+ (pngcp->back->cf)->bg[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bg[2] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[1];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[2];
+ pngcp->pfrpng->ch = png_get_channels(ppngread, ppnginfo);
+ /*
+ Pass data upwards to frame structure
+ */
+ (pngcp->back->cf)->res_x = pngcp->pfrpng->dblxdpi;
+ (pngcp->back->cf)->res_y = pngcp->pfrpng->dblydpi;
+ (pngcp->back->cf)->dim_x = (dk4_bif_dim_t)(pngcp->pfrpng->w);
+ (pngcp->back->cf)->dim_y = (dk4_bif_dim_t)(pngcp->pfrpng->h);
+ (pngcp->back->cf)->l_bdepth = (pngcp->back->cf)->r_bdepth = pngcp->pfrpng->bd;
+ dk4pxres_setup(&((pngcp->back->cf)->resampler), pngcp->pfrpng->bd, pngcp->pfrpng->bd);
+ (pngcp->back->cf)->bg[0] = dk4pxbit_get_max(pngcp->pfrpng->bd);
+ (pngcp->back->cf)->bg[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bg[2] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[1];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[2];
+ switch (pngcp->pfrpng->ct) {
+ case PNG_COLOR_TYPE_GRAY : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_GRAY;
+ (pngcp->back->cf)->n_comp = 1;
+ } break;
+ case PNG_COLOR_TYPE_GRAY_ALPHA : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_GRAY_ALPHA;
+ (pngcp->back->cf)->n_comp = 2;
+ } break;
+ case PNG_COLOR_TYPE_PALETTE : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_RGB;
+ (pngcp->back->cf)->n_comp = 3;
+ } break;
+ case PNG_COLOR_TYPE_RGB : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_RGB;
+ (pngcp->back->cf)->n_comp = 3;
+ } break;
+ case PNG_COLOR_TYPE_RGB_ALPHA : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_RGB_ALPHA;
+ (pngcp->back->cf)->n_comp = 4;
+ } break;
+ default : {
+ pngcp->pfrpng->had_error = 2;
+ goto finished;
+ } break;
+ }
+ if ((pngcp->back->cf)->n_comp != (size_t)(pngcp->pfrpng->ch)) {
+ pngcp->pfrpng->had_error = 2;
+ goto finished;
+ }
+ }
+ else {
+ pngcp->pfrpng->had_error = 2;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+ /* Second reading pass (image data)
+ */
+ if (0 != honly) {
+ pngcp->ok = 1;
+ goto finished;
+ }
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+ pngcp->pfrpng->rowbytes = png_get_rowbytes(ppngread, ppnginfo);
+ pngcp->pfrpng->rows = dk4mem_new(png_bytep,(size_t)(pngcp->pfrpng->h),erp);
+ if (NULL == pngcp->pfrpng->rows) {
+ goto finished;
+ }
+ /* Initialize row pointers
+ */
+ for (i = 0; i < (size_t)(pngcp->pfrpng->h); i++) {
+ (pngcp->pfrpng->rows)[i] = NULL;
+ }
+ /* Allocate row pointers
+ */
+ for (i = 0; i < (size_t)(pngcp->pfrpng->h); i++) {
+ (pngcp->pfrpng->rows)[i] =
+ dk4mem_new(png_byte,(size_t)(pngcp->pfrpng->rowbytes), erp);
+ if (NULL == (pngcp->pfrpng->rows)[i]) {
+ goto finished;
+ }
+ }
+ /* Now read image
+ */
+ png_read_image(ppngread, pngcp->pfrpng->rows);
+ if (png_get_bKGD(ppngread, ppnginfo, &bgp)) {
+ if (NULL != bgp) {
+ (pngcp->back->cf)->bg[0] = bgp->red;
+ (pngcp->back->cf)->bg[1] = bgp->green;
+ (pngcp->back->cf)->bg[2] = bgp->blue;
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[1];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[2];
+ /*
+ Colors in pngcp->background chunk are always 8 bit,
+ so we need to rescale.
+ */
+ dk4pxres_init(&pxres);
+ dk4pxres_setup(&pxres, 8, pngcp->pfrpng->bd);
+ dk4pxres_multiple(&((pngcp->back->cf)->bg[0]), 4, &pxres);
+ dk4pxres_multiple(&((pngcp->back->cf)->bglbd[0]), 4, &pxres);
+
+
+#line 453 "dk4bifp.ctr"
+
+
+#line 454 "dk4bifp.ctr"
+
+
+#line 455 "dk4bifp.ctr"
+
+
+#line 456 "dk4bifp.ctr"
+
+
+#line 457 "dk4bifp.ctr"
+
+
+#line 458 "dk4bifp.ctr"
+ (pngcp->back->cf)->hbg = 1;
+ switch ((pngcp->back->cf)->l_cs) {
+ case DK4_CS_GRAY_ALPHA : case DK4_CS_GRAY : {
+ (pngcp->back->cf)->bg[0] = dk4cs_mix_rgb_to_gray(
+ (pngcp->back->cf)->bg[0],
+ (pngcp->back->cf)->bg[1],
+ (pngcp->back->cf)->bg[2],
+ &(pngcp->back->cs_ctx)
+ );
+ (pngcp->back->cf)->bg[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bg[2] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[1];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[2];
+ }
+ }
+ }
+ }
+ pngcp->ok = 1;
+ }
+ else {
+ pngcp->pfrpng->had_error = 2;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+ /* Indicate success
+ */
+ pngcp->ok = 1;
+
+ /* Clean up and return
+ */
+ finished:
+ /*
+ Release PNG file reader resources from libpng
+ */
+ if (NULL != ppngread) {
+ if (NULL != ppnginfo) {
+#if DK4_HAVE_SETJMP_H
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+#endif
+ png_destroy_info_struct(ppngread,&(ppnginfo));
+#if DK4_HAVE_SETJMP_H
+ }
+ else {
+
+#line 502 "dk4bifp.ctr"
+ }
+#endif
+ ppnginfo = NULL;
+ }
+ else {
+ }
+#if DK4_HAVE_SETJMP_H
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+#endif
+ png_destroy_read_struct(
+ &(ppngread), (png_infopp)NULL, (png_infopp)NULL
+ );
+#if DK4_HAVE_SETJMP_H
+ }
+ else {
+
+#line 517 "dk4bifp.ctr"
+ }
+#endif
+ ppngread = NULL;
+ }
+ else {
+ }
+ /* Release result if any error occured.
+ */
+ if ((NULL != pngcp->back) && (0 == pngcp->ok)) {
+
+#line 526 "dk4bifp.ctr"
+ dk4bif_close(pngcp->back);
+ pngcp->back = NULL;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+
+
+#line 531 "dk4bifp.ctr"
+ return pngcp->back;
+}
+
+
+
+int
+dk4bifpng_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ dk4_er_t er; /* Error report for math operations */
+ dk4_bif_png_per_frame_t *pfrpng; /* Per-frame data */
+ png_bytep rowptr; /* Address of row data */
+ size_t si; /* Start index of pixel data in row */
+ size_t vi; /* Index of current sample in row */
+ size_t i; /* Traverse all components */
+ int back = 0;
+
+
+#line 552 "dk4bifp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bif);
+#endif
+ pfrpng = (dk4_bif_png_per_frame_t *)((bif->cf)->tsdata);
+ dk4error_init(&er);
+ si = dk4ma_size_t_mul(colno, pfrpng->ch, &er);
+ if ((DK4_E_NONE == er.ec) && ((SIZE_MAX - (size_t)(pfrpng->ch)) >= si)) {
+ vi = si;
+
+#line 561 "dk4bifp.ctr"
+ rowptr = (pfrpng->rows)[rowno];
+ for (i = 0; i < (size_t)(pfrpng->ch); i++) {
+ *(dptr++) = dk4bifpackedbits_get_element(
+ rowptr, vi++, pfrpng->bd, pfrpng->rowbytes
+ );
+ }
+ back = 1;
+ }
+
+
+#line 570 "dk4bifp.ctr"
+ return back;
+}
+
+
+#endif
+/* if DK4_HAVE_PNG_H */
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifp.ctr b/support/dktools/dk4bifp.ctr
new file mode 100644
index 0000000000..2b2d7d0a7d
--- /dev/null
+++ b/support/dktools/dk4bifp.ctr
@@ -0,0 +1,578 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+#include "dk4conf.h"
+
+
+#if DK4_HAVE_PNG_H
+
+
+#ifndef PNG_H_INCLUDED
+#include <png.h>
+#define PNG_H_INCLUDED 1
+#endif
+
+#if DK4_HAVE_SETJMP_H
+#ifndef SETJMP_H_INCLUDED
+#include <setjmp.h>
+#define SETJMP_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** User defined error handler for libpng functions.
+ @param pfptr Pointer to per-frame structure containing a jump buffer.
+ @param error_msg Libpng error message, ignored here.
+*/
+static
+void
+dk4bifpng_i_error_fn(
+ dk4_bif_png_per_frame_t *pfptr,
+ png_const_charp DK4_ARG_UNUSED(error_msg)
+)
+{
+ DK4_UNUSED_ARG(error_msg)
+ if (NULL != pfptr) {
+ if (2 > pfptr->had_error) {
+ pfptr->had_error = 2;
+ }
+ longjmp(pfptr->jump_buf, 1);
+ }
+}
+
+
+
+/** User defined error handler for libpng functions.
+ @param pfptr Pointer to per-frame structure containing a jump buffer.
+ @param error_msg Libpng error message, ignored here.
+*/
+static
+void
+dk4bifpng_i_warning_fn(
+ dk4_bif_png_per_frame_t *pfptr,
+ png_const_charp DK4_ARG_UNUSED(error_msg)
+)
+{
+ DK4_UNUSED_ARG(error_msg)
+ if (NULL != pfptr) {
+ if (1 > pfptr->had_error) {
+ pfptr->had_error = 1;
+ }
+ }
+}
+
+
+
+/** Allocate new per-frame data structure.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+
+static
+dk4_bif_png_per_frame_t *
+dk4bifpng_tsdata_new(dk4_er_t *erp)
+{
+ dk4_bif_png_per_frame_t *back = NULL;
+ $? "+ dk4_bif_png_per_frame_t"
+ back = dk4mem_new(dk4_bif_png_per_frame_t,1,erp);
+ if (NULL != back) {
+ back->rows = NULL;
+ back->dblxdpi = -1.0;
+ back->dblydpi = -1.0;
+ back->rowbytes = 0UL;
+ back->w = 0UL;
+ back->h = 0UL;
+ back->xdpi = 0UL;
+ back->ydpi = 0UL;
+ back->ct = 0;
+ back->im = 0;
+ back->cm = 0;
+ back->fm = 0;
+ back->ch = 0;
+ back->ip = 0;
+ back->bd = 0;
+ back->had_error = 0;
+ }
+ $? "- dk4_bif_png_per_frame_t %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+dk4bifpng_nc_release_per_frame_data(
+ void *tsdata
+)
+{
+ png_bytep *rp; /* Current row to release */
+ dk4_bif_png_per_frame_t *ppngfr; /* Per-frame data */
+ png_uint_32 i; /* Current row index */
+ $? "+ dk4bifpng_nc_release_per_frame_data"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+#endif
+ ppngfr = (dk4_bif_png_per_frame_t *)tsdata;
+ if (NULL != ppngfr->rows) {
+ rp = ppngfr->rows;
+ for (i = 0UL; i < ppngfr->h; i++) {
+ dk4mem_release(*rp);
+ rp++;
+ }
+ dk4mem_release(ppngfr->rows);
+ }
+ dk4mem_release(ppngfr);
+ $? "- dk4bifpng_nc_release_per_frame_data"
+}
+
+
+
+void
+dk4bifpng_nc_release_per_file_data(
+ void *tsdata
+)
+{
+ $? "+ dk4bifpng_nc_release_per_file_data"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+#endif
+ dk4mem_release(tsdata);
+ $? "- dk4bifpng_nc_release_per_file_data"
+}
+
+
+
+dk4_bif_t *
+dk4bifpng_nc_open_file(
+ FILE *fipo,
+ dkChar const *fn,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_bif_png_clobbered_t *pngcp,
+ dk4_er_t *erp
+)
+{
+ unsigned char pngsig[8]; /* Buffer for PNG signature */
+ dk4_px_resample_t pxres; /* Pixel resampler */
+ png_color_16p bgp = NULL; /* Background data */
+ png_structp ppngread = NULL; /* PNG reader structure */
+ png_infop ppnginfo = NULL; /* PNG info structure */
+ size_t i;
+ $? "+ dk4bifpng_nc_open_file"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ /*
+ Create bif and frame for one-frame image
+ */
+ pngcp->back = dk4biftool_nc_new_for_one_frame(
+ fn, DK4_BIF_TYPE_PNG, honly, pcsctx, erp
+ );
+ if (NULL == pngcp->back) {
+ goto finished;
+ }
+ /* Allocate per-frame data structure
+ */
+ (pngcp->back->cf)->tsdata = dk4bifpng_tsdata_new(erp);
+ if (NULL == (pngcp->back->cf)->tsdata) {
+ goto finished;
+ }
+ pngcp->pfrpng = (dk4_bif_png_per_frame_t *)((pngcp->back->cf)->tsdata);
+ /*
+ Check PNG signature
+ */
+ if (8 != fread(pngsig, 1, 8, fipo)) {
+ goto finished;
+ }
+ if (!png_check_sig(pngsig, 8)) {
+ goto finished;
+ }
+ /* Create PNG reader structure
+ */
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+ ppngread = png_create_read_struct(
+ PNG_LIBPNG_VER_STRING,
+ (png_voidp)pngcp->pfrpng,
+ (png_error_ptr)dk4bifpng_i_error_fn,
+ (png_error_ptr)dk4bifpng_i_warning_fn
+ );
+ if (NULL == ppngread) {
+ dk4error_set_elsize_nelem(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED, sizeof(png_structp), 1
+ );
+ goto finished;
+ }
+ }
+ else {
+ pngcp->pfrpng->had_error = 2;
+ goto finished;
+ }
+ /* Create PNG info structure
+ */
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+ ppnginfo = png_create_info_struct(ppngread);
+ if (NULL == ppnginfo) {
+ dk4error_set_elsize_nelem(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED, sizeof(png_infop), 1
+ );
+ goto finished;
+ }
+ }
+ else {
+ pngcp->pfrpng->had_error = 2;
+ goto finished;
+ }
+ /* First reading pass (header information)
+ */
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+ /*
+ Initialize PNG IO with file
+ */
+ png_init_io(ppngread, fipo);
+ /*
+ Set number of bytes used in signature check
+ */
+ png_set_sig_bytes(ppngread, 8);
+ /*
+ Read information from file header
+ */
+ png_read_info(ppngread, ppnginfo);
+ png_get_IHDR(
+ ppngread, ppnginfo,
+ &(pngcp->pfrpng->w), &(pngcp->pfrpng->h), &(pngcp->pfrpng->bd), &(pngcp->pfrpng->ct),
+ &(pngcp->pfrpng->im), &(pngcp->pfrpng->cm), &(pngcp->pfrpng->fm)
+ );
+ (pngcp->back->cf)->bg[0] = dk4pxbit_get_max(pngcp->pfrpng->bd);
+ (pngcp->back->cf)->bg[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bg[2] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[0];
+ pngcp->pfrpng->ch = png_get_channels(ppngread, ppnginfo);
+ /*
+ Read resolution
+ */
+ if (png_get_valid(ppngread, ppnginfo, PNG_INFO_pHYs)) {
+#if DK4_HAVE_PNG_GET_PIXELS_PER_INCH
+ pngcp->pfrpng->xdpi = pngcp->pfrpng->ydpi = png_get_pixels_per_inch(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->xdpi = png_get_x_pixels_per_inch(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->ydpi = png_get_y_pixels_per_inch(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->dblxdpi = (double)(pngcp->pfrpng->xdpi);
+ pngcp->pfrpng->dblydpi = (double)(pngcp->pfrpng->ydpi);
+#else
+ pngcp->pfrpng->xdpi = pngcp->pfrpng->ydpi = png_get_pixels_per_meter(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->xdpi = png_get_x_pixels_per_meter(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->ydpi = png_get_y_pixels_per_meter(
+ ppngread, ppnginfo
+ );
+ pngcp->pfrpng->dblxdpi = 0.0254 * (double)(pngcp->pfrpng->xdpi);
+ pngcp->pfrpng->dblydpi = 0.0254 * (double)(pngcp->pfrpng->ydpi);
+ pngcp->pfrpng->xdpi = (png_uint_32)(pngcp->pfrpng->dblxdpi);
+ pngcp->pfrpng->ydpi = (png_uint_32)(pngcp->pfrpng->dblydpi);
+#endif
+ }
+ /* Require palette to RGB conversion if necessary
+ */
+ if (PNG_COLOR_TYPE_PALETTE == pngcp->pfrpng->ct) {
+ png_set_palette_to_rgb(ppngread);
+ }
+ /* Require mask to alpha conversion if necessary
+ */
+ if(png_get_valid(ppngread, ppnginfo, PNG_INFO_tRNS)) {
+ png_set_tRNS_to_alpha(ppngread);
+ }
+ /* Set up automatic interlace handling
+ */
+ if (PNG_INTERLACE_ADAM7 == pngcp->pfrpng->im) {
+ pngcp->pfrpng->ip = png_set_interlace_handling(ppngread);
+ }
+ /* Update information
+ */
+ png_read_update_info(ppngread, ppnginfo);
+ png_get_IHDR(
+ ppngread, ppnginfo,
+ &(pngcp->pfrpng->w), &(pngcp->pfrpng->h), &(pngcp->pfrpng->bd), &(pngcp->pfrpng->ct),
+ &(pngcp->pfrpng->im), &(pngcp->pfrpng->cm), &(pngcp->pfrpng->fm)
+ );
+ (pngcp->back->cf)->bg[0] = dk4pxbit_get_max(pngcp->pfrpng->bd);
+ (pngcp->back->cf)->bg[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bg[2] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[1];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[2];
+ pngcp->pfrpng->ch = png_get_channels(ppngread, ppnginfo);
+ /*
+ Pass data upwards to frame structure
+ */
+ (pngcp->back->cf)->res_x = pngcp->pfrpng->dblxdpi;
+ (pngcp->back->cf)->res_y = pngcp->pfrpng->dblydpi;
+ (pngcp->back->cf)->dim_x = (dk4_bif_dim_t)(pngcp->pfrpng->w);
+ (pngcp->back->cf)->dim_y = (dk4_bif_dim_t)(pngcp->pfrpng->h);
+ (pngcp->back->cf)->l_bdepth = (pngcp->back->cf)->r_bdepth = pngcp->pfrpng->bd;
+ dk4pxres_setup(&((pngcp->back->cf)->resampler), pngcp->pfrpng->bd, pngcp->pfrpng->bd);
+ (pngcp->back->cf)->bg[0] = dk4pxbit_get_max(pngcp->pfrpng->bd);
+ (pngcp->back->cf)->bg[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bg[2] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[1];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[2];
+ switch (pngcp->pfrpng->ct) {
+ case PNG_COLOR_TYPE_GRAY : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_GRAY;
+ (pngcp->back->cf)->n_comp = 1;
+ } break;
+ case PNG_COLOR_TYPE_GRAY_ALPHA : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_GRAY_ALPHA;
+ (pngcp->back->cf)->n_comp = 2;
+ } break;
+ case PNG_COLOR_TYPE_PALETTE : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_RGB;
+ (pngcp->back->cf)->n_comp = 3;
+ } break;
+ case PNG_COLOR_TYPE_RGB : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_RGB;
+ (pngcp->back->cf)->n_comp = 3;
+ } break;
+ case PNG_COLOR_TYPE_RGB_ALPHA : {
+ (pngcp->back->cf)->l_cs = (pngcp->back->cf)->f_cs = DK4_CS_RGB_ALPHA;
+ (pngcp->back->cf)->n_comp = 4;
+ } break;
+ default : {
+ pngcp->pfrpng->had_error = 2;
+ goto finished;
+ } break;
+ }
+ if ((pngcp->back->cf)->n_comp != (size_t)(pngcp->pfrpng->ch)) {
+ pngcp->pfrpng->had_error = 2;
+ goto finished;
+ }
+ }
+ else {
+ pngcp->pfrpng->had_error = 2;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+ /* Second reading pass (image data)
+ */
+ if (0 != honly) {
+ pngcp->ok = 1;
+ goto finished;
+ }
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+ pngcp->pfrpng->rowbytes = png_get_rowbytes(ppngread, ppnginfo);
+ pngcp->pfrpng->rows = dk4mem_new(png_bytep,(size_t)(pngcp->pfrpng->h),erp);
+ if (NULL == pngcp->pfrpng->rows) {
+ goto finished;
+ }
+ /* Initialize row pointers
+ */
+ for (i = 0; i < (size_t)(pngcp->pfrpng->h); i++) {
+ (pngcp->pfrpng->rows)[i] = NULL;
+ }
+ /* Allocate row pointers
+ */
+ for (i = 0; i < (size_t)(pngcp->pfrpng->h); i++) {
+ (pngcp->pfrpng->rows)[i] =
+ dk4mem_new(png_byte,(size_t)(pngcp->pfrpng->rowbytes), erp);
+ if (NULL == (pngcp->pfrpng->rows)[i]) {
+ goto finished;
+ }
+ }
+ /* Now read image
+ */
+ png_read_image(ppngread, pngcp->pfrpng->rows);
+ if (png_get_bKGD(ppngread, ppnginfo, &bgp)) {
+ if (NULL != bgp) {
+ (pngcp->back->cf)->bg[0] = bgp->red;
+ (pngcp->back->cf)->bg[1] = bgp->green;
+ (pngcp->back->cf)->bg[2] = bgp->blue;
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[1];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[2];
+ /*
+ Colors in pngcp->background chunk are always 8 bit,
+ so we need to rescale.
+ */
+ dk4pxres_init(&pxres);
+ dk4pxres_setup(&pxres, 8, pngcp->pfrpng->bd);
+ dk4pxres_multiple(&((pngcp->back->cf)->bg[0]), 4, &pxres);
+ dk4pxres_multiple(&((pngcp->back->cf)->bglbd[0]), 4, &pxres);
+ $? ". bglbd[0] = %u", (unsigned)((pngcp->back->cf)->bglbd[0])
+ $? ". bglbd[1] = %u", (unsigned)((pngcp->back->cf)->bglbd[1])
+ $? ". bglbd[2] = %u", (unsigned)((pngcp->back->cf)->bglbd[2])
+ $? ". bg[0] = %u", (unsigned)((pngcp->back->cf)->bg[0])
+ $? ". bg[1] = %u", (unsigned)((pngcp->back->cf)->bg[1])
+ $? ". bg[2] = %u", (unsigned)((pngcp->back->cf)->bg[2])
+ (pngcp->back->cf)->hbg = 1;
+ switch ((pngcp->back->cf)->l_cs) {
+ case DK4_CS_GRAY_ALPHA : case DK4_CS_GRAY : {
+ (pngcp->back->cf)->bg[0] = dk4cs_mix_rgb_to_gray(
+ (pngcp->back->cf)->bg[0],
+ (pngcp->back->cf)->bg[1],
+ (pngcp->back->cf)->bg[2],
+ &(pngcp->back->cs_ctx)
+ );
+ (pngcp->back->cf)->bg[1] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bg[2] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[0] = (pngcp->back->cf)->bg[0];
+ (pngcp->back->cf)->bglbd[1] = (pngcp->back->cf)->bg[1];
+ (pngcp->back->cf)->bglbd[2] = (pngcp->back->cf)->bg[2];
+ }
+ }
+ }
+ }
+ pngcp->ok = 1;
+ }
+ else {
+ pngcp->pfrpng->had_error = 2;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+ /* Indicate success
+ */
+ pngcp->ok = 1;
+
+ /* Clean up and return
+ */
+ finished:
+ /*
+ Release PNG file reader resources from libpng
+ */
+ if (NULL != ppngread) {
+ if (NULL != ppnginfo) {
+#if DK4_HAVE_SETJMP_H
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+#endif
+ png_destroy_info_struct(ppngread,&(ppnginfo));
+#if DK4_HAVE_SETJMP_H
+ }
+ else { $? "! error while freeing info"
+ }
+#endif
+ ppnginfo = NULL;
+ }
+ else {
+ }
+#if DK4_HAVE_SETJMP_H
+ if (0 == setjmp(pngcp->pfrpng->jump_buf)) {
+#endif
+ png_destroy_read_struct(
+ &(ppngread), (png_infopp)NULL, (png_infopp)NULL
+ );
+#if DK4_HAVE_SETJMP_H
+ }
+ else { $? "! error while freeing reader"
+ }
+#endif
+ ppngread = NULL;
+ }
+ else {
+ }
+ /* Release result if any error occured.
+ */
+ if ((NULL != pngcp->back) && (0 == pngcp->ok)) { $? "! incomplete"
+ dk4bif_close(pngcp->back);
+ pngcp->back = NULL;
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ $? "- dk4bifpng_nc_open_file %d", TR_IPTR(pngcp->back)
+ return pngcp->back;
+}
+
+
+
+int
+dk4bifpng_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ dk4_er_t er; /* Error report for math operations */
+ dk4_bif_png_per_frame_t *pfrpng; /* Per-frame data */
+ png_bytep rowptr; /* Address of row data */
+ size_t si; /* Start index of pixel data in row */
+ size_t vi; /* Index of current sample in row */
+ size_t i; /* Traverse all components */
+ int back = 0;
+ $? "+ dk4bifpng_nc_get_original_pixel"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bif);
+#endif
+ pfrpng = (dk4_bif_png_per_frame_t *)((bif->cf)->tsdata);
+ dk4error_init(&er);
+ si = dk4ma_size_t_mul(colno, pfrpng->ch, &er);
+ if ((DK4_E_NONE == er.ec) && ((SIZE_MAX - (size_t)(pfrpng->ch)) >= si)) {
+ vi = si; $? ". row number ok"
+ rowptr = (pfrpng->rows)[rowno];
+ for (i = 0; i < (size_t)(pfrpng->ch); i++) {
+ *(dptr++) = dk4bifpackedbits_get_element(
+ rowptr, vi++, pfrpng->bd, pfrpng->rowbytes
+ );
+ }
+ back = 1;
+ }
+ $? "- dk4bifpng_nc_get_original_pixel %d", back
+ return back;
+}
+
+
+#endif
+/* if DK4_HAVE_PNG_H */
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifpb.c b/support/dktools/dk4bifpb.c
new file mode 100644
index 0000000000..cada867c1a
--- /dev/null
+++ b/support/dktools/dk4bifpb.c
@@ -0,0 +1,166 @@
+/*
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifpb.ctr
+*/
+
+/** @file dk4bifpb.c The dk4bifpb module.
+*/
+
+
+#line 8 "dk4bifpb.ctr"
+
+#include "dk4conf.h"
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4PX_H_INCLUDED
+#include "dk4px.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 40 "dk4bifpb.ctr"
+
+
+
+static const size_t shift_1bpp[] = {
+ 7, 6, 5, 4, 3, 2, 1, 0
+};
+
+
+static const size_t shift_2bpp[] = {
+ 6, 4, 2, 0
+};
+
+static const size_t shift_4bpp[] = {
+ 4, 0
+};
+
+
+
+
+dk4_px_t
+dk4bifpackedbits_get_element(
+ unsigned char const *buffer,
+ size_t elin,
+ size_t bd,
+ size_t nbytes
+)
+{
+ dk4_er_t er; /* Error report for index calculation */
+ size_t bytei = 0; /* Byte index */
+ size_t elno = 0; /* Element number within the byte */
+ size_t shv = 0; /* Number of bits for right shift operation */
+ dk4_px_t mask = 0; /* Mask value to apply after bit shifting */
+ dk4_px_t back = 0; /* Result */
+
+
+
+#line 75 "dk4bifpb.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+#endif
+ /*
+ Check buffer pointer
+ */
+ if (NULL == buffer) {
+ goto finished;
+ }
+ /* Check bit depth
+ */
+ if (8 != bd) {
+ if (16 != bd) {
+ if (1 != bd) {
+ if (4 != bd) {
+ if (2 != bd) {
+ goto finished;
+ }
+ }
+ }
+ }
+ }
+ switch ( (int)bd ) {
+ case 16 : {
+ dk4error_init(&er);
+ bytei = dk4ma_size_t_mul(elin, 2, &er);
+ if ((DK4_E_NONE == er.ec) && (nbytes > bytei)) {
+ back = ((((dk4_px_t)(buffer[bytei])) << 8) & (dk4_px_t)0xFF00U)
+ | (((dk4_px_t)(buffer[bytei+1])) & (dk4_px_t)0x00FFU);
+ }
+ } break;
+ case 8 : {
+ if (nbytes > elin) {
+ back = (dk4_px_t)(buffer[elin]);
+ }
+ } break;
+ default : {
+ switch ( (int)bd ) {
+ case 1 : {
+ bytei = elin / 8;
+ elno = elin % 8;
+ shv = shift_1bpp[elno];
+ mask = 1U;
+ } break;
+ case 2 : {
+ bytei = elin / 4;
+ elno = elin % 4;
+ shv = shift_2bpp[elno];
+ mask = 3U;
+ } break;
+ case 4 : {
+ bytei = elin / 2;
+ elno = elin % 2;
+ shv = shift_4bpp[elno];
+ mask = 15U;
+ } break;
+ }
+ if (nbytes > bytei) {
+ back = buffer[bytei];
+ if (0 < shv) {
+ back = back >> shv;
+ }
+ back &= mask;
+ }
+ } break;
+ }
+ finished:
+
+
+#line 143 "dk4bifpb.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifpb.ctr b/support/dktools/dk4bifpb.ctr
new file mode 100644
index 0000000000..010ad4d571
--- /dev/null
+++ b/support/dktools/dk4bifpb.ctr
@@ -0,0 +1,149 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2016-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% module
+
+#include "dk4conf.h"
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4PX_H_INCLUDED
+#include "dk4px.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+static const size_t shift_1bpp[] = {
+ 7, 6, 5, 4, 3, 2, 1, 0
+};
+
+
+static const size_t shift_2bpp[] = {
+ 6, 4, 2, 0
+};
+
+static const size_t shift_4bpp[] = {
+ 4, 0
+};
+
+
+
+
+dk4_px_t
+dk4bifpackedbits_get_element(
+ unsigned char const *buffer,
+ size_t elin,
+ size_t bd,
+ size_t nbytes
+)
+{
+ dk4_er_t er; /* Error report for index calculation */
+ size_t bytei = 0; /* Byte index */
+ size_t elno = 0; /* Element number within the byte */
+ size_t shv = 0; /* Number of bits for right shift operation */
+ dk4_px_t mask = 0; /* Mask value to apply after bit shifting */
+ dk4_px_t back = 0; /* Result */
+
+ $? "+ dk4bifpackedbits_get_element"
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+#endif
+ /*
+ Check buffer pointer
+ */
+ if (NULL == buffer) {
+ goto finished;
+ }
+ /* Check bit depth
+ */
+ if (8 != bd) {
+ if (16 != bd) {
+ if (1 != bd) {
+ if (4 != bd) {
+ if (2 != bd) {
+ goto finished;
+ }
+ }
+ }
+ }
+ }
+ switch ( (int)bd ) {
+ case 16 : {
+ dk4error_init(&er);
+ bytei = dk4ma_size_t_mul(elin, 2, &er);
+ if ((DK4_E_NONE == er.ec) && (nbytes > bytei)) {
+ back = ((((dk4_px_t)(buffer[bytei])) << 8) & (dk4_px_t)0xFF00U)
+ | (((dk4_px_t)(buffer[bytei+1])) & (dk4_px_t)0x00FFU);
+ }
+ } break;
+ case 8 : {
+ if (nbytes > elin) {
+ back = (dk4_px_t)(buffer[elin]);
+ }
+ } break;
+ default : {
+ switch ( (int)bd ) {
+ case 1 : {
+ bytei = elin / 8;
+ elno = elin % 8;
+ shv = shift_1bpp[elno];
+ mask = 1U;
+ } break;
+ case 2 : {
+ bytei = elin / 4;
+ elno = elin % 4;
+ shv = shift_2bpp[elno];
+ mask = 3U;
+ } break;
+ case 4 : {
+ bytei = elin / 2;
+ elno = elin % 2;
+ shv = shift_4bpp[elno];
+ mask = 15U;
+ } break;
+ }
+ if (nbytes > bytei) {
+ back = buffer[bytei];
+ if (0 < shv) {
+ back = back >> shv;
+ }
+ back &= mask;
+ }
+ } break;
+ }
+ finished:
+ $? "- dk4bifpackedbits_get_element %u", (unsigned)back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bift.c b/support/dktools/dk4bift.c
new file mode 100644
index 0000000000..15ca3317e9
--- /dev/null
+++ b/support/dktools/dk4bift.c
@@ -0,0 +1,371 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bift.ctr
+*/
+
+/** @file dk4bift.c The dk4bift module.
+*/
+
+
+#line 8 "dk4bift.ctr"
+#include "dk4conf.h"
+
+
+
+
+#line 12 "dk4bift.ctr"
+
+
+
+#if DK4_HAVE_TIFF_H
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4MAAL_H_INCLUDED
+#include "dk4maal.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+void
+dk4biftiff_nc_release_per_frame_data(
+ void *tsdata
+)
+{
+ dk4_bif_tiff_per_frame_t *pfd = NULL; /* Per-frame data */
+
+
+#line 48 "dk4bift.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+#endif
+ pfd = (dk4_bif_tiff_per_frame_t *)tsdata;
+ if (NULL != pfd) {
+ if (NULL != pfd->rows) {
+
+#line 54 "dk4bift.ctr"
+ _TIFFfree(pfd->rows);
+ pfd->rows = NULL;
+ }
+
+#line 57 "dk4bift.ctr"
+ dk4mem_free(pfd);
+ }
+
+
+#line 60 "dk4bift.ctr"
+}
+
+
+
+dk4_bif_t *
+dk4biftiff_nc_open_type(
+ dkChar const *fn,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report for math op */
+ dk4_bif_tiff_per_frame_t *pfd = NULL; /* Per-frame data */
+ dk4_bif_t *back = NULL;
+ TIFF *tiff = NULL; /* TIFF file */
+ double xrv; /* Temporary resolution valuej */
+ float rv; /* Temporary resolution value */
+ uint32 w; /* Frame width */
+ uint32 h; /* Frame height */
+ int ok = 0; /* Flag: Success */
+ int cc = 0; /* Flag: Can continue */
+ uint16 ru; /* Resolution unit */
+ uint16 orie; /* Orientation */
+ tsize_t nby; /* Byte number to allocate */
+
+
+#line 85 "dk4bift.ctr"
+ back = dk4biftool_nc_new_for_one_frame(
+ fn, DK4_BIF_TYPE_TIFF, 0, pcsctx, erp
+ );
+ if (NULL == back) { goto finished; }
+
+
+#line 90 "dk4bift.ctr"
+
+ pfd = dk4mem_new(dk4_bif_tiff_per_frame_t,1,NULL);
+ if (NULL == pfd) { goto finished; }
+ pfd->rows = NULL;
+
+
+#line 95 "dk4bift.ctr"
+
+ back->cf->tsdata = pfd;
+
+#if (DK4_CHAR_SIZE > 1) && (DK4_ON_WINDOWS)
+ tiff = TIFFOpenW(fn, "rb");
+#else
+ tiff = TIFFOpen(fn, "rb");
+#endif
+ if (NULL == tiff) { goto finished; }
+
+
+#line 105 "dk4bift.ctr"
+
+ /* Traverse all frames
+ */
+ ok = 1;
+ do {
+ cc = 0;
+ w = 0UL;
+ h = 0UL;
+
+ /* Read image width and height
+ */
+ if (1 == TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &w)) {
+ back->cf->dim_x = w;
+ }
+ else {
+
+#line 120 "dk4bift.ctr"
+ w = 0UL;
+ }
+ if (1 == TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &h)) {
+ back->cf->dim_y = h;
+ }
+ else {
+
+#line 126 "dk4bift.ctr"
+ h = 0UL;
+ }
+
+ /* Read resolution
+ */
+ rv = 0.0;
+ if (1 == TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &rv)) {
+ back->cf->res_x = rv;
+
+#line 134 "dk4bift.ctr"
+ }
+ rv = 0.0;
+ if (1 == TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &rv)) {
+ back->cf->res_y = rv;
+
+#line 138 "dk4bift.ctr"
+ }
+ ru = 0;
+ if (1 == TIFFGetField(tiff, TIFFTAG_RESOLUTIONUNIT, &ru)) {
+ if (RESUNIT_CENTIMETER == ru) {
+
+#line 142 "dk4bift.ctr"
+ back->cf->res_x *= 2.54;
+ back->cf->res_y *= 2.54;
+ }
+ }
+ if ((0.0 >= back->cf->res_x) || (0.0 >= back->cf->res_y)) {
+ back->cf->res_x = back->cf->res_y = -1.0;
+
+
+#line 149 "dk4bift.ctr"
+ }
+
+ /* Read orientation, swap x and y coordinates if necessary
+ */
+ orie = ORIENTATION_TOPLEFT;
+ if (1 == TIFFGetFieldDefaulted(tiff, TIFFTAG_ORIENTATION, &orie)) {
+ switch (orie) {
+ case 5: case 6: case 7: case 8: {
+
+#line 157 "dk4bift.ctr"
+ back->cf->dim_x = h; back->cf->dim_y = w;
+ xrv = back->cf->res_x;
+ back->cf->res_x = back->cf->res_y;
+ back->cf->res_y = xrv;
+ } break;
+ }
+ }
+ else {
+ orie = ORIENTATION_TOPLEFT;
+ }
+
+ /* Calculate byte number
+ */
+ dk4error_init(&er);
+ nby = dk4ma_long_mul(
+ dk4ma_long_mul(w, h, &er), 4L, &er
+ );
+
+ /* Read image data
+ */
+ if ((DK4_E_NONE == er.ec) && (0L < w) && (0L < h)) {
+ pfd->rows = (uint32 *)_TIFFmalloc(nby);
+ if (NULL != pfd->rows) {
+ if (1 == TIFFReadRGBAImageOriented(tiff,w,h,pfd->rows,orie,0)) {
+ back->cf->bg[0] = 255;
+
+#line 182 "dk4bift.ctr"
+ back->cf->bg[1] = 255;
+ back->cf->bg[2] = 255;
+ back->cf->bg[3] = 255;
+ back->cf->bglbd[0] = 255;
+ back->cf->bglbd[1] = 255;
+ back->cf->bglbd[2] = 255;
+ back->cf->bglbd[3] = 255;
+ dk4pxres_setup(&(back->cf->resampler), 8, 8);
+ back->cf->l_bdepth = back->cf->r_bdepth = 8;
+ back->cf->n_comp = 4;
+ back->cf->l_cs = back->cf->f_cs = DK4_CS_RGB_ALPHA;
+ back->cf->hbg = 0;
+ }
+ else {
+
+#line 196 "dk4bift.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ cc = -1;
+ ok = 0;
+ }
+ }
+ else {
+
+#line 202 "dk4bift.ctr"
+ dk4error_set_elsize_nelem(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED,
+ nby, 1
+ );
+ cc = -1;
+ ok = 0;
+ }
+ }
+ else {
+
+#line 211 "dk4bift.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ cc = -1;
+ ok = 0;
+ }
+
+ /* Attempt to read one further frame
+ */
+ if (0 == cc) {
+ if (1 == TIFFReadDirectory(tiff)) {
+
+#line 220 "dk4bift.ctr"
+ if (0 != dk4biftool_nc_add_frame(back, erp)) {
+ pfd = dk4mem_new(dk4_bif_tiff_per_frame_t,1,NULL);
+ if (NULL != pfd) {
+
+#line 223 "dk4bift.ctr"
+ pfd->rows = NULL;
+ back->cf->tsdata = pfd;
+ cc = 1;
+ }
+ else {
+
+#line 228 "dk4bift.ctr"
+ dk4error_set_elsize_nelem(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED,
+ sizeof(dk4_bif_tiff_per_frame_t), 1
+ );
+ ok = 0;
+ cc = -1;
+ }
+ }
+ else {
+
+#line 237 "dk4bift.ctr"
+ ok = 0;
+ cc = -1;
+ }
+ }
+ }
+
+ } while (1 == cc);
+
+ finished:
+ if (NULL != tiff) {
+
+#line 247 "dk4bift.ctr"
+ TIFFClose(tiff);
+ }
+ if (0 == ok) {
+ if (NULL != back) {
+
+#line 251 "dk4bift.ctr"
+ dk4bif_close(back);
+ back = NULL;
+ }
+ }
+
+
+#line 256 "dk4bift.ctr"
+ return back;
+}
+
+
+
+int
+dk4biftiff_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ dk4_bif_tiff_per_frame_t *pfd = NULL; /* Per-frame data */
+ uint32 abgr; /* Pixel index in array */
+ int back = 0;
+
+
+#line 273 "dk4bift.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bif);
+#endif
+ if (NULL == bif->cf->tsdata) {
+
+#line 278 "dk4bift.ctr"
+ goto finished;
+ }
+ pfd = (dk4_bif_tiff_per_frame_t *)(bif->cf->tsdata);
+ abgr = (pfd->rows)[(rowno * bif->cf->dim_x) + colno];
+ dptr[0] = TIFFGetR(abgr);
+ dptr[1] = TIFFGetG(abgr);
+ dptr[2] = TIFFGetB(abgr);
+ dptr[3] = TIFFGetA(abgr);
+ back = 1;
+
+ finished:
+
+
+#line 290 "dk4bift.ctr"
+ return back;
+}
+
+
+
+#endif
+/* if DK4_HAVE_TIFF_H */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bift.ctr b/support/dktools/dk4bift.ctr
new file mode 100644
index 0000000000..6cbd9a0d34
--- /dev/null
+++ b/support/dktools/dk4bift.ctr
@@ -0,0 +1,300 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+#include "dk4conf.h"
+
+
+$!trace-include
+
+
+
+#if DK4_HAVE_TIFF_H
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4MAAL_H_INCLUDED
+#include "dk4maal.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+void
+dk4biftiff_nc_release_per_frame_data(
+ void *tsdata
+)
+{
+ dk4_bif_tiff_per_frame_t *pfd = NULL; /* Per-frame data */
+ $? "+ dk4biftiff_nc_release_per_frame_data"
+#if DK4_USE_ASSERT
+ assert(NULL != tsdata);
+#endif
+ pfd = (dk4_bif_tiff_per_frame_t *)tsdata;
+ if (NULL != pfd) {
+ if (NULL != pfd->rows) { $? ". release pfd->rows"
+ _TIFFfree(pfd->rows);
+ pfd->rows = NULL;
+ } $? ". release pfd"
+ dk4mem_free(pfd);
+ }
+ $? "- dk4biftiff_nc_release_per_frame_data"
+}
+
+
+
+dk4_bif_t *
+dk4biftiff_nc_open_type(
+ dkChar const *fn,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Error report for math op */
+ dk4_bif_tiff_per_frame_t *pfd = NULL; /* Per-frame data */
+ dk4_bif_t *back = NULL;
+ TIFF *tiff = NULL; /* TIFF file */
+ double xrv; /* Temporary resolution valuej */
+ float rv; /* Temporary resolution value */
+ uint32 w; /* Frame width */
+ uint32 h; /* Frame height */
+ int ok = 0; /* Flag: Success */
+ int cc = 0; /* Flag: Can continue */
+ uint16 ru; /* Resolution unit */
+ uint16 orie; /* Orientation */
+ tsize_t nby; /* Byte number to allocate */
+ $? "+ dk4biftiff_nc_open_type"
+ back = dk4biftool_nc_new_for_one_frame(
+ fn, DK4_BIF_TYPE_TIFF, 0, pcsctx, erp
+ );
+ if (NULL == back) { goto finished; }
+ $? ". bif allocated"
+
+ pfd = dk4mem_new(dk4_bif_tiff_per_frame_t,1,NULL);
+ if (NULL == pfd) { goto finished; }
+ pfd->rows = NULL;
+ $? ". per-frame structure allocated"
+
+ back->cf->tsdata = pfd;
+
+#if (DK4_CHAR_SIZE > 1) && (DK4_ON_WINDOWS)
+ tiff = TIFFOpenW(fn, "rb");
+#else
+ tiff = TIFFOpen(fn, "rb");
+#endif
+ if (NULL == tiff) { goto finished; }
+ $? ". TIFF file opened"
+
+ /* Traverse all frames
+ */
+ ok = 1;
+ do {
+ cc = 0;
+ w = 0UL;
+ h = 0UL;
+
+ /* Read image width and height
+ */
+ if (1 == TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &w)) {
+ back->cf->dim_x = w;
+ }
+ else { $? "! failed to read width"
+ w = 0UL;
+ }
+ if (1 == TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &h)) {
+ back->cf->dim_y = h;
+ }
+ else { $? "! failed to read height"
+ h = 0UL;
+ }
+
+ /* Read resolution
+ */
+ rv = 0.0;
+ if (1 == TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &rv)) {
+ back->cf->res_x = rv; $? ". x resolution %g", rv
+ }
+ rv = 0.0;
+ if (1 == TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &rv)) {
+ back->cf->res_y = rv; $? ". y resolution %g", rv
+ }
+ ru = 0;
+ if (1 == TIFFGetField(tiff, TIFFTAG_RESOLUTIONUNIT, &ru)) {
+ if (RESUNIT_CENTIMETER == ru) { $? ". resolution in cm"
+ back->cf->res_x *= 2.54;
+ back->cf->res_y *= 2.54;
+ }
+ }
+ if ((0.0 >= back->cf->res_x) || (0.0 >= back->cf->res_y)) {
+ back->cf->res_x = back->cf->res_y = -1.0;
+ $? ". at least one illegal resolution value"
+ }
+
+ /* Read orientation, swap x and y coordinates if necessary
+ */
+ orie = ORIENTATION_TOPLEFT;
+ if (1 == TIFFGetFieldDefaulted(tiff, TIFFTAG_ORIENTATION, &orie)) {
+ switch (orie) {
+ case 5: case 6: case 7: case 8: { $? ". swap x/y"
+ back->cf->dim_x = h; back->cf->dim_y = w;
+ xrv = back->cf->res_x;
+ back->cf->res_x = back->cf->res_y;
+ back->cf->res_y = xrv;
+ } break;
+ }
+ }
+ else {
+ orie = ORIENTATION_TOPLEFT;
+ }
+
+ /* Calculate byte number
+ */
+ dk4error_init(&er);
+ nby = dk4ma_long_mul(
+ dk4ma_long_mul(w, h, &er), 4L, &er
+ );
+
+ /* Read image data
+ */
+ if ((DK4_E_NONE == er.ec) && (0L < w) && (0L < h)) {
+ pfd->rows = (uint32 *)_TIFFmalloc(nby);
+ if (NULL != pfd->rows) {
+ if (1 == TIFFReadRGBAImageOriented(tiff,w,h,pfd->rows,orie,0)) {
+ back->cf->bg[0] = 255; $? ". image read successfully"
+ back->cf->bg[1] = 255;
+ back->cf->bg[2] = 255;
+ back->cf->bg[3] = 255;
+ back->cf->bglbd[0] = 255;
+ back->cf->bglbd[1] = 255;
+ back->cf->bglbd[2] = 255;
+ back->cf->bglbd[3] = 255;
+ dk4pxres_setup(&(back->cf->resampler), 8, 8);
+ back->cf->l_bdepth = back->cf->r_bdepth = 8;
+ back->cf->n_comp = 4;
+ back->cf->l_cs = back->cf->f_cs = DK4_CS_RGB_ALPHA;
+ back->cf->hbg = 0;
+ }
+ else { $? "! failed to read image"
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ cc = -1;
+ ok = 0;
+ }
+ }
+ else { $? "! rows allocation failed"
+ dk4error_set_elsize_nelem(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED,
+ nby, 1
+ );
+ cc = -1;
+ ok = 0;
+ }
+ }
+ else { $? ". math overflow or w or h 0"
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ cc = -1;
+ ok = 0;
+ }
+
+ /* Attempt to read one further frame
+ */
+ if (0 == cc) {
+ if (1 == TIFFReadDirectory(tiff)) { $? ". further frame available"
+ if (0 != dk4biftool_nc_add_frame(back, erp)) {
+ pfd = dk4mem_new(dk4_bif_tiff_per_frame_t,1,NULL);
+ if (NULL != pfd) { $? ". pfd allocated"
+ pfd->rows = NULL;
+ back->cf->tsdata = pfd;
+ cc = 1;
+ }
+ else { $? "! failed to allocate pfd"
+ dk4error_set_elsize_nelem(
+ erp, DK4_E_MEMORY_ALLOCATION_FAILED,
+ sizeof(dk4_bif_tiff_per_frame_t), 1
+ );
+ ok = 0;
+ cc = -1;
+ }
+ }
+ else { $? "! failed to add frame"
+ ok = 0;
+ cc = -1;
+ }
+ }
+ }
+
+ } while (1 == cc);
+
+ finished:
+ if (NULL != tiff) { $? ". closing TIFF file"
+ TIFFClose(tiff);
+ }
+ if (0 == ok) {
+ if (NULL != back) { $? "! releasing bif structure due to errors"
+ dk4bif_close(back);
+ back = NULL;
+ }
+ }
+ $? "- dk4biftiff_nc_open_type %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+dk4biftiff_nc_get_original_pixel(
+ dk4_px_t *dptr,
+ dk4_bif_t const *bif,
+ dk4_bif_dim_t rowno,
+ dk4_bif_dim_t colno
+)
+{
+ dk4_bif_tiff_per_frame_t *pfd = NULL; /* Per-frame data */
+ uint32 abgr; /* Pixel index in array */
+ int back = 0;
+ $? "+ dk4biftiff_nc_get_original_pixel"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bif);
+#endif
+ if (NULL == bif->cf->tsdata) { $? "! no per-frame data"
+ goto finished;
+ }
+ pfd = (dk4_bif_tiff_per_frame_t *)(bif->cf->tsdata);
+ abgr = (pfd->rows)[(rowno * bif->cf->dim_x) + colno];
+ dptr[0] = TIFFGetR(abgr);
+ dptr[1] = TIFFGetG(abgr);
+ dptr[2] = TIFFGetB(abgr);
+ dptr[3] = TIFFGetA(abgr);
+ back = 1;
+
+ finished:
+ $? "- dk4biftiff_nc_get_original_pixel %d", back
+ return back;
+}
+
+
+
+#endif
+/* if DK4_HAVE_TIFF_H */
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifto.c b/support/dktools/dk4bifto.c
new file mode 100644
index 0000000000..7611b37361
--- /dev/null
+++ b/support/dktools/dk4bifto.c
@@ -0,0 +1,321 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bifto.ctr
+*/
+
+/** @file dk4bifto.c The dk4bifto module.
+*/
+
+
+#line 8 "dk4bifto.ctr"
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+
+#line 42 "dk4bifto.ctr"
+
+
+
+/** Compare two frames by frame number.
+ @param l Pointer to left frame.
+ @param r Pointer to right frame.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+*/
+
+static
+int
+dk4biftool_frame_compare(
+ const void *l,
+ const void *r,
+ int DK4_ARG_UNUSED(cr)
+)
+{
+ const dk4_bif_frame_t *pl; /* Left side object */
+ const dk4_bif_frame_t *pr; /* Right side object */
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_bif_frame_t *)l;
+ pr = (const dk4_bif_frame_t *)r;
+ if (pl->fno > pr->fno) {
+ back = 1;
+ }
+ else {
+ if (pl->fno < pr->fno) {
+ back = -1;
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4biftool_nc_bif_init(
+ dk4_bif_t *bptr,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 104 "dk4bifto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ /*
+ Initialize all structure members
+ */
+ if (NULL != pcsctx) {
+ DK4_MEMCPY(&(bptr->cs_ctx), pcsctx, sizeof(dk4_cs_conv_ctx_t));
+ }
+ else {
+ dk4cs_context_init(&(bptr->cs_ctx), erp);
+ }
+ bptr->tsdata = NULL;
+ bptr->s_frames = NULL;
+ bptr->i_frames = NULL;
+ bptr->filename = NULL;
+ bptr->cf = NULL;
+ bptr->n_frames = 0;
+ bptr->imgtype = ty;
+ bptr->hdronly = honly;
+ if (NULL != fn) {
+ bptr->filename = dk4str_dup(fn, erp);
+ if (NULL != bptr->filename) {
+ back = 1;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 131 "dk4bifto.ctr"
+ }
+#endif
+ }
+ else {
+ back = 1;
+ }
+ if (1 == back) {
+ back = 0;
+ bptr->s_frames = dk4sto_open(erp);
+ if (NULL != bptr->s_frames) {
+ (void)dk4sto_set_comp(bptr->s_frames, dk4biftool_frame_compare, 0);
+ bptr->i_frames = dk4sto_it_open(bptr->s_frames, erp);
+ if (NULL != bptr->i_frames) {
+ back = 1;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 148 "dk4bifto.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 153 "dk4bifto.ctr"
+ }
+#endif
+ }
+
+
+#line 157 "dk4bifto.ctr"
+ return back;
+}
+
+
+
+void
+dk4biftool_nc_frame_init(
+ dk4_bif_frame_t *fptr
+)
+{
+
+
+#line 168 "dk4bifto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fptr);
+#endif
+ fptr->bg[0] = fptr->bg[1] = fptr->bg[2] = fptr->bg[3] = 0;
+ fptr->bglbd[0] = fptr->bglbd[1] = fptr->bglbd[2] = fptr->bglbd[3] = 0;
+ dk4pxres_setup(&(fptr->resampler), 8, 8);
+ fptr->tsdata = NULL;
+ fptr->res_x = fptr->res_y = -1.0;
+ fptr->fno = 0;
+ fptr->n_comp = 0;
+ fptr->dim_x = fptr->dim_y = (dk4_bif_dim_t)0L;
+ fptr->l_cs = fptr->f_cs = -1;
+ fptr->hbg = 0;
+ fptr->fmres = 0;
+ fptr->fmrmv = 0U;
+ fptr->l_bdepth = fptr->r_bdepth = 8;
+
+
+#line 185 "dk4bifto.ctr"
+}
+
+
+
+int
+dk4biftool_nc_add_frame(
+ dk4_bif_t *bptr,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_frame_t *fptr; /* New frame */
+ int back = 0;
+
+
+#line 198 "dk4bifto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ if (SIZE_MAX > bptr->n_frames) {
+ /*
+ Allocate memory for frame, test allocation
+ */
+ fptr = dk4mem_new(dk4_bif_frame_t,1,erp);
+ if (NULL != fptr) {
+ /*
+ Initialize frame structure
+ */
+ dk4biftool_nc_frame_init(fptr);
+ fptr->fno = bptr->n_frames;
+ bptr->n_frames += 1;
+ /*
+ Add frame structure to storage
+ */
+ if (0 != dk4sto_add(bptr->s_frames, fptr, erp)) {
+ bptr->cf = fptr;
+ back = 1;
+ }
+ else {
+
+#line 221 "dk4bifto.ctr"
+ dk4mem_free(fptr);
+ }
+ }
+ }
+ else {
+
+#line 226 "dk4bifto.ctr"
+ /* Too many frames in bitmap image file, numeric overflow
+ */
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+
+
+#line 231 "dk4bifto.ctr"
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4biftool_nc_new_for_one_frame(
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *back = NULL;
+ int ok = 0;
+
+
+#line 248 "dk4bifto.ctr"
+ /*
+ Allocate memory for bitmap image file
+ */
+ back = dk4mem_new(dk4_bif_t,1,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* Initialize bitmap image file, allocate resources for components
+ */
+ if (0 == dk4biftool_nc_bif_init(back, fn, ty, honly, pcsctx, erp)) {
+ goto finished;
+ }
+ /* Add the first frame
+ */
+ if (0 == dk4biftool_nc_add_frame(back, erp)) {
+ goto finished;
+ }
+ /* Indicate success
+ */
+ ok = 1;
+
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+
+#line 271 "dk4bifto.ctr"
+ dk4bif_close(back);
+ back = NULL;
+ }
+
+
+#line 275 "dk4bifto.ctr"
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifto.ctr b/support/dktools/dk4bifto.ctr
new file mode 100644
index 0000000000..3a0dea1377
--- /dev/null
+++ b/support/dktools/dk4bifto.ctr
@@ -0,0 +1,280 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Compare two frames by frame number.
+ @param l Pointer to left frame.
+ @param r Pointer to right frame.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+*/
+
+static
+int
+dk4biftool_frame_compare(
+ const void *l,
+ const void *r,
+ int DK4_ARG_UNUSED(cr)
+)
+{
+ const dk4_bif_frame_t *pl; /* Left side object */
+ const dk4_bif_frame_t *pr; /* Right side object */
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_bif_frame_t *)l;
+ pr = (const dk4_bif_frame_t *)r;
+ if (pl->fno > pr->fno) {
+ back = 1;
+ }
+ else {
+ if (pl->fno < pr->fno) {
+ back = -1;
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4biftool_nc_bif_init(
+ dk4_bif_t *bptr,
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4biftool_nc_bif_init"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ /*
+ Initialize all structure members
+ */
+ if (NULL != pcsctx) {
+ DK4_MEMCPY(&(bptr->cs_ctx), pcsctx, sizeof(dk4_cs_conv_ctx_t));
+ }
+ else {
+ dk4cs_context_init(&(bptr->cs_ctx), erp);
+ }
+ bptr->tsdata = NULL;
+ bptr->s_frames = NULL;
+ bptr->i_frames = NULL;
+ bptr->filename = NULL;
+ bptr->cf = NULL;
+ bptr->n_frames = 0;
+ bptr->imgtype = ty;
+ bptr->hdronly = honly;
+ if (NULL != fn) {
+ bptr->filename = dk4str_dup(fn, erp);
+ if (NULL != bptr->filename) {
+ back = 1;
+ }
+#if TRACE_DEBUG
+ else { $? "! fn"
+ }
+#endif
+ }
+ else {
+ back = 1;
+ }
+ if (1 == back) {
+ back = 0;
+ bptr->s_frames = dk4sto_open(erp);
+ if (NULL != bptr->s_frames) {
+ (void)dk4sto_set_comp(bptr->s_frames, dk4biftool_frame_compare, 0);
+ bptr->i_frames = dk4sto_it_open(bptr->s_frames, erp);
+ if (NULL != bptr->i_frames) {
+ back = 1;
+ }
+#if TRACE_DEBUG
+ else { $? "! i_frames"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! s_frames"
+ }
+#endif
+ }
+ $? "- dk4biftool_nc_bif_init %d", back
+ return back;
+}
+
+
+
+void
+dk4biftool_nc_frame_init(
+ dk4_bif_frame_t *fptr
+)
+{
+ $? "+ dk4biftool_nc_frame_init"
+#if DK4_USE_ASSERT
+ assert(NULL != fptr);
+#endif
+ fptr->bg[0] = fptr->bg[1] = fptr->bg[2] = fptr->bg[3] = 0;
+ fptr->bglbd[0] = fptr->bglbd[1] = fptr->bglbd[2] = fptr->bglbd[3] = 0;
+ dk4pxres_setup(&(fptr->resampler), 8, 8);
+ fptr->tsdata = NULL;
+ fptr->res_x = fptr->res_y = -1.0;
+ fptr->fno = 0;
+ fptr->n_comp = 0;
+ fptr->dim_x = fptr->dim_y = (dk4_bif_dim_t)0L;
+ fptr->l_cs = fptr->f_cs = -1;
+ fptr->hbg = 0;
+ fptr->fmres = 0;
+ fptr->fmrmv = 0U;
+ fptr->l_bdepth = fptr->r_bdepth = 8;
+ $? "- dk4biftool_nc_frame_init"
+}
+
+
+
+int
+dk4biftool_nc_add_frame(
+ dk4_bif_t *bptr,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_frame_t *fptr; /* New frame */
+ int back = 0;
+ $? "+ dk4biftool_nc_add_frame"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ if (SIZE_MAX > bptr->n_frames) {
+ /*
+ Allocate memory for frame, test allocation
+ */
+ fptr = dk4mem_new(dk4_bif_frame_t,1,erp);
+ if (NULL != fptr) {
+ /*
+ Initialize frame structure
+ */
+ dk4biftool_nc_frame_init(fptr);
+ fptr->fno = bptr->n_frames;
+ bptr->n_frames += 1;
+ /*
+ Add frame structure to storage
+ */
+ if (0 != dk4sto_add(bptr->s_frames, fptr, erp)) {
+ bptr->cf = fptr;
+ back = 1;
+ }
+ else { $? "! dk4sto_add"
+ dk4mem_free(fptr);
+ }
+ }
+ }
+ else { $? "! overflow"
+ /* Too many frames in bitmap image file, numeric overflow
+ */
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ $? "- dk4biftool_nc_add_frame %d", back
+ return back;
+}
+
+
+
+dk4_bif_t *
+dk4biftool_nc_new_for_one_frame(
+ dkChar const *fn,
+ int ty,
+ int honly,
+ dk4_cs_conv_ctx_t const *pcsctx,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4biftool_nc_new_for_one_frame"
+ /*
+ Allocate memory for bitmap image file
+ */
+ back = dk4mem_new(dk4_bif_t,1,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* Initialize bitmap image file, allocate resources for components
+ */
+ if (0 == dk4biftool_nc_bif_init(back, fn, ty, honly, pcsctx, erp)) {
+ goto finished;
+ }
+ /* Add the first frame
+ */
+ if (0 == dk4biftool_nc_add_frame(back, erp)) {
+ goto finished;
+ }
+ /* Indicate success
+ */
+ ok = 1;
+
+ finished:
+ if ((NULL != back) && (0 == ok)) { $? "! incomplete setup"
+ dk4bif_close(back);
+ back = NULL;
+ }
+ $? "- dk4biftool_nc_new_for_one_frame %d", TR_IPTR(back)
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bifty.h b/support/dktools/dk4bifty.h
new file mode 100644
index 0000000000..5fcc594829
--- /dev/null
+++ b/support/dktools/dk4bifty.h
@@ -0,0 +1,147 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/** @file dk4bifty.h Type definitions for bitmap image files.
+*/
+
+#ifndef DK4BIFTY_H_INCLUDED
+/** Protection against multiple inclusions. */
+#define DK4BIFTY_H_INCLUDED 1
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
+#endif
+
+#ifndef DK4PX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4px.h"
+#else
+#include <dktools-4/dk4px.h>
+#endif
+#endif
+
+#ifndef DK4PXRES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4pxres.h"
+#else
+#include <dktools-4/dk4pxres.h>
+#endif
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4cs.h"
+#else
+#include <dktools-4/dk4cs.h>
+#endif
+#endif
+
+
+/** Image dimension and coordinate specifcation.
+*/
+typedef long dk4_bif_dim_t;
+
+
+/** Image file type.
+*/
+enum {
+ DK4_BIF_TYPE_PNG = 0, /**< PNG image. */
+ DK4_BIF_TYPE_JPEG , /**< JPEG image. */
+ DK4_BIF_TYPE_TIFF , /**< TIFF image. */
+ DK4_BIF_TYPE_NETPBM , /**< NetPBM image. */
+
+ DK4_BIF_TYPE_MIN = DK4_BIF_TYPE_PNG , /**< Minimum value. */
+ DK4_BIF_TYPE_MAX = DK4_BIF_TYPE_NETPBM /**< Maximum value. */
+};
+
+
+
+/** One frame from image.
+
+ The l_cs component is the color space the image reading library
+ returned, possibly after applying transformations to the image data.
+
+ The f_cs component is the original color space used in the image file.
+
+ The bg array contains a background color suggested in the image
+ file if there is partial transparency.
+ If l_cs is DK4_CS_GRAY_ALPHA there is only one gray component in the array.
+ If l_cs is DK4_CS_RGB_ALPHA there are red, green and blue components.
+*/
+typedef struct {
+ dk4_px_t bg[4]; /**< Background data, output bit depth. */
+ dk4_px_t bglbd[4]; /**< Background data, original bit depth. */
+ dk4_px_resample_t resampler; /**< Bit depth resampler. */
+ void *tsdata; /**< Type-specific data per frame. */
+ double res_x; /**< X resolution in dpi (dots per inch). */
+ double res_y; /**< Y resolution in dpi (dots per inch). */
+ size_t fno; /**< Frame number. */
+ size_t n_comp; /**< Number of color components. */
+ dk4_bif_dim_t dim_x; /**< Image width (number of pixels). */
+ dk4_bif_dim_t dim_y; /**< Image height (number of pixels). */
+ int l_cs; /**< Color space returned by library. */
+ int f_cs; /**< Color space in file. */
+ int hbg; /**< Flag: Background chunk in file. */
+ int fmres; /**< Flag: Must resample, unusual maxval. */
+ dk4_px_t fmrmv; /**< Unusual maxval value of frame. */
+ dk4_px_bit_depth_t l_bdepth; /**< Original bit depth from image file. */
+ dk4_px_bit_depth_t r_bdepth; /**< Required output bit depth. */
+} dk4_bif_frame_t;
+
+
+/** Bitmap image file.
+*/
+typedef struct {
+ dk4_cs_conv_ctx_t cs_ctx; /**< Color space conversion context. */
+ void *tsdata; /**< Type-specific data per file. */
+ dk4_sto_t *s_frames; /**< Container to store frames. */
+ dk4_sto_it_t *i_frames; /**< Iterator for frames container. */
+ dkChar *filename; /**< Name of image file. */
+ dk4_bif_frame_t *cf; /**< Current frame to process. */
+ size_t n_frames; /**< Number of frames in image. */
+ int imgtype; /**< Image type. */
+ int hdronly; /**< Flag: Read header information only. */
+} dk4_bif_t;
+
+
+
+/** Allowed difference in aspect ratio when setting custom resolution.
+*/
+#define DK4_BIF_EPSILON_ASPECT (1.0e-5)
+
+
+#endif
+/* ifndef DK4BIFTY_H_INCLUDED */
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4binenc.c b/support/dktools/dk4binenc.c
index 597dad1eb0..7a76ea8595 100644
--- a/support/dktools/dk4binenc.c
+++ b/support/dktools/dk4binenc.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4binenc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4binenc.ctr
*/
/** @file dk4binenc.c The dk4binenc module.
*/
-#line 94 "dk4binenc.ctr"
+#line 109 "dk4binenc.ctr"
+#include "dk4conf.h"
#include "dk4binenc.h"
#include "dk4mem.h"
#include "dk4memrs.h"
@@ -47,11 +26,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4strd.h"
#include "dk4edstm.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 106 "dk4binenc.ctr"
+#line 128 "dk4binenc.ctr"
@@ -92,7 +77,7 @@ dkT("a85"),
NULL
-#line 129 "dk4binenc.ctr"
+#line 151 "dk4binenc.ctr"
};
@@ -115,6 +100,12 @@ dk4binenc(
size_t oused;
size_t noused;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+ assert(0 < szdptr);
+ assert(0 < szsptr);
+#endif
if ((NULL != dptr) && (NULL != sptr) && (0 < szdptr) && (0 < szsptr)) {
switch (enc) {
case DK4_BINARY_TO_TEXT_ENCODING_NONE : {
@@ -235,6 +226,9 @@ dk4binenc_choose_encoding(const dkChar *name, dk4_er_t *erp)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL != name) {
switch (dk4str_array_index(dk4binenc_encoding_names, name, 0)) {
case 0: case 1: {
diff --git a/support/dktools/dk4binenc.ctr b/support/dktools/dk4binenc.ctr
index a46470ca4c..cfbc4a3a08 100644
--- a/support/dktools/dk4binenc.ctr
+++ b/support/dktools/dk4binenc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,7 +11,22 @@ license = bsd
/** @file dk4binenc.h Encode binary data to text.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -92,6 +107,7 @@ enum {
%% module
+#include "dk4conf.h"
#include "dk4binenc.h"
#include "dk4mem.h"
#include "dk4memrs.h"
@@ -100,6 +116,12 @@ enum {
#include "dk4strd.h"
#include "dk4edstm.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -148,6 +170,12 @@ dk4binenc(
size_t oused;
size_t noused;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+ assert(0 < szdptr);
+ assert(0 < szsptr);
+#endif
if ((NULL != dptr) && (NULL != sptr) && (0 < szdptr) && (0 < szsptr)) {
switch (enc) {
case DK4_BINARY_TO_TEXT_ENCODING_NONE : {
@@ -268,6 +296,9 @@ dk4binenc_choose_encoding(const dkChar *name, dk4_er_t *erp)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL != name) {
switch (dk4str_array_index(dk4binenc_encoding_names, name, 0)) {
case 0: case 1: {
diff --git a/support/dktools/dk4binenc.h b/support/dktools/dk4binenc.h
index 4a2c480436..8adaad3774 100644
--- a/support/dktools/dk4binenc.h
+++ b/support/dktools/dk4binenc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4binenc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4binenc.ctr
*/
#ifndef DK4BINENC_H_INCLUDED
@@ -43,7 +21,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4binenc.h Encode binary data to text.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4bitsh.c b/support/dktools/dk4bitsh.c
index bd3bbe3b05..657011f572 100644
--- a/support/dktools/dk4bitsh.c
+++ b/support/dktools/dk4bitsh.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4bitsh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bitsh.ctr
*/
/** @file dk4bitsh.c The dk4bitsh module.
*/
-#line 89 "dk4bitsh.ctr"
+#line 104 "dk4bitsh.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4bitsh.h"
#include "dk4edstm.h"
@@ -47,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 97 "dk4bitsh.ctr"
+#line 121 "dk4bitsh.ctr"
@@ -55,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void
dk4bit_shift_init(dk4_bit_shift_t *bs, dk4_er_t *erp)
{
+
+
+#line 129 "dk4bitsh.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bs);
+#endif
if (NULL != bs) {
DK4_MEMRES(bs, sizeof(dk4_bit_shift_t));
bs->pos = 0;
@@ -62,6 +55,9 @@ dk4bit_shift_init(dk4_bit_shift_t *bs, dk4_er_t *erp)
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 140 "dk4bitsh.ctr"
}
@@ -70,6 +66,12 @@ int
dk4bit_shift_add(dk4_bit_shift_t *bs, int bit, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
+
+
+#line 149 "dk4bitsh.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bs);
+#endif
if (NULL != bs) {
back = DK4_EDSTM_ACCEPT;
switch (bs->pos) {
@@ -104,12 +106,17 @@ dk4bit_shift_add(dk4_bit_shift_t *bs, int bit, dk4_er_t *erp)
case 7: {
if (0 != bit) { bs->obyte |= 0x01; }
bs->pos = 0;
- back = DK4_EDSTM_FINISHED;
+ back = DK4_EDSTM_FINISHED;
+
+#line 187 "dk4bitsh.ctr"
} break;
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 193 "dk4bitsh.ctr"
return back;
}
@@ -119,31 +126,50 @@ int
dk4bit_shift_finish(dk4_bit_shift_t *bs, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
+
+
+#line 203 "dk4bitsh.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bs);
+#endif
if (NULL != bs) {
if (0 != bs->pos) {
back = DK4_EDSTM_FINISHED;
} else {
- back = DK4_EDSTM_ACCEPT;
+ back = DK4_EDSTM_ACCEPT;
+
+#line 211 "dk4bitsh.ctr"
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 216 "dk4bitsh.ctr"
return back;
}
unsigned char
-dk4bit_shift_output(dk4_bit_shift_t *bs, dk4_er_t *erp)
+dk4bit_shift_output(dk4_bit_shift_t const *bs, dk4_er_t *erp)
{
unsigned char back;
+
+#line 226 "dk4bitsh.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bs);
+#endif
if (NULL != bs) {
back = bs->obyte;
} else {
back = 0x00;
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 236 "dk4bitsh.ctr"
return back;
}
diff --git a/support/dktools/dk4bitsh.ctr b/support/dktools/dk4bitsh.ctr
index a95b61ef0b..31305d257c 100644
--- a/support/dktools/dk4bitsh.ctr
+++ b/support/dktools/dk4bitsh.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,7 +11,22 @@ license = bsd
/** @file dk4bitsh.h Bit shifting.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
/** Bit shifter.
*/
@@ -79,7 +94,7 @@ dk4bit_shift_finish(dk4_bit_shift_t *bs, dk4_er_t *erp);
@return Byte value consisting of the last bits added.
*/
unsigned char
-dk4bit_shift_output(dk4_bit_shift_t *bs, dk4_er_t *erp);
+dk4bit_shift_output(dk4_bit_shift_t const *bs, dk4_er_t *erp);
#ifdef __cplusplus
}
@@ -87,6 +102,15 @@ dk4bit_shift_output(dk4_bit_shift_t *bs, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4bitsh.h"
#include "dk4edstm.h"
#include "dk4mem.h"
@@ -101,6 +125,10 @@ $!trace-include
void
dk4bit_shift_init(dk4_bit_shift_t *bs, dk4_er_t *erp)
{
+ $? "+ dk4bit_shift_init bs=%d", TR_IPTR(bs)
+#if DK4_USE_ASSERT
+ assert(NULL != bs);
+#endif
if (NULL != bs) {
DK4_MEMRES(bs, sizeof(dk4_bit_shift_t));
bs->pos = 0;
@@ -108,6 +136,7 @@ dk4bit_shift_init(dk4_bit_shift_t *bs, dk4_er_t *erp)
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4bit_shift_init"
}
@@ -116,6 +145,10 @@ int
dk4bit_shift_add(dk4_bit_shift_t *bs, int bit, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
+ $? "+ dk4bit_shift_add bs=%d bit=%d pos=%d", TR_IPTR(bs), bit, (int)(bs->pos)
+#if DK4_USE_ASSERT
+ assert(NULL != bs);
+#endif
if (NULL != bs) {
back = DK4_EDSTM_ACCEPT;
switch (bs->pos) {
@@ -150,12 +183,13 @@ dk4bit_shift_add(dk4_bit_shift_t *bs, int bit, dk4_er_t *erp)
case 7: {
if (0 != bit) { bs->obyte |= 0x01; }
bs->pos = 0;
- back = DK4_EDSTM_FINISHED;
+ back = DK4_EDSTM_FINISHED; $? ". byte finished %d", (int)(bs->obyte)
} break;
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4bit_shift_add %d", back
return back;
}
@@ -165,31 +199,40 @@ int
dk4bit_shift_finish(dk4_bit_shift_t *bs, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
+ $? "+ dk4bit_shift_finish bs=%d", TR_IPTR(bs)
+#if DK4_USE_ASSERT
+ assert(NULL != bs);
+#endif
if (NULL != bs) {
if (0 != bs->pos) {
back = DK4_EDSTM_FINISHED;
} else {
- back = DK4_EDSTM_ACCEPT;
+ back = DK4_EDSTM_ACCEPT; $? ". final byte available"
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4bit_shift_finish %d", back
return back;
}
unsigned char
-dk4bit_shift_output(dk4_bit_shift_t *bs, dk4_er_t *erp)
+dk4bit_shift_output(dk4_bit_shift_t const *bs, dk4_er_t *erp)
{
unsigned char back;
-
+ $? "+ dk4bit_shift_output bs=%d", TR_IPTR(bs)
+#if DK4_USE_ASSERT
+ assert(NULL != bs);
+#endif
if (NULL != bs) {
back = bs->obyte;
} else {
back = 0x00;
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4bit_shift_output %d", (int)back
return back;
}
diff --git a/support/dktools/dk4bitsh.h b/support/dktools/dk4bitsh.h
index 5d62fa3148..b53ae06fd7 100644
--- a/support/dktools/dk4bitsh.h
+++ b/support/dktools/dk4bitsh.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4bitsh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bitsh.ctr
*/
#ifndef DK4BITSH_H_INCLUDED
@@ -43,7 +21,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4bitsh.h Bit shifting.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
/** Bit shifter.
*/
@@ -111,7 +104,7 @@ dk4bit_shift_finish(dk4_bit_shift_t *bs, dk4_er_t *erp);
@return Byte value consisting of the last bits added.
*/
unsigned char
-dk4bit_shift_output(dk4_bit_shift_t *bs, dk4_er_t *erp);
+dk4bit_shift_output(dk4_bit_shift_t const *bs, dk4_er_t *erp);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4bm.c b/support/dktools/dk4bm.c
new file mode 100644
index 0000000000..d5da2e33e2
--- /dev/null
+++ b/support/dktools/dk4bm.c
@@ -0,0 +1,451 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bm.ctr
+*/
+
+/** @file dk4bm.c The dk4bm module.
+*/
+
+
+#line 202 "dk4bm.ctr"
+
+#include "dk4mem.h"
+#include "dk4memrs.h"
+#include "dk4bm.h"
+
+
+
+#line 208 "dk4bm.ctr"
+
+
+/** One byte.
+*/
+typedef unsigned char dk4bm_uc_t;
+
+
+/** Pointer to unsigned chars.
+*/
+typedef unsigned char *dk4bm_puc_t;
+
+
+/** Bits within a byte.
+*/
+static unsigned char bib[] = {
+ 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
+};
+
+
+/** Constant value 0 for comparisons.
+*/
+#define SZ0 ((size_t)0U)
+
+
+/** Constant value 8 for comparisons.
+*/
+#define SZ8 ((size_t)8U)
+
+
+dk4_bit_matrix_t *
+dk4bm_open(
+ size_t rows,
+ size_t columns,
+ dk4_er_t *erp
+)
+{
+ dk4_bit_matrix_t *back = NULL; /* Function result */
+ dk4bm_puc_t *ppuc; /* Pointer: traverse back->data */
+ size_t bpr; /* Bytes per row */
+ size_t i; /* Index: traverse back->data */
+ int ok; /* Flag: All allocations ok */
+
+
+#line 250 "dk4bm.ctr"
+ if ((SZ0 < rows) && (SZ0 < columns)) {
+ bpr = columns / SZ8;
+ if (SZ0 != (columns % SZ8)) bpr++;
+
+
+#line 254 "dk4bm.ctr"
+ back = dk4mem_new(dk4_bit_matrix_t,1,erp);
+ if (NULL != back) {
+ back->rows = rows;
+ back->columns = columns;
+ back->bytes_per_row = bpr;
+ back->data = dk4mem_new(dk4bm_puc_t,rows,erp);
+ if (NULL != back->data) {
+ /*
+ Initialize all row pointers to NULL
+ */
+ ppuc = back->data;
+ for (i = 0; i < rows; i++) {
+ *(ppuc++) = NULL;
+ }
+ /*
+ Allocate the rows
+ */
+ ppuc = back->data;
+ ok = 1;
+ for (i = 0; i < rows; i++) {
+ *ppuc = dk4mem_new(dk4bm_uc_t,bpr,erp);
+ if (NULL != *ppuc) {
+ DK4_MEMRES(*ppuc,bpr);
+ }
+ else {
+
+#line 279 "dk4bm.ctr"
+ ok = 0;
+ }
+ ppuc++;
+ }
+ /*
+ Check allocations, delete object on error
+ */
+ if (0 == ok) {
+ dk4bm_close(back, 0);
+ back = NULL;
+ }
+ }
+ else {
+
+#line 292 "dk4bm.ctr"
+ dk4bm_close(back, 0);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 298 "dk4bm.ctr"
+ }
+#endif
+ }
+ else {
+
+#line 302 "dk4bm.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 304 "dk4bm.ctr"
+ return back;
+}
+
+
+#define USE_MEMCPY_FOR_ROWS 1
+
+dk4_bit_matrix_t *
+dk4bm_open_copy(
+ dk4_bit_matrix_t const *psrc,
+ dk4_er_t *erp
+)
+{
+ dk4_bit_matrix_t *back = NULL;
+#if USE_MEMCPY_FOR_ROWS
+ dk4bm_puc_t const *ps; /* Source data */
+ dk4bm_puc_t *pd; /* Destination data */
+#endif
+ size_t i; /* Current row number to copy */
+#if (!(USE_MEMCPY_FOR_ROWS))
+ size_t j;
+ int v;
+#endif
+
+
+#line 327 "dk4bm.ctr"
+ if (NULL != psrc) {
+ back = dk4bm_open(psrc->rows, psrc->columns, erp);
+ if (NULL != back) {
+#if USE_MEMCPY_FOR_ROWS
+ ps = psrc->data;
+ pd = back->data;
+ for (i = SZ0; i < psrc->rows; i++) {
+ DK4_MEMCPY(*pd,*ps,psrc->bytes_per_row);
+ ps++; pd++;
+ }
+#endif
+#if (!(USE_MEMCPY_FOR_ROWS))
+ for (i = SZ0; i < back->rows; i++) {
+ for (j = SZ0; j < back->columns; j++) {
+ v = 0;
+ if (0 != dk4bm_get(&v, psrc, i, j, NULL)) {
+ if (0 != v) {
+ dk4bm_set(back, i, j, 1, NULL);
+ }
+ }
+ }
+ }
+#endif
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 356 "dk4bm.ctr"
+ return back;
+}
+
+
+
+int
+dk4bm_set(
+ dk4_bit_matrix_t *pmb,
+ size_t row,
+ size_t column,
+ int value,
+ dk4_er_t *erp
+)
+{
+ size_t byteno; /* Byte number within row */
+ size_t bitno; /* Bit number within byte */
+ int back = 0; /* Function result */
+
+
+#line 374 "dk4bm.ctr"
+
+
+#line 375 "dk4bm.ctr"
+ if ((NULL != pmb) && (NULL != pmb->data)) {
+ if ((row < pmb->rows) && (column < pmb->columns)) {
+ byteno = column / SZ8;
+ bitno = column % SZ8;
+ if (0 != value) {
+ ((pmb->data)[row])[byteno] |= bib[bitno];
+ }
+ else {
+ ((pmb->data)[row])[byteno] &= (~(bib[bitno]));
+ }
+ back = 1;
+ }
+ else {
+
+#line 388 "dk4bm.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+
+#line 392 "dk4bm.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 394 "dk4bm.ctr"
+ return back;
+}
+
+
+
+int
+dk4bm_get(
+ int *pdest,
+ dk4_bit_matrix_t const *pmb,
+ size_t row,
+ size_t column,
+ dk4_er_t *erp
+)
+{
+ size_t byteno; /* Byte number within row */
+ size_t bitno; /* Bit number within byte */
+ int back = 0; /* Function result */
+
+
+#line 412 "dk4bm.ctr"
+ if ((NULL != pdest) && (NULL != pmb) && (NULL != pmb->data)) {
+ if ((row < pmb->rows) && (column < pmb->columns)) {
+ byteno = column / SZ8;
+ bitno = column % SZ8;
+ if (0x00 != ((((pmb->data)[row])[byteno]) & bib[bitno])) {
+ *pdest = 1;
+ }
+ else {
+ *pdest = 0;
+ }
+ back = 1;
+ }
+ else {
+
+#line 425 "dk4bm.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+
+#line 429 "dk4bm.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 431 "dk4bm.ctr"
+ return back;
+}
+
+
+
+/* 2019-10-06
+ ----------
+ Cache-friendly programming.
+ ----------
+ To see whether there is an indirect path from node i to node j -- if
+ not yet present -- we check a list of all nodes k whether there is a
+ known path from i to k and a known path from k to j.
+ A cache-friendly algorithm is used here.
+ Instead of ijk-algorithm (also called "naive algorithm") the
+ order of loops is changed here to ikj.
+ Variable i is used as row index for both i->j and i->k, an array pointer
+ is calculated from the row index i.
+ Variable k is used as row index k->j but also as column index i->k.
+ Variable j is only used as column index in both i->j and k->j, the
+ column index results in an index within an array.
+ So i is the variable for the outermost loop, k is the variable for the
+ middle loop and j is the variable for the inner loop.
+*/
+
+int
+dk4bm_expand(
+ dk4_bit_matrix_t *pmb,
+ dk4_er_t *erp
+)
+{
+ dk4bm_uc_t *ptri; /* Pointer: Row i bytes */
+ dk4bm_uc_t *ptrk; /* Pointer: Row k bytes */
+ size_t i; /* Destination row index */
+ size_t j; /* Destination column index */
+ size_t k; /* Intermediate point index */
+ size_t i_byte; /* Byte number of i within row */
+ size_t i_bit; /* Bit number of i within byte */
+ size_t j_byte; /* Byte number of j within row */
+ size_t j_bit; /* Bit number of j within byte */
+ size_t k_byte; /* Byte number of k within row */
+ size_t k_bit; /* Bit number of k within byte */
+#if TRACE_DEBUG
+ unsigned long passno = 0UL; /* Current pass number */
+#endif
+ int changed; /* Flag: Change occured in current pass */
+ int back = 0; /* Function result */
+
+
+#line 478 "dk4bm.ctr"
+ if ((NULL != pmb) && (NULL != pmb->data) && (pmb->rows == pmb->columns)) {
+ if (0 < pmb->rows) {
+ back = 1;
+ changed = 1;
+ while(0 != changed) {
+
+#line 483 "dk4bm.ctr"
+ changed = 0;
+ i_byte = 0;
+ i_bit = 0;
+ for (i = 0; i < pmb->rows; i++) {
+
+
+#line 488 "dk4bm.ctr"
+ ptri = (pmb->data)[i];
+ k_byte = 0;
+ k_bit = 0;
+ for (k = 0; k < pmb->rows; k++) {
+
+
+#line 493 "dk4bm.ctr"
+ ptrk = (pmb->data)[k];
+ if (0x00 != (ptri[k_byte] & bib[k_bit])) {
+ j_byte = 0;
+ j_bit = 0;
+ for (j = 0; j < pmb->rows; j++) {
+
+
+#line 499 "dk4bm.ctr"
+ if (0x00 == (ptri[j_byte] & bib[j_bit])) {
+
+
+#line 501 "dk4bm.ctr"
+ if (0x00 != (ptrk[j_byte] & bib[j_bit])) {
+
+
+#line 503 "dk4bm.ctr"
+ ptri[j_byte] |= bib[j_bit];
+ changed = 1;
+ }
+ }
+ j_bit++;
+ if (8 <= j_bit) {
+ j_bit = 0; j_byte++;
+ }
+ }
+ }
+ k_bit++;
+ if (8 <= k_bit) {
+ k_bit = 0; k_byte++;
+ }
+ }
+ i_bit++;
+ if (8 <= i_bit) {
+ i_bit = 0; i_byte++;
+ }
+ }
+
+#line 523 "dk4bm.ctr"
+ }
+ }
+ else {
+
+#line 526 "dk4bm.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+
+#line 530 "dk4bm.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 532 "dk4bm.ctr"
+ return back;
+}
+
+
+
+void
+dk4bm_close(
+ dk4_bit_matrix_t *pbm,
+ int san
+)
+{
+ dk4bm_puc_t *ppuc; /* Pointer: Traverse pbm->data */
+ size_t i; /* Index: Traverse pbm->data */
+
+
+#line 546 "dk4bm.ctr"
+ if (NULL != pbm) {
+ if (NULL != pbm->data) {
+ ppuc = pbm->data;
+ for (i = 0; i < pbm->rows; i++) {
+ if (NULL != *ppuc) {
+ if (0 != san) {
+ dk4mem_reset_secure(*ppuc,pbm->bytes_per_row,NULL);
+ }
+ dk4mem_free(*ppuc);
+ }
+ ppuc++;
+ }
+ dk4mem_free(pbm->data);
+ }
+ if (0 != san) {
+ dk4mem_reset_secure(pbm,sizeof(dk4_bit_matrix_t),NULL);
+ }
+ dk4mem_free(pbm);
+ }
+
+#line 565 "dk4bm.ctr"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bm.ctr b/support/dktools/dk4bm.ctr
new file mode 100644
index 0000000000..5579e21410
--- /dev/null
+++ b/support/dktools/dk4bm.ctr
@@ -0,0 +1,570 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4bm.h Bit matrix.
+
+Among other things a bit matrix can be used to represent a directed
+graph. A 1-bit in row <i>i</i> column <i>j</i> indicates a directed
+edge from <i>i</i> to <i>j</i> (row number represents source node,
+column number represents destination node).
+
+Alternatively you may choose reverse representation:
+A 1-bit in row <i>i</i> column <i>j</i> indicates a directed edge from <i>j</i>
+to <i>i</i> (row number represents destination node number, column number
+represents source node number).<br>
+In a dependency graph it means: <i>i</i> depends on <i>j</i>.
+
+After expanding the matrix you can check whether or not there is a path
+from any node to any other, either direct or
+indirect (path consisting of a sequence of direct edges).
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+/** Bit matrix structure.
+*/
+typedef struct {
+ unsigned char **data; /**< Bits grouped in bytes. */
+ size_t rows; /**< Number of rows. */
+ size_t columns; /**< Number of columns. */
+ size_t bytes_per_row; /**< Bytes per row. */
+} dk4_bit_matrix_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Open bit matrix.
+
+ CRT on Windows: Optional.
+ @param rows Number of rows.
+ @param columns Number of columns.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+ Use dk4bm_close() to close the bit matrix when done with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if the number of rows or columns is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occurs in size calculation (number of rows and/or
+ columns too large),
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if not enough memory available.
+*/
+
+dk4_bit_matrix_t *
+dk4bm_open(
+ size_t rows,
+ size_t columns,
+ dk4_er_t *erp
+);
+
+
+/** Create a full copy of a bit matrix as new bit matrix.
+
+ CRT on Windows: Optional.
+ @param psrc Source bit matrix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+ Use dk4bm_close() to close the bit matrix when done with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if a NULL pointer is passed as psrc or the row or column number
+ in psrc is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occurs in size calculation (number of rows and/or
+ columns too large),
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if not enough memory available.
+*/
+
+dk4_bit_matrix_t *
+dk4bm_open_copy(
+ dk4_bit_matrix_t const *psrc,
+ dk4_er_t *erp
+);
+
+
+/** Set one bit in matrix.
+
+ CRT on Windows: Optional.
+ @param pmb Bit matrix to modify.
+ @param row Row position to modify.
+ @param column Column position to modify.
+ @param value Value (non-zero to set bit, 0 to reset bit).
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pmb is NULL or the row/column specification is out of range.
+*/
+
+int
+dk4bm_set(
+ dk4_bit_matrix_t *pmb,
+ size_t row,
+ size_t column,
+ int value,
+ dk4_er_t *erp
+);
+
+
+/** Get bit value from matrix.
+
+ CRT on Windows: Optional.
+ @param pdest Address of destination variable, set to 1 or 0.
+ @param pmb Bit matrix to retrieve bit from.
+ @param row Row position of bit to find.
+ @param column Column position of bit to find.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdest or pmb is NULL or the row/column specification is out of range.
+*/
+
+int
+dk4bm_get(
+ int *pdest,
+ dk4_bit_matrix_t const *pmb,
+ size_t row,
+ size_t column,
+ dk4_er_t *erp
+);
+
+
+/** Expand bit matrix.
+
+ CRT on Windows: Optional.
+ @param pmb Bit matrix to expand.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pmb is NULL or not a square matrix.
+*/
+
+int
+dk4bm_expand(
+ dk4_bit_matrix_t *pmb,
+ dk4_er_t *erp
+);
+
+
+/** Close bit matrix, release resources.
+
+ CRT on Windows: Optional.
+ @param pbm Bit matrix to close.
+ @param san Flag: Sanitize memory.
+*/
+
+void
+dk4bm_close(
+ dk4_bit_matrix_t *pbm,
+ int san
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "dk4mem.h"
+#include "dk4memrs.h"
+#include "dk4bm.h"
+
+$!trace-include
+
+
+/** One byte.
+*/
+typedef unsigned char dk4bm_uc_t;
+
+
+/** Pointer to unsigned chars.
+*/
+typedef unsigned char *dk4bm_puc_t;
+
+
+/** Bits within a byte.
+*/
+static unsigned char bib[] = {
+ 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
+};
+
+
+/** Constant value 0 for comparisons.
+*/
+#define SZ0 ((size_t)0U)
+
+
+/** Constant value 8 for comparisons.
+*/
+#define SZ8 ((size_t)8U)
+
+
+dk4_bit_matrix_t *
+dk4bm_open(
+ size_t rows,
+ size_t columns,
+ dk4_er_t *erp
+)
+{
+ dk4_bit_matrix_t *back = NULL; /* Function result */
+ dk4bm_puc_t *ppuc; /* Pointer: traverse back->data */
+ size_t bpr; /* Bytes per row */
+ size_t i; /* Index: traverse back->data */
+ int ok; /* Flag: All allocations ok */
+ $? "+ dk4bm_open r=%lu c=%lu", (unsigned long)rows, (unsigned long)columns
+ if ((SZ0 < rows) && (SZ0 < columns)) {
+ bpr = columns / SZ8;
+ if (SZ0 != (columns % SZ8)) bpr++;
+ $? ". bpr=%lu", (unsigned long)bpr
+ back = dk4mem_new(dk4_bit_matrix_t,1,erp);
+ if (NULL != back) {
+ back->rows = rows;
+ back->columns = columns;
+ back->bytes_per_row = bpr;
+ back->data = dk4mem_new(dk4bm_puc_t,rows,erp);
+ if (NULL != back->data) {
+ /*
+ Initialize all row pointers to NULL
+ */
+ ppuc = back->data;
+ for (i = 0; i < rows; i++) {
+ *(ppuc++) = NULL;
+ }
+ /*
+ Allocate the rows
+ */
+ ppuc = back->data;
+ ok = 1;
+ for (i = 0; i < rows; i++) {
+ *ppuc = dk4mem_new(dk4bm_uc_t,bpr,erp);
+ if (NULL != *ppuc) {
+ DK4_MEMRES(*ppuc,bpr);
+ }
+ else { $? "! allocation (row)"
+ ok = 0;
+ }
+ ppuc++;
+ }
+ /*
+ Check allocations, delete object on error
+ */
+ if (0 == ok) {
+ dk4bm_close(back, 0);
+ back = NULL;
+ }
+ }
+ else { $? "! allocation (pointers array)"
+ dk4bm_close(back, 0);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! allocation (matrix structure)"
+ }
+#endif
+ }
+ else { $? "! arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4bm_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+#define USE_MEMCPY_FOR_ROWS 1
+
+dk4_bit_matrix_t *
+dk4bm_open_copy(
+ dk4_bit_matrix_t const *psrc,
+ dk4_er_t *erp
+)
+{
+ dk4_bit_matrix_t *back = NULL;
+#if USE_MEMCPY_FOR_ROWS
+ dk4bm_puc_t const *ps; /* Source data */
+ dk4bm_puc_t *pd; /* Destination data */
+#endif
+ size_t i; /* Current row number to copy */
+#if (!(USE_MEMCPY_FOR_ROWS))
+ size_t j;
+ int v;
+#endif
+ $? "+ dk4bm_open_copy"
+ if (NULL != psrc) {
+ back = dk4bm_open(psrc->rows, psrc->columns, erp);
+ if (NULL != back) {
+#if USE_MEMCPY_FOR_ROWS
+ ps = psrc->data;
+ pd = back->data;
+ for (i = SZ0; i < psrc->rows; i++) {
+ DK4_MEMCPY(*pd,*ps,psrc->bytes_per_row);
+ ps++; pd++;
+ }
+#endif
+#if (!(USE_MEMCPY_FOR_ROWS))
+ for (i = SZ0; i < back->rows; i++) {
+ for (j = SZ0; j < back->columns; j++) {
+ v = 0;
+ if (0 != dk4bm_get(&v, psrc, i, j, NULL)) {
+ if (0 != v) {
+ dk4bm_set(back, i, j, 1, NULL);
+ }
+ }
+ }
+ }
+#endif
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4bm_open_copy %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+dk4bm_set(
+ dk4_bit_matrix_t *pmb,
+ size_t row,
+ size_t column,
+ int value,
+ dk4_er_t *erp
+)
+{
+ size_t byteno; /* Byte number within row */
+ size_t bitno; /* Bit number within byte */
+ int back = 0; /* Function result */
+ $? "+ dk4bm_set r=%lu c=%lu", (unsigned long)row, (unsigned long)column
+ $? ". v=%d", value
+ if ((NULL != pmb) && (NULL != pmb->data)) {
+ if ((row < pmb->rows) && (column < pmb->columns)) {
+ byteno = column / SZ8;
+ bitno = column % SZ8;
+ if (0 != value) {
+ ((pmb->data)[row])[byteno] |= bib[bitno];
+ }
+ else {
+ ((pmb->data)[row])[byteno] &= (~(bib[bitno]));
+ }
+ back = 1;
+ }
+ else { $? "! arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else { $? "! arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4bm_set %d", back
+ return back;
+}
+
+
+
+int
+dk4bm_get(
+ int *pdest,
+ dk4_bit_matrix_t const *pmb,
+ size_t row,
+ size_t column,
+ dk4_er_t *erp
+)
+{
+ size_t byteno; /* Byte number within row */
+ size_t bitno; /* Bit number within byte */
+ int back = 0; /* Function result */
+ $? "+ dk4bm_get r=%lu c=%lu", (unsigned long)row, (unsigned long)column
+ if ((NULL != pdest) && (NULL != pmb) && (NULL != pmb->data)) {
+ if ((row < pmb->rows) && (column < pmb->columns)) {
+ byteno = column / SZ8;
+ bitno = column % SZ8;
+ if (0x00 != ((((pmb->data)[row])[byteno]) & bib[bitno])) {
+ *pdest = 1;
+ }
+ else {
+ *pdest = 0;
+ }
+ back = 1;
+ }
+ else { $? "! arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else { $? "! arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4bm_get %d", back
+ return back;
+}
+
+
+
+/* 2019-10-06
+ ----------
+ Cache-friendly programming.
+ ----------
+ To see whether there is an indirect path from node i to node j -- if
+ not yet present -- we check a list of all nodes k whether there is a
+ known path from i to k and a known path from k to j.
+ A cache-friendly algorithm is used here.
+ Instead of ijk-algorithm (also called "naive algorithm") the
+ order of loops is changed here to ikj.
+ Variable i is used as row index for both i->j and i->k, an array pointer
+ is calculated from the row index i.
+ Variable k is used as row index k->j but also as column index i->k.
+ Variable j is only used as column index in both i->j and k->j, the
+ column index results in an index within an array.
+ So i is the variable for the outermost loop, k is the variable for the
+ middle loop and j is the variable for the inner loop.
+*/
+
+int
+dk4bm_expand(
+ dk4_bit_matrix_t *pmb,
+ dk4_er_t *erp
+)
+{
+ dk4bm_uc_t *ptri; /* Pointer: Row i bytes */
+ dk4bm_uc_t *ptrk; /* Pointer: Row k bytes */
+ size_t i; /* Destination row index */
+ size_t j; /* Destination column index */
+ size_t k; /* Intermediate point index */
+ size_t i_byte; /* Byte number of i within row */
+ size_t i_bit; /* Bit number of i within byte */
+ size_t j_byte; /* Byte number of j within row */
+ size_t j_bit; /* Bit number of j within byte */
+ size_t k_byte; /* Byte number of k within row */
+ size_t k_bit; /* Bit number of k within byte */
+#if TRACE_DEBUG
+ unsigned long passno = 0UL; /* Current pass number */
+#endif
+ int changed; /* Flag: Change occured in current pass */
+ int back = 0; /* Function result */
+ $? "+ dk4bm_expand"
+ if ((NULL != pmb) && (NULL != pmb->data) && (pmb->rows == pmb->columns)) {
+ if (0 < pmb->rows) {
+ back = 1;
+ changed = 1;
+ while(0 != changed) { $? ". begin pass %lu", passno++
+ changed = 0;
+ i_byte = 0;
+ i_bit = 0;
+ for (i = 0; i < pmb->rows; i++) {
+ $? ". i=%lu", (unsigned long)i
+ ptri = (pmb->data)[i];
+ k_byte = 0;
+ k_bit = 0;
+ for (k = 0; k < pmb->rows; k++) {
+ $? ". i=%lu k=%lu", (unsigned long)i, (unsigned long)k
+ ptrk = (pmb->data)[k];
+ if (0x00 != (ptri[k_byte] & bib[k_bit])) {
+ j_byte = 0;
+ j_bit = 0;
+ for (j = 0; j < pmb->rows; j++) {
+ $? ". i=%lu k=%lu j=%lu", (unsigned long)i, (unsigned long)k, (unsigned long)j
+ if (0x00 == (ptri[j_byte] & bib[j_bit])) {
+ $? ". %lu -> %lu not yet set", (unsigned long)i, (unsigned long)j
+ if (0x00 != (ptrk[j_byte] & bib[j_bit])) {
+ $? ". set %lu -> %lu", (unsigned long)i, (unsigned long)j
+ ptri[j_byte] |= bib[j_bit];
+ changed = 1;
+ }
+ }
+ j_bit++;
+ if (8 <= j_bit) {
+ j_bit = 0; j_byte++;
+ }
+ }
+ }
+ k_bit++;
+ if (8 <= k_bit) {
+ k_bit = 0; k_byte++;
+ }
+ }
+ i_bit++;
+ if (8 <= i_bit) {
+ i_bit = 0; i_byte++;
+ }
+ } $? ". end pass changed=%d", changed
+ }
+ }
+ else { $? "! arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else { $? "! arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4bm_expand %d", back
+ return back;
+}
+
+
+
+void
+dk4bm_close(
+ dk4_bit_matrix_t *pbm,
+ int san
+)
+{
+ dk4bm_puc_t *ppuc; /* Pointer: Traverse pbm->data */
+ size_t i; /* Index: Traverse pbm->data */
+ $? "+ dk4bm_close"
+ if (NULL != pbm) {
+ if (NULL != pbm->data) {
+ ppuc = pbm->data;
+ for (i = 0; i < pbm->rows; i++) {
+ if (NULL != *ppuc) {
+ if (0 != san) {
+ dk4mem_reset_secure(*ppuc,pbm->bytes_per_row,NULL);
+ }
+ dk4mem_free(*ppuc);
+ }
+ ppuc++;
+ }
+ dk4mem_free(pbm->data);
+ }
+ if (0 != san) {
+ dk4mem_reset_secure(pbm,sizeof(dk4_bit_matrix_t),NULL);
+ }
+ dk4mem_free(pbm);
+ } $? "- dk4bm_close"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4bm.h b/support/dktools/dk4bm.h
new file mode 100644
index 0000000000..cc9c07e8ae
--- /dev/null
+++ b/support/dktools/dk4bm.h
@@ -0,0 +1,213 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bm.ctr
+*/
+
+#ifndef DK4BM_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4BM_H_INCLUDED 1
+
+
+#line 9 "dk4bm.ctr"
+
+/** @file dk4bm.h Bit matrix.
+
+Among other things a bit matrix can be used to represent a directed
+graph. A 1-bit in row <i>i</i> column <i>j</i> indicates a directed
+edge from <i>i</i> to <i>j</i> (row number represents source node,
+column number represents destination node).
+
+Alternatively you may choose reverse representation:
+A 1-bit in row <i>i</i> column <i>j</i> indicates a directed edge from <i>j</i>
+to <i>i</i> (row number represents destination node number, column number
+represents source node number).<br>
+In a dependency graph it means: <i>i</i> depends on <i>j</i>.
+
+After expanding the matrix you can check whether or not there is a path
+from any node to any other, either direct or
+indirect (path consisting of a sequence of direct edges).
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+/** Bit matrix structure.
+*/
+typedef struct {
+ unsigned char **data; /**< Bits grouped in bytes. */
+ size_t rows; /**< Number of rows. */
+ size_t columns; /**< Number of columns. */
+ size_t bytes_per_row; /**< Bytes per row. */
+} dk4_bit_matrix_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Open bit matrix.
+
+ CRT on Windows: Optional.
+ @param rows Number of rows.
+ @param columns Number of columns.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+ Use dk4bm_close() to close the bit matrix when done with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if the number of rows or columns is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occurs in size calculation (number of rows and/or
+ columns too large),
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if not enough memory available.
+*/
+
+dk4_bit_matrix_t *
+dk4bm_open(
+ size_t rows,
+ size_t columns,
+ dk4_er_t *erp
+);
+
+
+/** Create a full copy of a bit matrix as new bit matrix.
+
+ CRT on Windows: Optional.
+ @param psrc Source bit matrix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+ Use dk4bm_close() to close the bit matrix when done with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if a NULL pointer is passed as psrc or the row or column number
+ in psrc is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occurs in size calculation (number of rows and/or
+ columns too large),
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if not enough memory available.
+*/
+
+dk4_bit_matrix_t *
+dk4bm_open_copy(
+ dk4_bit_matrix_t const *psrc,
+ dk4_er_t *erp
+);
+
+
+/** Set one bit in matrix.
+
+ CRT on Windows: Optional.
+ @param pmb Bit matrix to modify.
+ @param row Row position to modify.
+ @param column Column position to modify.
+ @param value Value (non-zero to set bit, 0 to reset bit).
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pmb is NULL or the row/column specification is out of range.
+*/
+
+int
+dk4bm_set(
+ dk4_bit_matrix_t *pmb,
+ size_t row,
+ size_t column,
+ int value,
+ dk4_er_t *erp
+);
+
+
+/** Get bit value from matrix.
+
+ CRT on Windows: Optional.
+ @param pdest Address of destination variable, set to 1 or 0.
+ @param pmb Bit matrix to retrieve bit from.
+ @param row Row position of bit to find.
+ @param column Column position of bit to find.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdest or pmb is NULL or the row/column specification is out of range.
+*/
+
+int
+dk4bm_get(
+ int *pdest,
+ dk4_bit_matrix_t const *pmb,
+ size_t row,
+ size_t column,
+ dk4_er_t *erp
+);
+
+
+/** Expand bit matrix.
+
+ CRT on Windows: Optional.
+ @param pmb Bit matrix to expand.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pmb is NULL or not a square matrix.
+*/
+
+int
+dk4bm_expand(
+ dk4_bit_matrix_t *pmb,
+ dk4_er_t *erp
+);
+
+
+/** Close bit matrix, release resources.
+
+ CRT on Windows: Optional.
+ @param pbm Bit matrix to close.
+ @param san Flag: Sanitize memory.
+*/
+
+void
+dk4bm_close(
+ dk4_bit_matrix_t *pbm,
+ int san
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4bml.c b/support/dktools/dk4bml.c
new file mode 100644
index 0000000000..31e8b6aae8
--- /dev/null
+++ b/support/dktools/dk4bml.c
@@ -0,0 +1,540 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bml.ctr
+*/
+
+/** @file dk4bml.c The dk4bml module.
+*/
+
+
+#line 118 "dk4bml.ctr"
+
+#include "dk4bml.h"
+#include "dk4bf.h"
+
+
+
+#line 123 "dk4bml.ctr"
+
+
+/** 0 as size_t.
+*/
+#define SZ0 ((size_t)0U)
+
+/** 1 as size_t.
+*/
+#define SZ1 ((size_t)1U)
+
+
+
+/** Mark all nodes without predecessors as evaluated.
+ @param pbm Bit matrix containing reverse graph representation, must be
+ already expanded.
+ @param pbf Bits to mark nodes as evaluated.
+*/
+
+static
+void
+dk4bm_i_reverse_start(
+ dk4_bit_matrix_t const *pbm,
+ dk4_bit_field_t *pbf
+)
+{
+ size_t i; /* Current node to inspect */
+ size_t j; /* Predecessor candidate */
+ int hp; /* Flag: Have predecessor */
+ int v; /* Bit value */
+
+
+#line 153 "dk4bml.ctr"
+ for (i = SZ0; i < pbm->rows; i++) {
+ hp = 0;
+ for (j = SZ0; j < pbm->rows; j++) {
+ if (i != j) {
+ v = 0;
+ if (0 != dk4bm_get(&v, pbm, i, j, NULL)) {
+ if (0 != v) {
+ hp = 1;
+ }
+ }
+ else {
+ i = j = pbm->rows - SZ1;
+ }
+ }
+ }
+ if (0 == hp) {
+ dk4bf_set(pbf, i, 1, NULL);
+ }
+ }
+
+#line 172 "dk4bml.ctr"
+}
+
+
+
+/** Levelize graph nodes from bit matrix containig reversed representation.
+
+ @param pdest Destination array for the node levels.
+ @param pbm Bit matrix representing the graph, must already be expanded.
+ @param pbf Bit field, which nodes are already evaluated.
+*/
+
+static
+void
+dk4bm_i_reverse_levelize(
+ size_t *pdest,
+ dk4_bit_matrix_t const *pbm,
+ dk4_bit_field_t *pbf
+)
+{
+ size_t i; /* Current node to inspect */
+ size_t j; /* Predecessor candidate */
+ size_t max; /* Maximum evaluation value found so far */
+#if TRACE_DEBUG
+ size_t passno; /* Current pass number */
+#endif
+ int ch; /* Flag: Change occured in current pass */
+ int unev; /* Flag: Node has unevaluated predecessor */
+ int v; /* Test value */
+
+
+#line 201 "dk4bml.ctr"
+ /*
+ Mark all nodes without predecessor as evaluated.
+ */
+ dk4bm_i_reverse_start(pbm, pbf);
+#if TRACE_DEBUG
+ passno = SZ0;
+#endif
+ do {
+
+#line 209 "dk4bml.ctr"
+ ch = 0;
+ for (i = SZ0; i < pbm->rows; i++) {
+ v = 0;
+
+#line 212 "dk4bml.ctr"
+ if (0 != dk4bf_get(&v, pbf, i, NULL)) {
+ if (0 == v) {
+
+#line 214 "dk4bml.ctr"
+ /*
+ Current node i is not yet evaluated
+ */
+ max = SZ0;
+ unev = 0;
+ for (j = SZ0; j < pbm->rows; j++) {
+ if (i != j) {
+ v = 0;
+ if (0 != dk4bm_get(&v, pbm, i, j, NULL)) {
+ if (0 != v) {
+ v = 0;
+ if (0 != dk4bf_get(&v, pbf, j, NULL)) {
+ if (0 != v) {
+ /*
+ Node j is already evaluated
+ */
+ if (pdest[j] > max) {
+ max = pdest[j];
+ }
+ }
+ else {
+ /*
+ Node j is not yet evaluated
+ */
+ v = 0;
+ if(0 != dk4bm_get(&v,pbm,j,i,NULL)){
+ /*
+ We can not evaluate node i
+ unless i and j are in a
+ loop.
+ */
+ if (0 == v) {
+ unev = 1;
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ /*
+ Evaluate node if no unevaluated predecessors
+ */
+ if (0 == unev) {
+ pdest[i] = max + SZ1;
+ dk4bf_set(pbf, i, 1, NULL);
+ ch = 1;
+
+
+#line 275 "dk4bml.ctr"
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 279 "dk4bml.ctr"
+ }
+#endif
+ }
+ else {
+ /* ERROR */
+ i = pbm->rows - SZ1; ch = 0;
+ }
+ }
+#if TRACE_DEBUG
+ passno++;
+#endif
+ } while(1 == ch);
+
+
+#line 292 "dk4bml.ctr"
+}
+
+
+
+/** Mark all nodes without predecessors as evaluated.
+ @param pbm Bit matrix containing forward graph representation, must
+ be expanded.
+ @param pbf Bits to mark nodes as evaluated.
+*/
+
+static
+void
+dk4bm_i_forward_start(
+ dk4_bit_matrix_t const *pbm,
+ dk4_bit_field_t *pbf
+)
+{
+ size_t i; /* Current node to inspect */
+ size_t j; /* Predecessor candidate */
+ int hp; /* Flag: Have predecessor */
+ int v; /* Bit value */
+
+
+#line 314 "dk4bml.ctr"
+ for (i = SZ0; i < pbm->rows; i++) {
+ hp = 0;
+ for (j = SZ0; j < pbm->rows; j++) {
+ if (i != j) {
+ v = 0;
+ if (0 != dk4bm_get(&v, pbm, j, i, NULL)) {
+ if (0 != v) {
+ hp = 1;
+ }
+ }
+ else {
+ i = j = pbm->rows - SZ1;
+ }
+ }
+ }
+ if (0 == hp) {
+ dk4bf_set(pbf, i, 1, NULL);
+ }
+ }
+
+#line 333 "dk4bml.ctr"
+}
+
+
+
+/** Levelize graph nodes from bit matrix containig forward representation.
+
+ @param pdest Destination array for the node levels.
+ @param szdest Size of destination array.
+ @param pbm Bit matrix representing the graph, must already be expanded.
+ @param pbf Bit field, which nodes are already evaluated.
+*/
+
+static
+void
+dk4bm_i_forward_levelize(
+ size_t *pdest,
+ dk4_bit_matrix_t const *pbm,
+ dk4_bit_field_t *pbf
+)
+{
+ size_t i; /* Current node to inspect */
+ size_t j; /* Predecessor candidate */
+ size_t max; /* Maximum evaluation value found so far */
+#if TRACE_DEBUG
+ size_t passno; /* Current pass number */
+#endif
+ int ch; /* Flag: Change occured in current pass */
+ int unev; /* Flag: Node has unevaluated predecessor */
+ int v; /* Value */
+
+
+#line 363 "dk4bml.ctr"
+ /*
+ Mark all nodes without predecessor as evaluated.
+ */
+ dk4bm_i_forward_start(pbm, pbf);
+#if TRACE_DEBUG
+ passno = SZ0;
+#endif
+ do {
+
+#line 371 "dk4bml.ctr"
+ ch = 0;
+ for (i = SZ0; i < pbm->rows; i++) {
+ v = 0;
+
+#line 374 "dk4bml.ctr"
+ if (0 != dk4bf_get(&v, pbf, i, NULL)) {
+ if (0 == v) {
+
+#line 376 "dk4bml.ctr"
+ /*
+ Current node i is not yet evaluated
+ */
+ max = SZ0;
+ unev = 0;
+ for (j = SZ0; j < pbm->rows; j++) {
+ if (i != j) {
+ v = 0;
+ if (0 != dk4bm_get(&v, pbm, j, i, NULL)) {
+ if (0 != v) {
+ v = 0;
+ if (0 != dk4bf_get(&v, pbf, j, NULL)) {
+ if (0 != v) {
+ /*
+ Node j is already evaluated
+ */
+ if (pdest[j] > max) {
+ max = pdest[j];
+ }
+ }
+ else {
+ /*
+ Node j is not yet evaluated
+ */
+ v = 0;
+ if(0 != dk4bm_get(&v,pbm,i,j,NULL)){
+ /*
+ We can not evaluate node i
+ unless i and j are in a
+ loop.
+ */
+ if (0 == v) {
+ unev = 1;
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ /*
+ Evaluate node if no unevaluated predecessors
+ */
+ if (0 == unev) {
+ pdest[i] = max + SZ1;
+ dk4bf_set(pbf, i, 1, NULL);
+ ch = 1;
+
+
+#line 437 "dk4bml.ctr"
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 441 "dk4bml.ctr"
+ }
+#endif
+ }
+ else {
+ /* ERROR */
+ i = pbm->rows - SZ1; ch = 0;
+ }
+ }
+#if TRACE_DEBUG
+ passno++;
+#endif
+ } while(1 == ch);
+
+
+#line 454 "dk4bml.ctr"
+}
+
+
+
+static
+int
+dk4bm_i_levelize(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+)
+{
+ dk4_bit_matrix_t *bm = NULL;
+ dk4_bit_field_t *bf = NULL;
+ size_t *pres;
+ size_t i;
+ int back = 0;
+
+
+#line 474 "dk4bml.ctr"
+ bm = dk4bm_open_copy(pbm, erp);
+ if (NULL != bm) {
+ bf = dk4bf_open(bm->columns, erp);
+ if (NULL != bf) {
+ dk4bm_expand(bm, erp);
+ pres = pdest;
+ for (i = 0; i < szdest; i++) { *(pres++) = 0; }
+ if (0 != isrev) {
+ dk4bm_i_reverse_levelize(pdest, bm, bf);
+ }
+ else {
+ dk4bm_i_forward_levelize(pdest, bm, bf);
+ }
+ back = 1;
+ dk4bf_close(bf);
+ }
+ dk4bm_close(bm, 1);
+ }
+
+#line 492 "dk4bml.ctr"
+ return back;
+}
+
+
+
+static
+int
+dk4bm_i_expanded_levelize(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+)
+{
+ dk4_bit_field_t *bf = NULL;
+ size_t *pres;
+ size_t i;
+ int back = 0;
+
+
+#line 512 "dk4bml.ctr"
+ bf = dk4bf_open(pbm->columns, erp);
+ if (NULL != bf) {
+ pres = pdest;
+ for (i = 0; i < szdest; i++) { *(pres++) = 0; }
+ if (0 != isrev) {
+ dk4bm_i_reverse_levelize(pdest, pbm, bf);
+ }
+ else {
+ dk4bm_i_forward_levelize(pdest, pbm, bf);
+ }
+ back = 1;
+ dk4bf_close(bf);
+ }
+
+
+#line 526 "dk4bml.ctr"
+ return back;
+}
+
+
+
+int
+dk4bm_levelize(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 542 "dk4bml.ctr"
+ if ((NULL != pdest) && (0 < szdest) && (NULL != pbm)) {
+ if ((pbm->rows <= szdest) && (pbm->rows == pbm->columns)) {
+ back = dk4bm_i_levelize(pdest, szdest, pbm, isrev, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 553 "dk4bml.ctr"
+ return back;
+}
+
+
+
+int
+dk4bm_levelize_expanded(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 569 "dk4bml.ctr"
+ if ((NULL != pdest) && (0 < szdest) && (NULL != pbm)) {
+ if ((pbm->rows <= szdest) && (pbm->rows == pbm->columns)) {
+ back = dk4bm_i_expanded_levelize(pdest, szdest, pbm, isrev, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 580 "dk4bml.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4bml.ctr b/support/dktools/dk4bml.ctr
new file mode 100644
index 0000000000..86acc9edb7
--- /dev/null
+++ b/support/dktools/dk4bml.ctr
@@ -0,0 +1,585 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4bml.h Levelize graph using a bit matrix.
+
+ Levelizing means counting the path length from start nodes (nodes
+ with no predecessor) to a certain node.
+
+ Levelizing here must be able to handle loops.
+
+ Two nodes are in the same loop if there is both a path from one node
+ to the other and a path vice versa.
+
+ Node a is a one-way predecessor of node b if a is a predecessor of b
+ and there is a path from a to b but not path from b to a.
+ This means a and b are not in the same loop.
+
+ Nodes without a predecessor are level 0 nodes.
+
+ In each pass all nodes not yet evaluated are checked.
+ A node is evaluated if at least all one-way predecessor nodes are evaluated.
+ The nodes value/level is the maximum value of all (not just the one-way)
+ predecessors already evaluated, increased by one.
+
+*/
+
+
+#ifndef DK4BM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bm.h"
+#else
+#include <dktools-4/dk4bm.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Levelize graph nodes.
+
+ CRT on Windows: Optional.
+
+ @param pdest Destination array for the node levels.
+ @param szdest Size of destination array.
+ @param pbm Bit matrix representing the graph.
+ @param isrev Flag: Reverse notation is used in pbm.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdest or pbm is NULL or szdest is 0,
+ - DK4_E_SYNTAX<br>
+ if the matrix is not square or szdest is smaller then the number of rows,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow happens in size calculations for
+ temporary data,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation attempt for temporary data fails.
+*/
+
+int
+dk4bm_levelize(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+);
+
+
+/** Levelize graph nodes.
+
+ CRT on Windows: Optional.
+
+ @param pdest Destination array for the node levels.
+ @param szdest Size of destination array.
+ @param pbm Bit matrix representing the graph, must already be expanded.
+ @param isrev Flag: Reverse notation is used in pbm.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdest or pbm is NULL or szdest is 0,
+ - DK4_E_SYNTAX<br>
+ if the matrix is not square or szdest is smaller then the number of rows,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow happens in size calculations for
+ temporary data,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation attempt for temporary data fails.
+*/
+
+int
+dk4bm_levelize_expanded(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "dk4bml.h"
+#include "dk4bf.h"
+
+$!trace-include
+
+
+/** 0 as size_t.
+*/
+#define SZ0 ((size_t)0U)
+
+/** 1 as size_t.
+*/
+#define SZ1 ((size_t)1U)
+
+
+
+/** Mark all nodes without predecessors as evaluated.
+ @param pbm Bit matrix containing reverse graph representation, must be
+ already expanded.
+ @param pbf Bits to mark nodes as evaluated.
+*/
+
+static
+void
+dk4bm_i_reverse_start(
+ dk4_bit_matrix_t const *pbm,
+ dk4_bit_field_t *pbf
+)
+{
+ size_t i; /* Current node to inspect */
+ size_t j; /* Predecessor candidate */
+ int hp; /* Flag: Have predecessor */
+ int v; /* Bit value */
+ $? "+ dk4bm_i_reverse_start"
+ for (i = SZ0; i < pbm->rows; i++) {
+ hp = 0;
+ for (j = SZ0; j < pbm->rows; j++) {
+ if (i != j) {
+ v = 0;
+ if (0 != dk4bm_get(&v, pbm, i, j, NULL)) {
+ if (0 != v) {
+ hp = 1;
+ }
+ }
+ else {
+ i = j = pbm->rows - SZ1;
+ }
+ }
+ }
+ if (0 == hp) {
+ dk4bf_set(pbf, i, 1, NULL);
+ }
+ } $? "- dk4bm_i_reverse_start"
+}
+
+
+
+/** Levelize graph nodes from bit matrix containig reversed representation.
+
+ @param pdest Destination array for the node levels.
+ @param pbm Bit matrix representing the graph, must already be expanded.
+ @param pbf Bit field, which nodes are already evaluated.
+*/
+
+static
+void
+dk4bm_i_reverse_levelize(
+ size_t *pdest,
+ dk4_bit_matrix_t const *pbm,
+ dk4_bit_field_t *pbf
+)
+{
+ size_t i; /* Current node to inspect */
+ size_t j; /* Predecessor candidate */
+ size_t max; /* Maximum evaluation value found so far */
+#if TRACE_DEBUG
+ size_t passno; /* Current pass number */
+#endif
+ int ch; /* Flag: Change occured in current pass */
+ int unev; /* Flag: Node has unevaluated predecessor */
+ int v; /* Test value */
+ $? "+ dk4bm_i_reverse_levelize"
+ /*
+ Mark all nodes without predecessor as evaluated.
+ */
+ dk4bm_i_reverse_start(pbm, pbf);
+#if TRACE_DEBUG
+ passno = SZ0;
+#endif
+ do { $? ". pass %lu", (unsigned long)passno
+ ch = 0;
+ for (i = SZ0; i < pbm->rows; i++) {
+ v = 0; $? ". check node %lu", (unsigned long)i
+ if (0 != dk4bf_get(&v, pbf, i, NULL)) {
+ if (0 == v) { $? ". not yet evaluated"
+ /*
+ Current node i is not yet evaluated
+ */
+ max = SZ0;
+ unev = 0;
+ for (j = SZ0; j < pbm->rows; j++) {
+ if (i != j) {
+ v = 0;
+ if (0 != dk4bm_get(&v, pbm, i, j, NULL)) {
+ if (0 != v) {
+ v = 0;
+ if (0 != dk4bf_get(&v, pbf, j, NULL)) {
+ if (0 != v) {
+ /*
+ Node j is already evaluated
+ */
+ if (pdest[j] > max) {
+ max = pdest[j];
+ }
+ }
+ else {
+ /*
+ Node j is not yet evaluated
+ */
+ v = 0;
+ if(0 != dk4bm_get(&v,pbm,j,i,NULL)){
+ /*
+ We can not evaluate node i
+ unless i and j are in a
+ loop.
+ */
+ if (0 == v) {
+ unev = 1;
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ /*
+ Evaluate node if no unevaluated predecessors
+ */
+ if (0 == unev) {
+ pdest[i] = max + SZ1;
+ dk4bf_set(pbf, i, 1, NULL);
+ ch = 1;
+ $? ". pass=%lu node=%lu level=%lu", (unsigned long)passno, (unsigned long)i, (unsigned long)(max + SZ1)
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". already evaluated %lu", (unsigned long)(pdest[i])
+ }
+#endif
+ }
+ else {
+ /* ERROR */
+ i = pbm->rows - SZ1; ch = 0;
+ }
+ }
+#if TRACE_DEBUG
+ passno++;
+#endif
+ } while(1 == ch);
+ $? "- dk4bm_i_reverse_levelize"
+}
+
+
+
+/** Mark all nodes without predecessors as evaluated.
+ @param pbm Bit matrix containing forward graph representation, must
+ be expanded.
+ @param pbf Bits to mark nodes as evaluated.
+*/
+
+static
+void
+dk4bm_i_forward_start(
+ dk4_bit_matrix_t const *pbm,
+ dk4_bit_field_t *pbf
+)
+{
+ size_t i; /* Current node to inspect */
+ size_t j; /* Predecessor candidate */
+ int hp; /* Flag: Have predecessor */
+ int v; /* Bit value */
+ $? "+ dk4bm_i_forward_start"
+ for (i = SZ0; i < pbm->rows; i++) {
+ hp = 0;
+ for (j = SZ0; j < pbm->rows; j++) {
+ if (i != j) {
+ v = 0;
+ if (0 != dk4bm_get(&v, pbm, j, i, NULL)) {
+ if (0 != v) {
+ hp = 1;
+ }
+ }
+ else {
+ i = j = pbm->rows - SZ1;
+ }
+ }
+ }
+ if (0 == hp) {
+ dk4bf_set(pbf, i, 1, NULL);
+ }
+ } $? "- dk4bm_i_forward_start"
+}
+
+
+
+/** Levelize graph nodes from bit matrix containig forward representation.
+
+ @param pdest Destination array for the node levels.
+ @param szdest Size of destination array.
+ @param pbm Bit matrix representing the graph, must already be expanded.
+ @param pbf Bit field, which nodes are already evaluated.
+*/
+
+static
+void
+dk4bm_i_forward_levelize(
+ size_t *pdest,
+ dk4_bit_matrix_t const *pbm,
+ dk4_bit_field_t *pbf
+)
+{
+ size_t i; /* Current node to inspect */
+ size_t j; /* Predecessor candidate */
+ size_t max; /* Maximum evaluation value found so far */
+#if TRACE_DEBUG
+ size_t passno; /* Current pass number */
+#endif
+ int ch; /* Flag: Change occured in current pass */
+ int unev; /* Flag: Node has unevaluated predecessor */
+ int v; /* Value */
+ $? "+ dk4bm_i_forward_levelize"
+ /*
+ Mark all nodes without predecessor as evaluated.
+ */
+ dk4bm_i_forward_start(pbm, pbf);
+#if TRACE_DEBUG
+ passno = SZ0;
+#endif
+ do { $? ". pass %lu", (unsigned long)passno
+ ch = 0;
+ for (i = SZ0; i < pbm->rows; i++) {
+ v = 0; $? ". check node %lu", (unsigned long)i
+ if (0 != dk4bf_get(&v, pbf, i, NULL)) {
+ if (0 == v) { $? ". not yet evaluated"
+ /*
+ Current node i is not yet evaluated
+ */
+ max = SZ0;
+ unev = 0;
+ for (j = SZ0; j < pbm->rows; j++) {
+ if (i != j) {
+ v = 0;
+ if (0 != dk4bm_get(&v, pbm, j, i, NULL)) {
+ if (0 != v) {
+ v = 0;
+ if (0 != dk4bf_get(&v, pbf, j, NULL)) {
+ if (0 != v) {
+ /*
+ Node j is already evaluated
+ */
+ if (pdest[j] > max) {
+ max = pdest[j];
+ }
+ }
+ else {
+ /*
+ Node j is not yet evaluated
+ */
+ v = 0;
+ if(0 != dk4bm_get(&v,pbm,i,j,NULL)){
+ /*
+ We can not evaluate node i
+ unless i and j are in a
+ loop.
+ */
+ if (0 == v) {
+ unev = 1;
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR */
+ i = j = pbm->rows - SZ1; ch = 0;
+ }
+ }
+ }
+ /*
+ Evaluate node if no unevaluated predecessors
+ */
+ if (0 == unev) {
+ pdest[i] = max + SZ1;
+ dk4bf_set(pbf, i, 1, NULL);
+ ch = 1;
+ $? ". pass=%lu node=%lu level=%lu", (unsigned long)passno, (unsigned long)i, (unsigned long)(max + SZ1)
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". already evaluated %lu", (unsigned long)(pdest[i])
+ }
+#endif
+ }
+ else {
+ /* ERROR */
+ i = pbm->rows - SZ1; ch = 0;
+ }
+ }
+#if TRACE_DEBUG
+ passno++;
+#endif
+ } while(1 == ch);
+ $? "- dk4bm_i_forward_levelize"
+}
+
+
+
+static
+int
+dk4bm_i_levelize(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+)
+{
+ dk4_bit_matrix_t *bm = NULL;
+ dk4_bit_field_t *bf = NULL;
+ size_t *pres;
+ size_t i;
+ int back = 0;
+ $? "+ dk4bm_i_levelize"
+ bm = dk4bm_open_copy(pbm, erp);
+ if (NULL != bm) {
+ bf = dk4bf_open(bm->columns, erp);
+ if (NULL != bf) {
+ dk4bm_expand(bm, erp);
+ pres = pdest;
+ for (i = 0; i < szdest; i++) { *(pres++) = 0; }
+ if (0 != isrev) {
+ dk4bm_i_reverse_levelize(pdest, bm, bf);
+ }
+ else {
+ dk4bm_i_forward_levelize(pdest, bm, bf);
+ }
+ back = 1;
+ dk4bf_close(bf);
+ }
+ dk4bm_close(bm, 1);
+ } $? "- dk4bm_i_levelize %d", back
+ return back;
+}
+
+
+
+static
+int
+dk4bm_i_expanded_levelize(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+)
+{
+ dk4_bit_field_t *bf = NULL;
+ size_t *pres;
+ size_t i;
+ int back = 0;
+ $? "+ dk4bm_i_expanded_levelize"
+ bf = dk4bf_open(pbm->columns, erp);
+ if (NULL != bf) {
+ pres = pdest;
+ for (i = 0; i < szdest; i++) { *(pres++) = 0; }
+ if (0 != isrev) {
+ dk4bm_i_reverse_levelize(pdest, pbm, bf);
+ }
+ else {
+ dk4bm_i_forward_levelize(pdest, pbm, bf);
+ }
+ back = 1;
+ dk4bf_close(bf);
+ }
+ $? "- dk4bm_i_expanded_levelize %d", back
+ return back;
+}
+
+
+
+int
+dk4bm_levelize(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4bm_levelize"
+ if ((NULL != pdest) && (0 < szdest) && (NULL != pbm)) {
+ if ((pbm->rows <= szdest) && (pbm->rows == pbm->columns)) {
+ back = dk4bm_i_levelize(pdest, szdest, pbm, isrev, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4bm_levelize %d", back
+ return back;
+}
+
+
+
+int
+dk4bm_levelize_expanded(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4bm_levelize_expanded"
+ if ((NULL != pdest) && (0 < szdest) && (NULL != pbm)) {
+ if ((pbm->rows <= szdest) && (pbm->rows == pbm->columns)) {
+ back = dk4bm_i_expanded_levelize(pdest, szdest, pbm, isrev, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4bm_levelize_expanded %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4bml.h b/support/dktools/dk4bml.h
new file mode 100644
index 0000000000..4d5a46c074
--- /dev/null
+++ b/support/dktools/dk4bml.h
@@ -0,0 +1,129 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bml.ctr
+*/
+
+#ifndef DK4BML_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4BML_H_INCLUDED 1
+
+
+#line 9 "dk4bml.ctr"
+
+/** @file dk4bml.h Levelize graph using a bit matrix.
+
+ Levelizing means counting the path length from start nodes (nodes
+ with no predecessor) to a certain node.
+
+ Levelizing here must be able to handle loops.
+
+ Two nodes are in the same loop if there is both a path from one node
+ to the other and a path vice versa.
+
+ Node a is a one-way predecessor of node b if a is a predecessor of b
+ and there is a path from a to b but not path from b to a.
+ This means a and b are not in the same loop.
+
+ Nodes without a predecessor are level 0 nodes.
+
+ In each pass all nodes not yet evaluated are checked.
+ A node is evaluated if at least all one-way predecessor nodes are evaluated.
+ The nodes value/level is the maximum value of all (not just the one-way)
+ predecessors already evaluated, increased by one.
+
+*/
+
+
+#ifndef DK4BM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bm.h"
+#else
+#include <dktools-4/dk4bm.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Levelize graph nodes.
+
+ CRT on Windows: Optional.
+
+ @param pdest Destination array for the node levels.
+ @param szdest Size of destination array.
+ @param pbm Bit matrix representing the graph.
+ @param isrev Flag: Reverse notation is used in pbm.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdest or pbm is NULL or szdest is 0,
+ - DK4_E_SYNTAX<br>
+ if the matrix is not square or szdest is smaller then the number of rows,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow happens in size calculations for
+ temporary data,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation attempt for temporary data fails.
+*/
+
+int
+dk4bm_levelize(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+);
+
+
+/** Levelize graph nodes.
+
+ CRT on Windows: Optional.
+
+ @param pdest Destination array for the node levels.
+ @param szdest Size of destination array.
+ @param pbm Bit matrix representing the graph, must already be expanded.
+ @param isrev Flag: Reverse notation is used in pbm.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdest or pbm is NULL or szdest is 0,
+ - DK4_E_SYNTAX<br>
+ if the matrix is not square or szdest is smaller then the number of rows,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow happens in size calculations for
+ temporary data,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation attempt for temporary data fails.
+*/
+
+int
+dk4bm_levelize_expanded(
+ size_t *pdest,
+ size_t szdest,
+ dk4_bit_matrix_t const *pbm,
+ int isrev,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4bom.c b/support/dktools/dk4bom.c
index a2a8477645..94fc1c0076 100644
--- a/support/dktools/dk4bom.c
+++ b/support/dktools/dk4bom.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4bom.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bom.ctr
*/
/** @file dk4bom.c The dk4bom module.
*/
-#line 152 "dk4bom.ctr"
+#line 164 "dk4bom.ctr"
@@ -46,17 +24,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4enc.h"
#include "dk4bom.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 163 "dk4bom.ctr"
+#line 181 "dk4bom.ctr"
void
dk4bom_detect_init(dk4_bom_detector_t *ptr, int defenc)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
ptr->defenc = defenc;
ptr->found = defenc;
@@ -86,6 +73,9 @@ int
dk4bom_detect_add(dk4_bom_detector_t *ptr, unsigned char byte)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
switch (ptr->state) {
case 0: {
@@ -210,9 +200,15 @@ dk4bom_detect_add(dk4_bom_detector_t *ptr, unsigned char byte)
int
-dk4bom_detect_get_encoding(dk4_bom_detector_t *ptr)
+dk4bom_detect_get_encoding(dk4_bom_detector_t const *ptr)
{
- int back = DK4_ENCODING_ASCII;
+ int back = DK4_ENCODING_PLAIN;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
+#if DK4_ON_WINDOWS
+ back = DK4_ENCODING_WIN1252;
+#endif
if (NULL != ptr) {
back = ptr->found;
}
@@ -222,9 +218,12 @@ dk4bom_detect_get_encoding(dk4_bom_detector_t *ptr)
size_t
-dk4bom_detect_num_unused_bytes(dk4_bom_detector_t *ptr)
+dk4bom_detect_num_unused_bytes(dk4_bom_detector_t const *ptr)
{
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = ptr->rjb;
}
@@ -234,9 +233,12 @@ dk4bom_detect_num_unused_bytes(dk4_bom_detector_t *ptr)
unsigned char
-dk4bom_detect_unused_byte(dk4_bom_detector_t *ptr, size_t num)
+dk4bom_detect_unused_byte(dk4_bom_detector_t const *ptr, size_t num)
{
unsigned char back = 0x00;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (0 == num) {
back = ptr->c1;
@@ -260,9 +262,12 @@ dk4bom_detect_unused_byte(dk4_bom_detector_t *ptr, size_t num)
int
-dk4bom_detect_in_detection(dk4_bom_detector_t *ptr)
+dk4bom_detect_in_detection(dk4_bom_detector_t const *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (-1 != ptr->state) {
back = 1;
diff --git a/support/dktools/dk4bom.ctr b/support/dktools/dk4bom.ctr
index 04442f3141..b564b2a815 100644
--- a/support/dktools/dk4bom.ctr
+++ b/support/dktools/dk4bom.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -41,15 +41,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4EDSTM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4edstm.h"
+#else
+#include <dktools-4/dk4edstm.h>
+#endif
#endif
#if DK4_HAVE_SYS_TYPES_H
@@ -64,10 +76,10 @@ license = bsd
at the beginning of a data stream.
*/
typedef struct {
+ size_t rjb; /**< Number of unused bytes. */
int defenc; /**< Default encoding, used if no BOM detected. */
int found; /**< Encoding from the BOM found. */
int state; /**< Current state of BOM detection. */
- size_t rjb; /**< Number of unused bytes. */
unsigned char c1; /**< Rejected byte 1. */
unsigned char c2; /**< Rejected byte 2. */
unsigned char c3; /**< Rejected byte 3. */
@@ -111,20 +123,20 @@ dk4bom_detect_add(dk4_bom_detector_t *ptr, unsigned char byte);
/** Retrieve the encoding from the detector.
@param ptr Detector to use.
- @return A file encoding, one from: DK4_FILE_ENCODING_ASCII,
- DK4_FILE_ENCODING_ANSI, DK4_FILE_ENCODING_UTF8,
+ @return A file encoding, one from: DK4_FILE_ENCODING_PLAIN,
+ DK4_FILE_ENCODING_WIN1252, DK4_FILE_ENCODING_UTF8,
DK4_FILE_ENCODING_UTF16_LE, DK4_FILE_ENCODING_UTF16_BE,
DK4_FILE_ENCODING_32_LE, or DK4_FILE_ENCODING_32_BE.
*/
int
-dk4bom_detect_get_encoding(dk4_bom_detector_t *ptr);
+dk4bom_detect_get_encoding(dk4_bom_detector_t const *ptr);
/** Retrieve the number of cted bytes stored in the detector.
@param ptr Detector to use.
@return Number of unused bytes stored in the detector.
*/
size_t
-dk4bom_detect_num_unused_bytes(dk4_bom_detector_t *ptr);
+dk4bom_detect_num_unused_bytes(dk4_bom_detector_t const *ptr);
/** Retrieve one unused byte stored in the detector.
@param ptr Detector to use.
@@ -132,7 +144,7 @@ dk4bom_detect_num_unused_bytes(dk4_bom_detector_t *ptr);
@return The byte value.
*/
unsigned char
-dk4bom_detect_unused_byte(dk4_bom_detector_t *ptr, size_t num);
+dk4bom_detect_unused_byte(dk4_bom_detector_t const *ptr, size_t num);
/** Check if BOM detection is still in progress.
@param ptr Detector to check.
@@ -140,7 +152,7 @@ dk4bom_detect_unused_byte(dk4_bom_detector_t *ptr, size_t num);
stored in the detector, 0 otherwise.
*/
int
-dk4bom_detect_in_detection(dk4_bom_detector_t *ptr);
+dk4bom_detect_in_detection(dk4_bom_detector_t const *ptr);
#ifdef __cplusplus
}
@@ -157,6 +169,12 @@ dk4bom_detect_in_detection(dk4_bom_detector_t *ptr);
#include "dk4enc.h"
#include "dk4bom.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -166,6 +184,9 @@ $!trace-include
void
dk4bom_detect_init(dk4_bom_detector_t *ptr, int defenc)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
ptr->defenc = defenc;
ptr->found = defenc;
@@ -195,6 +216,9 @@ int
dk4bom_detect_add(dk4_bom_detector_t *ptr, unsigned char byte)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
switch (ptr->state) {
case 0: {
@@ -319,9 +343,15 @@ dk4bom_detect_add(dk4_bom_detector_t *ptr, unsigned char byte)
int
-dk4bom_detect_get_encoding(dk4_bom_detector_t *ptr)
+dk4bom_detect_get_encoding(dk4_bom_detector_t const *ptr)
{
- int back = DK4_ENCODING_ASCII;
+ int back = DK4_ENCODING_PLAIN;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
+#if DK4_ON_WINDOWS
+ back = DK4_ENCODING_WIN1252;
+#endif
if (NULL != ptr) {
back = ptr->found;
}
@@ -331,9 +361,12 @@ dk4bom_detect_get_encoding(dk4_bom_detector_t *ptr)
size_t
-dk4bom_detect_num_unused_bytes(dk4_bom_detector_t *ptr)
+dk4bom_detect_num_unused_bytes(dk4_bom_detector_t const *ptr)
{
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = ptr->rjb;
}
@@ -343,9 +376,12 @@ dk4bom_detect_num_unused_bytes(dk4_bom_detector_t *ptr)
unsigned char
-dk4bom_detect_unused_byte(dk4_bom_detector_t *ptr, size_t num)
+dk4bom_detect_unused_byte(dk4_bom_detector_t const *ptr, size_t num)
{
unsigned char back = 0x00;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (0 == num) {
back = ptr->c1;
@@ -369,9 +405,12 @@ dk4bom_detect_unused_byte(dk4_bom_detector_t *ptr, size_t num)
int
-dk4bom_detect_in_detection(dk4_bom_detector_t *ptr)
+dk4bom_detect_in_detection(dk4_bom_detector_t const *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (-1 != ptr->state) {
back = 1;
diff --git a/support/dktools/dk4bom.h b/support/dktools/dk4bom.h
index 60cc69debe..4eeaaaa124 100644
--- a/support/dktools/dk4bom.h
+++ b/support/dktools/dk4bom.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4bom.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4bom.ctr
*/
#ifndef DK4BOM_H_INCLUDED
@@ -73,15 +51,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4EDSTM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4edstm.h"
+#else
+#include <dktools-4/dk4edstm.h>
+#endif
#endif
#if DK4_HAVE_SYS_TYPES_H
@@ -96,10 +86,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
at the beginning of a data stream.
*/
typedef struct {
+ size_t rjb; /**< Number of unused bytes. */
int defenc; /**< Default encoding, used if no BOM detected. */
int found; /**< Encoding from the BOM found. */
int state; /**< Current state of BOM detection. */
- size_t rjb; /**< Number of unused bytes. */
unsigned char c1; /**< Rejected byte 1. */
unsigned char c2; /**< Rejected byte 2. */
unsigned char c3; /**< Rejected byte 3. */
@@ -143,20 +133,20 @@ dk4bom_detect_add(dk4_bom_detector_t *ptr, unsigned char byte);
/** Retrieve the encoding from the detector.
@param ptr Detector to use.
- @return A file encoding, one from: DK4_FILE_ENCODING_ASCII,
- DK4_FILE_ENCODING_ANSI, DK4_FILE_ENCODING_UTF8,
+ @return A file encoding, one from: DK4_FILE_ENCODING_PLAIN,
+ DK4_FILE_ENCODING_WIN1252, DK4_FILE_ENCODING_UTF8,
DK4_FILE_ENCODING_UTF16_LE, DK4_FILE_ENCODING_UTF16_BE,
DK4_FILE_ENCODING_32_LE, or DK4_FILE_ENCODING_32_BE.
*/
int
-dk4bom_detect_get_encoding(dk4_bom_detector_t *ptr);
+dk4bom_detect_get_encoding(dk4_bom_detector_t const *ptr);
/** Retrieve the number of cted bytes stored in the detector.
@param ptr Detector to use.
@return Number of unused bytes stored in the detector.
*/
size_t
-dk4bom_detect_num_unused_bytes(dk4_bom_detector_t *ptr);
+dk4bom_detect_num_unused_bytes(dk4_bom_detector_t const *ptr);
/** Retrieve one unused byte stored in the detector.
@param ptr Detector to use.
@@ -164,7 +154,7 @@ dk4bom_detect_num_unused_bytes(dk4_bom_detector_t *ptr);
@return The byte value.
*/
unsigned char
-dk4bom_detect_unused_byte(dk4_bom_detector_t *ptr, size_t num);
+dk4bom_detect_unused_byte(dk4_bom_detector_t const *ptr, size_t num);
/** Check if BOM detection is still in progress.
@param ptr Detector to check.
@@ -172,7 +162,7 @@ dk4bom_detect_unused_byte(dk4_bom_detector_t *ptr, size_t num);
stored in the detector, 0 otherwise.
*/
int
-dk4bom_detect_in_detection(dk4_bom_detector_t *ptr);
+dk4bom_detect_in_detection(dk4_bom_detector_t const *ptr);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4c32.c b/support/dktools/dk4c32.c
index a197ad5b80..c3ab7d22f9 100644
--- a/support/dktools/dk4c32.c
+++ b/support/dktools/dk4c32.c
@@ -1,44 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4c32.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4c32.ctr
*/
/** @file dk4c32.c The dk4c32 module.
*/
-#line 77 "dk4c32.ctr"
+#line 85 "dk4c32.ctr"
+#include "dk4conf.h"
+#include "dk4types.h"
#include "dk4c32.h"
#ifndef DK4EDSTM_H_INCLUDED
@@ -57,11 +37,23 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
void
dk4c32_decoder_init(dk4_c32_byte_decoder_t *ptr, int msb)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
- ptr->val = (dk4_c32_t)0UL;
+ ptr->val = dkC32(0);
ptr->msb = msb;
ptr->nb = 0;
}
@@ -73,6 +65,9 @@ int
dk4c32_decoder_add(dk4_c32_byte_decoder_t *ptr, unsigned char inbyte)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
switch (ptr->nb) {
case 3: {
@@ -119,9 +114,12 @@ dk4c32_decoder_add(dk4_c32_byte_decoder_t *ptr, unsigned char inbyte)
dk4_c32_t
-dk4c32_decoder_get(dk4_c32_byte_decoder_t *ptr)
+dk4c32_decoder_get(dk4_c32_byte_decoder_t const *ptr)
{
- dk4_c32_t back = (dk4_c32_t)0UL;
+ dk4_c32_t back = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = ptr->val;
}
@@ -131,9 +129,12 @@ dk4c32_decoder_get(dk4_c32_byte_decoder_t *ptr)
int
-dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t *ptr)
+dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t const *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (0 == ptr->nb) {
back = 1;
diff --git a/support/dktools/dk4c32.ctr b/support/dktools/dk4c32.ctr
index f3e2e35ede..162d4c20c3 100644
--- a/support/dktools/dk4c32.ctr
+++ b/support/dktools/dk4c32.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,11 +15,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
/** Decoder structure to build a 32 bit character from 4 4 4 4 bytes.
@@ -57,7 +65,7 @@ dk4c32_decoder_add(dk4_c32_byte_decoder_t *ptr, unsigned char inbyte);
@return Output produced by the decoder.
*/
dk4_c32_t
-dk4c32_decoder_get(dk4_c32_byte_decoder_t *ptr);
+dk4c32_decoder_get(dk4_c32_byte_decoder_t const *ptr);
/** Check whether the decoder is empty (nothing is stored in the
internal state).
@@ -65,7 +73,7 @@ dk4c32_decoder_get(dk4_c32_byte_decoder_t *ptr);
@return 1 on success (decoder empty), 0 otherwise.
*/
int
-dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t *ptr);
+dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t const *ptr);
#ifdef __cplusplus
}
@@ -75,6 +83,8 @@ dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t *ptr);
%% module
+#include "dk4conf.h"
+#include "dk4types.h"
#include "dk4c32.h"
#ifndef DK4EDSTM_H_INCLUDED
@@ -93,11 +103,23 @@ dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t *ptr);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
void
dk4c32_decoder_init(dk4_c32_byte_decoder_t *ptr, int msb)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
- ptr->val = (dk4_c32_t)0UL;
+ ptr->val = dkC32(0);
ptr->msb = msb;
ptr->nb = 0;
}
@@ -109,6 +131,9 @@ int
dk4c32_decoder_add(dk4_c32_byte_decoder_t *ptr, unsigned char inbyte)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
switch (ptr->nb) {
case 3: {
@@ -155,9 +180,12 @@ dk4c32_decoder_add(dk4_c32_byte_decoder_t *ptr, unsigned char inbyte)
dk4_c32_t
-dk4c32_decoder_get(dk4_c32_byte_decoder_t *ptr)
+dk4c32_decoder_get(dk4_c32_byte_decoder_t const *ptr)
{
- dk4_c32_t back = (dk4_c32_t)0UL;
+ dk4_c32_t back = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = ptr->val;
}
@@ -167,9 +195,12 @@ dk4c32_decoder_get(dk4_c32_byte_decoder_t *ptr)
int
-dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t *ptr)
+dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t const *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (0 == ptr->nb) {
back = 1;
diff --git a/support/dktools/dk4c32.h b/support/dktools/dk4c32.h
index 90b6223a84..354d9a8c1e 100644
--- a/support/dktools/dk4c32.h
+++ b/support/dktools/dk4c32.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4c32.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4c32.ctr
*/
#ifndef DK4C32_H_INCLUDED
@@ -47,11 +25,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
/** Decoder structure to build a 32 bit character from 4 4 4 4 bytes.
@@ -89,7 +75,7 @@ dk4c32_decoder_add(dk4_c32_byte_decoder_t *ptr, unsigned char inbyte);
@return Output produced by the decoder.
*/
dk4_c32_t
-dk4c32_decoder_get(dk4_c32_byte_decoder_t *ptr);
+dk4c32_decoder_get(dk4_c32_byte_decoder_t const *ptr);
/** Check whether the decoder is empty (nothing is stored in the
internal state).
@@ -97,7 +83,7 @@ dk4c32_decoder_get(dk4_c32_byte_decoder_t *ptr);
@return 1 on success (decoder empty), 0 otherwise.
*/
int
-dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t *ptr);
+dk4c32_decoder_is_empty(dk4_c32_byte_decoder_t const *ptr);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4c8dbl.c b/support/dktools/dk4c8dbl.c
index bb224d4c00..ca00f69e34 100644
--- a/support/dktools/dk4c8dbl.c
+++ b/support/dktools/dk4c8dbl.c
@@ -1,44 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4c8dbl.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4c8dbl.ctr
*/
/** @file dk4c8dbl.c The dk4c8dbl module.
*/
-#line 99 "dk4c8dbl.ctr"
+#line 147 "dk4c8dbl.ctr"
+#include "dk4conf.h"
+#include "dk4types.h"
#include "dk4c8dbl.h"
#if DK4_HAVE_STRING_H
@@ -53,11 +33,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8ddi.h"
#include "dk4str8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 117 "dk4c8dbl.ctr"
+#line 173 "dk4c8dbl.ctr"
@@ -86,6 +72,9 @@ dk4c8dbl_i_byte_to_void(
)
{
int back;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
switch (dtp) {
case 1: {
back = dk4stream_write_byte((dk4_stream_t*)dptr, c, erp);
@@ -112,36 +101,39 @@ dk4c8dbl_i_cut_trailing_zeroes(char *str)
char *cutpos = NULL;
-#line 170 "dk4c8dbl.ctr"
+#line 229 "dk4c8dbl.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+#endif
while ('\0' != *str) {
-#line 171 "dk4c8dbl.ctr"
+#line 233 "dk4c8dbl.ctr"
if ('0' == *str) {
-#line 172 "dk4c8dbl.ctr"
+#line 234 "dk4c8dbl.ctr"
if (NULL == cutpos) {
-#line 173 "dk4c8dbl.ctr"
+#line 235 "dk4c8dbl.ctr"
cutpos = str;
}
}
else {
-#line 177 "dk4c8dbl.ctr"
+#line 239 "dk4c8dbl.ctr"
cutpos = NULL;
-#line 178 "dk4c8dbl.ctr"
+#line 240 "dk4c8dbl.ctr"
}
str++;
}
if (NULL != cutpos) {
-#line 182 "dk4c8dbl.ctr"
+#line 244 "dk4c8dbl.ctr"
*cutpos = '\0';
}
-#line 185 "dk4c8dbl.ctr"
+#line 247 "dk4c8dbl.ctr"
}
@@ -161,7 +153,7 @@ dk4c8dbl_i_cut_trailing_zeroes(char *str)
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
static
int
@@ -183,15 +175,19 @@ dk4c8dbl_i_str_to_void(
int res; /* Conversion result */
-#line 225 "dk4c8dbl.ctr"
+#line 287 "dk4c8dbl.ctr"
/*
Check for scientific notation
*/
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != str);
+#endif
eptr = strchr(str, 'e');
if (NULL == eptr) { eptr = strchr(str, 'E'); }
if (NULL != eptr) {
-#line 231 "dk4c8dbl.ctr"
+#line 297 "dk4c8dbl.ctr"
/*
Scientific notation found, analyse string first
-----------------------------------------------
@@ -213,7 +209,7 @@ dk4c8dbl_i_str_to_void(
}
-#line 251 "dk4c8dbl.ctr"
+#line 317 "dk4c8dbl.ctr"
/*
Find position of decimal dot and convert string digit sequence
*/
@@ -301,7 +297,7 @@ dk4c8dbl_i_str_to_void(
}
else {
-#line 337 "dk4c8dbl.ctr"
+#line 403 "dk4c8dbl.ctr"
/*
No exponent, can ship out string as is
--------------------------------------
@@ -322,7 +318,7 @@ dk4c8dbl_i_str_to_void(
dk4c8dbl_i_cut_trailing_zeroes(ddptr);
-#line 356 "dk4c8dbl.ctr"
+#line 422 "dk4c8dbl.ctr"
}
/*
Write output
@@ -342,7 +338,7 @@ dk4c8dbl_i_str_to_void(
}
-#line 374 "dk4c8dbl.ctr"
+#line 440 "dk4c8dbl.ctr"
return back;
}
@@ -365,7 +361,7 @@ dk4c8dbl_i_str_to_void(
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
static
int
@@ -382,7 +378,9 @@ dk4c8dbl_i_double_to_void(
size_t szbuf = sizeof(buf);
int res = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
res = dk4ma_write_c8_double(buf, szbuf, v, exact, minim, erp);
if (0 != res) {
@@ -406,6 +404,9 @@ dk4c8dbl_double_to_stream(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
return (dk4c8dbl_i_double_to_void((void *)strm, 1, v, exact, minim, erp));
}
@@ -420,6 +421,9 @@ dk4c8dbl_double_to_file(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (dk4c8dbl_i_double_to_void((void *)fipo, 0, v, exact, minim, erp));
}
@@ -434,7 +438,10 @@ dk4c8dbl_str_double_to_file(
{
char buf[16*sizeof(double)];
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != str);
+#endif
if ((NULL != fipo) && (NULL != str)) {
if (strlen(str) < sizeof(buf)) {
strcpy(buf, str);
diff --git a/support/dktools/dk4c8dbl.ctr b/support/dktools/dk4c8dbl.ctr
index 6dc89b1e19..fd36f6c1a2 100644
--- a/support/dktools/dk4c8dbl.ctr
+++ b/support/dktools/dk4c8dbl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,11 +11,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
-#include <dk4conf.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
-#include <dk4types.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -24,11 +32,19 @@ license = bsd
#endif
#ifndef DK4ERROR_H_INCLUDED
-#include <dk4error.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
-#include <dk4strm.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
@@ -43,6 +59,16 @@ extern "C" {
@param minim Flag: Minimize an exact representation.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm is NULL,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the internal destination buffer is too small to store the string,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
*/
int
@@ -62,6 +88,16 @@ dk4c8dbl_double_to_stream(
@param minim Flag: Minimize an exact representation.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the internal destination buffer is too small to store the string,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
*/
int
@@ -79,6 +115,18 @@ dk4c8dbl_double_to_file(
@param str String containing the value.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fipo or str is NULL,
+ - DK4_E_SYNTAX<br>
+ if the string str is empty,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if an internal buffer is too small to store the string,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
*/
int
@@ -97,6 +145,8 @@ dk4c8dbl_str_double_to_file(
/* vim: set ai sw=4 ts=4 : */
%% module
+#include "dk4conf.h"
+#include "dk4types.h"
#include "dk4c8dbl.h"
#if DK4_HAVE_STRING_H
@@ -111,6 +161,12 @@ dk4c8dbl_str_double_to_file(
#include "dk4mai8ddi.h"
#include "dk4str8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -142,6 +198,9 @@ dk4c8dbl_i_byte_to_void(
)
{
int back;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
switch (dtp) {
case 1: {
back = dk4stream_write_byte((dk4_stream_t*)dptr, c, erp);
@@ -167,6 +226,9 @@ dk4c8dbl_i_cut_trailing_zeroes(char *str)
{
char *cutpos = NULL;
$? "+ dk4c8dbl_i_cut_trailing_zeroes \"%!8s\"", str
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+#endif
while ('\0' != *str) { $? ". c = \"%c\"", *str
if ('0' == *str) { $? ". 0"
if (NULL == cutpos) { $? ". new cut position"
@@ -201,7 +263,7 @@ dk4c8dbl_i_cut_trailing_zeroes(char *str)
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
static
int
@@ -225,6 +287,10 @@ dk4c8dbl_i_str_to_void(
/*
Check for scientific notation
*/
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != str);
+#endif
eptr = strchr(str, 'e');
if (NULL == eptr) { eptr = strchr(str, 'E'); }
if (NULL != eptr) { $? ". exponent found"
@@ -393,7 +459,7 @@ dk4c8dbl_i_str_to_void(
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
static
int
@@ -410,7 +476,9 @@ dk4c8dbl_i_double_to_void(
size_t szbuf = sizeof(buf);
int res = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
res = dk4ma_write_c8_double(buf, szbuf, v, exact, minim, erp);
if (0 != res) {
@@ -434,6 +502,9 @@ dk4c8dbl_double_to_stream(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
return (dk4c8dbl_i_double_to_void((void *)strm, 1, v, exact, minim, erp));
}
@@ -448,6 +519,9 @@ dk4c8dbl_double_to_file(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (dk4c8dbl_i_double_to_void((void *)fipo, 0, v, exact, minim, erp));
}
@@ -462,7 +536,10 @@ dk4c8dbl_str_double_to_file(
{
char buf[16*sizeof(double)];
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != str);
+#endif
if ((NULL != fipo) && (NULL != str)) {
if (strlen(str) < sizeof(buf)) {
strcpy(buf, str);
diff --git a/support/dktools/dk4c8dbl.h b/support/dktools/dk4c8dbl.h
index 7f86bc812d..85b6382f19 100644
--- a/support/dktools/dk4c8dbl.h
+++ b/support/dktools/dk4c8dbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4c8dbl.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4c8dbl.ctr
*/
#ifndef DK4C8DBL_H_INCLUDED
@@ -45,11 +23,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
-#include <dk4conf.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
-#include <dk4types.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -58,11 +44,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef DK4ERROR_H_INCLUDED
-#include <dk4error.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
-#include <dk4strm.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
@@ -77,6 +71,16 @@ extern "C" {
@param minim Flag: Minimize an exact representation.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm is NULL,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the internal destination buffer is too small to store the string,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
*/
int
@@ -96,6 +100,16 @@ dk4c8dbl_double_to_stream(
@param minim Flag: Minimize an exact representation.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the internal destination buffer is too small to store the string,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
*/
int
@@ -113,6 +127,18 @@ dk4c8dbl_double_to_file(
@param str String containing the value.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fipo or str is NULL,
+ - DK4_E_SYNTAX<br>
+ if the string str is empty,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if an internal buffer is too small to store the string,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
*/
int
diff --git a/support/dktools/dk4chdir8.c b/support/dktools/dk4chdir8.c
new file mode 100644
index 0000000000..22fc4a1b6d
--- /dev/null
+++ b/support/dktools/dk4chdir8.c
@@ -0,0 +1,134 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4chdir8.ctr
+*/
+
+/** @file dk4chdir8.c The dk4chdir8 module.
+*/
+
+
+#line 63 "dk4chdir8.ctr"
+
+
+#include "dk4conf.h"
+#include "dk4chdir8.h"
+
+
+#if DK4_ON_WINDOWS
+#ifndef WINDOWS_H_INCLUDED
+#include <windows.h>
+#define WINDOWS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_UNISTD_H
+#ifndef UNISTD_H_INCLUDED
+#include <unistd.h>
+#define UNISTD_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_DIRECT_H
+#ifndef DIRECT_H_INCLUDED
+#include <direct.h>
+#define DIRECT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 113 "dk4chdir8.ctr"
+
+
+
+
+int
+dk4chdir_c8(const char *nd, dk4_er_t *erp)
+{
+ int back = 0;
+#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
+ BOOL res;
+#endif
+
+
+#line 125 "dk4chdir8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != nd);
+#endif
+ if (NULL != nd) {
+#if DK4_ON_WINDOWS
+#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
+ res = SetCurrentDirectoryA(nd);
+ if (res) {
+ back = 1;
+ }
+ else {
+
+#line 136 "dk4chdir8.ctr"
+ dk4error_set_ldetails(erp, DK4_E_SYSTEM, GetLastError());
+ }
+#else
+ if (0 == _chdir(nd)) {
+ back = 1;
+ }
+ else {
+
+#line 143 "dk4chdir8.ctr"
+ dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
+ }
+#endif
+#else
+ if (0 == chdir(nd)) {
+ back = 1;
+ }
+ else {
+
+#line 151 "dk4chdir8.ctr"
+ dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
+ }
+#endif
+ }
+ else {
+
+#line 156 "dk4chdir8.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 159 "dk4chdir8.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4chdir8.ctr b/support/dktools/dk4chdir8.ctr
new file mode 100644
index 0000000000..1de545b382
--- /dev/null
+++ b/support/dktools/dk4chdir8.ctr
@@ -0,0 +1,164 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file dk4chdir8.h Change current working directory.
+*/
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Change current working directory.
+ @param nd Name of new directory.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ CRT on Windows: Optional.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if nd is NULL,
+ - DK4_E_NOT_SUPPORTEDy<br>
+ if the operation is not supported on the current system,
+ - DK4_E_SYSTEM<br>
+ with error code in lDetails1 or iDetails1 if the operation
+ is supported but did fail.
+*/
+int
+dk4chdir_c8(const char *nd, dk4_er_t *erp);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#include "dk4conf.h"
+#include "dk4chdir8.h"
+
+
+#if DK4_ON_WINDOWS
+#ifndef WINDOWS_H_INCLUDED
+#include <windows.h>
+#define WINDOWS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_UNISTD_H
+#ifndef UNISTD_H_INCLUDED
+#include <unistd.h>
+#define UNISTD_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_DIRECT_H
+#ifndef DIRECT_H_INCLUDED
+#include <direct.h>
+#define DIRECT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+
+int
+dk4chdir_c8(const char *nd, dk4_er_t *erp)
+{
+ int back = 0;
+#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
+ BOOL res;
+#endif
+ $? "+ dk4chdir8 \"%!8s\"", TR_8STR(nd)
+#if DK4_USE_ASSERT
+ assert(NULL != nd);
+#endif
+ if (NULL != nd) {
+#if DK4_ON_WINDOWS
+#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
+ res = SetCurrentDirectoryA(nd);
+ if (res) {
+ back = 1;
+ }
+ else { $? "! SetCurrentDirectoryA"
+ dk4error_set_ldetails(erp, DK4_E_SYSTEM, GetLastError());
+ }
+#else
+ if (0 == _chdir(nd)) {
+ back = 1;
+ }
+ else { $? "! _chdir"
+ dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
+ }
+#endif
+#else
+ if (0 == chdir(nd)) {
+ back = 1;
+ }
+ else { $? "! chdir"
+ dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
+ }
+#endif
+ }
+ else { $? "! nd"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4chdir8 %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4chdir8.h b/support/dktools/dk4chdir8.h
new file mode 100644
index 0000000000..54fcea25bf
--- /dev/null
+++ b/support/dktools/dk4chdir8.h
@@ -0,0 +1,73 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4chdir8.ctr
+*/
+
+#ifndef DK4CHDIR8_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4CHDIR8_H_INCLUDED 1
+
+
+#line 10 "dk4chdir8.ctr"
+
+/** @file dk4chdir8.h Change current working directory.
+*/
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Change current working directory.
+ @param nd Name of new directory.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ CRT on Windows: Optional.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if nd is NULL,
+ - DK4_E_NOT_SUPPORTEDy<br>
+ if the operation is not supported on the current system,
+ - DK4_E_SYSTEM<br>
+ with error code in lDetails1 or iDetails1 if the operation
+ is supported but did fail.
+*/
+int
+dk4chdir_c8(const char *nd, dk4_er_t *erp);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4chdird.c b/support/dktools/dk4chdird.c
new file mode 100644
index 0000000000..00b715e45a
--- /dev/null
+++ b/support/dktools/dk4chdird.c
@@ -0,0 +1,52 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4chdird.ctr
+*/
+
+/** @file dk4chdird.c The dk4chdird module.
+*/
+
+
+#line 63 "dk4chdird.ctr"
+
+#include "dk4conf.h"
+#include "dk4chdird.h"
+
+#if DK4_CHAR_SIZE > 1
+#include "dk4chdirw.h"
+#else
+#include "dk4chdir8.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+int
+dk4chdir(dkChar const *nd, dk4_er_t *erp)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != nd);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return ( dk4chdir_wc(nd, erp) );
+#else
+ return ( dk4chdir_c8(nd, erp) );
+#endif
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4chdird.ctr b/support/dktools/dk4chdird.ctr
new file mode 100644
index 0000000000..f681b9b3e5
--- /dev/null
+++ b/support/dktools/dk4chdird.ctr
@@ -0,0 +1,96 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4chdird.h Change current directory.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Change current working directory.
+ @param nd Name of new directory.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ CRT on Windows: Optional.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if nd is NULL,
+ - DK4_E_NOT_SUPPORTEDy<br>
+ if the operation is not supported on the current system,
+ - DK4_E_SYSTEM<br>
+ with error code in lDetails1 or iDetails1 if the operation
+ is supported but did fail.
+*/
+
+int
+dk4chdir(dkChar const *nd, dk4_er_t *erp);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#include "dk4conf.h"
+#include "dk4chdird.h"
+
+#if DK4_CHAR_SIZE > 1
+#include "dk4chdirw.h"
+#else
+#include "dk4chdir8.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+int
+dk4chdir(dkChar const *nd, dk4_er_t *erp)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != nd);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return ( dk4chdir_wc(nd, erp) );
+#else
+ return ( dk4chdir_c8(nd, erp) );
+#endif
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4chdird.h b/support/dktools/dk4chdird.h
new file mode 100644
index 0000000000..8b6930b49a
--- /dev/null
+++ b/support/dktools/dk4chdird.h
@@ -0,0 +1,74 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4chdird.ctr
+*/
+
+#ifndef DK4CHDIRD_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4CHDIRD_H_INCLUDED 1
+
+
+#line 9 "dk4chdird.ctr"
+
+/** @file dk4chdird.h Change current directory.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Change current working directory.
+ @param nd Name of new directory.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ CRT on Windows: Optional.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if nd is NULL,
+ - DK4_E_NOT_SUPPORTEDy<br>
+ if the operation is not supported on the current system,
+ - DK4_E_SYSTEM<br>
+ with error code in lDetails1 or iDetails1 if the operation
+ is supported but did fail.
+*/
+
+int
+dk4chdir(dkChar const *nd, dk4_er_t *erp);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4chdirw.c b/support/dktools/dk4chdirw.c
new file mode 100644
index 0000000000..9b578b5962
--- /dev/null
+++ b/support/dktools/dk4chdirw.c
@@ -0,0 +1,125 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4chdirw.ctr
+*/
+
+/** @file dk4chdirw.c The dk4chdirw module.
+*/
+
+
+#line 65 "dk4chdirw.ctr"
+
+
+#include "dk4conf.h"
+#include "dk4chdirw.h"
+
+
+#if DK4_ON_WINDOWS
+#ifndef WINDOWS_H_INCLUDED
+#include <windows.h>
+#define WINDOWS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_UNISTD_H
+#ifndef UNISTD_H_INCLUDED
+#include <unistd.h>
+#define UNISTD_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_DIRECT_H
+#ifndef DIRECT_H_INCLUDED
+#include <direct.h>
+#define DIRECT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 115 "dk4chdirw.ctr"
+
+
+
+int
+dk4chdir_wc(const wchar_t *nd, dk4_er_t *erp)
+{
+ int back = 0;
+
+
+#line 123 "dk4chdirw.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != nd);
+#endif
+ if (NULL != nd) {
+#if DK4_ON_WINDOWS
+#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
+ if (SetCurrentDirectoryW(nd)) {
+ back = 1;
+ }
+ else {
+
+#line 133 "dk4chdirw.ctr"
+ dk4error_set_ldetails(erp, DK4_E_SYSTEM, GetLastError());
+ }
+#else
+ if (0 == _wchdir(nd)) {
+ back = 1;
+ }
+ else {
+
+#line 140 "dk4chdirw.ctr"
+ dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
+ }
+#endif
+#else
+
+
+#line 145 "dk4chdirw.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+ }
+ else {
+
+#line 149 "dk4chdirw.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 152 "dk4chdirw.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4chdirw.ctr b/support/dktools/dk4chdirw.ctr
new file mode 100644
index 0000000000..5a533fc73f
--- /dev/null
+++ b/support/dktools/dk4chdirw.ctr
@@ -0,0 +1,157 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4chdirw.h Change current working directory.
+*/
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Change current working directory.
+ @param nd Name of new directory.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ CRT on Windows: Optional.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if nd is NULL,
+ - DK4_E_NOT_SUPPORTEDy<br>
+ if the operation is not supported on the current system,
+ - DK4_E_SYSTEM<br>
+ with error code in lDetails1 or iDetails1 if the operation
+ is supported but did fail.
+*/
+
+int
+dk4chdir_wc(const wchar_t *nd, dk4_er_t *erp);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#include "dk4conf.h"
+#include "dk4chdirw.h"
+
+
+#if DK4_ON_WINDOWS
+#ifndef WINDOWS_H_INCLUDED
+#include <windows.h>
+#define WINDOWS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_UNISTD_H
+#ifndef UNISTD_H_INCLUDED
+#include <unistd.h>
+#define UNISTD_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_DIRECT_H
+#ifndef DIRECT_H_INCLUDED
+#include <direct.h>
+#define DIRECT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+int
+dk4chdir_wc(const wchar_t *nd, dk4_er_t *erp)
+{
+ int back = 0;
+ $? "+ dk4chdir_wc \"%!ws\"", TR_LSTR(nd)
+#if DK4_USE_ASSERT
+ assert(NULL != nd);
+#endif
+ if (NULL != nd) {
+#if DK4_ON_WINDOWS
+#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
+ if (SetCurrentDirectoryW(nd)) {
+ back = 1;
+ }
+ else { $? "! SetCurrentDirectoryW"
+ dk4error_set_ldetails(erp, DK4_E_SYSTEM, GetLastError());
+ }
+#else
+ if (0 == _wchdir(nd)) {
+ back = 1;
+ }
+ else { $? "! _wchdir"
+ dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
+ }
+#endif
+#else
+ $? "! not supported"
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+ }
+ else { $? "! nd"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4chdir_wc %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4chdirw.h b/support/dktools/dk4chdirw.h
new file mode 100644
index 0000000000..2968c3248e
--- /dev/null
+++ b/support/dktools/dk4chdirw.h
@@ -0,0 +1,76 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4chdirw.ctr
+*/
+
+#ifndef DK4CHDIRW_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4CHDIRW_H_INCLUDED 1
+
+
+#line 9 "dk4chdirw.ctr"
+
+/** @file dk4chdirw.h Change current working directory.
+*/
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Change current working directory.
+ @param nd Name of new directory.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ CRT on Windows: Optional.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if nd is NULL,
+ - DK4_E_NOT_SUPPORTEDy<br>
+ if the operation is not supported on the current system,
+ - DK4_E_SYSTEM<br>
+ with error code in lDetails1 or iDetails1 if the operation
+ is supported but did fail.
+*/
+
+int
+dk4chdir_wc(const wchar_t *nd, dk4_er_t *erp);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4conf.cross b/support/dktools/dk4conf.cross
index 019f4d96c8..786ba120f3 100644
--- a/support/dktools/dk4conf.cross
+++ b/support/dktools/dk4conf.cross
@@ -6,7 +6,7 @@
#include "config.h"
#ifndef DK4_ON_WINDOWS
-#ifdef _WIN32
+#if _WIN32
#define DK4_ON_WINDOWS 1
#ifndef HAVE_BACKSLASH_AS_SEP
#define HAVE_BACKSLASH_AS_SEPŧ1
@@ -52,6 +52,18 @@
#endif
#endif
+#ifndef DK4_HAVE_ATTRIBUTE_UNUSED
+#if HAVE_ATTRIBUTE_UNUSED
+/** DK4 version of HAVE_ATTRIBUTE_UNUSED, available.
+*/
+#define DK4_HAVE_ATTRIBUTE_UNUSED 1
+#else
+/** DK4 version of HAVE_ATTRIBUTE_UNUSED, not available.
+*/
+#define DK4_HAVE_ATTRIBUTE_UNUSED 0
+#endif
+#endif
+
#ifndef DK4_HAVE_BACKSLASH_AS_SEP
#if HAVE_BACKSLASH_AS_SEP
/** DK4 version of HAVE_BACKSLASH_AS_SEP, available.
@@ -124,6 +136,18 @@
#endif
#endif
+#ifndef DK4_HAVE_BSEARCH
+#if HAVE_BSEARCH
+/** DK4 version of HAVE_BSEARCH, available.
+*/
+#define DK4_HAVE_BSEARCH 1
+#else
+/** DK4 version of HAVE_BSEARCH, not available.
+*/
+#define DK4_HAVE_BSEARCH 0
+#endif
+#endif
+
#ifndef DK4_HAVE_BZERO
#if HAVE_BZERO
/** DK4 version of HAVE_BZERO, available.
@@ -844,6 +868,18 @@
#endif
#endif
+#ifndef DK4_HAVE_INITGROUPS
+#if HAVE_INITGROUPS
+/** DK4 version of HAVE_INITGROUPS, available.
+*/
+#define DK4_HAVE_INITGROUPS 1
+#else
+/** DK4 version of HAVE_INITGROUPS, not available.
+*/
+#define DK4_HAVE_INITGROUPS 0
+#endif
+#endif
+
#ifndef DK4_HAVE_INITSTATE
#if HAVE_INITSTATE
/** DK4 version of HAVE_INITSTATE, available.
@@ -1000,6 +1036,54 @@
#endif
#endif
+#ifndef DK4_HAVE_ISGREATER
+#if HAVE_ISGREATER
+/** DK4 version of HAVE_ISGREATER, available.
+*/
+#define DK4_HAVE_ISGREATER 1
+#else
+/** DK4 version of HAVE_ISGREATER, not available.
+*/
+#define DK4_HAVE_ISGREATER 0
+#endif
+#endif
+
+#ifndef DK4_HAVE_ISGREATEREQUAL
+#if HAVE_ISGREATEREQUAL
+/** DK4 version of HAVE_ISGREATEREQUAL, available.
+*/
+#define DK4_HAVE_ISGREATEREQUAL 1
+#else
+/** DK4 version of HAVE_ISGREATEREQUAL, not available.
+*/
+#define DK4_HAVE_ISGREATEREQUAL 0
+#endif
+#endif
+
+#ifndef DK4_HAVE_ISLESS
+#if HAVE_ISLESS
+/** DK4 version of HAVE_ISLESS, available.
+*/
+#define DK4_HAVE_ISLESS 1
+#else
+/** DK4 version of HAVE_ISLESS, not available.
+*/
+#define DK4_HAVE_ISLESS 0
+#endif
+#endif
+
+#ifndef DK4_HAVE_ISLESSEQUAL
+#if HAVE_ISLESSEQUAL
+/** DK4 version of HAVE_ISLESSEQUAL, available.
+*/
+#define DK4_HAVE_ISLESSEQUAL 1
+#else
+/** DK4 version of HAVE_ISLESSEQUAL, not available.
+*/
+#define DK4_HAVE_ISLESSEQUAL 0
+#endif
+#endif
+
#ifndef DK4_HAVE_ISNORMAL
#if HAVE_ISNORMAL
/** DK4 version of HAVE_ISNORMAL, available.
@@ -1228,6 +1312,18 @@
#endif
#endif
+#ifndef DK4_HAVE_MEMORY_H
+#if HAVE_MEMORY_H
+/** DK4 version of HAVE_MEMORY_H, available.
+*/
+#define DK4_HAVE_MEMORY_H 1
+#else
+/** DK4 version of HAVE_MEMORY_H, not available.
+*/
+#define DK4_HAVE_MEMORY_H 0
+#endif
+#endif
+
#ifndef DK4_HAVE_MEMSET
#if HAVE_MEMSET
/** DK4 version of HAVE_MEMSET, available.
@@ -1504,6 +1600,18 @@
#endif
#endif
+#ifndef DK4_HAVE_QSORT
+#if HAVE_QSORT
+/** DK4 version of HAVE_QSORT, available.
+*/
+#define DK4_HAVE_QSORT 1
+#else
+/** DK4 version of HAVE_QSORT, not available.
+*/
+#define DK4_HAVE_QSORT 0
+#endif
+#endif
+
#ifndef DK4_HAVE_RAND
#if HAVE_RAND
/** DK4 version of HAVE_RAND, available.
@@ -1576,6 +1684,18 @@
#endif
#endif
+#ifndef DK4_HAVE_SEARCH_H
+#if HAVE_SEARCH_H
+/** DK4 version of HAVE_SEARCH_H, available.
+*/
+#define DK4_HAVE_SEARCH_H 1
+#else
+/** DK4 version of HAVE_SEARCH_H, not available.
+*/
+#define DK4_HAVE_SEARCH_H 0
+#endif
+#endif
+
#ifndef DK4_HAVE_SELECT
#if HAVE_SELECT
/** DK4 version of HAVE_SELECT, available.
@@ -1636,6 +1756,18 @@
#endif
#endif
+#ifndef DK4_HAVE_SETGROUPS
+#if HAVE_SETGROUPS
+/** DK4 version of HAVE_SETGROUPS, available.
+*/
+#define DK4_HAVE_SETGROUPS 1
+#else
+/** DK4 version of HAVE_SETGROUPS, not available.
+*/
+#define DK4_HAVE_SETGROUPS 0
+#endif
+#endif
+
#ifndef DK4_HAVE_SETJMP_H
#if HAVE_SETJMP_H
/** DK4 version of HAVE_SETJMP_H, available.
@@ -2308,6 +2440,18 @@
#endif
#endif
+#ifndef DK4_HAVE_SYSEXITS_H
+#if HAVE_SYSEXITS_H
+/** DK4 version of HAVE_SYSEXITS_H, available.
+*/
+#define DK4_HAVE_SYSEXITS_H 1
+#else
+/** DK4 version of HAVE_SYSEXITS_H, not available.
+*/
+#define DK4_HAVE_SYSEXITS_H 0
+#endif
+#endif
+
#ifndef DK4_HAVE_SYSLOG
#if HAVE_SYSLOG
/** DK4 version of HAVE_SYSLOG, available.
@@ -2332,6 +2476,18 @@
#endif
#endif
+#ifndef DK4_HAVE_SYSTEMD
+#if HAVE_SYSTEMD
+/** DK4 version of HAVE_SYSTEMD, available.
+*/
+#define DK4_HAVE_SYSTEMD 1
+#else
+/** DK4 version of HAVE_SYSTEMD, not available.
+*/
+#define DK4_HAVE_SYSTEMD 0
+#endif
+#endif
+
#ifndef DK4_HAVE_SYS_PARAM_H
#if HAVE_SYS_PARAM_H
/** DK4 version of HAVE_SYS_PARAM_H, available.
@@ -2848,6 +3004,42 @@
#endif
#endif
+#ifndef DK4_HAVE_WX_CHARTYPE_H
+#if HAVE_WX_CHARTYPE_H
+/** DK4 version of HAVE_WX_CHARTYPE_H, available.
+*/
+#define DK4_HAVE_WX_CHARTYPE_H 1
+#else
+/** DK4 version of HAVE_WX_CHARTYPE_H, not available.
+*/
+#define DK4_HAVE_WX_CHARTYPE_H 0
+#endif
+#endif
+
+#ifndef DK4_HAVE_WX_DEFS_H
+#if HAVE_WX_DEFS_H
+/** DK4 version of HAVE_WX_DEFS_H, available.
+*/
+#define DK4_HAVE_WX_DEFS_H 1
+#else
+/** DK4 version of HAVE_WX_DEFS_H, not available.
+*/
+#define DK4_HAVE_WX_DEFS_H 0
+#endif
+#endif
+
+#ifndef DK4_HAVE_WX_WXCHAR_H
+#if HAVE_WX_WXCHAR_H
+/** DK4 version of HAVE_WX_WXCHAR_H, available.
+*/
+#define DK4_HAVE_WX_WXCHAR_H 1
+#else
+/** DK4 version of HAVE_WX_WXCHAR_H, not available.
+*/
+#define DK4_HAVE_WX_WXCHAR_H 0
+#endif
+#endif
+
#ifndef DK4_HAVE_ZLIB_H
#if HAVE_ZLIB_H
/** DK4 version of HAVE_ZLIB_H, available.
@@ -3274,12 +3466,6 @@
#define DK4_SIZEOF_DOUBLE SIZEOF_DOUBLE
#endif
-#ifndef DK4_SIZEOF_INO64_T
-/** DK4 version of SIZEOF_INO64_T.
-*/
-#define DK4_SIZEOF_INO64_T SIZEOF_INO64_T
-#endif
-
#ifndef DK4_SIZEOF_INO_T
/** DK4 version of SIZEOF_INO_T.
*/
@@ -3292,6 +3478,12 @@
#define DK4_SIZEOF_INT SIZEOF_INT
#endif
+#ifndef DK4_SIZEOF_INT32_T
+/** DK4 version of SIZEOF_INT32_T.
+*/
+#define DK4_SIZEOF_INT32_T SIZEOF_INT32_T
+#endif
+
#ifndef DK4_SIZEOF_INTMAX_T
/** DK4 version of SIZEOF_INTMAX_T.
*/
@@ -3316,12 +3508,6 @@
#define DK4_SIZEOF_LONG_LONG SIZEOF_LONG_LONG
#endif
-#ifndef DK4_SIZEOF_OFF64_T
-/** DK4 version of SIZEOF_OFF64_T.
-*/
-#define DK4_SIZEOF_OFF64_T SIZEOF_OFF64_T
-#endif
-
#ifndef DK4_SIZEOF_OFF_T
/** DK4 version of SIZEOF_OFF_T.
*/
@@ -3370,6 +3556,18 @@
#endif
#endif
+#ifndef DK4_USE_INLINE
+#if USE_INLINE
+/** DK4 version of USE_INLINE, available.
+*/
+#define DK4_USE_INLINE USE_INLINE
+#else
+/** DK4 version of USE_INLINE, not available.
+*/
+#define DK4_USE_INLINE 0
+#endif
+#endif
+
#ifndef DK4_USE_PRINTF_SCANF
#if USE_PRINTF_SCANF
/** DK4 version of USE_PRINTF_SCANF, available.
diff --git a/support/dktools/dk4conf.h b/support/dktools/dk4conf.h
index 9108015c69..efba1d79d0 100644
--- a/support/dktools/dk4conf.h
+++ b/support/dktools/dk4conf.h
@@ -1,3 +1,8 @@
+/*
+Copyright (C) 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file dk4conf.h Fixed configure results.
*/
@@ -6,6 +11,18 @@
*/
#define DK4CONF_H_INCLUDED 1
+#ifndef DK4_ON_WINDOWS
+#if _WIN32
+/** Define to 1 on Windows, 0 otherwise.
+*/
+#define DK4_ON_WINDOWS 1
+#else
+/** Define to 1 on Windows, 0 otherwise.
+*/
+#define DK4_ON_WINDOWS 0
+#endif
+#endif
+
/** DK4 version of HAVE_ALLOC_H.
*/
#define DK4_HAVE_ALLOC_H 0
@@ -18,6 +35,10 @@
*/
#define DK4_HAVE_ASSERT_H 1
+/** DK4 version of HAVE_ATTRIBUTE_UNUSED.
+*/
+#define DK4_HAVE_ATTRIBUTE_UNUSED 1
+
/** DK4 version of HAVE_BACKSLASH_AS_SEP.
*/
#define DK4_HAVE_BACKSLASH_AS_SEP 0
@@ -42,6 +63,10 @@
*/
#define DK4_HAVE_BLKSIZE_T 1
+/** DK4 version of HAVE_BSEARCH.
+*/
+#define DK4_HAVE_BSEARCH 1
+
/** DK4 version of HAVE_BZERO.
*/
#define DK4_HAVE_BZERO 1
@@ -282,13 +307,17 @@
*/
#define DK4_HAVE_INET_PTON 1
+/** DK4 version of HAVE_INITGROUPS.
+*/
+#define DK4_HAVE_INITGROUPS 1
+
/** DK4 version of HAVE_INITSTATE.
*/
#define DK4_HAVE_INITSTATE 1
/** DK4 version of HAVE_INLINE.
*/
-#define DK4_HAVE_INLINE 0
+#define DK4_HAVE_INLINE 1
/** DK4 version of HAVE_INO64_T.
*/
@@ -334,6 +363,22 @@
*/
#define DK4_HAVE_ISFINITE 1
+/** DK4 version of HAVE_ISGREATER.
+*/
+#define DK4_HAVE_ISGREATER 1
+
+/** DK4 version of HAVE_ISGREATEREQUAL.
+*/
+#define DK4_HAVE_ISGREATEREQUAL 1
+
+/** DK4 version of HAVE_ISLESS.
+*/
+#define DK4_HAVE_ISLESS 1
+
+/** DK4 version of HAVE_ISLESSEQUAL.
+*/
+#define DK4_HAVE_ISLESSEQUAL 1
+
/** DK4 version of HAVE_ISNORMAL.
*/
#define DK4_HAVE_ISNORMAL 1
@@ -348,7 +393,7 @@
/** DK4 version of HAVE_LARGEFILE64_SOURCE.
*/
-#define DK4_HAVE_LARGEFILE64_SOURCE 1
+#define DK4_HAVE_LARGEFILE64_SOURCE 0
/** DK4 version of HAVE_LIBNETSNMP.
*/
@@ -410,6 +455,10 @@
*/
#define DK4_HAVE_MEMCPY 1
+/** DK4 version of HAVE_MEMORY_H.
+*/
+#define DK4_HAVE_MEMORY_H 1
+
/** DK4 version of HAVE_MEMSET.
*/
#define DK4_HAVE_MEMSET 1
@@ -484,7 +533,7 @@
/** DK4 version of HAVE_PNG_GET_PIXELS_PER_INCH.
*/
-#define DK4_HAVE_PNG_GET_PIXELS_PER_INCH 0
+#define DK4_HAVE_PNG_GET_PIXELS_PER_INCH 1
/** DK4 version of HAVE_PNG_H.
*/
@@ -502,6 +551,10 @@
*/
#define DK4_HAVE_PWD_H 1
+/** DK4 version of HAVE_QSORT.
+*/
+#define DK4_HAVE_QSORT 1
+
/** DK4 version of HAVE_RAND.
*/
#define DK4_HAVE_RAND 1
@@ -512,7 +565,7 @@
/** DK4 version of HAVE_RAND_EGD.
*/
-#define DK4_HAVE_RAND_EGD 1
+#define DK4_HAVE_RAND_EGD 0
/** DK4 version of HAVE_READ.
*/
@@ -526,6 +579,10 @@
*/
#define DK4_HAVE_RMDIR 1
+/** DK4 version of HAVE_SEARCH_H.
+*/
+#define DK4_HAVE_SEARCH_H 1
+
/** DK4 version of HAVE_SELECT.
*/
#define DK4_HAVE_SELECT 1
@@ -546,6 +603,10 @@
*/
#define DK4_HAVE_SETGRENT 1
+/** DK4 version of HAVE_SETGROUPS.
+*/
+#define DK4_HAVE_SETGROUPS 1
+
/** DK4 version of HAVE_SETJMP_H.
*/
#define DK4_HAVE_SETJMP_H 1
@@ -770,6 +831,10 @@
*/
#define DK4_HAVE_SWPRINTF 1
+/** DK4 version of HAVE_SYSEXITS_H.
+*/
+#define DK4_HAVE_SYSEXITS_H 1
+
/** DK4 version of HAVE_SYSLOG.
*/
#define DK4_HAVE_SYSLOG 1
@@ -778,6 +843,10 @@
*/
#define DK4_HAVE_SYSLOG_H 1
+/** DK4 version of HAVE_SYSTEMD.
+*/
+#define DK4_HAVE_SYSTEMD 1
+
/** DK4 version of HAVE_SYS_PARAM_H.
*/
#define DK4_HAVE_SYS_PARAM_H 1
@@ -816,7 +885,7 @@
/** DK4 version of HAVE_THREADS_H.
*/
-#define DK4_HAVE_THREADS_H 0
+#define DK4_HAVE_THREADS_H 1
/** DK4 version of HAVE_TIFF_H.
*/
@@ -950,6 +1019,18 @@
*/
#define DK4_HAVE_WXWIDGETS 1
+/** DK4 version of HAVE_WX_CHARTYPE_H.
+*/
+#define DK4_HAVE_WX_CHARTYPE_H 1
+
+/** DK4 version of HAVE_WX_DEFS_H.
+*/
+#define DK4_HAVE_WX_DEFS_H 1
+
+/** DK4 version of HAVE_WX_WXCHAR_H.
+*/
+#define DK4_HAVE_WX_WXCHAR_H 0
+
/** DK4 version of HAVE_ZLIB_H.
*/
#define DK4_HAVE_ZLIB_H 1
@@ -964,7 +1045,7 @@
/** DK4 version of HAVE__FINITE.
*/
-#define DK4_HAVE__FINITE 0
+#define DK4_HAVE__FINITE 1
/** DK4 version of HAVE__FPOS_T.
*/
@@ -1094,10 +1175,6 @@
*/
#define DK4_SIZEOF_DOUBLE 8
-/** DK4 version of SIZEOF_INO64_T.
-*/
-#define DK4_SIZEOF_INO64_T 0
-
/** DK4 version of SIZEOF_INO_T.
*/
#define DK4_SIZEOF_INO_T 8
@@ -1106,6 +1183,10 @@
*/
#define DK4_SIZEOF_INT 4
+/** DK4 version of SIZEOF_INT32_T.
+*/
+#define DK4_SIZEOF_INT32_T 4
+
/** DK4 version of SIZEOF_INTMAX_T.
*/
#define DK4_SIZEOF_INTMAX_T 8
@@ -1122,10 +1203,6 @@
*/
#define DK4_SIZEOF_LONG_LONG 8
-/** DK4 version of SIZEOF_OFF64_T.
-*/
-#define DK4_SIZEOF_OFF64_T 0
-
/** DK4 version of SIZEOF_OFF_T.
*/
#define DK4_SIZEOF_OFF_T 8
@@ -1150,6 +1227,10 @@
*/
#define DK4_USE_FALLBACK_NUMERIC_LIMITS 0
+/** DK4 version of USE_INLINE.
+*/
+#define DK4_USE_INLINE 0
+
/** DK4 version of USE_PRINTF_SCANF.
*/
#define DK4_USE_PRINTF_SCANF 1
@@ -1162,9 +1243,16 @@
*/
#define DK4_WORDS_BIGENDIAN 0
-/** Size of wchar_t.
+#if DK4_HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+/** Use 64 bit file support.
*/
-#define DK4_SIZEOF_WXCHAR 4
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
+
#endif
/* ifndef DK4CONF_H_INCLUDED */
+
diff --git a/support/dktools/dk4conf.h.end b/support/dktools/dk4conf.h.end
new file mode 100644
index 0000000000..237dd0fea2
--- /dev/null
+++ b/support/dktools/dk4conf.h.end
@@ -0,0 +1,4 @@
+
+#endif
+/* ifndef DK4CONF_H_INCLUDED */
+
diff --git a/support/dktools/dk4conf.h.large b/support/dktools/dk4conf.h.large
new file mode 100644
index 0000000000..45e52c5365
--- /dev/null
+++ b/support/dktools/dk4conf.h.large
@@ -0,0 +1,9 @@
+
+#if DK4_HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+/** Use 64 bit file support.
+*/
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
diff --git a/support/dktools/dk4conf.h.start b/support/dktools/dk4conf.h.start
new file mode 100644
index 0000000000..1102f468fd
--- /dev/null
+++ b/support/dktools/dk4conf.h.start
@@ -0,0 +1,25 @@
+/*
+Copyright (C) 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/** @file dk4conf.h Fixed configure results.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+/** Protection against multiple inclusion.
+*/
+#define DK4CONF_H_INCLUDED 1
+
+#ifndef DK4_ON_WINDOWS
+#if _WIN32
+/** Define to 1 on Windows, 0 otherwise.
+*/
+#define DK4_ON_WINDOWS 1
+#else
+/** Define to 1 on Windows, 0 otherwise.
+*/
+#define DK4_ON_WINDOWS 0
+#endif
+#endif
+
diff --git a/support/dktools/dk4config.c b/support/dktools/dk4config.c
new file mode 100644
index 0000000000..9d1c5ff730
--- /dev/null
+++ b/support/dktools/dk4config.c
@@ -0,0 +1,2540 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/** @file dk4config.cpp Fix configure results.
+ Redirect output from this program to the dk4conf.h file.
+*/
+
+#include "config.h"
+
+#if HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
+#include <stdio.h>
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#include <dk3trace.h>
+#ifndef TRACE_DEBUG
+#define TRACE_DEBUG 1
+#endif
+
+#if HAVE_LARGEFILE64_SOURCE
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int
+check_largefile64(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+int
+check_largefile64(void)
+{
+ int back = 0;
+#if (HAVE_INO64_T) && (HAVE_INO_T)
+ if (sizeof(ino64_t) > sizeof(ino_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE__INO64_T) && (HAVE__INO_T)
+ if (sizeof(_ino64_t) > sizeof(_ino_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE_OFF64_T) && (HAVE_OFF_T)
+ if (sizeof(off64_t) > sizeof(off_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE__OFF64_T) && (HAVE__OFF_T)
+ if (sizeof(_off64_t) > sizeof(_off_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE_STAT64) && (HAVE_STAT)
+ if (sizeof(struct stat64) > sizeof(struct stat)) {
+ back = 1;
+ }
+#endif
+ return back;
+}
+#endif
+
+
+int
+main(void)
+{
+
+#if HAVE_ALLOC_H
+ fputs("/** DK4 version of HAVE_ALLOC_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ALLOC_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ALLOC_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ALLOC_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ARPA_INET_H
+ fputs("/** DK4 version of HAVE_ARPA_INET_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ARPA_INET_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ARPA_INET_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ARPA_INET_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ASSERT_H
+ fputs("/** DK4 version of HAVE_ASSERT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ASSERT_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ASSERT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ASSERT_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ATTRIBUTE_UNUSED
+ fputs("/** DK4 version of HAVE_ATTRIBUTE_UNUSED.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ATTRIBUTE_UNUSED 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ATTRIBUTE_UNUSED.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ATTRIBUTE_UNUSED 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BACKSLASH_AS_SEP
+ fputs("/** DK4 version of HAVE_BACKSLASH_AS_SEP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BACKSLASH_AS_SEP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BACKSLASH_AS_SEP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BACKSLASH_AS_SEP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BCMP
+ fputs("/** DK4 version of HAVE_BCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BCMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BCMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BCOPY
+ fputs("/** DK4 version of HAVE_BCOPY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BCOPY 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BCOPY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BCOPY 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BIOS_H
+ fputs("/** DK4 version of HAVE_BIOS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BIOS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BIOS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BIOS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BLKCNT_T
+ fputs("/** DK4 version of HAVE_BLKCNT_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BLKCNT_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BLKCNT_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BLKCNT_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BLKSIZE_T
+ fputs("/** DK4 version of HAVE_BLKSIZE_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BLKSIZE_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BLKSIZE_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BLKSIZE_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BSEARCH
+ fputs("/** DK4 version of HAVE_BSEARCH.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BSEARCH 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BSEARCH.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BSEARCH 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BZERO
+ fputs("/** DK4 version of HAVE_BZERO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BZERO 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BZERO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BZERO 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_BZLIB_H
+ fputs("/** DK4 version of HAVE_BZLIB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BZLIB_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BZLIB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BZLIB_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_CALLOC
+ fputs("/** DK4 version of HAVE_CALLOC.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CALLOC 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_CALLOC.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CALLOC 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_CASE_INSENSITIVE_PATHNAMES
+ fputs("/** DK4 version of HAVE_CASE_INSENSITIVE_PATHNAMES.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CASE_INSENSITIVE_PATHNAMES 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_CASE_INSENSITIVE_PATHNAMES.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CASE_INSENSITIVE_PATHNAMES 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_CASE_INSENSITIVE_USERNAMES
+ fputs("/** DK4 version of HAVE_CASE_INSENSITIVE_USERNAMES.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CASE_INSENSITIVE_USERNAMES 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_CASE_INSENSITIVE_USERNAMES.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CASE_INSENSITIVE_USERNAMES 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_CHMOD
+ fputs("/** DK4 version of HAVE_CHMOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CHMOD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_CHMOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CHMOD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_CHOWN
+ fputs("/** DK4 version of HAVE_CHOWN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CHOWN 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_CHOWN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CHOWN 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_COMPATDKTOOLS3
+ fputs("/** DK4 version of HAVE_COMPATDKTOOLS3.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_COMPATDKTOOLS3 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_COMPATDKTOOLS3.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_COMPATDKTOOLS3 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_COMPLEX_H
+ fputs("/** DK4 version of HAVE_COMPLEX_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_COMPLEX_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_COMPLEX_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_COMPLEX_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_CTYPE_H
+ fputs("/** DK4 version of HAVE_CTYPE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CTYPE_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_CTYPE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_CTYPE_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_DB_CURSOR_C_GET
+ fputs("/** DK4 version of HAVE_DB_CURSOR_C_GET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DB_CURSOR_C_GET 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_DB_CURSOR_C_GET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DB_CURSOR_C_GET 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_DB_H
+ fputs("/** DK4 version of HAVE_DB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DB_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_DB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DB_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_DEV_T
+ fputs("/** DK4 version of HAVE_DEV_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DEV_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_DEV_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DEV_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_DIRECT_H
+ fputs("/** DK4 version of HAVE_DIRECT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DIRECT_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_DIRECT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DIRECT_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_DIRENT_H
+ fputs("/** DK4 version of HAVE_DIRENT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DIRENT_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_DIRENT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DIRENT_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_DOS_H
+ fputs("/** DK4 version of HAVE_DOS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DOS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_DOS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_DOS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ENDGRENT
+ fputs("/** DK4 version of HAVE_ENDGRENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ENDGRENT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ENDGRENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ENDGRENT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ENDPWENT
+ fputs("/** DK4 version of HAVE_ENDPWENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ENDPWENT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ENDPWENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ENDPWENT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ERRNO_H
+ fputs("/** DK4 version of HAVE_ERRNO_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ERRNO_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ERRNO_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ERRNO_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FCNTL_H
+ fputs("/** DK4 version of HAVE_FCNTL_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FCNTL_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FCNTL_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FCNTL_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FENV_H
+ fputs("/** DK4 version of HAVE_FENV_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FENV_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FENV_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FENV_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FILEMODE_BINARY
+ fputs("/** DK4 version of HAVE_FILEMODE_BINARY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILEMODE_BINARY 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FILEMODE_BINARY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILEMODE_BINARY 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FILENO
+ fputs("/** DK4 version of HAVE_FILENO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILENO 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FILENO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILENO 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FILE_ATIMECTIME
+ fputs("/** DK4 version of HAVE_FILE_ATIMECTIME.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILE_ATIMECTIME 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FILE_ATIMECTIME.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILE_ATIMECTIME 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FILE_BLKSIZECNT
+ fputs("/** DK4 version of HAVE_FILE_BLKSIZECNT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILE_BLKSIZECNT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FILE_BLKSIZECNT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILE_BLKSIZECNT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FILE_DEVINO
+ fputs("/** DK4 version of HAVE_FILE_DEVINO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILE_DEVINO 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FILE_DEVINO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILE_DEVINO 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FILE_UIDGID
+ fputs("/** DK4 version of HAVE_FILE_UIDGID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILE_UIDGID 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FILE_UIDGID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FILE_UIDGID 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FLOAT_H
+ fputs("/** DK4 version of HAVE_FLOAT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FLOAT_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FLOAT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FLOAT_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FOPEN64
+ fputs("/** DK4 version of HAVE_FOPEN64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FOPEN64 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FOPEN64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FOPEN64 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FOPEN_S
+ fputs("/** DK4 version of HAVE_FOPEN_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FOPEN_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FOPEN_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FOPEN_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FPOS_T
+ fputs("/** DK4 version of HAVE_FPOS_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FPOS_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FPOS_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FPOS_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FPUTWC
+ fputs("/** DK4 version of HAVE_FPUTWC.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FPUTWC 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FPUTWC.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FPUTWC 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FPUTWS
+ fputs("/** DK4 version of HAVE_FPUTWS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FPUTWS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FPUTWS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FPUTWS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_FREE
+ fputs("/** DK4 version of HAVE_FREE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FREE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_FREE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_FREE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETADDRINFO
+ fputs("/** DK4 version of HAVE_GETADDRINFO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETADDRINFO 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETADDRINFO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETADDRINFO 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETCWD
+ fputs("/** DK4 version of HAVE_GETCWD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETCWD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETCWD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETCWD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETENV
+ fputs("/** DK4 version of HAVE_GETENV.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETENV 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETENV.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETENV 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETENV_S
+ fputs("/** DK4 version of HAVE_GETENV_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETENV_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETENV_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETENV_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETEUID
+ fputs("/** DK4 version of HAVE_GETEUID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETEUID 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETEUID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETEUID 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETEXECNAME
+ fputs("/** DK4 version of HAVE_GETEXECNAME.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETEXECNAME 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETEXECNAME.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETEXECNAME 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETFINALPATHNAMEBYHANDLE
+ fputs("/** DK4 version of HAVE_GETFINALPATHNAMEBYHANDLE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETFINALPATHNAMEBYHANDLE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETFINALPATHNAMEBYHANDLE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETFINALPATHNAMEBYHANDLE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETGRENT
+ fputs("/** DK4 version of HAVE_GETGRENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETGRENT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETGRENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETGRENT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETGRGID
+ fputs("/** DK4 version of HAVE_GETGRGID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETGRGID 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETGRGID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETGRGID 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETGRNAM
+ fputs("/** DK4 version of HAVE_GETGRNAM.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETGRNAM 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETGRNAM.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETGRNAM 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETHOSTBYNAME
+ fputs("/** DK4 version of HAVE_GETHOSTBYNAME.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETHOSTBYNAME 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETHOSTBYNAME.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETHOSTBYNAME 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETNAMEINFO
+ fputs("/** DK4 version of HAVE_GETNAMEINFO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETNAMEINFO 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETNAMEINFO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETNAMEINFO 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETPID
+ fputs("/** DK4 version of HAVE_GETPID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETPID 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETPID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETPID 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETPWENT
+ fputs("/** DK4 version of HAVE_GETPWENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETPWENT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETPWENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETPWENT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETPWNAM
+ fputs("/** DK4 version of HAVE_GETPWNAM.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETPWNAM 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETPWNAM.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETPWNAM 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETPWUID
+ fputs("/** DK4 version of HAVE_GETPWUID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETPWUID 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETPWUID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETPWUID 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GETRLIMIT
+ fputs("/** DK4 version of HAVE_GETRLIMIT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETRLIMIT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GETRLIMIT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GETRLIMIT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GID_T
+ fputs("/** DK4 version of HAVE_GID_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GID_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GID_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GID_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_GRP_H
+ fputs("/** DK4 version of HAVE_GRP_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GRP_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_GRP_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_GRP_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_HTONL
+ fputs("/** DK4 version of HAVE_HTONL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_HTONL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_HTONL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_HTONL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_HTONS
+ fputs("/** DK4 version of HAVE_HTONS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_HTONS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_HTONS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_HTONS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_IN6_ADDR
+ fputs("/** DK4 version of HAVE_IN6_ADDR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_IN6_ADDR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_IN6_ADDR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_IN6_ADDR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INET_ADDR
+ fputs("/** DK4 version of HAVE_INET_ADDR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INET_ADDR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INET_ADDR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INET_ADDR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INET_ATON
+ fputs("/** DK4 version of HAVE_INET_ATON.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INET_ATON 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INET_ATON.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INET_ATON 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INET_NTOP
+ fputs("/** DK4 version of HAVE_INET_NTOP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INET_NTOP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INET_NTOP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INET_NTOP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INET_PTON
+ fputs("/** DK4 version of HAVE_INET_PTON.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INET_PTON 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INET_PTON.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INET_PTON 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INITGROUPS
+ fputs("/** DK4 version of HAVE_INITGROUPS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INITGROUPS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INITGROUPS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INITGROUPS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INITSTATE
+ fputs("/** DK4 version of HAVE_INITSTATE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INITSTATE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INITSTATE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INITSTATE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INLINE
+ fputs("/** DK4 version of HAVE_INLINE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INLINE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INLINE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INLINE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INO64_T
+ fputs("/** DK4 version of HAVE_INO64_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INO64_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INO64_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INO64_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INO_T
+ fputs("/** DK4 version of HAVE_INO_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INO_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INO_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INO_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INT16_T
+ fputs("/** DK4 version of HAVE_INT16_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INT16_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INT16_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INT16_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INT32_T
+ fputs("/** DK4 version of HAVE_INT32_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INT32_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INT32_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INT32_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INT8_T
+ fputs("/** DK4 version of HAVE_INT8_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INT8_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INT8_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INT8_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INTMAX_T
+ fputs("/** DK4 version of HAVE_INTMAX_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INTMAX_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INTMAX_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INTMAX_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_INTTYPES_H
+ fputs("/** DK4 version of HAVE_INTTYPES_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INTTYPES_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INTTYPES_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INTTYPES_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_IN_ADDR
+ fputs("/** DK4 version of HAVE_IN_ADDR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_IN_ADDR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_IN_ADDR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_IN_ADDR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_IO_H
+ fputs("/** DK4 version of HAVE_IO_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_IO_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_IO_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_IO_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISATTY
+ fputs("/** DK4 version of HAVE_ISATTY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISATTY 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISATTY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISATTY 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISFINITE
+ fputs("/** DK4 version of HAVE_ISFINITE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISFINITE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISFINITE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISFINITE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISGREATER
+ fputs("/** DK4 version of HAVE_ISGREATER.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISGREATER 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISGREATER.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISGREATER 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISGREATEREQUAL
+ fputs("/** DK4 version of HAVE_ISGREATEREQUAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISGREATEREQUAL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISGREATEREQUAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISGREATEREQUAL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISLESS
+ fputs("/** DK4 version of HAVE_ISLESS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISLESS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISLESS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISLESS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISLESSEQUAL
+ fputs("/** DK4 version of HAVE_ISLESSEQUAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISLESSEQUAL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISLESSEQUAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISLESSEQUAL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISNORMAL
+ fputs("/** DK4 version of HAVE_ISNORMAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISNORMAL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISNORMAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISNORMAL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISO646_H
+ fputs("/** DK4 version of HAVE_ISO646_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISO646_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISO646_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISO646_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_JPEGLIB_H
+ fputs("/** DK4 version of HAVE_JPEGLIB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_JPEGLIB_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_JPEGLIB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_JPEGLIB_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LARGEFILE64_SOURCE
+ if (0 != check_largefile64()) {
+ fputs("/** DK4 version of HAVE_LARGEFILE64_SOURCE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LARGEFILE64_SOURCE 1\n", stdout);
+ } else {
+ fputs("/** DK4 version of HAVE_LARGEFILE64_SOURCE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LARGEFILE64_SOURCE 0\n", stdout);
+ }
+#else
+ fputs("/** DK4 version of HAVE_LARGEFILE64_SOURCE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LARGEFILE64_SOURCE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LIBNETSNMP
+ fputs("/** DK4 version of HAVE_LIBNETSNMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LIBNETSNMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LIBNETSNMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LIBNETSNMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LIMITS_H
+ fputs("/** DK4 version of HAVE_LIMITS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LIMITS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LIMITS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LIMITS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LINE_END_CR_NL
+ fputs("/** DK4 version of HAVE_LINE_END_CR_NL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LINE_END_CR_NL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LINE_END_CR_NL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LINE_END_CR_NL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LOCALE_H
+ fputs("/** DK4 version of HAVE_LOCALE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LOCALE_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LOCALE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LOCALE_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LOCALTIME_R
+ fputs("/** DK4 version of HAVE_LOCALTIME_R.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LOCALTIME_R 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LOCALTIME_R.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LOCALTIME_R 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LONG_DOUBLE
+ fputs("/** DK4 version of HAVE_LONG_DOUBLE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LONG_DOUBLE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LONG_DOUBLE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LONG_DOUBLE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LONG_LONG
+ fputs("/** DK4 version of HAVE_LONG_LONG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LONG_LONG 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LONG_LONG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LONG_LONG 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LRAND48
+ fputs("/** DK4 version of HAVE_LRAND48.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LRAND48 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LRAND48.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LRAND48 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LSTAT
+ fputs("/** DK4 version of HAVE_LSTAT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LSTAT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LSTAT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LSTAT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_LSTAT64
+ fputs("/** DK4 version of HAVE_LSTAT64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LSTAT64 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_LSTAT64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LSTAT64 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MALLOC
+ fputs("/** DK4 version of HAVE_MALLOC.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MALLOC 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MALLOC.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MALLOC 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MALLOC_H
+ fputs("/** DK4 version of HAVE_MALLOC_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MALLOC_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MALLOC_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MALLOC_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MATH_H
+ fputs("/** DK4 version of HAVE_MATH_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MATH_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MATH_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MATH_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MEMCMP
+ fputs("/** DK4 version of HAVE_MEMCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MEMCMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MEMCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MEMCMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MEMCPY
+ fputs("/** DK4 version of HAVE_MEMCPY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MEMCPY 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MEMCPY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MEMCPY 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MEMORY_H
+ fputs("/** DK4 version of HAVE_MEMORY_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MEMORY_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MEMORY_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MEMORY_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MEMSET
+ fputs("/** DK4 version of HAVE_MEMSET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MEMSET 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MEMSET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MEMSET 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MKDIR
+ fputs("/** DK4 version of HAVE_MKDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MKDIR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MKDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MKDIR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_MODE_T
+ fputs("/** DK4 version of HAVE_MODE_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MODE_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_MODE_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_MODE_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NDBM_H
+ fputs("/** DK4 version of HAVE_NDBM_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NDBM_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NDBM_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NDBM_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NETDB_H
+ fputs("/** DK4 version of HAVE_NETDB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NETDB_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NETDB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NETDB_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NETINET_IN6_H
+ fputs("/** DK4 version of HAVE_NETINET_IN6_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NETINET_IN6_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NETINET_IN6_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NETINET_IN6_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NETINET_IN_H
+ fputs("/** DK4 version of HAVE_NETINET_IN_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NETINET_IN_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NETINET_IN_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NETINET_IN_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NLINK_T
+ fputs("/** DK4 version of HAVE_NLINK_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NLINK_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NLINK_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NLINK_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NRAND48
+ fputs("/** DK4 version of HAVE_NRAND48.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NRAND48 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NRAND48.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NRAND48 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NTIFS_H
+ fputs("/** DK4 version of HAVE_NTIFS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NTIFS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NTIFS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NTIFS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NTOHL
+ fputs("/** DK4 version of HAVE_NTOHL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NTOHL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NTOHL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NTOHL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_NTOHS
+ fputs("/** DK4 version of HAVE_NTOHS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NTOHS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_NTOHS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_NTOHS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_OFF64_T
+ fputs("/** DK4 version of HAVE_OFF64_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OFF64_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_OFF64_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OFF64_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_OFF_T
+ fputs("/** DK4 version of HAVE_OFF_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OFF_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_OFF_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OFF_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_OPENSSL_MD5_H
+ fputs("/** DK4 version of HAVE_OPENSSL_MD5_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OPENSSL_MD5_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_OPENSSL_MD5_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OPENSSL_MD5_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_OPENSSL_RAND_H
+ fputs("/** DK4 version of HAVE_OPENSSL_RAND_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OPENSSL_RAND_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_OPENSSL_RAND_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OPENSSL_RAND_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_OPENSSL_RIPEMD_H
+ fputs("/** DK4 version of HAVE_OPENSSL_RIPEMD_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OPENSSL_RIPEMD_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_OPENSSL_RIPEMD_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OPENSSL_RIPEMD_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_OPENSSL_SHA_H
+ fputs("/** DK4 version of HAVE_OPENSSL_SHA_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OPENSSL_SHA_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_OPENSSL_SHA_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_OPENSSL_SHA_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_PNG_GET_PIXELS_PER_INCH
+ fputs("/** DK4 version of HAVE_PNG_GET_PIXELS_PER_INCH.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PNG_GET_PIXELS_PER_INCH 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_PNG_GET_PIXELS_PER_INCH.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PNG_GET_PIXELS_PER_INCH 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_PNG_H
+ fputs("/** DK4 version of HAVE_PNG_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PNG_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_PNG_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PNG_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_PROCESS_H
+ fputs("/** DK4 version of HAVE_PROCESS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PROCESS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_PROCESS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PROCESS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_PROC_PID_EXE
+ fputs("/** DK4 version of HAVE_PROC_PID_EXE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PROC_PID_EXE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_PROC_PID_EXE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PROC_PID_EXE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_PWD_H
+ fputs("/** DK4 version of HAVE_PWD_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PWD_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_PWD_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_PWD_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_QSORT
+ fputs("/** DK4 version of HAVE_QSORT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_QSORT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_QSORT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_QSORT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_RAND
+ fputs("/** DK4 version of HAVE_RAND.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_RAND 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_RAND.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_RAND 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_RANDOM
+ fputs("/** DK4 version of HAVE_RANDOM.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_RANDOM 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_RANDOM.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_RANDOM 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_RAND_EGD
+ fputs("/** DK4 version of HAVE_RAND_EGD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_RAND_EGD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_RAND_EGD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_RAND_EGD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_READ
+ fputs("/** DK4 version of HAVE_READ.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_READ 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_READ.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_READ 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_READLINK
+ fputs("/** DK4 version of HAVE_READLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_READLINK 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_READLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_READLINK 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_RMDIR
+ fputs("/** DK4 version of HAVE_RMDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_RMDIR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_RMDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_RMDIR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SEARCH_H
+ fputs("/** DK4 version of HAVE_SEARCH_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SEARCH_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SEARCH_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SEARCH_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SELECT
+ fputs("/** DK4 version of HAVE_SELECT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SELECT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SELECT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SELECT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETBUF
+ fputs("/** DK4 version of HAVE_SETBUF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETBUF 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETBUF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETBUF 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETBUFFER
+ fputs("/** DK4 version of HAVE_SETBUFFER.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETBUFFER 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETBUFFER.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETBUFFER 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETGID
+ fputs("/** DK4 version of HAVE_SETGID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETGID 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETGID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETGID 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETGRENT
+ fputs("/** DK4 version of HAVE_SETGRENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETGRENT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETGRENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETGRENT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETGROUPS
+ fputs("/** DK4 version of HAVE_SETGROUPS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETGROUPS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETGROUPS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETGROUPS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETJMP_H
+ fputs("/** DK4 version of HAVE_SETJMP_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETJMP_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETJMP_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETJMP_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETLOCALE
+ fputs("/** DK4 version of HAVE_SETLOCALE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETLOCALE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETLOCALE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETLOCALE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETMODE
+ fputs("/** DK4 version of HAVE_SETMODE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETMODE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETMODE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETMODE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETPGRP
+ fputs("/** DK4 version of HAVE_SETPGRP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETPGRP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETPGRP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETPGRP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETPWENT
+ fputs("/** DK4 version of HAVE_SETPWENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETPWENT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETPWENT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETPWENT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETSID
+ fputs("/** DK4 version of HAVE_SETSID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETSID 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETSID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETSID 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETSOCKOPT
+ fputs("/** DK4 version of HAVE_SETSOCKOPT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETSOCKOPT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETSOCKOPT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETSOCKOPT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETSTATE
+ fputs("/** DK4 version of HAVE_SETSTATE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETSTATE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETSTATE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETSTATE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETUID
+ fputs("/** DK4 version of HAVE_SETUID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETUID 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETUID.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETUID 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SETVBUF
+ fputs("/** DK4 version of HAVE_SETVBUF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETVBUF 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETVBUF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETVBUF 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SHA224
+ fputs("/** DK4 version of HAVE_SHA224.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHA224 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SHA224.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHA224 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SHA256
+ fputs("/** DK4 version of HAVE_SHA256.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHA256 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SHA256.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHA256 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SHA384
+ fputs("/** DK4 version of HAVE_SHA384.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHA384 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SHA384.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHA384 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SHA512
+ fputs("/** DK4 version of HAVE_SHA512.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHA512 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SHA512.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHA512 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SHARE_H
+ fputs("/** DK4 version of HAVE_SHARE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHARE_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SHARE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SHARE_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SIGACTION
+ fputs("/** DK4 version of HAVE_SIGACTION.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGACTION 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SIGACTION.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGACTION 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SIGEMPTYSET
+ fputs("/** DK4 version of HAVE_SIGEMPTYSET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGEMPTYSET 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SIGEMPTYSET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGEMPTYSET 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SIGNAL
+ fputs("/** DK4 version of HAVE_SIGNAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGNAL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SIGNAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGNAL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SIGNAL_H
+ fputs("/** DK4 version of HAVE_SIGNAL_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGNAL_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SIGNAL_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGNAL_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SIGPROCMASK
+ fputs("/** DK4 version of HAVE_SIGPROCMASK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGPROCMASK 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SIGPROCMASK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGPROCMASK 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SIGSET
+ fputs("/** DK4 version of HAVE_SIGSET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGSET 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SIGSET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIGSET 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SIG_ATOMIC_T
+ fputs("/** DK4 version of HAVE_SIG_ATOMIC_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIG_ATOMIC_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SIG_ATOMIC_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SIG_ATOMIC_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SNMP_DISABLE_FILELOG
+ fputs("/** DK4 version of HAVE_SNMP_DISABLE_FILELOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNMP_DISABLE_FILELOG 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SNMP_DISABLE_FILELOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNMP_DISABLE_FILELOG 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SNMP_DISABLE_STDERRLOG
+ fputs("/** DK4 version of HAVE_SNMP_DISABLE_STDERRLOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNMP_DISABLE_STDERRLOG 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SNMP_DISABLE_STDERRLOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNMP_DISABLE_STDERRLOG 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SNMP_DISABLE_SYSLOG
+ fputs("/** DK4 version of HAVE_SNMP_DISABLE_SYSLOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNMP_DISABLE_SYSLOG 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SNMP_DISABLE_SYSLOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNMP_DISABLE_SYSLOG 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SNMP_ENABLE_FILELOG
+ fputs("/** DK4 version of HAVE_SNMP_ENABLE_FILELOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNMP_ENABLE_FILELOG 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SNMP_ENABLE_FILELOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNMP_ENABLE_FILELOG 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SNPRINTF
+ fputs("/** DK4 version of HAVE_SNPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNPRINTF 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SNPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNPRINTF 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SNWPRINTF
+ fputs("/** DK4 version of HAVE_SNWPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNWPRINTF 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SNWPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SNWPRINTF 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SOCKET
+ fputs("/** DK4 version of HAVE_SOCKET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SOCKET 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SOCKET.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SOCKET 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SOCKLEN_T
+ fputs("/** DK4 version of HAVE_SOCKLEN_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SOCKLEN_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SOCKLEN_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SOCKLEN_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SRAND
+ fputs("/** DK4 version of HAVE_SRAND.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SRAND 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SRAND.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SRAND 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SSIZE_T
+ fputs("/** DK4 version of HAVE_SSIZE_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SSIZE_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SSIZE_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SSIZE_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STAT64
+ fputs("/** DK4 version of HAVE_STAT64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STAT64 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STAT64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STAT64 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STDALIGN_H
+ fputs("/** DK4 version of HAVE_STDALIGN_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDALIGN_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STDALIGN_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDALIGN_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STDARG_H
+ fputs("/** DK4 version of HAVE_STDARG_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDARG_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STDARG_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDARG_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STDATOMIC_H
+ fputs("/** DK4 version of HAVE_STDATOMIC_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDATOMIC_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STDATOMIC_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDATOMIC_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STDBOOL_H
+ fputs("/** DK4 version of HAVE_STDBOOL_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDBOOL_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STDBOOL_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDBOOL_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STDDEF_H
+ fputs("/** DK4 version of HAVE_STDDEF_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDDEF_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STDDEF_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDDEF_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STDINT_H
+ fputs("/** DK4 version of HAVE_STDINT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDINT_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STDINT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDINT_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STDLIB_H
+ fputs("/** DK4 version of HAVE_STDLIB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDLIB_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STDLIB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDLIB_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STDNORETURN_H
+ fputs("/** DK4 version of HAVE_STDNORETURN_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDNORETURN_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STDNORETURN_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STDNORETURN_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRCASECMP
+ fputs("/** DK4 version of HAVE_STRCASECMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRCASECMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRCASECMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRCASECMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRCAT_S
+ fputs("/** DK4 version of HAVE_STRCAT_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRCAT_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRCAT_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRCAT_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRCPY_S
+ fputs("/** DK4 version of HAVE_STRCPY_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRCPY_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRCPY_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRCPY_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRERROR
+ fputs("/** DK4 version of HAVE_STRERROR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRERROR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRERROR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRERROR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRERROR_R
+ fputs("/** DK4 version of HAVE_STRERROR_R.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRERROR_R 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRERROR_R.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRERROR_R 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRICMP
+ fputs("/** DK4 version of HAVE_STRICMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRICMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRICMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRICMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRINGS_H
+ fputs("/** DK4 version of HAVE_STRINGS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRINGS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRINGS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRINGS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRING_H
+ fputs("/** DK4 version of HAVE_STRING_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRING_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRING_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRING_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRTOD
+ fputs("/** DK4 version of HAVE_STRTOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRTOD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRTOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRTOD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRUCT_ADDRINFO
+ fputs("/** DK4 version of HAVE_STRUCT_ADDRINFO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_ADDRINFO 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRUCT_ADDRINFO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_ADDRINFO 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRUCT_SOCKADDR_IN
+ fputs("/** DK4 version of HAVE_STRUCT_SOCKADDR_IN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_SOCKADDR_IN 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRUCT_SOCKADDR_IN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_SOCKADDR_IN 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRUCT_SOCKADDR_IN6
+ fputs("/** DK4 version of HAVE_STRUCT_SOCKADDR_IN6.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_SOCKADDR_IN6 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRUCT_SOCKADDR_IN6.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_SOCKADDR_IN6 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRUCT_SOCKADDR_STORAGE
+ fputs("/** DK4 version of HAVE_STRUCT_SOCKADDR_STORAGE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_SOCKADDR_STORAGE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRUCT_SOCKADDR_STORAGE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_SOCKADDR_STORAGE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_STRUCT_SOCKADDR_UN
+ fputs("/** DK4 version of HAVE_STRUCT_SOCKADDR_UN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_SOCKADDR_UN 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_STRUCT_SOCKADDR_UN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_STRUCT_SOCKADDR_UN 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SWPRINTF
+ fputs("/** DK4 version of HAVE_SWPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SWPRINTF 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SWPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SWPRINTF 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYSEXITS_H
+ fputs("/** DK4 version of HAVE_SYSEXITS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYSEXITS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYSEXITS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYSEXITS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYSLOG
+ fputs("/** DK4 version of HAVE_SYSLOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYSLOG 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYSLOG.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYSLOG 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYSLOG_H
+ fputs("/** DK4 version of HAVE_SYSLOG_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYSLOG_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYSLOG_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYSLOG_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYSTEMD
+ fputs("/** DK4 version of HAVE_SYSTEMD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYSTEMD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYSTEMD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYSTEMD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYS_PARAM_H
+ fputs("/** DK4 version of HAVE_SYS_PARAM_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_PARAM_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYS_PARAM_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_PARAM_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYS_RESOURCE_H
+ fputs("/** DK4 version of HAVE_SYS_RESOURCE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_RESOURCE_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYS_RESOURCE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_RESOURCE_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYS_SELECT_H
+ fputs("/** DK4 version of HAVE_SYS_SELECT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_SELECT_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYS_SELECT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_SELECT_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYS_SOCKET_H
+ fputs("/** DK4 version of HAVE_SYS_SOCKET_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_SOCKET_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYS_SOCKET_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_SOCKET_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYS_STAT_H
+ fputs("/** DK4 version of HAVE_SYS_STAT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_STAT_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYS_STAT_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_STAT_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYS_TIME_H
+ fputs("/** DK4 version of HAVE_SYS_TIME_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_TIME_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYS_TIME_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_TIME_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYS_TYPES_H
+ fputs("/** DK4 version of HAVE_SYS_TYPES_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_TYPES_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYS_TYPES_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_TYPES_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_SYS_UN_H
+ fputs("/** DK4 version of HAVE_SYS_UN_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_UN_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SYS_UN_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SYS_UN_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_TGMATH_H
+ fputs("/** DK4 version of HAVE_TGMATH_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_TGMATH_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_TGMATH_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_TGMATH_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_THREADS_H
+ fputs("/** DK4 version of HAVE_THREADS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_THREADS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_THREADS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_THREADS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_TIFF_H
+ fputs("/** DK4 version of HAVE_TIFF_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_TIFF_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_TIFF_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_TIFF_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_TIME_H
+ fputs("/** DK4 version of HAVE_TIME_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_TIME_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_TIME_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_TIME_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_TYPE_STAT64
+ fputs("/** DK4 version of HAVE_TYPE_STAT64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_TYPE_STAT64 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_TYPE_STAT64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_TYPE_STAT64 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_UCHAR_H
+ fputs("/** DK4 version of HAVE_UCHAR_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UCHAR_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_UCHAR_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UCHAR_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_UID_T
+ fputs("/** DK4 version of HAVE_UID_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UID_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_UID_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UID_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_UINT16_T
+ fputs("/** DK4 version of HAVE_UINT16_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UINT16_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_UINT16_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UINT16_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_UINT32_T
+ fputs("/** DK4 version of HAVE_UINT32_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UINT32_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_UINT32_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UINT32_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_UINT8_T
+ fputs("/** DK4 version of HAVE_UINT8_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UINT8_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_UINT8_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UINT8_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_UNISTD_H
+ fputs("/** DK4 version of HAVE_UNISTD_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UNISTD_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_UNISTD_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UNISTD_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_UNLINK
+ fputs("/** DK4 version of HAVE_UNLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UNLINK 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_UNLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_UNLINK 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_VOLATILE
+ fputs("/** DK4 version of HAVE_VOLATILE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_VOLATILE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_VOLATILE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_VOLATILE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCHAR_H
+ fputs("/** DK4 version of HAVE_WCHAR_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCHAR_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCHAR_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCHAR_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSCASECMP
+ fputs("/** DK4 version of HAVE_WCSCASECMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCASECMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSCASECMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCASECMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSCAT
+ fputs("/** DK4 version of HAVE_WCSCAT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCAT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSCAT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCAT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSCAT_S
+ fputs("/** DK4 version of HAVE_WCSCAT_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCAT_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSCAT_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCAT_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSCHR
+ fputs("/** DK4 version of HAVE_WCSCHR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCHR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSCHR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCHR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSCMP
+ fputs("/** DK4 version of HAVE_WCSCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSCPY
+ fputs("/** DK4 version of HAVE_WCSCPY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCPY 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSCPY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCPY 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSCPY_S
+ fputs("/** DK4 version of HAVE_WCSCPY_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCPY_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSCPY_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSCPY_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSICMP
+ fputs("/** DK4 version of HAVE_WCSICMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSICMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSICMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSICMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSLEN
+ fputs("/** DK4 version of HAVE_WCSLEN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSLEN 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSLEN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSLEN 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSNCMP
+ fputs("/** DK4 version of HAVE_WCSNCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSNCMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSNCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSNCMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSRCHR
+ fputs("/** DK4 version of HAVE_WCSRCHR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSRCHR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSRCHR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSRCHR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCSTOD
+ fputs("/** DK4 version of HAVE_WCSTOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSTOD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCSTOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCSTOD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WCTYPE_H
+ fputs("/** DK4 version of HAVE_WCTYPE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCTYPE_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WCTYPE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WCTYPE_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WINDOWS_H
+ fputs("/** DK4 version of HAVE_WINDOWS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WINDOWS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WINDOWS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WINDOWS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WINSOCK2_H
+ fputs("/** DK4 version of HAVE_WINSOCK2_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WINSOCK2_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WINSOCK2_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WINSOCK2_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WMKDIR
+ fputs("/** DK4 version of HAVE_WMKDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WMKDIR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WMKDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WMKDIR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WRITE
+ fputs("/** DK4 version of HAVE_WRITE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WRITE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WRITE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WRITE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WRMDIR
+ fputs("/** DK4 version of HAVE_WRMDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WRMDIR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WRMDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WRMDIR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WS2TCPIP_H
+ fputs("/** DK4 version of HAVE_WS2TCPIP_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WS2TCPIP_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WS2TCPIP_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WS2TCPIP_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WUNLINK
+ fputs("/** DK4 version of HAVE_WUNLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WUNLINK 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WUNLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WUNLINK 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WXWIDGETS
+ fputs("/** DK4 version of HAVE_WXWIDGETS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WXWIDGETS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WXWIDGETS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WXWIDGETS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WX_CHARTYPE_H
+ fputs("/** DK4 version of HAVE_WX_CHARTYPE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_CHARTYPE_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WX_CHARTYPE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_CHARTYPE_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WX_DEFS_H
+ fputs("/** DK4 version of HAVE_WX_DEFS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_DEFS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WX_DEFS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_DEFS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WX_WXCHAR_H
+ fputs("/** DK4 version of HAVE_WX_WXCHAR_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_WXCHAR_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WX_WXCHAR_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_WXCHAR_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ZLIB_H
+ fputs("/** DK4 version of HAVE_ZLIB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ZLIB_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ZLIB_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ZLIB_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__DEV_T
+ fputs("/** DK4 version of HAVE__DEV_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__DEV_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__DEV_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__DEV_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__FILENO
+ fputs("/** DK4 version of HAVE__FILENO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__FILENO 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__FILENO.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__FILENO 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__FINITE
+ fputs("/** DK4 version of HAVE__FINITE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__FINITE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__FINITE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__FINITE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__FPOS_T
+ fputs("/** DK4 version of HAVE__FPOS_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__FPOS_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__FPOS_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__FPOS_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__GETCWD
+ fputs("/** DK4 version of HAVE__GETCWD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__GETCWD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__GETCWD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__GETCWD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__INO64_T
+ fputs("/** DK4 version of HAVE__INO64_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__INO64_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__INO64_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__INO64_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__INO_T
+ fputs("/** DK4 version of HAVE__INO_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__INO_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__INO_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__INO_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__ISATTY
+ fputs("/** DK4 version of HAVE__ISATTY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__ISATTY 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__ISATTY.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__ISATTY 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__MKDIR
+ fputs("/** DK4 version of HAVE__MKDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__MKDIR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__MKDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__MKDIR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__OFF64_T
+ fputs("/** DK4 version of HAVE__OFF64_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__OFF64_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__OFF64_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__OFF64_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__OFF_T
+ fputs("/** DK4 version of HAVE__OFF_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__OFF_T 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__OFF_T.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__OFF_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__READ
+ fputs("/** DK4 version of HAVE__READ.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__READ 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__READ.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__READ 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__RMDIR
+ fputs("/** DK4 version of HAVE__RMDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__RMDIR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__RMDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__RMDIR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__SETMODE
+ fputs("/** DK4 version of HAVE__SETMODE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SETMODE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__SETMODE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SETMODE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__SNPRINTF
+ fputs("/** DK4 version of HAVE__SNPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SNPRINTF 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__SNPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SNPRINTF 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__SNPRINTF_S
+ fputs("/** DK4 version of HAVE__SNPRINTF_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SNPRINTF_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__SNPRINTF_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SNPRINTF_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__SNWPRINTF
+ fputs("/** DK4 version of HAVE__SNWPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SNWPRINTF 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__SNWPRINTF.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SNWPRINTF 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__SNWPRINTF_S
+ fputs("/** DK4 version of HAVE__SNWPRINTF_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SNWPRINTF_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__SNWPRINTF_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__SNWPRINTF_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__STRICMP
+ fputs("/** DK4 version of HAVE__STRICMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__STRICMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__STRICMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__STRICMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__STRTOD
+ fputs("/** DK4 version of HAVE__STRTOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__STRTOD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__STRTOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__STRTOD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__UNLINK
+ fputs("/** DK4 version of HAVE__UNLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__UNLINK 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__UNLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__UNLINK 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WCSCASECMP
+ fputs("/** DK4 version of HAVE__WCSCASECMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSCASECMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WCSCASECMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSCASECMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WCSCMP
+ fputs("/** DK4 version of HAVE__WCSCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSCMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WCSCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSCMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WCSICMP
+ fputs("/** DK4 version of HAVE__WCSICMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSICMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WCSICMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSICMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WCSNCMP
+ fputs("/** DK4 version of HAVE__WCSNCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSNCMP 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WCSNCMP.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSNCMP 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WCSTOD
+ fputs("/** DK4 version of HAVE__WCSTOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSTOD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WCSTOD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WCSTOD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WFOPEN
+ fputs("/** DK4 version of HAVE__WFOPEN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WFOPEN 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WFOPEN.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WFOPEN 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WFOPEN64
+ fputs("/** DK4 version of HAVE__WFOPEN64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WFOPEN64 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WFOPEN64.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WFOPEN64 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WFOPEN_S
+ fputs("/** DK4 version of HAVE__WFOPEN_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WFOPEN_S 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WFOPEN_S.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WFOPEN_S 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WGETCWD
+ fputs("/** DK4 version of HAVE__WGETCWD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WGETCWD 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WGETCWD.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WGETCWD 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WMKDIR
+ fputs("/** DK4 version of HAVE__WMKDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WMKDIR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WMKDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WMKDIR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WRITE
+ fputs("/** DK4 version of HAVE__WRITE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WRITE 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WRITE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WRITE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WRMDIR
+ fputs("/** DK4 version of HAVE__WRMDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WRMDIR 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WRMDIR.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WRMDIR 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE__WUNLINK
+ fputs("/** DK4 version of HAVE__WUNLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WUNLINK 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE__WUNLINK.\n*/\n", stdout);
+ fputs("#define DK4_HAVE__WUNLINK 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_DOUBLE
+ fputs("/** DK4 version of SIZEOF_DOUBLE.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_DOUBLE %u\n", (unsigned)SIZEOF_DOUBLE);
+#else
+ fputs("/** DK4 version of SIZEOF_DOUBLE.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_DOUBLE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_INO_T
+ fputs("/** DK4 version of SIZEOF_INO_T.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_INO_T %u\n", (unsigned)SIZEOF_INO_T);
+#else
+ fputs("/** DK4 version of SIZEOF_INO_T.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_INO_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_INT
+ fputs("/** DK4 version of SIZEOF_INT.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_INT %u\n", (unsigned)SIZEOF_INT);
+#else
+ fputs("/** DK4 version of SIZEOF_INT.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_INT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_INT32_T
+ fputs("/** DK4 version of SIZEOF_INT32_T.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_INT32_T %u\n", (unsigned)SIZEOF_INT32_T);
+#else
+ fputs("/** DK4 version of SIZEOF_INT32_T.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_INT32_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_INTMAX_T
+ fputs("/** DK4 version of SIZEOF_INTMAX_T.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_INTMAX_T %u\n", (unsigned)SIZEOF_INTMAX_T);
+#else
+ fputs("/** DK4 version of SIZEOF_INTMAX_T.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_INTMAX_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_LONG
+ fputs("/** DK4 version of SIZEOF_LONG.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_LONG %u\n", (unsigned)SIZEOF_LONG);
+#else
+ fputs("/** DK4 version of SIZEOF_LONG.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_LONG 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_LONG_DOUBLE
+ fputs("/** DK4 version of SIZEOF_LONG_DOUBLE.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_LONG_DOUBLE %u\n", (unsigned)SIZEOF_LONG_DOUBLE);
+#else
+ fputs("/** DK4 version of SIZEOF_LONG_DOUBLE.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_LONG_DOUBLE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_LONG_LONG
+ fputs("/** DK4 version of SIZEOF_LONG_LONG.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_LONG_LONG %u\n", (unsigned)SIZEOF_LONG_LONG);
+#else
+ fputs("/** DK4 version of SIZEOF_LONG_LONG.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_LONG_LONG 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_OFF_T
+ fputs("/** DK4 version of SIZEOF_OFF_T.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_OFF_T %u\n", (unsigned)SIZEOF_OFF_T);
+#else
+ fputs("/** DK4 version of SIZEOF_OFF_T.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_OFF_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_SHORT
+ fputs("/** DK4 version of SIZEOF_SHORT.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_SHORT %u\n", (unsigned)SIZEOF_SHORT);
+#else
+ fputs("/** DK4 version of SIZEOF_SHORT.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_SHORT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_SIZE_T
+ fputs("/** DK4 version of SIZEOF_SIZE_T.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_SIZE_T %u\n", (unsigned)SIZEOF_SIZE_T);
+#else
+ fputs("/** DK4 version of SIZEOF_SIZE_T.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_SIZE_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if SIZEOF_WCHAR_T
+ fputs("/** DK4 version of SIZEOF_WCHAR_T.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_WCHAR_T %u\n", (unsigned)SIZEOF_WCHAR_T);
+#else
+ fputs("/** DK4 version of SIZEOF_WCHAR_T.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_WCHAR_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if TIME_WITH_SYS_TIME
+ fputs("/** DK4 version of TIME_WITH_SYS_TIME.\n*/\n", stdout);
+ printf("#define DK4_TIME_WITH_SYS_TIME %u\n", (unsigned)TIME_WITH_SYS_TIME);
+#else
+ fputs("/** DK4 version of TIME_WITH_SYS_TIME.\n*/\n", stdout);
+ fputs("#define DK4_TIME_WITH_SYS_TIME 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if USE_FALLBACK_NUMERIC_LIMITS
+ fputs("/** DK4 version of USE_FALLBACK_NUMERIC_LIMITS.\n*/\n", stdout);
+ printf("#define DK4_USE_FALLBACK_NUMERIC_LIMITS %u\n", (unsigned)USE_FALLBACK_NUMERIC_LIMITS);
+#else
+ fputs("/** DK4 version of USE_FALLBACK_NUMERIC_LIMITS.\n*/\n", stdout);
+ fputs("#define DK4_USE_FALLBACK_NUMERIC_LIMITS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if USE_INLINE
+ fputs("/** DK4 version of USE_INLINE.\n*/\n", stdout);
+ printf("#define DK4_USE_INLINE %u\n", (unsigned)USE_INLINE);
+#else
+ fputs("/** DK4 version of USE_INLINE.\n*/\n", stdout);
+ fputs("#define DK4_USE_INLINE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if USE_PRINTF_SCANF
+ fputs("/** DK4 version of USE_PRINTF_SCANF.\n*/\n", stdout);
+ printf("#define DK4_USE_PRINTF_SCANF %u\n", (unsigned)USE_PRINTF_SCANF);
+#else
+ fputs("/** DK4 version of USE_PRINTF_SCANF.\n*/\n", stdout);
+ fputs("#define DK4_USE_PRINTF_SCANF 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if USE_WINDOWS_LOCAL_ALLOC
+ fputs("/** DK4 version of USE_WINDOWS_LOCAL_ALLOC.\n*/\n", stdout);
+ printf("#define DK4_USE_WINDOWS_LOCAL_ALLOC %u\n", (unsigned)USE_WINDOWS_LOCAL_ALLOC);
+#else
+ fputs("/** DK4 version of USE_WINDOWS_LOCAL_ALLOC.\n*/\n", stdout);
+ fputs("#define DK4_USE_WINDOWS_LOCAL_ALLOC 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if WORDS_BIGENDIAN
+ fputs("/** DK4 version of WORDS_BIGENDIAN.\n*/\n", stdout);
+ printf("#define DK4_WORDS_BIGENDIAN %u\n", (unsigned)WORDS_BIGENDIAN);
+#else
+ fputs("/** DK4 version of WORDS_BIGENDIAN.\n*/\n", stdout);
+ fputs("#define DK4_WORDS_BIGENDIAN 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+/* Large file support start */
+#if HAVE_LARGEFILE64_SOURCE
+ fputs("#if DK4_HAVE_LARGEFILE64_SOURCE\n", stdout);
+ fputs("#ifndef _LARGEFILE64_SOURCE\n", stdout);
+ fputs("/**\tUse 64 bit file support.\n*/\n", stdout);
+ fputs("#define _LARGEFILE64_SOURCE 1\n", stdout);
+ fputs("#endif\n", stdout);
+ fputs("#endif\n\n\n", stdout);
+#endif
+/* Large file support end */
+
+ return 0;
+}
diff --git a/support/dktools/dk4config.cpp b/support/dktools/dk4config.cpp
index fb0ac4c502..854f9c8c43 100644
--- a/support/dktools/dk4config.cpp
+++ b/support/dktools/dk4config.cpp
@@ -2,9 +2,23 @@
Redirect output from this program to the dk4conf.h file.
*/
-#include <stdio.h>
#include "config.h"
+#if HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
+#include <stdio.h>
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
/* wxWidgets_header_start */
#if HAVE_WXWIDGETS
#include <wx/wxprec.h>
@@ -12,13 +26,25 @@
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
-#if DK4_HAVE_WX_CHARTYPE_H
+#if HAVE_WX_CHARTYPE_H
+#if HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED 1
+#endif
+#endif
#ifndef WX_CHARTYPE_H_INCLUDED
#include <wx/chartype.h>
#define WX_CHARTYPE_H_INCLUDED 1
#endif
#else
-#if DK4_HAVE_WX_WXCHAR_H
+#if HAVE_WX_WXCHAR_H
+#if HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED 1
+#endif
+#endif
#ifndef WX_WXCHAR_H_INCLUDED
#include <wx/wxchar.h>
#define WX_WXCHAR_H_INCLUDED 1
@@ -38,7 +64,56 @@
#ifndef TRACE_DEBUG
#define TRACE_DEBUG 1
#endif
-int main(void)
+
+#if HAVE_LARGEFILE64_SOURCE
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int
+check_largefile64(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+int
+check_largefile64(void)
+{
+ int back = 0;
+#if (HAVE_INO64_T) && (HAVE_INO_T)
+ if (sizeof(ino64_t) > sizeof(ino_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE__INO64_T) && (HAVE__INO_T)
+ if (sizeof(_ino64_t) > sizeof(_ino_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE_OFF64_T) && (HAVE_OFF_T)
+ if (sizeof(off64_t) > sizeof(off_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE__OFF64_T) && (HAVE__OFF_T)
+ if (sizeof(_off64_t) > sizeof(_off_t)) {
+ back = 1;
+ }
+#endif
+#if (HAVE_STAT64) && (HAVE_STAT)
+ if (sizeof(struct stat64) > sizeof(struct stat)) {
+ back = 1;
+ }
+#endif
+ return back;
+}
+#endif
+
+
+int
+main(void)
{
fputs("/**\t@file dk4conf.h Fixed configure results.\n*/\n\n", stdout);
@@ -69,6 +144,14 @@ int main(void)
fputs("#define DK4_HAVE_ASSERT_H 0\n", stdout);
#endif
fputc('\n', stdout);
+#if HAVE_ATTRIBUTE_UNUSED
+ fputs("/** DK4 version of HAVE_ATTRIBUTE_UNUSED.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ATTRIBUTE_UNUSED 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ATTRIBUTE_UNUSED.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ATTRIBUTE_UNUSED 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if HAVE_BACKSLASH_AS_SEP
fputs("/** DK4 version of HAVE_BACKSLASH_AS_SEP.\n*/\n", stdout);
fputs("#define DK4_HAVE_BACKSLASH_AS_SEP 1\n", stdout);
@@ -117,6 +200,14 @@ int main(void)
fputs("#define DK4_HAVE_BLKSIZE_T 0\n", stdout);
#endif
fputc('\n', stdout);
+#if HAVE_BSEARCH
+ fputs("/** DK4 version of HAVE_BSEARCH.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BSEARCH 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_BSEARCH.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_BSEARCH 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if HAVE_BZERO
fputs("/** DK4 version of HAVE_BZERO.\n*/\n", stdout);
fputs("#define DK4_HAVE_BZERO 1\n", stdout);
@@ -597,6 +688,14 @@ int main(void)
fputs("#define DK4_HAVE_INET_PTON 0\n", stdout);
#endif
fputc('\n', stdout);
+#if HAVE_INITGROUPS
+ fputs("/** DK4 version of HAVE_INITGROUPS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INITGROUPS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_INITGROUPS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_INITGROUPS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if HAVE_INITSTATE
fputs("/** DK4 version of HAVE_INITSTATE.\n*/\n", stdout);
fputs("#define DK4_HAVE_INITSTATE 1\n", stdout);
@@ -701,6 +800,38 @@ int main(void)
fputs("#define DK4_HAVE_ISFINITE 0\n", stdout);
#endif
fputc('\n', stdout);
+#if HAVE_ISGREATER
+ fputs("/** DK4 version of HAVE_ISGREATER.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISGREATER 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISGREATER.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISGREATER 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISGREATEREQUAL
+ fputs("/** DK4 version of HAVE_ISGREATEREQUAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISGREATEREQUAL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISGREATEREQUAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISGREATEREQUAL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISLESS
+ fputs("/** DK4 version of HAVE_ISLESS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISLESS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISLESS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISLESS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_ISLESSEQUAL
+ fputs("/** DK4 version of HAVE_ISLESSEQUAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISLESSEQUAL 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_ISLESSEQUAL.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_ISLESSEQUAL 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if HAVE_ISNORMAL
fputs("/** DK4 version of HAVE_ISNORMAL.\n*/\n", stdout);
fputs("#define DK4_HAVE_ISNORMAL 1\n", stdout);
@@ -726,8 +857,13 @@ int main(void)
#endif
fputc('\n', stdout);
#if HAVE_LARGEFILE64_SOURCE
- fputs("/** DK4 version of HAVE_LARGEFILE64_SOURCE.\n*/\n", stdout);
- fputs("#define DK4_HAVE_LARGEFILE64_SOURCE 1\n", stdout);
+ if (0 != check_largefile64()) {
+ fputs("/** DK4 version of HAVE_LARGEFILE64_SOURCE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LARGEFILE64_SOURCE 1\n", stdout);
+ } else {
+ fputs("/** DK4 version of HAVE_LARGEFILE64_SOURCE.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_LARGEFILE64_SOURCE 0\n", stdout);
+ }
#else
fputs("/** DK4 version of HAVE_LARGEFILE64_SOURCE.\n*/\n", stdout);
fputs("#define DK4_HAVE_LARGEFILE64_SOURCE 0\n", stdout);
@@ -1037,6 +1173,14 @@ int main(void)
fputs("#define DK4_HAVE_PWD_H 0\n", stdout);
#endif
fputc('\n', stdout);
+#if HAVE_QSORT
+ fputs("/** DK4 version of HAVE_QSORT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_QSORT 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_QSORT.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_QSORT 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if HAVE_RAND
fputs("/** DK4 version of HAVE_RAND.\n*/\n", stdout);
fputs("#define DK4_HAVE_RAND 1\n", stdout);
@@ -1085,6 +1229,14 @@ int main(void)
fputs("#define DK4_HAVE_RMDIR 0\n", stdout);
#endif
fputc('\n', stdout);
+#if HAVE_SEARCH_H
+ fputs("/** DK4 version of HAVE_SEARCH_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SEARCH_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SEARCH_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SEARCH_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if HAVE_SELECT
fputs("/** DK4 version of HAVE_SELECT.\n*/\n", stdout);
fputs("#define DK4_HAVE_SELECT 1\n", stdout);
@@ -1125,6 +1277,14 @@ int main(void)
fputs("#define DK4_HAVE_SETGRENT 0\n", stdout);
#endif
fputc('\n', stdout);
+#if HAVE_SETGROUPS
+ fputs("/** DK4 version of HAVE_SETGROUPS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETGROUPS 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_SETGROUPS.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_SETGROUPS 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if HAVE_SETJMP_H
fputs("/** DK4 version of HAVE_SETJMP_H.\n*/\n", stdout);
fputs("#define DK4_HAVE_SETJMP_H 1\n", stdout);
@@ -1933,6 +2093,30 @@ int main(void)
fputs("#define DK4_HAVE_WXWIDGETS 0\n", stdout);
#endif
fputc('\n', stdout);
+#if HAVE_WX_CHARTYPE_H
+ fputs("/** DK4 version of HAVE_WX_CHARTYPE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_CHARTYPE_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WX_CHARTYPE_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_CHARTYPE_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WX_DEFS_H
+ fputs("/** DK4 version of HAVE_WX_DEFS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_DEFS_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WX_DEFS_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_DEFS_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
+#if HAVE_WX_WXCHAR_H
+ fputs("/** DK4 version of HAVE_WX_WXCHAR_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_WXCHAR_H 1\n", stdout);
+#else
+ fputs("/** DK4 version of HAVE_WX_WXCHAR_H.\n*/\n", stdout);
+ fputs("#define DK4_HAVE_WX_WXCHAR_H 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if HAVE_ZLIB_H
fputs("/** DK4 version of HAVE_ZLIB_H.\n*/\n", stdout);
fputs("#define DK4_HAVE_ZLIB_H 1\n", stdout);
@@ -2245,6 +2429,14 @@ int main(void)
fputs("#define DK4_SIZEOF_INT 0\n", stdout);
#endif
fputc('\n', stdout);
+#if SIZEOF_INT32_T
+ fputs("/** DK4 version of SIZEOF_INT32_T.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_INT32_T %u\n", (unsigned)SIZEOF_INT32_T);
+#else
+ fputs("/** DK4 version of SIZEOF_INT32_T.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_INT32_T 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if SIZEOF_INTMAX_T
fputs("/** DK4 version of SIZEOF_INTMAX_T.\n*/\n", stdout);
printf("#define DK4_SIZEOF_INTMAX_T %u\n", (unsigned)SIZEOF_INTMAX_T);
@@ -2333,6 +2525,14 @@ int main(void)
fputs("#define DK4_USE_FALLBACK_NUMERIC_LIMITS 0\n", stdout);
#endif
fputc('\n', stdout);
+#if USE_INLINE
+ fputs("/** DK4 version of USE_INLINE.\n*/\n", stdout);
+ printf("#define DK4_USE_INLINE %u\n", (unsigned)USE_INLINE);
+#else
+ fputs("/** DK4 version of USE_INLINE.\n*/\n", stdout);
+ fputs("#define DK4_USE_INLINE 0\n", stdout);
+#endif
+ fputc('\n', stdout);
#if USE_PRINTF_SCANF
fputs("/** DK4 version of USE_PRINTF_SCANF.\n*/\n", stdout);
printf("#define DK4_USE_PRINTF_SCANF %u\n", (unsigned)USE_PRINTF_SCANF);
@@ -2359,14 +2559,34 @@ int main(void)
fputc('\n', stdout);
/* wxWidgets_body_start */
#if HAVE_WXWIDGETS
- fputs("/** Size of wchar_t.\n*/\n", stdout);
+ fputs("/** Size of wxChar.\n*/\n", stdout);
printf("#define DK4_SIZEOF_WXCHAR %u\n\n", (unsigned)sizeof(wxChar));
+#if HAVE_WX_CHARTYPE_H
+ fputs("/** Size of wxStringCharType.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_WXSTRINGCHARTYPE %u\n\n", (unsigned)sizeof(wxStringCharType));
+#else
+ fputs("/** Size of wxStringCharType.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_WXSTRINGCHARTYPE 0\n\n", stdout);
+#endif
#else
- fputs("/** Size of wchar_t.\n*/\n", stdout);
+ fputs("/** Size of wxChar.\n*/\n", stdout);
fputs("#define DK4_SIZEOF_WXCHAR 0\n\n", stdout);
+ fputs("/** Size of wxStringCharType.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_WXSTRINGCHARTYPE 0\n\n", stdout);
#endif
/* wxWidgets_body_end */
+/* Large file support start */
+#if HAVE_LARGEFILE64_SOURCE
+ fputs("#if DK4_HAVE_LARGEFILE64_SOURCE\n", stdout);
+ fputs("#ifndef _LARGEFILE64_SOURCE\n", stdout);
+ fputs("/**\tUse 64 bit file support.\n*/\n", stdout);
+ fputs("#define _LARGEFILE64_SOURCE 1\n", stdout);
+ fputs("#endif\n", stdout);
+ fputs("#endif\n\n\n", stdout);
+#endif
+/* Large file support end */
+
fputs("#endif\n/* ifndef DK4CONF_H_INCLUDED */\n", stdout);
return 0;
}
diff --git a/support/dktools/dk4const.h b/support/dktools/dk4const.h
index f1a0285391..f0980a92b8 100644
--- a/support/dktools/dk4const.h
+++ b/support/dktools/dk4const.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file dk4const.h Numeric constants
for log level and string table entry length.
@@ -10,7 +15,11 @@ for log level and string table entry length.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
diff --git a/support/dktools/dk4cp850.c b/support/dktools/dk4cp850.c
new file mode 100644
index 0000000000..705bd06a4f
--- /dev/null
+++ b/support/dktools/dk4cp850.c
@@ -0,0 +1,133 @@
+/*
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4cp850.ctr
+*/
+
+/** @file dk4cp850.c The dk4cp850 module.
+*/
+
+
+#line 69 "dk4cp850.ctr"
+
+#include "dk4cp850.h"
+#include "dk4numco.h"
+
+
+
+/** Conversion table from char:CP850 to C32.
+*/
+static const unsigned long dk4cp850_table[] = {
+/* 00 */
+0x0000UL, 0x263AUL, 0x263BUL, 0x2665UL, 0x2666UL, 0x2663UL, 0x2660UL, 0x2022UL,
+0x25D8UL, 0x25CBUL, 0x25D9UL, 0x2642UL, 0x2640UL, 0x266AUL, 0x266BUL, 0x263CUL,
+
+/* 10 */
+0x25BAUL, 0x25C4UL, 0x2195UL, 0x203CUL, 0x00B6UL, 0x00A7UL, 0x25ACUL, 0x21A8UL,
+0x2191UL, 0x2193UL, 0x2192UL, 0x2190UL, 0x221FUL, 0x2194UL, 0x25B2UL, 0x25BCUL,
+
+/* 20 */
+0x0020UL, 0x0021UL, 0x0022UL, 0x0023UL, 0x0024UL, 0x0025UL, 0x0026UL, 0x0027UL,
+0x0028UL, 0x0029UL, 0x002AUL, 0x002BUL, 0x002CUL, 0x002DUL, 0x002EUL, 0x002FUL,
+
+/* 30 */
+0x0030UL, 0x0031UL, 0x0032UL, 0x0033UL, 0x0034UL, 0x0035UL, 0x0036UL, 0x0037UL,
+0x0038UL, 0x0039UL, 0x003AUL, 0x003BUL, 0x003CUL, 0x003DUL, 0x003EUL, 0x003FUL,
+
+/* 40 */
+0x0040UL, 0x0041UL, 0x0042UL, 0x0043UL, 0x0044UL, 0x0045UL, 0x0046UL, 0x0047UL,
+0x0048UL, 0x0049UL, 0x004AUL, 0x004BUL, 0x004CUL, 0x004DUL, 0x004EUL, 0x004FUL,
+
+/* 50 */
+0x0050UL, 0x0051UL, 0x0052UL, 0x0053UL, 0x0054UL, 0x0055UL, 0x0056UL, 0x0057UL,
+0x0058UL, 0x0059UL, 0x005AUL, 0x005BUL, 0x005CUL, 0x005DUL, 0x005EUL, 0x005FUL,
+
+/* 60 */
+0x0060UL, 0x0061UL, 0x0062UL, 0x0063UL, 0x0064UL, 0x0065UL, 0x0066UL, 0x0067UL,
+0x0068UL, 0x0069UL, 0x006AUL, 0x006BUL, 0x006CUL, 0x006DUL, 0x006EUL, 0x006FUL,
+
+/* 70 */
+0x0070UL, 0x0071UL, 0x0072UL, 0x0073UL, 0x0074UL, 0x0075UL, 0x0076UL, 0x0077UL,
+0x0078UL, 0x0079UL, 0x007AUL, 0x007BUL, 0x007CUL, 0x007DUL, 0x007EUL, 0x2302UL,
+
+/* 80 */
+0x00C7UL, 0x00FCUL, 0x00E9UL, 0x00E2UL, 0x00E4UL, 0x00E0UL, 0x00E5UL, 0x00E7UL,
+0x00EAUL, 0x00EBUL, 0x00E8UL, 0x00EFUL, 0x00EEUL, 0x00ECUL, 0x00C4UL, 0x00C5UL,
+
+/* 90 */
+0x00C9UL, 0x00E6UL, 0x00C6UL, 0x00F4UL, 0x00F6UL, 0x00F2UL, 0x00FBUL, 0x00F9UL,
+0x00FFUL, 0x00D6UL, 0x00DCUL, 0x00F8UL, 0x00A3UL, 0x00D8UL, 0x00D7UL, 0x0192UL,
+
+/* A0 */
+0x00E1UL, 0x00EDUL, 0x00F3UL, 0x00FAUL, 0x00F1UL, 0x00D1UL, 0x00AAUL, 0x00BAUL,
+0x00BFUL, 0x00AEUL, 0x00ACUL, 0x00BDUL, 0x00BCUL, 0x00A1UL, 0x00ABUL, 0x00BBUL,
+
+/* B0 */
+0x2591UL, 0x2592UL, 0x2593UL, 0x2502UL, 0x2524UL, 0x00C1UL, 0x00C2UL, 0x00C0UL,
+0x00A9UL, 0x2563UL, 0x2551UL, 0x2557UL, 0x255DUL, 0x00A2UL, 0x00A5UL, 0x2510UL,
+
+/* C0 */
+0x2514UL, 0x2534UL, 0x252CUL, 0x251CUL, 0x2500UL, 0x253CUL, 0x00E3UL, 0x00C3UL,
+0x255AUL, 0x2554UL, 0x2569UL, 0x2566UL, 0x2560UL, 0x2550UL, 0x256CUL, 0x00A4UL,
+
+/* D0 */
+0x00F0UL, 0x00D0UL, 0x00CAUL, 0x00CBUL, 0x00C8UL, 0x0131UL, 0x00CDUL, 0x00CEUL,
+0x00CFUL, 0x2518UL, 0x250CUL, 0x2588UL, 0x2584UL, 0x00A6UL, 0x00CCUL, 0x2580UL,
+
+/* E0 */
+0x00D3UL, 0x00DFUL, 0x00D4UL, 0x00D2UL, 0x00F5UL, 0x00D5UL, 0x00B5UL, 0x00FEUL,
+0x00DEUL, 0x00DAUL, 0x00DBUL, 0x00D9UL, 0x00FDUL, 0x00DDUL, 0x00AFUL, 0x00B4UL,
+
+/* F0 */
+0x00ADUL, 0x00B1UL, 0x2017UL, 0x00BEUL, 0x00B6UL, 0x00A7UL, 0x00F7UL, 0x00B8UL,
+0x00B0UL, 0x00A8UL, 0x00B7UL, 0x00B9UL, 0x00B3UL, 0x00B2UL, 0x25A0UL, 0x00A0UL
+};
+
+
+
+/** Table size (number of elements).
+*/
+static const size_t dk4cp850_sz_table =
+sizeof(dk4cp850_table)/sizeof(unsigned long);
+
+
+int
+dk4cp850_encode(unsigned char *dptr, dk4_c32_t c32)
+{
+ size_t i;
+ int back = 0;
+ if (NULL != dptr) {
+ for (i = 0; ((0 == back) && (i < dk4cp850_sz_table)); i++) {
+ if ( (dk4_c32_t)(dk4cp850_table[i]) == c32 ) {
+ *dptr = (unsigned char)i;
+ back = 1;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4cp850_decode(dk4_c32_t *dptr, unsigned char uc)
+{
+ int back = 0;
+ if (NULL != dptr) {
+ *dptr = (dk4_c32_t)(
+ dk4cp850_table[((size_t)uc) & ((size_t)0x000000FFUL)]
+ );
+ back = 1;
+ }
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4cp850.ctr b/support/dktools/dk4cp850.ctr
new file mode 100644
index 0000000000..bc5ff1a909
--- /dev/null
+++ b/support/dktools/dk4cp850.ctr
@@ -0,0 +1,183 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2015-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file
+ Character conversion from CP850 to UNICODE
+ and vice versa.
+
+ CRT on Windows: Not used.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Encode 32 bit character as CP850 character if possible.
+ @param dptr Pointer to result variable.
+ @param c32 Character to convert.
+ @return 1 on success, 0 on error (character c32 out of range).
+*/
+int
+dk4cp850_encode(unsigned char *dptr, dk4_c32_t c32);
+
+/** Retrieve 32 bit character from CP850 encoded character.
+ @param dptr Pointer to result variable.
+ @param uc CP850 character to convert.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4cp850_decode(dk4_c32_t *dptr, unsigned char uc);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+%% module
+
+#include "dk4cp850.h"
+#include "dk4numco.h"
+
+
+
+/** Conversion table from char:CP850 to C32.
+*/
+static const unsigned long dk4cp850_table[] = {
+/* 00 */
+0x0000UL, 0x263AUL, 0x263BUL, 0x2665UL, 0x2666UL, 0x2663UL, 0x2660UL, 0x2022UL,
+0x25D8UL, 0x25CBUL, 0x25D9UL, 0x2642UL, 0x2640UL, 0x266AUL, 0x266BUL, 0x263CUL,
+
+/* 10 */
+0x25BAUL, 0x25C4UL, 0x2195UL, 0x203CUL, 0x00B6UL, 0x00A7UL, 0x25ACUL, 0x21A8UL,
+0x2191UL, 0x2193UL, 0x2192UL, 0x2190UL, 0x221FUL, 0x2194UL, 0x25B2UL, 0x25BCUL,
+
+/* 20 */
+0x0020UL, 0x0021UL, 0x0022UL, 0x0023UL, 0x0024UL, 0x0025UL, 0x0026UL, 0x0027UL,
+0x0028UL, 0x0029UL, 0x002AUL, 0x002BUL, 0x002CUL, 0x002DUL, 0x002EUL, 0x002FUL,
+
+/* 30 */
+0x0030UL, 0x0031UL, 0x0032UL, 0x0033UL, 0x0034UL, 0x0035UL, 0x0036UL, 0x0037UL,
+0x0038UL, 0x0039UL, 0x003AUL, 0x003BUL, 0x003CUL, 0x003DUL, 0x003EUL, 0x003FUL,
+
+/* 40 */
+0x0040UL, 0x0041UL, 0x0042UL, 0x0043UL, 0x0044UL, 0x0045UL, 0x0046UL, 0x0047UL,
+0x0048UL, 0x0049UL, 0x004AUL, 0x004BUL, 0x004CUL, 0x004DUL, 0x004EUL, 0x004FUL,
+
+/* 50 */
+0x0050UL, 0x0051UL, 0x0052UL, 0x0053UL, 0x0054UL, 0x0055UL, 0x0056UL, 0x0057UL,
+0x0058UL, 0x0059UL, 0x005AUL, 0x005BUL, 0x005CUL, 0x005DUL, 0x005EUL, 0x005FUL,
+
+/* 60 */
+0x0060UL, 0x0061UL, 0x0062UL, 0x0063UL, 0x0064UL, 0x0065UL, 0x0066UL, 0x0067UL,
+0x0068UL, 0x0069UL, 0x006AUL, 0x006BUL, 0x006CUL, 0x006DUL, 0x006EUL, 0x006FUL,
+
+/* 70 */
+0x0070UL, 0x0071UL, 0x0072UL, 0x0073UL, 0x0074UL, 0x0075UL, 0x0076UL, 0x0077UL,
+0x0078UL, 0x0079UL, 0x007AUL, 0x007BUL, 0x007CUL, 0x007DUL, 0x007EUL, 0x2302UL,
+
+/* 80 */
+0x00C7UL, 0x00FCUL, 0x00E9UL, 0x00E2UL, 0x00E4UL, 0x00E0UL, 0x00E5UL, 0x00E7UL,
+0x00EAUL, 0x00EBUL, 0x00E8UL, 0x00EFUL, 0x00EEUL, 0x00ECUL, 0x00C4UL, 0x00C5UL,
+
+/* 90 */
+0x00C9UL, 0x00E6UL, 0x00C6UL, 0x00F4UL, 0x00F6UL, 0x00F2UL, 0x00FBUL, 0x00F9UL,
+0x00FFUL, 0x00D6UL, 0x00DCUL, 0x00F8UL, 0x00A3UL, 0x00D8UL, 0x00D7UL, 0x0192UL,
+
+/* A0 */
+0x00E1UL, 0x00EDUL, 0x00F3UL, 0x00FAUL, 0x00F1UL, 0x00D1UL, 0x00AAUL, 0x00BAUL,
+0x00BFUL, 0x00AEUL, 0x00ACUL, 0x00BDUL, 0x00BCUL, 0x00A1UL, 0x00ABUL, 0x00BBUL,
+
+/* B0 */
+0x2591UL, 0x2592UL, 0x2593UL, 0x2502UL, 0x2524UL, 0x00C1UL, 0x00C2UL, 0x00C0UL,
+0x00A9UL, 0x2563UL, 0x2551UL, 0x2557UL, 0x255DUL, 0x00A2UL, 0x00A5UL, 0x2510UL,
+
+/* C0 */
+0x2514UL, 0x2534UL, 0x252CUL, 0x251CUL, 0x2500UL, 0x253CUL, 0x00E3UL, 0x00C3UL,
+0x255AUL, 0x2554UL, 0x2569UL, 0x2566UL, 0x2560UL, 0x2550UL, 0x256CUL, 0x00A4UL,
+
+/* D0 */
+0x00F0UL, 0x00D0UL, 0x00CAUL, 0x00CBUL, 0x00C8UL, 0x0131UL, 0x00CDUL, 0x00CEUL,
+0x00CFUL, 0x2518UL, 0x250CUL, 0x2588UL, 0x2584UL, 0x00A6UL, 0x00CCUL, 0x2580UL,
+
+/* E0 */
+0x00D3UL, 0x00DFUL, 0x00D4UL, 0x00D2UL, 0x00F5UL, 0x00D5UL, 0x00B5UL, 0x00FEUL,
+0x00DEUL, 0x00DAUL, 0x00DBUL, 0x00D9UL, 0x00FDUL, 0x00DDUL, 0x00AFUL, 0x00B4UL,
+
+/* F0 */
+0x00ADUL, 0x00B1UL, 0x2017UL, 0x00BEUL, 0x00B6UL, 0x00A7UL, 0x00F7UL, 0x00B8UL,
+0x00B0UL, 0x00A8UL, 0x00B7UL, 0x00B9UL, 0x00B3UL, 0x00B2UL, 0x25A0UL, 0x00A0UL
+};
+
+
+
+/** Table size (number of elements).
+*/
+static const size_t dk4cp850_sz_table =
+sizeof(dk4cp850_table)/sizeof(unsigned long);
+
+
+int
+dk4cp850_encode(unsigned char *dptr, dk4_c32_t c32)
+{
+ size_t i;
+ int back = 0;
+ if (NULL != dptr) {
+ for (i = 0; ((0 == back) && (i < dk4cp850_sz_table)); i++) {
+ if ( (dk4_c32_t)(dk4cp850_table[i]) == c32 ) {
+ *dptr = (unsigned char)i;
+ back = 1;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4cp850_decode(dk4_c32_t *dptr, unsigned char uc)
+{
+ int back = 0;
+ if (NULL != dptr) {
+ *dptr = (dk4_c32_t)(
+ dk4cp850_table[((size_t)uc) & ((size_t)0x000000FFUL)]
+ );
+ back = 1;
+ }
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4cp850.h b/support/dktools/dk4cp850.h
new file mode 100644
index 0000000000..04393e4aaf
--- /dev/null
+++ b/support/dktools/dk4cp850.h
@@ -0,0 +1,79 @@
+/*
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4cp850.ctr
+*/
+
+#ifndef DK4CP850_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4CP850_H_INCLUDED 1
+
+
+#line 10 "dk4cp850.ctr"
+
+/** @file
+ Character conversion from CP850 to UNICODE
+ and vice versa.
+
+ CRT on Windows: Not used.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Encode 32 bit character as CP850 character if possible.
+ @param dptr Pointer to result variable.
+ @param c32 Character to convert.
+ @return 1 on success, 0 on error (character c32 out of range).
+*/
+int
+dk4cp850_encode(unsigned char *dptr, dk4_c32_t c32);
+
+/** Retrieve 32 bit character from CP850 encoded character.
+ @param dptr Pointer to result variable.
+ @param uc CP850 character to convert.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4cp850_decode(dk4_c32_t *dptr, unsigned char uc);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#endif
diff --git a/support/dktools/dk4cs.c b/support/dktools/dk4cs.c
new file mode 100644
index 0000000000..1dccad682f
--- /dev/null
+++ b/support/dktools/dk4cs.c
@@ -0,0 +1,2386 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4cs.ctr
+*/
+
+/** @file dk4cs.c The dk4cs module.
+*/
+
+
+#line 702 "dk4cs.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#include "dk4cs.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 741 "dk4cs.ctr"
+
+
+
+/** Names for the conversion methods from RGB to CMYK.
+*/
+static const dkChar * const dk4cs_rgb_to_cmyk_names[] = {
+/* 0 */
+dkT("n$on-standard"),
+
+/* 1 */
+dkT("s$tandard"),
+
+NULL
+
+
+#line 757 "dk4cs.ctr"
+};
+
+
+/** Names for the conversion methods from RGB to GRAY.
+*/
+static const dkChar * const dk4cs_rgb_to_gray_names[] = {
+/* 0 */
+dkT("l$uminance"),
+
+/* 1 */
+dkT("in$accurate"),
+
+/* 2 */
+dkT("fast"),
+
+/* 3 */
+dkT("fastest"),
+
+/* 4 */
+dkT("it$u-bt709"),
+
+/* 5 */
+dkT("a$verage"),
+
+/* 6 */
+dkT("d$esaturation"),
+
+/* 7 */
+dkT("mi$n-decomposition"),
+
+/* 8 */
+dkT("me$dium-decomposition"),
+
+/* 9 */
+dkT("ma$x-decomposition"),
+
+/* 10 */
+dkT("r$ed"),
+
+/* 11 */
+dkT("g$reen"),
+
+/* 12 */
+dkT("b$lue"),
+
+NULL
+
+
+#line 817 "dk4cs.ctr"
+};
+
+
+
+/** Names of alpha channel handling mechanisms.
+*/
+static const dkChar * const dk4cs_alpha_names[] = {
+/* 0 */
+dkT("m$ix"),
+
+/* 1 */
+dkT("i$gnore"),
+
+NULL
+
+
+#line 828 "dk4cs.ctr"
+};
+
+
+
+int
+dk4cs_context_init(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 840 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ /*
+ Initialize all components
+ */
+ pctx->rgb_to_cmyk = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+ pctx->rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601;
+ pctx->alpha = DK4_CS_CONV_ALPHA_MIX;
+ /*
+ Indicate success
+ */
+ back = 1;
+ }
+ else {
+
+#line 856 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 858 "dk4cs.ctr"
+ return back;
+}
+
+
+
+dk4_cs_conv_ctx_t *
+dk4cs_context_open(
+ dk4_er_t *erp
+)
+{
+ dk4_cs_conv_ctx_t *back;
+
+
+#line 870 "dk4cs.ctr"
+ back = dk4mem_new(dk4_cs_conv_ctx_t,1,erp);
+ if (NULL != back) {
+ (void)dk4cs_context_init(back, NULL);
+ }
+
+#line 874 "dk4cs.ctr"
+ return back;
+}
+
+
+
+int
+dk4cs_context_set_rgb_to_cmyk(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_rgb_to_cmyk_t rgb_to_cmyk,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 888 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ pctx->rgb_to_cmyk = rgb_to_cmyk;
+ back = 1;
+ }
+ else {
+
+#line 896 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 898 "dk4cs.ctr"
+ return back;
+}
+
+
+
+int
+dk4cs_context_set_rgb_to_gray(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_rgb_to_gray_t rgb_to_gray,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 912 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ pctx->rgb_to_gray = rgb_to_gray;
+ back = 1;
+ }
+ else {
+
+#line 920 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 922 "dk4cs.ctr"
+ return back;
+}
+
+
+
+int
+dk4cs_context_set_alpha(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_alpha_t alpha,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 936 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ pctx->alpha = alpha;
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 946 "dk4cs.ctr"
+ return back;
+}
+
+
+
+int
+dk4cs_context_text_rgb_to_cmyk(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ int ind = 0; /* String index in array */
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+ assert(NULL != txt);
+#endif
+ if ((NULL == pctx) || (NULL == txt)) {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ ind = dk4str_abbr_index(dk4cs_rgb_to_cmyk_names, dkT('$'), txt, 0);
+ if (0 > ind) {
+ dk4error_set_simple_error_code(erp,DK4_E_SYNTAX);
+ goto finished;
+ }
+ pctx->rgb_to_cmyk = (dk4_cs_conv_rgb_to_cmyk_t)ind;
+ back = 1;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4cs_context_text_rgb_to_gray(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ int ind = 0; /* String index in array */
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+ assert(NULL != txt);
+#endif
+ if ((NULL == pctx) || (NULL == txt)) {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ ind = dk4str_abbr_index(dk4cs_rgb_to_gray_names, dkT('$'), txt, 0);
+ if (0 > ind) {
+ dk4error_set_simple_error_code(erp,DK4_E_SYNTAX);
+ goto finished;
+ }
+ pctx->rgb_to_gray = (dk4_cs_conv_rgb_to_gray_t)ind;
+ back = 1;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4cs_context_text_alpha(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ int ind = 0; /* String index in array */
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+ assert(NULL != txt);
+#endif
+ if ((NULL == pctx) || (NULL == txt)) {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ ind = dk4str_abbr_index(dk4cs_alpha_names, dkT('$'), txt, 0);
+ if (0 > ind) {
+ dk4error_set_simple_error_code(erp,DK4_E_SYNTAX);
+ goto finished;
+ }
+ pctx->alpha = (dk4_cs_conv_alpha_t)ind;
+ back = 1;
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4cs_context_close(
+ dk4_cs_conv_ctx_t *pctx
+)
+{
+
+
+#line 1050 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ dk4mem_free(pctx);
+ }
+
+#line 1056 "dk4cs.ctr"
+}
+
+
+
+dk4_px_t
+dk4cs_mix_alpha(dk4_px_t value, dk4_px_t alpha, dk4_px_t bg, dk4_px_t max)
+{
+
+
+#line 1064 "dk4cs.ctr"
+ return (
+ (dk4_px_t)(
+ (
+ ((unsigned long)value * (unsigned long)alpha)
+ + (
+ (unsigned long)bg
+ * ((unsigned long)max - (unsigned long)alpha)
+ )
+ ) / ((unsigned long)max)
+ )
+ );
+}
+
+
+
+double
+dk4cs_color_mix_alpha(
+ double v,
+ double a,
+ double b
+)
+{
+
+
+#line 1087 "dk4cs.ctr"
+ return ((v * a) + ((1.0 - a) * b));
+}
+
+
+
+dk4_px_t
+dk4cs_mix_rgb_to_gray(
+ unsigned long r,
+ unsigned long g,
+ unsigned long b,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ unsigned long min; /* Minimum of r g b */
+ unsigned long max; /* Maximum of r g b */
+ unsigned long back = 0UL;
+ dk4_cs_conv_rgb_to_gray_t alg = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601;
+
+
+#line 1105 "dk4cs.ctr"
+ if (NULL != pctx) { alg = pctx->rgb_to_gray; }
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE : {
+ back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN : {
+ back = g;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED : {
+ back = r;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION : {
+ back = r;
+ if (g > back) back = g;
+ if (b > back) back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION : {
+ if (r > g) {
+ if (g > b) {
+ back = g;
+ }
+ else {
+ if (r > b) {
+ back = b;
+ }
+ else {
+ back = r;
+ }
+ }
+ }
+ else {
+ if (g < b) {
+ back = g;
+ }
+ else {
+ if (r < b) {
+ back = b;
+ }
+ else {
+ back = r;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION : {
+ back = r;
+ if (g < back) back = g;
+ if (b < back) back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_DESATURATION : {
+ min = max = r;
+ if (g < min) min = g;
+ if (g > max) max = g;
+ if (b < min) min = b;
+ if (b > max) max = b;
+ back = (max + min) / 2UL;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709 : {
+ back = (2126UL * r + 7152UL * g + 722UL * b) / 10000UL;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_AVERAGE : {
+ back = (r + g + b) / 3UL;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST : {
+ back = ((r << 1) + ((g << 2) + g) + b) >> 3;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_FAST : {
+ back = (77UL * r + 151UL * g + 28UL * b) >> 8;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_LUMA : {
+ back = (30UL * r + 59UL * g + 11UL * b) / 100UL;
+ } break;
+ default : {
+ back = (299UL * r + 587UL * g + 114UL * b) / 1000UL;
+ } break;
+ }
+
+#line 1181 "dk4cs.ctr"
+ return ((dk4_px_t)back);
+}
+
+
+
+/** Convert pixel data RGB to CMYK
+ @param dptr Destination array address.
+ @param sptr Source array address.
+ @param max Maximum value for R, G, B, C, M, Y, and K.
+ @param pctx Conversion context, may be NULL.
+*/
+
+static
+void
+dk4cs_mix_rgb_to_cmyk(
+ dk4_px_t *dptr,
+ dk4_px_t const *sptr,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ dk4_px_t maxrgb; /* Maximum of r g b */
+ dk4_px_t c; /* Cyan */
+ dk4_px_t m; /* Magenta */
+ dk4_px_t y; /* Yellow */
+ dk4_px_t k; /* Black */
+ dk4_cs_conv_rgb_to_cmyk_t rgb_to_cmyk = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+
+
+#line 1209 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+
+
+#line 1214 "dk4cs.ctr"
+
+
+#line 1215 "dk4cs.ctr"
+
+
+#line 1216 "dk4cs.ctr"
+ if (NULL != pctx) { rgb_to_cmyk = pctx->rgb_to_cmyk; }
+ maxrgb = sptr[0];
+ if (sptr[1] > maxrgb) { maxrgb = sptr[1]; }
+ if (sptr[2] > maxrgb) { maxrgb = sptr[2]; }
+ k = max - maxrgb;
+ switch (rgb_to_cmyk) {
+ case DK4_CS_CONV_RGB_TO_CMYK_PS_PDF : {
+ c = maxrgb - sptr[0];
+ m = maxrgb - sptr[1];
+ y = maxrgb - sptr[2];
+ } break;
+ default : {
+ if ((dk4_px_t)0U == maxrgb) {
+ c = m = y = (dk4_px_t)0U;
+ }
+ else {
+ c = (dk4_px_t)(
+ (
+ ((unsigned long)max)
+ * (((unsigned long)maxrgb) - ((unsigned long)(sptr[0])))
+ ) / ((unsigned long)maxrgb)
+ );
+ m = (dk4_px_t)(
+ (
+ ((unsigned long)max)
+ * (((unsigned long)maxrgb) - ((unsigned long)(sptr[1])))
+ ) / ((unsigned long)maxrgb)
+ );
+ y = (dk4_px_t)(
+ (
+ ((unsigned long)max)
+ * (((unsigned long)maxrgb) - ((unsigned long)(sptr[2])))
+ ) / ((unsigned long)maxrgb)
+ );
+ }
+ } break;
+ }
+ dptr[0] = c; dptr[1] = m; dptr[2] = y; dptr[3] = k;
+
+
+#line 1255 "dk4cs.ctr"
+
+
+#line 1256 "dk4cs.ctr"
+
+
+#line 1257 "dk4cs.ctr"
+
+
+#line 1258 "dk4cs.ctr"
+
+
+#line 1259 "dk4cs.ctr"
+}
+
+
+
+/** Convert pixel data CMYK to RGB.
+ @param dptr Destination array address.
+ @param sptr Source array address.
+ @param max Maximum value for R, G, B, C, M, Y, and K.
+ @param pctx Conversion context, may be NULL.
+*/
+
+static
+void
+dk4cs_mix_cmyk_to_rgb(
+ dk4_px_t *dptr,
+ dk4_px_t const *sptr,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ dk4_cs_conv_rgb_to_cmyk_t alg = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+ dk4_px_t r; /* Red */
+ dk4_px_t g; /* Green */
+ dk4_px_t b; /* Blue */
+ dk4_px_t tr; /* Additional red component */
+ dk4_px_t tg; /* Additional green component */
+ dk4_px_t tb; /* Additional blue component */
+
+
+#line 1287 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+
+
+#line 1292 "dk4cs.ctr"
+
+
+#line 1293 "dk4cs.ctr"
+
+
+#line 1294 "dk4cs.ctr"
+
+
+#line 1295 "dk4cs.ctr"
+ if (NULL != pctx) { alg = pctx->rgb_to_cmyk; }
+ r = g = b = max - sptr[3];
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_CMYK_PS_PDF : {
+ /* Do nothing */
+ } break;
+ default : {
+ tr = (dk4_px_t)(
+ (((unsigned long)(sptr[0])) * ((unsigned long)(sptr[3])))
+ / ((unsigned long)max)
+ );
+ tg = (dk4_px_t)(
+ (((unsigned long)(sptr[1])) * ((unsigned long)(sptr[3])))
+ / ((unsigned long)max)
+ );
+ tb = (dk4_px_t)(
+ (((unsigned long)(sptr[2])) * ((unsigned long)(sptr[3])))
+ / ((unsigned long)max)
+ );
+ if ((max - tr) >= r) {
+ r += tr;
+ }
+ else {
+ r = max;
+ }
+ if ((max - tg) >= g) {
+ g += tg;
+ }
+ else {
+ g = max;
+ }
+ if ((max - tb) >= b) {
+ b += tb;
+ }
+ else {
+ b = max;
+ }
+ } break;
+ }
+ if (r >= sptr[0]) {
+ r -= sptr[0];
+ }
+ else {
+ r = 0;
+ }
+ if (g >= sptr[1]) {
+ g -= sptr[1];
+ }
+ else {
+ g = 0;
+ }
+ if (b >= sptr[2]) {
+ g -= sptr[2];
+ }
+ else {
+ g = 0;
+ }
+ dptr[0] = r;
+
+#line 1353 "dk4cs.ctr"
+ dptr[1] = g;
+
+#line 1354 "dk4cs.ctr"
+ dptr[2] = b;
+
+#line 1355 "dk4cs.ctr"
+
+
+#line 1356 "dk4cs.ctr"
+}
+
+
+
+size_t
+dk4cs_color_space_size(int cs)
+{
+ size_t back = 0;
+
+
+#line 1365 "dk4cs.ctr"
+ switch (cs) {
+ case DK4_CS_GRAY : {
+ back = 1;
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ back = 2;
+ } break;
+ case DK4_CS_RGB : {
+ back = 3;
+ } break;
+ case DK4_CS_RGB_ALPHA : case DK4_CS_CMYK : {
+ back = 4;
+ } break;
+ }
+
+#line 1379 "dk4cs.ctr"
+ return back;
+}
+
+
+
+void
+dk4cs_nc_px_convert(
+ dk4_px_t *dptr,
+ int dcs,
+ dk4_px_t const *sptr,
+ int scs,
+ dk4_px_t const *bptr,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ dk4_px_t myrgb[4]; /* Temporary pixel value */
+ size_t i; /* Traverse components when mixing */
+ dk4_cs_conv_alpha_t alpha; /* Alpha handling choice */
+
+
+#line 1399 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+ switch (scs) {
+ case DK4_CS_GRAY : {
+
+
+#line 1406 "dk4cs.ctr"
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 1409 "dk4cs.ctr"
+ dptr[0] = sptr[0];
+
+
+#line 1411 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 1414 "dk4cs.ctr"
+ dptr[0] = sptr[0];
+ dptr[1] = max;
+
+
+#line 1417 "dk4cs.ctr"
+
+
+#line 1418 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 1421 "dk4cs.ctr"
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+
+
+#line 1423 "dk4cs.ctr"
+
+
+#line 1424 "dk4cs.ctr"
+
+
+#line 1425 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 1428 "dk4cs.ctr"
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ dptr[3] = max;
+
+
+#line 1431 "dk4cs.ctr"
+
+
+#line 1432 "dk4cs.ctr"
+
+
+#line 1433 "dk4cs.ctr"
+
+
+#line 1434 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 1437 "dk4cs.ctr"
+ dptr[3] = max - sptr[0];
+ dptr[0] = dptr[1] = dptr[2] = 0;
+
+
+#line 1440 "dk4cs.ctr"
+
+
+#line 1441 "dk4cs.ctr"
+
+
+#line 1442 "dk4cs.ctr"
+
+
+#line 1443 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 1450 "dk4cs.ctr"
+
+
+#line 1451 "dk4cs.ctr"
+ alpha = DK4_CS_CONV_ALPHA_MIX;
+ if (NULL != pctx) { alpha = pctx->alpha; }
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 1456 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = sptr[0];
+ } break;
+ default : {
+ dptr[0] = dk4cs_mix_alpha(
+ sptr[0], sptr[1], bptr[0], max
+ );
+ } break;
+ }
+
+
+#line 1467 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 1470 "dk4cs.ctr"
+ dptr[0] = sptr[0];
+ dptr[1] = sptr[1];
+
+
+#line 1473 "dk4cs.ctr"
+
+
+#line 1474 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 1477 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ } break;
+ default : {
+ dptr[0] = dptr[1] = dptr[2] = dk4cs_mix_alpha(
+ sptr[0], sptr[1], bptr[0], max
+ );
+ } break;
+ }
+
+
+#line 1488 "dk4cs.ctr"
+
+
+#line 1489 "dk4cs.ctr"
+
+
+#line 1490 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 1493 "dk4cs.ctr"
+ dptr[3] = sptr[1];
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+
+
+#line 1496 "dk4cs.ctr"
+
+
+#line 1497 "dk4cs.ctr"
+
+
+#line 1498 "dk4cs.ctr"
+
+
+#line 1499 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 1502 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[3] = max - sptr[0];
+ } break;
+ default : {
+ dptr[3] = max - dk4cs_mix_alpha(
+ sptr[0], sptr[1], bptr[0], max
+ );
+ } break;
+ }
+ dptr[0] = dptr[1] = dptr[2] = 0;
+
+
+#line 1514 "dk4cs.ctr"
+
+
+#line 1515 "dk4cs.ctr"
+
+
+#line 1516 "dk4cs.ctr"
+
+
+#line 1517 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 1524 "dk4cs.ctr"
+
+
+#line 1525 "dk4cs.ctr"
+
+
+#line 1526 "dk4cs.ctr"
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 1529 "dk4cs.ctr"
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+
+
+#line 1533 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 1536 "dk4cs.ctr"
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ dptr[1] = max;
+
+
+#line 1541 "dk4cs.ctr"
+
+
+#line 1542 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 1545 "dk4cs.ctr"
+ dptr[0] = sptr[0];
+ dptr[1] = sptr[1];
+ dptr[2] = sptr[2];
+
+
+#line 1549 "dk4cs.ctr"
+
+
+#line 1550 "dk4cs.ctr"
+
+
+#line 1551 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 1554 "dk4cs.ctr"
+ dptr[0] = sptr[0];
+ dptr[1] = sptr[1];
+ dptr[2] = sptr[2];
+ dptr[3] = max;
+
+
+#line 1559 "dk4cs.ctr"
+
+
+#line 1560 "dk4cs.ctr"
+
+
+#line 1561 "dk4cs.ctr"
+
+
+#line 1562 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 1565 "dk4cs.ctr"
+ dk4cs_mix_rgb_to_cmyk(dptr, sptr, max, pctx);
+
+
+#line 1567 "dk4cs.ctr"
+
+
+#line 1568 "dk4cs.ctr"
+
+
+#line 1569 "dk4cs.ctr"
+
+
+#line 1570 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 1577 "dk4cs.ctr"
+
+
+#line 1578 "dk4cs.ctr"
+
+
+#line 1579 "dk4cs.ctr"
+
+
+#line 1580 "dk4cs.ctr"
+ alpha = DK4_CS_CONV_ALPHA_MIX;
+ if (NULL != pctx) { alpha = pctx->alpha; }
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 1585 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ } break;
+ default : {
+ for (i = 0; i < 3; i++) {
+ myrgb[i] = dk4cs_mix_alpha(
+ sptr[i], sptr[3], bptr[i], max
+ );
+ }
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ } break;
+ }
+
+
+#line 1603 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 1606 "dk4cs.ctr"
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ dptr[1] = sptr[3];
+
+
+#line 1611 "dk4cs.ctr"
+
+
+#line 1612 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 1615 "dk4cs.ctr"
+ for (i = 0; i < 3; i++) {
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[i] = sptr[i];
+ } break;
+ default : {
+ dptr[i] = dk4cs_mix_alpha(
+ sptr[i], sptr[3], bptr[i], max
+ );
+ } break;
+ }
+ }
+
+
+#line 1628 "dk4cs.ctr"
+
+
+#line 1629 "dk4cs.ctr"
+
+
+#line 1630 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 1633 "dk4cs.ctr"
+ for (i = 0; i < 4; i++) {
+ dptr[i] = sptr[i];
+ }
+
+
+#line 1637 "dk4cs.ctr"
+
+
+#line 1638 "dk4cs.ctr"
+
+
+#line 1639 "dk4cs.ctr"
+
+
+#line 1640 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 1643 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dk4cs_mix_rgb_to_cmyk(dptr, sptr, max, pctx);
+ } break;
+ default : {
+ for (i = 0; i < 3; i++) {
+ myrgb[i] = dk4cs_mix_alpha(
+ sptr[i], sptr[3], bptr[i], max
+ );
+ }
+ dk4cs_mix_rgb_to_cmyk(dptr, myrgb, max, pctx);
+ } break;
+ }
+
+
+#line 1657 "dk4cs.ctr"
+
+
+#line 1658 "dk4cs.ctr"
+
+
+#line 1659 "dk4cs.ctr"
+
+
+#line 1660 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 1667 "dk4cs.ctr"
+
+
+#line 1668 "dk4cs.ctr"
+
+
+#line 1669 "dk4cs.ctr"
+
+
+#line 1670 "dk4cs.ctr"
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 1673 "dk4cs.ctr"
+ dk4cs_mix_cmyk_to_rgb(myrgb, sptr, max, pctx);
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+
+
+#line 1678 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 1681 "dk4cs.ctr"
+ dk4cs_mix_cmyk_to_rgb(myrgb, sptr, max, pctx);
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ dptr[1] = max;
+
+
+#line 1687 "dk4cs.ctr"
+
+
+#line 1688 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 1691 "dk4cs.ctr"
+ dk4cs_mix_cmyk_to_rgb(dptr, sptr, max, pctx);
+
+
+#line 1693 "dk4cs.ctr"
+
+
+#line 1694 "dk4cs.ctr"
+
+
+#line 1695 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 1698 "dk4cs.ctr"
+ dk4cs_mix_cmyk_to_rgb(dptr, sptr, max, pctx);
+ dptr[3] = max;
+
+
+#line 1701 "dk4cs.ctr"
+
+
+#line 1702 "dk4cs.ctr"
+
+
+#line 1703 "dk4cs.ctr"
+
+
+#line 1704 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 1707 "dk4cs.ctr"
+ for (i = 0; i < 4; i++) {
+ dptr[i] = sptr[i];
+ }
+
+
+#line 1711 "dk4cs.ctr"
+
+
+#line 1712 "dk4cs.ctr"
+
+
+#line 1713 "dk4cs.ctr"
+
+
+#line 1714 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ default : {
+ } break;
+ }
+
+
+#line 1723 "dk4cs.ctr"
+}
+
+
+
+void
+dk4cs_px_convert(
+ dk4_px_t *dptr,
+ int dcs,
+ size_t dsz,
+ dk4_px_t const *sptr,
+ int scs,
+ size_t ssz,
+ dk4_px_t const *bptr,
+ size_t bsz,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+
+
+#line 1744 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != sptr);
+ assert(0 < ssz);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == dptr) {
+
+#line 1754 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_CS_MIN > dcs) || (DK4_CS_MAX < dcs)) {
+
+#line 1758 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (dsz < dk4cs_color_space_size(dcs)) {
+
+#line 1762 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == sptr) {
+
+#line 1766 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_CS_MIN > scs) || (DK4_CS_MAX < scs)) {
+
+#line 1770 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (ssz < dk4cs_color_space_size(scs)) {
+
+#line 1774 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((dk4_px_t)0U == max) {
+
+#line 1778 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < ssz; i++) {
+ if (max < sptr[i]) {
+
+#line 1783 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ switch (scs) {
+ case DK4_CS_GRAY_ALPHA :
+ case DK4_CS_RGB_ALPHA : {
+ if (NULL == bptr) {
+
+#line 1791 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (bsz < (dk4cs_color_space_size(scs) - 1)) {
+
+#line 1795 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < bsz; i++) {
+ if (max < bptr[i]) {
+
+#line 1800 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ } break;
+ }
+ /* Do conversion
+ */
+ dk4cs_nc_px_convert(dptr, dcs, sptr, scs, bptr, max, pctx);
+ finished:
+
+
+#line 1811 "dk4cs.ctr"
+ return;
+}
+
+
+
+double
+dk4cs_color_mix_rgb_to_gray(
+ double r,
+ double g,
+ double b,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ double min; /* Minimum of r g b */
+ double max; /* Maximum of r g b */
+ double back = 0.0;
+ dk4_cs_conv_rgb_to_gray_t alg = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601;
+
+
+#line 1829 "dk4cs.ctr"
+ if (NULL != pctx) { alg = pctx->rgb_to_gray; }
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE : {
+ back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN : {
+ back = g;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED : {
+ back = r;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION : {
+ back = r;
+ if (g > back) back = g;
+ if (b > back) back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION : {
+ if (r > g) {
+ if (g > b) {
+ back = g;
+ }
+ else {
+ if (r > b) {
+ back = b;
+ }
+ else {
+ back = r;
+ }
+ }
+ }
+ else {
+ if (g < b) {
+ back = g;
+ }
+ else {
+ if (r < b) {
+ back = b;
+ }
+ else {
+ back = r;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION : {
+ back = r;
+ if (g < back) back = g;
+ if (b < back) back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_DESATURATION : {
+ min = max = r;
+ if (g < min) min = g;
+ if (g > max) max = g;
+ if (b < min) min = b;
+ if (b > max) max = b;
+ back = (max + min) / 2.0;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709 : {
+ back = 0.2126*r + 0.7152*g + 0.0722*b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_AVERAGE : {
+ back = (r + g + b) / 3.0;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_LUMA : {
+ back = 0.3*r + 0.59*g + 0.11*b;
+ } break;
+ default : {
+ back = 0.299*r + 0.587*g + 0.114*b;
+ } break;
+ }
+
+#line 1899 "dk4cs.ctr"
+ return back;
+}
+
+
+
+/** Convert normalized color RGB to CMYK
+ @param dptr Address of result array (CMYK).
+ @param sptr Source values (RGB).
+ @param pctx Conversion context, may be NULL.
+*/
+
+static
+void
+dk4cs_color_mix_rgb_to_cmyk(
+ double *dptr,
+ const double *sptr,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ double c; /* Cyan */
+ double m; /* Magenta */
+ double y; /* Yellow */
+ double k; /* Black */
+ double maxrgb; /* Maximum of r g b */
+ int me; /* Flag: Math error */
+ dk4_cs_conv_rgb_to_cmyk_t alg = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+
+
+#line 1926 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+
+
+#line 1931 "dk4cs.ctr"
+
+
+#line 1932 "dk4cs.ctr"
+
+
+#line 1933 "dk4cs.ctr"
+ if (NULL != pctx) { alg = pctx->rgb_to_cmyk; }
+ maxrgb = sptr[0];
+ if (sptr[1] > maxrgb) { maxrgb = sptr[1]; }
+ if (sptr[2] > maxrgb) { maxrgb = sptr[2]; }
+ c = maxrgb - sptr[0];
+ m = maxrgb - sptr[1];
+ y = maxrgb - sptr[2];
+ k = 1.0 - maxrgb;
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_CMYK_PS_PDF : {
+ /* Nothing to do */
+ } break;
+ default : {
+ me = 0;
+ c = c / maxrgb; m = m / maxrgb ; y = y / maxrgb;
+ if (!(dk4ma_is_finite(c))) { me = 1; }
+ if (!(dk4ma_is_finite(m))) { me = 1; }
+ if (!(dk4ma_is_finite(y))) { me = 1; }
+ if ((0.0 > c) || (1.0 < c)) { me = 1; }
+ if ((0.0 > m) || (1.0 < m)) { me = 1; }
+ if ((0.0 > y) || (1.0 < y)) { me = 1; }
+ if (0 != me) {
+ c = m = y = 0.0; k = 1.0;
+ }
+ } break;
+ }
+ dptr[0] = c; dptr[1] = m; dptr[2] = y; dptr[3] = k;
+
+
+#line 1961 "dk4cs.ctr"
+
+
+#line 1962 "dk4cs.ctr"
+
+
+#line 1963 "dk4cs.ctr"
+
+
+#line 1964 "dk4cs.ctr"
+
+
+#line 1965 "dk4cs.ctr"
+}
+
+
+
+/** Convert normalized color CMYK to RGB.
+ @param dptr Address of result array.
+ @param sptr Address of source array.
+ @param pctx Conversion context, may be NULL.
+*/
+
+static
+void
+dk4cs_color_mix_cmyk_to_rgb(
+ double *dptr,
+ double const *sptr,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ double r; /* Red */
+ double g; /* Green */
+ double b; /* Blue */
+ dk4_cs_conv_rgb_to_cmyk_t alg = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+
+
+#line 1988 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+
+
+#line 1993 "dk4cs.ctr"
+
+
+#line 1994 "dk4cs.ctr"
+
+
+#line 1995 "dk4cs.ctr"
+
+
+#line 1996 "dk4cs.ctr"
+ if (NULL != pctx) { alg = pctx->rgb_to_cmyk; }
+ r = g = b = 1.0 - sptr[3];
+ r -= sptr[0];
+ g -= sptr[1];
+ b -= sptr[2];
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_CMYK_PS_PDF : {
+ /* Nothing to do */
+ } break;
+ default : {
+ r += (sptr[0] * sptr[3]);
+ g += (sptr[1] * sptr[3]);
+ b += (sptr[2] * sptr[3]);
+ } break;
+ }
+ if (0.0 > r) { r = 0.0; } if (1.0 < r) { r = 1.0; }
+ if (0.0 > g) { g = 0.0; } if (1.0 < g) { g = 1.0; }
+ if (0.0 > b) { b = 0.0; } if (1.0 < b) { b = 1.0; }
+ dptr[0] = r; dptr[1] = g; dptr[2] = b;
+
+
+#line 2016 "dk4cs.ctr"
+
+
+#line 2017 "dk4cs.ctr"
+
+
+#line 2018 "dk4cs.ctr"
+
+
+#line 2019 "dk4cs.ctr"
+}
+
+
+
+void
+dk4cs_nc_color_convert(
+ double *dptr,
+ int dcs,
+ double const *sptr,
+ int scs,
+ double const *bptr,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ double myrgb[4]; /* Temporary pixel data for mixing */
+ size_t i; /* Traverse all pixel components */
+ dk4_cs_conv_alpha_t alpha;
+
+
+#line 2037 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+ switch (scs) {
+ case DK4_CS_GRAY : {
+
+
+#line 2044 "dk4cs.ctr"
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 2047 "dk4cs.ctr"
+ dptr[0] = sptr[0];
+
+
+#line 2049 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 2052 "dk4cs.ctr"
+ dptr[0] = sptr[0];
+ dptr[1] = 1.0;
+
+
+#line 2055 "dk4cs.ctr"
+
+
+#line 2056 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 2059 "dk4cs.ctr"
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+
+
+#line 2061 "dk4cs.ctr"
+
+
+#line 2062 "dk4cs.ctr"
+
+
+#line 2063 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 2066 "dk4cs.ctr"
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ dptr[3] = 1.0;
+
+
+#line 2069 "dk4cs.ctr"
+
+
+#line 2070 "dk4cs.ctr"
+
+
+#line 2071 "dk4cs.ctr"
+
+
+#line 2072 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 2075 "dk4cs.ctr"
+ dptr[3] = 1.0 - sptr[0];
+ dptr[0] = dptr[1] = dptr[2] = 0.0;
+
+
+#line 2078 "dk4cs.ctr"
+
+
+#line 2079 "dk4cs.ctr"
+
+
+#line 2080 "dk4cs.ctr"
+
+
+#line 2081 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 2088 "dk4cs.ctr"
+
+
+#line 2089 "dk4cs.ctr"
+ alpha = DK4_CS_CONV_ALPHA_MIX;
+ if (NULL != pctx) { alpha = pctx->alpha; }
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 2094 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = sptr[0];
+ } break;
+ default : {
+ dptr[0] = dk4cs_color_mix_alpha(
+ sptr[0], sptr[1], bptr[0]
+ );
+ } break;
+ }
+
+
+#line 2105 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 2108 "dk4cs.ctr"
+ dptr[0] = sptr[0];
+ dptr[1] = sptr[1];
+
+
+#line 2111 "dk4cs.ctr"
+
+
+#line 2112 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 2115 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ } break;
+ default : {
+ dptr[0] = dptr[1] = dptr[2] =
+ dk4cs_color_mix_alpha(sptr[0], sptr[1], bptr[0]);
+ }
+ }
+
+
+#line 2125 "dk4cs.ctr"
+
+
+#line 2126 "dk4cs.ctr"
+
+
+#line 2127 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 2130 "dk4cs.ctr"
+ dptr[3] = sptr[1];
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+
+
+#line 2133 "dk4cs.ctr"
+
+
+#line 2134 "dk4cs.ctr"
+
+
+#line 2135 "dk4cs.ctr"
+
+
+#line 2136 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 2139 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[3] = 1.0 - sptr[0];
+ } break;
+ default : {
+ dptr[3] =
+ 1.0-dk4cs_color_mix_alpha(sptr[0],sptr[1],bptr[0]);
+ }
+ }
+ dptr[0] = dptr[1] = dptr[2] = 0.0;
+
+
+#line 2150 "dk4cs.ctr"
+
+
+#line 2151 "dk4cs.ctr"
+
+
+#line 2152 "dk4cs.ctr"
+
+
+#line 2153 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 2160 "dk4cs.ctr"
+
+
+#line 2161 "dk4cs.ctr"
+
+
+#line 2162 "dk4cs.ctr"
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 2165 "dk4cs.ctr"
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+
+
+#line 2169 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 2172 "dk4cs.ctr"
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ dptr[1] = 1.0;
+
+
+#line 2177 "dk4cs.ctr"
+
+
+#line 2178 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 2181 "dk4cs.ctr"
+ for (i = 0; i < 3; i++) {
+ dptr[i] = sptr[i];
+ }
+
+
+#line 2185 "dk4cs.ctr"
+
+
+#line 2186 "dk4cs.ctr"
+
+
+#line 2187 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 2190 "dk4cs.ctr"
+ for (i = 0; i < 3; i++) {
+ dptr[i] = sptr[i];
+ }
+ dptr[3] = 1.0;
+
+
+#line 2195 "dk4cs.ctr"
+
+
+#line 2196 "dk4cs.ctr"
+
+
+#line 2197 "dk4cs.ctr"
+
+
+#line 2198 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 2201 "dk4cs.ctr"
+ dk4cs_color_mix_rgb_to_cmyk(dptr, sptr, pctx);
+
+
+#line 2203 "dk4cs.ctr"
+
+
+#line 2204 "dk4cs.ctr"
+
+
+#line 2205 "dk4cs.ctr"
+
+
+#line 2206 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 2213 "dk4cs.ctr"
+
+
+#line 2214 "dk4cs.ctr"
+
+
+#line 2215 "dk4cs.ctr"
+
+
+#line 2216 "dk4cs.ctr"
+ alpha = DK4_CS_CONV_ALPHA_MIX;
+ if (NULL != pctx) { alpha = pctx->alpha; }
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 2221 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ } break;
+ default : {
+ for (i = 0; i < 3; i++) {
+ myrgb[i] = dk4cs_color_mix_alpha(
+ sptr[i], sptr[3], bptr[i]
+ );
+ }
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ }
+ }
+
+
+#line 2239 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 2242 "dk4cs.ctr"
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ dptr[1] = sptr[3];
+
+
+#line 2247 "dk4cs.ctr"
+
+
+#line 2248 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 2251 "dk4cs.ctr"
+ for (i = 0; i < 3; i++) {
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[i] = sptr[i];
+ } break;
+ default : {
+ dptr[i] = dk4cs_color_mix_alpha(
+ sptr[i], sptr[3], bptr[i]
+ );
+ } break;
+ }
+ }
+
+
+#line 2264 "dk4cs.ctr"
+
+
+#line 2265 "dk4cs.ctr"
+
+
+#line 2266 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 2269 "dk4cs.ctr"
+ for (i = 0; i < 4; i++) {
+ dptr[i] = sptr[i];
+ }
+
+
+#line 2273 "dk4cs.ctr"
+
+
+#line 2274 "dk4cs.ctr"
+
+
+#line 2275 "dk4cs.ctr"
+
+
+#line 2276 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 2279 "dk4cs.ctr"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dk4cs_color_mix_rgb_to_cmyk(dptr, sptr, pctx);
+ } break;
+ default : {
+ for (i = 0; i < 3; i++) {
+ myrgb[i] = dk4cs_color_mix_alpha(
+ sptr[i], sptr[3], bptr[i]
+ );
+ }
+ dk4cs_color_mix_rgb_to_cmyk(dptr, myrgb, pctx);
+ } break;
+ }
+
+
+#line 2293 "dk4cs.ctr"
+
+
+#line 2294 "dk4cs.ctr"
+
+
+#line 2295 "dk4cs.ctr"
+
+
+#line 2296 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 2303 "dk4cs.ctr"
+
+
+#line 2304 "dk4cs.ctr"
+
+
+#line 2305 "dk4cs.ctr"
+
+
+#line 2306 "dk4cs.ctr"
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+
+
+#line 2309 "dk4cs.ctr"
+ dk4cs_color_mix_cmyk_to_rgb(myrgb, sptr, pctx);
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+
+
+#line 2314 "dk4cs.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 2317 "dk4cs.ctr"
+ dk4cs_color_mix_cmyk_to_rgb(myrgb, sptr, pctx);
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ dptr[1] = 1.0;
+
+
+#line 2323 "dk4cs.ctr"
+
+
+#line 2324 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+
+#line 2327 "dk4cs.ctr"
+ dk4cs_color_mix_cmyk_to_rgb(dptr, sptr, pctx);
+
+
+#line 2329 "dk4cs.ctr"
+
+
+#line 2330 "dk4cs.ctr"
+
+
+#line 2331 "dk4cs.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+
+#line 2334 "dk4cs.ctr"
+ dk4cs_color_mix_cmyk_to_rgb(dptr, sptr, pctx);
+ dptr[3] = 1.0;
+
+
+#line 2337 "dk4cs.ctr"
+
+
+#line 2338 "dk4cs.ctr"
+
+
+#line 2339 "dk4cs.ctr"
+
+
+#line 2340 "dk4cs.ctr"
+ } break;
+ case DK4_CS_CMYK : {
+
+
+#line 2343 "dk4cs.ctr"
+ for (i = 0; i < 4; i++) {
+ dptr[i] = sptr[i];
+ }
+
+
+#line 2347 "dk4cs.ctr"
+
+
+#line 2348 "dk4cs.ctr"
+
+
+#line 2349 "dk4cs.ctr"
+
+
+#line 2350 "dk4cs.ctr"
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ default : {
+ } break;
+ }
+
+
+#line 2359 "dk4cs.ctr"
+}
+
+
+
+void
+dk4cs_color_convert(
+ double *dptr,
+ int dcs,
+ size_t dsz,
+ double const *sptr,
+ int scs,
+ size_t ssz,
+ double const *bptr,
+ size_t bsz,
+ dk4_cs_conv_ctx_t const *pctx,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+
+
+#line 2379 "dk4cs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != sptr);
+ assert(0 < ssz);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == dptr) {
+
+#line 2389 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_CS_MIN > dcs) || (DK4_CS_MAX < dcs)) {
+
+#line 2393 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (dsz < dk4cs_color_space_size(dcs)) {
+
+#line 2397 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == sptr) {
+
+#line 2401 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_CS_MIN > scs) || (DK4_CS_MAX < scs)) {
+
+#line 2405 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (ssz < dk4cs_color_space_size(scs)) {
+
+#line 2409 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < ssz; i++) {
+ if ((0.0 > sptr[i]) || (1.0 < sptr[i])) {
+
+#line 2414 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ switch (scs) {
+ case DK4_CS_GRAY_ALPHA :
+ case DK4_CS_RGB_ALPHA : {
+ if (NULL == bptr) {
+
+#line 2422 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (bsz < (dk4cs_color_space_size(scs) - 1)) {
+
+#line 2426 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < bsz; i++) {
+ if ((0.0 > bptr[i]) || (1.0 < bptr[i])) {
+
+#line 2431 "dk4cs.ctr"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ } break;
+ }
+ /* Do conversion
+ */
+ dk4cs_nc_color_convert(dptr, dcs, sptr, scs, bptr, pctx);
+ finished:
+
+
+#line 2442 "dk4cs.ctr"
+ return;
+}
+
+
+
+int
+dk4cs_check(int cs)
+{
+ int back = 0;
+ if ((DK4_CS_MIN <= cs) && (DK4_CS_MAX >= cs)) {
+ back = 1;
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4cs.ctr b/support/dktools/dk4cs.ctr
new file mode 100644
index 0000000000..2db878f282
--- /dev/null
+++ b/support/dktools/dk4cs.ctr
@@ -0,0 +1,2460 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4cs.h Color spaces, especially for bitmap images.
+
+This module provides color space conversion functions.
+
+Note: You should not use this module for conversion from other color spaces
+to CMYK or vice versa. Conversion to CMYK should be done by professional
+programs, as the conversion depends on the production process, the used
+inks, and the used paper. Professional conversion programs use color profiles
+and let you choose a number of settings. This module uses just simple
+formulas.
+
+The following symbols are used in formulas below:
+
+Symbol | Meaning
+:----: | :-----:
+d | Bit depth (integer), number of bits per component (sample)
+M | Maximum component value (integer), 2^d-1
+r | Red component for a pixel (integer), 0<=r<=M
+g | Green component for a pixel (integer), 0<=r<=M
+b | Blue component for a pixel (integer), 0<=b<=M
+e | Gray value for a pixel (integer), 0<=e<=M
+c | Cyan component for a pixel (integer), 0<=c<=M
+m | Magenta component for a pixel (integer), 0<=m<=M
+y | Yellow component for pixel (integer), 0<=y<=M
+k | Black or key component for a pixel (integer), 0<=k<=M
+maxrgb | Maximum value of r, g, and b (integer), 0<=maxrgb<=M
+mincmy | Minimum value of c, m, and y (integer), 0<=mincmy<=M
+r' | Normalized red component (floating point), 0.0<=r'<=1.0
+g' | Normalized green component (floating point), 0.0<=g'<=1.0
+b' | Normalized blue component (floating point), 0.0<=b'<=1.0
+e' | Normalized gray component (floating point), 0.0<=e'<=1.0
+c' | Normalized cyan component (floating point), 0.0<=c'<=1.0
+m' | Normalized magenta component (floating point), 0.0<=m'<=1.0
+y' | Normalized yellow component (floating point), 0.0<=y'<=1.0
+k' | Normalized black component (floating point), 0.0<=k'<=1.0
+maxrgb' | Normalized red component (floating point), 0.0<=maxrgb'<=1.0
+mincmy' | Normalized red component (floating point), 0.0<=mincmy'<=1.0
+ucr(x) | Undercolour removal function, maps [0,1] to [0,1]
+bg(x) | Black generation function, maps [0,1] to [0,1]
+
+To switch from default algorithms to other algorithms, open a
+conversion context, set up the conversion context, pass the context to
+the conversion functions and close the context when no longer needed.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4PX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4px.h"
+#else
+#include <dktools-4/dk4px.h>
+#endif
+#endif
+
+
+/** Color spaces used by the images we want to process.
+*/
+enum {
+ DK4_CS_GRAY = 0 , /**< Gray. */
+ DK4_CS_GRAY_ALPHA , /**< Gray, opacity. */
+ DK4_CS_RGB , /**< Red, green, blue. */
+ DK4_CS_RGB_ALPHA , /**< Red, green, blue, opacity. */
+ DK4_CS_CMYK , /**< Cyan, magentam, yellow, black (key). */
+
+ DK4_CS_MIN = DK4_CS_GRAY , /**< Minimum value. */
+ DK4_CS_MAX = DK4_CS_CMYK /**< Maximum value. */
+};
+
+
+/** Choose algorithm to convert RGB to CMYK.
+*/
+typedef enum {
+
+ DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF = 0 ,
+
+ /**< Algorithm differing from PS/PDF standard.
+ Most web pages about color
+ conversion recommend the algorithm
+ like this (default):
+ @code
+ c' = 1 - r'
+ m' = 1 - g'
+ y' = 1 - b'
+ mincmy' = min{c',m',y'}
+ if 1 = mincmy'
+ then
+ k' = 1
+ c' = m' = y' = 0
+ else
+ k' = mincmy'
+ c' = (c' - k') / (1 - k')
+ m' = (m' - k') / (1 - k')
+ y' = (y' - k') / (1 - k')
+ endif
+ @endcode
+ Substitution results in:
+ @code
+ maxrgb' = max{r',g',b'}
+ if 0 = maxrgb'
+ then
+ k' = 1
+ c' = m' = y' = 0
+ else
+ c' = (maxrgb' - r') / maxrgb'
+ m' = (maxrgb' - g') / maxrgb'
+ y' = (maxrgb' - b') / maxrgb'
+ k' = 1 - maxrgb'
+ endif
+ @endcode
+ The result for pixel components is:
+ @code
+ maxrgb = max{r,g,b}
+ if 0 = maxrgb
+ then
+ k = M
+ c = m = y = 0
+ else
+ c = (M * (maxrgb - r)) / maxrgb
+ m = (M * (maxrgb - g)) / maxrgb
+ y = (M * (maxrgb - b)) / maxrgb
+ k = M - maxrgb
+ endif
+ @endcode
+ */
+
+
+
+ DK4_CS_CONV_RGB_TO_CMYK_PS_PDF
+
+ /**< Algorithm as described in the PS and PDF standards.
+ @code
+ c' = 1 - r'
+ m' = 1 - g'
+ y' = 1 - b'
+ mincmy' = min{c',m',y'}
+ c' = c' - ucr(mincmy')
+ m' = m' - ucr(mincmy')
+ y' = y' - ucr(mincmy')
+ k' = bg(mincmy')
+ @endcode
+ Substitution and use of simplified
+ functions ucr(x)=x and bg(x)=x
+ results in:
+ @code
+ maxrgb' = max{r',g',b'}
+ c' = maxrgb' - r'
+ m' = maxrgb' - g'
+ y' = maxrgb' - b'
+ k' = 1 - maxrgb'
+ @endcode
+ The result for components values is:
+ @code
+ maxrgb = max{r,g,b}
+ c = maxrgb - r
+ m = maxrgb - g
+ y = maxrgb - b
+ k = M - maxrgb
+ @endcode
+ */
+
+} dk4_cs_conv_rgb_to_cmyk_t;
+
+
+
+/** How to convert RGB to gray.
+*/
+typedef enum {
+ /** Reproduce luminance (default).
+ @code
+ e' = 0.299 * r' + 0.587 * g' + 0.114 * b'
+ e = (299 * r + 587 * g + 114 * b) / 1000
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601 = 0,
+
+
+ /** Reproduce luminance.
+ Same as above but reduced number of digits
+ in the coefficients.
+ @code
+ e' = 0.3 * r' + 0.59 * g' + 0.11 * b'
+ e = (30 * r + 59 * g + 11 * b) / 100
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_LUMA ,
+
+ /** Reproduce luminance,
+ use alternative coefficients.
+ @code
+ e' = 0.2126 * r' + 0.7152 * g' + 0.0722 * b'
+ e = (2126 * r + 7152 * g + 722 * b) / 10000
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709 ,
+
+
+ /** Faster approximation for pixel values.
+ @code
+ e = (77 * r + 151 * g + 28 * b) >> 8
+ @endcode
+ For normalized colors use
+ @code
+ e' = 0.299 * r' + 0.587 * g' + 0.114 * b'
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_FAST ,
+
+
+ /** Still faster - and more inaccurate -
+ approximation for pixel values.
+ @code
+ e = ((r << 1) + ((g << 2) + g) + b) >> 3
+ @endcode
+ is a fast implementation of
+ @code
+ e = (2 * r + 5 * g + b) / 8
+ @endcode
+ For normalized colors use
+ @code
+ e' = 0.299 * r' + 0.587 * g' + 0.114 * b'
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST ,
+
+ /** Use average.
+ @code
+ e' = (r' + g' + b') / 3
+ e = (r + g + b) / 3
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_AVERAGE ,
+
+
+ /** Desaturation.
+ Flatter than luminance, less contrast.
+ @code
+ e' = (max{r',g',b'} + min{r',g',b'}) / 2
+ e = (max{r,b,b} + min{r,g,b}) / 2
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_DESATURATION ,
+
+
+ /** Minimum decomposition.
+ Produces dark images.
+ @code
+ e' = min{r',g',b'}
+ e = min{r,g,b}
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION ,
+
+ /** Medium value decomposition
+ (not minimum, not maximum).
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION ,
+
+
+ /** Maximum decomposition.
+ Produces bright images.
+ @code
+ e' = max{r',g',b'}
+ e = max{r,g,b}
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION ,
+
+
+ /** Use just red channel.
+ @code
+ e' = r'
+ e = r
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED ,
+
+
+ /** Use just green channel.
+ @code
+ e' = g'
+ e = g
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN ,
+
+
+ /** Use just blue channel.
+ @code
+ e' = b'
+ e = b
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE ,
+
+ /** Minimum value.
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MIN = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601 ,
+
+ /** Maximum value.
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MAX = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE
+
+} dk4_cs_conv_rgb_to_gray_t;
+
+
+
+/** How to handle alpha channel.
+ Only used when converting from a color space containing alpha data
+ to a color space not containing alpha data.
+*/
+typedef enum {
+ /** Mix against specified background.
+ */
+ DK4_CS_CONV_ALPHA_MIX = 0,
+
+ /** Ignore alpha value, just return foreground.
+ */
+ DK4_CS_CONV_ALPHA_FOREGROUND
+
+} dk4_cs_conv_alpha_t;
+
+
+
+/** Conversion context containing setup details for conversions.
+*/
+
+typedef struct {
+ dk4_cs_conv_rgb_to_cmyk_t rgb_to_cmyk; /**< RGB to CMYK. */
+ dk4_cs_conv_rgb_to_gray_t rgb_to_gray; /**< RGB to gray. */
+ dk4_cs_conv_alpha_t alpha; /**< Alpha channel handling. */
+} dk4_cs_conv_ctx_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Create new conversion context and initialize it.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem
+ set if there is not enough memory available.
+*/
+
+dk4_cs_conv_ctx_t *
+dk4cs_context_open(
+ dk4_er_t *erp
+);
+
+
+/** Initialize a conversion context.
+ @param pctx Context to set up.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx is NULL.
+*/
+
+int
+dk4cs_context_init(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_er_t *erp
+);
+
+
+/** Set RGB to CMYK handling in a conversion context.
+ @param pctx Context to set up.
+ @param rgb_to_cmyk Details for RGB to CMYK conversion.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx is NULL.
+*/
+
+int
+dk4cs_context_set_rgb_to_cmyk(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_rgb_to_cmyk_t rgb_to_cmyk,
+ dk4_er_t *erp
+);
+
+
+/** Set RGB to gray handling in a conversion context.
+ @param pctx Context to set up.
+ @param rgb_to_gray Details or RGB to gray conversion.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx is NULL.
+*/
+
+int
+dk4cs_context_set_rgb_to_gray(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_rgb_to_gray_t rgb_to_gray,
+ dk4_er_t *erp
+);
+
+
+/** Set alpha channel handling.
+ @param pctx Context to set up.
+ @param alpha Alpha channel handling method.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx is NULL.
+*/
+
+int
+dk4cs_context_set_alpha(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_alpha_t alpha,
+ dk4_er_t *erp
+);
+
+/** Destroy conversion context, release resources.
+ @param pctx Conversion context to close.
+*/
+
+void
+dk4cs_context_close(
+ dk4_cs_conv_ctx_t *pctx
+);
+
+
+/** Convert pixel data from one color space into another, samples are dk4_px_t.
+ @param dptr Address of destination array.
+ @param dcs Destination color space.
+ @param dsz Size of destination array (number of elements).
+ @param sptr Address of source array.
+ @param scs Source color space.
+ @param ssz Source array size (number of elements).
+ @param bptr Address of background array, may be NULL.
+ @param bsz Size of background array (number of elements), may be 0.
+ @param max Maximum value for a component.
+ @param pctx Conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if anything is wrong with arguments, i.e.:
+ * dptr or sptr is NULL,
+ * dcs or scs is not a valid color space,
+ * dsz or ssz is too small for the color space,
+ * max is 0,
+ * one of the sptr components is larger than max
+ * a background is required but bptr is NULL, bsz is too small
+ for the colro space or one of the background components is larger
+ than max.
+*/
+
+void
+dk4cs_px_convert(
+ dk4_px_t *dptr,
+ int dcs,
+ size_t dsz,
+ dk4_px_t const *sptr,
+ int scs,
+ size_t ssz,
+ dk4_px_t const *bptr,
+ size_t bsz,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx,
+ dk4_er_t *erp
+);
+
+
+/** Convert pixel data from one color space into another, samples are double.
+ @param dptr Address of destination array, values in interval [0;1].
+ @param dcs Destination color space.
+ @param dsz Size of destination array (number of elements).
+ @param sptr Address of source array, values in interval [0;1].
+ @param scs Source color space.
+ @param ssz Source array size (number of elements).
+ @param bptr Address of background array, values in [0;1], may be NULL.
+ @param bsz Size of background array (number of elements), may be 0.
+ @param pctx Conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if anything is wrong with arguments, i.e.:
+ * dptr or sptr is NULL,
+ * dcs or scs is not a valid color space,
+ * dsz or ssz is too small for the color space,
+ * one of the sptr components is out of interval [0;1],
+ * a background is required but bptr is NULL, bsz is too small
+ for the colro space or one of the background components is
+ out of interval [0;1].
+*/
+
+void
+dk4cs_color_convert(
+ double *dptr,
+ int dcs,
+ size_t dsz,
+ double const *sptr,
+ int scs,
+ size_t ssz,
+ double const *bptr,
+ size_t bsz,
+ dk4_cs_conv_ctx_t const *pctx,
+ dk4_er_t *erp
+);
+
+
+/** Mix pixel data foreground against background value.
+ @param value Foreground value.
+ @param alpha Foreground opacity.
+ @param bg Background value.
+ @param max Maximum for foreground, background, and alpha.
+ @return Mixing result.
+*/
+
+dk4_px_t
+dk4cs_mix_alpha(
+ dk4_px_t value,
+ dk4_px_t alpha,
+ dk4_px_t bg,
+ dk4_px_t max
+);
+
+
+/** Mix pixel data RGB to gray.
+ @param r Red.
+ @param g Green.
+ @param b Blue.
+ @param pctx Conversion context, may be NULL.
+ @return Gray value for RGB pixel.
+*/
+
+dk4_px_t
+dk4cs_mix_rgb_to_gray(
+ unsigned long r,
+ unsigned long g,
+ unsigned long b,
+ dk4_cs_conv_ctx_t const *pctx
+);
+
+
+/** Mix normalized color foreground against background using alpha value.
+ @param v Foreground value, normalized.
+ @param a Alpha value, normalized.
+ @param b Background value, normalized.
+*/
+
+double
+dk4cs_color_mix_alpha(
+ double v,
+ double a,
+ double b
+);
+
+
+/** Mix normalized color RGB to gray
+ @param r Normalized red component.
+ @param g Normalized green component.
+ @param b Normalized blue component.
+ @param pctx Conversion context, may be NULL.
+ @return Gray value.
+*/
+
+double
+dk4cs_color_mix_rgb_to_gray(
+ double r,
+ double g,
+ double b,
+ dk4_cs_conv_ctx_t const *pctx
+);
+
+
+/** Retrieve number of components for a color space.
+ @param cs Color space.
+ @return Number of components in color space cs.
+*/
+
+size_t
+dk4cs_color_space_size(int cs);
+
+
+/** Check whether an integer number represents a valid color space.
+ @param cs Number to check.
+ @return 1 on success (cs is a color space), 0 otherwise.
+*/
+
+int
+dk4cs_check(int cs);
+
+
+/** Set RGB to CMYK conversion method from text.
+ @param pctx Context to set up.
+ @param txt Text containing the method name.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx or txt is NULL,
+ - DK4_E_SYNTAX<br>
+ if txt does not cotain a valid method name.
+*/
+
+int
+dk4cs_context_text_rgb_to_cmyk(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+);
+
+
+/** Set RGB to GRAY conversion method from text.
+ @param pctx Context to set up.
+ @param txt Text containing the method name.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx or txt is NULL,
+ - DK4_E_SYNTAX<br>
+ if txt does not cotain a valid method name.
+*/
+
+int
+dk4cs_context_text_rgb_to_gray(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+);
+
+
+/** Set alpha channel handling method.
+ @param pctx Context to set up.
+ @param txt Text containing the method name.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx or txt is NULL,
+ - DK4_E_SYNTAX<br>
+ if txt does not cotain a valid method name.
+*/
+
+int
+dk4cs_context_text_alpha(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#include "dk4bifty.h"
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#include "dk4cs.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Names for the conversion methods from RGB to CMYK.
+*/
+static const dkChar * const dk4cs_rgb_to_cmyk_names[] = {
+$!string-table macro=dkT
+#
+# Most web sites explain a method not matching the PS and PDF standard.
+#
+n$on-standard
+#
+# Do as in the PS and PDF standard.
+#
+s$tandard
+$!end
+};
+
+
+/** Names for the conversion methods from RGB to GRAY.
+*/
+static const dkChar * const dk4cs_rgb_to_gray_names[] = {
+$!string-table macro=dkT
+#
+# 0 Reproduce luminance
+#
+l$uminance
+#
+# 1 Reproduce luminance, just 2 digits
+#
+in$accurate
+#
+# 2 Faster method
+#
+fast
+#
+# 3 Faster but more inaccurate
+#
+fastest
+#
+# 4 ITU-BT709
+#
+it$u-bt709
+#
+# 5 Average (stupid method)
+#
+a$verage
+#
+# 6 Desaturation
+#
+d$esaturation
+#
+# 7 Minimum decomposition
+#
+mi$n-decomposition
+#
+# 8 Medium decomposition
+#
+me$dium-decomposition
+#
+# 9 Maximum decomposition
+#
+ma$x-decomposition
+#
+# 10 Just use red channel
+#
+r$ed
+#
+# 11 Just use green channel
+#
+g$reen
+#
+# 12 Just use blue channel
+#
+b$lue
+$!end
+};
+
+
+
+/** Names of alpha channel handling mechanisms.
+*/
+static const dkChar * const dk4cs_alpha_names[] = {
+$!string-table macro=dkT
+m$ix
+i$gnore
+$!end
+};
+
+
+
+int
+dk4cs_context_init(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4cs_context_init"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ /*
+ Initialize all components
+ */
+ pctx->rgb_to_cmyk = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+ pctx->rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601;
+ pctx->alpha = DK4_CS_CONV_ALPHA_MIX;
+ /*
+ Indicate success
+ */
+ back = 1;
+ }
+ else { $? "! pctx"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4cs_context_init %d", back
+ return back;
+}
+
+
+
+dk4_cs_conv_ctx_t *
+dk4cs_context_open(
+ dk4_er_t *erp
+)
+{
+ dk4_cs_conv_ctx_t *back;
+ $? "+ dk4_cs_conv_ctx_t"
+ back = dk4mem_new(dk4_cs_conv_ctx_t,1,erp);
+ if (NULL != back) {
+ (void)dk4cs_context_init(back, NULL);
+ } $? "- dk4_cs_conv_ctx_t %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+dk4cs_context_set_rgb_to_cmyk(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_rgb_to_cmyk_t rgb_to_cmyk,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4cs_context_set_rgb_to_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ pctx->rgb_to_cmyk = rgb_to_cmyk;
+ back = 1;
+ }
+ else { $? "! pctx"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4cs_context_set_rgb_to_cmyk %d", back
+ return back;
+}
+
+
+
+int
+dk4cs_context_set_rgb_to_gray(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_rgb_to_gray_t rgb_to_gray,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4cs_context_set_rgb_to_gray"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ pctx->rgb_to_gray = rgb_to_gray;
+ back = 1;
+ }
+ else { $? "! pctx"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4cs_context_set_rgb_to_gray %d", back
+ return back;
+}
+
+
+
+int
+dk4cs_context_set_alpha(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_alpha_t alpha,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4cs_context_set_alpha"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ pctx->alpha = alpha;
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4cs_context_set_alpha %d", back
+ return back;
+}
+
+
+
+int
+dk4cs_context_text_rgb_to_cmyk(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ int ind = 0; /* String index in array */
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+ assert(NULL != txt);
+#endif
+ if ((NULL == pctx) || (NULL == txt)) {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ ind = dk4str_abbr_index(dk4cs_rgb_to_cmyk_names, dkT('$'), txt, 0);
+ if (0 > ind) {
+ dk4error_set_simple_error_code(erp,DK4_E_SYNTAX);
+ goto finished;
+ }
+ pctx->rgb_to_cmyk = (dk4_cs_conv_rgb_to_cmyk_t)ind;
+ back = 1;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4cs_context_text_rgb_to_gray(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ int ind = 0; /* String index in array */
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+ assert(NULL != txt);
+#endif
+ if ((NULL == pctx) || (NULL == txt)) {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ ind = dk4str_abbr_index(dk4cs_rgb_to_gray_names, dkT('$'), txt, 0);
+ if (0 > ind) {
+ dk4error_set_simple_error_code(erp,DK4_E_SYNTAX);
+ goto finished;
+ }
+ pctx->rgb_to_gray = (dk4_cs_conv_rgb_to_gray_t)ind;
+ back = 1;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4cs_context_text_alpha(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ int ind = 0; /* String index in array */
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+ assert(NULL != txt);
+#endif
+ if ((NULL == pctx) || (NULL == txt)) {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ ind = dk4str_abbr_index(dk4cs_alpha_names, dkT('$'), txt, 0);
+ if (0 > ind) {
+ dk4error_set_simple_error_code(erp,DK4_E_SYNTAX);
+ goto finished;
+ }
+ pctx->alpha = (dk4_cs_conv_alpha_t)ind;
+ back = 1;
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4cs_context_close(
+ dk4_cs_conv_ctx_t *pctx
+)
+{
+ $? "+ dk4cs_context_close"
+#if DK4_USE_ASSERT
+ assert(NULL != pctx);
+#endif
+ if (NULL != pctx) {
+ dk4mem_free(pctx);
+ } $? "- dk4cs_context_close"
+}
+
+
+
+dk4_px_t
+dk4cs_mix_alpha(dk4_px_t value, dk4_px_t alpha, dk4_px_t bg, dk4_px_t max)
+{
+ $? "= dk4cs_mix_alpha value=%lu bg=%lu alpha=%lu max=%lu", (unsigned long)value, (unsigned long)bg, (unsigned long)alpha, (unsigned long)max
+ return (
+ (dk4_px_t)(
+ (
+ ((unsigned long)value * (unsigned long)alpha)
+ + (
+ (unsigned long)bg
+ * ((unsigned long)max - (unsigned long)alpha)
+ )
+ ) / ((unsigned long)max)
+ )
+ );
+}
+
+
+
+double
+dk4cs_color_mix_alpha(
+ double v,
+ double a,
+ double b
+)
+{
+ $? "= dk4cs_color_mix_alpha"
+ return ((v * a) + ((1.0 - a) * b));
+}
+
+
+
+dk4_px_t
+dk4cs_mix_rgb_to_gray(
+ unsigned long r,
+ unsigned long g,
+ unsigned long b,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ unsigned long min; /* Minimum of r g b */
+ unsigned long max; /* Maximum of r g b */
+ unsigned long back = 0UL;
+ dk4_cs_conv_rgb_to_gray_t alg = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601;
+ $? "+ dk4cs_mix_rgb_to_gray r=%lu g=%lu b=%lu", r, g, b
+ if (NULL != pctx) { alg = pctx->rgb_to_gray; }
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE : {
+ back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN : {
+ back = g;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED : {
+ back = r;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION : {
+ back = r;
+ if (g > back) back = g;
+ if (b > back) back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION : {
+ if (r > g) {
+ if (g > b) {
+ back = g;
+ }
+ else {
+ if (r > b) {
+ back = b;
+ }
+ else {
+ back = r;
+ }
+ }
+ }
+ else {
+ if (g < b) {
+ back = g;
+ }
+ else {
+ if (r < b) {
+ back = b;
+ }
+ else {
+ back = r;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION : {
+ back = r;
+ if (g < back) back = g;
+ if (b < back) back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_DESATURATION : {
+ min = max = r;
+ if (g < min) min = g;
+ if (g > max) max = g;
+ if (b < min) min = b;
+ if (b > max) max = b;
+ back = (max + min) / 2UL;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709 : {
+ back = (2126UL * r + 7152UL * g + 722UL * b) / 10000UL;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_AVERAGE : {
+ back = (r + g + b) / 3UL;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST : {
+ back = ((r << 1) + ((g << 2) + g) + b) >> 3;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_FAST : {
+ back = (77UL * r + 151UL * g + 28UL * b) >> 8;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_LUMA : {
+ back = (30UL * r + 59UL * g + 11UL * b) / 100UL;
+ } break;
+ default : {
+ back = (299UL * r + 587UL * g + 114UL * b) / 1000UL;
+ } break;
+ } $? "- dk4cs_mix_rgb_to_gray %u", (unsigned)back
+ return ((dk4_px_t)back);
+}
+
+
+
+/** Convert pixel data RGB to CMYK
+ @param dptr Destination array address.
+ @param sptr Source array address.
+ @param max Maximum value for R, G, B, C, M, Y, and K.
+ @param pctx Conversion context, may be NULL.
+*/
+
+static
+void
+dk4cs_mix_rgb_to_cmyk(
+ dk4_px_t *dptr,
+ dk4_px_t const *sptr,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ dk4_px_t maxrgb; /* Maximum of r g b */
+ dk4_px_t c; /* Cyan */
+ dk4_px_t m; /* Magenta */
+ dk4_px_t y; /* Yellow */
+ dk4_px_t k; /* Black */
+ dk4_cs_conv_rgb_to_cmyk_t rgb_to_cmyk = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+ $? "+ dk4cs_mix_rgb_to_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+ $? ". r=%u", (unsigned)(sptr[0])
+ $? ". g=%u", (unsigned)(sptr[1])
+ $? ". b=%u", (unsigned)(sptr[2])
+ if (NULL != pctx) { rgb_to_cmyk = pctx->rgb_to_cmyk; }
+ maxrgb = sptr[0];
+ if (sptr[1] > maxrgb) { maxrgb = sptr[1]; }
+ if (sptr[2] > maxrgb) { maxrgb = sptr[2]; }
+ k = max - maxrgb;
+ switch (rgb_to_cmyk) {
+ case DK4_CS_CONV_RGB_TO_CMYK_PS_PDF : {
+ c = maxrgb - sptr[0];
+ m = maxrgb - sptr[1];
+ y = maxrgb - sptr[2];
+ } break;
+ default : {
+ if ((dk4_px_t)0U == maxrgb) {
+ c = m = y = (dk4_px_t)0U;
+ }
+ else {
+ c = (dk4_px_t)(
+ (
+ ((unsigned long)max)
+ * (((unsigned long)maxrgb) - ((unsigned long)(sptr[0])))
+ ) / ((unsigned long)maxrgb)
+ );
+ m = (dk4_px_t)(
+ (
+ ((unsigned long)max)
+ * (((unsigned long)maxrgb) - ((unsigned long)(sptr[1])))
+ ) / ((unsigned long)maxrgb)
+ );
+ y = (dk4_px_t)(
+ (
+ ((unsigned long)max)
+ * (((unsigned long)maxrgb) - ((unsigned long)(sptr[2])))
+ ) / ((unsigned long)maxrgb)
+ );
+ }
+ } break;
+ }
+ dptr[0] = c; dptr[1] = m; dptr[2] = y; dptr[3] = k;
+ $? ". c=%u", (unsigned)(dptr[0])
+ $? ". m=%u", (unsigned)(dptr[1])
+ $? ". y=%u", (unsigned)(dptr[2])
+ $? ". k=%u", (unsigned)(dptr[3])
+ $? "- dk4cs_mix_rgb_to_cmyk"
+}
+
+
+
+/** Convert pixel data CMYK to RGB.
+ @param dptr Destination array address.
+ @param sptr Source array address.
+ @param max Maximum value for R, G, B, C, M, Y, and K.
+ @param pctx Conversion context, may be NULL.
+*/
+
+static
+void
+dk4cs_mix_cmyk_to_rgb(
+ dk4_px_t *dptr,
+ dk4_px_t const *sptr,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ dk4_cs_conv_rgb_to_cmyk_t alg = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+ dk4_px_t r; /* Red */
+ dk4_px_t g; /* Green */
+ dk4_px_t b; /* Blue */
+ dk4_px_t tr; /* Additional red component */
+ dk4_px_t tg; /* Additional green component */
+ dk4_px_t tb; /* Additional blue component */
+ $? "+ dk4cs_mix_cmyk_to_rgb"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+ $? ". c=%u", (unsigned)(sptr[0])
+ $? ". m=%u", (unsigned)(sptr[1])
+ $? ". y=%u", (unsigned)(sptr[2])
+ $? ". k=%u", (unsigned)(sptr[3])
+ if (NULL != pctx) { alg = pctx->rgb_to_cmyk; }
+ r = g = b = max - sptr[3];
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_CMYK_PS_PDF : {
+ /* Do nothing */
+ } break;
+ default : {
+ tr = (dk4_px_t)(
+ (((unsigned long)(sptr[0])) * ((unsigned long)(sptr[3])))
+ / ((unsigned long)max)
+ );
+ tg = (dk4_px_t)(
+ (((unsigned long)(sptr[1])) * ((unsigned long)(sptr[3])))
+ / ((unsigned long)max)
+ );
+ tb = (dk4_px_t)(
+ (((unsigned long)(sptr[2])) * ((unsigned long)(sptr[3])))
+ / ((unsigned long)max)
+ );
+ if ((max - tr) >= r) {
+ r += tr;
+ }
+ else {
+ r = max;
+ }
+ if ((max - tg) >= g) {
+ g += tg;
+ }
+ else {
+ g = max;
+ }
+ if ((max - tb) >= b) {
+ b += tb;
+ }
+ else {
+ b = max;
+ }
+ } break;
+ }
+ if (r >= sptr[0]) {
+ r -= sptr[0];
+ }
+ else {
+ r = 0;
+ }
+ if (g >= sptr[1]) {
+ g -= sptr[1];
+ }
+ else {
+ g = 0;
+ }
+ if (b >= sptr[2]) {
+ g -= sptr[2];
+ }
+ else {
+ g = 0;
+ }
+ dptr[0] = r; $? ". r=%u", (unsigned)(dptr[0])
+ dptr[1] = g; $? ". g=%u", (unsigned)(dptr[1])
+ dptr[2] = b; $? ". b=%u", (unsigned)(dptr[2])
+ $? "- dk4cs_mix_cmyk_to_rgb"
+}
+
+
+
+size_t
+dk4cs_color_space_size(int cs)
+{
+ size_t back = 0;
+ $? "+ dk4cs_color_space_size cs=%d", cs
+ switch (cs) {
+ case DK4_CS_GRAY : {
+ back = 1;
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ back = 2;
+ } break;
+ case DK4_CS_RGB : {
+ back = 3;
+ } break;
+ case DK4_CS_RGB_ALPHA : case DK4_CS_CMYK : {
+ back = 4;
+ } break;
+ } $? "- dk4cs_color_space_size %u", (unsigned)back
+ return back;
+}
+
+
+
+void
+dk4cs_nc_px_convert(
+ dk4_px_t *dptr,
+ int dcs,
+ dk4_px_t const *sptr,
+ int scs,
+ dk4_px_t const *bptr,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ dk4_px_t myrgb[4]; /* Temporary pixel value */
+ size_t i; /* Traverse components when mixing */
+ dk4_cs_conv_alpha_t alpha; /* Alpha handling choice */
+ $? "+ dk4cs_nc_px_convert"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+ switch (scs) {
+ case DK4_CS_GRAY : {
+ $? ". e = %u", (unsigned)(sptr[0])
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". gray to gray"
+ dptr[0] = sptr[0];
+ $? ". e = %u", (unsigned)(dptr[0])
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". gray to gray+alpha"
+ dptr[0] = sptr[0];
+ dptr[1] = max;
+ $? ". e = %u", (unsigned)(dptr[0])
+ $? ". a = %u", (unsigned)(dptr[1])
+ } break;
+ case DK4_CS_RGB : {
+ $? ". gray to rgb"
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". gray to rgb+alpha"
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ dptr[3] = max;
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ $? ". a = %u", (unsigned)(dptr[3])
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". gray to cmyk"
+ dptr[3] = max - sptr[0];
+ dptr[0] = dptr[1] = dptr[2] = 0;
+ $? ". c = %u", (unsigned)(dptr[0])
+ $? ". m = %u", (unsigned)(dptr[1])
+ $? ". y = %u", (unsigned)(dptr[2])
+ $? ". k = %u", (unsigned)(dptr[3])
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". e = %u", (unsigned)(sptr[0])
+ $? ". a = %u", (unsigned)(sptr[1])
+ alpha = DK4_CS_CONV_ALPHA_MIX;
+ if (NULL != pctx) { alpha = pctx->alpha; }
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". gray+alpha to gray"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = sptr[0];
+ } break;
+ default : {
+ dptr[0] = dk4cs_mix_alpha(
+ sptr[0], sptr[1], bptr[0], max
+ );
+ } break;
+ }
+ $? ". e = %u", (unsigned)(dptr[0])
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". gray+alpha to gray+alpha"
+ dptr[0] = sptr[0];
+ dptr[1] = sptr[1];
+ $? ". e = %u", (unsigned)(dptr[0])
+ $? ". a = %u", (unsigned)(dptr[1])
+ } break;
+ case DK4_CS_RGB : {
+ $? ". gray+alpha to rgb"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ } break;
+ default : {
+ dptr[0] = dptr[1] = dptr[2] = dk4cs_mix_alpha(
+ sptr[0], sptr[1], bptr[0], max
+ );
+ } break;
+ }
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". gray+alpha to rgb+alpha"
+ dptr[3] = sptr[1];
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ $? ". a = %u", (unsigned)(dptr[3])
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". gray+alpha to cmyk"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[3] = max - sptr[0];
+ } break;
+ default : {
+ dptr[3] = max - dk4cs_mix_alpha(
+ sptr[0], sptr[1], bptr[0], max
+ );
+ } break;
+ }
+ dptr[0] = dptr[1] = dptr[2] = 0;
+ $? ". c = %u", (unsigned)(dptr[0])
+ $? ". m = %u", (unsigned)(dptr[1])
+ $? ". y = %u", (unsigned)(dptr[2])
+ $? ". k = %u", (unsigned)(dptr[3])
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_RGB : {
+ $? ". r = %u", (unsigned)(sptr[0])
+ $? ". g = %u", (unsigned)(sptr[1])
+ $? ". b = %u", (unsigned)(sptr[2])
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". rgb to gray"
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ $? ". e = %u", (unsigned)(dptr[0])
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". rgb to gray+alpha"
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ dptr[1] = max;
+ $? ". e = %u", (unsigned)(dptr[0])
+ $? ". a = %u", (unsigned)(dptr[1])
+ } break;
+ case DK4_CS_RGB : {
+ $? ". rgb to rgb"
+ dptr[0] = sptr[0];
+ dptr[1] = sptr[1];
+ dptr[2] = sptr[2];
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". rgb to rgb+alpha"
+ dptr[0] = sptr[0];
+ dptr[1] = sptr[1];
+ dptr[2] = sptr[2];
+ dptr[3] = max;
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ $? ". a = %u", (unsigned)(dptr[3])
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". rgb to cmyk"
+ dk4cs_mix_rgb_to_cmyk(dptr, sptr, max, pctx);
+ $? ". c = %u", (unsigned)(dptr[0])
+ $? ". m = %u", (unsigned)(dptr[1])
+ $? ". y = %u", (unsigned)(dptr[2])
+ $? ". k = %u", (unsigned)(dptr[3])
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". r = %u", (unsigned)(sptr[0])
+ $? ". g = %u", (unsigned)(sptr[1])
+ $? ". b = %u", (unsigned)(sptr[2])
+ $? ". a = %u", (unsigned)(sptr[3])
+ alpha = DK4_CS_CONV_ALPHA_MIX;
+ if (NULL != pctx) { alpha = pctx->alpha; }
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". rgb+alpha to gray"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ } break;
+ default : {
+ for (i = 0; i < 3; i++) {
+ myrgb[i] = dk4cs_mix_alpha(
+ sptr[i], sptr[3], bptr[i], max
+ );
+ }
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ } break;
+ }
+ $? ". e = %u", (unsigned)(dptr[0])
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". rgb+alpha to gray+alpha"
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ dptr[1] = sptr[3];
+ $? ". e = %u", (unsigned)(dptr[0])
+ $? ". a = %u", (unsigned)(dptr[1])
+ } break;
+ case DK4_CS_RGB : {
+ $? ". rgb+alpha to rgb"
+ for (i = 0; i < 3; i++) {
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[i] = sptr[i];
+ } break;
+ default : {
+ dptr[i] = dk4cs_mix_alpha(
+ sptr[i], sptr[3], bptr[i], max
+ );
+ } break;
+ }
+ }
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". rgb+alpha to rgb+alpha"
+ for (i = 0; i < 4; i++) {
+ dptr[i] = sptr[i];
+ }
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ $? ". a = %u", (unsigned)(dptr[3])
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". rgb+alpha to cmyk"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dk4cs_mix_rgb_to_cmyk(dptr, sptr, max, pctx);
+ } break;
+ default : {
+ for (i = 0; i < 3; i++) {
+ myrgb[i] = dk4cs_mix_alpha(
+ sptr[i], sptr[3], bptr[i], max
+ );
+ }
+ dk4cs_mix_rgb_to_cmyk(dptr, myrgb, max, pctx);
+ } break;
+ }
+ $? ". c = %u", (unsigned)(dptr[0])
+ $? ". m = %u", (unsigned)(dptr[1])
+ $? ". y = %u", (unsigned)(dptr[2])
+ $? ". k = %u", (unsigned)(dptr[3])
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". c = %u", (unsigned)(sptr[0])
+ $? ". m = %u", (unsigned)(sptr[1])
+ $? ". y = %u", (unsigned)(sptr[2])
+ $? ". k = %u", (unsigned)(sptr[3])
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". cmyk to gray"
+ dk4cs_mix_cmyk_to_rgb(myrgb, sptr, max, pctx);
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ $? ". e = %u", (unsigned)(dptr[0])
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". cmyk to gray+alpha"
+ dk4cs_mix_cmyk_to_rgb(myrgb, sptr, max, pctx);
+ dptr[0] = dk4cs_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ dptr[1] = max;
+ $? ". e = %u", (unsigned)(dptr[0])
+ $? ". a = %u", (unsigned)(dptr[1])
+ } break;
+ case DK4_CS_RGB : {
+ $? ". cmyk to rgb"
+ dk4cs_mix_cmyk_to_rgb(dptr, sptr, max, pctx);
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". cmyk to rgb+alpha"
+ dk4cs_mix_cmyk_to_rgb(dptr, sptr, max, pctx);
+ dptr[3] = max;
+ $? ". r = %u", (unsigned)(dptr[0])
+ $? ". g = %u", (unsigned)(dptr[1])
+ $? ". b = %u", (unsigned)(dptr[2])
+ $? ". a = %u", (unsigned)(dptr[3])
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". cmyk to cmyk"
+ for (i = 0; i < 4; i++) {
+ dptr[i] = sptr[i];
+ }
+ $? ". c = %u", (unsigned)(dptr[0])
+ $? ". m = %u", (unsigned)(dptr[1])
+ $? ". y = %u", (unsigned)(dptr[2])
+ $? ". k = %u", (unsigned)(dptr[3])
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ default : {
+ } break;
+ }
+ $? "- dk4cs_nc_px_convert"
+}
+
+
+
+void
+dk4cs_px_convert(
+ dk4_px_t *dptr,
+ int dcs,
+ size_t dsz,
+ dk4_px_t const *sptr,
+ int scs,
+ size_t ssz,
+ dk4_px_t const *bptr,
+ size_t bsz,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+ $? "+ dk4cs_px_convert"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != sptr);
+ assert(0 < ssz);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == dptr) { $? "! dptr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_CS_MIN > dcs) || (DK4_CS_MAX < dcs)) { $? "! dcs"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (dsz < dk4cs_color_space_size(dcs)) { $? "! dsz"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == sptr) { $? "! sptr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_CS_MIN > scs) || (DK4_CS_MAX < scs)) { $? "! scs"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (ssz < dk4cs_color_space_size(scs)) { $? "! ssz"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((dk4_px_t)0U == max) { $? "! max"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < ssz; i++) {
+ if (max < sptr[i]) { $? "! sptr[]>max"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ switch (scs) {
+ case DK4_CS_GRAY_ALPHA :
+ case DK4_CS_RGB_ALPHA : {
+ if (NULL == bptr) { $? "! bptr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (bsz < (dk4cs_color_space_size(scs) - 1)) { $? "! bsz"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < bsz; i++) {
+ if (max < bptr[i]) { $? "! bptr[]>max"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ } break;
+ }
+ /* Do conversion
+ */
+ dk4cs_nc_px_convert(dptr, dcs, sptr, scs, bptr, max, pctx);
+ finished:
+ $? "- dk4cs_px_convert"
+ return;
+}
+
+
+
+double
+dk4cs_color_mix_rgb_to_gray(
+ double r,
+ double g,
+ double b,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ double min; /* Minimum of r g b */
+ double max; /* Maximum of r g b */
+ double back = 0.0;
+ dk4_cs_conv_rgb_to_gray_t alg = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601;
+ $? "+ dk4cs_color_mix_rgb_to_gray r=%g g=%g b=%g", r, g, b
+ if (NULL != pctx) { alg = pctx->rgb_to_gray; }
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE : {
+ back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN : {
+ back = g;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED : {
+ back = r;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION : {
+ back = r;
+ if (g > back) back = g;
+ if (b > back) back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION : {
+ if (r > g) {
+ if (g > b) {
+ back = g;
+ }
+ else {
+ if (r > b) {
+ back = b;
+ }
+ else {
+ back = r;
+ }
+ }
+ }
+ else {
+ if (g < b) {
+ back = g;
+ }
+ else {
+ if (r < b) {
+ back = b;
+ }
+ else {
+ back = r;
+ }
+ }
+ }
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION : {
+ back = r;
+ if (g < back) back = g;
+ if (b < back) back = b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_DESATURATION : {
+ min = max = r;
+ if (g < min) min = g;
+ if (g > max) max = g;
+ if (b < min) min = b;
+ if (b > max) max = b;
+ back = (max + min) / 2.0;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709 : {
+ back = 0.2126*r + 0.7152*g + 0.0722*b;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_AVERAGE : {
+ back = (r + g + b) / 3.0;
+ } break;
+ case DK4_CS_CONV_RGB_TO_GRAY_LUMA : {
+ back = 0.3*r + 0.59*g + 0.11*b;
+ } break;
+ default : {
+ back = 0.299*r + 0.587*g + 0.114*b;
+ } break;
+ } $? "- dk4cs_color_mix_rgb_to_gray %g", back
+ return back;
+}
+
+
+
+/** Convert normalized color RGB to CMYK
+ @param dptr Address of result array (CMYK).
+ @param sptr Source values (RGB).
+ @param pctx Conversion context, may be NULL.
+*/
+
+static
+void
+dk4cs_color_mix_rgb_to_cmyk(
+ double *dptr,
+ const double *sptr,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ double c; /* Cyan */
+ double m; /* Magenta */
+ double y; /* Yellow */
+ double k; /* Black */
+ double maxrgb; /* Maximum of r g b */
+ int me; /* Flag: Math error */
+ dk4_cs_conv_rgb_to_cmyk_t alg = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+ $? "+ dk4cs_color_mix_rgb_to_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+ $? ". r=%g", sptr[0]
+ $? ". g=%g", sptr[1]
+ $? ". b=%g", sptr[2]
+ if (NULL != pctx) { alg = pctx->rgb_to_cmyk; }
+ maxrgb = sptr[0];
+ if (sptr[1] > maxrgb) { maxrgb = sptr[1]; }
+ if (sptr[2] > maxrgb) { maxrgb = sptr[2]; }
+ c = maxrgb - sptr[0];
+ m = maxrgb - sptr[1];
+ y = maxrgb - sptr[2];
+ k = 1.0 - maxrgb;
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_CMYK_PS_PDF : {
+ /* Nothing to do */
+ } break;
+ default : {
+ me = 0;
+ c = c / maxrgb; m = m / maxrgb ; y = y / maxrgb;
+ if (!(dk4ma_is_finite(c))) { me = 1; }
+ if (!(dk4ma_is_finite(m))) { me = 1; }
+ if (!(dk4ma_is_finite(y))) { me = 1; }
+ if ((0.0 > c) || (1.0 < c)) { me = 1; }
+ if ((0.0 > m) || (1.0 < m)) { me = 1; }
+ if ((0.0 > y) || (1.0 < y)) { me = 1; }
+ if (0 != me) {
+ c = m = y = 0.0; k = 1.0;
+ }
+ } break;
+ }
+ dptr[0] = c; dptr[1] = m; dptr[2] = y; dptr[3] = k;
+ $? ". c=%g", dptr[0]
+ $? ". m=%g", dptr[1]
+ $? ". y=%g", dptr[2]
+ $? ". k=%g", dptr[3]
+ $? "- dk4cs_color_mix_rgb_to_cmyk"
+}
+
+
+
+/** Convert normalized color CMYK to RGB.
+ @param dptr Address of result array.
+ @param sptr Address of source array.
+ @param pctx Conversion context, may be NULL.
+*/
+
+static
+void
+dk4cs_color_mix_cmyk_to_rgb(
+ double *dptr,
+ double const *sptr,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ double r; /* Red */
+ double g; /* Green */
+ double b; /* Blue */
+ dk4_cs_conv_rgb_to_cmyk_t alg = DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF;
+ $? "+ dk4cs_color_mix_cmyk_to_rgb"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+ $? ". c=%g", sptr[0]
+ $? ". m=%g", sptr[1]
+ $? ". y=%g", sptr[2]
+ $? ". k=%g", sptr[3]
+ if (NULL != pctx) { alg = pctx->rgb_to_cmyk; }
+ r = g = b = 1.0 - sptr[3];
+ r -= sptr[0];
+ g -= sptr[1];
+ b -= sptr[2];
+ switch (alg) {
+ case DK4_CS_CONV_RGB_TO_CMYK_PS_PDF : {
+ /* Nothing to do */
+ } break;
+ default : {
+ r += (sptr[0] * sptr[3]);
+ g += (sptr[1] * sptr[3]);
+ b += (sptr[2] * sptr[3]);
+ } break;
+ }
+ if (0.0 > r) { r = 0.0; } if (1.0 < r) { r = 1.0; }
+ if (0.0 > g) { g = 0.0; } if (1.0 < g) { g = 1.0; }
+ if (0.0 > b) { b = 0.0; } if (1.0 < b) { b = 1.0; }
+ dptr[0] = r; dptr[1] = g; dptr[2] = b;
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ $? "- dk4cs_color_mix_cmyk_to_rgb"
+}
+
+
+
+void
+dk4cs_nc_color_convert(
+ double *dptr,
+ int dcs,
+ double const *sptr,
+ int scs,
+ double const *bptr,
+ dk4_cs_conv_ctx_t const *pctx
+)
+{
+ double myrgb[4]; /* Temporary pixel data for mixing */
+ size_t i; /* Traverse all pixel components */
+ dk4_cs_conv_alpha_t alpha;
+ $? "+ dk4cs_nc_color_convert"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != sptr);
+#endif
+ switch (scs) {
+ case DK4_CS_GRAY : {
+ $? ". e=%g", sptr[0]
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". gray to gray"
+ dptr[0] = sptr[0];
+ $? ". e=%g", dptr[0]
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". gray to gray+alpha"
+ dptr[0] = sptr[0];
+ dptr[1] = 1.0;
+ $? ". e=%g", dptr[0]
+ $? ". a=%g", dptr[1]
+ } break;
+ case DK4_CS_RGB : {
+ $? ". gray to rgb"
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". gray to rgb+alpha"
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ dptr[3] = 1.0;
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ $? ". a=%g", dptr[3]
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". gray to cmyk"
+ dptr[3] = 1.0 - sptr[0];
+ dptr[0] = dptr[1] = dptr[2] = 0.0;
+ $? ". c=%g", dptr[0]
+ $? ". m=%g", dptr[1]
+ $? ". y=%g", dptr[2]
+ $? ". k=%g", dptr[3]
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". e=%g", sptr[0]
+ $? ". a=%g", sptr[1]
+ alpha = DK4_CS_CONV_ALPHA_MIX;
+ if (NULL != pctx) { alpha = pctx->alpha; }
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". gray+alpha to gray"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = sptr[0];
+ } break;
+ default : {
+ dptr[0] = dk4cs_color_mix_alpha(
+ sptr[0], sptr[1], bptr[0]
+ );
+ } break;
+ }
+ $? ". e=%g", dptr[0]
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". gray+alpha to gray+alpha"
+ dptr[0] = sptr[0];
+ dptr[1] = sptr[1];
+ $? ". e=%g", dptr[0]
+ $? ". a=%g", dptr[1]
+ } break;
+ case DK4_CS_RGB : {
+ $? ". gray+alpha to rgb"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ } break;
+ default : {
+ dptr[0] = dptr[1] = dptr[2] =
+ dk4cs_color_mix_alpha(sptr[0], sptr[1], bptr[0]);
+ }
+ }
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". gray+alpha to rgb+alpha"
+ dptr[3] = sptr[1];
+ dptr[0] = dptr[1] = dptr[2] = sptr[0];
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ $? ". a=%g", dptr[3]
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". gray+alpha to cmyk"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[3] = 1.0 - sptr[0];
+ } break;
+ default : {
+ dptr[3] =
+ 1.0-dk4cs_color_mix_alpha(sptr[0],sptr[1],bptr[0]);
+ }
+ }
+ dptr[0] = dptr[1] = dptr[2] = 0.0;
+ $? ". c=%g", dptr[0]
+ $? ". m=%g", dptr[1]
+ $? ". y=%g", dptr[2]
+ $? ". k=%g", dptr[3]
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_RGB : {
+ $? ". r=%g", sptr[0]
+ $? ". g=%g", sptr[1]
+ $? ". b=%g", sptr[2]
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". rgb to gray"
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ $? ". e=%g", dptr[0]
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". rgb to gray+alpha"
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ dptr[1] = 1.0;
+ $? ". e=%g", dptr[0]
+ $? ". a=%g", dptr[1]
+ } break;
+ case DK4_CS_RGB : {
+ $? ". rgb to rgb"
+ for (i = 0; i < 3; i++) {
+ dptr[i] = sptr[i];
+ }
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". rgb to rgb+alpha"
+ for (i = 0; i < 3; i++) {
+ dptr[i] = sptr[i];
+ }
+ dptr[3] = 1.0;
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ $? ". a=%g", dptr[3]
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". rgb to cmyk"
+ dk4cs_color_mix_rgb_to_cmyk(dptr, sptr, pctx);
+ $? ". c=%g", dptr[0]
+ $? ". m=%g", dptr[1]
+ $? ". y=%g", dptr[2]
+ $? ". k=%g", dptr[3]
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". r=%g", sptr[0]
+ $? ". g=%g", sptr[1]
+ $? ". b=%g", sptr[2]
+ $? ". a=%g", sptr[3]
+ alpha = DK4_CS_CONV_ALPHA_MIX;
+ if (NULL != pctx) { alpha = pctx->alpha; }
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". rgb+alpha to gray"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ } break;
+ default : {
+ for (i = 0; i < 3; i++) {
+ myrgb[i] = dk4cs_color_mix_alpha(
+ sptr[i], sptr[3], bptr[i]
+ );
+ }
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ }
+ }
+ $? ". e=%g", dptr[0]
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". rgb+alpha to gray+alpha"
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ sptr[0], sptr[1], sptr[2], pctx
+ );
+ dptr[1] = sptr[3];
+ $? ". e=%g", dptr[0]
+ $? ". a=%g", dptr[1]
+ } break;
+ case DK4_CS_RGB : {
+ $? ". rgb+alpha to rgb"
+ for (i = 0; i < 3; i++) {
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dptr[i] = sptr[i];
+ } break;
+ default : {
+ dptr[i] = dk4cs_color_mix_alpha(
+ sptr[i], sptr[3], bptr[i]
+ );
+ } break;
+ }
+ }
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". rgb+alpha to rgb+alpha"
+ for (i = 0; i < 4; i++) {
+ dptr[i] = sptr[i];
+ }
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ $? ". a=%g", dptr[3]
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". rgb+alpha to cmyk"
+ switch (alpha) {
+ case DK4_CS_CONV_ALPHA_FOREGROUND : {
+ dk4cs_color_mix_rgb_to_cmyk(dptr, sptr, pctx);
+ } break;
+ default : {
+ for (i = 0; i < 3; i++) {
+ myrgb[i] = dk4cs_color_mix_alpha(
+ sptr[i], sptr[3], bptr[i]
+ );
+ }
+ dk4cs_color_mix_rgb_to_cmyk(dptr, myrgb, pctx);
+ } break;
+ }
+ $? ". c=%g", dptr[0]
+ $? ". m=%g", dptr[1]
+ $? ". y=%g", dptr[2]
+ $? ". k=%g", dptr[3]
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". c=%g", sptr[0]
+ $? ". m=%g", sptr[1]
+ $? ". y=%g", sptr[2]
+ $? ". k=%g", sptr[3]
+ switch (dcs) {
+ case DK4_CS_GRAY : {
+ $? ". cmyk to gray"
+ dk4cs_color_mix_cmyk_to_rgb(myrgb, sptr, pctx);
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ $? ". e=%g", dptr[0]
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". cmyk to gray+alpha"
+ dk4cs_color_mix_cmyk_to_rgb(myrgb, sptr, pctx);
+ dptr[0] = dk4cs_color_mix_rgb_to_gray(
+ myrgb[0], myrgb[1], myrgb[2], pctx
+ );
+ dptr[1] = 1.0;
+ $? ". e=%g", dptr[0]
+ $? ". a=%g", dptr[1]
+ } break;
+ case DK4_CS_RGB : {
+ $? ". cmyk to rgb"
+ dk4cs_color_mix_cmyk_to_rgb(dptr, sptr, pctx);
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ $? ". cmyk to rgb+alpha"
+ dk4cs_color_mix_cmyk_to_rgb(dptr, sptr, pctx);
+ dptr[3] = 1.0;
+ $? ". r=%g", dptr[0]
+ $? ". g=%g", dptr[1]
+ $? ". b=%g", dptr[2]
+ $? ". a=%g", dptr[3]
+ } break;
+ case DK4_CS_CMYK : {
+ $? ". cmyk to cmyk"
+ for (i = 0; i < 4; i++) {
+ dptr[i] = sptr[i];
+ }
+ $? ". c=%g", dptr[0]
+ $? ". m=%g", dptr[1]
+ $? ". y=%g", dptr[2]
+ $? ". k=%g", dptr[3]
+ } break;
+ default : {
+ } break;
+ }
+ } break;
+ default : {
+ } break;
+ }
+ $? "- dk4cs_nc_color_convert"
+}
+
+
+
+void
+dk4cs_color_convert(
+ double *dptr,
+ int dcs,
+ size_t dsz,
+ double const *sptr,
+ int scs,
+ size_t ssz,
+ double const *bptr,
+ size_t bsz,
+ dk4_cs_conv_ctx_t const *pctx,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+ $? "+ dk4cs_color_convert"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != sptr);
+ assert(0 < ssz);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == dptr) { $? "! dptr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_CS_MIN > dcs) || (DK4_CS_MAX < dcs)) { $? "! dcs"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (dsz < dk4cs_color_space_size(dcs)) { $? "! dsz"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == sptr) { $? "! sptr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((DK4_CS_MIN > scs) || (DK4_CS_MAX < scs)) { $? "! scs"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (ssz < dk4cs_color_space_size(scs)) { $? "! ssz"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < ssz; i++) {
+ if ((0.0 > sptr[i]) || (1.0 < sptr[i])) { $? "! sptr[]"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ switch (scs) {
+ case DK4_CS_GRAY_ALPHA :
+ case DK4_CS_RGB_ALPHA : {
+ if (NULL == bptr) { $? "! bptr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (bsz < (dk4cs_color_space_size(scs) - 1)) { $? "! bsz"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < bsz; i++) {
+ if ((0.0 > bptr[i]) || (1.0 < bptr[i])) { $? "! bptr[]"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ } break;
+ }
+ /* Do conversion
+ */
+ dk4cs_nc_color_convert(dptr, dcs, sptr, scs, bptr, pctx);
+ finished:
+ $? "- dk4cs_color_convert"
+ return;
+}
+
+
+
+int
+dk4cs_check(int cs)
+{
+ int back = 0;
+ if ((DK4_CS_MIN <= cs) && (DK4_CS_MAX >= cs)) {
+ back = 1;
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4cs.h b/support/dktools/dk4cs.h
new file mode 100644
index 0000000000..959938fb5f
--- /dev/null
+++ b/support/dktools/dk4cs.h
@@ -0,0 +1,713 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4cs.ctr
+*/
+
+#ifndef DK4CS_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4CS_H_INCLUDED 1
+
+
+#line 9 "dk4cs.ctr"
+
+/** @file dk4cs.h Color spaces, especially for bitmap images.
+
+This module provides color space conversion functions.
+
+Note: You should not use this module for conversion from other color spaces
+to CMYK or vice versa. Conversion to CMYK should be done by professional
+programs, as the conversion depends on the production process, the used
+inks, and the used paper. Professional conversion programs use color profiles
+and let you choose a number of settings. This module uses just simple
+formulas.
+
+The following symbols are used in formulas below:
+
+Symbol | Meaning
+:----: | :-----:
+d | Bit depth (integer), number of bits per component (sample)
+M | Maximum component value (integer), 2^d-1
+r | Red component for a pixel (integer), 0<=r<=M
+g | Green component for a pixel (integer), 0<=r<=M
+b | Blue component for a pixel (integer), 0<=b<=M
+e | Gray value for a pixel (integer), 0<=e<=M
+c | Cyan component for a pixel (integer), 0<=c<=M
+m | Magenta component for a pixel (integer), 0<=m<=M
+y | Yellow component for pixel (integer), 0<=y<=M
+k | Black or key component for a pixel (integer), 0<=k<=M
+maxrgb | Maximum value of r, g, and b (integer), 0<=maxrgb<=M
+mincmy | Minimum value of c, m, and y (integer), 0<=mincmy<=M
+r' | Normalized red component (floating point), 0.0<=r'<=1.0
+g' | Normalized green component (floating point), 0.0<=g'<=1.0
+b' | Normalized blue component (floating point), 0.0<=b'<=1.0
+e' | Normalized gray component (floating point), 0.0<=e'<=1.0
+c' | Normalized cyan component (floating point), 0.0<=c'<=1.0
+m' | Normalized magenta component (floating point), 0.0<=m'<=1.0
+y' | Normalized yellow component (floating point), 0.0<=y'<=1.0
+k' | Normalized black component (floating point), 0.0<=k'<=1.0
+maxrgb' | Normalized red component (floating point), 0.0<=maxrgb'<=1.0
+mincmy' | Normalized red component (floating point), 0.0<=mincmy'<=1.0
+ucr(x) | Undercolour removal function, maps [0,1] to [0,1]
+bg(x) | Black generation function, maps [0,1] to [0,1]
+
+To switch from default algorithms to other algorithms, open a
+conversion context, set up the conversion context, pass the context to
+the conversion functions and close the context when no longer needed.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4PX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4px.h"
+#else
+#include <dktools-4/dk4px.h>
+#endif
+#endif
+
+
+/** Color spaces used by the images we want to process.
+*/
+enum {
+ DK4_CS_GRAY = 0 , /**< Gray. */
+ DK4_CS_GRAY_ALPHA , /**< Gray, opacity. */
+ DK4_CS_RGB , /**< Red, green, blue. */
+ DK4_CS_RGB_ALPHA , /**< Red, green, blue, opacity. */
+ DK4_CS_CMYK , /**< Cyan, magentam, yellow, black (key). */
+
+ DK4_CS_MIN = DK4_CS_GRAY , /**< Minimum value. */
+ DK4_CS_MAX = DK4_CS_CMYK /**< Maximum value. */
+};
+
+
+/** Choose algorithm to convert RGB to CMYK.
+*/
+typedef enum {
+
+ DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF = 0 ,
+
+ /**< Algorithm differing from PS/PDF standard.
+ Most web pages about color
+ conversion recommend the algorithm
+ like this (default):
+ @code
+ c' = 1 - r'
+ m' = 1 - g'
+ y' = 1 - b'
+ mincmy' = min{c',m',y'}
+ if 1 = mincmy'
+ then
+ k' = 1
+ c' = m' = y' = 0
+ else
+ k' = mincmy'
+ c' = (c' - k') / (1 - k')
+ m' = (m' - k') / (1 - k')
+ y' = (y' - k') / (1 - k')
+ endif
+ @endcode
+ Substitution results in:
+ @code
+ maxrgb' = max{r',g',b'}
+ if 0 = maxrgb'
+ then
+ k' = 1
+ c' = m' = y' = 0
+ else
+ c' = (maxrgb' - r') / maxrgb'
+ m' = (maxrgb' - g') / maxrgb'
+ y' = (maxrgb' - b') / maxrgb'
+ k' = 1 - maxrgb'
+ endif
+ @endcode
+ The result for pixel components is:
+ @code
+ maxrgb = max{r,g,b}
+ if 0 = maxrgb
+ then
+ k = M
+ c = m = y = 0
+ else
+ c = (M * (maxrgb - r)) / maxrgb
+ m = (M * (maxrgb - g)) / maxrgb
+ y = (M * (maxrgb - b)) / maxrgb
+ k = M - maxrgb
+ endif
+ @endcode
+ */
+
+
+
+ DK4_CS_CONV_RGB_TO_CMYK_PS_PDF
+
+ /**< Algorithm as described in the PS and PDF standards.
+ @code
+ c' = 1 - r'
+ m' = 1 - g'
+ y' = 1 - b'
+ mincmy' = min{c',m',y'}
+ c' = c' - ucr(mincmy')
+ m' = m' - ucr(mincmy')
+ y' = y' - ucr(mincmy')
+ k' = bg(mincmy')
+ @endcode
+ Substitution and use of simplified
+ functions ucr(x)=x and bg(x)=x
+ results in:
+ @code
+ maxrgb' = max{r',g',b'}
+ c' = maxrgb' - r'
+ m' = maxrgb' - g'
+ y' = maxrgb' - b'
+ k' = 1 - maxrgb'
+ @endcode
+ The result for components values is:
+ @code
+ maxrgb = max{r,g,b}
+ c = maxrgb - r
+ m = maxrgb - g
+ y = maxrgb - b
+ k = M - maxrgb
+ @endcode
+ */
+
+} dk4_cs_conv_rgb_to_cmyk_t;
+
+
+
+/** How to convert RGB to gray.
+*/
+typedef enum {
+ /** Reproduce luminance (default).
+ @code
+ e' = 0.299 * r' + 0.587 * g' + 0.114 * b'
+ e = (299 * r + 587 * g + 114 * b) / 1000
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601 = 0,
+
+
+ /** Reproduce luminance.
+ Same as above but reduced number of digits
+ in the coefficients.
+ @code
+ e' = 0.3 * r' + 0.59 * g' + 0.11 * b'
+ e = (30 * r + 59 * g + 11 * b) / 100
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_LUMA ,
+
+ /** Reproduce luminance,
+ use alternative coefficients.
+ @code
+ e' = 0.2126 * r' + 0.7152 * g' + 0.0722 * b'
+ e = (2126 * r + 7152 * g + 722 * b) / 10000
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709 ,
+
+
+ /** Faster approximation for pixel values.
+ @code
+ e = (77 * r + 151 * g + 28 * b) >> 8
+ @endcode
+ For normalized colors use
+ @code
+ e' = 0.299 * r' + 0.587 * g' + 0.114 * b'
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_FAST ,
+
+
+ /** Still faster - and more inaccurate -
+ approximation for pixel values.
+ @code
+ e = ((r << 1) + ((g << 2) + g) + b) >> 3
+ @endcode
+ is a fast implementation of
+ @code
+ e = (2 * r + 5 * g + b) / 8
+ @endcode
+ For normalized colors use
+ @code
+ e' = 0.299 * r' + 0.587 * g' + 0.114 * b'
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST ,
+
+ /** Use average.
+ @code
+ e' = (r' + g' + b') / 3
+ e = (r + g + b) / 3
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_AVERAGE ,
+
+
+ /** Desaturation.
+ Flatter than luminance, less contrast.
+ @code
+ e' = (max{r',g',b'} + min{r',g',b'}) / 2
+ e = (max{r,b,b} + min{r,g,b}) / 2
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_DESATURATION ,
+
+
+ /** Minimum decomposition.
+ Produces dark images.
+ @code
+ e' = min{r',g',b'}
+ e = min{r,g,b}
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION ,
+
+ /** Medium value decomposition
+ (not minimum, not maximum).
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION ,
+
+
+ /** Maximum decomposition.
+ Produces bright images.
+ @code
+ e' = max{r',g',b'}
+ e = max{r,g,b}
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION ,
+
+
+ /** Use just red channel.
+ @code
+ e' = r'
+ e = r
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED ,
+
+
+ /** Use just green channel.
+ @code
+ e' = g'
+ e = g
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN ,
+
+
+ /** Use just blue channel.
+ @code
+ e' = b'
+ e = b
+ @endcode
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE ,
+
+ /** Minimum value.
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MIN = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601 ,
+
+ /** Maximum value.
+ */
+ DK4_CS_CONV_RGB_TO_GRAY_MAX = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE
+
+} dk4_cs_conv_rgb_to_gray_t;
+
+
+
+/** How to handle alpha channel.
+ Only used when converting from a color space containing alpha data
+ to a color space not containing alpha data.
+*/
+typedef enum {
+ /** Mix against specified background.
+ */
+ DK4_CS_CONV_ALPHA_MIX = 0,
+
+ /** Ignore alpha value, just return foreground.
+ */
+ DK4_CS_CONV_ALPHA_FOREGROUND
+
+} dk4_cs_conv_alpha_t;
+
+
+
+/** Conversion context containing setup details for conversions.
+*/
+
+typedef struct {
+ dk4_cs_conv_rgb_to_cmyk_t rgb_to_cmyk; /**< RGB to CMYK. */
+ dk4_cs_conv_rgb_to_gray_t rgb_to_gray; /**< RGB to gray. */
+ dk4_cs_conv_alpha_t alpha; /**< Alpha channel handling. */
+} dk4_cs_conv_ctx_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Create new conversion context and initialize it.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem
+ set if there is not enough memory available.
+*/
+
+dk4_cs_conv_ctx_t *
+dk4cs_context_open(
+ dk4_er_t *erp
+);
+
+
+/** Initialize a conversion context.
+ @param pctx Context to set up.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx is NULL.
+*/
+
+int
+dk4cs_context_init(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_er_t *erp
+);
+
+
+/** Set RGB to CMYK handling in a conversion context.
+ @param pctx Context to set up.
+ @param rgb_to_cmyk Details for RGB to CMYK conversion.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx is NULL.
+*/
+
+int
+dk4cs_context_set_rgb_to_cmyk(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_rgb_to_cmyk_t rgb_to_cmyk,
+ dk4_er_t *erp
+);
+
+
+/** Set RGB to gray handling in a conversion context.
+ @param pctx Context to set up.
+ @param rgb_to_gray Details or RGB to gray conversion.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx is NULL.
+*/
+
+int
+dk4cs_context_set_rgb_to_gray(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_rgb_to_gray_t rgb_to_gray,
+ dk4_er_t *erp
+);
+
+
+/** Set alpha channel handling.
+ @param pctx Context to set up.
+ @param alpha Alpha channel handling method.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx is NULL.
+*/
+
+int
+dk4cs_context_set_alpha(
+ dk4_cs_conv_ctx_t *pctx,
+ dk4_cs_conv_alpha_t alpha,
+ dk4_er_t *erp
+);
+
+/** Destroy conversion context, release resources.
+ @param pctx Conversion context to close.
+*/
+
+void
+dk4cs_context_close(
+ dk4_cs_conv_ctx_t *pctx
+);
+
+
+/** Convert pixel data from one color space into another, samples are dk4_px_t.
+ @param dptr Address of destination array.
+ @param dcs Destination color space.
+ @param dsz Size of destination array (number of elements).
+ @param sptr Address of source array.
+ @param scs Source color space.
+ @param ssz Source array size (number of elements).
+ @param bptr Address of background array, may be NULL.
+ @param bsz Size of background array (number of elements), may be 0.
+ @param max Maximum value for a component.
+ @param pctx Conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if anything is wrong with arguments, i.e.:
+ * dptr or sptr is NULL,
+ * dcs or scs is not a valid color space,
+ * dsz or ssz is too small for the color space,
+ * max is 0,
+ * one of the sptr components is larger than max
+ * a background is required but bptr is NULL, bsz is too small
+ for the colro space or one of the background components is larger
+ than max.
+*/
+
+void
+dk4cs_px_convert(
+ dk4_px_t *dptr,
+ int dcs,
+ size_t dsz,
+ dk4_px_t const *sptr,
+ int scs,
+ size_t ssz,
+ dk4_px_t const *bptr,
+ size_t bsz,
+ dk4_px_t max,
+ dk4_cs_conv_ctx_t const *pctx,
+ dk4_er_t *erp
+);
+
+
+/** Convert pixel data from one color space into another, samples are double.
+ @param dptr Address of destination array, values in interval [0;1].
+ @param dcs Destination color space.
+ @param dsz Size of destination array (number of elements).
+ @param sptr Address of source array, values in interval [0;1].
+ @param scs Source color space.
+ @param ssz Source array size (number of elements).
+ @param bptr Address of background array, values in [0;1], may be NULL.
+ @param bsz Size of background array (number of elements), may be 0.
+ @param pctx Conversion context, may be NULL.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if anything is wrong with arguments, i.e.:
+ * dptr or sptr is NULL,
+ * dcs or scs is not a valid color space,
+ * dsz or ssz is too small for the color space,
+ * one of the sptr components is out of interval [0;1],
+ * a background is required but bptr is NULL, bsz is too small
+ for the colro space or one of the background components is
+ out of interval [0;1].
+*/
+
+void
+dk4cs_color_convert(
+ double *dptr,
+ int dcs,
+ size_t dsz,
+ double const *sptr,
+ int scs,
+ size_t ssz,
+ double const *bptr,
+ size_t bsz,
+ dk4_cs_conv_ctx_t const *pctx,
+ dk4_er_t *erp
+);
+
+
+/** Mix pixel data foreground against background value.
+ @param value Foreground value.
+ @param alpha Foreground opacity.
+ @param bg Background value.
+ @param max Maximum for foreground, background, and alpha.
+ @return Mixing result.
+*/
+
+dk4_px_t
+dk4cs_mix_alpha(
+ dk4_px_t value,
+ dk4_px_t alpha,
+ dk4_px_t bg,
+ dk4_px_t max
+);
+
+
+/** Mix pixel data RGB to gray.
+ @param r Red.
+ @param g Green.
+ @param b Blue.
+ @param pctx Conversion context, may be NULL.
+ @return Gray value for RGB pixel.
+*/
+
+dk4_px_t
+dk4cs_mix_rgb_to_gray(
+ unsigned long r,
+ unsigned long g,
+ unsigned long b,
+ dk4_cs_conv_ctx_t const *pctx
+);
+
+
+/** Mix normalized color foreground against background using alpha value.
+ @param v Foreground value, normalized.
+ @param a Alpha value, normalized.
+ @param b Background value, normalized.
+*/
+
+double
+dk4cs_color_mix_alpha(
+ double v,
+ double a,
+ double b
+);
+
+
+/** Mix normalized color RGB to gray
+ @param r Normalized red component.
+ @param g Normalized green component.
+ @param b Normalized blue component.
+ @param pctx Conversion context, may be NULL.
+ @return Gray value.
+*/
+
+double
+dk4cs_color_mix_rgb_to_gray(
+ double r,
+ double g,
+ double b,
+ dk4_cs_conv_ctx_t const *pctx
+);
+
+
+/** Retrieve number of components for a color space.
+ @param cs Color space.
+ @return Number of components in color space cs.
+*/
+
+size_t
+dk4cs_color_space_size(int cs);
+
+
+/** Check whether an integer number represents a valid color space.
+ @param cs Number to check.
+ @return 1 on success (cs is a color space), 0 otherwise.
+*/
+
+int
+dk4cs_check(int cs);
+
+
+/** Set RGB to CMYK conversion method from text.
+ @param pctx Context to set up.
+ @param txt Text containing the method name.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx or txt is NULL,
+ - DK4_E_SYNTAX<br>
+ if txt does not cotain a valid method name.
+*/
+
+int
+dk4cs_context_text_rgb_to_cmyk(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+);
+
+
+/** Set RGB to GRAY conversion method from text.
+ @param pctx Context to set up.
+ @param txt Text containing the method name.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx or txt is NULL,
+ - DK4_E_SYNTAX<br>
+ if txt does not cotain a valid method name.
+*/
+
+int
+dk4cs_context_text_rgb_to_gray(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+);
+
+
+/** Set alpha channel handling method.
+ @param pctx Context to set up.
+ @param txt Text containing the method name.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pctx or txt is NULL,
+ - DK4_E_SYNTAX<br>
+ if txt does not cotain a valid method name.
+*/
+
+int
+dk4cs_context_text_alpha(
+ dk4_cs_conv_ctx_t *pctx,
+ dkChar const *txt,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/dk4ctime.c b/support/dktools/dk4ctime.c
index 6d05522a3d..93702042eb 100644
--- a/support/dktools/dk4ctime.c
+++ b/support/dktools/dk4ctime.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ctime.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ctime.ctr
*/
/** @file dk4ctime.c The dk4ctime module.
*/
-#line 131 "dk4ctime.ctr"
+#line 147 "dk4ctime.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4types.h"
#include "dk4ctime.h"
@@ -66,6 +51,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
int
dk4clocktime_get(dk4_clock_time_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
GetLocalTime(dptr);
@@ -178,6 +166,11 @@ dk4clocktime_to_text(
)
{
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != clt);
+#endif
back = dk4time_to_text(
dptr, dsz, DK4_TIMEFORMAT_DATE_TIME,
clt->wYear, clt->wMonth, clt->wDay, clt->wHour, clt->wMinute, clt->wSecond,
@@ -187,6 +180,11 @@ dk4clocktime_to_text(
#if DK4_CHAR_SIZE > 1
char buf[32];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != clt);
+#endif
if (0 != dk4time_as_text_c8(buf, sizeof(buf), clt, erp)) {
back = dk4recode_char_to_dk(dptr, dsz, buf, erp);
}
diff --git a/support/dktools/dk4ctime.ctr b/support/dktools/dk4ctime.ctr
index 6ea7135296..c46b238fc5 100644
--- a/support/dktools/dk4ctime.ctr
+++ b/support/dktools/dk4ctime.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
@@ -62,7 +74,11 @@ license = bsd
#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#endif
@@ -131,6 +147,13 @@ dk4clocktime_to_text(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4types.h"
#include "dk4ctime.h"
@@ -156,6 +179,9 @@ dk4clocktime_to_text(
int
dk4clocktime_get(dk4_clock_time_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
GetLocalTime(dptr);
@@ -268,6 +294,11 @@ dk4clocktime_to_text(
)
{
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != clt);
+#endif
back = dk4time_to_text(
dptr, dsz, DK4_TIMEFORMAT_DATE_TIME,
clt->wYear, clt->wMonth, clt->wDay, clt->wHour, clt->wMinute, clt->wSecond,
@@ -277,6 +308,11 @@ dk4clocktime_to_text(
#if DK4_CHAR_SIZE > 1
char buf[32];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != clt);
+#endif
if (0 != dk4time_as_text_c8(buf, sizeof(buf), clt, erp)) {
back = dk4recode_char_to_dk(dptr, dsz, buf, erp);
}
diff --git a/support/dktools/dk4ctime.h b/support/dktools/dk4ctime.h
index a31167b242..f3713720d7 100644
--- a/support/dktools/dk4ctime.h
+++ b/support/dktools/dk4ctime.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ctime.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ctime.ctr
*/
#ifndef DK4CTIME_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
@@ -94,7 +84,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#endif
diff --git a/support/dktools/dk4dbi.c b/support/dktools/dk4dbi.c
index f7c3a349ad..d66e04ff79 100644
--- a/support/dktools/dk4dbi.c
+++ b/support/dktools/dk4dbi.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbi.ctr
*/
/** @file dk4dbi.c The dk4dbi module.
*/
-#line 556 "dk4dbi.ctr"
+#line 576 "dk4dbi.ctr"
#include "dk4conf.h"
@@ -55,6 +33,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4dbi.h"
#include "dk4mem.h"
#include "dk4memrs.h"
@@ -67,12 +52,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4delfile.h"
#include "dk4stat.h"
#include "dk4statd.h"
+#include "dk4maadu.h"
+#include "dk4unused.h"
-#line 589 "dk4dbi.ctr"
+#line 618 "dk4dbi.ctr"
@@ -102,22 +89,23 @@ dkT("ndbm"),
NULL
-#line 611 "dk4dbi.ctr"
+#line 640 "dk4dbi.ctr"
};
/** File name suffixes for NDBM files.
*/
+
+#if (DK4_CHAR_SIZE == 1) \
+&& (\
+ (DK4_HAVE_NDBM_H) \
+ || ((!(DK4_ON_WINDOWS)) && (DK4_HAVE_CHOWN) && (DK4_HAVE_CHMOD))\
+)
static const dkChar *dk4dbi_ndbm_suffixes[] = {
dkT(".dir"), dkT(".pag")
};
-
-
-
-/** Maximum size of key or value.
-*/
-static const unsigned long dk4dbi_max_size = 4294967295UL;
+#endif
@@ -134,14 +122,17 @@ dk4dbi_datum_delete(dk4_dbi_datum_t *ptr, int options)
int back = 0;
-#line 641 "dk4dbi.ctr"
+#line 671 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = 1;
if (0 != (DK4_DB_OPT_RESET_KEY & options)) {
if ((NULL != ptr->kd) && ((size_t)0UL < ptr->ks)) {
-#line 646 "dk4dbi.ctr"
+#line 679 "dk4dbi.ctr"
if (0 == dk4mem_reset_secure(ptr->kd, ptr->ks, NULL)) {
back = 0;
}
@@ -151,7 +142,7 @@ dk4dbi_datum_delete(dk4_dbi_datum_t *ptr, int options)
if ((NULL != ptr->vd) && ((size_t)0UL < ptr->vs)) {
-#line 654 "dk4dbi.ctr"
+#line 687 "dk4dbi.ctr"
if (0 == dk4mem_reset_secure(ptr->vd, ptr->vs, NULL)) {
back = 0;
}
@@ -164,13 +155,14 @@ dk4dbi_datum_delete(dk4_dbi_datum_t *ptr, int options)
}
-#line 665 "dk4dbi.ctr"
+#line 698 "dk4dbi.ctr"
return back;
}
/** Allocate memory for a new record.
+
@param ks
@param vs
@param erp
@@ -192,13 +184,17 @@ dk4dbi_datum_new(
dk4_dbi_datum_t *back = NULL;
-#line 691 "dk4dbi.ctr"
+#line 725 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(0 < ks);
+ assert(0 < vs);
+#endif
back = dk4mem_new(dk4_dbi_datum_t,1,erp);
if (NULL != back) {
back->kd = back->vd = NULL;
back->ks = back->vs = (size_t)0UL;
- back->kd = dk4mem_new(char,ks,erp);
- back->vd = dk4mem_new(char,vs,erp);
+ if (0 < ks) { back->kd = dk4mem_new(char,ks,erp); }
+ if (0 < vs) { back->vd = dk4mem_new(char,vs,erp); }
if ((NULL != back->kd) && (NULL != back->vd)) {
back->ks = ks; back->vs = vs;
} else {
@@ -209,7 +205,7 @@ dk4dbi_datum_new(
}
}
-#line 706 "dk4dbi.ctr"
+#line 744 "dk4dbi.ctr"
return back;
}
@@ -250,19 +246,22 @@ dk4dbi_mem_to_file(
-#line 745 "dk4dbi.ctr"
+#line 783 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
fipo = dk4fopen(db->fn, dkT("wb"), tests, erp);
if (NULL != fipo) {
-#line 748 "dk4dbi.ctr"
+#line 789 "dk4dbi.ctr"
back = 1;
dk4sto_it_reset((db->dt).mem.i);
do {
rp = (dk4_dbi_datum_t *)dk4sto_it_next((db->dt).mem.i);
if (NULL != rp) {
-#line 753 "dk4dbi.ctr"
+#line 794 "dk4dbi.ctr"
uc[0] = (unsigned char)(((unsigned long)(rp->ks) >> 24) & 0x000000FFUL);
uc[1] = (unsigned char)(((unsigned long)(rp->ks) >> 16) & 0x000000FFUL);
uc[2] = (unsigned char)(((unsigned long)(rp->ks) >> 8) & 0x000000FFUL);
@@ -274,30 +273,30 @@ dk4dbi_mem_to_file(
nbw = fwrite(uc, 1, 8, fipo);
if (8 == nbw) {
-#line 763 "dk4dbi.ctr"
+#line 804 "dk4dbi.ctr"
nbw = fwrite(rp->kd, 1, rp->ks, fipo);
if (rp->ks == nbw) {
-#line 765 "dk4dbi.ctr"
+#line 806 "dk4dbi.ctr"
nbw = fwrite(rp->vd, 1, rp->vs, fipo);
if (rp->vs == nbw) {
-#line 767 "dk4dbi.ctr"
+#line 808 "dk4dbi.ctr"
} else {
back = 0;
-#line 769 "dk4dbi.ctr"
+#line 810 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
}
} else {
-#line 772 "dk4dbi.ctr"
+#line 813 "dk4dbi.ctr"
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
}
} else {
-#line 776 "dk4dbi.ctr"
+#line 817 "dk4dbi.ctr"
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
}
@@ -305,20 +304,20 @@ dk4dbi_mem_to_file(
} while (NULL != rp);
if (0 != fclose(fipo)) {
-#line 782 "dk4dbi.ctr"
+#line 823 "dk4dbi.ctr"
back = 0;
dk4error_set_idetails(erp, DK4_E_CLOSE_FAILED, errno);
}
} else {
-#line 786 "dk4dbi.ctr"
+#line 827 "dk4dbi.ctr"
}
if (0 != back) {
db->uc = 0;
}
-#line 791 "dk4dbi.ctr"
+#line 832 "dk4dbi.ctr"
return back;
}
@@ -364,7 +363,10 @@ dk4dbi_mem_from_file(
int cc = 1; /* Flag: Can continue */
-#line 835 "dk4dbi.ctr"
+#line 876 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
fipo = dk4fopen(db->fn, dkT("rb"), 0, erp);
if (NULL != fipo) {
back = 1;
@@ -372,7 +374,7 @@ dk4dbi_mem_from_file(
nbr = fread(uc, 1, 8, fipo);
if (8 == nbr) {
-#line 841 "dk4dbi.ctr"
+#line 885 "dk4dbi.ctr"
ul1 = ((((unsigned long)(uc[0])) << 24) & 0xFF000000UL)
| ((((unsigned long)(uc[1])) << 16) & 0x00FF0000UL)
| ((((unsigned long)(uc[2])) << 8) & 0x0000FF00UL)
@@ -381,8 +383,14 @@ dk4dbi_mem_from_file(
| ((((unsigned long)(uc[5])) << 16) & 0x00FF0000UL)
| ((((unsigned long)(uc[6])) << 8) & 0x0000FF00UL)
| ((((unsigned long)(uc[7])) ) & 0x000000FFUL);
- if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)ul1) {
- if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)ul2) {
+#if 0
+ if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)ul1)
+#endif
+ if (0 != dk4ma_um_isgeq(SIZE_MAX, ul1)) {
+#if 0
+ if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)ul2)
+#endif
+ if (0 != dk4ma_um_isgeq(SIZE_MAX, ul2)) {
ks = (size_t)ul1; vs = (size_t)ul2;
if (
(((size_t)0UL == db->km) || (db->km >= ks))
@@ -393,7 +401,7 @@ dk4dbi_mem_from_file(
rp = dk4dbi_datum_new(ks, vs, erp);
if (NULL != rp) {
-#line 860 "dk4dbi.ctr"
+#line 910 "dk4dbi.ctr"
nbr = fread(rp->kd, 1, rp->ks, fipo);
if (nbr == rp->ks) {
nbr = fread(rp->vd, 1, rp->vs, fipo);
@@ -401,13 +409,13 @@ dk4dbi_mem_from_file(
if (0 == dk4sto_add((db->dt).mem.s, rp, erp)) {
cc = 0;
-#line 866 "dk4dbi.ctr"
+#line 916 "dk4dbi.ctr"
back = 0;
dk4dbi_datum_delete(rp, 0);
}
} else {
-#line 870 "dk4dbi.ctr"
+#line 920 "dk4dbi.ctr"
cc = 0;
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
@@ -415,7 +423,7 @@ dk4dbi_mem_from_file(
}
} else {
-#line 876 "dk4dbi.ctr"
+#line 926 "dk4dbi.ctr"
cc = 0;
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
@@ -423,7 +431,7 @@ dk4dbi_mem_from_file(
}
} else {
-#line 882 "dk4dbi.ctr"
+#line 932 "dk4dbi.ctr"
cc = 0;
back = 0;
}
@@ -431,28 +439,28 @@ dk4dbi_mem_from_file(
else
{
-#line 888 "dk4dbi.ctr"
+#line 938 "dk4dbi.ctr"
cc = 0;
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} else {
-#line 893 "dk4dbi.ctr"
+#line 943 "dk4dbi.ctr"
cc = 0;
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} else {
-#line 898 "dk4dbi.ctr"
+#line 948 "dk4dbi.ctr"
cc = 0;
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} else {
-#line 903 "dk4dbi.ctr"
+#line 953 "dk4dbi.ctr"
cc = 0;
if (0 != nbr) {
back = 0;
@@ -463,16 +471,16 @@ dk4dbi_mem_from_file(
(void)fclose(fipo);
} else {
-#line 912 "dk4dbi.ctr"
+#line 962 "dk4dbi.ctr"
if (0 == dk4stat(&stb, db->fn, NULL)) {
back = 1;
-#line 914 "dk4dbi.ctr"
+#line 964 "dk4dbi.ctr"
}
}
-#line 917 "dk4dbi.ctr"
+#line 967 "dk4dbi.ctr"
return back;
}
@@ -486,14 +494,15 @@ dk4dbi_mem_from_file(
*/
static
int
-dk4dbi_datum_compare(const void *l, const void *r, int cr)
+dk4dbi_datum_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
dk4_dbi_datum_t *pl; /* Left pointer */
dk4_dbi_datum_t *pr; /* Right pointer */
int back = 0;
-#line 936 "dk4dbi.ctr"
+#line 986 "dk4dbi.ctr"
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (dk4_dbi_datum_t *)l;
@@ -527,7 +536,7 @@ dk4dbi_datum_compare(const void *l, const void *r, int cr)
}
-#line 968 "dk4dbi.ctr"
+#line 1019 "dk4dbi.ctr"
return back;
}
@@ -542,14 +551,17 @@ dk4dbi_delete_base(dk4_dbi_t *ptr)
{
-#line 981 "dk4dbi.ctr"
+#line 1032 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4mem_release(ptr->fn);
dk4mem_free(ptr);
}
-#line 986 "dk4dbi.ctr"
+#line 1040 "dk4dbi.ctr"
}
@@ -558,6 +570,8 @@ dk4dbi_delete_base(dk4_dbi_t *ptr)
@param fn File name.
@param tp Backend type.
@param wa Flag: Write access required.
+ @param km
+ @param vm
@param erp Error report, may be NULL.
@return Pointer to memory on success, NULL on error.
@@ -582,7 +596,11 @@ dk4dbi_new_base(
dk4_dbi_t *back = NULL;
-#line 1017 "dk4dbi.ctr"
+#line 1073 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert((DK4_DB_BE_MEMORY == tp) || (DK4_DB_BE_BDB == tp) || (DK4_DB_BE_NDBM == tp));
+#endif
back = dk4mem_new(dk4_dbi_t,1,erp);
if (NULL != back) {
back->tp = tp;
@@ -610,14 +628,14 @@ dk4dbi_new_base(
back->fn = dk4str_dup(fn, erp);
if (NULL == back->fn) {
-#line 1043 "dk4dbi.ctr"
+#line 1103 "dk4dbi.ctr"
dk4mem_free(back);
back = NULL;
}
}
-#line 1048 "dk4dbi.ctr"
+#line 1108 "dk4dbi.ctr"
return back;
}
@@ -655,14 +673,17 @@ dk4dbi_close_mem(
int back = 1;
-#line 1084 "dk4dbi.ctr"
+#line 1144 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if ((NULL != (db->dt).mem.s) && (NULL != (db->dt).mem.i)) {
/*
Write records to file if there are unsaved changes.
*/
-#line 1089 "dk4dbi.ctr"
+#line 1152 "dk4dbi.ctr"
if ((0 != db->wa) && (0 != db->uc)) {
if (0 == dk4dbi_mem_to_file(db, erp)) {
back = 0;
@@ -688,7 +709,7 @@ dk4dbi_close_mem(
dk4sto_close((db->dt).mem.s);
}
-#line 1113 "dk4dbi.ctr"
+#line 1176 "dk4dbi.ctr"
return back;
}
@@ -738,7 +759,10 @@ dk4dbi_open_mem(
dk4_dbi_t *back = NULL;
-#line 1161 "dk4dbi.ctr"
+#line 1224 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != tr) {
(void)dk4delete_file(fn, NULL);
}
@@ -770,7 +794,7 @@ dk4dbi_open_mem(
}
-#line 1191 "dk4dbi.ctr"
+#line 1257 "dk4dbi.ctr"
return back;
}
@@ -784,7 +808,6 @@ dk4dbi_open_mem(
dk4dbi_close() function calls dk4dbi_delete_base()
to release the base components.
@param db Database to close.
- @param erp Error report, may be NULL.
@return 1 on success, 0 on error.
Error codes:
@@ -803,11 +826,13 @@ dk4dbi_open_mem(
static
int
dk4dbi_close_bdb(
- dk4_dbi_t *db,
- dk4_er_t *erp
+ dk4_dbi_t *db
)
{
int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != (db->dt).bdb.db) {
if ((0 != db->wa) && (0 != db->uc)) {
if (0 != ((db->dt).bdb.db)->sync((db->dt).bdb.db, 0)) {
@@ -870,7 +895,10 @@ dk4dbi_open_bdb(
int flags = 0;
-#line 1289 "dk4dbi.ctr"
+#line 1356 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
back = dk4dbi_new_base(fn, DK4_DB_BE_BDB, wa, km, vm, erp);
if (NULL != back) {
if (0 != tr) {
@@ -880,7 +908,7 @@ dk4dbi_open_bdb(
if (0 == res) {
((back->dt).bdb.db)->set_errfile((back->dt).bdb.db, NULL);
flags = ((0 != wa)
- ? ((0 != tr) ? ((DB_CREATE) || (DB_TRUNCATE)) : (DB_CREATE))
+ ? ((0 != tr) ? ((DB_CREATE) | (DB_TRUNCATE)) : (DB_CREATE))
: (DB_RDONLY));
res = ((back->dt).bdb.db)->open(
(back->dt).bdb.db, NULL, back->fn, NULL, DB_BTREE, flags, 0600
@@ -907,7 +935,7 @@ dk4dbi_open_bdb(
}
-#line 1324 "dk4dbi.ctr"
+#line 1394 "dk4dbi.ctr"
return back;
#endif
}
@@ -950,6 +978,9 @@ dk4dbi_close_ndbm(
)
{
int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != (db->dt).ndbm.dbm) {
dbm_close((db->dt).ndbm.dbm);
(db->dt).ndbm.dbm = NULL;
@@ -965,7 +996,9 @@ dk4dbi_truncate_ndbm(const dkChar *fn)
{
dkChar buf[DK4_MAX_PATH];
const size_t szbuf = DK4_SIZEOF(buf,dkChar);
-
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != dk4str_cpy_s(buf, szbuf, fn, NULL)) {
if (0 != dk4str_cat_s(buf, szbuf, dk4dbi_ndbm_suffixes[0], NULL)) {
(void)dk4delete_file(buf, NULL);
@@ -1005,8 +1038,10 @@ dk4dbi_open_ndbm(
-#line 1420 "dk4dbi.ctr"
-
+#line 1495 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != tr) {
dk4dbi_truncate_ndbm(fn);
}
@@ -1028,7 +1063,7 @@ dk4dbi_open_ndbm(
}
-#line 1441 "dk4dbi.ctr"
+#line 1518 "dk4dbi.ctr"
return back;
}
@@ -1051,7 +1086,11 @@ dk4dbi_open_with_type(
dk4_dbi_t *back = NULL;
-#line 1462 "dk4dbi.ctr"
+#line 1539 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert((DK4_DB_BE_MEMORY == tp) || (DK4_DB_BE_BDB == tp) || (DK4_DB_BE_NDBM == tp));
+#endif
if (NULL != fn) {
switch (tp) {
case DK4_DB_BE_MEMORY : {
@@ -1080,7 +1119,7 @@ dk4dbi_open_with_type(
}
-#line 1489 "dk4dbi.ctr"
+#line 1570 "dk4dbi.ctr"
return back;
}
@@ -1104,7 +1143,10 @@ dk4dbi_open(
-#line 1511 "dk4dbi.ctr"
+#line 1592 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
mycopy = dk4str_dup(fn, erp);
if (NULL != mycopy) {
@@ -1136,7 +1178,7 @@ dk4dbi_open(
}
-#line 1541 "dk4dbi.ctr"
+#line 1625 "dk4dbi.ctr"
return back;
}
@@ -1146,6 +1188,9 @@ const dkChar *
dk4dbi_filename_part(const dkChar *filename)
{
const dkChar *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
back = dk4str_chr(filename, dkT(':'));
if (NULL != back) {
@@ -1173,7 +1218,10 @@ dk4dbi_close(
int back = 0;
-#line 1576 "dk4dbi.ctr"
+#line 1663 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
switch (db->tp) {
case DK4_DB_BE_MEMORY : {
@@ -1181,7 +1229,7 @@ dk4dbi_close(
} break;
case DK4_DB_BE_BDB : {
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
- back = dk4dbi_close_bdb(db, erp);
+ back = dk4dbi_close_bdb(db);
#else
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
@@ -1200,7 +1248,7 @@ dk4dbi_close(
}
-#line 1601 "dk4dbi.ctr"
+#line 1691 "dk4dbi.ctr"
return back;
}
@@ -1214,6 +1262,10 @@ dk4dbi_set_option(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert((DK4_DB_OPT_RESET_KEY == opt) || (DK4_DB_OPT_RESET_VALUE == opt));
+#endif
if (NULL != db) {
switch (opt) {
case DK4_DB_OPT_RESET_KEY :
@@ -1253,7 +1305,11 @@ dk4dbi_delete(
-#line 1652 "dk4dbi.ctr"
+#line 1746 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert(0 != db->wa);
+#endif
if ((NULL != db) && (NULL != kp) && ((size_t)0UL < ks)) {
if ((0 != db->wa) && (((size_t)0UL == db->km) || (db->km >= ks))) {
switch (db->tp) {
@@ -1321,7 +1377,7 @@ dk4dbi_delete(
}
-#line 1718 "dk4dbi.ctr"
+#line 1816 "dk4dbi.ctr"
return back;
}
@@ -1352,13 +1408,17 @@ dk4dbi_set(
-#line 1747 "dk4dbi.ctr"
+#line 1845 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert(0 != db->wa);
+#endif
if ((NULL != db) && (NULL != kp) && ((size_t)0UL < ks)) {
-#line 1748 "dk4dbi.ctr"
+#line 1850 "dk4dbi.ctr"
if ((NULL != vp) && ((size_t)0UL < vs)) {
-#line 1749 "dk4dbi.ctr"
+#line 1851 "dk4dbi.ctr"
if(
(((size_t)0UL == db->km) || (db->km >= ks))
&& (((size_t)0UL == db->vm) || (db->vm >= vs))
@@ -1366,11 +1426,11 @@ dk4dbi_set(
)
{
-#line 1755 "dk4dbi.ctr"
+#line 1857 "dk4dbi.ctr"
switch (db->tp) {
case DK4_DB_BE_MEMORY : {
-#line 1757 "dk4dbi.ctr"
+#line 1859 "dk4dbi.ctr"
db->uc = 1;
dat.kd = (void *)kp; dat.ks = ks;
rp = (dk4_dbi_datum_t *)dk4sto_it_find_like(
@@ -1407,14 +1467,14 @@ dk4dbi_set(
} break;
case DK4_DB_BE_BDB : {
-#line 1792 "dk4dbi.ctr"
+#line 1894 "dk4dbi.ctr"
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
-#line 1794 "dk4dbi.ctr"
+#line 1896 "dk4dbi.ctr"
if (NULL != (db->dt).bdb.db) {
-#line 1795 "dk4dbi.ctr"
+#line 1897 "dk4dbi.ctr"
db->uc = 1;
DK4_MEMRES(&k, sizeof(DBT));
DK4_MEMRES(&v, sizeof(DBT));
@@ -1422,25 +1482,25 @@ dk4dbi_set(
k.size = ks; v.size = vs;
-#line 1801 "dk4dbi.ctr"
+#line 1903 "dk4dbi.ctr"
((db->dt).bdb.db)->del((db->dt).bdb.db, NULL, &k, 0);
DK4_MEMRES(&k, sizeof(DBT));
k.data = (void *)kp; k.size = ks;
-#line 1805 "dk4dbi.ctr"
+#line 1907 "dk4dbi.ctr"
if (0 == ((db->dt).bdb.db)->put((db->dt).bdb.db,NULL,&k,&v,0)) {
back = 1;
-#line 1807 "dk4dbi.ctr"
+#line 1909 "dk4dbi.ctr"
} else {
-#line 1808 "dk4dbi.ctr"
+#line 1910 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
}
} else {
-#line 1811 "dk4dbi.ctr"
+#line 1913 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
#else
@@ -1449,7 +1509,7 @@ dk4dbi_set(
} break;
case DK4_DB_BE_NDBM : {
-#line 1818 "dk4dbi.ctr"
+#line 1920 "dk4dbi.ctr"
#if DK4_HAVE_NDBM_H && (DK4_CHAR_SIZE == 1)
if (NULL != (db->dt).ndbm.dbm) {
db->uc = 1;
@@ -1482,22 +1542,22 @@ dk4dbi_set(
else
{
-#line 1849 "dk4dbi.ctr"
+#line 1951 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} else {
-#line 1852 "dk4dbi.ctr"
+#line 1954 "dk4dbi.ctr"
back = dk4dbi_delete(db, kp, ks, erp);
}
} else {
-#line 1855 "dk4dbi.ctr"
+#line 1957 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 1858 "dk4dbi.ctr"
+#line 1960 "dk4dbi.ctr"
return back;
}
@@ -1512,7 +1572,10 @@ dk4dbi_sync(
int back = 0;
-#line 1871 "dk4dbi.ctr"
+#line 1973 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
switch (db->tp) {
case DK4_DB_BE_MEMORY : {
@@ -1559,7 +1622,7 @@ dk4dbi_sync(
}
-#line 1916 "dk4dbi.ctr"
+#line 2021 "dk4dbi.ctr"
return back;
}
@@ -1589,7 +1652,12 @@ dk4dbi_get(
-#line 1944 "dk4dbi.ctr"
+#line 2049 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert(NULL != vp);
+ assert(NULL != vs);
+#endif
if (
(NULL != db) && (NULL != kp) && ((size_t)0 < ks)
&& (NULL != vp) && (NULL != vs)
@@ -1600,7 +1668,7 @@ dk4dbi_get(
switch (db->tp) {
case DK4_DB_BE_MEMORY : {
-#line 1953 "dk4dbi.ctr"
+#line 2063 "dk4dbi.ctr"
dat.kd = (void *)kp; dat.ks = ks;
rp = (dk4_dbi_datum_t *)dk4sto_it_find_like(
(db->dt).mem.i, &dat, 0
@@ -1623,14 +1691,14 @@ dk4dbi_get(
} break;
case DK4_DB_BE_BDB : {
-#line 1974 "dk4dbi.ctr"
+#line 2084 "dk4dbi.ctr"
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
-#line 1976 "dk4dbi.ctr"
+#line 2086 "dk4dbi.ctr"
if (NULL != (db->dt).bdb.db) {
-#line 1977 "dk4dbi.ctr"
+#line 2087 "dk4dbi.ctr"
DK4_MEMRES(&k, sizeof(DBT));
DK4_MEMRES(&v, sizeof(DBT));
k.data = (void *)kp; k.size = ks;
@@ -1638,28 +1706,28 @@ dk4dbi_get(
if (0 == ((db->dt).bdb.db)->get((db->dt).bdb.db,NULL,&k,&v,0)) {
*vs = v.size;
-#line 1983 "dk4dbi.ctr"
+#line 2093 "dk4dbi.ctr"
back = 1;
} else {
-#line 1985 "dk4dbi.ctr"
+#line 2095 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
} else {
-#line 1988 "dk4dbi.ctr"
+#line 2098 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
#else
-#line 1992 "dk4dbi.ctr"
+#line 2102 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
} break;
case DK4_DB_BE_NDBM : {
-#line 1996 "dk4dbi.ctr"
+#line 2106 "dk4dbi.ctr"
#if DK4_HAVE_NDBM_H && (DK4_CHAR_SIZE == 1)
if (NULL != (db->dt).ndbm.dbm) {
DK4_MEMRES(&datk, sizeof(datum));
@@ -1687,22 +1755,22 @@ dk4dbi_get(
}
} else {
-#line 2022 "dk4dbi.ctr"
+#line 2132 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 2025 "dk4dbi.ctr"
+#line 2135 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 2028 "dk4dbi.ctr"
+#line 2138 "dk4dbi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 2031 "dk4dbi.ctr"
+#line 2141 "dk4dbi.ctr"
return back;
}
@@ -1726,19 +1794,25 @@ dk4dbi_traverse(
#endif
dk4_dbi_datum_t *dddt = NULL; /* Pointer for traversal */
int res = 0; /* Operation result */
+#if (DK4_CHAR_SIZE == 1) && ((DK4_HAVE_NDBM_H) || (DK4_HAVE_DB_H))
int first = 1; /* Flag: Retrieving first record */
+#endif
int back = -1;
-#line 2058 "dk4dbi.ctr"
+#line 2170 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert(NULL != fct);
+#endif
if ((NULL != db) && (NULL != fct)) {
switch (db->tp) {
case DK4_DB_BE_MEMORY : {
back = 1;
dk4sto_it_reset((db->dt).mem.i);
do {
- dddt = dk4sto_it_next((db->dt).mem.i);
+ dddt = (dk4_dbi_datum_t *)dk4sto_it_next((db->dt).mem.i);
if (NULL != dddt) {
res = (*fct)(obj, dddt->kd, dddt->ks, dddt->vd, dddt->vs);
if (res < back) { back = res; }
@@ -1774,11 +1848,11 @@ dk4dbi_traverse(
cp->c_close(cp);
} else {
-#line 2099 "dk4dbi.ctr"
+#line 2215 "dk4dbi.ctr"
}
} else {
-#line 2101 "dk4dbi.ctr"
+#line 2217 "dk4dbi.ctr"
}
#endif
} break;
@@ -1809,7 +1883,7 @@ dk4dbi_traverse(
}
}
-#line 2130 "dk4dbi.ctr"
+#line 2246 "dk4dbi.ctr"
return back;
}
@@ -1847,7 +1921,7 @@ dk4dbi_change_file_owner_and_mode(
-#line 2166 "dk4dbi.ctr"
+#line 2282 "dk4dbi.ctr"
errno = 0;
if (0 == chown(fn, user, group)) {
errno = 0;
@@ -1860,7 +1934,7 @@ dk4dbi_change_file_owner_and_mode(
dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
}
-#line 2177 "dk4dbi.ctr"
+#line 2293 "dk4dbi.ctr"
return back;
}
@@ -1880,7 +1954,10 @@ dk4dbi_change_owner_and_mode(
-#line 2195 "dk4dbi.ctr"
+#line 2311 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
switch (db->tp) {
case DK4_DB_BE_MEMORY :
@@ -1914,7 +1991,7 @@ dk4dbi_change_owner_and_mode(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 2227 "dk4dbi.ctr"
+#line 2346 "dk4dbi.ctr"
return back;
}
@@ -1936,14 +2013,17 @@ dk4dbi_get_key_max(
size_t back = 0;
-#line 2247 "dk4dbi.ctr"
+#line 2366 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
back = db->km;
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 2252 "dk4dbi.ctr"
+#line 2374 "dk4dbi.ctr"
return back;
}
@@ -1958,14 +2038,17 @@ dk4dbi_get_val_max(
size_t back = 0;
-#line 2265 "dk4dbi.ctr"
+#line 2387 "dk4dbi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
back = db->vm;
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 2270 "dk4dbi.ctr"
+#line 2395 "dk4dbi.ctr"
return back;
}
@@ -1975,6 +2058,9 @@ int
dk4dbi_get_type(const dk4_dbi_t *db)
{
int back = DK4_DB_BE_UNKNOWN;
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
back = db->tp;
}
diff --git a/support/dktools/dk4dbi.ctr b/support/dktools/dk4dbi.ctr
index eb1ef2f9cd..fa331c1d68 100644
--- a/support/dktools/dk4dbi.ctr
+++ b/support/dktools/dk4dbi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,11 +12,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#if DK4_HAVE_UNISTD_H
@@ -51,15 +59,27 @@ license = bsd
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
@@ -570,6 +590,13 @@ dk4dbi_change_owner_and_mode(
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4dbi.h"
#include "dk4mem.h"
#include "dk4memrs.h"
@@ -582,6 +609,8 @@ dk4dbi_change_owner_and_mode(
#include "dk4delfile.h"
#include "dk4stat.h"
#include "dk4statd.h"
+#include "dk4maadu.h"
+#include "dk4unused.h"
@@ -614,15 +643,16 @@ $!end
/** File name suffixes for NDBM files.
*/
+
+#if (DK4_CHAR_SIZE == 1) \
+&& (\
+ (DK4_HAVE_NDBM_H) \
+ || ((!(DK4_ON_WINDOWS)) && (DK4_HAVE_CHOWN) && (DK4_HAVE_CHMOD))\
+)
static const dkChar *dk4dbi_ndbm_suffixes[] = {
dkT(".dir"), dkT(".pag")
};
-
-
-
-/** Maximum size of key or value.
-*/
-static const unsigned long dk4dbi_max_size = 4294967295UL;
+#endif
@@ -638,6 +668,9 @@ dk4dbi_datum_delete(dk4_dbi_datum_t *ptr, int options)
{
int back = 0;
$? "+ dk4dbi_datum_delete %!8s", TR_8PTR(ptr)
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = 1;
if (0 != (DK4_DB_OPT_RESET_KEY & options)) {
@@ -668,6 +701,7 @@ dk4dbi_datum_delete(dk4_dbi_datum_t *ptr, int options)
/** Allocate memory for a new record.
+
@param ks
@param vs
@param erp
@@ -688,12 +722,16 @@ dk4dbi_datum_new(
{
dk4_dbi_datum_t *back = NULL;
$? "+ dk4dbi_datum_new %lu %lu", (unsigned long)ks, (unsigned long)vs
+#if DK4_USE_ASSERT
+ assert(0 < ks);
+ assert(0 < vs);
+#endif
back = dk4mem_new(dk4_dbi_datum_t,1,erp);
if (NULL != back) {
back->kd = back->vd = NULL;
back->ks = back->vs = (size_t)0UL;
- back->kd = dk4mem_new(char,ks,erp);
- back->vd = dk4mem_new(char,vs,erp);
+ if (0 < ks) { back->kd = dk4mem_new(char,ks,erp); }
+ if (0 < vs) { back->vd = dk4mem_new(char,vs,erp); }
if ((NULL != back->kd) && (NULL != back->vd)) {
back->ks = ks; back->vs = vs;
} else {
@@ -742,6 +780,9 @@ dk4dbi_mem_to_file(
int back = 0;
$? "+ dk4dbi_mem_to_file %!8s", TR_8PTR(db)
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
fipo = dk4fopen(db->fn, dkT("wb"), tests, erp);
if (NULL != fipo) { $? ". fopen"
@@ -832,6 +873,9 @@ dk4dbi_mem_from_file(
int back = 0; /* Result */
int cc = 1; /* Flag: Can continue */
$? "+ dk4dbi_mem_from_file %!8s", TR_8PTR(db)
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
fipo = dk4fopen(db->fn, dkT("rb"), 0, erp);
if (NULL != fipo) {
back = 1;
@@ -846,8 +890,14 @@ dk4dbi_mem_from_file(
| ((((unsigned long)(uc[5])) << 16) & 0x00FF0000UL)
| ((((unsigned long)(uc[6])) << 8) & 0x0000FF00UL)
| ((((unsigned long)(uc[7])) ) & 0x000000FFUL);
- if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)ul1) {
- if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)ul2) {
+#if 0
+ if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)ul1)
+#endif
+ if (0 != dk4ma_um_isgeq(SIZE_MAX, ul1)) {
+#if 0
+ if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)ul2)
+#endif
+ if (0 != dk4ma_um_isgeq(SIZE_MAX, ul2)) {
ks = (size_t)ul1; vs = (size_t)ul2;
if (
(((size_t)0UL == db->km) || (db->km >= ks))
@@ -927,12 +977,13 @@ dk4dbi_mem_from_file(
*/
static
int
-dk4dbi_datum_compare(const void *l, const void *r, int cr)
+dk4dbi_datum_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
dk4_dbi_datum_t *pl; /* Left pointer */
dk4_dbi_datum_t *pr; /* Right pointer */
int back = 0;
$? "+ dk4dbi_datum_compare %!8s %!8s", TR_8PTR(l), TR_8PTR(r)
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (dk4_dbi_datum_t *)l;
@@ -978,6 +1029,9 @@ void
dk4dbi_delete_base(dk4_dbi_t *ptr)
{
$? "+ dk4dbi_delete_base %!8s", TR_8PTR(ptr)
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4mem_release(ptr->fn);
dk4mem_free(ptr);
@@ -991,6 +1045,8 @@ dk4dbi_delete_base(dk4_dbi_t *ptr)
@param fn File name.
@param tp Backend type.
@param wa Flag: Write access required.
+ @param km
+ @param vm
@param erp Error report, may be NULL.
@return Pointer to memory on success, NULL on error.
@@ -1014,6 +1070,10 @@ dk4dbi_new_base(
{
dk4_dbi_t *back = NULL;
$? "+ dk4dbi_new_base \"%!ds\" %d %d", TR_STR(fn), tp, wa
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert((DK4_DB_BE_MEMORY == tp) || (DK4_DB_BE_BDB == tp) || (DK4_DB_BE_NDBM == tp));
+#endif
back = dk4mem_new(dk4_dbi_t,1,erp);
if (NULL != back) {
back->tp = tp;
@@ -1081,6 +1141,9 @@ dk4dbi_close_mem(
dk4_dbi_datum_t *rp; /* Current record */
int back = 1;
$? "+ dk4dbi_close_mem"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if ((NULL != (db->dt).mem.s) && (NULL != (db->dt).mem.i)) {
/*
Write records to file if there are unsaved changes.
@@ -1158,6 +1221,9 @@ dk4dbi_open_mem(
{
dk4_dbi_t *back = NULL;
$? "+ dk4dbi_open_mem \"%!ds\" %d %d", TR_STR(fn), wa, tr
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != tr) {
(void)dk4delete_file(fn, NULL);
}
@@ -1201,7 +1267,6 @@ dk4dbi_open_mem(
dk4dbi_close() function calls dk4dbi_delete_base()
to release the base components.
@param db Database to close.
- @param erp Error report, may be NULL.
@return 1 on success, 0 on error.
Error codes:
@@ -1220,11 +1285,13 @@ dk4dbi_open_mem(
static
int
dk4dbi_close_bdb(
- dk4_dbi_t *db,
- dk4_er_t *erp
+ dk4_dbi_t *db
)
{
int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != (db->dt).bdb.db) {
if ((0 != db->wa) && (0 != db->uc)) {
if (0 != ((db->dt).bdb.db)->sync((db->dt).bdb.db, 0)) {
@@ -1286,6 +1353,9 @@ dk4dbi_open_bdb(
int res = 0;
int flags = 0;
$? "+ dk4dbi_open_bdb (char) \"%!ds\" %d %d", TR_STR(fn), wa, tr
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
back = dk4dbi_new_base(fn, DK4_DB_BE_BDB, wa, km, vm, erp);
if (NULL != back) {
if (0 != tr) {
@@ -1295,7 +1365,7 @@ dk4dbi_open_bdb(
if (0 == res) {
((back->dt).bdb.db)->set_errfile((back->dt).bdb.db, NULL);
flags = ((0 != wa)
- ? ((0 != tr) ? ((DB_CREATE) || (DB_TRUNCATE)) : (DB_CREATE))
+ ? ((0 != tr) ? ((DB_CREATE) | (DB_TRUNCATE)) : (DB_CREATE))
: (DB_RDONLY));
res = ((back->dt).bdb.db)->open(
(back->dt).bdb.db, NULL, back->fn, NULL, DB_BTREE, flags, 0600
@@ -1363,6 +1433,9 @@ dk4dbi_close_ndbm(
)
{
int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != (db->dt).ndbm.dbm) {
dbm_close((db->dt).ndbm.dbm);
(db->dt).ndbm.dbm = NULL;
@@ -1378,7 +1451,9 @@ dk4dbi_truncate_ndbm(const dkChar *fn)
{
dkChar buf[DK4_MAX_PATH];
const size_t szbuf = DK4_SIZEOF(buf,dkChar);
-
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != dk4str_cpy_s(buf, szbuf, fn, NULL)) {
if (0 != dk4str_cat_s(buf, szbuf, dk4dbi_ndbm_suffixes[0], NULL)) {
(void)dk4delete_file(buf, NULL);
@@ -1417,7 +1492,9 @@ dk4dbi_open_ndbm(
int flags = 0; /* Flags for opening the DB */
$? "+ dk4dbi_open_ndbm \"%!ds\" %d %d", TR_STR(fn), wa, tr
-
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != tr) {
dk4dbi_truncate_ndbm(fn);
}
@@ -1459,6 +1536,10 @@ dk4dbi_open_with_type(
{
dk4_dbi_t *back = NULL;
$? "+ dk4dbi_open_with_type \"%!ds\" tp=%d wa=%d tr=%d", TR_STR(fn), tp, wa, tr
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert((DK4_DB_BE_MEMORY == tp) || (DK4_DB_BE_BDB == tp) || (DK4_DB_BE_NDBM == tp));
+#endif
if (NULL != fn) {
switch (tp) {
case DK4_DB_BE_MEMORY : {
@@ -1508,6 +1589,9 @@ dk4dbi_open(
int tp = DK4_DB_BE_MEMORY ; /* Database type */
$? "+ dk4dbi_open \"%!ds\" %d %d", TR_STR(fn), wa, tr
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
mycopy = dk4str_dup(fn, erp);
if (NULL != mycopy) {
@@ -1547,6 +1631,9 @@ const dkChar *
dk4dbi_filename_part(const dkChar *filename)
{
const dkChar *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
back = dk4str_chr(filename, dkT(':'));
if (NULL != back) {
@@ -1573,6 +1660,9 @@ dk4dbi_close(
{
int back = 0;
$? "+ dk4dbi_close %!8s", TR_8PTR(db)
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
switch (db->tp) {
case DK4_DB_BE_MEMORY : {
@@ -1580,7 +1670,7 @@ dk4dbi_close(
} break;
case DK4_DB_BE_BDB : {
#if DK4_HAVE_DB_H && (DK4_CHAR_SIZE == 1)
- back = dk4dbi_close_bdb(db, erp);
+ back = dk4dbi_close_bdb(db);
#else
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
@@ -1611,6 +1701,10 @@ dk4dbi_set_option(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert((DK4_DB_OPT_RESET_KEY == opt) || (DK4_DB_OPT_RESET_VALUE == opt));
+#endif
if (NULL != db) {
switch (opt) {
case DK4_DB_OPT_RESET_KEY :
@@ -1649,6 +1743,10 @@ dk4dbi_delete(
dk4_dbi_datum_t *rp; /* Result found in db */
$? "+ dk4dbi_delete %!8s %!8s %lu", TR_8PTR(db), TR_8PTR(kp), (unsigned long)ks
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert(0 != db->wa);
+#endif
if ((NULL != db) && (NULL != kp) && ((size_t)0UL < ks)) {
if ((0 != db->wa) && (((size_t)0UL == db->km) || (db->km >= ks))) {
switch (db->tp) {
@@ -1744,6 +1842,10 @@ dk4dbi_set(
int back = 0;
$? "+ dk4dbi_set %!8s %!8s %lu %!8s %lu", TR_8PTR(db), TR_8PTR(kp), (unsigned long)ks, TR_8PTR(vp), (unsigned long)vs
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert(0 != db->wa);
+#endif
if ((NULL != db) && (NULL != kp) && ((size_t)0UL < ks)) { $? ". key ok"
if ((NULL != vp) && ((size_t)0UL < vs)) { $? ". set value"
if(
@@ -1868,6 +1970,9 @@ dk4dbi_sync(
{
int back = 0;
$? "+ dk4dbi_sync %!8s", TR_8PTR(db)
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
switch (db->tp) {
case DK4_DB_BE_MEMORY : {
@@ -1941,6 +2046,11 @@ dk4dbi_get(
int back = 0;
$? "+ dk4dbi_get %!8s %!8s %lu %!8s %!8s", TR_8PTR(db), TR_8PTR(kp), (unsigned long)ks, TR_8PTR(vp), TR_8PTR(vs)
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert(NULL != vp);
+ assert(NULL != vs);
+#endif
if (
(NULL != db) && (NULL != kp) && ((size_t)0 < ks)
&& (NULL != vp) && (NULL != vs)
@@ -2051,17 +2161,23 @@ dk4dbi_traverse(
#endif
dk4_dbi_datum_t *dddt = NULL; /* Pointer for traversal */
int res = 0; /* Operation result */
+#if (DK4_CHAR_SIZE == 1) && ((DK4_HAVE_NDBM_H) || (DK4_HAVE_DB_H))
int first = 1; /* Flag: Retrieving first record */
+#endif
int back = -1;
$? "+ dk4dbi_traverse db=%d obj=%d", TR_IPTR(db), TR_IPTR(obj)
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+ assert(NULL != fct);
+#endif
if ((NULL != db) && (NULL != fct)) {
switch (db->tp) {
case DK4_DB_BE_MEMORY : {
back = 1;
dk4sto_it_reset((db->dt).mem.i);
do {
- dddt = dk4sto_it_next((db->dt).mem.i);
+ dddt = (dk4_dbi_datum_t *)dk4sto_it_next((db->dt).mem.i);
if (NULL != dddt) {
res = (*fct)(obj, dddt->kd, dddt->ks, dddt->vd, dddt->vs);
if (res < back) { back = res; }
@@ -2192,6 +2308,9 @@ dk4dbi_change_owner_and_mode(
int back = 0;
$? "+ dk4dbi_change_owner_and_mode"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
switch (db->tp) {
case DK4_DB_BE_MEMORY :
@@ -2244,6 +2363,9 @@ dk4dbi_get_key_max(
{
size_t back = 0;
$? "+ dk4dbi_get_key_max"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
back = db->km;
} else {
@@ -2262,6 +2384,9 @@ dk4dbi_get_val_max(
{
size_t back = 0;
$? "+ dk4dbi_get_val_max"
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
back = db->vm;
} else {
@@ -2276,6 +2401,9 @@ int
dk4dbi_get_type(const dk4_dbi_t *db)
{
int back = DK4_DB_BE_UNKNOWN;
+#if DK4_USE_ASSERT
+ assert(NULL != db);
+#endif
if (NULL != db) {
back = db->tp;
}
diff --git a/support/dktools/dk4dbi.h b/support/dktools/dk4dbi.h
index 2c1dd43d6a..0a52359c8e 100644
--- a/support/dktools/dk4dbi.h
+++ b/support/dktools/dk4dbi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbi.ctr
*/
#ifndef DK4DBI_H_INCLUDED
@@ -44,11 +22,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#if DK4_HAVE_UNISTD_H
@@ -83,15 +69,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
diff --git a/support/dktools/dk4dbia.c b/support/dktools/dk4dbia.c
index e3cd6149a2..68f6a4c96c 100644
--- a/support/dktools/dk4dbia.c
+++ b/support/dktools/dk4dbia.c
@@ -1,45 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbia.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbia.ctr
*/
/** @file dk4dbia.c The dk4dbia module.
*/
-#line 128 "dk4dbia.ctr"
+#line 155 "dk4dbia.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4dbia.h"
#include "dk4const.h"
@@ -47,7 +33,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 136 "dk4dbia.ctr"
+#line 171 "dk4dbia.ctr"
@@ -63,7 +49,7 @@ dkT("db.value.max-size"),
NULL
-#line 146 "dk4dbia.ctr"
+#line 181 "dk4dbia.ctr"
};
@@ -77,7 +63,7 @@ dkT("dk4dbia.str"),
NULL
-#line 159 "dk4dbia.ctr"
+#line 194 "dk4dbia.ctr"
};
@@ -119,7 +105,7 @@ dkT("\nFailed to close the file."),
NULL
-#line 209 "dk4dbia.ctr"
+#line 244 "dk4dbia.ctr"
};
@@ -140,7 +126,9 @@ dk4dbi_open_sizes_app(
const dkChar * const *msg = NULL; /* Localized messages */
dk4_dbi_t *back = NULL; /* Result */
size_t szpts = 0; /* Number of elements in parts */
-
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
dk4error_init(&er);
back = dk4dbi_open(fn, wa, tr, km, vm, &er);
if (NULL == back) {
@@ -219,6 +207,9 @@ dk4dbi_open_app(
size_t km = 0;
size_t vm = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 == dk4app_pref_get_size(&km, app, dk4dbi_pref_names[0], 0)) {
km = 0;
}
diff --git a/support/dktools/dk4dbia.ctr b/support/dktools/dk4dbia.ctr
index 056ff0bb8f..fff8ca78d7 100644
--- a/support/dktools/dk4dbia.ctr
+++ b/support/dktools/dk4dbia.ctr
@@ -2,20 +2,42 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DBI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dbi.h"
+#else
+#include <dktools-4/dk4dbi.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/** Open database.
@param fn Database type and file name.
The database type is one from "mem", "bdb" or "ndbm".
@@ -124,9 +146,22 @@ dk4dbi_open_sizes_app(
dk4_app_t *app
);
+#ifdef __cplusplus
+}
+#endif
+
+
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4dbia.h"
#include "dk4const.h"
@@ -226,7 +261,9 @@ dk4dbi_open_sizes_app(
const dkChar * const *msg = NULL; /* Localized messages */
dk4_dbi_t *back = NULL; /* Result */
size_t szpts = 0; /* Number of elements in parts */
-
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
dk4error_init(&er);
back = dk4dbi_open(fn, wa, tr, km, vm, &er);
if (NULL == back) {
@@ -305,6 +342,9 @@ dk4dbi_open_app(
size_t km = 0;
size_t vm = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 == dk4app_pref_get_size(&km, app, dk4dbi_pref_names[0], 0)) {
km = 0;
}
diff --git a/support/dktools/dk4dbia.h b/support/dktools/dk4dbia.h
index 40e3cdec0e..a3a834b9ce 100644
--- a/support/dktools/dk4dbia.h
+++ b/support/dktools/dk4dbia.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbia.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbia.ctr
*/
/** @file dk4dbia.h Header file for the dk4dbia module.
@@ -43,14 +21,36 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4dbia.ctr"
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DBI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dbi.h"
+#else
+#include <dktools-4/dk4dbi.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
#endif
+
/** Open database.
@param fn Database type and file name.
The database type is one from "mem", "bdb" or "ndbm".
@@ -159,5 +159,10 @@ dk4dbi_open_sizes_app(
dk4_app_t *app
);
+#ifdef __cplusplus
+}
+#endif
+
+
#endif
diff --git a/support/dktools/dk4dbit.c b/support/dktools/dk4dbit.c
index 77cab17514..3598788868 100644
--- a/support/dktools/dk4dbit.c
+++ b/support/dktools/dk4dbit.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbit.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbit.ctr
*/
/** @file dk4dbit.c The dk4dbit module.
*/
-#line 152 "dk4dbit.ctr"
+#line 172 "dk4dbit.ctr"
#include "dk4conf.h"
@@ -50,7 +28,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 163 "dk4dbit.ctr"
+#line 183 "dk4dbit.ctr"
int
diff --git a/support/dktools/dk4dbit.ctr b/support/dktools/dk4dbit.ctr
index bc248ee309..929b116a2c 100644
--- a/support/dktools/dk4dbit.ctr
+++ b/support/dktools/dk4dbit.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,16 +11,36 @@ license = bsd
/** @file dk4dbit.h Text (dkChar) in database.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DBI_H_INCLUDED
-#include <dk4dbi.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbi.h"
+#else
+#include <dktools-4/dk4dbi.h>
+#endif
#endif
#ifndef DK4DBIT8_H_INCLUDED
-#include <dk4dbit8.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbit8.h"
+#else
+#include <dktools-4/dk4dbit8.h>
+#endif
#endif
#ifndef DK4DBITW_H_INCLUDED
-#include <dk4dbitw.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbitw.h"
+#else
+#include <dktools-4/dk4dbitw.h>
+#endif
#endif
#if DK4_CHAR_SIZE > 1
diff --git a/support/dktools/dk4dbit.h b/support/dktools/dk4dbit.h
index dd2f44d808..21588b8913 100644
--- a/support/dktools/dk4dbit.h
+++ b/support/dktools/dk4dbit.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbit.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbit.ctr
*/
#ifndef DK4DBIT_H_INCLUDED
@@ -43,16 +21,36 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4dbit.h Text (dkChar) in database.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DBI_H_INCLUDED
-#include <dk4dbi.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbi.h"
+#else
+#include <dktools-4/dk4dbi.h>
+#endif
#endif
#ifndef DK4DBIT8_H_INCLUDED
-#include <dk4dbit8.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbit8.h"
+#else
+#include <dktools-4/dk4dbit8.h>
+#endif
#endif
#ifndef DK4DBITW_H_INCLUDED
-#include <dk4dbitw.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbitw.h"
+#else
+#include <dktools-4/dk4dbitw.h>
+#endif
#endif
#if DK4_CHAR_SIZE > 1
diff --git a/support/dktools/dk4dbit8.c b/support/dktools/dk4dbit8.c
index db5cf12602..1afa5b5cd6 100644
--- a/support/dktools/dk4dbit8.c
+++ b/support/dktools/dk4dbit8.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbit8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbit8.ctr
*/
/** @file dk4dbit8.c The dk4dbit8 module.
*/
-#line 147 "dk4dbit8.ctr"
+#line 159 "dk4dbit8.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4str8.h"
#include "dk4dbit8.h"
#include "dk4maasz.h"
@@ -49,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 157 "dk4dbit8.ctr"
+#line 176 "dk4dbit8.ctr"
@@ -74,7 +59,7 @@ dk4dbi_c8_del(
int back = 0;
-#line 180 "dk4dbit8.ctr"
+#line 199 "dk4dbit8.ctr"
if ((NULL != db) && (NULL != k)) {
dk4error_init(&er);
ks = dk4ma_size_t_add(1, dk4str8_len(k), &er);
@@ -87,7 +72,7 @@ dk4dbi_c8_del(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 191 "dk4dbit8.ctr"
+#line 210 "dk4dbit8.ctr"
return back;
}
@@ -107,37 +92,37 @@ dk4dbi_c8_set(
int back = 0;
-#line 209 "dk4dbit8.ctr"
+#line 228 "dk4dbit8.ctr"
if ((NULL != db) && (NULL != k)) {
-#line 210 "dk4dbit8.ctr"
+#line 229 "dk4dbit8.ctr"
if (NULL != v) {
-#line 211 "dk4dbit8.ctr"
+#line 230 "dk4dbit8.ctr"
dk4error_init(&er);
ks = dk4ma_size_t_add(1, dk4str8_len(k), &er);
vs = dk4ma_size_t_add(1, dk4str8_len(v), &er);
if (DK4_E_NONE == er.ec) {
-#line 215 "dk4dbit8.ctr"
+#line 234 "dk4dbit8.ctr"
back = dk4dbi_set(db, k, ks, v, vs, erp);
} else {
-#line 217 "dk4dbit8.ctr"
+#line 236 "dk4dbit8.ctr"
dk4error_copy(erp, &er);
}
} else {
-#line 220 "dk4dbit8.ctr"
+#line 239 "dk4dbit8.ctr"
back = dk4dbi_c8_del(db, k, erp);
}
} else {
-#line 223 "dk4dbit8.ctr"
+#line 242 "dk4dbit8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 225 "dk4dbit8.ctr"
+#line 244 "dk4dbit8.ctr"
return back;
}
@@ -159,43 +144,43 @@ dk4dbi_c8_get(
-#line 245 "dk4dbit8.ctr"
+#line 264 "dk4dbit8.ctr"
if ((NULL != vbuf) && (0 < vsz)) { *vbuf = '\0'; }
if ((NULL != db) && (NULL != k) && (NULL != vbuf) && (0 < vsz)) {
dk4error_init(&er);
-#line 248 "dk4dbit8.ctr"
+#line 267 "dk4dbit8.ctr"
ressz = vsz;
ks = dk4ma_size_t_add(1, dk4str8_len(k), &er);
if (DK4_E_NONE == er.ec) {
-#line 251 "dk4dbit8.ctr"
+#line 270 "dk4dbit8.ctr"
if (0 != dk4dbi_get(db, k, ks, vbuf, &ressz, erp)) {
-#line 252 "dk4dbit8.ctr"
+#line 271 "dk4dbit8.ctr"
if (0 < ressz) {
-#line 253 "dk4dbit8.ctr"
+#line 272 "dk4dbit8.ctr"
if ('\0' == vbuf[ressz - 1]) {
back = 1;
-#line 255 "dk4dbit8.ctr"
+#line 274 "dk4dbit8.ctr"
} else {
if (ressz < vsz) {
vbuf[ressz] = '\0';
back = 1;
-#line 259 "dk4dbit8.ctr"
+#line 278 "dk4dbit8.ctr"
} else {
-#line 260 "dk4dbit8.ctr"
+#line 279 "dk4dbit8.ctr"
*vbuf = '\0';
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
}
} else {
-#line 265 "dk4dbit8.ctr"
+#line 284 "dk4dbit8.ctr"
*vbuf = '\0';
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
@@ -203,21 +188,21 @@ dk4dbi_c8_get(
#if TRACE_DEBUG
else {
-#line 271 "dk4dbit8.ctr"
+#line 290 "dk4dbit8.ctr"
}
#endif
} else {
-#line 274 "dk4dbit8.ctr"
+#line 293 "dk4dbit8.ctr"
dk4error_copy(erp, &er);
}
} else {
-#line 277 "dk4dbit8.ctr"
+#line 296 "dk4dbit8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 279 "dk4dbit8.ctr"
+#line 298 "dk4dbit8.ctr"
return back;
}
@@ -250,7 +235,7 @@ dk4dbi_c8_internal_traverse(
int back = 0;
-#line 310 "dk4dbit8.ctr"
+#line 329 "dk4dbit8.ctr"
if ((NULL != obj) && (NULL != kb) && (NULL != vb) && (0 < ks) && (0 < vs)) {
pk = (const char *)kb;
pv = (const char *)vb;
@@ -260,7 +245,7 @@ dk4dbi_c8_internal_traverse(
}
}
-#line 318 "dk4dbit8.ctr"
+#line 337 "dk4dbit8.ctr"
return back;
}
@@ -278,14 +263,14 @@ dk4dbi_c8_traverse(
-#line 334 "dk4dbit8.ctr"
+#line 353 "dk4dbit8.ctr"
if ((NULL != db) && (NULL != fct)) {
myobj.obj = obj;
myobj.fct = fct;
back = dk4dbi_traverse(db, &myobj, dk4dbi_c8_internal_traverse);
}
-#line 339 "dk4dbit8.ctr"
+#line 358 "dk4dbit8.ctr"
return back;
}
diff --git a/support/dktools/dk4dbit8.ctr b/support/dktools/dk4dbit8.ctr
index 2b51c1a52f..91a3145e7b 100644
--- a/support/dktools/dk4dbit8.ctr
+++ b/support/dktools/dk4dbit8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,20 @@ license = bsd
/** @file dk4dbit8.h Text in database.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DBI_H_INCLUDED
-#include <dk4dbi.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbi.h"
+#else
+#include <dktools-4/dk4dbi.h>
+#endif
#endif
/** Traverse simple database containing text.
@@ -147,6 +159,13 @@ dk4dbi_c8_traverse(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4str8.h"
#include "dk4dbit8.h"
#include "dk4maasz.h"
diff --git a/support/dktools/dk4dbit8.h b/support/dktools/dk4dbit8.h
index e24e1b449e..bcd4c6f68f 100644
--- a/support/dktools/dk4dbit8.h
+++ b/support/dktools/dk4dbit8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbit8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbit8.ctr
*/
#ifndef DK4DBIT8_H_INCLUDED
@@ -43,8 +21,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4dbit8.h Text in database.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DBI_H_INCLUDED
-#include <dk4dbi.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbi.h"
+#else
+#include <dktools-4/dk4dbi.h>
+#endif
#endif
/** Traverse simple database containing text.
diff --git a/support/dktools/dk4dbitw.c b/support/dktools/dk4dbitw.c
index 3490dbc20a..2df7b74f8b 100644
--- a/support/dktools/dk4dbitw.c
+++ b/support/dktools/dk4dbitw.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbitw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbitw.ctr
*/
/** @file dk4dbitw.c The dk4dbitw module.
*/
-#line 153 "dk4dbitw.ctr"
+#line 165 "dk4dbitw.ctr"
#include "dk4conf.h"
@@ -49,7 +27,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 163 "dk4dbitw.ctr"
+#line 175 "dk4dbitw.ctr"
diff --git a/support/dktools/dk4dbitw.ctr b/support/dktools/dk4dbitw.ctr
index 5da31311ed..570e64a78a 100644
--- a/support/dktools/dk4dbitw.ctr
+++ b/support/dktools/dk4dbitw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,20 @@ license = bsd
/** @file dk4dbitw.h Text (wchar_t) in database.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DBI_H_INCLUDED
-#include <dk4dbi.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbi.h"
+#else
+#include <dktools-4/dk4dbi.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
diff --git a/support/dktools/dk4dbitw.h b/support/dktools/dk4dbitw.h
index 1568146950..2429a6202e 100644
--- a/support/dktools/dk4dbitw.h
+++ b/support/dktools/dk4dbitw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbitw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbitw.ctr
*/
#ifndef DK4DBITW_H_INCLUDED
@@ -43,8 +21,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4dbitw.h Text (wchar_t) in database.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DBI_H_INCLUDED
-#include <dk4dbi.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4dbi.h"
+#else
+#include <dktools-4/dk4dbi.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
diff --git a/support/dktools/dk4dblc8.c b/support/dktools/dk4dblc8.c
index 7126f37df0..b355cae20e 100644
--- a/support/dktools/dk4dblc8.c
+++ b/support/dktools/dk4dblc8.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dblc8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dblc8.ctr
*/
/** @file dk4dblc8.c The dk4dblc8 module.
*/
-#line 62 "dk4dblc8.ctr"
+#line 74 "dk4dblc8.ctr"
+#include "dk4conf.h"
#include "dk4dblc8.h"
#include "dk4str8.h"
diff --git a/support/dktools/dk4dblc8.ctr b/support/dktools/dk4dblc8.ctr
index ca3dec91b0..b9cbf7898e 100644
--- a/support/dktools/dk4dblc8.ctr
+++ b/support/dktools/dk4dblc8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -60,6 +72,7 @@ dk4double_to_string_c8(char *dptr, size_t szdptr, double v, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4dblc8.h"
#include "dk4str8.h"
diff --git a/support/dktools/dk4dblc8.h b/support/dktools/dk4dblc8.h
index 82131e4580..3ac4cfdebb 100644
--- a/support/dktools/dk4dblc8.h
+++ b/support/dktools/dk4dblc8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dblc8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dblc8.ctr
*/
#ifndef DK4DBLC8_H_INCLUDED
@@ -49,15 +27,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
diff --git a/support/dktools/dk4dbldk.c b/support/dktools/dk4dbldk.c
index 7a7aecd952..91ad5c31bf 100644
--- a/support/dktools/dk4dbldk.c
+++ b/support/dktools/dk4dbldk.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbldk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbldk.ctr
*/
/** @file dk4dbldk.c The dk4dbldk module.
*/
-#line 56 "dk4dbldk.ctr"
+#line 68 "dk4dbldk.ctr"
+#include "dk4conf.h"
#include "dk4dbldk.h"
#if DK4_CHAR_SIZE > 1
diff --git a/support/dktools/dk4dbldk.ctr b/support/dktools/dk4dbldk.ctr
index 62f8628311..ec82c56830 100644
--- a/support/dktools/dk4dbldk.ctr
+++ b/support/dktools/dk4dbldk.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -54,6 +66,7 @@ dk4double_to_string(dkChar *dptr, size_t szdptr, double v, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4dbldk.h"
#if DK4_CHAR_SIZE > 1
diff --git a/support/dktools/dk4dbldk.h b/support/dktools/dk4dbldk.h
index e9f18d6455..6ae1818376 100644
--- a/support/dktools/dk4dbldk.h
+++ b/support/dktools/dk4dbldk.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dbldk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dbldk.ctr
*/
#ifndef DK4DBLDK_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4dblwc.c b/support/dktools/dk4dblwc.c
index 3ba64a52f3..a29fe4807d 100644
--- a/support/dktools/dk4dblwc.c
+++ b/support/dktools/dk4dblwc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dblwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dblwc.ctr
*/
/** @file dk4dblwc.c The dk4dblwc module.
*/
-#line 69 "dk4dblwc.ctr"
+#line 81 "dk4dblwc.ctr"
#include "dk4conf.h"
#include "dk4types.h"
diff --git a/support/dktools/dk4dblwc.ctr b/support/dktools/dk4dblwc.ctr
index 2b2100527d..24ceceb8f3 100644
--- a/support/dktools/dk4dblwc.ctr
+++ b/support/dktools/dk4dblwc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -17,15 +17,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
diff --git a/support/dktools/dk4dblwc.h b/support/dktools/dk4dblwc.h
index 3b843b5c58..2773bcf853 100644
--- a/support/dktools/dk4dblwc.h
+++ b/support/dktools/dk4dblwc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dblwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dblwc.ctr
*/
#ifndef DK4DBLWC_H_INCLUDED
@@ -49,15 +27,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
diff --git a/support/dktools/dk4dec.h b/support/dktools/dk4dec.h
index 030e42915d..b01b050b08 100644
--- a/support/dktools/dk4dec.h
+++ b/support/dktools/dk4dec.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4DEC_H_INCLUDED
#define DK4DEC_H_INCLUDED 1
diff --git a/support/dktools/dk4deldir.c b/support/dktools/dk4deldir.c
index b40ae60d17..ca1c056ef6 100644
--- a/support/dktools/dk4deldir.c
+++ b/support/dktools/dk4deldir.c
@@ -1,45 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4deldir.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4deldir.ctr
*/
/** @file dk4deldir.c The dk4deldir module.
*/
-#line 59 "dk4deldir.ctr"
-
+#line 71 "dk4deldir.ctr"
+#include "dk4conf.h"
#ifndef DK4DELDIR_H_INCLUDED
#include "dk4deldir.h"
@@ -51,11 +29,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4deldir08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4delete_directory(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4delete_directory_wc(fn, erp));
#else
diff --git a/support/dktools/dk4deldir.ctr b/support/dktools/dk4deldir.ctr
index e9110c5772..b3c590df53 100644
--- a/support/dktools/dk4deldir.ctr
+++ b/support/dktools/dk4deldir.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -57,7 +69,7 @@ dk4delete_directory(const dkChar *fn, dk4_er_t *erp);
%% module
-
+#include "dk4conf.h"
#ifndef DK4DELDIR_H_INCLUDED
#include "dk4deldir.h"
@@ -69,11 +81,20 @@ dk4delete_directory(const dkChar *fn, dk4_er_t *erp);
#include "dk4deldir08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4delete_directory(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4delete_directory_wc(fn, erp));
#else
diff --git a/support/dktools/dk4deldir.h b/support/dktools/dk4deldir.h
index 9f4e5e5ed8..69e5582907 100644
--- a/support/dktools/dk4deldir.h
+++ b/support/dktools/dk4deldir.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4deldir.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4deldir.ctr
*/
#ifndef DK4DELDIR_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4deldir08.c b/support/dktools/dk4deldir08.c
index a143423d84..5b8ffcaf85 100644
--- a/support/dktools/dk4deldir08.c
+++ b/support/dktools/dk4deldir08.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4deldir08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4deldir08.ctr
*/
/** @file dk4deldir08.c The dk4deldir08 module.
*/
-#line 59 "dk4deldir08.ctr"
+#line 71 "dk4deldir08.ctr"
#include "dk4conf.h"
@@ -67,11 +45,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <errno.h>
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 91 "dk4deldir08.ctr"
+#line 109 "dk4deldir08.ctr"
@@ -81,10 +65,13 @@ dk4delete_directory_c8(const char *fn, dk4_er_t *erp)
int back = 0;
-#line 99 "dk4deldir08.ctr"
+#line 117 "dk4deldir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
-#line 100 "dk4deldir08.ctr"
+#line 121 "dk4deldir08.ctr"
#if DK4_ON_WINDOWS
/* +++ Windows */
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
@@ -123,11 +110,11 @@ dk4delete_directory_c8(const char *fn, dk4_er_t *erp)
#endif
} else {
-#line 137 "dk4deldir08.ctr"
+#line 158 "dk4deldir08.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 139 "dk4deldir08.ctr"
+#line 160 "dk4deldir08.ctr"
return back;
}
diff --git a/support/dktools/dk4deldir08.ctr b/support/dktools/dk4deldir08.ctr
index c172fbbbb4..0fddbbd5de 100644
--- a/support/dktools/dk4deldir08.ctr
+++ b/support/dktools/dk4deldir08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -85,6 +97,12 @@ dk4delete_directory_c8(const char *fn, dk4_er_t *erp);
#include <errno.h>
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -96,6 +114,9 @@ dk4delete_directory_c8(const char *fn, dk4_er_t *erp)
{
int back = 0;
$? "+ dk4delete_directory_c8 \"%!8s\"", TR_8STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) { $? ". fn ok"
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4deldir08.h b/support/dktools/dk4deldir08.h
index 5adb8ff7fb..ea7dec4feb 100644
--- a/support/dktools/dk4deldir08.h
+++ b/support/dktools/dk4deldir08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4deldir08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4deldir08.ctr
*/
#ifndef DK4DELDIR08_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4deldirwc.c b/support/dktools/dk4deldirwc.c
index 78f0e0490a..2a7e807820 100644
--- a/support/dktools/dk4deldirwc.c
+++ b/support/dktools/dk4deldirwc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4deldirwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4deldirwc.ctr
*/
/** @file dk4deldirwc.c The dk4deldirwc module.
*/
-#line 59 "dk4deldirwc.ctr"
+#line 71 "dk4deldirwc.ctr"
#include "dk4conf.h"
@@ -63,12 +41,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <errno.h>
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4delete_directory_wc(const wchar_t *fn, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4deldirwc.ctr b/support/dktools/dk4deldirwc.ctr
index e2ea89d040..1f4d12925a 100644
--- a/support/dktools/dk4deldirwc.ctr
+++ b/support/dktools/dk4deldirwc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -81,12 +93,21 @@ dk4delete_directory_wc(const wchar_t *fn, dk4_er_t *erp);
#include <errno.h>
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4delete_directory_wc(const wchar_t *fn, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4deldirwc.h b/support/dktools/dk4deldirwc.h
index 195bce9a64..b9889e8c81 100644
--- a/support/dktools/dk4deldirwc.h
+++ b/support/dktools/dk4deldirwc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4deldirwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4deldirwc.ctr
*/
#ifndef DK4DELDIRWC_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4delfile.c b/support/dktools/dk4delfile.c
index c4e93cab3e..fca091fd85 100644
--- a/support/dktools/dk4delfile.c
+++ b/support/dktools/dk4delfile.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4delfile.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4delfile.ctr
*/
/** @file dk4delfile.c The dk4delfile module.
*/
-#line 58 "dk4delfile.ctr"
+#line 70 "dk4delfile.ctr"
+#include "dk4conf.h"
#include "dk4delfile.h"
#if DK4_CHAR_SIZE > 1
@@ -47,11 +26,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4delfile08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4delete_file(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4delete_file_wc(fn, erp));
#else
diff --git a/support/dktools/dk4delfile.ctr b/support/dktools/dk4delfile.ctr
index f090f35331..d7df208a00 100644
--- a/support/dktools/dk4delfile.ctr
+++ b/support/dktools/dk4delfile.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,6 +68,7 @@ dk4delete_file(const dkChar *fn, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4delfile.h"
#if DK4_CHAR_SIZE > 1
@@ -64,11 +77,20 @@ dk4delete_file(const dkChar *fn, dk4_er_t *erp);
#include "dk4delfile08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4delete_file(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4delete_file_wc(fn, erp));
#else
diff --git a/support/dktools/dk4delfile.h b/support/dktools/dk4delfile.h
index e9a0161f22..6e8521add6 100644
--- a/support/dktools/dk4delfile.h
+++ b/support/dktools/dk4delfile.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4delfile.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4delfile.ctr
*/
#ifndef DK4DELFILE_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4delfile08.c b/support/dktools/dk4delfile08.c
index 9d80c63bb2..fa219d7716 100644
--- a/support/dktools/dk4delfile08.c
+++ b/support/dktools/dk4delfile08.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4delfile08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4delfile08.ctr
*/
/** @file dk4delfile08.c The dk4delfile08 module.
*/
-#line 60 "dk4delfile08.ctr"
+#line 72 "dk4delfile08.ctr"
#include "dk4conf.h"
@@ -52,6 +30,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_ERRNO_H
#ifndef ERRNO_H_INCLUDED
#include <errno.h>
@@ -79,6 +64,9 @@ int
dk4delete_file_c8(const char *fn, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4delfile08.ctr b/support/dktools/dk4delfile08.ctr
index 5a81337aa9..7afa6b3cfa 100644
--- a/support/dktools/dk4delfile08.ctr
+++ b/support/dktools/dk4delfile08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -71,6 +83,13 @@ dk4delete_file_c8(const char *fn, dk4_er_t *erp);
#include <stdio.h>
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_ERRNO_H
#ifndef ERRNO_H_INCLUDED
#include <errno.h>
@@ -98,6 +117,9 @@ int
dk4delete_file_c8(const char *fn, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4delfile08.h b/support/dktools/dk4delfile08.h
index afd3e52cfd..33021a946a 100644
--- a/support/dktools/dk4delfile08.h
+++ b/support/dktools/dk4delfile08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4delfile08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4delfile08.ctr
*/
#ifndef DK4DELFILE08_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4delfilewc.c b/support/dktools/dk4delfilewc.c
index 29bb0b6179..acbd5d980a 100644
--- a/support/dktools/dk4delfilewc.c
+++ b/support/dktools/dk4delfilewc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4delfilewc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4delfilewc.ctr
*/
/** @file dk4delfilewc.c The dk4delfilewc module.
*/
-#line 60 "dk4delfilewc.ctr"
+#line 72 "dk4delfilewc.ctr"
#include "dk4conf.h"
@@ -52,6 +30,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_WCHAR_H
#ifndef WCHAR_H_INCLUDED
#include <wchar.h>
@@ -86,6 +71,9 @@ int
dk4delete_file_wc(const wchar_t *fn, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4delfilewc.ctr b/support/dktools/dk4delfilewc.ctr
index 4b5d2c5a79..595f2f45be 100644
--- a/support/dktools/dk4delfilewc.ctr
+++ b/support/dktools/dk4delfilewc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -71,6 +83,13 @@ dk4delete_file_wc(const wchar_t *fn, dk4_er_t *erp);
#include <stdio.h>
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_WCHAR_H
#ifndef WCHAR_H_INCLUDED
#include <wchar.h>
@@ -105,6 +124,9 @@ int
dk4delete_file_wc(const wchar_t *fn, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4delfilewc.h b/support/dktools/dk4delfilewc.h
index c7ef400e40..72ba952616 100644
--- a/support/dktools/dk4delfilewc.h
+++ b/support/dktools/dk4delfilewc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4delfilewc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4delfilewc.ctr
*/
#ifndef DK4DELFILEWC_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4dir.c b/support/dktools/dk4dir.c
index fef2f2508b..8182b06143 100644
--- a/support/dktools/dk4dir.c
+++ b/support/dktools/dk4dir.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dir.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dir.ctr
*/
/** @file dk4dir.c The dk4dir module.
*/
-#line 166 "dk4dir.ctr"
+#line 235 "dk4dir.ctr"
+#include "dk4conf.h"
#include "dk4dir.h"
#if DK4_CHAR_SIZE > 1
#include "dk4dirwc.h"
@@ -46,11 +25,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4dir08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
dk4_dir_t *
dk4dir_open(const dkChar *path, int om, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_open(path, om, erp));
#else
@@ -63,6 +51,9 @@ dk4dir_open(const dkChar *path, int om, dk4_er_t *erp)
void
dk4dir_close(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
dk4dir_wc_close(dptr);
#else
@@ -75,6 +66,9 @@ dk4dir_close(dk4_dir_t *dptr)
void
dk4dir_reset(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
dk4dir_wc_reset(dptr);
#else
@@ -85,8 +79,11 @@ dk4dir_reset(dk4_dir_t *dptr)
const dkChar *
-dk4dir_get_path(dk4_dir_t *dptr)
+dk4dir_get_path(dk4_dir_t const *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_get_path(dptr));
#else
@@ -99,6 +96,9 @@ dk4dir_get_path(dk4_dir_t *dptr)
const dkChar *
dk4dir_next_dir(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_next_dir(dptr));
#else
@@ -111,6 +111,9 @@ dk4dir_next_dir(dk4_dir_t *dptr)
const dkChar *
dk4dir_next_file(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_next_file(dptr));
#else
@@ -124,6 +127,9 @@ dk4dir_next_file(dk4_dir_t *dptr)
void
dk4dir_skip_files(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
dk4dir_wc_skip_files(dptr);
#else
@@ -134,8 +140,11 @@ dk4dir_skip_files(dk4_dir_t *dptr)
size_t
-dk4dir_get_max_entry_length(dk4_dir_t *dptr)
+dk4dir_get_max_entry_length(dk4_dir_t const *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_get_max_entry_length(dptr));
#else
@@ -143,3 +152,57 @@ dk4dir_get_max_entry_length(dk4_dir_t *dptr)
#endif
}
+
+
+int
+dk4dir_full_name_buffer(
+ dkChar *buffer,
+ size_t szbuf,
+ dk4_dir_t const *pdir,
+ dkChar const *fn,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (
+ dk4dir_wc_full_name_buffer(buffer, szbuf, pdir, fn, erp)
+ );
+#else
+ return (
+ dk4dir_c8_full_name_buffer(buffer, szbuf, pdir, fn, erp)
+ );
+#endif
+}
+
+
+
+dkChar *
+dk4dir_full_name_new(
+ dk4_dir_t const *pdir,
+ dkChar const *fn,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (
+ dk4dir_wc_full_name_new(pdir, fn, erp)
+ );
+#else
+ return (
+ dk4dir_c8_full_name_new(pdir, fn, erp)
+ );
+#endif
+}
+
+
+
diff --git a/support/dktools/dk4dir.ctr b/support/dktools/dk4dir.ctr
index b554f6c37b..ee2fde3358 100644
--- a/support/dktools/dk4dir.ctr
+++ b/support/dktools/dk4dir.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,24 +16,44 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_CHAR_SIZE > 1
#ifndef DK4DIRWC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dirwc.h"
+#else
+#include <dktools-4/dk4dirwc.h>
+#endif
#endif
#else
#ifndef DK4DIR08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir08.h"
+#else
+#include <dktools-4/dk4dir08.h>
+#endif
#endif
#endif
@@ -103,7 +123,7 @@ dk4dir_reset(dk4_dir_t *dptr);
file name expansion.
*/
const dkChar *
-dk4dir_get_path(dk4_dir_t *dptr);
+dk4dir_get_path(dk4_dir_t const *dptr);
/** Retrieve next directory name.
@param dptr Directory structure.
@@ -132,7 +152,56 @@ dk4dir_skip_files(dk4_dir_t *dptr);
@return Maximum name length.
*/
size_t
-dk4dir_get_max_entry_length(dk4_dir_t *dptr);
+dk4dir_get_max_entry_length(dk4_dir_t const *dptr);
+
+/** Create full path name for short file name in existing buffer.
+ @param buffer Result buffer.
+ @param szbuf Size of result buffer (number of dkChar).
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, pdir or fn is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4dir_full_name_buffer(
+ dkChar *buffer,
+ size_t szbuf,
+ dk4_dir_t const *pdir,
+ dkChar const *fn,
+ dk4_er_t *erp
+);
+
+/** Create full path name for short file name in newly allocated buffer.
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated buffer on success,
+ NULL on error.
+ On success use dk4mem_free() to release the memory when done with
+ the name.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdir or fn is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+dkChar *
+dk4dir_full_name_new(
+ dk4_dir_t const *pdir,
+ dkChar const *fn,
+ dk4_er_t *erp
+);
#ifdef __cplusplus
}
@@ -164,6 +233,7 @@ enum {
%% module
+#include "dk4conf.h"
#include "dk4dir.h"
#if DK4_CHAR_SIZE > 1
#include "dk4dirwc.h"
@@ -171,11 +241,20 @@ enum {
#include "dk4dir08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
dk4_dir_t *
dk4dir_open(const dkChar *path, int om, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_open(path, om, erp));
#else
@@ -188,6 +267,9 @@ dk4dir_open(const dkChar *path, int om, dk4_er_t *erp)
void
dk4dir_close(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
dk4dir_wc_close(dptr);
#else
@@ -200,6 +282,9 @@ dk4dir_close(dk4_dir_t *dptr)
void
dk4dir_reset(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
dk4dir_wc_reset(dptr);
#else
@@ -210,8 +295,11 @@ dk4dir_reset(dk4_dir_t *dptr)
const dkChar *
-dk4dir_get_path(dk4_dir_t *dptr)
+dk4dir_get_path(dk4_dir_t const *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_get_path(dptr));
#else
@@ -224,6 +312,9 @@ dk4dir_get_path(dk4_dir_t *dptr)
const dkChar *
dk4dir_next_dir(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_next_dir(dptr));
#else
@@ -236,6 +327,9 @@ dk4dir_next_dir(dk4_dir_t *dptr)
const dkChar *
dk4dir_next_file(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_next_file(dptr));
#else
@@ -249,6 +343,9 @@ dk4dir_next_file(dk4_dir_t *dptr)
void
dk4dir_skip_files(dk4_dir_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
dk4dir_wc_skip_files(dptr);
#else
@@ -259,8 +356,11 @@ dk4dir_skip_files(dk4_dir_t *dptr)
size_t
-dk4dir_get_max_entry_length(dk4_dir_t *dptr)
+dk4dir_get_max_entry_length(dk4_dir_t const *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4dir_wc_get_max_entry_length(dptr));
#else
@@ -268,3 +368,57 @@ dk4dir_get_max_entry_length(dk4_dir_t *dptr)
#endif
}
+
+
+int
+dk4dir_full_name_buffer(
+ dkChar *buffer,
+ size_t szbuf,
+ dk4_dir_t const *pdir,
+ dkChar const *fn,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (
+ dk4dir_wc_full_name_buffer(buffer, szbuf, pdir, fn, erp)
+ );
+#else
+ return (
+ dk4dir_c8_full_name_buffer(buffer, szbuf, pdir, fn, erp)
+ );
+#endif
+}
+
+
+
+dkChar *
+dk4dir_full_name_new(
+ dk4_dir_t const *pdir,
+ dkChar const *fn,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (
+ dk4dir_wc_full_name_new(pdir, fn, erp)
+ );
+#else
+ return (
+ dk4dir_c8_full_name_new(pdir, fn, erp)
+ );
+#endif
+}
+
+
+
diff --git a/support/dktools/dk4dir.h b/support/dktools/dk4dir.h
index b3bb35823b..3167ec4e1d 100644
--- a/support/dktools/dk4dir.h
+++ b/support/dktools/dk4dir.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dir.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dir.ctr
*/
#ifndef DK4DIR_H_INCLUDED
@@ -48,24 +26,44 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_CHAR_SIZE > 1
#ifndef DK4DIRWC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dirwc.h"
+#else
+#include <dktools-4/dk4dirwc.h>
+#endif
#endif
#else
#ifndef DK4DIR08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir08.h"
+#else
+#include <dktools-4/dk4dir08.h>
+#endif
#endif
#endif
@@ -135,7 +133,7 @@ dk4dir_reset(dk4_dir_t *dptr);
file name expansion.
*/
const dkChar *
-dk4dir_get_path(dk4_dir_t *dptr);
+dk4dir_get_path(dk4_dir_t const *dptr);
/** Retrieve next directory name.
@param dptr Directory structure.
@@ -164,7 +162,56 @@ dk4dir_skip_files(dk4_dir_t *dptr);
@return Maximum name length.
*/
size_t
-dk4dir_get_max_entry_length(dk4_dir_t *dptr);
+dk4dir_get_max_entry_length(dk4_dir_t const *dptr);
+
+/** Create full path name for short file name in existing buffer.
+ @param buffer Result buffer.
+ @param szbuf Size of result buffer (number of dkChar).
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, pdir or fn is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4dir_full_name_buffer(
+ dkChar *buffer,
+ size_t szbuf,
+ dk4_dir_t const *pdir,
+ dkChar const *fn,
+ dk4_er_t *erp
+);
+
+/** Create full path name for short file name in newly allocated buffer.
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated buffer on success,
+ NULL on error.
+ On success use dk4mem_free() to release the memory when done with
+ the name.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdir or fn is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+dkChar *
+dk4dir_full_name_new(
+ dk4_dir_t const *pdir,
+ dkChar const *fn,
+ dk4_er_t *erp
+);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4dir08.c b/support/dktools/dk4dir08.c
index 3fc428de58..f7e3146a71 100644
--- a/support/dktools/dk4dir08.c
+++ b/support/dktools/dk4dir08.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dir08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dir08.ctr
*/
/** @file dk4dir08.c The dk4dir08 module.
*/
-#line 146 "dk4dir08.ctr"
+#line 211 "dk4dir08.ctr"
#include "dk4conf.h"
@@ -54,6 +32,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4dir.h"
#endif
+#ifndef DK4PATH8_H_INCLUDED
+#include "dk4path8.h"
+#endif
+
#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
#endif
@@ -95,18 +77,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
-#line 206 "dk4dir08.ctr"
+#line 284 "dk4dir08.ctr"
int
-dk4dir_c8_compare(const void *l, const void *r, int cr)
+dk4dir_c8_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
int back = 0;
+
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
back = dk4str8_pathcmp((const char *)l, (const char *)r);
@@ -145,7 +138,10 @@ dk4dir_c8_close(dk4_dir_c8_t *dptr)
{
-#line 250 "dk4dir08.ctr"
+#line 330 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
dk4mem_release(dptr->path);
dk4dir_c8_clean_storage(dptr->s_dir, dptr->i_dir);
@@ -156,7 +152,7 @@ dk4dir_c8_close(dk4_dir_c8_t *dptr)
}
-#line 259 "dk4dir08.ctr"
+#line 342 "dk4dir08.ctr"
}
@@ -183,7 +179,7 @@ static const char * const dk4dir_c8_kw[] = {
NULL
-#line 289 "dk4dir08.ctr"
+#line 372 "dk4dir08.ctr"
};
@@ -203,7 +199,10 @@ dk4dir_c8_fill_directory(dk4_dir_c8_t *dptr, int om, dk4_er_t *erp)
int back = 0;
-#line 307 "dk4dir08.ctr"
+#line 390 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (dk4str8_cpy_s(pab, sizeof(pab), dptr->path, erp)) {
if (dk4str8_cat_s(pab, sizeof(pab), dk4dir_c8_kw[3], erp)) {
if (dk4str8_cat_s(pab, sizeof(pab), dk4dir_c8_kw[4], erp)) {
@@ -257,7 +256,7 @@ dk4dir_c8_fill_directory(dk4_dir_c8_t *dptr, int om, dk4_er_t *erp)
}
-#line 359 "dk4dir08.ctr"
+#line 445 "dk4dir08.ctr"
return back;
#else
char fnb[DK4_MAX_PATH]; /* File name buffer */
@@ -270,12 +269,15 @@ dk4dir_c8_fill_directory(dk4_dir_c8_t *dptr, int om, dk4_er_t *erp)
int back = 0;
-#line 370 "dk4dir08.ctr"
+#line 456 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
errno = 0;
dir = opendir(dptr->path);
if (NULL != dir) {
-#line 373 "dk4dir08.ctr"
+#line 462 "dk4dir08.ctr"
back = 1;
do {
de = readdir(dir);
@@ -303,7 +305,7 @@ dk4dir_c8_fill_directory(dk4_dir_c8_t *dptr, int om, dk4_er_t *erp)
}
} else {
-#line 399 "dk4dir08.ctr"
+#line 488 "dk4dir08.ctr"
#if 0
/* 2015-04-11 Dangling links are not
directories.
@@ -315,35 +317,35 @@ dk4dir_c8_fill_directory(dk4_dir_c8_t *dptr, int om, dk4_er_t *erp)
if (0 == dk4sto_add(dptr->s_dir, (void *)nn, erp)) {
back = 0;
-#line 409 "dk4dir08.ctr"
+#line 498 "dk4dir08.ctr"
dk4mem_free(nn);
}
} else {
if (0 == dk4sto_add(dptr->s_file, (void *)nn, erp)) {
back = 0;
-#line 414 "dk4dir08.ctr"
+#line 503 "dk4dir08.ctr"
dk4mem_free(nn);
}
}
} else {
-#line 418 "dk4dir08.ctr"
+#line 507 "dk4dir08.ctr"
back = 0;
}
} else {
-#line 421 "dk4dir08.ctr"
+#line 510 "dk4dir08.ctr"
back = 0;
}
} else {
-#line 424 "dk4dir08.ctr"
+#line 513 "dk4dir08.ctr"
back = 0;
}
} else {
-#line 427 "dk4dir08.ctr"
+#line 516 "dk4dir08.ctr"
back = 0;
}
}
@@ -354,11 +356,11 @@ dk4dir_c8_fill_directory(dk4_dir_c8_t *dptr, int om, dk4_er_t *erp)
closedir(dir);
} else {
-#line 436 "dk4dir08.ctr"
+#line 525 "dk4dir08.ctr"
dk4error_set_idetails(erp, DK4_E_OPENDIR_FAILED, errno);
}
-#line 438 "dk4dir08.ctr"
+#line 527 "dk4dir08.ctr"
return back;
#endif
}
@@ -373,7 +375,10 @@ dk4dir_c8_open(const char *path, int om, dk4_er_t *erp)
int ok = 0;
-#line 451 "dk4dir08.ctr"
+#line 540 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS || DK4_HAVE_DIRENT_H
back = dk4mem_new(dk4_dir_c8_t, 1, erp);
@@ -419,7 +424,7 @@ dk4dir_c8_open(const char *path, int om, dk4_er_t *erp)
}
-#line 495 "dk4dir08.ctr"
+#line 587 "dk4dir08.ctr"
return back;
}
@@ -430,7 +435,10 @@ dk4dir_c8_reset(dk4_dir_c8_t *dptr)
{
-#line 504 "dk4dir08.ctr"
+#line 596 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_dir) && (NULL != dptr->i_dir)) {
dk4sto_it_reset(dptr->i_dir);
@@ -441,24 +449,27 @@ dk4dir_c8_reset(dk4_dir_c8_t *dptr)
}
-#line 513 "dk4dir08.ctr"
+#line 608 "dk4dir08.ctr"
}
const char *
-dk4dir_c8_get_path(dk4_dir_c8_t *dptr)
+dk4dir_c8_get_path(dk4_dir_c8_t const *dptr)
{
const char *back = NULL;
-#line 522 "dk4dir08.ctr"
+#line 617 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
back = (const char *)(dptr->path);
}
-#line 526 "dk4dir08.ctr"
+#line 624 "dk4dir08.ctr"
return back;
}
@@ -470,7 +481,10 @@ dk4dir_c8_next_dir(dk4_dir_c8_t *dptr)
const char *back = NULL;
-#line 536 "dk4dir08.ctr"
+#line 634 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_dir) && (NULL != dptr->i_dir)) {
back = (const char *)dk4sto_it_next(dptr->i_dir);
@@ -478,7 +492,7 @@ dk4dir_c8_next_dir(dk4_dir_c8_t *dptr)
}
-#line 542 "dk4dir08.ctr"
+#line 643 "dk4dir08.ctr"
return back;
}
@@ -490,7 +504,10 @@ dk4dir_c8_next_file(dk4_dir_c8_t *dptr)
const char *back = NULL;
-#line 552 "dk4dir08.ctr"
+#line 653 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_file) && (NULL != dptr->i_file)) {
back = (const char *)dk4sto_it_next(dptr->i_file);
@@ -498,7 +515,7 @@ dk4dir_c8_next_file(dk4_dir_c8_t *dptr)
}
-#line 558 "dk4dir08.ctr"
+#line 662 "dk4dir08.ctr"
return back;
}
@@ -509,31 +526,87 @@ dk4dir_c8_skip_files(dk4_dir_c8_t *dptr)
{
-#line 567 "dk4dir08.ctr"
+#line 671 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
dk4dir_c8_clean_storage(dptr->s_file, dptr->i_file);
dptr->s_file = NULL; dptr->i_file = NULL;
}
-#line 572 "dk4dir08.ctr"
+#line 679 "dk4dir08.ctr"
}
size_t
-dk4dir_c8_get_max_entry_length(dk4_dir_c8_t *dptr)
+dk4dir_c8_get_max_entry_length(dk4_dir_c8_t const *dptr)
{
size_t back = 0;
-#line 581 "dk4dir08.ctr"
+#line 688 "dk4dir08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
back = dptr->maxlen;
}
-#line 585 "dk4dir08.ctr"
+#line 695 "dk4dir08.ctr"
+ return back;
+}
+
+
+
+int
+dk4dir_c8_full_name_buffer(
+ char *buffer,
+ size_t szbuf,
+ dk4_dir_c8_t const *pdir,
+ char const *fn,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+#endif
+ if ((NULL != buffer) && (NULL != pdir) && (NULL != fn) && (0 < szbuf)) {
+ back = dk4path8_concatenate_buffer(buffer, szbuf, pdir->path, fn, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+char *
+dk4dir_c8_full_name_new(
+ dk4_dir_c8_t const *pdir,
+ char const *fn,
+ dk4_er_t *erp
+)
+{
+ char *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+#endif
+ if ((NULL != pdir) && (NULL != fn)) {
+ back = dk4path8_concatenate_new(pdir->path, fn, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
return back;
}
diff --git a/support/dktools/dk4dir08.ctr b/support/dktools/dk4dir08.ctr
index 4759371680..d65209f148 100644
--- a/support/dktools/dk4dir08.ctr
+++ b/support/dktools/dk4dir08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,19 +15,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
@@ -98,7 +114,7 @@ dk4dir_c8_reset(dk4_dir_c8_t *dptr);
file name expansion.
*/
const char *
-dk4dir_c8_get_path(dk4_dir_c8_t *dptr);
+dk4dir_c8_get_path(dk4_dir_c8_t const *dptr);
/** Retrieve next directory name.
@param dptr Directory structure.
@@ -136,7 +152,56 @@ dk4dir_c8_compare(const void *l, const void *r, int cr);
@return Maximum name length.
*/
size_t
-dk4dir_c8_get_max_entry_length(dk4_dir_c8_t *dptr);
+dk4dir_c8_get_max_entry_length(dk4_dir_c8_t const *dptr);
+
+/** Create full path name for short file name in existing buffer.
+ @param buffer Result buffer.
+ @param szbuf Size of result buffer.
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4dir_c8_full_name_buffer(
+ char *buffer,
+ size_t szbuf,
+ dk4_dir_c8_t const *pdir,
+ char const *fn,
+ dk4_er_t *erp
+);
+
+/** Create full path name for short file name in newly allocated buffer.
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated buffer on success,
+ NULL on error.
+ On success use dk4mem_free() to release the memory when done with
+ the name.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdir or fn is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+char *
+dk4dir_c8_full_name_new(
+ dk4_dir_c8_t const *pdir,
+ char const *fn,
+ dk4_er_t *erp
+);
#ifdef __cplusplus
}
@@ -159,6 +224,10 @@ dk4dir_c8_get_max_entry_length(dk4_dir_c8_t *dptr);
#include "dk4dir.h"
#endif
+#ifndef DK4PATH8_H_INCLUDED
+#include "dk4path8.h"
+#endif
+
#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
#endif
@@ -200,6 +269,15 @@ dk4dir_c8_get_max_entry_length(dk4_dir_c8_t *dptr);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
$!trace-include
@@ -207,9 +285,11 @@ $!trace-include
int
-dk4dir_c8_compare(const void *l, const void *r, int cr)
+dk4dir_c8_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
int back = 0;
+
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
back = dk4str8_pathcmp((const char *)l, (const char *)r);
@@ -247,6 +327,9 @@ void
dk4dir_c8_close(dk4_dir_c8_t *dptr)
{
$? "+ dk4dir_c8_close"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
dk4mem_release(dptr->path);
dk4dir_c8_clean_storage(dptr->s_dir, dptr->i_dir);
@@ -304,6 +387,9 @@ dk4dir_c8_fill_directory(dk4_dir_c8_t *dptr, int om, dk4_er_t *erp)
int isdir; /* Flag: Entry is directory */
int back = 0;
$? "+ dk4dir_c8_fill_directory"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (dk4str8_cpy_s(pab, sizeof(pab), dptr->path, erp)) {
if (dk4str8_cat_s(pab, sizeof(pab), dk4dir_c8_kw[3], erp)) {
if (dk4str8_cat_s(pab, sizeof(pab), dk4dir_c8_kw[4], erp)) {
@@ -367,6 +453,9 @@ dk4dir_c8_fill_directory(dk4_dir_c8_t *dptr, int om, dk4_er_t *erp)
int isdir = 0; /* Flag: Current item is directory */
int back = 0;
$? "+ dk4dir_c8_fill_directory"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
errno = 0;
dir = opendir(dptr->path);
if (NULL != dir) { $? ". opendir"
@@ -448,6 +537,9 @@ dk4dir_c8_open(const char *path, int om, dk4_er_t *erp)
dk4_dir_c8_t *back = NULL;
int ok = 0;
$? "+ dk4dir_c8_open \"%!8s\"", TR_8STR(path)
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS || DK4_HAVE_DIRENT_H
back = dk4mem_new(dk4_dir_c8_t, 1, erp);
@@ -501,6 +593,9 @@ void
dk4dir_c8_reset(dk4_dir_c8_t *dptr)
{
$? "+ dk4dir_c8_reset"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_dir) && (NULL != dptr->i_dir)) {
dk4sto_it_reset(dptr->i_dir);
@@ -515,10 +610,13 @@ dk4dir_c8_reset(dk4_dir_c8_t *dptr)
const char *
-dk4dir_c8_get_path(dk4_dir_c8_t *dptr)
+dk4dir_c8_get_path(dk4_dir_c8_t const *dptr)
{
const char *back = NULL;
$? "+ dk4dir_c8_get_path"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
back = (const char *)(dptr->path);
}
@@ -533,6 +631,9 @@ dk4dir_c8_next_dir(dk4_dir_c8_t *dptr)
{
const char *back = NULL;
$? "+ dk4dir_c8_next_dir"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_dir) && (NULL != dptr->i_dir)) {
back = (const char *)dk4sto_it_next(dptr->i_dir);
@@ -549,6 +650,9 @@ dk4dir_c8_next_file(dk4_dir_c8_t *dptr)
{
const char *back = NULL;
$? "+ dk4dir_c8_next_file"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_file) && (NULL != dptr->i_file)) {
back = (const char *)dk4sto_it_next(dptr->i_file);
@@ -564,6 +668,9 @@ void
dk4dir_c8_skip_files(dk4_dir_c8_t *dptr)
{
$? "+ dk4dir_c8_skip_files"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
dk4dir_c8_clean_storage(dptr->s_file, dptr->i_file);
dptr->s_file = NULL; dptr->i_file = NULL;
@@ -574,10 +681,13 @@ dk4dir_c8_skip_files(dk4_dir_c8_t *dptr)
size_t
-dk4dir_c8_get_max_entry_length(dk4_dir_c8_t *dptr)
+dk4dir_c8_get_max_entry_length(dk4_dir_c8_t const *dptr)
{
size_t back = 0;
$? "+ dk4dir_c8_get_max_entry_length"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
back = dptr->maxlen;
}
@@ -586,3 +696,53 @@ dk4dir_c8_get_max_entry_length(dk4_dir_c8_t *dptr)
}
+
+int
+dk4dir_c8_full_name_buffer(
+ char *buffer,
+ size_t szbuf,
+ dk4_dir_c8_t const *pdir,
+ char const *fn,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+#endif
+ if ((NULL != buffer) && (NULL != pdir) && (NULL != fn) && (0 < szbuf)) {
+ back = dk4path8_concatenate_buffer(buffer, szbuf, pdir->path, fn, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+char *
+dk4dir_c8_full_name_new(
+ dk4_dir_c8_t const *pdir,
+ char const *fn,
+ dk4_er_t *erp
+)
+{
+ char *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+#endif
+ if ((NULL != pdir) && (NULL != fn)) {
+ back = dk4path8_concatenate_new(pdir->path, fn, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4dir08.h b/support/dktools/dk4dir08.h
index ff82352e32..d8fd907a9b 100644
--- a/support/dktools/dk4dir08.h
+++ b/support/dktools/dk4dir08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dir08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dir08.ctr
*/
#ifndef DK4DIR08_H_INCLUDED
@@ -47,19 +25,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
@@ -130,7 +124,7 @@ dk4dir_c8_reset(dk4_dir_c8_t *dptr);
file name expansion.
*/
const char *
-dk4dir_c8_get_path(dk4_dir_c8_t *dptr);
+dk4dir_c8_get_path(dk4_dir_c8_t const *dptr);
/** Retrieve next directory name.
@param dptr Directory structure.
@@ -168,7 +162,56 @@ dk4dir_c8_compare(const void *l, const void *r, int cr);
@return Maximum name length.
*/
size_t
-dk4dir_c8_get_max_entry_length(dk4_dir_c8_t *dptr);
+dk4dir_c8_get_max_entry_length(dk4_dir_c8_t const *dptr);
+
+/** Create full path name for short file name in existing buffer.
+ @param buffer Result buffer.
+ @param szbuf Size of result buffer.
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4dir_c8_full_name_buffer(
+ char *buffer,
+ size_t szbuf,
+ dk4_dir_c8_t const *pdir,
+ char const *fn,
+ dk4_er_t *erp
+);
+
+/** Create full path name for short file name in newly allocated buffer.
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated buffer on success,
+ NULL on error.
+ On success use dk4mem_free() to release the memory when done with
+ the name.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdir or fn is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+char *
+dk4dir_c8_full_name_new(
+ dk4_dir_c8_t const *pdir,
+ char const *fn,
+ dk4_er_t *erp
+);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4dira.c b/support/dktools/dk4dira.c
index b6671838b1..27fd5ee2bd 100644
--- a/support/dktools/dk4dira.c
+++ b/support/dktools/dk4dira.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dira.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dira.ctr
*/
/** @file dk4dira.c The dk4dira module.
*/
-#line 38 "dk4dira.ctr"
+#line 60 "dk4dira.ctr"
#include "dk4conf.h"
@@ -57,6 +35,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mem.h"
#include "dk4dira.h"
#include "dk4error.h"
@@ -68,7 +53,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 67 "dk4dira.ctr"
+#line 96 "dk4dira.ctr"
@@ -86,6 +71,9 @@ dk4dir_open_app(const dkChar *path, int om, dk4_app_t *app)
int found;
int res;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
dk4error_init(&er);
back = dk4dir_open(path, om, &er);
diff --git a/support/dktools/dk4dira.ctr b/support/dktools/dk4dira.ctr
index be79d99182..00a9909fd3 100644
--- a/support/dktools/dk4dira.ctr
+++ b/support/dktools/dk4dira.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,30 @@ license = bsd
/** @file dk4dira.h Directory operations with application support.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir.h"
+#else
+#include <dktools-4/dk4dir.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -54,6 +76,13 @@ dk4dir_open_app(const dkChar *path, int om, dk4_app_t *app);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mem.h"
#include "dk4dira.h"
#include "dk4error.h"
@@ -81,6 +110,9 @@ dk4dir_open_app(const dkChar *path, int om, dk4_app_t *app)
int found;
int res;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
dk4error_init(&er);
back = dk4dir_open(path, om, &er);
diff --git a/support/dktools/dk4dira.h b/support/dktools/dk4dira.h
index db8925a5a5..f6fa622eaf 100644
--- a/support/dktools/dk4dira.h
+++ b/support/dktools/dk4dira.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dira.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dira.ctr
*/
#ifndef DK4DIRA_H_INCLUDED
@@ -43,8 +21,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4dira.h Directory operations with application support.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir.h"
+#else
+#include <dktools-4/dk4dir.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4dirwc.c b/support/dktools/dk4dirwc.c
index 48396f8cc6..e27a4ec2d4 100644
--- a/support/dktools/dk4dirwc.c
+++ b/support/dktools/dk4dirwc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dirwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dirwc.ctr
*/
/** @file dk4dirwc.c The dk4dirwc module.
*/
-#line 146 "dk4dirwc.ctr"
+#line 211 "dk4dirwc.ctr"
#include "dk4conf.h"
@@ -54,6 +32,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4dir.h"
#endif
+#ifndef DK4PATHW_H_INCLUDED
+#include "dk4pathw.h"
+#endif
+
#ifndef DK4STR8_H_INCLUDED
#include "dk4strw.h"
#endif
@@ -106,20 +88,31 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
-#line 217 "dk4dirwc.ctr"
+
+
+#line 296 "dk4dirwc.ctr"
#if DK4_ON_WINDOWS
int
-dk4dir_wc_compare(const void *l, const void *r, int cr)
+dk4dir_wc_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
{
int back = 0;
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
back = dk4strw_pathcmp((const wchar_t *)l, (const wchar_t *)r);
@@ -158,6 +151,9 @@ dk4dir_wc_clean_storage(dk4_sto_t *s, dk4_sto_it_t *i)
void
dk4dir_wc_close(dk4_dir_wc_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
dk4mem_release(dptr->path);
dk4dir_wc_clean_storage(dptr->s_dir, dptr->i_dir);
@@ -192,7 +188,7 @@ L"*",
NULL
-#line 302 "dk4dirwc.ctr"
+#line 385 "dk4dirwc.ctr"
};
@@ -216,7 +212,12 @@ dk4dir_wc_fill_with_pab(
int back = 0;
-#line 324 "dk4dirwc.ctr"
+#line 407 "dk4dirwc.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != pab);
+ assert(0 < szpab);
+#endif
if (dk4strw_cpy_s(pab, szpab, dptr->path, erp)) {
if (dk4strw_cat_s(pab, szpab, dk4dir_wc_kw[3], erp)) {
if (dk4strw_cat_s(pab, szpab, dk4dir_wc_kw[4], erp)) {
@@ -270,7 +271,7 @@ dk4dir_wc_fill_with_pab(
}
-#line 376 "dk4dirwc.ctr"
+#line 464 "dk4dirwc.ctr"
return back;
}
@@ -281,6 +282,9 @@ int
dk4dir_wc_fill_with_local(dk4_dir_wc_t *dptr, int om, dk4_er_t *erp)
{
wchar_t pab[DK4_MAX_PATH];
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
return (dk4dir_wc_fill_with_pab(dptr, om, pab, DK4_SIZEOF(pab,wchar_t), erp));
}
@@ -301,6 +305,9 @@ dk4dir_wc_fill_directory(dk4_dir_wc_t *dptr, int om, dk4_er_t *erp)
size_t dptrlgt;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
dptrlgt = dk4strw_len(dptr->path);
if ((DK4_MAX_PATH - 2) > dptrlgt) {
back = dk4dir_wc_fill_with_local(dptr, om, erp);
@@ -325,12 +332,23 @@ dk4dir_wc_fill_directory(dk4_dir_wc_t *dptr, int om, dk4_er_t *erp)
dk4_dir_wc_t *
-dk4dir_wc_open(const wchar_t *path, int om, dk4_er_t *erp)
+dk4dir_wc_open(
+ const wchar_t *path,
+#if DK4_ON_WINDOWS
+ int om,
+#else
+ int DK4_ARG_UNUSED(om),
+#endif
+ dk4_er_t *erp
+)
{
dk4_dir_wc_t *back = NULL;
#if DK4_ON_WINDOWS
int ok = 0;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
back = dk4mem_new(dk4_dir_wc_t, 1, erp);
@@ -369,6 +387,7 @@ dk4dir_wc_open(const wchar_t *path, int om, dk4_er_t *erp)
}
}
#else
+ DK4_UNUSED_ARG(om)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
} else {
@@ -382,6 +401,9 @@ dk4dir_wc_open(const wchar_t *path, int om, dk4_er_t *erp)
void
dk4dir_wc_reset(dk4_dir_wc_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_dir) && (NULL != dptr->i_dir)) {
dk4sto_it_reset(dptr->i_dir);
@@ -395,9 +417,12 @@ dk4dir_wc_reset(dk4_dir_wc_t *dptr)
const wchar_t *
-dk4dir_wc_get_path(dk4_dir_wc_t *dptr)
+dk4dir_wc_get_path(dk4_dir_wc_t const *dptr)
{
const wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
back = (const wchar_t *)(dptr->path);
}
@@ -410,6 +435,9 @@ const wchar_t *
dk4dir_wc_next_dir(dk4_dir_wc_t *dptr)
{
const wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_dir) && (NULL != dptr->i_dir)) {
back = (const wchar_t *)dk4sto_it_next(dptr->i_dir);
@@ -424,6 +452,9 @@ const wchar_t *
dk4dir_wc_next_file(dk4_dir_wc_t *dptr)
{
const wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_file) && (NULL != dptr->i_file)) {
back = (const wchar_t *)dk4sto_it_next(dptr->i_file);
@@ -437,6 +468,9 @@ dk4dir_wc_next_file(dk4_dir_wc_t *dptr)
void
dk4dir_wc_skip_files(dk4_dir_wc_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
dk4dir_wc_clean_storage(dptr->s_file, dptr->i_file);
dptr->s_file = NULL; dptr->i_file = NULL;
@@ -446,12 +480,65 @@ dk4dir_wc_skip_files(dk4_dir_wc_t *dptr)
size_t
-dk4dir_wc_get_max_entry_length(dk4_dir_wc_t *dptr)
+dk4dir_wc_get_max_entry_length(dk4_dir_wc_t const *dptr)
{
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
back = dptr->maxlen;
}
return back;
}
+
+
+int
+dk4dir_wc_full_name_buffer(
+ wchar_t *buffer,
+ size_t szbuf,
+ dk4_dir_wc_t const *pdir,
+ wchar_t const *fn,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+#endif
+ if ((NULL != buffer) && (NULL != pdir) && (NULL != fn) && (0 < szbuf)) {
+ back = dk4pathw_concatenate_buffer(buffer, szbuf, pdir->path, fn, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+wchar_t *
+dk4dir_wc_full_name_new(
+ dk4_dir_wc_t const *pdir,
+ wchar_t const *fn,
+ dk4_er_t * erp
+)
+{
+ wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+#endif
+ if ((NULL != pdir) && (NULL != fn)) {
+ back = dk4pathw_concatenate_new(pdir->path, fn, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4dirwc.ctr b/support/dktools/dk4dirwc.ctr
index da1c023675..c72ddf6f51 100644
--- a/support/dktools/dk4dirwc.ctr
+++ b/support/dktools/dk4dirwc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,19 +15,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
@@ -98,7 +114,7 @@ dk4dir_wc_reset(dk4_dir_wc_t *dptr);
file name expansion.
*/
const wchar_t *
-dk4dir_wc_get_path(dk4_dir_wc_t *dptr);
+dk4dir_wc_get_path(dk4_dir_wc_t const *dptr);
/** Retrieve next directory name.
@param dptr Directory structure.
@@ -136,7 +152,56 @@ dk4dir_wc_compare(const void *l, const void *r, int cr);
@return Maximum name length.
*/
size_t
-dk4dir_wc_get_max_entry_length(dk4_dir_wc_t *dptr);
+dk4dir_wc_get_max_entry_length(dk4_dir_wc_t const *dptr);
+
+/** Create full path name for short file name in existing buffer.
+ @param buffer Result buffer.
+ @param szbuf Size of result buffer (number of wchar_t).
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, pdir or fn is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4dir_wc_full_name_buffer(
+ wchar_t *buffer,
+ size_t szbuf,
+ dk4_dir_wc_t const *pdir,
+ wchar_t const *fn,
+ dk4_er_t *erp
+);
+
+/** Create full path name for short file name in newly allocated buffer.
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated buffer on success,
+ NULL on error.
+ On success use dk4mem_free() to release the memory when done with
+ the name.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdir or fn is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+wchar_t *
+dk4dir_wc_full_name_new(
+ dk4_dir_wc_t const *pdir,
+ wchar_t const *fn,
+ dk4_er_t *erp
+);
#ifdef __cplusplus
}
@@ -159,6 +224,10 @@ dk4dir_wc_get_max_entry_length(dk4_dir_wc_t *dptr);
#include "dk4dir.h"
#endif
+#ifndef DK4PATHW_H_INCLUDED
+#include "dk4pathw.h"
+#endif
+
#ifndef DK4STR8_H_INCLUDED
#include "dk4strw.h"
#endif
@@ -211,6 +280,16 @@ dk4dir_wc_get_max_entry_length(dk4_dir_wc_t *dptr);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
+
$!trace-include
@@ -220,9 +299,10 @@ $!trace-include
#if DK4_ON_WINDOWS
int
-dk4dir_wc_compare(const void *l, const void *r, int cr)
+dk4dir_wc_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
{
int back = 0;
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
back = dk4strw_pathcmp((const wchar_t *)l, (const wchar_t *)r);
@@ -261,6 +341,9 @@ dk4dir_wc_clean_storage(dk4_sto_t *s, dk4_sto_it_t *i)
void
dk4dir_wc_close(dk4_dir_wc_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
dk4mem_release(dptr->path);
dk4dir_wc_clean_storage(dptr->s_dir, dptr->i_dir);
@@ -321,6 +404,11 @@ dk4dir_wc_fill_with_pab(
int isdir; /* Flag: Entry is directory */
int back = 0;
$? "+ dk4dir_wc_fill_directory"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != pab);
+ assert(0 < szpab);
+#endif
if (dk4strw_cpy_s(pab, szpab, dptr->path, erp)) {
if (dk4strw_cat_s(pab, szpab, dk4dir_wc_kw[3], erp)) {
if (dk4strw_cat_s(pab, szpab, dk4dir_wc_kw[4], erp)) {
@@ -383,6 +471,9 @@ int
dk4dir_wc_fill_with_local(dk4_dir_wc_t *dptr, int om, dk4_er_t *erp)
{
wchar_t pab[DK4_MAX_PATH];
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
return (dk4dir_wc_fill_with_pab(dptr, om, pab, DK4_SIZEOF(pab,wchar_t), erp));
}
@@ -403,6 +494,9 @@ dk4dir_wc_fill_directory(dk4_dir_wc_t *dptr, int om, dk4_er_t *erp)
size_t dptrlgt;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
dptrlgt = dk4strw_len(dptr->path);
if ((DK4_MAX_PATH - 2) > dptrlgt) {
back = dk4dir_wc_fill_with_local(dptr, om, erp);
@@ -427,12 +521,23 @@ dk4dir_wc_fill_directory(dk4_dir_wc_t *dptr, int om, dk4_er_t *erp)
dk4_dir_wc_t *
-dk4dir_wc_open(const wchar_t *path, int om, dk4_er_t *erp)
+dk4dir_wc_open(
+ const wchar_t *path,
+#if DK4_ON_WINDOWS
+ int om,
+#else
+ int DK4_ARG_UNUSED(om),
+#endif
+ dk4_er_t *erp
+)
{
dk4_dir_wc_t *back = NULL;
#if DK4_ON_WINDOWS
int ok = 0;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
back = dk4mem_new(dk4_dir_wc_t, 1, erp);
@@ -471,6 +576,7 @@ dk4dir_wc_open(const wchar_t *path, int om, dk4_er_t *erp)
}
}
#else
+ DK4_UNUSED_ARG(om)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
} else {
@@ -484,6 +590,9 @@ dk4dir_wc_open(const wchar_t *path, int om, dk4_er_t *erp)
void
dk4dir_wc_reset(dk4_dir_wc_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_dir) && (NULL != dptr->i_dir)) {
dk4sto_it_reset(dptr->i_dir);
@@ -497,9 +606,12 @@ dk4dir_wc_reset(dk4_dir_wc_t *dptr)
const wchar_t *
-dk4dir_wc_get_path(dk4_dir_wc_t *dptr)
+dk4dir_wc_get_path(dk4_dir_wc_t const *dptr)
{
const wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
back = (const wchar_t *)(dptr->path);
}
@@ -512,6 +624,9 @@ const wchar_t *
dk4dir_wc_next_dir(dk4_dir_wc_t *dptr)
{
const wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_dir) && (NULL != dptr->i_dir)) {
back = (const wchar_t *)dk4sto_it_next(dptr->i_dir);
@@ -526,6 +641,9 @@ const wchar_t *
dk4dir_wc_next_file(dk4_dir_wc_t *dptr)
{
const wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((NULL != dptr->s_file) && (NULL != dptr->i_file)) {
back = (const wchar_t *)dk4sto_it_next(dptr->i_file);
@@ -539,6 +657,9 @@ dk4dir_wc_next_file(dk4_dir_wc_t *dptr)
void
dk4dir_wc_skip_files(dk4_dir_wc_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
dk4dir_wc_clean_storage(dptr->s_file, dptr->i_file);
dptr->s_file = NULL; dptr->i_file = NULL;
@@ -548,12 +669,65 @@ dk4dir_wc_skip_files(dk4_dir_wc_t *dptr)
size_t
-dk4dir_wc_get_max_entry_length(dk4_dir_wc_t *dptr)
+dk4dir_wc_get_max_entry_length(dk4_dir_wc_t const *dptr)
{
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
back = dptr->maxlen;
}
return back;
}
+
+
+int
+dk4dir_wc_full_name_buffer(
+ wchar_t *buffer,
+ size_t szbuf,
+ dk4_dir_wc_t const *pdir,
+ wchar_t const *fn,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+#endif
+ if ((NULL != buffer) && (NULL != pdir) && (NULL != fn) && (0 < szbuf)) {
+ back = dk4pathw_concatenate_buffer(buffer, szbuf, pdir->path, fn, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+wchar_t *
+dk4dir_wc_full_name_new(
+ dk4_dir_wc_t const *pdir,
+ wchar_t const *fn,
+ dk4_er_t * erp
+)
+{
+ wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != pdir);
+ assert(NULL != fn);
+#endif
+ if ((NULL != pdir) && (NULL != fn)) {
+ back = dk4pathw_concatenate_new(pdir->path, fn, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4dirwc.h b/support/dktools/dk4dirwc.h
index 1cc56524b5..e60d16a499 100644
--- a/support/dktools/dk4dirwc.h
+++ b/support/dktools/dk4dirwc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dirwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dirwc.ctr
*/
#ifndef DK4DIRWC_H_INCLUDED
@@ -47,19 +25,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
@@ -130,7 +124,7 @@ dk4dir_wc_reset(dk4_dir_wc_t *dptr);
file name expansion.
*/
const wchar_t *
-dk4dir_wc_get_path(dk4_dir_wc_t *dptr);
+dk4dir_wc_get_path(dk4_dir_wc_t const *dptr);
/** Retrieve next directory name.
@param dptr Directory structure.
@@ -168,7 +162,56 @@ dk4dir_wc_compare(const void *l, const void *r, int cr);
@return Maximum name length.
*/
size_t
-dk4dir_wc_get_max_entry_length(dk4_dir_wc_t *dptr);
+dk4dir_wc_get_max_entry_length(dk4_dir_wc_t const *dptr);
+
+/** Create full path name for short file name in existing buffer.
+ @param buffer Result buffer.
+ @param szbuf Size of result buffer (number of wchar_t).
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, pdir or fn is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4dir_wc_full_name_buffer(
+ wchar_t *buffer,
+ size_t szbuf,
+ dk4_dir_wc_t const *pdir,
+ wchar_t const *fn,
+ dk4_er_t *erp
+);
+
+/** Create full path name for short file name in newly allocated buffer.
+ @param pdir Directory fn was obtained from.
+ @param fn Short file or directory name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated buffer on success,
+ NULL on error.
+ On success use dk4mem_free() to release the memory when done with
+ the name.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdir or fn is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+wchar_t *
+dk4dir_wc_full_name_new(
+ dk4_dir_wc_t const *pdir,
+ wchar_t const *fn,
+ dk4_er_t *erp
+);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4dmt.c b/support/dktools/dk4dmt.c
index 5e73c4e75c..189c0d5e45 100644
--- a/support/dktools/dk4dmt.c
+++ b/support/dktools/dk4dmt.c
@@ -1,44 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dmt.ctr
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dmt.ctr
*/
/** @file dk4dmt.c The dk4dmt module.
*/
-#line 101 "dk4dmt.ctr"
-
+#line 398 "dk4dmt.ctr"
#include "dk4conf.h"
@@ -100,118 +77,154 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_SYSEXITS_H
+#ifndef SYSEXITS_H_INCLUDED
+#include <sysexits.h>
+#define SYSEXITS_H_INCLUDED
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
#include "dk4types.h"
+#endif
+
+#ifndef DK4DMT_H_INCLUDED
#include "dk4dmt.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
#include "dk4mem.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4STAT8_H_INCLUDED
#include "dk4stat8.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
-#include "dk4fopc8.h"
-#include "dk4mkdh8.h"
+#endif
+#ifndef DK4FOPC8_H_INCLUDED
+#include "dk4fopc8.h"
+#endif
+#ifndef DK4MKDH8_H_INCLUDED
+#include "dk4mkdh8.h"
+#endif
-#line 175 "dk4dmt.ctr"
+#line 499 "dk4dmt.ctr"
-static const char * const dk4dmt_kw[] = {
+/** Constant texts used by module.
+*/
+static char const * const dk4dmt_kw[] = {
/* 0 */
"\n",
/* 1 */
-": ",
+"w",
/* 2 */
-"Failed to create background process!",
+"/dev/null",
/* 3 */
-"Failed to detach from terminal (missing setsid()/setpgpr())!",
+"/",
/* 4 */
-"Failed to detach from terminal (setsid() failed)!",
+"No signal handling functions available!",
/* 5 */
-"Failed to create daemon process!",
+"Failed to create empty set for signal ",
/* 6 */
-"Failed to reset signal handlers (sigemptyset)!",
+"!",
/* 7 */
-"Failed to reset signal handlers (sigaction)!",
+"Failed to reset handler for signal ",
/* 8 */
-"Neither sigaction() nor sigset() available!",
+"!",
/* 9 */
-"Failed to unblock signals (sigemptyset)!",
+"Failed to unblock all signals!",
/* 10 */
-"Failed to unblock signals (sigprocmask)!",
+"PID file already exists!",
/* 11 */
-"PID file already exists:\n\"",
+"Pipe not open (bug)!",
/* 12 */
-"\"!",
+"Failed to read from pipe!",
/* 13 */
-"Neither setsid() nor setpgrp() available!",
+"Failed to fork new process!",
/* 14 */
-"Failed to detach from terminal (setsid)!",
+"Failed to decouple from terminal using setsid()!",
/* 15 */
-"Failed to write PID file: \"",
+"Missing function to decouple from terminal (setsid/setpgrp)!",
/* 16 */
-"\"!",
+"Failed to write PID file!",
/* 17 */
-"dk4dmt",
+"No PID file name specified (bug)!",
/* 18 */
-"Failed to open /dev/null for read access!",
+"Failed to duplicate standard file handle using dup2()!",
/* 19 */
-"Failed to duplicate /dev/null to standard input!",
+"Failed to open /dev/null for read access!",
/* 20 */
"Failed to open /dev/null for write access!",
/* 21 */
-"Failed to duplicate /dev/null to standard output!",
+"Failed to change to / directory!",
/* 22 */
-"Failed to duplicate /dev/null to standard error output!",
+"Failed to remove PID file \"",
/* 23 */
-"Failed to change into root directory!",
+"\"!",
/* 24 */
-"Failed to remove PID file \"",
-
-/* 25 */
-"\"!",
+"dk4dmt.o",
NULL
-#line 273 "dk4dmt.ctr"
+#line 598 "dk4dmt.ctr"
};
static
void
-dk4dmt_syslog_1(const char *prgname, int slf, size_t idx)
+dk4dmt_log_1(dk4dmt_t *pdmt, size_t i)
{
-#if DK4_HAVE_SYSLOG
- openlog(((NULL != prgname) ? (prgname) : (dk4dmt_kw[17])), LOG_PID, slf);
- syslog(LOG_ERR, "%s", dk4dmt_kw[idx]);
- closelog();
+#if DK4_HAVE_SYSLOG
+ const char *progname;
+#endif
+ if (0 != pdmt->logstderr) {
+ fputs(dk4dmt_kw[i], stderr);
+ fputc('\n', stderr);
+ }
+#if DK4_HAVE_SYSLOG
+ progname = pdmt->prgname;
+ if (NULL == progname) { progname = dk4dmt_kw[24]; }
+ openlog(progname, LOG_PID, pdmt->slf);
+ syslog(LOG_ERR, "%s", dk4dmt_kw[i]);
+ closelog();
#endif
}
@@ -219,390 +232,853 @@ dk4dmt_syslog_1(const char *prgname, int slf, size_t idx)
static
void
-dk4dmt_syslog_3(
- const char *prgname, int slf, size_t i1, size_t i2, const char *str
-)
+dk4dmt_log_3(dk4dmt_t *pdmt, size_t i1, size_t i2, const char *s)
{
-#if DK4_HAVE_SYSLOG
- openlog(((NULL != prgname) ? (prgname) : (dk4dmt_kw[17])), LOG_PID, slf);
- if (NULL != str) {
- syslog(LOG_ERR, "%s%s%s", dk4dmt_kw[i1], str, dk4dmt_kw[i2]);
- } else {
- syslog(LOG_ERR, "%s%s", dk4dmt_kw[i1], dk4dmt_kw[i2]);
- }
- closelog();
+#if DK4_HAVE_SYSLOG
+ const char *progname;
+#endif
+ if (0 != pdmt->logstderr) {
+ fputs(dk4dmt_kw[i1], stderr);
+ fputs(s, stderr);
+ fputs(dk4dmt_kw[i2], stderr);
+ fputc('\n', stderr);
+ }
+#if DK4_HAVE_SYSLOG
+ progname = pdmt->prgname;
+ if (NULL == progname) { progname = dk4dmt_kw[24]; }
+ openlog(progname, LOG_PID, pdmt->slf);
+ syslog(LOG_ERR, "%s%s%s", dk4dmt_kw[i1], s, dk4dmt_kw[i2]);
+ closelog();
#endif
}
+/** Set exit status in structure.
+ @param pdmt Structure to modify.
+ @param syse One of the codes defined in the sysexits header.
+ @param sdes Systemd error code.
+*/
static
void
-dk4dmt_log_1(const char *prgname, int slf, int lse, size_t i)
+dk4dmt_set_error_exit_status(dk4dmt_t *pdmt, int syse, int sdes)
{
- if (0 != lse) {
- if (NULL != prgname) {
- fputs(prgname, stderr);
- fputs(dk4dmt_kw[1], stderr);
- }
- fputs(dk4dmt_kw[i], stderr);
- fputs(dk4dmt_kw[0], stderr);
- fflush(stderr);
- } else {
- dk4dmt_syslog_1(prgname, slf, i);
- }
+ if (NULL != pdmt) {
+ if (EXIT_SUCCESS == pdmt->exv) {
+#if DK4_HAVE_SYSTEMD
+ if (0 != sdes) {
+ pdmt->exv = sdes;
+ }
+ else {
+ pdmt->exv = syse;
+ }
+#else
+ if (0 != syse) {
+ pdmt->exv = syse;
+ }
+ else {
+ switch (sdes) {
+ default : {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ pdmt->exv = EX_OSERR;
+#else
+ pdmt->exv = EXIT_FAILURE;
+#endif
+ } break;
+ }
+ }
+#endif
+ }
+ }
}
-static
void
-dk4dmt_log_3(
- const char *prgname, int slf, int lse, size_t i1, size_t i2, const char *str
-)
+dk4dmt_init(dk4dmt_t *pdmt)
{
- if (0 != lse) {
- if (NULL != prgname) {
- fputs(prgname, stderr);
- fputs(dk4dmt_kw[1], stderr);
- }
- fputs(dk4dmt_kw[i1], stderr);
- if (NULL != str) { fputs(str, stderr); }
- fputs(dk4dmt_kw[i2], stderr);
- fputs(dk4dmt_kw[0], stderr);
- fflush(stderr);
- } else {
- dk4dmt_syslog_3(prgname, slf, i1, i2, str);
- }
+ if (NULL != pdmt) {
+ DK4_MEMRES(pdmt,sizeof(dk4dmt_t));
+ pdmt->prgname = NULL;
+ pdmt->pidfile = NULL;
+ pdmt->pfd[0] = -1;
+ pdmt->pfd[1] = -1;
+ pdmt->logstderr = 0;
+#if (DK4_HAVE_SYSLOG_H) && defined(LOG_DAEMON)
+ pdmt->slf = LOG_DAEMON;
+#else
+ pdmt->slf = (3<<3);
+#endif
+ pdmt->exv = EXIT_SUCCESS;
+ }
}
-/** Reset all signals to SIG_DFL.
- @param reason Address of error code variable
- (1=sigemptyset failed, 2=sigaction failed, 3=no signal handling).
- @return 1 on success, 0 on error.
-*/
-static
-int
-dk4dmt_reset_all_signals(int *reason)
+void
+dk4dmt_set_program(dk4dmt_t *pdmt, const char *progname)
{
-
+ if ((NULL != pdmt) && (NULL != progname)) {
+ pdmt->prgname = progname;
+ }
+}
-#line 361 "dk4dmt.ctr"
-#if DK4_HAVE_SIGACTION
- struct sigaction sigact; /* Signal information for sigaction() */
+
+
+void
+dk4dmt_set_pidfile(dk4dmt_t *pdmt, const char *pidfile)
+{
+ if ((NULL != pdmt) && (NULL != pidfile)) {
+ pdmt->pidfile = pidfile;
+ }
+}
+
+
+
+void
+dk4dmt_set_log_stderr(dk4dmt_t *pdmt, int flag)
+{
+ if (NULL != pdmt) {
+ pdmt->logstderr = flag;
+ }
+}
+
+
+
+void
+dk4dmt_set_syslog_feature(dk4dmt_t *pdmt, int feat)
+{
+ if (NULL != pdmt) {
+ pdmt->slf = feat;
+ }
+}
+
+
+
+void
+dk4dmt_error_sigprocmask(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 207);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 207);
#endif
- int back = 1; /* Function result */
- int maxsig; /* Maximum signal + 1 */
- int i; /* Current signal to modify */
- int go;
+}
-#ifdef _NSIG
- maxsig = _NSIG;
+
+
+void
+dk4dmt_error_sigemptyset(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 207);
#else
- maxsig = 16;
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 207);
#endif
+}
- for (i = 1; ((i < maxsig) && (1 == back)); i++) {
- go = 1;
-#ifdef SIGKILL
- if (SIGKILL == i) { go = 0; }
+
+
+void
+dk4dmt_error_no_signal_function(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 2);
#else
- if (9 == i) { go = 0; }
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 2);
#endif
-#ifdef SIGSTOP
- if (SIGSTOP == i) { go = 0; }
+}
+
+
+
+void
+dk4dmt_error_pid_file_exists(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_SOFTWARE)
+ dk4dmt_set_error_exit_status(pdmt, EX_SOFTWARE, 0);
#else
- if (19 == i) { go = 0; }
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
-
+}
-#line 388 "dk4dmt.ctr"
- if (0 != go) {
-#if DK4_HAVE_SIGACTION
- DK4_MEMRES(&sigact, sizeof(sigact));
- sigact.sa_handler = SIG_DFL;
- sigact.sa_flags = 0;
- if (0 != sigemptyset(&(sigact.sa_mask))) {
- if (16 > i) {
- back = 0;
- if (NULL != reason) {
-
-#line 397 "dk4dmt.ctr"
- *reason = 1;
- }
- }
- }
- if (0 != sigaction(i, &sigact, NULL)) {
- if (16 > i) {
- back = 0;
- if (NULL != reason) {
-
-#line 405 "dk4dmt.ctr"
- *reason = 2;
- }
- }
- }
+
+
+void
+dk4dmt_error_pid_file_name_missing(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_SOFTWARE)
+ dk4dmt_set_error_exit_status(pdmt, EX_SOFTWARE, 0);
#else
-#if DK4_HAVE_SIGSET
- sigset(i, SIG_DFL);
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+}
+
+
+
+void
+dk4dmt_error_pipe_not_open(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_SOFTWARE)
+ dk4dmt_set_error_exit_status(pdmt, EX_SOFTWARE, 0);
#else
-#if DK4_HAVE_SIGNAL
- signal(i, SIG_DFL);
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+}
+
+
+
+void
+dk4dmt_error_pipe_read_failed(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
#else
- back = 0;
- if (NULL != reason) { *reason = 3; }
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
+}
+
+
+
+void
+dk4dmt_error_fork_failed(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
+}
+
+
+
+void
+dk4dmt_error_dup2_failed(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- }
- }
-
+}
+
+
-#line 424 "dk4dmt.ctr"
- return back;
+void
+dk4dmt_error_failed_read_dev_null(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
}
-/** Obtain maximum file descriptor number.
- @return Maximum file descriptor.
-*/
-static
-int
-dk4dmt_max_file_descriptor(void)
+void
+dk4dmt_error_failed_write_dev_null(dk4dmt_t *pdmt)
{
-#if DK4_HAVE_SYS_RESOURCE_H && DK4_HAVE_GETRLIMIT && defined(RLIMIT_NOFILE)
- struct rlimit rl;
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- int back = 1024;
-#if DK4_HAVE_SYS_RESOURCE_H && DK4_HAVE_GETRLIMIT && defined(RLIMIT_NOFILE)
- if (0 == getrlimit(RLIMIT_NOFILE, &rl)) {
-#if defined(RLIM_INFINITY)
- if (RLIM_INFINITY != rl.rlim_max) {
+}
+
+
+
+void
+dk4dmt_error_failed_chdir_root(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 200);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 200);
#endif
- back = rl.rlim_max;
-#if defined(RLIM_INFINITY)
- }
+}
+
+
+
+void
+dk4dmt_error_setsid(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 220);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 220);
+#endif
+}
+
+
+void
+dk4dmt_error_write_pid_file(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- }
+}
+
+
+
+void
+dk4dmt_error_sysfct(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- return back;
+ }
+}
+
+
+
+void
+dk4dmt_error_usage(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_USAGE)
+ dk4dmt_set_error_exit_status(pdmt, EX_USAGE, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+ }
+}
+
+
+
+void
+dk4dmt_error_config(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_CONFIG)
+ dk4dmt_set_error_exit_status(pdmt, EX_CONFIG, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+ }
}
-/** Close all file descriptors except 0 (stdin), 1 (stdout) and 2 (stderr).
-*/
static
void
-dk4dmt_close_non_std_file_descriptors(void)
+dk4dmt_reset_all_signals(int *pback, dk4dmt_t *pdmt)
{
- int maxfd;
- int fd;
+#if DK4_HAVE_SIGACTION
+ struct sigaction sigact; /* Information for sigaction() */
+#endif
+ char buf[16*sizeof(int)];
+ int maxsig; /* Maximum signal number */
+ int signo; /* Current signal number to process */
+ int go; /* Flag: Reconfigure signal */
+ int ec; /* Error code */
+
+ ec = 0;
+#ifdef _NSIG
+ maxsig = _NSIG;
+#else
+ maxsig = 16;
+#endif
+ for (signo = 1; ((maxsig >= signo) && (1 == *pback)); signo++) {
+ go = 1;
+#ifdef SIGKILL
+ if (SIGKILL == signo) { go = 0; }
+#else
+ if (9 == signo) { go = 0; }
+#endif
+#ifdef SIGSTOP
+ if (SIGSTOP == signo) { go = 0; }
+#else
+ if (19 == signo) { go = 0; }
+#endif
+ if (0 != go) {
+#if DK4_HAVE_SIGACTION
+ DK4_MEMRES(&sigact, sizeof(sigact));
+ sigact.sa_handler = SIG_DFL;
+ sigact.sa_flags = 0;
+ if (0 != sigemptyset(&(sigact.sa_mask))) {
+ if (16 > signo) {
+ *pback = 0;
+ dk4dmt_error_sigemptyset(pdmt);
+ /* ERROR: Failed to empty set */
+#if DK4_HAVE_SNPRINTF
+ snprintf(buf, sizeof(buf), "%d", signo);
+#else
+ sprintf(buf, "%d", signo);
+#endif
+ dk4dmt_log_3(pdmt, 5, 6, buf);
+ }
+ }
+ else {
+ if (0 != sigaction(signo, &sigact, NULL)) {
+ if (16 > signo) {
+ *pback = 0;
+ dk4dmt_error_sigemptyset(pdmt);
+ /* ERROR: sigaction failed */
+#if DK4_HAVE_SNPRINTF
+ snprintf(buf, sizeof(buf), "%d", signo);
+#else
+ sprintf(buf, "%d", signo);
+#endif
+ dk4dmt_log_3(pdmt, 7, 8, buf);
+ }
+ }
+ }
+#else
+#if DK4_HAVE_SIGSET
+ sigset(signo, SIG_DFL);
+#else
+#if DK4_HAVE_SIGNAL
+ signal(signo, SIG_DFL);
+#else
+ *pback = 0;
+ dk4dmt_error_no_signal_function(pdmt);
+ /* ERROR: No function available to modify signals */
+ if (0 == ec) { ec = 3; }
+#endif
+#endif
+#endif
+ }
+ }
+ switch (ec) {
+ case 3: {
+ dk4dmt_log_1(pdmt, 4);
+ } break;
+ }
+}
+
+
- maxfd = dk4dmt_max_file_descriptor();
- for (fd = 3; fd < maxfd; fd++) {
- (void)close(fd);
- }
+static
+void
+dk4dmt_unblock_all_signals(int *pback, dk4dmt_t *pdmt)
+{
+ sigset_t set;
+ if (0 == sigemptyset(&set)) {
+ if (0 != sigprocmask(SIG_SETMASK, &set, NULL)) {
+ *pback = 0;
+ dk4dmt_error_sigprocmask(pdmt);
+ /* ERROR: sigprocmask failed */
+ dk4dmt_log_1(pdmt, 9);
+ }
+ }
+ else {
+ *pback = 0;
+ dk4dmt_error_sigemptyset(pdmt);
+ /* ERROR: Failed to sigemptyset */
+ dk4dmt_log_1(pdmt, 9);
+ }
}
-/** Unblock all signals.
- @param reason Address of error code variable
- (1=sigemptyset failed, 2=sigprocmask failed).
- @return 1 on success, 0 on error.
-*/
static
-int
-dk4dmt_unblock_all_signals(int *reason)
+void
+dk4dmt_close_non_std_file_descriptors(void)
{
- sigset_t set;
- int back = 1;
- if (0 != sigemptyset(&set)) {
- back = 0;
- if (NULL != reason) { *reason = 1; }
- }
- if (0 != sigprocmask(SIG_SETMASK, &set, NULL)) {
- back = 0;
- if (NULL != reason) { *reason = 2; }
- }
- return back;
+#if DK4_HAVE_SYS_RESOURCE_H && DK4_HAVE_GETRLIMIT && defined(RLIMIT_NOFILE)
+ struct rlimit rl;
+#endif
+ int maxfd = 1024;
+ int fd;
+
+ /* Find maximum file descriptor
+ */
+#if DK4_HAVE_SYS_RESOURCE_H && DK4_HAVE_GETRLIMIT && defined(RLIMIT_NOFILE)
+ if (0 == getrlimit(RLIMIT_NOFILE, &rl)) {
+#if defined(RLIM_INFINITY)
+ if (RLIM_INFINITY != rl.rlim_max) {
+ back = rl.rlim_max;
+ }
+#else
+ back = rl.rlim_max;
+#endif
+ }
+#else
+#endif
+ /*
+ Close file descriptors
+ */
+ for (fd = 3; fd <= maxfd; fd++) {
+ (void)close(fd);
+ }
}
int
-dk4dmt_parent_before_fork(
- const char *prgname, const char *pidfilename, int logstderr, int slf
-)
-{
- dk4_stat_t stb;
- int reason = 0;
- int back = 1;
-
- /* Close file descriptors except 0, 1 and 2 */
- dk4dmt_close_non_std_file_descriptors();
-
- /* Reset all signal actions to default handlers */
- if (0 == dk4dmt_reset_all_signals(&reason)) {
- back = 0;
- if (0 != logstderr) {
- switch (reason) {
- case 1: {
- /* ERROR: sigemptyset() failed */
- dk4dmt_log_1(prgname, slf, logstderr, 6);
- } break;
- case 2: {
- /* ERROR: sigaction() failed */
- dk4dmt_log_1(prgname, slf, logstderr, 7);
- } break;
- default: {
- /* ERROR: No sigaction()/sigset()/signal() function */
- dk4dmt_log_1(prgname, slf, logstderr, 8);
- } break;
- }
- }
- }
-
- /* Unblock all signals */
- if (0 == dk4dmt_unblock_all_signals(&reason)) {
- back = 0;
- if (0 != logstderr) {
- switch (reason) {
- case 1: {
- /* ERROR: sigemptyset() failed */
- dk4dmt_log_1(prgname, slf, logstderr, 9);
- } break;
- case 2: {
- /* ERROR: sigprocmask() failed */
- dk4dmt_log_1(prgname, slf, logstderr, 10);
- } break;
- }
- }
- }
-
- if ((0 != back) && (NULL != pidfilename)) {
- if (0 != dk4stat_c8(&stb, pidfilename, NULL)) {
- back = 0;
- /* ERROR: PID file exists */
- dk4dmt_log_3(prgname, slf, logstderr, 11, 12, pidfilename);
- }
- }
-
- return back;
+dk4dmt_parent_before_fork(dk4dmt_t *pdmt)
+{
+ dk4_stat_t stb;
+ int back = 0;
+
+ if (NULL != pdmt) {
+ back = 1;
+ /*
+ Close non-standard file descriptors
+ */
+ dk4dmt_close_non_std_file_descriptors();
+ /*
+ Reset all signals
+ */
+ dk4dmt_reset_all_signals(&back, pdmt);
+ if (1 == back) {
+ /*
+ Unblock all signals
+ */
+ dk4dmt_unblock_all_signals(&back, pdmt);
+ if (1 == back) {
+ if (NULL != pdmt->pidfile) {
+ if (0 != dk4stat_c8(&stb, pdmt->pidfile, NULL)) {
+ back = 0;
+ dk4dmt_error_pid_file_exists(pdmt);
+ /* ERROR: PID file exists */
+ dk4dmt_log_1(pdmt, 10);
+ }
+ }
+ if (1 == back) {
+ if (0 != pipe(&(pdmt->pfd[0]))) {
+ back = 0;
+ pdmt->pfd[0] = -1;
+ pdmt->pfd[1] = -1;
+ }
+ }
+ }
+ }
+ }
+ return back;
}
+
+void
+dk4dmt_parent_after_fork(dk4dmt_t *pdmt)
+{
+ int v;
+
+ if (NULL != pdmt) {
+ /*
+ Close write head
+ */
+ if (-1 != pdmt->pfd[1]) {
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ else {
+ dk4dmt_error_pipe_not_open(pdmt);
+ /* ERROR: Pipe was not open (bug) */
+ dk4dmt_log_1(pdmt, 11);
+ }
+ /*
+ Read exit status code and close read head
+ */
+ if (-1 != pdmt->pfd[0]) {
+ if ((int)sizeof(int) == (int)read(pdmt->pfd[0], &v, sizeof(int))) {
+ pdmt->exv = v;
+ }
+ else {
+ dk4dmt_error_pipe_read_failed(pdmt);
+ /* ERROR: Failed to read from pipe */
+ dk4dmt_log_1(pdmt, 12);
+ }
+ close(pdmt->pfd[0]);
+ pdmt->pfd[0] = -1;
+ }
+ else {
+ dk4dmt_error_pipe_not_open(pdmt);
+ /* ERROR: Pipe was not open (bug) */
+ dk4dmt_log_1(pdmt, 11);
+ }
+ }
+}
+
+
+
+void
+dk4dmt_parent_fork_failed(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+ /*
+ Write error exit status code
+ */
+ dk4dmt_error_fork_failed(pdmt);
+ /* ERROR: Fork failed */
+ dk4dmt_log_1(pdmt, 13);
+ /*
+ Close write head
+ */
+ if (-1 != pdmt->pfd[1]) {
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ /*
+ Close read head
+ */
+ if (-1 != pdmt->pfd[0]) {
+ close(pdmt->pfd[0]);
+ pdmt->pfd[0] = -1;
+ }
+ }
+}
+
+
+
int
-dk4dmt_intermediate_before_fork(const char *prgname, int slf)
+dk4dmt_intermediate_before_fork(dk4dmt_t *pdmt)
{
- int back = 1;
+ int back = 0;
+ if (NULL != pdmt) {
+ back = 1;
+ /*
+ Close read head
+ */
+ if (-1 != pdmt->pfd[0]) {
+ close(pdmt->pfd[0]);
+ pdmt->pfd[0] = -1;
+ }
#if DK4_HAVE_SETSID
- if ((pid_t)(-1) == setsid()) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 14);
- }
+ if ((pid_t)(-1) == setsid()) {
+ back = 0;
+ dk4dmt_error_setsid(pdmt);
+ /* ERROR: setsid() failed */
+ dk4dmt_log_1(pdmt, 14);
+ }
#else
#if DK4_HAVE_SETPGRP
- setpgrp();
+ setpgrp();
+#else
+ back = 0;
+ dk4dmt_error_setsid(pdmt);
+ /* ERROR: No function to decouple from terminal */
+ dk4dmt_log_1(pdmt, 15);
+#endif
+#endif
+ }
+ return back;
+}
+
+
+
+void
+dk4dmt_intermediate_after_fork(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+ /*
+ Close write head
+ */
+ if (-1 != pdmt->pfd[1]) {
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ }
+}
+
+
+
+void
+dk4dmt_intermediate_fork_failed(dk4dmt_t *pdmt)
+{
+ int v;
+
+ if (NULL != pdmt) {
+ /*
+ Set exit status code
+ */
+ dk4dmt_parent_fork_failed(pdmt);
+ /* ERROR: Fork failed */
+ dk4dmt_log_1(pdmt, 13);
+ /*
+ Close write head
+ */
+ if (-1 != pdmt->pfd[1]) {
+ v = pdmt->exv;
+ if ((int)sizeof(v) != (int)write(pdmt->pfd[1], &v, sizeof(v))) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
#else
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 13);
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
+ }
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ }
+}
+
+
+
+int
+dk4dmt_daemon_start(dk4dmt_t *pdmt)
+{
+ char pidbuf[16*sizeof(dk4_um_t)];
+ FILE *fipo;
+ int res;
+ int v;
+ int fdout;
+ int fdin;
+ int back = 0;
+
+ if (NULL != pdmt) {
+ if (NULL != pdmt->pidfile) {
+ res = dk4ma_write_c8_decimal_unsigned(
+ pidbuf, sizeof(pidbuf), (dk4_um_t)getpid(), 0, NULL
+ );
+ if (0 != res) {
+ if (0 != dk4str8_cat_s(pidbuf,sizeof(pidbuf),dk4dmt_kw[0],NULL))
+ {
+ (void)dk4mkdir_hierarchy_c8(pdmt->pidfile, 0, NULL);
+ fipo = dk4fopen_c8(
+ pdmt->pidfile,dk4dmt_kw[1],DK4_FOPEN_SC_PRIVILEGED,NULL
+ );
+ if (NULL != fipo) {
+ back = 1;
+ if (EOF == fputs(pidbuf, fipo)) {
+ back = 0;
+ dk4dmt_error_write_pid_file(pdmt);
+ /* ERROR: Failed to write PID file */
+ dk4dmt_log_1(pdmt, 16);
+ }
+ if (0 != fclose(fipo)) {
+ back = 0;
+ dk4dmt_error_write_pid_file(pdmt);
+ /* ERROR: Failed to write PID file */
+ dk4dmt_log_1(pdmt, 16);
+ }
+ }
+ else {
+ dk4dmt_error_write_pid_file(pdmt);
+ /* ERROR: Failed to write PID file */
+ dk4dmt_log_1(pdmt, 16);
+ }
+ }
+ }
+ if (0 == back) {
+ unlink(pdmt->pidfile);
+ }
+ }
+ else {
+ dk4dmt_error_pid_file_name_missing(pdmt);
+ /* ERROR: Missing PID file name */
+ dk4dmt_log_1(pdmt, 17);
+ }
+ /*
+ Connect /dev/null to stdin, stdout and stderr
+ */
+ if (0 != back) {
+ fdin = open(dk4dmt_kw[2], O_RDONLY);
+ if (-1 < fdin) {
+ if (-1 == dup2(fdin, 0)) {
+ back = 0;
+ dk4dmt_error_dup2_failed(pdmt);
+ /* ERROR: Failed to duplicate file handle */
+ dk4dmt_log_1(pdmt, 18);
+ }
+ close(fdin);
+ }
+ else {
+ back = 0;
+ dk4dmt_error_failed_read_dev_null(pdmt);
+ /* ERROR: Failed to read /dev/null */
+ dk4dmt_log_1(pdmt, 19);
+ }
+ fdout = open(dk4dmt_kw[2], O_WRONLY);
+ if (-1 < fdout) {
+ if (-1 == dup2(fdout, 1)) {
+ back = 0;
+ dk4dmt_error_dup2_failed(pdmt);
+ /* ERROR: Failed to duplicate file handle */
+ dk4dmt_log_1(pdmt, 18);
+ }
+ if (-1 == dup2(fdout, 2)) {
+ back = 0;
+ dk4dmt_error_dup2_failed(pdmt);
+ /* ERROR: Failed to duplicate file handle */
+ dk4dmt_log_1(pdmt, 18);
+ }
+ close(fdout);
+ }
+ else {
+ back = 0;
+ dk4dmt_error_failed_write_dev_null(pdmt);
+ /* ERROR: Failed to write /dev/null */
+ dk4dmt_log_1(pdmt, 20);
+ }
+ }
+ /*
+ Use exact permissions when creating new files or directories
+ */
+ if (0 != back) {
+ umask(0);
+ }
+ /*
+ Change to root directory
+ */
+ if (0 != back) {
+ if (0 != chdir(dk4dmt_kw[3])) {
+ back = 0;
+ dk4dmt_error_failed_chdir_root(pdmt);
+ /* ERROR: Failed to change into root directory */
+ dk4dmt_log_1(pdmt, 21);
+ }
+ }
+ /* Send exit status code to main process
+ */
+ if (-1 != pdmt->pfd[1]) {
+ v = pdmt->exv;
+ if ((int)sizeof(v) != (int)write(pdmt->pfd[1], &v, sizeof(v))) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- return back;
+ }
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ }
+ return back;
+}
+
+
+
+void
+dk4dmt_daemon_end(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+ if (NULL != pdmt->pidfile) {
+ if (0 != unlink(pdmt->pidfile)) {
+ /* ERROR: Failed to remove PID file */
+ dk4dmt_log_3(pdmt, 22, 23, pdmt->pidfile);
+ }
+ }
+ }
}
+void
+dk4dmt_success(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+ pdmt->exv = EXIT_SUCCESS;
+ }
+}
+
+
int
-dk4dmt_daemon_after_fork(const char *prgname, const char *pidfilename, int slf)
-{
- char pidbuf[16*sizeof(dk4_um_t)];
- FILE *fipo;
- int fdin; /* File descriptor for input */
- int fdout; /* File descriptor for output */
- int res; /* Operation result */
- int back = 1;
-
- if (NULL != pidfilename) {
- res = dk4ma_write_c8_decimal_unsigned(
- pidbuf, sizeof(pidbuf), (dk4_um_t)getpid(), 0, NULL
- );
- if (0 != res) {
- if (0 != dk4str8_cat_s(pidbuf, sizeof(pidbuf), dk4dmt_kw[0], NULL)) {
- (void)dk4mkdir_hierarchy_c8(pidfilename, 0, NULL);
- fipo = dk4fopen_c8(pidfilename, "w", DK4_FOPEN_SC_PRIVILEGED, NULL);
- if (NULL != fipo) {
- fputs(pidbuf, fipo);
- fclose(fipo);
- } else {
- dk4dmt_syslog_3(prgname, slf, 15, 16, pidfilename);
- back = 0;
+dk4dmt_get_exit_status(dk4dmt_t *pdmt)
+{
+ int back = EXIT_FAILURE;
+ if (NULL != pdmt) {
+ back = pdmt->exv;
}
- }
- }
- }
-
- /* Connect /dev/null to stdin stout stderr or close them
- */
- fdin = open("/dev/null", O_RDONLY);
- if (-1 < fdin) {
- if (-1 == dup2(fdin, 0)) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 19);
- }
- close(fdin);
- } else {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 18);
- }
- fdout = open("/dev/null", O_WRONLY);
- if (-1 < fdout) {
- if (-1 == dup2(fdout, 1)) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 21);
- }
- if (-1 == dup2(fdout, 2)) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 22);
- }
- close(fdout);
- } else {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 20);
- }
-
- /* Use exact permissions when creating new files or directories.
- */
- umask(0);
-
- /* Change to root directory, so the previous current directory
- can be unmounted without blocking.
- */
- if (0 != chdir("/")) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 23);
- }
-
- /* Indicate success or error.
- */
- return back;
-}
-
-
-
-void
-dk4dmt_daemon_end(const char *prgname, const char *pidfilename, int slf)
-{
- if (NULL != pidfilename) {
- if (0 != unlink(pidfilename)) {
- dk4dmt_syslog_3(prgname, slf, 24, 25, pidfilename);
- }
- }
+ return back;
}
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4dmt.ctr b/support/dktools/dk4dmt.ctr
index ed8f07b487..2ac31ee133 100644
--- a/support/dktools/dk4dmt.ctr
+++ b/support/dktools/dk4dmt.ctr
@@ -1,19 +1,24 @@
%% options
copyright owner = Dirk Krause
-copyright year = 2016-xxxx
-license = bsd
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
%% header
-/** @file dk4dmt.h Daemon tools.
+/** @file dk4dmt.h Daemon tool functions.
+
+The functions in this module can be used to program standing daemons.
+Three processes are involved in a standing daemon:
-The functions in this module can be used in standing daemons.
+* master process, originally started,
+* intermediate process, forked by master, decouples from terminal and
+* daemon process, forked by intermediate process.
+
+When a standing daemon is started by a systemd service unit, the master
+process must not exit before the daemon process has created the PID file.
-In the original process, call the
-dk4dmt_parent_before_fork() function to close all file descriptors
-above 2, reset all signal handlers to defaults, unblock all signals
-and check whether a PID file already exists.
If you plan to give up root privileges in the child processes
(use setgid() and setuid() to change effective user and group),
do not use /var/run/<i>program</i>.pid as PID file name, better
@@ -23,83 +28,374 @@ to the unprivileged user and group used by the child process.
User and group need write permission to the directory, so the unprivileged
child process can remove the PID file when exiting.
-In the intermediate process after the first fork call
-dk4dmt_intermediate_before_fork(). Among other things this function
-completely decouples the process from the terminal.
+The general usage structure looks like this:
-In the final process (after forking again) call
-dk4dmt_daemon_after_fork()
-to set up things before starting service. This function creates the PID
-file, connects file descriptors 0, 1 and 2 to /dev/null, resets
-the umask and changes into the / directory.
+@code
+#define PROGRAM_NAME "my-new-service"
+const char program_name[] = {
+ PROGRAM_NAME
+};
+const char pid_file_name[] = {
+ "/run/" PROGRAM_NAME "/" PROGRAM_NAME ".pid"
+};
+dk4dmt_t dmt;
+
+...
+
+pid_t cpid;
+dk4dmt_init(&dmt);
+if (0 != read_configuration_file()) {
+ dk4dmt_set_program(&dmt, program_name);
+ dk4dmt_set_pidfile(&dmt, pid_file_name);
+ dk4dmt_set_syslog_feature(&dmt, syslog_feature);
+ if (0 != dk4dmt_parent_before_fork(&dmt)) {
+ cpid = fork();
+ if ((pid_t)0 == cpid) {
+ if (0 != dk4dmt_intermediate_before_fork(&dmt)) {
+ cpid = fork();
+ if ((pid_t)0 == cpid) {
+ if (0 != dk4dmt_daemon_start(&dmt)) {
+ do_the_service();
+ }
+ dk4dmt_daemon_end(&dmt);
+ }
+ else {
+ if ((pid_t)(-1) != cpid) {
+ dk4dmt_intermediate_after_fork(&dmt);
+ }
+ else {
+ dk4dmt_intermediate_fork_failed(&dmt);
+ }
+ }
+ }
+ }
+ else {
+ if ((pid_t)(-1) != cpid) {
+ dk4dmt_parent_after_fork(&dmt);
+ }
+ else {
+ dk4dmt_parent_fork_failed(&dmt);
+ }
+ }
+ }
+}
+else {
+ dk4dmt_error_config(&dmt);
+}
+exval = dk4dmt_get_exit_status(&dmt);
+exit(exval);
+@endcode
-After finishing service call
-dk4dmt_daemon_end() before exiting. This function removes the PID
-file.
*/
-#ifdef __cplusplus
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+
+/** Data collection for daemon.
+*/
+typedef struct {
+ char const *prgname; /**< Program name. */
+ char const *pidfile; /**< PID file name. */
+ int pfd[2]; /**< Pipe file descriptors. */
+ int logstderr; /**< Flag: Logging to stderr allowed. */
+ int slf; /**< Syslog feature. */
+ int exv; /**< Exit status code to return. */
+} dk4dmt_t;
+
+
+
+#ifdef __cplusplus
extern "C" {
#endif
-/** Activities in parent process before calling fork().
- * Close all file descriptors above 2.
- * Reset all signal actions to default handlers.
- * Unblock all signals.
- * Check whether PID file already exists.
- Use this function to check whether the initial process
- can run fork().
- @param prgname Program name.
- @param pidfilename PID file name.
- @param logstderr Flag: Logging to stderr allowed.
- @param slf Syslog feature.
- @return 1 on success (can call fork), 0 on error (abort).
+/** Initialize daemon tool structure.
+ @param pdmt Daemon tool structure to initialize.
+*/
+
+void
+dk4dmt_init(dk4dmt_t *pdmt);
+
+
+/** Set program name for daemon tool structure.
+ The function does not create a copy of the program name,
+ it keeps the original pointer in the structure.
+ So the progname buffer must exist and contain data as long as
+ the structure is used.
+ @param pdmt Daemon tool structure to set up.
+ @param progname Program name.
+*/
+
+void
+dk4dmt_set_program(dk4dmt_t *pdmt, const char *progname);
+
+
+/** Set PID file name for daemon tool structure.
+ The function does not create a copy of the file name, it keeps the original
+ pointer in the structure.
+ So the pidfile buffer must exist and contain data as long as
+ the structure is used.
+ @param pdmt Daemon tool structure to set up.
+ @param pidfile PID file name.
*/
-int
-dk4dmt_parent_before_fork(
- const char *prgname, const char *pidfilename, int logstderr, int slf
-);
+void
+dk4dmt_set_pidfile(dk4dmt_t *pdmt, const char *pidfile);
+
+
+/** Enable or disable logging to stderr for daemon tool structure.
+ @param pdmt Daemon tool structure to set up.
+ @param flag Allow or deny logging to stderr.
+*/
-/** Activities in first child before calling fork() again.
- * Decouple completely from terminal.
- Use this function to check whether the first child process
- can run fork() again.
- @param prgname Program name.
- @param slf Syslog feature.
- @return 1 on success (can call fork), 0 on error (abort).
+void
+dk4dmt_set_log_stderr(dk4dmt_t *pdmt, int flag);
+
+
+/** Set syslog feature for daemon tool structure.
+ @param pdmt Daemon tool structure to set up.
+ @param feat Syslog feature to use.
*/
+
+void
+dk4dmt_set_syslog_feature(dk4dmt_t *pdmt, int feat);
+
+
+/** Process initialization before first fork attempt.
+ Open pipe for communication from daemon to parent.
+ @param pdmt Daemon tool structure to use.
+ @return 1 on success, 0 on error.
+*/
+
int
-dk4dmt_intermediate_before_fork(const char *prgname, int slf);
-
-/** Activities in final daemon process.
- * Create PID file.
- * Connect file descriptors 0, 1 and 2 to /dev/null.
- * Reset umask.
- * Change into / directory.
- @param prgname Program name.
- @param pidfilename File name for PID file.
- @param slf Syslog feature.
+dk4dmt_parent_before_fork(dk4dmt_t *pdmt);
+
+
+/** Wait for startup completion notification in parent process.
+ Close write head, read exit status, close read head.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_parent_after_fork(dk4dmt_t *pdmt);
+
+
+/** React on failed fork attempt in parent process.
+ Close both pipe heads.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_parent_fork_failed(dk4dmt_t *pdmt);
+
+
+/** Prepare for second fork attempt in intermediate process.
+ Close read head.
+ On error write exit status code and close write pipe head.
+ @param pdmt Daemon tool structure to use.
@return 1 on success, 0 on error.
*/
+
+int
+dk4dmt_intermediate_before_fork(dk4dmt_t *pdmt);
+
+
+/** Clean up in intermediate process after forking the daemon.
+ Close write pipe head.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_intermediate_after_fork(dk4dmt_t *pdmt);
+
+
+/** React on failed fork attempt in intermediate process.
+ Write exit status code and close write pipe head.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_intermediate_fork_failed(dk4dmt_t *pdmt);
+
+
+/** Create PID file and notify main process to exit.
+ Write exit status and close write pipe head.
+ @param pdmt Daemon tool structure to use.
+*/
+
int
-dk4dmt_daemon_after_fork(const char *prgname, const char *pidfilename, int slf);
+dk4dmt_daemon_start(dk4dmt_t *pdmt);
+
+
+/** Clean up daemon structure before exiting daemon process (remove PID file).
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_daemon_end(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure for failed system function.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_sysfct(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure for failed signal process mask.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_sigprocmask(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate missing signal functionality.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_no_signal_function(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate PID file exists.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_pid_file_exists(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate PID file not configured.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_pid_file_name_missing(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate write PID file failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_write_pid_file(dk4dmt_t *pdmt);
+
+/** Set exit code in daemon structure to indicate pipe was not opened (bug).
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_pipe_not_open(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate reading from pipe failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_pipe_read_failed(dk4dmt_t *pdmt);
+
-/** End of daemon, remove PID file.
- @param prgname Program name.
- @param pidfilename PID file name.
- @param slf Syslog feature.
+/** Set exit code in daemon structure to indicate fork failed.
+ @param pdmt Daemon tool structure to use.
*/
+
+void
+dk4dmt_error_fork_failed(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate setsid failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_setsid(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate dup2 failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_dup2_failed(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate reading /dev/null failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_failed_read_dev_null(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate writing /dev/null failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_failed_write_dev_null(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate chdir to / failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_failed_chdir_root(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure for failed signal set cleanup.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_sigemptyset(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure for unusable configuration.
+ @param pdmt Daemon tool structure to use.
+*/
+
void
-dk4dmt_daemon_end(const char *prgname, const char *pidfilename, int slf);
+dk4dmt_error_config(dk4dmt_t *pdmt);
+
-#ifdef __cplusplus
+/** Set exit code in daemon structure to indicate wrong call arguments.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_usage(dk4dmt_t *pdmt);
+
+
+/** Indicate success.
+ @param pdmt Daemon tool structure to use.
+*/
+void
+dk4dmt_success(dk4dmt_t *pdmt);
+
+
+/** Retrieve exit status code.
+ @param pdmt Daemon tool structure to use.
+ @return Exit status code to return.
+*/
+
+int
+dk4dmt_get_exit_status(dk4dmt_t *pdmt);
+
+#ifdef __cplusplus
}
#endif
%% module
-
#include "dk4conf.h"
#include <stdio.h>
@@ -160,115 +456,144 @@ dk4dmt_daemon_end(const char *prgname, const char *pidfilename, int slf);
#endif
#endif
+#if DK4_HAVE_SYSEXITS_H
+#ifndef SYSEXITS_H_INCLUDED
+#include <sysexits.h>
+#define SYSEXITS_H_INCLUDED
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
#include "dk4types.h"
+#endif
+
+#ifndef DK4DMT_H_INCLUDED
#include "dk4dmt.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
#include "dk4mem.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4STAT8_H_INCLUDED
#include "dk4stat8.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
-#include "dk4fopc8.h"
-#include "dk4mkdh8.h"
+#endif
+#ifndef DK4FOPC8_H_INCLUDED
+#include "dk4fopc8.h"
+#endif
+#ifndef DK4MKDH8_H_INCLUDED
+#include "dk4mkdh8.h"
+#endif
$!trace-include
-static const char * const dk4dmt_kw[] = {
+/** Constant texts used by module.
+*/
+static char const * const dk4dmt_kw[] = {
$!string-table
#
# 0 Newline
#
\n
#
-# 1 Separator after program name
+# 1 File mode for text writing
#
-:
+w
#
-# 2
+# 2 File name to open /dev/null
#
-Failed to create background process!
+/dev/null
#
-# 3
+# 3 The root directory
#
-Failed to detach from terminal (missing setsid()/setpgpr())!
+/
#
-# 4
+# 4 ERROR: No signal handling functions available!
#
-Failed to detach from terminal (setsid() failed)!
+No signal handling functions available!
#
-# 5
+# 5,6 ERROR: Failed to create empty set for signal xxx!
#
-Failed to create daemon process!
+Failed to create empty set for signal
+!
#
-# 6
+# 7,8 ERROR: Failed to reset handler for signal xxx!
#
-Failed to reset signal handlers (sigemptyset)!
+Failed to reset handler for signal
+!
#
-# 7
+# 9 ERROR: Failed to unblock all signals!
#
-Failed to reset signal handlers (sigaction)!
+Failed to unblock all signals!
#
-# 8
+# 10 ERROR: PID file already exists!
#
-Neither sigaction() nor sigset() available!
+PID file already exists!
#
-# 9
+# 11 ERROR: Pipe not open!
#
-Failed to unblock signals (sigemptyset)!
+Pipe not open (bug)!
#
-# 10
+# 12 ERROR: Failed to read from pipe!
#
-Failed to unblock signals (sigprocmask)!
+Failed to read from pipe!
#
-# 11 12
+# 13 ERROR: Failed to fork new process!
#
-PID file already exists:\n"
-"!
+Failed to fork new process!
#
-# 13
+# 14 ERROR: Failed to decouple from terminal!
#
-Neither setsid() nor setpgrp() available!
+Failed to decouple from terminal using setsid()!
#
-# 14
+# 15 ERROR: Missing function...
#
-Failed to detach from terminal (setsid)!
+Missing function to decouple from terminal (setsid/setpgrp)!
#
-# 15 16
+# 16 ERROR: Failed to write PID file!
#
-Failed to write PID file: "
-"!
+Failed to write PID file!
#
-# 17
+# 17 ERROR: No PID file specified!
#
-dk4dmt
+No PID file name specified (bug)!
#
-# 18
+# 18 ERROR: Failed to duplicate standard file handle!
#
-Failed to open /dev/null for read access!
+Failed to duplicate standard file handle using dup2()!
#
-# 19
+# 19 ERROR: Failed to open /dev/null for read access!
#
-Failed to duplicate /dev/null to standard input!
+Failed to open /dev/null for read access!
#
-# 20
+# 20 ERROR: Failed to open /dev/null for write access!
#
Failed to open /dev/null for write access!
#
-# 21 22
-#
-Failed to duplicate /dev/null to standard output!
-Failed to duplicate /dev/null to standard error output!
+# 21 ERROR: Failed to change to / directory!
#
-# 23
+Failed to change to / directory!
#
-Failed to change into root directory!
-#
-# 24 25
+# 22,23 ERROR: Failed to remove PID file!
#
Failed to remove PID file "
"!
+#
+# 24 Module name
+#
+dk4dmt.o
$!end
};
@@ -276,12 +601,21 @@ $!end
static
void
-dk4dmt_syslog_1(const char *prgname, int slf, size_t idx)
+dk4dmt_log_1(dk4dmt_t *pdmt, size_t i)
{
-#if DK4_HAVE_SYSLOG
- openlog(((NULL != prgname) ? (prgname) : (dk4dmt_kw[17])), LOG_PID, slf);
- syslog(LOG_ERR, "%s", dk4dmt_kw[idx]);
- closelog();
+#if DK4_HAVE_SYSLOG
+ const char *progname;
+#endif
+ if (0 != pdmt->logstderr) {
+ fputs(dk4dmt_kw[i], stderr);
+ fputc('\n', stderr);
+ }
+#if DK4_HAVE_SYSLOG
+ progname = pdmt->prgname;
+ if (NULL == progname) { progname = dk4dmt_kw[24]; }
+ openlog(progname, LOG_PID, pdmt->slf);
+ syslog(LOG_ERR, "%s", dk4dmt_kw[i]);
+ closelog();
#endif
}
@@ -289,380 +623,853 @@ dk4dmt_syslog_1(const char *prgname, int slf, size_t idx)
static
void
-dk4dmt_syslog_3(
- const char *prgname, int slf, size_t i1, size_t i2, const char *str
-)
+dk4dmt_log_3(dk4dmt_t *pdmt, size_t i1, size_t i2, const char *s)
{
-#if DK4_HAVE_SYSLOG
- openlog(((NULL != prgname) ? (prgname) : (dk4dmt_kw[17])), LOG_PID, slf);
- if (NULL != str) {
- syslog(LOG_ERR, "%s%s%s", dk4dmt_kw[i1], str, dk4dmt_kw[i2]);
- } else {
- syslog(LOG_ERR, "%s%s", dk4dmt_kw[i1], dk4dmt_kw[i2]);
- }
- closelog();
+#if DK4_HAVE_SYSLOG
+ const char *progname;
+#endif
+ if (0 != pdmt->logstderr) {
+ fputs(dk4dmt_kw[i1], stderr);
+ fputs(s, stderr);
+ fputs(dk4dmt_kw[i2], stderr);
+ fputc('\n', stderr);
+ }
+#if DK4_HAVE_SYSLOG
+ progname = pdmt->prgname;
+ if (NULL == progname) { progname = dk4dmt_kw[24]; }
+ openlog(progname, LOG_PID, pdmt->slf);
+ syslog(LOG_ERR, "%s%s%s", dk4dmt_kw[i1], s, dk4dmt_kw[i2]);
+ closelog();
#endif
}
+/** Set exit status in structure.
+ @param pdmt Structure to modify.
+ @param syse One of the codes defined in the sysexits header.
+ @param sdes Systemd error code.
+*/
static
void
-dk4dmt_log_1(const char *prgname, int slf, int lse, size_t i)
+dk4dmt_set_error_exit_status(dk4dmt_t *pdmt, int syse, int sdes)
+{
+ if (NULL != pdmt) {
+ if (EXIT_SUCCESS == pdmt->exv) {
+#if DK4_HAVE_SYSTEMD
+ if (0 != sdes) {
+ pdmt->exv = sdes;
+ }
+ else {
+ pdmt->exv = syse;
+ }
+#else
+ if (0 != syse) {
+ pdmt->exv = syse;
+ }
+ else {
+ switch (sdes) {
+ default : {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ pdmt->exv = EX_OSERR;
+#else
+ pdmt->exv = EXIT_FAILURE;
+#endif
+ } break;
+ }
+ }
+#endif
+ }
+ }
+}
+
+
+
+void
+dk4dmt_init(dk4dmt_t *pdmt)
{
- if (0 != lse) {
- if (NULL != prgname) {
- fputs(prgname, stderr);
- fputs(dk4dmt_kw[1], stderr);
- }
- fputs(dk4dmt_kw[i], stderr);
- fputs(dk4dmt_kw[0], stderr);
- fflush(stderr);
- } else {
- dk4dmt_syslog_1(prgname, slf, i);
- }
+ if (NULL != pdmt) {
+ DK4_MEMRES(pdmt,sizeof(dk4dmt_t));
+ pdmt->prgname = NULL;
+ pdmt->pidfile = NULL;
+ pdmt->pfd[0] = -1;
+ pdmt->pfd[1] = -1;
+ pdmt->logstderr = 0;
+#if (DK4_HAVE_SYSLOG_H) && defined(LOG_DAEMON)
+ pdmt->slf = LOG_DAEMON;
+#else
+ pdmt->slf = (3<<3);
+#endif
+ pdmt->exv = EXIT_SUCCESS;
+ }
}
-static
void
-dk4dmt_log_3(
- const char *prgname, int slf, int lse, size_t i1, size_t i2, const char *str
-)
+dk4dmt_set_program(dk4dmt_t *pdmt, const char *progname)
{
- if (0 != lse) {
- if (NULL != prgname) {
- fputs(prgname, stderr);
- fputs(dk4dmt_kw[1], stderr);
- }
- fputs(dk4dmt_kw[i1], stderr);
- if (NULL != str) { fputs(str, stderr); }
- fputs(dk4dmt_kw[i2], stderr);
- fputs(dk4dmt_kw[0], stderr);
- fflush(stderr);
- } else {
- dk4dmt_syslog_3(prgname, slf, i1, i2, str);
- }
+ if ((NULL != pdmt) && (NULL != progname)) {
+ pdmt->prgname = progname;
+ }
}
-/** Reset all signals to SIG_DFL.
- @param reason Address of error code variable
- (1=sigemptyset failed, 2=sigaction failed, 3=no signal handling).
- @return 1 on success, 0 on error.
-*/
-static
-int
-dk4dmt_reset_all_signals(int *reason)
+void
+dk4dmt_set_pidfile(dk4dmt_t *pdmt, const char *pidfile)
{
- $? "+ dk4dmt_reset_all_signals"
-#if DK4_HAVE_SIGACTION
- struct sigaction sigact; /* Signal information for sigaction() */
+ if ((NULL != pdmt) && (NULL != pidfile)) {
+ pdmt->pidfile = pidfile;
+ }
+}
+
+
+
+void
+dk4dmt_set_log_stderr(dk4dmt_t *pdmt, int flag)
+{
+ if (NULL != pdmt) {
+ pdmt->logstderr = flag;
+ }
+}
+
+
+
+void
+dk4dmt_set_syslog_feature(dk4dmt_t *pdmt, int feat)
+{
+ if (NULL != pdmt) {
+ pdmt->slf = feat;
+ }
+}
+
+
+
+void
+dk4dmt_error_sigprocmask(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 207);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 207);
#endif
- int back = 1; /* Function result */
- int maxsig; /* Maximum signal + 1 */
- int i; /* Current signal to modify */
- int go;
+}
+
-#ifdef _NSIG
- maxsig = _NSIG;
+
+void
+dk4dmt_error_sigemptyset(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 207);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 207);
+#endif
+}
+
+
+
+void
+dk4dmt_error_no_signal_function(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 2);
#else
- maxsig = 16;
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 2);
#endif
+}
+
+
- for (i = 1; ((i < maxsig) && (1 == back)); i++) {
- go = 1;
-#ifdef SIGKILL
- if (SIGKILL == i) { go = 0; }
+void
+dk4dmt_error_pid_file_exists(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_SOFTWARE)
+ dk4dmt_set_error_exit_status(pdmt, EX_SOFTWARE, 0);
#else
- if (9 == i) { go = 0; }
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
-#ifdef SIGSTOP
- if (SIGSTOP == i) { go = 0; }
+}
+
+
+
+void
+dk4dmt_error_pid_file_name_missing(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_SOFTWARE)
+ dk4dmt_set_error_exit_status(pdmt, EX_SOFTWARE, 0);
#else
- if (19 == i) { go = 0; }
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- $? ". signo = %d go = %d", i, go
- if (0 != go) {
-#if DK4_HAVE_SIGACTION
- DK4_MEMRES(&sigact, sizeof(sigact));
- sigact.sa_handler = SIG_DFL;
- sigact.sa_flags = 0;
- if (0 != sigemptyset(&(sigact.sa_mask))) {
- if (16 > i) {
- back = 0;
- if (NULL != reason) { $? "! sigemptyset"
- *reason = 1;
- }
- }
- }
- if (0 != sigaction(i, &sigact, NULL)) {
- if (16 > i) {
- back = 0;
- if (NULL != reason) { $? "! sigaction"
- *reason = 2;
- }
- }
- }
+}
+
+
+
+void
+dk4dmt_error_pipe_not_open(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_SOFTWARE)
+ dk4dmt_set_error_exit_status(pdmt, EX_SOFTWARE, 0);
#else
-#if DK4_HAVE_SIGSET
- sigset(i, SIG_DFL);
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+}
+
+
+
+void
+dk4dmt_error_pipe_read_failed(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
#else
-#if DK4_HAVE_SIGNAL
- signal(i, SIG_DFL);
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+}
+
+
+
+void
+dk4dmt_error_fork_failed(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 0);
#else
- back = 0;
- if (NULL != reason) { *reason = 3; }
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
+}
+
+
+
+void
+dk4dmt_error_dup2_failed(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
+}
+
+
+
+void
+dk4dmt_error_failed_read_dev_null(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- }
- }
- $? "- dk4dmt_reset_all_signals %d", back
- return back;
}
-/** Obtain maximum file descriptor number.
- @return Maximum file descriptor.
-*/
-static
-int
-dk4dmt_max_file_descriptor(void)
+void
+dk4dmt_error_failed_write_dev_null(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+}
+
+
+
+void
+dk4dmt_error_failed_chdir_root(dk4dmt_t *pdmt)
{
-#if DK4_HAVE_SYS_RESOURCE_H && DK4_HAVE_GETRLIMIT && defined(RLIMIT_NOFILE)
- struct rlimit rl;
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 200);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 200);
#endif
- int back = 1024;
-#if DK4_HAVE_SYS_RESOURCE_H && DK4_HAVE_GETRLIMIT && defined(RLIMIT_NOFILE)
- if (0 == getrlimit(RLIMIT_NOFILE, &rl)) {
-#if defined(RLIM_INFINITY)
- if (RLIM_INFINITY != rl.rlim_max) {
+}
+
+
+
+void
+dk4dmt_error_setsid(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 220);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 220);
#endif
- back = rl.rlim_max;
-#if defined(RLIM_INFINITY)
- }
+}
+
+
+void
+dk4dmt_error_write_pid_file(dk4dmt_t *pdmt)
+{
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- }
+}
+
+
+
+void
+dk4dmt_error_sysfct(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_OSERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_OSERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
#endif
- return back;
+ }
+}
+
+
+
+void
+dk4dmt_error_usage(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_USAGE)
+ dk4dmt_set_error_exit_status(pdmt, EX_USAGE, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+ }
+}
+
+
+
+void
+dk4dmt_error_config(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_CONFIG)
+ dk4dmt_set_error_exit_status(pdmt, EX_CONFIG, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+ }
}
-/** Close all file descriptors except 0 (stdin), 1 (stdout) and 2 (stderr).
-*/
static
void
-dk4dmt_close_non_std_file_descriptors(void)
+dk4dmt_reset_all_signals(int *pback, dk4dmt_t *pdmt)
{
- int maxfd;
- int fd;
+#if DK4_HAVE_SIGACTION
+ struct sigaction sigact; /* Information for sigaction() */
+#endif
+ char buf[16*sizeof(int)];
+ int maxsig; /* Maximum signal number */
+ int signo; /* Current signal number to process */
+ int go; /* Flag: Reconfigure signal */
+ int ec; /* Error code */
+
+ ec = 0;
+#ifdef _NSIG
+ maxsig = _NSIG;
+#else
+ maxsig = 16;
+#endif
+ for (signo = 1; ((maxsig >= signo) && (1 == *pback)); signo++) {
+ go = 1;
+#ifdef SIGKILL
+ if (SIGKILL == signo) { go = 0; }
+#else
+ if (9 == signo) { go = 0; }
+#endif
+#ifdef SIGSTOP
+ if (SIGSTOP == signo) { go = 0; }
+#else
+ if (19 == signo) { go = 0; }
+#endif
+ if (0 != go) {
+#if DK4_HAVE_SIGACTION
+ DK4_MEMRES(&sigact, sizeof(sigact));
+ sigact.sa_handler = SIG_DFL;
+ sigact.sa_flags = 0;
+ if (0 != sigemptyset(&(sigact.sa_mask))) {
+ if (16 > signo) {
+ *pback = 0;
+ dk4dmt_error_sigemptyset(pdmt);
+ /* ERROR: Failed to empty set */
+#if DK4_HAVE_SNPRINTF
+ snprintf(buf, sizeof(buf), "%d", signo);
+#else
+ sprintf(buf, "%d", signo);
+#endif
+ dk4dmt_log_3(pdmt, 5, 6, buf);
+ }
+ }
+ else {
+ if (0 != sigaction(signo, &sigact, NULL)) {
+ if (16 > signo) {
+ *pback = 0;
+ dk4dmt_error_sigemptyset(pdmt);
+ /* ERROR: sigaction failed */
+#if DK4_HAVE_SNPRINTF
+ snprintf(buf, sizeof(buf), "%d", signo);
+#else
+ sprintf(buf, "%d", signo);
+#endif
+ dk4dmt_log_3(pdmt, 7, 8, buf);
+ }
+ }
+ }
+#else
+#if DK4_HAVE_SIGSET
+ sigset(signo, SIG_DFL);
+#else
+#if DK4_HAVE_SIGNAL
+ signal(signo, SIG_DFL);
+#else
+ *pback = 0;
+ dk4dmt_error_no_signal_function(pdmt);
+ /* ERROR: No function available to modify signals */
+ if (0 == ec) { ec = 3; }
+#endif
+#endif
+#endif
+ }
+ }
+ switch (ec) {
+ case 3: {
+ dk4dmt_log_1(pdmt, 4);
+ } break;
+ }
+}
+
- maxfd = dk4dmt_max_file_descriptor();
- for (fd = 3; fd < maxfd; fd++) {
- (void)close(fd);
- }
+
+static
+void
+dk4dmt_unblock_all_signals(int *pback, dk4dmt_t *pdmt)
+{
+ sigset_t set;
+ if (0 == sigemptyset(&set)) {
+ if (0 != sigprocmask(SIG_SETMASK, &set, NULL)) {
+ *pback = 0;
+ dk4dmt_error_sigprocmask(pdmt);
+ /* ERROR: sigprocmask failed */
+ dk4dmt_log_1(pdmt, 9);
+ }
+ }
+ else {
+ *pback = 0;
+ dk4dmt_error_sigemptyset(pdmt);
+ /* ERROR: Failed to sigemptyset */
+ dk4dmt_log_1(pdmt, 9);
+ }
}
-/** Unblock all signals.
- @param reason Address of error code variable
- (1=sigemptyset failed, 2=sigprocmask failed).
- @return 1 on success, 0 on error.
-*/
static
-int
-dk4dmt_unblock_all_signals(int *reason)
+void
+dk4dmt_close_non_std_file_descriptors(void)
{
- sigset_t set;
- int back = 1;
- if (0 != sigemptyset(&set)) {
- back = 0;
- if (NULL != reason) { *reason = 1; }
- }
- if (0 != sigprocmask(SIG_SETMASK, &set, NULL)) {
- back = 0;
- if (NULL != reason) { *reason = 2; }
- }
- return back;
+#if DK4_HAVE_SYS_RESOURCE_H && DK4_HAVE_GETRLIMIT && defined(RLIMIT_NOFILE)
+ struct rlimit rl;
+#endif
+ int maxfd = 1024;
+ int fd;
+
+ /* Find maximum file descriptor
+ */
+#if DK4_HAVE_SYS_RESOURCE_H && DK4_HAVE_GETRLIMIT && defined(RLIMIT_NOFILE)
+ if (0 == getrlimit(RLIMIT_NOFILE, &rl)) {
+#if defined(RLIM_INFINITY)
+ if (RLIM_INFINITY != rl.rlim_max) {
+ back = rl.rlim_max;
+ }
+#else
+ back = rl.rlim_max;
+#endif
+ }
+#else
+#endif
+ /*
+ Close file descriptors
+ */
+ for (fd = 3; fd <= maxfd; fd++) {
+ (void)close(fd);
+ }
}
int
-dk4dmt_parent_before_fork(
- const char *prgname, const char *pidfilename, int logstderr, int slf
-)
-{
- dk4_stat_t stb;
- int reason = 0;
- int back = 1;
-
- /* Close file descriptors except 0, 1 and 2 */
- dk4dmt_close_non_std_file_descriptors();
-
- /* Reset all signal actions to default handlers */
- if (0 == dk4dmt_reset_all_signals(&reason)) {
- back = 0;
- if (0 != logstderr) {
- switch (reason) {
- case 1: {
- /* ERROR: sigemptyset() failed */
- dk4dmt_log_1(prgname, slf, logstderr, 6);
- } break;
- case 2: {
- /* ERROR: sigaction() failed */
- dk4dmt_log_1(prgname, slf, logstderr, 7);
- } break;
- default: {
- /* ERROR: No sigaction()/sigset()/signal() function */
- dk4dmt_log_1(prgname, slf, logstderr, 8);
- } break;
- }
- }
- }
-
- /* Unblock all signals */
- if (0 == dk4dmt_unblock_all_signals(&reason)) {
- back = 0;
- if (0 != logstderr) {
- switch (reason) {
- case 1: {
- /* ERROR: sigemptyset() failed */
- dk4dmt_log_1(prgname, slf, logstderr, 9);
- } break;
- case 2: {
- /* ERROR: sigprocmask() failed */
- dk4dmt_log_1(prgname, slf, logstderr, 10);
- } break;
- }
- }
- }
-
- if ((0 != back) && (NULL != pidfilename)) {
- if (0 != dk4stat_c8(&stb, pidfilename, NULL)) {
- back = 0;
- /* ERROR: PID file exists */
- dk4dmt_log_3(prgname, slf, logstderr, 11, 12, pidfilename);
- }
- }
-
- return back;
+dk4dmt_parent_before_fork(dk4dmt_t *pdmt)
+{
+ dk4_stat_t stb;
+ int back = 0;
+
+ if (NULL != pdmt) {
+ back = 1;
+ /*
+ Close non-standard file descriptors
+ */
+ dk4dmt_close_non_std_file_descriptors();
+ /*
+ Reset all signals
+ */
+ dk4dmt_reset_all_signals(&back, pdmt);
+ if (1 == back) {
+ /*
+ Unblock all signals
+ */
+ dk4dmt_unblock_all_signals(&back, pdmt);
+ if (1 == back) {
+ if (NULL != pdmt->pidfile) {
+ if (0 != dk4stat_c8(&stb, pdmt->pidfile, NULL)) {
+ back = 0;
+ dk4dmt_error_pid_file_exists(pdmt);
+ /* ERROR: PID file exists */
+ dk4dmt_log_1(pdmt, 10);
+ }
+ }
+ if (1 == back) {
+ if (0 != pipe(&(pdmt->pfd[0]))) {
+ back = 0;
+ pdmt->pfd[0] = -1;
+ pdmt->pfd[1] = -1;
+ }
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+void
+dk4dmt_parent_after_fork(dk4dmt_t *pdmt)
+{
+ int v;
+
+ if (NULL != pdmt) {
+ /*
+ Close write head
+ */
+ if (-1 != pdmt->pfd[1]) {
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ else {
+ dk4dmt_error_pipe_not_open(pdmt);
+ /* ERROR: Pipe was not open (bug) */
+ dk4dmt_log_1(pdmt, 11);
+ }
+ /*
+ Read exit status code and close read head
+ */
+ if (-1 != pdmt->pfd[0]) {
+ if ((int)sizeof(int) == (int)read(pdmt->pfd[0], &v, sizeof(int))) {
+ pdmt->exv = v;
+ }
+ else {
+ dk4dmt_error_pipe_read_failed(pdmt);
+ /* ERROR: Failed to read from pipe */
+ dk4dmt_log_1(pdmt, 12);
+ }
+ close(pdmt->pfd[0]);
+ pdmt->pfd[0] = -1;
+ }
+ else {
+ dk4dmt_error_pipe_not_open(pdmt);
+ /* ERROR: Pipe was not open (bug) */
+ dk4dmt_log_1(pdmt, 11);
+ }
+ }
+}
+
+
+
+void
+dk4dmt_parent_fork_failed(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+ /*
+ Write error exit status code
+ */
+ dk4dmt_error_fork_failed(pdmt);
+ /* ERROR: Fork failed */
+ dk4dmt_log_1(pdmt, 13);
+ /*
+ Close write head
+ */
+ if (-1 != pdmt->pfd[1]) {
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ /*
+ Close read head
+ */
+ if (-1 != pdmt->pfd[0]) {
+ close(pdmt->pfd[0]);
+ pdmt->pfd[0] = -1;
+ }
+ }
}
+
int
-dk4dmt_intermediate_before_fork(const char *prgname, int slf)
+dk4dmt_intermediate_before_fork(dk4dmt_t *pdmt)
{
- int back = 1;
+ int back = 0;
+ if (NULL != pdmt) {
+ back = 1;
+ /*
+ Close read head
+ */
+ if (-1 != pdmt->pfd[0]) {
+ close(pdmt->pfd[0]);
+ pdmt->pfd[0] = -1;
+ }
#if DK4_HAVE_SETSID
- if ((pid_t)(-1) == setsid()) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 14);
- }
+ if ((pid_t)(-1) == setsid()) {
+ back = 0;
+ dk4dmt_error_setsid(pdmt);
+ /* ERROR: setsid() failed */
+ dk4dmt_log_1(pdmt, 14);
+ }
#else
#if DK4_HAVE_SETPGRP
- setpgrp();
+ setpgrp();
#else
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 13);
+ back = 0;
+ dk4dmt_error_setsid(pdmt);
+ /* ERROR: No function to decouple from terminal */
+ dk4dmt_log_1(pdmt, 15);
#endif
#endif
- return back;
+ }
+ return back;
+}
+
+
+
+void
+dk4dmt_intermediate_after_fork(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+ /*
+ Close write head
+ */
+ if (-1 != pdmt->pfd[1]) {
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ }
}
+void
+dk4dmt_intermediate_fork_failed(dk4dmt_t *pdmt)
+{
+ int v;
+
+ if (NULL != pdmt) {
+ /*
+ Set exit status code
+ */
+ dk4dmt_parent_fork_failed(pdmt);
+ /* ERROR: Fork failed */
+ dk4dmt_log_1(pdmt, 13);
+ /*
+ Close write head
+ */
+ if (-1 != pdmt->pfd[1]) {
+ v = pdmt->exv;
+ if ((int)sizeof(v) != (int)write(pdmt->pfd[1], &v, sizeof(v))) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+ }
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ }
+}
+
+
+
+int
+dk4dmt_daemon_start(dk4dmt_t *pdmt)
+{
+ char pidbuf[16*sizeof(dk4_um_t)];
+ FILE *fipo;
+ int res;
+ int v;
+ int fdout;
+ int fdin;
+ int back = 0;
+
+ if (NULL != pdmt) {
+ if (NULL != pdmt->pidfile) {
+ res = dk4ma_write_c8_decimal_unsigned(
+ pidbuf, sizeof(pidbuf), (dk4_um_t)getpid(), 0, NULL
+ );
+ if (0 != res) {
+ if (0 != dk4str8_cat_s(pidbuf,sizeof(pidbuf),dk4dmt_kw[0],NULL))
+ {
+ (void)dk4mkdir_hierarchy_c8(pdmt->pidfile, 0, NULL);
+ fipo = dk4fopen_c8(
+ pdmt->pidfile,dk4dmt_kw[1],DK4_FOPEN_SC_PRIVILEGED,NULL
+ );
+ if (NULL != fipo) {
+ back = 1;
+ if (EOF == fputs(pidbuf, fipo)) {
+ back = 0;
+ dk4dmt_error_write_pid_file(pdmt);
+ /* ERROR: Failed to write PID file */
+ dk4dmt_log_1(pdmt, 16);
+ }
+ if (0 != fclose(fipo)) {
+ back = 0;
+ dk4dmt_error_write_pid_file(pdmt);
+ /* ERROR: Failed to write PID file */
+ dk4dmt_log_1(pdmt, 16);
+ }
+ }
+ else {
+ dk4dmt_error_write_pid_file(pdmt);
+ /* ERROR: Failed to write PID file */
+ dk4dmt_log_1(pdmt, 16);
+ }
+ }
+ }
+ if (0 == back) {
+ unlink(pdmt->pidfile);
+ }
+ }
+ else {
+ dk4dmt_error_pid_file_name_missing(pdmt);
+ /* ERROR: Missing PID file name */
+ dk4dmt_log_1(pdmt, 17);
+ }
+ /*
+ Connect /dev/null to stdin, stdout and stderr
+ */
+ if (0 != back) {
+ fdin = open(dk4dmt_kw[2], O_RDONLY);
+ if (-1 < fdin) {
+ if (-1 == dup2(fdin, 0)) {
+ back = 0;
+ dk4dmt_error_dup2_failed(pdmt);
+ /* ERROR: Failed to duplicate file handle */
+ dk4dmt_log_1(pdmt, 18);
+ }
+ close(fdin);
+ }
+ else {
+ back = 0;
+ dk4dmt_error_failed_read_dev_null(pdmt);
+ /* ERROR: Failed to read /dev/null */
+ dk4dmt_log_1(pdmt, 19);
+ }
+ fdout = open(dk4dmt_kw[2], O_WRONLY);
+ if (-1 < fdout) {
+ if (-1 == dup2(fdout, 1)) {
+ back = 0;
+ dk4dmt_error_dup2_failed(pdmt);
+ /* ERROR: Failed to duplicate file handle */
+ dk4dmt_log_1(pdmt, 18);
+ }
+ if (-1 == dup2(fdout, 2)) {
+ back = 0;
+ dk4dmt_error_dup2_failed(pdmt);
+ /* ERROR: Failed to duplicate file handle */
+ dk4dmt_log_1(pdmt, 18);
+ }
+ close(fdout);
+ }
+ else {
+ back = 0;
+ dk4dmt_error_failed_write_dev_null(pdmt);
+ /* ERROR: Failed to write /dev/null */
+ dk4dmt_log_1(pdmt, 20);
+ }
+ }
+ /*
+ Use exact permissions when creating new files or directories
+ */
+ if (0 != back) {
+ umask(0);
+ }
+ /*
+ Change to root directory
+ */
+ if (0 != back) {
+ if (0 != chdir(dk4dmt_kw[3])) {
+ back = 0;
+ dk4dmt_error_failed_chdir_root(pdmt);
+ /* ERROR: Failed to change into root directory */
+ dk4dmt_log_1(pdmt, 21);
+ }
+ }
+ /* Send exit status code to main process
+ */
+ if (-1 != pdmt->pfd[1]) {
+ v = pdmt->exv;
+ if ((int)sizeof(v) != (int)write(pdmt->pfd[1], &v, sizeof(v))) {
+#if (DK4_HAVE_SYSEXITS_H) && defined(EX_IOERR)
+ dk4dmt_set_error_exit_status(pdmt, EX_IOERR, 0);
+#else
+ dk4dmt_set_error_exit_status(pdmt, EXIT_FAILURE, 0);
+#endif
+ }
+ close(pdmt->pfd[1]);
+ pdmt->pfd[1] = -1;
+ }
+ }
+ return back;
+}
+
+
+
+void
+dk4dmt_daemon_end(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+ if (NULL != pdmt->pidfile) {
+ if (0 != unlink(pdmt->pidfile)) {
+ /* ERROR: Failed to remove PID file */
+ dk4dmt_log_3(pdmt, 22, 23, pdmt->pidfile);
+ }
+ }
+ }
+}
+
+
+
+void
+dk4dmt_success(dk4dmt_t *pdmt)
+{
+ if (NULL != pdmt) {
+ pdmt->exv = EXIT_SUCCESS;
+ }
+}
+
+
int
-dk4dmt_daemon_after_fork(const char *prgname, const char *pidfilename, int slf)
-{
- char pidbuf[16*sizeof(dk4_um_t)];
- FILE *fipo;
- int fdin; /* File descriptor for input */
- int fdout; /* File descriptor for output */
- int res; /* Operation result */
- int back = 1;
-
- if (NULL != pidfilename) {
- res = dk4ma_write_c8_decimal_unsigned(
- pidbuf, sizeof(pidbuf), (dk4_um_t)getpid(), 0, NULL
- );
- if (0 != res) {
- if (0 != dk4str8_cat_s(pidbuf, sizeof(pidbuf), dk4dmt_kw[0], NULL)) {
- (void)dk4mkdir_hierarchy_c8(pidfilename, 0, NULL);
- fipo = dk4fopen_c8(pidfilename, "w", DK4_FOPEN_SC_PRIVILEGED, NULL);
- if (NULL != fipo) {
- fputs(pidbuf, fipo);
- fclose(fipo);
- } else {
- dk4dmt_syslog_3(prgname, slf, 15, 16, pidfilename);
- back = 0;
+dk4dmt_get_exit_status(dk4dmt_t *pdmt)
+{
+ int back = EXIT_FAILURE;
+ if (NULL != pdmt) {
+ back = pdmt->exv;
}
- }
- }
- }
-
- /* Connect /dev/null to stdin stout stderr or close them
- */
- fdin = open("/dev/null", O_RDONLY);
- if (-1 < fdin) {
- if (-1 == dup2(fdin, 0)) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 19);
- }
- close(fdin);
- } else {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 18);
- }
- fdout = open("/dev/null", O_WRONLY);
- if (-1 < fdout) {
- if (-1 == dup2(fdout, 1)) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 21);
- }
- if (-1 == dup2(fdout, 2)) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 22);
- }
- close(fdout);
- } else {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 20);
- }
-
- /* Use exact permissions when creating new files or directories.
- */
- umask(0);
-
- /* Change to root directory, so the previous current directory
- can be unmounted without blocking.
- */
- if (0 != chdir("/")) {
- back = 0;
- dk4dmt_syslog_1(prgname, slf, 23);
- }
-
- /* Indicate success or error.
- */
- return back;
-}
-
-
-
-void
-dk4dmt_daemon_end(const char *prgname, const char *pidfilename, int slf)
-{
- if (NULL != pidfilename) {
- if (0 != unlink(pidfilename)) {
- dk4dmt_syslog_3(prgname, slf, 24, 25, pidfilename);
- }
- }
+ return back;
}
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4dmt.h b/support/dktools/dk4dmt.h
index b2a1059b5c..24d17a897c 100644
--- a/support/dktools/dk4dmt.h
+++ b/support/dktools/dk4dmt.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4dmt.ctr
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4dmt.ctr
*/
#ifndef DK4DMT_H_INCLUDED
@@ -38,16 +16,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DK4DMT_H_INCLUDED 1
-#line 8 "dk4dmt.ctr"
+#line 9 "dk4dmt.ctr"
-/** @file dk4dmt.h Daemon tools.
+/** @file dk4dmt.h Daemon tool functions.
-The functions in this module can be used in standing daemons.
+The functions in this module can be used to program standing daemons.
+Three processes are involved in a standing daemon:
+
+* master process, originally started,
+* intermediate process, forked by master, decouples from terminal and
+* daemon process, forked by intermediate process.
+
+When a standing daemon is started by a systemd service unit, the master
+process must not exit before the daemon process has created the PID file.
-In the original process, call the
-dk4dmt_parent_before_fork() function to close all file descriptors
-above 2, reset all signal handlers to defaults, unblock all signals
-and check whether a PID file already exists.
If you plan to give up root privileges in the child processes
(use setgid() and setuid() to change effective user and group),
do not use /var/run/<i>program</i>.pid as PID file name, better
@@ -57,77 +39,369 @@ to the unprivileged user and group used by the child process.
User and group need write permission to the directory, so the unprivileged
child process can remove the PID file when exiting.
-In the intermediate process after the first fork call
-dk4dmt_intermediate_before_fork(). Among other things this function
-completely decouples the process from the terminal.
+The general usage structure looks like this:
+
+@code
+#define PROGRAM_NAME "my-new-service"
+const char program_name[] = {
+ PROGRAM_NAME
+};
+const char pid_file_name[] = {
+ "/run/" PROGRAM_NAME "/" PROGRAM_NAME ".pid"
+};
+dk4dmt_t dmt;
-In the final process (after forking again) call
-dk4dmt_daemon_after_fork()
-to set up things before starting service. This function creates the PID
-file, connects file descriptors 0, 1 and 2 to /dev/null, resets
-the umask and changes into the / directory.
+...
-After finishing service call
-dk4dmt_daemon_end() before exiting. This function removes the PID
-file.
+pid_t cpid;
+dk4dmt_init(&dmt);
+if (0 != read_configuration_file()) {
+ dk4dmt_set_program(&dmt, program_name);
+ dk4dmt_set_pidfile(&dmt, pid_file_name);
+ dk4dmt_set_syslog_feature(&dmt, syslog_feature);
+ if (0 != dk4dmt_parent_before_fork(&dmt)) {
+ cpid = fork();
+ if ((pid_t)0 == cpid) {
+ if (0 != dk4dmt_intermediate_before_fork(&dmt)) {
+ cpid = fork();
+ if ((pid_t)0 == cpid) {
+ if (0 != dk4dmt_daemon_start(&dmt)) {
+ do_the_service();
+ }
+ dk4dmt_daemon_end(&dmt);
+ }
+ else {
+ if ((pid_t)(-1) != cpid) {
+ dk4dmt_intermediate_after_fork(&dmt);
+ }
+ else {
+ dk4dmt_intermediate_fork_failed(&dmt);
+ }
+ }
+ }
+ }
+ else {
+ if ((pid_t)(-1) != cpid) {
+ dk4dmt_parent_after_fork(&dmt);
+ }
+ else {
+ dk4dmt_parent_fork_failed(&dmt);
+ }
+ }
+ }
+}
+else {
+ dk4dmt_error_config(&dmt);
+}
+exval = dk4dmt_get_exit_status(&dmt);
+exit(exval);
+@endcode
+
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+
+/** Data collection for daemon.
*/
+typedef struct {
+ char const *prgname; /**< Program name. */
+ char const *pidfile; /**< PID file name. */
+ int pfd[2]; /**< Pipe file descriptors. */
+ int logstderr; /**< Flag: Logging to stderr allowed. */
+ int slf; /**< Syslog feature. */
+ int exv; /**< Exit status code to return. */
+} dk4dmt_t;
+
-#ifdef __cplusplus
+
+#ifdef __cplusplus
extern "C" {
#endif
-/** Activities in parent process before calling fork().
- * Close all file descriptors above 2.
- * Reset all signal actions to default handlers.
- * Unblock all signals.
- * Check whether PID file already exists.
- Use this function to check whether the initial process
- can run fork().
- @param prgname Program name.
- @param pidfilename PID file name.
- @param logstderr Flag: Logging to stderr allowed.
- @param slf Syslog feature.
- @return 1 on success (can call fork), 0 on error (abort).
+/** Initialize daemon tool structure.
+ @param pdmt Daemon tool structure to initialize.
*/
-int
-dk4dmt_parent_before_fork(
- const char *prgname, const char *pidfilename, int logstderr, int slf
-);
+
+void
+dk4dmt_init(dk4dmt_t *pdmt);
+
+
+/** Set program name for daemon tool structure.
+ The function does not create a copy of the program name,
+ it keeps the original pointer in the structure.
+ So the progname buffer must exist and contain data as long as
+ the structure is used.
+ @param pdmt Daemon tool structure to set up.
+ @param progname Program name.
+*/
+
+void
+dk4dmt_set_program(dk4dmt_t *pdmt, const char *progname);
+
+
+/** Set PID file name for daemon tool structure.
+ The function does not create a copy of the file name, it keeps the original
+ pointer in the structure.
+ So the pidfile buffer must exist and contain data as long as
+ the structure is used.
+ @param pdmt Daemon tool structure to set up.
+ @param pidfile PID file name.
+*/
+
+void
+dk4dmt_set_pidfile(dk4dmt_t *pdmt, const char *pidfile);
+
+
+/** Enable or disable logging to stderr for daemon tool structure.
+ @param pdmt Daemon tool structure to set up.
+ @param flag Allow or deny logging to stderr.
+*/
+
+void
+dk4dmt_set_log_stderr(dk4dmt_t *pdmt, int flag);
+
+
+/** Set syslog feature for daemon tool structure.
+ @param pdmt Daemon tool structure to set up.
+ @param feat Syslog feature to use.
+*/
+
+void
+dk4dmt_set_syslog_feature(dk4dmt_t *pdmt, int feat);
-/** Activities in first child before calling fork() again.
- * Decouple completely from terminal.
- Use this function to check whether the first child process
- can run fork() again.
- @param prgname Program name.
- @param slf Syslog feature.
- @return 1 on success (can call fork), 0 on error (abort).
+/** Process initialization before first fork attempt.
+ Open pipe for communication from daemon to parent.
+ @param pdmt Daemon tool structure to use.
+ @return 1 on success, 0 on error.
*/
+
int
-dk4dmt_intermediate_before_fork(const char *prgname, int slf);
-
-/** Activities in final daemon process.
- * Create PID file.
- * Connect file descriptors 0, 1 and 2 to /dev/null.
- * Reset umask.
- * Change into / directory.
- @param prgname Program name.
- @param pidfilename File name for PID file.
- @param slf Syslog feature.
+dk4dmt_parent_before_fork(dk4dmt_t *pdmt);
+
+
+/** Wait for startup completion notification in parent process.
+ Close write head, read exit status, close read head.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_parent_after_fork(dk4dmt_t *pdmt);
+
+
+/** React on failed fork attempt in parent process.
+ Close both pipe heads.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_parent_fork_failed(dk4dmt_t *pdmt);
+
+
+/** Prepare for second fork attempt in intermediate process.
+ Close read head.
+ On error write exit status code and close write pipe head.
+ @param pdmt Daemon tool structure to use.
@return 1 on success, 0 on error.
*/
+
+int
+dk4dmt_intermediate_before_fork(dk4dmt_t *pdmt);
+
+
+/** Clean up in intermediate process after forking the daemon.
+ Close write pipe head.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_intermediate_after_fork(dk4dmt_t *pdmt);
+
+
+/** React on failed fork attempt in intermediate process.
+ Write exit status code and close write pipe head.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_intermediate_fork_failed(dk4dmt_t *pdmt);
+
+
+/** Create PID file and notify main process to exit.
+ Write exit status and close write pipe head.
+ @param pdmt Daemon tool structure to use.
+*/
+
int
-dk4dmt_daemon_after_fork(const char *prgname, const char *pidfilename, int slf);
+dk4dmt_daemon_start(dk4dmt_t *pdmt);
+
+
+/** Clean up daemon structure before exiting daemon process (remove PID file).
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_daemon_end(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure for failed system function.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_sysfct(dk4dmt_t *pdmt);
+
-/** End of daemon, remove PID file.
- @param prgname Program name.
- @param pidfilename PID file name.
- @param slf Syslog feature.
+/** Set exit code in daemon structure for failed signal process mask.
+ @param pdmt Daemon tool structure to use.
*/
+
+void
+dk4dmt_error_sigprocmask(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate missing signal functionality.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_no_signal_function(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate PID file exists.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_pid_file_exists(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate PID file not configured.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_pid_file_name_missing(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate write PID file failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_write_pid_file(dk4dmt_t *pdmt);
+
+/** Set exit code in daemon structure to indicate pipe was not opened (bug).
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_pipe_not_open(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate reading from pipe failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_pipe_read_failed(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate fork failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_fork_failed(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate setsid failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_setsid(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate dup2 failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_dup2_failed(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate reading /dev/null failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_failed_read_dev_null(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate writing /dev/null failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_failed_write_dev_null(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate chdir to / failed.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_failed_chdir_root(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure for failed signal set cleanup.
+ @param pdmt Daemon tool structure to use.
+*/
+
void
-dk4dmt_daemon_end(const char *prgname, const char *pidfilename, int slf);
+dk4dmt_error_sigemptyset(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure for unusable configuration.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_config(dk4dmt_t *pdmt);
+
+
+/** Set exit code in daemon structure to indicate wrong call arguments.
+ @param pdmt Daemon tool structure to use.
+*/
+
+void
+dk4dmt_error_usage(dk4dmt_t *pdmt);
+
+
+/** Indicate success.
+ @param pdmt Daemon tool structure to use.
+*/
+void
+dk4dmt_success(dk4dmt_t *pdmt);
+
+
+/** Retrieve exit status code.
+ @param pdmt Daemon tool structure to use.
+ @return Exit status code to return.
+*/
+
+int
+dk4dmt_get_exit_status(dk4dmt_t *pdmt);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4edstm.h b/support/dktools/dk4edstm.h
index b985cf50a5..258d9aa923 100644
--- a/support/dktools/dk4edstm.h
+++ b/support/dktools/dk4edstm.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4EDSTM_H_INCLUDED
#define DK4EDSTM_H_INCLUDED 1
diff --git a/support/dktools/dk4enc.c b/support/dktools/dk4enc.c
index 0659794b1c..7a0d15ab21 100644
--- a/support/dktools/dk4enc.c
+++ b/support/dktools/dk4enc.c
@@ -1,48 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4enc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4enc.ctr
*/
/** @file dk4enc.c The dk4enc module.
*/
-#line 138 "dk4enc.ctr"
+#line 153 "dk4enc.ctr"
+#include "dk4conf.h"
#include "dk4enc.h"
#include "dk4mem.h"
#include "dk4strd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
/** Encoding names in variations.
@@ -153,10 +138,16 @@ dkT("iso-latin-1"),
/* 34 */
dkT("iso-8859-1"),
+/* 35 */
+dkT("win1252"),
+
+/* 36 */
+dkT("cp1252"),
+
NULL
-#line 215 "dk4enc.ctr"
+#line 245 "dk4enc.ctr"
};
@@ -185,7 +176,7 @@ dkT("nobom"),
NULL
-#line 230 "dk4enc.ctr"
+#line 260 "dk4enc.ctr"
};
@@ -202,7 +193,10 @@ dk4enc_find(int *encptr, int *bomptr, const dkChar *src, dk4_er_t *erp)
int enc = 0; /* Encoding found */
int bom = 0; /* Flag: BOM keyword found */
int bom_f = 0; /* Flag: BOM information found */
-
+#if DK4_USE_ASSERT
+ assert(NULL != encptr);
+ assert(NULL != src);
+#endif
if ((NULL != encptr) && (NULL != src)) {
if (0 != dk4str_cpy_s(buf, DK4_SIZEOF(buf,dkChar), src, erp)) {
p1 = dk4str_start(buf, NULL);
@@ -215,11 +209,11 @@ dk4enc_find(int *encptr, int *bomptr, const dkChar *src, dk4_er_t *erp)
dk4str_normalize(p1, NULL);
switch (dk4str_array_index(dk4enc_encoding_names, p1, 0)) {
case 0: case 1: case 33: case 34: {
- enc = DK4_FILE_ENCODING_ASCII;
+ enc = DK4_FILE_ENCODING_PLAIN;
back = 1;
} break;
- case 2: {
- enc = DK4_FILE_ENCODING_ANSI;
+ case 2: case 35: case 36: {
+ enc = DK4_FILE_ENCODING_WIN1252;
back = 1;
} break;
case 3: case 4: {
diff --git a/support/dktools/dk4enc.ctr b/support/dktools/dk4enc.ctr
index 898a825a6e..a7c1cf0ae1 100644
--- a/support/dktools/dk4enc.ctr
+++ b/support/dktools/dk4enc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -31,13 +43,15 @@ license = bsd
/** Encodings for text files.
*/
enum {
- /** ASCII character set.
+ /** Bytes 0x00 to 0xff represent
+ U+0000 to U+00FF.
+ Formerly misleading named "ASCII".
*/
- DK4_FILE_ENCODING_ASCII = 0,
+ DK4_FILE_ENCODING_PLAIN = 0,
- /** ANSII encoding (used ie on Windows).
+ /** Encoding used in Windows GUI programs.
*/
- DK4_FILE_ENCODING_ANSI ,
+ DK4_FILE_ENCODING_WIN1252 ,
/** UTF-8 encoding used on Linux and Unix.
*/
@@ -62,19 +76,19 @@ enum {
significant byte first.
*/
DK4_FILE_ENCODING_32_BE
+
};
/** Encoding for characters in memory.
*/
enum {
- /** ASCII character set (0 to 255) in
- ISO-LATIN-8859-1.
+ /** Bytes 0x00 to 0xFF represent U+0000 to U+00FF.
*/
- DK4_ENCODING_ASCII = DK4_FILE_ENCODING_ASCII,
+ DK4_ENCODING_PLAIN = DK4_FILE_ENCODING_PLAIN,
- /** ANSII encoding (used ie on Windows).
+ /** Encoding used by Windows GUI programs.
*/
- DK4_ENCODING_ANSI = DK4_FILE_ENCODING_ANSI,
+ DK4_ENCODING_WIN1252 = DK4_FILE_ENCODING_WIN1252,
/** UTF-8 encoding used on Linux and Unix.
*/
@@ -84,7 +98,7 @@ enum {
/** UTF-16 encoding.
*/
- DK4_ENCODING_UTF16 = DK4_FILE_ENCODING_UTF16_BE,
+ DK4_ENCODING_UTF16 = DK4_FILE_ENCODING_UTF16_BE ,
/** 32-bit unicode characters.
*/
@@ -94,13 +108,14 @@ enum {
/** UTF-16 encoding.
*/
- DK4_ENCODING_UTF16 = DK4_FILE_ENCODING_UTF16_LE,
+ DK4_ENCODING_UTF16 = DK4_FILE_ENCODING_UTF16_LE ,
/** 32-bit unicode characters.
*/
DK4_ENCODING_32 = DK4_FILE_ENCODING_32_LE
#endif
+
};
@@ -136,10 +151,17 @@ dk4enc_find(int *encptr, int *bomptr, const dkChar *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4enc.h"
#include "dk4mem.h"
#include "dk4strd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
/** Encoding names in variations.
@@ -211,6 +233,14 @@ uc32.msb
uc32.lsb
iso-latin-1
iso-8859-1
+#
+# 35 ... 36
+#
+win1252
+cp1252
+#
+#
+#
$!end
};
@@ -243,7 +273,10 @@ dk4enc_find(int *encptr, int *bomptr, const dkChar *src, dk4_er_t *erp)
int enc = 0; /* Encoding found */
int bom = 0; /* Flag: BOM keyword found */
int bom_f = 0; /* Flag: BOM information found */
-
+#if DK4_USE_ASSERT
+ assert(NULL != encptr);
+ assert(NULL != src);
+#endif
if ((NULL != encptr) && (NULL != src)) {
if (0 != dk4str_cpy_s(buf, DK4_SIZEOF(buf,dkChar), src, erp)) {
p1 = dk4str_start(buf, NULL);
@@ -256,11 +289,11 @@ dk4enc_find(int *encptr, int *bomptr, const dkChar *src, dk4_er_t *erp)
dk4str_normalize(p1, NULL);
switch (dk4str_array_index(dk4enc_encoding_names, p1, 0)) {
case 0: case 1: case 33: case 34: {
- enc = DK4_FILE_ENCODING_ASCII;
+ enc = DK4_FILE_ENCODING_PLAIN;
back = 1;
} break;
- case 2: {
- enc = DK4_FILE_ENCODING_ANSI;
+ case 2: case 35: case 36: {
+ enc = DK4_FILE_ENCODING_WIN1252;
back = 1;
} break;
case 3: case 4: {
diff --git a/support/dktools/dk4enc.h b/support/dktools/dk4enc.h
index cdeba4e9a1..2c091f7cec 100644
--- a/support/dktools/dk4enc.h
+++ b/support/dktools/dk4enc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4enc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4enc.ctr
*/
#ifndef DK4ENC_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -63,13 +53,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** Encodings for text files.
*/
enum {
- /** ASCII character set.
+ /** Bytes 0x00 to 0xff represent
+ U+0000 to U+00FF.
+ Formerly misleading named "ASCII".
*/
- DK4_FILE_ENCODING_ASCII = 0,
+ DK4_FILE_ENCODING_PLAIN = 0,
- /** ANSII encoding (used ie on Windows).
+ /** Encoding used in Windows GUI programs.
*/
- DK4_FILE_ENCODING_ANSI ,
+ DK4_FILE_ENCODING_WIN1252 ,
/** UTF-8 encoding used on Linux and Unix.
*/
@@ -94,19 +86,19 @@ enum {
significant byte first.
*/
DK4_FILE_ENCODING_32_BE
+
};
/** Encoding for characters in memory.
*/
enum {
- /** ASCII character set (0 to 255) in
- ISO-LATIN-8859-1.
+ /** Bytes 0x00 to 0xFF represent U+0000 to U+00FF.
*/
- DK4_ENCODING_ASCII = DK4_FILE_ENCODING_ASCII,
+ DK4_ENCODING_PLAIN = DK4_FILE_ENCODING_PLAIN,
- /** ANSII encoding (used ie on Windows).
+ /** Encoding used by Windows GUI programs.
*/
- DK4_ENCODING_ANSI = DK4_FILE_ENCODING_ANSI,
+ DK4_ENCODING_WIN1252 = DK4_FILE_ENCODING_WIN1252,
/** UTF-8 encoding used on Linux and Unix.
*/
@@ -116,7 +108,7 @@ enum {
/** UTF-16 encoding.
*/
- DK4_ENCODING_UTF16 = DK4_FILE_ENCODING_UTF16_BE,
+ DK4_ENCODING_UTF16 = DK4_FILE_ENCODING_UTF16_BE ,
/** 32-bit unicode characters.
*/
@@ -126,13 +118,14 @@ enum {
/** UTF-16 encoding.
*/
- DK4_ENCODING_UTF16 = DK4_FILE_ENCODING_UTF16_LE,
+ DK4_ENCODING_UTF16 = DK4_FILE_ENCODING_UTF16_LE ,
/** 32-bit unicode characters.
*/
DK4_ENCODING_32 = DK4_FILE_ENCODING_32_LE
#endif
+
};
diff --git a/support/dktools/dk4error.c b/support/dktools/dk4error.c
index e1620fa49b..e6d16de132 100644
--- a/support/dktools/dk4error.c
+++ b/support/dktools/dk4error.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4error.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4error.ctr
*/
/** @file dk4error.c The dk4error module.
*/
-#line 514 "dk4error.ctr"
+#line 533 "dk4error.ctr"
#include "dk4conf.h"
@@ -63,7 +41,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 538 "dk4error.ctr"
+#line 557 "dk4error.ctr"
@@ -72,7 +50,7 @@ dk4error_init(dk4_er_t *erp)
{
-#line 545 "dk4error.ctr"
+#line 564 "dk4error.ctr"
if (NULL != erp) {
#if DK4_ON_WINDOWS
/* +++ Windows */
@@ -104,7 +82,7 @@ dk4error_init(dk4_er_t *erp)
}
-#line 575 "dk4error.ctr"
+#line 594 "dk4error.ctr"
}
@@ -175,16 +153,16 @@ dk4error_set_with_position(
erp->ec = ec;
-#line 644 "dk4error.ctr"
+#line 663 "dk4error.ctr"
-#line 645 "dk4error.ctr"
+#line 664 "dk4error.ctr"
-#line 646 "dk4error.ctr"
+#line 665 "dk4error.ctr"
-#line 647 "dk4error.ctr"
+#line 666 "dk4error.ctr"
(erp->dt).fpos.byteno = byteno;
(erp->dt).fpos.lineno = lineno;
(erp->dt).fpos.charno = charno;
diff --git a/support/dktools/dk4error.ctr b/support/dktools/dk4error.ctr
index d717a0fb6c..9788058ade 100644
--- a/support/dktools/dk4error.ctr
+++ b/support/dktools/dk4error.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -28,18 +28,32 @@ license = bsd
At the end of the code section, check the error code in the
dk4_er_t structure.
-
The address of one dk4_er_t can be passed to several function
calls. Only the first error occured is noted in the structure,
it is not overwritten by later errors.
+
+ The final number used by DK tools and libraries is
+ DK4_E_HIGHEST_NUMBER.
+
+ In your applications you can define additional error codes
+ starting at (DK4_E_HIGHEST_NUMBER+1).
+
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
@@ -47,7 +61,7 @@ license = bsd
/** Error report.
*/
typedef struct {
- /** Details.
+ /** Details, depending on error code.
*/
union {
/** Position within a file or data stream.
@@ -64,8 +78,8 @@ typedef struct {
size_t elsize; /**< Element size. */
size_t nelem; /**< Number of elements. */
} mem;
- int iDetails1; /**< Integer details. */
- long lDetails1; /**< Long details. */
+ long lDetails1; /**< Long details, i.e. from GetLastError(). */
+ int iDetails1; /**< Integer details, i.e. from errno. */
} dt;
int ec; /**< Error code. */
} dk4_er_t;
@@ -506,6 +520,11 @@ enum {
in iDetails1.
*/
DK4_E_SOCKET_INET_PTON ,
+
+ /** Maximum error number defined in dk4error
+ module.
+ */
+ DK4_E_HIGHEST_NUMBER = DK4_E_SOCKET_INET_PTON
};
diff --git a/support/dktools/dk4error.h b/support/dktools/dk4error.h
index cb64f2ab04..b6593f663e 100644
--- a/support/dktools/dk4error.h
+++ b/support/dktools/dk4error.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4error.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4error.ctr
*/
#ifndef DK4ERROR_H_INCLUDED
@@ -61,18 +39,32 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
At the end of the code section, check the error code in the
dk4_er_t structure.
-
The address of one dk4_er_t can be passed to several function
calls. Only the first error occured is noted in the structure,
it is not overwritten by later errors.
+
+ The final number used by DK tools and libraries is
+ DK4_E_HIGHEST_NUMBER.
+
+ In your applications you can define additional error codes
+ starting at (DK4_E_HIGHEST_NUMBER+1).
+
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
@@ -80,7 +72,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** Error report.
*/
typedef struct {
- /** Details.
+ /** Details, depending on error code.
*/
union {
/** Position within a file or data stream.
@@ -97,8 +89,8 @@ typedef struct {
size_t elsize; /**< Element size. */
size_t nelem; /**< Number of elements. */
} mem;
- int iDetails1; /**< Integer details. */
- long lDetails1; /**< Long details. */
+ long lDetails1; /**< Long details, i.e. from GetLastError(). */
+ int iDetails1; /**< Integer details, i.e. from errno. */
} dt;
int ec; /**< Error code. */
} dk4_er_t;
@@ -539,6 +531,11 @@ enum {
in iDetails1.
*/
DK4_E_SOCKET_INET_PTON ,
+
+ /** Maximum error number defined in dk4error
+ module.
+ */
+ DK4_E_HIGHEST_NUMBER = DK4_E_SOCKET_INET_PTON
};
diff --git a/support/dktools/dk4exep.c b/support/dktools/dk4exep.c
index 32293f0d85..791214e375 100644
--- a/support/dktools/dk4exep.c
+++ b/support/dktools/dk4exep.c
@@ -1,4 +1,9 @@
/*
+Copyright 2014-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
@@ -6,7 +11,7 @@
*/
/*
-Copyright (C) 2014, Dirk Krause
+Copyright (C) 2014-2020, Dirk Krause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
diff --git a/support/dktools/dk4exep8.c b/support/dktools/dk4exep8.c
index e4368a621d..506205ac74 100644
--- a/support/dktools/dk4exep8.c
+++ b/support/dktools/dk4exep8.c
@@ -1,45 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4exep8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4exep8.ctr
*/
/** @file dk4exep8.c The dk4exep8 module.
*/
-#line 57 "dk4exep8.ctr"
+#line 69 "dk4exep8.ctr"
+
+#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4EXEP8_H_INCLUDED
#include "dk4exep8.h"
+#endif
#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
@@ -69,6 +55,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mpl.h"
#endif
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
#if DK4_ON_WINDOWS
#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
@@ -120,11 +110,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 142 "dk4exep8.ctr"
+#line 172 "dk4exep8.ctr"
@@ -164,6 +160,11 @@ dk4execpath_c8_inspect_path(
int back = 0;
int cc = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != argv0);
+#endif
envpath = getenv(dk4execpath_c8_kw[0]);
if (NULL != envpath) {
mycopy = dk4str8_dup(envpath, erp);
@@ -181,7 +182,7 @@ dk4execpath_c8_inspect_path(
}
} else {
-#line 197 "dk4exep8.ctr"
+#line 232 "dk4exep8.ctr"
}
} else {
cc = 0;
@@ -216,12 +217,22 @@ static const char * const dk4exep8_kw[] = {
#endif
-#if DK4_ON_WINDOWS
-#pragma warning (disable:4100)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4100 )
#endif
int
-dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
+dk4execpath_c8(
+ char *buffer,
+ size_t sz,
+#if DK4_ON_WINDOWS
+ const char * DK4_ARG_UNUSED(argv0),
+#else
+ const char *argv0,
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD res;
@@ -239,9 +250,16 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
#endif
#endif
int back = 0;
+#if DK4_ON_WINDOWS
+ DK4_UNUSED_ARG(argv0)
+#endif
-#line 255 "dk4exep8.ctr"
+#line 303 "dk4exep8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
#if DK4_ON_WINDOWS
if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)sz) {
@@ -265,7 +283,7 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
#if DK4_HAVE_GETEXECNAME
-#line 277 "dk4exep8.ctr"
+#line 329 "dk4exep8.ctr"
#if 0
/* Prototype is const char *getexecname(void);
@@ -273,7 +291,7 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
if (0 == getexecname(buffer, sz)) {
back = 1;
-#line 283 "dk4exep8.ctr"
+#line 335 "dk4exep8.ctr"
}
#endif
@@ -310,41 +328,41 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
#if DK4_HAVE_PROC_PID_EXE
if (0 == back) {
-#line 318 "dk4exep8.ctr"
+#line 370 "dk4exep8.ctr"
res = dk4ma_write_c8_decimal_unsigned(
numbuf, sizeof(numbuf), (dk4_um_t)getpid(), 0, NULL
);
if (0 != res) {
-#line 322 "dk4exep8.ctr"
+#line 374 "dk4exep8.ctr"
if (0 != dk4str8_cpy_s(fnbuf, sizeof(fnbuf), dk4exep8_kw[0], NULL)) {
-#line 324 "dk4exep8.ctr"
+#line 376 "dk4exep8.ctr"
if (0 != dk4str8_cat_s(fnbuf, sizeof(fnbuf), numbuf, NULL)) {
-#line 326 "dk4exep8.ctr"
+#line 378 "dk4exep8.ctr"
if (0 != dk4str8_cat_s(fnbuf,sizeof(fnbuf),dk4exep8_kw[1],NULL)) {
-#line 328 "dk4exep8.ctr"
+#line 380 "dk4exep8.ctr"
rlres = readlink(fnbuf, buffer, sz);
-#line 330 "dk4exep8.ctr"
+#line 382 "dk4exep8.ctr"
if (0 < rlres) {
-#line 331 "dk4exep8.ctr"
- if (rlres < sz) {
+#line 383 "dk4exep8.ctr"
+ if ((size_t)rlres < sz) {
-#line 332 "dk4exep8.ctr"
+#line 384 "dk4exep8.ctr"
buffer[rlres] = '\0';
-#line 333 "dk4exep8.ctr"
+#line 385 "dk4exep8.ctr"
back = 1;
-#line 334 "dk4exep8.ctr"
+#line 386 "dk4exep8.ctr"
}
}
}
@@ -355,12 +373,12 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
#endif
if (0 == back) {
-#line 343 "dk4exep8.ctr"
+#line 395 "dk4exep8.ctr"
if (NULL != argv0) {
back = dk4execpath_c8_inspect_path(buffer, sz, argv0, erp);
if (0 != back) {
-#line 346 "dk4exep8.ctr"
+#line 398 "dk4exep8.ctr"
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
@@ -371,11 +389,12 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 355 "dk4exep8.ctr"
+#line 407 "dk4exep8.ctr"
return back;
}
-#if DK4_ON_WINDOWS
-#pragma warning (default:4100)
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
#endif
diff --git a/support/dktools/dk4exep8.ctr b/support/dktools/dk4exep8.ctr
index 067e0c1e1a..7b1b70a0ff 100644
--- a/support/dktools/dk4exep8.ctr
+++ b/support/dktools/dk4exep8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -55,7 +67,15 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4EXEP8_H_INCLUDED
#include "dk4exep8.h"
+#endif
#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
@@ -85,6 +105,10 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp);
#include "dk4mpl.h"
#endif
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
#if DK4_ON_WINDOWS
#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
@@ -136,6 +160,12 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -178,6 +208,11 @@ dk4execpath_c8_inspect_path(
int back = 0;
int cc = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != argv0);
+#endif
envpath = getenv(dk4execpath_c8_kw[0]);
if (NULL != envpath) {
mycopy = dk4str8_dup(envpath, erp);
@@ -228,12 +263,22 @@ static const char * const dk4exep8_kw[] = {
#endif
-#if DK4_ON_WINDOWS
-#pragma warning (disable:4100)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4100 )
#endif
int
-dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
+dk4execpath_c8(
+ char *buffer,
+ size_t sz,
+#if DK4_ON_WINDOWS
+ const char * DK4_ARG_UNUSED(argv0),
+#else
+ const char *argv0,
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD res;
@@ -251,7 +296,14 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
#endif
#endif
int back = 0;
+#if DK4_ON_WINDOWS
+ DK4_UNUSED_ARG(argv0)
+#endif
$? "+ dk4execpath_c8"
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
#if DK4_ON_WINDOWS
if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)sz) {
@@ -328,7 +380,7 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
rlres = readlink(fnbuf, buffer, sz);
$? ". readlink -> %d", (int)rlres
if (0 < rlres) { $? ". readlink ok"
- if (rlres < sz) { $? ". path size ok"
+ if ((size_t)rlres < sz) { $? ". path size ok"
buffer[rlres] = '\0'; $? ". ok /proc/pid/exe"
back = 1; $? ". file \"%!8s\"", buffer
}
@@ -355,7 +407,8 @@ dk4execpath_c8(char *buffer, size_t sz, const char *argv0, dk4_er_t *erp)
return back;
}
-#if DK4_ON_WINDOWS
-#pragma warning (default:4100)
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
#endif
diff --git a/support/dktools/dk4exep8.h b/support/dktools/dk4exep8.h
index d5cb72c395..9ec4c5651d 100644
--- a/support/dktools/dk4exep8.h
+++ b/support/dktools/dk4exep8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4exep8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4exep8.ctr
*/
#ifndef DK4EXEP8_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4exepd.c b/support/dktools/dk4exepd.c
index 72d35e801e..edfe83601a 100644
--- a/support/dktools/dk4exepd.c
+++ b/support/dktools/dk4exepd.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4exepd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4exepd.ctr
*/
/** @file dk4exepd.c The dk4exepd module.
*/
-#line 48 "dk4exepd.ctr"
+#line 60 "dk4exepd.ctr"
+#include "dk4conf.h"
#include "dk4exepd.h"
#if DK4_CHAR_SIZE > 1
#include "dk4exepw.h"
@@ -46,9 +25,23 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4exep8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
int
dk4execpath(dkChar *buffer, size_t sz, const dkChar *argv0, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != argv0);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4execpath_wc(buffer, sz, argv0, erp));
#else
diff --git a/support/dktools/dk4exepd.ctr b/support/dktools/dk4exepd.ctr
index 793df856b6..6c7d665f91 100644
--- a/support/dktools/dk4exepd.ctr
+++ b/support/dktools/dk4exepd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -46,6 +58,7 @@ dk4execpath(dkChar *buffer, size_t sz, const dkChar *argv0, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4exepd.h"
#if DK4_CHAR_SIZE > 1
#include "dk4exepw.h"
@@ -53,9 +66,23 @@ dk4execpath(dkChar *buffer, size_t sz, const dkChar *argv0, dk4_er_t *erp);
#include "dk4exep8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
int
dk4execpath(dkChar *buffer, size_t sz, const dkChar *argv0, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != argv0);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4execpath_wc(buffer, sz, argv0, erp));
#else
diff --git a/support/dktools/dk4exepd.h b/support/dktools/dk4exepd.h
index d2edac04e6..088f7f7318 100644
--- a/support/dktools/dk4exepd.h
+++ b/support/dktools/dk4exepd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4exepd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4exepd.ctr
*/
#ifndef DK4EXEPD_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4exepw.c b/support/dktools/dk4exepw.c
index 9d73eac997..837e2fcf77 100644
--- a/support/dktools/dk4exepw.c
+++ b/support/dktools/dk4exepw.c
@@ -1,45 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4exepw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4exepw.ctr
*/
/** @file dk4exepw.c The dk4exepw module.
*/
-#line 54 "dk4exepw.ctr"
+#line 66 "dk4exepw.ctr"
+
+#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4EXEPW_H_INCLUDED
#include "dk4exepw.h"
+#endif
#ifndef DK4STRW_H_INCLUDED
#include "dk4strw.h"
@@ -105,11 +91,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 124 "dk4exepw.ctr"
+#line 152 "dk4exepw.ctr"
@@ -127,12 +121,24 @@ NULL
-#if DK4_ON_WINDOWS
-#pragma warning (disable:4100)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4100 )
#endif
int
-dk4execpath_wc(wchar_t *buffer, size_t sz, const wchar_t *argv0, dk4_er_t *erp)
+dk4execpath_wc(
+#if DK4_ON_WINDOWS
+ wchar_t *buffer,
+ size_t sz,
+ const wchar_t * DK4_ARG_UNUSED(argv0),
+#else
+ wchar_t * DK4_ARG_UNUSED(buffer),
+ size_t DK4_ARG_UNUSED(sz),
+ const wchar_t * DK4_ARG_UNUSED(argv0),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD res;
@@ -140,9 +146,14 @@ dk4execpath_wc(wchar_t *buffer, size_t sz, const wchar_t *argv0, dk4_er_t *erp)
#endif
int back = 0;
#if DK4_ON_WINDOWS
+ DK4_UNUSED_ARG(argv0)
-#line 155 "dk4exepw.ctr"
+#line 196 "dk4exepw.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)sz) {
dwsz = (DWORD)sz;
@@ -154,37 +165,41 @@ dk4execpath_wc(wchar_t *buffer, size_t sz, const wchar_t *argv0, dk4_er_t *erp)
if ((dk4_um_t)res < (dk4_um_t)sz) {
back = 1;
-#line 165 "dk4exepw.ctr"
+#line 210 "dk4exepw.ctr"
buffer[res] = L'\0';
} else {
-#line 167 "dk4exepw.ctr"
+#line 212 "dk4exepw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 170 "dk4exepw.ctr"
+#line 215 "dk4exepw.ctr"
/* ERROR: Not found */
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
} else {
-#line 174 "dk4exepw.ctr"
+#line 219 "dk4exepw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
#else
-#line 178 "dk4exepw.ctr"
+#line 223 "dk4exepw.ctr"
+ DK4_UNUSED_ARG(buffer)
+ DK4_UNUSED_ARG(sz)
+ DK4_UNUSED_ARG(argv0)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
-#line 181 "dk4exepw.ctr"
+#line 229 "dk4exepw.ctr"
return back;
}
-#if DK4_ON_WINDOWS
-#pragma warning (default:4100)
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
#endif
diff --git a/support/dktools/dk4exepw.ctr b/support/dktools/dk4exepw.ctr
index fab30cc3ca..3ba06aec04 100644
--- a/support/dktools/dk4exepw.ctr
+++ b/support/dktools/dk4exepw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
@@ -52,7 +64,15 @@ dk4execpath_wc(wchar_t *buffer, size_t sz, const wchar_t *argv0, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4EXEPW_H_INCLUDED
#include "dk4exepw.h"
+#endif
#ifndef DK4STRW_H_INCLUDED
#include "dk4strw.h"
@@ -118,6 +138,14 @@ dk4execpath_wc(wchar_t *buffer, size_t sz, const wchar_t *argv0, dk4_er_t *erp);
#endif
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -138,12 +166,24 @@ NULL
-#if DK4_ON_WINDOWS
-#pragma warning (disable:4100)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4100 )
#endif
int
-dk4execpath_wc(wchar_t *buffer, size_t sz, const wchar_t *argv0, dk4_er_t *erp)
+dk4execpath_wc(
+#if DK4_ON_WINDOWS
+ wchar_t *buffer,
+ size_t sz,
+ const wchar_t * DK4_ARG_UNUSED(argv0),
+#else
+ wchar_t * DK4_ARG_UNUSED(buffer),
+ size_t DK4_ARG_UNUSED(sz),
+ const wchar_t * DK4_ARG_UNUSED(argv0),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD res;
@@ -151,7 +191,12 @@ dk4execpath_wc(wchar_t *buffer, size_t sz, const wchar_t *argv0, dk4_er_t *erp)
#endif
int back = 0;
#if DK4_ON_WINDOWS
+ DK4_UNUSED_ARG(argv0)
$? "+ dk4execpath_wc"
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)sz) {
dwsz = (DWORD)sz;
@@ -175,13 +220,17 @@ dk4execpath_wc(wchar_t *buffer, size_t sz, const wchar_t *argv0, dk4_er_t *erp)
}
#else
$? "! not supported"
+ DK4_UNUSED_ARG(buffer)
+ DK4_UNUSED_ARG(sz)
+ DK4_UNUSED_ARG(argv0)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
$? "- dk4execpath_wc %d", back
return back;
}
-#if DK4_ON_WINDOWS
-#pragma warning (default:4100)
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
#endif
diff --git a/support/dktools/dk4exepw.h b/support/dktools/dk4exepw.h
index 8f6848c03b..755584f56f 100644
--- a/support/dktools/dk4exepw.h
+++ b/support/dktools/dk4exepw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4exepw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4exepw.ctr
*/
#ifndef DK4EXEPW_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
diff --git a/support/dktools/dk4fd.c b/support/dktools/dk4fd.c
index 8e3d168fb8..34cb618394 100644
--- a/support/dktools/dk4fd.c
+++ b/support/dktools/dk4fd.c
@@ -1,45 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fd.ctr
*/
/** @file dk4fd.c The dk4fd module.
*/
-#line 260 "dk4fd.ctr"
-
+#line 272 "dk4fd.ctr"
+#include "dk4conf.h"
#include "dk4fd.h"
#if DK4_HAVE_ERRNO_H
@@ -63,10 +41,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 287 "dk4fd.ctr"
+#line 308 "dk4fd.ctr"
@@ -74,9 +61,12 @@ int
dk4fd_c8_open(const char *path, int flags, dk4_er_t *erp)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
-#if _MSC_VER >= 1700
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700)
int res;
if (0 != (res = _sopen_s(&back,path,flags,_SH_DENYNO,(_S_IREAD|_S_IWRITE))))
{
@@ -109,12 +99,23 @@ dk4fd_c8_open(const char *path, int flags, dk4_er_t *erp)
int
-dk4fd_wc_open(const wchar_t *path, int flags, dk4_er_t *erp)
+dk4fd_wc_open(
+ const wchar_t *path,
+#if DK4_ON_WINDOWS
+ int flags,
+#else
+ int DK4_ARG_UNUSED(flags),
+#endif
+ dk4_er_t *erp
+)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
-#if _MSC_VER >= 1700
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700)
int res;
if (0 != (res=_wsopen_s(&back,path,flags,_SH_DENYNO,(_S_IREAD|_S_IWRITE))))
{
@@ -132,6 +133,7 @@ dk4fd_wc_open(const wchar_t *path, int flags, dk4_er_t *erp)
}
#endif
#else
+ DK4_UNUSED_ARG(flags)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
} else {
@@ -145,6 +147,9 @@ dk4fd_wc_open(const wchar_t *path, int flags, dk4_er_t *erp)
int
dk4fd_open(const dkChar *path, int flags, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fd_wc_open(path, flags, erp));
#else
@@ -194,6 +199,10 @@ dk4fd_write(int fd, const void *buffer, size_t sz, dk4_er_t *erp)
#if DK4_ON_WINDOWS
int back = 0;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
if ((dk4_um_t)INT_MAX >= (dk4_um_t)sz) {
errno = 0;
@@ -217,6 +226,10 @@ dk4fd_write(int fd, const void *buffer, size_t sz, dk4_er_t *erp)
#else
ssize_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
if ((dk4_um_t)SSIZE_MAX >= (dk4_um_t)sz) {
errno = 0;
@@ -248,6 +261,11 @@ dk4fd_read(int fd, void *buffer, size_t *psz, dk4_er_t *erp)
#if DK4_ON_WINDOWS
int res = 0; /* Result from read operation */
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(NULL != psz);
+ assert(0 < *psz);
+#endif
if ((NULL != buffer) && (NULL != psz)) {
if (0 < *psz) {
if ((dk4_um_t)INT_MAX >= (dk4_um_t)(*psz)) {
@@ -279,6 +297,11 @@ dk4fd_read(int fd, void *buffer, size_t *psz, dk4_er_t *erp)
#else
int back = 0;
ssize_t res;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(NULL != psz);
+ assert(0 < *psz);
+#endif
if ((NULL != buffer) && (NULL != psz)) {
if (0 < *psz) {
if ((dk4_um_t)SSIZE_MAX >= (dk4_um_t)(*psz)) {
diff --git a/support/dktools/dk4fd.ctr b/support/dktools/dk4fd.ctr
index 1ba43ae7bb..24e1ee2926 100644
--- a/support/dktools/dk4fd.ctr
+++ b/support/dktools/dk4fd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -17,15 +17,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_SYS_TYPES_H
@@ -258,7 +270,7 @@ dk4fd_read(int fd, void *buffer, size_t *psz, dk4_er_t *erp);
%% module
-
+#include "dk4conf.h"
#include "dk4fd.h"
#if DK4_HAVE_ERRNO_H
@@ -282,6 +294,15 @@ dk4fd_read(int fd, void *buffer, size_t *psz, dk4_er_t *erp);
#endif
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -291,9 +312,12 @@ int
dk4fd_c8_open(const char *path, int flags, dk4_er_t *erp)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
-#if _MSC_VER >= 1700
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700)
int res;
if (0 != (res = _sopen_s(&back,path,flags,_SH_DENYNO,(_S_IREAD|_S_IWRITE))))
{
@@ -326,12 +350,23 @@ dk4fd_c8_open(const char *path, int flags, dk4_er_t *erp)
int
-dk4fd_wc_open(const wchar_t *path, int flags, dk4_er_t *erp)
+dk4fd_wc_open(
+ const wchar_t *path,
+#if DK4_ON_WINDOWS
+ int flags,
+#else
+ int DK4_ARG_UNUSED(flags),
+#endif
+ dk4_er_t *erp
+)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
-#if _MSC_VER >= 1700
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700)
int res;
if (0 != (res=_wsopen_s(&back,path,flags,_SH_DENYNO,(_S_IREAD|_S_IWRITE))))
{
@@ -349,6 +384,7 @@ dk4fd_wc_open(const wchar_t *path, int flags, dk4_er_t *erp)
}
#endif
#else
+ DK4_UNUSED_ARG(flags)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
} else {
@@ -362,6 +398,9 @@ dk4fd_wc_open(const wchar_t *path, int flags, dk4_er_t *erp)
int
dk4fd_open(const dkChar *path, int flags, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fd_wc_open(path, flags, erp));
#else
@@ -411,6 +450,10 @@ dk4fd_write(int fd, const void *buffer, size_t sz, dk4_er_t *erp)
#if DK4_ON_WINDOWS
int back = 0;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
if ((dk4_um_t)INT_MAX >= (dk4_um_t)sz) {
errno = 0;
@@ -434,6 +477,10 @@ dk4fd_write(int fd, const void *buffer, size_t sz, dk4_er_t *erp)
#else
ssize_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
if ((dk4_um_t)SSIZE_MAX >= (dk4_um_t)sz) {
errno = 0;
@@ -465,6 +512,11 @@ dk4fd_read(int fd, void *buffer, size_t *psz, dk4_er_t *erp)
#if DK4_ON_WINDOWS
int res = 0; /* Result from read operation */
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(NULL != psz);
+ assert(0 < *psz);
+#endif
if ((NULL != buffer) && (NULL != psz)) {
if (0 < *psz) {
if ((dk4_um_t)INT_MAX >= (dk4_um_t)(*psz)) {
@@ -496,6 +548,11 @@ dk4fd_read(int fd, void *buffer, size_t *psz, dk4_er_t *erp)
#else
int back = 0;
ssize_t res;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(NULL != psz);
+ assert(0 < *psz);
+#endif
if ((NULL != buffer) && (NULL != psz)) {
if (0 < *psz) {
if ((dk4_um_t)SSIZE_MAX >= (dk4_um_t)(*psz)) {
diff --git a/support/dktools/dk4fd.h b/support/dktools/dk4fd.h
index 8706d7de3e..6c29a3673b 100644
--- a/support/dktools/dk4fd.h
+++ b/support/dktools/dk4fd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fd.ctr
*/
#ifndef DK4FD_H_INCLUDED
@@ -49,15 +27,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_SYS_TYPES_H
diff --git a/support/dktools/dk4fdrda.c b/support/dktools/dk4fdrda.c
index 22d636488a..f8f17c6c27 100644
--- a/support/dktools/dk4fdrda.c
+++ b/support/dktools/dk4fdrda.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fdrda.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fdrda.ctr
*/
/** @file dk4fdrda.c The dk4fdrda module.
*/
-#line 40 "dk4fdrda.ctr"
+#line 55 "dk4fdrda.ctr"
+#include "dk4conf.h"
#include "dk4fdrda.h"
#include "dk4fdrde.h"
@@ -67,7 +46,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 68 "dk4fdrda.ctr"
+#line 84 "dk4fdrda.ctr"
@@ -99,7 +78,7 @@ dk4fd_read_app(
-#line 98 "dk4fdrda.ctr"
+#line 114 "dk4fdrda.ctr"
if ((-1 != fd) && (NULL != buffer) && (NULL != psz)) {
if (0 < *psz) {
if ((dk4_um_t)RW_MAX >= (dk4_um_t)(*psz)) {
@@ -112,31 +91,31 @@ dk4fd_read_app(
if (0 <= res) {
if (0 < res) {
-#line 109 "dk4fdrda.ctr"
+#line 125 "dk4fdrda.ctr"
back = 1;
*psz = (size_t)res;
} else {
-#line 112 "dk4fdrda.ctr"
+#line 128 "dk4fdrda.ctr"
back = 1;
*psz = (size_t)0;
}
} else {
-#line 116 "dk4fdrda.ctr"
+#line 132 "dk4fdrda.ctr"
dk4fd_read_error_msg(app, fn, errno);
}
}
} else {
-#line 120 "dk4fdrda.ctr"
+#line 136 "dk4fdrda.ctr"
}
} else {
-#line 122 "dk4fdrda.ctr"
+#line 138 "dk4fdrda.ctr"
}
-#line 123 "dk4fdrda.ctr"
+#line 139 "dk4fdrda.ctr"
return back;
}
diff --git a/support/dktools/dk4fdrda.ctr b/support/dktools/dk4fdrda.ctr
index 3395cbd1bf..0186c692bb 100644
--- a/support/dktools/dk4fdrda.ctr
+++ b/support/dktools/dk4fdrda.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,8 +10,23 @@ license = bsd
/** @file dk4fdrda.h Read from file descriptor.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
#ifdef __cplusplus
extern "C" {
@@ -38,6 +53,7 @@ dk4fd_read_app(
%% module
+#include "dk4conf.h"
#include "dk4fdrda.h"
#include "dk4fdrde.h"
diff --git a/support/dktools/dk4fdrda.h b/support/dktools/dk4fdrda.h
index 3bd61d3f48..f39478e7ff 100644
--- a/support/dktools/dk4fdrda.h
+++ b/support/dktools/dk4fdrda.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fdrda.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fdrda.ctr
*/
#ifndef DK4FDRDA_H_INCLUDED
@@ -43,8 +21,23 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4fdrda.h Read from file descriptor.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4fdrde.c b/support/dktools/dk4fdrde.c
index 05311e0b85..e79ef91e9f 100644
--- a/support/dktools/dk4fdrde.c
+++ b/support/dktools/dk4fdrde.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fdrde.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fdrde.ctr
*/
/** @file dk4fdrde.c The dk4fdrde module.
*/
-#line 34 "dk4fdrde.ctr"
+#line 48 "dk4fdrde.ctr"
+#include "dk4conf.h"
#include "dk4fdrde.h"
#include "dk4const.h"
#include "dk4mem.h"
@@ -56,7 +35,7 @@ dk4fd_read_error_msg(dk4_app_t *app, const dkChar *fn, int errc)
{
dkChar buf[64];
const dkChar *oldsourcefile = NULL;
- size_t oldsourceline = (dk4_um_t)0UL;
+ dk4_um_t oldsourceline = (dk4_um_t)0UL;
int res;
if (NULL != app) {
diff --git a/support/dktools/dk4fdrde.ctr b/support/dktools/dk4fdrde.ctr
index 07ab799070..90c82a8710 100644
--- a/support/dktools/dk4fdrde.ctr
+++ b/support/dktools/dk4fdrde.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,22 @@ license = bsd
/** @file dk4fdrde.h Error message for errors while reading.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -32,6 +46,7 @@ dk4fd_read_error_msg(dk4_app_t *app, const dkChar *fn, int errc);
%% module
+#include "dk4conf.h"
#include "dk4fdrde.h"
#include "dk4const.h"
#include "dk4mem.h"
@@ -49,7 +64,7 @@ dk4fd_read_error_msg(dk4_app_t *app, const dkChar *fn, int errc)
{
dkChar buf[64];
const dkChar *oldsourcefile = NULL;
- size_t oldsourceline = (dk4_um_t)0UL;
+ dk4_um_t oldsourceline = (dk4_um_t)0UL;
int res;
if (NULL != app) {
diff --git a/support/dktools/dk4fdrde.h b/support/dktools/dk4fdrde.h
index 07ec103472..4e6725d540 100644
--- a/support/dktools/dk4fdrde.h
+++ b/support/dktools/dk4fdrde.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fdrde.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fdrde.ctr
*/
#ifndef DK4FDRDE_H_INCLUDED
@@ -43,8 +21,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4fdrde.h Error message for errors while reading.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4fdwre.c b/support/dktools/dk4fdwre.c
index e846016c5e..60672e7051 100644
--- a/support/dktools/dk4fdwre.c
+++ b/support/dktools/dk4fdwre.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fdwre.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fdwre.ctr
*/
/** @file dk4fdwre.c The dk4fdwre module.
*/
-#line 36 "dk4fdwre.ctr"
+#line 50 "dk4fdwre.ctr"
+#include "dk4conf.h"
#include "dk4fdwre.h"
#include "dk4const.h"
#include "dk4mem.h"
@@ -54,7 +33,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 51 "dk4fdwre.ctr"
+#line 66 "dk4fdwre.ctr"
@@ -63,7 +42,7 @@ dk4fd_write_error_msg(dk4_app_t *app, const dkChar *fn, int errc)
{
dkChar buf[64];
const dkChar *oldsourcefile = NULL;
- size_t oldsourceline = (dk4_um_t)0UL;
+ dk4_um_t oldsourceline = (dk4_um_t)0UL;
int res;
if (NULL != app) {
diff --git a/support/dktools/dk4fdwre.ctr b/support/dktools/dk4fdwre.ctr
index 7a13390a59..cea583146c 100644
--- a/support/dktools/dk4fdwre.ctr
+++ b/support/dktools/dk4fdwre.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,22 @@ license = bsd
/** @file dk4fdwre.h Report errors for write operations.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -34,6 +48,7 @@ dk4fd_write_error_msg(dk4_app_t *app, const dkChar *fn, int errc);
%% module
+#include "dk4conf.h"
#include "dk4fdwre.h"
#include "dk4const.h"
#include "dk4mem.h"
@@ -56,7 +71,7 @@ dk4fd_write_error_msg(dk4_app_t *app, const dkChar *fn, int errc)
{
dkChar buf[64];
const dkChar *oldsourcefile = NULL;
- size_t oldsourceline = (dk4_um_t)0UL;
+ dk4_um_t oldsourceline = (dk4_um_t)0UL;
int res;
if (NULL != app) {
diff --git a/support/dktools/dk4fdwre.h b/support/dktools/dk4fdwre.h
index 17fc4354f5..cde108b374 100644
--- a/support/dktools/dk4fdwre.h
+++ b/support/dktools/dk4fdwre.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fdwre.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fdwre.ctr
*/
#ifndef DK4FDWRE_H_INCLUDED
@@ -43,8 +21,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4fdwre.h Report errors for write operations.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4file8.c b/support/dktools/dk4file8.c
index b40d457e16..2233b65c3c 100644
--- a/support/dktools/dk4file8.c
+++ b/support/dktools/dk4file8.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4file8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4file8.ctr
*/
/** @file dk4file8.c The dk4file8 module.
*/
-#line 91 "dk4file8.ctr"
+#line 103 "dk4file8.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -58,6 +36,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4file8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 132 "dk4file8.ctr"
+
int
@@ -72,6 +62,9 @@ dk4file_c8_exists(const char *fn, dk4_er_t *erp)
dk4_stat_t lstb;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
dwattr = GetFileAttributesA(fn);
@@ -116,7 +109,15 @@ dk4file_c8_is_regular(const char *fn, dk4_er_t *erp)
dk4_stat_t stb;
#endif
int back = 0;
- if (NULL != fn) {
+
+
+#line 195 "dk4file8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL != fn) {
+
+#line 199 "dk4file8.ctr"
#if DK4_ON_WINDOWS
dwattr = GetFileAttributesA(fn);
if (INVALID_FILE_ATTRIBUTES != dwattr) {
@@ -140,17 +141,37 @@ dk4file_c8_is_regular(const char *fn, dk4_er_t *erp)
}
}
#else
- if (0 != dk4stat_c8(&stb, fn, NULL)) {
- if (0 != dk4stat_is_regular(&stb, erp)) {
+
+
+#line 223 "dk4file8.ctr"
+ if (0 != dk4stat_c8(&stb, fn, NULL)) {
+
+#line 224 "dk4file8.ctr"
+ if (0 != dk4stat_is_regular(&stb, erp)) {
+
+#line 225 "dk4file8.ctr"
back = 1;
}
- } else {
+#if TRACE_DEBUG
+ else {
+
+#line 229 "dk4file8.ctr"
+ }
+#endif
+ } else {
+
+#line 232 "dk4file8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
#endif
- } else {
+ } else {
+
+#line 236 "dk4file8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 239 "dk4file8.ctr"
return back;
}
@@ -167,6 +188,12 @@ dk4file_c8_is_directory(const char *fn, dk4_er_t *erp)
dk4_stat_t stb;
#endif
int back = 0;
+
+
+#line 256 "dk4file8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
dwattr = GetFileAttributesA(fn);
@@ -199,6 +226,9 @@ dk4file_c8_is_directory(const char *fn, dk4_er_t *erp)
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 292 "dk4file8.ctr"
return back;
}
diff --git a/support/dktools/dk4file8.ctr b/support/dktools/dk4file8.ctr
index 1330ef6966..0ca720a67d 100644
--- a/support/dktools/dk4file8.ctr
+++ b/support/dktools/dk4file8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -108,6 +120,16 @@ dk4file_c8_is_directory(const char *fn, dk4_er_t *erp);
#include "dk4file8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
int
@@ -122,6 +144,9 @@ dk4file_c8_exists(const char *fn, dk4_er_t *erp)
dk4_stat_t lstb;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
dwattr = GetFileAttributesA(fn);
@@ -166,7 +191,11 @@ dk4file_c8_is_regular(const char *fn, dk4_er_t *erp)
dk4_stat_t stb;
#endif
int back = 0;
- if (NULL != fn) {
+ $? "+ dk4file_c8_is_regular \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if (NULL != fn) { $? ". fn ok"
#if DK4_ON_WINDOWS
dwattr = GetFileAttributesA(fn);
if (INVALID_FILE_ATTRIBUTES != dwattr) {
@@ -190,17 +219,23 @@ dk4file_c8_is_regular(const char *fn, dk4_er_t *erp)
}
}
#else
- if (0 != dk4stat_c8(&stb, fn, NULL)) {
- if (0 != dk4stat_is_regular(&stb, erp)) {
+ $? ". not windows"
+ if (0 != dk4stat_c8(&stb, fn, NULL)) { $? ". stat ok"
+ if (0 != dk4stat_is_regular(&stb, erp)) { $? ". regular"
back = 1;
}
- } else {
+#if TRACE_DEBUG
+ else { $? ". not regular"
+ }
+#endif
+ } else { $? "! stat failed"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
#endif
- } else {
+ } else { $? "! fn"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4file_c8_is_regular %d", back
return back;
}
@@ -217,6 +252,10 @@ dk4file_c8_is_directory(const char *fn, dk4_er_t *erp)
dk4_stat_t stb;
#endif
int back = 0;
+ $? "+ dk4file_c8_is_directory \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
#if DK4_ON_WINDOWS
dwattr = GetFileAttributesA(fn);
@@ -249,6 +288,7 @@ dk4file_c8_is_directory(const char *fn, dk4_er_t *erp)
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4file_c8_is_directory %d", back
return back;
}
diff --git a/support/dktools/dk4file8.h b/support/dktools/dk4file8.h
index 1be6335fdc..da32c95be5 100644
--- a/support/dktools/dk4file8.h
+++ b/support/dktools/dk4file8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4file8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4file8.ctr
*/
#ifndef DK4FILE8_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4filed.c b/support/dktools/dk4filed.c
index e9df3aca39..b0254fa4d8 100644
--- a/support/dktools/dk4filed.c
+++ b/support/dktools/dk4filed.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4filed.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4filed.ctr
*/
/** @file dk4filed.c The dk4filed module.
*/
-#line 92 "dk4filed.ctr"
+#line 104 "dk4filed.ctr"
+#include "dk4conf.h"
#include "dk4filed.h"
#if DK4_CHAR_SIZE > 1
@@ -47,11 +26,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4file8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 123 "dk4filed.ctr"
+
int
dk4file_exists(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4file_wc_exists(fn, erp));
#else
@@ -64,6 +58,9 @@ dk4file_exists(const dkChar *fn, dk4_er_t *erp)
int
dk4file_is_regular(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4file_wc_is_regular(fn, erp));
#else
@@ -76,6 +73,9 @@ dk4file_is_regular(const dkChar *fn, dk4_er_t *erp)
int
dk4file_is_directory(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4file_wc_is_directory(fn, erp));
#else
diff --git a/support/dktools/dk4filed.ctr b/support/dktools/dk4filed.ctr
index 7de2ffe466..a274dad2e4 100644
--- a/support/dktools/dk4filed.ctr
+++ b/support/dktools/dk4filed.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -90,6 +102,7 @@ dk4file_is_directory(const dkChar *fn, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4filed.h"
#if DK4_CHAR_SIZE > 1
@@ -98,11 +111,24 @@ dk4file_is_directory(const dkChar *fn, dk4_er_t *erp);
#include "dk4file8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
int
dk4file_exists(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4file_wc_exists(fn, erp));
#else
@@ -115,6 +141,9 @@ dk4file_exists(const dkChar *fn, dk4_er_t *erp)
int
dk4file_is_regular(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4file_wc_is_regular(fn, erp));
#else
@@ -127,6 +156,9 @@ dk4file_is_regular(const dkChar *fn, dk4_er_t *erp)
int
dk4file_is_directory(const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4file_wc_is_directory(fn, erp));
#else
diff --git a/support/dktools/dk4filed.h b/support/dktools/dk4filed.h
index 6f448e1519..7aebe9cd56 100644
--- a/support/dktools/dk4filed.h
+++ b/support/dktools/dk4filed.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4filed.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4filed.ctr
*/
#ifndef DK4FILED_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4filei.c b/support/dktools/dk4filei.c
index e6273c9239..801594a536 100644
--- a/support/dktools/dk4filei.c
+++ b/support/dktools/dk4filei.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4filei.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4filei.ctr
*/
/** @file dk4filei.c The dk4filei module.
*/
-#line 379 "dk4filei.ctr"
+#line 399 "dk4filei.ctr"
+#include "dk4conf.h"
#include "dk4filei.h"
#ifndef DK4MEM_H_INCLUDED
@@ -50,16 +29,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
-#line 393 "dk4filei.ctr"
+#line 424 "dk4filei.ctr"
void
dk4fileinfo_init(dk4_file_info_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
DK4_MEMRES(dptr, sizeof(dk4_file_info_t));
dptr->contents = 0;
@@ -72,6 +64,9 @@ int
dk4fileinfo_is_symlink(const dk4_file_info_t *dptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != (DK4_FILE_INFO_CONTENTS_DATA_LINK & (dptr->contents))) {
#if DK4_ON_WINDOWS
@@ -111,14 +106,18 @@ dk4fileinfo_copy_size(
int back = 0;
-#line 449 "dk4filei.ctr"
+#line 486 "dk4filei.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bhfi);
+#endif
dk4error_init(&er);
-#line 451 "dk4filei.ctr"
+#line 492 "dk4filei.ctr"
-#line 452 "dk4filei.ctr"
+#line 493 "dk4filei.ctr"
if ((DWORD)0UL != bhfi->nFileSizeHigh) {
val = dk4ma_um_add(
dk4ma_um_mul(
@@ -138,17 +137,17 @@ dk4fileinfo_copy_size(
}
if (DK4_E_NONE == er.ec) {
-#line 470 "dk4filei.ctr"
+#line 511 "dk4filei.ctr"
back = 1;
*dptr = val;
} else {
-#line 473 "dk4filei.ctr"
+#line 514 "dk4filei.ctr"
dk4error_copy(erp, &er);
}
-#line 476 "dk4filei.ctr"
+#line 517 "dk4filei.ctr"
return back;
}
#else
@@ -157,9 +156,14 @@ int
dk4fileinfo_copy_size(
dk4_um_t *dptr,
const dk4_stat_t *stb,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
+ DK4_UNUSED_ARG(erp)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != stb);
+#endif
*dptr = (dk4_um_t)(stb->st_size);
return 1;
}
@@ -178,53 +182,57 @@ dk4fileinfo_size(
int back = 0;
-#line 504 "dk4filei.ctr"
+#line 550 "dk4filei.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fi);
+#endif
if ((NULL != dptr) && (NULL != fi)) {
-#line 505 "dk4filei.ctr"
+#line 555 "dk4filei.ctr"
dk4error_init(&er);
switch (ch) {
case DK4_FILE_INFO_CONTENTS_DATA_LINK: {
-#line 509 "dk4filei.ctr"
+#line 559 "dk4filei.ctr"
if (0 != ((fi->contents) & DK4_FILE_INFO_CONTENTS_DATA_LINK)) {
#if DK4_ON_WINDOWS
-#line 512 "dk4filei.ctr"
+#line 562 "dk4filei.ctr"
back = dk4fileinfo_copy_size(dptr, &(fi->linfo), &er);
#else
-#line 515 "dk4filei.ctr"
+#line 565 "dk4filei.ctr"
back = dk4fileinfo_copy_size(dptr, &(fi->lstb), &er);
#endif
} else {
-#line 518 "dk4filei.ctr"
+#line 568 "dk4filei.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
} break;
default: {
-#line 523 "dk4filei.ctr"
+#line 573 "dk4filei.ctr"
if (0 != ((fi->contents) & DK4_FILE_INFO_CONTENTS_DATA_TARGET)) {
#if DK4_ON_WINDOWS
-#line 526 "dk4filei.ctr"
+#line 576 "dk4filei.ctr"
back = dk4fileinfo_copy_size(dptr, &(fi->tinfo), &er);
#else
-#line 529 "dk4filei.ctr"
+#line 579 "dk4filei.ctr"
back = dk4fileinfo_copy_size(dptr, &(fi->tstb), &er);
#endif
} else {
-#line 532 "dk4filei.ctr"
+#line 582 "dk4filei.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
} break;
@@ -236,7 +244,7 @@ dk4fileinfo_size(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 542 "dk4filei.ctr"
+#line 592 "dk4filei.ctr"
return back;
}
@@ -246,6 +254,9 @@ int
dk4fileinfo_exists_and_is_regular(const dk4_file_info_t *fi, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fi);
+#endif
if (NULL != fi) {
#if DK4_ON_WINDOWS
if (0 != (DK4_FILE_INFO_CONTENTS_DATA_LINK & (fi->contents))) {
diff --git a/support/dktools/dk4filei.ctr b/support/dktools/dk4filei.ctr
index f03a4b4735..f674447add 100644
--- a/support/dktools/dk4filei.ctr
+++ b/support/dktools/dk4filei.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,16 +11,36 @@ license = bsd
Functions for file information.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
#endif
#ifndef DK4UFI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufi.h"
+#else
+#include <dktools-4/dk4ufi.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -252,7 +272,7 @@ int
dk4fileinfo_type_attributes_c8(
char *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
);
@@ -274,7 +294,7 @@ int
dk4fileinfo_type_attributes_wc(
wchar_t *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
);
@@ -296,7 +316,7 @@ int
dk4fileinfo_type_attributes(
dkChar *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
);
@@ -377,6 +397,7 @@ dk4fileinfo_exists_and_is_regular(const dk4_file_info_t *fi, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4filei.h"
#ifndef DK4MEM_H_INCLUDED
@@ -388,6 +409,16 @@ dk4fileinfo_exists_and_is_regular(const dk4_file_info_t *fi, dk4_er_t *erp);
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
$!trace-include
@@ -396,6 +427,9 @@ $!trace-include
void
dk4fileinfo_init(dk4_file_info_t *dptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
DK4_MEMRES(dptr, sizeof(dk4_file_info_t));
dptr->contents = 0;
@@ -408,6 +442,9 @@ int
dk4fileinfo_is_symlink(const dk4_file_info_t *dptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if (0 != (DK4_FILE_INFO_CONTENTS_DATA_LINK & (dptr->contents))) {
#if DK4_ON_WINDOWS
@@ -446,9 +483,13 @@ dk4fileinfo_copy_size(
dk4_um_t val;
int back = 0;
$? "+ dk4fileinfo_copy_size"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != bhfi);
+#endif
dk4error_init(&er);
- $? ". high %lu", (unsigned long)(bhfi->nFileSizeHigh)
- $? ". low %lu", (unsigned long)(bhfi->nFileSizeLow)
+ $? ". high %lu", (0xFFFFFFFFUL & ((unsigned long)(bhfi->nFileSizeHigh)))
+ $? ". low %lu", (0xFFFFFFFFUL & ((unsigned long)(bhfi->nFileSizeLow)))
if ((DWORD)0UL != bhfi->nFileSizeHigh) {
val = dk4ma_um_add(
dk4ma_um_mul(
@@ -481,9 +522,14 @@ int
dk4fileinfo_copy_size(
dk4_um_t *dptr,
const dk4_stat_t *stb,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
+ DK4_UNUSED_ARG(erp)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != stb);
+#endif
*dptr = (dk4_um_t)(stb->st_size);
return 1;
}
@@ -501,6 +547,10 @@ dk4fileinfo_size(
dk4_er_t er;
int back = 0;
$? "+ dk4fileinfo_size"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fi);
+#endif
if ((NULL != dptr) && (NULL != fi)) { $? ". args ok"
dk4error_init(&er);
switch (ch) {
@@ -548,6 +598,9 @@ int
dk4fileinfo_exists_and_is_regular(const dk4_file_info_t *fi, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fi);
+#endif
if (NULL != fi) {
#if DK4_ON_WINDOWS
if (0 != (DK4_FILE_INFO_CONTENTS_DATA_LINK & (fi->contents))) {
diff --git a/support/dktools/dk4filei.h b/support/dktools/dk4filei.h
index 9437cc67c0..f88e0032e2 100644
--- a/support/dktools/dk4filei.h
+++ b/support/dktools/dk4filei.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4filei.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4filei.ctr
*/
#ifndef DK4FILEI_H_INCLUDED
@@ -44,16 +22,36 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Functions for file information.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
#endif
#ifndef DK4UFI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufi.h"
+#else
+#include <dktools-4/dk4ufi.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -285,7 +283,7 @@ int
dk4fileinfo_type_attributes_c8(
char *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
);
@@ -307,7 +305,7 @@ int
dk4fileinfo_type_attributes_wc(
wchar_t *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
);
@@ -329,7 +327,7 @@ int
dk4fileinfo_type_attributes(
dkChar *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
);
diff --git a/support/dktools/dk4filei8.c b/support/dktools/dk4filei8.c
index 5c1cccdd48..eab88ba0fb 100644
--- a/support/dktools/dk4filei8.c
+++ b/support/dktools/dk4filei8.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4filei8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4filei8.ctr
*/
/** @file dk4filei8.c The dk4filei8 module.
*/
-#line 10 "dk4filei8.ctr"
+#line 52 "dk4filei8.ctr"
+#include "dk4conf.h"
#include "dk4filei.h"
#ifndef DK4MEM_H_INCLUDED
@@ -53,6 +32,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4error.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4fileinfo_c8(dk4_file_info_t *dptr, const char *fn, dk4_er_t *erp)
@@ -67,6 +54,10 @@ dk4fileinfo_c8(dk4_file_info_t *dptr, const char *fn, dk4_er_t *erp)
int isdir;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dk4error_init(&er);
DK4_MEMRES(dptr, sizeof(dk4_file_info_t));
diff --git a/support/dktools/dk4filei8.ctr b/support/dktools/dk4filei8.ctr
index 4cb6c4a86b..b24e293d0e 100644
--- a/support/dktools/dk4filei8.ctr
+++ b/support/dktools/dk4filei8.ctr
@@ -1,13 +1,56 @@
%% options
-
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4filei8.h File information for files specified
+ by char path name.
+*/
+
+#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/** Retrieve full information for a path name.
+ For symbolic links attempt to retrieve information both
+ about the link and about the link target.
+ @param dptr Pointer to result structure.
+ @param fn File path name.
+ @param erp Error report, may be NULL.
+ @return 1 if information is found, 0 otherwise.
+ If information about the link is found and no information about
+ the target, the function returns 1 as we can recognize the
+ directory item as a dangling link (link with non-existing target).
+*/
+int
+dk4fileinfo_c8(dk4_file_info_t *dptr, const char *fn, dk4_er_t *erp);
+
+#ifdef __cplusplus
+}
+#endif
%% module
+#include "dk4conf.h"
#include "dk4filei.h"
#ifndef DK4MEM_H_INCLUDED
@@ -22,6 +65,14 @@ license = bsd
#include "dk4error.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4fileinfo_c8(dk4_file_info_t *dptr, const char *fn, dk4_er_t *erp)
@@ -36,6 +87,10 @@ dk4fileinfo_c8(dk4_file_info_t *dptr, const char *fn, dk4_er_t *erp)
int isdir;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dk4error_init(&er);
DK4_MEMRES(dptr, sizeof(dk4_file_info_t));
diff --git a/support/dktools/dk4filei8.h b/support/dktools/dk4filei8.h
index 89b738b838..8aa57edeb1 100644
--- a/support/dktools/dk4filei8.h
+++ b/support/dktools/dk4filei8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4filei8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4filei8.ctr
*/
#ifndef DK4FILEI8_H_INCLUDED
@@ -38,18 +16,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DK4FILEI8_H_INCLUDED 1
-#line 10 "dk4filei8.ctr"
+#line 7 "dk4filei8.ctr"
/** @file dk4filei8.h File information for files specified
by char path name.
*/
#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -75,4 +61,5 @@ dk4fileinfo_c8(dk4_file_info_t *dptr, const char *fn, dk4_er_t *erp);
#endif
+
#endif
diff --git a/support/dktools/dk4fileia.c b/support/dktools/dk4fileia.c
index d48617702d..9811a40d4b 100644
--- a/support/dktools/dk4fileia.c
+++ b/support/dktools/dk4fileia.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileia.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileia.ctr
*/
/** @file dk4fileia.c The dk4fileia module.
*/
-#line 59 "dk4fileia.ctr"
+#line 81 "dk4fileia.ctr"
#include "dk4conf.h"
#include "dk4const.h"
@@ -66,11 +44,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maodh.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 90 "dk4fileia.ctr"
+#line 118 "dk4fileia.ctr"
@@ -140,7 +124,7 @@ dk4fileinfo_report_stat_failed(dk4_app_t *app, const dkChar *path, int errc)
{
-#line 158 "dk4fileia.ctr"
+#line 186 "dk4fileia.ctr"
switch (errc) {
#ifdef EACCES
case EACCES : {
@@ -193,7 +177,7 @@ dk4fileinfo_report_stat_failed(dk4_app_t *app, const dkChar *path, int errc)
}
-#line 209 "dk4fileia.ctr"
+#line 237 "dk4fileia.ctr"
}
@@ -203,6 +187,10 @@ dk4fileinfo_app(dk4_file_info_t *dptr, const dkChar *fn, dk4_app_t *app)
{
dk4_er_t er;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dk4error_init(&er);
back = dk4fileinfo(dptr, fn, &er);
diff --git a/support/dktools/dk4fileia.ctr b/support/dktools/dk4fileia.ctr
index d796540986..eea588a0a6 100644
--- a/support/dktools/dk4fileia.ctr
+++ b/support/dktools/dk4fileia.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,30 @@ license = bsd
/** @file dk4fileia.h File information with application support.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -84,6 +106,12 @@ dk4fileinfo_report_win_failed(dk4_app_t *app, const dkChar *path, long errc);
#include "dk4maodh.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -215,6 +243,10 @@ dk4fileinfo_app(dk4_file_info_t *dptr, const dkChar *fn, dk4_app_t *app)
{
dk4_er_t er;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dk4error_init(&er);
back = dk4fileinfo(dptr, fn, &er);
diff --git a/support/dktools/dk4fileia.h b/support/dktools/dk4fileia.h
index bd38ea67db..34084a4710 100644
--- a/support/dktools/dk4fileia.h
+++ b/support/dktools/dk4fileia.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileia.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileia.ctr
*/
#ifndef DK4FILEIA_H_INCLUDED
@@ -43,8 +21,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4fileia.h File information with application support.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4fileid.c b/support/dktools/dk4fileid.c
index 5b4b785d7e..6872c4b36d 100644
--- a/support/dktools/dk4fileid.c
+++ b/support/dktools/dk4fileid.c
@@ -1,50 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileid.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileid.ctr
*/
/** @file dk4fileid.c The dk4fileid module.
*/
-#line 10 "dk4fileid.ctr"
+#line 56 "dk4fileid.ctr"
+#include "dk4conf.h"
#include "dk4filei.h"
-#if DK4_CHAR_SIZE > 1
-#include "dk4fileiw.h"
-#else
-#include "dk4filei8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
#endif
@@ -52,6 +32,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
int
dk4fileinfo(dk4_file_info_t *dptr, const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fileinfo_wc(dptr, fn, erp));
#else
diff --git a/support/dktools/dk4fileid.ctr b/support/dktools/dk4fileid.ctr
index 27aa6d3a07..34441a61b5 100644
--- a/support/dktools/dk4fileid.ctr
+++ b/support/dktools/dk4fileid.ctr
@@ -2,18 +2,66 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4fileid.h File information for files specified
+ by dkChar path name.
+*/
+
+#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve full information for a path name.
+ For symbolic links attempt to retrieve information both
+ about the link and about the link target.
+ @param dptr Pointer to result structure.
+ @param fn File path name.
+ @param erp Error report, may be NULL.
+ @return 1 if information is found, 0 otherwise.
+ If information about the link is found and no information about
+ the target, the function returns 1 as we can recognize the
+ directory item as a dangling link (link with non-existing target).
+*/
+int
+dk4fileinfo(dk4_file_info_t *dptr, const dkChar *fn, dk4_er_t *erp);
+
+#ifdef __cplusplus
+}
+#endif
+
%% module
+#include "dk4conf.h"
#include "dk4filei.h"
-#if DK4_CHAR_SIZE > 1
-#include "dk4fileiw.h"
-#else
-#include "dk4filei8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
#endif
@@ -21,6 +69,10 @@ license = bsd
int
dk4fileinfo(dk4_file_info_t *dptr, const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fileinfo_wc(dptr, fn, erp));
#else
diff --git a/support/dktools/dk4fileid.h b/support/dktools/dk4fileid.h
index 38d7372be2..5c33cbfe97 100644
--- a/support/dktools/dk4fileid.h
+++ b/support/dktools/dk4fileid.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileid.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileid.ctr
*/
#ifndef DK4FILEID_H_INCLUDED
@@ -38,18 +16,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DK4FILEID_H_INCLUDED 1
-#line 10 "dk4fileid.ctr"
+#line 9 "dk4fileid.ctr"
/** @file dk4fileid.h File information for files specified
by dkChar path name.
*/
#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
#endif
/** Retrieve full information for a path name.
@@ -67,14 +57,11 @@ int
dk4fileinfo(dk4_file_info_t *dptr, const dkChar *fn, dk4_er_t *erp);
#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
}
#endif
+
#endif
diff --git a/support/dktools/dk4fileig8.c b/support/dktools/dk4fileig8.c
index 3aca331727..2d2f297320 100644
--- a/support/dktools/dk4fileig8.c
+++ b/support/dktools/dk4fileig8.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileig8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileig8.ctr
*/
/** @file dk4fileig8.c The dk4fileig8 module.
*/
-#line 10 "dk4fileig8.ctr"
+#line 63 "dk4fileig8.ctr"
+#include "dk4conf.h"
#include "dk4filei.h"
#ifndef DK4TIME_H_INCLUDED
@@ -53,6 +32,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4time08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_TIME_WITH_SYS_TIME
#ifndef SYS_TIME_H_INCLUDED
#include <sys/time.h>
@@ -82,7 +68,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 53 "dk4fileig8.ctr"
+#line 114 "dk4fileig8.ctr"
@@ -101,6 +87,11 @@ dk4fileinfo_c8_filetime_timestamp(
SYSTEMTIME st;
SYSTEMTIME lt;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != timer);
+#endif
if (FileTimeToSystemTime(timer, &st)) {
if (SystemTimeToTzSpecificLocalTime(NULL, &st, &lt)) {
back = dk4time_to_text_c8(
@@ -129,6 +120,11 @@ dk4fileinfo_c8_win_timestamp(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != pbhfi);
+#endif
switch (chtime) {
case DK4_FILE_INFO_TIME_ACCESS: {
back = dk4fileinfo_c8_filetime_timestamp(
@@ -166,6 +162,11 @@ dk4fileinfo_c8_stat_time_timestamp(
#if DK4_HAVE_LOCALTIME_R
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != timer);
+#endif
if (NULL != localtime_r(timer, &lct)) {
back = dk4time_convert_to_text_c8(dptr, szdptr, &lct, erp);
} else {
@@ -189,6 +190,11 @@ dk4fileinfo_c8_nonwin_timestamp(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != stb);
+#endif
switch (chtime) {
case DK4_FILE_INFO_TIME_ACCESS: {
back = dk4fileinfo_c8_stat_time_timestamp(
@@ -225,6 +231,11 @@ dk4fileinfo_timestamp_c8(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
if ((NULL != dptr) && (NULL != fi) && (0 < szdptr)) {
switch (chfile) {
case DK4_FILE_INFO_CONTENTS_DATA_LINK: {
@@ -270,12 +281,17 @@ int
dk4fileinfo_type_attributes_c8(
char *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
)
{
size_t i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
if ((NULL != dptr) && (NULL != fi) && (0 < szdptr)) {
DK4_MEMRES(dptr, szdptr);
#if DK4_ON_WINDOWS
@@ -403,7 +419,7 @@ dk4fileinfo_type_attributes_c8(
}
} else {
-#line 372 "dk4fileig8.ctr"
+#line 463 "dk4fileig8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
#else
diff --git a/support/dktools/dk4fileig8.ctr b/support/dktools/dk4fileig8.ctr
index cf4d9ae3fd..69b9cd3614 100644
--- a/support/dktools/dk4fileig8.ctr
+++ b/support/dktools/dk4fileig8.ctr
@@ -2,12 +2,66 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
+%% header
+
+/** @file dk4fileig8.h Retrieve file information from
+ file information structure.
+*/
+
+#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Write file related timestamp to string.
+ @param dptr Destination buffer pointer.
+ @param szdptr Destination buffer size.
+ @param fi File information.
+ @param chfile Choose file (either DK4_FILE_INFO_CONTENTS_DATA_LINK
+ or DK4_FILE_INFO_CONTENTS_DATA_TARGET).
+ @param chtime Choose timestamp, one from:
+ DK4_FILE_INFO_TIME_CREATE,
+ DK4_FILE_INFO_TIME_MODIFY or
+ DK4_FILE_INFO_TIME_ACCESS.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4fileinfo_timestamp_c8(
+ char *dptr,
+ size_t szdptr,
+ const dk4_file_info_t *fi,
+ int chfile,
+ int chtime,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
%% module
+#include "dk4conf.h"
#include "dk4filei.h"
#ifndef DK4TIME_H_INCLUDED
@@ -22,6 +76,13 @@ license = bsd
#include "dk4time08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_TIME_WITH_SYS_TIME
#ifndef SYS_TIME_H_INCLUDED
#include <sys/time.h>
@@ -68,6 +129,11 @@ dk4fileinfo_c8_filetime_timestamp(
SYSTEMTIME st;
SYSTEMTIME lt;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != timer);
+#endif
if (FileTimeToSystemTime(timer, &st)) {
if (SystemTimeToTzSpecificLocalTime(NULL, &st, &lt)) {
back = dk4time_to_text_c8(
@@ -96,6 +162,11 @@ dk4fileinfo_c8_win_timestamp(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != pbhfi);
+#endif
switch (chtime) {
case DK4_FILE_INFO_TIME_ACCESS: {
back = dk4fileinfo_c8_filetime_timestamp(
@@ -133,6 +204,11 @@ dk4fileinfo_c8_stat_time_timestamp(
#if DK4_HAVE_LOCALTIME_R
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != timer);
+#endif
if (NULL != localtime_r(timer, &lct)) {
back = dk4time_convert_to_text_c8(dptr, szdptr, &lct, erp);
} else {
@@ -156,6 +232,11 @@ dk4fileinfo_c8_nonwin_timestamp(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != stb);
+#endif
switch (chtime) {
case DK4_FILE_INFO_TIME_ACCESS: {
back = dk4fileinfo_c8_stat_time_timestamp(
@@ -192,6 +273,11 @@ dk4fileinfo_timestamp_c8(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
if ((NULL != dptr) && (NULL != fi) && (0 < szdptr)) {
switch (chfile) {
case DK4_FILE_INFO_CONTENTS_DATA_LINK: {
@@ -237,12 +323,17 @@ int
dk4fileinfo_type_attributes_c8(
char *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
)
{
size_t i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
if ((NULL != dptr) && (NULL != fi) && (0 < szdptr)) {
DK4_MEMRES(dptr, szdptr);
#if DK4_ON_WINDOWS
diff --git a/support/dktools/dk4fileig8.h b/support/dktools/dk4fileig8.h
index 4c802bde05..3d10c7a76b 100644
--- a/support/dktools/dk4fileig8.h
+++ b/support/dktools/dk4fileig8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileig8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileig8.ctr
*/
#ifndef DK4FILEIG8_H_INCLUDED
@@ -38,18 +16,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DK4FILEIG8_H_INCLUDED 1
-#line 10 "dk4fileig8.ctr"
+#line 9 "dk4fileig8.ctr"
/** @file dk4fileig8.h Retrieve file information from
file information structure.
*/
#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -85,5 +71,4 @@ dk4fileinfo_timestamp_c8(
-
#endif
diff --git a/support/dktools/dk4fileigd.c b/support/dktools/dk4fileigd.c
index 9c62359772..74c3ca2125 100644
--- a/support/dktools/dk4fileigd.c
+++ b/support/dktools/dk4fileigd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileigd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileigd.ctr
*/
/** @file dk4fileigd.c The dk4fileigd module.
@@ -39,8 +17,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4fileigd.ctr"
+#include "dk4conf.h"
#include "dk4filei.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
int
dk4fileinfo_timestamp(
dkChar *dptr,
@@ -51,6 +39,11 @@ dk4fileinfo_timestamp(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fileinfo_timestamp_wc(dptr, szdptr, fi, chfile, chtime, erp));
#else
@@ -62,10 +55,15 @@ int
dk4fileinfo_type_attributes(
dkChar *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fileinfo_type_attributes_wc(dptr, szdptr, fi, erp));
#else
diff --git a/support/dktools/dk4fileigd.ctr b/support/dktools/dk4fileigd.ctr
index 51adbfbc78..6e3fe60241 100644
--- a/support/dktools/dk4fileigd.ctr
+++ b/support/dktools/dk4fileigd.ctr
@@ -2,14 +2,24 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4filei.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
int
dk4fileinfo_timestamp(
dkChar *dptr,
@@ -20,6 +30,11 @@ dk4fileinfo_timestamp(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fileinfo_timestamp_wc(dptr, szdptr, fi, chfile, chtime, erp));
#else
@@ -31,10 +46,15 @@ int
dk4fileinfo_type_attributes(
dkChar *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fileinfo_type_attributes_wc(dptr, szdptr, fi, erp));
#else
diff --git a/support/dktools/dk4fileigw.c b/support/dktools/dk4fileigw.c
index bc838a0ccb..46479596dd 100644
--- a/support/dktools/dk4fileigw.c
+++ b/support/dktools/dk4fileigw.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileigw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileigw.ctr
*/
/** @file dk4fileigw.c The dk4fileigw module.
@@ -39,10 +17,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4fileigw.ctr"
+#include "dk4conf.h"
+
#include "dk4filei.h"
#include "dk4rec23.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
dk4fileinfo_timestamp_wc(
wchar_t *dptr,
@@ -55,6 +42,11 @@ dk4fileinfo_timestamp_wc(
{
char buf[64];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
if (0 != dk4fileinfo_timestamp_c8(buf,sizeof(buf),fi,chfile,chtime,erp)) {
back = dk4recode_char_to_wchar_t(dptr, szdptr, buf, erp);
}
@@ -65,12 +57,17 @@ int
dk4fileinfo_type_attributes_wc(
wchar_t *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
)
{
char buf[64];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
if (0 != dk4fileinfo_type_attributes_c8(buf, sizeof(buf), fi, erp)) {
back = dk4recode_char_to_wchar_t(dptr, szdptr, buf, erp);
}
diff --git a/support/dktools/dk4fileigw.ctr b/support/dktools/dk4fileigw.ctr
index f810320433..5d0f435c58 100644
--- a/support/dktools/dk4fileigw.ctr
+++ b/support/dktools/dk4fileigw.ctr
@@ -2,16 +2,25 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
+
#include "dk4filei.h"
#include "dk4rec23.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
dk4fileinfo_timestamp_wc(
wchar_t *dptr,
@@ -24,6 +33,11 @@ dk4fileinfo_timestamp_wc(
{
char buf[64];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
if (0 != dk4fileinfo_timestamp_c8(buf,sizeof(buf),fi,chfile,chtime,erp)) {
back = dk4recode_char_to_wchar_t(dptr, szdptr, buf, erp);
}
@@ -34,12 +48,17 @@ int
dk4fileinfo_type_attributes_wc(
wchar_t *dptr,
size_t szdptr,
- dk4_file_info_t *fi,
+ dk4_file_info_t const *fi,
dk4_er_t *erp
)
{
char buf[64];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != fi);
+#endif
if (0 != dk4fileinfo_type_attributes_c8(buf, sizeof(buf), fi, erp)) {
back = dk4recode_char_to_wchar_t(dptr, szdptr, buf, erp);
}
diff --git a/support/dktools/dk4fileit.h b/support/dktools/dk4fileit.h
index a809e4d4d0..26538dd297 100644
--- a/support/dktools/dk4fileit.h
+++ b/support/dktools/dk4fileit.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4FILEIT_H_INCLUDED
/** Protection against multiple inclusions. */
#define DK4FILEIT_H_INCLUDED 1
@@ -45,8 +50,13 @@
file index) is available.
*/
-
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
#if DK4_ON_WINDOWS
#ifndef WINDOWS_H_INCLUDED
@@ -55,7 +65,14 @@
#endif
#endif
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
+
/** File information contents found.
*/
diff --git a/support/dktools/dk4fileiu.c b/support/dktools/dk4fileiu.c
index 0152a0380e..0b45e93494 100644
--- a/support/dktools/dk4fileiu.c
+++ b/support/dktools/dk4fileiu.c
@@ -1,50 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileiu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileiu.ctr
*/
/** @file dk4fileiu.c The dk4fileiu module.
*/
-#line 10 "dk4fileiu.ctr"
+#line 64 "dk4fileiu.ctr"
+#include "dk4conf.h"
#include "dk4filei.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 15 "dk4fileiu.ctr"
+
+#line 77 "dk4fileiu.ctr"
#if DK4_ON_WINDOWS
@@ -83,6 +69,10 @@ dk4fileinfo_ufi(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != src);
+#endif
if ((NULL != dptr) && (NULL != src)) {
switch (ch) {
case DK4_FILE_INFO_CONTENTS_DATA_LINK: {
diff --git a/support/dktools/dk4fileiu.ctr b/support/dktools/dk4fileiu.ctr
index 18c4bb2760..98b1b34c06 100644
--- a/support/dktools/dk4fileiu.ctr
+++ b/support/dktools/dk4fileiu.ctr
@@ -2,14 +2,76 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
+%% header
+/** @file dk4fileiu.h Retrieve unique file identifier from
+ file information structure.
+*/
+
+#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
+#endif
+
+#ifndef DK4UFI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4ufi.h"
+#else
+#include <dktools-4/dk4ufi.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve unique file identifier from file information structure.
+ @param dptr Pointer to destination variable.
+ @param src File information structure to retrieve information from.
+ @param ch For symbolic links choose between information
+ for link itself (DK4_FILE_INFO_CONTENTS_DATA_LINK)
+ or link target (DK4_FILE_INFO_CONTENTS_DATA_TARGET).
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if dptr or src is NULL,
+ DK4_E_NOT_FOUND if the information is not present in the
+ file information structure.
+*/
+int
+dk4fileinfo_ufi(
+ dk4_ufi_t *dptr, const dk4_file_info_t *src, int ch, dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
%% module
+#include "dk4conf.h"
#include "dk4filei.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -50,6 +112,10 @@ dk4fileinfo_ufi(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != src);
+#endif
if ((NULL != dptr) && (NULL != src)) {
switch (ch) {
case DK4_FILE_INFO_CONTENTS_DATA_LINK: {
diff --git a/support/dktools/dk4fileiu.h b/support/dktools/dk4fileiu.h
index ca6a6413a6..cd926378f1 100644
--- a/support/dktools/dk4fileiu.h
+++ b/support/dktools/dk4fileiu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileiu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileiu.ctr
*/
#ifndef DK4FILEIU_H_INCLUDED
@@ -38,22 +16,34 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DK4FILEIU_H_INCLUDED 1
-#line 10 "dk4fileiu.ctr"
+#line 8 "dk4fileiu.ctr"
/** @file dk4fileiu.h Retrieve unique file identifier from
file information structure.
*/
#ifndef DK4FILEIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fileit.h"
+#else
+#include <dktools-4/dk4fileit.h>
+#endif
#endif
#ifndef DK4UFI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufi.h"
+#else
+#include <dktools-4/dk4ufi.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -83,6 +73,4 @@ dk4fileinfo_ufi(
#endif
-
-
#endif
diff --git a/support/dktools/dk4fileiw.c b/support/dktools/dk4fileiw.c
index 8e614dc6be..12874a5145 100644
--- a/support/dktools/dk4fileiw.c
+++ b/support/dktools/dk4fileiw.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileiw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileiw.ctr
*/
/** @file dk4fileiw.c The dk4fileiw module.
*/
-#line 10 "dk4fileiw.ctr"
+#line 46 "dk4fileiw.ctr"
+#include "dk4conf.h"
#include "dk4filei.h"
#ifndef DK4MEM_H_INCLUDED
@@ -53,11 +32,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4error.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 28 "dk4fileiw.ctr"
+#line 72 "dk4fileiw.ctr"
@@ -76,10 +62,14 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
int back = 0;
-#line 45 "dk4fileiw.ctr"
+#line 89 "dk4fileiw.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
-#line 46 "dk4fileiw.ctr"
+#line 94 "dk4fileiw.ctr"
dk4error_init(&er);
DK4_MEMRES(dptr, sizeof(dk4_file_info_t));
dptr->contents = 0;
@@ -100,10 +90,10 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
/* Symlink */
found = 0;
-#line 65 "dk4fileiw.ctr"
+#line 113 "dk4fileiw.ctr"
for (i = 0; ((3 > i) && (0 == found)); i++) {
-#line 66 "dk4fileiw.ctr"
+#line 114 "dk4fileiw.ctr"
dwatt = dptr->fattr;
dwatt |= FILE_FLAG_OPEN_REPARSE_POINT;
if (0 != isdir) { dwatt |= FILE_FLAG_BACKUP_SEMANTICS; }
@@ -122,16 +112,16 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
);
if (INVALID_HANDLE_VALUE != ha) {
-#line 83 "dk4fileiw.ctr"
+#line 131 "dk4fileiw.ctr"
if (GetFileInformationByHandle(ha, &(dptr->linfo))) {
found = 1;
-#line 85 "dk4fileiw.ctr"
+#line 133 "dk4fileiw.ctr"
back = 1;
dptr->contents |= DK4_FILE_INFO_CONTENTS_DATA_LINK;
} else {
-#line 88 "dk4fileiw.ctr"
+#line 136 "dk4fileiw.ctr"
if (1 == i) {
dk4error_set_ldetails(
&er, DK4_E_FILE_INFORMATION_FAILED,
@@ -142,7 +132,7 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
CloseHandle(ha);
} else {
-#line 97 "dk4fileiw.ctr"
+#line 145 "dk4fileiw.ctr"
if (1 == i) {
dk4error_set_ldetails(
&er, DK4_E_CREATE_FILE_FAILED,
@@ -154,10 +144,10 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
/* Target */
found = 0;
-#line 107 "dk4fileiw.ctr"
+#line 155 "dk4fileiw.ctr"
for (i = 0; ((3 > i) && (0 == found)); i++) {
-#line 108 "dk4fileiw.ctr"
+#line 156 "dk4fileiw.ctr"
dwatt = dptr->fattr;
if (0 != isdir) { dwatt |= FILE_FLAG_BACKUP_SEMANTICS; }
ha = CreateFileW(
@@ -175,16 +165,16 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
);
if (INVALID_HANDLE_VALUE != ha) {
-#line 124 "dk4fileiw.ctr"
+#line 172 "dk4fileiw.ctr"
if (GetFileInformationByHandle(ha, &(dptr->tinfo))) {
found = 1;
-#line 126 "dk4fileiw.ctr"
+#line 174 "dk4fileiw.ctr"
back = 1;
dptr->contents |= DK4_FILE_INFO_CONTENTS_DATA_TARGET;
} else {
-#line 129 "dk4fileiw.ctr"
+#line 177 "dk4fileiw.ctr"
if (1 == i) {
dk4error_set_ldetails(
&er, DK4_E_FILE_INFORMATION_FAILED,
@@ -195,7 +185,7 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
CloseHandle(ha);
} else {
-#line 138 "dk4fileiw.ctr"
+#line 186 "dk4fileiw.ctr"
if (1 == i) {
dk4error_set_ldetails(
&er, DK4_E_CREATE_FILE_FAILED,
@@ -207,22 +197,22 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
/* FindFirstFile */
if (0 != back) {
-#line 148 "dk4fileiw.ctr"
+#line 196 "dk4fileiw.ctr"
ha = FindFirstFileW(fn, &ffdata);
if (INVALID_HANDLE_VALUE != ha) {
-#line 150 "dk4fileiw.ctr"
+#line 198 "dk4fileiw.ctr"
dptr->fattr = ffdata.dwFileAttributes;
dptr->rppnt = ffdata.dwReserved0;
FindClose(ha);
}
} else {
-#line 155 "dk4fileiw.ctr"
+#line 203 "dk4fileiw.ctr"
ha = FindFirstFileW(fn, &ffdata);
if (INVALID_HANDLE_VALUE != ha) {
-#line 157 "dk4fileiw.ctr"
+#line 205 "dk4fileiw.ctr"
back = 1;
dptr->fattr = ffdata.dwFileAttributes;
dptr->rppnt = ffdata.dwReserved0;
@@ -244,7 +234,7 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
FindClose(ha);
} else {
-#line 177 "dk4fileiw.ctr"
+#line 225 "dk4fileiw.ctr"
}
}
} else {
@@ -262,11 +252,11 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
}
} else {
-#line 193 "dk4fileiw.ctr"
+#line 241 "dk4fileiw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 195 "dk4fileiw.ctr"
+#line 243 "dk4fileiw.ctr"
return back;
}
diff --git a/support/dktools/dk4fileiw.ctr b/support/dktools/dk4fileiw.ctr
index 2e3c880ce1..4b693c3db6 100644
--- a/support/dktools/dk4fileiw.ctr
+++ b/support/dktools/dk4fileiw.ctr
@@ -2,12 +2,49 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4fileiw.h File information for wide-character file names.
+*/
+
+#ifndef DK4FILEIT_H_INCLUDED
+#include "dk4fileit.h"
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#include "dk4error.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve full information for a path name.
+ For symbolic links attempt to retrieve information both
+ about the link and about the link target.
+ @param dptr Pointer to result structure.
+ @param fn File path name.
+ @param erp Error report, may be NULL.
+ @return 1 if information is found, 0 otherwise.
+ If information about the link is found and no information about
+ the target, the function returns 1 as we can recognize the
+ directory item as a dangling link (link with non-existing target).
+*/
+int
+dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp);
+
+#ifdef __cplusplus
+}
+#endif
%% module
+#include "dk4conf.h"
#include "dk4filei.h"
#ifndef DK4MEM_H_INCLUDED
@@ -22,6 +59,13 @@ license = bsd
#include "dk4error.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -42,6 +86,10 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp)
#endif
int back = 0;
$? "+ dk4fileinfo_wc"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) { $? ". args ok"
dk4error_init(&er);
DK4_MEMRES(dptr, sizeof(dk4_file_info_t));
diff --git a/support/dktools/dk4fileiw.h b/support/dktools/dk4fileiw.h
index 43a31c4c0d..f8f699e298 100644
--- a/support/dktools/dk4fileiw.h
+++ b/support/dktools/dk4fileiw.h
@@ -1,39 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fileiw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file dk4fileiw.h File information for wide-character file names.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fileiw.ctr
*/
#ifndef DK4FILEIW_H_INCLUDED
@@ -41,10 +16,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DK4FILEIW_H_INCLUDED 1
-#line 10 "dk4fileiw.ctr"
+#line 9 "dk4fileiw.ctr"
-/** @file dk4filei8.h File information for files specified
- by char path name.
+/** @file dk4fileiw.h File information for wide-character file names.
*/
#ifndef DK4FILEIT_H_INCLUDED
@@ -78,4 +52,6 @@ dk4fileinfo_wc(dk4_file_info_t *dptr, const wchar_t *fn, dk4_er_t *erp);
#endif
+
+
#endif
diff --git a/support/dktools/dk4filew.c b/support/dktools/dk4filew.c
index cfb464e284..f3e2c4a171 100644
--- a/support/dktools/dk4filew.c
+++ b/support/dktools/dk4filew.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4filew.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4filew.ctr
*/
/** @file dk4filew.c The dk4filew module.
*/
-#line 97 "dk4filew.ctr"
+#line 109 "dk4filew.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -55,9 +33,31 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4filew.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+
+#line 138 "dk4filew.ctr"
+
int
-dk4file_wc_exists(const wchar_t *fn, dk4_er_t *erp)
+dk4file_wc_exists(
+#if DK4_ON_WINDOWS
+ const wchar_t *fn,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD dwattr;
@@ -66,6 +66,9 @@ dk4file_wc_exists(const wchar_t *fn, dk4_er_t *erp)
#endif
int back = 0;
#if DK4_ON_WINDOWS
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES != dwattr) {
@@ -83,6 +86,7 @@ dk4file_wc_exists(const wchar_t *fn, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
return back;
@@ -91,13 +95,23 @@ dk4file_wc_exists(const wchar_t *fn, dk4_er_t *erp)
int
-dk4file_wc_is_regular(const wchar_t *fn, dk4_er_t *erp)
+dk4file_wc_is_regular(
+#if DK4_ON_WINDOWS || DK4_USE_ASSERT
+ const wchar_t *fn,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD dwattr;
HANDLE ha;
WIN32_FIND_DATAW ffdata;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES != dwattr) {
@@ -125,6 +139,7 @@ dk4file_wc_is_regular(const wchar_t *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -133,13 +148,23 @@ dk4file_wc_is_regular(const wchar_t *fn, dk4_er_t *erp)
int
-dk4file_wc_is_directory(const wchar_t *fn, dk4_er_t *erp)
+dk4file_wc_is_directory(
+#if DK4_ON_WINDOWS
+ const wchar_t *fn,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
WIN32_FIND_DATAW ffdata;
DWORD dwattr;
HANDLE ha;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES != dwattr) {
@@ -163,6 +188,7 @@ dk4file_wc_is_directory(const wchar_t *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4filew.ctr b/support/dktools/dk4filew.ctr
index 53f5d3f20e..b06168e261 100644
--- a/support/dktools/dk4filew.ctr
+++ b/support/dktools/dk4filew.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -111,9 +123,29 @@ dk4file_wc_is_directory(const wchar_t *fn, dk4_er_t *erp);
#include "dk4filew.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+$!trace-include
+
int
-dk4file_wc_exists(const wchar_t *fn, dk4_er_t *erp)
+dk4file_wc_exists(
+#if DK4_ON_WINDOWS
+ const wchar_t *fn,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD dwattr;
@@ -122,6 +154,9 @@ dk4file_wc_exists(const wchar_t *fn, dk4_er_t *erp)
#endif
int back = 0;
#if DK4_ON_WINDOWS
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES != dwattr) {
@@ -139,6 +174,7 @@ dk4file_wc_exists(const wchar_t *fn, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
return back;
@@ -147,13 +183,23 @@ dk4file_wc_exists(const wchar_t *fn, dk4_er_t *erp)
int
-dk4file_wc_is_regular(const wchar_t *fn, dk4_er_t *erp)
+dk4file_wc_is_regular(
+#if DK4_ON_WINDOWS || DK4_USE_ASSERT
+ const wchar_t *fn,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD dwattr;
HANDLE ha;
WIN32_FIND_DATAW ffdata;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES != dwattr) {
@@ -181,6 +227,7 @@ dk4file_wc_is_regular(const wchar_t *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -189,13 +236,23 @@ dk4file_wc_is_regular(const wchar_t *fn, dk4_er_t *erp)
int
-dk4file_wc_is_directory(const wchar_t *fn, dk4_er_t *erp)
+dk4file_wc_is_directory(
+#if DK4_ON_WINDOWS
+ const wchar_t *fn,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
WIN32_FIND_DATAW ffdata;
DWORD dwattr;
HANDLE ha;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES != dwattr) {
@@ -219,6 +276,7 @@ dk4file_wc_is_directory(const wchar_t *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4filew.h b/support/dktools/dk4filew.h
index ac3d97df6b..0ed2200f30 100644
--- a/support/dktools/dk4filew.h
+++ b/support/dktools/dk4filew.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4filew.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4filew.ctr
*/
#ifndef DK4FILEW_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4fne.c b/support/dktools/dk4fne.c
index 1b28761d14..c62b67694c 100644
--- a/support/dktools/dk4fne.c
+++ b/support/dktools/dk4fne.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fne.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fne.ctr
*/
/** @file dk4fne.c The dk4fne module.
*/
-#line 70 "dk4fne.ctr"
+#line 78 "dk4fne.ctr"
+#include "dk4conf.h"
#include "dk4fne.h"
#if DK4_CHAR_SIZE > 1
@@ -51,11 +30,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
dk4_dir_t *
dk4fne_open(const dkChar *pattern, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != pattern);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fne_open_wc(pattern, erp));
#else
diff --git a/support/dktools/dk4fne.ctr b/support/dktools/dk4fne.ctr
index 93c37489f3..6e95b72ee1 100644
--- a/support/dktools/dk4fne.ctr
+++ b/support/dktools/dk4fne.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,11 +14,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4DIR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir.h"
+#else
+#include <dktools-4/dk4dir.h>
+#endif
#endif
@@ -68,6 +76,7 @@ dk4fne_open(const dkChar *pattern, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4fne.h"
#if DK4_CHAR_SIZE > 1
@@ -80,11 +89,20 @@ dk4fne_open(const dkChar *pattern, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
dk4_dir_t *
dk4fne_open(const dkChar *pattern, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != pattern);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fne_open_wc(pattern, erp));
#else
diff --git a/support/dktools/dk4fne.h b/support/dktools/dk4fne.h
index 55de1709cd..b1ef631ba0 100644
--- a/support/dktools/dk4fne.h
+++ b/support/dktools/dk4fne.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fne.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fne.ctr
*/
#ifndef DK4FNE_H_INCLUDED
@@ -47,11 +25,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4DIR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir.h"
+#else
+#include <dktools-4/dk4dir.h>
+#endif
#endif
diff --git a/support/dktools/dk4fne08.c b/support/dktools/dk4fne08.c
index 379fb0ab28..9e6cf514c4 100644
--- a/support/dktools/dk4fne08.c
+++ b/support/dktools/dk4fne08.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fne08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fne08.ctr
*/
/** @file dk4fne08.c The dk4fne08 module.
*/
-#line 64 "dk4fne08.ctr"
+#line 76 "dk4fne08.ctr"
#include "dk4conf.h"
@@ -49,18 +27,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4fne08.h"
#include "dk4str8.h"
#include "dk4mem.h"
+#include "dk4unused.h"
+#include "dk4getcwd8.h"
-#line 82 "dk4fne08.ctr"
+#line 103 "dk4fne08.ctr"
+#if DK4_ON_WINDOWS
/** Constant texts used by the module.
*/
static const char * const dk4fne_c8_kw[] = {
@@ -73,8 +61,10 @@ static const char * const dk4fne_c8_kw[] = {
NULL
-#line 92 "dk4fne08.ctr"
+#line 114 "dk4fne08.ctr"
};
+#endif
+
#if DK4_ON_WINDOWS
@@ -86,7 +76,10 @@ dk4fne_c8_fill_directory(dk4_dir_c8_t *ptr, const char *fn, dk4_er_t *erp)
char *nn;
HANDLE ffres;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(NULL != fn);
+#endif
ffres = FindFirstFileA(fn, &ffdata);
if (INVALID_HANDLE_VALUE != ffres) {
back = 1;
@@ -127,12 +120,22 @@ dk4fne_c8_fill_directory(dk4_dir_c8_t *ptr, const char *fn, dk4_er_t *erp)
dk4_dir_c8_t *
-dk4fne_open_c8(const char *fn, dk4_er_t *erp)
+dk4fne_open_c8(
+#if DK4_ON_WINDOWS
+ const char *fn,
+#else
+ const char * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
dk4_dir_c8_t *back = NULL;
char *p1 = NULL;
int ok = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
back = dk4mem_new(dk4_dir_c8_t, 1, erp);
@@ -150,6 +153,7 @@ dk4fne_open_c8(const char *fn, dk4_er_t *erp)
} else {
dk4mem_free(back->path);
back->path = NULL;
+ back->path = dk4getcwd_c8_dup(erp);
}
back->s_dir = dk4sto_open(erp);
if (NULL != back->s_dir) {
@@ -177,6 +181,7 @@ dk4fne_open_c8(const char *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4fne08.ctr b/support/dktools/dk4fne08.ctr
index 5f2fb00bf7..532c94868c 100644
--- a/support/dktools/dk4fne08.ctr
+++ b/support/dktools/dk4fne08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,8 +14,20 @@ license = bsd
CRT on Windows: Optional.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DIR08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir08.h"
+#else
+#include <dktools-4/dk4dir08.h>
+#endif
#endif
#ifdef __cplusplus
@@ -72,9 +84,18 @@ dk4fne_open_c8(const char *pattern, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4fne08.h"
#include "dk4str8.h"
#include "dk4mem.h"
+#include "dk4unused.h"
+#include "dk4getcwd8.h"
@@ -82,6 +103,7 @@ $!trace-include
+#if DK4_ON_WINDOWS
/** Constant texts used by the module.
*/
static const char * const dk4fne_c8_kw[] = {
@@ -90,6 +112,8 @@ $!string-table
..
$!end
};
+#endif
+
#if DK4_ON_WINDOWS
@@ -101,7 +125,10 @@ dk4fne_c8_fill_directory(dk4_dir_c8_t *ptr, const char *fn, dk4_er_t *erp)
char *nn;
HANDLE ffres;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(NULL != fn);
+#endif
ffres = FindFirstFileA(fn, &ffdata);
if (INVALID_HANDLE_VALUE != ffres) {
back = 1;
@@ -142,12 +169,22 @@ dk4fne_c8_fill_directory(dk4_dir_c8_t *ptr, const char *fn, dk4_er_t *erp)
dk4_dir_c8_t *
-dk4fne_open_c8(const char *fn, dk4_er_t *erp)
+dk4fne_open_c8(
+#if DK4_ON_WINDOWS
+ const char *fn,
+#else
+ const char * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
dk4_dir_c8_t *back = NULL;
char *p1 = NULL;
int ok = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
back = dk4mem_new(dk4_dir_c8_t, 1, erp);
@@ -165,6 +202,7 @@ dk4fne_open_c8(const char *fn, dk4_er_t *erp)
} else {
dk4mem_free(back->path);
back->path = NULL;
+ back->path = dk4getcwd_c8_dup(erp);
}
back->s_dir = dk4sto_open(erp);
if (NULL != back->s_dir) {
@@ -192,6 +230,7 @@ dk4fne_open_c8(const char *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4fne08.h b/support/dktools/dk4fne08.h
index 62363587c8..85ed5ce46f 100644
--- a/support/dktools/dk4fne08.h
+++ b/support/dktools/dk4fne08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fne08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fne08.ctr
*/
#ifndef DK4FNE08_H_INCLUDED
@@ -46,8 +24,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Optional.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DIR08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dir08.h"
+#else
+#include <dktools-4/dk4dir08.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4fnewc.c b/support/dktools/dk4fnewc.c
index 9c64846d3b..cd6dd81bd7 100644
--- a/support/dktools/dk4fnewc.c
+++ b/support/dktools/dk4fnewc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fnewc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fnewc.ctr
*/
/** @file dk4fnewc.c The dk4fnewc module.
*/
-#line 64 "dk4fnewc.ctr"
+#line 76 "dk4fnewc.ctr"
#include "dk4conf.h"
@@ -49,10 +27,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
-#include "dk4fnewc.h"
-#include "dk4strw.h"
-#include "dk4mem.h"
-
#if DK4_HAVE_WCHAR_H
#ifndef WCHAR_H_INCLUDED
#include <wchar.h>
@@ -60,9 +34,24 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4fnewc.h"
+#include "dk4strw.h"
+#include "dk4mem.h"
+#include "dk4getcwdw.h"
+#include "dk4unused.h"
+
-#line 87 "dk4fnewc.ctr"
+
+
+#line 110 "dk4fnewc.ctr"
@@ -82,7 +71,7 @@ L"..",
NULL
-#line 101 "dk4fnewc.ctr"
+#line 124 "dk4fnewc.ctr"
};
@@ -97,7 +86,11 @@ dk4fne_wc_fill_directory(dk4_dir_wc_t *ptr, const wchar_t *fn, dk4_er_t *erp)
int back = 0;
-#line 114 "dk4fnewc.ctr"
+#line 137 "dk4fnewc.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(NULL != fn);
+#endif
ffres = FindFirstFileW(fn, &ffdata);
if (INVALID_HANDLE_VALUE != ffres) {
back = 1;
@@ -126,7 +119,7 @@ dk4fne_wc_fill_directory(dk4_dir_wc_t *ptr, const wchar_t *fn, dk4_er_t *erp)
FindClose(ffres);
} else {
-#line 141 "dk4fnewc.ctr"
+#line 168 "dk4fnewc.ctr"
/* ERROR: FindFirstFile failed */
dk4error_set_ldetails(
erp, DK4_E_FINDFIRSTFILE_FAILED,
@@ -134,7 +127,7 @@ dk4fne_wc_fill_directory(dk4_dir_wc_t *ptr, const wchar_t *fn, dk4_er_t *erp)
);
}
-#line 147 "dk4fnewc.ctr"
+#line 174 "dk4fnewc.ctr"
return back;
}
#endif
@@ -142,7 +135,14 @@ dk4fne_wc_fill_directory(dk4_dir_wc_t *ptr, const wchar_t *fn, dk4_er_t *erp)
dk4_dir_wc_t *
-dk4fne_open_wc(const wchar_t *fn, dk4_er_t *erp)
+dk4fne_open_wc(
+#if DK4_ON_WINDOWS
+ const wchar_t *fn,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
dk4_dir_wc_t *back = NULL;
@@ -150,12 +150,15 @@ dk4fne_open_wc(const wchar_t *fn, dk4_er_t *erp)
int ok = 0;
-#line 161 "dk4fnewc.ctr"
+#line 195 "dk4fnewc.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
back = dk4mem_new(dk4_dir_wc_t, 1, erp);
if (NULL != back) {
-#line 164 "dk4fnewc.ctr"
+#line 201 "dk4fnewc.ctr"
back->path = NULL;
back->s_dir = NULL;
back->i_dir = NULL;
@@ -164,13 +167,14 @@ dk4fne_open_wc(const wchar_t *fn, dk4_er_t *erp)
back->path = dk4strw_dup(fn, erp);
if (NULL != back->path) {
-#line 171 "dk4fnewc.ctr"
+#line 208 "dk4fnewc.ctr"
p1 = dk4strw_rchr(back->path, L'\\');
if (NULL != p1) {
*p1 = L'\0';
} else {
dk4mem_free(back->path);
back->path = NULL;
+ back->path = dk4getcwd_wc_dup(erp);
}
back->s_dir = dk4sto_open(erp);
if (NULL != back->s_dir) {
@@ -183,27 +187,27 @@ dk4fne_open_wc(const wchar_t *fn, dk4_er_t *erp)
back->i_file = dk4sto_it_open(back->s_file, erp);
if (NULL != back->i_file) {
-#line 188 "dk4fnewc.ctr"
+#line 226 "dk4fnewc.ctr"
ok = dk4fne_wc_fill_directory(back, fn, erp);
} else {
-#line 190 "dk4fnewc.ctr"
+#line 228 "dk4fnewc.ctr"
}
} else {
-#line 192 "dk4fnewc.ctr"
+#line 230 "dk4fnewc.ctr"
}
} else {
-#line 194 "dk4fnewc.ctr"
+#line 232 "dk4fnewc.ctr"
}
} else {
-#line 196 "dk4fnewc.ctr"
+#line 234 "dk4fnewc.ctr"
}
} else {
-#line 198 "dk4fnewc.ctr"
+#line 236 "dk4fnewc.ctr"
}
if (0 == ok) {
dk4dir_wc_close(back);
@@ -211,15 +215,16 @@ dk4fne_open_wc(const wchar_t *fn, dk4_er_t *erp)
}
} else {
-#line 204 "dk4fnewc.ctr"
+#line 242 "dk4fnewc.ctr"
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 208 "dk4fnewc.ctr"
+#line 246 "dk4fnewc.ctr"
return back;
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4fnewc.ctr b/support/dktools/dk4fnewc.ctr
index d1559586b3..8674ff32d2 100644
--- a/support/dktools/dk4fnewc.ctr
+++ b/support/dktools/dk4fnewc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,8 +14,20 @@ license = bsd
CRT on Windows: Optional.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DIRWC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dirwc.h"
+#else
+#include <dktools-4/dk4dirwc.h>
+#endif
#endif
#ifdef __cplusplus
@@ -72,10 +84,6 @@ dk4fne_open_wc(const wchar_t *pattern, dk4_er_t *erp);
#endif
#endif
-#include "dk4fnewc.h"
-#include "dk4strw.h"
-#include "dk4mem.h"
-
#if DK4_HAVE_WCHAR_H
#ifndef WCHAR_H_INCLUDED
#include <wchar.h>
@@ -83,6 +91,21 @@ dk4fne_open_wc(const wchar_t *pattern, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4fnewc.h"
+#include "dk4strw.h"
+#include "dk4mem.h"
+#include "dk4getcwdw.h"
+#include "dk4unused.h"
+
+
+
$!trace-include
@@ -111,6 +134,10 @@ dk4fne_wc_fill_directory(dk4_dir_wc_t *ptr, const wchar_t *fn, dk4_er_t *erp)
HANDLE ffres;
int back = 0;
$? "+ dk4fne_wc_fill_directory"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(NULL != fn);
+#endif
ffres = FindFirstFileW(fn, &ffdata);
if (INVALID_HANDLE_VALUE != ffres) {
back = 1;
@@ -151,13 +178,23 @@ dk4fne_wc_fill_directory(dk4_dir_wc_t *ptr, const wchar_t *fn, dk4_er_t *erp)
dk4_dir_wc_t *
-dk4fne_open_wc(const wchar_t *fn, dk4_er_t *erp)
+dk4fne_open_wc(
+#if DK4_ON_WINDOWS
+ const wchar_t *fn,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
dk4_dir_wc_t *back = NULL;
wchar_t *p1 = NULL;
int ok = 0;
$? "+ dk4fne_open_wc"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
back = dk4mem_new(dk4_dir_wc_t, 1, erp);
if (NULL != back) { $? ". memory"
@@ -174,6 +211,7 @@ dk4fne_open_wc(const wchar_t *fn, dk4_er_t *erp)
} else {
dk4mem_free(back->path);
back->path = NULL;
+ back->path = dk4getcwd_wc_dup(erp);
}
back->s_dir = dk4sto_open(erp);
if (NULL != back->s_dir) {
@@ -207,6 +245,7 @@ dk4fne_open_wc(const wchar_t *fn, dk4_er_t *erp)
} $? "- dk4fne_open_wc PTR=%d", TR_IPTR(back)
return back;
#else
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4fnewc.h b/support/dktools/dk4fnewc.h
index ff4f4ce0f0..16a6b6962b 100644
--- a/support/dktools/dk4fnewc.h
+++ b/support/dktools/dk4fnewc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fnewc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fnewc.ctr
*/
#ifndef DK4FNEWC_H_INCLUDED
@@ -46,8 +24,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Optional.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4DIRWC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4dirwc.h"
+#else
+#include <dktools-4/dk4dirwc.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4font.c b/support/dktools/dk4font.c
index 55c760616b..e13df5e77c 100644
--- a/support/dktools/dk4font.c
+++ b/support/dktools/dk4font.c
@@ -1,45 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4font.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4font.ctr
*/
/** @file dk4font.c The dk4font module.
*/
-#line 130 "dk4font.ctr"
-
+#line 166 "dk4font.ctr"
+#include "dk4conf.h"
#include "dk4font.h"
@@ -55,7 +33,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 146 "dk4font.ctr"
+#line 182 "dk4font.ctr"
@@ -168,7 +146,7 @@ static const char * const dk4font_ps_names[] = {
NULL
-#line 187 "dk4font.ctr"
+#line 223 "dk4font.ctr"
};
@@ -282,7 +260,7 @@ static const char * const dk4font_tex_family_names[] = {
NULL
-#line 229 "dk4font.ctr"
+#line 265 "dk4font.ctr"
};
@@ -396,7 +374,7 @@ static const char * const dk4font_tex_names[] = {
NULL
-#line 271 "dk4font.ctr"
+#line 307 "dk4font.ctr"
};
@@ -490,4 +468,24 @@ dk4font_get_features(dk4_font_number_t fno)
+dk4_font_number_t
+dk4font_number_from_int(int fno)
+{
+ dk4_font_number_t back = DK4_FONT_TIMES_ROMAN;
+ if ((DK4_FONT_TIMES_ROMAN <= fno) && (DK4_FONT_MAX >= fno)) {
+ back = (dk4_font_number_t)fno;
+ }
+ return back;
+}
+
+
+
+int
+dk4font_get_family(dk4_font_number_t fno)
+{
+ return (DK4_FONT_FEATURE_FT_MASK & dk4font_get_features(fno));
+}
+
+
+
/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4font.ctr b/support/dktools/dk4font.ctr
index ca7a60d7a8..d142a3e011 100644
--- a/support/dktools/dk4font.ctr
+++ b/support/dktools/dk4font.ctr
@@ -2,11 +2,19 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
/** Font numbers the module can handle.
*/
@@ -66,16 +74,25 @@ typedef enum {
/** Font features.
*/
enum {
+ /* Font families.
+ */
+ DK4_FONT_FEATURE_ROMAN = 0, /**< Roman font. */
DK4_FONT_FEATURE_SANS_SERIF = 1, /**< Sans-serif font. */
DK4_FONT_FEATURE_TTY = 2, /**< Typewriter style font. */
DK4_FONT_FEATURE_SYMBOL = 3, /**< Symbol font. */
- DK4_FONT_FEATURE_BOLD = 4, /**< Bold font. */
- DK4_FONT_FEATURE_ITALIC = 8, /**< Italic font. */
- DK4_FONT_FEATURE_OBLIQUE = 16, /**< Oblique font. */
- DK4_FONT_FEATURE_NARROW = 32, /**< Narrow or condensed font. */
+ DK4_FONT_FEATURE_SCRIPT = 4, /**< Script, imitating hand writing. */
- DK4_FONT_FEATURE_FT_MASK = 3, /**< Mask to retrieve sf or tty. */
- DK4_FONT_FEATURE_ITOB_MASK = 24, /**< Mask for italic or oblique. */
+ /* Font modifications.
+ */
+ DK4_FONT_FEATURE_BOLD = 8, /**< Bold font. */
+ DK4_FONT_FEATURE_ITALIC = 16, /**< Italic font. */
+ DK4_FONT_FEATURE_OBLIQUE = 32, /**< Oblique font. */
+ DK4_FONT_FEATURE_NARROW = 64, /**< Narrow or condensed font. */
+
+ /* Masks to retrieve family or certain features.
+ */
+ DK4_FONT_FEATURE_FT_MASK = 7, /**< Mask to retrieve sf or tty. */
+ DK4_FONT_FEATURE_ITOB_MASK = 48, /**< Mask for italic or oblique. */
};
@@ -119,6 +136,25 @@ dk4font_get_latex_font_name(dk4_font_number_t fno);
int
dk4font_get_features(dk4_font_number_t fno);
+
+/** Get font number for integer number.
+ @param fno Font number as int.
+ @return Font number as dk4_font_number_t.
+*/
+
+dk4_font_number_t
+dk4font_number_from_int(int fno);
+
+
+/** Retrieve font family.
+ @param fno Font number.
+ @return Font family.
+*/
+
+int
+dk4font_get_family(dk4_font_number_t fno);
+
+
#ifdef __cplusplus
}
#endif
@@ -128,7 +164,7 @@ dk4font_get_features(dk4_font_number_t fno);
/* vim: set ai sw=4 ts=4 : */
%% module
-
+#include "dk4conf.h"
#include "dk4font.h"
@@ -361,4 +397,24 @@ dk4font_get_features(dk4_font_number_t fno)
+dk4_font_number_t
+dk4font_number_from_int(int fno)
+{
+ dk4_font_number_t back = DK4_FONT_TIMES_ROMAN;
+ if ((DK4_FONT_TIMES_ROMAN <= fno) && (DK4_FONT_MAX >= fno)) {
+ back = (dk4_font_number_t)fno;
+ }
+ return back;
+}
+
+
+
+int
+dk4font_get_family(dk4_font_number_t fno)
+{
+ return (DK4_FONT_FEATURE_FT_MASK & dk4font_get_features(fno));
+}
+
+
+
/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4font.h b/support/dktools/dk4font.h
index a7556bc655..b11daf7081 100644
--- a/support/dktools/dk4font.h
+++ b/support/dktools/dk4font.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4font.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4font.ctr
*/
/** @file dk4font.h Header file for the dk4font module.
@@ -43,6 +21,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4font.ctr"
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
/** Font numbers the module can handle.
*/
@@ -102,16 +88,25 @@ typedef enum {
/** Font features.
*/
enum {
+ /* Font families.
+ */
+ DK4_FONT_FEATURE_ROMAN = 0, /**< Roman font. */
DK4_FONT_FEATURE_SANS_SERIF = 1, /**< Sans-serif font. */
DK4_FONT_FEATURE_TTY = 2, /**< Typewriter style font. */
DK4_FONT_FEATURE_SYMBOL = 3, /**< Symbol font. */
- DK4_FONT_FEATURE_BOLD = 4, /**< Bold font. */
- DK4_FONT_FEATURE_ITALIC = 8, /**< Italic font. */
- DK4_FONT_FEATURE_OBLIQUE = 16, /**< Oblique font. */
- DK4_FONT_FEATURE_NARROW = 32, /**< Narrow or condensed font. */
+ DK4_FONT_FEATURE_SCRIPT = 4, /**< Script, imitating hand writing. */
+
+ /* Font modifications.
+ */
+ DK4_FONT_FEATURE_BOLD = 8, /**< Bold font. */
+ DK4_FONT_FEATURE_ITALIC = 16, /**< Italic font. */
+ DK4_FONT_FEATURE_OBLIQUE = 32, /**< Oblique font. */
+ DK4_FONT_FEATURE_NARROW = 64, /**< Narrow or condensed font. */
- DK4_FONT_FEATURE_FT_MASK = 3, /**< Mask to retrieve sf or tty. */
- DK4_FONT_FEATURE_ITOB_MASK = 24, /**< Mask for italic or oblique. */
+ /* Masks to retrieve family or certain features.
+ */
+ DK4_FONT_FEATURE_FT_MASK = 7, /**< Mask to retrieve sf or tty. */
+ DK4_FONT_FEATURE_ITOB_MASK = 48, /**< Mask for italic or oblique. */
};
@@ -155,6 +150,25 @@ dk4font_get_latex_font_name(dk4_font_number_t fno);
int
dk4font_get_features(dk4_font_number_t fno);
+
+/** Get font number for integer number.
+ @param fno Font number as int.
+ @return Font number as dk4_font_number_t.
+*/
+
+dk4_font_number_t
+dk4font_number_from_int(int fno);
+
+
+/** Retrieve font family.
+ @param fno Font number.
+ @return Font family.
+*/
+
+int
+dk4font_get_family(dk4_font_number_t fno);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4fontc.c b/support/dktools/dk4fontc.c
new file mode 100644
index 0000000000..f970c25649
--- /dev/null
+++ b/support/dktools/dk4fontc.c
@@ -0,0 +1,440 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fontc.ctr
+*/
+
+/** @file dk4fontc.c The dk4fontc module.
+*/
+
+
+#line 169 "dk4fontc.ctr"
+
+#include "dk4conf.h"
+
+#ifndef DK4FONTC_H_INCLUDED
+#include "dk4fontc.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4NUMCO_H_INCLUDED
+#include "dk4numco.h"
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+/** Minimum size difference required to see different font sizes.
+*/
+#define FNT_EPS 1.0e-4
+
+
+
+
+#line 222 "dk4fontc.ctr"
+
+
+
+/** Initialize a font item.
+ @param ptr Item to initialize.
+*/
+static
+void
+dk4fontc_item_init(dk4_font_item_t *ptr)
+{
+
+
+#line 233 "dk4fontc.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
+ dk4mem_reset(ptr, sizeof(dk4_font_item_t), NULL);
+ ptr->fsz = 0.0;
+ ptr->nf = (size_t)0UL;
+ ptr->fno = DK4_FONT_TIMES_ROMAN;
+ ptr->fex = DK4_GRA_TF_NONE_NONE;
+
+
+#line 242 "dk4fontc.ctr"
+}
+
+
+
+static
+int
+dk4_font_item_equal_fex(
+ const dk4_font_item_t *pl,
+ const dk4_font_item_t *pr
+)
+{
+ int back = 0;
+ if (DK4_GRA_TF_NONE_NONE != pl->fex) {
+ switch (pl->fex) {
+ case DK4_GRA_TF_NONE_NONE : {
+ /* Intentionally empty to avoid compiler warnings. */
+ } break;
+ case DK4_GRA_TF_EXACT_SIZE : case DK4_GRA_TF_SIMILAR_SIZE : {
+ if (pl->fno > pr->fno) {
+ back = 1;
+ }
+ else {
+ if (pl->fno < pr->fno) {
+ back = -1;
+ }
+ }
+ if (0 == back) {
+ if (isgreater(pl->fsz, (FNT_EPS + pr->fsz))) {
+ back = 1;
+ }
+ else {
+ if (isgreater(pr->fsz, (FNT_EPS + pl->fsz))) {
+ back = -1;
+ }
+ }
+ }
+ } break;
+ case DK4_GRA_TF_EXACT_NONE : case DK4_GRA_TF_SIMILAR_NONE : {
+ if (pl->fno > pr->fno) {
+ back = 1;
+ }
+ else {
+ if (pl->fno < pr->fno) {
+ back = -1;
+ }
+ }
+ } break;
+ default : { /* DK4_GRA_TF_NONE_SIZE */
+ if (isgreater(pl->fsz, (FNT_EPS + pr->fsz))) {
+ back = 1;
+ }
+ else {
+ if (isgreater(pr->fsz, (FNT_EPS + pl->fsz))) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+/** Compare two font items by font number or by font id.
+ @param l Left font item.
+ @param r Right font item.
+ @param cr Comparison criteria (1=by number,0=normal).
+ @return Comparison result.
+*/
+static
+int
+dk4_font_item_compare_by_fontno_and_size(
+ const void *l,
+ const void *r,
+ int cr
+)
+{
+ int back = 0;
+ const dk4_font_item_t *pl; /* Left object */
+ const dk4_font_item_t *pr; /* Right object */
+
+
+
+#line 325 "dk4fontc.ctr"
+ pl = (const dk4_font_item_t *)l;
+ pr = (const dk4_font_item_t *)r;
+ if (NULL != pl) {
+ if (NULL != pr) {
+ switch (cr) {
+ case 1 : {
+ if (pl->nf > pr->nf) {
+ back = 1;
+ }
+ else {
+ if (pl->nf < pr->nf) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ /*
+ First check domain (exact font or similar font)
+ */
+ if (pl->fex > pr->fex) {
+ back = 1;
+ }
+ else {
+ if (pl->fex < pr->fex) {
+ back = -1;
+ }
+ }
+ if (0 == back) {
+ back = dk4_font_item_equal_fex(pl, pr);
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != pr) {
+ back = -1;
+ }
+ }
+
+
+#line 368 "dk4fontc.ctr"
+ return back;
+}
+
+
+
+/** Initialize new font collector.
+ @param ptr Font collector to initialize.
+*/
+static
+void
+dk4fontc_init(dk4_font_collector_t *ptr)
+{
+
+
+#line 381 "dk4fontc.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
+ ptr->s_fo = ptr->s_fn = NULL;
+ ptr->i_fo = ptr->i_fn = NULL;
+ ptr->nfonts = 0;
+
+
+#line 388 "dk4fontc.ctr"
+}
+
+
+
+void
+dk4fontc_close(
+ dk4_font_collector_t *fc
+)
+{
+ dk4_font_item_t *fi; /* Current font item to release */
+
+
+
+#line 400 "dk4fontc.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fc);
+#endif
+ if (NULL != fc) {
+ /*
+ s_fn only contains copy
+ */
+ if (NULL != fc->s_fn) {
+ if (NULL != fc->i_fn) {
+ dk4sto_it_close(fc->i_fn);
+ }
+ dk4sto_close(fc->s_fn);
+ }
+ fc->s_fn = NULL;
+ fc->i_fn = NULL;
+ /*
+ s_fo contains the real data, we must delete here
+ */
+ if (NULL != fc->s_fo) {
+ if (NULL != fc->i_fo) {
+ dk4sto_it_reset(fc->i_fo);
+ do {
+ fi = (dk4_font_item_t *)dk4sto_it_next(fc->i_fo);
+ if (NULL != fi) {
+
+
+#line 425 "dk4fontc.ctr"
+ dk4mem_free(fi);
+ }
+ } while(NULL != fi);
+ }
+ dk4sto_close(fc->s_fo);
+ }
+ fc->s_fo = NULL;
+ fc->i_fo = NULL;
+ dk4fontc_init(fc);
+ dk4mem_free(fc);
+ }
+
+
+#line 437 "dk4fontc.ctr"
+}
+
+
+
+dk4_font_collector_t *
+dk4fontc_open(
+ dk4_er_t *erp
+)
+{
+ dk4_font_collector_t *back = NULL;
+ int ok = 0;
+
+
+
+#line 450 "dk4fontc.ctr"
+ back = dk4mem_new(dk4_font_collector_t,1,erp);
+ if (NULL != back) {
+ dk4fontc_init(back);
+ back->s_fo = dk4sto_open(erp);
+ back->s_fn = dk4sto_open(erp);
+ if ((NULL != back->s_fo) && (NULL != back->s_fn)) {
+ dk4sto_set_comp(
+ back->s_fo, dk4_font_item_compare_by_fontno_and_size, 0
+ );
+ dk4sto_set_comp(
+ back->s_fn, dk4_font_item_compare_by_fontno_and_size, 1
+ );
+ back->i_fo = dk4sto_it_open(back->s_fo, erp);
+ back->i_fn = dk4sto_it_open(back->s_fn, erp);
+ if ((NULL != back->i_fo) && (NULL != back->i_fn)) {
+ ok = 1;
+ }
+ }
+ if (0 == ok) {
+ dk4fontc_close(back);
+ back = NULL;
+ }
+ }
+
+
+#line 474 "dk4fontc.ctr"
+ return back;
+}
+
+
+
+int
+dk4fontc_add_font(
+ size_t *pdst,
+ dk4_font_collector_t *fc,
+ int fno,
+ double fsz,
+ int fex,
+ dk4_er_t *erp
+)
+{
+ dk4_font_item_t tv; /* Test value */
+ dk4_font_item_t *ptr; /* Item found */
+ dk4_font_number_t rfno; /* Real font number */
+ int back = 0; /* Function result */
+
+
+
+#line 495 "dk4fontc.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fc);
+ assert(NULL != pdst);
+ assert(0 <= fno);
+ assert(0.0 < fsz);
+#endif
+ /*
+ Check command line arguments
+ */
+ if ((NULL == pdst) || (NULL == fc) || (0 > fno) || (0.0 >= fsz)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ else {
+ /* Initialize search record
+ */
+ dk4fontc_item_init(&tv);
+ tv.fsz = fsz;
+ tv.nf = 0;
+ tv.fex = fex;
+ rfno = dk4font_number_from_int(fno);
+ switch (fex) {
+ case DK4_GRA_TF_SIMILAR_NONE : case DK4_GRA_TF_SIMILAR_SIZE : {
+ tv.fno = dk4font_get_features(rfno);
+ } break;
+ default : {
+ tv.fno = fno;
+ } break;
+ }
+ /*
+ Search
+ */
+ ptr = (dk4_font_item_t *)dk4sto_it_find_like(fc->i_fo, &tv, 0);
+ /*
+ Success if found, otherwise create new entry
+ */
+ if (NULL != ptr) {
+ back = 1;
+ *pdst = ptr->nf;
+ }
+ else {
+ if (SIZE_MAX > fc->nfonts) {
+ ptr = dk4mem_new(dk4_font_item_t,1,erp);
+ if (NULL != ptr) {
+ DK4_MEMCPY(ptr,&tv,sizeof(dk4_font_item_t));
+ ptr->nf = fc->nfonts;
+ if (0 != dk4sto_add(fc->s_fo, ptr, erp)) {
+ fc->nfonts += 1;
+ if (0 != dk4sto_add(fc->s_fn, ptr, erp)) {
+ back = 1;
+ *pdst = ptr->nf;
+ }
+ }
+ else {
+ dk4mem_free(ptr);
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ }
+
+
+#line 558 "dk4fontc.ctr"
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4fontc.ctr b/support/dktools/dk4fontc.ctr
new file mode 100644
index 0000000000..e75d7f6ae4
--- /dev/null
+++ b/support/dktools/dk4fontc.ctr
@@ -0,0 +1,562 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4fontc.h LaTeX font collector.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4FONT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4font.h"
+#else
+#include <dktools-4/dk4font.h>
+#endif
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
+#endif
+
+
+
+/** How to use specified font and size.
+*/
+enum dk4_gra_tf_t_ {
+ DK4_GRA_TF_NONE_NONE = 0 , /**< No font choosing. */
+ DK4_GRA_TF_NONE_SIZE = 1 , /**< No font, with size. */
+ DK4_GRA_TF_SIMILAR_NONE = 2 , /**< Choose similar font, no size. */
+ DK4_GRA_TF_SIMILAR_SIZE = 3 , /**< Choose similar font, with size. */
+ DK4_GRA_TF_EXACT_NONE = 4 , /**< Choose exact font but no size. */
+ DK4_GRA_TF_EXACT_SIZE = 5 , /**< Exact font and size. */
+
+ /** For normal text use exact font as specified.
+ */
+ DK4_GRA_TF_NORMAL = DK4_GRA_TF_EXACT_SIZE ,
+
+ /** For special text use similar features and size.
+ */
+ DK4_GRA_TF_SPECIAL = DK4_GRA_TF_SIMILAR_SIZE ,
+};
+
+
+
+/** How to use specified font and size.
+*/
+typedef enum dk4_gra_tf_t_ dk4_gra_tf_t;
+
+
+
+/** One font to register.
+*/
+typedef struct {
+ double fsz; /**< Font size in pt. */
+ size_t nf; /**< Number of font in font collection. */
+ int fno; /**< Font number or feature set. */
+ int fex; /**< Flag: Use exact font. */
+} dk4_font_item_t;
+
+
+
+/** Font collection.
+*/
+typedef struct {
+ dk4_sto_t *s_fo; /**< Fonts by font ID or font features. */
+ dk4_sto_t *s_fn; /**< Fonts by number. */
+ dk4_sto_it_t *i_fo; /**< Iterator for fonts by ID or features. */
+ dk4_sto_it_t *i_fn; /**< Iterator for fonts by number. */
+ size_t nfonts; /**< Number of fonts stored, next font. */
+} dk4_font_collector_t;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open new font collector, allocate resources.
+ After using a font collector obtained from this function the collector
+ must be closed using the dk4fontc_close() function.
+ @param erp Error report for diagnostics.
+ @return Valid pointer to new font collector on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available.
+*/
+dk4_font_collector_t *
+dk4fontc_open(
+ dk4_er_t *erp
+);
+
+/** Close font collector, release resources.
+ @param fc Font collector to close and release.
+*/
+void
+dk4fontc_close(
+ dk4_font_collector_t *fc
+);
+
+/** Check whether a specified font is already in the collector,
+ add if necessary.
+ @param pdst Address of result variable for font number.
+ @param fc Font collector to query.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param erp Error report.
+ @return 1 on success (font in collector or successfully added),
+ 0 on error (failed to add).
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is invalid (pdst or fc is NULL, fno is outside
+ the valid range or fsz is negative),
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in the number of used fonts
+ (too many fonts used).
+*/
+int
+dk4fontc_add_font(
+ size_t *pdst,
+ dk4_font_collector_t *fc,
+ int fno,
+ double fsz,
+ int fex,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#include "dk4conf.h"
+
+#ifndef DK4FONTC_H_INCLUDED
+#include "dk4fontc.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4NUMCO_H_INCLUDED
+#include "dk4numco.h"
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+/** Minimum size difference required to see different font sizes.
+*/
+#define FNT_EPS 1.0e-4
+
+
+$!trace-include
+
+
+
+/** Initialize a font item.
+ @param ptr Item to initialize.
+*/
+static
+void
+dk4fontc_item_init(dk4_font_item_t *ptr)
+{
+ $? "+ dk4fontc_item_init"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
+ dk4mem_reset(ptr, sizeof(dk4_font_item_t), NULL);
+ ptr->fsz = 0.0;
+ ptr->nf = (size_t)0UL;
+ ptr->fno = DK4_FONT_TIMES_ROMAN;
+ ptr->fex = DK4_GRA_TF_NONE_NONE;
+ $? "- dk4fontc_item_init"
+}
+
+
+
+static
+int
+dk4_font_item_equal_fex(
+ const dk4_font_item_t *pl,
+ const dk4_font_item_t *pr
+)
+{
+ int back = 0;
+ if (DK4_GRA_TF_NONE_NONE != pl->fex) {
+ switch (pl->fex) {
+ case DK4_GRA_TF_NONE_NONE : {
+ /* Intentionally empty to avoid compiler warnings. */
+ } break;
+ case DK4_GRA_TF_EXACT_SIZE : case DK4_GRA_TF_SIMILAR_SIZE : {
+ if (pl->fno > pr->fno) {
+ back = 1;
+ }
+ else {
+ if (pl->fno < pr->fno) {
+ back = -1;
+ }
+ }
+ if (0 == back) {
+ if (isgreater(pl->fsz, (FNT_EPS + pr->fsz))) {
+ back = 1;
+ }
+ else {
+ if (isgreater(pr->fsz, (FNT_EPS + pl->fsz))) {
+ back = -1;
+ }
+ }
+ }
+ } break;
+ case DK4_GRA_TF_EXACT_NONE : case DK4_GRA_TF_SIMILAR_NONE : {
+ if (pl->fno > pr->fno) {
+ back = 1;
+ }
+ else {
+ if (pl->fno < pr->fno) {
+ back = -1;
+ }
+ }
+ } break;
+ default : { /* DK4_GRA_TF_NONE_SIZE */
+ if (isgreater(pl->fsz, (FNT_EPS + pr->fsz))) {
+ back = 1;
+ }
+ else {
+ if (isgreater(pr->fsz, (FNT_EPS + pl->fsz))) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+/** Compare two font items by font number or by font id.
+ @param l Left font item.
+ @param r Right font item.
+ @param cr Comparison criteria (1=by number,0=normal).
+ @return Comparison result.
+*/
+static
+int
+dk4_font_item_compare_by_fontno_and_size(
+ const void *l,
+ const void *r,
+ int cr
+)
+{
+ int back = 0;
+ const dk4_font_item_t *pl; /* Left object */
+ const dk4_font_item_t *pr; /* Right object */
+
+ $? "+ dk4_font_item_compare_by_fontno_and_size"
+ pl = (const dk4_font_item_t *)l;
+ pr = (const dk4_font_item_t *)r;
+ if (NULL != pl) {
+ if (NULL != pr) {
+ switch (cr) {
+ case 1 : {
+ if (pl->nf > pr->nf) {
+ back = 1;
+ }
+ else {
+ if (pl->nf < pr->nf) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ /*
+ First check domain (exact font or similar font)
+ */
+ if (pl->fex > pr->fex) {
+ back = 1;
+ }
+ else {
+ if (pl->fex < pr->fex) {
+ back = -1;
+ }
+ }
+ if (0 == back) {
+ back = dk4_font_item_equal_fex(pl, pr);
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != pr) {
+ back = -1;
+ }
+ }
+ $? "- dk4_font_item_compare_by_fontno_and_size %d", back
+ return back;
+}
+
+
+
+/** Initialize new font collector.
+ @param ptr Font collector to initialize.
+*/
+static
+void
+dk4fontc_init(dk4_font_collector_t *ptr)
+{
+ $? "+ dk4fontc_init"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
+ ptr->s_fo = ptr->s_fn = NULL;
+ ptr->i_fo = ptr->i_fn = NULL;
+ ptr->nfonts = 0;
+ $? "- dk4fontc_init"
+}
+
+
+
+void
+dk4fontc_close(
+ dk4_font_collector_t *fc
+)
+{
+ dk4_font_item_t *fi; /* Current font item to release */
+
+ $? "+ dk4fontc_close %d", TR_IPTR(fc)
+#if DK4_USE_ASSERT
+ assert(NULL != fc);
+#endif
+ if (NULL != fc) {
+ /*
+ s_fn only contains copy
+ */
+ if (NULL != fc->s_fn) {
+ if (NULL != fc->i_fn) {
+ dk4sto_it_close(fc->i_fn);
+ }
+ dk4sto_close(fc->s_fn);
+ }
+ fc->s_fn = NULL;
+ fc->i_fn = NULL;
+ /*
+ s_fo contains the real data, we must delete here
+ */
+ if (NULL != fc->s_fo) {
+ if (NULL != fc->i_fo) {
+ dk4sto_it_reset(fc->i_fo);
+ do {
+ fi = (dk4_font_item_t *)dk4sto_it_next(fc->i_fo);
+ if (NULL != fi) {
+ $? ". one font item to delete"
+ dk4mem_free(fi);
+ }
+ } while(NULL != fi);
+ }
+ dk4sto_close(fc->s_fo);
+ }
+ fc->s_fo = NULL;
+ fc->i_fo = NULL;
+ dk4fontc_init(fc);
+ dk4mem_free(fc);
+ }
+ $? "- dk4fontc_close"
+}
+
+
+
+dk4_font_collector_t *
+dk4fontc_open(
+ dk4_er_t *erp
+)
+{
+ dk4_font_collector_t *back = NULL;
+ int ok = 0;
+
+ $? "+ dk4fontc_open"
+ back = dk4mem_new(dk4_font_collector_t,1,erp);
+ if (NULL != back) {
+ dk4fontc_init(back);
+ back->s_fo = dk4sto_open(erp);
+ back->s_fn = dk4sto_open(erp);
+ if ((NULL != back->s_fo) && (NULL != back->s_fn)) {
+ dk4sto_set_comp(
+ back->s_fo, dk4_font_item_compare_by_fontno_and_size, 0
+ );
+ dk4sto_set_comp(
+ back->s_fn, dk4_font_item_compare_by_fontno_and_size, 1
+ );
+ back->i_fo = dk4sto_it_open(back->s_fo, erp);
+ back->i_fn = dk4sto_it_open(back->s_fn, erp);
+ if ((NULL != back->i_fo) && (NULL != back->i_fn)) {
+ ok = 1;
+ }
+ }
+ if (0 == ok) {
+ dk4fontc_close(back);
+ back = NULL;
+ }
+ }
+ $? "- dk4fontc_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+dk4fontc_add_font(
+ size_t *pdst,
+ dk4_font_collector_t *fc,
+ int fno,
+ double fsz,
+ int fex,
+ dk4_er_t *erp
+)
+{
+ dk4_font_item_t tv; /* Test value */
+ dk4_font_item_t *ptr; /* Item found */
+ dk4_font_number_t rfno; /* Real font number */
+ int back = 0; /* Function result */
+
+ $? "+ dk4fontc_add_font fno=%d fex=%d fsz=%lf", fno, fex, fsz
+#if DK4_USE_ASSERT
+ assert(NULL != fc);
+ assert(NULL != pdst);
+ assert(0 <= fno);
+ assert(0.0 < fsz);
+#endif
+ /*
+ Check command line arguments
+ */
+ if ((NULL == pdst) || (NULL == fc) || (0 > fno) || (0.0 >= fsz)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ else {
+ /* Initialize search record
+ */
+ dk4fontc_item_init(&tv);
+ tv.fsz = fsz;
+ tv.nf = 0;
+ tv.fex = fex;
+ rfno = dk4font_number_from_int(fno);
+ switch (fex) {
+ case DK4_GRA_TF_SIMILAR_NONE : case DK4_GRA_TF_SIMILAR_SIZE : {
+ tv.fno = dk4font_get_features(rfno);
+ } break;
+ default : {
+ tv.fno = fno;
+ } break;
+ }
+ /*
+ Search
+ */
+ ptr = (dk4_font_item_t *)dk4sto_it_find_like(fc->i_fo, &tv, 0);
+ /*
+ Success if found, otherwise create new entry
+ */
+ if (NULL != ptr) {
+ back = 1;
+ *pdst = ptr->nf;
+ }
+ else {
+ if (SIZE_MAX > fc->nfonts) {
+ ptr = dk4mem_new(dk4_font_item_t,1,erp);
+ if (NULL != ptr) {
+ DK4_MEMCPY(ptr,&tv,sizeof(dk4_font_item_t));
+ ptr->nf = fc->nfonts;
+ if (0 != dk4sto_add(fc->s_fo, ptr, erp)) {
+ fc->nfonts += 1;
+ if (0 != dk4sto_add(fc->s_fn, ptr, erp)) {
+ back = 1;
+ *pdst = ptr->nf;
+ }
+ }
+ else {
+ dk4mem_free(ptr);
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ }
+ $? "- dk4fontc_add_font %d", back
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4fontc.h b/support/dktools/dk4fontc.h
new file mode 100644
index 0000000000..d9a736d02e
--- /dev/null
+++ b/support/dktools/dk4fontc.h
@@ -0,0 +1,181 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fontc.ctr
+*/
+
+#ifndef DK4FONTC_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4FONTC_H_INCLUDED 1
+
+
+#line 8 "dk4fontc.ctr"
+
+/** @file dk4fontc.h LaTeX font collector.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4FONT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4font.h"
+#else
+#include <dktools-4/dk4font.h>
+#endif
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
+#endif
+
+
+
+/** How to use specified font and size.
+*/
+enum dk4_gra_tf_t_ {
+ DK4_GRA_TF_NONE_NONE = 0 , /**< No font choosing. */
+ DK4_GRA_TF_NONE_SIZE = 1 , /**< No font, with size. */
+ DK4_GRA_TF_SIMILAR_NONE = 2 , /**< Choose similar font, no size. */
+ DK4_GRA_TF_SIMILAR_SIZE = 3 , /**< Choose similar font, with size. */
+ DK4_GRA_TF_EXACT_NONE = 4 , /**< Choose exact font but no size. */
+ DK4_GRA_TF_EXACT_SIZE = 5 , /**< Exact font and size. */
+
+ /** For normal text use exact font as specified.
+ */
+ DK4_GRA_TF_NORMAL = DK4_GRA_TF_EXACT_SIZE ,
+
+ /** For special text use similar features and size.
+ */
+ DK4_GRA_TF_SPECIAL = DK4_GRA_TF_SIMILAR_SIZE ,
+};
+
+
+
+/** How to use specified font and size.
+*/
+typedef enum dk4_gra_tf_t_ dk4_gra_tf_t;
+
+
+
+/** One font to register.
+*/
+typedef struct {
+ double fsz; /**< Font size in pt. */
+ size_t nf; /**< Number of font in font collection. */
+ int fno; /**< Font number or feature set. */
+ int fex; /**< Flag: Use exact font. */
+} dk4_font_item_t;
+
+
+
+/** Font collection.
+*/
+typedef struct {
+ dk4_sto_t *s_fo; /**< Fonts by font ID or font features. */
+ dk4_sto_t *s_fn; /**< Fonts by number. */
+ dk4_sto_it_t *i_fo; /**< Iterator for fonts by ID or features. */
+ dk4_sto_it_t *i_fn; /**< Iterator for fonts by number. */
+ size_t nfonts; /**< Number of fonts stored, next font. */
+} dk4_font_collector_t;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open new font collector, allocate resources.
+ After using a font collector obtained from this function the collector
+ must be closed using the dk4fontc_close() function.
+ @param erp Error report for diagnostics.
+ @return Valid pointer to new font collector on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available.
+*/
+dk4_font_collector_t *
+dk4fontc_open(
+ dk4_er_t *erp
+);
+
+/** Close font collector, release resources.
+ @param fc Font collector to close and release.
+*/
+void
+dk4fontc_close(
+ dk4_font_collector_t *fc
+);
+
+/** Check whether a specified font is already in the collector,
+ add if necessary.
+ @param pdst Address of result variable for font number.
+ @param fc Font collector to query.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param erp Error report.
+ @return 1 on success (font in collector or successfully added),
+ 0 on error (failed to add).
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is invalid (pdst or fc is NULL, fno is outside
+ the valid range or fsz is negative),
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in the number of used fonts
+ (too many fonts used).
+*/
+int
+dk4fontc_add_font(
+ size_t *pdst,
+ dk4_font_collector_t *fc,
+ int fno,
+ double fsz,
+ int fex,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4fopc8.c b/support/dktools/dk4fopc8.c
index f4d90d7b47..31a4fa3cfa 100644
--- a/support/dktools/dk4fopc8.c
+++ b/support/dktools/dk4fopc8.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fopc8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fopc8.ctr
*/
/** @file dk4fopc8.c The dk4fopc8 module.
*/
-#line 111 "dk4fopc8.ctr"
+#line 131 "dk4fopc8.ctr"
#include "dk4conf.h"
@@ -66,6 +44,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4str8.h"
#endif
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
#if DK4_HAVE_SYS_TYPES_H
#ifndef SYS_TYPES_H_INCLUDED
#include <sys/types.h>
@@ -87,11 +69,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 163 "dk4fopc8.ctr"
+#line 193 "dk4fopc8.ctr"
@@ -116,6 +104,9 @@ dk4fopen_check_no_symlink_in_path(const char *name)
dk4_stat_t lstb;
char *p1;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (sizeof(buf) > dk4str8_len(name)) {
back = 1;
dk4str8_cpy_s(buf, sizeof(buf), name, NULL);
@@ -140,21 +131,37 @@ dk4fopen_check_no_symlink_in_path(const char *name)
int
-dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
+dk4fopen_check_c8(
+ const char *name,
+#if DK4_ON_WINDOWS
+ int DK4_ARG_UNUSED(ww),
+ int DK4_ARG_UNUSED(tests),
+#else
+ int ww,
+ int tests,
+#endif
+ dk4_er_t *erp
+
+)
{
#if DK4_ON_WINDOWS
WIN32_FIND_DATAA ffdata;
HANDLE ha;
DWORD dwattr;
int back = 1;
+ DK4_UNUSED_ARG(ww)
+ DK4_UNUSED_ARG(tests)
-#line 219 "dk4fopc8.ctr"
+#line 265 "dk4fopc8.ctr"
/* Check name
*/
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL == name) {
-#line 222 "dk4fopc8.ctr"
+#line 271 "dk4fopc8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
back = 0;
goto finished;
@@ -171,14 +178,14 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
}
if (INVALID_FILE_ATTRIBUTES == dwattr) {
-#line 237 "dk4fopc8.ctr"
+#line 286 "dk4fopc8.ctr"
goto finished;
}
/* Check directory
*/
if ((DWORD)0UL != (FILE_ATTRIBUTE_DIRECTORY & dwattr)) {
-#line 242 "dk4fopc8.ctr"
+#line 291 "dk4fopc8.ctr"
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
goto finished;
@@ -187,14 +194,14 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
*/
if ((DWORD)0UL != (FILE_ATTRIBUTE_DEVICE & dwattr)) {
-#line 249 "dk4fopc8.ctr"
+#line 298 "dk4fopc8.ctr"
back = 0;
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_IS_REGULAR);
}
finished:
-#line 254 "dk4fopc8.ctr"
+#line 303 "dk4fopc8.ctr"
return back;
#else
dk4_stat_t stb;
@@ -202,7 +209,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
int back = 1;
-#line 260 "dk4fopc8.ctr"
+#line 309 "dk4fopc8.ctr"
/* Check name argument.
*/
@@ -216,7 +223,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
if (0 == dk4stat_c8(&stb, name, NULL)) {
-#line 272 "dk4fopc8.ctr"
+#line 321 "dk4fopc8.ctr"
goto finished;
}
/* Check directory.
@@ -224,7 +231,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
if (0 != dk4stat_is_directory(&stb, NULL)) {
-#line 278 "dk4fopc8.ctr"
+#line 327 "dk4fopc8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
back = 0;
goto finished;
@@ -235,7 +242,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
if (0 == dk4stat_is_regular(&stb, NULL)) {
-#line 287 "dk4fopc8.ctr"
+#line 336 "dk4fopc8.ctr"
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_IS_REGULAR);
back = 0;
goto finished;
@@ -247,7 +254,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
if (0 == dk4fopen_check_no_symlink_in_path(name)) {
-#line 297 "dk4fopc8.ctr"
+#line 346 "dk4fopc8.ctr"
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_WR_SYMLINK_IN_PATH);
back = 0;
goto finished;
@@ -258,7 +265,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
if (0 == dk4stat_l_c8(&lstb, name, NULL)) {
-#line 306 "dk4fopc8.ctr"
+#line 355 "dk4fopc8.ctr"
goto finished;
}
/* Do not write to file via link.
@@ -267,7 +274,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
if (0 != dk4stat_is_symlink(&lstb, NULL)) {
-#line 313 "dk4fopc8.ctr"
+#line 362 "dk4fopc8.ctr"
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_WR_PATH_IS_SYMLINK);
back = 0;
goto finished;
@@ -280,7 +287,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
if (lstb.st_uid != stb.st_uid) {
-#line 324 "dk4fopc8.ctr"
+#line 373 "dk4fopc8.ctr"
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_WR_SYMLINK_OWNER);
back = 0;
goto finished;
@@ -290,7 +297,7 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
finished:
-#line 332 "dk4fopc8.ctr"
+#line 381 "dk4fopc8.ctr"
return back;
#endif
}
@@ -307,6 +314,10 @@ dk4fopen_c8(const char *name, const char *mode, int tests, dk4_er_t *erp)
errno_t errn;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != mode);
+#endif
if ((NULL != name) && (NULL != mode)) {
cptr = mode;
while (*cptr) {
@@ -323,7 +334,7 @@ dk4fopen_c8(const char *name, const char *mode, int tests, dk4_er_t *erp)
);
}
#else
-#if DK4_HAVE_FOPEN64
+#if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE_FOPEN64
errno = 0;
back = fopen64(name, mode);
if (NULL == back) {
diff --git a/support/dktools/dk4fopc8.ctr b/support/dktools/dk4fopc8.ctr
index c75a63e5bb..91e50a2c95 100644
--- a/support/dktools/dk4fopc8.ctr
+++ b/support/dktools/dk4fopc8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -23,23 +23,43 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4NUMCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4numco.h"
+#else
+#include <dktools-4/dk4numco.h>
+#endif
#endif
#ifndef DK4FOPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopt.h"
+#else
+#include <dktools-4/dk4fopt.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -136,6 +156,10 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp);
#include "dk4str8.h"
#endif
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
#if DK4_HAVE_SYS_TYPES_H
#ifndef SYS_TYPES_H_INCLUDED
#include <sys/types.h>
@@ -157,6 +181,12 @@ dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -184,6 +214,9 @@ dk4fopen_check_no_symlink_in_path(const char *name)
dk4_stat_t lstb;
char *p1;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (sizeof(buf) > dk4str8_len(name)) {
back = 1;
dk4str8_cpy_s(buf, sizeof(buf), name, NULL);
@@ -208,16 +241,32 @@ dk4fopen_check_no_symlink_in_path(const char *name)
int
-dk4fopen_check_c8(const char *name, int ww, int tests, dk4_er_t *erp)
+dk4fopen_check_c8(
+ const char *name,
+#if DK4_ON_WINDOWS
+ int DK4_ARG_UNUSED(ww),
+ int DK4_ARG_UNUSED(tests),
+#else
+ int ww,
+ int tests,
+#endif
+ dk4_er_t *erp
+
+)
{
#if DK4_ON_WINDOWS
WIN32_FIND_DATAA ffdata;
HANDLE ha;
DWORD dwattr;
int back = 1;
+ DK4_UNUSED_ARG(ww)
+ DK4_UNUSED_ARG(tests)
$? "+ dk4fopen_check_c8 \"%!8s\" wr=%d tests=%d", TR_8STR(name), ww, tests
/* Check name
*/
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL == name) { $? "! illegal name"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
back = 0;
@@ -345,6 +394,10 @@ dk4fopen_c8(const char *name, const char *mode, int tests, dk4_er_t *erp)
errno_t errn;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != mode);
+#endif
if ((NULL != name) && (NULL != mode)) {
cptr = mode;
while (*cptr) {
@@ -361,7 +414,7 @@ dk4fopen_c8(const char *name, const char *mode, int tests, dk4_er_t *erp)
);
}
#else
-#if DK4_HAVE_FOPEN64
+#if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE_FOPEN64
errno = 0;
back = fopen64(name, mode);
if (NULL == back) {
diff --git a/support/dktools/dk4fopc8.h b/support/dktools/dk4fopc8.h
index dbe333dcca..c8779ae5d8 100644
--- a/support/dktools/dk4fopc8.h
+++ b/support/dktools/dk4fopc8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fopc8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fopc8.ctr
*/
#ifndef DK4FOPC8_H_INCLUDED
@@ -55,23 +33,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4NUMCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4numco.h"
+#else
+#include <dktools-4/dk4numco.h>
+#endif
#endif
#ifndef DK4FOPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopt.h"
+#else
+#include <dktools-4/dk4fopt.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
diff --git a/support/dktools/dk4fopd.c b/support/dktools/dk4fopd.c
index 513a389b05..009f7447c3 100644
--- a/support/dktools/dk4fopd.c
+++ b/support/dktools/dk4fopd.c
@@ -1,50 +1,41 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fopd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fopd.ctr
*/
/** @file dk4fopd.c The dk4fopd module.
*/
-#line 83 "dk4fopd.ctr"
+#line 102 "dk4fopd.ctr"
#include "dk4conf.h"
#include "dk4fopd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
FILE *
dk4fopen(const dkChar *name, const dkChar *mode, int tests, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != mode);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fopen_wc(name, mode, tests, erp));
#else
@@ -55,6 +46,9 @@ dk4fopen(const dkChar *name, const dkChar *mode, int tests, dk4_er_t *erp)
int
dk4fopen_check(const dkChar *name, int ww, int tests, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fopen_check_wc(name, ww, tests, erp));
#else
diff --git a/support/dktools/dk4fopd.ctr b/support/dktools/dk4fopd.ctr
index 38493dcd93..b4bf1be8e0 100644
--- a/support/dktools/dk4fopd.ctr
+++ b/support/dktools/dk4fopd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,11 +13,30 @@ license = bsd
checks, file name is specified in dkChar characters.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4FOPC8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopc8.h"
+#else
+#include <dktools-4/dk4fopc8.h>
+#endif
+#endif
#if DK4_CHAR_SIZE > 1
+#ifndef DK4FOPWC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopwc.h"
+#else
+#include <dktools-4/dk4fopwc.h>
+#endif
+#endif
#endif
@@ -84,9 +103,22 @@ dk4fopen_check(const dkChar *name, int ww, int tests, dk4_er_t *erp);
#include "dk4conf.h"
#include "dk4fopd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
FILE *
dk4fopen(const dkChar *name, const dkChar *mode, int tests, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != mode);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fopen_wc(name, mode, tests, erp));
#else
@@ -97,6 +129,9 @@ dk4fopen(const dkChar *name, const dkChar *mode, int tests, dk4_er_t *erp)
int
dk4fopen_check(const dkChar *name, int ww, int tests, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4fopen_check_wc(name, ww, tests, erp));
#else
diff --git a/support/dktools/dk4fopd.h b/support/dktools/dk4fopd.h
index ffdcd30e53..0b60a76060 100644
--- a/support/dktools/dk4fopd.h
+++ b/support/dktools/dk4fopd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fopd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fopd.ctr
*/
#ifndef DK4FOPD_H_INCLUDED
@@ -45,11 +23,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
checks, file name is specified in dkChar characters.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4FOPC8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopc8.h"
+#else
+#include <dktools-4/dk4fopc8.h>
+#endif
+#endif
#if DK4_CHAR_SIZE > 1
+#ifndef DK4FOPWC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopwc.h"
+#else
+#include <dktools-4/dk4fopwc.h>
+#endif
+#endif
#endif
diff --git a/support/dktools/dk4fopda.c b/support/dktools/dk4fopda.c
index 925d79676e..27d918e16a 100644
--- a/support/dktools/dk4fopda.c
+++ b/support/dktools/dk4fopda.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fopda.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fopda.ctr
*/
/** @file dk4fopda.c The dk4fopda module.
*/
-#line 38 "dk4fopda.ctr"
+#line 63 "dk4fopda.ctr"
#if 0
@@ -64,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4fopda.h"
#include "dk4error.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
FILE *
@@ -71,6 +55,11 @@ dk4fopen_app(const dkChar *name, const dkChar *mode, int tests, dk4_app_t *app)
{
dk4_er_t er;
FILE *back = NULL;
+
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != mode);
+#endif
if ((NULL != name) && (NULL != mode)) {
dk4error_init(&er);
back = dk4fopen(name, mode, tests, &er);
diff --git a/support/dktools/dk4fopda.ctr b/support/dktools/dk4fopda.ctr
index da1715eca6..276acec69e 100644
--- a/support/dktools/dk4fopda.ctr
+++ b/support/dktools/dk4fopda.ctr
@@ -2,18 +2,43 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
/** @file dk4fopda.h File open.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+#ifndef DK4FOPC8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopc8.h"
+#else
+#include <dktools-4/dk4fopc8.h>
+#endif
+#endif
#ifndef DK4FOPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopt.h"
+#else
+#include <dktools-4/dk4fopt.h>
+#endif
#endif
#ifdef __cplusplus
@@ -61,6 +86,12 @@ dk4fopen_app(const dkChar *name, const dkChar *mode, int tests, dk4_app_t *app);
#include "dk4fopda.h"
#include "dk4error.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
FILE *
@@ -68,6 +99,11 @@ dk4fopen_app(const dkChar *name, const dkChar *mode, int tests, dk4_app_t *app)
{
dk4_er_t er;
FILE *back = NULL;
+
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != mode);
+#endif
if ((NULL != name) && (NULL != mode)) {
dk4error_init(&er);
back = dk4fopen(name, mode, tests, &er);
diff --git a/support/dktools/dk4fopda.h b/support/dktools/dk4fopda.h
index f594c5d9f9..399cc3cd44 100644
--- a/support/dktools/dk4fopda.h
+++ b/support/dktools/dk4fopda.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fopda.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fopda.ctr
*/
#ifndef DK4FOPDA_H_INCLUDED
@@ -43,11 +21,36 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4fopda.h File open.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+#ifndef DK4FOPC8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopc8.h"
+#else
+#include <dktools-4/dk4fopc8.h>
+#endif
+#endif
#ifndef DK4FOPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopt.h"
+#else
+#include <dktools-4/dk4fopt.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4fopt.h b/support/dktools/dk4fopt.h
index 14d9b58dc9..577b5e3de7 100644
--- a/support/dktools/dk4fopt.h
+++ b/support/dktools/dk4fopt.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK4FOPT_H_INCLUDED
#define DK4FOPT_H_INCLUDED 1
@@ -5,8 +9,20 @@
/** @file dk4fopt.h File open tests.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4NUMCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4numco.h"
+#else
+#include <dktools-4/dk4numco.h>
+#endif
#endif
/** Skip one ore more security checks when opening files.
diff --git a/support/dktools/dk4fopwc.c b/support/dktools/dk4fopwc.c
index cc2e21d77a..cba8e15ced 100644
--- a/support/dktools/dk4fopwc.c
+++ b/support/dktools/dk4fopwc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fopwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fopwc.ctr
*/
/** @file dk4fopwc.c The dk4fopwc module.
*/
-#line 113 "dk4fopwc.ctr"
+#line 133 "dk4fopwc.ctr"
#include "dk4conf.h"
@@ -59,6 +37,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4stat.h"
#endif
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
#if DK4_HAVE_SYS_TYPES_H
#ifndef SYS_TYPES_H_INCLUDED
#include <sys/types.h>
@@ -87,11 +69,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 165 "dk4fopwc.ctr"
+#line 195 "dk4fopwc.ctr"
@@ -104,7 +92,10 @@ dk4fopen_wc(const wchar_t *name, const wchar_t *mode, int tests, dk4_er_t *erp)
#if DK4_HAVE__WFOPEN_S
errno_t errn;
#endif
-
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != mode);
+#endif
if ((NULL != name) && (NULL != mode)) {
cptr = mode;
while(*cptr) {
@@ -123,7 +114,7 @@ dk4fopen_wc(const wchar_t *name, const wchar_t *mode, int tests, dk4_er_t *erp)
);
}
#else
-#if DK4_HAVE__WFOPEN64
+#if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE__WFOPEN64
errno = 0;
back = _wfopen64(name, mode);
if (NULL == back) {
@@ -155,21 +146,36 @@ dk4fopen_wc(const wchar_t *name, const wchar_t *mode, int tests, dk4_er_t *erp)
int
-dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
+dk4fopen_check_wc(
+ const wchar_t *name,
+#if DK4_ON_WINDOWS
+ int DK4_ARG_UNUSED(ww),
+ int DK4_ARG_UNUSED(tests),
+#else
+ int ww,
+ int tests,
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
WIN32_FIND_DATAW ffdata;
HANDLE ha;
DWORD dwattr;
int back = 1;
+ DK4_UNUSED_ARG(ww)
+ DK4_UNUSED_ARG(tests)
-#line 236 "dk4fopwc.ctr"
+#line 281 "dk4fopwc.ctr"
/* Check name
*/
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL == name) {
-#line 239 "dk4fopwc.ctr"
+#line 287 "dk4fopwc.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
back = 0;
goto finished;
@@ -186,14 +192,14 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
}
if (INVALID_FILE_ATTRIBUTES == dwattr) {
-#line 254 "dk4fopwc.ctr"
+#line 302 "dk4fopwc.ctr"
goto finished;
}
/* Check directory
*/
if ((DWORD)0UL != (FILE_ATTRIBUTE_DIRECTORY & dwattr)) {
-#line 259 "dk4fopwc.ctr"
+#line 307 "dk4fopwc.ctr"
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
goto finished;
@@ -202,14 +208,14 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
*/
if ((DWORD)0UL != (FILE_ATTRIBUTE_DEVICE & dwattr)) {
-#line 266 "dk4fopwc.ctr"
+#line 314 "dk4fopwc.ctr"
back = 0;
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_IS_REGULAR);
}
finished:
-#line 271 "dk4fopwc.ctr"
+#line 319 "dk4fopwc.ctr"
return back;
#else
dk4_stat_t stb;
@@ -228,7 +234,7 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
if (0 == dk4stat_wc(&stb, name, NULL)) {
-#line 288 "dk4fopwc.ctr"
+#line 336 "dk4fopwc.ctr"
goto finished;
}
/* Check directory.
@@ -236,7 +242,7 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
if (0 != dk4stat_is_directory(&stb, NULL)) {
-#line 294 "dk4fopwc.ctr"
+#line 342 "dk4fopwc.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
back = 0;
goto finished;
@@ -247,7 +253,7 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
if (0 == dk4stat_is_regular(&stb, NULL)) {
-#line 303 "dk4fopwc.ctr"
+#line 351 "dk4fopwc.ctr"
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_IS_REGULAR);
back = 0;
goto finished;
@@ -261,7 +267,7 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
if (0 == dk4fopen_check_no_symlink_in_path(name)) {
-#line 315 "dk4fopwc.ctr"
+#line 363 "dk4fopwc.ctr"
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_WR_SYMLINK_IN_PATH);
back = 0;
goto finished;
@@ -273,7 +279,7 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
if (0 == dk4stat_l_wc(&lstb, name, NULL)) {
-#line 325 "dk4fopwc.ctr"
+#line 373 "dk4fopwc.ctr"
goto finished;
}
/* Do not write to file via link.
@@ -282,7 +288,7 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
if (0 != dk4stat_is_symlink(&lstb, NULL)) {
-#line 332 "dk4fopwc.ctr"
+#line 380 "dk4fopwc.ctr"
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_WR_PATH_IS_SYMLINK);
back = 0;
goto finished;
@@ -295,7 +301,7 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
if (lstb.st_uid != stb.st_uid) {
-#line 343 "dk4fopwc.ctr"
+#line 391 "dk4fopwc.ctr"
dk4error_set_idetails(erp, DK4_E_SEC_CHECK, DK4_FOPEN_SC_WR_SYMLINK_OWNER);
back = 0;
goto finished;
diff --git a/support/dktools/dk4fopwc.ctr b/support/dktools/dk4fopwc.ctr
index 210587e60d..4d804cc0bc 100644
--- a/support/dktools/dk4fopwc.ctr
+++ b/support/dktools/dk4fopwc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -23,23 +23,43 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4NUMCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4numco.h"
+#else
+#include <dktools-4/dk4numco.h>
+#endif
#endif
#ifndef DK4FOPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopt.h"
+#else
+#include <dktools-4/dk4fopt.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -131,6 +151,10 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp);
#include "dk4stat.h"
#endif
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
#if DK4_HAVE_SYS_TYPES_H
#ifndef SYS_TYPES_H_INCLUDED
#include <sys/types.h>
@@ -159,6 +183,12 @@ dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -174,7 +204,10 @@ dk4fopen_wc(const wchar_t *name, const wchar_t *mode, int tests, dk4_er_t *erp)
#if DK4_HAVE__WFOPEN_S
errno_t errn;
#endif
-
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != mode);
+#endif
if ((NULL != name) && (NULL != mode)) {
cptr = mode;
while(*cptr) {
@@ -193,7 +226,7 @@ dk4fopen_wc(const wchar_t *name, const wchar_t *mode, int tests, dk4_er_t *erp)
);
}
#else
-#if DK4_HAVE__WFOPEN64
+#if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE__WFOPEN64
errno = 0;
back = _wfopen64(name, mode);
if (NULL == back) {
@@ -225,16 +258,31 @@ dk4fopen_wc(const wchar_t *name, const wchar_t *mode, int tests, dk4_er_t *erp)
int
-dk4fopen_check_wc(const wchar_t *name, int ww, int tests, dk4_er_t *erp)
+dk4fopen_check_wc(
+ const wchar_t *name,
+#if DK4_ON_WINDOWS
+ int DK4_ARG_UNUSED(ww),
+ int DK4_ARG_UNUSED(tests),
+#else
+ int ww,
+ int tests,
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
WIN32_FIND_DATAW ffdata;
HANDLE ha;
DWORD dwattr;
int back = 1;
+ DK4_UNUSED_ARG(ww)
+ DK4_UNUSED_ARG(tests)
$? "+ dk4fopen_check_wc \"%ls\" wr=%d tests=%d", TR_LSTR(name), ww, tests
/* Check name
*/
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL == name) { $? "! illegal name"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
back = 0;
diff --git a/support/dktools/dk4fopwc.h b/support/dktools/dk4fopwc.h
index bb9f71aed1..431f5b31e2 100644
--- a/support/dktools/dk4fopwc.h
+++ b/support/dktools/dk4fopwc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fopwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fopwc.ctr
*/
#ifndef DK4FOPWC_H_INCLUDED
@@ -55,23 +33,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4NUMCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4numco.h"
+#else
+#include <dktools-4/dk4numco.h>
+#endif
#endif
#ifndef DK4FOPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4fopt.h"
+#else
+#include <dktools-4/dk4fopt.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
diff --git a/support/dktools/dk4fpe.c b/support/dktools/dk4fpe.c
index c1c392ac1f..5db9aa31d4 100644
--- a/support/dktools/dk4fpe.c
+++ b/support/dktools/dk4fpe.c
@@ -1,49 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fpe.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fpe.ctr
*/
/** @file dk4fpe.c The dk4fpe module.
*/
-#line 200 "dk4fpe.ctr"
+#line 174 "dk4fpe.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4fpe.h"
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
/** Exception set for errors.
*/
@@ -68,7 +55,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
int back = 0;
if ((dk4_fpe_t)0 != (dk4fpe_errors & fpe)) {
back = 1;
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
if ((dk4_fpe_t)0 != (_SW_INVALID & fpe))
#else
if ((dk4_fpe_t)0 != (FE_INVALID & fpe))
@@ -78,7 +65,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
}
else
{
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
if ((dk4_fpe_t)0 != (_SW_ZERODIVIDE & fpe))
#else
if ((dk4_fpe_t)0 != (FE_DIVBYZERO & fpe))
@@ -88,7 +75,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
}
else
{
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
if ((dk4_fpe_t)0 != (_SW_OVERFLOW & fpe))
#else
if ((dk4_fpe_t)0 != (FE_OVERFLOW & fpe))
@@ -98,7 +85,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
}
else
{
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
if ((dk4_fpe_t)0 != (_SW_UNDERFLOW & fpe))
#else
if ((dk4_fpe_t)0 != (FE_UNDERFLOW & fpe))
@@ -117,7 +104,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
int
dk4fpe_clear(dk4_er_t *erp)
{
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
_clearfp();
return 1;
#else
@@ -142,8 +129,11 @@ int
dk4fpe_get(dk4_fpe_t *dptr, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
*dptr = (dk4_fpe_t)_statusfp();
back = 1;
#else
@@ -166,8 +156,11 @@ int
dk4fpe_get_clear(dk4_fpe_t *dptr, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
*dptr = _clearfp();
back = 1;
#else
@@ -189,36 +182,3 @@ dk4fpe_get_clear(dk4_fpe_t *dptr, dk4_er_t *erp)
}
-
-int
-dk4fpe_is_finite(double d)
-{
- int back = 0;
-#ifdef _WIN32
- back = ((0 != _finite(d)) ? 1 : 0);
-#else
- back = ((0 != isfinite(d)) ? 1 : 0);
-#endif
- return back;
-}
-
-
-
-int
-dk4fpe_is_normal(double d)
-{
- int back = 0;
-#ifdef _WIN32
- switch (_fpclass(d)) {
- case _FPCLASS_NN : case _FPCLASS_NZ :
- case _FPCLASS_PZ : case _FPCLASS_PN :
- {
- back = 1;
- } break;
- }
-#else
- back = ((0 != isnormal(d)) ? 1 : 0);
-#endif
- return back;
-}
-
diff --git a/support/dktools/dk4fpe.ctr b/support/dktools/dk4fpe.ctr
index 55ccf4f21a..23717bd9a1 100644
--- a/support/dktools/dk4fpe.ctr
+++ b/support/dktools/dk4fpe.ctr
@@ -2,59 +2,54 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
/** @file dk4fpe.h Floating point exceptions.
-
- Note: Including this file disables optimization of
- floating point operations by use of compiler pragma directives.
-
- Use only in those modules in which you want to check for
- floating point exceptions.
-
- This header file should be the last file included by a module.
-*/
-
-
-
-/* Pragmas differ on Windows and Unix/Linux to prevent optimization
- of floating point operations.
- At least one compiler bails out with error message for unknown
- pragma directives.
+Note: When using functions from this module you should use
+the compiler pragma to grant access to the floating
+point environment.
+This disables optimization of floating point operations.
+The availability and the exact form of the pragma depends
+on your compiler.
+
+* pragma STDC FENV_ACCESS ON
+ SUN workshop compiler.
+ Probably other Unix/Linux compilers.
+* pragma fenv_access (on)
+ Visual Studio on Windows.
+
+In version 4.13.1 and above the pragma is no longer included in
+this header file as you probably want to apply it to some
+code sections of a file only.
*/
-#ifndef _WIN32
-/* +++ !Windows */
-#ifdef __SUNPRO_C
-/* +++ !Windows, SUN workshop compiler */
-#if __SUNPRO_C > 0x570
-#pragma STDC FENV_ACCESS on
-#endif
-/* --- !Windows, SUN workshop compiler */
-#else
-/* +++ !Windows, ! SUN workshop compiler */
-#pragma STDC FENV_ACCESS on
-/* --- !Windows, ! SUN workshop compiler */
-#endif
-/* --- !Windows */
-#endif
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#if DK4_HAVE_MATH_H
#ifndef MATH_H_INCLUDED
-#ifdef _WIN32
-#define _USE_MATH_DEFINES 1
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
#endif
#include <math.h>
#define MATH_H_INCLUDED 1
@@ -68,26 +63,24 @@ license = bsd
#endif
#endif
-#ifndef _WIN32
#if DK4_HAVE_FENV_H
#ifndef FENV_H_INCLUDED
#include <fenv.h>
#define FENV_H_INCLUDED 1
#endif
#endif
-#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
#endif
-
-#ifdef _WIN32
-/* +++ Windows */
-#pragma fenv_access (on)
-/* --- Windows */
#endif
-#ifdef _WIN32
+
+
+#if _WIN32 && defined(_MSC_VER)
/** Floating point exception set.
*/
typedef unsigned int dk4_fpe_t;
@@ -172,25 +165,6 @@ int
dk4fpe_get_clear(dk4_fpe_t *dptr, dk4_er_t *erp);
-/** Check a double value whether or not it is a finite number
- (not +/- INF, not NaN).
- @param d Value to check.
- @return 1 on success, 0 on error.
-*/
-
-int
-dk4fpe_is_finite(double d) ;
-
-
-/** Check a double value whether or not it is a normalized number
- (not +/- INF, not NaN, not denormalized).
- @param d Value to check.
- @return 1 on success, 0 on error.
-*/
-int
-dk4fpe_is_normal(double d);
-
-
#ifdef __cplusplus
}
#endif
@@ -198,11 +172,20 @@ dk4fpe_is_normal(double d);
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4fpe.h"
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
/** Exception set for errors.
*/
@@ -227,7 +210,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
int back = 0;
if ((dk4_fpe_t)0 != (dk4fpe_errors & fpe)) {
back = 1;
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
if ((dk4_fpe_t)0 != (_SW_INVALID & fpe))
#else
if ((dk4_fpe_t)0 != (FE_INVALID & fpe))
@@ -237,7 +220,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
}
else
{
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
if ((dk4_fpe_t)0 != (_SW_ZERODIVIDE & fpe))
#else
if ((dk4_fpe_t)0 != (FE_DIVBYZERO & fpe))
@@ -247,7 +230,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
}
else
{
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
if ((dk4_fpe_t)0 != (_SW_OVERFLOW & fpe))
#else
if ((dk4_fpe_t)0 != (FE_OVERFLOW & fpe))
@@ -257,7 +240,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
}
else
{
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
if ((dk4_fpe_t)0 != (_SW_UNDERFLOW & fpe))
#else
if ((dk4_fpe_t)0 != (FE_UNDERFLOW & fpe))
@@ -276,7 +259,7 @@ dk4fpe_check_error(dk4_fpe_t fpe, dk4_er_t *erp)
int
dk4fpe_clear(dk4_er_t *erp)
{
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
_clearfp();
return 1;
#else
@@ -301,8 +284,11 @@ int
dk4fpe_get(dk4_fpe_t *dptr, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
*dptr = (dk4_fpe_t)_statusfp();
back = 1;
#else
@@ -325,8 +311,11 @@ int
dk4fpe_get_clear(dk4_fpe_t *dptr, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
-#ifdef _WIN32
+#if _WIN32 && defined(_MSC_VER)
*dptr = _clearfp();
back = 1;
#else
@@ -348,36 +337,3 @@ dk4fpe_get_clear(dk4_fpe_t *dptr, dk4_er_t *erp)
}
-
-int
-dk4fpe_is_finite(double d)
-{
- int back = 0;
-#ifdef _WIN32
- back = ((0 != _finite(d)) ? 1 : 0);
-#else
- back = ((0 != isfinite(d)) ? 1 : 0);
-#endif
- return back;
-}
-
-
-
-int
-dk4fpe_is_normal(double d)
-{
- int back = 0;
-#ifdef _WIN32
- switch (_fpclass(d)) {
- case _FPCLASS_NN : case _FPCLASS_NZ :
- case _FPCLASS_PZ : case _FPCLASS_PN :
- {
- back = 1;
- } break;
- }
-#else
- back = ((0 != isnormal(d)) ? 1 : 0);
-#endif
- return back;
-}
-
diff --git a/support/dktools/dk4fpe.h b/support/dktools/dk4fpe.h
index 553c6b2c76..17c45001de 100644
--- a/support/dktools/dk4fpe.h
+++ b/support/dktools/dk4fpe.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fpe.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fpe.ctr
*/
#ifndef DK4FPE_H_INCLUDED
@@ -41,53 +19,48 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4fpe.ctr"
/** @file dk4fpe.h Floating point exceptions.
-
- Note: Including this file disables optimization of
- floating point operations by use of compiler pragma directives.
-
- Use only in those modules in which you want to check for
- floating point exceptions.
-
- This header file should be the last file included by a module.
+Note: When using functions from this module you should use
+the compiler pragma to grant access to the floating
+point environment.
+This disables optimization of floating point operations.
+The availability and the exact form of the pragma depends
+on your compiler.
+
+* pragma STDC FENV_ACCESS ON
+ SUN workshop compiler.
+ Probably other Unix/Linux compilers.
+* pragma fenv_access (on)
+ Visual Studio on Windows.
+
+In version 4.13.1 and above the pragma is no longer included in
+this header file as you probably want to apply it to some
+code sections of a file only.
*/
-/* Pragmas differ on Windows and Unix/Linux to prevent optimization
- of floating point operations.
- At least one compiler bails out with error message for unknown
- pragma directives.
-*/
-
-#ifndef _WIN32
-/* +++ !Windows */
-#ifdef __SUNPRO_C
-/* +++ !Windows, SUN workshop compiler */
-#if __SUNPRO_C > 0x570
-#pragma STDC FENV_ACCESS on
-#endif
-/* --- !Windows, SUN workshop compiler */
-#else
-/* +++ !Windows, ! SUN workshop compiler */
-#pragma STDC FENV_ACCESS on
-/* --- !Windows, ! SUN workshop compiler */
-#endif
-/* --- !Windows */
-#endif
-
-
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#if DK4_HAVE_MATH_H
#ifndef MATH_H_INCLUDED
-#ifdef _WIN32
-#define _USE_MATH_DEFINES 1
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
#endif
#include <math.h>
#define MATH_H_INCLUDED 1
@@ -101,26 +74,24 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
-#ifndef _WIN32
#if DK4_HAVE_FENV_H
#ifndef FENV_H_INCLUDED
#include <fenv.h>
#define FENV_H_INCLUDED 1
#endif
#endif
-#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
#endif
-
-#ifdef _WIN32
-/* +++ Windows */
-#pragma fenv_access (on)
-/* --- Windows */
#endif
-#ifdef _WIN32
+
+
+#if _WIN32 && defined(_MSC_VER)
/** Floating point exception set.
*/
typedef unsigned int dk4_fpe_t;
@@ -205,25 +176,6 @@ int
dk4fpe_get_clear(dk4_fpe_t *dptr, dk4_er_t *erp);
-/** Check a double value whether or not it is a finite number
- (not +/- INF, not NaN).
- @param d Value to check.
- @return 1 on success, 0 on error.
-*/
-
-int
-dk4fpe_is_finite(double d) ;
-
-
-/** Check a double value whether or not it is a normalized number
- (not +/- INF, not NaN, not denormalized).
- @param d Value to check.
- @return 1 on success, 0 on error.
-*/
-int
-dk4fpe_is_normal(double d);
-
-
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4fput.c b/support/dktools/dk4fput.c
index 6719b4c362..e1fe1c377c 100644
--- a/support/dktools/dk4fput.c
+++ b/support/dktools/dk4fput.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fput.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fput.ctr
*/
/** @file dk4fput.c The dk4fput module.
*/
-#line 129 "dk4fput.ctr"
+#line 141 "dk4fput.ctr"
+#include "dk4conf.h"
#include "dk4fput.h"
#if DK4_HAVE_IO_H
@@ -55,15 +34,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#ifndef DK4REC26_H_INCLUDED
+#include "dk4rec26.h"
+#endif
+
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 149 "dk4fput.ctr"
+#line 174 "dk4fput.ctr"
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
/** Flag: Standard output initialized to write dkChar.
*/
@@ -88,7 +79,7 @@ static int dk4fput_stderr_oldmode = _O_TEXT;
void
dk4fput_initialize_stdout(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 == dk4fput_stdout_initialized) {
dk4fput_stdout_oldmode = _setmode(_fileno(stdout), _O_U16TEXT);
if (0 == _isatty(_fileno(stdout))) {
@@ -104,7 +95,7 @@ dk4fput_initialize_stdout(void)
void
dk4fput_initialize_stdout_no_bom(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 == dk4fput_stdout_initialized) {
dk4fput_stdout_oldmode = _setmode(_fileno(stdout), _O_U16TEXT);
dk4fput_stdout_initialized = 1;
@@ -116,7 +107,7 @@ dk4fput_initialize_stdout_no_bom(void)
void
dk4fput_cleanup_stdout(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 != dk4fput_stdout_initialized) {
fflush(stdout);
(void)_setmode(_fileno(stdout), dk4fput_stdout_oldmode);
@@ -129,7 +120,7 @@ dk4fput_cleanup_stdout(void)
void
dk4fput_initialize_stderr(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 == dk4fput_stderr_initialized) {
dk4fput_stderr_oldmode = _setmode(_fileno(stderr), _O_U16TEXT);
if (0 == _isatty(_fileno(stderr))) {
@@ -145,7 +136,7 @@ dk4fput_initialize_stderr(void)
void
dk4fput_initialize_stderr_no_bom(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 == dk4fput_stderr_initialized) {
dk4fput_stderr_oldmode = _setmode(_fileno(stderr), _O_U16TEXT);
dk4fput_stderr_initialized = 1;
@@ -158,7 +149,7 @@ dk4fput_initialize_stderr_no_bom(void)
void
dk4fput_cleanup_stderr(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 != dk4fput_stderr_initialized) {
fflush(stderr);
(void)_setmode(_fileno(stdout), dk4fput_stderr_oldmode);
@@ -168,25 +159,47 @@ dk4fput_cleanup_stderr(void)
void
-dk4fput_initialize_file(FILE *fipo)
+dk4fput_initialize_file(
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
+ FILE *fipo
+#else
+ FILE * DK4_ARG_UNUSED(fipo)
+#endif
+)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
(void)_setmode(_fileno(fipo), _O_U16TEXT);
fputwc(0xFEFF, fipo);
}
+#else
+ DK4_UNUSED_ARG(fipo)
#endif
}
void
-dk4fput_initialize_file_no_bom(FILE *fipo)
+dk4fput_initialize_file_no_bom(
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
+ FILE *fipo
+#else
+ FILE * DK4_ARG_UNUSED(fipo)
+#endif
+)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
(void)_setmode(_fileno(fipo), _O_U16TEXT);
}
+#else
+ DK4_UNUSED_ARG(fipo)
#endif
}
@@ -201,7 +214,10 @@ dk4fputc(dkChar c, FILE *fipo, dk4_er_t *erp)
int back = 0;
-#line 289 "dk4fput.ctr"
+#line 336 "dk4fput.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
errno = 0;
if (WEOF != fputwc(c, fipo)) {
@@ -213,7 +229,7 @@ dk4fputc(dkChar c, FILE *fipo, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 299 "dk4fput.ctr"
+#line 349 "dk4fput.ctr"
return back;
#else
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
@@ -225,6 +241,9 @@ dk4fputc(dkChar c, FILE *fipo, dk4_er_t *erp)
#endif
#else
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
errno = 0;
if (EOF != fputc(c, fipo)) {
@@ -248,6 +267,10 @@ dk4fputs(const dkChar *s, FILE *fipo, dk4_er_t *erp)
#if DK4_CHAR_SIZE == DK4_SIZEOF_WCHAR_T
#if DK4_HAVE_FPUTWS
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != s);
+#endif
if ((NULL != s) && (NULL != fipo)) {
errno = 0;
if (WEOF != fputws(s, fipo)) {
@@ -269,6 +292,10 @@ dk4fputs(const dkChar *s, FILE *fipo, dk4_er_t *erp)
#endif
#else
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != s);
+#endif
if ((NULL != s) && (NULL != fipo)) {
errno = 0;
if (EOF != fputs(s, fipo)) {
diff --git a/support/dktools/dk4fput.ctr b/support/dktools/dk4fput.ctr
index 648b244cb4..3e1328d012 100644
--- a/support/dktools/dk4fput.ctr
+++ b/support/dktools/dk4fput.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -127,6 +139,7 @@ dk4fputs(const dkChar *s, FILE *fipo, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4fput.h"
#if DK4_HAVE_IO_H
@@ -143,13 +156,25 @@ dk4fputs(const dkChar *s, FILE *fipo, dk4_er_t *erp);
#endif
#endif
+#ifndef DK4REC26_H_INCLUDED
+#include "dk4rec26.h"
+#endif
+
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
/** Flag: Standard output initialized to write dkChar.
*/
@@ -174,7 +199,7 @@ static int dk4fput_stderr_oldmode = _O_TEXT;
void
dk4fput_initialize_stdout(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 == dk4fput_stdout_initialized) {
dk4fput_stdout_oldmode = _setmode(_fileno(stdout), _O_U16TEXT);
if (0 == _isatty(_fileno(stdout))) {
@@ -190,7 +215,7 @@ dk4fput_initialize_stdout(void)
void
dk4fput_initialize_stdout_no_bom(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 == dk4fput_stdout_initialized) {
dk4fput_stdout_oldmode = _setmode(_fileno(stdout), _O_U16TEXT);
dk4fput_stdout_initialized = 1;
@@ -202,7 +227,7 @@ dk4fput_initialize_stdout_no_bom(void)
void
dk4fput_cleanup_stdout(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 != dk4fput_stdout_initialized) {
fflush(stdout);
(void)_setmode(_fileno(stdout), dk4fput_stdout_oldmode);
@@ -215,7 +240,7 @@ dk4fput_cleanup_stdout(void)
void
dk4fput_initialize_stderr(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 == dk4fput_stderr_initialized) {
dk4fput_stderr_oldmode = _setmode(_fileno(stderr), _O_U16TEXT);
if (0 == _isatty(_fileno(stderr))) {
@@ -231,7 +256,7 @@ dk4fput_initialize_stderr(void)
void
dk4fput_initialize_stderr_no_bom(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 == dk4fput_stderr_initialized) {
dk4fput_stderr_oldmode = _setmode(_fileno(stderr), _O_U16TEXT);
dk4fput_stderr_initialized = 1;
@@ -244,7 +269,7 @@ dk4fput_initialize_stderr_no_bom(void)
void
dk4fput_cleanup_stderr(void)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
if (0 != dk4fput_stderr_initialized) {
fflush(stderr);
(void)_setmode(_fileno(stdout), dk4fput_stderr_oldmode);
@@ -254,25 +279,47 @@ dk4fput_cleanup_stderr(void)
void
-dk4fput_initialize_file(FILE *fipo)
+dk4fput_initialize_file(
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
+ FILE *fipo
+#else
+ FILE * DK4_ARG_UNUSED(fipo)
+#endif
+)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
(void)_setmode(_fileno(fipo), _O_U16TEXT);
fputwc(0xFEFF, fipo);
}
+#else
+ DK4_UNUSED_ARG(fipo)
#endif
}
void
-dk4fput_initialize_file_no_bom(FILE *fipo)
+dk4fput_initialize_file_no_bom(
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
+ FILE *fipo
+#else
+ FILE * DK4_ARG_UNUSED(fipo)
+#endif
+)
{
-#if DK4_ON_WINDOWS && (DK4_CHAR_SIZE > 1)
+#if _WIN32 && (DK4_CHAR_SIZE > 1) && DK4_HAVE__SETMODE && defined(_MSC_VER)
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
(void)_setmode(_fileno(fipo), _O_U16TEXT);
}
+#else
+ DK4_UNUSED_ARG(fipo)
#endif
}
@@ -285,7 +332,10 @@ dk4fputc(dkChar c, FILE *fipo, dk4_er_t *erp)
#if DK4_CHAR_SIZE == DK4_SIZEOF_WCHAR_T
#if DK4_HAVE_FPUTWC
int back = 0;
- $? "+ dk4fputc (wide) %lx", (unsigned long)c
+ $? "+ dk4fputc (wide) %lx", dk4recode_dk_to_ul(c)
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
errno = 0;
if (WEOF != fputwc(c, fipo)) {
@@ -307,6 +357,9 @@ dk4fputc(dkChar c, FILE *fipo, dk4_er_t *erp)
#endif
#else
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
errno = 0;
if (EOF != fputc(c, fipo)) {
@@ -330,6 +383,10 @@ dk4fputs(const dkChar *s, FILE *fipo, dk4_er_t *erp)
#if DK4_CHAR_SIZE == DK4_SIZEOF_WCHAR_T
#if DK4_HAVE_FPUTWS
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != s);
+#endif
if ((NULL != s) && (NULL != fipo)) {
errno = 0;
if (WEOF != fputws(s, fipo)) {
@@ -351,6 +408,10 @@ dk4fputs(const dkChar *s, FILE *fipo, dk4_er_t *erp)
#endif
#else
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != s);
+#endif
if ((NULL != s) && (NULL != fipo)) {
errno = 0;
if (EOF != fputs(s, fipo)) {
diff --git a/support/dktools/dk4fput.h b/support/dktools/dk4fput.h
index a43a96cfae..2960415798 100644
--- a/support/dktools/dk4fput.h
+++ b/support/dktools/dk4fput.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fput.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fput.ctr
*/
#ifndef DK4FPUT_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
diff --git a/support/dktools/dk4fs.c b/support/dktools/dk4fs.c
index afaa7920af..93dc7aa8b4 100644
--- a/support/dktools/dk4fs.c
+++ b/support/dktools/dk4fs.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fs.ctr
*/
/** @file dk4fs.c The dk4fs module.
*/
-#line 493 "dk4fs.ctr"
+#line 687 "dk4fs.ctr"
+#include "dk4conf.h"
#include "dk4fs.h"
#if 0
@@ -61,12 +40,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4strd.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 520 "dk4fs.ctr"
+#line 721 "dk4fs.ctr"
@@ -97,10 +82,19 @@ dkT("dk3app"),
/* 7 */
dkT(".dk3app"),
+/* 8 */
+dkT("doc"),
+
+/* 9 */
+dkT("help"),
+
+/* 10 */
+dkT("en"),
+
NULL
-#line 551 "dk4fs.ctr"
+#line 758 "dk4fs.ctr"
};
@@ -191,7 +185,11 @@ dk4fs_attempt_file_name(
int back = 0;
-#line 640 "dk4fs.ctr"
+#line 847 "dk4fs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (0 < szdptr)) {
#if DK4_ON_WINDOWS && DK4_WIN_DENY_CRT
/* Compression/decompression libraries depend on CRT.
@@ -200,11 +198,11 @@ dk4fs_attempt_file_name(
#endif
-#line 647 "dk4fs.ctr"
+#line 858 "dk4fs.ctr"
back = dk4file_is_regular(dptr, erp);
-#line 649 "dk4fs.ctr"
+#line 860 "dk4fs.ctr"
if ((0 == back) && (0 != compressed)) {
eptr = dptr;
while (dkT('\0') != *eptr) { eptr++; }
@@ -212,11 +210,11 @@ dk4fs_attempt_file_name(
if (0 != dk4str_cat_s(dptr, szdptr, dk4fs_kw[3], erp)) {
-#line 655 "dk4fs.ctr"
+#line 866 "dk4fs.ctr"
back = dk4file_is_regular(dptr, erp);
-#line 657 "dk4fs.ctr"
+#line 868 "dk4fs.ctr"
}
#endif
#if DK4_HAVE_BZLIB_H
@@ -225,11 +223,11 @@ dk4fs_attempt_file_name(
if (0 != dk4str_cat_s(dptr, szdptr, dk4fs_kw[4], erp)) {
-#line 664 "dk4fs.ctr"
+#line 875 "dk4fs.ctr"
back = dk4file_is_regular(dptr, erp);
-#line 666 "dk4fs.ctr"
+#line 877 "dk4fs.ctr"
}
if (0 == back) {
*eptr = dkT('\0');
@@ -241,7 +239,7 @@ dk4fs_attempt_file_name(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 676 "dk4fs.ctr"
+#line 887 "dk4fs.ctr"
return back;
}
@@ -261,7 +259,13 @@ dk4fs_construct_from_parts(
int back = 0; /* Function result */
-#line 694 "dk4fs.ctr"
+#line 905 "dk4fs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != comp);
+ assert(0 < ncomp);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != comp) && (0 < ncomp)) {
for (i = 0; i < ncomp; i++) {
if (0 == i) {
@@ -292,7 +296,7 @@ dk4fs_construct_from_parts(
if (0 == back) { *dptr = dkT('\0'); }
-#line 723 "dk4fs.ctr"
+#line 940 "dk4fs.ctr"
return back;
}
@@ -317,7 +321,12 @@ dk4fs_config_construct_compat_one(
int back = 0;
-#line 746 "dk4fs.ctr"
+#line 963 "dk4fs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != shortname)) {
switch (passno) {
case DK4_FS_CONF_SHARE_LIB: {
@@ -485,7 +494,7 @@ dk4fs_config_construct_compat_one(
}
-#line 912 "dk4fs.ctr"
+#line 1134 "dk4fs.ctr"
return back;
}
@@ -505,6 +514,11 @@ dk4fs_config_construct_one(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
return(
dk4fs_config_construct_compat_one(
dptr, szdptr, shortname, dir_share, dir_etc, dir_home,
@@ -534,7 +548,12 @@ dk4fs_config_compat_one(
int back;
-#line 959 "dk4fs.ctr"
+#line 1186 "dk4fs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
back = dk4fs_config_construct_compat_one(
dptr, szdptr, shortname,
dir_share, dir_etc, dir_home,
@@ -543,15 +562,15 @@ dk4fs_config_compat_one(
if (0 != back) {
-#line 966 "dk4fs.ctr"
+#line 1198 "dk4fs.ctr"
back = dk4fs_attempt_file_name(dptr, szdptr, compressed, erp);
if (0 != back) {
-#line 968 "dk4fs.ctr"
+#line 1200 "dk4fs.ctr"
}
}
-#line 970 "dk4fs.ctr"
+#line 1202 "dk4fs.ctr"
return back;
}
@@ -572,6 +591,11 @@ dk4fs_config_one(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
return (
dk4fs_config_compat_one(
dptr, szdptr, shortname,
@@ -600,33 +624,38 @@ dk4fs_data_construct_one(
{
const dkChar *ptrs[8];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
-#line 1019 "dk4fs.ctr"
+#line 1261 "dk4fs.ctr"
-#line 1020 "dk4fs.ctr"
+#line 1262 "dk4fs.ctr"
-#line 1021 "dk4fs.ctr"
+#line 1263 "dk4fs.ctr"
-#line 1022 "dk4fs.ctr"
+#line 1264 "dk4fs.ctr"
-#line 1023 "dk4fs.ctr"
+#line 1265 "dk4fs.ctr"
-#line 1024 "dk4fs.ctr"
+#line 1266 "dk4fs.ctr"
-#line 1025 "dk4fs.ctr"
+#line 1267 "dk4fs.ctr"
-#line 1026 "dk4fs.ctr"
+#line 1268 "dk4fs.ctr"
-#line 1027 "dk4fs.ctr"
+#line 1269 "dk4fs.ctr"
if ((NULL != dptr) && (0 < szdptr) && (NULL != shortname)) {
switch (passno) {
@@ -939,13 +968,341 @@ dk4fs_data_construct_one(
}
-#line 1338 "dk4fs.ctr"
+#line 1580 "dk4fs.ctr"
return back;
}
int
+dk4fs_doc_construct_one(
+ dkChar *dptr,
+ size_t szdptr,
+ const dkChar *shortname,
+ const dkChar *dir_share,
+ const dkChar *language,
+ const dkChar *region,
+ const dkChar *name_prog,
+ const dkChar *name_group,
+ int passno,
+ dk4_er_t *erp
+)
+{
+ const dkChar *ptrs[8];
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
+
+
+#line 1607 "dk4fs.ctr"
+
+
+#line 1608 "dk4fs.ctr"
+
+
+#line 1609 "dk4fs.ctr"
+
+
+#line 1610 "dk4fs.ctr"
+
+
+#line 1611 "dk4fs.ctr"
+
+
+#line 1612 "dk4fs.ctr"
+
+
+#line 1613 "dk4fs.ctr"
+
+
+#line 1614 "dk4fs.ctr"
+ if ((NULL != dptr) && (0 < szdptr) && (NULL != shortname)) {
+ switch (passno) {
+ case DK4_FS_DOC_GROUP_HELP_PROG_LANG_REG : {
+ if (
+ (NULL != dir_share) && (NULL != language) && (NULL != region)
+ && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = name_prog;
+ ptrs[4] = language;
+ ptrs[5] = region;
+ ptrs[6] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,7,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_PROG_LANG_REG : {
+ if (
+ (NULL != dir_share) && (NULL != language) && (NULL != region)
+ && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = name_prog;
+ ptrs[5] = language;
+ ptrs[6] = region;
+ ptrs[7] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,8,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_PROG_LANG : {
+ if (
+ (NULL != dir_share) && (NULL != language)
+ && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = name_prog;
+ ptrs[4] = language;
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_PROG_LANG : {
+ if (
+ (NULL != dir_share) && (NULL != language)
+ && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = name_prog;
+ ptrs[5] = language;
+ ptrs[6] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,7,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_PROG_EN : {
+ if (
+ (NULL != dir_share) && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = name_prog;
+ ptrs[4] = dk4fs_kw[10];
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_PROG_EN : {
+ if (
+ (NULL != dir_share) && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = name_prog;
+ ptrs[5] = dk4fs_kw[10];
+ ptrs[6] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,7,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_PROG : {
+ if (
+ (NULL != dir_share) && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = name_prog;
+ ptrs[4] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,5,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_PROG : {
+ if (
+ (NULL != dir_share) && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = name_prog;
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_LANG_REG : {
+ if (
+ (NULL != dir_share) && (NULL != language) && (NULL != region)
+ && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = language;
+ ptrs[4] = region;
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_LANG_REG : {
+ if (
+ (NULL != dir_share) && (NULL != language) && (NULL != region)
+ && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = language;
+ ptrs[5] = region;
+ ptrs[6] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,7,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_LANG : {
+ if (
+ (NULL != dir_share) && (NULL != language)
+ && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = language;
+ ptrs[4] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,5,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_LANG : {
+ if (
+ (NULL != dir_share) && (NULL != language)
+ && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = language;
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_EN : {
+ if (
+ (NULL != dir_share) && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = dk4fs_kw[10];
+ ptrs[4] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,5,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_EN : {
+ if (
+ (NULL != dir_share) && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = dk4fs_kw[10];
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP : {
+ if (
+ (NULL != dir_share) && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,4,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP : {
+ if (
+ (NULL != dir_share) && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,5,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1889 "dk4fs.ctr"
+ return back;
+}
+
+
+
+
+int
dk4fs_data_one(
dkChar *dptr,
size_t szdptr,
@@ -964,7 +1321,12 @@ dk4fs_data_one(
int back;
-#line 1361 "dk4fs.ctr"
+#line 1913 "dk4fs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
back = dk4fs_data_construct_one(
dptr, szdptr, shortname,
dir_share, language, region, dir_home,
@@ -972,11 +1334,51 @@ dk4fs_data_one(
);
if (0 != back) {
-#line 1367 "dk4fs.ctr"
+#line 1924 "dk4fs.ctr"
back = dk4fs_attempt_file_name(dptr, szdptr, compressed, erp);
}
-#line 1369 "dk4fs.ctr"
+#line 1926 "dk4fs.ctr"
+ return back;
+}
+
+
+
+int
+dk4fs_doc_one(
+ dkChar *dptr,
+ size_t szdptr,
+ const dkChar *shortname,
+ const dkChar *dir_share,
+ const dkChar *name_prog,
+ const dkChar *name_group,
+ const dkChar *language,
+ const dkChar *region,
+ int passno,
+ dk4_er_t *erp
+)
+{
+ int back;
+
+
+#line 1947 "dk4fs.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
+ back = dk4fs_doc_construct_one(
+ dptr, szdptr, shortname, dir_share, language, region,
+ name_prog, name_group, passno, erp
+ );
+ if (0 != back) {
+
+#line 1957 "dk4fs.ctr"
+ back = dk4fs_attempt_file_name(dptr, szdptr, 0, erp);
+ }
+
+
+#line 1960 "dk4fs.ctr"
return back;
}
diff --git a/support/dktools/dk4fs.ctr b/support/dktools/dk4fs.ctr
index 75f0dc75cd..5b2ed2b466 100644
--- a/support/dktools/dk4fs.ctr
+++ b/support/dktools/dk4fs.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -26,15 +26,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -119,6 +131,87 @@ enum {
};
+/** Pass numbers for documentation and help file search.
+*/
+enum {
+
+ /** /usr/share/dktools/help/wxdkdraw/de/de. */
+
+ DK4_FS_DOC_GROUP_HELP_PROG_LANG_REG = 0,
+
+ /** /usr/share/doc/dktools/help/wxdkdraw/de/de. */
+
+ DK4_FS_DOC_DOC_GROUP_PROG_LANG_REG ,
+
+ /** /usr/share/dktools/help/wxdkdraw/de. */
+
+ DK4_FS_DOC_GROUP_HELP_PROG_LANG ,
+
+ /** /usr/share/doc/dktools/help/wxdkdraw/de. */
+
+ DK4_FS_DOC_DOC_GROUP_PROG_LANG ,
+
+ /* The en subdirectory is used as fallback if no file in current
+ language is available.
+ */
+
+ /** /usr/share/dktools/help/wxdkdraw/en. */
+
+ DK4_FS_DOC_GROUP_HELP_PROG_EN ,
+
+ /** /usr/share/doc/dktools/help/wxdkdraw/en. */
+
+ DK4_FS_DOC_DOC_GROUP_PROG_EN ,
+
+ /** /usr/share/dktools/help/wxdkdraw. */
+
+ DK4_FS_DOC_GROUP_HELP_PROG ,
+
+ /** /usr/share/doc/dktools/help/wxdkdraw. */
+
+ DK4_FS_DOC_DOC_GROUP_PROG ,
+
+ /** /usr/share/dktools/help/de/de. */
+
+ DK4_FS_DOC_GROUP_HELP_LANG_REG ,
+
+ /** /usr/share/doc/dktools/help/de/de. */
+
+ DK4_FS_DOC_DOC_GROUP_LANG_REG ,
+
+ /** /usr/share/dktools/help/de. */
+
+ DK4_FS_DOC_GROUP_HELP_LANG ,
+
+ /** /usr/share/doc/dktools/help/de. */
+
+ DK4_FS_DOC_DOC_GROUP_LANG ,
+
+ /* The en subdirectory is used as fallback if no file in current
+ language is available.
+ */
+
+ /** /usr/share/dktools/help/en. */
+
+ DK4_FS_DOC_GROUP_HELP_EN ,
+
+ /** /usr/share/doc/dktools/help/en. */
+
+ DK4_FS_DOC_DOC_GROUP_EN ,
+
+ /** /usr/share/dktools/help. */
+
+ DK4_FS_DOC_GROUP_HELP ,
+
+ /** /usr/share/doc/dktools/help. */
+
+ DK4_FS_DOC_DOC_GROUP ,
+
+ DK4_FS_DOC_MAX = DK4_FS_DOC_DOC_GROUP /**< Maximum. */
+};
+
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -483,6 +576,107 @@ dk4fs_data_one(
dk4_er_t *erp
);
+/** Attempt to construct one path name for a documentation or help file.
+ CRT on Windows: Optional.
+ @param dptr Buffer for result file name.
+ @param szdptr Size of buffer (number of dkChar).
+ @param shortname Short configuration file name.
+ @param dir_share The data directory.
+ @param language Users language.
+ @param region Users region.
+ @param name_prog Application name.
+ @param name_group Application group name.
+ @param passno Number of current pass.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr or shortname is NULL or szdptr is 0 or passno is an invalid
+ number or one of the used strings (dir_share, dir_home, language,
+ region, name_prog, or name_group) is NULL,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dptr buffer is too small,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow happened during a size calculation.
+*/
+int
+dk4fs_doc_construct_one(
+ dkChar *dptr,
+ size_t szdptr,
+ const dkChar *shortname,
+ const dkChar *dir_share,
+ const dkChar *language,
+ const dkChar *region,
+ const dkChar *name_prog,
+ const dkChar *name_group,
+ int passno,
+ dk4_er_t *erp
+);
+
+/** Check one path candidate for documentation or help file name
+ (construct file name and check presence).
+
+ To search for a file, use this function multiple times with different
+ passno values:
+ - Start with DK4_FS_DOC_GROUP_HELP_PROG_LANG_REG.
+ - Increase the pass number up to (including) DK4_FS_DOC_MAX.
+ - Use the first file found.
+
+ CRT on Windows: Optional.
+ @param dptr Buffer for result file name.
+ @param szdptr Size of buffer (number of dkChar).
+ @param shortname Short configuration file name.
+ @param dir_share The data directory.
+ @param name_prog Application name.
+ @param name_group Application group name.
+ @param language Users preferred language.
+ @param region Users region (country code).
+ @param passno Number of current pass.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ The function searches for the file <i>shortname</i> in the
+ following directories, first file found is returned:
+ - /usr/share/<i>group</i>/help/<i>program</i>/<i>language</i>/<i>region</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/<i>language</i>/<i>region</i>
+ - /usr/share/<i>group</i>/help/<i>program</i>/<i>language</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/<i>language</i>
+ - /usr/share/<i>group</i>/help/<i>program</i>/en
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/en
+ - /usr/share/<i>group</i>/help/<i>program</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>
+
+ For a relocated installation replace /usr/share by ${datadir}.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr or shortname is NULL or szdptr is 0 or passno is an invalid
+ number or one of the used strings (dir_share, dir_home, language,
+ region, name_prog, or name_group) is NULL,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dptr buffer is too small,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow happened during a size calculation,
+ - DK4_E_NOT_FOUND<br>
+ if no file was found,
+ - DK4_E_NOT_SUPPORTED<br>
+ if wchar_t are used as dkChar on non-Windows systems.
+*/
+int
+dk4fs_doc_one(
+ dkChar *dptr,
+ size_t szdptr,
+ const dkChar *shortname,
+ const dkChar *dir_share,
+ const dkChar *name_prog,
+ const dkChar *name_group,
+ const dkChar *language,
+ const dkChar *region,
+ int passno,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
@@ -491,6 +685,7 @@ dk4fs_data_one(
%% module
+#include "dk4conf.h"
#include "dk4fs.h"
#if 0
@@ -513,6 +708,12 @@ dk4fs_data_one(
#include "dk4strd.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
@@ -547,6 +748,12 @@ no-language
#
dk3app
.dk3app
+#
+# 8 ... 10 Directory names for help files
+#
+doc
+help
+en
$!end
};
@@ -637,6 +844,10 @@ dk4fs_attempt_file_name(
dkChar *eptr; /* End of name */
int back = 0;
$? "+ dk4fs_attempt_file_name"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (0 < szdptr)) {
#if DK4_ON_WINDOWS && DK4_WIN_DENY_CRT
/* Compression/decompression libraries depend on CRT.
@@ -691,6 +902,12 @@ dk4fs_construct_from_parts(
size_t i; /* Traverse comp */
int back = 0; /* Function result */
$? "+ dk4fs_construct_from_parts"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != comp);
+ assert(0 < ncomp);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != comp) && (0 < ncomp)) {
for (i = 0; i < ncomp; i++) {
if (0 == i) {
@@ -743,6 +960,11 @@ dk4fs_config_construct_compat_one(
const dkChar *ptrs[8];
int back = 0;
$? "+ dk4fs_config_construct_compact_one"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != shortname)) {
switch (passno) {
case DK4_FS_CONF_SHARE_LIB: {
@@ -928,6 +1150,11 @@ dk4fs_config_construct_one(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
return(
dk4fs_config_construct_compat_one(
dptr, szdptr, shortname, dir_share, dir_etc, dir_home,
@@ -956,6 +1183,11 @@ dk4fs_config_compat_one(
{
int back;
$? "+ dk4fs_config_compat_one \"%!ds\" %d", shortname, passno
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
back = dk4fs_config_construct_compat_one(
dptr, szdptr, shortname,
dir_share, dir_etc, dir_home,
@@ -987,6 +1219,11 @@ dk4fs_config_one(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
return (
dk4fs_config_compat_one(
dptr, szdptr, shortname,
@@ -1015,6 +1252,11 @@ dk4fs_data_construct_one(
{
const dkChar *ptrs[8];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
$? "+ dk4fs_data_construct_one"
$? ". short name = \"%!ds\"", TR_DKSTR(shortname)
$? ". /.../share = \"%!ds\"", TR_DKSTR(dir_share)
@@ -1341,6 +1583,316 @@ dk4fs_data_construct_one(
int
+dk4fs_doc_construct_one(
+ dkChar *dptr,
+ size_t szdptr,
+ const dkChar *shortname,
+ const dkChar *dir_share,
+ const dkChar *language,
+ const dkChar *region,
+ const dkChar *name_prog,
+ const dkChar *name_group,
+ int passno,
+ dk4_er_t *erp
+)
+{
+ const dkChar *ptrs[8];
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
+ $? "+ dk4fs_doc_construct_one"
+ $? ". short name = \"%!ds\"", TR_DKSTR(shortname)
+ $? ". /.../share = \"%!ds\"", TR_DKSTR(dir_share)
+ $? ". language = \"%!ds\"", TR_DKSTR(language)
+ $? ". region = \"%!ds\"", TR_DKSTR(region)
+ $? ". prog name = \"%!ds\"", TR_DKSTR(name_prog)
+ $? ". prog group = \"%!ds\"", TR_DKSTR(name_group)
+ $? ". pass no = %d", passno
+ if ((NULL != dptr) && (0 < szdptr) && (NULL != shortname)) {
+ switch (passno) {
+ case DK4_FS_DOC_GROUP_HELP_PROG_LANG_REG : {
+ if (
+ (NULL != dir_share) && (NULL != language) && (NULL != region)
+ && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = name_prog;
+ ptrs[4] = language;
+ ptrs[5] = region;
+ ptrs[6] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,7,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_PROG_LANG_REG : {
+ if (
+ (NULL != dir_share) && (NULL != language) && (NULL != region)
+ && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = name_prog;
+ ptrs[5] = language;
+ ptrs[6] = region;
+ ptrs[7] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,8,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_PROG_LANG : {
+ if (
+ (NULL != dir_share) && (NULL != language)
+ && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = name_prog;
+ ptrs[4] = language;
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_PROG_LANG : {
+ if (
+ (NULL != dir_share) && (NULL != language)
+ && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = name_prog;
+ ptrs[5] = language;
+ ptrs[6] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,7,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_PROG_EN : {
+ if (
+ (NULL != dir_share) && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = name_prog;
+ ptrs[4] = dk4fs_kw[10];
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_PROG_EN : {
+ if (
+ (NULL != dir_share) && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = name_prog;
+ ptrs[5] = dk4fs_kw[10];
+ ptrs[6] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,7,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_PROG : {
+ if (
+ (NULL != dir_share) && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = name_prog;
+ ptrs[4] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,5,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_PROG : {
+ if (
+ (NULL != dir_share) && (NULL != name_group) && (NULL != name_prog)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = name_prog;
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_LANG_REG : {
+ if (
+ (NULL != dir_share) && (NULL != language) && (NULL != region)
+ && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = language;
+ ptrs[4] = region;
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_LANG_REG : {
+ if (
+ (NULL != dir_share) && (NULL != language) && (NULL != region)
+ && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = language;
+ ptrs[5] = region;
+ ptrs[6] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,7,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_LANG : {
+ if (
+ (NULL != dir_share) && (NULL != language)
+ && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = language;
+ ptrs[4] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,5,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_LANG : {
+ if (
+ (NULL != dir_share) && (NULL != language)
+ && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = language;
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP_EN : {
+ if (
+ (NULL != dir_share) && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = dk4fs_kw[10];
+ ptrs[4] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,5,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP_EN : {
+ if (
+ (NULL != dir_share) && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = dk4fs_kw[10];
+ ptrs[5] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,6,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_GROUP_HELP : {
+ if (
+ (NULL != dir_share) && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = name_group;
+ ptrs[2] = dk4fs_kw[9];
+ ptrs[3] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,4,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ case DK4_FS_DOC_DOC_GROUP : {
+ if (
+ (NULL != dir_share) && (NULL != name_group)
+ ) {
+ ptrs[0] = dir_share;
+ ptrs[1] = dk4fs_kw[8];
+ ptrs[2] = name_group;
+ ptrs[3] = dk4fs_kw[9];
+ ptrs[4] = shortname;
+ back = dk4fs_construct_from_parts(dptr,szdptr,ptrs,5,0,erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4fs_doc_construct_one %d", back
+ return back;
+}
+
+
+
+
+int
dk4fs_data_one(
dkChar *dptr,
size_t szdptr,
@@ -1358,6 +1910,11 @@ dk4fs_data_one(
{
int back;
$? "+ dk4fs_data_one %!ds %d", shortname, passno
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
back = dk4fs_data_construct_one(
dptr, szdptr, shortname,
dir_share, language, region, dir_home,
@@ -1369,3 +1926,37 @@ dk4fs_data_one(
return back;
}
+
+
+int
+dk4fs_doc_one(
+ dkChar *dptr,
+ size_t szdptr,
+ const dkChar *shortname,
+ const dkChar *dir_share,
+ const dkChar *name_prog,
+ const dkChar *name_group,
+ const dkChar *language,
+ const dkChar *region,
+ int passno,
+ dk4_er_t *erp
+)
+{
+ int back;
+ $? "+ dk4fs_doc_one"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != shortname);
+#endif
+ back = dk4fs_doc_construct_one(
+ dptr, szdptr, shortname, dir_share, language, region,
+ name_prog, name_group, passno, erp
+ );
+ if (0 != back) { $? ". test \"%!ds\"", TR_DKSTR(dptr)
+ back = dk4fs_attempt_file_name(dptr, szdptr, 0, erp);
+ }
+ $? "- dk4fs_doc_one %d", back
+ return back;
+}
+
diff --git a/support/dktools/dk4fs.h b/support/dktools/dk4fs.h
index fa8c90b136..47186ca0b8 100644
--- a/support/dktools/dk4fs.h
+++ b/support/dktools/dk4fs.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fs.ctr
*/
#ifndef DK4FS_H_INCLUDED
@@ -59,15 +37,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -152,6 +142,87 @@ enum {
};
+/** Pass numbers for documentation and help file search.
+*/
+enum {
+
+ /** /usr/share/dktools/help/wxdkdraw/de/de. */
+
+ DK4_FS_DOC_GROUP_HELP_PROG_LANG_REG = 0,
+
+ /** /usr/share/doc/dktools/help/wxdkdraw/de/de. */
+
+ DK4_FS_DOC_DOC_GROUP_PROG_LANG_REG ,
+
+ /** /usr/share/dktools/help/wxdkdraw/de. */
+
+ DK4_FS_DOC_GROUP_HELP_PROG_LANG ,
+
+ /** /usr/share/doc/dktools/help/wxdkdraw/de. */
+
+ DK4_FS_DOC_DOC_GROUP_PROG_LANG ,
+
+ /* The en subdirectory is used as fallback if no file in current
+ language is available.
+ */
+
+ /** /usr/share/dktools/help/wxdkdraw/en. */
+
+ DK4_FS_DOC_GROUP_HELP_PROG_EN ,
+
+ /** /usr/share/doc/dktools/help/wxdkdraw/en. */
+
+ DK4_FS_DOC_DOC_GROUP_PROG_EN ,
+
+ /** /usr/share/dktools/help/wxdkdraw. */
+
+ DK4_FS_DOC_GROUP_HELP_PROG ,
+
+ /** /usr/share/doc/dktools/help/wxdkdraw. */
+
+ DK4_FS_DOC_DOC_GROUP_PROG ,
+
+ /** /usr/share/dktools/help/de/de. */
+
+ DK4_FS_DOC_GROUP_HELP_LANG_REG ,
+
+ /** /usr/share/doc/dktools/help/de/de. */
+
+ DK4_FS_DOC_DOC_GROUP_LANG_REG ,
+
+ /** /usr/share/dktools/help/de. */
+
+ DK4_FS_DOC_GROUP_HELP_LANG ,
+
+ /** /usr/share/doc/dktools/help/de. */
+
+ DK4_FS_DOC_DOC_GROUP_LANG ,
+
+ /* The en subdirectory is used as fallback if no file in current
+ language is available.
+ */
+
+ /** /usr/share/dktools/help/en. */
+
+ DK4_FS_DOC_GROUP_HELP_EN ,
+
+ /** /usr/share/doc/dktools/help/en. */
+
+ DK4_FS_DOC_DOC_GROUP_EN ,
+
+ /** /usr/share/dktools/help. */
+
+ DK4_FS_DOC_GROUP_HELP ,
+
+ /** /usr/share/doc/dktools/help. */
+
+ DK4_FS_DOC_DOC_GROUP ,
+
+ DK4_FS_DOC_MAX = DK4_FS_DOC_DOC_GROUP /**< Maximum. */
+};
+
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -516,6 +587,107 @@ dk4fs_data_one(
dk4_er_t *erp
);
+/** Attempt to construct one path name for a documentation or help file.
+ CRT on Windows: Optional.
+ @param dptr Buffer for result file name.
+ @param szdptr Size of buffer (number of dkChar).
+ @param shortname Short configuration file name.
+ @param dir_share The data directory.
+ @param language Users language.
+ @param region Users region.
+ @param name_prog Application name.
+ @param name_group Application group name.
+ @param passno Number of current pass.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr or shortname is NULL or szdptr is 0 or passno is an invalid
+ number or one of the used strings (dir_share, dir_home, language,
+ region, name_prog, or name_group) is NULL,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dptr buffer is too small,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow happened during a size calculation.
+*/
+int
+dk4fs_doc_construct_one(
+ dkChar *dptr,
+ size_t szdptr,
+ const dkChar *shortname,
+ const dkChar *dir_share,
+ const dkChar *language,
+ const dkChar *region,
+ const dkChar *name_prog,
+ const dkChar *name_group,
+ int passno,
+ dk4_er_t *erp
+);
+
+/** Check one path candidate for documentation or help file name
+ (construct file name and check presence).
+
+ To search for a file, use this function multiple times with different
+ passno values:
+ - Start with DK4_FS_DOC_GROUP_HELP_PROG_LANG_REG.
+ - Increase the pass number up to (including) DK4_FS_DOC_MAX.
+ - Use the first file found.
+
+ CRT on Windows: Optional.
+ @param dptr Buffer for result file name.
+ @param szdptr Size of buffer (number of dkChar).
+ @param shortname Short configuration file name.
+ @param dir_share The data directory.
+ @param name_prog Application name.
+ @param name_group Application group name.
+ @param language Users preferred language.
+ @param region Users region (country code).
+ @param passno Number of current pass.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ The function searches for the file <i>shortname</i> in the
+ following directories, first file found is returned:
+ - /usr/share/<i>group</i>/help/<i>program</i>/<i>language</i>/<i>region</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/<i>language</i>/<i>region</i>
+ - /usr/share/<i>group</i>/help/<i>program</i>/<i>language</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/<i>language</i>
+ - /usr/share/<i>group</i>/help/<i>program</i>/en
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>/en
+ - /usr/share/<i>group</i>/help/<i>program</i>
+ - /usr/share/doc/<i>group</i>/help/<i>program</i>
+
+ For a relocated installation replace /usr/share by ${datadir}.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr or shortname is NULL or szdptr is 0 or passno is an invalid
+ number or one of the used strings (dir_share, dir_home, language,
+ region, name_prog, or name_group) is NULL,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dptr buffer is too small,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow happened during a size calculation,
+ - DK4_E_NOT_FOUND<br>
+ if no file was found,
+ - DK4_E_NOT_SUPPORTED<br>
+ if wchar_t are used as dkChar on non-Windows systems.
+*/
+int
+dk4fs_doc_one(
+ dkChar *dptr,
+ size_t szdptr,
+ const dkChar *shortname,
+ const dkChar *dir_share,
+ const dkChar *name_prog,
+ const dkChar *name_group,
+ const dkChar *language,
+ const dkChar *region,
+ int passno,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4ft.h b/support/dktools/dk4ft.h
index 3968c7de38..238d19c985 100644
--- a/support/dktools/dk4ft.h
+++ b/support/dktools/dk4ft.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK4FT_H_INCLUDED
#define DK4FT_H_INCLUDED 1
diff --git a/support/dktools/dk4ftime.c b/support/dktools/dk4ftime.c
index a2fc9bef38..84c0793520 100644
--- a/support/dktools/dk4ftime.c
+++ b/support/dktools/dk4ftime.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ftime.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ftime.ctr
*/
/** @file dk4ftime.c The dk4ftime module.
*/
-#line 187 "dk4ftime.ctr"
+#line 207 "dk4ftime.ctr"
+#include "dk4conf.h"
#include "dk4ftime.h"
#if !DK4_ON_WINDOWS
diff --git a/support/dktools/dk4ftime.ctr b/support/dktools/dk4ftime.ctr
index 949011fe93..970ed78946 100644
--- a/support/dktools/dk4ftime.ctr
+++ b/support/dktools/dk4ftime.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,19 +13,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIMEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4timec.h"
+#else
+#include <dktools-4/dk4timec.h>
+#endif
#endif
#if DK4_ON_WINDOWS
@@ -65,7 +81,11 @@ license = bsd
#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#endif
@@ -185,6 +205,7 @@ dk4filetime_to_text(
%% module
+#include "dk4conf.h"
#include "dk4ftime.h"
#if !DK4_ON_WINDOWS
diff --git a/support/dktools/dk4ftime.h b/support/dktools/dk4ftime.h
index 00b12fcb97..a4fd3d5994 100644
--- a/support/dktools/dk4ftime.h
+++ b/support/dktools/dk4ftime.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ftime.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ftime.ctr
*/
#ifndef DK4FTIME_H_INCLUDED
@@ -45,19 +23,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIMEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4timec.h"
+#else
+#include <dktools-4/dk4timec.h>
+#endif
#endif
#if DK4_ON_WINDOWS
@@ -97,7 +91,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#endif
diff --git a/support/dktools/dk4ftime08.c b/support/dktools/dk4ftime08.c
index 38904b53e2..f75b8b6354 100644
--- a/support/dktools/dk4ftime08.c
+++ b/support/dktools/dk4ftime08.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ftime08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ftime08.ctr
*/
/** @file dk4ftime08.c The dk4ftime08 module.
@@ -39,6 +17,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4ftime08.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ftime.h"
#ifndef DK4TIME08_H_INCLUDED
@@ -59,6 +46,11 @@ dk4filetime_to_text_c8(
SYSTEMTIME st1;
SYSTEMTIME st2;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
if ((NULL != dptr) && (NULL != fit) && (0 < dsz)) {
if (FileTimeToSystemTime(fit, &st1)) {
if (SystemTimeToTzSpecificLocalTime(NULL, &st1, &st2)) {
@@ -81,6 +73,11 @@ dk4filetime_to_text_c8(
}
return back;
#else
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
return (dk4time_as_text_c8(dptr, dsz, fit, erp));
#endif
}
diff --git a/support/dktools/dk4ftime08.ctr b/support/dktools/dk4ftime08.ctr
index e191a73614..a9fb9cd83d 100644
--- a/support/dktools/dk4ftime08.ctr
+++ b/support/dktools/dk4ftime08.ctr
@@ -2,12 +2,21 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ftime.h"
#ifndef DK4TIME08_H_INCLUDED
@@ -28,6 +37,11 @@ dk4filetime_to_text_c8(
SYSTEMTIME st1;
SYSTEMTIME st2;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
if ((NULL != dptr) && (NULL != fit) && (0 < dsz)) {
if (FileTimeToSystemTime(fit, &st1)) {
if (SystemTimeToTzSpecificLocalTime(NULL, &st1, &st2)) {
@@ -50,6 +64,11 @@ dk4filetime_to_text_c8(
}
return back;
#else
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
return (dk4time_as_text_c8(dptr, dsz, fit, erp));
#endif
}
diff --git a/support/dktools/dk4ftimedk.c b/support/dktools/dk4ftimedk.c
index 1f3084f70a..d1748e911a 100644
--- a/support/dktools/dk4ftimedk.c
+++ b/support/dktools/dk4ftimedk.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ftimedk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ftimedk.ctr
*/
/** @file dk4ftimedk.c The dk4ftimedk module.
@@ -39,6 +17,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4ftimedk.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ftime.h"
#ifndef DK4TIMEWC_H_INCLUDED
@@ -56,6 +43,11 @@ dk4filetime_to_text(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4filetime_to_text_wc(dptr, dsz, fit, erp));
#else
diff --git a/support/dktools/dk4ftimedk.ctr b/support/dktools/dk4ftimedk.ctr
index d9a82b4059..fb6bdcf6bd 100644
--- a/support/dktools/dk4ftimedk.ctr
+++ b/support/dktools/dk4ftimedk.ctr
@@ -2,12 +2,21 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ftime.h"
#ifndef DK4TIMEWC_H_INCLUDED
@@ -25,6 +34,11 @@ dk4filetime_to_text(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4filetime_to_text_wc(dptr, dsz, fit, erp));
#else
diff --git a/support/dktools/dk4ftimewc.c b/support/dktools/dk4ftimewc.c
index aa81d52e0f..b5ca437ea5 100644
--- a/support/dktools/dk4ftimewc.c
+++ b/support/dktools/dk4ftimewc.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ftimewc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ftimewc.ctr
*/
/** @file dk4ftimewc.c The dk4ftimewc module.
@@ -39,6 +17,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4ftimewc.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ftime.h"
#ifndef DK4TIMEWC_H_INCLUDED
@@ -59,6 +46,11 @@ dk4filetime_to_text_wc(
SYSTEMTIME st1;
SYSTEMTIME st2;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
if ((NULL != dptr) && (NULL != fit) && (0 < dsz)) {
if (FileTimeToSystemTime(fit, &st1)) {
if (SystemTimeToTzSpecificLocalTime(NULL, &st1, &st2)) {
@@ -81,6 +73,11 @@ dk4filetime_to_text_wc(
}
return back;
#else
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
return (dk4time_as_text_wc(dptr, dsz, fit, erp));
#endif
}
diff --git a/support/dktools/dk4ftimewc.ctr b/support/dktools/dk4ftimewc.ctr
index e526aa9ea7..3133f30826 100644
--- a/support/dktools/dk4ftimewc.ctr
+++ b/support/dktools/dk4ftimewc.ctr
@@ -2,12 +2,21 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ftime.h"
#ifndef DK4TIMEWC_H_INCLUDED
@@ -28,6 +37,11 @@ dk4filetime_to_text_wc(
SYSTEMTIME st1;
SYSTEMTIME st2;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
if ((NULL != dptr) && (NULL != fit) && (0 < dsz)) {
if (FileTimeToSystemTime(fit, &st1)) {
if (SystemTimeToTzSpecificLocalTime(NULL, &st1, &st2)) {
@@ -50,6 +64,11 @@ dk4filetime_to_text_wc(
}
return back;
#else
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != fit);
+#endif
return (dk4time_as_text_wc(dptr, dsz, fit, erp));
#endif
}
diff --git a/support/dktools/dk4fwra.c b/support/dktools/dk4fwra.c
index 396985c361..1d027bcd3a 100644
--- a/support/dktools/dk4fwra.c
+++ b/support/dktools/dk4fwra.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fwra.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fwra.ctr
*/
/** @file dk4fwra.c The dk4fwra module.
*/
-#line 55 "dk4fwra.ctr"
+#line 66 "dk4fwra.ctr"
+#include "dk4conf.h"
#include "dk4fwra.h"
#if DK4_HAVE_ERRNO_H
@@ -74,7 +53,7 @@ dk4fwrite_app(
}
} else {
-#line 90 "dk4fwra.ctr"
+#line 102 "dk4fwra.ctr"
}
return back;
}
diff --git a/support/dktools/dk4fwra.ctr b/support/dktools/dk4fwra.ctr
index b5fd7b57e6..7267b9982f 100644
--- a/support/dktools/dk4fwra.ctr
+++ b/support/dktools/dk4fwra.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,14 +12,25 @@ license = bsd
Write to file using fwrite(), report errors immediately.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef STDIO_H_INCLUDED
#include <stdio.h>
#define STDIO_H_INCLUDED 1
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
-#define DK4APP_H_INCLUDED 1
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
#ifdef __cplusplus
@@ -53,6 +64,7 @@ dk4fwrite_app(
%% module
+#include "dk4conf.h"
#include "dk4fwra.h"
#if DK4_HAVE_ERRNO_H
diff --git a/support/dktools/dk4fwra.h b/support/dktools/dk4fwra.h
index d30548a696..c857cd90ce 100644
--- a/support/dktools/dk4fwra.h
+++ b/support/dktools/dk4fwra.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4fwra.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4fwra.ctr
*/
#ifndef DK4FWRA_H_INCLUDED
@@ -44,14 +22,25 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Write to file using fwrite(), report errors immediately.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef STDIO_H_INCLUDED
#include <stdio.h>
#define STDIO_H_INCLUDED 1
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
-#define DK4APP_H_INCLUDED 1
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4getcwd8.c b/support/dktools/dk4getcwd8.c
index 4787348a7f..3eed7e2f9e 100644
--- a/support/dktools/dk4getcwd8.c
+++ b/support/dktools/dk4getcwd8.c
@@ -1,45 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4getcwd8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4getcwd8.ctr
*/
/** @file dk4getcwd8.c The dk4getcwd8 module.
*/
-#line 36 "dk4getcwd8.ctr"
-
+#line 77 "dk4getcwd8.ctr"
+#include "dk4conf.h"
#include "dk4getcwd8.h"
#if DK4_ON_WINDOWS
@@ -77,12 +55,41 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+
+
+
+
+#line 138 "dk4getcwd8.ctr"
+
int
dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) { *dptr = '\0'; }
if ((NULL != dptr) && (0 < sz)) {
#if DK4_ON_WINDOWS
@@ -90,13 +97,13 @@ dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp)
DWORD dwSz;
DWORD dwRes;
dwSz = (DWORD)sz;
- if ((dk4_um_t)sz > (dk4_um_t)0xFFFFFFUL) { dwSz = (DWORD)0xFFFFFFFFUL; }
+ if ((dk4_um_t)sz > (dk4_um_t)0xFFFFFFFFUL) { dwSz = (DWORD)0xFFFFFFFFUL; }
dwRes = GetCurrentDirectoryA(dwSz, dptr);
if (0 < dwRes) {
if (dwRes < dwSz) {
- back = 1;
+ back = 1;
} else {
- dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
+ dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
dk4error_set_ldetails(erp, DK4_E_SYSTEM, GetLastError());
@@ -128,9 +135,9 @@ dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp)
dwRes = GetCurrentDirectoryA(dwSz, dptr);
if (0 < dwRes) {
if (dwRes < dwSz) {
- back = 1;
+ back = 1;
} else {
- dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
+ dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
dk4error_set_ldetails(erp, DK4_E_SYSTEM, GetLastError());
@@ -153,3 +160,17 @@ dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp)
}
+
+char *
+dk4getcwd_c8_dup(dk4_er_t *erp)
+{
+ char buf[DK4_MAX_PATH];
+ char *back = NULL;
+ size_t szbuf = DK4_SIZEOF(buf,char);
+
+ if (0 != dk4getcwd_c8(buf, szbuf, erp)) {
+ back = dk4str8_dup(buf, erp);
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4getcwd8.ctr b/support/dktools/dk4getcwd8.ctr
index 9ecc01097b..b603e2fdbc 100644
--- a/support/dktools/dk4getcwd8.ctr
+++ b/support/dktools/dk4getcwd8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,20 @@ license = bsd
/** @file dk4getcwd8.h Get current working directory as char string.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -24,17 +36,46 @@ extern "C" {
@param sz Buffer size.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL or sz is 0,
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryA()
+ failed.
*/
int
dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp);
+/** Find current working directory, return string in newly
+ allocated memory.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing
+ the directory name on success, NULL on error.
+ On success, use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryA()
+ failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY<br>
+ if no memory is available.
+*/
+char *
+dk4getcwd_c8_dup(dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
%% module
-
+#include "dk4conf.h"
#include "dk4getcwd8.h"
#if DK4_ON_WINDOWS
@@ -72,12 +113,39 @@ dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+
+
+$!trace-include
+
int
dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) { *dptr = '\0'; }
if ((NULL != dptr) && (0 < sz)) {
#if DK4_ON_WINDOWS
@@ -85,13 +153,13 @@ dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp)
DWORD dwSz;
DWORD dwRes;
dwSz = (DWORD)sz;
- if ((dk4_um_t)sz > (dk4_um_t)0xFFFFFFUL) { dwSz = (DWORD)0xFFFFFFFFUL; }
+ if ((dk4_um_t)sz > (dk4_um_t)0xFFFFFFFFUL) { dwSz = (DWORD)0xFFFFFFFFUL; }
dwRes = GetCurrentDirectoryA(dwSz, dptr);
if (0 < dwRes) {
if (dwRes < dwSz) {
- back = 1;
+ back = 1;
} else {
- dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
+ dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
dk4error_set_ldetails(erp, DK4_E_SYSTEM, GetLastError());
@@ -123,9 +191,9 @@ dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp)
dwRes = GetCurrentDirectoryA(dwSz, dptr);
if (0 < dwRes) {
if (dwRes < dwSz) {
- back = 1;
+ back = 1;
} else {
- dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
+ dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
dk4error_set_ldetails(erp, DK4_E_SYSTEM, GetLastError());
@@ -148,3 +216,17 @@ dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp)
}
+
+char *
+dk4getcwd_c8_dup(dk4_er_t *erp)
+{
+ char buf[DK4_MAX_PATH];
+ char *back = NULL;
+ size_t szbuf = DK4_SIZEOF(buf,char);
+
+ if (0 != dk4getcwd_c8(buf, szbuf, erp)) {
+ back = dk4str8_dup(buf, erp);
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4getcwd8.h b/support/dktools/dk4getcwd8.h
index d801eaf458..d7f8a09faf 100644
--- a/support/dktools/dk4getcwd8.h
+++ b/support/dktools/dk4getcwd8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4getcwd8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4getcwd8.ctr
*/
#ifndef DK4GETCWD8_H_INCLUDED
@@ -43,8 +21,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4getcwd8.h Get current working directory as char string.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,10 +46,39 @@ extern "C" {
@param sz Buffer size.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL or sz is 0,
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryA()
+ failed.
*/
int
dk4getcwd_c8(char *dptr, size_t sz, dk4_er_t *erp);
+/** Find current working directory, return string in newly
+ allocated memory.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing
+ the directory name on success, NULL on error.
+ On success, use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryA()
+ failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY<br>
+ if no memory is available.
+*/
+char *
+dk4getcwd_c8_dup(dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4getcwdd.c b/support/dktools/dk4getcwdd.c
index f785fc47db..8de1403b8d 100644
--- a/support/dktools/dk4getcwdd.c
+++ b/support/dktools/dk4getcwdd.c
@@ -1,45 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4getcwdd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4getcwdd.ctr
*/
/** @file dk4getcwdd.c The dk4getcwdd module.
*/
-#line 38 "dk4getcwdd.ctr"
-
+#line 72 "dk4getcwdd.ctr"
+#include "dk4conf.h"
#include "dk4getcwdd.h"
#if DK4_CHAR_SIZE > 1
@@ -48,17 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4getcwd8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 51 "dk4getcwdd.ctr"
+#line 91 "dk4getcwdd.ctr"
int
dk4getcwd(dkChar *dptr, size_t sz, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4getcwd_wc(dptr, sz, erp)
@@ -71,3 +59,18 @@ dk4getcwd(dkChar *dptr, size_t sz, dk4_er_t *erp)
}
+
+dkChar *
+dk4getcwd_dup(dk4_er_t *erp)
+{
+#if DK4_CHAR_SIZE > 1
+ return (
+ dk4getcwd_wc_dup(erp)
+ );
+#else
+ return (
+ dk4getcwd_c8_dup(erp)
+ );
+#endif
+}
+
diff --git a/support/dktools/dk4getcwdd.ctr b/support/dktools/dk4getcwdd.ctr
index e7b6eba7cf..16e3df1c2d 100644
--- a/support/dktools/dk4getcwdd.ctr
+++ b/support/dktools/dk4getcwdd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,9 +11,20 @@ license = bsd
/** @file dk4getcwdd.h Get current working directoy in dkChar.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -29,6 +40,29 @@ extern "C" {
int
dk4getcwd(dkChar *dptr, size_t sz, dk4_er_t *erp);
+/** Find current working directory, return string in newly
+ allocated memory.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing
+ the directory name on success, NULL on error.
+ On success, use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryA()
+ failed.
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if src is a NULL pointer,
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY<br>
+ if no memory is available.
+*/
+dkChar *
+dk4getcwd_dup(dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -36,7 +70,7 @@ dk4getcwd(dkChar *dptr, size_t sz, dk4_er_t *erp);
%% module
-
+#include "dk4conf.h"
#include "dk4getcwdd.h"
#if DK4_CHAR_SIZE > 1
@@ -45,6 +79,12 @@ dk4getcwd(dkChar *dptr, size_t sz, dk4_er_t *erp);
#include "dk4getcwd8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -54,6 +94,10 @@ $!trace-include
int
dk4getcwd(dkChar *dptr, size_t sz, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4getcwd_wc(dptr, sz, erp)
@@ -66,3 +110,18 @@ dk4getcwd(dkChar *dptr, size_t sz, dk4_er_t *erp)
}
+
+dkChar *
+dk4getcwd_dup(dk4_er_t *erp)
+{
+#if DK4_CHAR_SIZE > 1
+ return (
+ dk4getcwd_wc_dup(erp)
+ );
+#else
+ return (
+ dk4getcwd_c8_dup(erp)
+ );
+#endif
+}
+
diff --git a/support/dktools/dk4getcwdd.h b/support/dktools/dk4getcwdd.h
index b05f26989b..7e3b653f1c 100644
--- a/support/dktools/dk4getcwdd.h
+++ b/support/dktools/dk4getcwdd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4getcwdd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4getcwdd.ctr
*/
#ifndef DK4GETCWDD_H_INCLUDED
@@ -43,9 +21,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4getcwdd.h Get current working directoy in dkChar.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -61,6 +50,29 @@ extern "C" {
int
dk4getcwd(dkChar *dptr, size_t sz, dk4_er_t *erp);
+/** Find current working directory, return string in newly
+ allocated memory.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing
+ the directory name on success, NULL on error.
+ On success, use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryA()
+ failed.
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if src is a NULL pointer,
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY<br>
+ if no memory is available.
+*/
+dkChar *
+dk4getcwd_dup(dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4getcwdw.c b/support/dktools/dk4getcwdw.c
index 6cabefb9da..6a0dc8d983 100644
--- a/support/dktools/dk4getcwdw.c
+++ b/support/dktools/dk4getcwdw.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4getcwdw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4getcwdw.ctr
*/
/** @file dk4getcwdw.c The dk4getcwdw module.
*/
-#line 40 "dk4getcwdw.ctr"
+#line 87 "dk4getcwdw.ctr"
+#include "dk4conf.h"
#include "dk4getcwd8.h"
#if DK4_ON_WINDOWS
@@ -76,24 +55,50 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+#ifndef DK4STRW_H_INCLUDED
+#include "dk4strw.h"
+#endif
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4GETCWDW_H_INCLUDED
+#include "dk4getcwdw.h"
+#endif
-#line 81 "dk4getcwdw.ctr"
+
+
+#line 151 "dk4getcwdw.ctr"
int
dk4getcwd_wc(wchar_t *dptr, size_t sz, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
#if DK4_ON_WINDOWS
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
DWORD dwSz;
DWORD dwRes;
dwSz = (DWORD)sz;
- if ((dk4_um_t)sz > (dk4_um_t)0xFFFFFFUL) { dwSz = (DWORD)0xFFFFFFFFUL; }
+ if ((dk4_um_t)sz > (dk4_um_t)0xFFFFFFFFUL) { dwSz = (DWORD)0xFFFFFFFFUL; }
dwRes = GetCurrentDirectoryW(dwSz, dptr);
if (0 < dwRes) {
if (dwRes < dwSz) {
@@ -141,3 +146,19 @@ dk4getcwd_wc(wchar_t *dptr, size_t sz, dk4_er_t *erp)
return back;
}
+
+
+wchar_t *
+dk4getcwd_wc_dup(dk4_er_t *erp)
+{
+ wchar_t buf[DK4_MAX_PATH];
+ wchar_t *back = NULL;
+ size_t szbuf = DK4_SIZEOF(buf,wchar_t);
+
+ if (0 != dk4getcwd_wc(buf, szbuf, erp)) {
+ back = dk4strw_dup(buf, erp);
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4getcwdw.ctr b/support/dktools/dk4getcwdw.ctr
index 1cce43f1e7..a16825a784 100644
--- a/support/dktools/dk4getcwdw.ctr
+++ b/support/dktools/dk4getcwdw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,8 +12,20 @@ license = bsd
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -26,10 +38,45 @@ extern "C" {
@param sz Buffer size (Number of wchar_t).
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL or sz is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if dptr is too small,
+ - DK4_E_NOT_SUPPORTED<br>
+ if the operation is not supported,
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryW()
+ failed.
*/
int
dk4getcwd_wc(wchar_t *dptr, size_t sz, dk4_er_t *erp);
+/** Find current working directory, return string in newly
+ allocated memory.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing
+ the directory name on success, NULL on error.
+ On success, use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryA()
+ failed.
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if src is a NULL pointer,
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY<br>
+ if no memory is available.
+*/
+wchar_t *
+dk4getcwd_wc_dup(dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -38,6 +85,7 @@ dk4getcwd_wc(wchar_t *dptr, size_t sz, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4getcwd8.h"
#if DK4_ON_WINDOWS
@@ -75,6 +123,28 @@ dk4getcwd_wc(wchar_t *dptr, size_t sz, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STRW_H_INCLUDED
+#include "dk4strw.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4GETCWDW_H_INCLUDED
+#include "dk4getcwdw.h"
+#endif
$!trace-include
@@ -84,13 +154,17 @@ int
dk4getcwd_wc(wchar_t *dptr, size_t sz, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
#if DK4_ON_WINDOWS
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
DWORD dwSz;
DWORD dwRes;
dwSz = (DWORD)sz;
- if ((dk4_um_t)sz > (dk4_um_t)0xFFFFFFUL) { dwSz = (DWORD)0xFFFFFFFFUL; }
+ if ((dk4_um_t)sz > (dk4_um_t)0xFFFFFFFFUL) { dwSz = (DWORD)0xFFFFFFFFUL; }
dwRes = GetCurrentDirectoryW(dwSz, dptr);
if (0 < dwRes) {
if (dwRes < dwSz) {
@@ -138,3 +212,19 @@ dk4getcwd_wc(wchar_t *dptr, size_t sz, dk4_er_t *erp)
return back;
}
+
+
+wchar_t *
+dk4getcwd_wc_dup(dk4_er_t *erp)
+{
+ wchar_t buf[DK4_MAX_PATH];
+ wchar_t *back = NULL;
+ size_t szbuf = DK4_SIZEOF(buf,wchar_t);
+
+ if (0 != dk4getcwd_wc(buf, szbuf, erp)) {
+ back = dk4strw_dup(buf, erp);
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4getcwdw.h b/support/dktools/dk4getcwdw.h
index af8813b04c..acb61a359c 100644
--- a/support/dktools/dk4getcwdw.h
+++ b/support/dktools/dk4getcwdw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4getcwdw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4getcwdw.ctr
*/
#ifndef DK4GETCWDW_H_INCLUDED
@@ -44,8 +22,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -58,10 +48,45 @@ extern "C" {
@param sz Buffer size (Number of wchar_t).
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL or sz is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if dptr is too small,
+ - DK4_E_NOT_SUPPORTED<br>
+ if the operation is not supported,
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryW()
+ failed.
*/
int
dk4getcwd_wc(wchar_t *dptr, size_t sz, dk4_er_t *erp);
+/** Find current working directory, return string in newly
+ allocated memory.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing
+ the directory name on success, NULL on error.
+ On success, use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_SYSTEM<br>
+ with errno in iDetails if getcwd() or _getcwd() failed
+ or GetLastError() result in iDetails if GetCurrentDirectoryA()
+ failed.
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if src is a NULL pointer,
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY<br>
+ if no memory is available.
+*/
+wchar_t *
+dk4getcwd_wc_dup(dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4getpid.c b/support/dktools/dk4getpid.c
index 23969b441c..413f686f6c 100644
--- a/support/dktools/dk4getpid.c
+++ b/support/dktools/dk4getpid.c
@@ -1,45 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4getpid.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4getpid.ctr
*/
/** @file dk4getpid.c The dk4getpid module.
*/
-#line 68 "dk4getpid.ctr"
-
+#line 80 "dk4getpid.ctr"
+#include "dk4conf.h"
#include "dk4getpid.h"
#if DK4_ON_WINDOWS
diff --git a/support/dktools/dk4getpid.ctr b/support/dktools/dk4getpid.ctr
index 63ff591a48..bec6925683 100644
--- a/support/dktools/dk4getpid.ctr
+++ b/support/dktools/dk4getpid.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_SYS_TYPES_H
@@ -66,7 +78,7 @@ dk4getpid(void);
%% module
-
+#include "dk4conf.h"
#include "dk4getpid.h"
#if DK4_ON_WINDOWS
diff --git a/support/dktools/dk4getpid.h b/support/dktools/dk4getpid.h
index 190bf438b2..f0232ef0ef 100644
--- a/support/dktools/dk4getpid.h
+++ b/support/dktools/dk4getpid.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4getpid.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4getpid.ctr
*/
#ifndef DK4GETPID_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_SYS_TYPES_H
diff --git a/support/dktools/dk4gra.c b/support/dktools/dk4gra.c
new file mode 100644
index 0000000000..eeddf37811
--- /dev/null
+++ b/support/dktools/dk4gra.c
@@ -0,0 +1,3793 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4gra.ctr
+*/
+
+/** @file dk4gra.c The dk4gra module.
+*/
+
+
+#line 2179 "dk4gra.ctr"
+
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FLOAT_H
+#ifndef FLOAT_H_INCLUDED
+#include <float.h>
+#define FLOAT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4UC2L_H_INCLUDED
+#include "dk4uc2l.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include "dk4grat.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4FOPT_H_INCLUDED
+#include "dk4fopt.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 2268 "dk4gra.ctr"
+
+
+
+static
+void
+dk4gra_i_save_attributes(
+ dk4_gra_t *gra
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4gra_eps_save_attributes(gra);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dk4gra_pgf_save_attributes(gra);
+ } break;
+ default : {
+ dk4gra_pdf_save_attributes(gra);
+ } break;
+ }
+}
+
+
+
+static
+void
+dk4gra_i_restore_attributes(
+ dk4_gra_t *gra
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4gra_eps_restore_attributes(gra);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dk4gra_pgf_restore_attributes(gra);
+ } break;
+ default : {
+ dk4gra_pdf_restore_attributes(gra);
+ } break;
+ }
+}
+
+
+
+static
+void
+dk4gra_i_reset_attributes(
+ dk4_gra_t *gra
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4gra_eps_reset_attributes(gra);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dk4gra_pgf_reset_attributes(gra);
+ } break;
+ default : {
+ dk4gra_pdf_reset_attributes(gra);
+ } break;
+ }
+}
+
+
+
+static
+double
+dk4gra_i_to_range(double x, double min, double max)
+{
+ if (min > x) { x = min; }
+ if (max < x) { x = max; }
+ return x;
+}
+
+
+
+void
+dk4gra_close(
+ dk4_gra_t *gra
+)
+{
+
+
+#line 2360 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4gra_eps_close(gra);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dk4gra_pgf_close(gra);
+ } break;
+ default : {
+ dk4gra_pdf_close(gra);
+ } break;
+ }
+ finished:
+
+
+#line 2379 "dk4gra.ctr"
+ return;
+}
+
+
+
+dk4_gra_t *
+dk4gra_open_pdf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+
+
+#line 2395 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if ((0 == w) || (0 == h)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = dk4gra_pdf_open(fn, w, h, docfl, erp);
+ finished:
+
+
+#line 2405 "dk4gra.ctr"
+ return back;
+}
+
+
+
+dk4_gra_t *
+dk4gra_open_ps(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+
+
+#line 2421 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if ((0 == w) || (0 == h)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = dk4gra_eps_open(fn, w, h, docfl, erp);
+ finished:
+
+
+#line 2431 "dk4gra.ctr"
+ return back;
+}
+
+
+
+
+dk4_gra_t *
+dk4gra_open_pgf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+
+
+#line 2449 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if ((0 == w) || (0 == h)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = dk4gra_pgf_open(fn, w, h, docfl, sa, erp);
+ finished:
+
+
+#line 2459 "dk4gra.ctr"
+ return back;
+}
+
+
+
+void
+dk4gra_set_color_conversion(
+ dk4_gra_t *gra,
+ dk4_cs_conv_ctx_t const *ctx,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if ((NULL != gra) && (NULL != ctx)) {
+ DK4_MEMCPY(&(gra->cscctx),ctx,sizeof(dk4_cs_conv_ctx_t));
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if ((0 == back) && (NULL != backptr)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 2498 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == gra->s_pages) || (NULL == gra->i_pages)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4gra_close(gra);
+ goto finished;
+ }
+ if ((0 == gra->pages) || (NULL == gra->curpg)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4gra_close(gra);
+ goto finished;
+ }
+
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_write_file_and_close(fout, gra, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_write_file_and_close(fout, gra, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_write_file_and_close(fout, gra, erp);
+ } break;
+ }
+
+ finished:
+
+
+#line 2531 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_write_and_close(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ FILE *fout = NULL; /* Output file to write */
+ int tests = DK4_FOPEN_SC_USER; /* Tests for opening file */
+ int back = 0;
+#if DK4_ON_WINDOWS
+ int oldm = _O_TEXT; /* Previous DOS stdout mode */
+#endif
+
+
+#line 2550 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == gra->s_pages) || (NULL == gra->i_pages)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4gra_close(gra);
+ goto finished;
+ }
+ if ((0 == gra->pages) || (NULL == gra->curpg)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4gra_close(gra);
+ goto finished;
+ }
+
+ /* Open and write output file if name specified, otherwise
+ write to standard output.
+ */
+ if (NULL != gra->fn) {
+ if (0 != dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
+ fout = dk4fopen(gra->fn, dkT("wb"), tests, erp);
+ if (NULL != fout) {
+ back = 1;
+ dk4gra_write_file_and_close(fout, gra, &back, erp);
+ if (0 != fclose(fout)) {
+ dk4error_set_simple_error_code(erp, DK4_E_CLOSE_FAILED);
+ back = 0;
+ }
+ }
+ else {
+ dk4gra_close(gra);
+ }
+ }
+ else {
+ back = 1;
+#if DK4_ON_WINDOWS
+ oldm = _setmode(_fileno(stdout), _O_BINARY);
+#endif
+ dk4gra_write_file_and_close(stdout, gra, &back, erp);
+#if DK4_ON_WINDOWS
+ _setmode(_fileno(stdout), oldm);
+#endif
+ }
+
+ finished:
+
+
+#line 2599 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_page_with_flags(
+ dk4_gra_t *gra,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 2614 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+
+
+#line 2619 "dk4gra.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ gra->cur_x = 0.0;
+ gra->cur_y = 0.0;
+ if ((NULL == gra->s_pages) || (NULL == gra->i_pages)) {
+
+
+#line 2626 "dk4gra.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+
+
+#line 2632 "dk4gra.ctr"
+ back = dk4gra_eps_page(gra, flags, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+
+
+#line 2636 "dk4gra.ctr"
+ back = dk4gra_pgf_page(gra, flags, erp);
+ } break;
+ default : {
+
+
+#line 2640 "dk4gra.ctr"
+ back = dk4gra_pdf_page(gra, flags, erp);
+ } break;
+ }
+ finished:
+
+
+#line 2645 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_page(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ dk4gra_page_with_flags(gra, gra->docfl, backptr, erp);
+}
+
+
+
+void
+dk4gra_i_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_gsave(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_gsave(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_gsave(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_grestore(
+ dk4_gra_t *gra,
+ int res,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_grestore(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_grestore(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_grestore(gra, erp)) {
+ if (NULL != backptr) { * backptr = 0; }
+ }
+ } break;
+ }
+ if ((0 != gra->gscp) && (0 != res)) {
+ dk4gra_i_reset_attributes(gra);
+ }
+}
+
+
+
+void
+dk4gra_i_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_prepare_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_prepare_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_prepare_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+void
+dk4gra_i_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_prepare_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_prepare_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_prepare_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+void
+dk4gra_i_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_prepare_fill_and_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_prepare_fill_and_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) {*backptr = 0; }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_fill_and_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_fill_and_stroke(gra, erp)) {
+ if (NULL != backptr) {*backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_clip(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_clip(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_clip(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_set_eorule(
+ dk4_gra_t *gra,
+ int val
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL != gra) {
+ gra->eor = val;
+ }
+}
+
+
+
+void
+dk4gra_i_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2970 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+
+
+#line 2976 "dk4gra.ctr"
+ if (0 == dk4gra_eps_newpath_moveto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+
+
+#line 2982 "dk4gra.ctr"
+ if (0 == dk4gra_pgf_newpath_moveto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+
+
+#line 2988 "dk4gra.ctr"
+ if (0 == dk4gra_pdf_newpath_moveto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+
+
+#line 2994 "dk4gra.ctr"
+}
+
+
+
+void
+dk4gra_i_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3008 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_lineto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_lineto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_lineto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+
+
+#line 3029 "dk4gra.ctr"
+}
+
+
+
+void
+dk4gra_i_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3047 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_curveto(gra,xc1,yc1,xc2,yc2,x,y,erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_curveto(gra,xc1,yc1,xc2,yc2,x,y,erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_curveto(gra,xc1,yc1,xc2,yc2,x,y,erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+
+
+#line 3068 "dk4gra.ctr"
+}
+
+
+
+void
+dk4gra_i_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3080 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_closepath(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_closepath(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_closepath(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+
+
+#line 3101 "dk4gra.ctr"
+}
+
+
+
+void
+dk4gra_i_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t points[DK4_GRA_CIRCLE_POINTS]; /* Points for circle */
+ size_t i; /* Index of current point */
+ size_t c1; /* Index of first control point after point */
+ size_t c2; /* Index of second control point after point */
+ size_t c3; /* Index of third control point after point */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+
+ /* 2017-10-31
+ The TikZ and PGF manual explains that the pgfpathellipse command will
+ apply coordinate transformations to all coordinates.
+ So better calculate the curve ourselves.
+ */
+
+ if ( 0 == dk4gratool_points_for_ellipse(
+ points, DK4_GRA_CIRCLE_POINTS, xc, yc, rx, ry, rot, erp
+ )
+ ) {
+ if (NULL != backptr) { *backptr = 0; }
+ goto finished;
+ }
+ /* Construct path as cycle of Bezier segments
+ */
+ for (i = 0; i < ((DK4_GRA_CIRCLE_POINTS) / 3); i++) {
+ if (0 == i) {
+ dk4gra_i_newpath_moveto(gra,points[0].x,points[0].y,backptr,erp);
+ }
+ c1 = 3 * i + 1;
+ c2 = 3 * i + 2;
+ c3 = 3 * i + 3;
+ if (DK4_GRA_CIRCLE_POINTS <= c3) { c3 = 0; }
+ dk4gra_i_curveto(
+ gra, points[c1].x, points[c1].y,
+ points[c2].x, points[c2].y, points[c3].x, points[c3].y, backptr, erp
+ );
+ }
+ dk4gra_i_closepath(gra, backptr, erp);
+ if (NULL != bbptr) {
+ for (i = 0; i < ((DK4_GRA_CIRCLE_POINTS) / 3); i++) {
+ c1 = 3 * i + 1;
+ c2 = 3 * i + 2;
+ c3 = 3 * i + 3;
+ if (DK4_GRA_CIRCLE_POINTS <= c3) { c3 = 0; }
+ dk4bb_add_bezier(
+ bbptr,
+ points[i].x, points[i].y, points[c1].x, points[c1].y,
+ points[c2].x, points[c2].y, points[c3].x, points[c3].y
+ );
+ }
+
+
+#line 3169 "dk4gra.ctr"
+
+
+#line 3170 "dk4gra.ctr"
+
+
+#line 3171 "dk4gra.ctr"
+
+
+#line 3172 "dk4gra.ctr"
+
+
+#line 3173 "dk4gra.ctr"
+ dk4bb_add_rotated_ellipse(bbptr, xc, yc, rx, ry, rot);
+
+
+#line 3175 "dk4gra.ctr"
+
+
+#line 3176 "dk4gra.ctr"
+
+
+#line 3177 "dk4gra.ctr"
+
+
+#line 3178 "dk4gra.ctr"
+
+
+#line 3179 "dk4gra.ctr"
+ }
+
+ finished:
+ return;
+}
+
+
+
+void
+dk4gra_i_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3198 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_circle(gra, xc, yc, r, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_circle(gra, xc, yc, r, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ dk4gra_i_ellipse(gra, xc, yc, r, r, 0.0, NULL, backptr, erp);
+ } break;
+ }
+
+
+#line 3217 "dk4gra.ctr"
+}
+
+
+
+void
+dk4gra_i_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double dx; /* Width */
+ double dy; /* Height */
+ double xc1; /* Control point coordinates for rounded corners */
+ double yc1;
+ double xc2;
+ double yc2;
+
+
+#line 3240 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+
+
+#line 3244 "dk4gra.ctr"
+
+
+#line 3245 "dk4gra.ctr"
+
+
+#line 3246 "dk4gra.ctr"
+ if (0.0 < r) {
+ dx = xr - xl;
+ dy = yt - yb;
+ dx = 0.4999 * fabs(dx);
+ dy = 0.4999 * fabs(dy);
+ if (r > dx) {
+
+#line 3252 "dk4gra.ctr"
+ r = dx;
+#if 0
+ /* Silently correct radius
+ */
+ if (NULL != backptr) {
+
+#line 3257 "dk4gra.ctr"
+ *backptr = 0;
+ }
+#endif
+ }
+ if (r > dy) {
+
+#line 3262 "dk4gra.ctr"
+ r = dy;
+#if 0
+ /* Silently correct radius
+ */
+ if (NULL != backptr) {
+
+#line 3267 "dk4gra.ctr"
+ *backptr = 0;
+ }
+#endif
+ }
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_rectangle(gra, xl, xr, yb, yt, r, erp)) {
+ if (NULL != backptr) {
+
+#line 3276 "dk4gra.ctr"
+ *backptr = 0;
+ }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_rectangle(gra, xl, xr, yb, yt, r, erp)) {
+ if (NULL != backptr) {
+
+#line 3283 "dk4gra.ctr"
+ *backptr = 0;
+ }
+ }
+ } break;
+ default : {
+ if (0.0 >= r) {
+ dk4gra_i_newpath_moveto(gra, xl, yb, backptr, erp);
+ dk4gra_i_lineto(gra, xr, yb, backptr, erp);
+ dk4gra_i_lineto(gra, xr, yt, backptr, erp);
+ dk4gra_i_lineto(gra, xl, yt, backptr, erp);
+ dk4gra_i_closepath(gra, backptr, erp);
+ }
+ else {
+ dk4gra_i_newpath_moveto(gra, (xl + r), yb, backptr, erp);
+ dk4gra_i_lineto(gra, (xr - r), yb, backptr, erp);
+ xc1 = xr - (1.0 - KAPPA_4) * r;
+ yc1 = yb;
+ xc2 = xr;
+ yc2 = yb + (1.0 - KAPPA_4) * r;
+ dk4gra_i_curveto(gra,xc1,yc1,xc2,yc2,xr,(yb+r),backptr,erp);
+ dk4gra_i_lineto(gra, xr, (yt - r), backptr, erp);
+ xc1 = xr;
+ yc1 = yt - (1.0 - KAPPA_4) * r;
+ xc2 = xr - (1.0 - KAPPA_4) * r;
+ yc2 = yt;
+ dk4gra_i_curveto(gra,xc1,yc1,xc2,yc2,(xr-r),yt,backptr,erp);
+ dk4gra_i_lineto(gra, (xl+r), yt, backptr, erp);
+ xc1 = xl + (1.0 - KAPPA_4) * r;
+ yc1 = yt;
+ xc2 = xl;
+ yc2 = yt - (1.0 - KAPPA_4) * r;
+ dk4gra_i_curveto(gra,xc1,yc1,xc2,yc2,xl,(yt-r),backptr,erp);
+ dk4gra_i_lineto(gra, xl, (yb + r), backptr, erp);
+ xc1 = xl;
+ yc1 = yb + (1.0 - KAPPA_4) * r;
+ xc2 = xl + (1.0 - KAPPA_4) * r;
+ yc2 = yb;
+ dk4gra_i_curveto(gra,xc1,yc1,xc2,yc2,(xl+r),yb,backptr,erp);
+ dk4gra_i_closepath(gra, backptr, erp);
+ }
+ } break;
+ }
+
+
+#line 3326 "dk4gra.ctr"
+}
+
+
+
+void
+dk4gra_i_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double angdiff; /* Angle difference end - start */
+ double x0; /* Start of current arc segment */
+ double y0; /* Start of current arc segment */
+ double dxdt0; /* First x derivative at start */
+ double dydt0; /* First y derivative at start */
+ double x1; /* End of current arg segment */
+ double y1; /* End of current arg segment */
+ double dxdt1; /* First x derivative at end */
+ double dydt1; /* First y derivative at end */
+ double segcalc; /* Number of segments */
+ double seglgt; /* Angle per segment */
+ double kappa; /* Kappa value */
+ double segend; /* Angle at end of segment */
+ size_t segments; /* Number of segments */
+ size_t i; /* Current segment to draw */
+
+
+#line 3359 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_arc(gra, xc, yc, ra, start, end, cl, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ /* 2017-10-31
+ The TikZ and PGF manual warns the computation done by the
+ pgfpatharcto command are numerically very unstable and the arc
+ will not necessary end at the intended end point.
+ So we do not use that command and do the necessary calculations
+ ourselves in the default branch.
+ */
+ default : {
+ start *= M_PI;
+ end *= M_PI;
+ start /= 180.0;
+ end /= 180.0;
+ angdiff = end - start;
+ segcalc = angdiff * 4.0 / M_PI;
+ segments = (size_t)ceil(segcalc);
+ seglgt = angdiff / (double)segments;
+ kappa = dk4gratool_kappa_for_angle(seglgt);
+ x0 = xc + ra * cos(start);
+ y0 = yc + ra * sin(start);
+ dxdt0 = -1.0 * ra * seglgt * sin(start);
+ dydt0 = ra * seglgt * cos(start);
+ dk4gra_i_newpath_moveto(gra, x0, y0, backptr, erp);
+ for (i = 0; i < segments; i++) {
+ segend = start + angdiff * (double)(i + 1) / (double)segments;
+ x1 = xc + ra * cos(segend);
+ y1 = yc + ra * sin(segend);
+ dxdt1 = -1.0 * ra * seglgt * sin(segend);
+ dydt1 = ra * seglgt * cos(segend);
+ dk4gra_i_curveto(gra,
+ x0 + kappa * dxdt0,
+ y0 + kappa * dydt0,
+ x1 - kappa * dxdt1,
+ y1 - kappa * dydt1,
+ x1,
+ y1,
+ backptr, erp
+ );
+ x0 = x1;
+ y0 = y1;
+ dxdt0 = dxdt1;
+ dydt0 = dydt1;
+ }
+ if (0 != cl) {
+ dk4gra_i_lineto(gra, xc, yc, backptr, erp);
+ dk4gra_i_closepath(gra, backptr, erp);
+ }
+ } break;
+ }
+
+
+#line 3417 "dk4gra.ctr"
+}
+
+
+void
+dk4gra_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 3429 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_gsave(gra, &back, erp);
+
+ finished:
+
+
+#line 3445 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 3459 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_grestore(gra, 1, &back, erp);
+
+ finished:
+
+
+#line 3475 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_gs_for_pattern_only(
+ dk4_gra_t *gra,
+ int val,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL != gra) {
+ gra->gscp = ((0 != val) ? (1) : (0));
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+}
+
+
+
+void
+dk4gra_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 3510 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_line_width(gra, lw, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_line_width(gra, lw, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_line_width(gra, lw, erp);
+ } break;
+ }
+ finished:
+
+
+#line 3534 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_line_style(
+ dk4_gra_t *gra,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 3550 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_line_style(gra, ls, sv, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_line_style(gra, ls, sv, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_line_style(gra, ls, sv, erp);
+ } break;
+ }
+ finished:
+
+
+#line 3574 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_line_cap(
+ dk4_gra_t *gra,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 3589 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_line_cap(gra, lc, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_line_cap(gra, lc, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_line_cap(gra, lc, erp);
+ } break;
+ }
+ finished:
+
+
+#line 3613 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_line_join(
+ dk4_gra_t *gra,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 3629 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_line_join(gra, lj, ml, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_line_join(gra, lj, ml, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_line_join(gra, lj, ml, erp);
+ } break;
+ }
+ finished:
+
+
+#line 3653 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 3668 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ g = dk4gra_i_to_range(g, 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_gray(gra, g, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_gray(gra, g, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_gray(gra, g, erp);
+ } break;
+ }
+ finished:
+
+
+#line 3693 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double array1[4];
+ double array2[4];
+ double array3[4];
+ size_t i;
+ int back = 0;
+
+
+#line 3714 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ r = dk4gra_i_to_range(r, 0.0, 1.0);
+ g = dk4gra_i_to_range(g, 0.0, 1.0);
+ b = dk4gra_i_to_range(b, 0.0, 1.0);
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ for (i = 0; i < 4 ; i++) { array1[i] = array2[i] = array3[i] = 0.0; }
+ array1[0] = r; array1[1] = g; array1[2] = b;
+ dk4cs_color_convert(
+ array2, DK4_CS_GRAY, 4, array1, DK4_CS_RGB, 3,
+ array3, 3, &(gra->cscctx), erp
+ );
+ array2[0] = dk4gra_i_to_range(array2[0], 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_gray(gra, array2[0], erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_gray(gra, array2[0], erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_gray(gra, array2[0], erp);
+ } break;
+ }
+ }
+ else {
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_rgb(gra, r, g, b, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_rgb(gra, r, g, b, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_rgb(gra, r, g, b, erp);
+ } break;
+ }
+ }
+
+ finished:
+
+
+#line 3764 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double array1[4];
+ double array2[4];
+ double array3[4];
+ size_t i;
+ int back = 0;
+
+
+#line 3786 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ c = dk4gra_i_to_range(c, 0.0, 1.0);
+ m = dk4gra_i_to_range(m, 0.0, 1.0);
+ y = dk4gra_i_to_range(y, 0.0, 1.0);
+ k = dk4gra_i_to_range(k, 0.0, 1.0);
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ for (i = 0; i < 4 ; i++) { array1[i] = array2[i] = array3[i] = 0.0; }
+ array1[0] = c; array1[1] = m; array1[2] = y; array1[3] = k;
+ dk4cs_color_convert(
+ array2, DK4_CS_GRAY, 4, array1, DK4_CS_CMYK, 4,
+ array3, 4, &(gra->cscctx), erp
+ );
+ array2[0] = dk4gra_i_to_range(array2[0], 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_gray(gra, array2[0], erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_gray(gra, array2[0], erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_gray(gra, array2[0], erp);
+ } break;
+ }
+ }
+ else {
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_cmyk(gra, c, m, y, k, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_cmyk(gra, c, m, y, k, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_cmyk(gra, c, m, y, k, erp);
+ } break;
+ }
+ }
+
+ finished:
+
+
+#line 3837 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 3852 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ g = dk4gra_i_to_range(g, 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_gray(gra, g, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_gray(gra, g, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_gray(gra, g, erp);
+ } break;
+ }
+ finished:
+
+
+#line 3877 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double array1[4];
+ double array2[4];
+ double array3[4];
+ size_t i;
+ int back = 0;
+
+
+#line 3898 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ r = dk4gra_i_to_range(r, 0.0, 1.0);
+ g = dk4gra_i_to_range(g, 0.0, 1.0);
+ b = dk4gra_i_to_range(b, 0.0, 1.0);
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ /*
+ Force gray
+ */
+ for (i = 0; i < 4 ; i++) { array1[i] = array2[i] = array3[i] = 0.0; }
+ array1[0] = r; array1[1] = g; array1[2] = b;
+ dk4cs_color_convert(
+ array2, DK4_CS_GRAY, 4, array1, DK4_CS_RGB, 3,
+ array3, 3, &(gra->cscctx), erp
+ );
+ array2[0] = dk4gra_i_to_range(array2[0], 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ }
+ }
+ else {
+ /*
+ RGB allowed
+ */
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_rgb(gra, r, g, b, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_rgb(gra, r, g, b, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_rgb(gra, r, g, b, erp);
+ } break;
+ }
+ }
+
+ finished:
+
+
+#line 3954 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double array1[4];
+ double array2[4];
+ double array3[4];
+ size_t i;
+ int back = 0;
+
+
+#line 3976 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ c = dk4gra_i_to_range(c, 0.0, 1.0);
+ m = dk4gra_i_to_range(m, 0.0, 1.0);
+ y = dk4gra_i_to_range(y, 0.0, 1.0);
+ k = dk4gra_i_to_range(k, 0.0, 1.0);
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ /*
+ Force gray
+ */
+ for (i = 0; i < 4 ; i++) { array1[i] = array2[i] = array3[i] = 0.0; }
+ array1[0] = c; array1[1] = m; array1[2] = y; array1[3] = k;
+ dk4cs_color_convert(
+ array2, DK4_CS_GRAY, 4, array1, DK4_CS_CMYK, 3,
+ array3, 3, &(gra->cscctx), erp
+ );
+ array2[0] = dk4gra_i_to_range(array2[0], 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ }
+ }
+ else {
+ /*
+ CMYK allowed
+ */
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_cmyk(gra, c, m, y, k, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_cmyk(gra, c, m, y, k, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_cmyk(gra, c, m, y, k, erp);
+ } break;
+ }
+ }
+
+ finished:
+
+
+#line 4033 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+
+void
+dk4gra_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4048 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_prepare_fill(gra, &back, erp);
+
+ finished:
+
+
+#line 4064 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4078 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_prepare_stroke(gra, &back, erp);
+
+ finished:
+
+
+#line 4094 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4108 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_prepare_fill_and_stroke(gra, &back, erp);
+
+ finished:
+
+
+#line 4124 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+int
+dk4gra_can_fill_and_stroke(
+ const dk4_gra_t *gra
+)
+{
+ int back = 0;
+
+
+#line 4136 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = 0;
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = 1;
+ } break;
+ default : {
+ back = 1;
+ } break;
+ }
+
+
+#line 4151 "dk4gra.ctr"
+ return back;
+}
+
+
+
+void
+dk4gra_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4165 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_fill(gra, &back, erp);
+
+ finished:
+
+
+#line 4181 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4195 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_stroke(gra, &back, erp);
+
+ finished:
+
+
+#line 4211 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4225 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_fill_and_stroke(gra, &back, erp);
+
+ finished:
+
+
+#line 4241 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4255 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_clip(gra, &back, erp);
+
+ finished:
+
+
+#line 4271 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4288 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ gra->cur_x = x;
+ gra->cur_y = y;
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, x);
+ dk4bb_add_y(bbptr, y);
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_newpath_moveto(gra, x, y, &back, erp);
+ finished:
+
+
+#line 4309 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4326 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ gra->cur_x = x;
+ gra->cur_y = y;
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, x);
+ dk4bb_add_y(bbptr, y);
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_lineto(gra, x, y, &back, erp);
+ finished:
+
+
+#line 4347 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4368 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_bezier(
+ bbptr, gra->cur_x, gra->cur_y, xc1, yc1, xc2, yc2, x, y
+ );
+ }
+ gra->cur_x = x;
+ gra->cur_y = y;
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_curveto(gra, xc1, yc1, xc2, yc2, x, y, &back, erp);
+ finished:
+
+
+#line 4390 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4404 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_closepath(gra, &back, erp);
+ finished:
+
+
+#line 4419 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4437 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if ((NULL == gra) || (0.0 >= r)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xc - r); dk4bb_add_x(bbptr, xc + r);
+ dk4bb_add_y(bbptr, yc - r); dk4bb_add_y(bbptr, yc + r);
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_circle(gra, xc, yc, r, &back, erp);
+
+ finished:
+
+
+#line 4457 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+void
+dk4gra_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4476 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_rectangle(gra, xl, xr, yb, yt, r, &back, erp);
+
+ finished:
+
+
+#line 4496 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4517 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if ((NULL == gra) || (0.0 >= ra)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xc + ra * cos((M_PI * start)/ 180.0));
+ dk4bb_add_y(bbptr, yc + ra * sin((M_PI * start)/ 180.0));
+ dk4bb_add_x(bbptr, xc + ra * cos((M_PI * end)/ 180.0));
+ dk4bb_add_y(bbptr, yc + ra * sin((M_PI * end)/ 180.0));
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_arc(gra, xc, yc, ra, start, end, cl, &back, erp);
+ finished:
+
+
+#line 4538 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 4558 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ rot *= M_PI;
+ rot /= 180.0;
+ if ((NULL == gra) || (0.0 >= rx) || (0.0 >= ry)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_ellipse(gra, xc, yc, rx, ry, rot, bbptr, &back, erp);
+
+ finished:
+
+
+#line 4576 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double val[16]; /* Values passed to EPS pattern functions */
+ double y01; /* Temporary value */
+ double y02; /* Temporary value */
+ dk4_gra_lc_t lc; /* Line cap used while drawing the pattern */
+ dk4_gra_lj_t lj; /* Line join used while drawing the pattern */
+ dk4_gra_ls_t ls; /* Line style used while drawing the pattern */
+ int back = 0;
+
+
+#line 4601 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Extend pattern area for line width
+ */
+#if VERSION_BEFORE_20181212
+ xl -= 0.9; xr += 0.9; yb -= 0.9; yt += 0.9;
+#else
+ xl -= gra->patlw; xr += gra->patlw; yb -= gra->patlw; yt += gra->patlw;
+#endif
+ /*
+ Calculate arguments for EPS pattern functions
+ */
+ val[0] = xl;
+ val[1] = xr;
+ val[2] = yb;
+ val[3] = yt;
+ val[4] = 3.6;
+ switch (pn) {
+ case DK4_GRA_PATTERN_30_DEGREE_RIGHT : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ val[2] -= ((val[1] - val[0]) / sqrt(3.0));
+ val[4] = 7.2 / sqrt(3.0);
+ y01 = val[2] - val[0] / sqrt(3.0);
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 = y02 * val[4];
+ val[2] -= (y01 - y02);
+ } break;
+ case DK4_GRA_PATTERN_30_DEGREE_SIEVE : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ val[2] -= ((val[1] - val[0]) / sqrt(3.0));
+ val[4] = 7.2 / sqrt(3.0);
+ y01 = val[2] + val[1] / sqrt(3.0);
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 = y02 * val[4];
+ val[2] -= (y01 - y02);
+ y01 = val[0] - val[2] * sqrt(3.0);
+ y02 = y01 / 7.2;
+ y02 = floor(y02);
+ y02 = y02 * 7.2;
+ val[0] -= (y01 - y02);
+ val[2] -= val[4];
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_LEFT : {
+ val[2] -= (val[1] - val[0]);
+ val[4] = 3.6 * M_SQRT2;
+ y01 = val[2] + val[1];
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 *= val[4];
+ val[2] -= (y01 - y02);
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_RIGHT : {
+ val[2] -= (val[1] - val[0]);
+ val[4] = 3.6 * M_SQRT2;
+ y01 = val[2] - val[0];
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 *= val[4];
+ val[2] -= (y01 - y02);
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_SIEVE : {
+ val[2] -= (val[1] - val[0]);
+ val[4] = 3.6 * M_SQRT2;
+ y01 = val[2] + val[1];
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 *= val[4];
+ val[2] -= (y01 - y02);
+ y01 = val[0] - val[2];
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 *= val[4];
+ val[0] -= (y01 - y02);
+ val[2] -= val[4];
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_BRICKS : {
+ y01 = val[2] / 7.2;
+ y01 = floor(y01);
+ val[2] = y01 * 7.2;
+ y01 = val[0] / 14.4;
+ y01 = floor(y01);
+ val[0] = y01 * 14.4;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_BRICKS : {
+ y01 = val[2] / 14.4;
+ y01 = floor(y01);
+ val[2] = y01 * 14.4;
+ y01 = val[0] / 7.2;
+ y01 = floor(y01);
+ val[0] = y01 * 7.2;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_LINES : {
+ y01 = val[2] / 3.6;
+ y01 = floor(y01);
+ val[2] = y01 * 3.6;
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_LINES : {
+ y01 = val[0] / 3.6;
+ y01 = floor(y01);
+ val[0] = y01 * 3.6;
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE : {
+ y01 = val[2] / 3.6;
+ y01 = floor(y01);
+ val[2] = y01 * 3.6;
+ y01 = val[0] / 3.6;
+ y01 = floor(y01);
+ val[0] = y01 * 3.6;
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT : {
+ y01 = val[2] / 28.8;
+ y01 = floor(y01);
+ val[2] = y01 * 28.8;
+ y01 = val[0] / 14.4;
+ y01 = floor(y01);
+ val[0] = y01 * 14.4;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT : {
+ y01 = val[2] / 28.8;
+ y01 = floor(y01);
+ val[2] = y01 * 28.8;
+ y01 = val[0] / 14.4;
+ y01 = floor(y01);
+ val[0] = y01 * 14.4;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_1 : {
+ y01 = val[2] / 14.4;
+ y01 = floor(y01);
+ val[2] = y01 * 14.4;
+ y01 = val[0] / 28.8;
+ y01 = floor(y01);
+ val[0] = y01 * 28.8;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_2 : {
+ y01 = val[2] / 14.4;
+ y01 = floor(y01);
+ val[2] = y01 * 14.4;
+ y01 = val[0] / 28.8;
+ y01 = floor(y01);
+ val[0] = y01 * 28.8;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_LARGE_FISH_SCALES : {
+ /* xs xe ys ye dx dy r a1 a2 */
+ val[4] = 14.54;
+ val[5] = 3.7;
+ val[6] = 9.0;
+ val[7] = 216.1;
+ val[8] = 323.9;
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / (2 * val[5]);
+ y01 = floor(y01);
+ val[2] = 2.0 * y01 * val[5];
+ } break;
+ case DK4_GRA_PATTERN_SMALL_FISH_SCALES : {
+ /* xs xe ys ye dx dy r a1 a2 */
+ val[4] = 7.2;
+ val[5] = 3.6;
+ val[6] = 3.6;
+ val[7] = 180.0;
+ val[8] = 360.0;
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / (2 * val[5]);
+ y01 = floor(y01);
+ val[2] = 2.0 * y01 * val[5];
+ } break;
+ case DK4_GRA_PATTERN_CIRCLES : {
+ val[4] = 7.2;
+ y01 = val[0] / 14.4;
+ y01 = floor(y01);
+ val[0] = 14.4 * y01;
+ y01 = val[2] / 14.4;
+ y01 = floor(y01);
+ val[2] = 14.4 * y01;
+ } break;
+ case DK4_GRA_PATTERN_HEXAGONS : {
+ /* xs xe ys ye dx dy */
+ val[4] = 21.6;
+ val[5] = 12.47;
+ y01 = val[0] / 21.6;
+ y01 = floor(y01);
+ val[0] = y01 * 21.6;
+ y01 = val[2] / 12.47;
+ y01 = floor(y01);
+ val[2] = y01 * 12.47;
+ } break;
+ case DK4_GRA_PATTERN_OCTAGONS : {
+ /* xs xe ys ye dx co */
+ /* 2020-08-10 Bugfix
+ Pattern size too small, increased now.
+ */
+ val[4] = 14.4; /* previously 7.2; */
+ val[5] = 4.22; /* previously 2.11; */
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / val[4];
+ y01 = floor(y01);
+ val[2] = y01 * val[4];
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_TIRES : {
+ val[4] = 7.2;
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / val[4];
+ y01 = floor(y01);
+ val[2] = y01 * val[4];
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_TIRES : {
+ val[4] = 7.2;
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / val[4];
+ y01 = floor(y01);
+ val[2] = y01 * val[4];
+ } break;
+ /* DK4_GRA_PATTERN_30_DEGREE_LEFT */
+ default : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ val[2] -= ((val[1] - val[0]) / sqrt(3.0));
+ val[4] = 7.2 / sqrt(3.0);
+ y01 = val[2] + val[1] / sqrt(3.0);
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 = y02 * val[4];
+ val[2] -= (y01 - y02);
+ } break;
+ }
+
+ back = 1;
+
+ /* Save attributes and graphics state
+ */
+ dk4gra_i_save_attributes(gra);
+ dk4gra_i_gsave(gra, &back, erp);
+
+ /* Set attributes for stroking
+ */
+ dk4gra_set_line_width(gra, gra->patlw, &back, erp);
+ lc = DK4_GRA_LC_ROUNDED;
+ dk4gra_set_line_cap(gra, lc, &back, erp);
+ lj = DK4_GRA_LJ_MITERED;
+ switch (pn) {
+ case DK4_GRA_PATTERN_LARGE_FISH_SCALES:
+ case DK4_GRA_PATTERN_SMALL_FISH_SCALES: {
+ lj = DK4_GRA_LJ_ROUNDED;
+ } break;
+ default : {
+ /* Intentionally empty to avoid compiler warnings. */
+ } break;
+ }
+ dk4gra_set_line_join(gra, lj, 10.0, &back, erp);
+ ls = DK4_GRA_LS_SOLID;
+ dk4gra_set_line_style(gra, ls, 3.6, &back, erp);
+ dk4gra_prepare_stroke(gra, &back, erp);
+
+ /*
+ Driver specific pattern functions
+ */
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_pattern(gra, pn, val, erp)) {
+ back = 0;
+ }
+ } break;
+ default : {
+ dk4gra_i_pattern(gra, xl, xr, yb, yt, pn, val, &back, erp);
+ } break;
+ }
+
+ /* Restore graphics state and attributes
+ */
+ dk4gra_i_grestore(gra, 0, &back, erp);
+ dk4gra_i_restore_attributes(gra);
+
+
+ finished:
+
+
+#line 4901 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_bif_cotra_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+ int cs; /* Color space */
+ int back = 0;
+ dk4_px_bit_depth_t bpc; /* Number of bits per component */
+
+
+
+#line 4924 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != bif);
+ assert(NULL != cotra);
+#endif
+ /*
+ Check arguments
+ */
+ if ((NULL == gra) || (NULL == cotra) || (NULL == bif)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* When enforcing grayscaled output, do not write colored image
+ */
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ /* Direct re-use of DCT encoded data requires a file name
+ */
+ if (NULL == fn) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ /* Direct re-use of DCT encoded data requires given bits per component
+ */
+ bpc = dk4bif_get_original_bit_depth(bif);
+ if (8 != bpc) {
+ if (4 != bpc) {
+ if (2 != bpc) {
+ if (1 != bpc) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ }
+ /* Direct re-use of DCT encoded data restricts color spaces
+ */
+ cs = dk4bif_get_color_space(bif);
+ if (DK4_CS_GRAY != cs) {
+ if (DK4_CS_RGB != cs) {
+ if (DK4_CS_CMYK != cs) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ /* Direct re-use of DCT encoded data impossible for colored
+ images when enforcing grayscaled output
+ */
+ if ((DK4_CS_GRAY != cs) && (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_bif_fig_image(
+ gra, cotra, bif, fn,
+ ifl, erp
+ );
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (NULL != fn) {
+ back = dk4gra_pgf_bif_fig_image(
+ gra, cotra, bif, fn,
+ ifl, erp
+ );
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ default : { /* PDF */
+ back = dk4gra_pdf_bif_fig_image(
+ gra, cotra, bif, fn, fno,
+ ifl, erp
+ );
+ } break;
+ }
+
+ finished:
+
+
+#line 5003 "dk4gra.ctr"
+ if ((0 == back) && (NULL != backptr)) { *backptr = 0; }
+}
+
+
+void
+dk4gra_bif_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Values passed to low level functions */
+ double w; /* Image width */
+ double h; /* Image height */
+ double xres; /* X resolution */
+ double yres; /* Y resolution */
+ int res; /* Operation result */
+ int cs; /* Color space */
+ int back = 0;
+ dk4_px_bit_depth_t bpc;
+
+
+#line 5034 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != bif);
+#endif
+
+
+#line 5039 "dk4gra.ctr"
+
+
+#line 5040 "dk4gra.ctr"
+
+
+#line 5041 "dk4gra.ctr"
+
+
+#line 5042 "dk4gra.ctr"
+
+
+#line 5043 "dk4gra.ctr"
+
+
+#line 5044 "dk4gra.ctr"
+
+
+#line 5045 "dk4gra.ctr"
+
+
+#line 5046 "dk4gra.ctr"
+
+
+#line 5047 "dk4gra.ctr"
+
+
+#line 5048 "dk4gra.ctr"
+
+
+#line 5049 "dk4gra.ctr"
+
+
+#line 5050 "dk4gra.ctr"
+
+
+#line 5051 "dk4gra.ctr"
+
+
+#line 5052 "dk4gra.ctr"
+
+
+#line 5053 "dk4gra.ctr"
+
+
+#line 5054 "dk4gra.ctr"
+
+
+#line 5055 "dk4gra.ctr"
+
+
+#line 5056 "dk4gra.ctr"
+
+
+#line 5057 "dk4gra.ctr"
+
+
+#line 5058 "dk4gra.ctr"
+
+ /* 2018-03-19
+ Removed (NULL == fn)
+ */
+ if ((NULL == gra) || (NULL == bif)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((xr <= xl) || (yt <= yb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ /* Select frame
+ */
+ if (0 == dk4bif_set_current_frame(bif, fno)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Retrieve image dimensions
+ */
+ w = (double)dk4bif_get_width(bif);
+ h = (double)dk4bif_get_height(bif);
+ if (0 == (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)) {
+ xres = dk4bif_get_xres(bif);
+ yres = dk4bif_get_yres(bif);
+ if ((isgreater(xres, 0.0)) && (isgreater(yres, 0.0))) {
+ w = (72.0 * w) / xres;
+ h = (72.0 * h) / yres;
+#if DK4_HAVE_ISFINITE
+ if ((!(isfinite(w))) || (!(isfinite(h)))) {
+ w = (double)dk4bif_get_width(bif);
+ h = (double)dk4bif_get_height(bif);
+ }
+#else
+#if DK4_HAVE__FINITE
+ if ((!(_finite(w))) || (!(_finite(h)))) {
+ w = (double)dk4bif_get_width(bif);
+ h = (double)dk4bif_get_height(bif);
+ }
+#endif
+#endif
+ }
+ }
+ /*
+ Calculate coordinate system transformations
+ */
+ res = dk4gratool_calculate_transformations(
+ val, xl, xr, yb, yt, w, h,
+ ((0 == (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)) ? (1) : (0)),
+ pos, erp
+ );
+ if (0 == res) {
+ goto finished;
+ }
+ /* Direct re-use of DCT encoded data from JPEG requires file name
+ */
+ if (NULL == fn) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ /* DCT encoding restricts usable number of bits per component
+ */
+ bpc = dk4bif_get_original_bit_depth(bif);
+ if (8 != bpc) {
+ if (4 != bpc) {
+ if (2 != bpc) {
+ if (1 != bpc) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ }
+ /* DCT encoding restricts color spaces
+ */
+ cs = dk4bif_get_color_space(bif);
+ if (DK4_CS_GRAY != cs) {
+ if (DK4_CS_RGB != cs) {
+ if (DK4_CS_CMYK != cs) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ /* Direct re-use of DCT encoded data from colored image
+ not possible when enforcing grayscaled output
+ */
+ if ((DK4_CS_GRAY != cs) && (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ /* Can not specify frame number in PGF output, only frame 0
+ can be used
+ */
+ if ((DK4_GRA_DRIVER_PGF == gra->dr) && (0 != fno)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Call function to produce output with given coordinates transformation
+ */
+ back = 1;
+ dk4gra_bif_cotra_image(
+ gra, val, bif, fn, fno,
+ ifl, &back, erp
+ );
+
+ finished:
+
+
+#line 5169 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_bif_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double xres = 1.0; /* X resolution */
+ double yres = 1.0; /* Y resolution */
+ double w; /* Width */
+ double h; /* Height */
+ double xdiff; /* Available X space */
+ double ydiff; /* Available Y space */
+ int pos = 0; /* Image position */
+ int back = 0;
+
+
+#line 5199 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != bif);
+#endif
+
+
+#line 5204 "dk4gra.ctr"
+
+
+#line 5205 "dk4gra.ctr"
+
+
+#line 5206 "dk4gra.ctr"
+
+
+#line 5207 "dk4gra.ctr"
+
+
+#line 5208 "dk4gra.ctr"
+
+
+#line 5209 "dk4gra.ctr"
+
+
+#line 5210 "dk4gra.ctr"
+
+
+#line 5211 "dk4gra.ctr"
+
+
+#line 5212 "dk4gra.ctr"
+
+
+#line 5213 "dk4gra.ctr"
+
+
+#line 5214 "dk4gra.ctr"
+
+
+#line 5215 "dk4gra.ctr"
+
+
+#line 5216 "dk4gra.ctr"
+
+
+#line 5217 "dk4gra.ctr"
+
+
+#line 5218 "dk4gra.ctr"
+
+
+#line 5219 "dk4gra.ctr"
+
+
+#line 5220 "dk4gra.ctr"
+
+
+#line 5221 "dk4gra.ctr"
+
+
+#line 5222 "dk4gra.ctr"
+
+
+#line 5223 "dk4gra.ctr"
+ /* 2018-03-19
+ Removed (NULL == fn)
+ */
+ if ((NULL == gra) || (NULL == bif)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+#line 5230 "dk4gra.ctr"
+ if ((xr <= xl) || (yt <= yb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+#line 5234 "dk4gra.ctr"
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ if (0 == (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)) {
+ if (0 != (DK4_GRA_IMG_FLAG_ALLOW_ROTATION & ifl)) {
+ if (0 != dk4bif_set_current_frame(bif, fno)) {
+ xdiff = fabs(xr - xl);
+ ydiff = fabs(yt - yb);
+ w = (double)dk4bif_get_width(bif);
+ h = (double)dk4bif_get_height(bif);
+ if (0 == (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)) {
+ xres = dk4bif_get_xres(bif);
+ yres = dk4bif_get_yres(bif);
+ if ((isgreater(xres, 0.0)) && (isgreater(yres, 0.0))) {
+ w = (72.0 * w) / xres;
+ h = (72.0 * h) / yres;
+ }
+ }
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(w)) && (isfinite(h)))
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(w)) && (_finite(h)))
+#else
+
+#endif
+#endif
+ {
+ if ((isgreater(w, h)) && (isless(xdiff, ydiff))) {
+ pos = 1;
+ }
+ else {
+ if ((isless(w, h)) && (isgreater(xdiff, ydiff))) {
+ pos = 1;
+ }
+ }
+ }
+#if (DK4_HAVE_ISFINITE) || (DK4_HAVE__FINITE)
+ else {
+ /* ERROR: Width and height calculation failed */
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+#endif
+ }
+ else {
+ /* ERROR: Frame number does not exist! */
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ back = 1;
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, &back, erp
+ );
+ }
+ else {
+ back = 1;
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, &back, erp
+ );
+ }
+ }
+ else {
+ back = 1;
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, &back, erp
+ );
+ }
+ finished:
+
+
+#line 5309 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *bifptr = NULL; /* Bitmap image file */
+ int ho = 0; /* Flag: Read header only */
+ int back = 0;
+
+
+#line 5335 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fn);
+#endif
+
+
+#line 5340 "dk4gra.ctr"
+
+
+#line 5341 "dk4gra.ctr"
+
+
+#line 5342 "dk4gra.ctr"
+
+
+#line 5343 "dk4gra.ctr"
+
+
+#line 5344 "dk4gra.ctr"
+
+
+#line 5345 "dk4gra.ctr"
+
+
+#line 5346 "dk4gra.ctr"
+
+
+#line 5347 "dk4gra.ctr"
+
+
+#line 5348 "dk4gra.ctr"
+
+
+#line 5349 "dk4gra.ctr"
+
+
+#line 5350 "dk4gra.ctr"
+
+
+#line 5351 "dk4gra.ctr"
+
+
+#line 5352 "dk4gra.ctr"
+
+
+#line 5353 "dk4gra.ctr"
+
+
+#line 5354 "dk4gra.ctr"
+
+
+#line 5355 "dk4gra.ctr"
+
+
+#line 5356 "dk4gra.ctr"
+
+
+#line 5357 "dk4gra.ctr"
+
+
+#line 5358 "dk4gra.ctr"
+
+
+#line 5359 "dk4gra.ctr"
+ if ((NULL == gra) || (NULL == fn)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((xr <= xl) || (yt <= yb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == ctx) {
+ ctx = &(gra->cscctx);
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ if (DK4_GRA_DRIVER_PGF == gra->dr) {
+ ho = 1;
+ }
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == dk4bif_type_for_suffix(fn))
+ ) {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ ho = 1;
+ }
+ }
+ bifptr = dk4bif_open(fn, ho, ctx, erp);
+ if (NULL == bifptr) {
+ goto finished;
+ }
+ back = 1;
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bifptr, fn, fno,
+ pos, ifl, bbptr, &back, erp
+ );
+
+ finished:
+ if (NULL != bifptr) {
+ dk4bif_close(bifptr);
+ }
+
+
+#line 5403 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *bifptr = NULL; /* Bitmap image */
+ int back = 0; /* Function result */
+ int ho = 0; /* Flag: Read image header only */
+
+
+#line 5428 "dk4gra.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fn);
+#endif
+
+
+#line 5433 "dk4gra.ctr"
+
+
+#line 5434 "dk4gra.ctr"
+
+
+#line 5435 "dk4gra.ctr"
+
+
+#line 5436 "dk4gra.ctr"
+
+
+#line 5437 "dk4gra.ctr"
+
+
+#line 5438 "dk4gra.ctr"
+
+
+#line 5439 "dk4gra.ctr"
+
+
+#line 5440 "dk4gra.ctr"
+
+
+#line 5441 "dk4gra.ctr"
+
+
+#line 5442 "dk4gra.ctr"
+
+
+#line 5443 "dk4gra.ctr"
+
+
+#line 5444 "dk4gra.ctr"
+
+
+#line 5445 "dk4gra.ctr"
+
+
+#line 5446 "dk4gra.ctr"
+
+
+#line 5447 "dk4gra.ctr"
+
+
+#line 5448 "dk4gra.ctr"
+
+
+#line 5449 "dk4gra.ctr"
+
+
+#line 5450 "dk4gra.ctr"
+
+
+#line 5451 "dk4gra.ctr"
+
+
+#line 5452 "dk4gra.ctr"
+ /*
+ Check argument
+ */
+ if ((NULL == gra) || (NULL == fn)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+#line 5459 "dk4gra.ctr"
+ if ((xr <= xl) || (yt <= yb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+#line 5463 "dk4gra.ctr"
+ if (NULL == ctx) {
+ ctx = &(gra->cscctx);
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ /* Open bitmap file
+ */
+ if (DK4_GRA_DRIVER_PGF == gra->dr) {
+ ho = 1;
+ }
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == dk4bif_type_for_suffix(fn))
+ ) {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ ho = 1;
+ }
+ }
+ bifptr = dk4bif_open(fn, ho, ctx, erp);
+ if (NULL == bifptr) {
+
+#line 5485 "dk4gra.ctr"
+ goto finished;
+ }
+
+#line 5487 "dk4gra.ctr"
+ /* Process bitmap file
+ */
+ back = 1;
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ dk4gra_bif_image(
+ gra, xl, xr, yb, yt, bifptr, fn, fno,
+ ifl, bbptr, &back, erp
+ );
+
+ /* Clean up and exit
+ */
+ finished:
+
+
+#line 5502 "dk4gra.ctr"
+ if (NULL != bifptr) {
+
+#line 5503 "dk4gra.ctr"
+ dk4bif_close(bifptr);
+ }
+
+
+#line 5506 "dk4gra.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_pattern_line_width(
+ dk4_gra_t *gra,
+ double plw
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL != gra) {
+ if (0.0 < plw) {
+ gra->patlw = plw;
+ }
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4gra.ctr b/support/dktools/dk4gra.ctr
new file mode 100644
index 0000000000..df4cbf52a4
--- /dev/null
+++ b/support/dktools/dk4gra.ctr
@@ -0,0 +1,5529 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4gra.h Graphics output (PS/EPS/PDF/PGF).
+
+This module contains functions to create PS/EPS/PDF/PGF graphics.
+
+Coordinates are specified in PS points, called bp in LaTeX.
+72 PS points are one inch.
+
+The origin is in the lower left corner, x values grow to the right,
+y values grow to top.
+
+Colors specified as double values are in the range from 0.0 to 1.0.
+
+For each object to draw follow an algorithm like
+
+@code
+dk4_bb_t bb;
+
+dk4gra_set_line_width(...);
+dk4gra_set_line_style(...);
+dk4gra_set_line_cap(...);
+dk4gra_set_line_join(...);
+dk4gra_set_stroke_...(...);
+dk4gra_set_fill_...(...);
+
+if (want_a_pattern_filled_object) {
+ dk4bb_init(&bb);
+ dk4gra_prepare_fill(...);
+ construct_path(...);
+ dk4gra_fill(...);
+ dk4gra_set_gs_for_pattern_only(gra, 1, ...);
+ dk4gra_gsave(...);
+ construct_path(..., &bb, ...);
+ dk4gra_clip(...);
+ dk4gra_pattern(..., bb.xmin, bb.xmax, bb.ymin, bb.ymax, ...);
+ dk4gra_grestore(...);
+ dk4gra_set_gs_for_pattern_only(gra, 0, ...);
+ if (want_a_stroked_object) {
+ dk4gra_prepare_stroke(...);
+ construct_path(...);
+ dk4gra_stroke(...);
+ }
+}
+else {
+ if (want_a_filled_object) {
+ if (want_a_stroked_object) {
+ if (0 != dk4gra_can_fill_and_stroke(...)) {
+ dk4gra_prepare_fill_and_stroke(...);
+ construct_path(...);
+ dk4gra_fill_and_stroke(...);
+ }
+ else {
+ dk4gra_prepare_fill(...);
+ construct_path(...);
+ dk4gra_fill(...);
+ dk4gra_prepare_stroke(...);
+ construct_path(...);
+ dk4gra_stroke(...);
+ }
+ }
+ else {
+ dk4gra_prepare_fill(...);
+ construct_path(...);
+ dk4gra_fill(...);
+ }
+ }
+ else {
+ if (want_a_stroked_object) {
+ dk4gra_prepare_stroke(...);
+ construct_path(...);
+ dk4gra_stroke(...);
+ }
+ }
+}
+@endcode
+
+The dk4gra_set_fill_...() and dk4gra_set_stroke_...() functions set color
+space and color values. You must use the same color space for both
+fill and stroke color.
+*/
+
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4mem.h"
+#else
+#include <dktools-4/dk4mem.h>
+#endif
+#endif
+
+#ifndef DK4FONT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4font.h"
+#else
+#include <dktools-4/dk4font.h>
+#endif
+#endif
+
+#ifndef DK4ALIGN_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4align.h"
+#else
+#include <dktools-4/dk4align.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4BB_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bb.h"
+#else
+#include <dktools-4/dk4bb.h>
+#endif
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bifty.h"
+#else
+#include <dktools-4/dk4bifty.h>
+#endif
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4cs.h"
+#else
+#include <dktools-4/dk4cs.h>
+#endif
+#endif
+
+#ifndef DK4MEMBF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
+
+#ifndef DK4MBSTRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4mbstrm.h"
+#else
+#include <dktools-4/dk4mbstrm.h>
+#endif
+#endif
+
+#ifndef DK4FONTC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4fontc.h"
+#else
+#include <dktools-4/dk4fontc.h>
+#endif
+#endif
+
+#ifndef DK4UC2L_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4uc2l.h"
+#else
+#include <dktools-4/dk4uc2l.h>
+#endif
+#endif
+
+
+
+/** Epsilon value for coordinates.
+ All values smaller than this are treated as 0.0.
+*/
+#define DK4_GRA_EPSILON_COORDINATES 1.0e-5
+
+/** Epsilon value for line widths.
+ Line width differing less are treated as equal.
+*/
+#define DK4_GRA_EPSILON_LINEWIDTH 1.0e-3
+
+/** Epsilon value for miter limits.
+ Miter limits differing less are treated as equal.
+*/
+#define DK4_GRA_EPSILON_MITERLIMIT 1.0e-3
+
+
+/** Flags for adding images to a page.
+*/
+enum {
+ /** The image is the only page contents.
+ For PS output the gsave operator, clipping
+ and white filling at start of page are
+ removed, the grestore at end of page too.
+ */
+ DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS = 0x0001 ,
+
+ /** Fill image background with color from background
+ chunk before applying image data.
+ Only in effect when producing PDF output in
+ DK4_CS_RGB_ALPHA or DK4_CS_GRAY_ALPHA
+ color space.
+ */
+ DK4_GRA_IMG_FLAG_FILL_BACKGROUND = 0x0002 ,
+
+ /** Allow colored output.
+ Otherwise grayscaled output is enforced.
+ */
+ DK4_GRA_IMG_FLAG_COLOR = 0x0004 ,
+
+ /** Allow LZW compression in PS language
+ level 2 output.
+ */
+ DK4_GRA_IMG_FLAG_LZW = 0x0008 ,
+
+ /** Allow to use DCT encoded data from JPEG
+ files directly.
+ */
+ DK4_GRA_IMG_FLAG_DCT = 0x0010 ,
+
+ /** Set image interpolation flag to allow
+ PS/PDF renderers to optimize representation.
+ */
+ DK4_GRA_IMG_FLAG_INTERPOLATION = 0x0020 ,
+
+ /** Set image interpolation flag when directly
+ using DCT encoded data from JPEG files.
+ */
+ DK4_GRA_IMG_FLAG_DCT_INTERPOLATION = 0x0040 ,
+
+ /** Analyze number of bits per component, reduce
+ if possible without quality loss.
+ */
+ DK4_GRA_IMG_FLAG_ANALYZE_BPC = 0x0080 ,
+
+ /** Analyze use of colors, switch to grayscale
+ if possible without quality loss.
+ */
+ DK4_GRA_IMG_FLAG_ANALYZE_COLOR = 0x0100 ,
+
+ /** Analyze use of alpha channel data, ignore
+ alpha data if all pixels have full opacity.
+ */
+ DK4_GRA_IMG_FLAG_ANALYZE_ALPHA = 0x0200 ,
+
+ /** Allow to rotate the image to fit paper size.
+ */
+ DK4_GRA_IMG_FLAG_ALLOW_ROTATION = 0x0400 ,
+
+ /** Ignore image resolution saved in file.
+ */
+ DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION = 0x0800 ,
+
+ /** Ignore aspect ratio, allow distorsion while
+ filling the specified image range completely.
+ */
+ DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO = 0x1000 ,
+};
+
+
+
+/** Text flags for use with
+ dk4gra_pgf_simple_text(),
+ dk4gra_pgf_special_text(),
+ dk4gra_app_pgf_simple_text(),
+ dk4gra_app_pgf_special_text(),
+ dk4pppt_simple_text(),
+ and dk4pppt_special_text(), can be or-combined.
+*/
+enum {
+ /** Draw oval box around text.
+ */
+ DK4_GRA_TEXT_FLAG_OVAL_BOX = 0x0001 ,
+
+ /** Put white box around text and oval box.
+ */
+ DK4_GRA_TEXT_FLAG_WHITE_BOX = 0x0002
+};
+
+
+
+/** Output driver to choose.
+*/
+typedef enum {
+ DK4_GRA_DRIVER_PDF = 0, /**< Produce PDF file. */
+ DK4_GRA_DRIVER_EPS , /**< Produce EPS file. */
+ DK4_GRA_DRIVER_PS , /**< Produce PS file. */
+ DK4_GRA_DRIVER_PGF , /**< Produce PGF file. */
+ DK4_GRA_DRIVER_BB /**< Produce bounding box file. */
+} dk4_gra_driver_t;
+
+
+
+/** Intended purpose for output.
+*/
+typedef enum {
+ DK4_GRA_PURPOSE_OBJECT = 0 , /**< Object to include in a document. */
+ DK4_GRA_PURPOSE_IMAGE , /**< Standalone image. */
+ DK4_GRA_PURPOSE_DOCUMENT /**< Document for viewing or printing. */
+} dk4_gra_purpose_t;
+
+
+
+/** Line styles.
+*/
+typedef enum {
+ DK4_GRA_LS_SOLID = 0 , /**< Solid line. */
+ DK4_GRA_LS_DASH , /**< Dashed line. */
+ DK4_GRA_LS_DOT , /**< Dotted line. */
+ DK4_GRA_LS_DASH_DOT , /**< Dash dot line. */
+ DK4_GRA_LS_DASH_DOT_DOT , /**< Dash dot dot line. */
+ DK4_GRA_LS_DASH_DOT_DOT_DOT /**< Dash dot dot dot line. */
+} dk4_gra_ls_t;
+
+
+/** Line cap styles.
+*/
+typedef enum {
+ DK4_GRA_LC_BUTTED = 0, /**< Line finished exactly at point. */
+ DK4_GRA_LC_ROUNDED , /**< Half circle added at each line end. */
+ DK4_GRA_LC_PROJECTING /**< Half square added at each line end. */
+} dk4_gra_lc_t;
+
+
+/** Line join styles.
+*/
+typedef enum {
+ DK4_GRA_LJ_MITERED = 0, /**< Pointed. */
+ DK4_GRA_LJ_ROUNDED , /**< Rounded. */
+ DK4_GRA_LJ_BEVELED /**< Cutted point. */
+} dk4_gra_lj_t;
+
+
+/** Flags for new pages. Or-combinations allowed.
+*/
+enum {
+ /** Do not set clip path.
+ */
+ DK4_GRA_PAGE_FLAG_NO_CLIP = 0x0001 ,
+
+ /** Do not fill background in white.
+ */
+ DK4_GRA_PAGE_FLAG_NO_BG = 0x0002 ,
+
+ /** Use uncompressed PDF page stream.
+ Intended for debugging purposes only.
+ */
+ DK4_GRA_PAGE_FLAG_NOT_COMPRESSED = 0x0004 ,
+
+ /** Use front side and back side of paper.
+ */
+ DK4_GRA_DOC_FLAG_DUPLEX = 0x0200 ,
+
+ /** Use front side and back side of paper,
+ binding like a calendar.
+ */
+ DK4_GRA_DOC_FLAG_TUMBLE = 0x0400 ,
+
+ /** Force use of grayscaled output
+ instead of colors.
+ */
+ DK4_GRA_DOC_FLAG_FORCE_GRAY = 0x0800 ,
+
+ /** Use PS level 2 instead of level 3.
+ */
+ DK4_GRA_DOC_FLAG_PS2 = 0x1000 ,
+
+ /** Produce document structuring comments.
+ */
+ DK4_GRA_DOC_FLAG_PS_DSC = 0x2000 ,
+
+ /** Produce EPS instead of normal PS.
+ */
+ DK4_GRA_DOC_FLAG_EPS = 0x4000
+};
+
+
+
+/** Fill patterns.
+*/
+typedef enum {
+ /** Diagonal lines 30 degrees to the left.
+ */
+ DK4_GRA_PATTERN_30_DEGREE_LEFT = 0,
+
+ /** Diagonal lines 30 degrees to the right.
+ */
+ DK4_GRA_PATTERN_30_DEGREE_RIGHT ,
+
+ /** Crosshatch of lines 30 degrees to the left and right.
+ */
+ DK4_GRA_PATTERN_30_DEGREE_SIEVE ,
+
+ /** Diagonal lines 45 degrees to the left.
+ */
+ DK4_GRA_PATTERN_45_DEGREE_LEFT ,
+
+ /** Diagonal lines 45 degrees to the left.
+ */
+ DK4_GRA_PATTERN_45_DEGREE_RIGHT ,
+
+ /** Crosshatch of lines 45 degrees to the left and right.
+ */
+ DK4_GRA_PATTERN_45_DEGREE_SIEVE ,
+
+ /** Horizontal bricks.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_BRICKS ,
+
+ /** Vertical bricks.
+ */
+ DK4_GRA_PATTERN_VERTICAL_BRICKS ,
+
+ /** Horizontal lines.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_LINES ,
+
+ /** Vertical lines.
+ */
+ DK4_GRA_PATTERN_VERTICAL_LINES ,
+
+ /** Crosshatch of horizontal and vertical lines.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE ,
+
+ /** Horizontal shingles skewed to the left.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT ,
+
+ /** Horizontal shingles skewed to the right.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT ,
+
+ /** Vertical shingles skewed to one side.
+ */
+ DK4_GRA_PATTERN_VERTICAL_SHINGLES_1 ,
+
+ /** Vertical shingles skewed to the other side.
+ */
+ DK4_GRA_PATTERN_VERTICAL_SHINGLES_2 ,
+
+ /** Large fish scales.
+ */
+ DK4_GRA_PATTERN_LARGE_FISH_SCALES ,
+
+ /** Small fish scales.
+ */
+ DK4_GRA_PATTERN_SMALL_FISH_SCALES ,
+
+ /** Circles.
+ */
+ DK4_GRA_PATTERN_CIRCLES ,
+
+ /** Hexagons.
+ */
+ DK4_GRA_PATTERN_HEXAGONS ,
+
+ /** Octagons.
+ */
+ DK4_GRA_PATTERN_OCTAGONS ,
+
+ /** Horizontal tire treads.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_TIRES ,
+
+ /** Vertical tire treads.
+ */
+ DK4_GRA_PATTERN_VERTICAL_TIRES
+
+} dk4_gra_pattern_t;
+
+
+
+/** Maximum pattern number.
+*/
+enum {
+ /** Maximum pattern number.
+ */
+ DK4_GRA_PATTERN_MAX = DK4_GRA_PATTERN_VERTICAL_TIRES
+};
+
+
+
+/** Type of preamble line to add.
+*/
+enum {
+ DK4_GRA_PREAMBLE_FONT = 0 , /**< Line to load font package. */
+ DK4_GRA_PREAMBLE_PACKAGE , /**< Line to load other packages. */
+ DK4_GRA_PREAMBLE_OTHER /**< Any other configuration line. */
+};
+
+
+
+/** Output structure to produce a PS or EPS file.
+*/
+typedef struct {
+ int llev; /**< PS language level. */
+ int dsc; /**< Flag: Write DSC comments. */
+ int fspd; /**< Flag: Use setpagedevice for paper size. */
+ int fdu; /**< Flag: Duplex. */
+ int ftu; /**< Flag: Duplex and tumble. */
+} dk4_gra_ps_output_t;
+
+
+
+/** Output structure to produce a PDF file.
+*/
+typedef struct {
+ dk4_sto_t *s_imagno; /**< Images container by object number. */
+ dk4_sto_it_t *i_imagno; /**< Images iterator. */
+ dk4_sto_t *s_images; /**< Images container by data source. */
+ dk4_sto_it_t *i_images; /**< Images iterator. */
+ dk4_sto_t *s_objpos; /**< Object positions container. */
+ dk4_sto_it_t *i_objpos; /**< Object positions iterator. */
+ size_t nextobj; /**< Object number of next XObject. */
+ size_t unxo; /**< Number of XObjects without file name. */
+} dk4_gra_pdf_output_t;
+
+
+
+/** Output structure to produce a PGF file.
+*/
+typedef struct {
+ dk4_font_collector_t *fc; /**< Font collector. */
+ dk4_sto_t *s_imagno; /**< Images container by number. */
+ dk4_sto_it_t *i_imagno; /**< Images iterator. */
+ dk4_sto_t *s_images; /**< Images container by data source. */
+ dk4_sto_it_t *i_images; /**< Images iterator. */
+ dk4_sto_t *s_prelfo; /**< Containter for font setup. */
+ dk4_sto_it_t *i_prelfo; /**< Font setup iterator. */
+ dk4_sto_t *s_prelpa; /**< Container for packages. */
+ dk4_sto_it_t *i_prelpa; /**< Packages iterator. */
+ dk4_sto_t *s_prelot; /**< Container for other setup. */
+ dk4_sto_it_t *i_prelot; /**< Other setup iterator. */
+ double dfs; /**< Document font size. */
+ size_t n_images; /**< Next image number. */
+ size_t n_prelfo; /**< Number of font setup lines. */
+ size_t n_prelpa; /**< Number of package setup lines. */
+ size_t n_prelot; /**< Number of other setup lines. */
+ int sa; /**< Flag: Produce standalone doc. */
+} dk4_gra_pgf_output_t;
+
+
+
+/** Union of output structure types.
+*/
+typedef union {
+ dk4_gra_ps_output_t ps; /**< Produce PS/EPS output. */
+ dk4_gra_pdf_output_t pdf; /**< Produce PDF output. */
+ dk4_gra_pgf_output_t pgf; /**< Produce PGF output. */
+} dk4_gra_all_output_t;
+
+
+
+/** Output structure to produce a graphics file.
+*/
+typedef struct {
+ dk4_gra_all_output_t out; /**< Output structure. */
+ dk4_cs_conv_ctx_t cscctx; /**< Color space conversion context. */
+ dk4_sto_t *s_pages; /**< Pages container. */
+ dk4_sto_it_t *i_pages; /**< Iterator through container. */
+ dkChar *fn; /**< Output file name. */
+ void *curpg; /**< Current page. */
+ double cur_x; /**< Current x position. */
+ double cur_y; /**< Current y position. */
+ double patlw; /**< Pattern line width. */
+ size_t pages; /**< Number of pages. */
+ size_t w; /**< Image width. */
+ size_t h; /**< Image height. */
+ int dr; /**< Output driver. */
+ int gscp; /**< Flag: Graphics state pattern clip. */
+ int eor; /**< Flag: Use even-odd-rule fill clip. */
+ int le; /**< Previous error. */
+ int lec; /**< Previous error code. */
+ int len; /**< Number how often previous error. */
+ int docfl; /**< Document flag set. */
+} dk4_gra_t;
+
+
+
+/** Point coordinates in a graphics.
+*/
+typedef struct {
+ double x; /**< X value. */
+ double y; /**< Y value. */
+} dk4_gra_point_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Open output structure to create a PDF file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flags.
+ The flags can contain both document and page flags, page flags
+ here are applied as default page flags for pages added by the
+ dk4gra_page() function.
+
+ The following document flags are available:
+
+ - DK4_GRA_DOC_FLAG_PS2<br>
+ to produce PS level 2 instead of level 3,
+ - DK4_GRA_DOC_FLAG_EPS<br>
+ to produce EPS instead of PS,
+ - DK4_GRA_DOC_FLAG_PS_DSC<br>
+ to write document structuring comments,
+ - DK4_GRA_DOC_FLAG_FORCE_GRAY<br>
+ to enforce grayscaled output.
+
+ The following page flags are available:
+
+ - DK4_GRA_PAGE_FLAG_NO_CLIP<br>
+ to skip setting the clip path to page size,
+ - DK4_GRA_PAGE_FLAG_NO_BG<br>
+ to skip filling the page with a white background,
+ - DK4_GRA_PAGE_FLAG_NOT_COMPRESSED<br>
+ to create an uncompressed page contents stream
+ in PDF output (intended for debugging only).
+
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL, w or h is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available.
+*/
+
+dk4_gra_t *
+dk4gra_open_pdf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+);
+
+
+/** Open output structure to create a PS or EPS file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flags.
+ The flags can contain both document and page flags, page flags
+ here are applied as default page flags for pages added by the
+ dk4gra_page() function.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL, w or h is 0 or ll is neither 2 nor 3.
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available.
+*/
+
+dk4_gra_t *
+dk4gra_open_ps(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+);
+
+
+/** Open output structure to create a PGF file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flags.
+ The flags can contain both document and page flags, page flags
+ here are applied as default page flags for pages added by the
+ dk4gra_page() function.
+ @param sa Flag: Produce standalone TeX file.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL, w or h is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available.
+*/
+
+dk4_gra_t *
+dk4gra_open_pgf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_er_t *erp
+);
+
+
+/** Set color space conversion context.
+ @param gra Output structure.
+ @param ctx Color space conversion context to copy.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra or ctx is NULL.
+*/
+
+void
+dk4gra_set_color_conversion(
+ dk4_gra_t *gra,
+ dk4_cs_conv_ctx_t const *ctx,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Write output file and close output structure.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or in a state allowing this operation,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+
+*/
+
+void
+dk4gra_write_and_close(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Write output file and close output structure.
+ @param fout Output file already opened.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4gra_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Close output structure (without writing output file).
+ You might want to use this function instead of dk4gra_write_and_close()
+ if the drawing functions indicated an error.
+ @param gra Output structure.
+
+*/
+
+void
+dk4gra_close(
+ dk4_gra_t *gra
+);
+
+
+/** Start new page.
+ Default flags are used for the page:
+ - The clip path is set to the image dimensions.
+ - Background is filled white.
+ - For PDF the contents stream is compressed.
+ To start a new page with different setup, use dk4gra_page_with_flags()
+ instead and specify flags.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL, or in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_page(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Start new page with non-default setup.
+ @param gra Output structure.
+ @param flags Or-combined flags:
+ - DK4_GRA_PAGE_FLAG_NO_CLIP<br>
+ to avoid setting the clip path at start of page,
+ - DK4_GRA_PAGE_FLAG_NO_BG<br>
+ to avoid white background filling,
+ - DK4_GRA_PAGE_FLAG_NOT_COMPRESSED<br>
+ to avoid compression of page content stream in PDF.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_page_with_flags(
+ dk4_gra_t *gra,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set flag for simplified gsave/grestore handling.
+ Set this flag, if you use gsave and grestore only when dealing
+ with clip path for pattern filling.
+ @param gra Output structure.
+ @param val New flag value.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL.
+*/
+void
+dk4gra_set_gs_for_pattern_only(
+ dk4_gra_t *gra,
+ int val,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics state (especially clip path).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Restore graphics state (especially clip path).
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+
+/** Set line width.
+ @param gra Output structure.
+ @param lw Line width in bp.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set line style.
+ @param gra Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_line_style(
+ dk4_gra_t *gra,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set line cap.
+ @param gra Output structure.
+ @param lc Line cap type.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_line_cap(
+ dk4_gra_t *gra,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set line join.
+ @param gra Output structure.
+ @param lj Line join type.
+ @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_line_join(
+ dk4_gra_t *gra,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Check whether a combined fill and close operation is available
+ for an output structure.
+ @param gra Output structure to test.
+ @return 1 if a fill-and-close operation is available, 0 otherwise.
+*/
+
+int
+dk4gra_can_fill_and_stroke(
+ const dk4_gra_t *gra
+);
+
+
+/** Fill current path.
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Stroke current path.
+ Note: Use dk4gra_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Use current path for clipping.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line width for pattern drawing.
+ The pattern line width should be in range 0.0 to 2.0.
+ @param gra Output structure.
+ @param plw New pattern line width in bp.
+*/
+
+void
+dk4gra_set_pattern_line_width(
+ dk4_gra_t *gra,
+ double plw
+);
+
+/** Pattern a region (clipping should be set to the path).
+ @param gra Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set flag for even-odd-rule.
+ If this flag is on, the even-odd-rule is used for filling and
+ clipping. Otherwise the nonzero-winding rule is used.
+ By default this flag is turned on when creating a dk4_gra_t structure.
+ @param gra Output structure.
+ @param val New flag value.
+*/
+void
+dk4gra_set_eorule(
+ dk4_gra_t *gra,
+ int val
+);
+
+/** Start a new path and move to first point.
+ @param gra Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add line from current point to new point to path.
+ @param gra Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param gra Output structure.
+ @param xc1 X coordinate of first control point.
+ @param yc1 Y coordinate of first control point.
+ @param xc2 X coordinate of second control point.
+ @param yc2 Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Close current path.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for a circle.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add path for an arc.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for an ellipse.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in degree.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless a color is specified in colspec.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding, only used for char text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_pgf_simple_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless a color is specified in colspec.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_pgf_simple_utf8_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add special text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless a color is specified in colspec.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size.
+ @param fex Flag: Use exact font.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_pgf_special_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set the font size for the documentclass line.
+ @param gra Output structure, must be initialized for PGF.
+ @param fs Font size in pt.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+void
+dk4gra_pgf_doc_font_size(
+ dk4_gra_t *gra,
+ double fs,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add a preamble line.
+ For font setup and package setup the lines added by this function
+ replace the default contents.
+ For other setup the lines added by this function are appended
+ after the default contents.
+ @param gra Output structure, must be initialized for PGF.
+ @param line Line text without trailing newline.
+ @param tp Line type: DK4_GRA_PREAMBLE_FONT, DK4_GRA_PREAMBLE_PACKAGE,
+ or DK4_GRA_PREAMBLE_OTHER.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4gra_pgf_doc_preamble_line(
+ dk4_gra_t *gra,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image with coordinates transformations already calculated.
+ @param gra Output structure.
+ @param cotra Array containing 5 elements for coordinates transformations.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number. The frame number given here is used
+ by the PDF output driver only. You must call
+ dk4bif_set_current_frame() on the bitmap image file before calling
+ this function.
+ @param ifl Image flags.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or a frame number other than 0
+ was specified for PGF output or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4gra_bif_cotra_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image XFig style from opened bitmap image file.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or a frame number other than 0
+ was specified for PGF output or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_bif_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image from opened bitmap image file.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file data.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_bif_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image specified by file name.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image XFig style specified by file name.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/** Number of points to calculate for a circle or ellipse.
+*/
+enum {
+ /** Number of points to calculate for a circle
+ or ellipse.
+ */
+ DK4_GRA_CIRCLE_POINTS = 24
+};
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FLOAT_H
+#ifndef FLOAT_H_INCLUDED
+#include <float.h>
+#define FLOAT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4UC2L_H_INCLUDED
+#include "dk4uc2l.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include "dk4grat.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4FOPT_H_INCLUDED
+#include "dk4fopt.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+static
+void
+dk4gra_i_save_attributes(
+ dk4_gra_t *gra
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4gra_eps_save_attributes(gra);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dk4gra_pgf_save_attributes(gra);
+ } break;
+ default : {
+ dk4gra_pdf_save_attributes(gra);
+ } break;
+ }
+}
+
+
+
+static
+void
+dk4gra_i_restore_attributes(
+ dk4_gra_t *gra
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4gra_eps_restore_attributes(gra);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dk4gra_pgf_restore_attributes(gra);
+ } break;
+ default : {
+ dk4gra_pdf_restore_attributes(gra);
+ } break;
+ }
+}
+
+
+
+static
+void
+dk4gra_i_reset_attributes(
+ dk4_gra_t *gra
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4gra_eps_reset_attributes(gra);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dk4gra_pgf_reset_attributes(gra);
+ } break;
+ default : {
+ dk4gra_pdf_reset_attributes(gra);
+ } break;
+ }
+}
+
+
+
+static
+double
+dk4gra_i_to_range(double x, double min, double max)
+{
+ if (min > x) { x = min; }
+ if (max < x) { x = max; }
+ return x;
+}
+
+
+
+void
+dk4gra_close(
+ dk4_gra_t *gra
+)
+{
+ $? "+ dk4gra_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4gra_eps_close(gra);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dk4gra_pgf_close(gra);
+ } break;
+ default : {
+ dk4gra_pdf_close(gra);
+ } break;
+ }
+ finished:
+ $? "- dk4gra_close"
+ return;
+}
+
+
+
+dk4_gra_t *
+dk4gra_open_pdf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ $? "+ dk4gra_open_pdf \"%!ds\"", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if ((0 == w) || (0 == h)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = dk4gra_pdf_open(fn, w, h, docfl, erp);
+ finished:
+ $? "- dk4gra_open_pdf %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+dk4_gra_t *
+dk4gra_open_ps(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ $? "+ dk4gra_open_ps"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if ((0 == w) || (0 == h)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = dk4gra_eps_open(fn, w, h, docfl, erp);
+ finished:
+ $? "- dk4gra_open_ps %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+
+dk4_gra_t *
+dk4gra_open_pgf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ $? "+ dk4gra_open_pgf"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ if ((0 == w) || (0 == h)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = dk4gra_pgf_open(fn, w, h, docfl, sa, erp);
+ finished:
+ $? "- dk4gra_open_pgf %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+dk4gra_set_color_conversion(
+ dk4_gra_t *gra,
+ dk4_cs_conv_ctx_t const *ctx,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if ((NULL != gra) && (NULL != ctx)) {
+ DK4_MEMCPY(&(gra->cscctx),ctx,sizeof(dk4_cs_conv_ctx_t));
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if ((0 == back) && (NULL != backptr)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_write_file_and_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == gra->s_pages) || (NULL == gra->i_pages)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4gra_close(gra);
+ goto finished;
+ }
+ if ((0 == gra->pages) || (NULL == gra->curpg)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4gra_close(gra);
+ goto finished;
+ }
+
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_write_file_and_close(fout, gra, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_write_file_and_close(fout, gra, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_write_file_and_close(fout, gra, erp);
+ } break;
+ }
+
+ finished:
+ $? "- dk4gra_write_file_and_close %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_write_and_close(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ FILE *fout = NULL; /* Output file to write */
+ int tests = DK4_FOPEN_SC_USER; /* Tests for opening file */
+ int back = 0;
+#if DK4_ON_WINDOWS
+ int oldm = _O_TEXT; /* Previous DOS stdout mode */
+#endif
+ $? "+ dk4gra_write_and_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == gra->s_pages) || (NULL == gra->i_pages)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4gra_close(gra);
+ goto finished;
+ }
+ if ((0 == gra->pages) || (NULL == gra->curpg)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4gra_close(gra);
+ goto finished;
+ }
+
+ /* Open and write output file if name specified, otherwise
+ write to standard output.
+ */
+ if (NULL != gra->fn) {
+ if (0 != dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
+ fout = dk4fopen(gra->fn, dkT("wb"), tests, erp);
+ if (NULL != fout) {
+ back = 1;
+ dk4gra_write_file_and_close(fout, gra, &back, erp);
+ if (0 != fclose(fout)) {
+ dk4error_set_simple_error_code(erp, DK4_E_CLOSE_FAILED);
+ back = 0;
+ }
+ }
+ else {
+ dk4gra_close(gra);
+ }
+ }
+ else {
+ back = 1;
+#if DK4_ON_WINDOWS
+ oldm = _setmode(_fileno(stdout), _O_BINARY);
+#endif
+ dk4gra_write_file_and_close(stdout, gra, &back, erp);
+#if DK4_ON_WINDOWS
+ _setmode(_fileno(stdout), oldm);
+#endif
+ }
+
+ finished:
+ $? "- dk4gra_write_and_close %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_page_with_flags(
+ dk4_gra_t *gra,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_page"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ $? "! gra"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ gra->cur_x = 0.0;
+ gra->cur_y = 0.0;
+ if ((NULL == gra->s_pages) || (NULL == gra->i_pages)) {
+ $? "! s_pages, i_pages"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ $? ". eps driver"
+ back = dk4gra_eps_page(gra, flags, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ $? ". pgf driver"
+ back = dk4gra_pgf_page(gra, flags, erp);
+ } break;
+ default : {
+ $? ". pdf driver"
+ back = dk4gra_pdf_page(gra, flags, erp);
+ } break;
+ }
+ finished:
+ $? "- dk4gra_page %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_page(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ dk4gra_page_with_flags(gra, gra->docfl, backptr, erp);
+}
+
+
+
+void
+dk4gra_i_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_gsave(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_gsave(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_gsave(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_grestore(
+ dk4_gra_t *gra,
+ int res,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_grestore(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_grestore(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_grestore(gra, erp)) {
+ if (NULL != backptr) { * backptr = 0; }
+ }
+ } break;
+ }
+ if ((0 != gra->gscp) && (0 != res)) {
+ dk4gra_i_reset_attributes(gra);
+ }
+}
+
+
+
+void
+dk4gra_i_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_prepare_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_prepare_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_prepare_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+void
+dk4gra_i_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_prepare_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_prepare_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_prepare_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+void
+dk4gra_i_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_prepare_fill_and_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_prepare_fill_and_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_fill(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) {*backptr = 0; }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_fill_and_stroke(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_fill_and_stroke(gra, erp)) {
+ if (NULL != backptr) {*backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_i_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_clip(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_clip(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_clip(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+}
+
+
+
+void
+dk4gra_set_eorule(
+ dk4_gra_t *gra,
+ int val
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL != gra) {
+ gra->eor = val;
+ }
+}
+
+
+
+void
+dk4gra_i_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4gra_i_newpath_moveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ $? ". PS/EPS"
+ if (0 == dk4gra_eps_newpath_moveto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ $? ". PGF"
+ if (0 == dk4gra_pgf_newpath_moveto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ $? ". PDF"
+ if (0 == dk4gra_pdf_newpath_moveto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+ $? "- dk4gra_i_newpath_moveto"
+}
+
+
+
+void
+dk4gra_i_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4gra_i_lineto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_lineto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_lineto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_lineto(gra, x, y, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+ $? "- dk4gra_i_lineto"
+}
+
+
+
+void
+dk4gra_i_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4gra_i_curveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_curveto(gra,xc1,yc1,xc2,yc2,x,y,erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_curveto(gra,xc1,yc1,xc2,yc2,x,y,erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_curveto(gra,xc1,yc1,xc2,yc2,x,y,erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+ $? "- dk4gra_i_curveto"
+}
+
+
+
+void
+dk4gra_i_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4gra_i_closepath"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_closepath(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_closepath(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ if (0 == dk4gra_pdf_closepath(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ }
+ $? "- dk4gra_i_closepath"
+}
+
+
+
+void
+dk4gra_i_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t points[DK4_GRA_CIRCLE_POINTS]; /* Points for circle */
+ size_t i; /* Index of current point */
+ size_t c1; /* Index of first control point after point */
+ size_t c2; /* Index of second control point after point */
+ size_t c3; /* Index of third control point after point */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+
+ /* 2017-10-31
+ The TikZ and PGF manual explains that the pgfpathellipse command will
+ apply coordinate transformations to all coordinates.
+ So better calculate the curve ourselves.
+ */
+
+ if ( 0 == dk4gratool_points_for_ellipse(
+ points, DK4_GRA_CIRCLE_POINTS, xc, yc, rx, ry, rot, erp
+ )
+ ) {
+ if (NULL != backptr) { *backptr = 0; }
+ goto finished;
+ }
+ /* Construct path as cycle of Bezier segments
+ */
+ for (i = 0; i < ((DK4_GRA_CIRCLE_POINTS) / 3); i++) {
+ if (0 == i) {
+ dk4gra_i_newpath_moveto(gra,points[0].x,points[0].y,backptr,erp);
+ }
+ c1 = 3 * i + 1;
+ c2 = 3 * i + 2;
+ c3 = 3 * i + 3;
+ if (DK4_GRA_CIRCLE_POINTS <= c3) { c3 = 0; }
+ dk4gra_i_curveto(
+ gra, points[c1].x, points[c1].y,
+ points[c2].x, points[c2].y, points[c3].x, points[c3].y, backptr, erp
+ );
+ }
+ dk4gra_i_closepath(gra, backptr, erp);
+ if (NULL != bbptr) {
+ for (i = 0; i < ((DK4_GRA_CIRCLE_POINTS) / 3); i++) {
+ c1 = 3 * i + 1;
+ c2 = 3 * i + 2;
+ c3 = 3 * i + 3;
+ if (DK4_GRA_CIRCLE_POINTS <= c3) { c3 = 0; }
+ dk4bb_add_bezier(
+ bbptr,
+ points[i].x, points[i].y, points[c1].x, points[c1].y,
+ points[c2].x, points[c2].y, points[c3].x, points[c3].y
+ );
+ }
+ $? ". test 1"
+ $? ". xmin=%g", bbptr->xmin
+ $? ". xmax=%g", bbptr->xmax
+ $? ". ymin=%g", bbptr->ymin
+ $? ". ymax=%g", bbptr->ymax
+ dk4bb_add_rotated_ellipse(bbptr, xc, yc, rx, ry, rot);
+ $? ". test 2"
+ $? ". xmin=%g", bbptr->xmin
+ $? ". xmax=%g", bbptr->xmax
+ $? ". ymin=%g", bbptr->ymin
+ $? ". ymax=%g", bbptr->ymax
+ }
+
+ finished:
+ return;
+}
+
+
+
+void
+dk4gra_i_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4gra_i_circle"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_circle(gra, xc, yc, r, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_circle(gra, xc, yc, r, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ default : {
+ dk4gra_i_ellipse(gra, xc, yc, r, r, 0.0, NULL, backptr, erp);
+ } break;
+ }
+ $? "- dk4gra_i_circle"
+}
+
+
+
+void
+dk4gra_i_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double dx; /* Width */
+ double dy; /* Height */
+ double xc1; /* Control point coordinates for rounded corners */
+ double yc1;
+ double xc2;
+ double yc2;
+ $? "+ dk4gra_i_rectangle"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ $!trace-code if (NULL != backptr) {
+ $? ". *backptr = %d", *backptr
+ $!trace-code }
+ if (0.0 < r) {
+ dx = xr - xl;
+ dy = yt - yb;
+ dx = 0.4999 * fabs(dx);
+ dy = 0.4999 * fabs(dy);
+ if (r > dx) { $? ". r = %g dx = %g", r, dx
+ r = dx;
+#if 0
+ /* Silently correct radius
+ */
+ if (NULL != backptr) { $? "! r > dx"
+ *backptr = 0;
+ }
+#endif
+ }
+ if (r > dy) { $? ". r = %g dy = %g", r, dy
+ r = dy;
+#if 0
+ /* Silently correct radius
+ */
+ if (NULL != backptr) { $? "! r > dy"
+ *backptr = 0;
+ }
+#endif
+ }
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_rectangle(gra, xl, xr, yb, yt, r, erp)) {
+ if (NULL != backptr) { $? "! dk4gra_eps_rectangle"
+ *backptr = 0;
+ }
+ }
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (0 == dk4gra_pgf_rectangle(gra, xl, xr, yb, yt, r, erp)) {
+ if (NULL != backptr) { $? "! dk4gra_pgf_rectangle"
+ *backptr = 0;
+ }
+ }
+ } break;
+ default : {
+ if (0.0 >= r) {
+ dk4gra_i_newpath_moveto(gra, xl, yb, backptr, erp);
+ dk4gra_i_lineto(gra, xr, yb, backptr, erp);
+ dk4gra_i_lineto(gra, xr, yt, backptr, erp);
+ dk4gra_i_lineto(gra, xl, yt, backptr, erp);
+ dk4gra_i_closepath(gra, backptr, erp);
+ }
+ else {
+ dk4gra_i_newpath_moveto(gra, (xl + r), yb, backptr, erp);
+ dk4gra_i_lineto(gra, (xr - r), yb, backptr, erp);
+ xc1 = xr - (1.0 - KAPPA_4) * r;
+ yc1 = yb;
+ xc2 = xr;
+ yc2 = yb + (1.0 - KAPPA_4) * r;
+ dk4gra_i_curveto(gra,xc1,yc1,xc2,yc2,xr,(yb+r),backptr,erp);
+ dk4gra_i_lineto(gra, xr, (yt - r), backptr, erp);
+ xc1 = xr;
+ yc1 = yt - (1.0 - KAPPA_4) * r;
+ xc2 = xr - (1.0 - KAPPA_4) * r;
+ yc2 = yt;
+ dk4gra_i_curveto(gra,xc1,yc1,xc2,yc2,(xr-r),yt,backptr,erp);
+ dk4gra_i_lineto(gra, (xl+r), yt, backptr, erp);
+ xc1 = xl + (1.0 - KAPPA_4) * r;
+ yc1 = yt;
+ xc2 = xl;
+ yc2 = yt - (1.0 - KAPPA_4) * r;
+ dk4gra_i_curveto(gra,xc1,yc1,xc2,yc2,xl,(yt-r),backptr,erp);
+ dk4gra_i_lineto(gra, xl, (yb + r), backptr, erp);
+ xc1 = xl;
+ yc1 = yb + (1.0 - KAPPA_4) * r;
+ xc2 = xl + (1.0 - KAPPA_4) * r;
+ yc2 = yb;
+ dk4gra_i_curveto(gra,xc1,yc1,xc2,yc2,(xl+r),yb,backptr,erp);
+ dk4gra_i_closepath(gra, backptr, erp);
+ }
+ } break;
+ }
+ $? "- dk4gra_i_rectangle"
+}
+
+
+
+void
+dk4gra_i_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double angdiff; /* Angle difference end - start */
+ double x0; /* Start of current arc segment */
+ double y0; /* Start of current arc segment */
+ double dxdt0; /* First x derivative at start */
+ double dydt0; /* First y derivative at start */
+ double x1; /* End of current arg segment */
+ double y1; /* End of current arg segment */
+ double dxdt1; /* First x derivative at end */
+ double dydt1; /* First y derivative at end */
+ double segcalc; /* Number of segments */
+ double seglgt; /* Angle per segment */
+ double kappa; /* Kappa value */
+ double segend; /* Angle at end of segment */
+ size_t segments; /* Number of segments */
+ size_t i; /* Current segment to draw */
+ $? "+ dk4gra_i_arc"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_arc(gra, xc, yc, ra, start, end, cl, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } break;
+ /* 2017-10-31
+ The TikZ and PGF manual warns the computation done by the
+ pgfpatharcto command are numerically very unstable and the arc
+ will not necessary end at the intended end point.
+ So we do not use that command and do the necessary calculations
+ ourselves in the default branch.
+ */
+ default : {
+ start *= M_PI;
+ end *= M_PI;
+ start /= 180.0;
+ end /= 180.0;
+ angdiff = end - start;
+ segcalc = angdiff * 4.0 / M_PI;
+ segments = (size_t)ceil(segcalc);
+ seglgt = angdiff / (double)segments;
+ kappa = dk4gratool_kappa_for_angle(seglgt);
+ x0 = xc + ra * cos(start);
+ y0 = yc + ra * sin(start);
+ dxdt0 = -1.0 * ra * seglgt * sin(start);
+ dydt0 = ra * seglgt * cos(start);
+ dk4gra_i_newpath_moveto(gra, x0, y0, backptr, erp);
+ for (i = 0; i < segments; i++) {
+ segend = start + angdiff * (double)(i + 1) / (double)segments;
+ x1 = xc + ra * cos(segend);
+ y1 = yc + ra * sin(segend);
+ dxdt1 = -1.0 * ra * seglgt * sin(segend);
+ dydt1 = ra * seglgt * cos(segend);
+ dk4gra_i_curveto(gra,
+ x0 + kappa * dxdt0,
+ y0 + kappa * dydt0,
+ x1 - kappa * dxdt1,
+ y1 - kappa * dydt1,
+ x1,
+ y1,
+ backptr, erp
+ );
+ x0 = x1;
+ y0 = y1;
+ dxdt0 = dxdt1;
+ dydt0 = dydt1;
+ }
+ if (0 != cl) {
+ dk4gra_i_lineto(gra, xc, yc, backptr, erp);
+ dk4gra_i_closepath(gra, backptr, erp);
+ }
+ } break;
+ }
+ $? "- dk4gra_i_arc"
+}
+
+
+void
+dk4gra_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_gsave"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_gsave(gra, &back, erp);
+
+ finished:
+ $? "- dk4gra_gsave %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_grestore"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_grestore(gra, 1, &back, erp);
+
+ finished:
+ $? "- dk4gra_grestore %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_gs_for_pattern_only(
+ dk4_gra_t *gra,
+ int val,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL != gra) {
+ gra->gscp = ((0 != val) ? (1) : (0));
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+}
+
+
+
+void
+dk4gra_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_set_line_width"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_line_width(gra, lw, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_line_width(gra, lw, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_line_width(gra, lw, erp);
+ } break;
+ }
+ finished:
+ $? "- dk4gra_set_line_width %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_line_style(
+ dk4_gra_t *gra,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_set_line_style"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_line_style(gra, ls, sv, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_line_style(gra, ls, sv, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_line_style(gra, ls, sv, erp);
+ } break;
+ }
+ finished:
+ $? "- dk4gra_set_line_style %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_line_cap(
+ dk4_gra_t *gra,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_set_line_cap"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_line_cap(gra, lc, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_line_cap(gra, lc, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_line_cap(gra, lc, erp);
+ } break;
+ }
+ finished:
+ $? "- dk4gra_set_line_cap %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_line_join(
+ dk4_gra_t *gra,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_set_line_join"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_line_join(gra, lj, ml, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_line_join(gra, lj, ml, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_line_join(gra, lj, ml, erp);
+ } break;
+ }
+ finished:
+ $? "- dk4gra_set_line_join %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_set_fill_gray"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ g = dk4gra_i_to_range(g, 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_gray(gra, g, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_gray(gra, g, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_gray(gra, g, erp);
+ } break;
+ }
+ finished:
+ $? "- dk4gra_set_fill_gray %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double array1[4];
+ double array2[4];
+ double array3[4];
+ size_t i;
+ int back = 0;
+ $? "+ dk4gra_set_fill_rgb"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ r = dk4gra_i_to_range(r, 0.0, 1.0);
+ g = dk4gra_i_to_range(g, 0.0, 1.0);
+ b = dk4gra_i_to_range(b, 0.0, 1.0);
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ for (i = 0; i < 4 ; i++) { array1[i] = array2[i] = array3[i] = 0.0; }
+ array1[0] = r; array1[1] = g; array1[2] = b;
+ dk4cs_color_convert(
+ array2, DK4_CS_GRAY, 4, array1, DK4_CS_RGB, 3,
+ array3, 3, &(gra->cscctx), erp
+ );
+ array2[0] = dk4gra_i_to_range(array2[0], 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_gray(gra, array2[0], erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_gray(gra, array2[0], erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_gray(gra, array2[0], erp);
+ } break;
+ }
+ }
+ else {
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_rgb(gra, r, g, b, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_rgb(gra, r, g, b, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_rgb(gra, r, g, b, erp);
+ } break;
+ }
+ }
+
+ finished:
+ $? "- dk4gra_set_fill_rgb %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double array1[4];
+ double array2[4];
+ double array3[4];
+ size_t i;
+ int back = 0;
+ $? "+ dk4gra_set_fill_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ c = dk4gra_i_to_range(c, 0.0, 1.0);
+ m = dk4gra_i_to_range(m, 0.0, 1.0);
+ y = dk4gra_i_to_range(y, 0.0, 1.0);
+ k = dk4gra_i_to_range(k, 0.0, 1.0);
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ for (i = 0; i < 4 ; i++) { array1[i] = array2[i] = array3[i] = 0.0; }
+ array1[0] = c; array1[1] = m; array1[2] = y; array1[3] = k;
+ dk4cs_color_convert(
+ array2, DK4_CS_GRAY, 4, array1, DK4_CS_CMYK, 4,
+ array3, 4, &(gra->cscctx), erp
+ );
+ array2[0] = dk4gra_i_to_range(array2[0], 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_gray(gra, array2[0], erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_gray(gra, array2[0], erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_gray(gra, array2[0], erp);
+ } break;
+ }
+ }
+ else {
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_fill_cmyk(gra, c, m, y, k, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_fill_cmyk(gra, c, m, y, k, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_fill_cmyk(gra, c, m, y, k, erp);
+ } break;
+ }
+ }
+
+ finished:
+ $? "- dk4gra_set_fill_cmyk %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_set_stroke_gray"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ g = dk4gra_i_to_range(g, 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_gray(gra, g, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_gray(gra, g, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_gray(gra, g, erp);
+ } break;
+ }
+ finished:
+ $? "- dk4gra_set_stroke_gray %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double array1[4];
+ double array2[4];
+ double array3[4];
+ size_t i;
+ int back = 0;
+ $? "+ dk4gra_set_stroke_rgb"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ r = dk4gra_i_to_range(r, 0.0, 1.0);
+ g = dk4gra_i_to_range(g, 0.0, 1.0);
+ b = dk4gra_i_to_range(b, 0.0, 1.0);
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ /*
+ Force gray
+ */
+ for (i = 0; i < 4 ; i++) { array1[i] = array2[i] = array3[i] = 0.0; }
+ array1[0] = r; array1[1] = g; array1[2] = b;
+ dk4cs_color_convert(
+ array2, DK4_CS_GRAY, 4, array1, DK4_CS_RGB, 3,
+ array3, 3, &(gra->cscctx), erp
+ );
+ array2[0] = dk4gra_i_to_range(array2[0], 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ }
+ }
+ else {
+ /*
+ RGB allowed
+ */
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_rgb(gra, r, g, b, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_rgb(gra, r, g, b, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_rgb(gra, r, g, b, erp);
+ } break;
+ }
+ }
+
+ finished:
+ $? "- dk4gra_set_stroke_rgb %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double array1[4];
+ double array2[4];
+ double array3[4];
+ size_t i;
+ int back = 0;
+ $? "+ dk4gra_set_stroke_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ c = dk4gra_i_to_range(c, 0.0, 1.0);
+ m = dk4gra_i_to_range(m, 0.0, 1.0);
+ y = dk4gra_i_to_range(y, 0.0, 1.0);
+ k = dk4gra_i_to_range(k, 0.0, 1.0);
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ /*
+ Force gray
+ */
+ for (i = 0; i < 4 ; i++) { array1[i] = array2[i] = array3[i] = 0.0; }
+ array1[0] = c; array1[1] = m; array1[2] = y; array1[3] = k;
+ dk4cs_color_convert(
+ array2, DK4_CS_GRAY, 4, array1, DK4_CS_CMYK, 3,
+ array3, 3, &(gra->cscctx), erp
+ );
+ array2[0] = dk4gra_i_to_range(array2[0], 0.0, 1.0);
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_gray(gra, array2[0], erp);
+ } break;
+ }
+ }
+ else {
+ /*
+ CMYK allowed
+ */
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_set_stroke_cmyk(gra, c, m, y, k, erp);
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = dk4gra_pgf_set_stroke_cmyk(gra, c, m, y, k, erp);
+ } break;
+ default : {
+ back = dk4gra_pdf_set_stroke_cmyk(gra, c, m, y, k, erp);
+ } break;
+ }
+ }
+
+ finished:
+ $? "- dk4gra_set_stroke_cmyk %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+
+void
+dk4gra_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_prepare_fill"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_prepare_fill(gra, &back, erp);
+
+ finished:
+ $? "- dk4gra_prepare_fill %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_prepare_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_prepare_stroke(gra, &back, erp);
+
+ finished:
+ $? "- dk4gra_prepare_stroke %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_prepare_fill_and_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_prepare_fill_and_stroke(gra, &back, erp);
+
+ finished:
+ $? "- dk4gra_prepare_fill_and_stroke %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+int
+dk4gra_can_fill_and_stroke(
+ const dk4_gra_t *gra
+)
+{
+ int back = 0;
+ $? "+ dk4gra_can_fill_and_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = 0;
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ back = 1;
+ } break;
+ default : {
+ back = 1;
+ } break;
+ }
+ $? "- dk4gra_can_fill_and_stroke %d", back
+ return back;
+}
+
+
+
+void
+dk4gra_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_fill"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_fill(gra, &back, erp);
+
+ finished:
+ $? "- dk4gra_fill %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_stroke(gra, &back, erp);
+
+ finished:
+ $? "- dk4gra_stroke %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_fill_and_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_fill_and_stroke(gra, &back, erp);
+
+ finished:
+ $? "- dk4gra_fill_and_stroke %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_clip"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_clip(gra, &back, erp);
+
+ finished:
+ $? "- dk4gra_clip %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_newpath_moveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ gra->cur_x = x;
+ gra->cur_y = y;
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, x);
+ dk4bb_add_y(bbptr, y);
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_newpath_moveto(gra, x, y, &back, erp);
+ finished:
+ $? "- dk4gra_newpath_moveto %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_lineto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ gra->cur_x = x;
+ gra->cur_y = y;
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, x);
+ dk4bb_add_y(bbptr, y);
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_lineto(gra, x, y, &back, erp);
+ finished:
+ $? "- dk4gra_lineto %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_curveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_bezier(
+ bbptr, gra->cur_x, gra->cur_y, xc1, yc1, xc2, yc2, x, y
+ );
+ }
+ gra->cur_x = x;
+ gra->cur_y = y;
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_curveto(gra, xc1, yc1, xc2, yc2, x, y, &back, erp);
+ finished:
+ $? "- dk4gra_curveto %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_closepath"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_closepath(gra, &back, erp);
+ finished:
+ $? "- dk4gra_closepath %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_circle"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if ((NULL == gra) || (0.0 >= r)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xc - r); dk4bb_add_x(bbptr, xc + r);
+ dk4bb_add_y(bbptr, yc - r); dk4bb_add_y(bbptr, yc + r);
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_circle(gra, xc, yc, r, &back, erp);
+
+ finished:
+ $? "- dk4gra_circle %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+void
+dk4gra_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_rectangle"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_rectangle(gra, xl, xr, yb, yt, r, &back, erp);
+
+ finished:
+ $? "- dk4gra_rectangle %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_arc"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if ((NULL == gra) || (0.0 >= ra)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xc + ra * cos((M_PI * start)/ 180.0));
+ dk4bb_add_y(bbptr, yc + ra * sin((M_PI * start)/ 180.0));
+ dk4bb_add_x(bbptr, xc + ra * cos((M_PI * end)/ 180.0));
+ dk4bb_add_y(bbptr, yc + ra * sin((M_PI * end)/ 180.0));
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_arc(gra, xc, yc, ra, start, end, cl, &back, erp);
+ finished:
+ $? "- dk4gra_arc %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_ellipse"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ rot *= M_PI;
+ rot /= 180.0;
+ if ((NULL == gra) || (0.0 >= rx) || (0.0 >= ry)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_i_ellipse(gra, xc, yc, rx, ry, rot, bbptr, &back, erp);
+
+ finished:
+ $? "- dk4gra_ellipse %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double val[16]; /* Values passed to EPS pattern functions */
+ double y01; /* Temporary value */
+ double y02; /* Temporary value */
+ dk4_gra_lc_t lc; /* Line cap used while drawing the pattern */
+ dk4_gra_lj_t lj; /* Line join used while drawing the pattern */
+ dk4_gra_ls_t ls; /* Line style used while drawing the pattern */
+ int back = 0;
+ $? "+ dk4gra_pattern"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == gra->curpg) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Extend pattern area for line width
+ */
+#if VERSION_BEFORE_20181212
+ xl -= 0.9; xr += 0.9; yb -= 0.9; yt += 0.9;
+#else
+ xl -= gra->patlw; xr += gra->patlw; yb -= gra->patlw; yt += gra->patlw;
+#endif
+ /*
+ Calculate arguments for EPS pattern functions
+ */
+ val[0] = xl;
+ val[1] = xr;
+ val[2] = yb;
+ val[3] = yt;
+ val[4] = 3.6;
+ switch (pn) {
+ case DK4_GRA_PATTERN_30_DEGREE_RIGHT : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ val[2] -= ((val[1] - val[0]) / sqrt(3.0));
+ val[4] = 7.2 / sqrt(3.0);
+ y01 = val[2] - val[0] / sqrt(3.0);
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 = y02 * val[4];
+ val[2] -= (y01 - y02);
+ } break;
+ case DK4_GRA_PATTERN_30_DEGREE_SIEVE : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ val[2] -= ((val[1] - val[0]) / sqrt(3.0));
+ val[4] = 7.2 / sqrt(3.0);
+ y01 = val[2] + val[1] / sqrt(3.0);
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 = y02 * val[4];
+ val[2] -= (y01 - y02);
+ y01 = val[0] - val[2] * sqrt(3.0);
+ y02 = y01 / 7.2;
+ y02 = floor(y02);
+ y02 = y02 * 7.2;
+ val[0] -= (y01 - y02);
+ val[2] -= val[4];
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_LEFT : {
+ val[2] -= (val[1] - val[0]);
+ val[4] = 3.6 * M_SQRT2;
+ y01 = val[2] + val[1];
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 *= val[4];
+ val[2] -= (y01 - y02);
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_RIGHT : {
+ val[2] -= (val[1] - val[0]);
+ val[4] = 3.6 * M_SQRT2;
+ y01 = val[2] - val[0];
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 *= val[4];
+ val[2] -= (y01 - y02);
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_SIEVE : {
+ val[2] -= (val[1] - val[0]);
+ val[4] = 3.6 * M_SQRT2;
+ y01 = val[2] + val[1];
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 *= val[4];
+ val[2] -= (y01 - y02);
+ y01 = val[0] - val[2];
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 *= val[4];
+ val[0] -= (y01 - y02);
+ val[2] -= val[4];
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_BRICKS : {
+ y01 = val[2] / 7.2;
+ y01 = floor(y01);
+ val[2] = y01 * 7.2;
+ y01 = val[0] / 14.4;
+ y01 = floor(y01);
+ val[0] = y01 * 14.4;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_BRICKS : {
+ y01 = val[2] / 14.4;
+ y01 = floor(y01);
+ val[2] = y01 * 14.4;
+ y01 = val[0] / 7.2;
+ y01 = floor(y01);
+ val[0] = y01 * 7.2;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_LINES : {
+ y01 = val[2] / 3.6;
+ y01 = floor(y01);
+ val[2] = y01 * 3.6;
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_LINES : {
+ y01 = val[0] / 3.6;
+ y01 = floor(y01);
+ val[0] = y01 * 3.6;
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE : {
+ y01 = val[2] / 3.6;
+ y01 = floor(y01);
+ val[2] = y01 * 3.6;
+ y01 = val[0] / 3.6;
+ y01 = floor(y01);
+ val[0] = y01 * 3.6;
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT : {
+ y01 = val[2] / 28.8;
+ y01 = floor(y01);
+ val[2] = y01 * 28.8;
+ y01 = val[0] / 14.4;
+ y01 = floor(y01);
+ val[0] = y01 * 14.4;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT : {
+ y01 = val[2] / 28.8;
+ y01 = floor(y01);
+ val[2] = y01 * 28.8;
+ y01 = val[0] / 14.4;
+ y01 = floor(y01);
+ val[0] = y01 * 14.4;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_1 : {
+ y01 = val[2] / 14.4;
+ y01 = floor(y01);
+ val[2] = y01 * 14.4;
+ y01 = val[0] / 28.8;
+ y01 = floor(y01);
+ val[0] = y01 * 28.8;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_2 : {
+ y01 = val[2] / 14.4;
+ y01 = floor(y01);
+ val[2] = y01 * 14.4;
+ y01 = val[0] / 28.8;
+ y01 = floor(y01);
+ val[0] = y01 * 28.8;
+ val[4] = 7.2;
+ } break;
+ case DK4_GRA_PATTERN_LARGE_FISH_SCALES : {
+ /* xs xe ys ye dx dy r a1 a2 */
+ val[4] = 14.54;
+ val[5] = 3.7;
+ val[6] = 9.0;
+ val[7] = 216.1;
+ val[8] = 323.9;
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / (2 * val[5]);
+ y01 = floor(y01);
+ val[2] = 2.0 * y01 * val[5];
+ } break;
+ case DK4_GRA_PATTERN_SMALL_FISH_SCALES : {
+ /* xs xe ys ye dx dy r a1 a2 */
+ val[4] = 7.2;
+ val[5] = 3.6;
+ val[6] = 3.6;
+ val[7] = 180.0;
+ val[8] = 360.0;
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / (2 * val[5]);
+ y01 = floor(y01);
+ val[2] = 2.0 * y01 * val[5];
+ } break;
+ case DK4_GRA_PATTERN_CIRCLES : {
+ val[4] = 7.2;
+ y01 = val[0] / 14.4;
+ y01 = floor(y01);
+ val[0] = 14.4 * y01;
+ y01 = val[2] / 14.4;
+ y01 = floor(y01);
+ val[2] = 14.4 * y01;
+ } break;
+ case DK4_GRA_PATTERN_HEXAGONS : {
+ /* xs xe ys ye dx dy */
+ val[4] = 21.6;
+ val[5] = 12.47;
+ y01 = val[0] / 21.6;
+ y01 = floor(y01);
+ val[0] = y01 * 21.6;
+ y01 = val[2] / 12.47;
+ y01 = floor(y01);
+ val[2] = y01 * 12.47;
+ } break;
+ case DK4_GRA_PATTERN_OCTAGONS : {
+ /* xs xe ys ye dx co */
+ /* 2020-08-10 Bugfix
+ Pattern size too small, increased now.
+ */
+ val[4] = 14.4; /* previously 7.2; */
+ val[5] = 4.22; /* previously 2.11; */
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / val[4];
+ y01 = floor(y01);
+ val[2] = y01 * val[4];
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_TIRES : {
+ val[4] = 7.2;
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / val[4];
+ y01 = floor(y01);
+ val[2] = y01 * val[4];
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_TIRES : {
+ val[4] = 7.2;
+ y01 = val[0] / val[4];
+ y01 = floor(y01);
+ val[0] = y01 * val[4];
+ y01 = val[2] / val[4];
+ y01 = floor(y01);
+ val[2] = y01 * val[4];
+ } break;
+ /* DK4_GRA_PATTERN_30_DEGREE_LEFT */
+ default : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ val[2] -= ((val[1] - val[0]) / sqrt(3.0));
+ val[4] = 7.2 / sqrt(3.0);
+ y01 = val[2] + val[1] / sqrt(3.0);
+ y02 = y01 / val[4];
+ y02 = floor(y02);
+ y02 = y02 * val[4];
+ val[2] -= (y01 - y02);
+ } break;
+ }
+
+ back = 1;
+
+ /* Save attributes and graphics state
+ */
+ dk4gra_i_save_attributes(gra);
+ dk4gra_i_gsave(gra, &back, erp);
+
+ /* Set attributes for stroking
+ */
+ dk4gra_set_line_width(gra, gra->patlw, &back, erp);
+ lc = DK4_GRA_LC_ROUNDED;
+ dk4gra_set_line_cap(gra, lc, &back, erp);
+ lj = DK4_GRA_LJ_MITERED;
+ switch (pn) {
+ case DK4_GRA_PATTERN_LARGE_FISH_SCALES:
+ case DK4_GRA_PATTERN_SMALL_FISH_SCALES: {
+ lj = DK4_GRA_LJ_ROUNDED;
+ } break;
+ default : {
+ /* Intentionally empty to avoid compiler warnings. */
+ } break;
+ }
+ dk4gra_set_line_join(gra, lj, 10.0, &back, erp);
+ ls = DK4_GRA_LS_SOLID;
+ dk4gra_set_line_style(gra, ls, 3.6, &back, erp);
+ dk4gra_prepare_stroke(gra, &back, erp);
+
+ /*
+ Driver specific pattern functions
+ */
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ if (0 == dk4gra_eps_pattern(gra, pn, val, erp)) {
+ back = 0;
+ }
+ } break;
+ default : {
+ dk4gra_i_pattern(gra, xl, xr, yb, yt, pn, val, &back, erp);
+ } break;
+ }
+
+ /* Restore graphics state and attributes
+ */
+ dk4gra_i_grestore(gra, 0, &back, erp);
+ dk4gra_i_restore_attributes(gra);
+
+
+ finished:
+ $? "- dk4gra_pattern %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_bif_cotra_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+ int cs; /* Color space */
+ int back = 0;
+ dk4_px_bit_depth_t bpc; /* Number of bits per component */
+
+ $? "+ dk4gra_bif_cotra_image \"%!ds\"", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != bif);
+ assert(NULL != cotra);
+#endif
+ /*
+ Check arguments
+ */
+ if ((NULL == gra) || (NULL == cotra) || (NULL == bif)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* When enforcing grayscaled output, do not write colored image
+ */
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ /* Direct re-use of DCT encoded data requires a file name
+ */
+ if (NULL == fn) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ /* Direct re-use of DCT encoded data requires given bits per component
+ */
+ bpc = dk4bif_get_original_bit_depth(bif);
+ if (8 != bpc) {
+ if (4 != bpc) {
+ if (2 != bpc) {
+ if (1 != bpc) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ }
+ /* Direct re-use of DCT encoded data restricts color spaces
+ */
+ cs = dk4bif_get_color_space(bif);
+ if (DK4_CS_GRAY != cs) {
+ if (DK4_CS_RGB != cs) {
+ if (DK4_CS_CMYK != cs) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ /* Direct re-use of DCT encoded data impossible for colored
+ images when enforcing grayscaled output
+ */
+ if ((DK4_CS_GRAY != cs) && (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ back = dk4gra_eps_bif_fig_image(
+ gra, cotra, bif, fn,
+ ifl, erp
+ );
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ if (NULL != fn) {
+ back = dk4gra_pgf_bif_fig_image(
+ gra, cotra, bif, fn,
+ ifl, erp
+ );
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ default : { /* PDF */
+ back = dk4gra_pdf_bif_fig_image(
+ gra, cotra, bif, fn, fno,
+ ifl, erp
+ );
+ } break;
+ }
+
+ finished:
+ $? "- dk4gra_bif_cotra_image %d", back
+ if ((0 == back) && (NULL != backptr)) { *backptr = 0; }
+}
+
+
+void
+dk4gra_bif_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Values passed to low level functions */
+ double w; /* Image width */
+ double h; /* Image height */
+ double xres; /* X resolution */
+ double yres; /* Y resolution */
+ int res; /* Operation result */
+ int cs; /* Color space */
+ int back = 0;
+ dk4_px_bit_depth_t bpc;
+ $? "+ dk4gra_bif_fig_image"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != bif);
+#endif
+ $? ". xl = %lg", xl
+ $? ". xr = %lg", xr
+ $? ". yb = %lg", yb
+ $? ". yt = %lg", yt
+ $? ". bif = %d", TR_IPTR(bif)
+ $? ". fn = \"%!ds\"", TR_STR(fn)
+ $? ". fno = %u", (unsigned)fno
+ $? ". ipol = %d", (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)
+ $? ". ignres = %d", (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)
+ $? ". ignar = %d", (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)
+ $? ". pos = %d", pos
+ $? ". oiop = %d", (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)
+ $? ". alzw = %d", (DK4_GRA_IMG_FLAG_LZW & ifl)
+ $? ". ajpg = %d", (DK4_GRA_IMG_FLAG_DCT & ifl)
+ $? ". ijpg = %d", (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)
+ $? ". acol = %d", (DK4_GRA_IMG_FLAG_COLOR & ifl)
+ $? ". anb = %d", (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)
+ $? ". anc = %d", (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)
+ $? ". ana = %d", (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)
+ $? ". fbgf = %d", (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)
+
+ /* 2018-03-19
+ Removed (NULL == fn)
+ */
+ if ((NULL == gra) || (NULL == bif)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((xr <= xl) || (yt <= yb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ /* Select frame
+ */
+ if (0 == dk4bif_set_current_frame(bif, fno)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Retrieve image dimensions
+ */
+ w = (double)dk4bif_get_width(bif);
+ h = (double)dk4bif_get_height(bif);
+ if (0 == (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)) {
+ xres = dk4bif_get_xres(bif);
+ yres = dk4bif_get_yres(bif);
+ if ((isgreater(xres, 0.0)) && (isgreater(yres, 0.0))) {
+ w = (72.0 * w) / xres;
+ h = (72.0 * h) / yres;
+#if DK4_HAVE_ISFINITE
+ if ((!(isfinite(w))) || (!(isfinite(h)))) {
+ w = (double)dk4bif_get_width(bif);
+ h = (double)dk4bif_get_height(bif);
+ }
+#else
+#if DK4_HAVE__FINITE
+ if ((!(_finite(w))) || (!(_finite(h)))) {
+ w = (double)dk4bif_get_width(bif);
+ h = (double)dk4bif_get_height(bif);
+ }
+#endif
+#endif
+ }
+ }
+ /*
+ Calculate coordinate system transformations
+ */
+ res = dk4gratool_calculate_transformations(
+ val, xl, xr, yb, yt, w, h,
+ ((0 == (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)) ? (1) : (0)),
+ pos, erp
+ );
+ if (0 == res) {
+ goto finished;
+ }
+ /* Direct re-use of DCT encoded data from JPEG requires file name
+ */
+ if (NULL == fn) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ /* DCT encoding restricts usable number of bits per component
+ */
+ bpc = dk4bif_get_original_bit_depth(bif);
+ if (8 != bpc) {
+ if (4 != bpc) {
+ if (2 != bpc) {
+ if (1 != bpc) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ }
+ /* DCT encoding restricts color spaces
+ */
+ cs = dk4bif_get_color_space(bif);
+ if (DK4_CS_GRAY != cs) {
+ if (DK4_CS_RGB != cs) {
+ if (DK4_CS_CMYK != cs) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ /* Direct re-use of DCT encoded data from colored image
+ not possible when enforcing grayscaled output
+ */
+ if ((DK4_CS_GRAY != cs) && (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ /* Can not specify frame number in PGF output, only frame 0
+ can be used
+ */
+ if ((DK4_GRA_DRIVER_PGF == gra->dr) && (0 != fno)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Call function to produce output with given coordinates transformation
+ */
+ back = 1;
+ dk4gra_bif_cotra_image(
+ gra, val, bif, fn, fno,
+ ifl, &back, erp
+ );
+
+ finished:
+ $? "- dk4gra_bif_fig_image %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_bif_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double xres = 1.0; /* X resolution */
+ double yres = 1.0; /* Y resolution */
+ double w; /* Width */
+ double h; /* Height */
+ double xdiff; /* Available X space */
+ double ydiff; /* Available Y space */
+ int pos = 0; /* Image position */
+ int back = 0;
+ $? "+ dk4gra_bif_image"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != bif);
+#endif
+ $? ". xl = %lg", xl
+ $? ". xr = %lg", xr
+ $? ". yb = %lg", yb
+ $? ". yt = %lg", yt
+ $? ". bif = %d", TR_IPTR(bif)
+ $? ". fn = \"%!ds\"", TR_STR(fn)
+ $? ". fno = %u", (unsigned)fno
+ $? ". ipol = %d", (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)
+ $? ". ignres = %d", (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)
+ $? ". ignar = %d", (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)
+ $? ". arot = %d", (DK4_GRA_IMG_FLAG_ALLOW_ROTATION & ifl)
+ $? ". oiop = %d", (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)
+ $? ". alzw = %d", (DK4_GRA_IMG_FLAG_LZW & ifl)
+ $? ". ajpg = %d", (DK4_GRA_IMG_FLAG_DCT & ifl)
+ $? ". ijpg = %d", (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)
+ $? ". acol = %d", (DK4_GRA_IMG_FLAG_COLOR & ifl)
+ $? ". anb = %d", (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)
+ $? ". anc = %d", (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)
+ $? ". ana = %d", (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)
+ $? ". fbgf = %d", (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)
+ /* 2018-03-19
+ Removed (NULL == fn)
+ */
+ if ((NULL == gra) || (NULL == bif)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ } $? ". gra, bif, fn ok"
+ if ((xr <= xl) || (yt <= yb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ } $? ". xl, yt ok"
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ if (0 == (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)) {
+ if (0 != (DK4_GRA_IMG_FLAG_ALLOW_ROTATION & ifl)) {
+ if (0 != dk4bif_set_current_frame(bif, fno)) {
+ xdiff = fabs(xr - xl);
+ ydiff = fabs(yt - yb);
+ w = (double)dk4bif_get_width(bif);
+ h = (double)dk4bif_get_height(bif);
+ if (0 == (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)) {
+ xres = dk4bif_get_xres(bif);
+ yres = dk4bif_get_yres(bif);
+ if ((isgreater(xres, 0.0)) && (isgreater(yres, 0.0))) {
+ w = (72.0 * w) / xres;
+ h = (72.0 * h) / yres;
+ }
+ }
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(w)) && (isfinite(h)))
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(w)) && (_finite(h)))
+#else
+
+#endif
+#endif
+ {
+ if ((isgreater(w, h)) && (isless(xdiff, ydiff))) {
+ pos = 1;
+ }
+ else {
+ if ((isless(w, h)) && (isgreater(xdiff, ydiff))) {
+ pos = 1;
+ }
+ }
+ }
+#if (DK4_HAVE_ISFINITE) || (DK4_HAVE__FINITE)
+ else {
+ /* ERROR: Width and height calculation failed */
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+#endif
+ }
+ else {
+ /* ERROR: Frame number does not exist! */
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ back = 1;
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, &back, erp
+ );
+ }
+ else {
+ back = 1;
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, &back, erp
+ );
+ }
+ }
+ else {
+ back = 1;
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, &back, erp
+ );
+ }
+ finished:
+ $? "- dk4gra_bif_image %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *bifptr = NULL; /* Bitmap image file */
+ int ho = 0; /* Flag: Read header only */
+ int back = 0;
+ $? "+ dk4gra_fig_image"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fn);
+#endif
+ $? ". xl = %lg", xl
+ $? ". xr = %lg", xr
+ $? ". yb = %lg", yb
+ $? ". yt = %lg", yt
+ $? ". fn = \"%!ds\"", TR_STR(fn)
+ $? ". fno = %u", (unsigned)fno
+ $? ". ctx = %i", TR_IPTR(ctx)
+ $? ". ipol = %d", (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)
+ $? ". ignres = %d", (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)
+ $? ". ignar = %d", (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)
+ $? ". pos = %d", pos
+ $? ". oiop = %d", (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)
+ $? ". alzw = %d", (DK4_GRA_IMG_FLAG_LZW & ifl)
+ $? ". ajpg = %d", (DK4_GRA_IMG_FLAG_DCT & ifl)
+ $? ". ijpg = %d", (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)
+ $? ". acol = %d", (DK4_GRA_IMG_FLAG_COLOR & ifl)
+ $? ". anb = %d", (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)
+ $? ". anc = %d", (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)
+ $? ". ana = %d", (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)
+ $? ". fbgf = %d", (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)
+ if ((NULL == gra) || (NULL == fn)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((xr <= xl) || (yt <= yb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == ctx) {
+ ctx = &(gra->cscctx);
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ if (DK4_GRA_DRIVER_PGF == gra->dr) {
+ ho = 1;
+ }
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == dk4bif_type_for_suffix(fn))
+ ) {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ ho = 1;
+ }
+ }
+ bifptr = dk4bif_open(fn, ho, ctx, erp);
+ if (NULL == bifptr) {
+ goto finished;
+ }
+ back = 1;
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bifptr, fn, fno,
+ pos, ifl, bbptr, &back, erp
+ );
+
+ finished:
+ if (NULL != bifptr) {
+ dk4bif_close(bifptr);
+ }
+ $? "- dk4gra_fig_image %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_t *bifptr = NULL; /* Bitmap image */
+ int back = 0; /* Function result */
+ int ho = 0; /* Flag: Read image header only */
+ $? "+ dk4gra_image"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fn);
+#endif
+ $? ". xl = %lg", xl
+ $? ". xr = %lg", xr
+ $? ". yb = %lg", yb
+ $? ". yt = %lg", yt
+ $? ". fn = \"%!ds\"", TR_STR(fn)
+ $? ". fno = %u", (unsigned)fno
+ $? ". ctx = %i", TR_IPTR(ctx)
+ $? ". ipol = %d", (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)
+ $? ". ignres = %d", (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)
+ $? ". ignar = %d", (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)
+ $? ". arot = %d", (DK4_GRA_IMG_FLAG_ALLOW_ROTATION & ifl)
+ $? ". oiop = %d", (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)
+ $? ". alzw = %d", (DK4_GRA_IMG_FLAG_LZW & ifl)
+ $? ". ajpg = %d", (DK4_GRA_IMG_FLAG_DCT & ifl)
+ $? ". ijpg = %d", (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)
+ $? ". acol = %d", (DK4_GRA_IMG_FLAG_COLOR & ifl)
+ $? ". anb = %d", (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)
+ $? ". anc = %d", (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)
+ $? ". ana = %d", (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)
+ $? ". fbgf = %d", (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)
+ /*
+ Check argument
+ */
+ if ((NULL == gra) || (NULL == fn)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ } $? ". gra and fn ok"
+ if ((xr <= xl) || (yt <= yb)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ } $? ". xr and yb ok"
+ if (NULL == ctx) {
+ ctx = &(gra->cscctx);
+ }
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ /* Open bitmap file
+ */
+ if (DK4_GRA_DRIVER_PGF == gra->dr) {
+ ho = 1;
+ }
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == dk4bif_type_for_suffix(fn))
+ ) {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ ho = 1;
+ }
+ }
+ bifptr = dk4bif_open(fn, ho, ctx, erp);
+ if (NULL == bifptr) { $? "! failed to open bitmap file"
+ goto finished;
+ } $? ". bitmap file opened"
+ /* Process bitmap file
+ */
+ back = 1;
+ if (0 != (DK4_GRA_DOC_FLAG_FORCE_GRAY & (gra->docfl))) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_COLOR));
+ }
+ dk4gra_bif_image(
+ gra, xl, xr, yb, yt, bifptr, fn, fno,
+ ifl, bbptr, &back, erp
+ );
+
+ /* Clean up and exit
+ */
+ finished:
+ $? ". cleanup section"
+ if (NULL != bifptr) { $? ". close bitmap file"
+ dk4bif_close(bifptr);
+ }
+ $? "- dk4gra_image %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_set_pattern_line_width(
+ dk4_gra_t *gra,
+ double plw
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL != gra) {
+ if (0.0 < plw) {
+ gra->patlw = plw;
+ }
+ }
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4gra.h b/support/dktools/dk4gra.h
new file mode 100644
index 0000000000..a0584ef1a2
--- /dev/null
+++ b/support/dktools/dk4gra.h
@@ -0,0 +1,2190 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4gra.ctr
+*/
+
+#ifndef DK4GRA_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4GRA_H_INCLUDED 1
+
+
+#line 9 "dk4gra.ctr"
+
+/** @file dk4gra.h Graphics output (PS/EPS/PDF/PGF).
+
+This module contains functions to create PS/EPS/PDF/PGF graphics.
+
+Coordinates are specified in PS points, called bp in LaTeX.
+72 PS points are one inch.
+
+The origin is in the lower left corner, x values grow to the right,
+y values grow to top.
+
+Colors specified as double values are in the range from 0.0 to 1.0.
+
+For each object to draw follow an algorithm like
+
+@code
+dk4_bb_t bb;
+
+dk4gra_set_line_width(...);
+dk4gra_set_line_style(...);
+dk4gra_set_line_cap(...);
+dk4gra_set_line_join(...);
+dk4gra_set_stroke_...(...);
+dk4gra_set_fill_...(...);
+
+if (want_a_pattern_filled_object) {
+ dk4bb_init(&bb);
+ dk4gra_prepare_fill(...);
+ construct_path(...);
+ dk4gra_fill(...);
+ dk4gra_set_gs_for_pattern_only(gra, 1, ...);
+ dk4gra_gsave(...);
+ construct_path(..., &bb, ...);
+ dk4gra_clip(...);
+ dk4gra_pattern(..., bb.xmin, bb.xmax, bb.ymin, bb.ymax, ...);
+ dk4gra_grestore(...);
+ dk4gra_set_gs_for_pattern_only(gra, 0, ...);
+ if (want_a_stroked_object) {
+ dk4gra_prepare_stroke(...);
+ construct_path(...);
+ dk4gra_stroke(...);
+ }
+}
+else {
+ if (want_a_filled_object) {
+ if (want_a_stroked_object) {
+ if (0 != dk4gra_can_fill_and_stroke(...)) {
+ dk4gra_prepare_fill_and_stroke(...);
+ construct_path(...);
+ dk4gra_fill_and_stroke(...);
+ }
+ else {
+ dk4gra_prepare_fill(...);
+ construct_path(...);
+ dk4gra_fill(...);
+ dk4gra_prepare_stroke(...);
+ construct_path(...);
+ dk4gra_stroke(...);
+ }
+ }
+ else {
+ dk4gra_prepare_fill(...);
+ construct_path(...);
+ dk4gra_fill(...);
+ }
+ }
+ else {
+ if (want_a_stroked_object) {
+ dk4gra_prepare_stroke(...);
+ construct_path(...);
+ dk4gra_stroke(...);
+ }
+ }
+}
+@endcode
+
+The dk4gra_set_fill_...() and dk4gra_set_stroke_...() functions set color
+space and color values. You must use the same color space for both
+fill and stroke color.
+*/
+
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4mem.h"
+#else
+#include <dktools-4/dk4mem.h>
+#endif
+#endif
+
+#ifndef DK4FONT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4font.h"
+#else
+#include <dktools-4/dk4font.h>
+#endif
+#endif
+
+#ifndef DK4ALIGN_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4align.h"
+#else
+#include <dktools-4/dk4align.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4BB_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bb.h"
+#else
+#include <dktools-4/dk4bb.h>
+#endif
+#endif
+
+#ifndef DK4BIFTY_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bifty.h"
+#else
+#include <dktools-4/dk4bifty.h>
+#endif
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4cs.h"
+#else
+#include <dktools-4/dk4cs.h>
+#endif
+#endif
+
+#ifndef DK4MEMBF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
+
+#ifndef DK4MBSTRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4mbstrm.h"
+#else
+#include <dktools-4/dk4mbstrm.h>
+#endif
+#endif
+
+#ifndef DK4FONTC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4fontc.h"
+#else
+#include <dktools-4/dk4fontc.h>
+#endif
+#endif
+
+#ifndef DK4UC2L_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4uc2l.h"
+#else
+#include <dktools-4/dk4uc2l.h>
+#endif
+#endif
+
+
+
+/** Epsilon value for coordinates.
+ All values smaller than this are treated as 0.0.
+*/
+#define DK4_GRA_EPSILON_COORDINATES 1.0e-5
+
+/** Epsilon value for line widths.
+ Line width differing less are treated as equal.
+*/
+#define DK4_GRA_EPSILON_LINEWIDTH 1.0e-3
+
+/** Epsilon value for miter limits.
+ Miter limits differing less are treated as equal.
+*/
+#define DK4_GRA_EPSILON_MITERLIMIT 1.0e-3
+
+
+/** Flags for adding images to a page.
+*/
+enum {
+ /** The image is the only page contents.
+ For PS output the gsave operator, clipping
+ and white filling at start of page are
+ removed, the grestore at end of page too.
+ */
+ DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS = 0x0001 ,
+
+ /** Fill image background with color from background
+ chunk before applying image data.
+ Only in effect when producing PDF output in
+ DK4_CS_RGB_ALPHA or DK4_CS_GRAY_ALPHA
+ color space.
+ */
+ DK4_GRA_IMG_FLAG_FILL_BACKGROUND = 0x0002 ,
+
+ /** Allow colored output.
+ Otherwise grayscaled output is enforced.
+ */
+ DK4_GRA_IMG_FLAG_COLOR = 0x0004 ,
+
+ /** Allow LZW compression in PS language
+ level 2 output.
+ */
+ DK4_GRA_IMG_FLAG_LZW = 0x0008 ,
+
+ /** Allow to use DCT encoded data from JPEG
+ files directly.
+ */
+ DK4_GRA_IMG_FLAG_DCT = 0x0010 ,
+
+ /** Set image interpolation flag to allow
+ PS/PDF renderers to optimize representation.
+ */
+ DK4_GRA_IMG_FLAG_INTERPOLATION = 0x0020 ,
+
+ /** Set image interpolation flag when directly
+ using DCT encoded data from JPEG files.
+ */
+ DK4_GRA_IMG_FLAG_DCT_INTERPOLATION = 0x0040 ,
+
+ /** Analyze number of bits per component, reduce
+ if possible without quality loss.
+ */
+ DK4_GRA_IMG_FLAG_ANALYZE_BPC = 0x0080 ,
+
+ /** Analyze use of colors, switch to grayscale
+ if possible without quality loss.
+ */
+ DK4_GRA_IMG_FLAG_ANALYZE_COLOR = 0x0100 ,
+
+ /** Analyze use of alpha channel data, ignore
+ alpha data if all pixels have full opacity.
+ */
+ DK4_GRA_IMG_FLAG_ANALYZE_ALPHA = 0x0200 ,
+
+ /** Allow to rotate the image to fit paper size.
+ */
+ DK4_GRA_IMG_FLAG_ALLOW_ROTATION = 0x0400 ,
+
+ /** Ignore image resolution saved in file.
+ */
+ DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION = 0x0800 ,
+
+ /** Ignore aspect ratio, allow distorsion while
+ filling the specified image range completely.
+ */
+ DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO = 0x1000 ,
+};
+
+
+
+/** Text flags for use with
+ dk4gra_pgf_simple_text(),
+ dk4gra_pgf_special_text(),
+ dk4gra_app_pgf_simple_text(),
+ dk4gra_app_pgf_special_text(),
+ dk4pppt_simple_text(),
+ and dk4pppt_special_text(), can be or-combined.
+*/
+enum {
+ /** Draw oval box around text.
+ */
+ DK4_GRA_TEXT_FLAG_OVAL_BOX = 0x0001 ,
+
+ /** Put white box around text and oval box.
+ */
+ DK4_GRA_TEXT_FLAG_WHITE_BOX = 0x0002
+};
+
+
+
+/** Output driver to choose.
+*/
+typedef enum {
+ DK4_GRA_DRIVER_PDF = 0, /**< Produce PDF file. */
+ DK4_GRA_DRIVER_EPS , /**< Produce EPS file. */
+ DK4_GRA_DRIVER_PS , /**< Produce PS file. */
+ DK4_GRA_DRIVER_PGF , /**< Produce PGF file. */
+ DK4_GRA_DRIVER_BB /**< Produce bounding box file. */
+} dk4_gra_driver_t;
+
+
+
+/** Intended purpose for output.
+*/
+typedef enum {
+ DK4_GRA_PURPOSE_OBJECT = 0 , /**< Object to include in a document. */
+ DK4_GRA_PURPOSE_IMAGE , /**< Standalone image. */
+ DK4_GRA_PURPOSE_DOCUMENT /**< Document for viewing or printing. */
+} dk4_gra_purpose_t;
+
+
+
+/** Line styles.
+*/
+typedef enum {
+ DK4_GRA_LS_SOLID = 0 , /**< Solid line. */
+ DK4_GRA_LS_DASH , /**< Dashed line. */
+ DK4_GRA_LS_DOT , /**< Dotted line. */
+ DK4_GRA_LS_DASH_DOT , /**< Dash dot line. */
+ DK4_GRA_LS_DASH_DOT_DOT , /**< Dash dot dot line. */
+ DK4_GRA_LS_DASH_DOT_DOT_DOT /**< Dash dot dot dot line. */
+} dk4_gra_ls_t;
+
+
+/** Line cap styles.
+*/
+typedef enum {
+ DK4_GRA_LC_BUTTED = 0, /**< Line finished exactly at point. */
+ DK4_GRA_LC_ROUNDED , /**< Half circle added at each line end. */
+ DK4_GRA_LC_PROJECTING /**< Half square added at each line end. */
+} dk4_gra_lc_t;
+
+
+/** Line join styles.
+*/
+typedef enum {
+ DK4_GRA_LJ_MITERED = 0, /**< Pointed. */
+ DK4_GRA_LJ_ROUNDED , /**< Rounded. */
+ DK4_GRA_LJ_BEVELED /**< Cutted point. */
+} dk4_gra_lj_t;
+
+
+/** Flags for new pages. Or-combinations allowed.
+*/
+enum {
+ /** Do not set clip path.
+ */
+ DK4_GRA_PAGE_FLAG_NO_CLIP = 0x0001 ,
+
+ /** Do not fill background in white.
+ */
+ DK4_GRA_PAGE_FLAG_NO_BG = 0x0002 ,
+
+ /** Use uncompressed PDF page stream.
+ Intended for debugging purposes only.
+ */
+ DK4_GRA_PAGE_FLAG_NOT_COMPRESSED = 0x0004 ,
+
+ /** Use front side and back side of paper.
+ */
+ DK4_GRA_DOC_FLAG_DUPLEX = 0x0200 ,
+
+ /** Use front side and back side of paper,
+ binding like a calendar.
+ */
+ DK4_GRA_DOC_FLAG_TUMBLE = 0x0400 ,
+
+ /** Force use of grayscaled output
+ instead of colors.
+ */
+ DK4_GRA_DOC_FLAG_FORCE_GRAY = 0x0800 ,
+
+ /** Use PS level 2 instead of level 3.
+ */
+ DK4_GRA_DOC_FLAG_PS2 = 0x1000 ,
+
+ /** Produce document structuring comments.
+ */
+ DK4_GRA_DOC_FLAG_PS_DSC = 0x2000 ,
+
+ /** Produce EPS instead of normal PS.
+ */
+ DK4_GRA_DOC_FLAG_EPS = 0x4000
+};
+
+
+
+/** Fill patterns.
+*/
+typedef enum {
+ /** Diagonal lines 30 degrees to the left.
+ */
+ DK4_GRA_PATTERN_30_DEGREE_LEFT = 0,
+
+ /** Diagonal lines 30 degrees to the right.
+ */
+ DK4_GRA_PATTERN_30_DEGREE_RIGHT ,
+
+ /** Crosshatch of lines 30 degrees to the left and right.
+ */
+ DK4_GRA_PATTERN_30_DEGREE_SIEVE ,
+
+ /** Diagonal lines 45 degrees to the left.
+ */
+ DK4_GRA_PATTERN_45_DEGREE_LEFT ,
+
+ /** Diagonal lines 45 degrees to the left.
+ */
+ DK4_GRA_PATTERN_45_DEGREE_RIGHT ,
+
+ /** Crosshatch of lines 45 degrees to the left and right.
+ */
+ DK4_GRA_PATTERN_45_DEGREE_SIEVE ,
+
+ /** Horizontal bricks.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_BRICKS ,
+
+ /** Vertical bricks.
+ */
+ DK4_GRA_PATTERN_VERTICAL_BRICKS ,
+
+ /** Horizontal lines.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_LINES ,
+
+ /** Vertical lines.
+ */
+ DK4_GRA_PATTERN_VERTICAL_LINES ,
+
+ /** Crosshatch of horizontal and vertical lines.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE ,
+
+ /** Horizontal shingles skewed to the left.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT ,
+
+ /** Horizontal shingles skewed to the right.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT ,
+
+ /** Vertical shingles skewed to one side.
+ */
+ DK4_GRA_PATTERN_VERTICAL_SHINGLES_1 ,
+
+ /** Vertical shingles skewed to the other side.
+ */
+ DK4_GRA_PATTERN_VERTICAL_SHINGLES_2 ,
+
+ /** Large fish scales.
+ */
+ DK4_GRA_PATTERN_LARGE_FISH_SCALES ,
+
+ /** Small fish scales.
+ */
+ DK4_GRA_PATTERN_SMALL_FISH_SCALES ,
+
+ /** Circles.
+ */
+ DK4_GRA_PATTERN_CIRCLES ,
+
+ /** Hexagons.
+ */
+ DK4_GRA_PATTERN_HEXAGONS ,
+
+ /** Octagons.
+ */
+ DK4_GRA_PATTERN_OCTAGONS ,
+
+ /** Horizontal tire treads.
+ */
+ DK4_GRA_PATTERN_HORIZONTAL_TIRES ,
+
+ /** Vertical tire treads.
+ */
+ DK4_GRA_PATTERN_VERTICAL_TIRES
+
+} dk4_gra_pattern_t;
+
+
+
+/** Maximum pattern number.
+*/
+enum {
+ /** Maximum pattern number.
+ */
+ DK4_GRA_PATTERN_MAX = DK4_GRA_PATTERN_VERTICAL_TIRES
+};
+
+
+
+/** Type of preamble line to add.
+*/
+enum {
+ DK4_GRA_PREAMBLE_FONT = 0 , /**< Line to load font package. */
+ DK4_GRA_PREAMBLE_PACKAGE , /**< Line to load other packages. */
+ DK4_GRA_PREAMBLE_OTHER /**< Any other configuration line. */
+};
+
+
+
+/** Output structure to produce a PS or EPS file.
+*/
+typedef struct {
+ int llev; /**< PS language level. */
+ int dsc; /**< Flag: Write DSC comments. */
+ int fspd; /**< Flag: Use setpagedevice for paper size. */
+ int fdu; /**< Flag: Duplex. */
+ int ftu; /**< Flag: Duplex and tumble. */
+} dk4_gra_ps_output_t;
+
+
+
+/** Output structure to produce a PDF file.
+*/
+typedef struct {
+ dk4_sto_t *s_imagno; /**< Images container by object number. */
+ dk4_sto_it_t *i_imagno; /**< Images iterator. */
+ dk4_sto_t *s_images; /**< Images container by data source. */
+ dk4_sto_it_t *i_images; /**< Images iterator. */
+ dk4_sto_t *s_objpos; /**< Object positions container. */
+ dk4_sto_it_t *i_objpos; /**< Object positions iterator. */
+ size_t nextobj; /**< Object number of next XObject. */
+ size_t unxo; /**< Number of XObjects without file name. */
+} dk4_gra_pdf_output_t;
+
+
+
+/** Output structure to produce a PGF file.
+*/
+typedef struct {
+ dk4_font_collector_t *fc; /**< Font collector. */
+ dk4_sto_t *s_imagno; /**< Images container by number. */
+ dk4_sto_it_t *i_imagno; /**< Images iterator. */
+ dk4_sto_t *s_images; /**< Images container by data source. */
+ dk4_sto_it_t *i_images; /**< Images iterator. */
+ dk4_sto_t *s_prelfo; /**< Containter for font setup. */
+ dk4_sto_it_t *i_prelfo; /**< Font setup iterator. */
+ dk4_sto_t *s_prelpa; /**< Container for packages. */
+ dk4_sto_it_t *i_prelpa; /**< Packages iterator. */
+ dk4_sto_t *s_prelot; /**< Container for other setup. */
+ dk4_sto_it_t *i_prelot; /**< Other setup iterator. */
+ double dfs; /**< Document font size. */
+ size_t n_images; /**< Next image number. */
+ size_t n_prelfo; /**< Number of font setup lines. */
+ size_t n_prelpa; /**< Number of package setup lines. */
+ size_t n_prelot; /**< Number of other setup lines. */
+ int sa; /**< Flag: Produce standalone doc. */
+} dk4_gra_pgf_output_t;
+
+
+
+/** Union of output structure types.
+*/
+typedef union {
+ dk4_gra_ps_output_t ps; /**< Produce PS/EPS output. */
+ dk4_gra_pdf_output_t pdf; /**< Produce PDF output. */
+ dk4_gra_pgf_output_t pgf; /**< Produce PGF output. */
+} dk4_gra_all_output_t;
+
+
+
+/** Output structure to produce a graphics file.
+*/
+typedef struct {
+ dk4_gra_all_output_t out; /**< Output structure. */
+ dk4_cs_conv_ctx_t cscctx; /**< Color space conversion context. */
+ dk4_sto_t *s_pages; /**< Pages container. */
+ dk4_sto_it_t *i_pages; /**< Iterator through container. */
+ dkChar *fn; /**< Output file name. */
+ void *curpg; /**< Current page. */
+ double cur_x; /**< Current x position. */
+ double cur_y; /**< Current y position. */
+ double patlw; /**< Pattern line width. */
+ size_t pages; /**< Number of pages. */
+ size_t w; /**< Image width. */
+ size_t h; /**< Image height. */
+ int dr; /**< Output driver. */
+ int gscp; /**< Flag: Graphics state pattern clip. */
+ int eor; /**< Flag: Use even-odd-rule fill clip. */
+ int le; /**< Previous error. */
+ int lec; /**< Previous error code. */
+ int len; /**< Number how often previous error. */
+ int docfl; /**< Document flag set. */
+} dk4_gra_t;
+
+
+
+/** Point coordinates in a graphics.
+*/
+typedef struct {
+ double x; /**< X value. */
+ double y; /**< Y value. */
+} dk4_gra_point_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Open output structure to create a PDF file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flags.
+ The flags can contain both document and page flags, page flags
+ here are applied as default page flags for pages added by the
+ dk4gra_page() function.
+
+ The following document flags are available:
+
+ - DK4_GRA_DOC_FLAG_PS2<br>
+ to produce PS level 2 instead of level 3,
+ - DK4_GRA_DOC_FLAG_EPS<br>
+ to produce EPS instead of PS,
+ - DK4_GRA_DOC_FLAG_PS_DSC<br>
+ to write document structuring comments,
+ - DK4_GRA_DOC_FLAG_FORCE_GRAY<br>
+ to enforce grayscaled output.
+
+ The following page flags are available:
+
+ - DK4_GRA_PAGE_FLAG_NO_CLIP<br>
+ to skip setting the clip path to page size,
+ - DK4_GRA_PAGE_FLAG_NO_BG<br>
+ to skip filling the page with a white background,
+ - DK4_GRA_PAGE_FLAG_NOT_COMPRESSED<br>
+ to create an uncompressed page contents stream
+ in PDF output (intended for debugging only).
+
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL, w or h is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available.
+*/
+
+dk4_gra_t *
+dk4gra_open_pdf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+);
+
+
+/** Open output structure to create a PS or EPS file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flags.
+ The flags can contain both document and page flags, page flags
+ here are applied as default page flags for pages added by the
+ dk4gra_page() function.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL, w or h is 0 or ll is neither 2 nor 3.
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available.
+*/
+
+dk4_gra_t *
+dk4gra_open_ps(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+);
+
+
+/** Open output structure to create a PGF file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flags.
+ The flags can contain both document and page flags, page flags
+ here are applied as default page flags for pages added by the
+ dk4gra_page() function.
+ @param sa Flag: Produce standalone TeX file.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fn is NULL, w or h is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available.
+*/
+
+dk4_gra_t *
+dk4gra_open_pgf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_er_t *erp
+);
+
+
+/** Set color space conversion context.
+ @param gra Output structure.
+ @param ctx Color space conversion context to copy.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra or ctx is NULL.
+*/
+
+void
+dk4gra_set_color_conversion(
+ dk4_gra_t *gra,
+ dk4_cs_conv_ctx_t const *ctx,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Write output file and close output structure.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or in a state allowing this operation,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+
+*/
+
+void
+dk4gra_write_and_close(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Write output file and close output structure.
+ @param fout Output file already opened.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4gra_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Close output structure (without writing output file).
+ You might want to use this function instead of dk4gra_write_and_close()
+ if the drawing functions indicated an error.
+ @param gra Output structure.
+
+*/
+
+void
+dk4gra_close(
+ dk4_gra_t *gra
+);
+
+
+/** Start new page.
+ Default flags are used for the page:
+ - The clip path is set to the image dimensions.
+ - Background is filled white.
+ - For PDF the contents stream is compressed.
+ To start a new page with different setup, use dk4gra_page_with_flags()
+ instead and specify flags.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL, or in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_page(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Start new page with non-default setup.
+ @param gra Output structure.
+ @param flags Or-combined flags:
+ - DK4_GRA_PAGE_FLAG_NO_CLIP<br>
+ to avoid setting the clip path at start of page,
+ - DK4_GRA_PAGE_FLAG_NO_BG<br>
+ to avoid white background filling,
+ - DK4_GRA_PAGE_FLAG_NOT_COMPRESSED<br>
+ to avoid compression of page content stream in PDF.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_page_with_flags(
+ dk4_gra_t *gra,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set flag for simplified gsave/grestore handling.
+ Set this flag, if you use gsave and grestore only when dealing
+ with clip path for pattern filling.
+ @param gra Output structure.
+ @param val New flag value.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL.
+*/
+void
+dk4gra_set_gs_for_pattern_only(
+ dk4_gra_t *gra,
+ int val,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics state (especially clip path).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Restore graphics state (especially clip path).
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+
+/** Set line width.
+ @param gra Output structure.
+ @param lw Line width in bp.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set line style.
+ @param gra Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_line_style(
+ dk4_gra_t *gra,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set line cap.
+ @param gra Output structure.
+ @param lc Line cap type.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_line_cap(
+ dk4_gra_t *gra,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set line join.
+ @param gra Output structure.
+ @param lj Line join type.
+ @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_line_join(
+ dk4_gra_t *gra,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Check whether a combined fill and close operation is available
+ for an output structure.
+ @param gra Output structure to test.
+ @return 1 if a fill-and-close operation is available, 0 otherwise.
+*/
+
+int
+dk4gra_can_fill_and_stroke(
+ const dk4_gra_t *gra
+);
+
+
+/** Fill current path.
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Stroke current path.
+ Note: Use dk4gra_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Use current path for clipping.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line width for pattern drawing.
+ The pattern line width should be in range 0.0 to 2.0.
+ @param gra Output structure.
+ @param plw New pattern line width in bp.
+*/
+
+void
+dk4gra_set_pattern_line_width(
+ dk4_gra_t *gra,
+ double plw
+);
+
+/** Pattern a region (clipping should be set to the path).
+ @param gra Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set flag for even-odd-rule.
+ If this flag is on, the even-odd-rule is used for filling and
+ clipping. Otherwise the nonzero-winding rule is used.
+ By default this flag is turned on when creating a dk4_gra_t structure.
+ @param gra Output structure.
+ @param val New flag value.
+*/
+void
+dk4gra_set_eorule(
+ dk4_gra_t *gra,
+ int val
+);
+
+/** Start a new path and move to first point.
+ @param gra Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add line from current point to new point to path.
+ @param gra Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param gra Output structure.
+ @param xc1 X coordinate of first control point.
+ @param yc1 Y coordinate of first control point.
+ @param xc2 X coordinate of second control point.
+ @param yc2 Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Close current path.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for a circle.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add path for an arc.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for an ellipse.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in degree.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless a color is specified in colspec.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding, only used for char text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_pgf_simple_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless a color is specified in colspec.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_pgf_simple_utf8_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add special text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless a color is specified in colspec.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size.
+ @param fex Flag: Use exact font.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_pgf_special_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set the font size for the documentclass line.
+ @param gra Output structure, must be initialized for PGF.
+ @param fs Font size in pt.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+void
+dk4gra_pgf_doc_font_size(
+ dk4_gra_t *gra,
+ double fs,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add a preamble line.
+ For font setup and package setup the lines added by this function
+ replace the default contents.
+ For other setup the lines added by this function are appended
+ after the default contents.
+ @param gra Output structure, must be initialized for PGF.
+ @param line Line text without trailing newline.
+ @param tp Line type: DK4_GRA_PREAMBLE_FONT, DK4_GRA_PREAMBLE_PACKAGE,
+ or DK4_GRA_PREAMBLE_OTHER.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4gra_pgf_doc_preamble_line(
+ dk4_gra_t *gra,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image with coordinates transformations already calculated.
+ @param gra Output structure.
+ @param cotra Array containing 5 elements for coordinates transformations.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number. The frame number given here is used
+ by the PDF output driver only. You must call
+ dk4bif_set_current_frame() on the bitmap image file before calling
+ this function.
+ @param ifl Image flags.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or a frame number other than 0
+ was specified for PGF output or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4gra_bif_cotra_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image XFig style from opened bitmap image file.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or a frame number other than 0
+ was specified for PGF output or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_bif_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image from opened bitmap image file.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file data.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_bif_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image specified by file name.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image XFig style specified by file name.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or gra is
+ not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gra_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/** Number of points to calculate for a circle or ellipse.
+*/
+enum {
+ /** Number of points to calculate for a circle
+ or ellipse.
+ */
+ DK4_GRA_CIRCLE_POINTS = 24
+};
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4graa.c b/support/dktools/dk4graa.c
new file mode 100644
index 0000000000..7ca05a4e09
--- /dev/null
+++ b/support/dktools/dk4graa.c
@@ -0,0 +1,2229 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4graa.ctr
+*/
+
+/** @file dk4graa.c The dk4graa module.
+*/
+
+
+#line 1052 "dk4graa.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4GRAA_H_INCLUDED
+#include "dk4graa.h"
+#endif
+
+#ifndef DK4GRALO_H_INCLUDED
+#include "dk4gralo.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4BIFAP_H_INCLUDED
+#include "dk4bifap.h"
+#endif
+
+#ifndef DK4FOPDA_H_INCLUDED
+#include "dk4fopda.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#ifndef DK4_UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+
+
+
+
+#line 1100 "dk4graa.ctr"
+
+
+
+/** Error codes in error counting to avoid repeated error messages.
+*/
+enum {
+ /** Failed to add graphics contents.
+ */
+ E_ADD_CONTENTS = 1 ,
+
+ /** Failed to change graphics setup.
+ */
+ E_CHANGE_SETUP ,
+
+ /** Failed to write graphics contents to file.
+ */
+ E_WRITE_FILE ,
+
+ /** Image type not supported for PGF output.
+ */
+ E_PGF_IMAGE_TYPE ,
+};
+
+
+/** Show error message.
+ @param app Application structure.
+ @param fn Name of file to print with error message.
+ @param erp Error report, used for details.
+ @param si Index of primary message text in dk4gra_app_kw array.
+*/
+static
+void
+dk4gra_app_error(
+ dk4_app_t *app,
+ dkChar const *fn,
+ dk4_er_t const *erp,
+ size_t si
+)
+{
+ const dkChar * const *msg = NULL;
+ dkChar const *oldsourcefile = NULL;
+ dk4_um_t oldsourceline = 0UL;
+ size_t szmsg = 0;
+
+
+#line 1144 "dk4graa.ctr"
+ /*
+ Find localized message texts
+ */
+ szmsg = dk4gralog_sz_localized_texts();
+ msg = dk4gralog_localized_texts(app);
+ /*
+ Save source file and line
+ */
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ /*
+ Set source file and line
+ */
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ /*
+ Show error message, provide details if possible
+ */
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, si);
+ switch (erp->ec) {
+ case DK4_E_INVALID_ARGUMENTS : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 1);
+ } break;
+ case DK4_E_MATH_OVERFLOW : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 2);
+ } break;
+ case DK4_E_MEMORY_ALLOCATION_FAILED : {
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ } break;
+ case DK4_E_WRITE_FAILED : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 3);
+ } break;
+ case DK4_E_FLUSH_FAILED : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 4);
+ } break;
+ case DK4_E_CLOSE_FAILED : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 4);
+ } break;
+ }
+ /* Restore old source file and line
+ */
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+
+
+#line 1188 "dk4graa.ctr"
+}
+
+
+
+/** Check whether or not to print current error message.
+ We want to avoid repeating the same message again and again.
+*/
+static
+int
+dk4gra_app_check_error(
+ dk4_gra_t *gra,
+ int ce,
+ int ec
+)
+{
+ int back = 0;
+
+
+#line 1205 "dk4graa.ctr"
+ if (NULL != gra) {
+ if ((gra->le == ce) && (gra->lec == ec)) {
+
+#line 1207 "dk4graa.ctr"
+ if (4 > gra->len) {
+
+#line 1208 "dk4graa.ctr"
+ back = 1;
+ gra->len += 1;
+ }
+ }
+ else {
+
+#line 1213 "dk4graa.ctr"
+ back = 1;
+ gra->le = ce;
+ gra->lec = ec;
+ gra->len = 0;
+ }
+ }
+ else {
+
+#line 1220 "dk4graa.ctr"
+ back = 1;
+ }
+
+
+#line 1223 "dk4graa.ctr"
+ return back;
+}
+
+
+
+dk4_gra_t *
+dk4gra_app_open_pdf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_gra_t *back = NULL;
+
+
+#line 1240 "dk4graa.ctr"
+ dk4error_init(&er);
+ back = dk4gra_open_pdf(fn, w, h, docfl, &er);
+ if ((NULL == back) && (NULL != app)) {
+ dk4gra_app_error(app, fn, &er, 52);
+ }
+
+
+#line 1246 "dk4graa.ctr"
+ return back;
+}
+
+
+dk4_gra_t *
+dk4gra_app_open_ps(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_gra_t *back = NULL;
+
+
+#line 1262 "dk4graa.ctr"
+ dk4error_init(&er);
+ back = dk4gra_open_ps(fn, w, h, docfl, &er);
+ if ((NULL == back) && (NULL != app)) {
+ dk4gra_app_error(app, fn, &er, 52);
+ }
+
+
+#line 1268 "dk4graa.ctr"
+ return back;
+}
+
+
+
+dk4_gra_t *
+dk4gra_app_open_pgf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_gra_t *back = NULL;
+
+
+#line 1286 "dk4graa.ctr"
+ dk4error_init(&er);
+ back = dk4gra_open_pgf(fn, w, h, docfl, sa, &er);
+ if ((NULL == back) && (NULL != app)) {
+ dk4gra_app_error(app, fn, &er, 52);
+ }
+
+
+#line 1292 "dk4graa.ctr"
+ return back;
+}
+
+
+
+void
+dk4gra_app_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t * DK4_ARG_UNUSED(app)
+)
+{
+ dk4_er_t er;
+#if 0
+ dkChar *fn = NULL;
+#endif
+ int back = 1;
+ DK4_UNUSED_ARG(app)
+
+
+#line 1312 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_write_file_and_close(fout, gra, &back, &er);
+ gra = NULL;
+ if (0 == back) {
+
+#line 1316 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+#if 0
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_WRITE_FILE, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 59);
+ }
+ }
+#endif
+ }
+
+
+#line 1327 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_write_and_close(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ FILE *fout = NULL;
+ int tests = DK4_FOPEN_SC_USER;
+ int back = 0;
+ int invala = 0;
+#if DK4_ON_WINDOWS
+ int oldm = _O_TEXT;
+#endif
+
+
+#line 1347 "dk4graa.ctr"
+
+ if (NULL != gra) {
+ if ((NULL != gra->s_pages) && (NULL != gra->i_pages)) {
+ if ((0 != gra->pages) && (NULL != gra->curpg)) {
+ if (NULL != gra->fn) {
+
+#line 1352 "dk4graa.ctr"
+ if (0 != dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
+ fout = dk4fopen_app(gra->fn, dkT("wb"), tests, app);
+ if (NULL != fout) {
+
+#line 1355 "dk4graa.ctr"
+ back = 1;
+ dk4gra_app_write_file_and_close(fout, gra, &back, app);
+ gra = NULL;
+ dk4error_init(&er);
+ if (0 != fclose(fout)) {
+ dk4error_set_simple_error_code(
+ &er, DK4_E_CLOSE_FAILED
+ );
+ back = 0;
+#if 0
+ /* 2019-03-06
+ Graphics is closed, we can not access
+ components.
+ */
+ if (NULL != app) {
+ if (
+ 0 != dk4gra_app_check_error(
+ gra, E_WRITE_FILE, er.ec
+ )
+ )
+ {
+ dk4gra_app_error(app, gra->fn, &er, 59);
+ }
+ }
+#endif
+ }
+ }
+ else {
+
+#line 1383 "dk4graa.ctr"
+ dk4gra_close(gra);
+ gra = NULL;
+ }
+ }
+ else {
+
+#line 1388 "dk4graa.ctr"
+ back = 1;
+#if DK4_ON_WINDOWS
+ oldm = _setmode(_fileno(stdout), _O_BINARY);
+#endif
+ dk4gra_app_write_file_and_close(stdout, gra, &back, app);
+ gra = NULL;
+#if DK4_ON_WINDOWS
+ _setmode(_fileno(stdout), oldm);
+#endif
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ invala = 1;
+ dk4gra_close(gra);
+ gra = NULL;
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ invala = 1;
+ dk4gra_close(gra);
+ gra = NULL;
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ invala = 1;
+ }
+ if (0 != invala) {
+ /* ERROR: Invalid arguments */
+ dk4error_init(&er);
+ dk4error_set_simple_error_code(&er, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != app) {
+#if 0
+ /* 2019-03-06
+ Graphics is closed, we can no longer access components.
+ */
+ if (0 != dk4gra_app_check_error(gra, E_WRITE_FILE, er.ec)) {
+ dk4gra_app_error(app, gra->fn, &er, 59);
+ }
+#endif
+ }
+ }
+
+
+#line 1433 "dk4graa.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_app_set_color_conversion(
+ dk4_gra_t *gra,
+ dk4_cs_conv_ctx_t const *ctx,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1450 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_color_conversion(gra, ctx, &back, &er);
+ if (0 == back) {
+
+#line 1453 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_CHANGE_SETUP, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 58);
+ }
+ }
+ }
+
+
+#line 1462 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_page(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1477 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_page(gra, &back, &er);
+ if (0 == back) {
+
+#line 1480 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1489 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_page_with_flags(
+ dk4_gra_t *gra,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1505 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_page_with_flags(gra, flags, &back, &er);
+ if (0 == back) {
+
+#line 1508 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1517 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_gs_for_pattern_only(
+ dk4_gra_t *gra,
+ int val,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+
+
+#line 1531 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_gs_for_pattern_only(gra, val, &er);
+ if (0 != er.ec) {
+
+#line 1534 "dk4graa.ctr"
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_CHANGE_SETUP, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 58);
+ }
+ }
+ }
+
+
+#line 1542 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1557 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_gsave(gra, &back, &er);
+ if (0 == back) {
+
+#line 1560 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1569 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1584 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_grestore(gra, &back, &er);
+ if (0 == back) {
+
+#line 1587 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1596 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1612 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_line_width(gra, lw, &back, &er);
+ if (0 == back) {
+
+#line 1615 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1624 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_line_style(
+ dk4_gra_t *gra,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1641 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_line_style(gra, ls, sv, &back, &er);
+ if (0 == back) {
+
+#line 1644 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1653 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_line_cap(
+ dk4_gra_t *gra,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1669 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_line_cap(gra, lc, &back, &er);
+ if (0 == back) {
+
+#line 1672 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1681 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_line_join(
+ dk4_gra_t *gra,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1698 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_line_join(gra, lj, ml, &back, &er);
+ if (0 == back) {
+
+#line 1701 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1710 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1726 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_fill_gray(gra, g, &back, &er);
+ if (0 == back) {
+
+#line 1729 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1738 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1756 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_fill_rgb(gra, r, g, b, &back, &er);
+ if (0 == back) {
+
+#line 1759 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1768 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1787 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_fill_cmyk(gra, c, m, y, k, &back, &er);
+ if (0 == back) {
+
+#line 1790 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1799 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1815 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_stroke_gray(gra, g, &back, &er);
+ if (0 == back) {
+
+#line 1818 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1827 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1845 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_stroke_rgb(gra, r, g, b, &back, &er);
+ if (0 == back) {
+
+#line 1848 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1857 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1876 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_set_stroke_cmyk(gra, c, m, y, k, &back, &er);
+ if (0 == back) {
+
+#line 1879 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1888 "dk4graa.ctr"
+}
+
+
+
+
+void
+dk4gra_app_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1904 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_prepare_fill(gra, &back, &er);
+ if (0 == back) {
+
+#line 1907 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1916 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1931 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_prepare_stroke(gra, &back, &er);
+ if (0 == back) {
+
+#line 1934 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1943 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1958 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_prepare_fill_and_stroke(gra, &back, &er);
+ if (0 == back) {
+
+#line 1961 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1970 "dk4graa.ctr"
+}
+
+
+
+
+void
+dk4gra_app_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 1986 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_fill(gra, &back, &er);
+ if (0 == back) {
+
+#line 1989 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 1998 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2013 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_stroke(gra, &back, &er);
+ if (0 == back) {
+
+#line 2016 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2025 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2040 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_fill_and_stroke(gra, &back, &er);
+ if (0 == back) {
+
+#line 2043 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2052 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2067 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_clip(gra, &back, &er);
+ if (0 == back) {
+
+#line 2070 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2079 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2099 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_pattern(gra, xl, xr, yb, yt, pn, &back, &er);
+ if (0 == back) {
+
+#line 2102 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2111 "dk4graa.ctr"
+}
+
+
+
+
+void
+dk4gra_app_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2130 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_newpath_moveto(gra, x, y, bbptr, &back, &er);
+ if (0 == back) {
+
+#line 2133 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2142 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2160 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_lineto(gra, x, y, bbptr, &back, &er);
+ if (0 == back) {
+
+#line 2163 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2172 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2194 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_curveto(gra, xc1, yc1, xc2, yc2, x, y, bbptr, &back, &er);
+ if (0 == back) {
+
+#line 2197 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2206 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2221 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_closepath(gra, &back, &er);
+ if (0 == back) {
+
+#line 2224 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2233 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2252 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_circle(gra, xc, yc, r, bbptr, &back, &er);
+ if (0 == back) {
+
+#line 2255 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2264 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2285 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_rectangle(gra, xl, xr, yb, yt, r, bbptr, &back, &er);
+ if (0 == back) {
+
+#line 2288 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2297 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2319 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_arc(gra, xc, yc, ra, start, end, cl, bbptr, &back, &er);
+ if (0 == back) {
+
+#line 2322 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2331 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2352 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_ellipse(gra, xc, yc, rx, ry, rot, bbptr, &back, &er);
+ if (0 == back) {
+
+#line 2355 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2364 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_pgf_simple_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2392 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_pgf_simple_text(
+ gra, x, y, rot, txt, colspec, ie, ha, va, fno, fsz, fex, uc2l,
+ flags, &back, &er
+ );
+ if (0 == back) {
+
+#line 2398 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2407 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_pgf_special_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2433 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_pgf_special_text(
+ gra, x, y, rot, txt, colspec, ha, va, fno, fsz, fex, flags, &back, &er
+ );
+ if (0 == back) {
+
+#line 2438 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2447 "dk4graa.ctr"
+}
+
+
+/** Check whether the graphics driver supports the image type.
+ @param gra Graphics output structure.
+ @param bif Bitmap image file.
+ @return 1 if image type is supported, 0 otherwise.
+*/
+static
+int
+dk4gra_app_check_driver_and_image_type(
+ dk4_gra_t const *gra,
+ dk4_bif_t const *bif
+)
+{
+ int back = 0;
+
+
+#line 2464 "dk4graa.ctr"
+ if ((NULL != gra) && (NULL != bif)) {
+ back = 1;
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PGF : {
+ switch (dk4bif_get_image_type(bif)) {
+ case DK4_BIF_TYPE_NETPBM : case DK4_BIF_TYPE_TIFF : {
+ back = 0;
+ } break;
+ }
+ } break;
+ }
+ }
+
+
+#line 2477 "dk4graa.ctr"
+ return back;
+}
+
+
+
+void
+dk4gra_app_bif_cotra_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ int back = 1;
+
+
+#line 2497 "dk4graa.ctr"
+ dk4error_init(&er);
+ if (0 != dk4gra_app_check_driver_and_image_type(gra, bif)) {
+ dk4gra_bif_cotra_image(
+ gra, cotra, bif, fn, fno,
+ ifl, &back, &er
+ );
+ if (0 == back) {
+
+#line 2504 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+ }
+ else {
+
+#line 2515 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_PGF_IMAGE_TYPE, 0)) {
+ if (NULL != bif) { fn = bif->filename; }
+ dk4gra_app_error(app, fn, &er, 60);
+ }
+ }
+ }
+
+
+#line 2524 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_bif_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ int back = 1;
+
+
+#line 2548 "dk4graa.ctr"
+ dk4error_init(&er);
+ if (0 != dk4gra_app_check_driver_and_image_type(gra, bif)) {
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, &back, &er
+ );
+ if (0 == back) {
+
+#line 2555 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+
+#line 2557 "dk4graa.ctr"
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+
+
+#line 2559 "dk4graa.ctr"
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ }
+ else {
+
+#line 2566 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+
+#line 2568 "dk4graa.ctr"
+ if (0 != dk4gra_app_check_error(gra, E_PGF_IMAGE_TYPE, 0)) {
+
+
+#line 2570 "dk4graa.ctr"
+ if (NULL != bif) { fn = bif->filename; }
+ dk4gra_app_error(app, fn, &er, 60);
+ }
+ }
+ }
+
+
+#line 2576 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_bif_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ int back = 1;
+
+
+#line 2599 "dk4graa.ctr"
+ dk4error_init(&er);
+ if (0 != dk4gra_app_check_driver_and_image_type(gra, bif)) {
+ dk4gra_bif_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ ifl, bbptr, &back, &er
+ );
+ if (0 == back) {
+
+#line 2606 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+
+#line 2608 "dk4graa.ctr"
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+
+
+#line 2610 "dk4graa.ctr"
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ }
+ else {
+
+#line 2617 "dk4graa.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+
+#line 2619 "dk4graa.ctr"
+ if (0 != dk4gra_app_check_error(gra, E_PGF_IMAGE_TYPE, 0)) {
+
+
+#line 2621 "dk4graa.ctr"
+ if (NULL != bif) { fn = bif->filename; }
+ dk4gra_app_error(app, fn, &er, 60);
+ }
+ }
+ }
+
+
+#line 2627 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_bif_t *bifptr = NULL; /* Bitmap image */
+ int back = 0; /* Function result */
+ int ho = 0; /* Flag: Read image header only */
+
+
+#line 2652 "dk4graa.ctr"
+
+
+#line 2653 "dk4graa.ctr"
+
+
+#line 2654 "dk4graa.ctr"
+
+
+#line 2655 "dk4graa.ctr"
+
+
+#line 2656 "dk4graa.ctr"
+
+
+#line 2657 "dk4graa.ctr"
+
+
+#line 2658 "dk4graa.ctr"
+
+
+#line 2659 "dk4graa.ctr"
+
+
+#line 2660 "dk4graa.ctr"
+
+
+#line 2661 "dk4graa.ctr"
+
+
+#line 2662 "dk4graa.ctr"
+
+
+#line 2663 "dk4graa.ctr"
+
+
+#line 2664 "dk4graa.ctr"
+
+
+#line 2665 "dk4graa.ctr"
+
+
+#line 2666 "dk4graa.ctr"
+
+
+#line 2667 "dk4graa.ctr"
+
+
+#line 2668 "dk4graa.ctr"
+
+
+#line 2669 "dk4graa.ctr"
+
+
+#line 2670 "dk4graa.ctr"
+
+
+#line 2671 "dk4graa.ctr"
+
+
+#line 2672 "dk4graa.ctr"
+
+ if ((NULL != gra) && (NULL != fn) && (xr > xl) && (yt > yb)) {
+ /*
+ Register coordinates in bounding box
+ */
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ /* Set header-only flag for opening BIF
+ */
+ if (DK4_GRA_DRIVER_PGF == gra->dr) {
+ ho = 1;
+ }
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == dk4bif_type_for_suffix(fn))
+ ) {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ ho = 1;
+ }
+ }
+ /* Open bitmap image file
+ */
+ bifptr = dk4bif_open_app(fn, ho, ctx, app);
+ if (NULL != bifptr) {
+ back = 1;
+ dk4gra_app_bif_image(
+ gra, xl, xr, yb, yt, bifptr, fn, fno,
+ ifl, bbptr, &back, app
+ );
+
+
+#line 2704 "dk4graa.ctr"
+ dk4bif_close(bifptr);
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ dk4error_init(&er);
+ dk4error_set_simple_error_code(&er, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ if ((0 == back) && (NULL != backptr)) { *backptr = 0; }
+
+
+#line 2719 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_bif_t *bifptr = NULL;
+ int ho = 0;
+ int back = 0;
+
+
+#line 2745 "dk4graa.ctr"
+
+
+#line 2746 "dk4graa.ctr"
+
+
+#line 2747 "dk4graa.ctr"
+
+
+#line 2748 "dk4graa.ctr"
+
+
+#line 2749 "dk4graa.ctr"
+
+
+#line 2750 "dk4graa.ctr"
+
+
+#line 2751 "dk4graa.ctr"
+
+
+#line 2752 "dk4graa.ctr"
+
+
+#line 2753 "dk4graa.ctr"
+
+
+#line 2754 "dk4graa.ctr"
+
+
+#line 2755 "dk4graa.ctr"
+
+
+#line 2756 "dk4graa.ctr"
+
+
+#line 2757 "dk4graa.ctr"
+
+
+#line 2758 "dk4graa.ctr"
+
+
+#line 2759 "dk4graa.ctr"
+
+
+#line 2760 "dk4graa.ctr"
+
+
+#line 2761 "dk4graa.ctr"
+
+
+#line 2762 "dk4graa.ctr"
+
+
+#line 2763 "dk4graa.ctr"
+
+
+#line 2764 "dk4graa.ctr"
+
+
+#line 2765 "dk4graa.ctr"
+
+ if ((NULL != gra) && (NULL != fn) && (xr > xl) && (yt > yb)) {
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ if (DK4_GRA_DRIVER_PGF == gra->dr) {
+ ho = 1;
+ }
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == dk4bif_type_for_suffix(fn))
+ ) {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ ho = 1;
+ }
+ }
+ bifptr = dk4bif_open_app(fn, ho, ctx, app);
+ if (NULL != bifptr) {
+ back = 1;
+ dk4gra_app_bif_fig_image(
+ gra, xl, xr, yb, yt, bifptr, fn, fno,
+ pos, ifl, bbptr, &back, app
+ );
+
+
+#line 2790 "dk4graa.ctr"
+ dk4bif_close(bifptr);
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ dk4error_init(&er);
+ dk4error_set_simple_error_code(&er, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+
+#line 2804 "dk4graa.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+void
+dk4gra_app_pgf_doc_font_size(
+ dk4_gra_t *gra,
+ double fs,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2820 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_pgf_doc_font_size(gra, fs, &back, &er);
+ if (0 == back) {
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_CHANGE_SETUP, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 58);
+ }
+ }
+ }
+
+
+#line 2832 "dk4graa.ctr"
+}
+
+
+
+void
+dk4gra_app_pgf_doc_preamble_line(
+ dk4_gra_t *gra,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+
+
+#line 2849 "dk4graa.ctr"
+ dk4error_init(&er);
+ dk4gra_pgf_doc_preamble_line(gra, line, tp, &back, &er);
+ if (0 == back) {
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_CHANGE_SETUP, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 58);
+ }
+ }
+ }
+
+
+#line 2861 "dk4graa.ctr"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4graa.ctr b/support/dktools/dk4graa.ctr
new file mode 100644
index 0000000000..d250f43501
--- /dev/null
+++ b/support/dktools/dk4graa.ctr
@@ -0,0 +1,2866 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4graa.h Graphics output (PS/EPS/PDF/PGF), application support.
+*/
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4gra.h"
+#else
+#include <dktools-4/dk4gra.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open output structure to create a PDF file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flag set.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+dk4_gra_t *
+dk4gra_app_open_pdf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_app_t *app
+);
+
+
+/** Open output structure to create a PS or EPS file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Flag set, or combination of:
+ - DK4_GRA_DOC_FLAG_PS2<br>
+ to produce PS level 2 instead of level 3,
+ - DK4_GRA_DOC_FLAG_EPS<br>
+ to produce EPS instead of PS,
+ - DK4_GRA_DOC_FLAG_PS_DSC<br>
+ to write document structuring comments.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+dk4_gra_t *
+dk4gra_app_open_ps(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_app_t *app
+);
+
+
+/** Open output structure to create a PGF file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flag set.
+ @param sa Flag: Produce standalone TeX file.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+dk4_gra_t *
+dk4gra_app_open_pgf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_app_t *app
+);
+
+
+/** Write output file and close output structure.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_write_and_close(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Write output file and close output structure.
+ @param fout Output file already opened.
+ @param gra Output structure.
+ @param app Application structure for diagnostics, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+*/
+void
+dk4gra_app_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set color space conversion context.
+ @param gra Output structure.
+ @param ctx Color space conversion context to copy.
+ @param backptr Application structure for diagnostics, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4gra_app_set_color_conversion(
+ dk4_gra_t *gra,
+ dk4_cs_conv_ctx_t const *ctx,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Start new page.
+ Default flags are used for the page:
+ - The clip path is set to the image dimensions.
+ - Background is filled white.
+ - For PDF the contents stream is compressed.
+ To start a new page with different setup, use dk4gra_page_with_flags()
+ instead and specify flags.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_page(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Start new page with non-default setup.
+ @param gra Output structure.
+ @param flags Or-combined flags:
+ - DK4_GRA_PAGE_FLAG_NO_CLIP<br>
+ to avoid setting the clip path at start of page,
+ - DK4_GRA_PAGE_FLAG_NO_BG<br>
+ to avoid white background filling,
+ - DK4_GRA_PAGE_FLAG_NOT_COMPRESSED<br>
+ to avoid compression of page content stream in PDF.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_page_with_flags(
+ dk4_gra_t *gra,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set flag for simplified gsave/grestore handling.
+ Set this flag, if you use gsave and grestore only when dealing
+ with clip path for pattern filling.
+ @param gra Output structure.
+ @param val New flag value.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4gra_app_set_gs_for_pattern_only(
+ dk4_gra_t *gra,
+ int val,
+ dk4_app_t *app
+);
+
+
+/** Save current graphics state (especially clip path).
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Restore graphics state (especially clip path).
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+
+/** Set line width.
+ @param gra Output structure.
+ @param lw Line width in bp.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set line style.
+ @param gra Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_line_style(
+ dk4_gra_t *gra,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set line cap.
+ @param gra Output structure.
+ @param lc Line cap type.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_line_cap(
+ dk4_gra_t *gra,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set line join.
+ @param gra Output structure.
+ @param lj Line join type.
+ @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_line_join(
+ dk4_gra_t *gra,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set fill color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set fill color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set fill color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set stroke color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set stroke color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set stroke color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+
+/** Fill current path.
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Stroke current path.
+ Note: Use dk4gra_app_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_app_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_app_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Use current path for clipping.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_app_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Pattern a region (clipping should be set to the path).
+ @param gra Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+
+/** Start a new path and move to first point.
+ @param gra Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add line from current point to new point to path.
+ @param gra Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param gra Output structure.
+ @param xc1 X coordinate of first control point.
+ @param yc1 Y coordinate of first control point.
+ @param xc2 X coordinate of second control point.
+ @param yc2 Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Close current path.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Create path for a circle.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add path for an arc.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Create path for an ellipse.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in degree.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding, only used for char text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pgf_simple_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add special text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pgf_special_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image with coordinate transformations already calculated.
+ @param gra Output structure.
+ @param cotra Array containing coordinate transformations.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number. The frame number given here is used
+ by the PDF output driver only. You must call
+ dk4bif_set_current_frame() on the bitmap image file before calling
+ this function.
+ @param ifl Image flags.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_bif_cotra_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image XFig style.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_bif_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file data.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_bif_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image XFig style.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set the font size for the documentclass line.
+ @param gra Output structure, must be initialized for PGF.
+ @param fs Font size in pt.
+ @param backptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pgf_doc_font_size(
+ dk4_gra_t *gra,
+ double fs,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add a preamble line.
+ For font setup and package setup the lines added by this function
+ replace the default contents.
+ For other setup the lines added by this function are appended
+ after the default contents.
+ @param gra Output structure, must be initialized for PGF.
+ @param line Line text without trailing newline.
+ @param tp Line type: DK4_GRA_PREAMBLE_FONT, DK4_GRA_PREAMBLE_PACKAGE,
+ or DK4_GRA_PREAMBLE_OTHER.
+ @param backptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pgf_doc_preamble_line(
+ dk4_gra_t *gra,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_FCNTL_H
+#ifndef FCNTL_H_INCLUDED
+#include <fcntl.h>
+#define FCNTL_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_IO_H
+#ifndef IO_H_INCLUDED
+#include <io.h>
+#define IO_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4GRAA_H_INCLUDED
+#include "dk4graa.h"
+#endif
+
+#ifndef DK4GRALO_H_INCLUDED
+#include "dk4gralo.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4BIFAP_H_INCLUDED
+#include "dk4bifap.h"
+#endif
+
+#ifndef DK4FOPDA_H_INCLUDED
+#include "dk4fopda.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#ifndef DK4_UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Error codes in error counting to avoid repeated error messages.
+*/
+enum {
+ /** Failed to add graphics contents.
+ */
+ E_ADD_CONTENTS = 1 ,
+
+ /** Failed to change graphics setup.
+ */
+ E_CHANGE_SETUP ,
+
+ /** Failed to write graphics contents to file.
+ */
+ E_WRITE_FILE ,
+
+ /** Image type not supported for PGF output.
+ */
+ E_PGF_IMAGE_TYPE ,
+};
+
+
+/** Show error message.
+ @param app Application structure.
+ @param fn Name of file to print with error message.
+ @param erp Error report, used for details.
+ @param si Index of primary message text in dk4gra_app_kw array.
+*/
+static
+void
+dk4gra_app_error(
+ dk4_app_t *app,
+ dkChar const *fn,
+ dk4_er_t const *erp,
+ size_t si
+)
+{
+ const dkChar * const *msg = NULL;
+ dkChar const *oldsourcefile = NULL;
+ dk4_um_t oldsourceline = 0UL;
+ size_t szmsg = 0;
+ $? "+ dk4gra_app_error %u", (unsigned)si
+ /*
+ Find localized message texts
+ */
+ szmsg = dk4gralog_sz_localized_texts();
+ msg = dk4gralog_localized_texts(app);
+ /*
+ Save source file and line
+ */
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ /*
+ Set source file and line
+ */
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ /*
+ Show error message, provide details if possible
+ */
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, si);
+ switch (erp->ec) {
+ case DK4_E_INVALID_ARGUMENTS : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 1);
+ } break;
+ case DK4_E_MATH_OVERFLOW : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 2);
+ } break;
+ case DK4_E_MEMORY_ALLOCATION_FAILED : {
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ } break;
+ case DK4_E_WRITE_FAILED : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 3);
+ } break;
+ case DK4_E_FLUSH_FAILED : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 4);
+ } break;
+ case DK4_E_CLOSE_FAILED : {
+ dk4app_log_1(app, msg, szmsg, DK4_LL_ERROR, 4);
+ } break;
+ }
+ /* Restore old source file and line
+ */
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ $? "- dk4gra_app_error"
+}
+
+
+
+/** Check whether or not to print current error message.
+ We want to avoid repeating the same message again and again.
+*/
+static
+int
+dk4gra_app_check_error(
+ dk4_gra_t *gra,
+ int ce,
+ int ec
+)
+{
+ int back = 0;
+ $? "+ dk4gra_app_check_error"
+ if (NULL != gra) {
+ if ((gra->le == ce) && (gra->lec == ec)) { $? ". same error again"
+ if (4 > gra->len) { $? ". repeat once more"
+ back = 1;
+ gra->len += 1;
+ }
+ }
+ else { $? ". other error"
+ back = 1;
+ gra->le = ce;
+ gra->lec = ec;
+ gra->len = 0;
+ }
+ }
+ else { $? ". no gra"
+ back = 1;
+ }
+ $? "- dk4gra_app_check_error %d", back
+ return back;
+}
+
+
+
+dk4_gra_t *
+dk4gra_app_open_pdf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_gra_t *back = NULL;
+ $? "+ dk4gra_app_open_pdf \"%!ds\"", TR_STR(fn)
+ dk4error_init(&er);
+ back = dk4gra_open_pdf(fn, w, h, docfl, &er);
+ if ((NULL == back) && (NULL != app)) {
+ dk4gra_app_error(app, fn, &er, 52);
+ }
+ $? "- dk4gra_app_open_pdf %d", TR_IPTR(back)
+ return back;
+}
+
+
+dk4_gra_t *
+dk4gra_app_open_ps(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_gra_t *back = NULL;
+ $? "+ dk4gra_app_open_ps \"%!ds\"", TR_STR(fn)
+ dk4error_init(&er);
+ back = dk4gra_open_ps(fn, w, h, docfl, &er);
+ if ((NULL == back) && (NULL != app)) {
+ dk4gra_app_error(app, fn, &er, 52);
+ }
+ $? "- dk4gra_app_open_ps %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+dk4_gra_t *
+dk4gra_app_open_pgf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_gra_t *back = NULL;
+ $? "+ dk4gra_app_open_pgf \"%!ds\"", TR_STR(fn)
+ dk4error_init(&er);
+ back = dk4gra_open_pgf(fn, w, h, docfl, sa, &er);
+ if ((NULL == back) && (NULL != app)) {
+ dk4gra_app_error(app, fn, &er, 52);
+ }
+ $? "- dk4gra_app_open_pgf %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+dk4gra_app_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t * DK4_ARG_UNUSED(app)
+)
+{
+ dk4_er_t er;
+#if 0
+ dkChar *fn = NULL;
+#endif
+ int back = 1;
+ DK4_UNUSED_ARG(app)
+ $? "+ dk4gra_app_write_file_and_close"
+ dk4error_init(&er);
+ dk4gra_write_file_and_close(fout, gra, &back, &er);
+ gra = NULL;
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+#if 0
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_WRITE_FILE, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 59);
+ }
+ }
+#endif
+ }
+ $? "- dk4gra_app_write_file_and_close"
+}
+
+
+
+void
+dk4gra_app_write_and_close(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ FILE *fout = NULL;
+ int tests = DK4_FOPEN_SC_USER;
+ int back = 0;
+ int invala = 0;
+#if DK4_ON_WINDOWS
+ int oldm = _O_TEXT;
+#endif
+ $? "+ dk4gra_app_write_and_close"
+
+ if (NULL != gra) {
+ if ((NULL != gra->s_pages) && (NULL != gra->i_pages)) {
+ if ((0 != gra->pages) && (NULL != gra->curpg)) {
+ if (NULL != gra->fn) { $? ". have file name"
+ if (0 != dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
+ fout = dk4fopen_app(gra->fn, dkT("wb"), tests, app);
+ if (NULL != fout) { $? ". fout"
+ back = 1;
+ dk4gra_app_write_file_and_close(fout, gra, &back, app);
+ gra = NULL;
+ dk4error_init(&er);
+ if (0 != fclose(fout)) {
+ dk4error_set_simple_error_code(
+ &er, DK4_E_CLOSE_FAILED
+ );
+ back = 0;
+#if 0
+ /* 2019-03-06
+ Graphics is closed, we can not access
+ components.
+ */
+ if (NULL != app) {
+ if (
+ 0 != dk4gra_app_check_error(
+ gra, E_WRITE_FILE, er.ec
+ )
+ )
+ {
+ dk4gra_app_error(app, gra->fn, &er, 59);
+ }
+ }
+#endif
+ }
+ }
+ else { $? "! fout"
+ dk4gra_close(gra);
+ gra = NULL;
+ }
+ }
+ else { $? ". writing to stdout"
+ back = 1;
+#if DK4_ON_WINDOWS
+ oldm = _setmode(_fileno(stdout), _O_BINARY);
+#endif
+ dk4gra_app_write_file_and_close(stdout, gra, &back, app);
+ gra = NULL;
+#if DK4_ON_WINDOWS
+ _setmode(_fileno(stdout), oldm);
+#endif
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ invala = 1;
+ dk4gra_close(gra);
+ gra = NULL;
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ invala = 1;
+ dk4gra_close(gra);
+ gra = NULL;
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ invala = 1;
+ }
+ if (0 != invala) {
+ /* ERROR: Invalid arguments */
+ dk4error_init(&er);
+ dk4error_set_simple_error_code(&er, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != app) {
+#if 0
+ /* 2019-03-06
+ Graphics is closed, we can no longer access components.
+ */
+ if (0 != dk4gra_app_check_error(gra, E_WRITE_FILE, er.ec)) {
+ dk4gra_app_error(app, gra->fn, &er, 59);
+ }
+#endif
+ }
+ }
+ $? "- dk4gra_app_write_and_close %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_app_set_color_conversion(
+ dk4_gra_t *gra,
+ dk4_cs_conv_ctx_t const *ctx,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_color_conversion"
+ dk4error_init(&er);
+ dk4gra_set_color_conversion(gra, ctx, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_CHANGE_SETUP, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 58);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_color_conversion"
+}
+
+
+
+void
+dk4gra_app_page(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_page"
+ dk4error_init(&er);
+ dk4gra_page(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_page"
+}
+
+
+
+void
+dk4gra_app_page_with_flags(
+ dk4_gra_t *gra,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_page_with_flags"
+ dk4error_init(&er);
+ dk4gra_page_with_flags(gra, flags, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_page_with_flags"
+}
+
+
+
+void
+dk4gra_app_set_gs_for_pattern_only(
+ dk4_gra_t *gra,
+ int val,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ $? "+ dk4gra_app_set_gs_for_pattern_only"
+ dk4error_init(&er);
+ dk4gra_set_gs_for_pattern_only(gra, val, &er);
+ if (0 != er.ec) { $? "! failed"
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_CHANGE_SETUP, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 58);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_gs_for_pattern_only"
+}
+
+
+
+void
+dk4gra_app_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_gsave"
+ dk4error_init(&er);
+ dk4gra_gsave(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_gsave"
+}
+
+
+
+void
+dk4gra_app_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_grestore"
+ dk4error_init(&er);
+ dk4gra_grestore(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_grestore"
+}
+
+
+
+void
+dk4gra_app_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_line_width"
+ dk4error_init(&er);
+ dk4gra_set_line_width(gra, lw, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_line_width"
+}
+
+
+
+void
+dk4gra_app_set_line_style(
+ dk4_gra_t *gra,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_line_style"
+ dk4error_init(&er);
+ dk4gra_set_line_style(gra, ls, sv, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_line_style"
+}
+
+
+
+void
+dk4gra_app_set_line_cap(
+ dk4_gra_t *gra,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_line_cap"
+ dk4error_init(&er);
+ dk4gra_set_line_cap(gra, lc, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_line_cap"
+}
+
+
+
+void
+dk4gra_app_set_line_join(
+ dk4_gra_t *gra,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_line_join"
+ dk4error_init(&er);
+ dk4gra_set_line_join(gra, lj, ml, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_line_join"
+}
+
+
+
+void
+dk4gra_app_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_fill_gray"
+ dk4error_init(&er);
+ dk4gra_set_fill_gray(gra, g, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_fill_gray"
+}
+
+
+
+void
+dk4gra_app_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_fill_rgb"
+ dk4error_init(&er);
+ dk4gra_set_fill_rgb(gra, r, g, b, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_fill_rgb"
+}
+
+
+
+void
+dk4gra_app_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_fill_cmyk"
+ dk4error_init(&er);
+ dk4gra_set_fill_cmyk(gra, c, m, y, k, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_fill_cmyk"
+}
+
+
+
+void
+dk4gra_app_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_stroke_gray"
+ dk4error_init(&er);
+ dk4gra_set_stroke_gray(gra, g, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_stroke_gray"
+}
+
+
+
+void
+dk4gra_app_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_stroke_rgb"
+ dk4error_init(&er);
+ dk4gra_set_stroke_rgb(gra, r, g, b, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_stroke_rgb"
+}
+
+
+
+void
+dk4gra_app_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_set_stroke_cmyk"
+ dk4error_init(&er);
+ dk4gra_set_stroke_cmyk(gra, c, m, y, k, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_set_stroke_cmyk"
+}
+
+
+
+
+void
+dk4gra_app_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_prepare_fill"
+ dk4error_init(&er);
+ dk4gra_prepare_fill(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_prepare_fill"
+}
+
+
+
+void
+dk4gra_app_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_prepare_stroke"
+ dk4error_init(&er);
+ dk4gra_prepare_stroke(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_prepare_stroke"
+}
+
+
+
+void
+dk4gra_app_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_prepare_fill_and_stroke"
+ dk4error_init(&er);
+ dk4gra_prepare_fill_and_stroke(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_prepare_fill_and_stroke"
+}
+
+
+
+
+void
+dk4gra_app_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_fill"
+ dk4error_init(&er);
+ dk4gra_fill(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_fill"
+}
+
+
+
+void
+dk4gra_app_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_stroke"
+ dk4error_init(&er);
+ dk4gra_stroke(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_stroke"
+}
+
+
+
+void
+dk4gra_app_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_fill_and_stroke"
+ dk4error_init(&er);
+ dk4gra_fill_and_stroke(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_fill_and_stroke"
+}
+
+
+
+void
+dk4gra_app_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_clip"
+ dk4error_init(&er);
+ dk4gra_clip(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_clip"
+}
+
+
+
+void
+dk4gra_app_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_pattern"
+ dk4error_init(&er);
+ dk4gra_pattern(gra, xl, xr, yb, yt, pn, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_pattern"
+}
+
+
+
+
+void
+dk4gra_app_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_newpath_moveto"
+ dk4error_init(&er);
+ dk4gra_newpath_moveto(gra, x, y, bbptr, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_newpath_moveto"
+}
+
+
+
+void
+dk4gra_app_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_lineto"
+ dk4error_init(&er);
+ dk4gra_lineto(gra, x, y, bbptr, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_lineto"
+}
+
+
+
+void
+dk4gra_app_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_curveto"
+ dk4error_init(&er);
+ dk4gra_curveto(gra, xc1, yc1, xc2, yc2, x, y, bbptr, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_curveto"
+}
+
+
+
+void
+dk4gra_app_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_curveto"
+ dk4error_init(&er);
+ dk4gra_closepath(gra, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_curveto"
+}
+
+
+
+void
+dk4gra_app_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_circle"
+ dk4error_init(&er);
+ dk4gra_circle(gra, xc, yc, r, bbptr, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_circle"
+}
+
+
+
+void
+dk4gra_app_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_rectangle"
+ dk4error_init(&er);
+ dk4gra_rectangle(gra, xl, xr, yb, yt, r, bbptr, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_rectangle"
+}
+
+
+
+void
+dk4gra_app_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_arc"
+ dk4error_init(&er);
+ dk4gra_arc(gra, xc, yc, ra, start, end, cl, bbptr, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_arc"
+}
+
+
+
+void
+dk4gra_app_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_ellipse"
+ dk4error_init(&er);
+ dk4gra_ellipse(gra, xc, yc, rx, ry, rot, bbptr, &back, &er);
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_ellipse"
+}
+
+
+
+void
+dk4gra_app_pgf_simple_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_pgf_simple_text"
+ dk4error_init(&er);
+ dk4gra_pgf_simple_text(
+ gra, x, y, rot, txt, colspec, ie, ha, va, fno, fsz, fex, uc2l,
+ flags, &back, &er
+ );
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_pgf_simple_text"
+}
+
+
+
+void
+dk4gra_app_pgf_special_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_pgf_special_text"
+ dk4error_init(&er);
+ dk4gra_pgf_special_text(
+ gra, x, y, rot, txt, colspec, ha, va, fno, fsz, fex, flags, &back, &er
+ );
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_app_pgf_special_text"
+}
+
+
+/** Check whether the graphics driver supports the image type.
+ @param gra Graphics output structure.
+ @param bif Bitmap image file.
+ @return 1 if image type is supported, 0 otherwise.
+*/
+static
+int
+dk4gra_app_check_driver_and_image_type(
+ dk4_gra_t const *gra,
+ dk4_bif_t const *bif
+)
+{
+ int back = 0;
+ $? "+ dk4gra_app_check_driver_and_image_type"
+ if ((NULL != gra) && (NULL != bif)) {
+ back = 1;
+ switch (gra->dr) {
+ case DK4_GRA_DRIVER_PGF : {
+ switch (dk4bif_get_image_type(bif)) {
+ case DK4_BIF_TYPE_NETPBM : case DK4_BIF_TYPE_TIFF : {
+ back = 0;
+ } break;
+ }
+ } break;
+ }
+ }
+ $? "- dk4gra_app_check_driver_and_image_type %d", back
+ return back;
+}
+
+
+
+void
+dk4gra_app_bif_cotra_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ int back = 1;
+ $? "+ dk4gra_app_bif_cotra_image"
+ dk4error_init(&er);
+ if (0 != dk4gra_app_check_driver_and_image_type(gra, bif)) {
+ dk4gra_bif_cotra_image(
+ gra, cotra, bif, fn, fno,
+ ifl, &back, &er
+ );
+ if (0 == back) { $? "! failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+
+ }
+ else { $? "! driver / file type check failed"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_PGF_IMAGE_TYPE, 0)) {
+ if (NULL != bif) { fn = bif->filename; }
+ dk4gra_app_error(app, fn, &er, 60);
+ }
+ }
+ }
+ $? "- dk4gra_app_bif_cotra_image"
+}
+
+
+
+void
+dk4gra_app_bif_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ int back = 1;
+ $? "+ dk4gra_app_bif_fig_image"
+ dk4error_init(&er);
+ if (0 != dk4gra_app_check_driver_and_image_type(gra, bif)) {
+ dk4gra_bif_fig_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, &back, &er
+ );
+ if (0 == back) { $? "! failed to apply image"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) { $? ". have app"
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ $? ". must report"
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ }
+ else { $? "! driver / image type problem"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) { $? ". have app"
+ if (0 != dk4gra_app_check_error(gra, E_PGF_IMAGE_TYPE, 0)) {
+ $? ". must report"
+ if (NULL != bif) { fn = bif->filename; }
+ dk4gra_app_error(app, fn, &er, 60);
+ }
+ }
+ }
+ $? "- dk4gra_app_bif_fig_image"
+}
+
+
+
+void
+dk4gra_app_bif_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ int back = 1;
+ $? "+ dk4gra_app_bif_image"
+ dk4error_init(&er);
+ if (0 != dk4gra_app_check_driver_and_image_type(gra, bif)) {
+ dk4gra_bif_image(
+ gra, xl, xr, yb, yt, bif, fn, fno,
+ ifl, bbptr, &back, &er
+ );
+ if (0 == back) { $? "! failed to apply image"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) { $? ". have app"
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ $? ". must report"
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ }
+ else { $? "! driver / image type problem"
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) { $? ". have app"
+ if (0 != dk4gra_app_check_error(gra, E_PGF_IMAGE_TYPE, 0)) {
+ $? ". must report"
+ if (NULL != bif) { fn = bif->filename; }
+ dk4gra_app_error(app, fn, &er, 60);
+ }
+ }
+ }
+ $? "- dk4gra_app_bif_image"
+}
+
+
+
+void
+dk4gra_app_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_bif_t *bifptr = NULL; /* Bitmap image */
+ int back = 0; /* Function result */
+ int ho = 0; /* Flag: Read image header only */
+ $? "+ dk4gra_app_image"
+ $? ". xl = %lg", xl
+ $? ". xr = %lg", xr
+ $? ". yb = %lg", yb
+ $? ". yt = %lg", yt
+ $? ". fn = \"%!ds\"", TR_STR(fn)
+ $? ". fno = %u", (unsigned)fno
+ $? ". ctx = %i", TR_IPTR(ctx)
+ $? ". ipol = %d", (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)
+ $? ". ignres = %d", (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)
+ $? ". ignar = %d", (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)
+ $? ". arot = %d", (DK4_GRA_IMG_FLAG_ALLOW_ROTATION & ifl)
+ $? ". oiop = %d", (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)
+ $? ". alzw = %d", (DK4_GRA_IMG_FLAG_LZW & ifl)
+ $? ". ajpg = %d", (DK4_GRA_IMG_FLAG_DCT & ifl)
+ $? ". ijpg = %d", (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)
+ $? ". acol = %d", (DK4_GRA_IMG_FLAG_COLOR & ifl)
+ $? ". anb = %d", (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)
+ $? ". anc = %d", (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)
+ $? ". ana = %d", (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)
+ $? ". fbgf = %d", (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)
+
+ if ((NULL != gra) && (NULL != fn) && (xr > xl) && (yt > yb)) {
+ /*
+ Register coordinates in bounding box
+ */
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ /* Set header-only flag for opening BIF
+ */
+ if (DK4_GRA_DRIVER_PGF == gra->dr) {
+ ho = 1;
+ }
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == dk4bif_type_for_suffix(fn))
+ ) {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ ho = 1;
+ }
+ }
+ /* Open bitmap image file
+ */
+ bifptr = dk4bif_open_app(fn, ho, ctx, app);
+ if (NULL != bifptr) {
+ back = 1;
+ dk4gra_app_bif_image(
+ gra, xl, xr, yb, yt, bifptr, fn, fno,
+ ifl, bbptr, &back, app
+ );
+ $? ". image was applied, close now"
+ dk4bif_close(bifptr);
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ dk4error_init(&er);
+ dk4error_set_simple_error_code(&er, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ if ((0 == back) && (NULL != backptr)) { *backptr = 0; }
+ $? "- dk4gra_app_image %d", back
+}
+
+
+
+void
+dk4gra_app_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_bif_t *bifptr = NULL;
+ int ho = 0;
+ int back = 0;
+ $? "+ dk4gra_fig_image"
+ $? ". xl = %lg", xl
+ $? ". xr = %lg", xr
+ $? ". yb = %lg", yb
+ $? ". yt = %lg", yt
+ $? ". fn = \"%!ds\"", TR_STR(fn)
+ $? ". fno = %u", (unsigned)fno
+ $? ". ctx = %i", TR_IPTR(ctx)
+ $? ". ipol = %d", (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)
+ $? ". ignres = %d", (DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION & ifl)
+ $? ". ignar = %d", (DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO & ifl)
+ $? ". pos = %d", pos
+ $? ". oiop = %d", (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)
+ $? ". alzw = %d", (DK4_GRA_IMG_FLAG_LZW & ifl)
+ $? ". ajpg = %d", (DK4_GRA_IMG_FLAG_DCT & ifl)
+ $? ". ijpg = %d", (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)
+ $? ". acol = %d", (DK4_GRA_IMG_FLAG_COLOR & ifl)
+ $? ". anb = %d", (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)
+ $? ". anc = %d", (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)
+ $? ". ana = %d", (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)
+ $? ". fbgf = %d", (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)
+
+ if ((NULL != gra) && (NULL != fn) && (xr > xl) && (yt > yb)) {
+ if (NULL != bbptr) {
+ dk4bb_add_x(bbptr, xl); dk4bb_add_x(bbptr, xr);
+ dk4bb_add_y(bbptr, yb); dk4bb_add_y(bbptr, yt);
+ }
+ if (DK4_GRA_DRIVER_PGF == gra->dr) {
+ ho = 1;
+ }
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == dk4bif_type_for_suffix(fn))
+ ) {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ ho = 1;
+ }
+ }
+ bifptr = dk4bif_open_app(fn, ho, ctx, app);
+ if (NULL != bifptr) {
+ back = 1;
+ dk4gra_app_bif_fig_image(
+ gra, xl, xr, yb, yt, bifptr, fn, fno,
+ pos, ifl, bbptr, &back, app
+ );
+ $? ". image was applied, close now"
+ dk4bif_close(bifptr);
+ }
+ }
+ else {
+ /* ERROR: Invalid arguments */
+ dk4error_init(&er);
+ dk4error_set_simple_error_code(&er, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_ADD_CONTENTS, er.ec)) {
+ dk4gra_app_error(app, fn, &er, 57);
+ }
+ }
+ }
+ $? "- dk4gra_fig_image %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+void
+dk4gra_app_pgf_doc_font_size(
+ dk4_gra_t *gra,
+ double fs,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_pgf_doc_font_size %lg", fs
+ dk4error_init(&er);
+ dk4gra_pgf_doc_font_size(gra, fs, &back, &er);
+ if (0 == back) {
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_CHANGE_SETUP, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 58);
+ }
+ }
+ }
+ $? "- dk4gra_app_pgf_doc_font_size"
+}
+
+
+
+void
+dk4gra_app_pgf_doc_preamble_line(
+ dk4_gra_t *gra,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dkChar *fn = NULL;
+ int back = 1;
+ $? "+ dk4gra_app_pgf_doc_preamble_line"
+ dk4error_init(&er);
+ dk4gra_pgf_doc_preamble_line(gra, line, tp, &back, &er);
+ if (0 == back) {
+ if (NULL != backptr) { *backptr = 0; }
+ if (NULL != app) {
+ if (0 != dk4gra_app_check_error(gra, E_CHANGE_SETUP, er.ec)) {
+ if (NULL != gra) { fn = gra->fn; }
+ dk4gra_app_error(app, fn, &er, 58);
+ }
+ }
+ }
+ $? "- dk4gra_app_pgf_doc_preamble_line"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4graa.h b/support/dktools/dk4graa.h
new file mode 100644
index 0000000000..d4e542c03a
--- /dev/null
+++ b/support/dktools/dk4graa.h
@@ -0,0 +1,1063 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4graa.ctr
+*/
+
+#ifndef DK4GRAA_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4GRAA_H_INCLUDED 1
+
+
+#line 9 "dk4graa.ctr"
+
+/** @file dk4graa.h Graphics output (PS/EPS/PDF/PGF), application support.
+*/
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4gra.h"
+#else
+#include <dktools-4/dk4gra.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open output structure to create a PDF file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flag set.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+dk4_gra_t *
+dk4gra_app_open_pdf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_app_t *app
+);
+
+
+/** Open output structure to create a PS or EPS file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Flag set, or combination of:
+ - DK4_GRA_DOC_FLAG_PS2<br>
+ to produce PS level 2 instead of level 3,
+ - DK4_GRA_DOC_FLAG_EPS<br>
+ to produce EPS instead of PS,
+ - DK4_GRA_DOC_FLAG_PS_DSC<br>
+ to write document structuring comments.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+dk4_gra_t *
+dk4gra_app_open_ps(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_app_t *app
+);
+
+
+/** Open output structure to create a PGF file.
+ @param fn File name for output file, NULL for standard output.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flag set.
+ @param sa Flag: Produce standalone TeX file.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+dk4_gra_t *
+dk4gra_app_open_pgf(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_app_t *app
+);
+
+
+/** Write output file and close output structure.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_write_and_close(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Write output file and close output structure.
+ @param fout Output file already opened.
+ @param gra Output structure.
+ @param app Application structure for diagnostics, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+*/
+void
+dk4gra_app_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set color space conversion context.
+ @param gra Output structure.
+ @param ctx Color space conversion context to copy.
+ @param backptr Application structure for diagnostics, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4gra_app_set_color_conversion(
+ dk4_gra_t *gra,
+ dk4_cs_conv_ctx_t const *ctx,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Start new page.
+ Default flags are used for the page:
+ - The clip path is set to the image dimensions.
+ - Background is filled white.
+ - For PDF the contents stream is compressed.
+ To start a new page with different setup, use dk4gra_page_with_flags()
+ instead and specify flags.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_page(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Start new page with non-default setup.
+ @param gra Output structure.
+ @param flags Or-combined flags:
+ - DK4_GRA_PAGE_FLAG_NO_CLIP<br>
+ to avoid setting the clip path at start of page,
+ - DK4_GRA_PAGE_FLAG_NO_BG<br>
+ to avoid white background filling,
+ - DK4_GRA_PAGE_FLAG_NOT_COMPRESSED<br>
+ to avoid compression of page content stream in PDF.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_page_with_flags(
+ dk4_gra_t *gra,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set flag for simplified gsave/grestore handling.
+ Set this flag, if you use gsave and grestore only when dealing
+ with clip path for pattern filling.
+ @param gra Output structure.
+ @param val New flag value.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4gra_app_set_gs_for_pattern_only(
+ dk4_gra_t *gra,
+ int val,
+ dk4_app_t *app
+);
+
+
+/** Save current graphics state (especially clip path).
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Restore graphics state (especially clip path).
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+
+/** Set line width.
+ @param gra Output structure.
+ @param lw Line width in bp.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set line style.
+ @param gra Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_line_style(
+ dk4_gra_t *gra,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set line cap.
+ @param gra Output structure.
+ @param lc Line cap type.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_line_cap(
+ dk4_gra_t *gra,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set line join.
+ @param gra Output structure.
+ @param lj Line join type.
+ @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_line_join(
+ dk4_gra_t *gra,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set fill color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set fill color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set fill color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set stroke color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set stroke color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set stroke color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+
+/** Fill current path.
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Stroke current path.
+ Note: Use dk4gra_app_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_app_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_app_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Use current path for clipping.
+ The value of the even-odd-rule flag is used to choose either
+ even-odd-rule or nonzero-winding-rule, the dk4gra_app_set_eorule() function
+ can be used to set the flag.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Pattern a region (clipping should be set to the path).
+ @param gra Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+
+/** Start a new path and move to first point.
+ @param gra Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add line from current point to new point to path.
+ @param gra Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param gra Output structure.
+ @param xc1 X coordinate of first control point.
+ @param yc1 Y coordinate of first control point.
+ @param xc2 X coordinate of second control point.
+ @param yc2 Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Close current path.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Create path for a circle.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add path for an arc.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Create path for an ellipse.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in degree.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding, only used for char text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pgf_simple_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add special text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param gra Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pgf_special_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image with coordinate transformations already calculated.
+ @param gra Output structure.
+ @param cotra Array containing coordinate transformations.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number. The frame number given here is used
+ by the PDF output driver only. You must call
+ dk4bif_set_current_frame() on the bitmap image file before calling
+ this function.
+ @param ifl Image flags.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_bif_cotra_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image XFig style.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_bif_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file data.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_bif_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add bitmap image XFig style.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_fig_image(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set the font size for the documentclass line.
+ @param gra Output structure, must be initialized for PGF.
+ @param fs Font size in pt.
+ @param backptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pgf_doc_font_size(
+ dk4_gra_t *gra,
+ double fs,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add a preamble line.
+ For font setup and package setup the lines added by this function
+ replace the default contents.
+ For other setup the lines added by this function are appended
+ after the default contents.
+ @param gra Output structure, must be initialized for PGF.
+ @param line Line text without trailing newline.
+ @param tp Line type: DK4_GRA_PREAMBLE_FONT, DK4_GRA_PREAMBLE_PACKAGE,
+ or DK4_GRA_PREAMBLE_OTHER.
+ @param backptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4gra_app_pgf_doc_preamble_line(
+ dk4_gra_t *gra,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/dk4gralo.c b/support/dktools/dk4gralo.c
new file mode 100644
index 0000000000..02b4c39ebb
--- /dev/null
+++ b/support/dktools/dk4gralo.c
@@ -0,0 +1,359 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4gralo.ctr
+*/
+
+/** @file dk4gralo.c The dk4gralo module.
+*/
+
+
+#line 104 "dk4gralo.ctr"
+
+#include "dk4conf.h"
+
+#ifndef DK4GRALO_H_INCLUDED
+#include "dk4gralo.h"
+#endif
+
+
+
+
+
+#line 114 "dk4gralo.ctr"
+
+
+
+/** Default texts in English returned if the string table is not found.
+*/
+static const dkChar * const dk4gralog_kwdef[] = {
+/* 0 */
+dkT("Not a boolean value: \""),
+
+/* 1 */
+dkT("\"!"),
+
+/* 2 */
+dkT("Not a resolution value: \""),
+
+/* 3 */
+dkT("\"!"),
+
+/* 4 */
+dkT("Color value \""),
+
+/* 5 */
+dkT("\" out of range 0...255!"),
+
+/* 6 */
+dkT("Not a number: \""),
+
+/* 7 */
+dkT("\"!"),
+
+/* 8 */
+dkT("Not a boolean: \""),
+
+/* 9 */
+dkT("\"!"),
+
+/* 10 */
+dkT("Not a hexadecimal digit: \""),
+
+/* 11 */
+dkT("\"!"),
+
+/* 12 */
+dkT("Hexadecimal number \""),
+
+/* 13 */
+dkT("\" too short, must have 6 digits!"),
+
+/* 14 */
+dkT("Wrong number of components in background specification!"),
+
+/* 15 */
+dkT("Negative number not allowed in resolution specification!"),
+
+/* 16 */
+dkT("Paper size not found: \""),
+
+/* 17 */
+dkT("\"!"),
+
+/* 18 */
+dkT("Negative number not allowed in size specification!"),
+
+/* 19 */
+dkT("Illegal number of arguments for paper size!"),
+
+/* 20 */
+dkT("Option \""),
+
+/* 21 */
+dkT("\" requires a value!"),
+
+/* 22 */
+dkT("Invalid tsize value: \""),
+
+/* 23 */
+dkT("\"!"),
+
+/* 24 */
+dkT("Invalid PS level: \""),
+
+/* 25 */
+dkT("\", must be \"2\" or \"3\"!"),
+
+/* 26 */
+dkT("Negative text size not allowed!"),
+
+/* 27 */
+dkT("No such purpose: \""),
+
+/* 28 */
+dkT("\"!"),
+
+/* 29 */
+dkT("No such driver: \""),
+
+/* 30 */
+dkT("\"!"),
+
+/* 31 */
+dkT("Illegal configuration key: \""),
+
+/* 32 */
+dkT("\"!"),
+
+/* 33 */
+dkT("Empty configuration string!"),
+
+/* 34 */
+dkT("Invalid value!\n\tUnknown RGB to gray conversion method name \""),
+
+/* 35 */
+dkT("\"!"),
+
+/* 36 */
+dkT("Invalid value!\n\tUnknown RGB to gray conversion method name \""),
+
+/* 37 */
+dkT("\"!"),
+
+/* 38 */
+dkT("Invalid value!\n\tNot an alpha handling method: \""),
+
+/* 39 */
+dkT("\"!"),
+
+/* 40 */
+dkT("Failed to set up text stream processing!"),
+
+/* 41 */
+dkT("Failed to read file!"),
+
+/* 42 */
+dkT("Ignoring configuration key \""),
+
+/* 43 */
+dkT("\"!"),
+
+/* 44 */
+dkT("No such driver or purpose: \""),
+
+/* 45 */
+dkT("\"!"),
+
+/* 46 */
+dkT("Line does not contain a value!"),
+
+/* 47 */
+dkT("Purpose \"document\" only available for \"ps\", \"pdf\", \"tex\" output!"),
+
+/* 48 */
+dkT("Processing configuration files (start)."),
+
+/* 49 */
+dkT("Processing configuration files (finished)."),
+
+/* 50 */
+dkT("Processing file (start)."),
+
+/* 51 */
+dkT("Processing file (finished)."),
+
+/* 52 */
+dkT("Failed to create graphics output structure!"),
+
+/* 53 */
+dkT("Invalid function arguments, probably bug!"),
+
+/* 54 */
+dkT("Numeric overflow in size calculation!\n\tSome dimension too large?"),
+
+/* 55 */
+dkT("Failed to write data!"),
+
+/* 56 */
+dkT("Failed to flush write buffers!"),
+
+/* 57 */
+dkT("Failed to add graphics details!"),
+
+/* 58 */
+dkT("Failed to change graphics setup!"),
+
+/* 59 */
+dkT("Failed to write graphics to file!"),
+
+/* 60 */
+dkT("Only PNG/JPEG allowed in PGF output!"),
+
+/* 61 */
+dkT("Not an unsigned number: \""),
+
+/* 62 */
+dkT("\"!"),
+
+/* 63 */
+dkT("Illegal value: 0!"),
+
+/* 64 */
+dkT("Unusual large number of x-spline sub segments!\n\tMay result in large output files."),
+
+/* 65 */
+dkT("Unusual low number of x-spline sub segments!\n\tMay result in inexact approximation."),
+
+/* 66 */
+dkT("Option \""),
+
+/* 67 */
+dkT("\" requires a value!"),
+
+/* 68 */
+dkT("Not a floating point number: \""),
+
+/* 69 */
+dkT("\"!"),
+
+/* 70 */
+dkT("Positive value required for \""),
+
+/* 71 */
+dkT("\"!"),
+
+NULL
+
+
+#line 335 "dk4gralo.ctr"
+};
+
+
+
+/** String table file name.
+*/
+static const dkChar dk4gralog_stt_file_name[] = { dkT("dk4gra.str") };
+
+
+
+/** Number of elements in the dk4gralog_kwdef array.
+*/
+static const size_t dk4gralog_sz_kwdef =
+(sizeof(dk4gralog_kwdef)/sizeof(DK4_PDKCHAR) - 1);
+
+
+const dkChar * const *
+dk4gralog_localized_texts(dk4_app_t *app)
+{
+ if (NULL != app) {
+ return (
+ dk4app_string_table(
+ app,
+ dk4gralog_stt_file_name,
+ dk4gralog_kwdef
+ )
+ );
+ }
+ else {
+ return dk4gralog_kwdef;
+ }
+}
+
+
+
+size_t
+dk4gralog_sz_localized_texts(void)
+{
+ return ( dk4app_string_table_size(dk4gralog_kwdef) );
+}
+
+
+
+void
+dk4gralog_1(
+ dk4_app_t *app,
+ int priority,
+ size_t i1
+)
+{
+ const dkChar * const *msg; /* Localized texts */
+
+ if (NULL != app) {
+ msg = dk4gralog_localized_texts(app);
+ dk4app_log_1(app, msg, dk4gralog_sz_kwdef, priority, i1);
+ }
+}
+
+
+
+void
+dk4gralog_3(
+ dk4_app_t *app,
+ int priority,
+ size_t i1,
+ size_t i2,
+ const dkChar *t1
+)
+{
+ const dkChar * const *msg; /* Localized texts */
+
+ if (NULL != app) {
+ msg = dk4gralog_localized_texts(app);
+ dk4app_log_3(app, msg, dk4gralog_sz_kwdef, priority, i1, i2, t1);
+ }
+}
+
+
+
+void
+dk4gralog_choice(
+ dk4_app_t *app,
+ int priority,
+ const dkChar *t1,
+ const dkChar *allowed
+)
+{
+ const dkChar *mp[8]; /* Array of message components */
+ const dkChar * const *msg; /* Localized text fragments */
+
+ if ((NULL != app) && (NULL != t1) && (NULL != allowed)) {
+ msg = dk4gralog_localized_texts(app);
+ mp[0] = msg[2];
+ mp[1] = t1;
+ mp[2] = msg[3];
+ mp[4] = allowed;
+ dk4app_log_msg(app, priority, mp, 4);
+ }
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4gralo.ctr b/support/dktools/dk4gralo.ctr
new file mode 100644
index 0000000000..9d1625c018
--- /dev/null
+++ b/support/dktools/dk4gralo.ctr
@@ -0,0 +1,437 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Obtain array of localized texts.
+ @param app Application structure.
+ @return String table of localized texts.
+ The table can be used only as long as app is valid,
+ as app manages the memory for the string table.
+*/
+const dkChar * const *
+dk4gralog_localized_texts(dk4_app_t *app);
+
+/** Find string table size (number of strings) in default string array.
+ @return Number of strings required in string table file.
+*/
+size_t
+dk4gralog_sz_localized_texts(void);
+
+
+/** Issue message of 1 component (const).
+ @param app Aplication structure.
+ @param priority Message priority.
+ @param i1 Index of first constant part in message array.
+*/
+void
+dk4gralog_1(
+ dk4_app_t *app,
+ int priority,
+ size_t i1
+);
+
+/** Issue message of 3 components (const, variable, const).
+ @param app Aplication structure.
+ @param priority Message priority.
+ @param i1 Index of first constant part in message array.
+ @param i2 Index of second constant part in message array.
+ @param t1 Variable text.
+*/
+void
+dk4gralog_3(
+ dk4_app_t *app,
+ int priority,
+ size_t i1,
+ size_t i2,
+ const dkChar *t1
+);
+
+
+/** Write error message about illegal resolution value.
+ @param app Application structure for diagnostics.
+ @param priority Diagnostic message priority.
+ @param t1 Text entered by the user.
+ @param allowed Allowed texts to use instead.
+*/
+void
+dk4gralog_choice(
+ dk4_app_t *app,
+ int priority,
+ const dkChar *t1,
+ const dkChar *allowed
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#include "dk4conf.h"
+
+#ifndef DK4GRALO_H_INCLUDED
+#include "dk4gralo.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Default texts in English returned if the string table is not found.
+*/
+static const dkChar * const dk4gralog_kwdef[] = {
+$!string-table macro=dkT
+#
+# 0 1 ERROR: Not a boolean value.
+#
+Not a boolean value: "
+"!
+#
+# 2 3 ERROR: Not a resolution value.
+#
+Not a resolution value: "
+"!
+#
+# 4 5 ERROR: Color value out of range.
+#
+Color value "
+" out of range 0...255!
+#
+# 6 7 ERROR: Not a number!
+#
+Not a number: "
+"!
+#
+# 8 9 ERROR: Not a boolean
+#
+Not a boolean: "
+"!
+#
+# 10 11 ERROR: Not a hexadecimal digit!
+#
+Not a hexadecimal digit: "
+"!
+#
+# 12 13 ERROR: Hexadecimal number to short!
+#
+Hexadecimal number "
+" too short, must have 6 digits!
+#
+# 14 ERROR: Wrong number of components in background specification!
+#
+Wrong number of components in background specification!
+#
+# 15 ERROR: Negative number not allowed in resolution specification!
+#
+Negative number not allowed in resolution specification!
+#
+# 16 17 ERROR: Paper size not found
+#
+Paper size not found: "
+"!
+#
+# 18
+#
+Negative number not allowed in size specification!
+#
+# 19
+#
+Illegal number of arguments for paper size!
+#
+# 20 21 ERROR: Option requires a value!
+#
+Option "
+" requires a value!
+#
+# 22 23 ERROR: Invalid tsize value!
+#
+Invalid tsize value: "
+"!
+#
+# 24 25 ERROR: Invalid PS level
+#
+Invalid PS level: "
+", must be "2" or "3"!
+#
+# 26 ERROR: Text size must not be negative
+#
+Negative text size not allowed!
+#
+# 27 28 ERROR: Illegal purpose!
+#
+No such purpose: "
+"!
+#
+# 29 30 ERROR: No such driver!
+#
+No such driver: "
+"!
+#
+# 31 32 ERROR: Illegal configuration key!
+#
+Illegal configuration key: "
+"!
+#
+# 33 ERROR: Empty configuration string!
+#
+Empty configuration string!
+#
+# 34 35 ERROR: Unknown RGB to gray conversion method name "..."!
+#
+Invalid value!\n\tUnknown RGB to gray conversion method name "
+"!
+#
+# 36 37 ERROR: Unknown RGB to gray conversion method name "..."!
+#
+Invalid value!\n\tUnknown RGB to gray conversion method name "
+"!
+#
+# 38 39 ERROR: Not an alpha handling method: "..."!
+#
+Invalid value!\n\tNot an alpha handling method: "
+"!
+#
+# 40 ERROR: Failed to set up text stream processing!
+#
+Failed to set up text stream processing!
+#
+# 41 ERROR: Failed to read file!
+#
+Failed to read file!
+#
+# 42 43 Warning: Ignoring configuration key "..."!
+#
+Ignoring configuration key "
+"!
+#
+# 44 45 ERROR: No such driver or purpose: "..."!
+#
+No such driver or purpose: "
+"!
+#
+# 46 ERROR: Line does not contain a value!
+#
+Line does not contain a value!
+#
+# 47 ERROR: Purpose "document" only available for "ps", "pdf", "tex"!
+#
+Purpose "document" only available for "ps", "pdf", "tex" output!
+#
+# 48-49 Progress messages for configuration files
+#
+Processing configuration files (start).
+Processing configuration files (finished).
+#
+# 50-51 Progress messages for files to convert
+#
+Processing file (start).
+Processing file (finished).
+#
+# 52 ERROR: Failed to create graphics output structure!
+#
+Failed to create graphics output structure!
+#
+# 53 ERROR: Invalid function arguments, probably bug!
+#
+Invalid function arguments, probably bug!
+#
+# 54 ERROR: Numeric overflow
+#
+Numeric overflow in size calculation!\n\tSome dimension too large?
+#
+# 55 ERROR: Failed to write data!
+#
+Failed to write data!
+#
+# 56 ERROR: Failed to flush write buffers!
+#
+Failed to flush write buffers!
+#
+# 57 ERROR: Failed to add graphics details!
+#
+Failed to add graphics details!
+#
+# 58 ERROR: Failed to change graphics setup!
+#
+Failed to change graphics setup!
+#
+# 59 ERROR: Failed to write graphics to file!
+#
+Failed to write graphics to file!
+#
+# 60 ERROR: Only PNG/JPEG allowed in PGF output!
+#
+Only PNG/JPEG allowed in PGF output!
+#
+# 61 62 Not an unsigned number!
+#
+Not an unsigned number: "
+"!
+#
+# 63 Illegal value: 0!
+#
+Illegal value: 0!
+#
+# 64 Warning: Unusual large number of x-spline sub segments!
+#
+Unusual large number of x-spline sub segments!\n\tMay result in large output files.
+#
+# 65 Warning: Unusual low number of x-spline sub segments!
+#
+Unusual low number of x-spline sub segments!\n\tMay result in inexact approximation.
+#
+# 66 67 Warning: Option ... requires a value!
+#
+Option "
+" requires a value!
+#
+# 68 69 ERROR: Not a floating point number: "..."!
+#
+Not a floating point number: "
+"!
+#
+# 70 71 ERROR: Positive value required for "..."!
+#
+Positive value required for "
+"!
+$!end
+};
+
+
+
+/** String table file name.
+*/
+static const dkChar dk4gralog_stt_file_name[] = { dkT("dk4gra.str") };
+
+
+
+/** Number of elements in the dk4gralog_kwdef array.
+*/
+static const size_t dk4gralog_sz_kwdef =
+(sizeof(dk4gralog_kwdef)/sizeof(DK4_PDKCHAR) - 1);
+
+
+const dkChar * const *
+dk4gralog_localized_texts(dk4_app_t *app)
+{
+ if (NULL != app) {
+ return (
+ dk4app_string_table(
+ app,
+ dk4gralog_stt_file_name,
+ dk4gralog_kwdef
+ )
+ );
+ }
+ else {
+ return dk4gralog_kwdef;
+ }
+}
+
+
+
+size_t
+dk4gralog_sz_localized_texts(void)
+{
+ return ( dk4app_string_table_size(dk4gralog_kwdef) );
+}
+
+
+
+void
+dk4gralog_1(
+ dk4_app_t *app,
+ int priority,
+ size_t i1
+)
+{
+ const dkChar * const *msg; /* Localized texts */
+
+ if (NULL != app) {
+ msg = dk4gralog_localized_texts(app);
+ dk4app_log_1(app, msg, dk4gralog_sz_kwdef, priority, i1);
+ }
+}
+
+
+
+void
+dk4gralog_3(
+ dk4_app_t *app,
+ int priority,
+ size_t i1,
+ size_t i2,
+ const dkChar *t1
+)
+{
+ const dkChar * const *msg; /* Localized texts */
+
+ if (NULL != app) {
+ msg = dk4gralog_localized_texts(app);
+ dk4app_log_3(app, msg, dk4gralog_sz_kwdef, priority, i1, i2, t1);
+ }
+}
+
+
+
+void
+dk4gralog_choice(
+ dk4_app_t *app,
+ int priority,
+ const dkChar *t1,
+ const dkChar *allowed
+)
+{
+ const dkChar *mp[8]; /* Array of message components */
+ const dkChar * const *msg; /* Localized text fragments */
+
+ if ((NULL != app) && (NULL != t1) && (NULL != allowed)) {
+ msg = dk4gralog_localized_texts(app);
+ mp[0] = msg[2];
+ mp[1] = t1;
+ mp[2] = msg[3];
+ mp[4] = allowed;
+ dk4app_log_msg(app, priority, mp, 4);
+ }
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4gralo.h b/support/dktools/dk4gralo.h
new file mode 100644
index 0000000000..06c520d2b4
--- /dev/null
+++ b/support/dktools/dk4gralo.h
@@ -0,0 +1,119 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4gralo.ctr
+*/
+
+/** @file dk4gralo.h Header file for the dk4gralo module.
+*/
+
+#ifndef DK4GRALO_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4GRALO_H_INCLUDED 1
+
+
+#line 8 "dk4gralo.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Obtain array of localized texts.
+ @param app Application structure.
+ @return String table of localized texts.
+ The table can be used only as long as app is valid,
+ as app manages the memory for the string table.
+*/
+const dkChar * const *
+dk4gralog_localized_texts(dk4_app_t *app);
+
+/** Find string table size (number of strings) in default string array.
+ @return Number of strings required in string table file.
+*/
+size_t
+dk4gralog_sz_localized_texts(void);
+
+
+/** Issue message of 1 component (const).
+ @param app Aplication structure.
+ @param priority Message priority.
+ @param i1 Index of first constant part in message array.
+*/
+void
+dk4gralog_1(
+ dk4_app_t *app,
+ int priority,
+ size_t i1
+);
+
+/** Issue message of 3 components (const, variable, const).
+ @param app Aplication structure.
+ @param priority Message priority.
+ @param i1 Index of first constant part in message array.
+ @param i2 Index of second constant part in message array.
+ @param t1 Variable text.
+*/
+void
+dk4gralog_3(
+ dk4_app_t *app,
+ int priority,
+ size_t i1,
+ size_t i2,
+ const dkChar *t1
+);
+
+
+/** Write error message about illegal resolution value.
+ @param app Application structure for diagnostics.
+ @param priority Diagnostic message priority.
+ @param t1 Text entered by the user.
+ @param allowed Allowed texts to use instead.
+*/
+void
+dk4gralog_choice(
+ dk4_app_t *app,
+ int priority,
+ const dkChar *t1,
+ const dkChar *allowed
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4grat.c b/support/dktools/dk4grat.c
new file mode 100644
index 0000000000..1d1bc8d320
--- /dev/null
+++ b/support/dktools/dk4grat.c
@@ -0,0 +1,1891 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grat.ctr
+*/
+
+/** @file dk4grat.c The dk4grat module.
+*/
+
+
+#line 164 "dk4grat.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include "dk4grat.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#include "dk4strm.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4ITER_H_INCLUDED
+#include "dk4iter.h"
+#endif
+
+#ifndef DK4BITSH_H_INCLUDED
+#include "dk4bitsh.h"
+#endif
+
+#ifndef DK4EDSTM_H_INCLUDED
+#include "dk4edstm.h"
+#endif
+
+#ifndef DK4FONTC_H_INCLUDED
+#include "dk4fontc.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 248 "dk4grat.ctr"
+
+
+
+/** Masks to request a single bit from a dk4_px_t value.
+*/
+static const dk4_px_t dk4gratool_bit_values[] = {
+ 0x0001, 0x0002, 0x0004, 0x0008,
+ 0x0010, 0x0020, 0x0040, 0x0080,
+ 0x0100, 0x0200, 0x0400, 0x0800
+};
+
+
+
+/** Start of standalone document, part 1.
+*/
+static const char * const dk4gratool_text1[] = {
+/* 0 */
+"% PPPT_FONT_SETUP_BEGIN\n",
+
+/* 1 */
+"\\usepackage[T1]{fontenc}\n",
+
+/* 2 */
+"\\usepackage{mathptmx}\n",
+
+/* 3 */
+"\\usepackage[scaled=.92]{helvet}\n",
+
+/* 4 */
+"\\usepackage{courier}\n",
+
+/* 5 */
+"% PPPT_FONT_SETUP_END\n",
+
+NULL
+
+
+#line 272 "dk4grat.ctr"
+};
+
+
+
+/** Start of standalone document, part 1.
+*/
+static const char * const dk4gratool_text3[] = {
+/* 0 */
+"% PPPT_PACKAGES_BEGIN\n",
+
+/* 1 */
+"\\usepackage{textcomp}\n",
+
+/* 2 */
+"\\usepackage[intlimits]{amsmath}\n",
+
+/* 3 */
+"\\usepackage{fancybox}\n",
+
+/* 4 */
+"\\usepackage{graphicx}\n",
+
+/* 5 */
+"\\usepackage{xcolor}\n",
+
+/* 6 */
+"% PPPT_PACKAGES_END\n",
+
+NULL
+
+
+#line 288 "dk4grat.ctr"
+};
+
+
+
+/** Start of standalone document, part 1.
+*/
+static const char * const dk4gratool_text4[] = {
+/* 0 */
+"% PPPT_PDF_INFO_BEGIN\n",
+
+/* 1 */
+"% \\usepackage{hyperref}\n",
+
+/* 2 */
+"% \\hypersetup{\n",
+
+/* 3 */
+"% pdfauthor={Anonymous author},\n",
+
+/* 4 */
+"% pdftitle={Document title},\n",
+
+/* 5 */
+"% pdfsubject={Document subject},\n",
+
+/* 6 */
+"% pdfkeywords={Key,word,another}\n",
+
+/* 7 */
+"% }\n",
+
+/* 8 */
+"% PPPT_PDF_INFO_END\n",
+
+NULL
+
+
+#line 306 "dk4grat.ctr"
+};
+
+
+/** Start of standalone document, part 2.
+*/
+static const char * const dk4gratool_text2[] = {
+/* 0 */
+"\\pagestyle{empty}\n",
+
+/* 1 */
+"\\setlength{\\voffset}{-1in}\n",
+
+/* 2 */
+"\\setlength{\\topmargin}{0bp}\n",
+
+/* 3 */
+"\\setlength{\\headheight}{0bp}\n",
+
+/* 4 */
+"\\setlength{\\headsep}{0bp}\n",
+
+/* 5 */
+"\\setlength{\\topskip}{0bp}\n",
+
+/* 6 */
+"\\setlength{\\hoffset}{-1in}\n",
+
+/* 7 */
+"\\setlength{\\oddsidemargin}{0bp}\n",
+
+/* 8 */
+"\\setlength{\\evensidemargin}{0bp}\n",
+
+/* 9 */
+"\\setlength{\\marginparwidth}{0bp}\n",
+
+/* 10 */
+"\\setlength{\\marginparsep}{0bp}\n",
+
+/* 11 */
+"\\setlength{\\textwidth}{\\paperwidth}\n",
+
+/* 12 */
+"\\setlength{\\textheight}{\\paperheight}\n",
+
+/* 13 */
+"\\setlength{\\parskip}{0bp}\n",
+
+/* 14 */
+"\\setlength{\\parindent}{0bp}\n",
+
+/* 15 */
+"\\setlength{\\pdfpagewidth}{\\paperwidth}\n",
+
+/* 16 */
+"\\setlength{\\pdfpageheight}{\\paperheight}\n",
+
+NULL
+
+
+#line 331 "dk4grat.ctr"
+};
+
+
+
+/** Constant text fragments.
+*/
+static const char * const dk4gratool_kw[] = {
+/* 0 */ "\n",
+/* 1 */ "\\setlength{\\paperwidth}{",
+/* 2 */ "\\setlength{\\paperheight}{",
+/* 3 */ "bp}\n",
+/* 4 */ "\\end{document}\n",
+/* 5 */ "\\usepackage{pgfcore}\n",
+/* 6 */ "\\color[cmyk]{",
+/* 7 */ "\\color[gray]{",
+/* 8 */ "\\color[rgb]{",
+/* 9 */ "}",
+/* 10 */ ",",
+/* 11 */ "\\newfont{\\PPPTfo",
+/* 12 */ "}{",
+/* 13 */ "pt}%\n",
+/* 14 */ " at ",
+/* 15 */ "\\providecommand{\\PPPTfo",
+/* 16 */ "}{}%\n",
+/* 17 */ "\\renewcommand{\\PPPTfo",
+/* 18 */ "}{\\normalfont",
+/* 19 */ "\\selectfont}%\n",
+/* 20 */ "\\fontfamily{",
+/* 21 */ "}",
+/* 22 */ "\\ttdefault",
+/* 23 */ "\\sfdefault",
+/* 24 */ "\\rmdefault",
+/* 25 */ "\\fontseries{\\bfdefault}",
+/* 26 */ "\\fontseries{\\mddefault}",
+/* 27 */ "\\fontshape{\\itdefault}",
+/* 28 */ "\\fontshape{\\updefault}",
+/* 29 */ "\\fontsize{",
+/* 30 */ "pt}{",
+/* 31 */ "pt}",
+/* 32 */ "\\begin{document}%\n",
+/* 33 */ "\\documentclass[12pt]{article}\n",
+/* 34 */ "\\documentclass[",
+/* 35 */ "pt]{article}\n",
+/* 36 */ "% PPPT_FONT_SETUP_BEGIN\n",
+/* 37 */ "% PPPT_FONT_SETUP_END\n",
+/* 38 */ "% PPPT_PACKAGES_BEGIN\n",
+/* 39 */ "% PPPT_PACKAGES_END\n",
+NULL
+};
+
+
+
+/** Alphabet used to translate numbers to uniqe names.
+*/
+static const char dk4gratool_alphabet[] = {
+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+};
+
+
+dk4_gra_t *
+dk4gratool_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+
+
+#line 401 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert(0 < w);
+ assert(0 < h);
+#endif
+ back = dk4mem_new(dk4_gra_t,1,erp);
+ if (NULL != back) {
+ /*
+ Initialize all components to defaults
+ */
+ dk4cs_context_init(&(back->cscctx), erp);
+ back->s_pages = NULL;
+ back->i_pages = NULL;
+ back->fn = NULL;
+ back->curpg = NULL;
+ back->pages = 0;
+ back->dr = DK4_GRA_DRIVER_PDF;
+ back->gscp = 0;
+ back->eor = 1;
+ back->w = w;
+ back->h = h;
+ back->cur_x = 0.0;
+ back->cur_y = 0.0;
+ back->patlw = 0.9;
+ back->le = 0;
+ back->lec = 0;
+ back->len = 0;
+ back->docfl = docfl;
+
+ /*
+ Allocate memory for data copies
+ */
+ if (NULL != fn) {
+ back->fn = dk4str_dup(fn, erp);
+ if (NULL == back->fn) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 442 "dk4grat.ctr"
+ return back;
+}
+
+
+
+void
+dk4gratool_close(
+ dk4_gra_t *gptr
+)
+{
+
+
+#line 453 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gptr);
+#endif
+ if (NULL != gptr) {
+
+#line 457 "dk4grat.ctr"
+ if (NULL != gptr->fn) {
+
+#line 458 "dk4grat.ctr"
+ dk4mem_free(gptr->fn);
+ gptr->fn = NULL;
+ }
+ dk4mem_free(gptr);
+ }
+
+
+#line 464 "dk4grat.ctr"
+}
+
+
+
+int
+dk4gratool_points_for_circle(
+ dk4_gra_point_t *ptr,
+ size_t sz,
+ double r,
+ dk4_er_t *erp
+)
+{
+ double kr; /* Product of kappa and radius */
+ double krsq2; /* Product of kappa and radius divided by sqrt(2) */
+ int back = 0;
+
+
+#line 480 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert((24 == sz) || (12 == sz));
+ assert(0.0 < r);
+#endif
+ if ((NULL == ptr) || ((24 != sz) && (12 != sz)) || (0.0 >= r)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ ptr[0].x = r;
+ ptr[0].y = 0.0;
+ if (24 == sz) {
+ kr = KAPPA_8 * r;
+ krsq2 = kr / M_SQRT2;
+ ptr[ 1].x = r;
+ ptr[ 1].y = kr;
+ ptr[ 3].x = r / M_SQRT2;
+ ptr[ 3].y = r / M_SQRT2;
+ ptr[ 2].x = ptr[3].x + krsq2;
+ ptr[ 2].y = ptr[3].y - krsq2;
+ ptr[ 4].x = ptr[3].x - krsq2;
+ ptr[ 4].y = ptr[3].y + krsq2;
+ ptr[ 5].x = kr;
+ ptr[ 5].y = r;
+ ptr[ 6].x = 0.0;
+ ptr[ 6].y = r;
+ ptr[ 7].x = 0.0 - kr;
+ ptr[ 7].y = r;
+ ptr[ 9].x = 0.0 - ptr[3].x;
+ ptr[ 9].y = ptr[3].y;
+ ptr[ 8].x = ptr[9].x + krsq2;
+ ptr[ 8].y = ptr[9].y + krsq2;
+ ptr[10].x = ptr[9].x - krsq2;
+ ptr[10].y = ptr[9].y - krsq2;
+ ptr[11].x = 0.0 - r;
+ ptr[11].y = kr;
+ ptr[12].x = 0.0 - r;
+ ptr[12].y = 0.0;
+ ptr[13].x = 0.0 - r;
+ ptr[13].y = 0.0 - kr;
+ ptr[15].x = ptr[9].x;
+ ptr[15].y = 0.0 - ptr[3].x;
+ ptr[14].x = ptr[15].x - krsq2;
+ ptr[14].y = ptr[15].y + krsq2;
+ ptr[16].x = ptr[15].x + krsq2;
+ ptr[16].y = ptr[15].y - krsq2;
+ ptr[17].x = 0.0 - kr;
+ ptr[17].y = 0.0 - r;
+ ptr[18].x = 0.0;
+ ptr[18].y = 0.0 - r;
+ ptr[19].x = kr;
+ ptr[19].y = 0.0 - r;
+ ptr[21].x = ptr[3].x;
+ ptr[21].y = 0.0 - ptr[3].y;
+ ptr[20].x = ptr[21].x - krsq2;
+ ptr[20].y = ptr[21].y - krsq2;
+ ptr[22].x = ptr[21].x + krsq2;
+ ptr[22].y = ptr[21].y + krsq2;
+ ptr[23].x = r;
+ ptr[23].y = 0.0 - kr;
+ }
+ else {
+ kr = KAPPA_4 * r;
+ ptr[ 1].x = r;
+ ptr[ 1].y = kr;
+ ptr[ 2].x = kr;
+ ptr[ 2].y = r;
+ ptr[ 3].x = 0.0;
+ ptr[ 3].y = r;
+ ptr[ 4].x = 0.0 - kr;
+ ptr[ 4].y = r;
+ ptr[ 5].x = 0.0 - r;
+ ptr[ 5].y = kr;
+ ptr[ 6].x = 0.0 - r;
+ ptr[ 6].y = 0.0;
+ ptr[ 7].x = 0.0 - r;
+ ptr[ 7].y = 0.0 - kr;
+ ptr[ 8].x = 0.0 - kr;
+ ptr[ 8].y = 0.0 - r;
+ ptr[ 9].x = 0.0;
+ ptr[ 9].y = 0.0 - r;
+ ptr[10].x = kr;
+ ptr[10].y = 0.0 - r;
+ ptr[11].x = r;
+ ptr[11].y = 0.0 - kr;
+ }
+ back = 1;
+
+ finished:
+
+
+#line 570 "dk4grat.ctr"
+ return back;
+}
+
+
+
+int
+dk4gratool_points_for_ellipse(
+ dk4_gra_point_t *ptr,
+ size_t sz,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double alpha,
+ dk4_er_t *erp
+)
+{
+ double coeff; /* Coefficient ry/rx */
+ size_t i; /* Index to traverse all points */
+ int back = 0; /* Result */
+
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert((24 == sz) || (12 == sz));
+ assert(0.0 < rx);
+ assert(0.0 < ry);
+#endif
+ /*
+ Check arguments
+ */
+ if (
+ (NULL == ptr) || ((24 != sz) && (12 != sz))
+ || (0.0 >= rx) || (0.0 >= ry)
+ ) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /*
+ Create circle data
+ */
+ back = dk4gratool_points_for_circle(ptr, sz, rx, erp);
+ if (0 == back) { goto finished; }
+ /*
+ Scale y values for radius ry
+ */
+ coeff = ry / rx;
+ for (i = 0; i < sz; i++) {
+ ptr[i].y *= coeff;
+ }
+ /* Rotate the points if necessary
+ */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(alpha)) {
+ for (i = 0; i < sz; i++) {
+ dk4gratool_rotate_point(&(ptr[i]), alpha);
+ }
+ }
+ /* Shift to specified center point
+ */
+ for (i = 0; i < sz; i++) {
+ ptr[i].x += xc;
+ ptr[i].y += yc;
+ }
+ /* Check all coordinates for finite values.
+ */
+ for (i = 0; i < sz; i++) {
+#if DK4_HAVE_ISFINITE
+ if ((!(isfinite(ptr[i].x))) || (!(isfinite(ptr[i].y)))) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+#else
+#if DK4_HAVE__FINITE
+ if ((!(_finite(ptr[i].x))) || (!(_finite(ptr[i].y)))) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+#else
+
+#endif
+#endif
+ }
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4gratool_rotate_point(dk4_gra_point_t *pt, double rot)
+{
+ double r; /* Point radius */
+ double a; /* Point angle */
+
+
+#line 664 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pt);
+#endif
+ r = sqrt(pt->x * pt->x + pt->y * pt->y);
+ a = atan2(pt->y, pt->x);
+ a += rot;
+ pt->x = r * cos(a);
+ pt->y = r * sin(a);
+
+
+#line 673 "dk4grat.ctr"
+}
+
+
+
+void
+dk4gratool_initialize_attributes(
+ dk4gra_attributes_t *pattr
+)
+{
+
+
+#line 683 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pattr);
+#endif
+ if (NULL != pattr) {
+ pattr->lc_active = -1;
+ pattr->lc_requested = DK4_GRA_LC_BUTTED;
+ pattr->lj_active = -1;
+ pattr->lj_requested = DK4_GRA_LJ_MITERED;
+ pattr->ls_active = -1;
+ pattr->ls_requested = DK4_GRA_LS_SOLID;
+ pattr->lw_active = -1.0;
+ pattr->lw_requested = 0.9;
+ pattr->sv_active = -1.0;
+ pattr->sv_requested = 4.0;
+ pattr->ml_active = 10.0;
+ pattr->ml_requested = 10.0;
+ pattr->eor_active = -1;
+ pattr->eor_requested = 0;
+ dk4mem_reset(&(pattr->col_stroke_active), sizeof(dk4gra_col_t), NULL);
+ pattr->col_stroke_active.what = DK4_GRA_COL_SPEC_NONE;
+ dk4mem_cpy(
+ &(pattr->col_fill_active), &(pattr->col_stroke_active),
+ sizeof(dk4gra_col_t), NULL
+ );
+ dk4mem_cpy(
+ &(pattr->col_stroke_requested), &(pattr->col_stroke_active),
+ sizeof(dk4gra_col_t), NULL
+ );
+ pattr->col_stroke_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ pattr->col_stroke_requested.data.gray = 0.0;
+ dk4mem_cpy(
+ &(pattr->col_fill_requested), &(pattr->col_stroke_requested),
+ sizeof(dk4gra_col_t), NULL
+ );
+
+ }
+
+
+#line 720 "dk4grat.ctr"
+}
+
+
+
+void
+dk4gratool_reset_active_attributes(
+ dk4gra_attributes_t *pattr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pattr);
+#endif
+ pattr->col_stroke_active.what = DK4_GRA_COL_SPEC_NONE;
+ pattr->col_fill_active.what = DK4_GRA_COL_SPEC_NONE;
+ pattr->lw_active = -1.0;
+ pattr->sv_active = -1.0;
+ pattr->ml_active = -1.0;
+ pattr->lc_active = -1;
+ pattr->lj_active = -1;
+ pattr->ls_active = -1;
+ pattr->eor_active = -1;
+}
+
+
+
+void
+dk4gratool_set_color_requested(
+ dk4gra_col_t *pcol,
+ int colsp,
+ double c1,
+ double c2,
+ double c3,
+ double c4
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pcol);
+#endif
+ pcol->what = colsp;
+ switch (colsp) {
+ case DK4_GRA_COL_SPEC_CMYK : {
+ pcol->data.cmyk.c = c1;
+ pcol->data.cmyk.m = c2;
+ pcol->data.cmyk.y = c3;
+ pcol->data.cmyk.k = c4;
+ } break;
+ case DK4_GRA_COL_SPEC_RGB : {
+ pcol->data.rgb.r = c1;
+ pcol->data.rgb.g = c2;
+ pcol->data.rgb.b = c3;
+ } break;
+ case DK4_GRA_COL_SPEC_GRAY : {
+ pcol->data.gray = c1;
+ } break;
+ }
+}
+
+
+
+int
+dk4gratool_colors_differ(
+ dk4gra_col_t *p1,
+ dk4gra_col_t *p2
+)
+{
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != p1);
+ assert(NULL != p2);
+#endif
+ if (p1->what == p2->what) {
+ switch (p1->what) {
+ case DK4_GRA_COL_SPEC_CMYK : {
+ back = 0;
+ if (1.0e-3 < fabs(p1->data.cmyk.c - p2->data.cmyk.c)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.cmyk.m - p2->data.cmyk.m)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.cmyk.y - p2->data.cmyk.y)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.cmyk.k - p2->data.cmyk.k)) {
+ back = 1;
+ }
+ } break;
+ case DK4_GRA_COL_SPEC_RGB : {
+ back = 0;
+ if (1.0e-3 < fabs(p1->data.rgb.r - p2->data.rgb.r)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.rgb.g - p2->data.rgb.g)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.rgb.b - p2->data.rgb.b)) {
+ back = 1;
+ }
+ } break;
+ case DK4_GRA_COL_SPEC_GRAY : {
+ if (1.0e-3 >= fabs(p1->data.gray - p2->data.gray)) {
+ back = 0;
+ }
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4gratool_line_style_differs(
+ int ls_a,
+ int ls_r,
+ double sv_a,
+ double sv_r,
+ int lwc
+)
+{
+ int back = 1;
+
+
+#line 842 "dk4grat.ctr"
+ if (ls_a == ls_r) {
+ back = 0;
+ if (DK4_GRA_LS_SOLID != ls_a) {
+ if (0 != lwc) {
+ back = 1;
+ }
+ else {
+ if (1.0e-3 < fabs(sv_a - sv_r)) {
+ back = 1;
+ }
+ }
+ }
+ }
+
+
+#line 856 "dk4grat.ctr"
+ return back;
+}
+
+
+
+int
+dk4gratool_calculate_transformations(
+ double *dst,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double w,
+ double h,
+ int kar,
+ int pos,
+ dk4_er_t *erp
+)
+{
+ double dx; /* Available X space */
+ double dy; /* Available Y space */
+ size_t i; /* Traverse transformation values */
+ int back = 0;
+
+
+#line 880 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(xr > xl);
+ assert(yt > yb);
+ assert(0.0 < w);
+ assert(0.0 < h);
+#endif
+ if ((xr <= xl) || (yt <= yb) || (0.0 >= w) || (0.0 >= h)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < 5; i++) { dst[i] = 0.0; }
+ dx = xr - xl;
+ dy = yt - yb;
+ switch (pos) {
+ case 1: {
+ dst[2] = 90.0;
+ if (0 != kar) {
+ if ((w * dx) > (h * dy)) { /* Y fully used, space in X */
+ dx = (h * dy) / w;
+ dst[0] = xr - (xr - xl - dx) / 2.0;
+ dst[1] = yb;
+ }
+ else { /* X fully used, space in Y */
+ dy = (w * dx) / h;
+ dst[0] = xr;
+ dst[1] = yb + (yt - yb - dy) / 2.0;
+ }
+ dst[3] = dy;
+ dst[4] = dx;
+ }
+ else {
+ dst[0] = xr;
+ dst[1] = yb;
+ dst[3] = yt - yb;
+ dst[4] = xr - xl;
+ }
+ } break;
+ case 2: {
+ dst[2] = 180.0;
+ if (0 != kar) {
+ if ((w * dy) > (h * dx)) { /* X fully used, space in Y */
+ dy = (h * dx) / w;
+ dst[0] = xr;
+ dst[1] = yt - (yt - yb - dy) / 2.0;
+ }
+ else {
+ dx = (w * dy) / h;
+ dst[0] = xr - (xr - xl - dx) / 2.0;
+ dst[1] = yt;
+ }
+ dst[3] = dx;
+ dst[4] = dy;
+ }
+ else {
+ dst[0] = xr;
+ dst[1] = yt;
+ dst[3] = xr - xl;
+ dst[4] = yt - yb;
+ }
+ } break;
+ case 3: {
+ dst[2] = 270.0;
+ if (0 != kar) {
+ if ((w * dx) > (h * dy)) { /* Y fully used, space in X */
+ dx = (h * dy) / w;
+ dst[0] = xl + (xr - xl - dx) / 2.0;
+ dst[1] = yt;
+ }
+ else { /* X fully used, space in Y */
+ dy = (w * dx) / h;
+ dst[0] = xl;
+ dst[1] = yt - (yt - yb - dy) / 2.0;
+ }
+ dst[3] = dy;
+ dst[4] = dx;
+ }
+ else {
+ dst[0] = xl;
+ dst[1] = yt;
+ dst[3] = yt - yb;
+ dst[4] = xr - xl;
+
+ }
+ } break;
+ case 4: {
+ dst[2] = 90.0;
+ if (0 != kar) {
+ if ((w * dx) > (h * dy)) { /* Y fully used, space in X */
+ dx = (h * dy) / w;
+ dst[0] = xr - (xr - xl - dx) / 2.0;
+ dst[1] = yt;
+ }
+ else { /* X fully used, space in Y */
+ dy = (w * dx) / h;
+ dst[0] = xr;
+ dst[1] = yt - (yt - yb - dy) / 2.0;
+ }
+ dst[3] = 0.0 - dy;
+ dst[4] = dx;
+ }
+ else {
+ dst[0] = xr;
+ dst[1] = yt;
+ dst[3] = yb - yt;
+ dst[4] = xr - xl;
+ }
+ } break;
+ case 5: {
+ if (0 != kar) {
+ if ((w * dy) > (h * dx)) { /* X fully used, space in Y */
+ dy = (h * dx) / w;
+ dst[0] = xr;
+ dst[1] = yb + (yt - yb - dy) / 2.0;
+ }
+ else { /* Y fully used, space in X */
+ dx = (w * dy) / h;
+ dst[0] = xr - (xr - xl - dx) / 2.0;
+ dst[1] = yb;
+ }
+ dst[3] = 0.0 - dx;
+ dst[4] = dy;
+
+ }
+ else {
+ dst[0] = xr;
+ dst[1] = yb;
+ dst[3] = xl - xr;
+ dst[4] = yt - yb;
+ }
+ } break;
+ case 6: {
+ dst[2] = 90.0;
+ if (0 != kar) {
+ if ((w * dx) > (h * dy)) { /* Y fully used, space in X */
+ dx = (h * dy) / w;
+ dst[0] = xl + (xr - xl - dx) / 2.0;
+ dst[1] = yb;
+ }
+ else { /* X fully used, space in Y */
+ dy = (w * dx) / h;
+ dst[0] = xl;
+ dst[1] = yb + (yt - yb - dy) / 2.0;
+ }
+ dst[3] = dy;
+ dst[4] = 0.0 - dx;
+ }
+ else {
+ dst[0] = xl;
+ dst[1] = yb;
+ dst[3] = yt - yb;
+ dst[4] = xl - xr;
+ }
+ } break;
+ case 7: {
+ if (0 != kar) {
+ if ((w * dy) > (h * dx)) { /* X fully used, space in Y */
+ dy = (h * dx) / w;
+ dst[0] = xl;
+ dst[1] = yt - (yt - yb - dy) / 2.0;
+ }
+ else { /* Y fully used, space in X */
+ dx = (w * dy) / h;
+ dst[0] = xl + (xr - xl - dx) / 2.0;
+ dst[1] = yt;
+ }
+ dst[3] = dx;
+ dst[4] = 0.0 - dy;
+
+ }
+ else {
+ dst[0] = xl;
+ dst[1] = yt;
+ dst[3] = xr - xl;
+ dst[4] = yb - yt;
+ }
+ } break;
+ default : { /* 0 */
+ if (0 != kar) {
+ if ((w * dy) > (h * dx)) { /* X fully used, space in Y */
+ dy = (h * dx) / w;
+ dst[0] = xl;
+ dst[1] = yb + (yt - yb - dy) / 2.0;
+ }
+ else { /* Y fully used, space in X */
+ dx = (w * dy) / h;
+ dst[0] = xl + (xr - xl - dx) / 2.0;
+ dst[1] = yb;
+ }
+ dst[3] = dx;
+ dst[4] = dy;
+ }
+ else {
+ dst[0] = xl;
+ dst[1] = yb;
+ dst[3] = (xr - xl);
+ dst[4] = (yt - yb);
+ }
+ } break;
+ }
+
+ back = 1;
+ for (i = 0; i < 5; i++) {
+#if DK4_HAVE_ISFINITE
+ if (!(isfinite(dst[i]))) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+#else
+#if DK4_HAVE__FINITE
+ if (!(_finite(dst[i]))) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+#endif
+#endif
+ }
+
+ finished:
+
+
+#line 1100 "dk4grat.ctr"
+ return back;
+}
+
+
+
+void
+dk4gratool_stream_string(
+ dk4_stream_t *os,
+ const char *str,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != str);
+#endif
+ if (0 == dk4stream_write_char_string(os, str, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+void
+dk4gratool_stream_double(
+ dk4_stream_t *os,
+ double val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ if (0 == dk4ma_write_c8_double_no_sci_to_stream(os,val,1.0e-8,0,1,erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+void
+dk4gratool_stream_uint(
+ dk4_stream_t *os,
+ dk4_um_t val,
+ size_t padsz,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ char buf[16*sizeof(dk4_um_t)]; /* Buffer for val as text */
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ if (0 != dk4ma_write_c8_decimal_unsigned(buf,sizeof(buf),val,padsz,erp)) {
+ dk4gratool_stream_string(os, buf, backptr, erp);
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+void
+dk4gratool_stream_num_alpha(
+ dk4_stream_t *os,
+ size_t val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t kwi; /* Index of number in alphabet */
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ do {
+ kwi = val % (size_t)26U;
+ val = val / (size_t)26U;
+ if (0 == dk4stream_write_byte(os, dk4gratool_alphabet[kwi], erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } while (0 < val);
+}
+
+
+
+void
+dk4gratool_stream_color(
+ dk4_stream_t *os,
+ dk4gra_col_t const *col,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != col);
+#endif
+ switch (col->what) {
+ case DK4_GRA_COL_SPEC_CMYK : {
+ dk4gratool_stream_string(os, dk4gratool_kw[6], backptr, erp);
+ dk4gratool_stream_double(os, col->data.cmyk.c, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.cmyk.m, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.cmyk.y, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.cmyk.k, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[9], backptr, erp);
+ } break;
+ case DK4_GRA_COL_SPEC_GRAY : {
+ dk4gratool_stream_string(os, dk4gratool_kw[7], backptr, erp);
+ dk4gratool_stream_double(os, col->data.gray, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[9], backptr, erp);
+ } break;
+ default : { /* RGB */
+ dk4gratool_stream_string(os, dk4gratool_kw[8], backptr, erp);
+ dk4gratool_stream_double(os, col->data.rgb.r, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.rgb.g, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.rgb.b, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[9], backptr, erp);
+ } break;
+ }
+}
+
+
+
+double
+dk4gratool_kappa_for_angle(double alpha)
+{
+ double back;
+
+
+#line 1236 "dk4grat.ctr"
+ alpha = fabs(alpha);
+ back = (2.0 * sqrt(8.0 * (1.0 - cos(alpha))) - 4.0 * sin(alpha))
+ / (3.0 * alpha * (1.0 - cos(alpha)));
+
+
+#line 1240 "dk4grat.ctr"
+ return back;
+}
+
+
+
+dk4_px_t
+dk4gratool_bit(
+ size_t i
+)
+{
+ return (dk4gratool_bit_values[i]);
+}
+
+
+
+void
+dk4gratool_put_pixel_value(
+ dk4_stream_t *strm,
+ dk4_bit_shift_t *bs,
+ dk4_px_t pixval,
+ dk4_px_bit_depth_t bpc,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int res;
+ dk4_px_bit_depth_t i;
+
+
+#line 1268 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != bs);
+#endif
+ for (i = 0; i < bpc; i++) {
+ res = dk4bit_shift_add(
+ bs,
+ ((0 != (pixval & (dk4gratool_bit(bpc-1-i)))) ? (1) : (0)),
+ NULL
+ );
+ if (DK4_EDSTM_FINISHED == res) {
+ res = dk4stream_write_byte(
+ strm, dk4bit_shift_output(bs, NULL), erp
+ );
+ if (0 == res) {
+
+#line 1283 "dk4grat.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ }
+
+
+#line 1288 "dk4grat.ctr"
+}
+
+
+
+/** Write paragraph of text to output.
+ @param ostrm Output stream.
+ @param strar String array.
+ @param bptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gratool_paragraph_to_stream(
+ dk4_stream_t *ostrm,
+ const char * const *strar,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != strar);
+#endif
+ if ((NULL != ostrm) && (NULL != strar)) {
+ while (NULL != *strar) {
+ dk4gratool_stream_string(ostrm, *(strar++), bptr, erp);
+ }
+ }
+}
+
+
+
+void
+dk4gratool_start_standalone_document(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ int pgf,
+ double dfs,
+ dk4_sto_t *s_f,
+ dk4_sto_it_t *i_f,
+ dk4_sto_t *s_p,
+ dk4_sto_it_t *i_p,
+ dk4_sto_t *s_o,
+ dk4_sto_it_t *i_o,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_preamble_line_t *pl;
+ int res;
+
+
+#line 1339 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != gra);
+ assert(0.0 < dfs);
+#endif
+ /*
+ Document class
+ */
+
+
+#line 1348 "dk4grat.ctr"
+ if (0.0 < dfs) {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[34], bptr, erp);
+ res = dk4ma_write_c8_double_no_sci_to_stream(
+ ostrm, dfs, 1.0e-1, 0, 0, erp
+ );
+ if (0 == res) { if (NULL != bptr) { *bptr = 0; } }
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[35], bptr, erp);
+ }
+ else {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[33], bptr, erp);
+ }
+ /*
+ Font setup
+ */
+ if ((NULL != s_f) && (NULL != i_f)) {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[36], bptr, erp);
+ dk4sto_it_reset(i_f);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(i_f);
+ if (NULL != pl) {
+ dk4gratool_stream_string(ostrm, pl->text, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[0], bptr, erp);
+ }
+ } while (NULL != pl);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[37], bptr, erp);
+ }
+ else {
+ dk4gratool_paragraph_to_stream(ostrm, dk4gratool_text1, bptr, erp);
+ }
+ /*
+ Additional packages
+ */
+ if ((NULL != s_p) && (NULL != i_p)) {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[38], bptr, erp);
+ dk4sto_it_reset(i_p);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(i_p);
+ if (NULL != pl) {
+ dk4gratool_stream_string(ostrm, pl->text, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[0], bptr, erp);
+ }
+ } while (NULL != pl);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[39], bptr, erp);
+ }
+ else {
+ dk4gratool_paragraph_to_stream(ostrm, dk4gratool_text3, bptr, erp);
+ }
+ dk4gratool_paragraph_to_stream(ostrm, dk4gratool_text4, bptr, erp);
+ /*
+ /setlength{/paperwidth{xxxbp}
+ */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[1], bptr, erp);
+ dk4gratool_stream_uint(ostrm, gra->w, 0, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[3], bptr, erp);
+ /*
+ /setlength{/paperheight{xxxbp}
+ */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[2], bptr, erp);
+ dk4gratool_stream_uint(ostrm, gra->h, 0, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[3], bptr, erp);
+ /*
+ /usepackage{pgfcore}
+ */
+ if (0 != pgf) {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[5], bptr, erp);
+ }
+ /*
+ Instructions for setup
+ */
+ dk4gratool_paragraph_to_stream(ostrm, dk4gratool_text2, bptr, erp);
+ /*
+ Additional other setup lines
+ */
+ if ((NULL != s_o) && (NULL != i_o)) {
+ dk4sto_it_reset(i_o);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(i_o);
+ if (NULL != pl) {
+ dk4gratool_stream_string(ostrm, pl->text, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[0], bptr, erp);
+ }
+ } while (NULL != pl);
+ }
+ /*
+ /begin{document}
+ */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[32], bptr, erp);
+
+
+#line 1436 "dk4grat.ctr"
+}
+
+
+
+void
+dk4gratool_end_standalone_document(
+ dk4_stream_t *ostrm,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+#endif
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[4], bptr, erp);
+}
+
+
+
+/** Write definition for one font from collector to output stream.
+ @param ostrm Output stream.
+ @param foi Font item to write.
+ @param bptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gratool_font_one_definition(
+ dk4_stream_t *ostrm,
+ dk4_font_item_t const *foi,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+ const char *lfn = NULL; /* LaTeX font name */
+ int ffl = 0; /* Font number or font features */
+ int ff = 0; /* Font features mask */
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != foi);
+#endif
+ if (DK4_GRA_TF_EXACT_SIZE == foi->fex) {
+ lfn = dk4font_get_latex_font_name(dk4font_number_from_int(foi->fno));
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[11], bptr, erp);
+ dk4gratool_stream_num_alpha(ostrm, foi->nf, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[12], bptr, erp);
+ dk4gratool_stream_string(ostrm, lfn, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[14], bptr, erp);
+ dk4gratool_stream_double(ostrm, foi->fsz, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[13], bptr, erp);
+ }
+ else {
+ /* providecommand */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[15], bptr, erp);
+ dk4gratool_stream_num_alpha(ostrm, foi->nf, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[16], bptr, erp);
+ /* renewcommand */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[17], bptr, erp);
+ dk4gratool_stream_num_alpha(ostrm, foi->nf, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[18], bptr, erp);
+ /* Font size */
+ switch (foi->fex) {
+ case DK4_GRA_TF_SIMILAR_SIZE : case DK4_GRA_TF_NONE_SIZE : {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[29], bptr, erp);
+ dk4gratool_stream_double(ostrm, foi->fsz, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[30], bptr, erp);
+ dk4gratool_stream_double(ostrm, (1.2 * foi->fsz), bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[31], bptr, erp);
+ } break;
+ default : {
+ /* Intentionally empty to avoid compiler warnings. */
+ } break;
+ }
+ /* Font family, series and shape */
+ switch (foi->fex) {
+ case DK4_GRA_TF_EXACT_NONE :
+ case DK4_GRA_TF_SIMILAR_SIZE :
+ case DK4_GRA_TF_SIMILAR_NONE : {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[20], bptr, erp);
+ if (DK4_GRA_TF_EXACT_NONE == foi->fex) {
+ dk4gratool_stream_string(
+ ostrm,
+ dk4font_get_latex_family_name(
+ dk4font_number_from_int(foi->fno)
+ ),
+ bptr,
+ erp
+ );
+ }
+ else {
+ switch (DK4_FONT_FEATURE_FT_MASK & (foi->fno)) {
+ case DK4_FONT_FEATURE_SYMBOL : {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[24], bptr, erp
+ );
+ } break;
+ case DK4_FONT_FEATURE_TTY : {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[22], bptr, erp
+ );
+ } break;
+ case DK4_FONT_FEATURE_SANS_SERIF : {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[23], bptr, erp
+ );
+ } break;
+ default : { /* roman */
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[24], bptr, erp
+ );
+ } break;
+ }
+ /* 2019-05-14 Bugfix
+ To find the type we must and-combine the font
+ features with the mask bit as above.
+ */
+#if 0
+ if (0 != (DK4_FONT_FEATURE_TTY & (foi->fno))) {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[22], bptr, erp
+ );
+ }
+ else {
+ if (0 != (DK4_FONT_FEATURE_SANS_SERIF & (foi->fno))) {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[23], bptr, erp
+ );
+ }
+ else {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[24], bptr, erp
+ );
+ }
+ }
+#endif
+ }
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[21], bptr, erp);
+ ffl = foi->fno;
+ if (DK4_GRA_TF_EXACT_NONE == foi->fex) {
+ ffl = dk4font_get_features(
+ dk4font_number_from_int(foi->fno)
+ );
+ }
+ if (0 != (DK4_FONT_FEATURE_BOLD & ffl)) {
+ dk4gratool_stream_string(ostrm,dk4gratool_kw[25],bptr,erp);
+ }
+ else {
+ dk4gratool_stream_string(ostrm,dk4gratool_kw[26],bptr,erp);
+ }
+ ff = DK4_FONT_FEATURE_ITALIC | DK4_FONT_FEATURE_OBLIQUE;
+ if (0 != (ff & ffl)) {
+ dk4gratool_stream_string(ostrm,dk4gratool_kw[27],bptr,erp);
+ }
+ else {
+ dk4gratool_stream_string(ostrm,dk4gratool_kw[28],bptr,erp);
+ }
+ } break;
+ default : {
+ /* Intentionally empty to avoid compiler warnings. */
+ } break;
+ }
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[19], bptr, erp);
+ }
+}
+
+
+
+void
+dk4gratool_font_definitions(
+ dk4_stream_t *ostrm,
+ dk4_font_collector_t *fontc,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+ dk4_font_item_t *foi; /* Current font item to write */
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != fontc);
+#endif
+ dk4sto_it_reset(fontc->i_fn);
+ do {
+ foi = (dk4_font_item_t *)dk4sto_it_next(fontc->i_fn);
+ if (NULL != foi) {
+ dk4gratool_font_one_definition(ostrm, foi, bptr, erp);
+ }
+ } while (NULL != foi);
+}
+
+
+
+int
+dk4gratool_compare_preamble_lines(
+ void const *l,
+ void const *r,
+ int DK4_ARG_UNUSED(cr)
+)
+{
+ dk4_gra_preamble_line_t const *pl;
+ dk4_gra_preamble_line_t const *pr;
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (dk4_gra_preamble_line_t const *)l;
+ pr = (dk4_gra_preamble_line_t const *)r;
+ if (pl->lineno > pr->lineno) {
+ back = 1;
+ }
+ else {
+ if (pl->lineno < pr->lineno) {
+ back = -1;
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+void
+dk4gratool_preamble_delete(
+ dk4_gra_preamble_line_t *ptr
+)
+{
+
+
+#line 1672 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
+ if (NULL != ptr) {
+
+#line 1676 "dk4grat.ctr"
+ if (NULL != ptr->text) {
+
+#line 1677 "dk4grat.ctr"
+ dk4mem_free(ptr->text);
+ }
+ dk4mem_free(ptr);
+ }
+
+
+#line 1682 "dk4grat.ctr"
+}
+
+
+
+dk4_gra_preamble_line_t *
+dk4gratool_preamble_new(
+ char const *textline,
+ size_t lineno,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_preamble_line_t *back = NULL;
+
+
+#line 1695 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != textline);
+#endif
+ if (NULL != textline) {
+
+#line 1699 "dk4grat.ctr"
+ back = dk4mem_new(dk4_gra_preamble_line_t,1,erp);
+ if (NULL != back) {
+
+#line 1701 "dk4grat.ctr"
+ back->lineno = lineno;
+ back->text = dk4str8_dup(textline, erp);
+ if (NULL == back->text) {
+
+#line 1704 "dk4grat.ctr"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1710 "dk4grat.ctr"
+ }
+#endif
+ }
+ else {
+
+#line 1714 "dk4grat.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1717 "dk4grat.ctr"
+ return back;
+}
+
+
+
+double
+dk4gratool_dist_point_point(
+ dk4_gra_point_t const *a,
+ dk4_gra_point_t const *b,
+ dk4_er_t *erp
+)
+{
+ double back = -1;
+ double dx;
+ double dy;
+#if DK4_USE_ASSERT
+ assert(NULL != a);
+ assert(NULL != b);
+#endif
+ if ((NULL != a) && (NULL != b)) {
+ dx = b->x - a->x;
+ dy = b->y - a->y;
+ back = sqrt(dx * dx + dy * dy);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+/** Calculate square value.
+ @param x Original value.
+ @return Square value.
+*/
+
+static
+double
+dbl_sq(double x)
+{
+ return (x * x);
+}
+
+
+double
+dk4gratool_dist_point_track(
+ dk4_gra_point_t const *a,
+ dk4_gra_point_t const *b,
+ dk4_gra_point_t const *p,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t q;
+ double back = -1.0;
+ double z;
+ double n;
+ double t;
+#if DK4_USE_ASSERT
+ assert(NULL != a);
+ assert(NULL != b);
+ assert(NULL != p);
+#endif
+ if ((NULL != a) && (NULL != b) && (NULL != p)) {
+ z = (b->y - a->y) * p->y - a->y * b->y + dbl_sq(a->y);
+ z += (b->x - a->x) * p->x - a->x * b->x + dbl_sq(a->x);
+ n = dbl_sq(b->y) - 2.0 * a->y * b->y + dbl_sq(a->y);
+ n += dbl_sq(b->x) - 2.0 * a->x * b->x + dbl_sq(a->x);
+ t = z / n;
+ if ((0 != dk4ma_is_finite(t)) && (0.0 <= t) && (1.0 >= t)) {
+ q.x = a->x + t * (b->x - a->x);
+ q.y = a->y + t * (b->y - a->y);
+ back = dk4gratool_dist_point_point(&q, p, erp);
+ }
+ else {
+ z = dk4gratool_dist_point_point(a, p, erp);
+ n = dk4gratool_dist_point_point(b, p, erp);
+ back = ((z <= n) ? (z) : (n));
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+double
+dk4gratool_dist_point_ellipse_simple(
+ double rx,
+ double ry,
+ dk4_gra_point_t const *p
+)
+{
+ double px;
+ double back = -1.0;
+
+
+#line 1815 "dk4grat.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != p);
+ assert(0.0 < rx);
+ assert(0.0 < ry);
+#endif
+ px = (ry * p->x) / rx;
+
+#line 1821 "dk4grat.ctr"
+ back = sqrt((px * px) + (p->y * p->y));
+
+#line 1822 "dk4grat.ctr"
+ back = fabs(back - ry);
+
+#line 1823 "dk4grat.ctr"
+ back = (back * rx) / ry;
+
+#line 1824 "dk4grat.ctr"
+
+
+#line 1825 "dk4grat.ctr"
+ return back;
+}
+
+
+
+double
+dk4gratool_dist_point_ellipse(
+ dk4_gra_point_t const *c,
+ double rx,
+ double ry,
+ double rot,
+ dk4_gra_point_t const *p,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t myp;
+ double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != c);
+ assert(NULL != p);
+ assert(0.0 < rx);
+ assert(0.0 < ry);
+#endif
+ if ((NULL != c) && (NULL != p) && (0.0 < rx) && (0.0 < ry)) {
+ DK4_MEMCPY(&myp,p,sizeof(dk4_gra_point_t));
+ myp.x -= c->x;
+ myp.y -= c->y;
+ if (1.0e-8 <= fabs(rot)) {
+ dk4gratool_rotate_point(&myp, (0.0 - rot));
+ }
+ back = dk4gratool_dist_point_ellipse_simple(rx, ry, &myp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grat.ctr b/support/dktools/dk4grat.ctr
new file mode 100644
index 0000000000..813b1cbef6
--- /dev/null
+++ b/support/dktools/dk4grat.ctr
@@ -0,0 +1,1866 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Calculate kappa value for angle to use instead of 1/3 for Bezier curves.
+ @param alpha Arc angle.
+ @return Kappa value.
+*/
+double
+dk4gratool_kappa_for_angle(double alpha);
+
+/** Initialize points to draw a circle.
+ @param ptr Address of result array of points.
+ @param sz Number of elements in array (12 or 24).
+ @param r Radius.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if ptr is NULL, r is negative or the number of points
+ is neither 12 nor 24.
+*/
+int
+dk4gratool_points_for_circle(
+ dk4_gra_point_t *ptr,
+ size_t sz,
+ double r,
+ dk4_er_t *erp
+);
+
+/** Initialize points to draw an ellipse.
+ @param ptr Address of result array of points.
+ @param sz Number of elements in array (12 or 24).
+ @param xc Center point x.
+ @param yc Center point y.
+ @param rx X radius.
+ @param ry Y radius.
+ @param alpha Rotation counterclockwise in radians.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if ptr is NULL, r is negative or the number of points
+ is neither 12 nor 24.
+*/
+int
+dk4gratool_points_for_ellipse(
+ dk4_gra_point_t *ptr,
+ size_t sz,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double alpha,
+ dk4_er_t *erp
+);
+
+
+/** Rotate a point relatively to origin.
+ @param pt Point whose coordinates must be changed (in/out),
+ must not be NULL (not checked in function).
+ @param rot Rotation counterclockwise in radians.
+*/
+
+void
+dk4gratool_rotate_point(
+ dk4_gra_point_t *pt,
+ double rot
+);
+
+
+/** Calculate distance between two points.
+ @param a Point A.
+ @param b Point B.
+ @param erp Error report, may be NULL.
+ @return Distance between the points.
+*/
+
+double
+dk4gratool_dist_point_point(
+ dk4_gra_point_t const *a,
+ dk4_gra_point_t const *b,
+ dk4_er_t *erp
+);
+
+
+/** Calculate distance between a track specified by points
+ A and B and an external point P.
+ @param a Track endpoint A.
+ @param b Track endpoint B.
+ @param p External point P.
+ @param erp Error report, may be NULL.
+ @return Distance from point P to track specified by endpoint A, B.
+*/
+
+double
+dk4gratool_dist_point_track(
+ dk4_gra_point_t const *a,
+ dk4_gra_point_t const *b,
+ dk4_gra_point_t const *p,
+ dk4_er_t *erp
+);
+
+
+/** Calculate distance between a simple ellipse (in origin, not rotated)
+ and a point.
+ This is a poor approximation working best if rx and ry do not
+ differ too much.
+ @param rx Ellipse x radius.
+ @param ry Ellipse y radius.
+ @param p Point.
+ @return Non-negative value on success, negative value on error.
+*/
+
+double
+dk4gratool_dist_point_ellipse_simple(
+ double rx,
+ double ry,
+ dk4_gra_point_t const *p
+);
+
+
+/** Calculate distance between a rotated ellipse and a point.
+ This is a poor approximation working best if rx and ry do not
+ differ too much.
+ @param c Ellipse center point.
+ @param rx Ellipse x radius.
+ @param ry Ellipse y radius.
+ @param rot Ellipse rotation.
+ @param p Point to calculate distance to.
+ @param erp Error report, may be NULL.
+ @return Distance value.
+*/
+
+double
+dk4gratool_dist_point_ellipse(
+ dk4_gra_point_t const *c,
+ double rx,
+ double ry,
+ double rot,
+ dk4_gra_point_t const *p,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include "dk4grat.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#include "dk4strm.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4ITER_H_INCLUDED
+#include "dk4iter.h"
+#endif
+
+#ifndef DK4BITSH_H_INCLUDED
+#include "dk4bitsh.h"
+#endif
+
+#ifndef DK4EDSTM_H_INCLUDED
+#include "dk4edstm.h"
+#endif
+
+#ifndef DK4FONTC_H_INCLUDED
+#include "dk4fontc.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Masks to request a single bit from a dk4_px_t value.
+*/
+static const dk4_px_t dk4gratool_bit_values[] = {
+ 0x0001, 0x0002, 0x0004, 0x0008,
+ 0x0010, 0x0020, 0x0040, 0x0080,
+ 0x0100, 0x0200, 0x0400, 0x0800
+};
+
+
+
+/** Start of standalone document, part 1.
+*/
+static const char * const dk4gratool_text1[] = {
+$!string-table
+% PPPT_FONT_SETUP_BEGIN\n
+\\usepackage[T1]{fontenc}\n
+\\usepackage{mathptmx}\n
+\\usepackage[scaled=.92]{helvet}\n
+\\usepackage{courier}\n
+% PPPT_FONT_SETUP_END\n
+$!end
+};
+
+
+
+/** Start of standalone document, part 1.
+*/
+static const char * const dk4gratool_text3[] = {
+$!string-table
+% PPPT_PACKAGES_BEGIN\n
+\\usepackage{textcomp}\n
+\\usepackage[intlimits]{amsmath}\n
+\\usepackage{fancybox}\n
+\\usepackage{graphicx}\n
+\\usepackage{xcolor}\n
+% PPPT_PACKAGES_END\n
+$!end
+};
+
+
+
+/** Start of standalone document, part 1.
+*/
+static const char * const dk4gratool_text4[] = {
+$!string-table
+% PPPT_PDF_INFO_BEGIN\n
+% \\usepackage{hyperref}\n
+% \\hypersetup{\n
+% pdfauthor={Anonymous author},\n
+% pdftitle={Document title},\n
+% pdfsubject={Document subject},\n
+% pdfkeywords={Key,word,another}\n
+% }\n
+% PPPT_PDF_INFO_END\n
+$!end
+};
+
+
+/** Start of standalone document, part 2.
+*/
+static const char * const dk4gratool_text2[] = {
+$!string-table
+\\pagestyle{empty}\n
+\\setlength{\\voffset}{-1in}\n
+\\setlength{\\topmargin}{0bp}\n
+\\setlength{\\headheight}{0bp}\n
+\\setlength{\\headsep}{0bp}\n
+\\setlength{\\topskip}{0bp}\n
+\\setlength{\\hoffset}{-1in}\n
+\\setlength{\\oddsidemargin}{0bp}\n
+\\setlength{\\evensidemargin}{0bp}\n
+\\setlength{\\marginparwidth}{0bp}\n
+\\setlength{\\marginparsep}{0bp}\n
+\\setlength{\\textwidth}{\\paperwidth}\n
+\\setlength{\\textheight}{\\paperheight}\n
+\\setlength{\\parskip}{0bp}\n
+\\setlength{\\parindent}{0bp}\n
+\\setlength{\\pdfpagewidth}{\\paperwidth}\n
+\\setlength{\\pdfpageheight}{\\paperheight}\n
+$!end
+};
+
+
+
+/** Constant text fragments.
+*/
+static const char * const dk4gratool_kw[] = {
+/* 0 */ "\n",
+/* 1 */ "\\setlength{\\paperwidth}{",
+/* 2 */ "\\setlength{\\paperheight}{",
+/* 3 */ "bp}\n",
+/* 4 */ "\\end{document}\n",
+/* 5 */ "\\usepackage{pgfcore}\n",
+/* 6 */ "\\color[cmyk]{",
+/* 7 */ "\\color[gray]{",
+/* 8 */ "\\color[rgb]{",
+/* 9 */ "}",
+/* 10 */ ",",
+/* 11 */ "\\newfont{\\PPPTfo",
+/* 12 */ "}{",
+/* 13 */ "pt}%\n",
+/* 14 */ " at ",
+/* 15 */ "\\providecommand{\\PPPTfo",
+/* 16 */ "}{}%\n",
+/* 17 */ "\\renewcommand{\\PPPTfo",
+/* 18 */ "}{\\normalfont",
+/* 19 */ "\\selectfont}%\n",
+/* 20 */ "\\fontfamily{",
+/* 21 */ "}",
+/* 22 */ "\\ttdefault",
+/* 23 */ "\\sfdefault",
+/* 24 */ "\\rmdefault",
+/* 25 */ "\\fontseries{\\bfdefault}",
+/* 26 */ "\\fontseries{\\mddefault}",
+/* 27 */ "\\fontshape{\\itdefault}",
+/* 28 */ "\\fontshape{\\updefault}",
+/* 29 */ "\\fontsize{",
+/* 30 */ "pt}{",
+/* 31 */ "pt}",
+/* 32 */ "\\begin{document}%\n",
+/* 33 */ "\\documentclass[12pt]{article}\n",
+/* 34 */ "\\documentclass[",
+/* 35 */ "pt]{article}\n",
+/* 36 */ "% PPPT_FONT_SETUP_BEGIN\n",
+/* 37 */ "% PPPT_FONT_SETUP_END\n",
+/* 38 */ "% PPPT_PACKAGES_BEGIN\n",
+/* 39 */ "% PPPT_PACKAGES_END\n",
+NULL
+};
+
+
+
+/** Alphabet used to translate numbers to uniqe names.
+*/
+static const char dk4gratool_alphabet[] = {
+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+};
+
+
+dk4_gra_t *
+dk4gratool_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ $? "+ dk4gratool_open \"%!ds\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert(0 < w);
+ assert(0 < h);
+#endif
+ back = dk4mem_new(dk4_gra_t,1,erp);
+ if (NULL != back) {
+ /*
+ Initialize all components to defaults
+ */
+ dk4cs_context_init(&(back->cscctx), erp);
+ back->s_pages = NULL;
+ back->i_pages = NULL;
+ back->fn = NULL;
+ back->curpg = NULL;
+ back->pages = 0;
+ back->dr = DK4_GRA_DRIVER_PDF;
+ back->gscp = 0;
+ back->eor = 1;
+ back->w = w;
+ back->h = h;
+ back->cur_x = 0.0;
+ back->cur_y = 0.0;
+ back->patlw = 0.9;
+ back->le = 0;
+ back->lec = 0;
+ back->len = 0;
+ back->docfl = docfl;
+
+ /*
+ Allocate memory for data copies
+ */
+ if (NULL != fn) {
+ back->fn = dk4str_dup(fn, erp);
+ if (NULL == back->fn) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- dk4gratool_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+dk4gratool_close(
+ dk4_gra_t *gptr
+)
+{
+ $? "+ dk4gratool_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gptr);
+#endif
+ if (NULL != gptr) { $? ". gptr"
+ if (NULL != gptr->fn) { $? ". fn \"%!ds\"", gptr->fn
+ dk4mem_free(gptr->fn);
+ gptr->fn = NULL;
+ }
+ dk4mem_free(gptr);
+ }
+ $? "- dk4gratool_close"
+}
+
+
+
+int
+dk4gratool_points_for_circle(
+ dk4_gra_point_t *ptr,
+ size_t sz,
+ double r,
+ dk4_er_t *erp
+)
+{
+ double kr; /* Product of kappa and radius */
+ double krsq2; /* Product of kappa and radius divided by sqrt(2) */
+ int back = 0;
+ $? "+ dk4gratool_points_for_circle r=%g", r
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert((24 == sz) || (12 == sz));
+ assert(0.0 < r);
+#endif
+ if ((NULL == ptr) || ((24 != sz) && (12 != sz)) || (0.0 >= r)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ ptr[0].x = r;
+ ptr[0].y = 0.0;
+ if (24 == sz) {
+ kr = KAPPA_8 * r;
+ krsq2 = kr / M_SQRT2;
+ ptr[ 1].x = r;
+ ptr[ 1].y = kr;
+ ptr[ 3].x = r / M_SQRT2;
+ ptr[ 3].y = r / M_SQRT2;
+ ptr[ 2].x = ptr[3].x + krsq2;
+ ptr[ 2].y = ptr[3].y - krsq2;
+ ptr[ 4].x = ptr[3].x - krsq2;
+ ptr[ 4].y = ptr[3].y + krsq2;
+ ptr[ 5].x = kr;
+ ptr[ 5].y = r;
+ ptr[ 6].x = 0.0;
+ ptr[ 6].y = r;
+ ptr[ 7].x = 0.0 - kr;
+ ptr[ 7].y = r;
+ ptr[ 9].x = 0.0 - ptr[3].x;
+ ptr[ 9].y = ptr[3].y;
+ ptr[ 8].x = ptr[9].x + krsq2;
+ ptr[ 8].y = ptr[9].y + krsq2;
+ ptr[10].x = ptr[9].x - krsq2;
+ ptr[10].y = ptr[9].y - krsq2;
+ ptr[11].x = 0.0 - r;
+ ptr[11].y = kr;
+ ptr[12].x = 0.0 - r;
+ ptr[12].y = 0.0;
+ ptr[13].x = 0.0 - r;
+ ptr[13].y = 0.0 - kr;
+ ptr[15].x = ptr[9].x;
+ ptr[15].y = 0.0 - ptr[3].x;
+ ptr[14].x = ptr[15].x - krsq2;
+ ptr[14].y = ptr[15].y + krsq2;
+ ptr[16].x = ptr[15].x + krsq2;
+ ptr[16].y = ptr[15].y - krsq2;
+ ptr[17].x = 0.0 - kr;
+ ptr[17].y = 0.0 - r;
+ ptr[18].x = 0.0;
+ ptr[18].y = 0.0 - r;
+ ptr[19].x = kr;
+ ptr[19].y = 0.0 - r;
+ ptr[21].x = ptr[3].x;
+ ptr[21].y = 0.0 - ptr[3].y;
+ ptr[20].x = ptr[21].x - krsq2;
+ ptr[20].y = ptr[21].y - krsq2;
+ ptr[22].x = ptr[21].x + krsq2;
+ ptr[22].y = ptr[21].y + krsq2;
+ ptr[23].x = r;
+ ptr[23].y = 0.0 - kr;
+ }
+ else {
+ kr = KAPPA_4 * r;
+ ptr[ 1].x = r;
+ ptr[ 1].y = kr;
+ ptr[ 2].x = kr;
+ ptr[ 2].y = r;
+ ptr[ 3].x = 0.0;
+ ptr[ 3].y = r;
+ ptr[ 4].x = 0.0 - kr;
+ ptr[ 4].y = r;
+ ptr[ 5].x = 0.0 - r;
+ ptr[ 5].y = kr;
+ ptr[ 6].x = 0.0 - r;
+ ptr[ 6].y = 0.0;
+ ptr[ 7].x = 0.0 - r;
+ ptr[ 7].y = 0.0 - kr;
+ ptr[ 8].x = 0.0 - kr;
+ ptr[ 8].y = 0.0 - r;
+ ptr[ 9].x = 0.0;
+ ptr[ 9].y = 0.0 - r;
+ ptr[10].x = kr;
+ ptr[10].y = 0.0 - r;
+ ptr[11].x = r;
+ ptr[11].y = 0.0 - kr;
+ }
+ back = 1;
+
+ finished:
+ $? "- dk4gratool_points_for_circle %d", back
+ return back;
+}
+
+
+
+int
+dk4gratool_points_for_ellipse(
+ dk4_gra_point_t *ptr,
+ size_t sz,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double alpha,
+ dk4_er_t *erp
+)
+{
+ double coeff; /* Coefficient ry/rx */
+ size_t i; /* Index to traverse all points */
+ int back = 0; /* Result */
+
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert((24 == sz) || (12 == sz));
+ assert(0.0 < rx);
+ assert(0.0 < ry);
+#endif
+ /*
+ Check arguments
+ */
+ if (
+ (NULL == ptr) || ((24 != sz) && (12 != sz))
+ || (0.0 >= rx) || (0.0 >= ry)
+ ) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /*
+ Create circle data
+ */
+ back = dk4gratool_points_for_circle(ptr, sz, rx, erp);
+ if (0 == back) { goto finished; }
+ /*
+ Scale y values for radius ry
+ */
+ coeff = ry / rx;
+ for (i = 0; i < sz; i++) {
+ ptr[i].y *= coeff;
+ }
+ /* Rotate the points if necessary
+ */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(alpha)) {
+ for (i = 0; i < sz; i++) {
+ dk4gratool_rotate_point(&(ptr[i]), alpha);
+ }
+ }
+ /* Shift to specified center point
+ */
+ for (i = 0; i < sz; i++) {
+ ptr[i].x += xc;
+ ptr[i].y += yc;
+ }
+ /* Check all coordinates for finite values.
+ */
+ for (i = 0; i < sz; i++) {
+#if DK4_HAVE_ISFINITE
+ if ((!(isfinite(ptr[i].x))) || (!(isfinite(ptr[i].y)))) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+#else
+#if DK4_HAVE__FINITE
+ if ((!(_finite(ptr[i].x))) || (!(_finite(ptr[i].y)))) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+#else
+
+#endif
+#endif
+ }
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4gratool_rotate_point(dk4_gra_point_t *pt, double rot)
+{
+ double r; /* Point radius */
+ double a; /* Point angle */
+ $? "+ dk4gratool_rotate_point %g %g rot=%g", pt->x, pt->y, rot
+#if DK4_USE_ASSERT
+ assert(NULL != pt);
+#endif
+ r = sqrt(pt->x * pt->x + pt->y * pt->y);
+ a = atan2(pt->y, pt->x);
+ a += rot;
+ pt->x = r * cos(a);
+ pt->y = r * sin(a);
+ $? "- dk4gratool_rotate_point %g %g", pt->x, pt->y
+}
+
+
+
+void
+dk4gratool_initialize_attributes(
+ dk4gra_attributes_t *pattr
+)
+{
+ $? "+ dk4gratool_initialize_attributes"
+#if DK4_USE_ASSERT
+ assert(NULL != pattr);
+#endif
+ if (NULL != pattr) {
+ pattr->lc_active = -1;
+ pattr->lc_requested = DK4_GRA_LC_BUTTED;
+ pattr->lj_active = -1;
+ pattr->lj_requested = DK4_GRA_LJ_MITERED;
+ pattr->ls_active = -1;
+ pattr->ls_requested = DK4_GRA_LS_SOLID;
+ pattr->lw_active = -1.0;
+ pattr->lw_requested = 0.9;
+ pattr->sv_active = -1.0;
+ pattr->sv_requested = 4.0;
+ pattr->ml_active = 10.0;
+ pattr->ml_requested = 10.0;
+ pattr->eor_active = -1;
+ pattr->eor_requested = 0;
+ dk4mem_reset(&(pattr->col_stroke_active), sizeof(dk4gra_col_t), NULL);
+ pattr->col_stroke_active.what = DK4_GRA_COL_SPEC_NONE;
+ dk4mem_cpy(
+ &(pattr->col_fill_active), &(pattr->col_stroke_active),
+ sizeof(dk4gra_col_t), NULL
+ );
+ dk4mem_cpy(
+ &(pattr->col_stroke_requested), &(pattr->col_stroke_active),
+ sizeof(dk4gra_col_t), NULL
+ );
+ pattr->col_stroke_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ pattr->col_stroke_requested.data.gray = 0.0;
+ dk4mem_cpy(
+ &(pattr->col_fill_requested), &(pattr->col_stroke_requested),
+ sizeof(dk4gra_col_t), NULL
+ );
+
+ }
+ $? "- dk4gratool_initialize_attributes"
+}
+
+
+
+void
+dk4gratool_reset_active_attributes(
+ dk4gra_attributes_t *pattr
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pattr);
+#endif
+ pattr->col_stroke_active.what = DK4_GRA_COL_SPEC_NONE;
+ pattr->col_fill_active.what = DK4_GRA_COL_SPEC_NONE;
+ pattr->lw_active = -1.0;
+ pattr->sv_active = -1.0;
+ pattr->ml_active = -1.0;
+ pattr->lc_active = -1;
+ pattr->lj_active = -1;
+ pattr->ls_active = -1;
+ pattr->eor_active = -1;
+}
+
+
+
+void
+dk4gratool_set_color_requested(
+ dk4gra_col_t *pcol,
+ int colsp,
+ double c1,
+ double c2,
+ double c3,
+ double c4
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pcol);
+#endif
+ pcol->what = colsp;
+ switch (colsp) {
+ case DK4_GRA_COL_SPEC_CMYK : {
+ pcol->data.cmyk.c = c1;
+ pcol->data.cmyk.m = c2;
+ pcol->data.cmyk.y = c3;
+ pcol->data.cmyk.k = c4;
+ } break;
+ case DK4_GRA_COL_SPEC_RGB : {
+ pcol->data.rgb.r = c1;
+ pcol->data.rgb.g = c2;
+ pcol->data.rgb.b = c3;
+ } break;
+ case DK4_GRA_COL_SPEC_GRAY : {
+ pcol->data.gray = c1;
+ } break;
+ }
+}
+
+
+
+int
+dk4gratool_colors_differ(
+ dk4gra_col_t *p1,
+ dk4gra_col_t *p2
+)
+{
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != p1);
+ assert(NULL != p2);
+#endif
+ if (p1->what == p2->what) {
+ switch (p1->what) {
+ case DK4_GRA_COL_SPEC_CMYK : {
+ back = 0;
+ if (1.0e-3 < fabs(p1->data.cmyk.c - p2->data.cmyk.c)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.cmyk.m - p2->data.cmyk.m)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.cmyk.y - p2->data.cmyk.y)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.cmyk.k - p2->data.cmyk.k)) {
+ back = 1;
+ }
+ } break;
+ case DK4_GRA_COL_SPEC_RGB : {
+ back = 0;
+ if (1.0e-3 < fabs(p1->data.rgb.r - p2->data.rgb.r)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.rgb.g - p2->data.rgb.g)) {
+ back = 1;
+ }
+ if (1.0e-3 < fabs(p1->data.rgb.b - p2->data.rgb.b)) {
+ back = 1;
+ }
+ } break;
+ case DK4_GRA_COL_SPEC_GRAY : {
+ if (1.0e-3 >= fabs(p1->data.gray - p2->data.gray)) {
+ back = 0;
+ }
+ } break;
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4gratool_line_style_differs(
+ int ls_a,
+ int ls_r,
+ double sv_a,
+ double sv_r,
+ int lwc
+)
+{
+ int back = 1;
+ $? "+ dk4gratool_line_style_differs %d/%g %d/%g %d",ls_a,sv_a,ls_r,sv_r,lwc
+ if (ls_a == ls_r) {
+ back = 0;
+ if (DK4_GRA_LS_SOLID != ls_a) {
+ if (0 != lwc) {
+ back = 1;
+ }
+ else {
+ if (1.0e-3 < fabs(sv_a - sv_r)) {
+ back = 1;
+ }
+ }
+ }
+ }
+ $? "- dk4gratool_line_style_differs %d", back
+ return back;
+}
+
+
+
+int
+dk4gratool_calculate_transformations(
+ double *dst,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double w,
+ double h,
+ int kar,
+ int pos,
+ dk4_er_t *erp
+)
+{
+ double dx; /* Available X space */
+ double dy; /* Available Y space */
+ size_t i; /* Traverse transformation values */
+ int back = 0;
+ $? "+ dk4gratool_calculate_transformations"
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(xr > xl);
+ assert(yt > yb);
+ assert(0.0 < w);
+ assert(0.0 < h);
+#endif
+ if ((xr <= xl) || (yt <= yb) || (0.0 >= w) || (0.0 >= h)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ for (i = 0; i < 5; i++) { dst[i] = 0.0; }
+ dx = xr - xl;
+ dy = yt - yb;
+ switch (pos) {
+ case 1: {
+ dst[2] = 90.0;
+ if (0 != kar) {
+ if ((w * dx) > (h * dy)) { /* Y fully used, space in X */
+ dx = (h * dy) / w;
+ dst[0] = xr - (xr - xl - dx) / 2.0;
+ dst[1] = yb;
+ }
+ else { /* X fully used, space in Y */
+ dy = (w * dx) / h;
+ dst[0] = xr;
+ dst[1] = yb + (yt - yb - dy) / 2.0;
+ }
+ dst[3] = dy;
+ dst[4] = dx;
+ }
+ else {
+ dst[0] = xr;
+ dst[1] = yb;
+ dst[3] = yt - yb;
+ dst[4] = xr - xl;
+ }
+ } break;
+ case 2: {
+ dst[2] = 180.0;
+ if (0 != kar) {
+ if ((w * dy) > (h * dx)) { /* X fully used, space in Y */
+ dy = (h * dx) / w;
+ dst[0] = xr;
+ dst[1] = yt - (yt - yb - dy) / 2.0;
+ }
+ else {
+ dx = (w * dy) / h;
+ dst[0] = xr - (xr - xl - dx) / 2.0;
+ dst[1] = yt;
+ }
+ dst[3] = dx;
+ dst[4] = dy;
+ }
+ else {
+ dst[0] = xr;
+ dst[1] = yt;
+ dst[3] = xr - xl;
+ dst[4] = yt - yb;
+ }
+ } break;
+ case 3: {
+ dst[2] = 270.0;
+ if (0 != kar) {
+ if ((w * dx) > (h * dy)) { /* Y fully used, space in X */
+ dx = (h * dy) / w;
+ dst[0] = xl + (xr - xl - dx) / 2.0;
+ dst[1] = yt;
+ }
+ else { /* X fully used, space in Y */
+ dy = (w * dx) / h;
+ dst[0] = xl;
+ dst[1] = yt - (yt - yb - dy) / 2.0;
+ }
+ dst[3] = dy;
+ dst[4] = dx;
+ }
+ else {
+ dst[0] = xl;
+ dst[1] = yt;
+ dst[3] = yt - yb;
+ dst[4] = xr - xl;
+
+ }
+ } break;
+ case 4: {
+ dst[2] = 90.0;
+ if (0 != kar) {
+ if ((w * dx) > (h * dy)) { /* Y fully used, space in X */
+ dx = (h * dy) / w;
+ dst[0] = xr - (xr - xl - dx) / 2.0;
+ dst[1] = yt;
+ }
+ else { /* X fully used, space in Y */
+ dy = (w * dx) / h;
+ dst[0] = xr;
+ dst[1] = yt - (yt - yb - dy) / 2.0;
+ }
+ dst[3] = 0.0 - dy;
+ dst[4] = dx;
+ }
+ else {
+ dst[0] = xr;
+ dst[1] = yt;
+ dst[3] = yb - yt;
+ dst[4] = xr - xl;
+ }
+ } break;
+ case 5: {
+ if (0 != kar) {
+ if ((w * dy) > (h * dx)) { /* X fully used, space in Y */
+ dy = (h * dx) / w;
+ dst[0] = xr;
+ dst[1] = yb + (yt - yb - dy) / 2.0;
+ }
+ else { /* Y fully used, space in X */
+ dx = (w * dy) / h;
+ dst[0] = xr - (xr - xl - dx) / 2.0;
+ dst[1] = yb;
+ }
+ dst[3] = 0.0 - dx;
+ dst[4] = dy;
+
+ }
+ else {
+ dst[0] = xr;
+ dst[1] = yb;
+ dst[3] = xl - xr;
+ dst[4] = yt - yb;
+ }
+ } break;
+ case 6: {
+ dst[2] = 90.0;
+ if (0 != kar) {
+ if ((w * dx) > (h * dy)) { /* Y fully used, space in X */
+ dx = (h * dy) / w;
+ dst[0] = xl + (xr - xl - dx) / 2.0;
+ dst[1] = yb;
+ }
+ else { /* X fully used, space in Y */
+ dy = (w * dx) / h;
+ dst[0] = xl;
+ dst[1] = yb + (yt - yb - dy) / 2.0;
+ }
+ dst[3] = dy;
+ dst[4] = 0.0 - dx;
+ }
+ else {
+ dst[0] = xl;
+ dst[1] = yb;
+ dst[3] = yt - yb;
+ dst[4] = xl - xr;
+ }
+ } break;
+ case 7: {
+ if (0 != kar) {
+ if ((w * dy) > (h * dx)) { /* X fully used, space in Y */
+ dy = (h * dx) / w;
+ dst[0] = xl;
+ dst[1] = yt - (yt - yb - dy) / 2.0;
+ }
+ else { /* Y fully used, space in X */
+ dx = (w * dy) / h;
+ dst[0] = xl + (xr - xl - dx) / 2.0;
+ dst[1] = yt;
+ }
+ dst[3] = dx;
+ dst[4] = 0.0 - dy;
+
+ }
+ else {
+ dst[0] = xl;
+ dst[1] = yt;
+ dst[3] = xr - xl;
+ dst[4] = yb - yt;
+ }
+ } break;
+ default : { /* 0 */
+ if (0 != kar) {
+ if ((w * dy) > (h * dx)) { /* X fully used, space in Y */
+ dy = (h * dx) / w;
+ dst[0] = xl;
+ dst[1] = yb + (yt - yb - dy) / 2.0;
+ }
+ else { /* Y fully used, space in X */
+ dx = (w * dy) / h;
+ dst[0] = xl + (xr - xl - dx) / 2.0;
+ dst[1] = yb;
+ }
+ dst[3] = dx;
+ dst[4] = dy;
+ }
+ else {
+ dst[0] = xl;
+ dst[1] = yb;
+ dst[3] = (xr - xl);
+ dst[4] = (yt - yb);
+ }
+ } break;
+ }
+
+ back = 1;
+ for (i = 0; i < 5; i++) {
+#if DK4_HAVE_ISFINITE
+ if (!(isfinite(dst[i]))) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+#else
+#if DK4_HAVE__FINITE
+ if (!(_finite(dst[i]))) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+#endif
+#endif
+ }
+
+ finished:
+ $? "- dk4gratool_calculate_transformations %d", back
+ return back;
+}
+
+
+
+void
+dk4gratool_stream_string(
+ dk4_stream_t *os,
+ const char *str,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != str);
+#endif
+ if (0 == dk4stream_write_char_string(os, str, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+void
+dk4gratool_stream_double(
+ dk4_stream_t *os,
+ double val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ if (0 == dk4ma_write_c8_double_no_sci_to_stream(os,val,1.0e-8,0,1,erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+void
+dk4gratool_stream_uint(
+ dk4_stream_t *os,
+ dk4_um_t val,
+ size_t padsz,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ char buf[16*sizeof(dk4_um_t)]; /* Buffer for val as text */
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ if (0 != dk4ma_write_c8_decimal_unsigned(buf,sizeof(buf),val,padsz,erp)) {
+ dk4gratool_stream_string(os, buf, backptr, erp);
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+void
+dk4gratool_stream_num_alpha(
+ dk4_stream_t *os,
+ size_t val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t kwi; /* Index of number in alphabet */
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ do {
+ kwi = val % (size_t)26U;
+ val = val / (size_t)26U;
+ if (0 == dk4stream_write_byte(os, dk4gratool_alphabet[kwi], erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ } while (0 < val);
+}
+
+
+
+void
+dk4gratool_stream_color(
+ dk4_stream_t *os,
+ dk4gra_col_t const *col,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != col);
+#endif
+ switch (col->what) {
+ case DK4_GRA_COL_SPEC_CMYK : {
+ dk4gratool_stream_string(os, dk4gratool_kw[6], backptr, erp);
+ dk4gratool_stream_double(os, col->data.cmyk.c, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.cmyk.m, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.cmyk.y, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.cmyk.k, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[9], backptr, erp);
+ } break;
+ case DK4_GRA_COL_SPEC_GRAY : {
+ dk4gratool_stream_string(os, dk4gratool_kw[7], backptr, erp);
+ dk4gratool_stream_double(os, col->data.gray, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[9], backptr, erp);
+ } break;
+ default : { /* RGB */
+ dk4gratool_stream_string(os, dk4gratool_kw[8], backptr, erp);
+ dk4gratool_stream_double(os, col->data.rgb.r, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.rgb.g, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[10], backptr, erp);
+ dk4gratool_stream_double(os, col->data.rgb.b, backptr, erp);
+ dk4gratool_stream_string(os, dk4gratool_kw[9], backptr, erp);
+ } break;
+ }
+}
+
+
+
+double
+dk4gratool_kappa_for_angle(double alpha)
+{
+ double back;
+ $? "+ kappa_for_angle %g", alpha
+ alpha = fabs(alpha);
+ back = (2.0 * sqrt(8.0 * (1.0 - cos(alpha))) - 4.0 * sin(alpha))
+ / (3.0 * alpha * (1.0 - cos(alpha)));
+ $? "- kappa_for_angle %g", back
+ return back;
+}
+
+
+
+dk4_px_t
+dk4gratool_bit(
+ size_t i
+)
+{
+ return (dk4gratool_bit_values[i]);
+}
+
+
+
+void
+dk4gratool_put_pixel_value(
+ dk4_stream_t *strm,
+ dk4_bit_shift_t *bs,
+ dk4_px_t pixval,
+ dk4_px_bit_depth_t bpc,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ int res;
+ dk4_px_bit_depth_t i;
+ $? "+ dk4gratool_put_pixel_value %u", (unsigned)pixval
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != bs);
+#endif
+ for (i = 0; i < bpc; i++) {
+ res = dk4bit_shift_add(
+ bs,
+ ((0 != (pixval & (dk4gratool_bit(bpc-1-i)))) ? (1) : (0)),
+ NULL
+ );
+ if (DK4_EDSTM_FINISHED == res) {
+ res = dk4stream_write_byte(
+ strm, dk4bit_shift_output(bs, NULL), erp
+ );
+ if (0 == res) { $? "! dk4stream_write_byte"
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ }
+ $? "- dk4gratool_put_pixel_value"
+}
+
+
+
+/** Write paragraph of text to output.
+ @param ostrm Output stream.
+ @param strar String array.
+ @param bptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gratool_paragraph_to_stream(
+ dk4_stream_t *ostrm,
+ const char * const *strar,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != strar);
+#endif
+ if ((NULL != ostrm) && (NULL != strar)) {
+ while (NULL != *strar) {
+ dk4gratool_stream_string(ostrm, *(strar++), bptr, erp);
+ }
+ }
+}
+
+
+
+void
+dk4gratool_start_standalone_document(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ int pgf,
+ double dfs,
+ dk4_sto_t *s_f,
+ dk4_sto_it_t *i_f,
+ dk4_sto_t *s_p,
+ dk4_sto_it_t *i_p,
+ dk4_sto_t *s_o,
+ dk4_sto_it_t *i_o,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_preamble_line_t *pl;
+ int res;
+ $? "+ dk4gratool_start_standalone_document"
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != gra);
+ assert(0.0 < dfs);
+#endif
+ /*
+ Document class
+ */
+ $? ". dfs = %lg", dfs
+ if (0.0 < dfs) {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[34], bptr, erp);
+ res = dk4ma_write_c8_double_no_sci_to_stream(
+ ostrm, dfs, 1.0e-1, 0, 0, erp
+ );
+ if (0 == res) { if (NULL != bptr) { *bptr = 0; } }
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[35], bptr, erp);
+ }
+ else {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[33], bptr, erp);
+ }
+ /*
+ Font setup
+ */
+ if ((NULL != s_f) && (NULL != i_f)) {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[36], bptr, erp);
+ dk4sto_it_reset(i_f);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(i_f);
+ if (NULL != pl) {
+ dk4gratool_stream_string(ostrm, pl->text, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[0], bptr, erp);
+ }
+ } while (NULL != pl);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[37], bptr, erp);
+ }
+ else {
+ dk4gratool_paragraph_to_stream(ostrm, dk4gratool_text1, bptr, erp);
+ }
+ /*
+ Additional packages
+ */
+ if ((NULL != s_p) && (NULL != i_p)) {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[38], bptr, erp);
+ dk4sto_it_reset(i_p);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(i_p);
+ if (NULL != pl) {
+ dk4gratool_stream_string(ostrm, pl->text, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[0], bptr, erp);
+ }
+ } while (NULL != pl);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[39], bptr, erp);
+ }
+ else {
+ dk4gratool_paragraph_to_stream(ostrm, dk4gratool_text3, bptr, erp);
+ }
+ dk4gratool_paragraph_to_stream(ostrm, dk4gratool_text4, bptr, erp);
+ /*
+ /setlength{/paperwidth{xxxbp}
+ */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[1], bptr, erp);
+ dk4gratool_stream_uint(ostrm, gra->w, 0, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[3], bptr, erp);
+ /*
+ /setlength{/paperheight{xxxbp}
+ */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[2], bptr, erp);
+ dk4gratool_stream_uint(ostrm, gra->h, 0, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[3], bptr, erp);
+ /*
+ /usepackage{pgfcore}
+ */
+ if (0 != pgf) {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[5], bptr, erp);
+ }
+ /*
+ Instructions for setup
+ */
+ dk4gratool_paragraph_to_stream(ostrm, dk4gratool_text2, bptr, erp);
+ /*
+ Additional other setup lines
+ */
+ if ((NULL != s_o) && (NULL != i_o)) {
+ dk4sto_it_reset(i_o);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(i_o);
+ if (NULL != pl) {
+ dk4gratool_stream_string(ostrm, pl->text, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[0], bptr, erp);
+ }
+ } while (NULL != pl);
+ }
+ /*
+ /begin{document}
+ */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[32], bptr, erp);
+ $? "- dk4gratool_start_standalone_document"
+}
+
+
+
+void
+dk4gratool_end_standalone_document(
+ dk4_stream_t *ostrm,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+#endif
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[4], bptr, erp);
+}
+
+
+
+/** Write definition for one font from collector to output stream.
+ @param ostrm Output stream.
+ @param foi Font item to write.
+ @param bptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gratool_font_one_definition(
+ dk4_stream_t *ostrm,
+ dk4_font_item_t const *foi,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+ const char *lfn = NULL; /* LaTeX font name */
+ int ffl = 0; /* Font number or font features */
+ int ff = 0; /* Font features mask */
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != foi);
+#endif
+ if (DK4_GRA_TF_EXACT_SIZE == foi->fex) {
+ lfn = dk4font_get_latex_font_name(dk4font_number_from_int(foi->fno));
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[11], bptr, erp);
+ dk4gratool_stream_num_alpha(ostrm, foi->nf, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[12], bptr, erp);
+ dk4gratool_stream_string(ostrm, lfn, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[14], bptr, erp);
+ dk4gratool_stream_double(ostrm, foi->fsz, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[13], bptr, erp);
+ }
+ else {
+ /* providecommand */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[15], bptr, erp);
+ dk4gratool_stream_num_alpha(ostrm, foi->nf, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[16], bptr, erp);
+ /* renewcommand */
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[17], bptr, erp);
+ dk4gratool_stream_num_alpha(ostrm, foi->nf, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[18], bptr, erp);
+ /* Font size */
+ switch (foi->fex) {
+ case DK4_GRA_TF_SIMILAR_SIZE : case DK4_GRA_TF_NONE_SIZE : {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[29], bptr, erp);
+ dk4gratool_stream_double(ostrm, foi->fsz, bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[30], bptr, erp);
+ dk4gratool_stream_double(ostrm, (1.2 * foi->fsz), bptr, erp);
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[31], bptr, erp);
+ } break;
+ default : {
+ /* Intentionally empty to avoid compiler warnings. */
+ } break;
+ }
+ /* Font family, series and shape */
+ switch (foi->fex) {
+ case DK4_GRA_TF_EXACT_NONE :
+ case DK4_GRA_TF_SIMILAR_SIZE :
+ case DK4_GRA_TF_SIMILAR_NONE : {
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[20], bptr, erp);
+ if (DK4_GRA_TF_EXACT_NONE == foi->fex) {
+ dk4gratool_stream_string(
+ ostrm,
+ dk4font_get_latex_family_name(
+ dk4font_number_from_int(foi->fno)
+ ),
+ bptr,
+ erp
+ );
+ }
+ else {
+ switch (DK4_FONT_FEATURE_FT_MASK & (foi->fno)) {
+ case DK4_FONT_FEATURE_SYMBOL : {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[24], bptr, erp
+ );
+ } break;
+ case DK4_FONT_FEATURE_TTY : {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[22], bptr, erp
+ );
+ } break;
+ case DK4_FONT_FEATURE_SANS_SERIF : {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[23], bptr, erp
+ );
+ } break;
+ default : { /* roman */
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[24], bptr, erp
+ );
+ } break;
+ }
+ /* 2019-05-14 Bugfix
+ To find the type we must and-combine the font
+ features with the mask bit as above.
+ */
+#if 0
+ if (0 != (DK4_FONT_FEATURE_TTY & (foi->fno))) {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[22], bptr, erp
+ );
+ }
+ else {
+ if (0 != (DK4_FONT_FEATURE_SANS_SERIF & (foi->fno))) {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[23], bptr, erp
+ );
+ }
+ else {
+ dk4gratool_stream_string(
+ ostrm, dk4gratool_kw[24], bptr, erp
+ );
+ }
+ }
+#endif
+ }
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[21], bptr, erp);
+ ffl = foi->fno;
+ if (DK4_GRA_TF_EXACT_NONE == foi->fex) {
+ ffl = dk4font_get_features(
+ dk4font_number_from_int(foi->fno)
+ );
+ }
+ if (0 != (DK4_FONT_FEATURE_BOLD & ffl)) {
+ dk4gratool_stream_string(ostrm,dk4gratool_kw[25],bptr,erp);
+ }
+ else {
+ dk4gratool_stream_string(ostrm,dk4gratool_kw[26],bptr,erp);
+ }
+ ff = DK4_FONT_FEATURE_ITALIC | DK4_FONT_FEATURE_OBLIQUE;
+ if (0 != (ff & ffl)) {
+ dk4gratool_stream_string(ostrm,dk4gratool_kw[27],bptr,erp);
+ }
+ else {
+ dk4gratool_stream_string(ostrm,dk4gratool_kw[28],bptr,erp);
+ }
+ } break;
+ default : {
+ /* Intentionally empty to avoid compiler warnings. */
+ } break;
+ }
+ dk4gratool_stream_string(ostrm, dk4gratool_kw[19], bptr, erp);
+ }
+}
+
+
+
+void
+dk4gratool_font_definitions(
+ dk4_stream_t *ostrm,
+ dk4_font_collector_t *fontc,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+ dk4_font_item_t *foi; /* Current font item to write */
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != fontc);
+#endif
+ dk4sto_it_reset(fontc->i_fn);
+ do {
+ foi = (dk4_font_item_t *)dk4sto_it_next(fontc->i_fn);
+ if (NULL != foi) {
+ dk4gratool_font_one_definition(ostrm, foi, bptr, erp);
+ }
+ } while (NULL != foi);
+}
+
+
+
+int
+dk4gratool_compare_preamble_lines(
+ void const *l,
+ void const *r,
+ int DK4_ARG_UNUSED(cr)
+)
+{
+ dk4_gra_preamble_line_t const *pl;
+ dk4_gra_preamble_line_t const *pr;
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (dk4_gra_preamble_line_t const *)l;
+ pr = (dk4_gra_preamble_line_t const *)r;
+ if (pl->lineno > pr->lineno) {
+ back = 1;
+ }
+ else {
+ if (pl->lineno < pr->lineno) {
+ back = -1;
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+void
+dk4gratool_preamble_delete(
+ dk4_gra_preamble_line_t *ptr
+)
+{
+ $? "+ dk4gratool_preamble_delete"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
+ if (NULL != ptr) { $? ". ptr"
+ if (NULL != ptr->text) { $? ". text = \"%!8s\"", ptr->text
+ dk4mem_free(ptr->text);
+ }
+ dk4mem_free(ptr);
+ }
+ $? "- dk4gratool_preamble_delete"
+}
+
+
+
+dk4_gra_preamble_line_t *
+dk4gratool_preamble_new(
+ char const *textline,
+ size_t lineno,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_preamble_line_t *back = NULL;
+ $? "+ dk4gratool_preamble_new"
+#if DK4_USE_ASSERT
+ assert(NULL != textline);
+#endif
+ if (NULL != textline) { $? ". args ok"
+ back = dk4mem_new(dk4_gra_preamble_line_t,1,erp);
+ if (NULL != back) { $? ". allocation ok"
+ back->lineno = lineno;
+ back->text = dk4str8_dup(textline, erp);
+ if (NULL == back->text) { $? "! text allocation"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! allocation"
+ }
+#endif
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4gratool_preamble_new %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+double
+dk4gratool_dist_point_point(
+ dk4_gra_point_t const *a,
+ dk4_gra_point_t const *b,
+ dk4_er_t *erp
+)
+{
+ double back = -1;
+ double dx;
+ double dy;
+#if DK4_USE_ASSERT
+ assert(NULL != a);
+ assert(NULL != b);
+#endif
+ if ((NULL != a) && (NULL != b)) {
+ dx = b->x - a->x;
+ dy = b->y - a->y;
+ back = sqrt(dx * dx + dy * dy);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+/** Calculate square value.
+ @param x Original value.
+ @return Square value.
+*/
+
+static
+double
+dbl_sq(double x)
+{
+ return (x * x);
+}
+
+
+double
+dk4gratool_dist_point_track(
+ dk4_gra_point_t const *a,
+ dk4_gra_point_t const *b,
+ dk4_gra_point_t const *p,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t q;
+ double back = -1.0;
+ double z;
+ double n;
+ double t;
+#if DK4_USE_ASSERT
+ assert(NULL != a);
+ assert(NULL != b);
+ assert(NULL != p);
+#endif
+ if ((NULL != a) && (NULL != b) && (NULL != p)) {
+ z = (b->y - a->y) * p->y - a->y * b->y + dbl_sq(a->y);
+ z += (b->x - a->x) * p->x - a->x * b->x + dbl_sq(a->x);
+ n = dbl_sq(b->y) - 2.0 * a->y * b->y + dbl_sq(a->y);
+ n += dbl_sq(b->x) - 2.0 * a->x * b->x + dbl_sq(a->x);
+ t = z / n;
+ if ((0 != dk4ma_is_finite(t)) && (0.0 <= t) && (1.0 >= t)) {
+ q.x = a->x + t * (b->x - a->x);
+ q.y = a->y + t * (b->y - a->y);
+ back = dk4gratool_dist_point_point(&q, p, erp);
+ }
+ else {
+ z = dk4gratool_dist_point_point(a, p, erp);
+ n = dk4gratool_dist_point_point(b, p, erp);
+ back = ((z <= n) ? (z) : (n));
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+double
+dk4gratool_dist_point_ellipse_simple(
+ double rx,
+ double ry,
+ dk4_gra_point_t const *p
+)
+{
+ double px;
+ double back = -1.0;
+ $? "+ dk4gratool_dist_point_ellipse_simple"
+#if DK4_USE_ASSERT
+ assert(NULL != p);
+ assert(0.0 < rx);
+ assert(0.0 < ry);
+#endif
+ px = (ry * p->x) / rx; $? ". px = %g", px
+ back = sqrt((px * px) + (p->y * p->y)); $? ". r = %g", back
+ back = fabs(back - ry); $? ". r = %g", back
+ back = (back * rx) / ry; $? ". r = %g", back
+ $? "- dk4gratool_dist_point_ellipse_simple %g", back
+ return back;
+}
+
+
+
+double
+dk4gratool_dist_point_ellipse(
+ dk4_gra_point_t const *c,
+ double rx,
+ double ry,
+ double rot,
+ dk4_gra_point_t const *p,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t myp;
+ double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != c);
+ assert(NULL != p);
+ assert(0.0 < rx);
+ assert(0.0 < ry);
+#endif
+ if ((NULL != c) && (NULL != p) && (0.0 < rx) && (0.0 < ry)) {
+ DK4_MEMCPY(&myp,p,sizeof(dk4_gra_point_t));
+ myp.x -= c->x;
+ myp.y -= c->y;
+ if (1.0e-8 <= fabs(rot)) {
+ dk4gratool_rotate_point(&myp, (0.0 - rot));
+ }
+ back = dk4gratool_dist_point_ellipse_simple(rx, ry, &myp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grat.h b/support/dktools/dk4grat.h
new file mode 100644
index 0000000000..7147ef62f1
--- /dev/null
+++ b/support/dktools/dk4grat.h
@@ -0,0 +1,179 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grat.ctr
+*/
+
+/** @file dk4grat.h Header file for the dk4grat module.
+*/
+
+#ifndef DK4GRAT_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4GRAT_H_INCLUDED 1
+
+
+#line 8 "dk4grat.ctr"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Calculate kappa value for angle to use instead of 1/3 for Bezier curves.
+ @param alpha Arc angle.
+ @return Kappa value.
+*/
+double
+dk4gratool_kappa_for_angle(double alpha);
+
+/** Initialize points to draw a circle.
+ @param ptr Address of result array of points.
+ @param sz Number of elements in array (12 or 24).
+ @param r Radius.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if ptr is NULL, r is negative or the number of points
+ is neither 12 nor 24.
+*/
+int
+dk4gratool_points_for_circle(
+ dk4_gra_point_t *ptr,
+ size_t sz,
+ double r,
+ dk4_er_t *erp
+);
+
+/** Initialize points to draw an ellipse.
+ @param ptr Address of result array of points.
+ @param sz Number of elements in array (12 or 24).
+ @param xc Center point x.
+ @param yc Center point y.
+ @param rx X radius.
+ @param ry Y radius.
+ @param alpha Rotation counterclockwise in radians.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if ptr is NULL, r is negative or the number of points
+ is neither 12 nor 24.
+*/
+int
+dk4gratool_points_for_ellipse(
+ dk4_gra_point_t *ptr,
+ size_t sz,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double alpha,
+ dk4_er_t *erp
+);
+
+
+/** Rotate a point relatively to origin.
+ @param pt Point whose coordinates must be changed (in/out),
+ must not be NULL (not checked in function).
+ @param rot Rotation counterclockwise in radians.
+*/
+
+void
+dk4gratool_rotate_point(
+ dk4_gra_point_t *pt,
+ double rot
+);
+
+
+/** Calculate distance between two points.
+ @param a Point A.
+ @param b Point B.
+ @param erp Error report, may be NULL.
+ @return Distance between the points.
+*/
+
+double
+dk4gratool_dist_point_point(
+ dk4_gra_point_t const *a,
+ dk4_gra_point_t const *b,
+ dk4_er_t *erp
+);
+
+
+/** Calculate distance between a track specified by points
+ A and B and an external point P.
+ @param a Track endpoint A.
+ @param b Track endpoint B.
+ @param p External point P.
+ @param erp Error report, may be NULL.
+ @return Distance from point P to track specified by endpoint A, B.
+*/
+
+double
+dk4gratool_dist_point_track(
+ dk4_gra_point_t const *a,
+ dk4_gra_point_t const *b,
+ dk4_gra_point_t const *p,
+ dk4_er_t *erp
+);
+
+
+/** Calculate distance between a simple ellipse (in origin, not rotated)
+ and a point.
+ This is a poor approximation working best if rx and ry do not
+ differ too much.
+ @param rx Ellipse x radius.
+ @param ry Ellipse y radius.
+ @param p Point.
+ @return Non-negative value on success, negative value on error.
+*/
+
+double
+dk4gratool_dist_point_ellipse_simple(
+ double rx,
+ double ry,
+ dk4_gra_point_t const *p
+);
+
+
+/** Calculate distance between a rotated ellipse and a point.
+ This is a poor approximation working best if rx and ry do not
+ differ too much.
+ @param c Ellipse center point.
+ @param rx Ellipse x radius.
+ @param ry Ellipse y radius.
+ @param rot Ellipse rotation.
+ @param p Point to calculate distance to.
+ @param erp Error report, may be NULL.
+ @return Distance value.
+*/
+
+double
+dk4gratool_dist_point_ellipse(
+ dk4_gra_point_t const *c,
+ double rx,
+ double ry,
+ double rot,
+ dk4_gra_point_t const *p,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4grco.c b/support/dktools/dk4grco.c
new file mode 100644
index 0000000000..3ae36b8929
--- /dev/null
+++ b/support/dktools/dk4grco.c
@@ -0,0 +1,180 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grco.ctr
+*/
+
+/** @file dk4grco.c The dk4grco module.
+*/
+
+
+#line 164 "dk4grco.ctr"
+
+#include "dk4conf.h"
+
+#ifndef DK4GRCO_H_INCLUDED
+#include "dk4grco.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+
+#line 185 "dk4grco.ctr"
+
+
+
+void
+dk4gra_conf_init(
+ dk4_gra_conf_t *conf
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ if (NULL != conf) {
+ conf->media.name = NULL;
+ conf->media.w = 595.0;
+ conf->media.h = 842.0;
+ conf->media.i = 56.0;
+ conf->media.o = 28.0;
+ conf->media.b = 14.0;
+ conf->media.t = 14.0;
+ dk4cs_context_init(&(conf->ctx), NULL);
+ conf->xres = -1.0; /* Not specified */
+ conf->yres = -1.0; /* Not specified */
+ conf->xslp = 1.0e-3;
+ conf->xspp = 4.0e-3;
+ conf->psi = 0;
+ conf->xsss = 8U;
+ conf->driver = DK4_GRA_DRIVER_PDF;
+ conf->purpose = DK4_GRA_PURPOSE_OBJECT;
+ conf->color = 1;
+ conf->ps_level = 3;
+ conf->ps_lzw = 0;
+ conf->ps_dsc = 0;
+ conf->img_bg_r = 255;
+ conf->img_bg_g = 255;
+ conf->img_bg_b = 255;
+ conf->img_bg_f = 0;
+ conf->img_dct = 1;
+ conf->img_int = 1;
+ conf->img_dct_int = 0;
+ conf->img_an_bpc = 1;
+ conf->img_an_color = 1;
+ conf->img_an_alpha = 1;
+ conf->img_rot = 0;
+ conf->img_ign_res = 0;
+ conf->img_ign_asp = 0;
+ conf->use_media = 0;
+ conf->doc_duplex = 1;
+ conf->doc_tumble = 0;
+ conf->have_psi = 0;
+ }
+}
+
+
+
+int
+dk4gra_conf_flags_document(
+ dk4_gra_conf_t const *conf
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ if (NULL != conf) {
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ back |= DK4_GRA_DOC_FLAG_EPS;
+ }
+ if (0 == conf->color) {
+ back |= DK4_GRA_DOC_FLAG_FORCE_GRAY;
+ }
+ if (2 == conf->ps_level) {
+ back |= DK4_GRA_DOC_FLAG_PS2;
+ }
+ if (0 != conf->ps_dsc) {
+ back |= DK4_GRA_DOC_FLAG_PS_DSC;
+ }
+ if (0 != conf->doc_tumble) {
+ back |= DK4_GRA_DOC_FLAG_TUMBLE;
+ }
+ else {
+ if (0 != conf->doc_duplex) {
+ back |= DK4_GRA_DOC_FLAG_DUPLEX;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4gra_conf_flags_image(
+ dk4_gra_conf_t const *conf
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ if (NULL != conf) {
+ if (0 != conf->color) {
+ back |= DK4_GRA_IMG_FLAG_COLOR;
+ }
+ if (0 != conf->ps_lzw) {
+ back |= DK4_GRA_IMG_FLAG_LZW;
+ }
+ if (0 != conf->img_dct) {
+ back |= DK4_GRA_IMG_FLAG_DCT;
+ }
+ if (0 != conf->img_int) {
+ back |= DK4_GRA_IMG_FLAG_INTERPOLATION;
+ }
+ if (0 != conf->img_dct_int) {
+ back |= DK4_GRA_IMG_FLAG_DCT_INTERPOLATION;
+ }
+ if (0 != conf->img_an_bpc) {
+ back |= DK4_GRA_IMG_FLAG_ANALYZE_BPC;
+ }
+ if (0 != conf->img_an_color) {
+ back |= DK4_GRA_IMG_FLAG_ANALYZE_COLOR;
+ }
+ if (0 != conf->img_an_alpha) {
+ back |= DK4_GRA_IMG_FLAG_ANALYZE_ALPHA;
+ }
+ if (0 != conf->img_rot) {
+ back |= DK4_GRA_IMG_FLAG_ALLOW_ROTATION;
+ }
+ if (0 != conf->img_ign_res) {
+ back |= DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION;
+ }
+ if (0 != conf->img_ign_asp) {
+ back |= DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO;
+ }
+ }
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grco.ctr b/support/dktools/dk4grco.ctr
new file mode 100644
index 0000000000..e0aec1dc30
--- /dev/null
+++ b/support/dktools/dk4grco.ctr
@@ -0,0 +1,323 @@
+%% options
+
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4grco.h Graphics configuration.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4PAPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4paper.h"
+#else
+#include <dktools-4/dk4paper.h>
+#endif
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4cs.h"
+#else
+#include <dktools-4/dk4cs.h>
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4gra.h"
+#else
+#include <dktools-4/dk4gra.h>
+#endif
+#endif
+
+/** Scopes for configuration entries
+*/
+enum {
+ /** Base setup like choosing a driver,
+ PS language level.
+ */
+ DK4_GRA_CONF_SCOPE_SETUP = 0x0001 ,
+
+ /** Setup tasks related to bitmap images.
+ */
+ DK4_GRA_CONF_SCOPE_IMAGE = 0x0002 ,
+
+ /** Setup tasks related to drawing operations.
+ */
+ DK4_GRA_CONF_SCOPE_DRAW = 0x0004 ,
+
+ /** Setup tasks related to text typesetting.
+ */
+ DK4_GRA_CONF_SCOPE_TEXT = 0x0008 ,
+
+ /* ----- Combinations for some programs ----- */
+
+ /** The bmpp program only uses base
+ setup and bitmap image setup.
+ */
+ DK4_GRA_CONF_SCOPE_BMPP = (
+ DK4_GRA_CONF_SCOPE_SETUP
+ | DK4_GRA_CONF_SCOPE_IMAGE
+ ) ,
+
+ /** The fig2lat program uses all setup
+ features.
+ */
+ DK4_GRA_CONF_SCOPE_FIG2LAT = (
+ DK4_GRA_CONF_SCOPE_BMPP
+ | DK4_GRA_CONF_SCOPE_DRAW
+ | DK4_GRA_CONF_SCOPE_TEXT
+ )
+
+};
+
+/** Graphics configuration.
+*/
+typedef struct {
+ dk4_paper_size_t media; /**< Paper size to use. */
+ dk4_cs_conv_ctx_t ctx; /**< Color space conversion context. */
+ double xres; /**< X resolution. */
+ double yres; /**< Y resolution. */
+ double xslp; /**< X-spline length precision. */
+ double xspp; /**< X-spline parameter precision. */
+ size_t psi; /**< Paper size index in collection. */
+ unsigned xsss; /**< X-spline sub segments. */
+ int driver; /**< Graphics output driver. */
+ int purpose; /**< Intended output purpose. */
+ int color; /**< Flag: Colored output. */
+ int ps_level; /**< PS level, 2 or 3. */
+ int ps_lzw; /**< Flag: Allow LZW. */
+ int ps_dsc; /**< Flag: Write DSC comments. */
+ int img_bg_r; /**< Image background red. */
+ int img_bg_g; /**< Image background green. */
+ int img_bg_b; /**< Image background blue. */
+ int img_bg_f; /**< Flag: Force specified bg. */
+ int img_dct; /**< Flag: Directly use DCT data. */
+ int img_int; /**< Flag: Use image interpolation. */
+ int img_dct_int; /**< Flag: Interpolation for DCT. */
+ int img_an_bpc; /**< Flag: Analyse bits per sample. */
+ int img_an_color; /**< Flag: Analyse color usage. */
+ int img_an_alpha; /**< Flag: Analyse alpha channel use. */
+ int img_rot; /**< Flag: Allow rotation. */
+ int img_ign_res; /**< Flag: Ignore resolution chunk. */
+ int img_ign_asp; /**< Flag: Ignore aspect ratio. */
+ int use_media; /**< Flag: Fit to paper size. */
+ int doc_duplex; /**< Flag: Use duplex printing. */
+ int doc_tumble; /**< Flag: Use duplex and tumble. */
+ int have_psi; /**< Flag: Have psi number. */
+} dk4_gra_conf_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Initialize configuration structure.
+ @param conf Configuration structure to initialize.
+*/
+void
+dk4gra_conf_init(
+ dk4_gra_conf_t *conf
+);
+
+
+/** Retrieve flags for applying an image from the configuration.
+ @param conf Configuration structure to obtain values from.
+ @return Or-combined set of flags.
+*/
+int
+dk4gra_conf_flags_image(
+ dk4_gra_conf_t const *conf
+);
+
+
+/** Retrieve document flags for opening a graphics output structure
+ from the configuration.
+ @param conf Configuration structure to obtain values from.
+ @return Or-combined set of flags.
+*/
+int
+dk4gra_conf_flags_document(
+ dk4_gra_conf_t const *conf
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+%% module
+
+#include "dk4conf.h"
+
+#ifndef DK4GRCO_H_INCLUDED
+#include "dk4grco.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+$!trace-include
+
+
+
+void
+dk4gra_conf_init(
+ dk4_gra_conf_t *conf
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ if (NULL != conf) {
+ conf->media.name = NULL;
+ conf->media.w = 595.0;
+ conf->media.h = 842.0;
+ conf->media.i = 56.0;
+ conf->media.o = 28.0;
+ conf->media.b = 14.0;
+ conf->media.t = 14.0;
+ dk4cs_context_init(&(conf->ctx), NULL);
+ conf->xres = -1.0; /* Not specified */
+ conf->yres = -1.0; /* Not specified */
+ conf->xslp = 1.0e-3;
+ conf->xspp = 4.0e-3;
+ conf->psi = 0;
+ conf->xsss = 8U;
+ conf->driver = DK4_GRA_DRIVER_PDF;
+ conf->purpose = DK4_GRA_PURPOSE_OBJECT;
+ conf->color = 1;
+ conf->ps_level = 3;
+ conf->ps_lzw = 0;
+ conf->ps_dsc = 0;
+ conf->img_bg_r = 255;
+ conf->img_bg_g = 255;
+ conf->img_bg_b = 255;
+ conf->img_bg_f = 0;
+ conf->img_dct = 1;
+ conf->img_int = 1;
+ conf->img_dct_int = 0;
+ conf->img_an_bpc = 1;
+ conf->img_an_color = 1;
+ conf->img_an_alpha = 1;
+ conf->img_rot = 0;
+ conf->img_ign_res = 0;
+ conf->img_ign_asp = 0;
+ conf->use_media = 0;
+ conf->doc_duplex = 1;
+ conf->doc_tumble = 0;
+ conf->have_psi = 0;
+ }
+}
+
+
+
+int
+dk4gra_conf_flags_document(
+ dk4_gra_conf_t const *conf
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ if (NULL != conf) {
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ back |= DK4_GRA_DOC_FLAG_EPS;
+ }
+ if (0 == conf->color) {
+ back |= DK4_GRA_DOC_FLAG_FORCE_GRAY;
+ }
+ if (2 == conf->ps_level) {
+ back |= DK4_GRA_DOC_FLAG_PS2;
+ }
+ if (0 != conf->ps_dsc) {
+ back |= DK4_GRA_DOC_FLAG_PS_DSC;
+ }
+ if (0 != conf->doc_tumble) {
+ back |= DK4_GRA_DOC_FLAG_TUMBLE;
+ }
+ else {
+ if (0 != conf->doc_duplex) {
+ back |= DK4_GRA_DOC_FLAG_DUPLEX;
+ }
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4gra_conf_flags_image(
+ dk4_gra_conf_t const *conf
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ if (NULL != conf) {
+ if (0 != conf->color) {
+ back |= DK4_GRA_IMG_FLAG_COLOR;
+ }
+ if (0 != conf->ps_lzw) {
+ back |= DK4_GRA_IMG_FLAG_LZW;
+ }
+ if (0 != conf->img_dct) {
+ back |= DK4_GRA_IMG_FLAG_DCT;
+ }
+ if (0 != conf->img_int) {
+ back |= DK4_GRA_IMG_FLAG_INTERPOLATION;
+ }
+ if (0 != conf->img_dct_int) {
+ back |= DK4_GRA_IMG_FLAG_DCT_INTERPOLATION;
+ }
+ if (0 != conf->img_an_bpc) {
+ back |= DK4_GRA_IMG_FLAG_ANALYZE_BPC;
+ }
+ if (0 != conf->img_an_color) {
+ back |= DK4_GRA_IMG_FLAG_ANALYZE_COLOR;
+ }
+ if (0 != conf->img_an_alpha) {
+ back |= DK4_GRA_IMG_FLAG_ANALYZE_ALPHA;
+ }
+ if (0 != conf->img_rot) {
+ back |= DK4_GRA_IMG_FLAG_ALLOW_ROTATION;
+ }
+ if (0 != conf->img_ign_res) {
+ back |= DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION;
+ }
+ if (0 != conf->img_ign_asp) {
+ back |= DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO;
+ }
+ }
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grco.h b/support/dktools/dk4grco.h
new file mode 100644
index 0000000000..8913e331dc
--- /dev/null
+++ b/support/dktools/dk4grco.h
@@ -0,0 +1,174 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grco.ctr
+*/
+
+#ifndef DK4GRCO_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4GRCO_H_INCLUDED 1
+
+
+#line 10 "dk4grco.ctr"
+
+/** @file dk4grco.h Graphics configuration.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4PAPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4paper.h"
+#else
+#include <dktools-4/dk4paper.h>
+#endif
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4cs.h"
+#else
+#include <dktools-4/dk4cs.h>
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4gra.h"
+#else
+#include <dktools-4/dk4gra.h>
+#endif
+#endif
+
+/** Scopes for configuration entries
+*/
+enum {
+ /** Base setup like choosing a driver,
+ PS language level.
+ */
+ DK4_GRA_CONF_SCOPE_SETUP = 0x0001 ,
+
+ /** Setup tasks related to bitmap images.
+ */
+ DK4_GRA_CONF_SCOPE_IMAGE = 0x0002 ,
+
+ /** Setup tasks related to drawing operations.
+ */
+ DK4_GRA_CONF_SCOPE_DRAW = 0x0004 ,
+
+ /** Setup tasks related to text typesetting.
+ */
+ DK4_GRA_CONF_SCOPE_TEXT = 0x0008 ,
+
+ /* ----- Combinations for some programs ----- */
+
+ /** The bmpp program only uses base
+ setup and bitmap image setup.
+ */
+ DK4_GRA_CONF_SCOPE_BMPP = (
+ DK4_GRA_CONF_SCOPE_SETUP
+ | DK4_GRA_CONF_SCOPE_IMAGE
+ ) ,
+
+ /** The fig2lat program uses all setup
+ features.
+ */
+ DK4_GRA_CONF_SCOPE_FIG2LAT = (
+ DK4_GRA_CONF_SCOPE_BMPP
+ | DK4_GRA_CONF_SCOPE_DRAW
+ | DK4_GRA_CONF_SCOPE_TEXT
+ )
+
+};
+
+/** Graphics configuration.
+*/
+typedef struct {
+ dk4_paper_size_t media; /**< Paper size to use. */
+ dk4_cs_conv_ctx_t ctx; /**< Color space conversion context. */
+ double xres; /**< X resolution. */
+ double yres; /**< Y resolution. */
+ double xslp; /**< X-spline length precision. */
+ double xspp; /**< X-spline parameter precision. */
+ size_t psi; /**< Paper size index in collection. */
+ unsigned xsss; /**< X-spline sub segments. */
+ int driver; /**< Graphics output driver. */
+ int purpose; /**< Intended output purpose. */
+ int color; /**< Flag: Colored output. */
+ int ps_level; /**< PS level, 2 or 3. */
+ int ps_lzw; /**< Flag: Allow LZW. */
+ int ps_dsc; /**< Flag: Write DSC comments. */
+ int img_bg_r; /**< Image background red. */
+ int img_bg_g; /**< Image background green. */
+ int img_bg_b; /**< Image background blue. */
+ int img_bg_f; /**< Flag: Force specified bg. */
+ int img_dct; /**< Flag: Directly use DCT data. */
+ int img_int; /**< Flag: Use image interpolation. */
+ int img_dct_int; /**< Flag: Interpolation for DCT. */
+ int img_an_bpc; /**< Flag: Analyse bits per sample. */
+ int img_an_color; /**< Flag: Analyse color usage. */
+ int img_an_alpha; /**< Flag: Analyse alpha channel use. */
+ int img_rot; /**< Flag: Allow rotation. */
+ int img_ign_res; /**< Flag: Ignore resolution chunk. */
+ int img_ign_asp; /**< Flag: Ignore aspect ratio. */
+ int use_media; /**< Flag: Fit to paper size. */
+ int doc_duplex; /**< Flag: Use duplex printing. */
+ int doc_tumble; /**< Flag: Use duplex and tumble. */
+ int have_psi; /**< Flag: Have psi number. */
+} dk4_gra_conf_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Initialize configuration structure.
+ @param conf Configuration structure to initialize.
+*/
+void
+dk4gra_conf_init(
+ dk4_gra_conf_t *conf
+);
+
+
+/** Retrieve flags for applying an image from the configuration.
+ @param conf Configuration structure to obtain values from.
+ @return Or-combined set of flags.
+*/
+int
+dk4gra_conf_flags_image(
+ dk4_gra_conf_t const *conf
+);
+
+
+/** Retrieve document flags for opening a graphics output structure
+ from the configuration.
+ @param conf Configuration structure to obtain values from.
+ @return Or-combined set of flags.
+*/
+int
+dk4gra_conf_flags_document(
+ dk4_gra_conf_t const *conf
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+
+#endif
diff --git a/support/dktools/dk4grcoa.c b/support/dktools/dk4grcoa.c
new file mode 100644
index 0000000000..e38899136c
--- /dev/null
+++ b/support/dktools/dk4grcoa.c
@@ -0,0 +1,2504 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grcoa.ctr
+*/
+
+/** @file dk4grcoa.c The dk4grcoa module.
+*/
+
+
+#line 68 "dk4grcoa.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4FS_H_INCLUDED
+#include "dk4fs.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRDA_H_INCLUDED
+#include "dk4strda.h"
+#endif
+
+#ifndef DK4TSPDK_H_INCLUDED
+#include "dk4tspdk.h"
+#endif
+
+#ifndef DK4STRMR_H_INCLUDED
+#include "dk4strmr.h"
+#endif
+
+#ifndef DK4PAPER_H_INCLUDED
+#include "dk4paper.h"
+#endif
+
+#ifndef DK4GRALO_H_INCLUDED
+#include "dk4gralo.h"
+#endif
+
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+
+#ifndef DK4PAPEA_H_INCLUDED
+#include "dk4papea.h"
+#endif
+
+#ifndef DK4MAIDDII_H_INCLUDED
+#include "dk4maiddii.h"
+#endif
+
+#ifndef DK4MAIDDUI_H_INCLUDED
+#include "dk4maiddui.h"
+#endif
+
+#ifndef DK4MAIDDBL_H_INCLUDED
+#include "dk4maiddbl.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 138 "dk4grcoa.ctr"
+
+
+
+/** Driver names.
+*/
+static dkChar const * const dk4gra_conf_driver_names[] = {
+/* 0 */
+dkT("pdf"),
+
+/* 1 */
+dkT("eps"),
+
+/* 2 */
+dkT("ps"),
+
+/* 3 */
+dkT("tex"),
+
+/* 4 */
+dkT("bb"),
+
+NULL
+
+
+#line 151 "dk4grcoa.ctr"
+};
+
+
+
+/** Purpose names.
+*/
+static dkChar const * const dk4gra_conf_purpose_names[] = {
+/* 0 */
+dkT("o$bject"),
+
+/* 1 */
+dkT("i$mage"),
+
+/* 2 */
+dkT("d$ocument"),
+
+NULL
+
+
+#line 163 "dk4grcoa.ctr"
+};
+
+
+
+/** Names of configuration keys.
+ Order of entries must match in dk4gra_conf_key_names,
+ dk4gra_conf_cfgfile_key_names and dk4gra_conf_key_scopes.
+*/
+static dkChar const * const dk4gra_conf_key_names[] = {
+/* 0 */
+dkT("c$olor"),
+
+/* 1 */
+dkT("al$pha"),
+
+/* 2 */
+dkT("b$g"),
+
+/* 3 */
+dkT("f$orce-bg"),
+
+/* 4 */
+dkT("in$terpolation"),
+
+/* 5 */
+dkT("dc$t"),
+
+/* 6 */
+dkT("dct-$interpolation"),
+
+/* 7 */
+dkT("a-b$pc"),
+
+/* 8 */
+dkT("a-c$olor"),
+
+/* 9 */
+dkT("a-a$lpha"),
+
+/* 10 */
+dkT("i-$res"),
+
+/* 11 */
+dkT("le$vel"),
+
+/* 12 */
+dkT("lz$w"),
+
+/* 13 */
+dkT("p$aper"),
+
+/* 14 */
+dkT("du$plex"),
+
+/* 15 */
+dkT("t$umble"),
+
+/* 16 */
+dkT("ds$c"),
+
+/* 17 */
+dkT("rgb-to-gray"),
+
+/* 18 */
+dkT("rgb-to-cmyk"),
+
+/* 19 */
+dkT("i-a$spect"),
+
+/* 20 */
+dkT("ro$tate"),
+
+/* 21 */
+dkT("resolution"),
+
+/* 22 */
+dkT("xss$s"),
+
+/* 23 */
+dkT("xsl$p"),
+
+/* 24 */
+dkT("xsp$p"),
+
+NULL
+
+
+#line 274 "dk4grcoa.ctr"
+};
+
+
+
+/** Key names in configuration files.
+ Order of entries must match in dk4gra_conf_key_names,
+ dk4gra_conf_cfgfile_key_names and dk4gra_conf_key_scopes.
+*/
+static dkChar const * const dk4gra_conf_cfgfile_key_names[] = {
+/* 0 */
+dkT("color"),
+
+/* 1 */
+dkT("use alpha channel"),
+
+/* 2 */
+dkT("image background"),
+
+/* 3 */
+dkT("force image background"),
+
+/* 4 */
+dkT("image interpolation"),
+
+/* 5 */
+dkT("use dct encoded data"),
+
+/* 6 */
+dkT("dct image interpolation"),
+
+/* 7 */
+dkT("analyze bits per component"),
+
+/* 8 */
+dkT("analyze colors"),
+
+/* 9 */
+dkT("analyze alpha"),
+
+/* 10 */
+dkT("ignore resolution"),
+
+/* 11 */
+dkT("level"),
+
+/* 12 */
+dkT("lzw"),
+
+/* 13 */
+dkT("paper size"),
+
+/* 14 */
+dkT("duplex"),
+
+/* 15 */
+dkT("tumble"),
+
+/* 16 */
+dkT("dsc"),
+
+/* 17 */
+dkT("rgb to gray"),
+
+/* 18 */
+dkT("rgb to cmyk"),
+
+/* 19 */
+dkT("ignore aspect ratio"),
+
+/* 20 */
+dkT("allow rotate"),
+
+/* 21 */
+dkT("resolution"),
+
+/* 22 */
+dkT("x-spline sub segments"),
+
+/* 23 */
+dkT("x-spline length precision"),
+
+/* 24 */
+dkT("x-spline parameter precision"),
+
+NULL
+
+
+#line 385 "dk4grcoa.ctr"
+};
+
+
+
+/** Constant text fragments.
+*/
+static const dkChar * const dk4gra_conf_txt[] = {
+/* 0 */
+dkT(": \t\r\nvf"),
+
+/* 1 */
+dkT("dk4gra.conf"),
+
+/* 2 */
+dkT("*"),
+
+NULL
+
+
+#line 406 "dk4grcoa.ctr"
+};
+
+
+
+/** Names for alpha channel handling methods.
+*/
+static const dkChar * const dk4gra_conf_alpha_processing[] = {
+/* 0 */
+dkT("m$ix"),
+
+/* 1 */
+dkT("f$oreground"),
+
+NULL
+
+
+#line 417 "dk4grcoa.ctr"
+};
+
+
+
+/** Names of RGB to gray conversion methods.
+*/
+static const dkChar * const dk4gra_conf_rgb_to_gray_methods[] = {
+/* 0 */
+dkT("bt6$01"),
+
+/* 1 */
+dkT("l$uminance"),
+
+/* 2 */
+dkT("f$ast"),
+
+/* 3 */
+dkT("faste$st"),
+
+/* 4 */
+dkT("bt7$09"),
+
+/* 5 */
+dkT("a$verage"),
+
+/* 6 */
+dkT("d$esaturation"),
+
+/* 7 */
+dkT("mi$n"),
+
+/* 8 */
+dkT("me$dian"),
+
+/* 9 */
+dkT("ma$x"),
+
+/* 10 */
+dkT("r$ed"),
+
+/* 11 */
+dkT("g$reen"),
+
+/* 12 */
+dkT("bl$ue"),
+
+NULL
+
+
+#line 439 "dk4grcoa.ctr"
+};
+
+
+
+/** Method names for RGB to CMYK conversion.
+*/
+static const dkChar * const dk4gra_conf_rgb_to_cmyk_methods[] = {
+/* 0 */
+dkT("n$on-standard"),
+
+/* 1 */
+dkT("s$tandard"),
+
+NULL
+
+
+#line 450 "dk4grcoa.ctr"
+};
+
+
+
+/** Names for methods how to handle resolution.
+*/
+static const dkChar * const dk4gra_reso_names[] = {
+/* 0 */
+dkT("1$px1pt"),
+
+/* 1 */
+dkT("c$hunk"),
+
+NULL
+
+
+#line 461 "dk4grcoa.ctr"
+};
+
+
+
+/** Scopes of configuration keys.
+ Order of entries must match in dk4gra_conf_key_names,
+ dk4gra_conf_cfgfile_key_names and dk4gra_conf_key_scopes.
+*/
+static const int dk4gra_conf_key_scopes[] = {
+ /* 0 Allow color output */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 1 How to use alpha channel */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 2 Background RGB triple */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 3 Force image background */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 4 Allow image interpolation */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 5 Use DCT-encoded data from JPEG files directly */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 6 Allow image interpolation for DCT-encoded data from JPEG files */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 7 Analyze bits per component, reduce if possible */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 8 Analyze use of color, switch to grayscale if possible */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 9 Analyze alpha channel, ignore if possible */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 10 Ignore resolution chunk from bitmap image files */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 11 PS language level */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 12 Allow LZW compression in PS 2 output */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 13 Paper size */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 14 Duplex printing */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 15 Duplex and tumble */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 16 Document structuring comments */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 17 RGB to gray conversion method */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 18 RGB to CMYK conversion method */
+ DK4_GRA_CONF_SCOPE_SETUP,
+
+ /* 19 Ignore aspect ratio of image */
+ DK4_GRA_CONF_SCOPE_IMAGE,
+
+ /* 20 Allow image rotation to better fit into space */
+ DK4_GRA_CONF_SCOPE_IMAGE,
+
+ /* 21 Image resolution when bmpp processes one image per page */
+ DK4_GRA_CONF_SCOPE_IMAGE,
+
+ /* 22 Bezier segments per X-spline segment */
+ DK4_GRA_CONF_SCOPE_DRAW,
+
+ /* 23 X-spline length precision */
+ DK4_GRA_CONF_SCOPE_DRAW,
+
+ /* 24 X-spline parameter precision */
+ DK4_GRA_CONF_SCOPE_DRAW,
+};
+
+
+
+/** Retrieve boolean value from value text.
+ @param bptr Address of boolean variable.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_bool(
+ int *bptr,
+#if TRACE_DEBUG
+ dkChar const *keyname,
+#else
+ dkChar const * DK4_ARG_UNUSED(keyname),
+#endif
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ int back = 1;
+#if (!(TRACE_DEBUG))
+ DK4_UNUSED_ARG(keyname)
+#endif
+
+
+#line 573 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ if (0 != dk4str_is_bool(value)) {
+ *bptr = dk4str_is_on(value);
+ }
+ else {
+ /* ERROR: Not a boolean */
+ dk4gralog_3(app, DK4_LL_ERROR, 0, 1, value);
+ back = 0;
+ }
+ }
+ else {
+ *bptr = 1;
+ }
+
+
+#line 591 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Retrieve method for RGB to gray conversion.
+ @param conf Structure to configure.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_rgb_to_gray(
+ dk4_gra_conf_t *conf,
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ int res;
+
+
+#line 615 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4str_abbr_index(
+ dk4gra_conf_rgb_to_gray_methods, dkT('$'), value, 0
+ );
+ if (-1 < res) {
+ back = 1;
+ }
+ switch (res) {
+ case 0: { /* bt601 */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601, NULL
+ );
+ } break;
+ case 1: { /* luminance */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_LUMA, NULL
+ );
+ } break;
+ case 2: { /* fast */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_FAST, NULL
+ );
+ } break;
+ case 3: { /* fastest */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST, NULL
+ );
+ } break;
+ case 4: { /* bt709 */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709, NULL
+ );
+ } break;
+ case 5: { /* average */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_AVERAGE, NULL
+ );
+ } break;
+ case 6: { /* desaturation */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_DESATURATION, NULL
+ );
+ } break;
+ case 7: { /* min */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx),
+ DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION, NULL
+ );
+ } break;
+ case 8: { /* medium */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx),
+ DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION, NULL
+ );
+ } break;
+ case 9: { /* max */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx),
+ DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION, NULL
+ );
+ } break;
+ case 10: { /* red */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED, NULL
+ );
+ } break;
+ case 11: { /* green */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN, NULL
+ );
+ } break;
+ case 12: { /* blue */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE, NULL
+ );
+ } break;
+ default : {
+ /* ERROR: Unknown method name */
+ dk4gralog_3(app, DK4_LL_ERROR, 34, 35, value);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Missing value */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+
+
+#line 719 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Retrieve method for RGB to CMYK conversion.
+ @param conf Structure to configure.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_rgb_to_cmyk(
+ dk4_gra_conf_t *conf,
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ int res;
+
+
+#line 743 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4str_abbr_index(
+ dk4gra_conf_rgb_to_cmyk_methods, dkT('$'), value, 0
+ );
+ switch (res) {
+ case 0: { /* non-standard */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_cmyk(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF, NULL
+ );
+ } break;
+ case 1: { /* standard */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_cmyk(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_CMYK_PS_PDF, NULL
+ );
+ } break;
+ default: {
+ /* ERROR: Unknown method */
+ dk4gralog_3(app, DK4_LL_ERROR, 36, 37, value);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+
+
+#line 775 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Retrieve alpha handling value from value text.
+ @param conf Structure to configure.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_alpha_handling(
+ dk4_gra_conf_t *conf,
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ int res;
+
+
+#line 799 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4str_abbr_index(dk4gra_conf_alpha_processing,dkT('$'),value,0);
+ switch (res) {
+ case 0: {
+ back = 1;
+ dk4cs_context_set_alpha(
+ &(conf->ctx), DK4_CS_CONV_ALPHA_MIX, NULL
+ );
+ } break;
+ case 1: {
+ back = 1;
+ dk4cs_context_set_alpha(
+ &(conf->ctx), DK4_CS_CONV_ALPHA_FOREGROUND, NULL
+ );
+ } break;
+ default : {
+ /* ERROR: Illegal value */
+ dk4gralog_3(app, DK4_LL_ERROR, 38, 39, value);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+
+
+#line 829 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Check whether a value is within specified range, correct if necessary.
+ @param value Address of value variable.
+ @param min Minimum value.
+ @param max Maximum value.
+ @param app Application structure for diagnostics.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_conf_check_range(
+ int *value,
+ int min,
+ int max,
+ dkChar const *txt,
+ dk4_app_t *app
+)
+{
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != value);
+#endif
+ if (min > *value) {
+ *value = min;
+ back = 0;
+ /* ERROR: Value too small! */
+ dk4gralog_3(app, DK4_LL_ERROR, 4, 5, txt);
+ }
+ if (max < *value) {
+ *value = max;
+ back = 0;
+ /* ERROR: Value too large! */
+ dk4gralog_3(app, DK4_LL_ERROR, 4, 5, txt);
+ }
+ return back;
+}
+
+
+
+/** Retrieve background color from value text.
+ @param bptr Address of boolean variable.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_background(
+ int *r,
+ int *g,
+ int *b,
+ int *f,
+ dkChar const *keyname,
+ dkChar *value,
+ dk4_app_t *app
+)
+{
+ dkChar const *ep;
+ dkChar *p[8];
+ size_t numtok = 0;
+ int back = 0;
+
+
+#line 896 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != r);
+ assert(NULL != g);
+ assert(NULL != b);
+ assert(NULL != f);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ numtok = dk4str_tokenize(p, 8, value, dk4gra_conf_txt[0], NULL);
+ switch (numtok) {
+ case 3: case 4: {
+ back = 1;
+ ep = NULL;
+ if (0 == dk4ma_input_dk_dec_int(r, p[0], &ep, 1, NULL)) {
+ back = 0;
+ /* ERROR: Incorrect value */
+ dk4gralog_3(app, DK4_LL_ERROR, 6, 7, p[0]);
+ }
+ else {
+ if (0 == dk4gra_conf_check_range(r, 0, 255, p[0], app)) {
+ back = 0;
+ }
+ }
+ ep = NULL;
+ if (0 == dk4ma_input_dk_dec_int(g, p[1], &ep, 1, NULL)) {
+ back = 0;
+ /* ERROR: Incorrect value */
+ dk4gralog_3(app, DK4_LL_ERROR, 6, 7, p[1]);
+ }
+ else {
+ if (0 == dk4gra_conf_check_range(g, 0, 255, p[1], app)) {
+ back = 0;
+ }
+ }
+ ep = NULL;
+ if (0 == dk4ma_input_dk_dec_int(b, p[2], &ep, 1, NULL)) {
+ back = 0;
+ /* ERROR: Incorrect value */
+ dk4gralog_3(app, DK4_LL_ERROR, 6, 7, p[2]);
+ }
+ else {
+ if (0 == dk4gra_conf_check_range(b, 0, 255, p[2], app)) {
+ back = 0;
+ }
+ }
+ if (4 == numtok) {
+ if (dk4str_is_bool(p[3])) {
+ *f = dk4str_is_on(p[3]);
+ }
+ else {
+ /* ERROR: Incorrect value */
+ dk4gralog_3(app, DK4_LL_ERROR, 4, 5, p[3]);
+ }
+ }
+ } break;
+ default : {
+ /* ERROR: Incorrect value */
+ dk4gralog_1(app, DK4_LL_ERROR, 14);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+
+
+#line 962 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Retrieve PS language level value from value text.
+ @param bptr Address of boolean variable.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_psll(
+ int *bptr,
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ const dkChar *ep = NULL;
+ int back = 0;
+ int psl = 0;
+ int res = 0;
+
+
+#line 988 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4ma_input_dk_dec_int(&psl, value, &ep, 1, NULL);
+ if (0 != res) {
+ if ((1 < psl) && (4 > psl)) {
+ *bptr = psl;
+
+#line 997 "dk4grcoa.ctr"
+ back = 1;
+ }
+ else {
+ /* ERROR: Invalid value */
+ dk4gralog_3(app, DK4_LL_ERROR, 24, 25, value);
+ }
+ }
+ else {
+ /* ERROR: Not a number */
+ dk4gralog_3(app, DK4_LL_ERROR, 6, 7, value);
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+
+
+#line 1014 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Retrieve paper size from value text.
+ @param bptr Address of boolean variable.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_paper_size(
+ dk4_gra_conf_t *conf,
+#if 0
+ dk4_paper_size_t *paper,
+#endif
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+#if VERSION_BEFORE_2018_03_27
+ dk4_paper_size_t *paps;
+ int back = 0;
+
+
+#line 1042 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ paps = dk4app_get_paper_size(app, value);
+ if (NULL != paps) {
+ DK4_MEMCPY(&(conf->media), paps, sizeof(dk4_paper_size_t));
+ back = 1;
+ dk4mem_free(paps);
+ }
+ else {
+ /* ERROR: Not found */
+ dk4gralog_3(app, DK4_LL_ERROR, 16, 17, value);
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+
+
+#line 1063 "dk4grcoa.ctr"
+ return back;
+#else
+ dk4_paper_size_collection_t *pcoll = NULL;
+ dk4_paper_size_t *paps = NULL;
+ dk4_paper_size_t const *cpaps = NULL;
+ int back = 0;
+
+
+#line 1070 "dk4grcoa.ctr"
+ conf->psi = 0;
+ conf->have_psi = 0;
+ if (NULL != value) {
+ /*
+ First attempt: Use collection
+ */
+ pcoll = dk4app_get_paper_sizes(app);
+ if (NULL != pcoll) {
+
+#line 1078 "dk4grcoa.ctr"
+ cpaps = dk4papersize_coll_find_with_index(
+ pcoll, value, &(conf->psi), NULL
+ );
+ if (NULL != cpaps) {
+ DK4_MEMCPY(&(conf->media), cpaps, sizeof(dk4_paper_size_t));
+ conf->media.name = NULL;
+ back = 1;
+ conf->have_psi = 1;
+ }
+ dk4papersize_coll_close(pcoll);
+ }
+ /*
+ Second attempt: Ask for paper size directly
+ */
+ if (0 == back) {
+ paps = dk4app_get_paper_size(app, value);
+ if (NULL != paps) {
+ DK4_MEMCPY(&(conf->media), paps, sizeof(dk4_paper_size_t));
+ back = 1;
+ dk4mem_free(paps);
+ }
+ else {
+ /* ERROR: Not found */
+ dk4gralog_3(app, DK4_LL_ERROR, 16, 17, value);
+ }
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+
+
+#line 1110 "dk4grcoa.ctr"
+ return back;
+#endif
+}
+
+
+
+static
+int
+dk4gra_conf_resolution(
+ dk4_gra_conf_t *conf,
+ const dkChar *keyname,
+ dkChar *value,
+ dk4_app_t *app
+)
+{
+ dkChar *p[8];
+ const dkChar *ep = NULL;
+ double rv;
+ double rw;
+ size_t numtok = 0;
+ int back = 0;
+ int res;
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ numtok = dk4str_tokenize(p, 8, value, dk4gra_conf_txt[0], NULL);
+ switch (numtok) {
+ case 1: {
+ switch (dk4str_abbr_index(dk4gra_reso_names,dkT('$'),p[0],0)) {
+ case 0: {
+ conf->xres = 72.0;
+ conf->yres = 72.0;
+ back = 1;
+ } break;
+ case 1: {
+ /* Left empty by intent, do not specify a resolution */
+ back = 1;
+ } break;
+ default : {
+ rv = 0.0;
+ res = dk4ma_input_dk_double(&rv, p[0], &ep, 1, NULL);
+ if (0 != res) {
+ if (0.0 < rv) {
+ conf->xres = conf->yres = rv;
+ back = 1;
+ }
+ else {
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[0]);
+ }
+ }
+ else {
+ /* ERROR: Invalid resolution value */
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[0]);
+ }
+ } break;
+ }
+ } break;
+ case 2: {
+ rv = rw = 0.0;
+ ep = NULL;
+ res = dk4ma_input_dk_double(&rv, p[0], &ep, 1, NULL);
+ if (0 != res) {
+ ep = NULL;
+ res = dk4ma_input_dk_double(&rw, p[1], &ep, 1, NULL);
+ if (0 != res) {
+ if (0.0 < rv) {
+ if (0.0 < rw) {
+ conf->xres = rv;
+ conf->yres = rw;
+ back = 1;
+ }
+ else {
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[1]);
+ }
+ }
+ else {
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[0]);
+ }
+ }
+ else {
+ /* ERROR: Invalid resolution value */
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[1]);
+ }
+ }
+ else {
+ /* ERROR: Invalid resolution value */
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[0]);
+ }
+ } break;
+ default : {
+ dk4gralog_1(app, DK4_LL_ERROR, 14);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ return back;
+}
+
+
+
+static
+int
+dk4gra_conf_xsss(
+ dk4_gra_conf_t *conf,
+ dkChar *value,
+ dk4_app_t *app
+)
+{
+ const dkChar *ep = NULL;
+ unsigned u = 0U;
+ int res = 0;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4ma_input_dk_dec_uint(&u, value, &ep, 1, NULL);
+ if (0 != res) {
+ if (0U < u) {
+ conf->xsss = u;
+ back = 1;
+ if (16U < u) {
+ dk4gralog_1(app, DK4_LL_WARNING, 64);
+ }
+ else {
+ if (4U > u) {
+ dk4gralog_1(app, DK4_LL_WARNING, 65);
+ }
+ }
+ }
+ else {
+ /* ERROR: Illegal value 0 */
+ conf->xsss = 8U;
+ dk4gralog_1(app, DK4_LL_ERROR, 63);
+ }
+ }
+ else {
+ /* ERROR: Not an unsigned number */
+ conf->xsss = 8U;
+ dk4gralog_3(app, DK4_LL_ERROR, 61, 62, value);
+ }
+ }
+ else {
+ conf->xsss = 8U;
+ back = 1;
+ }
+ return back;
+}
+
+
+
+static
+int
+dk4gra_conf_posdouble(
+ double *rp,
+ const dkChar *keyname,
+ dkChar *value,
+ dk4_app_t *app
+)
+{
+ double d;
+ const dkChar *ep = NULL;
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ back = dk4ma_input_dk_double(&d, value, &ep, 1, NULL);
+ if (0 != back) {
+ if (0.0 < d) {
+ *rp = d;
+ }
+ else {
+ back = 0;
+ /* ERROR: Positive number required */
+ dk4gralog_3(app, DK4_LL_ERROR, 70, 71, keyname);
+ }
+ }
+ else {
+ /* ERROR: Not a double number */
+ dk4gralog_3(app, DK4_LL_ERROR, 68, 69, value);
+ }
+ }
+ else {
+ /* WARNING: Value required */
+ dk4gralog_3(app, DK4_LL_WARNING, 66, 67, keyname);
+ }
+ return back;
+}
+
+
+
+/** Reader object.
+*/
+typedef struct {
+ dk4_gra_conf_t *conf; /**< Configuration structure to modify. */
+ dk4_app_t *app; /**< Application structure. */
+ dk4_um_t lno; /**< Line number. */
+ int insc; /**< Flag: In scope */
+} reader_obj_t;
+
+
+
+/** Check scope line whether or not it matches driver, purpose
+ or combination of both.
+ @param conf Configuration structure to set up.
+ @param txt Text line to process.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on match, 0 on no match.
+*/
+static
+int
+dk4gra_conf_scope_check(
+ dk4_gra_conf_t *conf,
+ dkChar *txt,
+ dk4_app_t *app
+)
+{
+ dkChar *eptr;
+ dkChar *pptr;
+ int drno;
+ int puno;
+ int drmatch;
+ int pumatch;
+ int back = 0;
+
+
+#line 1343 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != txt);
+#endif
+ txt++; txt = dk4str_start(txt, NULL);
+ if (NULL != txt) {
+ eptr = dk4str_chr(txt, dkT(']'));
+ if (NULL != eptr) {
+ *eptr = dkT('\0');
+ }
+ pptr = dk4str_chr(txt, dkT('.'));
+ if (NULL != pptr) {
+ *(pptr++) = dkT('\0'); pptr = dk4str_start(pptr, NULL);
+ }
+ if (NULL != pptr) {
+
+#line 1358 "dk4grcoa.ctr"
+ /*
+ Driver.purpose combination
+ */
+ drno = dk4str_array_index(dk4gra_conf_driver_names, txt, 0);
+ puno = dk4str_abbr_index(
+ dk4gra_conf_purpose_names, dkT('$'), pptr, 0
+ );
+ if (-1 < drno) {
+
+#line 1366 "dk4grcoa.ctr"
+ if (-1 < puno) {
+
+#line 1367 "dk4grcoa.ctr"
+ drmatch = pumatch = 0;
+ switch (drno) {
+ case 0: { /* pdf */
+ if (DK4_GRA_DRIVER_PDF == conf->driver) {
+ drmatch = 1;
+
+#line 1372 "dk4grcoa.ctr"
+ }
+ } break;
+ case 1: { /* eps */
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ drmatch = 1;
+
+#line 1377 "dk4grcoa.ctr"
+ }
+ } break;
+ case 2: { /* ps */
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ drmatch = 1;
+
+#line 1382 "dk4grcoa.ctr"
+ }
+ else {
+ if (DK4_GRA_DRIVER_PS == conf->driver) {
+ drmatch = 1;
+
+#line 1386 "dk4grcoa.ctr"
+ }
+ }
+ } break;
+ case 3: { /* tex */
+ if (DK4_GRA_DRIVER_PGF == conf->driver) {
+ drmatch = 1;
+
+#line 1392 "dk4grcoa.ctr"
+ }
+ } break;
+ case 4: { /* bb */
+ if (DK4_GRA_DRIVER_BB == conf->driver) {
+ drmatch = 1;
+
+#line 1397 "dk4grcoa.ctr"
+ }
+ } break;
+ }
+ switch (puno) {
+ case 0: {
+ if (DK4_GRA_PURPOSE_OBJECT == conf->purpose) {
+ pumatch = 1;
+
+#line 1404 "dk4grcoa.ctr"
+ }
+ } break;
+ case 1: {
+ if (DK4_GRA_PURPOSE_IMAGE == conf->purpose) {
+ pumatch = 1;
+
+#line 1409 "dk4grcoa.ctr"
+ }
+ } break;
+ case 2: {
+ if (DK4_GRA_PURPOSE_DOCUMENT == conf->purpose) {
+ pumatch = 1;
+
+#line 1414 "dk4grcoa.ctr"
+ }
+ } break;
+ }
+ if ((0 != drmatch) && (0 != pumatch)) {
+ back = 1;
+
+#line 1419 "dk4grcoa.ctr"
+ }
+ else {
+
+
+#line 1422 "dk4grcoa.ctr"
+ }
+ }
+ else {
+
+#line 1425 "dk4grcoa.ctr"
+ /* ERROR: No such purpose */
+ dk4gralog_3(app, DK4_LL_ERROR, 27, 28, pptr);
+ }
+ }
+ else {
+
+#line 1430 "dk4grcoa.ctr"
+ /* ERROR: No such driver */
+ dk4gralog_3(app, DK4_LL_ERROR, 29, 30, txt);
+ }
+ }
+ else {
+
+#line 1435 "dk4grcoa.ctr"
+ /*
+ Either only driver or purpose
+ */
+ switch (dk4str_array_index(dk4gra_conf_driver_names, txt, 0)) {
+ case 0: { /* pdf */
+ if (DK4_GRA_DRIVER_PDF == conf->driver) {
+ back = 1;
+
+#line 1442 "dk4grcoa.ctr"
+ }
+ } break;
+ case 1: { /* eps */
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ back = 1;
+
+#line 1447 "dk4grcoa.ctr"
+ }
+ } break;
+ case 2: { /* ps */
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ back = 1;
+
+#line 1452 "dk4grcoa.ctr"
+ }
+ else {
+ if (DK4_GRA_DRIVER_PS == conf->driver) {
+ back = 1;
+
+#line 1456 "dk4grcoa.ctr"
+ }
+ }
+ } break;
+ case 3: { /* tex */
+ if (DK4_GRA_DRIVER_PGF == conf->driver) {
+ back = 1;
+
+#line 1462 "dk4grcoa.ctr"
+ }
+ } break;
+ case 4: { /* bb */
+ if (DK4_GRA_DRIVER_BB == conf->driver) {
+ back = 1;
+
+#line 1467 "dk4grcoa.ctr"
+ }
+ } break;
+ default : {
+ switch (
+ dk4str_abbr_index(
+ dk4gra_conf_purpose_names, dkT('$'), txt, 0
+ )
+ ) {
+ case 0: {
+ if (DK4_GRA_PURPOSE_OBJECT == conf->purpose) {
+ back = 1;
+
+#line 1478 "dk4grcoa.ctr"
+ }
+ } break;
+ case 1: {
+ if (DK4_GRA_PURPOSE_IMAGE == conf->purpose) {
+ back = 1;
+
+#line 1483 "dk4grcoa.ctr"
+ }
+ } break;
+ case 2: {
+ if (DK4_GRA_PURPOSE_DOCUMENT == conf->purpose) {
+ back = 1;
+
+#line 1488 "dk4grcoa.ctr"
+ }
+ } break;
+ default : {
+ if (0 == dk4str_cmp(txt, dk4gra_conf_txt[2])) {
+ back = 1;
+
+#line 1493 "dk4grcoa.ctr"
+ }
+ else {
+ /* ERROR: Not a driver or purpose */
+ dk4gralog_3(app, DK4_LL_ERROR, 44, 45, txt);
+ }
+ } break;
+ }
+ } break;
+ }
+ }
+ }
+
+
+#line 1505 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Callback function, handler to process a line read by the
+ text stream processor.
+ @param obj Reader object.
+ @param line Line to process.
+ @param lineno Line number.
+ @param erp Error report, may be NULL.
+ @return
+ DK4_TSP_RES_OK if the line was processed successfully,
+ DK4_TSP_RES_ERROR on error (can continue),
+ DK4_TSP_RES_FATAL on fatal error (must abort).
+*/
+static
+int
+dk4gra_conf_line_handler(
+ void *obj,
+ dkChar *line,
+ dk4_um_t lineno,
+ dk4_er_t * DK4_ARG_UNUSED(erp)
+)
+{
+ reader_obj_t *rdo;
+ dkChar *pcur;
+ dkChar *vptr;
+ dk4_app_t *app;
+ dk4_gra_conf_t *conf;
+ int back;
+ int res;
+ DK4_UNUSED_ARG(erp)
+
+
+#line 1539 "dk4grcoa.ctr"
+
+
+#line 1540 "dk4grcoa.ctr"
+ back = DK4_TSP_RES_OK;
+ rdo = (reader_obj_t *)obj;
+ app = rdo->app;
+ conf = rdo->conf;
+ dk4app_set_log_source_line(rdo->app, lineno);
+ pcur = dk4str_start(line, NULL);
+ if (NULL != pcur) {
+
+#line 1547 "dk4grcoa.ctr"
+ if (dkT('#') != *pcur) {
+
+#line 1548 "dk4grcoa.ctr"
+ if (dkT('[') == *pcur) {
+
+#line 1549 "dk4grcoa.ctr"
+ rdo->insc = dk4gra_conf_scope_check(conf, pcur, app);
+#if TRACE_DEBUG
+ if (0 != rdo->insc) {
+
+#line 1552 "dk4grcoa.ctr"
+ }
+ else {
+
+#line 1554 "dk4grcoa.ctr"
+ }
+#endif
+ }
+ else {
+
+#line 1558 "dk4grcoa.ctr"
+ if (0 != rdo->insc) {
+
+#line 1559 "dk4grcoa.ctr"
+ vptr = dk4str_chr(pcur, dkT('='));
+ if (NULL != vptr) {
+
+#line 1561 "dk4grcoa.ctr"
+ *(vptr++) = dkT('\0');
+ vptr = dk4str_start(vptr, NULL);
+ if (NULL != vptr) {
+
+
+#line 1565 "dk4grcoa.ctr"
+ dk4str_normalize(pcur, NULL);
+
+
+#line 1567 "dk4grcoa.ctr"
+ dk4str_normalize(vptr, NULL);
+
+
+#line 1569 "dk4grcoa.ctr"
+ res = dk4str_abbr_index(
+ dk4gra_conf_cfgfile_key_names, dkT('$'),
+ pcur, 0
+ );
+
+
+#line 1574 "dk4grcoa.ctr"
+ switch (res) {
+ case 0 : { /* color */
+ res = dk4gra_conf_bool(
+ &(conf->color), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 1 : { /* alpha */
+ res = dk4gra_conf_alpha_handling(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 2 : { /* background */
+ res = dk4gra_conf_background(
+ &(conf->img_bg_r), &(conf->img_bg_g),
+ &(conf->img_bg_b), &(conf->img_bg_f),
+ pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 3 : { /* force background */
+ res = dk4gra_conf_bool(
+ &(conf->img_bg_f), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 4 : { /* image interpolation */
+ res = dk4gra_conf_bool(
+ &(conf->img_int), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 5 : { /* dct */
+ res = dk4gra_conf_bool(
+ &(conf->img_dct), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 6 : { /* dct interpolation */
+ res = dk4gra_conf_bool(
+ &(conf->img_dct_int), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 7 : { /* analyze bits per component */
+ res = dk4gra_conf_bool(
+ &(conf->img_an_bpc), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 8 : { /* analyze color use */
+ res = dk4gra_conf_bool(
+ &(conf->img_an_color), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 9 : { /* analyze alpha use */
+ res = dk4gra_conf_bool(
+ &(conf->img_an_alpha), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 10 : { /* ignore resolution */
+ res = dk4gra_conf_bool(
+ &(conf->img_ign_res), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 11 : { /* ps language level */
+ res = dk4gra_conf_psll(
+ &(conf->ps_level), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 12 : { /* allow lzw */
+ res = dk4gra_conf_bool(
+ &(conf->ps_lzw), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 13 : { /* paper size */
+ res = dk4gra_conf_paper_size(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 14 : { /* duplex */
+ res = dk4gra_conf_bool(
+ &(conf->doc_duplex), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 15 : { /* tumble */
+ res = dk4gra_conf_bool(
+ &(conf->doc_tumble), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 16 : { /* dsc */
+ res = dk4gra_conf_bool(
+ &(conf->ps_dsc), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 17 : { /* rgb to gray */
+ res = dk4gra_conf_rgb_to_gray(
+ conf,pcur,vptr,app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 18 : { /* rgb to cmyk */
+ res = dk4gra_conf_rgb_to_cmyk(
+ conf,pcur,vptr,app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 19 : { /* ignore aspect ratio */
+ res = dk4gra_conf_bool(
+ &(conf->img_ign_asp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 20 : { /* allow rotate */
+ res = dk4gra_conf_bool(
+ &(conf->img_rot), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 21 : { /* resolution */
+ res = dk4gra_conf_resolution(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 22 : { /* X-spline sub segments */
+ res = dk4gra_conf_xsss(
+ conf, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 23 : {
+ res = dk4gra_conf_posdouble(
+ &(conf->xslp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 24 : {
+ res = dk4gra_conf_posdouble(
+ &(conf->xspp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ default : {
+ /* ERROR: Unknown key */
+ back = DK4_TSP_RES_ERROR;
+ dk4gralog_3(
+ app, DK4_LL_ERROR, 31, 32, pcur
+ );
+ } break;
+ }
+ }
+ else {
+
+#line 1787 "dk4grcoa.ctr"
+ dk4gralog_1(app, DK4_LL_ERROR, 46);
+ }
+ }
+ else {
+
+#line 1791 "dk4grcoa.ctr"
+ dk4gralog_1(app, DK4_LL_ERROR, 46);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1796 "dk4grcoa.ctr"
+ }
+#endif
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1802 "dk4grcoa.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1807 "dk4grcoa.ctr"
+ }
+#endif
+
+
+#line 1810 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Apply one configuration file cumulative to the configuration.
+ @param conf Configuration structure to modify.
+ @param filename Input file name.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_conf_apply_file(
+ dk4_gra_conf_t *conf,
+ dkChar const *filename,
+ dk4_app_t *app
+)
+{
+ char ib[4096];
+ dkChar il[256];
+ dk4_tspdk_t tsp;
+ reader_obj_t obj;
+ dk4_stream_t *istrm = NULL;
+ dkChar const *oldsourcefile;
+ dk4_um_t oldsourceline;
+ size_t rb;
+ int res;
+ int back = 1;
+ int cc = 1;
+
+
+#line 1841 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != filename);
+#endif
+ /* Initialize reader object
+ */
+ obj.conf = conf;
+ obj.app = app;
+ obj.lno = (dk4_um_t)0UL;
+ obj.insc = 1;
+ /*
+ Set up logging for file to process
+ */
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, filename);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ dk4gralog_1(app, DK4_LL_PROGRESS, 50);
+ /*
+ Open input stream
+ */
+ istrm = dk4stream_open_file_reader(filename, NULL);
+ if (NULL != istrm) {
+ res = dk4tspdk_setup_line(
+ &tsp, &obj, dk4gra_conf_line_handler,
+ il, DK4_SIZEOF(il,dkChar),
+ dk4app_get_encoding(app), dk4app_get_file_in_encoding(app), NULL
+ );
+ if (0 != res) {
+ do {
+ cc = 0;
+ rb = sizeof(ib);
+ if (0 != dk4stream_read(ib, &rb, istrm, NULL)) {
+ if (0 < rb) {
+ res = dk4tspdk_add_bytes(
+ &tsp, (const unsigned char *)ib, rb
+ );
+ if (DK4_TSP_RES_FATAL != res) {
+ cc = 1;
+ }
+ else {
+ cc = -1;
+ back = 0;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1888 "dk4grcoa.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1893 "dk4grcoa.ctr"
+ }
+#endif
+ } while (1 == cc);
+ if (0 == cc) {
+ res = dk4tspdk_finish(&tsp);
+ if (DK4_TSP_RES_FATAL == res) {
+ back = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR: Failed to set up text processing */
+ dk4gralog_1(app, DK4_LL_ERROR, 40);
+ }
+ dk4stream_close(istrm, NULL);
+ }
+ else {
+ /* ERROR: Failed to read file */
+ dk4gralog_1(app, DK4_LL_ERROR, 41);
+ }
+ /* Set up logging for file processed previously
+ */
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ dk4gralog_1(app, DK4_LL_PROGRESS, 51);
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ /*
+ Finished, return
+ */
+
+
+#line 1923 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Complete setup by reading configuration files after finding
+ driver and purpose.
+ @param conf Configuration structure to set up.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort program).
+*/
+static
+int
+dk4gra_conf_setup_cfgfiles(
+ dk4_gra_conf_t *conf,
+ dk4_app_t *app
+)
+{
+ dkChar fnb[DK4_MAX_PATH]; /* Buffer to construct cfg file name */
+ dkChar const *osf; /* Old source file */
+ dk4_um_t osl; /* Old source line */
+ size_t i; /* Index of current cfg file */
+ int res; /* Operation result */
+ int back = 1;
+
+
+
+#line 1949 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ /*
+ Progress message
+ */
+ osf = dk4app_get_log_source_file(app);
+ osl = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, NULL);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ dk4gralog_1(app, DK4_LL_PROGRESS, 48);
+ for (i = 0; i <= DK4_FS_CONF_MAX; i++) {
+ res = dk4app_search_one_config_file(
+ fnb, DK4_SIZEOF(fnb,dkChar), app, dk4gra_conf_txt[1],
+ (int)i, 1, NULL
+ );
+ if (0 != res) {
+
+
+#line 1967 "dk4grcoa.ctr"
+ if (0 == dk4gra_conf_apply_file(conf, fnb, app)) {
+ back = 0;
+ }
+ }
+ }
+ dk4gralog_1(app, DK4_LL_PROGRESS, 49);
+ dk4app_set_log_source_file(app, osf);
+ dk4app_set_log_source_line(app, osl);
+
+
+#line 1976 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Find driver and purpose from string.
+ @param conf Configuration structure to set up.
+ @param txt Text containing driver and purpose names.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_driver_purpose(
+ dk4_gra_conf_t *conf,
+ dkChar *txt,
+ dk4_app_t *app
+)
+{
+ dkChar *ppur = NULL;
+ int back = 0;
+
+
+#line 1998 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != txt);
+#endif
+ ppur = dk4str_chr(txt, dkT('.'));
+ if (NULL != ppur) {
+ *(ppur++) = dkT('\0');
+ ppur = dk4str_start(ppur, NULL);
+ }
+ conf->driver = dk4str_array_index(dk4gra_conf_driver_names, txt, 0);
+
+
+#line 2009 "dk4grcoa.ctr"
+ if (-1 < conf->driver) {
+ back = 1;
+ if (NULL != ppur) {
+ conf->purpose = dk4str_abbr_index(
+ dk4gra_conf_purpose_names, dkT('$'), ppur, 0
+ );
+
+
+#line 2016 "dk4grcoa.ctr"
+ if (0 > conf->purpose) {
+ back = 0;
+ /* ERROR: Illegal purpose name */
+ dk4gralog_3(app, DK4_LL_ERROR, 27, 28, ppur);
+ }
+ }
+ if (DK4_GRA_DRIVER_PS == conf->driver) {
+ if (DK4_GRA_PURPOSE_DOCUMENT == conf->purpose) {
+ conf->ps_dsc = 1;
+ }
+ }
+ }
+ else {
+ /* ERROR: Illegal driver name */
+ dk4gralog_3(app, DK4_LL_ERROR, 29, 30, txt);
+ }
+
+
+#line 2033 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+static
+int
+dk4gra_conf_key_value(
+ dk4_gra_conf_t *conf,
+ dkChar *txt,
+ int cfscope,
+ dk4_app_t *app
+)
+{
+ dkChar *pcur;
+ dkChar *pnext;
+ dkChar *vptr;
+ int back = 1;
+ int res;
+
+
+#line 2053 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != txt);
+#endif
+ pcur = txt;
+ while ((0 != back) && (NULL != pcur)) {
+ pnext = dk4str_chr(pcur, dkT(','));
+ if (NULL != pnext) {
+ *(pnext++) = dkT('\0');
+ pnext = dk4str_start(pnext, NULL);
+ }
+ vptr = dk4str_chr(pcur, dkT('='));
+ if (NULL != vptr) {
+ *(vptr++) = dkT('\0');
+ vptr = dk4str_start(vptr, NULL);
+ }
+ res = dk4str_abbr_index(dk4gra_conf_key_names, dkT('$'), pcur, 0);
+ if (-1 < res) {
+ if (0 == (cfscope & dk4gra_conf_key_scopes[res])) {
+ /* Warning: Ignored configuration key */
+ dk4gralog_3(app, DK4_LL_ERROR, 42, 43, pcur);
+ }
+ }
+ switch (res) {
+ case 0 : { /* color */
+ res = dk4gra_conf_bool(&(conf->color), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 1 : { /* alpha */
+ res = dk4gra_conf_alpha_handling(conf, pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 2 : { /* background */
+ res = dk4gra_conf_background(
+ &(conf->img_bg_r), &(conf->img_bg_g), &(conf->img_bg_b),
+ &(conf->img_bg_f), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 3 : { /* force background */
+ res = dk4gra_conf_bool(&(conf->img_bg_f), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 4 : { /* image interpolation */
+ res = dk4gra_conf_bool(&(conf->img_int), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 5 : { /* dct */
+ res = dk4gra_conf_bool(&(conf->img_dct), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 6 : { /* dct interpolation */
+ res = dk4gra_conf_bool(&(conf->img_dct_int), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 7 : { /* analyze bits per component */
+ res = dk4gra_conf_bool(&(conf->img_an_bpc), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 8 : { /* analyze color use */
+ res = dk4gra_conf_bool(&(conf->img_an_color), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 9 : { /* analyze alpha use */
+ res = dk4gra_conf_bool(&(conf->img_an_alpha), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 10 : { /* ignore resolution */
+ res = dk4gra_conf_bool(&(conf->img_ign_res), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 11 : { /* ps language level */
+ res = dk4gra_conf_psll(
+ &(conf->ps_level), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 12 : { /* allow lzw */
+ res = dk4gra_conf_bool(&(conf->ps_lzw), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 13 : { /* paper size */
+ res = dk4gra_conf_paper_size(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 14 : { /* duplex */
+ res = dk4gra_conf_bool(&(conf->doc_duplex), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 15 : { /* tumble */
+ res = dk4gra_conf_bool(&(conf->doc_tumble), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 16 : { /* dsc */
+ res = dk4gra_conf_bool(&(conf->ps_dsc), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 17 : { /* rgb to gray */
+ res = dk4gra_conf_rgb_to_gray(conf, pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 18 : { /* rgb to cmyk */
+ res = dk4gra_conf_rgb_to_cmyk(conf, pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 19 : {
+ res = dk4gra_conf_bool(
+ &(conf->img_ign_asp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 20 : {
+ res = dk4gra_conf_bool(
+ &(conf->img_rot), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 21: {
+ res = dk4gra_conf_resolution(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 22: {
+ res = dk4gra_conf_xsss(
+ conf, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 23 : {
+ res = dk4gra_conf_posdouble(
+ &(conf->xslp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 24 : {
+ res = dk4gra_conf_posdouble(
+ &(conf->xspp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ default : {
+ /* ERROR: Unknown key */
+ dk4gralog_3(app, DK4_LL_ERROR, 31, 32, pcur);
+ back = 0;
+ } break;
+ }
+ pcur = pnext;
+ }
+
+
+#line 2255 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/** Process configuration string.
+ @param conf Configuration structure to set up.
+ @param txt Writable copy of configuration string.
+ @param usecfg Flag: Process configuration files after finding
+ driver and purpose.
+ @param cfscope Configuration scope.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort program).
+*/
+static
+int
+dk4gra_conf_setup_txt(
+ dk4_gra_conf_t *conf,
+ dkChar *txt,
+ int usecfg,
+ int cfscope,
+ dk4_app_t *app
+)
+{
+ dkChar *pcur;
+ dkChar *pnext;
+ int back = 1;
+
+
+#line 2283 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != txt);
+#endif
+ pcur = dk4str_start(txt, NULL);
+ if (NULL != pcur) {
+ pnext = dk4str_chr(pcur, dkT(','));
+ if (NULL != pnext) {
+ *(pnext++) = dkT('\0');
+ pnext = dk4str_start(pnext, NULL);
+ }
+ back = dk4gra_conf_driver_purpose(conf, pcur, app);
+ if (0 != back) {
+ if (0 != usecfg) {
+ back = dk4gra_conf_setup_cfgfiles(conf, app);
+ }
+ if (0 != back) {
+ back = dk4gra_conf_key_value(conf, pnext, cfscope, app);
+ }
+ }
+ }
+ else {
+ /* Warning: Empty configuration string */
+ }
+
+
+#line 2308 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_conf_setup(
+ dk4_gra_conf_t *conf,
+ dkChar const *txt,
+ int usecfg,
+ int cfscope,
+ dk4_app_t *app
+)
+{
+ dkChar *mycopy;
+ int back = 0;
+
+
+#line 2325 "dk4grcoa.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ if (NULL != conf) {
+ if ((NULL != txt) || (0 != usecfg)) {
+ if (NULL != txt) {
+ mycopy = dk4str_dup_app(txt, app);
+ if (NULL != mycopy) {
+ back = dk4gra_conf_setup_txt(
+ conf, mycopy, usecfg, cfscope, app
+ );
+ dk4mem_free(mycopy);
+ }
+ }
+ else {
+ back = dk4gra_conf_setup_cfgfiles(conf, app);
+ }
+ }
+ if (DK4_GRA_PURPOSE_DOCUMENT == conf->purpose) {
+ switch (conf->driver) {
+ case DK4_GRA_DRIVER_PDF :
+ case DK4_GRA_DRIVER_PS :
+ case DK4_GRA_DRIVER_PGF : {
+ /* Empty by intent */
+ } break;
+ default : {
+ /* ERROR: Driver/purpose combination no allowd */
+ back = 1;
+ dk4gralog_1(app, DK4_LL_ERROR, 47);
+ } break;
+ }
+ }
+ }
+
+
+#line 2359 "dk4grcoa.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grcoa.ctr b/support/dktools/dk4grcoa.ctr
new file mode 100644
index 0000000000..517f645733
--- /dev/null
+++ b/support/dktools/dk4grcoa.ctr
@@ -0,0 +1,2364 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4grcoa.h Graphics configuration with application support.
+*/
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+#ifndef DK4GRCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4grco.h"
+#else
+#include <dktools-4/dk4grco.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Set up graphics configuration from text string and/or configuration file(s).
+ @param conf Configuration structure to set up.
+ @param txt Text containing information, may be NULL.
+ @param usecfg Flag: Process configuration file.
+ @param cfscope Configuration scopes allowed in txt.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (program can continue), 0 on error (abort program).
+*/
+
+int
+dk4gra_conf_setup(
+ dk4_gra_conf_t *conf,
+ dkChar const *txt,
+ int usecfg,
+ int cfscope,
+ dk4_app_t *app
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4FS_H_INCLUDED
+#include "dk4fs.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRDA_H_INCLUDED
+#include "dk4strda.h"
+#endif
+
+#ifndef DK4TSPDK_H_INCLUDED
+#include "dk4tspdk.h"
+#endif
+
+#ifndef DK4STRMR_H_INCLUDED
+#include "dk4strmr.h"
+#endif
+
+#ifndef DK4PAPER_H_INCLUDED
+#include "dk4paper.h"
+#endif
+
+#ifndef DK4GRALO_H_INCLUDED
+#include "dk4gralo.h"
+#endif
+
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+
+#ifndef DK4PAPEA_H_INCLUDED
+#include "dk4papea.h"
+#endif
+
+#ifndef DK4MAIDDII_H_INCLUDED
+#include "dk4maiddii.h"
+#endif
+
+#ifndef DK4MAIDDUI_H_INCLUDED
+#include "dk4maiddui.h"
+#endif
+
+#ifndef DK4MAIDDBL_H_INCLUDED
+#include "dk4maiddbl.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Driver names.
+*/
+static dkChar const * const dk4gra_conf_driver_names[] = {
+$!string-table macro=dkT
+pdf
+eps
+ps
+tex
+bb
+$!end
+};
+
+
+
+/** Purpose names.
+*/
+static dkChar const * const dk4gra_conf_purpose_names[] = {
+$!string-table macro=dkT
+o$bject
+i$mage
+d$ocument
+$!end
+};
+
+
+
+/** Names of configuration keys.
+ Order of entries must match in dk4gra_conf_key_names,
+ dk4gra_conf_cfgfile_key_names and dk4gra_conf_key_scopes.
+*/
+static dkChar const * const dk4gra_conf_key_names[] = {
+$!string-table macro=dkT
+#
+# 0 Allow color output
+#
+c$olor
+#
+# 1 How to use alpha channel
+#
+al$pha
+#
+# 2 Background RGB triple
+#
+b$g
+#
+# 3 Force image background
+#
+f$orce-bg
+#
+# 4 Allow image interpolation
+#
+in$terpolation
+#
+# 5 Use DCT-encoded data from JPEG files directly
+#
+dc$t
+#
+# 6 Allow image interpolation for DCT-encoded data from JPEG files
+#
+dct-$interpolation
+#
+# 7 Analyze bits per component, reduce if possible
+#
+a-b$pc
+#
+# 8 Analyze use of color, switch to grayscale if possible
+#
+a-c$olor
+#
+# 9 Analyze alpha channel, ignore if possible
+#
+a-a$lpha
+#
+# 10 Ignore resolution chunk from bitmap image files
+#
+i-$res
+#
+# 11 PS language level
+#
+le$vel
+#
+# 12 Allow LZW compression in PS 2 output
+#
+lz$w
+#
+# 13 Paper size
+#
+p$aper
+#
+# 14 Duplex printing
+#
+du$plex
+#
+# 15 Duplex and tumble
+#
+t$umble
+#
+# 16 Document structuring comments
+#
+ds$c
+#
+# 17 RGB to gray conversion method
+#
+rgb-to-gray
+#
+# 18 RGB to CMYK conversion method
+#
+rgb-to-cmyk
+#
+# 19 Ignore aspect ratio
+#
+i-a$spect
+#
+# 20 Allow to rotate image
+#
+ro$tate
+#
+# 21 Specified image resolution
+#
+resolution
+#
+# 22 X-spline sub segments
+#
+xss$s
+#
+# 23 X-spline length precision
+#
+xsl$p
+#
+# 24 X-spline parameter precision
+#
+xsp$p
+$!end
+};
+
+
+
+/** Key names in configuration files.
+ Order of entries must match in dk4gra_conf_key_names,
+ dk4gra_conf_cfgfile_key_names and dk4gra_conf_key_scopes.
+*/
+static dkChar const * const dk4gra_conf_cfgfile_key_names[] = {
+$!string-table macro=dkT
+#
+# 0 Allow color output
+#
+color
+#
+# 1 How to use alpha channel
+#
+use alpha channel
+#
+# 2 Background RGB triple
+#
+image background
+#
+# 3 Force image background
+#
+force image background
+#
+# 4 Allow image interpolation
+#
+image interpolation
+#
+# 5 Use DCT-encoded data from JPEG files directly
+#
+use dct encoded data
+#
+# 6 Allow image interpolation for DCT-encoded data from JPEG files
+#
+dct image interpolation
+#
+# 7 Analyze bits per component, reduce if possible
+#
+analyze bits per component
+#
+# 8 Analyze use of color, switch to grayscale if possible
+#
+analyze colors
+#
+# 9 Analyze alpha channel, ignore if possible
+#
+analyze alpha
+#
+# 10 Ignore resolution chunk from bitmap image files
+#
+ignore resolution
+#
+# 11 PS language level
+#
+level
+#
+# 12 Allow LZW compression in PS 2 output
+#
+lzw
+#
+# 13 Paper size
+#
+paper size
+#
+# 14 Duplex printing
+#
+duplex
+#
+# 15 Duplex and tumble
+#
+tumble
+#
+# 16 Document structuring comments
+#
+dsc
+#
+# 17 RGB to gray conversion method
+#
+rgb to gray
+#
+# 18 RGB to CMYK conversion method
+#
+rgb to cmyk
+#
+# 19 Ignore aspect ratio
+#
+ignore aspect ratio
+#
+# 20 Allow to rotate image
+#
+allow rotate
+#
+# 21 Image resolution when processing just one image
+#
+resolution
+#
+# 22 Number of Bezier segements to draw per X-spline segment
+#
+x-spline sub segments
+#
+# 23 X-spline length precision
+#
+x-spline length precision
+#
+# 24 X-spline parameter precision
+#
+x-spline parameter precision
+$!end
+};
+
+
+
+/** Constant text fragments.
+*/
+static const dkChar * const dk4gra_conf_txt[] = {
+$!string-table macro=dkT
+#
+# 0 Separator string
+#
+: \t\r\n\v\f
+#
+# 1 Configuration file name
+#
+dk4gra.conf
+#
+# 2 Match any driver or purpose
+#
+*
+$!end
+};
+
+
+
+/** Names for alpha channel handling methods.
+*/
+static const dkChar * const dk4gra_conf_alpha_processing[] = {
+$!string-table macro=dkT
+m$ix
+f$oreground
+$!end
+};
+
+
+
+/** Names of RGB to gray conversion methods.
+*/
+static const dkChar * const dk4gra_conf_rgb_to_gray_methods[] = {
+$!string-table macro=dkT
+bt6$01
+l$uminance
+f$ast
+faste$st
+bt7$09
+a$verage
+d$esaturation
+mi$n
+me$dian
+ma$x
+r$ed
+g$reen
+bl$ue
+$!end
+};
+
+
+
+/** Method names for RGB to CMYK conversion.
+*/
+static const dkChar * const dk4gra_conf_rgb_to_cmyk_methods[] = {
+$!string-table macro=dkT
+n$on-standard
+s$tandard
+$!end
+};
+
+
+
+/** Names for methods how to handle resolution.
+*/
+static const dkChar * const dk4gra_reso_names[] = {
+$!string-table macro=dkT
+1$px1pt
+c$hunk
+$!end
+};
+
+
+
+/** Scopes of configuration keys.
+ Order of entries must match in dk4gra_conf_key_names,
+ dk4gra_conf_cfgfile_key_names and dk4gra_conf_key_scopes.
+*/
+static const int dk4gra_conf_key_scopes[] = {
+ /* 0 Allow color output */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 1 How to use alpha channel */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 2 Background RGB triple */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 3 Force image background */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 4 Allow image interpolation */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 5 Use DCT-encoded data from JPEG files directly */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 6 Allow image interpolation for DCT-encoded data from JPEG files */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 7 Analyze bits per component, reduce if possible */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 8 Analyze use of color, switch to grayscale if possible */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 9 Analyze alpha channel, ignore if possible */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 10 Ignore resolution chunk from bitmap image files */
+ DK4_GRA_CONF_SCOPE_IMAGE ,
+
+ /* 11 PS language level */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 12 Allow LZW compression in PS 2 output */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 13 Paper size */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 14 Duplex printing */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 15 Duplex and tumble */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 16 Document structuring comments */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 17 RGB to gray conversion method */
+ DK4_GRA_CONF_SCOPE_SETUP ,
+
+ /* 18 RGB to CMYK conversion method */
+ DK4_GRA_CONF_SCOPE_SETUP,
+
+ /* 19 Ignore aspect ratio of image */
+ DK4_GRA_CONF_SCOPE_IMAGE,
+
+ /* 20 Allow image rotation to better fit into space */
+ DK4_GRA_CONF_SCOPE_IMAGE,
+
+ /* 21 Image resolution when bmpp processes one image per page */
+ DK4_GRA_CONF_SCOPE_IMAGE,
+
+ /* 22 Bezier segments per X-spline segment */
+ DK4_GRA_CONF_SCOPE_DRAW,
+
+ /* 23 X-spline length precision */
+ DK4_GRA_CONF_SCOPE_DRAW,
+
+ /* 24 X-spline parameter precision */
+ DK4_GRA_CONF_SCOPE_DRAW,
+};
+
+
+
+/** Retrieve boolean value from value text.
+ @param bptr Address of boolean variable.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_bool(
+ int *bptr,
+#if TRACE_DEBUG
+ dkChar const *keyname,
+#else
+ dkChar const * DK4_ARG_UNUSED(keyname),
+#endif
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ int back = 1;
+#if (!(TRACE_DEBUG))
+ DK4_UNUSED_ARG(keyname)
+#endif
+ $? "+ dk4gra_conf_bool \"%!ds\"=\"%!ds\"", TR_STR(keyname), TR_STR(value)
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ if (0 != dk4str_is_bool(value)) {
+ *bptr = dk4str_is_on(value);
+ }
+ else {
+ /* ERROR: Not a boolean */
+ dk4gralog_3(app, DK4_LL_ERROR, 0, 1, value);
+ back = 0;
+ }
+ }
+ else {
+ *bptr = 1;
+ }
+ $? "- dk4gra_conf_bool %d", back
+ return back;
+}
+
+
+
+/** Retrieve method for RGB to gray conversion.
+ @param conf Structure to configure.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_rgb_to_gray(
+ dk4_gra_conf_t *conf,
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ int res;
+ $? "+ dk4gra_conf_rgb_to_gray \"%!ds\"", TR_STR(value)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4str_abbr_index(
+ dk4gra_conf_rgb_to_gray_methods, dkT('$'), value, 0
+ );
+ if (-1 < res) {
+ back = 1;
+ }
+ switch (res) {
+ case 0: { /* bt601 */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601, NULL
+ );
+ } break;
+ case 1: { /* luminance */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_LUMA, NULL
+ );
+ } break;
+ case 2: { /* fast */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_FAST, NULL
+ );
+ } break;
+ case 3: { /* fastest */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST, NULL
+ );
+ } break;
+ case 4: { /* bt709 */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709, NULL
+ );
+ } break;
+ case 5: { /* average */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_AVERAGE, NULL
+ );
+ } break;
+ case 6: { /* desaturation */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_DESATURATION, NULL
+ );
+ } break;
+ case 7: { /* min */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx),
+ DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION, NULL
+ );
+ } break;
+ case 8: { /* medium */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx),
+ DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION, NULL
+ );
+ } break;
+ case 9: { /* max */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx),
+ DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION, NULL
+ );
+ } break;
+ case 10: { /* red */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED, NULL
+ );
+ } break;
+ case 11: { /* green */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN, NULL
+ );
+ } break;
+ case 12: { /* blue */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_gray(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE, NULL
+ );
+ } break;
+ default : {
+ /* ERROR: Unknown method name */
+ dk4gralog_3(app, DK4_LL_ERROR, 34, 35, value);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Missing value */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ $? "- dk4gra_conf_rgb_to_gray %d", back
+ return back;
+}
+
+
+
+/** Retrieve method for RGB to CMYK conversion.
+ @param conf Structure to configure.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_rgb_to_cmyk(
+ dk4_gra_conf_t *conf,
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ int res;
+ $? "+ dk4gra_conf_rgb_to_cmyk \"%!ds\"", TR_STR(value)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4str_abbr_index(
+ dk4gra_conf_rgb_to_cmyk_methods, dkT('$'), value, 0
+ );
+ switch (res) {
+ case 0: { /* non-standard */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_cmyk(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_CMYK_NOT_PS_PDF, NULL
+ );
+ } break;
+ case 1: { /* standard */
+ back = 1;
+ (void)dk4cs_context_set_rgb_to_cmyk(
+ &(conf->ctx), DK4_CS_CONV_RGB_TO_CMYK_PS_PDF, NULL
+ );
+ } break;
+ default: {
+ /* ERROR: Unknown method */
+ dk4gralog_3(app, DK4_LL_ERROR, 36, 37, value);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ $? "- dk4gra_conf_rgb_to_cmyk %d", back
+ return back;
+}
+
+
+
+/** Retrieve alpha handling value from value text.
+ @param conf Structure to configure.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_alpha_handling(
+ dk4_gra_conf_t *conf,
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ int res;
+ $? "+ dk4gra_conf_alpha_handling \"%!ds\"", TR_STR(value)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4str_abbr_index(dk4gra_conf_alpha_processing,dkT('$'),value,0);
+ switch (res) {
+ case 0: {
+ back = 1;
+ dk4cs_context_set_alpha(
+ &(conf->ctx), DK4_CS_CONV_ALPHA_MIX, NULL
+ );
+ } break;
+ case 1: {
+ back = 1;
+ dk4cs_context_set_alpha(
+ &(conf->ctx), DK4_CS_CONV_ALPHA_FOREGROUND, NULL
+ );
+ } break;
+ default : {
+ /* ERROR: Illegal value */
+ dk4gralog_3(app, DK4_LL_ERROR, 38, 39, value);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ $? "- dk4gra_conf_alpha_handling %d", back
+ return back;
+}
+
+
+
+/** Check whether a value is within specified range, correct if necessary.
+ @param value Address of value variable.
+ @param min Minimum value.
+ @param max Maximum value.
+ @param app Application structure for diagnostics.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_conf_check_range(
+ int *value,
+ int min,
+ int max,
+ dkChar const *txt,
+ dk4_app_t *app
+)
+{
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != value);
+#endif
+ if (min > *value) {
+ *value = min;
+ back = 0;
+ /* ERROR: Value too small! */
+ dk4gralog_3(app, DK4_LL_ERROR, 4, 5, txt);
+ }
+ if (max < *value) {
+ *value = max;
+ back = 0;
+ /* ERROR: Value too large! */
+ dk4gralog_3(app, DK4_LL_ERROR, 4, 5, txt);
+ }
+ return back;
+}
+
+
+
+/** Retrieve background color from value text.
+ @param bptr Address of boolean variable.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_background(
+ int *r,
+ int *g,
+ int *b,
+ int *f,
+ dkChar const *keyname,
+ dkChar *value,
+ dk4_app_t *app
+)
+{
+ dkChar const *ep;
+ dkChar *p[8];
+ size_t numtok = 0;
+ int back = 0;
+ $? "+ dk4gra_conf_background \"%!ds\"", TR_STR(value)
+#if DK4_USE_ASSERT
+ assert(NULL != r);
+ assert(NULL != g);
+ assert(NULL != b);
+ assert(NULL != f);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ numtok = dk4str_tokenize(p, 8, value, dk4gra_conf_txt[0], NULL);
+ switch (numtok) {
+ case 3: case 4: {
+ back = 1;
+ ep = NULL;
+ if (0 == dk4ma_input_dk_dec_int(r, p[0], &ep, 1, NULL)) {
+ back = 0;
+ /* ERROR: Incorrect value */
+ dk4gralog_3(app, DK4_LL_ERROR, 6, 7, p[0]);
+ }
+ else {
+ if (0 == dk4gra_conf_check_range(r, 0, 255, p[0], app)) {
+ back = 0;
+ }
+ }
+ ep = NULL;
+ if (0 == dk4ma_input_dk_dec_int(g, p[1], &ep, 1, NULL)) {
+ back = 0;
+ /* ERROR: Incorrect value */
+ dk4gralog_3(app, DK4_LL_ERROR, 6, 7, p[1]);
+ }
+ else {
+ if (0 == dk4gra_conf_check_range(g, 0, 255, p[1], app)) {
+ back = 0;
+ }
+ }
+ ep = NULL;
+ if (0 == dk4ma_input_dk_dec_int(b, p[2], &ep, 1, NULL)) {
+ back = 0;
+ /* ERROR: Incorrect value */
+ dk4gralog_3(app, DK4_LL_ERROR, 6, 7, p[2]);
+ }
+ else {
+ if (0 == dk4gra_conf_check_range(b, 0, 255, p[2], app)) {
+ back = 0;
+ }
+ }
+ if (4 == numtok) {
+ if (dk4str_is_bool(p[3])) {
+ *f = dk4str_is_on(p[3]);
+ }
+ else {
+ /* ERROR: Incorrect value */
+ dk4gralog_3(app, DK4_LL_ERROR, 4, 5, p[3]);
+ }
+ }
+ } break;
+ default : {
+ /* ERROR: Incorrect value */
+ dk4gralog_1(app, DK4_LL_ERROR, 14);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ $? "- dk4gra_conf_background %d", back
+ return back;
+}
+
+
+
+/** Retrieve PS language level value from value text.
+ @param bptr Address of boolean variable.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_psll(
+ int *bptr,
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+ const dkChar *ep = NULL;
+ int back = 0;
+ int psl = 0;
+ int res = 0;
+ $? "+ dk4gra_conf_psll \"%!ds\"", TR_STR(value)
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4ma_input_dk_dec_int(&psl, value, &ep, 1, NULL);
+ if (0 != res) {
+ if ((1 < psl) && (4 > psl)) {
+ *bptr = psl; $? ". psl = %d", psl
+ back = 1;
+ }
+ else {
+ /* ERROR: Invalid value */
+ dk4gralog_3(app, DK4_LL_ERROR, 24, 25, value);
+ }
+ }
+ else {
+ /* ERROR: Not a number */
+ dk4gralog_3(app, DK4_LL_ERROR, 6, 7, value);
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ $? "- dk4gra_conf_psll %d", back
+ return back;
+}
+
+
+
+/** Retrieve paper size from value text.
+ @param bptr Address of boolean variable.
+ @param keyname Key name to use in diagnostics.
+ @param value Value text, may be NULL.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_paper_size(
+ dk4_gra_conf_t *conf,
+#if 0
+ dk4_paper_size_t *paper,
+#endif
+ dkChar const *keyname,
+ dkChar const *value,
+ dk4_app_t *app
+)
+{
+#if VERSION_BEFORE_2018_03_27
+ dk4_paper_size_t *paps;
+ int back = 0;
+ $? "+ dk4gra_conf_paper_size \"%!ds\"", TR_STR(value)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ paps = dk4app_get_paper_size(app, value);
+ if (NULL != paps) {
+ DK4_MEMCPY(&(conf->media), paps, sizeof(dk4_paper_size_t));
+ back = 1;
+ dk4mem_free(paps);
+ }
+ else {
+ /* ERROR: Not found */
+ dk4gralog_3(app, DK4_LL_ERROR, 16, 17, value);
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ $? "- dk4gra_conf_paper_size %d", back
+ return back;
+#else
+ dk4_paper_size_collection_t *pcoll = NULL;
+ dk4_paper_size_t *paps = NULL;
+ dk4_paper_size_t const *cpaps = NULL;
+ int back = 0;
+ $? "+ dk4gra_conf_paper_size \"%!ds\"", TR_STR(value)
+ conf->psi = 0;
+ conf->have_psi = 0;
+ if (NULL != value) {
+ /*
+ First attempt: Use collection
+ */
+ pcoll = dk4app_get_paper_sizes(app);
+ if (NULL != pcoll) { $? ". have collection, search for size and ind"
+ cpaps = dk4papersize_coll_find_with_index(
+ pcoll, value, &(conf->psi), NULL
+ );
+ if (NULL != cpaps) {
+ DK4_MEMCPY(&(conf->media), cpaps, sizeof(dk4_paper_size_t));
+ conf->media.name = NULL;
+ back = 1;
+ conf->have_psi = 1;
+ }
+ dk4papersize_coll_close(pcoll);
+ }
+ /*
+ Second attempt: Ask for paper size directly
+ */
+ if (0 == back) {
+ paps = dk4app_get_paper_size(app, value);
+ if (NULL != paps) {
+ DK4_MEMCPY(&(conf->media), paps, sizeof(dk4_paper_size_t));
+ back = 1;
+ dk4mem_free(paps);
+ }
+ else {
+ /* ERROR: Not found */
+ dk4gralog_3(app, DK4_LL_ERROR, 16, 17, value);
+ }
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ $? "- dk4gra_conf_paper_size %d", back
+ return back;
+#endif
+}
+
+
+
+static
+int
+dk4gra_conf_resolution(
+ dk4_gra_conf_t *conf,
+ const dkChar *keyname,
+ dkChar *value,
+ dk4_app_t *app
+)
+{
+ dkChar *p[8];
+ const dkChar *ep = NULL;
+ double rv;
+ double rw;
+ size_t numtok = 0;
+ int back = 0;
+ int res;
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ numtok = dk4str_tokenize(p, 8, value, dk4gra_conf_txt[0], NULL);
+ switch (numtok) {
+ case 1: {
+ switch (dk4str_abbr_index(dk4gra_reso_names,dkT('$'),p[0],0)) {
+ case 0: {
+ conf->xres = 72.0;
+ conf->yres = 72.0;
+ back = 1;
+ } break;
+ case 1: {
+ /* Left empty by intent, do not specify a resolution */
+ back = 1;
+ } break;
+ default : {
+ rv = 0.0;
+ res = dk4ma_input_dk_double(&rv, p[0], &ep, 1, NULL);
+ if (0 != res) {
+ if (0.0 < rv) {
+ conf->xres = conf->yres = rv;
+ back = 1;
+ }
+ else {
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[0]);
+ }
+ }
+ else {
+ /* ERROR: Invalid resolution value */
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[0]);
+ }
+ } break;
+ }
+ } break;
+ case 2: {
+ rv = rw = 0.0;
+ ep = NULL;
+ res = dk4ma_input_dk_double(&rv, p[0], &ep, 1, NULL);
+ if (0 != res) {
+ ep = NULL;
+ res = dk4ma_input_dk_double(&rw, p[1], &ep, 1, NULL);
+ if (0 != res) {
+ if (0.0 < rv) {
+ if (0.0 < rw) {
+ conf->xres = rv;
+ conf->yres = rw;
+ back = 1;
+ }
+ else {
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[1]);
+ }
+ }
+ else {
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[0]);
+ }
+ }
+ else {
+ /* ERROR: Invalid resolution value */
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[1]);
+ }
+ }
+ else {
+ /* ERROR: Invalid resolution value */
+ dk4gralog_3(app, DK4_LL_ERROR, 2, 3, p[0]);
+ }
+ } break;
+ default : {
+ dk4gralog_1(app, DK4_LL_ERROR, 14);
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk4gralog_3(app, DK4_LL_ERROR, 20, 21, keyname);
+ }
+ return back;
+}
+
+
+
+static
+int
+dk4gra_conf_xsss(
+ dk4_gra_conf_t *conf,
+ dkChar *value,
+ dk4_app_t *app
+)
+{
+ const dkChar *ep = NULL;
+ unsigned u = 0U;
+ int res = 0;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ res = dk4ma_input_dk_dec_uint(&u, value, &ep, 1, NULL);
+ if (0 != res) {
+ if (0U < u) {
+ conf->xsss = u;
+ back = 1;
+ if (16U < u) {
+ dk4gralog_1(app, DK4_LL_WARNING, 64);
+ }
+ else {
+ if (4U > u) {
+ dk4gralog_1(app, DK4_LL_WARNING, 65);
+ }
+ }
+ }
+ else {
+ /* ERROR: Illegal value 0 */
+ conf->xsss = 8U;
+ dk4gralog_1(app, DK4_LL_ERROR, 63);
+ }
+ }
+ else {
+ /* ERROR: Not an unsigned number */
+ conf->xsss = 8U;
+ dk4gralog_3(app, DK4_LL_ERROR, 61, 62, value);
+ }
+ }
+ else {
+ conf->xsss = 8U;
+ back = 1;
+ }
+ return back;
+}
+
+
+
+static
+int
+dk4gra_conf_posdouble(
+ double *rp,
+ const dkChar *keyname,
+ dkChar *value,
+ dk4_app_t *app
+)
+{
+ double d;
+ const dkChar *ep = NULL;
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != value);
+#endif
+ if (NULL != value) {
+ back = dk4ma_input_dk_double(&d, value, &ep, 1, NULL);
+ if (0 != back) {
+ if (0.0 < d) {
+ *rp = d;
+ }
+ else {
+ back = 0;
+ /* ERROR: Positive number required */
+ dk4gralog_3(app, DK4_LL_ERROR, 70, 71, keyname);
+ }
+ }
+ else {
+ /* ERROR: Not a double number */
+ dk4gralog_3(app, DK4_LL_ERROR, 68, 69, value);
+ }
+ }
+ else {
+ /* WARNING: Value required */
+ dk4gralog_3(app, DK4_LL_WARNING, 66, 67, keyname);
+ }
+ return back;
+}
+
+
+
+/** Reader object.
+*/
+typedef struct {
+ dk4_gra_conf_t *conf; /**< Configuration structure to modify. */
+ dk4_app_t *app; /**< Application structure. */
+ dk4_um_t lno; /**< Line number. */
+ int insc; /**< Flag: In scope */
+} reader_obj_t;
+
+
+
+/** Check scope line whether or not it matches driver, purpose
+ or combination of both.
+ @param conf Configuration structure to set up.
+ @param txt Text line to process.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on match, 0 on no match.
+*/
+static
+int
+dk4gra_conf_scope_check(
+ dk4_gra_conf_t *conf,
+ dkChar *txt,
+ dk4_app_t *app
+)
+{
+ dkChar *eptr;
+ dkChar *pptr;
+ int drno;
+ int puno;
+ int drmatch;
+ int pumatch;
+ int back = 0;
+ $? "+ dk4gra_conf_scope_check \"%!ds\"", TR_STR(txt)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != txt);
+#endif
+ txt++; txt = dk4str_start(txt, NULL);
+ if (NULL != txt) {
+ eptr = dk4str_chr(txt, dkT(']'));
+ if (NULL != eptr) {
+ *eptr = dkT('\0');
+ }
+ pptr = dk4str_chr(txt, dkT('.'));
+ if (NULL != pptr) {
+ *(pptr++) = dkT('\0'); pptr = dk4str_start(pptr, NULL);
+ }
+ if (NULL != pptr) { $? ". driver and purpose"
+ /*
+ Driver.purpose combination
+ */
+ drno = dk4str_array_index(dk4gra_conf_driver_names, txt, 0);
+ puno = dk4str_abbr_index(
+ dk4gra_conf_purpose_names, dkT('$'), pptr, 0
+ );
+ if (-1 < drno) { $? ". valid driver"
+ if (-1 < puno) { $? ". valid purpose"
+ drmatch = pumatch = 0;
+ switch (drno) {
+ case 0: { /* pdf */
+ if (DK4_GRA_DRIVER_PDF == conf->driver) {
+ drmatch = 1; $? ". driver match"
+ }
+ } break;
+ case 1: { /* eps */
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ drmatch = 1; $? ". driver match"
+ }
+ } break;
+ case 2: { /* ps */
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ drmatch = 1; $? ". driver match"
+ }
+ else {
+ if (DK4_GRA_DRIVER_PS == conf->driver) {
+ drmatch = 1; $? ". driver match"
+ }
+ }
+ } break;
+ case 3: { /* tex */
+ if (DK4_GRA_DRIVER_PGF == conf->driver) {
+ drmatch = 1; $? ". driver match"
+ }
+ } break;
+ case 4: { /* bb */
+ if (DK4_GRA_DRIVER_BB == conf->driver) {
+ drmatch = 1; $? ". driver match"
+ }
+ } break;
+ }
+ switch (puno) {
+ case 0: {
+ if (DK4_GRA_PURPOSE_OBJECT == conf->purpose) {
+ pumatch = 1; $? ". purpose match"
+ }
+ } break;
+ case 1: {
+ if (DK4_GRA_PURPOSE_IMAGE == conf->purpose) {
+ pumatch = 1; $? ". purpose match"
+ }
+ } break;
+ case 2: {
+ if (DK4_GRA_PURPOSE_DOCUMENT == conf->purpose) {
+ pumatch = 1; $? ". purpose match"
+ }
+ } break;
+ }
+ if ((0 != drmatch) && (0 != pumatch)) {
+ back = 1; $? ". match ok"
+ }
+ else {
+ $? ". drmatch=%d pumatch=%d", drmatch, pumatch
+ }
+ }
+ else { $? "! invalid purpose"
+ /* ERROR: No such purpose */
+ dk4gralog_3(app, DK4_LL_ERROR, 27, 28, pptr);
+ }
+ }
+ else { $? "! invalid driver"
+ /* ERROR: No such driver */
+ dk4gralog_3(app, DK4_LL_ERROR, 29, 30, txt);
+ }
+ }
+ else { $? ". driver or purpose"
+ /*
+ Either only driver or purpose
+ */
+ switch (dk4str_array_index(dk4gra_conf_driver_names, txt, 0)) {
+ case 0: { /* pdf */
+ if (DK4_GRA_DRIVER_PDF == conf->driver) {
+ back = 1; $? ". driver match"
+ }
+ } break;
+ case 1: { /* eps */
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ back = 1; $? ". driver match"
+ }
+ } break;
+ case 2: { /* ps */
+ if (DK4_GRA_DRIVER_EPS == conf->driver) {
+ back = 1; $? ". driver match"
+ }
+ else {
+ if (DK4_GRA_DRIVER_PS == conf->driver) {
+ back = 1; $? ". driver match"
+ }
+ }
+ } break;
+ case 3: { /* tex */
+ if (DK4_GRA_DRIVER_PGF == conf->driver) {
+ back = 1; $? ". driver match"
+ }
+ } break;
+ case 4: { /* bb */
+ if (DK4_GRA_DRIVER_BB == conf->driver) {
+ back = 1; $? ". driver match"
+ }
+ } break;
+ default : {
+ switch (
+ dk4str_abbr_index(
+ dk4gra_conf_purpose_names, dkT('$'), txt, 0
+ )
+ ) {
+ case 0: {
+ if (DK4_GRA_PURPOSE_OBJECT == conf->purpose) {
+ back = 1; $? ". purpose match"
+ }
+ } break;
+ case 1: {
+ if (DK4_GRA_PURPOSE_IMAGE == conf->purpose) {
+ back = 1; $? ". purpose match"
+ }
+ } break;
+ case 2: {
+ if (DK4_GRA_PURPOSE_DOCUMENT == conf->purpose) {
+ back = 1; $? ". purpose match"
+ }
+ } break;
+ default : {
+ if (0 == dk4str_cmp(txt, dk4gra_conf_txt[2])) {
+ back = 1; $? ". general match"
+ }
+ else {
+ /* ERROR: Not a driver or purpose */
+ dk4gralog_3(app, DK4_LL_ERROR, 44, 45, txt);
+ }
+ } break;
+ }
+ } break;
+ }
+ }
+ }
+ $? "- dk4gra_conf_scope_check %d", back
+ return back;
+}
+
+
+
+/** Callback function, handler to process a line read by the
+ text stream processor.
+ @param obj Reader object.
+ @param line Line to process.
+ @param lineno Line number.
+ @param erp Error report, may be NULL.
+ @return
+ DK4_TSP_RES_OK if the line was processed successfully,
+ DK4_TSP_RES_ERROR on error (can continue),
+ DK4_TSP_RES_FATAL on fatal error (must abort).
+*/
+static
+int
+dk4gra_conf_line_handler(
+ void *obj,
+ dkChar *line,
+ dk4_um_t lineno,
+ dk4_er_t * DK4_ARG_UNUSED(erp)
+)
+{
+ reader_obj_t *rdo;
+ dkChar *pcur;
+ dkChar *vptr;
+ dk4_app_t *app;
+ dk4_gra_conf_t *conf;
+ int back;
+ int res;
+ DK4_UNUSED_ARG(erp)
+ $!trace-code if (NULL != line) { dk4str_delnl(line); }
+ $? "+ dk4gra_conf_line_handler \"%!ds\"", TR_STR(line)
+ back = DK4_TSP_RES_OK;
+ rdo = (reader_obj_t *)obj;
+ app = rdo->app;
+ conf = rdo->conf;
+ dk4app_set_log_source_line(rdo->app, lineno);
+ pcur = dk4str_start(line, NULL);
+ if (NULL != pcur) { $? ". have text"
+ if (dkT('#') != *pcur) { $? ". not a comment"
+ if (dkT('[') == *pcur) { $? ". scope definition"
+ rdo->insc = dk4gra_conf_scope_check(conf, pcur, app);
+#if TRACE_DEBUG
+ if (0 != rdo->insc) { $? ". scope on"
+ }
+ else { $? ". scope off"
+ }
+#endif
+ }
+ else { $? ". data line"
+ if (0 != rdo->insc) { $? ". in scope"
+ vptr = dk4str_chr(pcur, dkT('='));
+ if (NULL != vptr) { $? ". have value"
+ *(vptr++) = dkT('\0');
+ vptr = dk4str_start(vptr, NULL);
+ if (NULL != vptr) {
+ $? ". vptr=%!ds", vptr
+ dk4str_normalize(pcur, NULL);
+ $? ". pcur=%!ds", pcur
+ dk4str_normalize(vptr, NULL);
+ $? ". vptr=%!ds", vptr
+ res = dk4str_abbr_index(
+ dk4gra_conf_cfgfile_key_names, dkT('$'),
+ pcur, 0
+ );
+ $? ". res = %d", res
+ switch (res) {
+ case 0 : { /* color */
+ res = dk4gra_conf_bool(
+ &(conf->color), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 1 : { /* alpha */
+ res = dk4gra_conf_alpha_handling(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 2 : { /* background */
+ res = dk4gra_conf_background(
+ &(conf->img_bg_r), &(conf->img_bg_g),
+ &(conf->img_bg_b), &(conf->img_bg_f),
+ pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 3 : { /* force background */
+ res = dk4gra_conf_bool(
+ &(conf->img_bg_f), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 4 : { /* image interpolation */
+ res = dk4gra_conf_bool(
+ &(conf->img_int), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 5 : { /* dct */
+ res = dk4gra_conf_bool(
+ &(conf->img_dct), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 6 : { /* dct interpolation */
+ res = dk4gra_conf_bool(
+ &(conf->img_dct_int), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 7 : { /* analyze bits per component */
+ res = dk4gra_conf_bool(
+ &(conf->img_an_bpc), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 8 : { /* analyze color use */
+ res = dk4gra_conf_bool(
+ &(conf->img_an_color), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 9 : { /* analyze alpha use */
+ res = dk4gra_conf_bool(
+ &(conf->img_an_alpha), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 10 : { /* ignore resolution */
+ res = dk4gra_conf_bool(
+ &(conf->img_ign_res), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 11 : { /* ps language level */
+ res = dk4gra_conf_psll(
+ &(conf->ps_level), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 12 : { /* allow lzw */
+ res = dk4gra_conf_bool(
+ &(conf->ps_lzw), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 13 : { /* paper size */
+ res = dk4gra_conf_paper_size(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 14 : { /* duplex */
+ res = dk4gra_conf_bool(
+ &(conf->doc_duplex), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 15 : { /* tumble */
+ res = dk4gra_conf_bool(
+ &(conf->doc_tumble), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 16 : { /* dsc */
+ res = dk4gra_conf_bool(
+ &(conf->ps_dsc), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 17 : { /* rgb to gray */
+ res = dk4gra_conf_rgb_to_gray(
+ conf,pcur,vptr,app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 18 : { /* rgb to cmyk */
+ res = dk4gra_conf_rgb_to_cmyk(
+ conf,pcur,vptr,app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 19 : { /* ignore aspect ratio */
+ res = dk4gra_conf_bool(
+ &(conf->img_ign_asp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 20 : { /* allow rotate */
+ res = dk4gra_conf_bool(
+ &(conf->img_rot), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 21 : { /* resolution */
+ res = dk4gra_conf_resolution(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 22 : { /* X-spline sub segments */
+ res = dk4gra_conf_xsss(
+ conf, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 23 : {
+ res = dk4gra_conf_posdouble(
+ &(conf->xslp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ case 24 : {
+ res = dk4gra_conf_posdouble(
+ &(conf->xspp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = DK4_TSP_RES_ERROR;
+ }
+ } break;
+ default : {
+ /* ERROR: Unknown key */
+ back = DK4_TSP_RES_ERROR;
+ dk4gralog_3(
+ app, DK4_LL_ERROR, 31, 32, pcur
+ );
+ } break;
+ }
+ }
+ else { $? "! no value found"
+ dk4gralog_1(app, DK4_LL_ERROR, 46);
+ }
+ }
+ else { $? "! no value found"
+ dk4gralog_1(app, DK4_LL_ERROR, 46);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". not in scope"
+ }
+#endif
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". comment line"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? ". empty line ok"
+ }
+#endif
+ $? "- dk4gra_conf_line_handler %d", back
+ return back;
+}
+
+
+
+/** Apply one configuration file cumulative to the configuration.
+ @param conf Configuration structure to modify.
+ @param filename Input file name.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_conf_apply_file(
+ dk4_gra_conf_t *conf,
+ dkChar const *filename,
+ dk4_app_t *app
+)
+{
+ char ib[4096];
+ dkChar il[256];
+ dk4_tspdk_t tsp;
+ reader_obj_t obj;
+ dk4_stream_t *istrm = NULL;
+ dkChar const *oldsourcefile;
+ dk4_um_t oldsourceline;
+ size_t rb;
+ int res;
+ int back = 1;
+ int cc = 1;
+ $? "+ dk4gra_conf_apply_file \"%!ds\"", TR_STR(filename)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != filename);
+#endif
+ /* Initialize reader object
+ */
+ obj.conf = conf;
+ obj.app = app;
+ obj.lno = (dk4_um_t)0UL;
+ obj.insc = 1;
+ /*
+ Set up logging for file to process
+ */
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, filename);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ dk4gralog_1(app, DK4_LL_PROGRESS, 50);
+ /*
+ Open input stream
+ */
+ istrm = dk4stream_open_file_reader(filename, NULL);
+ if (NULL != istrm) {
+ res = dk4tspdk_setup_line(
+ &tsp, &obj, dk4gra_conf_line_handler,
+ il, DK4_SIZEOF(il,dkChar),
+ dk4app_get_encoding(app), dk4app_get_file_in_encoding(app), NULL
+ );
+ if (0 != res) {
+ do {
+ cc = 0;
+ rb = sizeof(ib);
+ if (0 != dk4stream_read(ib, &rb, istrm, NULL)) {
+ if (0 < rb) {
+ res = dk4tspdk_add_bytes(
+ &tsp, (const unsigned char *)ib, rb
+ );
+ if (DK4_TSP_RES_FATAL != res) {
+ cc = 1;
+ }
+ else {
+ cc = -1;
+ back = 0;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". rb 0"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? ". read 0"
+ }
+#endif
+ } while (1 == cc);
+ if (0 == cc) {
+ res = dk4tspdk_finish(&tsp);
+ if (DK4_TSP_RES_FATAL == res) {
+ back = 0;
+ }
+ }
+ }
+ else {
+ /* ERROR: Failed to set up text processing */
+ dk4gralog_1(app, DK4_LL_ERROR, 40);
+ }
+ dk4stream_close(istrm, NULL);
+ }
+ else {
+ /* ERROR: Failed to read file */
+ dk4gralog_1(app, DK4_LL_ERROR, 41);
+ }
+ /* Set up logging for file processed previously
+ */
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ dk4gralog_1(app, DK4_LL_PROGRESS, 51);
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ /*
+ Finished, return
+ */
+ $? "- dk4gra_conf_apply_file %d", back
+ return back;
+}
+
+
+
+/** Complete setup by reading configuration files after finding
+ driver and purpose.
+ @param conf Configuration structure to set up.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort program).
+*/
+static
+int
+dk4gra_conf_setup_cfgfiles(
+ dk4_gra_conf_t *conf,
+ dk4_app_t *app
+)
+{
+ dkChar fnb[DK4_MAX_PATH]; /* Buffer to construct cfg file name */
+ dkChar const *osf; /* Old source file */
+ dk4_um_t osl; /* Old source line */
+ size_t i; /* Index of current cfg file */
+ int res; /* Operation result */
+ int back = 1;
+
+ $? "+ dk4gra_conf_setup_cfgfiles"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ /*
+ Progress message
+ */
+ osf = dk4app_get_log_source_file(app);
+ osl = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, NULL);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ dk4gralog_1(app, DK4_LL_PROGRESS, 48);
+ for (i = 0; i <= DK4_FS_CONF_MAX; i++) {
+ res = dk4app_search_one_config_file(
+ fnb, DK4_SIZEOF(fnb,dkChar), app, dk4gra_conf_txt[1],
+ (int)i, 1, NULL
+ );
+ if (0 != res) {
+ $? ". process file \"%!ds\"", fnb
+ if (0 == dk4gra_conf_apply_file(conf, fnb, app)) {
+ back = 0;
+ }
+ }
+ }
+ dk4gralog_1(app, DK4_LL_PROGRESS, 49);
+ dk4app_set_log_source_file(app, osf);
+ dk4app_set_log_source_line(app, osl);
+ $? "- dk4gra_conf_setup_cfgfiles %d", back
+ return back;
+}
+
+
+
+/** Find driver and purpose from string.
+ @param conf Configuration structure to set up.
+ @param txt Text containing driver and purpose names.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort).
+*/
+static
+int
+dk4gra_conf_driver_purpose(
+ dk4_gra_conf_t *conf,
+ dkChar *txt,
+ dk4_app_t *app
+)
+{
+ dkChar *ppur = NULL;
+ int back = 0;
+ $? "+ dk4gra_conf_driver_purpose \"%!ds\"", TR_STR(txt)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != txt);
+#endif
+ ppur = dk4str_chr(txt, dkT('.'));
+ if (NULL != ppur) {
+ *(ppur++) = dkT('\0');
+ ppur = dk4str_start(ppur, NULL);
+ }
+ conf->driver = dk4str_array_index(dk4gra_conf_driver_names, txt, 0);
+ $? ". driver = %d", conf->driver
+ if (-1 < conf->driver) {
+ back = 1;
+ if (NULL != ppur) {
+ conf->purpose = dk4str_abbr_index(
+ dk4gra_conf_purpose_names, dkT('$'), ppur, 0
+ );
+ $? ". purpose = %d", conf->purpose
+ if (0 > conf->purpose) {
+ back = 0;
+ /* ERROR: Illegal purpose name */
+ dk4gralog_3(app, DK4_LL_ERROR, 27, 28, ppur);
+ }
+ }
+ if (DK4_GRA_DRIVER_PS == conf->driver) {
+ if (DK4_GRA_PURPOSE_DOCUMENT == conf->purpose) {
+ conf->ps_dsc = 1;
+ }
+ }
+ }
+ else {
+ /* ERROR: Illegal driver name */
+ dk4gralog_3(app, DK4_LL_ERROR, 29, 30, txt);
+ }
+ $? "- dk4gra_conf_driver_purpose %d", back
+ return back;
+}
+
+
+
+static
+int
+dk4gra_conf_key_value(
+ dk4_gra_conf_t *conf,
+ dkChar *txt,
+ int cfscope,
+ dk4_app_t *app
+)
+{
+ dkChar *pcur;
+ dkChar *pnext;
+ dkChar *vptr;
+ int back = 1;
+ int res;
+ $? "+ dk4gra_conf_key_value \"%!ds\"", TR_STR(txt)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != txt);
+#endif
+ pcur = txt;
+ while ((0 != back) && (NULL != pcur)) {
+ pnext = dk4str_chr(pcur, dkT(','));
+ if (NULL != pnext) {
+ *(pnext++) = dkT('\0');
+ pnext = dk4str_start(pnext, NULL);
+ }
+ vptr = dk4str_chr(pcur, dkT('='));
+ if (NULL != vptr) {
+ *(vptr++) = dkT('\0');
+ vptr = dk4str_start(vptr, NULL);
+ }
+ res = dk4str_abbr_index(dk4gra_conf_key_names, dkT('$'), pcur, 0);
+ if (-1 < res) {
+ if (0 == (cfscope & dk4gra_conf_key_scopes[res])) {
+ /* Warning: Ignored configuration key */
+ dk4gralog_3(app, DK4_LL_ERROR, 42, 43, pcur);
+ }
+ }
+ switch (res) {
+ case 0 : { /* color */
+ res = dk4gra_conf_bool(&(conf->color), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 1 : { /* alpha */
+ res = dk4gra_conf_alpha_handling(conf, pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 2 : { /* background */
+ res = dk4gra_conf_background(
+ &(conf->img_bg_r), &(conf->img_bg_g), &(conf->img_bg_b),
+ &(conf->img_bg_f), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 3 : { /* force background */
+ res = dk4gra_conf_bool(&(conf->img_bg_f), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 4 : { /* image interpolation */
+ res = dk4gra_conf_bool(&(conf->img_int), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 5 : { /* dct */
+ res = dk4gra_conf_bool(&(conf->img_dct), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 6 : { /* dct interpolation */
+ res = dk4gra_conf_bool(&(conf->img_dct_int), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 7 : { /* analyze bits per component */
+ res = dk4gra_conf_bool(&(conf->img_an_bpc), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 8 : { /* analyze color use */
+ res = dk4gra_conf_bool(&(conf->img_an_color), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 9 : { /* analyze alpha use */
+ res = dk4gra_conf_bool(&(conf->img_an_alpha), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 10 : { /* ignore resolution */
+ res = dk4gra_conf_bool(&(conf->img_ign_res), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 11 : { /* ps language level */
+ res = dk4gra_conf_psll(
+ &(conf->ps_level), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 12 : { /* allow lzw */
+ res = dk4gra_conf_bool(&(conf->ps_lzw), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 13 : { /* paper size */
+ res = dk4gra_conf_paper_size(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 14 : { /* duplex */
+ res = dk4gra_conf_bool(&(conf->doc_duplex), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 15 : { /* tumble */
+ res = dk4gra_conf_bool(&(conf->doc_tumble), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 16 : { /* dsc */
+ res = dk4gra_conf_bool(&(conf->ps_dsc), pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 17 : { /* rgb to gray */
+ res = dk4gra_conf_rgb_to_gray(conf, pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 18 : { /* rgb to cmyk */
+ res = dk4gra_conf_rgb_to_cmyk(conf, pcur, vptr, app);
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 19 : {
+ res = dk4gra_conf_bool(
+ &(conf->img_ign_asp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 20 : {
+ res = dk4gra_conf_bool(
+ &(conf->img_rot), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 21: {
+ res = dk4gra_conf_resolution(
+ conf, pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 22: {
+ res = dk4gra_conf_xsss(
+ conf, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 23 : {
+ res = dk4gra_conf_posdouble(
+ &(conf->xslp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ case 24 : {
+ res = dk4gra_conf_posdouble(
+ &(conf->xspp), pcur, vptr, app
+ );
+ if (0 == res) {
+ back = 0;
+ }
+ } break;
+ default : {
+ /* ERROR: Unknown key */
+ dk4gralog_3(app, DK4_LL_ERROR, 31, 32, pcur);
+ back = 0;
+ } break;
+ }
+ pcur = pnext;
+ }
+ $? "- dk4gra_conf_key_value %d", back
+ return back;
+}
+
+
+
+/** Process configuration string.
+ @param conf Configuration structure to set up.
+ @param txt Writable copy of configuration string.
+ @param usecfg Flag: Process configuration files after finding
+ driver and purpose.
+ @param cfscope Configuration scope.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (continue processing), 0 on error (abort program).
+*/
+static
+int
+dk4gra_conf_setup_txt(
+ dk4_gra_conf_t *conf,
+ dkChar *txt,
+ int usecfg,
+ int cfscope,
+ dk4_app_t *app
+)
+{
+ dkChar *pcur;
+ dkChar *pnext;
+ int back = 1;
+ $? "+ dk4gra_conf_setup_txt \"%!ds\"", TR_PTR(txt)
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+ assert(NULL != txt);
+#endif
+ pcur = dk4str_start(txt, NULL);
+ if (NULL != pcur) {
+ pnext = dk4str_chr(pcur, dkT(','));
+ if (NULL != pnext) {
+ *(pnext++) = dkT('\0');
+ pnext = dk4str_start(pnext, NULL);
+ }
+ back = dk4gra_conf_driver_purpose(conf, pcur, app);
+ if (0 != back) {
+ if (0 != usecfg) {
+ back = dk4gra_conf_setup_cfgfiles(conf, app);
+ }
+ if (0 != back) {
+ back = dk4gra_conf_key_value(conf, pnext, cfscope, app);
+ }
+ }
+ }
+ else {
+ /* Warning: Empty configuration string */
+ }
+ $? "- dk4gra_conf_setup_txt %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_conf_setup(
+ dk4_gra_conf_t *conf,
+ dkChar const *txt,
+ int usecfg,
+ int cfscope,
+ dk4_app_t *app
+)
+{
+ dkChar *mycopy;
+ int back = 0;
+ $? "+ dk4gra_conf_setup"
+#if DK4_USE_ASSERT
+ assert(NULL != conf);
+#endif
+ if (NULL != conf) {
+ if ((NULL != txt) || (0 != usecfg)) {
+ if (NULL != txt) {
+ mycopy = dk4str_dup_app(txt, app);
+ if (NULL != mycopy) {
+ back = dk4gra_conf_setup_txt(
+ conf, mycopy, usecfg, cfscope, app
+ );
+ dk4mem_free(mycopy);
+ }
+ }
+ else {
+ back = dk4gra_conf_setup_cfgfiles(conf, app);
+ }
+ }
+ if (DK4_GRA_PURPOSE_DOCUMENT == conf->purpose) {
+ switch (conf->driver) {
+ case DK4_GRA_DRIVER_PDF :
+ case DK4_GRA_DRIVER_PS :
+ case DK4_GRA_DRIVER_PGF : {
+ /* Empty by intent */
+ } break;
+ default : {
+ /* ERROR: Driver/purpose combination no allowd */
+ back = 1;
+ dk4gralog_1(app, DK4_LL_ERROR, 47);
+ } break;
+ }
+ }
+ }
+ $? "- dk4gra_conf_setup %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grcoa.h b/support/dktools/dk4grcoa.h
new file mode 100644
index 0000000000..6c995e032d
--- /dev/null
+++ b/support/dktools/dk4grcoa.h
@@ -0,0 +1,80 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grcoa.ctr
+*/
+
+#ifndef DK4GRCOA_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4GRCOA_H_INCLUDED 1
+
+
+#line 8 "dk4grcoa.ctr"
+
+/** @file dk4grcoa.h Graphics configuration with application support.
+*/
+
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+#ifndef DK4GRCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4grco.h"
+#else
+#include <dktools-4/dk4grco.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Set up graphics configuration from text string and/or configuration file(s).
+ @param conf Configuration structure to set up.
+ @param txt Text containing information, may be NULL.
+ @param usecfg Flag: Process configuration file.
+ @param cfscope Configuration scopes allowed in txt.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success (program can continue), 0 on error (abort program).
+*/
+
+int
+dk4gra_conf_setup(
+ dk4_gra_conf_t *conf,
+ dkChar const *txt,
+ int usecfg,
+ int cfscope,
+ dk4_app_t *app
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/dk4grepi.c b/support/dktools/dk4grepi.c
new file mode 100644
index 0000000000..73d374a0df
--- /dev/null
+++ b/support/dktools/dk4grepi.c
@@ -0,0 +1,1273 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grepi.ctr
+*/
+
+/** @file dk4grepi.c The dk4grepi module.
+*/
+
+
+#line 9 "dk4grepi.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STRMCO_H_INCLUDED
+#include "dk4strmco.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4BIFA_H_INCLUDED
+#include "dk4bifa.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#ifndef DK4FOPT_H_INCLUDED
+#include "dk4fopt.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4BITSH_H_INCLUDED
+#include "dk4bitsh.h"
+#endif
+
+#ifndef DK4EDSTM_H_INCLUDED
+#include "dk4edstm.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 89 "dk4grepi.ctr"
+
+
+
+/*
+ FOR DEBUGGING ONLY!
+ The FORCE_... constants are for debugging purposes only.
+ They must be disabled in release versions.
+*/
+
+#ifdef FORCE_COE
+#undef FORCE_COE
+#endif
+
+/** Set to 1 to force a specific compression/encoding combination.
+ Note: You can not use DK4_GRA_COE_DCT_ASCII85
+*/
+#define FORCE_COE 0
+
+#ifndef FORCED_COE
+/** Compression/encoding combination to enforce.
+*/
+#define FORCED_COE DK4_GRA_COE_FLATE_ASCII85
+#endif
+
+#ifdef FORCE_CS
+#undef FORCE_CS
+#endif
+/** Set to 1 to force a specific color space.
+ Note: You can only use DK4_CS_GRAY, DK4_CS_RGB and DK4_CS_CMYK.
+*/
+#define FORCE_CS 0
+
+#ifndef FORCED_CS
+/** Color space to enforce.
+*/
+#define FORCED_CS DK4_CS_CMYK
+#endif
+
+#ifdef FORCE_BPC
+#undef FORCE_BPC
+#endif
+/** Set to 1 to force a specific bits per component number.
+ Note: The number must be one from 1, 2, 4, 8, 12.
+*/
+#define FORCE_BPC 0
+
+#ifndef FORCED_BPC
+/** Bits per component number to enforce.
+*/
+#define FORCED_BPC 8
+#endif
+
+
+
+/** Constant text fragments used in this module.
+*/
+static const char * const dk4gra_eps_c8_kw[] = {
+/* 0 */
+"\n",
+
+/* 1 */
+"{\n",
+
+/* 2 */
+"} exec\n",
+
+/* 3 */
+"gsave\n",
+
+/* 4 */
+"grestore\n",
+
+/* 5 */
+"showpage\n",
+
+/* 6 */
+" ",
+
+/* 7 */
+" translate\n",
+
+/* 8 */
+" rotate\n",
+
+/* 9 */
+" scale\n",
+
+/* 10 */
+"15 dict begin\n",
+
+/* 11 */
+"end\n",
+
+/* 12 */
+"/DeviceRGB setcolorspace\n",
+
+/* 13 */
+"/DeviceGray setcolorspace\n",
+
+/* 14 */
+"/DeviceCMYK setcolorspace\n",
+
+/* 15 */
+"/fa currentfile /ASCII85Decode filter def\n",
+
+/* 16 */
+"/fb fa /FlateDecode filter def\n",
+
+/* 17 */
+"/fb fa /LZWDecode filter def\n",
+
+/* 18 */
+"/fb fa /RunLengthDecode filter def\n",
+
+/* 19 */
+"/fb fa << >> /DCTDecode filter def\n",
+
+/* 20 */
+"fb closefile\n",
+
+/* 21 */
+"fa flushfile fa closefile\n",
+
+/* 22 */
+"<<\n",
+
+/* 23 */
+">>\n",
+
+/* 24 */
+"/ImageType 1\n",
+
+/* 25 */
+"/Width ",
+
+/* 26 */
+"/Height ",
+
+/* 27 */
+"/BitsPerComponent ",
+
+/* 28 */
+"/ImageMatrix [",
+
+/* 29 */
+" 0 0 -",
+
+/* 30 */
+" 0 ",
+
+/* 31 */
+"]\n",
+
+/* 32 */
+"/MultipleDataSources false\n",
+
+/* 33 */
+"/MultipleDataSources true\n",
+
+/* 34 */
+"/DataSource [\n",
+
+/* 35 */
+"{ fb sr readstring pop }\n",
+
+/* 36 */
+"{ fb sg readstring pop }\n",
+
+/* 37 */
+"{ fb sb readstring pop }\n",
+
+/* 38 */
+"{ fb sk readstring pop }\n",
+
+/* 39 */
+"]\n",
+
+/* 40 */
+"/sr ",
+
+/* 41 */
+"/sg ",
+
+/* 42 */
+"/sb ",
+
+/* 43 */
+"/sk ",
+
+/* 44 */
+" string def\n",
+
+/* 45 */
+"/DataSource fb\n",
+
+/* 46 */
+"/DataSource fa\n",
+
+/* 47 */
+"/Decode [0 1]\n",
+
+/* 48 */
+"/Decode [1 0]\n",
+
+/* 49 */
+"/Decode [0 1 0 1 0 1]\n",
+
+/* 50 */
+"/Decode [1 0 1 0 1 0]\n",
+
+/* 51 */
+"/Decode [0 1 0 1 0 1 0 1]\n",
+
+/* 52 */
+"/Decode [1 0 1 0 1 0 1 0]\n",
+
+/* 53 */
+"image\n",
+
+/* 54 */
+"/Interpolate true\n",
+
+NULL
+
+
+#line 278 "dk4grepi.ctr"
+};
+
+
+
+/** Write keyword to stream, reset a result variable on error.
+ @param os Output stream to write to.
+ @param kwi Index of keyword in dk4gra_eps_c8_kw array.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_eps_put_kw(
+ dk4_stream_t *os,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ if (0 == dk4stream_write_char_string(os, dk4gra_eps_c8_kw[kwi], erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** Put double value to stream, no scientific notation.
+ On error reset a success variable.
+ @param os Output stream.
+ @param val Value to write.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_eps_put_dbl(
+ dk4_stream_t *os,
+ double val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ if (
+ 0 ==
+ dk4ma_write_c8_double_no_sci_to_stream(
+ os, val, DK4_GRA_EPSILON_COORDINATES, 0, 1, erp
+ )
+ )
+ {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** Write unsigned integer number to stream, reset a success variable on error.
+ @param os Output stream to write to.
+ @param val Value to write.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_eps_put_uim(
+ dk4_stream_t *os,
+ dk4_um_t val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ char buf[16*sizeof(dk4_um_t)]; /* Buffer to construct string */
+
+ if (0 != dk4ma_write_c8_decimal_unsigned(buf, sizeof(buf), val, 0, erp)) {
+ if (0 == dk4stream_write_char_string(os, buf, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** Write procedure before writing data.
+ @param gra Graphics output structure.
+ @param os Output stream for current page.
+ @param cotra Transformation (xshift, yshift, rotation, xscale, yscale).
+ @param bif Bitmap image.
+ @param cs Color space corrected to supported color space.
+ @param bpc Bits per component.
+ @param deci Flag: Decoding inverted.
+ @param ipol Flag: Interpolation.
+ @param spip Flag: Write showpage operator in procedure.
+ @param coe Compression and encoding:
+ - 0: DCT + ASCII85,
+ - 1: Flate + ASCII85,
+ - 2: LZW + ASCII85,
+ - 3: Run-length + ASCII85,
+ - 4: Pure ASCII85.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+dk4gra_eps_write_procedure(
+ dk4_gra_t *gra,
+ dk4_stream_t *os,
+ double *cotra,
+ dk4_bif_t const *bif,
+ int cs,
+ dk4_px_bit_depth_t bpc,
+ int deci,
+ int ipol,
+ int spip,
+ int coe,
+ dk4_er_t *erp
+)
+{
+ size_t w = 0; /* Image width */
+ size_t h = 0; /* Image height */
+ dk4_um_t bn = 0; /* Byte number for run-length compression */
+ int back = 1; /* Function result */
+
+ w = dk4bif_get_width(bif);
+ h = dk4bif_get_height(bif);
+ bn = (w * bpc) / 8;
+ if (0 != ((w * bpc) % 8)) {
+ bn++;
+ }
+
+ /* { */
+ dk4gra_eps_put_kw(os, 1, &back, erp);
+
+ /* gsave */
+ dk4gra_eps_put_kw(os, 3, &back, erp);
+
+ /* ... ... translate */
+ if (
+ (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[0]))
+ || (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[1]))
+ ) {
+ dk4gra_eps_put_dbl(os, cotra[0], &back, erp);
+ dk4gra_eps_put_kw(os, 6, &back, erp);
+ dk4gra_eps_put_dbl(os, cotra[1], &back, erp);
+ dk4gra_eps_put_kw(os, 7, &back, erp);
+ }
+
+ /* ... rotate */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[2])) {
+ dk4gra_eps_put_dbl(os, cotra[2], &back, erp);
+ dk4gra_eps_put_kw(os, 8, &back, erp);
+ }
+
+ /* ... ... scale */
+ dk4gra_eps_put_dbl(os, cotra[3], &back, erp);
+ dk4gra_eps_put_kw(os, 6, &back, erp);
+ dk4gra_eps_put_dbl(os, cotra[4], &back, erp);
+ dk4gra_eps_put_kw(os, 9, &back, erp);
+
+ /* 13 dict begin */
+ dk4gra_eps_put_kw(os, 10, &back, erp);
+
+ /* ... setcolorspace */
+ switch (cs) {
+ case DK4_CS_GRAY : {
+ dk4gra_eps_put_kw(os, 13, &back, erp);
+ } break;
+ case DK4_CS_CMYK : {
+ dk4gra_eps_put_kw(os, 14, &back, erp);
+ } break;
+ default : {
+ dk4gra_eps_put_kw(os, 12, &back, erp);
+ } break;
+ }
+
+ /* ... filter def ... */
+ switch (coe) {
+ case DK4_GRA_COE_ASCII85 : { /* ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ } break;
+ case DK4_GRA_COE_RUNLENGTH_ASCII85 : { /* Run-length ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ dk4gra_eps_put_kw(os, 18, &back, erp);
+ } break;
+ case DK4_GRA_COE_LZW_ASCII85 : { /* LZW ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ dk4gra_eps_put_kw(os, 17, &back, erp);
+ } break;
+ case DK4_GRA_COE_FLATE_ASCII85 : { /* Flate ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ dk4gra_eps_put_kw(os, 16, &back, erp);
+ } break;
+ default: { /* DCT ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ dk4gra_eps_put_kw(os, 19, &back, erp);
+ } break;
+ }
+ if (DK4_GRA_COE_RUNLENGTH_ASCII85 == coe) {
+ if (DK4_CS_GRAY != cs) {
+ switch (cs) {
+ case DK4_CS_CMYK : {
+ dk4gra_eps_put_kw(os, 40, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 41, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 42, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 43, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ } break;
+ default : {
+ dk4gra_eps_put_kw(os, 40, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 41, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 42, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ } break;
+ }
+ }
+ }
+
+ /* << */
+ dk4gra_eps_put_kw(os, 22, &back, erp);
+
+ /* /ImageType 1 */
+ dk4gra_eps_put_kw(os, 24, &back, erp);
+
+ /* /Width ... */
+ dk4gra_eps_put_kw(os, 25, &back, erp);
+ dk4gra_eps_put_uim(os, w, &back, erp);
+ dk4gra_eps_put_kw(os, 0, &back, erp);
+
+ /* /Height ... */
+ dk4gra_eps_put_kw(os, 26, &back, erp);
+ dk4gra_eps_put_uim(os, h, &back, erp);
+ dk4gra_eps_put_kw(os, 0, &back, erp);
+
+ /* ImageMatrix */
+ dk4gra_eps_put_kw(os, 28, &back, erp);
+ dk4gra_eps_put_uim(os, w, &back, erp);
+ dk4gra_eps_put_kw(os, 29, &back, erp);
+ dk4gra_eps_put_uim(os, h, &back, erp);
+ dk4gra_eps_put_kw(os, 30, &back, erp);
+ dk4gra_eps_put_uim(os, h, &back, erp);
+ dk4gra_eps_put_kw(os, 31, &back, erp);
+
+ /* BitsPerComponent */
+ dk4gra_eps_put_kw(os, 27, &back, erp);
+ dk4gra_eps_put_uim(os, bpc, &back, erp);
+ dk4gra_eps_put_kw(os, 0, &back, erp);
+
+ /* MultipleDataSources */
+ if (DK4_GRA_COE_RUNLENGTH_ASCII85 == coe) {
+ if (DK4_CS_GRAY == cs) {
+ dk4gra_eps_put_kw(os, 32, &back, erp);
+ }
+ else {
+ dk4gra_eps_put_kw(os, 33, &back, erp);
+ }
+ }
+ else {
+ dk4gra_eps_put_kw(os, 32, &back, erp);
+ }
+
+ /* DataSource */
+ if (DK4_GRA_COE_RUNLENGTH_ASCII85 == coe) {
+ if (DK4_CS_GRAY == cs) {
+ dk4gra_eps_put_kw(os, 45, &back, erp);
+ }
+ else {
+ dk4gra_eps_put_kw(os, 34, &back, erp);
+ dk4gra_eps_put_kw(os, 35, &back, erp);
+ dk4gra_eps_put_kw(os, 36, &back, erp);
+ dk4gra_eps_put_kw(os, 37, &back, erp);
+ if (DK4_CS_CMYK == cs) {
+ dk4gra_eps_put_kw(os, 38, &back, erp);
+ }
+ dk4gra_eps_put_kw(os, 39, &back, erp);
+ }
+ }
+ else {
+ if (DK4_GRA_COE_ASCII85 == coe) {
+ dk4gra_eps_put_kw(os, 46, &back, erp);
+ }
+ else {
+ dk4gra_eps_put_kw(os, 45, &back, erp);
+ }
+ }
+
+ /* Decode */
+ switch (cs) {
+ case DK4_CS_GRAY : {
+ dk4gra_eps_put_kw(os, ((0 != deci) ? (48) : (47)), &back, erp);
+ } break;
+ case DK4_CS_CMYK : {
+ dk4gra_eps_put_kw(os, ((0 != deci) ? (52) : (51)), &back, erp);
+ } break;
+ default : {
+ dk4gra_eps_put_kw(os, ((0 != deci) ? (50) : (49)), &back, erp);
+ } break;
+ }
+
+ /* Interpolate */
+ if (0 != ipol) {
+ dk4gra_eps_put_kw(os, 54, &back, erp);
+ }
+
+ /* >> */
+ dk4gra_eps_put_kw(os, 23, &back, erp);
+
+ /* image */
+ dk4gra_eps_put_kw(os, 53, &back, erp);
+
+ /* ... closefile ... */
+ if (DK4_GRA_COE_ASCII85 != coe) {
+ dk4gra_eps_put_kw(os, 20, &back, erp);
+ }
+ dk4gra_eps_put_kw(os, 21, &back, erp);
+
+ /* end */
+ dk4gra_eps_put_kw(os, 11, &back, erp);
+
+ /* grestore */
+ dk4gra_eps_put_kw(os, 4, &back, erp);
+
+ /* showpage */
+ if ((DK4_GRA_DRIVER_EPS != gra->dr) && (0 != spip)) {
+ dk4gra_eps_put_kw(os, 5, &back, erp);
+ }
+
+ /* } exec */
+ dk4gra_eps_put_kw(os, 2, &back, erp);
+
+ return back;
+}
+
+
+
+/** Re-use DCT encoded data from JPEG file directly.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param cotra Coordinates transformation values.
+ @param bif Bitmap image.
+ @param cs Color space correted to supported color space
+ @param fn Bitmap image file name.
+ @param ipol Flag: Interpolation.
+ @param spip Flag: Use showpage in procedure.
+ @param ijpg Flag: Interpolation for JPEGs too.
+ @param erp Error report, may be NULL.
+*/
+
+static
+int
+dk4gra_eps_jpg_bif_fig_image(
+ dk4_gra_t *gra,
+ dk4_gra_ps_page_t *bptr,
+ double *cotra,
+ dk4_bif_t const *bif,
+ int cs,
+ const dkChar *fn,
+ int ipol,
+ int spip,
+ int ijpg,
+ dk4_er_t *erp
+)
+{
+ char b1[256]; /* Default buffer */
+ FILE *infile = NULL; /* Input file */
+ dk4_stream_t *ostrm = NULL; /* Output stream, ASCII85 encoding */
+ char *bufptr = b1; /* Buffer to use */
+ char *mybuf = NULL; /* Allocated buffer */
+ dk4_bif_jpeg_per_frame_t *pjpgf;
+ size_t szbuf = sizeof(b1); /* Size of buffer to use */
+ size_t rdb = 0; /* Number of bytes read in pass */
+ int back = 0; /* Function result */
+ int deci = 0; /* Flag: Invert Decode values */
+ int fotest = DK4_FOPEN_SC_USER; /* Test for files */
+ dk4_px_bit_depth_t bpc = 8; /* Number of bits per component */
+
+
+#line 667 "dk4grepi.ctr"
+ /*
+ */
+ if (0 != dk4isadmin()) { fotest = DK4_FOPEN_SC_PRIVILEGED; }
+ infile = dk4fopen(fn, dkT("rb"), fotest, erp);
+ if (NULL == infile) {
+ goto finished;
+ }
+ /* Allocate memory for buffer
+ */
+ mybuf = (char *)malloc(4096);
+ if (NULL != mybuf) {
+ bufptr = mybuf; szbuf = 4096;
+ }
+ /* Open output encoding stream for ASCII85
+ */
+ ostrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_NONE, DK4_STRMCO_OE_ASCII85,
+ (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
+ erp
+ );
+ if (NULL == ostrm) {
+ goto finished;
+ }
+ pjpgf = (dk4_bif_jpeg_per_frame_t *)(bif->cf->tsdata);
+ if (NULL != pjpgf) {
+ if ((DK4_CS_CMYK == cs) && (0 != pjpgf->is_adobe)) {
+ deci = 1;
+ }
+ }
+ /* Ressources allocated successfully
+ */
+ bpc = dk4bif_get_original_bit_depth(bif);
+ back = dk4gra_eps_write_procedure(
+ gra, bptr->memstrm, cotra, bif, cs, bpc, deci,
+ (((0 != ipol) && (0 != ijpg)) ? (1) : (0)),
+ spip, 0, erp
+ );
+ /* Copy file contents
+ */
+ do {
+ rdb = fread(bufptr, 1, szbuf, infile);
+ if (0 < rdb) {
+ if (0 == dk4stream_write(ostrm, bufptr, rdb, erp)) {
+ back = 0;
+ }
+ }
+ } while (0 < rdb);
+
+ /* Clean up and return
+ */
+ finished:
+ if (NULL != ostrm) {
+ if (0 == dk4stream_close(ostrm, erp)) {
+ back = 0;
+ }
+ }
+ if (NULL != mybuf) {
+ dk4mem_free(mybuf);
+ }
+ if (NULL != infile) {
+ fclose(infile);
+ }
+
+
+#line 731 "dk4grepi.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ int ifl,
+ dk4_er_t *erp
+)
+{
+ dk4_px_t pix[8]; /* Pixel components */
+ dk4_bit_shift_t bs; /* Bit shifter */
+ dk4_gra_ps_page_t *bptr = NULL; /* Current page */
+ dk4_stream_t *costrm = NULL; /* Compressed+encoded output stream */
+ dk4_um_t nby = 0; /* Number of bytes per line */
+ size_t szpix = sizeof(pix) / sizeof(dk4_px_t);
+ size_t h = 0; /* Image height */
+ size_t w = 0; /* Image width */
+ size_t x = 0; /* Current column position */
+ size_t y = 0; /* Current row position */
+ size_t nco = 3; /* Number of components */
+ size_t i = 0; /* Traverse pixel components */
+ int back = 0; /* Function result */
+ int cs = DK4_CS_RGB; /* Color space */
+ int coe = DK4_GRA_COE_FLATE_ASCII85;
+ dk4_px_bit_depth_t bpc = 8; /* Number of bits per component */
+
+
+#line 763 "dk4grepi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != cotra);
+ assert(NULL != bif);
+ assert(NULL != fn);
+#endif
+ /* Check arguments
+ */
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if (NULL == bptr) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 != (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)) {
+ if (0 != bptr->cont) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->spip = 1;
+ }
+ /* File name is required to re-use DCT encoded data directly
+ */
+ if (NULL == fn) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ /* Retrieve color space
+ */
+ if (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ if (DK4_CS_GRAY != dk4bif_get_color_space(bif)) {
+ if (DK4_CS_GRAY_ALPHA != dk4bif_get_color_space(bif)) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ cs = dk4bif_get_color_space(bif);
+#if TRACE_DEBUG
+
+
+#line 804 "dk4grepi.ctr"
+ switch (cs) {
+ case DK4_CS_CMYK : {
+
+#line 806 "dk4grepi.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+
+#line 808 "dk4grepi.ctr"
+ } break;
+ case DK4_CS_RGB : {
+
+#line 810 "dk4grepi.ctr"
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+#line 812 "dk4grepi.ctr"
+ } break;
+ case DK4_CS_GRAY : {
+
+#line 814 "dk4grepi.ctr"
+ } break;
+ }
+#endif
+ /*
+ Re-use DCT encoded data from JPEG directly, if possible
+ */
+
+
+#line 821 "dk4grepi.ctr"
+ if ((DK4_CS_GRAY == cs) || (DK4_CS_RGB == cs) || (DK4_CS_CMYK == cs)) {
+ if (
+ (DK4_BIF_TYPE_JPEG == bif->imgtype)
+ && (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ ) {
+ back = dk4gra_eps_jpg_bif_fig_image(
+ gra, bptr, cotra, bif, cs, fn,
+ ((0 != (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)) ? (1) :(0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)) ? 1 : 0),
+ ((0 != (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)) ? (1) : (0)),
+ erp
+ );
+
+#line 833 "dk4grepi.ctr"
+ goto finished;
+ }
+ }
+
+
+#line 837 "dk4grepi.ctr"
+ /* Correct color space to supported color space
+ */
+ if (DK4_CS_GRAY_ALPHA == cs) {
+
+#line 840 "dk4grepi.ctr"
+ cs = DK4_CS_GRAY;
+
+#line 841 "dk4grepi.ctr"
+ }
+ if (DK4_CS_RGB_ALPHA == cs) {
+
+#line 843 "dk4grepi.ctr"
+ cs = DK4_CS_RGB;
+
+#line 844 "dk4grepi.ctr"
+ }
+ /* Skip processing for unsupported color spaces
+ */
+ if (DK4_CS_GRAY != cs) {
+ if (DK4_CS_RGB != cs) {
+ if (DK4_CS_CMYK != cs) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ }
+ w = dk4bif_get_width(bif);
+ h = dk4bif_get_height(bif);
+ bpc = dk4bif_get_original_bit_depth(bif);
+ nby = ((dk4_um_t)w * (dk4_um_t)bpc) / (dk4_um_t)8UL;
+
+
+#line 860 "dk4grepi.ctr"
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl))
+ || (0 != (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl))
+ ) {
+ (void)dk4bif_analyze(
+ &cs, &bpc, bif,
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)) ? (1) : (0)),
+ 0, erp
+ );
+ }
+
+
+#line 872 "dk4grepi.ctr"
+
+
+#line 873 "dk4grepi.ctr"
+ /* Correct color space to supported color space
+ */
+ if (DK4_CS_GRAY_ALPHA == cs) {
+
+#line 876 "dk4grepi.ctr"
+ cs = DK4_CS_GRAY;
+
+#line 877 "dk4grepi.ctr"
+ }
+ if (DK4_CS_RGB_ALPHA == cs) {
+
+#line 879 "dk4grepi.ctr"
+ cs = DK4_CS_RGB;
+
+#line 880 "dk4grepi.ctr"
+ }
+
+
+#line 882 "dk4grepi.ctr"
+
+
+#line 883 "dk4grepi.ctr"
+ if (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ switch (cs) {
+ case DK4_CS_RGB : case DK4_CS_CMYK : {
+ cs = DK4_CS_GRAY;
+ } break;
+ }
+ }
+
+
+#line 891 "dk4grepi.ctr"
+ /* Skip processing for unsupported color spaces
+ */
+ if (DK4_CS_GRAY != cs) {
+ if (DK4_CS_RGB != cs) {
+ if (DK4_CS_CMYK != cs) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ }
+ if (12 < bpc) {
+
+#line 902 "dk4grepi.ctr"
+ bpc = 12;
+ }
+
+
+#line 905 "dk4grepi.ctr"
+ if ((dk4_um_t)0UL != (((dk4_um_t)w * (dk4_um_t)bpc) % (dk4_um_t)8UL)) {
+ nby++;
+ }
+
+#if FORCE_CS
+
+
+#line 911 "dk4grepi.ctr"
+ cs = FORCED_CS;
+#endif
+#if FORCE_BPC
+
+
+#line 915 "dk4grepi.ctr"
+ bpc = FORCED_BPC;
+#endif
+
+ nco = 3;
+ switch (cs) {
+ case DK4_CS_GRAY : { nco = 1; }; break;
+ case DK4_CS_CMYK : { nco = 4; }; break;
+ }
+ if (3 != gra->out.ps.llev) {
+ if (0 != (DK4_GRA_IMG_FLAG_LZW & ifl)) {
+ coe = DK4_GRA_COE_LZW_ASCII85;
+ }
+ else {
+ coe = DK4_GRA_COE_ASCII85; /* or 3 for run-length */
+ if ((DK4_CS_GRAY == cs) || ((dk4_um_t)16384UL > nby)) {
+ coe = DK4_GRA_COE_RUNLENGTH_ASCII85;
+ }
+ }
+ }
+
+#if FORCE_COE
+
+
+#line 937 "dk4grepi.ctr"
+ coe = FORCED_COE;
+#endif
+
+ switch (coe) {
+ case DK4_GRA_COE_DCT_ASCII85 : { /* DCT ASCII85 */
+
+#line 942 "dk4grepi.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ } break;
+ case DK4_GRA_COE_LZW_ASCII85 : { /* LZW ASCII85 */
+ costrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_NONE,
+ DK4_STRMCO_CO_LZW,
+ DK4_STRMCO_OE_ASCII85,
+ (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
+ erp
+ );
+ } break;
+ case DK4_GRA_COE_RUNLENGTH_ASCII85 : { /* Run-length ASCII85 */
+ costrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_RUNLENGTH,
+ DK4_STRMCO_CO_NONE,
+ DK4_STRMCO_OE_ASCII85,
+ (
+ DK4_STRMCO_FL_EOD_OE
+ | DK4_STRMCO_FL_EOD_PP
+ | DK4_STRMCO_FL_NL_OE
+ ),
+ erp
+ );
+ } break;
+ case DK4_GRA_COE_ASCII85 : { /* Pure ASCII85 */
+ costrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_NONE,
+ DK4_STRMCO_CO_NONE,
+ DK4_STRMCO_OE_ASCII85,
+ (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
+ erp
+ );
+ } break;
+ default: { /* Flate ASCII85 */
+ costrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_NONE,
+ DK4_STRMCO_CO_FLATE,
+ DK4_STRMCO_OE_ASCII85,
+ (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
+ erp
+ );
+ } break;
+ }
+ if (NULL == costrm) {
+ goto finished;
+ }
+
+
+ back = dk4gra_eps_write_procedure(
+ gra, bptr->memstrm, cotra, bif, cs, bpc, 0,
+ ((0 != (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)) ? (1) : (0)),
+ coe, erp
+ );
+
+#line 1000 "dk4grepi.ctr"
+
+ dk4bif_set_output_bit_depth(bif, bpc);
+ if (8 == bpc) {
+
+#line 1003 "dk4grepi.ctr"
+ if ((3 == coe) && (DK4_CS_GRAY != cs)) {
+ for (y = 0; y < h; y++) {
+ for (i = 0; i < nco; i++) {
+ for (x = 0; x < w; x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, szpix, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, cs
+ )
+ ) {
+ back = 0;
+
+#line 1014 "dk4grepi.ctr"
+ }
+
+#line 1015 "dk4grepi.ctr"
+ if (0 == dk4stream_write_byte(costrm, (char)(pix[i]), erp)) {
+ back = 0;
+
+#line 1017 "dk4grepi.ctr"
+ }
+ }
+ }
+ }
+ }
+ else {
+ for (y = 0; y < h; y++) {
+ for (x = 0; x < w; x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, szpix, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, cs
+ )
+ ) {
+ back = 0;
+ }
+ for (i = 0; i < nco; i++) {
+#if 0
+
+
+#line 1036 "dk4grepi.ctr"
+#endif
+ if (0 == dk4stream_write_byte(costrm, (char)(pix[i]), erp)) {
+ back = 0;
+
+#line 1039 "dk4grepi.ctr"
+ }
+ }
+ }
+ }
+ }
+ }
+ else {
+
+#line 1046 "dk4grepi.ctr"
+ if ((3 == coe) && (DK4_CS_GRAY != cs)) {
+ for (y = 0; y < h; y++) {
+ for (i = 0; i < nco; i++) {
+
+ dk4bit_shift_init(&bs, NULL);
+ for (x = 0; x < w; x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, szpix, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, cs
+ )
+ ) {
+ back = 0;
+
+#line 1059 "dk4grepi.ctr"
+ }
+
+
+#line 1061 "dk4grepi.ctr"
+ dk4gratool_put_pixel_value(
+ costrm, &bs, pix[i], bpc, &back, erp
+ );
+
+
+#line 1065 "dk4grepi.ctr"
+ }
+ if (DK4_EDSTM_FINISHED == dk4bit_shift_finish(&bs, NULL)) {
+ if (0 == dk4stream_write_byte(
+ costrm, dk4bit_shift_output(&bs, NULL), erp
+ )
+ ) {
+ back = 0;
+
+#line 1072 "dk4grepi.ctr"
+ }
+ }
+
+ }
+ }
+ }
+ else {
+ for (y = 0; y < h; y++) {
+ dk4bit_shift_init(&bs, NULL);
+ for (x = 0; x < w; x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, szpix, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, cs
+ )
+ ) {
+ back = 0;
+
+#line 1089 "dk4grepi.ctr"
+ }
+ for (i = 0; i < nco; i++) {
+
+
+#line 1092 "dk4grepi.ctr"
+ dk4gratool_put_pixel_value(
+ costrm, &bs, pix[i], bpc, &back, erp
+ );
+
+
+#line 1096 "dk4grepi.ctr"
+ }
+ }
+ if (DK4_EDSTM_FINISHED == dk4bit_shift_finish(&bs, NULL)) {
+ if (0 == dk4stream_write_byte(
+ costrm, dk4bit_shift_output(&bs, NULL), erp
+ )
+ ) {
+ back = 0;
+
+#line 1104 "dk4grepi.ctr"
+ }
+ }
+ }
+ }
+ }
+
+ /* Cleanup
+ */
+ finished:
+ if (NULL != costrm) {
+ if (0 == dk4stream_close(costrm, erp)) {
+ back = 0;
+
+#line 1116 "dk4grepi.ctr"
+ }
+ }
+
+
+#line 1119 "dk4grepi.ctr"
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grepi.ctr b/support/dktools/dk4grepi.ctr
new file mode 100644
index 0000000000..4b961a4402
--- /dev/null
+++ b/support/dktools/dk4grepi.ctr
@@ -0,0 +1,1124 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STRMCO_H_INCLUDED
+#include "dk4strmco.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4BIFA_H_INCLUDED
+#include "dk4bifa.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#ifndef DK4FOPT_H_INCLUDED
+#include "dk4fopt.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4BITSH_H_INCLUDED
+#include "dk4bitsh.h"
+#endif
+
+#ifndef DK4EDSTM_H_INCLUDED
+#include "dk4edstm.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/*
+ FOR DEBUGGING ONLY!
+ The FORCE_... constants are for debugging purposes only.
+ They must be disabled in release versions.
+*/
+
+#ifdef FORCE_COE
+#undef FORCE_COE
+#endif
+
+/** Set to 1 to force a specific compression/encoding combination.
+ Note: You can not use DK4_GRA_COE_DCT_ASCII85
+*/
+#define FORCE_COE 0
+
+#ifndef FORCED_COE
+/** Compression/encoding combination to enforce.
+*/
+#define FORCED_COE DK4_GRA_COE_FLATE_ASCII85
+#endif
+
+#ifdef FORCE_CS
+#undef FORCE_CS
+#endif
+/** Set to 1 to force a specific color space.
+ Note: You can only use DK4_CS_GRAY, DK4_CS_RGB and DK4_CS_CMYK.
+*/
+#define FORCE_CS 0
+
+#ifndef FORCED_CS
+/** Color space to enforce.
+*/
+#define FORCED_CS DK4_CS_CMYK
+#endif
+
+#ifdef FORCE_BPC
+#undef FORCE_BPC
+#endif
+/** Set to 1 to force a specific bits per component number.
+ Note: The number must be one from 1, 2, 4, 8, 12.
+*/
+#define FORCE_BPC 0
+
+#ifndef FORCED_BPC
+/** Bits per component number to enforce.
+*/
+#define FORCED_BPC 8
+#endif
+
+
+
+/** Constant text fragments used in this module.
+*/
+static const char * const dk4gra_eps_c8_kw[] = {
+$!string-table
+#
+# 0
+#
+\n
+#
+# 1
+#
+{\n
+#
+# 2
+#
+} exec\n
+#
+# 3 4 5
+#
+gsave\n
+grestore\n
+showpage\n
+#
+# 6 space
+#
+
+#
+# 7 translate
+#
+ translate\n
+#
+# 8 rotate
+#
+ rotate\n
+#
+# 9 scale
+#
+ scale\n
+#
+# 10 11 15 dict begin end
+#
+15 dict begin\n
+end\n
+#
+# 12 13 14 color spaces
+#
+/DeviceRGB setcolorspace\n
+/DeviceGray setcolorspace\n
+/DeviceCMYK setcolorspace\n
+#
+# 15...19 decoding filters
+#
+/fa currentfile /ASCII85Decode filter def\n
+/fb fa /FlateDecode filter def\n
+/fb fa /LZWDecode filter def\n
+/fb fa /RunLengthDecode filter def\n
+/fb fa << >> /DCTDecode filter def\n
+#
+# 20 21 close files.
+#
+fb closefile\n
+fa flushfile fa closefile\n
+#
+# 22 23 dictionary borders
+#
+<<\n
+>>\n
+#
+# 24
+#
+/ImageType 1\n
+#
+# 25 26
+#
+/Width
+/Height
+#
+# 27
+#
+/BitsPerComponent
+#
+# 28...31
+#
+/ImageMatrix [
+ 0 0 -
+ 0
+]\n
+#
+# 32 33
+#
+/MultipleDataSources false\n
+/MultipleDataSources true\n
+#
+# 34...39
+#
+/DataSource [\n
+{ fb sr readstring pop }\n
+{ fb sg readstring pop }\n
+{ fb sb readstring pop }\n
+{ fb sk readstring pop }\n
+]\n
+#
+# 40...44
+#
+/sr
+/sg
+/sb
+/sk
+ string def\n
+#
+# 45 46
+#
+/DataSource fb\n
+/DataSource fa\n
+#
+# 47...52
+#
+/Decode [0 1]\n
+/Decode [1 0]\n
+/Decode [0 1 0 1 0 1]\n
+/Decode [1 0 1 0 1 0]\n
+/Decode [0 1 0 1 0 1 0 1]\n
+/Decode [1 0 1 0 1 0 1 0]\n
+#
+# 53
+#
+image\n
+#
+# 54
+#
+/Interpolate true\n
+#
+#
+#
+$!end
+};
+
+
+
+/** Write keyword to stream, reset a result variable on error.
+ @param os Output stream to write to.
+ @param kwi Index of keyword in dk4gra_eps_c8_kw array.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_eps_put_kw(
+ dk4_stream_t *os,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ if (0 == dk4stream_write_char_string(os, dk4gra_eps_c8_kw[kwi], erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** Put double value to stream, no scientific notation.
+ On error reset a success variable.
+ @param os Output stream.
+ @param val Value to write.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_eps_put_dbl(
+ dk4_stream_t *os,
+ double val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ if (
+ 0 ==
+ dk4ma_write_c8_double_no_sci_to_stream(
+ os, val, DK4_GRA_EPSILON_COORDINATES, 0, 1, erp
+ )
+ )
+ {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** Write unsigned integer number to stream, reset a success variable on error.
+ @param os Output stream to write to.
+ @param val Value to write.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_eps_put_uim(
+ dk4_stream_t *os,
+ dk4_um_t val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ char buf[16*sizeof(dk4_um_t)]; /* Buffer to construct string */
+
+ if (0 != dk4ma_write_c8_decimal_unsigned(buf, sizeof(buf), val, 0, erp)) {
+ if (0 == dk4stream_write_char_string(os, buf, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** Write procedure before writing data.
+ @param gra Graphics output structure.
+ @param os Output stream for current page.
+ @param cotra Transformation (xshift, yshift, rotation, xscale, yscale).
+ @param bif Bitmap image.
+ @param cs Color space corrected to supported color space.
+ @param bpc Bits per component.
+ @param deci Flag: Decoding inverted.
+ @param ipol Flag: Interpolation.
+ @param spip Flag: Write showpage operator in procedure.
+ @param coe Compression and encoding:
+ - 0: DCT + ASCII85,
+ - 1: Flate + ASCII85,
+ - 2: LZW + ASCII85,
+ - 3: Run-length + ASCII85,
+ - 4: Pure ASCII85.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+dk4gra_eps_write_procedure(
+ dk4_gra_t *gra,
+ dk4_stream_t *os,
+ double *cotra,
+ dk4_bif_t const *bif,
+ int cs,
+ dk4_px_bit_depth_t bpc,
+ int deci,
+ int ipol,
+ int spip,
+ int coe,
+ dk4_er_t *erp
+)
+{
+ size_t w = 0; /* Image width */
+ size_t h = 0; /* Image height */
+ dk4_um_t bn = 0; /* Byte number for run-length compression */
+ int back = 1; /* Function result */
+
+ w = dk4bif_get_width(bif);
+ h = dk4bif_get_height(bif);
+ bn = (w * bpc) / 8;
+ if (0 != ((w * bpc) % 8)) {
+ bn++;
+ }
+
+ /* { */
+ dk4gra_eps_put_kw(os, 1, &back, erp);
+
+ /* gsave */
+ dk4gra_eps_put_kw(os, 3, &back, erp);
+
+ /* ... ... translate */
+ if (
+ (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[0]))
+ || (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[1]))
+ ) {
+ dk4gra_eps_put_dbl(os, cotra[0], &back, erp);
+ dk4gra_eps_put_kw(os, 6, &back, erp);
+ dk4gra_eps_put_dbl(os, cotra[1], &back, erp);
+ dk4gra_eps_put_kw(os, 7, &back, erp);
+ }
+
+ /* ... rotate */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[2])) {
+ dk4gra_eps_put_dbl(os, cotra[2], &back, erp);
+ dk4gra_eps_put_kw(os, 8, &back, erp);
+ }
+
+ /* ... ... scale */
+ dk4gra_eps_put_dbl(os, cotra[3], &back, erp);
+ dk4gra_eps_put_kw(os, 6, &back, erp);
+ dk4gra_eps_put_dbl(os, cotra[4], &back, erp);
+ dk4gra_eps_put_kw(os, 9, &back, erp);
+
+ /* 13 dict begin */
+ dk4gra_eps_put_kw(os, 10, &back, erp);
+
+ /* ... setcolorspace */
+ switch (cs) {
+ case DK4_CS_GRAY : {
+ dk4gra_eps_put_kw(os, 13, &back, erp);
+ } break;
+ case DK4_CS_CMYK : {
+ dk4gra_eps_put_kw(os, 14, &back, erp);
+ } break;
+ default : {
+ dk4gra_eps_put_kw(os, 12, &back, erp);
+ } break;
+ }
+
+ /* ... filter def ... */
+ switch (coe) {
+ case DK4_GRA_COE_ASCII85 : { /* ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ } break;
+ case DK4_GRA_COE_RUNLENGTH_ASCII85 : { /* Run-length ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ dk4gra_eps_put_kw(os, 18, &back, erp);
+ } break;
+ case DK4_GRA_COE_LZW_ASCII85 : { /* LZW ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ dk4gra_eps_put_kw(os, 17, &back, erp);
+ } break;
+ case DK4_GRA_COE_FLATE_ASCII85 : { /* Flate ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ dk4gra_eps_put_kw(os, 16, &back, erp);
+ } break;
+ default: { /* DCT ASCII85 */
+ dk4gra_eps_put_kw(os, 15, &back, erp);
+ dk4gra_eps_put_kw(os, 19, &back, erp);
+ } break;
+ }
+ if (DK4_GRA_COE_RUNLENGTH_ASCII85 == coe) {
+ if (DK4_CS_GRAY != cs) {
+ switch (cs) {
+ case DK4_CS_CMYK : {
+ dk4gra_eps_put_kw(os, 40, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 41, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 42, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 43, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ } break;
+ default : {
+ dk4gra_eps_put_kw(os, 40, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 41, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ dk4gra_eps_put_kw(os, 42, &back, erp);
+ dk4gra_eps_put_uim(os, bn, &back, erp);
+ dk4gra_eps_put_kw(os, 44, &back, erp);
+ } break;
+ }
+ }
+ }
+
+ /* << */
+ dk4gra_eps_put_kw(os, 22, &back, erp);
+
+ /* /ImageType 1 */
+ dk4gra_eps_put_kw(os, 24, &back, erp);
+
+ /* /Width ... */
+ dk4gra_eps_put_kw(os, 25, &back, erp);
+ dk4gra_eps_put_uim(os, w, &back, erp);
+ dk4gra_eps_put_kw(os, 0, &back, erp);
+
+ /* /Height ... */
+ dk4gra_eps_put_kw(os, 26, &back, erp);
+ dk4gra_eps_put_uim(os, h, &back, erp);
+ dk4gra_eps_put_kw(os, 0, &back, erp);
+
+ /* ImageMatrix */
+ dk4gra_eps_put_kw(os, 28, &back, erp);
+ dk4gra_eps_put_uim(os, w, &back, erp);
+ dk4gra_eps_put_kw(os, 29, &back, erp);
+ dk4gra_eps_put_uim(os, h, &back, erp);
+ dk4gra_eps_put_kw(os, 30, &back, erp);
+ dk4gra_eps_put_uim(os, h, &back, erp);
+ dk4gra_eps_put_kw(os, 31, &back, erp);
+
+ /* BitsPerComponent */
+ dk4gra_eps_put_kw(os, 27, &back, erp);
+ dk4gra_eps_put_uim(os, bpc, &back, erp);
+ dk4gra_eps_put_kw(os, 0, &back, erp);
+
+ /* MultipleDataSources */
+ if (DK4_GRA_COE_RUNLENGTH_ASCII85 == coe) {
+ if (DK4_CS_GRAY == cs) {
+ dk4gra_eps_put_kw(os, 32, &back, erp);
+ }
+ else {
+ dk4gra_eps_put_kw(os, 33, &back, erp);
+ }
+ }
+ else {
+ dk4gra_eps_put_kw(os, 32, &back, erp);
+ }
+
+ /* DataSource */
+ if (DK4_GRA_COE_RUNLENGTH_ASCII85 == coe) {
+ if (DK4_CS_GRAY == cs) {
+ dk4gra_eps_put_kw(os, 45, &back, erp);
+ }
+ else {
+ dk4gra_eps_put_kw(os, 34, &back, erp);
+ dk4gra_eps_put_kw(os, 35, &back, erp);
+ dk4gra_eps_put_kw(os, 36, &back, erp);
+ dk4gra_eps_put_kw(os, 37, &back, erp);
+ if (DK4_CS_CMYK == cs) {
+ dk4gra_eps_put_kw(os, 38, &back, erp);
+ }
+ dk4gra_eps_put_kw(os, 39, &back, erp);
+ }
+ }
+ else {
+ if (DK4_GRA_COE_ASCII85 == coe) {
+ dk4gra_eps_put_kw(os, 46, &back, erp);
+ }
+ else {
+ dk4gra_eps_put_kw(os, 45, &back, erp);
+ }
+ }
+
+ /* Decode */
+ switch (cs) {
+ case DK4_CS_GRAY : {
+ dk4gra_eps_put_kw(os, ((0 != deci) ? (48) : (47)), &back, erp);
+ } break;
+ case DK4_CS_CMYK : {
+ dk4gra_eps_put_kw(os, ((0 != deci) ? (52) : (51)), &back, erp);
+ } break;
+ default : {
+ dk4gra_eps_put_kw(os, ((0 != deci) ? (50) : (49)), &back, erp);
+ } break;
+ }
+
+ /* Interpolate */
+ if (0 != ipol) {
+ dk4gra_eps_put_kw(os, 54, &back, erp);
+ }
+
+ /* >> */
+ dk4gra_eps_put_kw(os, 23, &back, erp);
+
+ /* image */
+ dk4gra_eps_put_kw(os, 53, &back, erp);
+
+ /* ... closefile ... */
+ if (DK4_GRA_COE_ASCII85 != coe) {
+ dk4gra_eps_put_kw(os, 20, &back, erp);
+ }
+ dk4gra_eps_put_kw(os, 21, &back, erp);
+
+ /* end */
+ dk4gra_eps_put_kw(os, 11, &back, erp);
+
+ /* grestore */
+ dk4gra_eps_put_kw(os, 4, &back, erp);
+
+ /* showpage */
+ if ((DK4_GRA_DRIVER_EPS != gra->dr) && (0 != spip)) {
+ dk4gra_eps_put_kw(os, 5, &back, erp);
+ }
+
+ /* } exec */
+ dk4gra_eps_put_kw(os, 2, &back, erp);
+
+ return back;
+}
+
+
+
+/** Re-use DCT encoded data from JPEG file directly.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param cotra Coordinates transformation values.
+ @param bif Bitmap image.
+ @param cs Color space correted to supported color space
+ @param fn Bitmap image file name.
+ @param ipol Flag: Interpolation.
+ @param spip Flag: Use showpage in procedure.
+ @param ijpg Flag: Interpolation for JPEGs too.
+ @param erp Error report, may be NULL.
+*/
+
+static
+int
+dk4gra_eps_jpg_bif_fig_image(
+ dk4_gra_t *gra,
+ dk4_gra_ps_page_t *bptr,
+ double *cotra,
+ dk4_bif_t const *bif,
+ int cs,
+ const dkChar *fn,
+ int ipol,
+ int spip,
+ int ijpg,
+ dk4_er_t *erp
+)
+{
+ char b1[256]; /* Default buffer */
+ FILE *infile = NULL; /* Input file */
+ dk4_stream_t *ostrm = NULL; /* Output stream, ASCII85 encoding */
+ char *bufptr = b1; /* Buffer to use */
+ char *mybuf = NULL; /* Allocated buffer */
+ dk4_bif_jpeg_per_frame_t *pjpgf;
+ size_t szbuf = sizeof(b1); /* Size of buffer to use */
+ size_t rdb = 0; /* Number of bytes read in pass */
+ int back = 0; /* Function result */
+ int deci = 0; /* Flag: Invert Decode values */
+ int fotest = DK4_FOPEN_SC_USER; /* Test for files */
+ dk4_px_bit_depth_t bpc = 8; /* Number of bits per component */
+ $? "+ dk4gra_eps_jpg_bif_fig_image"
+ /*
+ */
+ if (0 != dk4isadmin()) { fotest = DK4_FOPEN_SC_PRIVILEGED; }
+ infile = dk4fopen(fn, dkT("rb"), fotest, erp);
+ if (NULL == infile) {
+ goto finished;
+ }
+ /* Allocate memory for buffer
+ */
+ mybuf = (char *)malloc(4096);
+ if (NULL != mybuf) {
+ bufptr = mybuf; szbuf = 4096;
+ }
+ /* Open output encoding stream for ASCII85
+ */
+ ostrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_NONE, DK4_STRMCO_OE_ASCII85,
+ (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
+ erp
+ );
+ if (NULL == ostrm) {
+ goto finished;
+ }
+ pjpgf = (dk4_bif_jpeg_per_frame_t *)(bif->cf->tsdata);
+ if (NULL != pjpgf) {
+ if ((DK4_CS_CMYK == cs) && (0 != pjpgf->is_adobe)) {
+ deci = 1;
+ }
+ }
+ /* Ressources allocated successfully
+ */
+ bpc = dk4bif_get_original_bit_depth(bif);
+ back = dk4gra_eps_write_procedure(
+ gra, bptr->memstrm, cotra, bif, cs, bpc, deci,
+ (((0 != ipol) && (0 != ijpg)) ? (1) : (0)),
+ spip, 0, erp
+ );
+ /* Copy file contents
+ */
+ do {
+ rdb = fread(bufptr, 1, szbuf, infile);
+ if (0 < rdb) {
+ if (0 == dk4stream_write(ostrm, bufptr, rdb, erp)) {
+ back = 0;
+ }
+ }
+ } while (0 < rdb);
+
+ /* Clean up and return
+ */
+ finished:
+ if (NULL != ostrm) {
+ if (0 == dk4stream_close(ostrm, erp)) {
+ back = 0;
+ }
+ }
+ if (NULL != mybuf) {
+ dk4mem_free(mybuf);
+ }
+ if (NULL != infile) {
+ fclose(infile);
+ }
+ $? "- dk4gra_eps_jpg_bif_fig_image %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ int ifl,
+ dk4_er_t *erp
+)
+{
+ dk4_px_t pix[8]; /* Pixel components */
+ dk4_bit_shift_t bs; /* Bit shifter */
+ dk4_gra_ps_page_t *bptr = NULL; /* Current page */
+ dk4_stream_t *costrm = NULL; /* Compressed+encoded output stream */
+ dk4_um_t nby = 0; /* Number of bytes per line */
+ size_t szpix = sizeof(pix) / sizeof(dk4_px_t);
+ size_t h = 0; /* Image height */
+ size_t w = 0; /* Image width */
+ size_t x = 0; /* Current column position */
+ size_t y = 0; /* Current row position */
+ size_t nco = 3; /* Number of components */
+ size_t i = 0; /* Traverse pixel components */
+ int back = 0; /* Function result */
+ int cs = DK4_CS_RGB; /* Color space */
+ int coe = DK4_GRA_COE_FLATE_ASCII85;
+ dk4_px_bit_depth_t bpc = 8; /* Number of bits per component */
+ $? "+ dk4gra_eps_bif_fig_image"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != cotra);
+ assert(NULL != bif);
+ assert(NULL != fn);
+#endif
+ /* Check arguments
+ */
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if (NULL == bptr) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 != (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)) {
+ if (0 != bptr->cont) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->spip = 1;
+ }
+ /* File name is required to re-use DCT encoded data directly
+ */
+ if (NULL == fn) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ /* Retrieve color space
+ */
+ if (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ if (DK4_CS_GRAY != dk4bif_get_color_space(bif)) {
+ if (DK4_CS_GRAY_ALPHA != dk4bif_get_color_space(bif)) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+ }
+ }
+ }
+ cs = dk4bif_get_color_space(bif);
+#if TRACE_DEBUG
+ $? ". cs as received from bif"
+ switch (cs) {
+ case DK4_CS_CMYK : { $? ". cs = cmyk"
+ } break;
+ case DK4_CS_RGB_ALPHA : { $? ". cs = rgba"
+ } break;
+ case DK4_CS_RGB : { $? ". cs = rgb"
+ } break;
+ case DK4_CS_GRAY_ALPHA : { $? ". cs = ga"
+ } break;
+ case DK4_CS_GRAY : { $? ". cs = g"
+ } break;
+ }
+#endif
+ /*
+ Re-use DCT encoded data from JPEG directly, if possible
+ */
+ $? ". ajpg = %d", (DK4_GRA_IMG_FLAG_DCT & ifl)
+ if ((DK4_CS_GRAY == cs) || (DK4_CS_RGB == cs) || (DK4_CS_CMYK == cs)) {
+ if (
+ (DK4_BIF_TYPE_JPEG == bif->imgtype)
+ && (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ ) {
+ back = dk4gra_eps_jpg_bif_fig_image(
+ gra, bptr, cotra, bif, cs, fn,
+ ((0 != (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)) ? (1) :(0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)) ? 1 : 0),
+ ((0 != (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)) ? (1) : (0)),
+ erp
+ ); $? ". back = %d after writing dct data", back
+ goto finished;
+ }
+ }
+ $? ". cs correction 1"
+ /* Correct color space to supported color space
+ */
+ if (DK4_CS_GRAY_ALPHA == cs) { $? ". change cs from GA to G"
+ cs = DK4_CS_GRAY; $? ". cs = g"
+ }
+ if (DK4_CS_RGB_ALPHA == cs) { $? ". change cs from RGBA to RGB"
+ cs = DK4_CS_RGB; $? ". cs = rgb"
+ }
+ /* Skip processing for unsupported color spaces
+ */
+ if (DK4_CS_GRAY != cs) {
+ if (DK4_CS_RGB != cs) {
+ if (DK4_CS_CMYK != cs) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ }
+ w = dk4bif_get_width(bif);
+ h = dk4bif_get_height(bif);
+ bpc = dk4bif_get_original_bit_depth(bif);
+ nby = ((dk4_um_t)w * (dk4_um_t)bpc) / (dk4_um_t)8UL;
+ $? ". cs=%d bpc=%d", cs, (int)bpc
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl))
+ || (0 != (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl))
+ ) {
+ (void)dk4bif_analyze(
+ &cs, &bpc, bif,
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)) ? (1) : (0)),
+ 0, erp
+ );
+ }
+ $? ". cs=%d bpc=%d", cs, (int)bpc
+ $? ". cs correction 2"
+ /* Correct color space to supported color space
+ */
+ if (DK4_CS_GRAY_ALPHA == cs) { $? ". change cs from GA to G"
+ cs = DK4_CS_GRAY; $? ". cs = g"
+ }
+ if (DK4_CS_RGB_ALPHA == cs) { $? ". change cs from RGBA to RGB"
+ cs = DK4_CS_RGB; $? ". cs = rgb"
+ }
+ $? ". cs=%d bpc=%d", cs, (int)bpc
+ $? ". cs correction 3"
+ if (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ switch (cs) {
+ case DK4_CS_RGB : case DK4_CS_CMYK : {
+ cs = DK4_CS_GRAY;
+ } break;
+ }
+ }
+ $? ". cs=%d bpc=%d", cs, (int)bpc
+ /* Skip processing for unsupported color spaces
+ */
+ if (DK4_CS_GRAY != cs) {
+ if (DK4_CS_RGB != cs) {
+ if (DK4_CS_CMYK != cs) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ }
+ }
+ if (12 < bpc) { $? ". correct bits per component to 12"
+ bpc = 12;
+ }
+ $? ". cs=%d bpc=%d", cs, (int)bpc
+ if ((dk4_um_t)0UL != (((dk4_um_t)w * (dk4_um_t)bpc) % (dk4_um_t)8UL)) {
+ nby++;
+ }
+
+#if FORCE_CS
+ $? "! warning: Use forced cs (debugging feature)"
+ cs = FORCED_CS;
+#endif
+#if FORCE_BPC
+ $? "! warning: Use forced bpc (debugging feature)"
+ bpc = FORCED_BPC;
+#endif
+
+ nco = 3;
+ switch (cs) {
+ case DK4_CS_GRAY : { nco = 1; }; break;
+ case DK4_CS_CMYK : { nco = 4; }; break;
+ }
+ if (3 != gra->out.ps.llev) {
+ if (0 != (DK4_GRA_IMG_FLAG_LZW & ifl)) {
+ coe = DK4_GRA_COE_LZW_ASCII85;
+ }
+ else {
+ coe = DK4_GRA_COE_ASCII85; /* or 3 for run-length */
+ if ((DK4_CS_GRAY == cs) || ((dk4_um_t)16384UL > nby)) {
+ coe = DK4_GRA_COE_RUNLENGTH_ASCII85;
+ }
+ }
+ }
+
+#if FORCE_COE
+ $? "! warning: Use forced coe (debugging feature)"
+ coe = FORCED_COE;
+#endif
+
+ switch (coe) {
+ case DK4_GRA_COE_DCT_ASCII85 : { /* DCT ASCII85 */ $? "! bug"
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ } break;
+ case DK4_GRA_COE_LZW_ASCII85 : { /* LZW ASCII85 */
+ costrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_NONE,
+ DK4_STRMCO_CO_LZW,
+ DK4_STRMCO_OE_ASCII85,
+ (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
+ erp
+ );
+ } break;
+ case DK4_GRA_COE_RUNLENGTH_ASCII85 : { /* Run-length ASCII85 */
+ costrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_RUNLENGTH,
+ DK4_STRMCO_CO_NONE,
+ DK4_STRMCO_OE_ASCII85,
+ (
+ DK4_STRMCO_FL_EOD_OE
+ | DK4_STRMCO_FL_EOD_PP
+ | DK4_STRMCO_FL_NL_OE
+ ),
+ erp
+ );
+ } break;
+ case DK4_GRA_COE_ASCII85 : { /* Pure ASCII85 */
+ costrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_NONE,
+ DK4_STRMCO_CO_NONE,
+ DK4_STRMCO_OE_ASCII85,
+ (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
+ erp
+ );
+ } break;
+ default: { /* Flate ASCII85 */
+ costrm = dk4strmco_open(
+ bptr->memstrm,
+ DK4_STRMCO_PP_NONE,
+ DK4_STRMCO_CO_FLATE,
+ DK4_STRMCO_OE_ASCII85,
+ (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
+ erp
+ );
+ } break;
+ }
+ if (NULL == costrm) {
+ goto finished;
+ }
+
+
+ back = dk4gra_eps_write_procedure(
+ gra, bptr->memstrm, cotra, bif, cs, bpc, 0,
+ ((0 != (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ONLY_PAGE_CONTENTS & ifl)) ? (1) : (0)),
+ coe, erp
+ ); $? ". back = %d after writing procedure", back
+
+ dk4bif_set_output_bit_depth(bif, bpc);
+ if (8 == bpc) { $? ". bpc == 8"
+ if ((3 == coe) && (DK4_CS_GRAY != cs)) {
+ for (y = 0; y < h; y++) {
+ for (i = 0; i < nco; i++) {
+ for (x = 0; x < w; x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, szpix, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, cs
+ )
+ ) {
+ back = 0; $? "! failed to get pixel"
+ } $? ". pixel value = %lu", (unsigned long)(pix[i])
+ if (0 == dk4stream_write_byte(costrm, (char)(pix[i]), erp)) {
+ back = 0; $? "! failed to write co stream"
+ }
+ }
+ }
+ }
+ }
+ else {
+ for (y = 0; y < h; y++) {
+ for (x = 0; x < w; x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, szpix, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, cs
+ )
+ ) {
+ back = 0;
+ }
+ for (i = 0; i < nco; i++) {
+#if 0
+ $? ". pixel value = %lu", (unsigned long)(pix[i])
+#endif
+ if (0 == dk4stream_write_byte(costrm, (char)(pix[i]), erp)) {
+ back = 0; $? "! failed to write co stream"
+ }
+ }
+ }
+ }
+ }
+ }
+ else { $? ". bpc != 8"
+ if ((3 == coe) && (DK4_CS_GRAY != cs)) {
+ for (y = 0; y < h; y++) {
+ for (i = 0; i < nco; i++) {
+
+ dk4bit_shift_init(&bs, NULL);
+ for (x = 0; x < w; x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, szpix, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, cs
+ )
+ ) {
+ back = 0; $? "! failed to get pixel"
+ }
+ $? ". xxx back = %d", back
+ dk4gratool_put_pixel_value(
+ costrm, &bs, pix[i], bpc, &back, erp
+ );
+ $? ". xxx back = %d", back
+ }
+ if (DK4_EDSTM_FINISHED == dk4bit_shift_finish(&bs, NULL)) {
+ if (0 == dk4stream_write_byte(
+ costrm, dk4bit_shift_output(&bs, NULL), erp
+ )
+ ) {
+ back = 0; $? "! failed to write to co stream"
+ }
+ }
+
+ }
+ }
+ }
+ else {
+ for (y = 0; y < h; y++) {
+ dk4bit_shift_init(&bs, NULL);
+ for (x = 0; x < w; x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, szpix, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, cs
+ )
+ ) {
+ back = 0; $? "! failed to obtain pixel value"
+ }
+ for (i = 0; i < nco; i++) {
+ $? ". xxx back = %d", back
+ dk4gratool_put_pixel_value(
+ costrm, &bs, pix[i], bpc, &back, erp
+ );
+ $? ". xxx back = %d", back
+ }
+ }
+ if (DK4_EDSTM_FINISHED == dk4bit_shift_finish(&bs, NULL)) {
+ if (0 == dk4stream_write_byte(
+ costrm, dk4bit_shift_output(&bs, NULL), erp
+ )
+ ) {
+ back = 0; $? "! failed to write to co stream"
+ }
+ }
+ }
+ }
+ }
+
+ /* Cleanup
+ */
+ finished:
+ if (NULL != costrm) {
+ if (0 == dk4stream_close(costrm, erp)) {
+ back = 0; $? "! failed to close compressing stream"
+ }
+ }
+ $? "- dk4gra_eps_bif_fig_image %d", back
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grepp.c b/support/dktools/dk4grepp.c
new file mode 100644
index 0000000000..d559df1f41
--- /dev/null
+++ b/support/dktools/dk4grepp.c
@@ -0,0 +1,2168 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grepp.ctr
+*/
+
+/** @file dk4grepp.c The dk4grepp module.
+*/
+
+
+#line 9 "dk4grepp.ctr"
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+/** Pattern procedure.
+*/
+static const char * const p00[] = {
+/* 0 */
+"/ThirtyLeft\t\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 3 index 5 index sub 3.0 sqrt div\t% xs xe ys ye dy ydiff",
+
+/* 3 */
+" 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
+
+/* 6 */
+" 5 index 1 index\t\t\t% xs xe ys ye dy ydiff y xe y",
+
+/* 7 */
+" 8 index 1 index 5 index add\t\t% xs xe ys ye dy ydiff y xe y xs y2",
+
+/* 8 */
+" newpath moveto\t\t\t% xs xe ys ye dy ydiff y xe y",
+
+/* 9 */
+" lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 10 */
+" 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 11 */
+" }",
+
+/* 12 */
+" loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 13 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 14 */
+"} bind def",
+
+NULL
+
+
+#line 50 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p01[] = {
+/* 0 */
+"/ThirtyRight\t\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 3 index 5 index sub 3.0 sqrt div\t% xs xe ys ye dy ydiff",
+
+/* 3 */
+" 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
+
+/* 6 */
+" 6 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y",
+
+/* 7 */
+" 7 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y xe y",
+
+/* 8 */
+" 5 index add\t\t\t\t% xs xe ys ye dy ydiff y xs y xe y2",
+
+/* 9 */
+" newpath moveto\t\t\t% xs xe ys ye dy ydiff y xs y",
+
+/* 10 */
+" lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 11 */
+" 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 12 */
+" }",
+
+/* 13 */
+" loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 14 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 15 */
+"} bind def",
+
+NULL
+
+
+#line 75 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p02[] = {
+/* 0 */
+"/ThirtyHatch\t\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 3 index 5 index sub 3.0 sqrt div\t% xs xe ys ye dy ydiff",
+
+/* 3 */
+" 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
+
+/* 6 */
+" 6 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y",
+
+/* 7 */
+" 7 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y xe y",
+
+/* 8 */
+" 5 index add\t\t\t\t% xs xe ys ye dy ydiff y xs y xe y2",
+
+/* 9 */
+" newpath moveto\t\t\t% xs xe ys ye dy ydiff y xs y",
+
+/* 10 */
+" lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 11 */
+" 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 12 */
+" }",
+
+/* 13 */
+" loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 14 */
+" pop pop\t\t\t\t% xs xe ys ye dy",
+
+/* 15 */
+" 3 index 5 index sub 3.0 sqrt div\t% xs xe ys ye dy ydiff",
+
+/* 16 */
+" 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 17 */
+" {",
+
+/* 18 */
+" dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
+
+/* 19 */
+" 5 index 1 index\t\t\t% xs xe ys ye dy ydiff y xe y",
+
+/* 20 */
+" 8 index 1 index 5 index add\t\t% xs xe ys ye dy ydiff y xe y xs y2",
+
+/* 21 */
+" newpath moveto\t\t\t% xs xe ys ye dy ydiff y xe y",
+
+/* 22 */
+" lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 23 */
+" 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 24 */
+" }",
+
+/* 25 */
+" loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 26 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 27 */
+"} bind def",
+
+NULL
+
+
+#line 112 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p03[] = {
+/* 0 */
+"/FourtyFiveLeft\t\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 3 index 5 index sub \t\t\t% xs xe ys ye dy ydiff",
+
+/* 3 */
+" 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
+
+/* 6 */
+" 5 index 1 index\t\t\t% xs xe ys ye dy ydiff y xe y",
+
+/* 7 */
+" 8 index 1 index 5 index add\t\t% xs xe ys ye dy ydiff y xe y xs y2",
+
+/* 8 */
+" newpath moveto\t\t\t% xs xe ys ye dy ydiff y xe y",
+
+/* 9 */
+" lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 10 */
+" 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 11 */
+" }",
+
+/* 12 */
+" loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 13 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 14 */
+"} bind def",
+
+NULL
+
+
+#line 136 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p04[] = {
+/* 0 */
+"/FourtyFiveRight\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 3 index 5 index sub \t\t\t% xs xe ys ye dy ydiff",
+
+/* 3 */
+" 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
+
+/* 6 */
+" 6 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y",
+
+/* 7 */
+" 7 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y xe y",
+
+/* 8 */
+" 5 index add\t\t\t\t% xs xe ys ye dy ydiff y xs y xe y2",
+
+/* 9 */
+" newpath moveto\t\t\t% xs xe ys ye dy ydiff y xs y",
+
+/* 10 */
+" lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 11 */
+" 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 12 */
+" }",
+
+/* 13 */
+" loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 14 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 15 */
+"} bind def",
+
+NULL
+
+
+#line 161 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p05[] = {
+/* 0 */
+"/FourtyFiveHatch\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 3 index 5 index sub \t\t\t% xs xe ys ye dy ydiff",
+
+/* 3 */
+" 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
+
+/* 6 */
+" 5 index 1 index\t\t\t% xs xe ys ye dy ydiff y xe y",
+
+/* 7 */
+" 8 index 1 index 5 index add\t\t% xs xe ys ye dy ydiff y xe y xs y2",
+
+/* 8 */
+" newpath moveto\t\t\t% xs xe ys ye dy ydiff y xe y",
+
+/* 9 */
+" lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 10 */
+" 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 11 */
+" }",
+
+/* 12 */
+" loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 13 */
+" pop pop \t\t\t\t% xs xe ys ye dy",
+
+/* 14 */
+" 3 index 5 index sub \t\t\t% xs xe ys ye dy ydiff",
+
+/* 15 */
+" 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 16 */
+" {",
+
+/* 17 */
+" dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
+
+/* 18 */
+" 6 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y",
+
+/* 19 */
+" 7 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y xe y",
+
+/* 20 */
+" 5 index add\t\t\t\t% xs xe ys ye dy ydiff y xs y xe y2",
+
+/* 21 */
+" newpath moveto\t\t\t% xs xe ys ye dy ydiff y xs y",
+
+/* 22 */
+" lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 23 */
+" 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 24 */
+" }",
+
+/* 25 */
+" loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
+
+/* 26 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 27 */
+"} bind def",
+
+NULL
+
+
+#line 198 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p06[] = {
+/* 0 */
+"/HorizontalBricks\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 2 index 0\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 3 */
+" {",
+
+/* 4 */
+" 1 index\t\t\t\t% xs xe ys ye dy y nr y",
+
+/* 5 */
+" 4 index\t\t\t\t% xs xe ys ye dy y nr y ye",
+
+/* 6 */
+" gt {exit} if\t\t\t% xs xe ys ye dy y nr",
+
+/* 7 */
+" 6 index\t\t\t\t% xs xe ys ye dy y nr xs",
+
+/* 8 */
+" 2 index\t\t\t\t% xs xe ys ye dy y nr xs y",
+
+/* 9 */
+" 7 index\t\t\t\t% xs xe ys ye dy y nr xs y xe",
+
+/* 10 */
+" 1 index\t\t\t\t% xs xe ys ye dy y nr xs y xe y",
+
+/* 11 */
+" newpath moveto lineto stroke\t% xs xe ys ye dy y nr",
+
+/* 12 */
+" 6 index\t\t\t\t% xs xe ys ye dy y nr x",
+
+/* 13 */
+" 1 index 0\t\t\t\t% xs xe ys ye dy y nr x nr 0",
+
+/* 14 */
+" gt {3 index add} if\t\t\t% xs xe ys ye dy y nr x",
+
+/* 15 */
+" {",
+
+/* 16 */
+" dup 7 index\t\t\t% xs xe ys ye dy y nr x x xe",
+
+/* 17 */
+" gt {exit} if\t\t\t% xs xe ys ye dy y nr x",
+
+/* 18 */
+" dup 3 index\t\t\t% xs xe ys ye dy y nr x x y",
+
+/* 19 */
+" 1 index 1 index\t\t\t% xs xe ys ye dy y nr x x y x y",
+
+/* 20 */
+" 7 index add\t\t\t% xs xe ys ye dy y nr x x y x y",
+
+/* 21 */
+" newpath moveto lineto stroke\t% xs xe ys ye dy y nr x",
+
+/* 22 */
+" 3 index 2.0 mul add\t\t% xs xe ys ye dy y nr x",
+
+/* 23 */
+" }",
+
+/* 24 */
+" loop\t\t\t\t% xs xe ys ye dy y nr x",
+
+/* 25 */
+" pop\t\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 26 */
+" 1 add\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 27 */
+" dup\t\t\t\t\t% xs xe ys ye dy y nr nr",
+
+/* 28 */
+" 1 gt {pop 0} if\t\t\t% xs xe ys ye dy y nr",
+
+/* 29 */
+" exch 2 index add exch\t\t% xs xe ys ye dy y nr",
+
+/* 30 */
+" }",
+
+/* 31 */
+" loop\t\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 32 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 33 */
+"} bind def",
+
+NULL
+
+
+#line 241 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p07[] = {
+/* 0 */
+"/VerticalBricks\t\t\t\t% xs xe ys ye dx",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 4 index 0\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 3 */
+" {",
+
+/* 4 */
+" 1 index 6 index\t\t\t% xs xe ys ye dx x nr x xe",
+
+/* 5 */
+" gt {exit} if\t\t\t% xs xe ys ye dx x nr",
+
+/* 6 */
+" 1 index 5 index\t\t\t% xs xe ys ye dx x nr x ys",
+
+/* 7 */
+" 1 index 6 index\t\t\t% xs xe ys ye dx x nr x ys x ye",
+
+/* 8 */
+" newpath moveto lineto stroke\t% xs xe ys ye dx x nr",
+
+/* 9 */
+" 4 index 1 index 0\t\t\t% xs xe ys ye dx x nr y nr 0",
+
+/* 10 */
+" gt {3 index add} if\t\t\t% xs xe ys ye dx x nr y",
+
+/* 11 */
+" {",
+
+/* 12 */
+" dup 5 index\t\t\t% xs xe ys ye dx x nr y y ye",
+
+/* 13 */
+" gt {exit} if\t\t\t% xs xe ys ye dx x nr y",
+
+/* 14 */
+" 2 index 1 index\t\t\t% xs xe ys ye dx x nr y x y",
+
+/* 15 */
+" dup 2 index\t\t\t% xs xe ys ye dx x nr y x y y x",
+
+/* 16 */
+" 7 index add exch\t\t\t% xs xe ys ye dx x nr y x y x y",
+
+/* 17 */
+" newpath moveto lineto stroke\t% xs xe ys ye dx x nr y",
+
+/* 18 */
+" 3 index 2.0 mul add\t\t% xs xe ys ye dx x nr y",
+
+/* 19 */
+" }",
+
+/* 20 */
+" loop\t\t\t\t% xs xe ys ye dx x nr y",
+
+/* 21 */
+" pop\t\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 22 */
+" exch 2 index add exch\t\t% xs xe ys ye dx x nr",
+
+/* 23 */
+" 1 add\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 24 */
+" dup 1\t\t\t\t% xs xe ys ye dx x nr nr 1",
+
+/* 25 */
+" gt {pop 0} if\t\t\t% xs xe ys ye dx x nr",
+
+/* 26 */
+" }",
+
+/* 27 */
+" loop\t\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 28 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 29 */
+"} bind def",
+
+NULL
+
+
+#line 280 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p08[] = {
+/* 0 */
+"/HorizontalLines\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 2 index\t\t\t\t% xs xe ys ye dy y",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 3 index gt {exit} if\t\t% xs xe ys ye dy y",
+
+/* 5 */
+" 4 index 1 index\t\t\t% xs xe ys ye dy y xe y",
+
+/* 6 */
+" 7 index 1 index\t\t\t% xs xe ys ye dy y xe y xs y",
+
+/* 7 */
+" newpath moveto\t\t\t% xs xe ys ye dy y xe y",
+
+/* 8 */
+" lineto stroke\t\t\t% xs xe ys ye dy y",
+
+/* 9 */
+" 1 index add\t\t\t\t% xs xe ys ye dy y",
+
+/* 10 */
+" }",
+
+/* 11 */
+" loop\t\t\t\t\t% xs xe ys ye dy y",
+
+/* 12 */
+" pop pop pop pop pop pop\t\t% --",
+
+/* 13 */
+"} bind def",
+
+NULL
+
+
+#line 303 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p09[] = {
+/* 0 */
+"/VerticalLines\t\t\t\t% xs xe ys ye dx",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 4 index\t\t\t\t% xs xe ys ye dx x",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 5 index gt {exit} if\t\t% xs xe ys ye dx x",
+
+/* 5 */
+" dup 3 index\t\t\t\t% xs xe ys ye dx x x ye",
+
+/* 6 */
+" 1 index 6 index\t\t\t% xs xe ys ye dx x x ye x ys",
+
+/* 7 */
+" newpath moveto\t\t\t% xs xe ys ye dx x x ye",
+
+/* 8 */
+" lineto stroke\t\t\t% xs xe ys ye dx x",
+
+/* 9 */
+" 1 index add\t\t\t\t% xs xe ys ye dx x",
+
+/* 10 */
+" }",
+
+/* 11 */
+" loop\t\t\t\t\t% xs xe ys ye dx x",
+
+/* 12 */
+" pop pop pop pop pop pop\t\t% --",
+
+/* 13 */
+"} bind def",
+
+NULL
+
+
+#line 326 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p10[] = {
+/* 0 */
+"/CrossHatch\t\t\t\t% xs xe ys ye dx",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 4 index\t\t\t\t% xs xe ys ye dx x",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 5 index gt {exit} if\t\t% xs xe ys ye dx x",
+
+/* 5 */
+" dup 3 index\t\t\t\t% xs xe ys ye dx x x ye",
+
+/* 6 */
+" 1 index 6 index\t\t\t% xs xe ys ye dx x x ye x ys",
+
+/* 7 */
+" newpath moveto\t\t\t% xs xe ys ye dx x x ye",
+
+/* 8 */
+" lineto stroke\t\t\t% xs xe ys ye dx x",
+
+/* 9 */
+" 1 index add\t\t\t\t% xs xe ys ye dx x",
+
+/* 10 */
+" }",
+
+/* 11 */
+" loop\t\t\t\t\t% xs xe ys ye dx x",
+
+/* 12 */
+" pop\t\t\t\t\t% xs xe ys ye dy",
+
+/* 13 */
+" 2 index\t\t\t\t% xs xe ys ye dy y",
+
+/* 14 */
+" {",
+
+/* 15 */
+" dup 3 index gt {exit} if\t\t% xs xe ys ye dy y",
+
+/* 16 */
+" 4 index 1 index\t\t\t% xs xe ys ye dy y xe y",
+
+/* 17 */
+" 7 index 1 index\t\t\t% xs xe ys ye dy y xe y xs y",
+
+/* 18 */
+" newpath moveto\t\t\t% xs xe ys ye dy y xe y",
+
+/* 19 */
+" lineto stroke\t\t\t% xs xe ys ye dy y",
+
+/* 20 */
+" 1 index add\t\t\t\t% xs xe ys ye dy y",
+
+/* 21 */
+" }",
+
+/* 22 */
+" loop\t\t\t\t\t% xs xe ys ye dy y",
+
+/* 23 */
+" pop pop pop pop pop pop\t\t% --",
+
+/* 24 */
+"} bind def",
+
+NULL
+
+
+#line 360 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p11[] = {
+/* 0 */
+"/HorizontalShinglesLeft\t\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 2 index\t\t\t\t% xs xe ys ye dy y",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 3 index gt {exit} if\t\t% xs xe ys ye dy y",
+
+/* 5 */
+" 4 index 1 index\t\t\t% xs xe ys ye dy y xe y",
+
+/* 6 */
+" 7 index 1 index\t\t\t% xs xe ys ye dy y xe y xs y",
+
+/* 7 */
+" newpath moveto\t\t\t% xs xe ys ye dy y xe y",
+
+/* 8 */
+" lineto stroke\t\t\t% xs xe ys ye dy y",
+
+/* 9 */
+" 1 index add\t\t\t\t% xs xe ys ye dy y",
+
+/* 10 */
+" }",
+
+/* 11 */
+" loop\t\t\t\t\t% xs xe ys ye dy y",
+
+/* 12 */
+" pop\t\t\t\t\t% xs xe ys ye dy",
+
+/* 13 */
+" 2 index 0\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 14 */
+" {",
+
+/* 15 */
+" 1 index 4 index gt {exit} if\t% xs xe ys ye dy y nr",
+
+/* 16 */
+" 6 index\t\t\t\t% xs xe ys ye dy y nr x",
+
+/* 17 */
+" 1 index 2 gt",
+
+/* 18 */
+" { 3 index 0.5 mul add }",
+
+/* 19 */
+" {",
+
+/* 20 */
+" 1 index 1 gt",
+
+/* 21 */
+" { 3 index add }",
+
+/* 22 */
+" {",
+
+/* 23 */
+" 1 index 0 gt",
+
+/* 24 */
+"\t{ 3 index 1.5 mul add }",
+
+/* 25 */
+"\tif",
+
+/* 26 */
+" }",
+
+/* 27 */
+" ifelse",
+
+/* 28 */
+" }",
+
+/* 29 */
+" ifelse",
+
+/* 30 */
+" {",
+
+/* 31 */
+" dup 7 index gt {exit} if\t\t% xs xe ys ye dy y nr x",
+
+/* 32 */
+" dup 4 index 0.5 mul add\t\t% xs xe ys ye dy y nr x x2",
+
+/* 33 */
+" 3 index 5 index add\t\t% xs xe ys ye dy y nr x x2 y2",
+
+/* 34 */
+" 2 index 5 index newpath moveto\t% xs xe ys ye dy y nr x x2 y2",
+
+/* 35 */
+" lineto stroke\t\t\t% xs xe ys ye dy y nr x",
+
+/* 36 */
+" 3 index 2.0 mul add\t\t% xs xe ys ye dy y nr x",
+
+/* 37 */
+" }",
+
+/* 38 */
+" loop pop\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 39 */
+" exch 2 index add exch\t\t% xs xe ys ye dy y nr",
+
+/* 40 */
+" 1 add dup 3 gt {pop 0} if\t\t% xs xe ys ye dy y nr",
+
+/* 41 */
+" }",
+
+/* 42 */
+" loop\t\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 43 */
+" pop pop pop pop pop pop pop",
+
+/* 44 */
+"} bind def",
+
+NULL
+
+
+#line 414 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p12[] = {
+/* 0 */
+"/HorizontalShinglesRight\t\t% xs xe ys ye dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 2 index\t\t\t\t% xs xe ys ye dy y",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 3 index gt {exit} if\t\t% xs xe ys ye dy y",
+
+/* 5 */
+" 4 index 1 index\t\t\t% xs xe ys ye dy y xe y",
+
+/* 6 */
+" 7 index 1 index\t\t\t% xs xe ys ye dy y xe y xs y",
+
+/* 7 */
+" newpath moveto\t\t\t% xs xe ys ye dy y xe y",
+
+/* 8 */
+" lineto stroke\t\t\t% xs xe ys ye dy y",
+
+/* 9 */
+" 1 index add\t\t\t\t% xs xe ys ye dy y",
+
+/* 10 */
+" }",
+
+/* 11 */
+" loop\t\t\t\t\t% xs xe ys ye dy y",
+
+/* 12 */
+" pop\t\t\t\t\t% xs xe ys ye dy",
+
+/* 13 */
+" 2 index 0\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 14 */
+" {",
+
+/* 15 */
+" 1 index 4 index gt {exit} if\t% xs xe ys ye dy y nr",
+
+/* 16 */
+" 6 index\t\t\t\t% xs xe ys ye dy y nr x",
+
+/* 17 */
+" 1 index 4 index 0.5 mul mul add\t% xs xe ys ye dy y nr x",
+
+/* 18 */
+" {",
+
+/* 19 */
+" dup 7 index gt {exit} if\t\t% xs xe ys ye dy y nr x",
+
+/* 20 */
+" dup 3 index 5 index add\t\t% xs xe ys ye dy y nr x x y2",
+
+/* 21 */
+" 1 index 6 index 0.5 mul add\t% xs xe ys ye dy y nr x x y2 x2",
+
+/* 22 */
+" 5 index newpath moveto lineto\t% xs xe ys ye dy y nr x",
+
+/* 23 */
+" stroke",
+
+/* 24 */
+" 3 index 2.0 mul add\t\t% xs xe ys ye dy y nr x",
+
+/* 25 */
+" }",
+
+/* 26 */
+" loop pop\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 27 */
+" exch 2 index add exch\t\t% xs xe ys ye dy y nr",
+
+/* 28 */
+" 1 add dup 3 gt {pop 0} if\t\t% xs xe ys ye dy y nr",
+
+/* 29 */
+" }",
+
+/* 30 */
+" loop\t\t\t\t\t% xs xe ys ye dy y nr",
+
+/* 31 */
+" pop pop pop pop pop pop pop",
+
+/* 32 */
+"} bind def",
+
+NULL
+
+
+#line 456 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p13[] = {
+/* 0 */
+"/VerticalShinglesLeft\t\t\t% xs xe ys ye dx",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 4 index\t\t\t\t% xs xe ys ye dx x",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 5 index gt {exit} if\t\t% xs xe ys ye dx x",
+
+/* 5 */
+" dup 3 index\t\t\t\t% xs xe ys ye dx x x ye",
+
+/* 6 */
+" 1 index 6 index\t\t\t% xs xe ys ye dx x x ye x ys",
+
+/* 7 */
+" newpath moveto\t\t\t% xs xe ys ye dx x x ye",
+
+/* 8 */
+" lineto stroke\t\t\t% xs xe ys ye dx x",
+
+/* 9 */
+" 1 index add\t\t\t\t% xs xe ys ye dx x",
+
+/* 10 */
+" }",
+
+/* 11 */
+" loop\t\t\t\t\t% xs xe ys ye dx x",
+
+/* 12 */
+" pop\t\t\t\t\t% xs xe ys ye dx",
+
+/* 13 */
+" 4 index 0\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 14 */
+" {",
+
+/* 15 */
+" 1 index 6 index gt {exit} if\t% xs xe ys ye dx x nr",
+
+/* 16 */
+" 4 index\t\t\t\t% xs xe ys ye dx x nr y",
+
+/* 17 */
+" 3 index 2 index 0.5 mul mul add\t% xs xe ys ye dx x nr y",
+
+/* 18 */
+" {",
+
+/* 19 */
+" dup 5 index gt {exit} if\t\t% xs xe ys ye dx x nr y",
+
+/* 20 */
+" 2 index 1 index\t\t\t% xs xe ys ye dx x nr y x y",
+
+/* 21 */
+" 5 index 0.5 mul add\t\t% xs xe ys ye dx x nr y x y2",
+
+/* 22 */
+" 1 index 6 index add 3 index\t% xs xe ys ye dx x nr y x y2 x2 y",
+
+/* 23 */
+" newpath moveto lineto stroke\t% xs xe ys ye dx x nr y",
+
+/* 24 */
+" 3 index 2.0 mul add\t\t% xs xe ys ye dx x nr y",
+
+/* 25 */
+" }",
+
+/* 26 */
+" loop pop\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 27 */
+" exch 2 index add exch\t\t% xs xe ys ye dx x nr",
+
+/* 28 */
+" 1 add dup 3 gt {pop 0} if\t\t% xs xe ys ye dx x nr",
+
+/* 29 */
+" }",
+
+/* 30 */
+" loop\t\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 31 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 32 */
+"} bind def",
+
+NULL
+
+
+#line 498 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p14[] = {
+/* 0 */
+"/VerticalShinglesRight\t\t\t% xs xe ys ye dx",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 4 index\t\t\t\t% xs xe ys ye dx x",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 5 index gt {exit} if\t\t% xs xe ys ye dx x",
+
+/* 5 */
+" dup 3 index\t\t\t\t% xs xe ys ye dx x x ye",
+
+/* 6 */
+" 1 index 6 index\t\t\t% xs xe ys ye dx x x ye x ys",
+
+/* 7 */
+" newpath moveto\t\t\t% xs xe ys ye dx x x ye",
+
+/* 8 */
+" lineto stroke\t\t\t% xs xe ys ye dx x",
+
+/* 9 */
+" 1 index add\t\t\t\t% xs xe ys ye dx x",
+
+/* 10 */
+" }",
+
+/* 11 */
+" loop\t\t\t\t\t% xs xe ys ye dx x",
+
+/* 12 */
+" pop\t\t\t\t\t% xs xe ys ye dx",
+
+/* 13 */
+" 4 index 0\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 14 */
+" {",
+
+/* 15 */
+" 1 index 6 index gt {exit} if\t% xs xe ys ye dx x nr",
+
+/* 16 */
+" 4 index\t\t\t\t% xs xe ys ye dx x nr y",
+
+/* 17 */
+" 1 index 2 gt",
+
+/* 18 */
+" { 3 index 0.5 mul add }",
+
+/* 19 */
+" {",
+
+/* 20 */
+" 1 index 1 gt",
+
+/* 21 */
+" { 3 index add }",
+
+/* 22 */
+" {",
+
+/* 23 */
+" 1 index 0 gt",
+
+/* 24 */
+"\t{ 3 index 1.5 mul add }",
+
+/* 25 */
+"\tif",
+
+/* 26 */
+" }",
+
+/* 27 */
+" ifelse",
+
+/* 28 */
+" }",
+
+/* 29 */
+" ifelse",
+
+/* 30 */
+" {",
+
+/* 31 */
+" dup 5 index gt {exit} if\t\t% xs xe ys ye dx x nr y",
+
+/* 32 */
+" 2 index 1 index\t\t\t% xs xe ys ye dx x nr y x y",
+
+/* 33 */
+" 1 index 6 index add\t\t% xs xe ys ye dx x nr y x y x2",
+
+/* 34 */
+" 1 index 7 index 0.5 mul add\t% xs xe ys ye dx x nr y x y x2 y2",
+
+/* 35 */
+" newpath moveto lineto stroke\t% xs xe ys ye dx x nr y",
+
+/* 36 */
+" 3 index 2.0 mul add\t\t% xs xe ys ye dx x nr y",
+
+/* 37 */
+" }",
+
+/* 38 */
+" loop pop\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 39 */
+" exch 2 index add exch\t\t% xs xe ys ye dx x nr",
+
+/* 40 */
+" 1 add dup 3 gt {pop 0} if\t\t% xs xe ys ye dx x nr",
+
+/* 41 */
+" }",
+
+/* 42 */
+" loop\t\t\t\t\t% xs xe ys ye dx x nr",
+
+/* 43 */
+" pop pop pop pop pop pop pop\t\t% --",
+
+/* 44 */
+"} bind def",
+
+NULL
+
+
+#line 552 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p15[] = {
+/* 0 */
+"/FishScales\t\t\t\t% xs xe ys ye dx dy r a1 a2",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 6 index 0\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 3 */
+" {",
+
+/* 4 */
+" 1 index 8 index gt {exit} if\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 5 */
+" 10 index\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 6 */
+" 1 index 0 gt",
+
+/* 7 */
+" { 7 index 0.5 mul add }",
+
+/* 8 */
+" if",
+
+/* 9 */
+" {",
+
+/* 10 */
+" dup 11 index gt {exit} if\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 11 */
+" dup 3 index 8 index add\t\t% xs xe ys ye dx dy r a1 a2 y nr x x y+dy",
+
+/* 12 */
+" newpath moveto\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 13 */
+" dup 8 index 0.5 mul add\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm",
+
+/* 14 */
+" 3 index 7 index add\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm ym",
+
+/* 15 */
+" 7 index 7 index 7 index\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm ym r a1 a2",
+
+/* 16 */
+" arc stroke\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 17 */
+" 7 index add\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 18 */
+" }",
+
+/* 19 */
+" loop pop\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 20 */
+" exch 5 index add exch\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 21 */
+" 1 add dup 1 gt {pop 0} if\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 22 */
+" }",
+
+/* 23 */
+" loop\t\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 24 */
+" pop pop pop pop pop pop pop pop pop pop pop",
+
+/* 25 */
+"} bind def",
+
+NULL
+
+
+#line 587 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p16[] = {
+/* 0 */
+"/SmallFishScales\t\t\t% xs xe ys ye dx dy r a1 a2",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 6 index 0\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 3 */
+" {",
+
+/* 4 */
+" 1 index 8 index gt {exit} if\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 5 */
+" 10 index\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 6 */
+" 1 index 0 gt",
+
+/* 7 */
+" { 7 index 0.5 mul add }",
+
+/* 8 */
+" if",
+
+/* 9 */
+" {",
+
+/* 10 */
+" dup 11 index gt {exit} if\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 11 */
+" dup 3 index 8 index add\t\t% xs xe ys ye dx dy r a1 a2 y nr x x y+dy",
+
+/* 12 */
+" newpath moveto\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 13 */
+" dup 8 index 0.5 mul add\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm",
+
+/* 14 */
+" 3 index 7 index add\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm ym",
+
+/* 15 */
+" 7 index 7 index 7 index\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm ym r a1 a2",
+
+/* 16 */
+" arc stroke\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 17 */
+" 7 index add\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
+
+/* 18 */
+" }",
+
+/* 19 */
+" loop pop\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 20 */
+" exch 5 index add exch\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 21 */
+" 1 add dup 1 gt {pop 0} if\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 22 */
+" }",
+
+/* 23 */
+" loop\t\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
+
+/* 24 */
+" pop pop pop pop pop pop pop pop pop pop pop",
+
+/* 25 */
+"} bind def",
+
+NULL
+
+
+#line 622 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p17[] = {
+/* 0 */
+"/Circles\t\t\t% xs xe ys ye r",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 2 index\t\t\t% xs xe ys ye r y",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 3 index gt {exit} if",
+
+/* 5 */
+" 5 index\t\t\t% xs xe ys ye r y x",
+
+/* 6 */
+" {",
+
+/* 7 */
+" dup 6 index gt {exit} if",
+
+/* 8 */
+" dup 3 index add\t\t% xs xe ys ye r y x xm",
+
+/* 9 */
+" 2 index 4 index add\t% xs xe ys ye r y x xm ym",
+
+/* 10 */
+" 4 index 0 360\t\t% xs xe ys ye r y x xm ym r a1 a2",
+
+/* 11 */
+" 4 index 3 index add\t% xs xe ys ye r y x xm ym r a1 a2 xr",
+
+/* 12 */
+" 4 index\t\t\t% xs xe ys ye r y x xm ym r a1 a2 xr yr",
+
+/* 13 */
+" newpath moveto arc",
+
+/* 14 */
+" closepath stroke\t\t% xs xe ys ye r y x",
+
+/* 15 */
+" 2 index dup add add",
+
+/* 16 */
+" }",
+
+/* 17 */
+" loop pop",
+
+/* 18 */
+" 1 index dup add add\t\t% xs xe ys ye r y",
+
+/* 19 */
+" }",
+
+/* 20 */
+" loop\t\t\t\t% xs xe ys ye r y",
+
+/* 21 */
+" pop pop pop pop pop pop\t% --",
+
+/* 22 */
+"} bind def",
+
+NULL
+
+
+#line 654 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p18[] = {
+/* 0 */
+"/Hexagons\t\t\t\t% xs xe ys ye dx dy",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 1 index 3.0 div\t\t\t% xs xe ys ye dx dy r",
+
+/* 3 */
+" 4 index\t\t\t\t% xs xe ys ye dx dy r y",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 5 index gt {exit} if",
+
+/* 6 */
+" 7 index\t\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 7 */
+" {",
+
+/* 8 */
+" dup 8 index gt {exit} if",
+
+/* 9 */
+" newpath",
+
+/* 10 */
+" dup 3 index 3.0 mul add\t\t% xs xe ys ye dx dy r y x x0",
+
+/* 11 */
+" 2 index 5 index 0.5 mul add\t% xs xe ys ye dx dy r y x x0 y0",
+
+/* 12 */
+" moveto\t\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 13 */
+" dup 3 index 2.0 mul add\t\t% xs xe ys ye dx dy r y x x1",
+
+/* 14 */
+" 2 index 5 index 0.5 mul add\t% xs xe ys ye dx dy r y x x1 y1",
+
+/* 15 */
+" lineto\t\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 16 */
+" dup 3 index 1.5 mul add\t\t% xs xe ys ye dx dy r y x x2",
+
+/* 17 */
+" 2 index 5 index add\t\t% xs xe ys ye dx dy r y x x2 y2",
+
+/* 18 */
+" lineto\t\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 19 */
+" dup 3 index 0.5 mul add\t\t% xs xe ys ye dx dy r y x x3",
+
+/* 20 */
+" 2 index 5 index add\t\t% xs xe ys ye dx dy r y x x3 y3",
+
+/* 21 */
+" lineto\t\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 22 */
+" dup 2 index 5 index 0.5 mul add\t% xs xe ys ye dx dy r y x x4 y4",
+
+/* 23 */
+" lineto\t\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 24 */
+" dup 3 index 0.5 mul add 2 index\t% xs xe ys ye dx dy r y x x5 y5",
+
+/* 25 */
+" lineto\t\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 26 */
+" dup 3 index 1.5 mul add 2 index\t% xs xe ys ye dx dy r y x x6 y6",
+
+/* 27 */
+" lineto\t\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 28 */
+" dup 3 index 2.0 mul add\t\t% xs xe ys ye dx dy r y x x7",
+
+/* 29 */
+" 2 index 5 index 0.5 mul add\t% xs xe ys ye dx dy r y x x7 y7",
+
+/* 30 */
+" lineto stroke\t\t\t% xs xe ys ye dx dy r y x",
+
+/* 31 */
+" 4 index add",
+
+/* 32 */
+" }",
+
+/* 33 */
+" loop pop",
+
+/* 34 */
+" 2 index add",
+
+/* 35 */
+" }",
+
+/* 36 */
+" loop pop pop pop pop pop pop pop pop",
+
+/* 37 */
+"} bind def",
+
+NULL
+
+
+#line 701 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p19[] = {
+/* 0 */
+"/Octagons\t\t\t\t% xs xe ys ye dx co",
+
+/* 1 */
+"{",
+
+/* 2 */
+" 3 index\t\t\t\t% xs xe ys ye dx co y",
+
+/* 3 */
+" {",
+
+/* 4 */
+" dup 4 index gt {exit} if",
+
+/* 5 */
+" 6 index\t\t\t\t% xs xe ys ye dx co y x",
+
+/* 6 */
+" {",
+
+/* 7 */
+" dup 7 index gt {exit} if\t\t% xs xe ys ye dx co y x",
+
+/* 8 */
+" newpath",
+
+/* 9 */
+" dup 3 index add\t\t\t% xs xe ys ye dx co y x x0",
+
+/* 10 */
+" 2 index\t\t\t\t% xs xe ys ye dx co y x x0 y0",
+
+/* 11 */
+" moveto\t\t\t\t% xs xe ys ye dx co y x",
+
+/* 12 */
+" dup 4 index add 3 index sub\t% xs xe ys ye dx co y x x1",
+
+/* 13 */
+" 2 index\t\t\t\t% xs xe ys ye dx co y x x1 y1",
+
+/* 14 */
+" lineto\t\t\t\t% xs xe ys ye dx co y x",
+
+/* 15 */
+" dup 4 index add\t\t\t% xs xe ys ye dx co y x x2",
+
+/* 16 */
+" 2 index 4 index add\t\t% xs xe ys ye dx co y x x2 y2",
+
+/* 17 */
+" lineto\t\t\t\t% xs xe ys ye dx co y x",
+
+/* 18 */
+" dup 4 index add\t\t\t% xs xe ys ye dx co y x x3",
+
+/* 19 */
+" 2 index 5 index add 4 index sub\t% xs xe ys ye dx co y x x3 y3",
+
+/* 20 */
+" lineto\t\t\t\t% xs xe ys ye dx co y x",
+
+/* 21 */
+" dup 4 index add 3 index sub\t% xs xe ys ye dx co y x x4",
+
+/* 22 */
+" 2 index 5 index add\t\t% xs xe ys ye dx co y x x4 y4",
+
+/* 23 */
+" lineto\t\t\t\t% xs xe ys ye dx co y x",
+
+/* 24 */
+" dup 3 index add\t\t\t% xs xe ys ye dx co y x x5",
+
+/* 25 */
+" 2 index 5 index add\t\t% xs xe ys ye dx co y x x5 y5",
+
+/* 26 */
+" lineto\t\t\t\t% xs xe ys ye dx co y x",
+
+/* 27 */
+" dup\t\t\t\t% xs xe ys ye dx co y x x6",
+
+/* 28 */
+" 2 index 5 index add 4 index sub\t% xs xe ys ye dx co y x x6 y6",
+
+/* 29 */
+" lineto\t\t\t\t% xs xe ys ye dx co y x",
+
+/* 30 */
+" dup\t\t\t\t% xs xe ys ye dx co y x x7",
+
+/* 31 */
+" 2 index 4 index add\t\t% xs xe ys ye dx co y x x7 y7",
+
+/* 32 */
+" lineto closepath stroke\t\t% xs xe ys ye dx co y x",
+
+/* 33 */
+" 3 index add",
+
+/* 34 */
+" }",
+
+/* 35 */
+" loop pop",
+
+/* 36 */
+" 2 index add",
+
+/* 37 */
+" }",
+
+/* 38 */
+" loop pop pop pop pop pop pop pop",
+
+/* 39 */
+"} bind def",
+
+NULL
+
+
+#line 750 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p20[] = {
+/* 0 */
+"/HorizontalTireTreads\t\t% xs xe ys ye dx",
+
+/* 1 */
+"{",
+
+/* 2 */
+" dup 0.5 mul\t\t\t% xs xe ys ye dx r",
+
+/* 3 */
+" 3 index\t\t\t% xs xe ys ye dx r y",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 4 index gt {exit} if",
+
+/* 6 */
+" 6 index\t\t\t% xs xe ys ye dx r y x",
+
+/* 7 */
+" {",
+
+/* 8 */
+" dup 7 index gt {exit} if\t\t% xs xe ys ye dx r y x",
+
+/* 9 */
+" dup 4 index add 2 index\t\t% xs xe ys ye dx r y x x2 y2",
+
+/* 10 */
+" 2 index 5 index add\t\t% xs xe ys ye dx r y x x2 y2 x1",
+
+/* 11 */
+" 4 index 6 index add\t\t% xs xe ys ye dx r y x x2 y2 x1 y1",
+
+/* 12 */
+" 4 index 6 index\t\t\t% xs xe ys ye dx r y x x2 y2 x1 y1 x0 y0",
+
+/* 13 */
+" newpath moveto lineto lineto\t% xs xe ys ye dx r y x",
+
+/* 14 */
+" stroke",
+
+/* 15 */
+" 3 index add",
+
+/* 16 */
+" }",
+
+/* 17 */
+" loop pop\t\t\t% xs xe ys ye dx r y",
+
+/* 18 */
+" 2 index add",
+
+/* 19 */
+" }",
+
+/* 20 */
+" loop\t\t\t\t\t% xs xe ys ye dx r y",
+
+/* 21 */
+" pop pop pop pop pop pop pop",
+
+/* 22 */
+"} bind def",
+
+NULL
+
+
+#line 782 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p21[] = {
+/* 0 */
+"/VerticalTireTreads\t\t% xs xe ys ye dx",
+
+/* 1 */
+"{",
+
+/* 2 */
+" dup 0.5 mul\t\t\t% xs xe ys ye dx r",
+
+/* 3 */
+" 5 index\t\t\t% xs xe ys ye dx r x",
+
+/* 4 */
+" {",
+
+/* 5 */
+" dup 6 index gt {exit} if",
+
+/* 6 */
+" 4 index\t\t\t% xs xe ys ye dx r x y",
+
+/* 7 */
+" {",
+
+/* 8 */
+" dup 5 index gt {exit} if",
+
+/* 9 */
+" 1 index 1 index 5 index add\t% xs xe ys ye dx r x y x2 y2",
+
+/* 10 */
+" 3 index 5 index add\t\t% xs xe ys ye dx r x y x2 y2 x1",
+
+/* 11 */
+" 3 index 6 index add\t\t% xs xe ys ye dx r x y x2 y2 x1 y1",
+
+/* 12 */
+" 5 index 5 index\t\t\t% xs xe ys ye dx r x y x2 y2 x1 y1 x0 y0",
+
+/* 13 */
+" newpath moveto lineto lineto\t% xs xe ys ye dx r x y",
+
+/* 14 */
+" stroke",
+
+/* 15 */
+" 3 index add",
+
+/* 16 */
+" }",
+
+/* 17 */
+" loop pop",
+
+/* 18 */
+" 2 index add",
+
+/* 19 */
+" }",
+
+/* 20 */
+" loop\t\t\t\t% xs xe ys ye dx r x",
+
+/* 21 */
+" pop pop pop pop pop pop pop",
+
+/* 22 */
+"} bind def",
+
+NULL
+
+
+#line 814 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern names.
+*/
+static const char * const pnames[] = {
+/* 0 */
+"ThirtyLeft",
+
+/* 1 */
+"ThirtyRight",
+
+/* 2 */
+"ThirtyHatch",
+
+/* 3 */
+"FourtyFiveLeft",
+
+/* 4 */
+"FourtyFiveRight",
+
+/* 5 */
+"FourtyFiveHatch",
+
+/* 6 */
+"HorizontalBricks",
+
+/* 7 */
+"VerticalBricks",
+
+/* 8 */
+"HorizontalLines",
+
+/* 9 */
+"VerticalLines",
+
+/* 10 */
+"CrossHatch",
+
+/* 11 */
+"HorizontalShinglesLeft",
+
+/* 12 */
+"HorizontalShinglesRight",
+
+/* 13 */
+"VerticalShinglesLeft",
+
+/* 14 */
+"VerticalShinglesRight",
+
+/* 15 */
+"FishScales",
+
+/* 16 */
+"SmallFishScales",
+
+/* 17 */
+"Circles",
+
+/* 18 */
+"Hexagons",
+
+/* 19 */
+"Octagons",
+
+/* 20 */
+"HorizontalTireTreads",
+
+/* 21 */
+"VerticalTireTreads",
+
+NULL
+
+
+#line 845 "dk4grepp.ctr"
+};
+
+
+
+/** Pattern procedures.
+*/
+static const char * const * pproc[] = {
+p00, p01, p02, p03, p04, p05, p06, p07, p08, p09,
+p10, p11, p12, p13, p14, p15, p16, p17, p18, p19,
+p20, p21
+};
+
+
+
+const char * const *
+dk4gra_eps_pattern_procedure(size_t i)
+{
+ const char * const *back = NULL;
+#if DK4_USE_ASSERT
+ assert(DK4_GRA_PATTERN_MAX >= i);
+#endif
+ if (DK4_GRA_PATTERN_MAX >= i) {
+ back = pproc[i];
+ }
+ return back;
+}
+
+
+
+const char *
+dk4gra_eps_pattern_name(size_t i)
+{
+ const char *back = NULL;
+#if DK4_USE_ASSERT
+ assert(DK4_GRA_PATTERN_MAX >= i);
+#endif
+ if (DK4_GRA_PATTERN_MAX >= i) {
+ back = pnames[i];
+ }
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grepp.ctr b/support/dktools/dk4grepp.ctr
new file mode 100644
index 0000000000..ddf4e88b14
--- /dev/null
+++ b/support/dktools/dk4grepp.ctr
@@ -0,0 +1,888 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+/** Pattern procedure.
+*/
+static const char * const p00[] = {
+$!string-table
+/ThirtyLeft % xs xe ys ye dy
+{
+ 3 index 5 index sub 3.0 sqrt div % xs xe ys ye dy ydiff
+ 3 index % xs xe ys ye dy ydiff y
+ {
+ dup 4 index gt {exit} if % xs xe ys ye dy ydiff y
+ 5 index 1 index % xs xe ys ye dy ydiff y xe y
+ 8 index 1 index 5 index add % xs xe ys ye dy ydiff y xe y xs y2
+ newpath moveto % xs xe ys ye dy ydiff y xe y
+ lineto stroke % xs xe ys ye dy ydiff y
+ 2 index add % xs xe ys ye dy ydiff y
+ }
+ loop % xs xe ys ye dy ydiff y
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p01[] = {
+$!string-table
+/ThirtyRight % xs xe ys ye dy
+{
+ 3 index 5 index sub 3.0 sqrt div % xs xe ys ye dy ydiff
+ 3 index % xs xe ys ye dy ydiff y
+ {
+ dup 4 index gt {exit} if % xs xe ys ye dy ydiff y
+ 6 index 1 index % xs xe ys ye dy ydiff y xs y
+ 7 index 1 index % xs xe ys ye dy ydiff y xs y xe y
+ 5 index add % xs xe ys ye dy ydiff y xs y xe y2
+ newpath moveto % xs xe ys ye dy ydiff y xs y
+ lineto stroke % xs xe ys ye dy ydiff y
+ 2 index add % xs xe ys ye dy ydiff y
+ }
+ loop % xs xe ys ye dy ydiff y
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p02[] = {
+$!string-table
+/ThirtyHatch % xs xe ys ye dy
+{
+ 3 index 5 index sub 3.0 sqrt div % xs xe ys ye dy ydiff
+ 3 index % xs xe ys ye dy ydiff y
+ {
+ dup 4 index gt {exit} if % xs xe ys ye dy ydiff y
+ 6 index 1 index % xs xe ys ye dy ydiff y xs y
+ 7 index 1 index % xs xe ys ye dy ydiff y xs y xe y
+ 5 index add % xs xe ys ye dy ydiff y xs y xe y2
+ newpath moveto % xs xe ys ye dy ydiff y xs y
+ lineto stroke % xs xe ys ye dy ydiff y
+ 2 index add % xs xe ys ye dy ydiff y
+ }
+ loop % xs xe ys ye dy ydiff y
+ pop pop % xs xe ys ye dy
+ 3 index 5 index sub 3.0 sqrt div % xs xe ys ye dy ydiff
+ 3 index % xs xe ys ye dy ydiff y
+ {
+ dup 4 index gt {exit} if % xs xe ys ye dy ydiff y
+ 5 index 1 index % xs xe ys ye dy ydiff y xe y
+ 8 index 1 index 5 index add % xs xe ys ye dy ydiff y xe y xs y2
+ newpath moveto % xs xe ys ye dy ydiff y xe y
+ lineto stroke % xs xe ys ye dy ydiff y
+ 2 index add % xs xe ys ye dy ydiff y
+ }
+ loop % xs xe ys ye dy ydiff y
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p03[] = {
+$!string-table
+/FourtyFiveLeft % xs xe ys ye dy
+{
+ 3 index 5 index sub % xs xe ys ye dy ydiff
+ 3 index % xs xe ys ye dy ydiff y
+ {
+ dup 4 index gt {exit} if % xs xe ys ye dy ydiff y
+ 5 index 1 index % xs xe ys ye dy ydiff y xe y
+ 8 index 1 index 5 index add % xs xe ys ye dy ydiff y xe y xs y2
+ newpath moveto % xs xe ys ye dy ydiff y xe y
+ lineto stroke % xs xe ys ye dy ydiff y
+ 2 index add % xs xe ys ye dy ydiff y
+ }
+ loop % xs xe ys ye dy ydiff y
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p04[] = {
+$!string-table
+/FourtyFiveRight % xs xe ys ye dy
+{
+ 3 index 5 index sub % xs xe ys ye dy ydiff
+ 3 index % xs xe ys ye dy ydiff y
+ {
+ dup 4 index gt {exit} if % xs xe ys ye dy ydiff y
+ 6 index 1 index % xs xe ys ye dy ydiff y xs y
+ 7 index 1 index % xs xe ys ye dy ydiff y xs y xe y
+ 5 index add % xs xe ys ye dy ydiff y xs y xe y2
+ newpath moveto % xs xe ys ye dy ydiff y xs y
+ lineto stroke % xs xe ys ye dy ydiff y
+ 2 index add % xs xe ys ye dy ydiff y
+ }
+ loop % xs xe ys ye dy ydiff y
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p05[] = {
+$!string-table
+/FourtyFiveHatch % xs xe ys ye dy
+{
+ 3 index 5 index sub % xs xe ys ye dy ydiff
+ 3 index % xs xe ys ye dy ydiff y
+ {
+ dup 4 index gt {exit} if % xs xe ys ye dy ydiff y
+ 5 index 1 index % xs xe ys ye dy ydiff y xe y
+ 8 index 1 index 5 index add % xs xe ys ye dy ydiff y xe y xs y2
+ newpath moveto % xs xe ys ye dy ydiff y xe y
+ lineto stroke % xs xe ys ye dy ydiff y
+ 2 index add % xs xe ys ye dy ydiff y
+ }
+ loop % xs xe ys ye dy ydiff y
+ pop pop % xs xe ys ye dy
+ 3 index 5 index sub % xs xe ys ye dy ydiff
+ 3 index % xs xe ys ye dy ydiff y
+ {
+ dup 4 index gt {exit} if % xs xe ys ye dy ydiff y
+ 6 index 1 index % xs xe ys ye dy ydiff y xs y
+ 7 index 1 index % xs xe ys ye dy ydiff y xs y xe y
+ 5 index add % xs xe ys ye dy ydiff y xs y xe y2
+ newpath moveto % xs xe ys ye dy ydiff y xs y
+ lineto stroke % xs xe ys ye dy ydiff y
+ 2 index add % xs xe ys ye dy ydiff y
+ }
+ loop % xs xe ys ye dy ydiff y
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p06[] = {
+$!string-table
+/HorizontalBricks % xs xe ys ye dy
+{
+ 2 index 0 % xs xe ys ye dy y nr
+ {
+ 1 index % xs xe ys ye dy y nr y
+ 4 index % xs xe ys ye dy y nr y ye
+ gt {exit} if % xs xe ys ye dy y nr
+ 6 index % xs xe ys ye dy y nr xs
+ 2 index % xs xe ys ye dy y nr xs y
+ 7 index % xs xe ys ye dy y nr xs y xe
+ 1 index % xs xe ys ye dy y nr xs y xe y
+ newpath moveto lineto stroke % xs xe ys ye dy y nr
+ 6 index % xs xe ys ye dy y nr x
+ 1 index 0 % xs xe ys ye dy y nr x nr 0
+ gt {3 index add} if % xs xe ys ye dy y nr x
+ {
+ dup 7 index % xs xe ys ye dy y nr x x xe
+ gt {exit} if % xs xe ys ye dy y nr x
+ dup 3 index % xs xe ys ye dy y nr x x y
+ 1 index 1 index % xs xe ys ye dy y nr x x y x y
+ 7 index add % xs xe ys ye dy y nr x x y x y
+ newpath moveto lineto stroke % xs xe ys ye dy y nr x
+ 3 index 2.0 mul add % xs xe ys ye dy y nr x
+ }
+ loop % xs xe ys ye dy y nr x
+ pop % xs xe ys ye dy y nr
+ 1 add % xs xe ys ye dy y nr
+ dup % xs xe ys ye dy y nr nr
+ 1 gt {pop 0} if % xs xe ys ye dy y nr
+ exch 2 index add exch % xs xe ys ye dy y nr
+ }
+ loop % xs xe ys ye dy y nr
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p07[] = {
+$!string-table
+/VerticalBricks % xs xe ys ye dx
+{
+ 4 index 0 % xs xe ys ye dx x nr
+ {
+ 1 index 6 index % xs xe ys ye dx x nr x xe
+ gt {exit} if % xs xe ys ye dx x nr
+ 1 index 5 index % xs xe ys ye dx x nr x ys
+ 1 index 6 index % xs xe ys ye dx x nr x ys x ye
+ newpath moveto lineto stroke % xs xe ys ye dx x nr
+ 4 index 1 index 0 % xs xe ys ye dx x nr y nr 0
+ gt {3 index add} if % xs xe ys ye dx x nr y
+ {
+ dup 5 index % xs xe ys ye dx x nr y y ye
+ gt {exit} if % xs xe ys ye dx x nr y
+ 2 index 1 index % xs xe ys ye dx x nr y x y
+ dup 2 index % xs xe ys ye dx x nr y x y y x
+ 7 index add exch % xs xe ys ye dx x nr y x y x y
+ newpath moveto lineto stroke % xs xe ys ye dx x nr y
+ 3 index 2.0 mul add % xs xe ys ye dx x nr y
+ }
+ loop % xs xe ys ye dx x nr y
+ pop % xs xe ys ye dx x nr
+ exch 2 index add exch % xs xe ys ye dx x nr
+ 1 add % xs xe ys ye dx x nr
+ dup 1 % xs xe ys ye dx x nr nr 1
+ gt {pop 0} if % xs xe ys ye dx x nr
+ }
+ loop % xs xe ys ye dx x nr
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p08[] = {
+$!string-table
+/HorizontalLines % xs xe ys ye dy
+{
+ 2 index % xs xe ys ye dy y
+ {
+ dup 3 index gt {exit} if % xs xe ys ye dy y
+ 4 index 1 index % xs xe ys ye dy y xe y
+ 7 index 1 index % xs xe ys ye dy y xe y xs y
+ newpath moveto % xs xe ys ye dy y xe y
+ lineto stroke % xs xe ys ye dy y
+ 1 index add % xs xe ys ye dy y
+ }
+ loop % xs xe ys ye dy y
+ pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p09[] = {
+$!string-table
+/VerticalLines % xs xe ys ye dx
+{
+ 4 index % xs xe ys ye dx x
+ {
+ dup 5 index gt {exit} if % xs xe ys ye dx x
+ dup 3 index % xs xe ys ye dx x x ye
+ 1 index 6 index % xs xe ys ye dx x x ye x ys
+ newpath moveto % xs xe ys ye dx x x ye
+ lineto stroke % xs xe ys ye dx x
+ 1 index add % xs xe ys ye dx x
+ }
+ loop % xs xe ys ye dx x
+ pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p10[] = {
+$!string-table
+/CrossHatch % xs xe ys ye dx
+{
+ 4 index % xs xe ys ye dx x
+ {
+ dup 5 index gt {exit} if % xs xe ys ye dx x
+ dup 3 index % xs xe ys ye dx x x ye
+ 1 index 6 index % xs xe ys ye dx x x ye x ys
+ newpath moveto % xs xe ys ye dx x x ye
+ lineto stroke % xs xe ys ye dx x
+ 1 index add % xs xe ys ye dx x
+ }
+ loop % xs xe ys ye dx x
+ pop % xs xe ys ye dy
+ 2 index % xs xe ys ye dy y
+ {
+ dup 3 index gt {exit} if % xs xe ys ye dy y
+ 4 index 1 index % xs xe ys ye dy y xe y
+ 7 index 1 index % xs xe ys ye dy y xe y xs y
+ newpath moveto % xs xe ys ye dy y xe y
+ lineto stroke % xs xe ys ye dy y
+ 1 index add % xs xe ys ye dy y
+ }
+ loop % xs xe ys ye dy y
+ pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p11[] = {
+$!string-table
+/HorizontalShinglesLeft % xs xe ys ye dy
+{
+ 2 index % xs xe ys ye dy y
+ {
+ dup 3 index gt {exit} if % xs xe ys ye dy y
+ 4 index 1 index % xs xe ys ye dy y xe y
+ 7 index 1 index % xs xe ys ye dy y xe y xs y
+ newpath moveto % xs xe ys ye dy y xe y
+ lineto stroke % xs xe ys ye dy y
+ 1 index add % xs xe ys ye dy y
+ }
+ loop % xs xe ys ye dy y
+ pop % xs xe ys ye dy
+ 2 index 0 % xs xe ys ye dy y nr
+ {
+ 1 index 4 index gt {exit} if % xs xe ys ye dy y nr
+ 6 index % xs xe ys ye dy y nr x
+ 1 index 2 gt
+ { 3 index 0.5 mul add }
+ {
+ 1 index 1 gt
+ { 3 index add }
+ {
+ 1 index 0 gt
+ { 3 index 1.5 mul add }
+ if
+ }
+ ifelse
+ }
+ ifelse
+ {
+ dup 7 index gt {exit} if % xs xe ys ye dy y nr x
+ dup 4 index 0.5 mul add % xs xe ys ye dy y nr x x2
+ 3 index 5 index add % xs xe ys ye dy y nr x x2 y2
+ 2 index 5 index newpath moveto % xs xe ys ye dy y nr x x2 y2
+ lineto stroke % xs xe ys ye dy y nr x
+ 3 index 2.0 mul add % xs xe ys ye dy y nr x
+ }
+ loop pop % xs xe ys ye dy y nr
+ exch 2 index add exch % xs xe ys ye dy y nr
+ 1 add dup 3 gt {pop 0} if % xs xe ys ye dy y nr
+ }
+ loop % xs xe ys ye dy y nr
+ pop pop pop pop pop pop pop
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p12[] = {
+$!string-table
+/HorizontalShinglesRight % xs xe ys ye dy
+{
+ 2 index % xs xe ys ye dy y
+ {
+ dup 3 index gt {exit} if % xs xe ys ye dy y
+ 4 index 1 index % xs xe ys ye dy y xe y
+ 7 index 1 index % xs xe ys ye dy y xe y xs y
+ newpath moveto % xs xe ys ye dy y xe y
+ lineto stroke % xs xe ys ye dy y
+ 1 index add % xs xe ys ye dy y
+ }
+ loop % xs xe ys ye dy y
+ pop % xs xe ys ye dy
+ 2 index 0 % xs xe ys ye dy y nr
+ {
+ 1 index 4 index gt {exit} if % xs xe ys ye dy y nr
+ 6 index % xs xe ys ye dy y nr x
+ 1 index 4 index 0.5 mul mul add % xs xe ys ye dy y nr x
+ {
+ dup 7 index gt {exit} if % xs xe ys ye dy y nr x
+ dup 3 index 5 index add % xs xe ys ye dy y nr x x y2
+ 1 index 6 index 0.5 mul add % xs xe ys ye dy y nr x x y2 x2
+ 5 index newpath moveto lineto % xs xe ys ye dy y nr x
+ stroke
+ 3 index 2.0 mul add % xs xe ys ye dy y nr x
+ }
+ loop pop % xs xe ys ye dy y nr
+ exch 2 index add exch % xs xe ys ye dy y nr
+ 1 add dup 3 gt {pop 0} if % xs xe ys ye dy y nr
+ }
+ loop % xs xe ys ye dy y nr
+ pop pop pop pop pop pop pop
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p13[] = {
+$!string-table
+/VerticalShinglesLeft % xs xe ys ye dx
+{
+ 4 index % xs xe ys ye dx x
+ {
+ dup 5 index gt {exit} if % xs xe ys ye dx x
+ dup 3 index % xs xe ys ye dx x x ye
+ 1 index 6 index % xs xe ys ye dx x x ye x ys
+ newpath moveto % xs xe ys ye dx x x ye
+ lineto stroke % xs xe ys ye dx x
+ 1 index add % xs xe ys ye dx x
+ }
+ loop % xs xe ys ye dx x
+ pop % xs xe ys ye dx
+ 4 index 0 % xs xe ys ye dx x nr
+ {
+ 1 index 6 index gt {exit} if % xs xe ys ye dx x nr
+ 4 index % xs xe ys ye dx x nr y
+ 3 index 2 index 0.5 mul mul add % xs xe ys ye dx x nr y
+ {
+ dup 5 index gt {exit} if % xs xe ys ye dx x nr y
+ 2 index 1 index % xs xe ys ye dx x nr y x y
+ 5 index 0.5 mul add % xs xe ys ye dx x nr y x y2
+ 1 index 6 index add 3 index % xs xe ys ye dx x nr y x y2 x2 y
+ newpath moveto lineto stroke % xs xe ys ye dx x nr y
+ 3 index 2.0 mul add % xs xe ys ye dx x nr y
+ }
+ loop pop % xs xe ys ye dx x nr
+ exch 2 index add exch % xs xe ys ye dx x nr
+ 1 add dup 3 gt {pop 0} if % xs xe ys ye dx x nr
+ }
+ loop % xs xe ys ye dx x nr
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p14[] = {
+$!string-table
+/VerticalShinglesRight % xs xe ys ye dx
+{
+ 4 index % xs xe ys ye dx x
+ {
+ dup 5 index gt {exit} if % xs xe ys ye dx x
+ dup 3 index % xs xe ys ye dx x x ye
+ 1 index 6 index % xs xe ys ye dx x x ye x ys
+ newpath moveto % xs xe ys ye dx x x ye
+ lineto stroke % xs xe ys ye dx x
+ 1 index add % xs xe ys ye dx x
+ }
+ loop % xs xe ys ye dx x
+ pop % xs xe ys ye dx
+ 4 index 0 % xs xe ys ye dx x nr
+ {
+ 1 index 6 index gt {exit} if % xs xe ys ye dx x nr
+ 4 index % xs xe ys ye dx x nr y
+ 1 index 2 gt
+ { 3 index 0.5 mul add }
+ {
+ 1 index 1 gt
+ { 3 index add }
+ {
+ 1 index 0 gt
+ { 3 index 1.5 mul add }
+ if
+ }
+ ifelse
+ }
+ ifelse
+ {
+ dup 5 index gt {exit} if % xs xe ys ye dx x nr y
+ 2 index 1 index % xs xe ys ye dx x nr y x y
+ 1 index 6 index add % xs xe ys ye dx x nr y x y x2
+ 1 index 7 index 0.5 mul add % xs xe ys ye dx x nr y x y x2 y2
+ newpath moveto lineto stroke % xs xe ys ye dx x nr y
+ 3 index 2.0 mul add % xs xe ys ye dx x nr y
+ }
+ loop pop % xs xe ys ye dx x nr
+ exch 2 index add exch % xs xe ys ye dx x nr
+ 1 add dup 3 gt {pop 0} if % xs xe ys ye dx x nr
+ }
+ loop % xs xe ys ye dx x nr
+ pop pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p15[] = {
+$!string-table
+/FishScales % xs xe ys ye dx dy r a1 a2
+{
+ 6 index 0 % xs xe ys ye dx dy r a1 a2 y nr
+ {
+ 1 index 8 index gt {exit} if % xs xe ys ye dx dy r a1 a2 y nr
+ 10 index % xs xe ys ye dx dy r a1 a2 y nr x
+ 1 index 0 gt
+ { 7 index 0.5 mul add }
+ if
+ {
+ dup 11 index gt {exit} if % xs xe ys ye dx dy r a1 a2 y nr x
+ dup 3 index 8 index add % xs xe ys ye dx dy r a1 a2 y nr x x y+dy
+ newpath moveto % xs xe ys ye dx dy r a1 a2 y nr x
+ dup 8 index 0.5 mul add % xs xe ys ye dx dy r a1 a2 y nr x xm
+ 3 index 7 index add % xs xe ys ye dx dy r a1 a2 y nr x xm ym
+ 7 index 7 index 7 index % xs xe ys ye dx dy r a1 a2 y nr x xm ym r a1 a2
+ arc stroke % xs xe ys ye dx dy r a1 a2 y nr x
+ 7 index add % xs xe ys ye dx dy r a1 a2 y nr x
+ }
+ loop pop % xs xe ys ye dx dy r a1 a2 y nr
+ exch 5 index add exch % xs xe ys ye dx dy r a1 a2 y nr
+ 1 add dup 1 gt {pop 0} if % xs xe ys ye dx dy r a1 a2 y nr
+ }
+ loop % xs xe ys ye dx dy r a1 a2 y nr
+ pop pop pop pop pop pop pop pop pop pop pop
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p16[] = {
+$!string-table
+/SmallFishScales % xs xe ys ye dx dy r a1 a2
+{
+ 6 index 0 % xs xe ys ye dx dy r a1 a2 y nr
+ {
+ 1 index 8 index gt {exit} if % xs xe ys ye dx dy r a1 a2 y nr
+ 10 index % xs xe ys ye dx dy r a1 a2 y nr x
+ 1 index 0 gt
+ { 7 index 0.5 mul add }
+ if
+ {
+ dup 11 index gt {exit} if % xs xe ys ye dx dy r a1 a2 y nr x
+ dup 3 index 8 index add % xs xe ys ye dx dy r a1 a2 y nr x x y+dy
+ newpath moveto % xs xe ys ye dx dy r a1 a2 y nr x
+ dup 8 index 0.5 mul add % xs xe ys ye dx dy r a1 a2 y nr x xm
+ 3 index 7 index add % xs xe ys ye dx dy r a1 a2 y nr x xm ym
+ 7 index 7 index 7 index % xs xe ys ye dx dy r a1 a2 y nr x xm ym r a1 a2
+ arc stroke % xs xe ys ye dx dy r a1 a2 y nr x
+ 7 index add % xs xe ys ye dx dy r a1 a2 y nr x
+ }
+ loop pop % xs xe ys ye dx dy r a1 a2 y nr
+ exch 5 index add exch % xs xe ys ye dx dy r a1 a2 y nr
+ 1 add dup 1 gt {pop 0} if % xs xe ys ye dx dy r a1 a2 y nr
+ }
+ loop % xs xe ys ye dx dy r a1 a2 y nr
+ pop pop pop pop pop pop pop pop pop pop pop
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p17[] = {
+$!string-table
+/Circles % xs xe ys ye r
+{
+ 2 index % xs xe ys ye r y
+ {
+ dup 3 index gt {exit} if
+ 5 index % xs xe ys ye r y x
+ {
+ dup 6 index gt {exit} if
+ dup 3 index add % xs xe ys ye r y x xm
+ 2 index 4 index add % xs xe ys ye r y x xm ym
+ 4 index 0 360 % xs xe ys ye r y x xm ym r a1 a2
+ 4 index 3 index add % xs xe ys ye r y x xm ym r a1 a2 xr
+ 4 index % xs xe ys ye r y x xm ym r a1 a2 xr yr
+ newpath moveto arc
+ closepath stroke % xs xe ys ye r y x
+ 2 index dup add add
+ }
+ loop pop
+ 1 index dup add add % xs xe ys ye r y
+ }
+ loop % xs xe ys ye r y
+ pop pop pop pop pop pop % --
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p18[] = {
+$!string-table
+/Hexagons % xs xe ys ye dx dy
+{
+ 1 index 3.0 div % xs xe ys ye dx dy r
+ 4 index % xs xe ys ye dx dy r y
+ {
+ dup 5 index gt {exit} if
+ 7 index % xs xe ys ye dx dy r y x
+ {
+ dup 8 index gt {exit} if
+ newpath
+ dup 3 index 3.0 mul add % xs xe ys ye dx dy r y x x0
+ 2 index 5 index 0.5 mul add % xs xe ys ye dx dy r y x x0 y0
+ moveto % xs xe ys ye dx dy r y x
+ dup 3 index 2.0 mul add % xs xe ys ye dx dy r y x x1
+ 2 index 5 index 0.5 mul add % xs xe ys ye dx dy r y x x1 y1
+ lineto % xs xe ys ye dx dy r y x
+ dup 3 index 1.5 mul add % xs xe ys ye dx dy r y x x2
+ 2 index 5 index add % xs xe ys ye dx dy r y x x2 y2
+ lineto % xs xe ys ye dx dy r y x
+ dup 3 index 0.5 mul add % xs xe ys ye dx dy r y x x3
+ 2 index 5 index add % xs xe ys ye dx dy r y x x3 y3
+ lineto % xs xe ys ye dx dy r y x
+ dup 2 index 5 index 0.5 mul add % xs xe ys ye dx dy r y x x4 y4
+ lineto % xs xe ys ye dx dy r y x
+ dup 3 index 0.5 mul add 2 index % xs xe ys ye dx dy r y x x5 y5
+ lineto % xs xe ys ye dx dy r y x
+ dup 3 index 1.5 mul add 2 index % xs xe ys ye dx dy r y x x6 y6
+ lineto % xs xe ys ye dx dy r y x
+ dup 3 index 2.0 mul add % xs xe ys ye dx dy r y x x7
+ 2 index 5 index 0.5 mul add % xs xe ys ye dx dy r y x x7 y7
+ lineto stroke % xs xe ys ye dx dy r y x
+ 4 index add
+ }
+ loop pop
+ 2 index add
+ }
+ loop pop pop pop pop pop pop pop pop
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p19[] = {
+$!string-table
+/Octagons % xs xe ys ye dx co
+{
+ 3 index % xs xe ys ye dx co y
+ {
+ dup 4 index gt {exit} if
+ 6 index % xs xe ys ye dx co y x
+ {
+ dup 7 index gt {exit} if % xs xe ys ye dx co y x
+ newpath
+ dup 3 index add % xs xe ys ye dx co y x x0
+ 2 index % xs xe ys ye dx co y x x0 y0
+ moveto % xs xe ys ye dx co y x
+ dup 4 index add 3 index sub % xs xe ys ye dx co y x x1
+ 2 index % xs xe ys ye dx co y x x1 y1
+ lineto % xs xe ys ye dx co y x
+ dup 4 index add % xs xe ys ye dx co y x x2
+ 2 index 4 index add % xs xe ys ye dx co y x x2 y2
+ lineto % xs xe ys ye dx co y x
+ dup 4 index add % xs xe ys ye dx co y x x3
+ 2 index 5 index add 4 index sub % xs xe ys ye dx co y x x3 y3
+ lineto % xs xe ys ye dx co y x
+ dup 4 index add 3 index sub % xs xe ys ye dx co y x x4
+ 2 index 5 index add % xs xe ys ye dx co y x x4 y4
+ lineto % xs xe ys ye dx co y x
+ dup 3 index add % xs xe ys ye dx co y x x5
+ 2 index 5 index add % xs xe ys ye dx co y x x5 y5
+ lineto % xs xe ys ye dx co y x
+ dup % xs xe ys ye dx co y x x6
+ 2 index 5 index add 4 index sub % xs xe ys ye dx co y x x6 y6
+ lineto % xs xe ys ye dx co y x
+ dup % xs xe ys ye dx co y x x7
+ 2 index 4 index add % xs xe ys ye dx co y x x7 y7
+ lineto closepath stroke % xs xe ys ye dx co y x
+ 3 index add
+ }
+ loop pop
+ 2 index add
+ }
+ loop pop pop pop pop pop pop pop
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p20[] = {
+$!string-table
+/HorizontalTireTreads % xs xe ys ye dx
+{
+ dup 0.5 mul % xs xe ys ye dx r
+ 3 index % xs xe ys ye dx r y
+ {
+ dup 4 index gt {exit} if
+ 6 index % xs xe ys ye dx r y x
+ {
+ dup 7 index gt {exit} if % xs xe ys ye dx r y x
+ dup 4 index add 2 index % xs xe ys ye dx r y x x2 y2
+ 2 index 5 index add % xs xe ys ye dx r y x x2 y2 x1
+ 4 index 6 index add % xs xe ys ye dx r y x x2 y2 x1 y1
+ 4 index 6 index % xs xe ys ye dx r y x x2 y2 x1 y1 x0 y0
+ newpath moveto lineto lineto % xs xe ys ye dx r y x
+ stroke
+ 3 index add
+ }
+ loop pop % xs xe ys ye dx r y
+ 2 index add
+ }
+ loop % xs xe ys ye dx r y
+ pop pop pop pop pop pop pop
+} bind def
+$!end
+};
+
+
+
+/** Pattern procedure.
+*/
+static const char * const p21[] = {
+$!string-table
+/VerticalTireTreads % xs xe ys ye dx
+{
+ dup 0.5 mul % xs xe ys ye dx r
+ 5 index % xs xe ys ye dx r x
+ {
+ dup 6 index gt {exit} if
+ 4 index % xs xe ys ye dx r x y
+ {
+ dup 5 index gt {exit} if
+ 1 index 1 index 5 index add % xs xe ys ye dx r x y x2 y2
+ 3 index 5 index add % xs xe ys ye dx r x y x2 y2 x1
+ 3 index 6 index add % xs xe ys ye dx r x y x2 y2 x1 y1
+ 5 index 5 index % xs xe ys ye dx r x y x2 y2 x1 y1 x0 y0
+ newpath moveto lineto lineto % xs xe ys ye dx r x y
+ stroke
+ 3 index add
+ }
+ loop pop
+ 2 index add
+ }
+ loop % xs xe ys ye dx r x
+ pop pop pop pop pop pop pop
+} bind def
+$!end
+};
+
+
+
+/** Pattern names.
+*/
+static const char * const pnames[] = {
+$!string-table
+ThirtyLeft
+ThirtyRight
+ThirtyHatch
+FourtyFiveLeft
+FourtyFiveRight
+FourtyFiveHatch
+HorizontalBricks
+VerticalBricks
+HorizontalLines
+VerticalLines
+CrossHatch
+HorizontalShinglesLeft
+HorizontalShinglesRight
+VerticalShinglesLeft
+VerticalShinglesRight
+FishScales
+SmallFishScales
+Circles
+Hexagons
+Octagons
+HorizontalTireTreads
+VerticalTireTreads
+$!end
+};
+
+
+
+/** Pattern procedures.
+*/
+static const char * const * pproc[] = {
+p00, p01, p02, p03, p04, p05, p06, p07, p08, p09,
+p10, p11, p12, p13, p14, p15, p16, p17, p18, p19,
+p20, p21
+};
+
+
+
+const char * const *
+dk4gra_eps_pattern_procedure(size_t i)
+{
+ const char * const *back = NULL;
+#if DK4_USE_ASSERT
+ assert(DK4_GRA_PATTERN_MAX >= i);
+#endif
+ if (DK4_GRA_PATTERN_MAX >= i) {
+ back = pproc[i];
+ }
+ return back;
+}
+
+
+
+const char *
+dk4gra_eps_pattern_name(size_t i)
+{
+ const char *back = NULL;
+#if DK4_USE_ASSERT
+ assert(DK4_GRA_PATTERN_MAX >= i);
+#endif
+ if (DK4_GRA_PATTERN_MAX >= i) {
+ back = pnames[i];
+ }
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4greps.c b/support/dktools/dk4greps.c
new file mode 100644
index 0000000000..5cd486da3d
--- /dev/null
+++ b/support/dktools/dk4greps.c
@@ -0,0 +1,2656 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4greps.ctr
+*/
+
+/** @file dk4greps.c The dk4greps module.
+*/
+
+
+#line 8 "dk4greps.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MEMBF_H_INCLUDED
+#include "dk4membf.h"
+#endif
+
+#ifndef DK4MBSTRM_H_INCLUDED
+#include "dk4mbstrm.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 60 "dk4greps.ctr"
+
+
+
+/** Constant text fragments.
+*/
+static const char * const dk4gra_eps_c8_kw[] = {
+/* 0 */
+"\n",
+
+/* 1 */
+"gsave\n",
+
+/* 2 */
+"grestore\n",
+
+/* 3 */
+" ",
+
+/* 4 */
+" setlinewidth\n",
+
+/* 5 */
+" setcmykcolor\n",
+
+/* 6 */
+" setrgbcolor\n",
+
+/* 7 */
+" setgray\n",
+
+/* 8 */
+"[] 0 setdash\n",
+
+/* 9 */
+"[",
+
+/* 10 */
+"]",
+
+/* 11 */
+" setdash\n",
+
+/* 12 */
+"0 setlinecap\n",
+
+/* 13 */
+"1 setlinecap\n",
+
+/* 14 */
+"2 setlinecap\n",
+
+/* 15 */
+"0 setlinejoin\n",
+
+/* 16 */
+"1 setlinejoin\n",
+
+/* 17 */
+"2 setlinejoin\n",
+
+/* 18 */
+"fill\n",
+
+/* 19 */
+"eofill\n",
+
+/* 20 */
+"stroke\n",
+
+/* 21 */
+"clip\n",
+
+/* 22 */
+"eoclip\n",
+
+/* 23 */
+"newpath\n",
+
+/* 24 */
+" moveto\n",
+
+/* 25 */
+" lineto\n",
+
+/* 26 */
+" curveto\n",
+
+/* 27 */
+"closepath\n",
+
+/* 28 */
+" 0 360 arc closepath\n",
+
+/* 29 */
+" arc\n",
+
+/* 30 */
+"%!PS-Adobe-3.0 EPSF-3.0\n",
+
+/* 31 */
+"%!PS-Adobe-2.0 EPSF-2.0\n",
+
+/* 32 */
+"%!PS-Adobe-3.0\n",
+
+/* 33 */
+"%!PS-Adobe-2.0\n",
+
+/* 34 */
+"%%LanguageLevel: 3\n",
+
+/* 35 */
+"%%LanguageLevel: 2\n",
+
+/* 36 */
+"%%BoundingBox: 0 0 ",
+
+/* 37 */
+"%%Pages: ",
+
+/* 38 */
+"%%PageOrder: Ascend\n",
+
+/* 39 */
+"%%DocumentData: Clean7Bit\n",
+
+/* 40 */
+"%%EndComments\n%%BeginProlog\n%%EndProlog\n",
+
+/* 41 */
+"%%Trailer\n%%EOF\n",
+
+/* 42 */
+"%%Page: ",
+
+/* 43 */
+" dict begin\n",
+
+/* 44 */
+"end\n",
+
+/* 45 */
+"showpage\n",
+
+/* 46 */
+"0 0 moveto\n",
+
+/* 47 */
+"0",
+
+/* 48 */
+"1 setlinecap\n",
+
+/* 49 */
+"1 setgray\n",
+
+/* 50 */
+" setmiterlimit\n",
+
+/* 51 */
+"%%BeginSetup\n",
+
+/* 52 */
+"%%EndSetup\n",
+
+/* 53 */
+"%%BeginFeature: *PageSize BmppPage\n",
+
+/* 54 */
+"%%EndFeature\n",
+
+/* 55 */
+"<< /PageSize [",
+
+/* 56 */
+"] /ImagingBBox null >> setpagedevice\n",
+
+/* 57 */
+"%%BeginFeature: *Duplex DuplexNoTumble\n",
+
+/* 58 */
+"<< /Duplex true /Tumble false >> setpagedevice\n",
+
+/* 59 */
+"%%BeginFeature: *Duplex DuplexTumble\n",
+
+/* 60 */
+"<< /Duplex true /Tumble true >> setpagedevice\n",
+
+NULL
+
+
+#line 261 "dk4greps.ctr"
+};
+
+
+
+/** Write double value to page memory stream.
+ @param bptr Current page.
+ @param v Value to write.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if os is NULL.
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+static
+void
+dk4gra_eps_double_value(
+ dk4_gra_ps_page_t *bptr,
+ double v,
+ int *backptr,
+ dk4_er_t *erp
+
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ dk4gratool_stream_double(bptr->memstrm, v, backptr, erp);
+}
+
+
+
+/** Write a fixed keyword from dk4gra_eps_c8_kw to page memory stream.
+ @param bptr Current page.
+ @param i Index of keyword in array.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_eps_kw(
+ dk4_gra_ps_page_t *bptr,
+ size_t i,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ dk4gratool_stream_string(bptr->memstrm, dk4gra_eps_c8_kw[i], backptr, erp);
+}
+
+
+/** Delete a PS/EPS page structure.
+ @param bptr Page structure to delete.
+*/
+static
+void
+dk4gra_eps_page_delete(
+ dk4_gra_ps_page_t *bptr
+)
+{
+
+
+#line 343 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ if (NULL != bptr) {
+ /*
+ Release all resources
+ */
+ if (NULL != bptr->memstrm) {
+
+#line 351 "dk4greps.ctr"
+ dk4stream_close(bptr->memstrm, NULL);
+ }
+ bptr->memstrm = NULL;
+ if (NULL != bptr->membuf) {
+
+#line 355 "dk4greps.ctr"
+ dk4membuf_close(bptr->membuf);
+ }
+ bptr->membuf = NULL;
+ /*
+ Free memory for page structure itself
+ */
+ dk4mem_free(bptr);
+ }
+
+
+#line 364 "dk4greps.ctr"
+}
+
+
+
+/** Create new page structure, allocated related resources.
+ @param pageno Page number of new page.
+ @param flags Page flags.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new page structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the product of elsize and nelem,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+static
+dk4_gra_ps_page_t *
+dk4gra_eps_page_new(
+ size_t pageno,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *back = NULL;
+ size_t i = 0; /* Traverse patterns */
+ int ok = 0;
+
+
+#line 393 "dk4greps.ctr"
+ back = dk4mem_new(dk4_gra_ps_page_t,1,erp);
+ if (NULL != back) {
+ /*
+ Initialize all components
+ */
+ dk4gratool_initialize_attributes(&(back->attr));
+ back->membuf = NULL;
+ back->memstrm = NULL;
+ back->flags = flags;
+ for (i = 0; i < 22; i++) {
+ back->patu[i] = 0x00;
+ }
+ back->pageno = pageno;
+ back->spip = 0;
+ back->cont = 0;
+ /*
+ Allocate resources for memory buffer and stream
+ */
+ back->membuf = dk4membuf_open(erp);
+ if (NULL != back->membuf) {
+ back->memstrm = dk4stream_open_membuf_writer(back->membuf, erp);
+ if (NULL != back->memstrm) {
+ ok = 1;
+ }
+ }
+ if (0 == ok) {
+ dk4gra_eps_page_delete(back);
+ back = NULL;
+ }
+ }
+
+
+#line 424 "dk4greps.ctr"
+ return back;
+}
+
+
+
+/** Write several double values to page memory stream and add keyword.
+ @param bptr Current page.
+ @param da Array of double values.
+ @param szda Number of elements in array.
+ @param kwi Index of keyword to add.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra, bptr or da or the current page or the page stream on the
+ current page is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent in one of the double values is out of range for
+ integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if the text representation of the double value
+ contains invalid characters.
+*/
+static
+void
+dk4gra_eps_values_and_keyword(
+ dk4_gra_ps_page_t *bptr,
+ double *da,
+ size_t szda,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t i; /* Traverse da */
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != da);
+ assert(0 < szda);
+#endif
+ for (i = 0; i < szda; i++) {
+ if (0 != i) {
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ }
+ dk4gra_eps_double_value(bptr, da[i], &back, erp);
+ }
+ if (0 < kwi) {
+ dk4gra_eps_kw(bptr, kwi, &back, erp);
+ }
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+/** Set new color if necessary.
+ @param bptr Current page.
+ @param p_col_active Currently active color.
+ @param p_col_requested Requested color.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra, bptr or da or the current page or the page stream on the
+ current page is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent in one of the double values is out of range for
+ integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if the text representation of the double value
+ contains invalid characters.
+*/
+static
+int
+dk4gra_eps_set_color_if_necessary(
+ dk4_gra_ps_page_t *bptr,
+ dk4gra_col_t *p_col_active,
+ dk4gra_col_t *p_col_requested,
+ dk4_er_t *erp
+)
+{
+ double val[4]; /* Color components */
+ int back = 0;
+
+
+#line 518 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != p_col_active);
+ assert(NULL != p_col_requested);
+#endif
+ if (0 == dk4gratool_colors_differ(p_col_active, p_col_requested)) {
+ back = 1;
+ goto finished;
+ }
+ dk4mem_cpy(p_col_active, p_col_requested, sizeof(dk4gra_col_t), NULL);
+ switch (p_col_active->what) {
+ case DK4_GRA_COL_SPEC_CMYK : {
+ val[0] = p_col_active->data.cmyk.c;
+ val[1] = p_col_active->data.cmyk.m;
+ val[2] = p_col_active->data.cmyk.y;
+ val[3] = p_col_active->data.cmyk.k;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 4, 5, &back, erp);
+ } break;
+ case DK4_GRA_COL_SPEC_RGB : {
+ val[0] = p_col_active->data.rgb.r;
+ val[1] = p_col_active->data.rgb.g;
+ val[2] = p_col_active->data.rgb.b;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 3, 6, &back, erp);
+ } break;
+ case DK4_GRA_COL_SPEC_GRAY : {
+ val[0] = p_col_active->data.gray;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 1, 7, &back, erp);
+ } break;
+ }
+
+ finished:
+
+
+#line 553 "dk4greps.ctr"
+ return back;
+}
+
+
+
+/** Write dash setup.
+ @param bptr Current page in gra.
+ @param da Array of double values for stroke and gap lengths.
+ @param sz Number of elements in array.
+ @param offset Offset to start dash pattern.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if the contents stream of the current page
+ is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent of a doublevalue is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if a double value converted to string contains invalid characters.
+*/
+static
+int
+dk4gra_eps_dash_out(
+ dk4_gra_ps_page_t *bptr,
+ double *da,
+ size_t sz,
+ double offset,
+ dk4_er_t *erp
+)
+{
+ size_t i; /* Traverse dash length array da */
+ int back = 1;
+
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != da);
+ assert(0 < sz);
+#endif
+ dk4gra_eps_kw(bptr, 9, &back, erp);
+ for (i = 0; i < sz; i++) {
+ if (0 != i) {
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ }
+ dk4gra_eps_double_value(bptr, da[i], &back, erp);
+ }
+ dk4gra_eps_kw(bptr, 10, &back, erp);
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ dk4gra_eps_double_value(bptr, offset, &back, erp);
+ dk4gra_eps_kw(bptr, 11, &back, erp);
+ return back;
+}
+
+
+
+/** Put string to output file, on error set return code and error code.
+ @param fout Output file.
+ @param str String to write.
+ @param pret Address of return code variable.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_WRITE_FAILED<br>
+ if the write attempt failed.
+*/
+static
+void
+dk4gra_eps_string_to_file(
+ FILE *fout,
+ const char *str,
+ int *pret,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != fout);
+ assert(NULL != str);
+#endif
+ if (EOF == fputs(str, fout)) {
+ *pret = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
+ }
+}
+
+
+
+/** Construct path for page border.
+ @param fout Output file to write.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if arguments are invalid,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen),
+ - DK4_E_WRITE_FAILED<br>
+ if the write attempt failed.
+*/
+static
+void
+dk4gra_eps_page_border_path(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ char b1[16*sizeof(dk4_um_t)]; /* Width as text */
+ char b2[16*sizeof(dk4_um_t)]; /* Height as text */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ (void)dk4ma_write_c8_decimal_unsigned(b1, sizeof(b1), gra->w, 0, erp);
+ (void)dk4ma_write_c8_decimal_unsigned(b2, sizeof(b2), gra->h, 0, erp);
+ /* 0 0 moveto */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[23], backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[46], backptr, erp);
+ /* w 0 lineto */
+ dk4gra_eps_string_to_file(fout, b1, backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[47], backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[25], backptr, erp);
+ /* w h lineto */
+ dk4gra_eps_string_to_file(fout, b1, backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], backptr, erp);
+ dk4gra_eps_string_to_file(fout, b2, backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[25], backptr, erp);
+ /* 0 h lineto */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[47], backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], backptr, erp);
+ dk4gra_eps_string_to_file(fout, b2, backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[25], backptr, erp);
+ /* closepath */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[27], backptr, erp);
+}
+
+
+/** Write one page to output file.
+ @param fout Output file.
+ @param gra Output structure.
+ @param bptr Current page.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_eps_one_page_to_file(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_gra_ps_page_t *bptr,
+ dk4_er_t *erp
+)
+{
+ char b1[8*sizeof(dk4_um_t)]; /* Page no as text */
+ char b2[8*sizeof(dk4_um_t)]; /* Pages number as text */
+ const char * const *pproc; /* Pattern procedure name */
+ size_t numpat = 0; /* Number of used pats */
+ size_t i = 0; /* Traverse used pats */
+ int back = 1;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ /* %%Page: 1 1
+ */
+ if (0 != gra->out.ps.dsc) {
+ (void)dk4ma_write_c8_decimal_unsigned(
+ b1, sizeof(b1), (bptr->pageno + 1), 0, erp
+ );
+ (void)dk4ma_write_c8_decimal_unsigned(
+ b2, sizeof(b2), gra->pages, 0, erp
+ );
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[42], &back, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], &back, erp);
+ dk4gra_eps_string_to_file(fout, b2, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[0], &back, erp);
+ }
+
+ /* Count number of used patterns.
+ */
+ for (i = 0; i <= DK4_GRA_PATTERN_MAX; i++) {
+ if (0 != bptr->patu[i]) { numpat++; }
+ }
+
+ /* xxx dict begin
+ */
+ if (0 != numpat) {
+ (void)dk4ma_write_c8_decimal_unsigned(b1, sizeof(b1), numpat, 0, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[43], &back, erp);
+ for (i = 0; i <= DK4_GRA_PATTERN_MAX; i++) {
+ if (0 != bptr->patu[i]) {
+ pproc = dk4gra_eps_pattern_procedure(i);
+ while (NULL != *pproc) {
+ if (EOF == fputs(*(pproc++), fout)) { back = 0; }
+ if (EOF == fputc('\n', fout)) { back = 0; }
+ }
+ }
+ }
+ }
+
+ /* gsave
+ */
+ if (0 == bptr->spip) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[1], &back, erp);
+ }
+
+ /* clip path
+ */
+ if (
+ (0 == ((bptr->flags) & DK4_GRA_PAGE_FLAG_NO_CLIP))
+ && (0 == bptr->spip)
+ ) {
+ /* construct path */
+ dk4gra_eps_page_border_path(fout, gra, &back, erp);
+ /* clip */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[21], &back, erp);
+ }
+
+ /* white page background
+ */
+ if (
+ (0 == ((bptr->flags) & DK4_GRA_PAGE_FLAG_NO_BG))
+ && (0 == bptr->spip)
+ ) {
+ /* white color */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[49], &back, erp);
+ bptr->attr.col_stroke_active.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_stroke_active.data.gray = 1.0;
+ /* construct path */
+ dk4gra_eps_page_border_path(fout, gra, &back, erp);
+ /* fill */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[18], &back, erp);
+ }
+
+ /* page contents
+ */
+ if (NULL != bptr->memstrm) {
+ if (0 == dk4stream_close(bptr->memstrm, erp)) {
+ back = 0;
+ }
+ bptr->memstrm = NULL;
+ }
+ if (NULL != bptr->membuf) {
+ if (0 == dk4membuf_to_file(fout, bptr->membuf, erp)) {
+ back = 0;
+ }
+ }
+
+ /* grestore
+ */
+ if (0 == bptr->spip) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[2], &back, erp);
+ }
+
+ /* end
+ */
+ if (0 != numpat) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[44], &back, erp);
+ }
+
+ /* showpage
+ */
+ if ((DK4_GRA_DRIVER_EPS != gra->dr) && (0 == bptr->spip)) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[45], &back, erp);
+ }
+
+ return back;
+}
+
+
+
+/** Write pattern instance.
+ @param bptr Current page.
+ @param da Array of values.
+ @param szda Size of da array (number of elements).
+ @param pname Pattern name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_eps_write_pattern_instance(
+ dk4_gra_ps_page_t *bptr,
+ const double *da,
+ size_t szda,
+ const char *pname,
+ dk4_er_t *erp
+)
+{
+ size_t i; /* Traverse da array */
+ int res; /* Operation result */
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != da);
+ assert(0 < szda);
+ assert(NULL != pname);
+#endif
+ for (i = 0; i < szda; i++) {
+ if (0 != i) {
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ }
+ res = dk4ma_write_c8_double_no_sci_to_stream(
+ bptr->memstrm, *(da++), DK4_GRA_EPSILON_COORDINATES, 0, 1, erp
+ );
+ if (0 == res) { back = 0; }
+ }
+ if (0 < i) {
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ }
+ res = dk4stream_write_char_string(bptr->memstrm, pname, erp);
+ if (0 == res) { back = 0; }
+ dk4gra_eps_kw(bptr, 0, &back, erp);
+ return back;
+}
+
+
+
+/** Compare page structures by number or a page against a number.
+ @param l Left page object.
+ @param r Right page object or page number.
+ @param cr Comparison criteria (0=page/page, 1=page/number).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_eps_compare_pages_by_number(const void *l, const void *r, int cr)
+{
+ const dk4_gra_ps_page_t *pl; /* Left side object */
+ const dk4_gra_ps_page_t *pr; /* Right side object */
+ const size_t *ppno; /* Address of a page number */
+
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_ps_page_t *)l;
+ switch (cr) {
+ case 1: {
+ ppno = (const size_t *)r;
+ if (pl->pageno > *ppno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < *ppno) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ pr = (const dk4_gra_ps_page_t *)r;
+ if (pl->pageno > pr->pageno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < pr->pageno) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Write PS/EPS contents to file.
+ @param fout File, opened for write access.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_WRITE_FAILED<br>
+ if the write attempt failed.
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_CLOSE_FAILED<br>
+ if closing downward data failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if an internal buffer in this function is too small (should not happen).
+ - DK4_E_BUG<br>
+ if an internal buffer in dk4ma_write_c8_decimal_unsigned()
+ is too small (should not happen).
+*/
+static
+int
+dk4gra_eps_file(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ char b1[8*sizeof(dk4_um_t)]; /* Buffer for numbers */
+ char b2[8*sizeof(dk4_um_t)]; /* Buffer for numbers */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 1;
+
+
+#line 972 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ /* Document header
+ ---------------
+ */
+
+ /* %!PS-Adobe-2.0 (EPSF...)
+ */
+ if (DK4_GRA_DRIVER_EPS == gra->dr) {
+ dk4gra_eps_string_to_file(
+ fout, dk4gra_eps_c8_kw[(3 == gra->out.ps.llev) ? (30) : (31)],
+ &back, erp
+ );
+ }
+ else {
+ dk4gra_eps_string_to_file(
+ fout, dk4gra_eps_c8_kw[(3 == gra->out.ps.llev) ? (32) : (33)],
+ &back, erp
+ );
+ }
+
+ /* %%LanguageLevel
+ */
+ dk4gra_eps_string_to_file(
+ fout, dk4gra_eps_c8_kw[(3 == gra->out.ps.llev) ? (34) : (35)],
+ &back, erp
+ );
+
+ /* %%BoundingBox
+ */
+ (void)dk4ma_write_c8_decimal_unsigned(b1, sizeof(b1), gra->w, 0, erp);
+ (void)dk4ma_write_c8_decimal_unsigned(b2, sizeof(b2), gra->h, 0, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[36], &back, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], &back, erp);
+ dk4gra_eps_string_to_file(fout, b2, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[0], &back, erp);
+
+
+ if (0 != gra->out.ps.dsc) {
+
+ /* %%Title -- ignored
+ */
+
+ /* %%Creator -- ignored
+ */
+
+ /* %%CreationDate -- ignored
+ */
+
+ /* %%Pages
+ */
+ (void)dk4ma_write_c8_decimal_unsigned(
+ b1, sizeof(b1), gra->pages, 0, erp
+ );
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[37], &back, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[0], &back, erp);
+
+
+ /* %%PageOrder
+ */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[38], &back, erp);
+
+ /* %%DocumentData
+ */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[39], &back, erp);
+
+ /* %%EndComments BeginProlog EndProlog
+ */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[40], &back, erp);
+
+ /* Page setup for PS documents
+ */
+ if (DK4_GRA_DRIVER_PS == gra->dr) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[51], &back, erp);
+ /*
+ Paper size
+ */
+ (void)dk4ma_write_c8_decimal_unsigned(b1,sizeof(b1),gra->w,0,erp);
+ (void)dk4ma_write_c8_decimal_unsigned(b2,sizeof(b2),gra->h,0,erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[53], &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[55], &back, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], &back, erp);
+ dk4gra_eps_string_to_file(fout, b2, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[56], &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[54], &back, erp);
+ /*
+ Duplex (and tumble)
+ */
+ if (0 != (DK4_GRA_DOC_FLAG_TUMBLE & (gra->docfl))) {
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[59],&back,erp);
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[60],&back,erp);
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[54],&back,erp);
+ }
+ else {
+ if (0 != (DK4_GRA_DOC_FLAG_DUPLEX & (gra->docfl))) {
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[57],&back,erp);
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[58],&back,erp);
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[54],&back,erp);
+ }
+ }
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[52], &back, erp);
+ }
+
+ }
+
+ /* Pages
+ -----
+ */
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_ps_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ if (0 == dk4gra_eps_one_page_to_file(fout, gra, bptr, erp)) {
+ back = 0;
+ }
+ }
+ } while (NULL != bptr);
+
+
+ /* Document trailer
+ ----------------
+ */
+
+ if (0 != gra->out.ps.dsc) {
+ /* %%Trailer %%EOF
+ */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[41], &back, erp);
+ }
+
+ /* Ctrl-D
+ */
+ if (DK4_GRA_DRIVER_PS == gra->dr) {
+ if (EOF == fputc(0x04, fout)) {
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
+ }
+ }
+
+
+
+#line 1116 "dk4greps.ctr"
+ return back;
+}
+
+
+
+void
+dk4gra_eps_close(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page to release */
+
+
+
+#line 1129 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ goto finished;
+ }
+ if (NULL != gra->s_pages) {
+ if (NULL != gra->i_pages) {
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_ps_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ dk4gra_eps_page_delete(bptr);
+ }
+ } while (NULL != bptr);
+ dk4sto_it_close(gra->i_pages);
+ gra->i_pages = NULL;
+ }
+ dk4sto_close(gra->s_pages);
+ gra->s_pages = NULL;
+ }
+ dk4gratool_close(gra);
+
+ finished:
+
+
+#line 1154 "dk4greps.ctr"
+ return;
+}
+
+
+
+dk4_gra_t *
+dk4gra_eps_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ int ok = 0;
+
+
+#line 1171 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+
+ /* Open output structure, set up default components
+ */
+ back = dk4gratool_open(fn, w, h, docfl, erp);
+ if (NULL == back) {
+ goto finished;
+ }
+
+ /* Set driver
+ */
+ if (0 != (DK4_GRA_DOC_FLAG_EPS & docfl)) {
+ back->dr = DK4_GRA_DRIVER_EPS;
+ }
+ else {
+ back->dr = DK4_GRA_DRIVER_PS;
+ }
+ if (0 != (DK4_GRA_DOC_FLAG_PS_DSC & docfl)) {
+ back->out.ps.dsc = 1;
+ }
+ if (0 != (DK4_GRA_DOC_FLAG_PS2 & docfl)) {
+ back->out.ps.llev = 2;
+ }
+ else {
+ back->out.ps.llev = 3;
+ }
+ back->out.ps.fspd = 0;
+ back->out.ps.fdu = 0;
+ back->out.ps.ftu = 0;
+
+ /* Set up container and iterator for pages
+ */
+ back->s_pages = dk4sto_open(erp);
+ if (NULL == back->s_pages) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->s_pages, dk4gra_eps_compare_pages_by_number, 0);
+ back->i_pages = dk4sto_it_open(back->s_pages, erp);
+ if (NULL == back->i_pages) {
+ goto finished;
+ }
+
+ /* Indicate success to cleanup section
+ */
+ ok = 1;
+
+ /* End of function, clean up if not successful
+ */
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_eps_close(back);
+ back = NULL;
+ }
+
+
+#line 1227 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 1241 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ back = dk4gra_eps_file(fout, gra, erp);
+ dk4gra_eps_close(gra);
+
+
+#line 1248 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *curpg; /* New current page */
+ int back = 0;
+
+
+#line 1263 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ /*
+ Check number of pages already defined
+ */
+ if (SIZE_MAX == gra->pages) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ goto finished;
+ }
+ if ((DK4_GRA_DRIVER_EPS == gra->dr) && (0 != gra->pages)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Create new page and add to containter and mark as current page
+ */
+ curpg = dk4gra_eps_page_new(gra->pages, flags, erp);
+ if (NULL == curpg) {
+ goto finished;
+ }
+ /* Add new page to pages container
+ */
+ if (0 == dk4sto_add(gra->s_pages, curpg, erp)) {
+ dk4gra_eps_page_delete(curpg);
+ goto finished;
+ }
+ /* Set new page as current page, indicate success
+ */
+ gra->curpg = curpg;
+ gra->pages += 1;
+ back = 1;
+
+ finished:
+
+
+#line 1297 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1311 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 1, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1325 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1339 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 2, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1353 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1368 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->attr.lw_requested = lw;
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1382 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1398 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->attr.ls_requested = ls;
+ bptr->attr.sv_requested = sv;
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1413 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1428 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->attr.lc_requested = lc;
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1442 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1458 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->attr.lj_requested = lj;
+ bptr->attr.ml_requested = ml;
+ back = 1;
+ if (1.0 > bptr->attr.ml_requested) {
+ bptr->attr.ml_requested = 1.0;
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1478 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1493 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_fill_requested),
+ DK4_GRA_COL_SPEC_GRAY, g, 0.0, 0.0, 0.0
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1510 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1527 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_fill_requested),
+ DK4_GRA_COL_SPEC_RGB, r, g, b, 0.0
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1544 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1562 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_fill_requested),
+ DK4_GRA_COL_SPEC_CMYK, c, m, y, k
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1579 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1594 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_stroke_requested),
+ DK4_GRA_COL_SPEC_GRAY, g, 0.0, 0.0, 0.0
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1611 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1628 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_stroke_requested),
+ DK4_GRA_COL_SPEC_RGB, r, g, b, 0.0
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1645 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1663 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_stroke_requested),
+ DK4_GRA_COL_SPEC_CMYK, c, m, y, k
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1680 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1694 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /*
+ Fill color
+ */
+ back = dk4gra_eps_set_color_if_necessary(
+ bptr,
+ &(bptr->attr.col_stroke_active), &(bptr->attr.col_fill_requested),
+ erp
+ );
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1714 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ double da[8]; /* Dash array */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ double gw; /* Gap width */
+ size_t lci; /* Line cap index */
+ int res; /* Operation result */
+ int back = 0; /* Function result */
+ int lwc = 0; /* Flag: Line width was changed */
+
+
+#line 1733 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Stroke color
+ */
+ back = dk4gra_eps_set_color_if_necessary(
+ bptr,
+ &(bptr->attr.col_stroke_active), &(bptr->attr.col_stroke_requested),
+ erp
+ );
+ /* Line width
+ */
+ if (
+ DK4_GRA_EPSILON_LINEWIDTH
+ < fabs(bptr->attr.lw_active - bptr->attr.lw_requested)
+ ) {
+ dk4gra_eps_double_value(bptr, bptr->attr.lw_requested, &back, erp);
+ dk4gra_eps_kw(bptr, 4, &back, erp);
+ lwc = 1;
+ bptr->attr.lw_active = bptr->attr.lw_requested;
+ }
+ /* Line style
+ */
+ res = dk4gratool_line_style_differs(
+ bptr->attr.ls_active, bptr->attr.ls_requested,
+ bptr->attr.sv_active, bptr->attr.sv_requested,
+ lwc
+ );
+ if (0 != res) {
+ bptr->attr.ls_active = bptr->attr.ls_requested;
+ bptr->attr.sv_active = bptr->attr.sv_requested;
+ gw = (bptr->attr.sv_active + bptr->attr.lw_active) / 2.0;
+ if ((2.0 * bptr->attr.lw_active) < gw) {
+ gw = 2.0 * bptr->attr.lw_active;
+ }
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : case DK4_GRA_LC_PROJECTING : {
+ gw += bptr->attr.lw_requested;
+ } break;
+ }
+ switch (bptr->attr.ls_active) {
+ case DK4_GRA_LS_DASH : {
+ da[0] = bptr->attr.sv_active;
+ da[1] = gw;
+ res = dk4gra_eps_dash_out(
+ bptr, da, 2, (bptr->attr.sv_active / 2.0), erp
+ );
+ if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_LS_DOT : {
+ da[0] = da[1] = bptr->attr.lw_active;
+ res = dk4gra_eps_dash_out(bptr, da, 2, 0.0, erp);
+ if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_LS_DASH_DOT : {
+ da[0] = bptr->attr.sv_active;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_active;
+ da[3] = gw;
+ res = dk4gra_eps_dash_out(
+ bptr, da, 4, (bptr->attr.sv_active / 2.0), erp
+ );
+ if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT : {
+ da[0] = bptr->attr.sv_active;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_active;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_active;
+ da[5] = gw;
+ res = dk4gra_eps_dash_out(
+ bptr, da, 6, (bptr->attr.sv_active / 2.0), erp
+ );
+ if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT_DOT : {
+ da[0] = bptr->attr.sv_active;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_active;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_active;
+ da[5] = gw;
+ da[6] = bptr->attr.lw_active;
+ da[7] = gw;
+ res = dk4gra_eps_dash_out(
+ bptr, da, 8, (bptr->attr.sv_active / 2.0), erp
+ );
+ if (0 == res) { back = 0; }
+ } break;
+ default : {
+ dk4gra_eps_kw(bptr, 8, &back, erp);
+ } break;
+ }
+ }
+ /* Line cap
+ */
+ if (bptr->attr.lc_active != bptr->attr.lc_requested) {
+ bptr->attr.lc_active = bptr->attr.lc_requested;
+ switch (bptr->attr.lc_active) {
+ case DK4_GRA_LC_ROUNDED : {
+ lci = 13;
+ } break;
+ case DK4_GRA_LC_PROJECTING : {
+ lci = 14;
+ } break;
+ default : {
+ lci = 12;
+ } break;
+ }
+ dk4gra_eps_kw(bptr, lci, &back, erp);
+ }
+ /* Line join
+ */
+ if (bptr->attr.lj_active != bptr->attr.lj_requested) {
+ bptr->attr.lj_active = bptr->attr.lj_requested;
+ switch (bptr->attr.lj_active) {
+ case DK4_GRA_LJ_ROUNDED : {
+ lci = 16;
+ } break;
+ case DK4_GRA_LJ_BEVELED : {
+ lci = 17;
+ } break;
+ default : {
+ lci = 15;
+ } break;
+ }
+ dk4gra_eps_kw(bptr, lci, &back, erp);
+ }
+ /* Miter limit, only if line join is mitered
+ */
+ if (DK4_GRA_LJ_MITERED == bptr->attr.lj_active) {
+ if (
+ DK4_GRA_EPSILON_MITERLIMIT
+ < fabs(bptr->attr.ml_active - bptr->attr.ml_requested)
+ ) {
+ dk4gra_eps_values_and_keyword(
+ bptr, &(bptr->attr.ml_requested), 1, 50, &back, erp
+ );
+ bptr->attr.ml_active = bptr->attr.ml_requested;
+ }
+ }
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1884 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1898 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, ((0 != gra->eor) ? (19) : (18)), &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1912 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1926 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 20, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1940 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 1954 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, ((0 != gra->eor) ? (22) : (21)), &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 1968 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_pattern(
+ dk4_gra_t *gra,
+ int pn,
+ double *xval,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ const char *pname; /* Pattern name */
+ int back = 0;
+ int res; /* Operation result */
+
+
+#line 1986 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0 > pn) || (DK4_GRA_PATTERN_MAX < pn)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ pname = dk4gra_eps_pattern_name(pn);
+ if (NULL == pname) {
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ goto finished;
+ }
+ bptr->patu[pn] = 0x01;
+
+ back = 1;
+
+ switch (pn) {
+ case DK4_GRA_PATTERN_30_DEGREE_RIGHT : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_30_DEGREE_SIEVE : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_LEFT : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_RIGHT : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_SIEVE : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_BRICKS : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_BRICKS : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_LINES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_LINES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_1 : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_2 : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_LARGE_FISH_SCALES : {
+ /* xs xe ys ye dx dy r a1 a2 */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 9, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_SMALL_FISH_SCALES : {
+ /* xs xe ys ye dx dy r a1 a2 */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 9, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_CIRCLES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HEXAGONS : {
+ /* xs xe ys ye dx dy */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 6, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_OCTAGONS : {
+ /* xs xe ys ye dx co */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 6, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_TIRES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_TIRES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ /* DK4_GRA_PATTERN_30_DEGREE_LEFT */
+ default : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ }
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 2131 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ double val[4]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2148 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+
+
+#line 2152 "dk4greps.ctr"
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 23, &back, erp);
+ val[0] = x; val[1] = y;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 2165 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ double val[4]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2182 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+
+
+#line 2186 "dk4greps.ctr"
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ val[0] = x; val[1] = y;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 2198 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2219 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+
+
+#line 2223 "dk4greps.ctr"
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ val[0] = xc1; val[1] = yc1; val[2] = xc2; val[3] = yc2;
+ val[4] = x; val[5] = y;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 2236 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2250 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+
+
+#line 2254 "dk4greps.ctr"
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 27, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 2265 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2283 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 23, &back, erp);
+ val[0] = xc + r;
+ val[1] = yc;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ val[0] = xc; val[1] = yc; val[2] = r;
+ dk4gra_eps_values_and_keyword(bptr, val, 3, 28, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 2302 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2322 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ /* Correct radius if necessary
+ */
+ back = 1;
+
+ /* Output
+ */
+ dk4gra_eps_kw(bptr, 23, &back, erp);
+ if (0.0 < r) {
+ val[0] = xl + r;
+ val[1] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ val[0] = xr - r;
+ val[1] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xr - (1.0 - KAPPA_4) * r;
+ val[1] = yb;
+ val[2] = xr;
+ val[3] = yb + (1.0 - KAPPA_4) * r;
+ val[4] = xr;
+ val[5] = yb + r;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ val[0] = xr;
+ val[1] = yt - r;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xr;
+ val[1] = yt - (1.0 - KAPPA_4) * r;
+ val[2] = xr - (1.0 - KAPPA_4) * r;
+ val[3] = yt;
+ val[4] = xr - r;
+ val[5] = yt;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ val[0] = xl + r;
+ val[1] = yt;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xl + (1.0 - KAPPA_4) * r;
+ val[1] = yt;
+ val[2] = xl;
+ val[3] = yt - (1.0 - KAPPA_4) * r;
+ val[4] = xl;
+ val[5] = yt - r;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ val[0] = xl;
+ val[1] = yb + r;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xl;
+ val[1] = yb + (1.0 - KAPPA_4) * r;
+ val[2] = xl + (1.0 - KAPPA_4) * r;
+ val[3] = yb;
+ val[4] = xl + r;
+ val[5] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ dk4gra_eps_kw(bptr, 27, &back, erp);
+ }
+ else {
+ val[0] = xl; val[1] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ val[0] = xr; val[1] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xr; val[1] = yt;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xl; val[1] = yt;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ dk4gra_eps_kw(bptr, 27, &back, erp);
+ }
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 2399 "dk4greps.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_eps_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ double xstart; /* Start X coordinate */
+ double ystart; /* Start Y coordinate */
+ int back = 0;
+
+
+#line 2422 "dk4greps.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ xstart = (M_PI * start) / 180.0;
+ ystart = xstart;
+ xstart = xc + ra * cos(xstart);
+ ystart = yc + ra * sin(ystart);
+ back = 1;
+ dk4gra_eps_kw(bptr, 23, &back, erp);
+ val[0] = xstart; val[1] = ystart;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ val[0] = xc; val[1] = yc; val[2] = ra; val[3] = start; val[4] = end;
+ dk4gra_eps_values_and_keyword(bptr, val, 5, 29, &back, erp);
+ if (0 != cl) {
+ val[0] = xc; val[1] = yc;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ dk4gra_eps_kw(bptr, 27, &back, erp);
+ }
+ bptr->cont = 1;
+
+ finished:
+
+
+#line 2449 "dk4greps.ctr"
+ return back;
+}
+
+
+
+void
+dk4gra_eps_save_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->catt),
+ &(bptr->attr),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_eps_restore_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->attr),
+ &(bptr->catt),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_eps_reset_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ dk4gratool_reset_active_attributes(&(bptr->attr));
+}
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4greps.ctr b/support/dktools/dk4greps.ctr
new file mode 100644
index 0000000000..514710ee9c
--- /dev/null
+++ b/support/dktools/dk4greps.ctr
@@ -0,0 +1,2507 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MEMBF_H_INCLUDED
+#include "dk4membf.h"
+#endif
+
+#ifndef DK4MBSTRM_H_INCLUDED
+#include "dk4mbstrm.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Constant text fragments.
+*/
+static const char * const dk4gra_eps_c8_kw[] = {
+$!string-table
+#
+# 0 Newline
+#
+\n
+#
+# 1 gsave
+#
+gsave\n
+#
+# 2 grestore
+#
+grestore\n
+#
+# 3 space
+#
+
+#
+# 4 setlinewidth
+#
+ setlinewidth\n
+#
+# 5 setcmykcolor
+#
+ setcmykcolor\n
+#
+# 6 setrgbcolor
+#
+ setrgbcolor\n
+#
+# 7 setgray
+#
+ setgray\n
+#
+# 8 dash for solid line
+#
+[] 0 setdash\n
+#
+# 9 10 11 Dash array.
+#
+[
+]
+ setdash\n
+#
+# 12 13 14 Line cap
+#
+0 setlinecap\n
+1 setlinecap\n
+2 setlinecap\n
+#
+# 15 16 17 Line join
+#
+0 setlinejoin\n
+1 setlinejoin\n
+2 setlinejoin\n
+#
+# 18 19 fill
+#
+fill\n
+eofill\n
+#
+# 20 stroke
+#
+stroke\n
+#
+# 21 22 clip
+#
+clip\n
+eoclip\n
+#
+# 23 newpath
+#
+newpath\n
+#
+# 24 moveto
+#
+ moveto\n
+#
+# 25 lineto
+#
+ lineto\n
+#
+# 26 curveto
+#
+ curveto\n
+#
+# 27 closepath
+#
+closepath\n
+#
+# 28 circle
+#
+ 0 360 arc closepath\n
+#
+# 29 arc
+#
+ arc\n
+#
+# 30 31 PS EPSF
+#
+%!PS-Adobe-3.0 EPSF-3.0\n
+%!PS-Adobe-2.0 EPSF-2.0\n
+#
+# 32 33 PS
+#
+%!PS-Adobe-3.0\n
+%!PS-Adobe-2.0\n
+#
+# 34 35 LanguageLevel
+#
+\%\%LanguageLevel: 3\n
+\%\%LanguageLevel: 2\n
+#
+# 36 BoundingBox
+#
+\%\%BoundingBox: 0 0
+#
+# 37 Pages
+#
+\%\%Pages:
+#
+# 38 PageOrder
+#
+\%\%PageOrder: Ascend\n
+#
+# 39 DocumentData
+#
+\%\%DocumentData: Clean7Bit\n
+#
+# 40 EndComments BeginProlog EndProlog
+#
+\%\%EndComments\n\%\%BeginProlog\n\%\%EndProlog\n
+#
+# 41 Trailer EOF
+#
+\%\%Trailer\n\%\%EOF\n
+#
+# 42 Page
+#
+\%\%Page:
+#
+# 43 44 begin dict
+#
+ dict begin\n
+end\n
+#
+# 45 showpage
+#
+showpage\n
+#
+# 46 0 0 moveto
+#
+0 0 moveto\n
+#
+# 47 0
+#
+0
+#
+# 48 1 setlinecap
+#
+1 setlinecap\n
+#
+# 49 white background fill color
+#
+1 setgray\n
+#
+# 50
+#
+ setmiterlimit\n
+#
+# 51-52 Begin and end setup
+#
+\%\%BeginSetup\n
+\%\%EndSetup\n
+#
+# 53-54 Begin and end feature
+#
+\%\%BeginFeature: *PageSize BmppPage\n
+\%\%EndFeature\n
+#
+# 55-56 Page size
+#
+<< /PageSize [
+] /ImagingBBox null >> setpagedevice\n
+#
+# 57-58
+#
+\%\%BeginFeature: *Duplex DuplexNoTumble\n
+<< /Duplex true /Tumble false >> setpagedevice\n
+#
+# 59-60
+#
+\%\%BeginFeature: *Duplex DuplexTumble\n
+<< /Duplex true /Tumble true >> setpagedevice\n
+$!end
+};
+
+
+
+/** Write double value to page memory stream.
+ @param bptr Current page.
+ @param v Value to write.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if os is NULL.
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+static
+void
+dk4gra_eps_double_value(
+ dk4_gra_ps_page_t *bptr,
+ double v,
+ int *backptr,
+ dk4_er_t *erp
+
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ dk4gratool_stream_double(bptr->memstrm, v, backptr, erp);
+}
+
+
+
+/** Write a fixed keyword from dk4gra_eps_c8_kw to page memory stream.
+ @param bptr Current page.
+ @param i Index of keyword in array.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_eps_kw(
+ dk4_gra_ps_page_t *bptr,
+ size_t i,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ dk4gratool_stream_string(bptr->memstrm, dk4gra_eps_c8_kw[i], backptr, erp);
+}
+
+
+/** Delete a PS/EPS page structure.
+ @param bptr Page structure to delete.
+*/
+static
+void
+dk4gra_eps_page_delete(
+ dk4_gra_ps_page_t *bptr
+)
+{
+ $? "+ dk4gra_eps_page_delete %d", TR_IPTR(bptr)
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ if (NULL != bptr) {
+ /*
+ Release all resources
+ */
+ if (NULL != bptr->memstrm) { $? ". close memory stream"
+ dk4stream_close(bptr->memstrm, NULL);
+ }
+ bptr->memstrm = NULL;
+ if (NULL != bptr->membuf) { $? ". close memory buffer"
+ dk4membuf_close(bptr->membuf);
+ }
+ bptr->membuf = NULL;
+ /*
+ Free memory for page structure itself
+ */
+ dk4mem_free(bptr);
+ }
+ $? "- dk4gra_eps_page_delete"
+}
+
+
+
+/** Create new page structure, allocated related resources.
+ @param pageno Page number of new page.
+ @param flags Page flags.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new page structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the product of elsize and nelem,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+static
+dk4_gra_ps_page_t *
+dk4gra_eps_page_new(
+ size_t pageno,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *back = NULL;
+ size_t i = 0; /* Traverse patterns */
+ int ok = 0;
+ $? "+ dk4gra_eps_page_new"
+ back = dk4mem_new(dk4_gra_ps_page_t,1,erp);
+ if (NULL != back) {
+ /*
+ Initialize all components
+ */
+ dk4gratool_initialize_attributes(&(back->attr));
+ back->membuf = NULL;
+ back->memstrm = NULL;
+ back->flags = flags;
+ for (i = 0; i < 22; i++) {
+ back->patu[i] = 0x00;
+ }
+ back->pageno = pageno;
+ back->spip = 0;
+ back->cont = 0;
+ /*
+ Allocate resources for memory buffer and stream
+ */
+ back->membuf = dk4membuf_open(erp);
+ if (NULL != back->membuf) {
+ back->memstrm = dk4stream_open_membuf_writer(back->membuf, erp);
+ if (NULL != back->memstrm) {
+ ok = 1;
+ }
+ }
+ if (0 == ok) {
+ dk4gra_eps_page_delete(back);
+ back = NULL;
+ }
+ }
+ $? "- dk4gra_eps_page_new %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Write several double values to page memory stream and add keyword.
+ @param bptr Current page.
+ @param da Array of double values.
+ @param szda Number of elements in array.
+ @param kwi Index of keyword to add.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra, bptr or da or the current page or the page stream on the
+ current page is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent in one of the double values is out of range for
+ integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if the text representation of the double value
+ contains invalid characters.
+*/
+static
+void
+dk4gra_eps_values_and_keyword(
+ dk4_gra_ps_page_t *bptr,
+ double *da,
+ size_t szda,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t i; /* Traverse da */
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != da);
+ assert(0 < szda);
+#endif
+ for (i = 0; i < szda; i++) {
+ if (0 != i) {
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ }
+ dk4gra_eps_double_value(bptr, da[i], &back, erp);
+ }
+ if (0 < kwi) {
+ dk4gra_eps_kw(bptr, kwi, &back, erp);
+ }
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+/** Set new color if necessary.
+ @param bptr Current page.
+ @param p_col_active Currently active color.
+ @param p_col_requested Requested color.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra, bptr or da or the current page or the page stream on the
+ current page is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent in one of the double values is out of range for
+ integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if the text representation of the double value
+ contains invalid characters.
+*/
+static
+int
+dk4gra_eps_set_color_if_necessary(
+ dk4_gra_ps_page_t *bptr,
+ dk4gra_col_t *p_col_active,
+ dk4gra_col_t *p_col_requested,
+ dk4_er_t *erp
+)
+{
+ double val[4]; /* Color components */
+ int back = 0;
+ $? "+ dk4gra_eps_set_color_if_necessary"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != p_col_active);
+ assert(NULL != p_col_requested);
+#endif
+ if (0 == dk4gratool_colors_differ(p_col_active, p_col_requested)) {
+ back = 1;
+ goto finished;
+ }
+ dk4mem_cpy(p_col_active, p_col_requested, sizeof(dk4gra_col_t), NULL);
+ switch (p_col_active->what) {
+ case DK4_GRA_COL_SPEC_CMYK : {
+ val[0] = p_col_active->data.cmyk.c;
+ val[1] = p_col_active->data.cmyk.m;
+ val[2] = p_col_active->data.cmyk.y;
+ val[3] = p_col_active->data.cmyk.k;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 4, 5, &back, erp);
+ } break;
+ case DK4_GRA_COL_SPEC_RGB : {
+ val[0] = p_col_active->data.rgb.r;
+ val[1] = p_col_active->data.rgb.g;
+ val[2] = p_col_active->data.rgb.b;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 3, 6, &back, erp);
+ } break;
+ case DK4_GRA_COL_SPEC_GRAY : {
+ val[0] = p_col_active->data.gray;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 1, 7, &back, erp);
+ } break;
+ }
+
+ finished:
+ $? "- dk4gra_eps_set_color_if_necessary %d", back
+ return back;
+}
+
+
+
+/** Write dash setup.
+ @param bptr Current page in gra.
+ @param da Array of double values for stroke and gap lengths.
+ @param sz Number of elements in array.
+ @param offset Offset to start dash pattern.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if the contents stream of the current page
+ is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent of a doublevalue is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if a double value converted to string contains invalid characters.
+*/
+static
+int
+dk4gra_eps_dash_out(
+ dk4_gra_ps_page_t *bptr,
+ double *da,
+ size_t sz,
+ double offset,
+ dk4_er_t *erp
+)
+{
+ size_t i; /* Traverse dash length array da */
+ int back = 1;
+
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != da);
+ assert(0 < sz);
+#endif
+ dk4gra_eps_kw(bptr, 9, &back, erp);
+ for (i = 0; i < sz; i++) {
+ if (0 != i) {
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ }
+ dk4gra_eps_double_value(bptr, da[i], &back, erp);
+ }
+ dk4gra_eps_kw(bptr, 10, &back, erp);
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ dk4gra_eps_double_value(bptr, offset, &back, erp);
+ dk4gra_eps_kw(bptr, 11, &back, erp);
+ return back;
+}
+
+
+
+/** Put string to output file, on error set return code and error code.
+ @param fout Output file.
+ @param str String to write.
+ @param pret Address of return code variable.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_WRITE_FAILED<br>
+ if the write attempt failed.
+*/
+static
+void
+dk4gra_eps_string_to_file(
+ FILE *fout,
+ const char *str,
+ int *pret,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != fout);
+ assert(NULL != str);
+#endif
+ if (EOF == fputs(str, fout)) {
+ *pret = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
+ }
+}
+
+
+
+/** Construct path for page border.
+ @param fout Output file to write.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if arguments are invalid,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen),
+ - DK4_E_WRITE_FAILED<br>
+ if the write attempt failed.
+*/
+static
+void
+dk4gra_eps_page_border_path(
+ FILE *fout,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ char b1[16*sizeof(dk4_um_t)]; /* Width as text */
+ char b2[16*sizeof(dk4_um_t)]; /* Height as text */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ (void)dk4ma_write_c8_decimal_unsigned(b1, sizeof(b1), gra->w, 0, erp);
+ (void)dk4ma_write_c8_decimal_unsigned(b2, sizeof(b2), gra->h, 0, erp);
+ /* 0 0 moveto */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[23], backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[46], backptr, erp);
+ /* w 0 lineto */
+ dk4gra_eps_string_to_file(fout, b1, backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[47], backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[25], backptr, erp);
+ /* w h lineto */
+ dk4gra_eps_string_to_file(fout, b1, backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], backptr, erp);
+ dk4gra_eps_string_to_file(fout, b2, backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[25], backptr, erp);
+ /* 0 h lineto */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[47], backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], backptr, erp);
+ dk4gra_eps_string_to_file(fout, b2, backptr, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[25], backptr, erp);
+ /* closepath */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[27], backptr, erp);
+}
+
+
+/** Write one page to output file.
+ @param fout Output file.
+ @param gra Output structure.
+ @param bptr Current page.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_eps_one_page_to_file(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_gra_ps_page_t *bptr,
+ dk4_er_t *erp
+)
+{
+ char b1[8*sizeof(dk4_um_t)]; /* Page no as text */
+ char b2[8*sizeof(dk4_um_t)]; /* Pages number as text */
+ const char * const *pproc; /* Pattern procedure name */
+ size_t numpat = 0; /* Number of used pats */
+ size_t i = 0; /* Traverse used pats */
+ int back = 1;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ /* %%Page: 1 1
+ */
+ if (0 != gra->out.ps.dsc) {
+ (void)dk4ma_write_c8_decimal_unsigned(
+ b1, sizeof(b1), (bptr->pageno + 1), 0, erp
+ );
+ (void)dk4ma_write_c8_decimal_unsigned(
+ b2, sizeof(b2), gra->pages, 0, erp
+ );
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[42], &back, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], &back, erp);
+ dk4gra_eps_string_to_file(fout, b2, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[0], &back, erp);
+ }
+
+ /* Count number of used patterns.
+ */
+ for (i = 0; i <= DK4_GRA_PATTERN_MAX; i++) {
+ if (0 != bptr->patu[i]) { numpat++; }
+ }
+
+ /* xxx dict begin
+ */
+ if (0 != numpat) {
+ (void)dk4ma_write_c8_decimal_unsigned(b1, sizeof(b1), numpat, 0, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[43], &back, erp);
+ for (i = 0; i <= DK4_GRA_PATTERN_MAX; i++) {
+ if (0 != bptr->patu[i]) {
+ pproc = dk4gra_eps_pattern_procedure(i);
+ while (NULL != *pproc) {
+ if (EOF == fputs(*(pproc++), fout)) { back = 0; }
+ if (EOF == fputc('\n', fout)) { back = 0; }
+ }
+ }
+ }
+ }
+
+ /* gsave
+ */
+ if (0 == bptr->spip) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[1], &back, erp);
+ }
+
+ /* clip path
+ */
+ if (
+ (0 == ((bptr->flags) & DK4_GRA_PAGE_FLAG_NO_CLIP))
+ && (0 == bptr->spip)
+ ) {
+ /* construct path */
+ dk4gra_eps_page_border_path(fout, gra, &back, erp);
+ /* clip */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[21], &back, erp);
+ }
+
+ /* white page background
+ */
+ if (
+ (0 == ((bptr->flags) & DK4_GRA_PAGE_FLAG_NO_BG))
+ && (0 == bptr->spip)
+ ) {
+ /* white color */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[49], &back, erp);
+ bptr->attr.col_stroke_active.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_stroke_active.data.gray = 1.0;
+ /* construct path */
+ dk4gra_eps_page_border_path(fout, gra, &back, erp);
+ /* fill */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[18], &back, erp);
+ }
+
+ /* page contents
+ */
+ if (NULL != bptr->memstrm) {
+ if (0 == dk4stream_close(bptr->memstrm, erp)) {
+ back = 0;
+ }
+ bptr->memstrm = NULL;
+ }
+ if (NULL != bptr->membuf) {
+ if (0 == dk4membuf_to_file(fout, bptr->membuf, erp)) {
+ back = 0;
+ }
+ }
+
+ /* grestore
+ */
+ if (0 == bptr->spip) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[2], &back, erp);
+ }
+
+ /* end
+ */
+ if (0 != numpat) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[44], &back, erp);
+ }
+
+ /* showpage
+ */
+ if ((DK4_GRA_DRIVER_EPS != gra->dr) && (0 == bptr->spip)) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[45], &back, erp);
+ }
+
+ return back;
+}
+
+
+
+/** Write pattern instance.
+ @param bptr Current page.
+ @param da Array of values.
+ @param szda Size of da array (number of elements).
+ @param pname Pattern name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_eps_write_pattern_instance(
+ dk4_gra_ps_page_t *bptr,
+ const double *da,
+ size_t szda,
+ const char *pname,
+ dk4_er_t *erp
+)
+{
+ size_t i; /* Traverse da array */
+ int res; /* Operation result */
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != da);
+ assert(0 < szda);
+ assert(NULL != pname);
+#endif
+ for (i = 0; i < szda; i++) {
+ if (0 != i) {
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ }
+ res = dk4ma_write_c8_double_no_sci_to_stream(
+ bptr->memstrm, *(da++), DK4_GRA_EPSILON_COORDINATES, 0, 1, erp
+ );
+ if (0 == res) { back = 0; }
+ }
+ if (0 < i) {
+ dk4gra_eps_kw(bptr, 3, &back, erp);
+ }
+ res = dk4stream_write_char_string(bptr->memstrm, pname, erp);
+ if (0 == res) { back = 0; }
+ dk4gra_eps_kw(bptr, 0, &back, erp);
+ return back;
+}
+
+
+
+/** Compare page structures by number or a page against a number.
+ @param l Left page object.
+ @param r Right page object or page number.
+ @param cr Comparison criteria (0=page/page, 1=page/number).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_eps_compare_pages_by_number(const void *l, const void *r, int cr)
+{
+ const dk4_gra_ps_page_t *pl; /* Left side object */
+ const dk4_gra_ps_page_t *pr; /* Right side object */
+ const size_t *ppno; /* Address of a page number */
+
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_ps_page_t *)l;
+ switch (cr) {
+ case 1: {
+ ppno = (const size_t *)r;
+ if (pl->pageno > *ppno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < *ppno) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ pr = (const dk4_gra_ps_page_t *)r;
+ if (pl->pageno > pr->pageno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < pr->pageno) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Write PS/EPS contents to file.
+ @param fout File, opened for write access.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_WRITE_FAILED<br>
+ if the write attempt failed.
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_CLOSE_FAILED<br>
+ if closing downward data failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if an internal buffer in this function is too small (should not happen).
+ - DK4_E_BUG<br>
+ if an internal buffer in dk4ma_write_c8_decimal_unsigned()
+ is too small (should not happen).
+*/
+static
+int
+dk4gra_eps_file(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ char b1[8*sizeof(dk4_um_t)]; /* Buffer for numbers */
+ char b2[8*sizeof(dk4_um_t)]; /* Buffer for numbers */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 1;
+ $? "+ dk4gra_eps_file"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ /* Document header
+ ---------------
+ */
+
+ /* %!PS-Adobe-2.0 (EPSF...)
+ */
+ if (DK4_GRA_DRIVER_EPS == gra->dr) {
+ dk4gra_eps_string_to_file(
+ fout, dk4gra_eps_c8_kw[(3 == gra->out.ps.llev) ? (30) : (31)],
+ &back, erp
+ );
+ }
+ else {
+ dk4gra_eps_string_to_file(
+ fout, dk4gra_eps_c8_kw[(3 == gra->out.ps.llev) ? (32) : (33)],
+ &back, erp
+ );
+ }
+
+ /* %%LanguageLevel
+ */
+ dk4gra_eps_string_to_file(
+ fout, dk4gra_eps_c8_kw[(3 == gra->out.ps.llev) ? (34) : (35)],
+ &back, erp
+ );
+
+ /* %%BoundingBox
+ */
+ (void)dk4ma_write_c8_decimal_unsigned(b1, sizeof(b1), gra->w, 0, erp);
+ (void)dk4ma_write_c8_decimal_unsigned(b2, sizeof(b2), gra->h, 0, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[36], &back, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], &back, erp);
+ dk4gra_eps_string_to_file(fout, b2, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[0], &back, erp);
+
+
+ if (0 != gra->out.ps.dsc) {
+
+ /* %%Title -- ignored
+ */
+
+ /* %%Creator -- ignored
+ */
+
+ /* %%CreationDate -- ignored
+ */
+
+ /* %%Pages
+ */
+ (void)dk4ma_write_c8_decimal_unsigned(
+ b1, sizeof(b1), gra->pages, 0, erp
+ );
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[37], &back, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[0], &back, erp);
+
+
+ /* %%PageOrder
+ */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[38], &back, erp);
+
+ /* %%DocumentData
+ */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[39], &back, erp);
+
+ /* %%EndComments BeginProlog EndProlog
+ */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[40], &back, erp);
+
+ /* Page setup for PS documents
+ */
+ if (DK4_GRA_DRIVER_PS == gra->dr) {
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[51], &back, erp);
+ /*
+ Paper size
+ */
+ (void)dk4ma_write_c8_decimal_unsigned(b1,sizeof(b1),gra->w,0,erp);
+ (void)dk4ma_write_c8_decimal_unsigned(b2,sizeof(b2),gra->h,0,erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[53], &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[55], &back, erp);
+ dk4gra_eps_string_to_file(fout, b1, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[3], &back, erp);
+ dk4gra_eps_string_to_file(fout, b2, &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[56], &back, erp);
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[54], &back, erp);
+ /*
+ Duplex (and tumble)
+ */
+ if (0 != (DK4_GRA_DOC_FLAG_TUMBLE & (gra->docfl))) {
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[59],&back,erp);
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[60],&back,erp);
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[54],&back,erp);
+ }
+ else {
+ if (0 != (DK4_GRA_DOC_FLAG_DUPLEX & (gra->docfl))) {
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[57],&back,erp);
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[58],&back,erp);
+ dk4gra_eps_string_to_file(fout,dk4gra_eps_c8_kw[54],&back,erp);
+ }
+ }
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[52], &back, erp);
+ }
+
+ }
+
+ /* Pages
+ -----
+ */
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_ps_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ if (0 == dk4gra_eps_one_page_to_file(fout, gra, bptr, erp)) {
+ back = 0;
+ }
+ }
+ } while (NULL != bptr);
+
+
+ /* Document trailer
+ ----------------
+ */
+
+ if (0 != gra->out.ps.dsc) {
+ /* %%Trailer %%EOF
+ */
+ dk4gra_eps_string_to_file(fout, dk4gra_eps_c8_kw[41], &back, erp);
+ }
+
+ /* Ctrl-D
+ */
+ if (DK4_GRA_DRIVER_PS == gra->dr) {
+ if (EOF == fputc(0x04, fout)) {
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
+ }
+ }
+
+ $? "- dk4gra_eps_file %d", back
+ return back;
+}
+
+
+
+void
+dk4gra_eps_close(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page to release */
+
+ $? "+ dk4gra_eps_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ goto finished;
+ }
+ if (NULL != gra->s_pages) {
+ if (NULL != gra->i_pages) {
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_ps_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ dk4gra_eps_page_delete(bptr);
+ }
+ } while (NULL != bptr);
+ dk4sto_it_close(gra->i_pages);
+ gra->i_pages = NULL;
+ }
+ dk4sto_close(gra->s_pages);
+ gra->s_pages = NULL;
+ }
+ dk4gratool_close(gra);
+
+ finished:
+ $? "- dk4gra_eps_close"
+ return;
+}
+
+
+
+dk4_gra_t *
+dk4gra_eps_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4gra_eps_open_ps"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+
+ /* Open output structure, set up default components
+ */
+ back = dk4gratool_open(fn, w, h, docfl, erp);
+ if (NULL == back) {
+ goto finished;
+ }
+
+ /* Set driver
+ */
+ if (0 != (DK4_GRA_DOC_FLAG_EPS & docfl)) {
+ back->dr = DK4_GRA_DRIVER_EPS;
+ }
+ else {
+ back->dr = DK4_GRA_DRIVER_PS;
+ }
+ if (0 != (DK4_GRA_DOC_FLAG_PS_DSC & docfl)) {
+ back->out.ps.dsc = 1;
+ }
+ if (0 != (DK4_GRA_DOC_FLAG_PS2 & docfl)) {
+ back->out.ps.llev = 2;
+ }
+ else {
+ back->out.ps.llev = 3;
+ }
+ back->out.ps.fspd = 0;
+ back->out.ps.fdu = 0;
+ back->out.ps.ftu = 0;
+
+ /* Set up container and iterator for pages
+ */
+ back->s_pages = dk4sto_open(erp);
+ if (NULL == back->s_pages) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->s_pages, dk4gra_eps_compare_pages_by_number, 0);
+ back->i_pages = dk4sto_it_open(back->s_pages, erp);
+ if (NULL == back->i_pages) {
+ goto finished;
+ }
+
+ /* Indicate success to cleanup section
+ */
+ ok = 1;
+
+ /* End of function, clean up if not successful
+ */
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_eps_close(back);
+ back = NULL;
+ }
+ $? "- dk4gra_eps_open_ps %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+dk4gra_eps_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_eps_write_file_and_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ back = dk4gra_eps_file(fout, gra, erp);
+ dk4gra_eps_close(gra);
+ $? "- dk4gra_eps_write_file_and_close %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *curpg; /* New current page */
+ int back = 0;
+ $? "+ dk4gra_eps_page"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ /*
+ Check number of pages already defined
+ */
+ if (SIZE_MAX == gra->pages) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ goto finished;
+ }
+ if ((DK4_GRA_DRIVER_EPS == gra->dr) && (0 != gra->pages)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Create new page and add to containter and mark as current page
+ */
+ curpg = dk4gra_eps_page_new(gra->pages, flags, erp);
+ if (NULL == curpg) {
+ goto finished;
+ }
+ /* Add new page to pages container
+ */
+ if (0 == dk4sto_add(gra->s_pages, curpg, erp)) {
+ dk4gra_eps_page_delete(curpg);
+ goto finished;
+ }
+ /* Set new page as current page, indicate success
+ */
+ gra->curpg = curpg;
+ gra->pages += 1;
+ back = 1;
+
+ finished:
+ $? "- dk4gra_eps_page %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_gsave"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 1, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_gsave %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_grestore"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 2, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_grestore %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_line_width"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->attr.lw_requested = lw;
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_line_width %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_line_style"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->attr.ls_requested = ls;
+ bptr->attr.sv_requested = sv;
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_line_style %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_line_cap"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->attr.lc_requested = lc;
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_line_cap %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_line_join"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr->attr.lj_requested = lj;
+ bptr->attr.ml_requested = ml;
+ back = 1;
+ if (1.0 > bptr->attr.ml_requested) {
+ bptr->attr.ml_requested = 1.0;
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_line_join %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_fill_gray %g", g
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_fill_requested),
+ DK4_GRA_COL_SPEC_GRAY, g, 0.0, 0.0, 0.0
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_fill_gray %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_fill_rgb %g %g %g", r, g, b
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_fill_requested),
+ DK4_GRA_COL_SPEC_RGB, r, g, b, 0.0
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_fill_rgb %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_fill_cmyk %g %g %g %g", c, m, y, k
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_fill_requested),
+ DK4_GRA_COL_SPEC_CMYK, c, m, y, k
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_fill_cmyk %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_stroke_gray %g", g
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_stroke_requested),
+ DK4_GRA_COL_SPEC_GRAY, g, 0.0, 0.0, 0.0
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_stroke_gray %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_stroke_rgb %g %g %g", r, g, b
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_stroke_requested),
+ DK4_GRA_COL_SPEC_RGB, r, g, b, 0.0
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_stroke_rgb %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_set_stroke_cmyk %g %g %g %g", c, m, y, k
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ dk4gratool_set_color_requested(
+ &(bptr->attr.col_stroke_requested),
+ DK4_GRA_COL_SPEC_CMYK, c, m, y, k
+ );
+ back = 1;
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_set_stroke_cmyk %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_prepare_fill"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /*
+ Fill color
+ */
+ back = dk4gra_eps_set_color_if_necessary(
+ bptr,
+ &(bptr->attr.col_stroke_active), &(bptr->attr.col_fill_requested),
+ erp
+ );
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_prepare_fill %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ double da[8]; /* Dash array */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ double gw; /* Gap width */
+ size_t lci; /* Line cap index */
+ int res; /* Operation result */
+ int back = 0; /* Function result */
+ int lwc = 0; /* Flag: Line width was changed */
+ $? "+ dk4gra_eps_prepare_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Stroke color
+ */
+ back = dk4gra_eps_set_color_if_necessary(
+ bptr,
+ &(bptr->attr.col_stroke_active), &(bptr->attr.col_stroke_requested),
+ erp
+ );
+ /* Line width
+ */
+ if (
+ DK4_GRA_EPSILON_LINEWIDTH
+ < fabs(bptr->attr.lw_active - bptr->attr.lw_requested)
+ ) {
+ dk4gra_eps_double_value(bptr, bptr->attr.lw_requested, &back, erp);
+ dk4gra_eps_kw(bptr, 4, &back, erp);
+ lwc = 1;
+ bptr->attr.lw_active = bptr->attr.lw_requested;
+ }
+ /* Line style
+ */
+ res = dk4gratool_line_style_differs(
+ bptr->attr.ls_active, bptr->attr.ls_requested,
+ bptr->attr.sv_active, bptr->attr.sv_requested,
+ lwc
+ );
+ if (0 != res) {
+ bptr->attr.ls_active = bptr->attr.ls_requested;
+ bptr->attr.sv_active = bptr->attr.sv_requested;
+ gw = (bptr->attr.sv_active + bptr->attr.lw_active) / 2.0;
+ if ((2.0 * bptr->attr.lw_active) < gw) {
+ gw = 2.0 * bptr->attr.lw_active;
+ }
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : case DK4_GRA_LC_PROJECTING : {
+ gw += bptr->attr.lw_requested;
+ } break;
+ }
+ switch (bptr->attr.ls_active) {
+ case DK4_GRA_LS_DASH : {
+ da[0] = bptr->attr.sv_active;
+ da[1] = gw;
+ res = dk4gra_eps_dash_out(
+ bptr, da, 2, (bptr->attr.sv_active / 2.0), erp
+ );
+ if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_LS_DOT : {
+ da[0] = da[1] = bptr->attr.lw_active;
+ res = dk4gra_eps_dash_out(bptr, da, 2, 0.0, erp);
+ if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_LS_DASH_DOT : {
+ da[0] = bptr->attr.sv_active;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_active;
+ da[3] = gw;
+ res = dk4gra_eps_dash_out(
+ bptr, da, 4, (bptr->attr.sv_active / 2.0), erp
+ );
+ if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT : {
+ da[0] = bptr->attr.sv_active;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_active;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_active;
+ da[5] = gw;
+ res = dk4gra_eps_dash_out(
+ bptr, da, 6, (bptr->attr.sv_active / 2.0), erp
+ );
+ if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT_DOT : {
+ da[0] = bptr->attr.sv_active;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_active;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_active;
+ da[5] = gw;
+ da[6] = bptr->attr.lw_active;
+ da[7] = gw;
+ res = dk4gra_eps_dash_out(
+ bptr, da, 8, (bptr->attr.sv_active / 2.0), erp
+ );
+ if (0 == res) { back = 0; }
+ } break;
+ default : {
+ dk4gra_eps_kw(bptr, 8, &back, erp);
+ } break;
+ }
+ }
+ /* Line cap
+ */
+ if (bptr->attr.lc_active != bptr->attr.lc_requested) {
+ bptr->attr.lc_active = bptr->attr.lc_requested;
+ switch (bptr->attr.lc_active) {
+ case DK4_GRA_LC_ROUNDED : {
+ lci = 13;
+ } break;
+ case DK4_GRA_LC_PROJECTING : {
+ lci = 14;
+ } break;
+ default : {
+ lci = 12;
+ } break;
+ }
+ dk4gra_eps_kw(bptr, lci, &back, erp);
+ }
+ /* Line join
+ */
+ if (bptr->attr.lj_active != bptr->attr.lj_requested) {
+ bptr->attr.lj_active = bptr->attr.lj_requested;
+ switch (bptr->attr.lj_active) {
+ case DK4_GRA_LJ_ROUNDED : {
+ lci = 16;
+ } break;
+ case DK4_GRA_LJ_BEVELED : {
+ lci = 17;
+ } break;
+ default : {
+ lci = 15;
+ } break;
+ }
+ dk4gra_eps_kw(bptr, lci, &back, erp);
+ }
+ /* Miter limit, only if line join is mitered
+ */
+ if (DK4_GRA_LJ_MITERED == bptr->attr.lj_active) {
+ if (
+ DK4_GRA_EPSILON_MITERLIMIT
+ < fabs(bptr->attr.ml_active - bptr->attr.ml_requested)
+ ) {
+ dk4gra_eps_values_and_keyword(
+ bptr, &(bptr->attr.ml_requested), 1, 50, &back, erp
+ );
+ bptr->attr.ml_active = bptr->attr.ml_requested;
+ }
+ }
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_prepare_stroke %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_fill"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, ((0 != gra->eor) ? (19) : (18)), &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_fill %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 20, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_stroke %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_clip"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, ((0 != gra->eor) ? (22) : (21)), &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_clip %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_pattern(
+ dk4_gra_t *gra,
+ int pn,
+ double *xval,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ const char *pname; /* Pattern name */
+ int back = 0;
+ int res; /* Operation result */
+ $? "+ dk4gra_eps_pattern"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0 > pn) || (DK4_GRA_PATTERN_MAX < pn)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ pname = dk4gra_eps_pattern_name(pn);
+ if (NULL == pname) {
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ goto finished;
+ }
+ bptr->patu[pn] = 0x01;
+
+ back = 1;
+
+ switch (pn) {
+ case DK4_GRA_PATTERN_30_DEGREE_RIGHT : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_30_DEGREE_SIEVE : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_LEFT : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_RIGHT : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_SIEVE : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_BRICKS : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_BRICKS : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_LINES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_LINES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_1 : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_2 : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_LARGE_FISH_SCALES : {
+ /* xs xe ys ye dx dy r a1 a2 */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 9, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_SMALL_FISH_SCALES : {
+ /* xs xe ys ye dx dy r a1 a2 */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 9, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_CIRCLES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HEXAGONS : {
+ /* xs xe ys ye dx dy */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 6, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_OCTAGONS : {
+ /* xs xe ys ye dx co */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 6, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_TIRES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_TIRES : {
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ /* DK4_GRA_PATTERN_30_DEGREE_LEFT */
+ default : {
+ /* ys = yb - (xe - xs) / sqrt(3) */
+ res = dk4gra_eps_write_pattern_instance(
+ bptr, xval, 5, pname, erp
+ ); if (0 == res) { back = 0; }
+ } break;
+ }
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_pattern %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ double val[4]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_newpath_moveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ $? ". PS: %g %g moveto", x, y
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 23, &back, erp);
+ val[0] = x; val[1] = y;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_newpath_moveto %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ double val[4]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_lineto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ $? ". PS: %g %g lineto", x, y
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ val[0] = x; val[1] = y;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_lineto %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_curveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ $? ". PS: %g %g %g %g %g %g curveto", xc1, yc1, xc2, yc2, x, y
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ val[0] = xc1; val[1] = yc1; val[2] = xc2; val[3] = yc2;
+ val[4] = x; val[5] = y;
+ back = 1;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_curveto %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_closepath"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ $? ". PS: closepath"
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 27, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_closepath %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_circle x=%g y=%g r=%g", xc, yc, r
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_eps_kw(bptr, 23, &back, erp);
+ val[0] = xc + r;
+ val[1] = yc;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ val[0] = xc; val[1] = yc; val[2] = r;
+ dk4gra_eps_values_and_keyword(bptr, val, 3, 28, &back, erp);
+ bptr->cont = 1;
+
+ finished:
+ $? "-dk4gra_eps_circle %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_eps_rectangle x=%g %g y=%g %g r=%g", xl, xr, yb, yt, r
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ /* Correct radius if necessary
+ */
+ back = 1;
+
+ /* Output
+ */
+ dk4gra_eps_kw(bptr, 23, &back, erp);
+ if (0.0 < r) {
+ val[0] = xl + r;
+ val[1] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ val[0] = xr - r;
+ val[1] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xr - (1.0 - KAPPA_4) * r;
+ val[1] = yb;
+ val[2] = xr;
+ val[3] = yb + (1.0 - KAPPA_4) * r;
+ val[4] = xr;
+ val[5] = yb + r;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ val[0] = xr;
+ val[1] = yt - r;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xr;
+ val[1] = yt - (1.0 - KAPPA_4) * r;
+ val[2] = xr - (1.0 - KAPPA_4) * r;
+ val[3] = yt;
+ val[4] = xr - r;
+ val[5] = yt;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ val[0] = xl + r;
+ val[1] = yt;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xl + (1.0 - KAPPA_4) * r;
+ val[1] = yt;
+ val[2] = xl;
+ val[3] = yt - (1.0 - KAPPA_4) * r;
+ val[4] = xl;
+ val[5] = yt - r;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ val[0] = xl;
+ val[1] = yb + r;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xl;
+ val[1] = yb + (1.0 - KAPPA_4) * r;
+ val[2] = xl + (1.0 - KAPPA_4) * r;
+ val[3] = yb;
+ val[4] = xl + r;
+ val[5] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 6, 26, &back, erp);
+ dk4gra_eps_kw(bptr, 27, &back, erp);
+ }
+ else {
+ val[0] = xl; val[1] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ val[0] = xr; val[1] = yb;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xr; val[1] = yt;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ val[0] = xl; val[1] = yt;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ dk4gra_eps_kw(bptr, 27, &back, erp);
+ }
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_rectangle %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_eps_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_er_t *erp
+)
+{
+ double val[8]; /* Array for function call */
+ dk4_gra_ps_page_t *bptr; /* Current page */
+ double xstart; /* Start X coordinate */
+ double ystart; /* Start Y coordinate */
+ int back = 0;
+ $? "+ dk4gra_eps_arc x=%g y=%g r=%g a=%g b=%g cl=%d",xc,yc,ra,start,end,cl
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ if ((NULL == bptr->memstrm) || (0 != bptr->spip)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ xstart = (M_PI * start) / 180.0;
+ ystart = xstart;
+ xstart = xc + ra * cos(xstart);
+ ystart = yc + ra * sin(ystart);
+ back = 1;
+ dk4gra_eps_kw(bptr, 23, &back, erp);
+ val[0] = xstart; val[1] = ystart;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 24, &back, erp);
+ val[0] = xc; val[1] = yc; val[2] = ra; val[3] = start; val[4] = end;
+ dk4gra_eps_values_and_keyword(bptr, val, 5, 29, &back, erp);
+ if (0 != cl) {
+ val[0] = xc; val[1] = yc;
+ dk4gra_eps_values_and_keyword(bptr, val, 2, 25, &back, erp);
+ dk4gra_eps_kw(bptr, 27, &back, erp);
+ }
+ bptr->cont = 1;
+
+ finished:
+ $? "- dk4gra_eps_arc %d", back
+ return back;
+}
+
+
+
+void
+dk4gra_eps_save_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->catt),
+ &(bptr->attr),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_eps_restore_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->attr),
+ &(bptr->catt),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_eps_reset_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_ps_page_t *bptr; /* Current page */
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_ps_page_t *)(gra->curpg);
+ dk4gratool_reset_active_attributes(&(bptr->attr));
+}
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grpat.c b/support/dktools/dk4grpat.c
new file mode 100644
index 0000000000..d4d85d415e
--- /dev/null
+++ b/support/dktools/dk4grpat.c
@@ -0,0 +1,530 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grpat.ctr
+*/
+
+/** @file dk4grpat.c The dk4grpat module.
+*/
+
+
+#line 8 "dk4grpat.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include "dk4grat.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+void
+dk4gra_i_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ int pn,
+ const double *val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double x;
+ double y;
+ double dx;
+ double dy;
+ double ydiff;
+ double alpha;
+ double alpha1;
+ double alpha2;
+ double kappa;
+ double dxdt0;
+ double dxdt1;
+ double dydt0;
+ double dydt1;
+ int passno;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (pn) {
+ case DK4_GRA_PATTERN_30_DEGREE_RIGHT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ ydiff = (val[1] - val[0]) / sqrt(3.0);
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], (y + ydiff), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_30_DEGREE_SIEVE : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_30_DEGREE_RIGHT, val, backptr, erp
+ );
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_30_DEGREE_LEFT, val, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_LEFT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ ydiff = val[1] - val[0];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[1], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[0], (y + ydiff), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_RIGHT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ ydiff = val[1] - val[0];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], (y + ydiff), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_SIEVE : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_45_DEGREE_RIGHT, val, backptr, erp
+ );
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_45_DEGREE_LEFT, val, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_BRICKS : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ passno = 0;
+ y = val[2];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x = val[0];
+ if (0 != passno) { x += val[4]; }
+ do {
+ dk4gra_i_newpath_moveto(gra, x, y, backptr, erp);
+ dk4gra_i_lineto(gra, x, (y + val[4]), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += (2.0 * val[4]);
+ } while (val[1] >= x);
+ y += val[4];
+ passno = ((0 != passno) ? (0) : (1));
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_BRICKS : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ x = val[0];
+ passno = 0;
+ do {
+ dk4gra_i_newpath_moveto(gra, x, val[2], backptr, erp);
+ dk4gra_i_lineto(gra, x, val[3], backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y = val[2];
+ if (0 != passno) { y += val[4]; }
+ do {
+ dk4gra_i_newpath_moveto(gra, x, y, backptr, erp);
+ dk4gra_i_lineto(gra, (x + val[4]), y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += (2.0 * val[4]);
+ } while (val[3] >= y);
+ x += val[4];
+ passno = ((0 != passno) ? (0) : (1));
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_LINES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_LINES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ x = val[0];
+ do {
+ dk4gra_i_newpath_moveto(gra, x, val[2], backptr, erp);
+ dk4gra_i_lineto(gra, x, val[3], backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += val[4];
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_HORIZONTAL_LINES, val, backptr, erp
+ );
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_VERTICAL_LINES, val, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ dx = val[4] / 4.0;
+ passno = 0;
+ y = val[2];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x = val[0];
+ switch (passno) {
+ case 1: {
+ x += (1.5 * val[4]);
+ } break;
+ case 2: {
+ x += val[4];
+ } break;
+ case 3: {
+ x += (0.5 * val[4]);
+ } break;
+ }
+ do {
+ dk4gra_i_newpath_moveto(gra, (x - dx), y, backptr, erp);
+ dk4gra_i_lineto(gra, (x + dx), (y + val[4]), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += (2.0 * val[4]);
+ } while (val[1] >= x);
+ y += val[4];
+ passno++;
+ if (4 <= passno) { passno = 0; }
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ dx = val[4] / 4.0;
+ passno = 0;
+ y = val[2];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x = val[0];
+ switch (passno) {
+ case 1: {
+ x += (0.5 * val[4]);
+ } break;
+ case 2: {
+ x += val[4];
+ } break;
+ case 3: {
+ x += (1.5 * val[4]);
+ } break;
+ }
+ do {
+ dk4gra_i_newpath_moveto(gra, (x + dx), y, backptr, erp);
+ dk4gra_i_lineto(gra, (x - dx), (y + val[4]), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += (2.0 * val[4]);
+ } while (val[1] >= x);
+ y += val[4];
+ passno++;
+ if (4 <= passno) { passno = 0; }
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_1 : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ dy = val[4] / 4.0;
+ x = val[0];
+ passno = 0;
+ do {
+ dk4gra_i_newpath_moveto(gra, x, val[2], backptr, erp);
+ dk4gra_i_lineto(gra, x, val[3], backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y = val[2];
+ switch (passno) {
+ case 1: {
+ y += (0.5 * val[4]);
+ } break;
+ case 2: {
+ y += val[4];
+ } break;
+ case 3: {
+ y += (1.5 * val[4]);
+ } break;
+ }
+ do {
+ dk4gra_i_newpath_moveto(gra, x, (y + dy), backptr, erp);
+ dk4gra_i_lineto(gra, (x + val[4]), (y - dy), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += (2.0 * val[4]);
+ } while (val[3] >= y);
+ x += val[4];
+ passno++; if (4 <= passno) { passno = 0; }
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_2 : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ dy = val[4] / 4.0;
+ x = val[0];
+ passno = 0;
+ do {
+ dk4gra_i_newpath_moveto(gra, x, val[2], backptr, erp);
+ dk4gra_i_lineto(gra, x, val[3], backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y = val[2];
+ switch (passno) {
+ case 1: {
+ y += (1.5 * val[4]);
+ } break;
+ case 2: {
+ y += val[4];
+ } break;
+ case 3: {
+ y += (0.5 * val[4]);
+ } break;
+ }
+ do {
+ dk4gra_i_newpath_moveto(gra, x, (y - dy), backptr, erp);
+ dk4gra_i_lineto(gra, (x + val[4]), (y + dy), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += (2.0 * val[4]);
+ } while (val[3] >= y);
+ x += val[4];
+ passno++; if (4 <= passno) { passno = 0; }
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_LARGE_FISH_SCALES :
+ case DK4_GRA_PATTERN_SMALL_FISH_SCALES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx 5=dy 6=r 7=a1 8=a2 */
+ passno = 0;
+ alpha1 = (M_PI * val[7]) / 180.0;
+ alpha2 = (M_PI * val[8]) / 180.0;
+ alpha = alpha2 - alpha1;
+ kappa = dk4gratool_kappa_for_angle(alpha);
+ dxdt0 = -1.0 * val[6] * alpha * sin(alpha1);
+ dydt0 = val[6] * alpha * cos(alpha1);
+ dxdt1 = -1.0 * val[6] * alpha * sin(alpha2);
+ dydt1 = val[6] * alpha * cos(alpha2);
+ dxdt0 *= kappa; dydt0 *= kappa; dxdt1 *= kappa; dydt1 *= kappa;
+ y = val[2];
+ do {
+ x = val[0];
+ if (0 != passno) x -= (val[4] / 2.0);
+ /* moveto */
+ dk4gra_i_newpath_moveto(
+ gra, x, (y+val[5]), backptr, erp
+ );
+ /* curveto */
+ dk4gra_i_curveto(
+ gra,
+ (x+dxdt0), (y+val[5]+dydt0),
+ (x+val[4]-dxdt1), (y+val[5]-dydt1),
+ (x+val[4]), (y+val[5]),
+ backptr, erp
+ );
+ x += val[4];
+ while (val[1] > x) {
+ /* curveto */
+ dk4gra_i_curveto(
+ gra,
+ (x+dxdt0), (y+val[5]+dydt0),
+ (x+val[4]-dxdt1), (y+val[5]-dydt1),
+ (x+val[4]), (y+val[5]),
+ backptr, erp
+ );
+ x += val[4];
+ }
+ /* stroke */
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[5];
+ passno = ((0 != passno) ? (0) : (1));
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_CIRCLES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=r */
+ x = val[0];
+ do {
+ y = val[2];
+ do {
+ dk4gra_i_circle(
+ gra, (x+val[4]), (y+val[4]), val[4], backptr, erp
+ );
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += 2.0 * val[4];
+ } while (val[3] >= y);
+ x += (2.0 * val[4]);
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_HEXAGONS : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx 5=dy */
+ dx = val[4] / 6.0;
+ dy = val[5] / 2.0;
+ y = val[2];
+ do {
+ x = val[0];
+ do {
+ dk4gra_i_newpath_moveto(gra, x, (y+dy), backptr, erp);
+ dk4gra_i_lineto(gra, (x + dx), y, backptr, erp);
+ dk4gra_i_lineto(gra, (x + 3.0 * dx), y, backptr, erp);
+ dk4gra_i_lineto(gra,(x + 4.0 * dx),(y + dy),backptr,erp);
+ dk4gra_i_lineto(gra,(x + 3.0 * dx),(y+val[5]),backptr,erp);
+ dk4gra_i_lineto(gra, (x + dx), (y + val[5]), backptr, erp);
+ dk4gra_i_closepath(gra, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ dk4gra_i_newpath_moveto(
+ gra, (x + 4.0 * dx), (y + dy), backptr, erp
+ );
+ dk4gra_i_lineto(gra,(x + 6.0 * dx),(y + dy),backptr,erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += val[4];
+ } while (val[1] >= x);
+ y += val[5];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_OCTAGONS : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx 5=co */
+ y = val[2];
+ do {
+ x = val[0];
+ do {
+ dk4gra_i_newpath_moveto(
+ gra, (x + val[5]), y, backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4] - val[5]), y, backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4]), (y + val[5]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4]), (y + val[4] - val[5]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4] - val[5]), (y + val[4]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[5]), (y + val[4]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, x, (y + val[4] - val[5]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, x, (y + val[5]), backptr, erp
+ );
+ dk4gra_i_closepath(gra, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += val[4];
+ } while (val[1] >= x);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_TIRES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ y = val[2];
+ do {
+ x = val[0];
+ dk4gra_i_newpath_moveto(gra, x, y, backptr, erp);
+ dk4gra_i_lineto(
+ gra, (x + val[4] / 2.0), (y + val[4] / 2.0), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4]), y, backptr, erp
+ );
+ do {
+ dk4gra_i_lineto(
+ gra,(x + val[4] / 2.0),(y + val[4] / 2.0),backptr,erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4]), y, backptr, erp
+ );
+ x += val[4];
+ } while (val[1] >= x);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_TIRES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ x = val[0];
+ do {
+ y = val[2];
+ dk4gra_i_newpath_moveto(gra, x, y, backptr, erp);
+ dk4gra_i_lineto(
+ gra, (x + val[4] / 2.0), (y + val[4] / 2.0), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, x, (y + val[4]), backptr, erp
+ );
+ do {
+ dk4gra_i_lineto(
+ gra,(x + val[4] / 2.0),(y + val[4] / 2.0),backptr,erp
+ );
+ dk4gra_i_lineto(
+ gra, x, (y + val[4]), backptr, erp
+ );
+ y += val[4];
+ } while (val[3] >= y);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += val[4];
+ } while (val[1] >= x);
+ } break;
+ default : { /* 30 degree left */
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ ydiff = (val[1] - val[0]) / sqrt(3.0);
+ do {
+ dk4gra_i_newpath_moveto(gra, val[1], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[0], (y + ydiff), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ }
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grpat.ctr b/support/dktools/dk4grpat.ctr
new file mode 100644
index 0000000000..2c643ffeda
--- /dev/null
+++ b/support/dktools/dk4grpat.ctr
@@ -0,0 +1,519 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include "dk4grat.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+void
+dk4gra_i_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ int pn,
+ const double *val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double x;
+ double y;
+ double dx;
+ double dy;
+ double ydiff;
+ double alpha;
+ double alpha1;
+ double alpha2;
+ double kappa;
+ double dxdt0;
+ double dxdt1;
+ double dydt0;
+ double dydt1;
+ int passno;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ switch (pn) {
+ case DK4_GRA_PATTERN_30_DEGREE_RIGHT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ ydiff = (val[1] - val[0]) / sqrt(3.0);
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], (y + ydiff), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_30_DEGREE_SIEVE : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_30_DEGREE_RIGHT, val, backptr, erp
+ );
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_30_DEGREE_LEFT, val, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_LEFT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ ydiff = val[1] - val[0];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[1], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[0], (y + ydiff), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_RIGHT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ ydiff = val[1] - val[0];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], (y + ydiff), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_45_DEGREE_SIEVE : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_45_DEGREE_RIGHT, val, backptr, erp
+ );
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_45_DEGREE_LEFT, val, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_BRICKS : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ passno = 0;
+ y = val[2];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x = val[0];
+ if (0 != passno) { x += val[4]; }
+ do {
+ dk4gra_i_newpath_moveto(gra, x, y, backptr, erp);
+ dk4gra_i_lineto(gra, x, (y + val[4]), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += (2.0 * val[4]);
+ } while (val[1] >= x);
+ y += val[4];
+ passno = ((0 != passno) ? (0) : (1));
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_BRICKS : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ x = val[0];
+ passno = 0;
+ do {
+ dk4gra_i_newpath_moveto(gra, x, val[2], backptr, erp);
+ dk4gra_i_lineto(gra, x, val[3], backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y = val[2];
+ if (0 != passno) { y += val[4]; }
+ do {
+ dk4gra_i_newpath_moveto(gra, x, y, backptr, erp);
+ dk4gra_i_lineto(gra, (x + val[4]), y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += (2.0 * val[4]);
+ } while (val[3] >= y);
+ x += val[4];
+ passno = ((0 != passno) ? (0) : (1));
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_LINES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_LINES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ x = val[0];
+ do {
+ dk4gra_i_newpath_moveto(gra, x, val[2], backptr, erp);
+ dk4gra_i_lineto(gra, x, val[3], backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += val[4];
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_HORIZONTAL_LINES, val, backptr, erp
+ );
+ dk4gra_i_pattern(
+ gra, xl, xr, yb, yt,
+ DK4_GRA_PATTERN_VERTICAL_LINES, val, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ dx = val[4] / 4.0;
+ passno = 0;
+ y = val[2];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x = val[0];
+ switch (passno) {
+ case 1: {
+ x += (1.5 * val[4]);
+ } break;
+ case 2: {
+ x += val[4];
+ } break;
+ case 3: {
+ x += (0.5 * val[4]);
+ } break;
+ }
+ do {
+ dk4gra_i_newpath_moveto(gra, (x - dx), y, backptr, erp);
+ dk4gra_i_lineto(gra, (x + dx), (y + val[4]), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += (2.0 * val[4]);
+ } while (val[1] >= x);
+ y += val[4];
+ passno++;
+ if (4 <= passno) { passno = 0; }
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ dx = val[4] / 4.0;
+ passno = 0;
+ y = val[2];
+ do {
+ dk4gra_i_newpath_moveto(gra, val[0], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[1], y, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x = val[0];
+ switch (passno) {
+ case 1: {
+ x += (0.5 * val[4]);
+ } break;
+ case 2: {
+ x += val[4];
+ } break;
+ case 3: {
+ x += (1.5 * val[4]);
+ } break;
+ }
+ do {
+ dk4gra_i_newpath_moveto(gra, (x + dx), y, backptr, erp);
+ dk4gra_i_lineto(gra, (x - dx), (y + val[4]), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += (2.0 * val[4]);
+ } while (val[1] >= x);
+ y += val[4];
+ passno++;
+ if (4 <= passno) { passno = 0; }
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_1 : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ dy = val[4] / 4.0;
+ x = val[0];
+ passno = 0;
+ do {
+ dk4gra_i_newpath_moveto(gra, x, val[2], backptr, erp);
+ dk4gra_i_lineto(gra, x, val[3], backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y = val[2];
+ switch (passno) {
+ case 1: {
+ y += (0.5 * val[4]);
+ } break;
+ case 2: {
+ y += val[4];
+ } break;
+ case 3: {
+ y += (1.5 * val[4]);
+ } break;
+ }
+ do {
+ dk4gra_i_newpath_moveto(gra, x, (y + dy), backptr, erp);
+ dk4gra_i_lineto(gra, (x + val[4]), (y - dy), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += (2.0 * val[4]);
+ } while (val[3] >= y);
+ x += val[4];
+ passno++; if (4 <= passno) { passno = 0; }
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_SHINGLES_2 : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ dy = val[4] / 4.0;
+ x = val[0];
+ passno = 0;
+ do {
+ dk4gra_i_newpath_moveto(gra, x, val[2], backptr, erp);
+ dk4gra_i_lineto(gra, x, val[3], backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y = val[2];
+ switch (passno) {
+ case 1: {
+ y += (1.5 * val[4]);
+ } break;
+ case 2: {
+ y += val[4];
+ } break;
+ case 3: {
+ y += (0.5 * val[4]);
+ } break;
+ }
+ do {
+ dk4gra_i_newpath_moveto(gra, x, (y - dy), backptr, erp);
+ dk4gra_i_lineto(gra, (x + val[4]), (y + dy), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += (2.0 * val[4]);
+ } while (val[3] >= y);
+ x += val[4];
+ passno++; if (4 <= passno) { passno = 0; }
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_LARGE_FISH_SCALES :
+ case DK4_GRA_PATTERN_SMALL_FISH_SCALES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx 5=dy 6=r 7=a1 8=a2 */
+ passno = 0;
+ alpha1 = (M_PI * val[7]) / 180.0;
+ alpha2 = (M_PI * val[8]) / 180.0;
+ alpha = alpha2 - alpha1;
+ kappa = dk4gratool_kappa_for_angle(alpha);
+ dxdt0 = -1.0 * val[6] * alpha * sin(alpha1);
+ dydt0 = val[6] * alpha * cos(alpha1);
+ dxdt1 = -1.0 * val[6] * alpha * sin(alpha2);
+ dydt1 = val[6] * alpha * cos(alpha2);
+ dxdt0 *= kappa; dydt0 *= kappa; dxdt1 *= kappa; dydt1 *= kappa;
+ y = val[2];
+ do {
+ x = val[0];
+ if (0 != passno) x -= (val[4] / 2.0);
+ /* moveto */
+ dk4gra_i_newpath_moveto(
+ gra, x, (y+val[5]), backptr, erp
+ );
+ /* curveto */
+ dk4gra_i_curveto(
+ gra,
+ (x+dxdt0), (y+val[5]+dydt0),
+ (x+val[4]-dxdt1), (y+val[5]-dydt1),
+ (x+val[4]), (y+val[5]),
+ backptr, erp
+ );
+ x += val[4];
+ while (val[1] > x) {
+ /* curveto */
+ dk4gra_i_curveto(
+ gra,
+ (x+dxdt0), (y+val[5]+dydt0),
+ (x+val[4]-dxdt1), (y+val[5]-dydt1),
+ (x+val[4]), (y+val[5]),
+ backptr, erp
+ );
+ x += val[4];
+ }
+ /* stroke */
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[5];
+ passno = ((0 != passno) ? (0) : (1));
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_CIRCLES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=r */
+ x = val[0];
+ do {
+ y = val[2];
+ do {
+ dk4gra_i_circle(
+ gra, (x+val[4]), (y+val[4]), val[4], backptr, erp
+ );
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += 2.0 * val[4];
+ } while (val[3] >= y);
+ x += (2.0 * val[4]);
+ } while (val[1] >= x);
+ } break;
+ case DK4_GRA_PATTERN_HEXAGONS : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx 5=dy */
+ dx = val[4] / 6.0;
+ dy = val[5] / 2.0;
+ y = val[2];
+ do {
+ x = val[0];
+ do {
+ dk4gra_i_newpath_moveto(gra, x, (y+dy), backptr, erp);
+ dk4gra_i_lineto(gra, (x + dx), y, backptr, erp);
+ dk4gra_i_lineto(gra, (x + 3.0 * dx), y, backptr, erp);
+ dk4gra_i_lineto(gra,(x + 4.0 * dx),(y + dy),backptr,erp);
+ dk4gra_i_lineto(gra,(x + 3.0 * dx),(y+val[5]),backptr,erp);
+ dk4gra_i_lineto(gra, (x + dx), (y + val[5]), backptr, erp);
+ dk4gra_i_closepath(gra, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ dk4gra_i_newpath_moveto(
+ gra, (x + 4.0 * dx), (y + dy), backptr, erp
+ );
+ dk4gra_i_lineto(gra,(x + 6.0 * dx),(y + dy),backptr,erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += val[4];
+ } while (val[1] >= x);
+ y += val[5];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_OCTAGONS : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx 5=co */
+ y = val[2];
+ do {
+ x = val[0];
+ do {
+ dk4gra_i_newpath_moveto(
+ gra, (x + val[5]), y, backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4] - val[5]), y, backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4]), (y + val[5]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4]), (y + val[4] - val[5]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4] - val[5]), (y + val[4]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[5]), (y + val[4]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, x, (y + val[4] - val[5]), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, x, (y + val[5]), backptr, erp
+ );
+ dk4gra_i_closepath(gra, backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += val[4];
+ } while (val[1] >= x);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_HORIZONTAL_TIRES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ y = val[2];
+ do {
+ x = val[0];
+ dk4gra_i_newpath_moveto(gra, x, y, backptr, erp);
+ dk4gra_i_lineto(
+ gra, (x + val[4] / 2.0), (y + val[4] / 2.0), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4]), y, backptr, erp
+ );
+ do {
+ dk4gra_i_lineto(
+ gra,(x + val[4] / 2.0),(y + val[4] / 2.0),backptr,erp
+ );
+ dk4gra_i_lineto(
+ gra, (x + val[4]), y, backptr, erp
+ );
+ x += val[4];
+ } while (val[1] >= x);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ case DK4_GRA_PATTERN_VERTICAL_TIRES : {
+ /* 0=xs 1=xe 2=ys 3=ye 4=dx */
+ x = val[0];
+ do {
+ y = val[2];
+ dk4gra_i_newpath_moveto(gra, x, y, backptr, erp);
+ dk4gra_i_lineto(
+ gra, (x + val[4] / 2.0), (y + val[4] / 2.0), backptr, erp
+ );
+ dk4gra_i_lineto(
+ gra, x, (y + val[4]), backptr, erp
+ );
+ do {
+ dk4gra_i_lineto(
+ gra,(x + val[4] / 2.0),(y + val[4] / 2.0),backptr,erp
+ );
+ dk4gra_i_lineto(
+ gra, x, (y + val[4]), backptr, erp
+ );
+ y += val[4];
+ } while (val[3] >= y);
+ dk4gra_i_stroke(gra, backptr, erp);
+ x += val[4];
+ } while (val[1] >= x);
+ } break;
+ default : { /* 30 degree left */
+ /* 0=xs 1=xe 2=ys 3=ye 4=dy */
+ y = val[2];
+ ydiff = (val[1] - val[0]) / sqrt(3.0);
+ do {
+ dk4gra_i_newpath_moveto(gra, val[1], y, backptr, erp);
+ dk4gra_i_lineto(gra, val[0], (y + ydiff), backptr, erp);
+ dk4gra_i_stroke(gra, backptr, erp);
+ y += val[4];
+ } while (val[3] >= y);
+ } break;
+ }
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grpdf.c b/support/dktools/dk4grpdf.c
new file mode 100644
index 0000000000..f5b76e4797
--- /dev/null
+++ b/support/dktools/dk4grpdf.c
@@ -0,0 +1,3040 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grpdf.ctr
+*/
+
+/** @file dk4grpdf.c The dk4grpdf module.
+*/
+
+
+#line 8 "dk4grpdf.ctr"
+
+
+#ifdef DK4GRA_PDF_FORCE_UNCOMPRESSED
+#undef DK4GRA_PDF_FORCE_UNCOMPRESSED
+#endif
+
+/** Use for debugging purposes only to produce
+ an uncompresse page contents data stream.
+ Normally this should be defined to 0.
+*/
+#define DK4GRA_PDF_FORCE_UNCOMPRESSED 0
+
+
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#ifndef DK4UFIC_H_INCLUDED
+#include "dk4ufic.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#include "dk4strm.h"
+#endif
+
+#ifndef DK4STRMF_H_INCLUDED
+#include "dk4strmf.h"
+#endif
+
+#ifndef DK4STRMCO_H_INCLUDED
+#include "dk4strmco.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 85 "dk4grpdf.ctr"
+
+
+/** PDF object position.
+*/
+typedef struct {
+ size_t num; /**< Object number. */
+ dk4_um_t pos; /**< Start position in output stream. */
+} dk4_gra_pdf_objpos_t;
+
+
+
+/** Constant text fragments used by module.
+*/
+static const char * const dk4_gra_pdf_c8_kw[] = {
+/* 0 */
+"\n",
+
+/* 1 */
+" ",
+
+/* 2 */
+"q\n",
+
+/* 3 */
+"Q\n",
+
+/* 4 */
+" m\n",
+
+/* 5 */
+" l\n",
+
+/* 6 */
+" c\n",
+
+/* 7 */
+"h\n",
+
+/* 8 */
+"S\n",
+
+/* 9 */
+"f\n",
+
+/* 10 */
+"f*\n",
+
+/* 11 */
+"B\n",
+
+/* 12 */
+"B*\n",
+
+/* 13 */
+"W n\n",
+
+/* 14 */
+"W* n\n",
+
+/* 15 */
+"1 g\n",
+
+/* 16 */
+"0 ",
+
+/* 17 */
+"0",
+
+/* 18 */
+" 0",
+
+/* 19 */
+" g\n",
+
+/* 20 */
+" G\n",
+
+/* 21 */
+" k\n",
+
+/* 22 */
+" K\n",
+
+/* 23 */
+" rg\n",
+
+/* 24 */
+" RG\n",
+
+/* 25 */
+" w\n",
+
+/* 26 */
+"0 J\n",
+
+/* 27 */
+"1 J\n",
+
+/* 28 */
+"2 J\n",
+
+/* 29 */
+"0 j\n",
+
+/* 30 */
+"1 j\n",
+
+/* 31 */
+"2 j\n",
+
+/* 32 */
+"[] 0 d\n",
+
+/* 33 */
+"[",
+
+/* 34 */
+"] ",
+
+/* 35 */
+" d\n",
+
+/* 36 */
+"%PDF-1.4\n",
+
+/* 37 */
+" 0 obj\n",
+
+/* 38 */
+"endobj\n",
+
+/* 39 */
+"<<\n",
+
+/* 40 */
+">>\n",
+
+/* 41 */
+"/Producer (libdk4gra, see http://sourceforge.net/p/dktools/wiki/Home/)\n",
+
+/* 42 */
+"/CreationDate (D:",
+
+/* 43 */
+"/ModDate (D:",
+
+/* 44 */
+")\n",
+
+/* 45 */
+"xref 0 ",
+
+/* 46 */
+"0000000000 65535 f\n",
+
+/* 47 */
+" 00000 n\n",
+
+/* 48 */
+"trailer\n<< /Size ",
+
+/* 49 */
+" /Info 1 0 R /Root 2 0 R >>\nstartxref\n",
+
+/* 50 */
+"\n%%EOF\n",
+
+/* 51 */
+"/Type /Catalog\n",
+
+/* 52 */
+"/Pages 3 0 R\n",
+
+/* 53 */
+"/Type /Pages\n",
+
+/* 54 */
+"/Count ",
+
+/* 55 */
+"/Kids [\n",
+
+/* 56 */
+"]\n",
+
+/* 57 */
+" 0 R\n",
+
+/* 58 */
+"/Type /Page\n",
+
+/* 59 */
+"/Parent 3 0 R\n",
+
+/* 60 */
+"/MediaBox [0 0 ",
+
+/* 61 */
+"/CropBox [0 0 ",
+
+/* 62 */
+"/Resources <<\n",
+
+/* 63 */
+"/ProcSet [/PDF /ImageB /ImageC]\n",
+
+/* 64 */
+"/XObject <<\n",
+
+/* 65 */
+"/Contents ",
+
+/* 66 */
+"/Length ",
+
+/* 67 */
+"/Filter /FlateDecode\n",
+
+/* 68 */
+"stream\n",
+
+/* 69 */
+"\nendstream\n",
+
+/* 70 */
+" cm\n",
+
+/* 71 */
+"/X",
+
+/* 72 */
+" Do\n",
+
+/* 73 */
+"/Type /XObject\n",
+
+/* 74 */
+"/Subtype /Image\n",
+
+/* 75 */
+"/Width ",
+
+/* 76 */
+"/Height ",
+
+/* 77 */
+"/BitsPerComponent ",
+
+/* 78 */
+"/ColorSpace /DeviceRGB\n",
+
+/* 79 */
+"/ColorSpace /DeviceGray\n",
+
+/* 80 */
+"/ColorSpace /DeviceCMYK\n",
+
+/* 81 */
+"/SMask ",
+
+/* 82 */
+"/Interpolate true\n",
+
+/* 83 */
+"/Filter /DCTDecode\n",
+
+/* 84 */
+" M\n",
+
+/* 85 */
+"/Decode [1 0 1 0 1 0 1 0]\n",
+
+/* 86 */
+"/Decode [1 0 1 0 1 0] \n",
+
+/* 87 */
+"/Decode [1 0 1 0] \n",
+
+/* 88 */
+"/Decode [1 0]\n",
+
+NULL
+
+
+#line 361 "dk4grpdf.ctr"
+};
+
+
+
+void
+dk4gra_pdf_i_outstream_kw(
+ dk4_stream_t *os,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 374 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_string(os, dk4_gra_pdf_c8_kw[kwi], backptr, erp);
+}
+
+
+
+void
+dk4gra_pdf_i_values_and_kw(
+ dk4_stream_t *os,
+ double *da,
+ size_t szda,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != da);
+ assert(0 < szda);
+#endif
+ for (i = 0; i < szda; i++) {
+ if (0 < i) {
+ dk4gratool_stream_string(os, dk4_gra_pdf_c8_kw[1], backptr, erp);
+ }
+ if (0 == dk4ma_write_c8_double_no_sci_to_stream(
+ os, da[i], DK4_GRA_EPSILON_COORDINATES, 0, 1, erp
+ )
+ ) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ dk4gratool_stream_string(os, dk4_gra_pdf_c8_kw[kwi], backptr, erp);
+}
+
+
+
+/** Compare page structures by number or a page against a number.
+ @param l Left page object.
+ @param r Right page object or page number.
+ @param cr Comparison criteria (0=page/page, 1=page/number).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pdf_compare_pages_by_number(const void *l, const void *r, int cr)
+{
+ const dk4_gra_pdf_page_t *pl;
+ const dk4_gra_pdf_page_t *pr;
+ const size_t *ppno;
+
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pdf_page_t *)l;
+ switch (cr) {
+ case 1: {
+ ppno = (const size_t *)r;
+ if (pl->pageno > *ppno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < *ppno) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ pr = (const dk4_gra_pdf_page_t *)r;
+ if (pl->pageno > pr->pageno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < pr->pageno) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_compare_used_xo(
+ const void *l,
+ const void *r,
+ int cr
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+ __attribute__((unused))
+#endif
+)
+{
+ const dk4_gra_pdf_img_xo_t *pl;
+ const dk4_gra_pdf_img_xo_t *pr;
+ int back = 0;
+
+#if !DK4_HAVE_ATTRIBUTE_UNUSED
+ (void)cr;
+#endif
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pdf_img_xo_t *)l;
+ pr = (const dk4_gra_pdf_img_xo_t *)r;
+ if (pl->objno > pr->objno) {
+ back = 1;
+ }
+ else {
+ if (pl->objno < pr->objno) {
+ back = -1;
+ }
+ }
+ }
+ else { back = 1; }
+ }
+ else {
+ if (NULL != r) { back = -1; }
+ }
+ return back;
+}
+
+
+
+/** Compare two object positions by number.
+ @param l Left object.
+ @param r Right object.
+ @param cr Comparison criteria (0=objpos/objpos, 1=objpos/number).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pdf_compare_objpos(
+ const void *l,
+ const void *r,
+ int cr
+)
+{
+ const dk4_gra_pdf_objpos_t *pl;
+ const dk4_gra_pdf_objpos_t *pr;
+ const size_t *psz;
+ int back = 0;
+
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pdf_objpos_t *)l;
+ switch (cr) {
+ case 1 : {
+ psz = (const size_t *)r;
+ if (pl->num > *psz) {
+ back = 1;
+ }
+ else {
+ if (pl->num < *psz) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ pr = (const dk4_gra_pdf_objpos_t *)r;
+ if (pl->num > pr->num) {
+ back = 1;
+ }
+ else {
+ if (pl->num < pr->num) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Check whether two XObjects are generated from the same file.
+ @param pl Left object.
+ @param pr Right object.
+ @return Comparison result (0 for equality).
+*/
+static
+int
+dk4gra_pdf_xo_check_same_file(
+ const dk4_gra_pdf_img_xo_t *pl,
+ const dk4_gra_pdf_img_xo_t *pr
+)
+{
+ int back = 0;
+
+
+#line 586 "dk4grpdf.ctr"
+
+
+#line 587 "dk4grpdf.ctr"
+ if (0 != pl->hufi) {
+ if (0 != pr->hufi) {
+ back = dk4ufi_compare(&(pl->ufi), &(pr->ufi));
+
+
+#line 591 "dk4grpdf.ctr"
+ }
+ else {
+
+#line 593 "dk4grpdf.ctr"
+ back = 1;
+ }
+ }
+ else {
+ if (0 != pr->hufi) {
+
+#line 598 "dk4grpdf.ctr"
+ back = -1;
+ }
+ else {
+ if (NULL != pl->fn) {
+ if (NULL != pr->fn) {
+ back = dk4str_pathcmp(pl->fn, pr->fn);
+
+
+#line 605 "dk4grpdf.ctr"
+ }
+ else {
+ back = 1;
+
+#line 608 "dk4grpdf.ctr"
+ }
+ }
+ else {
+ if (NULL != pr->fn) {
+ back = -1;
+
+#line 613 "dk4grpdf.ctr"
+ }
+ else {
+
+#line 615 "dk4grpdf.ctr"
+ if (pl->objno > pr->objno) {
+ back = 1;
+ }
+ else {
+ if (pl->objno < pr->objno) {
+ back = -1;
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+#line 628 "dk4grpdf.ctr"
+ return back;
+}
+
+
+
+/** Compare two integer values.
+ @param l Left value.
+ @param r Right value.
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pdf_compare_int(int l, int r)
+{
+ int back = 0;
+ if (l > r) {
+ back = 1;
+ }
+ else {
+ if (l < r) { back = -1; }
+ }
+ return back;
+}
+
+
+
+/** Compare two XObjects whether or not they contain the same file
+ and frame number using same conversion settings.
+ @param l Left object.
+ @param r Right object.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pdf_compare_xo(
+ const void *l,
+ const void *r,
+ int cr
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+ __attribute__((unused))
+#endif
+)
+{
+ const dk4_gra_pdf_img_xo_t *pl;
+ const dk4_gra_pdf_img_xo_t *pr;
+ int back = 0;
+
+#if !DK4_HAVE_ATTRIBUTE_UNUSED
+ (void)cr;
+#endif
+
+
+#line 680 "dk4grpdf.ctr"
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pdf_img_xo_t *)l;
+ pr = (const dk4_gra_pdf_img_xo_t *)r;
+ /*
+ Check whether or not both XObjects use the same file
+ */
+ back = dk4gra_pdf_xo_check_same_file(pl, pr);
+ /*
+ If the same file is used for both XObjects, check
+ whether the same settings are used
+ */
+ if (0 == back) {
+ if (pl->fno > pr->fno) {
+
+#line 694 "dk4grpdf.ctr"
+ back = 1;
+ }
+ else {
+ if (pl->fno < pr->fno) {
+
+#line 698 "dk4grpdf.ctr"
+ back = -1;
+ }
+ }
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->dct, pr->dct);
+
+
+#line 705 "dk4grpdf.ctr"
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->ipol, pr->ipol);
+
+
+#line 709 "dk4grpdf.ctr"
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->cs, pr->cs);
+
+
+#line 713 "dk4grpdf.ctr"
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->bpc, pr->bpc);
+
+
+#line 717 "dk4grpdf.ctr"
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->deci, pr->deci);
+
+
+#line 721 "dk4grpdf.ctr"
+ }
+ }
+ else {
+
+#line 724 "dk4grpdf.ctr"
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+
+#line 729 "dk4grpdf.ctr"
+ back = -1;
+ }
+ }
+
+
+#line 733 "dk4grpdf.ctr"
+ return back;
+}
+
+
+
+/** Destroy XObject structure, release resources.
+ @param puxo XObject structure to destroy.
+*/
+void
+dk4gra_pdf_xo_delete(
+ dk4_gra_pdf_img_xo_t *puxo
+)
+{
+
+
+#line 747 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != puxo);
+#endif
+ if (NULL != puxo) {
+
+#line 751 "dk4grpdf.ctr"
+
+
+#line 752 "dk4grpdf.ctr"
+ if (NULL != puxo->i_mb) {
+
+
+#line 754 "dk4grpdf.ctr"
+ dk4membuf_close(puxo->i_mb);
+
+
+#line 756 "dk4grpdf.ctr"
+ } puxo->i_mb = NULL;
+
+
+#line 758 "dk4grpdf.ctr"
+ if (NULL != puxo->m_mb) {
+
+
+#line 760 "dk4grpdf.ctr"
+ dk4membuf_close(puxo->m_mb);
+
+
+#line 762 "dk4grpdf.ctr"
+ } puxo->m_mb = NULL;
+
+
+#line 764 "dk4grpdf.ctr"
+ if (NULL != puxo->fn) {
+
+
+#line 766 "dk4grpdf.ctr"
+ dk4mem_free((void *)(puxo->fn));
+
+
+#line 768 "dk4grpdf.ctr"
+ } puxo->fn = NULL;
+
+
+#line 770 "dk4grpdf.ctr"
+ dk4mem_free(puxo);
+
+
+#line 772 "dk4grpdf.ctr"
+ }
+
+
+#line 774 "dk4grpdf.ctr"
+}
+
+
+
+/** Destroy page structure, release resources.
+ @param pptr Page to destroy.
+*/
+static
+void
+dk4gra_pgf_page_delete(
+ dk4_gra_pdf_page_t *pptr
+)
+{
+
+
+#line 788 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pptr);
+#endif
+ if (NULL != pptr) {
+
+#line 792 "dk4grpdf.ctr"
+ if (NULL != pptr->s_uxo) {
+ if (NULL != pptr->i_uxo) {
+ dk4sto_it_close(pptr->i_uxo);
+ }
+ dk4sto_close(pptr->s_uxo);
+ } pptr->s_uxo = NULL; pptr->i_uxo = NULL;
+ if (NULL != pptr->costrm) {
+
+
+#line 800 "dk4grpdf.ctr"
+ dk4stream_close(pptr->costrm, NULL);
+
+
+#line 802 "dk4grpdf.ctr"
+ } pptr->costrm = NULL;
+ if (NULL != pptr->memstrm) {
+
+
+#line 805 "dk4grpdf.ctr"
+ dk4stream_close(pptr->memstrm, NULL);
+
+
+#line 807 "dk4grpdf.ctr"
+ } pptr->memstrm = NULL;
+ if (NULL != pptr->membuf) {
+
+
+#line 810 "dk4grpdf.ctr"
+ dk4membuf_close(pptr->membuf);
+
+
+#line 812 "dk4grpdf.ctr"
+ } pptr->membuf = NULL;
+ pptr->outstrm = NULL;
+ dk4mem_free(pptr);
+ }
+
+
+#line 817 "dk4grpdf.ctr"
+}
+
+
+
+/** Write path construction commands to output stream.
+ @param os Output stream.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_page_box_path(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+#endif
+ /* 0 0 newpathmoveto
+ */
+ dk4gra_pdf_i_outstream_kw(os, 16, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 17, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 4, backptr, erp);
+
+ /* w 0 lineto */
+ dk4gratool_stream_uint(os, gra->w, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 18, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 5, backptr, erp);
+
+ /* w h lineto
+ */
+ dk4gratool_stream_uint(os, gra->w, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_uint(os, gra->h, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 5, backptr, erp);
+
+ /* 0 h lineto
+ */
+ dk4gra_pdf_i_outstream_kw(os, 16, backptr, erp);
+ dk4gratool_stream_uint(os, gra->h, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 5, backptr, erp);
+
+ /* closepath
+ */
+ dk4gra_pdf_i_outstream_kw(os, 7, backptr, erp);
+}
+
+
+
+/** Create new page, allocate resources.
+ @param pageno Page number of new page.
+ @param flags Flags to open new page.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+static
+dk4_gra_pdf_page_t *
+dk4gra_pdf_page_new(
+ size_t pageno,
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *back = NULL;
+ int ok = 0;
+
+
+#line 889 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+#if DK4GRA_PDF_FORCE_UNCOMPRESSED
+ flags |= DK4_GRA_PAGE_FLAG_NOT_COMPRESSED;
+#endif
+
+
+#line 896 "dk4grpdf.ctr"
+ back = dk4mem_new(dk4_gra_pdf_page_t,1,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ back->membuf = NULL;
+ back->memstrm = NULL;
+ back->costrm = NULL;
+ back->outstrm = NULL;
+ back->s_uxo = NULL;
+ back->i_uxo = NULL;
+ back->pageno = pageno;
+ back->objno = 0;
+ back->flags = flags;
+
+#line 909 "dk4grpdf.ctr"
+ dk4gratool_initialize_attributes(&(back->attr));
+ back->membuf = dk4membuf_open(erp);
+ if (NULL == back->membuf) {
+ goto finished;
+ }
+ back->memstrm = dk4stream_open_membuf_writer(back->membuf, erp);
+ if (NULL == back->membuf) {
+ goto finished;
+ }
+ if (0 != (flags & DK4_GRA_PAGE_FLAG_NOT_COMPRESSED)) {
+
+#line 919 "dk4grpdf.ctr"
+ back->outstrm = back->memstrm;
+ ok = 1;
+ }
+ else {
+
+#line 923 "dk4grpdf.ctr"
+ back->costrm = dk4strmco_open(
+ back->memstrm,
+ DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_FLATE, DK4_STRMCO_OE_NONE,
+ 0, erp
+ );
+ if (NULL != back->costrm) {
+ back->outstrm = back->costrm;
+ ok = 1;
+ }
+ }
+ if (1 == ok) {
+ /* TODO: gsave */
+ dk4gra_pdf_i_outstream_kw(back->outstrm, 2, &ok, erp);
+ /* clip */
+ if (0 == (flags & DK4_GRA_PAGE_FLAG_NO_CLIP)) {
+ dk4gra_pdf_page_box_path(back->outstrm, gra, &ok, erp);
+ dk4gra_pdf_i_outstream_kw(back->outstrm, 13, &ok, erp);
+ }
+ /* fill */
+ if (0 == (flags & DK4_GRA_PAGE_FLAG_NO_BG)) {
+ dk4gra_pdf_i_outstream_kw(back->outstrm, 15, &ok, erp);
+ dk4gra_pdf_page_box_path(back->outstrm, gra, &ok, erp);
+ dk4gra_pdf_i_outstream_kw(back->outstrm, 9, &ok, erp);
+ }
+ }
+
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pgf_page_delete(back);
+ back = NULL;
+ }
+
+
+#line 955 "dk4grpdf.ctr"
+
+
+#line 956 "dk4grpdf.ctr"
+ return back;
+}
+
+
+
+/** Change current fill or stroke color if necessary.
+ @param os Output stream.
+ @param cpactive Active color.
+ @param cprequested Requested color.
+ @param fill Flag: Fill color (0=stroke color).
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_set_color_if_necessary(
+ dk4_stream_t *os,
+ dk4gra_col_t *cpactive,
+ dk4gra_col_t *cprequested,
+ int fill,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != cpactive);
+ assert(NULL != cprequested);
+#endif
+ if (dk4gratool_colors_differ(cpactive, cprequested)) {
+ switch (cprequested->what) {
+ case DK4_GRA_COL_SPEC_GRAY : {
+ dk4gratool_stream_double(
+ os, cprequested->data.gray, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(
+ os, ((0 != fill) ? (19) : (20)), backptr, erp
+ );
+ } break;
+ case DK4_GRA_COL_SPEC_CMYK : {
+ dk4gratool_stream_double(
+ os, cprequested->data.cmyk.c, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.cmyk.m, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.cmyk.y, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.cmyk.k, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(
+ os, ((0 != fill) ? (21) : (22)), backptr, erp
+ );
+ } break;
+ default : { /* RGB */
+ dk4gratool_stream_double(
+ os, cprequested->data.rgb.r, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.rgb.g, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.rgb.b, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(
+ os, ((0 != fill) ? (23) : (24)), backptr, erp
+ );
+ } break;
+ }
+ dk4mem_cpy(cpactive, cprequested, sizeof(dk4gra_col_t), erp);
+ }
+}
+
+
+
+/** Write dash setup to output stream.
+ @param os Output stream.
+ @param da Dash length array.
+ @param szda Size of dash length array (number of elements).
+ @param phase Phase for dash pattern.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_dash_out(
+ dk4_stream_t *os,
+ double *da,
+ size_t szda,
+ double phase,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != da);
+ assert(0 < szda);
+#endif
+ dk4gra_pdf_i_outstream_kw(os, 33, backptr, erp);
+ for (i = 0; i < szda; i++) {
+ if (0 < i) {
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ }
+ dk4gratool_stream_double(os, da[i], backptr, erp);
+ }
+ dk4gra_pdf_i_outstream_kw(os, 34, backptr, erp);
+ dk4gratool_stream_double(os, phase, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 35, backptr, erp);
+}
+
+
+
+/** Begin a new object, save start position.
+ @param os Output stream.
+ @param gra Output structure.
+ @param objno Number of new object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_begin_object(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ size_t objno,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_objpos_t *ppos = NULL;
+ dk4_um_t position;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+#endif
+ position = dk4stream_bytes_written(os);
+ dk4gratool_stream_uint(os, objno, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 37, backptr, erp);
+ ppos = dk4mem_new(dk4_gra_pdf_objpos_t,1,erp);
+ if (NULL != ppos) {
+ ppos->pos = position;
+ ppos->num = objno;
+ if (0 == dk4sto_add(gra->out.pdf.s_objpos, ppos, erp)) {
+ dk4mem_free(ppos);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** End current object.
+ @param os Output stream.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_end_object(
+ dk4_stream_t *os,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gra_pdf_i_outstream_kw(os, 38, backptr, erp);
+}
+
+
+
+/** Enumerate pages (assign object numbers to pages).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_enumerate_pages(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pdf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ /*
+ If gsave was issued at start of stream, issue grestore now
+ */
+ if (0 == ((bptr->flags) & DK4_GRA_PAGE_FLAG_NO_CLIP)) {
+ if (NULL != bptr->outstrm) {
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 3, &back, erp);
+ }
+ }
+ bptr->outstrm = NULL;
+ /*
+ Close compressed stream
+ */
+ if (NULL != bptr->costrm) {
+ if (0 == dk4stream_close(bptr->costrm, erp)) { back = 0; }
+ }
+ bptr->costrm = NULL;
+ /*
+ Close memory stream
+ */
+ if (NULL != bptr->memstrm) {
+ if (0 == dk4stream_close(bptr->memstrm, erp)) { back = 0; }
+ }
+ bptr->memstrm = NULL;
+ /*
+ Assign object number
+ */
+ if ((SIZE_MAX - 1) > gra->out.pdf.nextobj) {
+ bptr->objno = gra->out.pdf.nextobj;
+ gra->out.pdf.nextobj += 2;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+ }
+ } while ((1 == back) && (NULL != bptr));
+ if (SIZE_MAX <= gra->out.pdf.nextobj) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+ return back;
+}
+
+
+
+static
+void
+dk4gra_pdf_one_xobject(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ dk4_gra_pdf_img_xo_t *puxo,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t szmb;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+ assert(NULL != puxo);
+#endif
+ /* Image object
+ */
+ dk4gra_pdf_begin_object(os, gra, puxo->objno, backptr, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, backptr, erp);
+ /* /Type /XObject */
+ dk4gra_pdf_i_outstream_kw(os, 73, backptr, erp);
+ /* /Subtype /Image */
+ dk4gra_pdf_i_outstream_kw(os, 74, backptr, erp);
+ /* /Width ... */
+ dk4gra_pdf_i_outstream_kw(os, 75, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->width, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /Height ... */
+ dk4gra_pdf_i_outstream_kw(os, 76, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->height, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /BitsPerComponent ... */
+ dk4gra_pdf_i_outstream_kw(os, 77, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->bpc, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /ColorSpace ... */
+ switch (puxo->cs) {
+ case DK4_CS_CMYK : {
+ dk4gra_pdf_i_outstream_kw(os, 80, backptr, erp);
+ } break;
+ case DK4_CS_GRAY : case DK4_CS_GRAY_ALPHA : {
+ dk4gra_pdf_i_outstream_kw(os, 79, backptr, erp);
+ } break;
+ default : {
+ dk4gra_pdf_i_outstream_kw(os, 78, backptr, erp);
+ } break;
+ }
+ if ((0 != puxo->mobjno) && (NULL != puxo->m_mb)) {
+ /* /SMask ... */
+ dk4gra_pdf_i_outstream_kw(os, 81, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->mobjno, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 57, backptr, erp);
+ }
+ /* /Interpolate ... */
+ if (0 != puxo->ipol) {
+ dk4gra_pdf_i_outstream_kw(os, 82, backptr, erp);
+ }
+ /* /Filter ... */
+ dk4gra_pdf_i_outstream_kw(os,((0 != puxo->dct) ? (83) : (67)),backptr,erp);
+ /* /Length ... */
+ dk4gra_pdf_i_outstream_kw(os, 66, backptr, erp);
+
+
+#line 1271 "dk4grpdf.ctr"
+ if (0 == dk4membuf_size(&szmb, puxo->i_mb, erp)) {
+ szmb = 0;
+
+#line 1273 "dk4grpdf.ctr"
+ }
+ dk4gratool_stream_uint(os, szmb, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ if (0 != puxo->deci) {
+ switch (puxo->cs) {
+ case DK4_CS_CMYK : {
+ dk4gra_pdf_i_outstream_kw(os, 85, backptr, erp);
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ dk4gra_pdf_i_outstream_kw(os, 85, backptr, erp);
+ } break;
+ case DK4_CS_RGB : {
+ dk4gra_pdf_i_outstream_kw(os, 86, backptr, erp);
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ dk4gra_pdf_i_outstream_kw(os, 87, backptr, erp);
+ } break;
+ case DK4_CS_GRAY : {
+ dk4gra_pdf_i_outstream_kw(os, 88, backptr, erp);
+ } break;
+ }
+ }
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ /* stream */
+ dk4gra_pdf_i_outstream_kw(os, 68, backptr, erp);
+ /* Memory buffer contents */
+ if (0 == dk4membuf_to_stream(os, puxo->i_mb, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ /* endstream */
+ dk4gra_pdf_i_outstream_kw(os, 69, backptr, erp);
+ dk4gra_pdf_end_object(os, backptr, erp);
+ /*
+ Mask object, if available
+ */
+ if ((0 != puxo->mobjno) && (NULL != puxo->m_mb)) {
+ dk4gra_pdf_begin_object(os, gra, puxo->mobjno, backptr, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, backptr, erp);
+
+ /* /Type /XObject */
+ dk4gra_pdf_i_outstream_kw(os, 73, backptr, erp);
+ /* /Subtype /Image */
+ dk4gra_pdf_i_outstream_kw(os, 74, backptr, erp);
+ /* /Width ... */
+ dk4gra_pdf_i_outstream_kw(os, 75, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->width, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /Height ... */
+ dk4gra_pdf_i_outstream_kw(os, 76, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->height, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /BitsPerComponent ... */
+ dk4gra_pdf_i_outstream_kw(os, 77, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->bpc, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /ColorSpace /DeviceGray */
+ dk4gra_pdf_i_outstream_kw(os, 79, backptr, erp);
+ /* /Filter /FlateDecode */
+ dk4gra_pdf_i_outstream_kw(os, 67, backptr, erp);
+ /* /Length ... */
+
+
+#line 1336 "dk4grpdf.ctr"
+ if (0 == dk4membuf_size(&szmb, puxo->m_mb, erp)) {
+ szmb = 0;
+
+#line 1338 "dk4grpdf.ctr"
+ }
+ dk4gra_pdf_i_outstream_kw(os, 66, backptr, erp);
+ dk4gratool_stream_uint(os, szmb, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ /* stream */
+ dk4gra_pdf_i_outstream_kw(os, 68, backptr, erp);
+ /* Memory buffer contents */
+ if (0 == dk4membuf_to_stream(os, puxo->m_mb, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ /* endstream */
+ dk4gra_pdf_i_outstream_kw(os, 69, backptr, erp);
+ dk4gra_pdf_end_object(os, backptr, erp);
+ }
+}
+
+
+
+static
+void
+dk4gra_pdf_one_page(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ dk4_gra_pdf_page_t *bptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_img_xo_t *xo;
+ size_t mbs = 0;
+
+
+#line 1371 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+#endif
+ dk4gra_pdf_begin_object(os, gra, bptr->objno, backptr, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, backptr, erp);
+ /* /Type /Page */
+ dk4gra_pdf_i_outstream_kw(os, 58, backptr, erp);
+ /* /Parent 3 0 R */
+ dk4gra_pdf_i_outstream_kw(os, 59, backptr, erp);
+ /* /MediaBox [ 0 0 595 842 ] */
+ dk4gra_pdf_i_outstream_kw(os, 60, backptr, erp);
+ dk4gratool_stream_uint(os, gra->w, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_uint(os, gra->h, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 56, backptr, erp);
+ /* /CropBox [ 0 0 595 842 ] */
+ dk4gra_pdf_i_outstream_kw(os, 61, backptr, erp);
+ dk4gratool_stream_uint(os, gra->w, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_uint(os, gra->h, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 56, backptr, erp);
+ /* /Resources << */
+ dk4gra_pdf_i_outstream_kw(os, 62, backptr, erp);
+ /* /ProcSet [ /PDF /ImageB /ImageC ] */
+ dk4gra_pdf_i_outstream_kw(os, 63, backptr, erp);
+ if ((NULL != bptr->s_uxo) && (NULL != bptr->i_uxo)) {
+ dk4gra_pdf_i_outstream_kw(os, 64, backptr, erp);
+ dk4sto_it_reset(bptr->i_uxo);
+ do {
+ xo = (dk4_gra_pdf_img_xo_t *)dk4sto_it_next(bptr->i_uxo);
+ if (NULL != xo) {
+ dk4gra_pdf_i_outstream_kw(os, 71, backptr, erp);
+ dk4gratool_stream_uint(os, xo->objno, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_uint(os, xo->objno, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 57, backptr, erp);
+ }
+ } while (NULL != xo);
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ }
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ /* /Contents 12 0 R */
+ dk4gra_pdf_i_outstream_kw(os, 65, backptr, erp);
+ dk4gratool_stream_uint(os, (bptr->objno + 1), 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 57, backptr, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ dk4gra_pdf_end_object(os, backptr, erp);
+
+ dk4gra_pdf_begin_object(os, gra, (bptr->objno + 1), backptr, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, backptr, erp);
+ /* /Length ... */
+
+
+#line 1428 "dk4grpdf.ctr"
+ if (0 == dk4membuf_size(&mbs, bptr->membuf, erp)) {
+
+
+#line 1430 "dk4grpdf.ctr"
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ dk4gra_pdf_i_outstream_kw(os, 66, backptr, erp);
+ dk4gratool_stream_uint(os, mbs, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /Filter ... */
+
+
+#line 1437 "dk4grpdf.ctr"
+ if (0 == ((bptr->flags) & DK4_GRA_PAGE_FLAG_NOT_COMPRESSED)) {
+ dk4gra_pdf_i_outstream_kw(os, 67, backptr, erp);
+ }
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ /* stream */
+ dk4gra_pdf_i_outstream_kw(os, 68, backptr, erp);
+ /* data */
+ if (0 == dk4membuf_to_stream(os, bptr->membuf, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ /* endstream */
+ dk4gra_pdf_i_outstream_kw(os, 69, backptr, erp);
+ dk4gra_pdf_end_object(os, backptr, erp);
+
+
+#line 1452 "dk4grpdf.ctr"
+}
+
+
+
+static
+void
+dk4gra_pdf_xref_section(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_objpos_t *objpos;
+ dk4_um_t startxrefpos;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+#endif
+ startxrefpos = dk4stream_bytes_written(os);
+ dk4gra_pdf_i_outstream_kw(os, 45, backptr, erp);
+ dk4gratool_stream_uint(os, gra->out.pdf.nextobj, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 46, backptr, erp);
+ dk4sto_it_reset(gra->out.pdf.i_objpos);
+ do {
+ objpos = (dk4_gra_pdf_objpos_t *)dk4sto_it_next(gra->out.pdf.i_objpos);
+ if (NULL != objpos) {
+ dk4gratool_stream_uint(os, objpos->pos, 10, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 47, backptr, erp);
+ }
+ } while (NULL != objpos);
+ dk4gra_pdf_i_outstream_kw(os, 48, backptr, erp);
+ dk4gratool_stream_uint(os, gra->out.pdf.nextobj, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 49, backptr, erp);
+ dk4gratool_stream_uint(os, startxrefpos, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 50, backptr, erp);
+}
+
+
+/** Write PDF file.
+ @param fout Output file, opened for binary write operations.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_file(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ char timestamp[64];
+ dk4_gra_pdf_img_xo_t *puxo;
+ dk4_gra_pdf_page_t *bptr;
+ dk4_stream_t *os = NULL;
+ int back = 0;
+
+
+#line 1512 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ if (0 == dk4gra_pdf_timestamp(timestamp, sizeof(timestamp), erp)) {
+ goto finished;
+ }
+ os = dk4stream_open_for_file(fout, DK4_STREAM_WRITE, 4096, 4096, erp);
+ if (NULL == os) { goto finished; }
+ back = dk4gra_pdf_enumerate_pages(gra, erp);
+
+ /* PDF line at start of file
+ */
+ dk4gra_pdf_i_outstream_kw(os, 36, &back, erp);
+
+ /* Object 1 is Info object.
+ */
+ dk4gra_pdf_begin_object(os, gra, 1, &back, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, &back, erp);
+ /* /Producer (http://sourceforge.net/p/dktools/wiki/Home/) */
+ dk4gra_pdf_i_outstream_kw(os, 41, &back, erp);
+ /* /CreationDate (D:20170324235818) */
+ dk4gra_pdf_i_outstream_kw(os, 42, &back, erp);
+ if (0 == dk4stream_write_char_string(os, timestamp, erp)) { back = 0; }
+ dk4gra_pdf_i_outstream_kw(os, 44, &back, erp);
+ /* /ModDate (D:20170324235818) */
+ dk4gra_pdf_i_outstream_kw(os, 43, &back, erp);
+ if (0 == dk4stream_write_char_string(os, timestamp, erp)) { back = 0; }
+ dk4gra_pdf_i_outstream_kw(os, 44, &back, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, &back, erp);
+ dk4gra_pdf_end_object(os, &back, erp);
+
+ /* Object 2 is Root object.
+ */
+ dk4gra_pdf_begin_object(os, gra, 2, &back, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, &back, erp);
+ /* /Type /Catalog */
+ dk4gra_pdf_i_outstream_kw(os, 51, &back, erp);
+ /* /Pages 3 0 R */
+ dk4gra_pdf_i_outstream_kw(os, 52, &back, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, &back, erp);
+ dk4gra_pdf_end_object(os, &back, erp);
+
+ /* Object 3 is Pages object.
+ */
+ dk4gra_pdf_begin_object(os, gra, 3, &back, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, &back, erp);
+ /* /Type /Pages */
+ dk4gra_pdf_i_outstream_kw(os, 53, &back, erp);
+ /* /Count ... */
+ dk4gra_pdf_i_outstream_kw(os, 54, &back, erp);
+ dk4gratool_stream_uint(os, gra->pages, 0, &back, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, &back, erp);
+ /* /Kids [ */
+ dk4gra_pdf_i_outstream_kw(os, 55, &back, erp);
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pdf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ dk4gratool_stream_uint(os, bptr->objno, 0, &back, erp);
+ dk4gra_pdf_i_outstream_kw(os, 57, &back, erp);
+ }
+ } while (NULL != bptr);
+ /* ] */
+ dk4gra_pdf_i_outstream_kw(os, 56, &back, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, &back, erp);
+ dk4gra_pdf_end_object(os, &back, erp);
+
+ /* XOjects for images
+ */
+
+
+#line 1589 "dk4grpdf.ctr"
+ dk4sto_it_reset(gra->out.pdf.i_imagno);
+ do {
+ puxo = (dk4_gra_pdf_img_xo_t *)dk4sto_it_next(gra->out.pdf.i_imagno);
+ if (NULL != puxo) {
+
+
+#line 1594 "dk4grpdf.ctr"
+ dk4gra_pdf_one_xobject(os, gra, puxo, &back, erp);
+ }
+ } while (NULL != puxo);
+
+
+#line 1598 "dk4grpdf.ctr"
+
+ /* Pages and content streams
+ */
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pdf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ dk4gra_pdf_one_page(os, gra, bptr, &back, erp);
+ }
+ } while (NULL != bptr);
+
+ /* Finishing section (xref)
+ */
+ dk4gra_pdf_xref_section(os, gra, &back, erp);
+
+ finished:
+ if (NULL != os) { if (0 == dk4stream_close(os, erp)) { back = 0; } }
+
+
+#line 1616 "dk4grpdf.ctr"
+ return back;
+}
+
+
+
+void
+dk4gra_pdf_close(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ dk4_gra_pdf_img_xo_t *puxo;
+ void *vptr;
+
+
+#line 1630 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ goto finished;
+ }
+
+ /* Release object positions
+ */
+ if (NULL != gra->out.pdf.s_objpos) {
+ if (NULL != gra->out.pdf.i_objpos) {
+ dk4sto_it_reset(gra->out.pdf.i_objpos);
+ do {
+ vptr = dk4sto_it_next(gra->out.pdf.i_objpos);
+ if (NULL != vptr) {
+ dk4mem_free(vptr);
+ }
+ } while (NULL != vptr);
+ dk4sto_it_close(gra->out.pdf.i_objpos);
+ }
+ dk4sto_close(gra->out.pdf.s_objpos);
+ }
+ gra->out.pdf.s_objpos = NULL;
+ gra->out.pdf.i_objpos = NULL;
+
+ /* Release storage and iterator sorted by XObject object number
+ */
+ if (NULL != gra->out.pdf.s_imagno) {
+ if (NULL != gra->out.pdf.i_imagno) {
+ dk4sto_it_close(gra->out.pdf.i_imagno);
+ }
+ dk4sto_close(gra->out.pdf.s_imagno);
+ }
+ gra->out.pdf.s_imagno = NULL;
+ gra->out.pdf.i_imagno = NULL;
+
+ /* Release pages
+ */
+
+
+#line 1669 "dk4grpdf.ctr"
+ if (NULL != gra->s_pages) {
+ if (NULL != gra->i_pages) {
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pdf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ dk4gra_pgf_page_delete(bptr);
+ }
+ } while(NULL != bptr);
+ dk4sto_it_close(gra->i_pages);
+ }
+ dk4sto_close(gra->s_pages);
+ }
+ gra->s_pages = NULL;
+ gra->i_pages = NULL;
+ gra->curpg = NULL;
+
+
+#line 1686 "dk4grpdf.ctr"
+
+ /* Release records for embedded images
+ */
+
+
+#line 1690 "dk4grpdf.ctr"
+ if (NULL != gra->out.pdf.s_images) {
+ if (NULL != gra->out.pdf.i_images) {
+ dk4sto_it_reset(gra->out.pdf.i_images);
+ do {
+ puxo = (dk4_gra_pdf_img_xo_t *)dk4sto_it_next(
+ gra->out.pdf.i_images
+ );
+ if (NULL != puxo) {
+
+
+#line 1699 "dk4grpdf.ctr"
+ dk4gra_pdf_xo_delete(puxo);
+ }
+ } while(NULL != puxo);
+ dk4sto_it_close(gra->out.pdf.i_images);
+ }
+ dk4sto_close(gra->out.pdf.s_images);
+ }
+ gra->out.pdf.s_images = NULL;
+ gra->out.pdf.i_images = NULL;
+
+
+#line 1709 "dk4grpdf.ctr"
+
+ /* Release file name and output structure itself
+ */
+ dk4gratool_close(gra);
+
+ finished:
+
+
+#line 1716 "dk4grpdf.ctr"
+ return;
+}
+
+
+
+dk4_gra_t *
+dk4gra_pdf_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ int ok = 0;
+
+
+#line 1733 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ /*
+ Generic initialization
+ */
+ back = dk4gratool_open(fn, w, h, docfl, erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* PDF specific initialization
+ */
+ back->out.pdf.s_imagno = NULL;
+ back->out.pdf.i_imagno = NULL;
+ back->out.pdf.s_images = NULL;
+ back->out.pdf.i_images = NULL;
+ back->out.pdf.s_objpos = NULL;
+ back->out.pdf.i_objpos = NULL;
+ back->out.pdf.nextobj = 4;
+ back->out.pdf.unxo = 0;
+ /*
+ Pages container and iterator
+ */
+ back->s_pages = dk4sto_open(erp);
+ if (NULL == back->s_pages) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->s_pages, dk4gra_pdf_compare_pages_by_number, 0);
+ back->i_pages = dk4sto_it_open(back->s_pages, erp);
+ if (NULL == back->i_pages) {
+ goto finished;
+ }
+ /*
+ PDF XObject container and iterator for embedded images
+ */
+ back->out.pdf.s_images = dk4sto_open(erp);
+ if (NULL == back->out.pdf.s_images) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->out.pdf.s_images, dk4gra_pdf_compare_xo, 0);
+ back->out.pdf.i_images = dk4sto_it_open(back->out.pdf.s_images, erp);
+ if (NULL == back->out.pdf.i_images) {
+ goto finished;
+ }
+ /* PDF XObject container and iterator sorted by object number
+ */
+ back->out.pdf.s_imagno = dk4sto_open(erp);
+ if (NULL == back->out.pdf.s_imagno) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->out.pdf.s_imagno,dk4gra_pdf_compare_used_xo,0);
+ back->out.pdf.i_imagno = dk4sto_it_open(back->out.pdf.s_imagno, erp);
+ if (NULL == back->out.pdf.i_imagno) {
+ goto finished;
+ }
+ /* Storage and iterator for object start positions
+ */
+ back->out.pdf.s_objpos = dk4sto_open(erp);
+ if (NULL == back->out.pdf.s_objpos) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->out.pdf.s_objpos, dk4gra_pdf_compare_objpos, 0);
+ back->out.pdf.i_objpos = dk4sto_it_open(back->out.pdf.s_objpos, erp);
+ if (NULL == back->out.pdf.i_objpos) {
+ goto finished;
+ }
+ /* Finally indicate success
+ */
+ ok = 1;
+
+ /* Cleanup section, destroy object if errors occured
+ */
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pdf_close(back);
+ back = NULL;
+ }
+
+
+#line 1811 "dk4grpdf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ back = dk4gra_pdf_file(fout, gra, erp);
+ dk4gra_pdf_close(gra);
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *curpg = NULL;
+ int back = 0;
+
+
+#line 1845 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ /*
+ Check number of pages already defined
+ */
+ if (SIZE_MAX == gra->pages) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ goto finished;
+ }
+ curpg = dk4gra_pdf_page_new(gra->pages, gra, flags, erp);
+ if (NULL == curpg) {
+ goto finished;
+ }
+ if (0 == dk4sto_add(gra->s_pages, curpg, erp)) {
+ dk4gra_pgf_page_delete(curpg);
+ goto finished;
+ }
+ gra->curpg = curpg;
+ gra->pages += 1;
+ back = 1;
+
+ finished:
+
+
+#line 1869 "dk4grpdf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 2, &back, erp);
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4gra_pdf_i_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (0 == dk4gra_pdf_gsave(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+int
+dk4gra_pdf_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 3, &back, erp);
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4gra_pdf_i_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (0 == dk4gra_pdf_grestore(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+int
+dk4gra_pdf_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+)
+{
+
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lw_requested = lw;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.ls_requested = ls;
+ bptr->attr.sv_requested = sv;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lc_requested = lc;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+
+
+#line 2049 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+
+#line 2054 "dk4grpdf.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+
+#line 2058 "dk4grpdf.ctr"
+ bptr->attr.lj_requested = lj;
+ bptr->attr.ml_requested = ml;
+ if (1.0 > bptr->attr.ml_requested) {
+
+#line 2061 "dk4grpdf.ctr"
+ bptr->attr.ml_requested = 1.0;
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+ finished:
+
+
+#line 2068 "dk4grpdf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_fill_requested.data.gray = g;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_RGB;
+ bptr->attr.col_fill_requested.data.rgb.r = r;
+ bptr->attr.col_fill_requested.data.rgb.g = g;
+ bptr->attr.col_fill_requested.data.rgb.b = b;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_CMYK;
+ bptr->attr.col_fill_requested.data.cmyk.c = c;
+ bptr->attr.col_fill_requested.data.cmyk.m = m;
+ bptr->attr.col_fill_requested.data.cmyk.y = y;
+ bptr->attr.col_fill_requested.data.cmyk.k = k;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_stroke_requested.data.gray = g;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_RGB;
+ bptr->attr.col_stroke_requested.data.rgb.r = r;
+ bptr->attr.col_stroke_requested.data.rgb.g = g;
+ bptr->attr.col_stroke_requested.data.rgb.b = b;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_CMYK;
+ bptr->attr.col_stroke_requested.data.cmyk.c = c;
+ bptr->attr.col_stroke_requested.data.cmyk.m = m;
+ bptr->attr.col_stroke_requested.data.cmyk.y = y;
+ bptr->attr.col_stroke_requested.data.cmyk.k = k;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_set_color_if_necessary(
+ bptr->outstrm,
+ &(bptr->attr.col_fill_active), &(bptr->attr.col_fill_requested),
+ 1, &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+
+
+int
+dk4gra_pdf_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ double da[16];
+ dk4_gra_pdf_page_t *bptr;
+ double gw;
+ int back = 0;
+ int lwc = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+
+ /* Stroke color
+ */
+ dk4gra_pdf_set_color_if_necessary(
+ bptr->outstrm,
+ &(bptr->attr.col_stroke_active), &(bptr->attr.col_stroke_requested),
+ 0, &back, erp
+ );
+
+ /* Line width
+ */
+ if (
+ DK4_GRA_EPSILON_LINEWIDTH
+ < fabs(bptr->attr.lw_active - bptr->attr.lw_requested)
+ ) {
+ dk4gratool_stream_double(
+ bptr->outstrm, bptr->attr.lw_requested, &back, erp
+ );
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 25, &back, erp);
+ bptr->attr.lw_active = bptr->attr.lw_requested;
+ lwc = 1;
+ }
+ /* Line style
+ */
+ lwc = dk4gratool_line_style_differs(
+ bptr->attr.ls_active, bptr->attr.ls_requested,
+ bptr->attr.sv_active, bptr->attr.sv_requested,
+ lwc
+ );
+ if (0 != lwc) {
+ gw = (bptr->attr.sv_requested + bptr->attr.lw_requested) / 2.0;
+ if ((2.0 * bptr->attr.lw_requested) < gw) {
+ gw = 2.0 * bptr->attr.lw_requested;
+ }
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : case DK4_GRA_LC_PROJECTING : {
+ gw += bptr->attr.lw_requested;
+ } break;
+ }
+ switch (bptr->attr.ls_requested) {
+ case DK4_GRA_LS_DASH : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 2, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ case DK4_GRA_LS_DOT : {
+ da[0] = da[1] = bptr->attr.lw_requested;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 2, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ case DK4_GRA_LS_DASH_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 4, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_requested;
+ da[5] = gw;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 6, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_requested;
+ da[5] = gw;
+ da[6] = bptr->attr.lw_requested;
+ da[7] = gw;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 8, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ default : { /* solid */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 32, &back, erp);
+ } break;
+ }
+ bptr->attr.ls_active = bptr->attr.ls_requested;
+ bptr->attr.sv_active = bptr->attr.sv_requested;
+ }
+ /* Line cap
+ */
+ if (bptr->attr.lc_active != bptr->attr.lc_requested) {
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : { /* 1 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 27, &back, erp);
+ } break;
+ case DK4_GRA_LC_PROJECTING : { /* 2 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 28, &back, erp);
+ } break;
+ default : { /* 0 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 26, &back, erp);
+ } break;
+ }
+ bptr->attr.lc_active = bptr->attr.lc_requested;
+ }
+ /* Line join
+ */
+ if (bptr->attr.lj_active != bptr->attr.lj_requested) {
+ switch (bptr->attr.lj_requested) {
+ case DK4_GRA_LJ_ROUNDED : { /* 1 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 30, &back, erp);
+ } break;
+ case DK4_GRA_LJ_BEVELED : { /* 2 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 31, &back, erp);
+ } break;
+ default : { /* 0 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 29, &back, erp);
+ } break;
+ }
+ bptr->attr.lj_active = bptr->attr.lj_requested;
+ }
+ if (DK4_GRA_LJ_MITERED == bptr->attr.lj_active) {
+ if (
+ DK4_GRA_EPSILON_MITERLIMIT
+ < fabs(bptr->attr.ml_active - bptr->attr.ml_requested)
+ ) {
+ dk4gra_pdf_i_values_and_kw(
+ bptr->outstrm, &(bptr->attr.ml_requested), 1, 84, &back, erp
+ );
+ bptr->attr.ml_active = bptr->attr.ml_requested;
+ }
+ }
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ back = dk4gra_pdf_prepare_fill(gra, erp);
+ if (0 == dk4gra_pdf_prepare_stroke(gra, erp)) {
+ back = 0;
+ }
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(
+ bptr->outstrm, ((0 != gra->eor) ? (10) : (9)), &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 8, &back, erp);
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(
+ bptr->outstrm, ((0 != gra->eor) ? (12) : (11)), &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(
+ bptr->outstrm, ((0 != gra->eor) ? (14) : (13)), &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+static
+void
+dk4gra_pdf_i_newpath_moveto(
+ dk4_stream_t *os,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2585 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_double(os, x, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, y, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 4, backptr, erp);
+
+
+#line 2593 "dk4grpdf.ctr"
+}
+
+
+
+static
+void
+dk4gra_pdf_i_lineto(
+ dk4_stream_t *os,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_double(os, x, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, y, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 5, backptr, erp);
+}
+
+
+
+static
+void
+dk4gra_pdf_i_curveto(
+ dk4_stream_t *os,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_double(os, xc1, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, yc1, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, xc2, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, yc2, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, x, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, y, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 6, backptr, erp);
+}
+
+
+
+static
+void
+dk4gra_pdf_i_closepath(
+ dk4_stream_t *os,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gra_pdf_i_outstream_kw(os, 7, backptr, erp);
+}
+
+
+
+int
+dk4gra_pdf_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+
+
+#line 2678 "dk4grpdf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+
+
+#line 2683 "dk4grpdf.ctr"
+ if (NULL == bptr->outstrm) {
+
+
+#line 2685 "dk4grpdf.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+
+
+#line 2690 "dk4grpdf.ctr"
+ dk4gra_pdf_i_newpath_moveto(bptr->outstrm, x, y, &back, erp);
+
+ finished:
+
+
+#line 2694 "dk4grpdf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_lineto(bptr->outstrm, x, y, &back, erp);
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_curveto(
+ bptr->outstrm, xc1, yc1, xc2, yc2, x, y, &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_closepath(
+ bptr->outstrm, &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4gra_pdf_save_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->catt),
+ &(bptr->attr),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_pdf_restore_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->attr),
+ &(bptr->catt),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_pdf_reset_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ dk4gratool_reset_active_attributes(&(bptr->attr));
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grpdf.ctr b/support/dktools/dk4grpdf.ctr
new file mode 100644
index 0000000000..531cc33b3f
--- /dev/null
+++ b/support/dktools/dk4grpdf.ctr
@@ -0,0 +1,2840 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% module
+
+
+#ifdef DK4GRA_PDF_FORCE_UNCOMPRESSED
+#undef DK4GRA_PDF_FORCE_UNCOMPRESSED
+#endif
+
+/** Use for debugging purposes only to produce
+ an uncompresse page contents data stream.
+ Normally this should be defined to 0.
+*/
+#define DK4GRA_PDF_FORCE_UNCOMPRESSED 0
+
+
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#ifndef DK4UFIC_H_INCLUDED
+#include "dk4ufic.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#include "dk4strm.h"
+#endif
+
+#ifndef DK4STRMF_H_INCLUDED
+#include "dk4strmf.h"
+#endif
+
+#ifndef DK4STRMCO_H_INCLUDED
+#include "dk4strmco.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+/** PDF object position.
+*/
+typedef struct {
+ size_t num; /**< Object number. */
+ dk4_um_t pos; /**< Start position in output stream. */
+} dk4_gra_pdf_objpos_t;
+
+
+
+/** Constant text fragments used by module.
+*/
+static const char * const dk4_gra_pdf_c8_kw[] = {
+$!string-table
+#
+# 0 Newline
+#
+\n
+#
+# 1 Space
+#
+
+#
+# 2 gsave
+#
+q\n
+#
+# 3 grestore
+#
+Q\n
+#
+# 4 newpath + moveto
+#
+ m\n
+#
+# 5 lineto
+#
+ l\n
+#
+# 6 curveto
+#
+ c\n
+#
+# 7 closepath
+#
+h\n
+#
+# 8 stroke
+#
+S\n
+#
+# 9 fill (non-zero)
+#
+f\n
+#
+# 10 eofill
+#
+f*\n
+#
+# 11 fill (non-zero) and stroke
+#
+B\n
+#
+# 12 eofill and stroke
+#
+B*\n
+#
+# 13 clip (non-zero)
+#
+W n\n
+#
+# 14 eoclip
+#
+W* n\n
+#
+# 15 1 setgray
+#
+1 g\n
+#
+# 16 0 with space
+#
+0
+#
+# 17 0 without space
+#
+0
+#
+# 18 0 with leading space
+#
+ 0
+#
+# 19 20 setfillgray setstrokegray
+#
+ g\n
+ G\n
+#
+# 21 22 setfillcmyk setstrokecmyk
+#
+ k\n
+ K\n
+#
+# 23 24 setfillrgb setstrokergb
+#
+ rg\n
+ RG\n
+#
+# 25 setlinewidth
+#
+ w\n
+#
+# 26 27 28 setlinecap
+#
+0 J\n
+1 J\n
+2 J\n
+#
+# 29 30 31 setlinejoin
+#
+0 j\n
+1 j\n
+2 j\n
+#
+# 32 dash pattern for solid line
+#
+[] 0 d\n
+#
+# 33 opening square bracket
+#
+[
+#
+# 34 closing square bracket and space
+#
+]
+#
+# 35 setdash
+#
+ d\n
+#
+# 36 First line in PDF
+#
+%PDF-1.4\n
+#
+# 37 End of begin object line
+#
+ 0 obj\n
+#
+# 38
+#
+endobj\n
+#
+# 39 40 Open and close dictionary
+#
+<<\n
+>>\n
+#
+# 41...44 Info object contents
+#
+/Producer (libdk4gra, see http://sourceforge.net/p/dktools/wiki/Home/)\n
+/CreationDate (D:
+/ModDate (D:
+)\n
+#
+# 45 Start of xref section
+#
+xref 0
+#
+# 46 47 First object (0) is empty
+#
+0000000000 65535 f\n
+ 00000 n\n
+#
+# 48...50 trailer and final dictionary
+#
+trailer\n<< /Size
+ /Info 1 0 R /Root 2 0 R >>\nstartxref\n
+\n%%EOF\n
+#
+# 51 52 Root object contents
+#
+/Type /Catalog\n
+/Pages 3 0 R\n
+#
+# 53 54
+#
+/Type /Pages\n
+/Count
+#
+# 55...57 pages in pages tree
+#
+/Kids [\n
+]\n
+ 0 R\n
+#
+# 58...65 Page dictionary contents
+#
+/Type /Page\n
+/Parent 3 0 R\n
+/MediaBox [0 0
+/CropBox [0 0
+/Resources <<\n
+/ProcSet [/PDF /ImageB /ImageC]\n
+/XObject <<\n
+/Contents
+#
+# 66 67 content stream attributes
+#
+/Length
+/Filter /FlateDecode\n
+#
+# 68 69 begin and end of stream
+#
+stream\n
+\nendstream\n
+#
+# 70 Change matrix
+#
+ cm\n
+#
+# 71 Start of XObject name
+#
+/X
+#
+# 72 Show image
+#
+ Do\n
+#
+# 73 Image XObject type
+#
+/Type /XObject\n
+#
+# 74 Image XObject subtype
+#
+/Subtype /Image\n
+#
+# 75 76 Image width and height
+#
+/Width
+/Height
+#
+# 77 Bits per component
+#
+/BitsPerComponent
+#
+# 78...80 Color spaces
+#
+/ColorSpace /DeviceRGB\n
+/ColorSpace /DeviceGray\n
+/ColorSpace /DeviceCMYK\n
+#
+# 81
+#
+/SMask
+#
+# 82
+#
+/Interpolate true\n
+#
+# 83
+#
+/Filter /DCTDecode\n
+#
+# 84
+#
+ M\n
+#
+# 85-88
+#
+/Decode [1 0 1 0 1 0 1 0]\n
+/Decode [1 0 1 0 1 0] \n
+/Decode [1 0 1 0] \n
+/Decode [1 0]\n
+#
+#
+#
+$!end
+};
+
+
+
+void
+dk4gra_pdf_i_outstream_kw(
+ dk4_stream_t *os,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "= dk4gra_pdf_i_outstream_kw \"%!8s\"", dk4_gra_pdf_c8_kw[kwi]
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_string(os, dk4_gra_pdf_c8_kw[kwi], backptr, erp);
+}
+
+
+
+void
+dk4gra_pdf_i_values_and_kw(
+ dk4_stream_t *os,
+ double *da,
+ size_t szda,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != da);
+ assert(0 < szda);
+#endif
+ for (i = 0; i < szda; i++) {
+ if (0 < i) {
+ dk4gratool_stream_string(os, dk4_gra_pdf_c8_kw[1], backptr, erp);
+ }
+ if (0 == dk4ma_write_c8_double_no_sci_to_stream(
+ os, da[i], DK4_GRA_EPSILON_COORDINATES, 0, 1, erp
+ )
+ ) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ dk4gratool_stream_string(os, dk4_gra_pdf_c8_kw[kwi], backptr, erp);
+}
+
+
+
+/** Compare page structures by number or a page against a number.
+ @param l Left page object.
+ @param r Right page object or page number.
+ @param cr Comparison criteria (0=page/page, 1=page/number).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pdf_compare_pages_by_number(const void *l, const void *r, int cr)
+{
+ const dk4_gra_pdf_page_t *pl;
+ const dk4_gra_pdf_page_t *pr;
+ const size_t *ppno;
+
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pdf_page_t *)l;
+ switch (cr) {
+ case 1: {
+ ppno = (const size_t *)r;
+ if (pl->pageno > *ppno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < *ppno) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ pr = (const dk4_gra_pdf_page_t *)r;
+ if (pl->pageno > pr->pageno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < pr->pageno) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_compare_used_xo(
+ const void *l,
+ const void *r,
+ int cr
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+ __attribute__((unused))
+#endif
+)
+{
+ const dk4_gra_pdf_img_xo_t *pl;
+ const dk4_gra_pdf_img_xo_t *pr;
+ int back = 0;
+
+#if !DK4_HAVE_ATTRIBUTE_UNUSED
+ (void)cr;
+#endif
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pdf_img_xo_t *)l;
+ pr = (const dk4_gra_pdf_img_xo_t *)r;
+ if (pl->objno > pr->objno) {
+ back = 1;
+ }
+ else {
+ if (pl->objno < pr->objno) {
+ back = -1;
+ }
+ }
+ }
+ else { back = 1; }
+ }
+ else {
+ if (NULL != r) { back = -1; }
+ }
+ return back;
+}
+
+
+
+/** Compare two object positions by number.
+ @param l Left object.
+ @param r Right object.
+ @param cr Comparison criteria (0=objpos/objpos, 1=objpos/number).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pdf_compare_objpos(
+ const void *l,
+ const void *r,
+ int cr
+)
+{
+ const dk4_gra_pdf_objpos_t *pl;
+ const dk4_gra_pdf_objpos_t *pr;
+ const size_t *psz;
+ int back = 0;
+
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pdf_objpos_t *)l;
+ switch (cr) {
+ case 1 : {
+ psz = (const size_t *)r;
+ if (pl->num > *psz) {
+ back = 1;
+ }
+ else {
+ if (pl->num < *psz) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ pr = (const dk4_gra_pdf_objpos_t *)r;
+ if (pl->num > pr->num) {
+ back = 1;
+ }
+ else {
+ if (pl->num < pr->num) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Check whether two XObjects are generated from the same file.
+ @param pl Left object.
+ @param pr Right object.
+ @return Comparison result (0 for equality).
+*/
+static
+int
+dk4gra_pdf_xo_check_same_file(
+ const dk4_gra_pdf_img_xo_t *pl,
+ const dk4_gra_pdf_img_xo_t *pr
+)
+{
+ int back = 0;
+ $? "+ dk4gra_pdf_xo_check_same_file"
+ $? ". \"%!ds\" \"%!ds\"", TR_STR(pl->fn), TR_STR(pr->fn)
+ if (0 != pl->hufi) {
+ if (0 != pr->hufi) {
+ back = dk4ufi_compare(&(pl->ufi), &(pr->ufi));
+ $? ". ufi comparison returned %d", back
+ }
+ else { $? "! missing right ufi"
+ back = 1;
+ }
+ }
+ else {
+ if (0 != pr->hufi) { $? "! missing left ufi"
+ back = -1;
+ }
+ else {
+ if (NULL != pl->fn) {
+ if (NULL != pr->fn) {
+ back = dk4str_pathcmp(pl->fn, pr->fn);
+ $? ". file name comparison returned %d", back
+ }
+ else {
+ back = 1; $? "! missing right file name"
+ }
+ }
+ else {
+ if (NULL != pr->fn) {
+ back = -1; $? "! missing left file name"
+ }
+ else { $? "! use object numbers"
+ if (pl->objno > pr->objno) {
+ back = 1;
+ }
+ else {
+ if (pl->objno < pr->objno) {
+ back = -1;
+ }
+ }
+ }
+ }
+ }
+ }
+ $? "- dk4gra_pdf_xo_check_same_file %d", back
+ return back;
+}
+
+
+
+/** Compare two integer values.
+ @param l Left value.
+ @param r Right value.
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pdf_compare_int(int l, int r)
+{
+ int back = 0;
+ if (l > r) {
+ back = 1;
+ }
+ else {
+ if (l < r) { back = -1; }
+ }
+ return back;
+}
+
+
+
+/** Compare two XObjects whether or not they contain the same file
+ and frame number using same conversion settings.
+ @param l Left object.
+ @param r Right object.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pdf_compare_xo(
+ const void *l,
+ const void *r,
+ int cr
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+ __attribute__((unused))
+#endif
+)
+{
+ const dk4_gra_pdf_img_xo_t *pl;
+ const dk4_gra_pdf_img_xo_t *pr;
+ int back = 0;
+
+#if !DK4_HAVE_ATTRIBUTE_UNUSED
+ (void)cr;
+#endif
+ $? "+ dk4gra_pdf_compare_xo"
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pdf_img_xo_t *)l;
+ pr = (const dk4_gra_pdf_img_xo_t *)r;
+ /*
+ Check whether or not both XObjects use the same file
+ */
+ back = dk4gra_pdf_xo_check_same_file(pl, pr);
+ /*
+ If the same file is used for both XObjects, check
+ whether the same settings are used
+ */
+ if (0 == back) {
+ if (pl->fno > pr->fno) { $? ". pl fno > pr fno"
+ back = 1;
+ }
+ else {
+ if (pl->fno < pr->fno) { $? ". pl fno < pr fno"
+ back = -1;
+ }
+ }
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->dct, pr->dct);
+ $? ". dct comparison returned %d", back
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->ipol, pr->ipol);
+ $? ". interpolation comparison returned %d", back
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->cs, pr->cs);
+ $? ". color space comparison returned %d", back
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->bpc, pr->bpc);
+ $? ". bpc comparison returned %d", back
+ }
+ if (0 == back) {
+ back = dk4gra_pdf_compare_int(pl->deci, pr->deci);
+ $? ". deci comparison returned %d", back
+ }
+ }
+ else { $? ". no right side object"
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) { $? ". no left side object"
+ back = -1;
+ }
+ }
+ $? "- dk4gra_pdf_compare_xo %d", back
+ return back;
+}
+
+
+
+/** Destroy XObject structure, release resources.
+ @param puxo XObject structure to destroy.
+*/
+void
+dk4gra_pdf_xo_delete(
+ dk4_gra_pdf_img_xo_t *puxo
+)
+{
+ $? "+ dk4gra_pdf_xo_delete"
+#if DK4_USE_ASSERT
+ assert(NULL != puxo);
+#endif
+ if (NULL != puxo) { $? ". pointer ok %p", puxo
+ $? ". close i_mb"
+ if (NULL != puxo->i_mb) {
+ $? ". close i_mb (2)"
+ dk4membuf_close(puxo->i_mb);
+ $? ". i_mb closed"
+ } puxo->i_mb = NULL;
+ $? ". close m_mb"
+ if (NULL != puxo->m_mb) {
+ $? ". close m_mb (2)"
+ dk4membuf_close(puxo->m_mb);
+ $? ". m_mb closed"
+ } puxo->m_mb = NULL;
+ $? ". free fn"
+ if (NULL != puxo->fn) {
+ $? ". free fn (2)"
+ dk4mem_free((void *)(puxo->fn));
+ $? ". fn freed"
+ } puxo->fn = NULL;
+ $? ". release xo"
+ dk4mem_free(puxo);
+ $? ". xo released"
+ }
+ $? "- dk4gra_pdf_xo_delete"
+}
+
+
+
+/** Destroy page structure, release resources.
+ @param pptr Page to destroy.
+*/
+static
+void
+dk4gra_pgf_page_delete(
+ dk4_gra_pdf_page_t *pptr
+)
+{
+ $? "+ dk4gra_pgf_page_delete"
+#if DK4_USE_ASSERT
+ assert(NULL != pptr);
+#endif
+ if (NULL != pptr) { $? ". page %p", pptr
+ if (NULL != pptr->s_uxo) {
+ if (NULL != pptr->i_uxo) {
+ dk4sto_it_close(pptr->i_uxo);
+ }
+ dk4sto_close(pptr->s_uxo);
+ } pptr->s_uxo = NULL; pptr->i_uxo = NULL;
+ if (NULL != pptr->costrm) {
+ $? ". close costrm"
+ dk4stream_close(pptr->costrm, NULL);
+ $? ". costrm closed"
+ } pptr->costrm = NULL;
+ if (NULL != pptr->memstrm) {
+ $? ". close memstrm"
+ dk4stream_close(pptr->memstrm, NULL);
+ $? ". memstrm closed"
+ } pptr->memstrm = NULL;
+ if (NULL != pptr->membuf) {
+ $? ". close membuf"
+ dk4membuf_close(pptr->membuf);
+ $? ". membuf closed"
+ } pptr->membuf = NULL;
+ pptr->outstrm = NULL;
+ dk4mem_free(pptr);
+ }
+ $? "- dk4gra_pgf_page_delete"
+}
+
+
+
+/** Write path construction commands to output stream.
+ @param os Output stream.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_page_box_path(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+#endif
+ /* 0 0 newpathmoveto
+ */
+ dk4gra_pdf_i_outstream_kw(os, 16, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 17, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 4, backptr, erp);
+
+ /* w 0 lineto */
+ dk4gratool_stream_uint(os, gra->w, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 18, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 5, backptr, erp);
+
+ /* w h lineto
+ */
+ dk4gratool_stream_uint(os, gra->w, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_uint(os, gra->h, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 5, backptr, erp);
+
+ /* 0 h lineto
+ */
+ dk4gra_pdf_i_outstream_kw(os, 16, backptr, erp);
+ dk4gratool_stream_uint(os, gra->h, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 5, backptr, erp);
+
+ /* closepath
+ */
+ dk4gra_pdf_i_outstream_kw(os, 7, backptr, erp);
+}
+
+
+
+/** Create new page, allocate resources.
+ @param pageno Page number of new page.
+ @param flags Flags to open new page.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+static
+dk4_gra_pdf_page_t *
+dk4gra_pdf_page_new(
+ size_t pageno,
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4gra_pdf_page_new %lu flags=%d", (unsigned long)pageno, flags
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+#if DK4GRA_PDF_FORCE_UNCOMPRESSED
+ flags |= DK4_GRA_PAGE_FLAG_NOT_COMPRESSED;
+#endif
+ $? ". flags=%d", flags
+ back = dk4mem_new(dk4_gra_pdf_page_t,1,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ back->membuf = NULL;
+ back->memstrm = NULL;
+ back->costrm = NULL;
+ back->outstrm = NULL;
+ back->s_uxo = NULL;
+ back->i_uxo = NULL;
+ back->pageno = pageno;
+ back->objno = 0;
+ back->flags = flags; $? ". pageflags=%d flags=%d", back->flags, flags
+ dk4gratool_initialize_attributes(&(back->attr));
+ back->membuf = dk4membuf_open(erp);
+ if (NULL == back->membuf) {
+ goto finished;
+ }
+ back->memstrm = dk4stream_open_membuf_writer(back->membuf, erp);
+ if (NULL == back->membuf) {
+ goto finished;
+ }
+ if (0 != (flags & DK4_GRA_PAGE_FLAG_NOT_COMPRESSED)) { $? ". not compr"
+ back->outstrm = back->memstrm;
+ ok = 1;
+ }
+ else { $? ". compressed"
+ back->costrm = dk4strmco_open(
+ back->memstrm,
+ DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_FLATE, DK4_STRMCO_OE_NONE,
+ 0, erp
+ );
+ if (NULL != back->costrm) {
+ back->outstrm = back->costrm;
+ ok = 1;
+ }
+ }
+ if (1 == ok) {
+ /* TODO: gsave */
+ dk4gra_pdf_i_outstream_kw(back->outstrm, 2, &ok, erp);
+ /* clip */
+ if (0 == (flags & DK4_GRA_PAGE_FLAG_NO_CLIP)) {
+ dk4gra_pdf_page_box_path(back->outstrm, gra, &ok, erp);
+ dk4gra_pdf_i_outstream_kw(back->outstrm, 13, &ok, erp);
+ }
+ /* fill */
+ if (0 == (flags & DK4_GRA_PAGE_FLAG_NO_BG)) {
+ dk4gra_pdf_i_outstream_kw(back->outstrm, 15, &ok, erp);
+ dk4gra_pdf_page_box_path(back->outstrm, gra, &ok, erp);
+ dk4gra_pdf_i_outstream_kw(back->outstrm, 9, &ok, erp);
+ }
+ }
+
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pgf_page_delete(back);
+ back = NULL;
+ }
+ $? ". flags=%d pageflags=%d", flags, back->flags
+ $? "- dk4gra_pdf_page_new %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Change current fill or stroke color if necessary.
+ @param os Output stream.
+ @param cpactive Active color.
+ @param cprequested Requested color.
+ @param fill Flag: Fill color (0=stroke color).
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_set_color_if_necessary(
+ dk4_stream_t *os,
+ dk4gra_col_t *cpactive,
+ dk4gra_col_t *cprequested,
+ int fill,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != cpactive);
+ assert(NULL != cprequested);
+#endif
+ if (dk4gratool_colors_differ(cpactive, cprequested)) {
+ switch (cprequested->what) {
+ case DK4_GRA_COL_SPEC_GRAY : {
+ dk4gratool_stream_double(
+ os, cprequested->data.gray, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(
+ os, ((0 != fill) ? (19) : (20)), backptr, erp
+ );
+ } break;
+ case DK4_GRA_COL_SPEC_CMYK : {
+ dk4gratool_stream_double(
+ os, cprequested->data.cmyk.c, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.cmyk.m, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.cmyk.y, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.cmyk.k, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(
+ os, ((0 != fill) ? (21) : (22)), backptr, erp
+ );
+ } break;
+ default : { /* RGB */
+ dk4gratool_stream_double(
+ os, cprequested->data.rgb.r, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.rgb.g, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(
+ os, cprequested->data.rgb.b, backptr, erp
+ );
+ dk4gra_pdf_i_outstream_kw(
+ os, ((0 != fill) ? (23) : (24)), backptr, erp
+ );
+ } break;
+ }
+ dk4mem_cpy(cpactive, cprequested, sizeof(dk4gra_col_t), erp);
+ }
+}
+
+
+
+/** Write dash setup to output stream.
+ @param os Output stream.
+ @param da Dash length array.
+ @param szda Size of dash length array (number of elements).
+ @param phase Phase for dash pattern.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_dash_out(
+ dk4_stream_t *os,
+ double *da,
+ size_t szda,
+ double phase,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != da);
+ assert(0 < szda);
+#endif
+ dk4gra_pdf_i_outstream_kw(os, 33, backptr, erp);
+ for (i = 0; i < szda; i++) {
+ if (0 < i) {
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ }
+ dk4gratool_stream_double(os, da[i], backptr, erp);
+ }
+ dk4gra_pdf_i_outstream_kw(os, 34, backptr, erp);
+ dk4gratool_stream_double(os, phase, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 35, backptr, erp);
+}
+
+
+
+/** Begin a new object, save start position.
+ @param os Output stream.
+ @param gra Output structure.
+ @param objno Number of new object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_begin_object(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ size_t objno,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_objpos_t *ppos = NULL;
+ dk4_um_t position;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+#endif
+ position = dk4stream_bytes_written(os);
+ dk4gratool_stream_uint(os, objno, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 37, backptr, erp);
+ ppos = dk4mem_new(dk4_gra_pdf_objpos_t,1,erp);
+ if (NULL != ppos) {
+ ppos->pos = position;
+ ppos->num = objno;
+ if (0 == dk4sto_add(gra->out.pdf.s_objpos, ppos, erp)) {
+ dk4mem_free(ppos);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** End current object.
+ @param os Output stream.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_end_object(
+ dk4_stream_t *os,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gra_pdf_i_outstream_kw(os, 38, backptr, erp);
+}
+
+
+
+/** Enumerate pages (assign object numbers to pages).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_enumerate_pages(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pdf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ /*
+ If gsave was issued at start of stream, issue grestore now
+ */
+ if (0 == ((bptr->flags) & DK4_GRA_PAGE_FLAG_NO_CLIP)) {
+ if (NULL != bptr->outstrm) {
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 3, &back, erp);
+ }
+ }
+ bptr->outstrm = NULL;
+ /*
+ Close compressed stream
+ */
+ if (NULL != bptr->costrm) {
+ if (0 == dk4stream_close(bptr->costrm, erp)) { back = 0; }
+ }
+ bptr->costrm = NULL;
+ /*
+ Close memory stream
+ */
+ if (NULL != bptr->memstrm) {
+ if (0 == dk4stream_close(bptr->memstrm, erp)) { back = 0; }
+ }
+ bptr->memstrm = NULL;
+ /*
+ Assign object number
+ */
+ if ((SIZE_MAX - 1) > gra->out.pdf.nextobj) {
+ bptr->objno = gra->out.pdf.nextobj;
+ gra->out.pdf.nextobj += 2;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+ }
+ } while ((1 == back) && (NULL != bptr));
+ if (SIZE_MAX <= gra->out.pdf.nextobj) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = 0;
+ }
+ return back;
+}
+
+
+
+static
+void
+dk4gra_pdf_one_xobject(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ dk4_gra_pdf_img_xo_t *puxo,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t szmb;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+ assert(NULL != puxo);
+#endif
+ /* Image object
+ */
+ dk4gra_pdf_begin_object(os, gra, puxo->objno, backptr, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, backptr, erp);
+ /* /Type /XObject */
+ dk4gra_pdf_i_outstream_kw(os, 73, backptr, erp);
+ /* /Subtype /Image */
+ dk4gra_pdf_i_outstream_kw(os, 74, backptr, erp);
+ /* /Width ... */
+ dk4gra_pdf_i_outstream_kw(os, 75, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->width, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /Height ... */
+ dk4gra_pdf_i_outstream_kw(os, 76, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->height, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /BitsPerComponent ... */
+ dk4gra_pdf_i_outstream_kw(os, 77, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->bpc, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /ColorSpace ... */
+ switch (puxo->cs) {
+ case DK4_CS_CMYK : {
+ dk4gra_pdf_i_outstream_kw(os, 80, backptr, erp);
+ } break;
+ case DK4_CS_GRAY : case DK4_CS_GRAY_ALPHA : {
+ dk4gra_pdf_i_outstream_kw(os, 79, backptr, erp);
+ } break;
+ default : {
+ dk4gra_pdf_i_outstream_kw(os, 78, backptr, erp);
+ } break;
+ }
+ if ((0 != puxo->mobjno) && (NULL != puxo->m_mb)) {
+ /* /SMask ... */
+ dk4gra_pdf_i_outstream_kw(os, 81, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->mobjno, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 57, backptr, erp);
+ }
+ /* /Interpolate ... */
+ if (0 != puxo->ipol) {
+ dk4gra_pdf_i_outstream_kw(os, 82, backptr, erp);
+ }
+ /* /Filter ... */
+ dk4gra_pdf_i_outstream_kw(os,((0 != puxo->dct) ? (83) : (67)),backptr,erp);
+ /* /Length ... */
+ dk4gra_pdf_i_outstream_kw(os, 66, backptr, erp);
+ $? ". retrieving image data memory buffer size"
+ if (0 == dk4membuf_size(&szmb, puxo->i_mb, erp)) {
+ szmb = 0; $? "! failed to obtain memory buffer size"
+ }
+ dk4gratool_stream_uint(os, szmb, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ if (0 != puxo->deci) {
+ switch (puxo->cs) {
+ case DK4_CS_CMYK : {
+ dk4gra_pdf_i_outstream_kw(os, 85, backptr, erp);
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ dk4gra_pdf_i_outstream_kw(os, 85, backptr, erp);
+ } break;
+ case DK4_CS_RGB : {
+ dk4gra_pdf_i_outstream_kw(os, 86, backptr, erp);
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ dk4gra_pdf_i_outstream_kw(os, 87, backptr, erp);
+ } break;
+ case DK4_CS_GRAY : {
+ dk4gra_pdf_i_outstream_kw(os, 88, backptr, erp);
+ } break;
+ }
+ }
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ /* stream */
+ dk4gra_pdf_i_outstream_kw(os, 68, backptr, erp);
+ /* Memory buffer contents */
+ if (0 == dk4membuf_to_stream(os, puxo->i_mb, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ /* endstream */
+ dk4gra_pdf_i_outstream_kw(os, 69, backptr, erp);
+ dk4gra_pdf_end_object(os, backptr, erp);
+ /*
+ Mask object, if available
+ */
+ if ((0 != puxo->mobjno) && (NULL != puxo->m_mb)) {
+ dk4gra_pdf_begin_object(os, gra, puxo->mobjno, backptr, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, backptr, erp);
+
+ /* /Type /XObject */
+ dk4gra_pdf_i_outstream_kw(os, 73, backptr, erp);
+ /* /Subtype /Image */
+ dk4gra_pdf_i_outstream_kw(os, 74, backptr, erp);
+ /* /Width ... */
+ dk4gra_pdf_i_outstream_kw(os, 75, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->width, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /Height ... */
+ dk4gra_pdf_i_outstream_kw(os, 76, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->height, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /BitsPerComponent ... */
+ dk4gra_pdf_i_outstream_kw(os, 77, backptr, erp);
+ dk4gratool_stream_uint(os, puxo->bpc, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /ColorSpace /DeviceGray */
+ dk4gra_pdf_i_outstream_kw(os, 79, backptr, erp);
+ /* /Filter /FlateDecode */
+ dk4gra_pdf_i_outstream_kw(os, 67, backptr, erp);
+ /* /Length ... */
+ $? ". retrieving mask data memory buffer size"
+ if (0 == dk4membuf_size(&szmb, puxo->m_mb, erp)) {
+ szmb = 0; $? "! failed to obtain memory buffer size"
+ }
+ dk4gra_pdf_i_outstream_kw(os, 66, backptr, erp);
+ dk4gratool_stream_uint(os, szmb, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ /* stream */
+ dk4gra_pdf_i_outstream_kw(os, 68, backptr, erp);
+ /* Memory buffer contents */
+ if (0 == dk4membuf_to_stream(os, puxo->m_mb, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ /* endstream */
+ dk4gra_pdf_i_outstream_kw(os, 69, backptr, erp);
+ dk4gra_pdf_end_object(os, backptr, erp);
+ }
+}
+
+
+
+static
+void
+dk4gra_pdf_one_page(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ dk4_gra_pdf_page_t *bptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_img_xo_t *xo;
+ size_t mbs = 0;
+ $? "+ dk4gra_pdf_one_page"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+#endif
+ dk4gra_pdf_begin_object(os, gra, bptr->objno, backptr, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, backptr, erp);
+ /* /Type /Page */
+ dk4gra_pdf_i_outstream_kw(os, 58, backptr, erp);
+ /* /Parent 3 0 R */
+ dk4gra_pdf_i_outstream_kw(os, 59, backptr, erp);
+ /* /MediaBox [ 0 0 595 842 ] */
+ dk4gra_pdf_i_outstream_kw(os, 60, backptr, erp);
+ dk4gratool_stream_uint(os, gra->w, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_uint(os, gra->h, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 56, backptr, erp);
+ /* /CropBox [ 0 0 595 842 ] */
+ dk4gra_pdf_i_outstream_kw(os, 61, backptr, erp);
+ dk4gratool_stream_uint(os, gra->w, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_uint(os, gra->h, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 56, backptr, erp);
+ /* /Resources << */
+ dk4gra_pdf_i_outstream_kw(os, 62, backptr, erp);
+ /* /ProcSet [ /PDF /ImageB /ImageC ] */
+ dk4gra_pdf_i_outstream_kw(os, 63, backptr, erp);
+ if ((NULL != bptr->s_uxo) && (NULL != bptr->i_uxo)) {
+ dk4gra_pdf_i_outstream_kw(os, 64, backptr, erp);
+ dk4sto_it_reset(bptr->i_uxo);
+ do {
+ xo = (dk4_gra_pdf_img_xo_t *)dk4sto_it_next(bptr->i_uxo);
+ if (NULL != xo) {
+ dk4gra_pdf_i_outstream_kw(os, 71, backptr, erp);
+ dk4gratool_stream_uint(os, xo->objno, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_uint(os, xo->objno, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 57, backptr, erp);
+ }
+ } while (NULL != xo);
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ }
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ /* /Contents 12 0 R */
+ dk4gra_pdf_i_outstream_kw(os, 65, backptr, erp);
+ dk4gratool_stream_uint(os, (bptr->objno + 1), 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 57, backptr, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ dk4gra_pdf_end_object(os, backptr, erp);
+
+ dk4gra_pdf_begin_object(os, gra, (bptr->objno + 1), backptr, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, backptr, erp);
+ /* /Length ... */
+ $? ". retrieving page contents stream memory buffer size"
+ if (0 == dk4membuf_size(&mbs, bptr->membuf, erp)) {
+ $? "! failed to obtain memory buffer size"
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ dk4gra_pdf_i_outstream_kw(os, 66, backptr, erp);
+ dk4gratool_stream_uint(os, mbs, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ /* /Filter ... */
+ $? ". flags = %d", bptr->flags
+ if (0 == ((bptr->flags) & DK4_GRA_PAGE_FLAG_NOT_COMPRESSED)) {
+ dk4gra_pdf_i_outstream_kw(os, 67, backptr, erp);
+ }
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, backptr, erp);
+ /* stream */
+ dk4gra_pdf_i_outstream_kw(os, 68, backptr, erp);
+ /* data */
+ if (0 == dk4membuf_to_stream(os, bptr->membuf, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ /* endstream */
+ dk4gra_pdf_i_outstream_kw(os, 69, backptr, erp);
+ dk4gra_pdf_end_object(os, backptr, erp);
+ $? "- dk4gra_pdf_one_page"
+}
+
+
+
+static
+void
+dk4gra_pdf_xref_section(
+ dk4_stream_t *os,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_objpos_t *objpos;
+ dk4_um_t startxrefpos;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != os);
+#endif
+ startxrefpos = dk4stream_bytes_written(os);
+ dk4gra_pdf_i_outstream_kw(os, 45, backptr, erp);
+ dk4gratool_stream_uint(os, gra->out.pdf.nextobj, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 46, backptr, erp);
+ dk4sto_it_reset(gra->out.pdf.i_objpos);
+ do {
+ objpos = (dk4_gra_pdf_objpos_t *)dk4sto_it_next(gra->out.pdf.i_objpos);
+ if (NULL != objpos) {
+ dk4gratool_stream_uint(os, objpos->pos, 10, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 47, backptr, erp);
+ }
+ } while (NULL != objpos);
+ dk4gra_pdf_i_outstream_kw(os, 48, backptr, erp);
+ dk4gratool_stream_uint(os, gra->out.pdf.nextobj, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 49, backptr, erp);
+ dk4gratool_stream_uint(os, startxrefpos, 0, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 50, backptr, erp);
+}
+
+
+/** Write PDF file.
+ @param fout Output file, opened for binary write operations.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_file(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ char timestamp[64];
+ dk4_gra_pdf_img_xo_t *puxo;
+ dk4_gra_pdf_page_t *bptr;
+ dk4_stream_t *os = NULL;
+ int back = 0;
+ $? "+ dk4gra_pdf_file"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ if (0 == dk4gra_pdf_timestamp(timestamp, sizeof(timestamp), erp)) {
+ goto finished;
+ }
+ os = dk4stream_open_for_file(fout, DK4_STREAM_WRITE, 4096, 4096, erp);
+ if (NULL == os) { goto finished; }
+ back = dk4gra_pdf_enumerate_pages(gra, erp);
+
+ /* PDF line at start of file
+ */
+ dk4gra_pdf_i_outstream_kw(os, 36, &back, erp);
+
+ /* Object 1 is Info object.
+ */
+ dk4gra_pdf_begin_object(os, gra, 1, &back, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, &back, erp);
+ /* /Producer (http://sourceforge.net/p/dktools/wiki/Home/) */
+ dk4gra_pdf_i_outstream_kw(os, 41, &back, erp);
+ /* /CreationDate (D:20170324235818) */
+ dk4gra_pdf_i_outstream_kw(os, 42, &back, erp);
+ if (0 == dk4stream_write_char_string(os, timestamp, erp)) { back = 0; }
+ dk4gra_pdf_i_outstream_kw(os, 44, &back, erp);
+ /* /ModDate (D:20170324235818) */
+ dk4gra_pdf_i_outstream_kw(os, 43, &back, erp);
+ if (0 == dk4stream_write_char_string(os, timestamp, erp)) { back = 0; }
+ dk4gra_pdf_i_outstream_kw(os, 44, &back, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, &back, erp);
+ dk4gra_pdf_end_object(os, &back, erp);
+
+ /* Object 2 is Root object.
+ */
+ dk4gra_pdf_begin_object(os, gra, 2, &back, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, &back, erp);
+ /* /Type /Catalog */
+ dk4gra_pdf_i_outstream_kw(os, 51, &back, erp);
+ /* /Pages 3 0 R */
+ dk4gra_pdf_i_outstream_kw(os, 52, &back, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, &back, erp);
+ dk4gra_pdf_end_object(os, &back, erp);
+
+ /* Object 3 is Pages object.
+ */
+ dk4gra_pdf_begin_object(os, gra, 3, &back, erp);
+ /* << */
+ dk4gra_pdf_i_outstream_kw(os, 39, &back, erp);
+ /* /Type /Pages */
+ dk4gra_pdf_i_outstream_kw(os, 53, &back, erp);
+ /* /Count ... */
+ dk4gra_pdf_i_outstream_kw(os, 54, &back, erp);
+ dk4gratool_stream_uint(os, gra->pages, 0, &back, erp);
+ dk4gra_pdf_i_outstream_kw(os, 0, &back, erp);
+ /* /Kids [ */
+ dk4gra_pdf_i_outstream_kw(os, 55, &back, erp);
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pdf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ dk4gratool_stream_uint(os, bptr->objno, 0, &back, erp);
+ dk4gra_pdf_i_outstream_kw(os, 57, &back, erp);
+ }
+ } while (NULL != bptr);
+ /* ] */
+ dk4gra_pdf_i_outstream_kw(os, 56, &back, erp);
+ /* >> */
+ dk4gra_pdf_i_outstream_kw(os, 40, &back, erp);
+ dk4gra_pdf_end_object(os, &back, erp);
+
+ /* XOjects for images
+ */
+ $? ". begin xo output"
+ dk4sto_it_reset(gra->out.pdf.i_imagno);
+ do {
+ puxo = (dk4_gra_pdf_img_xo_t *)dk4sto_it_next(gra->out.pdf.i_imagno);
+ if (NULL != puxo) {
+ $? ". output xo"
+ dk4gra_pdf_one_xobject(os, gra, puxo, &back, erp);
+ }
+ } while (NULL != puxo);
+ $? ". end xo output"
+
+ /* Pages and content streams
+ */
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pdf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ dk4gra_pdf_one_page(os, gra, bptr, &back, erp);
+ }
+ } while (NULL != bptr);
+
+ /* Finishing section (xref)
+ */
+ dk4gra_pdf_xref_section(os, gra, &back, erp);
+
+ finished:
+ if (NULL != os) { if (0 == dk4stream_close(os, erp)) { back = 0; } }
+ $? "- dk4gra_pdf_file %d", back
+ return back;
+}
+
+
+
+void
+dk4gra_pdf_close(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ dk4_gra_pdf_img_xo_t *puxo;
+ void *vptr;
+ $? "+ dk4gra_pdf_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ goto finished;
+ }
+
+ /* Release object positions
+ */
+ if (NULL != gra->out.pdf.s_objpos) {
+ if (NULL != gra->out.pdf.i_objpos) {
+ dk4sto_it_reset(gra->out.pdf.i_objpos);
+ do {
+ vptr = dk4sto_it_next(gra->out.pdf.i_objpos);
+ if (NULL != vptr) {
+ dk4mem_free(vptr);
+ }
+ } while (NULL != vptr);
+ dk4sto_it_close(gra->out.pdf.i_objpos);
+ }
+ dk4sto_close(gra->out.pdf.s_objpos);
+ }
+ gra->out.pdf.s_objpos = NULL;
+ gra->out.pdf.i_objpos = NULL;
+
+ /* Release storage and iterator sorted by XObject object number
+ */
+ if (NULL != gra->out.pdf.s_imagno) {
+ if (NULL != gra->out.pdf.i_imagno) {
+ dk4sto_it_close(gra->out.pdf.i_imagno);
+ }
+ dk4sto_close(gra->out.pdf.s_imagno);
+ }
+ gra->out.pdf.s_imagno = NULL;
+ gra->out.pdf.i_imagno = NULL;
+
+ /* Release pages
+ */
+ $? ". start release pages"
+ if (NULL != gra->s_pages) {
+ if (NULL != gra->i_pages) {
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pdf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ dk4gra_pgf_page_delete(bptr);
+ }
+ } while(NULL != bptr);
+ dk4sto_it_close(gra->i_pages);
+ }
+ dk4sto_close(gra->s_pages);
+ }
+ gra->s_pages = NULL;
+ gra->i_pages = NULL;
+ gra->curpg = NULL;
+ $? ". finished release pages"
+
+ /* Release records for embedded images
+ */
+ $? ". start release embedded images"
+ if (NULL != gra->out.pdf.s_images) {
+ if (NULL != gra->out.pdf.i_images) {
+ dk4sto_it_reset(gra->out.pdf.i_images);
+ do {
+ puxo = (dk4_gra_pdf_img_xo_t *)dk4sto_it_next(
+ gra->out.pdf.i_images
+ );
+ if (NULL != puxo) {
+ $? ". release xo"
+ dk4gra_pdf_xo_delete(puxo);
+ }
+ } while(NULL != puxo);
+ dk4sto_it_close(gra->out.pdf.i_images);
+ }
+ dk4sto_close(gra->out.pdf.s_images);
+ }
+ gra->out.pdf.s_images = NULL;
+ gra->out.pdf.i_images = NULL;
+ $? ". finished release embedded images"
+
+ /* Release file name and output structure itself
+ */
+ dk4gratool_close(gra);
+
+ finished:
+ $? "- dk4gra_pdf_close"
+ return;
+}
+
+
+
+dk4_gra_t *
+dk4gra_pdf_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4gra_pdf_open"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ /*
+ Generic initialization
+ */
+ back = dk4gratool_open(fn, w, h, docfl, erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* PDF specific initialization
+ */
+ back->out.pdf.s_imagno = NULL;
+ back->out.pdf.i_imagno = NULL;
+ back->out.pdf.s_images = NULL;
+ back->out.pdf.i_images = NULL;
+ back->out.pdf.s_objpos = NULL;
+ back->out.pdf.i_objpos = NULL;
+ back->out.pdf.nextobj = 4;
+ back->out.pdf.unxo = 0;
+ /*
+ Pages container and iterator
+ */
+ back->s_pages = dk4sto_open(erp);
+ if (NULL == back->s_pages) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->s_pages, dk4gra_pdf_compare_pages_by_number, 0);
+ back->i_pages = dk4sto_it_open(back->s_pages, erp);
+ if (NULL == back->i_pages) {
+ goto finished;
+ }
+ /*
+ PDF XObject container and iterator for embedded images
+ */
+ back->out.pdf.s_images = dk4sto_open(erp);
+ if (NULL == back->out.pdf.s_images) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->out.pdf.s_images, dk4gra_pdf_compare_xo, 0);
+ back->out.pdf.i_images = dk4sto_it_open(back->out.pdf.s_images, erp);
+ if (NULL == back->out.pdf.i_images) {
+ goto finished;
+ }
+ /* PDF XObject container and iterator sorted by object number
+ */
+ back->out.pdf.s_imagno = dk4sto_open(erp);
+ if (NULL == back->out.pdf.s_imagno) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->out.pdf.s_imagno,dk4gra_pdf_compare_used_xo,0);
+ back->out.pdf.i_imagno = dk4sto_it_open(back->out.pdf.s_imagno, erp);
+ if (NULL == back->out.pdf.i_imagno) {
+ goto finished;
+ }
+ /* Storage and iterator for object start positions
+ */
+ back->out.pdf.s_objpos = dk4sto_open(erp);
+ if (NULL == back->out.pdf.s_objpos) {
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->out.pdf.s_objpos, dk4gra_pdf_compare_objpos, 0);
+ back->out.pdf.i_objpos = dk4sto_it_open(back->out.pdf.s_objpos, erp);
+ if (NULL == back->out.pdf.i_objpos) {
+ goto finished;
+ }
+ /* Finally indicate success
+ */
+ ok = 1;
+
+ /* Cleanup section, destroy object if errors occured
+ */
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pdf_close(back);
+ back = NULL;
+ }
+ $? "- dk4gra_pdf_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ back = dk4gra_pdf_file(fout, gra, erp);
+ dk4gra_pdf_close(gra);
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *curpg = NULL;
+ int back = 0;
+ $? "+ dk4gra_pdf_page"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ /*
+ Check number of pages already defined
+ */
+ if (SIZE_MAX == gra->pages) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ goto finished;
+ }
+ curpg = dk4gra_pdf_page_new(gra->pages, gra, flags, erp);
+ if (NULL == curpg) {
+ goto finished;
+ }
+ if (0 == dk4sto_add(gra->s_pages, curpg, erp)) {
+ dk4gra_pgf_page_delete(curpg);
+ goto finished;
+ }
+ gra->curpg = curpg;
+ gra->pages += 1;
+ back = 1;
+
+ finished:
+ $? "- dk4gra_pdf_page %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 2, &back, erp);
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4gra_pdf_i_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (0 == dk4gra_pdf_gsave(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+int
+dk4gra_pdf_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 3, &back, erp);
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4gra_pdf_i_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (0 == dk4gra_pdf_grestore(gra, erp)) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+int
+dk4gra_pdf_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+)
+{
+
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lw_requested = lw;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.ls_requested = ls;
+ bptr->attr.sv_requested = sv;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lc_requested = lc;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pdf_set_line_join lj=%d ml=%g", lj, ml
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) { $? ". no output stream"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1; $? ". success"
+ bptr->attr.lj_requested = lj;
+ bptr->attr.ml_requested = ml;
+ if (1.0 > bptr->attr.ml_requested) { $? ". ml = %g < 1", ml
+ bptr->attr.ml_requested = 1.0;
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+ finished:
+ $? "- dk4gra_pdf_set_line_join %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_fill_requested.data.gray = g;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_RGB;
+ bptr->attr.col_fill_requested.data.rgb.r = r;
+ bptr->attr.col_fill_requested.data.rgb.g = g;
+ bptr->attr.col_fill_requested.data.rgb.b = b;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_CMYK;
+ bptr->attr.col_fill_requested.data.cmyk.c = c;
+ bptr->attr.col_fill_requested.data.cmyk.m = m;
+ bptr->attr.col_fill_requested.data.cmyk.y = y;
+ bptr->attr.col_fill_requested.data.cmyk.k = k;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_stroke_requested.data.gray = g;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_RGB;
+ bptr->attr.col_stroke_requested.data.rgb.r = r;
+ bptr->attr.col_stroke_requested.data.rgb.g = g;
+ bptr->attr.col_stroke_requested.data.rgb.b = b;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_CMYK;
+ bptr->attr.col_stroke_requested.data.cmyk.c = c;
+ bptr->attr.col_stroke_requested.data.cmyk.m = m;
+ bptr->attr.col_stroke_requested.data.cmyk.y = y;
+ bptr->attr.col_stroke_requested.data.cmyk.k = k;
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_set_color_if_necessary(
+ bptr->outstrm,
+ &(bptr->attr.col_fill_active), &(bptr->attr.col_fill_requested),
+ 1, &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+
+
+int
+dk4gra_pdf_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ double da[16];
+ dk4_gra_pdf_page_t *bptr;
+ double gw;
+ int back = 0;
+ int lwc = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+
+ /* Stroke color
+ */
+ dk4gra_pdf_set_color_if_necessary(
+ bptr->outstrm,
+ &(bptr->attr.col_stroke_active), &(bptr->attr.col_stroke_requested),
+ 0, &back, erp
+ );
+
+ /* Line width
+ */
+ if (
+ DK4_GRA_EPSILON_LINEWIDTH
+ < fabs(bptr->attr.lw_active - bptr->attr.lw_requested)
+ ) {
+ dk4gratool_stream_double(
+ bptr->outstrm, bptr->attr.lw_requested, &back, erp
+ );
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 25, &back, erp);
+ bptr->attr.lw_active = bptr->attr.lw_requested;
+ lwc = 1;
+ }
+ /* Line style
+ */
+ lwc = dk4gratool_line_style_differs(
+ bptr->attr.ls_active, bptr->attr.ls_requested,
+ bptr->attr.sv_active, bptr->attr.sv_requested,
+ lwc
+ );
+ if (0 != lwc) {
+ gw = (bptr->attr.sv_requested + bptr->attr.lw_requested) / 2.0;
+ if ((2.0 * bptr->attr.lw_requested) < gw) {
+ gw = 2.0 * bptr->attr.lw_requested;
+ }
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : case DK4_GRA_LC_PROJECTING : {
+ gw += bptr->attr.lw_requested;
+ } break;
+ }
+ switch (bptr->attr.ls_requested) {
+ case DK4_GRA_LS_DASH : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 2, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ case DK4_GRA_LS_DOT : {
+ da[0] = da[1] = bptr->attr.lw_requested;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 2, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ case DK4_GRA_LS_DASH_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 4, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_requested;
+ da[5] = gw;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 6, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_requested;
+ da[5] = gw;
+ da[6] = bptr->attr.lw_requested;
+ da[7] = gw;
+ dk4gra_pdf_dash_out(
+ bptr->outstrm, da, 8, (da[0] / 2.0), &back, erp
+ );
+ } break;
+ default : { /* solid */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 32, &back, erp);
+ } break;
+ }
+ bptr->attr.ls_active = bptr->attr.ls_requested;
+ bptr->attr.sv_active = bptr->attr.sv_requested;
+ }
+ /* Line cap
+ */
+ if (bptr->attr.lc_active != bptr->attr.lc_requested) {
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : { /* 1 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 27, &back, erp);
+ } break;
+ case DK4_GRA_LC_PROJECTING : { /* 2 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 28, &back, erp);
+ } break;
+ default : { /* 0 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 26, &back, erp);
+ } break;
+ }
+ bptr->attr.lc_active = bptr->attr.lc_requested;
+ }
+ /* Line join
+ */
+ if (bptr->attr.lj_active != bptr->attr.lj_requested) {
+ switch (bptr->attr.lj_requested) {
+ case DK4_GRA_LJ_ROUNDED : { /* 1 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 30, &back, erp);
+ } break;
+ case DK4_GRA_LJ_BEVELED : { /* 2 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 31, &back, erp);
+ } break;
+ default : { /* 0 */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 29, &back, erp);
+ } break;
+ }
+ bptr->attr.lj_active = bptr->attr.lj_requested;
+ }
+ if (DK4_GRA_LJ_MITERED == bptr->attr.lj_active) {
+ if (
+ DK4_GRA_EPSILON_MITERLIMIT
+ < fabs(bptr->attr.ml_active - bptr->attr.ml_requested)
+ ) {
+ dk4gra_pdf_i_values_and_kw(
+ bptr->outstrm, &(bptr->attr.ml_requested), 1, 84, &back, erp
+ );
+ bptr->attr.ml_active = bptr->attr.ml_requested;
+ }
+ }
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ back = dk4gra_pdf_prepare_fill(gra, erp);
+ if (0 == dk4gra_pdf_prepare_stroke(gra, erp)) {
+ back = 0;
+ }
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(
+ bptr->outstrm, ((0 != gra->eor) ? (10) : (9)), &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 8, &back, erp);
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(
+ bptr->outstrm, ((0 != gra->eor) ? (12) : (11)), &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_outstream_kw(
+ bptr->outstrm, ((0 != gra->eor) ? (14) : (13)), &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+static
+void
+dk4gra_pdf_i_newpath_moveto(
+ dk4_stream_t *os,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4gra_pdf_i_newpath_moveto os=%i", TR_IPTR(os)
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_double(os, x, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, y, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 4, backptr, erp);
+ $? "- dk4gra_pdf_i_newpath_moveto"
+}
+
+
+
+static
+void
+dk4gra_pdf_i_lineto(
+ dk4_stream_t *os,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_double(os, x, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, y, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 5, backptr, erp);
+}
+
+
+
+static
+void
+dk4gra_pdf_i_curveto(
+ dk4_stream_t *os,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_double(os, xc1, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, yc1, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, xc2, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, yc2, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, x, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 1, backptr, erp);
+ dk4gratool_stream_double(os, y, backptr, erp);
+ dk4gra_pdf_i_outstream_kw(os, 6, backptr, erp);
+}
+
+
+
+static
+void
+dk4gra_pdf_i_closepath(
+ dk4_stream_t *os,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gra_pdf_i_outstream_kw(os, 7, backptr, erp);
+}
+
+
+
+int
+dk4gra_pdf_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pdf_newpath_moveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ $? ". bptr = %d", TR_IPTR(bptr)
+ if (NULL == bptr->outstrm) {
+ $? "! bptr->outstrm"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ $? ". call dk4gra_pdf_i_newpath_moveto"
+ dk4gra_pdf_i_newpath_moveto(bptr->outstrm, x, y, &back, erp);
+
+ finished:
+ $? "- dk4gra_pdf_newpath_moveto %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_lineto(bptr->outstrm, x, y, &back, erp);
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_curveto(
+ bptr->outstrm, xc1, yc1, xc2, yc2, x, y, &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pdf_i_closepath(
+ bptr->outstrm, &back, erp
+ );
+
+ finished:
+ return back;
+}
+
+
+
+void
+dk4gra_pdf_save_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->catt),
+ &(bptr->attr),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_pdf_restore_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->attr),
+ &(bptr->catt),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_pdf_reset_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pdf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ dk4gratool_reset_active_attributes(&(bptr->attr));
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grpdi.c b/support/dktools/dk4grpdi.c
new file mode 100644
index 0000000000..13b55c45bf
--- /dev/null
+++ b/support/dktools/dk4grpdi.c
@@ -0,0 +1,1309 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grpdi.ctr
+*/
+
+/** @file dk4grpdi.c The dk4grpdi module.
+*/
+
+
+#line 9 "dk4grpdi.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4BIFA_H_INCLUDED
+#include "dk4bifa.h"
+#endif
+
+#ifndef DK4UFI_H_INCLUDED
+#include "dk4ufi.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#include "dk4strm.h"
+#endif
+
+#ifndef DK4STRMCO_H_INCLUDED
+#include "dk4strmco.h"
+#endif
+
+#ifndef DK4BITSH_H_INCLUDED
+#include "dk4bitsh.h"
+#endif
+
+#ifndef DK4EDSTM_H_INCLUDED
+#include "dk4edstm.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 89 "dk4grpdi.ctr"
+
+
+
+/** Text fragments to write background color.
+*/
+static const char * const dk4gra_pdfi_kw[] = {
+/* 0 */
+" ",
+
+/* 1 */
+"g",
+
+/* 2 */
+"rg",
+
+/* 3 */
+"k",
+
+/* 4 */
+" 0 0 m 0 1 l 1 1 l 1 0 l h f\n",
+
+NULL
+
+
+#line 111 "dk4grpdi.ctr"
+};
+
+
+
+/** Write instruction to fill rectangle (0,0)--(0,1)--(1,1)--(1,0)--closepath.
+ @param os Output stream (memory buffer stream).
+ @param colval Color components array.
+ @param ncolval Number of color components.
+ @param fii Fill color instruction index.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_fill_rectangle(
+ dk4_stream_t *os,
+ double *colval,
+ size_t ncolval,
+ size_t fii,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+
+ for (i = 0; i < ncolval; i++) {
+ dk4gratool_stream_double(os, colval[i], backptr, erp);
+ dk4gratool_stream_string(os, dk4gra_pdfi_kw[0], backptr, erp);
+ }
+ dk4gratool_stream_string(os, dk4gra_pdfi_kw[fii], backptr, erp);
+ dk4gratool_stream_string(os, dk4gra_pdfi_kw[4], backptr, erp);
+}
+
+
+
+/** Setup text XObject for a given image.
+ Note: No dynamic memory is used here, a pointer to the original
+ fn is stored in the XObject.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+*/
+
+static
+void
+dk4gra_pdf_xo_setup(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_gra_t *gra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ipol,
+ int ajpg,
+ int ijpg,
+ int acol,
+ int anb,
+ int anc,
+ int ana,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_jpeg_per_frame_t *pjpgf;
+
+
+#line 183 "dk4grpdi.ctr"
+ dk4mem_reset(xo, sizeof(dk4_gra_pdf_img_xo_t), NULL);
+ xo->fn = NULL;
+ xo->i_mb = NULL;
+ xo->m_mb = NULL;
+ xo->fno = 0;
+ xo->objno = 0;
+ xo->mobjno = 0;
+ xo->unxon = 0;
+ xo->width = 0;
+ xo->height = 0;
+ xo->dct = 0;
+ xo->ipol = 0;
+ xo->cs = 0;
+
+#line 196 "dk4grpdi.ctr"
+ xo->hufi = 0;
+ xo->deci = 0;
+ xo->bpc = 0;
+ xo->fn = fn;
+ if (NULL == fn) {
+ xo->unxon = gra->out.pdf.unxo;
+ gra->out.pdf.unxo = gra->out.pdf.unxo + 1;
+ }
+ xo->fno = fno;
+ xo->objno = gra->out.pdf.nextobj;
+ xo->width = dk4bif_get_width(bif);
+ xo->height = dk4bif_get_height(bif);
+ if ((DK4_BIF_TYPE_JPEG == bif->imgtype) && (0 != ajpg)) {
+
+
+#line 210 "dk4grpdi.ctr"
+ xo->dct = 1;
+ xo->ipol = (((0 != ipol) && (0 != ijpg)) ? (1) : (0));
+ xo->cs = dk4bif_get_color_space(bif);
+ xo->bpc = dk4bif_get_original_bit_depth(bif);
+ pjpgf = (dk4_bif_jpeg_per_frame_t *)(bif->cf->tsdata);
+ if (NULL != pjpgf) {
+ if ((DK4_CS_CMYK == xo->cs) && (0 != pjpgf->is_adobe)) {
+ xo->deci = 1;
+ }
+ }
+
+
+#line 221 "dk4grpdi.ctr"
+
+
+#line 222 "dk4grpdi.ctr"
+ }
+ else {
+
+
+#line 225 "dk4grpdi.ctr"
+ xo->ipol = ipol;
+ if (0 == dk4bif_analyze(
+ &(xo->cs), &(xo->bpc), bif, anb, anc, ana, erp
+ )
+ ) {
+
+#line 230 "dk4grpdi.ctr"
+ xo->cs = dk4bif_get_color_space(bif);
+ xo->bpc = dk4bif_get_original_bit_depth(bif);
+ }
+
+
+#line 234 "dk4grpdi.ctr"
+
+
+#line 235 "dk4grpdi.ctr"
+
+
+#line 236 "dk4grpdi.ctr"
+ if (0 == acol) {
+ switch (xo->cs) {
+ case DK4_CS_RGB : case DK4_CS_CMYK : {
+ xo->cs = DK4_CS_GRAY;
+
+#line 240 "dk4grpdi.ctr"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ xo->cs = DK4_CS_GRAY_ALPHA;
+
+#line 243 "dk4grpdi.ctr"
+ } break;
+ }
+ }
+
+
+#line 247 "dk4grpdi.ctr"
+
+
+#line 248 "dk4grpdi.ctr"
+
+
+#line 249 "dk4grpdi.ctr"
+ }
+ if (8 < xo->bpc) {
+ xo->bpc = 8;
+
+#line 252 "dk4grpdi.ctr"
+ }
+ if (NULL != fn) {
+ xo->hufi = dk4ufi_get(&(xo->ufi), fn, erp);
+#if TRACE_DEBUG
+ if (0 != xo->hufi) {
+
+
+#line 258 "dk4grpdi.ctr"
+
+
+#line 259 "dk4grpdi.ctr"
+ }
+#endif
+ }
+
+
+#line 263 "dk4grpdi.ctr"
+
+
+#line 264 "dk4grpdi.ctr"
+
+
+#line 265 "dk4grpdi.ctr"
+
+
+#line 266 "dk4grpdi.ctr"
+
+
+#line 267 "dk4grpdi.ctr"
+
+
+#line 268 "dk4grpdi.ctr"
+
+
+#line 269 "dk4grpdi.ctr"
+
+
+#line 270 "dk4grpdi.ctr"
+
+
+#line 271 "dk4grpdi.ctr"
+
+
+#line 272 "dk4grpdi.ctr"
+
+
+#line 273 "dk4grpdi.ctr"
+
+
+#line 274 "dk4grpdi.ctr"
+}
+
+
+
+/** Add image data to i_mb component of xo, directly transfer DCT
+ encoded data from JPEG file.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param curpg Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_add_jpeg_data(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_er_t *erp
+)
+{
+ char mybuf[128];
+ FILE *fipo = NULL;
+ char *bptr = mybuf;
+ char *aptr = NULL;
+ size_t szbptr = sizeof(mybuf);
+ size_t rdb;
+ int fotest = DK4_FOPEN_SC_IS_REGULAR;
+ int back = 0;
+ int cc = 0;
+
+
+#line 312 "dk4grpdi.ctr"
+ /* Attempt to allocate a larger buffer dynamically
+ */
+ aptr = (char *)calloc(4096,1);
+ if (NULL != aptr) {
+ bptr = aptr;
+ szbptr = 4096;
+ }
+ fipo = dk4fopen(xo->fn, dkT("rb"), fotest, erp);
+ if (NULL == fipo) {
+
+#line 321 "dk4grpdi.ctr"
+ goto finished;
+ }
+ do {
+ cc = 0;
+ rdb = fread(bptr, 1, szbptr, fipo);
+
+#line 326 "dk4grpdi.ctr"
+ if (0 < rdb) {
+ cc = 1;
+ if (1 != dk4membuf_store(xo->i_mb, bptr, rdb, erp)) {
+
+
+#line 330 "dk4grpdi.ctr"
+ cc = -1;
+ }
+ }
+ } while (1 == cc);
+ if (0 == cc) { back = 1; }
+
+#if TRACE_DEBUG
+#if 0
+ if (0 != dk4membuf_size(&rdb, curpg->membuf, NULL)) {
+
+
+#line 340 "dk4grpdi.ctr"
+ }
+ else {
+
+
+#line 343 "dk4grpdi.ctr"
+ }
+#endif
+#endif
+
+ finished:
+ if (NULL != aptr) { dk4mem_free(aptr); }
+ if (NULL != fipo) { fclose(fipo); }
+
+
+#line 351 "dk4grpdi.ctr"
+ return back;
+}
+
+
+
+
+/** Add image data to i_mb component of xo, use dk4_bif_t methods to
+ access pixel data.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_add_bif_data(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_bif_t *bif,
+ dk4_er_t *erp
+)
+{
+ dk4_px_t pix[8];
+ dk4_bit_shift_t bs;
+ dk4_stream_t *mbstrm = NULL;
+ dk4_stream_t *costrm = NULL;
+ size_t nco = 1;
+ size_t y = 0;
+ size_t x = 0;
+ size_t i = 0;
+ int back = 0;
+ unsigned char uc = 0;
+
+
+#line 393 "dk4grpdi.ctr"
+ /* Open streams to write compressed data to memory buffer
+ */
+ mbstrm = dk4stream_open_membuf_writer(xo->i_mb, erp);
+ if (NULL == mbstrm) {
+
+#line 397 "dk4grpdi.ctr"
+ goto finished;
+ }
+ costrm = dk4strmco_open(
+ mbstrm, DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_FLATE,
+ DK4_STRMCO_OE_NONE, 0, erp
+ );
+ if (NULL == costrm) {
+
+#line 404 "dk4grpdi.ctr"
+ goto finished;
+ }
+ /*
+ Find color space size
+ */
+
+
+#line 410 "dk4grpdi.ctr"
+ nco = dk4cs_color_space_size(xo->cs);
+
+
+#line 412 "dk4grpdi.ctr"
+ if ((DK4_CS_GRAY_ALPHA == xo->cs) || (DK4_CS_RGB_ALPHA == xo->cs)) {
+ nco--;
+ }
+
+
+#line 416 "dk4grpdi.ctr"
+
+ back = 1;
+
+ dk4bif_set_output_bit_depth(bif, xo->bpc);
+ if (8 == xo->bpc) {
+ for (y = 0; y < (size_t)(xo->height); y++) {
+ for (x = 0; x < (size_t)(xo->width); x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, 8, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, xo->cs
+ )
+ ) {
+ back = 0;
+
+#line 430 "dk4grpdi.ctr"
+ }
+ for (i = 0; i < nco; i++) {
+ if (0 == dk4stream_write_byte(costrm,(char)(pix[i]),erp)) {
+ back = 0;
+
+#line 434 "dk4grpdi.ctr"
+ }
+ }
+ }
+ }
+ }
+ else {
+ for (y = 0; y < (size_t)(xo->height); y++) {
+ dk4bit_shift_init(&bs, erp);
+ for (x = 0; x < (size_t)(xo->width); x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, 8, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, xo->cs
+ )
+ ) {
+ back = 0;
+
+#line 450 "dk4grpdi.ctr"
+ }
+ for (i = 0; i < nco; i++) {
+ dk4gratool_put_pixel_value(
+ costrm, &bs, pix[i], xo->bpc, &back, erp
+ );
+ }
+ }
+ switch (dk4bit_shift_finish(&bs, erp)) {
+ case DK4_EDSTM_FINISHED : {
+ uc = dk4bit_shift_output(&bs, erp);
+ if (0 == dk4stream_write_byte(costrm, (char)uc, erp)) {
+ back = 0;
+
+#line 462 "dk4grpdi.ctr"
+ }
+ } break;
+ case DK4_EDSTM_ERROR : {
+ back = 0;
+ } break;
+ }
+ }
+ }
+
+
+ /* Cleanup
+ */
+ finished:
+ if (NULL != costrm) {
+ if (0 == dk4stream_close(costrm, erp)) {
+
+#line 477 "dk4grpdi.ctr"
+ back = 0;
+ }
+ }
+ if (NULL != mbstrm) {
+ if (0 == dk4stream_close(mbstrm, erp)) {
+
+#line 482 "dk4grpdi.ctr"
+ back = 0;
+ }
+ }
+
+
+#line 486 "dk4grpdi.ctr"
+ return back;
+}
+
+
+
+/** Add image data to xo.
+ to obtain image data.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_add_image_data(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_bif_t *bif,
+ int ajpg,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 519 "dk4grpdi.ctr"
+ if ((DK4_BIF_TYPE_JPEG == bif->imgtype) && (0 != ajpg)) {
+
+
+#line 521 "dk4grpdi.ctr"
+ back = dk4gra_pdf_add_jpeg_data(xo, erp);
+ }
+ else {
+
+
+#line 525 "dk4grpdi.ctr"
+ back = dk4gra_pdf_add_bif_data(xo, bif, erp);
+ }
+
+
+#line 528 "dk4grpdi.ctr"
+ return back;
+}
+
+
+
+/** Add image mask data to m_mb component of xo.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_add_image_mask(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_bif_t *bif,
+ dk4_er_t *erp
+)
+{
+ dk4_px_t pix[8];
+ dk4_bit_shift_t bs;
+ dk4_stream_t *mbstrm = NULL;
+ dk4_stream_t *costrm = NULL;
+ size_t y;
+ size_t x;
+ size_t numco;
+ int back = 0;
+ unsigned char uc;
+
+
+#line 566 "dk4grpdi.ctr"
+ /* Open streams to write compressed data to memory buffer
+ */
+ mbstrm = dk4stream_open_membuf_writer(xo->m_mb, erp);
+ if (NULL == mbstrm) {
+
+#line 570 "dk4grpdi.ctr"
+ goto finished;
+ }
+ costrm = dk4strmco_open(
+ mbstrm, DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_FLATE,
+ DK4_STRMCO_OE_NONE, 0, erp
+ );
+ if (NULL == costrm) {
+
+#line 577 "dk4grpdi.ctr"
+ goto finished;
+ }
+
+ /* Success so far
+ */
+ back = 1;
+
+ numco = dk4cs_color_space_size(xo->cs);
+ numco--;
+ if (8 == xo->bpc) {
+ for (y = 0; y < (size_t)(xo->height); y++) {
+ for (x = 0; x < (size_t)(xo->width); x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, 8, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, xo->cs
+ )
+ ) {
+ back = 0;
+
+#line 596 "dk4grpdi.ctr"
+ }
+ uc = (unsigned char)(pix[numco]);
+ if (0 == dk4stream_write_byte(costrm, (char)uc, erp)) {
+ back = 0;
+
+#line 600 "dk4grpdi.ctr"
+ }
+ }
+ }
+ }
+ else {
+ for (y = 0; y < (size_t)(xo->height); y++) {
+ dk4bit_shift_init(&bs, erp);
+ for (x = 0; x < (size_t)(xo->width); x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, 8, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, xo->cs
+ )
+ ) {
+ back = 0;
+
+#line 615 "dk4grpdi.ctr"
+ }
+ dk4gratool_put_pixel_value(
+ costrm, &bs, pix[numco], xo->bpc, &back, erp
+ );
+ }
+ switch (dk4bit_shift_finish(&bs, erp)) {
+ case DK4_EDSTM_FINISHED : {
+ uc = dk4bit_shift_output(&bs, erp);
+ if (0 == dk4stream_write_byte(costrm, (char)uc, erp)) {
+ back = 0;
+
+#line 625 "dk4grpdi.ctr"
+ }
+ } break;
+ case DK4_EDSTM_ERROR : {
+ back = 0;
+ } break;
+ }
+ }
+ }
+
+ /* Clean up before returning
+ */
+ finished:
+ if (NULL != costrm) {
+ if (0 == dk4stream_close(costrm, erp)) {
+
+#line 639 "dk4grpdi.ctr"
+ back = 0;
+ }
+ }
+ if (NULL != mbstrm) {
+ if (0 == dk4stream_close(mbstrm, erp)) {
+
+#line 644 "dk4grpdi.ctr"
+ back = 0;
+ }
+ }
+
+
+#line 648 "dk4grpdi.ctr"
+ return back;
+}
+
+
+
+
+/** create a new object.
+ @param xo Source XObject.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new XObject, NULL on error.
+*/
+
+static
+dk4_gra_pdf_img_xo_t *
+dk4gra_pdf_xo_create(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_gra_t *gra,
+ dk4_bif_t *bif,
+ int ajpg,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_img_xo_t *back = NULL;
+ int ok = 0;
+
+
+#line 684 "dk4grpdi.ctr"
+ /* Allocate memory
+ */
+ back = dk4mem_new(dk4_gra_pdf_img_xo_t,1,erp);
+ if (NULL == back) {
+
+#line 688 "dk4grpdi.ctr"
+ goto finished;
+ }
+
+ /* Copy existing information
+ */
+ dk4mem_cpy(back, xo, sizeof(dk4_gra_pdf_img_xo_t), NULL);
+
+ /* Create own copy of file name
+ */
+ if (NULL != xo->fn) {
+ back->fn = dk4str_dup(xo->fn, erp);
+ if (NULL == back->fn) {
+
+#line 700 "dk4grpdi.ctr"
+ goto finished;
+ }
+ }
+ else {
+ back->fn = NULL;
+ }
+
+ /* Open memory buffers
+ */
+
+
+#line 710 "dk4grpdi.ctr"
+ back->i_mb = dk4membuf_open(erp);
+ if (NULL == back->i_mb) {
+
+#line 712 "dk4grpdi.ctr"
+ goto finished;
+ }
+ if ((DK4_CS_GRAY_ALPHA == xo->cs) || (DK4_CS_RGB_ALPHA == xo->cs)) {
+ back->m_mb = dk4membuf_open(erp);
+ if (NULL == back->m_mb) {
+
+#line 717 "dk4grpdi.ctr"
+ goto finished;
+ }
+ }
+ ok = dk4gra_pdf_add_image_data(
+ back, bif, ajpg, erp
+ );
+ if (0 != ok) {
+
+#line 724 "dk4grpdi.ctr"
+ if ((DK4_CS_GRAY_ALPHA == xo->cs) || (DK4_CS_RGB_ALPHA == xo->cs)) {
+ ok = dk4gra_pdf_add_image_mask(back,bif,erp);
+#if TRACE_DEBUG
+ if (0 == ok) {
+
+#line 728 "dk4grpdi.ctr"
+ }
+#endif
+ }
+ }
+ if (0 != ok) {
+ if (0 == dk4sto_add(gra->out.pdf.s_images, back, erp)) {
+ ok = 0;
+
+#line 735 "dk4grpdi.ctr"
+ }
+ else {
+ if (0 == dk4sto_add(gra->out.pdf.s_imagno, back, erp)) {
+ ok = 0;
+
+#line 739 "dk4grpdi.ctr"
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 744 "dk4grpdi.ctr"
+ }
+#endif
+
+
+ finished:
+ /*
+ Clean up and return NULL on errors
+ */
+ if ((NULL != back) && (0 == ok)) {
+ /* Delete XObject */
+ dk4gra_pdf_xo_delete(back);
+ back = NULL;
+ }
+ /*
+ If we have a new object, correct next object number in gra
+ */
+ if (NULL != back) {
+ gra->out.pdf.nextobj += 1;
+ if (NULL != back->m_mb) {
+ back->mobjno = gra->out.pdf.nextobj;
+ gra->out.pdf.nextobj += 1;
+ }
+ }
+
+
+#line 768 "dk4grpdi.ctr"
+ return back;
+}
+
+
+
+/** Find object or create a new one.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to found or new XObject, NULL on error.
+*/
+
+static
+dk4_gra_pdf_img_xo_t *
+dk4gra_pdf_find_or_create(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_gra_t *gra,
+ dk4_bif_t *bif,
+ int ajpg,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_img_xo_t *back = NULL;
+
+
+#line 802 "dk4grpdi.ctr"
+ back = (dk4_gra_pdf_img_xo_t *)dk4sto_it_find_like(
+ gra->out.pdf.i_images, xo, 0
+ );
+ if (NULL == back) {
+
+#line 806 "dk4grpdi.ctr"
+ back = dk4gra_pdf_xo_create(xo, gra, bif, ajpg, erp);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 810 "dk4grpdi.ctr"
+ }
+#endif
+
+
+#line 813 "dk4grpdi.ctr"
+ return back;
+}
+
+
+
+/** Register XObject for use on page (add to the pages container
+ of used XObjects if not yet present).
+ @param bptr Current page.
+ @param xo XObject to use on page.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_register_xo_for_page(
+ dk4_gra_pdf_page_t *bptr,
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 835 "dk4grpdi.ctr"
+ if (NULL == bptr->s_uxo) {
+ bptr->s_uxo = dk4sto_open(erp);
+ if (NULL == bptr->s_uxo) {
+
+#line 838 "dk4grpdi.ctr"
+ goto finished;
+ }
+ dk4sto_set_comp(bptr->s_uxo, dk4gra_pdf_compare_used_xo, 0);
+ }
+ if (NULL == bptr->i_uxo) {
+ bptr->i_uxo = dk4sto_it_open(bptr->s_uxo, erp);
+ if (NULL == bptr->i_uxo) {
+
+#line 845 "dk4grpdi.ctr"
+ goto finished;
+ }
+ }
+ if (NULL != dk4sto_it_find_like(bptr->i_uxo, xo, 0)) {
+ back = 1;
+
+#line 850 "dk4grpdi.ctr"
+ }
+ else {
+ if (0 != dk4sto_add(bptr->s_uxo, xo, erp)) {
+ back = 1;
+
+#line 854 "dk4grpdi.ctr"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 857 "dk4grpdi.ctr"
+ }
+#endif
+ }
+ finished:
+
+
+#line 862 "dk4grpdi.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_img_xo_t testxo;
+ dk4_gra_pdf_img_xo_t *xo;
+ dk4_gra_pdf_page_t *bptr;
+ double cm[6];
+ dk4_px_t gbg[4];
+ double cosphi;
+ double sinphi;
+ size_t i;
+ int back = 0;
+
+
+#line 888 "dk4grpdi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != cotra);
+ assert(NULL != bif);
+ assert(NULL != fn);
+#endif
+
+
+#line 895 "dk4grpdi.ctr"
+
+
+#line 896 "dk4grpdi.ctr"
+
+
+#line 897 "dk4grpdi.ctr"
+
+
+#line 898 "dk4grpdi.ctr"
+
+
+#line 899 "dk4grpdi.ctr"
+
+
+#line 900 "dk4grpdi.ctr"
+
+
+#line 901 "dk4grpdi.ctr"
+
+
+#line 902 "dk4grpdi.ctr"
+
+
+#line 903 "dk4grpdi.ctr"
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) {
+
+#line 905 "dk4grpdi.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+
+#line 909 "dk4grpdi.ctr"
+ if (DK4_CS_GRAY != dk4bif_get_color_space(bif)) {
+
+#line 910 "dk4grpdi.ctr"
+ if (DK4_CS_GRAY_ALPHA != dk4bif_get_color_space(bif)) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT));
+
+#line 912 "dk4grpdi.ctr"
+ }
+ }
+ }
+
+
+#line 916 "dk4grpdi.ctr"
+ dk4gra_pdf_xo_setup(
+ &testxo, gra, bif, fn, fno,
+ ((0 != (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_DCT & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)) ? (1) : (0)),
+ erp
+ );
+ xo = dk4gra_pdf_find_or_create(
+ &testxo, gra, bif,
+ ((0 != (DK4_GRA_IMG_FLAG_DCT & ifl)) ? (1) : (0)),
+ erp
+ );
+ if (NULL != xo) {
+
+#line 933 "dk4grpdi.ctr"
+ if (0 != dk4gra_pdf_register_xo_for_page(bptr, xo, erp)) {
+
+
+#line 935 "dk4grpdi.ctr"
+ back = 1;
+ dk4gra_pdf_save_attributes(gra);
+ dk4gra_i_gsave(gra, &back, erp);
+#if 1
+ /*
+ One CTM for combined translate, rotate and scale
+ */
+ for (i = 0; i < sizeof(cm)/sizeof(double); i++) { cm[i] = 0.0; }
+ cosphi = cos((M_PI * cotra[2]) / 180.0);
+ sinphi = sin((M_PI * cotra[2]) / 180.0);
+ cm[0] = cotra[3] * cosphi;
+ cm[1] = cotra[3] * sinphi;
+ cm[2] = 0.0 - cotra[4] * sinphi;
+ cm[3] = cotra[4] * cosphi;
+ if (
+ (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[0]))
+ || (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[1]))
+ ) {
+ cm[4] = cotra[0];
+ cm[5] = cotra[1];
+ }
+ dk4gra_pdf_i_values_and_kw(bptr->outstrm, cm, 6, 70, &back, erp);
+#else
+ /*
+ Old code - no longer used - performing multiple CTM changes
+ for a sequence of translate, rotate, and scale operations
+ */
+
+
+#line 963 "dk4grpdi.ctr"
+ /* translate */
+ if (
+ (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[0]))
+ || (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[1]))
+ ) {
+ for (i = 0; i < sizeof(cm)/sizeof(double); i++) { cm[i] = 0.0; }
+ cm[0] = 1.0;
+ cm[3] = 1.0;
+ cm[4] = cotra[0];
+ cm[5] = cotra[1];
+ dk4gra_pdf_i_values_and_kw(bptr->outstrm,cm,6,70,&back,erp);
+ }
+ /* rotate */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[2])) {
+ for (i = 0; i < sizeof(cm)/sizeof(double); i++) { cm[i] = 0.0; }
+ cm[0] = cosphi;
+ cm[1] = sinphi;
+ cm[2] = 0.0 - sinphi;
+ cm[3] = cosphi;
+ dk4gra_pdf_i_values_and_kw(bptr->outstrm,cm,6,70,&back, erp);
+ }
+ /* scale */
+ for (i = 0; i < sizeof(cm)/sizeof(double); i++) { cm[i] = 0.0; }
+ cm[0] = cotra[3];
+ cm[3] = cotra[4];
+ dk4gra_pdf_i_values_and_kw(bptr->outstrm, cm, 6, 70, &back, erp);
+#endif
+ /*
+ Fill image background with background color if required
+ */
+ if (0 != (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)) {
+
+
+#line 995 "dk4grpdi.ctr"
+ switch (bif->cf->l_cs) {
+ case DK4_CS_RGB_ALPHA : {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+
+
+#line 999 "dk4grpdi.ctr"
+ for (i = 0; i < 3; i++) {
+ cm[i] = ((double)(bif->cf->bglbd[i]))
+ / ((double)dk4pxbit_get_max(bif->cf->l_bdepth));
+ if (0.0 > cm[i]) { cm[i] = 0.0; }
+ if (1.0 < cm[i]) { cm[i] = 1.0; }
+ }
+ dk4gra_pdf_fill_rectangle(
+ bptr->outstrm, cm, 3, 2, &back, erp
+ );
+ }
+ else {
+ dk4cs_px_convert(
+ gbg, DK4_CS_GRAY, DK4_SIZEOF(gbg,dk4_px_t),
+ &(bif->cf->bglbd[0]), DK4_CS_RGB, 3,
+ NULL, 0,
+ dk4pxbit_get_max(bif->cf->l_bdepth),
+ &(bif->cs_ctx), erp
+ );
+ for (i = 0; i < 1; i++) {
+ cm[i] = ((double)(gbg[i]))
+ / ((double)dk4pxbit_get_max(bif->cf->l_bdepth));
+ if (0.0 > cm[i]) { cm[i] = 0.0; }
+ if (1.0 < cm[i]) { cm[i] = 1.0; }
+ }
+ dk4gra_pdf_fill_rectangle(
+ bptr->outstrm, cm, 1, 1, &back, erp
+ );
+ }
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+
+
+#line 1030 "dk4grpdi.ctr"
+ for (i = 0; i < 1; i++) {
+ cm[i] = ((double)(bif->cf->bglbd[i]))
+ / ((double)dk4pxbit_get_max(bif->cf->l_bdepth));
+ if (0.0 > cm[i]) { cm[i] = 0.0; }
+ if (1.0 < cm[i]) { cm[i] = 1.0; }
+ }
+ dk4gra_pdf_fill_rectangle(
+ bptr->outstrm, cm, 1, 1, &back, erp
+ );
+ } break;
+ }
+ }
+ /*
+ Write Do operator to stream
+ */
+ /* /X */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 71, &back, erp);
+ /* number */
+ dk4gratool_stream_uint(bptr->outstrm, xo->objno, 0, &back, erp);
+ /* space and Do */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 72, &back, erp);
+
+ dk4gra_i_grestore(gra, 0, &back, erp);
+ dk4gra_pdf_restore_attributes(gra);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1057 "dk4grpdi.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1062 "dk4grpdi.ctr"
+ }
+#endif
+
+ finished:
+
+
+#line 1067 "dk4grpdi.ctr"
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grpdi.ctr b/support/dktools/dk4grpdi.ctr
new file mode 100644
index 0000000000..692d897a00
--- /dev/null
+++ b/support/dktools/dk4grpdi.ctr
@@ -0,0 +1,1072 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef BIF_H_INCLUDED
+#include "bif.h"
+#endif
+
+#ifndef DK4BIFA_H_INCLUDED
+#include "dk4bifa.h"
+#endif
+
+#ifndef DK4UFI_H_INCLUDED
+#include "dk4ufi.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#include "dk4strm.h"
+#endif
+
+#ifndef DK4STRMCO_H_INCLUDED
+#include "dk4strmco.h"
+#endif
+
+#ifndef DK4BITSH_H_INCLUDED
+#include "dk4bitsh.h"
+#endif
+
+#ifndef DK4EDSTM_H_INCLUDED
+#include "dk4edstm.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Text fragments to write background color.
+*/
+static const char * const dk4gra_pdfi_kw[] = {
+$!string-table
+#
+# 0 Space
+#
+
+#
+# 1-3 gray, rgb, cmyk
+#
+g
+rg
+k
+#
+# 4 Code for filled rectangle (0,0)--(0,1)--(1,1)--(1,0)--closepath
+#
+ 0 0 m 0 1 l 1 1 l 1 0 l h f\n
+$!end
+};
+
+
+
+/** Write instruction to fill rectangle (0,0)--(0,1)--(1,1)--(1,0)--closepath.
+ @param os Output stream (memory buffer stream).
+ @param colval Color components array.
+ @param ncolval Number of color components.
+ @param fii Fill color instruction index.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pdf_fill_rectangle(
+ dk4_stream_t *os,
+ double *colval,
+ size_t ncolval,
+ size_t fii,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+
+ for (i = 0; i < ncolval; i++) {
+ dk4gratool_stream_double(os, colval[i], backptr, erp);
+ dk4gratool_stream_string(os, dk4gra_pdfi_kw[0], backptr, erp);
+ }
+ dk4gratool_stream_string(os, dk4gra_pdfi_kw[fii], backptr, erp);
+ dk4gratool_stream_string(os, dk4gra_pdfi_kw[4], backptr, erp);
+}
+
+
+
+/** Setup text XObject for a given image.
+ Note: No dynamic memory is used here, a pointer to the original
+ fn is stored in the XObject.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+*/
+
+static
+void
+dk4gra_pdf_xo_setup(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_gra_t *gra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ipol,
+ int ajpg,
+ int ijpg,
+ int acol,
+ int anb,
+ int anc,
+ int ana,
+ dk4_er_t *erp
+)
+{
+ dk4_bif_jpeg_per_frame_t *pjpgf;
+ $? "+ dk4gra_pdf_xo_setup"
+ dk4mem_reset(xo, sizeof(dk4_gra_pdf_img_xo_t), NULL);
+ xo->fn = NULL;
+ xo->i_mb = NULL;
+ xo->m_mb = NULL;
+ xo->fno = 0;
+ xo->objno = 0;
+ xo->mobjno = 0;
+ xo->unxon = 0;
+ xo->width = 0;
+ xo->height = 0;
+ xo->dct = 0;
+ xo->ipol = 0;
+ xo->cs = 0; $? ". xo cs = 0"
+ xo->hufi = 0;
+ xo->deci = 0;
+ xo->bpc = 0;
+ xo->fn = fn;
+ if (NULL == fn) {
+ xo->unxon = gra->out.pdf.unxo;
+ gra->out.pdf.unxo = gra->out.pdf.unxo + 1;
+ }
+ xo->fno = fno;
+ xo->objno = gra->out.pdf.nextobj;
+ xo->width = dk4bif_get_width(bif);
+ xo->height = dk4bif_get_height(bif);
+ if ((DK4_BIF_TYPE_JPEG == bif->imgtype) && (0 != ajpg)) {
+ $? ". can use JPEG directly"
+ xo->dct = 1;
+ xo->ipol = (((0 != ipol) && (0 != ijpg)) ? (1) : (0));
+ xo->cs = dk4bif_get_color_space(bif);
+ xo->bpc = dk4bif_get_original_bit_depth(bif);
+ pjpgf = (dk4_bif_jpeg_per_frame_t *)(bif->cf->tsdata);
+ if (NULL != pjpgf) {
+ if ((DK4_CS_CMYK == xo->cs) && (0 != pjpgf->is_adobe)) {
+ xo->deci = 1;
+ }
+ }
+ $? ". xo cs = %d", xo->cs
+ $? ". xo bpc = %u", (unsigned)(xo->bpc)
+ }
+ else {
+ $? ". must decode JPEG"
+ xo->ipol = ipol;
+ if (0 == dk4bif_analyze(
+ &(xo->cs), &(xo->bpc), bif, anb, anc, ana, erp
+ )
+ ) { $? "! image analysis failed"
+ xo->cs = dk4bif_get_color_space(bif);
+ xo->bpc = dk4bif_get_original_bit_depth(bif);
+ }
+ $? ". after analysis"
+ $? ". xo cs = %d", xo->cs
+ $? ". xo bpc = %u", (unsigned)(xo->bpc)
+ if (0 == acol) {
+ switch (xo->cs) {
+ case DK4_CS_RGB : case DK4_CS_CMYK : {
+ xo->cs = DK4_CS_GRAY; $? ". switching to gray"
+ } break;
+ case DK4_CS_RGB_ALPHA : {
+ xo->cs = DK4_CS_GRAY_ALPHA; $? ". switching to gray+a"
+ } break;
+ }
+ }
+ $? ". after correction for acol"
+ $? ". xo cs = %d", xo->cs
+ $? ". xo bpc = %u", (unsigned)(xo->bpc)
+ }
+ if (8 < xo->bpc) {
+ xo->bpc = 8; $? ". bpc = %u", (unsigned)(xo->bpc)
+ }
+ if (NULL != fn) {
+ xo->hufi = dk4ufi_get(&(xo->ufi), fn, erp);
+#if TRACE_DEBUG
+ if (0 != xo->hufi) {
+ $? ". dev = %llu", (unsigned long long)(xo->ufi.dev)
+ $? ". ino = %llu", (unsigned long long)(xo->ufi.ino)
+ }
+#endif
+ }
+ $? ". xo file name = \"%!ds\"", TR_STR(xo->fn)
+ $? ". xo frame no = %lu", (unsigned long)(xo->fno)
+ $? ". xo object no = %lu", (unsigned long)(xo->objno)
+ $? ". xo mask no = %lu", (unsigned long)(xo->mobjno)
+ $? ". xo width = %lu", (unsigned long)(xo->width)
+ $? ". xo height = %lu", (unsigned long)(xo->height)
+ $? ". xo dct = %d", xo->dct
+ $? ". xo ipol = %d", xo->ipol
+ $? ". xo cs = %d", xo->cs
+ $? ". xo have ufi = %d", xo->hufi
+ $? ". xo bpc = %u", (unsigned)(xo->bpc)
+ $? "- dk4gra_pdf_xo_setup"
+}
+
+
+
+/** Add image data to i_mb component of xo, directly transfer DCT
+ encoded data from JPEG file.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param curpg Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_add_jpeg_data(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_er_t *erp
+)
+{
+ char mybuf[128];
+ FILE *fipo = NULL;
+ char *bptr = mybuf;
+ char *aptr = NULL;
+ size_t szbptr = sizeof(mybuf);
+ size_t rdb;
+ int fotest = DK4_FOPEN_SC_IS_REGULAR;
+ int back = 0;
+ int cc = 0;
+ $? "+ dk4gra_pdf_add_jpeg_data"
+ /* Attempt to allocate a larger buffer dynamically
+ */
+ aptr = (char *)calloc(4096,1);
+ if (NULL != aptr) {
+ bptr = aptr;
+ szbptr = 4096;
+ }
+ fipo = dk4fopen(xo->fn, dkT("rb"), fotest, erp);
+ if (NULL == fipo) { $? "! failed to open file for reading"
+ goto finished;
+ }
+ do {
+ cc = 0;
+ rdb = fread(bptr, 1, szbptr, fipo); $? ". %u bytes read", (unsigned)rdb
+ if (0 < rdb) {
+ cc = 1;
+ if (1 != dk4membuf_store(xo->i_mb, bptr, rdb, erp)) {
+ $? "! failed to add bytes to memory buffer"
+ cc = -1;
+ }
+ }
+ } while (1 == cc);
+ if (0 == cc) { back = 1; }
+
+#if TRACE_DEBUG
+#if 0
+ if (0 != dk4membuf_size(&rdb, curpg->membuf, NULL)) {
+ $? ". bytes in memory buffer: %lu", (unsigned long)rdb
+ }
+ else {
+ $? "! failed to obtain memory buffer size"
+ }
+#endif
+#endif
+
+ finished:
+ if (NULL != aptr) { dk4mem_free(aptr); }
+ if (NULL != fipo) { fclose(fipo); }
+ $? "- dk4gra_pdf_add_jpeg_data %d", back
+ return back;
+}
+
+
+
+
+/** Add image data to i_mb component of xo, use dk4_bif_t methods to
+ access pixel data.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_add_bif_data(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_bif_t *bif,
+ dk4_er_t *erp
+)
+{
+ dk4_px_t pix[8];
+ dk4_bit_shift_t bs;
+ dk4_stream_t *mbstrm = NULL;
+ dk4_stream_t *costrm = NULL;
+ size_t nco = 1;
+ size_t y = 0;
+ size_t x = 0;
+ size_t i = 0;
+ int back = 0;
+ unsigned char uc = 0;
+ $? "+ dk4gra_pdf_add_bif_data"
+ /* Open streams to write compressed data to memory buffer
+ */
+ mbstrm = dk4stream_open_membuf_writer(xo->i_mb, erp);
+ if (NULL == mbstrm) { $? "! mb stream"
+ goto finished;
+ }
+ costrm = dk4strmco_open(
+ mbstrm, DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_FLATE,
+ DK4_STRMCO_OE_NONE, 0, erp
+ );
+ if (NULL == costrm) { $? "! co stream"
+ goto finished;
+ }
+ /*
+ Find color space size
+ */
+ $? ". xo cs = %d", xo->cs
+ nco = dk4cs_color_space_size(xo->cs);
+ $? ". nco = %u", (unsigned)nco
+ if ((DK4_CS_GRAY_ALPHA == xo->cs) || (DK4_CS_RGB_ALPHA == xo->cs)) {
+ nco--;
+ }
+ $? ". nco = %u", (unsigned)nco
+
+ back = 1;
+
+ dk4bif_set_output_bit_depth(bif, xo->bpc);
+ if (8 == xo->bpc) {
+ for (y = 0; y < (size_t)(xo->height); y++) {
+ for (x = 0; x < (size_t)(xo->width); x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, 8, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, xo->cs
+ )
+ ) {
+ back = 0; $? "! dk4bif_get_pixel"
+ }
+ for (i = 0; i < nco; i++) {
+ if (0 == dk4stream_write_byte(costrm,(char)(pix[i]),erp)) {
+ back = 0; $? "! dk4stream_write_byte"
+ }
+ }
+ }
+ }
+ }
+ else {
+ for (y = 0; y < (size_t)(xo->height); y++) {
+ dk4bit_shift_init(&bs, erp);
+ for (x = 0; x < (size_t)(xo->width); x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, 8, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, xo->cs
+ )
+ ) {
+ back = 0; $? "! dk4bif_get_pixel"
+ }
+ for (i = 0; i < nco; i++) {
+ dk4gratool_put_pixel_value(
+ costrm, &bs, pix[i], xo->bpc, &back, erp
+ );
+ }
+ }
+ switch (dk4bit_shift_finish(&bs, erp)) {
+ case DK4_EDSTM_FINISHED : {
+ uc = dk4bit_shift_output(&bs, erp);
+ if (0 == dk4stream_write_byte(costrm, (char)uc, erp)) {
+ back = 0; $? "! dk4stream_write_byte"
+ }
+ } break;
+ case DK4_EDSTM_ERROR : {
+ back = 0;
+ } break;
+ }
+ }
+ }
+
+
+ /* Cleanup
+ */
+ finished:
+ if (NULL != costrm) {
+ if (0 == dk4stream_close(costrm, erp)) { $? "! close co stream"
+ back = 0;
+ }
+ }
+ if (NULL != mbstrm) {
+ if (0 == dk4stream_close(mbstrm, erp)) { $? "! close mb stream"
+ back = 0;
+ }
+ }
+ $? "- dk4gra_pdf_add_bif_data %d", back
+ return back;
+}
+
+
+
+/** Add image data to xo.
+ to obtain image data.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_add_image_data(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_bif_t *bif,
+ int ajpg,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_pdf_add_image_data"
+ if ((DK4_BIF_TYPE_JPEG == bif->imgtype) && (0 != ajpg)) {
+ $? ". DCT data"
+ back = dk4gra_pdf_add_jpeg_data(xo, erp);
+ }
+ else {
+ $? ". normal data"
+ back = dk4gra_pdf_add_bif_data(xo, bif, erp);
+ }
+ $? "- dk4gra_pdf_add_image_data %d", back
+ return back;
+}
+
+
+
+/** Add image mask data to m_mb component of xo.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_add_image_mask(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_bif_t *bif,
+ dk4_er_t *erp
+)
+{
+ dk4_px_t pix[8];
+ dk4_bit_shift_t bs;
+ dk4_stream_t *mbstrm = NULL;
+ dk4_stream_t *costrm = NULL;
+ size_t y;
+ size_t x;
+ size_t numco;
+ int back = 0;
+ unsigned char uc;
+ $? "+ dk4gra_pdf_add_image_mask"
+ /* Open streams to write compressed data to memory buffer
+ */
+ mbstrm = dk4stream_open_membuf_writer(xo->m_mb, erp);
+ if (NULL == mbstrm) { $? "! failed to open mb stream"
+ goto finished;
+ }
+ costrm = dk4strmco_open(
+ mbstrm, DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_FLATE,
+ DK4_STRMCO_OE_NONE, 0, erp
+ );
+ if (NULL == costrm) { $? "! failed to open co stream"
+ goto finished;
+ }
+
+ /* Success so far
+ */
+ back = 1;
+
+ numco = dk4cs_color_space_size(xo->cs);
+ numco--;
+ if (8 == xo->bpc) {
+ for (y = 0; y < (size_t)(xo->height); y++) {
+ for (x = 0; x < (size_t)(xo->width); x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, 8, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, xo->cs
+ )
+ ) {
+ back = 0; $? "! dk4bif_get_pixel"
+ }
+ uc = (unsigned char)(pix[numco]);
+ if (0 == dk4stream_write_byte(costrm, (char)uc, erp)) {
+ back = 0; $? "! dk4stream_write_byte"
+ }
+ }
+ }
+ }
+ else {
+ for (y = 0; y < (size_t)(xo->height); y++) {
+ dk4bit_shift_init(&bs, erp);
+ for (x = 0; x < (size_t)(xo->width); x++) {
+ if (
+ 0 == dk4bif_get_pixel(
+ pix, 8, bif,
+ (dk4_bif_dim_t)y, (dk4_bif_dim_t)x, xo->cs
+ )
+ ) {
+ back = 0; $? "! dk4bif_get_pixel"
+ }
+ dk4gratool_put_pixel_value(
+ costrm, &bs, pix[numco], xo->bpc, &back, erp
+ );
+ }
+ switch (dk4bit_shift_finish(&bs, erp)) {
+ case DK4_EDSTM_FINISHED : {
+ uc = dk4bit_shift_output(&bs, erp);
+ if (0 == dk4stream_write_byte(costrm, (char)uc, erp)) {
+ back = 0; $? "! dk4stream_write_byte"
+ }
+ } break;
+ case DK4_EDSTM_ERROR : {
+ back = 0;
+ } break;
+ }
+ }
+ }
+
+ /* Clean up before returning
+ */
+ finished:
+ if (NULL != costrm) {
+ if (0 == dk4stream_close(costrm, erp)) { $? "! close co stream"
+ back = 0;
+ }
+ }
+ if (NULL != mbstrm) {
+ if (0 == dk4stream_close(mbstrm, erp)) { $? "! close mb stream"
+ back = 0;
+ }
+ }
+ $? "- dk4gra_pdf_add_image_mask %d", back
+ return back;
+}
+
+
+
+
+/** create a new object.
+ @param xo Source XObject.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new XObject, NULL on error.
+*/
+
+static
+dk4_gra_pdf_img_xo_t *
+dk4gra_pdf_xo_create(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_gra_t *gra,
+ dk4_bif_t *bif,
+ int ajpg,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_img_xo_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4gra_pdf_xo_create %lu", (unsigned long)(xo->objno)
+ /* Allocate memory
+ */
+ back = dk4mem_new(dk4_gra_pdf_img_xo_t,1,erp);
+ if (NULL == back) { $? "! failed to allocate memory"
+ goto finished;
+ }
+
+ /* Copy existing information
+ */
+ dk4mem_cpy(back, xo, sizeof(dk4_gra_pdf_img_xo_t), NULL);
+
+ /* Create own copy of file name
+ */
+ if (NULL != xo->fn) {
+ back->fn = dk4str_dup(xo->fn, erp);
+ if (NULL == back->fn) { $? "! failed to duplicate file name"
+ goto finished;
+ }
+ }
+ else {
+ back->fn = NULL;
+ }
+
+ /* Open memory buffers
+ */
+ $? ". xo cs = %d", xo->cs
+ back->i_mb = dk4membuf_open(erp);
+ if (NULL == back->i_mb) { $? "! failed to open image mem buf"
+ goto finished;
+ }
+ if ((DK4_CS_GRAY_ALPHA == xo->cs) || (DK4_CS_RGB_ALPHA == xo->cs)) {
+ back->m_mb = dk4membuf_open(erp);
+ if (NULL == back->m_mb) { $? "! failed to open mask mem buf"
+ goto finished;
+ }
+ }
+ ok = dk4gra_pdf_add_image_data(
+ back, bif, ajpg, erp
+ );
+ if (0 != ok) { $? ". image data added"
+ if ((DK4_CS_GRAY_ALPHA == xo->cs) || (DK4_CS_RGB_ALPHA == xo->cs)) {
+ ok = dk4gra_pdf_add_image_mask(back,bif,erp);
+#if TRACE_DEBUG
+ if (0 == ok) { $? "! failed to add mask data"
+ }
+#endif
+ }
+ }
+ if (0 != ok) {
+ if (0 == dk4sto_add(gra->out.pdf.s_images, back, erp)) {
+ ok = 0; $? "! failed to add to storage"
+ }
+ else {
+ if (0 == dk4sto_add(gra->out.pdf.s_imagno, back, erp)) {
+ ok = 0; $? "! failed to add to storage"
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! failed to add image data"
+ }
+#endif
+
+
+ finished:
+ /*
+ Clean up and return NULL on errors
+ */
+ if ((NULL != back) && (0 == ok)) {
+ /* Delete XObject */
+ dk4gra_pdf_xo_delete(back);
+ back = NULL;
+ }
+ /*
+ If we have a new object, correct next object number in gra
+ */
+ if (NULL != back) {
+ gra->out.pdf.nextobj += 1;
+ if (NULL != back->m_mb) {
+ back->mobjno = gra->out.pdf.nextobj;
+ gra->out.pdf.nextobj += 1;
+ }
+ }
+ $? "- dk4gra_pdf_xo_create %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Find object or create a new one.
+ @param xo XObject to fill with data.
+ @param gra Graphics output structure.
+ @param bptr Current page.
+ @param bif Bitmap image file.
+ @param fn Bitmap image file name.
+ @param fno Frame number in bitmap image file.
+ @param ipol Flag: Allow interpolation.
+ @param ajpg Flag: Allow direct re-use of DCT encoded data from JPEG.
+ @param ijpg Flag: Allow interpolation for DCT encoded data.
+ @param anb Flag: Analyze bit depth.
+ @param anc Flag: Analyze colors.
+ @param ana Flag: Analyze alpha channel use.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to found or new XObject, NULL on error.
+*/
+
+static
+dk4_gra_pdf_img_xo_t *
+dk4gra_pdf_find_or_create(
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_gra_t *gra,
+ dk4_bif_t *bif,
+ int ajpg,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_img_xo_t *back = NULL;
+ $? "+ dk4gra_pdf_find_or_create"
+ back = (dk4_gra_pdf_img_xo_t *)dk4sto_it_find_like(
+ gra->out.pdf.i_images, xo, 0
+ );
+ if (NULL == back) { $? ". must create new xo"
+ back = dk4gra_pdf_xo_create(xo, gra, bif, ajpg, erp);
+ }
+#if TRACE_DEBUG
+ else { $? ". found existing xo"
+ }
+#endif
+ $? "- dk4gra_pdf_find_or_create %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Register XObject for use on page (add to the pages container
+ of used XObjects if not yet present).
+ @param bptr Current page.
+ @param xo XObject to use on page.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4gra_pdf_register_xo_for_page(
+ dk4_gra_pdf_page_t *bptr,
+ dk4_gra_pdf_img_xo_t *xo,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_pdf_register_xo_for_page %lu", (unsigned long)(xo->objno)
+ if (NULL == bptr->s_uxo) {
+ bptr->s_uxo = dk4sto_open(erp);
+ if (NULL == bptr->s_uxo) { $? "! failed to create storage"
+ goto finished;
+ }
+ dk4sto_set_comp(bptr->s_uxo, dk4gra_pdf_compare_used_xo, 0);
+ }
+ if (NULL == bptr->i_uxo) {
+ bptr->i_uxo = dk4sto_it_open(bptr->s_uxo, erp);
+ if (NULL == bptr->i_uxo) { $? "! failed to create iterator"
+ goto finished;
+ }
+ }
+ if (NULL != dk4sto_it_find_like(bptr->i_uxo, xo, 0)) {
+ back = 1; $? ". found existing object"
+ }
+ else {
+ if (0 != dk4sto_add(bptr->s_uxo, xo, erp)) {
+ back = 1; $? ". added new object"
+ }
+#if TRACE_DEBUG
+ else { $? "! failed to add object"
+ }
+#endif
+ }
+ finished:
+ $? "- dk4gra_pdf_register_xo_for_page %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pdf_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pdf_img_xo_t testxo;
+ dk4_gra_pdf_img_xo_t *xo;
+ dk4_gra_pdf_page_t *bptr;
+ double cm[6];
+ dk4_px_t gbg[4];
+ double cosphi;
+ double sinphi;
+ size_t i;
+ int back = 0;
+ $? "+ dk4gra_pdf_bif_fig_image \"%!ds\"", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != cotra);
+ assert(NULL != bif);
+ assert(NULL != fn);
+#endif
+ $? ". fno = %u", (unsigned)fno
+ $? ". ipol = %d", (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)
+ $? ". ajpg = %d", (DK4_GRA_IMG_FLAG_DCT & ifl)
+ $? ". ijpg = %d", (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)
+ $? ". acol = %d", (DK4_GRA_IMG_FLAG_COLOR & ifl)
+ $? ". anb = %d", (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)
+ $? ". anc = %d", (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)
+ $? ". ana = %d", (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)
+ $? ". fbgf = %d", (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)
+ bptr = (dk4_gra_pdf_page_t *)(gra->curpg);
+ if (NULL == bptr->outstrm) { $? "! not output stream for page"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 == (DK4_GRA_IMG_FLAG_COLOR & ifl)) { $? ". no color"
+ if (DK4_CS_GRAY != dk4bif_get_color_space(bif)) { $? ". not gray"
+ if (DK4_CS_GRAY_ALPHA != dk4bif_get_color_space(bif)) {
+ ifl &= (~(DK4_GRA_IMG_FLAG_DCT)); $? ". ajpg = 0"
+ }
+ }
+ }
+ $? ". set up xo"
+ dk4gra_pdf_xo_setup(
+ &testxo, gra, bif, fn, fno,
+ ((0 != (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_DCT & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_BPC & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_COLOR & ifl)) ? (1) : (0)),
+ ((0 != (DK4_GRA_IMG_FLAG_ANALYZE_ALPHA & ifl)) ? (1) : (0)),
+ erp
+ );
+ xo = dk4gra_pdf_find_or_create(
+ &testxo, gra, bif,
+ ((0 != (DK4_GRA_IMG_FLAG_DCT & ifl)) ? (1) : (0)),
+ erp
+ );
+ if (NULL != xo) { $? ". xo found"
+ if (0 != dk4gra_pdf_register_xo_for_page(bptr, xo, erp)) {
+ $? ". xo registered"
+ back = 1;
+ dk4gra_pdf_save_attributes(gra);
+ dk4gra_i_gsave(gra, &back, erp);
+#if 1
+ /*
+ One CTM for combined translate, rotate and scale
+ */
+ for (i = 0; i < sizeof(cm)/sizeof(double); i++) { cm[i] = 0.0; }
+ cosphi = cos((M_PI * cotra[2]) / 180.0);
+ sinphi = sin((M_PI * cotra[2]) / 180.0);
+ cm[0] = cotra[3] * cosphi;
+ cm[1] = cotra[3] * sinphi;
+ cm[2] = 0.0 - cotra[4] * sinphi;
+ cm[3] = cotra[4] * cosphi;
+ if (
+ (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[0]))
+ || (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[1]))
+ ) {
+ cm[4] = cotra[0];
+ cm[5] = cotra[1];
+ }
+ dk4gra_pdf_i_values_and_kw(bptr->outstrm, cm, 6, 70, &back, erp);
+#else
+ /*
+ Old code - no longer used - performing multiple CTM changes
+ for a sequence of translate, rotate, and scale operations
+ */
+ $? ". multiple CTMS for translate rotate scale"
+ /* translate */
+ if (
+ (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[0]))
+ || (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[1]))
+ ) {
+ for (i = 0; i < sizeof(cm)/sizeof(double); i++) { cm[i] = 0.0; }
+ cm[0] = 1.0;
+ cm[3] = 1.0;
+ cm[4] = cotra[0];
+ cm[5] = cotra[1];
+ dk4gra_pdf_i_values_and_kw(bptr->outstrm,cm,6,70,&back,erp);
+ }
+ /* rotate */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[2])) {
+ for (i = 0; i < sizeof(cm)/sizeof(double); i++) { cm[i] = 0.0; }
+ cm[0] = cosphi;
+ cm[1] = sinphi;
+ cm[2] = 0.0 - sinphi;
+ cm[3] = cosphi;
+ dk4gra_pdf_i_values_and_kw(bptr->outstrm,cm,6,70,&back, erp);
+ }
+ /* scale */
+ for (i = 0; i < sizeof(cm)/sizeof(double); i++) { cm[i] = 0.0; }
+ cm[0] = cotra[3];
+ cm[3] = cotra[4];
+ dk4gra_pdf_i_values_and_kw(bptr->outstrm, cm, 6, 70, &back, erp);
+#endif
+ /*
+ Fill image background with background color if required
+ */
+ if (0 != (DK4_GRA_IMG_FLAG_FILL_BACKGROUND & ifl)) {
+ $? ". fill background first before applying image"
+ switch (bif->cf->l_cs) {
+ case DK4_CS_RGB_ALPHA : {
+ if (0 != (DK4_GRA_IMG_FLAG_COLOR & ifl)) {
+ $? ". fill rgb"
+ for (i = 0; i < 3; i++) {
+ cm[i] = ((double)(bif->cf->bglbd[i]))
+ / ((double)dk4pxbit_get_max(bif->cf->l_bdepth));
+ if (0.0 > cm[i]) { cm[i] = 0.0; }
+ if (1.0 < cm[i]) { cm[i] = 1.0; }
+ }
+ dk4gra_pdf_fill_rectangle(
+ bptr->outstrm, cm, 3, 2, &back, erp
+ );
+ }
+ else {
+ dk4cs_px_convert(
+ gbg, DK4_CS_GRAY, DK4_SIZEOF(gbg,dk4_px_t),
+ &(bif->cf->bglbd[0]), DK4_CS_RGB, 3,
+ NULL, 0,
+ dk4pxbit_get_max(bif->cf->l_bdepth),
+ &(bif->cs_ctx), erp
+ );
+ for (i = 0; i < 1; i++) {
+ cm[i] = ((double)(gbg[i]))
+ / ((double)dk4pxbit_get_max(bif->cf->l_bdepth));
+ if (0.0 > cm[i]) { cm[i] = 0.0; }
+ if (1.0 < cm[i]) { cm[i] = 1.0; }
+ }
+ dk4gra_pdf_fill_rectangle(
+ bptr->outstrm, cm, 1, 1, &back, erp
+ );
+ }
+ } break;
+ case DK4_CS_GRAY_ALPHA : {
+ $? ". fill gray"
+ for (i = 0; i < 1; i++) {
+ cm[i] = ((double)(bif->cf->bglbd[i]))
+ / ((double)dk4pxbit_get_max(bif->cf->l_bdepth));
+ if (0.0 > cm[i]) { cm[i] = 0.0; }
+ if (1.0 < cm[i]) { cm[i] = 1.0; }
+ }
+ dk4gra_pdf_fill_rectangle(
+ bptr->outstrm, cm, 1, 1, &back, erp
+ );
+ } break;
+ }
+ }
+ /*
+ Write Do operator to stream
+ */
+ /* /X */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 71, &back, erp);
+ /* number */
+ dk4gratool_stream_uint(bptr->outstrm, xo->objno, 0, &back, erp);
+ /* space and Do */
+ dk4gra_pdf_i_outstream_kw(bptr->outstrm, 72, &back, erp);
+
+ dk4gra_i_grestore(gra, 0, &back, erp);
+ dk4gra_pdf_restore_attributes(gra);
+ }
+#if TRACE_DEBUG
+ else { $? "! failed to register xo"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! no xo found"
+ }
+#endif
+
+ finished:
+ $? "- dk4gra_pdf_bif_fig_image %d", back
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grpdt.c b/support/dktools/dk4grpdt.c
new file mode 100644
index 0000000000..3a52787552
--- /dev/null
+++ b/support/dktools/dk4grpdt.c
@@ -0,0 +1,184 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grpdt.ctr
+*/
+
+/** @file dk4grpdt.c The dk4grpdt module.
+*/
+
+
+#line 9 "dk4grpdt.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_TIME_WITH_SYS_TIME
+#ifndef SYS_TIME_H_INCLUDED
+#include <sys/time.h>
+#define SYS_TIME_H_INCLUDED 1
+#endif
+#ifndef TIME_H_INCLUDED
+#include <time.h>
+#define TIME_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_TIME_H
+#ifndef TIME_H_INCLUDED
+#include <time.h>
+#define TIME_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_SYS_TIME_H
+#ifndef SYS_TIME_H_INCLUDED
+#include <sys/time.h>
+#define SYS_TIME_H_INCLUDED 1
+#endif
+#endif
+#endif
+#endif
+
+#include <stdio.h>
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+/** Conversion format string.
+*/
+static const char dk4gra_pdf_ts_format[] = { "%04d%02d%02d%02d%02d%02d" };
+
+
+
+/** Convert timestamp to text.
+ @param buf Destination buffer.
+ @param szbuf Size of destination buffer.
+ @param plct Local time splitted into components.
+*/
+static
+void
+dk4gra_pdf_convert_timestamp(char *buf, size_t szbuf, const struct tm *plct)
+{
+#if DK4_HAVE__SNPRINTF_S
+ _snprintf_s(
+ buf, szbuf, _TRUNCATE, dk4gra_pdf_ts_format,
+ (1900 + plct->tm_year),
+ (1 + plct->tm_mon),
+ plct->tm_mday,
+ plct->tm_hour,
+ plct->tm_min,
+ plct->tm_sec
+ );
+#else
+#if DK4_HAVE__SNPRINTF
+ _snprintf(
+ buf, szbuf, dk4gra_pdf_ts_format,
+ (1900 + plct->tm_year),
+ (1 + plct->tm_mon),
+ plct->tm_mday,
+ plct->tm_hour,
+ plct->tm_min,
+ plct->tm_sec
+ );
+#else
+#if DK4_HAVE_SNPRINTF
+ snprintf(
+ buf, szbuf, dk4gra_pdf_ts_format,
+ (1900 + plct->tm_year),
+ (1 + plct->tm_mon),
+ plct->tm_mday,
+ plct->tm_hour,
+ plct->tm_min,
+ plct->tm_sec
+ );
+#else
+ sprintf(
+ buf, dk4gra_pdf_ts_format,
+ (1900 + plct->tm_year),
+ (1 + plct->tm_mon),
+ plct->tm_mday,
+ plct->tm_hour,
+ plct->tm_min,
+ plct->tm_sec
+ );
+#endif
+#endif
+#endif
+}
+
+
+
+int
+dk4gra_pdf_timestamp(char *buf, size_t szbuf, dk4_er_t *erp)
+{
+#if DK4_ON_WINDOWS
+/* +++ Windows +++ */
+ struct tm lct;
+ __time64_t timer;
+/* --- Windows --- */
+#else
+/* +++ POSIX +++ */
+ struct tm lct;
+#if !DK4_HAVE_LOCALTIME_R
+ struct tm *plct;
+#endif
+ time_t timer;
+/* --- POSIX --- */
+#endif
+
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buf);
+ assert(14 < szbuf);
+#endif
+ if ((NULL == buf) || (15 > szbuf)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ buf[0] = '\0';
+#if DK4_ON_WINDOWS
+/* +++ Windows +++ */
+ (void)_time64(&timer);
+ if (0 == _localtime64_s(&lct, &timer)) {
+ back = 1;
+ dk4gra_pdf_convert_timestamp(buf, szbuf, &lct);
+ }
+/* --- Windows --- */
+#else
+/* +++ POSIX +++ */
+ (void)time(&timer);
+#if DK4_HAVE_LOCALTIME_R
+ if (NULL != localtime_r(&timer, &lct)) {
+ back = 1;
+ dk4gra_pdf_convert_timestamp(buf, szbuf, &lct);
+ }
+#else
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+/* --- POSIX --- */
+#endif
+
+ finished:
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grpdt.ctr b/support/dktools/dk4grpdt.ctr
new file mode 100644
index 0000000000..dad6ea6e02
--- /dev/null
+++ b/support/dktools/dk4grpdt.ctr
@@ -0,0 +1,174 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_TIME_WITH_SYS_TIME
+#ifndef SYS_TIME_H_INCLUDED
+#include <sys/time.h>
+#define SYS_TIME_H_INCLUDED 1
+#endif
+#ifndef TIME_H_INCLUDED
+#include <time.h>
+#define TIME_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_TIME_H
+#ifndef TIME_H_INCLUDED
+#include <time.h>
+#define TIME_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_SYS_TIME_H
+#ifndef SYS_TIME_H_INCLUDED
+#include <sys/time.h>
+#define SYS_TIME_H_INCLUDED 1
+#endif
+#endif
+#endif
+#endif
+
+#include <stdio.h>
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+/** Conversion format string.
+*/
+static const char dk4gra_pdf_ts_format[] = { "%04d%02d%02d%02d%02d%02d" };
+
+
+
+/** Convert timestamp to text.
+ @param buf Destination buffer.
+ @param szbuf Size of destination buffer.
+ @param plct Local time splitted into components.
+*/
+static
+void
+dk4gra_pdf_convert_timestamp(char *buf, size_t szbuf, const struct tm *plct)
+{
+#if DK4_HAVE__SNPRINTF_S
+ _snprintf_s(
+ buf, szbuf, _TRUNCATE, dk4gra_pdf_ts_format,
+ (1900 + plct->tm_year),
+ (1 + plct->tm_mon),
+ plct->tm_mday,
+ plct->tm_hour,
+ plct->tm_min,
+ plct->tm_sec
+ );
+#else
+#if DK4_HAVE__SNPRINTF
+ _snprintf(
+ buf, szbuf, dk4gra_pdf_ts_format,
+ (1900 + plct->tm_year),
+ (1 + plct->tm_mon),
+ plct->tm_mday,
+ plct->tm_hour,
+ plct->tm_min,
+ plct->tm_sec
+ );
+#else
+#if DK4_HAVE_SNPRINTF
+ snprintf(
+ buf, szbuf, dk4gra_pdf_ts_format,
+ (1900 + plct->tm_year),
+ (1 + plct->tm_mon),
+ plct->tm_mday,
+ plct->tm_hour,
+ plct->tm_min,
+ plct->tm_sec
+ );
+#else
+ sprintf(
+ buf, dk4gra_pdf_ts_format,
+ (1900 + plct->tm_year),
+ (1 + plct->tm_mon),
+ plct->tm_mday,
+ plct->tm_hour,
+ plct->tm_min,
+ plct->tm_sec
+ );
+#endif
+#endif
+#endif
+}
+
+
+
+int
+dk4gra_pdf_timestamp(char *buf, size_t szbuf, dk4_er_t *erp)
+{
+#if DK4_ON_WINDOWS
+/* +++ Windows +++ */
+ struct tm lct;
+ __time64_t timer;
+/* --- Windows --- */
+#else
+/* +++ POSIX +++ */
+ struct tm lct;
+#if !DK4_HAVE_LOCALTIME_R
+ struct tm *plct;
+#endif
+ time_t timer;
+/* --- POSIX --- */
+#endif
+
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buf);
+ assert(14 < szbuf);
+#endif
+ if ((NULL == buf) || (15 > szbuf)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ buf[0] = '\0';
+#if DK4_ON_WINDOWS
+/* +++ Windows +++ */
+ (void)_time64(&timer);
+ if (0 == _localtime64_s(&lct, &timer)) {
+ back = 1;
+ dk4gra_pdf_convert_timestamp(buf, szbuf, &lct);
+ }
+/* --- Windows --- */
+#else
+/* +++ POSIX +++ */
+ (void)time(&timer);
+#if DK4_HAVE_LOCALTIME_R
+ if (NULL != localtime_r(&timer, &lct)) {
+ back = 1;
+ dk4gra_pdf_convert_timestamp(buf, szbuf, &lct);
+ }
+#else
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+#endif
+/* --- POSIX --- */
+#endif
+
+ finished:
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grpgf.c b/support/dktools/dk4grpgf.c
new file mode 100644
index 0000000000..66f9c3251f
--- /dev/null
+++ b/support/dktools/dk4grpgf.c
@@ -0,0 +1,3205 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grpgf.ctr
+*/
+
+/** @file dk4grpgf.c The dk4grpgf module.
+*/
+
+
+#line 8 "dk4grpgf.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#include "dk4enc.h"
+#endif
+
+#ifndef DK4REC25_H_INCLUDED
+#include "dk4rec25.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4UFIC_H_INCLUDED
+#include "dk4ufic.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRMF_H_INCLUDED
+#include "dk4strmf.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4UFI_H_INCLUDED
+#include "dk4ufi.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4LOC_H_INCLUDED
+#include "dk4loc.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4FONTC_H_INCLUDED
+#include "dk4fontc.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 92 "dk4grpgf.ctr"
+
+
+
+/** Constant text fragments for PGF output.
+*/
+static const char * const dk4gra_pgf_kw[] = {
+/* 0 */
+"\n",
+
+/* 1 */
+"\\begin{pgfscope}\n",
+
+/* 2 */
+"\\end{pgfscope}\n",
+
+/* 3 */
+",",
+
+/* 4 */
+"\\definecolor{PPPTcs}{gray}{",
+
+/* 5 */
+"\\definecolor{PPPTcn}{gray}{",
+
+/* 6 */
+"\\definecolor{PPPTcs}{rgb}{",
+
+/* 7 */
+"\\definecolor{PPPTcn}{rgb}{",
+
+/* 8 */
+"\\definecolor{PPPTcs}{cmyk}{",
+
+/* 9 */
+"\\definecolor{PPPTcn}{cmyk}{",
+
+/* 10 */
+"}\\pgfsetstrokecolor{PPPTcs}\n",
+
+/* 11 */
+"}\\pgfsetfillcolor{PPPTcn}\n",
+
+/* 12 */
+"\\pgfsetlinewidth{",
+
+/* 13 */
+"bp}\n",
+
+/* 14 */
+"\\pgfsetdash{",
+
+/* 15 */
+"}{",
+
+/* 16 */
+"{",
+
+/* 17 */
+"bp}",
+
+/* 18 */
+"\\pgfsetbuttcap\n",
+
+/* 19 */
+"\\pgfsetroundcap\n",
+
+/* 20 */
+"\\pgfsetrectcap\n",
+
+/* 21 */
+"\\pgfsetroundjoin\n",
+
+/* 22 */
+"\\pgfsetbeveljoin\n",
+
+/* 23 */
+"\\pgfsetmiterjoin\n",
+
+/* 24 */
+"\\pgfsetmiterlimit{",
+
+/* 25 */
+"}\n",
+
+/* 26 */
+"\\pgfusepath{fill}\n",
+
+/* 27 */
+"\\pgfusepath{stroke}\n",
+
+/* 28 */
+"\\pgfusepath{fill,stroke}\n",
+
+/* 29 */
+"\\pgfusepath{clip}\n",
+
+/* 30 */
+"\\pgfusepath{use as bounding box}\n",
+
+/* 31 */
+"\\pgfpathmoveto{\\pgfpoint{",
+
+/* 32 */
+"\\pgfpathlineto{\\pgfpoint{",
+
+/* 33 */
+"bp}{",
+
+/* 34 */
+"bp}}\n",
+
+/* 35 */
+"\\pgfpathcurveto{\\pgfpoint{",
+
+/* 36 */
+"bp}}{\\pgfpoint{",
+
+/* 37 */
+"\\pgfpathclose\n",
+
+/* 38 */
+"\\pgfpathcircle{\\pgfpoint{",
+
+/* 39 */
+"bp}}{",
+
+/* 40 */
+"{\n",
+
+/* 41 */
+"\\pgfsetcornersarced{\\pgfpoint{",
+
+/* 42 */
+"\\pgfpathrectanglecorners{\\pgfpoint{",
+
+/* 43 */
+"\\clearpage\n",
+
+/* 44 */
+"\\begin{pgfpicture}\n",
+
+/* 45 */
+"\\end{pgfpicture}%\n",
+
+/* 46 */
+"\\pgfpathrectangle{\\pgfpointorigin}{\\pgfpoint{",
+
+/* 47 */
+"\\pgfseteorule\n",
+
+/* 48 */
+"\\pgfsetnonzerorule\n",
+
+/* 49 */
+"\\pgftext[top,at={\\pgfpoint{",
+
+/* 50 */
+"\\pgftext[top,right,at={\\pgfpoint{",
+
+/* 51 */
+"\\pgftext[top,left,at={\\pgfpoint{",
+
+/* 52 */
+"\\pgftext[at={\\pgfpoint{",
+
+/* 53 */
+"\\pgftext[right,at={\\pgfpoint{",
+
+/* 54 */
+"\\pgftext[left,at={\\pgfpoint{",
+
+/* 55 */
+"\\pgftext[bottom,at={\\pgfpoint{",
+
+/* 56 */
+"\\pgftext[bottom,right,at={\\pgfpoint{",
+
+/* 57 */
+"\\pgftext[bottom,left,at={\\pgfpoint{",
+
+/* 58 */
+"\\pgftext[base,at={\\pgfpoint{",
+
+/* 59 */
+"\\pgftext[base,right,at={\\pgfpoint{",
+
+/* 60 */
+"\\pgftext[base,left,at={\\pgfpoint{",
+
+/* 61 */
+"bp}}",
+
+/* 62 */
+"\\smash{",
+
+/* 63 */
+"}",
+
+/* 64 */
+"}}",
+
+/* 65 */
+"{",
+
+/* 66 */
+"\\pgfdeclareimage[width=1bp,height=1bp",
+
+/* 67 */
+",interpolate=true",
+
+/* 68 */
+"]{PPPTim",
+
+/* 69 */
+"}{",
+
+/* 70 */
+"}%\n",
+
+/* 71 */
+"\\definecolor{PPPTcn}{gray}{1}\\pgfsetfillcolor{PPPTcn}\n",
+
+/* 72 */
+"\\PPPTfo",
+
+/* 73 */
+"{}",
+
+/* 74 */
+"\\colorbox{white}{",
+
+/* 75 */
+"\\ovalbox{",
+
+/* 76 */
+"]{",
+
+/* 77 */
+",rotate=",
+
+NULL
+
+
+#line 268 "dk4grpgf.ctr"
+};
+
+
+
+/** Compare page structures by number or a page against a number.
+ @param l Left page object.
+ @param r Right page object or page number.
+ @param cr Comparison criteria (0=page/page, 1=page/number).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pgf_compare_pages_by_number(const void *l, const void *r, int cr)
+{
+ const dk4_gra_pgf_page_t *pl;
+ const dk4_gra_pgf_page_t *pr;
+ const size_t *ppno;
+
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pgf_page_t *)l;
+ switch (cr) {
+ case 1: {
+ ppno = (const size_t *)r;
+ if (pl->pageno > *ppno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < *ppno) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ pr = (const dk4_gra_pgf_page_t *)r;
+ if (pl->pageno > pr->pageno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < pr->pageno) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Compare images by UFI (if available) or name.
+ @param l Left image record.
+ @param r Right image record.
+ @param cr Comparison criteria (ignored).
+*/
+static
+int
+dk4gra_pgf_compare_images_by_ufi_and_name(
+ const void *l,
+ const void *r,
+ int DK4_ARG_UNUSED(cr)
+)
+{
+ const dk4_gra_pgf_img_no_t *pl;
+ const dk4_gra_pgf_img_no_t *pr;
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pgf_img_no_t *)l;
+ pr = (const dk4_gra_pgf_img_no_t *)r;
+ if (0 != pl->hufi) {
+ if (0 != pr->hufi) {
+ back = dk4ufi_compare(&(pl->ufi), &(pr->ufi));
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (0 != pr->hufi) {
+ back = -1;
+ }
+ else {
+ if (NULL != pl->fn) {
+ if (NULL != pr->fn) {
+ back = dk4str_pathcmp(pl->fn, pr->fn);
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != pr->fn) {
+ back = -1;
+ }
+ }
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Compare images by image number.
+ @param l Left image record.
+ @param r Right image record.
+ @param cr Comparison criteria (ignored).
+*/
+static
+int
+dk4gra_pgf_compare_images_by_number(
+ const void *l,
+ const void *r,
+ int DK4_ARG_UNUSED(cr)
+)
+{
+ const dk4_gra_pgf_img_no_t *pl;
+ const dk4_gra_pgf_img_no_t *pr;
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pgf_img_no_t *)l;
+ pr = (const dk4_gra_pgf_img_no_t *)r;
+ if (pl->imgno > pr->imgno) {
+ back = 1;
+ }
+ else {
+ if (pl->imgno < pr->imgno) {
+ back = -1;
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Issue one keyword to stream.
+ @param os Output stream to write to.
+ @param kwi Keyword index in dk4gra_pgf_kw array.
+ @param backptr Address of success variable, reset to 0 on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_pgf_stream_kw(
+ dk4_stream_t *os,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_string(os, dk4gra_pgf_kw[kwi], backptr, erp);
+}
+
+
+
+/** Issue one keyword to the page memory stream.
+ @param bptr Current page.
+ @param kwi Keyword index in dk4gra_pgf_kw array.
+ @param backptr Address of success variable, reset to 0 on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_pgf_page_kw(
+ dk4_gra_pgf_page_t *bptr,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ dk4gra_pgf_stream_kw(bptr->memstrm, kwi, backptr, erp);
+}
+
+
+
+/** Change stroking or non-stroking color.
+ @param os Output stream to write to.
+ @param cactive Active color.
+ @param crequested Requested color.
+ @param fi Flag: Change fill (non-stroking) color.
+ @param ptrback Address of success variable, reset to 0 on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+static
+void
+dk4gra_pgf_set_color_if_necessary(
+ dk4_stream_t *os,
+ dk4gra_col_t *cactive,
+ dk4gra_col_t *crequested,
+ int fi,
+ int *ptrback,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != cactive);
+ assert(NULL != crequested);
+#endif
+ if (dk4gratool_colors_differ(cactive, crequested)) {
+ switch (crequested->what) {
+ case DK4_GRA_COL_SPEC_GRAY : {
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 5 : 4), ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.gray, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 11 : 10), ptrback, erp);
+ } break;
+ case DK4_GRA_COL_SPEC_CMYK : {
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 9 : 8), ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.cmyk.c, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.cmyk.m, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.cmyk.y, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.cmyk.k, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 11 : 10), ptrback, erp);
+ } break;
+ default : {
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 7 : 6), ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.rgb.r, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.rgb.g, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.rgb.b, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 11 : 10), ptrback, erp);
+ } break;
+ }
+ dk4mem_cpy(cactive, crequested, sizeof(dk4gra_col_t), erp);
+ }
+}
+
+
+
+/** Write set dash instruction.
+ @param bptr Current page.
+ @param da Array containing the dash length values.
+ @param szda Number of elements in da.
+ @param offs Initial dash offset.
+ @param ptrback Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+static
+void
+dk4gra_pgf_dash_out(
+ dk4_gra_pgf_page_t *bptr,
+ const double *da,
+ size_t szda,
+ double offs,
+ int *ptrback,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != da);
+ assert(0 < szda);
+#endif
+ /* setdash{ */
+ dk4gra_pgf_page_kw(bptr, 14, ptrback, erp);
+ for (i = 0; i < szda; i++) {
+ /* { */
+ dk4gra_pgf_page_kw(bptr, 16, ptrback, erp);
+ /* One dash length */
+ dk4gratool_stream_double(bptr->memstrm, da[i], ptrback, erp);
+ /* bp} */
+ dk4gra_pgf_page_kw(bptr, 17, ptrback, erp);
+ }
+ /* }{ */
+ dk4gra_pgf_page_kw(bptr, 15, ptrback, erp);
+ /* Initial dash offset */
+ dk4gratool_stream_double(bptr->memstrm, offs, ptrback, erp);
+ /* bp} */
+ dk4gra_pgf_page_kw(bptr, 13, ptrback, erp);
+}
+
+
+
+/** Initialize image record.
+ @param imgptr Image record to initialize.
+ @param fn File name, may be NULL.
+ @param imgno Image number.
+ @param ii Flag: Allow image interpolation.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if src is a NULL pointer,
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if no memory is available.
+*/
+static
+int
+dk4gra_pgf_img_init(
+ dk4_gra_pgf_img_no_t *imgptr,
+ const dkChar *fn,
+ size_t imgno,
+ int ii,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != imgptr);
+ assert(NULL != fn);
+#endif
+ /* Default values for all components
+ */
+ DK4_MEMRES(imgptr,sizeof(dk4_gra_pgf_img_no_t));
+ imgptr->fn = NULL;
+ imgptr->imgno = imgno;
+ imgptr->hufi = 0;
+ imgptr->intp = ii;
+ /*
+ Retrieve unique file identifier and other setup for file.
+ */
+ if (NULL != fn) {
+ imgptr->hufi = dk4ufi_get(&(imgptr->ufi), fn, NULL);
+ imgptr->fn = dk4str_dup(fn, erp);
+ if (NULL != imgptr->fn) {
+ back = 1;
+ }
+ }
+ return back;
+}
+
+
+
+void
+dk4gra_pgf_img_close(dk4_gra_pgf_img_no_t *imgptr)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != imgptr);
+#endif
+ if (NULL != imgptr) {
+ dk4mem_release(imgptr->fn);
+ dk4mem_free(imgptr);
+ }
+}
+
+
+
+dk4_gra_pgf_img_no_t *
+dk4gra_pgf_img_open(const dkChar *fn, size_t imgno, int ii, dk4_er_t *erp)
+{
+ dk4_gra_pgf_img_no_t *back = NULL;
+ int ok = 0;
+
+
+#line 718 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == fn) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Allocate memory
+ */
+ back = dk4mem_new(dk4_gra_pgf_img_no_t,1,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* Initialize record components
+ */
+ if (0 == dk4gra_pgf_img_init(back, fn, imgno, ii, erp)) {
+ goto finished;
+ }
+
+ ok = 1;
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pgf_img_close(back);
+ back = NULL;
+ }
+
+
+#line 747 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+/** Write keyword to stream, reset success variable on errors.
+ @param ostrm Stream to write to.
+ @param kwi Keyword index in array.
+ @param bptr Address of success variable.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_pgf_kw_to_stream(
+ dk4_stream_t *ostrm,
+ size_t kwi,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+#endif
+ dk4gratool_stream_string(ostrm, dk4gra_pgf_kw[kwi], bptr, erp);
+}
+
+
+
+/** Write the font definitions.
+ @param ostrm Output stream.
+ @param gra Graphics structure.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+static
+void
+dk4gra_pgf_font_definitions(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != ostrm);
+#endif
+ dk4gratool_font_definitions(ostrm, gra->out.pgf.fc, backptr, erp);
+}
+
+
+
+/** Write the image definitions.
+ @param ostrm Output stream.
+ @param gra Graphics structure.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if one of the buffers to read locale settings is too small,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_pgf_image_definitions(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_CHAR_SIZE > 1
+ char buf[DK4_MAX_PATH];
+#endif
+ dkChar lang[16];
+ dkChar reg[16];
+ dk4_gra_pgf_img_no_t *tptr;
+#if DK4_CHAR_SIZE > 1
+ char *bufptr;
+#endif
+ int enc;
+ int res;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != ostrm);
+#endif
+ res = dk4loc_get_settings(
+ lang, DK4_SIZEOF(lang,dkChar), reg, DK4_SIZEOF(reg,dkChar), &enc, erp
+ );
+ if (0 == res) {
+#if DK4_ON_WINDOWS
+ enc = DK4_FILE_ENCODING_WIN1252;
+#else
+ enc = DK4_FILE_ENCODING_PLAIN;
+#endif
+ }
+
+ dk4sto_it_reset(gra->out.pgf.i_imagno);
+ do {
+ tptr = (dk4_gra_pgf_img_no_t *)dk4sto_it_next(gra->out.pgf.i_imagno);
+ if (NULL != tptr) {
+ dk4gra_pgf_kw_to_stream(ostrm, 66, backptr, erp);
+ if (0 != tptr->intp) {
+ dk4gra_pgf_kw_to_stream(ostrm, 67, backptr, erp);
+ }
+ dk4gra_pgf_kw_to_stream(ostrm, 68, backptr, erp);
+ /* NUMBER */
+ dk4gratool_stream_num_alpha(ostrm, tptr->imgno, backptr, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 69, backptr, erp);
+ /* FILE NAME */
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ res = dk4recode_dk_to_any(
+ buf, sizeof(buf), DK4_FILE_ENCODING_WIN1252,
+ tptr->fn, DK4_ENCODING_32, erp
+ );
+#else
+ res = dk4recode_dk_to_any(
+ buf, sizeof(buf), DK4_FILE_ENCODING_WIN1252,
+ tptr->fn, DK4_ENCODING_UTF16, erp
+ );
+#endif
+ if (0 != res) {
+ bufptr = buf;
+ while ('\0' != *bufptr) {
+ if ('\\' == *bufptr) { *bufptr = '/'; }
+ bufptr++;
+ }
+ dk4gratool_stream_string(ostrm, buf, backptr, erp);
+ }
+#else
+ dk4gratool_stream_string(ostrm, tptr->fn, backptr, erp);
+#endif
+ dk4gra_pgf_kw_to_stream(ostrm, 70, backptr, erp);
+ }
+ } while (NULL != tptr);
+}
+
+
+
+/** Write one page to output stream.
+ @param ostrm Output stream.
+ @param gra Graphics the page is from.
+ @param page Page to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_CLOSE_FAILED<br>
+ if closing downward data failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
+*/
+static
+int
+dk4gra_pgf_one_page(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ dk4_gra_pgf_page_t *page,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != ostrm);
+ assert(NULL != page);
+#endif
+ if (NULL != page->memstrm) {
+ back = 1;
+ if (0 == dk4stream_close(page->memstrm, erp)) {
+ back = 0;
+ }
+ page->memstrm = NULL;
+
+ /* begin{pgfpicture}
+ */
+ dk4gra_pgf_kw_to_stream(ostrm, 44, &back, erp);
+
+ /* Font and image definitions
+ */
+ if (0 == gra->out.pgf.sa) {
+ dk4gra_pgf_font_definitions(ostrm, gra, &back, erp);
+ dk4gra_pgf_image_definitions(ostrm, gra, &back, erp);
+ }
+
+ /* Bounding box path
+ */
+ dk4gra_pgf_kw_to_stream(ostrm, 46, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->w, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 33, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->h, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 34, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 30, &back, erp);
+
+ /* Clip path
+ */
+ if (0 == ((page->flags) & DK4_GRA_PAGE_FLAG_NO_CLIP)) {
+ dk4gra_pgf_kw_to_stream(ostrm, 1, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 46, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->w, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 33, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->h, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 34, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 29, &back, erp);
+ }
+
+ /* White background
+ */
+ if (0 == ((page->flags) & DK4_GRA_PAGE_FLAG_NO_BG)) {
+ dk4gra_pgf_kw_to_stream(ostrm, 71, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 46, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->w, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 33, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->h, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 34, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 26, &back, erp);
+ }
+
+
+ /* Contents
+ */
+ if (NULL != page->membuf) {
+ if (0 == dk4membuf_to_stream(ostrm, page->membuf, erp)) {
+ back = 0;
+ }
+ }
+ else {
+ back = 0;
+ }
+
+ /* End clipping
+ */
+ if (0 == ((page->flags) & DK4_GRA_PAGE_FLAG_NO_CLIP)) {
+ dk4gra_pgf_kw_to_stream(ostrm, 2, &back, erp);
+ }
+
+ /* end{pgfpicture}
+ */
+ dk4gra_pgf_kw_to_stream(ostrm, 45, &back, erp);
+ }
+ else {
+ /* ERROR: No memstream */
+ }
+ return back;
+}
+
+
+
+/** Write output file.
+ @param fout Output file to write.
+ @param gra Graphics to write to file.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_CLOSE_FAILED<br>
+ if closing downward data failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
+*/
+static
+int
+dk4gra_pgf_file(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr = NULL;
+ dk4_stream_t *ostrm = NULL;
+ int back = 0;
+ int hadpage = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ ostrm = dk4stream_open_for_file(fout, DK4_STREAM_WRITE, 0, 0, erp);
+ if (NULL != ostrm) {
+ back = 1;
+ /*
+ Start of standalone document
+ */
+ if (0 != gra->out.pgf.sa) {
+ dk4gratool_start_standalone_document(
+ ostrm, gra, 1,
+ gra->out.pgf.dfs,
+ gra->out.pgf.s_prelfo, gra->out.pgf.i_prelfo,
+ gra->out.pgf.s_prelpa, gra->out.pgf.i_prelpa,
+ gra->out.pgf.s_prelot, gra->out.pgf.i_prelot,
+ &back, erp
+ );
+ dk4gra_pgf_font_definitions(ostrm, gra, &back, erp);
+ dk4gra_pgf_image_definitions(ostrm, gra, &back, erp);
+ }
+ /*
+ Page contents
+ */
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pgf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ if (0 != hadpage) {
+ dk4gra_pgf_page_kw(bptr, 43, &back, erp);
+ }
+ if (0 == dk4gra_pgf_one_page(ostrm, gra, bptr, erp)) {
+ back = 0;
+ }
+ hadpage = 1;
+ }
+ } while (NULL != bptr);
+ /*
+ End of standalone document
+ */
+ if (0 != gra->out.pgf.sa) {
+ dk4gratool_end_standalone_document(ostrm, &back, erp);
+ }
+ }
+
+ if (NULL != ostrm) {
+ if (0 == dk4stream_close(ostrm, erp)) {
+ back = 0;
+ }
+ }
+ return back;
+}
+
+
+
+/** Delete PGF page structure, release resources.
+ @param pageptr Page to release.
+*/
+static
+void
+dk4gra_pgf_page_delete(dk4_gra_pgf_page_t *pageptr)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pageptr);
+#endif
+ if (NULL != pageptr) {
+ if (NULL != pageptr->memstrm) {
+ dk4stream_close(pageptr->memstrm, NULL);
+ }
+ pageptr->memstrm = NULL;
+ if (NULL != pageptr->membuf) {
+ dk4membuf_close(pageptr->membuf);
+ }
+ pageptr->membuf = NULL;
+ dk4mem_free(pageptr);
+ }
+}
+
+
+
+/** Create PGF page structure, allocate resources.
+ @param pageno Page number.
+ @param flags Flags.
+ @param erp Error report.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating a memory allocation size,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+static
+dk4_gra_pgf_page_t *
+dk4gra_pgf_page_new(
+ size_t pageno,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *back = NULL;
+ int ok = 0;
+
+
+#line 1180 "dk4grpgf.ctr"
+ /* Allocate structure
+ */
+ back = dk4mem_new(dk4_gra_pgf_page_t,1,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* Initialize components to defaults
+ */
+ DK4_MEMRES(back,sizeof(dk4_gra_pgf_page_t));
+ dk4gratool_initialize_attributes(&(back->attr));
+ dk4gratool_initialize_attributes(&(back->catt));
+ back->membuf = NULL;
+ back->memstrm = NULL;
+ back->pageno = pageno;
+ back->flags = flags;
+ /*
+ Allocate memory buffer and stream
+ */
+ back->membuf = dk4membuf_open(erp);
+ if (NULL == back->membuf) {
+ goto finished;
+ }
+ back->memstrm = dk4stream_open_membuf_writer(back->membuf, erp);
+ if (NULL == back->memstrm) {
+ goto finished;
+ }
+ /* Indicate success
+ */
+ ok = 1;
+
+ /* Clean up if neccessary, return
+ */
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pgf_page_delete(back);
+ back = NULL;
+ }
+
+
+#line 1218 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+/** Delete all preamble lines from a storage/iterator pair.
+ @param pot Address of storage pointer.
+ @param pit Address of iterator pointer.
+*/
+static
+void
+dk4gra_pgf_doc_preamble_close(
+ dk4_sto_t **pot,
+ dk4_sto_it_t **pit
+)
+{
+ dk4_gra_preamble_line_t *pl;
+ if (NULL != *pot) {
+ if (NULL != *pit) {
+ dk4sto_it_reset(*pit);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(*pit);
+ if (NULL != pl) {
+ dk4gratool_preamble_delete(pl);
+ }
+ } while (NULL != pl);
+ dk4sto_it_close(*pit);
+ *pit = NULL;
+ }
+ dk4sto_close(*pot);
+ *pot = NULL;
+ }
+ *pot = NULL;
+ *pit = NULL;
+}
+
+
+
+void
+dk4gra_pgf_close(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pgf_img_no_t *imgptr;
+
+
+#line 1263 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ goto finished;
+ }
+ if (NULL != gra->out.pgf.fc) {
+ dk4fontc_close(gra->out.pgf.fc);
+ gra->out.pgf.fc = NULL;
+ }
+ if (NULL != gra->out.pgf.s_imagno) {
+ if (NULL != gra->out.pgf.i_imagno) {
+ dk4sto_it_close(gra->out.pgf.i_imagno);
+ }
+ dk4sto_close(gra->out.pgf.s_imagno);
+ gra->out.pgf.s_imagno = NULL;
+ }
+ if (NULL != gra->out.pgf.s_images) {
+ if (NULL != gra->out.pgf.i_images) {
+ dk4sto_it_reset(gra->out.pgf.i_images);
+ do {
+ imgptr = (dk4_gra_pgf_img_no_t *)dk4sto_it_next(
+ gra->out.pgf.i_images
+ );
+ if (NULL != imgptr) {
+ dk4gra_pgf_img_close(imgptr);
+ }
+ } while (NULL != imgptr);
+ dk4sto_it_close(gra->out.pgf.i_images);
+ }
+ dk4sto_close(gra->out.pgf.s_images);
+ gra->out.pgf.s_images = NULL;
+ }
+ dk4gra_pgf_doc_preamble_close(
+ &(gra->out.pgf.s_prelfo), &(gra->out.pgf.i_prelfo)
+ );
+ dk4gra_pgf_doc_preamble_close(
+ &(gra->out.pgf.s_prelpa), &(gra->out.pgf.i_prelpa)
+ );
+ dk4gra_pgf_doc_preamble_close(
+ &(gra->out.pgf.s_prelot), &(gra->out.pgf.i_prelot)
+ );
+ dk4gratool_close(gra);
+
+ finished:
+
+
+#line 1309 "dk4grpgf.ctr"
+ return;
+}
+
+
+
+dk4_gra_t *
+dk4gra_pgf_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ int ok = 0;
+
+
+#line 1327 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert(0 < w);
+ assert(0 < h);
+#endif
+
+
+#line 1333 "dk4grpgf.ctr"
+ /*
+ Generic initialization
+ */
+ back = dk4gratool_open(fn, w, h, docfl, erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* PGF-specific default initialization
+ */
+ back->dr = DK4_GRA_DRIVER_PGF;
+ back->out.pgf.fc = NULL;
+ back->out.pgf.s_imagno = NULL;
+ back->out.pgf.i_imagno = NULL;
+ back->out.pgf.s_images = NULL;
+ back->out.pgf.i_images = NULL;
+ back->out.pgf.s_prelfo = NULL;
+ back->out.pgf.i_prelfo = NULL;
+ back->out.pgf.s_prelpa = NULL;
+ back->out.pgf.i_prelpa = NULL;
+ back->out.pgf.s_prelot = NULL;
+ back->out.pgf.i_prelot = NULL;
+ back->out.pgf.dfs = -1.0;
+ back->out.pgf.n_images = 0;
+ back->out.pgf.n_prelfo = 0;
+ back->out.pgf.n_prelpa = 0;
+ back->out.pgf.n_prelot = 0;
+ back->out.pgf.sa = sa;
+ /* Pages storage and iterator.
+ */
+ back->s_pages = dk4sto_open(erp);
+ if (NULL == back->s_pages) {
+
+#line 1364 "dk4grpgf.ctr"
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->s_pages, dk4gra_pgf_compare_pages_by_number, 0);
+ back->i_pages = dk4sto_it_open(back->s_pages, erp);
+ if (NULL == back->i_pages) {
+
+#line 1369 "dk4grpgf.ctr"
+ goto finished;
+ }
+ /*
+ Allocate resources
+ */
+ back->out.pgf.fc = dk4fontc_open(erp);
+ if (NULL == back->out.pgf.fc) {
+ goto finished;
+ }
+ back->out.pgf.s_imagno = dk4sto_open(erp);
+ if (NULL == back->out.pgf.s_imagno) {
+ goto finished;
+ }
+ back->out.pgf.s_images = dk4sto_open(erp);
+ if (NULL == back->out.pgf.s_images) {
+ goto finished;
+ }
+ dk4sto_set_comp(
+ back->out.pgf.s_imagno,
+ dk4gra_pgf_compare_images_by_number, 0
+ );
+ dk4sto_set_comp(
+ back->out.pgf.s_images,
+ dk4gra_pgf_compare_images_by_ufi_and_name, 0
+ );
+ back->out.pgf.i_imagno = dk4sto_it_open(back->out.pgf.s_imagno, erp);
+ if (NULL == back->out.pgf.i_imagno) {
+ goto finished;
+ }
+ back->out.pgf.i_images = dk4sto_it_open(back->out.pgf.s_images, erp);
+ if (NULL == back->out.pgf.i_images) {
+ goto finished;
+ }
+
+ /* Finally indicate success
+ */
+ ok = 1;
+
+ /* Cleanup section, destroy object if not completely initialized
+ */
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pgf_close(back);
+ back = NULL;
+ }
+
+
+#line 1415 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 1429 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ back = dk4gra_pgf_file(fout, gra, erp);
+ dk4gra_pgf_close(gra);
+
+
+#line 1436 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *newpage = NULL;
+ int back = 0;
+
+
+#line 1451 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ /*
+ Check for page number overflow
+ */
+ if (SIZE_MAX == gra->pages) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ goto finished;
+ }
+ /* Allocate resources for new page
+ */
+ newpage = dk4gra_pgf_page_new(gra->pages, flags, erp);
+ if (NULL == newpage) {
+ goto finished;
+ }
+ /* Save new page in pages storage.
+ */
+ if (0 == dk4sto_add(gra->s_pages, newpage, erp)) {
+ dk4gra_pgf_page_delete(newpage);
+ goto finished;
+ }
+ /* Update pages number
+ */
+ gra->pages += 1;
+ gra->curpg = newpage;
+ back = 1;
+
+ finished:
+
+
+#line 1481 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1495 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 1, &back, erp);
+
+ finished:
+
+
+#line 1508 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1522 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 2, &back, erp);
+
+ finished:
+
+
+#line 1535 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1550 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lw_requested = lw;
+
+ finished:
+
+
+#line 1563 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1579 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.ls_requested = ls;
+ bptr->attr.sv_requested = sv;
+
+ finished:
+
+
+#line 1593 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1608 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lc_requested = lc;
+
+ finished:
+
+
+#line 1621 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1637 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lj_requested = lj;
+ bptr->attr.ml_requested = ml;
+ if (1.0 > bptr->attr.ml_requested) {
+ bptr->attr.ml_requested = 1.0;
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+ finished:
+
+
+#line 1656 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1671 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_fill_requested.data.gray = g;
+
+ finished:
+
+
+#line 1685 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1702 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_RGB;
+ bptr->attr.col_fill_requested.data.rgb.r = r;
+ bptr->attr.col_fill_requested.data.rgb.g = g;
+ bptr->attr.col_fill_requested.data.rgb.b = b;
+
+ finished:
+
+
+#line 1718 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1736 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_CMYK;
+ bptr->attr.col_fill_requested.data.cmyk.c = c;
+ bptr->attr.col_fill_requested.data.cmyk.m = m;
+ bptr->attr.col_fill_requested.data.cmyk.y = y;
+ bptr->attr.col_fill_requested.data.cmyk.k = k;
+
+ finished:
+
+
+#line 1753 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1768 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_stroke_requested.data.gray = g;
+
+ finished:
+
+
+#line 1782 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1799 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_RGB;
+ bptr->attr.col_stroke_requested.data.rgb.r = r;
+ bptr->attr.col_stroke_requested.data.rgb.g = g;
+ bptr->attr.col_stroke_requested.data.rgb.b = b;
+
+ finished:
+
+
+#line 1815 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1833 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_CMYK;
+ bptr->attr.col_stroke_requested.data.cmyk.c = c;
+ bptr->attr.col_stroke_requested.data.cmyk.m = m;
+ bptr->attr.col_stroke_requested.data.cmyk.y = y;
+ bptr->attr.col_stroke_requested.data.cmyk.k = k;
+
+ finished:
+
+
+#line 1850 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+
+int
+dk4gra_pgf_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+
+
+#line 1865 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_set_color_if_necessary(
+ bptr->memstrm,
+ &(bptr->attr.col_fill_active), &(bptr->attr.col_fill_requested),
+ 1, &back, erp
+ );
+ if (gra->eor != bptr->attr.eor_active) {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_kw[(0 != gra->eor) ? (47) : (48)],
+ &back, erp
+ );
+ bptr->attr.eor_active = gra->eor;
+ }
+
+ finished:
+
+
+#line 1889 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ double da[16]; /* Dash array */
+ double gw = 0.0; /* Gap width in dash pattern */
+ int back = 0; /* Function result */
+ int lwc = 0; /* Flag line width or style changed */
+
+
+#line 1906 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ /*
+ Stroke color
+ */
+ dk4gra_pgf_set_color_if_necessary(
+ bptr->memstrm,
+ &(bptr->attr.col_stroke_active), &(bptr->attr.col_stroke_requested),
+ 0, &back, erp
+ );
+ /* Line width
+ */
+ if (
+ DK4_GRA_EPSILON_LINEWIDTH
+ < fabs(bptr->attr.lw_active - bptr->attr.lw_requested)
+ ) {
+ dk4gra_pgf_page_kw(bptr, 12, &back, erp);
+ dk4gratool_stream_double(
+ bptr->memstrm, bptr->attr.lw_requested, &back, erp
+ );
+ dk4gra_pgf_page_kw(bptr, 13, &back, erp);
+ bptr->attr.lw_active = bptr->attr.lw_requested;
+ lwc = 1;
+ }
+ /* Line style
+ */
+ lwc = dk4gratool_line_style_differs(
+ bptr->attr.ls_active, bptr->attr.ls_requested,
+ bptr->attr.sv_active, bptr->attr.sv_requested,
+ lwc
+ );
+ if (0 != lwc) {
+ gw = (bptr->attr.sv_requested + bptr->attr.lw_requested) / 2.0;
+ if ((2.0 * bptr->attr.lw_requested) < gw) {
+ gw = 2.0 * bptr->attr.lw_requested;
+ }
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : case DK4_GRA_LC_PROJECTING : {
+ gw += bptr->attr.lw_requested;
+ } break;
+ }
+ switch (bptr->attr.ls_requested) {
+ case DK4_GRA_LS_DASH : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ dk4gra_pgf_dash_out(bptr, da, 2, (da[0] / 2.0), &back, erp);
+ } break;
+ case DK4_GRA_LS_DOT : {
+ da[0] = da[1] = bptr->attr.lw_requested;
+ dk4gra_pgf_dash_out(bptr, da, 2, (da[0] / 2.0), &back, erp);
+ } break;
+ case DK4_GRA_LS_DASH_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ dk4gra_pgf_dash_out(bptr, da, 4, (da[0] / 2.0), &back, erp);
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_requested;
+ da[5] = gw;
+ dk4gra_pgf_dash_out(bptr, da, 6, (da[0] / 2.0), &back, erp);
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_requested;
+ da[5] = gw;
+ da[6] = bptr->attr.lw_requested;
+ da[7] = gw;
+ dk4gra_pgf_dash_out(bptr, da, 8, (da[0] / 2.0), &back, erp);
+ } break;
+ default : {
+ dk4gra_pgf_dash_out(bptr, da, 0, 0.0, &back, erp);
+ } break;
+ }
+ bptr->attr.ls_active = bptr->attr.ls_requested;
+ bptr->attr.sv_active = bptr->attr.sv_requested;
+ }
+ /* Line cap
+ */
+ if (bptr->attr.lc_active != bptr->attr.lc_requested) {
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : {
+ dk4gra_pgf_page_kw(bptr, 19, &back, erp);
+ } break;
+ case DK4_GRA_LC_PROJECTING : {
+ dk4gra_pgf_page_kw(bptr, 20, &back, erp);
+ } break;
+ default : {
+ dk4gra_pgf_page_kw(bptr, 18, &back, erp);
+ } break;
+ }
+ bptr->attr.lc_active = bptr->attr.lc_requested;
+ }
+ /* Line join
+ */
+ if (bptr->attr.lj_active != bptr->attr.lj_requested) {
+ switch (bptr->attr.lj_requested) {
+ case DK4_GRA_LJ_ROUNDED : {
+ dk4gra_pgf_page_kw(bptr, 21, &back, erp);
+ } break;
+ case DK4_GRA_LJ_BEVELED : {
+ dk4gra_pgf_page_kw(bptr, 22, &back, erp);
+ } break;
+ default : {
+ dk4gra_pgf_page_kw(bptr, 23, &back, erp);
+ } break;
+ }
+ bptr->attr.lj_active = bptr->attr.lj_requested;
+ }
+ if (DK4_GRA_LJ_MITERED == bptr->attr.lj_active) {
+ if (
+ DK4_GRA_EPSILON_MITERLIMIT
+ < fabs(bptr->attr.ml_active - bptr->attr.ml_requested)
+ ) {
+ dk4gra_pgf_page_kw(bptr, 24, &back, erp);
+ dk4gratool_stream_double(
+ bptr->memstrm, bptr->attr.ml_requested, &back, erp
+ );
+ dk4gra_pgf_page_kw(bptr, 25, &back, erp);
+ bptr->attr.ml_active = bptr->attr.ml_requested;
+ }
+ }
+
+
+ finished:
+
+
+#line 2047 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back;
+
+
+#line 2060 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ back = dk4gra_pgf_prepare_fill(gra, erp);
+ if (0 == dk4gra_pgf_prepare_stroke(gra, erp)) {
+ back = 0;
+ }
+
+
+#line 2068 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2082 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 26, &back, erp);
+
+ finished:
+
+
+#line 2095 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2110 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 27, &back, erp);
+
+ finished:
+
+
+#line 2123 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2137 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 28, &back, erp);
+
+ finished:
+
+
+#line 2150 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2164 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 29, &back, erp);
+
+ finished:
+
+
+#line 2177 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2193 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 31, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, x, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, y, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+
+
+
+#line 2209 "dk4grpgf.ctr"
+ finished:
+
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2227 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 32, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, x, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, y, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+
+
+
+#line 2243 "dk4grpgf.ctr"
+ finished:
+
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2265 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 35, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xc1, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yc1, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 36, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xc2, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yc2, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 36, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, x, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, y, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+
+ finished:
+
+
+#line 2290 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2304 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 37, &back, erp);
+
+ finished:
+
+
+#line 2317 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2334 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 38, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xc, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yc, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 39, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, r, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 25, &back, erp);
+
+ finished:
+
+
+#line 2353 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+
+
+#line 2372 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ if (0.0 < r) {
+ /* Open TeX scope */
+ dk4gra_pgf_page_kw(bptr, 40, &back, erp);
+ /* Set corner radius */
+ dk4gra_pgf_page_kw(bptr, 41, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, r, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, r, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+ }
+ /* Draw rectangle by two corners */
+ dk4gra_pgf_page_kw(bptr, 42, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xl, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yb, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 36, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xr, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yt, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+ if (0.0 < r) {
+ /* Close Tex scope */
+ dk4gra_pgf_page_kw(bptr, 25, &back, erp);
+ }
+
+ finished:
+
+
+#line 2408 "dk4grpgf.ctr"
+ return back;
+}
+
+
+
+/** Handle text.
+ @param gra Graphics structure.
+ @param x X position of text.
+ @param y Y position of text.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to write.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding for simple text specified as char.
+ @param ha Horizontal alignment of text origin.
+ @param va Vertical alignment of text origin.
+ @param isnt Flag: Is normal text, no special text.
+ @param fno Font number, DK4_FONT_TIMES_ROMAN and others.
+ @param fsz Font size in pt.
+ @param fex Exactness of font, DK4_GRA_TF_EXACT_SIZE and others.
+ @param uc2l Unicode to LaTeX converter to use for normal text.
+ @param flags Flags.
+ @param backptr Address of suuccess variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pgf_i_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const void *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int isnt,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ size_t fontno = 0;
+ size_t kwi = 60;
+ int back = 0;
+ int dorot = 0;
+
+
+#line 2460 "dk4grpgf.ctr"
+ if ((NULL == gra) || (NULL == txt)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (DK4_GRA_DRIVER_PGF != gra->dr) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (1.0e-8 < fabs(rot)) { dorot = 1; }
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 != isnt) {
+ if (0 == dk4fontc_add_font(&fontno, gra->out.pgf.fc, fno, fsz, fex, erp)) {
+ goto finished;
+ }
+ }
+ switch (va) {
+ case DK4_TEXT_ALIGN_V_TOP : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 49;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 50;
+ } break;
+ default : { /* left */
+ kwi = 51;
+ } break;
+ }
+ } break;
+ case DK4_TEXT_ALIGN_V_CENTERED : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 52;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 53;
+ } break;
+ default : { /* left */
+ kwi = 54;
+ } break;
+ }
+ } break;
+ case DK4_TEXT_ALIGN_V_BOTTOM : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 55;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 56;
+ } break;
+ default : { /* left */
+ kwi = 57;
+ } break;
+ }
+ } break;
+ default : { /* base */
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 58;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 59;
+ } break;
+ default : { /* left */
+ kwi = 60;
+ } break;
+ }
+ } break;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, kwi, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, x, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, y, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 61, &back, erp);
+ if (0 != dorot) {
+ dk4gra_pgf_page_kw(bptr, 77, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, rot, &back, erp);
+ }
+ dk4gra_pgf_page_kw(bptr, 76, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 65, &back, erp);
+ /*
+ White box if required
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_WHITE_BOX & flags)) {
+ dk4gra_pgf_page_kw(bptr, 65, &back, erp);
+ }
+ /*
+ Use either specified color from colspec or fill color
+ */
+ if (NULL != colspec) {
+ if (0 == dk4stream_write_char_string(bptr->memstrm, colspec, erp)) {
+ back = 0;
+ }
+ }
+ else {
+ dk4gratool_stream_color(
+ bptr->memstrm, &(bptr->attr.col_fill_requested), &back, erp
+ );
+ }
+ /*
+ Open oval box if required
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_OVAL_BOX & flags)) {
+ dk4gra_pgf_page_kw(bptr, 75, &back, erp);
+ }
+ /*
+ Switch font
+ */
+ if (0 != isnt) {
+ dk4gra_pgf_page_kw(bptr, 72, &back, erp);
+ dk4gratool_stream_num_alpha(bptr->memstrm, fontno, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 73, &back, erp);
+ }
+ /*
+ Write text
+ */
+ if (0 != isnt) {
+ if (
+ 0 ==
+ dk4uc2l_string_dk(bptr->memstrm, uc2l, (const dkChar *)txt, ie, erp)
+ )
+ {
+ back = 0;
+ }
+ }
+ else {
+ if (
+ 0 ==
+ dk4stream_write_char_string(bptr->memstrm, (const char *)txt, erp)
+ )
+ {
+ back = 0;
+ }
+ }
+ /* Close oval box if required
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_OVAL_BOX & flags)) {
+ dk4gra_pgf_page_kw(bptr, 63, &back, erp);
+ }
+ /* Close white box if required
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_WHITE_BOX & flags)) {
+ dk4gra_pgf_page_kw(bptr, 63, &back, erp);
+ }
+ dk4gra_pgf_page_kw(bptr, 64, &back, erp);
+#if 0
+ if (0 != dorot) {
+ }
+#endif
+ dk4gra_pgf_page_kw(bptr, 0, &back, erp);
+
+ finished:
+
+
+#line 2618 "dk4grpgf.ctr"
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_pgf_simple_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != txt);
+#endif
+ dk4gra_pgf_i_text(
+ gra, x, y, rot, txt, colspec, ie, ha, va, 1, fno, fsz, fex, uc2l,
+ flags, backptr, erp
+ );
+}
+
+
+
+void
+dk4gra_pgf_simple_utf8_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != txt);
+#endif
+ dk4gra_pgf_i_text(
+ gra, x, y, rot, txt, colspec, DK4_ENCODING_UTF8,
+ ha, va, 1, fno, fsz, fex, uc2l, flags, backptr, erp
+ );
+}
+
+
+
+void
+dk4gra_pgf_special_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != txt);
+#endif
+ dk4gra_pgf_i_text(
+ gra, x, y, rot, txt, colspec,
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252,
+#else
+ DK4_FILE_ENCODING_PLAIN,
+#endif
+ ha, va, 0, fno, fsz, fex, NULL, flags, backptr, erp
+ );
+}
+
+
+
+void
+dk4gra_pgf_save_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->catt),
+ &(bptr->attr),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_pgf_restore_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->attr),
+ &(bptr->catt),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_pgf_reset_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ dk4gratool_reset_active_attributes(&(bptr->attr));
+}
+
+
+
+void
+dk4gra_pgf_doc_font_size(
+ dk4_gra_t *gra,
+ double fs,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2785 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(0.0 < fs);
+ assert(DK4_GRA_DRIVER_PGF == gra->dr);
+#endif
+ if ((NULL != gra) && (0.0 < fs) && (DK4_GRA_DRIVER_PGF == gra->dr)) {
+ if (0 != gra->out.pgf.sa) {
+ gra->out.pgf.dfs = fs;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+
+
+#line 2804 "dk4grpgf.ctr"
+}
+
+
+
+/** Add one configuration line to storage.
+ @param psto Address of container.
+ @param pit Address of container iterator.
+ @param pnum Address of variable storing number of lines.
+ @param textline Text line to add.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pgf_i_preamble_line(
+ dk4_sto_t **psto,
+ dk4_sto_it_t **pit,
+ size_t *pnum,
+ char const *textline,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_preamble_line_t *pl;
+ int back = 0;
+
+
+#line 2830 "dk4grpgf.ctr"
+ if (SIZE_MAX > *pnum) {
+
+#line 2831 "dk4grpgf.ctr"
+ if (NULL == *psto) {
+
+#line 2832 "dk4grpgf.ctr"
+ *psto = dk4sto_open(erp);
+ if (NULL != *psto) {
+
+#line 2834 "dk4grpgf.ctr"
+ dk4sto_set_comp(*psto, dk4gratool_compare_preamble_lines, 0);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2838 "dk4grpgf.ctr"
+ }
+#endif
+ }
+ if (NULL != *psto) {
+ if (NULL == *pit) {
+
+#line 2843 "dk4grpgf.ctr"
+ *pit = dk4sto_it_open(*psto, erp);
+ }
+ if (NULL != *pit) {
+
+#line 2846 "dk4grpgf.ctr"
+ pl = dk4gratool_preamble_new(textline, *pnum, erp);
+ if (NULL != pl) {
+
+#line 2848 "dk4grpgf.ctr"
+ if (0 != dk4sto_add(*psto, pl, erp)) {
+ back = 1;
+
+#line 2850 "dk4grpgf.ctr"
+ }
+ else {
+
+#line 2852 "dk4grpgf.ctr"
+ dk4gratool_preamble_delete(pl);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2857 "dk4grpgf.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2862 "dk4grpgf.ctr"
+ }
+#endif
+ }
+ }
+ else {
+
+#line 2867 "dk4grpgf.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (0 == back) { if (NULL != backptr) { *backptr = 0; } }
+
+
+#line 2871 "dk4grpgf.ctr"
+}
+
+
+
+void
+dk4gra_pgf_doc_preamble_line(
+ dk4_gra_t *gra,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2885 "dk4grpgf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != line);
+ assert(DK4_GRA_DRIVER_PGF == gra->dr);
+#endif
+ if ((NULL != gra) && (NULL != line) && (DK4_GRA_DRIVER_PGF == gra->dr)) {
+ if (0 != gra->out.pgf.sa) {
+ switch (tp) {
+ case DK4_GRA_PREAMBLE_FONT : {
+
+#line 2894 "dk4grpgf.ctr"
+ dk4gra_pgf_i_preamble_line(
+ &(gra->out.pgf.s_prelfo),
+ &(gra->out.pgf.i_prelfo),
+ &(gra->out.pgf.n_prelfo),
+ line,
+ backptr,
+ erp
+ );
+ } break;
+ case DK4_GRA_PREAMBLE_PACKAGE : {
+
+#line 2904 "dk4grpgf.ctr"
+ dk4gra_pgf_i_preamble_line(
+ &(gra->out.pgf.s_prelpa),
+ &(gra->out.pgf.i_prelpa),
+ &(gra->out.pgf.n_prelpa),
+ line,
+ backptr,
+ erp
+ );
+ } break;
+ case DK4_GRA_PREAMBLE_OTHER : {
+
+#line 2914 "dk4grpgf.ctr"
+ dk4gra_pgf_i_preamble_line(
+ &(gra->out.pgf.s_prelot),
+ &(gra->out.pgf.i_prelot),
+ &(gra->out.pgf.n_prelot),
+ line,
+ backptr,
+ erp
+ );
+ } break;
+ default : {
+
+#line 2924 "dk4grpgf.ctr"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ } break;
+ }
+ }
+ else {
+
+#line 2930 "dk4grpgf.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+
+#line 2935 "dk4grpgf.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+
+
+#line 2939 "dk4grpgf.ctr"
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grpgf.ctr b/support/dktools/dk4grpgf.ctr
new file mode 100644
index 0000000000..2f99c5ea2a
--- /dev/null
+++ b/support/dktools/dk4grpgf.ctr
@@ -0,0 +1,2942 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#include "dk4enc.h"
+#endif
+
+#ifndef DK4REC25_H_INCLUDED
+#include "dk4rec25.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4UFIC_H_INCLUDED
+#include "dk4ufic.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRMF_H_INCLUDED
+#include "dk4strmf.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4UFI_H_INCLUDED
+#include "dk4ufi.h"
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include "dk4mao8d.h"
+#endif
+
+#ifndef DK4LOC_H_INCLUDED
+#include "dk4loc.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4FONTC_H_INCLUDED
+#include "dk4fontc.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Constant text fragments for PGF output.
+*/
+static const char * const dk4gra_pgf_kw[] = {
+$!string-table
+#
+# 0 Simple newline
+#
+\n
+#
+# 1 2 Begin and end PGF scope
+#
+\\begin{pgfscope}\n
+\\end{pgfscope}\n
+#
+# 3 Comma
+#
+,
+#
+# 4 11 Color definitions
+#
+\\definecolor{PPPTcs}{gray}{
+\\definecolor{PPPTcn}{gray}{
+\\definecolor{PPPTcs}{rgb}{
+\\definecolor{PPPTcn}{rgb}{
+\\definecolor{PPPTcs}{cmyk}{
+\\definecolor{PPPTcn}{cmyk}{
+}\\pgfsetstrokecolor{PPPTcs}\n
+}\\pgfsetfillcolor{PPPTcn}\n
+#
+# 12 13 Line width
+#
+\\pgfsetlinewidth{
+bp}\n
+#
+# 14 17 Dash
+#
+\\pgfsetdash{
+}{
+{
+bp}
+#
+# 18 20 Line cap
+#
+\\pgfsetbuttcap\n
+\\pgfsetroundcap\n
+\\pgfsetrectcap\n
+#
+# 21 25 Line join
+#
+\\pgfsetroundjoin\n
+\\pgfsetbeveljoin\n
+\\pgfsetmiterjoin\n
+\\pgfsetmiterlimit{
+}\n
+#
+# 26 30 Path usage
+#
+\\pgfusepath{fill}\n
+\\pgfusepath{stroke}\n
+\\pgfusepath{fill,stroke}\n
+\\pgfusepath{clip}\n
+\\pgfusepath{use as bounding box}\n
+#
+# 31 34 Path operations
+#
+\\pgfpathmoveto{\\pgfpoint{
+\\pgfpathlineto{\\pgfpoint{
+bp}{
+bp}}\n
+#
+# 35 36 Curves
+#
+\\pgfpathcurveto{\\pgfpoint{
+bp}}{\\pgfpoint{
+#
+# 37 Closepath
+#
+\\pgfpathclose\n
+#
+# 38 39 Circle
+#
+\\pgfpathcircle{\\pgfpoint{
+bp}}{
+#
+# 40 Open TeX scope
+#
+{\n
+#
+# 41 Arced corners
+#
+\\pgfsetcornersarced{\\pgfpoint{
+#
+# 42 Rectangle by corners
+#
+\\pgfpathrectanglecorners{\\pgfpoint{
+#
+# 43 clearpage
+#
+\\clearpage\n
+#
+# 44-45 begin and end picture
+#
+\\begin{pgfpicture}\n
+\\end{pgfpicture}%\n
+#
+# 46 Path rectangle
+#
+\\pgfpathrectangle{\\pgfpointorigin}{\\pgfpoint{
+#
+# 47-48 Filling ruls
+#
+\\pgfseteorule\n
+\\pgfsetnonzerorule\n
+#
+# 49-60 pgftext instructions with alignment
+#
+\\pgftext[top,at={\\pgfpoint{
+\\pgftext[top,right,at={\\pgfpoint{
+\\pgftext[top,left,at={\\pgfpoint{
+\\pgftext[at={\\pgfpoint{
+\\pgftext[right,at={\\pgfpoint{
+\\pgftext[left,at={\\pgfpoint{
+\\pgftext[bottom,at={\\pgfpoint{
+\\pgftext[bottom,right,at={\\pgfpoint{
+\\pgftext[bottom,left,at={\\pgfpoint{
+\\pgftext[base,at={\\pgfpoint{
+\\pgftext[base,right,at={\\pgfpoint{
+\\pgftext[base,left,at={\\pgfpoint{
+#
+# 61-65
+#
+bp}}
+\\smash{
+}
+}}
+{
+#
+# 66-70 Image declaration
+#
+\\pgfdeclareimage[width=1bp,height=1bp
+,interpolate=true
+]{PPPTim
+}{
+}%\n
+#
+# 71 Set fill color for background filling
+#
+\\definecolor{PPPTcn}{gray}{1}\\pgfsetfillcolor{PPPTcn}\n
+#
+# 72 Start font name
+#
+\\PPPTfo
+#
+# 73 Mark font as command
+#
+{}
+#
+# 74 Open white colorbox
+#
+\\colorbox{white}{
+#
+# 75 Open oval box
+#
+\\ovalbox{
+#
+# 76 (formerly end of 61)
+#
+]{
+#
+# 77 Rotation
+#
+,rotate=
+$!end
+};
+
+
+
+/** Compare page structures by number or a page against a number.
+ @param l Left page object.
+ @param r Right page object or page number.
+ @param cr Comparison criteria (0=page/page, 1=page/number).
+ @return Comparison result.
+*/
+static
+int
+dk4gra_pgf_compare_pages_by_number(const void *l, const void *r, int cr)
+{
+ const dk4_gra_pgf_page_t *pl;
+ const dk4_gra_pgf_page_t *pr;
+ const size_t *ppno;
+
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pgf_page_t *)l;
+ switch (cr) {
+ case 1: {
+ ppno = (const size_t *)r;
+ if (pl->pageno > *ppno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < *ppno) {
+ back = -1;
+ }
+ }
+ } break;
+ default : {
+ pr = (const dk4_gra_pgf_page_t *)r;
+ if (pl->pageno > pr->pageno) {
+ back = 1;
+ }
+ else {
+ if (pl->pageno < pr->pageno) {
+ back = -1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Compare images by UFI (if available) or name.
+ @param l Left image record.
+ @param r Right image record.
+ @param cr Comparison criteria (ignored).
+*/
+static
+int
+dk4gra_pgf_compare_images_by_ufi_and_name(
+ const void *l,
+ const void *r,
+ int DK4_ARG_UNUSED(cr)
+)
+{
+ const dk4_gra_pgf_img_no_t *pl;
+ const dk4_gra_pgf_img_no_t *pr;
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pgf_img_no_t *)l;
+ pr = (const dk4_gra_pgf_img_no_t *)r;
+ if (0 != pl->hufi) {
+ if (0 != pr->hufi) {
+ back = dk4ufi_compare(&(pl->ufi), &(pr->ufi));
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (0 != pr->hufi) {
+ back = -1;
+ }
+ else {
+ if (NULL != pl->fn) {
+ if (NULL != pr->fn) {
+ back = dk4str_pathcmp(pl->fn, pr->fn);
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != pr->fn) {
+ back = -1;
+ }
+ }
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Compare images by image number.
+ @param l Left image record.
+ @param r Right image record.
+ @param cr Comparison criteria (ignored).
+*/
+static
+int
+dk4gra_pgf_compare_images_by_number(
+ const void *l,
+ const void *r,
+ int DK4_ARG_UNUSED(cr)
+)
+{
+ const dk4_gra_pgf_img_no_t *pl;
+ const dk4_gra_pgf_img_no_t *pr;
+ int back = 0;
+
+ DK4_UNUSED_ARG(cr)
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_gra_pgf_img_no_t *)l;
+ pr = (const dk4_gra_pgf_img_no_t *)r;
+ if (pl->imgno > pr->imgno) {
+ back = 1;
+ }
+ else {
+ if (pl->imgno < pr->imgno) {
+ back = -1;
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
+
+
+
+/** Issue one keyword to stream.
+ @param os Output stream to write to.
+ @param kwi Keyword index in dk4gra_pgf_kw array.
+ @param backptr Address of success variable, reset to 0 on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_pgf_stream_kw(
+ dk4_stream_t *os,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+#endif
+ dk4gratool_stream_string(os, dk4gra_pgf_kw[kwi], backptr, erp);
+}
+
+
+
+/** Issue one keyword to the page memory stream.
+ @param bptr Current page.
+ @param kwi Keyword index in dk4gra_pgf_kw array.
+ @param backptr Address of success variable, reset to 0 on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_pgf_page_kw(
+ dk4_gra_pgf_page_t *bptr,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+#endif
+ dk4gra_pgf_stream_kw(bptr->memstrm, kwi, backptr, erp);
+}
+
+
+
+/** Change stroking or non-stroking color.
+ @param os Output stream to write to.
+ @param cactive Active color.
+ @param crequested Requested color.
+ @param fi Flag: Change fill (non-stroking) color.
+ @param ptrback Address of success variable, reset to 0 on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+static
+void
+dk4gra_pgf_set_color_if_necessary(
+ dk4_stream_t *os,
+ dk4gra_col_t *cactive,
+ dk4gra_col_t *crequested,
+ int fi,
+ int *ptrback,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != os);
+ assert(NULL != cactive);
+ assert(NULL != crequested);
+#endif
+ if (dk4gratool_colors_differ(cactive, crequested)) {
+ switch (crequested->what) {
+ case DK4_GRA_COL_SPEC_GRAY : {
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 5 : 4), ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.gray, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 11 : 10), ptrback, erp);
+ } break;
+ case DK4_GRA_COL_SPEC_CMYK : {
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 9 : 8), ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.cmyk.c, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.cmyk.m, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.cmyk.y, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.cmyk.k, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 11 : 10), ptrback, erp);
+ } break;
+ default : {
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 7 : 6), ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.rgb.r, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.rgb.g, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, 3, ptrback, erp);
+ dk4gratool_stream_double(
+ os, crequested->data.rgb.b, ptrback, erp
+ );
+ dk4gra_pgf_stream_kw(os, ((0 != fi) ? 11 : 10), ptrback, erp);
+ } break;
+ }
+ dk4mem_cpy(cactive, crequested, sizeof(dk4gra_col_t), erp);
+ }
+}
+
+
+
+/** Write set dash instruction.
+ @param bptr Current page.
+ @param da Array containing the dash length values.
+ @param szda Number of elements in da.
+ @param offs Initial dash offset.
+ @param ptrback Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+static
+void
+dk4gra_pgf_dash_out(
+ dk4_gra_pgf_page_t *bptr,
+ const double *da,
+ size_t szda,
+ double offs,
+ int *ptrback,
+ dk4_er_t *erp
+)
+{
+ size_t i;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(NULL != da);
+ assert(0 < szda);
+#endif
+ /* setdash{ */
+ dk4gra_pgf_page_kw(bptr, 14, ptrback, erp);
+ for (i = 0; i < szda; i++) {
+ /* { */
+ dk4gra_pgf_page_kw(bptr, 16, ptrback, erp);
+ /* One dash length */
+ dk4gratool_stream_double(bptr->memstrm, da[i], ptrback, erp);
+ /* bp} */
+ dk4gra_pgf_page_kw(bptr, 17, ptrback, erp);
+ }
+ /* }{ */
+ dk4gra_pgf_page_kw(bptr, 15, ptrback, erp);
+ /* Initial dash offset */
+ dk4gratool_stream_double(bptr->memstrm, offs, ptrback, erp);
+ /* bp} */
+ dk4gra_pgf_page_kw(bptr, 13, ptrback, erp);
+}
+
+
+
+/** Initialize image record.
+ @param imgptr Image record to initialize.
+ @param fn File name, may be NULL.
+ @param imgno Image number.
+ @param ii Flag: Allow image interpolation.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if src is a NULL pointer,
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if no memory is available.
+*/
+static
+int
+dk4gra_pgf_img_init(
+ dk4_gra_pgf_img_no_t *imgptr,
+ const dkChar *fn,
+ size_t imgno,
+ int ii,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != imgptr);
+ assert(NULL != fn);
+#endif
+ /* Default values for all components
+ */
+ DK4_MEMRES(imgptr,sizeof(dk4_gra_pgf_img_no_t));
+ imgptr->fn = NULL;
+ imgptr->imgno = imgno;
+ imgptr->hufi = 0;
+ imgptr->intp = ii;
+ /*
+ Retrieve unique file identifier and other setup for file.
+ */
+ if (NULL != fn) {
+ imgptr->hufi = dk4ufi_get(&(imgptr->ufi), fn, NULL);
+ imgptr->fn = dk4str_dup(fn, erp);
+ if (NULL != imgptr->fn) {
+ back = 1;
+ }
+ }
+ return back;
+}
+
+
+
+void
+dk4gra_pgf_img_close(dk4_gra_pgf_img_no_t *imgptr)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != imgptr);
+#endif
+ if (NULL != imgptr) {
+ dk4mem_release(imgptr->fn);
+ dk4mem_free(imgptr);
+ }
+}
+
+
+
+dk4_gra_pgf_img_no_t *
+dk4gra_pgf_img_open(const dkChar *fn, size_t imgno, int ii, dk4_er_t *erp)
+{
+ dk4_gra_pgf_img_no_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4gra_pgf_img_open %!ds", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+ /*
+ Check arguments
+ */
+ if (NULL == fn) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Allocate memory
+ */
+ back = dk4mem_new(dk4_gra_pgf_img_no_t,1,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* Initialize record components
+ */
+ if (0 == dk4gra_pgf_img_init(back, fn, imgno, ii, erp)) {
+ goto finished;
+ }
+
+ ok = 1;
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pgf_img_close(back);
+ back = NULL;
+ }
+ $? "- dk4gra_pgf_img_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Write keyword to stream, reset success variable on errors.
+ @param ostrm Stream to write to.
+ @param kwi Keyword index in array.
+ @param bptr Address of success variable.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_pgf_kw_to_stream(
+ dk4_stream_t *ostrm,
+ size_t kwi,
+ int *bptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+#endif
+ dk4gratool_stream_string(ostrm, dk4gra_pgf_kw[kwi], bptr, erp);
+}
+
+
+
+/** Write the font definitions.
+ @param ostrm Output stream.
+ @param gra Graphics structure.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+static
+void
+dk4gra_pgf_font_definitions(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != ostrm);
+#endif
+ dk4gratool_font_definitions(ostrm, gra->out.pgf.fc, backptr, erp);
+}
+
+
+
+/** Write the image definitions.
+ @param ostrm Output stream.
+ @param gra Graphics structure.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if one of the buffers to read locale settings is too small,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+static
+void
+dk4gra_pgf_image_definitions(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_CHAR_SIZE > 1
+ char buf[DK4_MAX_PATH];
+#endif
+ dkChar lang[16];
+ dkChar reg[16];
+ dk4_gra_pgf_img_no_t *tptr;
+#if DK4_CHAR_SIZE > 1
+ char *bufptr;
+#endif
+ int enc;
+ int res;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != ostrm);
+#endif
+ res = dk4loc_get_settings(
+ lang, DK4_SIZEOF(lang,dkChar), reg, DK4_SIZEOF(reg,dkChar), &enc, erp
+ );
+ if (0 == res) {
+#if DK4_ON_WINDOWS
+ enc = DK4_FILE_ENCODING_WIN1252;
+#else
+ enc = DK4_FILE_ENCODING_PLAIN;
+#endif
+ }
+
+ dk4sto_it_reset(gra->out.pgf.i_imagno);
+ do {
+ tptr = (dk4_gra_pgf_img_no_t *)dk4sto_it_next(gra->out.pgf.i_imagno);
+ if (NULL != tptr) {
+ dk4gra_pgf_kw_to_stream(ostrm, 66, backptr, erp);
+ if (0 != tptr->intp) {
+ dk4gra_pgf_kw_to_stream(ostrm, 67, backptr, erp);
+ }
+ dk4gra_pgf_kw_to_stream(ostrm, 68, backptr, erp);
+ /* NUMBER */
+ dk4gratool_stream_num_alpha(ostrm, tptr->imgno, backptr, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 69, backptr, erp);
+ /* FILE NAME */
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ res = dk4recode_dk_to_any(
+ buf, sizeof(buf), DK4_FILE_ENCODING_WIN1252,
+ tptr->fn, DK4_ENCODING_32, erp
+ );
+#else
+ res = dk4recode_dk_to_any(
+ buf, sizeof(buf), DK4_FILE_ENCODING_WIN1252,
+ tptr->fn, DK4_ENCODING_UTF16, erp
+ );
+#endif
+ if (0 != res) {
+ bufptr = buf;
+ while ('\0' != *bufptr) {
+ if ('\\' == *bufptr) { *bufptr = '/'; }
+ bufptr++;
+ }
+ dk4gratool_stream_string(ostrm, buf, backptr, erp);
+ }
+#else
+ dk4gratool_stream_string(ostrm, tptr->fn, backptr, erp);
+#endif
+ dk4gra_pgf_kw_to_stream(ostrm, 70, backptr, erp);
+ }
+ } while (NULL != tptr);
+}
+
+
+
+/** Write one page to output stream.
+ @param ostrm Output stream.
+ @param gra Graphics the page is from.
+ @param page Page to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_CLOSE_FAILED<br>
+ if closing downward data failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
+*/
+static
+int
+dk4gra_pgf_one_page(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ dk4_gra_pgf_page_t *page,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != ostrm);
+ assert(NULL != page);
+#endif
+ if (NULL != page->memstrm) {
+ back = 1;
+ if (0 == dk4stream_close(page->memstrm, erp)) {
+ back = 0;
+ }
+ page->memstrm = NULL;
+
+ /* begin{pgfpicture}
+ */
+ dk4gra_pgf_kw_to_stream(ostrm, 44, &back, erp);
+
+ /* Font and image definitions
+ */
+ if (0 == gra->out.pgf.sa) {
+ dk4gra_pgf_font_definitions(ostrm, gra, &back, erp);
+ dk4gra_pgf_image_definitions(ostrm, gra, &back, erp);
+ }
+
+ /* Bounding box path
+ */
+ dk4gra_pgf_kw_to_stream(ostrm, 46, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->w, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 33, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->h, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 34, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 30, &back, erp);
+
+ /* Clip path
+ */
+ if (0 == ((page->flags) & DK4_GRA_PAGE_FLAG_NO_CLIP)) {
+ dk4gra_pgf_kw_to_stream(ostrm, 1, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 46, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->w, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 33, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->h, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 34, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 29, &back, erp);
+ }
+
+ /* White background
+ */
+ if (0 == ((page->flags) & DK4_GRA_PAGE_FLAG_NO_BG)) {
+ dk4gra_pgf_kw_to_stream(ostrm, 71, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 46, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->w, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 33, &back, erp);
+ dk4gratool_stream_uint(ostrm, gra->h, 0, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 34, &back, erp);
+ dk4gra_pgf_kw_to_stream(ostrm, 26, &back, erp);
+ }
+
+
+ /* Contents
+ */
+ if (NULL != page->membuf) {
+ if (0 == dk4membuf_to_stream(ostrm, page->membuf, erp)) {
+ back = 0;
+ }
+ }
+ else {
+ back = 0;
+ }
+
+ /* End clipping
+ */
+ if (0 == ((page->flags) & DK4_GRA_PAGE_FLAG_NO_CLIP)) {
+ dk4gra_pgf_kw_to_stream(ostrm, 2, &back, erp);
+ }
+
+ /* end{pgfpicture}
+ */
+ dk4gra_pgf_kw_to_stream(ostrm, 45, &back, erp);
+ }
+ else {
+ /* ERROR: No memstream */
+ }
+ return back;
+}
+
+
+
+/** Write output file.
+ @param fout Output file to write.
+ @param gra Graphics to write to file.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_CLOSE_FAILED<br>
+ if closing downward data failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
+*/
+static
+int
+dk4gra_pgf_file(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr = NULL;
+ dk4_stream_t *ostrm = NULL;
+ int back = 0;
+ int hadpage = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ ostrm = dk4stream_open_for_file(fout, DK4_STREAM_WRITE, 0, 0, erp);
+ if (NULL != ostrm) {
+ back = 1;
+ /*
+ Start of standalone document
+ */
+ if (0 != gra->out.pgf.sa) {
+ dk4gratool_start_standalone_document(
+ ostrm, gra, 1,
+ gra->out.pgf.dfs,
+ gra->out.pgf.s_prelfo, gra->out.pgf.i_prelfo,
+ gra->out.pgf.s_prelpa, gra->out.pgf.i_prelpa,
+ gra->out.pgf.s_prelot, gra->out.pgf.i_prelot,
+ &back, erp
+ );
+ dk4gra_pgf_font_definitions(ostrm, gra, &back, erp);
+ dk4gra_pgf_image_definitions(ostrm, gra, &back, erp);
+ }
+ /*
+ Page contents
+ */
+ dk4sto_it_reset(gra->i_pages);
+ do {
+ bptr = (dk4_gra_pgf_page_t *)dk4sto_it_next(gra->i_pages);
+ if (NULL != bptr) {
+ if (0 != hadpage) {
+ dk4gra_pgf_page_kw(bptr, 43, &back, erp);
+ }
+ if (0 == dk4gra_pgf_one_page(ostrm, gra, bptr, erp)) {
+ back = 0;
+ }
+ hadpage = 1;
+ }
+ } while (NULL != bptr);
+ /*
+ End of standalone document
+ */
+ if (0 != gra->out.pgf.sa) {
+ dk4gratool_end_standalone_document(ostrm, &back, erp);
+ }
+ }
+
+ if (NULL != ostrm) {
+ if (0 == dk4stream_close(ostrm, erp)) {
+ back = 0;
+ }
+ }
+ return back;
+}
+
+
+
+/** Delete PGF page structure, release resources.
+ @param pageptr Page to release.
+*/
+static
+void
+dk4gra_pgf_page_delete(dk4_gra_pgf_page_t *pageptr)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pageptr);
+#endif
+ if (NULL != pageptr) {
+ if (NULL != pageptr->memstrm) {
+ dk4stream_close(pageptr->memstrm, NULL);
+ }
+ pageptr->memstrm = NULL;
+ if (NULL != pageptr->membuf) {
+ dk4membuf_close(pageptr->membuf);
+ }
+ pageptr->membuf = NULL;
+ dk4mem_free(pageptr);
+ }
+}
+
+
+
+/** Create PGF page structure, allocate resources.
+ @param pageno Page number.
+ @param flags Flags.
+ @param erp Error report.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating a memory allocation size,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+static
+dk4_gra_pgf_page_t *
+dk4gra_pgf_page_new(
+ size_t pageno,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4gra_pgf_page_new"
+ /* Allocate structure
+ */
+ back = dk4mem_new(dk4_gra_pgf_page_t,1,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* Initialize components to defaults
+ */
+ DK4_MEMRES(back,sizeof(dk4_gra_pgf_page_t));
+ dk4gratool_initialize_attributes(&(back->attr));
+ dk4gratool_initialize_attributes(&(back->catt));
+ back->membuf = NULL;
+ back->memstrm = NULL;
+ back->pageno = pageno;
+ back->flags = flags;
+ /*
+ Allocate memory buffer and stream
+ */
+ back->membuf = dk4membuf_open(erp);
+ if (NULL == back->membuf) {
+ goto finished;
+ }
+ back->memstrm = dk4stream_open_membuf_writer(back->membuf, erp);
+ if (NULL == back->memstrm) {
+ goto finished;
+ }
+ /* Indicate success
+ */
+ ok = 1;
+
+ /* Clean up if neccessary, return
+ */
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pgf_page_delete(back);
+ back = NULL;
+ }
+ $? "- dk4gra_pgf_page_new %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Delete all preamble lines from a storage/iterator pair.
+ @param pot Address of storage pointer.
+ @param pit Address of iterator pointer.
+*/
+static
+void
+dk4gra_pgf_doc_preamble_close(
+ dk4_sto_t **pot,
+ dk4_sto_it_t **pit
+)
+{
+ dk4_gra_preamble_line_t *pl;
+ if (NULL != *pot) {
+ if (NULL != *pit) {
+ dk4sto_it_reset(*pit);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(*pit);
+ if (NULL != pl) {
+ dk4gratool_preamble_delete(pl);
+ }
+ } while (NULL != pl);
+ dk4sto_it_close(*pit);
+ *pit = NULL;
+ }
+ dk4sto_close(*pot);
+ *pot = NULL;
+ }
+ *pot = NULL;
+ *pit = NULL;
+}
+
+
+
+void
+dk4gra_pgf_close(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pgf_img_no_t *imgptr;
+ $? "+ dk4gra_pgf_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ if (NULL == gra) {
+ goto finished;
+ }
+ if (NULL != gra->out.pgf.fc) {
+ dk4fontc_close(gra->out.pgf.fc);
+ gra->out.pgf.fc = NULL;
+ }
+ if (NULL != gra->out.pgf.s_imagno) {
+ if (NULL != gra->out.pgf.i_imagno) {
+ dk4sto_it_close(gra->out.pgf.i_imagno);
+ }
+ dk4sto_close(gra->out.pgf.s_imagno);
+ gra->out.pgf.s_imagno = NULL;
+ }
+ if (NULL != gra->out.pgf.s_images) {
+ if (NULL != gra->out.pgf.i_images) {
+ dk4sto_it_reset(gra->out.pgf.i_images);
+ do {
+ imgptr = (dk4_gra_pgf_img_no_t *)dk4sto_it_next(
+ gra->out.pgf.i_images
+ );
+ if (NULL != imgptr) {
+ dk4gra_pgf_img_close(imgptr);
+ }
+ } while (NULL != imgptr);
+ dk4sto_it_close(gra->out.pgf.i_images);
+ }
+ dk4sto_close(gra->out.pgf.s_images);
+ gra->out.pgf.s_images = NULL;
+ }
+ dk4gra_pgf_doc_preamble_close(
+ &(gra->out.pgf.s_prelfo), &(gra->out.pgf.i_prelfo)
+ );
+ dk4gra_pgf_doc_preamble_close(
+ &(gra->out.pgf.s_prelpa), &(gra->out.pgf.i_prelpa)
+ );
+ dk4gra_pgf_doc_preamble_close(
+ &(gra->out.pgf.s_prelot), &(gra->out.pgf.i_prelot)
+ );
+ dk4gratool_close(gra);
+
+ finished:
+ $? "- dk4gra_pgf_close"
+ return;
+}
+
+
+
+dk4_gra_t *
+dk4gra_pgf_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4gra_pgf_open"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert(0 < w);
+ assert(0 < h);
+#endif
+ $? ". sa = %d", sa
+ /*
+ Generic initialization
+ */
+ back = dk4gratool_open(fn, w, h, docfl, erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* PGF-specific default initialization
+ */
+ back->dr = DK4_GRA_DRIVER_PGF;
+ back->out.pgf.fc = NULL;
+ back->out.pgf.s_imagno = NULL;
+ back->out.pgf.i_imagno = NULL;
+ back->out.pgf.s_images = NULL;
+ back->out.pgf.i_images = NULL;
+ back->out.pgf.s_prelfo = NULL;
+ back->out.pgf.i_prelfo = NULL;
+ back->out.pgf.s_prelpa = NULL;
+ back->out.pgf.i_prelpa = NULL;
+ back->out.pgf.s_prelot = NULL;
+ back->out.pgf.i_prelot = NULL;
+ back->out.pgf.dfs = -1.0;
+ back->out.pgf.n_images = 0;
+ back->out.pgf.n_prelfo = 0;
+ back->out.pgf.n_prelpa = 0;
+ back->out.pgf.n_prelot = 0;
+ back->out.pgf.sa = sa;
+ /* Pages storage and iterator.
+ */
+ back->s_pages = dk4sto_open(erp);
+ if (NULL == back->s_pages) { $? "! s_pages"
+ goto finished;
+ }
+ (void)dk4sto_set_comp(back->s_pages, dk4gra_pgf_compare_pages_by_number, 0);
+ back->i_pages = dk4sto_it_open(back->s_pages, erp);
+ if (NULL == back->i_pages) { $? "! i_pages"
+ goto finished;
+ }
+ /*
+ Allocate resources
+ */
+ back->out.pgf.fc = dk4fontc_open(erp);
+ if (NULL == back->out.pgf.fc) {
+ goto finished;
+ }
+ back->out.pgf.s_imagno = dk4sto_open(erp);
+ if (NULL == back->out.pgf.s_imagno) {
+ goto finished;
+ }
+ back->out.pgf.s_images = dk4sto_open(erp);
+ if (NULL == back->out.pgf.s_images) {
+ goto finished;
+ }
+ dk4sto_set_comp(
+ back->out.pgf.s_imagno,
+ dk4gra_pgf_compare_images_by_number, 0
+ );
+ dk4sto_set_comp(
+ back->out.pgf.s_images,
+ dk4gra_pgf_compare_images_by_ufi_and_name, 0
+ );
+ back->out.pgf.i_imagno = dk4sto_it_open(back->out.pgf.s_imagno, erp);
+ if (NULL == back->out.pgf.i_imagno) {
+ goto finished;
+ }
+ back->out.pgf.i_images = dk4sto_it_open(back->out.pgf.s_images, erp);
+ if (NULL == back->out.pgf.i_images) {
+ goto finished;
+ }
+
+ /* Finally indicate success
+ */
+ ok = 1;
+
+ /* Cleanup section, destroy object if not completely initialized
+ */
+ finished:
+ if ((NULL != back) && (0 == ok)) {
+ dk4gra_pgf_close(back);
+ back = NULL;
+ }
+ $? "- dk4gra_pgf_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4gra_pgf_write_file_and_close"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != fout);
+#endif
+ back = dk4gra_pgf_file(fout, gra, erp);
+ dk4gra_pgf_close(gra);
+ $? "- dk4gra_pgf_write_file_and_close %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *newpage = NULL;
+ int back = 0;
+ $? "+ dk4gra_pgf_page"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ /*
+ Check for page number overflow
+ */
+ if (SIZE_MAX == gra->pages) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ goto finished;
+ }
+ /* Allocate resources for new page
+ */
+ newpage = dk4gra_pgf_page_new(gra->pages, flags, erp);
+ if (NULL == newpage) {
+ goto finished;
+ }
+ /* Save new page in pages storage.
+ */
+ if (0 == dk4sto_add(gra->s_pages, newpage, erp)) {
+ dk4gra_pgf_page_delete(newpage);
+ goto finished;
+ }
+ /* Update pages number
+ */
+ gra->pages += 1;
+ gra->curpg = newpage;
+ back = 1;
+
+ finished:
+ $? "- dk4gra_pgf_page %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_gsave"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 1, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_gsave %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_grestore"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 2, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_grestore %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_line_width"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lw_requested = lw;
+
+ finished:
+ $? "- dk4gra_pgf_set_line_width %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_line_style"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.ls_requested = ls;
+ bptr->attr.sv_requested = sv;
+
+ finished:
+ $? "- dk4gra_pgf_set_line_style %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_line_cap"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lc_requested = lc;
+
+ finished:
+ $? "- dk4gra_pgf_set_line_cap %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_line_join"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.lj_requested = lj;
+ bptr->attr.ml_requested = ml;
+ if (1.0 > bptr->attr.ml_requested) {
+ bptr->attr.ml_requested = 1.0;
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+ finished:
+ $? "- dk4gra_pgf_set_line_join %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_fill_gray"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_fill_requested.data.gray = g;
+
+ finished:
+ $? "- dk4gra_pgf_set_fill_gray %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_fill_rgb"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_RGB;
+ bptr->attr.col_fill_requested.data.rgb.r = r;
+ bptr->attr.col_fill_requested.data.rgb.g = g;
+ bptr->attr.col_fill_requested.data.rgb.b = b;
+
+ finished:
+ $? "- dk4gra_pgf_set_fill_rgb %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_fill_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_fill_requested.what = DK4_GRA_COL_SPEC_CMYK;
+ bptr->attr.col_fill_requested.data.cmyk.c = c;
+ bptr->attr.col_fill_requested.data.cmyk.m = m;
+ bptr->attr.col_fill_requested.data.cmyk.y = y;
+ bptr->attr.col_fill_requested.data.cmyk.k = k;
+
+ finished:
+ $? "- dk4gra_pgf_set_fill_cmyk"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_stroke_gray"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_GRAY;
+ bptr->attr.col_stroke_requested.data.gray = g;
+
+ finished:
+ $? "- dk4gra_pgf_set_stroke_gray %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_set_stroke_rgb"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_RGB;
+ bptr->attr.col_stroke_requested.data.rgb.r = r;
+ bptr->attr.col_stroke_requested.data.rgb.g = g;
+ bptr->attr.col_stroke_requested.data.rgb.b = b;
+
+ finished:
+ $? "- dk4gra_pgf_set_stroke_rgb %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "- dk4gra_pgf_set_stroke_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ bptr->attr.col_stroke_requested.what = DK4_GRA_COL_SPEC_CMYK;
+ bptr->attr.col_stroke_requested.data.cmyk.c = c;
+ bptr->attr.col_stroke_requested.data.cmyk.m = m;
+ bptr->attr.col_stroke_requested.data.cmyk.y = y;
+ bptr->attr.col_stroke_requested.data.cmyk.k = k;
+
+ finished:
+ $? "- dk4gra_pgf_set_stroke_cmyk %d", back
+ return back;
+}
+
+
+
+
+int
+dk4gra_pgf_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+ int back = 0;
+ $? "+ dk4gra_pgf_prepare_fill"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_set_color_if_necessary(
+ bptr->memstrm,
+ &(bptr->attr.col_fill_active), &(bptr->attr.col_fill_requested),
+ 1, &back, erp
+ );
+ if (gra->eor != bptr->attr.eor_active) {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_kw[(0 != gra->eor) ? (47) : (48)],
+ &back, erp
+ );
+ bptr->attr.eor_active = gra->eor;
+ }
+
+ finished:
+ $? "- dk4gra_pgf_prepare_fill %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ double da[16]; /* Dash array */
+ double gw = 0.0; /* Gap width in dash pattern */
+ int back = 0; /* Function result */
+ int lwc = 0; /* Flag line width or style changed */
+ $? "+ dk4gra_pgf_prepare_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ /*
+ Stroke color
+ */
+ dk4gra_pgf_set_color_if_necessary(
+ bptr->memstrm,
+ &(bptr->attr.col_stroke_active), &(bptr->attr.col_stroke_requested),
+ 0, &back, erp
+ );
+ /* Line width
+ */
+ if (
+ DK4_GRA_EPSILON_LINEWIDTH
+ < fabs(bptr->attr.lw_active - bptr->attr.lw_requested)
+ ) {
+ dk4gra_pgf_page_kw(bptr, 12, &back, erp);
+ dk4gratool_stream_double(
+ bptr->memstrm, bptr->attr.lw_requested, &back, erp
+ );
+ dk4gra_pgf_page_kw(bptr, 13, &back, erp);
+ bptr->attr.lw_active = bptr->attr.lw_requested;
+ lwc = 1;
+ }
+ /* Line style
+ */
+ lwc = dk4gratool_line_style_differs(
+ bptr->attr.ls_active, bptr->attr.ls_requested,
+ bptr->attr.sv_active, bptr->attr.sv_requested,
+ lwc
+ );
+ if (0 != lwc) {
+ gw = (bptr->attr.sv_requested + bptr->attr.lw_requested) / 2.0;
+ if ((2.0 * bptr->attr.lw_requested) < gw) {
+ gw = 2.0 * bptr->attr.lw_requested;
+ }
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : case DK4_GRA_LC_PROJECTING : {
+ gw += bptr->attr.lw_requested;
+ } break;
+ }
+ switch (bptr->attr.ls_requested) {
+ case DK4_GRA_LS_DASH : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ dk4gra_pgf_dash_out(bptr, da, 2, (da[0] / 2.0), &back, erp);
+ } break;
+ case DK4_GRA_LS_DOT : {
+ da[0] = da[1] = bptr->attr.lw_requested;
+ dk4gra_pgf_dash_out(bptr, da, 2, (da[0] / 2.0), &back, erp);
+ } break;
+ case DK4_GRA_LS_DASH_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ dk4gra_pgf_dash_out(bptr, da, 4, (da[0] / 2.0), &back, erp);
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_requested;
+ da[5] = gw;
+ dk4gra_pgf_dash_out(bptr, da, 6, (da[0] / 2.0), &back, erp);
+ } break;
+ case DK4_GRA_LS_DASH_DOT_DOT_DOT : {
+ da[0] = bptr->attr.sv_requested;
+ da[1] = gw;
+ da[2] = bptr->attr.lw_requested;
+ da[3] = gw;
+ da[4] = bptr->attr.lw_requested;
+ da[5] = gw;
+ da[6] = bptr->attr.lw_requested;
+ da[7] = gw;
+ dk4gra_pgf_dash_out(bptr, da, 8, (da[0] / 2.0), &back, erp);
+ } break;
+ default : {
+ dk4gra_pgf_dash_out(bptr, da, 0, 0.0, &back, erp);
+ } break;
+ }
+ bptr->attr.ls_active = bptr->attr.ls_requested;
+ bptr->attr.sv_active = bptr->attr.sv_requested;
+ }
+ /* Line cap
+ */
+ if (bptr->attr.lc_active != bptr->attr.lc_requested) {
+ switch (bptr->attr.lc_requested) {
+ case DK4_GRA_LC_ROUNDED : {
+ dk4gra_pgf_page_kw(bptr, 19, &back, erp);
+ } break;
+ case DK4_GRA_LC_PROJECTING : {
+ dk4gra_pgf_page_kw(bptr, 20, &back, erp);
+ } break;
+ default : {
+ dk4gra_pgf_page_kw(bptr, 18, &back, erp);
+ } break;
+ }
+ bptr->attr.lc_active = bptr->attr.lc_requested;
+ }
+ /* Line join
+ */
+ if (bptr->attr.lj_active != bptr->attr.lj_requested) {
+ switch (bptr->attr.lj_requested) {
+ case DK4_GRA_LJ_ROUNDED : {
+ dk4gra_pgf_page_kw(bptr, 21, &back, erp);
+ } break;
+ case DK4_GRA_LJ_BEVELED : {
+ dk4gra_pgf_page_kw(bptr, 22, &back, erp);
+ } break;
+ default : {
+ dk4gra_pgf_page_kw(bptr, 23, &back, erp);
+ } break;
+ }
+ bptr->attr.lj_active = bptr->attr.lj_requested;
+ }
+ if (DK4_GRA_LJ_MITERED == bptr->attr.lj_active) {
+ if (
+ DK4_GRA_EPSILON_MITERLIMIT
+ < fabs(bptr->attr.ml_active - bptr->attr.ml_requested)
+ ) {
+ dk4gra_pgf_page_kw(bptr, 24, &back, erp);
+ dk4gratool_stream_double(
+ bptr->memstrm, bptr->attr.ml_requested, &back, erp
+ );
+ dk4gra_pgf_page_kw(bptr, 25, &back, erp);
+ bptr->attr.ml_active = bptr->attr.ml_requested;
+ }
+ }
+
+
+ finished:
+ $? "- dk4gra_pgf_prepare_stroke %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ int back;
+ $? "+ dk4gra_pgf_prepare_fill_and_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ back = dk4gra_pgf_prepare_fill(gra, erp);
+ if (0 == dk4gra_pgf_prepare_stroke(gra, erp)) {
+ back = 0;
+ }
+ $? "- dk4gra_pgf_prepare_fill_and_stroke %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_fill"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 26, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_fill %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 27, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_stroke %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_fill_and_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 28, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_fill_and_stroke %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_clip"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 29, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_clip %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_newpath_moveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 31, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, x, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, y, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+
+ $? "- dk4gra_pgf_newpath_moveto %d", back
+ finished:
+
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_newpath_moveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 32, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, x, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, y, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+
+ $? "- dk4gra_pgf_newpath_moveto %d", back
+ finished:
+
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_curveto"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 35, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xc1, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yc1, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 36, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xc2, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yc2, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 36, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, x, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, y, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_curveto %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_closepath"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 37, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_closepath"
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_circle"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, 38, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xc, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yc, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 39, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, r, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 25, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_circle %d", back
+ return back;
+}
+
+
+
+int
+dk4gra_pgf_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_rectangle"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ if (0.0 < r) {
+ /* Open TeX scope */
+ dk4gra_pgf_page_kw(bptr, 40, &back, erp);
+ /* Set corner radius */
+ dk4gra_pgf_page_kw(bptr, 41, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, r, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, r, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+ }
+ /* Draw rectangle by two corners */
+ dk4gra_pgf_page_kw(bptr, 42, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xl, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yb, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 36, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, xr, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, yt, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 34, &back, erp);
+ if (0.0 < r) {
+ /* Close Tex scope */
+ dk4gra_pgf_page_kw(bptr, 25, &back, erp);
+ }
+
+ finished:
+ $? "- dk4gra_pgf_rectangle %d", back
+ return back;
+}
+
+
+
+/** Handle text.
+ @param gra Graphics structure.
+ @param x X position of text.
+ @param y Y position of text.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to write.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding for simple text specified as char.
+ @param ha Horizontal alignment of text origin.
+ @param va Vertical alignment of text origin.
+ @param isnt Flag: Is normal text, no special text.
+ @param fno Font number, DK4_FONT_TIMES_ROMAN and others.
+ @param fsz Font size in pt.
+ @param fex Exactness of font, DK4_GRA_TF_EXACT_SIZE and others.
+ @param uc2l Unicode to LaTeX converter to use for normal text.
+ @param flags Flags.
+ @param backptr Address of suuccess variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pgf_i_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const void *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int isnt,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_page_t *bptr; /* Current page */
+ size_t fontno = 0;
+ size_t kwi = 60;
+ int back = 0;
+ int dorot = 0;
+ $? "+ dk4gra_pgf_i_text"
+ if ((NULL == gra) || (NULL == txt)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (DK4_GRA_DRIVER_PGF != gra->dr) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (1.0e-8 < fabs(rot)) { dorot = 1; }
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 != isnt) {
+ if (0 == dk4fontc_add_font(&fontno, gra->out.pgf.fc, fno, fsz, fex, erp)) {
+ goto finished;
+ }
+ }
+ switch (va) {
+ case DK4_TEXT_ALIGN_V_TOP : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 49;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 50;
+ } break;
+ default : { /* left */
+ kwi = 51;
+ } break;
+ }
+ } break;
+ case DK4_TEXT_ALIGN_V_CENTERED : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 52;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 53;
+ } break;
+ default : { /* left */
+ kwi = 54;
+ } break;
+ }
+ } break;
+ case DK4_TEXT_ALIGN_V_BOTTOM : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 55;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 56;
+ } break;
+ default : { /* left */
+ kwi = 57;
+ } break;
+ }
+ } break;
+ default : { /* base */
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 58;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 59;
+ } break;
+ default : { /* left */
+ kwi = 60;
+ } break;
+ }
+ } break;
+ }
+ back = 1;
+ dk4gra_pgf_page_kw(bptr, kwi, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, x, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 33, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, y, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 61, &back, erp);
+ if (0 != dorot) {
+ dk4gra_pgf_page_kw(bptr, 77, &back, erp);
+ dk4gratool_stream_double(bptr->memstrm, rot, &back, erp);
+ }
+ dk4gra_pgf_page_kw(bptr, 76, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 65, &back, erp);
+ /*
+ White box if required
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_WHITE_BOX & flags)) {
+ dk4gra_pgf_page_kw(bptr, 65, &back, erp);
+ }
+ /*
+ Use either specified color from colspec or fill color
+ */
+ if (NULL != colspec) {
+ if (0 == dk4stream_write_char_string(bptr->memstrm, colspec, erp)) {
+ back = 0;
+ }
+ }
+ else {
+ dk4gratool_stream_color(
+ bptr->memstrm, &(bptr->attr.col_fill_requested), &back, erp
+ );
+ }
+ /*
+ Open oval box if required
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_OVAL_BOX & flags)) {
+ dk4gra_pgf_page_kw(bptr, 75, &back, erp);
+ }
+ /*
+ Switch font
+ */
+ if (0 != isnt) {
+ dk4gra_pgf_page_kw(bptr, 72, &back, erp);
+ dk4gratool_stream_num_alpha(bptr->memstrm, fontno, &back, erp);
+ dk4gra_pgf_page_kw(bptr, 73, &back, erp);
+ }
+ /*
+ Write text
+ */
+ if (0 != isnt) {
+ if (
+ 0 ==
+ dk4uc2l_string_dk(bptr->memstrm, uc2l, (const dkChar *)txt, ie, erp)
+ )
+ {
+ back = 0;
+ }
+ }
+ else {
+ if (
+ 0 ==
+ dk4stream_write_char_string(bptr->memstrm, (const char *)txt, erp)
+ )
+ {
+ back = 0;
+ }
+ }
+ /* Close oval box if required
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_OVAL_BOX & flags)) {
+ dk4gra_pgf_page_kw(bptr, 63, &back, erp);
+ }
+ /* Close white box if required
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_WHITE_BOX & flags)) {
+ dk4gra_pgf_page_kw(bptr, 63, &back, erp);
+ }
+ dk4gra_pgf_page_kw(bptr, 64, &back, erp);
+#if 0
+ if (0 != dorot) {
+ }
+#endif
+ dk4gra_pgf_page_kw(bptr, 0, &back, erp);
+
+ finished:
+ $? "- dk4gra_pgf_i_text %d", back
+ if ((NULL != backptr) && (0 == back)) { *backptr = 0; }
+}
+
+
+
+void
+dk4gra_pgf_simple_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != txt);
+#endif
+ dk4gra_pgf_i_text(
+ gra, x, y, rot, txt, colspec, ie, ha, va, 1, fno, fsz, fex, uc2l,
+ flags, backptr, erp
+ );
+}
+
+
+
+void
+dk4gra_pgf_simple_utf8_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != txt);
+#endif
+ dk4gra_pgf_i_text(
+ gra, x, y, rot, txt, colspec, DK4_ENCODING_UTF8,
+ ha, va, 1, fno, fsz, fex, uc2l, flags, backptr, erp
+ );
+}
+
+
+
+void
+dk4gra_pgf_special_text(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != txt);
+#endif
+ dk4gra_pgf_i_text(
+ gra, x, y, rot, txt, colspec,
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252,
+#else
+ DK4_FILE_ENCODING_PLAIN,
+#endif
+ ha, va, 0, fno, fsz, fex, NULL, flags, backptr, erp
+ );
+}
+
+
+
+void
+dk4gra_pgf_save_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->catt),
+ &(bptr->attr),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_pgf_restore_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ dk4mem_cpy(
+ &(bptr->attr),
+ &(bptr->catt),
+ sizeof(dk4gra_attributes_t),
+ NULL
+ );
+}
+
+
+
+void
+dk4gra_pgf_reset_attributes(
+ dk4_gra_t *gra
+)
+{
+ dk4_gra_pgf_page_t *bptr;
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+#endif
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ dk4gratool_reset_active_attributes(&(bptr->attr));
+}
+
+
+
+void
+dk4gra_pgf_doc_font_size(
+ dk4_gra_t *gra,
+ double fs,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4gra_pgf_doc_font_size"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(0.0 < fs);
+ assert(DK4_GRA_DRIVER_PGF == gra->dr);
+#endif
+ if ((NULL != gra) && (0.0 < fs) && (DK4_GRA_DRIVER_PGF == gra->dr)) {
+ if (0 != gra->out.pgf.sa) {
+ gra->out.pgf.dfs = fs;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ $? "- dk4gra_pgf_doc_font_size"
+}
+
+
+
+/** Add one configuration line to storage.
+ @param psto Address of container.
+ @param pit Address of container iterator.
+ @param pnum Address of variable storing number of lines.
+ @param textline Text line to add.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4gra_pgf_i_preamble_line(
+ dk4_sto_t **psto,
+ dk4_sto_it_t **pit,
+ size_t *pnum,
+ char const *textline,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_preamble_line_t *pl;
+ int back = 0;
+ $? "+ dk4gra_pgf_i_preamble_line"
+ if (SIZE_MAX > *pnum) { $? ". number ok"
+ if (NULL == *psto) { $? ". no storage yet"
+ *psto = dk4sto_open(erp);
+ if (NULL != *psto) { $? ". have storage"
+ dk4sto_set_comp(*psto, dk4gratool_compare_preamble_lines, 0);
+ }
+#if TRACE_DEBUG
+ else { $? "! storage"
+ }
+#endif
+ }
+ if (NULL != *psto) {
+ if (NULL == *pit) { $? ". no iterator yet"
+ *pit = dk4sto_it_open(*psto, erp);
+ }
+ if (NULL != *pit) { $? ". iterator ok"
+ pl = dk4gratool_preamble_new(textline, *pnum, erp);
+ if (NULL != pl) { $? ". structure ok"
+ if (0 != dk4sto_add(*psto, pl, erp)) {
+ back = 1; $? ". added ok"
+ }
+ else { $? "! add"
+ dk4gratool_preamble_delete(pl);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! structure"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! iterator"
+ }
+#endif
+ }
+ }
+ else { $? "! number"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (0 == back) { if (NULL != backptr) { *backptr = 0; } }
+ $? "- dk4gra_pgf_i_preamble_line %d", back
+}
+
+
+
+void
+dk4gra_pgf_doc_preamble_line(
+ dk4_gra_t *gra,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4gra_pgf_doc_preamble_line"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != line);
+ assert(DK4_GRA_DRIVER_PGF == gra->dr);
+#endif
+ if ((NULL != gra) && (NULL != line) && (DK4_GRA_DRIVER_PGF == gra->dr)) {
+ if (0 != gra->out.pgf.sa) {
+ switch (tp) {
+ case DK4_GRA_PREAMBLE_FONT : { $? ". font"
+ dk4gra_pgf_i_preamble_line(
+ &(gra->out.pgf.s_prelfo),
+ &(gra->out.pgf.i_prelfo),
+ &(gra->out.pgf.n_prelfo),
+ line,
+ backptr,
+ erp
+ );
+ } break;
+ case DK4_GRA_PREAMBLE_PACKAGE : { $? ". package"
+ dk4gra_pgf_i_preamble_line(
+ &(gra->out.pgf.s_prelpa),
+ &(gra->out.pgf.i_prelpa),
+ &(gra->out.pgf.n_prelpa),
+ line,
+ backptr,
+ erp
+ );
+ } break;
+ case DK4_GRA_PREAMBLE_OTHER : { $? ". other"
+ dk4gra_pgf_i_preamble_line(
+ &(gra->out.pgf.s_prelot),
+ &(gra->out.pgf.i_prelot),
+ &(gra->out.pgf.n_prelot),
+ line,
+ backptr,
+ erp
+ );
+ } break;
+ default : { $? "! type"
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ } break;
+ }
+ }
+ else { $? "! not a document"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ $? "- dk4gra_pgf_doc_preamble_line"
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4grpgi.c b/support/dktools/dk4grpgi.c
new file mode 100644
index 0000000000..e45cac8b8d
--- /dev/null
+++ b/support/dktools/dk4grpgi.c
@@ -0,0 +1,239 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4grpgi.ctr
+*/
+
+/** @file dk4grpgi.c The dk4grpgi module.
+*/
+
+
+#line 9 "dk4grpgi.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4UFI_H_INCLUDED
+#include "dk4ufi.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 49 "dk4grpgi.ctr"
+
+
+
+/** Constant text fragments for PGF output.
+*/
+static const char * const dk4gra_pgf_img_kw[] = {
+/* 0 */ "\\begin{pgfscope}\n",
+/* 1 */ "\\end{pgfscope}\n",
+/* 2 */ "\\pgftransformshift{\\pgfpoint{",
+/* 3 */ "bp}{",
+/* 4 */ "bp}}\n",
+/* 5 */ "\\pgftransformrotate{",
+/* 6 */ "}\n",
+/* 7 */ "\\pgftransformxscale{",
+/* 8 */ "\\pgftransformyscale{",
+/* 9 */ "}\n",
+/* 10 */ "\\pgftext[left,base,at=\\pgfpointorigin]{\\pgfuseimage{PPPTim",
+/* 11 */ "}}\n",
+NULL
+};
+
+
+
+int
+dk4gra_pgf_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ int ifl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_img_no_t to; /* Test object */
+ dk4_gra_pgf_img_no_t *tptr = NULL; /* Search existing or add new */
+ dk4_gra_pgf_page_t *bptr = NULL; /* Current page */
+ int back = 0;
+
+
+#line 87 "dk4grpgi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != bif);
+ assert(NULL != cotra);
+ assert(NULL != fn);
+#endif
+ /*
+ Check arguments
+ */
+ if ((NULL == gra) || (NULL == cotra) || (NULL == bif) || (NULL == fn)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Check image file types, pdflatex can handle JPEG and PNG only
+ */
+ switch (dk4bif_get_image_type(bif)) {
+ case DK4_BIF_TYPE_NETPBM : case DK4_BIF_TYPE_TIFF : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ } break;
+ }
+ to.fn = (dkChar *)fn;
+ to.hufi = dk4ufi_get(&(to.ufi), fn, erp);
+ to.intp = ((0 != (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)) ? (1) : (0));
+ to.imgno = gra->out.pgf.n_images;
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == bif->imgtype)
+ ) {
+ if (0 == (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)) {
+ to.intp = 0;
+ }
+ }
+ tptr = (dk4_gra_pgf_img_no_t *)dk4sto_it_find_like(
+ gra->out.pgf.i_images, &to, 0
+ );
+ if (NULL == tptr) {
+ if (SIZE_MAX > gra->out.pgf.n_images) {
+ tptr = dk4gra_pgf_img_open(
+ fn, gra->out.pgf.n_images, to.intp, erp
+ );
+ if (NULL != tptr) {
+ gra->out.pgf.n_images += (size_t)1U;
+ if (0 != dk4sto_add(gra->out.pgf.s_images, tptr, erp)) {
+ if (0 == dk4sto_add(gra->out.pgf.s_imagno, tptr, erp)) {
+ tptr = NULL;
+ }
+ }
+ else {
+ dk4gra_pgf_img_close(tptr);
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ if (NULL != tptr) {
+ back = 1;
+ /* begin pgfscope */
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[0], &back, erp
+ );
+ /* pgftransformshift */
+ if (
+ (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[0]))
+ || (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[1]))
+ )
+ {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[2], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[0], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[3], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[1], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[4], &back, erp
+ );
+ }
+ /* pgftransformrotate */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[2])) {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[5], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[2], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[6], &back, erp
+ );
+ }
+ /* pgftransformxscale */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[3] - 1.0)) {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[7], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[3], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[9], &back, erp
+ );
+ }
+ /* pgftransformyscale */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[4] - 1.0)) {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[8], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[4], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[9], &back, erp
+ );
+ }
+ /* show image */
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[10], &back, erp
+ );
+ dk4gratool_stream_num_alpha(bptr->memstrm, tptr->imgno, &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[11], &back, erp
+ );
+ /* end pgfscope */
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[1], &back, erp
+ );
+ }
+
+ finished:
+
+
+#line 219 "dk4grpgi.ctr"
+ return back;
+}
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4grpgi.ctr b/support/dktools/dk4grpgi.ctr
new file mode 100644
index 0000000000..7e2bf8b144
--- /dev/null
+++ b/support/dktools/dk4grpgi.ctr
@@ -0,0 +1,223 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4UFI_H_INCLUDED
+#include "dk4ufi.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Constant text fragments for PGF output.
+*/
+static const char * const dk4gra_pgf_img_kw[] = {
+/* 0 */ "\\begin{pgfscope}\n",
+/* 1 */ "\\end{pgfscope}\n",
+/* 2 */ "\\pgftransformshift{\\pgfpoint{",
+/* 3 */ "bp}{",
+/* 4 */ "bp}}\n",
+/* 5 */ "\\pgftransformrotate{",
+/* 6 */ "}\n",
+/* 7 */ "\\pgftransformxscale{",
+/* 8 */ "\\pgftransformyscale{",
+/* 9 */ "}\n",
+/* 10 */ "\\pgftext[left,base,at=\\pgfpointorigin]{\\pgfuseimage{PPPTim",
+/* 11 */ "}}\n",
+NULL
+};
+
+
+
+int
+dk4gra_pgf_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ int ifl,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_pgf_img_no_t to; /* Test object */
+ dk4_gra_pgf_img_no_t *tptr = NULL; /* Search existing or add new */
+ dk4_gra_pgf_page_t *bptr = NULL; /* Current page */
+ int back = 0;
+ $? "+ dk4gra_pgf_bif_fig_image \"%!ds\"", TR_STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != gra);
+ assert(NULL != bif);
+ assert(NULL != cotra);
+ assert(NULL != fn);
+#endif
+ /*
+ Check arguments
+ */
+ if ((NULL == gra) || (NULL == cotra) || (NULL == bif) || (NULL == fn)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ bptr = (dk4_gra_pgf_page_t *)(gra->curpg);
+ if (NULL == bptr->memstrm) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Check image file types, pdflatex can handle JPEG and PNG only
+ */
+ switch (dk4bif_get_image_type(bif)) {
+ case DK4_BIF_TYPE_NETPBM : case DK4_BIF_TYPE_TIFF : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ } break;
+ }
+ to.fn = (dkChar *)fn;
+ to.hufi = dk4ufi_get(&(to.ufi), fn, erp);
+ to.intp = ((0 != (DK4_GRA_IMG_FLAG_INTERPOLATION & ifl)) ? (1) : (0));
+ to.imgno = gra->out.pgf.n_images;
+ if (
+ (0 != (DK4_GRA_IMG_FLAG_DCT & ifl))
+ && (DK4_BIF_TYPE_JPEG == bif->imgtype)
+ ) {
+ if (0 == (DK4_GRA_IMG_FLAG_DCT_INTERPOLATION & ifl)) {
+ to.intp = 0;
+ }
+ }
+ tptr = (dk4_gra_pgf_img_no_t *)dk4sto_it_find_like(
+ gra->out.pgf.i_images, &to, 0
+ );
+ if (NULL == tptr) {
+ if (SIZE_MAX > gra->out.pgf.n_images) {
+ tptr = dk4gra_pgf_img_open(
+ fn, gra->out.pgf.n_images, to.intp, erp
+ );
+ if (NULL != tptr) {
+ gra->out.pgf.n_images += (size_t)1U;
+ if (0 != dk4sto_add(gra->out.pgf.s_images, tptr, erp)) {
+ if (0 == dk4sto_add(gra->out.pgf.s_imagno, tptr, erp)) {
+ tptr = NULL;
+ }
+ }
+ else {
+ dk4gra_pgf_img_close(tptr);
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ if (NULL != tptr) {
+ back = 1;
+ /* begin pgfscope */
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[0], &back, erp
+ );
+ /* pgftransformshift */
+ if (
+ (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[0]))
+ || (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[1]))
+ )
+ {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[2], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[0], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[3], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[1], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[4], &back, erp
+ );
+ }
+ /* pgftransformrotate */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[2])) {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[5], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[2], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[6], &back, erp
+ );
+ }
+ /* pgftransformxscale */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[3] - 1.0)) {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[7], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[3], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[9], &back, erp
+ );
+ }
+ /* pgftransformyscale */
+ if (DK4_GRA_EPSILON_COORDINATES < fabs(cotra[4] - 1.0)) {
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[8], &back, erp
+ );
+ dk4gratool_stream_double(bptr->memstrm, cotra[4], &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[9], &back, erp
+ );
+ }
+ /* show image */
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[10], &back, erp
+ );
+ dk4gratool_stream_num_alpha(bptr->memstrm, tptr->imgno, &back, erp);
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[11], &back, erp
+ );
+ /* end pgfscope */
+ dk4gratool_stream_string(
+ bptr->memstrm, dk4gra_pgf_img_kw[1], &back, erp
+ );
+ }
+
+ finished:
+ $? "- dk4gra_pgf_bif_fig_image %d", back
+ return back;
+}
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4hname8.c b/support/dktools/dk4hname8.c
index 835570886d..e02c8b96ff 100644
--- a/support/dktools/dk4hname8.c
+++ b/support/dktools/dk4hname8.c
@@ -1,45 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4hname8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4hname8.ctr
*/
/** @file dk4hname8.c The dk4hname8 module.
*/
-#line 55 "dk4hname8.ctr"
-
+#line 67 "dk4hname8.ctr"
+#include "dk4conf.h"
#include "dk4hname8.h"
#if DK4_ON_WINDOWS
@@ -57,6 +35,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -66,6 +50,10 @@ dk4hostname_c8(char *buffer, size_t sz, dk4_er_t *erp)
DWORD s;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
#if DK4_ON_WINDOWS
if ((dk4_um_t)sz <= (dk4_um_t)0xFFFFFFFFUL) {
diff --git a/support/dktools/dk4hname8.ctr b/support/dktools/dk4hname8.ctr
index 7aa2385ba4..8a8299b7d4 100644
--- a/support/dktools/dk4hname8.ctr
+++ b/support/dktools/dk4hname8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -53,7 +65,7 @@ dk4hostname_c8(char *buffer, size_t sz, dk4_er_t *erp);
%% module
-
+#include "dk4conf.h"
#include "dk4hname8.h"
#if DK4_ON_WINDOWS
@@ -71,6 +83,12 @@ dk4hostname_c8(char *buffer, size_t sz, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -80,6 +98,10 @@ dk4hostname_c8(char *buffer, size_t sz, dk4_er_t *erp)
DWORD s;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
#if DK4_ON_WINDOWS
if ((dk4_um_t)sz <= (dk4_um_t)0xFFFFFFFFUL) {
diff --git a/support/dktools/dk4hname8.h b/support/dktools/dk4hname8.h
index b773353ae7..c9057848dd 100644
--- a/support/dktools/dk4hname8.h
+++ b/support/dktools/dk4hname8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4hname8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4hname8.ctr
*/
#ifndef DK4HNAME8_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4hnamed.c b/support/dktools/dk4hnamed.c
index 9e9a78262c..8736461a08 100644
--- a/support/dktools/dk4hnamed.c
+++ b/support/dktools/dk4hnamed.c
@@ -1,50 +1,41 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4hnamed.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4hnamed.ctr
*/
/** @file dk4hnamed.c The dk4hnamed module.
*/
-#line 64 "dk4hnamed.ctr"
+#line 84 "dk4hnamed.ctr"
+#include "dk4conf.h"
#include "dk4hnamed.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4hostname(dkChar *buffer, size_t sz, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4hostname_wc(buffer, sz, erp));
#else
diff --git a/support/dktools/dk4hnamed.ctr b/support/dktools/dk4hnamed.ctr
index 69039548b8..3a08de36eb 100644
--- a/support/dktools/dk4hnamed.ctr
+++ b/support/dktools/dk4hnamed.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -13,24 +13,44 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_CHAR_SIZE > 1
#ifndef DK4HNAMEW_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4hnamew.h"
+#else
+#include <dktools-4/dk4hnamew.h>
+#endif
#endif
#else
#ifndef DK4HNAME8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4hname8.h"
+#else
+#include <dktools-4/dk4hname8.h>
+#endif
#endif
#endif
@@ -62,12 +82,25 @@ dk4hostname(dkChar *buffer, size_t sz, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4hnamed.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4hostname(dkChar *buffer, size_t sz, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4hostname_wc(buffer, sz, erp));
#else
diff --git a/support/dktools/dk4hnamed.h b/support/dktools/dk4hnamed.h
index 7f0aca5b50..f93bdb6fd8 100644
--- a/support/dktools/dk4hnamed.h
+++ b/support/dktools/dk4hnamed.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4hnamed.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4hnamed.ctr
*/
#ifndef DK4HNAMED_H_INCLUDED
@@ -47,24 +25,44 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_CHAR_SIZE > 1
#ifndef DK4HNAMEW_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4hnamew.h"
+#else
+#include <dktools-4/dk4hnamew.h>
+#endif
#endif
#else
#ifndef DK4HNAME8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4hname8.h"
+#else
+#include <dktools-4/dk4hname8.h>
+#endif
#endif
#endif
diff --git a/support/dktools/dk4hnamew.c b/support/dktools/dk4hnamew.c
index 6d0d530a6d..405793a7bf 100644
--- a/support/dktools/dk4hnamew.c
+++ b/support/dktools/dk4hnamew.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4hnamew.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4hnamew.ctr
*/
/** @file dk4hnamew.c The dk4hnamew module.
*/
-#line 57 "dk4hnamew.ctr"
+#line 69 "dk4hnamew.ctr"
+#include "dk4conf.h"
#include "dk4hnamew.h"
#if DK4_ON_WINDOWS
@@ -55,6 +34,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -64,6 +49,10 @@ dk4hostname_wc(wchar_t *buffer, size_t sz, dk4_er_t *erp)
DWORD s;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
#if DK4_ON_WINDOWS
if ((dk4_um_t)sz <= (dk4_um_t)0xFFFFFFFFUL) {
diff --git a/support/dktools/dk4hnamew.ctr b/support/dktools/dk4hnamew.ctr
index b7e1efceb0..30163d9dd7 100644
--- a/support/dktools/dk4hnamew.ctr
+++ b/support/dktools/dk4hnamew.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -55,6 +67,7 @@ dk4hostname_wc(wchar_t *buffer, size_t sz, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4hnamew.h"
#if DK4_ON_WINDOWS
@@ -71,6 +84,12 @@ dk4hostname_wc(wchar_t *buffer, size_t sz, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -80,6 +99,10 @@ dk4hostname_wc(wchar_t *buffer, size_t sz, dk4_er_t *erp)
DWORD s;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != buffer) && (0 < sz)) {
#if DK4_ON_WINDOWS
if ((dk4_um_t)sz <= (dk4_um_t)0xFFFFFFFFUL) {
diff --git a/support/dktools/dk4hnamew.h b/support/dktools/dk4hnamew.h
index 2349298ad0..fef97a4bc9 100644
--- a/support/dktools/dk4hnamew.h
+++ b/support/dktools/dk4hnamew.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4hnamew.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4hnamew.ctr
*/
#ifndef DK4HNAMEW_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4info.c b/support/dktools/dk4info.c
index b2e68dd8db..6cbcd24876 100644
--- a/support/dktools/dk4info.c
+++ b/support/dktools/dk4info.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4info.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4info.ctr
*/
/** @file dk4info.c The dk4info module.
@@ -58,11 +36,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4inst.h"
#include "dk4strd.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 33 "dk4info.ctr"
+#line 36 "dk4info.ctr"
@@ -90,7 +71,7 @@ dkT(""),
NULL
-#line 59 "dk4info.ctr"
+#line 62 "dk4info.ctr"
};
@@ -103,7 +84,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -130,27 +112,28 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
+dkT(""),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -224,7 +207,7 @@ dkT(""),
NULL
-#line 191 "dk4info.ctr"
+#line 196 "dk4info.ctr"
};
@@ -244,7 +227,7 @@ dkT("dk4info.str"),
NULL
-#line 212 "dk4info.ctr"
+#line 217 "dk4info.ctr"
};
@@ -281,7 +264,7 @@ dkT("------------"),
NULL
-#line 244 "dk4info.ctr"
+#line 249 "dk4info.ctr"
};
@@ -325,7 +308,7 @@ dkT("--libexecdir="),
NULL
-#line 264 "dk4info.ctr"
+#line 269 "dk4info.ctr"
};
@@ -477,16 +460,16 @@ int main(int argc, char *argv[])
{
-#line 414 "dk4info.ctr"
+#line 419 "dk4info.ctr"
-#line 415 "dk4info.ctr"
+#line 420 "dk4info.ctr"
-#line 416 "dk4info.ctr"
+#line 421 "dk4info.ctr"
-#line 417 "dk4info.ctr"
+#line 422 "dk4info.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
@@ -512,10 +495,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 441 "dk4info.ctr"
+#line 446 "dk4info.ctr"
-#line 442 "dk4info.ctr"
+#line 447 "dk4info.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dk4info.ctr b/support/dktools/dk4info.ctr
index 28adafcef1..60cab5b568 100644
--- a/support/dktools/dk4info.ctr
+++ b/support/dktools/dk4info.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -27,6 +27,9 @@ license = bsd
#include "dk4inst.h"
#include "dk4strd.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -69,7 +72,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -96,27 +100,28 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
#if DK4_HAVE_ZLIB_H
diff --git a/support/dktools/dk4info.rc b/support/dktools/dk4info.rc
index a165fc2dcf..1fff18d077 100644
--- a/support/dktools/dk4info.rc
+++ b/support/dktools/dk4info.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Show setup information\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Show setup information\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dk4info\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dk4info1.c b/support/dktools/dk4info1.c
index abc651914c..3b0239a5f1 100644
--- a/support/dktools/dk4info1.c
+++ b/support/dktools/dk4info1.c
@@ -22,6 +22,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_ASSERT_H = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+ dk4fputs(dkT("DK4_HAVE_ATTRIBUTE_UNUSED = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_ATTRIBUTE_UNUSED = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_BACKSLASH_AS_SEP
dk4fputs(dkT("DK4_HAVE_BACKSLASH_AS_SEP = 1\n"), stdout, NULL);
#else
@@ -58,6 +64,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_BLKSIZE_T = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_BSEARCH
+ dk4fputs(dkT("DK4_HAVE_BSEARCH = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_BSEARCH = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_BZERO
dk4fputs(dkT("DK4_HAVE_BZERO = 1\n"), stdout, NULL);
#else
@@ -418,6 +430,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_INET_PTON = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_INITGROUPS
+ dk4fputs(dkT("DK4_HAVE_INITGROUPS = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_INITGROUPS = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_INITSTATE
dk4fputs(dkT("DK4_HAVE_INITSTATE = 1\n"), stdout, NULL);
#else
@@ -496,6 +514,30 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_ISFINITE = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_ISGREATER
+ dk4fputs(dkT("DK4_HAVE_ISGREATER = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_ISGREATER = 0\n"), stdout, NULL);
+#endif
+
+#if DK4_HAVE_ISGREATEREQUAL
+ dk4fputs(dkT("DK4_HAVE_ISGREATEREQUAL = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_ISGREATEREQUAL = 0\n"), stdout, NULL);
+#endif
+
+#if DK4_HAVE_ISLESS
+ dk4fputs(dkT("DK4_HAVE_ISLESS = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_ISLESS = 0\n"), stdout, NULL);
+#endif
+
+#if DK4_HAVE_ISLESSEQUAL
+ dk4fputs(dkT("DK4_HAVE_ISLESSEQUAL = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_ISLESSEQUAL = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_ISNORMAL
dk4fputs(dkT("DK4_HAVE_ISNORMAL = 1\n"), stdout, NULL);
#else
@@ -610,6 +652,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_MEMCPY = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_MEMORY_H
+ dk4fputs(dkT("DK4_HAVE_MEMORY_H = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_MEMORY_H = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_MEMSET
dk4fputs(dkT("DK4_HAVE_MEMSET = 1\n"), stdout, NULL);
#else
@@ -748,6 +796,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_PWD_H = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_QSORT
+ dk4fputs(dkT("DK4_HAVE_QSORT = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_QSORT = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_RAND
dk4fputs(dkT("DK4_HAVE_RAND = 1\n"), stdout, NULL);
#else
@@ -784,6 +838,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_RMDIR = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_SEARCH_H
+ dk4fputs(dkT("DK4_HAVE_SEARCH_H = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_SEARCH_H = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_SELECT
dk4fputs(dkT("DK4_HAVE_SELECT = 1\n"), stdout, NULL);
#else
@@ -814,6 +874,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_SETGRENT = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_SETGROUPS
+ dk4fputs(dkT("DK4_HAVE_SETGROUPS = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_SETGROUPS = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_SETJMP_H
dk4fputs(dkT("DK4_HAVE_SETJMP_H = 1\n"), stdout, NULL);
#else
@@ -1150,6 +1216,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_SWPRINTF = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_SYSEXITS_H
+ dk4fputs(dkT("DK4_HAVE_SYSEXITS_H = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_SYSEXITS_H = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_SYSLOG
dk4fputs(dkT("DK4_HAVE_SYSLOG = 1\n"), stdout, NULL);
#else
@@ -1162,6 +1234,12 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_SYSLOG_H = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_SYSTEMD
+ dk4fputs(dkT("DK4_HAVE_SYSTEMD = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_SYSTEMD = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_SYS_PARAM_H
dk4fputs(dkT("DK4_HAVE_SYS_PARAM_H = 1\n"), stdout, NULL);
#else
@@ -1420,6 +1498,24 @@ showdefines(void)
dk4fputs(dkT("DK4_HAVE_WXWIDGETS = 0\n"), stdout, NULL);
#endif
+#if DK4_HAVE_WX_CHARTYPE_H
+ dk4fputs(dkT("DK4_HAVE_WX_CHARTYPE_H = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_WX_CHARTYPE_H = 0\n"), stdout, NULL);
+#endif
+
+#if DK4_HAVE_WX_DEFS_H
+ dk4fputs(dkT("DK4_HAVE_WX_DEFS_H = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_WX_DEFS_H = 0\n"), stdout, NULL);
+#endif
+
+#if DK4_HAVE_WX_WXCHAR_H
+ dk4fputs(dkT("DK4_HAVE_WX_WXCHAR_H = 1\n"), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_HAVE_WX_WXCHAR_H = 0\n"), stdout, NULL);
+#endif
+
#if DK4_HAVE_ZLIB_H
dk4fputs(dkT("DK4_HAVE_ZLIB_H = 1\n"), stdout, NULL);
#else
@@ -1639,15 +1735,6 @@ showdefines(void)
dk4fputs(dkT("DK4_SIZEOF_DOUBLE = 0\n"), stdout, NULL);
#endif
-#ifdef DK4_SIZEOF_INO64_T
- dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf, dkChar), (dk4_um_t)DK4_SIZEOF_INO64_T, 0, NULL);
- dk4fputs(dkT("DK4_SIZEOF_INO64_T = "), stdout, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
-#else
- dk4fputs(dkT("DK4_SIZEOF_INO64_T = 0\n"), stdout, NULL);
-#endif
-
#ifdef DK4_SIZEOF_INO_T
dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf, dkChar), (dk4_um_t)DK4_SIZEOF_INO_T, 0, NULL);
dk4fputs(dkT("DK4_SIZEOF_INO_T = "), stdout, NULL);
@@ -1666,6 +1753,15 @@ showdefines(void)
dk4fputs(dkT("DK4_SIZEOF_INT = 0\n"), stdout, NULL);
#endif
+#ifdef DK4_SIZEOF_INT32_T
+ dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf, dkChar), (dk4_um_t)DK4_SIZEOF_INT32_T, 0, NULL);
+ dk4fputs(dkT("DK4_SIZEOF_INT32_T = "), stdout, NULL);
+ dk4fputs(buf, stdout, NULL);
+ dk4fputc(dkT('\n'), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_SIZEOF_INT32_T = 0\n"), stdout, NULL);
+#endif
+
#ifdef DK4_SIZEOF_INTMAX_T
dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf, dkChar), (dk4_um_t)DK4_SIZEOF_INTMAX_T, 0, NULL);
dk4fputs(dkT("DK4_SIZEOF_INTMAX_T = "), stdout, NULL);
@@ -1702,15 +1798,6 @@ showdefines(void)
dk4fputs(dkT("DK4_SIZEOF_LONG_LONG = 0\n"), stdout, NULL);
#endif
-#ifdef DK4_SIZEOF_OFF64_T
- dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf, dkChar), (dk4_um_t)DK4_SIZEOF_OFF64_T, 0, NULL);
- dk4fputs(dkT("DK4_SIZEOF_OFF64_T = "), stdout, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
-#else
- dk4fputs(dkT("DK4_SIZEOF_OFF64_T = 0\n"), stdout, NULL);
-#endif
-
#ifdef DK4_SIZEOF_OFF_T
dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf, dkChar), (dk4_um_t)DK4_SIZEOF_OFF_T, 0, NULL);
dk4fputs(dkT("DK4_SIZEOF_OFF_T = "), stdout, NULL);
@@ -1765,6 +1852,15 @@ showdefines(void)
dk4fputs(dkT("DK4_USE_FALLBACK_NUMERIC_LIMITS = 0\n"), stdout, NULL);
#endif
+#ifdef DK4_USE_INLINE
+ dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf, dkChar), (dk4_um_t)DK4_USE_INLINE, 0, NULL);
+ dk4fputs(dkT("DK4_USE_INLINE = "), stdout, NULL);
+ dk4fputs(buf, stdout, NULL);
+ dk4fputc(dkT('\n'), stdout, NULL);
+#else
+ dk4fputs(dkT("DK4_USE_INLINE = 0\n"), stdout, NULL);
+#endif
+
#ifdef DK4_USE_PRINTF_SCANF
dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf, dkChar), (dk4_um_t)DK4_USE_PRINTF_SCANF, 0, NULL);
dk4fputs(dkT("DK4_USE_PRINTF_SCANF = "), stdout, NULL);
diff --git a/support/dktools/dk4inst.c b/support/dktools/dk4inst.c
index bead5e5b82..54f35e38b8 100644
--- a/support/dktools/dk4inst.c
+++ b/support/dktools/dk4inst.c
@@ -1,11 +1,23 @@
+/*
+Copyright 2020-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file dk4inst.c Installation directories.
- Produced by configure, 2017-03-28 22:19:29.
+ Produced by configure, 2020-09-15 21:54:22.
*/
#ifndef DK4CONF_H_INCLUDED
#include "dk4conf.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#ifndef DK4TYPES_H_INCLUDED
#include "dk4types.h"
#endif
@@ -31,6 +43,8 @@ const dkChar * const dk4inst_directories[] = {
/* 8 */ dkT("C:\\Program Files\\Krause\\man"),
/* 9 */ dkT("C:\\Program Files\\Krause"),
/* 10 */ dkT("C:\\Program Files\\Krause\\libexec"),
+ /* 11 */ dkT("C:\\Program Files\\Krause\\run"),
+ /* 12 */ dkT("C:\\Program Files\\Krause\\run"),
#else
/* 0 */ dkT("/usr/local"),
/* 1 */ dkT("/usr/local/etc"),
@@ -43,6 +57,8 @@ const dkChar * const dk4inst_directories[] = {
/* 8 */ dkT("/usr/local/share/man"),
/* 9 */ dkT("/usr/local"),
/* 10 */ dkT("/usr/local/libexec"),
+ /* 11 */ dkT("/usr/local/var/run"),
+ /* 12 */ dkT("/run"),
#endif
};
@@ -52,7 +68,10 @@ const dkChar *
dk4inst_get_directory(size_t i)
{
const dkChar *back = NULL;
- if(i <= 10) { back = dk4inst_directories[i]; }
+#if DK4_USE_ASSERT
+ assert(i <= 12);
+#endif
+ if(i <= 12) { back = dk4inst_directories[i]; }
return back;
}
diff --git a/support/dktools/dk4inst.h b/support/dktools/dk4inst.h
index 89fb845312..66da20c706 100644
--- a/support/dktools/dk4inst.h
+++ b/support/dktools/dk4inst.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DK4INST_H_INCLUDED
#define DK4INST_H_INCLUDED 1
@@ -11,7 +15,7 @@
CRT on Windows: Not used.
- Produced by configure, 2017-03-28 22:19:29.
+ Produced by configure, 2020-09-15 21:54:22.
*/
#ifndef DK4CONF_H_INCLUDED
@@ -50,7 +54,7 @@ dk4inst_get_directory(size_t i);
/** @defgroup instdirs Installation directories. */
/**@{*/
-#ifdef _WIN32
+#if _WIN32
/** Installation prefix, typlically /usr or /usr/local.
*/
@@ -96,6 +100,14 @@ dk4inst_get_directory(size_t i);
*/
#define DK4_INST_DIR_LIBEXEC "C:\\Program Files\\Krause\\libexec"
+/** Run state directory, typically /var/run or /run.
+*/
+#define DK4_INST_DIR_RUNSTATE "C:\\Program Files\\Krause\\run"
+
+/** Run state directory for systemd, typically /run.
+*/
+#define DK4_INST_DIR_SYSTEMD_RUN "C:\\Program Files\\Krause\\run"
+
#else
/** Installation prefix, typlically /usr or /usr/local.
@@ -142,6 +154,14 @@ dk4inst_get_directory(size_t i);
*/
#define DK4_INST_DIR_LIBEXEC "/usr/local/libexec"
+/** Run state directory, typically /var/run or /run.
+*/
+#define DK4_INST_DIR_RUNSTATE "/usr/local/var/run"
+
+/** Run state directory for systemd, typically /run.
+*/
+#define DK4_INST_DIR_SYSTEMD_RUN "/run"
+
#endif
/**@}*/
diff --git a/support/dktools/dk4isadm.c b/support/dktools/dk4isadm.c
index fdb30fd60d..b6405c3fa8 100644
--- a/support/dktools/dk4isadm.c
+++ b/support/dktools/dk4isadm.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4isadm.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4isadm.ctr
*/
/** @file dk4isadm.c The dk4isadm module.
@@ -65,6 +43,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#include "dk4isadm.h"
+
+
+
+
+
+#line 61 "dk4isadm.ctr"
+
+
+
+
int
dk4isadmin(void)
{
diff --git a/support/dktools/dk4isadm.ctr b/support/dktools/dk4isadm.ctr
index bdd7573763..13be10271e 100644
--- a/support/dktools/dk4isadm.ctr
+++ b/support/dktools/dk4isadm.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -53,6 +53,15 @@ dk4isadmin(void);
#endif
#endif
+#include "dk4isadm.h"
+
+
+
+$!trace-include
+
+
+
+
int
dk4isadmin(void)
{
diff --git a/support/dktools/dk4isadm.h b/support/dktools/dk4isadm.h
index 039ca746c2..3c4f398ee6 100644
--- a/support/dktools/dk4isadm.h
+++ b/support/dktools/dk4isadm.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4isadm.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4isadm.ctr
*/
#ifndef DK4ISADM_H_INCLUDED
diff --git a/support/dktools/dk4istty.c b/support/dktools/dk4istty.c
index 0248705a51..e9ecd22c59 100644
--- a/support/dktools/dk4istty.c
+++ b/support/dktools/dk4istty.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4istty.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4istty.ctr
*/
/** @file dk4istty.c The dk4istty module.
*/
-#line 69 "dk4istty.ctr"
+#line 81 "dk4istty.ctr"
+#include "dk4conf.h"
#include "dk4istty.h"
#if DK4_HAVE_UNISTD_H
@@ -55,11 +34,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
+
+
+
+
+#line 111 "dk4istty.ctr"
+
+
+
int
-dk4istty(int fd, dk4_er_t *erp)
+dk4istty(
+#if (DK4_HAVE_ISATTY) || (DK4_HAVE__ISATTY)
+ int fd, dk4_er_t * DK4_ARG_UNUSED(erp)
+#else
+ int fd, dk4_er_t *erp
+#endif
+)
{
int back = -1;
#if DK4_HAVE_ISATTY
+ DK4_UNUSED_ARG(erp)
if ( 0 != isatty(fd) ) {
back = 1;
} else {
@@ -67,6 +70,7 @@ dk4istty(int fd, dk4_er_t *erp)
}
#else
#if DK4_HAVE__ISATTY
+ DK4_UNUSED_ARG(erp)
if ( 0 != _isatty(fd) ) {
back = 1;
} else {
@@ -85,6 +89,9 @@ int
dk4istty_file(FILE *fipo, dk4_er_t *erp)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
#if DK4_HAVE_FILENO
back = dk4istty(fileno(fipo), erp);
diff --git a/support/dktools/dk4istty.ctr b/support/dktools/dk4istty.ctr
index e4032c5ad2..a503b1152e 100644
--- a/support/dktools/dk4istty.ctr
+++ b/support/dktools/dk4istty.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -67,6 +79,7 @@ dk4istty_file(FILE *fipo, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4istty.h"
#if DK4_HAVE_UNISTD_H
@@ -83,11 +96,33 @@ dk4istty_file(FILE *fipo, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
+
+
+$!trace-include
+
+
+
int
-dk4istty(int fd, dk4_er_t *erp)
+dk4istty(
+#if (DK4_HAVE_ISATTY) || (DK4_HAVE__ISATTY)
+ int fd, dk4_er_t * DK4_ARG_UNUSED(erp)
+#else
+ int fd, dk4_er_t *erp
+#endif
+)
{
int back = -1;
#if DK4_HAVE_ISATTY
+ DK4_UNUSED_ARG(erp)
if ( 0 != isatty(fd) ) {
back = 1;
} else {
@@ -95,6 +130,7 @@ dk4istty(int fd, dk4_er_t *erp)
}
#else
#if DK4_HAVE__ISATTY
+ DK4_UNUSED_ARG(erp)
if ( 0 != _isatty(fd) ) {
back = 1;
} else {
@@ -113,6 +149,9 @@ int
dk4istty_file(FILE *fipo, dk4_er_t *erp)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
#if DK4_HAVE_FILENO
back = dk4istty(fileno(fipo), erp);
diff --git a/support/dktools/dk4istty.h b/support/dktools/dk4istty.h
index b7280d331a..b8eb37a370 100644
--- a/support/dktools/dk4istty.h
+++ b/support/dktools/dk4istty.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4istty.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4istty.ctr
*/
#ifndef DK4ISTTY_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
diff --git a/support/dktools/dk4iter.c b/support/dktools/dk4iter.c
new file mode 100644
index 0000000000..d958ac2b1e
--- /dev/null
+++ b/support/dktools/dk4iter.c
@@ -0,0 +1,1226 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4iter.ctr
+*/
+
+/** @file dk4iter.c The dk4iter module.
+*/
+
+
+#line 401 "dk4iter.ctr"
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_LIMITS_H
+#ifndef LIMITS_H_INCLUDED
+#include <limits.h>
+#define LIMITS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDINT_H
+#ifndef STDINT_H_INCLUDED
+#include <stdint.h>
+#define STDINT_H_INCLUDED 1
+#endif
+#endif
+
+
+#include "dk4mem.h"
+#include "dk4iter.h"
+#include "dk4math.h"
+
+
+
+
+
+#line 443 "dk4iter.ctr"
+
+
+
+/** Initial function value condition.
+*/
+enum {
+ CONDITION_ILLEGAL = 0 ,
+ /** fa < 0, fb >= 0.
+ */
+ CONDITION_FA_LESS_ZERO ,
+
+ /** fa <= 0, fb > 0.
+ */
+ CONDITION_FA_LEQ_ZERO ,
+
+ /** fa > 0, fb <= 0.
+ */
+ CONDITION_FA_GREATER_ZERO ,
+
+ /** fa >= 0, fb < 0.
+ */
+ CONDITION_FA_GEQ_ZERO
+};
+
+
+
+/** Note which interval border was changed in previous step.
+*/
+enum {
+ /** No interval border change yet.
+ */
+ CHANGED_NONE = 0,
+
+ /** Previous step changed interval border a.
+ */
+ CHANGED_A = -1,
+
+ /** Previous step changed interval border b.
+ */
+ CHANGED_B = 1
+};
+
+
+
+/** Flags which restrictions apply to x values.
+*/
+enum {
+ /** Minimum specified.
+ */
+ MINMAX_MINIMUM = 0x0001 ,
+
+ /** Maximum specified.
+ */
+ MINMAX_MAXIMUM = 0x0002 ,
+
+ /** Specified minimum is exclusive.
+ */
+ MINMAX_MIN_EXCL = 0x0004 ,
+
+ /** Specified maximum is exclusive.
+ */
+ MINMAX_MAX_EXCL = 0x0008
+};
+
+
+
+void
+dk4iter_ctx_init(dk4_iter_ctx_t *ctx)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ DK4_MEMRES(ctx,sizeof(dk4_iter_ctx_t));
+ ctx->xmin = 0.0;
+ ctx->xmax = 0.0;
+ ctx->eps_x = 1.0e-8;
+ ctx->eps_y = 1.0e-8;
+ ctx->maxpass = (unsigned long)(DK4_ITER_PASSES_REGULAR);
+ ctx->exact = 0;
+ ctx->algo = DK4_ITER_ALG_RF_ANDERSON_BJOERCK;
+ ctx->minmax = 0;
+ }
+}
+
+
+
+dk4_iter_ctx_t *
+dk4iter_ctx_open(void)
+{
+ dk4_iter_ctx_t *back = NULL;
+ back = dk4mem_new(dk4_iter_ctx_t,1,NULL);
+ if (NULL != back) {
+ dk4iter_ctx_init(back);
+ }
+ return back;
+}
+
+
+
+void
+dk4iter_ctx_close(dk4_iter_ctx_t *ctx)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ dk4mem_free(ctx);
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_eps_x(dk4_iter_ctx_t *ctx, double eps)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->eps_x = eps;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_eps_y(dk4_iter_ctx_t *ctx, double eps)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->eps_y = eps;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_maxpass(dk4_iter_ctx_t *ctx, unsigned long passes)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->maxpass = passes;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_exact(dk4_iter_ctx_t *ctx, int flag)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->exact = flag;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_algorithm(dk4_iter_ctx_t *ctx, int algorithm)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->algo = algorithm;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_min(dk4_iter_ctx_t *ctx, double xmin)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->xmin = xmin;
+ ctx->minmax |= MINMAX_MINIMUM;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_max(dk4_iter_ctx_t *ctx, double xmax)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->xmax = xmax;
+ ctx->minmax |= MINMAX_MAXIMUM;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_exclusive_min(dk4_iter_ctx_t *ctx, double xmin)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->xmin = xmin;
+ ctx->minmax |= (MINMAX_MINIMUM | MINMAX_MIN_EXCL);
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_exclusive_max(dk4_iter_ctx_t *ctx, double xmax)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->xmax = xmax;
+ ctx->minmax |= (MINMAX_MAXIMUM | MINMAX_MAX_EXCL);
+ }
+}
+
+
+
+static
+int
+find_condition(double fa, double fb)
+{
+ int back = CONDITION_ILLEGAL;
+
+ if ((0.0 > fa) && (0.0 <= fb)) {
+ back = CONDITION_FA_LESS_ZERO;
+ }
+ else {
+ if ((0.0 < fa) && (0.0 >= fb)) {
+ back = CONDITION_FA_GREATER_ZERO;
+ }
+ else {
+ if ((0.0 >= fa) && (0.0 < fb)) {
+ back = CONDITION_FA_LEQ_ZERO;
+ }
+ else {
+ if ((0.0 <= fa) && (0.0 > fb)) {
+ back = CONDITION_FA_GEQ_ZERO;
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+/** Calculate gamma value for PEGASUS variant.
+ @param fg Function value at border last set.
+ @param fx Function value at recent x position.
+ @return Gamma value.
+*/
+static
+double
+dk4iter_gamma_pegasus(double fg, double fx)
+{
+ double back;
+ back = fg / (fg + fx);
+ if (0 == dk4ma_is_finite(back)) {
+ back = 0.5;
+ }
+ else {
+ if (0.0 >= back) {
+ back = 0.5;
+ }
+#if 0
+ /* 2018-07-06
+ Can not happen, fg and fx have same sign.
+ */
+ else {
+ if (1.0 < back) {
+ back = 1.0;
+ }
+ }
+#endif
+ }
+ return back;
+}
+
+
+
+/** Calculate gamma value for ANDERSON-BJOERCK variant.
+ @param fg Function value at border last set.
+ @param fx Function value at recent x position.
+ @return Gamma value.
+*/
+static
+double
+dk4iter_gamma_anderson_bjoerck(double fg, double fx)
+{
+ double back;
+ back = 1.0 - fx / fg;
+ if (0 == dk4ma_is_finite(back)) {
+ back = 0.5;
+ }
+ else {
+ if (0.0 >= back) {
+ back = 0.5;
+ }
+#if 0
+ /* 2018-07-06
+ Can not happen as fx and fy have same sign.
+ */
+ else {
+ if (1.0 < back) {
+ back = 1.0;
+ }
+ }
+#endif
+ }
+ return back;
+}
+
+
+
+int
+dk4iter_interval(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double b,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ dk4_iter_ctx_t mctx; /* Copy of context */
+ double fa = 0.0; /* Function value for border a */
+ double fb = 0.0; /* Function value for border b */
+ double x = 0.0; /* Text x value */
+ double fx = 0.0; /* Function value for x */
+ double afx = 0.0; /* Absolute function value for x */
+ double xo = 0.0; /* Previous step x value */
+ double gamma = 0.5; /* Correction factor */
+ unsigned long passno = 0UL; /* Number of current pass */
+ int res = 0; /* Operation result */
+ int cond = 0; /* Condition of interval borders */
+ int cc = 0; /* 1=continue, 0=finished, -1=abort */
+ int pc = CHANGED_NONE; /* Previous border change */
+ int nc = CHANGED_NONE; /* Next change */
+ int back = DK4_ITER_RESULT_E_ARGS;
+
+
+#line 801 "dk4iter.ctr"
+ /* Check function call arguments
+ */
+#if DK4_USE_ASSERT
+ assert(NULL != d);
+ assert(NULL != fct);
+#endif
+ if ((NULL == d) || (NULL == fct)) {
+
+#line 808 "dk4iter.ctr"
+ goto finished;
+ }
+ if (a == b) {
+
+#line 811 "dk4iter.ctr"
+ goto finished;
+ }
+
+ /* Copy or initialize context
+ */
+ if (NULL != ctx) {
+
+#line 817 "dk4iter.ctr"
+ DK4_MEMCPY(&mctx,ctx,sizeof(dk4_iter_ctx_t));
+ }
+ else {
+
+#line 820 "dk4iter.ctr"
+ dk4iter_ctx_init(&mctx);
+ }
+
+ /* Check algorithm specification
+ */
+ if (DK4_ITER_ALG_BISECTION != mctx.algo) {
+ if (DK4_ITER_ALG_RF_PRIMITIVE != mctx.algo) {
+ if (DK4_ITER_ALG_RF_ILLINOIS != mctx.algo) {
+ if (DK4_ITER_ALG_RF_PEGASUS != mctx.algo) {
+ if (DK4_ITER_ALG_RF_ANDERSON_BJOERCK != mctx.algo) {
+ goto finished;
+
+#line 831 "dk4iter.ctr"
+ }
+ }
+ }
+ }
+ }
+
+ /* Calculate borders at beginning, check
+ */
+ res = (*fct)(&fa, a, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fa)))) {
+ back = DK4_ITER_RESULT_E_FCT;
+
+#line 842 "dk4iter.ctr"
+ goto finished;
+ }
+ res = (*fct)(&fb, b, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fb)))) {
+ back = DK4_ITER_RESULT_E_FCT;
+
+#line 847 "dk4iter.ctr"
+ goto finished;
+ }
+ cond = find_condition(fa, fb);
+ if (CONDITION_ILLEGAL == cond) {
+
+#line 851 "dk4iter.ctr"
+ goto finished;
+ }
+
+ /* Prepare iteration loop
+ */
+ passno = 0UL;
+ x = xo = 0.0;
+ cc = 1;
+ pc = CHANGED_NONE;
+
+ /* Run iteration loop
+ */
+ do {
+ /* Keep previous x position
+ */
+ xo = x;
+ /* Increase pass number, but avoid wrapping
+ */
+ if (ULONG_MAX > passno) { passno++; }
+
+#line 870 "dk4iter.ctr"
+ /* Calculate x position
+ */
+
+
+#line 873 "dk4iter.ctr"
+ switch (mctx.algo) {
+ case DK4_ITER_ALG_RF_PRIMITIVE :
+ case DK4_ITER_ALG_RF_ILLINOIS :
+ case DK4_ITER_ALG_RF_PEGASUS :
+ case DK4_ITER_ALG_RF_ANDERSON_BJOERCK : { /* Regula falsi */
+ x = (a * fb - b * fa) / (fb - fa);
+ } break;
+ default : { /* Bisection */
+ x = (a + b) / 2.0;
+ } break;
+ }
+ if (0 == dk4ma_is_finite(x)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+ }
+ else {
+
+#line 889 "dk4iter.ctr"
+ /* Calculate function for x, if x is usable
+ */
+ res = (*fct)(&fx, x, ps);
+ if (0 == res) {
+
+#line 893 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_FCT;
+ cc = -1;
+ }
+ if (0 == dk4ma_is_finite(fx)) {
+
+#line 897 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+ }
+ afx = fabs(fx);
+ if (0 == dk4ma_is_finite(afx)) {
+
+#line 902 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+ }
+ /* Check whether we are done, if we could continue
+ */
+ if (1 == cc) {
+
+#line 908 "dk4iter.ctr"
+
+
+#line 909 "dk4iter.ctr"
+
+
+#line 910 "dk4iter.ctr"
+
+
+#line 911 "dk4iter.ctr"
+ if (isgreater(mctx.eps_y,0.0)) {
+ /* Must check y */
+ if (afx < mctx.eps_y) {
+
+#line 914 "dk4iter.ctr"
+ if ((x == xo) && (1UL < passno)) {
+ cc = 0;
+
+#line 916 "dk4iter.ctr"
+ }
+ else {
+ if (0 == mctx.exact) {
+ if(isgreater(mctx.eps_x,0.0)) {
+ if (isless(fabs(x - xo),mctx.eps_x)) {
+ if (1UL < passno) {
+ cc = 0;
+
+#line 923 "dk4iter.ctr"
+ }
+ }
+ }
+ else {
+ cc = 0;
+
+#line 928 "dk4iter.ctr"
+ }
+ }
+ }
+ }
+ }
+ else {
+
+#line 934 "dk4iter.ctr"
+ /* No y check */
+ if ((x == xo) && (1UL < passno)) {
+ cc = 0;
+
+#line 937 "dk4iter.ctr"
+ }
+ else {
+ if (0 == mctx.exact) {
+ if(isgreater(mctx.eps_x,0.0)) {
+ if (isless(fabs(x - xo),mctx.eps_x)) {
+ if (1UL < passno) {
+ cc = 0;
+
+#line 944 "dk4iter.ctr"
+ }
+ }
+ }
+ else {
+ /* Neither eps_x nor eps_y,
+ so we wait for x=xo.
+ */
+ }
+ }
+ }
+ }
+ }
+ /* Continue for usable y values only
+ */
+ if (1 == cc) {
+ /* Find direction for next change
+ */
+ nc = CHANGED_NONE;
+ switch (cond) {
+ case CONDITION_FA_LESS_ZERO : {
+ if (0.0 > fx) {
+ nc = CHANGED_A;
+ }
+ else {
+ nc = CHANGED_B;
+ }
+ } break;
+ case CONDITION_FA_LEQ_ZERO : {
+ if (0.0 >= fx) {
+ nc = CHANGED_A;
+ }
+ else {
+ nc = CHANGED_B;
+ }
+ } break;
+ case CONDITION_FA_GREATER_ZERO : {
+ if (0.0 < fx) {
+ nc = CHANGED_A;
+ }
+ else {
+ nc = CHANGED_B;
+ }
+ } break;
+ case CONDITION_FA_GEQ_ZERO : {
+ if (0.0 <= fx) {
+ nc = CHANGED_A;
+ }
+ else {
+ nc = CHANGED_B;
+ }
+ } break;
+ }
+ /* Apply interval border change
+ */
+ switch (nc) {
+ case CHANGED_A: {
+
+#line 1000 "dk4iter.ctr"
+ if (CHANGED_A == pc) {
+ switch (mctx.algo) {
+ case DK4_ITER_ALG_RF_ILLINOIS : {
+ fb = 0.5 * fb;
+ if (0 == dk4ma_is_finite(fb)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+
+#line 1007 "dk4iter.ctr"
+ }
+ } break;
+ case DK4_ITER_ALG_RF_PEGASUS : {
+ gamma = dk4iter_gamma_pegasus(fa, fx);
+ fb *= gamma;
+ if (0 == dk4ma_is_finite(fb)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+
+#line 1015 "dk4iter.ctr"
+ }
+ } break;
+ case DK4_ITER_ALG_RF_ANDERSON_BJOERCK : {
+ gamma = dk4iter_gamma_anderson_bjoerck(
+ fa, fx
+ );
+ fb *= gamma;
+ if (0 == dk4ma_is_finite(fb)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+
+#line 1025 "dk4iter.ctr"
+ }
+ } break;
+ }
+ }
+ a = x;
+ fa = fx;
+ pc = CHANGED_A;
+ } break;
+ case CHANGED_B: {
+
+#line 1034 "dk4iter.ctr"
+ if (CHANGED_B == pc) {
+ switch (mctx.algo) {
+ case DK4_ITER_ALG_RF_ILLINOIS : {
+ fa = 0.5 * fa;
+ if (0 == dk4ma_is_finite(fa)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+
+#line 1041 "dk4iter.ctr"
+ }
+ } break;
+ case DK4_ITER_ALG_RF_PEGASUS : {
+ gamma = dk4iter_gamma_pegasus(
+ fb, fx
+ );
+ fa *= gamma;
+ if (0 == dk4ma_is_finite(fa)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+
+#line 1051 "dk4iter.ctr"
+ }
+ } break;
+ case DK4_ITER_ALG_RF_ANDERSON_BJOERCK : {
+ gamma = dk4iter_gamma_anderson_bjoerck(
+ fb, fx
+ );
+ fa *= gamma;
+ if (0 == dk4ma_is_finite(fa)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+
+#line 1061 "dk4iter.ctr"
+ }
+ } break;
+ }
+ }
+ b = x;
+ fb = fx;
+ pc = CHANGED_B;
+ } break;
+ default: {
+ /* ERROR: Must not happen */
+ back = DK4_ITER_RESULT_E_CONV;
+
+#line 1072 "dk4iter.ctr"
+ cc = -1;
+ } break;
+ }
+ }
+ }
+ /* Check number of passes
+ */
+ if ((1 == cc) && (0UL < mctx.maxpass) && (passno >= mctx.maxpass)) {
+ back = DK4_ITER_RESULT_E_PASSES;
+
+#line 1081 "dk4iter.ctr"
+ cc = -1;
+ }
+ } while (1 == cc);
+
+ /* Success
+ */
+ if (0 == cc) {
+ *d = x;
+ if (NULL != pp) { *pp = passno; }
+ back = DK4_ITER_RESULT_SUCCESS;
+ }
+
+ finished:
+
+
+#line 1095 "dk4iter.ctr"
+ return back;
+}
+
+
+
+/** Run Newton iteration.
+ @param d Destination (address of result variable).
+ @param pp Address of variable to store number of passes on success.
+ @param fct Iteration function, returns two values into the array
+ at address d: the function value and the first derivative
+ value.
+ @param ps Parameter set, may be NULL if fct does not use it.
+ @param x0 Start point.
+ @param ctx Iteration context, may be NULL.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_PASSES, DK4_ITER_RESULT_E_INFINITE,
+ DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV, DK4_ITER_RESULT_E_FCT,
+ or DK4_ITER_RESULT_E_ARGS on error.
+*/
+static
+int
+dk4iter_newton(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double x0,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ double v[2];
+ double xn = 0.0;
+ unsigned long passno = 0UL;
+ int back = DK4_ITER_RESULT_E_ARGS;
+ int cc = 1;
+ int res = 0;
+
+
+#line 1132 "dk4iter.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != d);
+ assert(NULL != fct);
+#endif
+ res = (*fct)(v, x0, ps);
+ if (0 == res) {
+ cc = -1;
+
+#line 1139 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_FCT;
+ }
+ if (!((dk4ma_is_finite(v[0])) && (dk4ma_is_finite(v[1])))) {
+ cc = -1;
+
+#line 1143 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ }
+ while (1 == cc) {
+ if (ULONG_MAX > passno) { passno++; }
+
+#line 1147 "dk4iter.ctr"
+ xn = x0 - v[0] / v[1];
+ if (dk4ma_is_finite(xn)) {
+
+#line 1149 "dk4iter.ctr"
+ if (0 != (MINMAX_MINIMUM & (ctx->minmax))) {
+ if (0 != (MINMAX_MIN_EXCL & (ctx->minmax))) {
+ if (xn <= ctx->xmin) {
+ cc = -1;
+
+#line 1153 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ else {
+ if (xn < ctx->xmin) {
+ cc = -1;
+
+#line 1159 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ }
+ if (0 != (MINMAX_MAXIMUM & (ctx->minmax))) {
+ if (0 != (MINMAX_MAX_EXCL & (ctx->minmax))) {
+ if (xn >= ctx->xmax) {
+ cc = -1;
+
+#line 1167 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ else {
+ if (xn > ctx->xmax) {
+ cc = -1;
+
+#line 1173 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ }
+ if (1 == cc) {
+ res = (*fct)(v, xn, ps);
+ if (0 == res) {
+ cc = -1;
+
+#line 1181 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_FCT;
+ }
+ if (!((dk4ma_is_finite(v[0])) && (dk4ma_is_finite(v[1])))) {
+ cc = -1;
+
+#line 1185 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ }
+ if (1 == cc) {
+
+
+#line 1189 "dk4iter.ctr"
+
+
+#line 1190 "dk4iter.ctr"
+ if (isgreater(ctx->eps_y,0.0)) {
+
+#line 1191 "dk4iter.ctr"
+ if (fabs(v[0]) < ctx->eps_y) {
+
+#line 1192 "dk4iter.ctr"
+ if (xn == x0) {
+ cc = 0;
+
+#line 1194 "dk4iter.ctr"
+ }
+ else {
+ if (0 == ctx->exact) {
+
+#line 1197 "dk4iter.ctr"
+ if(isgreater(ctx->eps_x,0.0)) {
+ if (isless(fabs(xn - x0),ctx->eps_x)) {
+ cc = 0;
+
+#line 1200 "dk4iter.ctr"
+ }
+ }
+ else {
+ cc = 0;
+
+#line 1204 "dk4iter.ctr"
+ }
+ }
+ }
+ }
+ }
+ else {
+
+#line 1210 "dk4iter.ctr"
+ if (xn == x0) {
+ cc = 0;
+
+#line 1212 "dk4iter.ctr"
+ }
+ else {
+ if (0 == ctx->exact) {
+ if (isgreater(ctx->eps_x,0.0)) {
+ if (isless(fabs(xn - x0),ctx->eps_x)) {
+ cc = 0;
+
+#line 1218 "dk4iter.ctr"
+ }
+ }
+ else {
+ /* Neither eps_x nor eps_y,
+ so we wait for x=x0.
+ */
+ }
+ }
+ }
+ }
+ }
+ x0 = xn;
+ }
+ }
+ else {
+ cc = -1;
+
+#line 1234 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ }
+ if ((1 == cc) && (0UL < ctx->maxpass) && (passno >= ctx->maxpass)) {
+ cc = -1;
+ back = DK4_ITER_RESULT_E_PASSES;
+ }
+ }
+ if (0 == cc) {
+ *d = xn;
+ if (NULL != pp) { *pp = passno; }
+ back = DK4_ITER_RESULT_SUCCESS;
+ }
+
+
+#line 1247 "dk4iter.ctr"
+ return back;
+}
+
+
+
+/** Run fix point iteration.
+ @param d Destination (address of result variable).
+ @param pp Address of variable to store number of passes on success.
+ @param fct Iteration function, the phi part of phi(x)=x.
+ @param ps Parameter set, may be NULL if fct does not use it.
+ @param x0 Start point.
+ @param ctx Iteration context, may be NULL.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_PASSES, DK4_ITER_RESULT_E_INFINITE,
+ DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV, DK4_ITER_RESULT_E_FCT,
+ or DK4_ITER_RESULT_E_ARGS on error.
+*/
+static
+int
+dk4iter_fix_point(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double x0,
+ dk4_iter_ctx_t const *ctx
+)
+{
+#if 0
+ double a; /* Border from previous steps */
+ double b; /* Border from previous steps */
+#endif
+ double xn = 0.0; /* New x value */
+ unsigned long passno = 0UL; /* Iteration step number */
+ int res = 0; /* Function evaluation result */
+ int cc = 1; /* Flag: Can continue */
+ int back = DK4_ITER_RESULT_E_ARGS;
+
+
+#line 1285 "dk4iter.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != d);
+ assert(NULL != fct);
+#endif
+ while (1 == cc) {
+ if (ULONG_MAX > passno) { passno++; }
+
+#line 1291 "dk4iter.ctr"
+ /*
+ Calculate new x, check result
+ */
+ res = (*fct)(&xn, x0, ps);
+ if (0 == res) {
+ cc = -1;
+
+#line 1297 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_FCT;
+ }
+ if (!(dk4ma_is_finite(xn))) {
+ cc = -1;
+
+#line 1301 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ }
+ if (1 == cc) {
+
+#line 1304 "dk4iter.ctr"
+ /*
+ Check whether specified interval is exceeded
+ */
+ if (0 != (MINMAX_MINIMUM & (ctx->minmax))) {
+ if (0 != (MINMAX_MIN_EXCL & (ctx->minmax))) {
+ if (xn <= ctx->xmin) {
+ cc = -1;
+
+#line 1311 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ else {
+ if (xn < ctx->xmin) {
+ cc = -1;
+
+#line 1317 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ }
+ if (0 != (MINMAX_MAXIMUM & (ctx->minmax))) {
+ if (0 != (MINMAX_MAX_EXCL & (ctx->minmax))) {
+ if (xn >= ctx->xmax) {
+ cc = -1;
+
+#line 1325 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ else {
+ if (xn > ctx->xmax) {
+ cc = -1;
+
+#line 1331 "dk4iter.ctr"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ }
+ if (1 == cc) {
+ if (1 == cc) {
+ /*
+ Check whether we are finished
+ */
+ if (xn == x0) {
+ cc = 0;
+
+#line 1342 "dk4iter.ctr"
+ }
+ else {
+ if ((0 == ctx->exact) && (0.0 < ctx->eps_x)) {
+ if (isless(fabs(xn-x0),ctx->eps_x)) {
+ cc = 0;
+
+#line 1347 "dk4iter.ctr"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1350 "dk4iter.ctr"
+ }
+#endif
+ }
+ else {
+
+#line 1354 "dk4iter.ctr"
+ }
+ }
+ }
+ }
+ x0 = xn;
+ }
+ /* Stop if too many passes
+ */
+ if (1 == cc) {
+ if ((0UL < ctx->maxpass) && (passno >= ctx->maxpass)) {
+ cc = -1;
+ back = DK4_ITER_RESULT_E_PASSES;
+ }
+ }
+ }
+ if (0 == cc) {
+ *d = xn;
+ if (NULL != pp) { *pp = passno; }
+ back = DK4_ITER_RESULT_SUCCESS;
+ }
+
+
+#line 1375 "dk4iter.ctr"
+ return back;
+}
+
+
+
+int
+dk4iter_start_point(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double x0,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ dk4_iter_ctx_t mctx;
+ int back = DK4_ITER_RESULT_E_ARGS;
+
+ /* Check function call arguments
+ */
+#if DK4_USE_ASSERT
+ assert(NULL != d);
+ assert(NULL != fct);
+#endif
+ if ((NULL == d) || (NULL == fct)) {
+ goto finished;
+ }
+ /* Copy or initialize context
+ */
+ if (NULL != ctx) {
+ DK4_MEMCPY(&mctx,ctx,sizeof(dk4_iter_ctx_t));
+ }
+ else {
+ dk4iter_ctx_init(&mctx);
+ mctx.algo = DK4_ITER_ALG_NEWTON;
+ }
+ /* Check x0 in interval
+ */
+ if (0 != (MINMAX_MINIMUM & (mctx.minmax))) {
+ if (0 != (MINMAX_MIN_EXCL & (mctx.minmax))) {
+ if (x0 <= mctx.xmin) {
+ goto finished;
+ }
+ }
+ else {
+ if (x0 < mctx.xmin) {
+ goto finished;
+ }
+ }
+ }
+ if (0 != (MINMAX_MAXIMUM & (mctx.minmax))) {
+ if (0 != (MINMAX_MAX_EXCL & (mctx.minmax))) {
+ if (x0 >= mctx.xmax) {
+ goto finished;
+ }
+ }
+ else {
+ if (x0 > mctx.xmax) {
+ goto finished;
+ }
+ }
+ }
+ /* Call function for specified algorithm.
+ */
+ switch (mctx.algo) {
+ case DK4_ITER_ALG_NEWTON : {
+ back = dk4iter_newton(d, pp, fct, ps, x0, &mctx);
+ } break;
+ case DK4_ITER_ALG_FIX_POINT : {
+ back = dk4iter_fix_point(d, pp, fct, ps, x0, &mctx);
+ } break;
+ }
+
+ finished:
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4iter.ctr b/support/dktools/dk4iter.ctr
new file mode 100644
index 0000000000..1cd125b366
--- /dev/null
+++ b/support/dktools/dk4iter.ctr
@@ -0,0 +1,1456 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4iter.h Iteration algorithms for root finding.
+
+This module implements the following root finding iteration algorithms:
+- Bisection
+- Regula falsi (primitive form, Illinois, Pegasus, Anderson-Bjoerck)
+- Newton
+- fix point
+
+The function to iterate must be implemented as dk4_iter_fct_t.
+This function type returns an integer value (non-zero to indicate a
+successful calculation, 0 to indicate an error).
+The function expects the following arguments:
+- Result address<br>
+ Address of a variable or an array to store the calculation result.
+ Functions for Newton iteration algorithm store 2 values: Function value
+ and value of the first derivative.
+- X position<br>
+ The x value you want a function value for.
+- Address of parameter set.
+ Additional parameters probably required by the function. I.e. for a
+ polynomial calculation function you may specify the coefficients here.
+ This parameter is optional.
+
+Details for an iteration may be specified in an iteration context.
+The dk4iter_ctx_open() creates such a context and returns a pointer.
+Use dk4iter_ctx_close() to release the context when done with it.
+Alternatively use a automatic/static variable of the dk4_iter_ctx_t type
+and initialize it using the dk4iter_ctx_init() function.
+
+The dk4iter_ctx_set_algorithm() function chooses the iteration method.
+
+For Newton and fixpoint the context may specify an x interval the
+iteration must not leave. Leaving the interval results in abort.
+The dk4iter_ctx_set_min(), dk4iter_ctx_set_exclusive_min(),
+dk4iter_ctx_set_max() and dk4iter_ctx_set_exclusive_max() functions can
+be used to set closed and open interval borders.
+
+Tolerance values (epsilon) may be specified for
+- y direction unless fixpoint is used and/or
+- x direction.
+Use dk4iter_ctx_set_eps_y() and dk4iter_ctx_set_eps_x() to set the
+tolerances.
+Use 0.0 or negative tolerances to skip one check (not both!).
+
+Once the iteration reached allowed y difference you can decide
+to stop when the x difference is in allowed tolerance range too or
+to continue until full machine precision is reached (new x is exactly
+the same as previous x).
+I do not recommend attempts to iterate to full machine precision as this
+(a) may fail for some functions resulting in an oscillation and
+(b) uses a larger number of iteration passes and.
+Use dk4iter_ctx_set_exact() to control this.
+
+The dk4iter_ctx_set_maxpass() function sets the maximum number of
+iteration passes (iteration steps). The iteration is aborted if there
+is no success within this maximum number of passes.
+Although you can use 0 to set an unlimited number of passes I do not recommend
+to do so.
+
+The dk4iter_interval() function runs an iteration for a specified interval.
+
+The dk4iter_start_point() function runs an iteration if just one
+starting x value is specified.
+
+If no context is specified the following defaults are used:
+
+Option | Default
+:----: | :------
+Algorithm | DK4_ITER_ALG_RF_ANDERSON_BJOERCK for dk4iter_interval(), DK4_ITER_ALG_NEWTON for dk4iter_start_point().
+Max passes | 256.
+Y tolerance | 1.0e-8
+X tolerance | 1.0e-8
+Full machine precision | No.
+Restricted x interval | None.
+
+*/
+
+
+
+/** Border values for maximum number of iteration passes.
+*/
+enum {
+ /** Number of passes for average cases.
+ */
+ DK4_ITER_PASSES_REGULAR = 256 ,
+
+ /** Do not set a limit on the number of passes.
+ Warning: Might result in an endless loop!
+ */
+ DK4_ITER_PASSES_UNLIMITED = 0
+};
+
+
+
+/** Iteration algorithms.
+*/
+enum {
+ /** Interval bisection.
+ */
+ DK4_ITER_ALG_BISECTION = 0 ,
+
+ /** Primitive from of regula falsi.
+ */
+ DK4_ITER_ALG_RF_PRIMITIVE ,
+
+ /** Regula falsi, Illinois variant.
+ */
+ DK4_ITER_ALG_RF_ILLINOIS ,
+
+ /** Regula falsi, Pegasus variant.
+ */
+ DK4_ITER_ALG_RF_PEGASUS ,
+
+ /** Regula falsi, Anderson-Bjoerck variant.
+ */
+ DK4_ITER_ALG_RF_ANDERSON_BJOERCK ,
+
+ /** Newton algorithm.
+ The function must place 2 elements
+ in the array specified by pointer:
+ Function value and derivative value.
+ */
+ DK4_ITER_ALG_NEWTON ,
+
+ /** Fix point algorithm.
+ The function must be the phi(x)
+ function from the
+ phi(x) = x equation.
+ */
+ DK4_ITER_ALG_FIX_POINT
+};
+
+
+
+/** Iteration result.
+*/
+enum {
+ /** Iteration succeeded.
+ */
+ DK4_ITER_RESULT_SUCCESS = 1 ,
+
+ /** Error: Too many passes without success.
+ */
+ DK4_ITER_RESULT_E_PASSES = 0 ,
+
+ /** Error: Infinite value or NaN in calculation.
+ */
+ DK4_ITER_RESULT_E_INFINITE = -1 ,
+
+ /** Error: X left initial interval.
+ Can happen with Newton and fix point
+ algorithm.
+ */
+ DK4_ITER_RESULT_E_OOR = -2 ,
+
+ /** Error: Not converging.
+ Fix point algorithm: Interval was enlarging.
+ */
+ DK4_ITER_RESULT_E_CONV = -3 ,
+
+ /** Function calculation failed.
+ */
+ DK4_ITER_RESULT_E_FCT = -4 ,
+
+ /** Invalid arguments passed to function call.
+ */
+ DK4_ITER_RESULT_E_ARGS = -5
+};
+
+
+
+/** Function to iterate.
+ @param d Destination address. One element for all algorithms
+ except DK4_ITER_ALG_NEWTON which saves function value and derivative
+ value in a 2 elements array.
+ @param x X position to calculate the function value for.
+ @param ps Parameter set, may be NULL.
+ @return Non-zero value on success, 0 on error.
+*/
+typedef int dk4_iter_fct_t(double *d, double x, const void *ps);
+
+
+/** Iteration context.
+*/
+typedef struct {
+ double xmin; /**< Minimum of x interval. */
+ double xmax; /**< Maximum of x interval. */
+ double eps_x; /**< Epsilon for x change. */
+ double eps_y; /**< Epsilon for absolute y value. */
+ unsigned long maxpass; /**< Maximum number of passes. */
+ int exact; /**< Flag: End only if there is no x change. */
+ int algo; /**< Iteration algorithm to use. */
+ int minmax; /**< Flags: min(1), max(2) set. */
+} dk4_iter_ctx_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open new iteration context.
+ Allocate memory for new iteration context, set up default value.
+ A context allocated by this function must be released after
+ use by the dk4iter_ctx_close() function.
+ @return Valid pointer to new context on success, NULL on error.
+*/
+
+dk4_iter_ctx_t *
+dk4iter_ctx_open(void);
+
+
+/** Initialize a context to default values.
+ @param ctx Context to initialize.
+*/
+
+void
+dk4iter_ctx_init(dk4_iter_ctx_t *ctx);
+
+
+/** Close iteration context.
+ Release memory assigned to the context.
+ @param ctx Context created by dk4iter_ctx_open().
+*/
+
+void
+dk4iter_ctx_close(dk4_iter_ctx_t *ctx);
+
+
+/** Set epsilon value for x change.
+ @param ctx Context to modify.
+ @param eps Epsilon value for x change.
+*/
+
+void
+dk4iter_ctx_set_eps_x(dk4_iter_ctx_t *ctx, double eps);
+
+
+/** Set maximum absolute y value.
+ @param ctx Context to modify.
+ @param eps Maximum absolute y value.
+*/
+
+void
+dk4iter_ctx_set_eps_y(dk4_iter_ctx_t *ctx, double eps);
+
+
+/** Set maximum number of passes (iteration steps).
+ @param ctx Context to modify.
+ @param passes Maximum number of passes, 0 or negative values indicate
+ an unlimited number of steps.
+*/
+
+void
+dk4iter_ctx_set_maxpass(dk4_iter_ctx_t *ctx, unsigned long passes);
+
+
+/** Set flag for exact iteration.
+ If the flag is activated, iteration is continued until there is
+ no longer any change in the x value. For some functions you can
+ retrieve a result in machine precision using this flag, for other
+ functions the iteration may fail.
+ @param ctx Context to modify.
+ @param flag New flag value, 0=inactive, other=active.
+ The recommended value is 0.
+*/
+
+void
+dk4iter_ctx_set_exact(dk4_iter_ctx_t *ctx, int flag);
+
+
+/** Set up iteration algorithm.
+ @param ctx Context to modify.
+ @param algorithm Algorithm to use.
+*/
+
+void
+dk4iter_ctx_set_algorithm(dk4_iter_ctx_t *ctx, int algorithm);
+
+
+/** Set interval minimum.
+ The allowed interval is only used for Newton and fixed point
+ algorithm.
+ @param ctx Context to modify.
+ @param xmin Minimum x value allowed.
+*/
+
+void
+dk4iter_ctx_set_min(dk4_iter_ctx_t *ctx, double xmin);
+
+
+/** Set exlusive interval minimum (open interval border).
+ The allowed interval is only used for Newton and fixed point
+ algorithm.
+ @param ctx Context to modify.
+ @param xmin Minimum x value allowed.
+*/
+
+void
+dk4iter_ctx_set_exclusive_min(dk4_iter_ctx_t *ctx, double xmin);
+
+
+/** Set interval maximum.
+ The allowed interval is only used for Newton and fixed point
+ algorithm.
+ @param ctx Context to modify.
+ @param xmax Maximum x value allowed.
+*/
+
+void
+dk4iter_ctx_set_max(dk4_iter_ctx_t *ctx, double xmax);
+
+
+/** Set exclusive interval maximum (open interval border).
+ The allowed interval is only used for Newton and fixed point
+ algorithm.
+ @param ctx Context to modify.
+ @param xmax Maximum x value allowed.
+*/
+
+void
+dk4iter_ctx_set_exclusive_max(dk4_iter_ctx_t *ctx, double xmax);
+
+
+/** Run iteration.
+ The algorithm in the context must be one from:
+ DK4_ITER_ALG_BISECTION, DK4_ITER_ALG_RF_PRIMITIVE, DK4_ITER_ALG_RF_ILLINOIS,
+ DK4_ITER_ALG_RF_PEGASUS DK4_ITER_ALG_RF_ANDERSON_BJOERCK.
+ Without a context DK4_ITER_ALG_RF_ANDERSON_BJOERCK is used as default.
+ @param d Address of result variable.
+ @param pp Address of variable to store number of passes, may be NULL.
+ @param fct Function to find root for.
+ @param ps Parameter set for function, may be NULL.
+ @param a One interval border.
+ @param b Other interval border.
+ @param ctx Iteration context.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_PASSES, DK4_ITER_RESULT_E_INFINITE,
+ DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV or
+ DK4_ITER_RESULT_E_FCT on error.
+*/
+
+int
+dk4iter_interval(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double b,
+ dk4_iter_ctx_t const *ctx
+);
+
+
+/** Run iteration.
+ The algorithm in the context must be one from:
+ DK4_ITER_ALG_NEWTON, DK4_ITER_ALG_FIX_POINT.
+ Without a context, DK4_ITER_ALG_NEWTON is used as default.
+ @param d Address of result variable.
+ @param pp Address of variable to store number of passes, may be NULL.
+ @param fct Function to find root for.
+ For Newton iteration this function must set two values
+ in the destination array: function value and derivative value.
+ For fixpoint iteration the function calculates the
+ phi(x) part of phi(x)=x.
+ @param ps Parameter set for function, may be NULL.
+ @param x0 Start point.
+ @param ctx Iteration context.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_PASSES, DK4_ITER_RESULT_E_INFINITE,
+ DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV or
+ DK4_ITER_RESULT_E_FCT on error.
+*/
+
+int
+dk4iter_start_point(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double x0,
+ dk4_iter_ctx_t const *ctx
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_LIMITS_H
+#ifndef LIMITS_H_INCLUDED
+#include <limits.h>
+#define LIMITS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDINT_H
+#ifndef STDINT_H_INCLUDED
+#include <stdint.h>
+#define STDINT_H_INCLUDED 1
+#endif
+#endif
+
+
+#include "dk4mem.h"
+#include "dk4iter.h"
+#include "dk4math.h"
+
+
+
+$!trace-include
+
+
+
+/** Initial function value condition.
+*/
+enum {
+ CONDITION_ILLEGAL = 0 ,
+ /** fa < 0, fb >= 0.
+ */
+ CONDITION_FA_LESS_ZERO ,
+
+ /** fa <= 0, fb > 0.
+ */
+ CONDITION_FA_LEQ_ZERO ,
+
+ /** fa > 0, fb <= 0.
+ */
+ CONDITION_FA_GREATER_ZERO ,
+
+ /** fa >= 0, fb < 0.
+ */
+ CONDITION_FA_GEQ_ZERO
+};
+
+
+
+/** Note which interval border was changed in previous step.
+*/
+enum {
+ /** No interval border change yet.
+ */
+ CHANGED_NONE = 0,
+
+ /** Previous step changed interval border a.
+ */
+ CHANGED_A = -1,
+
+ /** Previous step changed interval border b.
+ */
+ CHANGED_B = 1
+};
+
+
+
+/** Flags which restrictions apply to x values.
+*/
+enum {
+ /** Minimum specified.
+ */
+ MINMAX_MINIMUM = 0x0001 ,
+
+ /** Maximum specified.
+ */
+ MINMAX_MAXIMUM = 0x0002 ,
+
+ /** Specified minimum is exclusive.
+ */
+ MINMAX_MIN_EXCL = 0x0004 ,
+
+ /** Specified maximum is exclusive.
+ */
+ MINMAX_MAX_EXCL = 0x0008
+};
+
+
+
+void
+dk4iter_ctx_init(dk4_iter_ctx_t *ctx)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ DK4_MEMRES(ctx,sizeof(dk4_iter_ctx_t));
+ ctx->xmin = 0.0;
+ ctx->xmax = 0.0;
+ ctx->eps_x = 1.0e-8;
+ ctx->eps_y = 1.0e-8;
+ ctx->maxpass = (unsigned long)(DK4_ITER_PASSES_REGULAR);
+ ctx->exact = 0;
+ ctx->algo = DK4_ITER_ALG_RF_ANDERSON_BJOERCK;
+ ctx->minmax = 0;
+ }
+}
+
+
+
+dk4_iter_ctx_t *
+dk4iter_ctx_open(void)
+{
+ dk4_iter_ctx_t *back = NULL;
+ back = dk4mem_new(dk4_iter_ctx_t,1,NULL);
+ if (NULL != back) {
+ dk4iter_ctx_init(back);
+ }
+ return back;
+}
+
+
+
+void
+dk4iter_ctx_close(dk4_iter_ctx_t *ctx)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ dk4mem_free(ctx);
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_eps_x(dk4_iter_ctx_t *ctx, double eps)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->eps_x = eps;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_eps_y(dk4_iter_ctx_t *ctx, double eps)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->eps_y = eps;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_maxpass(dk4_iter_ctx_t *ctx, unsigned long passes)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->maxpass = passes;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_exact(dk4_iter_ctx_t *ctx, int flag)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->exact = flag;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_algorithm(dk4_iter_ctx_t *ctx, int algorithm)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->algo = algorithm;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_min(dk4_iter_ctx_t *ctx, double xmin)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->xmin = xmin;
+ ctx->minmax |= MINMAX_MINIMUM;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_max(dk4_iter_ctx_t *ctx, double xmax)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->xmax = xmax;
+ ctx->minmax |= MINMAX_MAXIMUM;
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_exclusive_min(dk4_iter_ctx_t *ctx, double xmin)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->xmin = xmin;
+ ctx->minmax |= (MINMAX_MINIMUM | MINMAX_MIN_EXCL);
+ }
+}
+
+
+
+void
+dk4iter_ctx_set_exclusive_max(dk4_iter_ctx_t *ctx, double xmax)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ctx);
+#endif
+ if (NULL != ctx) {
+ ctx->xmax = xmax;
+ ctx->minmax |= (MINMAX_MAXIMUM | MINMAX_MAX_EXCL);
+ }
+}
+
+
+
+static
+int
+find_condition(double fa, double fb)
+{
+ int back = CONDITION_ILLEGAL;
+
+ if ((0.0 > fa) && (0.0 <= fb)) {
+ back = CONDITION_FA_LESS_ZERO;
+ }
+ else {
+ if ((0.0 < fa) && (0.0 >= fb)) {
+ back = CONDITION_FA_GREATER_ZERO;
+ }
+ else {
+ if ((0.0 >= fa) && (0.0 < fb)) {
+ back = CONDITION_FA_LEQ_ZERO;
+ }
+ else {
+ if ((0.0 <= fa) && (0.0 > fb)) {
+ back = CONDITION_FA_GEQ_ZERO;
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+/** Calculate gamma value for PEGASUS variant.
+ @param fg Function value at border last set.
+ @param fx Function value at recent x position.
+ @return Gamma value.
+*/
+static
+double
+dk4iter_gamma_pegasus(double fg, double fx)
+{
+ double back;
+ back = fg / (fg + fx);
+ if (0 == dk4ma_is_finite(back)) {
+ back = 0.5;
+ }
+ else {
+ if (0.0 >= back) {
+ back = 0.5;
+ }
+#if 0
+ /* 2018-07-06
+ Can not happen, fg and fx have same sign.
+ */
+ else {
+ if (1.0 < back) {
+ back = 1.0;
+ }
+ }
+#endif
+ }
+ return back;
+}
+
+
+
+/** Calculate gamma value for ANDERSON-BJOERCK variant.
+ @param fg Function value at border last set.
+ @param fx Function value at recent x position.
+ @return Gamma value.
+*/
+static
+double
+dk4iter_gamma_anderson_bjoerck(double fg, double fx)
+{
+ double back;
+ back = 1.0 - fx / fg;
+ if (0 == dk4ma_is_finite(back)) {
+ back = 0.5;
+ }
+ else {
+ if (0.0 >= back) {
+ back = 0.5;
+ }
+#if 0
+ /* 2018-07-06
+ Can not happen as fx and fy have same sign.
+ */
+ else {
+ if (1.0 < back) {
+ back = 1.0;
+ }
+ }
+#endif
+ }
+ return back;
+}
+
+
+
+int
+dk4iter_interval(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double b,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ dk4_iter_ctx_t mctx; /* Copy of context */
+ double fa = 0.0; /* Function value for border a */
+ double fb = 0.0; /* Function value for border b */
+ double x = 0.0; /* Text x value */
+ double fx = 0.0; /* Function value for x */
+ double afx = 0.0; /* Absolute function value for x */
+ double xo = 0.0; /* Previous step x value */
+ double gamma = 0.5; /* Correction factor */
+ unsigned long passno = 0UL; /* Number of current pass */
+ int res = 0; /* Operation result */
+ int cond = 0; /* Condition of interval borders */
+ int cc = 0; /* 1=continue, 0=finished, -1=abort */
+ int pc = CHANGED_NONE; /* Previous border change */
+ int nc = CHANGED_NONE; /* Next change */
+ int back = DK4_ITER_RESULT_E_ARGS;
+ $? "+ dk4iter_interval"
+ /* Check function call arguments
+ */
+#if DK4_USE_ASSERT
+ assert(NULL != d);
+ assert(NULL != fct);
+#endif
+ if ((NULL == d) || (NULL == fct)) { $? "! d or fct"
+ goto finished;
+ }
+ if (a == b) { $? "! zero length interval"
+ goto finished;
+ }
+
+ /* Copy or initialize context
+ */
+ if (NULL != ctx) { $? ". use context"
+ DK4_MEMCPY(&mctx,ctx,sizeof(dk4_iter_ctx_t));
+ }
+ else { $? ". no context, use defaults"
+ dk4iter_ctx_init(&mctx);
+ }
+
+ /* Check algorithm specification
+ */
+ if (DK4_ITER_ALG_BISECTION != mctx.algo) {
+ if (DK4_ITER_ALG_RF_PRIMITIVE != mctx.algo) {
+ if (DK4_ITER_ALG_RF_ILLINOIS != mctx.algo) {
+ if (DK4_ITER_ALG_RF_PEGASUS != mctx.algo) {
+ if (DK4_ITER_ALG_RF_ANDERSON_BJOERCK != mctx.algo) {
+ goto finished; $? "! illegal algorithm"
+ }
+ }
+ }
+ }
+ }
+
+ /* Calculate borders at beginning, check
+ */
+ res = (*fct)(&fa, a, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fa)))) {
+ back = DK4_ITER_RESULT_E_FCT; $? "! function calculation for a"
+ goto finished;
+ }
+ res = (*fct)(&fb, b, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fb)))) {
+ back = DK4_ITER_RESULT_E_FCT; $? "! function calculation for b"
+ goto finished;
+ }
+ cond = find_condition(fa, fb);
+ if (CONDITION_ILLEGAL == cond) { $? "! invalid interval"
+ goto finished;
+ }
+
+ /* Prepare iteration loop
+ */
+ passno = 0UL;
+ x = xo = 0.0;
+ cc = 1;
+ pc = CHANGED_NONE;
+
+ /* Run iteration loop
+ */
+ do {
+ /* Keep previous x position
+ */
+ xo = x;
+ /* Increase pass number, but avoid wrapping
+ */
+ if (ULONG_MAX > passno) { passno++; } $? ". pass %lu", passno
+ /* Calculate x position
+ */
+ $? ". a = %lg fa = %lg b = %lg fb = %lg", a, fa, b, fb
+ switch (mctx.algo) {
+ case DK4_ITER_ALG_RF_PRIMITIVE :
+ case DK4_ITER_ALG_RF_ILLINOIS :
+ case DK4_ITER_ALG_RF_PEGASUS :
+ case DK4_ITER_ALG_RF_ANDERSON_BJOERCK : { /* Regula falsi */
+ x = (a * fb - b * fa) / (fb - fa);
+ } break;
+ default : { /* Bisection */
+ x = (a + b) / 2.0;
+ } break;
+ }
+ if (0 == dk4ma_is_finite(x)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+ }
+ else { $? ". x = %lg", x
+ /* Calculate function for x, if x is usable
+ */
+ res = (*fct)(&fx, x, ps);
+ if (0 == res) { $? "! function calculation for x"
+ back = DK4_ITER_RESULT_E_FCT;
+ cc = -1;
+ }
+ if (0 == dk4ma_is_finite(fx)) { $? "! function calculation for x"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+ }
+ afx = fabs(fx);
+ if (0 == dk4ma_is_finite(afx)) { $? "! absolute value for fx"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1;
+ }
+ /* Check whether we are done, if we could continue
+ */
+ if (1 == cc) { $? ". y = %lg", fx
+ $!trace-code if (1UL < passno) {
+ $? ". x-delta = %lg", fabs(x - xo)
+ $!trace-code }
+ if (isgreater(mctx.eps_y,0.0)) {
+ /* Must check y */
+ if (afx < mctx.eps_y) { $? ". y small enough"
+ if ((x == xo) && (1UL < passno)) {
+ cc = 0; $? ". OK exact match"
+ }
+ else {
+ if (0 == mctx.exact) {
+ if(isgreater(mctx.eps_x,0.0)) {
+ if (isless(fabs(x - xo),mctx.eps_x)) {
+ if (1UL < passno) {
+ cc = 0; $? ". OK small step"
+ }
+ }
+ }
+ else {
+ cc = 0; $? ". OK no x step restriction"
+ }
+ }
+ }
+ }
+ }
+ else { $? ". no y check required"
+ /* No y check */
+ if ((x == xo) && (1UL < passno)) {
+ cc = 0; $? ". OK exact match"
+ }
+ else {
+ if (0 == mctx.exact) {
+ if(isgreater(mctx.eps_x,0.0)) {
+ if (isless(fabs(x - xo),mctx.eps_x)) {
+ if (1UL < passno) {
+ cc = 0; $? ". OK x step small enough"
+ }
+ }
+ }
+ else {
+ /* Neither eps_x nor eps_y,
+ so we wait for x=xo.
+ */
+ }
+ }
+ }
+ }
+ }
+ /* Continue for usable y values only
+ */
+ if (1 == cc) {
+ /* Find direction for next change
+ */
+ nc = CHANGED_NONE;
+ switch (cond) {
+ case CONDITION_FA_LESS_ZERO : {
+ if (0.0 > fx) {
+ nc = CHANGED_A;
+ }
+ else {
+ nc = CHANGED_B;
+ }
+ } break;
+ case CONDITION_FA_LEQ_ZERO : {
+ if (0.0 >= fx) {
+ nc = CHANGED_A;
+ }
+ else {
+ nc = CHANGED_B;
+ }
+ } break;
+ case CONDITION_FA_GREATER_ZERO : {
+ if (0.0 < fx) {
+ nc = CHANGED_A;
+ }
+ else {
+ nc = CHANGED_B;
+ }
+ } break;
+ case CONDITION_FA_GEQ_ZERO : {
+ if (0.0 <= fx) {
+ nc = CHANGED_A;
+ }
+ else {
+ nc = CHANGED_B;
+ }
+ } break;
+ }
+ /* Apply interval border change
+ */
+ switch (nc) {
+ case CHANGED_A: { $? ". use x as a"
+ if (CHANGED_A == pc) {
+ switch (mctx.algo) {
+ case DK4_ITER_ALG_RF_ILLINOIS : {
+ fb = 0.5 * fb;
+ if (0 == dk4ma_is_finite(fb)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1; $? "! fb"
+ }
+ } break;
+ case DK4_ITER_ALG_RF_PEGASUS : {
+ gamma = dk4iter_gamma_pegasus(fa, fx);
+ fb *= gamma;
+ if (0 == dk4ma_is_finite(fb)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1; $? "! fb"
+ }
+ } break;
+ case DK4_ITER_ALG_RF_ANDERSON_BJOERCK : {
+ gamma = dk4iter_gamma_anderson_bjoerck(
+ fa, fx
+ );
+ fb *= gamma;
+ if (0 == dk4ma_is_finite(fb)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1; $? "! fb"
+ }
+ } break;
+ }
+ }
+ a = x;
+ fa = fx;
+ pc = CHANGED_A;
+ } break;
+ case CHANGED_B: { $? ". use x as b"
+ if (CHANGED_B == pc) {
+ switch (mctx.algo) {
+ case DK4_ITER_ALG_RF_ILLINOIS : {
+ fa = 0.5 * fa;
+ if (0 == dk4ma_is_finite(fa)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1; $? "! fa"
+ }
+ } break;
+ case DK4_ITER_ALG_RF_PEGASUS : {
+ gamma = dk4iter_gamma_pegasus(
+ fb, fx
+ );
+ fa *= gamma;
+ if (0 == dk4ma_is_finite(fa)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1; $? "! fa"
+ }
+ } break;
+ case DK4_ITER_ALG_RF_ANDERSON_BJOERCK : {
+ gamma = dk4iter_gamma_anderson_bjoerck(
+ fb, fx
+ );
+ fa *= gamma;
+ if (0 == dk4ma_is_finite(fa)) {
+ back = DK4_ITER_RESULT_E_INFINITE;
+ cc = -1; $? "! fa"
+ }
+ } break;
+ }
+ }
+ b = x;
+ fb = fx;
+ pc = CHANGED_B;
+ } break;
+ default: {
+ /* ERROR: Must not happen */
+ back = DK4_ITER_RESULT_E_CONV; $? "! bug"
+ cc = -1;
+ } break;
+ }
+ }
+ }
+ /* Check number of passes
+ */
+ if ((1 == cc) && (0UL < mctx.maxpass) && (passno >= mctx.maxpass)) {
+ back = DK4_ITER_RESULT_E_PASSES; $? "! too many passes"
+ cc = -1;
+ }
+ } while (1 == cc);
+
+ /* Success
+ */
+ if (0 == cc) {
+ *d = x;
+ if (NULL != pp) { *pp = passno; }
+ back = DK4_ITER_RESULT_SUCCESS;
+ }
+
+ finished:
+ $? "- dk4iter_interval %d", back
+ return back;
+}
+
+
+
+/** Run Newton iteration.
+ @param d Destination (address of result variable).
+ @param pp Address of variable to store number of passes on success.
+ @param fct Iteration function, returns two values into the array
+ at address d: the function value and the first derivative
+ value.
+ @param ps Parameter set, may be NULL if fct does not use it.
+ @param x0 Start point.
+ @param ctx Iteration context, may be NULL.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_PASSES, DK4_ITER_RESULT_E_INFINITE,
+ DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV, DK4_ITER_RESULT_E_FCT,
+ or DK4_ITER_RESULT_E_ARGS on error.
+*/
+static
+int
+dk4iter_newton(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double x0,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ double v[2];
+ double xn = 0.0;
+ unsigned long passno = 0UL;
+ int back = DK4_ITER_RESULT_E_ARGS;
+ int cc = 1;
+ int res = 0;
+ $? "+ dk4iter_newton"
+#if DK4_USE_ASSERT
+ assert(NULL != d);
+ assert(NULL != fct);
+#endif
+ res = (*fct)(v, x0, ps);
+ if (0 == res) {
+ cc = -1; $? "! function calculation"
+ back = DK4_ITER_RESULT_E_FCT;
+ }
+ if (!((dk4ma_is_finite(v[0])) && (dk4ma_is_finite(v[1])))) {
+ cc = -1; $? "! infinite values"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ }
+ while (1 == cc) {
+ if (ULONG_MAX > passno) { passno++; } $? ". begin pass %lu", passno
+ xn = x0 - v[0] / v[1];
+ if (dk4ma_is_finite(xn)) { $? ". x = %lg", xn
+ if (0 != (MINMAX_MINIMUM & (ctx->minmax))) {
+ if (0 != (MINMAX_MIN_EXCL & (ctx->minmax))) {
+ if (xn <= ctx->xmin) {
+ cc = -1; $? "! out of range, too small"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ else {
+ if (xn < ctx->xmin) {
+ cc = -1; $? "! out of range, too small"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ }
+ if (0 != (MINMAX_MAXIMUM & (ctx->minmax))) {
+ if (0 != (MINMAX_MAX_EXCL & (ctx->minmax))) {
+ if (xn >= ctx->xmax) {
+ cc = -1; $? "! out of range, too large"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ else {
+ if (xn > ctx->xmax) {
+ cc = -1; $? "! out of range, too large"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ }
+ if (1 == cc) {
+ res = (*fct)(v, xn, ps);
+ if (0 == res) {
+ cc = -1; $? "! function calculation"
+ back = DK4_ITER_RESULT_E_FCT;
+ }
+ if (!((dk4ma_is_finite(v[0])) && (dk4ma_is_finite(v[1])))) {
+ cc = -1; $? "! infinite values"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ }
+ if (1 == cc) {
+ $? ". y = %lg", v[0]
+ $? ". dy/dx = %lg", v[1]
+ if (isgreater(ctx->eps_y,0.0)) { $? ". check y"
+ if (fabs(v[0]) < ctx->eps_y) { $? ". y in range"
+ if (xn == x0) {
+ cc = 0; $? ". OK exact value"
+ }
+ else {
+ if (0 == ctx->exact) { $? ". check step"
+ if(isgreater(ctx->eps_x,0.0)) {
+ if (isless(fabs(xn - x0),ctx->eps_x)) {
+ cc = 0; $? ". OK small step"
+ }
+ }
+ else {
+ cc = 0; $? ". OK no x step constraint"
+ }
+ }
+ }
+ }
+ }
+ else { $? ". no y check"
+ if (xn == x0) {
+ cc = 0; $? ". OK exact match"
+ }
+ else {
+ if (0 == ctx->exact) {
+ if (isgreater(ctx->eps_x,0.0)) {
+ if (isless(fabs(xn - x0),ctx->eps_x)) {
+ cc = 0; $? ". OK x step small enough"
+ }
+ }
+ else {
+ /* Neither eps_x nor eps_y,
+ so we wait for x=x0.
+ */
+ }
+ }
+ }
+ }
+ }
+ x0 = xn;
+ }
+ }
+ else {
+ cc = -1; $? "! infinite value"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ }
+ if ((1 == cc) && (0UL < ctx->maxpass) && (passno >= ctx->maxpass)) {
+ cc = -1;
+ back = DK4_ITER_RESULT_E_PASSES;
+ }
+ }
+ if (0 == cc) {
+ *d = xn;
+ if (NULL != pp) { *pp = passno; }
+ back = DK4_ITER_RESULT_SUCCESS;
+ }
+ $? "- dk4iter_newton %d", back
+ return back;
+}
+
+
+
+/** Run fix point iteration.
+ @param d Destination (address of result variable).
+ @param pp Address of variable to store number of passes on success.
+ @param fct Iteration function, the phi part of phi(x)=x.
+ @param ps Parameter set, may be NULL if fct does not use it.
+ @param x0 Start point.
+ @param ctx Iteration context, may be NULL.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_PASSES, DK4_ITER_RESULT_E_INFINITE,
+ DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV, DK4_ITER_RESULT_E_FCT,
+ or DK4_ITER_RESULT_E_ARGS on error.
+*/
+static
+int
+dk4iter_fix_point(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double x0,
+ dk4_iter_ctx_t const *ctx
+)
+{
+#if 0
+ double a; /* Border from previous steps */
+ double b; /* Border from previous steps */
+#endif
+ double xn = 0.0; /* New x value */
+ unsigned long passno = 0UL; /* Iteration step number */
+ int res = 0; /* Function evaluation result */
+ int cc = 1; /* Flag: Can continue */
+ int back = DK4_ITER_RESULT_E_ARGS;
+ $? "+ dk4iter_fix_point"
+#if DK4_USE_ASSERT
+ assert(NULL != d);
+ assert(NULL != fct);
+#endif
+ while (1 == cc) {
+ if (ULONG_MAX > passno) { passno++; } $? ". begin pass %lu", passno
+ /*
+ Calculate new x, check result
+ */
+ res = (*fct)(&xn, x0, ps);
+ if (0 == res) {
+ cc = -1; $? "! function evaluation"
+ back = DK4_ITER_RESULT_E_FCT;
+ }
+ if (!(dk4ma_is_finite(xn))) {
+ cc = -1; $? "! infinite result"
+ back = DK4_ITER_RESULT_E_INFINITE;
+ }
+ if (1 == cc) { $? ". x = %lg", xn
+ /*
+ Check whether specified interval is exceeded
+ */
+ if (0 != (MINMAX_MINIMUM & (ctx->minmax))) {
+ if (0 != (MINMAX_MIN_EXCL & (ctx->minmax))) {
+ if (xn <= ctx->xmin) {
+ cc = -1; $? "! out of range, too small"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ else {
+ if (xn < ctx->xmin) {
+ cc = -1; $? "! out of range, too small"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ }
+ if (0 != (MINMAX_MAXIMUM & (ctx->minmax))) {
+ if (0 != (MINMAX_MAX_EXCL & (ctx->minmax))) {
+ if (xn >= ctx->xmax) {
+ cc = -1; $? "! out of range, too large"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ else {
+ if (xn > ctx->xmax) {
+ cc = -1; $? "! out of range, too large"
+ back = DK4_ITER_RESULT_E_OOR;
+ }
+ }
+ }
+ if (1 == cc) {
+ if (1 == cc) {
+ /*
+ Check whether we are finished
+ */
+ if (xn == x0) {
+ cc = 0; $? ". OK exact match"
+ }
+ else {
+ if ((0 == ctx->exact) && (0.0 < ctx->eps_x)) {
+ if (isless(fabs(xn-x0),ctx->eps_x)) {
+ cc = 0; $? ". OK change small enough"
+ }
+#if TRACE_DEBUG
+ else { $? ". change %lg", fabs(xn-x0)
+ }
+#endif
+ }
+ else { $? "! No condition to check %lg", (xn-x0)
+ }
+ }
+ }
+ }
+ x0 = xn;
+ }
+ /* Stop if too many passes
+ */
+ if (1 == cc) {
+ if ((0UL < ctx->maxpass) && (passno >= ctx->maxpass)) {
+ cc = -1;
+ back = DK4_ITER_RESULT_E_PASSES;
+ }
+ }
+ }
+ if (0 == cc) {
+ *d = xn;
+ if (NULL != pp) { *pp = passno; }
+ back = DK4_ITER_RESULT_SUCCESS;
+ }
+ $? "- dk4iter_fix_point %d", back
+ return back;
+}
+
+
+
+int
+dk4iter_start_point(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double x0,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ dk4_iter_ctx_t mctx;
+ int back = DK4_ITER_RESULT_E_ARGS;
+
+ /* Check function call arguments
+ */
+#if DK4_USE_ASSERT
+ assert(NULL != d);
+ assert(NULL != fct);
+#endif
+ if ((NULL == d) || (NULL == fct)) {
+ goto finished;
+ }
+ /* Copy or initialize context
+ */
+ if (NULL != ctx) {
+ DK4_MEMCPY(&mctx,ctx,sizeof(dk4_iter_ctx_t));
+ }
+ else {
+ dk4iter_ctx_init(&mctx);
+ mctx.algo = DK4_ITER_ALG_NEWTON;
+ }
+ /* Check x0 in interval
+ */
+ if (0 != (MINMAX_MINIMUM & (mctx.minmax))) {
+ if (0 != (MINMAX_MIN_EXCL & (mctx.minmax))) {
+ if (x0 <= mctx.xmin) {
+ goto finished;
+ }
+ }
+ else {
+ if (x0 < mctx.xmin) {
+ goto finished;
+ }
+ }
+ }
+ if (0 != (MINMAX_MAXIMUM & (mctx.minmax))) {
+ if (0 != (MINMAX_MAX_EXCL & (mctx.minmax))) {
+ if (x0 >= mctx.xmax) {
+ goto finished;
+ }
+ }
+ else {
+ if (x0 > mctx.xmax) {
+ goto finished;
+ }
+ }
+ }
+ /* Call function for specified algorithm.
+ */
+ switch (mctx.algo) {
+ case DK4_ITER_ALG_NEWTON : {
+ back = dk4iter_newton(d, pp, fct, ps, x0, &mctx);
+ } break;
+ case DK4_ITER_ALG_FIX_POINT : {
+ back = dk4iter_fix_point(d, pp, fct, ps, x0, &mctx);
+ } break;
+ }
+
+ finished:
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4iter.h b/support/dktools/dk4iter.h
new file mode 100644
index 0000000000..9ad4f544c3
--- /dev/null
+++ b/support/dktools/dk4iter.h
@@ -0,0 +1,413 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4iter.ctr
+*/
+
+#ifndef DK4ITER_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4ITER_H_INCLUDED 1
+
+
+#line 8 "dk4iter.ctr"
+
+/** @file dk4iter.h Iteration algorithms for root finding.
+
+This module implements the following root finding iteration algorithms:
+- Bisection
+- Regula falsi (primitive form, Illinois, Pegasus, Anderson-Bjoerck)
+- Newton
+- fix point
+
+The function to iterate must be implemented as dk4_iter_fct_t.
+This function type returns an integer value (non-zero to indicate a
+successful calculation, 0 to indicate an error).
+The function expects the following arguments:
+- Result address<br>
+ Address of a variable or an array to store the calculation result.
+ Functions for Newton iteration algorithm store 2 values: Function value
+ and value of the first derivative.
+- X position<br>
+ The x value you want a function value for.
+- Address of parameter set.
+ Additional parameters probably required by the function. I.e. for a
+ polynomial calculation function you may specify the coefficients here.
+ This parameter is optional.
+
+Details for an iteration may be specified in an iteration context.
+The dk4iter_ctx_open() creates such a context and returns a pointer.
+Use dk4iter_ctx_close() to release the context when done with it.
+Alternatively use a automatic/static variable of the dk4_iter_ctx_t type
+and initialize it using the dk4iter_ctx_init() function.
+
+The dk4iter_ctx_set_algorithm() function chooses the iteration method.
+
+For Newton and fixpoint the context may specify an x interval the
+iteration must not leave. Leaving the interval results in abort.
+The dk4iter_ctx_set_min(), dk4iter_ctx_set_exclusive_min(),
+dk4iter_ctx_set_max() and dk4iter_ctx_set_exclusive_max() functions can
+be used to set closed and open interval borders.
+
+Tolerance values (epsilon) may be specified for
+- y direction unless fixpoint is used and/or
+- x direction.
+Use dk4iter_ctx_set_eps_y() and dk4iter_ctx_set_eps_x() to set the
+tolerances.
+Use 0.0 or negative tolerances to skip one check (not both!).
+
+Once the iteration reached allowed y difference you can decide
+to stop when the x difference is in allowed tolerance range too or
+to continue until full machine precision is reached (new x is exactly
+the same as previous x).
+I do not recommend attempts to iterate to full machine precision as this
+(a) may fail for some functions resulting in an oscillation and
+(b) uses a larger number of iteration passes and.
+Use dk4iter_ctx_set_exact() to control this.
+
+The dk4iter_ctx_set_maxpass() function sets the maximum number of
+iteration passes (iteration steps). The iteration is aborted if there
+is no success within this maximum number of passes.
+Although you can use 0 to set an unlimited number of passes I do not recommend
+to do so.
+
+The dk4iter_interval() function runs an iteration for a specified interval.
+
+The dk4iter_start_point() function runs an iteration if just one
+starting x value is specified.
+
+If no context is specified the following defaults are used:
+
+Option | Default
+:----: | :------
+Algorithm | DK4_ITER_ALG_RF_ANDERSON_BJOERCK for dk4iter_interval(), DK4_ITER_ALG_NEWTON for dk4iter_start_point().
+Max passes | 256.
+Y tolerance | 1.0e-8
+X tolerance | 1.0e-8
+Full machine precision | No.
+Restricted x interval | None.
+
+*/
+
+
+
+/** Border values for maximum number of iteration passes.
+*/
+enum {
+ /** Number of passes for average cases.
+ */
+ DK4_ITER_PASSES_REGULAR = 256 ,
+
+ /** Do not set a limit on the number of passes.
+ Warning: Might result in an endless loop!
+ */
+ DK4_ITER_PASSES_UNLIMITED = 0
+};
+
+
+
+/** Iteration algorithms.
+*/
+enum {
+ /** Interval bisection.
+ */
+ DK4_ITER_ALG_BISECTION = 0 ,
+
+ /** Primitive from of regula falsi.
+ */
+ DK4_ITER_ALG_RF_PRIMITIVE ,
+
+ /** Regula falsi, Illinois variant.
+ */
+ DK4_ITER_ALG_RF_ILLINOIS ,
+
+ /** Regula falsi, Pegasus variant.
+ */
+ DK4_ITER_ALG_RF_PEGASUS ,
+
+ /** Regula falsi, Anderson-Bjoerck variant.
+ */
+ DK4_ITER_ALG_RF_ANDERSON_BJOERCK ,
+
+ /** Newton algorithm.
+ The function must place 2 elements
+ in the array specified by pointer:
+ Function value and derivative value.
+ */
+ DK4_ITER_ALG_NEWTON ,
+
+ /** Fix point algorithm.
+ The function must be the phi(x)
+ function from the
+ phi(x) = x equation.
+ */
+ DK4_ITER_ALG_FIX_POINT
+};
+
+
+
+/** Iteration result.
+*/
+enum {
+ /** Iteration succeeded.
+ */
+ DK4_ITER_RESULT_SUCCESS = 1 ,
+
+ /** Error: Too many passes without success.
+ */
+ DK4_ITER_RESULT_E_PASSES = 0 ,
+
+ /** Error: Infinite value or NaN in calculation.
+ */
+ DK4_ITER_RESULT_E_INFINITE = -1 ,
+
+ /** Error: X left initial interval.
+ Can happen with Newton and fix point
+ algorithm.
+ */
+ DK4_ITER_RESULT_E_OOR = -2 ,
+
+ /** Error: Not converging.
+ Fix point algorithm: Interval was enlarging.
+ */
+ DK4_ITER_RESULT_E_CONV = -3 ,
+
+ /** Function calculation failed.
+ */
+ DK4_ITER_RESULT_E_FCT = -4 ,
+
+ /** Invalid arguments passed to function call.
+ */
+ DK4_ITER_RESULT_E_ARGS = -5
+};
+
+
+
+/** Function to iterate.
+ @param d Destination address. One element for all algorithms
+ except DK4_ITER_ALG_NEWTON which saves function value and derivative
+ value in a 2 elements array.
+ @param x X position to calculate the function value for.
+ @param ps Parameter set, may be NULL.
+ @return Non-zero value on success, 0 on error.
+*/
+typedef int dk4_iter_fct_t(double *d, double x, const void *ps);
+
+
+/** Iteration context.
+*/
+typedef struct {
+ double xmin; /**< Minimum of x interval. */
+ double xmax; /**< Maximum of x interval. */
+ double eps_x; /**< Epsilon for x change. */
+ double eps_y; /**< Epsilon for absolute y value. */
+ unsigned long maxpass; /**< Maximum number of passes. */
+ int exact; /**< Flag: End only if there is no x change. */
+ int algo; /**< Iteration algorithm to use. */
+ int minmax; /**< Flags: min(1), max(2) set. */
+} dk4_iter_ctx_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open new iteration context.
+ Allocate memory for new iteration context, set up default value.
+ A context allocated by this function must be released after
+ use by the dk4iter_ctx_close() function.
+ @return Valid pointer to new context on success, NULL on error.
+*/
+
+dk4_iter_ctx_t *
+dk4iter_ctx_open(void);
+
+
+/** Initialize a context to default values.
+ @param ctx Context to initialize.
+*/
+
+void
+dk4iter_ctx_init(dk4_iter_ctx_t *ctx);
+
+
+/** Close iteration context.
+ Release memory assigned to the context.
+ @param ctx Context created by dk4iter_ctx_open().
+*/
+
+void
+dk4iter_ctx_close(dk4_iter_ctx_t *ctx);
+
+
+/** Set epsilon value for x change.
+ @param ctx Context to modify.
+ @param eps Epsilon value for x change.
+*/
+
+void
+dk4iter_ctx_set_eps_x(dk4_iter_ctx_t *ctx, double eps);
+
+
+/** Set maximum absolute y value.
+ @param ctx Context to modify.
+ @param eps Maximum absolute y value.
+*/
+
+void
+dk4iter_ctx_set_eps_y(dk4_iter_ctx_t *ctx, double eps);
+
+
+/** Set maximum number of passes (iteration steps).
+ @param ctx Context to modify.
+ @param passes Maximum number of passes, 0 or negative values indicate
+ an unlimited number of steps.
+*/
+
+void
+dk4iter_ctx_set_maxpass(dk4_iter_ctx_t *ctx, unsigned long passes);
+
+
+/** Set flag for exact iteration.
+ If the flag is activated, iteration is continued until there is
+ no longer any change in the x value. For some functions you can
+ retrieve a result in machine precision using this flag, for other
+ functions the iteration may fail.
+ @param ctx Context to modify.
+ @param flag New flag value, 0=inactive, other=active.
+ The recommended value is 0.
+*/
+
+void
+dk4iter_ctx_set_exact(dk4_iter_ctx_t *ctx, int flag);
+
+
+/** Set up iteration algorithm.
+ @param ctx Context to modify.
+ @param algorithm Algorithm to use.
+*/
+
+void
+dk4iter_ctx_set_algorithm(dk4_iter_ctx_t *ctx, int algorithm);
+
+
+/** Set interval minimum.
+ The allowed interval is only used for Newton and fixed point
+ algorithm.
+ @param ctx Context to modify.
+ @param xmin Minimum x value allowed.
+*/
+
+void
+dk4iter_ctx_set_min(dk4_iter_ctx_t *ctx, double xmin);
+
+
+/** Set exlusive interval minimum (open interval border).
+ The allowed interval is only used for Newton and fixed point
+ algorithm.
+ @param ctx Context to modify.
+ @param xmin Minimum x value allowed.
+*/
+
+void
+dk4iter_ctx_set_exclusive_min(dk4_iter_ctx_t *ctx, double xmin);
+
+
+/** Set interval maximum.
+ The allowed interval is only used for Newton and fixed point
+ algorithm.
+ @param ctx Context to modify.
+ @param xmax Maximum x value allowed.
+*/
+
+void
+dk4iter_ctx_set_max(dk4_iter_ctx_t *ctx, double xmax);
+
+
+/** Set exclusive interval maximum (open interval border).
+ The allowed interval is only used for Newton and fixed point
+ algorithm.
+ @param ctx Context to modify.
+ @param xmax Maximum x value allowed.
+*/
+
+void
+dk4iter_ctx_set_exclusive_max(dk4_iter_ctx_t *ctx, double xmax);
+
+
+/** Run iteration.
+ The algorithm in the context must be one from:
+ DK4_ITER_ALG_BISECTION, DK4_ITER_ALG_RF_PRIMITIVE, DK4_ITER_ALG_RF_ILLINOIS,
+ DK4_ITER_ALG_RF_PEGASUS DK4_ITER_ALG_RF_ANDERSON_BJOERCK.
+ Without a context DK4_ITER_ALG_RF_ANDERSON_BJOERCK is used as default.
+ @param d Address of result variable.
+ @param pp Address of variable to store number of passes, may be NULL.
+ @param fct Function to find root for.
+ @param ps Parameter set for function, may be NULL.
+ @param a One interval border.
+ @param b Other interval border.
+ @param ctx Iteration context.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_PASSES, DK4_ITER_RESULT_E_INFINITE,
+ DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV or
+ DK4_ITER_RESULT_E_FCT on error.
+*/
+
+int
+dk4iter_interval(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double b,
+ dk4_iter_ctx_t const *ctx
+);
+
+
+/** Run iteration.
+ The algorithm in the context must be one from:
+ DK4_ITER_ALG_NEWTON, DK4_ITER_ALG_FIX_POINT.
+ Without a context, DK4_ITER_ALG_NEWTON is used as default.
+ @param d Address of result variable.
+ @param pp Address of variable to store number of passes, may be NULL.
+ @param fct Function to find root for.
+ For Newton iteration this function must set two values
+ in the destination array: function value and derivative value.
+ For fixpoint iteration the function calculates the
+ phi(x) part of phi(x)=x.
+ @param ps Parameter set for function, may be NULL.
+ @param x0 Start point.
+ @param ctx Iteration context.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_PASSES, DK4_ITER_RESULT_E_INFINITE,
+ DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV or
+ DK4_ITER_RESULT_E_FCT on error.
+*/
+
+int
+dk4iter_start_point(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double x0,
+ dk4_iter_ctx_t const *ctx
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4itmin.c b/support/dktools/dk4itmin.c
new file mode 100644
index 0000000000..f50f14b654
--- /dev/null
+++ b/support/dktools/dk4itmin.c
@@ -0,0 +1,434 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4itmin.ctr
+*/
+
+/** @file dk4itmin.c The dk4itmin module.
+*/
+
+
+#line 68 "dk4itmin.ctr"
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_LIMITS_H
+#ifndef LIMITS_H_INCLUDED
+#include <limits.h>
+#define LIMITS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDINT_H
+#ifndef STDINT_H_INCLUDED
+#include <stdint.h>
+#define STDINT_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4ITER_H_INCLUDED
+#include "dk4iter.h"
+#endif
+
+#ifndef DK4MIN_H_INCLUDED
+#include "dk4itmin.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+
+
+static
+int
+dk4itmin_check_tolerances(
+ double eps_y,
+ double y,
+ double yold,
+ double eps_x,
+ double x,
+ double xold
+)
+{
+ int back = 0;
+ if ((!(isgreater(eps_y, 0.0))) || (isgreater(eps_y, fabs(y - yold)))) {
+ if ((!(isgreater(eps_x, 0.0))) || (isgreater(eps_x, fabs(x - xold)))) {
+ back = 1;
+ }
+ }
+ return back;
+}
+
+
+
+static
+int
+dk4itmin_golden_section(
+ double *pd,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double fa,
+ double b,
+ double fb,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ double c = 0.0; /* Probe position c */
+ double fc = 0.0; /* Function value at c */
+ double d = 0.0; /* Probe position d */
+ double fd = 0.0; /* Function value at d */
+ double f1 = 0.0; /* Factor for probe calculation */
+ double f2 = 0.0; /* Factor for probe calculation */
+ double x = 0.0; /* Current probe point */
+ double xold = 0.0; /* Previous probe point */
+ double y = 0.0; /* Current probe value */
+ double yold = 0.0; /* Previous probe value */
+ double max = 0.0; /* Maximum of fa and fb */
+ unsigned long passno = 0UL; /* Current pass number */
+ int res = 0; /* Operations result */
+ int cc = 1; /* 1=go on, 0=finished, -1=abort */
+ int back = DK4_ITER_RESULT_E_ARGS;
+
+
+#line 171 "dk4itmin.ctr"
+ /*
+ Initialize allowed maximum function value
+ */
+ /*
+ Initialize factors for probe calculation
+ */
+ f1 = sqrt(5.0) - 1.0;
+
+#line 178 "dk4itmin.ctr"
+ f2 = 3.0 - sqrt(5.0);
+
+#line 179 "dk4itmin.ctr"
+ max = ((fa > fb) ? (fa) : (fb));
+ /*
+ Initial probe points
+ */
+ c = (f1 * a + f2 * b) / 2.0;
+ d = (f2 * a + f1 * b) / 2.0;
+ res = (*fct)(&fc, c, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fc)))) {
+
+#line 187 "dk4itmin.ctr"
+ back = DK4_ITER_RESULT_E_FCT;
+ goto finished;
+ }
+ res = (*fct)(&fd, d, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fd)))) {
+
+#line 192 "dk4itmin.ctr"
+ back = DK4_ITER_RESULT_E_FCT;
+ goto finished;
+ }
+
+
+#line 196 "dk4itmin.ctr"
+
+
+#line 197 "dk4itmin.ctr"
+
+
+#line 198 "dk4itmin.ctr"
+
+
+#line 199 "dk4itmin.ctr"
+ if (fc > max) {
+
+#line 200 "dk4itmin.ctr"
+ back = DK4_ITER_RESULT_E_CONV;
+ goto finished;
+ }
+ if (fd > max) {
+
+#line 204 "dk4itmin.ctr"
+ back = DK4_ITER_RESULT_E_CONV;
+ goto finished;
+ }
+ /*
+ Iteration loop
+ */
+ do {
+ /* Increase pass number
+ */
+ if (ULONG_MAX > passno) { passno++; }
+
+
+#line 215 "dk4itmin.ctr"
+
+
+#line 216 "dk4itmin.ctr"
+
+
+#line 217 "dk4itmin.ctr"
+
+
+#line 218 "dk4itmin.ctr"
+
+
+#line 219 "dk4itmin.ctr"
+ /*
+ Save probe point and value
+ */
+ xold = x;
+ yold = y;
+ /*
+ Process the probe points
+ */
+ if (fc < fd) {
+
+#line 228 "dk4itmin.ctr"
+ b = d;
+ d = c;
+ c = (f1 * a + f2 * b) / 2.0;
+ fb = fd;
+ fd = fc;
+ res = (*fct)(&fc, c, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fc)))) {
+ back = DK4_ITER_RESULT_E_FCT;
+
+#line 236 "dk4itmin.ctr"
+ cc = -1;
+ }
+ else {
+ max = ((fa > fb) ? (fa) : (fb));
+ if (fc > max) {
+
+#line 241 "dk4itmin.ctr"
+ back = DK4_ITER_RESULT_E_CONV;
+ cc = -1;
+ }
+ else {
+ x = c;
+
+#line 246 "dk4itmin.ctr"
+ y = fc;
+
+#line 247 "dk4itmin.ctr"
+ }
+ }
+ }
+ else {
+
+#line 251 "dk4itmin.ctr"
+ a = c;
+ c = d;
+ d = (f2 * a + f1 * b) / 2.0;
+ fa = fc;
+ fc = fd;
+ res = (*fct)(&fd, d, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fd)))) {
+ back = DK4_ITER_RESULT_E_FCT;
+
+#line 259 "dk4itmin.ctr"
+ cc = -1;
+ }
+ else {
+ max = ((fa > fb) ? (fa) : (fb));
+ if (fd > max) {
+
+#line 264 "dk4itmin.ctr"
+ back = DK4_ITER_RESULT_E_CONV;
+ cc = -1;
+ }
+ else {
+ x = d;
+
+#line 269 "dk4itmin.ctr"
+ y = fd;
+
+#line 270 "dk4itmin.ctr"
+ }
+ }
+ }
+ /*
+ Check for reached tolerance
+ */
+ if (1 == cc) {
+ if (1UL < passno) {
+ if (x == xold) {
+ cc = 0;
+
+#line 280 "dk4itmin.ctr"
+ }
+ else {
+ if (0 == ctx->exact) {
+ res = dk4itmin_check_tolerances(
+ ctx->eps_y, y, yold, ctx->eps_x, x, xold
+ );
+ if (0 != res) {
+ cc = 0;
+
+#line 288 "dk4itmin.ctr"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 291 "dk4itmin.ctr"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 298 "dk4itmin.ctr"
+ }
+#endif
+ }
+ /*
+ Abort if number of passes exceeded
+ */
+ if (1 == cc) {
+ if ((0UL < ctx->maxpass) && (passno >= ctx->maxpass)) {
+ back = DK4_ITER_RESULT_E_PASSES;
+ cc = -1;
+
+#line 308 "dk4itmin.ctr"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 311 "dk4itmin.ctr"
+ }
+#endif
+ }
+ } while (1 == cc);
+
+ /*
+ Transfer results on success
+ */
+ if (0 == cc) {
+
+#line 320 "dk4itmin.ctr"
+ pd[0] = x;
+ pd[1] = y;
+ back = DK4_ITER_RESULT_SUCCESS;
+ if (NULL != pp) { *pp = passno; }
+ }
+
+ finished:
+
+
+#line 328 "dk4itmin.ctr"
+ return back;
+}
+
+
+
+int
+dk4itmin_interval(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double b,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ dk4_iter_ctx_t mctx; /* Iteration context copy */
+ double fa = 0.0; /* Value at left border */
+ double fb = 0.0; /* Value at right border */
+ int res = 0; /* Operation result */
+ int back = DK4_ITER_RESULT_E_ARGS;
+
+
+#line 350 "dk4itmin.ctr"
+ /*
+ Check function cal arguments
+ */
+#if DK4_USE_ASSERT
+ assert(NULL != d)
+ assert(NULL != fct)
+ assert(a < b)
+#endif
+ if ((NULL == d) || (NULL == fct)) {
+
+#line 359 "dk4itmin.ctr"
+ goto finished;
+ }
+ if (a >= b) {
+
+#line 362 "dk4itmin.ctr"
+ goto finished;
+ }
+
+ /* Calculate values for the three given points
+ */
+ res = (*fct)(&fa, a, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fa)))) {
+ back = DK4_ITER_RESULT_E_FCT;
+
+#line 370 "dk4itmin.ctr"
+ goto finished;
+ }
+ res = (*fct)(&fb, b, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fb)))) {
+ back = DK4_ITER_RESULT_E_FCT;
+
+#line 375 "dk4itmin.ctr"
+ goto finished;
+ }
+
+ /* Copy or initialize context
+ */
+ if (NULL != ctx) {
+
+#line 381 "dk4itmin.ctr"
+ DK4_MEMCPY(&mctx,ctx,sizeof(dk4_iter_ctx_t));
+ }
+ else {
+
+#line 384 "dk4itmin.ctr"
+ dk4iter_ctx_init(&mctx);
+ }
+
+ /* Choose algorithm depending on context
+ At this time only golden section available
+ */
+ back = dk4itmin_golden_section(d, pp, fct, ps, a, fa, b, fb, &mctx);
+
+ finished:
+
+
+#line 394 "dk4itmin.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4itmin.ctr b/support/dktools/dk4itmin.ctr
new file mode 100644
index 0000000000..59136b6a75
--- /dev/null
+++ b/support/dktools/dk4itmin.ctr
@@ -0,0 +1,399 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file dk4itmin.h Iteration algorithms for minimum search.
+Iteration can be used on functions unimodal on interval [a;b] only.
+This means the function must have exactly one local minimum on
+interval [a;b], no local maximum.
+
+To search for a maximum of f(x) simply search for the minimum of
+the 0-f(x) function.
+*/
+
+
+#ifndef DK4ITER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4iter.h"
+#else
+#include <dktools-4/dk4iter.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Run iteration for minimum search.
+ @param d Address of result array, 2 elements: x-value and y-value.
+ @param pp Address of variable to store number of passes, may be NULL.
+ @param fct Function to find minimum for.
+ The function must be unimodal on [a;b], the dk4itmin_interval()
+ function can not check this.
+ @param ps Parameter set for function, may be NULL.
+ @param a Left interval border.
+ @param b Right interval border.
+ Required: f(c)<f(a) and f(c)<f(b).
+ @param ctx Iteration context.
+ Only eps_x and eps_y are used, other information in the
+ context is ignored.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_ARGS, DK4_ITER_RESULT_E_PASSES,
+ DK4_ITER_RESULT_E_INFINITE, DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV
+ or DK4_ITER_RESULT_E_FCT on error.
+*/
+int
+dk4itmin_interval(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double b,
+ dk4_iter_ctx_t const *ctx
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+%% module
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDLIB_H
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_LIMITS_H
+#ifndef LIMITS_H_INCLUDED
+#include <limits.h>
+#define LIMITS_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_STDINT_H
+#ifndef STDINT_H_INCLUDED
+#include <stdint.h>
+#define STDINT_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4ITER_H_INCLUDED
+#include "dk4iter.h"
+#endif
+
+#ifndef DK4MIN_H_INCLUDED
+#include "dk4itmin.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+
+
+static
+int
+dk4itmin_check_tolerances(
+ double eps_y,
+ double y,
+ double yold,
+ double eps_x,
+ double x,
+ double xold
+)
+{
+ int back = 0;
+ if ((!(isgreater(eps_y, 0.0))) || (isgreater(eps_y, fabs(y - yold)))) {
+ if ((!(isgreater(eps_x, 0.0))) || (isgreater(eps_x, fabs(x - xold)))) {
+ back = 1;
+ }
+ }
+ return back;
+}
+
+
+
+static
+int
+dk4itmin_golden_section(
+ double *pd,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double fa,
+ double b,
+ double fb,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ double c = 0.0; /* Probe position c */
+ double fc = 0.0; /* Function value at c */
+ double d = 0.0; /* Probe position d */
+ double fd = 0.0; /* Function value at d */
+ double f1 = 0.0; /* Factor for probe calculation */
+ double f2 = 0.0; /* Factor for probe calculation */
+ double x = 0.0; /* Current probe point */
+ double xold = 0.0; /* Previous probe point */
+ double y = 0.0; /* Current probe value */
+ double yold = 0.0; /* Previous probe value */
+ double max = 0.0; /* Maximum of fa and fb */
+ unsigned long passno = 0UL; /* Current pass number */
+ int res = 0; /* Operations result */
+ int cc = 1; /* 1=go on, 0=finished, -1=abort */
+ int back = DK4_ITER_RESULT_E_ARGS;
+ $? "+ dk4itmin_golden_section"
+ /*
+ Initialize allowed maximum function value
+ */
+ /*
+ Initialize factors for probe calculation
+ */
+ f1 = sqrt(5.0) - 1.0; $? ". f1 = %g", f1
+ f2 = 3.0 - sqrt(5.0); $? ". f2 = %g", f2
+ max = ((fa > fb) ? (fa) : (fb));
+ /*
+ Initial probe points
+ */
+ c = (f1 * a + f2 * b) / 2.0;
+ d = (f2 * a + f1 * b) / 2.0;
+ res = (*fct)(&fc, c, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fc)))) { $? "! fc calculation"
+ back = DK4_ITER_RESULT_E_FCT;
+ goto finished;
+ }
+ res = (*fct)(&fd, d, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fd)))) { $? "! fd calculation"
+ back = DK4_ITER_RESULT_E_FCT;
+ goto finished;
+ }
+ $? ". A ( %g , %g )", a, fa
+ $? ". B ( %g , %g )", b, fb
+ $? ". C ( %g , %g )", c, fc
+ $? ". D ( %g , %g )", d, fd
+ if (fc > max) { $? "! fc not unimodal"
+ back = DK4_ITER_RESULT_E_CONV;
+ goto finished;
+ }
+ if (fd > max) { $? "! fd not unimodal"
+ back = DK4_ITER_RESULT_E_CONV;
+ goto finished;
+ }
+ /*
+ Iteration loop
+ */
+ do {
+ /* Increase pass number
+ */
+ if (ULONG_MAX > passno) { passno++; }
+ $? ". pass %lu", passno
+ $? ". A ( %g , %g )", a, fa
+ $? ". B ( %g , %g )", b, fb
+ $? ". C ( %g , %g )", c, fc
+ $? ". D ( %g , %g )", d, fd
+ /*
+ Save probe point and value
+ */
+ xold = x;
+ yold = y;
+ /*
+ Process the probe points
+ */
+ if (fc < fd) { $? ". switch to [a;d]"
+ b = d;
+ d = c;
+ c = (f1 * a + f2 * b) / 2.0;
+ fb = fd;
+ fd = fc;
+ res = (*fct)(&fc, c, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fc)))) {
+ back = DK4_ITER_RESULT_E_FCT; $? "! fc calculation"
+ cc = -1;
+ }
+ else {
+ max = ((fa > fb) ? (fa) : (fb));
+ if (fc > max) { $? "! fc not unimodal"
+ back = DK4_ITER_RESULT_E_CONV;
+ cc = -1;
+ }
+ else {
+ x = c; $? ". x = %g", x
+ y = fc; $? ". y = %g", y
+ }
+ }
+ }
+ else { $? ". switch to [c;b]"
+ a = c;
+ c = d;
+ d = (f2 * a + f1 * b) / 2.0;
+ fa = fc;
+ fc = fd;
+ res = (*fct)(&fd, d, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fd)))) {
+ back = DK4_ITER_RESULT_E_FCT; $? "! fd calculation"
+ cc = -1;
+ }
+ else {
+ max = ((fa > fb) ? (fa) : (fb));
+ if (fd > max) { $? "! fd not unimodal"
+ back = DK4_ITER_RESULT_E_CONV;
+ cc = -1;
+ }
+ else {
+ x = d; $? ". x = %g", x
+ y = fd; $? ". y = %g", y
+ }
+ }
+ }
+ /*
+ Check for reached tolerance
+ */
+ if (1 == cc) {
+ if (1UL < passno) {
+ if (x == xold) {
+ cc = 0; $? ". exact result found"
+ }
+ else {
+ if (0 == ctx->exact) {
+ res = dk4itmin_check_tolerances(
+ ctx->eps_y, y, yold, ctx->eps_x, x, xold
+ );
+ if (0 != res) {
+ cc = 0; $? ". tolerances reached"
+ }
+#if TRACE_DEBUG
+ else { $? ". must continue"
+ }
+#endif
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". first pass, cannot check yet"
+ }
+#endif
+ }
+ /*
+ Abort if number of passes exceeded
+ */
+ if (1 == cc) {
+ if ((0UL < ctx->maxpass) && (passno >= ctx->maxpass)) {
+ back = DK4_ITER_RESULT_E_PASSES;
+ cc = -1; $? "! too many passes"
+ }
+#if TRACE_DEBUG
+ else { $? ". can continue"
+ }
+#endif
+ }
+ } while (1 == cc);
+
+ /*
+ Transfer results on success
+ */
+ if (0 == cc) { $? ". success"
+ pd[0] = x;
+ pd[1] = y;
+ back = DK4_ITER_RESULT_SUCCESS;
+ if (NULL != pp) { *pp = passno; }
+ }
+
+ finished:
+ $? "- dk4itmin_golden_section %d", back
+ return back;
+}
+
+
+
+int
+dk4itmin_interval(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double b,
+ dk4_iter_ctx_t const *ctx
+)
+{
+ dk4_iter_ctx_t mctx; /* Iteration context copy */
+ double fa = 0.0; /* Value at left border */
+ double fb = 0.0; /* Value at right border */
+ int res = 0; /* Operation result */
+ int back = DK4_ITER_RESULT_E_ARGS;
+ $? "+ dk4itmin_interval"
+ /*
+ Check function cal arguments
+ */
+#if DK4_USE_ASSERT
+ assert(NULL != d)
+ assert(NULL != fct)
+ assert(a < b)
+#endif
+ if ((NULL == d) || (NULL == fct)) { $? "! d or fct"
+ goto finished;
+ }
+ if (a >= b) { $? "! zero length interval"
+ goto finished;
+ }
+
+ /* Calculate values for the three given points
+ */
+ res = (*fct)(&fa, a, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fa)))) {
+ back = DK4_ITER_RESULT_E_FCT; $? "! function calculation for a"
+ goto finished;
+ }
+ res = (*fct)(&fb, b, ps);
+ if ((0 == res) || (!(dk4ma_is_finite(fb)))) {
+ back = DK4_ITER_RESULT_E_FCT; $? "! function calculation for b"
+ goto finished;
+ }
+
+ /* Copy or initialize context
+ */
+ if (NULL != ctx) { $? ". use provided context"
+ DK4_MEMCPY(&mctx,ctx,sizeof(dk4_iter_ctx_t));
+ }
+ else { $? ". no context, use defaults"
+ dk4iter_ctx_init(&mctx);
+ }
+
+ /* Choose algorithm depending on context
+ At this time only golden section available
+ */
+ back = dk4itmin_golden_section(d, pp, fct, ps, a, fa, b, fb, &mctx);
+
+ finished:
+ $? "- dk4itmin_interval %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4itmin.h b/support/dktools/dk4itmin.h
new file mode 100644
index 0000000000..45784d1933
--- /dev/null
+++ b/support/dktools/dk4itmin.h
@@ -0,0 +1,78 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4itmin.ctr
+*/
+
+#ifndef DK4ITMIN_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4ITMIN_H_INCLUDED 1
+
+
+#line 10 "dk4itmin.ctr"
+
+/** @file dk4itmin.h Iteration algorithms for minimum search.
+Iteration can be used on functions unimodal on interval [a;b] only.
+This means the function must have exactly one local minimum on
+interval [a;b], no local maximum.
+
+To search for a maximum of f(x) simply search for the minimum of
+the 0-f(x) function.
+*/
+
+
+#ifndef DK4ITER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4iter.h"
+#else
+#include <dktools-4/dk4iter.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Run iteration for minimum search.
+ @param d Address of result array, 2 elements: x-value and y-value.
+ @param pp Address of variable to store number of passes, may be NULL.
+ @param fct Function to find minimum for.
+ The function must be unimodal on [a;b], the dk4itmin_interval()
+ function can not check this.
+ @param ps Parameter set for function, may be NULL.
+ @param a Left interval border.
+ @param b Right interval border.
+ Required: f(c)<f(a) and f(c)<f(b).
+ @param ctx Iteration context.
+ Only eps_x and eps_y are used, other information in the
+ context is ignored.
+ @return DK4_ITER_RESULT_SUCCESS on success, one from
+ DK4_ITER_RESULT_E_ARGS, DK4_ITER_RESULT_E_PASSES,
+ DK4_ITER_RESULT_E_INFINITE, DK4_ITER_RESULT_E_OOR, DK4_ITER_RESULT_E_CONV
+ or DK4_ITER_RESULT_E_FCT on error.
+*/
+int
+dk4itmin_interval(
+ double *d,
+ unsigned long *pp,
+ dk4_iter_fct_t *fct,
+ void const *ps,
+ double a,
+ double b,
+ dk4_iter_ctx_t const *ctx
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#endif
diff --git a/support/dktools/dk4loc.c b/support/dktools/dk4loc.c
index df93e3a331..6d55b4c3f2 100644
--- a/support/dktools/dk4loc.c
+++ b/support/dktools/dk4loc.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4loc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4loc.ctr
*/
/** @file dk4loc.c The dk4loc module.
*/
-#line 67 "dk4loc.ctr"
+#line 79 "dk4loc.ctr"
+#include "dk4conf.h"
#include "dk4loc.h"
#ifndef STDLIB_H_INCLUDED
@@ -79,10 +58,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 110 "dk4loc.ctr"
+#line 129 "dk4loc.ctr"
@@ -110,7 +95,7 @@ static const char * const dk4loc_mod_kw_8[] = {
NULL
-#line 133 "dk4loc.ctr"
+#line 152 "dk4loc.ctr"
};
@@ -163,17 +148,30 @@ dk4loc_get_settings(
int back = 0;
-#line 184 "dk4loc.ctr"
+#line 203 "dk4loc.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != lang);
+ assert(NULL != reg);
+ assert(NULL != enc);
+ assert(0 < szlang);
+ assert(0 < szreg);
+#endif
if ((NULL != lang) && (0 < szlang)) { *lang = dkT('\0'); }
if ((NULL != reg ) && (0 < szreg )) { *reg = dkT('\0'); }
- if (NULL != enc) { *enc = DK4_ENCODING_ASCII; }
+ if (NULL != enc) {
+#if DK4_ON_WINDOWS
+ *enc = DK4_ENCODING_WIN1252;
+#else
+ *enc = DK4_ENCODING_PLAIN;
+#endif
+ }
if ((NULL != lang) && (NULL != reg) && (NULL != enc)) {
if ((0 < szlang) && (0 < szreg)) {
#if DK4_ON_WINDOWS
#if DK4_CHAR_SIZE > 1
*enc = DK4_ENCODING_UTF16;
#else
- *enc = DK4_ENCODING_ASCII;
+ *enc = DK4_ENCODING_WIN1252;
#endif
kptr = dk4wreg_open_key_c8(DK4_WREGKEY_HKCU, dk4loc_mod_kw_8[3], 0, erp);
if (NULL != kptr) {
@@ -253,37 +251,37 @@ dk4loc_get_settings(
p1 = getenv(dk4loc_mod_kw_8[0]);
if (NULL != p1) {
-#line 272 "dk4loc.ctr"
+#line 304 "dk4loc.ctr"
if (sizeof(buf) > dk4str8_len(p1)) {
-#line 273 "dk4loc.ctr"
+#line 305 "dk4loc.ctr"
dk4str8_cpy_s(buf, sizeof(buf), p1, NULL);
p2 = dk4str8_chr(buf, '.');
if (NULL != p2) {
-#line 276 "dk4loc.ctr"
+#line 308 "dk4loc.ctr"
*(p2++) = '\0';
-#line 277 "dk4loc.ctr"
+#line 309 "dk4loc.ctr"
}
p3 = dk4str8_chr(buf, '_');
if (NULL != p3) {
-#line 280 "dk4loc.ctr"
+#line 312 "dk4loc.ctr"
*(p3++) = '\0';
-#line 281 "dk4loc.ctr"
+#line 313 "dk4loc.ctr"
}
-#line 282 "dk4loc.ctr"
+#line 314 "dk4loc.ctr"
dk4str8_normalize(buf, NULL);
-#line 283 "dk4loc.ctr"
+#line 315 "dk4loc.ctr"
if (NULL != p2) { dk4str8_normalize(p2, NULL); }
if (NULL != p3) { dk4str8_normalize(p3, NULL); }
sz = dk4str8_len(buf);
-#line 286 "dk4loc.ctr"
+#line 318 "dk4loc.ctr"
if (0 < sz) {
if (szlang > sz) {
/* strcpy(lang, buf); */
@@ -313,19 +311,19 @@ dk4loc_get_settings(
#if DK4_CHAR_SIZE > 2
-#line 314 "dk4loc.ctr"
+#line 346 "dk4loc.ctr"
*enc = DK4_ENCODING_32;
#else
-#line 317 "dk4loc.ctr"
+#line 349 "dk4loc.ctr"
*enc = DK4_ENCODING_UTF16;
#endif
#else
-#line 321 "dk4loc.ctr"
- *enc = DK4_ENCODING_ASCII;
+#line 353 "dk4loc.ctr"
+ *enc = DK4_ENCODING_PLAIN;
if (NULL != p2) {
if (0 == dk4str8_casecmp(p2, dk4loc_mod_kw_8[1])) {
*enc = DK4_ENCODING_UTF8;
@@ -338,37 +336,37 @@ dk4loc_get_settings(
#endif
} else {
-#line 333 "dk4loc.ctr"
+#line 365 "dk4loc.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 336 "dk4loc.ctr"
+#line 368 "dk4loc.ctr"
back = dk4loc_use_default(lang, szlang, erp);
}
} else {
-#line 339 "dk4loc.ctr"
+#line 371 "dk4loc.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 342 "dk4loc.ctr"
+#line 374 "dk4loc.ctr"
back = dk4loc_use_default(lang, szlang, erp);
}
#endif
} else {
-#line 346 "dk4loc.ctr"
+#line 378 "dk4loc.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 349 "dk4loc.ctr"
+#line 381 "dk4loc.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 351 "dk4loc.ctr"
+#line 383 "dk4loc.ctr"
return back;
}
diff --git a/support/dktools/dk4loc.ctr b/support/dktools/dk4loc.ctr
index ea7ec2ede5..302f080d9d 100644
--- a/support/dktools/dk4loc.ctr
+++ b/support/dktools/dk4loc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -65,6 +77,7 @@ dk4loc_get_settings(
%% module
+#include "dk4conf.h"
#include "dk4loc.h"
#ifndef STDLIB_H_INCLUDED
@@ -105,6 +118,12 @@ dk4loc_get_settings(
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -181,16 +200,29 @@ dk4loc_get_settings(
#endif
int back = 0;
$? "+ dk4loc_get_settings %d %u %d %u %d %d", TR_IPTR(lang), (unsigned)szlang, TR_IPTR(reg), (unsigned)szreg, TR_IPTR(enc), TR_IPTR(erp)
+#if DK4_USE_ASSERT
+ assert(NULL != lang);
+ assert(NULL != reg);
+ assert(NULL != enc);
+ assert(0 < szlang);
+ assert(0 < szreg);
+#endif
if ((NULL != lang) && (0 < szlang)) { *lang = dkT('\0'); }
if ((NULL != reg ) && (0 < szreg )) { *reg = dkT('\0'); }
- if (NULL != enc) { *enc = DK4_ENCODING_ASCII; }
+ if (NULL != enc) {
+#if DK4_ON_WINDOWS
+ *enc = DK4_ENCODING_WIN1252;
+#else
+ *enc = DK4_ENCODING_PLAIN;
+#endif
+ }
if ((NULL != lang) && (NULL != reg) && (NULL != enc)) {
if ((0 < szlang) && (0 < szreg)) {
#if DK4_ON_WINDOWS
#if DK4_CHAR_SIZE > 1
*enc = DK4_ENCODING_UTF16;
#else
- *enc = DK4_ENCODING_ASCII;
+ *enc = DK4_ENCODING_WIN1252;
#endif
kptr = dk4wreg_open_key_c8(DK4_WREGKEY_HKCU, dk4loc_mod_kw_8[3], 0, erp);
if (NULL != kptr) {
@@ -318,7 +350,7 @@ dk4loc_get_settings(
#endif
#else
$? ". 8 bit"
- *enc = DK4_ENCODING_ASCII;
+ *enc = DK4_ENCODING_PLAIN;
if (NULL != p2) {
if (0 == dk4str8_casecmp(p2, dk4loc_mod_kw_8[1])) {
*enc = DK4_ENCODING_UTF8;
diff --git a/support/dktools/dk4loc.h b/support/dktools/dk4loc.h
index 5731463edc..93235397f7 100644
--- a/support/dktools/dk4loc.h
+++ b/support/dktools/dk4loc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4loc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4loc.ctr
*/
#ifndef DK4LOC_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4lprng.h b/support/dktools/dk4lprng.h
index 02d94a798b..cd41244d6d 100644
--- a/support/dktools/dk4lprng.h
+++ b/support/dktools/dk4lprng.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4LPRNG_H_INCLUDED
/** Protection against multiple inclusion.
*/
diff --git a/support/dktools/dk4lzwe.c b/support/dktools/dk4lzwe.c
index 6946a4f81e..080b90e6d5 100644
--- a/support/dktools/dk4lzwe.c
+++ b/support/dktools/dk4lzwe.c
@@ -1,54 +1,38 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4lzwe.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4lzwe.ctr
*/
/** @file dk4lzwe.c The dk4lzwe module.
*/
-#line 179 "dk4lzwe.ctr"
-
+#line 196 "dk4lzwe.ctr"
+#include "dk4conf.h"
#include "dk4lzwe.h"
#include "dk4mem.h"
#include "dk4edstm.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 188 "dk4lzwe.ctr"
+#line 211 "dk4lzwe.ctr"
@@ -106,7 +90,10 @@ dk4lzwe_shipout(
-#line 244 "dk4lzwe.ctr"
+#line 267 "dk4lzwe.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
i = lzwptr->bits;
while (0 < i--) {
res = dk4bit_shift_add(
@@ -117,23 +104,23 @@ dk4lzwe_shipout(
switch (res) {
case DK4_EDSTM_ERROR : {
-#line 253 "dk4lzwe.ctr"
+#line 279 "dk4lzwe.ctr"
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_BUG);
} break;
case DK4_EDSTM_FINISHED : {
-#line 257 "dk4lzwe.ctr"
+#line 283 "dk4lzwe.ctr"
uc = dk4bit_shift_output(&(lzwptr->bs), NULL);
if (8 > lzwptr->obu) {
-#line 259 "dk4lzwe.ctr"
+#line 285 "dk4lzwe.ctr"
lzwptr->ob[lzwptr->obu] = uc;
lzwptr->obu += 1;
}
else {
-#line 263 "dk4lzwe.ctr"
+#line 289 "dk4lzwe.ctr"
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
@@ -142,7 +129,7 @@ dk4lzwe_shipout(
}
-#line 270 "dk4lzwe.ctr"
+#line 296 "dk4lzwe.ctr"
return back;
}
@@ -161,7 +148,10 @@ dk4lzwe_clear_table_entries(
size_t i;
-#line 287 "dk4lzwe.ctr"
+#line 313 "dk4lzwe.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
cptr = lzwptr->p_tbl;
for (i = 0; i < LZW_TABLE_SIZE; i++) {
cptr[i].os = (unsigned short)0U;
@@ -170,7 +160,7 @@ dk4lzwe_clear_table_entries(
}
-#line 294 "dk4lzwe.ctr"
+#line 323 "dk4lzwe.ctr"
}
@@ -184,10 +174,13 @@ dk4lzwe_init(
int back = 0;
-#line 306 "dk4lzwe.ctr"
+#line 335 "dk4lzwe.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
if (NULL != lzwptr) {
-#line 307 "dk4lzwe.ctr"
+#line 339 "dk4lzwe.ctr"
/*
Default values for al components
*/
@@ -209,25 +202,25 @@ dk4lzwe_init(
*/
if (NULL != lzwptr->p_tbl) {
-#line 327 "dk4lzwe.ctr"
+#line 359 "dk4lzwe.ctr"
dk4lzwe_clear_table_entries(lzwptr);
back = dk4lzwe_shipout(lzwptr, LZW_CLT, erp);
}
#if TRACE_DEBUG
else {
-#line 332 "dk4lzwe.ctr"
+#line 364 "dk4lzwe.ctr"
}
#endif
}
else {
-#line 336 "dk4lzwe.ctr"
+#line 368 "dk4lzwe.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 339 "dk4lzwe.ctr"
+#line 371 "dk4lzwe.ctr"
return back;
}
@@ -251,10 +244,13 @@ dk4lzwe_i_add(
unsigned short offs;
-#line 361 "dk4lzwe.ctr"
+#line 393 "dk4lzwe.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
if (0 != lzwptr->hst) {
-#line 362 "dk4lzwe.ctr"
+#line 397 "dk4lzwe.ctr"
/*
Already input available, so we have to check the table
for a matching rule
@@ -268,18 +264,18 @@ dk4lzwe_i_add(
cc = 1;
found = 0;
-#line 374 "dk4lzwe.ctr"
+#line 409 "dk4lzwe.ctr"
do {
-#line 375 "dk4lzwe.ctr"
+#line 410 "dk4lzwe.ctr"
if ((unsigned short)0U != (lzwptr->p_tbl)[ind].ns) {
-#line 376 "dk4lzwe.ctr"
+#line 411 "dk4lzwe.ctr"
if (lzwptr->cs == (lzwptr->p_tbl)[ind].os) {
if (uc == (lzwptr->p_tbl)[ind].in) {
found = 1;
-#line 379 "dk4lzwe.ctr"
+#line 414 "dk4lzwe.ctr"
}
}
if (0 != found) {
@@ -287,14 +283,14 @@ dk4lzwe_i_add(
}
else {
-#line 385 "dk4lzwe.ctr"
+#line 420 "dk4lzwe.ctr"
ind += offs;
ind = (ind % LZW_TABLE_SIZE);
}
}
else {
-#line 390 "dk4lzwe.ctr"
+#line 425 "dk4lzwe.ctr"
cc = 0;
}
#if TRACE_DEBUG
@@ -302,15 +298,15 @@ dk4lzwe_i_add(
#endif
} while (0 < cc);
-#line 396 "dk4lzwe.ctr"
+#line 431 "dk4lzwe.ctr"
#if TRACE_DEBUG
-#line 398 "dk4lzwe.ctr"
+#line 433 "dk4lzwe.ctr"
#endif
if (0 != found) {
-#line 400 "dk4lzwe.ctr"
+#line 435 "dk4lzwe.ctr"
/*
A matching rule was found, so we just change state.
*/
@@ -319,14 +315,14 @@ dk4lzwe_i_add(
}
else {
-#line 407 "dk4lzwe.ctr"
+#line 442 "dk4lzwe.ctr"
/* No matching rule was found.
We check whether or not we can add further entries to
the table.
*/
if ((unsigned short)4094U <= lzwptr->ns) {
-#line 412 "dk4lzwe.ctr"
+#line 447 "dk4lzwe.ctr"
/*
Table is full, so we ship out the current state,
clean we table and keep the input as new current state.
@@ -335,7 +331,7 @@ dk4lzwe_i_add(
if (0 != dk4lzwe_shipout(lzwptr, LZW_CLT, erp)) {
back = DK4_EDSTM_FINISHED;
-#line 419 "dk4lzwe.ctr"
+#line 454 "dk4lzwe.ctr"
lzwptr->mret = 1;
}
}
@@ -346,7 +342,7 @@ dk4lzwe_i_add(
}
else {
-#line 428 "dk4lzwe.ctr"
+#line 463 "dk4lzwe.ctr"
/* There is still room in the table.
Ship out current state, create new rule in the
table and keep input as new current state.
@@ -354,7 +350,7 @@ dk4lzwe_i_add(
if (0 != dk4lzwe_shipout(lzwptr, lzwptr->cs, erp)) {
back = DK4_EDSTM_FINISHED;
-#line 434 "dk4lzwe.ctr"
+#line 469 "dk4lzwe.ctr"
lzwptr->mret = 1;
}
(lzwptr->p_tbl)[ind].os = lzwptr->cs;
@@ -362,25 +358,25 @@ dk4lzwe_i_add(
(lzwptr->p_tbl)[ind].in = uc;
-#line 440 "dk4lzwe.ctr"
+#line 475 "dk4lzwe.ctr"
/*
Increase number of bits if necessary.
*/
switch ( (int)(lzwptr->ns) ) {
case 511 : {
-#line 445 "dk4lzwe.ctr"
+#line 480 "dk4lzwe.ctr"
lzwptr->bits = 10;
} break;
case 1023 : {
lzwptr->bits = 11;
-#line 449 "dk4lzwe.ctr"
+#line 484 "dk4lzwe.ctr"
} break;
case 2047 : {
lzwptr->bits = 12;
-#line 452 "dk4lzwe.ctr"
+#line 487 "dk4lzwe.ctr"
} break;
}
lzwptr->ns += 1U;
@@ -390,7 +386,7 @@ dk4lzwe_i_add(
}
else {
-#line 460 "dk4lzwe.ctr"
+#line 495 "dk4lzwe.ctr"
/* No current state yet (no input yet).
Just store the input as current state.
*/
@@ -400,7 +396,7 @@ dk4lzwe_i_add(
}
-#line 468 "dk4lzwe.ctr"
+#line 503 "dk4lzwe.ctr"
return back;
}
@@ -416,7 +412,10 @@ dk4lzwe_add(
int back = DK4_EDSTM_ERROR;
-#line 482 "dk4lzwe.ctr"
+#line 517 "dk4lzwe.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
if (NULL != lzwptr) {
if (NULL != lzwptr->p_tbl) {
if (0 == lzwptr->mret) {
@@ -435,7 +434,7 @@ dk4lzwe_add(
}
-#line 499 "dk4lzwe.ctr"
+#line 537 "dk4lzwe.ctr"
return back;
}
@@ -451,7 +450,10 @@ dk4lzwe_finish(
unsigned char uc;
-#line 513 "dk4lzwe.ctr"
+#line 551 "dk4lzwe.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
if (NULL != lzwptr) {
if (NULL != lzwptr->p_tbl) {
if (0 == lzwptr->mret) {
@@ -461,11 +463,11 @@ dk4lzwe_finish(
*/
if (0 != lzwptr->hst) {
-#line 521 "dk4lzwe.ctr"
+#line 562 "dk4lzwe.ctr"
if (0 == dk4lzwe_shipout(lzwptr, lzwptr->cs, erp)) {
back = DK4_EDSTM_ERROR;
-#line 523 "dk4lzwe.ctr"
+#line 564 "dk4lzwe.ctr"
}
}
/* Ship out end of data marker.
@@ -473,7 +475,7 @@ dk4lzwe_finish(
if (0 == dk4lzwe_shipout(lzwptr, LZW_EOD, erp)) {
back = DK4_EDSTM_ERROR;
-#line 529 "dk4lzwe.ctr"
+#line 570 "dk4lzwe.ctr"
}
/* Apply final byte from bit shifter to output.
*/
@@ -481,19 +483,19 @@ dk4lzwe_finish(
case DK4_EDSTM_ERROR : {
back = DK4_EDSTM_ERROR;
-#line 535 "dk4lzwe.ctr"
+#line 576 "dk4lzwe.ctr"
} break;
case DK4_EDSTM_FINISHED : {
uc = dk4bit_shift_output(&(lzwptr->bs), NULL);
if (8 > lzwptr->obu) {
-#line 539 "dk4lzwe.ctr"
+#line 580 "dk4lzwe.ctr"
lzwptr->ob[lzwptr->obu] = uc;
lzwptr->obu += 1;
}
else {
-#line 543 "dk4lzwe.ctr"
+#line 584 "dk4lzwe.ctr"
back = DK4_EDSTM_ERROR;
dk4error_set_simple_error_code(
erp, DK4_E_BUFFER_TOO_SMALL
@@ -506,7 +508,7 @@ dk4lzwe_finish(
if ((DK4_EDSTM_ACCEPT == back) && (0 < lzwptr->obu)) {
back = DK4_EDSTM_FINISHED;
-#line 554 "dk4lzwe.ctr"
+#line 595 "dk4lzwe.ctr"
lzwptr->mret = 1;
}
}
@@ -525,7 +527,7 @@ dk4lzwe_finish(
}
-#line 571 "dk4lzwe.ctr"
+#line 612 "dk4lzwe.ctr"
return back;
}
@@ -542,7 +544,12 @@ dk4lzwe_output(
int back = 0;
-#line 586 "dk4lzwe.ctr"
+#line 627 "dk4lzwe.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+ assert(NULL != lzwptr);
+#endif
if ((NULL != dptr) && (NULL != szptr) && (NULL != lzwptr)) {
/*
All arguments ok, do normal output operation.
@@ -552,12 +559,12 @@ dk4lzwe_output(
back = ((0 < lzwptr->obu) ? (1) : (0));
lzwptr->mret = 0;
-#line 594 "dk4lzwe.ctr"
+#line 640 "dk4lzwe.ctr"
lzwptr->obu = 0;
}
else {
-#line 597 "dk4lzwe.ctr"
+#line 643 "dk4lzwe.ctr"
/*
Argument error, indicate no data available.
*/
@@ -571,7 +578,7 @@ dk4lzwe_output(
}
-#line 609 "dk4lzwe.ctr"
+#line 655 "dk4lzwe.ctr"
return back;
}
diff --git a/support/dktools/dk4lzwe.ctr b/support/dktools/dk4lzwe.ctr
index d38a83fbd8..c1df55bcec 100644
--- a/support/dktools/dk4lzwe.ctr
+++ b/support/dktools/dk4lzwe.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -16,12 +16,29 @@ license = bsd
an entry for 4094, the table is cleared.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
-#include <dk4error.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4BITSH_H_INCLUDED
-#include <dk4bitsh.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bitsh.h"
+#else
+#include <dktools-4/dk4bitsh.h>
+#endif
#endif
@@ -177,11 +194,17 @@ dk4lzwe_output(
/* vim: set ai sw=4 ts=4 : */
%% module
-
+#include "dk4conf.h"
#include "dk4lzwe.h"
#include "dk4mem.h"
#include "dk4edstm.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -241,6 +264,9 @@ dk4lzwe_shipout(
unsigned char uc;
$? "+ dk4lzwe_shipout %u/%u", (unsigned)val, (unsigned)(lzwptr->bits)
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
i = lzwptr->bits;
while (0 < i--) {
res = dk4bit_shift_add(
@@ -284,6 +310,9 @@ dk4lzwe_clear_table_entries(
dk4_lzw_cell_t *cptr;
size_t i;
$? "+ dk4lzwe_clear_table_entries"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
cptr = lzwptr->p_tbl;
for (i = 0; i < LZW_TABLE_SIZE; i++) {
cptr[i].os = (unsigned short)0U;
@@ -303,6 +332,9 @@ dk4lzwe_init(
{
int back = 0;
$? "+ dk4lzwe_init %d", TR_IPTR(lzwptr)
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
if (NULL != lzwptr) { $? ". lzwptr"
/*
Default values for al components
@@ -358,6 +390,9 @@ dk4lzwe_i_add(
unsigned short ind;
unsigned short offs;
$? "+ dk4lzwe_i_add"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
if (0 != lzwptr->hst) { $? ". already input"
/*
Already input available, so we have to check the table
@@ -479,6 +514,9 @@ dk4lzwe_add(
{
int back = DK4_EDSTM_ERROR;
$? "+ dk4lzwe_add"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
if (NULL != lzwptr) {
if (NULL != lzwptr->p_tbl) {
if (0 == lzwptr->mret) {
@@ -510,6 +548,9 @@ dk4lzwe_finish(
int back = DK4_EDSTM_ERROR;
unsigned char uc;
$? "+ dk4lzwe_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != lzwptr);
+#endif
if (NULL != lzwptr) {
if (NULL != lzwptr->p_tbl) {
if (0 == lzwptr->mret) {
@@ -583,6 +624,11 @@ dk4lzwe_output(
{
int back = 0;
$? "+ dk4lzwe_output"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+ assert(NULL != lzwptr);
+#endif
if ((NULL != dptr) && (NULL != szptr) && (NULL != lzwptr)) {
/*
All arguments ok, do normal output operation.
diff --git a/support/dktools/dk4lzwe.h b/support/dktools/dk4lzwe.h
index 7afc458065..a6087f644d 100644
--- a/support/dktools/dk4lzwe.h
+++ b/support/dktools/dk4lzwe.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4lzwe.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4lzwe.ctr
*/
#ifndef DK4LZWE_H_INCLUDED
@@ -50,12 +28,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
an entry for 4094, the table is cleared.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
-#include <dk4error.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4BITSH_H_INCLUDED
-#include <dk4bitsh.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bitsh.h"
+#else
+#include <dktools-4/dk4bitsh.h>
+#endif
#endif
diff --git a/support/dktools/dk4ma.h b/support/dktools/dk4ma.h
index 4d23a60de8..72306b3703 100644
--- a/support/dktools/dk4ma.h
+++ b/support/dktools/dk4ma.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file dk4ma.h Header file to include all dk4maxxxxx related headers.
@section operations dk4maa*.h - Arithmetic operations on different types
@@ -214,501 +219,997 @@ dk4_um_t | dk4maodh.h | dk4ma_write_hex_signed()
#define DK4MA_H_INCLUDED 1
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4NUMCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4numco.h"
+#else
+#include <dktools-4/dk4numco.h>
+#endif
#endif
#ifndef DK4MAAC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maac.h"
+#else
+#include <dktools-4/dk4maac.h>
+#endif
#endif
#ifndef DK4MAAUC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maauc.h"
+#else
+#include <dktools-4/dk4maauc.h>
+#endif
#endif
#ifndef DK4MAAS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maas.h"
+#else
+#include <dktools-4/dk4maas.h>
+#endif
#endif
#ifndef DK4MAAUS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maaus.h"
+#else
+#include <dktools-4/dk4maaus.h>
+#endif
#endif
#ifndef DK4MAAI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maai.h"
+#else
+#include <dktools-4/dk4maai.h>
+#endif
#endif
#ifndef DK4MAAUI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maaui.h"
+#else
+#include <dktools-4/dk4maaui.h>
+#endif
#endif
#ifndef DK4MAAL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maal.h"
+#else
+#include <dktools-4/dk4maal.h>
+#endif
#endif
#ifndef DK4MAAUL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maaul.h"
+#else
+#include <dktools-4/dk4maaul.h>
+#endif
#endif
#ifndef DK4MAALL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maall.h"
+#else
+#include <dktools-4/dk4maall.h>
+#endif
#endif
#ifndef DK4MAALU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maalu.h"
+#else
+#include <dktools-4/dk4maalu.h>
+#endif
#endif
#ifndef DK4MAAMI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maami.h"
+#else
+#include <dktools-4/dk4maami.h>
+#endif
#endif
#ifndef DK4MAAMU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maamu.h"
+#else
+#include <dktools-4/dk4maamu.h>
+#endif
#endif
#ifndef DK4MAADI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maadi.h"
+#else
+#include <dktools-4/dk4maadi.h>
+#endif
#endif
#ifndef DK4MAADU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maadu.h"
+#else
+#include <dktools-4/dk4maadu.h>
+#endif
#endif
#ifndef DK4MASZ_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maasz.h"
+#else
+#include <dktools-4/dk4maasz.h>
+#endif
#endif
#ifndef DK4MACC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4macc.h"
+#else
+#include <dktools-4/dk4macc.h>
+#endif
#endif
#ifndef DK4MACS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4macs.h"
+#else
+#include <dktools-4/dk4macs.h>
+#endif
#endif
#ifndef DK4MACI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maci.h"
+#else
+#include <dktools-4/dk4maci.h>
+#endif
#endif
#ifndef DK4MACL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4macl.h"
+#else
+#include <dktools-4/dk4macl.h>
+#endif
#endif
#ifndef DK4MACLL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4macll.h"
+#else
+#include <dktools-4/dk4macll.h>
+#endif
#endif
#ifndef DK4MACM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4macm.h"
+#else
+#include <dktools-4/dk4macm.h>
+#endif
#endif
#ifndef DK4MACD_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4macd.h"
+#else
+#include <dktools-4/dk4macd.h>
+#endif
#endif
#ifndef DK4MAO8D_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mao8d.h"
+#else
+#include <dktools-4/dk4mao8d.h>
+#endif
#endif
#ifndef DK4MAO8H_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mao8h.h"
+#else
+#include <dktools-4/dk4mao8h.h>
+#endif
#endif
#ifndef DK4MAOWD_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maowd.h"
+#else
+#include <dktools-4/dk4maowd.h>
+#endif
#endif
#ifndef DK4MAOWH_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maowh.h"
+#else
+#include <dktools-4/dk4maowh.h>
+#endif
#endif
#ifndef DK4MAODD_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maodd.h"
+#else
+#include <dktools-4/dk4maodd.h>
+#endif
#endif
#ifndef DK4MAODH_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maodh.h"
+#else
+#include <dktools-4/dk4maodh.h>
+#endif
#endif
#ifndef DK4MAI8DDI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8ddi.h"
+#else
+#include <dktools-4/dk4mai8ddi.h>
+#endif
#endif
#ifndef DK4MAI8DDU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8ddu.h"
+#else
+#include <dktools-4/dk4mai8ddu.h>
+#endif
#endif
#ifndef DK4MAI8DIC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dic.h"
+#else
+#include <dktools-4/dk4mai8dic.h>
+#endif
#endif
#ifndef DK4MAI8DII_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dii.h"
+#else
+#include <dktools-4/dk4mai8dii.h>
+#endif
#endif
#ifndef DK4MAI8DIL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dil.h"
+#else
+#include <dktools-4/dk4mai8dil.h>
+#endif
#endif
#ifndef DK4MAI8DIS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dis.h"
+#else
+#include <dktools-4/dk4mai8dis.h>
+#endif
#endif
#ifndef DK4MAI8DLI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dli.h"
+#else
+#include <dktools-4/dk4mai8dli.h>
+#endif
#endif
#ifndef DK4MAI8DLU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dlu.h"
+#else
+#include <dktools-4/dk4mai8dlu.h>
+#endif
#endif
#ifndef DK4MAI8DMI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dmi.h"
+#else
+#include <dktools-4/dk4mai8dmi.h>
+#endif
#endif
#ifndef DK4MAI8DMU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dmu.h"
+#else
+#include <dktools-4/dk4mai8dmu.h>
+#endif
#endif
#ifndef DK4MAI8DSZ_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dsz.h"
+#else
+#include <dktools-4/dk4mai8dsz.h>
+#endif
#endif
#ifndef DK4MAI8DUC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8duc.h"
+#else
+#include <dktools-4/dk4mai8duc.h>
+#endif
#endif
#ifndef DK4MAI8DUI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dui.h"
+#else
+#include <dktools-4/dk4mai8dui.h>
+#endif
#endif
#ifndef DK4MAI8DUL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dul.h"
+#else
+#include <dktools-4/dk4mai8dul.h>
+#endif
#endif
#ifndef DK4MAI8DUS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8dus.h"
+#else
+#include <dktools-4/dk4mai8dus.h>
+#endif
#endif
#ifndef DK4MAI8HDI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hdi.h"
+#else
+#include <dktools-4/dk4mai8hdi.h>
+#endif
#endif
#ifndef DK4MAI8HDU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hdu.h"
+#else
+#include <dktools-4/dk4mai8hdu.h>
+#endif
#endif
#ifndef DK4MAI8HIC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hic.h"
+#else
+#include <dktools-4/dk4mai8hic.h>
+#endif
#endif
#ifndef DK4MAI8HII_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hii.h"
+#else
+#include <dktools-4/dk4mai8hii.h>
+#endif
#endif
#ifndef DK4MAI8HIL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hil.h"
+#else
+#include <dktools-4/dk4mai8hil.h>
+#endif
#endif
#ifndef DK4MAI8HIS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8his.h"
+#else
+#include <dktools-4/dk4mai8his.h>
+#endif
#endif
#ifndef DK4MAI8HLI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hli.h"
+#else
+#include <dktools-4/dk4mai8hli.h>
+#endif
#endif
#ifndef DK4MAI8HLU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hlu.h"
+#else
+#include <dktools-4/dk4mai8hlu.h>
+#endif
#endif
#ifndef DK4MAI8HMI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hmi.h"
+#else
+#include <dktools-4/dk4mai8hmi.h>
+#endif
#endif
#ifndef DK4MAI8HMU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hmu.h"
+#else
+#include <dktools-4/dk4mai8hmu.h>
+#endif
#endif
#ifndef DK4MAI8HUC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8huc.h"
+#else
+#include <dktools-4/dk4mai8huc.h>
+#endif
#endif
#ifndef DK4MAI8HUI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hui.h"
+#else
+#include <dktools-4/dk4mai8hui.h>
+#endif
#endif
#ifndef DK4MAI8HUL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hul.h"
+#else
+#include <dktools-4/dk4mai8hul.h>
+#endif
#endif
#ifndef DK4MAI8HUS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4mai8hus.h"
+#else
+#include <dktools-4/dk4mai8hus.h>
+#endif
#endif
#ifndef DK4MAIDDDI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidddi.h"
+#else
+#include <dktools-4/dk4maidddi.h>
+#endif
#endif
#ifndef DK4MAIDDDU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidddu.h"
+#else
+#include <dktools-4/dk4maidddu.h>
+#endif
#endif
#ifndef DK4MAIDDIC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddic.h"
+#else
+#include <dktools-4/dk4maiddic.h>
+#endif
#endif
#ifndef DK4MAIDDII_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddii.h"
+#else
+#include <dktools-4/dk4maiddii.h>
+#endif
#endif
#ifndef DK4MAIDDIL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddil.h"
+#else
+#include <dktools-4/dk4maiddil.h>
+#endif
#endif
#ifndef DK4MAIDDIS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddis.h"
+#else
+#include <dktools-4/dk4maiddis.h>
+#endif
#endif
#ifndef DK4MAIDDLI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddli.h"
+#else
+#include <dktools-4/dk4maiddli.h>
+#endif
#endif
#ifndef DK4MAIDDLU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddlu.h"
+#else
+#include <dktools-4/dk4maiddlu.h>
+#endif
#endif
#ifndef DK4MAIDDMI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddmi.h"
+#else
+#include <dktools-4/dk4maiddmi.h>
+#endif
#endif
#ifndef DK4MAIDDMU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddmu.h"
+#else
+#include <dktools-4/dk4maiddmu.h>
+#endif
#endif
#ifndef DK4MAIDDSZ_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddsz.h"
+#else
+#include <dktools-4/dk4maiddsz.h>
+#endif
#endif
#ifndef DK4MAIDDUC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidduc.h"
+#else
+#include <dktools-4/dk4maidduc.h>
+#endif
#endif
#ifndef DK4MAIDDUI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddui.h"
+#else
+#include <dktools-4/dk4maiddui.h>
+#endif
#endif
#ifndef DK4MAIDDUL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddul.h"
+#else
+#include <dktools-4/dk4maiddul.h>
+#endif
#endif
#ifndef DK4MAIDDUS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiddus.h"
+#else
+#include <dktools-4/dk4maiddus.h>
+#endif
#endif
#ifndef DK4MAIDHDI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhdi.h"
+#else
+#include <dktools-4/dk4maidhdi.h>
+#endif
#endif
#ifndef DK4MAIDHDU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhdu.h"
+#else
+#include <dktools-4/dk4maidhdu.h>
+#endif
#endif
#ifndef DK4MAIDHIC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhic.h"
+#else
+#include <dktools-4/dk4maidhic.h>
+#endif
#endif
#ifndef DK4MAIDHII_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhii.h"
+#else
+#include <dktools-4/dk4maidhii.h>
+#endif
#endif
#ifndef DK4MAIDHIL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhil.h"
+#else
+#include <dktools-4/dk4maidhil.h>
+#endif
#endif
#ifndef DK4MAIDHIS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhis.h"
+#else
+#include <dktools-4/dk4maidhis.h>
+#endif
#endif
#ifndef DK4MAIDHLI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhli.h"
+#else
+#include <dktools-4/dk4maidhli.h>
+#endif
#endif
#ifndef DK4MAIDHLU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhlu.h"
+#else
+#include <dktools-4/dk4maidhlu.h>
+#endif
#endif
#ifndef DK4MAIDHMI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhmi.h"
+#else
+#include <dktools-4/dk4maidhmi.h>
+#endif
#endif
-#ifndef DK4MAIDHMU_H_INCLUDED
+#ifndef DK4MAIDHMU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhmu.h"
+#else
+#include <dktools-4/dk4maidhmu.h>
+#endif
#endif
#ifndef DK4MAIDHUC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhuc.h"
+#else
+#include <dktools-4/dk4maidhuc.h>
+#endif
#endif
#ifndef DK4MAIDHUI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhui.h"
+#else
+#include <dktools-4/dk4maidhui.h>
+#endif
#endif
#ifndef DK4MAIDHUL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhul.h"
+#else
+#include <dktools-4/dk4maidhul.h>
+#endif
#endif
#ifndef DK4MAIDHUS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maidhus.h"
+#else
+#include <dktools-4/dk4maidhus.h>
+#endif
#endif
#ifndef DK4MAIWDDI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwddi.h"
+#else
+#include <dktools-4/dk4maiwddi.h>
+#endif
#endif
#ifndef DK4MAIWDDU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwddu.h"
+#else
+#include <dktools-4/dk4maiwddu.h>
+#endif
#endif
#ifndef DK4MAIWDIC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdic.h"
+#else
+#include <dktools-4/dk4maiwdic.h>
+#endif
#endif
#ifndef DK4MAIWDII_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdii.h"
+#else
+#include <dktools-4/dk4maiwdii.h>
+#endif
#endif
#ifndef DK4MAIWDIL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdil.h"
+#else
+#include <dktools-4/dk4maiwdil.h>
+#endif
#endif
#ifndef DK4MAIWDIS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdis.h"
+#else
+#include <dktools-4/dk4maiwdis.h>
+#endif
#endif
#ifndef DK4MAIWDLI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdli.h"
+#else
+#include <dktools-4/dk4maiwdli.h>
+#endif
#endif
#ifndef DK4MAIWDLU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdlu.h"
+#else
+#include <dktools-4/dk4maiwdlu.h>
+#endif
#endif
#ifndef DK4MAIWDMI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdmi.h"
+#else
+#include <dktools-4/dk4maiwdmi.h>
+#endif
#endif
#ifndef DK4MAIWDMU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdmu.h"
+#else
+#include <dktools-4/dk4maiwdmu.h>
+#endif
#endif
#ifndef DK4MAIWDSZ_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdsz.h"
+#else
+#include <dktools-4/dk4maiwdsz.h>
+#endif
#endif
#ifndef DK4MAIWDUC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwduc.h"
+#else
+#include <dktools-4/dk4maiwduc.h>
+#endif
#endif
#ifndef DK4MAIWDUI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdui.h"
+#else
+#include <dktools-4/dk4maiwdui.h>
+#endif
#endif
#ifndef DK4MAIWDUL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdul.h"
+#else
+#include <dktools-4/dk4maiwdul.h>
+#endif
#endif
#ifndef DK4MAIWDUS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwdus.h"
+#else
+#include <dktools-4/dk4maiwdus.h>
+#endif
#endif
#ifndef DK4MAIWHDI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhdi.h"
+#else
+#include <dktools-4/dk4maiwhdi.h>
+#endif
#endif
#ifndef Dk4MAIWHDU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhdu.h"
+#else
+#include <dktools-4/dk4maiwhdu.h>
+#endif
#endif
#ifndef DK4MAIWHIC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhic.h"
+#else
+#include <dktools-4/dk4maiwhic.h>
+#endif
#endif
#ifndef DK4MAIWHII_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhii.h"
+#else
+#include <dktools-4/dk4maiwhii.h>
+#endif
#endif
#ifndef DK4MAIWHIL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhil.h"
+#else
+#include <dktools-4/dk4maiwhil.h>
+#endif
#endif
#ifndef DK4MAIWHIS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhis.h"
+#else
+#include <dktools-4/dk4maiwhis.h>
+#endif
#endif
#ifndef DK4MAIWHLI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhli.h"
+#else
+#include <dktools-4/dk4maiwhli.h>
+#endif
#endif
#ifndef DK4MAIWHLU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhlu.h"
+#else
+#include <dktools-4/dk4maiwhlu.h>
+#endif
#endif
#ifndef DK4MAIWHMI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhmi.h"
+#else
+#include <dktools-4/dk4maiwhmi.h>
+#endif
#endif
#ifndef DK4MAIWHMU_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhmu.h"
+#else
+#include <dktools-4/dk4maiwhmu.h>
+#endif
#endif
#ifndef DK4MAIWHUC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhuc.h"
+#else
+#include <dktools-4/dk4maiwhuc.h>
+#endif
#endif
#ifndef DK4MAIWHUI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhui.h"
+#else
+#include <dktools-4/dk4maiwhui.h>
+#endif
#endif
#ifndef DK4MAIWHUL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhul.h"
+#else
+#include <dktools-4/dk4maiwhul.h>
+#endif
#endif
#ifndef DK4MAIWHUS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maiwhus.h"
+#else
+#include <dktools-4/dk4maiwhus.h>
+#endif
#endif
#ifndef DK4MAAI16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maai16.h"
+#else
+#include <dktools-4/dk4maai16.h>
+#endif
#endif
#ifndef DK4MAAU16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maau16.h"
+#else
+#include <dktools-4/dk4maau16.h>
+#endif
#endif
#ifndef DK4MAAI32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maai32.h"
+#else
+#include <dktools-4/dk4maai32.h>
+#endif
#endif
#ifndef DK4MAAU32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maau32.h"
+#else
+#include <dktools-4/dk4maau32.h>
+#endif
#endif
#ifndef DK4MACI16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maci16.h"
+#else
+#include <dktools-4/dk4maci16.h>
+#endif
#endif
#ifndef DK4MACI32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4maci32.h"
+#else
+#include <dktools-4/dk4maci32.h>
+#endif
#endif
#endif
diff --git a/support/dktools/dk4maac.c b/support/dktools/dk4maac.c
index 1092c27f00..a861d1e34e 100644
--- a/support/dktools/dk4maac.c
+++ b/support/dktools/dk4maac.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maac.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maac.ctr
*/
/** @file dk4maac.c The dk4maac module.
*/
-#line 98 "dk4maac.ctr"
+#line 130 "dk4maac.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -49,7 +27,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 108 "dk4maac.ctr"
+#line 140 "dk4maac.ctr"
@@ -112,7 +90,7 @@ dk4ma_char_mul(signed char a, signed char b, dk4_er_t *erp)
{
-#line 169 "dk4maac.ctr"
+#line 201 "dk4maac.ctr"
if ((0 != a) && (0 != b)) {
if (SCHAR_MIN == a) {
if ((signed char)1 != b) {
@@ -150,7 +128,7 @@ dk4ma_char_mul(signed char a, signed char b, dk4_er_t *erp)
}
-#line 205 "dk4maac.ctr"
+#line 237 "dk4maac.ctr"
return (signed char)(a * b);
}
@@ -175,3 +153,36 @@ dk4ma_char_div(signed char a, signed char b, dk4_er_t *erp)
return back;
}
+
+
+signed char
+dm4ma_char_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(SCHAR_MAX) < i) || ((dk4_im_t)(SCHAR_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((signed char)i);
+}
+
+
+
+signed char
+dk4ma_char_from_double(double d, dk4_er_t *erp)
+{
+ signed char back = 0x00;
+ if ((double)(SCHAR_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = SCHAR_MIN;
+ }
+ else {
+ if ((double)(SCHAR_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = SCHAR_MAX;
+ }
+ else {
+ back = (signed char)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maac.ctr b/support/dktools/dk4maac.ctr
index 3cffc828e2..69a40d5576 100644
--- a/support/dktools/dk4maac.ctr
+++ b/support/dktools/dk4maac.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -90,6 +102,26 @@ dk4ma_char_mul(signed char a, signed char b, dk4_er_t *erp);
signed char
dk4ma_char_div(signed char a, signed char b, dk4_er_t *erp);
+/** Convert value to signed character.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+signed char
+dm4ma_char_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+signed char
+dk4ma_char_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -226,3 +258,36 @@ dk4ma_char_div(signed char a, signed char b, dk4_er_t *erp)
return back;
}
+
+
+signed char
+dm4ma_char_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(SCHAR_MAX) < i) || ((dk4_im_t)(SCHAR_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((signed char)i);
+}
+
+
+
+signed char
+dk4ma_char_from_double(double d, dk4_er_t *erp)
+{
+ signed char back = 0x00;
+ if ((double)(SCHAR_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = SCHAR_MIN;
+ }
+ else {
+ if ((double)(SCHAR_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = SCHAR_MAX;
+ }
+ else {
+ back = (signed char)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maac.h b/support/dktools/dk4maac.h
index 3a46013888..44e7aac2a4 100644
--- a/support/dktools/dk4maac.h
+++ b/support/dktools/dk4maac.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maac.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maac.ctr
*/
#ifndef DK4MAAC_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -124,6 +114,26 @@ dk4ma_char_mul(signed char a, signed char b, dk4_er_t *erp);
signed char
dk4ma_char_div(signed char a, signed char b, dk4_er_t *erp);
+/** Convert value to signed character.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+signed char
+dm4ma_char_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+signed char
+dk4ma_char_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maadi.c b/support/dktools/dk4maadi.c
index 0ae674bd14..be724cc804 100644
--- a/support/dktools/dk4maadi.c
+++ b/support/dktools/dk4maadi.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maadi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maadi.ctr
*/
/** @file dk4maadi.c The dk4maadi module.
*/
-#line 100 "dk4maadi.ctr"
+#line 134 "dk4maadi.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -56,6 +34,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maadi.h"
+#ifndef DK4MAADU_H_INCLUDED
+#include "dk4maadu.h"
+#endif
+
dk4_im_t
@@ -137,3 +119,37 @@ dk4ma_im_div(dk4_im_t a, dk4_im_t b, dk4_er_t *erp)
}
+
+dk4_im_t
+dk4ma_im_gcd(dk4_im_t a, dk4_im_t b, dk4_er_t *erp)
+{
+ dk4_im_t back;
+ dk4_um_t v;
+
+ v = dk4ma_um_gcd(dk4ma_im_abs(a, erp), dk4ma_im_abs(b, erp));
+ back = (dk4_im_t)v;
+ if ((dk4_um_t)(DK4_IM_MAX) < v) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return back;
+}
+
+
+
+dk4_im_t
+dk4ma_im_lcm(dk4_im_t a, dk4_im_t b, dk4_er_t *erp)
+{
+ return (
+ dk4ma_im_mul(
+ dk4ma_im_div(dk4ma_im_abs(a, erp), dk4ma_im_gcd(a, b, erp), erp),
+ dk4ma_im_abs(b, erp),
+ erp
+ )
+ );
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4maadi.ctr b/support/dktools/dk4maadi.ctr
index 64cac42ab3..b3f6d1ead8 100644
--- a/support/dktools/dk4maadi.ctr
+++ b/support/dktools/dk4maadi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -91,6 +103,28 @@ dk4ma_im_mul(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
dk4_im_t
dk4ma_im_div(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
+/** Calculate greatest common divisor.
+ @param a One number.
+ @param b Other number.
+ @param erp Error report, may be NULL.
+ @return Greatest common divisor of a and b.
+
+ Error codes: DK4_E_OVERFLOW, DK4_E_DIVZERO.
+*/
+dk4_im_t
+dk4ma_im_gcd(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
+
+/** Calculate least common multiple.
+ @param a One number.
+ @param b Other number.
+ @param erp Error report, may be NULL.
+ @return Least common multiple of a and b.
+
+ Error codes: DK4_E_OVERFLOW, DK4_E_DIVZERO.
+*/
+dk4_im_t
+dk4ma_im_lcm(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -115,6 +149,10 @@ dk4ma_im_div(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
#include "dk4maadi.h"
+#ifndef DK4MAADU_H_INCLUDED
+#include "dk4maadu.h"
+#endif
+
dk4_im_t
@@ -196,3 +234,37 @@ dk4ma_im_div(dk4_im_t a, dk4_im_t b, dk4_er_t *erp)
}
+
+dk4_im_t
+dk4ma_im_gcd(dk4_im_t a, dk4_im_t b, dk4_er_t *erp)
+{
+ dk4_im_t back;
+ dk4_um_t v;
+
+ v = dk4ma_um_gcd(dk4ma_im_abs(a, erp), dk4ma_im_abs(b, erp));
+ back = (dk4_im_t)v;
+ if ((dk4_um_t)(DK4_IM_MAX) < v) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return back;
+}
+
+
+
+dk4_im_t
+dk4ma_im_lcm(dk4_im_t a, dk4_im_t b, dk4_er_t *erp)
+{
+ return (
+ dk4ma_im_mul(
+ dk4ma_im_div(dk4ma_im_abs(a, erp), dk4ma_im_gcd(a, b, erp), erp),
+ dk4ma_im_abs(b, erp),
+ erp
+ )
+ );
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4maadi.h b/support/dktools/dk4maadi.h
index 6413d0f2fa..51d88af8a2 100644
--- a/support/dktools/dk4maadi.h
+++ b/support/dktools/dk4maadi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maadi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maadi.ctr
*/
#ifndef DK4MAADI_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -124,6 +114,28 @@ dk4ma_im_mul(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
dk4_im_t
dk4ma_im_div(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
+/** Calculate greatest common divisor.
+ @param a One number.
+ @param b Other number.
+ @param erp Error report, may be NULL.
+ @return Greatest common divisor of a and b.
+
+ Error codes: DK4_E_OVERFLOW, DK4_E_DIVZERO.
+*/
+dk4_im_t
+dk4ma_im_gcd(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
+
+/** Calculate least common multiple.
+ @param a One number.
+ @param b Other number.
+ @param erp Error report, may be NULL.
+ @return Least common multiple of a and b.
+
+ Error codes: DK4_E_OVERFLOW, DK4_E_DIVZERO.
+*/
+dk4_im_t
+dk4ma_im_lcm(dk4_im_t a, dk4_im_t b, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maadu.c b/support/dktools/dk4maadu.c
index 7f7bfc7c29..842cade825 100644
--- a/support/dktools/dk4maadu.c
+++ b/support/dktools/dk4maadu.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maadu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maadu.ctr
*/
/** @file dk4maadu.c The dk4maadu module.
*/
-#line 90 "dk4maadu.ctr"
+#line 137 "dk4maadu.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -57,6 +35,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maadu.h"
+
+
+
+#line 158 "dk4maadu.ctr"
+
+
+
dk4_um_t
dk4ma_um_add(dk4_um_t a, dk4_um_t b, dk4_er_t *erp)
{
@@ -119,3 +104,55 @@ dk4ma_um_div(dk4_um_t a, dk4_um_t b, dk4_er_t *erp)
#endif
}
+
+
+dk4_um_t
+dk4ma_um_gcd(dk4_um_t a, dk4_um_t b)
+{
+ dk4_um_t h;
+
+
+#line 230 "dk4maadu.ctr"
+ while (0UL < b) {
+ h = a % b;
+ a = b;
+ b = h;
+ }
+ if (0UL == a) { a = 1UL; }
+
+#line 236 "dk4maadu.ctr"
+ return a;
+}
+
+
+
+dk4_um_t
+dk4ma_um_lcm(dk4_um_t a, dk4_um_t b, dk4_er_t *erp)
+{
+ return(
+ dk4ma_um_mul(
+ dk4ma_um_div(a, dk4ma_um_gcd(a, b), erp), b, erp
+ )
+ );
+}
+
+
+
+int
+dk4ma_um_isgr(dk4_um_t a, dk4_um_t b)
+{
+ return ((a > b) ? ((int)1) : ((int)0));
+}
+
+
+
+int
+dk4ma_um_isgeq(dk4_um_t a, dk4_um_t b)
+{
+ return ((a >= b) ? ((int)1) : ((int)0));
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4maadu.ctr b/support/dktools/dk4maadu.ctr
index c54adb8401..fa0cb19876 100644
--- a/support/dktools/dk4maadu.ctr
+++ b/support/dktools/dk4maadu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -81,6 +93,41 @@ dk4ma_um_mul(dk4_um_t a, dk4_um_t b, dk4_er_t *erp);
dk4_um_t
dk4ma_um_div(dk4_um_t a, dk4_um_t b, dk4_er_t *erp);
+/** Calculate greatest common divisor of two numbers.
+ @param a One number.
+ @param b Other number.
+ @return Greatest common divisor.
+*/
+dk4_um_t
+dk4ma_um_gcd(dk4_um_t a, dk4_um_t b);
+
+/** Calculate least common multiple of two numbers.
+ @param a One number.
+ @param b Other number.
+ @param erp Error report, may be NULL.
+ @return Least common multiple of a and b.
+
+ Error codes: DK4_E_OVERFLOW, DK4_E_DIVZERO.
+*/
+dk4_um_t
+dk4ma_um_lcm(dk4_um_t a, dk4_um_t b, dk4_er_t *erp);
+
+/** Comparison: Is a greater than b.
+ @param a Left comparison operand.
+ @param b Right comparison operand.
+ @return 1 if a>b, 0 otherwise.
+*/
+int
+dk4ma_um_isgr(dk4_um_t a, dk4_um_t b);
+
+/** Comparison: Is a greater than or equal to b.
+ @param a Left comparison operand.
+ @param b Right comparison operand.
+ @return 1 if a>=b, 0 otherwise.
+*/
+int
+dk4ma_um_isgeq(dk4_um_t a, dk4_um_t b);
+
#ifdef __cplusplus
}
#endif
@@ -106,6 +153,11 @@ dk4ma_um_div(dk4_um_t a, dk4_um_t b, dk4_er_t *erp);
#include "dk4maadu.h"
+
+$!trace-include
+
+
+
dk4_um_t
dk4ma_um_add(dk4_um_t a, dk4_um_t b, dk4_er_t *erp)
{
@@ -168,3 +220,51 @@ dk4ma_um_div(dk4_um_t a, dk4_um_t b, dk4_er_t *erp)
#endif
}
+
+
+dk4_um_t
+dk4ma_um_gcd(dk4_um_t a, dk4_um_t b)
+{
+ dk4_um_t h;
+ $? "+ dk4ma_um_gcd %lu %lu", (unsigned long)a, (unsigned long)b
+ while (0UL < b) {
+ h = a % b;
+ a = b;
+ b = h;
+ }
+ if (0UL == a) { a = 1UL; } $? "- dk4ma_um_gcd %lu", (unsigned long)a
+ return a;
+}
+
+
+
+dk4_um_t
+dk4ma_um_lcm(dk4_um_t a, dk4_um_t b, dk4_er_t *erp)
+{
+ return(
+ dk4ma_um_mul(
+ dk4ma_um_div(a, dk4ma_um_gcd(a, b), erp), b, erp
+ )
+ );
+}
+
+
+
+int
+dk4ma_um_isgr(dk4_um_t a, dk4_um_t b)
+{
+ return ((a > b) ? ((int)1) : ((int)0));
+}
+
+
+
+int
+dk4ma_um_isgeq(dk4_um_t a, dk4_um_t b)
+{
+ return ((a >= b) ? ((int)1) : ((int)0));
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4maadu.h b/support/dktools/dk4maadu.h
index 4f26c44ac6..c591ba21c9 100644
--- a/support/dktools/dk4maadu.h
+++ b/support/dktools/dk4maadu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maadu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maadu.ctr
*/
#ifndef DK4MAADU_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -113,6 +103,41 @@ dk4ma_um_mul(dk4_um_t a, dk4_um_t b, dk4_er_t *erp);
dk4_um_t
dk4ma_um_div(dk4_um_t a, dk4_um_t b, dk4_er_t *erp);
+/** Calculate greatest common divisor of two numbers.
+ @param a One number.
+ @param b Other number.
+ @return Greatest common divisor.
+*/
+dk4_um_t
+dk4ma_um_gcd(dk4_um_t a, dk4_um_t b);
+
+/** Calculate least common multiple of two numbers.
+ @param a One number.
+ @param b Other number.
+ @param erp Error report, may be NULL.
+ @return Least common multiple of a and b.
+
+ Error codes: DK4_E_OVERFLOW, DK4_E_DIVZERO.
+*/
+dk4_um_t
+dk4ma_um_lcm(dk4_um_t a, dk4_um_t b, dk4_er_t *erp);
+
+/** Comparison: Is a greater than b.
+ @param a Left comparison operand.
+ @param b Right comparison operand.
+ @return 1 if a>b, 0 otherwise.
+*/
+int
+dk4ma_um_isgr(dk4_um_t a, dk4_um_t b);
+
+/** Comparison: Is a greater than or equal to b.
+ @param a Left comparison operand.
+ @param b Right comparison operand.
+ @return 1 if a>=b, 0 otherwise.
+*/
+int
+dk4ma_um_isgeq(dk4_um_t a, dk4_um_t b);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maai.c b/support/dktools/dk4maai.c
index c584f84cee..5cf19b371c 100644
--- a/support/dktools/dk4maai.c
+++ b/support/dktools/dk4maai.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maai.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maai.ctr
*/
/** @file dk4maai.c The dk4maai module.
*/
-#line 100 "dk4maai.ctr"
+#line 132 "dk4maai.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -168,3 +146,36 @@ dk4ma_int_div(int a, int b, dk4_er_t *erp)
}
+
+int
+dk4ma_int_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(INT_MAX) < i) || ((dk4_im_t)(INT_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((int)i);
+}
+
+
+
+int
+dk4ma_int_from_double(double d, dk4_er_t *erp)
+{
+ int back = 0;
+ if ((double)(INT_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = INT_MIN;
+ }
+ else {
+ if ((double)(INT_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = INT_MAX;
+ }
+ else {
+ back = (int)d;
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4maai.ctr b/support/dktools/dk4maai.ctr
index bdbcc285ae..0274fae83e 100644
--- a/support/dktools/dk4maai.ctr
+++ b/support/dktools/dk4maai.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -91,6 +103,26 @@ dk4ma_int_mul(int a, int b, dk4_er_t *erp);
int
dk4ma_int_div(int a, int b, dk4_er_t *erp);
+/** Convert dk4_im_t value to int.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+int
+dk4ma_int_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double value to int.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+int
+dk4ma_int_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -227,3 +259,36 @@ dk4ma_int_div(int a, int b, dk4_er_t *erp)
}
+
+int
+dk4ma_int_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(INT_MAX) < i) || ((dk4_im_t)(INT_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((int)i);
+}
+
+
+
+int
+dk4ma_int_from_double(double d, dk4_er_t *erp)
+{
+ int back = 0;
+ if ((double)(INT_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = INT_MIN;
+ }
+ else {
+ if ((double)(INT_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = INT_MAX;
+ }
+ else {
+ back = (int)d;
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4maai.h b/support/dktools/dk4maai.h
index 5008a675f6..2b1aaf356d 100644
--- a/support/dktools/dk4maai.h
+++ b/support/dktools/dk4maai.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maai.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maai.ctr
*/
#ifndef DK4MAAI_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -124,6 +114,26 @@ dk4ma_int_mul(int a, int b, dk4_er_t *erp);
int
dk4ma_int_div(int a, int b, dk4_er_t *erp);
+/** Convert dk4_im_t value to int.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+int
+dk4ma_int_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double value to int.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+int
+dk4ma_int_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maai16.c b/support/dktools/dk4maai16.c
index 48859d6b63..9387896cc5 100644
--- a/support/dktools/dk4maai16.c
+++ b/support/dktools/dk4maai16.c
@@ -1,65 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maai16.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maai16.ctr
*/
/** @file dk4maai16.c The dk4maai16 module.
*/
-#line 133 "dk4maai16.ctr"
+#line 167 "dk4maai16.ctr"
+#include "dk4conf.h"
#include "dk4maai16.h"
-#line 139 "dk4maai16.ctr"
+#line 174 "dk4maai16.ctr"
int16_t
dk4ma_int16_t_add(int16_t a, int16_t b, dk4_er_t *erp)
{
- if ((DK4_I16_MAX < a) || (DK4_I16_MIN > a)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if ((DK4_I16_MAX < b) || (DK4_I16_MIN > b)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((0 < a) && (0 < b)) {
if ((DK4_I16_MAX - a) < b) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
@@ -75,7 +46,6 @@ dk4ma_int16_t_add(int16_t a, int16_t b, dk4_er_t *erp)
}
}
}
-finished:
return (a + b);
}
@@ -84,14 +54,6 @@ finished:
int16_t
dk4ma_int16_t_sub(int16_t a, int16_t b, dk4_er_t *erp)
{
- if ((DK4_I16_MAX < a) || (DK4_I16_MIN > a)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if ((DK4_I16_MAX < b) || (DK4_I16_MIN > b)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((0 < a) && (0 > b)) {
if ((DK4_I16_MAX + b) < a) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
@@ -103,7 +65,6 @@ dk4ma_int16_t_sub(int16_t a, int16_t b, dk4_er_t *erp)
}
}
}
-finished:
return (a - b);
}
@@ -112,14 +73,6 @@ finished:
int16_t
dk4ma_int16_t_mul(int16_t a, int16_t b, dk4_er_t *erp)
{
- if ((DK4_I16_MAX < a) || (DK4_I16_MIN > a)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if ((DK4_I16_MAX < b) || (DK4_I16_MIN > b)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((0 != a) && (0 != b)) {
if (DK4_I16_MIN == b) {
if (1 != a) {
@@ -155,7 +108,6 @@ dk4ma_int16_t_mul(int16_t a, int16_t b, dk4_er_t *erp)
}
}
}
-finished:
return (a * b);
}
@@ -165,15 +117,7 @@ int16_t
dk4ma_int16_t_div(int16_t a, int16_t b, dk4_er_t *erp)
{
int16_t back = 0;
- if ((DK4_I16_MAX < a) || (DK4_I16_MIN > a)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if ((DK4_I16_MAX < b) || (DK4_I16_MIN > b)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
-finished:
+
if (0 != b) {
if ((DK4_I16_MIN == a) && (-1 == b)) {
back = DK4_I16_MAX;
@@ -200,10 +144,47 @@ int16_t
dk4ma_int16_t_abs(int16_t a, dk4_er_t *erp)
{
if (DK4_I16_MIN != a) {
- return (0 - a);
+ if ((int16_t)0 > a) {
+ return ((int16_t)0 - a);
+ } else {
+ return a;
+ }
} else {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
return (DK4_I16_MAX);
}
}
+
+
+int16_t
+dk4ma_int16_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(DK4_I16_MAX) < i) || ((dk4_im_t)(DK4_I16_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((int16_t)i);
+}
+
+
+
+int16_t
+dk4ma_int16_from_double(double d, dk4_er_t *erp)
+{
+ int16_t back = 0;
+ if ((double)(DK4_I16_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = DK4_I16_MIN;
+ }
+ else {
+ if ((double)(DK4_I16_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = DK4_I16_MAX;
+ }
+ else {
+ back = (int16_t)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maai16.ctr b/support/dktools/dk4maai16.ctr
index d8aef32f4b..54eb0c442b 100644
--- a/support/dktools/dk4maai16.ctr
+++ b/support/dktools/dk4maai16.ctr
@@ -2,25 +2,31 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
/** @file dk4maai16.h Operations on int16_t data.
+
+ CRT on Windows: Optional.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
#endif
-
-#ifndef DK4TYPES_H_INCLUDED
-#include "dk4types.h"
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -44,6 +50,14 @@ license = bsd
#endif
#endif
+#ifndef INT16_MAX
+#define INT16_MAX ((int16_t)32767)
+#endif
+
+#ifndef INT16_MIN
+#define INT16_MIN (((int16_t)(-32767)) - ((int16_t)1))
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -124,6 +138,26 @@ dk4ma_int16_t_div(int16_t a, int16_t b, dk4_er_t *erp);
int16_t
dk4ma_int16_t_abs(int16_t a, dk4_er_t *erp);
+/** Convert dk4_im_t value to int16_t.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+int16_t
+dk4ma_int16_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to int16_t.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+int16_t
+dk4ma_int16_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -131,6 +165,7 @@ dk4ma_int16_t_abs(int16_t a, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4maai16.h"
@@ -142,14 +177,6 @@ $!trace-include
int16_t
dk4ma_int16_t_add(int16_t a, int16_t b, dk4_er_t *erp)
{
- if ((DK4_I16_MAX < a) || (DK4_I16_MIN > a)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if ((DK4_I16_MAX < b) || (DK4_I16_MIN > b)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((0 < a) && (0 < b)) {
if ((DK4_I16_MAX - a) < b) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
@@ -165,7 +192,6 @@ dk4ma_int16_t_add(int16_t a, int16_t b, dk4_er_t *erp)
}
}
}
-finished:
return (a + b);
}
@@ -174,14 +200,6 @@ finished:
int16_t
dk4ma_int16_t_sub(int16_t a, int16_t b, dk4_er_t *erp)
{
- if ((DK4_I16_MAX < a) || (DK4_I16_MIN > a)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if ((DK4_I16_MAX < b) || (DK4_I16_MIN > b)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((0 < a) && (0 > b)) {
if ((DK4_I16_MAX + b) < a) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
@@ -193,7 +211,6 @@ dk4ma_int16_t_sub(int16_t a, int16_t b, dk4_er_t *erp)
}
}
}
-finished:
return (a - b);
}
@@ -202,14 +219,6 @@ finished:
int16_t
dk4ma_int16_t_mul(int16_t a, int16_t b, dk4_er_t *erp)
{
- if ((DK4_I16_MAX < a) || (DK4_I16_MIN > a)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if ((DK4_I16_MAX < b) || (DK4_I16_MIN > b)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((0 != a) && (0 != b)) {
if (DK4_I16_MIN == b) {
if (1 != a) {
@@ -245,7 +254,6 @@ dk4ma_int16_t_mul(int16_t a, int16_t b, dk4_er_t *erp)
}
}
}
-finished:
return (a * b);
}
@@ -255,15 +263,7 @@ int16_t
dk4ma_int16_t_div(int16_t a, int16_t b, dk4_er_t *erp)
{
int16_t back = 0;
- if ((DK4_I16_MAX < a) || (DK4_I16_MIN > a)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if ((DK4_I16_MAX < b) || (DK4_I16_MIN > b)) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
-finished:
+
if (0 != b) {
if ((DK4_I16_MIN == a) && (-1 == b)) {
back = DK4_I16_MAX;
@@ -290,10 +290,47 @@ int16_t
dk4ma_int16_t_abs(int16_t a, dk4_er_t *erp)
{
if (DK4_I16_MIN != a) {
- return (0 - a);
+ if ((int16_t)0 > a) {
+ return ((int16_t)0 - a);
+ } else {
+ return a;
+ }
} else {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
return (DK4_I16_MAX);
}
}
+
+
+int16_t
+dk4ma_int16_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(DK4_I16_MAX) < i) || ((dk4_im_t)(DK4_I16_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((int16_t)i);
+}
+
+
+
+int16_t
+dk4ma_int16_from_double(double d, dk4_er_t *erp)
+{
+ int16_t back = 0;
+ if ((double)(DK4_I16_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = DK4_I16_MIN;
+ }
+ else {
+ if ((double)(DK4_I16_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = DK4_I16_MAX;
+ }
+ else {
+ back = (int16_t)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maai16.h b/support/dktools/dk4maai16.h
index 34da557eee..7bc3e1fee7 100644
--- a/support/dktools/dk4maai16.h
+++ b/support/dktools/dk4maai16.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maai16.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maai16.ctr
*/
#ifndef DK4MAAI16_H_INCLUDED
@@ -41,19 +19,25 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4maai16.ctr"
/** @file dk4maai16.h Operations on int16_t data.
+
+ CRT on Windows: Optional.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
#endif
-
-#ifndef DK4TYPES_H_INCLUDED
-#include "dk4types.h"
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -77,6 +61,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#ifndef INT16_MAX
+#define INT16_MAX ((int16_t)32767)
+#endif
+
+#ifndef INT16_MIN
+#define INT16_MIN (((int16_t)(-32767)) - ((int16_t)1))
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -157,6 +149,26 @@ dk4ma_int16_t_div(int16_t a, int16_t b, dk4_er_t *erp);
int16_t
dk4ma_int16_t_abs(int16_t a, dk4_er_t *erp);
+/** Convert dk4_im_t value to int16_t.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+int16_t
+dk4ma_int16_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to int16_t.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+int16_t
+dk4ma_int16_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maai32.c b/support/dktools/dk4maai32.c
index 244829534a..14543f601d 100644
--- a/support/dktools/dk4maai32.c
+++ b/support/dktools/dk4maai32.c
@@ -1,51 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maai32.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maai32.ctr
*/
/** @file dk4maai32.c The dk4maai32 module.
*/
-#line 133 "dk4maai32.ctr"
+#line 194 "dk4maai32.ctr"
+#include "dk4conf.h"
#include "dk4maai32.h"
-#line 139 "dk4maai32.ctr"
+#line 201 "dk4maai32.ctr"
@@ -200,10 +179,113 @@ int32_t
dk4ma_int32_t_abs(int32_t a, dk4_er_t *erp)
{
if (DK4_I32_MIN != a) {
- return (0L - a);
+ if ((int32_t)0L > a) {
+ return ((int32_t)0L - a);
+ } else {
+ return a;
+ }
} else {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
return (DK4_I32_MAX);
}
}
+
+
+int32_t
+dk4ma_int32_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(DK4_I32_MAX) < i) || ((dk4_im_t)(DK4_I32_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((int32_t)i);
+}
+
+
+
+int32_t
+dk4ma_int32_from_double(double d, dk4_er_t *erp)
+{
+ int32_t back = 0;
+ if ((double)(DK4_I32_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = DK4_I32_MIN;
+ }
+ else {
+ if ((double)(DK4_I32_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = DK4_I32_MAX;
+ }
+ else {
+ back = (int32_t)d;
+ }
+ }
+ return back;
+}
+
+
+uint32_t
+dk4ma_int32_difference(int32_t a, int32_t b)
+{
+ uint32_t back;
+
+
+#line 405 "dk4maai32.ctr"
+ if ((int32_t)0L < a) {
+ if ((int32_t)0L < b) {
+ if (a >= b) {
+ back = (uint32_t)(a - b);
+ }
+ else {
+ back = (uint32_t)(b - a);
+ }
+ }
+ else {
+ if (DK4_I32_MIN == b) {
+ back = (uint32_t)a + (uint32_t)(DK4_I32_MAX)
+ + (uint32_t)1UL;
+ }
+ else {
+ back = (uint32_t)a
+ + (uint32_t)dk4ma_int32_t_abs(b, NULL);
+ }
+ }
+ }
+ else {
+ if ((int32_t)0L < b) {
+ if (DK4_I32_MIN == a) {
+ back = (uint32_t)b + (uint32_t)(DK4_I32_MAX)
+ + (uint32_t)1UL;
+ }
+ else {
+ back = (uint32_t)b
+ + (uint32_t)dk4ma_int32_t_abs(a, NULL);
+ }
+ }
+ else {
+ if (a >= b) {
+ back = (uint32_t)(a - b);
+ }
+ else {
+ back = (uint32_t)(b - a);
+ }
+ }
+ }
+
+
+#line 446 "dk4maai32.ctr"
+ return back;
+}
+
+
+
+int32_t
+dk4ma_int32_t_sq(int32_t a, dk4_er_t *erp)
+{
+ return (dk4ma_int32_t_mul(a, a, erp));
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4maai32.ctr b/support/dktools/dk4maai32.ctr
index d03cd997bd..8385dc0e62 100644
--- a/support/dktools/dk4maai32.ctr
+++ b/support/dktools/dk4maai32.ctr
@@ -2,25 +2,39 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
/** @file dk4maai32.h Operations on int32_t data.
+
+ CRT on Windows: Optional.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -44,6 +58,15 @@ license = bsd
#endif
#endif
+#ifndef INT32_MAX
+#define INT32_MAX ((int32_t)2147483647L)
+#endif
+
+#ifndef INT32_MIN
+#define INT32_MIN (((int32_t)(-2147483647L)) - ((int32_t)1L))
+#endif
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -93,6 +116,14 @@ dk4ma_int32_t_sub(int32_t a, int32_t b, dk4_er_t *erp);
int32_t
dk4ma_int32_t_mul(int32_t a, int32_t b, dk4_er_t *erp);
+/** Calculate square value of an int.
+ @param a Value to calculate square for.
+ @param erp Error report, may be NULL.
+ @return Square value.
+*/
+int32_t
+dk4ma_int32_t_sq(int32_t a, dk4_er_t *erp);
+
/** Division of int32_t.
@param a Left operand.
@param b Right operand.
@@ -124,6 +155,36 @@ dk4ma_int32_t_div(int32_t a, int32_t b, dk4_er_t *erp);
int32_t
dk4ma_int32_t_abs(int32_t a, dk4_er_t *erp);
+
+/** Convert dk4_im_t value to int32_t.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+int32_t
+dk4ma_int32_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to int32_t.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+int32_t
+dk4ma_int32_from_double(double d, dk4_er_t *erp);
+
+/** Find difference of 2 signed integers, return difference
+ as unsigned integer.
+ @param a One parameter.
+ @param b Other parameter.
+ @return Absolute value of the difference.
+*/
+uint32_t
+dk4ma_int32_difference(int32_t a, int32_t b);
+
#ifdef __cplusplus
}
#endif
@@ -131,6 +192,7 @@ dk4ma_int32_t_abs(int32_t a, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4maai32.h"
@@ -290,10 +352,109 @@ int32_t
dk4ma_int32_t_abs(int32_t a, dk4_er_t *erp)
{
if (DK4_I32_MIN != a) {
- return (0L - a);
+ if ((int32_t)0L > a) {
+ return ((int32_t)0L - a);
+ } else {
+ return a;
+ }
} else {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
return (DK4_I32_MAX);
}
}
+
+
+int32_t
+dk4ma_int32_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(DK4_I32_MAX) < i) || ((dk4_im_t)(DK4_I32_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((int32_t)i);
+}
+
+
+
+int32_t
+dk4ma_int32_from_double(double d, dk4_er_t *erp)
+{
+ int32_t back = 0;
+ if ((double)(DK4_I32_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = DK4_I32_MIN;
+ }
+ else {
+ if ((double)(DK4_I32_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = DK4_I32_MAX;
+ }
+ else {
+ back = (int32_t)d;
+ }
+ }
+ return back;
+}
+
+
+uint32_t
+dk4ma_int32_difference(int32_t a, int32_t b)
+{
+ uint32_t back;
+ $? "+ dk4ma_int32_difference %ld %ld", (long)a, (long)b
+ if ((int32_t)0L < a) {
+ if ((int32_t)0L < b) {
+ if (a >= b) {
+ back = (uint32_t)(a - b);
+ }
+ else {
+ back = (uint32_t)(b - a);
+ }
+ }
+ else {
+ if (DK4_I32_MIN == b) {
+ back = (uint32_t)a + (uint32_t)(DK4_I32_MAX)
+ + (uint32_t)1UL;
+ }
+ else {
+ back = (uint32_t)a
+ + (uint32_t)dk4ma_int32_t_abs(b, NULL);
+ }
+ }
+ }
+ else {
+ if ((int32_t)0L < b) {
+ if (DK4_I32_MIN == a) {
+ back = (uint32_t)b + (uint32_t)(DK4_I32_MAX)
+ + (uint32_t)1UL;
+ }
+ else {
+ back = (uint32_t)b
+ + (uint32_t)dk4ma_int32_t_abs(a, NULL);
+ }
+ }
+ else {
+ if (a >= b) {
+ back = (uint32_t)(a - b);
+ }
+ else {
+ back = (uint32_t)(b - a);
+ }
+ }
+ }
+ $? "- dk4ma_int32_difference %lu", (unsigned long)back
+ return back;
+}
+
+
+
+int32_t
+dk4ma_int32_t_sq(int32_t a, dk4_er_t *erp)
+{
+ return (dk4ma_int32_t_mul(a, a, erp));
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4maai32.h b/support/dktools/dk4maai32.h
index 98ff723f54..d9bdf7035a 100644
--- a/support/dktools/dk4maai32.h
+++ b/support/dktools/dk4maai32.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maai32.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maai32.ctr
*/
#ifndef DK4MAAI32_H_INCLUDED
@@ -41,19 +19,33 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4maai32.ctr"
/** @file dk4maai32.h Operations on int32_t data.
+
+ CRT on Windows: Optional.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -77,6 +69,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#ifndef INT32_MAX
+#define INT32_MAX ((int32_t)2147483647L)
+#endif
+
+#ifndef INT32_MIN
+#define INT32_MIN (((int32_t)(-2147483647L)) - ((int32_t)1L))
+#endif
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -126,6 +127,14 @@ dk4ma_int32_t_sub(int32_t a, int32_t b, dk4_er_t *erp);
int32_t
dk4ma_int32_t_mul(int32_t a, int32_t b, dk4_er_t *erp);
+/** Calculate square value of an int.
+ @param a Value to calculate square for.
+ @param erp Error report, may be NULL.
+ @return Square value.
+*/
+int32_t
+dk4ma_int32_t_sq(int32_t a, dk4_er_t *erp);
+
/** Division of int32_t.
@param a Left operand.
@param b Right operand.
@@ -157,6 +166,36 @@ dk4ma_int32_t_div(int32_t a, int32_t b, dk4_er_t *erp);
int32_t
dk4ma_int32_t_abs(int32_t a, dk4_er_t *erp);
+
+/** Convert dk4_im_t value to int32_t.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+int32_t
+dk4ma_int32_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to int32_t.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+int32_t
+dk4ma_int32_from_double(double d, dk4_er_t *erp);
+
+/** Find difference of 2 signed integers, return difference
+ as unsigned integer.
+ @param a One parameter.
+ @param b Other parameter.
+ @return Absolute value of the difference.
+*/
+uint32_t
+dk4ma_int32_difference(int32_t a, int32_t b);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maal.c b/support/dktools/dk4maal.c
index 58eba88c6b..455f928540 100644
--- a/support/dktools/dk4maal.c
+++ b/support/dktools/dk4maal.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maal.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maal.ctr
*/
/** @file dk4maal.c The dk4maal module.
*/
-#line 100 "dk4maal.ctr"
+#line 132 "dk4maal.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -168,3 +146,34 @@ dk4ma_long_div(long a, long b, dk4_er_t *erp)
}
+
+long
+dk4ma_long_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(LONG_MAX) < i) || ((dk4_im_t)(LONG_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((long)i);
+}
+
+
+
+long
+dk4ma_long_from_double(double d, dk4_er_t *erp)
+{
+ long back = 0L;
+ if ((double)(LONG_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = LONG_MIN;
+ }
+ else {
+ if ((double)(LONG_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = LONG_MAX;
+ }
+ else {
+ back = (long)d;
+ }
+ }
+ return back;
+}
diff --git a/support/dktools/dk4maal.ctr b/support/dktools/dk4maal.ctr
index 601524b322..28f2e0b44e 100644
--- a/support/dktools/dk4maal.ctr
+++ b/support/dktools/dk4maal.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -91,6 +103,26 @@ dk4ma_long_mul(long a, long b, dk4_er_t *erp);
long
dk4ma_long_div(long a, long b, dk4_er_t *erp);
+/** Convert dk4_im_t value to long.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+long
+dk4ma_long_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to long.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+long
+dk4ma_long_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -227,3 +259,34 @@ dk4ma_long_div(long a, long b, dk4_er_t *erp)
}
+
+long
+dk4ma_long_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(LONG_MAX) < i) || ((dk4_im_t)(LONG_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((long)i);
+}
+
+
+
+long
+dk4ma_long_from_double(double d, dk4_er_t *erp)
+{
+ long back = 0L;
+ if ((double)(LONG_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = LONG_MIN;
+ }
+ else {
+ if ((double)(LONG_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = LONG_MAX;
+ }
+ else {
+ back = (long)d;
+ }
+ }
+ return back;
+}
diff --git a/support/dktools/dk4maal.h b/support/dktools/dk4maal.h
index 9ad122aef6..a1fd2904e8 100644
--- a/support/dktools/dk4maal.h
+++ b/support/dktools/dk4maal.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maal.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maal.ctr
*/
#ifndef DK4MAAL_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -124,6 +114,26 @@ dk4ma_long_mul(long a, long b, dk4_er_t *erp);
long
dk4ma_long_div(long a, long b, dk4_er_t *erp);
+/** Convert dk4_im_t value to long.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+long
+dk4ma_long_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to long.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+long
+dk4ma_long_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maall.c b/support/dktools/dk4maall.c
index 0aa0625610..a09796cb34 100644
--- a/support/dktools/dk4maall.c
+++ b/support/dktools/dk4maall.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maall.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maall.ctr
*/
/** @file dk4maall.c The dk4maall module.
*/
-#line 104 "dk4maall.ctr"
+#line 136 "dk4maall.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -169,5 +147,39 @@ dk4ma_ll_div(long long a, long long b, dk4_er_t *erp)
}
+
+long long
+dk4ma_ll_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(LLONG_MAX) < i) || ((dk4_im_t)(LLONG_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((long long)i);
+}
+
+
+
+long long
+dk4ma_ll_from_double(double d, dk4_er_t *erp)
+{
+ long long back = 0LL;
+ if ((double)(LLONG_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = LLONG_MIN;
+ }
+ else {
+ if ((double)(LLONG_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = LLONG_MAX;
+ }
+ else {
+ back = (long long)d;
+ }
+ }
+ return back;
+}
+
+
+
#endif
diff --git a/support/dktools/dk4maall.ctr b/support/dktools/dk4maall.ctr
index 35694bb4de..24fb4d1b97 100644
--- a/support/dktools/dk4maall.ctr
+++ b/support/dktools/dk4maall.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -93,6 +105,26 @@ dk4ma_ll_mul(long long a, long long b, dk4_er_t *erp);
long long
dk4ma_ll_div(long long a, long long b, dk4_er_t *erp);
+/** Convert dk4_im_t value to long long.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+long long
+dk4ma_ll_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+long long
+dk4ma_ll_from_double(double d, dk4_er_t *erp);
+
#endif
#ifdef __cplusplus
@@ -232,5 +264,39 @@ dk4ma_ll_div(long long a, long long b, dk4_er_t *erp)
}
+
+long long
+dk4ma_ll_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(LLONG_MAX) < i) || ((dk4_im_t)(LLONG_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((long long)i);
+}
+
+
+
+long long
+dk4ma_ll_from_double(double d, dk4_er_t *erp)
+{
+ long long back = 0LL;
+ if ((double)(LLONG_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = LLONG_MIN;
+ }
+ else {
+ if ((double)(LLONG_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = LLONG_MAX;
+ }
+ else {
+ back = (long long)d;
+ }
+ }
+ return back;
+}
+
+
+
#endif
diff --git a/support/dktools/dk4maall.h b/support/dktools/dk4maall.h
index d00e019284..335cfbd5e2 100644
--- a/support/dktools/dk4maall.h
+++ b/support/dktools/dk4maall.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maall.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maall.ctr
*/
#ifndef DK4MAALL_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -126,6 +116,26 @@ dk4ma_ll_mul(long long a, long long b, dk4_er_t *erp);
long long
dk4ma_ll_div(long long a, long long b, dk4_er_t *erp);
+/** Convert dk4_im_t value to long long.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+long long
+dk4ma_ll_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+long long
+dk4ma_ll_from_double(double d, dk4_er_t *erp);
+
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maalu.c b/support/dktools/dk4maalu.c
index 67348ec9ce..00c343e529 100644
--- a/support/dktools/dk4maalu.c
+++ b/support/dktools/dk4maalu.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maalu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maalu.ctr
*/
/** @file dk4maalu.c The dk4maalu module.
*/
-#line 94 "dk4maalu.ctr"
+#line 126 "dk4maalu.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -49,7 +27,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 104 "dk4maalu.ctr"
+#line 136 "dk4maalu.ctr"
@@ -95,20 +73,54 @@ dk4ma_ull_div(unsigned long long a, unsigned long long b, dk4_er_t *erp)
{
-#line 148 "dk4maalu.ctr"
+#line 180 "dk4maalu.ctr"
if (0ULL < b) {
-#line 150 "dk4maalu.ctr"
+#line 182 "dk4maalu.ctr"
return (unsigned long long)(a / b);
} else {
dk4error_set_simple_error_code(erp, DK4_E_MATH_DIVZERO);
-#line 154 "dk4maalu.ctr"
+#line 186 "dk4maalu.ctr"
return (unsigned long long)(ULLONG_MAX);
}
}
+
+
+unsigned long long
+dk4ma_ull_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(ULLONG_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned long long)u);
+}
+
+
+
+unsigned long long
+dk4ma_ull_from_double(double d, dk4_er_t *erp)
+{
+ unsigned long long back = 0ULL;
+ if ((double)(ULLONG_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = ULLONG_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned long long)d;
+ }
+ }
+ return back;
+}
+
+
+
#endif
diff --git a/support/dktools/dk4maalu.ctr b/support/dktools/dk4maalu.ctr
index 073bf6a19d..488ac0f5f9 100644
--- a/support/dktools/dk4maalu.ctr
+++ b/support/dktools/dk4maalu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -83,6 +95,26 @@ dk4ma_ull_mul(unsigned long long a, unsigned long long b, dk4_er_t *erp);
unsigned long long
dk4ma_ull_div(unsigned long long a, unsigned long long b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned long long.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned long long
+dk4ma_ull_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to unsigned long long.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned long long
+dk4ma_ull_from_double(double d, dk4_er_t *erp);
+
#endif
#ifdef __cplusplus
@@ -155,5 +187,39 @@ dk4ma_ull_div(unsigned long long a, unsigned long long b, dk4_er_t *erp)
}
}
+
+
+unsigned long long
+dk4ma_ull_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(ULLONG_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned long long)u);
+}
+
+
+
+unsigned long long
+dk4ma_ull_from_double(double d, dk4_er_t *erp)
+{
+ unsigned long long back = 0ULL;
+ if ((double)(ULLONG_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = ULLONG_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned long long)d;
+ }
+ }
+ return back;
+}
+
+
+
#endif
diff --git a/support/dktools/dk4maalu.h b/support/dktools/dk4maalu.h
index 9070a0a28b..09016c5cba 100644
--- a/support/dktools/dk4maalu.h
+++ b/support/dktools/dk4maalu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maalu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maalu.ctr
*/
#ifndef DK4MAALU_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -115,6 +105,26 @@ dk4ma_ull_mul(unsigned long long a, unsigned long long b, dk4_er_t *erp);
unsigned long long
dk4ma_ull_div(unsigned long long a, unsigned long long b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned long long.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned long long
+dk4ma_ull_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to unsigned long long.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned long long
+dk4ma_ull_from_double(double d, dk4_er_t *erp);
+
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maami.c b/support/dktools/dk4maami.c
index f409005a71..6039a26a3c 100644
--- a/support/dktools/dk4maami.c
+++ b/support/dktools/dk4maami.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maami.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maami.ctr
*/
/** @file dk4maami.c The dk4maami module.
*/
-#line 104 "dk4maami.ctr"
+#line 116 "dk4maami.ctr"
#include "dk4conf.h"
#include "dk4types.h"
diff --git a/support/dktools/dk4maami.ctr b/support/dktools/dk4maami.ctr
index b3bd550267..90412ef5e8 100644
--- a/support/dktools/dk4maami.ctr
+++ b/support/dktools/dk4maami.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maami.h b/support/dktools/dk4maami.h
index 54f357f7fb..f7c2778c95 100644
--- a/support/dktools/dk4maami.h
+++ b/support/dktools/dk4maami.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maami.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maami.ctr
*/
#ifndef DK4MAAMI_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maamu.c b/support/dktools/dk4maamu.c
index 4a5914fc59..d91f1e60ce 100644
--- a/support/dktools/dk4maamu.c
+++ b/support/dktools/dk4maamu.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maamu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maamu.ctr
*/
/** @file dk4maamu.c The dk4maamu module.
*/
-#line 94 "dk4maamu.ctr"
+#line 106 "dk4maamu.ctr"
#include "dk4conf.h"
#include "dk4types.h"
diff --git a/support/dktools/dk4maamu.ctr b/support/dktools/dk4maamu.ctr
index 92621a52e6..e0212815c9 100644
--- a/support/dktools/dk4maamu.ctr
+++ b/support/dktools/dk4maamu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maamu.h b/support/dktools/dk4maamu.h
index a80361322c..03080ed6bd 100644
--- a/support/dktools/dk4maamu.h
+++ b/support/dktools/dk4maamu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maamu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maamu.ctr
*/
#ifndef DK4MAAMU_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maas.c b/support/dktools/dk4maas.c
index 168469024e..8af172b60e 100644
--- a/support/dktools/dk4maas.c
+++ b/support/dktools/dk4maas.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maas.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maas.ctr
*/
/** @file dk4maas.c The dk4maas module.
*/
-#line 100 "dk4maas.ctr"
+#line 132 "dk4maas.ctr"
#include "dk4conf.h"
@@ -54,7 +32,11 @@ dk4ma_short_abs(short a, dk4_er_t *erp)
if (SHRT_MIN == a) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
- return (short)((0 <= a) ? a : ((SHRT_MIN == a) ? SHRT_MAX : (0 - a)));
+ return (
+ ((short)0 <= a)
+ ? (a)
+ : ((SHRT_MIN == a) ? (SHRT_MAX) : ((short)0 - a))
+ );
}
@@ -168,3 +150,36 @@ dk4ma_short_div(short a, short b, dk4_er_t *erp)
return back;
}
+
+
+short
+dk4ma_short_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(SHRT_MAX) < i) || ((dk4_im_t)(SHRT_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((short)i);
+}
+
+
+
+short
+dk4ma_short_from_double(double d, dk4_er_t *erp)
+{
+ short back = 0;
+ if ((double)(SHRT_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = SHRT_MIN;
+ }
+ else {
+ if ((double)(SHRT_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = SHRT_MAX;
+ }
+ else {
+ back = (short)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maas.ctr b/support/dktools/dk4maas.ctr
index 140c720fde..824db51fb8 100644
--- a/support/dktools/dk4maas.ctr
+++ b/support/dktools/dk4maas.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -92,6 +104,26 @@ dk4ma_short_mul(short a, short b, dk4_er_t *erp);
short
dk4ma_short_div(short a, short b, dk4_er_t *erp);
+/** Convert dk4_im_t value to short.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+short
+dk4ma_short_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to short.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+short
+dk4ma_short_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -113,7 +145,11 @@ dk4ma_short_abs(short a, dk4_er_t *erp)
if (SHRT_MIN == a) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
- return (short)((0 <= a) ? a : ((SHRT_MIN == a) ? SHRT_MAX : (0 - a)));
+ return (
+ ((short)0 <= a)
+ ? (a)
+ : ((SHRT_MIN == a) ? (SHRT_MAX) : ((short)0 - a))
+ );
}
@@ -227,3 +263,36 @@ dk4ma_short_div(short a, short b, dk4_er_t *erp)
return back;
}
+
+
+short
+dk4ma_short_from(dk4_im_t i, dk4_er_t *erp)
+{
+ if (((dk4_im_t)(SHRT_MAX) < i) || ((dk4_im_t)(SHRT_MIN) > i)) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((short)i);
+}
+
+
+
+short
+dk4ma_short_from_double(double d, dk4_er_t *erp)
+{
+ short back = 0;
+ if ((double)(SHRT_MIN) > d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = SHRT_MIN;
+ }
+ else {
+ if ((double)(SHRT_MAX) < d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ back = SHRT_MAX;
+ }
+ else {
+ back = (short)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maas.h b/support/dktools/dk4maas.h
index 11810e5010..1a5f844f37 100644
--- a/support/dktools/dk4maas.h
+++ b/support/dktools/dk4maas.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maas.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maas.ctr
*/
#ifndef DK4MAAS_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -124,6 +114,26 @@ dk4ma_short_mul(short a, short b, dk4_er_t *erp);
short
dk4ma_short_div(short a, short b, dk4_er_t *erp);
+/** Convert dk4_im_t value to short.
+ @param i Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+short
+dk4ma_short_from(dk4_im_t i, dk4_er_t *erp);
+
+/** Convert double to short.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+short
+dk4ma_short_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maasz.c b/support/dktools/dk4maasz.c
index 6b8cbbbe98..a6c185190a 100644
--- a/support/dktools/dk4maasz.c
+++ b/support/dktools/dk4maasz.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maasz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maasz.ctr
*/
/** @file dk4maasz.c The dk4maasz module.
*/
-#line 66 "dk4maasz.ctr"
+#line 98 "dk4maasz.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -101,3 +79,37 @@ dk4ma_size_t_mul(size_t a, size_t b, dk4_er_t *erp)
return (a * b);
}
+
+
+size_t
+dk4ma_size_t_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(SIZE_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((size_t)u);
+}
+
+
+
+size_t
+dk4ma_size_t_from_double(double d, dk4_er_t *erp)
+{
+ size_t back = 0;
+
+ if ((double)(SIZE_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = SIZE_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (size_t)d;
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4maasz.ctr b/support/dktools/dk4maasz.ctr
index b96dd28159..52c4a5e60c 100644
--- a/support/dktools/dk4maasz.ctr
+++ b/support/dktools/dk4maasz.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -58,6 +70,26 @@ dk4ma_size_t_sub(size_t a, size_t b, dk4_er_t *erp);
size_t
dk4ma_size_t_mul(size_t a, size_t b, dk4_er_t *erp);
+/** Convert dk4_um_t value to size_t.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+size_t
+dk4ma_size_t_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+size_t
+dk4ma_size_t_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -126,3 +158,37 @@ dk4ma_size_t_mul(size_t a, size_t b, dk4_er_t *erp)
return (a * b);
}
+
+
+size_t
+dk4ma_size_t_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(SIZE_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((size_t)u);
+}
+
+
+
+size_t
+dk4ma_size_t_from_double(double d, dk4_er_t *erp)
+{
+ size_t back = 0;
+
+ if ((double)(SIZE_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = SIZE_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (size_t)d;
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4maasz.h b/support/dktools/dk4maasz.h
index db4808a827..7ec01a2b49 100644
--- a/support/dktools/dk4maasz.h
+++ b/support/dktools/dk4maasz.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maasz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maasz.ctr
*/
#ifndef DK4MAASZ_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -91,6 +81,26 @@ dk4ma_size_t_sub(size_t a, size_t b, dk4_er_t *erp);
size_t
dk4ma_size_t_mul(size_t a, size_t b, dk4_er_t *erp);
+/** Convert dk4_um_t value to size_t.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+size_t
+dk4ma_size_t_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+size_t
+dk4ma_size_t_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maau16.c b/support/dktools/dk4maau16.c
index 04918050ff..33a91b0ba9 100644
--- a/support/dktools/dk4maau16.c
+++ b/support/dktools/dk4maau16.c
@@ -1,69 +1,39 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maau16.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maau16.ctr
*/
/** @file dk4maau16.c The dk4maau16 module.
*/
-#line 119 "dk4maau16.ctr"
+#line 157 "dk4maau16.ctr"
+#include "dk4conf.h"
#include "dk4maau16.h"
-#line 125 "dk4maau16.ctr"
+#line 164 "dk4maau16.ctr"
uint16_t
dk4ma_uint16_t_add(uint16_t a, uint16_t b, dk4_er_t *erp)
{
- if (DK4_U16_MAX < a) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if (DK4_U16_MAX < b) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((DK4_U16_MAX - a) < b) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
-finished:
return (a + b);
}
@@ -72,18 +42,9 @@ finished:
uint16_t
dk4ma_uint16_t_sub(uint16_t a, uint16_t b, dk4_er_t *erp)
{
- if (DK4_U16_MAX < a) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if (DK4_U16_MAX < b) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if (b > a) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
-finished:
return (a - b);
}
@@ -92,20 +53,11 @@ finished:
uint16_t
dk4ma_uint16_t_mul(uint16_t a, uint16_t b, dk4_er_t *erp)
{
- if (DK4_U16_MAX < a) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if (DK4_U16_MAX < b) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((0 < a) && (0 < b)) {
if ((DK4_U16_MAX / a) < b) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
}
-finished:
return (a * b);
}
@@ -115,15 +67,7 @@ uint16_t
dk4ma_uint16_t_div(uint16_t a, uint16_t b, dk4_er_t *erp)
{
uint16_t back = 0;
- if (DK4_U16_MAX < a) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if (DK4_U16_MAX < b) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
-finished:
+
if (0 != b) {
back = a / b;
} else {
@@ -134,3 +78,33 @@ finished:
+uint16_t
+dk4ma_uint16_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(DK4_U16_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((uint16_t)u);
+}
+
+
+
+uint16_t
+dk4ma_uint16_from_double(double d, dk4_er_t *erp)
+{
+ uint16_t back = 0;
+ if ((double)(DK4_U16_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = DK4_U16_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (uint16_t)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maau16.ctr b/support/dktools/dk4maau16.ctr
index cad11e5c79..28b32a7776 100644
--- a/support/dktools/dk4maau16.ctr
+++ b/support/dktools/dk4maau16.ctr
@@ -2,25 +2,39 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
/** @file dk4maau16.h Operations on uint16_t data.
+
+ CRT on Windows: Optional.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -44,6 +58,10 @@ license = bsd
#endif
#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX ((uint16_t)65535U)
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -110,6 +128,26 @@ dk4ma_uint16_t_mul(uint16_t a, uint16_t b, dk4_er_t *erp);
uint16_t
dk4ma_uint16_t_div(uint16_t a, uint16_t b, dk4_er_t *erp);
+/** Convert dk4_um_t value to uint16_t.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+uint16_t
+dk4ma_uint16_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+uint16_t
+dk4ma_uint16_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -117,6 +155,7 @@ dk4ma_uint16_t_div(uint16_t a, uint16_t b, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4maau16.h"
@@ -128,18 +167,9 @@ $!trace-include
uint16_t
dk4ma_uint16_t_add(uint16_t a, uint16_t b, dk4_er_t *erp)
{
- if (DK4_U16_MAX < a) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if (DK4_U16_MAX < b) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((DK4_U16_MAX - a) < b) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
-finished:
return (a + b);
}
@@ -148,18 +178,9 @@ finished:
uint16_t
dk4ma_uint16_t_sub(uint16_t a, uint16_t b, dk4_er_t *erp)
{
- if (DK4_U16_MAX < a) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if (DK4_U16_MAX < b) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if (b > a) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
-finished:
return (a - b);
}
@@ -168,20 +189,11 @@ finished:
uint16_t
dk4ma_uint16_t_mul(uint16_t a, uint16_t b, dk4_er_t *erp)
{
- if (DK4_U16_MAX < a) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if (DK4_U16_MAX < b) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
if ((0 < a) && (0 < b)) {
if ((DK4_U16_MAX / a) < b) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
}
-finished:
return (a * b);
}
@@ -191,15 +203,7 @@ uint16_t
dk4ma_uint16_t_div(uint16_t a, uint16_t b, dk4_er_t *erp)
{
uint16_t back = 0;
- if (DK4_U16_MAX < a) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
- if (DK4_U16_MAX < b) {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- goto finished;
- }
-finished:
+
if (0 != b) {
back = a / b;
} else {
@@ -210,3 +214,33 @@ finished:
+uint16_t
+dk4ma_uint16_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(DK4_U16_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((uint16_t)u);
+}
+
+
+
+uint16_t
+dk4ma_uint16_from_double(double d, dk4_er_t *erp)
+{
+ uint16_t back = 0;
+ if ((double)(DK4_U16_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = DK4_U16_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (uint16_t)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maau16.h b/support/dktools/dk4maau16.h
index 5607e6e7b3..8c7ea08149 100644
--- a/support/dktools/dk4maau16.h
+++ b/support/dktools/dk4maau16.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maau16.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maau16.ctr
*/
#ifndef DK4MAAU16_H_INCLUDED
@@ -41,19 +19,33 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4maau16.ctr"
/** @file dk4maau16.h Operations on uint16_t data.
+
+ CRT on Windows: Optional.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -77,6 +69,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX ((uint16_t)65535U)
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -143,6 +139,26 @@ dk4ma_uint16_t_mul(uint16_t a, uint16_t b, dk4_er_t *erp);
uint16_t
dk4ma_uint16_t_div(uint16_t a, uint16_t b, dk4_er_t *erp);
+/** Convert dk4_um_t value to uint16_t.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+uint16_t
+dk4ma_uint16_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+uint16_t
+dk4ma_uint16_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maau32.c b/support/dktools/dk4maau32.c
index ca19ae6a8c..d050afd1fc 100644
--- a/support/dktools/dk4maau32.c
+++ b/support/dktools/dk4maau32.c
@@ -1,51 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maau32.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maau32.ctr
*/
/** @file dk4maau32.c The dk4maau32 module.
*/
-#line 119 "dk4maau32.ctr"
+#line 157 "dk4maau32.ctr"
+#include "dk4conf.h"
#include "dk4maau32.h"
-#line 125 "dk4maau32.ctr"
+#line 164 "dk4maau32.ctr"
@@ -134,3 +113,34 @@ finished:
+uint32_t
+dk4ma_uint32_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(DK4_U32_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((uint32_t)u);
+}
+
+
+
+
+uint32_t
+dk4ma_uint32_from_double(double d, dk4_er_t *erp)
+{
+ uint32_t back = 0UL;
+ if ((double)(DK4_U32_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = DK4_U32_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (uint32_t)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maau32.ctr b/support/dktools/dk4maau32.ctr
index 6665abcb30..59d6e0d308 100644
--- a/support/dktools/dk4maau32.ctr
+++ b/support/dktools/dk4maau32.ctr
@@ -2,25 +2,39 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
/** @file dk4maau32.h Operations on uint32_t data.
+
+ CRT on Windows: Optional.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -44,6 +58,10 @@ license = bsd
#endif
#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX ((uint32_t)4294967295UL)
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -110,6 +128,26 @@ dk4ma_uint32_t_mul(uint32_t a, uint32_t b, dk4_er_t *erp);
uint32_t
dk4ma_uint32_t_div(uint32_t a, uint32_t b, dk4_er_t *erp);
+/** Convert dk4_um_t value to uint32_t.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+uint32_t
+dk4ma_uint32_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+uint32_t
+dk4ma_uint32_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -117,6 +155,7 @@ dk4ma_uint32_t_div(uint32_t a, uint32_t b, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4maau32.h"
@@ -210,3 +249,34 @@ finished:
+uint32_t
+dk4ma_uint32_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(DK4_U32_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((uint32_t)u);
+}
+
+
+
+
+uint32_t
+dk4ma_uint32_from_double(double d, dk4_er_t *erp)
+{
+ uint32_t back = 0UL;
+ if ((double)(DK4_U32_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = DK4_U32_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (uint32_t)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maau32.h b/support/dktools/dk4maau32.h
index 615a8afaa0..d8a09d5f9a 100644
--- a/support/dktools/dk4maau32.h
+++ b/support/dktools/dk4maau32.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maau32.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maau32.ctr
*/
#ifndef DK4MAAU32_H_INCLUDED
@@ -41,19 +19,33 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4maau32.ctr"
/** @file dk4maau32.h Operations on uint32_t data.
+
+ CRT on Windows: Optional.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -77,6 +69,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX ((uint32_t)4294967295UL)
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -143,6 +139,26 @@ dk4ma_uint32_t_mul(uint32_t a, uint32_t b, dk4_er_t *erp);
uint32_t
dk4ma_uint32_t_div(uint32_t a, uint32_t b, dk4_er_t *erp);
+/** Convert dk4_um_t value to uint32_t.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+uint32_t
+dk4ma_uint32_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+uint32_t
+dk4ma_uint32_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maauc.c b/support/dktools/dk4maauc.c
index b614ce6b69..a4c468806d 100644
--- a/support/dktools/dk4maauc.c
+++ b/support/dktools/dk4maauc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maauc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maauc.ctr
*/
/** @file dk4maauc.c The dk4maauc module.
*/
-#line 90 "dk4maauc.ctr"
+#line 122 "dk4maauc.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -92,3 +70,36 @@ dk4ma_uchar_div(unsigned char a, unsigned char b, dk4_er_t *erp)
}
}
+
+
+unsigned char
+dk4ma_uchar_from(dk4_um_t u, dk4_er_t *erp)
+{
+
+ if ((dk4_um_t)(UCHAR_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned char)u);
+}
+
+
+
+unsigned char
+dk4ma_uchar_from_double(double d, dk4_er_t *erp)
+{
+ unsigned char back = 0;
+ if ((double)(UCHAR_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = UCHAR_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned char)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maauc.ctr b/support/dktools/dk4maauc.ctr
index bb5a14421a..6425c8e32c 100644
--- a/support/dktools/dk4maauc.ctr
+++ b/support/dktools/dk4maauc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -76,11 +88,31 @@ dk4ma_uchar_mul(unsigned char a, unsigned char b, dk4_er_t *erp);
UCHAR_MAX on division by zero
(see the ec component of erp).
- Error codes: DK4_E_DIVZERO.
+ Error codes: DK4_E_MATH_DIVZERO.
*/
unsigned char
dk4ma_uchar_div(unsigned char a, unsigned char b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned char.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned char
+dk4ma_uchar_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned char
+dk4ma_uchar_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -141,3 +173,36 @@ dk4ma_uchar_div(unsigned char a, unsigned char b, dk4_er_t *erp)
}
}
+
+
+unsigned char
+dk4ma_uchar_from(dk4_um_t u, dk4_er_t *erp)
+{
+
+ if ((dk4_um_t)(UCHAR_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned char)u);
+}
+
+
+
+unsigned char
+dk4ma_uchar_from_double(double d, dk4_er_t *erp)
+{
+ unsigned char back = 0;
+ if ((double)(UCHAR_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = UCHAR_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned char)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maauc.h b/support/dktools/dk4maauc.h
index e971b8e067..afbfaafade 100644
--- a/support/dktools/dk4maauc.h
+++ b/support/dktools/dk4maauc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maauc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maauc.ctr
*/
#ifndef DK4MAAUC_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -108,11 +98,31 @@ dk4ma_uchar_mul(unsigned char a, unsigned char b, dk4_er_t *erp);
UCHAR_MAX on division by zero
(see the ec component of erp).
- Error codes: DK4_E_DIVZERO.
+ Error codes: DK4_E_MATH_DIVZERO.
*/
unsigned char
dk4ma_uchar_div(unsigned char a, unsigned char b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned char.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned char
+dk4ma_uchar_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned char
+dk4ma_uchar_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maaui.c b/support/dktools/dk4maaui.c
index ecb92816ee..4dd4cc1f88 100644
--- a/support/dktools/dk4maaui.c
+++ b/support/dktools/dk4maaui.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maaui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maaui.ctr
*/
/** @file dk4maaui.c The dk4maaui module.
*/
-#line 90 "dk4maaui.ctr"
+#line 123 "dk4maaui.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -92,3 +70,36 @@ dk4ma_uint_div(unsigned a, unsigned b, dk4_er_t *erp)
}
}
+
+
+unsigned
+dk4ma_uint_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(UINT_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned)u);
+}
+
+
+
+unsigned
+dk4ma_uint_from_double(double d, dk4_er_t *erp)
+{
+ unsigned back = 0U;
+ if ((double)(UINT_MAX) < d) {
+ back = UINT_MAX;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned)d;
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4maaui.ctr b/support/dktools/dk4maaui.ctr
index 35a57ce74b..c894815b68 100644
--- a/support/dktools/dk4maaui.ctr
+++ b/support/dktools/dk4maaui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -76,11 +88,32 @@ dk4ma_uint_mul(unsigned a, unsigned b, dk4_er_t *erp);
UINT_MAX on division by zero
(see the ec component of erp).
- Error codes: DK4_E_DIVZERO.
+ Error codes: DK4_E_MATH_DIVZERO.
*/
unsigned
dk4ma_uint_div(unsigned a, unsigned b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned
+dk4ma_uint_from(dk4_um_t u, dk4_er_t *erp);
+
+
+/** Convert double value to unsigned int.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned
+dk4ma_uint_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -141,3 +174,36 @@ dk4ma_uint_div(unsigned a, unsigned b, dk4_er_t *erp)
}
}
+
+
+unsigned
+dk4ma_uint_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(UINT_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned)u);
+}
+
+
+
+unsigned
+dk4ma_uint_from_double(double d, dk4_er_t *erp)
+{
+ unsigned back = 0U;
+ if ((double)(UINT_MAX) < d) {
+ back = UINT_MAX;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned)d;
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4maaui.h b/support/dktools/dk4maaui.h
index b691eaf29f..8448fe1384 100644
--- a/support/dktools/dk4maaui.h
+++ b/support/dktools/dk4maaui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maaui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maaui.ctr
*/
#ifndef DK4MAAUI_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -108,11 +98,32 @@ dk4ma_uint_mul(unsigned a, unsigned b, dk4_er_t *erp);
UINT_MAX on division by zero
(see the ec component of erp).
- Error codes: DK4_E_DIVZERO.
+ Error codes: DK4_E_MATH_DIVZERO.
*/
unsigned
dk4ma_uint_div(unsigned a, unsigned b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned
+dk4ma_uint_from(dk4_um_t u, dk4_er_t *erp);
+
+
+/** Convert double value to unsigned int.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned
+dk4ma_uint_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maaul.c b/support/dktools/dk4maaul.c
index c8e2145198..acd21ed0dc 100644
--- a/support/dktools/dk4maaul.c
+++ b/support/dktools/dk4maaul.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maaul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maaul.ctr
*/
/** @file dk4maaul.c The dk4maaul module.
*/
-#line 90 "dk4maaul.ctr"
+#line 122 "dk4maaul.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -49,7 +27,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 100 "dk4maaul.ctr"
+#line 132 "dk4maaul.ctr"
@@ -58,25 +36,25 @@ dk4ma_ulong_add(unsigned long a, unsigned long b, dk4_er_t *erp)
{
-#line 107 "dk4maaul.ctr"
+#line 139 "dk4maaul.ctr"
-#line 108 "dk4maaul.ctr"
+#line 140 "dk4maaul.ctr"
-#line 109 "dk4maaul.ctr"
+#line 141 "dk4maaul.ctr"
-#line 110 "dk4maaul.ctr"
+#line 142 "dk4maaul.ctr"
if ((ULONG_MAX - a) < b) {
-#line 111 "dk4maaul.ctr"
+#line 143 "dk4maaul.ctr"
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
-#line 114 "dk4maaul.ctr"
- return (unsigned long)(a + b);
+#line 146 "dk4maaul.ctr"
+ return (a + b);
}
@@ -87,7 +65,7 @@ dk4ma_ulong_sub(unsigned long a, unsigned long b, dk4_er_t *erp)
if (b > a) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
- return (unsigned long)(a - b);
+ return (a - b);
}
@@ -100,7 +78,7 @@ dk4ma_ulong_mul(unsigned long a, unsigned long b, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
}
- return (unsigned long)(a * b);
+ return (a * b);
}
@@ -109,10 +87,43 @@ unsigned long
dk4ma_ulong_div(unsigned long a, unsigned long b, dk4_er_t *erp)
{
if (0UL < b) {
- return (unsigned long)(a / b);
+ return (a / b);
} else {
dk4error_set_simple_error_code(erp, DK4_E_MATH_DIVZERO);
return (unsigned long)(ULONG_MAX);
}
}
+
+
+unsigned long
+dk4ma_ulong_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(ULONG_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned long)u);
+}
+
+
+
+unsigned long
+dk4ma_ulong_from_double(double d, dk4_er_t *erp)
+{
+ unsigned long back = 0UL;
+ if ((double)(ULONG_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = ULONG_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned long)d;
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4maaul.ctr b/support/dktools/dk4maaul.ctr
index 487c354a29..dd44c54228 100644
--- a/support/dktools/dk4maaul.ctr
+++ b/support/dktools/dk4maaul.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -76,11 +88,31 @@ dk4ma_ulong_mul(unsigned long a, unsigned long b, dk4_er_t *erp);
ULONG_MAX on division by zero
(see the ec component of erp).
- Error codes: DK4_E_DIVZERO.
+ Error codes: DK4_E_MATH_DIVZERO.
*/
unsigned long
dk4ma_ulong_div(unsigned long a, unsigned long b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned long.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned long
+dk4ma_ulong_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned long
+dk4ma_ulong_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -111,7 +143,7 @@ dk4ma_ulong_add(unsigned long a, unsigned long b, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
$? "- dk4ma_ulong_add %lu", (a+b)
- return (unsigned long)(a + b);
+ return (a + b);
}
@@ -122,7 +154,7 @@ dk4ma_ulong_sub(unsigned long a, unsigned long b, dk4_er_t *erp)
if (b > a) {
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
- return (unsigned long)(a - b);
+ return (a - b);
}
@@ -135,7 +167,7 @@ dk4ma_ulong_mul(unsigned long a, unsigned long b, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
}
- return (unsigned long)(a * b);
+ return (a * b);
}
@@ -144,10 +176,43 @@ unsigned long
dk4ma_ulong_div(unsigned long a, unsigned long b, dk4_er_t *erp)
{
if (0UL < b) {
- return (unsigned long)(a / b);
+ return (a / b);
} else {
dk4error_set_simple_error_code(erp, DK4_E_MATH_DIVZERO);
return (unsigned long)(ULONG_MAX);
}
}
+
+
+unsigned long
+dk4ma_ulong_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(ULONG_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned long)u);
+}
+
+
+
+unsigned long
+dk4ma_ulong_from_double(double d, dk4_er_t *erp)
+{
+ unsigned long back = 0UL;
+ if ((double)(ULONG_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = ULONG_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned long)d;
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4maaul.h b/support/dktools/dk4maaul.h
index f830845422..6034d78aba 100644
--- a/support/dktools/dk4maaul.h
+++ b/support/dktools/dk4maaul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maaul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maaul.ctr
*/
#ifndef DK4MAAUL_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -108,11 +98,31 @@ dk4ma_ulong_mul(unsigned long a, unsigned long b, dk4_er_t *erp);
ULONG_MAX on division by zero
(see the ec component of erp).
- Error codes: DK4_E_DIVZERO.
+ Error codes: DK4_E_MATH_DIVZERO.
*/
unsigned long
dk4ma_ulong_div(unsigned long a, unsigned long b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned long.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned long
+dk4ma_ulong_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned long
+dk4ma_ulong_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maaus.c b/support/dktools/dk4maaus.c
index 604714485c..a73e6c8af9 100644
--- a/support/dktools/dk4maaus.c
+++ b/support/dktools/dk4maaus.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maaus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maaus.ctr
*/
/** @file dk4maaus.c The dk4maaus module.
*/
-#line 90 "dk4maaus.ctr"
+#line 122 "dk4maaus.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -92,3 +70,35 @@ dk4ma_ushort_div(unsigned short a, unsigned short b, dk4_er_t *erp)
}
}
+
+
+unsigned short
+dk4ma_ushort_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(USHRT_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned short)u);
+}
+
+
+
+unsigned short
+dk4ma_ushort_from_double(double d, dk4_er_t *erp)
+{
+ unsigned short back = 0;
+ if ((double)(USHRT_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = USHRT_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned short)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maaus.ctr b/support/dktools/dk4maaus.ctr
index e991c99471..697984f0b8 100644
--- a/support/dktools/dk4maaus.ctr
+++ b/support/dktools/dk4maaus.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -76,11 +88,31 @@ dk4ma_ushort_mul(unsigned short a, unsigned short b, dk4_er_t *erp);
USHRT_MAX on division by zero
(see the ec component of erp).
- Error codes: DK4_E_DIVZERO.
+ Error codes: DK4_E_MATH_DIVZERO.
*/
unsigned short
dk4ma_ushort_div(unsigned short a, unsigned short b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned short.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned short
+dk4ma_ushort_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned short
+dk4ma_ushort_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
@@ -141,3 +173,35 @@ dk4ma_ushort_div(unsigned short a, unsigned short b, dk4_er_t *erp)
}
}
+
+
+unsigned short
+dk4ma_ushort_from(dk4_um_t u, dk4_er_t *erp)
+{
+ if ((dk4_um_t)(USHRT_MAX) < u) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ return ((unsigned short)u);
+}
+
+
+
+unsigned short
+dk4ma_ushort_from_double(double d, dk4_er_t *erp)
+{
+ unsigned short back = 0;
+ if ((double)(USHRT_MAX) < d) {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ back = USHRT_MAX;
+ }
+ else {
+ if (0.0 > d) {
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ else {
+ back = (unsigned short)d;
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4maaus.h b/support/dktools/dk4maaus.h
index e243a6ee23..6810c515e5 100644
--- a/support/dktools/dk4maaus.h
+++ b/support/dktools/dk4maaus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maaus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maaus.ctr
*/
#ifndef DK4MAAUS_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -108,11 +98,31 @@ dk4ma_ushort_mul(unsigned short a, unsigned short b, dk4_er_t *erp);
USHRT_MAX on division by zero
(see the ec component of erp).
- Error codes: DK4_E_DIVZERO.
+ Error codes: DK4_E_MATH_DIVZERO.
*/
unsigned short
dk4ma_ushort_div(unsigned short a, unsigned short b, dk4_er_t *erp);
+/** Convert dk4_um_t value to unsigned short.
+ @param u Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_MATH_OVERFLOW.
+*/
+unsigned short
+dk4ma_ushort_from(dk4_um_t u, dk4_er_t *erp);
+
+/** Convert double to signed char.
+ @param d Value to convert.
+ @param erp Error report, may be NULL.
+ @return Conversion result.
+
+ Error codes: DK4_E_OVERFLOW.
+*/
+unsigned short
+dk4ma_ushort_from_double(double d, dk4_er_t *erp);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4macc.c b/support/dktools/dk4macc.c
index 474a9f31d7..b5d90f64a4 100644
--- a/support/dktools/dk4macc.c
+++ b/support/dktools/dk4macc.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macc.ctr
*/
/** @file dk4macc.c The dk4macc module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 34 "dk4macc.ctr"
+#include "dk4conf.h"
#include "dk4macc.h"
int
diff --git a/support/dktools/dk4macc.ctr b/support/dktools/dk4macc.ctr
index 4cd01f6587..3f8f65098d 100644
--- a/support/dktools/dk4macc.ctr
+++ b/support/dktools/dk4macc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -32,6 +32,7 @@ dk4ma_char_compare(signed char s, unsigned char u);
%% module
+#include "dk4conf.h"
#include "dk4macc.h"
int
diff --git a/support/dktools/dk4macc.h b/support/dktools/dk4macc.h
index 1655e250ff..c808bdaf74 100644
--- a/support/dktools/dk4macc.h
+++ b/support/dktools/dk4macc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macc.ctr
*/
#ifndef DK4MACC_H_INCLUDED
diff --git a/support/dktools/dk4macd.c b/support/dktools/dk4macd.c
index 18e9bb0fbb..f21c72fa4d 100644
--- a/support/dktools/dk4macd.c
+++ b/support/dktools/dk4macd.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macd.ctr
*/
/** @file dk4macd.c The dk4macd module.
*/
-#line 43 "dk4macd.ctr"
+#line 51 "dk4macd.ctr"
#include "dk4conf.h"
#include "dk4types.h"
diff --git a/support/dktools/dk4macd.ctr b/support/dktools/dk4macd.ctr
index 19ea859b5d..a161228b9b 100644
--- a/support/dktools/dk4macd.ctr
+++ b/support/dktools/dk4macd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,11 +14,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
diff --git a/support/dktools/dk4macd.h b/support/dktools/dk4macd.h
index 14cd7bb660..20f8aca575 100644
--- a/support/dktools/dk4macd.h
+++ b/support/dktools/dk4macd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macd.ctr
*/
#ifndef DK4MACD_H_INCLUDED
@@ -46,11 +24,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
diff --git a/support/dktools/dk4maci.c b/support/dktools/dk4maci.c
index 3b8245b723..24b94d7571 100644
--- a/support/dktools/dk4maci.c
+++ b/support/dktools/dk4maci.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maci.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maci.ctr
*/
/** @file dk4maci.c The dk4maci module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 35 "dk4maci.ctr"
+#include "dk4conf.h"
#include "dk4maci.h"
int
diff --git a/support/dktools/dk4maci.ctr b/support/dktools/dk4maci.ctr
index 49afe41ab2..ef3285ec29 100644
--- a/support/dktools/dk4maci.ctr
+++ b/support/dktools/dk4maci.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -33,6 +33,7 @@ dk4ma_int_compare(int s, unsigned int u);
%% module
+#include "dk4conf.h"
#include "dk4maci.h"
int
diff --git a/support/dktools/dk4maci.h b/support/dktools/dk4maci.h
index 842da5732c..d374ab4ba9 100644
--- a/support/dktools/dk4maci.h
+++ b/support/dktools/dk4maci.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maci.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maci.ctr
*/
#ifndef DK4MACI_H_INCLUDED
diff --git a/support/dktools/dk4maci16.c b/support/dktools/dk4maci16.c
index af96f267db..e32d8777e3 100644
--- a/support/dktools/dk4maci16.c
+++ b/support/dktools/dk4maci16.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maci16.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maci16.ctr
*/
/** @file dk4maci16.c The dk4maci16 module.
*/
-#line 64 "dk4maci16.ctr"
+#line 76 "dk4maci16.ctr"
+#include "dk4conf.h"
#include "dk4maci16.h"
diff --git a/support/dktools/dk4maci16.ctr b/support/dktools/dk4maci16.ctr
index 2db11327c7..3a9f83ef80 100644
--- a/support/dktools/dk4maci16.ctr
+++ b/support/dktools/dk4maci16.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -12,15 +12,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -62,6 +74,7 @@ dk4ma_int16_t_compare(int16_t s, uint16_t u);
%% module
+#include "dk4conf.h"
#include "dk4maci16.h"
diff --git a/support/dktools/dk4maci16.h b/support/dktools/dk4maci16.h
index cecf000cf0..5cf01bea07 100644
--- a/support/dktools/dk4maci16.h
+++ b/support/dktools/dk4maci16.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maci16.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maci16.ctr
*/
#ifndef DK4MACI16_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
diff --git a/support/dktools/dk4maci32.c b/support/dktools/dk4maci32.c
index efef31623b..a659dc98c4 100644
--- a/support/dktools/dk4maci32.c
+++ b/support/dktools/dk4maci32.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maci32.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maci32.ctr
*/
/** @file dk4maci32.c The dk4maci32 module.
*/
-#line 64 "dk4maci32.ctr"
+#line 76 "dk4maci32.ctr"
+#include "dk4conf.h"
#include "dk4maci32.h"
diff --git a/support/dktools/dk4maci32.ctr b/support/dktools/dk4maci32.ctr
index bf15fc5aff..a4f70f307a 100644
--- a/support/dktools/dk4maci32.ctr
+++ b/support/dktools/dk4maci32.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -12,15 +12,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -62,6 +74,7 @@ dk4ma_int32_t_compare(int32_t s, uint32_t u);
%% module
+#include "dk4conf.h"
#include "dk4maci32.h"
diff --git a/support/dktools/dk4maci32.h b/support/dktools/dk4maci32.h
index 8ff17f2fe7..f2fc38c56f 100644
--- a/support/dktools/dk4maci32.h
+++ b/support/dktools/dk4maci32.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maci32.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maci32.ctr
*/
#ifndef DK4MACI32_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
diff --git a/support/dktools/dk4macl.c b/support/dktools/dk4macl.c
index 3731e3fd28..4844e0f521 100644
--- a/support/dktools/dk4macl.c
+++ b/support/dktools/dk4macl.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macl.ctr
*/
/** @file dk4macl.c The dk4macl module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 35 "dk4macl.ctr"
+#include "dk4conf.h"
#include "dk4macl.h"
int
diff --git a/support/dktools/dk4macl.ctr b/support/dktools/dk4macl.ctr
index 6de05cf886..764491719f 100644
--- a/support/dktools/dk4macl.ctr
+++ b/support/dktools/dk4macl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -33,6 +33,7 @@ dk4ma_long_compare(long s, unsigned long u);
%% module
+#include "dk4conf.h"
#include "dk4macl.h"
int
diff --git a/support/dktools/dk4macl.h b/support/dktools/dk4macl.h
index 8c9b38f780..b80d242778 100644
--- a/support/dktools/dk4macl.h
+++ b/support/dktools/dk4macl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macl.ctr
*/
#ifndef DK4MACL_H_INCLUDED
diff --git a/support/dktools/dk4macll.c b/support/dktools/dk4macll.c
index 43a482e575..aa0b72025e 100644
--- a/support/dktools/dk4macll.c
+++ b/support/dktools/dk4macll.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macll.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macll.ctr
*/
/** @file dk4macll.c The dk4macll module.
*/
-#line 49 "dk4macll.ctr"
+#line 57 "dk4macll.ctr"
+#include "dk4conf.h"
#include "dk4macll.h"
#if DK4_HAVE_LONG_LONG
diff --git a/support/dktools/dk4macll.ctr b/support/dktools/dk4macll.ctr
index 0432660b48..bf813cda47 100644
--- a/support/dktools/dk4macll.ctr
+++ b/support/dktools/dk4macll.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,11 +14,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
@@ -47,6 +55,7 @@ dk4ma_long_long_compare(long long s, unsigned long long u);
%% module
+#include "dk4conf.h"
#include "dk4macll.h"
#if DK4_HAVE_LONG_LONG
diff --git a/support/dktools/dk4macll.h b/support/dktools/dk4macll.h
index 18df43b6ac..cef97d6f2e 100644
--- a/support/dktools/dk4macll.h
+++ b/support/dktools/dk4macll.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macll.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macll.ctr
*/
#ifndef DK4MACLL_H_INCLUDED
@@ -46,11 +24,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
diff --git a/support/dktools/dk4macm.c b/support/dktools/dk4macm.c
index 92ce22fa7b..0ff35a65bc 100644
--- a/support/dktools/dk4macm.c
+++ b/support/dktools/dk4macm.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macm.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macm.ctr
*/
/** @file dk4macm.c The dk4macm module.
*/
-#line 49 "dk4macm.ctr"
+#line 57 "dk4macm.ctr"
+#include "dk4conf.h"
#include "dk4macm.h"
diff --git a/support/dktools/dk4macm.ctr b/support/dktools/dk4macm.ctr
index f0e90842a5..49f71bf9fc 100644
--- a/support/dktools/dk4macm.ctr
+++ b/support/dktools/dk4macm.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,11 +14,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
@@ -47,6 +55,7 @@ dk4ma_intmax_t_compare(intmax_t s, uintmax_t u);
%% module
+#include "dk4conf.h"
#include "dk4macm.h"
diff --git a/support/dktools/dk4macm.h b/support/dktools/dk4macm.h
index 92409e3480..abc4b08844 100644
--- a/support/dktools/dk4macm.h
+++ b/support/dktools/dk4macm.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macm.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macm.ctr
*/
#ifndef DK4MACM_H_INCLUDED
@@ -46,11 +24,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
diff --git a/support/dktools/dk4macs.c b/support/dktools/dk4macs.c
index f23d389341..b6a135212a 100644
--- a/support/dktools/dk4macs.c
+++ b/support/dktools/dk4macs.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macs.ctr
*/
/** @file dk4macs.c The dk4macs module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 35 "dk4macs.ctr"
+#include "dk4conf.h"
#include "dk4macs.h"
int
diff --git a/support/dktools/dk4macs.ctr b/support/dktools/dk4macs.ctr
index 97fab0ddc4..47792bcffc 100644
--- a/support/dktools/dk4macs.ctr
+++ b/support/dktools/dk4macs.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -33,6 +33,7 @@ dk4ma_short_compare(short s, unsigned short u);
%% module
+#include "dk4conf.h"
#include "dk4macs.h"
int
diff --git a/support/dktools/dk4macs.h b/support/dktools/dk4macs.h
index 32fad731d9..dc257fa252 100644
--- a/support/dktools/dk4macs.h
+++ b/support/dktools/dk4macs.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4macs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4macs.ctr
*/
#ifndef DK4MACS_H_INCLUDED
diff --git a/support/dktools/dk4mai8dbl.c b/support/dktools/dk4mai8dbl.c
index 1d9d081907..42643e0e0f 100644
--- a/support/dktools/dk4mai8dbl.c
+++ b/support/dktools/dk4mai8dbl.c
@@ -1,44 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dbl.ctr
*/
/** @file dk4mai8dbl.c The dk4mai8dbl module.
*/
-#line 76 "dk4mai8dbl.ctr"
+#line 90 "dk4mai8dbl.ctr"
+
+#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8dbl.h"
@@ -65,8 +51,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -120,6 +111,10 @@ dk4ma_internal_input_c8_double(
char *myend = NULL;
int back = 0;
int xerr = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
errno = 0;
#if DK4_HAVE_STRTOD
@@ -179,6 +174,10 @@ dk4ma_internal_input_c8_double(
#if DK4_USE_PRINTF_SCANF
double val = 0.0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (1 == sscanf(src, "%lf", &val)) {
*rp = val;
@@ -212,6 +211,10 @@ dk4ma_input_c8_double(
char *oldloc = NULL;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
oldloc = setlocale(LC_NUMERIC, NULL);
(void)setlocale(LC_NUMERIC, locale_kw);
diff --git a/support/dktools/dk4mai8dbl.ctr b/support/dktools/dk4mai8dbl.ctr
index 934270f057..cb132bd1ad 100644
--- a/support/dktools/dk4mai8dbl.ctr
+++ b/support/dktools/dk4mai8dbl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -34,6 +46,8 @@ extern "C" {
The function temporarily resets the LC_NUMERIC locale setting
to "C" to retrieve the number and returns the setting to the
original value before returning.
+
+ CRT on Windows: Required.
@param rp Address of result variable.
@param src String to process.
@param endptr Address of pointer variable.
@@ -74,6 +88,14 @@ dk4ma_input_c8_double(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8dbl.h"
@@ -100,8 +122,13 @@ dk4ma_input_c8_double(
#endif
#endif
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -155,6 +182,10 @@ dk4ma_internal_input_c8_double(
char *myend = NULL;
int back = 0;
int xerr = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
errno = 0;
#if DK4_HAVE_STRTOD
@@ -214,6 +245,10 @@ dk4ma_internal_input_c8_double(
#if DK4_USE_PRINTF_SCANF
double val = 0.0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (1 == sscanf(src, "%lf", &val)) {
*rp = val;
@@ -247,6 +282,10 @@ dk4ma_input_c8_double(
char *oldloc = NULL;
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
oldloc = setlocale(LC_NUMERIC, NULL);
(void)setlocale(LC_NUMERIC, locale_kw);
diff --git a/support/dktools/dk4mai8dbl.h b/support/dktools/dk4mai8dbl.h
index cc56ba02f3..e14146bdf8 100644
--- a/support/dktools/dk4mai8dbl.h
+++ b/support/dktools/dk4mai8dbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dbl.ctr
*/
#ifndef DK4MAI8DBL_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +56,8 @@ extern "C" {
The function temporarily resets the LC_NUMERIC locale setting
to "C" to retrieve the number and returns the setting to the
original value before returning.
+
+ CRT on Windows: Required.
@param rp Address of result variable.
@param src String to process.
@param endptr Address of pointer variable.
diff --git a/support/dktools/dk4mai8ddi.c b/support/dktools/dk4mai8ddi.c
index 8ff0011369..74c820c9a8 100644
--- a/support/dktools/dk4mai8ddi.c
+++ b/support/dktools/dk4mai8ddi.c
@@ -1,44 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8ddi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8ddi.ctr
*/
/** @file dk4mai8ddi.c The dk4mai8ddi module.
*/
-#line 70 "dk4mai8ddi.ctr"
+#line 82 "dk4mai8ddi.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddi.h"
#include "dk4mai8ddu.h"
@@ -48,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 79 "dk4mai8ddi.ctr"
+#line 99 "dk4mai8ddi.ctr"
@@ -66,50 +52,55 @@ dk4ma_input_c8_dec_dk4_im_t(
int back = 0;
-#line 95 "dk4mai8ddi.ctr"
+#line 115 "dk4mai8ddi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if ('-' == *src) {
-#line 97 "dk4mai8ddi.ctr"
+#line 121 "dk4mai8ddi.ctr"
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, ++src, &ep, atg, erp)) {
if (((dk4_um_t)(DK4_IM_MAX) + (dk4_um_t)1UL) == res) {
-#line 99 "dk4mai8ddi.ctr"
+#line 123 "dk4mai8ddi.ctr"
*rp = DK4_IM_MIN;
back = 1;
} else {
if (((dk4_um_t)(DK4_IM_MAX)) >= res) {
-#line 103 "dk4mai8ddi.ctr"
+#line 127 "dk4mai8ddi.ctr"
*rp = (dk4_im_t)0L - (dk4_im_t)res;
back = 1;
} else {
-#line 106 "dk4mai8ddi.ctr"
+#line 130 "dk4mai8ddi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
}
} else {
-#line 110 "dk4mai8ddi.ctr"
+#line 134 "dk4mai8ddi.ctr"
}
} else {
-#line 112 "dk4mai8ddi.ctr"
+#line 136 "dk4mai8ddi.ctr"
+ if ('+' == *src) { src++; }
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, &ep, atg, erp)) {
if (((dk4_um_t)(DK4_IM_MAX)) >= res) {
-#line 114 "dk4mai8ddi.ctr"
+#line 139 "dk4mai8ddi.ctr"
*rp = (dk4_im_t)res;
back = 1;
} else {
-#line 117 "dk4mai8ddi.ctr"
+#line 142 "dk4mai8ddi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
} else {
-#line 120 "dk4mai8ddi.ctr"
+#line 145 "dk4mai8ddi.ctr"
}
}
} else {
@@ -118,7 +109,7 @@ dk4ma_input_c8_dec_dk4_im_t(
if (NULL != endptr) { *endptr = ep; }
-#line 127 "dk4mai8ddi.ctr"
+#line 152 "dk4mai8ddi.ctr"
return back;
}
diff --git a/support/dktools/dk4mai8ddi.ctr b/support/dktools/dk4mai8ddi.ctr
index c52744cdd2..c40941e9b3 100644
--- a/support/dktools/dk4mai8ddi.ctr
+++ b/support/dktools/dk4mai8ddi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -68,6 +80,14 @@ dk4ma_input_c8_dec_dk4_im_t(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddi.h"
#include "dk4mai8ddu.h"
@@ -92,6 +112,10 @@ dk4ma_input_c8_dec_dk4_im_t(
const char *ep = NULL;
int back = 0;
$? "+ dk4ma_input_c8_dec_dk4_im_t \"%!8s\" %d", src, atg
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if ('-' == *src) { $? ". negative"
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, ++src, &ep, atg, erp)) {
@@ -109,6 +133,7 @@ dk4ma_input_c8_dec_dk4_im_t(
} else { $? "! failed"
}
} else { $? ". not negative"
+ if ('+' == *src) { src++; }
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, &ep, atg, erp)) {
if (((dk4_um_t)(DK4_IM_MAX)) >= res) { $? ". ok"
*rp = (dk4_im_t)res;
diff --git a/support/dktools/dk4mai8ddi.h b/support/dktools/dk4mai8ddi.h
index 2d2d486258..af3a74d0e5 100644
--- a/support/dktools/dk4mai8ddi.h
+++ b/support/dktools/dk4mai8ddi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8ddi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8ddi.ctr
*/
#ifndef DK4MAI8DDI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4mai8ddu.c b/support/dktools/dk4mai8ddu.c
index 84932b8494..9a6d5c67cd 100644
--- a/support/dktools/dk4mai8ddu.c
+++ b/support/dktools/dk4mai8ddu.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8ddu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8ddu.ctr
*/
/** @file dk4mai8ddu.c The dk4mai8ddu module.
*/
-#line 70 "dk4mai8ddu.ctr"
+#line 82 "dk4mai8ddu.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddu.h"
#include "dk4numco.h"
@@ -47,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 78 "dk4mai8ddu.ctr"
+#line 99 "dk4mai8ddu.ctr"
@@ -71,7 +58,11 @@ dk4ma_input_c8_dec_dk4_um_t(
int cc = 1;
-#line 100 "dk4mai8ddu.ctr"
+#line 121 "dk4mai8ddu.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
#if VERSION_BEFORE_20141007
dk4error_init(&er);
@@ -79,7 +70,7 @@ dk4ma_input_c8_dec_dk4_um_t(
do {
-#line 106 "dk4mai8ddu.ctr"
+#line 131 "dk4mai8ddu.ctr"
op = (dk4_um_t)0UL;
switch (*src) {
case '0': { op = (dk4_um_t)0UL; } break;
@@ -94,40 +85,40 @@ dk4ma_input_c8_dec_dk4_um_t(
case '9': { op = (dk4_um_t)9UL; } break;
case '\0': {
-#line 119 "dk4mai8ddu.ctr"
+#line 144 "dk4mai8ddu.ctr"
cc = 0;
if (0 != found) {
-#line 121 "dk4mai8ddu.ctr"
+#line 146 "dk4mai8ddu.ctr"
back = 1;
*rp = result;
} else {
-#line 124 "dk4mai8ddu.ctr"
+#line 149 "dk4mai8ddu.ctr"
ep = src;
-#line 125 "dk4mai8ddu.ctr"
+#line 150 "dk4mai8ddu.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} break;
default: {
cc = 0;
-#line 130 "dk4mai8ddu.ctr"
+#line 155 "dk4mai8ddu.ctr"
ep = src;
-#line 131 "dk4mai8ddu.ctr"
+#line 156 "dk4mai8ddu.ctr"
if (0 != found) {
switch (atg) {
case 2: {
-#line 134 "dk4mai8ddu.ctr"
+#line 159 "dk4mai8ddu.ctr"
back = 1;
*rp = result;
} break;
case 1: {
-#line 138 "dk4mai8ddu.ctr"
+#line 163 "dk4mai8ddu.ctr"
if (NULL == dk4str8_start(src, NULL)) {
back = 1;
*rp = result;
@@ -137,7 +128,7 @@ dk4ma_input_c8_dec_dk4_um_t(
} break;
default: {
-#line 146 "dk4mai8ddu.ctr"
+#line 171 "dk4mai8ddu.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
} break;
}
@@ -148,7 +139,7 @@ dk4ma_input_c8_dec_dk4_um_t(
}
if (0 != cc) {
-#line 155 "dk4mai8ddu.ctr"
+#line 180 "dk4mai8ddu.ctr"
found = 1;
#if VERSION_BEFORE_20141007
result = dk4ma_um_add(
@@ -158,7 +149,7 @@ dk4ma_input_c8_dec_dk4_um_t(
if (DK4_E_NONE != er.ec) {
cc = 0;
-#line 163 "dk4mai8ddu.ctr"
+#line 188 "dk4mai8ddu.ctr"
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
ep = src;
}
@@ -190,7 +181,7 @@ dk4ma_input_c8_dec_dk4_um_t(
if (NULL != endptr) { *endptr = ep; }
-#line 193 "dk4mai8ddu.ctr"
+#line 218 "dk4mai8ddu.ctr"
return back;
}
diff --git a/support/dktools/dk4mai8ddu.ctr b/support/dktools/dk4mai8ddu.ctr
index c5d771bedc..6c8cd9eaa8 100644
--- a/support/dktools/dk4mai8ddu.ctr
+++ b/support/dktools/dk4mai8ddu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -68,6 +80,15 @@ dk4ma_input_c8_dec_dk4_um_t(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8ddu.h"
#include "dk4numco.h"
#include "dk4str8.h"
@@ -97,6 +118,10 @@ dk4ma_input_c8_dec_dk4_um_t(
int back = 0;
int cc = 1;
$? "+ dk4ma_input_c8_dec_dk4_um_t \"%!8s\"", src
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
#if VERSION_BEFORE_20141007
dk4error_init(&er);
diff --git a/support/dktools/dk4mai8ddu.h b/support/dktools/dk4mai8ddu.h
index 48288cf319..552607191c 100644
--- a/support/dktools/dk4mai8ddu.h
+++ b/support/dktools/dk4mai8ddu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8ddu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8ddu.ctr
*/
#ifndef DK4MAI8DDU_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4mai8di16.c b/support/dktools/dk4mai8di16.c
new file mode 100644
index 0000000000..760a7498b5
--- /dev/null
+++ b/support/dktools/dk4mai8di16.c
@@ -0,0 +1,60 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8di16.ctr
+*/
+
+/** @file dk4mai8di16.c The dk4mai8di16 module.
+*/
+
+
+#line 82 "dk4mai8di16.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddi.h"
+#include "dk4mai8di16.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_i16(
+ int16_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_im_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
+ if (((dk4_im_t)(-1L - 0x7FFFL) <= res) && (((dk4_im_t)(0x7FFFL)) >= res)) {
+ *rp = (int16_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8di16.ctr b/support/dktools/dk4mai8di16.ctr
new file mode 100644
index 0000000000..d36115894a
--- /dev/null
+++ b/support/dktools/dk4mai8di16.ctr
@@ -0,0 +1,123 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file
+ Retrieve short int value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_i16(
+ int16_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddi.h"
+#include "dk4mai8di16.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_i16(
+ int16_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_im_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
+ if (((dk4_im_t)(-1L - 0x7FFFL) <= res) && (((dk4_im_t)(0x7FFFL)) >= res)) {
+ *rp = (int16_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8di16.h b/support/dktools/dk4mai8di16.h
new file mode 100644
index 0000000000..a057851a77
--- /dev/null
+++ b/support/dktools/dk4mai8di16.h
@@ -0,0 +1,92 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8di16.ctr
+*/
+
+#ifndef DK4MAI8DI16_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4MAI8DI16_H_INCLUDED 1
+
+
+#line 10 "dk4mai8di16.ctr"
+
+/** @file
+ Retrieve short int value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_i16(
+ int16_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4mai8di32.c b/support/dktools/dk4mai8di32.c
new file mode 100644
index 0000000000..26f073cd86
--- /dev/null
+++ b/support/dktools/dk4mai8di32.c
@@ -0,0 +1,69 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8di32.ctr
+*/
+
+/** @file dk4mai8di32.c The dk4mai8di32 module.
+*/
+
+
+#line 82 "dk4mai8di32.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddi.h"
+#include "dk4mai8di32.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_i32(
+ int32_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_im_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
+#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG || (DK4_SIZEOF_LONG > 4)
+ if (
+ ((dk4_im_t)(-1L - 0x7FFFFFFFL) <= res)
+ && (((dk4_im_t)(0x7FFFFFFFL)) >= res)
+ )
+ {
+ *rp = (int32_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+#else
+ *rp = (int32_t)res;
+ back = 1;
+#endif
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8di32.ctr b/support/dktools/dk4mai8di32.ctr
new file mode 100644
index 0000000000..3e6ff3f58e
--- /dev/null
+++ b/support/dktools/dk4mai8di32.ctr
@@ -0,0 +1,132 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file
+ Retrieve short int value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_i32(
+ int32_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddi.h"
+#include "dk4mai8di32.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_i32(
+ int32_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_im_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
+#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG || (DK4_SIZEOF_LONG > 4)
+ if (
+ ((dk4_im_t)(-1L - 0x7FFFFFFFL) <= res)
+ && (((dk4_im_t)(0x7FFFFFFFL)) >= res)
+ )
+ {
+ *rp = (int32_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+#else
+ *rp = (int32_t)res;
+ back = 1;
+#endif
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8di32.h b/support/dktools/dk4mai8di32.h
new file mode 100644
index 0000000000..467bf345d6
--- /dev/null
+++ b/support/dktools/dk4mai8di32.h
@@ -0,0 +1,92 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8di32.ctr
+*/
+
+#ifndef DK4MAI8DI32_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4MAI8DI32_H_INCLUDED 1
+
+
+#line 10 "dk4mai8di32.ctr"
+
+/** @file
+ Retrieve short int value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_i32(
+ int32_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4mai8di8.c b/support/dktools/dk4mai8di8.c
new file mode 100644
index 0000000000..3b2d44ebe6
--- /dev/null
+++ b/support/dktools/dk4mai8di8.c
@@ -0,0 +1,61 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8di8.ctr
+*/
+
+/** @file dk4mai8di8.c The dk4mai8di8 module.
+*/
+
+
+#line 82 "dk4mai8di8.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8di8.h"
+#include "dk4mai8ddi.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_i8(
+ int8_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_im_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
+ if (((dk4_im_t)(-128L) <= res) && ((dk4_im_t)(127L) >= res)) {
+ *rp = (int8_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4mai8di8.ctr b/support/dktools/dk4mai8di8.ctr
new file mode 100644
index 0000000000..9d8218cfff
--- /dev/null
+++ b/support/dktools/dk4mai8di8.ctr
@@ -0,0 +1,124 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file
+ Retrieve signed char value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_i8(
+ int8_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8di8.h"
+#include "dk4mai8ddi.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_i8(
+ int8_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_im_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
+ if (((dk4_im_t)(-128L) <= res) && ((dk4_im_t)(127L) >= res)) {
+ *rp = (int8_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4mai8di8.h b/support/dktools/dk4mai8di8.h
new file mode 100644
index 0000000000..137a5a1c63
--- /dev/null
+++ b/support/dktools/dk4mai8di8.h
@@ -0,0 +1,93 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8di8.ctr
+*/
+
+#ifndef DK4MAI8DI8_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4MAI8DI8_H_INCLUDED 1
+
+
+#line 9 "dk4mai8di8.ctr"
+
+/** @file
+ Retrieve signed char value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_i8(
+ int8_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#endif
diff --git a/support/dktools/dk4mai8dic.c b/support/dktools/dk4mai8dic.c
index 674ea6e52a..d71f7ee8fd 100644
--- a/support/dktools/dk4mai8dic.c
+++ b/support/dktools/dk4mai8dic.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dic.ctr
*/
/** @file dk4mai8dic.c The dk4mai8dic module.
*/
-#line 70 "dk4mai8dic.ctr"
+#line 82 "dk4mai8dic.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8dic.h"
#include "dk4mai8ddi.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_dec_char(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(CHAR_MIN) <= res) && ((dk4_im_t)(CHAR_MAX) >= res)) {
*rp = (signed char)res;
diff --git a/support/dktools/dk4mai8dic.ctr b/support/dktools/dk4mai8dic.ctr
index 3672a45682..e2df2a12ea 100644
--- a/support/dktools/dk4mai8dic.ctr
+++ b/support/dktools/dk4mai8dic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_dec_char(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8dic.h"
#include "dk4mai8ddi.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_dec_char(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(CHAR_MIN) <= res) && ((dk4_im_t)(CHAR_MAX) >= res)) {
*rp = (signed char)res;
diff --git a/support/dktools/dk4mai8dic.h b/support/dktools/dk4mai8dic.h
index 64eb58e11d..dc959395df 100644
--- a/support/dktools/dk4mai8dic.h
+++ b/support/dktools/dk4mai8dic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dic.ctr
*/
#ifndef DK4MAI8DIC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dii.c b/support/dktools/dk4mai8dii.c
index 5435ab45a7..8c9efa8100 100644
--- a/support/dktools/dk4mai8dii.c
+++ b/support/dktools/dk4mai8dii.c
@@ -1,43 +1,31 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk4mai8dii.ctr
*/
-/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+/** @file dk4mai8dii.c The dk4mai8dii module.
+*/
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+#line 82 "dk4mai8dii.ctr"
-/** @file dk4mai8dii.c The dk4mai8dii module.
-*/
+#include "dk4conf.h"
-#line 70 "dk4mai8dii.ctr"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddi.h"
#include "dk4mai8dii.h"
@@ -56,6 +44,10 @@ dk4ma_input_c8_dec_int(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(INT_MIN) <= res) && (((dk4_im_t)(INT_MAX)) >= res)) {
*rp = (int)res;
diff --git a/support/dktools/dk4mai8dii.ctr b/support/dktools/dk4mai8dii.ctr
index 1089ce611e..33bd9595e8 100644
--- a/support/dktools/dk4mai8dii.ctr
+++ b/support/dktools/dk4mai8dii.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,16 @@ dk4ma_input_c8_dec_int(
%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8ddi.h"
#include "dk4mai8dii.h"
#include "dk4numco.h"
@@ -85,6 +107,10 @@ dk4ma_input_c8_dec_int(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(INT_MIN) <= res) && (((dk4_im_t)(INT_MAX)) >= res)) {
*rp = (int)res;
diff --git a/support/dktools/dk4mai8dii.h b/support/dktools/dk4mai8dii.h
index 4e42cd8b0d..4f21478d6c 100644
--- a/support/dktools/dk4mai8dii.h
+++ b/support/dktools/dk4mai8dii.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dii.ctr
*/
#ifndef DK4MAI8DII_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dil.c b/support/dktools/dk4mai8dil.c
index ba7a64166f..33002672c7 100644
--- a/support/dktools/dk4mai8dil.c
+++ b/support/dktools/dk4mai8dil.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dil.ctr
*/
/** @file dk4mai8dil.c The dk4mai8dil module.
*/
-#line 70 "dk4mai8dil.ctr"
+#line 82 "dk4mai8dil.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddi.h"
#include "dk4mai8dil.h"
@@ -57,6 +44,10 @@ dk4ma_input_c8_dec_long(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LONG_MIN) <= res) && (((dk4_im_t)(LONG_MAX)) >= res)) {
*rp = (long)res;
diff --git a/support/dktools/dk4mai8dil.ctr b/support/dktools/dk4mai8dil.ctr
index 4a0fc4c5c5..b6d94194b2 100644
--- a/support/dktools/dk4mai8dil.ctr
+++ b/support/dktools/dk4mai8dil.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_dec_long(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8ddi.h"
#include "dk4mai8dil.h"
#include "dk4numco.h"
@@ -86,6 +107,10 @@ dk4ma_input_c8_dec_long(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LONG_MIN) <= res) && (((dk4_im_t)(LONG_MAX)) >= res)) {
*rp = (long)res;
diff --git a/support/dktools/dk4mai8dil.h b/support/dktools/dk4mai8dil.h
index cdd690a6d8..570a2aee8f 100644
--- a/support/dktools/dk4mai8dil.h
+++ b/support/dktools/dk4mai8dil.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dil.ctr
*/
#ifndef DK4MAI8DIL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dis.c b/support/dktools/dk4mai8dis.c
index 13121b9ad5..e46b778389 100644
--- a/support/dktools/dk4mai8dis.c
+++ b/support/dktools/dk4mai8dis.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dis.ctr
*/
/** @file dk4mai8dis.c The dk4mai8dis module.
*/
-#line 70 "dk4mai8dis.ctr"
+#line 82 "dk4mai8dis.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddi.h"
#include "dk4mai8dis.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_dec_short(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(SHRT_MIN) <= res) && (((dk4_im_t)(SHRT_MAX)) >= res)) {
*rp = (short)res;
diff --git a/support/dktools/dk4mai8dis.ctr b/support/dktools/dk4mai8dis.ctr
index 0010bcace6..392c4a4c32 100644
--- a/support/dktools/dk4mai8dis.ctr
+++ b/support/dktools/dk4mai8dis.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_dec_short(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8ddi.h"
#include "dk4mai8dis.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_dec_short(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(SHRT_MIN) <= res) && (((dk4_im_t)(SHRT_MAX)) >= res)) {
*rp = (short)res;
diff --git a/support/dktools/dk4mai8dis.h b/support/dktools/dk4mai8dis.h
index b6f5916600..3bcb1b041f 100644
--- a/support/dktools/dk4mai8dis.h
+++ b/support/dktools/dk4mai8dis.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dis.ctr
*/
#ifndef DK4MAI8DIS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dli.c b/support/dktools/dk4mai8dli.c
index 54249acde7..b438cccf9b 100644
--- a/support/dktools/dk4mai8dli.c
+++ b/support/dktools/dk4mai8dli.c
@@ -1,46 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dli.ctr
*/
/** @file dk4mai8dli.c The dk4mai8dli module.
*/
-#line 74 "dk4mai8dli.ctr"
+#line 86 "dk4mai8dli.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
#if DK4_HAVE_LONG_LONG
#include "dk4mai8ddi.h"
@@ -61,6 +47,10 @@ dk4ma_input_c8_dec_ll(
#if DK4_HAVE_INTMAX_T
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LLONG_MIN) <= res) && (((dk4_im_t)(LLONG_MAX)) >= res)) {
*rp = (long long)res;
diff --git a/support/dktools/dk4mai8dli.ctr b/support/dktools/dk4mai8dli.ctr
index 8c8ccc1652..d07378806e 100644
--- a/support/dktools/dk4mai8dli.ctr
+++ b/support/dktools/dk4mai8dli.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -74,6 +86,14 @@ dk4ma_input_c8_dec_ll(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
#if DK4_HAVE_LONG_LONG
#include "dk4mai8ddi.h"
@@ -94,6 +114,10 @@ dk4ma_input_c8_dec_ll(
#if DK4_HAVE_INTMAX_T
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LLONG_MIN) <= res) && (((dk4_im_t)(LLONG_MAX)) >= res)) {
*rp = (long long)res;
diff --git a/support/dktools/dk4mai8dli.h b/support/dktools/dk4mai8dli.h
index 3d41e97fba..81ad12d53e 100644
--- a/support/dktools/dk4mai8dli.h
+++ b/support/dktools/dk4mai8dli.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dli.ctr
*/
#ifndef DK4MAI8DLI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dlu.c b/support/dktools/dk4mai8dlu.c
index 9ba88a30e8..dcdc1defc3 100644
--- a/support/dktools/dk4mai8dlu.c
+++ b/support/dktools/dk4mai8dlu.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dlu.ctr
*/
/** @file dk4mai8dlu.c The dk4mai8dlu module.
*/
-#line 74 "dk4mai8dlu.ctr"
+#line 86 "dk4mai8dlu.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4mai8ddu.h"
@@ -61,6 +46,10 @@ dk4ma_input_c8_dec_ull(
#if DK4_HAVE_INTMAX_T
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULLONG_MAX)) >= res) {
*rp = (unsigned long long)res;
diff --git a/support/dktools/dk4mai8dlu.ctr b/support/dktools/dk4mai8dlu.ctr
index 5f1d704610..a91a32accb 100644
--- a/support/dktools/dk4mai8dlu.ctr
+++ b/support/dktools/dk4mai8dlu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -74,6 +86,13 @@ dk4ma_input_c8_dec_ull(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4mai8ddu.h"
@@ -94,6 +113,10 @@ dk4ma_input_c8_dec_ull(
#if DK4_HAVE_INTMAX_T
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULLONG_MAX)) >= res) {
*rp = (unsigned long long)res;
diff --git a/support/dktools/dk4mai8dlu.h b/support/dktools/dk4mai8dlu.h
index 7e5e606115..323c465c7e 100644
--- a/support/dktools/dk4mai8dlu.h
+++ b/support/dktools/dk4mai8dlu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dlu.ctr
*/
#ifndef DK4MAI8DLU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dmi.c b/support/dktools/dk4mai8dmi.c
index e2d106e1bd..752564573c 100644
--- a/support/dktools/dk4mai8dmi.c
+++ b/support/dktools/dk4mai8dmi.c
@@ -1,47 +1,37 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dmi.ctr
*/
/** @file dk4mai8dmi.c The dk4mai8dmi module.
*/
-#line 75 "dk4mai8dmi.ctr"
+#line 87 "dk4mai8dmi.ctr"
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -59,6 +49,10 @@ dk4ma_input_c8_dec_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_dec_dk4_im_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4mai8dmi.ctr b/support/dktools/dk4mai8dmi.ctr
index 162ce086f0..4c5eb266cf 100644
--- a/support/dktools/dk4mai8dmi.ctr
+++ b/support/dktools/dk4mai8dmi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -75,7 +87,19 @@ dk4ma_input_c8_dec_intmax_t(
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -93,6 +117,10 @@ dk4ma_input_c8_dec_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_dec_dk4_im_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4mai8dmi.h b/support/dktools/dk4mai8dmi.h
index bfa9f26466..d18aa0f476 100644
--- a/support/dktools/dk4mai8dmi.h
+++ b/support/dktools/dk4mai8dmi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dmi.ctr
*/
#ifndef DK4MAI8DMI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dmu.c b/support/dktools/dk4mai8dmu.c
index 877c9353c8..e8fe7662fd 100644
--- a/support/dktools/dk4mai8dmu.c
+++ b/support/dktools/dk4mai8dmu.c
@@ -1,47 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dmu.ctr
*/
/** @file dk4mai8dmu.c The dk4mai8dmu module.
*/
-#line 75 "dk4mai8dmu.ctr"
+#line 87 "dk4mai8dmu.ctr"
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -59,6 +48,10 @@ dk4ma_input_c8_dec_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_dec_dk4_um_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4mai8dmu.ctr b/support/dktools/dk4mai8dmu.ctr
index 9e844b10fe..1580d5a5f7 100644
--- a/support/dktools/dk4mai8dmu.ctr
+++ b/support/dktools/dk4mai8dmu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -75,7 +87,18 @@ dk4ma_input_c8_dec_uintmax_t(
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -93,6 +116,10 @@ dk4ma_input_c8_dec_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_dec_dk4_um_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4mai8dmu.h b/support/dktools/dk4mai8dmu.h
index d7ab9dddd3..a2ac4b4437 100644
--- a/support/dktools/dk4mai8dmu.h
+++ b/support/dktools/dk4mai8dmu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dmu.ctr
*/
#ifndef DK4MAI8DMU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dsz.c b/support/dktools/dk4mai8dsz.c
index e90225d627..47f173f1dc 100644
--- a/support/dktools/dk4mai8dsz.c
+++ b/support/dktools/dk4mai8dsz.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dsz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dsz.ctr
*/
/** @file dk4mai8dsz.c The dk4mai8dsz module.
*/
-#line 72 "dk4mai8dsz.ctr"
+#line 127 "dk4mai8dsz.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddu.h"
#include "dk4mai8dsz.h"
@@ -47,123 +34,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#if VERSION_1
-
-/** Find multiplication factor for size.
- @param str String probably containing a size specification.
- @param fp Pointer to factor variable.
- @param erp Error report, may be NULL.
- @return Start of string after size specification.
-*/
-static
-const char *
-dk4mai8dsz_find_factor(const char *str, size_t *fp, dk4_er_t *erp)
-{
- size_t factor = 1;
- size_t numl = 0;
- switch (*str) {
- case 'k': case 'K': { numl = 1; str++; } break;
- case 'm': case 'M': { numl = 2; str++; } break;
- case 'g': case 'G': { numl = 3; str++; } break;
- case 't': case 'T': { numl = 4; str++; } break;
- }
- while (0 < numl--) {
-#if VERSION_BEFORE_20141007
- factor = dk4ma_size_t_mul(factor, 1024, erp);
-#else
- if ((SIZE_MAX / 1024) >= factor) {
- factor *= 1024;
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
-#endif
- }
- *fp = factor;
- return str;
-}
-
-
-
-/* UNTESTED */
-int
-dk4ma_input_c8_dec_size_t(
- size_t *rp,
- const char *src,
- const char **endptr,
- int atg,
- dk4_er_t *erp
-)
-{
- dk4_er_t er;
- const char *myend = NULL;
- dk4_um_t res;
- size_t szr;
- size_t factor = 1;
- int back = 0;
- if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, &myend, 2, erp)) {
- if (((dk4_um_t)(SIZE_MAX)) >= res) {
- szr = (size_t)res;
- if (NULL != myend) {
- dk4error_init(&er);
- myend = dk4mai8dsz_find_factor(myend, &factor, &er);
- if (DK4_E_MATH_OVERFLOW != er.ec) {
- dk4error_init(&er);
-#if VERSION_BEFORE_20141107
- szr = dk4ma_size_t_mul(szr, factor, &er);
-#else
- if ((SIZE_MAX / factor) >= szr) {
- szr *= factor;
- } else {
- dk4error_set_simple_error_code(&er, DK4_E_MATH_OVERFLOW);
- }
-#endif
- if (DK4_E_MATH_OVERFLOW != er.ec) {
- if ('\0' == *myend) {
- *rp = szr;
- back = 1;
- } else {
- switch (atg) {
- case 2: {
- *rp = szr;
- back = 1;
- } break;
- case 1: {
- if (NULL == dk4str8_start(myend, NULL)) {
- *rp = szr;
- back = 1;
- } else {
- *endptr = myend;
- dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
- }
- } break;
- default: {
- *endptr = myend;
- dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
- } break;
- }
- }
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
- } else {
- *rp = szr;
- back = 1;
- }
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
- }
- return back;
-}
-
-
-#endif
-
-
-
int
dk4ma_input_c8_dec_size_t(
size_t *rp,
@@ -176,10 +46,14 @@ dk4ma_input_c8_dec_size_t(
const char *myend = NULL;
dk4_um_t um = (dk4_um_t)0UL;
size_t res = 0;
+ size_t xf = 1024;
size_t factor = 1;
size_t nloop = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (0 != dk4ma_input_c8_dec_dk4_um_t(&um, src, &myend, 2, erp)) {
if (((dk4_um_t)(SIZE_MAX)) >= um) {
@@ -187,14 +61,26 @@ dk4ma_input_c8_dec_size_t(
if (NULL != myend) {
back = 1;
switch (*myend) {
- case 'k': case 'K': { nloop = 1; myend++; } break;
- case 'm': case 'M': { nloop = 2; myend++; } break;
- case 'g': case 'G': { nloop = 3; myend++; } break;
- case 't': case 'T': { nloop = 4; myend++; } break;
+ case 'K': { nloop = 1; myend++; } break;
+ case 'M': { nloop = 2; myend++; } break;
+ case 'G': { nloop = 3; myend++; } break;
+ case 'T': { nloop = 4; myend++; } break;
+ case 'P': { nloop = 5; myend++; } break;
+ case 'E': { nloop = 6; myend++; } break;
+ case 'Z': { nloop = 7; myend++; } break;
+ case 'Y': { nloop = 8; myend++; } break;
+ case 'k': { nloop = 1; myend++; xf = 1000; } break;
+ case 'm': { nloop = 2; myend++; xf = 1000; } break;
+ case 'g': { nloop = 3; myend++; xf = 1000; } break;
+ case 't': { nloop = 4; myend++; xf = 1000; } break;
+ case 'p': { nloop = 5; myend++; xf = 1000; } break;
+ case 'e': { nloop = 6; myend++; xf = 1000; } break;
+ case 'z': { nloop = 7; myend++; xf = 1000; } break;
+ case 'y': { nloop = 8; myend++; xf = 1000; } break;
}
while (nloop--) {
- if ((SIZE_MAX / 1024) >= factor) {
- factor *= 1024;
+ if ((SIZE_MAX / xf) >= factor) {
+ factor *= xf;
} else {
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
@@ -243,3 +129,38 @@ dk4ma_input_c8_dec_size_t(
return back;
}
+
+
+int
+dk4ma_input_c8_dec_size_t_simple(
+ size_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ const char *myend = NULL;
+ dk4_um_t um = (dk4_um_t)0UL;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if ((NULL != rp) && (NULL != src)) {
+ if (0 != dk4ma_input_c8_dec_dk4_um_t(&um, src, &myend, atg, erp)) {
+ if (((dk4_um_t)(SIZE_MAX)) >= um) {
+ *rp = (size_t)um;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (NULL != endptr) { *endptr = myend; }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4mai8dsz.ctr b/support/dktools/dk4mai8dsz.ctr
index fd14c2683c..3847da948f 100644
--- a/support/dktools/dk4mai8dsz.ctr
+++ b/support/dktools/dk4mai8dsz.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -36,6 +48,13 @@ extern "C" {
/** Retrieve numeric value from string, decimal notation.
@param rp Pointer to result variable for the found value.
@param src String to check for numeric value.
+ In addition to the numeric value the string can
+ contain a suffix 'K', 'M', 'G', 'T', 'P', 'E',
+ 'Z' or 'Y' to indicate multiples of powers of 1024
+ (kibibytes, mibibytes...).
+ Suffixes 'k', 'm', 'g', 't', 'p', 'e', 'z' or 'y'
+ indicate multiples of powers of 1000
+ (kilobytes, megabytes...).
@param endptr Address of pointer variable.
A pointer to the first character not processed
is stored here.
@@ -55,6 +74,7 @@ extern "C" {
DK4_E_MATH_OVERFLOW if the number is out of range, or
DK4_E_SYNTAX if src contains illegal characters.
*/
+
int
dk4ma_input_c8_dec_size_t(
size_t *rp,
@@ -64,135 +84,62 @@ dk4ma_input_c8_dec_size_t(
dk4_er_t *erp
);
-#ifdef __cplusplus
-}
-#endif
-
-%% module
-#include "dk4mai8ddu.h"
-#include "dk4mai8dsz.h"
-#include "dk4maasz.h"
-#include "dk4numco.h"
-#include "dk4str8.h"
-
-
-
-#if VERSION_1
-
-/** Find multiplication factor for size.
- @param str String probably containing a size specification.
- @param fp Pointer to factor variable.
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ No suffixes allowed.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
@param erp Error report, may be NULL.
- @return Start of string after size specification.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
*/
-static
-const char *
-dk4mai8dsz_find_factor(const char *str, size_t *fp, dk4_er_t *erp)
-{
- size_t factor = 1;
- size_t numl = 0;
- switch (*str) {
- case 'k': case 'K': { numl = 1; str++; } break;
- case 'm': case 'M': { numl = 2; str++; } break;
- case 'g': case 'G': { numl = 3; str++; } break;
- case 't': case 'T': { numl = 4; str++; } break;
- }
- while (0 < numl--) {
-#if VERSION_BEFORE_20141007
- factor = dk4ma_size_t_mul(factor, 1024, erp);
-#else
- if ((SIZE_MAX / 1024) >= factor) {
- factor *= 1024;
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
-#endif
- }
- *fp = factor;
- return str;
-}
-
-
-/* UNTESTED */
int
-dk4ma_input_c8_dec_size_t(
+dk4ma_input_c8_dec_size_t_simple(
size_t *rp,
const char *src,
const char **endptr,
int atg,
dk4_er_t *erp
-)
-{
- dk4_er_t er;
- const char *myend = NULL;
- dk4_um_t res;
- size_t szr;
- size_t factor = 1;
- int back = 0;
- if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, &myend, 2, erp)) {
- if (((dk4_um_t)(SIZE_MAX)) >= res) {
- szr = (size_t)res;
- if (NULL != myend) {
- dk4error_init(&er);
- myend = dk4mai8dsz_find_factor(myend, &factor, &er);
- if (DK4_E_MATH_OVERFLOW != er.ec) {
- dk4error_init(&er);
-#if VERSION_BEFORE_20141107
- szr = dk4ma_size_t_mul(szr, factor, &er);
-#else
- if ((SIZE_MAX / factor) >= szr) {
- szr *= factor;
- } else {
- dk4error_set_simple_error_code(&er, DK4_E_MATH_OVERFLOW);
- }
-#endif
- if (DK4_E_MATH_OVERFLOW != er.ec) {
- if ('\0' == *myend) {
- *rp = szr;
- back = 1;
- } else {
- switch (atg) {
- case 2: {
- *rp = szr;
- back = 1;
- } break;
- case 1: {
- if (NULL == dk4str8_start(myend, NULL)) {
- *rp = szr;
- back = 1;
- } else {
- *endptr = myend;
- dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
- }
- } break;
- default: {
- *endptr = myend;
- dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
- } break;
- }
- }
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
- } else {
- *rp = szr;
- back = 1;
- }
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
- }
- return back;
+);
+
+
+#ifdef __cplusplus
}
+#endif
+
+%% module
+#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
#endif
+#include "dk4mai8ddu.h"
+#include "dk4mai8dsz.h"
+#include "dk4maasz.h"
+#include "dk4numco.h"
+#include "dk4str8.h"
+
int
@@ -207,10 +154,14 @@ dk4ma_input_c8_dec_size_t(
const char *myend = NULL;
dk4_um_t um = (dk4_um_t)0UL;
size_t res = 0;
+ size_t xf = 1024;
size_t factor = 1;
size_t nloop = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (0 != dk4ma_input_c8_dec_dk4_um_t(&um, src, &myend, 2, erp)) {
if (((dk4_um_t)(SIZE_MAX)) >= um) {
@@ -218,14 +169,26 @@ dk4ma_input_c8_dec_size_t(
if (NULL != myend) {
back = 1;
switch (*myend) {
- case 'k': case 'K': { nloop = 1; myend++; } break;
- case 'm': case 'M': { nloop = 2; myend++; } break;
- case 'g': case 'G': { nloop = 3; myend++; } break;
- case 't': case 'T': { nloop = 4; myend++; } break;
+ case 'K': { nloop = 1; myend++; } break;
+ case 'M': { nloop = 2; myend++; } break;
+ case 'G': { nloop = 3; myend++; } break;
+ case 'T': { nloop = 4; myend++; } break;
+ case 'P': { nloop = 5; myend++; } break;
+ case 'E': { nloop = 6; myend++; } break;
+ case 'Z': { nloop = 7; myend++; } break;
+ case 'Y': { nloop = 8; myend++; } break;
+ case 'k': { nloop = 1; myend++; xf = 1000; } break;
+ case 'm': { nloop = 2; myend++; xf = 1000; } break;
+ case 'g': { nloop = 3; myend++; xf = 1000; } break;
+ case 't': { nloop = 4; myend++; xf = 1000; } break;
+ case 'p': { nloop = 5; myend++; xf = 1000; } break;
+ case 'e': { nloop = 6; myend++; xf = 1000; } break;
+ case 'z': { nloop = 7; myend++; xf = 1000; } break;
+ case 'y': { nloop = 8; myend++; xf = 1000; } break;
}
while (nloop--) {
- if ((SIZE_MAX / 1024) >= factor) {
- factor *= 1024;
+ if ((SIZE_MAX / xf) >= factor) {
+ factor *= xf;
} else {
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
@@ -274,3 +237,38 @@ dk4ma_input_c8_dec_size_t(
return back;
}
+
+
+int
+dk4ma_input_c8_dec_size_t_simple(
+ size_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ const char *myend = NULL;
+ dk4_um_t um = (dk4_um_t)0UL;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if ((NULL != rp) && (NULL != src)) {
+ if (0 != dk4ma_input_c8_dec_dk4_um_t(&um, src, &myend, atg, erp)) {
+ if (((dk4_um_t)(SIZE_MAX)) >= um) {
+ *rp = (size_t)um;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (NULL != endptr) { *endptr = myend; }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4mai8dsz.h b/support/dktools/dk4mai8dsz.h
index b4911f261f..ad3f258e58 100644
--- a/support/dktools/dk4mai8dsz.h
+++ b/support/dktools/dk4mai8dsz.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dsz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dsz.ctr
*/
#ifndef DK4MAI8DSZ_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +58,13 @@ extern "C" {
/** Retrieve numeric value from string, decimal notation.
@param rp Pointer to result variable for the found value.
@param src String to check for numeric value.
+ In addition to the numeric value the string can
+ contain a suffix 'K', 'M', 'G', 'T', 'P', 'E',
+ 'Z' or 'Y' to indicate multiples of powers of 1024
+ (kibibytes, mibibytes...).
+ Suffixes 'k', 'm', 'g', 't', 'p', 'e', 'z' or 'y'
+ indicate multiples of powers of 1000
+ (kilobytes, megabytes...).
@param endptr Address of pointer variable.
A pointer to the first character not processed
is stored here.
@@ -87,6 +84,7 @@ extern "C" {
DK4_E_MATH_OVERFLOW if the number is out of range, or
DK4_E_SYNTAX if src contains illegal characters.
*/
+
int
dk4ma_input_c8_dec_size_t(
size_t *rp,
@@ -96,6 +94,41 @@ dk4ma_input_c8_dec_size_t(
dk4_er_t *erp
);
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ No suffixes allowed.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+
+int
+dk4ma_input_c8_dec_size_t_simple(
+ size_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4mai8du16.c b/support/dktools/dk4mai8du16.c
new file mode 100644
index 0000000000..54436dbf61
--- /dev/null
+++ b/support/dktools/dk4mai8du16.c
@@ -0,0 +1,60 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8du16.ctr
+*/
+
+/** @file dk4mai8du16.c The dk4mai8du16 module.
+*/
+
+
+#line 82 "dk4mai8du16.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddu.h"
+#include "dk4mai8du16.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_u16(
+ uint16_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_um_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
+ if (((dk4_um_t)(0xFFFFUL)) >= res) {
+ *rp = (uint16_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8du16.ctr b/support/dktools/dk4mai8du16.ctr
new file mode 100644
index 0000000000..958fa61fe9
--- /dev/null
+++ b/support/dktools/dk4mai8du16.ctr
@@ -0,0 +1,123 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file
+ Retrieve unsigned short value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_u16(
+ uint16_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddu.h"
+#include "dk4mai8du16.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_u16(
+ uint16_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_um_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
+ if (((dk4_um_t)(0xFFFFUL)) >= res) {
+ *rp = (uint16_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8du16.h b/support/dktools/dk4mai8du16.h
new file mode 100644
index 0000000000..635f1ee2fa
--- /dev/null
+++ b/support/dktools/dk4mai8du16.h
@@ -0,0 +1,92 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8du16.ctr
+*/
+
+#ifndef DK4MAI8DU16_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4MAI8DU16_H_INCLUDED 1
+
+
+#line 10 "dk4mai8du16.ctr"
+
+/** @file
+ Retrieve unsigned short value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_u16(
+ uint16_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4mai8du32.c b/support/dktools/dk4mai8du32.c
new file mode 100644
index 0000000000..44b727453e
--- /dev/null
+++ b/support/dktools/dk4mai8du32.c
@@ -0,0 +1,65 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8du32.ctr
+*/
+
+/** @file dk4mai8du32.c The dk4mai8du32 module.
+*/
+
+
+#line 82 "dk4mai8du32.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddu.h"
+#include "dk4mai8du32.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_u32(
+ uint32_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_um_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
+#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG || (DK4_SIZEOF_LONG > 4)
+ if (((dk4_um_t)(0xFFFFFFFFUL)) >= res) {
+ *rp = (uint32_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+#else
+ *rp = (uint32_t)res;
+ back = 1;
+#endif
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8du32.ctr b/support/dktools/dk4mai8du32.ctr
new file mode 100644
index 0000000000..8beea4c9e4
--- /dev/null
+++ b/support/dktools/dk4mai8du32.ctr
@@ -0,0 +1,128 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file
+ Retrieve unsigned short value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_u32(
+ uint32_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddu.h"
+#include "dk4mai8du32.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_u32(
+ uint32_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_um_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
+#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG || (DK4_SIZEOF_LONG > 4)
+ if (((dk4_um_t)(0xFFFFFFFFUL)) >= res) {
+ *rp = (uint32_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+#else
+ *rp = (uint32_t)res;
+ back = 1;
+#endif
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8du32.h b/support/dktools/dk4mai8du32.h
new file mode 100644
index 0000000000..ae91869e0e
--- /dev/null
+++ b/support/dktools/dk4mai8du32.h
@@ -0,0 +1,92 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8du32.ctr
+*/
+
+#ifndef DK4MAI8DU32_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4MAI8DU32_H_INCLUDED 1
+
+
+#line 10 "dk4mai8du32.ctr"
+
+/** @file
+ Retrieve unsigned short value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_u32(
+ uint32_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4mai8du8.c b/support/dktools/dk4mai8du8.c
new file mode 100644
index 0000000000..4e415b9f5d
--- /dev/null
+++ b/support/dktools/dk4mai8du8.c
@@ -0,0 +1,60 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8du8.ctr
+*/
+
+/** @file dk4mai8du8.c The dk4mai8du8 module.
+*/
+
+
+#line 82 "dk4mai8du8.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddu.h"
+#include "dk4mai8du8.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_u8(
+ uint8_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_um_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
+ if (((dk4_um_t)(255UL)) >= res) {
+ *rp = (uint8_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8du8.ctr b/support/dktools/dk4mai8du8.ctr
new file mode 100644
index 0000000000..60f09b72e7
--- /dev/null
+++ b/support/dktools/dk4mai8du8.ctr
@@ -0,0 +1,123 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file
+ Retrieve unsigned char value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_u8(
+ uint8_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4mai8ddu.h"
+#include "dk4mai8du8.h"
+#include "dk4numco.h"
+
+
+
+int
+dk4ma_input_c8_dec_u8(
+ uint8_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ dk4_um_t res;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
+ if (((dk4_um_t)(255UL)) >= res) {
+ *rp = (uint8_t)res;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ return back;
+}
+
diff --git a/support/dktools/dk4mai8du8.h b/support/dktools/dk4mai8du8.h
new file mode 100644
index 0000000000..2fb115bcd2
--- /dev/null
+++ b/support/dktools/dk4mai8du8.h
@@ -0,0 +1,92 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8du8.ctr
+*/
+
+#ifndef DK4MAI8DU8_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4MAI8DU8_H_INCLUDED 1
+
+
+#line 10 "dk4mai8du8.ctr"
+
+/** @file
+ Retrieve unsigned char value from
+ 8 bit character string in decimal notation.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+int
+dk4ma_input_c8_dec_u8(
+ uint8_t *rp,
+ const char *src,
+ const char **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4mai8duc.c b/support/dktools/dk4mai8duc.c
index 298db369bf..fdcc047dbe 100644
--- a/support/dktools/dk4mai8duc.c
+++ b/support/dktools/dk4mai8duc.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8duc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8duc.ctr
*/
/** @file dk4mai8duc.c The dk4mai8duc module.
*/
-#line 70 "dk4mai8duc.ctr"
+#line 82 "dk4mai8duc.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddu.h"
#include "dk4mai8duc.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_dec_uchar(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UCHAR_MAX)) >= res) {
*rp = (unsigned char)res;
diff --git a/support/dktools/dk4mai8duc.ctr b/support/dktools/dk4mai8duc.ctr
index c242b054ad..01bd0b02ef 100644
--- a/support/dktools/dk4mai8duc.ctr
+++ b/support/dktools/dk4mai8duc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_dec_uchar(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8ddu.h"
#include "dk4mai8duc.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_dec_uchar(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UCHAR_MAX)) >= res) {
*rp = (unsigned char)res;
diff --git a/support/dktools/dk4mai8duc.h b/support/dktools/dk4mai8duc.h
index 072a808dec..36a9f5868d 100644
--- a/support/dktools/dk4mai8duc.h
+++ b/support/dktools/dk4mai8duc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8duc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8duc.ctr
*/
#ifndef DK4MAI8DUC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dui.c b/support/dktools/dk4mai8dui.c
index 0a847656c6..2548452b42 100644
--- a/support/dktools/dk4mai8dui.c
+++ b/support/dktools/dk4mai8dui.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dui.ctr
*/
/** @file dk4mai8dui.c The dk4mai8dui module.
*/
-#line 70 "dk4mai8dui.ctr"
+#line 82 "dk4mai8dui.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddu.h"
#include "dk4mai8dui.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_dec_uint(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UINT_MAX)) >= res) {
*rp = (unsigned)res;
diff --git a/support/dktools/dk4mai8dui.ctr b/support/dktools/dk4mai8dui.ctr
index 8eef26615e..4faaf7aee5 100644
--- a/support/dktools/dk4mai8dui.ctr
+++ b/support/dktools/dk4mai8dui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_dec_uint(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8ddu.h"
#include "dk4mai8dui.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_dec_uint(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UINT_MAX)) >= res) {
*rp = (unsigned)res;
diff --git a/support/dktools/dk4mai8dui.h b/support/dktools/dk4mai8dui.h
index 604e58e29d..7ce3cbe05f 100644
--- a/support/dktools/dk4mai8dui.h
+++ b/support/dktools/dk4mai8dui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dui.ctr
*/
#ifndef DK4MAI8DUI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dul.c b/support/dktools/dk4mai8dul.c
index 9bfa35383c..91012990c9 100644
--- a/support/dktools/dk4mai8dul.c
+++ b/support/dktools/dk4mai8dul.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dul.ctr
*/
/** @file dk4mai8dul.c The dk4mai8dul module.
*/
-#line 70 "dk4mai8dul.ctr"
+#line 82 "dk4mai8dul.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddu.h"
#include "dk4mai8dul.h"
@@ -57,6 +44,10 @@ dk4ma_input_c8_dec_ulong(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULONG_MAX)) >= res) {
*rp = (unsigned long)res;
diff --git a/support/dktools/dk4mai8dul.ctr b/support/dktools/dk4mai8dul.ctr
index 4bb0736b5a..7792f8b26d 100644
--- a/support/dktools/dk4mai8dul.ctr
+++ b/support/dktools/dk4mai8dul.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_dec_ulong(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8ddu.h"
#include "dk4mai8dul.h"
#include "dk4numco.h"
@@ -86,6 +107,10 @@ dk4ma_input_c8_dec_ulong(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULONG_MAX)) >= res) {
*rp = (unsigned long)res;
diff --git a/support/dktools/dk4mai8dul.h b/support/dktools/dk4mai8dul.h
index a137dcdafb..5ed99b4168 100644
--- a/support/dktools/dk4mai8dul.h
+++ b/support/dktools/dk4mai8dul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dul.ctr
*/
#ifndef DK4MAI8DUL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8dus.c b/support/dktools/dk4mai8dus.c
index 6edda6ba1a..8fde8daebf 100644
--- a/support/dktools/dk4mai8dus.c
+++ b/support/dktools/dk4mai8dus.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dus.ctr
*/
/** @file dk4mai8dus.c The dk4mai8dus module.
*/
-#line 70 "dk4mai8dus.ctr"
+#line 82 "dk4mai8dus.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8ddu.h"
#include "dk4mai8dus.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_dec_ushort(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(USHRT_MAX)) >= res) {
*rp = (unsigned short)res;
diff --git a/support/dktools/dk4mai8dus.ctr b/support/dktools/dk4mai8dus.ctr
index 8155d389ae..78005985dc 100644
--- a/support/dktools/dk4mai8dus.ctr
+++ b/support/dktools/dk4mai8dus.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_dec_ushort(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8ddu.h"
#include "dk4mai8dus.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_dec_ushort(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(USHRT_MAX)) >= res) {
*rp = (unsigned short)res;
diff --git a/support/dktools/dk4mai8dus.h b/support/dktools/dk4mai8dus.h
index c02a7aecd1..21adf01285 100644
--- a/support/dktools/dk4mai8dus.h
+++ b/support/dktools/dk4mai8dus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8dus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8dus.ctr
*/
#ifndef DK4MAI8DUS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hdi.c b/support/dktools/dk4mai8hdi.c
index b74ae329ad..5b1360f368 100644
--- a/support/dktools/dk4mai8hdi.c
+++ b/support/dktools/dk4mai8hdi.c
@@ -1,44 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hdi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hdi.ctr
*/
/** @file dk4mai8hdi.c The dk4mai8hdi module.
*/
-#line 72 "dk4mai8hdi.ctr"
+#line 84 "dk4mai8hdi.ctr"
+
+
+#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdu.h"
#include "dk4mai8hdi.h"
@@ -48,7 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 81 "dk4mai8hdi.ctr"
+#line 102 "dk4mai8hdi.ctr"
@@ -66,42 +53,46 @@ dk4ma_input_c8_hex_dk4_im_t(
int back = 0;
-#line 97 "dk4mai8hdi.ctr"
+#line 118 "dk4mai8hdi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if ('-' == *src) {
-#line 99 "dk4mai8hdi.ctr"
+#line 124 "dk4mai8hdi.ctr"
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, ++src, &ep, atg, erp)) {
if (((dk4_um_t)(DK4_IM_MAX) + (dk4_um_t)1UL) == res) {
-#line 101 "dk4mai8hdi.ctr"
+#line 126 "dk4mai8hdi.ctr"
*rp = DK4_IM_MIN;
back = 1;
} else {
if (((dk4_um_t)(DK4_IM_MAX)) >= res) {
-#line 105 "dk4mai8hdi.ctr"
+#line 130 "dk4mai8hdi.ctr"
*rp = (dk4_im_t)0L - (dk4_im_t)res;
back = 1;
} else {
-#line 108 "dk4mai8hdi.ctr"
+#line 133 "dk4mai8hdi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
}
} else {
-#line 112 "dk4mai8hdi.ctr"
+#line 137 "dk4mai8hdi.ctr"
}
} else {
-#line 114 "dk4mai8hdi.ctr"
+#line 139 "dk4mai8hdi.ctr"
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, &ep, atg, erp)) {
*rp = (dk4_im_t)res;
back = 1;
} else {
-#line 118 "dk4mai8hdi.ctr"
+#line 143 "dk4mai8hdi.ctr"
}
}
} else {
@@ -110,7 +101,7 @@ dk4ma_input_c8_hex_dk4_im_t(
if (NULL != endptr) { *endptr = ep; }
-#line 125 "dk4mai8hdi.ctr"
+#line 150 "dk4mai8hdi.ctr"
return back;
}
diff --git a/support/dktools/dk4mai8hdi.ctr b/support/dktools/dk4mai8hdi.ctr
index 7e568572c0..059d636a06 100644
--- a/support/dktools/dk4mai8hdi.ctr
+++ b/support/dktools/dk4mai8hdi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -71,6 +83,15 @@ dk4ma_input_c8_hex_dk4_im_t(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdu.h"
#include "dk4mai8hdi.h"
#include "dk4numco.h"
@@ -94,6 +115,10 @@ dk4ma_input_c8_hex_dk4_im_t(
const char *ep = NULL;
int back = 0;
$? "+ dk4ma_input_c8_hex_dk4_im_t \"%!8s\" %d", src, atg
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if ('-' == *src) { $? ". negative"
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, ++src, &ep, atg, erp)) {
diff --git a/support/dktools/dk4mai8hdi.h b/support/dktools/dk4mai8hdi.h
index 87ad665181..7e9262881c 100644
--- a/support/dktools/dk4mai8hdi.h
+++ b/support/dktools/dk4mai8hdi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hdi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hdi.ctr
*/
#ifndef DK4MAI8HDI_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4mai8hdu.c b/support/dktools/dk4mai8hdu.c
index 433341727b..e1f153c1b8 100644
--- a/support/dktools/dk4mai8hdu.c
+++ b/support/dktools/dk4mai8hdu.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hdu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hdu.ctr
*/
/** @file dk4mai8hdu.c The dk4mai8hdu module.
*/
-#line 72 "dk4mai8hdu.ctr"
+#line 84 "dk4mai8hdu.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdu.h"
#include "dk4numco.h"
@@ -47,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 80 "dk4mai8hdu.ctr"
+#line 101 "dk4mai8hdu.ctr"
@@ -71,7 +58,11 @@ dk4ma_input_c8_hex_dk4_um_t(
int cc = 1;
-#line 102 "dk4mai8hdu.ctr"
+#line 123 "dk4mai8hdu.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if ('0' == src[0]) {
if (('x' == src[1]) || ('X' == src[1])) { src++; src++; }
@@ -82,7 +73,7 @@ dk4ma_input_c8_hex_dk4_um_t(
do {
-#line 111 "dk4mai8hdu.ctr"
+#line 136 "dk4mai8hdu.ctr"
op = (dk4_um_t)0UL;
switch (*src) {
case '0': { op = (dk4_um_t)0UL; } break;
@@ -103,16 +94,16 @@ dk4ma_input_c8_hex_dk4_um_t(
case 'f': case 'F': { op = (dk4_um_t)15UL; } break;
case '\0': {
-#line 130 "dk4mai8hdu.ctr"
+#line 155 "dk4mai8hdu.ctr"
cc = 0;
if (0 != found) {
-#line 132 "dk4mai8hdu.ctr"
+#line 157 "dk4mai8hdu.ctr"
back = 1;
*rp = result;
} else {
-#line 135 "dk4mai8hdu.ctr"
+#line 160 "dk4mai8hdu.ctr"
ep = src;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
@@ -183,7 +174,7 @@ dk4ma_input_c8_hex_dk4_um_t(
if (NULL != endptr) { *endptr = ep; }
-#line 204 "dk4mai8hdu.ctr"
+#line 229 "dk4mai8hdu.ctr"
return back;
}
diff --git a/support/dktools/dk4mai8hdu.ctr b/support/dktools/dk4mai8hdu.ctr
index 186ef9f8e5..a6a9f2648e 100644
--- a/support/dktools/dk4mai8hdu.ctr
+++ b/support/dktools/dk4mai8hdu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -70,6 +82,15 @@ dk4ma_input_c8_hex_dk4_um_t(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdu.h"
#include "dk4numco.h"
#include "dk4str8.h"
@@ -99,6 +120,10 @@ dk4ma_input_c8_hex_dk4_um_t(
int back = 0;
int cc = 1;
$? "+ dk4ma_input_c8_hex_dk4_um_t \"%!8s\"", src
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if ('0' == src[0]) {
if (('x' == src[1]) || ('X' == src[1])) { src++; src++; }
diff --git a/support/dktools/dk4mai8hdu.h b/support/dktools/dk4mai8hdu.h
index b22a9a0d0e..da161e76c0 100644
--- a/support/dktools/dk4mai8hdu.h
+++ b/support/dktools/dk4mai8hdu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hdu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hdu.ctr
*/
#ifndef DK4MAI8HDU_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4mai8hic.c b/support/dktools/dk4mai8hic.c
index d49fc6ff22..d2840ff317 100644
--- a/support/dktools/dk4mai8hic.c
+++ b/support/dktools/dk4mai8hic.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hic.ctr
*/
/** @file dk4mai8hic.c The dk4mai8hic module.
*/
-#line 70 "dk4mai8hic.ctr"
+#line 82 "dk4mai8hic.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hic.h"
#include "dk4mai8hdi.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_hex_char(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(CHAR_MIN) <= res) && ((dk4_im_t)(CHAR_MAX) >= res)) {
*rp = (signed char)res;
diff --git a/support/dktools/dk4mai8hic.ctr b/support/dktools/dk4mai8hic.ctr
index 0d988de2f6..6da33412c5 100644
--- a/support/dktools/dk4mai8hic.ctr
+++ b/support/dktools/dk4mai8hic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_hex_char(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hic.h"
#include "dk4mai8hdi.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_hex_char(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(CHAR_MIN) <= res) && ((dk4_im_t)(CHAR_MAX) >= res)) {
*rp = (signed char)res;
diff --git a/support/dktools/dk4mai8hic.h b/support/dktools/dk4mai8hic.h
index e2a8e044df..a6e0137cd9 100644
--- a/support/dktools/dk4mai8hic.h
+++ b/support/dktools/dk4mai8hic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hic.ctr
*/
#ifndef DK4MAI8HIC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hii.c b/support/dktools/dk4mai8hii.c
index 09191a0d35..045a27d5e5 100644
--- a/support/dktools/dk4mai8hii.c
+++ b/support/dktools/dk4mai8hii.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hii.ctr
*/
/** @file dk4mai8hii.c The dk4mai8hii module.
*/
-#line 70 "dk4mai8hii.ctr"
+#line 82 "dk4mai8hii.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdi.h"
#include "dk4mai8hii.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_hex_int(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(INT_MIN) <= res) && (((dk4_im_t)(INT_MAX)) >= res)) {
*rp = (int)res;
diff --git a/support/dktools/dk4mai8hii.ctr b/support/dktools/dk4mai8hii.ctr
index 62fe02efd1..f7951ca2da 100644
--- a/support/dktools/dk4mai8hii.ctr
+++ b/support/dktools/dk4mai8hii.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_hex_int(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdi.h"
#include "dk4mai8hii.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_hex_int(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(INT_MIN) <= res) && (((dk4_im_t)(INT_MAX)) >= res)) {
*rp = (int)res;
diff --git a/support/dktools/dk4mai8hii.h b/support/dktools/dk4mai8hii.h
index 24178bde5b..663e06ba68 100644
--- a/support/dktools/dk4mai8hii.h
+++ b/support/dktools/dk4mai8hii.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hii.ctr
*/
#ifndef DK4MAI8HII_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hil.c b/support/dktools/dk4mai8hil.c
index 3323b55df8..7425c138e3 100644
--- a/support/dktools/dk4mai8hil.c
+++ b/support/dktools/dk4mai8hil.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hil.ctr
*/
/** @file dk4mai8hil.c The dk4mai8hil module.
*/
-#line 70 "dk4mai8hil.ctr"
+#line 82 "dk4mai8hil.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdi.h"
#include "dk4mai8hil.h"
@@ -57,6 +44,10 @@ dk4ma_input_c8_hex_long(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LONG_MIN) <= res) && (((dk4_im_t)(LONG_MAX)) >= res)) {
*rp = (long)res;
@@ -67,6 +58,10 @@ dk4ma_input_c8_hex_long(
}
return back;
#else
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_hex_dk4_im_t(rp, src, endptr, atg, erp));
#endif
}
diff --git a/support/dktools/dk4mai8hil.ctr b/support/dktools/dk4mai8hil.ctr
index cba14b8b6d..b9fbf01e7d 100644
--- a/support/dktools/dk4mai8hil.ctr
+++ b/support/dktools/dk4mai8hil.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_hex_long(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdi.h"
#include "dk4mai8hil.h"
#include "dk4numco.h"
@@ -86,6 +107,10 @@ dk4ma_input_c8_hex_long(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LONG_MIN) <= res) && (((dk4_im_t)(LONG_MAX)) >= res)) {
*rp = (long)res;
@@ -96,6 +121,10 @@ dk4ma_input_c8_hex_long(
}
return back;
#else
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_hex_dk4_im_t(rp, src, endptr, atg, erp));
#endif
}
diff --git a/support/dktools/dk4mai8hil.h b/support/dktools/dk4mai8hil.h
index 45734f59a0..96ce5c73f5 100644
--- a/support/dktools/dk4mai8hil.h
+++ b/support/dktools/dk4mai8hil.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hil.ctr
*/
#ifndef DK4MAI8HIL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8his.c b/support/dktools/dk4mai8his.c
index d1f7ddec7a..3352269aa3 100644
--- a/support/dktools/dk4mai8his.c
+++ b/support/dktools/dk4mai8his.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8his.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8his.ctr
*/
/** @file dk4mai8his.c The dk4mai8his module.
*/
-#line 70 "dk4mai8his.ctr"
+#line 82 "dk4mai8his.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdi.h"
#include "dk4mai8his.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_hex_short(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(SHRT_MIN) <= res) && (((dk4_im_t)(SHRT_MAX)) >= res)) {
*rp = (short)res;
diff --git a/support/dktools/dk4mai8his.ctr b/support/dktools/dk4mai8his.ctr
index 60377dbb72..0fee43eba5 100644
--- a/support/dktools/dk4mai8his.ctr
+++ b/support/dktools/dk4mai8his.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_hex_short(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdi.h"
#include "dk4mai8his.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_hex_short(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(SHRT_MIN) <= res) && (((dk4_im_t)(SHRT_MAX)) >= res)) {
*rp = (short)res;
diff --git a/support/dktools/dk4mai8his.h b/support/dktools/dk4mai8his.h
index c0d3fb3a2c..33deb4b547 100644
--- a/support/dktools/dk4mai8his.h
+++ b/support/dktools/dk4mai8his.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8his.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8his.ctr
*/
#ifndef DK4MAI8HIS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hli.c b/support/dktools/dk4mai8hli.c
index 17de979c19..148c435ec4 100644
--- a/support/dktools/dk4mai8hli.c
+++ b/support/dktools/dk4mai8hli.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hli.ctr
*/
/** @file dk4mai8hli.c The dk4mai8hli module.
*/
-#line 74 "dk4mai8hli.ctr"
+#line 86 "dk4mai8hli.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4mai8hdi.h"
@@ -61,6 +46,10 @@ dk4ma_input_c8_hex_ll(
#if DK4_HAVE_INTMAX_T
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LLONG_MIN) <= res) && (((dk4_im_t)(LLONG_MAX)) >= res)) {
*rp = (long long)res;
@@ -71,6 +60,10 @@ dk4ma_input_c8_hex_ll(
}
return back;
#else
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_hex_dk4_im_t(rp, src, endptr, atg, erp));
#endif
}
diff --git a/support/dktools/dk4mai8hli.ctr b/support/dktools/dk4mai8hli.ctr
index 49aa35a000..2c95cbd7a8 100644
--- a/support/dktools/dk4mai8hli.ctr
+++ b/support/dktools/dk4mai8hli.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -74,6 +86,13 @@ dk4ma_input_c8_hex_ll(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4mai8hdi.h"
@@ -94,6 +113,10 @@ dk4ma_input_c8_hex_ll(
#if DK4_HAVE_INTMAX_T
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LLONG_MIN) <= res) && (((dk4_im_t)(LLONG_MAX)) >= res)) {
*rp = (long long)res;
@@ -104,6 +127,10 @@ dk4ma_input_c8_hex_ll(
}
return back;
#else
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_hex_dk4_im_t(rp, src, endptr, atg, erp));
#endif
}
diff --git a/support/dktools/dk4mai8hli.h b/support/dktools/dk4mai8hli.h
index 02d2066981..6ffe9e684c 100644
--- a/support/dktools/dk4mai8hli.h
+++ b/support/dktools/dk4mai8hli.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hli.ctr
*/
#ifndef DK4MAI8HLI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hlu.c b/support/dktools/dk4mai8hlu.c
index c915858414..2ae2ffe228 100644
--- a/support/dktools/dk4mai8hlu.c
+++ b/support/dktools/dk4mai8hlu.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hlu.ctr
*/
/** @file dk4mai8hlu.c The dk4mai8hlu module.
*/
-#line 74 "dk4mai8hlu.ctr"
+#line 86 "dk4mai8hlu.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4mai8hdu.h"
@@ -61,6 +46,10 @@ dk4ma_input_c8_hex_ull(
#if DK4_HAVE_INTMAX_T
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULLONG_MAX)) >= res) {
*rp = (unsigned long long)res;
diff --git a/support/dktools/dk4mai8hlu.ctr b/support/dktools/dk4mai8hlu.ctr
index a718017d92..c0bbf604e8 100644
--- a/support/dktools/dk4mai8hlu.ctr
+++ b/support/dktools/dk4mai8hlu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -74,6 +86,13 @@ dk4ma_input_c8_hex_ull(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4mai8hdu.h"
@@ -94,6 +113,10 @@ dk4ma_input_c8_hex_ull(
#if DK4_HAVE_INTMAX_T
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULLONG_MAX)) >= res) {
*rp = (unsigned long long)res;
diff --git a/support/dktools/dk4mai8hlu.h b/support/dktools/dk4mai8hlu.h
index 4cbd2f5056..eb60c3c2ab 100644
--- a/support/dktools/dk4mai8hlu.h
+++ b/support/dktools/dk4mai8hlu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hlu.ctr
*/
#ifndef DK4MAI8HLU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hmi.c b/support/dktools/dk4mai8hmi.c
index 5620935d2c..99a39b48f8 100644
--- a/support/dktools/dk4mai8hmi.c
+++ b/support/dktools/dk4mai8hmi.c
@@ -1,47 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hmi.ctr
*/
/** @file dk4mai8hmi.c The dk4mai8hmi module.
*/
-#line 75 "dk4mai8hmi.ctr"
+#line 87 "dk4mai8hmi.ctr"
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -59,6 +48,10 @@ dk4ma_input_c8_hex_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_hex_dk4_im_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4mai8hmi.ctr b/support/dktools/dk4mai8hmi.ctr
index 82d56c938f..80e5448763 100644
--- a/support/dktools/dk4mai8hmi.ctr
+++ b/support/dktools/dk4mai8hmi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -75,7 +87,18 @@ dk4ma_input_c8_hex_intmax_t(
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -93,6 +116,10 @@ dk4ma_input_c8_hex_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_hex_dk4_im_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4mai8hmi.h b/support/dktools/dk4mai8hmi.h
index 082284bc43..a5e7a73427 100644
--- a/support/dktools/dk4mai8hmi.h
+++ b/support/dktools/dk4mai8hmi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hmi.ctr
*/
#ifndef DK4MAI8HMI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hmu.c b/support/dktools/dk4mai8hmu.c
index 2828d6103d..442a3b37c5 100644
--- a/support/dktools/dk4mai8hmu.c
+++ b/support/dktools/dk4mai8hmu.c
@@ -1,47 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hmu.ctr
*/
/** @file dk4mai8hmu.c The dk4mai8hmu module.
*/
-#line 75 "dk4mai8hmu.ctr"
+#line 87 "dk4mai8hmu.ctr"
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -59,6 +48,10 @@ dk4ma_input_c8_hex_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_hex_dk4_um_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4mai8hmu.ctr b/support/dktools/dk4mai8hmu.ctr
index 44dd60d2ca..bb5633847c 100644
--- a/support/dktools/dk4mai8hmu.ctr
+++ b/support/dktools/dk4mai8hmu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -75,7 +87,18 @@ dk4ma_input_c8_hex_uintmax_t(
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -93,6 +116,10 @@ dk4ma_input_c8_hex_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_c8_hex_dk4_um_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4mai8hmu.h b/support/dktools/dk4mai8hmu.h
index da689b7b79..efad8f294f 100644
--- a/support/dktools/dk4mai8hmu.h
+++ b/support/dktools/dk4mai8hmu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hmu.ctr
*/
#ifndef DK4MAI8HMU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8huc.c b/support/dktools/dk4mai8huc.c
index d504abac5a..af9e2199cc 100644
--- a/support/dktools/dk4mai8huc.c
+++ b/support/dktools/dk4mai8huc.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8huc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8huc.ctr
*/
/** @file dk4mai8huc.c The dk4mai8huc module.
*/
-#line 70 "dk4mai8huc.ctr"
+#line 82 "dk4mai8huc.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdu.h"
#include "dk4mai8huc.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_hex_uchar(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UCHAR_MAX)) >= res) {
*rp = (unsigned char)res;
diff --git a/support/dktools/dk4mai8huc.ctr b/support/dktools/dk4mai8huc.ctr
index 96c2311b02..9d429ed1ad 100644
--- a/support/dktools/dk4mai8huc.ctr
+++ b/support/dktools/dk4mai8huc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_hex_uchar(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdu.h"
#include "dk4mai8huc.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_hex_uchar(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UCHAR_MAX)) >= res) {
*rp = (unsigned char)res;
diff --git a/support/dktools/dk4mai8huc.h b/support/dktools/dk4mai8huc.h
index 6ce2d4ba03..1f085c6f42 100644
--- a/support/dktools/dk4mai8huc.h
+++ b/support/dktools/dk4mai8huc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8huc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8huc.ctr
*/
#ifndef DK4MAI8HUC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hui.c b/support/dktools/dk4mai8hui.c
index adc6d21d22..5f07d7840c 100644
--- a/support/dktools/dk4mai8hui.c
+++ b/support/dktools/dk4mai8hui.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hui.ctr
*/
/** @file dk4mai8hui.c The dk4mai8hui module.
*/
-#line 70 "dk4mai8hui.ctr"
+#line 82 "dk4mai8hui.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdu.h"
#include "dk4mai8hui.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_hex_uint(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UINT_MAX)) >= res) {
*rp = (unsigned)res;
diff --git a/support/dktools/dk4mai8hui.ctr b/support/dktools/dk4mai8hui.ctr
index 7329956fbd..f77d9a8fdb 100644
--- a/support/dktools/dk4mai8hui.ctr
+++ b/support/dktools/dk4mai8hui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_hex_uint(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdu.h"
#include "dk4mai8hui.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_hex_uint(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UINT_MAX)) >= res) {
*rp = (unsigned)res;
diff --git a/support/dktools/dk4mai8hui.h b/support/dktools/dk4mai8hui.h
index ee5e116912..514bc97bc0 100644
--- a/support/dktools/dk4mai8hui.h
+++ b/support/dktools/dk4mai8hui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hui.ctr
*/
#ifndef DK4MAI8HUI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hul.c b/support/dktools/dk4mai8hul.c
index 6b9afd3cc9..8c9959e13c 100644
--- a/support/dktools/dk4mai8hul.c
+++ b/support/dktools/dk4mai8hul.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hul.ctr
*/
/** @file dk4mai8hul.c The dk4mai8hul module.
*/
-#line 70 "dk4mai8hul.ctr"
+#line 82 "dk4mai8hul.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdu.h"
#include "dk4mai8hul.h"
@@ -57,6 +44,10 @@ dk4ma_input_c8_hex_ulong(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULONG_MAX)) >= res) {
*rp = (unsigned long)res;
diff --git a/support/dktools/dk4mai8hul.ctr b/support/dktools/dk4mai8hul.ctr
index 2acd9f2e6c..3a878dede5 100644
--- a/support/dktools/dk4mai8hul.ctr
+++ b/support/dktools/dk4mai8hul.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_hex_ulong(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdu.h"
#include "dk4mai8hul.h"
#include "dk4numco.h"
@@ -86,6 +107,10 @@ dk4ma_input_c8_hex_ulong(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULONG_MAX)) >= res) {
*rp = (unsigned long)res;
diff --git a/support/dktools/dk4mai8hul.h b/support/dktools/dk4mai8hul.h
index 51f5424a5d..e437689dae 100644
--- a/support/dktools/dk4mai8hul.h
+++ b/support/dktools/dk4mai8hul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hul.ctr
*/
#ifndef DK4MAI8HUL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mai8hus.c b/support/dktools/dk4mai8hus.c
index d13e482357..d3d9f195ea 100644
--- a/support/dktools/dk4mai8hus.c
+++ b/support/dktools/dk4mai8hus.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hus.ctr
*/
/** @file dk4mai8hus.c The dk4mai8hus module.
*/
-#line 70 "dk4mai8hus.ctr"
+#line 82 "dk4mai8hus.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mai8hdu.h"
#include "dk4mai8hus.h"
@@ -56,6 +43,10 @@ dk4ma_input_c8_hex_ushort(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(USHRT_MAX)) >= res) {
*rp = (unsigned short)res;
diff --git a/support/dktools/dk4mai8hus.ctr b/support/dktools/dk4mai8hus.ctr
index 15c60d75b3..4688b19e97 100644
--- a/support/dktools/dk4mai8hus.ctr
+++ b/support/dktools/dk4mai8hus.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_c8_hex_ushort(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mai8hdu.h"
#include "dk4mai8hus.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_c8_hex_ushort(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_c8_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(USHRT_MAX)) >= res) {
*rp = (unsigned short)res;
diff --git a/support/dktools/dk4mai8hus.h b/support/dktools/dk4mai8hus.h
index 9b3eb556ce..f01b8438e5 100644
--- a/support/dktools/dk4mai8hus.h
+++ b/support/dktools/dk4mai8hus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mai8hus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mai8hus.ctr
*/
#ifndef DK4MAI8HUS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiddbl.c b/support/dktools/dk4maiddbl.c
index 9a2a7f02ec..e17c7aaa05 100644
--- a/support/dktools/dk4maiddbl.c
+++ b/support/dktools/dk4maiddbl.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddbl.ctr
*/
/** @file dk4maiddbl.c The dk4maiddbl module.
*/
-#line 77 "dk4maiddbl.ctr"
+#line 91 "dk4maiddbl.ctr"
+#include "dk4conf.h"
#include "dk4maiddbl.h"
#if DK4_CHAR_SIZE > 1
@@ -47,6 +26,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dbl.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
dk4ma_input_dk_double(
double *rp,
@@ -56,6 +42,10 @@ dk4ma_input_dk_double(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_input_wc_double(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddbl.ctr b/support/dktools/dk4maiddbl.ctr
index 030b7adfc3..ccb095ae70 100644
--- a/support/dktools/dk4maiddbl.ctr
+++ b/support/dktools/dk4maiddbl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -34,6 +46,8 @@ extern "C" {
The function temporarily resets the LC_NUMERIC locale setting
to "C" to retrieve the number and returns the setting to the
original value before returning.
+
+ CRT on Windows: Required.
@param rp Address of result variable.
@param src String to process.
@param endptr Address of pointer variable.
@@ -75,6 +89,7 @@ dk4ma_input_dk_double(
%% module
+#include "dk4conf.h"
#include "dk4maiddbl.h"
#if DK4_CHAR_SIZE > 1
@@ -83,6 +98,13 @@ dk4ma_input_dk_double(
#include "dk4mai8dbl.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
dk4ma_input_dk_double(
double *rp,
@@ -92,6 +114,10 @@ dk4ma_input_dk_double(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_input_wc_double(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddbl.h b/support/dktools/dk4maiddbl.h
index 5adb784b6e..be3f886f72 100644
--- a/support/dktools/dk4maiddbl.h
+++ b/support/dktools/dk4maiddbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddbl.ctr
*/
#ifndef DK4MAIDDBL_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +56,8 @@ extern "C" {
The function temporarily resets the LC_NUMERIC locale setting
to "C" to retrieve the number and returns the setting to the
original value before returning.
+
+ CRT on Windows: Required.
@param rp Address of result variable.
@param src String to process.
@param endptr Address of pointer variable.
diff --git a/support/dktools/dk4maidddi.c b/support/dktools/dk4maidddi.c
index 107441cf52..3dc27f79b1 100644
--- a/support/dktools/dk4maidddi.c
+++ b/support/dktools/dk4maidddi.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidddi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidddi.ctr
*/
/** @file dk4maidddi.c The dk4maidddi module.
*/
-#line 68 "dk4maidddi.ctr"
+#line 80 "dk4maidddi.ctr"
+#include "dk4conf.h"
#include "dk4maidddi.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8ddi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_dk4_im_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_input_wc_dec_dk4_im_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidddi.ctr b/support/dktools/dk4maidddi.ctr
index c04b3d8655..adf3466476 100644
--- a/support/dktools/dk4maidddi.ctr
+++ b/support/dktools/dk4maidddi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_dk4_im_t(
%% module
+#include "dk4conf.h"
#include "dk4maidddi.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_dk4_im_t(
#include "dk4mai8ddi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_dk4_im_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_input_wc_dec_dk4_im_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidddi.h b/support/dktools/dk4maidddi.h
index a5e1c6ba94..b923f06c84 100644
--- a/support/dktools/dk4maidddi.h
+++ b/support/dktools/dk4maidddi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidddi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidddi.ctr
*/
#ifndef DK4MAIDDDI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidddu.c b/support/dktools/dk4maidddu.c
index bf7885999a..27bef95464 100644
--- a/support/dktools/dk4maidddu.c
+++ b/support/dktools/dk4maidddu.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidddu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidddu.ctr
*/
/** @file dk4maidddu.c The dk4maidddu module.
*/
-#line 68 "dk4maidddu.ctr"
+#line 80 "dk4maidddu.ctr"
+#include "dk4conf.h"
#include "dk4maidddu.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8ddu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_dk4_um_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_dk4_um_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidddu.ctr b/support/dktools/dk4maidddu.ctr
index 9c6a5ac45c..a9fe10045c 100644
--- a/support/dktools/dk4maidddu.ctr
+++ b/support/dktools/dk4maidddu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_dk4_um_t(
%% module
+#include "dk4conf.h"
#include "dk4maidddu.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_dk4_um_t(
#include "dk4mai8ddu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_dk4_um_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_dk4_um_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidddu.h b/support/dktools/dk4maidddu.h
index c6a7f44836..9ed2116702 100644
--- a/support/dktools/dk4maidddu.h
+++ b/support/dktools/dk4maidddu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidddu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidddu.ctr
*/
#ifndef DK4MAIDDDU_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddic.c b/support/dktools/dk4maiddic.c
index fb26d080aa..c85fd283d8 100644
--- a/support/dktools/dk4maiddic.c
+++ b/support/dktools/dk4maiddic.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddic.ctr
*/
/** @file dk4maiddic.c The dk4maiddic module.
*/
-#line 68 "dk4maiddic.ctr"
+#line 80 "dk4maiddic.ctr"
+#include "dk4conf.h"
#include "dk4maiddic.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dic.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_char(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_char(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddic.ctr b/support/dktools/dk4maiddic.ctr
index 88adb8b252..7f31ea9cc6 100644
--- a/support/dktools/dk4maiddic.ctr
+++ b/support/dktools/dk4maiddic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_char(
%% module
+#include "dk4conf.h"
#include "dk4maiddic.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_char(
#include "dk4mai8dic.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_char(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_char(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddic.h b/support/dktools/dk4maiddic.h
index f848167537..64e0539bc2 100644
--- a/support/dktools/dk4maiddic.h
+++ b/support/dktools/dk4maiddic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddic.ctr
*/
#ifndef DK4MAIDDIC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddii.c b/support/dktools/dk4maiddii.c
index 632fb7c549..1c3b06020e 100644
--- a/support/dktools/dk4maiddii.c
+++ b/support/dktools/dk4maiddii.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddii.ctr
*/
/** @file dk4maiddii.c The dk4maiddii module.
*/
-#line 68 "dk4maiddii.ctr"
+#line 80 "dk4maiddii.ctr"
+#include "dk4conf.h"
#include "dk4maiddii.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dii.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_int(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_int(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddii.ctr b/support/dktools/dk4maiddii.ctr
index 35b89c182c..b15d285a3e 100644
--- a/support/dktools/dk4maiddii.ctr
+++ b/support/dktools/dk4maiddii.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_int(
%% module
+#include "dk4conf.h"
#include "dk4maiddii.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_int(
#include "dk4mai8dii.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_int(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_int(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddii.h b/support/dktools/dk4maiddii.h
index a8b54fd3e4..cb42a6039e 100644
--- a/support/dktools/dk4maiddii.h
+++ b/support/dktools/dk4maiddii.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddii.ctr
*/
#ifndef DK4MAIDDII_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddil.c b/support/dktools/dk4maiddil.c
index 4767ef2cc1..db25569e42 100644
--- a/support/dktools/dk4maiddil.c
+++ b/support/dktools/dk4maiddil.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddil.ctr
*/
/** @file dk4maiddil.c The dk4maiddil module.
*/
-#line 68 "dk4maiddil.ctr"
+#line 80 "dk4maiddil.ctr"
+#include "dk4conf.h"
#include "dk4maiddil.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dil.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_long(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_long(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddil.ctr b/support/dktools/dk4maiddil.ctr
index 956a549d22..ef4ffd4719 100644
--- a/support/dktools/dk4maiddil.ctr
+++ b/support/dktools/dk4maiddil.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_long(
%% module
+#include "dk4conf.h"
#include "dk4maiddil.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_long(
#include "dk4mai8dil.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_long(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_long(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddil.h b/support/dktools/dk4maiddil.h
index 6795a6b842..4170be687e 100644
--- a/support/dktools/dk4maiddil.h
+++ b/support/dktools/dk4maiddil.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddil.ctr
*/
#ifndef DK4MAIDDIL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddis.c b/support/dktools/dk4maiddis.c
index bb28e3b586..22d879d9cb 100644
--- a/support/dktools/dk4maiddis.c
+++ b/support/dktools/dk4maiddis.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddis.ctr
*/
/** @file dk4maiddis.c The dk4maiddis module.
*/
-#line 68 "dk4maiddis.ctr"
+#line 80 "dk4maiddis.ctr"
+#include "dk4conf.h"
#include "dk4maiddis.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dis.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_short(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_short(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddis.ctr b/support/dktools/dk4maiddis.ctr
index 751df1586f..5898f17635 100644
--- a/support/dktools/dk4maiddis.ctr
+++ b/support/dktools/dk4maiddis.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_short(
%% module
+#include "dk4conf.h"
#include "dk4maiddis.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_short(
#include "dk4mai8dis.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_short(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_short(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddis.h b/support/dktools/dk4maiddis.h
index 3dd73ebe87..13ac6f6ff5 100644
--- a/support/dktools/dk4maiddis.h
+++ b/support/dktools/dk4maiddis.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddis.ctr
*/
#ifndef DK4MAIDDIS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddli.c b/support/dktools/dk4maiddli.c
index 137daa15f2..9e00c57817 100644
--- a/support/dktools/dk4maiddli.c
+++ b/support/dktools/dk4maiddli.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddli.ctr
*/
/** @file dk4maiddli.c The dk4maiddli module.
*/
-#line 68 "dk4maiddli.ctr"
+#line 80 "dk4maiddli.ctr"
+#include "dk4conf.h"
#include "dk4maiddli.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dli.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_ll(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_ll(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddli.ctr b/support/dktools/dk4maiddli.ctr
index 2df351cc05..6fd799bcea 100644
--- a/support/dktools/dk4maiddli.ctr
+++ b/support/dktools/dk4maiddli.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_ll(
%% module
+#include "dk4conf.h"
#include "dk4maiddli.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_ll(
#include "dk4mai8dli.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_ll(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_ll(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddli.h b/support/dktools/dk4maiddli.h
index caa186ec27..214722a7d6 100644
--- a/support/dktools/dk4maiddli.h
+++ b/support/dktools/dk4maiddli.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddli.ctr
*/
#ifndef DK4MAIDDLI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddlu.c b/support/dktools/dk4maiddlu.c
index 44b87745f6..39bc932d0c 100644
--- a/support/dktools/dk4maiddlu.c
+++ b/support/dktools/dk4maiddlu.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddlu.ctr
*/
/** @file dk4maiddlu.c The dk4maiddlu module.
*/
-#line 68 "dk4maiddlu.ctr"
+#line 80 "dk4maiddlu.ctr"
+#include "dk4conf.h"
#include "dk4maiddlu.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dlu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_ull(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_ull(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddlu.ctr b/support/dktools/dk4maiddlu.ctr
index e2f21e70ab..d7a689d4c8 100644
--- a/support/dktools/dk4maiddlu.ctr
+++ b/support/dktools/dk4maiddlu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_ull(
%% module
+#include "dk4conf.h"
#include "dk4maiddlu.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_ull(
#include "dk4mai8dlu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_ull(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_ull(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddlu.h b/support/dktools/dk4maiddlu.h
index 5488564746..8525e36530 100644
--- a/support/dktools/dk4maiddlu.h
+++ b/support/dktools/dk4maiddlu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddlu.ctr
*/
#ifndef DK4MAIDDLU_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddmi.c b/support/dktools/dk4maiddmi.c
index 0df99ed896..da4f7dff1a 100644
--- a/support/dktools/dk4maiddmi.c
+++ b/support/dktools/dk4maiddmi.c
@@ -1,47 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddmi.ctr
*/
/** @file dk4maiddmi.c The dk4maiddmi module.
*/
-#line 71 "dk4maiddmi.ctr"
+#line 83 "dk4maiddmi.ctr"
+
+#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4MAIDDMI_H_INCLUDED
#include "dk4maiddmi.h"
+#endif
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -57,6 +43,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dmi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -68,6 +60,10 @@ dk4ma_input_dk_dec_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_intmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddmi.ctr b/support/dktools/dk4maiddmi.ctr
index 6a38f39640..0eb93a5195 100644
--- a/support/dktools/dk4maiddmi.ctr
+++ b/support/dktools/dk4maiddmi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -69,9 +81,17 @@ dk4ma_input_dk_dec_intmax_t(
%% module
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4MAIDDMI_H_INCLUDED
#include "dk4maiddmi.h"
+#endif
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -87,6 +107,12 @@ dk4ma_input_dk_dec_intmax_t(
#include "dk4mai8dmi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -98,6 +124,10 @@ dk4ma_input_dk_dec_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_intmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddmi.h b/support/dktools/dk4maiddmi.h
index e6b4dc3c16..a2674b7309 100644
--- a/support/dktools/dk4maiddmi.h
+++ b/support/dktools/dk4maiddmi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddmi.ctr
*/
#ifndef DK4MAIDDMI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddmu.c b/support/dktools/dk4maiddmu.c
index 55810b3e2f..996b4c8c90 100644
--- a/support/dktools/dk4maiddmu.c
+++ b/support/dktools/dk4maiddmu.c
@@ -1,47 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddmu.ctr
*/
/** @file dk4maiddmu.c The dk4maiddmu module.
*/
-#line 72 "dk4maiddmu.ctr"
+#line 84 "dk4maiddmu.ctr"
+
+#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4MAIDDMU_H_INCLUDED
#include "dk4maiddmu.h"
+#endif
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -59,6 +45,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dmu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +62,10 @@ dk4ma_input_dk_dec_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_uintmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddmu.ctr b/support/dktools/dk4maiddmu.ctr
index a4b8577657..473c6600b4 100644
--- a/support/dktools/dk4maiddmu.ctr
+++ b/support/dktools/dk4maiddmu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -70,9 +82,17 @@ dk4ma_input_dk_dec_uintmax_t(
%% module
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4MAIDDMU_H_INCLUDED
#include "dk4maiddmu.h"
+#endif
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -90,6 +110,12 @@ dk4ma_input_dk_dec_uintmax_t(
#include "dk4mai8dmu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -101,6 +127,10 @@ dk4ma_input_dk_dec_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_uintmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddmu.h b/support/dktools/dk4maiddmu.h
index c8cd691b0a..6539be8dbd 100644
--- a/support/dktools/dk4maiddmu.h
+++ b/support/dktools/dk4maiddmu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddmu.ctr
*/
#ifndef DK4MAIDDMU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddsz.c b/support/dktools/dk4maiddsz.c
index 098248bc0a..bcaf50e114 100644
--- a/support/dktools/dk4maiddsz.c
+++ b/support/dktools/dk4maiddsz.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddsz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddsz.ctr
*/
/** @file dk4maiddsz.c The dk4maiddsz module.
*/
-#line 68 "dk4maiddsz.ctr"
+#line 117 "dk4maiddsz.ctr"
+#include "dk4conf.h"
#include "dk4maiddsz.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dsz.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_size_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_size_t(rp, src, endptr, atg, erp));
#else
@@ -69,3 +58,24 @@ dk4ma_input_dk_dec_size_t(
#endif
}
+
+
+int
+dk4ma_input_dk_dec_size_t_simple(
+ size_t *rp,
+ const dkChar *src,
+ const dkChar **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return ( dk4ma_input_wc_dec_size_t_simple(rp, src, endptr, atg, erp));
+#else
+ return ( dk4ma_input_c8_dec_size_t_simple(rp, src, endptr, atg, erp));
+#endif
+}
diff --git a/support/dktools/dk4maiddsz.ctr b/support/dktools/dk4maiddsz.ctr
index f284ae79c1..8bea509f83 100644
--- a/support/dktools/dk4maiddsz.ctr
+++ b/support/dktools/dk4maiddsz.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -32,6 +44,13 @@ extern "C" {
/** Retrieve numeric value from string, decimal notation.
@param rp Pointer to result variable for the found value.
@param src String to check for numeric value.
+ In addition to the numeric value the string can
+ contain a suffix 'K', 'M', 'G', 'T', 'P', 'E',
+ 'Z' or 'Y' to indicate multiples of powers of 1024
+ (kibibytes, mibibytes...).
+ Suffixes 'k', 'm', 'g', 't', 'p', 'e', 'z' or 'y'
+ indicate multiples of powers of 1000
+ (kilobytes, megabytes...).
@param endptr Address of pointer variable.
A pointer to the first character not processed
is stored here.
@@ -58,6 +77,36 @@ dk4ma_input_dk_dec_size_t(
dk4_er_t *erp
);
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+
+int
+dk4ma_input_dk_dec_size_t_simple(
+ size_t *rp,
+ const dkChar *src,
+ const dkChar **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
@@ -66,6 +115,7 @@ dk4ma_input_dk_dec_size_t(
%% module
+#include "dk4conf.h"
#include "dk4maiddsz.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +128,12 @@ dk4ma_input_dk_dec_size_t(
#include "dk4mai8dsz.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +145,10 @@ dk4ma_input_dk_dec_size_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_size_t(rp, src, endptr, atg, erp));
#else
@@ -96,3 +156,24 @@ dk4ma_input_dk_dec_size_t(
#endif
}
+
+
+int
+dk4ma_input_dk_dec_size_t_simple(
+ size_t *rp,
+ const dkChar *src,
+ const dkChar **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return ( dk4ma_input_wc_dec_size_t_simple(rp, src, endptr, atg, erp));
+#else
+ return ( dk4ma_input_c8_dec_size_t_simple(rp, src, endptr, atg, erp));
+#endif
+}
diff --git a/support/dktools/dk4maiddsz.h b/support/dktools/dk4maiddsz.h
index 8b367e5bfe..75d1133c71 100644
--- a/support/dktools/dk4maiddsz.h
+++ b/support/dktools/dk4maiddsz.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddsz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddsz.ctr
*/
#ifndef DK4MAIDDSZ_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -64,6 +54,13 @@ extern "C" {
/** Retrieve numeric value from string, decimal notation.
@param rp Pointer to result variable for the found value.
@param src String to check for numeric value.
+ In addition to the numeric value the string can
+ contain a suffix 'K', 'M', 'G', 'T', 'P', 'E',
+ 'Z' or 'Y' to indicate multiples of powers of 1024
+ (kibibytes, mibibytes...).
+ Suffixes 'k', 'm', 'g', 't', 'p', 'e', 'z' or 'y'
+ indicate multiples of powers of 1000
+ (kilobytes, megabytes...).
@param endptr Address of pointer variable.
A pointer to the first character not processed
is stored here.
@@ -90,6 +87,36 @@ dk4ma_input_dk_dec_size_t(
dk4_er_t *erp
);
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+
+int
+dk4ma_input_dk_dec_size_t_simple(
+ size_t *rp,
+ const dkChar *src,
+ const dkChar **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maidduc.c b/support/dktools/dk4maidduc.c
index 5a92c86bf4..18d2d97e17 100644
--- a/support/dktools/dk4maidduc.c
+++ b/support/dktools/dk4maidduc.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidduc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidduc.ctr
*/
/** @file dk4maidduc.c The dk4maidduc module.
*/
-#line 68 "dk4maidduc.ctr"
+#line 80 "dk4maidduc.ctr"
+#include "dk4conf.h"
#include "dk4maidduc.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8duc.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_uchar(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_uchar(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidduc.ctr b/support/dktools/dk4maidduc.ctr
index bc369d5227..c6ab3ba9b4 100644
--- a/support/dktools/dk4maidduc.ctr
+++ b/support/dktools/dk4maidduc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_uchar(
%% module
+#include "dk4conf.h"
#include "dk4maidduc.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_uchar(
#include "dk4mai8duc.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_uchar(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_uchar(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidduc.h b/support/dktools/dk4maidduc.h
index 7d392a3f4c..2b61e0aeb2 100644
--- a/support/dktools/dk4maidduc.h
+++ b/support/dktools/dk4maidduc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidduc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidduc.ctr
*/
#ifndef DK4MAIDDUC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddui.c b/support/dktools/dk4maiddui.c
index 2c358d35db..4cef9436fa 100644
--- a/support/dktools/dk4maiddui.c
+++ b/support/dktools/dk4maiddui.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddui.ctr
*/
/** @file dk4maiddui.c The dk4maiddui module.
*/
-#line 68 "dk4maiddui.ctr"
+#line 80 "dk4maiddui.ctr"
+#include "dk4conf.h"
#include "dk4maiddui.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dui.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_uint(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_uint(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddui.ctr b/support/dktools/dk4maiddui.ctr
index d2a4b65af4..dd3e97fd5b 100644
--- a/support/dktools/dk4maiddui.ctr
+++ b/support/dktools/dk4maiddui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_uint(
%% module
+#include "dk4conf.h"
#include "dk4maiddui.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_uint(
#include "dk4mai8dui.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_uint(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_uint(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddui.h b/support/dktools/dk4maiddui.h
index 8f96a0e67b..3718d4ca51 100644
--- a/support/dktools/dk4maiddui.h
+++ b/support/dktools/dk4maiddui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddui.ctr
*/
#ifndef DK4MAIDDUI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddul.c b/support/dktools/dk4maiddul.c
index a3742c6d3e..2d65c3ac31 100644
--- a/support/dktools/dk4maiddul.c
+++ b/support/dktools/dk4maiddul.c
@@ -1,45 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddul.ctr
*/
/** @file dk4maiddul.c The dk4maiddul module.
*/
-#line 68 "dk4maiddul.ctr"
+#line 80 "dk4maiddul.ctr"
-#include "dk4maidddu.h"
+#include "dk4conf.h"
+#include "dk4maiddul.h"
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE == DK4_SIZEOF_WCHAR_T
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dul.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_ulong(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_ulong(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddul.ctr b/support/dktools/dk4maiddul.ctr
index 16c1e465c1..efe23c02a4 100644
--- a/support/dktools/dk4maiddul.ctr
+++ b/support/dktools/dk4maiddul.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,7 +78,8 @@ dk4ma_input_dk_dec_ulong(
%% module
-#include "dk4maidddu.h"
+#include "dk4conf.h"
+#include "dk4maiddul.h"
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE == DK4_SIZEOF_WCHAR_T
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_ulong(
#include "dk4mai8dul.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_ulong(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_ulong(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddul.h b/support/dktools/dk4maiddul.h
index f25816c217..dbc3585323 100644
--- a/support/dktools/dk4maiddul.h
+++ b/support/dktools/dk4maiddul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddul.ctr
*/
#ifndef DK4MAIDDUL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiddus.c b/support/dktools/dk4maiddus.c
index 1b2b0991ed..b617b81ece 100644
--- a/support/dktools/dk4maiddus.c
+++ b/support/dktools/dk4maiddus.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddus.ctr
*/
/** @file dk4maiddus.c The dk4maiddus module.
*/
-#line 68 "dk4maiddus.ctr"
+#line 80 "dk4maiddus.ctr"
+#include "dk4conf.h"
#include "dk4maiddus.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_dec_ushort(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_ushort(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddus.ctr b/support/dktools/dk4maiddus.ctr
index a36bedbde3..d3bec04556 100644
--- a/support/dktools/dk4maiddus.ctr
+++ b/support/dktools/dk4maiddus.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_dec_ushort(
%% module
+#include "dk4conf.h"
#include "dk4maiddus.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_dec_ushort(
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_dec_ushort(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_dec_ushort(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maiddus.h b/support/dktools/dk4maiddus.h
index a2bd9f1511..2cb9764147 100644
--- a/support/dktools/dk4maiddus.h
+++ b/support/dktools/dk4maiddus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiddus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiddus.ctr
*/
#ifndef DK4MAIDDUS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhdi.c b/support/dktools/dk4maidhdi.c
index 3d6371c0a6..d510e799a7 100644
--- a/support/dktools/dk4maidhdi.c
+++ b/support/dktools/dk4maidhdi.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhdi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhdi.ctr
*/
/** @file dk4maidhdi.c The dk4maidhdi module.
*/
-#line 68 "dk4maidhdi.ctr"
+#line 80 "dk4maidhdi.ctr"
+#include "dk4conf.h"
#include "dk4maidhdi.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hdi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_dk4_im_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_dk4_im_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhdi.ctr b/support/dktools/dk4maidhdi.ctr
index 67554ffac3..cf74e2d073 100644
--- a/support/dktools/dk4maidhdi.ctr
+++ b/support/dktools/dk4maidhdi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_dk4_im_t(
%% module
+#include "dk4conf.h"
#include "dk4maidhdi.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_dk4_im_t(
#include "dk4mai8hdi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_dk4_im_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_dk4_im_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhdi.h b/support/dktools/dk4maidhdi.h
index fd1ab21aca..f9a220b70e 100644
--- a/support/dktools/dk4maidhdi.h
+++ b/support/dktools/dk4maidhdi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhdi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhdi.ctr
*/
#ifndef DK4MAIDHDI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhdu.c b/support/dktools/dk4maidhdu.c
index de890fd0d2..face9df151 100644
--- a/support/dktools/dk4maidhdu.c
+++ b/support/dktools/dk4maidhdu.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhdu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhdu.ctr
*/
/** @file dk4maidhdu.c The dk4maidhdu module.
*/
-#line 68 "dk4maidhdu.ctr"
+#line 80 "dk4maidhdu.ctr"
+#include "dk4conf.h"
#include "dk4maidhdu.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hdu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_dk4_um_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_dk4_um_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhdu.ctr b/support/dktools/dk4maidhdu.ctr
index 1dd1ac1050..e9fa90d509 100644
--- a/support/dktools/dk4maidhdu.ctr
+++ b/support/dktools/dk4maidhdu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_dk4_um_t(
%% module
+#include "dk4conf.h"
#include "dk4maidhdu.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_dk4_um_t(
#include "dk4mai8hdu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_dk4_um_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_dk4_um_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhdu.h b/support/dktools/dk4maidhdu.h
index cba66b83d9..e286fff426 100644
--- a/support/dktools/dk4maidhdu.h
+++ b/support/dktools/dk4maidhdu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhdu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhdu.ctr
*/
#ifndef DK4MAIDHDU_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhic.c b/support/dktools/dk4maidhic.c
index 4fdd4cf11b..7b922a71e1 100644
--- a/support/dktools/dk4maidhic.c
+++ b/support/dktools/dk4maidhic.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhic.ctr
*/
/** @file dk4maidhic.c The dk4maidhic module.
*/
-#line 68 "dk4maidhic.ctr"
+#line 80 "dk4maidhic.ctr"
+#include "dk4conf.h"
#include "dk4maidhic.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hic.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_char(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_char(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhic.ctr b/support/dktools/dk4maidhic.ctr
index 4ac32518bc..0b1682f972 100644
--- a/support/dktools/dk4maidhic.ctr
+++ b/support/dktools/dk4maidhic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_char(
%% module
+#include "dk4conf.h"
#include "dk4maidhic.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_char(
#include "dk4mai8hic.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_char(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_char(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhic.h b/support/dktools/dk4maidhic.h
index a88e40f100..b3a434836b 100644
--- a/support/dktools/dk4maidhic.h
+++ b/support/dktools/dk4maidhic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhic.ctr
*/
#ifndef DK4MAIDHIC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhii.c b/support/dktools/dk4maidhii.c
index a4f1c31eb4..d2e7fc828f 100644
--- a/support/dktools/dk4maidhii.c
+++ b/support/dktools/dk4maidhii.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhii.ctr
*/
/** @file dk4maidhii.c The dk4maidhii module.
*/
-#line 68 "dk4maidhii.ctr"
+#line 80 "dk4maidhii.ctr"
+#include "dk4conf.h"
#include "dk4maidhii.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hii.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_int(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_int(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhii.ctr b/support/dktools/dk4maidhii.ctr
index 11118357d4..9456af0f8f 100644
--- a/support/dktools/dk4maidhii.ctr
+++ b/support/dktools/dk4maidhii.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_int(
%% module
+#include "dk4conf.h"
#include "dk4maidhii.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_int(
#include "dk4mai8hii.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_int(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_int(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhii.h b/support/dktools/dk4maidhii.h
index 566f66ac76..15e319111c 100644
--- a/support/dktools/dk4maidhii.h
+++ b/support/dktools/dk4maidhii.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhii.ctr
*/
#ifndef DK4MAIDHII_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhil.c b/support/dktools/dk4maidhil.c
index 4decc015a8..bad885eacf 100644
--- a/support/dktools/dk4maidhil.c
+++ b/support/dktools/dk4maidhil.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhil.ctr
*/
/** @file dk4maidhil.c The dk4maidhil module.
*/
-#line 68 "dk4maidhil.ctr"
+#line 80 "dk4maidhil.ctr"
+#include "dk4conf.h"
#include "dk4maidhil.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hil.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_long(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_long(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhil.ctr b/support/dktools/dk4maidhil.ctr
index df24d1bb5f..7e205e11ad 100644
--- a/support/dktools/dk4maidhil.ctr
+++ b/support/dktools/dk4maidhil.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_long(
%% module
+#include "dk4conf.h"
#include "dk4maidhil.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_long(
#include "dk4mai8hil.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_long(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_long(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhil.h b/support/dktools/dk4maidhil.h
index 92ddbc6ff5..45162c3505 100644
--- a/support/dktools/dk4maidhil.h
+++ b/support/dktools/dk4maidhil.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhil.ctr
*/
#ifndef DK4MAIDHIL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhis.c b/support/dktools/dk4maidhis.c
index 82b3886826..fa63c2fe16 100644
--- a/support/dktools/dk4maidhis.c
+++ b/support/dktools/dk4maidhis.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhis.ctr
*/
/** @file dk4maidhis.c The dk4maidhis module.
*/
-#line 68 "dk4maidhis.ctr"
+#line 80 "dk4maidhis.ctr"
+#include "dk4conf.h"
#include "dk4maidhis.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8his.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_short(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_short(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhis.ctr b/support/dktools/dk4maidhis.ctr
index f2810d3823..911277aa35 100644
--- a/support/dktools/dk4maidhis.ctr
+++ b/support/dktools/dk4maidhis.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_short(
%% module
+#include "dk4conf.h"
#include "dk4maidhis.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_short(
#include "dk4mai8his.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_short(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_short(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhis.h b/support/dktools/dk4maidhis.h
index 961f124684..dcf0d63296 100644
--- a/support/dktools/dk4maidhis.h
+++ b/support/dktools/dk4maidhis.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhis.ctr
*/
#ifndef DK4MAIDHIS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhli.c b/support/dktools/dk4maidhli.c
index ca342f83e2..fe5d333280 100644
--- a/support/dktools/dk4maidhli.c
+++ b/support/dktools/dk4maidhli.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhli.ctr
*/
/** @file dk4maidhli.c The dk4maidhli module.
*/
-#line 68 "dk4maidhli.ctr"
+#line 80 "dk4maidhli.ctr"
+#include "dk4conf.h"
#include "dk4maidhli.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hli.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_ll(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_ll(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhli.ctr b/support/dktools/dk4maidhli.ctr
index e05c88646a..ce12b97962 100644
--- a/support/dktools/dk4maidhli.ctr
+++ b/support/dktools/dk4maidhli.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_ll(
%% module
+#include "dk4conf.h"
#include "dk4maidhli.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_ll(
#include "dk4mai8hli.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_ll(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_ll(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhli.h b/support/dktools/dk4maidhli.h
index 5f2af0b530..85e4664629 100644
--- a/support/dktools/dk4maidhli.h
+++ b/support/dktools/dk4maidhli.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhli.ctr
*/
#ifndef DK4MAIDHLI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhlu.c b/support/dktools/dk4maidhlu.c
index a689b80488..ab024e6e60 100644
--- a/support/dktools/dk4maidhlu.c
+++ b/support/dktools/dk4maidhlu.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhlu.ctr
*/
/** @file dk4maidhlu.c The dk4maidhlu module.
*/
-#line 68 "dk4maidhlu.ctr"
+#line 80 "dk4maidhlu.ctr"
+#include "dk4conf.h"
#include "dk4maidhlu.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hlu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_ull(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_ull(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhlu.ctr b/support/dktools/dk4maidhlu.ctr
index 5289f04b1a..a87ed72e79 100644
--- a/support/dktools/dk4maidhlu.ctr
+++ b/support/dktools/dk4maidhlu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_ull(
%% module
+#include "dk4conf.h"
#include "dk4maidhlu.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_ull(
#include "dk4mai8hlu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_ull(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_ull(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhlu.h b/support/dktools/dk4maidhlu.h
index 29a8a6ec4b..213125e6f7 100644
--- a/support/dktools/dk4maidhlu.h
+++ b/support/dktools/dk4maidhlu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhlu.ctr
*/
#ifndef DK4MAIDHLU_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhmi.c b/support/dktools/dk4maidhmi.c
index 0aeca3c951..d39c8fcc1f 100644
--- a/support/dktools/dk4maidhmi.c
+++ b/support/dktools/dk4maidhmi.c
@@ -1,47 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhmi.ctr
*/
/** @file dk4maidhmi.c The dk4maidhmi module.
*/
-#line 71 "dk4maidhmi.ctr"
+#line 83 "dk4maidhmi.ctr"
+
+#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4MAIDHMI_H_INCLUDED
#include "dk4maidhmi.h"
+#endif
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -58,6 +44,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hmi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -69,6 +61,10 @@ dk4ma_input_dk_hex_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_intmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhmi.ctr b/support/dktools/dk4maidhmi.ctr
index 2fc37694ee..90d505f8b6 100644
--- a/support/dktools/dk4maidhmi.ctr
+++ b/support/dktools/dk4maidhmi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -69,9 +81,17 @@ dk4ma_input_dk_hex_intmax_t(
%% module
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4MAIDHMI_H_INCLUDED
#include "dk4maidhmi.h"
+#endif
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -88,6 +108,12 @@ dk4ma_input_dk_hex_intmax_t(
#include "dk4mai8hmi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -99,6 +125,10 @@ dk4ma_input_dk_hex_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_intmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhmi.h b/support/dktools/dk4maidhmi.h
index bff5a5394a..1a73edf24c 100644
--- a/support/dktools/dk4maidhmi.h
+++ b/support/dktools/dk4maidhmi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhmi.ctr
*/
#ifndef DK4MAIDHMI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhmu.c b/support/dktools/dk4maidhmu.c
index 8a55f521a6..49d20f2d29 100644
--- a/support/dktools/dk4maidhmu.c
+++ b/support/dktools/dk4maidhmu.c
@@ -1,47 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhmu.ctr
*/
/** @file dk4maidhmu.c The dk4maidhmu module.
*/
-#line 71 "dk4maidhmu.ctr"
+#line 83 "dk4maidhmu.ctr"
+
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+#ifndef DK4MAIDHMU_H_INCLUDED
#include "dk4maidhmu.h"
+#endif
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -57,6 +43,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hmu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -68,6 +60,10 @@ dk4ma_input_dk_hex_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_uintmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhmu.ctr b/support/dktools/dk4maidhmu.ctr
index ba00195ec1..2837844ee3 100644
--- a/support/dktools/dk4maidhmu.ctr
+++ b/support/dktools/dk4maidhmu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -69,9 +81,17 @@ dk4ma_input_dk_hex_uintmax_t(
%% module
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4MAIDHMU_H_INCLUDED
#include "dk4maidhmu.h"
+#endif
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -87,6 +107,12 @@ dk4ma_input_dk_hex_uintmax_t(
#include "dk4mai8hmu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -98,6 +124,10 @@ dk4ma_input_dk_hex_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_uintmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhmu.h b/support/dktools/dk4maidhmu.h
index 46c15500bc..361f612515 100644
--- a/support/dktools/dk4maidhmu.h
+++ b/support/dktools/dk4maidhmu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhmu.ctr
*/
#ifndef DK4MAIDHMU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhsz.c b/support/dktools/dk4maidhsz.c
index a80fad8093..c5bed04a34 100644
--- a/support/dktools/dk4maidhsz.c
+++ b/support/dktools/dk4maidhsz.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhsz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhsz.ctr
*/
/** @file dk4maidhsz.c The dk4maidhsz module.
*/
-#line 68 "dk4maidhsz.ctr"
+#line 80 "dk4maidhsz.ctr"
+#include "dk4conf.h"
#include "dk4maidhsz.h"
#if DK4_CHAR_SIZE > 1
diff --git a/support/dktools/dk4maidhsz.ctr b/support/dktools/dk4maidhsz.ctr
index 00b49de272..da2a96455f 100644
--- a/support/dktools/dk4maidhsz.ctr
+++ b/support/dktools/dk4maidhsz.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_size_t(
%% module
+#include "dk4conf.h"
#include "dk4maidhsz.h"
#if DK4_CHAR_SIZE > 1
diff --git a/support/dktools/dk4maidhsz.h b/support/dktools/dk4maidhsz.h
index ae7006385a..bd4a8e0e13 100644
--- a/support/dktools/dk4maidhsz.h
+++ b/support/dktools/dk4maidhsz.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhsz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhsz.ctr
*/
#ifndef DK4MAIDHSZ_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhuc.c b/support/dktools/dk4maidhuc.c
index a1f7d7b66d..520cb6a905 100644
--- a/support/dktools/dk4maidhuc.c
+++ b/support/dktools/dk4maidhuc.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhuc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhuc.ctr
*/
/** @file dk4maidhuc.c The dk4maidhuc module.
*/
-#line 68 "dk4maidhuc.ctr"
+#line 80 "dk4maidhuc.ctr"
+#include "dk4conf.h"
#include "dk4maidhuc.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8huc.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_uchar(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_uchar(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhuc.ctr b/support/dktools/dk4maidhuc.ctr
index c6cd9f7e7b..fcc5f00cc3 100644
--- a/support/dktools/dk4maidhuc.ctr
+++ b/support/dktools/dk4maidhuc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_uchar(
%% module
+#include "dk4conf.h"
#include "dk4maidhuc.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_uchar(
#include "dk4mai8huc.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_uchar(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_uchar(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhuc.h b/support/dktools/dk4maidhuc.h
index ab75f758b7..f4e103ac96 100644
--- a/support/dktools/dk4maidhuc.h
+++ b/support/dktools/dk4maidhuc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhuc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhuc.ctr
*/
#ifndef DK4MAIDHUC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhui.c b/support/dktools/dk4maidhui.c
index 24ce5b030e..caa226d667 100644
--- a/support/dktools/dk4maidhui.c
+++ b/support/dktools/dk4maidhui.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhui.ctr
*/
/** @file dk4maidhui.c The dk4maidhui module.
*/
-#line 68 "dk4maidhui.ctr"
+#line 80 "dk4maidhui.ctr"
+#include "dk4conf.h"
#include "dk4maidhui.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hui.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_uint(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_uint(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhui.ctr b/support/dktools/dk4maidhui.ctr
index 9579f1982e..6b194a48d7 100644
--- a/support/dktools/dk4maidhui.ctr
+++ b/support/dktools/dk4maidhui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_uint(
%% module
+#include "dk4conf.h"
#include "dk4maidhui.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_uint(
#include "dk4mai8hui.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_uint(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_uint(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhui.h b/support/dktools/dk4maidhui.h
index f6b8f04beb..88e21ea9ea 100644
--- a/support/dktools/dk4maidhui.h
+++ b/support/dktools/dk4maidhui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhui.ctr
*/
#ifndef DK4MAIDHUI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhul.c b/support/dktools/dk4maidhul.c
index 2532e2418c..cb7bc0dc72 100644
--- a/support/dktools/dk4maidhul.c
+++ b/support/dktools/dk4maidhul.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhul.ctr
*/
/** @file dk4maidhul.c The dk4maidhul module.
*/
-#line 68 "dk4maidhul.ctr"
+#line 80 "dk4maidhul.ctr"
+#include "dk4conf.h"
#include "dk4maidhul.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hul.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_ulong(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_ulong(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhul.ctr b/support/dktools/dk4maidhul.ctr
index a8461f7107..4d8be5ff2f 100644
--- a/support/dktools/dk4maidhul.ctr
+++ b/support/dktools/dk4maidhul.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_ulong(
%% module
+#include "dk4conf.h"
#include "dk4maidhul.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_ulong(
#include "dk4mai8hul.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_ulong(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_ulong(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhul.h b/support/dktools/dk4maidhul.h
index 2bea1278d4..b5e673cca3 100644
--- a/support/dktools/dk4maidhul.h
+++ b/support/dktools/dk4maidhul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhul.ctr
*/
#ifndef DK4MAIDHUL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maidhus.c b/support/dktools/dk4maidhus.c
index fdb12fdcf8..64219a1354 100644
--- a/support/dktools/dk4maidhus.c
+++ b/support/dktools/dk4maidhus.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhus.ctr
*/
/** @file dk4maidhus.c The dk4maidhus module.
*/
-#line 68 "dk4maidhus.ctr"
+#line 80 "dk4maidhus.ctr"
+#include "dk4conf.h"
#include "dk4maidhus.h"
#if DK4_CHAR_SIZE > 1
@@ -51,6 +30,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8hus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -62,6 +47,10 @@ dk4ma_input_dk_hex_ushort(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_ushort(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhus.ctr b/support/dktools/dk4maidhus.ctr
index 7c8cf7a66e..44b9aaf089 100644
--- a/support/dktools/dk4maidhus.ctr
+++ b/support/dktools/dk4maidhus.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +78,7 @@ dk4ma_input_dk_hex_ushort(
%% module
+#include "dk4conf.h"
#include "dk4maidhus.h"
#if DK4_CHAR_SIZE > 1
@@ -78,6 +91,12 @@ dk4ma_input_dk_hex_ushort(
#include "dk4mai8hus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -89,6 +108,10 @@ dk4ma_input_dk_hex_ushort(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_CHAR_SIZE > 1
return ( dk4ma_input_wc_hex_ushort(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maidhus.h b/support/dktools/dk4maidhus.h
index 25395d6602..6b6ea3240a 100644
--- a/support/dktools/dk4maidhus.h
+++ b/support/dktools/dk4maidhus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maidhus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maidhus.ctr
*/
#ifndef DK4MAIDHUS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiwdbl.c b/support/dktools/dk4maiwdbl.c
index 02988bd04b..6abe2c41a5 100644
--- a/support/dktools/dk4maiwdbl.c
+++ b/support/dktools/dk4maiwdbl.c
@@ -1,44 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdbl.ctr
*/
/** @file dk4maiwdbl.c The dk4maiwdbl module.
*/
-#line 77 "dk4maiwdbl.ctr"
+#line 89 "dk4maiwdbl.ctr"
+
+
+#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwdbl.h"
@@ -72,8 +59,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -103,6 +95,10 @@ dk4ma_internal_input_wc_double(
wchar_t *myend = NULL;
int back = 0;
int xerr = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
errno = 0;
#if DK4_HAVE_WCSTOD
@@ -168,6 +164,10 @@ dk4ma_internal_input_wc_double(
#if DK4_USE_PRINTF_SCANF
double val = 0.0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (1 == swscanf(src, L"%lf", &val)) {
*rp = val;
@@ -201,7 +201,10 @@ dk4ma_input_wc_double(
char *oldloc = NULL;
#endif
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
oldloc = setlocale(LC_NUMERIC, NULL);
(void)setlocale(LC_NUMERIC, locale_kw);
diff --git a/support/dktools/dk4maiwdbl.ctr b/support/dktools/dk4maiwdbl.ctr
index 92ec72741a..06dfc984c6 100644
--- a/support/dktools/dk4maiwdbl.ctr
+++ b/support/dktools/dk4maiwdbl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -10,20 +10,30 @@ license = bsd
/** @file
Read double value from wchar_t string.
-
- CRT on Windows: Optional, disabling CRT degrades performance.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -34,6 +44,8 @@ extern "C" {
The function temporarily resets the LC_NUMERIC locale setting
to "C" to retrieve the number and returns the setting to the
original value before returning.
+
+ CRT on Windows: Required.
@param rp Address of result variable.
@param src String to process.
@param endptr Address of pointer variable.
@@ -76,6 +88,15 @@ dk4ma_input_wc_double(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwdbl.h"
#include "dk4strw.h"
@@ -108,8 +129,13 @@ dk4ma_input_wc_double(
#endif
#endif
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -139,6 +165,10 @@ dk4ma_internal_input_wc_double(
wchar_t *myend = NULL;
int back = 0;
int xerr = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
errno = 0;
#if DK4_HAVE_WCSTOD
@@ -204,6 +234,10 @@ dk4ma_internal_input_wc_double(
#if DK4_USE_PRINTF_SCANF
double val = 0.0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (1 == swscanf(src, L"%lf", &val)) {
*rp = val;
@@ -237,7 +271,10 @@ dk4ma_input_wc_double(
char *oldloc = NULL;
#endif
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
oldloc = setlocale(LC_NUMERIC, NULL);
(void)setlocale(LC_NUMERIC, locale_kw);
diff --git a/support/dktools/dk4maiwdbl.h b/support/dktools/dk4maiwdbl.h
index 197be831e4..14385fadd1 100644
--- a/support/dktools/dk4maiwdbl.h
+++ b/support/dktools/dk4maiwdbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdbl.ctr
*/
#ifndef DK4MAIWDBL_H_INCLUDED
@@ -42,20 +20,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file
Read double value from wchar_t string.
-
- CRT on Windows: Optional, disabling CRT degrades performance.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,6 +54,8 @@ extern "C" {
The function temporarily resets the LC_NUMERIC locale setting
to "C" to retrieve the number and returns the setting to the
original value before returning.
+
+ CRT on Windows: Required.
@param rp Address of result variable.
@param src String to process.
@param endptr Address of pointer variable.
diff --git a/support/dktools/dk4maiwddi.c b/support/dktools/dk4maiwddi.c
index 6760ccbf64..06120add08 100644
--- a/support/dktools/dk4maiwddi.c
+++ b/support/dktools/dk4maiwddi.c
@@ -1,45 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwddi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwddi.ctr
*/
/** @file dk4maiwddi.c The dk4maiwddi module.
*/
-#line 69 "dk4maiwddi.ctr"
+#line 81 "dk4maiwddi.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddi.h"
#include "dk4maiwddu.h"
#include "dk4numco.h"
@@ -57,7 +44,10 @@ dk4ma_input_wc_dec_dk4_im_t(
const wchar_t *ep = NULL;
dk4_um_t res = (dk4_um_t)0UL;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (L'-' == *src) {
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, ++src, &ep, atg, erp)) {
@@ -74,6 +64,7 @@ dk4ma_input_wc_dec_dk4_im_t(
}
}
} else {
+ if (L'+' == *src) { src++; }
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, &ep, atg, erp)) {
if (((dk4_um_t)(DK4_IM_MAX)) >= res) {
*rp = (dk4_im_t)res;
diff --git a/support/dktools/dk4maiwddi.ctr b/support/dktools/dk4maiwddi.ctr
index 697b8cd92b..107715db6b 100644
--- a/support/dktools/dk4maiwddi.ctr
+++ b/support/dktools/dk4maiwddi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -68,6 +80,15 @@ dk4ma_input_wc_dec_dk4_im_t(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddi.h"
#include "dk4maiwddu.h"
#include "dk4numco.h"
@@ -85,7 +106,10 @@ dk4ma_input_wc_dec_dk4_im_t(
const wchar_t *ep = NULL;
dk4_um_t res = (dk4_um_t)0UL;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (L'-' == *src) {
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, ++src, &ep, atg, erp)) {
@@ -102,6 +126,7 @@ dk4ma_input_wc_dec_dk4_im_t(
}
}
} else {
+ if (L'+' == *src) { src++; }
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, &ep, atg, erp)) {
if (((dk4_um_t)(DK4_IM_MAX)) >= res) {
*rp = (dk4_im_t)res;
diff --git a/support/dktools/dk4maiwddi.h b/support/dktools/dk4maiwddi.h
index 7e79102428..74577f56c0 100644
--- a/support/dktools/dk4maiwddi.h
+++ b/support/dktools/dk4maiwddi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwddi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwddi.ctr
*/
#ifndef DK4MAIWDDI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiwddu.c b/support/dktools/dk4maiwddu.c
index bc9f3d858d..6c25037ef3 100644
--- a/support/dktools/dk4maiwddu.c
+++ b/support/dktools/dk4maiwddu.c
@@ -1,46 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwddu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwddu.ctr
*/
/** @file dk4maiwddu.c The dk4maiwddu module.
*/
-#line 70 "dk4maiwddu.ctr"
+#line 82 "dk4maiwddu.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddu.h"
#include "dk4numco.h"
#include "dk4strw.h"
@@ -49,7 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 80 "dk4maiwddu.ctr"
+#line 101 "dk4maiwddu.ctr"
@@ -70,7 +57,11 @@ dk4ma_input_wc_dec_dk4_um_t(
int cc = 1;
-#line 99 "dk4maiwddu.ctr"
+#line 120 "dk4maiwddu.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
do {
op = (dk4_um_t)0UL;
@@ -88,40 +79,40 @@ dk4ma_input_wc_dec_dk4_um_t(
case L'9': { op = (dk4_um_t)9UL; } break;
case L'\0': {
-#line 115 "dk4maiwddu.ctr"
+#line 140 "dk4maiwddu.ctr"
cc = 0;
if (0 != found) {
-#line 117 "dk4maiwddu.ctr"
+#line 142 "dk4maiwddu.ctr"
back = 1;
*rp = result;
} else {
-#line 120 "dk4maiwddu.ctr"
+#line 145 "dk4maiwddu.ctr"
ep = src;
-#line 121 "dk4maiwddu.ctr"
+#line 146 "dk4maiwddu.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} break;
default: {
cc = 0;
-#line 126 "dk4maiwddu.ctr"
+#line 151 "dk4maiwddu.ctr"
ep = src;
-#line 127 "dk4maiwddu.ctr"
+#line 152 "dk4maiwddu.ctr"
if (0 != found) {
switch (atg) {
case 2: {
-#line 130 "dk4maiwddu.ctr"
+#line 155 "dk4maiwddu.ctr"
back = 1;
*rp = result;
} break;
case 1: {
-#line 134 "dk4maiwddu.ctr"
+#line 159 "dk4maiwddu.ctr"
if (NULL == dk4strw_start(src, NULL)) {
back = 1;
*rp = result;
@@ -131,7 +122,7 @@ dk4ma_input_wc_dec_dk4_um_t(
} break;
default: {
-#line 142 "dk4maiwddu.ctr"
+#line 167 "dk4maiwddu.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
} break;
}
@@ -249,7 +240,7 @@ dk4ma_input_wc_dec_dk4_um_t(
if (NULL != endptr) { *endptr = ep; }
-#line 258 "dk4maiwddu.ctr"
+#line 283 "dk4maiwddu.ctr"
return back;
}
diff --git a/support/dktools/dk4maiwddu.ctr b/support/dktools/dk4maiwddu.ctr
index 74246ef3c4..4e8f2253e8 100644
--- a/support/dktools/dk4maiwddu.ctr
+++ b/support/dktools/dk4maiwddu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -70,6 +82,15 @@ dk4ma_input_wc_dec_dk4_um_t(
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddu.h"
#include "dk4numco.h"
#include "dk4strw.h"
@@ -96,6 +117,10 @@ dk4ma_input_wc_dec_dk4_um_t(
int back = 0;
int cc = 1;
$? "+ dk4ma_input_wc_dec_dk4_um_t"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
do {
op = (dk4_um_t)0UL;
diff --git a/support/dktools/dk4maiwddu.h b/support/dktools/dk4maiwddu.h
index 1634676ccd..9f3a0ac813 100644
--- a/support/dktools/dk4maiwddu.h
+++ b/support/dktools/dk4maiwddu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwddu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwddu.ctr
*/
#ifndef DK4MAIWDDU_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiwdic.c b/support/dktools/dk4maiwdic.c
index f16f192be0..3f15f32f04 100644
--- a/support/dktools/dk4maiwdic.c
+++ b/support/dktools/dk4maiwdic.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdic.ctr
*/
/** @file dk4maiwdic.c The dk4maiwdic module.
*/
-#line 70 "dk4maiwdic.ctr"
+#line 82 "dk4maiwdic.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwdic.h"
#include "dk4maiwddi.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_dec_char(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(CHAR_MIN) <= res) && ((dk4_im_t)(CHAR_MAX) >= res)) {
*rp = (signed char)res;
diff --git a/support/dktools/dk4maiwdic.ctr b/support/dktools/dk4maiwdic.ctr
index f4a600ef9f..e414c7bd88 100644
--- a/support/dktools/dk4maiwdic.ctr
+++ b/support/dktools/dk4maiwdic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_dec_char(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwdic.h"
#include "dk4maiwddi.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_dec_char(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(CHAR_MIN) <= res) && ((dk4_im_t)(CHAR_MAX) >= res)) {
*rp = (signed char)res;
diff --git a/support/dktools/dk4maiwdic.h b/support/dktools/dk4maiwdic.h
index d1b428da46..770d45ff22 100644
--- a/support/dktools/dk4maiwdic.h
+++ b/support/dktools/dk4maiwdic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdic.ctr
*/
#ifndef DK4MAIWDIC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdii.c b/support/dktools/dk4maiwdii.c
index 47b52d1333..e68ab4abff 100644
--- a/support/dktools/dk4maiwdii.c
+++ b/support/dktools/dk4maiwdii.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdii.ctr
*/
/** @file dk4maiwdii.c The dk4maiwdii module.
*/
-#line 70 "dk4maiwdii.ctr"
+#line 82 "dk4maiwdii.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwddi.h"
#include "dk4maiwdii.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_dec_int(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(INT_MIN) <= res) && (((dk4_im_t)(INT_MAX)) >= res)) {
*rp = (int)res;
diff --git a/support/dktools/dk4maiwdii.ctr b/support/dktools/dk4maiwdii.ctr
index 3ba8789194..da41bb8768 100644
--- a/support/dktools/dk4maiwdii.ctr
+++ b/support/dktools/dk4maiwdii.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_dec_int(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddi.h"
#include "dk4maiwdii.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_dec_int(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(INT_MIN) <= res) && (((dk4_im_t)(INT_MAX)) >= res)) {
*rp = (int)res;
diff --git a/support/dktools/dk4maiwdii.h b/support/dktools/dk4maiwdii.h
index a05f9ed124..1d34e53405 100644
--- a/support/dktools/dk4maiwdii.h
+++ b/support/dktools/dk4maiwdii.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdii.ctr
*/
#ifndef DK4MAIWDII_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdil.c b/support/dktools/dk4maiwdil.c
index 1f3a0a5ad2..2af2aa0657 100644
--- a/support/dktools/dk4maiwdil.c
+++ b/support/dktools/dk4maiwdil.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdil.ctr
*/
/** @file dk4maiwdil.c The dk4maiwdil module.
*/
-#line 70 "dk4maiwdil.ctr"
+#line 82 "dk4maiwdil.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwddi.h"
#include "dk4maiwdil.h"
@@ -57,6 +44,10 @@ dk4ma_input_wc_dec_long(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LONG_MIN) <= res) && (((dk4_im_t)(LONG_MAX)) >= res)) {
*rp = (long)res;
diff --git a/support/dktools/dk4maiwdil.ctr b/support/dktools/dk4maiwdil.ctr
index 4612141090..020319d37c 100644
--- a/support/dktools/dk4maiwdil.ctr
+++ b/support/dktools/dk4maiwdil.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_dec_long(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddi.h"
#include "dk4maiwdil.h"
#include "dk4numco.h"
@@ -86,6 +107,10 @@ dk4ma_input_wc_dec_long(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LONG_MIN) <= res) && (((dk4_im_t)(LONG_MAX)) >= res)) {
*rp = (long)res;
diff --git a/support/dktools/dk4maiwdil.h b/support/dktools/dk4maiwdil.h
index 9978b6e4b2..9dd3a828eb 100644
--- a/support/dktools/dk4maiwdil.h
+++ b/support/dktools/dk4maiwdil.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdil.ctr
*/
#ifndef DK4MAIWDIL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdis.c b/support/dktools/dk4maiwdis.c
index 4f563d9ebc..8ee7d54dbf 100644
--- a/support/dktools/dk4maiwdis.c
+++ b/support/dktools/dk4maiwdis.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdis.ctr
*/
/** @file dk4maiwdis.c The dk4maiwdis module.
*/
-#line 70 "dk4maiwdis.ctr"
+#line 82 "dk4maiwdis.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwddi.h"
#include "dk4maiwdis.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_dec_short(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(SHRT_MIN) <= res) && (((dk4_im_t)(SHRT_MAX)) >= res)) {
*rp = (short)res;
diff --git a/support/dktools/dk4maiwdis.ctr b/support/dktools/dk4maiwdis.ctr
index 63ba351479..0536375b3e 100644
--- a/support/dktools/dk4maiwdis.ctr
+++ b/support/dktools/dk4maiwdis.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_dec_short(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddi.h"
#include "dk4maiwdis.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_dec_short(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(SHRT_MIN) <= res) && (((dk4_im_t)(SHRT_MAX)) >= res)) {
*rp = (short)res;
diff --git a/support/dktools/dk4maiwdis.h b/support/dktools/dk4maiwdis.h
index b6ace41a4c..cd2df6a897 100644
--- a/support/dktools/dk4maiwdis.h
+++ b/support/dktools/dk4maiwdis.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdis.ctr
*/
#ifndef DK4MAIWDIS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdli.c b/support/dktools/dk4maiwdli.c
index 9a10ae5594..e34f092396 100644
--- a/support/dktools/dk4maiwdli.c
+++ b/support/dktools/dk4maiwdli.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdli.ctr
*/
/** @file dk4maiwdli.c The dk4maiwdli module.
*/
-#line 74 "dk4maiwdli.ctr"
+#line 86 "dk4maiwdli.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4maiwddi.h"
@@ -61,6 +46,10 @@ dk4ma_input_wc_dec_ll(
#if DK4_HAVE_INTMAX_T
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LLONG_MIN) <= res) && (((dk4_im_t)(LLONG_MAX)) >= res)) {
*rp = (long long)res;
diff --git a/support/dktools/dk4maiwdli.ctr b/support/dktools/dk4maiwdli.ctr
index 655253c970..57156c28da 100644
--- a/support/dktools/dk4maiwdli.ctr
+++ b/support/dktools/dk4maiwdli.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -74,6 +86,13 @@ dk4ma_input_wc_dec_ll(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4maiwddi.h"
@@ -94,6 +113,10 @@ dk4ma_input_wc_dec_ll(
#if DK4_HAVE_INTMAX_T
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LLONG_MIN) <= res) && (((dk4_im_t)(LLONG_MAX)) >= res)) {
*rp = (long long)res;
diff --git a/support/dktools/dk4maiwdli.h b/support/dktools/dk4maiwdli.h
index e600695536..c8d409b6cd 100644
--- a/support/dktools/dk4maiwdli.h
+++ b/support/dktools/dk4maiwdli.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdli.ctr
*/
#ifndef DK4MAIWDLI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdlu.c b/support/dktools/dk4maiwdlu.c
index 53988a3b63..899b897223 100644
--- a/support/dktools/dk4maiwdlu.c
+++ b/support/dktools/dk4maiwdlu.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdlu.ctr
*/
/** @file dk4maiwdlu.c The dk4maiwdlu module.
*/
-#line 74 "dk4maiwdlu.ctr"
+#line 86 "dk4maiwdlu.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4maiwddu.h"
@@ -61,6 +46,10 @@ dk4ma_input_wc_dec_ull(
#if DK4_HAVE_INTMAX_T
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULLONG_MAX)) >= res) {
*rp = (unsigned long long)res;
diff --git a/support/dktools/dk4maiwdlu.ctr b/support/dktools/dk4maiwdlu.ctr
index b307bea4e6..96797bbc49 100644
--- a/support/dktools/dk4maiwdlu.ctr
+++ b/support/dktools/dk4maiwdlu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -74,6 +86,13 @@ dk4ma_input_wc_dec_ull(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4maiwddu.h"
@@ -94,6 +113,10 @@ dk4ma_input_wc_dec_ull(
#if DK4_HAVE_INTMAX_T
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULLONG_MAX)) >= res) {
*rp = (unsigned long long)res;
diff --git a/support/dktools/dk4maiwdlu.h b/support/dktools/dk4maiwdlu.h
index 6c63a73e2c..b911e99e42 100644
--- a/support/dktools/dk4maiwdlu.h
+++ b/support/dktools/dk4maiwdlu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdlu.ctr
*/
#ifndef DK4MAIWDLU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdmi.c b/support/dktools/dk4maiwdmi.c
index de83a98c7a..b2e07800f5 100644
--- a/support/dktools/dk4maiwdmi.c
+++ b/support/dktools/dk4maiwdmi.c
@@ -1,54 +1,50 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdmi.ctr
*/
/** @file dk4maiwdmi.c The dk4maiwdmi module.
*/
-#line 75 "dk4maiwdmi.ctr"
+#line 87 "dk4maiwdmi.ctr"
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
#if DK4_HAVE_INTMAX_T
+#ifndef DK4MAIWDDI_H_INCLUDED
#include "dk4maiwddi.h"
-#include "dk4maiwdmu.h"
+#endif
+
+#ifndef DK4MAIWDMI_H_INCLUDED
+#include "dk4maiwdmi.h"
+#endif
+
+
int
dk4ma_input_wc_dec_intmax_t(
@@ -59,6 +55,10 @@ dk4ma_input_wc_dec_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_wc_dec_dk4_im_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4maiwdmi.ctr b/support/dktools/dk4maiwdmi.ctr
index a6de7688db..6c0c02f661 100644
--- a/support/dktools/dk4maiwdmi.ctr
+++ b/support/dktools/dk4maiwdmi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -75,14 +87,32 @@ dk4ma_input_wc_dec_intmax_t(
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
#if DK4_HAVE_INTMAX_T
+#ifndef DK4MAIWDDI_H_INCLUDED
#include "dk4maiwddi.h"
-#include "dk4maiwdmu.h"
+#endif
+
+#ifndef DK4MAIWDMI_H_INCLUDED
+#include "dk4maiwdmi.h"
+#endif
+
+
int
dk4ma_input_wc_dec_intmax_t(
@@ -93,6 +123,10 @@ dk4ma_input_wc_dec_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_wc_dec_dk4_im_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4maiwdmi.h b/support/dktools/dk4maiwdmi.h
index 9fbea4f5f5..2f0c4e46ea 100644
--- a/support/dktools/dk4maiwdmi.h
+++ b/support/dktools/dk4maiwdmi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdmi.ctr
*/
#ifndef DK4MAIWDMI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdmu.c b/support/dktools/dk4maiwdmu.c
index 3622c65f19..db336d87d6 100644
--- a/support/dktools/dk4maiwdmu.c
+++ b/support/dktools/dk4maiwdmu.c
@@ -1,54 +1,50 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdmu.ctr
*/
/** @file dk4maiwdmu.c The dk4maiwdmu module.
*/
-#line 75 "dk4maiwdmu.ctr"
+#line 87 "dk4maiwdmu.ctr"
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
#if DK4_HAVE_INTMAX_T
+#ifndef DK4MAIWDDU_H_INCLUDED
#include "dk4maiwddu.h"
+#endif
+
+#ifndef DK4MAIWDMU_H_INCLUDED
#include "dk4maiwdmu.h"
+#endif
+
+
int
dk4ma_input_wc_dec_uintmax_t(
@@ -59,6 +55,10 @@ dk4ma_input_wc_dec_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_wc_dec_dk4_um_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4maiwdmu.ctr b/support/dktools/dk4maiwdmu.ctr
index 9c5747cf78..387296a7cf 100644
--- a/support/dktools/dk4maiwdmu.ctr
+++ b/support/dktools/dk4maiwdmu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -75,14 +87,32 @@ dk4ma_input_wc_dec_uintmax_t(
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
#if DK4_HAVE_INTMAX_T
+#ifndef DK4MAIWDDU_H_INCLUDED
#include "dk4maiwddu.h"
+#endif
+
+#ifndef DK4MAIWDMU_H_INCLUDED
#include "dk4maiwdmu.h"
+#endif
+
+
int
dk4ma_input_wc_dec_uintmax_t(
@@ -93,6 +123,10 @@ dk4ma_input_wc_dec_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_wc_dec_dk4_um_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4maiwdmu.h b/support/dktools/dk4maiwdmu.h
index 411832a569..1a40599d2e 100644
--- a/support/dktools/dk4maiwdmu.h
+++ b/support/dktools/dk4maiwdmu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdmu.ctr
*/
#ifndef DK4MAIWDMU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdsz.c b/support/dktools/dk4maiwdsz.c
index 13bec9b5fb..ea4a0adfd7 100644
--- a/support/dktools/dk4maiwdsz.c
+++ b/support/dktools/dk4maiwdsz.c
@@ -1,77 +1,39 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdsz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdsz.ctr
*/
/** @file dk4maiwdsz.c The dk4maiwdsz module.
*/
-#line 70 "dk4maiwdsz.ctr"
+#line 124 "dk4maiwdsz.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwddu.h"
#include "dk4maiwdui.h"
+#include "dk4maiwdsz.h"
#include "dk4numco.h"
#include "dk4strw.h"
-#if 0
-int
-dk4ma_input_wc_dec_size_t(
- size_t *rp,
- const wchar_t *src,
- const wchar_t **endptr,
- int atg,
- dk4_er_t *erp
-)
-{
- dk4_um_t res;
- int back = 0;
- if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
- if (((dk4_um_t)(SIZE_MAX)) >= res) {
- *rp = (size_t)res;
- back = 1;
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
- }
- return back;
-}
-#endif
-
-
-
int
dk4ma_input_wc_dec_size_t(
size_t *rp,
@@ -84,25 +46,43 @@ dk4ma_input_wc_dec_size_t(
const wchar_t *myend = NULL;
dk4_um_t um = (dk4_um_t)0UL;
size_t res = 0;
+ size_t xf = 1024;
size_t factor = 1;
size_t nloop = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (0 != dk4ma_input_wc_dec_dk4_um_t(&um, src, &myend, 2, erp)) {
if (((dk4_um_t)(SIZE_MAX)) >= um) {
res = (size_t)um;
if (NULL != myend) {
back = 1;
- switch (*myend) {
- case 'k': case 'K': { nloop = 1; myend++; } break;
- case 'm': case 'M': { nloop = 2; myend++; } break;
- case 'g': case 'G': { nloop = 3; myend++; } break;
- case 't': case 'T': { nloop = 4; myend++; } break;
+ if (*myend <= (wchar_t)(0x00FFU)) {
+ switch ((int)(*myend)) {
+ case 'K': { nloop = 1; myend++; } break;
+ case 'M': { nloop = 2; myend++; } break;
+ case 'G': { nloop = 3; myend++; } break;
+ case 'T': { nloop = 4; myend++; } break;
+ case 'P': { nloop = 5; myend++; } break;
+ case 'E': { nloop = 6; myend++; } break;
+ case 'Z': { nloop = 7; myend++; } break;
+ case 'Y': { nloop = 8; myend++; } break;
+ case 'k': { nloop = 1; myend++; xf = 1000; } break;
+ case 'm': { nloop = 2; myend++; xf = 1000; } break;
+ case 'g': { nloop = 3; myend++; xf = 1000; } break;
+ case 't': { nloop = 4; myend++; xf = 1000; } break;
+ case 'p': { nloop = 5; myend++; xf = 1000; } break;
+ case 'e': { nloop = 6; myend++; xf = 1000; } break;
+ case 'z': { nloop = 7; myend++; xf = 1000; } break;
+ case 'y': { nloop = 8; myend++; xf = 1000; } break;
+ }
}
while (nloop--) {
- if ((SIZE_MAX / 1024) >= factor) {
- factor *= 1024;
+ if ((SIZE_MAX / xf) >= factor) {
+ factor *= xf;
} else {
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
@@ -151,3 +131,37 @@ dk4ma_input_wc_dec_size_t(
return back;
}
+
+
+int
+dk4ma_input_wc_dec_size_t_simple(
+ size_t *rp,
+ const wchar_t *src,
+ const wchar_t **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ const wchar_t *myend = NULL;
+ dk4_um_t um = (dk4_um_t)0UL;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if ((NULL != rp) && (NULL != src)) {
+ if (0 != dk4ma_input_wc_dec_dk4_um_t(&um, src, &myend, atg, erp)) {
+ if (((dk4_um_t)(SIZE_MAX)) >= um) {
+ *rp = (size_t)um;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (NULL != endptr) { *endptr = myend; }
+ return back;
+}
+
diff --git a/support/dktools/dk4maiwdsz.ctr b/support/dktools/dk4maiwdsz.ctr
index 5a70963f03..4574c912d2 100644
--- a/support/dktools/dk4maiwdsz.ctr
+++ b/support/dktools/dk4maiwdsz.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -34,6 +46,13 @@ extern "C" {
/** Retrieve numeric value from string, decimal notation.
@param rp Pointer to result variable for the found value.
@param src String to check for numeric value.
+ In addition to the numeric value the string can
+ contain a suffix 'K', 'M', 'G', 'T', 'P', 'E',
+ 'Z' or 'Y' to indicate multiples of powers of 1024
+ (kibibytes, mibibytes...).
+ Suffixes 'k', 'm', 'g', 't', 'p', 'e', 'z' or 'y'
+ indicate multiples of powers of 1000
+ (kilobytes, megabytes...).
@param endptr Address of pointer variable.
A pointer to the first character not processed
is stored here.
@@ -53,6 +72,7 @@ extern "C" {
DK4_E_MATH_OVERFLOW if the number is out of range, or
DK4_E_SYNTAX if src contains illegal characters.
*/
+
int
dk4ma_input_wc_dec_size_t(
size_t *rp,
@@ -62,43 +82,61 @@ dk4ma_input_wc_dec_size_t(
dk4_er_t *erp
);
-#ifdef __cplusplus
-}
-#endif
-
-%% module
-
-#include "dk4maiwddu.h"
-#include "dk4maiwdui.h"
-#include "dk4numco.h"
-#include "dk4strw.h"
-
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ No suffixes allowed.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
-#if 0
int
-dk4ma_input_wc_dec_size_t(
+dk4ma_input_wc_dec_size_t_simple(
size_t *rp,
const wchar_t *src,
const wchar_t **endptr,
int atg,
dk4_er_t *erp
-)
-{
- dk4_um_t res;
- int back = 0;
- if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
- if (((dk4_um_t)(SIZE_MAX)) >= res) {
- *rp = (size_t)res;
- back = 1;
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
- }
- }
- return back;
+);
+
+#ifdef __cplusplus
}
#endif
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4maiwddu.h"
+#include "dk4maiwdui.h"
+#include "dk4maiwdsz.h"
+#include "dk4numco.h"
+#include "dk4strw.h"
+
int
@@ -113,25 +151,43 @@ dk4ma_input_wc_dec_size_t(
const wchar_t *myend = NULL;
dk4_um_t um = (dk4_um_t)0UL;
size_t res = 0;
+ size_t xf = 1024;
size_t factor = 1;
size_t nloop = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (0 != dk4ma_input_wc_dec_dk4_um_t(&um, src, &myend, 2, erp)) {
if (((dk4_um_t)(SIZE_MAX)) >= um) {
res = (size_t)um;
if (NULL != myend) {
back = 1;
- switch (*myend) {
- case 'k': case 'K': { nloop = 1; myend++; } break;
- case 'm': case 'M': { nloop = 2; myend++; } break;
- case 'g': case 'G': { nloop = 3; myend++; } break;
- case 't': case 'T': { nloop = 4; myend++; } break;
+ if (*myend <= (wchar_t)(0x00FFU)) {
+ switch ((int)(*myend)) {
+ case 'K': { nloop = 1; myend++; } break;
+ case 'M': { nloop = 2; myend++; } break;
+ case 'G': { nloop = 3; myend++; } break;
+ case 'T': { nloop = 4; myend++; } break;
+ case 'P': { nloop = 5; myend++; } break;
+ case 'E': { nloop = 6; myend++; } break;
+ case 'Z': { nloop = 7; myend++; } break;
+ case 'Y': { nloop = 8; myend++; } break;
+ case 'k': { nloop = 1; myend++; xf = 1000; } break;
+ case 'm': { nloop = 2; myend++; xf = 1000; } break;
+ case 'g': { nloop = 3; myend++; xf = 1000; } break;
+ case 't': { nloop = 4; myend++; xf = 1000; } break;
+ case 'p': { nloop = 5; myend++; xf = 1000; } break;
+ case 'e': { nloop = 6; myend++; xf = 1000; } break;
+ case 'z': { nloop = 7; myend++; xf = 1000; } break;
+ case 'y': { nloop = 8; myend++; xf = 1000; } break;
+ }
}
while (nloop--) {
- if ((SIZE_MAX / 1024) >= factor) {
- factor *= 1024;
+ if ((SIZE_MAX / xf) >= factor) {
+ factor *= xf;
} else {
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
@@ -180,3 +236,37 @@ dk4ma_input_wc_dec_size_t(
return back;
}
+
+
+int
+dk4ma_input_wc_dec_size_t_simple(
+ size_t *rp,
+ const wchar_t *src,
+ const wchar_t **endptr,
+ int atg,
+ dk4_er_t *erp
+)
+{
+ const wchar_t *myend = NULL;
+ dk4_um_t um = (dk4_um_t)0UL;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
+ if ((NULL != rp) && (NULL != src)) {
+ if (0 != dk4ma_input_wc_dec_dk4_um_t(&um, src, &myend, atg, erp)) {
+ if (((dk4_um_t)(SIZE_MAX)) >= um) {
+ *rp = (size_t)um;
+ back = 1;
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (NULL != endptr) { *endptr = myend; }
+ return back;
+}
+
diff --git a/support/dktools/dk4maiwdsz.h b/support/dktools/dk4maiwdsz.h
index ccf595ccc3..c5a8b38efd 100644
--- a/support/dktools/dk4maiwdsz.h
+++ b/support/dktools/dk4maiwdsz.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdsz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdsz.ctr
*/
#ifndef DK4MAIWDSZ_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -66,6 +56,13 @@ extern "C" {
/** Retrieve numeric value from string, decimal notation.
@param rp Pointer to result variable for the found value.
@param src String to check for numeric value.
+ In addition to the numeric value the string can
+ contain a suffix 'K', 'M', 'G', 'T', 'P', 'E',
+ 'Z' or 'Y' to indicate multiples of powers of 1024
+ (kibibytes, mibibytes...).
+ Suffixes 'k', 'm', 'g', 't', 'p', 'e', 'z' or 'y'
+ indicate multiples of powers of 1000
+ (kilobytes, megabytes...).
@param endptr Address of pointer variable.
A pointer to the first character not processed
is stored here.
@@ -85,6 +82,7 @@ extern "C" {
DK4_E_MATH_OVERFLOW if the number is out of range, or
DK4_E_SYNTAX if src contains illegal characters.
*/
+
int
dk4ma_input_wc_dec_size_t(
size_t *rp,
@@ -94,6 +92,40 @@ dk4ma_input_wc_dec_size_t(
dk4_er_t *erp
);
+
+/** Retrieve numeric value from string, decimal notation.
+ @param rp Pointer to result variable for the found value.
+ @param src String to check for numeric value.
+ No suffixes allowed.
+ @param endptr Address of pointer variable.
+ A pointer to the first character not processed
+ is stored here.
+ The function may also store a NULL pointer in this
+ variable.
+ The variable points to the correct error position
+ only if er.ec is DK4_E_SYNTAX.
+ @param atg Allow trailing garbage:
+ 0=no unprocessable trailing bytes allowed,
+ 1=trailing whitespaces allowed,
+ 2=any trailing characters allowed.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ DK4_E_INVALID_ARGUMENTS if rp or src is NULL,
+ DK4_E_MATH_OVERFLOW if the number is out of range, or
+ DK4_E_SYNTAX if src contains illegal characters.
+*/
+
+int
+dk4ma_input_wc_dec_size_t_simple(
+ size_t *rp,
+ const wchar_t *src,
+ const wchar_t **endptr,
+ int atg,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4maiwduc.c b/support/dktools/dk4maiwduc.c
index 4a68ca23ef..1b4c2d5caf 100644
--- a/support/dktools/dk4maiwduc.c
+++ b/support/dktools/dk4maiwduc.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwduc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwduc.ctr
*/
/** @file dk4maiwduc.c The dk4maiwduc module.
*/
-#line 71 "dk4maiwduc.ctr"
+#line 83 "dk4maiwduc.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwduc.h"
#include "dk4maiwddu.h"
@@ -56,7 +43,10 @@ dk4ma_input_wc_dec_uchar(
{
dk4_um_t res;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UCHAR_MAX)) >= res) {
*rp = (unsigned char)res;
diff --git a/support/dktools/dk4maiwduc.ctr b/support/dktools/dk4maiwduc.ctr
index cd2e0803d9..188bcc86da 100644
--- a/support/dktools/dk4maiwduc.ctr
+++ b/support/dktools/dk4maiwduc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -69,6 +81,15 @@ dk4ma_input_wc_dec_uchar(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwduc.h"
#include "dk4maiwddu.h"
#include "dk4numco.h"
@@ -86,7 +107,10 @@ dk4ma_input_wc_dec_uchar(
{
dk4_um_t res;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UCHAR_MAX)) >= res) {
*rp = (unsigned char)res;
diff --git a/support/dktools/dk4maiwduc.h b/support/dktools/dk4maiwduc.h
index fd237e07cf..e1547f3044 100644
--- a/support/dktools/dk4maiwduc.h
+++ b/support/dktools/dk4maiwduc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwduc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwduc.ctr
*/
#ifndef DK4MAIWDUC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdui.c b/support/dktools/dk4maiwdui.c
index 68cca40e8a..6e482760d1 100644
--- a/support/dktools/dk4maiwdui.c
+++ b/support/dktools/dk4maiwdui.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdui.ctr
*/
/** @file dk4maiwdui.c The dk4maiwdui module.
*/
-#line 70 "dk4maiwdui.ctr"
+#line 82 "dk4maiwdui.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwddu.h"
#include "dk4maiwdui.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_dec_uint(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UINT_MAX)) >= res) {
*rp = (unsigned)res;
diff --git a/support/dktools/dk4maiwdui.ctr b/support/dktools/dk4maiwdui.ctr
index bcfd84960c..34a9a2b968 100644
--- a/support/dktools/dk4maiwdui.ctr
+++ b/support/dktools/dk4maiwdui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_dec_uint(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddu.h"
#include "dk4maiwdui.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_dec_uint(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UINT_MAX)) >= res) {
*rp = (unsigned)res;
diff --git a/support/dktools/dk4maiwdui.h b/support/dktools/dk4maiwdui.h
index 142d91030a..2b16f9d45e 100644
--- a/support/dktools/dk4maiwdui.h
+++ b/support/dktools/dk4maiwdui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdui.ctr
*/
#ifndef DK4MAIWDUI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdul.c b/support/dktools/dk4maiwdul.c
index f16ee0f715..aacf8a517d 100644
--- a/support/dktools/dk4maiwdul.c
+++ b/support/dktools/dk4maiwdul.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdul.ctr
*/
/** @file dk4maiwdul.c The dk4maiwdul module.
*/
-#line 70 "dk4maiwdul.ctr"
+#line 82 "dk4maiwdul.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwddu.h"
#include "dk4maiwdul.h"
@@ -57,6 +44,10 @@ dk4ma_input_wc_dec_ulong(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULONG_MAX)) >= res) {
*rp = (unsigned long)res;
diff --git a/support/dktools/dk4maiwdul.ctr b/support/dktools/dk4maiwdul.ctr
index 6b222f11af..9e7337cb42 100644
--- a/support/dktools/dk4maiwdul.ctr
+++ b/support/dktools/dk4maiwdul.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_dec_ulong(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddu.h"
#include "dk4maiwdul.h"
#include "dk4numco.h"
@@ -86,6 +107,10 @@ dk4ma_input_wc_dec_ulong(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULONG_MAX)) >= res) {
*rp = (unsigned long)res;
diff --git a/support/dktools/dk4maiwdul.h b/support/dktools/dk4maiwdul.h
index 847c75ef11..3178288592 100644
--- a/support/dktools/dk4maiwdul.h
+++ b/support/dktools/dk4maiwdul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdul.ctr
*/
#ifndef DK4MAIWDUL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwdus.c b/support/dktools/dk4maiwdus.c
index 3cbd96552e..61bf94976f 100644
--- a/support/dktools/dk4maiwdus.c
+++ b/support/dktools/dk4maiwdus.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdus.ctr
*/
/** @file dk4maiwdus.c The dk4maiwdus module.
*/
-#line 70 "dk4maiwdus.ctr"
+#line 82 "dk4maiwdus.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwddu.h"
#include "dk4maiwdus.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_dec_ushort(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(USHRT_MAX)) >= res) {
*rp = (unsigned short)res;
diff --git a/support/dktools/dk4maiwdus.ctr b/support/dktools/dk4maiwdus.ctr
index e3cd64c7b6..126917ba35 100644
--- a/support/dktools/dk4maiwdus.ctr
+++ b/support/dktools/dk4maiwdus.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_dec_ushort(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwddu.h"
#include "dk4maiwdus.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_dec_ushort(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_dec_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(USHRT_MAX)) >= res) {
*rp = (unsigned short)res;
diff --git a/support/dktools/dk4maiwdus.h b/support/dktools/dk4maiwdus.h
index 7300371811..0225d55ca8 100644
--- a/support/dktools/dk4maiwdus.h
+++ b/support/dktools/dk4maiwdus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwdus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwdus.ctr
*/
#ifndef DK4MAIWDUS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhdi.c b/support/dktools/dk4maiwhdi.c
index eeb4b56df3..148ceb69bc 100644
--- a/support/dktools/dk4maiwhdi.c
+++ b/support/dktools/dk4maiwhdi.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhdi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhdi.ctr
*/
/** @file dk4maiwhdi.c The dk4maiwhdi module.
*/
-#line 72 "dk4maiwhdi.ctr"
+#line 84 "dk4maiwhdi.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhdu.h"
#include "dk4maiwhdi.h"
@@ -47,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 80 "dk4maiwhdi.ctr"
+#line 101 "dk4maiwhdi.ctr"
@@ -65,42 +52,46 @@ dk4ma_input_wc_hex_dk4_im_t(
int back = 0;
-#line 96 "dk4maiwhdi.ctr"
+#line 117 "dk4maiwhdi.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (L'-' == *src) {
-#line 98 "dk4maiwhdi.ctr"
+#line 123 "dk4maiwhdi.ctr"
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, ++src, &ep, atg, erp)) {
if (((dk4_um_t)(DK4_IM_MAX) + (dk4_um_t)1UL) == res) {
-#line 100 "dk4maiwhdi.ctr"
+#line 125 "dk4maiwhdi.ctr"
*rp = DK4_IM_MIN;
back = 1;
} else {
if (((dk4_um_t)(DK4_IM_MAX)) >= res) {
-#line 104 "dk4maiwhdi.ctr"
+#line 129 "dk4maiwhdi.ctr"
*rp = (dk4_im_t)0L - (dk4_im_t)res;
back = 1;
} else {
-#line 107 "dk4maiwhdi.ctr"
+#line 132 "dk4maiwhdi.ctr"
dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
}
}
} else {
-#line 111 "dk4maiwhdi.ctr"
+#line 136 "dk4maiwhdi.ctr"
}
} else {
-#line 113 "dk4maiwhdi.ctr"
+#line 138 "dk4maiwhdi.ctr"
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, &ep, atg, erp)) {
*rp = (dk4_im_t)res;
back = 1;
} else {
-#line 117 "dk4maiwhdi.ctr"
+#line 142 "dk4maiwhdi.ctr"
}
}
} else {
@@ -109,7 +100,7 @@ dk4ma_input_wc_hex_dk4_im_t(
if (NULL != endptr) { *endptr = ep; }
-#line 124 "dk4maiwhdi.ctr"
+#line 149 "dk4maiwhdi.ctr"
return back;
}
diff --git a/support/dktools/dk4maiwhdi.ctr b/support/dktools/dk4maiwhdi.ctr
index 14d07a1a53..6e9c8939d4 100644
--- a/support/dktools/dk4maiwhdi.ctr
+++ b/support/dktools/dk4maiwhdi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -70,6 +82,15 @@ dk4ma_input_wc_hex_dk4_im_t(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhdu.h"
#include "dk4maiwhdi.h"
#include "dk4numco.h"
@@ -93,6 +114,10 @@ dk4ma_input_wc_hex_dk4_im_t(
const wchar_t *ep = NULL;
int back = 0;
$? "+ dk4ma_input_wc_hex_dk4_im_t \"%ls\" %d", src, atg
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (L'-' == *src) { $? ". negative"
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, ++src, &ep, atg, erp)) {
diff --git a/support/dktools/dk4maiwhdi.h b/support/dktools/dk4maiwhdi.h
index c9ab793be8..2f75ed34b8 100644
--- a/support/dktools/dk4maiwhdi.h
+++ b/support/dktools/dk4maiwhdi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhdi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhdi.ctr
*/
#ifndef DK4MAIWHDI_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiwhdu.c b/support/dktools/dk4maiwhdu.c
index 6dfc171ecc..21c8472c5f 100644
--- a/support/dktools/dk4maiwhdu.c
+++ b/support/dktools/dk4maiwhdu.c
@@ -1,45 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhdu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhdu.ctr
*/
/** @file dk4maiwhdu.c The dk4maiwhdu module.
*/
-#line 70 "dk4maiwhdu.ctr"
+#line 81 "dk4maiwhdu.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhdu.h"
#include "dk4numco.h"
@@ -49,7 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 80 "dk4maiwhdu.ctr"
+#line 100 "dk4maiwhdu.ctr"
@@ -71,7 +58,11 @@ dk4ma_input_wc_hex_dk4_um_t(
int cc = 1;
-#line 100 "dk4maiwhdu.ctr"
+#line 120 "dk4maiwhdu.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (L'0' == src[0]) {
if ((L'x' == src[1]) || (L'X' == src[1])) { src++; src++; }
@@ -98,16 +89,16 @@ dk4ma_input_wc_hex_dk4_um_t(
case L'f': case L'F': { op = (dk4_um_t)15UL; } break;
case L'\0': {
-#line 125 "dk4maiwhdu.ctr"
+#line 149 "dk4maiwhdu.ctr"
cc = 0;
if (0 != found) {
-#line 127 "dk4maiwhdu.ctr"
+#line 151 "dk4maiwhdu.ctr"
back = 1;
*rp = result;
} else {
-#line 130 "dk4maiwhdu.ctr"
+#line 154 "dk4maiwhdu.ctr"
ep = src;
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
@@ -275,7 +266,7 @@ dk4ma_input_wc_hex_dk4_um_t(
if (NULL != endptr) { *endptr = ep; }
-#line 296 "dk4maiwhdu.ctr"
+#line 320 "dk4maiwhdu.ctr"
return back;
}
diff --git a/support/dktools/dk4maiwhdu.ctr b/support/dktools/dk4maiwhdu.ctr
index a200767d9a..7fe8801801 100644
--- a/support/dktools/dk4maiwhdu.ctr
+++ b/support/dktools/dk4maiwhdu.ctr
@@ -2,8 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
-
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -16,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -70,6 +81,15 @@ dk4ma_input_wc_hex_dk4_um_t(
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhdu.h"
#include "dk4numco.h"
#include "dk4strw.h"
@@ -97,6 +117,10 @@ dk4ma_input_wc_hex_dk4_um_t(
int back = 0;
int cc = 1;
$? "+ dk4ma_input_wc_hex_dk4_um_t"
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if ((NULL != rp) && (NULL != src)) {
if (L'0' == src[0]) {
if ((L'x' == src[1]) || (L'X' == src[1])) { src++; src++; }
diff --git a/support/dktools/dk4maiwhdu.h b/support/dktools/dk4maiwhdu.h
index ae3a54d884..2ac229ae2d 100644
--- a/support/dktools/dk4maiwhdu.h
+++ b/support/dktools/dk4maiwhdu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhdu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhdu.ctr
*/
#ifndef DK4MAIWHDU_H_INCLUDED
@@ -38,7 +16,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DK4MAIWHDU_H_INCLUDED 1
-#line 10 "dk4maiwhdu.ctr"
+#line 9 "dk4maiwhdu.ctr"
/** @file
Retrieve dk4_um_t value from
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4maiwhic.c b/support/dktools/dk4maiwhic.c
index 6e3cf008f7..84b9865705 100644
--- a/support/dktools/dk4maiwhic.c
+++ b/support/dktools/dk4maiwhic.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhic.ctr
*/
/** @file dk4maiwhic.c The dk4maiwhic module.
*/
-#line 70 "dk4maiwhic.ctr"
+#line 82 "dk4maiwhic.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhic.h"
#include "dk4maiwhdi.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_hex_char(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(CHAR_MIN) <= res) && ((dk4_im_t)(CHAR_MAX) >= res)) {
*rp = (signed char)res;
diff --git a/support/dktools/dk4maiwhic.ctr b/support/dktools/dk4maiwhic.ctr
index fe30478b64..4e5a7c6984 100644
--- a/support/dktools/dk4maiwhic.ctr
+++ b/support/dktools/dk4maiwhic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_hex_char(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhic.h"
#include "dk4maiwhdi.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_hex_char(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(CHAR_MIN) <= res) && ((dk4_im_t)(CHAR_MAX) >= res)) {
*rp = (signed char)res;
diff --git a/support/dktools/dk4maiwhic.h b/support/dktools/dk4maiwhic.h
index 4778105453..9761d2ade5 100644
--- a/support/dktools/dk4maiwhic.h
+++ b/support/dktools/dk4maiwhic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhic.ctr
*/
#ifndef DK4MAIWHIC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhii.c b/support/dktools/dk4maiwhii.c
index 82a71745bf..9e73ab7c42 100644
--- a/support/dktools/dk4maiwhii.c
+++ b/support/dktools/dk4maiwhii.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhii.ctr
*/
/** @file dk4maiwhii.c The dk4maiwhii module.
*/
-#line 70 "dk4maiwhii.ctr"
+#line 82 "dk4maiwhii.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhdi.h"
#include "dk4maiwhii.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_hex_int(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(INT_MIN) <= res) && (((dk4_im_t)(INT_MAX)) >= res)) {
*rp = (int)res;
diff --git a/support/dktools/dk4maiwhii.ctr b/support/dktools/dk4maiwhii.ctr
index dd99a1d631..f7724151c1 100644
--- a/support/dktools/dk4maiwhii.ctr
+++ b/support/dktools/dk4maiwhii.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_hex_int(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhdi.h"
#include "dk4maiwhii.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_hex_int(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(INT_MIN) <= res) && (((dk4_im_t)(INT_MAX)) >= res)) {
*rp = (int)res;
diff --git a/support/dktools/dk4maiwhii.h b/support/dktools/dk4maiwhii.h
index df2b91cbae..fde29baaf9 100644
--- a/support/dktools/dk4maiwhii.h
+++ b/support/dktools/dk4maiwhii.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhii.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhii.ctr
*/
#ifndef DK4MAIWHII_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhil.c b/support/dktools/dk4maiwhil.c
index d734c386aa..9c4db9b82a 100644
--- a/support/dktools/dk4maiwhil.c
+++ b/support/dktools/dk4maiwhil.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhil.ctr
*/
/** @file dk4maiwhil.c The dk4maiwhil module.
*/
-#line 70 "dk4maiwhil.ctr"
+#line 82 "dk4maiwhil.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhdi.h"
#include "dk4maiwhil.h"
@@ -57,6 +44,10 @@ dk4ma_input_wc_hex_long(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LONG_MIN) <= res) && (((dk4_im_t)(LONG_MAX)) >= res)) {
*rp = (long)res;
diff --git a/support/dktools/dk4maiwhil.ctr b/support/dktools/dk4maiwhil.ctr
index bd65868144..4a112cd196 100644
--- a/support/dktools/dk4maiwhil.ctr
+++ b/support/dktools/dk4maiwhil.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_hex_long(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhdi.h"
#include "dk4maiwhil.h"
#include "dk4numco.h"
@@ -86,6 +107,10 @@ dk4ma_input_wc_hex_long(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LONG_MIN) <= res) && (((dk4_im_t)(LONG_MAX)) >= res)) {
*rp = (long)res;
diff --git a/support/dktools/dk4maiwhil.h b/support/dktools/dk4maiwhil.h
index 795b5119fc..f304201bfc 100644
--- a/support/dktools/dk4maiwhil.h
+++ b/support/dktools/dk4maiwhil.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhil.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhil.ctr
*/
#ifndef DK4MAIWHIL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhis.c b/support/dktools/dk4maiwhis.c
index 99469a5ce0..e05e6ba697 100644
--- a/support/dktools/dk4maiwhis.c
+++ b/support/dktools/dk4maiwhis.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhis.ctr
*/
/** @file dk4maiwhis.c The dk4maiwhis module.
*/
-#line 70 "dk4maiwhis.ctr"
+#line 82 "dk4maiwhis.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhdi.h"
#include "dk4maiwhis.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_hex_short(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(SHRT_MIN) <= res) && (((dk4_im_t)(SHRT_MAX)) >= res)) {
*rp = (short)res;
diff --git a/support/dktools/dk4maiwhis.ctr b/support/dktools/dk4maiwhis.ctr
index c1f441bede..f33bcbfc59 100644
--- a/support/dktools/dk4maiwhis.ctr
+++ b/support/dktools/dk4maiwhis.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_hex_short(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhdi.h"
#include "dk4maiwhis.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_hex_short(
{
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(SHRT_MIN) <= res) && (((dk4_im_t)(SHRT_MAX)) >= res)) {
*rp = (short)res;
diff --git a/support/dktools/dk4maiwhis.h b/support/dktools/dk4maiwhis.h
index 08e884f409..a53571dbf5 100644
--- a/support/dktools/dk4maiwhis.h
+++ b/support/dktools/dk4maiwhis.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhis.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhis.ctr
*/
#ifndef DK4MAIWHIS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhli.c b/support/dktools/dk4maiwhli.c
index 6635e12325..69877a6577 100644
--- a/support/dktools/dk4maiwhli.c
+++ b/support/dktools/dk4maiwhli.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhli.ctr
*/
/** @file dk4maiwhli.c The dk4maiwhli module.
*/
-#line 74 "dk4maiwhli.ctr"
+#line 86 "dk4maiwhli.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4maiwhdi.h"
@@ -61,6 +46,10 @@ dk4ma_input_wc_hex_ll(
#if DK4_HAVE_INTMAX_T
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LLONG_MIN) <= res) && (((dk4_im_t)(LLONG_MAX)) >= res)) {
*rp = (long long)res;
diff --git a/support/dktools/dk4maiwhli.ctr b/support/dktools/dk4maiwhli.ctr
index b78f85064f..cad4ee96fc 100644
--- a/support/dktools/dk4maiwhli.ctr
+++ b/support/dktools/dk4maiwhli.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -74,6 +86,13 @@ dk4ma_input_wc_hex_ll(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4maiwhdi.h"
@@ -94,6 +113,10 @@ dk4ma_input_wc_hex_ll(
#if DK4_HAVE_INTMAX_T
dk4_im_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_im_t(&res, src, endptr, atg, erp)) {
if (((dk4_im_t)(LLONG_MIN) <= res) && (((dk4_im_t)(LLONG_MAX)) >= res)) {
*rp = (long long)res;
diff --git a/support/dktools/dk4maiwhli.h b/support/dktools/dk4maiwhli.h
index d97bcb389b..2588b67415 100644
--- a/support/dktools/dk4maiwhli.h
+++ b/support/dktools/dk4maiwhli.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhli.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhli.ctr
*/
#ifndef DK4MAIWHLI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhlu.c b/support/dktools/dk4maiwhlu.c
index 5d07aee5db..48ed185efa 100644
--- a/support/dktools/dk4maiwhlu.c
+++ b/support/dktools/dk4maiwhlu.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhlu.ctr
*/
/** @file dk4maiwhlu.c The dk4maiwhlu module.
*/
-#line 74 "dk4maiwhlu.ctr"
+#line 86 "dk4maiwhlu.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4maiwhdu.h"
@@ -61,6 +46,10 @@ dk4ma_input_wc_hex_ull(
#if DK4_HAVE_INTMAX_T
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULLONG_MAX)) >= res) {
*rp = (unsigned long long)res;
diff --git a/support/dktools/dk4maiwhlu.ctr b/support/dktools/dk4maiwhlu.ctr
index 082f036f95..c9703c55fd 100644
--- a/support/dktools/dk4maiwhlu.ctr
+++ b/support/dktools/dk4maiwhlu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -74,6 +86,13 @@ dk4ma_input_wc_hex_ull(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LONG_LONG
#include "dk4maiwhdu.h"
@@ -94,6 +113,10 @@ dk4ma_input_wc_hex_ull(
#if DK4_HAVE_INTMAX_T
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULLONG_MAX)) >= res) {
*rp = (unsigned long long)res;
diff --git a/support/dktools/dk4maiwhlu.h b/support/dktools/dk4maiwhlu.h
index 39e63e0d9e..a49b3fb645 100644
--- a/support/dktools/dk4maiwhlu.h
+++ b/support/dktools/dk4maiwhlu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhlu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhlu.ctr
*/
#ifndef DK4MAIWHLU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LONG_LONG
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhmi.c b/support/dktools/dk4maiwhmi.c
index 0a1bab88aa..86a17b6ab3 100644
--- a/support/dktools/dk4maiwhmi.c
+++ b/support/dktools/dk4maiwhmi.c
@@ -1,54 +1,50 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhmi.ctr
*/
/** @file dk4maiwhmi.c The dk4maiwhmi module.
*/
-#line 75 "dk4maiwhmi.ctr"
+#line 87 "dk4maiwhmi.ctr"
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
#if DK4_HAVE_INTMAX_T
+#ifndef DK4MAIWHDI_H_INCLUDED
#include "dk4maiwhdi.h"
+#endif
+
+#ifndef DK4MAIWHMI_H_INCLUDED
#include "dk4maiwhmi.h"
+#endif
+
+
int
dk4ma_input_wc_hex_intmax_t(
@@ -59,6 +55,10 @@ dk4ma_input_wc_hex_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_wc_hex_dk4_im_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4maiwhmi.ctr b/support/dktools/dk4maiwhmi.ctr
index 56004e1875..f84fcbe017 100644
--- a/support/dktools/dk4maiwhmi.ctr
+++ b/support/dktools/dk4maiwhmi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -75,14 +87,32 @@ dk4ma_input_wc_hex_intmax_t(
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
#if DK4_HAVE_INTMAX_T
+#ifndef DK4MAIWHDI_H_INCLUDED
#include "dk4maiwhdi.h"
+#endif
+
+#ifndef DK4MAIWHMI_H_INCLUDED
#include "dk4maiwhmi.h"
+#endif
+
+
int
dk4ma_input_wc_hex_intmax_t(
@@ -93,6 +123,10 @@ dk4ma_input_wc_hex_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_wc_hex_dk4_im_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4maiwhmi.h b/support/dktools/dk4maiwhmi.h
index 723b1e5f9e..c224f18717 100644
--- a/support/dktools/dk4maiwhmi.h
+++ b/support/dktools/dk4maiwhmi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhmi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhmi.ctr
*/
#ifndef DK4MAIWHMI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhmu.c b/support/dktools/dk4maiwhmu.c
index fce3e0744e..4e575bf406 100644
--- a/support/dktools/dk4maiwhmu.c
+++ b/support/dktools/dk4maiwhmu.c
@@ -1,54 +1,50 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhmu.ctr
*/
/** @file dk4maiwhmu.c The dk4maiwhmu module.
*/
-#line 75 "dk4maiwhmu.ctr"
+#line 87 "dk4maiwhmu.ctr"
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
#if DK4_HAVE_INTMAX_T
+#ifndef DK4MAIWHDU_H_INCLUDED
#include "dk4maiwhdu.h"
+#endif
+
+#ifndef DK4MAIWHMU_H_INCLUDED
#include "dk4maiwhmu.h"
+#endif
+
+
int
dk4ma_input_wc_hex_uintmax_t(
@@ -59,6 +55,10 @@ dk4ma_input_wc_hex_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_wc_hex_dk4_um_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4maiwhmu.ctr b/support/dktools/dk4maiwhmu.ctr
index cfa93cf68b..42d318bac5 100644
--- a/support/dktools/dk4maiwhmu.ctr
+++ b/support/dktools/dk4maiwhmu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -75,14 +87,32 @@ dk4ma_input_wc_hex_uintmax_t(
#include "dk4conf.h"
-#if DK4_ON_WINDOWS
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
#if DK4_HAVE_INTMAX_T
+#ifndef DK4MAIWHDU_H_INCLUDED
#include "dk4maiwhdu.h"
+#endif
+
+#ifndef DK4MAIWHMU_H_INCLUDED
#include "dk4maiwhmu.h"
+#endif
+
+
int
dk4ma_input_wc_hex_uintmax_t(
@@ -93,6 +123,10 @@ dk4ma_input_wc_hex_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
return (dk4ma_input_wc_hex_dk4_um_t(rp, src, endptr, atg, erp));
}
diff --git a/support/dktools/dk4maiwhmu.h b/support/dktools/dk4maiwhmu.h
index 83042ca22f..2f83402b17 100644
--- a/support/dktools/dk4maiwhmu.h
+++ b/support/dktools/dk4maiwhmu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhmu.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhmu.ctr
*/
#ifndef DK4MAIWHMU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhuc.c b/support/dktools/dk4maiwhuc.c
index 71bfe28117..e6baeac715 100644
--- a/support/dktools/dk4maiwhuc.c
+++ b/support/dktools/dk4maiwhuc.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhuc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhuc.ctr
*/
/** @file dk4maiwhuc.c The dk4maiwhuc module.
*/
-#line 71 "dk4maiwhuc.ctr"
+#line 83 "dk4maiwhuc.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhuc.h"
#include "dk4maiwhdu.h"
@@ -56,7 +43,10 @@ dk4ma_input_wc_hex_uchar(
{
dk4_um_t res;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UCHAR_MAX)) >= res) {
*rp = (unsigned char)res;
diff --git a/support/dktools/dk4maiwhuc.ctr b/support/dktools/dk4maiwhuc.ctr
index ec100d5d6d..3e9ecd1862 100644
--- a/support/dktools/dk4maiwhuc.ctr
+++ b/support/dktools/dk4maiwhuc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -69,6 +81,15 @@ dk4ma_input_wc_hex_uchar(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhuc.h"
#include "dk4maiwhdu.h"
#include "dk4numco.h"
@@ -86,7 +107,10 @@ dk4ma_input_wc_hex_uchar(
{
dk4_um_t res;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UCHAR_MAX)) >= res) {
*rp = (unsigned char)res;
diff --git a/support/dktools/dk4maiwhuc.h b/support/dktools/dk4maiwhuc.h
index 091b82dbdc..e6100ffdd0 100644
--- a/support/dktools/dk4maiwhuc.h
+++ b/support/dktools/dk4maiwhuc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhuc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhuc.ctr
*/
#ifndef DK4MAIWHUC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhui.c b/support/dktools/dk4maiwhui.c
index 11127b3772..62591ce17f 100644
--- a/support/dktools/dk4maiwhui.c
+++ b/support/dktools/dk4maiwhui.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhui.ctr
*/
/** @file dk4maiwhui.c The dk4maiwhui module.
*/
-#line 70 "dk4maiwhui.ctr"
+#line 82 "dk4maiwhui.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhdu.h"
#include "dk4maiwhui.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_hex_uint(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UINT_MAX)) >= res) {
*rp = (unsigned)res;
diff --git a/support/dktools/dk4maiwhui.ctr b/support/dktools/dk4maiwhui.ctr
index 7ebfa4cc4b..8092c56796 100644
--- a/support/dktools/dk4maiwhui.ctr
+++ b/support/dktools/dk4maiwhui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_hex_uint(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhdu.h"
#include "dk4maiwhui.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_hex_uint(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(UINT_MAX)) >= res) {
*rp = (unsigned)res;
diff --git a/support/dktools/dk4maiwhui.h b/support/dktools/dk4maiwhui.h
index e80c479e5c..333583d5ff 100644
--- a/support/dktools/dk4maiwhui.h
+++ b/support/dktools/dk4maiwhui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhui.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhui.ctr
*/
#ifndef DK4MAIWHUI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhul.c b/support/dktools/dk4maiwhul.c
index d3586ebd90..5b7fea4f65 100644
--- a/support/dktools/dk4maiwhul.c
+++ b/support/dktools/dk4maiwhul.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhul.ctr
*/
/** @file dk4maiwhul.c The dk4maiwhul module.
*/
-#line 70 "dk4maiwhul.ctr"
+#line 82 "dk4maiwhul.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhdu.h"
#include "dk4maiwhul.h"
@@ -57,6 +44,10 @@ dk4ma_input_wc_hex_ulong(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULONG_MAX)) >= res) {
*rp = (unsigned long)res;
diff --git a/support/dktools/dk4maiwhul.ctr b/support/dktools/dk4maiwhul.ctr
index 7dd85ad499..c869b3b13a 100644
--- a/support/dktools/dk4maiwhul.ctr
+++ b/support/dktools/dk4maiwhul.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_hex_ulong(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhdu.h"
#include "dk4maiwhul.h"
#include "dk4numco.h"
@@ -86,6 +107,10 @@ dk4ma_input_wc_hex_ulong(
#if DK4_HAVE_INTMAX_T || DK4_HAVE_LONG_LONG
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(ULONG_MAX)) >= res) {
*rp = (unsigned long)res;
diff --git a/support/dktools/dk4maiwhul.h b/support/dktools/dk4maiwhul.h
index 1411bde74e..5f7d55e926 100644
--- a/support/dktools/dk4maiwhul.h
+++ b/support/dktools/dk4maiwhul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhul.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhul.ctr
*/
#ifndef DK4MAIWHUL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maiwhus.c b/support/dktools/dk4maiwhus.c
index 113ddf9838..9274335b9b 100644
--- a/support/dktools/dk4maiwhus.c
+++ b/support/dktools/dk4maiwhus.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhus.ctr
*/
/** @file dk4maiwhus.c The dk4maiwhus module.
*/
-#line 70 "dk4maiwhus.ctr"
+#line 82 "dk4maiwhus.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maiwhdu.h"
#include "dk4maiwhus.h"
@@ -56,6 +43,10 @@ dk4ma_input_wc_hex_ushort(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(USHRT_MAX)) >= res) {
*rp = (unsigned short)res;
diff --git a/support/dktools/dk4maiwhus.ctr b/support/dktools/dk4maiwhus.ctr
index bbd729015c..da993555e5 100644
--- a/support/dktools/dk4maiwhus.ctr
+++ b/support/dktools/dk4maiwhus.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -68,6 +80,15 @@ dk4ma_input_wc_hex_ushort(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maiwhdu.h"
#include "dk4maiwhus.h"
#include "dk4numco.h"
@@ -85,6 +106,10 @@ dk4ma_input_wc_hex_ushort(
{
dk4_um_t res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
if (0 != dk4ma_input_wc_hex_dk4_um_t(&res, src, endptr, atg, erp)) {
if (((dk4_um_t)(USHRT_MAX)) >= res) {
*rp = (unsigned short)res;
diff --git a/support/dktools/dk4maiwhus.h b/support/dktools/dk4maiwhus.h
index 68eb82f82c..cf9d87e6c8 100644
--- a/support/dktools/dk4maiwhus.h
+++ b/support/dktools/dk4maiwhus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maiwhus.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maiwhus.ctr
*/
#ifndef DK4MAIWHUS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdbl.cpp b/support/dktools/dk4maixdbl.cpp
index 732897ca33..aff69445ac 100644
--- a/support/dktools/dk4maixdbl.cpp
+++ b/support/dktools/dk4maixdbl.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdbl.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdbl.cpt
*/
/** @file dk4maixdbl.cpp The dk4maixdbl module.
*/
-#line 106 "dk4maixdbl.cpt"
+#line 118 "dk4maixdbl.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dbl.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4ma_input_wx_double(
@@ -69,6 +58,10 @@ dk4ma_input_wx_double(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_input_wc_double(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdbl.cpt b/support/dktools/dk4maixdbl.cpt
index 688dc69119..28497ff757 100644
--- a/support/dktools/dk4maixdbl.cpt
+++ b/support/dktools/dk4maixdbl.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -106,6 +118,11 @@ dk4ma_input_wx_double(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -124,6 +141,12 @@ dk4ma_input_wx_double(
#include "dk4mai8dbl.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4ma_input_wx_double(
@@ -134,6 +157,10 @@ dk4ma_input_wx_double(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_input_wc_double(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdbl.h b/support/dktools/dk4maixdbl.h
index 4fd92fccd0..af37254bbb 100644
--- a/support/dktools/dk4maixdbl.h
+++ b/support/dktools/dk4maixdbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdbl.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdbl.cpt
*/
#ifndef DK4MAIXDBL_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixddi.cpp b/support/dktools/dk4maixddi.cpp
index c662f5844b..614986237f 100644
--- a/support/dktools/dk4maixddi.cpp
+++ b/support/dktools/dk4maixddi.cpp
@@ -1,47 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixddi.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixddi.cpt
*/
/** @file dk4maixddi.cpp The dk4maixddi module.
*/
-#line 96 "dk4maixddi.cpt"
+#line 108 "dk4maixddi.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -60,6 +43,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8ddi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -71,6 +60,10 @@ dk4ma_input_wx_dec_dk4_im_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_input_wc_dec_dk4_im_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixddi.cpt b/support/dktools/dk4maixddi.cpt
index abfc349399..16ef1a3601 100644
--- a/support/dktools/dk4maixddi.cpt
+++ b/support/dktools/dk4maixddi.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -97,6 +109,11 @@ dk4ma_input_wx_dec_dk4_im_t(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -115,6 +132,12 @@ dk4ma_input_wx_dec_dk4_im_t(
#include "dk4mai8ddi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -126,6 +149,10 @@ dk4ma_input_wx_dec_dk4_im_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_input_wc_dec_dk4_im_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixddi.h b/support/dktools/dk4maixddi.h
index d4e1c944d5..8983e24098 100644
--- a/support/dktools/dk4maixddi.h
+++ b/support/dktools/dk4maixddi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixddi.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixddi.cpt
*/
#ifndef DK4MAIXDDI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
diff --git a/support/dktools/dk4maixddu.cpp b/support/dktools/dk4maixddu.cpp
index 19cb51d863..bf8fcfdaaf 100644
--- a/support/dktools/dk4maixddu.cpp
+++ b/support/dktools/dk4maixddu.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixddu.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixddu.cpt
*/
/** @file dk4maixddu.cpp The dk4maixddu module.
*/
-#line 96 "dk4maixddu.cpt"
+#line 108 "dk4maixddu.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8ddu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_dk4_um_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_dk4_um_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixddu.cpt b/support/dktools/dk4maixddu.cpt
index b1a2dc5178..86c4fb3fad 100644
--- a/support/dktools/dk4maixddu.cpt
+++ b/support/dktools/dk4maixddu.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -96,6 +108,11 @@ dk4ma_input_wx_dec_dk4_um_t(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -114,6 +131,12 @@ dk4ma_input_wx_dec_dk4_um_t(
#include "dk4mai8ddu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -125,6 +148,10 @@ dk4ma_input_wx_dec_dk4_um_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_dk4_um_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixddu.h b/support/dktools/dk4maixddu.h
index 10ff0999eb..8490bab611 100644
--- a/support/dktools/dk4maixddu.h
+++ b/support/dktools/dk4maixddu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixddu.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixddu.cpt
*/
#ifndef DK4MAIXDDU_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
diff --git a/support/dktools/dk4maixdic.cpp b/support/dktools/dk4maixdic.cpp
index 2183c0fad2..6cba58da53 100644
--- a/support/dktools/dk4maixdic.cpp
+++ b/support/dktools/dk4maixdic.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdic.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdic.cpt
*/
/** @file dk4maixdic.cpp The dk4maixdic module.
*/
-#line 99 "dk4maixdic.cpt"
+#line 111 "dk4maixdic.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dic.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_char(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_char(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdic.cpt b/support/dktools/dk4maixdic.cpt
index 961da1f6a1..f9f328babb 100644
--- a/support/dktools/dk4maixdic.cpt
+++ b/support/dktools/dk4maixdic.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -99,6 +111,11 @@ dk4ma_input_wx_dec_char(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -117,6 +134,12 @@ dk4ma_input_wx_dec_char(
#include "dk4mai8dic.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -128,6 +151,10 @@ dk4ma_input_wx_dec_char(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_char(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdic.h b/support/dktools/dk4maixdic.h
index 7e6eae86d5..60ede58ff5 100644
--- a/support/dktools/dk4maixdic.h
+++ b/support/dktools/dk4maixdic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdic.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdic.cpt
*/
#ifndef DK4MAIXDIC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdii.cpp b/support/dktools/dk4maixdii.cpp
index a7a5c55849..b2a874dc3f 100644
--- a/support/dktools/dk4maixdii.cpp
+++ b/support/dktools/dk4maixdii.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdii.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdii.cpt
*/
/** @file dk4maixdii.cpp The dk4maixdii module.
*/
-#line 101 "dk4maixdii.cpt"
+#line 113 "dk4maixdii.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dii.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_int(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_int(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdii.cpt b/support/dktools/dk4maixdii.cpt
index 5572295433..0396b845c3 100644
--- a/support/dktools/dk4maixdii.cpt
+++ b/support/dktools/dk4maixdii.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -101,6 +113,11 @@ dk4ma_input_wx_dec_int(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -119,6 +136,12 @@ dk4ma_input_wx_dec_int(
#include "dk4mai8dii.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -130,6 +153,10 @@ dk4ma_input_wx_dec_int(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_int(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdii.h b/support/dktools/dk4maixdii.h
index e061d2ddc5..61eb92c610 100644
--- a/support/dktools/dk4maixdii.h
+++ b/support/dktools/dk4maixdii.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdii.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdii.cpt
*/
#ifndef DK4MAIXDII_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdil.cpp b/support/dktools/dk4maixdil.cpp
index 00b9452a93..843fcc7594 100644
--- a/support/dktools/dk4maixdil.cpp
+++ b/support/dktools/dk4maixdil.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdil.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdil.cpt
*/
/** @file dk4maixdil.cpp The dk4maixdil module.
*/
-#line 102 "dk4maixdil.cpt"
+#line 114 "dk4maixdil.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dil.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_long(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_long(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdil.cpt b/support/dktools/dk4maixdil.cpt
index e90fd711f0..78ffd2494c 100644
--- a/support/dktools/dk4maixdil.cpt
+++ b/support/dktools/dk4maixdil.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -102,6 +114,11 @@ dk4ma_input_wx_dec_long(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -120,6 +137,12 @@ dk4ma_input_wx_dec_long(
#include "dk4mai8dil.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -131,6 +154,10 @@ dk4ma_input_wx_dec_long(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_long(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdil.h b/support/dktools/dk4maixdil.h
index e58949e32f..9236562d99 100644
--- a/support/dktools/dk4maixdil.h
+++ b/support/dktools/dk4maixdil.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdil.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdil.cpt
*/
#ifndef DK4MAIXDIL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdis.cpp b/support/dktools/dk4maixdis.cpp
index d96d4e6e64..be32f63741 100644
--- a/support/dktools/dk4maixdis.cpp
+++ b/support/dktools/dk4maixdis.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdis.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdis.cpt
*/
/** @file dk4maixdis.cpp The dk4maixdis module.
*/
-#line 103 "dk4maixdis.cpt"
+#line 115 "dk4maixdis.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dis.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_short(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_short(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdis.cpt b/support/dktools/dk4maixdis.cpt
index 6274eb41af..00187e85b5 100644
--- a/support/dktools/dk4maixdis.cpt
+++ b/support/dktools/dk4maixdis.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -103,6 +115,11 @@ dk4ma_input_wx_dec_short(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -121,6 +138,12 @@ dk4ma_input_wx_dec_short(
#include "dk4mai8dis.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -132,6 +155,10 @@ dk4ma_input_wx_dec_short(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_short(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdis.h b/support/dktools/dk4maixdis.h
index 77a6560c33..caafaa3fd7 100644
--- a/support/dktools/dk4maixdis.h
+++ b/support/dktools/dk4maixdis.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdis.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdis.cpt
*/
#ifndef DK4MAIXDIS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdli.cpp b/support/dktools/dk4maixdli.cpp
index de08c58f99..f6d57ab50e 100644
--- a/support/dktools/dk4maixdli.cpp
+++ b/support/dktools/dk4maixdli.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdli.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdli.cpt
*/
/** @file dk4maixdli.cpp The dk4maixdli module.
*/
-#line 103 "dk4maixdli.cpt"
+#line 115 "dk4maixdli.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dli.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_ll(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_ll(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdli.cpt b/support/dktools/dk4maixdli.cpt
index 1665b0af7e..17bfe56ed7 100644
--- a/support/dktools/dk4maixdli.cpt
+++ b/support/dktools/dk4maixdli.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -103,6 +115,11 @@ dk4ma_input_wx_dec_ll(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -121,6 +138,12 @@ dk4ma_input_wx_dec_ll(
#include "dk4mai8dli.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -132,6 +155,10 @@ dk4ma_input_wx_dec_ll(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_ll(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdli.h b/support/dktools/dk4maixdli.h
index ff0de1cc74..fddd9a818e 100644
--- a/support/dktools/dk4maixdli.h
+++ b/support/dktools/dk4maixdli.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdli.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdli.cpt
*/
#ifndef DK4MAIXDLI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdlu.cpp b/support/dktools/dk4maixdlu.cpp
index 2941628d0c..cbb2c298dc 100644
--- a/support/dktools/dk4maixdlu.cpp
+++ b/support/dktools/dk4maixdlu.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdlu.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdlu.cpt
*/
/** @file dk4maixdlu.cpp The dk4maixdlu module.
*/
-#line 102 "dk4maixdlu.cpt"
+#line 114 "dk4maixdlu.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dlu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_ull(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_ull(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdlu.cpt b/support/dktools/dk4maixdlu.cpt
index e793f44cd3..c7d671c6f7 100644
--- a/support/dktools/dk4maixdlu.cpt
+++ b/support/dktools/dk4maixdlu.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -102,6 +114,11 @@ dk4ma_input_wx_dec_ull(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -120,6 +137,12 @@ dk4ma_input_wx_dec_ull(
#include "dk4mai8dlu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -131,6 +154,10 @@ dk4ma_input_wx_dec_ull(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_ull(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdlu.h b/support/dktools/dk4maixdlu.h
index fdbba8cf57..720f7d0fe2 100644
--- a/support/dktools/dk4maixdlu.h
+++ b/support/dktools/dk4maixdlu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdlu.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdlu.cpt
*/
#ifndef DK4MAIXDLU_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdmi.cpp b/support/dktools/dk4maixdmi.cpp
index 481d7b488b..ef1fd075c3 100644
--- a/support/dktools/dk4maixdmi.cpp
+++ b/support/dktools/dk4maixdmi.cpp
@@ -1,46 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdmi.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdmi.cpt
*/
/** @file dk4maixdmi.cpp The dk4maixdmi module.
*/
-#line 106 "dk4maixdmi.cpt"
+#line 118 "dk4maixdmi.cpt"
#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -49,7 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maixdmi.h"
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -65,6 +52,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dmi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -76,6 +69,10 @@ dk4ma_input_wx_dec_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_intmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdmi.cpt b/support/dktools/dk4maixdmi.cpt
index e04a34856b..7b6ab37f52 100644
--- a/support/dktools/dk4maixdmi.cpt
+++ b/support/dktools/dk4maixdmi.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -106,6 +118,15 @@ dk4ma_input_wx_dec_intmax_t(
#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -114,7 +135,7 @@ dk4ma_input_wx_dec_intmax_t(
#include "dk4maixdmi.h"
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -130,6 +151,12 @@ dk4ma_input_wx_dec_intmax_t(
#include "dk4mai8dmi.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -141,6 +168,10 @@ dk4ma_input_wx_dec_intmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_intmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdmi.h b/support/dktools/dk4maixdmi.h
index fc746cd40c..78b31254f2 100644
--- a/support/dktools/dk4maixdmi.h
+++ b/support/dktools/dk4maixdmi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdmi.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdmi.cpt
*/
#ifndef DK4MAIXDMI_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdmu.cpp b/support/dktools/dk4maixdmu.cpp
index b76b0d8bd3..e9629fb7cb 100644
--- a/support/dktools/dk4maixdmu.cpp
+++ b/support/dktools/dk4maixdmu.cpp
@@ -1,47 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdmu.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdmu.cpt
*/
/** @file dk4maixdmu.cpp The dk4maixdmu module.
*/
-#line 108 "dk4maixdmu.cpt"
+#line 120 "dk4maixdmu.cpt"
#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -50,7 +37,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maixdmu.h"
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -68,6 +55,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dmu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -79,6 +72,10 @@ dk4ma_input_wx_dec_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_uintmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdmu.cpt b/support/dktools/dk4maixdmu.cpt
index 2668df1bb6..e1a9ced34a 100644
--- a/support/dktools/dk4maixdmu.cpt
+++ b/support/dktools/dk4maixdmu.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -109,6 +121,15 @@ dk4ma_input_wx_dec_uintmax_t(
#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -117,7 +138,7 @@ dk4ma_input_wx_dec_uintmax_t(
#include "dk4maixdmu.h"
-#if DK4_ON_WINDOWS
+#if DK4_USE_PRAGMA_WARNING_DISABLE
#pragma warning (disable:4206)
#endif
@@ -135,6 +156,12 @@ dk4ma_input_wx_dec_uintmax_t(
#include "dk4mai8dmu.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -146,6 +173,10 @@ dk4ma_input_wx_dec_uintmax_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_uintmax_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdmu.h b/support/dktools/dk4maixdmu.h
index daec3b709d..bcdc2d5e8a 100644
--- a/support/dktools/dk4maixdmu.h
+++ b/support/dktools/dk4maixdmu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdmu.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdmu.cpt
*/
#ifndef DK4MAIXDMU_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_INTMAX_T
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdsz.cpp b/support/dktools/dk4maixdsz.cpp
index 96af7ef6d0..5f01acd972 100644
--- a/support/dktools/dk4maixdsz.cpp
+++ b/support/dktools/dk4maixdsz.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdsz.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdsz.cpt
*/
/** @file dk4maixdsz.cpp The dk4maixdsz module.
*/
-#line 103 "dk4maixdsz.cpt"
+#line 115 "dk4maixdsz.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dsz.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_size_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_size_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdsz.cpt b/support/dktools/dk4maixdsz.cpt
index a005393e83..59c19713e7 100644
--- a/support/dktools/dk4maixdsz.cpt
+++ b/support/dktools/dk4maixdsz.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -103,6 +115,11 @@ dk4ma_input_wx_dec_size_t(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -121,6 +138,12 @@ dk4ma_input_wx_dec_size_t(
#include "dk4mai8dsz.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -132,6 +155,10 @@ dk4ma_input_wx_dec_size_t(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_size_t(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdsz.h b/support/dktools/dk4maixdsz.h
index 67f3eb09d3..c0748a4421 100644
--- a/support/dktools/dk4maixdsz.h
+++ b/support/dktools/dk4maixdsz.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdsz.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdsz.cpt
*/
#ifndef DK4MAIXDSZ_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixduc.cpp b/support/dktools/dk4maixduc.cpp
index 201f15d372..6113bdedd2 100644
--- a/support/dktools/dk4maixduc.cpp
+++ b/support/dktools/dk4maixduc.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixduc.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixduc.cpt
*/
/** @file dk4maixduc.cpp The dk4maixduc module.
*/
-#line 102 "dk4maixduc.cpt"
+#line 114 "dk4maixduc.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8duc.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_uchar(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_uchar(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixduc.cpt b/support/dktools/dk4maixduc.cpt
index a95842db99..af83cb6201 100644
--- a/support/dktools/dk4maixduc.cpt
+++ b/support/dktools/dk4maixduc.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -102,6 +114,11 @@ dk4ma_input_wx_dec_uchar(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -120,6 +137,12 @@ dk4ma_input_wx_dec_uchar(
#include "dk4mai8duc.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -131,6 +154,10 @@ dk4ma_input_wx_dec_uchar(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_uchar(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixduc.h b/support/dktools/dk4maixduc.h
index d4f33662e6..2c6ae14118 100644
--- a/support/dktools/dk4maixduc.h
+++ b/support/dktools/dk4maixduc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixduc.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixduc.cpt
*/
#ifndef DK4MAIXDUC_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdui.cpp b/support/dktools/dk4maixdui.cpp
index 79600d1b09..15d9052894 100644
--- a/support/dktools/dk4maixdui.cpp
+++ b/support/dktools/dk4maixdui.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdui.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdui.cpt
*/
/** @file dk4maixdui.cpp The dk4maixdui module.
*/
-#line 104 "dk4maixdui.cpt"
+#line 116 "dk4maixdui.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dui.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_uint(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_uint(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdui.cpt b/support/dktools/dk4maixdui.cpt
index f5a4a1bb6c..9ed54e0e14 100644
--- a/support/dktools/dk4maixdui.cpt
+++ b/support/dktools/dk4maixdui.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -104,6 +116,11 @@ dk4ma_input_wx_dec_uint(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -122,6 +139,12 @@ dk4ma_input_wx_dec_uint(
#include "dk4mai8dui.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -133,6 +156,10 @@ dk4ma_input_wx_dec_uint(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_uint(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdui.h b/support/dktools/dk4maixdui.h
index fbe3d480ff..7f85da1e9e 100644
--- a/support/dktools/dk4maixdui.h
+++ b/support/dktools/dk4maixdui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdui.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdui.cpt
*/
#ifndef DK4MAIXDUI_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdul.cpp b/support/dktools/dk4maixdul.cpp
index ac6c906d31..dbd2c98007 100644
--- a/support/dktools/dk4maixdul.cpp
+++ b/support/dktools/dk4maixdul.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdul.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdul.cpt
*/
/** @file dk4maixdul.cpp The dk4maixdul module.
*/
-#line 103 "dk4maixdul.cpt"
+#line 115 "dk4maixdul.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dul.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_ulong(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_ulong(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdul.cpt b/support/dktools/dk4maixdul.cpt
index fc2219baa1..f87a6f69d0 100644
--- a/support/dktools/dk4maixdul.cpt
+++ b/support/dktools/dk4maixdul.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -103,6 +115,11 @@ dk4ma_input_wx_dec_ulong(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -121,6 +138,12 @@ dk4ma_input_wx_dec_ulong(
#include "dk4mai8dul.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -132,6 +155,10 @@ dk4ma_input_wx_dec_ulong(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_ulong(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdul.h b/support/dktools/dk4maixdul.h
index 251b13f58e..b975fcdecf 100644
--- a/support/dktools/dk4maixdul.h
+++ b/support/dktools/dk4maixdul.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdul.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdul.cpt
*/
#ifndef DK4MAIXDUL_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maixdus.cpp b/support/dktools/dk4maixdus.cpp
index c0623dd8a8..f1940ba8d5 100644
--- a/support/dktools/dk4maixdus.cpp
+++ b/support/dktools/dk4maixdus.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdus.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdus.cpt
*/
/** @file dk4maixdus.cpp The dk4maixdus module.
*/
-#line 103 "dk4maixdus.cpt"
+#line 115 "dk4maixdus.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +59,10 @@ dk4ma_input_wx_dec_ushort(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_ushort(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdus.cpt b/support/dktools/dk4maixdus.cpt
index 6f8f6f4c36..8da458266e 100644
--- a/support/dktools/dk4maixdus.cpt
+++ b/support/dktools/dk4maixdus.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -103,6 +115,11 @@ dk4ma_input_wx_dec_ushort(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -121,6 +138,12 @@ dk4ma_input_wx_dec_ushort(
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -132,6 +155,10 @@ dk4ma_input_wx_dec_ushort(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != src);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return ( dk4ma_input_wc_dec_ushort(rp, src, endptr, atg, erp));
#else
diff --git a/support/dktools/dk4maixdus.h b/support/dktools/dk4maixdus.h
index 8bbafca207..dbe69b8dd8 100644
--- a/support/dktools/dk4maixdus.h
+++ b/support/dktools/dk4maixdus.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maixdus.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maixdus.cpt
*/
#ifndef DK4MAIXDUS_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4mao8d.c b/support/dktools/dk4mao8d.c
index f0da4bb96e..a223c7ebaf 100644
--- a/support/dktools/dk4mao8d.c
+++ b/support/dktools/dk4mao8d.c
@@ -1,44 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mao8d.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mao8d.ctr
*/
/** @file dk4mao8d.c The dk4mao8d module.
*/
-#line 67 "dk4mao8d.ctr"
+#line 99 "dk4mao8d.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mao8d.h"
#include "dk4numco.h"
@@ -49,7 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 77 "dk4mao8d.ctr"
+#line 118 "dk4mao8d.ctr"
@@ -64,7 +51,10 @@ dk4ma_write_c8_decimal_unsigned(
int cc = 1; /* Flag: Can continue */
int err = 0; /* Flag: Error occured */
int back = 0; /* Function result */
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
*dptr = '\0';
}
@@ -146,6 +136,10 @@ dk4ma_write_c8_decimal_signed(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
*dptr = '\0';
}
diff --git a/support/dktools/dk4mao8d.ctr b/support/dktools/dk4mao8d.ctr
index cb7fdf5e13..8cd17fd8a3 100644
--- a/support/dktools/dk4mao8d.ctr
+++ b/support/dktools/dk4mao8d.ctr
@@ -3,7 +3,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -32,12 +44,22 @@ extern "C" {
#endif
/** Write unsigned number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@param padsz Size for padding.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL or sz is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
*/
int
dk4ma_write_c8_decimal_unsigned(
@@ -45,12 +67,22 @@ dk4ma_write_c8_decimal_unsigned(
);
/** Write signed number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@param padsz Size for padding.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL or sz is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
*/
int
dk4ma_write_c8_decimal_signed(
@@ -66,6 +98,15 @@ dk4ma_write_c8_decimal_signed(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mao8d.h"
#include "dk4numco.h"
#include "dk4error.h"
@@ -88,7 +129,10 @@ dk4ma_write_c8_decimal_unsigned(
int cc = 1; /* Flag: Can continue */
int err = 0; /* Flag: Error occured */
int back = 0; /* Function result */
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
*dptr = '\0';
}
@@ -170,6 +214,10 @@ dk4ma_write_c8_decimal_signed(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
*dptr = '\0';
}
diff --git a/support/dktools/dk4mao8d.h b/support/dktools/dk4mao8d.h
index 90d6fe573e..8a6b4ae8e4 100644
--- a/support/dktools/dk4mao8d.h
+++ b/support/dktools/dk4mao8d.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mao8d.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mao8d.ctr
*/
#ifndef DK4MAO8D_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -64,12 +54,22 @@ extern "C" {
#endif
/** Write unsigned number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@param padsz Size for padding.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL or sz is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
*/
int
dk4ma_write_c8_decimal_unsigned(
@@ -77,12 +77,22 @@ dk4ma_write_c8_decimal_unsigned(
);
/** Write signed number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@param padsz Size for padding.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr is NULL or sz is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
*/
int
dk4ma_write_c8_decimal_signed(
diff --git a/support/dktools/dk4mao8dbl.c b/support/dktools/dk4mao8dbl.c
index fb1ac5804e..5b96f72d72 100644
--- a/support/dktools/dk4mao8dbl.c
+++ b/support/dktools/dk4mao8dbl.c
@@ -1,43 +1,42 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mao8dbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mao8dbl.ctr
*/
/** @file dk4mao8dbl.c The dk4mao8dbl module.
*/
-#line 66 "dk4mao8dbl.ctr"
+#line 81 "dk4mao8dbl.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
#include "dk4mao8dbl.h"
#include "dk4str8.h"
@@ -54,7 +53,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 81 "dk4mao8dbl.ctr"
+#line 117 "dk4mao8dbl.ctr"
@@ -69,6 +68,8 @@ static const char * const dk4double_format_strings[] = {
/** Squeeze a double written to string.
+
+ CRT on Windows: Not used.
@param buf Buffer containing the string.
*/
static
@@ -83,19 +84,19 @@ dk4double_squeeze_c8_string(char *buf)
int useexp = 1;
-#line 108 "dk4mao8dbl.ctr"
+#line 146 "dk4mao8dbl.ctr"
if (NULL != buf) {
ptr = buf;
while('\0' != *ptr) {
switch (*ptr) {
case 'e': case 'E': {
-#line 113 "dk4mao8dbl.ctr"
+#line 151 "dk4mao8dbl.ctr"
if (NULL == ptre) { ptre = ptr; }
} break;
case '.': {
-#line 116 "dk4mao8dbl.ctr"
+#line 154 "dk4mao8dbl.ctr"
if (NULL == ptrdot) { ptrdot = ptr; }
} break;
case ',': {
@@ -106,28 +107,28 @@ dk4double_squeeze_c8_string(char *buf)
}
if (NULL != ptre) {
-#line 125 "dk4mao8dbl.ctr"
+#line 163 "dk4mao8dbl.ctr"
*ptre = '\0';
ptr = ptre;
ptr++;
-#line 128 "dk4mao8dbl.ctr"
+#line 166 "dk4mao8dbl.ctr"
if (('+' == *ptr) || ('0' == *ptr)) {
-#line 129 "dk4mao8dbl.ctr"
+#line 167 "dk4mao8dbl.ctr"
useexp = 0;
-#line 130 "dk4mao8dbl.ctr"
+#line 168 "dk4mao8dbl.ctr"
ptr++;
while('\0' != *ptr) {
-#line 132 "dk4mao8dbl.ctr"
+#line 170 "dk4mao8dbl.ctr"
if ('0' != *ptr) {
-#line 133 "dk4mao8dbl.ctr"
+#line 171 "dk4mao8dbl.ctr"
useexp = 1;
-#line 134 "dk4mao8dbl.ctr"
+#line 172 "dk4mao8dbl.ctr"
}
ptr++;
}
@@ -137,21 +138,21 @@ dk4double_squeeze_c8_string(char *buf)
ptrdot++;
if ('\0' != *ptrdot) {
-#line 142 "dk4mao8dbl.ctr"
+#line 180 "dk4mao8dbl.ctr"
ptrdot++;
while('\0' != *ptrdot) {
-#line 144 "dk4mao8dbl.ctr"
+#line 182 "dk4mao8dbl.ctr"
if ('0' == *ptrdot) {
if (NULL == ptrcut) {
ptrcut = ptrdot;
-#line 147 "dk4mao8dbl.ctr"
+#line 185 "dk4mao8dbl.ctr"
}
} else {
ptrcut = NULL;
-#line 150 "dk4mao8dbl.ctr"
+#line 188 "dk4mao8dbl.ctr"
}
ptrdot++;
}
@@ -188,7 +189,7 @@ dk4double_squeeze_c8_string(char *buf)
}
-#line 185 "dk4mao8dbl.ctr"
+#line 223 "dk4mao8dbl.ctr"
}
@@ -204,6 +205,10 @@ dk4ma_internal_write_c8_double(
char buf[64];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -242,6 +247,10 @@ dk4ma_internal_write_c8_double(
char buf[64];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -277,6 +286,10 @@ dk4ma_internal_write_c8_double(
char buf[64];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -311,6 +324,10 @@ dk4ma_internal_write_c8_double(
char buf[64];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -344,7 +361,10 @@ dk4ma_write_c8_double(
char *oldloc = NULL;
#endif
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
oldloc = setlocale(LC_NUMERIC, NULL);
(void)setlocale(LC_NUMERIC, dk4double_format_strings[2]);
@@ -357,3 +377,4 @@ dk4ma_write_c8_double(
}
+
diff --git a/support/dktools/dk4mao8dbl.ctr b/support/dktools/dk4mao8dbl.ctr
index f9e7683ac5..efa65f9224 100644
--- a/support/dktools/dk4mao8dbl.ctr
+++ b/support/dktools/dk4mao8dbl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -37,6 +49,8 @@ extern "C" {
#endif
/** Convert double value to string.
+
+ CRT on Windows: Required.
@param dptr Destination buffer pointer.
@param szdptr Size of destination buffer.
@param v Value to convert.
@@ -56,6 +70,7 @@ dk4ma_write_c8_double(
char *dptr, size_t szdptr, double v, int exact, int minimize, dk4_er_t *erp
);
+
#ifdef __cplusplus
}
#endif
@@ -64,6 +79,27 @@ dk4ma_write_c8_double(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mao8dbl.h"
#include "dk4str8.h"
@@ -92,6 +128,8 @@ static const char * const dk4double_format_strings[] = {
/** Squeeze a double written to string.
+
+ CRT on Windows: Not used.
@param buf Buffer containing the string.
*/
static
@@ -197,6 +235,10 @@ dk4ma_internal_write_c8_double(
char buf[64];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -235,6 +277,10 @@ dk4ma_internal_write_c8_double(
char buf[64];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -270,6 +316,10 @@ dk4ma_internal_write_c8_double(
char buf[64];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -304,6 +354,10 @@ dk4ma_internal_write_c8_double(
char buf[64];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -337,7 +391,10 @@ dk4ma_write_c8_double(
char *oldloc = NULL;
#endif
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
oldloc = setlocale(LC_NUMERIC, NULL);
(void)setlocale(LC_NUMERIC, dk4double_format_strings[2]);
@@ -350,3 +407,4 @@ dk4ma_write_c8_double(
}
+
diff --git a/support/dktools/dk4mao8dbl.h b/support/dktools/dk4mao8dbl.h
index ef28840734..1947479adb 100644
--- a/support/dktools/dk4mao8dbl.h
+++ b/support/dktools/dk4mao8dbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mao8dbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mao8dbl.ctr
*/
#ifndef DK4MAO8DBL_H_INCLUDED
@@ -49,15 +27,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -70,6 +60,8 @@ extern "C" {
#endif
/** Convert double value to string.
+
+ CRT on Windows: Required.
@param dptr Destination buffer pointer.
@param szdptr Size of destination buffer.
@param v Value to convert.
@@ -89,6 +81,7 @@ dk4ma_write_c8_double(
char *dptr, size_t szdptr, double v, int exact, int minimize, dk4_er_t *erp
);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4mao8dns.c b/support/dktools/dk4mao8dns.c
new file mode 100644
index 0000000000..c1d6bff8cf
--- /dev/null
+++ b/support/dktools/dk4mao8dns.c
@@ -0,0 +1,299 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mao8dns.ctr
+*/
+
+/** @file dk4mao8dns.c The dk4mao8dns module.
+*/
+
+
+#line 132 "dk4mao8dns.ctr"
+
+
+#include "dk4conf.h"
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#if DK4_HAVE_STRING_H
+#ifndef STRING_H_INCLUDED
+#include <string.h>
+#define STRING_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MAO8DBL_H_INCLUDED
+#include "dk4mao8dbl.h"
+#endif
+
+#ifndef DK4MAI8DDI_H_INCLUDED
+#include "dk4mai8ddi.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 180 "dk4mao8dns.ctr"
+
+
+
+int
+dk4ma_write_c8_double_string_no_sci_to_stream(
+ dk4_stream_t *strm,
+ char *buf,
+ dk4_er_t *erp
+)
+{
+ char *ptrex = NULL; /* Start of exponent */
+ char *ptrdd = NULL; /* Decimal dot */
+ char *ptrout = NULL; /* Character to output */
+ const char *endptr = NULL; /* First unusable exponent character */
+ dk4_im_t dotpos = (dk4_im_t)0L; /* Dot position */
+ dk4_im_t expon = (dk4_im_t)0L; /* Exponent */
+ dk4_im_t i = (dk4_im_t)0L; /* Running index */
+ int isneg = 0; /* Flag: Negative value */
+ int res = 0; /* Conversion result */
+ int back = 0; /* Result */
+
+
+#line 201 "dk4mao8dns.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != buf);
+#endif
+ if ((NULL != strm) && (NULL != buf)) {
+ back = 1;
+ if ('-' == *buf) {
+
+#line 208 "dk4mao8dns.ctr"
+ isneg = 1;
+ buf++;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 213 "dk4mao8dns.ctr"
+ }
+#endif
+ /*
+ Find exponent
+ */
+ ptrex = strchr(buf, 'e');
+ if (NULL == ptrex) { ptrex = strchr(buf, 'E'); }
+ if (NULL != ptrex) {
+ *(ptrex++) = '\0';
+
+#line 222 "dk4mao8dns.ctr"
+ if ('+' == *ptrex) { ptrex++; }
+ res = dk4ma_input_c8_dec_dk4_im_t(&expon, ptrex, &endptr, 1, erp);
+ if (0 == res) { expon = (dk4_im_t)0L; back = 0; }
+
+
+#line 226 "dk4mao8dns.ctr"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 229 "dk4mao8dns.ctr"
+ }
+#endif
+ /* Find decimal dot
+ */
+ ptrdd = strchr(buf, '.');
+ if (NULL != ptrdd) {
+
+#line 235 "dk4mao8dns.ctr"
+ *ptrdd = '\0';
+ dotpos = strlen(buf);
+ dk4str8_cpy_to_left(ptrdd, &(ptrdd[1]));
+ }
+ else {
+
+#line 240 "dk4mao8dns.ctr"
+ dotpos = strlen(buf);
+ }
+ /* Calculate dot position from original position and exponent
+ */
+ dotpos += expon;
+
+#line 245 "dk4mao8dns.ctr"
+ /*
+ Write leading zero(s)
+ */
+ if ((dk4_im_t)0L >= dotpos) {
+
+#line 249 "dk4mao8dns.ctr"
+ if (0 != isneg) {
+ if (0 == dk4stream_write_byte(strm, '-', erp)) { back = 0; }
+ isneg = 0;
+ }
+ if (0 == dk4stream_write_byte(strm, '0', erp)) { back = 0; }
+ if (0 == dk4stream_write_byte(strm, '.', erp)) { back = 0; }
+ i = dotpos;
+ while ((dk4_im_t)0L > i++) {
+ if (0 == dk4stream_write_byte(strm, '0', erp)) { back = 0; }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 262 "dk4mao8dns.ctr"
+ }
+#endif
+ /* Write digits from buffer
+ */
+ if (0 != isneg) {
+
+#line 267 "dk4mao8dns.ctr"
+ if (0 == dk4stream_write_byte(strm, '-', erp)) { back = 0; }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 271 "dk4mao8dns.ctr"
+ }
+#endif
+ i = (dk4_im_t)0L;
+ ptrout = buf;
+ while ('\0' != *ptrout) {
+
+
+#line 277 "dk4mao8dns.ctr"
+
+
+#line 278 "dk4mao8dns.ctr"
+ if ((dotpos == i) && ((dk4_im_t)0L != dotpos)) {
+
+
+#line 280 "dk4mao8dns.ctr"
+ if (0 == dk4stream_write_byte(strm, '.', erp)) {
+ back = 0;
+
+#line 282 "dk4mao8dns.ctr"
+ }
+ }
+
+
+#line 285 "dk4mao8dns.ctr"
+ if (0 == dk4stream_write_byte(strm, *(ptrout++), erp)) {
+ back = 0;
+
+#line 287 "dk4mao8dns.ctr"
+ }
+
+
+#line 289 "dk4mao8dns.ctr"
+ i++;
+ }
+ /* Append trailing zero(s)
+ */
+
+
+#line 294 "dk4mao8dns.ctr"
+ while (i++ < dotpos) {
+ if (0 == dk4stream_write_byte(strm, '0', erp)) {
+ back = 0;
+
+#line 297 "dk4mao8dns.ctr"
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 304 "dk4mao8dns.ctr"
+ return back;
+}
+
+
+
+int
+dk4ma_write_c8_double_no_sci_to_stream(
+ dk4_stream_t *strm,
+ double v,
+ double eps,
+ int ex,
+ int min,
+ dk4_er_t *erp
+)
+{
+ char buf[16*sizeof(double)];
+ size_t szbuf = sizeof(buf);
+ int back = 0;
+
+
+#line 323 "dk4mao8dns.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
+ if (NULL != strm) {
+ if (fabs(v) < eps) {
+
+#line 328 "dk4mao8dns.ctr"
+ back = dk4stream_write_byte(strm, '0', erp);
+ }
+ else {
+
+#line 331 "dk4mao8dns.ctr"
+ if (0 != dk4ma_write_c8_double(buf, szbuf, v, ex, min, erp)) {
+
+
+#line 333 "dk4mao8dns.ctr"
+ back = dk4ma_write_c8_double_string_no_sci_to_stream(
+ strm, buf, erp
+ );
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 339 "dk4mao8dns.ctr"
+ }
+#endif
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 347 "dk4mao8dns.ctr"
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4mao8dns.ctr b/support/dktools/dk4mao8dns.ctr
new file mode 100644
index 0000000000..097a05d89b
--- /dev/null
+++ b/support/dktools/dk4mao8dns.ctr
@@ -0,0 +1,352 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+
+/** @file dk4mao8dns.h Print double without scientific notation.
+
+The dk4ma_write_c8_double_no_sci_to_stream() function is intended to write
+coordinates to PDF, PS and EPS output.
+
+In contrast to the dk4c8dbl_double_to_stream() function from the dk4c8dbl
+this function uses parameter eps to print 0 instead of
+very small absolute values.
+
+This module is in the libdk4c library, not libdk4maio8d, as it uses
+the dk4_stream_t data type and related functions.
+
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Write a double value stored in a buffer to a stream, avoid
+ scientific notation.
+ @param strm Stream to write to.
+ @param buf Buffer containing string representation of double value.
+ The buffer contents is modified and probably
+ damaged during operation.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm or buf is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+int
+dk4ma_write_c8_double_string_no_sci_to_stream(
+ dk4_stream_t *strm,
+ char *buf,
+ dk4_er_t *erp
+);
+
+/** Write double value to stream, avoid scientific notation.
+ @param strm Stream to write to.
+ @param v Value to write.
+ @param eps Epsilon (values below epsilon are written as 0).
+ @param ex Flag: Use exact representation.
+ @param min Minimize text representation.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm is NULL.
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+int
+dk4ma_write_c8_double_no_sci_to_stream(
+ dk4_stream_t *strm,
+ double v,
+ double eps,
+ int ex,
+ int min,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#include "dk4conf.h"
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+#include "dk4mao8dns.h"
+#endif
+
+#if DK4_HAVE_STRING_H
+#ifndef STRING_H_INCLUDED
+#include <string.h>
+#define STRING_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4MAO8DBL_H_INCLUDED
+#include "dk4mao8dbl.h"
+#endif
+
+#ifndef DK4MAI8DDI_H_INCLUDED
+#include "dk4mai8ddi.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+int
+dk4ma_write_c8_double_string_no_sci_to_stream(
+ dk4_stream_t *strm,
+ char *buf,
+ dk4_er_t *erp
+)
+{
+ char *ptrex = NULL; /* Start of exponent */
+ char *ptrdd = NULL; /* Decimal dot */
+ char *ptrout = NULL; /* Character to output */
+ const char *endptr = NULL; /* First unusable exponent character */
+ dk4_im_t dotpos = (dk4_im_t)0L; /* Dot position */
+ dk4_im_t expon = (dk4_im_t)0L; /* Exponent */
+ dk4_im_t i = (dk4_im_t)0L; /* Running index */
+ int isneg = 0; /* Flag: Negative value */
+ int res = 0; /* Conversion result */
+ int back = 0; /* Result */
+ $? "+ dk4ma_write_c8_double_string_no_sci_to_stream"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != buf);
+#endif
+ if ((NULL != strm) && (NULL != buf)) {
+ back = 1;
+ if ('-' == *buf) { $? ". negative"
+ isneg = 1;
+ buf++;
+ }
+#if TRACE_DEBUG
+ else { $? ". not negative"
+ }
+#endif
+ /*
+ Find exponent
+ */
+ ptrex = strchr(buf, 'e');
+ if (NULL == ptrex) { ptrex = strchr(buf, 'E'); }
+ if (NULL != ptrex) {
+ *(ptrex++) = '\0'; $? ". exponent=\"%s\"", ptrex
+ if ('+' == *ptrex) { ptrex++; }
+ res = dk4ma_input_c8_dec_dk4_im_t(&expon, ptrex, &endptr, 1, erp);
+ if (0 == res) { expon = (dk4_im_t)0L; back = 0; }
+ $? ". exponent = %d", (int)expon
+ }
+#if TRACE_DEBUG
+ else { $? ". no exponent"
+ }
+#endif
+ /* Find decimal dot
+ */
+ ptrdd = strchr(buf, '.');
+ if (NULL != ptrdd) { $? ". have decimal dot"
+ *ptrdd = '\0';
+ dotpos = strlen(buf);
+ dk4str8_cpy_to_left(ptrdd, &(ptrdd[1]));
+ }
+ else { $? ". no decimal dot"
+ dotpos = strlen(buf);
+ }
+ /* Calculate dot position from original position and exponent
+ */
+ dotpos += expon; $? ". dot position = %d", (int)dotpos
+ /*
+ Write leading zero(s)
+ */
+ if ((dk4_im_t)0L >= dotpos) { $? ". leading zeros"
+ if (0 != isneg) {
+ if (0 == dk4stream_write_byte(strm, '-', erp)) { back = 0; }
+ isneg = 0;
+ }
+ if (0 == dk4stream_write_byte(strm, '0', erp)) { back = 0; }
+ if (0 == dk4stream_write_byte(strm, '.', erp)) { back = 0; }
+ i = dotpos;
+ while ((dk4_im_t)0L > i++) {
+ if (0 == dk4stream_write_byte(strm, '0', erp)) { back = 0; }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? ". no leading zeros"
+ }
+#endif
+ /* Write digits from buffer
+ */
+ if (0 != isneg) { $? ". negative sign"
+ if (0 == dk4stream_write_byte(strm, '-', erp)) { back = 0; }
+ }
+#if TRACE_DEBUG
+ else { $? ". no negative sign"
+ }
+#endif
+ i = (dk4_im_t)0L;
+ ptrout = buf;
+ while ('\0' != *ptrout) {
+ $? ". character %c", *ptrout
+ $? ". dotpos=%d i=%d", (int)dotpos, (int)i
+ if ((dotpos == i) && ((dk4_im_t)0L != dotpos)) {
+ $? ". must write dot"
+ if (0 == dk4stream_write_byte(strm, '.', erp)) {
+ back = 0; $? "! write error (dot)"
+ }
+ }
+ $? ". going to write character"
+ if (0 == dk4stream_write_byte(strm, *(ptrout++), erp)) {
+ back = 0; $? "! write error (character)"
+ }
+ $? ". character was written"
+ i++;
+ }
+ /* Append trailing zero(s)
+ */
+ $? ". appending trailing zeros i=%d dotpos=%d", (int)i, (int)dotpos
+ while (i++ < dotpos) {
+ if (0 == dk4stream_write_byte(strm, '0', erp)) {
+ back = 0; $? "! write error (trailing zero)"
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4ma_write_c8_double_string_no_sci_to_stream %d", back
+ return back;
+}
+
+
+
+int
+dk4ma_write_c8_double_no_sci_to_stream(
+ dk4_stream_t *strm,
+ double v,
+ double eps,
+ int ex,
+ int min,
+ dk4_er_t *erp
+)
+{
+ char buf[16*sizeof(double)];
+ size_t szbuf = sizeof(buf);
+ int back = 0;
+ $? "+ dk4ma_write_c8_double_no_sci_to_stream %g", v
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
+ if (NULL != strm) {
+ if (fabs(v) < eps) { $? ". 0"
+ back = dk4stream_write_byte(strm, '0', erp);
+ }
+ else { $? ". not 0"
+ if (0 != dk4ma_write_c8_double(buf, szbuf, v, ex, min, erp)) {
+ $? ". buf=\"%s\"", buf
+ back = dk4ma_write_c8_double_string_no_sci_to_stream(
+ strm, buf, erp
+ );
+ }
+#if TRACE_DEBUG
+ else { $? "! dk4ma_write_c8_double"
+ }
+#endif
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4ma_write_c8_double_no_sci_to_stream %d", back
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4mao8dns.h b/support/dktools/dk4mao8dns.h
new file mode 100644
index 0000000000..ab6671b957
--- /dev/null
+++ b/support/dktools/dk4mao8dns.h
@@ -0,0 +1,144 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mao8dns.ctr
+*/
+
+#ifndef DK4MAO8DNS_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4MAO8DNS_H_INCLUDED 1
+
+
+#line 8 "dk4mao8dns.ctr"
+
+
+/** @file dk4mao8dns.h Print double without scientific notation.
+
+The dk4ma_write_c8_double_no_sci_to_stream() function is intended to write
+coordinates to PDF, PS and EPS output.
+
+In contrast to the dk4c8dbl_double_to_stream() function from the dk4c8dbl
+this function uses parameter eps to print 0 instead of
+very small absolute values.
+
+This module is in the libdk4c library, not libdk4maio8d, as it uses
+the dk4_stream_t data type and related functions.
+
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
+#ifndef STDLIB_H_INCLUDED
+#include <stdlib.h>
+#define STDLIB_H_INCLUDED 1
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Write a double value stored in a buffer to a stream, avoid
+ scientific notation.
+ @param strm Stream to write to.
+ @param buf Buffer containing string representation of double value.
+ The buffer contents is modified and probably
+ damaged during operation.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm or buf is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+int
+dk4ma_write_c8_double_string_no_sci_to_stream(
+ dk4_stream_t *strm,
+ char *buf,
+ dk4_er_t *erp
+);
+
+/** Write double value to stream, avoid scientific notation.
+ @param strm Stream to write to.
+ @param v Value to write.
+ @param eps Epsilon (values below epsilon are written as 0).
+ @param ex Flag: Use exact representation.
+ @param min Minimize text representation.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm is NULL.
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+int
+dk4ma_write_c8_double_no_sci_to_stream(
+ dk4_stream_t *strm,
+ double v,
+ double eps,
+ int ex,
+ int min,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4mao8h.c b/support/dktools/dk4mao8h.c
index 5865852fe6..fb7f36b7a2 100644
--- a/support/dktools/dk4mao8h.c
+++ b/support/dktools/dk4mao8h.c
@@ -1,45 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mao8h.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mao8h.ctr
*/
/** @file dk4mao8h.c The dk4mao8h module.
*/
-#line 67 "dk4mao8h.ctr"
+#line 83 "dk4mao8h.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mao8h.h"
#include "dk4numco.h"
#include "dk4error.h"
@@ -48,7 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 76 "dk4mao8h.ctr"
+#line 101 "dk4mao8h.ctr"
@@ -65,94 +52,98 @@ dk4ma_write_c8_hex_unsigned(
int back = 0; /* Function result */
-#line 91 "dk4mao8h.ctr"
+#line 116 "dk4mao8h.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if (1 == padsz) { padsz = 2 * sizeof(dk4_um_t); }
if ((NULL != dptr) && (0 < sz) && (padsz < sz)) {
-#line 94 "dk4mao8h.ctr"
+#line 123 "dk4mao8h.ctr"
do {
-#line 95 "dk4mao8h.ctr"
+#line 124 "dk4mao8h.ctr"
switch((int)(val % (dk4_um_t)16UL)) {
case 0: {
-#line 97 "dk4mao8h.ctr"
+#line 126 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '0'; } else { err = 1; }
} break;
case 1: {
-#line 100 "dk4mao8h.ctr"
+#line 129 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '1'; } else { err = 1; }
} break;
case 2: {
-#line 103 "dk4mao8h.ctr"
+#line 132 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '2'; } else { err = 1; }
} break;
case 3: {
-#line 106 "dk4mao8h.ctr"
+#line 135 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '3'; } else { err = 1; }
} break;
case 4: {
-#line 109 "dk4mao8h.ctr"
+#line 138 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '4'; } else { err = 1; }
} break;
case 5: {
-#line 112 "dk4mao8h.ctr"
+#line 141 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '5'; } else { err = 1; }
} break;
case 6: {
-#line 115 "dk4mao8h.ctr"
+#line 144 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '6'; } else { err = 1; }
} break;
case 7: {
-#line 118 "dk4mao8h.ctr"
+#line 147 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '7'; } else { err = 1; }
} break;
case 8: {
-#line 121 "dk4mao8h.ctr"
+#line 150 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '8'; } else { err = 1; }
} break;
case 9: {
-#line 124 "dk4mao8h.ctr"
+#line 153 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = '9'; } else { err = 1; }
} break;
case 10: {
-#line 127 "dk4mao8h.ctr"
+#line 156 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = 'A'; } else { err = 1; }
} break;
case 11: {
-#line 130 "dk4mao8h.ctr"
+#line 159 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = 'B'; } else { err = 1; }
} break;
case 12: {
-#line 133 "dk4mao8h.ctr"
+#line 162 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = 'C'; } else { err = 1; }
} break;
case 13: {
-#line 136 "dk4mao8h.ctr"
+#line 165 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = 'D'; } else { err = 1; }
} break;
case 14: {
-#line 139 "dk4mao8h.ctr"
+#line 168 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = 'E'; } else { err = 1; }
} break;
case 15: {
-#line 142 "dk4mao8h.ctr"
+#line 171 "dk4mao8h.ctr"
if(used < sizeof(buf)) { buf[used++] = 'F'; } else { err = 1; }
} break;
}
@@ -161,13 +152,13 @@ dk4ma_write_c8_hex_unsigned(
} while((1 == cc) && (0 == err));
if (0 == err) {
-#line 149 "dk4mao8h.ctr"
+#line 178 "dk4mao8h.ctr"
if (used < sz) {
-#line 150 "dk4mao8h.ctr"
+#line 179 "dk4mao8h.ctr"
if ((0 < padsz) && (used < padsz)) {
-#line 151 "dk4mao8h.ctr"
+#line 180 "dk4mao8h.ctr"
for (i = 0; i < (padsz - used); i++) {
dptr[i] = '0';
}
@@ -178,7 +169,7 @@ dk4ma_write_c8_hex_unsigned(
back = 1;
} else {
-#line 160 "dk4mao8h.ctr"
+#line 189 "dk4mao8h.ctr"
for (i = 0; i < used; i++) {
dptr[i] = buf[used - 1 - i];
}
@@ -187,22 +178,22 @@ dk4ma_write_c8_hex_unsigned(
}
} else {
-#line 167 "dk4mao8h.ctr"
+#line 196 "dk4mao8h.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 170 "dk4mao8h.ctr"
+#line 199 "dk4mao8h.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
} else {
-#line 173 "dk4mao8h.ctr"
+#line 202 "dk4mao8h.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 176 "dk4mao8h.ctr"
+#line 205 "dk4mao8h.ctr"
return back;
}
diff --git a/support/dktools/dk4mao8h.ctr b/support/dktools/dk4mao8h.ctr
index 84e23cd28e..bc536556c8 100644
--- a/support/dktools/dk4mao8h.ctr
+++ b/support/dktools/dk4mao8h.ctr
@@ -3,7 +3,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -32,6 +44,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in hex notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -45,6 +59,8 @@ dk4ma_write_c8_hex_unsigned(
);
/** Write signed number to char string in hex notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -66,6 +82,15 @@ dk4ma_write_c8_hex_signed(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mao8h.h"
#include "dk4numco.h"
#include "dk4error.h"
@@ -88,6 +113,10 @@ dk4ma_write_c8_hex_unsigned(
int err = 0; /* Flag: Error occued */
int back = 0; /* Function result */
$? "+ dk4ma_write_c8_hex_unsigned"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if (NULL != dptr) { *dptr = '\0'; }
if (1 == padsz) { padsz = 2 * sizeof(dk4_um_t); }
if ((NULL != dptr) && (0 < sz) && (padsz < sz)) { $? ". args"
diff --git a/support/dktools/dk4mao8h.h b/support/dktools/dk4mao8h.h
index c3b158add3..89dda706d8 100644
--- a/support/dktools/dk4mao8h.h
+++ b/support/dktools/dk4mao8h.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mao8h.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mao8h.ctr
*/
#ifndef DK4MAO8H_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -64,6 +54,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in hex notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -77,6 +69,8 @@ dk4ma_write_c8_hex_unsigned(
);
/** Write signed number to char string in hex notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
diff --git a/support/dktools/dk4maodd.c b/support/dktools/dk4maodd.c
index 606e610cf3..98cd0c45d4 100644
--- a/support/dktools/dk4maodd.c
+++ b/support/dktools/dk4maodd.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maodd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maodd.ctr
*/
/** @file dk4maodd.c The dk4maodd module.
*/
-#line 70 "dk4maodd.ctr"
+#line 86 "dk4maodd.ctr"
#include "dk4conf.h"
@@ -54,6 +32,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maodd.h"
#include "dk4error.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -61,6 +45,10 @@ dk4ma_write_decimal_unsigned(
dkChar *dptr, size_t sz, dk4_um_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_decimal_unsigned(dptr, sz, val, padsz, erp));
#else
@@ -75,6 +63,10 @@ dk4ma_write_decimal_signed(
dkChar *dptr, size_t sz, dk4_im_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_decimal_signed(dptr, sz, val, padsz, erp));
#else
diff --git a/support/dktools/dk4maodd.ctr b/support/dktools/dk4maodd.ctr
index 2fdbd4e5d1..306cfc6195 100644
--- a/support/dktools/dk4maodd.ctr
+++ b/support/dktools/dk4maodd.ctr
@@ -3,7 +3,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -34,6 +46,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -47,6 +61,8 @@ dk4ma_write_decimal_unsigned(
);
/** Write signed number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -83,6 +99,12 @@ dk4ma_write_decimal_signed(
#include "dk4maodd.h"
#include "dk4error.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -90,6 +112,10 @@ dk4ma_write_decimal_unsigned(
dkChar *dptr, size_t sz, dk4_um_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_decimal_unsigned(dptr, sz, val, padsz, erp));
#else
@@ -104,6 +130,10 @@ dk4ma_write_decimal_signed(
dkChar *dptr, size_t sz, dk4_im_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_decimal_signed(dptr, sz, val, padsz, erp));
#else
diff --git a/support/dktools/dk4maodd.h b/support/dktools/dk4maodd.h
index a9c78dd5de..78c526583b 100644
--- a/support/dktools/dk4maodd.h
+++ b/support/dktools/dk4maodd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maodd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maodd.ctr
*/
#ifndef DK4MAODD_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -66,6 +56,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -79,6 +71,8 @@ dk4ma_write_decimal_unsigned(
);
/** Write signed number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
diff --git a/support/dktools/dk4maoddbl.c b/support/dktools/dk4maoddbl.c
index a708e83531..a1c7e25125 100644
--- a/support/dktools/dk4maoddbl.c
+++ b/support/dktools/dk4maoddbl.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maoddbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maoddbl.ctr
*/
/** @file dk4maoddbl.c The dk4maoddbl module.
*/
-#line 60 "dk4maoddbl.ctr"
+#line 72 "dk4maoddbl.ctr"
+#include "dk4conf.h"
#include "dk4maoddbl.h"
#if DK4_CHAR_SIZE > 1
@@ -47,12 +26,23 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mao8dbl.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
dk4ma_write_double(
dkChar *dptr, size_t szdptr, double v, int exact, int minimize, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_double(dptr, szdptr, v, exact, minimize, erp));
#else
diff --git a/support/dktools/dk4maoddbl.ctr b/support/dktools/dk4maoddbl.ctr
index 8d24f5285b..ff7b51dd36 100644
--- a/support/dktools/dk4maoddbl.ctr
+++ b/support/dktools/dk4maoddbl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -58,6 +70,7 @@ dk4ma_write_double(
%% module
+#include "dk4conf.h"
#include "dk4maoddbl.h"
#if DK4_CHAR_SIZE > 1
@@ -66,12 +79,23 @@ dk4ma_write_double(
#include "dk4mao8dbl.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
dk4ma_write_double(
dkChar *dptr, size_t szdptr, double v, int exact, int minimize, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_double(dptr, szdptr, v, exact, minimize, erp));
#else
diff --git a/support/dktools/dk4maoddbl.h b/support/dktools/dk4maoddbl.h
index e7e36b4096..102f20f5f2 100644
--- a/support/dktools/dk4maoddbl.h
+++ b/support/dktools/dk4maoddbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maoddbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maoddbl.ctr
*/
#ifndef DK4MAODDBL_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maodh.c b/support/dktools/dk4maodh.c
index c782d9ec8a..75971ac66c 100644
--- a/support/dktools/dk4maodh.c
+++ b/support/dktools/dk4maodh.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maodh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maodh.ctr
*/
/** @file dk4maodh.c The dk4maodh module.
@@ -51,6 +29,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maodh.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -58,6 +42,10 @@ dk4ma_write_hex_unsigned(
dkChar *dptr, size_t sz, dk4_um_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_hex_unsigned(dptr, sz, val, padsz, erp));
#else
@@ -72,6 +60,10 @@ dk4ma_write_hex_signed(
dkChar *dptr, size_t sz, dk4_im_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_hex_signed(dptr, sz, val, padsz, erp));
#else
diff --git a/support/dktools/dk4maodh.ctr b/support/dktools/dk4maodh.ctr
index ca8b7dc510..342c3b2677 100644
--- a/support/dktools/dk4maodh.ctr
+++ b/support/dktools/dk4maodh.ctr
@@ -4,7 +4,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -33,6 +45,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in hex notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -46,6 +60,8 @@ dk4ma_write_hex_unsigned(
);
/** Write signed number to char string in hex notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -77,6 +93,12 @@ dk4ma_write_hex_signed(
#include "dk4maodh.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -84,6 +106,10 @@ dk4ma_write_hex_unsigned(
dkChar *dptr, size_t sz, dk4_um_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_hex_unsigned(dptr, sz, val, padsz, erp));
#else
@@ -98,6 +124,10 @@ dk4ma_write_hex_signed(
dkChar *dptr, size_t sz, dk4_im_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ma_write_wc_hex_signed(dptr, sz, val, padsz, erp));
#else
diff --git a/support/dktools/dk4maodh.h b/support/dktools/dk4maodh.h
index f9f574aad5..5c60d7adbc 100644
--- a/support/dktools/dk4maodh.h
+++ b/support/dktools/dk4maodh.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maodh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maodh.ctr
*/
#ifndef DK4MAODH_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -64,6 +54,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in hex notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -77,6 +69,8 @@ dk4ma_write_hex_unsigned(
);
/** Write signed number to char string in hex notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
diff --git a/support/dktools/dk4maodo.c b/support/dktools/dk4maodo.c
index d0e1ec7e60..627e4f3dca 100644
--- a/support/dktools/dk4maodo.c
+++ b/support/dktools/dk4maodo.c
@@ -1,51 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maodo.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maodo.ctr
*/
/** @file dk4maodo.c The dk4maodo module.
*/
-#line 49 "dk4maodo.ctr"
+#line 63 "dk4maodo.ctr"
+#include "dk4conf.h"
#include "dk4maodo.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 55 "dk4maodo.ctr"
+#line 76 "dk4maodo.ctr"
@@ -60,6 +45,10 @@ dk4ma_write_octal_unsigned(
int cc = 1; /* Flag: Can continue */
int err = 0; /* Flag: Error occured */
int back = 0; /* Result */
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) { *dptr = dkT('\0'); }
if (1 == padsz) {
padsz = (8 * sizeof(dk4_um_t)) / 3;
@@ -121,7 +110,7 @@ dk4ma_write_octal_unsigned(
}
} else {
-#line 129 "dk4maodo.ctr"
+#line 154 "dk4maodo.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
} else {
diff --git a/support/dktools/dk4maodo.ctr b/support/dktools/dk4maodo.ctr
index 04a826d1b9..9e91dfc27a 100644
--- a/support/dktools/dk4maodo.ctr
+++ b/support/dktools/dk4maodo.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,15 +12,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -28,6 +40,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in octal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -47,8 +61,15 @@ dk4ma_write_octal_unsigned(
%% module
+#include "dk4conf.h"
#include "dk4maodo.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -66,6 +87,10 @@ dk4ma_write_octal_unsigned(
int cc = 1; /* Flag: Can continue */
int err = 0; /* Flag: Error occured */
int back = 0; /* Result */
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) { *dptr = dkT('\0'); }
if (1 == padsz) {
padsz = (8 * sizeof(dk4_um_t)) / 3;
diff --git a/support/dktools/dk4maodo.h b/support/dktools/dk4maodo.h
index e23438cf7e..772ef101ae 100644
--- a/support/dktools/dk4maodo.h
+++ b/support/dktools/dk4maodo.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maodo.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maodo.ctr
*/
#ifndef DK4MAODO_H_INCLUDED
@@ -44,15 +22,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -60,6 +50,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in octal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
diff --git a/support/dktools/dk4maowd.c b/support/dktools/dk4maowd.c
index d5c3504891..1d64d3e839 100644
--- a/support/dktools/dk4maowd.c
+++ b/support/dktools/dk4maowd.c
@@ -1,44 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maowd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maowd.ctr
*/
/** @file dk4maowd.c The dk4maowd module.
*/
-#line 67 "dk4maowd.ctr"
+#line 83 "dk4maowd.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4maowd.h"
#include "dk4numco.h"
@@ -48,7 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 76 "dk4maowd.ctr"
+#line 101 "dk4maowd.ctr"
@@ -64,6 +51,10 @@ dk4ma_write_wc_decimal_unsigned(
int err = 0; /* Flag: Error occued */
int back = 0; /* Function result */
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
*dptr = L'\0';
}
@@ -145,7 +136,10 @@ dk4ma_write_wc_decimal_signed(
)
{
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
*dptr = L'\0';
}
diff --git a/support/dktools/dk4maowd.ctr b/support/dktools/dk4maowd.ctr
index 4e11d84993..ad0a4362b5 100644
--- a/support/dktools/dk4maowd.ctr
+++ b/support/dktools/dk4maowd.ctr
@@ -3,7 +3,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -32,6 +44,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -45,6 +59,8 @@ dk4ma_write_wc_decimal_unsigned(
);
/** Write signed number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -66,6 +82,15 @@ dk4ma_write_wc_decimal_signed(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maowd.h"
#include "dk4numco.h"
#include "dk4numl.h"
@@ -88,6 +113,10 @@ dk4ma_write_wc_decimal_unsigned(
int err = 0; /* Flag: Error occued */
int back = 0; /* Function result */
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
*dptr = L'\0';
}
@@ -169,7 +198,10 @@ dk4ma_write_wc_decimal_signed(
)
{
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if ((NULL != dptr) && (0 < sz)) {
*dptr = L'\0';
}
diff --git a/support/dktools/dk4maowd.h b/support/dktools/dk4maowd.h
index 36a521a6d3..4bd4d48987 100644
--- a/support/dktools/dk4maowd.h
+++ b/support/dktools/dk4maowd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maowd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maowd.ctr
*/
#ifndef DK4MAOWD_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -64,6 +54,8 @@ extern "C" {
#endif
/** Write unsigned number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
@@ -77,6 +69,8 @@ dk4ma_write_wc_decimal_unsigned(
);
/** Write signed number to char string in decimal notation.
+
+ CRT on Windows: Optional.
@param dptr Pointer to buffer for string.
@param sz Buffer size (number of char).
@param val Value to write.
diff --git a/support/dktools/dk4maowdbl.c b/support/dktools/dk4maowdbl.c
index 09d5c556b0..1a5aaca1c0 100644
--- a/support/dktools/dk4maowdbl.c
+++ b/support/dktools/dk4maowdbl.c
@@ -1,47 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maowdbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maowdbl.ctr
*/
/** @file dk4maowdbl.c The dk4maowdbl module.
*/
-#line 74 "dk4maowdbl.ctr"
+#line 88 "dk4maowdbl.ctr"
#include "dk4conf.h"
#include "dk4types.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LOCALE_H
#ifndef LOCALE_H_INCLUDED
#include <locale.h>
@@ -57,6 +42,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#line 115 "dk4maowdbl.ctr"
+
+
+
/** Locale to user for conversion.
*/
static const char locale_kw[] = { "C" };
@@ -90,7 +81,7 @@ dk4double_squeeze_wc_string(wchar_t *buf)
int useexp = 1;
-#line 125 "dk4maowdbl.ctr"
+#line 150 "dk4maowdbl.ctr"
if (NULL != buf) {
ptr = buf;
while(L'\0' != *ptr) {
@@ -109,19 +100,19 @@ dk4double_squeeze_wc_string(wchar_t *buf)
}
if (NULL != ptre) {
-#line 142 "dk4maowdbl.ctr"
+#line 167 "dk4maowdbl.ctr"
*ptre = '\0';
ptr = ptre;
ptr++;
if ((L'+' == *ptr) || (L'0' == *ptr)) {
-#line 146 "dk4maowdbl.ctr"
+#line 171 "dk4maowdbl.ctr"
useexp = 0;
ptr++;
while(L'\0' != *ptr) {
if (L'0' != *ptr) {
-#line 150 "dk4maowdbl.ctr"
+#line 175 "dk4maowdbl.ctr"
useexp = 1;
}
ptr++;
@@ -132,21 +123,21 @@ dk4double_squeeze_wc_string(wchar_t *buf)
ptrdot++;
if (L'\0' != *ptrdot) {
-#line 159 "dk4maowdbl.ctr"
+#line 184 "dk4maowdbl.ctr"
ptrdot++;
while(L'\0' != *ptrdot) {
-#line 161 "dk4maowdbl.ctr"
+#line 186 "dk4maowdbl.ctr"
if (L'0' == *ptrdot) {
if (NULL == ptrcut) {
ptrcut = ptrdot;
-#line 164 "dk4maowdbl.ctr"
+#line 189 "dk4maowdbl.ctr"
}
} else {
ptrcut = NULL;
-#line 167 "dk4maowdbl.ctr"
+#line 192 "dk4maowdbl.ctr"
}
ptrdot++;
}
@@ -183,7 +174,7 @@ dk4double_squeeze_wc_string(wchar_t *buf)
}
-#line 202 "dk4maowdbl.ctr"
+#line 227 "dk4maowdbl.ctr"
}
@@ -199,13 +190,20 @@ dk4ma_internal_write_wc_double(
wchar_t buf[64];
int back = 0;
int res = 0;
+
+
+#line 243 "dk4maowdbl.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = L'\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
res = _snwprintf_s(
buf, DK4_SIZEOF(buf,dkChar), _TRUNCATE, L"%.*e", (int)DK4_DBL_DIGITS, v
);
- if ((0 < res) && (res < DK4_SIZEOF(buf,dkChar))) {
+ if ((0 < res) && (((size_t)res) < DK4_SIZEOF(buf,dkChar))) {
buf[res] = L'\0';
if (0 != minimize) {
dk4double_squeeze_wc_string(buf);
@@ -218,7 +216,7 @@ dk4ma_internal_write_wc_double(
res = _snwprintf_s(
buf, DK4_SIZEOF(buf,dkChar), _TRUNCATE, L"%g", v
);
- if ((0 < res) && (res < DK4_SIZEOF(buf,dkChar))) {
+ if ((0 < res) && (((size_t)res) < DK4_SIZEOF(buf,dkChar))) {
buf[res] = L'\0';
back = dk4strw_cpy_s(dptr, szdptr, buf, erp);
} else {
@@ -228,6 +226,9 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 277 "dk4maowdbl.ctr"
return back;
/* --- _snwprintf_s */
#else
@@ -236,6 +237,13 @@ dk4ma_internal_write_wc_double(
wchar_t buf[64];
int back = 0;
int res = 0;
+
+
+#line 286 "dk4maowdbl.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = L'\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -265,6 +273,9 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 320 "dk4maowdbl.ctr"
return back;
/* --- _snwprintf */
#else
@@ -272,6 +283,13 @@ dk4ma_internal_write_wc_double(
wchar_t buf[64];
int back = 0;
int res = 0;
+
+
+#line 328 "dk4maowdbl.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = L'\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -297,6 +315,9 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 358 "dk4maowdbl.ctr"
return back;
#else
#if DK4_HAVE_SWPRINTF
@@ -304,11 +325,18 @@ dk4ma_internal_write_wc_double(
wchar_t buf[64];
int back = 0;
int res = 0;
+
+
+#line 366 "dk4maowdbl.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = L'\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
res = swprintf(buf,DK4_SIZEOF(buf,dkChar),L"%.*e",(int)DK4_DBL_DIGITS,v);
- if ((0 < res) && (res < DK4_SIZEOF(buf,dkChar))) {
+ if ((0 < res) && ((size_t)res < DK4_SIZEOF(buf,dkChar))) {
buf[res] = L'\0';
if (0 != minimize) {
dk4double_squeeze_wc_string(buf);
@@ -319,7 +347,7 @@ dk4ma_internal_write_wc_double(
}
} else {
res = swprintf(buf, DK4_SIZEOF(buf,dkChar), L"%g", v);
- if ((0 < res) && (res < DK4_SIZEOF(buf,dkChar))) {
+ if ((0 < res) && ((size_t)res < DK4_SIZEOF(buf,dkChar))) {
buf[res] = L'\0';
back = dk4strw_cpy_s(dptr, szdptr, buf, erp);
} else {
@@ -329,6 +357,9 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 396 "dk4maowdbl.ctr"
return back;
/* --- swprintf */
#else
@@ -336,6 +367,13 @@ dk4ma_internal_write_wc_double(
char *p1;
wchar_t *p2;
int back = 0;
+
+
+#line 404 "dk4maowdbl.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != dk4ma_write_c8_double(buf,sizeof(buf),v,exact,minimize,erp)) {
if (dk4str8_len(buf) < szdptr) {
@@ -352,6 +390,9 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 425 "dk4maowdbl.ctr"
return back;
#endif
#endif
@@ -371,7 +412,13 @@ dk4ma_write_wc_double(
char *oldloc = NULL;
#endif
int back = 0;
+
+#line 445 "dk4maowdbl.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
oldloc = setlocale(LC_NUMERIC, NULL);
(void)setlocale(LC_NUMERIC, locale_kw);
@@ -380,6 +427,9 @@ dk4ma_write_wc_double(
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
(void)setlocale(LC_NUMERIC, oldloc);
#endif
+
+
+#line 458 "dk4maowdbl.ctr"
return back;
}
diff --git a/support/dktools/dk4maowdbl.ctr b/support/dktools/dk4maowdbl.ctr
index c48681d1ac..72e4d708c1 100644
--- a/support/dktools/dk4maowdbl.ctr
+++ b/support/dktools/dk4maowdbl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -17,15 +17,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
@@ -45,6 +57,8 @@ extern "C" {
#endif
/** Convert double value to string.
+
+ CRT on Windows: Required.
@param dptr Destination buffer pointer.
@param szdptr Size of destination buffer (number of wchar_t).
@param v Value to convert.
@@ -75,6 +89,13 @@ dk4ma_write_wc_double(
#include "dk4conf.h"
#include "dk4types.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_LOCALE_H
#ifndef LOCALE_H_INCLUDED
#include <locale.h>
@@ -90,6 +111,10 @@ dk4ma_write_wc_double(
+$!trace-include
+
+
+
/** Locale to user for conversion.
*/
static const char locale_kw[] = { "C" };
@@ -214,13 +239,18 @@ dk4ma_internal_write_wc_double(
wchar_t buf[64];
int back = 0;
int res = 0;
+ $? "+ dk4ma_internal_write_wc_double DK4_HAVE__SNWPRINTF_S"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = L'\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
res = _snwprintf_s(
buf, DK4_SIZEOF(buf,dkChar), _TRUNCATE, L"%.*e", (int)DK4_DBL_DIGITS, v
);
- if ((0 < res) && (res < DK4_SIZEOF(buf,dkChar))) {
+ if ((0 < res) && (((size_t)res) < DK4_SIZEOF(buf,dkChar))) {
buf[res] = L'\0';
if (0 != minimize) {
dk4double_squeeze_wc_string(buf);
@@ -233,7 +263,7 @@ dk4ma_internal_write_wc_double(
res = _snwprintf_s(
buf, DK4_SIZEOF(buf,dkChar), _TRUNCATE, L"%g", v
);
- if ((0 < res) && (res < DK4_SIZEOF(buf,dkChar))) {
+ if ((0 < res) && (((size_t)res) < DK4_SIZEOF(buf,dkChar))) {
buf[res] = L'\0';
back = dk4strw_cpy_s(dptr, szdptr, buf, erp);
} else {
@@ -243,6 +273,7 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4ma_internal_write_wc_double DK4_HAVE__SNWPRINTF_S %d", back
return back;
/* --- _snwprintf_s */
#else
@@ -251,6 +282,11 @@ dk4ma_internal_write_wc_double(
wchar_t buf[64];
int back = 0;
int res = 0;
+ $? "+ dk4ma_internal_write_wc_double DK4_HAVE__SNWPRINTF"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = L'\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -280,6 +316,7 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4ma_internal_write_wc_double DK4_HAVE__SNWPRINTF %d", back
return back;
/* --- _snwprintf */
#else
@@ -287,6 +324,11 @@ dk4ma_internal_write_wc_double(
wchar_t buf[64];
int back = 0;
int res = 0;
+ $? "+ dk4ma_internal_write_wc_double DK4_HAVE_SNWPRINTF"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = L'\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
@@ -312,6 +354,7 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4ma_internal_write_wc_double DK4_HAVE_SNWPRINTF %d", back
return back;
#else
#if DK4_HAVE_SWPRINTF
@@ -319,11 +362,16 @@ dk4ma_internal_write_wc_double(
wchar_t buf[64];
int back = 0;
int res = 0;
+ $? "+ dk4ma_internal_write_wc_double DK4_HAVE_SWPRINTF"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if (NULL != dptr) { *dptr = L'\0'; }
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != exact) {
res = swprintf(buf,DK4_SIZEOF(buf,dkChar),L"%.*e",(int)DK4_DBL_DIGITS,v);
- if ((0 < res) && (res < DK4_SIZEOF(buf,dkChar))) {
+ if ((0 < res) && ((size_t)res < DK4_SIZEOF(buf,dkChar))) {
buf[res] = L'\0';
if (0 != minimize) {
dk4double_squeeze_wc_string(buf);
@@ -334,7 +382,7 @@ dk4ma_internal_write_wc_double(
}
} else {
res = swprintf(buf, DK4_SIZEOF(buf,dkChar), L"%g", v);
- if ((0 < res) && (res < DK4_SIZEOF(buf,dkChar))) {
+ if ((0 < res) && ((size_t)res < DK4_SIZEOF(buf,dkChar))) {
buf[res] = L'\0';
back = dk4strw_cpy_s(dptr, szdptr, buf, erp);
} else {
@@ -344,6 +392,7 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4ma_internal_write_wc_double DK4_HAVE_SWPRINTF %d", back
return back;
/* --- swprintf */
#else
@@ -351,6 +400,11 @@ dk4ma_internal_write_wc_double(
char *p1;
wchar_t *p2;
int back = 0;
+ $? "+ dk4ma_internal_write_wc_double swprintf"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
if ((NULL != dptr) && (1 < szdptr)) {
if (0 != dk4ma_write_c8_double(buf,sizeof(buf),v,exact,minimize,erp)) {
if (dk4str8_len(buf) < szdptr) {
@@ -367,6 +421,7 @@ dk4ma_internal_write_wc_double(
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4ma_internal_write_wc_double swprintf %d", back
return back;
#endif
#endif
@@ -386,7 +441,11 @@ dk4ma_write_wc_double(
char *oldloc = NULL;
#endif
int back = 0;
-
+ $? "+ dk4ma_write_wc_double %u value=%lg", (unsigned)szdptr, v
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
oldloc = setlocale(LC_NUMERIC, NULL);
(void)setlocale(LC_NUMERIC, locale_kw);
@@ -395,6 +454,7 @@ dk4ma_write_wc_double(
#if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC)
(void)setlocale(LC_NUMERIC, oldloc);
#endif
+ $? "- dk4ma_write_wc_double %d", back
return back;
}
diff --git a/support/dktools/dk4maowdbl.h b/support/dktools/dk4maowdbl.h
index 8b7526d560..0db4664c1f 100644
--- a/support/dktools/dk4maowdbl.h
+++ b/support/dktools/dk4maowdbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maowdbl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maowdbl.ctr
*/
#ifndef DK4MAOWDBL_H_INCLUDED
@@ -49,15 +27,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
@@ -77,6 +67,8 @@ extern "C" {
#endif
/** Convert double value to string.
+
+ CRT on Windows: Required.
@param dptr Destination buffer pointer.
@param szdptr Size of destination buffer (number of wchar_t).
@param v Value to convert.
diff --git a/support/dktools/dk4maowh.c b/support/dktools/dk4maowh.c
index 16db7f8ee8..52dd53954a 100644
--- a/support/dktools/dk4maowh.c
+++ b/support/dktools/dk4maowh.c
@@ -1,45 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maowh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maowh.ctr
*/
/** @file dk4maowh.c The dk4maowh module.
*/
-#line 67 "dk4maowh.ctr"
+#line 79 "dk4maowh.ctr"
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maowh.h"
@@ -55,7 +42,10 @@ dk4ma_write_wc_hex_unsigned(
int cc = 1; /* Flag: Can continue */
int err = 0; /* Flag: Error occued */
int back = 0; /* Function result */
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if (1 == padsz) { padsz = 2 * sizeof(dk4_um_t); }
if ((NULL != dptr) && (0 < sz) && (padsz < sz)) {
*dptr = L'\0';
@@ -150,6 +140,10 @@ dk4ma_write_wc_hex_signed(
wchar_t *dptr, size_t sz, dk4_im_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
return (dk4ma_write_wc_hex_unsigned(dptr, sz, (dk4_um_t)val, padsz, erp));
}
diff --git a/support/dktools/dk4maowh.ctr b/support/dktools/dk4maowh.ctr
index ebf0826703..43b9ae890f 100644
--- a/support/dktools/dk4maowh.ctr
+++ b/support/dktools/dk4maowh.ctr
@@ -3,7 +3,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -66,6 +78,15 @@ dk4ma_write_wc_hex_signed(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4maowh.h"
@@ -81,7 +102,10 @@ dk4ma_write_wc_hex_unsigned(
int cc = 1; /* Flag: Can continue */
int err = 0; /* Flag: Error occued */
int back = 0; /* Function result */
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
if (1 == padsz) { padsz = 2 * sizeof(dk4_um_t); }
if ((NULL != dptr) && (0 < sz) && (padsz < sz)) {
*dptr = L'\0';
@@ -176,6 +200,10 @@ dk4ma_write_wc_hex_signed(
wchar_t *dptr, size_t sz, dk4_im_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
return (dk4ma_write_wc_hex_unsigned(dptr, sz, (dk4_um_t)val, padsz, erp));
}
diff --git a/support/dktools/dk4maowh.h b/support/dktools/dk4maowh.h
index 8bfa2550ed..256c722ecd 100644
--- a/support/dktools/dk4maowh.h
+++ b/support/dktools/dk4maowh.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maowh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maowh.ctr
*/
#ifndef DK4MAOWH_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maoxd.cpp b/support/dktools/dk4maoxd.cpp
index 9123e31bdf..8aae55eb80 100644
--- a/support/dktools/dk4maoxd.cpp
+++ b/support/dktools/dk4maoxd.cpp
@@ -1,46 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maoxd.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maoxd.cpt
*/
/** @file dk4maoxd.cpp The dk4maoxd module.
*/
-#line 104 "dk4maoxd.cpt"
+#line 116 "dk4maoxd.cpt"
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -62,6 +45,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mao8d.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -69,6 +58,10 @@ dk4ma_write_wx_decimal_unsigned(
wxChar *dptr, size_t sz, dk4_um_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_write_wc_decimal_unsigned(dptr, sz, val, padsz, erp));
#else
@@ -83,6 +76,10 @@ dk4ma_write_wx_decimal_signed(
wxChar *dptr, size_t sz, dk4_im_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_write_wc_decimal_signed(dptr, sz, val, padsz, erp));
#else
diff --git a/support/dktools/dk4maoxd.cpt b/support/dktools/dk4maoxd.cpt
index b2e8934397..cb5c4d8bb7 100644
--- a/support/dktools/dk4maoxd.cpt
+++ b/support/dktools/dk4maoxd.cpt
@@ -3,7 +3,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,17 +14,29 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -104,6 +116,11 @@ dk4ma_write_wx_decimal_signed(
#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -125,6 +142,12 @@ dk4ma_write_wx_decimal_signed(
#include "dk4mao8d.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -132,6 +155,10 @@ dk4ma_write_wx_decimal_unsigned(
wxChar *dptr, size_t sz, dk4_um_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_write_wc_decimal_unsigned(dptr, sz, val, padsz, erp));
#else
@@ -146,6 +173,10 @@ dk4ma_write_wx_decimal_signed(
wxChar *dptr, size_t sz, dk4_im_t val, size_t padsz, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < sz);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_write_wc_decimal_signed(dptr, sz, val, padsz, erp));
#else
diff --git a/support/dktools/dk4maoxd.h b/support/dktools/dk4maoxd.h
index 515797cdee..e9fd466e12 100644
--- a/support/dktools/dk4maoxd.h
+++ b/support/dktools/dk4maoxd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maoxd.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maoxd.cpt
*/
#ifndef DK4MAOXD_H_INCLUDED
@@ -46,17 +24,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4maoxdbl.cpp b/support/dktools/dk4maoxdbl.cpp
index 1218a31b97..3f85b2f574 100644
--- a/support/dktools/dk4maoxdbl.cpp
+++ b/support/dktools/dk4maoxdbl.cpp
@@ -1,47 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maoxdbl.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maoxdbl.cpt
*/
/** @file dk4maoxdbl.cpp The dk4maoxdbl module.
*/
-#line 95 "dk4maoxdbl.cpt"
+#line 107 "dk4maoxdbl.cpt"
#include "dk4conf.h"
-
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -59,12 +41,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mao8dbl.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4ma_write_wx_double(
wxChar *dptr, size_t szdptr, double v, int exact, int minimize, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_write_wc_double(dptr, szdptr, v, exact, minimize, erp));
#else
diff --git a/support/dktools/dk4maoxdbl.cpt b/support/dktools/dk4maoxdbl.cpt
index bb15b3245c..690505d462 100644
--- a/support/dktools/dk4maoxdbl.cpt
+++ b/support/dktools/dk4maoxdbl.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -95,7 +107,11 @@ dk4ma_write_wx_double(
#include "dk4conf.h"
-
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if (DK4_HAVE_WXWIDGETS) && (defined(__cplusplus))
@@ -113,12 +129,22 @@ dk4ma_write_wx_double(
#include "dk4mao8dbl.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4ma_write_wx_double(
wxChar *dptr, size_t szdptr, double v, int exact, int minimize, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+#endif
#if DK4_SIZEOF_WXCHAR > 1
return (dk4ma_write_wc_double(dptr, szdptr, v, exact, minimize, erp));
#else
diff --git a/support/dktools/dk4maoxdbl.h b/support/dktools/dk4maoxdbl.h
index c912ed94ce..3efc29a001 100644
--- a/support/dktools/dk4maoxdbl.h
+++ b/support/dktools/dk4maoxdbl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4maoxdbl.cpt
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4maoxdbl.cpt
*/
#ifndef DK4MAOXDBL_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4masz.c b/support/dktools/dk4masz.c
index 68aabdc33e..9c304cac68 100644
--- a/support/dktools/dk4masz.c
+++ b/support/dktools/dk4masz.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4masz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4masz.ctr
*/
/** @file dk4masz.c The dk4masz module.
*/
-#line 55 "dk4masz.ctr"
+#line 67 "dk4masz.ctr"
#include "dk4conf.h"
#include "dk4types.h"
diff --git a/support/dktools/dk4masz.ctr b/support/dktools/dk4masz.ctr
index 441c8d70a4..2efb39d49d 100644
--- a/support/dktools/dk4masz.ctr
+++ b/support/dktools/dk4masz.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -12,15 +12,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4masz.h b/support/dktools/dk4masz.h
index a3c5dda66d..f8b1e920e2 100644
--- a/support/dktools/dk4masz.h
+++ b/support/dktools/dk4masz.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4masz.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4masz.ctr
*/
#ifndef DK4MASZ_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4math.c b/support/dktools/dk4math.c
new file mode 100644
index 0000000000..55cddeb8bb
--- /dev/null
+++ b/support/dktools/dk4math.c
@@ -0,0 +1,181 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4math.ctr
+*/
+
+/** @file dk4math.c The dk4math module.
+*/
+
+
+#line 243 "dk4math.ctr"
+
+#include "dk4conf.h"
+#include "dk4math.h"
+
+
+
+#if (!(DK4_HAVE_RINT))
+double
+dk4ma_rint(double x)
+{
+ return (floor(x+0.5));
+}
+#endif
+
+
+
+#if (!(DK4_HAVE_ISGREATER))
+int
+dk4ma_isgreater(double a, double b)
+{
+ int back = 0;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(a)) && (isfinite(b))) {
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(a)) && (_finite(b))) {
+#endif
+#endif
+ if (a > b) {
+ back = 1;
+ }
+#if DK4_HAVE_ISFINITE
+ }
+#else
+#if DK4_HAVE__FINITE
+ }
+#endif
+#endif
+ return back;
+}
+#endif
+
+
+
+#if (!(DK4_HAVE_ISGREATEREQUAL))
+int
+dk4ma_isgreaterequal(double a, double b)
+{
+ int back = 0;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(a)) && (isfinite(b))) {
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(a)) && (_finite(b))) {
+#endif
+#endif
+ if (a >= b) {
+ back = 1;
+ }
+#if DK4_HAVE_ISFINITE
+ }
+#else
+#if DK4_HAVE__FINITE
+ }
+#endif
+#endif
+ return back;
+}
+#endif
+
+
+
+#if (!(DK4_HAVE_ISLESS))
+int
+dk4ma_isless(double a, double b)
+{
+ int back = 0;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(a)) && (isfinite(b))) {
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(a)) && (_finite(b))) {
+#endif
+#endif
+ if (a < b) {
+ back = 1;
+ }
+#if DK4_HAVE_ISFINITE
+ }
+#else
+#if DK4_HAVE__FINITE
+ }
+#endif
+#endif
+ return back;
+}
+#endif
+
+
+
+#if (!(DK4_HAVE_ISLESSEQUAL))
+int
+dk4ma_islessequal(double a, double b)
+{
+ int back = 0;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(a)) && (isfinite(b))) {
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(a)) && (_finite(b))) {
+#endif
+#endif
+ if (a <= b) {
+ back = 1;
+ }
+#if DK4_HAVE_ISFINITE
+ }
+#else
+#if DK4_HAVE__FINITE
+ }
+#endif
+#endif
+ return back;
+}
+#endif
+
+
+
+int
+dk4ma_is_finite(double d)
+{
+ int back = 0;
+#if _WIN32
+ back = ((0 != _finite(d)) ? 1 : 0);
+#else
+ back = ((0 != isfinite(d)) ? 1 : 0);
+#endif
+ return back;
+}
+
+
+
+int
+dk4ma_is_normal(double d)
+{
+ int back = 0;
+#if _WIN32
+ switch (_fpclass(d)) {
+ case _FPCLASS_NN : case _FPCLASS_NZ :
+ case _FPCLASS_PZ : case _FPCLASS_PN :
+ {
+ back = 1;
+ } break;
+ }
+#else
+ back = ((0 != isnormal(d)) ? 1 : 0);
+#endif
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4math.ctr b/support/dktools/dk4math.ctr
new file mode 100644
index 0000000000..ec89ed8021
--- /dev/null
+++ b/support/dktools/dk4math.ctr
@@ -0,0 +1,405 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4math.h Functions and macros not available on all platforms.
+
+If some of the functions or macros rint(), isgreater(), isgreaterequal(),
+isless() and islessequal() - typically defined in math.h - are missing,
+this header file defines either
+macros or static inline functions calling the provided fallback
+functions dk4ma_rint(), dk4ma_isgreater(), dk4ma_isgreaterequal(),
+dk4ma_isless() or dk4ma_islessequal().
+
+Inline functions are used if both DK4_HAVE_INLINE and DK4_USE_INLINE
+are enabled, macros are used otherwise.
+
+Although the CERT C coding standard prefers use of inline functions over macros,
+I prefer macros as the static inline functions
+(a) create slightly larger object modules,
+(b) create warnings for those static inline functions not used in the module and
+(c) might create warnings if the compiler decides to use real functions
+instead of generating inline code.
+
+The dk4ma_rint() function in the module is always compiled to avoid
+``empty compilation unit'' warnings. The other functions in this module
+are only compiled if necessary.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FLOAT_H
+#ifndef FLOAT_H_INCLUDED
+#include <float.h>
+#define FLOAT_H_INCLUDED 1
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if (!(DK4_HAVE_RINT))
+/** Round value to next integer.
+ @param x floating point valued.
+ @return Floating point value rounded to next integer.
+*/
+double
+dk4ma_rint(double x);
+#endif
+
+#if (!(DK4_HAVE_ISGREATER))
+/** Check whether a is greater than b.
+ @param a Floating point value.
+ @param b Floating point value.
+ @return Comparison result.
+*/
+int
+dk4ma_isgreater(double a, double b);
+#endif
+
+#if (!(DK4_HAVE_ISGREATEREQUAL))
+/** Check whether a is greater than or equal to b.
+ @param a Floating point value.
+ @param b Floating point value.
+ @return Comparison result.
+*/
+int
+dk4ma_isgreaterequal(double a, double b);
+#endif
+
+#if (!(DK4_HAVE_ISLESS))
+/** Check whether a is less than b.
+ @param a Floating point value.
+ @param b Floating point value.
+ @return Comparison result.
+*/
+int
+dk4ma_isless(double a, double b);
+#endif
+
+#if (!(DK4_HAVE_ISLESSEQUAL))
+/** Check whether a is less than or equal to b.
+ @param a Floating point value.
+ @param b Floating point value.
+ @return Comparison result.
+*/
+int
+dk4ma_islessequal(double a, double b);
+#endif
+
+/** Check whether or not a double value is finite.
+ @param d Value to check.
+ @return Nonzero for finite value, zero for infinite value or NaN.
+*/
+int
+dk4ma_is_finite(double d);
+
+/** Check whether double value is in normalized representation.
+ @param d Value to check.
+ @return Nonzero for normalized value, zero for non-normalized value.
+*/
+int
+dk4ma_is_normal(double d);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+
+#if (!(DK4_HAVE_RINT))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+static
+inline
+double
+rint(double x)
+{
+ return (dk4ma_rint(x));
+}
+#else
+/** The rint() function rounds to next integer.
+*/
+#define rint(x) dk4ma_rint(x)
+#endif
+#endif
+
+
+#if (!(DK4_HAVE_ISGREATER))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+/** Compare two double values, check if left value is greater than right value.
+ @param a Left value.
+ @param b Right value.
+ @return Comparison result.
+*/
+static
+inline
+int
+isgreater(double a, double b)
+{
+ return (dk4ma_isgreater(a,b));
+}
+#else
+/** Compare to values.
+*/
+#define isgreater(a,b) dk4ma_isgreater(a,b)
+#endif
+#endif
+
+
+#if (!(DK4_HAVE_ISGREATEREQUAL))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+/** Compare two double values, check if left value is greater than
+ or equal to right value.
+ @param a Left value.
+ @param b Right value.
+ @return Comparison result.
+*/
+static
+inline
+int
+isgreaterequal(double a, double b)
+{
+ return (dk4ma_isgreaterequal(a,b));
+}
+#else
+/** Compare to values.
+*/
+#define isgreaterequal(a,b) dk4ma_isgreaterequal(a,b)
+#endif
+#endif
+
+
+#if (!(DK4_HAVE_ISLESS))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+/** Compare two double values, check if left value is less than right value.
+ @param a Left value.
+ @param b Right value.
+ @return Comparison result.
+*/
+static
+inline
+int
+isless(double a, double b)
+{
+ return (dk4ma_isless(a,b));
+}
+#else
+/** Compare to values.
+*/
+#define isless(a,b) dk4ma_isless(a,b)
+#endif
+#endif
+
+
+#if (!(DK4_HAVE_ISLESSEQUAL))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+/** Compare two double values, check if left value is less than
+ or equal to right value.
+ @param a Left value.
+ @param b Right value.
+ @return Comparison result.
+*/
+static
+inline
+int
+islessequal(double a, double b)
+{
+ return (dk4ma_islessequal(a,b));
+}
+#else
+/** Compare to values.
+*/
+#define islessequal(a,b) dk4ma_islessequal(a,b)
+#endif
+#endif
+
+
+
+%% module
+
+#include "dk4conf.h"
+#include "dk4math.h"
+
+
+
+#if (!(DK4_HAVE_RINT))
+double
+dk4ma_rint(double x)
+{
+ return (floor(x+0.5));
+}
+#endif
+
+
+
+#if (!(DK4_HAVE_ISGREATER))
+int
+dk4ma_isgreater(double a, double b)
+{
+ int back = 0;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(a)) && (isfinite(b))) {
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(a)) && (_finite(b))) {
+#endif
+#endif
+ if (a > b) {
+ back = 1;
+ }
+#if DK4_HAVE_ISFINITE
+ }
+#else
+#if DK4_HAVE__FINITE
+ }
+#endif
+#endif
+ return back;
+}
+#endif
+
+
+
+#if (!(DK4_HAVE_ISGREATEREQUAL))
+int
+dk4ma_isgreaterequal(double a, double b)
+{
+ int back = 0;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(a)) && (isfinite(b))) {
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(a)) && (_finite(b))) {
+#endif
+#endif
+ if (a >= b) {
+ back = 1;
+ }
+#if DK4_HAVE_ISFINITE
+ }
+#else
+#if DK4_HAVE__FINITE
+ }
+#endif
+#endif
+ return back;
+}
+#endif
+
+
+
+#if (!(DK4_HAVE_ISLESS))
+int
+dk4ma_isless(double a, double b)
+{
+ int back = 0;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(a)) && (isfinite(b))) {
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(a)) && (_finite(b))) {
+#endif
+#endif
+ if (a < b) {
+ back = 1;
+ }
+#if DK4_HAVE_ISFINITE
+ }
+#else
+#if DK4_HAVE__FINITE
+ }
+#endif
+#endif
+ return back;
+}
+#endif
+
+
+
+#if (!(DK4_HAVE_ISLESSEQUAL))
+int
+dk4ma_islessequal(double a, double b)
+{
+ int back = 0;
+#if DK4_HAVE_ISFINITE
+ if ((isfinite(a)) && (isfinite(b))) {
+#else
+#if DK4_HAVE__FINITE
+ if ((_finite(a)) && (_finite(b))) {
+#endif
+#endif
+ if (a <= b) {
+ back = 1;
+ }
+#if DK4_HAVE_ISFINITE
+ }
+#else
+#if DK4_HAVE__FINITE
+ }
+#endif
+#endif
+ return back;
+}
+#endif
+
+
+
+int
+dk4ma_is_finite(double d)
+{
+ int back = 0;
+#if _WIN32
+ back = ((0 != _finite(d)) ? 1 : 0);
+#else
+ back = ((0 != isfinite(d)) ? 1 : 0);
+#endif
+ return back;
+}
+
+
+
+int
+dk4ma_is_normal(double d)
+{
+ int back = 0;
+#if _WIN32
+ switch (_fpclass(d)) {
+ case _FPCLASS_NN : case _FPCLASS_NZ :
+ case _FPCLASS_PZ : case _FPCLASS_PN :
+ {
+ back = 1;
+ } break;
+ }
+#else
+ back = ((0 != isnormal(d)) ? 1 : 0);
+#endif
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4math.h b/support/dktools/dk4math.h
new file mode 100644
index 0000000000..0c21e195f0
--- /dev/null
+++ b/support/dktools/dk4math.h
@@ -0,0 +1,255 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4math.ctr
+*/
+
+#ifndef DK4MATH_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4MATH_H_INCLUDED 1
+
+
+#line 8 "dk4math.ctr"
+
+/** @file dk4math.h Functions and macros not available on all platforms.
+
+If some of the functions or macros rint(), isgreater(), isgreaterequal(),
+isless() and islessequal() - typically defined in math.h - are missing,
+this header file defines either
+macros or static inline functions calling the provided fallback
+functions dk4ma_rint(), dk4ma_isgreater(), dk4ma_isgreaterequal(),
+dk4ma_isless() or dk4ma_islessequal().
+
+Inline functions are used if both DK4_HAVE_INLINE and DK4_USE_INLINE
+are enabled, macros are used otherwise.
+
+Although the CERT C coding standard prefers use of inline functions over macros,
+I prefer macros as the static inline functions
+(a) create slightly larger object modules,
+(b) create warnings for those static inline functions not used in the module and
+(c) might create warnings if the compiler decides to use real functions
+instead of generating inline code.
+
+The dk4ma_rint() function in the module is always compiled to avoid
+``empty compilation unit'' warnings. The other functions in this module
+are only compiled if necessary.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_FLOAT_H
+#ifndef FLOAT_H_INCLUDED
+#include <float.h>
+#define FLOAT_H_INCLUDED 1
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if (!(DK4_HAVE_RINT))
+/** Round value to next integer.
+ @param x floating point valued.
+ @return Floating point value rounded to next integer.
+*/
+double
+dk4ma_rint(double x);
+#endif
+
+#if (!(DK4_HAVE_ISGREATER))
+/** Check whether a is greater than b.
+ @param a Floating point value.
+ @param b Floating point value.
+ @return Comparison result.
+*/
+int
+dk4ma_isgreater(double a, double b);
+#endif
+
+#if (!(DK4_HAVE_ISGREATEREQUAL))
+/** Check whether a is greater than or equal to b.
+ @param a Floating point value.
+ @param b Floating point value.
+ @return Comparison result.
+*/
+int
+dk4ma_isgreaterequal(double a, double b);
+#endif
+
+#if (!(DK4_HAVE_ISLESS))
+/** Check whether a is less than b.
+ @param a Floating point value.
+ @param b Floating point value.
+ @return Comparison result.
+*/
+int
+dk4ma_isless(double a, double b);
+#endif
+
+#if (!(DK4_HAVE_ISLESSEQUAL))
+/** Check whether a is less than or equal to b.
+ @param a Floating point value.
+ @param b Floating point value.
+ @return Comparison result.
+*/
+int
+dk4ma_islessequal(double a, double b);
+#endif
+
+/** Check whether or not a double value is finite.
+ @param d Value to check.
+ @return Nonzero for finite value, zero for infinite value or NaN.
+*/
+int
+dk4ma_is_finite(double d);
+
+/** Check whether double value is in normalized representation.
+ @param d Value to check.
+ @return Nonzero for normalized value, zero for non-normalized value.
+*/
+int
+dk4ma_is_normal(double d);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+
+#if (!(DK4_HAVE_RINT))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+static
+inline
+double
+rint(double x)
+{
+ return (dk4ma_rint(x));
+}
+#else
+/** The rint() function rounds to next integer.
+*/
+#define rint(x) dk4ma_rint(x)
+#endif
+#endif
+
+
+#if (!(DK4_HAVE_ISGREATER))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+/** Compare two double values, check if left value is greater than right value.
+ @param a Left value.
+ @param b Right value.
+ @return Comparison result.
+*/
+static
+inline
+int
+isgreater(double a, double b)
+{
+ return (dk4ma_isgreater(a,b));
+}
+#else
+/** Compare to values.
+*/
+#define isgreater(a,b) dk4ma_isgreater(a,b)
+#endif
+#endif
+
+
+#if (!(DK4_HAVE_ISGREATEREQUAL))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+/** Compare two double values, check if left value is greater than
+ or equal to right value.
+ @param a Left value.
+ @param b Right value.
+ @return Comparison result.
+*/
+static
+inline
+int
+isgreaterequal(double a, double b)
+{
+ return (dk4ma_isgreaterequal(a,b));
+}
+#else
+/** Compare to values.
+*/
+#define isgreaterequal(a,b) dk4ma_isgreaterequal(a,b)
+#endif
+#endif
+
+
+#if (!(DK4_HAVE_ISLESS))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+/** Compare two double values, check if left value is less than right value.
+ @param a Left value.
+ @param b Right value.
+ @return Comparison result.
+*/
+static
+inline
+int
+isless(double a, double b)
+{
+ return (dk4ma_isless(a,b));
+}
+#else
+/** Compare to values.
+*/
+#define isless(a,b) dk4ma_isless(a,b)
+#endif
+#endif
+
+
+#if (!(DK4_HAVE_ISLESSEQUAL))
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
+/** Compare two double values, check if left value is less than
+ or equal to right value.
+ @param a Left value.
+ @param b Right value.
+ @return Comparison result.
+*/
+static
+inline
+int
+islessequal(double a, double b)
+{
+ return (dk4ma_islessequal(a,b));
+}
+#else
+/** Compare to values.
+*/
+#define islessequal(a,b) dk4ma_islessequal(a,b)
+#endif
+#endif
+
+
+
+
+#endif
diff --git a/support/dktools/dk4mbstrm.c b/support/dktools/dk4mbstrm.c
index d42b82ce65..ab8e0dc35f 100644
--- a/support/dktools/dk4mbstrm.c
+++ b/support/dktools/dk4mbstrm.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mbstrm.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mbstrm.ctr
*/
/** @file dk4mbstrm.c The dk4mbstrm module.
*/
-#line 45 "dk4mbstrm.ctr"
+#line 70 "dk4mbstrm.ctr"
+#include "dk4conf.h"
#include "dk4mbstrm.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
static
@@ -49,6 +34,9 @@ dk4stream_membuf_function(dk4_stream_api_t *api)
{
dk4_membuf_t *mb;
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -56,11 +44,16 @@ dk4stream_membuf_function(dk4_stream_api_t *api)
if (NULL != mb) {
switch (api->cmd) {
case DK4_STREAM_API_WRITE: {
- api->res = dk4membuf_store(
- mb, (const void *)(api->b), api->sz_in, NULL
- );
- if (0 != api->res) {
- api->sz_out = api->sz_in;
+ if (0 < api->sz_in) {
+ api->res = dk4membuf_store(
+ mb, (const void *)(api->b), api->sz_in, NULL
+ );
+ if (0 != api->res) {
+ api->sz_out = api->sz_in;
+ }
+ }
+ else {
+ api->res = 1;
}
} break;
case DK4_STREAM_API_FLUSH: {
@@ -85,6 +78,10 @@ dk4_stream_t *
dk4stream_open_membuf_writer(dk4_membuf_t *mb, dk4_er_t *erp)
{
dk4_stream_t *back = NULL;
+
+#if DK4_USE_ASSERT
+ assert(NULL != mb);
+#endif
if (NULL != mb) {
back = dk4stream_open(
mb, dk4stream_membuf_function,
diff --git a/support/dktools/dk4mbstrm.ctr b/support/dktools/dk4mbstrm.ctr
index e295336389..74a78b4f35 100644
--- a/support/dktools/dk4mbstrm.ctr
+++ b/support/dktools/dk4mbstrm.ctr
@@ -2,21 +2,42 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4MEMBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -30,6 +51,10 @@ extern "C" {
@param mb Destination memory buffer.
@param erp Error report, may be NULL.
@return Valid pointer on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if mb is NULL.
*/
dk4_stream_t *
@@ -43,8 +68,15 @@ dk4stream_open_membuf_writer(dk4_membuf_t *mb, dk4_er_t *erp);
/* vim: set ai sw=4 ts=4 : */
%% module
+#include "dk4conf.h"
#include "dk4mbstrm.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
static
@@ -53,6 +85,9 @@ dk4stream_membuf_function(dk4_stream_api_t *api)
{
dk4_membuf_t *mb;
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -60,11 +95,16 @@ dk4stream_membuf_function(dk4_stream_api_t *api)
if (NULL != mb) {
switch (api->cmd) {
case DK4_STREAM_API_WRITE: {
- api->res = dk4membuf_store(
- mb, (const void *)(api->b), api->sz_in, NULL
- );
- if (0 != api->res) {
- api->sz_out = api->sz_in;
+ if (0 < api->sz_in) {
+ api->res = dk4membuf_store(
+ mb, (const void *)(api->b), api->sz_in, NULL
+ );
+ if (0 != api->res) {
+ api->sz_out = api->sz_in;
+ }
+ }
+ else {
+ api->res = 1;
}
} break;
case DK4_STREAM_API_FLUSH: {
@@ -89,6 +129,10 @@ dk4_stream_t *
dk4stream_open_membuf_writer(dk4_membuf_t *mb, dk4_er_t *erp)
{
dk4_stream_t *back = NULL;
+
+#if DK4_USE_ASSERT
+ assert(NULL != mb);
+#endif
if (NULL != mb) {
back = dk4stream_open(
mb, dk4stream_membuf_function,
diff --git a/support/dktools/dk4mbstrm.h b/support/dktools/dk4mbstrm.h
index d1435e358e..392b511be1 100644
--- a/support/dktools/dk4mbstrm.h
+++ b/support/dktools/dk4mbstrm.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mbstrm.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mbstrm.ctr
*/
/** @file dk4mbstrm.h Header file for the dk4mbstrm module.
@@ -43,16 +21,37 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4mbstrm.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4MEMBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -66,6 +65,10 @@ extern "C" {
@param mb Destination memory buffer.
@param erp Error report, may be NULL.
@return Valid pointer on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if mb is NULL.
*/
dk4_stream_t *
diff --git a/support/dktools/dk4md.c b/support/dktools/dk4md.c
index 0a37fcd0b6..19cc26e04c 100644
--- a/support/dktools/dk4md.c
+++ b/support/dktools/dk4md.c
@@ -1,55 +1,40 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4md.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4md.ctr
*/
/** @file dk4md.c The dk4md module.
*/
-#line 252 "dk4md.ctr"
+#line 272 "dk4md.ctr"
+#include "dk4conf.h"
#include "dk4md.h"
#include "dk4mem.h"
#include "dk4numco.h"
#include "dk4binenc.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 262 "dk4md.ctr"
+#line 289 "dk4md.ctr"
@@ -57,6 +42,9 @@ int
dk4md_ctx_init(dk4_md_ctx_t *ctxptr, int mdt, int mde, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ctxptr);
+#endif
if (NULL != ctxptr) {
DK4_MEMRES(ctxptr, sizeof(dk4_md_ctx_t));
ctxptr->mdtype = -1;
@@ -173,6 +161,11 @@ dk4md_ctx_add(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ctxptr);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != ctxptr) && (NULL != buffer) && (0 < sz)) {
if ((dk4_um_t)sz <= (dk4_um_t)ULONG_MAX) {
if (-1 != ctxptr->mdtype) {
@@ -287,7 +280,12 @@ dk4md_ctx_finish(
int back = 0;
-#line 498 "dk4md.ctr"
+#line 533 "dk4md.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rptr);
+ assert(NULL != rszptr);
+ assert(NULL != ctxptr);
+#endif
if ((NULL != rptr) && (NULL != rszptr) && (NULL != ctxptr)) {
if (-1 != ctxptr->mdtype) {
switch (ctxptr->mdtype) {
@@ -413,15 +411,15 @@ dk4md_ctx_finish(
} break;
case DK4_MD_SHA512 : {
-#line 622 "dk4md.ctr"
+#line 662 "dk4md.ctr"
#if DK4_HAVE_OPENSSL_SHA_H && DK4_HAVE_SHA512
-#line 624 "dk4md.ctr"
+#line 664 "dk4md.ctr"
back = SHA512_Final(&(ctxptr->bbuf[0]), &((ctxptr->ctx).sha512));
if (0 != back) {
-#line 626 "dk4md.ctr"
+#line 666 "dk4md.ctr"
back = dk4binenc(
&(ctxptr->obuf[0]), DK4MD_BUFFER_SIZE_TEXT,
&(ctxptr->bbuf[0]), 64,
@@ -429,10 +427,10 @@ dk4md_ctx_finish(
);
if (0 != back) {
-#line 632 "dk4md.ctr"
+#line 672 "dk4md.ctr"
*rptr = &(ctxptr->obuf[0]);
-#line 633 "dk4md.ctr"
+#line 673 "dk4md.ctr"
switch (ctxptr->encoding) {
case DK4_BINARY_TO_TEXT_ENCODING_NONE : { *rszptr = 64; } break;
case DK4_BINARY_TO_TEXT_ENCODING_HEX : { *rszptr = 128;} break;
@@ -440,11 +438,11 @@ dk4md_ctx_finish(
}
} else {
-#line 639 "dk4md.ctr"
+#line 679 "dk4md.ctr"
}
} else {
-#line 641 "dk4md.ctr"
+#line 681 "dk4md.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYSTEM);
}
#else
@@ -488,7 +486,7 @@ dk4md_ctx_finish(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 683 "dk4md.ctr"
+#line 723 "dk4md.ctr"
return back;
}
diff --git a/support/dktools/dk4md.ctr b/support/dktools/dk4md.ctr
index 358c9b097f..e1e653d139 100644
--- a/support/dktools/dk4md.ctr
+++ b/support/dktools/dk4md.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -19,9 +19,29 @@ Eric Young (eay@cryptsoft.com).
This product includes software written by Tim Hudson (tjh@cryptsoft.com).
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4BINENC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4binenc.h"
+#else
+#include <dktools-4/dk4binenc.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
#if DK4_HAVE_OPENSSL_MD5_H
@@ -251,11 +271,18 @@ enum {
%% module
+#include "dk4conf.h"
#include "dk4md.h"
#include "dk4mem.h"
#include "dk4numco.h"
#include "dk4binenc.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -266,6 +293,9 @@ int
dk4md_ctx_init(dk4_md_ctx_t *ctxptr, int mdt, int mde, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ctxptr);
+#endif
if (NULL != ctxptr) {
DK4_MEMRES(ctxptr, sizeof(dk4_md_ctx_t));
ctxptr->mdtype = -1;
@@ -382,6 +412,11 @@ dk4md_ctx_add(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ctxptr);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != ctxptr) && (NULL != buffer) && (0 < sz)) {
if ((dk4_um_t)sz <= (dk4_um_t)ULONG_MAX) {
if (-1 != ctxptr->mdtype) {
@@ -495,6 +530,11 @@ dk4md_ctx_finish(
{
int back = 0;
$? "+ dk4md_ctx_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != rptr);
+ assert(NULL != rszptr);
+ assert(NULL != ctxptr);
+#endif
if ((NULL != rptr) && (NULL != rszptr) && (NULL != ctxptr)) {
if (-1 != ctxptr->mdtype) {
switch (ctxptr->mdtype) {
diff --git a/support/dktools/dk4md.h b/support/dktools/dk4md.h
index 7ae2337133..b27399c2f7 100644
--- a/support/dktools/dk4md.h
+++ b/support/dktools/dk4md.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4md.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4md.ctr
*/
#ifndef DK4MD_H_INCLUDED
@@ -52,9 +30,29 @@ Eric Young (eay@cryptsoft.com).
This product includes software written by Tim Hudson (tjh@cryptsoft.com).
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4BINENC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4binenc.h"
+#else
+#include <dktools-4/dk4binenc.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
#if DK4_HAVE_OPENSSL_MD5_H
diff --git a/support/dktools/dk4mdch.c b/support/dktools/dk4mdch.c
index b70e18990f..a7b26ca384 100644
--- a/support/dktools/dk4mdch.c
+++ b/support/dktools/dk4mdch.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk4mdch.ctr
@@ -9,16 +15,23 @@
*/
-#line 6 "dk4mdch.ctr"
+#line 8 "dk4mdch.ctr"
+#include "dk4conf.h"
#include "dk4md.h"
#include "dk4strd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 13 "dk4mdch.ctr"
+#line 22 "dk4mdch.ctr"
@@ -68,7 +81,7 @@ dkT("ripemd160"),
NULL
-#line 35 "dk4mdch.ctr"
+#line 44 "dk4mdch.ctr"
};
@@ -77,6 +90,9 @@ int
dk4md_choose_type(const dkChar *name, dk4_er_t *erp)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL != name) {
switch (dk4str_array_index(dk4md_type_names, name, 0)) {
case 0: {
diff --git a/support/dktools/dk4mdch.ctr b/support/dktools/dk4mdch.ctr
index 5d9693c0f7..afa7593f15 100644
--- a/support/dktools/dk4mdch.ctr
+++ b/support/dktools/dk4mdch.ctr
@@ -1,12 +1,21 @@
%% options
-
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4md.h"
#include "dk4strd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -40,6 +49,9 @@ int
dk4md_choose_type(const dkChar *name, dk4_er_t *erp)
{
int back = -1;
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL != name) {
switch (dk4str_array_index(dk4md_type_names, name, 0)) {
case 0: {
diff --git a/support/dktools/dk4mem.c b/support/dktools/dk4mem.c
index a0da0418ae..ec114fb633 100644
--- a/support/dktools/dk4mem.c
+++ b/support/dktools/dk4mem.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mem.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mem.ctr
*/
/** @file dk4mem.c The dk4mem module.
*/
-#line 699 "dk4mem.ctr"
+#line 895 "dk4mem.ctr"
#include "dk4conf.h"
@@ -62,6 +40,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define STRINGS_H_INCLUDED 1
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mem.h"
#include "dk4numco.h"
@@ -70,9 +54,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 730 "dk4mem.ctr"
+#line 932 "dk4mem.ctr"
+#if ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMSET)) && (!(DK4_HAVE_BZERO)))
static
void
@@ -86,17 +71,27 @@ dk4mem_fallback_i_reset(unsigned char *bptr, size_t sz)
void
dk4mem_fallback_reset(void *bptr, size_t sz)
{
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
dk4mem_fallback_i_reset((unsigned char *)bptr, sz);
}
+#endif
+
void
dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp)
{
-#line 754 "dk4mem.ctr"
+#line 963 "dk4mem.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
if ((NULL != bptr) && (0 < sz)) {
DK4_MEMRES(bptr, sz);
} else {
@@ -104,7 +99,7 @@ dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp)
}
-#line 760 "dk4mem.ctr"
+#line 973 "dk4mem.ctr"
}
@@ -112,23 +107,38 @@ dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp)
void
dk4mem_set(void *bptr, size_t sz, unsigned char uc, dk4_er_t *erp)
{
-#if !DK4_HAVE_MEMSET
- unsigned char *ucptr;
+#if DK4_HAVE_MEMSET \
+&& (!(DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_AVOID_CRT)))
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < sz);
#endif
if ((NULL != bptr) && (0 < sz)) {
-#if DK4_HAVE_MEMSET
memset(bptr, (int)uc, sz);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
#else
+ unsigned char *ucptr;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
+ if ((NULL != bptr) && (0 < sz)) {
ucptr = (unsigned char *)bptr;
while (0 < sz--) { *(ucptr++) = uc; }
-#endif
- } else {
+ }
+ else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+#endif
}
+#if ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMCPY)) && (!(DK4_HAVE_BCOPY)))
+
static
void
dk4mem_fallback_i_cpy(unsigned char *dst, const unsigned char *src, size_t sz)
@@ -141,6 +151,11 @@ dk4mem_fallback_i_cpy(unsigned char *dst, const unsigned char *src, size_t sz)
void
dk4mem_fallback_cpy(void *dst, const void *src, size_t sz)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+ assert(0 < sz);
+#endif
dk4mem_fallback_i_cpy(
(unsigned char *)dst,
(const unsigned char *)src,
@@ -149,10 +164,17 @@ dk4mem_fallback_cpy(void *dst, const void *src, size_t sz)
}
+#endif
+
void
dk4mem_cpy(void *dst, void const *src, size_t sz, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (NULL != src) && (0 < sz)) {
DK4_MEMCPY(dst, src, sz);
} else {
@@ -161,6 +183,10 @@ dk4mem_cpy(void *dst, void const *src, size_t sz, dk4_er_t *erp)
}
+
+#if (DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)) \
+|| ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMCMP)) && (!(DK4_HAVE_BCMP)))
+
static
int
dk4mem_fallback_i_cmp(
@@ -188,6 +214,11 @@ dk4mem_fallback_i_cmp(
int
dk4mem_fallback_cmp(const void *s1, const void *s2, size_t sz)
{
+#if DK4_USE_ASSERT
+ assert(NULL != s1);
+ assert(NULL != s2);
+ assert(0 < sz);
+#endif
return(
dk4mem_fallback_i_cmp(
(const unsigned char *)s1,
@@ -197,12 +228,18 @@ dk4mem_fallback_cmp(const void *s1, const void *s2, size_t sz)
);
}
+#endif
int
dk4mem_cmp(const void *s1, const void *s2, size_t sz, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != s1);
+ assert(NULL != s2);
+ assert(0 < sz);
+#endif
if ((NULL != s1) && (NULL != s2) && (0 < sz)) {
back = DK4_MEMCMP(s1, s2, sz);
} else {
@@ -220,6 +257,9 @@ void *
dk4mem_malloc_bytes(size_t bytes, dk4_er_t *erp)
{
void *back = NULL; /* Function result. */
+#if DK4_USE_ASSERT
+ assert(0 < bytes);
+#endif
if (0 < bytes) {
#if DK4_ON_WINDOWS
/* +++ Windows */
@@ -264,6 +304,11 @@ dk4mem_malloc(size_t elsize, size_t nelem, dk4_er_t *erp)
{
void *back = NULL;
size_t bytes;
+#if DK4_USE_ASSERT
+ assert(0 < elsize);
+ assert(0 < nelem);
+ assert((SIZE_MAX / elsize) >= nelem);
+#endif
if ((0 < elsize) && (0 < nelem)) {
if ((SIZE_MAX / elsize) >= nelem) {
bytes = elsize * nelem;
@@ -283,7 +328,11 @@ void *
dk4mem_calloc(size_t elsize, size_t nelem, dk4_er_t *erp)
{
void *back = NULL;
-
+#if DK4_USE_ASSERT
+ assert(0 < elsize);
+ assert(0 < nelem);
+ assert((SIZE_MAX / elsize) >= nelem);
+#endif
if ((0 < elsize) && (0 < nelem)) {
if ((SIZE_MAX / elsize) >= nelem) {
#if DK4_ON_WINDOWS
@@ -352,6 +401,9 @@ dk4mem_calloc(size_t elsize, size_t nelem, dk4_er_t *erp)
void
dk4mem_free(void *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4mem.ctr b/support/dktools/dk4mem.ctr
index 97d26f5b7b..629d7b52e5 100644
--- a/support/dktools/dk4mem.ctr
+++ b/support/dktools/dk4mem.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
-/** @file
+/** @file dk4mem.h Memory operations.
+
Memory allocation and deallocation;
copy, reset and compare memory regions.
@@ -21,15 +22,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STRING_H
@@ -50,9 +63,14 @@ license = bsd
extern "C" {
#endif
+#if ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMCPY)) && (!(DK4_HAVE_BCOPY)))
+
/** Fallback function to use if no suitable memory copy function is found.
This function does not do any error checking.
The caller is responsible to provide valid arguments.
+ If dst and src overlap, src must be right from dst.
+
+ CRT on Windows: Not used.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -60,19 +78,34 @@ extern "C" {
void
dk4mem_fallback_cpy(void *dst, const void *src, size_t sz);
+#endif
+
+
+
+#if ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMSET)) && (!(DK4_HAVE_BZERO)))
+
/** Fallback function to use if no suitable memory reseet function is found.
This function does not do any error checking.
The caller is responsible to provide valid arguments.
+
+ CRT on Windows: Not used.
@param bptr Address of buffer to reset.
@param sz Number of bytes to reset.
*/
void
dk4mem_fallback_reset(void *bptr, size_t sz);
+#endif
+
+#if (DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)) \
+|| ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMCMP)) && (!(DK4_HAVE_BCMP)))
+
/** Fallback function to use if no suitable memory comparison function
is found.
This function does not do any error checking.
The caller is responsible to provide valid arguments.
+
+ CRT on Windows: Not used.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Buffer size (number of bytes).
@@ -81,8 +114,13 @@ dk4mem_fallback_reset(void *bptr, size_t sz);
int
dk4mem_fallback_cmp(const void *s1, const void *s2, size_t sz);
+#endif
+
/** Reset memory range.
-
+ Do not use dk4mem_reset() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
CRT on Windows: Optional.
@param bptr Pointer to start of buffer.
@param sz Buffer size (number of bytes).
@@ -97,7 +135,11 @@ dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp);
/** Set memory range to specified value.
- CRT on Windows: Optional.
+ This function uses self-made fallback code if memset() is not
+ available or use of the CRT is disabled on Windows.
+ To reset memory, the recommended function is dk4mem_reset().
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param bptr Pointer to start of buffer.
@param sz Buffer size (number of bytes).
@param uc Byte value to write.
@@ -110,8 +152,8 @@ dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp);
void
dk4mem_set(void *bptr, size_t sz, unsigned char uc, dk4_er_t *erp);
-/** Copy memory range.
-
+/** Copy memory range, source and destination must not overlap.
+
CRT on Windows: Optional.
@param dst Destination address.
@param src Source address.
@@ -126,7 +168,7 @@ void
dk4mem_cpy(void *dst, void const *src, size_t sz, dk4_er_t *erp);
/** Compare two memory ranges.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Left memory range.
@param s2 Right memory range.
@@ -144,7 +186,7 @@ dk4mem_cmp(const void *s1, const void *s2, size_t sz, dk4_er_t *erp);
#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
/** Dynamically allocate memory. The memory range is not initialized.
-
+
CRT on Windows: Optional.
@param bytes Number of bytes to allocate.
@param erp Error report, may be NULL.
@@ -163,7 +205,7 @@ void *
dk4mem_malloc_bytes(size_t bytes, dk4_er_t *erp);
/** Dynamically allocate memory. The memory range is not initialized.
-
+
CRT on Windows: Optional.
@param elsize Size of each element.
@param nelem Number of elements.
@@ -184,7 +226,7 @@ void *
dk4mem_malloc(size_t elsize, size_t nelem, dk4_er_t *erp);
/** Dynamically allocate memory and initialize memory range.
-
+
CRT on Windows: Optional.
@param elsize Size of each element.
@param nelem Number of elements.
@@ -207,6 +249,7 @@ dk4mem_calloc(size_t elsize, size_t nelem, dk4_er_t *erp);
/** Release memory allocated by dk4mem_malloc() or dk4mem_calloc().
The function checks whether the pointer is NULL and frees
the memory only for non-NULL pointers.
+
CRT on Windows: Optional.
@param ptr Pointer to start address of memory to release.
*/
@@ -214,7 +257,6 @@ void
dk4mem_free(void *ptr);
#endif
-/* if defined(_WIN32) ... */
#ifdef __cplusplus
}
@@ -222,6 +264,8 @@ dk4mem_free(void *ptr);
/** Allocate and initialize memory.
+
+ CRT on Windows: Optional.
@param tp Type to allocate.
@param ne Number of elements to allocate.
@param er Error report, may be NULL.
@@ -241,6 +285,8 @@ dk4mem_free(void *ptr);
/** Free memory previously allocated.
+
+ CRT on Windows: Optional.
@param ptr Start address of memory range to free.
*/
#define dk4mem_release(ptr) \
@@ -248,6 +294,8 @@ do { if (NULL != ptr) { dk4mem_free(ptr); } ptr = NULL; } while (0)
/** Find number of elements in array.
+
+ CRT on Windows: Not used.
@param v Variable.
@param t Type.
@return The size of the variable divided by the size of the type.
@@ -257,6 +305,8 @@ do { if (NULL != ptr) { dk4mem_free(ptr); } ptr = NULL; } while (0)
/** Increase byte number to alignment size.
+
+ CRT on Windows: Not used.
@param sz Original byte number.
@param al Alignment size, typically 16.
@return Size corrected for alignment.
@@ -264,14 +314,21 @@ do { if (NULL != ptr) { dk4mem_free(ptr); } ptr = NULL; } while (0)
#define DK4_MEM_ALIGN(sz,al) ((0 == (sz % al)) ? (sz) : (al * (1 + (sz/al))))
-#if DK4_HAVE_INLINE
+
+
+
+
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
/* +++ DK4_HAVE_INLINE */
#if DK4_ON_WINDOWS
/* +++ DK4_HAVE_INLINE, Windows */
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
/* +++ DK4_HAVE_INLINE, Windows, ! crt */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -283,8 +340,14 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
CopyMemory(dst, src, sz);
}
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -295,9 +358,12 @@ DK4_MEMRES(void *dst, size_t sz)
{
ZeroMemory(dst, sz);
}
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT probably degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -310,11 +376,15 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return ( dk4mem_fallback_cmp(s1, s2, sz) );
}
+
/* --- DK4_HAVE_INLINE, Windows, ! crt */
#else
/* +++ DK4_HAVE_INLINE, Windows, crt */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -326,8 +396,14 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
memcpy(dst, src, sz);
}
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -338,9 +414,12 @@ DK4_MEMRES(void *dst, size_t sz)
{
memset(dst, 0, sz);
}
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -353,6 +432,7 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return (memcmp(s1, s2, sz));
}
+
/* --- DK4_HAVE_INLINE, Windows, crt */
#endif
/* --- DK4_HAVE_INLINE, Windows */
@@ -360,8 +440,14 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
/* +++ DK4_HAVE_INLINE, ! Windows */
#if DK4_HAVE_MEMSET
/* +++ DK4_HAVE_INLINE, ! Windows, memset */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -372,13 +458,20 @@ DK4_MEMRES(void *dst, size_t sz)
{
memset(dst, 0, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, memset */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memset */
#if DK4_HAVE_BZERO
/* +++ DK4_HAVE_INLINE, ! Windows, ! memset, bzero */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -389,11 +482,18 @@ DK4_MEMRES(void *dst, size_t sz)
{
bzero(dst, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memset, bzero */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memset, ! bzero */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -404,14 +504,18 @@ DK4_MEMRES(void *dst, size_t sz)
{
dk4mem_fallback_reset(dst, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memset, ! bzero */
#endif
/* --- DK4_HAVE_INLINE, ! Windows, ! memset */
#endif
#if DK4_HAVE_MEMCPY
/* +++ DK4_HAVE_INLINE, ! Windows, memcpy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -423,13 +527,17 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
memcpy(dst, src, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, memcpy */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcpy */
#if DK4_HAVE_BCOPY
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcpy, bcopy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -441,11 +549,15 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
bcopy(src, dst, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memcpy, bcopy */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcpy, ! bcopy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -457,15 +569,19 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
dk4mem_fallback_cpy(dst, src, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memcpy, ! bcopy */
#endif
/* --- DK4_HAVE_INLINE, ! Windows, ! memcpy */
#endif
#if DK4_HAVE_MEMCMP
/* +++ DK4_HAVE_INLINE, ! Windows, memcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -478,14 +594,18 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return (memcmp(s1, s2, sz));
}
+
/* --- DK4_HAVE_INLINE, ! Windows, memcmp */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcmp */
#if DK4_HAVE_BCMP
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcmp, bcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -498,12 +618,16 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return (bcmp(s1, s2, sz));
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memcmp, bcmp */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcmp, ! bcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -516,6 +640,7 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return ( dk4mem_fallback_cmp(s1, s2, sz) );
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memcmp, ! bcmp */
#endif
/* --- DK4_HAVE_INLINE, ! Windows, ! memcmp */
@@ -529,53 +654,79 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
/* +++ ! DK4_HAVE_INLINE, Windows */
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
/* +++ ! DK4_HAVE_INLINE, Windows, ! crt */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) CopyMemory(dst, src, sz)
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) ZeroMemory(dst, sz)
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) dk4mem_fallback_cmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, Windows, ! crt */
#else
/* +++ ! DK4_HAVE_INLINE, Windows, crt */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) memcpy(dst, src, sz)
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) memset(dst, 0, sz)
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) memcmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, Windows, crt */
#endif
/* --- ! DK4_HAVE_INLINE, Windows */
@@ -583,108 +734,153 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
/* +++ ! DK4_HAVE_INLINE, ! Windows */
#if DK4_HAVE_MEMSET
/* +++ ! DK4_HAVE_INLINE, ! Windows, memset */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) memset(dst, 0, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, memset */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memset */
#if DK4_HAVE_BZERO
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memset, bzero */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) bzero(dst, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memset, bzero */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memset, ! bzero */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) dk4mem_fallback_reset(dst, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memset, ! bzero */
#endif
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memset */
#endif
#if DK4_HAVE_MEMCPY
/* +++ ! DK4_HAVE_INLINE, ! Windows, memcpy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) memcpy(dst, src, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, memcpy */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcpy */
#if DK4_HAVE_BCOPY
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcpy, bcopy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) bcopy(src, dst, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcpy, bcopy */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcpy, ! bcopy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) dk4mem_fallback_cpy(dst, src, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcpy, ! bcopy */
#endif
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcpy */
#endif
#if DK4_HAVE_MEMCMP
/* +++ ! DK4_HAVE_INLINE, ! Windows, memcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) memcmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, memcmp */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcmp */
#if DK4_HAVE_BCMP
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcmp, bcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) bcmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcmp, bcmp */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcmp, ! bcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) dk4mem_fallback_cmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcmp, ! bcmp */
#endif
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcmp */
@@ -720,6 +916,12 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
#define STRINGS_H_INCLUDED 1
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4mem.h"
#include "dk4numco.h"
@@ -729,6 +931,7 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
$!trace-include
+#if ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMSET)) && (!(DK4_HAVE_BZERO)))
static
void
@@ -742,15 +945,25 @@ dk4mem_fallback_i_reset(unsigned char *bptr, size_t sz)
void
dk4mem_fallback_reset(void *bptr, size_t sz)
{
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
dk4mem_fallback_i_reset((unsigned char *)bptr, sz);
}
+#endif
+
void
dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp)
{
$? "+ dk4mem_reset"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
if ((NULL != bptr) && (0 < sz)) {
DK4_MEMRES(bptr, sz);
} else {
@@ -764,23 +977,38 @@ dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp)
void
dk4mem_set(void *bptr, size_t sz, unsigned char uc, dk4_er_t *erp)
{
-#if !DK4_HAVE_MEMSET
- unsigned char *ucptr;
+#if DK4_HAVE_MEMSET \
+&& (!(DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_AVOID_CRT)))
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < sz);
#endif
if ((NULL != bptr) && (0 < sz)) {
-#if DK4_HAVE_MEMSET
memset(bptr, (int)uc, sz);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
#else
+ unsigned char *ucptr;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
+ if ((NULL != bptr) && (0 < sz)) {
ucptr = (unsigned char *)bptr;
while (0 < sz--) { *(ucptr++) = uc; }
-#endif
- } else {
+ }
+ else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+#endif
}
+#if ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMCPY)) && (!(DK4_HAVE_BCOPY)))
+
static
void
dk4mem_fallback_i_cpy(unsigned char *dst, const unsigned char *src, size_t sz)
@@ -793,6 +1021,11 @@ dk4mem_fallback_i_cpy(unsigned char *dst, const unsigned char *src, size_t sz)
void
dk4mem_fallback_cpy(void *dst, const void *src, size_t sz)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+ assert(0 < sz);
+#endif
dk4mem_fallback_i_cpy(
(unsigned char *)dst,
(const unsigned char *)src,
@@ -801,10 +1034,17 @@ dk4mem_fallback_cpy(void *dst, const void *src, size_t sz)
}
+#endif
+
void
dk4mem_cpy(void *dst, void const *src, size_t sz, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (NULL != src) && (0 < sz)) {
DK4_MEMCPY(dst, src, sz);
} else {
@@ -813,6 +1053,10 @@ dk4mem_cpy(void *dst, void const *src, size_t sz, dk4_er_t *erp)
}
+
+#if (DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)) \
+|| ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMCMP)) && (!(DK4_HAVE_BCMP)))
+
static
int
dk4mem_fallback_i_cmp(
@@ -840,6 +1084,11 @@ dk4mem_fallback_i_cmp(
int
dk4mem_fallback_cmp(const void *s1, const void *s2, size_t sz)
{
+#if DK4_USE_ASSERT
+ assert(NULL != s1);
+ assert(NULL != s2);
+ assert(0 < sz);
+#endif
return(
dk4mem_fallback_i_cmp(
(const unsigned char *)s1,
@@ -849,12 +1098,18 @@ dk4mem_fallback_cmp(const void *s1, const void *s2, size_t sz)
);
}
+#endif
int
dk4mem_cmp(const void *s1, const void *s2, size_t sz, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != s1);
+ assert(NULL != s2);
+ assert(0 < sz);
+#endif
if ((NULL != s1) && (NULL != s2) && (0 < sz)) {
back = DK4_MEMCMP(s1, s2, sz);
} else {
@@ -872,6 +1127,9 @@ void *
dk4mem_malloc_bytes(size_t bytes, dk4_er_t *erp)
{
void *back = NULL; /* Function result. */
+#if DK4_USE_ASSERT
+ assert(0 < bytes);
+#endif
if (0 < bytes) {
#if DK4_ON_WINDOWS
/* +++ Windows */
@@ -916,6 +1174,11 @@ dk4mem_malloc(size_t elsize, size_t nelem, dk4_er_t *erp)
{
void *back = NULL;
size_t bytes;
+#if DK4_USE_ASSERT
+ assert(0 < elsize);
+ assert(0 < nelem);
+ assert((SIZE_MAX / elsize) >= nelem);
+#endif
if ((0 < elsize) && (0 < nelem)) {
if ((SIZE_MAX / elsize) >= nelem) {
bytes = elsize * nelem;
@@ -935,7 +1198,11 @@ void *
dk4mem_calloc(size_t elsize, size_t nelem, dk4_er_t *erp)
{
void *back = NULL;
-
+#if DK4_USE_ASSERT
+ assert(0 < elsize);
+ assert(0 < nelem);
+ assert((SIZE_MAX / elsize) >= nelem);
+#endif
if ((0 < elsize) && (0 < nelem)) {
if ((SIZE_MAX / elsize) >= nelem) {
#if DK4_ON_WINDOWS
@@ -1004,6 +1271,9 @@ dk4mem_calloc(size_t elsize, size_t nelem, dk4_er_t *erp)
void
dk4mem_free(void *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
#if DK4_ON_WINDOWS
/* +++ Windows */
diff --git a/support/dktools/dk4mem.h b/support/dktools/dk4mem.h
index e86408e357..6a8adf2f20 100644
--- a/support/dktools/dk4mem.h
+++ b/support/dktools/dk4mem.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mem.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mem.ctr
*/
#ifndef DK4MEM_H_INCLUDED
@@ -40,7 +18,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4mem.ctr"
-/** @file
+/** @file dk4mem.h Memory operations.
+
Memory allocation and deallocation;
copy, reset and compare memory regions.
@@ -54,15 +33,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STRING_H
@@ -83,9 +74,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
extern "C" {
#endif
+#if ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMCPY)) && (!(DK4_HAVE_BCOPY)))
+
/** Fallback function to use if no suitable memory copy function is found.
This function does not do any error checking.
The caller is responsible to provide valid arguments.
+ If dst and src overlap, src must be right from dst.
+
+ CRT on Windows: Not used.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -93,19 +89,34 @@ extern "C" {
void
dk4mem_fallback_cpy(void *dst, const void *src, size_t sz);
+#endif
+
+
+
+#if ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMSET)) && (!(DK4_HAVE_BZERO)))
+
/** Fallback function to use if no suitable memory reseet function is found.
This function does not do any error checking.
The caller is responsible to provide valid arguments.
+
+ CRT on Windows: Not used.
@param bptr Address of buffer to reset.
@param sz Number of bytes to reset.
*/
void
dk4mem_fallback_reset(void *bptr, size_t sz);
+#endif
+
+#if (DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)) \
+|| ((!(DK4_ON_WINDOWS)) && (!(DK4_HAVE_MEMCMP)) && (!(DK4_HAVE_BCMP)))
+
/** Fallback function to use if no suitable memory comparison function
is found.
This function does not do any error checking.
The caller is responsible to provide valid arguments.
+
+ CRT on Windows: Not used.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Buffer size (number of bytes).
@@ -114,8 +125,13 @@ dk4mem_fallback_reset(void *bptr, size_t sz);
int
dk4mem_fallback_cmp(const void *s1, const void *s2, size_t sz);
+#endif
+
/** Reset memory range.
-
+ Do not use dk4mem_reset() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
CRT on Windows: Optional.
@param bptr Pointer to start of buffer.
@param sz Buffer size (number of bytes).
@@ -130,7 +146,11 @@ dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp);
/** Set memory range to specified value.
- CRT on Windows: Optional.
+ This function uses self-made fallback code if memset() is not
+ available or use of the CRT is disabled on Windows.
+ To reset memory, the recommended function is dk4mem_reset().
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param bptr Pointer to start of buffer.
@param sz Buffer size (number of bytes).
@param uc Byte value to write.
@@ -143,8 +163,8 @@ dk4mem_reset(void *bptr, size_t sz, dk4_er_t *erp);
void
dk4mem_set(void *bptr, size_t sz, unsigned char uc, dk4_er_t *erp);
-/** Copy memory range.
-
+/** Copy memory range, source and destination must not overlap.
+
CRT on Windows: Optional.
@param dst Destination address.
@param src Source address.
@@ -159,7 +179,7 @@ void
dk4mem_cpy(void *dst, void const *src, size_t sz, dk4_er_t *erp);
/** Compare two memory ranges.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Left memory range.
@param s2 Right memory range.
@@ -177,7 +197,7 @@ dk4mem_cmp(const void *s1, const void *s2, size_t sz, dk4_er_t *erp);
#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
/** Dynamically allocate memory. The memory range is not initialized.
-
+
CRT on Windows: Optional.
@param bytes Number of bytes to allocate.
@param erp Error report, may be NULL.
@@ -196,7 +216,7 @@ void *
dk4mem_malloc_bytes(size_t bytes, dk4_er_t *erp);
/** Dynamically allocate memory. The memory range is not initialized.
-
+
CRT on Windows: Optional.
@param elsize Size of each element.
@param nelem Number of elements.
@@ -217,7 +237,7 @@ void *
dk4mem_malloc(size_t elsize, size_t nelem, dk4_er_t *erp);
/** Dynamically allocate memory and initialize memory range.
-
+
CRT on Windows: Optional.
@param elsize Size of each element.
@param nelem Number of elements.
@@ -240,6 +260,7 @@ dk4mem_calloc(size_t elsize, size_t nelem, dk4_er_t *erp);
/** Release memory allocated by dk4mem_malloc() or dk4mem_calloc().
The function checks whether the pointer is NULL and frees
the memory only for non-NULL pointers.
+
CRT on Windows: Optional.
@param ptr Pointer to start address of memory to release.
*/
@@ -247,7 +268,6 @@ void
dk4mem_free(void *ptr);
#endif
-/* if defined(_WIN32) ... */
#ifdef __cplusplus
}
@@ -255,6 +275,8 @@ dk4mem_free(void *ptr);
/** Allocate and initialize memory.
+
+ CRT on Windows: Optional.
@param tp Type to allocate.
@param ne Number of elements to allocate.
@param er Error report, may be NULL.
@@ -274,6 +296,8 @@ dk4mem_free(void *ptr);
/** Free memory previously allocated.
+
+ CRT on Windows: Optional.
@param ptr Start address of memory range to free.
*/
#define dk4mem_release(ptr) \
@@ -281,6 +305,8 @@ do { if (NULL != ptr) { dk4mem_free(ptr); } ptr = NULL; } while (0)
/** Find number of elements in array.
+
+ CRT on Windows: Not used.
@param v Variable.
@param t Type.
@return The size of the variable divided by the size of the type.
@@ -290,6 +316,8 @@ do { if (NULL != ptr) { dk4mem_free(ptr); } ptr = NULL; } while (0)
/** Increase byte number to alignment size.
+
+ CRT on Windows: Not used.
@param sz Original byte number.
@param al Alignment size, typically 16.
@return Size corrected for alignment.
@@ -297,14 +325,21 @@ do { if (NULL != ptr) { dk4mem_free(ptr); } ptr = NULL; } while (0)
#define DK4_MEM_ALIGN(sz,al) ((0 == (sz % al)) ? (sz) : (al * (1 + (sz/al))))
-#if DK4_HAVE_INLINE
+
+
+
+
+#if DK4_HAVE_INLINE && DK4_USE_INLINE
/* +++ DK4_HAVE_INLINE */
#if DK4_ON_WINDOWS
/* +++ DK4_HAVE_INLINE, Windows */
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
/* +++ DK4_HAVE_INLINE, Windows, ! crt */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -316,8 +351,14 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
CopyMemory(dst, src, sz);
}
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -328,9 +369,12 @@ DK4_MEMRES(void *dst, size_t sz)
{
ZeroMemory(dst, sz);
}
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT probably degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -343,11 +387,15 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return ( dk4mem_fallback_cmp(s1, s2, sz) );
}
+
/* --- DK4_HAVE_INLINE, Windows, ! crt */
#else
/* +++ DK4_HAVE_INLINE, Windows, crt */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -359,8 +407,14 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
memcpy(dst, src, sz);
}
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -371,9 +425,12 @@ DK4_MEMRES(void *dst, size_t sz)
{
memset(dst, 0, sz);
}
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -386,6 +443,7 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return (memcmp(s1, s2, sz));
}
+
/* --- DK4_HAVE_INLINE, Windows, crt */
#endif
/* --- DK4_HAVE_INLINE, Windows */
@@ -393,8 +451,14 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
/* +++ DK4_HAVE_INLINE, ! Windows */
#if DK4_HAVE_MEMSET
/* +++ DK4_HAVE_INLINE, ! Windows, memset */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -405,13 +469,20 @@ DK4_MEMRES(void *dst, size_t sz)
{
memset(dst, 0, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, memset */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memset */
#if DK4_HAVE_BZERO
/* +++ DK4_HAVE_INLINE, ! Windows, ! memset, bzero */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -422,11 +493,18 @@ DK4_MEMRES(void *dst, size_t sz)
{
bzero(dst, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memset, bzero */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memset, ! bzero */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
@@ -437,14 +515,18 @@ DK4_MEMRES(void *dst, size_t sz)
{
dk4mem_fallback_reset(dst, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memset, ! bzero */
#endif
/* --- DK4_HAVE_INLINE, ! Windows, ! memset */
#endif
#if DK4_HAVE_MEMCPY
/* +++ DK4_HAVE_INLINE, ! Windows, memcpy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -456,13 +538,17 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
memcpy(dst, src, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, memcpy */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcpy */
#if DK4_HAVE_BCOPY
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcpy, bcopy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -474,11 +560,15 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
bcopy(src, dst, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memcpy, bcopy */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcpy, ! bcopy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -490,15 +580,19 @@ DK4_MEMCPY(void *dst, const void *src, size_t sz)
{
dk4mem_fallback_cpy(dst, src, sz);
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memcpy, ! bcopy */
#endif
/* --- DK4_HAVE_INLINE, ! Windows, ! memcpy */
#endif
#if DK4_HAVE_MEMCMP
/* +++ DK4_HAVE_INLINE, ! Windows, memcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -511,14 +605,18 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return (memcmp(s1, s2, sz));
}
+
/* --- DK4_HAVE_INLINE, ! Windows, memcmp */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcmp */
#if DK4_HAVE_BCMP
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcmp, bcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -531,12 +629,16 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return (bcmp(s1, s2, sz));
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memcmp, bcmp */
#else
/* +++ DK4_HAVE_INLINE, ! Windows, ! memcmp, ! bcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@@ -549,6 +651,7 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
{
return ( dk4mem_fallback_cmp(s1, s2, sz) );
}
+
/* --- DK4_HAVE_INLINE, ! Windows, ! memcmp, ! bcmp */
#endif
/* --- DK4_HAVE_INLINE, ! Windows, ! memcmp */
@@ -562,53 +665,79 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
/* +++ ! DK4_HAVE_INLINE, Windows */
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
/* +++ ! DK4_HAVE_INLINE, Windows, ! crt */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) CopyMemory(dst, src, sz)
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) ZeroMemory(dst, sz)
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) dk4mem_fallback_cmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, Windows, ! crt */
#else
/* +++ ! DK4_HAVE_INLINE, Windows, crt */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) memcpy(dst, src, sz)
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) memset(dst, 0, sz)
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) memcmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, Windows, crt */
#endif
/* --- ! DK4_HAVE_INLINE, Windows */
@@ -616,108 +745,153 @@ DK4_MEMCMP(const void *s1, const void *s2, size_t sz)
/* +++ ! DK4_HAVE_INLINE, ! Windows */
#if DK4_HAVE_MEMSET
/* +++ ! DK4_HAVE_INLINE, ! Windows, memset */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) memset(dst, 0, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, memset */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memset */
#if DK4_HAVE_BZERO
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memset, bzero */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) bzero(dst, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memset, bzero */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memset, ! bzero */
+
/** Pure memory reset. All arguments must be checked by the caller
before calling this function.
+ Do not use DK4_MEMRES() to sanitize memory (overwrite sensitive
+ data before memory is freed or the program exits),
+ use dk4mem_reset_secure() from dk4memrs.h instead.
+
+ CRT on Windows: Optional.
@param dst Start address of buffer to reset.
@param sz Number of bytes to reset.
*/
#define DK4_MEMRES(dst,sz) dk4mem_fallback_reset(dst, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memset, ! bzero */
#endif
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memset */
#endif
#if DK4_HAVE_MEMCPY
/* +++ ! DK4_HAVE_INLINE, ! Windows, memcpy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) memcpy(dst, src, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, memcpy */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcpy */
#if DK4_HAVE_BCOPY
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcpy, bcopy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) bcopy(src, dst, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcpy, bcopy */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcpy, ! bcopy */
+
/** Pure memory copy operation. All arguments must be checked
by the caller before calling this function.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
*/
#define DK4_MEMCPY(dst,src,sz) dk4mem_fallback_cpy(dst, src, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcpy, ! bcopy */
#endif
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcpy */
#endif
#if DK4_HAVE_MEMCMP
/* +++ ! DK4_HAVE_INLINE, ! Windows, memcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) memcmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, memcmp */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcmp */
#if DK4_HAVE_BCMP
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcmp, bcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) bcmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcmp, bcmp */
#else
/* +++ ! DK4_HAVE_INLINE, ! Windows, ! memcmp, ! bcmp */
+
/** Pure memory comparison.
All arguments must be checked by the caller before calling this
function.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s1 Address of left buffer in comparison.
@param s2 Address of right buffer in comparison.
@param sz Number of bytes to compare.
@return 1 if s1>s2, 0 for equal buffers, -1 if s1<s2.
*/
#define DK4_MEMCMP(s1,s2,sz) dk4mem_fallback_cmp(s1, s2, sz)
+
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcmp, ! bcmp */
#endif
/* --- ! DK4_HAVE_INLINE, ! Windows, ! memcmp */
diff --git a/support/dktools/dk4mema.c b/support/dktools/dk4mema.c
index 8b9287d373..98093de1d4 100644
--- a/support/dktools/dk4mema.c
+++ b/support/dktools/dk4mema.c
@@ -1,49 +1,35 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mema.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mema.ctr
*/
/** @file dk4mema.c The dk4mema module.
*/
-#line 60 "dk4mema.ctr"
+#line 72 "dk4mema.ctr"
+#include "dk4conf.h"
#include "dk4mema.h"
#include "dk4mem.h"
#include "dk4maodd.h"
#include "dk4const.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
void *
dk4mem_calloc_app(size_t elsize, size_t nelem, dk4_app_t *app)
@@ -54,6 +40,10 @@ dk4mem_calloc_app(size_t elsize, size_t nelem, dk4_app_t *app)
dk4_er_t er;
int res;
+#if DK4_USE_ASSERT
+ assert(0 < elsize);
+ assert(0 < nelem);
+#endif
dk4error_init(&er);
back = dk4mem_calloc(elsize, nelem, &er);
if (NULL == back) {
diff --git a/support/dktools/dk4mema.ctr b/support/dktools/dk4mema.ctr
index dad2c6eaf5..73bd569bd1 100644
--- a/support/dktools/dk4mema.ctr
+++ b/support/dktools/dk4mema.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
@@ -58,11 +70,19 @@ dk4mem_calloc_app(size_t elsize, size_t nelem, dk4_app_t *app);
%% module
+#include "dk4conf.h"
#include "dk4mema.h"
#include "dk4mem.h"
#include "dk4maodd.h"
#include "dk4const.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
void *
dk4mem_calloc_app(size_t elsize, size_t nelem, dk4_app_t *app)
@@ -73,6 +93,10 @@ dk4mem_calloc_app(size_t elsize, size_t nelem, dk4_app_t *app)
dk4_er_t er;
int res;
+#if DK4_USE_ASSERT
+ assert(0 < elsize);
+ assert(0 < nelem);
+#endif
dk4error_init(&er);
back = dk4mem_calloc(elsize, nelem, &er);
if (NULL == back) {
diff --git a/support/dktools/dk4mema.h b/support/dktools/dk4mema.h
index 57140cff40..3744b64fa9 100644
--- a/support/dktools/dk4mema.h
+++ b/support/dktools/dk4mema.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mema.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mema.ctr
*/
#ifndef DK4MEMA_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
diff --git a/support/dktools/dk4membf.c b/support/dktools/dk4membf.c
index 999fcacef0..2f45e782cc 100644
--- a/support/dktools/dk4membf.c
+++ b/support/dktools/dk4membf.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4membf.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4membf.ctr
*/
/** @file dk4membf.c The dk4membf module.
*/
-#line 41 "dk4membf.ctr"
+#line 61 "dk4membf.ctr"
+#include "dk4conf.h"
#include "dk4membf.h"
#if DK4_HAVE_ERRNO_H
@@ -48,15 +27,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
-dk4membuf_to_file(FILE *fipo, dk4_membuf_t *mbptr, dk4_er_t *erp)
+dk4membuf_to_file(FILE *fipo, dk4_membuf_t const *mbptr, dk4_er_t *erp)
{
dk4_membuf_cell_t *pc = NULL;
dk4_membuf_cell_t *pn = NULL;
size_t wrb = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != mbptr);
+#endif
if ((NULL != fipo) && (NULL != mbptr)) {
back = 1;
pc = mbptr->first;
diff --git a/support/dktools/dk4membf.ctr b/support/dktools/dk4membf.ctr
index a00d284ea8..9221489599 100644
--- a/support/dktools/dk4membf.ctr
+++ b/support/dktools/dk4membf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,12 +11,26 @@ license = bsd
/** @file dk4membf.h Save buffer data to file.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef STDIO_H_INCLUDED
#include <stdio.h>
#define STDIO_H_INCLUDED 1
#endif
+#ifndef DK4MEMBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
#ifdef __cplusplus
extern "C" {
@@ -27,9 +41,15 @@ extern "C" {
@param mbptr Buffer containing data to write.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fipo or mbptr is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if a write attempt to file failed.
*/
int
-dk4membuf_to_file(FILE *fipo, dk4_membuf_t *mbptr, dk4_er_t *erp);
+dk4membuf_to_file(FILE *fipo, dk4_membuf_t const *mbptr, dk4_er_t *erp);
#ifdef __cplusplus
}
@@ -39,6 +59,7 @@ dk4membuf_to_file(FILE *fipo, dk4_membuf_t *mbptr, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4membf.h"
#if DK4_HAVE_ERRNO_H
@@ -48,15 +69,26 @@ dk4membuf_to_file(FILE *fipo, dk4_membuf_t *mbptr, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
-dk4membuf_to_file(FILE *fipo, dk4_membuf_t *mbptr, dk4_er_t *erp)
+dk4membuf_to_file(FILE *fipo, dk4_membuf_t const *mbptr, dk4_er_t *erp)
{
dk4_membuf_cell_t *pc = NULL;
dk4_membuf_cell_t *pn = NULL;
size_t wrb = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != mbptr);
+#endif
if ((NULL != fipo) && (NULL != mbptr)) {
back = 1;
pc = mbptr->first;
diff --git a/support/dktools/dk4membf.h b/support/dktools/dk4membf.h
index 43ccac56c3..690418f109 100644
--- a/support/dktools/dk4membf.h
+++ b/support/dktools/dk4membf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4membf.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4membf.ctr
*/
#ifndef DK4MEMBF_H_INCLUDED
@@ -43,12 +21,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4membf.h Save buffer data to file.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef STDIO_H_INCLUDED
#include <stdio.h>
#define STDIO_H_INCLUDED 1
#endif
+#ifndef DK4MEMBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
#ifdef __cplusplus
extern "C" {
@@ -59,9 +51,15 @@ extern "C" {
@param mbptr Buffer containing data to write.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fipo or mbptr is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if a write attempt to file failed.
*/
int
-dk4membuf_to_file(FILE *fipo, dk4_membuf_t *mbptr, dk4_er_t *erp);
+dk4membuf_to_file(FILE *fipo, dk4_membuf_t const *mbptr, dk4_er_t *erp);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4membs.c b/support/dktools/dk4membs.c
index 70ff054236..18c9fa1a3f 100644
--- a/support/dktools/dk4membs.c
+++ b/support/dktools/dk4membs.c
@@ -1,55 +1,48 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4membs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4membs.ctr
*/
/** @file dk4membs.c The dk4membs module.
*/
-#line 37 "dk4membs.ctr"
+#line 71 "dk4membs.ctr"
+#include "dk4conf.h"
#include "dk4membs.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
-dk4membuf_to_stream(dk4_stream_t *strm, dk4_membuf_t *mbptr, dk4_er_t *erp)
+dk4membuf_to_stream(
+ dk4_stream_t *strm,
+ dk4_membuf_t const *mbptr,
+ dk4_er_t *erp
+)
{
dk4_membuf_cell_t *pc = NULL;
dk4_membuf_cell_t *pn = NULL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != mbptr);
+#endif
if ((NULL != strm) && (NULL != mbptr)) {
back = 1;
pc = mbptr->first;
diff --git a/support/dktools/dk4membs.ctr b/support/dktools/dk4membs.ctr
index 3931b00a8e..3d48d629d3 100644
--- a/support/dktools/dk4membs.ctr
+++ b/support/dktools/dk4membs.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,8 +11,30 @@ license = bsd
/** @file dk4membs.h Save buffer data to stream.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4MEMBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -23,9 +45,21 @@ extern "C" {
@param mbptr Buffer containing data to write.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm or mbptr is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flusing data downwards failed.
*/
int
-dk4membuf_to_stream(dk4_stream_t *strm, dk4_membuf_t *mbptr, dk4_er_t *erp);
+dk4membuf_to_stream(
+ dk4_stream_t *strm,
+ dk4_membuf_t const *mbptr,
+ dk4_er_t *erp
+);
#ifdef __cplusplus
}
@@ -35,17 +69,32 @@ dk4membuf_to_stream(dk4_stream_t *strm, dk4_membuf_t *mbptr, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4membs.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
-dk4membuf_to_stream(dk4_stream_t *strm, dk4_membuf_t *mbptr, dk4_er_t *erp)
+dk4membuf_to_stream(
+ dk4_stream_t *strm,
+ dk4_membuf_t const *mbptr,
+ dk4_er_t *erp
+)
{
dk4_membuf_cell_t *pc = NULL;
dk4_membuf_cell_t *pn = NULL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != mbptr);
+#endif
if ((NULL != strm) && (NULL != mbptr)) {
back = 1;
pc = mbptr->first;
diff --git a/support/dktools/dk4membs.h b/support/dktools/dk4membs.h
index e35e9a6b71..242560738d 100644
--- a/support/dktools/dk4membs.h
+++ b/support/dktools/dk4membs.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4membs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4membs.ctr
*/
#ifndef DK4MEMBS_H_INCLUDED
@@ -43,8 +21,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4membs.h Save buffer data to stream.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4MEMBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -55,9 +55,21 @@ extern "C" {
@param mbptr Buffer containing data to write.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm or mbptr is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flusing data downwards failed.
*/
int
-dk4membuf_to_stream(dk4_stream_t *strm, dk4_membuf_t *mbptr, dk4_er_t *erp);
+dk4membuf_to_stream(
+ dk4_stream_t *strm,
+ dk4_membuf_t const *mbptr,
+ dk4_er_t *erp
+);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4membuf.c b/support/dktools/dk4membuf.c
index fe6931d6a5..d30b7c08b6 100644
--- a/support/dktools/dk4membuf.c
+++ b/support/dktools/dk4membuf.c
@@ -1,53 +1,38 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4membuf.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4membuf.ctr
*/
/** @file dk4membuf.c The dk4membuf module.
*/
-#line 95 "dk4membuf.ctr"
+#line 113 "dk4membuf.ctr"
+#include "dk4conf.h"
#include "dk4membuf.h"
#include "dk4mem.h"
#include "dk4maasz.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 103 "dk4membuf.ctr"
+#line 128 "dk4membuf.ctr"
@@ -55,6 +40,9 @@ static
void
dk4membuf_cell_close(dk4_membuf_cell_t *mcptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != mcptr);
+#endif
if (NULL != mcptr) {
dk4mem_release(mcptr->buf);
mcptr->next = NULL;
@@ -125,7 +113,9 @@ dk4membuf_close(dk4_membuf_t *mbptr)
{
dk4_membuf_cell_t *pc;
dk4_membuf_cell_t *pn;
-
+#if DK4_USE_ASSERT
+ assert(NULL != mbptr);
+#endif
if (NULL != mbptr) {
pc = mbptr->first;
while (NULL != pc) {
@@ -147,7 +137,11 @@ dk4membuf_store(dk4_membuf_t *mbptr, const void *src, size_t sz, dk4_er_t *erp)
const char *psrc = NULL;
size_t bl = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+ assert(0 < sz);
+ assert(NULL != mbptr);
+#endif
if ((NULL != mbptr) && (NULL != src) && (0 < sz)) {
/* Initialize variables.
*/
@@ -188,18 +182,30 @@ dk4membuf_store(dk4_membuf_t *mbptr, const void *src, size_t sz, dk4_er_t *erp)
int
-dk4membuf_size(size_t *szptr, dk4_membuf_t *mbptr, dk4_er_t *erp)
+dk4membuf_size(size_t *szptr, dk4_membuf_t const *mbptr, dk4_er_t *erp)
{
dk4_er_t er;
dk4_membuf_cell_t *cp = NULL;
size_t result = (size_t)0U;
int back = 0;
+
+#line 284 "dk4membuf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != szptr);
+ assert(NULL != mbptr);
+#endif
if ((NULL != szptr) && (NULL != mbptr)) {
back = 1;
cp = mbptr->first;
dk4error_init(&er);
+
+
+#line 293 "dk4membuf.ctr"
while (NULL != cp) {
+
+
+#line 295 "dk4membuf.ctr"
result = dk4ma_size_t_add(result, cp->used, &er);
cp = cp->next;
}
@@ -207,9 +213,28 @@ dk4membuf_size(size_t *szptr, dk4_membuf_t *mbptr, dk4_er_t *erp)
back = 1;
*szptr = result;
}
+#if TRACE_DEBUG
+ else {
+
+#line 304 "dk4membuf.ctr"
+ }
+#endif
} else {
+#if TRACE_DEBUG
+ if (NULL == szptr) {
+
+#line 309 "dk4membuf.ctr"
+ }
+ if (NULL == mbptr) {
+
+#line 311 "dk4membuf.ctr"
+ }
+#endif
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 316 "dk4membuf.ctr"
return back;
}
diff --git a/support/dktools/dk4membuf.ctr b/support/dktools/dk4membuf.ctr
index ff8561edcf..f3b330ce1d 100644
--- a/support/dktools/dk4membuf.ctr
+++ b/support/dktools/dk4membuf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,8 +10,20 @@ license = bsd
/** @file dk4membuf.h Memory buffer.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** One cell of a memory buffer.
@@ -38,6 +50,13 @@ extern "C" {
/** Create new buffer, allocate initial memory.
@param erp Error report, may be NULL.
@return Pointer on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the product of elsize and nelem,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
*/
dk4_membuf_t *
dk4membuf_open(dk4_er_t *erp);
@@ -63,7 +82,6 @@ dk4membuf_close(dk4_membuf_t *mbptr);
- DK4_E_MEMORY_ALLOCATION_FAILED<br>
with mem.elsize and mem.nelem set
if there is not enough memory available.
-
*/
int
dk4membuf_store(dk4_membuf_t *mbptr, const void *src, size_t sz, dk4_er_t *erp);
@@ -81,7 +99,7 @@ dk4membuf_store(dk4_membuf_t *mbptr, const void *src, size_t sz, dk4_er_t *erp);
if a mathematical overflow occured in size calculation.
*/
int
-dk4membuf_size(size_t *szptr, dk4_membuf_t *mbptr, dk4_er_t *erp);
+dk4membuf_size(size_t *szptr, dk4_membuf_t const *mbptr, dk4_er_t *erp);
#ifdef __cplusplus
}
@@ -93,10 +111,17 @@ dk4membuf_size(size_t *szptr, dk4_membuf_t *mbptr, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4membuf.h"
#include "dk4mem.h"
#include "dk4maasz.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -107,6 +132,9 @@ static
void
dk4membuf_cell_close(dk4_membuf_cell_t *mcptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != mcptr);
+#endif
if (NULL != mcptr) {
dk4mem_release(mcptr->buf);
mcptr->next = NULL;
@@ -177,7 +205,9 @@ dk4membuf_close(dk4_membuf_t *mbptr)
{
dk4_membuf_cell_t *pc;
dk4_membuf_cell_t *pn;
-
+#if DK4_USE_ASSERT
+ assert(NULL != mbptr);
+#endif
if (NULL != mbptr) {
pc = mbptr->first;
while (NULL != pc) {
@@ -199,7 +229,11 @@ dk4membuf_store(dk4_membuf_t *mbptr, const void *src, size_t sz, dk4_er_t *erp)
const char *psrc = NULL;
size_t bl = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+ assert(0 < sz);
+ assert(NULL != mbptr);
+#endif
if ((NULL != mbptr) && (NULL != src) && (0 < sz)) {
/* Initialize variables.
*/
@@ -240,18 +274,24 @@ dk4membuf_store(dk4_membuf_t *mbptr, const void *src, size_t sz, dk4_er_t *erp)
int
-dk4membuf_size(size_t *szptr, dk4_membuf_t *mbptr, dk4_er_t *erp)
+dk4membuf_size(size_t *szptr, dk4_membuf_t const *mbptr, dk4_er_t *erp)
{
dk4_er_t er;
dk4_membuf_cell_t *cp = NULL;
size_t result = (size_t)0U;
int back = 0;
-
+ $? "+ dk4membuf_size"
+#if DK4_USE_ASSERT
+ assert(NULL != szptr);
+ assert(NULL != mbptr);
+#endif
if ((NULL != szptr) && (NULL != mbptr)) {
back = 1;
cp = mbptr->first;
dk4error_init(&er);
+ $? ". going to add cells"
while (NULL != cp) {
+ $? ". add cell %lu", (unsigned long)(cp->used)
result = dk4ma_size_t_add(result, cp->used, &er);
cp = cp->next;
}
@@ -259,9 +299,20 @@ dk4membuf_size(size_t *szptr, dk4_membuf_t *mbptr, dk4_er_t *erp)
back = 1;
*szptr = result;
}
+#if TRACE_DEBUG
+ else { $? "! numeric overflow"
+ }
+#endif
} else {
+#if TRACE_DEBUG
+ if (NULL == szptr) { $? "! missing size variable address"
+ }
+ if (NULL == mbptr) { $? "! missing memory buffer address"
+ }
+#endif
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4membuf_size %d (size=%lu)", back, (unsigned long)result
return back;
}
diff --git a/support/dktools/dk4membuf.h b/support/dktools/dk4membuf.h
index 3e603777ac..7fe1e8ba58 100644
--- a/support/dktools/dk4membuf.h
+++ b/support/dktools/dk4membuf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4membuf.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4membuf.ctr
*/
#ifndef DK4MEMBUF_H_INCLUDED
@@ -43,8 +21,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4membuf.h Memory buffer.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** One cell of a memory buffer.
@@ -71,6 +61,13 @@ extern "C" {
/** Create new buffer, allocate initial memory.
@param erp Error report, may be NULL.
@return Pointer on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the product of elsize and nelem,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
*/
dk4_membuf_t *
dk4membuf_open(dk4_er_t *erp);
@@ -96,7 +93,6 @@ dk4membuf_close(dk4_membuf_t *mbptr);
- DK4_E_MEMORY_ALLOCATION_FAILED<br>
with mem.elsize and mem.nelem set
if there is not enough memory available.
-
*/
int
dk4membuf_store(dk4_membuf_t *mbptr, const void *src, size_t sz, dk4_er_t *erp);
@@ -114,7 +110,7 @@ dk4membuf_store(dk4_membuf_t *mbptr, const void *src, size_t sz, dk4_er_t *erp);
if a mathematical overflow occured in size calculation.
*/
int
-dk4membuf_size(size_t *szptr, dk4_membuf_t *mbptr, dk4_er_t *erp);
+dk4membuf_size(size_t *szptr, dk4_membuf_t const *mbptr, dk4_er_t *erp);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4memcpl.c b/support/dktools/dk4memcpl.c
index 85d5b601a9..e7c562bde0 100644
--- a/support/dktools/dk4memcpl.c
+++ b/support/dktools/dk4memcpl.c
@@ -1,44 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4memcpl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4memcpl.ctr
*/
/** @file dk4memcpl.c The dk4memcpl module.
*/
-#line 34 "dk4memcpl.ctr"
+#line 52 "dk4memcpl.ctr"
+
+
+#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4memcpl.h"
@@ -49,6 +36,11 @@ dk4mem_cpy_to_left(void *dst, const void *src, size_t sz, dk4_er_t *erp)
{
unsigned char *dptr;
const unsigned char *sptr;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (NULL != src) && (0 < sz)) {
dptr = (unsigned char *)dst; sptr = (const unsigned char *)src;
while (0 < sz--) { *(dptr++) = *(sptr++); }
diff --git a/support/dktools/dk4memcpl.ctr b/support/dktools/dk4memcpl.ctr
index eb217cccc3..f0df662da4 100644
--- a/support/dktools/dk4memcpl.ctr
+++ b/support/dktools/dk4memcpl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,13 +10,31 @@ license = bsd
/** @file dk4memcpl.h Copy memory within buffer from right to left.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
/** Copy memory from right to left.
+
+ CRT on Windows: Not used.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
@@ -33,6 +51,15 @@ dk4mem_cpy_to_left(void *dst, const void *src, size_t sz, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4memcpl.h"
@@ -42,6 +69,11 @@ dk4mem_cpy_to_left(void *dst, const void *src, size_t sz, dk4_er_t *erp)
{
unsigned char *dptr;
const unsigned char *sptr;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (NULL != src) && (0 < sz)) {
dptr = (unsigned char *)dst; sptr = (const unsigned char *)src;
while (0 < sz--) { *(dptr++) = *(sptr++); }
diff --git a/support/dktools/dk4memcpl.h b/support/dktools/dk4memcpl.h
index 8dc60e25f7..5ca891ec26 100644
--- a/support/dktools/dk4memcpl.h
+++ b/support/dktools/dk4memcpl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4memcpl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4memcpl.ctr
*/
#ifndef DK4MEMCPL_H_INCLUDED
@@ -43,13 +21,31 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4memcpl.h Copy memory within buffer from right to left.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
/** Copy memory from right to left.
+
+ CRT on Windows: Not used.
@param dst Destination buffer address.
@param src Source buffer address.
@param sz Number of bytes to copy.
diff --git a/support/dktools/dk4memrs.c b/support/dktools/dk4memrs.c
index cad97ca228..2c33e208cc 100644
--- a/support/dktools/dk4memrs.c
+++ b/support/dktools/dk4memrs.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4memrs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4memrs.ctr
*/
/** @file dk4memrs.c The dk4memrs module.
*/
-#line 79 "dk4memrs.ctr"
+#line 45 "dk4memrs.ctr"
#include "dk4conf.h"
@@ -56,51 +34,55 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mem.h"
+#include "dk4memrs.h"
+
+
+
+
+#line 75 "dk4memrs.ctr"
+
+
+#ifndef DK4MEMRS_PARANOID_CHECK
+#define DK4MEMRS_PARANOID_CHECK 0
+#endif
+
int
dk4mem_reset_secure(void *ptr, size_t sz, dk4_er_t *erp)
{
-#if !DK4_ON_WINDOWS
+#if (!DK4_ON_WINDOWS) && (DK4MEMRS_PARANOID_CHECK)
unsigned char *p1;
#endif
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(0 < sz);
+#endif
if ((NULL != ptr) && (0 < sz)) {
#if DK4_ON_WINDOWS
SecureZeroMemory(ptr, sz);
back = 1;
#else
DK4_MEMRES(ptr, sz);
- p1 = (unsigned char *)ptr;
back = 1;
- while(sz--) {
+#if DK4MEMRS_PARANOID_CHECK
+ p1 = (unsigned char *)ptr;
+ while((0 != back) && (sz--)) {
if ('\0' != *(p1++)) {
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
}
#endif
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- }
- return back;
-}
-
-
-
-int
-dk4mem_free_secure(void *ptr, size_t sz, dk4_er_t *erp)
-{
- int back = 0;
-
- if (NULL != ptr) {
- if (0 < sz) {
- back = dk4mem_reset_secure(ptr, sz, erp);
- } else {
- back = 1;
- }
- dk4mem_free(ptr);
+#endif
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
diff --git a/support/dktools/dk4memrs.ctr b/support/dktools/dk4memrs.ctr
index 735df8db5a..5c1da8894a 100644
--- a/support/dktools/dk4memrs.ctr
+++ b/support/dktools/dk4memrs.ctr
@@ -2,15 +2,14 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
-/** @file
- Secure memory reset (reset byte buffer
- to 0x00 bytes and read the buffer to prevent compilers
- from optimizing the resetting out).
+/** @file dk4memrs.h Secure memory reset.
+
+ Securely reset byte buffer to 0x00 bytes.
*/
#ifdef __cplusplus
@@ -18,19 +17,13 @@ extern "C" {
#endif
/** Secure memory reset.
- This function does not just reset the bytes to 0,
- it also reads each byte to check it.
- Reading each byte should prevent the compiler from optimizing
- out.
- This function has significantly lower performance than
- dk4mem_reset(), so use it to clear sensitive memory
- (i.e. used for passwords, keys...) only.
CRT on Windows: Not used.
@param ptr Start address of memory range.
@param sz Size of memory range in bytes.
@param erp Error report, may be NULL.
- @return 1 on success, 0 on error.
+ @return 1 on success, 0 on error. You should not ignore the
+ return value.
Error codes:
- DK4_E_INVALID_ARGUMENTS<br>
@@ -41,38 +34,11 @@ extern "C" {
int
dk4mem_reset_secure(void *ptr, size_t sz, dk4_er_t *erp);
-/** Secure memory release.
- This function does not just reset the bytes to 0 before releasing
- memory, it also reads each byte to check it.
- Reading each byte should prevent the compiler from optimizing
- out.
- This function has significantly lower performance than
- dk4mem_free(), so use it to clear sensitive memory
- (i.e. used for passwords, keys...) only.
-
- CRT on Windows: Not used.
- @param ptr Start address of memory range.
- @param sz Size of memory range in bytes.
- @param erp Error report, may be NULL.
- @return 1 on success, 0 on error.
-
- Error codes:
- - DK4_E_INVALID_ARGUMENTS<br>
- if ptr is NULL or sz is 0,
- - DK4_E_BUG<br>
- if one of the bytes in the buffer is not 0 during check.
-*/
-int
-dk4mem_free_secure(void *ptr, size_t sz, dk4_er_t *erp);
#ifdef __cplusplus
}
#endif
-/** Release memory securely (sanitize memory before releasing it).
-*/
-#define dk4mem_release_secure(ptr,sz,erp) \
-do { if (NULL != ptr) { (void)dk4mem_free_secure(ptr,sz,erp); } ptr = NULL; } while (0)
%% module
@@ -94,51 +60,53 @@ do { if (NULL != ptr) { (void)dk4mem_free_secure(ptr,sz,erp); } ptr = NULL; } wh
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mem.h"
+#include "dk4memrs.h"
+
+
+$!trace-include
+
+
+#ifndef DK4MEMRS_PARANOID_CHECK
+#define DK4MEMRS_PARANOID_CHECK 0
+#endif
+
int
dk4mem_reset_secure(void *ptr, size_t sz, dk4_er_t *erp)
{
-#if !DK4_ON_WINDOWS
+#if (!DK4_ON_WINDOWS) && (DK4MEMRS_PARANOID_CHECK)
unsigned char *p1;
#endif
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(0 < sz);
+#endif
if ((NULL != ptr) && (0 < sz)) {
#if DK4_ON_WINDOWS
SecureZeroMemory(ptr, sz);
back = 1;
#else
DK4_MEMRES(ptr, sz);
- p1 = (unsigned char *)ptr;
back = 1;
- while(sz--) {
+#if DK4MEMRS_PARANOID_CHECK
+ p1 = (unsigned char *)ptr;
+ while((0 != back) && (sz--)) {
if ('\0' != *(p1++)) {
back = 0;
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
}
#endif
- } else {
- dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
- }
- return back;
-}
-
-
-
-int
-dk4mem_free_secure(void *ptr, size_t sz, dk4_er_t *erp)
-{
- int back = 0;
-
- if (NULL != ptr) {
- if (0 < sz) {
- back = dk4mem_reset_secure(ptr, sz, erp);
- } else {
- back = 1;
- }
- dk4mem_free(ptr);
+#endif
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
diff --git a/support/dktools/dk4memrs.h b/support/dktools/dk4memrs.h
index 2ab64645b0..bb5a31ad57 100644
--- a/support/dktools/dk4memrs.h
+++ b/support/dktools/dk4memrs.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4memrs.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4memrs.ctr
*/
#ifndef DK4MEMRS_H_INCLUDED
@@ -40,10 +18,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4memrs.ctr"
-/** @file
- Secure memory reset (reset byte buffer
- to 0x00 bytes and read the buffer to prevent compilers
- from optimizing the resetting out).
+/** @file dk4memrs.h Secure memory reset.
+
+ Securely reset byte buffer to 0x00 bytes.
*/
#ifdef __cplusplus
@@ -51,19 +28,13 @@ extern "C" {
#endif
/** Secure memory reset.
- This function does not just reset the bytes to 0,
- it also reads each byte to check it.
- Reading each byte should prevent the compiler from optimizing
- out.
- This function has significantly lower performance than
- dk4mem_reset(), so use it to clear sensitive memory
- (i.e. used for passwords, keys...) only.
CRT on Windows: Not used.
@param ptr Start address of memory range.
@param sz Size of memory range in bytes.
@param erp Error report, may be NULL.
- @return 1 on success, 0 on error.
+ @return 1 on success, 0 on error. You should not ignore the
+ return value.
Error codes:
- DK4_E_INVALID_ARGUMENTS<br>
@@ -74,38 +45,11 @@ extern "C" {
int
dk4mem_reset_secure(void *ptr, size_t sz, dk4_er_t *erp);
-/** Secure memory release.
- This function does not just reset the bytes to 0 before releasing
- memory, it also reads each byte to check it.
- Reading each byte should prevent the compiler from optimizing
- out.
- This function has significantly lower performance than
- dk4mem_free(), so use it to clear sensitive memory
- (i.e. used for passwords, keys...) only.
-
- CRT on Windows: Not used.
- @param ptr Start address of memory range.
- @param sz Size of memory range in bytes.
- @param erp Error report, may be NULL.
- @return 1 on success, 0 on error.
-
- Error codes:
- - DK4_E_INVALID_ARGUMENTS<br>
- if ptr is NULL or sz is 0,
- - DK4_E_BUG<br>
- if one of the bytes in the buffer is not 0 during check.
-*/
-int
-dk4mem_free_secure(void *ptr, size_t sz, dk4_er_t *erp);
#ifdef __cplusplus
}
#endif
-/** Release memory securely (sanitize memory before releasing it).
-*/
-#define dk4mem_release_secure(ptr,sz,erp) \
-do { if (NULL != ptr) { (void)dk4mem_free_secure(ptr,sz,erp); } ptr = NULL; } while (0)
diff --git a/support/dktools/dk4mkdh.c b/support/dktools/dk4mkdh.c
index 94ad8382f3..877abd36a9 100644
--- a/support/dktools/dk4mkdh.c
+++ b/support/dktools/dk4mkdh.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mkdh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mkdh.ctr
*/
/** @file dk4mkdh.c The dk4mkdh module.
*/
-#line 60 "dk4mkdh.ctr"
+#line 72 "dk4mkdh.ctr"
+#include "dk4conf.h"
#include "dk4mkdh.h"
#if DK4_CHAR_SIZE > 1
@@ -51,11 +30,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4mkdir_hierarchy(const dkChar *fn, int lc, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4mkdir_hierarchy_wc(fn, lc, erp));
#else
diff --git a/support/dktools/dk4mkdh.ctr b/support/dktools/dk4mkdh.ctr
index a300402206..f9c1f06055 100644
--- a/support/dktools/dk4mkdh.ctr
+++ b/support/dktools/dk4mkdh.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -58,6 +70,7 @@ dk4mkdir_hierarchy(const dkChar *fn, int lc, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4mkdh.h"
#if DK4_CHAR_SIZE > 1
@@ -70,11 +83,20 @@ dk4mkdir_hierarchy(const dkChar *fn, int lc, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4mkdir_hierarchy(const dkChar *fn, int lc, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4mkdir_hierarchy_wc(fn, lc, erp));
#else
diff --git a/support/dktools/dk4mkdh.h b/support/dktools/dk4mkdh.h
index cbeb3a7b34..fcede78dcc 100644
--- a/support/dktools/dk4mkdh.h
+++ b/support/dktools/dk4mkdh.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mkdh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mkdh.ctr
*/
#ifndef DK4MKDH_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4mkdh8.c b/support/dktools/dk4mkdh8.c
index a8e1c2a0ae..38c3dbc8cc 100644
--- a/support/dktools/dk4mkdh8.c
+++ b/support/dktools/dk4mkdh8.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mkdh8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mkdh8.ctr
*/
/** @file dk4mkdh8.c The dk4mkdh8 module.
*/
-#line 156 "dk4mkdh8.ctr"
+#line 168 "dk4mkdh8.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -117,11 +95,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4stat.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 238 "dk4mkdh8.ctr"
+#line 256 "dk4mkdh8.ctr"
@@ -163,7 +147,10 @@ dk4mkdir_hierarchy_c8_one(const char *fn, int ro, dk4_er_t *erp)
int back = 0;
-#line 278 "dk4mkdh8.ctr"
+#line 296 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -244,7 +231,7 @@ dk4mkdir_hierarchy_c8_one(const char *fn, int ro, dk4_er_t *erp)
#endif
-#line 357 "dk4mkdh8.ctr"
+#line 378 "dk4mkdh8.ctr"
finished:
return back;
}
@@ -258,6 +245,9 @@ dk4mkdir_hierarchy_c8_first_sep(char *fn, int *bptr, int lc, dk4_er_t *erp)
int back = 0;
char sc;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -388,7 +378,10 @@ dk4mkdir_hierarchy_c8_one(const char *fn, int ro, dk4_er_t *erp)
int back = 0;
-#line 499 "dk4mkdh8.ctr"
+#line 523 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -416,7 +409,7 @@ dk4mkdir_hierarchy_c8_one(const char *fn, int ro, dk4_er_t *erp)
#endif
-#line 525 "dk4mkdh8.ctr"
+#line 552 "dk4mkdh8.ctr"
finished:
return back;
}
@@ -429,6 +422,9 @@ dk4mkdir_hierarchy_c8_first_sep(char *fn, int *bptr, int lc, dk4_er_t *erp)
char *pc = NULL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -492,7 +488,10 @@ dk4mkdir_hierarchy_c8_on_copy(char *fn, int lc, dk4_er_t *erp)
-#line 599 "dk4mkdh8.ctr"
+#line 629 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
/* Correct file name */
dk4path8_correct_sep(fn);
@@ -526,7 +525,7 @@ dk4mkdir_hierarchy_c8_on_copy(char *fn, int lc, dk4_er_t *erp)
}
-#line 631 "dk4mkdh8.ctr"
+#line 664 "dk4mkdh8.ctr"
return back;
}
@@ -564,12 +563,15 @@ dk4mkdir_hierarchy_c8_local(const char *fn, int lc, dk4_er_t *erp)
int back = 0;
-#line 667 "dk4mkdh8.ctr"
+#line 700 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != dk4str8_cpy_s(mycp, sizeof(mycp), fn, erp)) {
back = dk4mkdir_hierarchy_c8_on_copy(mycp, lc, erp);
}
-#line 670 "dk4mkdh8.ctr"
+#line 706 "dk4mkdh8.ctr"
return back;
}
@@ -583,7 +585,10 @@ dk4mkdir_hierarchy_c8(const char *fn, int lc, dk4_er_t *erp)
int back = 0;
-#line 682 "dk4mkdh8.ctr"
+#line 718 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
sz = dk4str8_len(fn);
if (DK4_MAX_PATH > sz) {
@@ -599,7 +604,7 @@ dk4mkdir_hierarchy_c8(const char *fn, int lc, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 696 "dk4mkdh8.ctr"
+#line 735 "dk4mkdh8.ctr"
return back;
}
@@ -654,7 +659,10 @@ dk4mkdir_hierarchy_ugm_c8_one(
int back = 0;
-#line 749 "dk4mkdh8.ctr"
+#line 788 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -692,7 +700,7 @@ dk4mkdir_hierarchy_ugm_c8_one(
#endif
-#line 785 "dk4mkdh8.ctr"
+#line 827 "dk4mkdh8.ctr"
finished:
return back;
}
@@ -745,11 +753,15 @@ dk4mkdir_hierarchy_ugm_c8_on_copy(
{
char *pc;
int back = 0;
-
+
-#line 839 "dk4mkdh8.ctr"
+#line 881 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+
/* Correct file name */
dk4path8_correct_sep(fn);
@@ -782,7 +794,7 @@ dk4mkdir_hierarchy_ugm_c8_on_copy(
}
-#line 871 "dk4mkdh8.ctr"
+#line 917 "dk4mkdh8.ctr"
return back;
}
@@ -836,12 +848,15 @@ dk4mkdir_hierarchy_ugm_c8_local(
int back = 0;
-#line 923 "dk4mkdh8.ctr"
+#line 969 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != dk4str8_cpy_s(mycp, sizeof(mycp), fn, erp)) {
back = dk4mkdir_hierarchy_ugm_c8_on_copy(mycp, lc, uid, gid, mode, erp);
}
-#line 926 "dk4mkdh8.ctr"
+#line 975 "dk4mkdh8.ctr"
return back;
}
@@ -862,7 +877,10 @@ dk4mkdir_hierarchy_ugm_c8(
int back = 0;
-#line 945 "dk4mkdh8.ctr"
+#line 994 "dk4mkdh8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
sz = dk4str8_len(fn);
if (DK4_MAX_PATH > sz) {
@@ -878,7 +896,7 @@ dk4mkdir_hierarchy_ugm_c8(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 959 "dk4mkdh8.ctr"
+#line 1011 "dk4mkdh8.ctr"
return back;
}
diff --git a/support/dktools/dk4mkdh8.ctr b/support/dktools/dk4mkdh8.ctr
index 3dc340e135..5d37fecfe9 100644
--- a/support/dktools/dk4mkdh8.ctr
+++ b/support/dktools/dk4mkdh8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -232,6 +244,12 @@ dk4mkdir_hierarchy_ugm_c8(
#include "dk4stat.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -275,6 +293,9 @@ dk4mkdir_hierarchy_c8_one(const char *fn, int ro, dk4_er_t *erp)
int i;
int back = 0;
$? "+ dk4mkdir_hierarchy_c8_one \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -367,6 +388,9 @@ dk4mkdir_hierarchy_c8_first_sep(char *fn, int *bptr, int lc, dk4_er_t *erp)
int back = 0;
char sc;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -496,6 +520,9 @@ dk4mkdir_hierarchy_c8_one(const char *fn, int ro, dk4_er_t *erp)
dk4_stat_t stb;
int back = 0;
$? "+ dk4mkdir_hierarchy_c8_one \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -534,6 +561,9 @@ dk4mkdir_hierarchy_c8_first_sep(char *fn, int *bptr, int lc, dk4_er_t *erp)
char *pc = NULL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -596,6 +626,9 @@ dk4mkdir_hierarchy_c8_on_copy(char *fn, int lc, dk4_er_t *erp)
int back = 0;
$? "+ dk4mkdir_hierarchy_c8_on_copy \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
/* Correct file name */
dk4path8_correct_sep(fn);
@@ -664,6 +697,9 @@ dk4mkdir_hierarchy_c8_local(const char *fn, int lc, dk4_er_t *erp)
char mycp[DK4_MAX_PATH];
int back = 0;
$? "+ dk4mkdir_hierarchy_c8_local \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != dk4str8_cpy_s(mycp, sizeof(mycp), fn, erp)) {
back = dk4mkdir_hierarchy_c8_on_copy(mycp, lc, erp);
} $? "- dk4mkdir_hierarchy_c8_local %d", back
@@ -679,6 +715,9 @@ dk4mkdir_hierarchy_c8(const char *fn, int lc, dk4_er_t *erp)
size_t sz;
int back = 0;
$? "+ dk4mkdir_hierarchy_c8 \"%!8s\"", TR_8STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
sz = dk4str8_len(fn);
if (DK4_MAX_PATH > sz) {
@@ -746,6 +785,9 @@ dk4mkdir_hierarchy_ugm_c8_one(
dk4_stat_t stb;
int back = 0;
$? "+ dk4mkdir_hierarchy_c8_one \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -834,9 +876,13 @@ dk4mkdir_hierarchy_ugm_c8_on_copy(
{
char *pc;
int back = 0;
-
+
$? "+ dk4mkdir_hierarchy_c8_on_copy \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+
/* Correct file name */
dk4path8_correct_sep(fn);
@@ -920,6 +966,9 @@ dk4mkdir_hierarchy_ugm_c8_local(
char mycp[DK4_MAX_PATH];
int back = 0;
$? "+ dk4mkdir_hierarchy_c8_local \"%!8s\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (0 != dk4str8_cpy_s(mycp, sizeof(mycp), fn, erp)) {
back = dk4mkdir_hierarchy_ugm_c8_on_copy(mycp, lc, uid, gid, mode, erp);
} $? "- dk4mkdir_hierarchy_c8_local %d", back
@@ -942,6 +991,9 @@ dk4mkdir_hierarchy_ugm_c8(
size_t sz;
int back = 0;
$? "+ dk4mkdir_hierarchy_c8 \"%!8s\"", TR_8STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
sz = dk4str8_len(fn);
if (DK4_MAX_PATH > sz) {
diff --git a/support/dktools/dk4mkdh8.h b/support/dktools/dk4mkdh8.h
index 4e9635a15d..becec7e4e8 100644
--- a/support/dktools/dk4mkdh8.h
+++ b/support/dktools/dk4mkdh8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mkdh8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mkdh8.ctr
*/
#ifndef DK4MKDH8_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4mkdhw.c b/support/dktools/dk4mkdhw.c
index 28f1d3bdbe..1729cd2287 100644
--- a/support/dktools/dk4mkdhw.c
+++ b/support/dktools/dk4mkdhw.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mkdhw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mkdhw.ctr
*/
/** @file dk4mkdhw.c The dk4mkdhw module.
*/
-#line 112 "dk4mkdhw.ctr"
+#line 124 "dk4mkdhw.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -49,7 +27,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
-#include "dk4mkdh8.h"
+#include "dk4mkdhw.h"
#if DK4_HAVE_SYS_STAT_H
#ifndef SYS_STAT_H_INCLUDED
@@ -117,11 +95,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4stat.h"
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 194 "dk4mkdhw.ctr"
+#line 214 "dk4mkdhw.ctr"
@@ -155,7 +141,10 @@ dk4mkdir_hierarchy_wc_one(const wchar_t *fn, int ro, dk4_er_t *erp)
int back = 0;
-#line 226 "dk4mkdhw.ctr"
+#line 246 "dk4mkdhw.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -171,14 +160,14 @@ dk4mkdir_hierarchy_wc_one(const wchar_t *fn, int ro, dk4_er_t *erp)
}
if (INVALID_FILE_ATTRIBUTES != dwattr) {
-#line 240 "dk4mkdhw.ctr"
+#line 263 "dk4mkdhw.ctr"
if (0 != (FILE_ATTRIBUTE_DIRECTORY & dwattr)) {
-#line 241 "dk4mkdhw.ctr"
+#line 264 "dk4mkdhw.ctr"
back = 1;
} else {
-#line 243 "dk4mkdhw.ctr"
+#line 266 "dk4mkdhw.ctr"
if (0 != (FILE_ATTRIBUTE_REPARSE_POINT & dwattr)) {
found = 0;
for (i = 0; ((3 > i) && (0 == back) && (0 == found)); i++) {
@@ -212,18 +201,18 @@ dk4mkdir_hierarchy_wc_one(const wchar_t *fn, int ro, dk4_er_t *erp)
}
} else {
-#line 275 "dk4mkdhw.ctr"
+#line 298 "dk4mkdhw.ctr"
if (0 != ro) {
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
} else {
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
if (CreateDirectoryW(fn, NULL)) {
-#line 280 "dk4mkdhw.ctr"
+#line 303 "dk4mkdhw.ctr"
back = 1;
} else {
-#line 282 "dk4mkdhw.ctr"
+#line 305 "dk4mkdhw.ctr"
dk4error_set_ldetails(
erp, DK4_E_CREATE_DIR_FAILED ,
(long)((unsigned long)GetLastError())
@@ -232,11 +221,11 @@ dk4mkdir_hierarchy_wc_one(const wchar_t *fn, int ro, dk4_er_t *erp)
#else
if (CreateDirectoryW(fn, NULL)) {
-#line 289 "dk4mkdhw.ctr"
+#line 312 "dk4mkdhw.ctr"
back = 1;
} else {
-#line 291 "dk4mkdhw.ctr"
+#line 314 "dk4mkdhw.ctr"
errno = 0;
if (0 == _wmkdir(fn)) {
back = 1;
@@ -253,7 +242,7 @@ dk4mkdir_hierarchy_wc_one(const wchar_t *fn, int ro, dk4_er_t *erp)
finished:
-#line 306 "dk4mkdhw.ctr"
+#line 329 "dk4mkdhw.ctr"
return back;
}
@@ -267,6 +256,9 @@ dk4mkdir_hierarchy_wc_first_sep(wchar_t *fn, int *bptr, int lc, dk4_er_t *erp)
int back = 0;
int isunc = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -498,6 +490,10 @@ dk4mkdir_hierarchy_wc_on_copy(wchar_t *fn, int lc, dk4_er_t *erp)
wchar_t *pc = NULL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+
/* Correct path name */
dk4pathw_correct_sep(fn);
@@ -548,6 +544,9 @@ dk4mkdir_hierarchy_wc_local(const wchar_t *fn, int lc, dk4_er_t *erp)
{
wchar_t mycp[DK4_MAX_PATH];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (dk4strw_cpy_s(mycp, DK4_SIZEOF(mycp,wchar_t), fn, erp)) {
back = dk4mkdir_hierarchy_wc_on_copy(mycp, lc, erp);
}
@@ -560,12 +559,24 @@ dk4mkdir_hierarchy_wc_local(const wchar_t *fn, int lc, dk4_er_t *erp)
int
-dk4mkdir_hierarchy_wc(const wchar_t *fn, int lc, dk4_er_t *erp)
+dk4mkdir_hierarchy_wc(
+#if DK4_ON_WINDOWS
+ const wchar_t *fn,
+ int lc,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+ int DK4_ARG_UNUSED(lc),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
wchar_t *mycp;
size_t sz;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
sz = dk4strw_len(fn);
if (0 < sz) {
@@ -586,16 +597,18 @@ dk4mkdir_hierarchy_wc(const wchar_t *fn, int lc, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(fn)
+ DK4_UNUSED_ARG(lc)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
-#line 640 "dk4mkdhw.ctr"
+#line 687 "dk4mkdhw.ctr"
-#line 641 "dk4mkdhw.ctr"
+#line 688 "dk4mkdhw.ctr"
-#line 642 "dk4mkdhw.ctr"
+#line 689 "dk4mkdhw.ctr"
return 0;
#endif
}
diff --git a/support/dktools/dk4mkdhw.ctr b/support/dktools/dk4mkdhw.ctr
index c5703860fb..de7f6e8fbc 100644
--- a/support/dktools/dk4mkdhw.ctr
+++ b/support/dktools/dk4mkdhw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
@@ -120,7 +132,7 @@ dk4mkdir_hierarchy_wc(const wchar_t *fn, int lc, dk4_er_t *erp);
#endif
#endif
-#include "dk4mkdh8.h"
+#include "dk4mkdhw.h"
#if DK4_HAVE_SYS_STAT_H
#ifndef SYS_STAT_H_INCLUDED
@@ -188,6 +200,14 @@ dk4mkdir_hierarchy_wc(const wchar_t *fn, int lc, dk4_er_t *erp);
#include "dk4stat.h"
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -223,6 +243,9 @@ dk4mkdir_hierarchy_wc_one(const wchar_t *fn, int ro, dk4_er_t *erp)
int i;
int back = 0;
$? "+ dk4mkdir_hierarchy_wc_one \"%ls\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -316,6 +339,9 @@ dk4mkdir_hierarchy_wc_first_sep(wchar_t *fn, int *bptr, int lc, dk4_er_t *erp)
int back = 0;
int isunc = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL == fn) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -547,6 +573,10 @@ dk4mkdir_hierarchy_wc_on_copy(wchar_t *fn, int lc, dk4_er_t *erp)
wchar_t *pc = NULL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
+
/* Correct path name */
dk4pathw_correct_sep(fn);
@@ -597,6 +627,9 @@ dk4mkdir_hierarchy_wc_local(const wchar_t *fn, int lc, dk4_er_t *erp)
{
wchar_t mycp[DK4_MAX_PATH];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (dk4strw_cpy_s(mycp, DK4_SIZEOF(mycp,wchar_t), fn, erp)) {
back = dk4mkdir_hierarchy_wc_on_copy(mycp, lc, erp);
}
@@ -609,12 +642,24 @@ dk4mkdir_hierarchy_wc_local(const wchar_t *fn, int lc, dk4_er_t *erp)
int
-dk4mkdir_hierarchy_wc(const wchar_t *fn, int lc, dk4_er_t *erp)
+dk4mkdir_hierarchy_wc(
+#if DK4_ON_WINDOWS
+ const wchar_t *fn,
+ int lc,
+#else
+ const wchar_t * DK4_ARG_UNUSED(fn),
+ int DK4_ARG_UNUSED(lc),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
wchar_t *mycp;
size_t sz;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+#endif
if (NULL != fn) {
sz = dk4strw_len(fn);
if (0 < sz) {
@@ -635,6 +680,8 @@ dk4mkdir_hierarchy_wc(const wchar_t *fn, int lc, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(fn)
+ DK4_UNUSED_ARG(lc)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
$? "+ dk4mkdir_hierarchy"
$? "! not supported on this platform"
diff --git a/support/dktools/dk4mkdhw.h b/support/dktools/dk4mkdhw.h
index c54a082412..09faeb4f0d 100644
--- a/support/dktools/dk4mkdhw.h
+++ b/support/dktools/dk4mkdhw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mkdhw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mkdhw.ctr
*/
#ifndef DK4MKDHW_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
diff --git a/support/dktools/dk4mm.c b/support/dktools/dk4mm.c
index 90214b22e8..6f3005da27 100644
--- a/support/dktools/dk4mm.c
+++ b/support/dktools/dk4mm.c
@@ -1,47 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mm.ctr
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mm.ctr
*/
/** @file dk4mm.c The dk4mm module.
*/
-#line 39 "dk4mm.ctr"
+#line 47 "dk4mm.ctr"
+#include "dk4conf.h"
#include "dk4mm.h"
#include "dk4statd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
@@ -50,6 +36,10 @@ dk4makemode_must_rebuild(const dkChar *dn, const dkChar *sn)
dk4_stat_t ds;
dk4_stat_t ss;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dn);
+ assert(NULL != sn);
+#endif
if ((NULL == dn) || (NULL == sn)) {
goto finished;
}
diff --git a/support/dktools/dk4mm.ctr b/support/dktools/dk4mm.ctr
index 2014e69b35..971557ab1f 100644
--- a/support/dktools/dk4mm.ctr
+++ b/support/dktools/dk4mm.ctr
@@ -1,7 +1,7 @@
%% options
copyright owner = Dirk Krause
copyright year = 2017-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,11 +10,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
-#include <dk4conf.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
-#include <dk4types.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
@@ -37,9 +45,17 @@ dk4makemode_must_rebuild(const dkChar *dn, const dkChar *sn);
/* vim: set ai sw=4 ts=4 : */
%% module
+#include "dk4conf.h"
#include "dk4mm.h"
#include "dk4statd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
int
@@ -48,6 +64,10 @@ dk4makemode_must_rebuild(const dkChar *dn, const dkChar *sn)
dk4_stat_t ds;
dk4_stat_t ss;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dn);
+ assert(NULL != sn);
+#endif
if ((NULL == dn) || (NULL == sn)) {
goto finished;
}
diff --git a/support/dktools/dk4mm.h b/support/dktools/dk4mm.h
index d928177e1c..beb57df5dc 100644
--- a/support/dktools/dk4mm.h
+++ b/support/dktools/dk4mm.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4mm.ctr
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2017-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4mm.ctr
*/
#ifndef DK4MM_H_INCLUDED
@@ -45,11 +23,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
-#include <dk4conf.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
-#include <dk4types.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
diff --git a/support/dktools/dk4mpl.h b/support/dktools/dk4mpl.h
index 7e20d707fc..2dc6daf7c5 100644
--- a/support/dktools/dk4mpl.h
+++ b/support/dktools/dk4mpl.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4MPL_H_INCLUDED
/** @file dk4mpl.h Definition of DK4_MAX_PATH
@@ -5,7 +10,11 @@
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
diff --git a/support/dktools/dk4numco.h b/support/dktools/dk4numco.h
index bc1fcdef55..7716fdffdd 100644
--- a/support/dktools/dk4numco.h
+++ b/support/dktools/dk4numco.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file dk4numco.h Numeric constants.
Typically the constants from limits.h and stdint.h are used.
@@ -11,7 +16,11 @@
#define DK4NUMCO_H_INCLUDED 1
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_LIMITS_H
diff --git a/support/dktools/dk4numl.c b/support/dktools/dk4numl.c
index eb1f46bf75..0065eee0d0 100644
--- a/support/dktools/dk4numl.c
+++ b/support/dktools/dk4numl.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4numl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4numl.ctr
*/
/** @file dk4numl.c The dk4numl module.
*/
-#line 47 "dk4numl.ctr"
+#line 55 "dk4numl.ctr"
#include "dk4conf.h"
#include "dk4error.h"
diff --git a/support/dktools/dk4numl.ctr b/support/dktools/dk4numl.ctr
index 5e97883bca..2789707eae 100644
--- a/support/dktools/dk4numl.ctr
+++ b/support/dktools/dk4numl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -19,11 +19,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
diff --git a/support/dktools/dk4numl.h b/support/dktools/dk4numl.h
index 485f76bea6..8a9847bd76 100644
--- a/support/dktools/dk4numl.h
+++ b/support/dktools/dk4numl.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4numl.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4numl.ctr
*/
#ifndef DK4NUML_H_INCLUDED
@@ -51,11 +29,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
diff --git a/support/dktools/dk4opt.c b/support/dktools/dk4opt.c
index d625f62430..f5e6ff24bc 100644
--- a/support/dktools/dk4opt.c
+++ b/support/dktools/dk4opt.c
@@ -1,55 +1,40 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4opt.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4opt.ctr
*/
/** @file dk4opt.c The dk4opt module.
*/
-#line 303 "dk4opt.ctr"
+#line 315 "dk4opt.ctr"
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 313 "dk4opt.ctr"
+#line 332 "dk4opt.ctr"
@@ -168,10 +153,13 @@ dk4opt_close(dk4_option_t *optptr)
{
-#line 430 "dk4opt.ctr"
+#line 449 "dk4opt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != optptr);
+#endif
if (NULL != optptr) {
-#line 431 "dk4opt.ctr"
+#line 453 "dk4opt.ctr"
/*
We can not sanitize the memory for option name and option value
as the option name is constant and the option value was provided
@@ -183,7 +171,7 @@ dk4opt_close(dk4_option_t *optptr)
}
-#line 441 "dk4opt.ctr"
+#line 463 "dk4opt.ctr"
}
@@ -192,6 +180,9 @@ dk4_option_t *
dk4opt_open(const dk4_option_specification_t *spec, dk4_er_t *erp)
{
dk4_option_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != spec);
+#endif
if (NULL != spec) {
if ((NULL != spec->longopt) || (dkT('\0') != spec->c)) {
back = dk4mem_new(dk4_option_t,1,NULL);
diff --git a/support/dktools/dk4opt.ctr b/support/dktools/dk4opt.ctr
index cca3eae8c4..cc4579c15c 100644
--- a/support/dktools/dk4opt.ctr
+++ b/support/dktools/dk4opt.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -18,15 +18,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** Option specification for application module.
@@ -130,7 +142,7 @@ dk4opt_open(const dk4_option_specification_t *spec, dk4_er_t *erp);
configured with an incompatible type.
*/
int
-dk4opt_get_bool(int *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_bool(int *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve size_t value from option.
CRT on Windows: Optional.
@@ -153,7 +165,7 @@ dk4opt_get_bool(int *dptr, dk4_option_t *optptr, dk4_er_t *erp);
results in an overflow.
*/
int
-dk4opt_get_size(size_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_size(size_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve integer value (dk4_im_t) from option.
CRT on Windows: Optional.
@@ -176,7 +188,7 @@ dk4opt_get_size(size_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
results in an overflow.
*/
int
-dk4opt_get_int(dk4_im_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_int(dk4_im_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve unsigned integer value (dk4_um_t) from option.
CRT on Windows: Optional.
@@ -199,7 +211,7 @@ dk4opt_get_int(dk4_im_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
negative value is stored.
*/
int
-dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve double value from option.
CRT on Windows: Optional.
@@ -219,7 +231,7 @@ dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
string stored as option argument does not represent a double number.
*/
int
-dk4opt_get_double(double *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_double(double *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve string value from option.
CRT on Windows: Optional, disabling CRT reduces functionality
@@ -246,7 +258,7 @@ dk4opt_get_double(double *dptr, dk4_option_t *optptr, dk4_er_t *erp);
*/
int
dk4opt_get_string(
- dkChar *dptr, size_t szdptr, dk4_option_t *optptr, dk4_er_t *erp
+ dkChar *dptr, size_t szdptr, dk4_option_t const *optptr, dk4_er_t *erp
);
/** Destroy option object, release memory.
@@ -303,10 +315,17 @@ dk4opt_process_argv(
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -427,6 +446,9 @@ void
dk4opt_close(dk4_option_t *optptr)
{
$? "+ dk4opt_close"
+#if DK4_USE_ASSERT
+ assert(NULL != optptr);
+#endif
if (NULL != optptr) { $? ". valid option ptr"
/*
We can not sanitize the memory for option name and option value
@@ -446,6 +468,9 @@ dk4_option_t *
dk4opt_open(const dk4_option_specification_t *spec, dk4_er_t *erp)
{
dk4_option_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != spec);
+#endif
if (NULL != spec) {
if ((NULL != spec->longopt) || (dkT('\0') != spec->c)) {
back = dk4mem_new(dk4_option_t,1,NULL);
diff --git a/support/dktools/dk4opt.h b/support/dktools/dk4opt.h
index ef9dd297f8..1de8643d03 100644
--- a/support/dktools/dk4opt.h
+++ b/support/dktools/dk4opt.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4opt.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4opt.ctr
*/
#ifndef DK4OPT_H_INCLUDED
@@ -50,15 +28,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** Option specification for application module.
@@ -162,7 +152,7 @@ dk4opt_open(const dk4_option_specification_t *spec, dk4_er_t *erp);
configured with an incompatible type.
*/
int
-dk4opt_get_bool(int *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_bool(int *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve size_t value from option.
CRT on Windows: Optional.
@@ -185,7 +175,7 @@ dk4opt_get_bool(int *dptr, dk4_option_t *optptr, dk4_er_t *erp);
results in an overflow.
*/
int
-dk4opt_get_size(size_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_size(size_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve integer value (dk4_im_t) from option.
CRT on Windows: Optional.
@@ -208,7 +198,7 @@ dk4opt_get_size(size_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
results in an overflow.
*/
int
-dk4opt_get_int(dk4_im_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_int(dk4_im_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve unsigned integer value (dk4_um_t) from option.
CRT on Windows: Optional.
@@ -231,7 +221,7 @@ dk4opt_get_int(dk4_im_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
negative value is stored.
*/
int
-dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve double value from option.
CRT on Windows: Optional.
@@ -251,7 +241,7 @@ dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t *optptr, dk4_er_t *erp);
string stored as option argument does not represent a double number.
*/
int
-dk4opt_get_double(double *dptr, dk4_option_t *optptr, dk4_er_t *erp);
+dk4opt_get_double(double *dptr, dk4_option_t const *optptr, dk4_er_t *erp);
/** Retrieve string value from option.
CRT on Windows: Optional, disabling CRT reduces functionality
@@ -278,7 +268,7 @@ dk4opt_get_double(double *dptr, dk4_option_t *optptr, dk4_er_t *erp);
*/
int
dk4opt_get_string(
- dkChar *dptr, size_t szdptr, dk4_option_t *optptr, dk4_er_t *erp
+ dkChar *dptr, size_t szdptr, dk4_option_t const *optptr, dk4_er_t *erp
);
/** Destroy option object, release memory.
diff --git a/support/dktools/dk4opt01.c b/support/dktools/dk4opt01.c
index bb215c8446..279a102c32 100644
--- a/support/dktools/dk4opt01.c
+++ b/support/dktools/dk4opt01.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4opt01.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4opt01.ctr
*/
/** @file dk4opt01.c The dk4opt01 module.
@@ -39,22 +17,33 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4opt01.ctr"
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 18 "dk4opt01.ctr"
+#line 25 "dk4opt01.ctr"
int
-dk4opt_get_bool(int *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_bool(int *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt01.ctr b/support/dktools/dk4opt01.ctr
index d1f846af5f..07ccf5b34b 100644
--- a/support/dktools/dk4opt01.ctr
+++ b/support/dktools/dk4opt01.ctr
@@ -2,16 +2,23 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -19,9 +26,13 @@ $!trace-include
int
-dk4opt_get_bool(int *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_bool(int *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt02.c b/support/dktools/dk4opt02.c
index 15d6f03963..bdf88cce41 100644
--- a/support/dktools/dk4opt02.c
+++ b/support/dktools/dk4opt02.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4opt02.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4opt02.ctr
*/
/** @file dk4opt02.c The dk4opt02 module.
@@ -39,25 +17,36 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4opt02.ctr"
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
#include "dk4maiddsz.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 19 "dk4opt02.ctr"
+#line 26 "dk4opt02.ctr"
int
-dk4opt_get_size(size_t *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_size(size_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
size_t val = 0;
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt02.ctr b/support/dktools/dk4opt02.ctr
index 33e0303df1..2ccbef359e 100644
--- a/support/dktools/dk4opt02.ctr
+++ b/support/dktools/dk4opt02.ctr
@@ -2,17 +2,24 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
#include "dk4maiddsz.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -20,11 +27,15 @@ $!trace-include
int
-dk4opt_get_size(size_t *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_size(size_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
size_t val = 0;
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt03.c b/support/dktools/dk4opt03.c
index 96ccff1caa..b5cd3eb430 100644
--- a/support/dktools/dk4opt03.c
+++ b/support/dktools/dk4opt03.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4opt03.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4opt03.ctr
*/
/** @file dk4opt03.c The dk4opt03 module.
@@ -39,26 +17,37 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4opt03.ctr"
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
#include "dk4numco.h"
#include "dk4maidddi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 20 "dk4opt03.ctr"
+#line 27 "dk4opt03.ctr"
int
-dk4opt_get_int(dk4_im_t *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_int(dk4_im_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
dk4_im_t val = (dk4_im_t)0L;
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt03.ctr b/support/dktools/dk4opt03.ctr
index 8d85332dc2..e8b7d1ef3c 100644
--- a/support/dktools/dk4opt03.ctr
+++ b/support/dktools/dk4opt03.ctr
@@ -2,18 +2,25 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
#include "dk4numco.h"
#include "dk4maidddi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -21,11 +28,15 @@ $!trace-include
int
-dk4opt_get_int(dk4_im_t *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_int(dk4_im_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
dk4_im_t val = (dk4_im_t)0L;
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt04.c b/support/dktools/dk4opt04.c
index db3ea28c44..faf8f491e5 100644
--- a/support/dktools/dk4opt04.c
+++ b/support/dktools/dk4opt04.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4opt04.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4opt04.ctr
*/
/** @file dk4opt04.c The dk4opt04 module.
@@ -39,25 +17,36 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4opt04.ctr"
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
#include "dk4maidddu.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 19 "dk4opt04.ctr"
+#line 26 "dk4opt04.ctr"
int
-dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
dk4_um_t val = (dk4_um_t)0UL;
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt04.ctr b/support/dktools/dk4opt04.ctr
index 63c6177dda..5017d9fb2a 100644
--- a/support/dktools/dk4opt04.ctr
+++ b/support/dktools/dk4opt04.ctr
@@ -2,17 +2,24 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
#include "dk4maidddu.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -20,11 +27,15 @@ $!trace-include
int
-dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_unsigned(dk4_um_t *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
dk4_um_t val = (dk4_um_t)0UL;
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt05.c b/support/dktools/dk4opt05.c
index b2ac4db59d..8c94ec740b 100644
--- a/support/dktools/dk4opt05.c
+++ b/support/dktools/dk4opt05.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4opt05.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4opt05.ctr
*/
/** @file dk4opt05.c The dk4opt05 module.
@@ -39,19 +17,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4opt05.ctr"
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
#include "dk4maiddbl.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
-dk4opt_get_double(double *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_double(double *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
double val = 0.0;
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt05.ctr b/support/dktools/dk4opt05.ctr
index 12d1e30734..fc422254cb 100644
--- a/support/dktools/dk4opt05.ctr
+++ b/support/dktools/dk4opt05.ctr
@@ -2,25 +2,36 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
#include "dk4maiddbl.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
-dk4opt_get_double(double *dptr, dk4_option_t *optptr, dk4_er_t *erp)
+dk4opt_get_double(double *dptr, dk4_option_t const *optptr, dk4_er_t *erp)
{
double val = 0.0;
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt06.c b/support/dktools/dk4opt06.c
index 2c5eb77db8..efbca552ba 100644
--- a/support/dktools/dk4opt06.c
+++ b/support/dktools/dk4opt06.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4opt06.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4opt06.ctr
*/
/** @file dk4opt06.c The dk4opt06 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4opt06.ctr"
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
@@ -46,22 +25,33 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mao8dbl.h"
#include "dk4maoddbl.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 21 "dk4opt06.ctr"
+#line 28 "dk4opt06.ctr"
int
dk4opt_get_string(
- dkChar *dptr, size_t szdptr, dk4_option_t *optptr, dk4_er_t *erp
+ dkChar *dptr, size_t szdptr, dk4_option_t const *optptr, dk4_er_t *erp
)
{
dkChar buf[16 * sizeof(dk4_um_t)];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt06.ctr b/support/dktools/dk4opt06.ctr
index 2f21e7dbc8..168196f365 100644
--- a/support/dktools/dk4opt06.ctr
+++ b/support/dktools/dk4opt06.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4opt.h"
#include "dk4strd.h"
#include "dk4mem.h"
@@ -15,6 +16,12 @@ license = bsd
#include "dk4mao8dbl.h"
#include "dk4maoddbl.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -23,12 +30,17 @@ $!trace-include
int
dk4opt_get_string(
- dkChar *dptr, size_t szdptr, dk4_option_t *optptr, dk4_er_t *erp
+ dkChar *dptr, size_t szdptr, dk4_option_t const *optptr, dk4_er_t *erp
)
{
dkChar buf[16 * sizeof(dk4_um_t)];
int back = 0;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < szdptr);
+ assert(NULL != optptr);
+#endif
if ((NULL != dptr) && (0 < szdptr) && (NULL != optptr)) {
if (0 != optptr->found) {
switch ((optptr->spec).argtype) {
diff --git a/support/dktools/dk4opt07.c b/support/dktools/dk4opt07.c
index 8f8b206f7b..734f3b577a 100644
--- a/support/dktools/dk4opt07.c
+++ b/support/dktools/dk4opt07.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk4opt07.ctr
@@ -9,7 +15,7 @@
*/
-#line 5 "dk4opt07.ctr"
+#line 7 "dk4opt07.ctr"
#include "dk4conf.h"
#include "dk4types.h"
@@ -22,11 +28,17 @@
#include "dk4strd.h"
#include "dk4fput.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 20 "dk4opt07.ctr"
+#line 28 "dk4opt07.ctr"
@@ -106,7 +118,7 @@ dkT("\".\n"),
NULL
-#line 80 "dk4opt07.ctr"
+#line 88 "dk4opt07.ctr"
};
@@ -168,6 +180,9 @@ dk4opt_complain_argument(
int logstderr
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != opt);
+#endif
if (0 != logstderr) {
if ((dkT('\0') != opt->spec.c) || (NULL != opt->spec.longopt)) {
dk4fput_initialize_stderr();
@@ -219,7 +234,7 @@ dk4opt_complain_argument(
/** Find first position of equal sign in string.
- Before calling this function we manuall checked there is no
+ Before calling this function we manually checked there is no
equal sign at position 0.
@param str String to check.
@return Position of first equal sign on success, 0 on error.
@@ -266,11 +281,14 @@ dk4opt_i_set_value(
int back = 0; /* Result */
-#line 238 "dk4opt07.ctr"
+#line 249 "dk4opt07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != opt);
+#endif
switch (opt->spec.argtype) {
case DK4_OPT_ARG_BOOL : {
-#line 240 "dk4opt07.ctr"
+#line 254 "dk4opt07.ctr"
opt->val.b = 0;
opt->found = 0;
if (0 != dk4str_is_bool(valstr)) {
@@ -292,7 +310,7 @@ dk4opt_i_set_value(
} break;
case DK4_OPT_ARG_SIZE : {
-#line 260 "dk4opt07.ctr"
+#line 274 "dk4opt07.ctr"
opt->val.s = (size_t)0UL;
opt->found = 0;
back = dk4ma_input_dk_dec_size_t(&sz, valstr, &ep, 1, NULL);
@@ -308,7 +326,7 @@ dk4opt_i_set_value(
} break;
case DK4_OPT_ARG_INT : {
-#line 274 "dk4opt07.ctr"
+#line 288 "dk4opt07.ctr"
opt->val.i = (dk4_im_t)0L;
opt->found = 0;
back = dk4ma_input_dk_dec_dk4_im_t(&im, valstr, &ep, 1, NULL);
@@ -324,7 +342,7 @@ dk4opt_i_set_value(
} break;
case DK4_OPT_ARG_UNSIGNED : {
-#line 288 "dk4opt07.ctr"
+#line 302 "dk4opt07.ctr"
opt->val.u = (dk4_um_t)0UL;
opt->found = 0;
back = dk4ma_input_dk_dec_dk4_um_t(&um, valstr, &ep, 1, NULL);
@@ -340,7 +358,7 @@ dk4opt_i_set_value(
} break;
case DK4_OPT_ARG_DOUBLE : {
-#line 302 "dk4opt07.ctr"
+#line 316 "dk4opt07.ctr"
opt->val.d = 0.0;
opt->found = 0;
back = dk4ma_input_dk_double(&d, valstr, &ep, 1, NULL);
@@ -356,14 +374,14 @@ dk4opt_i_set_value(
} break;
case DK4_OPT_ARG_STRING : {
-#line 316 "dk4opt07.ctr"
+#line 330 "dk4opt07.ctr"
opt->val.t = valstr;
opt->found = 1;
if (NULL != valstr) { back = 1; }
} break;
}
-#line 321 "dk4opt07.ctr"
+#line 335 "dk4opt07.ctr"
return back;
}
@@ -393,17 +411,21 @@ dk4opt_process_argv(
int back = 0;
-#line 349 "dk4opt07.ctr"
+#line 363 "dk4opt07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != optptr);
+ assert(0 < szoptptr);
+#endif
if ((NULL != optptr) && (0 < szoptptr)) {
-#line 350 "dk4opt07.ctr"
+#line 368 "dk4opt07.ctr"
for (j = 0; j < szoptptr; j++) {
optptr[j].found = 0;
optptr[j].val.t = NULL;
}
if ((0 < argc) && (NULL != argv)) {
-#line 355 "dk4opt07.ctr"
+#line 373 "dk4opt07.ctr"
if ((NULL != filenames) && (NULL != nfilenames)) {
for (fnused = 0; fnused < *nfilenames; fnused++) {
filenames[fnused] = NULL;
@@ -416,7 +438,7 @@ dk4opt_process_argv(
while(i < argc) {
ocurptr = curptr = argv[i];
-#line 366 "dk4opt07.ctr"
+#line 384 "dk4opt07.ctr"
if (dkT('-') == *curptr) {
curptr++;
if (dkT('-') == *curptr) {
@@ -426,10 +448,9 @@ dk4opt_process_argv(
eqpos = dk4opt_i_equal_sign_position(curptr);
found = 0;
-#line 374 "dk4opt07.ctr"
+#line 392 "dk4opt07.ctr"
for (j = 0; ((j < szoptptr) && (0 == found)); j++) {
if (NULL != optptr[j].spec.longopt) {
- res = 0;
if (0 != eqpos) {
if (eqpos == dk4str_len(optptr[j].spec.longopt)) {
res = dk4str_ncmp(curptr,optptr[j].spec.longopt,eqpos);
@@ -640,7 +661,7 @@ dk4opt_process_argv(
if (NULL != nfilenames) { *nfilenames = fnused; }
-#line 586 "dk4opt07.ctr"
+#line 603 "dk4opt07.ctr"
return back;
}
diff --git a/support/dktools/dk4opt07.ctr b/support/dktools/dk4opt07.ctr
index 03c94456c9..8d2d018d11 100644
--- a/support/dktools/dk4opt07.ctr
+++ b/support/dktools/dk4opt07.ctr
@@ -1,5 +1,7 @@
%% options
-
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -14,6 +16,12 @@
#include "dk4strd.h"
#include "dk4fput.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -138,6 +146,9 @@ dk4opt_complain_argument(
int logstderr
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != opt);
+#endif
if (0 != logstderr) {
if ((dkT('\0') != opt->spec.c) || (NULL != opt->spec.longopt)) {
dk4fput_initialize_stderr();
@@ -189,7 +200,7 @@ dk4opt_complain_argument(
/** Find first position of equal sign in string.
- Before calling this function we manuall checked there is no
+ Before calling this function we manually checked there is no
equal sign at position 0.
@param str String to check.
@return Position of first equal sign on success, 0 on error.
@@ -235,6 +246,9 @@ dk4opt_i_set_value(
size_t sz = (size_t)0UL; /* Default size value */
int back = 0; /* Result */
$? "+ dk4opt_i_set_value \"%!ds\"", TR_STR(valstr)
+#if DK4_USE_ASSERT
+ assert(NULL != opt);
+#endif
switch (opt->spec.argtype) {
case DK4_OPT_ARG_BOOL : { $? ". boolean"
opt->val.b = 0;
@@ -346,6 +360,10 @@ dk4opt_process_argv(
int res = 0; /* Operation result */
int back = 0;
$? "+ dk4opt_process_argv"
+#if DK4_USE_ASSERT
+ assert(NULL != optptr);
+ assert(0 < szoptptr);
+#endif
if ((NULL != optptr) && (0 < szoptptr)) { $? ". args ok"
for (j = 0; j < szoptptr; j++) {
optptr[j].found = 0;
@@ -373,7 +391,6 @@ dk4opt_process_argv(
found = 0; $? ". eqpos = %u", (unsigned)eqpos
for (j = 0; ((j < szoptptr) && (0 == found)); j++) {
if (NULL != optptr[j].spec.longopt) {
- res = 0;
if (0 != eqpos) {
if (eqpos == dk4str_len(optptr[j].spec.longopt)) {
res = dk4str_ncmp(curptr,optptr[j].spec.longopt,eqpos);
diff --git a/support/dktools/dk4papea.c b/support/dktools/dk4papea.c
index c7c2c23f53..cb409aee27 100644
--- a/support/dktools/dk4papea.c
+++ b/support/dktools/dk4papea.c
@@ -1,45 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4papea.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4papea.ctr
*/
/** @file dk4papea.c The dk4papea module.
*/
-#line 57 "dk4papea.ctr"
+#line 73 "dk4papea.ctr"
+#include "dk4conf.h"
#include "dk4papea.h"
#include "dk4strd.h"
#include "dk4mem.h"
@@ -49,12 +28,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mpl.h"
#include "dk4strm.h"
#include "dk4strmr.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 72 "dk4papea.ctr"
+#line 96 "dk4papea.ctr"
@@ -97,7 +83,7 @@ dk4papersize_line_handler(
void *obj,
dkChar *line,
dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
double val[6]; /* w, h, i, o, t, b */
@@ -114,7 +100,8 @@ dk4papersize_line_handler(
int back = DK4_TSP_RES_OK;
-#line 130 "dk4papea.ctr"
+#line 154 "dk4papea.ctr"
+ DK4_UNUSED_ARG(erp)
/* Retrieve components from obj pointer
*/
rdo = (reader_obj_t *)obj;
@@ -127,7 +114,7 @@ dk4papersize_line_handler(
pls = dk4str_start(line, NULL);
if (NULL == pls) {
-#line 141 "dk4papea.ctr"
+#line 166 "dk4papea.ctr"
goto finished;
}
/*
@@ -135,7 +122,7 @@ dk4papersize_line_handler(
*/
if (dkT('#') == *pls) {
-#line 147 "dk4papea.ctr"
+#line 172 "dk4papea.ctr"
goto finished;
}
/*
@@ -144,51 +131,51 @@ dk4papersize_line_handler(
pval = dk4str_chr(pls, dkT('='));
if (NULL == pval) {
-#line 154 "dk4papea.ctr"
+#line 179 "dk4papea.ctr"
/* ERROR: Syntax */
dk4app_log_base1(app, DK4_LL_WARNING, 159);
back = DK4_TSP_RES_ERROR;
goto finished;
}
-#line 159 "dk4papea.ctr"
+#line 184 "dk4papea.ctr"
*(pval++) = dkT('\0');
dk4str_rtwh(pls, NULL);
if (0 == dk4str_len(pls)) {
-#line 162 "dk4papea.ctr"
+#line 187 "dk4papea.ctr"
/* ERROR: Syntax */
dk4app_log_base1(app, DK4_LL_WARNING, 159);
back = DK4_TSP_RES_ERROR;
goto finished;
}
-#line 167 "dk4papea.ctr"
+#line 192 "dk4papea.ctr"
pval = dk4str_start(pval, NULL);
if (NULL == pval) {
-#line 169 "dk4papea.ctr"
+#line 194 "dk4papea.ctr"
/* ERROR: Syntax */
dk4app_log_base1(app, DK4_LL_WARNING, 159);
back = DK4_TSP_RES_ERROR;
goto finished;
}
-#line 174 "dk4papea.ctr"
+#line 199 "dk4papea.ctr"
/*
Tokenize string
*/
ntok = dk4str_tokenize(tok, 16, pval, NULL, NULL);
if ((2 > ntok) || (6 < ntok)) {
-#line 179 "dk4papea.ctr"
+#line 204 "dk4papea.ctr"
/* ERROR: Syntax */
dk4app_log_base1(app, DK4_LL_WARNING, 159);
back = DK4_TSP_RES_ERROR;
goto finished;
}
-#line 184 "dk4papea.ctr"
+#line 209 "dk4papea.ctr"
/*
Initialize values
*/
@@ -199,13 +186,13 @@ dk4papersize_line_handler(
for (i = 0; i < ntok; i++) {
ep = NULL;
-#line 193 "dk4papea.ctr"
+#line 218 "dk4papea.ctr"
if (0 == dk4ma_input_dk_double(&(val[i]), tok[i], &ep, 1, NULL)) {
/* ERROR: Syntax */
dk4app_log_base1(app, DK4_LL_WARNING, 159);
back = DK4_TSP_RES_ERROR;
-#line 197 "dk4papea.ctr"
+#line 222 "dk4papea.ctr"
goto finished;
}
}
@@ -215,42 +202,42 @@ dk4papersize_line_handler(
ps = (dk4_paper_size_t *)dk4sto_it_find_like(pscptr->i_ps, pls, 1);
if (NULL == ps) {
-#line 205 "dk4papea.ctr"
+#line 230 "dk4papea.ctr"
ps = dk4papersize_new(pls, NULL);
if (NULL != ps) {
-#line 207 "dk4papea.ctr"
+#line 232 "dk4papea.ctr"
if (0 == dk4sto_add(pscptr->s_ps, ps, NULL)) {
dk4papersize_delete(ps);
-#line 209 "dk4papea.ctr"
+#line 234 "dk4papea.ctr"
ps = NULL;
}
}
#if TRACE_DEBUG
else {
-#line 214 "dk4papea.ctr"
+#line 239 "dk4papea.ctr"
}
#endif
}
if (NULL == ps) {
-#line 218 "dk4papea.ctr"
+#line 243 "dk4papea.ctr"
/* ERROR: Memory */
dk4app_log_base1(app, DK4_LL_WARNING, 90);
back = DK4_TSP_RES_ERROR;
goto finished;
}
-#line 223 "dk4papea.ctr"
+#line 248 "dk4papea.ctr"
ps->w = val[0]; ps->h = val[1]; ps->i = val[2];
ps->o = val[3]; ps->t = val[4]; ps->b = val[5];
finished:
-#line 228 "dk4papea.ctr"
+#line 253 "dk4papea.ctr"
return back;
}
@@ -282,7 +269,11 @@ dk4app_apply_paper_size_file(
int res = 0; /* Operation result */
-#line 258 "dk4papea.ctr"
+#line 283 "dk4papea.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pscptr);
+ assert(NULL != fn);
+#endif
/* Save current file name and file line for logging
*/
oldsourcefile = dk4app_get_log_source_file(app);
@@ -299,11 +290,11 @@ dk4app_apply_paper_size_file(
istrm = dk4stream_open_file_reader(fn, &er);
if (NULL == istrm) {
-#line 273 "dk4papea.ctr"
+#line 302 "dk4papea.ctr"
goto finished;
}
-#line 275 "dk4papea.ctr"
+#line 304 "dk4papea.ctr"
/*
Set up reader object
*/
@@ -318,49 +309,49 @@ dk4app_apply_paper_size_file(
);
if (0 == res) {
-#line 288 "dk4papea.ctr"
+#line 317 "dk4papea.ctr"
goto finished;
}
-#line 290 "dk4papea.ctr"
+#line 319 "dk4papea.ctr"
/*
Read and process contents from stream
*/
res = DK4_TSP_RES_OK;
do {
-#line 295 "dk4papea.ctr"
+#line 324 "dk4papea.ctr"
cc = 0;
rb = sizeof(ib);
if (0 != dk4stream_read(ib, &rb, istrm, &er)) {
-#line 298 "dk4papea.ctr"
+#line 327 "dk4papea.ctr"
if (0 < rb) {
-#line 299 "dk4papea.ctr"
+#line 328 "dk4papea.ctr"
res = dk4tspdk_add_bytes(&tsp, (const unsigned char *)ib, rb);
if (DK4_TSP_RES_FATAL != res) {
-#line 301 "dk4papea.ctr"
+#line 330 "dk4papea.ctr"
cc = 1;
}
}
#if TRACE_DEBUG
else {
-#line 306 "dk4papea.ctr"
+#line 335 "dk4papea.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 311 "dk4papea.ctr"
+#line 340 "dk4papea.ctr"
}
#endif
-#line 314 "dk4papea.ctr"
+#line 343 "dk4papea.ctr"
} while (1 == cc);
if (DK4_TSP_RES_FATAL != res) {
dk4tspdk_finish(&tsp);
@@ -378,7 +369,7 @@ dk4app_apply_paper_size_file(
dk4app_set_log_source_line(app, oldsourceline);
-#line 330 "dk4papea.ctr"
+#line 359 "dk4papea.ctr"
}
@@ -395,12 +386,15 @@ dk4app_get_paper_sizes(dk4_app_t *app)
int i; /* Index for traversal */
-#line 345 "dk4papea.ctr"
+#line 374 "dk4papea.ctr"
/* Check app pointer
*/
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL == app) {
-#line 348 "dk4papea.ctr"
+#line 380 "dk4papea.ctr"
goto finished;
}
/* Allocate new size collection with default sizes
@@ -408,7 +402,7 @@ dk4app_get_paper_sizes(dk4_app_t *app)
back = dk4papersize_coll_open(NULL);
if (NULL == back) {
-#line 354 "dk4papea.ctr"
+#line 386 "dk4papea.ctr"
/* ERROR: Memory */
dk4app_log_base1(app, DK4_LL_WARNING, 90);
goto finished;
@@ -423,7 +417,7 @@ dk4app_get_paper_sizes(dk4_app_t *app)
}
for (i = 0; i <= DK4_FS_CONF_MAX; i++) {
-#line 367 "dk4papea.ctr"
+#line 399 "dk4papea.ctr"
#if DK4_HAVE_COMPATDKTOOLS3
#if VERSION_BEFORE_2017_03_09
dk4error_init(&er);
@@ -434,7 +428,7 @@ dk4app_get_paper_sizes(dk4_app_t *app)
);
if (0 != res) {
-#line 376 "dk4papea.ctr"
+#line 408 "dk4papea.ctr"
dk4app_apply_paper_size_file(back, fnb, app);
}
#else
@@ -477,7 +471,7 @@ dk4app_get_paper_sizes(dk4_app_t *app)
);
if (0 != res) {
-#line 417 "dk4papea.ctr"
+#line 449 "dk4papea.ctr"
dk4app_apply_paper_size_file(back, fnb, app);
}
#else
@@ -515,7 +509,7 @@ dk4app_get_paper_sizes(dk4_app_t *app)
finished:
-#line 453 "dk4papea.ctr"
+#line 485 "dk4papea.ctr"
return back;
}
@@ -529,7 +523,11 @@ dk4app_get_paper_size(dk4_app_t *app, const dkChar *psname)
dk4_paper_size_t *tmp = NULL; /* Temporary found paper size */
-#line 465 "dk4papea.ctr"
+#line 497 "dk4papea.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != psname);
+ assert(NULL != app);
+#endif
/*
Check arguments
*/
@@ -565,7 +563,7 @@ dk4app_get_paper_size(dk4_app_t *app, const dkChar *psname)
}
-#line 499 "dk4papea.ctr"
+#line 535 "dk4papea.ctr"
return back;
}
diff --git a/support/dktools/dk4papea.ctr b/support/dktools/dk4papea.ctr
index 313cbdf77c..6a1355809f 100644
--- a/support/dktools/dk4papea.ctr
+++ b/support/dktools/dk4papea.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,12 +10,28 @@ license = bsd
/** @file dk4papea.h Paper sizes for applications.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4PAPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4paper.h"
+#else
+#include <dktools-4/dk4paper.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,6 +72,7 @@ dk4app_get_paper_size(dk4_app_t *app, const dkChar *psname);
%% module
+#include "dk4conf.h"
#include "dk4papea.h"
#include "dk4strd.h"
#include "dk4mem.h"
@@ -65,7 +82,14 @@ dk4app_get_paper_size(dk4_app_t *app, const dkChar *psname);
#include "dk4mpl.h"
#include "dk4strm.h"
#include "dk4strmr.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -111,7 +135,7 @@ dk4papersize_line_handler(
void *obj,
dkChar *line,
dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
double val[6]; /* w, h, i, o, t, b */
@@ -127,6 +151,7 @@ dk4papersize_line_handler(
size_t i; /* index for traversal */
int back = DK4_TSP_RES_OK;
$? "+ dk4papersize_line_handler \"%!ds\"", line
+ DK4_UNUSED_ARG(erp)
/* Retrieve components from obj pointer
*/
rdo = (reader_obj_t *)obj;
@@ -255,6 +280,10 @@ dk4app_apply_paper_size_file(
int cc = 1; /* Flag: Can continue */
int res = 0; /* Operation result */
$? "+ dk4app_apply_paper_size_file \"%!ds\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != pscptr);
+ assert(NULL != fn);
+#endif
/* Save current file name and file line for logging
*/
oldsourcefile = dk4app_get_log_source_file(app);
@@ -344,6 +373,9 @@ dk4app_get_paper_sizes(dk4_app_t *app)
$? "+ dk4app_get_paper_sizes"
/* Check app pointer
*/
+#if DK4_USE_ASSERT
+ assert(NULL != app);
+#endif
if (NULL == app) { $? "! invalid app pointer"
goto finished;
}
@@ -462,6 +494,10 @@ dk4app_get_paper_size(dk4_app_t *app, const dkChar *psname)
dk4_paper_size_t *back = NULL; /* Function result */
dk4_paper_size_t *tmp = NULL; /* Temporary found paper size */
$? "+ dk4app_get_paper_size \"%!ds\"", TR_STR(psname)
+#if DK4_USE_ASSERT
+ assert(NULL != psname);
+ assert(NULL != app);
+#endif
/*
Check arguments
*/
diff --git a/support/dktools/dk4papea.h b/support/dktools/dk4papea.h
index fb7a926a50..fd4aabc813 100644
--- a/support/dktools/dk4papea.h
+++ b/support/dktools/dk4papea.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4papea.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4papea.ctr
*/
#ifndef DK4PAPEA_H_INCLUDED
@@ -43,12 +21,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4papea.h Paper sizes for applications.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4PAPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4paper.h"
+#else
+#include <dktools-4/dk4paper.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4paper.c b/support/dktools/dk4paper.c
index 0b29e51593..86038229fe 100644
--- a/support/dktools/dk4paper.c
+++ b/support/dktools/dk4paper.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4paper.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4paper.ctr
*/
/** @file dk4paper.c The dk4paper module.
*/
-#line 288 "dk4paper.ctr"
+#line 373 "dk4paper.ctr"
+#include "dk4conf.h"
#include "dk4mem.h"
#include "dk4strd.h"
#include "dk4paper.h"
@@ -52,12 +31,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4loc.h"
#include "dk4user.h"
#include "dk4inst.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 306 "dk4paper.ctr"
+#line 399 "dk4paper.ctr"
@@ -96,7 +82,7 @@ dkT("letter"),
NULL
-#line 335 "dk4paper.ctr"
+#line 428 "dk4paper.ctr"
};
@@ -106,16 +92,19 @@ dk4papersize_delete(dk4_paper_size_t *pps)
{
-#line 343 "dk4paper.ctr"
+#line 436 "dk4paper.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pps);
+#endif
if (NULL != pps) {
-#line 344 "dk4paper.ctr"
+#line 440 "dk4paper.ctr"
if (NULL != pps->name) {
-#line 345 "dk4paper.ctr"
+#line 441 "dk4paper.ctr"
-#line 346 "dk4paper.ctr"
+#line 442 "dk4paper.ctr"
dk4mem_free(pps->name);
pps->name = NULL;
}
@@ -124,12 +113,12 @@ dk4papersize_delete(dk4_paper_size_t *pps)
#if TRACE_DEBUG
else {
-#line 353 "dk4paper.ctr"
+#line 449 "dk4paper.ctr"
}
#endif
-#line 356 "dk4paper.ctr"
+#line 452 "dk4paper.ctr"
}
@@ -140,7 +129,10 @@ dk4papersize_new(const dkChar *name, dk4_er_t *erp)
dk4_paper_size_t *back = NULL;
-#line 365 "dk4paper.ctr"
+#line 461 "dk4paper.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL != name) {
back = dk4mem_new(dk4_paper_size_t,1,erp);
if (NULL != back) {
@@ -162,7 +154,7 @@ dk4papersize_new(const dkChar *name, dk4_er_t *erp)
}
-#line 385 "dk4paper.ctr"
+#line 484 "dk4paper.ctr"
return back;
}
@@ -175,22 +167,25 @@ dk4papersize_coll_close(dk4_paper_size_collection_t *ptr)
dk4_paper_size_t *pps;
-#line 396 "dk4paper.ctr"
+#line 495 "dk4paper.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
-#line 397 "dk4paper.ctr"
+#line 499 "dk4paper.ctr"
if (NULL != ptr->s_ps) {
-#line 398 "dk4paper.ctr"
+#line 500 "dk4paper.ctr"
if (NULL != ptr->i_ps) {
-#line 399 "dk4paper.ctr"
+#line 501 "dk4paper.ctr"
dk4sto_it_reset(ptr->i_ps);
do {
pps = (dk4_paper_size_t *)dk4sto_it_next(ptr->i_ps);
if (NULL != pps) {
-#line 403 "dk4paper.ctr"
+#line 505 "dk4paper.ctr"
dk4papersize_delete(pps);
}
} while (NULL != pps);
@@ -200,7 +195,7 @@ dk4papersize_coll_close(dk4_paper_size_collection_t *ptr)
#if TRACE_DEBUG
else {
-#line 411 "dk4paper.ctr"
+#line 513 "dk4paper.ctr"
}
#endif
dk4sto_close(ptr->s_ps);
@@ -209,23 +204,23 @@ dk4papersize_coll_close(dk4_paper_size_collection_t *ptr)
#if TRACE_DEBUG
else {
-#line 418 "dk4paper.ctr"
+#line 520 "dk4paper.ctr"
}
#endif
-#line 421 "dk4paper.ctr"
+#line 523 "dk4paper.ctr"
dk4mem_free(ptr);
}
#if TRACE_DEBUG
else {
-#line 425 "dk4paper.ctr"
+#line 527 "dk4paper.ctr"
}
#endif
-#line 428 "dk4paper.ctr"
+#line 530 "dk4paper.ctr"
}
@@ -285,38 +280,42 @@ dk4papersize_i_add_one_default_size(
int back = 0;
-#line 486 "dk4paper.ctr"
+#line 588 "dk4paper.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pscptr);
+ assert(NULL != name);
+#endif
ptr = dk4papersize_new(name, erp);
if (NULL != ptr) {
-#line 488 "dk4paper.ctr"
+#line 594 "dk4paper.ctr"
ptr->w = w; ptr->h = h; ptr->i = i; ptr->o = o; ptr->t = t; ptr->b = b;
-#line 490 "dk4paper.ctr"
+#line 596 "dk4paper.ctr"
-#line 491 "dk4paper.ctr"
+#line 597 "dk4paper.ctr"
-#line 492 "dk4paper.ctr"
+#line 598 "dk4paper.ctr"
-#line 493 "dk4paper.ctr"
+#line 599 "dk4paper.ctr"
-#line 494 "dk4paper.ctr"
+#line 600 "dk4paper.ctr"
-#line 495 "dk4paper.ctr"
+#line 601 "dk4paper.ctr"
if (0 != dk4sto_add(pscptr->s_ps, ptr, erp)) {
back = 1;
-#line 497 "dk4paper.ctr"
+#line 603 "dk4paper.ctr"
}
else {
-#line 499 "dk4paper.ctr"
+#line 605 "dk4paper.ctr"
dk4papersize_delete(ptr);
ptr = NULL;
}
@@ -324,12 +323,12 @@ dk4papersize_i_add_one_default_size(
#if TRACE_DEBUG
else {
-#line 505 "dk4paper.ctr"
+#line 611 "dk4paper.ctr"
}
#endif
-#line 508 "dk4paper.ctr"
+#line 614 "dk4paper.ctr"
return back;
}
@@ -345,7 +344,10 @@ dk4papersize_i_add_default_sizes(
int back = 0;
-#line 522 "dk4paper.ctr"
+#line 628 "dk4paper.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pscptr);
+#endif
back = dk4papersize_i_add_one_default_size(
pscptr, default_paper_sizes[0], 595.0, 842.0, 0.0, 0.0, 0.0, 0.0, erp
);
@@ -371,7 +373,7 @@ dk4papersize_i_add_default_sizes(
finished:
-#line 546 "dk4paper.ctr"
+#line 655 "dk4paper.ctr"
return back;
}
@@ -385,7 +387,7 @@ dk4papersize_coll_open(dk4_er_t *erp)
int ok = 0;
-#line 558 "dk4paper.ctr"
+#line 667 "dk4paper.ctr"
back = dk4mem_new(dk4_paper_size_collection_t,1,erp);
if (NULL != back) {
back->i_ps = NULL;
@@ -403,7 +405,7 @@ dk4papersize_coll_open(dk4_er_t *erp)
}
}
-#line 574 "dk4paper.ctr"
+#line 683 "dk4paper.ctr"
return back;
}
@@ -411,19 +413,46 @@ dk4papersize_coll_open(dk4_er_t *erp)
const dk4_paper_size_t *
-dk4papersize_coll_find(
+dk4papersize_coll_find_with_index(
dk4_paper_size_collection_t *ptr,
const dkChar *name,
+ size_t *ppsi,
dk4_er_t *erp
)
{
- dk4_paper_size_t *back = NULL;
+ dk4_paper_size_t *back = NULL;
+ dk4_paper_size_t const *psptr;
+ size_t i;
+ int found;
-#line 589 "dk4paper.ctr"
+#line 702 "dk4paper.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(NULL != name);
+#endif
if ((NULL != ptr) && (NULL != name)) {
back = (dk4_paper_size_t *)dk4sto_it_find_like(ptr->i_ps, name, 1);
- if (NULL == back) {
+ if (NULL != back) {
+ if (NULL != ppsi) {
+ found = 0;
+ i = 0;
+ dk4papersize_coll_reset(ptr);
+ do {
+ psptr = dk4papersize_coll_next(ptr);
+ if (NULL != psptr) {
+ if (NULL != psptr->name) {
+ if (0 == dk4str_cmp(name, psptr->name)) {
+ found = 1;
+ *ppsi = i;
+ }
+ }
+ }
+ i++;
+ } while ((NULL != psptr) && (0 == found));
+ }
+ }
+ else {
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
}
@@ -431,16 +460,35 @@ dk4papersize_coll_find(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 598 "dk4paper.ctr"
+#line 734 "dk4paper.ctr"
return ((const dk4_paper_size_t *)back);
}
+const dk4_paper_size_t *
+dk4papersize_coll_find(
+ dk4_paper_size_collection_t *ptr,
+ const dkChar *name,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(NULL != name);
+#endif
+ return (dk4papersize_coll_find_with_index(ptr, name, NULL, erp));
+}
+
+
+
double
dk4papersize_get_width(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->w;
}
@@ -453,6 +501,9 @@ double
dk4papersize_get_height(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->h;
}
@@ -465,6 +516,9 @@ double
dk4papersize_get_left_border(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->i;
}
@@ -477,6 +531,9 @@ double
dk4papersize_get_right_border(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->o;
}
@@ -489,6 +546,9 @@ double
dk4papersize_get_top_border(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->t;
}
@@ -501,6 +561,9 @@ double
dk4papersize_get_bottom_border(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->b;
}
@@ -513,6 +576,9 @@ const dkChar *
dk4papersize_get_name(const dk4_paper_size_t *psptr)
{
const dkChar *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->name;
}
@@ -525,6 +591,9 @@ size_t
dk4papersize_coll_size(dk4_paper_size_collection_t *ptr)
{
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4sto_it_reset(ptr->i_ps);
while (NULL != dk4sto_it_next(ptr->i_ps)) {
@@ -539,6 +608,9 @@ dk4papersize_coll_size(dk4_paper_size_collection_t *ptr)
void
dk4papersize_coll_reset(dk4_paper_size_collection_t *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4sto_it_reset(ptr->i_ps);
}
@@ -550,6 +622,9 @@ const dk4_paper_size_t *
dk4papersize_coll_next(dk4_paper_size_collection_t *ptr)
{
dk4_paper_size_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = (dk4_paper_size_t *)dk4sto_it_next(ptr->i_ps);
}
@@ -563,7 +638,9 @@ dk4papersize_coll_get(dk4_paper_size_collection_t *ptr, size_t n)
{
dk4_paper_size_t *back = NULL;
size_t i = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4sto_it_reset(ptr->i_ps);
do {
@@ -592,7 +669,7 @@ int
dk4papersize_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
+ dk4_um_t DK4_ARG_UNUSED(lineno),
dk4_er_t *erp
)
{
@@ -609,7 +686,8 @@ dk4papersize_line_handler(
int back = DK4_TSP_RES_OK;
-#line 774 "dk4paper.ctr"
+#line 958 "dk4paper.ctr"
+ DK4_UNUSED_ARG(lineno)
/* Retrieve pointers
*/
rdo = (reader_obj_t *)obj;
@@ -620,7 +698,7 @@ dk4papersize_line_handler(
pls = dk4str_start(line, NULL);
if (NULL == pls) {
-#line 783 "dk4paper.ctr"
+#line 968 "dk4paper.ctr"
goto finished;
}
/*
@@ -628,7 +706,7 @@ dk4papersize_line_handler(
*/
if (dkT('#') == *pls) {
-#line 789 "dk4paper.ctr"
+#line 974 "dk4paper.ctr"
goto finished;
}
/* Find value side
@@ -712,7 +790,7 @@ dk4papersize_line_handler(
finished:
-#line 871 "dk4paper.ctr"
+#line 1056 "dk4paper.ctr"
return back;
}
@@ -746,7 +824,11 @@ dk4paper_apply_file(
int back = 1;
-#line 903 "dk4paper.ctr"
+#line 1088 "dk4paper.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != coll);
+ assert(NULL != fn);
+#endif
/* Open input stream
*/
istrm = dk4stream_open_file_reader(fn, erp);
@@ -763,7 +845,13 @@ dk4paper_apply_file(
enc,
(
(DK4_ENCODING_UTF8 == enc) ?
- (DK4_FILE_ENCODING_UTF8) : (DK4_FILE_ENCODING_ASCII)
+ (DK4_FILE_ENCODING_UTF8) : (
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+ )
),
erp
);
@@ -775,43 +863,43 @@ dk4paper_apply_file(
do {
-#line 930 "dk4paper.ctr"
+#line 1125 "dk4paper.ctr"
cc = 0;
rb = sizeof(ib);
if (0 != dk4stream_read(ib, &rb, istrm, erp)) {
-#line 933 "dk4paper.ctr"
+#line 1128 "dk4paper.ctr"
if (0 < rb) {
-#line 934 "dk4paper.ctr"
+#line 1129 "dk4paper.ctr"
res = dk4tspdk_add_bytes(&tsp, (const unsigned char *)ib, rb);
if (DK4_TSP_RES_FATAL == res) {
-#line 936 "dk4paper.ctr"
+#line 1131 "dk4paper.ctr"
back = 0;
}
else {
-#line 939 "dk4paper.ctr"
+#line 1134 "dk4paper.ctr"
cc = 1;
}
}
#if TRACE_DEBUG
else {
-#line 944 "dk4paper.ctr"
+#line 1139 "dk4paper.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 949 "dk4paper.ctr"
+#line 1144 "dk4paper.ctr"
}
#endif
-#line 952 "dk4paper.ctr"
+#line 1147 "dk4paper.ctr"
} while (1 == cc);
/*
Finalize text stream processor
@@ -819,7 +907,7 @@ dk4paper_apply_file(
if (DK4_TSP_RES_FATAL != res) {
if (DK4_TSP_RES_FATAL == dk4tspdk_finish(&tsp)) {
-#line 958 "dk4paper.ctr"
+#line 1153 "dk4paper.ctr"
back = 0;
}
}
@@ -828,7 +916,7 @@ dk4paper_apply_file(
if (NULL != istrm) { dk4stream_close(istrm, NULL); }
-#line 965 "dk4paper.ctr"
+#line 1160 "dk4paper.ctr"
return back;
}
@@ -852,34 +940,38 @@ dk4papersize_coll_for_application(
int ok; /* Flag: No error */
-#line 987 "dk4paper.ctr"
+#line 1182 "dk4paper.ctr"
/* Create default collection
*/
+#if DK4_USE_ASSERT
+ assert(NULL != progname);
+ assert(NULL != grpname);
+#endif
back = dk4papersize_coll_open(erp);
if (NULL == back) {
-#line 991 "dk4paper.ctr"
+#line 1190 "dk4paper.ctr"
goto finished;
}
-#line 993 "dk4paper.ctr"
+#line 1192 "dk4paper.ctr"
/* Check program and program group name
*/
if ((NULL == progname) || (NULL == grpname)) {
-#line 996 "dk4paper.ctr"
+#line 1195 "dk4paper.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
}
-#line 999 "dk4paper.ctr"
+#line 1198 "dk4paper.ctr"
/* Find users home directory.
*/
if (0 == dk4user_get_homedir(home, DK4_SIZEOF(home,dkChar), 0, NULL)) {
goto finished;
}
-#line 1004 "dk4paper.ctr"
+#line 1203 "dk4paper.ctr"
/* Find encoding
*/
res = dk4loc_get_settings(
@@ -887,12 +979,16 @@ dk4papersize_coll_for_application(
&enc, NULL
);
-#line 1010 "dk4paper.ctr"
+#line 1209 "dk4paper.ctr"
if (0 == res) {
- enc = DK4_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ enc = DK4_ENCODING_WIN1252;
+#else
+ enc = DK4_ENCODING_PLAIN;
+#endif
}
-#line 1013 "dk4paper.ctr"
+#line 1216 "dk4paper.ctr"
/* Apply configuration files from build-in directory names
*/
ok = 1;
@@ -901,36 +997,36 @@ dk4papersize_coll_for_application(
res = dk4fs_config_compat_one(
fnb, DK4_SIZEOF(fnb,dkChar), conf_file_names[1],
dk4inst_get_directory(2), dk4inst_get_directory(1), home,
- progname, grpname, i, 1, 1, NULL
+ progname, grpname, (int)i, 1, 1, NULL
);
if (0 != res) {
-#line 1024 "dk4paper.ctr"
+#line 1227 "dk4paper.ctr"
if (0 == dk4paper_apply_file(back, fnb, enc, erp)) {
ok = 0;
-#line 1026 "dk4paper.ctr"
+#line 1229 "dk4paper.ctr"
}
}
#endif
res = dk4fs_config_one(
fnb, DK4_SIZEOF(fnb,dkChar), conf_file_names[0],
dk4inst_get_directory(2), dk4inst_get_directory(1), home,
- progname, grpname, i, 1, NULL
+ progname, grpname, (int)i, 1, NULL
);
if (0 != res) {
-#line 1035 "dk4paper.ctr"
+#line 1238 "dk4paper.ctr"
if (0 == dk4paper_apply_file(back, fnb, enc, erp)) {
ok = 0;
-#line 1037 "dk4paper.ctr"
+#line 1240 "dk4paper.ctr"
}
}
}
if (0 == ok) {
-#line 1041 "dk4paper.ctr"
+#line 1244 "dk4paper.ctr"
dk4papersize_coll_close(back);
back = NULL;
}
@@ -938,7 +1034,81 @@ dk4papersize_coll_for_application(
finished:
-#line 1047 "dk4paper.ctr"
+#line 1250 "dk4paper.ctr"
+ return back;
+}
+
+
+
+double
+dk4paper_difference(dk4_paper_size_t const *l, dk4_paper_size_t const *r)
+{
+ double back = 0.0;
+ double value = 0.0;
+#if DK4_USE_ASSERT
+ assert(NULL != l);
+ assert(NULL != r);
+#endif
+ if ((NULL != l) && (NULL != r)) {
+ back = fabs(l->w - r->w);
+ value = fabs(l->h - r->h); if (value > back) { back = value; }
+ value = fabs(l->i - r->i); if (value > back) { back = value; }
+ value = fabs(l->o - r->o); if (value > back) { back = value; }
+ value = fabs(l->t - r->t); if (value > back) { back = value; }
+ value = fabs(l->b - r->b); if (value > back) { back = value; }
+ }
+ return back;
+}
+
+
+
+int
+dk4paper_find_nearest(
+ size_t *pres,
+ dk4_paper_size_t *a,
+ size_t sza,
+ dk4_paper_size_t *vptr,
+ dk4_er_t *erp
+)
+{
+ double mindiff = 0.0; /* Minimum difference so far */
+ double thisdiff = 0.0; /* Difference for current size */
+ size_t i; /* Current array index to test */
+ size_t minind = 0; /* Index of minimum array element */
+ int back = 0;
+
+
+#line 1292 "dk4paper.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pres);
+ assert(NULL != a);
+ assert(0 < sza);
+ assert(NULL != vptr);
+#endif
+ if ((NULL != pres) && (NULL != a) && (0 < sza) && (NULL != vptr)) {
+ for (i = 0; i < sza; i++) {
+ thisdiff = dk4paper_difference(a, vptr);
+ if (0 == i) {
+ minind = 0;
+ mindiff = thisdiff;
+ }
+ else {
+ if (thisdiff < mindiff) {
+ mindiff = thisdiff;
+ minind = i;
+ }
+ }
+ a++;
+ }
+ *pres = minind;
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1320 "dk4paper.ctr"
return back;
}
diff --git a/support/dktools/dk4paper.ctr b/support/dktools/dk4paper.ctr
index 81055ba1be..448cd2c8a0 100644
--- a/support/dktools/dk4paper.ctr
+++ b/support/dktools/dk4paper.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,19 +11,47 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
@@ -111,6 +139,34 @@ dk4papersize_coll_find(
);
+/** Find a specific paper size in the collection, retrieve index in collection.
+ Note: Do not mix search and traversal mechanism, use exactly
+ one method from the following three:
+ - Find paper size entry by name using dk4papersize_coll_find(),
+ - Get number of paper sizes using dk4papersize_coll_size() and use
+ dk4papersize_coll_get() to get an entry for a given index,
+ - Reset the collection using dk4papersize_coll_reset() and retrieve
+ the next entry using dk4papersize_coll_next(), repeat
+ dk4papersize_coll_next() until it returns NULL.
+ All three methods use and modify the same internal container iterator,
+ so mixing the methods is not a good idea.
+ @param ptr Paper size collection to search for a paper size.
+ @param name Name of paper size to find.
+ @param ppsi Address of variable to store the index of the named
+ paper size within the collection, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Pointer to paper size on success, NULL on error or not found.
+*/
+
+const dk4_paper_size_t *
+dk4papersize_coll_find_with_index(
+ dk4_paper_size_collection_t *ptr,
+ const dkChar *name,
+ size_t *ppsi,
+ dk4_er_t *erp
+);
+
+
/** Get number of paper sizes stored in the collection.
Note: Do not mix search and traversal mechanism, use exactly
one method from the following three:
@@ -278,6 +334,35 @@ dk4papersize_get_bottom_border(const dk4_paper_size_t *psptr);
const dkChar *
dk4papersize_get_name(const dk4_paper_size_t *psptr);
+
+/** Find maximum difference between to paper sizes.
+ @param l Left paper size.
+ @param r Right paper size.
+ @return Maximum difference of corresponding values.
+*/
+
+double
+dk4paper_difference(dk4_paper_size_t const *l, dk4_paper_size_t const *r);
+
+
+/** Find index of array element nearest to a given paper size.
+ @param pres Address of result variable.
+ @param a Array of paper sizes to test.
+ @param sza Size of array a (number of elements).
+ @param vptr Paper size to search for.
+ @param erp Error report, may be NULL.
+ @return 1 on success (pres variable was set), 0 on error.
+*/
+
+int
+dk4paper_find_nearest(
+ size_t *pres,
+ dk4_paper_size_t *a,
+ size_t sza,
+ dk4_paper_size_t *vptr,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
@@ -286,6 +371,7 @@ dk4papersize_get_name(const dk4_paper_size_t *psptr);
/* vim: set ai sw=4 ts=4 : */
%% module
+#include "dk4conf.h"
#include "dk4mem.h"
#include "dk4strd.h"
#include "dk4paper.h"
@@ -299,7 +385,14 @@ dk4papersize_get_name(const dk4_paper_size_t *psptr);
#include "dk4loc.h"
#include "dk4user.h"
#include "dk4inst.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -340,6 +433,9 @@ void
dk4papersize_delete(dk4_paper_size_t *pps)
{
$? "+ dk4papersize_delete"
+#if DK4_USE_ASSERT
+ assert(NULL != pps);
+#endif
if (NULL != pps) { $? ". args ok"
if (NULL != pps->name) { $? ". name=\"%!ds\"", pps->name
$? ". w=%g h=%g l=%g r=%g t=%g, b=%g", pps->w, pps->h, pps->i, pps->o, pps->t, pps->b
@@ -362,6 +458,9 @@ dk4papersize_new(const dkChar *name, dk4_er_t *erp)
{
dk4_paper_size_t *back = NULL;
$? "+ dk4papersize_new \"%!ds\"", TR_STR(name)
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+#endif
if (NULL != name) {
back = dk4mem_new(dk4_paper_size_t,1,erp);
if (NULL != back) {
@@ -393,6 +492,9 @@ dk4papersize_coll_close(dk4_paper_size_collection_t *ptr)
{
dk4_paper_size_t *pps;
$? "+ dk4papersize_coll_close %d", TR_IPTR(ptr)
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) { $? ". ptr ok"
if (NULL != ptr->s_ps) { $? ". s_ps ok"
if (NULL != ptr->i_ps) { $? ". i_ps ok"
@@ -483,6 +585,10 @@ dk4papersize_i_add_one_default_size(
dk4_paper_size_t *ptr;
int back = 0;
$? "+ dk4papersize_i_add_one_default_size \"%!ds\"", name
+#if DK4_USE_ASSERT
+ assert(NULL != pscptr);
+ assert(NULL != name);
+#endif
ptr = dk4papersize_new(name, erp);
if (NULL != ptr) { $? ". ptr"
ptr->w = w; ptr->h = h; ptr->i = i; ptr->o = o; ptr->t = t; ptr->b = b;
@@ -519,6 +625,9 @@ dk4papersize_i_add_default_sizes(
{
int back = 0;
$? "+ dk4papersize_i_add_default_sizes"
+#if DK4_USE_ASSERT
+ assert(NULL != pscptr);
+#endif
back = dk4papersize_i_add_one_default_size(
pscptr, default_paper_sizes[0], 595.0, 842.0, 0.0, 0.0, 0.0, 0.0, erp
);
@@ -578,17 +687,44 @@ dk4papersize_coll_open(dk4_er_t *erp)
const dk4_paper_size_t *
-dk4papersize_coll_find(
+dk4papersize_coll_find_with_index(
dk4_paper_size_collection_t *ptr,
const dkChar *name,
+ size_t *ppsi,
dk4_er_t *erp
)
{
- dk4_paper_size_t *back = NULL;
+ dk4_paper_size_t *back = NULL;
+ dk4_paper_size_t const *psptr;
+ size_t i;
+ int found;
$? "+ dk4papersize_coll_find %d \"%!ds\"", TR_IPTR(ptr), TR_STR(name)
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(NULL != name);
+#endif
if ((NULL != ptr) && (NULL != name)) {
back = (dk4_paper_size_t *)dk4sto_it_find_like(ptr->i_ps, name, 1);
- if (NULL == back) {
+ if (NULL != back) {
+ if (NULL != ppsi) {
+ found = 0;
+ i = 0;
+ dk4papersize_coll_reset(ptr);
+ do {
+ psptr = dk4papersize_coll_next(ptr);
+ if (NULL != psptr) {
+ if (NULL != psptr->name) {
+ if (0 == dk4str_cmp(name, psptr->name)) {
+ found = 1;
+ *ppsi = i;
+ }
+ }
+ }
+ i++;
+ } while ((NULL != psptr) && (0 == found));
+ }
+ }
+ else {
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
}
@@ -600,10 +736,29 @@ dk4papersize_coll_find(
+const dk4_paper_size_t *
+dk4papersize_coll_find(
+ dk4_paper_size_collection_t *ptr,
+ const dkChar *name,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(NULL != name);
+#endif
+ return (dk4papersize_coll_find_with_index(ptr, name, NULL, erp));
+}
+
+
+
double
dk4papersize_get_width(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->w;
}
@@ -616,6 +771,9 @@ double
dk4papersize_get_height(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->h;
}
@@ -628,6 +786,9 @@ double
dk4papersize_get_left_border(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->i;
}
@@ -640,6 +801,9 @@ double
dk4papersize_get_right_border(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->o;
}
@@ -652,6 +816,9 @@ double
dk4papersize_get_top_border(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->t;
}
@@ -664,6 +831,9 @@ double
dk4papersize_get_bottom_border(const dk4_paper_size_t *psptr)
{
double back = -1.0;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->b;
}
@@ -676,6 +846,9 @@ const dkChar *
dk4papersize_get_name(const dk4_paper_size_t *psptr)
{
const dkChar *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != psptr);
+#endif
if (NULL != psptr) {
back = psptr->name;
}
@@ -688,6 +861,9 @@ size_t
dk4papersize_coll_size(dk4_paper_size_collection_t *ptr)
{
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4sto_it_reset(ptr->i_ps);
while (NULL != dk4sto_it_next(ptr->i_ps)) {
@@ -702,6 +878,9 @@ dk4papersize_coll_size(dk4_paper_size_collection_t *ptr)
void
dk4papersize_coll_reset(dk4_paper_size_collection_t *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4sto_it_reset(ptr->i_ps);
}
@@ -713,6 +892,9 @@ const dk4_paper_size_t *
dk4papersize_coll_next(dk4_paper_size_collection_t *ptr)
{
dk4_paper_size_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = (dk4_paper_size_t *)dk4sto_it_next(ptr->i_ps);
}
@@ -726,7 +908,9 @@ dk4papersize_coll_get(dk4_paper_size_collection_t *ptr, size_t n)
{
dk4_paper_size_t *back = NULL;
size_t i = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4sto_it_reset(ptr->i_ps);
do {
@@ -755,7 +939,7 @@ int
dk4papersize_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
+ dk4_um_t DK4_ARG_UNUSED(lineno),
dk4_er_t *erp
)
{
@@ -771,6 +955,7 @@ dk4papersize_line_handler(
size_t i; /* traverse tokens */
int back = DK4_TSP_RES_OK;
$? "+ dk4papersize_line_handler \"%!ds\"", line
+ DK4_UNUSED_ARG(lineno)
/* Retrieve pointers
*/
rdo = (reader_obj_t *)obj;
@@ -900,6 +1085,10 @@ dk4paper_apply_file(
int res = 0;
int back = 1;
$? "+ dk4paper_apply_file \"%!ds\"", fn
+#if DK4_USE_ASSERT
+ assert(NULL != coll);
+ assert(NULL != fn);
+#endif
/* Open input stream
*/
istrm = dk4stream_open_file_reader(fn, erp);
@@ -916,7 +1105,13 @@ dk4paper_apply_file(
enc,
(
(DK4_ENCODING_UTF8 == enc) ?
- (DK4_FILE_ENCODING_UTF8) : (DK4_FILE_ENCODING_ASCII)
+ (DK4_FILE_ENCODING_UTF8) : (
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+ )
),
erp
);
@@ -986,6 +1181,10 @@ dk4papersize_coll_for_application(
$? "+ dk4_paper_size_collection_t"
/* Create default collection
*/
+#if DK4_USE_ASSERT
+ assert(NULL != progname);
+ assert(NULL != grpname);
+#endif
back = dk4papersize_coll_open(erp);
if (NULL == back) { $? "! memory"
goto finished;
@@ -1008,7 +1207,11 @@ dk4papersize_coll_for_application(
&enc, NULL
); $? ". enc = %d", enc
if (0 == res) {
- enc = DK4_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ enc = DK4_ENCODING_WIN1252;
+#else
+ enc = DK4_ENCODING_PLAIN;
+#endif
} $? ". enc = %d", enc
/* Apply configuration files from build-in directory names
*/
@@ -1018,7 +1221,7 @@ dk4papersize_coll_for_application(
res = dk4fs_config_compat_one(
fnb, DK4_SIZEOF(fnb,dkChar), conf_file_names[1],
dk4inst_get_directory(2), dk4inst_get_directory(1), home,
- progname, grpname, i, 1, 1, NULL
+ progname, grpname, (int)i, 1, 1, NULL
);
if (0 != res) { $? ". apply \"%!ds\"", fnb
if (0 == dk4paper_apply_file(back, fnb, enc, erp)) {
@@ -1029,7 +1232,7 @@ dk4papersize_coll_for_application(
res = dk4fs_config_one(
fnb, DK4_SIZEOF(fnb,dkChar), conf_file_names[0],
dk4inst_get_directory(2), dk4inst_get_directory(1), home,
- progname, grpname, i, 1, NULL
+ progname, grpname, (int)i, 1, NULL
);
if (0 != res) { $? ". apply \"%!ds\"", fnb
if (0 == dk4paper_apply_file(back, fnb, enc, erp)) {
@@ -1049,5 +1252,75 @@ dk4papersize_coll_for_application(
+double
+dk4paper_difference(dk4_paper_size_t const *l, dk4_paper_size_t const *r)
+{
+ double back = 0.0;
+ double value = 0.0;
+#if DK4_USE_ASSERT
+ assert(NULL != l);
+ assert(NULL != r);
+#endif
+ if ((NULL != l) && (NULL != r)) {
+ back = fabs(l->w - r->w);
+ value = fabs(l->h - r->h); if (value > back) { back = value; }
+ value = fabs(l->i - r->i); if (value > back) { back = value; }
+ value = fabs(l->o - r->o); if (value > back) { back = value; }
+ value = fabs(l->t - r->t); if (value > back) { back = value; }
+ value = fabs(l->b - r->b); if (value > back) { back = value; }
+ }
+ return back;
+}
+
+
+
+int
+dk4paper_find_nearest(
+ size_t *pres,
+ dk4_paper_size_t *a,
+ size_t sza,
+ dk4_paper_size_t *vptr,
+ dk4_er_t *erp
+)
+{
+ double mindiff = 0.0; /* Minimum difference so far */
+ double thisdiff = 0.0; /* Difference for current size */
+ size_t i; /* Current array index to test */
+ size_t minind = 0; /* Index of minimum array element */
+ int back = 0;
+ $? "+ dk4paper_find_nearest"
+#if DK4_USE_ASSERT
+ assert(NULL != pres);
+ assert(NULL != a);
+ assert(0 < sza);
+ assert(NULL != vptr);
+#endif
+ if ((NULL != pres) && (NULL != a) && (0 < sza) && (NULL != vptr)) {
+ for (i = 0; i < sza; i++) {
+ thisdiff = dk4paper_difference(a, vptr);
+ if (0 == i) {
+ minind = 0;
+ mindiff = thisdiff;
+ }
+ else {
+ if (thisdiff < mindiff) {
+ mindiff = thisdiff;
+ minind = i;
+ }
+ }
+ a++;
+ }
+ *pres = minind;
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4paper_find_nearest %d", back
+ return back;
+}
+
+
+
/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4paper.h b/support/dktools/dk4paper.h
index 6afcd696ec..82370f7bbb 100644
--- a/support/dktools/dk4paper.h
+++ b/support/dktools/dk4paper.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4paper.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4paper.ctr
*/
#ifndef DK4PAPER_H_INCLUDED
@@ -44,19 +22,47 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
@@ -144,6 +150,34 @@ dk4papersize_coll_find(
);
+/** Find a specific paper size in the collection, retrieve index in collection.
+ Note: Do not mix search and traversal mechanism, use exactly
+ one method from the following three:
+ - Find paper size entry by name using dk4papersize_coll_find(),
+ - Get number of paper sizes using dk4papersize_coll_size() and use
+ dk4papersize_coll_get() to get an entry for a given index,
+ - Reset the collection using dk4papersize_coll_reset() and retrieve
+ the next entry using dk4papersize_coll_next(), repeat
+ dk4papersize_coll_next() until it returns NULL.
+ All three methods use and modify the same internal container iterator,
+ so mixing the methods is not a good idea.
+ @param ptr Paper size collection to search for a paper size.
+ @param name Name of paper size to find.
+ @param ppsi Address of variable to store the index of the named
+ paper size within the collection, may be NULL.
+ @param erp Error report, may be NULL.
+ @return Pointer to paper size on success, NULL on error or not found.
+*/
+
+const dk4_paper_size_t *
+dk4papersize_coll_find_with_index(
+ dk4_paper_size_collection_t *ptr,
+ const dkChar *name,
+ size_t *ppsi,
+ dk4_er_t *erp
+);
+
+
/** Get number of paper sizes stored in the collection.
Note: Do not mix search and traversal mechanism, use exactly
one method from the following three:
@@ -311,6 +345,35 @@ dk4papersize_get_bottom_border(const dk4_paper_size_t *psptr);
const dkChar *
dk4papersize_get_name(const dk4_paper_size_t *psptr);
+
+/** Find maximum difference between to paper sizes.
+ @param l Left paper size.
+ @param r Right paper size.
+ @return Maximum difference of corresponding values.
+*/
+
+double
+dk4paper_difference(dk4_paper_size_t const *l, dk4_paper_size_t const *r);
+
+
+/** Find index of array element nearest to a given paper size.
+ @param pres Address of result variable.
+ @param a Array of paper sizes to test.
+ @param sza Size of array a (number of elements).
+ @param vptr Paper size to search for.
+ @param erp Error report, may be NULL.
+ @return 1 on success (pres variable was set), 0 on error.
+*/
+
+int
+dk4paper_find_nearest(
+ size_t *pres,
+ dk4_paper_size_t *a,
+ size_t sza,
+ dk4_paper_size_t *vptr,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4path8.c b/support/dktools/dk4path8.c
index 7507a2ea6f..66c3cfacb9 100644
--- a/support/dktools/dk4path8.c
+++ b/support/dktools/dk4path8.c
@@ -1,48 +1,28 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4path8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4path8.ctr
*/
/** @file dk4path8.c The dk4path8 module.
*/
-#line 109 "dk4path8.ctr"
+#line 248 "dk4path8.ctr"
+#include "dk4conf.h"
#include "dk4path8.h"
#include "dk4mem.h"
#include "dk4str8.h"
+#include "dk4maasz.h"
#if DK4_HAVE_STRING_H
#ifndef STRING_H_INCLUDED
@@ -51,6 +31,23 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
+
+
+
+
+#line 275 "dk4path8.ctr"
+
+
+
/** Constant keywords used by the dk4path8 module.
*/
static const char * const dk4path8_kw[] = {
@@ -79,6 +76,9 @@ char
dk4path8_lastchar(const char *str)
{
char back = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+#endif
if (str) { while ('\0' != *str) { back = *(str++); } }
return back;
}
@@ -92,6 +92,9 @@ dk4path8_is_absolute(const char *path)
#if DK4_ON_WINDOWS
char c;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
c = *path;
@@ -122,6 +125,9 @@ int
dk4path8_is_relative(const char *path)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
if (NULL != dk4str8_chr(path, *(dk4path8_kw[0]))) {
if (0 == dk4path8_is_absolute(path)) {
@@ -148,6 +154,11 @@ dk4path8_append(char *buffer, size_t sz, const char *filename, dk4_er_t *erp)
int failed = 0; /* Definitely failed */
char lch; /* Last character from string */
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != filename);
+#endif
if ((NULL != buffer) && (NULL != filename) && (0 < sz)) {
mycp = dk4str8_dup(filename, erp);
if (NULL != mycp) {
@@ -228,6 +239,9 @@ char *
dk4path8_get_suffix(const char *filename, dk4_er_t *erp)
{
const char *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while ('\0' != *filename) {
if (('\\' == *filename) || ('/' == *filename)) {
@@ -253,6 +267,9 @@ dk4path8_get_suffix(const char *filename, dk4_er_t *erp)
void
dk4path8_correct_sep(char *filename)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while ('\0' != *filename) {
#if DK4_HAVE_BACKSLASH_AS_SEP
@@ -268,10 +285,19 @@ dk4path8_correct_sep(char *filename)
int
-dk4path8_must_expand(const char *filename)
+dk4path8_must_expand(
+#if DK4_ON_WINDOWS
+ const char *filename
+#else
+ const char * DK4_ARG_UNUSED(filename)
+#endif
+)
{
#if DK4_ON_WINDOWS
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while(('\0' != *filename) && (0 == back)) {
switch (*filename) {
@@ -286,7 +312,248 @@ dk4path8_must_expand(const char *filename)
}
return back;
#else
+ DK4_UNUSED_ARG(filename)
return 0;
#endif
}
+
+
+int
+dk4path8_set_suffix(
+ char *pdst,
+ size_t szdst,
+ char const *srcname,
+ char const *newsu,
+ dk4_er_t *erp
+)
+{
+ char *sp = NULL;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+ if ((NULL == pdst) || (NULL == srcname) || (NULL == newsu) || (0 == szdst)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 == dk4str8_cpy_s(pdst, szdst, srcname, erp)) {
+ goto finished;
+ }
+ sp = dk4path8_get_suffix(pdst, NULL);
+ if (NULL != sp) {
+ *sp = '\0';
+ }
+ back = dk4str8_cat_s(pdst, szdst, newsu, erp);
+
+ finished:
+ return back;
+}
+
+
+
+char *
+dk4path8_dup_change_suffix(
+ char const *srcname,
+ char const *newsu,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ char *sp;
+ char *back = NULL;
+ size_t lold;
+ size_t lsuff;
+ size_t lnew;
+
+#if DK4_USE_ASSERT
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+ if ((NULL == srcname) || (NULL == newsu)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ sp = dk4path8_get_suffix(srcname, NULL);
+ lold = strlen(srcname);
+ lsuff = 0;
+ if (NULL != sp) {
+ lsuff = strlen(sp);
+ }
+ if (lsuff > lold) {
+ /* BUG */
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ goto finished;
+ }
+ lold -= lsuff;
+ lsuff = strlen(newsu);
+ dk4error_init(&er);
+ lnew = dk4ma_size_t_add(lold, lsuff, &er);
+ lnew = dk4ma_size_t_add(lnew, 1, &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ goto finished;
+ }
+ back = dk4mem_new(char,lnew,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* 2018-04-04 Bugfix
+ The new file name may be shorter than the original
+ file name, so we must not copy the original name
+ into the new buffer!
+ */
+#if 0
+ /* 2018-04-04 Performance
+ Performance should be better using strncpy.
+ */
+ for (i = 0; i < lold; i++) { back[i] = srcname[i]; }
+#endif
+#if 0
+ strncpy(back, srcname, lold);
+#endif
+ DK4_MEMCPY(back,srcname,lold);
+ back[lold] = '\0';
+ strcat(back, newsu);
+ finished:
+ return back;
+}
+
+
+
+size_t
+dk4path8_concatenate_size(
+ char const *dirname,
+ char const *filename,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Test for math overflow */
+ size_t back = 0; /* Function result */
+ size_t sldir = 0; /* Length of dirname */
+ size_t slfil = 0; /* Length of filename */
+ size_t toadd = 2; /* Path separator and finalizer byte */
+
+
+#line 667 "dk4path8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dirname);
+ assert(NULL != filename);
+#endif
+ if ((NULL != dirname) && (NULL != filename)) {
+ sldir = dk4str8_len(dirname);
+ slfil = dk4str8_len(filename);
+ if (0 < sldir) {
+ if (*(dk4path8_kw[0]) == dirname[sldir - 1]) { toadd = 1; }
+ }
+ dk4error_init(&er);
+ back = dk4ma_size_t_add( dk4ma_size_t_add(sldir, slfil, &er), toadd, &er );
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ back = 0;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 688 "dk4path8.ctr"
+ return back;
+}
+
+
+
+int
+dk4path8_concatenate_buffer(
+ char *buffer,
+ size_t szbuf,
+ char const *dirn,
+ char const *filen,
+ dk4_er_t *erp
+)
+{
+ size_t sld;
+ int back = 0;
+ int sep = 1;
+
+
+#line 706 "dk4path8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+ if ((NULL != buffer) && (NULL != dirn) && (NULL != filen) && (0 != szbuf)) {
+ sld = dk4str8_len(dirn);
+ if (0 < sld) { if (dirn[sld - 1] == *(dk4path8_kw[0])) { sep = 0; } }
+ back = dk4str8_cpy_s(buffer, szbuf, dirn, erp);
+ if (0 != back) {
+ if (0 != sep) {
+ back = dk4str8_cat_s(buffer, szbuf, dk4path8_kw[0], erp);
+ }
+ }
+ if (0 != back) {
+ back = dk4str8_cat_s(buffer, szbuf, filen, erp);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if ((0 == back) && (NULL != buffer) && (0 < szbuf)) { buffer[0] = '\0'; }
+
+
+#line 730 "dk4path8.ctr"
+ return back;
+}
+
+
+
+char *
+dk4path8_concatenate_new(
+ char const *dirn,
+ char const *filen,
+ dk4_er_t *erp
+)
+{
+ char *back = NULL;
+ size_t bl = 0;
+
+
+#line 745 "dk4path8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+ if ((NULL != dirn) && (NULL != filen)) {
+ bl = dk4path8_concatenate_size(dirn, filen, erp);
+ if (0 != bl) {
+ back = dk4mem_new(char,bl,erp);
+ if (NULL != back) {
+ if (0 == dk4path8_concatenate_buffer(back, bl, dirn, filen, erp)) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ if (NULL != back) {
+
+
+#line 761 "dk4path8.ctr"
+ }
+#endif
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 770 "dk4path8.ctr"
+ return back;
+}
+
diff --git a/support/dktools/dk4path8.ctr b/support/dktools/dk4path8.ctr
index d02ca90d65..b64d3c375d 100644
--- a/support/dktools/dk4path8.ctr
+++ b/support/dktools/dk4path8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -46,6 +58,7 @@ int
dk4path8_is_relative(const char *path);
/** Append path filename to path name already stored in buffer.
+ Resolve . and .. for current directory and parent directory.
CRT on Windows: Optional, disabling CRT degrades performance.
@param buffer Buffer already containing a path.
@param sz Buffer size.
@@ -99,6 +112,132 @@ dk4path8_correct_sep(char *filename);
int
dk4path8_must_expand(const char *filename);
+/** Create file name with specified suffix.
+ @param pdst Destination buffer.
+ @param szdst Size of pdst.
+ @param srcname Source file name.
+ @param newsu New file suffix.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdst or srcname or newsu is NULL or szdst is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dst buffer is too small.
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+*/
+int
+dk4path8_set_suffix(
+ char *pdst,
+ size_t szdst,
+ char const *srcname,
+ char const *newsu,
+ dk4_er_t *erp
+);
+
+/** Create a dynamic copy of a file name with changed suffix.
+ @param srcname Old file name.
+ @param newsu New suffix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to changed file name on success, NULL on error.
+ On success call dk4mem_free() on the pointer when no longer needed
+ to release the memory.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if srcname or newsu is NULL,
+ - DK4_E_BUG<br>
+ if a bug occured,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+char *
+dk4path8_dup_change_suffix(
+ char const *srcname,
+ char const *newsu,
+ dk4_er_t *erp
+);
+
+/** Calculate buffer size required to concatenate a directory
+ name and a file name.
+ @param dirname Directory name.
+ @param filename File name.
+ @param erp Error report, may be NULL.
+ @return Buffer size for concatenated names including the finalizer
+ byte on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirname or filename is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the calculation results in a numeric overflow.
+*/
+size_t
+dk4path8_concatenate_size(
+ char const *dirname,
+ char const *filename,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into an existing buffer.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param buffer Result buffer for combined file name.
+ @param szbuf Buffer size.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4path8_concatenate_buffer(
+ char *buffer,
+ size_t szbuf,
+ char const *dirn,
+ char const *filen,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into newly
+ allocated memory.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing the
+ concatenation on success, NULL on error.
+ On success use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirn or filen is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+char *
+dk4path8_concatenate_new(
+ char const *dirn,
+ char const *filen,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
@@ -108,9 +247,11 @@ dk4path8_must_expand(const char *filename);
%% module
+#include "dk4conf.h"
#include "dk4path8.h"
#include "dk4mem.h"
#include "dk4str8.h"
+#include "dk4maasz.h"
#if DK4_HAVE_STRING_H
#ifndef STRING_H_INCLUDED
@@ -119,6 +260,21 @@ dk4path8_must_expand(const char *filename);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
+
+
+$!trace-include
+
+
+
/** Constant keywords used by the dk4path8 module.
*/
static const char * const dk4path8_kw[] = {
@@ -147,6 +303,9 @@ char
dk4path8_lastchar(const char *str)
{
char back = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+#endif
if (str) { while ('\0' != *str) { back = *(str++); } }
return back;
}
@@ -160,6 +319,9 @@ dk4path8_is_absolute(const char *path)
#if DK4_ON_WINDOWS
char c;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
c = *path;
@@ -190,6 +352,9 @@ int
dk4path8_is_relative(const char *path)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
if (NULL != dk4str8_chr(path, *(dk4path8_kw[0]))) {
if (0 == dk4path8_is_absolute(path)) {
@@ -216,6 +381,11 @@ dk4path8_append(char *buffer, size_t sz, const char *filename, dk4_er_t *erp)
int failed = 0; /* Definitely failed */
char lch; /* Last character from string */
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != filename);
+#endif
if ((NULL != buffer) && (NULL != filename) && (0 < sz)) {
mycp = dk4str8_dup(filename, erp);
if (NULL != mycp) {
@@ -296,6 +466,9 @@ char *
dk4path8_get_suffix(const char *filename, dk4_er_t *erp)
{
const char *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while ('\0' != *filename) {
if (('\\' == *filename) || ('/' == *filename)) {
@@ -321,6 +494,9 @@ dk4path8_get_suffix(const char *filename, dk4_er_t *erp)
void
dk4path8_correct_sep(char *filename)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while ('\0' != *filename) {
#if DK4_HAVE_BACKSLASH_AS_SEP
@@ -336,10 +512,19 @@ dk4path8_correct_sep(char *filename)
int
-dk4path8_must_expand(const char *filename)
+dk4path8_must_expand(
+#if DK4_ON_WINDOWS
+ const char *filename
+#else
+ const char * DK4_ARG_UNUSED(filename)
+#endif
+)
{
#if DK4_ON_WINDOWS
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while(('\0' != *filename) && (0 == back)) {
switch (*filename) {
@@ -354,7 +539,234 @@ dk4path8_must_expand(const char *filename)
}
return back;
#else
+ DK4_UNUSED_ARG(filename)
return 0;
#endif
}
+
+
+int
+dk4path8_set_suffix(
+ char *pdst,
+ size_t szdst,
+ char const *srcname,
+ char const *newsu,
+ dk4_er_t *erp
+)
+{
+ char *sp = NULL;
+ int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+ if ((NULL == pdst) || (NULL == srcname) || (NULL == newsu) || (0 == szdst)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 == dk4str8_cpy_s(pdst, szdst, srcname, erp)) {
+ goto finished;
+ }
+ sp = dk4path8_get_suffix(pdst, NULL);
+ if (NULL != sp) {
+ *sp = '\0';
+ }
+ back = dk4str8_cat_s(pdst, szdst, newsu, erp);
+
+ finished:
+ return back;
+}
+
+
+
+char *
+dk4path8_dup_change_suffix(
+ char const *srcname,
+ char const *newsu,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ char *sp;
+ char *back = NULL;
+ size_t lold;
+ size_t lsuff;
+ size_t lnew;
+
+#if DK4_USE_ASSERT
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+ if ((NULL == srcname) || (NULL == newsu)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ sp = dk4path8_get_suffix(srcname, NULL);
+ lold = strlen(srcname);
+ lsuff = 0;
+ if (NULL != sp) {
+ lsuff = strlen(sp);
+ }
+ if (lsuff > lold) {
+ /* BUG */
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ goto finished;
+ }
+ lold -= lsuff;
+ lsuff = strlen(newsu);
+ dk4error_init(&er);
+ lnew = dk4ma_size_t_add(lold, lsuff, &er);
+ lnew = dk4ma_size_t_add(lnew, 1, &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ goto finished;
+ }
+ back = dk4mem_new(char,lnew,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+ /* 2018-04-04 Bugfix
+ The new file name may be shorter than the original
+ file name, so we must not copy the original name
+ into the new buffer!
+ */
+#if 0
+ /* 2018-04-04 Performance
+ Performance should be better using strncpy.
+ */
+ for (i = 0; i < lold; i++) { back[i] = srcname[i]; }
+#endif
+#if 0
+ strncpy(back, srcname, lold);
+#endif
+ DK4_MEMCPY(back,srcname,lold);
+ back[lold] = '\0';
+ strcat(back, newsu);
+ finished:
+ return back;
+}
+
+
+
+size_t
+dk4path8_concatenate_size(
+ char const *dirname,
+ char const *filename,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er; /* Test for math overflow */
+ size_t back = 0; /* Function result */
+ size_t sldir = 0; /* Length of dirname */
+ size_t slfil = 0; /* Length of filename */
+ size_t toadd = 2; /* Path separator and finalizer byte */
+ $? "+ dk4path8_concatenate_size"
+#if DK4_USE_ASSERT
+ assert(NULL != dirname);
+ assert(NULL != filename);
+#endif
+ if ((NULL != dirname) && (NULL != filename)) {
+ sldir = dk4str8_len(dirname);
+ slfil = dk4str8_len(filename);
+ if (0 < sldir) {
+ if (*(dk4path8_kw[0]) == dirname[sldir - 1]) { toadd = 1; }
+ }
+ dk4error_init(&er);
+ back = dk4ma_size_t_add( dk4ma_size_t_add(sldir, slfil, &er), toadd, &er );
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ back = 0;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4path8_concatenate_size %u", (unsigned)back
+ return back;
+}
+
+
+
+int
+dk4path8_concatenate_buffer(
+ char *buffer,
+ size_t szbuf,
+ char const *dirn,
+ char const *filen,
+ dk4_er_t *erp
+)
+{
+ size_t sld;
+ int back = 0;
+ int sep = 1;
+ $? "+ dk4path8_concatenate_buffer \"%!8s\" \"%!8s\"", TR_8STR(dirn), TR_8STR(filen)
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+ if ((NULL != buffer) && (NULL != dirn) && (NULL != filen) && (0 != szbuf)) {
+ sld = dk4str8_len(dirn);
+ if (0 < sld) { if (dirn[sld - 1] == *(dk4path8_kw[0])) { sep = 0; } }
+ back = dk4str8_cpy_s(buffer, szbuf, dirn, erp);
+ if (0 != back) {
+ if (0 != sep) {
+ back = dk4str8_cat_s(buffer, szbuf, dk4path8_kw[0], erp);
+ }
+ }
+ if (0 != back) {
+ back = dk4str8_cat_s(buffer, szbuf, filen, erp);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if ((0 == back) && (NULL != buffer) && (0 < szbuf)) { buffer[0] = '\0'; }
+ $? "- dk4path8_concatenate_buffer %d", back
+ return back;
+}
+
+
+
+char *
+dk4path8_concatenate_new(
+ char const *dirn,
+ char const *filen,
+ dk4_er_t *erp
+)
+{
+ char *back = NULL;
+ size_t bl = 0;
+ $? "+ dk4path8_concatenate_new dir=\"%!8s\" f=\"%!8s\"", TR_8STR(dirn), TR_8STR(filen)
+#if DK4_USE_ASSERT
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+ if ((NULL != dirn) && (NULL != filen)) {
+ bl = dk4path8_concatenate_size(dirn, filen, erp);
+ if (0 != bl) {
+ back = dk4mem_new(char,bl,erp);
+ if (NULL != back) {
+ if (0 == dk4path8_concatenate_buffer(back, bl, dirn, filen, erp)) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ if (NULL != back) {
+ $? ". path = \"%!8s\"", back
+ }
+#endif
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4path8_concatenate_new %d", TR_IPTR(back)
+ return back;
+}
+
diff --git a/support/dktools/dk4path8.h b/support/dktools/dk4path8.h
index b41b1f2e44..f92155ab28 100644
--- a/support/dktools/dk4path8.h
+++ b/support/dktools/dk4path8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4path8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4path8.ctr
*/
#ifndef DK4PATH8_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -79,6 +69,7 @@ int
dk4path8_is_relative(const char *path);
/** Append path filename to path name already stored in buffer.
+ Resolve . and .. for current directory and parent directory.
CRT on Windows: Optional, disabling CRT degrades performance.
@param buffer Buffer already containing a path.
@param sz Buffer size.
@@ -132,6 +123,132 @@ dk4path8_correct_sep(char *filename);
int
dk4path8_must_expand(const char *filename);
+/** Create file name with specified suffix.
+ @param pdst Destination buffer.
+ @param szdst Size of pdst.
+ @param srcname Source file name.
+ @param newsu New file suffix.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdst or srcname or newsu is NULL or szdst is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dst buffer is too small.
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+*/
+int
+dk4path8_set_suffix(
+ char *pdst,
+ size_t szdst,
+ char const *srcname,
+ char const *newsu,
+ dk4_er_t *erp
+);
+
+/** Create a dynamic copy of a file name with changed suffix.
+ @param srcname Old file name.
+ @param newsu New suffix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to changed file name on success, NULL on error.
+ On success call dk4mem_free() on the pointer when no longer needed
+ to release the memory.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if srcname or newsu is NULL,
+ - DK4_E_BUG<br>
+ if a bug occured,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+char *
+dk4path8_dup_change_suffix(
+ char const *srcname,
+ char const *newsu,
+ dk4_er_t *erp
+);
+
+/** Calculate buffer size required to concatenate a directory
+ name and a file name.
+ @param dirname Directory name.
+ @param filename File name.
+ @param erp Error report, may be NULL.
+ @return Buffer size for concatenated names including the finalizer
+ byte on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirname or filename is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the calculation results in a numeric overflow.
+*/
+size_t
+dk4path8_concatenate_size(
+ char const *dirname,
+ char const *filename,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into an existing buffer.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param buffer Result buffer for combined file name.
+ @param szbuf Buffer size.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4path8_concatenate_buffer(
+ char *buffer,
+ size_t szbuf,
+ char const *dirn,
+ char const *filen,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into newly
+ allocated memory.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing the
+ concatenation on success, NULL on error.
+ On success use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirn or filen is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+char *
+dk4path8_concatenate_new(
+ char const *dirn,
+ char const *filen,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4pathd.c b/support/dktools/dk4pathd.c
index ba2e722b11..9f96286181 100644
--- a/support/dktools/dk4pathd.c
+++ b/support/dktools/dk4pathd.c
@@ -1,44 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4pathd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pathd.ctr
*/
/** @file dk4pathd.c The dk4pathd module.
*/
-#line 135 "dk4pathd.ctr"
+#line 274 "dk4pathd.ctr"
+
+#include "dk4conf.h"
#include "dk4pathd.h"
#if DK4_CHAR_SIZE > 1
@@ -47,6 +27,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4path8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mem.h"
#include "dk4mpl.h"
#include "dk4strd.h"
@@ -55,13 +42,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 151 "dk4pathd.ctr"
+#line 299 "dk4pathd.ctr"
int
dk4path_is_absolute(const dkChar *path)
{
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_is_absolute(path));
#else
@@ -74,6 +64,9 @@ dk4path_is_absolute(const dkChar *path)
int
dk4path_is_relative(const dkChar *path)
{
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_is_relative(path));
#else
@@ -88,6 +81,11 @@ dk4path_append(
dkChar *buffer, size_t sz, const dkChar *filename, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != filename);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_append(buffer, sz, filename, erp));
#else
@@ -100,6 +98,9 @@ dk4path_append(
dkChar *
dk4path_get_suffix(const dkChar *filename, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_get_suffix(filename, erp));
#else
@@ -112,6 +113,9 @@ dk4path_get_suffix(const dkChar *filename, dk4_er_t *erp)
void
dk4path_correct_sep(dkChar *filename)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
#if DK4_CHAR_SIZE > 1
dk4pathw_correct_sep(filename);
#else
@@ -124,6 +128,9 @@ dk4path_correct_sep(dkChar *filename)
int
dk4path_must_expand(const dkChar *filename)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_must_expand(filename));
#else
@@ -142,29 +149,33 @@ dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp)
int back = 0;
-#line 236 "dk4pathd.ctr"
+#line 404 "dk4pathd.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(NULL != parent);
+#endif
if ((NULL != filename) && (NULL != parent)) {
if (0 != dk4str_cpy_s(buf, DK4_SIZEOF(buf,dkChar), filename, erp)) {
szf = dk4str_len(buf);
szp = dk4str_len(parent);
if (szf > szp) {
-#line 241 "dk4pathd.ctr"
-#if DK4_ON_WINDOWS
+#line 413 "dk4pathd.ctr"
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
if (buf[szp] == dkT('\\'))
#else
if (buf[szp] == dkT('/'))
#endif
{
-#line 247 "dk4pathd.ctr"
+#line 419 "dk4pathd.ctr"
buf[szp] = dkT('\0');
if (0 == dk4str_pathcmp(buf, parent)) {
back = 1;
-#line 250 "dk4pathd.ctr"
+#line 422 "dk4pathd.ctr"
}
-#if DK4_ON_WINDOWS
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
buf[szp] = dkT('\\');
#else
buf[szp] = dkT('/');
@@ -173,11 +184,11 @@ dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp)
} else {
if (szf == szp) {
-#line 259 "dk4pathd.ctr"
+#line 431 "dk4pathd.ctr"
if (0 == dk4str_pathcmp(buf, parent)) {
back = 1;
-#line 261 "dk4pathd.ctr"
+#line 433 "dk4pathd.ctr"
}
}
}
@@ -186,9 +197,117 @@ dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 268 "dk4pathd.ctr"
+#line 440 "dk4pathd.ctr"
return back;
}
+int
+dk4path_set_suffix(
+ dkChar *pdst,
+ size_t szdst,
+ dkChar const *srcname,
+ dkChar const *newsu,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_set_suffix(pdst, szdst, srcname, newsu, erp));
+#else
+ return (dk4path8_set_suffix(pdst, szdst, srcname, newsu, erp));
+#endif
+}
+
+
+
+dkChar *
+dk4path_dup_change_suffix(
+ dkChar const *srcname,
+ dkChar const *newsu,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_dup_change_suffix(srcname, newsu, erp));
+#else
+ return (dk4path8_dup_change_suffix(srcname, newsu, erp));
+#endif
+}
+
+
+
+size_t
+dk4path_concatenate_size(
+ dkChar const *dirname,
+ dkChar const *filename,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != dirname);
+ assert(NULL != filename);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_concatenate_size(dirname, filename, erp));
+#else
+ return (dk4path8_concatenate_size(dirname, filename, erp));
+#endif
+}
+
+
+
+int
+dk4path_concatenate_buffer(
+ dkChar *buffer,
+ size_t szbuf,
+ dkChar const *dirn,
+ dkChar const *filen,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_concatenate_buffer(buffer, szbuf, dirn, filen, erp));
+#else
+ return (dk4path8_concatenate_buffer(buffer, szbuf, dirn, filen, erp));
+#endif
+}
+
+
+
+dkChar *
+dk4path_concatenate_new(
+ dkChar const *dirn,
+ dkChar const *filen,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_concatenate_new(dirn, filen, erp));
+#else
+ return (dk4path8_concatenate_new(dirn, filen, erp));
+#endif
+}
+
+
+
diff --git a/support/dktools/dk4pathd.ctr b/support/dktools/dk4pathd.ctr
index f37cc038a1..f3c0c7ba14 100644
--- a/support/dktools/dk4pathd.ctr
+++ b/support/dktools/dk4pathd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
@@ -53,6 +65,7 @@ int
dk4path_is_relative(const dkChar *path);
/** Append path filename to path name already stored in buffer.
+ Resolve . and .. for current directory and parent directory.
CRT on Windows: Optional, disabling CRT degrades performance.
@param buffer Buffer already containing a path.
@param sz Buffer size.
@@ -126,6 +139,132 @@ dk4path_must_expand(const dkChar *filename);
int
dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp);
+/** Create file name with specified suffix.
+ @param pdst Destination buffer.
+ @param szdst Size of pdst (number of dkChar).
+ @param srcname Source file name.
+ @param newsu New file suffix.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdst or srcname or newsu is NULL or szdst is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dst buffer is too small.
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+*/
+int
+dk4path_set_suffix(
+ dkChar *pdst,
+ size_t szdst,
+ dkChar const *srcname,
+ dkChar const *newsu,
+ dk4_er_t *erp
+);
+
+/** Create a dynamic copy of a file name with changed suffix.
+ @param srcname Old file name.
+ @param newsu New suffix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to changed file name on success, NULL on error.
+ On success call dk4mem_free() on the pointer when no longer needed
+ to release the memory.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if srcname or newsu is NULL,
+ - DK4_E_BUG<br>
+ if a bug occured,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+dkChar *
+dk4path_dup_change_suffix(
+ dkChar const *srcname,
+ dkChar const *newsu,
+ dk4_er_t *erp
+);
+
+/** Calculate buffer size required to concatenate a directory
+ name and a file name.
+ @param dirname Directory name.
+ @param filename File name.
+ @param erp Error report, may be NULL.
+ @return Buffer size for concatenated names including the finalizer
+ byte on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirname or filename is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the calculation results in a numeric overflow.
+*/
+size_t
+dk4path_concatenate_size(
+ dkChar const *dirname,
+ dkChar const *filename,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into an existing buffer.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param buffer Result buffer for combined file name.
+ @param szbuf Buffer size (number of dkChar).
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4path_concatenate_buffer(
+ dkChar *buffer,
+ size_t szbuf,
+ dkChar const *dirn,
+ dkChar const *filen,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into newly
+ allocated memory.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing the
+ concatenation on success, NULL on error.
+ On success use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirn or filen is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+dkChar *
+dk4path_concatenate_new(
+ dkChar const *dirn,
+ dkChar const *filen,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
@@ -134,6 +273,8 @@ dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp);
%% module
+#include "dk4conf.h"
+
#include "dk4pathd.h"
#if DK4_CHAR_SIZE > 1
#include "dk4pathw.h"
@@ -141,6 +282,13 @@ dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp);
#include "dk4path8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mem.h"
#include "dk4mpl.h"
#include "dk4strd.h"
@@ -154,6 +302,9 @@ $!trace-include
int
dk4path_is_absolute(const dkChar *path)
{
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_is_absolute(path));
#else
@@ -166,6 +317,9 @@ dk4path_is_absolute(const dkChar *path)
int
dk4path_is_relative(const dkChar *path)
{
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_is_relative(path));
#else
@@ -180,6 +334,11 @@ dk4path_append(
dkChar *buffer, size_t sz, const dkChar *filename, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != filename);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_append(buffer, sz, filename, erp));
#else
@@ -192,6 +351,9 @@ dk4path_append(
dkChar *
dk4path_get_suffix(const dkChar *filename, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_get_suffix(filename, erp));
#else
@@ -204,6 +366,9 @@ dk4path_get_suffix(const dkChar *filename, dk4_er_t *erp)
void
dk4path_correct_sep(dkChar *filename)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
#if DK4_CHAR_SIZE > 1
dk4pathw_correct_sep(filename);
#else
@@ -216,6 +381,9 @@ dk4path_correct_sep(dkChar *filename)
int
dk4path_must_expand(const dkChar *filename)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4pathw_must_expand(filename));
#else
@@ -233,12 +401,16 @@ dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp)
size_t szp;
int back = 0;
$? "+ dk4path_is_in_subdir f=\"%!ds\" p=\"%!ds\"", filename, parent
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(NULL != parent);
+#endif
if ((NULL != filename) && (NULL != parent)) {
if (0 != dk4str_cpy_s(buf, DK4_SIZEOF(buf,dkChar), filename, erp)) {
szf = dk4str_len(buf);
szp = dk4str_len(parent);
if (szf > szp) { $? ". filename larger than parent"
-#if DK4_ON_WINDOWS
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
if (buf[szp] == dkT('\\'))
#else
if (buf[szp] == dkT('/'))
@@ -248,7 +420,7 @@ dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp)
if (0 == dk4str_pathcmp(buf, parent)) {
back = 1; $? ". match"
}
-#if DK4_ON_WINDOWS
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
buf[szp] = dkT('\\');
#else
buf[szp] = dkT('/');
@@ -270,3 +442,111 @@ dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp)
+int
+dk4path_set_suffix(
+ dkChar *pdst,
+ size_t szdst,
+ dkChar const *srcname,
+ dkChar const *newsu,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_set_suffix(pdst, szdst, srcname, newsu, erp));
+#else
+ return (dk4path8_set_suffix(pdst, szdst, srcname, newsu, erp));
+#endif
+}
+
+
+
+dkChar *
+dk4path_dup_change_suffix(
+ dkChar const *srcname,
+ dkChar const *newsu,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_dup_change_suffix(srcname, newsu, erp));
+#else
+ return (dk4path8_dup_change_suffix(srcname, newsu, erp));
+#endif
+}
+
+
+
+size_t
+dk4path_concatenate_size(
+ dkChar const *dirname,
+ dkChar const *filename,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != dirname);
+ assert(NULL != filename);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_concatenate_size(dirname, filename, erp));
+#else
+ return (dk4path8_concatenate_size(dirname, filename, erp));
+#endif
+}
+
+
+
+int
+dk4path_concatenate_buffer(
+ dkChar *buffer,
+ size_t szbuf,
+ dkChar const *dirn,
+ dkChar const *filen,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_concatenate_buffer(buffer, szbuf, dirn, filen, erp));
+#else
+ return (dk4path8_concatenate_buffer(buffer, szbuf, dirn, filen, erp));
+#endif
+}
+
+
+
+dkChar *
+dk4path_concatenate_new(
+ dkChar const *dirn,
+ dkChar const *filen,
+ dk4_er_t *erp
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+#if DK4_CHAR_SIZE > 1
+ return (dk4pathw_concatenate_new(dirn, filen, erp));
+#else
+ return (dk4path8_concatenate_new(dirn, filen, erp));
+#endif
+}
+
+
+
diff --git a/support/dktools/dk4pathd.h b/support/dktools/dk4pathd.h
index fb80048298..ccdfc179b2 100644
--- a/support/dktools/dk4pathd.h
+++ b/support/dktools/dk4pathd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4pathd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pathd.ctr
*/
#ifndef DK4PATHD_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_WCHAR_H
@@ -85,6 +75,7 @@ int
dk4path_is_relative(const dkChar *path);
/** Append path filename to path name already stored in buffer.
+ Resolve . and .. for current directory and parent directory.
CRT on Windows: Optional, disabling CRT degrades performance.
@param buffer Buffer already containing a path.
@param sz Buffer size.
@@ -158,6 +149,132 @@ dk4path_must_expand(const dkChar *filename);
int
dk4path_is_in_subdir(const dkChar *filename,const dkChar *parent,dk4_er_t *erp);
+/** Create file name with specified suffix.
+ @param pdst Destination buffer.
+ @param szdst Size of pdst (number of dkChar).
+ @param srcname Source file name.
+ @param newsu New file suffix.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdst or srcname or newsu is NULL or szdst is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dst buffer is too small.
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+*/
+int
+dk4path_set_suffix(
+ dkChar *pdst,
+ size_t szdst,
+ dkChar const *srcname,
+ dkChar const *newsu,
+ dk4_er_t *erp
+);
+
+/** Create a dynamic copy of a file name with changed suffix.
+ @param srcname Old file name.
+ @param newsu New suffix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to changed file name on success, NULL on error.
+ On success call dk4mem_free() on the pointer when no longer needed
+ to release the memory.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if srcname or newsu is NULL,
+ - DK4_E_BUG<br>
+ if a bug occured,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+dkChar *
+dk4path_dup_change_suffix(
+ dkChar const *srcname,
+ dkChar const *newsu,
+ dk4_er_t *erp
+);
+
+/** Calculate buffer size required to concatenate a directory
+ name and a file name.
+ @param dirname Directory name.
+ @param filename File name.
+ @param erp Error report, may be NULL.
+ @return Buffer size for concatenated names including the finalizer
+ byte on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirname or filename is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the calculation results in a numeric overflow.
+*/
+size_t
+dk4path_concatenate_size(
+ dkChar const *dirname,
+ dkChar const *filename,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into an existing buffer.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param buffer Result buffer for combined file name.
+ @param szbuf Buffer size (number of dkChar).
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4path_concatenate_buffer(
+ dkChar *buffer,
+ size_t szbuf,
+ dkChar const *dirn,
+ dkChar const *filen,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into newly
+ allocated memory.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing the
+ concatenation on success, NULL on error.
+ On success use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirn or filen is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+dkChar *
+dk4path_concatenate_new(
+ dkChar const *dirn,
+ dkChar const *filen,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4pathw.c b/support/dktools/dk4pathw.c
index 178c83eeb9..9ad5a00e53 100644
--- a/support/dktools/dk4pathw.c
+++ b/support/dktools/dk4pathw.c
@@ -1,48 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4pathw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pathw.ctr
*/
/** @file dk4pathw.c The dk4pathw module.
*/
-#line 110 "dk4pathw.ctr"
+#line 249 "dk4pathw.ctr"
+#include "dk4conf.h"
#include "dk4pathw.h"
#include "dk4mem.h"
#include "dk4strw.h"
+#include "dk4maasz.h"
+
#if DK4_HAVE_STRING_H
#ifndef STRING_H_INCLUDED
@@ -58,6 +39,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
+
+
+
+
+#line 284 "dk4pathw.ctr"
+
+
/** Constant keywords used by the dk4pathw module.
*/
@@ -85,6 +82,9 @@ wchar_t
dk4pathw_lastchar(const wchar_t *str)
{
wchar_t back = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+#endif
if (str) { while (L'\0' != *str) { back = *(str++); } }
return back;
}
@@ -98,6 +98,9 @@ dk4pathw_is_absolute(const wchar_t *path)
#if DK4_ON_WINDOWS
wchar_t c;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
c = *path;
@@ -128,6 +131,9 @@ int
dk4pathw_is_relative(const wchar_t *path)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
if (NULL != dk4strw_chr(path, *(dk4pathw_kw[0]))) {
if (0 == dk4pathw_is_absolute(path)) {
@@ -156,6 +162,11 @@ dk4pathw_append(
int failed = 0; /* Definitely failed */
wchar_t lch; /* Last character from string */
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != filename);
+#endif
if ((NULL != buffer) && (NULL != filename) && (0 < sz)) {
mycp = dk4strw_dup(filename, erp);
if (NULL != mycp) {
@@ -236,6 +247,9 @@ wchar_t *
dk4pathw_get_suffix(const wchar_t *filename, dk4_er_t *erp)
{
const wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while (L'\0' != *filename) {
if ((L'\\' == *filename) || (L'/' == *filename)) {
@@ -258,6 +272,9 @@ dk4pathw_get_suffix(const wchar_t *filename, dk4_er_t *erp)
void
dk4pathw_correct_sep(wchar_t *filename)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while (L'\0' != *filename) {
#if DK4_HAVE_BACKSLASH_AS_SEP
@@ -273,10 +290,19 @@ dk4pathw_correct_sep(wchar_t *filename)
int
-dk4pathw_must_expand(const wchar_t *filename)
+dk4pathw_must_expand(
+#if DK4_ON_WINDOWS
+ const wchar_t *filename
+#else
+ const wchar_t * DK4_ARG_UNUSED(filename)
+#endif
+)
{
#if DK4_ON_WINDOWS
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
if (L'\\' == filename[0]) {
if (L'\\' == filename[1]) {
@@ -301,7 +327,229 @@ dk4pathw_must_expand(const wchar_t *filename)
}
return back;
#else
+ DK4_UNUSED_ARG(filename)
return 0;
#endif
}
+
+
+int
+dk4pathw_set_suffix(
+ wchar_t *pdst,
+ size_t szdst,
+ wchar_t const *srcname,
+ wchar_t const *newsu,
+ dk4_er_t *erp
+)
+{
+ wchar_t *sp = NULL;
+ int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+ if ((NULL == pdst) || (NULL == srcname) || (NULL == newsu) || (0 == szdst)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 == dk4strw_cpy_s(pdst, szdst, srcname, erp)) {
+ goto finished;
+ }
+ sp = dk4pathw_get_suffix(pdst, NULL);
+ if (NULL != sp) {
+ *sp = L'\0';
+ }
+ back = dk4strw_cat_s(pdst, szdst, newsu, erp);
+
+ finished:
+ return back;
+}
+
+
+
+wchar_t *
+dk4pathw_dup_change_suffix(
+ wchar_t const *srcname,
+ wchar_t const *newsu,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ wchar_t *sp;
+ wchar_t *back = NULL;
+ size_t lold;
+ size_t lsuff;
+ size_t lnew;
+#if 0
+ size_t i;
+#endif
+
+#if DK4_USE_ASSERT
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+ if ((NULL == srcname) || (NULL == newsu)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ sp = dk4pathw_get_suffix(srcname, NULL);
+ lold = dk4strw_len(srcname);
+ lsuff = 0;
+ if (NULL != sp) { lsuff = dk4strw_len(sp); }
+ if (lsuff > lold) {
+ /* BUG */
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ goto finished;
+ }
+ lold -= lsuff;
+ lsuff = dk4strw_len(newsu);
+ dk4error_init(&er);
+ lnew = dk4ma_size_t_add(lold, lsuff, &er);
+ lnew = dk4ma_size_t_add(lnew, 1, &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ goto finished;
+ }
+ back = dk4mem_new(wchar_t,lnew,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+#if 0
+ /* 2018-04-04 Bugfix
+ The new file name may be shorter than the original
+ file name, so we must not copy the original name
+ into the new buffer!
+ */
+ dk4strw_cpy_s(back, lnew, srcname, NULL);
+ sp = dk4pathw_get_suffix(back, NULL);
+ if (NULL != sp) { *sp = L'\0'; }
+#endif
+#if 0
+ for (i = 0; i < lold; i++) {
+ back[i] = srcname[i];
+ }
+#endif
+ DK4_MEMCPY(back,srcname,(lold*sizeof(wchar_t)));
+ back[lold] = L'\0';
+ dk4strw_cat_s(back, lnew, newsu, NULL);
+
+ finished:
+ return back;
+}
+
+
+
+size_t
+dk4pathw_concatenate_size(
+ wchar_t const *dirname,
+ wchar_t const *filename,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ size_t back = 0;
+ size_t sldir = 0;
+ size_t slfil = 0;
+ size_t toadd = 2;
+
+#if DK4_USE_ASSERT
+ assert(NULL != dirname);
+ assert(NULL != filename);
+#endif
+ if ((NULL != dirname) && (NULL != filename)) {
+ sldir = dk4strw_len(dirname);
+ slfil = dk4strw_len(filename);
+ if (0 < sldir) {
+ if (*(dk4pathw_kw[0]) == dirname[sldir - 1]) { toadd = 1; }
+ }
+ dk4error_init(&er);
+ back = dk4ma_size_t_add( dk4ma_size_t_add(sldir, slfil, &er), toadd, &er );
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ back = 0;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+int
+dk4pathw_concatenate_buffer(
+ wchar_t *buffer,
+ size_t szbuf,
+ wchar_t const *dirn,
+ wchar_t const *filen,
+ dk4_er_t *erp
+)
+{
+ size_t sld;
+ int back = 0;
+ int sep = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+ if ((NULL != buffer) && (NULL != dirn) && (NULL != filen) && (0 != szbuf)) {
+ sld = dk4strw_len(dirn);
+ if (0 < sld) { if (dirn[sld - 1] == *(dk4pathw_kw[0])) { sep = 0; } }
+ back = dk4strw_cpy_s(buffer, szbuf, dirn, erp);
+ if (0 != back) {
+ if (0 != sep) {
+ back = dk4strw_cat_s(buffer, szbuf, dk4pathw_kw[0], erp);
+ }
+ }
+ if (0 != back) {
+ back = dk4strw_cat_s(buffer, szbuf, filen, erp);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if ((0 == back) && (NULL != buffer) && (0 < szbuf)) { buffer[0] = L'\0'; }
+ return back;
+}
+
+
+
+wchar_t *
+dk4pathw_concatenate_new(
+ wchar_t const *dirn,
+ wchar_t const *filen,
+ dk4_er_t *erp
+)
+{
+ wchar_t *back = NULL;
+ size_t bl = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+ if ((NULL != dirn) && (NULL != filen)) {
+ bl = dk4pathw_concatenate_size(dirn, filen, erp);
+ if (0 != bl) {
+ back = dk4mem_new(wchar_t,bl,erp);
+ if (NULL != back) {
+ if (0 == dk4pathw_concatenate_buffer(back, bl, dirn, filen, erp)) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4pathw.ctr b/support/dktools/dk4pathw.ctr
index b5299600df..bd81124b71 100644
--- a/support/dktools/dk4pathw.ctr
+++ b/support/dktools/dk4pathw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -45,6 +57,7 @@ int
dk4pathw_is_relative(const wchar_t *path);
/** Append path filename to path name already stored in buffer.
+ Resolve . and .. for current directory and parent directory.
CRT on Windows: Optional, disabling CRT degrades performance.
@param buffer Buffer already containing a path.
@param sz Buffer size.
@@ -100,6 +113,132 @@ dk4pathw_correct_sep(wchar_t *filename);
int
dk4pathw_must_expand(const wchar_t *filename);
+/** Create file name with specified suffix.
+ @param pdst Destination buffer.
+ @param szdst Size of pdst (number of wchar_t).
+ @param srcname Source file name.
+ @param newsu New file suffix.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdst or srcname or newsu is NULL or szdst is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dst buffer is too small.
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+*/
+int
+dk4pathw_set_suffix(
+ wchar_t *pdst,
+ size_t szdst,
+ wchar_t const *srcname,
+ wchar_t const *newsu,
+ dk4_er_t *erp
+);
+
+/** Create a dynamic copy of a file name with changed suffix.
+ @param srcname Old file name.
+ @param newsu New suffix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to changed file name on success, NULL on error.
+ On success call dk4mem_free() on the pointer when no longer needed
+ to release the memory.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if srcname or newsu is NULL,
+ - DK4_E_BUG<br>
+ if a bug occured,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+wchar_t *
+dk4pathw_dup_change_suffix(
+ wchar_t const *srcname,
+ wchar_t const *newsu,
+ dk4_er_t *erp
+);
+
+/** Calculate buffer size required to concatenate a directory
+ name and a file name.
+ @param dirname Directory name.
+ @param filename File name.
+ @param erp Error report, may be NULL.
+ @return Buffer size for concatenated names including the finalizer
+ byte on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirname or filename is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the calculation results in a numeric overflow.
+*/
+size_t
+dk4pathw_concatenate_size(
+ wchar_t const *dirname,
+ wchar_t const *filename,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into an existing buffer.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param buffer Result buffer for combined file name.
+ @param szbuf Buffer size (number of wchar_t).
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4pathw_concatenate_buffer(
+ wchar_t *buffer,
+ size_t szbuf,
+ wchar_t const *dirn,
+ wchar_t const *filen,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into newly
+ allocated memory.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing the
+ concatenation on success, NULL on error.
+ On success use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirn or filen is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+wchar_t *
+dk4pathw_concatenate_new(
+ wchar_t const *dirn,
+ wchar_t const *filen,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
@@ -109,9 +248,12 @@ dk4pathw_must_expand(const wchar_t *filename);
%% module
+#include "dk4conf.h"
#include "dk4pathw.h"
#include "dk4mem.h"
#include "dk4strw.h"
+#include "dk4maasz.h"
+
#if DK4_HAVE_STRING_H
#ifndef STRING_H_INCLUDED
@@ -127,6 +269,20 @@ dk4pathw_must_expand(const wchar_t *filename);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4unused.h"
+
+
+
+$!trace-include
+
+
/** Constant keywords used by the dk4pathw module.
*/
@@ -154,6 +310,9 @@ wchar_t
dk4pathw_lastchar(const wchar_t *str)
{
wchar_t back = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+#endif
if (str) { while (L'\0' != *str) { back = *(str++); } }
return back;
}
@@ -167,6 +326,9 @@ dk4pathw_is_absolute(const wchar_t *path)
#if DK4_ON_WINDOWS
wchar_t c;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
#if DK4_ON_WINDOWS
c = *path;
@@ -197,6 +359,9 @@ int
dk4pathw_is_relative(const wchar_t *path)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != path);
+#endif
if (NULL != path) {
if (NULL != dk4strw_chr(path, *(dk4pathw_kw[0]))) {
if (0 == dk4pathw_is_absolute(path)) {
@@ -225,6 +390,11 @@ dk4pathw_append(
int failed = 0; /* Definitely failed */
wchar_t lch; /* Last character from string */
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < sz);
+ assert(NULL != filename);
+#endif
if ((NULL != buffer) && (NULL != filename) && (0 < sz)) {
mycp = dk4strw_dup(filename, erp);
if (NULL != mycp) {
@@ -305,6 +475,9 @@ wchar_t *
dk4pathw_get_suffix(const wchar_t *filename, dk4_er_t *erp)
{
const wchar_t *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while (L'\0' != *filename) {
if ((L'\\' == *filename) || (L'/' == *filename)) {
@@ -327,6 +500,9 @@ dk4pathw_get_suffix(const wchar_t *filename, dk4_er_t *erp)
void
dk4pathw_correct_sep(wchar_t *filename)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
while (L'\0' != *filename) {
#if DK4_HAVE_BACKSLASH_AS_SEP
@@ -342,10 +518,19 @@ dk4pathw_correct_sep(wchar_t *filename)
int
-dk4pathw_must_expand(const wchar_t *filename)
+dk4pathw_must_expand(
+#if DK4_ON_WINDOWS
+ const wchar_t *filename
+#else
+ const wchar_t * DK4_ARG_UNUSED(filename)
+#endif
+)
{
#if DK4_ON_WINDOWS
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
if (L'\\' == filename[0]) {
if (L'\\' == filename[1]) {
@@ -370,7 +555,229 @@ dk4pathw_must_expand(const wchar_t *filename)
}
return back;
#else
+ DK4_UNUSED_ARG(filename)
return 0;
#endif
}
+
+
+int
+dk4pathw_set_suffix(
+ wchar_t *pdst,
+ size_t szdst,
+ wchar_t const *srcname,
+ wchar_t const *newsu,
+ dk4_er_t *erp
+)
+{
+ wchar_t *sp = NULL;
+ int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+ if ((NULL == pdst) || (NULL == srcname) || (NULL == newsu) || (0 == szdst)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (0 == dk4strw_cpy_s(pdst, szdst, srcname, erp)) {
+ goto finished;
+ }
+ sp = dk4pathw_get_suffix(pdst, NULL);
+ if (NULL != sp) {
+ *sp = L'\0';
+ }
+ back = dk4strw_cat_s(pdst, szdst, newsu, erp);
+
+ finished:
+ return back;
+}
+
+
+
+wchar_t *
+dk4pathw_dup_change_suffix(
+ wchar_t const *srcname,
+ wchar_t const *newsu,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ wchar_t *sp;
+ wchar_t *back = NULL;
+ size_t lold;
+ size_t lsuff;
+ size_t lnew;
+#if 0
+ size_t i;
+#endif
+
+#if DK4_USE_ASSERT
+ assert(NULL != srcname);
+ assert(NULL != newsu);
+#endif
+ if ((NULL == srcname) || (NULL == newsu)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ sp = dk4pathw_get_suffix(srcname, NULL);
+ lold = dk4strw_len(srcname);
+ lsuff = 0;
+ if (NULL != sp) { lsuff = dk4strw_len(sp); }
+ if (lsuff > lold) {
+ /* BUG */
+ dk4error_set_simple_error_code(erp, DK4_E_BUG);
+ goto finished;
+ }
+ lold -= lsuff;
+ lsuff = dk4strw_len(newsu);
+ dk4error_init(&er);
+ lnew = dk4ma_size_t_add(lold, lsuff, &er);
+ lnew = dk4ma_size_t_add(lnew, 1, &er);
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ goto finished;
+ }
+ back = dk4mem_new(wchar_t,lnew,erp);
+ if (NULL == back) {
+ goto finished;
+ }
+#if 0
+ /* 2018-04-04 Bugfix
+ The new file name may be shorter than the original
+ file name, so we must not copy the original name
+ into the new buffer!
+ */
+ dk4strw_cpy_s(back, lnew, srcname, NULL);
+ sp = dk4pathw_get_suffix(back, NULL);
+ if (NULL != sp) { *sp = L'\0'; }
+#endif
+#if 0
+ for (i = 0; i < lold; i++) {
+ back[i] = srcname[i];
+ }
+#endif
+ DK4_MEMCPY(back,srcname,(lold*sizeof(wchar_t)));
+ back[lold] = L'\0';
+ dk4strw_cat_s(back, lnew, newsu, NULL);
+
+ finished:
+ return back;
+}
+
+
+
+size_t
+dk4pathw_concatenate_size(
+ wchar_t const *dirname,
+ wchar_t const *filename,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ size_t back = 0;
+ size_t sldir = 0;
+ size_t slfil = 0;
+ size_t toadd = 2;
+
+#if DK4_USE_ASSERT
+ assert(NULL != dirname);
+ assert(NULL != filename);
+#endif
+ if ((NULL != dirname) && (NULL != filename)) {
+ sldir = dk4strw_len(dirname);
+ slfil = dk4strw_len(filename);
+ if (0 < sldir) {
+ if (*(dk4pathw_kw[0]) == dirname[sldir - 1]) { toadd = 1; }
+ }
+ dk4error_init(&er);
+ back = dk4ma_size_t_add( dk4ma_size_t_add(sldir, slfil, &er), toadd, &er );
+ if (DK4_E_NONE != er.ec) {
+ dk4error_copy(erp, &er);
+ back = 0;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+int
+dk4pathw_concatenate_buffer(
+ wchar_t *buffer,
+ size_t szbuf,
+ wchar_t const *dirn,
+ wchar_t const *filen,
+ dk4_er_t *erp
+)
+{
+ size_t sld;
+ int back = 0;
+ int sep = 1;
+#if DK4_USE_ASSERT
+ assert(NULL != buffer);
+ assert(0 < szbuf);
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+ if ((NULL != buffer) && (NULL != dirn) && (NULL != filen) && (0 != szbuf)) {
+ sld = dk4strw_len(dirn);
+ if (0 < sld) { if (dirn[sld - 1] == *(dk4pathw_kw[0])) { sep = 0; } }
+ back = dk4strw_cpy_s(buffer, szbuf, dirn, erp);
+ if (0 != back) {
+ if (0 != sep) {
+ back = dk4strw_cat_s(buffer, szbuf, dk4pathw_kw[0], erp);
+ }
+ }
+ if (0 != back) {
+ back = dk4strw_cat_s(buffer, szbuf, filen, erp);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if ((0 == back) && (NULL != buffer) && (0 < szbuf)) { buffer[0] = L'\0'; }
+ return back;
+}
+
+
+
+wchar_t *
+dk4pathw_concatenate_new(
+ wchar_t const *dirn,
+ wchar_t const *filen,
+ dk4_er_t *erp
+)
+{
+ wchar_t *back = NULL;
+ size_t bl = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dirn);
+ assert(NULL != filen);
+#endif
+ if ((NULL != dirn) && (NULL != filen)) {
+ bl = dk4pathw_concatenate_size(dirn, filen, erp);
+ if (0 != bl) {
+ back = dk4mem_new(wchar_t,bl,erp);
+ if (NULL != back) {
+ if (0 == dk4pathw_concatenate_buffer(back, bl, dirn, filen, erp)) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
diff --git a/support/dktools/dk4pathw.h b/support/dktools/dk4pathw.h
index 83eba9ed3c..ba613860e1 100644
--- a/support/dktools/dk4pathw.h
+++ b/support/dktools/dk4pathw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4pathw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pathw.ctr
*/
#ifndef DK4PATHW_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -78,6 +68,7 @@ int
dk4pathw_is_relative(const wchar_t *path);
/** Append path filename to path name already stored in buffer.
+ Resolve . and .. for current directory and parent directory.
CRT on Windows: Optional, disabling CRT degrades performance.
@param buffer Buffer already containing a path.
@param sz Buffer size.
@@ -133,6 +124,132 @@ dk4pathw_correct_sep(wchar_t *filename);
int
dk4pathw_must_expand(const wchar_t *filename);
+/** Create file name with specified suffix.
+ @param pdst Destination buffer.
+ @param szdst Size of pdst (number of wchar_t).
+ @param srcname Source file name.
+ @param newsu New file suffix.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdst or srcname or newsu is NULL or szdst is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dst buffer is too small.
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+*/
+int
+dk4pathw_set_suffix(
+ wchar_t *pdst,
+ size_t szdst,
+ wchar_t const *srcname,
+ wchar_t const *newsu,
+ dk4_er_t *erp
+);
+
+/** Create a dynamic copy of a file name with changed suffix.
+ @param srcname Old file name.
+ @param newsu New suffix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to changed file name on success, NULL on error.
+ On success call dk4mem_free() on the pointer when no longer needed
+ to release the memory.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if srcname or newsu is NULL,
+ - DK4_E_BUG<br>
+ if a bug occured,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+wchar_t *
+dk4pathw_dup_change_suffix(
+ wchar_t const *srcname,
+ wchar_t const *newsu,
+ dk4_er_t *erp
+);
+
+/** Calculate buffer size required to concatenate a directory
+ name and a file name.
+ @param dirname Directory name.
+ @param filename File name.
+ @param erp Error report, may be NULL.
+ @return Buffer size for concatenated names including the finalizer
+ byte on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirname or filename is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the calculation results in a numeric overflow.
+*/
+size_t
+dk4pathw_concatenate_size(
+ wchar_t const *dirname,
+ wchar_t const *filename,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into an existing buffer.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param buffer Result buffer for combined file name.
+ @param szbuf Buffer size (number of wchar_t).
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4pathw_concatenate_buffer(
+ wchar_t *buffer,
+ size_t szbuf,
+ wchar_t const *dirn,
+ wchar_t const *filen,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into newly
+ allocated memory.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing the
+ concatenation on success, NULL on error.
+ On success use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirn or filen is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+wchar_t *
+dk4pathw_concatenate_new(
+ wchar_t const *dirn,
+ wchar_t const *filen,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4pathx.cpp b/support/dktools/dk4pathx.cpp
new file mode 100644
index 0000000000..57d9668566
--- /dev/null
+++ b/support/dktools/dk4pathx.cpp
@@ -0,0 +1,328 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pathx.cpt
+*/
+
+/** @file dk4pathx.cpp The dk4pathx module.
+*/
+
+
+#line 102 "dk4pathx.cpt"
+
+#include "dk4strx.h"
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
+
+
+#if DK4_SIZEOF_WXCHAR > 1
+#include "dk4strw.h"
+#include "dk4pathw.h"
+#else
+#include "dk4str8.h"
+#include "dk4path8.h"
+#endif
+
+
+
+
+
+#line 123 "dk4pathx.cpt"
+
+
+
+int
+dk4strx_cpy_s(wxChar *dst, size_t sz, const wxChar *src, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_cpy_s(dst, sz, src, erp));
+#else
+ return (dk4str8_cpy_s(dst, sz, src, erp));
+#endif
+}
+
+
+
+int
+dk4strx_cat_s(wxChar *dst, size_t sz, const wxChar *src, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_cat_s(dst, sz, src, erp));
+#else
+ return (dk4str8_cat_s(dst, sz, src, erp));
+#endif
+}
+
+
+
+void
+dk4strx_cpy_to_left(wxChar *dst, const wxChar *src)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4strw_cpy_to_left(dst, src);
+#else
+ dk4str8_cpy_to_left(dst, src);
+#endif
+}
+
+
+
+size_t
+dk4strx_len(const wxChar *src)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_len(src));
+#else
+ return (dk4str8_len(src));
+#endif
+}
+
+
+
+int
+dk4strx_cmp(const wxChar *s1, const wxChar *s2)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_cmp(s1, s2));
+#else
+ return (dk4str8_cmp(s1, s2));
+#endif
+}
+
+
+
+int
+dk4strx_casecmp(const wxChar *s1, const wxChar *s2)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_casecmp(s1, s2));
+#else
+ return (dk4str8_casecmp(s1, s2));
+#endif
+}
+
+
+
+int
+dk4strx_pathcmp(const wxChar *s1, const wxChar *s2)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_pathcmp(s1, s2));
+#else
+ return (dk4str8_pathcmp(s1, s2));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_chr(const wxChar *s, wxChar c)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_chr(s, c));
+#else
+ return (dk4str8_chr(s, c));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_rchr(const wxChar *s, wxChar c)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_rchr(s, c));
+#else
+ return (dk4str8_rchr(s, c));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_sep(wxChar **stringp, const wxChar *delim)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_sep(stringp, delim));
+#else
+ return (dk4str8_sep(stringp, delim));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_start(const wxChar *src, const wxChar *delim)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_start(src, delim));
+#else
+ return (dk4str8_start(src, delim));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_next(wxChar *src, const wxChar *delim)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_next(src, delim));
+#else
+ return (dk4str8_next(src, delim));
+#endif
+}
+
+
+
+size_t
+dk4strx_tokenize(
+ wxChar **dpp, size_t szdpp, wxChar *src, const wxChar *delim, dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_tokenize(dpp, szdpp, src, delim, erp));
+#else
+ return (dk4str8_tokenize(dpp, szdpp, src, delim, erp));
+#endif
+}
+
+
+
+void
+dk4strx_normalize(wxChar *src, const wxChar *delim)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4strw_normalize(src, delim);
+#else
+ dk4str8_normalize(src, delim);
+#endif
+}
+
+
+
+int
+dk4strx_array_index(const wxChar * const *arr, const wxChar *str, int cs)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_array_index(arr, str, cs));
+#else
+ return (dk4str8_array_index(arr, str, cs));
+#endif
+}
+
+
+
+int
+dk4strx_abbr_index(
+ const wxChar * const *arr,
+ wxChar spec,
+ const wxChar *str,
+ int cs
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_abbr_index(arr, spec, str, cs));
+#else
+ return (dk4str8_abbr_index(arr, spec, str, cs));
+#endif
+}
+
+
+
+int
+dk4strx_is_abbr(const wxChar *str, const wxChar *pattern, wxChar spec, int cs)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_is_abbr(str, pattern, spec, cs));
+#else
+ return (dk4str8_is_abbr(str, pattern, spec, cs));
+#endif
+}
+
+
+
+int
+dk4strx_is_bool(const wxChar *str)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_is_bool(str));
+#else
+ return (dk4str8_is_bool(str));
+#endif
+}
+
+
+
+int
+dk4strx_is_on(const wxChar *str)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_is_on(str));
+#else
+ return (dk4str8_is_on(str));
+#endif
+}
+
+
+
+#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
+ || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+
+wxChar *
+dk4strx_dup(const wxChar *src, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_dup(src, erp));
+#else
+ return (dk4str8_dup(src, erp));
+#endif
+}
+
+#endif
+/* if (defined(_WIN32) ... */
+
+void
+dk4strx_rtwh(wxChar *str, const wxChar *whsp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4strw_rtwh(str, whsp);
+#else
+ dk4str8_rtwh(str, whsp);
+#endif
+}
+
+
+
+void
+dk4strx_delnl(wxChar *lptr)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4strw_delnl(lptr);
+#else
+ dk4str8_delnl(lptr);
+#endif
+}
+
+
+wxChar const *
+dk4strx_get_path_suffix(wxChar const *filename, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_get_suffix(filename, erp));
+#else
+ return (dk4path8_get_suffix(filename, erp));
+#endif
+}
+
diff --git a/support/dktools/dk4pathx.cpt b/support/dktools/dk4pathx.cpt
new file mode 100644
index 0000000000..3f481993b0
--- /dev/null
+++ b/support/dktools/dk4pathx.cpt
@@ -0,0 +1,409 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4pathx.h String operations for path names (wxChar).
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strx.h"
+#else
+#include <dktools-4/dk4strx.h>
+#endif
+#endif
+
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#if DK4_HAVE_WX_CHARTYPE_H
+#ifndef WX_CHARTYPE_H_INCLUDED
+#include <wx/chartype.h>
+#define WX_CHARTYPE_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_WX_WXCHAR_H
+#ifndef WX_WXCHAR_H_INCLUDED
+#include <wx/wxchar.h>
+#define WX_WXCHAR_H_INCLUDED 1
+#endif
+#else
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED
+#endif
+#endif
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+%% module
+
+#include "dk4strx.h"
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
+
+
+#if DK4_SIZEOF_WXCHAR > 1
+#include "dk4strw.h"
+#include "dk4pathw.h"
+#else
+#include "dk4str8.h"
+#include "dk4path8.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+int
+dk4strx_cpy_s(wxChar *dst, size_t sz, const wxChar *src, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_cpy_s(dst, sz, src, erp));
+#else
+ return (dk4str8_cpy_s(dst, sz, src, erp));
+#endif
+}
+
+
+
+int
+dk4strx_cat_s(wxChar *dst, size_t sz, const wxChar *src, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_cat_s(dst, sz, src, erp));
+#else
+ return (dk4str8_cat_s(dst, sz, src, erp));
+#endif
+}
+
+
+
+void
+dk4strx_cpy_to_left(wxChar *dst, const wxChar *src)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4strw_cpy_to_left(dst, src);
+#else
+ dk4str8_cpy_to_left(dst, src);
+#endif
+}
+
+
+
+size_t
+dk4strx_len(const wxChar *src)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_len(src));
+#else
+ return (dk4str8_len(src));
+#endif
+}
+
+
+
+int
+dk4strx_cmp(const wxChar *s1, const wxChar *s2)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_cmp(s1, s2));
+#else
+ return (dk4str8_cmp(s1, s2));
+#endif
+}
+
+
+
+int
+dk4strx_casecmp(const wxChar *s1, const wxChar *s2)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_casecmp(s1, s2));
+#else
+ return (dk4str8_casecmp(s1, s2));
+#endif
+}
+
+
+
+int
+dk4strx_pathcmp(const wxChar *s1, const wxChar *s2)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_pathcmp(s1, s2));
+#else
+ return (dk4str8_pathcmp(s1, s2));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_chr(const wxChar *s, wxChar c)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_chr(s, c));
+#else
+ return (dk4str8_chr(s, c));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_rchr(const wxChar *s, wxChar c)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_rchr(s, c));
+#else
+ return (dk4str8_rchr(s, c));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_sep(wxChar **stringp, const wxChar *delim)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_sep(stringp, delim));
+#else
+ return (dk4str8_sep(stringp, delim));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_start(const wxChar *src, const wxChar *delim)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_start(src, delim));
+#else
+ return (dk4str8_start(src, delim));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_next(wxChar *src, const wxChar *delim)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_next(src, delim));
+#else
+ return (dk4str8_next(src, delim));
+#endif
+}
+
+
+
+size_t
+dk4strx_tokenize(
+ wxChar **dpp, size_t szdpp, wxChar *src, const wxChar *delim, dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_tokenize(dpp, szdpp, src, delim, erp));
+#else
+ return (dk4str8_tokenize(dpp, szdpp, src, delim, erp));
+#endif
+}
+
+
+
+void
+dk4strx_normalize(wxChar *src, const wxChar *delim)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4strw_normalize(src, delim);
+#else
+ dk4str8_normalize(src, delim);
+#endif
+}
+
+
+
+int
+dk4strx_array_index(const wxChar * const *arr, const wxChar *str, int cs)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_array_index(arr, str, cs));
+#else
+ return (dk4str8_array_index(arr, str, cs));
+#endif
+}
+
+
+
+int
+dk4strx_abbr_index(
+ const wxChar * const *arr,
+ wxChar spec,
+ const wxChar *str,
+ int cs
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_abbr_index(arr, spec, str, cs));
+#else
+ return (dk4str8_abbr_index(arr, spec, str, cs));
+#endif
+}
+
+
+
+int
+dk4strx_is_abbr(const wxChar *str, const wxChar *pattern, wxChar spec, int cs)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_is_abbr(str, pattern, spec, cs));
+#else
+ return (dk4str8_is_abbr(str, pattern, spec, cs));
+#endif
+}
+
+
+
+int
+dk4strx_is_bool(const wxChar *str)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_is_bool(str));
+#else
+ return (dk4str8_is_bool(str));
+#endif
+}
+
+
+
+int
+dk4strx_is_on(const wxChar *str)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_is_on(str));
+#else
+ return (dk4str8_is_on(str));
+#endif
+}
+
+
+
+#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
+ || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+
+wxChar *
+dk4strx_dup(const wxChar *src, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4strw_dup(src, erp));
+#else
+ return (dk4str8_dup(src, erp));
+#endif
+}
+
+#endif
+/* if (defined(_WIN32) ... */
+
+void
+dk4strx_rtwh(wxChar *str, const wxChar *whsp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4strw_rtwh(str, whsp);
+#else
+ dk4str8_rtwh(str, whsp);
+#endif
+}
+
+
+
+void
+dk4strx_delnl(wxChar *lptr)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4strw_delnl(lptr);
+#else
+ dk4str8_delnl(lptr);
+#endif
+}
+
+
+wxChar const *
+dk4strx_get_path_suffix(wxChar const *filename, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_get_suffix(filename, erp));
+#else
+ return (dk4path8_get_suffix(filename, erp));
+#endif
+}
+
diff --git a/support/dktools/dk4pathx.h b/support/dktools/dk4pathx.h
new file mode 100644
index 0000000000..be9d44ee7b
--- /dev/null
+++ b/support/dktools/dk4pathx.h
@@ -0,0 +1,114 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pathx.cpt
+*/
+
+#ifndef DK4PATHX_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4PATHX_H_INCLUDED 1
+
+
+#line 8 "dk4pathx.cpt"
+
+/** @file dk4pathx.h String operations for path names (wxChar).
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strx.h"
+#else
+#include <dktools-4/dk4strx.h>
+#endif
+#endif
+
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#if DK4_HAVE_WX_CHARTYPE_H
+#ifndef WX_CHARTYPE_H_INCLUDED
+#include <wx/chartype.h>
+#define WX_CHARTYPE_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_WX_WXCHAR_H
+#ifndef WX_WXCHAR_H_INCLUDED
+#include <wx/wxchar.h>
+#define WX_WXCHAR_H_INCLUDED 1
+#endif
+#else
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED
+#endif
+#endif
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+
+#endif
diff --git a/support/dktools/dk4pppt.c b/support/dktools/dk4pppt.c
new file mode 100644
index 0000000000..5ac293cb0a
--- /dev/null
+++ b/support/dktools/dk4pppt.c
@@ -0,0 +1,3018 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pppt.ctr
+*/
+
+/** @file dk4pppt.c The dk4pppt module.
+*/
+
+
+#line 1423 "dk4pppt.ctr"
+
+#include "dk4conf.h"
+
+#ifdef DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#define _USE_MATH_DEFINES 1
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4PPPT_H_INCLUDED
+#include "dk4pppt.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#include "dk4enc.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRMF_H_INCLUDED
+#include "dk4strmf.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 1487 "dk4pppt.ctr"
+
+
+
+/** Constant text fragments.
+*/
+static const dkChar * const dk4pppt_dk_kw[] = {
+/* 0 */
+dkT("-i.pdf"),
+
+/* 1 */
+dkT(".pdf"),
+
+/* 2 */
+dkT(".ps"),
+
+/* 3 */
+dkT(".eps"),
+
+NULL
+
+
+#line 1502 "dk4pppt.ctr"
+};
+
+
+
+/** Constant text fragments
+*/
+static const char * const dk4pppt_c8_kw[] = {
+/* 0 */
+"\\put(",
+
+/* 1 */
+",",
+
+/* 2 */
+"){",
+
+/* 3 */
+"}%\n",
+
+/* 4 */
+"\\makebox(0,0)[lb]{",
+
+/* 5 */
+"\\makebox(0,0)[b]{",
+
+/* 6 */
+"\\makebox(0,0)[rb]{",
+
+/* 7 */
+"\\makebox(0,0)[l]{",
+
+/* 8 */
+"\\makebox(0,0){",
+
+/* 9 */
+"\\makebox(0,0)[r]{",
+
+/* 10 */
+"\\makebox(0,0)[lt]{",
+
+/* 11 */
+"\\makebox(0,0)[t]{",
+
+/* 12 */
+"\\makebox(0,0)[rt]{",
+
+/* 13 */
+"}",
+
+/* 14 */
+"\\smash{",
+
+/* 15 */
+"{",
+
+/* 16 */
+"\\PPPTfo",
+
+/* 17 */
+"\\begin{picture}(0,0)\n",
+
+/* 18 */
+"\\end{picture}%\n\\setlength{\\unitlength}{1bp}%\n",
+
+/* 19 */
+"\\includegraphics{",
+
+/* 20 */
+"}\n",
+
+/* 21 */
+"\\end{picture}%\n",
+
+/* 22 */
+"\\begin{picture}(",
+
+/* 23 */
+")\n",
+
+/* 24 */
+"{}",
+
+/* 25 */
+"\\colorbox{white}{",
+
+/* 26 */
+"\\ovalbox{",
+
+/* 27 */
+"\\rotatebox{",
+
+/* 28 */
+"}{",
+
+NULL
+
+
+#line 1585 "dk4pppt.ctr"
+};
+
+
+
+/** Reset a success variable.
+ @param backptr Address of success variable to reset.
+*/
+static
+void
+dk4pppt_reset(int *backptr)
+{
+ if (NULL != backptr) {
+ *backptr = 0;
+ }
+}
+
+
+
+/** Check whether a value is within a specified range.
+ @param min Minimum value (inclusive).
+ @param max Maximum value (inclusive).
+ @param val Value to check.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4pppt_in_range(double min, double max, double val)
+{
+ int back = 0;
+ if ((min <= val) && (max >= val)) {
+ back = 1;
+ }
+ return back;
+}
+
+
+
+/** Release preamble lines.
+ @param ps Preamble lines storage.
+ @param pi Preamble lines iterator.
+*/
+static
+void
+dk4pppt_release_preamble_lines(
+ dk4_sto_t *ps,
+ dk4_sto_it_t *pi
+)
+{
+ dk4_gra_preamble_line_t *pl;
+
+ if (NULL != ps) {
+ if (NULL != pi) {
+ dk4sto_it_reset(pi);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(pi);
+ if (NULL != pl) {
+ dk4gratool_preamble_delete(pl);
+ }
+ } while (NULL != pl);
+ dk4sto_it_close(pi);
+ }
+ dk4sto_close(ps);
+ }
+}
+
+
+
+void
+dk4pppt_close(
+ dk4_pppt_t *pppt
+)
+{
+
+
+#line 1658 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (NULL != pppt) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ if (NULL != pppt->out.pgf) {
+ dk4gra_close(pppt->out.pgf);
+ pppt->out.pgf = NULL;
+ }
+ } break;
+ default : { /* PDF+TeX or EPS+TeX */
+ dk4pppt_release_preamble_lines(
+ pppt->out.ppt.s_f, pppt->out.ppt.i_f
+ );
+ dk4pppt_release_preamble_lines(
+ pppt->out.ppt.s_p, pppt->out.ppt.i_p
+ );
+ dk4pppt_release_preamble_lines(
+ pppt->out.ppt.s_o, pppt->out.ppt.i_o
+ );
+ pppt->out.ppt.s_f =
+ pppt->out.ppt.s_p =
+ pppt->out.ppt.s_o = NULL;
+ pppt->out.ppt.i_f =
+ pppt->out.ppt.i_p =
+ pppt->out.ppt.i_o = NULL;
+ if (NULL != pppt->out.ppt.tms) {
+ dk4stream_close(pppt->out.ppt.tms, NULL);
+ pppt->out.ppt.tms = NULL;
+ }
+ if (NULL != pppt->out.ppt.tmb) {
+ dk4membuf_close(pppt->out.ppt.tmb);
+ pppt->out.ppt.tmb = NULL;
+ }
+ if (NULL != pppt->out.ppt.fc) {
+ dk4fontc_close(pppt->out.ppt.fc);
+ pppt->out.ppt.fc = NULL;
+ }
+ if (NULL != pppt->out.ppt.gra) {
+ dk4gra_close(pppt->out.ppt.gra);
+ pppt->out.ppt.gra = NULL;
+ }
+ if (NULL != pppt->out.ppt.tfn) {
+ dk4mem_free(pppt->out.ppt.tfn);
+ pppt->out.ppt.tfn = NULL;
+ }
+ } break;
+ }
+ dk4mem_free(pppt);
+ }
+
+
+#line 1710 "dk4pppt.ctr"
+}
+
+
+
+/** Open a PGF output structure.
+ @param texname Name of TeX output file.
+ The name ends on ".tex".
+ The name of the included *.eps or *.pdf file
+ is derived from this name.
+ @param dr Output driver.
+ @param isdoc Flag: Produce LaTeX document, not just image.
+ @param flags Additional flags for graphics.
+ @param width Image width in bp (PS point).
+ @param height Image height in bp.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+*/
+static
+dk4_pppt_t *
+dk4pppt_pgf_open(
+ const dkChar *texname,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_er_t *erp
+)
+{
+ dk4_pppt_t *back = NULL;
+
+
+#line 1740 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != texname);
+ assert(0 < width);
+ assert(0 < height);
+#endif
+ back = dk4mem_new(dk4_pppt_t,1,erp);
+ if (NULL != back) {
+ DK4_MEMRES(back,sizeof(dk4_pppt_t));
+ back->flags = flags;
+ back->isdoc = isdoc;
+ back->dr = DK4_PPPT_DR_PGF;
+ back->out.pgf = dk4gra_open_pgf(texname,width,height,flags,isdoc,erp);
+ if (NULL == back->out.pgf) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+
+
+#line 1758 "dk4pppt.ctr"
+ return back;
+}
+
+
+
+/** Construct output file name based on TeX file name.
+ @param obuf Output buffer.
+ @param szobuf Output buffer size (number of dkChar).
+ @param texname TeX file name.
+ @param dr Driver to produce name for.
+ @param flags Document flags.
+ @param isdoc Flag: Produce entire document.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error (buffer too short).
+*/
+static
+int
+dk4pppt_construct_output_file_name(
+ dkChar *obuf,
+ size_t szobuf,
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int flags,
+ int isdoc,
+ dk4_er_t *erp
+)
+{
+ dkChar *psuffix = NULL; /* File name existing suffix */
+ size_t kwi = 0; /* Keyword index for suffix to append */
+ int back = 0;
+
+
+#line 1789 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != obuf);
+ assert(0 < szobuf);
+ assert(NULL != texname);
+#endif
+ if (0 != dk4str_cpy_s(obuf, szobuf, texname, erp)) {
+ psuffix = dk4path_get_suffix(obuf, NULL);
+ if (NULL != psuffix) {
+ *psuffix = dkT('\0');
+ }
+ kwi = 1;
+ if (DK4_PPPT_DR_PDF_TEX == dr) {
+ if (0 != isdoc) { kwi = 0; }
+ }
+ else {
+ kwi = 2;
+ if (0 != (DK4_GRA_DOC_FLAG_EPS & flags)) { kwi = 3; }
+ }
+ back = dk4str_cat_s(obuf, szobuf, dk4pppt_dk_kw[kwi], erp);
+ }
+ if (0 == back) { obuf[0] = dkT('\0'); }
+
+
+#line 1811 "dk4pppt.ctr"
+ return back;
+}
+
+
+
+/** Open a non-PGF output structure.
+ @param texname Name of TeX output file.
+ The name ends on ".tex".
+ The name of the included *.eps or *.pdf file
+ is derived from this name.
+ @param dr Output driver.
+ @param isdoc Flag: Produce LaTeX document, not just image.
+ @param flags Additional flags for graphics.
+ @param width Image width in bp (PS point).
+ @param height Image height in bp.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+*/
+static
+dk4_pppt_t *
+dk4pppt_ppt_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_er_t *erp
+)
+{
+ dkChar ofnbuf[DK4_MAX_PATH]; /* Buffer to construct name */
+#if DK4_CHAR_SIZE > 1
+ char tb[DK4_MAX_PATH]; /* ANSI file name */
+#endif
+ dk4_pppt_t *back = NULL; /* Function result */
+ int res = 0; /* Operation result */
+ int ok = 0; /* Flag: Everything ok */
+
+
+#line 1849 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != texname);
+#endif
+ res = dk4pppt_construct_output_file_name(
+ ofnbuf, DK4_SIZEOF(ofnbuf,dkChar), texname, dr, flags, isdoc, erp
+ );
+ if (0 != res) {
+ back = dk4mem_new(dk4_pppt_t,1,erp);
+ if (NULL != back) {
+ DK4_MEMRES(back,sizeof(dk4_pppt_t));
+ back->flags = flags;
+ back->isdoc = isdoc;
+ back->dr = dr;
+ back->out.ppt.tfn = NULL;
+ back->out.ppt.gra = NULL;
+ back->out.ppt.fc = NULL;
+ back->out.ppt.tmb = NULL;
+ back->out.ppt.tms = NULL;
+ back->out.ppt.s_f = NULL;
+ back->out.ppt.i_f = NULL;
+ back->out.ppt.s_p = NULL;
+ back->out.ppt.i_p = NULL;
+ back->out.ppt.s_o = NULL;
+ back->out.ppt.i_o = NULL;
+ back->out.ppt.dfs = -1.0;
+ back->out.ppt.n_f = 0UL;
+ back->out.ppt.n_p = 0UL;
+ back->out.ppt.n_o = 0UL;
+ back->out.ppt.tfn = dk4str_dup(texname, erp);
+ if (NULL != back->out.ppt.tfn) {
+ if (DK4_PPPT_DR_EPS_TEX == dr) {
+ back->out.ppt.gra = dk4gra_open_ps(
+ ofnbuf, width, height, flags, erp
+ );
+ }
+ else {
+ back->out.ppt.gra = dk4gra_open_pdf(
+ ofnbuf, width, height, flags, erp
+ );
+ }
+ if (NULL != back->out.ppt.gra) {
+ back->out.ppt.fc = dk4fontc_open(erp);
+ if (NULL != back->out.ppt.fc) {
+ back->out.ppt.tmb = dk4membuf_open(erp);
+ if (NULL != back->out.ppt.tmb) {
+ back->out.ppt.tms = dk4stream_open_membuf_writer(
+ back->out.ppt.tmb, erp
+ );
+ if (NULL != back->out.ppt.tms) {
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ ok = dk4recode_dk_to_any(
+ tb, sizeof(tb), DK4_FILE_ENCODING_WIN1252,
+ ofnbuf, DK4_ENCODING_32, erp
+ );
+#else
+ ok = dk4recode_dk_to_any(
+ tb, sizeof(tb), DK4_FILE_ENCODING_WIN1252,
+ ofnbuf, DK4_ENCODING_UTF16, erp
+ );
+#endif
+#else
+ ok = 1;
+#endif
+ }
+ }
+ }
+ }
+ }
+ if (0 == ok) {
+ dk4pppt_close(back);
+ back = NULL;
+ }
+ }
+ }
+
+
+#line 1925 "dk4pppt.ctr"
+ return back;
+}
+
+
+
+dk4_pppt_t *
+dk4pppt_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_er_t *erp
+)
+{
+ dk4_pppt_t *back = NULL;
+ int ok = 1;
+
+
+#line 1944 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != texname);
+ assert(0 < width);
+ assert(0 < height);
+#endif
+ if ((NULL != texname) && (0 < width) && (0 < height)) {
+ switch (dr) {
+ case DK4_PPPT_DR_PGF : {
+
+
+#line 1953 "dk4pppt.ctr"
+ back = dk4pppt_pgf_open(
+ texname, isdoc, flags, width, height, erp
+ );
+ } break;
+ case DK4_PPPT_DR_EPS_TEX : {
+ /*
+ Cannot create document for PS output, check here
+ */
+
+
+#line 1962 "dk4pppt.ctr"
+ if (0 == isdoc) {
+ back = dk4pppt_ppt_open(
+ texname, dr, isdoc, flags, width, height, erp
+ );
+ }
+ else {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ default : { /* DK4_PPPT_DR_PDF_TEX */
+
+
+#line 1973 "dk4pppt.ctr"
+ back = dk4pppt_ppt_open(
+ texname, dr, isdoc, flags, width, height, erp
+ );
+ } break;
+ }
+ if (NULL != back) {
+ switch (dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_page_with_flags(
+ back->out.pgf, flags, &ok, erp
+ );
+ } break;
+ default : {
+ dk4gra_page_with_flags(
+ back->out.ppt.gra, flags, &ok, erp
+ );
+ } break;
+ }
+ if (0 == ok) {
+ dk4pppt_close(back);
+ back = NULL;
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 2001 "dk4pppt.ctr"
+ return back;
+}
+
+
+
+/** Check whether pppt object state grants graphics and text operations.
+ @param pppt Structure to check.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4pppt_is_state_ok(
+ const dk4_pppt_t *pppt
+)
+{
+ int back = 0;
+
+ /* Check for valid pointer
+ */
+ if (NULL == pppt) {
+ goto finished;
+ }
+ /* Remaining checks depend on driver
+ */
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ if (NULL != pppt->out.pgf) {
+ back = 1;
+ }
+ } break;
+ default : {
+ if (NULL != pppt->out.ppt.gra) {
+ if (NULL != pppt->out.ppt.fc) {
+ if (NULL != pppt->out.ppt.tmb) {
+ if (NULL != pppt->out.ppt.tms) {
+ if (NULL != pppt->out.ppt.tfn) {
+ back = 1;
+ }
+ }
+ }
+ }
+ }
+ } break;
+ }
+ finished:
+ return back;
+}
+
+
+
+/** Convert backslashes to forward slashes for use of file name in LaTeX.
+ @param fn String to correct.
+*/
+static
+void
+dk4pppt_to_slash(char *fn)
+{
+ while ('\0' != *fn) {
+ if ('\\' == *fn) { *fn = '/'; }
+ fn++;
+ }
+}
+
+
+
+/** Write file name to includegraphics instruction.
+ @param ostrm Destination output stream.
+ @param fn File name to print.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4pppt_file_name_to_stream(
+ dk4_stream_t *ostrm,
+ const dkChar *fn,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ char buf[DK4_MAX_PATH];
+ char *p1 = NULL;
+ char *p2 = NULL;
+ int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != fn);
+#endif
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ res = dk4recode_dk_to_any(
+ buf, sizeof(buf), DK4_FILE_ENCODING_WIN1252, fn, DK4_ENCODING_32, erp
+ );
+#else
+ res = dk4recode_dk_to_any(
+ buf, sizeof(buf), DK4_FILE_ENCODING_WIN1252, fn, DK4_ENCODING_UTF16, erp
+ );
+#endif
+#else
+ res = dk4str8_cpy_s(buf, sizeof(buf), fn, erp);
+#endif
+ if (0 != res) {
+ dk4pppt_to_slash(buf);
+ if (0 != dk4path_is_absolute(fn)) {
+ res = dk4stream_write_char_string(ostrm, buf, erp);
+ if (0 == res) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+ p2 = buf;
+ while ('\0' != *p2) {
+ if ('/' == *p2) { p1 = p2; }
+ p2++;
+ }
+ if (NULL != p1) { p1++; }
+ else { p1 = buf; }
+ res = dk4stream_write_char_string(ostrm, p1, erp);
+ if (0 == res) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** Write output data.
+ @param pppt Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4pppt_write(
+ dk4_pppt_t *pppt,
+ dk4_er_t *erp
+)
+{
+ FILE *fout = NULL;
+ dk4_stream_t *ostrm = NULL;
+ int tests = DK4_FOPEN_SC_USER;
+ int res = 0;
+ int back = 0;
+
+
+#line 2149 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ back = 1;
+ dk4gra_write_and_close(pppt->out.pgf, &back, erp);
+ pppt->out.pgf = NULL;
+ } break;
+ default : {
+ /*
+ Write *.tex file first, as name of graphics file is in gra
+ */
+ if (0 != dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
+ fout = dk4fopen(pppt->out.ppt.tfn, dkT("wb"), tests, erp);
+ if (NULL != fout) {
+ ostrm = dk4stream_open_for_file(
+ fout, DK4_STREAM_WRITE, 0, 0, erp
+ );
+ if (NULL != ostrm) {
+ back = 1;
+ if (0 != pppt->isdoc) {
+ dk4gratool_start_standalone_document(
+ ostrm, pppt->out.ppt.gra, 0, pppt->out.ppt.dfs,
+ pppt->out.ppt.s_f, pppt->out.ppt.i_f,
+ pppt->out.ppt.s_p, pppt->out.ppt.i_p,
+ pppt->out.ppt.s_o, pppt->out.ppt.i_o,
+ &back, erp
+ );
+ }
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[17], &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[19], &back, erp
+ );
+ dk4pppt_file_name_to_stream(
+ ostrm, pppt->out.ppt.gra->fn, &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[20], &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[18], &back, erp
+ );
+ dk4gratool_font_definitions(
+ ostrm, pppt->out.ppt.fc, &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[22], &back, erp
+ );
+ dk4gratool_stream_uint(
+ ostrm, pppt->out.ppt.gra->w, 0, &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[1], &back, erp
+ );
+ dk4gratool_stream_uint(
+ ostrm, pppt->out.ppt.gra->h, 0, &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[23], &back, erp
+ );
+ if (NULL != pppt->out.ppt.tms) {
+ if (0 == dk4stream_close(pppt->out.ppt.tms, erp)) {
+ back = 0;
+ }
+ pppt->out.ppt.tms = NULL;
+ }
+ if (NULL != pppt->out.ppt.tmb) {
+ res = dk4membuf_to_stream(ostrm,pppt->out.ppt.tmb,erp);
+ if (0 == res) {
+ back = 0;
+ }
+ }
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[21], &back, erp
+ );
+ if (0 != pppt->isdoc) {
+ dk4gratool_end_standalone_document(ostrm, &back, erp);
+ }
+ if (0 == dk4stream_close(ostrm, erp)) { back = 0; }
+ /*
+ Write and close the real graphics
+ */
+ dk4gra_write_and_close(
+ pppt->out.ppt.gra, &back, erp
+ );
+ pppt->out.ppt.gra = NULL;
+ }
+ if (0 != fclose(fout)) { back = 0; }
+ }
+ } break;
+ }
+
+
+#line 2244 "dk4pppt.ctr"
+ return back;
+}
+
+
+
+int
+dk4pppt_write_and_close(
+ dk4_pppt_t *pppt,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+
+#line 2258 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (NULL != pppt) {
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ back = dk4pppt_write(pppt, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ dk4pppt_close(pppt);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 2274 "dk4pppt.ctr"
+ return back;
+}
+
+
+
+void
+dk4pppt_set_gs_for_pattern_only(
+ dk4_pppt_t *pppt,
+ int val,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2287 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_gs_for_pattern_only(
+ pppt->out.pgf, val, erp
+ );
+ } break;
+ default : {
+ dk4gra_set_gs_for_pattern_only(
+ pppt->out.ppt.gra, val, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 2308 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_gsave(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2320 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_gsave(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_gsave(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2338 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_grestore(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2350 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_grestore(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_grestore(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2368 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_line_width(
+ dk4_pppt_t *pppt,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2381 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (0.0 <= lw)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_line_width(pppt->out.pgf, lw, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_line_width(pppt->out.ppt.gra, lw, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2399 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_line_style(
+ dk4_pppt_t *pppt,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2413 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (0.0 <= sv)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_line_style(pppt->out.pgf, ls, sv, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_line_style(pppt->out.ppt.gra, ls, sv, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2431 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_line_cap(
+ dk4_pppt_t *pppt,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2444 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_line_cap(pppt->out.pgf, lc, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_line_cap(pppt->out.ppt.gra, lc, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2462 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_line_join(
+ dk4_pppt_t *pppt,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2476 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_line_join(pppt->out.pgf, lj, ml, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_line_join(pppt->out.ppt.gra, lj, ml, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2494 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_fill_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2507 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (0.0 <= g) && (1.0 >= g)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_fill_gray(pppt->out.pgf, g, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_fill_gray(pppt->out.ppt.gra, g, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2525 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_fill_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2540 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt))
+ && (dk4pppt_in_range(0.0, 1.0, r))
+ && (dk4pppt_in_range(0.0, 1.0, g))
+ && (dk4pppt_in_range(0.0, 1.0, b))
+ )
+ {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+
+
+#line 2552 "dk4pppt.ctr"
+ dk4gra_set_fill_rgb(pppt->out.pgf, r, g, b, backptr, erp);
+ } break;
+ default : {
+
+
+#line 2556 "dk4pppt.ctr"
+ dk4gra_set_fill_rgb(pppt->out.ppt.gra, r, g, b, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2565 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_fill_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2581 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt))
+ && (dk4pppt_in_range(0.0, 1.0, c)) && (dk4pppt_in_range(0.0, 1.0, m))
+ && (dk4pppt_in_range(0.0, 1.0, y)) && (dk4pppt_in_range(0.0, 1.0, k))
+ ) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_fill_cmyk(pppt->out.pgf, c, m, y, k, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_fill_cmyk(pppt->out.ppt.gra,c,m,y,k,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2602 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_stroke_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2615 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (dk4pppt_in_range(0.0, 1.0, g))) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_stroke_gray(pppt->out.pgf, g, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_stroke_gray(pppt->out.ppt.gra, g, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2633 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_stroke_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2648 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (
+ (0 != dk4pppt_is_state_ok(pppt)) && (dk4pppt_in_range(0.0, 1.0, r))
+ && (dk4pppt_in_range(0.0, 1.0, g)) && (dk4pppt_in_range(0.0, 1.0, b))
+ ) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_stroke_rgb(pppt->out.pgf, r, g, b, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_stroke_rgb(pppt->out.ppt.gra, r, g, b, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2669 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_stroke_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2685 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (
+ (0 != dk4pppt_is_state_ok(pppt))
+ && (dk4pppt_in_range(0.0, 1.0, c)) && (dk4pppt_in_range(0.0, 1.0, m))
+ && (dk4pppt_in_range(0.0, 1.0, y)) && (dk4pppt_in_range(0.0, 1.0, k))
+ ) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_stroke_cmyk(pppt->out.pgf, c, m, y, k, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_stroke_cmyk(pppt->out.ppt.gra,c,m,y,k,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2707 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_prepare_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2719 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_prepare_fill(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_prepare_fill(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2737 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_prepare_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2749 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_prepare_stroke(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_prepare_stroke(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2767 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_prepare_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2779 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_prepare_fill_and_stroke(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_prepare_fill_and_stroke(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2797 "dk4pppt.ctr"
+}
+
+
+
+int
+dk4pppt_can_fill_and_stroke(
+ const dk4_pppt_t *pppt
+)
+{
+ int back = 0;
+
+
+#line 2808 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ back = dk4gra_can_fill_and_stroke(pppt->out.pgf);
+ } break;
+ default : {
+ back = dk4gra_can_fill_and_stroke(pppt->out.ppt.gra);
+ } break;
+ }
+ }
+
+
+#line 2822 "dk4pppt.ctr"
+ return back;
+}
+
+
+
+void
+dk4pppt_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2835 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_fill(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_fill(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2853 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2865 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_stroke(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_stroke(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2883 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2895 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_fill_and_stroke(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_fill_and_stroke(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2913 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_clip(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2925 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_clip(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_clip(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 2943 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_pattern_line_width(
+ dk4_pppt_t *pppt,
+ double plw
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (NULL != pppt) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_pattern_line_width(pppt->out.pgf, plw);
+ } break;
+ default : {
+ dk4gra_set_pattern_line_width(pppt->out.ppt.gra, plw);
+ } break;
+ }
+ }
+}
+
+
+
+void
+dk4pppt_pattern(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2983 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pattern(pppt->out.pgf, xl, xr, yb, yt, pn, backptr, erp);
+ } break;
+ default : {
+ dk4gra_pattern(pppt->out.ppt.gra,xl,xr,yb,yt,pn,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3001 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_newpath_moveto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3016 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+
+
+#line 3023 "dk4pppt.ctr"
+ dk4gra_newpath_moveto(pppt->out.pgf, x, y, bbptr, backptr, erp);
+ } break;
+ default : {
+
+
+#line 3027 "dk4pppt.ctr"
+ dk4gra_newpath_moveto(pppt->out.ppt.gra,x,y,bbptr,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3036 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_lineto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3051 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_lineto(pppt->out.pgf, x, y, bbptr, backptr, erp);
+ } break;
+ default : {
+ dk4gra_lineto(pppt->out.ppt.gra, x, y, bbptr, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3069 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_curveto(
+ dk4_pppt_t *pppt,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3088 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_curveto(
+ pppt->out.pgf, xc1, yc1, xc2, yc2, x, y, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_curveto(
+ pppt->out.ppt.gra,xc1,yc1,xc2,yc2,x,y,bbptr,backptr,erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3110 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_closepath(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3122 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_closepath(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_closepath(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3140 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_bif_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3162 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != bif);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_bif_fig_image(
+ pppt->out.pgf, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_bif_fig_image(
+ pppt->out.ppt.gra,
+ xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3188 "dk4pppt.ctr"
+}
+
+
+void
+dk4pppt_bif_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3208 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != bif);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_bif_image(
+ pppt->out.pgf, xl, xr, yb, yt, bif, fn, fno,
+ ifl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_bif_image(
+ pppt->out.ppt.gra, xl, xr, yb, yt, bif, fn, fno,
+ ifl, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3233 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3254 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != fn);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_image(
+ pppt->out.pgf, xl, xr, yb, yt, fn, fno, ctx,
+ ifl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_image(
+ pppt->out.ppt.gra, xl, xr, yb, yt, fn, fno, ctx,
+ ifl, bbptr, backptr, erp
+ );
+
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3280 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3302 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != fn);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_fig_image(
+ pppt->out.pgf, xl, xr, yb, yt, fn, fno, ctx,
+ pos, ifl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_fig_image(
+ pppt->out.ppt.gra, xl, xr, yb, yt, fn, fno, ctx,
+ pos, ifl, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3327 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_circle(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3343 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_circle(pppt->out.pgf, xc, yc, r, bbptr, backptr, erp);
+ } break;
+ default : {
+ dk4gra_circle(pppt->out.ppt.gra,xc,yc,r,bbptr,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3361 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_rectangle(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3379 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_rectangle(pppt->out.pgf,xl,xr,yb,yt,r,bbptr,backptr,erp);
+ } break;
+ default : {
+ dk4gra_rectangle(
+ pppt->out.ppt.gra, xl, xr, yb, yt, r, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3399 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_arc(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3418 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_arc(
+ pppt->out.pgf,
+ xc, yc, ra, start, end, cl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_arc(
+ pppt->out.ppt.gra,
+ xc, yc, ra, start, end, cl, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3442 "dk4pppt.ctr"
+}
+
+
+void
+dk4pppt_ellipse(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3459 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_ellipse(
+ pppt->out.pgf, xc, yc, rx, ry, rot, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_ellipse(
+ pppt->out.ppt.gra, xc, yc, rx, ry, rot, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3481 "dk4pppt.ctr"
+}
+
+
+
+static
+void
+dk4pppt_kw_out(
+ dk4_pppt_t *pppt,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4gratool_stream_string(
+ pppt->out.ppt.tms, dk4pppt_c8_kw[kwi], backptr, erp
+ );
+}
+
+
+
+static
+void
+dk4pppt_double_out(
+ dk4_pppt_t *pppt,
+ double val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4gratool_stream_double(
+ pppt->out.ppt.tms, val, backptr, erp
+ );
+}
+
+
+
+/** Handle one text piece, normal or special.
+ @param pppt Output structure.
+ @param x X position.
+ @param y Y position.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to write, dkChar for normal text, char for special.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Input encoding for normal text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param isnt Flag: Normal text.
+ @param fno Font id number.
+ @param fsz Font size.
+ @param fex Flag: Use font exactly as specified.
+ @param uc2l Unicode to LaTeX converter, may be NULL for special text.
+ @param flags Text flags.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4pppt_i_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const void *txt,
+ const char *colspec,
+ int ie,
+ int ha,
+ int va,
+ int isnt,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4gra_col_t *pcolf = NULL; /* Fill color */
+ dk4_gra_ps_page_t *pgps = NULL; /* PS page */
+ dk4_gra_pdf_page_t *pgpdf = NULL; /* PDF page */
+ size_t fontno = 0; /* Font number */
+ size_t kwi = 4; /* Keyword index */
+ int res = 0; /* One operation result */
+ int dorot = 0; /* Flag: Use rotatebox */
+
+
+
+#line 3567 "dk4pppt.ctr"
+
+
+#line 3568 "dk4pppt.ctr"
+ /* Attempt to register font
+ */
+ if (1.0e-8 < fabs(rot)) { dorot = 1; }
+ if (0 != isnt) {
+
+#line 3572 "dk4pppt.ctr"
+ if (0 == dk4fontc_add_font(&fontno, pppt->out.ppt.fc, fno, fsz, fex, erp)) {
+
+
+#line 3574 "dk4pppt.ctr"
+ goto finished;
+ }
+ }
+ /* Find non-stroking color
+ */
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PDF_TEX : {
+
+#line 3581 "dk4pppt.ctr"
+ pgpdf = (dk4_gra_pdf_page_t *)(pppt->out.ppt.gra->curpg);
+ if (NULL != pgpdf) {
+ pcolf = &(pgpdf->attr.col_fill_requested);
+ }
+ else {
+
+#line 3586 "dk4pppt.ctr"
+ goto finished;
+ }
+ } break;
+ case DK4_PPPT_DR_EPS_TEX : {
+
+#line 3590 "dk4pppt.ctr"
+ pgps = (dk4_gra_ps_page_t *)(pppt->out.ppt.gra->curpg);
+ if (NULL != pgps) {
+ pcolf = &(pgps->attr.col_fill_requested);
+ }
+ else {
+
+#line 3595 "dk4pppt.ctr"
+ goto finished;
+ }
+ } break;
+ default : {
+ /* Empty by intent */
+ } break;
+ }
+ if (NULL == pcolf) {
+
+#line 3603 "dk4pppt.ctr"
+ goto finished;
+ }
+ /* put(
+ */
+ dk4pppt_kw_out(pppt, 0, backptr, erp);
+
+
+#line 3609 "dk4pppt.ctr"
+ /* X
+ */
+ dk4pppt_double_out(pppt, x, backptr, erp);
+
+
+#line 3613 "dk4pppt.ctr"
+ /* ,
+ */
+ dk4pppt_kw_out(pppt, 1, backptr, erp);
+
+
+#line 3617 "dk4pppt.ctr"
+ /* Y
+ */
+ dk4pppt_double_out(pppt, y, backptr, erp);
+
+
+#line 3621 "dk4pppt.ctr"
+ /* ){
+ */
+ dk4pppt_kw_out(pppt, 2, backptr, erp);
+
+
+#line 3625 "dk4pppt.ctr"
+ if (0 != dorot) {
+
+#line 3626 "dk4pppt.ctr"
+ /*
+ Open rotatebox
+ */
+ dk4pppt_kw_out(pppt, 27, backptr, erp);
+
+
+#line 3631 "dk4pppt.ctr"
+ dk4pppt_double_out(pppt, rot, backptr, erp);
+
+
+#line 3633 "dk4pppt.ctr"
+ dk4pppt_kw_out(pppt, 28, backptr, erp);
+
+
+#line 3635 "dk4pppt.ctr"
+ }
+ /* Find index of makebox instruction depending on alignment
+ */
+ switch (va) {
+ case DK4_TEXT_ALIGN_V_TOP : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 11;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 12;
+ } break;
+ default : { /* left */
+ kwi = 10;
+ } break;
+ }
+ } break;
+ case DK4_TEXT_ALIGN_V_CENTERED : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 8;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 9;
+ } break;
+ default : { /* left */
+ kwi = 7;
+ } break;
+ }
+ } break;
+ default : { /* base or bottom */
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 5;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 6;
+ } break;
+ default : { /* left */
+ kwi = 4;
+ } break;
+ }
+ } break;
+ }
+ /* Start makebox
+ */
+ dk4pppt_kw_out(pppt, kwi, backptr, erp);
+
+
+#line 3683 "dk4pppt.ctr"
+ /* Start smash
+ */
+ if (DK4_TEXT_ALIGN_V_BASELINE == va) {
+ dk4pppt_kw_out(pppt, 14, backptr, erp);
+
+
+#line 3688 "dk4pppt.ctr"
+ }
+ /* Start group
+ */
+ dk4pppt_kw_out(pppt, 15, backptr, erp);
+
+
+#line 3693 "dk4pppt.ctr"
+ /* Open white box
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_WHITE_BOX & flags)) {
+ dk4pppt_kw_out(pppt, 25, backptr, erp);
+
+
+#line 3698 "dk4pppt.ctr"
+ }
+ /* Color
+ */
+ if (NULL != colspec) {
+ res = dk4stream_write_char_string(pppt->out.ppt.tms, colspec, erp);
+ if (0 == res) {
+
+#line 3704 "dk4pppt.ctr"
+ dk4pppt_reset(backptr);
+
+
+#line 3706 "dk4pppt.ctr"
+ }
+ }
+ else {
+ dk4gratool_stream_color(pppt->out.ppt.tms, pcolf, backptr, erp);
+
+
+#line 3711 "dk4pppt.ctr"
+ }
+ /* Open oval box
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_OVAL_BOX & flags)) {
+ dk4pppt_kw_out(pppt, 26, backptr, erp);
+
+
+#line 3717 "dk4pppt.ctr"
+ }
+ /* Font
+ */
+ if (0 != isnt) {
+ dk4pppt_kw_out(pppt, 16, backptr, erp);
+
+
+#line 3723 "dk4pppt.ctr"
+ dk4gratool_stream_num_alpha(pppt->out.ppt.tms, fontno, backptr, erp);
+
+
+#line 3725 "dk4pppt.ctr"
+ dk4pppt_kw_out(pppt, 24, backptr, erp);
+
+
+#line 3727 "dk4pppt.ctr"
+ }
+ /* Text
+ */
+ if (0 != isnt) { /* normal text */
+ res = dk4uc2l_string_encoded(
+ pppt->out.ppt.tms, uc2l, (const dkChar *)txt, ie, erp
+ );
+ if (0 == res) {
+
+#line 3735 "dk4pppt.ctr"
+ dk4pppt_reset(backptr);
+
+
+#line 3737 "dk4pppt.ctr"
+ }
+ }
+ else { /* special text */
+ res = dk4stream_write_char_string(
+ pppt->out.ppt.tms, (const char *)txt, erp
+ );
+ if (0 == res) {
+
+#line 3744 "dk4pppt.ctr"
+ dk4pppt_reset(backptr);
+
+
+#line 3746 "dk4pppt.ctr"
+ }
+ }
+ /* Close oval box
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_OVAL_BOX & flags)) {
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+
+
+#line 3753 "dk4pppt.ctr"
+ }
+ /* Close white box
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_WHITE_BOX & flags)) {
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+
+
+#line 3759 "dk4pppt.ctr"
+ }
+ /* End group
+ */
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+
+
+#line 3764 "dk4pppt.ctr"
+ /* End smash
+ */
+ if (DK4_TEXT_ALIGN_V_BASELINE == va) {
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+
+
+#line 3769 "dk4pppt.ctr"
+ }
+ /* End makebox
+ */
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+
+
+#line 3774 "dk4pppt.ctr"
+ if (0 != dorot) {
+ /*
+ End rotatebox
+ */
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+
+
+#line 3780 "dk4pppt.ctr"
+ }
+ /* } newline
+ */
+ dk4pppt_kw_out(pppt, 3, backptr, erp);
+
+
+#line 3785 "dk4pppt.ctr"
+
+ finished:
+
+
+#line 3788 "dk4pppt.ctr"
+ return;
+}
+
+
+
+void
+dk4pppt_simple_utf8_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3813 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != txt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (NULL != txt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pgf_simple_utf8_text(
+ pppt->out.pgf,
+ x, y, rot, txt, colspec, ha, va, fno, fsz, fex, uc2l,
+ flags, backptr, erp
+ );
+ } break;
+ default : {
+ dk4pppt_i_text(
+ pppt,
+ x, y, rot, txt, colspec, DK4_ENCODING_UTF8, ha, va, 1,
+ fno, fsz, fex, uc2l, flags, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3840 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_simple_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3865 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != txt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (NULL != txt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+
+#line 3872 "dk4pppt.ctr"
+ dk4gra_pgf_simple_text(
+ pppt->out.pgf,
+ x, y, rot, txt, colspec, ie, ha, va, fno, fsz, fex, uc2l,
+ flags, backptr, erp
+ );
+ } break;
+ default : {
+
+#line 3879 "dk4pppt.ctr"
+ dk4pppt_i_text(
+ pppt,
+ x, y, rot, txt, colspec, ie, ha, va, 1,
+ fno, fsz, fex, uc2l, flags, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+
+#line 3888 "dk4pppt.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3892 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_special_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3915 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != txt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (NULL != txt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pgf_special_text(
+ pppt->out.pgf,
+ x, y, rot, txt, colspec, ha, va, fno, fsz, fex,
+ flags, backptr, erp
+ );
+ } break;
+ default : {
+ dk4pppt_i_text(
+ pppt,
+ x, y, rot, txt, colspec, DK4_FILE_ENCODING_PLAIN, ha, va, 0,
+ fno, fsz, fex, NULL, flags, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3942 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_set_eorule(
+ dk4_pppt_t *pppt,
+ int val
+)
+{
+
+
+#line 3953 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_eorule(pppt->out.pgf, val);
+ } break;
+ default : {
+ dk4gra_set_eorule(pppt->out.ppt.gra, val);
+ } break;
+ }
+ }
+
+
+#line 3967 "dk4pppt.ctr"
+}
+
+
+
+void
+dk4pppt_doc_font_size(
+ dk4_pppt_t *pppt,
+ double fs,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3980 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(0.0 < fs);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (0.0 < fs)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pgf_doc_font_size(pppt->out.pgf , fs, backptr, erp);
+ } break;
+ default : {
+ pppt->out.ppt.dfs = fs;
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 3999 "dk4pppt.ctr"
+}
+
+
+
+static
+void
+dk4pppt_one_preamble_line(
+ dk4_sto_t **ps,
+ dk4_sto_it_t **pi,
+ size_t *pn,
+ char const *pline,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_preamble_line_t *pl;
+ int back = 0;
+
+ if (SIZE_MAX > *pn) {
+ if (NULL == *ps) {
+ *ps = dk4sto_open(erp);
+ if (NULL != *ps) {
+ dk4sto_set_comp(*ps, dk4gratool_compare_preamble_lines, 0);
+ }
+ }
+ if (NULL != *ps) {
+ if (NULL == *pi) {
+ *pi = dk4sto_it_open(*ps, erp);
+ }
+ if (NULL != *pi) {
+ pl = dk4gratool_preamble_new(pline, *pn, erp);
+ if (NULL != pl) {
+ if (0 != dk4sto_add(*ps, pl, erp)) {
+ back = 1;
+ }
+ else {
+ dk4gratool_preamble_delete(pl);
+ }
+ }
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (0 == back) { dk4pppt_reset(backptr); }
+}
+
+
+
+void
+dk4pppt_doc_preamble_line(
+ dk4_pppt_t *pppt,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 4059 "dk4pppt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != line);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (NULL != line)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pgf_doc_preamble_line(pppt->out.pgf,line,tp,backptr,erp);
+ } break;
+ default : {
+ switch (tp) {
+ case DK4_GRA_PREAMBLE_FONT : {
+ dk4pppt_one_preamble_line(
+ &(pppt->out.ppt.s_f), &(pppt->out.ppt.i_f),
+ &(pppt->out.ppt.n_f), line, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PREAMBLE_PACKAGE : {
+ dk4pppt_one_preamble_line(
+ &(pppt->out.ppt.s_p), &(pppt->out.ppt.i_p),
+ &(pppt->out.ppt.n_p), line, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PREAMBLE_OTHER : {
+ dk4pppt_one_preamble_line(
+ &(pppt->out.ppt.s_o), &(pppt->out.ppt.i_o),
+ &(pppt->out.ppt.n_o), line, backptr, erp
+ );
+ } break;
+ default : {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_INVALID_ARGUMENTS
+ );
+ dk4pppt_reset(backptr);
+ } break;
+ }
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+
+
+#line 4103 "dk4pppt.ctr"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4pppt.ctr b/support/dktools/dk4pppt.ctr
new file mode 100644
index 0000000000..31a37310af
--- /dev/null
+++ b/support/dktools/dk4pppt.ctr
@@ -0,0 +1,4108 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4pppt.h PGF/PDF+TeX/(E)PS+TeX output.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4FONT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4font.h"
+#else
+#include <dktools-4/dk4font.h>
+#endif
+#endif
+
+#ifndef DK4ALIGN_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4align.h"
+#else
+#include <dktools-4/dk4align.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4MEMBF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
+
+#ifndef DK4MBSTRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4mbstrm.h"
+#else
+#include <dktools-4/dk4mbstrm.h>
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4gra.h"
+#else
+#include <dktools-4/dk4gra.h>
+#endif
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4enc.h"
+#else
+#include <dktools-4/dk4enc.h>
+#endif
+#endif
+
+#ifndef DK4REC25_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4rec25.h"
+#else
+#include <dktools-4/dk4rec25.h>
+#endif
+#endif
+
+/** Output drivers.
+*/
+typedef enum {
+ DK4_PPPT_DR_PDF_TEX = 0, /**< Produce PDF+TeX file pair. */
+ DK4_PPPT_DR_EPS_TEX , /**< Produce EPS+TeX file pair. */
+ DK4_PPPT_DR_PGF /**< Produce PGF file. */
+} dk4_pppt_driver_t;
+
+
+/** Output structure for combined PDF+TeX/EPS+TeX output.
+*/
+typedef struct {
+ dkChar *tfn; /**< TeX file name. */
+ dk4_gra_t *gra; /**< Graphics structure. */
+ dk4_font_collector_t *fc; /**< Font collector. */
+ dk4_membuf_t *tmb; /**< TeX memory buffer. */
+ dk4_stream_t *tms; /**< TeX memory stream. */
+ dk4_sto_t *s_f; /**< Storage for font setup lines. */
+ dk4_sto_it_t *i_f; /**< Iterator for font setup lines. */
+ dk4_sto_t *s_p; /**< Storage for package setup lines. */
+ dk4_sto_it_t *i_p; /**< Iterator for package setup lines. */
+ dk4_sto_t *s_o; /**< Storage for other preamble lines. */
+ dk4_sto_it_t *i_o; /**< Iterator for other preamble lines. */
+ double dfs; /**< Document font size. */
+ size_t n_f; /**< Number of font setup lines. */
+ size_t n_p; /**< Number of package setup lines. */
+ size_t n_o; /**< Number of other setup lines. */
+} dk4_pppt_pdf_ps_t;
+
+
+
+/** Details structure.
+*/
+typedef union {
+ dk4_gra_t *pgf; /**< PGF output structure. */
+ dk4_pppt_pdf_ps_t ppt; /**< Output structure PDF+TeX/EPS+TeX. */
+} dk4_pppt_out_t;
+
+
+
+/** Output structure.
+*/
+typedef struct {
+ dk4_pppt_out_t out; /**< Output union. */
+ dk4_pppt_driver_t dr; /**< Driver, dk4_pppt_driver_t value. */
+ int isdoc; /**< Flag: Produce entire document. */
+ int flags; /**< Document and page flags. */
+} dk4_pppt_t;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open an output structure.
+ @param texname Name of TeX output file.
+ The name ends on ".tex".
+ The name of the included *.eps or *.pdf file
+ is derived from this name.
+ @param dr Output driver.
+ @param isdoc Flag: Produce LaTeX document, not just image.
+ @param flags Additional flags for graphics.
+ @param width Image width in bp (PS point).
+ @param height Image height in bp.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+*/
+dk4_pppt_t *
+dk4pppt_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_er_t *erp
+);
+
+/** Write output file(s) and close output structure.
+ @param pppt Output structure to write and close.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4pppt_write_and_close(
+ dk4_pppt_t *pppt,
+ dk4_er_t *erp
+);
+
+/** Close output structure without writing.
+ This function can be used after errors to close the structure
+ without any attempt to overwrite existing files.
+ @param pppt Output structure to close.
+*/
+void
+dk4pppt_close(
+ dk4_pppt_t *pppt
+);
+
+/** Set flag for simplified gsave/grestore handling.
+ Set this flag, if you use gsave and grestore only to save and restore
+ the clip path for pattern filling.
+ @param pppt Output structure.
+ @param val Flag: Simplified gsave and grestore handling.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL.
+*/
+void
+dk4pppt_set_gs_for_pattern_only(
+ dk4_pppt_t *pppt,
+ int val,
+ dk4_er_t *erp
+);
+
+/** Save current graphics state (especially clip path).
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_gsave(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Restore graphics state (especially clip path).
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_grestore(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line width.
+ @param pppt Output structure.
+ @param lw Line width in bp.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_line_width(
+ dk4_pppt_t *pppt,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line style.
+ @param pppt Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_line_style(
+ dk4_pppt_t *pppt,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line cap.
+ @param pppt Output structure.
+ @param lc Line cap type.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_line_cap(
+ dk4_pppt_t *pppt,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line join.
+ @param pppt Output structure.
+ @param lj Line join type.
+ @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_line_join(
+ dk4_pppt_t *pppt,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set fill color to gray.
+ @param pppt Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_fill_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set fill color to RGB.
+ @param pppt Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_fill_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set fill color to CMYK.
+ @param pppt Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_fill_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set stroke color to gray.
+ @param pppt Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_stroke_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set stroke color to RGB.
+ @param pppt Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_stroke_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set stroke color to CMYK.
+ @param pppt Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_stroke_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_prepare_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_prepare_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_prepare_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Check whether a combined fill and close operation is available
+ for an output structure.
+ @param pppt Output structure to test.
+ @return 1 if a fill-and-close operation is available, 0 otherwise.
+*/
+int
+dk4pppt_can_fill_and_stroke(
+ const dk4_pppt_t *pppt
+);
+
+/** Fill current path.
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Stroke current path.
+ Note: Use dk4gra_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Use current path for clipping.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_clip(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line width to draw fill patterns.
+ The pattern line width should be in range 0 to 2bp,
+ default is 0.9bp.
+ @param pppt Output structure.
+ @param plw New pattern line width in bp.
+*/
+void
+dk4pppt_set_pattern_line_width(
+ dk4_pppt_t *pppt,
+ double plw
+);
+
+/** Pattern a region (clipping should be set to the path).
+ @param pppt Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_pattern(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Start a new path and move to first point.
+ @param pppt Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_newpath_moveto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add line from current point to new point to path.
+ @param pppt Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_lineto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param pppt Output structure.
+ @param xc1 X coordinate of first control point.
+ @param yc1 Y coordinate of first control point.
+ @param xc2 X coordinate of second control point.
+ @param yc2 Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_curveto(
+ dk4_pppt_t *pppt,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Close current path.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_closepath(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add bitmap image XFig style.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or a frame number other than 0
+ was specified for PGF output,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_bif_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add bitmap image.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file data.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_bif_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add bitmap image.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add bitmap image XFig style.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Create path for a circle.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_circle(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_rectangle(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add path for an arc.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_arc(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Create path for an ellipse.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in degree.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_ellipse(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding, only used for char text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_simple_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_simple_utf8_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add special text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_special_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set flag for even-odd-rule.
+ If this flag is on, the even-odd-rule is used for filling and
+ clipping. Otherwise the nonzero-winding rule is used.
+ By default this flag is turned on when creating a dk4_gra_t structure.
+ @param pppt Output structure.
+ @param val New flag value.
+*/
+void
+dk4pppt_set_eorule(
+ dk4_pppt_t *pppt,
+ int val
+);
+
+
+/** Set document font size.
+ @param pppt Output structure.
+ @param fs New font size.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4pppt_doc_font_size(
+ dk4_pppt_t *pppt,
+ double fs,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add one preamble line.
+ @param pppt Output structure.
+ @param line Line to add without trailing newline.
+ @param tp Preamble line type.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4pppt_doc_preamble_line(
+ dk4_pppt_t *pppt,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#include "dk4conf.h"
+
+#ifdef DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#define _USE_MATH_DEFINES 1
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4PPPT_H_INCLUDED
+#include "dk4pppt.h"
+#endif
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#include "dk4enc.h"
+#endif
+
+#ifndef DK4FOPD_H_INCLUDED
+#include "dk4fopd.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4STRMF_H_INCLUDED
+#include "dk4strmf.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4ISADM_H_INCLUDED
+#include "dk4isadm.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Constant text fragments.
+*/
+static const dkChar * const dk4pppt_dk_kw[] = {
+$!string-table macro=dkT
+#
+# 0-3 File name suffixes for graphics files.
+#
+-i.pdf
+.pdf
+.ps
+.eps
+$!end
+};
+
+
+
+/** Constant text fragments
+*/
+static const char * const dk4pppt_c8_kw[] = {
+$!string-table
+#
+# 0-3 Put instruction for text
+#
+\\put(
+,
+){
+}%\n
+#
+# 4-12 makebox instructions with alignments
+#
+\\makebox(0,0)[lb]{
+\\makebox(0,0)[b]{
+\\makebox(0,0)[rb]{
+\\makebox(0,0)[l]{
+\\makebox(0,0){
+\\makebox(0,0)[r]{
+\\makebox(0,0)[lt]{
+\\makebox(0,0)[t]{
+\\makebox(0,0)[rt]{
+#
+# 13 Closing the makebox
+#
+}
+#
+# 14 Smash
+#
+\\smash{
+#
+# 15 Start group
+#
+{
+#
+# 16 Font command
+#
+\\PPPTfo
+#
+# 17-18 begin/end picture
+#
+\\begin{picture}(0,0)\n
+\\end{picture}%\n\\setlength{\\unitlength}{1bp}%\n
+#
+# 19-20 Included image
+#
+\\includegraphics{
+}\n
+#
+# 21 End picture
+#
+\\end{picture}%\n
+#
+# 22-23
+#
+\\begin{picture}(
+)\n
+#
+# 24 Mark text as command
+#
+{}
+#
+# 25 Open white box
+#
+\\colorbox{white}{
+#
+# 26 Open oval box
+#
+\\ovalbox{
+#
+# 27 Rotatebox
+#
+\\rotatebox{
+#
+# 28 Separate degrees from text
+#
+}{
+$!end
+};
+
+
+
+/** Reset a success variable.
+ @param backptr Address of success variable to reset.
+*/
+static
+void
+dk4pppt_reset(int *backptr)
+{
+ if (NULL != backptr) {
+ *backptr = 0;
+ }
+}
+
+
+
+/** Check whether a value is within a specified range.
+ @param min Minimum value (inclusive).
+ @param max Maximum value (inclusive).
+ @param val Value to check.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4pppt_in_range(double min, double max, double val)
+{
+ int back = 0;
+ if ((min <= val) && (max >= val)) {
+ back = 1;
+ }
+ return back;
+}
+
+
+
+/** Release preamble lines.
+ @param ps Preamble lines storage.
+ @param pi Preamble lines iterator.
+*/
+static
+void
+dk4pppt_release_preamble_lines(
+ dk4_sto_t *ps,
+ dk4_sto_it_t *pi
+)
+{
+ dk4_gra_preamble_line_t *pl;
+
+ if (NULL != ps) {
+ if (NULL != pi) {
+ dk4sto_it_reset(pi);
+ do {
+ pl = (dk4_gra_preamble_line_t *)dk4sto_it_next(pi);
+ if (NULL != pl) {
+ dk4gratool_preamble_delete(pl);
+ }
+ } while (NULL != pl);
+ dk4sto_it_close(pi);
+ }
+ dk4sto_close(ps);
+ }
+}
+
+
+
+void
+dk4pppt_close(
+ dk4_pppt_t *pppt
+)
+{
+ $? "+ dk4pppt_close"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (NULL != pppt) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ if (NULL != pppt->out.pgf) {
+ dk4gra_close(pppt->out.pgf);
+ pppt->out.pgf = NULL;
+ }
+ } break;
+ default : { /* PDF+TeX or EPS+TeX */
+ dk4pppt_release_preamble_lines(
+ pppt->out.ppt.s_f, pppt->out.ppt.i_f
+ );
+ dk4pppt_release_preamble_lines(
+ pppt->out.ppt.s_p, pppt->out.ppt.i_p
+ );
+ dk4pppt_release_preamble_lines(
+ pppt->out.ppt.s_o, pppt->out.ppt.i_o
+ );
+ pppt->out.ppt.s_f =
+ pppt->out.ppt.s_p =
+ pppt->out.ppt.s_o = NULL;
+ pppt->out.ppt.i_f =
+ pppt->out.ppt.i_p =
+ pppt->out.ppt.i_o = NULL;
+ if (NULL != pppt->out.ppt.tms) {
+ dk4stream_close(pppt->out.ppt.tms, NULL);
+ pppt->out.ppt.tms = NULL;
+ }
+ if (NULL != pppt->out.ppt.tmb) {
+ dk4membuf_close(pppt->out.ppt.tmb);
+ pppt->out.ppt.tmb = NULL;
+ }
+ if (NULL != pppt->out.ppt.fc) {
+ dk4fontc_close(pppt->out.ppt.fc);
+ pppt->out.ppt.fc = NULL;
+ }
+ if (NULL != pppt->out.ppt.gra) {
+ dk4gra_close(pppt->out.ppt.gra);
+ pppt->out.ppt.gra = NULL;
+ }
+ if (NULL != pppt->out.ppt.tfn) {
+ dk4mem_free(pppt->out.ppt.tfn);
+ pppt->out.ppt.tfn = NULL;
+ }
+ } break;
+ }
+ dk4mem_free(pppt);
+ }
+ $? "- dk4pppt_close"
+}
+
+
+
+/** Open a PGF output structure.
+ @param texname Name of TeX output file.
+ The name ends on ".tex".
+ The name of the included *.eps or *.pdf file
+ is derived from this name.
+ @param dr Output driver.
+ @param isdoc Flag: Produce LaTeX document, not just image.
+ @param flags Additional flags for graphics.
+ @param width Image width in bp (PS point).
+ @param height Image height in bp.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+*/
+static
+dk4_pppt_t *
+dk4pppt_pgf_open(
+ const dkChar *texname,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_er_t *erp
+)
+{
+ dk4_pppt_t *back = NULL;
+ $? "+ dk4pppt_pgf_open"
+#if DK4_USE_ASSERT
+ assert(NULL != texname);
+ assert(0 < width);
+ assert(0 < height);
+#endif
+ back = dk4mem_new(dk4_pppt_t,1,erp);
+ if (NULL != back) {
+ DK4_MEMRES(back,sizeof(dk4_pppt_t));
+ back->flags = flags;
+ back->isdoc = isdoc;
+ back->dr = DK4_PPPT_DR_PGF;
+ back->out.pgf = dk4gra_open_pgf(texname,width,height,flags,isdoc,erp);
+ if (NULL == back->out.pgf) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+ $? "- dk4pppt_pgf_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Construct output file name based on TeX file name.
+ @param obuf Output buffer.
+ @param szobuf Output buffer size (number of dkChar).
+ @param texname TeX file name.
+ @param dr Driver to produce name for.
+ @param flags Document flags.
+ @param isdoc Flag: Produce entire document.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error (buffer too short).
+*/
+static
+int
+dk4pppt_construct_output_file_name(
+ dkChar *obuf,
+ size_t szobuf,
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int flags,
+ int isdoc,
+ dk4_er_t *erp
+)
+{
+ dkChar *psuffix = NULL; /* File name existing suffix */
+ size_t kwi = 0; /* Keyword index for suffix to append */
+ int back = 0;
+ $? "+ dk4pppt_construct_output_file_name"
+#if DK4_USE_ASSERT
+ assert(NULL != obuf);
+ assert(0 < szobuf);
+ assert(NULL != texname);
+#endif
+ if (0 != dk4str_cpy_s(obuf, szobuf, texname, erp)) {
+ psuffix = dk4path_get_suffix(obuf, NULL);
+ if (NULL != psuffix) {
+ *psuffix = dkT('\0');
+ }
+ kwi = 1;
+ if (DK4_PPPT_DR_PDF_TEX == dr) {
+ if (0 != isdoc) { kwi = 0; }
+ }
+ else {
+ kwi = 2;
+ if (0 != (DK4_GRA_DOC_FLAG_EPS & flags)) { kwi = 3; }
+ }
+ back = dk4str_cat_s(obuf, szobuf, dk4pppt_dk_kw[kwi], erp);
+ }
+ if (0 == back) { obuf[0] = dkT('\0'); }
+ $? "- dk4pppt_construct_output_file_name %d \"%!ds\"", back, obuf
+ return back;
+}
+
+
+
+/** Open a non-PGF output structure.
+ @param texname Name of TeX output file.
+ The name ends on ".tex".
+ The name of the included *.eps or *.pdf file
+ is derived from this name.
+ @param dr Output driver.
+ @param isdoc Flag: Produce LaTeX document, not just image.
+ @param flags Additional flags for graphics.
+ @param width Image width in bp (PS point).
+ @param height Image height in bp.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+*/
+static
+dk4_pppt_t *
+dk4pppt_ppt_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_er_t *erp
+)
+{
+ dkChar ofnbuf[DK4_MAX_PATH]; /* Buffer to construct name */
+#if DK4_CHAR_SIZE > 1
+ char tb[DK4_MAX_PATH]; /* ANSI file name */
+#endif
+ dk4_pppt_t *back = NULL; /* Function result */
+ int res = 0; /* Operation result */
+ int ok = 0; /* Flag: Everything ok */
+ $? "+ dk4pppt_ppt_open"
+#if DK4_USE_ASSERT
+ assert(NULL != texname);
+#endif
+ res = dk4pppt_construct_output_file_name(
+ ofnbuf, DK4_SIZEOF(ofnbuf,dkChar), texname, dr, flags, isdoc, erp
+ );
+ if (0 != res) {
+ back = dk4mem_new(dk4_pppt_t,1,erp);
+ if (NULL != back) {
+ DK4_MEMRES(back,sizeof(dk4_pppt_t));
+ back->flags = flags;
+ back->isdoc = isdoc;
+ back->dr = dr;
+ back->out.ppt.tfn = NULL;
+ back->out.ppt.gra = NULL;
+ back->out.ppt.fc = NULL;
+ back->out.ppt.tmb = NULL;
+ back->out.ppt.tms = NULL;
+ back->out.ppt.s_f = NULL;
+ back->out.ppt.i_f = NULL;
+ back->out.ppt.s_p = NULL;
+ back->out.ppt.i_p = NULL;
+ back->out.ppt.s_o = NULL;
+ back->out.ppt.i_o = NULL;
+ back->out.ppt.dfs = -1.0;
+ back->out.ppt.n_f = 0UL;
+ back->out.ppt.n_p = 0UL;
+ back->out.ppt.n_o = 0UL;
+ back->out.ppt.tfn = dk4str_dup(texname, erp);
+ if (NULL != back->out.ppt.tfn) {
+ if (DK4_PPPT_DR_EPS_TEX == dr) {
+ back->out.ppt.gra = dk4gra_open_ps(
+ ofnbuf, width, height, flags, erp
+ );
+ }
+ else {
+ back->out.ppt.gra = dk4gra_open_pdf(
+ ofnbuf, width, height, flags, erp
+ );
+ }
+ if (NULL != back->out.ppt.gra) {
+ back->out.ppt.fc = dk4fontc_open(erp);
+ if (NULL != back->out.ppt.fc) {
+ back->out.ppt.tmb = dk4membuf_open(erp);
+ if (NULL != back->out.ppt.tmb) {
+ back->out.ppt.tms = dk4stream_open_membuf_writer(
+ back->out.ppt.tmb, erp
+ );
+ if (NULL != back->out.ppt.tms) {
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ ok = dk4recode_dk_to_any(
+ tb, sizeof(tb), DK4_FILE_ENCODING_WIN1252,
+ ofnbuf, DK4_ENCODING_32, erp
+ );
+#else
+ ok = dk4recode_dk_to_any(
+ tb, sizeof(tb), DK4_FILE_ENCODING_WIN1252,
+ ofnbuf, DK4_ENCODING_UTF16, erp
+ );
+#endif
+#else
+ ok = 1;
+#endif
+ }
+ }
+ }
+ }
+ }
+ if (0 == ok) {
+ dk4pppt_close(back);
+ back = NULL;
+ }
+ }
+ }
+ $? "- dk4pppt_ppt_open"
+ return back;
+}
+
+
+
+dk4_pppt_t *
+dk4pppt_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_er_t *erp
+)
+{
+ dk4_pppt_t *back = NULL;
+ int ok = 1;
+ $? "+ dk4pppt_open"
+#if DK4_USE_ASSERT
+ assert(NULL != texname);
+ assert(0 < width);
+ assert(0 < height);
+#endif
+ if ((NULL != texname) && (0 < width) && (0 < height)) {
+ switch (dr) {
+ case DK4_PPPT_DR_PGF : {
+ $? ". PGF"
+ back = dk4pppt_pgf_open(
+ texname, isdoc, flags, width, height, erp
+ );
+ } break;
+ case DK4_PPPT_DR_EPS_TEX : {
+ /*
+ Cannot create document for PS output, check here
+ */
+ $? ". not PGF (EPS/TeX)"
+ if (0 == isdoc) {
+ back = dk4pppt_ppt_open(
+ texname, dr, isdoc, flags, width, height, erp
+ );
+ }
+ else {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ }
+ } break;
+ default : { /* DK4_PPPT_DR_PDF_TEX */
+ $? ". not PGF"
+ back = dk4pppt_ppt_open(
+ texname, dr, isdoc, flags, width, height, erp
+ );
+ } break;
+ }
+ if (NULL != back) {
+ switch (dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_page_with_flags(
+ back->out.pgf, flags, &ok, erp
+ );
+ } break;
+ default : {
+ dk4gra_page_with_flags(
+ back->out.ppt.gra, flags, &ok, erp
+ );
+ } break;
+ }
+ if (0 == ok) {
+ dk4pppt_close(back);
+ back = NULL;
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4pppt_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/** Check whether pppt object state grants graphics and text operations.
+ @param pppt Structure to check.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4pppt_is_state_ok(
+ const dk4_pppt_t *pppt
+)
+{
+ int back = 0;
+
+ /* Check for valid pointer
+ */
+ if (NULL == pppt) {
+ goto finished;
+ }
+ /* Remaining checks depend on driver
+ */
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ if (NULL != pppt->out.pgf) {
+ back = 1;
+ }
+ } break;
+ default : {
+ if (NULL != pppt->out.ppt.gra) {
+ if (NULL != pppt->out.ppt.fc) {
+ if (NULL != pppt->out.ppt.tmb) {
+ if (NULL != pppt->out.ppt.tms) {
+ if (NULL != pppt->out.ppt.tfn) {
+ back = 1;
+ }
+ }
+ }
+ }
+ }
+ } break;
+ }
+ finished:
+ return back;
+}
+
+
+
+/** Convert backslashes to forward slashes for use of file name in LaTeX.
+ @param fn String to correct.
+*/
+static
+void
+dk4pppt_to_slash(char *fn)
+{
+ while ('\0' != *fn) {
+ if ('\\' == *fn) { *fn = '/'; }
+ fn++;
+ }
+}
+
+
+
+/** Write file name to includegraphics instruction.
+ @param ostrm Destination output stream.
+ @param fn File name to print.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4pppt_file_name_to_stream(
+ dk4_stream_t *ostrm,
+ const dkChar *fn,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ char buf[DK4_MAX_PATH];
+ char *p1 = NULL;
+ char *p2 = NULL;
+ int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ostrm);
+ assert(NULL != fn);
+#endif
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ res = dk4recode_dk_to_any(
+ buf, sizeof(buf), DK4_FILE_ENCODING_WIN1252, fn, DK4_ENCODING_32, erp
+ );
+#else
+ res = dk4recode_dk_to_any(
+ buf, sizeof(buf), DK4_FILE_ENCODING_WIN1252, fn, DK4_ENCODING_UTF16, erp
+ );
+#endif
+#else
+ res = dk4str8_cpy_s(buf, sizeof(buf), fn, erp);
+#endif
+ if (0 != res) {
+ dk4pppt_to_slash(buf);
+ if (0 != dk4path_is_absolute(fn)) {
+ res = dk4stream_write_char_string(ostrm, buf, erp);
+ if (0 == res) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ else {
+ p2 = buf;
+ while ('\0' != *p2) {
+ if ('/' == *p2) { p1 = p2; }
+ p2++;
+ }
+ if (NULL != p1) { p1++; }
+ else { p1 = buf; }
+ res = dk4stream_write_char_string(ostrm, p1, erp);
+ if (0 == res) {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+ }
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ }
+}
+
+
+
+/** Write output data.
+ @param pppt Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4pppt_write(
+ dk4_pppt_t *pppt,
+ dk4_er_t *erp
+)
+{
+ FILE *fout = NULL;
+ dk4_stream_t *ostrm = NULL;
+ int tests = DK4_FOPEN_SC_USER;
+ int res = 0;
+ int back = 0;
+ $? "+ dk4pppt_write"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ back = 1;
+ dk4gra_write_and_close(pppt->out.pgf, &back, erp);
+ pppt->out.pgf = NULL;
+ } break;
+ default : {
+ /*
+ Write *.tex file first, as name of graphics file is in gra
+ */
+ if (0 != dk4isadmin()) { tests = DK4_FOPEN_SC_PRIVILEGED; }
+ fout = dk4fopen(pppt->out.ppt.tfn, dkT("wb"), tests, erp);
+ if (NULL != fout) {
+ ostrm = dk4stream_open_for_file(
+ fout, DK4_STREAM_WRITE, 0, 0, erp
+ );
+ if (NULL != ostrm) {
+ back = 1;
+ if (0 != pppt->isdoc) {
+ dk4gratool_start_standalone_document(
+ ostrm, pppt->out.ppt.gra, 0, pppt->out.ppt.dfs,
+ pppt->out.ppt.s_f, pppt->out.ppt.i_f,
+ pppt->out.ppt.s_p, pppt->out.ppt.i_p,
+ pppt->out.ppt.s_o, pppt->out.ppt.i_o,
+ &back, erp
+ );
+ }
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[17], &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[19], &back, erp
+ );
+ dk4pppt_file_name_to_stream(
+ ostrm, pppt->out.ppt.gra->fn, &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[20], &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[18], &back, erp
+ );
+ dk4gratool_font_definitions(
+ ostrm, pppt->out.ppt.fc, &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[22], &back, erp
+ );
+ dk4gratool_stream_uint(
+ ostrm, pppt->out.ppt.gra->w, 0, &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[1], &back, erp
+ );
+ dk4gratool_stream_uint(
+ ostrm, pppt->out.ppt.gra->h, 0, &back, erp
+ );
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[23], &back, erp
+ );
+ if (NULL != pppt->out.ppt.tms) {
+ if (0 == dk4stream_close(pppt->out.ppt.tms, erp)) {
+ back = 0;
+ }
+ pppt->out.ppt.tms = NULL;
+ }
+ if (NULL != pppt->out.ppt.tmb) {
+ res = dk4membuf_to_stream(ostrm,pppt->out.ppt.tmb,erp);
+ if (0 == res) {
+ back = 0;
+ }
+ }
+ dk4gratool_stream_string(
+ ostrm, dk4pppt_c8_kw[21], &back, erp
+ );
+ if (0 != pppt->isdoc) {
+ dk4gratool_end_standalone_document(ostrm, &back, erp);
+ }
+ if (0 == dk4stream_close(ostrm, erp)) { back = 0; }
+ /*
+ Write and close the real graphics
+ */
+ dk4gra_write_and_close(
+ pppt->out.ppt.gra, &back, erp
+ );
+ pppt->out.ppt.gra = NULL;
+ }
+ if (0 != fclose(fout)) { back = 0; }
+ }
+ } break;
+ }
+ $? "- dk4pppt_write %d", back
+ return back;
+}
+
+
+
+int
+dk4pppt_write_and_close(
+ dk4_pppt_t *pppt,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+ $? "+ dk4pppt_write_and_close"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (NULL != pppt) {
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ back = dk4pppt_write(pppt, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ dk4pppt_close(pppt);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4pppt_write_and_close %d", back
+ return back;
+}
+
+
+
+void
+dk4pppt_set_gs_for_pattern_only(
+ dk4_pppt_t *pppt,
+ int val,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_gs_for_pattern_only"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_gs_for_pattern_only(
+ pppt->out.pgf, val, erp
+ );
+ } break;
+ default : {
+ dk4gra_set_gs_for_pattern_only(
+ pppt->out.ppt.gra, val, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4pppt_set_gs_for_pattern_only"
+}
+
+
+
+void
+dk4pppt_gsave(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_gsave"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_gsave(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_gsave(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_gsave"
+}
+
+
+
+void
+dk4pppt_grestore(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_grestore"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_grestore(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_grestore(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_grestore"
+}
+
+
+
+void
+dk4pppt_set_line_width(
+ dk4_pppt_t *pppt,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_line_width"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (0.0 <= lw)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_line_width(pppt->out.pgf, lw, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_line_width(pppt->out.ppt.gra, lw, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_line_width"
+}
+
+
+
+void
+dk4pppt_set_line_style(
+ dk4_pppt_t *pppt,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_line_style"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (0.0 <= sv)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_line_style(pppt->out.pgf, ls, sv, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_line_style(pppt->out.ppt.gra, ls, sv, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_line_style"
+}
+
+
+
+void
+dk4pppt_set_line_cap(
+ dk4_pppt_t *pppt,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_line_cap"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_line_cap(pppt->out.pgf, lc, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_line_cap(pppt->out.ppt.gra, lc, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_line_cap"
+}
+
+
+
+void
+dk4pppt_set_line_join(
+ dk4_pppt_t *pppt,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_line_join"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_line_join(pppt->out.pgf, lj, ml, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_line_join(pppt->out.ppt.gra, lj, ml, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_line_join"
+}
+
+
+
+void
+dk4pppt_set_fill_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_fill_gray"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (0.0 <= g) && (1.0 >= g)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_fill_gray(pppt->out.pgf, g, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_fill_gray(pppt->out.ppt.gra, g, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_fill_gray"
+}
+
+
+
+void
+dk4pppt_set_fill_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_fill_rgb"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt))
+ && (dk4pppt_in_range(0.0, 1.0, r))
+ && (dk4pppt_in_range(0.0, 1.0, g))
+ && (dk4pppt_in_range(0.0, 1.0, b))
+ )
+ {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ $? ". PGF"
+ dk4gra_set_fill_rgb(pppt->out.pgf, r, g, b, backptr, erp);
+ } break;
+ default : {
+ $? ". not PGF"
+ dk4gra_set_fill_rgb(pppt->out.ppt.gra, r, g, b, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_fill_rgb"
+}
+
+
+
+void
+dk4pppt_set_fill_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_fill_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt))
+ && (dk4pppt_in_range(0.0, 1.0, c)) && (dk4pppt_in_range(0.0, 1.0, m))
+ && (dk4pppt_in_range(0.0, 1.0, y)) && (dk4pppt_in_range(0.0, 1.0, k))
+ ) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_fill_cmyk(pppt->out.pgf, c, m, y, k, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_fill_cmyk(pppt->out.ppt.gra,c,m,y,k,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_fill_cmyk"
+}
+
+
+
+void
+dk4pppt_set_stroke_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_stroke_gray"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (dk4pppt_in_range(0.0, 1.0, g))) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_stroke_gray(pppt->out.pgf, g, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_stroke_gray(pppt->out.ppt.gra, g, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_stroke_gray"
+}
+
+
+
+void
+dk4pppt_set_stroke_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_stroke_rgb"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (
+ (0 != dk4pppt_is_state_ok(pppt)) && (dk4pppt_in_range(0.0, 1.0, r))
+ && (dk4pppt_in_range(0.0, 1.0, g)) && (dk4pppt_in_range(0.0, 1.0, b))
+ ) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_stroke_rgb(pppt->out.pgf, r, g, b, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_stroke_rgb(pppt->out.ppt.gra, r, g, b, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_stroke_rgb"
+}
+
+
+
+void
+dk4pppt_set_stroke_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_set_stroke_cmyk"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (
+ (0 != dk4pppt_is_state_ok(pppt))
+ && (dk4pppt_in_range(0.0, 1.0, c)) && (dk4pppt_in_range(0.0, 1.0, m))
+ && (dk4pppt_in_range(0.0, 1.0, y)) && (dk4pppt_in_range(0.0, 1.0, k))
+ ) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_stroke_cmyk(pppt->out.pgf, c, m, y, k, backptr, erp);
+ } break;
+ default : {
+ dk4gra_set_stroke_cmyk(pppt->out.ppt.gra,c,m,y,k,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_set_stroke_cmyk"
+}
+
+
+
+void
+dk4pppt_prepare_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_prepare_fill"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_prepare_fill(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_prepare_fill(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_prepare_fill"
+}
+
+
+
+void
+dk4pppt_prepare_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_prepare_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_prepare_stroke(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_prepare_stroke(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_prepare_stroke"
+}
+
+
+
+void
+dk4pppt_prepare_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_prepare_fill_and_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_prepare_fill_and_stroke(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_prepare_fill_and_stroke(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_prepare_fill_and_stroke"
+}
+
+
+
+int
+dk4pppt_can_fill_and_stroke(
+ const dk4_pppt_t *pppt
+)
+{
+ int back = 0;
+ $? "+ dk4pppt_can_fill_and_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ back = dk4gra_can_fill_and_stroke(pppt->out.pgf);
+ } break;
+ default : {
+ back = dk4gra_can_fill_and_stroke(pppt->out.ppt.gra);
+ } break;
+ }
+ }
+ $? "- dk4pppt_can_fill_and_stroke %d", back
+ return back;
+}
+
+
+
+void
+dk4pppt_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_fill"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_fill(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_fill(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_fill"
+}
+
+
+
+void
+dk4pppt_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_stroke(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_stroke(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_stroke"
+}
+
+
+
+void
+dk4pppt_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_fill_and_stroke"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_fill_and_stroke(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_fill_and_stroke(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_fill_and_stroke"
+}
+
+
+
+void
+dk4pppt_clip(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_clip"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_clip(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_clip(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_clip"
+}
+
+
+
+void
+dk4pppt_set_pattern_line_width(
+ dk4_pppt_t *pppt,
+ double plw
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (NULL != pppt) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_pattern_line_width(pppt->out.pgf, plw);
+ } break;
+ default : {
+ dk4gra_set_pattern_line_width(pppt->out.ppt.gra, plw);
+ } break;
+ }
+ }
+}
+
+
+
+void
+dk4pppt_pattern(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_pattern"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pattern(pppt->out.pgf, xl, xr, yb, yt, pn, backptr, erp);
+ } break;
+ default : {
+ dk4gra_pattern(pppt->out.ppt.gra,xl,xr,yb,yt,pn,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_pattern"
+}
+
+
+
+void
+dk4pppt_newpath_moveto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_newpath_moveto"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ $? ". PGF"
+ dk4gra_newpath_moveto(pppt->out.pgf, x, y, bbptr, backptr, erp);
+ } break;
+ default : {
+ $? ". not PGF"
+ dk4gra_newpath_moveto(pppt->out.ppt.gra,x,y,bbptr,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_newpath_moveto"
+}
+
+
+
+void
+dk4pppt_lineto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_lineto"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_lineto(pppt->out.pgf, x, y, bbptr, backptr, erp);
+ } break;
+ default : {
+ dk4gra_lineto(pppt->out.ppt.gra, x, y, bbptr, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_lineto"
+}
+
+
+
+void
+dk4pppt_curveto(
+ dk4_pppt_t *pppt,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_curveto"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_curveto(
+ pppt->out.pgf, xc1, yc1, xc2, yc2, x, y, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_curveto(
+ pppt->out.ppt.gra,xc1,yc1,xc2,yc2,x,y,bbptr,backptr,erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_curveto"
+}
+
+
+
+void
+dk4pppt_closepath(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_closepath"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_closepath(pppt->out.pgf, backptr, erp);
+ } break;
+ default : {
+ dk4gra_closepath(pppt->out.ppt.gra, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_closepath"
+}
+
+
+
+void
+dk4pppt_bif_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_bif_fig_image"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != bif);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_bif_fig_image(
+ pppt->out.pgf, xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_bif_fig_image(
+ pppt->out.ppt.gra,
+ xl, xr, yb, yt, bif, fn, fno,
+ pos, ifl, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_bif_fig_image"
+}
+
+
+void
+dk4pppt_bif_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_bif_image"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != bif);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_bif_image(
+ pppt->out.pgf, xl, xr, yb, yt, bif, fn, fno,
+ ifl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_bif_image(
+ pppt->out.ppt.gra, xl, xr, yb, yt, bif, fn, fno,
+ ifl, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_bif_image"
+}
+
+
+
+void
+dk4pppt_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_image"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != fn);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_image(
+ pppt->out.pgf, xl, xr, yb, yt, fn, fno, ctx,
+ ifl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_image(
+ pppt->out.ppt.gra, xl, xr, yb, yt, fn, fno, ctx,
+ ifl, bbptr, backptr, erp
+ );
+
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_image"
+}
+
+
+
+void
+dk4pppt_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_fig_image"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != fn);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_fig_image(
+ pppt->out.pgf, xl, xr, yb, yt, fn, fno, ctx,
+ pos, ifl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_fig_image(
+ pppt->out.ppt.gra, xl, xr, yb, yt, fn, fno, ctx,
+ pos, ifl, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_fig_image"
+}
+
+
+
+void
+dk4pppt_circle(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_circle"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_circle(pppt->out.pgf, xc, yc, r, bbptr, backptr, erp);
+ } break;
+ default : {
+ dk4gra_circle(pppt->out.ppt.gra,xc,yc,r,bbptr,backptr,erp);
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_circle"
+}
+
+
+
+void
+dk4pppt_rectangle(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_rectangle"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_rectangle(pppt->out.pgf,xl,xr,yb,yt,r,bbptr,backptr,erp);
+ } break;
+ default : {
+ dk4gra_rectangle(
+ pppt->out.ppt.gra, xl, xr, yb, yt, r, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_rectangle"
+}
+
+
+
+void
+dk4pppt_arc(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_arc"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_arc(
+ pppt->out.pgf,
+ xc, yc, ra, start, end, cl, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_arc(
+ pppt->out.ppt.gra,
+ xc, yc, ra, start, end, cl, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_arc"
+}
+
+
+void
+dk4pppt_ellipse(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_ellipse"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_ellipse(
+ pppt->out.pgf, xc, yc, rx, ry, rot, bbptr, backptr, erp
+ );
+ } break;
+ default : {
+ dk4gra_ellipse(
+ pppt->out.ppt.gra, xc, yc, rx, ry, rot, bbptr, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_ellipse"
+}
+
+
+
+static
+void
+dk4pppt_kw_out(
+ dk4_pppt_t *pppt,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4gratool_stream_string(
+ pppt->out.ppt.tms, dk4pppt_c8_kw[kwi], backptr, erp
+ );
+}
+
+
+
+static
+void
+dk4pppt_double_out(
+ dk4_pppt_t *pppt,
+ double val,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4gratool_stream_double(
+ pppt->out.ppt.tms, val, backptr, erp
+ );
+}
+
+
+
+/** Handle one text piece, normal or special.
+ @param pppt Output structure.
+ @param x X position.
+ @param y Y position.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to write, dkChar for normal text, char for special.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Input encoding for normal text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param isnt Flag: Normal text.
+ @param fno Font id number.
+ @param fsz Font size.
+ @param fex Flag: Use font exactly as specified.
+ @param uc2l Unicode to LaTeX converter, may be NULL for special text.
+ @param flags Text flags.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+dk4pppt_i_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const void *txt,
+ const char *colspec,
+ int ie,
+ int ha,
+ int va,
+ int isnt,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4gra_col_t *pcolf = NULL; /* Fill color */
+ dk4_gra_ps_page_t *pgps = NULL; /* PS page */
+ dk4_gra_pdf_page_t *pgpdf = NULL; /* PDF page */
+ size_t fontno = 0; /* Font number */
+ size_t kwi = 4; /* Keyword index */
+ int res = 0; /* One operation result */
+ int dorot = 0; /* Flag: Use rotatebox */
+
+ $? "+ dk4pppt_i_text"
+ $? ". *backptr = %d", *backptr
+ /* Attempt to register font
+ */
+ if (1.0e-8 < fabs(rot)) { dorot = 1; }
+ if (0 != isnt) { $? ". normal text"
+ if (0 == dk4fontc_add_font(&fontno, pppt->out.ppt.fc, fno, fsz, fex, erp)) {
+ $? "! failed to add font"
+ goto finished;
+ }
+ }
+ /* Find non-stroking color
+ */
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PDF_TEX : { $? ". pdf tex"
+ pgpdf = (dk4_gra_pdf_page_t *)(pppt->out.ppt.gra->curpg);
+ if (NULL != pgpdf) {
+ pcolf = &(pgpdf->attr.col_fill_requested);
+ }
+ else { $? "! curpg"
+ goto finished;
+ }
+ } break;
+ case DK4_PPPT_DR_EPS_TEX : { $? ". eps tex"
+ pgps = (dk4_gra_ps_page_t *)(pppt->out.ppt.gra->curpg);
+ if (NULL != pgps) {
+ pcolf = &(pgps->attr.col_fill_requested);
+ }
+ else { $? "! curpg"
+ goto finished;
+ }
+ } break;
+ default : {
+ /* Empty by intent */
+ } break;
+ }
+ if (NULL == pcolf) { $? "! no current page"
+ goto finished;
+ }
+ /* put(
+ */
+ dk4pppt_kw_out(pppt, 0, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ /* X
+ */
+ dk4pppt_double_out(pppt, x, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ /* ,
+ */
+ dk4pppt_kw_out(pppt, 1, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ /* Y
+ */
+ dk4pppt_double_out(pppt, y, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ /* ){
+ */
+ dk4pppt_kw_out(pppt, 2, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ if (0 != dorot) { $? ". open rotate box"
+ /*
+ Open rotatebox
+ */
+ dk4pppt_kw_out(pppt, 27, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ dk4pppt_double_out(pppt, rot, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ dk4pppt_kw_out(pppt, 28, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* Find index of makebox instruction depending on alignment
+ */
+ switch (va) {
+ case DK4_TEXT_ALIGN_V_TOP : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 11;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 12;
+ } break;
+ default : { /* left */
+ kwi = 10;
+ } break;
+ }
+ } break;
+ case DK4_TEXT_ALIGN_V_CENTERED : {
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 8;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 9;
+ } break;
+ default : { /* left */
+ kwi = 7;
+ } break;
+ }
+ } break;
+ default : { /* base or bottom */
+ switch (ha) {
+ case DK4_TEXT_ALIGN_H_CENTERED : {
+ kwi = 5;
+ } break;
+ case DK4_TEXT_ALIGN_H_RIGHT : {
+ kwi = 6;
+ } break;
+ default : { /* left */
+ kwi = 4;
+ } break;
+ }
+ } break;
+ }
+ /* Start makebox
+ */
+ dk4pppt_kw_out(pppt, kwi, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ /* Start smash
+ */
+ if (DK4_TEXT_ALIGN_V_BASELINE == va) {
+ dk4pppt_kw_out(pppt, 14, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* Start group
+ */
+ dk4pppt_kw_out(pppt, 15, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ /* Open white box
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_WHITE_BOX & flags)) {
+ dk4pppt_kw_out(pppt, 25, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* Color
+ */
+ if (NULL != colspec) {
+ res = dk4stream_write_char_string(pppt->out.ppt.tms, colspec, erp);
+ if (0 == res) { $? "! backptr"
+ dk4pppt_reset(backptr);
+ $? ". *backptr = %d", *backptr
+ }
+ }
+ else {
+ dk4gratool_stream_color(pppt->out.ppt.tms, pcolf, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* Open oval box
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_OVAL_BOX & flags)) {
+ dk4pppt_kw_out(pppt, 26, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* Font
+ */
+ if (0 != isnt) {
+ dk4pppt_kw_out(pppt, 16, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ dk4gratool_stream_num_alpha(pppt->out.ppt.tms, fontno, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ dk4pppt_kw_out(pppt, 24, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* Text
+ */
+ if (0 != isnt) { /* normal text */
+ res = dk4uc2l_string_encoded(
+ pppt->out.ppt.tms, uc2l, (const dkChar *)txt, ie, erp
+ );
+ if (0 == res) { $? "! backptr"
+ dk4pppt_reset(backptr);
+ $? ". *backptr = %d", *backptr
+ }
+ }
+ else { /* special text */
+ res = dk4stream_write_char_string(
+ pppt->out.ppt.tms, (const char *)txt, erp
+ );
+ if (0 == res) { $? "! backptr"
+ dk4pppt_reset(backptr);
+ $? ". *backptr = %d", *backptr
+ }
+ }
+ /* Close oval box
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_OVAL_BOX & flags)) {
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* Close white box
+ */
+ if (0 != (DK4_GRA_TEXT_FLAG_WHITE_BOX & flags)) {
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* End group
+ */
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ /* End smash
+ */
+ if (DK4_TEXT_ALIGN_V_BASELINE == va) {
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* End makebox
+ */
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ if (0 != dorot) {
+ /*
+ End rotatebox
+ */
+ dk4pppt_kw_out(pppt, 13, backptr, erp);
+ $? ". *backptr = %d", *backptr
+ }
+ /* } newline
+ */
+ dk4pppt_kw_out(pppt, 3, backptr, erp);
+ $? ". *backptr = %d", *backptr
+
+ finished:
+ $? "- dk4pppt_i_text *backptr=%d", *backptr
+ return;
+}
+
+
+
+void
+dk4pppt_simple_utf8_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_simple_utf8_text"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != txt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (NULL != txt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pgf_simple_utf8_text(
+ pppt->out.pgf,
+ x, y, rot, txt, colspec, ha, va, fno, fsz, fex, uc2l,
+ flags, backptr, erp
+ );
+ } break;
+ default : {
+ dk4pppt_i_text(
+ pppt,
+ x, y, rot, txt, colspec, DK4_ENCODING_UTF8, ha, va, 1,
+ fno, fsz, fex, uc2l, flags, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_simple_utf8_text"
+}
+
+
+
+void
+dk4pppt_simple_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_simple_text"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != txt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (NULL != txt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : { $? ". pgf output"
+ dk4gra_pgf_simple_text(
+ pppt->out.pgf,
+ x, y, rot, txt, colspec, ie, ha, va, fno, fsz, fex, uc2l,
+ flags, backptr, erp
+ );
+ } break;
+ default : { $? ". pdf/ps output"
+ dk4pppt_i_text(
+ pppt,
+ x, y, rot, txt, colspec, ie, ha, va, 1,
+ fno, fsz, fex, uc2l, flags, backptr, erp
+ );
+ } break;
+ }
+ }
+ else { $? "! invalid arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_simple_text"
+}
+
+
+
+void
+dk4pppt_special_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_special_text"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != txt);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (NULL != txt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pgf_special_text(
+ pppt->out.pgf,
+ x, y, rot, txt, colspec, ha, va, fno, fsz, fex,
+ flags, backptr, erp
+ );
+ } break;
+ default : {
+ dk4pppt_i_text(
+ pppt,
+ x, y, rot, txt, colspec, DK4_FILE_ENCODING_PLAIN, ha, va, 0,
+ fno, fsz, fex, NULL, flags, backptr, erp
+ );
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_special_text"
+}
+
+
+
+void
+dk4pppt_set_eorule(
+ dk4_pppt_t *pppt,
+ int val
+)
+{
+ $? "+ dk4pppt_set_eorule"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+#endif
+ if (0 != dk4pppt_is_state_ok(pppt)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_set_eorule(pppt->out.pgf, val);
+ } break;
+ default : {
+ dk4gra_set_eorule(pppt->out.ppt.gra, val);
+ } break;
+ }
+ }
+ $? "- dk4pppt_set_eorule"
+}
+
+
+
+void
+dk4pppt_doc_font_size(
+ dk4_pppt_t *pppt,
+ double fs,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_doc_font_size"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(0.0 < fs);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (0.0 < fs)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pgf_doc_font_size(pppt->out.pgf , fs, backptr, erp);
+ } break;
+ default : {
+ pppt->out.ppt.dfs = fs;
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_doc_font_size"
+}
+
+
+
+static
+void
+dk4pppt_one_preamble_line(
+ dk4_sto_t **ps,
+ dk4_sto_it_t **pi,
+ size_t *pn,
+ char const *pline,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_preamble_line_t *pl;
+ int back = 0;
+
+ if (SIZE_MAX > *pn) {
+ if (NULL == *ps) {
+ *ps = dk4sto_open(erp);
+ if (NULL != *ps) {
+ dk4sto_set_comp(*ps, dk4gratool_compare_preamble_lines, 0);
+ }
+ }
+ if (NULL != *ps) {
+ if (NULL == *pi) {
+ *pi = dk4sto_it_open(*ps, erp);
+ }
+ if (NULL != *pi) {
+ pl = dk4gratool_preamble_new(pline, *pn, erp);
+ if (NULL != pl) {
+ if (0 != dk4sto_add(*ps, pl, erp)) {
+ back = 1;
+ }
+ else {
+ dk4gratool_preamble_delete(pl);
+ }
+ }
+ }
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (0 == back) { dk4pppt_reset(backptr); }
+}
+
+
+
+void
+dk4pppt_doc_preamble_line(
+ dk4_pppt_t *pppt,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ dk4pppt_doc_preamble_line"
+#if DK4_USE_ASSERT
+ assert(NULL != pppt);
+ assert(NULL != line);
+#endif
+ if ((0 != dk4pppt_is_state_ok(pppt)) && (NULL != line)) {
+ switch (pppt->dr) {
+ case DK4_PPPT_DR_PGF : {
+ dk4gra_pgf_doc_preamble_line(pppt->out.pgf,line,tp,backptr,erp);
+ } break;
+ default : {
+ switch (tp) {
+ case DK4_GRA_PREAMBLE_FONT : {
+ dk4pppt_one_preamble_line(
+ &(pppt->out.ppt.s_f), &(pppt->out.ppt.i_f),
+ &(pppt->out.ppt.n_f), line, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PREAMBLE_PACKAGE : {
+ dk4pppt_one_preamble_line(
+ &(pppt->out.ppt.s_p), &(pppt->out.ppt.i_p),
+ &(pppt->out.ppt.n_p), line, backptr, erp
+ );
+ } break;
+ case DK4_GRA_PREAMBLE_OTHER : {
+ dk4pppt_one_preamble_line(
+ &(pppt->out.ppt.s_o), &(pppt->out.ppt.i_o),
+ &(pppt->out.ppt.n_o), line, backptr, erp
+ );
+ } break;
+ default : {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_INVALID_ARGUMENTS
+ );
+ dk4pppt_reset(backptr);
+ } break;
+ }
+ } break;
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ dk4pppt_reset(backptr);
+ }
+ $? "- dk4pppt_doc_preamble_line"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4pppt.h b/support/dktools/dk4pppt.h
new file mode 100644
index 0000000000..f5f402114c
--- /dev/null
+++ b/support/dktools/dk4pppt.h
@@ -0,0 +1,1434 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pppt.ctr
+*/
+
+#ifndef DK4PPPT_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4PPPT_H_INCLUDED 1
+
+
+#line 9 "dk4pppt.ctr"
+
+/** @file dk4pppt.h PGF/PDF+TeX/(E)PS+TeX output.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4FONT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4font.h"
+#else
+#include <dktools-4/dk4font.h>
+#endif
+#endif
+
+#ifndef DK4ALIGN_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4align.h"
+#else
+#include <dktools-4/dk4align.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4MEMBF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
+
+#ifndef DK4MBSTRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4mbstrm.h"
+#else
+#include <dktools-4/dk4mbstrm.h>
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4gra.h"
+#else
+#include <dktools-4/dk4gra.h>
+#endif
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4enc.h"
+#else
+#include <dktools-4/dk4enc.h>
+#endif
+#endif
+
+#ifndef DK4REC25_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4rec25.h"
+#else
+#include <dktools-4/dk4rec25.h>
+#endif
+#endif
+
+/** Output drivers.
+*/
+typedef enum {
+ DK4_PPPT_DR_PDF_TEX = 0, /**< Produce PDF+TeX file pair. */
+ DK4_PPPT_DR_EPS_TEX , /**< Produce EPS+TeX file pair. */
+ DK4_PPPT_DR_PGF /**< Produce PGF file. */
+} dk4_pppt_driver_t;
+
+
+/** Output structure for combined PDF+TeX/EPS+TeX output.
+*/
+typedef struct {
+ dkChar *tfn; /**< TeX file name. */
+ dk4_gra_t *gra; /**< Graphics structure. */
+ dk4_font_collector_t *fc; /**< Font collector. */
+ dk4_membuf_t *tmb; /**< TeX memory buffer. */
+ dk4_stream_t *tms; /**< TeX memory stream. */
+ dk4_sto_t *s_f; /**< Storage for font setup lines. */
+ dk4_sto_it_t *i_f; /**< Iterator for font setup lines. */
+ dk4_sto_t *s_p; /**< Storage for package setup lines. */
+ dk4_sto_it_t *i_p; /**< Iterator for package setup lines. */
+ dk4_sto_t *s_o; /**< Storage for other preamble lines. */
+ dk4_sto_it_t *i_o; /**< Iterator for other preamble lines. */
+ double dfs; /**< Document font size. */
+ size_t n_f; /**< Number of font setup lines. */
+ size_t n_p; /**< Number of package setup lines. */
+ size_t n_o; /**< Number of other setup lines. */
+} dk4_pppt_pdf_ps_t;
+
+
+
+/** Details structure.
+*/
+typedef union {
+ dk4_gra_t *pgf; /**< PGF output structure. */
+ dk4_pppt_pdf_ps_t ppt; /**< Output structure PDF+TeX/EPS+TeX. */
+} dk4_pppt_out_t;
+
+
+
+/** Output structure.
+*/
+typedef struct {
+ dk4_pppt_out_t out; /**< Output union. */
+ dk4_pppt_driver_t dr; /**< Driver, dk4_pppt_driver_t value. */
+ int isdoc; /**< Flag: Produce entire document. */
+ int flags; /**< Document and page flags. */
+} dk4_pppt_t;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open an output structure.
+ @param texname Name of TeX output file.
+ The name ends on ".tex".
+ The name of the included *.eps or *.pdf file
+ is derived from this name.
+ @param dr Output driver.
+ @param isdoc Flag: Produce LaTeX document, not just image.
+ @param flags Additional flags for graphics.
+ @param width Image width in bp (PS point).
+ @param height Image height in bp.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+*/
+dk4_pppt_t *
+dk4pppt_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_er_t *erp
+);
+
+/** Write output file(s) and close output structure.
+ @param pppt Output structure to write and close.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4pppt_write_and_close(
+ dk4_pppt_t *pppt,
+ dk4_er_t *erp
+);
+
+/** Close output structure without writing.
+ This function can be used after errors to close the structure
+ without any attempt to overwrite existing files.
+ @param pppt Output structure to close.
+*/
+void
+dk4pppt_close(
+ dk4_pppt_t *pppt
+);
+
+/** Set flag for simplified gsave/grestore handling.
+ Set this flag, if you use gsave and grestore only to save and restore
+ the clip path for pattern filling.
+ @param pppt Output structure.
+ @param val Flag: Simplified gsave and grestore handling.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL.
+*/
+void
+dk4pppt_set_gs_for_pattern_only(
+ dk4_pppt_t *pppt,
+ int val,
+ dk4_er_t *erp
+);
+
+/** Save current graphics state (especially clip path).
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_gsave(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Restore graphics state (especially clip path).
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_grestore(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line width.
+ @param pppt Output structure.
+ @param lw Line width in bp.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_line_width(
+ dk4_pppt_t *pppt,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line style.
+ @param pppt Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_line_style(
+ dk4_pppt_t *pppt,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line cap.
+ @param pppt Output structure.
+ @param lc Line cap type.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_line_cap(
+ dk4_pppt_t *pppt,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line join.
+ @param pppt Output structure.
+ @param lj Line join type.
+ @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_line_join(
+ dk4_pppt_t *pppt,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set fill color to gray.
+ @param pppt Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_fill_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set fill color to RGB.
+ @param pppt Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_fill_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set fill color to CMYK.
+ @param pppt Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_fill_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set stroke color to gray.
+ @param pppt Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_stroke_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set stroke color to RGB.
+ @param pppt Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_stroke_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set stroke color to CMYK.
+ @param pppt Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation.
+*/
+void
+dk4pppt_set_stroke_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_prepare_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_prepare_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_prepare_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Check whether a combined fill and close operation is available
+ for an output structure.
+ @param pppt Output structure to test.
+ @return 1 if a fill-and-close operation is available, 0 otherwise.
+*/
+int
+dk4pppt_can_fill_and_stroke(
+ const dk4_pppt_t *pppt
+);
+
+/** Fill current path.
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Stroke current path.
+ Note: Use dk4gra_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Use current path for clipping.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_clip(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Set line width to draw fill patterns.
+ The pattern line width should be in range 0 to 2bp,
+ default is 0.9bp.
+ @param pppt Output structure.
+ @param plw New pattern line width in bp.
+*/
+void
+dk4pppt_set_pattern_line_width(
+ dk4_pppt_t *pppt,
+ double plw
+);
+
+/** Pattern a region (clipping should be set to the path).
+ @param pppt Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_pattern(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Start a new path and move to first point.
+ @param pppt Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_newpath_moveto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add line from current point to new point to path.
+ @param pppt Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_lineto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param pppt Output structure.
+ @param xc1 X coordinate of first control point.
+ @param yc1 Y coordinate of first control point.
+ @param xc2 X coordinate of second control point.
+ @param yc2 Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_curveto(
+ dk4_pppt_t *pppt,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Close current path.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_closepath(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add bitmap image XFig style.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL or a frame number other than 0
+ was specified for PGF output,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_bif_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add bitmap image.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file data.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_bif_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add bitmap image.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add bitmap image XFig style.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or bif is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Create path for a circle.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_circle(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_rectangle(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add path for an arc.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_arc(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Create path for an ellipse.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in degree.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_ellipse(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding, only used for char text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_simple_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_simple_utf8_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add special text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param rot Rotation counterclockwise in degree.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font.
+ @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is not in a state allowing this operation,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow in memory size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if there is not enough memory available,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4pppt_special_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ double rot,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int flags,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set flag for even-odd-rule.
+ If this flag is on, the even-odd-rule is used for filling and
+ clipping. Otherwise the nonzero-winding rule is used.
+ By default this flag is turned on when creating a dk4_gra_t structure.
+ @param pppt Output structure.
+ @param val New flag value.
+*/
+void
+dk4pppt_set_eorule(
+ dk4_pppt_t *pppt,
+ int val
+);
+
+
+/** Set document font size.
+ @param pppt Output structure.
+ @param fs New font size.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4pppt_doc_font_size(
+ dk4_pppt_t *pppt,
+ double fs,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add one preamble line.
+ @param pppt Output structure.
+ @param line Line to add without trailing newline.
+ @param tp Preamble line type.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4pppt_doc_preamble_line(
+ dk4_pppt_t *pppt,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4pppta.c b/support/dktools/dk4pppta.c
new file mode 100644
index 0000000000..cc52c15d04
--- /dev/null
+++ b/support/dktools/dk4pppta.c
@@ -0,0 +1,747 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pppta.ctr
+*/
+
+/** @file dk4pppta.c The dk4pppta module.
+*/
+
+
+#line 865 "dk4pppta.ctr"
+
+#include "dk4pppta.h"
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+
+
+
+#line 878 "dk4pppta.ctr"
+
+
+
+static
+void
+dk4pppt_app_reset(int *backptr, int back)
+{
+ if ((NULL != backptr) && (0 == back)) {
+ *backptr = 0;
+ }
+}
+
+
+dk4_pppt_t *
+dk4pppt_app_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_app_t *app
+)
+{
+ dk4_pppt_t *back = NULL;
+ /* ##### TODO: Implementation */
+ return back;
+}
+
+
+
+void
+dk4pppt_app_close(
+ dk4_pppt_t *pppt
+)
+{
+ dk4pppt_close(pppt);
+}
+
+
+
+int
+dk4pppt_app_write_and_close(
+ dk4_pppt_t *pppt,
+ dk4_app_t *app
+)
+{
+ /* ##### TODO: Implementation */
+}
+
+
+
+void
+dk4pppt_app_set_gs_for_pattern_only(
+ dk4_pppt_t *pppt,
+ int val,
+ dk4_app_t *app
+)
+{
+ /* ##### TODO: Implementation */
+}
+
+
+
+void
+dk4pppt_app_gsave(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_grestore(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_line_width(
+ dk4_pppt_t *pppt,
+ double lw,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_line_style(
+ dk4_pppt_t *pppt,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_line_cap(
+ dk4_pppt_t *pppt,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_line_join(
+ dk4_pppt_t *pppt,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_fill_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_fill_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_fill_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_stroke_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_stroke_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_stroke_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_prepare_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_prepare_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_prepare_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+int
+dk4pppt_app_can_fill_and_stroke(
+ dk4_pppt_t *pppt
+)
+{
+ /* ##### TODO: Implementation */
+}
+
+
+
+void
+dk4pppt_app_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_clip(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_pattern(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_newpath_moveto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_lineto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_curveto(
+ dk4_pppt_t *pppt,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_closepath(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_bif_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_bif_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_circle(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_rectangle(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_arc(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_ellipse(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_simple_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_special_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_eorule(
+ dk4_pppt_t *pppt,
+ int val
+)
+{
+ /* ##### TODO: Implementation */
+}
+
+
+
+void
+dk4pppt_app_doc_font_size(
+ dk4_pppt_t *pppt,
+ double fs,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_doc_preamble_line(
+ dk4_pppt_t *pppt,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4pppta.ctr b/support/dktools/dk4pppta.ctr
new file mode 100644
index 0000000000..10e46d6916
--- /dev/null
+++ b/support/dktools/dk4pppta.ctr
@@ -0,0 +1,1591 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+
+/** @file dk4pppta.h PGF/PDF/PS+TeX output with dk4_app_t support.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4PPPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4pppt.h"
+#else
+#include <dktools-4/dk4pppt.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open an output structure.
+ @param texname Name of TeX output file.
+ The name ends on ".tex".
+ The name of the included *.eps or *.pdf file
+ is derived from this name.
+ @param dr Output driver.
+ @param isdoc Flag: Produce LaTeX document, not just image.
+ @param flags Additional flags for graphics.
+ @param width Image width in bp (PS point).
+ @param height Image height in bp.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+*/
+dk4_pppt_t *
+dk4pppt_app_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_app_t *app
+);
+
+/** Write output file(s) and close output structure.
+ @param pppt Output structure to write and close.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4pppt_app_write_and_close(
+ dk4_pppt_t *pppt,
+ dk4_app_t *app
+);
+
+/** Close output structure without writing.
+ This function can be used after errors to close the structure
+ without any attempt to overwrite existing files.
+ @param pppt Output structure to close.
+*/
+void
+dk4pppt_app_close(
+ dk4_pppt_t *pppt
+);
+
+/** Set flag for simplified gsave/grestore handling.
+ Set this flag, if you use gsave and grestore only to save and restore
+ the clip path for pattern filling.
+ @param pppt Output structure.
+ @param val Flag: Simplified gsave and grestore handling.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_gs_for_pattern_only(
+ dk4_pppt_t *pppt,
+ int val,
+ dk4_app_t *app
+);
+
+/** Save current graphics state (especially clip path).
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_gsave(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Restore graphics state (especially clip path).
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_grestore(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set line width.
+ @param pppt Output structure.
+ @param lw Line width in bp.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_line_width(
+ dk4_pppt_t *pppt,
+ double lw,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set line style.
+ @param pppt Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_line_style(
+ dk4_pppt_t *pppt,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set line cap.
+ @param pppt Output structure.
+ @param lc Line cap type.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_line_cap(
+ dk4_pppt_t *pppt,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set line join.
+ @param pppt Output structure.
+ @param lj Line join type.
+ @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_line_join(
+ dk4_pppt_t *pppt,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set fill color to gray.
+ @param pppt Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_fill_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set fill color to RGB.
+ @param pppt Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_fill_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set fill color to CMYK.
+ @param pppt Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_fill_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set stroke color to gray.
+ @param pppt Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_stroke_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set stroke color to RGB.
+ @param pppt Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_stroke_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set stroke color to CMYK.
+ @param pppt Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_stroke_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_prepare_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_prepare_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_prepare_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Check whether a combined fill and close operation is available
+ for an output structure.
+ @param pppt Output structure to test.
+ @return 1 if a fill-and-close operation is available, 0 otherwise.
+*/
+int
+dk4pppt_app_can_fill_and_stroke(
+ dk4_pppt_t *pppt
+);
+
+/** Fill current path.
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Stroke current path.
+ Note: Use dk4gra_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Use current path for clipping.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_clip(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Pattern a region (clipping should be set to the path).
+ @param pppt Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_pattern(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Start a new path and move to first point.
+ @param pppt Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_newpath_moveto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add line from current point to new point to path.
+ @param pppt Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_lineto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param pppt Output structure.
+ @param xc1 X coordinate of first control point.
+ @param yc1 Y coordinate of first control point.
+ @param xc2 X coordinate of second control point.
+ @param yc2 Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_curveto(
+ dk4_pppt_t *pppt,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Close current path.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_closepath(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add bitmap image XFig style.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_bif_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add bitmap image.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file data.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_bif_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add bitmap image.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add bitmap image XFig style.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Create path for a circle.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_circle(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_rectangle(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add path for an arc.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_arc(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Create path for an ellipse.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in degree.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_ellipse(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding, only used for char text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_simple_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add special text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use the fill colorö.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_special_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set flag for even-odd-rule.
+ If this flag is on, the even-odd-rule is used for filling and
+ clipping. Otherwise the nonzero-winding rule is used.
+ By default this flag is turned on when creating a dk4_gra_t structure.
+ @param pppt Output structure.
+ @param val New flag value.
+*/
+void
+dk4pppt_app_set_eorule(
+ dk4_pppt_t *pppt,
+ int val
+);
+
+
+/** Set document font size.
+ @param pppt Output structure.
+ @param fs New font size.
+ @param backptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4pppt_app_doc_font_size(
+ dk4_pppt_t *pppt,
+ double fs,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add one preamble line.
+ @param pppt Output structure.
+ @param line Line to add without trailing newline.
+ @param tp Preamble line type.
+ @param backptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4pppt_app_doc_preamble_line(
+ dk4_pppt_t *pppt,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+%% module
+
+#include "dk4pppta.h"
+
+#ifndef GRA_H_INCLUDED
+#include "gra.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+
+$!trace-include
+
+
+
+static
+void
+dk4pppt_app_reset(int *backptr, int back)
+{
+ if ((NULL != backptr) && (0 == back)) {
+ *backptr = 0;
+ }
+}
+
+
+dk4_pppt_t *
+dk4pppt_app_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_app_t *app
+)
+{
+ dk4_pppt_t *back = NULL;
+ /* ##### TODO: Implementation */
+ return back;
+}
+
+
+
+void
+dk4pppt_app_close(
+ dk4_pppt_t *pppt
+)
+{
+ dk4pppt_close(pppt);
+}
+
+
+
+int
+dk4pppt_app_write_and_close(
+ dk4_pppt_t *pppt,
+ dk4_app_t *app
+)
+{
+ /* ##### TODO: Implementation */
+}
+
+
+
+void
+dk4pppt_app_set_gs_for_pattern_only(
+ dk4_pppt_t *pppt,
+ int val,
+ dk4_app_t *app
+)
+{
+ /* ##### TODO: Implementation */
+}
+
+
+
+void
+dk4pppt_app_gsave(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_grestore(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_line_width(
+ dk4_pppt_t *pppt,
+ double lw,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_line_style(
+ dk4_pppt_t *pppt,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_line_cap(
+ dk4_pppt_t *pppt,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_line_join(
+ dk4_pppt_t *pppt,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_fill_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_fill_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_fill_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_stroke_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_stroke_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_stroke_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_prepare_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_prepare_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_prepare_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+int
+dk4pppt_app_can_fill_and_stroke(
+ dk4_pppt_t *pppt
+)
+{
+ /* ##### TODO: Implementation */
+}
+
+
+
+void
+dk4pppt_app_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_clip(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_pattern(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_newpath_moveto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_lineto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_curveto(
+ dk4_pppt_t *pppt,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_closepath(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_bif_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_bif_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_circle(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_rectangle(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_arc(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_ellipse(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_simple_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_special_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_set_eorule(
+ dk4_pppt_t *pppt,
+ int val
+)
+{
+ /* ##### TODO: Implementation */
+}
+
+
+
+void
+dk4pppt_app_doc_font_size(
+ dk4_pppt_t *pppt,
+ double fs,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+void
+dk4pppt_app_doc_preamble_line(
+ dk4_pppt_t *pppt,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_app_t *app
+)
+{
+ int back = 0;
+ /* ##### TODO: Implementation */
+ dk4pppt_app_reset(backptr, back);
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4pppta.h b/support/dktools/dk4pppta.h
new file mode 100644
index 0000000000..20d8187694
--- /dev/null
+++ b/support/dktools/dk4pppta.h
@@ -0,0 +1,877 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pppta.ctr
+*/
+
+#ifndef DK4PPPTA_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4PPPTA_H_INCLUDED 1
+
+
+#line 8 "dk4pppta.ctr"
+
+
+/** @file dk4pppta.h PGF/PDF/PS+TeX output with dk4_app_t support.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4PPPT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4pppt.h"
+#else
+#include <dktools-4/dk4pppt.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open an output structure.
+ @param texname Name of TeX output file.
+ The name ends on ".tex".
+ The name of the included *.eps or *.pdf file
+ is derived from this name.
+ @param dr Output driver.
+ @param isdoc Flag: Produce LaTeX document, not just image.
+ @param flags Additional flags for graphics.
+ @param width Image width in bp (PS point).
+ @param height Image height in bp.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+*/
+dk4_pppt_t *
+dk4pppt_app_open(
+ const dkChar *texname,
+ dk4_pppt_driver_t dr,
+ int isdoc,
+ int flags,
+ size_t width,
+ size_t height,
+ dk4_app_t *app
+);
+
+/** Write output file(s) and close output structure.
+ @param pppt Output structure to write and close.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4pppt_app_write_and_close(
+ dk4_pppt_t *pppt,
+ dk4_app_t *app
+);
+
+/** Close output structure without writing.
+ This function can be used after errors to close the structure
+ without any attempt to overwrite existing files.
+ @param pppt Output structure to close.
+*/
+void
+dk4pppt_app_close(
+ dk4_pppt_t *pppt
+);
+
+/** Set flag for simplified gsave/grestore handling.
+ Set this flag, if you use gsave and grestore only to save and restore
+ the clip path for pattern filling.
+ @param pppt Output structure.
+ @param val Flag: Simplified gsave and grestore handling.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_gs_for_pattern_only(
+ dk4_pppt_t *pppt,
+ int val,
+ dk4_app_t *app
+);
+
+/** Save current graphics state (especially clip path).
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_gsave(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Restore graphics state (especially clip path).
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_grestore(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set line width.
+ @param pppt Output structure.
+ @param lw Line width in bp.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_line_width(
+ dk4_pppt_t *pppt,
+ double lw,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set line style.
+ @param pppt Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_line_style(
+ dk4_pppt_t *pppt,
+ dk4_gra_ls_t ls,
+ double sv,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set line cap.
+ @param pppt Output structure.
+ @param lc Line cap type.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_line_cap(
+ dk4_pppt_t *pppt,
+ dk4_gra_lc_t lc,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set line join.
+ @param pppt Output structure.
+ @param lj Line join type.
+ @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_line_join(
+ dk4_pppt_t *pppt,
+ dk4_gra_lj_t lj,
+ double ml,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set fill color to gray.
+ @param pppt Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_fill_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set fill color to RGB.
+ @param pppt Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_fill_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set fill color to CMYK.
+ @param pppt Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_fill_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set stroke color to gray.
+ @param pppt Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_stroke_gray(
+ dk4_pppt_t *pppt,
+ double g,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set stroke color to RGB.
+ @param pppt Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_stroke_rgb(
+ dk4_pppt_t *pppt,
+ double r,
+ double g,
+ double b,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Set stroke color to CMYK.
+ @param pppt Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_set_stroke_cmyk(
+ dk4_pppt_t *pppt,
+ double c,
+ double m,
+ double y,
+ double k,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_prepare_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_prepare_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_prepare_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Check whether a combined fill and close operation is available
+ for an output structure.
+ @param pppt Output structure to test.
+ @return 1 if a fill-and-close operation is available, 0 otherwise.
+*/
+int
+dk4pppt_app_can_fill_and_stroke(
+ dk4_pppt_t *pppt
+);
+
+/** Fill current path.
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_fill(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Stroke current path.
+ Note: Use dk4gra_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_fill_and_stroke(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Use current path for clipping.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_clip(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Pattern a region (clipping should be set to the path).
+ @param pppt Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_pattern(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_gra_pattern_t pn,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Start a new path and move to first point.
+ @param pppt Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_newpath_moveto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add line from current point to new point to path.
+ @param pppt Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_lineto(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param pppt Output structure.
+ @param xc1 X coordinate of first control point.
+ @param yc1 Y coordinate of first control point.
+ @param xc2 X coordinate of second control point.
+ @param yc2 Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_curveto(
+ dk4_pppt_t *pppt,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Close current path.
+ @param pppt Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_closepath(
+ dk4_pppt_t *pppt,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add bitmap image XFig style.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_bif_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add bitmap image.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param bif Bitmap image file data.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_bif_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add bitmap image.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add bitmap image XFig style.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param fn Image file name.
+ @param fno Frame number (0 for first frame).
+ @param ctx Bitmap image conversion context, may be NULL.
+ @param pos Image positioning:
+ - 0 not rotated, not flipped,
+ - 1 rotated 90 degree counterclockwise, not flipped,
+ - 2 rotated 180 degree counterclockwise, not flipped,
+ - 3 rotated 270 degree counterclockwise, not flipped,
+ - 4 not rotated, flipped,
+ - 5 rotated 90 degree counterclockwise, flipped,
+ - 6 rotated 180 degree counterclockwise, flipped,
+ - 7 rotated 270 degree counterclockwise, flipped.
+ @param ifl Image flags.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_fig_image(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ const dkChar *fn,
+ size_t fno,
+ dk4_cs_conv_ctx_t *ctx,
+ int pos,
+ int ifl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Create path for a circle.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_circle(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param pppt Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_rectangle(
+ dk4_pppt_t *pppt,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add path for an arc.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_arc(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Create path for an ellipse.
+ @param pppt Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in degree.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_ellipse(
+ dk4_pppt_t *pppt,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add simple (non-special) text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use fill color.
+ @param ie Text encoding, only used for char text.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font (1) or similar font (0).
+ @param uc2l UC to LaTeX conversion structure.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_simple_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ const dkChar *txt,
+ const char *colspec,
+ int ie,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ dk4_uc2l_t *uc2l,
+ int *backptr,
+ dk4_app_t *app
+);
+
+/** Add special text to PGF graphics.
+ The text is shown in the current fill color (non-stroking color)
+ unless colspec is used to specify a color.
+ @param pppt Output structure, must be initialized for PGF.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param txt Text to show.
+ @param colspec Color specification, may be NULL to use the fill colorö.
+ @param ha Horizontal alignment.
+ @param va Vertical alignment.
+ @param fno Font number.
+ @param fsz Font size in pt.
+ @param fex Flag: Use exact font.
+ @param backptr Address of success variable to reset on errors.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+void
+dk4pppt_app_special_text(
+ dk4_pppt_t *pppt,
+ double x,
+ double y,
+ const char *txt,
+ const char *colspec,
+ dk4_text_align_h_t ha,
+ dk4_text_align_v_t va,
+ int fno,
+ double fsz,
+ dk4_gra_tf_t fex,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Set flag for even-odd-rule.
+ If this flag is on, the even-odd-rule is used for filling and
+ clipping. Otherwise the nonzero-winding rule is used.
+ By default this flag is turned on when creating a dk4_gra_t structure.
+ @param pppt Output structure.
+ @param val New flag value.
+*/
+void
+dk4pppt_app_set_eorule(
+ dk4_pppt_t *pppt,
+ int val
+);
+
+
+/** Set document font size.
+ @param pppt Output structure.
+ @param fs New font size.
+ @param backptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4pppt_app_doc_font_size(
+ dk4_pppt_t *pppt,
+ double fs,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+/** Add one preamble line.
+ @param pppt Output structure.
+ @param line Line to add without trailing newline.
+ @param tp Preamble line type.
+ @param backptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics, may be NULL.
+*/
+
+void
+dk4pppt_app_doc_preamble_line(
+ dk4_pppt_t *pppt,
+ const char *line,
+ int tp,
+ int *backptr,
+ dk4_app_t *app
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+
+#endif
diff --git a/support/dktools/dk4pref.c b/support/dktools/dk4pref.c
index a8d8d133b5..279b1aa7e6 100644
--- a/support/dktools/dk4pref.c
+++ b/support/dktools/dk4pref.c
@@ -1,53 +1,38 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4pref.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pref.ctr
*/
/** @file dk4pref.c The dk4pref module.
*/
-#line 93 "dk4pref.ctr"
+#line 117 "dk4pref.ctr"
+#include "dk4conf.h"
#include "dk4pref.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 101 "dk4pref.ctr"
+#line 132 "dk4pref.ctr"
@@ -57,7 +42,11 @@ dk4pref_open(dkChar const *name, dkChar const *value, dk4_er_t *erp)
dk4_pref_t *back = NULL;
-#line 109 "dk4pref.ctr"
+#line 140 "dk4pref.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != value);
+#endif
if ((NULL != name) && (NULL != value)) {
back = dk4mem_new(dk4_pref_t,1,erp);
if (NULL != back) {
@@ -74,7 +63,7 @@ dk4pref_open(dkChar const *name, dkChar const *value, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 124 "dk4pref.ctr"
+#line 159 "dk4pref.ctr"
return back;
}
@@ -85,11 +74,14 @@ dk4pref_close(dk4_pref_t *ptr)
{
-#line 133 "dk4pref.ctr"
+#line 168 "dk4pref.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
-#line 135 "dk4pref.ctr"
+#line 173 "dk4pref.ctr"
#if 0
/* Original stuff.
*/
@@ -104,7 +96,7 @@ dk4pref_close(dk4_pref_t *ptr)
}
-#line 148 "dk4pref.ctr"
+#line 186 "dk4pref.ctr"
}
@@ -117,7 +109,7 @@ dk4pref_compare(const void *l, const void *r, int cr)
int back = 0;
-#line 159 "dk4pref.ctr"
+#line 197 "dk4pref.ctr"
if (NULL != l) {
if (NULL != r) {
pl = (const dk4_pref_t *)l;
@@ -153,7 +145,7 @@ dk4pref_compare(const void *l, const void *r, int cr)
}
}
-#line 193 "dk4pref.ctr"
+#line 231 "dk4pref.ctr"
return back;
}
diff --git a/support/dktools/dk4pref.ctr b/support/dktools/dk4pref.ctr
index cd43353e4b..b99007579b 100644
--- a/support/dktools/dk4pref.ctr
+++ b/support/dktools/dk4pref.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -19,27 +19,51 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STR8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4str8.h"
+#else
+#include <dktools-4/dk4str8.h>
+#endif
#endif
#ifndef DK4STRW_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strw.h"
+#else
+#include <dktools-4/dk4strw.h>
+#endif
#endif
#ifndef DK4STRD_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strd.h"
+#else
+#include <dktools-4/dk4strd.h>
+#endif
#endif
@@ -92,9 +116,16 @@ dk4pref_compare(const void *l, const void *r, int cr);
%% module
+#include "dk4conf.h"
#include "dk4pref.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -106,6 +137,10 @@ dk4pref_open(dkChar const *name, dkChar const *value, dk4_er_t *erp)
{
dk4_pref_t *back = NULL;
$? "+ dk4pref_open \"%!ds\"=\"%!ds\"", TR_DKSTR(name), TR_DKSTR(value)
+#if DK4_USE_ASSERT
+ assert(NULL != name);
+ assert(NULL != value);
+#endif
if ((NULL != name) && (NULL != value)) {
back = dk4mem_new(dk4_pref_t,1,erp);
if (NULL != back) {
@@ -130,6 +165,9 @@ void
dk4pref_close(dk4_pref_t *ptr)
{
$? "+ dk4pref_close"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
$? ". \"%!ds\"=\"%!ds\"", TR_DKSTR(ptr->name), TR_DKSTR(ptr->value)
#if 0
diff --git a/support/dktools/dk4pref.h b/support/dktools/dk4pref.h
index 741ae9c080..990034f6fa 100644
--- a/support/dktools/dk4pref.h
+++ b/support/dktools/dk4pref.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4pref.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pref.ctr
*/
#ifndef DK4PREF_H_INCLUDED
@@ -51,27 +29,51 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STR8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4str8.h"
+#else
+#include <dktools-4/dk4str8.h>
+#endif
#endif
#ifndef DK4STRW_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strw.h"
+#else
+#include <dktools-4/dk4strw.h>
+#endif
#endif
#ifndef DK4STRD_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strd.h"
+#else
+#include <dktools-4/dk4strd.h>
+#endif
#endif
diff --git a/support/dktools/dk4px.h b/support/dktools/dk4px.h
new file mode 100644
index 0000000000..578d12c99f
--- /dev/null
+++ b/support/dktools/dk4px.h
@@ -0,0 +1,41 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef DK4PX_H_INCLUDED
+/** Protection against multiple inclusion. */
+#define DK4PX_H_INCLUDED 1
+
+/** @file dk4px.h Definition of the dk4_px_t data type.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+/** One component (one color or alpha) of a pixel.
+*/
+typedef uint16_t dk4_px_t;
+
+
+/** Bit depth (number of bits per component). As seen above, the maximum
+ is 16.
+*/
+typedef uint8_t dk4_px_bit_depth_t;
+
+
+/* vim: set ai sw=4 ts=4 : */
+#endif
diff --git a/support/dktools/dk4pxbit.c b/support/dktools/dk4pxbit.c
new file mode 100644
index 0000000000..36b815e59a
--- /dev/null
+++ b/support/dktools/dk4pxbit.c
@@ -0,0 +1,100 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pxbit.ctr
+*/
+
+/** @file dk4pxbit.c The dk4pxbit module.
+*/
+
+
+#line 77 "dk4pxbit.ctr"
+
+#include "dk4conf.h"
+#ifndef DK4PXBIT_H_INCLUDED
+#include "dk4pxbit.h"
+#endif
+
+
+
+
+
+#line 86 "dk4pxbit.ctr"
+
+
+
+/** Bit number values.
+*/
+static dk4_px_t dk4pxbit_values[] = {
+ 0x0001U, 0x0002U, 0x0004U, 0x0008U, 0x0010U, 0x0020U, 0x0040U, 0x0080U,
+ 0x0100U, 0x0200U, 0x0400U, 0x0800U, 0x1000U, 0x2000U, 0x4000U, 0x8000U
+};
+
+
+/** Maxima values.
+*/
+static dk4_px_t dk4pxbit_maxima[] = {
+ 0x0001U, 0x0003U, 0x0007U, 0x000FU, 0x001FU, 0x003FU, 0x007FU, 0x00FFU,
+ 0x01FFU, 0x03FFU, 0x07FFU, 0x0FFFU, 0x1FFFU, 0x3FFFU, 0x7FFFU, 0xFFFFU
+};
+
+
+
+dk4_px_t
+dk4pxbit_get_bit(size_t bitno)
+{
+ if ((sizeof(dk4pxbit_values)/sizeof(dk4_px_t)) > bitno) {
+ return (dk4pxbit_values[bitno]);
+ }
+ return ((dk4_px_t)0U);
+}
+
+
+
+dk4_px_t
+dk4pxbit_get_max(size_t bitno)
+{
+ dk4_px_t back = 0;
+
+
+#line 122 "dk4pxbit.ctr"
+ if (((sizeof(dk4pxbit_maxima)/sizeof(dk4_px_t)) > bitno) && (0 < bitno)) {
+ back = dk4pxbit_maxima[bitno - 1];
+ }
+
+
+#line 126 "dk4pxbit.ctr"
+ return back;
+}
+
+
+
+size_t
+dk4pxbit_get_bitno(dk4_px_t maxval)
+{
+ size_t back = 16;
+ size_t i = 15;
+ int cc = 1;
+ for (i = 15; ((i > 0) && (1 == cc)); i--) {
+ if (dk4pxbit_maxima[i - 1] >= maxval) {
+ back = i;
+ }
+ else {
+ cc = 0;
+ }
+ }
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4pxbit.ctr b/support/dktools/dk4pxbit.ctr
new file mode 100644
index 0000000000..09bd6db4a1
--- /dev/null
+++ b/support/dktools/dk4pxbit.ctr
@@ -0,0 +1,152 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4pxbit.h Bit constants for pixels.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4PX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4px.h"
+#else
+#include <dktools-4/dk4px.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve bit for a given bit number.
+ Least significant bit is 0, most significant is 15.
+ @param bitno Bit number to retrieve bit value for.
+ @return Positive bit value on success, 0 on error (out of range).
+*/
+
+dk4_px_t
+dk4pxbit_get_bit(size_t bitno);
+
+
+/** Retrieve maximum value for a given bit number.
+ Least significant bit is 0, most significant is 15.
+ @param bitno Bit number to retrieve bit value for.
+ @return Positive maximum value on success, 0 on error (out of range).
+*/
+
+dk4_px_t
+dk4pxbit_get_max(size_t bitno);
+
+
+/** Find bit number to represent a maximum value.
+ @param maxval Maximum value for a pixel component.
+ @return Required bit number.
+*/
+
+size_t
+dk4pxbit_get_bitno(dk4_px_t maxval);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+%% module
+
+#include "dk4conf.h"
+#ifndef DK4PXBIT_H_INCLUDED
+#include "dk4pxbit.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Bit number values.
+*/
+static dk4_px_t dk4pxbit_values[] = {
+ 0x0001U, 0x0002U, 0x0004U, 0x0008U, 0x0010U, 0x0020U, 0x0040U, 0x0080U,
+ 0x0100U, 0x0200U, 0x0400U, 0x0800U, 0x1000U, 0x2000U, 0x4000U, 0x8000U
+};
+
+
+/** Maxima values.
+*/
+static dk4_px_t dk4pxbit_maxima[] = {
+ 0x0001U, 0x0003U, 0x0007U, 0x000FU, 0x001FU, 0x003FU, 0x007FU, 0x00FFU,
+ 0x01FFU, 0x03FFU, 0x07FFU, 0x0FFFU, 0x1FFFU, 0x3FFFU, 0x7FFFU, 0xFFFFU
+};
+
+
+
+dk4_px_t
+dk4pxbit_get_bit(size_t bitno)
+{
+ if ((sizeof(dk4pxbit_values)/sizeof(dk4_px_t)) > bitno) {
+ return (dk4pxbit_values[bitno]);
+ }
+ return ((dk4_px_t)0U);
+}
+
+
+
+dk4_px_t
+dk4pxbit_get_max(size_t bitno)
+{
+ dk4_px_t back = 0;
+ $? "+ dk4pxbit_get_max %u", (unsigned)bitno
+ if (((sizeof(dk4pxbit_maxima)/sizeof(dk4_px_t)) > bitno) && (0 < bitno)) {
+ back = dk4pxbit_maxima[bitno - 1];
+ }
+ $? "- dk4pxbit_get_max %lu", (unsigned long)back
+ return back;
+}
+
+
+
+size_t
+dk4pxbit_get_bitno(dk4_px_t maxval)
+{
+ size_t back = 16;
+ size_t i = 15;
+ int cc = 1;
+ for (i = 15; ((i > 0) && (1 == cc)); i--) {
+ if (dk4pxbit_maxima[i - 1] >= maxval) {
+ back = i;
+ }
+ else {
+ cc = 0;
+ }
+ }
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4pxbit.h b/support/dktools/dk4pxbit.h
new file mode 100644
index 0000000000..38dc81a3de
--- /dev/null
+++ b/support/dktools/dk4pxbit.h
@@ -0,0 +1,89 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pxbit.ctr
+*/
+
+#ifndef DK4PXBIT_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4PXBIT_H_INCLUDED 1
+
+
+#line 8 "dk4pxbit.ctr"
+
+/** @file dk4pxbit.h Bit constants for pixels.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4PX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4px.h"
+#else
+#include <dktools-4/dk4px.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve bit for a given bit number.
+ Least significant bit is 0, most significant is 15.
+ @param bitno Bit number to retrieve bit value for.
+ @return Positive bit value on success, 0 on error (out of range).
+*/
+
+dk4_px_t
+dk4pxbit_get_bit(size_t bitno);
+
+
+/** Retrieve maximum value for a given bit number.
+ Least significant bit is 0, most significant is 15.
+ @param bitno Bit number to retrieve bit value for.
+ @return Positive maximum value on success, 0 on error (out of range).
+*/
+
+dk4_px_t
+dk4pxbit_get_max(size_t bitno);
+
+
+/** Find bit number to represent a maximum value.
+ @param maxval Maximum value for a pixel component.
+ @return Required bit number.
+*/
+
+size_t
+dk4pxbit_get_bitno(dk4_px_t maxval);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+
+#endif
diff --git a/support/dktools/dk4pxres.c b/support/dktools/dk4pxres.c
new file mode 100644
index 0000000000..02c52fbc4b
--- /dev/null
+++ b/support/dktools/dk4pxres.c
@@ -0,0 +1,337 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pxres.ctr
+*/
+
+/** @file dk4pxres.c The dk4pxres module.
+*/
+
+
+#line 148 "dk4pxres.ctr"
+
+#include "dk4conf.h"
+
+#ifndef DK4PXRES_H_INCLUDED
+#include "dk4pxres.h"
+#endif
+
+#ifndef DK4PXBIT_H_INCLUDED
+#include "dk4pxbit.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 168 "dk4pxres.ctr"
+
+
+
+void
+dk4pxres_init(dk4_px_resample_t *pxrptr)
+{
+
+
+#line 175 "dk4pxres.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ if (NULL != pxrptr) {
+ pxrptr->nom = 255UL;
+ pxrptr->denom = 255UL;
+ pxrptr->denom2 = 127UL;
+ }
+
+
+#line 184 "dk4pxres.ctr"
+}
+
+
+
+int
+dk4pxres_setup(
+ dk4_px_resample_t *pxrptr,
+ size_t ibits,
+ size_t obits
+)
+{
+ dk4_px_t nom;
+ dk4_px_t denom;
+ int back = 0;
+
+
+#line 199 "dk4pxres.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ /*
+ Check pointer
+ */
+ if (NULL == pxrptr) {
+ goto finished;
+ }
+ pxrptr->nom = 255UL;
+ pxrptr->denom = 255UL;
+ pxrptr->denom2 = 127UL;
+ /*
+ Attempt to retrieve values
+ */
+ nom = dk4pxbit_get_max(obits);
+ denom = dk4pxbit_get_max(ibits);
+ if ((0 == nom) || (0 == denom)) {
+ goto finished;
+ }
+ /*
+ Set values and indicate success
+ */
+ pxrptr->nom = (unsigned long)nom;
+ pxrptr->denom = (unsigned long)denom;
+ pxrptr->denom2 = pxrptr->denom / 2UL;
+
+
+#line 226 "dk4pxres.ctr"
+ back = 1;
+ finished:
+
+
+#line 229 "dk4pxres.ctr"
+ return back;
+}
+
+
+
+int
+dk4pxres_setup_from_maxval(
+ dk4_px_resample_t *pxrptr,
+ dk4_px_t imaxval,
+ size_t obits
+)
+{
+ int back = 0;
+ unsigned long nom;
+ unsigned long denom;
+
+
+#line 245 "dk4pxres.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ /*
+ Check pointer
+ */
+ if (NULL == pxrptr) {
+ goto finished;
+ }
+ /*
+ Set defaults
+ */
+ pxrptr->nom = 255UL;
+ pxrptr->denom = 255UL;
+ pxrptr->denom2 = 127UL;
+ /*
+ Retrieve values
+ */
+ nom = dk4pxbit_get_max(obits);
+ if ((0 == nom) || (0 == imaxval)) {
+ goto finished;
+ }
+ /* Set values and indicate success
+ */
+ pxrptr->nom = (unsigned long)nom;
+ pxrptr->denom = denom = (unsigned long)imaxval;
+ pxrptr->denom2 = (unsigned long)imaxval / 2UL;
+
+
+#line 273 "dk4pxres.ctr"
+ back = 1;
+
+ finished:
+
+
+#line 277 "dk4pxres.ctr"
+ return back;
+}
+
+
+
+int
+dk4pxres_setup_to_maxval(
+ dk4_px_resample_t *pxrptr,
+ size_t ibits,
+ dk4_px_t omaxval
+)
+{
+ unsigned long nom;
+ unsigned long denom;
+ int back = 0;
+
+
+#line 293 "dk4pxres.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ /*
+ Check pointer
+ */
+ if (NULL == pxrptr) { goto finished; }
+ /*
+ Set defaults
+ */
+ pxrptr->nom = 255UL;
+ pxrptr->denom = 255UL;
+ pxrptr->denom2 = 127UL;
+ /*
+ Find nominator and denominator
+ */
+ nom = (unsigned long)omaxval;
+ denom = (unsigned long)dk4pxbit_get_max(ibits);
+ if ((0UL == nom) || (0UL == denom)) { goto finished; }
+ pxrptr->nom = nom;
+ pxrptr->denom = denom;
+ pxrptr->denom2 = denom / 2UL;
+
+
+#line 316 "dk4pxres.ctr"
+ back = 1;
+
+ finished:
+
+
+#line 320 "dk4pxres.ctr"
+ return back;
+}
+
+
+
+dk4_px_t
+dk4pxres_get(
+ dk4_px_resample_t const *pxrptr,
+ dk4_px_t in
+)
+{
+ unsigned long prod;
+ dk4_px_t back = 0U;
+
+
+#line 334 "dk4pxres.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ /*
+ Check pointer
+ */
+ if (NULL == pxrptr) {
+ goto finished;
+ }
+ /*
+ Leave value unchanged for equal size
+ */
+ if (pxrptr->nom == pxrptr->denom) {
+ back = in;
+ goto finished;
+ }
+ /*
+ Calculate
+ */
+ if (0 == pxrptr->denom) {
+ goto finished;
+ }
+ prod = (unsigned long)in * pxrptr->nom;
+ back = (dk4_px_t)(prod / pxrptr->denom);
+ if (pxrptr->denom2 < (prod % pxrptr->denom)) {
+ back++;
+ }
+ finished:
+
+
+#line 363 "dk4pxres.ctr"
+ return back;
+}
+
+
+
+int
+dk4pxres_check(
+ dk4_px_resample_t const *pxrptr,
+ dk4_px_t in
+)
+{
+ unsigned long prod;
+ int back = 0;
+
+
+#line 377 "dk4pxres.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ if (NULL == pxrptr) {
+ goto finished;
+ }
+ if (pxrptr->nom == pxrptr->denom) {
+ back = 1;
+ goto finished;
+ }
+ if (0 == pxrptr->denom) {
+ goto finished;
+ }
+ prod = (unsigned long)in * pxrptr->nom;
+ if (0 == (prod % pxrptr->denom)) {
+ back = 1;
+ }
+ finished:
+
+
+#line 396 "dk4pxres.ctr"
+ return back;
+}
+
+
+
+int
+dk4pxres_multiple(
+ dk4_px_t *dptr,
+ size_t dsz,
+ dk4_px_resample_t const *pxrptr
+)
+{
+ int back = 0;
+
+
+#line 410 "dk4pxres.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
+ if ((NULL == dptr) || (NULL == pxrptr)) {
+ goto finished;
+ }
+ back = 1;
+ while (0 < dsz--) {
+ *dptr = dk4pxres_get(pxrptr, *dptr);
+ dptr++;
+ }
+ finished:
+
+
+#line 424 "dk4pxres.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4pxres.ctr b/support/dktools/dk4pxres.ctr
new file mode 100644
index 0000000000..6dde1a8373
--- /dev/null
+++ b/support/dktools/dk4pxres.ctr
@@ -0,0 +1,430 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4pxres.h Pixel resampling.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4PXBIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4pxbit.h"
+#else
+#include <dktools-4/dk4pxbit.h>
+#endif
+#endif
+
+/** Structure to resample pixels.
+*/
+typedef struct {
+ unsigned long nom; /**< Nominator in scale factor. */
+ unsigned long denom; /**< Denominator in scale factor. */
+ unsigned long denom2; /**< Half of the denominator. */
+} dk4_px_resample_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Initialize resampler structure.
+ @param pxrptr Resampler structure to initialize.
+*/
+
+void
+dk4pxres_init(dk4_px_resample_t *pxrptr);
+
+
+/** Set up resample structure for conversions.
+ @param pxrptr Resample structure to set up.
+ @param ibits Number of input bits.
+ @param obits Number of output (result) bits.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4pxres_setup(
+ dk4_px_resample_t *pxrptr,
+ size_t ibits,
+ size_t obits
+);
+
+
+/** Set up resample structure for conversions for unusual maxval values.
+ Input is from a range with unusual maxval, output is prepared
+ for a given bit depth.
+ @param pxrptr Resample structure to set up.
+ @param imaxval Maximum value for input pixel data.
+ @param obits Number of output (result) bits.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4pxres_setup_from_maxval(
+ dk4_px_resample_t *pxrptr,
+ dk4_px_t imaxval,
+ size_t obits
+);
+
+
+/** Set up resample structure for conversions for unusual maxval values.
+ Input has a given bit depth, output must be in the range up to s
+ specified maxval.
+ @param pxrptr Resample structure to set up.
+ @param ibits Input bit depth.
+ @param omaxval Maximum value for output pixel data.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4pxres_setup_to_maxval(
+ dk4_px_resample_t *pxrptr,
+ size_t ibits,
+ dk4_px_t omaxval
+);
+
+
+/** Resample pixel component from old bit width to new bit width.
+ @param pxrptr Resample structure to use.
+ @param in Component value in old bit depth.
+ @return Resampling result (component value in new bit depth).
+*/
+
+dk4_px_t
+dk4pxres_get(
+ dk4_px_resample_t const *pxrptr,
+ dk4_px_t in
+);
+
+
+/** Check whether a component value can be resampled without quality loss.
+ @param pxrptr Resample structure to use.
+ @param in Component value in old bit depth.
+ @return 1 on success (no division remainder), 0 on error
+ (skipped division remainder results in quality loss).
+*/
+
+int
+dk4pxres_check(
+ dk4_px_resample_t const *pxrptr,
+ dk4_px_t in
+);
+
+
+/** Resample multiple values to new bit depth.
+ @param dptr Array containing values to resample, results on output.
+ @param dsz Number of elements in array.
+ @param pxrptr Resample structure to use.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4pxres_multiple(
+ dk4_px_t *dptr,
+ size_t dsz,
+ dk4_px_resample_t const *pxrptr
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+%% module
+
+#include "dk4conf.h"
+
+#ifndef DK4PXRES_H_INCLUDED
+#include "dk4pxres.h"
+#endif
+
+#ifndef DK4PXBIT_H_INCLUDED
+#include "dk4pxbit.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+void
+dk4pxres_init(dk4_px_resample_t *pxrptr)
+{
+ $? "+ dk4pxres_init ptr=%d", TR_IPTR(pxrptr)
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ if (NULL != pxrptr) {
+ pxrptr->nom = 255UL;
+ pxrptr->denom = 255UL;
+ pxrptr->denom2 = 127UL;
+ }
+ $? "- dk4pxres_init"
+}
+
+
+
+int
+dk4pxres_setup(
+ dk4_px_resample_t *pxrptr,
+ size_t ibits,
+ size_t obits
+)
+{
+ dk4_px_t nom;
+ dk4_px_t denom;
+ int back = 0;
+ $? "+ dk4pxres_setup in=%u out=%u", (unsigned)ibits, (unsigned)obits
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ /*
+ Check pointer
+ */
+ if (NULL == pxrptr) {
+ goto finished;
+ }
+ pxrptr->nom = 255UL;
+ pxrptr->denom = 255UL;
+ pxrptr->denom2 = 127UL;
+ /*
+ Attempt to retrieve values
+ */
+ nom = dk4pxbit_get_max(obits);
+ denom = dk4pxbit_get_max(ibits);
+ if ((0 == nom) || (0 == denom)) {
+ goto finished;
+ }
+ /*
+ Set values and indicate success
+ */
+ pxrptr->nom = (unsigned long)nom;
+ pxrptr->denom = (unsigned long)denom;
+ pxrptr->denom2 = pxrptr->denom / 2UL;
+ $? ". factor = %lu / %lu", (unsigned long)nom, (unsigned long)denom
+ back = 1;
+ finished:
+ $? "- dk4pxres_setup %d", back
+ return back;
+}
+
+
+
+int
+dk4pxres_setup_from_maxval(
+ dk4_px_resample_t *pxrptr,
+ dk4_px_t imaxval,
+ size_t obits
+)
+{
+ int back = 0;
+ unsigned long nom;
+ unsigned long denom;
+ $? "+ dk4pxres_setup_from_maxval p=%d maxval=%u obits=%u", TR_IPTR(pxrptr), (unsigned)imaxval, (unsigned)obits
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ /*
+ Check pointer
+ */
+ if (NULL == pxrptr) {
+ goto finished;
+ }
+ /*
+ Set defaults
+ */
+ pxrptr->nom = 255UL;
+ pxrptr->denom = 255UL;
+ pxrptr->denom2 = 127UL;
+ /*
+ Retrieve values
+ */
+ nom = dk4pxbit_get_max(obits);
+ if ((0 == nom) || (0 == imaxval)) {
+ goto finished;
+ }
+ /* Set values and indicate success
+ */
+ pxrptr->nom = (unsigned long)nom;
+ pxrptr->denom = denom = (unsigned long)imaxval;
+ pxrptr->denom2 = (unsigned long)imaxval / 2UL;
+ $? ". factor = %lu / %lu", (unsigned long)nom, (unsigned long)denom
+ back = 1;
+
+ finished:
+ $? "- dk4pxres_setup_from_maxval %d", back
+ return back;
+}
+
+
+
+int
+dk4pxres_setup_to_maxval(
+ dk4_px_resample_t *pxrptr,
+ size_t ibits,
+ dk4_px_t omaxval
+)
+{
+ unsigned long nom;
+ unsigned long denom;
+ int back = 0;
+ $? "+ dk4pxres_setup_to_maxval"
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ /*
+ Check pointer
+ */
+ if (NULL == pxrptr) { goto finished; }
+ /*
+ Set defaults
+ */
+ pxrptr->nom = 255UL;
+ pxrptr->denom = 255UL;
+ pxrptr->denom2 = 127UL;
+ /*
+ Find nominator and denominator
+ */
+ nom = (unsigned long)omaxval;
+ denom = (unsigned long)dk4pxbit_get_max(ibits);
+ if ((0UL == nom) || (0UL == denom)) { goto finished; }
+ pxrptr->nom = nom;
+ pxrptr->denom = denom;
+ pxrptr->denom2 = denom / 2UL;
+ $? ". factor = %lu / %lu", nom, denom
+ back = 1;
+
+ finished:
+ $? "- dk4pxres_setup_to_maxval %d", back
+ return back;
+}
+
+
+
+dk4_px_t
+dk4pxres_get(
+ dk4_px_resample_t const *pxrptr,
+ dk4_px_t in
+)
+{
+ unsigned long prod;
+ dk4_px_t back = 0U;
+ $? "+ dk4pxres_get %lu", (unsigned long)in
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ /*
+ Check pointer
+ */
+ if (NULL == pxrptr) {
+ goto finished;
+ }
+ /*
+ Leave value unchanged for equal size
+ */
+ if (pxrptr->nom == pxrptr->denom) {
+ back = in;
+ goto finished;
+ }
+ /*
+ Calculate
+ */
+ if (0 == pxrptr->denom) {
+ goto finished;
+ }
+ prod = (unsigned long)in * pxrptr->nom;
+ back = (dk4_px_t)(prod / pxrptr->denom);
+ if (pxrptr->denom2 < (prod % pxrptr->denom)) {
+ back++;
+ }
+ finished:
+ $? "- dk4pxres_get %lu", (unsigned long)back
+ return back;
+}
+
+
+
+int
+dk4pxres_check(
+ dk4_px_resample_t const *pxrptr,
+ dk4_px_t in
+)
+{
+ unsigned long prod;
+ int back = 0;
+ $? "+ dk4pxres_check %lu", (unsigned long)in
+#if DK4_USE_ASSERT
+ assert(NULL != pxrptr);
+#endif
+ if (NULL == pxrptr) {
+ goto finished;
+ }
+ if (pxrptr->nom == pxrptr->denom) {
+ back = 1;
+ goto finished;
+ }
+ if (0 == pxrptr->denom) {
+ goto finished;
+ }
+ prod = (unsigned long)in * pxrptr->nom;
+ if (0 == (prod % pxrptr->denom)) {
+ back = 1;
+ }
+ finished:
+ $? "- dk4pxres_check %d", back
+ return back;
+}
+
+
+
+int
+dk4pxres_multiple(
+ dk4_px_t *dptr,
+ size_t dsz,
+ dk4_px_resample_t const *pxrptr
+)
+{
+ int back = 0;
+ $? "+ dk4pxres_multiple %u", (unsigned)dsz
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
+ if ((NULL == dptr) || (NULL == pxrptr)) {
+ goto finished;
+ }
+ back = 1;
+ while (0 < dsz--) {
+ *dptr = dk4pxres_get(pxrptr, *dptr);
+ dptr++;
+ }
+ finished:
+ $? "- dk4pxres_multiple %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4pxres.h b/support/dktools/dk4pxres.h
new file mode 100644
index 0000000000..b718fb96d3
--- /dev/null
+++ b/support/dktools/dk4pxres.h
@@ -0,0 +1,159 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4pxres.ctr
+*/
+
+#ifndef DK4PXRES_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4PXRES_H_INCLUDED 1
+
+
+#line 9 "dk4pxres.ctr"
+
+/** @file dk4pxres.h Pixel resampling.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4PXBIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4pxbit.h"
+#else
+#include <dktools-4/dk4pxbit.h>
+#endif
+#endif
+
+/** Structure to resample pixels.
+*/
+typedef struct {
+ unsigned long nom; /**< Nominator in scale factor. */
+ unsigned long denom; /**< Denominator in scale factor. */
+ unsigned long denom2; /**< Half of the denominator. */
+} dk4_px_resample_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Initialize resampler structure.
+ @param pxrptr Resampler structure to initialize.
+*/
+
+void
+dk4pxres_init(dk4_px_resample_t *pxrptr);
+
+
+/** Set up resample structure for conversions.
+ @param pxrptr Resample structure to set up.
+ @param ibits Number of input bits.
+ @param obits Number of output (result) bits.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4pxres_setup(
+ dk4_px_resample_t *pxrptr,
+ size_t ibits,
+ size_t obits
+);
+
+
+/** Set up resample structure for conversions for unusual maxval values.
+ Input is from a range with unusual maxval, output is prepared
+ for a given bit depth.
+ @param pxrptr Resample structure to set up.
+ @param imaxval Maximum value for input pixel data.
+ @param obits Number of output (result) bits.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4pxres_setup_from_maxval(
+ dk4_px_resample_t *pxrptr,
+ dk4_px_t imaxval,
+ size_t obits
+);
+
+
+/** Set up resample structure for conversions for unusual maxval values.
+ Input has a given bit depth, output must be in the range up to s
+ specified maxval.
+ @param pxrptr Resample structure to set up.
+ @param ibits Input bit depth.
+ @param omaxval Maximum value for output pixel data.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4pxres_setup_to_maxval(
+ dk4_px_resample_t *pxrptr,
+ size_t ibits,
+ dk4_px_t omaxval
+);
+
+
+/** Resample pixel component from old bit width to new bit width.
+ @param pxrptr Resample structure to use.
+ @param in Component value in old bit depth.
+ @return Resampling result (component value in new bit depth).
+*/
+
+dk4_px_t
+dk4pxres_get(
+ dk4_px_resample_t const *pxrptr,
+ dk4_px_t in
+);
+
+
+/** Check whether a component value can be resampled without quality loss.
+ @param pxrptr Resample structure to use.
+ @param in Component value in old bit depth.
+ @return 1 on success (no division remainder), 0 on error
+ (skipped division remainder results in quality loss).
+*/
+
+int
+dk4pxres_check(
+ dk4_px_resample_t const *pxrptr,
+ dk4_px_t in
+);
+
+
+/** Resample multiple values to new bit depth.
+ @param dptr Array containing values to resample, results on output.
+ @param dsz Number of elements in array.
+ @param pxrptr Resample structure to use.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4pxres_multiple(
+ dk4_px_t *dptr,
+ size_t dsz,
+ dk4_px_resample_t const *pxrptr
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+
+#endif
diff --git a/support/dktools/dk4rec.h b/support/dktools/dk4rec.h
index 6a34458ba1..fb0fc3212a 100644
--- a/support/dktools/dk4rec.h
+++ b/support/dktools/dk4rec.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2016-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4REC_H_INCLUDED
#define DK4REC_H_INCLUDED 1
@@ -25,6 +30,8 @@
- ASCII to dkChar: dk4recode_ascii_to_dk()
- char to dkChar (simple conversion, 0x00 to 0x7F only):
dk4recode_char_to_dk()
+ - char (ASCII, WIN1252 or UTF-8) to dkChar:
+ dk4recode_c8_to_dk()
- char to wchar_t (simple conversion, 0x00 to 0x7F only):
dk4recode_char_to_wchar_t()
- wchar_t to char (simple conversion, 0x00 to 0x7F only):
@@ -34,79 +41,193 @@
*/
#ifndef DK4REC01_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec01.h"
+#else
+#include <dktools-4/dk4rec01.h>
+#endif
#endif
#ifndef DK4REC02_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec02.h"
+#else
+#include <dktools-4/dk4rec02.h>
+#endif
#endif
#ifndef DK4REC03_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec03.h"
+#else
+#include <dktools-4/dk4rec03.h>
+#endif
#endif
#ifndef DK4REC04_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec04.h"
+#else
+#include <dktools-4/dk4rec04.h>
+#endif
#endif
#ifndef DK4REC05_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec05.h"
+#else
+#include <dktools-4/dk4rec05.h>
+#endif
#endif
#ifndef DK4REC06_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec06.h"
+#else
+#include <dktools-4/dk4rec06.h>
+#endif
#endif
#ifndef DK4REC07_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec07.h"
+#else
+#include <dktools-4/dk4rec07.h>
+#endif
#endif
#ifndef DK4REC08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec08.h"
+#else
+#include <dktools-4/dk4rec08.h>
+#endif
#endif
#ifndef DK4REC09_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec09.h"
+#else
+#include <dktools-4/dk4rec09.h>
+#endif
#endif
#ifndef DK4REC10_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec10.h"
+#else
+#include <dktools-4/dk4rec10.h>
+#endif
#endif
#ifndef DK4REC11_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec11.h"
+#else
+#include <dktools-4/dk4rec11.h>
+#endif
#endif
#ifndef DK4REC12_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec12.h"
+#else
+#include <dktools-4/dk4rec12.h>
+#endif
#endif
#ifndef DK4REC13_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec13.h"
+#else
+#include <dktools-4/dk4rec13.h>
+#endif
#endif
#ifndef DK4REC14_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec14.h"
+#else
+#include <dktools-4/dk4rec14.h>
+#endif
#endif
#ifndef DK4REC15_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec15.h"
+#else
+#include <dktools-4/dk4rec15.h>
+#endif
#endif
#ifndef DK4REC16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec16.h"
+#else
+#include <dktools-4/dk4rec16.h>
+#endif
#endif
#ifndef DK4REC17_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec17.h"
+#else
+#include <dktools-4/dk4rec17.h>
+#endif
#endif
#ifndef DK4REC18_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec18.h"
+#else
+#include <dktools-4/dk4rec18.h>
+#endif
#endif
#ifndef DK4REC19_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec19.h"
+#else
+#include <dktools-4/dk4rec19.h>
+#endif
#endif
#ifndef DK4REC20_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec20.h"
+#else
+#include <dktools-4/dk4rec20.h>
+#endif
#endif
#ifndef DK4REC21_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec21.h"
+#else
+#include <dktools-4/dk4rec21.h>
+#endif
#endif
#ifndef DK4REC22_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec22.h"
+#else
+#include <dktools-4/dk4rec22.h>
+#endif
#endif
#ifndef DK4REC23_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec23.h"
+#else
+#include <dktools-4/dk4rec23.h>
+#endif
#endif
#ifndef DK4REC24_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec24.h"
+#else
+#include <dktools-4/dk4rec24.h>
+#endif
#endif
#ifndef DK4REC25_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4rec25.h"
+#else
+#include <dktools-4/dk4rec25.h>
+#endif
+#endif
+#ifndef DK4REC26_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4rec26.h"
+#else
+#include <dktools-4/dk4rec26.h>
+#endif
+#endif
+#ifndef DK4REC27_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4rec27.h"
+#else
+#include <dktools-4/dk4rec27.h>
+#endif
#endif
#endif
diff --git a/support/dktools/dk4rec01.c b/support/dktools/dk4rec01.c
index eff5a53e46..c4da72df12 100644
--- a/support/dktools/dk4rec01.c
+++ b/support/dktools/dk4rec01.c
@@ -1,47 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec01.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec01.ctr
*/
/** @file dk4rec01.c The dk4rec01 module.
*/
-#line 58 "dk4rec01.ctr"
+#line 70 "dk4rec01.ctr"
+#include "dk4conf.h"
#include "dk4rec01.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -53,6 +38,11 @@ dk4recode_ascii_to_ansi(
dk4_c32_t c32 = dkC32(0);
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while(('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec01.ctr b/support/dktools/dk4rec01.ctr
index 32ffcbd6cc..fc223ca80e 100644
--- a/support/dktools/dk4rec01.ctr
+++ b/support/dktools/dk4rec01.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,9 +68,16 @@ dk4recode_ascii_to_ansi(
%% module
+#include "dk4conf.h"
#include "dk4rec01.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,6 +89,11 @@ dk4recode_ascii_to_ansi(
dk4_c32_t c32 = dkC32(0);
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while(('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec01.h b/support/dktools/dk4rec01.h
index ef53993c98..b2edd09c9a 100644
--- a/support/dktools/dk4rec01.h
+++ b/support/dktools/dk4rec01.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec01.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec01.ctr
*/
#ifndef DK4REC01_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec02.c b/support/dktools/dk4rec02.c
index 41cd126f06..d1db62a07b 100644
--- a/support/dktools/dk4rec02.c
+++ b/support/dktools/dk4rec02.c
@@ -1,47 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec02.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec02.ctr
*/
/** @file dk4rec02.c The dk4rec02 module.
*/
-#line 58 "dk4rec02.ctr"
+#line 70 "dk4rec02.ctr"
+#include "dk4conf.h"
#include "dk4rec02.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_ansi_to_ascii(
char *dstb, size_t szdstb, const char *src, dk4_er_t *erp
@@ -51,6 +38,11 @@ dk4recode_ansi_to_ascii(
dk4_c32_t c32 = dkC32(0);
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while (('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec02.ctr b/support/dktools/dk4rec02.ctr
index bc2ecfad92..eb2bc6c847 100644
--- a/support/dktools/dk4rec02.ctr
+++ b/support/dktools/dk4rec02.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,9 +68,18 @@ dk4recode_ansi_to_ascii(
%% module
+#include "dk4conf.h"
#include "dk4rec02.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_ansi_to_ascii(
char *dstb, size_t szdstb, const char *src, dk4_er_t *erp
@@ -68,6 +89,11 @@ dk4recode_ansi_to_ascii(
dk4_c32_t c32 = dkC32(0);
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while (('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec02.h b/support/dktools/dk4rec02.h
index 46fcc0446e..b2335ca5f4 100644
--- a/support/dktools/dk4rec02.h
+++ b/support/dktools/dk4rec02.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec02.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec02.ctr
*/
#ifndef DK4REC02_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec03.c b/support/dktools/dk4rec03.c
index 124fb4e4d7..67c7bbd385 100644
--- a/support/dktools/dk4rec03.c
+++ b/support/dktools/dk4rec03.c
@@ -1,48 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec03.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec03.ctr
*/
/** @file dk4rec03.c The dk4rec03 module.
*/
-#line 75 "dk4rec03.ctr"
+#line 87 "dk4rec03.ctr"
+#include "dk4conf.h"
#include "dk4rec03.h"
#include "dk4mem.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
size_t
@@ -54,7 +40,9 @@ dk4recode_size_ascii_to_utf8(const char *src, dk4_er_t *erp)
size_t rdb = 0; /* Number of bytes read from input */
size_t back = 0; /* Function result */
unsigned char uc; /* Currenct character */
-
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
dk4error_init(&er);
while ('\0' != *src) {
@@ -97,7 +85,11 @@ dk4recode_ascii_to_utf8(
size_t used = 0;
int back = 0;
unsigned char uc = '\0';
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while(('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec03.ctr b/support/dktools/dk4rec03.ctr
index 6b89a2232f..4c6edbc8fe 100644
--- a/support/dktools/dk4rec03.ctr
+++ b/support/dktools/dk4rec03.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -73,10 +85,18 @@ dk4recode_size_ascii_to_utf8(const char *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4rec03.h"
#include "dk4mem.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
size_t
@@ -88,7 +108,9 @@ dk4recode_size_ascii_to_utf8(const char *src, dk4_er_t *erp)
size_t rdb = 0; /* Number of bytes read from input */
size_t back = 0; /* Function result */
unsigned char uc; /* Currenct character */
-
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
dk4error_init(&er);
while ('\0' != *src) {
@@ -131,7 +153,11 @@ dk4recode_ascii_to_utf8(
size_t used = 0;
int back = 0;
unsigned char uc = '\0';
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while(('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec03.h b/support/dktools/dk4rec03.h
index 8a071dabad..ea58403a70 100644
--- a/support/dktools/dk4rec03.h
+++ b/support/dktools/dk4rec03.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec03.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec03.ctr
*/
#ifndef DK4REC03_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec04.c b/support/dktools/dk4rec04.c
index 6ee79d1b8d..b6c9c93e24 100644
--- a/support/dktools/dk4rec04.c
+++ b/support/dktools/dk4rec04.c
@@ -1,47 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec04.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec04.ctr
*/
/** @file dk4rec04.c The dk4rec04 module.
*/
-#line 75 "dk4rec04.ctr"
+#line 87 "dk4rec04.ctr"
+#include "dk4conf.h"
#include "dk4rec04.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
size_t
dk4recode_size_utf8_to_ascii(const char *src, dk4_er_t *erp)
{
@@ -50,6 +37,9 @@ dk4recode_size_utf8_to_ascii(const char *src, dk4_er_t *erp)
size_t rdb = 0;
size_t back = 0;
dk4_c32_t c32;
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
/* Initialize data structures.
*/
@@ -113,6 +103,11 @@ dk4recode_utf8_to_ascii(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf8_init(&dec);
diff --git a/support/dktools/dk4rec04.ctr b/support/dktools/dk4rec04.ctr
index c9c87442e7..1110ae1e3e 100644
--- a/support/dktools/dk4rec04.ctr
+++ b/support/dktools/dk4rec04.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -73,9 +85,18 @@ dk4recode_size_utf8_to_ascii(const char *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4rec04.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
size_t
dk4recode_size_utf8_to_ascii(const char *src, dk4_er_t *erp)
{
@@ -84,6 +105,9 @@ dk4recode_size_utf8_to_ascii(const char *src, dk4_er_t *erp)
size_t rdb = 0;
size_t back = 0;
dk4_c32_t c32;
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
/* Initialize data structures.
*/
@@ -147,6 +171,11 @@ dk4recode_utf8_to_ascii(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf8_init(&dec);
diff --git a/support/dktools/dk4rec04.h b/support/dktools/dk4rec04.h
index bb996c62b3..9e576d10ed 100644
--- a/support/dktools/dk4rec04.h
+++ b/support/dktools/dk4rec04.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec04.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec04.ctr
*/
#ifndef DK4REC04_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec05.c b/support/dktools/dk4rec05.c
index 0788feedd6..70672c1e77 100644
--- a/support/dktools/dk4rec05.c
+++ b/support/dktools/dk4rec05.c
@@ -1,49 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec05.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec05.ctr
*/
/** @file dk4rec05.c The dk4rec05 module.
*/
-#line 76 "dk4rec05.ctr"
+#line 88 "dk4rec05.ctr"
+#include "dk4conf.h"
#include "dk4rec05.h"
#include "dk4mem.h"
#include "dk4ansi.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
size_t
@@ -57,6 +42,9 @@ dk4recode_size_ansi_to_utf8(const char *src, dk4_er_t *erp)
dk4_c32_t c32; /* Current 32 bit character */
unsigned char uc; /* Current source character */
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
dk4error_init(&er);
while ('\0' != *src) {
@@ -104,6 +92,11 @@ dk4recode_ansi_to_utf8(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while (('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec05.ctr b/support/dktools/dk4rec05.ctr
index e20aff795b..5678f977bd 100644
--- a/support/dktools/dk4rec05.ctr
+++ b/support/dktools/dk4rec05.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -74,11 +86,18 @@ dk4recode_size_ansi_to_utf8(const char *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4rec05.h"
#include "dk4mem.h"
#include "dk4ansi.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
size_t
@@ -92,6 +111,9 @@ dk4recode_size_ansi_to_utf8(const char *src, dk4_er_t *erp)
dk4_c32_t c32; /* Current 32 bit character */
unsigned char uc; /* Current source character */
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
dk4error_init(&er);
while ('\0' != *src) {
@@ -139,6 +161,11 @@ dk4recode_ansi_to_utf8(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while (('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec05.h b/support/dktools/dk4rec05.h
index ce25c3cf4d..3f0867c3b0 100644
--- a/support/dktools/dk4rec05.h
+++ b/support/dktools/dk4rec05.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec05.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec05.ctr
*/
#ifndef DK4REC05_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec06.c b/support/dktools/dk4rec06.c
index 096305fc1c..05ff237b60 100644
--- a/support/dktools/dk4rec06.c
+++ b/support/dktools/dk4rec06.c
@@ -1,49 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec06.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec06.ctr
*/
/** @file dk4rec06.c The dk4rec06 module.
*/
-#line 77 "dk4rec06.ctr"
+#line 89 "dk4rec06.ctr"
+#include "dk4conf.h"
#include "dk4rec06.h"
#include "dk4utf8.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
size_t
dk4recode_size_utf8_to_ansi(const char *src, dk4_er_t *erp)
{
@@ -54,6 +41,9 @@ dk4recode_size_utf8_to_ansi(const char *src, dk4_er_t *erp)
dk4_c32_t c32;
unsigned char uc;
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
/* Initialize data structures.
*/
@@ -118,6 +108,11 @@ dk4recode_utf8_to_ansi(
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf8_init(&dec);
diff --git a/support/dktools/dk4rec06.ctr b/support/dktools/dk4rec06.ctr
index c5188a2ed3..73c6b7e7bf 100644
--- a/support/dktools/dk4rec06.ctr
+++ b/support/dktools/dk4rec06.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -76,10 +88,19 @@ dk4recode_size_utf8_to_ansi(const char *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4rec06.h"
#include "dk4utf8.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
size_t
dk4recode_size_utf8_to_ansi(const char *src, dk4_er_t *erp)
{
@@ -90,6 +111,9 @@ dk4recode_size_utf8_to_ansi(const char *src, dk4_er_t *erp)
dk4_c32_t c32;
unsigned char uc;
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
/* Initialize data structures.
*/
@@ -154,6 +178,11 @@ dk4recode_utf8_to_ansi(
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf8_init(&dec);
diff --git a/support/dktools/dk4rec06.h b/support/dktools/dk4rec06.h
index 3449032892..b143097a31 100644
--- a/support/dktools/dk4rec06.h
+++ b/support/dktools/dk4rec06.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec06.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec06.ctr
*/
#ifndef DK4REC06_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec07.c b/support/dktools/dk4rec07.c
index a76c39d8f8..06a447547f 100644
--- a/support/dktools/dk4rec07.c
+++ b/support/dktools/dk4rec07.c
@@ -1,48 +1,35 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec07.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec07.ctr
*/
/** @file dk4rec07.c The dk4rec07 module.
*/
-#line 59 "dk4rec07.ctr"
+#line 71 "dk4rec07.ctr"
+#include "dk4conf.h"
#include "dk4rec07.h"
#include "dk4mem.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_ascii_to_utf16(
dk4_c16_t *dstb, size_t szdstb, const char *src, dk4_er_t *erp
@@ -54,6 +41,11 @@ dk4recode_ascii_to_utf16(
size_t rdb = 0;
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while(('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec07.ctr b/support/dktools/dk4rec07.ctr
index 440810dc83..3b09d5b3f0 100644
--- a/support/dktools/dk4rec07.ctr
+++ b/support/dktools/dk4rec07.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -57,10 +69,19 @@ dk4recode_ascii_to_utf16(
%% module
+#include "dk4conf.h"
#include "dk4rec07.h"
#include "dk4mem.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_ascii_to_utf16(
dk4_c16_t *dstb, size_t szdstb, const char *src, dk4_er_t *erp
@@ -72,6 +93,11 @@ dk4recode_ascii_to_utf16(
size_t rdb = 0;
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while(('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec07.h b/support/dktools/dk4rec07.h
index a9900b4bf6..cf3afbfddc 100644
--- a/support/dktools/dk4rec07.h
+++ b/support/dktools/dk4rec07.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec07.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec07.ctr
*/
#ifndef DK4REC07_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec08.c b/support/dktools/dk4rec08.c
index a713a93323..80909f2fa7 100644
--- a/support/dktools/dk4rec08.c
+++ b/support/dktools/dk4rec08.c
@@ -1,48 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec08.ctr
*/
/** @file dk4rec08.c The dk4rec08 module.
*/
-#line 59 "dk4rec08.ctr"
+#line 71 "dk4rec08.ctr"
+#include "dk4conf.h"
#include "dk4rec08.h"
#include "dk4mem.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -56,6 +41,11 @@ dk4recode_utf16_to_ascii(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf16_init(&dec);
diff --git a/support/dktools/dk4rec08.ctr b/support/dktools/dk4rec08.ctr
index fdc22729e7..ceec6fa098 100644
--- a/support/dktools/dk4rec08.ctr
+++ b/support/dktools/dk4rec08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -57,10 +69,17 @@ dk4recode_utf16_to_ascii(
%% module
+#include "dk4conf.h"
#include "dk4rec08.h"
#include "dk4mem.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -74,6 +93,11 @@ dk4recode_utf16_to_ascii(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf16_init(&dec);
diff --git a/support/dktools/dk4rec08.h b/support/dktools/dk4rec08.h
index aae058398c..ad2496e789 100644
--- a/support/dktools/dk4rec08.h
+++ b/support/dktools/dk4rec08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec08.ctr
*/
#ifndef DK4REC08_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec09.c b/support/dktools/dk4rec09.c
index c7eaa136c6..0947401efd 100644
--- a/support/dktools/dk4rec09.c
+++ b/support/dktools/dk4rec09.c
@@ -1,49 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec09.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec09.ctr
*/
/** @file dk4rec09.c The dk4rec09 module.
*/
-#line 59 "dk4rec09.ctr"
+#line 71 "dk4rec09.ctr"
+#include "dk4conf.h"
#include "dk4rec09.h"
#include "dk4mem.h"
#include "dk4ansi.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -58,6 +43,11 @@ dk4recode_ansi_to_utf16(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while(((dk4_c16_t)0U != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec09.ctr b/support/dktools/dk4rec09.ctr
index 71bf4e3e4e..83256a79e6 100644
--- a/support/dktools/dk4rec09.ctr
+++ b/support/dktools/dk4rec09.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -57,11 +69,18 @@ dk4recode_ansi_to_utf16(
%% module
+#include "dk4conf.h"
#include "dk4rec09.h"
#include "dk4mem.h"
#include "dk4ansi.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -76,6 +95,11 @@ dk4recode_ansi_to_utf16(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while(((dk4_c16_t)0U != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec09.h b/support/dktools/dk4rec09.h
index 8c806e91c4..dbf731bc94 100644
--- a/support/dktools/dk4rec09.h
+++ b/support/dktools/dk4rec09.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec09.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec09.ctr
*/
#ifndef DK4REC09_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec10.c b/support/dktools/dk4rec10.c
index fd20c964d6..888c22f6a6 100644
--- a/support/dktools/dk4rec10.c
+++ b/support/dktools/dk4rec10.c
@@ -1,49 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec10.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec10.ctr
*/
/** @file dk4rec10.c The dk4rec10 module.
*/
-#line 59 "dk4rec10.ctr"
+#line 71 "dk4rec10.ctr"
+#include "dk4conf.h"
#include "dk4rec10.h"
#include "dk4mem.h"
#include "dk4ansi.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -58,6 +43,11 @@ dk4recode_utf16_to_ansi(
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf16_init(&dec);
diff --git a/support/dktools/dk4rec10.ctr b/support/dktools/dk4rec10.ctr
index 869ef2262b..290dac782c 100644
--- a/support/dktools/dk4rec10.ctr
+++ b/support/dktools/dk4rec10.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -57,11 +69,18 @@ dk4recode_utf16_to_ansi(
%% module
+#include "dk4conf.h"
#include "dk4rec10.h"
#include "dk4mem.h"
#include "dk4ansi.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -76,6 +95,11 @@ dk4recode_utf16_to_ansi(
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf16_init(&dec);
diff --git a/support/dktools/dk4rec10.h b/support/dktools/dk4rec10.h
index a035c33125..7ac9108a5d 100644
--- a/support/dktools/dk4rec10.h
+++ b/support/dktools/dk4rec10.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec10.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec10.ctr
*/
#ifndef DK4REC10_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec11.c b/support/dktools/dk4rec11.c
index 138d58d453..a14d01cdd0 100644
--- a/support/dktools/dk4rec11.c
+++ b/support/dktools/dk4rec11.c
@@ -1,53 +1,39 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec11.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec11.ctr
*/
/** @file dk4rec11.c The dk4rec11 module.
*/
-#line 76 "dk4rec11.ctr"
+#line 88 "dk4rec11.ctr"
+#include "dk4conf.h"
#include "dk4rec11.h"
#include "dk4mem.h"
#include "dk4utf8.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 84 "dk4rec11.ctr"
+#line 104 "dk4rec11.ctr"
@@ -62,6 +48,9 @@ dk4recode_size_utf8_to_utf16(const char *src, dk4_er_t *erp)
size_t sz;
dk4_c32_t c32;
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
/* Initialize data structures.
*/
@@ -128,6 +117,11 @@ dk4recode_utf8_to_utf16(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf8_init(&dec);
diff --git a/support/dktools/dk4rec11.ctr b/support/dktools/dk4rec11.ctr
index 723d86b854..39dce4d331 100644
--- a/support/dktools/dk4rec11.ctr
+++ b/support/dktools/dk4rec11.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -74,11 +86,19 @@ dk4recode_size_utf8_to_utf16(const char *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4rec11.h"
#include "dk4mem.h"
#include "dk4utf8.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -95,6 +115,9 @@ dk4recode_size_utf8_to_utf16(const char *src, dk4_er_t *erp)
size_t sz;
dk4_c32_t c32;
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
/* Initialize data structures.
*/
@@ -161,6 +184,11 @@ dk4recode_utf8_to_utf16(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf8_init(&dec);
diff --git a/support/dktools/dk4rec11.h b/support/dktools/dk4rec11.h
index da927995bd..a7060ed4c5 100644
--- a/support/dktools/dk4rec11.h
+++ b/support/dktools/dk4rec11.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec11.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec11.ctr
*/
#ifndef DK4REC11_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec12.c b/support/dktools/dk4rec12.c
index 94ce3bb7e9..d58b6bb7e4 100644
--- a/support/dktools/dk4rec12.c
+++ b/support/dktools/dk4rec12.c
@@ -1,49 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec12.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec12.ctr
*/
/** @file dk4rec12.c The dk4rec12 module.
*/
-#line 75 "dk4rec12.ctr"
+#line 87 "dk4rec12.ctr"
+#include "dk4conf.h"
#include "dk4rec12.h"
#include "dk4mem.h"
#include "dk4utf8.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
size_t
@@ -56,6 +41,9 @@ dk4recode_size_utf16_to_utf8(const dk4_c16_t *src, dk4_er_t *erp)
size_t rd = 0;
size_t back = 0;
dk4_c32_t c32 = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
dk4error_init(&er);
dk4utf16_init(&dec);
@@ -112,6 +100,11 @@ dk4recode_utf16_to_utf8(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf16_init(&dec);
diff --git a/support/dktools/dk4rec12.ctr b/support/dktools/dk4rec12.ctr
index 2259b75a7e..dd4792b0a3 100644
--- a/support/dktools/dk4rec12.ctr
+++ b/support/dktools/dk4rec12.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -73,11 +85,18 @@ dk4recode_size_utf16_to_utf8(const dk4_c16_t *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4rec12.h"
#include "dk4mem.h"
#include "dk4utf8.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
size_t
@@ -90,6 +109,9 @@ dk4recode_size_utf16_to_utf8(const dk4_c16_t *src, dk4_er_t *erp)
size_t rd = 0;
size_t back = 0;
dk4_c32_t c32 = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
dk4error_init(&er);
dk4utf16_init(&dec);
@@ -146,6 +168,11 @@ dk4recode_utf16_to_utf8(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf16_init(&dec);
diff --git a/support/dktools/dk4rec12.h b/support/dktools/dk4rec12.h
index 72b1683473..0d3532ca45 100644
--- a/support/dktools/dk4rec12.h
+++ b/support/dktools/dk4rec12.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec12.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec12.ctr
*/
#ifndef DK4REC12_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec13.c b/support/dktools/dk4rec13.c
index ca5af35c6d..26195ec1ca 100644
--- a/support/dktools/dk4rec13.c
+++ b/support/dktools/dk4rec13.c
@@ -1,50 +1,35 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec13.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec13.ctr
*/
/** @file dk4rec13.c The dk4rec13 module.
*/
-#line 58 "dk4rec13.ctr"
+#line 70 "dk4rec13.ctr"
+#include "dk4conf.h"
#include "dk4rec13.h"
#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -53,7 +38,11 @@ dk4recode_ascii_to_c32(
)
{
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
if (szdstb > dk4str8_len(src)) {
while ('\0' != *src) {
diff --git a/support/dktools/dk4rec13.ctr b/support/dktools/dk4rec13.ctr
index 7cd8fe5451..9160076b56 100644
--- a/support/dktools/dk4rec13.ctr
+++ b/support/dktools/dk4rec13.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,12 +68,19 @@ dk4recode_ascii_to_c32(
%% module
+#include "dk4conf.h"
#include "dk4rec13.h"
#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -70,7 +89,11 @@ dk4recode_ascii_to_c32(
)
{
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
if (szdstb > dk4str8_len(src)) {
while ('\0' != *src) {
diff --git a/support/dktools/dk4rec13.h b/support/dktools/dk4rec13.h
index 31464c92ab..3e3b894392 100644
--- a/support/dktools/dk4rec13.h
+++ b/support/dktools/dk4rec13.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec13.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec13.ctr
*/
#ifndef DK4REC13_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec14.c b/support/dktools/dk4rec14.c
index 900f80486c..e643579144 100644
--- a/support/dktools/dk4rec14.c
+++ b/support/dktools/dk4rec14.c
@@ -1,46 +1,33 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec14.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec14.ctr
*/
/** @file dk4rec14.c The dk4rec14 module.
*/
-#line 58 "dk4rec14.ctr"
+#line 70 "dk4rec14.ctr"
+#include "dk4conf.h"
#include "dk4rec14.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_c32_to_ascii(
@@ -51,7 +38,11 @@ dk4recode_c32_to_ascii(
size_t used = 0;
dk4_c32_t c32 = dkC32(0);
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while((dkC32(0) != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec14.ctr b/support/dktools/dk4rec14.ctr
index 685b63f555..5a2e92d638 100644
--- a/support/dktools/dk4rec14.ctr
+++ b/support/dktools/dk4rec14.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,8 +68,17 @@ dk4recode_c32_to_ascii(
%% module
+#include "dk4conf.h"
#include "dk4rec14.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_c32_to_ascii(
@@ -68,7 +89,11 @@ dk4recode_c32_to_ascii(
size_t used = 0;
dk4_c32_t c32 = dkC32(0);
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while((dkC32(0) != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec14.h b/support/dktools/dk4rec14.h
index 9e21f42a94..ca8c42ba48 100644
--- a/support/dktools/dk4rec14.h
+++ b/support/dktools/dk4rec14.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec14.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec14.ctr
*/
#ifndef DK4REC14_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec15.c b/support/dktools/dk4rec15.c
index 5da7a5dc1c..896360f948 100644
--- a/support/dktools/dk4rec15.c
+++ b/support/dktools/dk4rec15.c
@@ -1,47 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec15.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec15.ctr
*/
/** @file dk4rec15.c The dk4rec15 module.
*/
-#line 59 "dk4rec15.ctr"
+#line 71 "dk4rec15.ctr"
+#include "dk4conf.h"
#include "dk4rec15.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -53,7 +38,11 @@ dk4recode_ansi_to_c32(
size_t rdb = 0;
dk4_c32_t c32 = dkC32(0);
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while (('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec15.ctr b/support/dktools/dk4rec15.ctr
index eb1e48bacb..0d840bcc8f 100644
--- a/support/dktools/dk4rec15.ctr
+++ b/support/dktools/dk4rec15.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -57,9 +69,16 @@ dk4recode_ansi_to_c32(
%% module
+#include "dk4conf.h"
#include "dk4rec15.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -71,7 +90,11 @@ dk4recode_ansi_to_c32(
size_t rdb = 0;
dk4_c32_t c32 = dkC32(0);
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while (('\0' != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec15.h b/support/dktools/dk4rec15.h
index 691d31f2ee..c4829236bc 100644
--- a/support/dktools/dk4rec15.h
+++ b/support/dktools/dk4rec15.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec15.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec15.ctr
*/
#ifndef DK4REC15_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec16.c b/support/dktools/dk4rec16.c
index bc9ebd4a09..76667ea427 100644
--- a/support/dktools/dk4rec16.c
+++ b/support/dktools/dk4rec16.c
@@ -1,47 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec16.ctr
*/
/** @file dk4rec16.c The dk4rec16 module.
*/
-#line 58 "dk4rec16.ctr"
+#line 70 "dk4rec16.ctr"
+#include "dk4conf.h"
#include "dk4rec16.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_c32_to_ansi(
char *dstb, size_t szdstb, const dk4_c32_t *src, dk4_er_t *erp
@@ -53,6 +40,11 @@ dk4recode_c32_to_ansi(
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while((dkC32(0) != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec16.ctr b/support/dktools/dk4rec16.ctr
index d44d9bcbe2..ae4d08cc46 100644
--- a/support/dktools/dk4rec16.ctr
+++ b/support/dktools/dk4rec16.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,9 +68,18 @@ dk4recode_c32_to_ansi(
%% module
+#include "dk4conf.h"
#include "dk4rec16.h"
#include "dk4ansi.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_c32_to_ansi(
char *dstb, size_t szdstb, const dk4_c32_t *src, dk4_er_t *erp
@@ -70,6 +91,11 @@ dk4recode_c32_to_ansi(
int back = 0;
unsigned char uc = '\0';
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while((dkC32(0) != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec16.h b/support/dktools/dk4rec16.h
index 1571e11047..737e504fe7 100644
--- a/support/dktools/dk4rec16.h
+++ b/support/dktools/dk4rec16.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec16.ctr
*/
#ifndef DK4REC16_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec17.c b/support/dktools/dk4rec17.c
index cb4585c3dd..706d5960b5 100644
--- a/support/dktools/dk4rec17.c
+++ b/support/dktools/dk4rec17.c
@@ -1,51 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec17.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec17.ctr
*/
/** @file dk4rec17.c The dk4rec17 module.
*/
-#line 76 "dk4rec17.ctr"
+#line 88 "dk4rec17.ctr"
+#include "dk4conf.h"
#include "dk4rec17.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 82 "dk4rec17.ctr"
+#line 101 "dk4rec17.ctr"
size_t
@@ -55,7 +40,9 @@ dk4recode_size_utf8_to_c32(const char *src, dk4_er_t *erp)
dk4_utf8_decoder_t dec;
size_t rdb = 0;
size_t back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
/* Initialize data structures.
*/
@@ -102,6 +89,8 @@ dk4recode_size_utf8_to_c32(const char *src, dk4_er_t *erp)
return back;
}
+
+
int
dk4recode_utf8_to_c32(
dk4_c32_t *dstb, size_t szdstb, const char *src, dk4_er_t *erp
@@ -113,6 +102,11 @@ dk4recode_utf8_to_c32(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf8_init(&dec);
diff --git a/support/dktools/dk4rec17.ctr b/support/dktools/dk4rec17.ctr
index f9b79e062f..553977beb0 100644
--- a/support/dktools/dk4rec17.ctr
+++ b/support/dktools/dk4rec17.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -74,9 +86,16 @@ dk4recode_size_utf8_to_c32(const char *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4rec17.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -88,7 +107,9 @@ dk4recode_size_utf8_to_c32(const char *src, dk4_er_t *erp)
dk4_utf8_decoder_t dec;
size_t rdb = 0;
size_t back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
/* Initialize data structures.
*/
@@ -135,6 +156,8 @@ dk4recode_size_utf8_to_c32(const char *src, dk4_er_t *erp)
return back;
}
+
+
int
dk4recode_utf8_to_c32(
dk4_c32_t *dstb, size_t szdstb, const char *src, dk4_er_t *erp
@@ -146,6 +169,11 @@ dk4recode_utf8_to_c32(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf8_init(&dec);
diff --git a/support/dktools/dk4rec17.h b/support/dktools/dk4rec17.h
index 53e4888a16..62872c2202 100644
--- a/support/dktools/dk4rec17.h
+++ b/support/dktools/dk4rec17.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec17.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec17.ctr
*/
#ifndef DK4REC17_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec18.c b/support/dktools/dk4rec18.c
index 012ad98404..25acbaf8d9 100644
--- a/support/dktools/dk4rec18.c
+++ b/support/dktools/dk4rec18.c
@@ -1,53 +1,38 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec18.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec18.ctr
*/
/** @file dk4rec18.c The dk4rec18 module.
*/
-#line 74 "dk4rec18.ctr"
+#line 86 "dk4rec18.ctr"
+#include "dk4conf.h"
#include "dk4rec18.h"
#include "dk4mem.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 82 "dk4rec18.ctr"
+#line 101 "dk4rec18.ctr"
@@ -60,7 +45,9 @@ dk4recode_size_c32_to_utf8(const dk4_c32_t *src, dk4_er_t *erp)
size_t rd = 0;
size_t back = 0;
dk4_c32_t c32 = dkC32(0);
-
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
dk4error_init(&er);
while (dkC32(0) != (c32 = *(src++))) {
@@ -102,7 +89,11 @@ dk4recode_c32_to_utf8(
size_t used = 0;
dk4_c32_t c32 = dkC32(0);
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while((dkC32(0) != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec18.ctr b/support/dktools/dk4rec18.ctr
index 2f3bc777ab..c20d2c4f03 100644
--- a/support/dktools/dk4rec18.ctr
+++ b/support/dktools/dk4rec18.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -72,10 +84,17 @@ dk4recode_size_c32_to_utf8(const dk4_c32_t *src, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4rec18.h"
#include "dk4mem.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -91,7 +110,9 @@ dk4recode_size_c32_to_utf8(const dk4_c32_t *src, dk4_er_t *erp)
size_t rd = 0;
size_t back = 0;
dk4_c32_t c32 = dkC32(0);
-
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
dk4error_init(&er);
while (dkC32(0) != (c32 = *(src++))) {
@@ -133,7 +154,11 @@ dk4recode_c32_to_utf8(
size_t used = 0;
dk4_c32_t c32 = dkC32(0);
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while((dkC32(0) != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec18.h b/support/dktools/dk4rec18.h
index cf1095420b..5f4a900459 100644
--- a/support/dktools/dk4rec18.h
+++ b/support/dktools/dk4rec18.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec18.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec18.ctr
*/
#ifndef DK4REC18_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec19.c b/support/dktools/dk4rec19.c
index 2791812282..be3992ddac 100644
--- a/support/dktools/dk4rec19.c
+++ b/support/dktools/dk4rec19.c
@@ -1,47 +1,32 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec19.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec19.ctr
*/
/** @file dk4rec19.c The dk4rec19 module.
*/
-#line 59 "dk4rec19.ctr"
+#line 71 "dk4rec19.ctr"
+#include "dk4conf.h"
#include "dk4rec19.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -55,6 +40,11 @@ dk4recode_utf16_to_c32(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf16_init(&dec);
diff --git a/support/dktools/dk4rec19.ctr b/support/dktools/dk4rec19.ctr
index d476e1f1c7..a238722af0 100644
--- a/support/dktools/dk4rec19.ctr
+++ b/support/dktools/dk4rec19.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -57,9 +69,16 @@ dk4recode_utf16_to_c32(
%% module
+#include "dk4conf.h"
#include "dk4rec19.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -73,6 +92,11 @@ dk4recode_utf16_to_c32(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
dk4utf16_init(&dec);
diff --git a/support/dktools/dk4rec19.h b/support/dktools/dk4rec19.h
index 117df9af28..7979041d47 100644
--- a/support/dktools/dk4rec19.h
+++ b/support/dktools/dk4rec19.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec19.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec19.ctr
*/
#ifndef DK4REC19_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec20.c b/support/dktools/dk4rec20.c
index e2ad3e3da9..dd53133314 100644
--- a/support/dktools/dk4rec20.c
+++ b/support/dktools/dk4rec20.c
@@ -1,48 +1,35 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec20.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec20.ctr
*/
/** @file dk4rec20.c The dk4rec20 module.
*/
-#line 58 "dk4rec20.ctr"
+#line 70 "dk4rec20.ctr"
+#include "dk4conf.h"
#include "dk4rec20.h"
#include "dk4mem.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_c32_to_utf16(
dk4_c16_t *dstb, size_t szdstb, const dk4_c32_t *src, dk4_er_t *erp
@@ -55,6 +42,11 @@ dk4recode_c32_to_utf16(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while((dkC32(0) != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec20.ctr b/support/dktools/dk4rec20.ctr
index 217bcc1322..a36c8cf490 100644
--- a/support/dktools/dk4rec20.ctr
+++ b/support/dktools/dk4rec20.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -56,10 +68,19 @@ dk4recode_c32_to_utf16(
%% module
+#include "dk4conf.h"
#include "dk4rec20.h"
#include "dk4mem.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4recode_c32_to_utf16(
dk4_c16_t *dstb, size_t szdstb, const dk4_c32_t *src, dk4_er_t *erp
@@ -72,6 +93,11 @@ dk4recode_c32_to_utf16(
dk4_c32_t c32 = dkC32(0);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
back = 1;
while((dkC32(0) != *src) && (1 == back) && (used < szdstb)) {
diff --git a/support/dktools/dk4rec20.h b/support/dktools/dk4rec20.h
index b92ebd791e..c6b34f18a4 100644
--- a/support/dktools/dk4rec20.h
+++ b/support/dktools/dk4rec20.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec20.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec20.ctr
*/
#ifndef DK4REC20_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec21.c b/support/dktools/dk4rec21.c
index e339ca31be..2585f715f1 100644
--- a/support/dktools/dk4rec21.c
+++ b/support/dktools/dk4rec21.c
@@ -1,43 +1,27 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec21.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec21.ctr
*/
/** @file dk4rec21.c The dk4rec21 module.
*/
-#line 67 "dk4rec21.ctr"
+#line 79 "dk4rec21.ctr"
+
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
#include "dk4enc.h"
#include "dk4rec21.h"
@@ -46,17 +30,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4rec07.h"
#include "dk4rec13.h"
#include "dk4str8.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4100 )
+#endif
+
int
dk4recode_ascii_to_dk(
- dkChar *dstb, size_t szdstb, int enc, const char *src, dk4_er_t *erp
+ dkChar *dstb,
+ size_t szdstb,
+#if DK4_CHAR_SIZE > 1
+ int DK4_ARG_UNUSED(enc),
+#else
+ int enc,
+#endif
+ const char *src,
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(enc)
#if DK4_CHAR_SIZE > 2
back = dk4recode_ascii_to_c32(dstb, szdstb, src, erp);
#else
@@ -67,7 +77,7 @@ dk4recode_ascii_to_dk(
case DK4_ENCODING_UTF8: {
back = dk4recode_ascii_to_utf8(dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI: {
+ case DK4_ENCODING_WIN1252: {
back = dk4recode_ascii_to_ansi(dstb, szdstb, src, erp);
} break;
default: {
@@ -81,4 +91,7 @@ dk4recode_ascii_to_dk(
return back;
}
+#if _WIN32 && defined(_MSC_VER) && (_MSC_VER >= 1700)
+#pragma warning( pop )
+#endif
diff --git a/support/dktools/dk4rec21.ctr b/support/dktools/dk4rec21.ctr
index 4fb10bde84..4abb44e62b 100644
--- a/support/dktools/dk4rec21.ctr
+++ b/support/dktools/dk4rec21.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -17,15 +17,27 @@ license = bsd
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -65,6 +77,12 @@ dk4recode_ascii_to_dk(
%% module
+#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
#include "dk4enc.h"
#include "dk4rec21.h"
#include "dk4rec01.h"
@@ -72,17 +90,43 @@ dk4recode_ascii_to_dk(
#include "dk4rec07.h"
#include "dk4rec13.h"
#include "dk4str8.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4100 )
+#endif
+
int
dk4recode_ascii_to_dk(
- dkChar *dstb, size_t szdstb, int enc, const char *src, dk4_er_t *erp
+ dkChar *dstb,
+ size_t szdstb,
+#if DK4_CHAR_SIZE > 1
+ int DK4_ARG_UNUSED(enc),
+#else
+ int enc,
+#endif
+ const char *src,
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (0 < szdstb) && (NULL != src)) {
#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(enc)
#if DK4_CHAR_SIZE > 2
back = dk4recode_ascii_to_c32(dstb, szdstb, src, erp);
#else
@@ -93,7 +137,7 @@ dk4recode_ascii_to_dk(
case DK4_ENCODING_UTF8: {
back = dk4recode_ascii_to_utf8(dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI: {
+ case DK4_ENCODING_WIN1252: {
back = dk4recode_ascii_to_ansi(dstb, szdstb, src, erp);
} break;
default: {
@@ -107,4 +151,7 @@ dk4recode_ascii_to_dk(
return back;
}
+#if _WIN32 && defined(_MSC_VER) && (_MSC_VER >= 1700)
+#pragma warning( pop )
+#endif
diff --git a/support/dktools/dk4rec21.h b/support/dktools/dk4rec21.h
index eb57aaf125..4c4313eb36 100644
--- a/support/dktools/dk4rec21.h
+++ b/support/dktools/dk4rec21.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec21.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec21.ctr
*/
#ifndef DK4REC21_H_INCLUDED
@@ -49,15 +27,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4rec22.c b/support/dktools/dk4rec22.c
index 4a58644268..e362cfea9f 100644
--- a/support/dktools/dk4rec22.c
+++ b/support/dktools/dk4rec22.c
@@ -1,55 +1,40 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec22.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec22.ctr
*/
/** @file dk4rec22.c The dk4rec22 module.
*/
-#line 60 "dk4rec22.ctr"
+#line 72 "dk4rec22.ctr"
+#include "dk4conf.h"
#include "dk4rec22.h"
#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 70 "dk4rec22.ctr"
+#line 89 "dk4rec22.ctr"
@@ -59,6 +44,11 @@ dk4recode_char_to_dk(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
if (dk4str8_len(src) < szdstb) {
while ('\0' != *src) {
diff --git a/support/dktools/dk4rec22.ctr b/support/dktools/dk4rec22.ctr
index b4657abe09..29267ab993 100644
--- a/support/dktools/dk4rec22.ctr
+++ b/support/dktools/dk4rec22.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -58,12 +70,19 @@ dk4recode_char_to_dk(
%% module
+#include "dk4conf.h"
#include "dk4rec22.h"
#ifndef DK4STR8_H_INCLUDED
#include "dk4str8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -76,6 +95,11 @@ dk4recode_char_to_dk(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
if (dk4str8_len(src) < szdstb) {
while ('\0' != *src) {
diff --git a/support/dktools/dk4rec22.h b/support/dktools/dk4rec22.h
index 28f89baba1..53168f6d10 100644
--- a/support/dktools/dk4rec22.h
+++ b/support/dktools/dk4rec22.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec22.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec22.ctr
*/
#ifndef DK4REC22_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec23.c b/support/dktools/dk4rec23.c
index 6c60f2c84d..719b148f25 100644
--- a/support/dktools/dk4rec23.c
+++ b/support/dktools/dk4rec23.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec23.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec23.ctr
*/
/** @file dk4rec23.c The dk4rec23 module.
*/
-#line 60 "dk4rec23.ctr"
+#line 72 "dk4rec23.ctr"
+#include "dk4conf.h"
#include "dk4rec23.h"
#include "dk4str8.h"
@@ -49,11 +28,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 74 "dk4rec23.ctr"
+#line 93 "dk4rec23.ctr"
int
@@ -62,6 +47,11 @@ dk4recode_char_to_wchar_t(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
*dstb = L'\0';
if (dk4str8_len(src) < szdstb) {
diff --git a/support/dktools/dk4rec23.ctr b/support/dktools/dk4rec23.ctr
index ffaa17c08f..31e41c6aaa 100644
--- a/support/dktools/dk4rec23.ctr
+++ b/support/dktools/dk4rec23.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -58,6 +70,7 @@ dk4recode_char_to_wchar_t(
%% module
+#include "dk4conf.h"
#include "dk4rec23.h"
#include "dk4str8.h"
@@ -68,6 +81,12 @@ dk4recode_char_to_wchar_t(
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -79,6 +98,11 @@ dk4recode_char_to_wchar_t(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
*dstb = L'\0';
if (dk4str8_len(src) < szdstb) {
diff --git a/support/dktools/dk4rec23.h b/support/dktools/dk4rec23.h
index 4ffff926b6..2bb53b435d 100644
--- a/support/dktools/dk4rec23.h
+++ b/support/dktools/dk4rec23.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec23.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec23.ctr
*/
#ifndef DK4REC23_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec24.c b/support/dktools/dk4rec24.c
index 14007e448d..d5f979f895 100644
--- a/support/dktools/dk4rec24.c
+++ b/support/dktools/dk4rec24.c
@@ -1,45 +1,36 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk4rec24.ctr
*/
-/*
-Copyright (C) 2015-2017, Dirk Krause
+/** @file dk4rec24.c The dk4rec24 module.
+*/
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
+#line 75 "dk4rec24.ctr"
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+#include "dk4conf.h"
+#include "dk4rec24.h"
+#include "dk4rec26.h"
-/** @file dk4rec24.c The dk4rec24 module.
-*/
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 63 "dk4rec24.ctr"
-#include "dk4rec24.h"
+#line 88 "dk4rec24.ctr"
int
@@ -49,10 +40,15 @@ dk4recode_wchar_t_to_char(
{
size_t used = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while ((L'\0' != *src) && (1 == back)) {
- if ((wchar_t)128 > *src) {
+ if (128UL > dk4recode_wc_to_ul(*src)) {
dstb[used++] = (char)(*(src++));
} else {
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
diff --git a/support/dktools/dk4rec24.ctr b/support/dktools/dk4rec24.ctr
index c25cb0277e..9fa4411be6 100644
--- a/support/dktools/dk4rec24.ctr
+++ b/support/dktools/dk4rec24.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -61,7 +73,18 @@ dk4recode_wchar_t_to_char(
%% module
+#include "dk4conf.h"
#include "dk4rec24.h"
+#include "dk4rec26.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+$!trace-include
int
@@ -71,10 +94,15 @@ dk4recode_wchar_t_to_char(
{
size_t used = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
back = 1;
while ((L'\0' != *src) && (1 == back)) {
- if ((wchar_t)128 > *src) {
+ if (128UL > dk4recode_wc_to_ul(*src)) {
dstb[used++] = (char)(*(src++));
} else {
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
diff --git a/support/dktools/dk4rec24.h b/support/dktools/dk4rec24.h
index 8bf21a1ae5..b1e773fcda 100644
--- a/support/dktools/dk4rec24.h
+++ b/support/dktools/dk4rec24.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec24.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec24.ctr
*/
#ifndef DK4REC24_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4rec25.c b/support/dktools/dk4rec25.c
index 55d91a1569..e793eee313 100644
--- a/support/dktools/dk4rec25.c
+++ b/support/dktools/dk4rec25.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec25.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec25.ctr
*/
/** @file dk4rec25.c The dk4rec25 module.
@@ -40,58 +18,99 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 47 "dk4rec25.ctr"
#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
#include "dk4types.h"
#include "dk4enc.h"
#include "dk4rec.h"
#include "dk4str8.h"
#include "dk4strw.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 70 "dk4rec25.ctr"
+
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4100 )
+#endif
int
dk4recode_dk_to_any(
- void *dstb, size_t szdstb, int de, const dkChar *src, int se, dk4_er_t *erp
+ void *dstb,
+ size_t szdstb,
+ int de,
+ const dkChar *src,
+#if DK4_CHAR_SIZE > 1
+ int DK4_ARG_UNUSED(se),
+#else
+ int se,
+#endif
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(se)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
switch (de) {
- case DK4_ENCODING_ASCII : {
+ case DK4_ENCODING_PLAIN : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4recode_c32_to_ascii(dstb, szdstb, src, erp);
+ back = dk4recode_c32_to_ascii((char *)dstb, szdstb, src, erp);
#else
- back = dk4recode_utf16_to_ascii(dstb, szdstb, src, erp);
+ back = dk4recode_utf16_to_ascii((char *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4recode_utf8_to_ascii(dstb, szdstb, src, erp);
+ back = dk4recode_utf8_to_ascii((char *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back = dk4recode_ansi_to_ascii(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_ascii((char *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4str8_cpy_s(dstb, szdstb, src, erp);
+ back = dk4str8_cpy_s((char *)dstb, szdstb, src, erp);
} break;
}
#endif
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4recode_c32_to_ansi(dstb, szdstb, src, erp);
+ back = dk4recode_c32_to_ansi((char *)dstb, szdstb, src, erp);
#else
- back = dk4recode_utf16_to_ansi(dstb, szdstb, src, erp);
+ back = dk4recode_utf16_to_ansi((char *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4recode_utf8_to_ansi(dstb, szdstb, src, erp);
+ back = dk4recode_utf8_to_ansi((char *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back = dk4str8_cpy_s(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4str8_cpy_s((char *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4recode_ascii_to_ansi(dstb, szdstb, src, erp);
+ back = dk4recode_ascii_to_ansi((char *)dstb, szdstb, src, erp);
} break;
}
#endif
@@ -99,20 +118,20 @@ dk4recode_dk_to_any(
case DK4_ENCODING_UTF8 : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4recode_c32_to_utf8(dstb, szdstb, src, erp);
+ back = dk4recode_c32_to_utf8((char *)dstb, szdstb, src, erp);
#else
- back = dk4recode_utf16_to_utf8(dstb, szdstb, src, erp);
+ back = dk4recode_utf16_to_utf8((char *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4str8_cpy_s(dstb, szdstb, src, erp);
+ back = dk4str8_cpy_s((char *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back= dk4recode_ansi_to_utf8(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back= dk4recode_ansi_to_utf8((char *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4recode_ascii_to_utf8(dstb, szdstb, src, erp);
+ back = dk4recode_ascii_to_utf8((char *)dstb, szdstb, src, erp);
} break;
}
#endif
@@ -120,20 +139,20 @@ dk4recode_dk_to_any(
case DK4_ENCODING_UTF16 : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4recode_c32_to_utf16(dstb, szdstb, src, erp);
+ back = dk4recode_c32_to_utf16((dk4_c16_t *)dstb, szdstb, src, erp);
#else
- back = dk4strw_cpy_s(dstb, szdstb, src, erp);
+ back = dk4strw_cpy_s((wchar_t *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4recode_utf8_to_utf16(dstb, szdstb, src, erp);
+ back = dk4recode_utf8_to_utf16((dk4_c16_t *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back = dk4recode_ansi_to_utf16(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_utf16((dk4_c16_t *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4recode_ascii_to_utf16(dstb, szdstb, src, erp);
+ back = dk4recode_ascii_to_utf16((dk4_c16_t *)dstb,szdstb,src,erp);
} break;
}
#endif
@@ -141,20 +160,20 @@ dk4recode_dk_to_any(
case DK4_ENCODING_32 : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4strw_cpy_s(dstb, szdstb, src, erp);
+ back = dk4strw_cpy_s((wchar_t *)dstb, szdstb, src, erp);
#else
- back = dk4recode_utf16_to_c32(dstb, szdstb, src, erp);
+ back = dk4recode_utf16_to_c32((dk4_c32_t *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4recode_utf8_to_c32(dstb, szdstb, src, erp);
+ back = dk4recode_utf8_to_c32((dk4_c32_t *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back = dk4recode_ansi_to_c32(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_c32((dk4_c32_t *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4recode_ascii_to_c32(dstb, szdstb, src, erp);
+ back = dk4recode_ascii_to_c32((dk4_c32_t *)dstb, szdstb, src, erp);
} break;
}
#endif
@@ -166,4 +185,8 @@ dk4recode_dk_to_any(
return back;
}
+#if _WIN32 && defined(_MSC_VER) && (_MSC_VER >= 1700)
+#pragma warning( pop )
+#endif
+
diff --git a/support/dktools/dk4rec25.ctr b/support/dktools/dk4rec25.ctr
index 618649cd53..e125a9b0f9 100644
--- a/support/dktools/dk4rec25.ctr
+++ b/support/dktools/dk4rec25.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -46,58 +46,97 @@ dk4recode_dk_to_any(
%% module
#include "dk4conf.h"
+
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
#include "dk4types.h"
#include "dk4enc.h"
#include "dk4rec.h"
#include "dk4str8.h"
#include "dk4strw.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4100 )
+#endif
int
dk4recode_dk_to_any(
- void *dstb, size_t szdstb, int de, const dkChar *src, int se, dk4_er_t *erp
+ void *dstb,
+ size_t szdstb,
+ int de,
+ const dkChar *src,
+#if DK4_CHAR_SIZE > 1
+ int DK4_ARG_UNUSED(se),
+#else
+ int se,
+#endif
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(se)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
switch (de) {
- case DK4_ENCODING_ASCII : {
+ case DK4_ENCODING_PLAIN : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4recode_c32_to_ascii(dstb, szdstb, src, erp);
+ back = dk4recode_c32_to_ascii((char *)dstb, szdstb, src, erp);
#else
- back = dk4recode_utf16_to_ascii(dstb, szdstb, src, erp);
+ back = dk4recode_utf16_to_ascii((char *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4recode_utf8_to_ascii(dstb, szdstb, src, erp);
+ back = dk4recode_utf8_to_ascii((char *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back = dk4recode_ansi_to_ascii(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_ascii((char *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4str8_cpy_s(dstb, szdstb, src, erp);
+ back = dk4str8_cpy_s((char *)dstb, szdstb, src, erp);
} break;
}
#endif
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4recode_c32_to_ansi(dstb, szdstb, src, erp);
+ back = dk4recode_c32_to_ansi((char *)dstb, szdstb, src, erp);
#else
- back = dk4recode_utf16_to_ansi(dstb, szdstb, src, erp);
+ back = dk4recode_utf16_to_ansi((char *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4recode_utf8_to_ansi(dstb, szdstb, src, erp);
+ back = dk4recode_utf8_to_ansi((char *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back = dk4str8_cpy_s(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4str8_cpy_s((char *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4recode_ascii_to_ansi(dstb, szdstb, src, erp);
+ back = dk4recode_ascii_to_ansi((char *)dstb, szdstb, src, erp);
} break;
}
#endif
@@ -105,20 +144,20 @@ dk4recode_dk_to_any(
case DK4_ENCODING_UTF8 : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4recode_c32_to_utf8(dstb, szdstb, src, erp);
+ back = dk4recode_c32_to_utf8((char *)dstb, szdstb, src, erp);
#else
- back = dk4recode_utf16_to_utf8(dstb, szdstb, src, erp);
+ back = dk4recode_utf16_to_utf8((char *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4str8_cpy_s(dstb, szdstb, src, erp);
+ back = dk4str8_cpy_s((char *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back= dk4recode_ansi_to_utf8(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back= dk4recode_ansi_to_utf8((char *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4recode_ascii_to_utf8(dstb, szdstb, src, erp);
+ back = dk4recode_ascii_to_utf8((char *)dstb, szdstb, src, erp);
} break;
}
#endif
@@ -126,20 +165,20 @@ dk4recode_dk_to_any(
case DK4_ENCODING_UTF16 : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4recode_c32_to_utf16(dstb, szdstb, src, erp);
+ back = dk4recode_c32_to_utf16((dk4_c16_t *)dstb, szdstb, src, erp);
#else
- back = dk4strw_cpy_s(dstb, szdstb, src, erp);
+ back = dk4strw_cpy_s((wchar_t *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4recode_utf8_to_utf16(dstb, szdstb, src, erp);
+ back = dk4recode_utf8_to_utf16((dk4_c16_t *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back = dk4recode_ansi_to_utf16(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_utf16((dk4_c16_t *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4recode_ascii_to_utf16(dstb, szdstb, src, erp);
+ back = dk4recode_ascii_to_utf16((dk4_c16_t *)dstb,szdstb,src,erp);
} break;
}
#endif
@@ -147,20 +186,20 @@ dk4recode_dk_to_any(
case DK4_ENCODING_32 : {
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
- back = dk4strw_cpy_s(dstb, szdstb, src, erp);
+ back = dk4strw_cpy_s((wchar_t *)dstb, szdstb, src, erp);
#else
- back = dk4recode_utf16_to_c32(dstb, szdstb, src, erp);
+ back = dk4recode_utf16_to_c32((dk4_c32_t *)dstb, szdstb, src, erp);
#endif
#else
switch (se) {
case DK4_ENCODING_UTF8 : {
- back = dk4recode_utf8_to_c32(dstb, szdstb, src, erp);
+ back = dk4recode_utf8_to_c32((dk4_c32_t *)dstb, szdstb, src, erp);
} break;
- case DK4_ENCODING_ANSI : {
- back = dk4recode_ansi_to_c32(dstb, szdstb, src, erp);
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_c32((dk4_c32_t *)dstb, szdstb, src, erp);
} break;
default : {
- back = dk4recode_ascii_to_c32(dstb, szdstb, src, erp);
+ back = dk4recode_ascii_to_c32((dk4_c32_t *)dstb, szdstb, src, erp);
} break;
}
#endif
@@ -172,4 +211,8 @@ dk4recode_dk_to_any(
return back;
}
+#if _WIN32 && defined(_MSC_VER) && (_MSC_VER >= 1700)
+#pragma warning( pop )
+#endif
+
diff --git a/support/dktools/dk4rec25.h b/support/dktools/dk4rec25.h
index 84a980c72b..896fdd84ca 100644
--- a/support/dktools/dk4rec25.h
+++ b/support/dktools/dk4rec25.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rec25.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec25.ctr
*/
#ifndef DK4REC25_H_INCLUDED
diff --git a/support/dktools/dk4rec26.c b/support/dktools/dk4rec26.c
new file mode 100644
index 0000000000..bceb62dff3
--- /dev/null
+++ b/support/dktools/dk4rec26.c
@@ -0,0 +1,107 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec26.ctr
+*/
+
+/** @file dk4rec26.c The dk4rec26 module.
+*/
+
+
+#line 96 "dk4rec26.ctr"
+
+#include "dk4conf.h"
+
+
+#include "dk4rec26.h"
+
+
+
+unsigned long
+dk4recode_char_to_ul(unsigned long back)
+{
+ back &= 0x000000FFUL;
+ return back;
+}
+
+
+
+unsigned long
+dk4recode_c16_to_ul(unsigned long back)
+{
+ back &= 0x0000FFFFUL;
+ return back;
+}
+
+
+
+unsigned long
+dk4recode_c32_to_ul(unsigned long back)
+{
+ back &= 0xFFFFFFFFUL;
+ return back;
+}
+
+
+
+unsigned long
+dk4recode_dk_to_ul(unsigned long back)
+{
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ back &= 0xFFFFFFFFUL;
+#else
+ back &= 0x0000FFFFUL;
+#endif
+#else
+ back &= 0x000000FFUL;
+#endif
+ return back;
+}
+
+
+
+unsigned long
+dk4recode_wc_to_ul(unsigned long back)
+{
+#if DK4_SIZEOF_WCHAR_T > 1
+#if DK4_SIZEOF_WCHAR_T > 2
+ back &= 0xFFFFFFFFUL;
+#else
+ back &= 0x0000FFFFUL;
+#endif
+#else
+ back &= 0x000000FFUL;
+#endif
+ return back;
+}
+
+
+
+#if 0
+
+unsigned long
+dk4recode_wx_to_ul(unsigned long back)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+#if DK4_SIZEOF_WXCHAR > 2
+ back &= 0xFFFFFFFFUL;
+#else
+ back &= 0x0000FFFFUL;
+#endif
+#else
+ back &= 0x000000FFUL;
+#endif
+ return back;
+}
+
+#endif
+
+
diff --git a/support/dktools/dk4rec26.ctr b/support/dktools/dk4rec26.ctr
new file mode 100644
index 0000000000..ccd52f51c3
--- /dev/null
+++ b/support/dktools/dk4rec26.ctr
@@ -0,0 +1,184 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4rec26.h Recode characters to unsigned long.
+ We can not simply convert unsing the (unsigned long) cast
+ as on some systems wchar_t may be a signed integer type
+ and unsigned long may be larger than 32 bits.
+
+ Promoting negative wchar_t or wxChar values to 64 bit
+ unsigned long will result in conversions for instance from
+ wchar_t=0xFFFE0000 to ul=0xFFFFFFFFFFFE0000.
+
+ So after an (unsigned long) cast we have to apply a mask,
+ i.e. 0xFFFFFFFFUL when wchar_t is 4 bytes long or
+ 0xFFFFU when wchar_t is 2 bytes long.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Convert char to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_char_to_ul(unsigned long back);
+
+/** Convert 16 bit character to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_c16_to_ul(unsigned long back);
+
+/** Convert 32 bit character to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_c32_to_ul(unsigned long back);
+
+/** Convert dkChar to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_dk_to_ul(unsigned long back);
+
+/** Convert wchar_t to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_wc_to_ul(unsigned long back);
+
+#if 0
+
+/** Convert wxChar to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_wx_to_ul(unsigned long back);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "dk4conf.h"
+
+
+#include "dk4rec26.h"
+
+
+
+unsigned long
+dk4recode_char_to_ul(unsigned long back)
+{
+ back &= 0x000000FFUL;
+ return back;
+}
+
+
+
+unsigned long
+dk4recode_c16_to_ul(unsigned long back)
+{
+ back &= 0x0000FFFFUL;
+ return back;
+}
+
+
+
+unsigned long
+dk4recode_c32_to_ul(unsigned long back)
+{
+ back &= 0xFFFFFFFFUL;
+ return back;
+}
+
+
+
+unsigned long
+dk4recode_dk_to_ul(unsigned long back)
+{
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ back &= 0xFFFFFFFFUL;
+#else
+ back &= 0x0000FFFFUL;
+#endif
+#else
+ back &= 0x000000FFUL;
+#endif
+ return back;
+}
+
+
+
+unsigned long
+dk4recode_wc_to_ul(unsigned long back)
+{
+#if DK4_SIZEOF_WCHAR_T > 1
+#if DK4_SIZEOF_WCHAR_T > 2
+ back &= 0xFFFFFFFFUL;
+#else
+ back &= 0x0000FFFFUL;
+#endif
+#else
+ back &= 0x000000FFUL;
+#endif
+ return back;
+}
+
+
+
+#if 0
+
+unsigned long
+dk4recode_wx_to_ul(unsigned long back)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+#if DK4_SIZEOF_WXCHAR > 2
+ back &= 0xFFFFFFFFUL;
+#else
+ back &= 0x0000FFFFUL;
+#endif
+#else
+ back &= 0x000000FFUL;
+#endif
+ return back;
+}
+
+#endif
+
+
diff --git a/support/dktools/dk4rec26.h b/support/dktools/dk4rec26.h
new file mode 100644
index 0000000000..8c5130ad01
--- /dev/null
+++ b/support/dktools/dk4rec26.h
@@ -0,0 +1,108 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec26.ctr
+*/
+
+#ifndef DK4REC26_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4REC26_H_INCLUDED 1
+
+
+#line 8 "dk4rec26.ctr"
+
+/** @file dk4rec26.h Recode characters to unsigned long.
+ We can not simply convert unsing the (unsigned long) cast
+ as on some systems wchar_t may be a signed integer type
+ and unsigned long may be larger than 32 bits.
+
+ Promoting negative wchar_t or wxChar values to 64 bit
+ unsigned long will result in conversions for instance from
+ wchar_t=0xFFFE0000 to ul=0xFFFFFFFFFFFE0000.
+
+ So after an (unsigned long) cast we have to apply a mask,
+ i.e. 0xFFFFFFFFUL when wchar_t is 4 bytes long or
+ 0xFFFFU when wchar_t is 2 bytes long.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Convert char to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_char_to_ul(unsigned long back);
+
+/** Convert 16 bit character to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_c16_to_ul(unsigned long back);
+
+/** Convert 32 bit character to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_c32_to_ul(unsigned long back);
+
+/** Convert dkChar to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_dk_to_ul(unsigned long back);
+
+/** Convert wchar_t to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_wc_to_ul(unsigned long back);
+
+#if 0
+
+/** Convert wxChar to unsigned long.
+ @param back Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recode_wx_to_ul(unsigned long back);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4rec27.c b/support/dktools/dk4rec27.c
new file mode 100644
index 0000000000..107c84c4c4
--- /dev/null
+++ b/support/dktools/dk4rec27.c
@@ -0,0 +1,175 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec27.ctr
+*/
+
+/** @file dk4rec27.c The dk4rec27 module.
+*/
+
+
+#line 77 "dk4rec27.ctr"
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4REC_H_INCLUDED
+#include "dk4rec.h"
+#endif
+
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+int
+dk4recode_c8_to_dk(
+ dkChar *dstb,
+ size_t szdstb,
+#if DK4_CHAR_SIZE == 1
+ int dke,
+#else
+ int DK4_ARG_UNUSED(dke),
+#endif
+ char const *src,
+ int se,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(dke)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
+ if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ switch (se) {
+ case DK4_ENCODING_PLAIN : {
+ back = dk4recode_ascii_to_c32(dstb, szdstb, src, erp);
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_c32(dstb, szdstb, src, erp);
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ back = dk4recode_utf8_to_c32(dstb, szdstb, src, erp);
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } break;
+ }
+#else
+ switch (se) {
+ case DK4_ENCODING_PLAIN : {
+ back = dk4recode_ascii_to_utf16(dstb, szdstb, src, erp);
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_utf16(dstb, szdstb, src, erp);
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ back = dk4recode_utf8_to_utf16(dstb, szdstb, src, erp);
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } break;
+ }
+#endif
+#else
+ if (dke == se) {
+ back = dk4str8_cpy_s(dstb, szdstb, src, erp);
+ }
+ else {
+ switch (dke) {
+ case DK4_ENCODING_PLAIN : {
+ switch (se) {
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_ascii(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ back = dk4recode_utf8_to_ascii(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ default : {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_INVALID_ARGUMENTS
+ );
+ } break;
+ }
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ switch (se) {
+ case DK4_ENCODING_PLAIN : {
+ back = dk4recode_ascii_to_ansi(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ back = dk4recode_utf8_to_ansi(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ default : {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_INVALID_ARGUMENTS
+ );
+ } break;
+ }
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ switch (se) {
+ case DK4_ENCODING_PLAIN : {
+ back = dk4recode_ascii_to_utf8(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_utf8(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ default : {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_INVALID_ARGUMENTS
+ );
+ } break;
+ }
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ } break;
+ }
+ }
+#endif
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4rec27.ctr b/support/dktools/dk4rec27.ctr
new file mode 100644
index 0000000000..8bc5828416
--- /dev/null
+++ b/support/dktools/dk4rec27.ctr
@@ -0,0 +1,233 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file dk4rec27.h Recoding from char to dkChar.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4enc.h"
+#else
+#include <dktools-4/dk4enc.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Recode from char string to dkChar string.
+ @param dstb Destination buffer.
+ @param szdstb Destination buffer size (number of dkChar).
+ @param dke Encoding for dkChar.
+ @param src Source string.
+ @param se Source string encoding.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4recode_c8_to_dk(
+ dkChar *dstb,
+ size_t szdstb,
+ int dke,
+ char const *src,
+ int se,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4REC_H_INCLUDED
+#include "dk4rec.h"
+#endif
+
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+int
+dk4recode_c8_to_dk(
+ dkChar *dstb,
+ size_t szdstb,
+#if DK4_CHAR_SIZE == 1
+ int dke,
+#else
+ int DK4_ARG_UNUSED(dke),
+#endif
+ char const *src,
+ int se,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(dke)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != dstb);
+ assert(0 < szdstb);
+ assert(NULL != src);
+#endif
+ if ((NULL != dstb) && (NULL != src) && (0 < szdstb)) {
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ switch (se) {
+ case DK4_ENCODING_PLAIN : {
+ back = dk4recode_ascii_to_c32(dstb, szdstb, src, erp);
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_c32(dstb, szdstb, src, erp);
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ back = dk4recode_utf8_to_c32(dstb, szdstb, src, erp);
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } break;
+ }
+#else
+ switch (se) {
+ case DK4_ENCODING_PLAIN : {
+ back = dk4recode_ascii_to_utf16(dstb, szdstb, src, erp);
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_utf16(dstb, szdstb, src, erp);
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ back = dk4recode_utf8_to_utf16(dstb, szdstb, src, erp);
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } break;
+ }
+#endif
+#else
+ if (dke == se) {
+ back = dk4str8_cpy_s(dstb, szdstb, src, erp);
+ }
+ else {
+ switch (dke) {
+ case DK4_ENCODING_PLAIN : {
+ switch (se) {
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_ascii(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ back = dk4recode_utf8_to_ascii(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ default : {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_INVALID_ARGUMENTS
+ );
+ } break;
+ }
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ switch (se) {
+ case DK4_ENCODING_PLAIN : {
+ back = dk4recode_ascii_to_ansi(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ back = dk4recode_utf8_to_ansi(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ default : {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_INVALID_ARGUMENTS
+ );
+ } break;
+ }
+ } break;
+ case DK4_ENCODING_UTF8 : {
+ switch (se) {
+ case DK4_ENCODING_PLAIN : {
+ back = dk4recode_ascii_to_utf8(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ back = dk4recode_ansi_to_utf8(
+ dstb, szdstb, src, erp
+ );
+ } break;
+ default : {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_INVALID_ARGUMENTS
+ );
+ } break;
+ }
+ } break;
+ default : {
+ dk4error_set_simple_error_code(erp,DK4_E_INVALID_ARGUMENTS);
+ } break;
+ }
+ }
+#endif
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4rec27.h b/support/dktools/dk4rec27.h
new file mode 100644
index 0000000000..4fc68c882c
--- /dev/null
+++ b/support/dktools/dk4rec27.h
@@ -0,0 +1,89 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rec27.ctr
+*/
+
+#ifndef DK4REC27_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4REC27_H_INCLUDED 1
+
+
+#line 8 "dk4rec27.ctr"
+
+/** @file dk4rec27.h Recoding from char to dkChar.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4enc.h"
+#else
+#include <dktools-4/dk4enc.h>
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Recode from char string to dkChar string.
+ @param dstb Destination buffer.
+ @param szdstb Destination buffer size (number of dkChar).
+ @param dke Encoding for dkChar.
+ @param src Source string.
+ @param se Source string encoding.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4recode_c8_to_dk(
+ dkChar *dstb,
+ size_t szdstb,
+ int dke,
+ char const *src,
+ int se,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dk4recwx.cpp b/support/dktools/dk4recwx.cpp
index f50fec753f..499622e06b 100644
--- a/support/dktools/dk4recwx.cpp
+++ b/support/dktools/dk4recwx.cpp
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4recwx.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4recwx.cpt
*/
/** @file dk4recwx.cpp The dk4recwx module.
*/
-#line 159 "dk4recwx.cpt"
+#line 235 "dk4recwx.cpt"
#include "dk4recwx.h"
#include "dk4rec.h"
@@ -47,7 +25,39 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 167 "dk4recwx.cpt"
+#line 243 "dk4recwx.cpt"
+
+
+
+int
+dk4recwx_utf8_to_wxchar(
+ wxChar *dptr,
+ size_t dsz,
+ const char *sptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
+#if DK4_SIZEOF_WXCHAR > 1
+#if DK4_SIZEOF_WXCHAR > 2
+ back = dk4recode_utf8_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
+#else
+ back = dk4recode_utf8_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
+#endif
+#else
+#if wxUSE_UNICODE_UTF8
+ back = dk4str8_cpy_s((char *)dptr, dsz, sptr, erp);
+#else
+ back = dk4recode_utf8_to_ansi((char *)dptr, dsz, sptr, erp);
+#endif
+#endif
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
@@ -55,9 +65,17 @@ int
dk4recwx_dkchar_to_wxchar(
wxChar *dptr,
size_t dsz,
+#if DK4_SIZEOF_WXCHAR == 1
int de,
+#else
+ int WXUNUSED(de),
+#endif
const dkChar *sptr,
+#if DK4_CHAR_SIZE == 1
int se,
+#else
+ int WXUNUSED(se),
+#endif
dk4_er_t *erp
)
{
@@ -83,7 +101,7 @@ dk4recwx_dkchar_to_wxchar(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf8_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_ansi_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
default : { /* ASCII */
@@ -113,7 +131,7 @@ dk4recwx_dkchar_to_wxchar(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf8_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_ansi_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
default : { /* ASCII */
@@ -135,7 +153,7 @@ dk4recwx_dkchar_to_wxchar(
case DK4_ENCODING_UTF8 : {
back = dk4recode_c32_to_utf8(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_c32_to_ansi(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
default : { /* ASCII */
@@ -149,7 +167,7 @@ dk4recwx_dkchar_to_wxchar(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf16_to_utf8(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_utf16_to_ansi(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
default : { /* ASCII */
@@ -178,16 +196,24 @@ int
dk4recwx_wxchar_to_dkchar(
dkChar *dptr,
size_t dsz,
+#if DK4_CHAR_SIZE == 1
int de,
+#else
+ int WXUNUSED(de),
+#endif
const wxChar *sptr,
+#if DK4_SIZEOF_WXCHAR == 1
int se,
+#else
+ int WXUNUSED(se),
+#endif
dk4_er_t *erp
)
{
int back = 0;
-#line 305 "dk4recwx.cpt"
+#line 429 "dk4recwx.cpt"
if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
#if DK4_SIZEOF_WXCHAR > 1
#if DK4_SIZEOF_WXCHAR > 2
@@ -198,14 +224,14 @@ dk4recwx_wxchar_to_dkchar(
/* +++++ wxChar=4 dkChar=4 */
-#line 314 "dk4recwx.cpt"
+#line 438 "dk4recwx.cpt"
back = dk4str_cpy_s(dptr, dsz, (dkChar *)sptr, erp);
/* ----- wxChar=4 dkChar=4 */
#else
/* +++++ wxChar=4 dkChar=2 */
-#line 319 "dk4recwx.cpt"
+#line 443 "dk4recwx.cpt"
back = dk4recode_c32_to_utf16((dk4_c16_t *)dptr, dsz, (dk4_c32_t *)sptr, erp);
/* ----- wxChar=4 dkChar=2 */
#endif
@@ -213,24 +239,24 @@ dk4recwx_wxchar_to_dkchar(
/* +++++ wxChar=4 dkChar=1 */
-#line 325 "dk4recwx.cpt"
+#line 449 "dk4recwx.cpt"
switch (de) {
case DK4_ENCODING_UTF8 : {
-#line 328 "dk4recwx.cpt"
+#line 452 "dk4recwx.cpt"
back = dk4recode_c32_to_utf8(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
-#line 332 "dk4recwx.cpt"
+#line 456 "dk4recwx.cpt"
back = dk4recode_c32_to_ansi(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
default : { /* ASCII */
-#line 336 "dk4recwx.cpt"
+#line 460 "dk4recwx.cpt"
back = dk4recode_c32_to_ascii(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
}
@@ -246,14 +272,14 @@ dk4recwx_wxchar_to_dkchar(
/* +++++ wxChar=2 dkChar=4 */
-#line 350 "dk4recwx.cpt"
+#line 474 "dk4recwx.cpt"
back = dk4recode_utf16_to_c32((dk4_c32_t *)dptr, dsz, (dk4_c16_t *)sptr, erp);
/* ----- wxChar=2 dkChar=4 */
#else
/* +++++ wxChar=2 dkChar=2 */
-#line 355 "dk4recwx.cpt"
+#line 479 "dk4recwx.cpt"
back = dk4str_cpy_s(dptr, dsz, (dkChar *)sptr, erp);
/* ----- wxChar=2 dkChar=2 */
#endif
@@ -261,24 +287,24 @@ dk4recwx_wxchar_to_dkchar(
/* +++++ wxChar=2 dkChar=1 */
-#line 361 "dk4recwx.cpt"
+#line 485 "dk4recwx.cpt"
switch (de) {
case DK4_ENCODING_UTF8 : {
-#line 364 "dk4recwx.cpt"
+#line 488 "dk4recwx.cpt"
back = dk4recode_utf16_to_utf8(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
-#line 368 "dk4recwx.cpt"
+#line 492 "dk4recwx.cpt"
back = dk4recode_utf16_to_ansi(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
default : { /* ASCII */
-#line 372 "dk4recwx.cpt"
+#line 496 "dk4recwx.cpt"
back = dk4recode_utf16_to_ascii(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
}
@@ -295,24 +321,24 @@ dk4recwx_wxchar_to_dkchar(
/* +++++ wxChar=1 dkChar=4 */
-#line 387 "dk4recwx.cpt"
+#line 511 "dk4recwx.cpt"
switch (se) {
case DK4_ENCODING_UTF8 : {
-#line 390 "dk4recwx.cpt"
+#line 514 "dk4recwx.cpt"
back = dk4recode_utf8_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
-#line 394 "dk4recwx.cpt"
+#line 518 "dk4recwx.cpt"
back = dk4recode_ansi_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
default : { /* ASCII */
-#line 398 "dk4recwx.cpt"
+#line 522 "dk4recwx.cpt"
back = dk4recode_ascii_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
}
@@ -321,24 +347,24 @@ dk4recwx_wxchar_to_dkchar(
/* +++++ wxChar=1 dkChar=2 */
-#line 405 "dk4recwx.cpt"
+#line 529 "dk4recwx.cpt"
switch (se) {
case DK4_ENCODING_UTF8 : {
-#line 408 "dk4recwx.cpt"
+#line 532 "dk4recwx.cpt"
back = dk4recode_utf8_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
-#line 412 "dk4recwx.cpt"
+#line 536 "dk4recwx.cpt"
back = dk4recode_ansi_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
default : { /* ASCII */
-#line 416 "dk4recwx.cpt"
+#line 540 "dk4recwx.cpt"
back = dk4recode_ascii_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
}
@@ -348,7 +374,7 @@ dk4recwx_wxchar_to_dkchar(
/* +++++ wxChar=1 dkChar=1 */
-#line 424 "dk4recwx.cpt"
+#line 548 "dk4recwx.cpt"
back = dk4str8_cpy_s(dptr, dsz, sptr, erp);
/* ----- wxChar=1 dkChar=1 */
#endif
@@ -357,12 +383,12 @@ dk4recwx_wxchar_to_dkchar(
#endif
} else {
-#line 431 "dk4recwx.cpt"
+#line 555 "dk4recwx.cpt"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 434 "dk4recwx.cpt"
+#line 558 "dk4recwx.cpt"
return back;
}
@@ -374,7 +400,11 @@ dk4recwx_wxchar_to_char(
size_t dsz,
int de,
const wxChar *sptr,
+#if DK4_SIZEOF_WXCHAR == 1
int se,
+#else
+ int WXUNUSED(se),
+#endif
dk4_er_t *erp
)
{
@@ -398,7 +428,7 @@ dk4recwx_wxchar_to_char(
case DK4_ENCODING_UTF8 : {
back = dk4str8_cpy_s(dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_ansi_to_utf8(dptr, dsz, sptr, erp);
} break;
default : {
@@ -408,7 +438,7 @@ dk4recwx_wxchar_to_char(
/* --- wxChar 1 --- */
#endif
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
#if DK4_SIZEOF_WXCHAR > 1
#if DK4_SIZEOF_WXCHAR > 2
/* +++ wxChar 4 +++ */
@@ -425,7 +455,7 @@ dk4recwx_wxchar_to_char(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf8_to_ansi(dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4str8_cpy_s(dptr, dsz, sptr, erp);
} break;
default : {
@@ -452,7 +482,7 @@ dk4recwx_wxchar_to_char(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf8_to_ascii(dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_ansi_to_ascii(dptr, dsz, sptr, erp);
} break;
default : {
@@ -469,3 +499,21 @@ dk4recwx_wxchar_to_char(
return back;
}
+
+
+unsigned long
+dk4recwx_wxchar_to_ul(wxChar wxc)
+{
+ unsigned long back;
+#if DK4_SIZEOF_WXCHAR > 1
+#if DK4_SIZEOF_WXCHAR > 2
+ back = (0xFFFFFFFFUL & ((unsigned long)wxc));
+#else
+ back = (0x0000FFFFUL & ((unsigned long)wxc));
+#endif
+#else
+ back = (0x000000FFUL & ((unsigned long)wxc));
+#endif
+ return back;
+}
+
diff --git a/support/dktools/dk4recwx.cpt b/support/dktools/dk4recwx.cpt
index 75f0378638..9092142d7b 100644
--- a/support/dktools/dk4recwx.cpt
+++ b/support/dktools/dk4recwx.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,28 +12,62 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
#if DK4_SIZEOF_WXCHAR == DK4_CHAR_SIZE
#ifndef DK4STRD_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strd.h"
+#else
+#include <dktools-4/dk4strd.h>
+#endif
#endif
#endif
@@ -47,12 +81,24 @@ license = bsd
#endif
#ifndef WX_PRECOMP
#if DK4_HAVE_WX_CHARTYPE_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_CHARTYPE_H_INCLUDED
#include <wx/chartype.h>
#define WX_CHARTYPE_H_INCLUDED 1
#endif
#else
#if DK4_HAVE_WX_WXCHAR_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_WXCHAR_H_INCLUDED
#include <wx/wxchar.h>
#define WX_WXCHAR_H_INCLUDED 1
@@ -70,6 +116,29 @@ license = bsd
extern "C" {
#endif
+/** Convert UTF-8 encoded char string to wxChar.
+ @param dptr Destination buffer pointer.
+ @param dsz Size of destination buffer (number of wxChar).
+ @param sptr Source string pointer.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr or sptr is NULL or dsz is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer is too small,
+ - DK4_E_SYNTAX<br>
+ if the source string can not be decoded properly.
+*/
+int
+dk4recwx_utf8_to_wxchar(
+ wxChar *dptr,
+ size_t dsz,
+ const char *sptr,
+ dk4_er_t *erp
+);
+
/** Convert dkChar string to wxChar.
@param dptr Destination buffer pointer.
@param dsz Size of destination buffer (number of wxChar).
@@ -151,6 +220,13 @@ dk4recwx_wxchar_to_char(
dk4_er_t *erp
);
+/** Convert wxChar to unsigned long.
+ @param wxc Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recwx_wxchar_to_ul(wxChar wxc);
+
#ifdef __cplusplus
}
#endif
@@ -168,12 +244,52 @@ $!trace-include
int
+dk4recwx_utf8_to_wxchar(
+ wxChar *dptr,
+ size_t dsz,
+ const char *sptr,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ if ((NULL != dptr) && (NULL != sptr) && (0 < dsz)) {
+#if DK4_SIZEOF_WXCHAR > 1
+#if DK4_SIZEOF_WXCHAR > 2
+ back = dk4recode_utf8_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
+#else
+ back = dk4recode_utf8_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
+#endif
+#else
+#if wxUSE_UNICODE_UTF8
+ back = dk4str8_cpy_s((char *)dptr, dsz, sptr, erp);
+#else
+ back = dk4recode_utf8_to_ansi((char *)dptr, dsz, sptr, erp);
+#endif
+#endif
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ return back;
+}
+
+
+
+int
dk4recwx_dkchar_to_wxchar(
wxChar *dptr,
size_t dsz,
+#if DK4_SIZEOF_WXCHAR == 1
int de,
+#else
+ int WXUNUSED(de),
+#endif
const dkChar *sptr,
+#if DK4_CHAR_SIZE == 1
int se,
+#else
+ int WXUNUSED(se),
+#endif
dk4_er_t *erp
)
{
@@ -199,7 +315,7 @@ dk4recwx_dkchar_to_wxchar(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf8_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_ansi_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
default : { /* ASCII */
@@ -229,7 +345,7 @@ dk4recwx_dkchar_to_wxchar(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf8_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_ansi_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
default : { /* ASCII */
@@ -251,7 +367,7 @@ dk4recwx_dkchar_to_wxchar(
case DK4_ENCODING_UTF8 : {
back = dk4recode_c32_to_utf8(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_c32_to_ansi(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
default : { /* ASCII */
@@ -265,7 +381,7 @@ dk4recwx_dkchar_to_wxchar(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf16_to_utf8(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_utf16_to_ansi(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
default : { /* ASCII */
@@ -294,9 +410,17 @@ int
dk4recwx_wxchar_to_dkchar(
dkChar *dptr,
size_t dsz,
+#if DK4_CHAR_SIZE == 1
int de,
+#else
+ int WXUNUSED(de),
+#endif
const wxChar *sptr,
+#if DK4_SIZEOF_WXCHAR == 1
int se,
+#else
+ int WXUNUSED(se),
+#endif
dk4_er_t *erp
)
{
@@ -327,7 +451,7 @@ dk4recwx_wxchar_to_dkchar(
$? ". dk utf-8"
back = dk4recode_c32_to_utf8(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
$? ". dk ansi"
back = dk4recode_c32_to_ansi(dptr, dsz, (dk4_c32_t *)sptr, erp);
} break;
@@ -363,7 +487,7 @@ dk4recwx_wxchar_to_dkchar(
$? ". dk utf-8"
back = dk4recode_utf16_to_utf8(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
$? ". dk ansi"
back = dk4recode_utf16_to_ansi(dptr, dsz, (dk4_c16_t *)sptr, erp);
} break;
@@ -389,7 +513,7 @@ dk4recwx_wxchar_to_dkchar(
$? ". wx utf-8"
back = dk4recode_utf8_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
$? ". wx ansi"
back = dk4recode_ansi_to_c32((dk4_c32_t *)dptr, dsz, sptr, erp);
} break;
@@ -407,7 +531,7 @@ dk4recwx_wxchar_to_dkchar(
$? ". wx utf-8"
back = dk4recode_utf8_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
$? ". wx ansi"
back = dk4recode_ansi_to_utf16((dk4_c16_t *)dptr, dsz, sptr, erp);
} break;
@@ -442,7 +566,11 @@ dk4recwx_wxchar_to_char(
size_t dsz,
int de,
const wxChar *sptr,
+#if DK4_SIZEOF_WXCHAR == 1
int se,
+#else
+ int WXUNUSED(se),
+#endif
dk4_er_t *erp
)
{
@@ -466,7 +594,7 @@ dk4recwx_wxchar_to_char(
case DK4_ENCODING_UTF8 : {
back = dk4str8_cpy_s(dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_ansi_to_utf8(dptr, dsz, sptr, erp);
} break;
default : {
@@ -476,7 +604,7 @@ dk4recwx_wxchar_to_char(
/* --- wxChar 1 --- */
#endif
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
#if DK4_SIZEOF_WXCHAR > 1
#if DK4_SIZEOF_WXCHAR > 2
/* +++ wxChar 4 +++ */
@@ -493,7 +621,7 @@ dk4recwx_wxchar_to_char(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf8_to_ansi(dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4str8_cpy_s(dptr, dsz, sptr, erp);
} break;
default : {
@@ -520,7 +648,7 @@ dk4recwx_wxchar_to_char(
case DK4_ENCODING_UTF8 : {
back = dk4recode_utf8_to_ascii(dptr, dsz, sptr, erp);
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
back = dk4recode_ansi_to_ascii(dptr, dsz, sptr, erp);
} break;
default : {
@@ -537,3 +665,21 @@ dk4recwx_wxchar_to_char(
return back;
}
+
+
+unsigned long
+dk4recwx_wxchar_to_ul(wxChar wxc)
+{
+ unsigned long back;
+#if DK4_SIZEOF_WXCHAR > 1
+#if DK4_SIZEOF_WXCHAR > 2
+ back = (0xFFFFFFFFUL & ((unsigned long)wxc));
+#else
+ back = (0x0000FFFFUL & ((unsigned long)wxc));
+#endif
+#else
+ back = (0x000000FFUL & ((unsigned long)wxc));
+#endif
+ return back;
+}
+
diff --git a/support/dktools/dk4recwx.h b/support/dktools/dk4recwx.h
index ab3e877d5b..09b85ad9a4 100644
--- a/support/dktools/dk4recwx.h
+++ b/support/dktools/dk4recwx.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4recwx.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4recwx.cpt
*/
#ifndef DK4RECWX_H_INCLUDED
@@ -44,28 +22,62 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
#if DK4_SIZEOF_WXCHAR == DK4_CHAR_SIZE
#ifndef DK4STRD_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strd.h"
+#else
+#include <dktools-4/dk4strd.h>
+#endif
#endif
#endif
@@ -79,12 +91,24 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef WX_PRECOMP
#if DK4_HAVE_WX_CHARTYPE_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_CHARTYPE_H_INCLUDED
#include <wx/chartype.h>
#define WX_CHARTYPE_H_INCLUDED 1
#endif
#else
#if DK4_HAVE_WX_WXCHAR_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_WXCHAR_H_INCLUDED
#include <wx/wxchar.h>
#define WX_WXCHAR_H_INCLUDED 1
@@ -102,6 +126,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
extern "C" {
#endif
+/** Convert UTF-8 encoded char string to wxChar.
+ @param dptr Destination buffer pointer.
+ @param dsz Size of destination buffer (number of wxChar).
+ @param sptr Source string pointer.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dptr or sptr is NULL or dsz is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer is too small,
+ - DK4_E_SYNTAX<br>
+ if the source string can not be decoded properly.
+*/
+int
+dk4recwx_utf8_to_wxchar(
+ wxChar *dptr,
+ size_t dsz,
+ const char *sptr,
+ dk4_er_t *erp
+);
+
/** Convert dkChar string to wxChar.
@param dptr Destination buffer pointer.
@param dsz Size of destination buffer (number of wxChar).
@@ -183,6 +230,13 @@ dk4recwx_wxchar_to_char(
dk4_er_t *erp
);
+/** Convert wxChar to unsigned long.
+ @param wxc Character to convert.
+ @return Conversion result.
+*/
+unsigned long
+dk4recwx_wxchar_to_ul(wxChar wxc);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4rld.c b/support/dktools/dk4rld.c
index c1d3756088..4053b16845 100644
--- a/support/dktools/dk4rld.c
+++ b/support/dktools/dk4rld.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rld.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rld.ctr
*/
/** @file dk4rld.c The dk4rld module.
*/
-#line 121 "dk4rld.ctr"
+#line 139 "dk4rld.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4rld.h"
#include "dk4edstm.h"
@@ -47,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 129 "dk4rld.ctr"
+#line 156 "dk4rld.ctr"
@@ -80,7 +67,10 @@ dk4rld_init(dk4_rl_dec_t *dec, dk4_er_t *erp)
{
-#line 160 "dk4rld.ctr"
+#line 187 "dk4rld.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
DK4_MEMRES(dec, sizeof(dk4_rl_dec_t));
dec->oused = 0;
@@ -90,7 +80,7 @@ dk4rld_init(dk4_rl_dec_t *dec, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 168 "dk4rld.ctr"
+#line 198 "dk4rld.ctr"
}
@@ -101,11 +91,14 @@ dk4rld_add(dk4_rl_dec_t *dec, unsigned char inbyte, dk4_er_t *erp)
int back = DK4_EDSTM_ERROR;
-#line 177 "dk4rld.ctr"
+#line 207 "dk4rld.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
switch (dec->st) {
case RLD_ST_EXPECT_KEY_BYTE : {
- if ((unsigned char)128 > inbyte) {
+ if ((unsigned char)128U > inbyte) {
/*
Literal byte sequence
*/
@@ -113,7 +106,7 @@ dk4rld_add(dk4_rl_dec_t *dec, unsigned char inbyte, dk4_er_t *erp)
dec->ll = (size_t)inbyte + 1;
back = DK4_EDSTM_ACCEPT;
} else {
- if ((unsigned char)128 < inbyte) {
+ if ((unsigned char)128U < inbyte) {
/*
Run of equal bytes
*/
@@ -152,7 +145,7 @@ dk4rld_add(dk4_rl_dec_t *dec, unsigned char inbyte, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 226 "dk4rld.ctr"
+#line 259 "dk4rld.ctr"
return back;
}
@@ -164,7 +157,10 @@ dk4rld_finish(dk4_rl_dec_t *dec, dk4_er_t *erp)
int back = DK4_EDSTM_ERROR;
-#line 236 "dk4rld.ctr"
+#line 269 "dk4rld.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
switch (dec->st) {
case RLD_ST_EXPECT_KEY_BYTE : case RLD_ST_EOD_FOUND : {
@@ -178,7 +174,7 @@ dk4rld_finish(dk4_rl_dec_t *dec, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 248 "dk4rld.ctr"
+#line 284 "dk4rld.ctr"
return back;
}
@@ -186,13 +182,21 @@ dk4rld_finish(dk4_rl_dec_t *dec, dk4_er_t *erp)
int
dk4rld_output(
- const unsigned char **dptr, size_t *szptr, dk4_rl_dec_t *dec, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_rl_dec_t const *dec,
+ dk4_er_t *erp
)
{
int back = 0;
-#line 260 "dk4rld.ctr"
+#line 299 "dk4rld.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
if (0 < dec->oused) {
*dptr = &(dec->ob[0]);
@@ -206,7 +210,7 @@ dk4rld_output(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 272 "dk4rld.ctr"
+#line 316 "dk4rld.ctr"
return back;
}
diff --git a/support/dktools/dk4rld.ctr b/support/dktools/dk4rld.ctr
index e981d30119..f49f6b187c 100644
--- a/support/dktools/dk4rld.ctr
+++ b/support/dktools/dk4rld.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -26,7 +26,22 @@ syntax. If the function returns DK4_EDSTM_ERROR, the input data stream
was not properly run-length encoded.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
/** Run length decoder.
*/
@@ -110,7 +125,10 @@ dk4rld_finish(dk4_rl_dec_t *dec, dk4_er_t *erp);
*/
int
dk4rld_output(
- const unsigned char **dptr, size_t *szptr, dk4_rl_dec_t *dec, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_rl_dec_t const *dec,
+ dk4_er_t *erp
);
#ifdef __cplusplus
@@ -119,6 +137,15 @@ dk4rld_output(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4rld.h"
#include "dk4edstm.h"
#include "dk4mem.h"
@@ -157,6 +184,9 @@ void
dk4rld_init(dk4_rl_dec_t *dec, dk4_er_t *erp)
{
$? "+ dk4rld_init"
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
DK4_MEMRES(dec, sizeof(dk4_rl_dec_t));
dec->oused = 0;
@@ -174,10 +204,13 @@ dk4rld_add(dk4_rl_dec_t *dec, unsigned char inbyte, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
$? "+ dk4rld_add"
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
switch (dec->st) {
case RLD_ST_EXPECT_KEY_BYTE : {
- if ((unsigned char)128 > inbyte) {
+ if ((unsigned char)128U > inbyte) {
/*
Literal byte sequence
*/
@@ -185,7 +218,7 @@ dk4rld_add(dk4_rl_dec_t *dec, unsigned char inbyte, dk4_er_t *erp)
dec->ll = (size_t)inbyte + 1;
back = DK4_EDSTM_ACCEPT;
} else {
- if ((unsigned char)128 < inbyte) {
+ if ((unsigned char)128U < inbyte) {
/*
Run of equal bytes
*/
@@ -233,6 +266,9 @@ dk4rld_finish(dk4_rl_dec_t *dec, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
$? "+ dk4rld_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
switch (dec->st) {
case RLD_ST_EXPECT_KEY_BYTE : case RLD_ST_EOD_FOUND : {
@@ -252,11 +288,19 @@ dk4rld_finish(dk4_rl_dec_t *dec, dk4_er_t *erp)
int
dk4rld_output(
- const unsigned char **dptr, size_t *szptr, dk4_rl_dec_t *dec, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_rl_dec_t const *dec,
+ dk4_er_t *erp
)
{
int back = 0;
$? "+ dk4rld_output"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+ assert(NULL != dec);
+#endif
if (NULL != dec) {
if (0 < dec->oused) {
*dptr = &(dec->ob[0]);
diff --git a/support/dktools/dk4rld.h b/support/dktools/dk4rld.h
index 32167f9583..77b87b8942 100644
--- a/support/dktools/dk4rld.h
+++ b/support/dktools/dk4rld.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rld.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rld.ctr
*/
#ifndef DK4RLD_H_INCLUDED
@@ -59,7 +37,22 @@ syntax. If the function returns DK4_EDSTM_ERROR, the input data stream
was not properly run-length encoded.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
/** Run length decoder.
*/
@@ -143,7 +136,10 @@ dk4rld_finish(dk4_rl_dec_t *dec, dk4_er_t *erp);
*/
int
dk4rld_output(
- const unsigned char **dptr, size_t *szptr, dk4_rl_dec_t *dec, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_rl_dec_t const *dec,
+ dk4_er_t *erp
);
#ifdef __cplusplus
diff --git a/support/dktools/dk4rle.c b/support/dktools/dk4rle.c
index 7f4a89b703..72bd2723f9 100644
--- a/support/dktools/dk4rle.c
+++ b/support/dktools/dk4rle.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rle.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rle.ctr
*/
/** @file dk4rle.c The dk4rle module.
*/
-#line 127 "dk4rle.ctr"
+#line 145 "dk4rle.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4rle.h"
#include "dk4edstm.h"
@@ -48,7 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 136 "dk4rle.ctr"
+#line 163 "dk4rle.ctr"
@@ -96,6 +83,9 @@ dk4rle_literal_length_byte(size_t sz)
void
dk4rle_init(dk4_rl_enc_t *enc, int weod, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
enc->ib = &(enc->ob[1]);
enc->oused = 0;
@@ -118,6 +108,9 @@ static
void
dk4rle_process_lwo(dk4_rl_enc_t *enc)
{
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (0 < enc->ao_ss) {
dk4mem_cpy_to_left(
enc->ib,
@@ -140,12 +133,15 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
int cr = 0; /* Flag: Change to run */
-#line 226 "dk4rle.ctr"
+#line 259 "dk4rle.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
if (0 != enc->lwo) { dk4rle_process_lwo(enc); }
-#line 229 "dk4rle.ctr"
+#line 265 "dk4rle.ctr"
back = DK4_EDSTM_ACCEPT;
(enc->ib)[enc->iused] = ibyte;
enc->iused += 1;
@@ -157,7 +153,7 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
if ((enc->ib)[enc->iused - 1] != (enc->ib)[enc->iused - 2]) {
-#line 239 "dk4rle.ctr"
+#line 275 "dk4rle.ctr"
/*
End of run, change to normal mode.
*/
@@ -175,7 +171,7 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
if (128 <= enc->iused) {
-#line 255 "dk4rle.ctr"
+#line 291 "dk4rle.ctr"
/*
Full 128 byte run, output.
*/
@@ -199,7 +195,7 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
if (enc->ib[enc->iused - 1] == enc->ib[enc->iused - 4]) {
cr = 1;
-#line 277 "dk4rle.ctr"
+#line 313 "dk4rle.ctr"
}
}
}
@@ -207,7 +203,7 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
if (1 == cr) {
-#line 283 "dk4rle.ctr"
+#line 319 "dk4rle.ctr"
if (4 < enc->iused) {
enc->ob[0] = dk4rle_literal_length_byte(enc->iused - 4);
enc->oused = (enc->iused - 3);
@@ -224,7 +220,7 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
if ((enc->ib)[127] == (enc->ib)[126]) {
if ((enc->ib)[127] == (enc->ib)[125]) {
-#line 298 "dk4rle.ctr"
+#line 334 "dk4rle.ctr"
enc->ob[0] = dk4rle_literal_length_byte(125);
enc->oused = 126;
back = DK4_EDSTM_FINISHED;
@@ -234,7 +230,7 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
enc->ao_st = RLE_ENC_STATE_NO_RUN;
} else {
-#line 306 "dk4rle.ctr"
+#line 342 "dk4rle.ctr"
enc->ob[0] = dk4rle_literal_length_byte(126);
enc->oused = 127;
back = DK4_EDSTM_FINISHED;
@@ -245,7 +241,7 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
}
} else {
-#line 315 "dk4rle.ctr"
+#line 351 "dk4rle.ctr"
enc->ob[0] = dk4rle_literal_length_byte(128);
enc->oused = 129;
back = DK4_EDSTM_FINISHED;
@@ -261,13 +257,13 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
if (DK4_EDSTM_FINISHED == back) {
enc->lwo = 1;
-#line 329 "dk4rle.ctr"
+#line 365 "dk4rle.ctr"
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 333 "dk4rle.ctr"
+#line 369 "dk4rle.ctr"
return back;
}
@@ -279,17 +275,20 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
int back = DK4_EDSTM_ERROR;
-#line 343 "dk4rle.ctr"
+#line 379 "dk4rle.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
if (0 != enc->lwo) { dk4rle_process_lwo(enc); }
back = DK4_EDSTM_ACCEPT;
if (0 < enc->iused) {
-#line 347 "dk4rle.ctr"
+#line 386 "dk4rle.ctr"
switch (enc->st) {
case RLE_ENC_STATE_RUN : {
-#line 349 "dk4rle.ctr"
+#line 388 "dk4rle.ctr"
enc->ob[0] = dk4rle_run_length_byte(enc->iused);
enc->oused = 2;
back = DK4_EDSTM_FINISHED;
@@ -299,14 +298,14 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
enc->ao_st = RLE_ENC_STATE_NO_RUN;
if (0 != enc->weod) {
-#line 357 "dk4rle.ctr"
+#line 396 "dk4rle.ctr"
enc->ob[2] = (unsigned char)128;
enc->oused = 3;
}
} break;
default : {
-#line 362 "dk4rle.ctr"
+#line 401 "dk4rle.ctr"
enc->ob[0] = dk4rle_literal_length_byte(enc->iused);
enc->oused = enc->iused + 1;
back = DK4_EDSTM_FINISHED;
@@ -316,7 +315,7 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
enc->ao_st = RLE_ENC_STATE_NO_RUN;
if (0 != enc->weod) {
-#line 370 "dk4rle.ctr"
+#line 409 "dk4rle.ctr"
enc->ob[enc->iused] = (unsigned char)128;
enc->oused += 1;
}
@@ -325,7 +324,7 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
} else {
if (0 != enc->weod) {
-#line 377 "dk4rle.ctr"
+#line 416 "dk4rle.ctr"
enc->ob[0] = (unsigned char)128;
enc->oused = 1;
back = DK4_EDSTM_FINISHED;
@@ -342,7 +341,7 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 392 "dk4rle.ctr"
+#line 431 "dk4rle.ctr"
return back;
}
@@ -350,10 +349,18 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
int
dk4rle_output(
- const unsigned char **dptr, size_t *szptr, dk4_rl_enc_t *enc, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_rl_enc_t const *enc,
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+#endif
if ((NULL != enc) && (NULL != dptr) && (NULL != szptr)) {
if (0 < enc->oused) {
*dptr = &(enc->ob[0]);
@@ -479,9 +486,16 @@ dk4rle_output(
#include "dk4mem.h"
#include "dk4memcpl.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 529 "dk4rle.ctr"
+#line 583 "dk4rle.ctr"
/** Run length encoder state.
*/
@@ -500,7 +514,10 @@ dk4rle_init(dk4_rl_enc_t *enc, int weod, dk4_er_t *erp)
{
-#line 546 "dk4rle.ctr"
+#line 600 "dk4rle.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
DK4_MEMRES(enc, sizeof(dk4_rl_enc_t));
enc->st = RLE_ENC_STATE_NO_RUN;
@@ -511,7 +528,7 @@ dk4rle_init(dk4_rl_enc_t *enc, int weod, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 555 "dk4rle.ctr"
+#line 612 "dk4rle.ctr"
}
/** Calculate byte for a run length.
@@ -543,26 +560,29 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
int cr = 0; /* Flag: Change run */
-#line 585 "dk4rle.ctr"
+#line 642 "dk4rle.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
-#line 586 "dk4rle.ctr"
+#line 646 "dk4rle.ctr"
-#line 587 "dk4rle.ctr"
+#line 647 "dk4rle.ctr"
back = DK4_EDSTM_ACCEPT;
-#line 588 "dk4rle.ctr"
+#line 648 "dk4rle.ctr"
enc->ib[enc->iused] = ibyte;
-#line 589 "dk4rle.ctr"
+#line 649 "dk4rle.ctr"
enc->iused += 1;
-#line 590 "dk4rle.ctr"
+#line 650 "dk4rle.ctr"
switch (enc->st) {
case RLE_ENC_STATE_RUN : {
-#line 592 "dk4rle.ctr"
+#line 652 "dk4rle.ctr"
if (enc->ib[enc->iused - 1] != enc->ib[enc->iused - 2]) {
/* Copy data to output buffer.
*/
@@ -610,26 +630,26 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
} break;
default : {
-#line 638 "dk4rle.ctr"
+#line 698 "dk4rle.ctr"
if (4 <= enc->iused) {
-#line 639 "dk4rle.ctr"
+#line 699 "dk4rle.ctr"
if (enc->ib[enc->iused - 1] == enc->ib[enc->iused - 2]) {
-#line 640 "dk4rle.ctr"
+#line 700 "dk4rle.ctr"
if (enc->ib[enc->iused - 1] == enc->ib[enc->iused - 3]) {
-#line 641 "dk4rle.ctr"
+#line 701 "dk4rle.ctr"
if (enc->ib[enc->iused - 1] == enc->ib[enc->iused - 4]) {
-#line 642 "dk4rle.ctr"
+#line 702 "dk4rle.ctr"
cr = 1;
}
}
}
if (1 == cr) {
-#line 647 "dk4rle.ctr"
+#line 707 "dk4rle.ctr"
/*
Start of run.
*/
@@ -661,7 +681,7 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
enc->st = RLE_ENC_STATE_RUN;
} else {
-#line 677 "dk4rle.ctr"
+#line 737 "dk4rle.ctr"
if (128 <= enc->iused) {
if (enc->ib[enc->iused - 1] == enc->ib[enc->iused - 2]) {
if (enc->ib[enc->iused - 1] == enc->ib[enc->iused - 3]) {
@@ -736,11 +756,11 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
}
} else {
-#line 750 "dk4rle.ctr"
+#line 810 "dk4rle.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 752 "dk4rle.ctr"
+#line 812 "dk4rle.ctr"
return back;
}
@@ -750,7 +770,10 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
int back = DK4_EDSTM_ERROR;
-#line 760 "dk4rle.ctr"
+#line 820 "dk4rle.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
back = DK4_EDSTM_ACCEPT;
if (0 < enc->iused) {
@@ -804,7 +827,7 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 812 "dk4rle.ctr"
+#line 875 "dk4rle.ctr"
return back;
}
@@ -816,7 +839,12 @@ dk4rle_output(
int back = 0;
-#line 822 "dk4rle.ctr"
+#line 885 "dk4rle.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+#endif
if (NULL != enc) {
if (0 < enc->oused) {
*dptr = &(enc->ob[0]);
@@ -827,7 +855,7 @@ dk4rle_output(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 831 "dk4rle.ctr"
+#line 899 "dk4rle.ctr"
return back;
}
/* ---------------------------- */
diff --git a/support/dktools/dk4rle.ctr b/support/dktools/dk4rle.ctr
index ece71c3140..5d4aa3fb61 100644
--- a/support/dktools/dk4rle.ctr
+++ b/support/dktools/dk4rle.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -25,7 +25,22 @@ If the function returns DK4_EDSTM_FINISHED, use dk4rle_output() to retrieve
the final output data.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
/** Run-length encoder.
*/
@@ -114,7 +129,10 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp);
*/
int
dk4rle_output(
- const unsigned char **dptr, size_t *szptr, dk4_rl_enc_t *enc, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_rl_enc_t const *enc,
+ dk4_er_t *erp
);
#ifdef __cplusplus
@@ -125,6 +143,15 @@ dk4rle_output(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4rle.h"
#include "dk4edstm.h"
#include "dk4mem.h"
@@ -180,6 +207,9 @@ dk4rle_literal_length_byte(size_t sz)
void
dk4rle_init(dk4_rl_enc_t *enc, int weod, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
enc->ib = &(enc->ob[1]);
enc->oused = 0;
@@ -202,6 +232,9 @@ static
void
dk4rle_process_lwo(dk4_rl_enc_t *enc)
{
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (0 < enc->ao_ss) {
dk4mem_cpy_to_left(
enc->ib,
@@ -223,6 +256,9 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
int back = DK4_EDSTM_ERROR;
int cr = 0; /* Flag: Change to run */
$? "+ dk4rle_add %02x", (unsigned)ibyte
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
if (0 != enc->lwo) { dk4rle_process_lwo(enc); }
$? ". index = %u", (unsigned)(enc->iused)
@@ -340,6 +376,9 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
$? "+ dk4rle_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
if (0 != enc->lwo) { dk4rle_process_lwo(enc); }
back = DK4_EDSTM_ACCEPT;
@@ -396,10 +435,18 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
int
dk4rle_output(
- const unsigned char **dptr, size_t *szptr, dk4_rl_enc_t *enc, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_rl_enc_t const *enc,
+ dk4_er_t *erp
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+#endif
if ((NULL != enc) && (NULL != dptr) && (NULL != szptr)) {
if (0 < enc->oused) {
*dptr = &(enc->ob[0]);
@@ -525,6 +572,13 @@ dk4rle_output(
#include "dk4mem.h"
#include "dk4memcpl.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
/** Run length encoder state.
@@ -543,6 +597,9 @@ void
dk4rle_init(dk4_rl_enc_t *enc, int weod, dk4_er_t *erp)
{
$? "+ dk4rle_init"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
DK4_MEMRES(enc, sizeof(dk4_rl_enc_t));
enc->st = RLE_ENC_STATE_NO_RUN;
@@ -582,6 +639,9 @@ dk4rle_add(dk4_rl_enc_t *enc, unsigned char ibyte, dk4_er_t *erp)
int back = DK4_EDSTM_ERROR;
int cr = 0; /* Flag: Change run */
$? "+ dk4rle_add"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) { $? ". enc"
$? ". iused = %u", (unsigned)(enc->iused)
back = DK4_EDSTM_ACCEPT; $? ". back"
@@ -757,6 +817,9 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp)
{
int back = DK4_EDSTM_ERROR;
$? "+ dk4rle_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+#endif
if (NULL != enc) {
back = DK4_EDSTM_ACCEPT;
if (0 < enc->iused) {
@@ -819,6 +882,11 @@ dk4rle_output(
{
int back = 0;
$? "+ dk4rle_output"
+#if DK4_USE_ASSERT
+ assert(NULL != enc);
+ assert(NULL != dptr);
+ assert(NULL != szptr);
+#endif
if (NULL != enc) {
if (0 < enc->oused) {
*dptr = &(enc->ob[0]);
diff --git a/support/dktools/dk4rle.h b/support/dktools/dk4rle.h
index 770ad0807b..0c5ae02fd0 100644
--- a/support/dktools/dk4rle.h
+++ b/support/dktools/dk4rle.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4rle.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4rle.ctr
*/
#ifndef DK4RLE_H_INCLUDED
@@ -57,7 +35,22 @@ If the function returns DK4_EDSTM_FINISHED, use dk4rle_output() to retrieve
the final output data.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
/** Run-length encoder.
*/
@@ -146,7 +139,10 @@ dk4rle_finish(dk4_rl_enc_t *enc, dk4_er_t *erp);
*/
int
dk4rle_output(
- const unsigned char **dptr, size_t *szptr, dk4_rl_enc_t *enc, dk4_er_t *erp
+ const unsigned char **dptr,
+ size_t *szptr,
+ dk4_rl_enc_t const *enc,
+ dk4_er_t *erp
);
#ifdef __cplusplus
diff --git a/support/dktools/dk4serf.c b/support/dktools/dk4serf.c
index 8f91d08db6..4fb856bf74 100644
--- a/support/dktools/dk4serf.c
+++ b/support/dktools/dk4serf.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4serf.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4serf.ctr
*/
/** @file dk4serf.c The dk4serf module.
*/
-#line 147 "dk4serf.ctr"
+#line 159 "dk4serf.ctr"
#include "dk4conf.h"
@@ -65,10 +43,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4rec12.h"
#include "dk4rec18.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 176 "dk4serf.ctr"
+#line 194 "dk4serf.ctr"
@@ -77,7 +61,11 @@ dk4serialize_file_uint16_t(FILE *fipo, uint16_t u, dk4_er_t *erp)
{
unsigned char uc[4];
int back = 0;
- if ((NULL != fipo) && (DK4_U16_MAX >= u)) {
+
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ if (NULL != fipo) {
uc[0] = (unsigned char)((u >> 8) & 0x00FFU);
uc[1] = (unsigned char)(u & 0x00FFU);
errno = 0;
@@ -99,7 +87,11 @@ dk4serialize_file_int16_t(FILE *fipo, int16_t i, dk4_er_t *erp)
{
unsigned char uc[4];
int back = 0;
- if ((NULL != fipo) && (DK4_I16_MAX >= i) && (DK4_I16_MIN <= i)) {
+
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ if (NULL != fipo) {
uc[0] = (unsigned char)((((uint16_t)i) >> 8) & 0x00FFU);
uc[1] = (unsigned char)(((uint16_t)i) & 0x00FFU);
errno = 0;
@@ -121,6 +113,10 @@ dk4serialize_file_uint32_t(FILE *fipo, uint32_t u, dk4_er_t *erp)
{
unsigned char uc[4];
int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if ((NULL != fipo) && (DK4_U32_MAX >= u)) {
uc[0] = (unsigned char)((u >> 24) & 0x000000FFUL);
uc[1] = (unsigned char)((u >> 16) & 0x000000FFUL);
@@ -145,6 +141,10 @@ dk4serialize_file_int32_t(FILE *fipo, int32_t i, dk4_er_t *erp)
{
unsigned char uc[4];
int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if ((NULL != fipo) && (DK4_I32_MAX >= i) && (DK4_I32_MIN <= i)) {
uc[0] = (unsigned char)((((uint32_t)i) >> 24) & 0x000000FFUL);
uc[1] = (unsigned char)((((uint32_t)i) >> 16) & 0x000000FFUL);
@@ -172,6 +172,10 @@ dk4serialize_file_utf8_string(FILE *fipo, const char *str, dk4_er_t *erp)
int back = 0;
uint16_t usz;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != str);
+#endif
if ((NULL != fipo) && (NULL != str)) {
sz = strlen(str);
dk4error_init(&er);
@@ -210,6 +214,9 @@ dk4serialize_file_double(FILE *fipo, double d, dk4_er_t *erp)
char buffer[2 * DK4_DBL_DIGITS];
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
if (0 != dk4ma_write_c8_double(buffer, sizeof(buffer), d, 1, 1, erp)) {
back = dk4serialize_file_utf8_string(fipo, buffer, erp);
@@ -228,6 +235,10 @@ dk4serialize_file_dk_string(FILE *fipo,const dkChar *str,int de,dk4_er_t *erp)
char *tmpbuf = NULL;
size_t szbuf = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+ assert(NULL != fipo);
+#endif
if ((NULL != fipo) && (NULL != str)) {
switch (de) {
#if DK4_CHAR_SIZE > 1
@@ -259,7 +270,7 @@ dk4serialize_file_dk_string(FILE *fipo,const dkChar *str,int de,dk4_er_t *erp)
} break;
#endif
#else
- case DK4_ENCODING_ASCII : {
+ case DK4_ENCODING_PLAIN : {
szbuf = dk4recode_size_ascii_to_utf8(str, erp);
if (0 < szbuf) {
tmpbuf = dk4mem_new(char,szbuf,erp);
@@ -271,7 +282,7 @@ dk4serialize_file_dk_string(FILE *fipo,const dkChar *str,int de,dk4_er_t *erp)
}
}
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
szbuf = dk4recode_size_ansi_to_utf8(str, erp);
if (0 < szbuf) {
tmpbuf = dk4mem_new(char,szbuf,erp);
diff --git a/support/dktools/dk4serf.ctr b/support/dktools/dk4serf.ctr
index 3b7f444e2c..7b2e062309 100644
--- a/support/dktools/dk4serf.ctr
+++ b/support/dktools/dk4serf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,15 +11,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -171,6 +183,12 @@ dk4serialize_file_double(FILE *fipo, double d, dk4_er_t *erp);
#include "dk4rec12.h"
#include "dk4rec18.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -181,7 +199,11 @@ dk4serialize_file_uint16_t(FILE *fipo, uint16_t u, dk4_er_t *erp)
{
unsigned char uc[4];
int back = 0;
- if ((NULL != fipo) && (DK4_U16_MAX >= u)) {
+
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ if (NULL != fipo) {
uc[0] = (unsigned char)((u >> 8) & 0x00FFU);
uc[1] = (unsigned char)(u & 0x00FFU);
errno = 0;
@@ -203,7 +225,11 @@ dk4serialize_file_int16_t(FILE *fipo, int16_t i, dk4_er_t *erp)
{
unsigned char uc[4];
int back = 0;
- if ((NULL != fipo) && (DK4_I16_MAX >= i) && (DK4_I16_MIN <= i)) {
+
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
+ if (NULL != fipo) {
uc[0] = (unsigned char)((((uint16_t)i) >> 8) & 0x00FFU);
uc[1] = (unsigned char)(((uint16_t)i) & 0x00FFU);
errno = 0;
@@ -225,6 +251,10 @@ dk4serialize_file_uint32_t(FILE *fipo, uint32_t u, dk4_er_t *erp)
{
unsigned char uc[4];
int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if ((NULL != fipo) && (DK4_U32_MAX >= u)) {
uc[0] = (unsigned char)((u >> 24) & 0x000000FFUL);
uc[1] = (unsigned char)((u >> 16) & 0x000000FFUL);
@@ -249,6 +279,10 @@ dk4serialize_file_int32_t(FILE *fipo, int32_t i, dk4_er_t *erp)
{
unsigned char uc[4];
int back = 0;
+
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if ((NULL != fipo) && (DK4_I32_MAX >= i) && (DK4_I32_MIN <= i)) {
uc[0] = (unsigned char)((((uint32_t)i) >> 24) & 0x000000FFUL);
uc[1] = (unsigned char)((((uint32_t)i) >> 16) & 0x000000FFUL);
@@ -276,6 +310,10 @@ dk4serialize_file_utf8_string(FILE *fipo, const char *str, dk4_er_t *erp)
int back = 0;
uint16_t usz;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+ assert(NULL != str);
+#endif
if ((NULL != fipo) && (NULL != str)) {
sz = strlen(str);
dk4error_init(&er);
@@ -314,6 +352,9 @@ dk4serialize_file_double(FILE *fipo, double d, dk4_er_t *erp)
char buffer[2 * DK4_DBL_DIGITS];
#endif
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
if (0 != dk4ma_write_c8_double(buffer, sizeof(buffer), d, 1, 1, erp)) {
back = dk4serialize_file_utf8_string(fipo, buffer, erp);
@@ -332,6 +373,10 @@ dk4serialize_file_dk_string(FILE *fipo,const dkChar *str,int de,dk4_er_t *erp)
char *tmpbuf = NULL;
size_t szbuf = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+ assert(NULL != fipo);
+#endif
if ((NULL != fipo) && (NULL != str)) {
switch (de) {
#if DK4_CHAR_SIZE > 1
@@ -363,7 +408,7 @@ dk4serialize_file_dk_string(FILE *fipo,const dkChar *str,int de,dk4_er_t *erp)
} break;
#endif
#else
- case DK4_ENCODING_ASCII : {
+ case DK4_ENCODING_PLAIN : {
szbuf = dk4recode_size_ascii_to_utf8(str, erp);
if (0 < szbuf) {
tmpbuf = dk4mem_new(char,szbuf,erp);
@@ -375,7 +420,7 @@ dk4serialize_file_dk_string(FILE *fipo,const dkChar *str,int de,dk4_er_t *erp)
}
}
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
szbuf = dk4recode_size_ansi_to_utf8(str, erp);
if (0 < szbuf) {
tmpbuf = dk4mem_new(char,szbuf,erp);
diff --git a/support/dktools/dk4serf.h b/support/dktools/dk4serf.h
index 6ba897037d..1ecc862e14 100644
--- a/support/dktools/dk4serf.h
+++ b/support/dktools/dk4serf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4serf.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4serf.ctr
*/
#ifndef DK4SERF_H_INCLUDED
@@ -44,15 +22,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
diff --git a/support/dktools/dk4sock.h b/support/dktools/dk4sock.h
index 91ba45fe17..8a920723b7 100644
--- a/support/dktools/dk4sock.h
+++ b/support/dktools/dk4sock.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4SOCK_H_INCLUDED
/** Protection against multiple inclusions. */
#define DK4SOCK_H_INCLUDED 1
@@ -24,7 +29,14 @@ functions are used to hide this difference.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
@@ -110,11 +122,19 @@ typedef int dk4_socket_t;
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4sock01.c b/support/dktools/dk4sock01.c
index e49a0b9089..e5dee57dd8 100644
--- a/support/dktools/dk4sock01.c
+++ b/support/dktools/dk4sock01.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock01.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock01.ctr
*/
/** @file dk4sock01.c The dk4sock01 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock01.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#if DK4_HAVE_ERRNO_H
@@ -48,11 +27,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#include "dk4unused.h"
-#line 23 "dk4sock01.ctr"
+
+#line 26 "dk4sock01.ctr"
@@ -100,7 +81,17 @@ dk4socket_error_report(dk4_er_t *erp, int ec)
void
-dk4socket_debug_address(const char *text, struct sockaddr *addr, size_t sz)
+dk4socket_debug_address(
+#if TRACE_DEBUG
+ const char *text,
+ struct sockaddr *addr,
+ size_t sz
+#else
+ const char * DK4_ARG_UNUSED(text),
+ struct sockaddr * DK4_ARG_UNUSED(addr),
+ size_t DK4_ARG_UNUSED(sz)
+#endif
+)
{
#if TRACE_DEBUG
FILE *fipo;
@@ -142,6 +133,10 @@ dk4socket_debug_address(const char *text, struct sockaddr *addr, size_t sz)
} break;
}
}
+#else
+ DK4_UNUSED_ARG(text)
+ DK4_UNUSED_ARG(addr)
+ DK4_UNUSED_ARG(sz)
#endif
}
@@ -158,7 +153,7 @@ dk4socket_non_null_getsockopt(int optval, socklen_t slo)
int back = 0;
-#line 127 "dk4sock01.ctr"
+#line 144 "dk4sock01.ctr"
max = sizeof(int);
if (slo < max) { max = slo; }
ptr = (unsigned char *)(&optval);
@@ -169,7 +164,7 @@ dk4socket_non_null_getsockopt(int optval, socklen_t slo)
}
-#line 136 "dk4sock01.ctr"
+#line 153 "dk4sock01.ctr"
return back;
}
diff --git a/support/dktools/dk4sock01.ctr b/support/dktools/dk4sock01.ctr
index 8811430e69..e7197437a5 100644
--- a/support/dktools/dk4sock01.ctr
+++ b/support/dktools/dk4sock01.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#if DK4_HAVE_ERRNO_H
@@ -17,6 +18,8 @@ license = bsd
#endif
#endif
+#include "dk4unused.h"
+
$!trace-include
@@ -67,7 +70,17 @@ dk4socket_error_report(dk4_er_t *erp, int ec)
void
-dk4socket_debug_address(const char *text, struct sockaddr *addr, size_t sz)
+dk4socket_debug_address(
+#if TRACE_DEBUG
+ const char *text,
+ struct sockaddr *addr,
+ size_t sz
+#else
+ const char * DK4_ARG_UNUSED(text),
+ struct sockaddr * DK4_ARG_UNUSED(addr),
+ size_t DK4_ARG_UNUSED(sz)
+#endif
+)
{
#if TRACE_DEBUG
FILE *fipo;
@@ -109,6 +122,10 @@ dk4socket_debug_address(const char *text, struct sockaddr *addr, size_t sz)
} break;
}
}
+#else
+ DK4_UNUSED_ARG(text)
+ DK4_UNUSED_ARG(addr)
+ DK4_UNUSED_ARG(sz)
#endif
}
diff --git a/support/dktools/dk4sock02.c b/support/dktools/dk4sock02.c
index a33a52c729..ba964127aa 100644
--- a/support/dktools/dk4sock02.c
+++ b/support/dktools/dk4sock02.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock02.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock02.ctr
*/
@@ -39,6 +17,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dk4sock01.c Conversion between host and net representation.
*/
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4types.h"
#include "dk4error.h"
#include "dk4sock.h"
@@ -190,6 +177,9 @@ dk4socket_mask_bits(unsigned long *dptr, size_t sz, dk4_er_t *erp)
unsigned long res = 0UL;
unsigned long val = 0x80000000UL;
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((0 < sz) && (33 > sz)) {
while (0 < sz--) {
@@ -219,7 +209,9 @@ dk4socket_mask6_bits(struct in6_addr *inp, size_t sz, dk4_er_t *erp)
size_t j = 0;
unsigned char rchr = 0x00;
unsigned char vchr = 0x80;
-
+#if DK4_USE_ASSERT
+ assert(NULL != inp);
+#endif
if (NULL != inp) {
for (i = 0; i < 16; i++) { inp->s6_addr[i] = 0xFF; }
if ((0 < sz) && (129 > sz)) {
@@ -253,7 +245,11 @@ void
dk4socket_set_one_bytes(void *ptr, size_t nbytes)
{
unsigned char *cptr;
- cptr = ptr;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(0 < nbytes);
+#endif
+ cptr = (unsigned char *)ptr;
while (0 < nbytes--) { *(cptr++) = 0x01; }
}
@@ -265,6 +261,9 @@ size_t
dk4socket_unix_length(const struct sockaddr_un *sock)
{
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != sock);
+#endif
if (NULL != sock) {
#ifdef SUN_LEN
back = SUN_LEN(sock);
@@ -426,6 +425,10 @@ int
dk4socket_correct_addr_lgt(const struct sockaddr *soa, size_t *plgt)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != soa);
+ assert(NULL != plgt);
+#endif
if ((NULL != soa) && (NULL != plgt)) {
back = 1;
switch (soa->sa_family) {
diff --git a/support/dktools/dk4sock02.ctr b/support/dktools/dk4sock02.ctr
index 8e39a7dc7b..04073c37f1 100644
--- a/support/dktools/dk4sock02.ctr
+++ b/support/dktools/dk4sock02.ctr
@@ -2,13 +2,22 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
/** @file dk4sock01.c Conversion between host and net representation.
*/
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4types.h"
#include "dk4error.h"
#include "dk4sock.h"
@@ -160,6 +169,9 @@ dk4socket_mask_bits(unsigned long *dptr, size_t sz, dk4_er_t *erp)
unsigned long res = 0UL;
unsigned long val = 0x80000000UL;
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+#endif
if (NULL != dptr) {
if ((0 < sz) && (33 > sz)) {
while (0 < sz--) {
@@ -189,7 +201,9 @@ dk4socket_mask6_bits(struct in6_addr *inp, size_t sz, dk4_er_t *erp)
size_t j = 0;
unsigned char rchr = 0x00;
unsigned char vchr = 0x80;
-
+#if DK4_USE_ASSERT
+ assert(NULL != inp);
+#endif
if (NULL != inp) {
for (i = 0; i < 16; i++) { inp->s6_addr[i] = 0xFF; }
if ((0 < sz) && (129 > sz)) {
@@ -223,7 +237,11 @@ void
dk4socket_set_one_bytes(void *ptr, size_t nbytes)
{
unsigned char *cptr;
- cptr = ptr;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+ assert(0 < nbytes);
+#endif
+ cptr = (unsigned char *)ptr;
while (0 < nbytes--) { *(cptr++) = 0x01; }
}
@@ -235,6 +253,9 @@ size_t
dk4socket_unix_length(const struct sockaddr_un *sock)
{
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != sock);
+#endif
if (NULL != sock) {
#ifdef SUN_LEN
back = SUN_LEN(sock);
@@ -396,6 +417,10 @@ int
dk4socket_correct_addr_lgt(const struct sockaddr *soa, size_t *plgt)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != soa);
+ assert(NULL != plgt);
+#endif
if ((NULL != soa) && (NULL != plgt)) {
back = 1;
switch (soa->sa_family) {
diff --git a/support/dktools/dk4sock03.c b/support/dktools/dk4sock03.c
index 97696625f5..e0b3356823 100644
--- a/support/dktools/dk4sock03.c
+++ b/support/dktools/dk4sock03.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock03.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock03.ctr
*/
/** @file dk4sock03.c The dk4sock03 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock03.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
#include "dk4str8.h"
@@ -47,11 +26,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mao8h.h"
#include "dk4rec23.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 22 "dk4sock03.ctr"
+#line 31 "dk4sock03.ctr"
@@ -70,7 +57,7 @@ static const char * const dk4socket_c8_kw[] = {
NULL
-#line 42 "dk4sock03.ctr"
+#line 51 "dk4sock03.ctr"
};
@@ -92,7 +79,10 @@ dk4socket_c8_inet_ntop(
#endif
struct in_addr in4; /* IPv4 host address */
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
dk4socket_error_reset();
@@ -127,6 +117,10 @@ dk4socket_c8_inet_ntop(
#else
/* +++++ +inet_ntop -Windows */
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
if (NULL != inet_ntop(afam, src, dptr, dsz)) {
@@ -157,7 +151,10 @@ dk4socket_c8_inet_ntop(
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
unsigned short us;
#endif
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
switch (afam) {
@@ -264,7 +261,11 @@ int
dk4socket_c8_addr_port_to_text(
char *dptr,
size_t dsz,
+#if DK4_HAVE_GETNAMEINFO
+ int DK4_ARG_UNUSED(afam),
+#else
int afam,
+#endif
const struct sockaddr *saptr,
size_t sasz,
dk4_er_t *erp
@@ -278,7 +279,14 @@ dk4socket_c8_addr_port_to_text(
int back = DK4_SOCKET_RESULT_FAILED;
-#line 248 "dk4sock03.ctr"
+#line 271 "dk4sock03.ctr"
+ DK4_UNUSED_ARG(afam)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz) && (0 < sasz)) {
res = NI_NUMERICHOST | NI_NUMERICSERV;
@@ -297,28 +305,28 @@ dk4socket_c8_addr_port_to_text(
back = DK4_SOCKET_RESULT_SUCCESS;
} else {
-#line 265 "dk4sock03.ctr"
+#line 295 "dk4sock03.ctr"
}
} else {
-#line 267 "dk4sock03.ctr"
+#line 297 "dk4sock03.ctr"
}
} else {
-#line 269 "dk4sock03.ctr"
+#line 299 "dk4sock03.ctr"
}
} else {
-#line 271 "dk4sock03.ctr"
+#line 301 "dk4sock03.ctr"
dk4error_set_idetails(erp, DK4_E_SOCKET_GETADDRINFO, res);
}
} else {
-#line 274 "dk4sock03.ctr"
+#line 304 "dk4sock03.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 276 "dk4sock03.ctr"
+#line 306 "dk4sock03.ctr"
return back;
/* ----- +getnameinfo */
#else
@@ -335,7 +343,13 @@ dk4socket_c8_addr_port_to_text(
unsigned short us;
-#line 291 "dk4sock03.ctr"
+#line 321 "dk4sock03.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz) && (0 < sasz)) {
switch (afam) {
@@ -390,7 +404,7 @@ dk4socket_c8_addr_port_to_text(
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 344 "dk4sock03.ctr"
+#line 380 "dk4sock03.ctr"
return back;
/* ----- -getnameinfo */
#endif
@@ -409,6 +423,11 @@ dk4socket_c8_sockaddr_to_text(
const struct sockaddr *soa;
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz)) {
soa = (const struct sockaddr *)saptr;
switch (soa->sa_family) {
diff --git a/support/dktools/dk4sock03.ctr b/support/dktools/dk4sock03.ctr
index 9a36f71799..e88b8e98cb 100644
--- a/support/dktools/dk4sock03.ctr
+++ b/support/dktools/dk4sock03.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
#include "dk4str8.h"
@@ -16,6 +17,14 @@ license = bsd
#include "dk4mao8h.h"
#include "dk4rec23.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -60,7 +69,10 @@ dk4socket_c8_inet_ntop(
#endif
struct in_addr in4; /* IPv4 host address */
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
dk4socket_error_reset();
@@ -95,6 +107,10 @@ dk4socket_c8_inet_ntop(
#else
/* +++++ +inet_ntop -Windows */
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
if (NULL != inet_ntop(afam, src, dptr, dsz)) {
@@ -125,7 +141,10 @@ dk4socket_c8_inet_ntop(
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
unsigned short us;
#endif
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
switch (afam) {
@@ -232,7 +251,11 @@ int
dk4socket_c8_addr_port_to_text(
char *dptr,
size_t dsz,
+#if DK4_HAVE_GETNAMEINFO
+ int DK4_ARG_UNUSED(afam),
+#else
int afam,
+#endif
const struct sockaddr *saptr,
size_t sasz,
dk4_er_t *erp
@@ -245,6 +268,13 @@ dk4socket_c8_addr_port_to_text(
int res; /* Operation result */
int back = DK4_SOCKET_RESULT_FAILED;
$? "+ dk4socket_c8_addr_port_to_text (+getnameinfo)"
+ DK4_UNUSED_ARG(afam)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz) && (0 < sasz)) {
res = NI_NUMERICHOST | NI_NUMERICSERV;
@@ -288,6 +318,12 @@ dk4socket_c8_addr_port_to_text(
int res;
unsigned short us;
$? "+ dk4socket_c8_addr_port_to_text (-getnameinfo)"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz) && (0 < sasz)) {
switch (afam) {
@@ -359,6 +395,11 @@ dk4socket_c8_sockaddr_to_text(
const struct sockaddr *soa;
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz)) {
soa = (const struct sockaddr *)saptr;
switch (soa->sa_family) {
diff --git a/support/dktools/dk4sock04.c b/support/dktools/dk4sock04.c
index 653125b4fd..7a162f41b1 100644
--- a/support/dktools/dk4sock04.c
+++ b/support/dktools/dk4sock04.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk4sock04.ctr
@@ -9,8 +15,9 @@
*/
-#line 6 "dk4sock04.ctr"
+#line 8 "dk4sock04.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
#include "dk4strw.h"
@@ -19,14 +26,22 @@
#include "dk4maowh.h"
#include "dk4rec23.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 18 "dk4sock04.ctr"
+#line 29 "dk4sock04.ctr"
+#if DK4_ON_WINDOWS
/** Constant texts used by the module, not localized.
*/
static const wchar_t * const dk4socket_wc_kw[] = {
@@ -42,16 +57,25 @@ L":",
NULL
-#line 38 "dk4sock04.ctr"
+#line 49 "dk4sock04.ctr"
};
+#endif
+
int
dk4socket_wc_inet_ntop(
+#if DK4_ON_WINDOWS
wchar_t *dptr,
size_t dsz,
int afam,
const void *src,
+#else
+ wchar_t * DK4_ARG_UNUSED(dptr),
+ size_t DK4_ARG_UNUSED(dsz),
+ int DK4_ARG_UNUSED(afam),
+ const void * DK4_ARG_UNUSED(src),
+#endif
dk4_er_t *erp
)
{
@@ -63,6 +87,12 @@ dk4socket_wc_inet_ntop(
#endif
struct in_addr in4;
int back = DK4_SOCKET_RESULT_FAILED;
+
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != src);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = L'\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
dk4socket_error_reset();
@@ -111,7 +141,11 @@ dk4socket_wc_inet_ntop(
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
unsigned short us;
#endif
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != src);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = L'\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
switch (afam) {
@@ -211,6 +245,10 @@ dk4socket_wc_inet_ntop(
/* ----- +Windows -inet_ntop */
#endif
#else
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(dsz)
+ DK4_UNUSED_ARG(afam)
+ DK4_UNUSED_ARG(src)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return DK4_SOCKET_RESULT_FAILED;
#endif
@@ -220,11 +258,23 @@ dk4socket_wc_inet_ntop(
int
dk4socket_wc_addr_port_to_text(
+#if DK4_ON_WINDOWS
wchar_t *dptr,
size_t dsz,
+#if DK4_HAVE_GETNAMEINFO
+ int DK4_ARG_UNUSED(afam),
+#else
int afam,
+#endif
const struct sockaddr *saptr,
size_t sasz,
+#else
+ wchar_t * DK4_ARG_UNUSED(dptr),
+ size_t DK4_ARG_UNUSED(dsz),
+ int DK4_ARG_UNUSED(afam),
+ const struct sockaddr * DK4_ARG_UNUSED(saptr),
+ size_t DK4_ARG_UNUSED(sasz),
+#endif
dk4_er_t *erp
)
{
@@ -237,6 +287,13 @@ dk4socket_wc_addr_port_to_text(
const DWORD szp = DK4_SIZEOF(pbuf,wchar_t);
int back = DK4_SOCKET_RESULT_FAILED;
int res;
+ DK4_UNUSED_ARG(afam)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz) && (0 < sasz)) {
res = NI_NUMERICHOST | NI_NUMERICSERV;
@@ -274,6 +331,12 @@ dk4socket_wc_addr_port_to_text(
int hpah = 0;
int res;
unsigned short us;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = L'\0'; }
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz) && (0 < sasz)) {
switch (afam) {
@@ -331,6 +394,11 @@ dk4socket_wc_addr_port_to_text(
/* ----- -getnameinfo */
#endif
#else
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(dsz)
+ DK4_UNUSED_ARG(afam)
+ DK4_UNUSED_ARG(saptr)
+ DK4_UNUSED_ARG(sasz)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return DK4_SOCKET_RESULT_FAILED;
#endif
@@ -348,7 +416,11 @@ dk4socket_wc_sockaddr_to_text(
{
const struct sockaddr *soa;
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz)) {
soa = (const struct sockaddr *)saptr;
switch (soa->sa_family) {
diff --git a/support/dktools/dk4sock04.ctr b/support/dktools/dk4sock04.ctr
index fdc9799775..3d4a920e89 100644
--- a/support/dktools/dk4sock04.ctr
+++ b/support/dktools/dk4sock04.ctr
@@ -1,9 +1,12 @@
%% options
-
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
#include "dk4strw.h"
@@ -12,12 +15,20 @@
#include "dk4maowh.h"
#include "dk4rec23.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-$!trace-include
+$!trace-include
+#if DK4_ON_WINDOWS
/** Constant texts used by the module, not localized.
*/
static const wchar_t * const dk4socket_wc_kw[] = {
@@ -36,14 +47,23 @@ $!string-table prefix=L
:
$!end
};
+#endif
+
int
dk4socket_wc_inet_ntop(
+#if DK4_ON_WINDOWS
wchar_t *dptr,
size_t dsz,
int afam,
const void *src,
+#else
+ wchar_t * DK4_ARG_UNUSED(dptr),
+ size_t DK4_ARG_UNUSED(dsz),
+ int DK4_ARG_UNUSED(afam),
+ const void * DK4_ARG_UNUSED(src),
+#endif
dk4_er_t *erp
)
{
@@ -55,6 +75,12 @@ dk4socket_wc_inet_ntop(
#endif
struct in_addr in4;
int back = DK4_SOCKET_RESULT_FAILED;
+
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != src);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = L'\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
dk4socket_error_reset();
@@ -103,7 +129,11 @@ dk4socket_wc_inet_ntop(
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
unsigned short us;
#endif
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != src);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = L'\0'; }
if ((NULL != dptr) && (NULL != src) && (0 < dsz)) {
switch (afam) {
@@ -203,6 +233,10 @@ dk4socket_wc_inet_ntop(
/* ----- +Windows -inet_ntop */
#endif
#else
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(dsz)
+ DK4_UNUSED_ARG(afam)
+ DK4_UNUSED_ARG(src)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return DK4_SOCKET_RESULT_FAILED;
#endif
@@ -212,11 +246,23 @@ dk4socket_wc_inet_ntop(
int
dk4socket_wc_addr_port_to_text(
+#if DK4_ON_WINDOWS
wchar_t *dptr,
size_t dsz,
+#if DK4_HAVE_GETNAMEINFO
+ int DK4_ARG_UNUSED(afam),
+#else
int afam,
+#endif
const struct sockaddr *saptr,
size_t sasz,
+#else
+ wchar_t * DK4_ARG_UNUSED(dptr),
+ size_t DK4_ARG_UNUSED(dsz),
+ int DK4_ARG_UNUSED(afam),
+ const struct sockaddr * DK4_ARG_UNUSED(saptr),
+ size_t DK4_ARG_UNUSED(sasz),
+#endif
dk4_er_t *erp
)
{
@@ -229,6 +275,13 @@ dk4socket_wc_addr_port_to_text(
const DWORD szp = DK4_SIZEOF(pbuf,wchar_t);
int back = DK4_SOCKET_RESULT_FAILED;
int res;
+ DK4_UNUSED_ARG(afam)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz) && (0 < sasz)) {
res = NI_NUMERICHOST | NI_NUMERICSERV;
@@ -266,6 +319,12 @@ dk4socket_wc_addr_port_to_text(
int hpah = 0;
int res;
unsigned short us;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = L'\0'; }
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz) && (0 < sasz)) {
switch (afam) {
@@ -323,6 +382,11 @@ dk4socket_wc_addr_port_to_text(
/* ----- -getnameinfo */
#endif
#else
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(dsz)
+ DK4_UNUSED_ARG(afam)
+ DK4_UNUSED_ARG(saptr)
+ DK4_UNUSED_ARG(sasz)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return DK4_SOCKET_RESULT_FAILED;
#endif
@@ -340,7 +404,11 @@ dk4socket_wc_sockaddr_to_text(
{
const struct sockaddr *soa;
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (NULL != saptr) && (0 < dsz)) {
soa = (const struct sockaddr *)saptr;
switch (soa->sa_family) {
diff --git a/support/dktools/dk4sock05.c b/support/dktools/dk4sock05.c
index 53ff475de9..50c8af5f9d 100644
--- a/support/dktools/dk4sock05.c
+++ b/support/dktools/dk4sock05.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock05.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock05.ctr
*/
/** @file dk4sock05.c The dk4sock05 module.
@@ -39,8 +17,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock05.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
int
dk4socket_inet_ntop(
dkChar *dptr,
@@ -50,6 +38,11 @@ dk4socket_inet_ntop(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != src);
+ assert(0 < dsz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4socket_wc_inet_ntop(dptr, dsz, afam, src, erp));
#else
@@ -67,6 +60,12 @@ dk4socket_addr_port_to_text(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4socket_wc_addr_port_to_text(dptr, dsz, afam, saptr, sasz, erp));
#else
@@ -85,6 +84,11 @@ dk4socket_sockaddr_to_text(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4socket_wc_sockaddr_to_text(dptr, dsz, saptr, erp));
#else
diff --git a/support/dktools/dk4sock05.ctr b/support/dktools/dk4sock05.ctr
index 0fef1ac9e2..44ec019191 100644
--- a/support/dktools/dk4sock05.ctr
+++ b/support/dktools/dk4sock05.ctr
@@ -2,14 +2,24 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
int
dk4socket_inet_ntop(
dkChar *dptr,
@@ -19,6 +29,11 @@ dk4socket_inet_ntop(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != src);
+ assert(0 < dsz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4socket_wc_inet_ntop(dptr, dsz, afam, src, erp));
#else
@@ -36,6 +51,12 @@ dk4socket_addr_port_to_text(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+ assert(0 < sasz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4socket_wc_addr_port_to_text(dptr, dsz, afam, saptr, sasz, erp));
#else
@@ -54,6 +75,11 @@ dk4socket_sockaddr_to_text(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != saptr);
+ assert(0 < dsz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4socket_wc_sockaddr_to_text(dptr, dsz, saptr, erp));
#else
diff --git a/support/dktools/dk4sock06.c b/support/dktools/dk4sock06.c
index 81f617a0ee..72ce4a2243 100644
--- a/support/dktools/dk4sock06.c
+++ b/support/dktools/dk4sock06.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock06.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock06.ctr
*/
/** @file dk4sock06.c The dk4sock06 module.
@@ -39,15 +17,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock06.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4maaul.h"
#include "dk4maaus.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 18 "dk4sock06.ctr"
+#line 25 "dk4sock06.ctr"
@@ -217,7 +202,11 @@ dk4socket_my_ip6_pton(
int i = 0; /* Index to fill address */
unsigned short curval = 0; /* Value collected so far */
unsigned short us = 0; /* Current character value */
-
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
do {
if ('\0' == *src) {
icl = INPUT_END;
@@ -396,7 +385,12 @@ dk4socket_my_ip4_pton(
unsigned short us = 0;
-#line 365 "dk4sock06.ctr"
+#line 376 "dk4sock06.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
do {
us = 0;
if ('\0' == *src) {
@@ -505,16 +499,16 @@ dk4socket_my_ip4_pton(
back = DK4_SOCKET_RESULT_FAILED;
-#line 472 "dk4sock06.ctr"
+#line 488 "dk4sock06.ctr"
} else {
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
-#line 475 "dk4sock06.ctr"
+#line 491 "dk4sock06.ctr"
}
-#line 477 "dk4sock06.ctr"
+#line 493 "dk4sock06.ctr"
return back;
}
@@ -529,7 +523,11 @@ dk4socket_my_inet_pton(
)
{
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
if (AF_INET6 == afam) {
back = dk4socket_my_ip6_pton(pAddr, szAddr, src, erp);
@@ -558,6 +556,11 @@ dk4socket_c8_inet_pton(
/* +++++ +inet_pton */
int back = DK4_SOCKET_RESULT_FAILED;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
if ((NULL != pAddr) && (0 < szAddr) && (NULL != src)) {
switch (afam) {
case AF_INET : {
@@ -599,6 +602,11 @@ dk4socket_c8_inet_pton(
#else
/* +++++ -inet_pton */
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
if ((NULL != pAddr) && (0 < szAddr) && (NULL != src)) {
switch (afam) {
case AF_INET : {
diff --git a/support/dktools/dk4sock06.ctr b/support/dktools/dk4sock06.ctr
index e8101716e6..343c3c7672 100644
--- a/support/dktools/dk4sock06.ctr
+++ b/support/dktools/dk4sock06.ctr
@@ -2,16 +2,23 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4maaul.h"
#include "dk4maaus.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -184,7 +191,11 @@ dk4socket_my_ip6_pton(
int i = 0; /* Index to fill address */
unsigned short curval = 0; /* Value collected so far */
unsigned short us = 0; /* Current character value */
-
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
do {
if ('\0' == *src) {
icl = INPUT_END;
@@ -362,6 +373,11 @@ dk4socket_my_ip4_pton(
int curnum = 0;
unsigned short us = 0;
$? "+ dk4socket_my_ip4_pton \"%!8s\"", src
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
do {
us = 0;
if ('\0' == *src) {
@@ -488,7 +504,11 @@ dk4socket_my_inet_pton(
)
{
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
if (AF_INET6 == afam) {
back = dk4socket_my_ip6_pton(pAddr, szAddr, src, erp);
@@ -517,6 +537,11 @@ dk4socket_c8_inet_pton(
/* +++++ +inet_pton */
int back = DK4_SOCKET_RESULT_FAILED;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
if ((NULL != pAddr) && (0 < szAddr) && (NULL != src)) {
switch (afam) {
case AF_INET : {
@@ -558,6 +583,11 @@ dk4socket_c8_inet_pton(
#else
/* +++++ -inet_pton */
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
if ((NULL != pAddr) && (0 < szAddr) && (NULL != src)) {
switch (afam) {
case AF_INET : {
diff --git a/support/dktools/dk4sock07.c b/support/dktools/dk4sock07.c
index 65a0a044d1..8e705dd8c4 100644
--- a/support/dktools/dk4sock07.c
+++ b/support/dktools/dk4sock07.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock07.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock07.ctr
*/
/** @file dk4sock07.c The dk4sock07 module.
@@ -39,14 +17,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock07.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4rec24.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 17 "dk4sock07.ctr"
+#line 24 "dk4sock07.ctr"
@@ -62,6 +47,11 @@ dk4socket_wc_inet_pton(
#if DK4_ON_WINDOWS && DK4_HAVE_INET_PTON
int back = DK4_SOCKET_RESULT_FAILED;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
if ((NULL != pAddr) && (NULL != src) && (0 < szAddr)) {
dk4socket_error_reset();
res = InetPtonW(afam, src, pAddr);
@@ -81,6 +71,11 @@ dk4socket_wc_inet_pton(
#else
char buf[128];
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
if ((NULL != pAddr) && (NULL != src) && (0 < szAddr)) {
if (0 != dk4recode_wchar_t_to_char(buf, sizeof(buf), src, erp)) {
back = dk4socket_c8_inet_pton(pAddr, szAddr, afam, buf, erp);
diff --git a/support/dktools/dk4sock07.ctr b/support/dktools/dk4sock07.ctr
index b2af0aedf9..31b95a4d78 100644
--- a/support/dktools/dk4sock07.ctr
+++ b/support/dktools/dk4sock07.ctr
@@ -2,15 +2,22 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4rec24.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -29,6 +36,11 @@ dk4socket_wc_inet_pton(
#if DK4_ON_WINDOWS && DK4_HAVE_INET_PTON
int back = DK4_SOCKET_RESULT_FAILED;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
if ((NULL != pAddr) && (NULL != src) && (0 < szAddr)) {
dk4socket_error_reset();
res = InetPtonW(afam, src, pAddr);
@@ -48,6 +60,11 @@ dk4socket_wc_inet_pton(
#else
char buf[128];
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
if ((NULL != pAddr) && (NULL != src) && (0 < szAddr)) {
if (0 != dk4recode_wchar_t_to_char(buf, sizeof(buf), src, erp)) {
back = dk4socket_c8_inet_pton(pAddr, szAddr, afam, buf, erp);
diff --git a/support/dktools/dk4sock08.c b/support/dktools/dk4sock08.c
index b8cd68e35a..cfc413ef7a 100644
--- a/support/dktools/dk4sock08.c
+++ b/support/dktools/dk4sock08.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock08.ctr
*/
/** @file dk4sock08.c The dk4sock08 module.
@@ -39,8 +17,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock08.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -52,6 +37,11 @@ dk4socket_inet_pton(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4socket_wc_inet_pton(pAddr, szAddr, afam, src, erp));
#else
diff --git a/support/dktools/dk4sock08.ctr b/support/dktools/dk4sock08.ctr
index 7fa1d12e8b..56e013bafe 100644
--- a/support/dktools/dk4sock08.ctr
+++ b/support/dktools/dk4sock08.ctr
@@ -2,14 +2,21 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -21,6 +28,11 @@ dk4socket_inet_pton(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(NULL != src);
+ assert(0 < szAddr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4socket_wc_inet_pton(pAddr, szAddr, afam, src, erp));
#else
diff --git a/support/dktools/dk4sock09.c b/support/dktools/dk4sock09.c
index b9a90f2c36..081cda8dc4 100644
--- a/support/dktools/dk4sock09.c
+++ b/support/dktools/dk4sock09.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock09.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock09.ctr
*/
/** @file dk4sock09.c The dk4sock09 module.
@@ -39,18 +17,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock09.ctr"
+#include "dk4conf.h"
+
#include "dk4sock.h"
+#include "dk4unused.h"
-#line 16 "dk4sock09.ctr"
+
+#line 20 "dk4sock09.ctr"
int
-dk4socket_up(dk4_er_t *er)
+dk4socket_up(
+#if DK4_ON_WINDOWS
+ dk4_er_t *er
+#else
+ dk4_er_t * DK4_ARG_UNUSED(er)
+#endif
+)
{
#if DK4_ON_WINDOWS
WSADATA wsaData;
@@ -59,23 +47,24 @@ dk4socket_up(dk4_er_t *er)
int err;
-#line 28 "dk4sock09.ctr"
+#line 38 "dk4sock09.ctr"
wVersionRequested = MAKEWORD(2,0);
err = WSAStartup(wVersionRequested, &wsaData);
if (0 == err) {
-#line 31 "dk4sock09.ctr"
+#line 41 "dk4sock09.ctr"
back = DK4_SOCKET_RESULT_SUCCESS;
} else {
-#line 33 "dk4sock09.ctr"
+#line 43 "dk4sock09.ctr"
dk4error_set_idetails(er, DK4_E_SOCKET_UP, err);
}
-#line 36 "dk4sock09.ctr"
+#line 46 "dk4sock09.ctr"
return back;
#else
+ DK4_UNUSED_ARG(er)
return DK4_SOCKET_RESULT_SUCCESS;
#endif
}
@@ -83,30 +72,37 @@ dk4socket_up(dk4_er_t *er)
int
-dk4socket_down(dk4_er_t *er)
+dk4socket_down(
+#if DK4_ON_WINDOWS
+ dk4_er_t *er
+#else
+ dk4_er_t * DK4_ARG_UNUSED(er)
+#endif
+)
{
#if DK4_ON_WINDOWS
int back = DK4_SOCKET_RESULT_FAILED;
int errc;
-#line 51 "dk4sock09.ctr"
+#line 68 "dk4sock09.ctr"
WSASetLastError(0);
if (0 == WSACleanup()) {
-#line 53 "dk4sock09.ctr"
+#line 70 "dk4sock09.ctr"
back = DK4_SOCKET_RESULT_SUCCESS;
} else {
errc = WSAGetLastError();
-#line 56 "dk4sock09.ctr"
+#line 73 "dk4sock09.ctr"
dk4error_set_idetails(er, DK4_E_SOCKET_DOWN, errc);
}
-#line 59 "dk4sock09.ctr"
+#line 76 "dk4sock09.ctr"
return back;
#else
+ DK4_UNUSED_ARG(er)
return DK4_SOCKET_RESULT_SUCCESS;
#endif
}
diff --git a/support/dktools/dk4sock09.ctr b/support/dktools/dk4sock09.ctr
index 78706e365d..4b69bc1cd4 100644
--- a/support/dktools/dk4sock09.ctr
+++ b/support/dktools/dk4sock09.ctr
@@ -2,14 +2,18 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
+
#include "dk4sock.h"
+#include "dk4unused.h"
+
$!trace-include
@@ -17,7 +21,13 @@ $!trace-include
int
-dk4socket_up(dk4_er_t *er)
+dk4socket_up(
+#if DK4_ON_WINDOWS
+ dk4_er_t *er
+#else
+ dk4_er_t * DK4_ARG_UNUSED(er)
+#endif
+)
{
#if DK4_ON_WINDOWS
WSADATA wsaData;
@@ -35,6 +45,7 @@ dk4socket_up(dk4_er_t *er)
$? "- dk4socket_up %d", back
return back;
#else
+ DK4_UNUSED_ARG(er)
return DK4_SOCKET_RESULT_SUCCESS;
#endif
}
@@ -42,7 +53,13 @@ dk4socket_up(dk4_er_t *er)
int
-dk4socket_down(dk4_er_t *er)
+dk4socket_down(
+#if DK4_ON_WINDOWS
+ dk4_er_t *er
+#else
+ dk4_er_t * DK4_ARG_UNUSED(er)
+#endif
+)
{
#if DK4_ON_WINDOWS
int back = DK4_SOCKET_RESULT_FAILED;
@@ -58,6 +75,7 @@ dk4socket_down(dk4_er_t *er)
$? "- dk4socket_down %d", back
return back;
#else
+ DK4_UNUSED_ARG(er)
return DK4_SOCKET_RESULT_SUCCESS;
#endif
}
diff --git a/support/dktools/dk4sock10.c b/support/dktools/dk4sock10.c
index ff048fa5be..dd3c76f9b2 100644
--- a/support/dktools/dk4sock10.c
+++ b/support/dktools/dk4sock10.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock10.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock10.ctr
*/
/** @file dk4sock10.c The dk4sock10 module.
@@ -40,6 +18,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4sock10.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -65,9 +44,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 37 "dk4sock10.ctr"
+
+
+#line 46 "dk4sock10.ctr"
@@ -77,7 +64,7 @@ dk4socket_open(int af, int tp, int pr, dk4_er_t *erp)
dk4_socket_t back = INVALID_SOCKET;
-#line 45 "dk4sock10.ctr"
+#line 54 "dk4sock10.ctr"
switch (af) {
case AF_INET:
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
@@ -102,7 +89,7 @@ dk4socket_open(int af, int tp, int pr, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
-#line 68 "dk4sock10.ctr"
+#line 77 "dk4sock10.ctr"
} break;
}
} break;
@@ -110,12 +97,12 @@ dk4socket_open(int af, int tp, int pr, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
-#line 74 "dk4sock10.ctr"
+#line 83 "dk4sock10.ctr"
} break;
}
-#line 77 "dk4sock10.ctr"
+#line 86 "dk4sock10.ctr"
return back;
}
@@ -125,7 +112,9 @@ int
dk4socket_close(dk4_socket_t so, dk4_er_t *erp)
{
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != so);
+#endif
if (INVALID_SOCKET != so) {
dk4socket_error_reset();
#if DK4_ON_WINDOWS
@@ -150,6 +139,9 @@ int
dk4socket_shutdown(dk4_socket_t so, int how, dk4_er_t *erp)
{
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != so);
+#endif
if (INVALID_SOCKET != so) {
switch (how) {
case DK4_SOCKET_SHUT_READ :
diff --git a/support/dktools/dk4sock10.ctr b/support/dktools/dk4sock10.ctr
index b7f58e8feb..b267268e0a 100644
--- a/support/dktools/dk4sock10.ctr
+++ b/support/dktools/dk4sock10.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -33,6 +34,14 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
$!trace-include
@@ -83,7 +92,9 @@ int
dk4socket_close(dk4_socket_t so, dk4_er_t *erp)
{
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != so);
+#endif
if (INVALID_SOCKET != so) {
dk4socket_error_reset();
#if DK4_ON_WINDOWS
@@ -108,6 +119,9 @@ int
dk4socket_shutdown(dk4_socket_t so, int how, dk4_er_t *erp)
{
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != so);
+#endif
if (INVALID_SOCKET != so) {
switch (how) {
case DK4_SOCKET_SHUT_READ :
diff --git a/support/dktools/dk4sock11.c b/support/dktools/dk4sock11.c
index 8561a6d43b..65eb0553d9 100644
--- a/support/dktools/dk4sock11.c
+++ b/support/dktools/dk4sock11.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock11.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock11.ctr
*/
/** @file dk4sock11.c The dk4sock11 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4sock11.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -64,9 +43,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 36 "dk4sock11.ctr"
+#line 44 "dk4sock11.ctr"
@@ -79,6 +65,12 @@ dk4socket_bind(
)
{
int back = DK4_SOCKET_RESULT_FAILED;
+
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != pAddr);
+ assert(0 < szAddr);
+#endif
if ((INVALID_SOCKET != sock) && (NULL != pAddr) && (0 < szAddr)) {
(void)dk4socket_correct_addr_lgt(pAddr, &szAddr);
dk4socket_error_reset();
diff --git a/support/dktools/dk4sock11.ctr b/support/dktools/dk4sock11.ctr
index b483837cb2..c0928fa862 100644
--- a/support/dktools/dk4sock11.ctr
+++ b/support/dktools/dk4sock11.ctr
@@ -2,11 +2,12 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -32,6 +33,13 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -45,6 +53,12 @@ dk4socket_bind(
)
{
int back = DK4_SOCKET_RESULT_FAILED;
+
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != pAddr);
+ assert(0 < szAddr);
+#endif
if ((INVALID_SOCKET != sock) && (NULL != pAddr) && (0 < szAddr)) {
(void)dk4socket_correct_addr_lgt(pAddr, &szAddr);
dk4socket_error_reset();
diff --git a/support/dktools/dk4sock12.c b/support/dktools/dk4sock12.c
index 4586300270..fba184d8ec 100644
--- a/support/dktools/dk4sock12.c
+++ b/support/dktools/dk4sock12.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock12.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock12.ctr
*/
/** @file dk4sock12.c The dk4sock12 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4sock12.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -73,11 +52,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 47 "dk4sock12.ctr"
+#line 54 "dk4sock12.ctr"
int
@@ -92,11 +77,16 @@ dk4socket_connect(
int errc = 0;
-#line 60 "dk4sock12.ctr"
+#line 67 "dk4sock12.ctr"
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != pAddr);
+ assert(0 < szAddr);
+#endif
if ((INVALID_SOCKET != sock) && (NULL != pAddr) && (0 < szAddr)) {
-#line 62 "dk4sock12.ctr"
+#line 74 "dk4sock12.ctr"
(void)dk4socket_correct_addr_lgt(pAddr, &szAddr);
dk4socket_error_reset();
#if DK4_HAVE_SOCKLEN_T
@@ -108,14 +98,14 @@ dk4socket_connect(
back = DK4_SOCKET_RESULT_SUCCESS;
-#line 72 "dk4sock12.ctr"
+#line 84 "dk4sock12.ctr"
}
else
{
errc = dk4socket_error_get();
-#line 77 "dk4sock12.ctr"
+#line 89 "dk4sock12.ctr"
#if DK4_ON_WINDOWS
if (WSAEWOULDBLOCK == errc)
#else
@@ -125,25 +115,25 @@ dk4socket_connect(
back = DK4_SOCKET_RESULT_IN_PROGRESS;
-#line 85 "dk4sock12.ctr"
+#line 97 "dk4sock12.ctr"
}
else
{
dk4error_set_idetails(erp, DK4_E_SOCKET_CONNECT, errc);
-#line 90 "dk4sock12.ctr"
+#line 102 "dk4sock12.ctr"
}
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
-#line 95 "dk4sock12.ctr"
+#line 107 "dk4sock12.ctr"
}
-#line 97 "dk4sock12.ctr"
+#line 109 "dk4sock12.ctr"
return back;
}
@@ -166,7 +156,10 @@ dk4socket_c8_unix_client(
size_t slen;
dk4_socket_t back = INVALID_SOCKET;
int res;
-
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+#endif
if (NULL != filename) {
if (108 > strlen(filename)) {
DK4_MEMRES(&soun, sizeof(soun));
diff --git a/support/dktools/dk4sock12.ctr b/support/dktools/dk4sock12.ctr
index 941b2328eb..4759e62e00 100644
--- a/support/dktools/dk4sock12.ctr
+++ b/support/dktools/dk4sock12.ctr
@@ -2,11 +2,12 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -41,6 +42,12 @@ license = bsd
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -57,6 +64,11 @@ dk4socket_connect(
int back = DK4_SOCKET_RESULT_FAILED;
int errc = 0;
$? "+ dk4socket_connect"
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != pAddr);
+ assert(0 < szAddr);
+#endif
if ((INVALID_SOCKET != sock) && (NULL != pAddr) && (0 < szAddr)) {
$? ". args PTR=%d %lu", TR_IPTR(pAddr), (unsigned long)szAddr
(void)dk4socket_correct_addr_lgt(pAddr, &szAddr);
@@ -116,7 +128,10 @@ dk4socket_c8_unix_client(
size_t slen;
dk4_socket_t back = INVALID_SOCKET;
int res;
-
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+#endif
if (NULL != filename) {
if (108 > strlen(filename)) {
DK4_MEMRES(&soun, sizeof(soun));
diff --git a/support/dktools/dk4sock13.c b/support/dktools/dk4sock13.c
index 47c54c82c5..faadfcb4c8 100644
--- a/support/dktools/dk4sock13.c
+++ b/support/dktools/dk4sock13.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock13.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock13.ctr
*/
/** @file dk4sock13.c The dk4sock13 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4sock13.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -76,10 +55,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4stat8.h"
#include "dk4delfile08.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
-#line 49 "dk4sock13.ctr"
+#line 58 "dk4sock13.ctr"
@@ -91,6 +78,9 @@ dk4socket_listen(
)
{
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
if ((INVALID_SOCKET != sock) && (0 < bl)) {
dk4socket_error_reset();
if (0 == listen(sock, bl)) {
@@ -122,17 +112,23 @@ dk4socket_accept(
#endif
-#line 90 "dk4sock13.ctr"
+#line 102 "dk4sock13.ctr"
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != pAddr);
+ assert(NULL != pSzAddr);
+ assert(0 < *pSzAddr);
+#endif
if (INVALID_SOCKET != sock) {
if (NULL != pAddr) {
-#line 92 "dk4sock13.ctr"
+#line 110 "dk4sock13.ctr"
if (NULL != pSzAddr) {
-#line 93 "dk4sock13.ctr"
+#line 111 "dk4sock13.ctr"
if (0 < *pSzAddr) {
-#line 94 "dk4sock13.ctr"
+#line 112 "dk4sock13.ctr"
#if DK4_HAVE_SOCKLEN_T
sz = (socklen_t)(*pSzAddr);
#else
@@ -148,17 +144,17 @@ dk4socket_accept(
}
} else {
-#line 108 "dk4sock13.ctr"
+#line 126 "dk4sock13.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 111 "dk4sock13.ctr"
+#line 129 "dk4sock13.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 114 "dk4sock13.ctr"
+#line 132 "dk4sock13.ctr"
/* ACCEPT */
dk4socket_error_reset();
back = accept(sock, NULL, NULL);
@@ -168,11 +164,11 @@ dk4socket_accept(
}
} else {
-#line 122 "dk4sock13.ctr"
+#line 140 "dk4sock13.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 124 "dk4sock13.ctr"
+#line 142 "dk4sock13.ctr"
return back;
}
@@ -202,9 +198,14 @@ dk4socket_i_change_owner_group_mode(
{
int errval;
int back = 1;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+#endif
-#line 154 "dk4sock13.ctr"
+#line 177 "dk4sock13.ctr"
if (0 != cog) {
errno = 0;
if (0 != chown(filename, owner, group)) {
@@ -225,7 +226,7 @@ dk4socket_i_change_owner_group_mode(
}
-#line 173 "dk4sock13.ctr"
+#line 196 "dk4sock13.ctr"
return back;
}
@@ -251,7 +252,11 @@ dk4socket_i_c8_unix_listener_ogm(
int res;
int ogm1;
int ogm2;
-
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+ assert(0 < backlog);
+#endif
if ((NULL != filename) && (0 < backlog)) {
if (108 > strlen(filename)) {
/* Attempt to remove existing socket.
@@ -331,6 +336,10 @@ dk4socket_c8_unix_listener(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+#endif
return (
dk4socket_i_c8_unix_listener_ogm(filename, backlog, 0, 0, 0660, 0, erp)
);
@@ -348,6 +357,10 @@ dk4socket_c8_unix_listener_owner_group_mode(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+#endif
return (
dk4socket_i_c8_unix_listener_ogm(
filename, backlog, owner, group, mode, 1, erp
diff --git a/support/dktools/dk4sock13.ctr b/support/dktools/dk4sock13.ctr
index 739ba73c50..4fc89c2289 100644
--- a/support/dktools/dk4sock13.ctr
+++ b/support/dktools/dk4sock13.ctr
@@ -2,11 +2,12 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -44,6 +45,14 @@ license = bsd
#include "dk4stat8.h"
#include "dk4delfile08.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
$!trace-include
@@ -57,6 +66,9 @@ dk4socket_listen(
)
{
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
if ((INVALID_SOCKET != sock) && (0 < bl)) {
dk4socket_error_reset();
if (0 == listen(sock, bl)) {
@@ -87,6 +99,12 @@ dk4socket_accept(
int sz;
#endif
$? "+ dk4socket_accept %d", (int)sock
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != pAddr);
+ assert(NULL != pSzAddr);
+ assert(0 < *pSzAddr);
+#endif
if (INVALID_SOCKET != sock) {
if (NULL != pAddr) { $? ". address buffer"
if (NULL != pSzAddr) { $? ". address size pointer"
@@ -150,6 +168,11 @@ dk4socket_i_change_owner_group_mode(
{
int errval;
int back = 1;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+#endif
$? "+ dk4socket_i_change_owner_group_mode"
if (0 != cog) {
errno = 0;
@@ -195,7 +218,11 @@ dk4socket_i_c8_unix_listener_ogm(
int res;
int ogm1;
int ogm2;
-
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+ assert(0 < backlog);
+#endif
if ((NULL != filename) && (0 < backlog)) {
if (108 > strlen(filename)) {
/* Attempt to remove existing socket.
@@ -275,6 +302,10 @@ dk4socket_c8_unix_listener(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+#endif
return (
dk4socket_i_c8_unix_listener_ogm(filename, backlog, 0, 0, 0660, 0, erp)
);
@@ -292,6 +323,10 @@ dk4socket_c8_unix_listener_owner_group_mode(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+ assert(108 > strlen(filename));
+#endif
return (
dk4socket_i_c8_unix_listener_ogm(
filename, backlog, owner, group, mode, 1, erp
diff --git a/support/dktools/dk4sock14.c b/support/dktools/dk4sock14.c
index c8093c88b4..79118c341a 100644
--- a/support/dktools/dk4sock14.c
+++ b/support/dktools/dk4sock14.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock14.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock14.ctr
*/
/** @file dk4sock14.c The dk4sock14 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock14.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4types.h"
#include "dk4const.h"
@@ -67,9 +46,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 40 "dk4sock14.ctr"
+
+#line 49 "dk4sock14.ctr"
@@ -85,7 +72,10 @@ dk4socket_option_set_reuse(
int res = 0;
-#line 54 "dk4sock14.ctr"
+#line 63 "dk4sock14.ctr"
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
if (INVALID_SOCKET != sock) {
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
if (0 != val) { dk4socket_set_one_bytes(&opt, sizeof(opt)); }
@@ -95,17 +85,17 @@ dk4socket_option_set_reuse(
);
if (0 == res) {
-#line 62 "dk4sock14.ctr"
+#line 74 "dk4sock14.ctr"
back = DK4_SOCKET_RESULT_SUCCESS;
} else {
-#line 64 "dk4sock14.ctr"
+#line 76 "dk4sock14.ctr"
dk4socket_error_report(erp, DK4_E_SOCKET_SETSOCKOPT);
}
#else
-#line 68 "dk4sock14.ctr"
+#line 80 "dk4sock14.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEPORT)
@@ -117,7 +107,7 @@ dk4socket_option_set_reuse(
);
if (0 != res) {
-#line 78 "dk4sock14.ctr"
+#line 90 "dk4sock14.ctr"
back = DK4_SOCKET_RESULT_FAILED;
dk4socket_error_report(erp, DK4_E_SOCKET_SETSOCKOPT);
}
@@ -127,7 +117,7 @@ dk4socket_option_set_reuse(
}
-#line 86 "dk4sock14.ctr"
+#line 98 "dk4sock14.ctr"
return back;
}
@@ -144,8 +134,11 @@ dk4socket_option_set_broadcast(
int res = 0;
-#line 101 "dk4sock14.ctr"
+#line 113 "dk4sock14.ctr"
if (INVALID_SOCKET != sock) {
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
#if DK4_HAVE_SETSOCKOPT && defined(SO_BROADCAST)
if (0 != val) { dk4socket_set_one_bytes(&opt, sizeof(opt)); }
dk4socket_error_reset();
@@ -154,17 +147,17 @@ dk4socket_option_set_broadcast(
);
if (0 == res) {
-#line 109 "dk4sock14.ctr"
+#line 124 "dk4sock14.ctr"
back = DK4_SOCKET_RESULT_SUCCESS;
} else {
-#line 111 "dk4sock14.ctr"
+#line 126 "dk4sock14.ctr"
dk4socket_error_report(erp, DK4_E_SOCKET_SETSOCKOPT);
}
#else
-#line 115 "dk4sock14.ctr"
+#line 130 "dk4sock14.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
#endif
} else {
@@ -172,7 +165,7 @@ dk4socket_option_set_broadcast(
}
-#line 121 "dk4sock14.ctr"
+#line 136 "dk4sock14.ctr"
return back;
}
diff --git a/support/dktools/dk4sock14.ctr b/support/dktools/dk4sock14.ctr
index b70cedda3f..1cff9b5417 100644
--- a/support/dktools/dk4sock14.ctr
+++ b/support/dktools/dk4sock14.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4types.h"
#include "dk4const.h"
@@ -36,6 +37,14 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
$!trace-include
@@ -51,6 +60,9 @@ dk4socket_option_set_reuse(
int opt = 0;
int res = 0;
$? "+ dk4socket_option_set_reuse %d", val
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
if (INVALID_SOCKET != sock) {
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
if (0 != val) { dk4socket_set_one_bytes(&opt, sizeof(opt)); }
@@ -99,6 +111,9 @@ dk4socket_option_set_broadcast(
int res = 0;
$? "+ dk4socket_option_set_broadcast %d", val
if (INVALID_SOCKET != sock) {
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
#if DK4_HAVE_SETSOCKOPT && defined(SO_BROADCAST)
if (0 != val) { dk4socket_set_one_bytes(&opt, sizeof(opt)); }
dk4socket_error_reset();
diff --git a/support/dktools/dk4sock15.c b/support/dktools/dk4sock15.c
index 2a91ca32ac..6f34851421 100644
--- a/support/dktools/dk4sock15.c
+++ b/support/dktools/dk4sock15.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock15.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock15.ctr
*/
/** @file dk4sock15.c The dk4sock15 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock15.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -71,9 +50,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 44 "dk4sock15.ctr"
+
+#line 53 "dk4sock15.ctr"
@@ -87,6 +74,9 @@ dk4socket_option_set_nonblock(
#if DK4_ON_WINDOWS
unsigned long xv = 0UL;
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
if (INVALID_SOCKET != sock) {
if (0 != val) { xv = 0x11111111UL; }
WSASetLastError(0);
@@ -102,6 +92,9 @@ dk4socket_option_set_nonblock(
#else
int back = DK4_SOCKET_RESULT_FAILED;
int om;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
if (INVALID_SOCKET != sock) {
om = fcntl(sock, F_GETFL);
if (0 != val) {
diff --git a/support/dktools/dk4sock15.ctr b/support/dktools/dk4sock15.ctr
index 9a5a81dece..af7a3bb914 100644
--- a/support/dktools/dk4sock15.ctr
+++ b/support/dktools/dk4sock15.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -40,6 +41,14 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
$!trace-include
@@ -54,6 +63,9 @@ dk4socket_option_set_nonblock(
#if DK4_ON_WINDOWS
unsigned long xv = 0UL;
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
if (INVALID_SOCKET != sock) {
if (0 != val) { xv = 0x11111111UL; }
WSASetLastError(0);
@@ -69,6 +81,9 @@ dk4socket_option_set_nonblock(
#else
int back = DK4_SOCKET_RESULT_FAILED;
int om;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+#endif
if (INVALID_SOCKET != sock) {
om = fcntl(sock, F_GETFL);
if (0 != val) {
diff --git a/support/dktools/dk4sock16.c b/support/dktools/dk4sock16.c
index 256974cfd3..5f20ac6930 100644
--- a/support/dktools/dk4sock16.c
+++ b/support/dktools/dk4sock16.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock16.ctr
*/
/** @file dk4sock16.c The dk4sock16 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4sock16.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -80,19 +59,24 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 52 "dk4sock16.ctr"
+
+#line 61 "dk4sock16.ctr"
static
dk4_socket_t
dk4socket_tcp_client_cleanup_socket(
- dk4_socket_t sock,
- int level,
- struct sockaddr *pAddr,
- size_t szAddr
+ dk4_socket_t sock
)
{
#if 0
@@ -120,8 +104,6 @@ dk4socket_tcp_client_connect_attempt(
dk4_socket_t back,
struct sockaddr *pAddr,
size_t szAddr,
- struct sockaddr *pLoAddr,
- size_t szLoAddr,
long secs,
long usecs,
dk4_er_t *erp
@@ -141,20 +123,24 @@ dk4socket_tcp_client_connect_attempt(
int res;
-#line 109 "dk4sock16.ctr"
+#line 113 "dk4sock16.ctr"
-#line 110 "dk4sock16.ctr"
+#line 114 "dk4sock16.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(0 < szAddr);
+#endif
res = dk4socket_connect(back, pAddr, szAddr, erp);
switch (res) {
case DK4_SOCKET_RESULT_SUCCESS : {
-#line 113 "dk4sock16.ctr"
+#line 121 "dk4sock16.ctr"
/* do nothing */
} break;
case DK4_SOCKET_RESULT_IN_PROGRESS : {
-#line 116 "dk4sock16.ctr"
+#line 124 "dk4sock16.ctr"
FD_ZERO(&wfds);
FD_SET(back, &wfds);
to.tv_sec = secs;
@@ -163,10 +149,10 @@ dk4socket_tcp_client_connect_attempt(
res = select((((int)back) + 1), NULL, &wfds, NULL, &to);
if (0 < res) {
-#line 123 "dk4sock16.ctr"
+#line 131 "dk4sock16.ctr"
if (FD_ISSET(back, &wfds)) {
-#line 124 "dk4sock16.ctr"
+#line 132 "dk4sock16.ctr"
#if (!DK4_ON_WINDOWS) && (DK4_HAVE_SETSOCKOPT) \
&& defined(SOL_SOCKET) && defined(SO_ERROR)
err = 0;
@@ -175,70 +161,64 @@ dk4socket_tcp_client_connect_attempt(
res = getsockopt(back, SOL_SOCKET, SO_ERROR, &err, &slo);
if (0 == res) {
-#line 131 "dk4sock16.ctr"
+#line 139 "dk4sock16.ctr"
if (0 != dk4socket_non_null_getsockopt(err, slo)) {
-#line 133 "dk4sock16.ctr"
+#line 141 "dk4sock16.ctr"
dk4error_set_idetails(erp, DK4_E_SOCKET_CONNECT, err);
- back = dk4socket_tcp_client_cleanup_socket(
- back, 1, pLoAddr, szLoAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
#if VERSION_BEFORE_20160415
if (sizeof(int) != slo) {
if (0 != err) {
-#line 141 "dk4sock16.ctr"
+#line 147 "dk4sock16.ctr"
dk4error_set_idetails(erp, DK4_E_SOCKET_CONNECT, err);
- back = dk4socket_tcp_client_cleanup_socket(
- back, 1, pLoAddr, szLoAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
} else {
-#line 147 "dk4sock16.ctr"
+#line 151 "dk4sock16.ctr"
dk4socket_error_report(erp, DK4_E_SOCKET_GETSOCKOPT);
- back = dk4socket_tcp_client_cleanup_socket(
- back, 1, pLoAddr, szLoAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
#endif
} else {
-#line 154 "dk4sock16.ctr"
+#line 156 "dk4sock16.ctr"
dk4socket_error_report(erp, DK4_E_SOCKET_GETSOCKOPT);
- back = dk4socket_tcp_client_cleanup_socket(back,1,pLoAddr,szLoAddr);
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
#endif
} else {
-#line 159 "dk4sock16.ctr"
+#line 161 "dk4sock16.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SOCKET_TIMEOUT);
- back = dk4socket_tcp_client_cleanup_socket(back,0,pLoAddr,szLoAddr);
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
} else {
if (0 > res) {
-#line 164 "dk4sock16.ctr"
+#line 166 "dk4sock16.ctr"
dk4socket_error_report(erp, DK4_E_SOCKET_SELECT);
} else {
-#line 166 "dk4sock16.ctr"
+#line 168 "dk4sock16.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SOCKET_TIMEOUT);
}
- back = dk4socket_tcp_client_cleanup_socket(back,0,pLoAddr,szLoAddr);
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
} break;
default : {
-#line 172 "dk4sock16.ctr"
- back = dk4socket_tcp_client_cleanup_socket(back, 0, pLoAddr, szLoAddr);
+#line 174 "dk4sock16.ctr"
+ back = dk4socket_tcp_client_cleanup_socket(back);
} break;
}
-#line 176 "dk4sock16.ctr"
+#line 178 "dk4sock16.ctr"
return back;
}
@@ -263,24 +243,28 @@ dk4socket_tcp_client_for_addr(
#endif
-#line 199 "dk4sock16.ctr"
+#line 201 "dk4sock16.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pRemoteAddr);
+ assert(0 < szRemoteAddr);
+#endif
if ((NULL != pRemoteAddr) && (0 < szRemoteAddr)) {
-#line 200 "dk4sock16.ctr"
+#line 206 "dk4sock16.ctr"
-#line 201 "dk4sock16.ctr"
+#line 207 "dk4sock16.ctr"
back = dk4socket_open(protfam, SOCK_STREAM, 0, erp);
if (INVALID_SOCKET != back) {
-#line 203 "dk4sock16.ctr"
+#line 209 "dk4sock16.ctr"
if ((NULL != pLocalAddr) && (0 < szLocalAddr)) {
-#line 204 "dk4sock16.ctr"
+#line 210 "dk4sock16.ctr"
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEPORT)
-#line 206 "dk4sock16.ctr"
+#line 212 "dk4sock16.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
back, SOL_SOCKET,
@@ -288,13 +272,13 @@ dk4socket_tcp_client_for_addr(
);
if (0 != res) {
-#line 212 "dk4sock16.ctr"
+#line 218 "dk4sock16.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 216 "dk4sock16.ctr"
+#line 222 "dk4sock16.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
back, SOL_SOCKET,
@@ -302,57 +286,51 @@ dk4socket_tcp_client_for_addr(
);
if (0 != res) {
-#line 222 "dk4sock16.ctr"
+#line 228 "dk4sock16.ctr"
}
#else
-#line 225 "dk4sock16.ctr"
+#line 231 "dk4sock16.ctr"
#endif
#endif
res = dk4socket_bind(back, pLocalAddr, szLocalAddr, erp);
if (DK4_SOCKET_RESULT_FAILED == res) {
-#line 229 "dk4sock16.ctr"
- back = dk4socket_tcp_client_cleanup_socket(
- back, 0, pLocalAddr, szLocalAddr
- );
+#line 235 "dk4sock16.ctr"
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
}
if (INVALID_SOCKET != back) {
if ((0L != seconds) || (0L != microSeconds)) {
-#line 236 "dk4sock16.ctr"
+#line 240 "dk4sock16.ctr"
res = dk4socket_option_set_nonblock(back, 1, erp);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 238 "dk4sock16.ctr"
+#line 242 "dk4sock16.ctr"
back = dk4socket_tcp_client_connect_attempt(
- back, pRemoteAddr, szRemoteAddr, pLocalAddr, szLocalAddr,
+ back, pRemoteAddr, szRemoteAddr,
seconds, microSeconds, erp
);
if (INVALID_SOCKET != back) {
res = dk4socket_option_set_nonblock(back, 0, erp);
if (DK4_SOCKET_RESULT_SUCCESS != res) {
-#line 245 "dk4sock16.ctr"
- back = dk4socket_tcp_client_cleanup_socket(
- back, 1, pLocalAddr, szLocalAddr
- );
+#line 249 "dk4sock16.ctr"
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
}
} else {
-#line 251 "dk4sock16.ctr"
- back = dk4socket_tcp_client_cleanup_socket(
- back, 0, pLocalAddr, szLocalAddr
- );
+#line 253 "dk4sock16.ctr"
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
} else {
#line 256 "dk4sock16.ctr"
back = dk4socket_tcp_client_connect_attempt(
- back, pRemoteAddr, szRemoteAddr, pLocalAddr, szLocalAddr,
+ back, pRemoteAddr, szRemoteAddr,
0L, 0L, erp
);
}
diff --git a/support/dktools/dk4sock16.ctr b/support/dktools/dk4sock16.ctr
index ebac56871b..06f0aea8c7 100644
--- a/support/dktools/dk4sock16.ctr
+++ b/support/dktools/dk4sock16.ctr
@@ -2,11 +2,12 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include <stdio.h>
@@ -48,6 +49,14 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
$!trace-include
@@ -55,10 +64,7 @@ $!trace-include
static
dk4_socket_t
dk4socket_tcp_client_cleanup_socket(
- dk4_socket_t sock,
- int level,
- struct sockaddr *pAddr,
- size_t szAddr
+ dk4_socket_t sock
)
{
#if 0
@@ -86,8 +92,6 @@ dk4socket_tcp_client_connect_attempt(
dk4_socket_t back,
struct sockaddr *pAddr,
size_t szAddr,
- struct sockaddr *pLoAddr,
- size_t szLoAddr,
long secs,
long usecs,
dk4_er_t *erp
@@ -107,6 +111,10 @@ dk4socket_tcp_client_connect_attempt(
int res;
$? "+ dk4socket_tcp_client_connect_attempt"
$? ". remote = PTR=%d %lu", TR_IPTR(pAddr), (unsigned long)szAddr
+#if DK4_USE_ASSERT
+ assert(NULL != pAddr);
+ assert(0 < szAddr);
+#endif
res = dk4socket_connect(back, pAddr, szAddr, erp);
switch (res) {
case DK4_SOCKET_RESULT_SUCCESS : { $? ". connected"
@@ -131,33 +139,27 @@ dk4socket_tcp_client_connect_attempt(
if (0 != dk4socket_non_null_getsockopt(err, slo)) {
$? "! non-null from getsockopt"
dk4error_set_idetails(erp, DK4_E_SOCKET_CONNECT, err);
- back = dk4socket_tcp_client_cleanup_socket(
- back, 1, pLoAddr, szLoAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
#if VERSION_BEFORE_20160415
if (sizeof(int) != slo) {
if (0 != err) { $? "! error from getsockopt"
dk4error_set_idetails(erp, DK4_E_SOCKET_CONNECT, err);
- back = dk4socket_tcp_client_cleanup_socket(
- back, 1, pLoAddr, szLoAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
} else { $? "! getsockopt (size)"
dk4socket_error_report(erp, DK4_E_SOCKET_GETSOCKOPT);
- back = dk4socket_tcp_client_cleanup_socket(
- back, 1, pLoAddr, szLoAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
#endif
} else { $? "! getsockopt"
dk4socket_error_report(erp, DK4_E_SOCKET_GETSOCKOPT);
- back = dk4socket_tcp_client_cleanup_socket(back,1,pLoAddr,szLoAddr);
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
#endif
} else { $? "! timeout (not in list)"
dk4error_set_simple_error_code(erp, DK4_E_SOCKET_TIMEOUT);
- back = dk4socket_tcp_client_cleanup_socket(back,0,pLoAddr,szLoAddr);
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
} else {
if (0 > res) { $? "! select"
@@ -165,11 +167,11 @@ dk4socket_tcp_client_connect_attempt(
} else { $? "! timeout (from select)"
dk4error_set_simple_error_code(erp, DK4_E_SOCKET_TIMEOUT);
}
- back = dk4socket_tcp_client_cleanup_socket(back,0,pLoAddr,szLoAddr);
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
} break;
default : { $? "! failed"
- back = dk4socket_tcp_client_cleanup_socket(back, 0, pLoAddr, szLoAddr);
+ back = dk4socket_tcp_client_cleanup_socket(back);
} break;
}
$? "- dk4socket_tcp_client_connect_attempt %d", (int)back
@@ -196,6 +198,10 @@ dk4socket_tcp_client_for_addr(
int opt = 0;
#endif
$? "+ dk4socket_tcp_client_for_addr"
+#if DK4_USE_ASSERT
+ assert(NULL != pRemoteAddr);
+ assert(0 < szRemoteAddr);
+#endif
if ((NULL != pRemoteAddr) && (0 < szRemoteAddr)) { $? ". args ok"
$? ". remote = PTR=%d %lu",TR_IPTR(pRemoteAddr),(unsigned long)szRemoteAddr
back = dk4socket_open(protfam, SOCK_STREAM, 0, erp);
@@ -226,9 +232,7 @@ dk4socket_tcp_client_for_addr(
#endif
res = dk4socket_bind(back, pLocalAddr, szLocalAddr, erp);
if (DK4_SOCKET_RESULT_FAILED == res) { $? "! bind"
- back = dk4socket_tcp_client_cleanup_socket(
- back, 0, pLocalAddr, szLocalAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
}
if (INVALID_SOCKET != back) {
@@ -236,25 +240,21 @@ dk4socket_tcp_client_for_addr(
res = dk4socket_option_set_nonblock(back, 1, erp);
if (DK4_SOCKET_RESULT_SUCCESS == res) { $? ". non-blocking"
back = dk4socket_tcp_client_connect_attempt(
- back, pRemoteAddr, szRemoteAddr, pLocalAddr, szLocalAddr,
+ back, pRemoteAddr, szRemoteAddr,
seconds, microSeconds, erp
);
if (INVALID_SOCKET != back) {
res = dk4socket_option_set_nonblock(back, 0, erp);
if (DK4_SOCKET_RESULT_SUCCESS != res) { $? "! back blocking"
- back = dk4socket_tcp_client_cleanup_socket(
- back, 1, pLocalAddr, szLocalAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
}
} else { $? "! non-blocking"
- back = dk4socket_tcp_client_cleanup_socket(
- back, 0, pLocalAddr, szLocalAddr
- );
+ back = dk4socket_tcp_client_cleanup_socket(back);
}
} else { $? ". no timeout"
back = dk4socket_tcp_client_connect_attempt(
- back, pRemoteAddr, szRemoteAddr, pLocalAddr, szLocalAddr,
+ back, pRemoteAddr, szRemoteAddr,
0L, 0L, erp
);
}
diff --git a/support/dktools/dk4sock17.c b/support/dktools/dk4sock17.c
index 49ed4e0be5..7982a855ee 100644
--- a/support/dktools/dk4sock17.c
+++ b/support/dktools/dk4sock17.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock17.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock17.ctr
*/
/** @file dk4sock17.c The dk4sock17 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock17.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
#include "dk4mao8d.h"
@@ -47,10 +26,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 21 "dk4sock17.ctr"
+#line 28 "dk4sock17.ctr"
@@ -58,7 +43,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* +++++ +getaddrinfo +++++ */
/** Create client socket for given address lists.
- @param hostname Remote host name to connect to.
@param raddrst List of remote addresses.
@param laddrst List of local addresses to use, optional.
@param secs Seconds for timeout.
@@ -91,7 +75,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
static
dk4_socket_t
dk4socket_c8_tcp_client_addresses(
- const char *hostname,
struct addrinfo *raddrst,
struct addrinfo *laddrst,
long secs,
@@ -104,7 +87,7 @@ dk4socket_c8_tcp_client_addresses(
dk4_socket_t back = INVALID_SOCKET;
-#line 73 "dk4sock17.ctr"
+#line 78 "dk4sock17.ctr"
ra = raddrst;
while ((INVALID_SOCKET == back) && (NULL != ra)) {
if (NULL != laddrst) {
@@ -113,16 +96,16 @@ dk4socket_c8_tcp_client_addresses(
if (la->ai_family == ra->ai_family) {
-#line 80 "dk4sock17.ctr"
+#line 85 "dk4sock17.ctr"
-#line 81 "dk4sock17.ctr"
+#line 86 "dk4sock17.ctr"
-#line 82 "dk4sock17.ctr"
+#line 87 "dk4sock17.ctr"
-#line 83 "dk4sock17.ctr"
+#line 88 "dk4sock17.ctr"
back = dk4socket_tcp_client_for_addr(
ra->ai_family, ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen, secs, usecs, erp
@@ -146,7 +129,7 @@ dk4socket_c8_tcp_client_addresses(
}
-#line 105 "dk4sock17.ctr"
+#line 110 "dk4sock17.ctr"
return back;
}
@@ -186,13 +169,17 @@ dk4socket_c8_tcp_client_host_num_srv(
dk4_socket_t back = INVALID_SOCKET;
-#line 143 "dk4sock17.ctr"
+#line 148 "dk4sock17.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
-#line 144 "dk4sock17.ctr"
+#line 153 "dk4sock17.ctr"
-#line 145 "dk4sock17.ctr"
+#line 154 "dk4sock17.ctr"
DK4_MEMRES(&rhints, sizeof(rhints));
rhints.ai_family = AF_UNSPEC;
rhints.ai_socktype = SOCK_STREAM;
@@ -210,24 +197,24 @@ dk4socket_c8_tcp_client_host_num_srv(
res = getaddrinfo(NULL, lsvcname, &lhints, &laddrst);
if ((0 == res) && (NULL != laddrst)) {
back = dk4socket_c8_tcp_client_addresses(
- hostname, raddrst, laddrst, secs, usecs, erp
+ raddrst, laddrst, secs, usecs, erp
);
if (NULL != laddrst) { freeaddrinfo(laddrst); }
} else {
-#line 166 "dk4sock17.ctr"
+#line 175 "dk4sock17.ctr"
/* ERROR: getaddrinfo failed */
dk4error_set_idetails(erp, DK4_E_SOCKET_GETADDRLOC, res);
}
} else {
back = dk4socket_c8_tcp_client_addresses(
- hostname, raddrst, NULL, secs, usecs, erp
+ raddrst, NULL, secs, usecs, erp
);
}
if (NULL != raddrst) { freeaddrinfo(raddrst); }
} else {
-#line 176 "dk4sock17.ctr"
+#line 185 "dk4sock17.ctr"
/* ERROR: getaddrinfo failed */
dk4error_set_idetails(erp, DK4_E_SOCKET_GETADDRINFO, res);
}
@@ -236,7 +223,7 @@ dk4socket_c8_tcp_client_host_num_srv(
}
-#line 183 "dk4sock17.ctr"
+#line 192 "dk4sock17.ctr"
return back;
/* ----- +getaddrinfo */
#else
@@ -250,10 +237,14 @@ dk4socket_c8_tcp_client_host_num_srv(
dk4_socket_t back = INVALID_SOCKET;
-#line 195 "dk4sock17.ctr"
+#line 204 "dk4sock17.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
-#line 196 "dk4sock17.ctr"
+#line 209 "dk4sock17.ctr"
res = dk4ma_input_c8_dec_ushort(&rport, svcname, &endptr, 1, NULL);
if (0 == res) {
dk4socket_error_reset();
@@ -299,7 +290,7 @@ dk4socket_c8_tcp_client_host_num_srv(
}
-#line 240 "dk4sock17.ctr"
+#line 253 "dk4sock17.ctr"
return back;
/* ----- -getaddrinfo */
#endif
@@ -344,7 +335,11 @@ dk4socket_c8_tcp_client_host_port(
dk4_socket_t back = INVALID_SOCKET;
-#line 283 "dk4sock17.ctr"
+#line 296 "dk4sock17.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
res = dk4ma_write_c8_decimal_unsigned(
rpnb, sizeof(rpnb), (dk4_um_t)portno, 0, erp
@@ -360,7 +355,7 @@ dk4socket_c8_tcp_client_host_port(
);
} else {
-#line 297 "dk4sock17.ctr"
+#line 314 "dk4sock17.ctr"
}
} else {
back = dk4socket_c8_tcp_client_host_num_srv(
@@ -369,7 +364,7 @@ dk4socket_c8_tcp_client_host_port(
}
} else {
-#line 304 "dk4sock17.ctr"
+#line 321 "dk4sock17.ctr"
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
@@ -390,22 +385,26 @@ dk4socket_c8_tcp_client_host_port(
dk4_socket_t back = INVALID_SOCKET;
-#line 323 "dk4sock17.ctr"
+#line 340 "dk4sock17.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
hep = gethostbyname(hostname);
if (NULL != hep) {
-#line 326 "dk4sock17.ctr"
+#line 347 "dk4sock17.ctr"
if (NULL != hep->h_addr_list) {
-#line 327 "dk4sock17.ctr"
+#line 348 "dk4sock17.ctr"
switch (hep->h_addrtype) {
case AF_INET : {
-#line 329 "dk4sock17.ctr"
+#line 350 "dk4sock17.ctr"
if (4 == hep->h_length) {
-#line 330 "dk4sock17.ctr"
+#line 351 "dk4sock17.ctr"
addrptr = hep->h_addr_list;
while ((INVALID_SOCKET == back) && (NULL != *addrptr)) {
DK4_MEMRES(&sr4, sizeof(sr4));
@@ -414,7 +413,7 @@ dk4socket_c8_tcp_client_host_port(
DK4_MEMCPY(&(sr4.sin_addr), *addrptr, sizeof(IN_ADDR));
-#line 337 "dk4sock17.ctr"
+#line 358 "dk4sock17.ctr"
if (0 != lportno) {
DK4_MEMRES(&sl4, sizeof(sl4));
sl4.sin_family = AF_INET;
@@ -422,7 +421,7 @@ dk4socket_c8_tcp_client_host_port(
sl4.sin_addr.s_addr = dk4socket_htonl(INADDR_ANY);
-#line 343 "dk4sock17.ctr"
+#line 364 "dk4sock17.ctr"
back = dk4socket_tcp_client_for_addr(
AF_INET, (struct sockaddr *)(&sr4), sizeof(sr4),
(struct sockaddr *)(&sl4), sizeof(sl4),
@@ -438,7 +437,7 @@ dk4socket_c8_tcp_client_host_port(
}
} else {
-#line 357 "dk4sock17.ctr"
+#line 378 "dk4sock17.ctr"
/* ERROR: Address length mismatch */
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
@@ -446,7 +445,7 @@ dk4socket_c8_tcp_client_host_port(
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
case AF_INET6 : {
-#line 363 "dk4sock17.ctr"
+#line 384 "dk4sock17.ctr"
if (16 == hep->h_length) {
addrptr = hep->h_addr_list;
while ((INVALID_SOCKET == back) && (NULL != *addrptr)) {
@@ -485,13 +484,13 @@ dk4socket_c8_tcp_client_host_port(
}
} else {
-#line 400 "dk4sock17.ctr"
+#line 421 "dk4sock17.ctr"
/* ERROR: Host not found (empty list) */
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
} else {
-#line 404 "dk4sock17.ctr"
+#line 425 "dk4sock17.ctr"
/* ERROR: Host not found */
dk4socket_error_report(erp, DK4_E_SOCKET_GETHOSTBYNAME);
}
diff --git a/support/dktools/dk4sock17.ctr b/support/dktools/dk4sock17.ctr
index 0b32c77f74..3f11f1a1fd 100644
--- a/support/dktools/dk4sock17.ctr
+++ b/support/dktools/dk4sock17.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
#include "dk4mao8d.h"
@@ -16,6 +17,12 @@ license = bsd
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -25,7 +32,6 @@ $!trace-include
/* +++++ +getaddrinfo +++++ */
/** Create client socket for given address lists.
- @param hostname Remote host name to connect to.
@param raddrst List of remote addresses.
@param laddrst List of local addresses to use, optional.
@param secs Seconds for timeout.
@@ -58,7 +64,6 @@ $!trace-include
static
dk4_socket_t
dk4socket_c8_tcp_client_addresses(
- const char *hostname,
struct addrinfo *raddrst,
struct addrinfo *laddrst,
long secs,
@@ -140,6 +145,10 @@ dk4socket_c8_tcp_client_host_num_srv(
int res; /* Operation result */
dk4_socket_t back = INVALID_SOCKET;
$? "+ dk4socket_c8_tcp_client_host_num_srv (+getaddrinfo)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) { $? ". args ok"
$? ". have getaddrinfo"
DK4_MEMRES(&rhints, sizeof(rhints));
@@ -159,7 +168,7 @@ dk4socket_c8_tcp_client_host_num_srv(
res = getaddrinfo(NULL, lsvcname, &lhints, &laddrst);
if ((0 == res) && (NULL != laddrst)) {
back = dk4socket_c8_tcp_client_addresses(
- hostname, raddrst, laddrst, secs, usecs, erp
+ raddrst, laddrst, secs, usecs, erp
);
if (NULL != laddrst) { freeaddrinfo(laddrst); }
} else { $? "! bug"
@@ -168,7 +177,7 @@ dk4socket_c8_tcp_client_host_num_srv(
}
} else {
back = dk4socket_c8_tcp_client_addresses(
- hostname, raddrst, NULL, secs, usecs, erp
+ raddrst, NULL, secs, usecs, erp
);
}
if (NULL != raddrst) { freeaddrinfo(raddrst); }
@@ -192,6 +201,10 @@ dk4socket_c8_tcp_client_host_num_srv(
int res; /* Operation result */
dk4_socket_t back = INVALID_SOCKET;
$? "+ dk4socket_c8_tcp_client_host_num_srv (-getaddrinfo)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) { $? ". args ok"
res = dk4ma_input_c8_dec_ushort(&rport, svcname, &endptr, 1, NULL);
if (0 == res) {
@@ -280,6 +293,10 @@ dk4socket_c8_tcp_client_host_port(
int res;
dk4_socket_t back = INVALID_SOCKET;
$? "+ dk4socket_c8_tcp_client_host_port"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
res = dk4ma_write_c8_decimal_unsigned(
rpnb, sizeof(rpnb), (dk4_um_t)portno, 0, erp
@@ -320,6 +337,10 @@ dk4socket_c8_tcp_client_host_port(
struct hostent * hep = NULL;
dk4_socket_t back = INVALID_SOCKET;
$? "+ dk4socket_c8_tcp_client_host_port"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
hep = gethostbyname(hostname);
if (NULL != hep) { $? ". hep"
diff --git a/support/dktools/dk4sock18.c b/support/dktools/dk4sock18.c
index afdff9611f..9ad4034158 100644
--- a/support/dktools/dk4sock18.c
+++ b/support/dktools/dk4sock18.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock18.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock18.ctr
*/
/** @file dk4sock18.c The dk4sock18 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock18.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
#include "dk4maodd.h"
@@ -49,10 +28,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maiddus.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 23 "dk4sock18.ctr"
+
+#line 33 "dk4sock18.ctr"
@@ -62,7 +50,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
static
dk4_socket_t
dk4socket_wc_tcp_client_addresses(
- const wchar_t *hostname,
ADDRINFOW *raddrst,
ADDRINFOW *laddrst,
long secs,
@@ -75,7 +62,7 @@ dk4socket_wc_tcp_client_addresses(
dk4_socket_t back = INVALID_SOCKET;
-#line 44 "dk4sock18.ctr"
+#line 53 "dk4sock18.ctr"
ra = raddrst;
while ((INVALID_SOCKET == back) && (NULL != ra)) {
if (NULL != laddrst) {
@@ -84,16 +71,16 @@ dk4socket_wc_tcp_client_addresses(
if (la->ai_family == ra->ai_family) {
-#line 51 "dk4sock18.ctr"
+#line 60 "dk4sock18.ctr"
-#line 52 "dk4sock18.ctr"
+#line 61 "dk4sock18.ctr"
-#line 53 "dk4sock18.ctr"
+#line 62 "dk4sock18.ctr"
-#line 54 "dk4sock18.ctr"
+#line 63 "dk4sock18.ctr"
back = dk4socket_tcp_client_for_addr(
ra->ai_family, ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen, secs, usecs, erp
@@ -117,7 +104,7 @@ dk4socket_wc_tcp_client_addresses(
}
-#line 76 "dk4sock18.ctr"
+#line 85 "dk4sock18.ctr"
return back;
}
@@ -130,12 +117,21 @@ dk4socket_wc_tcp_client_addresses(
dk4_socket_t
dk4socket_wc_tcp_client_host_num_srv(
+#if DK4_ON_WINDOWS
const wchar_t *hostname,
const wchar_t *svcname,
const wchar_t *lsvcname,
long secs,
long usecs,
int nsrv,
+#else
+ const wchar_t * DK4_ARG_UNUSED(hostname),
+ const wchar_t * DK4_ARG_UNUSED(svcname),
+ const wchar_t * DK4_ARG_UNUSED(lsvcname),
+ long DK4_ARG_UNUSED(secs),
+ long DK4_ARG_UNUSED(usecs),
+ int DK4_ARG_UNUSED(nsrv),
+#endif
dk4_er_t *erp
)
{
@@ -150,7 +146,11 @@ dk4socket_wc_tcp_client_host_num_srv(
int res;
-#line 107 "dk4sock18.ctr"
+#line 125 "dk4sock18.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
DK4_MEMRES(&rhints, sizeof(rhints));
rhints.ai_family = AF_UNSPEC;
@@ -169,7 +169,7 @@ dk4socket_wc_tcp_client_host_num_srv(
res = GetAddrInfoW(NULL, lsvcname, &lhints, &laddrst);
if ((0 == res) && (NULL != laddrst)) {
back = dk4socket_wc_tcp_client_addresses(
- hostname, raddrst, laddrst, secs, usecs, erp
+ raddrst, laddrst, secs, usecs, erp
);
if (NULL != laddrst) { FreeAddrInfoW(laddrst); }
} else {
@@ -178,7 +178,7 @@ dk4socket_wc_tcp_client_host_num_srv(
}
} else {
back = dk4socket_wc_tcp_client_addresses(
- hostname, raddrst, NULL, secs, usecs, erp
+ raddrst, NULL, secs, usecs, erp
);
}
} else {
@@ -191,7 +191,7 @@ dk4socket_wc_tcp_client_host_num_srv(
}
-#line 146 "dk4sock18.ctr"
+#line 168 "dk4sock18.ctr"
return back;
/* ----- +getaddrinfo */
#else
@@ -205,6 +205,10 @@ dk4socket_wc_tcp_client_host_num_srv(
unsigned short rport = 0U;
unsigned short lport = 0U;
unsigned short iport = 0U;
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
res = dk4ma_input_dk_dec_ushort(&rport, svcname, &endptr, 1, erp);
if (0 == res) {
@@ -259,6 +263,12 @@ dk4socket_wc_tcp_client_host_num_srv(
/* ----- -getaddrinfo */
#endif
#else
+ DK4_UNUSED_ARG(hostname)
+ DK4_UNUSED_ARG(svcname)
+ DK4_UNUSED_ARG(lsvcname)
+ DK4_UNUSED_ARG(secs)
+ DK4_UNUSED_ARG(usecs)
+ DK4_UNUSED_ARG(nsrv)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return (DK4_SOCKET_RESULT_FAILED);
#endif
@@ -285,7 +295,7 @@ dk4socket_wc_tcp_client_host_srv(
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6
+#if (DK4_HAVE_STRUCT_SOCKADDR_IN6) && (!(DK4_HAVE_GETADDRINFO))
/** used to initialize IPv6 address for binding local ports.
*/
static const IN6_ADDR dk4sock18_any6 = IN6ADDR_ANY_INIT ;
@@ -295,11 +305,19 @@ static const IN6_ADDR dk4sock18_any6 = IN6ADDR_ANY_INIT ;
dk4_socket_t
dk4socket_wc_tcp_client_host_port(
+#if DK4_ON_WINDOWS
const wchar_t *hostname,
unsigned short portno,
unsigned short lportno,
long secs,
long usecs,
+#else
+ const wchar_t * DK4_ARG_UNUSED(hostname),
+ unsigned short DK4_ARG_UNUSED(portno),
+ unsigned short DK4_ARG_UNUSED(lportno),
+ long DK4_ARG_UNUSED(secs),
+ long DK4_ARG_UNUSED(usecs),
+#endif
dk4_er_t *erp
)
{
@@ -314,7 +332,11 @@ dk4socket_wc_tcp_client_host_port(
int res;
-#line 267 "dk4sock18.ctr"
+#line 307 "dk4sock18.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
res = dk4ma_write_decimal_unsigned(rpnb, szrpbn, (dk4_um_t)portno, 0, erp);
if (0 != res) {
@@ -326,7 +348,7 @@ dk4socket_wc_tcp_client_host_port(
);
} else {
-#line 277 "dk4sock18.ctr"
+#line 321 "dk4sock18.ctr"
}
} else {
back = dk4socket_wc_tcp_client_host_num_srv(
@@ -335,14 +357,14 @@ dk4socket_wc_tcp_client_host_port(
}
} else {
-#line 284 "dk4sock18.ctr"
+#line 328 "dk4sock18.ctr"
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 289 "dk4sock18.ctr"
+#line 333 "dk4sock18.ctr"
return back;
/* ----- +getaddrinfo */
#else
@@ -359,21 +381,25 @@ dk4socket_wc_tcp_client_host_port(
dk4_socket_t back = INVALID_SOCKET;
-#line 304 "dk4sock18.ctr"
+#line 348 "dk4sock18.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
-#line 305 "dk4sock18.ctr"
+#line 353 "dk4sock18.ctr"
if (0 != dk4recode_wchar_t_to_char(hona, sizeof(hona), hostname, erp)) {
dk4socket_error_reset();
hep = gethostbyname(hona);
-#line 308 "dk4sock18.ctr"
+#line 356 "dk4sock18.ctr"
if (NULL != hep) {
-#line 309 "dk4sock18.ctr"
+#line 357 "dk4sock18.ctr"
if (NULL != hep->h_addr_list) {
-#line 310 "dk4sock18.ctr"
+#line 358 "dk4sock18.ctr"
switch (hep->h_addrtype) {
case AF_INET : {
if (4 == hep->h_length) {
@@ -385,7 +411,7 @@ dk4socket_wc_tcp_client_host_port(
DK4_MEMCPY(&(sr4.sin_addr), *addrptr, sizeof(IN_ADDR));
-#line 320 "dk4sock18.ctr"
+#line 368 "dk4sock18.ctr"
if (0 != lportno) {
DK4_MEMRES(&sl4, sizeof(sl4));
sl4.sin_family = AF_INET;
@@ -393,7 +419,7 @@ dk4socket_wc_tcp_client_host_port(
sl4.sin_addr.s_addr = dk4socket_htonl(INADDR_ANY);
-#line 326 "dk4sock18.ctr"
+#line 374 "dk4sock18.ctr"
back = dk4socket_tcp_client_for_addr(
AF_INET, (struct sockaddr *)(&sr4), sizeof(sr4),
(struct sockaddr *)(&sl4), sizeof(sl4),
@@ -409,7 +435,7 @@ dk4socket_wc_tcp_client_host_port(
}
} else {
-#line 340 "dk4sock18.ctr"
+#line 388 "dk4sock18.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
} break;
@@ -453,33 +479,38 @@ dk4socket_wc_tcp_client_host_port(
}
} else {
-#line 382 "dk4sock18.ctr"
+#line 430 "dk4sock18.ctr"
/* ERROR: List empty */
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
} else {
-#line 386 "dk4sock18.ctr"
+#line 434 "dk4sock18.ctr"
/* ERROR: Host not found */
dk4socket_error_report(erp, DK4_E_SOCKET_GETHOSTBYNAME);
}
} else {
-#line 390 "dk4sock18.ctr"
+#line 438 "dk4sock18.ctr"
/* ERROR: Failed to convert hostname to ASCII, already reported */
}
} else {
-#line 393 "dk4sock18.ctr"
+#line 441 "dk4sock18.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 396 "dk4sock18.ctr"
+#line 444 "dk4sock18.ctr"
return back;
/* ----- -getaddrinfo */
#endif
#else
+ DK4_UNUSED_ARG(hostname)
+ DK4_UNUSED_ARG(portno)
+ DK4_UNUSED_ARG(lportno)
+ DK4_UNUSED_ARG(secs)
+ DK4_UNUSED_ARG(usecs)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return (DK4_SOCKET_RESULT_FAILED);
#endif
diff --git a/support/dktools/dk4sock18.ctr b/support/dktools/dk4sock18.ctr
index 117d3969a9..300c9b1915 100644
--- a/support/dktools/dk4sock18.ctr
+++ b/support/dktools/dk4sock18.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
#include "dk4maodd.h"
@@ -18,6 +19,15 @@ license = bsd
#include "dk4maiddus.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -29,7 +39,6 @@ $!trace-include
static
dk4_socket_t
dk4socket_wc_tcp_client_addresses(
- const wchar_t *hostname,
ADDRINFOW *raddrst,
ADDRINFOW *laddrst,
long secs,
@@ -85,12 +94,21 @@ $!trace-code dk4socket_debug_address("local ", la->ai_addr, la->ai_addrlen);
dk4_socket_t
dk4socket_wc_tcp_client_host_num_srv(
+#if DK4_ON_WINDOWS
const wchar_t *hostname,
const wchar_t *svcname,
const wchar_t *lsvcname,
long secs,
long usecs,
int nsrv,
+#else
+ const wchar_t * DK4_ARG_UNUSED(hostname),
+ const wchar_t * DK4_ARG_UNUSED(svcname),
+ const wchar_t * DK4_ARG_UNUSED(lsvcname),
+ long DK4_ARG_UNUSED(secs),
+ long DK4_ARG_UNUSED(usecs),
+ int DK4_ARG_UNUSED(nsrv),
+#endif
dk4_er_t *erp
)
{
@@ -104,6 +122,10 @@ dk4socket_wc_tcp_client_host_num_srv(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_dk_tcp_client_host_num_srv (getaddrinfo)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
DK4_MEMRES(&rhints, sizeof(rhints));
rhints.ai_family = AF_UNSPEC;
@@ -122,7 +144,7 @@ dk4socket_wc_tcp_client_host_num_srv(
res = GetAddrInfoW(NULL, lsvcname, &lhints, &laddrst);
if ((0 == res) && (NULL != laddrst)) {
back = dk4socket_wc_tcp_client_addresses(
- hostname, raddrst, laddrst, secs, usecs, erp
+ raddrst, laddrst, secs, usecs, erp
);
if (NULL != laddrst) { FreeAddrInfoW(laddrst); }
} else {
@@ -131,7 +153,7 @@ dk4socket_wc_tcp_client_host_num_srv(
}
} else {
back = dk4socket_wc_tcp_client_addresses(
- hostname, raddrst, NULL, secs, usecs, erp
+ raddrst, NULL, secs, usecs, erp
);
}
} else {
@@ -156,6 +178,10 @@ dk4socket_wc_tcp_client_host_num_srv(
unsigned short rport = 0U;
unsigned short lport = 0U;
unsigned short iport = 0U;
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
res = dk4ma_input_dk_dec_ushort(&rport, svcname, &endptr, 1, erp);
if (0 == res) {
@@ -210,6 +236,12 @@ dk4socket_wc_tcp_client_host_num_srv(
/* ----- -getaddrinfo */
#endif
#else
+ DK4_UNUSED_ARG(hostname)
+ DK4_UNUSED_ARG(svcname)
+ DK4_UNUSED_ARG(lsvcname)
+ DK4_UNUSED_ARG(secs)
+ DK4_UNUSED_ARG(usecs)
+ DK4_UNUSED_ARG(nsrv)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return (DK4_SOCKET_RESULT_FAILED);
#endif
@@ -236,7 +268,7 @@ dk4socket_wc_tcp_client_host_srv(
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6
+#if (DK4_HAVE_STRUCT_SOCKADDR_IN6) && (!(DK4_HAVE_GETADDRINFO))
/** used to initialize IPv6 address for binding local ports.
*/
static const IN6_ADDR dk4sock18_any6 = IN6ADDR_ANY_INIT ;
@@ -246,11 +278,19 @@ static const IN6_ADDR dk4sock18_any6 = IN6ADDR_ANY_INIT ;
dk4_socket_t
dk4socket_wc_tcp_client_host_port(
+#if DK4_ON_WINDOWS
const wchar_t *hostname,
unsigned short portno,
unsigned short lportno,
long secs,
long usecs,
+#else
+ const wchar_t * DK4_ARG_UNUSED(hostname),
+ unsigned short DK4_ARG_UNUSED(portno),
+ unsigned short DK4_ARG_UNUSED(lportno),
+ long DK4_ARG_UNUSED(secs),
+ long DK4_ARG_UNUSED(usecs),
+#endif
dk4_er_t *erp
)
{
@@ -264,6 +304,10 @@ dk4socket_wc_tcp_client_host_port(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_dk_tcp_client_host_port (getaddrinfo)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
res = dk4ma_write_decimal_unsigned(rpnb, szrpbn, (dk4_um_t)portno, 0, erp);
if (0 != res) {
@@ -301,6 +345,10 @@ dk4socket_wc_tcp_client_host_port(
struct hostent *hep;
dk4_socket_t back = INVALID_SOCKET;
$? "+ dk4socket_dk_tcp_client_host_port (no getaddrinfo)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) { $? ". args ok"
if (0 != dk4recode_wchar_t_to_char(hona, sizeof(hona), hostname, erp)) {
dk4socket_error_reset();
@@ -397,6 +445,11 @@ $!trace-code dk4socket_debug_address("local ", (struct sockaddr *)(&sl4), sizeof
/* ----- -getaddrinfo */
#endif
#else
+ DK4_UNUSED_ARG(hostname)
+ DK4_UNUSED_ARG(portno)
+ DK4_UNUSED_ARG(lportno)
+ DK4_UNUSED_ARG(secs)
+ DK4_UNUSED_ARG(usecs)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return (DK4_SOCKET_RESULT_FAILED);
#endif
diff --git a/support/dktools/dk4sock19.c b/support/dktools/dk4sock19.c
index 059774bce2..197649ef88 100644
--- a/support/dktools/dk4sock19.c
+++ b/support/dktools/dk4sock19.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk4sock19.ctr
@@ -9,8 +15,9 @@
*/
-#line 5 "dk4sock19.ctr"
+#line 7 "dk4sock19.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
@@ -18,7 +25,7 @@
-#line 12 "dk4sock19.ctr"
+#line 15 "dk4sock19.ctr"
diff --git a/support/dktools/dk4sock19.ctr b/support/dktools/dk4sock19.ctr
index ba2ced394f..6c2f00dd65 100644
--- a/support/dktools/dk4sock19.ctr
+++ b/support/dktools/dk4sock19.ctr
@@ -1,8 +1,11 @@
%% options
-
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
diff --git a/support/dktools/dk4sock20.c b/support/dktools/dk4sock20.c
index fd75d1bceb..1fd38ec51f 100644
--- a/support/dktools/dk4sock20.c
+++ b/support/dktools/dk4sock20.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock20.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock20.ctr
*/
/** @file dk4sock20.c The dk4sock20 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock20.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#if DK4_HAVE_LIMITS_H
@@ -70,11 +49,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4numco.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 45 "dk4sock20.ctr"
+#line 52 "dk4sock20.ctr"
@@ -100,6 +85,12 @@ dk4socket_send(
int res;
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != buf);
+ assert(NULL != pszbuf);
+ assert(0 < *pszbuf);
+#endif
if ((INVALID_SOCKET != sock) && (NULL != buf) && (NULL != pszbuf)) {
if (0 < *pszbuf) {
#if DK4_HAVE_SSIZE_T
@@ -209,7 +200,12 @@ dk4socket_recv(
#endif
int res;
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != buf);
+ assert(NULL != pszbuf);
+ assert(0 < *pszbuf);
+#endif
if ((INVALID_SOCKET != sock) && (NULL != buf) && (NULL != pszbuf)) {
if (0 < *pszbuf) {
#if DK4_HAVE_SSIZE_T
diff --git a/support/dktools/dk4sock20.ctr b/support/dktools/dk4sock20.ctr
index 0c81d22d25..eb029bb141 100644
--- a/support/dktools/dk4sock20.ctr
+++ b/support/dktools/dk4sock20.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#if DK4_HAVE_LIMITS_H
@@ -39,6 +40,12 @@ license = bsd
#include "dk4numco.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -67,6 +74,12 @@ dk4socket_send(
int res;
int back = DK4_SOCKET_RESULT_FAILED;
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != buf);
+ assert(NULL != pszbuf);
+ assert(0 < *pszbuf);
+#endif
if ((INVALID_SOCKET != sock) && (NULL != buf) && (NULL != pszbuf)) {
if (0 < *pszbuf) {
#if DK4_HAVE_SSIZE_T
@@ -176,7 +189,12 @@ dk4socket_recv(
#endif
int res;
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != buf);
+ assert(NULL != pszbuf);
+ assert(0 < *pszbuf);
+#endif
if ((INVALID_SOCKET != sock) && (NULL != buf) && (NULL != pszbuf)) {
if (0 < *pszbuf) {
#if DK4_HAVE_SSIZE_T
diff --git a/support/dktools/dk4sock21.c b/support/dktools/dk4sock21.c
index ae8b91f689..65f2414bcb 100644
--- a/support/dktools/dk4sock21.c
+++ b/support/dktools/dk4sock21.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock21.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock21.ctr
*/
/** @file dk4sock21.c The dk4sock21 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock21.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#if DK4_HAVE_LIMITS_H
@@ -70,11 +49,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4numco.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 45 "dk4sock21.ctr"
+#line 52 "dk4sock21.ctr"
@@ -101,7 +86,14 @@ dk4socket_sendto(
#endif
int res;
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != buf);
+ assert(NULL != pszbuf);
+ assert(0 < *pszbuf);
+ assert(NULL != saddr);
+ assert(0 < addrlen);
+#endif
if (
(INVALID_SOCKET != sock) && (NULL != buf) && (NULL != pszbuf)
&& (NULL != saddr) && (0 < addrlen)
@@ -234,7 +226,14 @@ dk4socket_recvfrom(
#endif
int res;
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != buf);
+ assert(NULL != pszbuf);
+ assert(0 < *pszbuf);
+ assert(NULL != saddr);
+ assert(NULL != paddrlen);
+#endif
if (
(INVALID_SOCKET != sock) && (NULL != buf) && (NULL != pszbuf)
&& (NULL != saddr) && (NULL != paddrlen)
diff --git a/support/dktools/dk4sock21.ctr b/support/dktools/dk4sock21.ctr
index c778b67d9d..f768e7f780 100644
--- a/support/dktools/dk4sock21.ctr
+++ b/support/dktools/dk4sock21.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#if DK4_HAVE_LIMITS_H
@@ -39,6 +40,12 @@ license = bsd
#include "dk4numco.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -68,7 +75,14 @@ dk4socket_sendto(
#endif
int res;
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != buf);
+ assert(NULL != pszbuf);
+ assert(0 < *pszbuf);
+ assert(NULL != saddr);
+ assert(0 < addrlen);
+#endif
if (
(INVALID_SOCKET != sock) && (NULL != buf) && (NULL != pszbuf)
&& (NULL != saddr) && (0 < addrlen)
@@ -201,7 +215,14 @@ dk4socket_recvfrom(
#endif
int res;
int back = DK4_SOCKET_RESULT_FAILED;
-
+#if DK4_USE_ASSERT
+ assert(INVALID_SOCKET != sock);
+ assert(NULL != buf);
+ assert(NULL != pszbuf);
+ assert(0 < *pszbuf);
+ assert(NULL != saddr);
+ assert(NULL != paddrlen);
+#endif
if (
(INVALID_SOCKET != sock) && (NULL != buf) && (NULL != pszbuf)
&& (NULL != saddr) && (NULL != paddrlen)
diff --git a/support/dktools/dk4sock22.c b/support/dktools/dk4sock22.c
index 12013493cd..05531f1cf9 100644
--- a/support/dktools/dk4sock22.c
+++ b/support/dktools/dk4sock22.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock22.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock22.ctr
*/
/** @file dk4sock22.c The dk4sock22 module.
@@ -40,14 +18,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock22.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 18 "dk4sock22.ctr"
+#line 25 "dk4sock22.ctr"
@@ -60,7 +45,9 @@ dk4socket_set_new(
dk4_socket_set_t *back = NULL;
dk4_socket_t *ps;
size_t i;
-
+#if DK4_USE_ASSERT
+ assert(0 < max);
+#endif
if (0 < max) {
if ((SIZE_MAX / sizeof(dk4_socket_t)) >= max) {
back = dk4mem_new(dk4_socket_set_t,1,erp);
@@ -94,6 +81,9 @@ dk4socket_set_delete(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != set);
+#endif
if (NULL != set) {
if (NULL != set->pSockets) {
dk4mem_release(set->pSockets);
@@ -113,7 +103,9 @@ dk4socket_set_close(
)
{
size_t i;
-
+#if DK4_USE_ASSERT
+ assert(NULL != set);
+#endif
if (NULL != set) {
if (NULL != set->pSockets) {
for (i = 0; i < set->szUsed; i++) {
diff --git a/support/dktools/dk4sock22.ctr b/support/dktools/dk4sock22.ctr
index 06809a82bd..4db16783d1 100644
--- a/support/dktools/dk4sock22.ctr
+++ b/support/dktools/dk4sock22.ctr
@@ -2,16 +2,23 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -27,7 +34,9 @@ dk4socket_set_new(
dk4_socket_set_t *back = NULL;
dk4_socket_t *ps;
size_t i;
-
+#if DK4_USE_ASSERT
+ assert(0 < max);
+#endif
if (0 < max) {
if ((SIZE_MAX / sizeof(dk4_socket_t)) >= max) {
back = dk4mem_new(dk4_socket_set_t,1,erp);
@@ -61,6 +70,9 @@ dk4socket_set_delete(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != set);
+#endif
if (NULL != set) {
if (NULL != set->pSockets) {
dk4mem_release(set->pSockets);
@@ -80,7 +92,9 @@ dk4socket_set_close(
)
{
size_t i;
-
+#if DK4_USE_ASSERT
+ assert(NULL != set);
+#endif
if (NULL != set) {
if (NULL != set->pSockets) {
for (i = 0; i < set->szUsed; i++) {
diff --git a/support/dktools/dk4sock23.c b/support/dktools/dk4sock23.c
index a65cfea596..afce322685 100644
--- a/support/dktools/dk4sock23.c
+++ b/support/dktools/dk4sock23.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock23.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock23.ctr
*/
/** @file dk4sock23.c The dk4sock23 module.
@@ -40,14 +18,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 8 "dk4sock23.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 16 "dk4sock23.ctr"
+#line 23 "dk4sock23.ctr"
@@ -69,7 +54,9 @@ dk4socket_set_server_directly(
#if DK4_HAVE_SETSOCKOPT && (defined(SO_REUSEPORT) || defined(SO_REUSEADDR))
int opt;
#endif
-
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
if (0 < portno) {
max = 1;
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
@@ -99,13 +86,13 @@ dk4socket_set_server_directly(
);
if (0 != res) {
-#line 66 "dk4sock23.ctr"
+#line 75 "dk4sock23.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 70 "dk4sock23.ctr"
+#line 79 "dk4sock23.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -113,12 +100,12 @@ dk4socket_set_server_directly(
);
if (0 != res) {
-#line 76 "dk4sock23.ctr"
+#line 85 "dk4sock23.ctr"
}
#else
-#line 79 "dk4sock23.ctr"
+#line 88 "dk4sock23.ctr"
#endif
#endif
@@ -164,13 +151,13 @@ dk4socket_set_server_directly(
);
if (0 != res) {
-#line 123 "dk4sock23.ctr"
+#line 132 "dk4sock23.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 127 "dk4sock23.ctr"
+#line 136 "dk4sock23.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -178,12 +165,12 @@ dk4socket_set_server_directly(
);
if (0 != res) {
-#line 133 "dk4sock23.ctr"
+#line 142 "dk4sock23.ctr"
}
#else
-#line 136 "dk4sock23.ctr"
+#line 145 "dk4sock23.ctr"
#endif
#endif
res = dk4socket_bind(
diff --git a/support/dktools/dk4sock23.ctr b/support/dktools/dk4sock23.ctr
index 8e711a175a..ccd9e90af0 100644
--- a/support/dktools/dk4sock23.ctr
+++ b/support/dktools/dk4sock23.ctr
@@ -2,14 +2,21 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -34,7 +41,9 @@ dk4socket_set_server_directly(
#if DK4_HAVE_SETSOCKOPT && (defined(SO_REUSEPORT) || defined(SO_REUSEADDR))
int opt;
#endif
-
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
if (0 < portno) {
max = 1;
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
diff --git a/support/dktools/dk4sock24.c b/support/dktools/dk4sock24.c
index ac1d6a0453..158c6b089f 100644
--- a/support/dktools/dk4sock24.c
+++ b/support/dktools/dk4sock24.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock24.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock24.ctr
*/
/** @file dk4sock24.c The dk4sock24 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4sock24.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
@@ -48,11 +27,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 22 "dk4sock24.ctr"
+#line 29 "dk4sock24.ctr"
@@ -87,7 +72,11 @@ dk4socket_c8_set_service_num_flag(
#endif
-#line 55 "dk4sock24.ctr"
+#line 62 "dk4sock24.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+ assert(0 < backlog);
+#endif
if (NULL != servicename) {
DK4_MEMRES(&hints, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@@ -106,13 +95,13 @@ dk4socket_c8_set_service_num_flag(
while (NULL != paddr) { numad++; paddr = paddr->ai_next; }
if (0 < numad) {
-#line 72 "dk4sock24.ctr"
+#line 83 "dk4sock24.ctr"
paddr = addri;
back = dk4socket_set_new(numad, erp);
if (NULL != back) {
while (NULL != paddr) {
-#line 76 "dk4sock24.ctr"
+#line 87 "dk4sock24.ctr"
(back->pSockets)[back->szUsed] = dk4socket_open(
paddr->ai_family, SOCK_STREAM, 0, erp
);
@@ -120,7 +109,7 @@ dk4socket_c8_set_service_num_flag(
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEPORT)
-#line 82 "dk4sock24.ctr"
+#line 93 "dk4sock24.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -128,13 +117,13 @@ dk4socket_c8_set_service_num_flag(
);
if (0 != res) {
-#line 88 "dk4sock24.ctr"
+#line 99 "dk4sock24.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 92 "dk4sock24.ctr"
+#line 103 "dk4sock24.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -142,12 +131,12 @@ dk4socket_c8_set_service_num_flag(
);
if (0 != res) {
-#line 98 "dk4sock24.ctr"
+#line 109 "dk4sock24.ctr"
}
#else
-#line 101 "dk4sock24.ctr"
+#line 112 "dk4sock24.ctr"
#endif
#endif
res = dk4socket_bind(
@@ -162,22 +151,22 @@ dk4socket_c8_set_service_num_flag(
back->szUsed += 1;
-#line 114 "dk4sock24.ctr"
+#line 125 "dk4sock24.ctr"
} else {
-#line 115 "dk4sock24.ctr"
+#line 126 "dk4sock24.ctr"
(void)dk4socket_close((back->pSockets)[back->szUsed], NULL);
(back->pSockets)[back->szUsed] = INVALID_SOCKET;
}
} else {
-#line 119 "dk4sock24.ctr"
+#line 130 "dk4sock24.ctr"
(void)dk4socket_close((back->pSockets)[back->szUsed], NULL);
(back->pSockets)[back->szUsed] = INVALID_SOCKET;
}
} else {
-#line 123 "dk4sock24.ctr"
+#line 134 "dk4sock24.ctr"
}
paddr = paddr->ai_next;
}
@@ -196,7 +185,7 @@ dk4socket_c8_set_service_num_flag(
}
-#line 140 "dk4sock24.ctr"
+#line 151 "dk4sock24.ctr"
return back;
/* ----- +getaddrinfo */
#else
@@ -209,7 +198,11 @@ dk4socket_c8_set_service_num_flag(
unsigned short portno = 0;
-#line 151 "dk4sock24.ctr"
+#line 162 "dk4sock24.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+ assert(0 < backlog);
+#endif
if (NULL != servicename) {
res = dk4ma_input_c8_dec_ushort(
&portno, servicename, &endptr, 1, NULL
@@ -233,7 +226,7 @@ dk4socket_c8_set_service_num_flag(
}
-#line 173 "dk4sock24.ctr"
+#line 188 "dk4sock24.ctr"
return back;
/* ----- -getaddrinfo */
#endif
@@ -254,6 +247,10 @@ dk4socket_c8_set_server(
char pnb[16*sizeof(dk4_um_t)];
dk4_socket_set_t *back = NULL;
int res;
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+ assert(0 < backlog);
+#endif
if (0 < portno) {
res = dk4ma_write_c8_decimal_unsigned(
pnb, sizeof(pnb), (dk4_um_t)portno, 0, erp
@@ -287,6 +284,10 @@ dk4socket_c8_set_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+ assert(0 < backlog);
+#endif
return (
dk4socket_c8_set_service_num_flag(servicename, backlog, local, 0, erp)
);
diff --git a/support/dktools/dk4sock24.ctr b/support/dktools/dk4sock24.ctr
index cce68e3b8d..e05f48cdea 100644
--- a/support/dktools/dk4sock24.ctr
+++ b/support/dktools/dk4sock24.ctr
@@ -2,11 +2,12 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
@@ -16,6 +17,12 @@ license = bsd
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -52,6 +59,10 @@ dk4socket_c8_set_service_num_flag(
int opt = 0;
#endif
$? "+ dk4socket_c8_set_service_num_flag"
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+ assert(0 < backlog);
+#endif
if (NULL != servicename) {
DK4_MEMRES(&hints, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@@ -148,6 +159,10 @@ dk4socket_c8_set_service_num_flag(
int res = 0;
unsigned short portno = 0;
$? "+ dk4socket_c8_set_service_num_flag"
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+ assert(0 < backlog);
+#endif
if (NULL != servicename) {
res = dk4ma_input_c8_dec_ushort(
&portno, servicename, &endptr, 1, NULL
@@ -190,6 +205,10 @@ dk4socket_c8_set_server(
char pnb[16*sizeof(dk4_um_t)];
dk4_socket_set_t *back = NULL;
int res;
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+ assert(0 < backlog);
+#endif
if (0 < portno) {
res = dk4ma_write_c8_decimal_unsigned(
pnb, sizeof(pnb), (dk4_um_t)portno, 0, erp
@@ -223,6 +242,10 @@ dk4socket_c8_set_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+ assert(0 < backlog);
+#endif
return (
dk4socket_c8_set_service_num_flag(servicename, backlog, local, 0, erp)
);
diff --git a/support/dktools/dk4sock25.c b/support/dktools/dk4sock25.c
index e844e4920f..aad4a87d9c 100644
--- a/support/dktools/dk4sock25.c
+++ b/support/dktools/dk4sock25.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock25.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock25.ctr
*/
/** @file dk4sock25.c The dk4sock25 module.
@@ -41,6 +19,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
@@ -52,11 +31,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4rec24.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 27 "dk4sock25.ctr"
+#line 34 "dk4sock25.ctr"
@@ -123,7 +108,7 @@ dk4socket_wc_set_service_num_flag(
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEPORT)
-#line 92 "dk4sock25.ctr"
+#line 99 "dk4sock25.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -131,13 +116,13 @@ dk4socket_wc_set_service_num_flag(
);
if (0 != res) {
-#line 98 "dk4sock25.ctr"
+#line 105 "dk4sock25.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 102 "dk4sock25.ctr"
+#line 109 "dk4sock25.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -145,12 +130,12 @@ dk4socket_wc_set_service_num_flag(
);
if (0 != res) {
-#line 108 "dk4sock25.ctr"
+#line 115 "dk4sock25.ctr"
}
#else
-#line 111 "dk4sock25.ctr"
+#line 118 "dk4sock25.ctr"
#endif
#endif
res = dk4socket_bind(
@@ -186,7 +171,7 @@ dk4socket_wc_set_service_num_flag(
}
}
}
- FreeAddrInfo(addri);
+ FreeAddrInfoW(addri);
} else {
dk4error_set_idetails(erp, DK4_E_SOCKET_GETADDRLOC, res);
}
@@ -305,6 +290,10 @@ dk4socket_set_server(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+ assert(0 < backlog);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_set_server(portno, backlog, local, erp)
@@ -326,6 +315,10 @@ dk4socket_set_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+ assert(0 < backlog);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_set_service(servicename, backlog, local, erp)
diff --git a/support/dktools/dk4sock25.ctr b/support/dktools/dk4sock25.ctr
index f24299cb5a..08465e4983 100644
--- a/support/dktools/dk4sock25.ctr
+++ b/support/dktools/dk4sock25.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -10,6 +10,7 @@ license = bsd
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
@@ -21,6 +22,12 @@ license = bsd
#include "dk4rec24.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -143,7 +150,7 @@ dk4socket_wc_set_service_num_flag(
}
}
}
- FreeAddrInfo(addri);
+ FreeAddrInfoW(addri);
} else {
dk4error_set_idetails(erp, DK4_E_SOCKET_GETADDRLOC, res);
}
@@ -262,6 +269,10 @@ dk4socket_set_server(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+ assert(0 < backlog);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_set_server(portno, backlog, local, erp)
@@ -283,6 +294,10 @@ dk4socket_set_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+ assert(0 < backlog);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_set_service(servicename, backlog, local, erp)
diff --git a/support/dktools/dk4sock26.c b/support/dktools/dk4sock26.c
index 793b5dff0a..4900ec9310 100644
--- a/support/dktools/dk4sock26.c
+++ b/support/dktools/dk4sock26.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock26.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock26.ctr
*/
/** @file dk4sock26.c The dk4sock26 module.
@@ -49,11 +27,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4str8.h"
#include "dk4mai8dsz.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 22 "dk4sock26.ctr"
+#line 28 "dk4sock26.ctr"
@@ -146,7 +130,11 @@ dk4socket_c8_get_allowed_peer(
int res = 0;
-#line 113 "dk4sock26.ctr"
+#line 119 "dk4sock26.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != peerptr);
+ assert(NULL != str);
+#endif
if ((NULL != peerptr) && (NULL != str)) {
if (0 != dk4str8_cpy_s(mycp, sizeof(mycp), str, erp)) {
maptr = dk4str8_chr(mycp, '/');
@@ -163,11 +151,11 @@ dk4socket_c8_get_allowed_peer(
back = DK4_SOCKET_RESULT_FAILED;
if (NULL != maptr) {
-#line 128 "dk4sock26.ctr"
+#line 138 "dk4sock26.ctr"
res = dk4ma_input_c8_dec_size_t(&bitno, maptr, &endptr, 1, NULL);
if (0 != res) {
-#line 130 "dk4sock26.ctr"
+#line 140 "dk4sock26.ctr"
/* Bit number was specified.
*/
switch (af) {
@@ -180,7 +168,7 @@ dk4socket_c8_get_allowed_peer(
back = DK4_SOCKET_RESULT_SUCCESS;
} else {
-#line 141 "dk4sock26.ctr"
+#line 151 "dk4sock26.ctr"
}
} break;
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
@@ -192,7 +180,7 @@ dk4socket_c8_get_allowed_peer(
peerptr->af = af;
} else {
-#line 151 "dk4sock26.ctr"
+#line 161 "dk4sock26.ctr"
}
} break;
#endif
@@ -202,7 +190,7 @@ dk4socket_c8_get_allowed_peer(
}
} else {
-#line 159 "dk4sock26.ctr"
+#line 169 "dk4sock26.ctr"
/* Not a bit number, probably an address.
*/
switch (af) {
@@ -216,7 +204,7 @@ dk4socket_c8_get_allowed_peer(
peerptr->af = af;
} else {
-#line 171 "dk4sock26.ctr"
+#line 181 "dk4sock26.ctr"
}
} break;
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
@@ -230,7 +218,7 @@ dk4socket_c8_get_allowed_peer(
peerptr->af = af;
} else {
-#line 183 "dk4sock26.ctr"
+#line 193 "dk4sock26.ctr"
}
} break;
#endif
@@ -238,7 +226,7 @@ dk4socket_c8_get_allowed_peer(
}
} else {
-#line 189 "dk4sock26.ctr"
+#line 199 "dk4sock26.ctr"
/* Host was specified
*/
switch (af) {
@@ -265,15 +253,15 @@ dk4socket_c8_get_allowed_peer(
}
} else {
-#line 214 "dk4sock26.ctr"
+#line 224 "dk4sock26.ctr"
}
} else {
-#line 216 "dk4sock26.ctr"
+#line 226 "dk4sock26.ctr"
}
} else {
-#line 218 "dk4sock26.ctr"
+#line 228 "dk4sock26.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
#if TRACE_DEBUG
@@ -283,7 +271,7 @@ dk4socket_c8_get_allowed_peer(
#endif
-#line 226 "dk4sock26.ctr"
+#line 236 "dk4sock26.ctr"
return back;
}
diff --git a/support/dktools/dk4sock26.ctr b/support/dktools/dk4sock26.ctr
index 6a26fd6f81..88ac2937ae 100644
--- a/support/dktools/dk4sock26.ctr
+++ b/support/dktools/dk4sock26.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -16,6 +16,12 @@ license = bsd
#include "dk4str8.h"
#include "dk4mai8dsz.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -110,6 +116,10 @@ dk4socket_c8_get_allowed_peer(
int af = AF_UNSPEC;
int res = 0;
$? "+ dk4socket_c8_get_allowed_peer \"%!8s\"", str
+#if DK4_USE_ASSERT
+ assert(NULL != peerptr);
+ assert(NULL != str);
+#endif
if ((NULL != peerptr) && (NULL != str)) {
if (0 != dk4str8_cpy_s(mycp, sizeof(mycp), str, erp)) {
maptr = dk4str8_chr(mycp, '/');
diff --git a/support/dktools/dk4sock27.c b/support/dktools/dk4sock27.c
index 7a65e34eaf..6c0b619cfb 100644
--- a/support/dktools/dk4sock27.c
+++ b/support/dktools/dk4sock27.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock27.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock27.ctr
*/
/** @file dk4sock27.c The dk4sock27 module.
@@ -49,11 +27,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dsz.h"
#include "dk4maiwdsz.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 25 "dk4sock27.ctr"
+#line 31 "dk4sock27.ctr"
@@ -61,6 +45,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if DK4_ON_WINDOWS
+static
int
dk4socket_wc_get_allowed_peer(
dk4_allowed_peer_t *peerptr,
@@ -85,6 +70,10 @@ dk4socket_wc_get_allowed_peer(
int back = DK4_SOCKET_RESULT_FAILED;
int af = AF_UNSPEC;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != peerptr);
+ assert(NULL != str);
+#endif
if ((NULL != peerptr) && (NULL != str)) {
if (0 != dk4strw_cpy_s(mycp, DK4_SIZEOF(mycp,wchar_t), str, erp)) {
maptr = dk4strw_chr(mycp, L'/');
@@ -202,6 +191,10 @@ dk4socket_get_allowed_peer(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != peerptr);
+ assert(NULL != str);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_get_allowed_peer(peerptr, str, erp)
diff --git a/support/dktools/dk4sock27.ctr b/support/dktools/dk4sock27.ctr
index f63fdb21a7..125550b154 100644
--- a/support/dktools/dk4sock27.ctr
+++ b/support/dktools/dk4sock27.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -19,6 +19,12 @@ license = bsd
#include "dk4mai8dsz.h"
#include "dk4maiwdsz.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -29,6 +35,7 @@ $!trace-include
#if DK4_ON_WINDOWS
+static
int
dk4socket_wc_get_allowed_peer(
dk4_allowed_peer_t *peerptr,
@@ -53,6 +60,10 @@ dk4socket_wc_get_allowed_peer(
int back = DK4_SOCKET_RESULT_FAILED;
int af = AF_UNSPEC;
int res = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != peerptr);
+ assert(NULL != str);
+#endif
if ((NULL != peerptr) && (NULL != str)) {
if (0 != dk4strw_cpy_s(mycp, DK4_SIZEOF(mycp,wchar_t), str, erp)) {
maptr = dk4strw_chr(mycp, L'/');
@@ -170,6 +181,10 @@ dk4socket_get_allowed_peer(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != peerptr);
+ assert(NULL != str);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_get_allowed_peer(peerptr, str, erp)
diff --git a/support/dktools/dk4sock28.c b/support/dktools/dk4sock28.c
index 025d0095b6..009f6b1a05 100644
--- a/support/dktools/dk4sock28.c
+++ b/support/dktools/dk4sock28.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock28.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock28.ctr
*/
/** @file dk4sock28.c The dk4sock28 module.
diff --git a/support/dktools/dk4sock28.ctr b/support/dktools/dk4sock28.ctr
index e54365d4be..44d2fb0382 100644
--- a/support/dktools/dk4sock28.ctr
+++ b/support/dktools/dk4sock28.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dk4sock29.c b/support/dktools/dk4sock29.c
index fbf2862301..45232191a5 100644
--- a/support/dktools/dk4sock29.c
+++ b/support/dktools/dk4sock29.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock29.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock29.ctr
*/
/** @file dk4sock29.c The dk4sock29 module.
@@ -39,14 +17,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 8 "dk4sock29.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 15 "dk4sock29.ctr"
+#line 22 "dk4sock29.ctr"
@@ -68,7 +53,9 @@ dk4socket_set_udp_directly(
#if DK4_HAVE_SETSOCKOPT && (defined(SO_REUSEPORT) || defined(SO_REUSEADDR))
int opt;
#endif
-
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
if (0 < portno) {
max = 1;
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
@@ -98,13 +85,13 @@ dk4socket_set_udp_directly(
);
if (0 != res) {
-#line 65 "dk4sock29.ctr"
+#line 74 "dk4sock29.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 69 "dk4sock29.ctr"
+#line 78 "dk4sock29.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -112,18 +99,18 @@ dk4socket_set_udp_directly(
);
if (0 != res) {
-#line 75 "dk4sock29.ctr"
+#line 84 "dk4sock29.ctr"
}
#else
-#line 78 "dk4sock29.ctr"
+#line 87 "dk4sock29.ctr"
#endif
#endif
#if DK4_HAVE_SETSOCKOPT && defined(SO_BROADCAST)
-#line 82 "dk4sock29.ctr"
+#line 91 "dk4sock29.ctr"
if (0 != broadcast) {
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
@@ -132,13 +119,13 @@ dk4socket_set_udp_directly(
);
if (0 != res) {
-#line 89 "dk4sock29.ctr"
+#line 98 "dk4sock29.ctr"
}
}
#else
-#line 93 "dk4sock29.ctr"
+#line 102 "dk4sock29.ctr"
#endif
res = dk4socket_bind(
(back->pSockets)[back->szUsed],
@@ -172,13 +159,13 @@ dk4socket_set_udp_directly(
);
if (0 != res) {
-#line 125 "dk4sock29.ctr"
+#line 134 "dk4sock29.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 129 "dk4sock29.ctr"
+#line 138 "dk4sock29.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -186,18 +173,18 @@ dk4socket_set_udp_directly(
);
if (0 != res) {
-#line 135 "dk4sock29.ctr"
+#line 144 "dk4sock29.ctr"
}
#else
-#line 138 "dk4sock29.ctr"
+#line 147 "dk4sock29.ctr"
#endif
#endif
#if DK4_HAVE_SETSOCKOPT && defined(SO_BROADCAST)
-#line 142 "dk4sock29.ctr"
+#line 151 "dk4sock29.ctr"
if (0 != broadcast) {
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
@@ -206,13 +193,13 @@ dk4socket_set_udp_directly(
);
if (0 != res) {
-#line 149 "dk4sock29.ctr"
+#line 158 "dk4sock29.ctr"
}
}
#else
-#line 153 "dk4sock29.ctr"
+#line 162 "dk4sock29.ctr"
#endif
res = dk4socket_bind(
diff --git a/support/dktools/dk4sock29.ctr b/support/dktools/dk4sock29.ctr
index a5553e0cf2..9fc724206d 100644
--- a/support/dktools/dk4sock29.ctr
+++ b/support/dktools/dk4sock29.ctr
@@ -2,13 +2,20 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -33,7 +40,9 @@ dk4socket_set_udp_directly(
#if DK4_HAVE_SETSOCKOPT && (defined(SO_REUSEPORT) || defined(SO_REUSEADDR))
int opt;
#endif
-
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
if (0 < portno) {
max = 1;
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
diff --git a/support/dktools/dk4sock30.c b/support/dktools/dk4sock30.c
index 11a7254fa2..e5eb7733dc 100644
--- a/support/dktools/dk4sock30.c
+++ b/support/dktools/dk4sock30.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock30.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock30.ctr
*/
/** @file dk4sock30.c The dk4sock30 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4sock30.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
@@ -48,11 +27,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 22 "dk4sock30.ctr"
+#line 29 "dk4sock30.ctr"
@@ -87,7 +72,10 @@ dk4socket_c8_set_udp_num_flag(
#endif
-#line 55 "dk4sock30.ctr"
+#line 62 "dk4sock30.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
if (NULL != servicename) {
DK4_MEMRES(&hints, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@@ -106,13 +94,13 @@ dk4socket_c8_set_udp_num_flag(
while (NULL != paddr) { numad++; paddr = paddr->ai_next; }
if (0 < numad) {
-#line 72 "dk4sock30.ctr"
+#line 82 "dk4sock30.ctr"
paddr = addri;
back = dk4socket_set_new(numad, erp);
if (NULL != back) {
while (NULL != paddr) {
-#line 76 "dk4sock30.ctr"
+#line 86 "dk4sock30.ctr"
(back->pSockets)[back->szUsed] = dk4socket_open(
paddr->ai_family, SOCK_DGRAM, 0, erp
);
@@ -120,7 +108,7 @@ dk4socket_c8_set_udp_num_flag(
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEPORT)
-#line 82 "dk4sock30.ctr"
+#line 92 "dk4sock30.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -128,13 +116,13 @@ dk4socket_c8_set_udp_num_flag(
);
if (0 != res) {
-#line 88 "dk4sock30.ctr"
+#line 98 "dk4sock30.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 92 "dk4sock30.ctr"
+#line 102 "dk4sock30.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -142,18 +130,18 @@ dk4socket_c8_set_udp_num_flag(
);
if (0 != res) {
-#line 98 "dk4sock30.ctr"
+#line 108 "dk4sock30.ctr"
}
#else
-#line 101 "dk4sock30.ctr"
+#line 111 "dk4sock30.ctr"
#endif
#endif
#if DK4_HAVE_SETSOCKOPT && defined(SO_BROADCAST)
-#line 105 "dk4sock30.ctr"
+#line 115 "dk4sock30.ctr"
if (0 != broadcast) {
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
@@ -162,13 +150,13 @@ dk4socket_c8_set_udp_num_flag(
);
if (0 != res) {
-#line 112 "dk4sock30.ctr"
+#line 122 "dk4sock30.ctr"
}
}
#else
-#line 116 "dk4sock30.ctr"
+#line 126 "dk4sock30.ctr"
#endif
res = dk4socket_bind(
(back->pSockets)[back->szUsed], paddr->ai_addr,
@@ -178,16 +166,16 @@ dk4socket_c8_set_udp_num_flag(
back->szUsed += 1;
-#line 124 "dk4sock30.ctr"
+#line 134 "dk4sock30.ctr"
} else {
-#line 125 "dk4sock30.ctr"
+#line 135 "dk4sock30.ctr"
(void)dk4socket_close((back->pSockets)[back->szUsed], NULL);
(back->pSockets)[back->szUsed] = INVALID_SOCKET;
}
} else {
-#line 129 "dk4sock30.ctr"
+#line 139 "dk4sock30.ctr"
}
paddr = paddr->ai_next;
}
@@ -206,7 +194,7 @@ dk4socket_c8_set_udp_num_flag(
}
-#line 146 "dk4sock30.ctr"
+#line 156 "dk4sock30.ctr"
return back;
/* ----- +getaddrinfo */
#else
@@ -219,7 +207,10 @@ dk4socket_c8_set_udp_num_flag(
unsigned short portno = 0;
-#line 157 "dk4sock30.ctr"
+#line 167 "dk4sock30.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
if (NULL != servicename) {
res = dk4ma_input_c8_dec_ushort(
&portno, servicename, &endptr, 1, NULL
@@ -243,7 +234,7 @@ dk4socket_c8_set_udp_num_flag(
}
-#line 179 "dk4sock30.ctr"
+#line 192 "dk4sock30.ctr"
return back;
/* ----- -getaddrinfo */
#endif
@@ -264,6 +255,9 @@ dk4socket_c8_set_udp(
char pnb[16*sizeof(dk4_um_t)];
dk4_socket_set_t *back = NULL;
int res;
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
if (0 < portno) {
res = dk4ma_write_c8_decimal_unsigned(
pnb, sizeof(pnb), (dk4_um_t)portno, 0, erp
@@ -297,6 +291,9 @@ dk4socket_c8_set_udp_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
return (
dk4socket_c8_set_udp_num_flag(servicename, local, broadcast, 0, erp)
);
diff --git a/support/dktools/dk4sock30.ctr b/support/dktools/dk4sock30.ctr
index eb97c5f740..0665d8907f 100644
--- a/support/dktools/dk4sock30.ctr
+++ b/support/dktools/dk4sock30.ctr
@@ -2,11 +2,12 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
@@ -16,6 +17,12 @@ license = bsd
#include "dk4mai8dus.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -52,6 +59,9 @@ dk4socket_c8_set_udp_num_flag(
int opt = 0;
#endif
$? "+ dk4socket_c8_set_udp_num_flag"
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
if (NULL != servicename) {
DK4_MEMRES(&hints, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@@ -154,6 +164,9 @@ dk4socket_c8_set_udp_num_flag(
int res = 0;
unsigned short portno = 0;
$? "+ dk4socket_c8_set_udp_num_flag"
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
if (NULL != servicename) {
res = dk4ma_input_c8_dec_ushort(
&portno, servicename, &endptr, 1, NULL
@@ -196,6 +209,9 @@ dk4socket_c8_set_udp(
char pnb[16*sizeof(dk4_um_t)];
dk4_socket_set_t *back = NULL;
int res;
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
if (0 < portno) {
res = dk4ma_write_c8_decimal_unsigned(
pnb, sizeof(pnb), (dk4_um_t)portno, 0, erp
@@ -229,6 +245,9 @@ dk4socket_c8_set_udp_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
return (
dk4socket_c8_set_udp_num_flag(servicename, local, broadcast, 0, erp)
);
diff --git a/support/dktools/dk4sock31.c b/support/dktools/dk4sock31.c
index df8ded713f..c82018707f 100644
--- a/support/dktools/dk4sock31.c
+++ b/support/dktools/dk4sock31.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock31.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock31.ctr
*/
/** @file dk4sock31.c The dk4sock31 module.
@@ -41,6 +19,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
@@ -52,11 +31,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4rec24.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 27 "dk4sock31.ctr"
+#line 34 "dk4sock31.ctr"
@@ -94,7 +79,9 @@ dk4socket_wc_set_udp_num_flag(
#if DK4_HAVE_SETSOCKOPT && (defined(SO_REUSEPORT) || defined(SO_REUSEADDR))
int opt = 0;
#endif
-
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
if (NULL != servicename) {
DK4_MEMRES(&hints, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@@ -123,7 +110,7 @@ dk4socket_wc_set_udp_num_flag(
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEPORT)
-#line 92 "dk4sock31.ctr"
+#line 101 "dk4sock31.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -131,13 +118,13 @@ dk4socket_wc_set_udp_num_flag(
);
if (0 != res) {
-#line 98 "dk4sock31.ctr"
+#line 107 "dk4sock31.ctr"
}
#else
#if DK4_HAVE_SETSOCKOPT && defined(SO_REUSEADDR)
-#line 102 "dk4sock31.ctr"
+#line 111 "dk4sock31.ctr"
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
(back->pSockets)[back->szUsed], SOL_SOCKET,
@@ -145,18 +132,18 @@ dk4socket_wc_set_udp_num_flag(
);
if (0 != res) {
-#line 108 "dk4sock31.ctr"
+#line 117 "dk4sock31.ctr"
}
#else
-#line 111 "dk4sock31.ctr"
+#line 120 "dk4sock31.ctr"
#endif
#endif
#if DK4_HAVE_SETSOCKOPT && defined(SO_BROADCAST)
-#line 115 "dk4sock31.ctr"
+#line 124 "dk4sock31.ctr"
if (0 != broadcast) {
dk4socket_set_one_bytes(&opt, sizeof(opt));
res = setsockopt(
@@ -165,13 +152,13 @@ dk4socket_wc_set_udp_num_flag(
);
if (0 != res) {
-#line 122 "dk4sock31.ctr"
+#line 131 "dk4sock31.ctr"
}
}
#else
-#line 126 "dk4sock31.ctr"
+#line 135 "dk4sock31.ctr"
#endif
res = dk4socket_bind(
(back->pSockets)[back->szUsed], paddr->ai_addr,
@@ -192,7 +179,7 @@ dk4socket_wc_set_udp_num_flag(
}
}
}
- FreeAddrInfo(addri);
+ FreeAddrInfoW(addri);
} else {
dk4error_set_idetails(erp, DK4_E_SOCKET_GETADDRLOC, res);
}
@@ -210,6 +197,9 @@ dk4socket_wc_set_udp_num_flag(
int iport = 0;
int res = 0;
unsigned short portno = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
if (NULL != servicename) {
res = dk4ma_input_wc_dec_ushort(
&portno, servicename, &endptr, 1, erp
@@ -254,6 +244,9 @@ dk4socket_wc_set_udp(
wchar_t pnb[16*sizeof(dk4_um_t)];
dk4_socket_set_t *back = NULL;
int res;
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
if (0 < portno) {
res = dk4ma_write_wc_decimal_unsigned(
pnb, DK4_SIZEOF(pnb,wchar_t), (dk4_um_t)portno, 0, erp
@@ -288,6 +281,9 @@ dk4socket_wc_set_udp_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
return (
dk4socket_wc_set_udp_num_flag(servicename, local, broadcast, 0, erp)
);
@@ -311,6 +307,9 @@ dk4socket_set_udp(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_set_udp(portno, local, broadcast, erp)
@@ -332,6 +331,9 @@ dk4socket_set_udp_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_set_udp_service(servicename, local, broadcast, erp)
diff --git a/support/dktools/dk4sock31.ctr b/support/dktools/dk4sock31.ctr
index d63ec4e784..deac56338c 100644
--- a/support/dktools/dk4sock31.ctr
+++ b/support/dktools/dk4sock31.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -10,6 +10,7 @@ license = bsd
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4mem.h"
@@ -21,6 +22,12 @@ license = bsd
#include "dk4rec24.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -61,7 +68,9 @@ dk4socket_wc_set_udp_num_flag(
#if DK4_HAVE_SETSOCKOPT && (defined(SO_REUSEPORT) || defined(SO_REUSEADDR))
int opt = 0;
#endif
-
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
if (NULL != servicename) {
DK4_MEMRES(&hints, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@@ -143,7 +152,7 @@ dk4socket_wc_set_udp_num_flag(
}
}
}
- FreeAddrInfo(addri);
+ FreeAddrInfoW(addri);
} else {
dk4error_set_idetails(erp, DK4_E_SOCKET_GETADDRLOC, res);
}
@@ -161,6 +170,9 @@ dk4socket_wc_set_udp_num_flag(
int iport = 0;
int res = 0;
unsigned short portno = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
if (NULL != servicename) {
res = dk4ma_input_wc_dec_ushort(
&portno, servicename, &endptr, 1, erp
@@ -205,6 +217,9 @@ dk4socket_wc_set_udp(
wchar_t pnb[16*sizeof(dk4_um_t)];
dk4_socket_set_t *back = NULL;
int res;
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
if (0 < portno) {
res = dk4ma_write_wc_decimal_unsigned(
pnb, DK4_SIZEOF(pnb,wchar_t), (dk4_um_t)portno, 0, erp
@@ -239,6 +254,9 @@ dk4socket_wc_set_udp_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
return (
dk4socket_wc_set_udp_num_flag(servicename, local, broadcast, 0, erp)
);
@@ -262,6 +280,9 @@ dk4socket_set_udp(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(0 < portno);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_set_udp(portno, local, broadcast, erp)
@@ -283,6 +304,9 @@ dk4socket_set_udp_service(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != servicename);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_set_udp_service(servicename, local, broadcast, erp)
diff --git a/support/dktools/dk4sock32.c b/support/dktools/dk4sock32.c
index d2cc296a35..7dd7292715 100644
--- a/support/dktools/dk4sock32.c
+++ b/support/dktools/dk4sock32.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock32.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock32.ctr
*/
/** @file dk4sock32.c The dk4sock32 module.
@@ -46,11 +24,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dus.h"
#include "dk4mao8d.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 21 "dk4sock32.ctr"
+#line 27 "dk4sock32.ctr"
@@ -67,6 +51,9 @@ dk4socket_address_family(dk4_sockaddr_storage_t *aptr)
{
struct sockaddr *sa = NULL;
int back = AF_UNSPEC;
+#if DK4_USE_ASSERT
+ assert(NULL != aptr);
+#endif
if (NULL != aptr) {
sa = (struct sockaddr *)aptr;
switch (sa->sa_family) {
@@ -88,7 +75,9 @@ dk4socket_address_size(dk4_sockaddr_storage_t *aptr)
{
struct sockaddr *sa;
size_t back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != aptr);
+#endif
if (NULL != aptr) {
sa = (struct sockaddr *)aptr;
switch (sa->sa_family) {
@@ -122,12 +111,15 @@ dk4socket_complete_addresses(
int back = DK4_SOCKET_RESULT_FAILED;
-#line 91 "dk4sock32.ctr"
+#line 102 "dk4sock32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+#endif
sa = (struct sockaddr *)array;
switch (sa->sa_family) {
case AF_INET : {
-#line 94 "dk4sock32.ctr"
+#line 108 "dk4sock32.ctr"
sa4 = (struct sockaddr_in *)array;
sa4->sin_port = dk4socket_htons(remport);
sa4 = (struct sockaddr_in *)(&(array[1]));
@@ -139,7 +131,7 @@ dk4socket_complete_addresses(
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
case AF_INET6 : {
-#line 104 "dk4sock32.ctr"
+#line 118 "dk4sock32.ctr"
sa6 = (struct sockaddr_in6 *)array;
sa6->sin6_port = dk4socket_htons(remport);
sa6 = (struct sockaddr_in6 *)(&(array[1]));
@@ -152,7 +144,7 @@ dk4socket_complete_addresses(
}
-#line 115 "dk4sock32.ctr"
+#line 129 "dk4sock32.ctr"
return back;
}
diff --git a/support/dktools/dk4sock32.ctr b/support/dktools/dk4sock32.ctr
index 686db27b73..9c63750459 100644
--- a/support/dktools/dk4sock32.ctr
+++ b/support/dktools/dk4sock32.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,6 +15,12 @@ license = bsd
#include "dk4mai8dus.h"
#include "dk4mao8d.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -34,6 +40,9 @@ dk4socket_address_family(dk4_sockaddr_storage_t *aptr)
{
struct sockaddr *sa = NULL;
int back = AF_UNSPEC;
+#if DK4_USE_ASSERT
+ assert(NULL != aptr);
+#endif
if (NULL != aptr) {
sa = (struct sockaddr *)aptr;
switch (sa->sa_family) {
@@ -55,7 +64,9 @@ dk4socket_address_size(dk4_sockaddr_storage_t *aptr)
{
struct sockaddr *sa;
size_t back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != aptr);
+#endif
if (NULL != aptr) {
sa = (struct sockaddr *)aptr;
switch (sa->sa_family) {
@@ -88,6 +99,9 @@ dk4socket_complete_addresses(
struct sockaddr *sa;
int back = DK4_SOCKET_RESULT_FAILED;
$? "+ dk4socket_complete_addresses"
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+#endif
sa = (struct sockaddr *)array;
switch (sa->sa_family) {
case AF_INET : { $? ". IPv4"
diff --git a/support/dktools/dk4sock33.c b/support/dktools/dk4sock33.c
index d2f47ade70..de76192161 100644
--- a/support/dktools/dk4sock33.c
+++ b/support/dktools/dk4sock33.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock33.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock33.ctr
*/
/** @file dk4sock33.c The dk4sock33 module.
@@ -46,11 +24,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mai8dus.h"
#include "dk4mao8d.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 21 "dk4sock33.ctr"
+#line 27 "dk4sock33.ctr"
@@ -75,11 +59,15 @@ dk4socket_c8_find_address(dk4_sockaddr_storage_t *dptr, const char *str)
int res;
-#line 44 "dk4sock33.ctr"
+#line 50 "dk4sock33.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != str);
+#endif
res = dk4socket_c8_inet_pton(&addr4, sizeof(addr4), AF_INET, str, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 46 "dk4sock33.ctr"
+#line 56 "dk4sock33.ctr"
in4 = (struct sockaddr_in *)dptr;
in4->sin_family = AF_INET;
DK4_MEMCPY(&(in4->sin_addr), &addr4, sizeof(addr4));
@@ -89,7 +77,7 @@ dk4socket_c8_find_address(dk4_sockaddr_storage_t *dptr, const char *str)
res = dk4socket_c8_inet_pton(&addr6, sizeof(addr6), AF_INET6, str, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 54 "dk4sock33.ctr"
+#line 64 "dk4sock33.ctr"
in6 = (struct sockaddr_in6 *)dptr;
in6->sin6_family = AF_INET6;
DK4_MEMCPY(&(in6->sin6_addr), &addr6, sizeof(addr6));
@@ -99,7 +87,7 @@ dk4socket_c8_find_address(dk4_sockaddr_storage_t *dptr, const char *str)
}
-#line 62 "dk4sock33.ctr"
+#line 72 "dk4sock33.ctr"
return back;
}
@@ -130,7 +118,12 @@ dk4socket_c8_find_host(
int res = 0;
-#line 91 "dk4sock33.ctr"
+#line 101 "dk4sock33.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != remhost);
+ assert(0 < remport);
+#endif
res = dk4ma_write_c8_decimal_unsigned(
buf, sizeof(buf), (dk4_um_t)remport, 0, NULL
);
@@ -143,32 +136,32 @@ dk4socket_c8_find_host(
res = getaddrinfo(remhost, buf, &hints, &results);
if ((0 == res) && (NULL != results)) {
-#line 102 "dk4sock33.ctr"
+#line 117 "dk4sock33.ctr"
if (0 != ip4) {
-#line 103 "dk4sock33.ctr"
+#line 118 "dk4sock33.ctr"
rptr = results;
while ((NULL != rptr) && (0 == back)) {
-#line 105 "dk4sock33.ctr"
+#line 120 "dk4sock33.ctr"
if ((0 < rptr->ai_addrlen) && (NULL != rptr->ai_addr)) {
if (AF_INET == rptr->ai_addr->sa_family) {
if (sizeof(dk4_sockaddr_storage_t) >= rptr->ai_addrlen) {
DK4_MEMCPY(dptr, rptr->ai_addr, rptr->ai_addrlen);
back = 1;
-#line 110 "dk4sock33.ctr"
+#line 125 "dk4sock33.ctr"
} else {
-#line 111 "dk4sock33.ctr"
+#line 126 "dk4sock33.ctr"
}
} else {
-#line 113 "dk4sock33.ctr"
+#line 128 "dk4sock33.ctr"
}
} else {
-#line 115 "dk4sock33.ctr"
+#line 130 "dk4sock33.ctr"
}
rptr = rptr->ai_next;
}
@@ -176,60 +169,60 @@ dk4socket_c8_find_host(
rptr = results;
while ((NULL != rptr) && (0 == back)) {
-#line 121 "dk4sock33.ctr"
+#line 136 "dk4sock33.ctr"
if ((0 < rptr->ai_addrlen) && (NULL != rptr->ai_addr)) {
if (sizeof(dk4_sockaddr_storage_t) >= rptr->ai_addrlen) {
DK4_MEMCPY(dptr, rptr->ai_addr, rptr->ai_addrlen);
back = 1;
-#line 125 "dk4sock33.ctr"
+#line 140 "dk4sock33.ctr"
} else {
-#line 126 "dk4sock33.ctr"
+#line 141 "dk4sock33.ctr"
}
} else {
-#line 128 "dk4sock33.ctr"
+#line 143 "dk4sock33.ctr"
}
rptr = rptr->ai_next;
}
}
} else {
-#line 133 "dk4sock33.ctr"
+#line 148 "dk4sock33.ctr"
rptr = results;
while ((NULL != rptr) && (0 == back)) {
-#line 135 "dk4sock33.ctr"
+#line 150 "dk4sock33.ctr"
if ((0 < rptr->ai_addrlen) && (NULL != rptr->ai_addr)) {
if (sizeof(dk4_sockaddr_storage_t) >= rptr->ai_addrlen) {
DK4_MEMCPY(dptr, rptr->ai_addr, rptr->ai_addrlen);
back = 1;
-#line 139 "dk4sock33.ctr"
+#line 154 "dk4sock33.ctr"
} else {
-#line 140 "dk4sock33.ctr"
+#line 155 "dk4sock33.ctr"
}
} else {
-#line 142 "dk4sock33.ctr"
+#line 157 "dk4sock33.ctr"
}
rptr = rptr->ai_next;
}
}
} else {
-#line 147 "dk4sock33.ctr"
+#line 162 "dk4sock33.ctr"
}
if (NULL != results) { freeaddrinfo(results); }
} else {
-#line 150 "dk4sock33.ctr"
+#line 165 "dk4sock33.ctr"
}
-#line 152 "dk4sock33.ctr"
+#line 167 "dk4sock33.ctr"
return back;
#else
#if DK4_HAVE_GETHOSTBYNAME
@@ -241,21 +234,26 @@ dk4socket_c8_find_host(
int back = 0;
-#line 162 "dk4sock33.ctr"
+#line 177 "dk4sock33.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != remhost);
+ assert(0 < remport);
+#endif
hep = gethostbyname(remhost);
if (NULL != hep) {
-#line 164 "dk4sock33.ctr"
+#line 184 "dk4sock33.ctr"
if (NULL != hep->h_addr_list) {
-#line 165 "dk4sock33.ctr"
+#line 185 "dk4sock33.ctr"
if (NULL != *(hep->h_addr_list)) {
-#line 166 "dk4sock33.ctr"
+#line 186 "dk4sock33.ctr"
switch (hep->h_addrtype) {
case AF_INET : {
-#line 168 "dk4sock33.ctr"
+#line 188 "dk4sock33.ctr"
sa4 = (struct sockaddr_in *)dptr;
DK4_MEMRES(sa4, sizeof(struct sockaddr_in));
sa4->sin_family = AF_INET;
@@ -263,12 +261,12 @@ dk4socket_c8_find_host(
DK4_MEMCPY(&(sa4->sin_addr),*(hep->h_addr_list),sizeof(IN_ADDR));
back = 1;
-#line 174 "dk4sock33.ctr"
+#line 194 "dk4sock33.ctr"
} break;
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
case AF_INET6 : {
-#line 177 "dk4sock33.ctr"
+#line 197 "dk4sock33.ctr"
sa6 = (struct sockaddr_in6 *)dptr;
DK4_MEMRES(sa6, sizeof(struct sockaddr_in6));
sa6->sin6_family = AF_INET6;
@@ -276,34 +274,34 @@ dk4socket_c8_find_host(
DK4_MEMCPY(&(sa6->sin6_addr),*(hep->h_addr_list),sizeof(IN6_ADDR));
back = 1;
-#line 183 "dk4sock33.ctr"
+#line 203 "dk4sock33.ctr"
} break;
#endif
}
} else {
-#line 187 "dk4sock33.ctr"
+#line 207 "dk4sock33.ctr"
}
} else {
-#line 189 "dk4sock33.ctr"
+#line 209 "dk4sock33.ctr"
}
} else {
-#line 191 "dk4sock33.ctr"
+#line 211 "dk4sock33.ctr"
}
-#line 193 "dk4sock33.ctr"
+#line 213 "dk4sock33.ctr"
return back;
#else
int back = 0;
-#line 197 "dk4sock33.ctr"
+#line 217 "dk4sock33.ctr"
-#line 198 "dk4sock33.ctr"
+#line 218 "dk4sock33.ctr"
return back;
#endif
#endif
@@ -324,42 +322,48 @@ dk4socket_c8_udp_addresses_numeric(
int back = DK4_SOCKET_RESULT_FAILED;
-#line 217 "dk4sock33.ctr"
+#line 237 "dk4sock33.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
if ((NULL != array) && (NULL != remhost) && (0 < remport) && (0 < locport)) {
DK4_MEMRES(array, (2*sizeof(dk4_sockaddr_storage_t)));
if (0 != dk4socket_c8_find_address(array, remhost)) {
-#line 221 "dk4sock33.ctr"
+#line 247 "dk4sock33.ctr"
back = dk4socket_complete_addresses(array, remport, locport);
-#line 223 "dk4sock33.ctr"
+#line 249 "dk4sock33.ctr"
}
if (DK4_SOCKET_RESULT_FAILED == back) {
-#line 225 "dk4sock33.ctr"
+#line 251 "dk4sock33.ctr"
if (0 != dk4socket_c8_find_host(array, remhost, remport, ip4)) {
back = dk4socket_complete_addresses(array, remport, locport);
if (DK4_SOCKET_RESULT_FAILED == back) {
-#line 228 "dk4sock33.ctr"
+#line 254 "dk4sock33.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
} else {
-#line 231 "dk4sock33.ctr"
+#line 257 "dk4sock33.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
}
} else {
-#line 235 "dk4sock33.ctr"
+#line 261 "dk4sock33.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 238 "dk4sock33.ctr"
+#line 264 "dk4sock33.ctr"
return back;
}
diff --git a/support/dktools/dk4sock33.ctr b/support/dktools/dk4sock33.ctr
index d6ff6b842e..529218adb0 100644
--- a/support/dktools/dk4sock33.ctr
+++ b/support/dktools/dk4sock33.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,6 +15,12 @@ license = bsd
#include "dk4mai8dus.h"
#include "dk4mao8d.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -41,6 +47,10 @@ dk4socket_c8_find_address(dk4_sockaddr_storage_t *dptr, const char *str)
int back = 0;
int res;
$? "+ dk4socket_c8_find_address"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != str);
+#endif
res = dk4socket_c8_inet_pton(&addr4, sizeof(addr4), AF_INET, str, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) { $? ". IPv4"
in4 = (struct sockaddr_in *)dptr;
@@ -88,6 +98,11 @@ dk4socket_c8_find_host(
int back = 0;
int res = 0;
$? "+ dk4socket_c8_find_host (getaddrinfo) \"%s\"", TR_8STR(remhost)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != remhost);
+ assert(0 < remport);
+#endif
res = dk4ma_write_c8_decimal_unsigned(
buf, sizeof(buf), (dk4_um_t)remport, 0, NULL
);
@@ -159,6 +174,11 @@ dk4socket_c8_find_host(
struct hostent *hep = NULL;
int back = 0;
$? "+ dk4socket_c8_find_host (gethostbyname) \"%s\"", TR_8STR(remhost)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != remhost);
+ assert(0 < remport);
+#endif
hep = gethostbyname(remhost);
if (NULL != hep) { $? ". entry"
if (NULL != hep->h_addr_list) { $? ". list"
@@ -214,6 +234,12 @@ dk4socket_c8_udp_addresses_numeric(
{
int back = DK4_SOCKET_RESULT_FAILED;
$? "+ dk4socket_c8_udp_addresses_numeric \"%s\"", TR_8STR(remhost)
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
if ((NULL != array) && (NULL != remhost) && (0 < remport) && (0 < locport)) {
DK4_MEMRES(array, (2*sizeof(dk4_sockaddr_storage_t)));
if (0 != dk4socket_c8_find_address(array, remhost)) {
diff --git a/support/dktools/dk4sock34.c b/support/dktools/dk4sock34.c
index 9174b8ece0..e0c2fcab58 100644
--- a/support/dktools/dk4sock34.c
+++ b/support/dktools/dk4sock34.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock34.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock34.ctr
*/
/** @file dk4sock34.c The dk4sock34 module.
@@ -48,11 +26,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mao8d.h"
#include "dk4rec24.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 23 "dk4sock34.ctr"
+#line 32 "dk4sock34.ctr"
@@ -79,7 +66,7 @@ dk4socket_wc_find_address(dk4_sockaddr_storage_t *dptr, const wchar_t *str)
int res;
-#line 48 "dk4sock34.ctr"
+#line 57 "dk4sock34.ctr"
res = dk4socket_wc_inet_pton(&addr4, sizeof(addr4), AF_INET, str, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
in4 = (struct sockaddr_in *)dptr;
@@ -99,7 +86,7 @@ dk4socket_wc_find_address(dk4_sockaddr_storage_t *dptr, const wchar_t *str)
}
-#line 66 "dk4sock34.ctr"
+#line 75 "dk4sock34.ctr"
return back;
}
@@ -118,7 +105,11 @@ dk4socket_wc_find_host(
const wchar_t *remhost,
unsigned short remport,
int ip4,
+#if (!(DK4_HAVE_GETADDRINFO))
dk4_er_t *erp
+#else
+ dk4_er_t * DK4_ARG_UNUSED(erp)
+#endif
)
{
#if DK4_HAVE_GETADDRINFO
@@ -129,9 +120,15 @@ dk4socket_wc_find_host(
ADDRINFOW *rptr = NULL;
int back = 0;
int res = 0;
+ DK4_UNUSED_ARG(erp)
-#line 96 "dk4sock34.ctr"
+#line 110 "dk4sock34.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != remhost);
+ assert(0 < remport);
+#endif
res = dk4ma_write_wc_decimal_unsigned(
buf, DK4_SIZEOF(buf,wchar_t), (dk4_um_t)remport, 0, NULL
);
@@ -144,7 +141,7 @@ dk4socket_wc_find_host(
res = GetAddrInfoW(remhost, buf, &hints, &results);
if ((0 == res) && (NULL != results)) {
-#line 107 "dk4sock34.ctr"
+#line 126 "dk4sock34.ctr"
if (0 != ip4) {
rptr = results;
while ((NULL != rptr) && (0 == back)) {
@@ -154,26 +151,26 @@ dk4socket_wc_find_host(
DK4_MEMCPY(dptr, rptr->ai_addr, rptr->ai_addrlen);
back = 1;
-#line 115 "dk4sock34.ctr"
+#line 134 "dk4sock34.ctr"
}
#if TRACE_DEBUG
else {
-#line 118 "dk4sock34.ctr"
+#line 137 "dk4sock34.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 123 "dk4sock34.ctr"
+#line 142 "dk4sock34.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 128 "dk4sock34.ctr"
+#line 147 "dk4sock34.ctr"
}
#endif
rptr = rptr->ai_next;
@@ -186,19 +183,19 @@ dk4socket_wc_find_host(
DK4_MEMCPY(dptr, rptr->ai_addr, rptr->ai_addrlen);
back = 1;
-#line 139 "dk4sock34.ctr"
+#line 158 "dk4sock34.ctr"
}
#if TRACE_DEBUG
else {
-#line 142 "dk4sock34.ctr"
+#line 161 "dk4sock34.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 147 "dk4sock34.ctr"
+#line 166 "dk4sock34.ctr"
}
#endif
rptr = rptr->ai_next;
@@ -206,7 +203,7 @@ dk4socket_wc_find_host(
}
} else {
-#line 153 "dk4sock34.ctr"
+#line 172 "dk4sock34.ctr"
rptr = results;
while ((NULL != rptr) && (0 == back)) {
if ((0 < rptr->ai_addrlen) && (NULL != rptr->ai_addr)) {
@@ -214,19 +211,19 @@ dk4socket_wc_find_host(
DK4_MEMCPY(dptr, rptr->ai_addr, rptr->ai_addrlen);
back = 1;
-#line 159 "dk4sock34.ctr"
+#line 178 "dk4sock34.ctr"
}
#if TRACE_DEBUG
else {
-#line 162 "dk4sock34.ctr"
+#line 181 "dk4sock34.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 167 "dk4sock34.ctr"
+#line 186 "dk4sock34.ctr"
}
#endif
rptr = rptr->ai_next;
@@ -234,19 +231,19 @@ dk4socket_wc_find_host(
}
} else {
-#line 173 "dk4sock34.ctr"
+#line 192 "dk4sock34.ctr"
}
if (NULL != results) { FreeAddrInfoW(results); }
}
#if TRACE_DEBUG
else {
-#line 178 "dk4sock34.ctr"
+#line 197 "dk4sock34.ctr"
}
#endif
-#line 181 "dk4sock34.ctr"
+#line 200 "dk4sock34.ctr"
return back;
/* --- getaddrinfo --- */
#else
@@ -262,22 +259,27 @@ dk4socket_wc_find_host(
int back = 0;
-#line 195 "dk4sock34.ctr"
+#line 214 "dk4sock34.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != remhost);
+ assert(0 < remport);
+#endif
if (0 != dk4recode_wchar_t_to_char(hona, sizeof(hona), remhost, erp)) {
hep = gethostbyname(hona);
if (NULL != hep) {
-#line 198 "dk4sock34.ctr"
+#line 222 "dk4sock34.ctr"
if (NULL != hep->h_addr_list) {
-#line 199 "dk4sock34.ctr"
+#line 223 "dk4sock34.ctr"
if (NULL != *(hep->h_addr_list)) {
-#line 200 "dk4sock34.ctr"
+#line 224 "dk4sock34.ctr"
switch (hep->h_addrtype) {
case AF_INET : {
-#line 202 "dk4sock34.ctr"
+#line 226 "dk4sock34.ctr"
sa4 = (struct sockaddr_in *)dptr;
DK4_MEMRES(sa4, sizeof(struct sockaddr_in));
sa4->sin_family = AF_INET;
@@ -285,12 +287,12 @@ dk4socket_wc_find_host(
DK4_MEMCPY(&(sa4->sin_addr),*(hep->h_addr_list),sizeof(IN_ADDR));
back = 1;
-#line 208 "dk4sock34.ctr"
+#line 232 "dk4sock34.ctr"
} break;
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
case AF_INET6 : {
-#line 211 "dk4sock34.ctr"
+#line 235 "dk4sock34.ctr"
sa6 = (struct sockaddr_in6 *)dptr;
DK4_MEMRES(sa6, sizeof(struct sockaddr_in6));
sa6->sin6_family = AF_INET6;
@@ -298,13 +300,13 @@ dk4socket_wc_find_host(
DK4_MEMCPY(&(sa6->sin6_addr),*(hep->h_addr_list),sizeof(IN6_ADDR));
back = 1;
-#line 217 "dk4sock34.ctr"
+#line 241 "dk4sock34.ctr"
} break;
#endif
#if TRACE_DEBUG
default : {
-#line 221 "dk4sock34.ctr"
+#line 245 "dk4sock34.ctr"
} break;
#endif
}
@@ -312,33 +314,33 @@ dk4socket_wc_find_host(
#if TRACE_DEBUG
else {
-#line 227 "dk4sock34.ctr"
+#line 251 "dk4sock34.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 232 "dk4sock34.ctr"
+#line 256 "dk4sock34.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 237 "dk4sock34.ctr"
+#line 261 "dk4sock34.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 242 "dk4sock34.ctr"
+#line 266 "dk4sock34.ctr"
}
#endif
-#line 245 "dk4sock34.ctr"
+#line 269 "dk4sock34.ctr"
return back;
/* --- gethostbyname --- */
#else
@@ -346,7 +348,7 @@ dk4socket_wc_find_host(
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
-#line 251 "dk4sock34.ctr"
+#line 275 "dk4sock34.ctr"
/* --- ! gethostbyname --- */
#endif
/* --- ! getaddrinfo --- */
@@ -357,11 +359,19 @@ dk4socket_wc_find_host(
int
dk4socket_wc_udp_addresses_numeric(
+#if DK4_ON_WINDOWS
dk4_sockaddr_storage_t *array,
const wchar_t *remhost,
unsigned short remport,
unsigned short locport,
int ip4,
+#else
+ dk4_sockaddr_storage_t * DK4_ARG_UNUSED(array),
+ const wchar_t * DK4_ARG_UNUSED(remhost),
+ unsigned short DK4_ARG_UNUSED(remport),
+ unsigned short DK4_ARG_UNUSED(locport),
+ int DK4_ARG_UNUSED(ip4),
+#endif
dk4_er_t *erp
)
{
@@ -369,44 +379,55 @@ dk4socket_wc_udp_addresses_numeric(
int back = DK4_SOCKET_RESULT_FAILED;
-#line 272 "dk4sock34.ctr"
+#line 304 "dk4sock34.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
if ((NULL != array) && (NULL != remhost) && (0 < remport) && (0 < locport)) {
DK4_MEMRES(array, (2*sizeof(dk4_sockaddr_storage_t)));
if (0 != dk4socket_wc_find_address(array, remhost)) {
-#line 276 "dk4sock34.ctr"
+#line 314 "dk4sock34.ctr"
back = dk4socket_complete_addresses(array, remport, locport);
-#line 278 "dk4sock34.ctr"
+#line 316 "dk4sock34.ctr"
}
if (DK4_SOCKET_RESULT_FAILED == back) {
-#line 280 "dk4sock34.ctr"
+#line 318 "dk4sock34.ctr"
if (0 != dk4socket_wc_find_host(array, remhost, remport, ip4, erp)) {
back = dk4socket_complete_addresses(array, remport, locport);
if (DK4_SOCKET_RESULT_FAILED == back) {
-#line 283 "dk4sock34.ctr"
+#line 321 "dk4sock34.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUG);
}
} else {
-#line 286 "dk4sock34.ctr"
+#line 324 "dk4sock34.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
}
} else {
-#line 290 "dk4sock34.ctr"
+#line 328 "dk4sock34.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 293 "dk4sock34.ctr"
+#line 331 "dk4sock34.ctr"
return back;
#else
+ DK4_UNUSED_ARG(array)
+ DK4_UNUSED_ARG(remhost)
+ DK4_UNUSED_ARG(remport)
+ DK4_UNUSED_ARG(locport)
+ DK4_UNUSED_ARG(ip4)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -423,6 +444,12 @@ dk4socket_udp_addresses_numeric(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_udp_addresses_numeric(
diff --git a/support/dktools/dk4sock34.ctr b/support/dktools/dk4sock34.ctr
index ba221eed2d..167e15a6e5 100644
--- a/support/dktools/dk4sock34.ctr
+++ b/support/dktools/dk4sock34.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -17,6 +17,15 @@ license = bsd
#include "dk4mao8d.h"
#include "dk4rec24.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
@@ -81,7 +90,11 @@ dk4socket_wc_find_host(
const wchar_t *remhost,
unsigned short remport,
int ip4,
+#if (!(DK4_HAVE_GETADDRINFO))
dk4_er_t *erp
+#else
+ dk4_er_t * DK4_ARG_UNUSED(erp)
+#endif
)
{
#if DK4_HAVE_GETADDRINFO
@@ -92,7 +105,13 @@ dk4socket_wc_find_host(
ADDRINFOW *rptr = NULL;
int back = 0;
int res = 0;
+ DK4_UNUSED_ARG(erp)
$? "+ dk4socket_wc_find_host (getaddrinfo) \"%!ws\"", TR_LSTR(remhost)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != remhost);
+ assert(0 < remport);
+#endif
res = dk4ma_write_wc_decimal_unsigned(
buf, DK4_SIZEOF(buf,wchar_t), (dk4_um_t)remport, 0, NULL
);
@@ -192,6 +211,11 @@ dk4socket_wc_find_host(
struct hostent *hep = NULL;
int back = 0;
$? "+ dk4socket_wc_find_host (gethostbyname) \"%s\"", TR_LSTR(remhost)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != remhost);
+ assert(0 < remport);
+#endif
if (0 != dk4recode_wchar_t_to_char(hona, sizeof(hona), remhost, erp)) {
hep = gethostbyname(hona);
if (NULL != hep) { $? ". hep"
@@ -258,17 +282,31 @@ dk4socket_wc_find_host(
int
dk4socket_wc_udp_addresses_numeric(
+#if DK4_ON_WINDOWS
dk4_sockaddr_storage_t *array,
const wchar_t *remhost,
unsigned short remport,
unsigned short locport,
int ip4,
+#else
+ dk4_sockaddr_storage_t * DK4_ARG_UNUSED(array),
+ const wchar_t * DK4_ARG_UNUSED(remhost),
+ unsigned short DK4_ARG_UNUSED(remport),
+ unsigned short DK4_ARG_UNUSED(locport),
+ int DK4_ARG_UNUSED(ip4),
+#endif
dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
int back = DK4_SOCKET_RESULT_FAILED;
$? "+ dk4socket_wc_udp_addresses_numeric DK4_ON_WINDOWS"
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
if ((NULL != array) && (NULL != remhost) && (0 < remport) && (0 < locport)) {
DK4_MEMRES(array, (2*sizeof(dk4_sockaddr_storage_t)));
if (0 != dk4socket_wc_find_address(array, remhost)) {
@@ -292,6 +330,11 @@ dk4socket_wc_udp_addresses_numeric(
$? "- dk4socket_wc_udp_addresses_numeric DK4_ON_WINDOWS %d", back
return back;
#else
+ DK4_UNUSED_ARG(array)
+ DK4_UNUSED_ARG(remhost)
+ DK4_UNUSED_ARG(remport)
+ DK4_UNUSED_ARG(locport)
+ DK4_UNUSED_ARG(ip4)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -308,6 +351,12 @@ dk4socket_udp_addresses_numeric(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_udp_addresses_numeric(
diff --git a/support/dktools/dk4sock35.c b/support/dktools/dk4sock35.c
index 16705599b5..dc11be3f3c 100644
--- a/support/dktools/dk4sock35.c
+++ b/support/dktools/dk4sock35.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock35.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock35.ctr
*/
/** @file dk4sock35.c The dk4sock35 module.
@@ -39,13 +17,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 8 "dk4sock35.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 14 "dk4sock35.ctr"
+#line 21 "dk4sock35.ctr"
@@ -61,10 +46,14 @@ dk4socket_udp_client_for_addr(
int res;
-#line 28 "dk4sock35.ctr"
+#line 35 "dk4sock35.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pLocalAddr);
+ assert(0 < szLocalAddr);
+#endif
if ((NULL != pLocalAddr) && (0 < szLocalAddr)) {
-#line 29 "dk4sock35.ctr"
+#line 40 "dk4sock35.ctr"
switch (addrfam) {
case PF_INET :
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
@@ -72,43 +61,43 @@ dk4socket_udp_client_for_addr(
#endif
{
-#line 35 "dk4sock35.ctr"
+#line 46 "dk4sock35.ctr"
back = dk4socket_open(addrfam, SOCK_DGRAM, 0, erp);
if (INVALID_SOCKET != back) {
res = dk4socket_bind(back, pLocalAddr, szLocalAddr, erp);
if (DK4_SOCKET_RESULT_SUCCESS != res) {
-#line 39 "dk4sock35.ctr"
+#line 50 "dk4sock35.ctr"
(void)dk4socket_close(back, NULL);
back = INVALID_SOCKET;
}
#if TRACE_DEBUG
else {
-#line 44 "dk4sock35.ctr"
+#line 55 "dk4sock35.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 49 "dk4sock35.ctr"
+#line 60 "dk4sock35.ctr"
}
#endif
} break;
default : {
-#line 53 "dk4sock35.ctr"
+#line 64 "dk4sock35.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
} break;
}
} else {
-#line 57 "dk4sock35.ctr"
+#line 68 "dk4sock35.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 59 "dk4sock35.ctr"
+#line 70 "dk4sock35.ctr"
return back;
}
diff --git a/support/dktools/dk4sock35.ctr b/support/dktools/dk4sock35.ctr
index 2b58ea1293..b6beb66b1f 100644
--- a/support/dktools/dk4sock35.ctr
+++ b/support/dktools/dk4sock35.ctr
@@ -2,12 +2,19 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -25,6 +32,10 @@ dk4socket_udp_client_for_addr(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_udp_client_for_addr"
+#if DK4_USE_ASSERT
+ assert(NULL != pLocalAddr);
+ assert(0 < szLocalAddr);
+#endif
if ((NULL != pLocalAddr) && (0 < szLocalAddr)) { $? ". arguments"
switch (addrfam) {
case PF_INET :
diff --git a/support/dktools/dk4sock36.c b/support/dktools/dk4sock36.c
index c8b3921f3e..a0c85191f2 100644
--- a/support/dktools/dk4sock36.c
+++ b/support/dktools/dk4sock36.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock36.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock36.ctr
*/
/** @file dk4sock36.c The dk4sock36 module.
@@ -39,13 +17,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock36.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 16 "dk4sock36.ctr"
+#line 23 "dk4sock36.ctr"
@@ -64,40 +49,46 @@ dk4socket_c8_udp_client_for_host(
int res;
-#line 33 "dk4sock36.ctr"
+#line 40 "dk4sock36.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
if ((NULL != array) && (NULL != remhost) && (0 != remport) && (0 != locport))
{
-#line 35 "dk4sock36.ctr"
+#line 48 "dk4sock36.ctr"
res = dk4socket_c8_udp_addresses_numeric(
array, remhost, remport, locport, ip4, erp
);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 39 "dk4sock36.ctr"
+#line 52 "dk4sock36.ctr"
sa = (struct sockaddr *)(&(array[1]));
back = dk4socket_udp_client_for_addr(
sa->sa_family, sa, sizeof(dk4_sockaddr_storage_t), erp
);
-#line 43 "dk4sock36.ctr"
+#line 56 "dk4sock36.ctr"
}
#if TRACE_DEBUG
else {
-#line 46 "dk4sock36.ctr"
+#line 59 "dk4sock36.ctr"
}
#endif
}
else
{
-#line 51 "dk4sock36.ctr"
+#line 64 "dk4sock36.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 54 "dk4sock36.ctr"
+#line 67 "dk4sock36.ctr"
return back;
}
diff --git a/support/dktools/dk4sock36.ctr b/support/dktools/dk4sock36.ctr
index 3b467b67bf..dc64198af8 100644
--- a/support/dktools/dk4sock36.ctr
+++ b/support/dktools/dk4sock36.ctr
@@ -2,14 +2,21 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -30,6 +37,12 @@ dk4socket_c8_udp_client_for_host(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_c8_udp_client_for_host \"%s\" %u %u", TR_8STR(remhost), (unsigned)remport, (unsigned)locport
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
if ((NULL != array) && (NULL != remhost) && (0 != remport) && (0 != locport))
{ $? ". arguments"
res = dk4socket_c8_udp_addresses_numeric(
diff --git a/support/dktools/dk4sock37.c b/support/dktools/dk4sock37.c
index 3e115c56e2..d3ae301e5e 100644
--- a/support/dktools/dk4sock37.c
+++ b/support/dktools/dk4sock37.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sock37.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sock37.ctr
*/
/** @file dk4sock37.c The dk4sock37 module.
@@ -39,13 +17,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4sock37.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 16 "dk4sock37.ctr"
+#line 23 "dk4sock37.ctr"
@@ -64,40 +49,46 @@ dk4socket_wc_udp_client_for_host(
int res;
-#line 33 "dk4sock37.ctr"
+#line 40 "dk4sock37.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
if ((NULL != array) && (NULL != remhost) && (0 != remport) && (0 != locport))
{
-#line 35 "dk4sock37.ctr"
+#line 48 "dk4sock37.ctr"
res = dk4socket_wc_udp_addresses_numeric(
array, remhost, remport, locport, ip4, erp
);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 39 "dk4sock37.ctr"
+#line 52 "dk4sock37.ctr"
sa = (struct sockaddr *)(&(array[1]));
back = dk4socket_udp_client_for_addr(
sa->sa_family, sa, sizeof(dk4_sockaddr_storage_t), erp
);
-#line 43 "dk4sock37.ctr"
+#line 56 "dk4sock37.ctr"
}
#if TRACE_DEBUG
else {
-#line 46 "dk4sock37.ctr"
+#line 59 "dk4sock37.ctr"
}
#endif
}
else
{
-#line 51 "dk4sock37.ctr"
+#line 64 "dk4sock37.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 54 "dk4sock37.ctr"
+#line 67 "dk4sock37.ctr"
return back;
}
@@ -113,6 +104,12 @@ dk4socket_udp_client_for_host(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_udp_client_for_host(array, remhost, remport, locport, ip4, erp)
diff --git a/support/dktools/dk4sock37.ctr b/support/dktools/dk4sock37.ctr
index d03a4cd2fc..2f87160a11 100644
--- a/support/dktools/dk4sock37.ctr
+++ b/support/dktools/dk4sock37.ctr
@@ -2,14 +2,21 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -30,6 +37,12 @@ dk4socket_wc_udp_client_for_host(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_wc_udp_client_for_host \"%!ws\" %u %u", TR_LSTR(remhost), (unsigned)remport, (unsigned)locport
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
if ((NULL != array) && (NULL != remhost) && (0 != remport) && (0 != locport))
{ $? ". arguments"
res = dk4socket_wc_udp_addresses_numeric(
@@ -66,6 +79,12 @@ dk4socket_udp_client_for_host(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != array);
+ assert(NULL != remhost);
+ assert(0 < remport);
+ assert(0 < locport);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4socket_wc_udp_client_for_host(array, remhost, remport, locport, ip4, erp)
diff --git a/support/dktools/dk4socka.h b/support/dktools/dk4socka.h
index fb046a69bb..e42370d34e 100644
--- a/support/dktools/dk4socka.h
+++ b/support/dktools/dk4socka.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4SOCKA_H_INCLUDED
#define DK4SOCKA_H_INCLUDED 1
@@ -5,19 +10,39 @@
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4SOCK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sock.h"
+#else
+#include <dktools-4/dk4sock.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
#ifdef __cplusplus
@@ -245,6 +270,28 @@ dk4socket_accept_app(
/*
Create a tcp client socket.
---------------------------
+ Module: dk4socka06
+*/
+
+/** Connect socket to remote address.
+ @param sock Socket to connect.
+ @param pAddr Remote address to connect to.
+ @param szAddr Size of remote address.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4socket_connect_app(
+ dk4_socket_t sock,
+ const struct sockaddr *pAddr,
+ size_t szAddr,
+ dk4_app_t *app
+);
+
+/*
+ Create a tcp client socket.
+ ---------------------------
Module: dk4socka07
*/
diff --git a/support/dktools/dk4socka01.c b/support/dktools/dk4socka01.c
index 1722cfde96..8a555d9027 100644
--- a/support/dktools/dk4socka01.c
+++ b/support/dktools/dk4socka01.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka01.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka01.ctr
*/
/** @file dk4socka01.c The dk4socka01 module.
@@ -40,6 +18,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4socka01.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
#include "dk4mem.h"
@@ -63,7 +42,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 34 "dk4socka01.ctr"
+#line 35 "dk4socka01.ctr"
@@ -154,7 +133,7 @@ dkT("inet_pton"),
NULL
-#line 126 "dk4socka01.ctr"
+#line 127 "dk4socka01.ctr"
};
@@ -594,7 +573,7 @@ dkT("\"!"),
NULL
-#line 641 "dk4socka01.ctr"
+#line 642 "dk4socka01.ctr"
};
@@ -760,7 +739,7 @@ dk4socket_log_fctname_msg(
if (NULL == mytext) {
-#line 805 "dk4socka01.ctr"
+#line 806 "dk4socka01.ctr"
switch (erp->ec) {
#if DK4_ON_WINDOWS
/* +++++ Windows +++++ */
diff --git a/support/dktools/dk4socka01.ctr b/support/dktools/dk4socka01.ctr
index 0822476329..0c30483cbd 100644
--- a/support/dktools/dk4socka01.ctr
+++ b/support/dktools/dk4socka01.ctr
@@ -2,13 +2,14 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
#include "dk4mem.h"
diff --git a/support/dktools/dk4socka02.c b/support/dktools/dk4socka02.c
index 07cb8a97ff..11d1e01e11 100644
--- a/support/dktools/dk4socka02.c
+++ b/support/dktools/dk4socka02.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka02.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka02.ctr
*/
/** @file dk4socka02.c The dk4socka02 module.
@@ -39,13 +17,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4socka02.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
+#include "dk4unused.h"
+
+
+
+
+
+#line 18 "dk4socka02.ctr"
int
-dk4socket_up_app(dk4_app_t *app)
+dk4socket_up_app(
+#if DK4_ON_WINDOWS
+ dk4_app_t *app
+#else
+ dk4_app_t * DK4_ARG_UNUSED(app)
+#endif
+)
{
#if DK4_ON_WINDOWS
dk4_er_t er;
@@ -58,6 +50,7 @@ dk4socket_up_app(dk4_app_t *app)
}
return back;
#else
+ DK4_UNUSED_ARG(app)
return (DK4_SOCKET_RESULT_SUCCESS);
#endif
}
@@ -65,7 +58,13 @@ dk4socket_up_app(dk4_app_t *app)
int
-dk4socket_down_app(dk4_app_t *app)
+dk4socket_down_app(
+#if DK4_ON_WINDOWS
+ dk4_app_t *app
+#else
+ dk4_app_t * DK4_ARG_UNUSED(app)
+#endif
+)
{
#if DK4_ON_WINDOWS
dk4_er_t er;
@@ -78,6 +77,7 @@ dk4socket_down_app(dk4_app_t *app)
}
return back;
#else
+ DK4_UNUSED_ARG(app)
return (DK4_SOCKET_RESULT_SUCCESS);
#endif
}
diff --git a/support/dktools/dk4socka02.ctr b/support/dktools/dk4socka02.ctr
index 45671ac1e1..86f2ca28e1 100644
--- a/support/dktools/dk4socka02.ctr
+++ b/support/dktools/dk4socka02.ctr
@@ -2,18 +2,30 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
+#include "dk4unused.h"
+
+
+
+$!trace-include
int
-dk4socket_up_app(dk4_app_t *app)
+dk4socket_up_app(
+#if DK4_ON_WINDOWS
+ dk4_app_t *app
+#else
+ dk4_app_t * DK4_ARG_UNUSED(app)
+#endif
+)
{
#if DK4_ON_WINDOWS
dk4_er_t er;
@@ -26,6 +38,7 @@ dk4socket_up_app(dk4_app_t *app)
}
return back;
#else
+ DK4_UNUSED_ARG(app)
return (DK4_SOCKET_RESULT_SUCCESS);
#endif
}
@@ -33,7 +46,13 @@ dk4socket_up_app(dk4_app_t *app)
int
-dk4socket_down_app(dk4_app_t *app)
+dk4socket_down_app(
+#if DK4_ON_WINDOWS
+ dk4_app_t *app
+#else
+ dk4_app_t * DK4_ARG_UNUSED(app)
+#endif
+)
{
#if DK4_ON_WINDOWS
dk4_er_t er;
@@ -46,6 +65,7 @@ dk4socket_down_app(dk4_app_t *app)
}
return back;
#else
+ DK4_UNUSED_ARG(app)
return (DK4_SOCKET_RESULT_SUCCESS);
#endif
}
diff --git a/support/dktools/dk4socka03.c b/support/dktools/dk4socka03.c
index cf7ec3e035..a9bf30e5ea 100644
--- a/support/dktools/dk4socka03.c
+++ b/support/dktools/dk4socka03.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka03.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka03.ctr
*/
/** @file dk4socka03.c The dk4socka03 module.
@@ -40,6 +18,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4socka03.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
diff --git a/support/dktools/dk4socka03.ctr b/support/dktools/dk4socka03.ctr
index 4232fb9e3a..0da95ec60f 100644
--- a/support/dktools/dk4socka03.ctr
+++ b/support/dktools/dk4socka03.ctr
@@ -2,13 +2,14 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
diff --git a/support/dktools/dk4socka04.c b/support/dktools/dk4socka04.c
index bfa45458e7..0bed97df54 100644
--- a/support/dktools/dk4socka04.c
+++ b/support/dktools/dk4socka04.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka04.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka04.ctr
*/
/** @file dk4socka04.c The dk4socka04 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4socka04.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
#include "dk4mem.h"
@@ -47,7 +26,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 18 "dk4socka04.ctr"
+#line 19 "dk4socka04.ctr"
int
diff --git a/support/dktools/dk4socka04.ctr b/support/dktools/dk4socka04.ctr
index 3bf7a61d96..27f50eb581 100644
--- a/support/dktools/dk4socka04.ctr
+++ b/support/dktools/dk4socka04.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
#include "dk4mem.h"
diff --git a/support/dktools/dk4socka05.c b/support/dktools/dk4socka05.c
index 3871a089a1..5994383b78 100644
--- a/support/dktools/dk4socka05.c
+++ b/support/dktools/dk4socka05.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka05.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka05.ctr
*/
/** @file dk4socka05.c The dk4socka05 module.
@@ -40,6 +18,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4socka05.ctr"
+#include "dk4conf.h"
#include "dk4app.h"
#include "dk4socka.h"
diff --git a/support/dktools/dk4socka05.ctr b/support/dktools/dk4socka05.ctr
index 5a15106e36..f34bef11ec 100644
--- a/support/dktools/dk4socka05.ctr
+++ b/support/dktools/dk4socka05.ctr
@@ -2,13 +2,14 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4app.h"
#include "dk4socka.h"
diff --git a/support/dktools/dk4socka06.c b/support/dktools/dk4socka06.c
index 79830178ff..b910e3355e 100644
--- a/support/dktools/dk4socka06.c
+++ b/support/dktools/dk4socka06.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka06.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka06.ctr
*/
/** @file dk4socka06.c The dk4socka06 module.
@@ -40,6 +18,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4socka06.ctr"
+#include "dk4conf.h"
#include "dk4socka.h"
#include "dk4mem.h"
@@ -47,7 +26,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 18 "dk4socka06.ctr"
+#line 19 "dk4socka06.ctr"
diff --git a/support/dktools/dk4socka06.ctr b/support/dktools/dk4socka06.ctr
index 4b4015cb9e..04e053ce73 100644
--- a/support/dktools/dk4socka06.ctr
+++ b/support/dktools/dk4socka06.ctr
@@ -2,13 +2,14 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4socka.h"
#include "dk4mem.h"
diff --git a/support/dktools/dk4socka07.c b/support/dktools/dk4socka07.c
index 7b7cf9ba97..d01e31b48f 100644
--- a/support/dktools/dk4socka07.c
+++ b/support/dktools/dk4socka07.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka07.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka07.ctr
*/
/** @file dk4socka07.c The dk4socka07 module.
@@ -40,6 +18,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4socka07.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
#include "dk4mem.h"
@@ -58,11 +37,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4maodd.h"
#include "dk4maodh.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 32 "dk4socka07.ctr"
+#line 39 "dk4socka07.ctr"
@@ -81,7 +66,7 @@ dkT("@"),
NULL
-#line 52 "dk4socka07.ctr"
+#line 59 "dk4socka07.ctr"
};
@@ -93,7 +78,6 @@ NULL
/** Report error from dk4socket_tcp_client_for_addr().
@param app Application structure for logging.
- @param hostname Host name to connect to.
@param afam Address family.
@param sremote Pointer to remote address buffer.
@param szremote Remote address size.
@@ -105,7 +89,6 @@ static
void
dk4socket_report_connection_error(
dk4_app_t *app,
- const dkChar *hostname,
int afam,
const struct sockaddr *sremote,
size_t szremote,
@@ -131,7 +114,7 @@ dk4socket_report_connection_error(
int fctnmsg = 0; /* Flag: Use fct name */
-#line 100 "dk4socka07.ctr"
+#line 105 "dk4socka07.ctr"
if (NULL != app) {
if (dk4app_log_do(app, DK4_LL_ERROR)) {
#if VERSION_BEFORE_20150821
@@ -246,14 +229,13 @@ dk4socket_report_connection_error(
}
-#line 213 "dk4socka07.ctr"
+#line 218 "dk4socka07.ctr"
}
/** Report error from dk4socket_tcp_client_for_addr().
@param app Application structure for logging.
- @param hostname Host name to connect to.
@param afam Address family.
@param sremote Pointer to remote address buffer.
@param szremote Remote address size.
@@ -265,7 +247,6 @@ static
void
dk4socket_report_connection_established(
dk4_app_t *app,
- const dkChar *hostname,
int afam,
const struct sockaddr *sremote,
size_t szremote,
@@ -492,7 +473,7 @@ dk4socket_tcp_client_addresses_app(
int mpf = 0;
-#line 457 "dk4socka07.ctr"
+#line 460 "dk4socka07.ctr"
ra = rast;
while ((INVALID_SOCKET == back) && (NULL != ra)) {
if (NULL != last) {
@@ -501,7 +482,7 @@ dk4socket_tcp_client_addresses_app(
if (ra->ai_family == la->ai_family) {
mpf = 1;
-#line 464 "dk4socka07.ctr"
+#line 467 "dk4socka07.ctr"
dk4error_init(&er);
back = dk4socket_tcp_client_for_addr(
ra->ai_family,
@@ -511,17 +492,17 @@ dk4socket_tcp_client_addresses_app(
);
if (INVALID_SOCKET != back) {
dk4socket_report_connection_established(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen
);
ra = NULL; la = NULL;
} else {
-#line 479 "dk4socka07.ctr"
+#line 482 "dk4socka07.ctr"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen,
&er
@@ -538,17 +519,17 @@ dk4socket_tcp_client_addresses_app(
);
if (INVALID_SOCKET != back) {
dk4socket_report_connection_established(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
NULL, 0
);
ra = NULL;
} else {
-#line 504 "dk4socka07.ctr"
+#line 507 "dk4socka07.ctr"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app,hostname,ra->ai_family,ra->ai_addr,ra->ai_addrlen,NULL,0,&er
+ app,ra->ai_family,ra->ai_addr,ra->ai_addrlen,NULL,0,&er
);
}
}
@@ -557,14 +538,14 @@ dk4socket_tcp_client_addresses_app(
if (INVALID_SOCKET == back) {
if (0 == mpf) {
-#line 514 "dk4socka07.ctr"
+#line 517 "dk4socka07.ctr"
/* ERROR: No matching address pair found (27) */
dk4socket_report_no_matching_addresses(hostname, app);
}
}
-#line 519 "dk4socka07.ctr"
+#line 522 "dk4socka07.ctr"
return back;
}
@@ -597,7 +578,7 @@ dk4socket_tcp_client_addresses_app(
int mpf = 0;
-#line 550 "dk4socka07.ctr"
+#line 553 "dk4socka07.ctr"
ra = rast;
while ((INVALID_SOCKET == back) && (NULL != ra)) {
if (NULL != last) {
@@ -614,17 +595,17 @@ dk4socket_tcp_client_addresses_app(
);
if (INVALID_SOCKET != back) {
dk4socket_report_connection_established(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen
);
ra = NULL; la = NULL;
} else {
-#line 572 "dk4socka07.ctr"
+#line 575 "dk4socka07.ctr"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen,
&er
@@ -641,17 +622,17 @@ dk4socket_tcp_client_addresses_app(
);
if (INVALID_SOCKET != back) {
dk4socket_report_connection_established(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
NULL, 0
);
ra = NULL;
} else {
-#line 597 "dk4socka07.ctr"
+#line 600 "dk4socka07.ctr"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app,hostname,ra->ai_family,ra->ai_addr,ra->ai_addrlen,NULL,0,&er
+ app,ra->ai_family,ra->ai_addr,ra->ai_addrlen,NULL,0,&er
);
}
}
@@ -665,7 +646,7 @@ dk4socket_tcp_client_addresses_app(
}
-#line 612 "dk4socka07.ctr"
+#line 615 "dk4socka07.ctr"
return back;
}
@@ -848,10 +829,14 @@ dk4socket_tcp_client_for_host_num_service_app(
int res;
-#line 793 "dk4socka07.ctr"
+#line 796 "dk4socka07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
-#line 794 "dk4socka07.ctr"
+#line 801 "dk4socka07.ctr"
DK4_MEMRES(&rhints, sizeof(rhints));
rhints.ai_family = AF_UNSPEC;
rhints.ai_socktype = SOCK_STREAM;
@@ -861,10 +846,10 @@ dk4socket_tcp_client_for_host_num_service_app(
res = GetAddrInfoW(hostname, svcname, &rhints, &rast);
if ((0 == res) && (NULL != rast)) {
-#line 802 "dk4socka07.ctr"
+#line 809 "dk4socka07.ctr"
if (NULL != lsvcname) {
-#line 803 "dk4socka07.ctr"
+#line 810 "dk4socka07.ctr"
DK4_MEMRES(&lhints, sizeof(lhints));
lhints.ai_family = AF_UNSPEC;
lhints.ai_socktype = SOCK_STREAM;
@@ -875,21 +860,21 @@ dk4socket_tcp_client_for_host_num_service_app(
res = GetAddrInfoW(NULL, lsvcname, &lhints, &last);
if ((0 == res) && (NULL != last)) {
-#line 812 "dk4socka07.ctr"
+#line 819 "dk4socka07.ctr"
back = dk4socket_tcp_client_addresses_app(
hostname, rast, last, secs, usecs, app
);
FreeAddrInfoW(last);
} else {
-#line 817 "dk4socka07.ctr"
+#line 824 "dk4socka07.ctr"
/* ERROR: Failed to obtain local addresses to bind (18, 19) */
dk4error_set_idetails(&er, DK4_E_SOCKET_GETADDRINFO, res);
dk4socket_report_gai(NULL, lsvcname, res, 1, app, &er);
}
} else {
-#line 822 "dk4socka07.ctr"
+#line 829 "dk4socka07.ctr"
back = dk4socket_tcp_client_addresses_app(
hostname, rast, NULL, secs, usecs, app
);
@@ -897,20 +882,20 @@ dk4socket_tcp_client_for_host_num_service_app(
FreeAddrInfoW(rast);
} else {
-#line 828 "dk4socka07.ctr"
+#line 835 "dk4socka07.ctr"
/* ERROR: Failed to obtain remote addresses (20, 21, 22) */
dk4error_set_idetails(&er, DK4_E_SOCKET_GETADDRINFO, res);
dk4socket_report_gai(hostname, svcname, res, 0, app, &er);
}
} else {
-#line 833 "dk4socka07.ctr"
+#line 840 "dk4socka07.ctr"
/* ERROR: Invalid arguments (bug) */
dk4socket_report_invalid_arguments(app);
}
-#line 837 "dk4socka07.ctr"
+#line 844 "dk4socka07.ctr"
return back;
}
@@ -952,56 +937,60 @@ dk4socket_tcp_client_for_host_port_app(
int res;
-#line 877 "dk4socka07.ctr"
+#line 884 "dk4socka07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
-#line 878 "dk4socka07.ctr"
+#line 889 "dk4socka07.ctr"
dk4error_init(&er);
res = dk4ma_write_decimal_unsigned(
rpnb, DK4_SIZEOF(rpnb,dkChar), (dk4_um_t)portno, 0, &er
);
if (0 != res) {
-#line 883 "dk4socka07.ctr"
+#line 894 "dk4socka07.ctr"
if (0 < lportno) {
-#line 884 "dk4socka07.ctr"
+#line 895 "dk4socka07.ctr"
dk4error_init(&er);
res = dk4ma_write_decimal_unsigned(
lpnb, DK4_SIZEOF(lpnb,dkChar), (dk4_um_t)lportno, 0, &er
);
if (0 != res) {
-#line 889 "dk4socka07.ctr"
+#line 900 "dk4socka07.ctr"
back = dk4socket_tcp_client_for_host_num_service_app(
hostname, rpnb, lpnb, secs, usecs, 0, app
);
} else {
-#line 893 "dk4socka07.ctr"
+#line 904 "dk4socka07.ctr"
/* ERROR: Failed to convert local port number to text, bug */
}
} else {
-#line 896 "dk4socka07.ctr"
+#line 907 "dk4socka07.ctr"
back = dk4socket_tcp_client_for_host_num_service_app(
hostname, rpnb, NULL, secs, usecs, 0, app
);
}
} else {
-#line 901 "dk4socka07.ctr"
+#line 912 "dk4socka07.ctr"
/* ERROR: Failed to convert port number to text, bug */
}
} else {
-#line 904 "dk4socka07.ctr"
+#line 915 "dk4socka07.ctr"
/* ERROR: Invalid arguments (bug) */
dk4socket_report_invalid_arguments(app);
}
-#line 908 "dk4socka07.ctr"
+#line 919 "dk4socka07.ctr"
return back;
}
@@ -1036,7 +1025,11 @@ dk4socket_tcp_client_for_host_num_service_app(
unsigned short iport = 0U;
-#line 941 "dk4socka07.ctr"
+#line 952 "dk4socka07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
dk4error_init(&er);
res = dk4ma_input_dk_dec_ushort(&rport, svcname, &endptr, 1, NULL);
@@ -1107,7 +1100,7 @@ dk4socket_tcp_client_for_host_num_service_app(
}
-#line 1010 "dk4socka07.ctr"
+#line 1025 "dk4socka07.ctr"
return back;
}
@@ -1156,7 +1149,11 @@ dk4socket_tcp_client_for_host_port_app(
-#line 1057 "dk4socka07.ctr"
+#line 1072 "dk4socka07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
dk4error_init(&er);
if (0 != dk4recode_wchar_t_to_char(hona, sizeof(hona), hostname, &er)) {
@@ -1191,10 +1188,10 @@ dk4socket_tcp_client_for_host_port_app(
}
if (INVALID_SOCKET == back) {
-#line 1090 "dk4socka07.ctr"
+#line 1109 "dk4socka07.ctr"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, AF_INET,
+ app, AF_INET,
(struct sockaddr *)(&sr4), sizeof(sr4),
((0 < lportno) ? ((struct sockaddr *)(&sl4)) : NULL),
((0 < lportno) ? (sizeof(sl4)) : 0),
@@ -1203,7 +1200,7 @@ dk4socket_tcp_client_for_host_port_app(
} else {
/* DEBUG: Connection established (30) */
dk4socket_report_connection_established(
- app, hostname, AF_INET,
+ app, AF_INET,
(struct sockaddr *)(&sr4), sizeof(sr4),
((0 < lportno) ? ((struct sockaddr *)(&sl4)) : NULL),
((0 < lportno) ? (sizeof(sl4)) : 0)
@@ -1243,10 +1240,10 @@ dk4socket_tcp_client_for_host_port_app(
}
if (INVALID_SOCKET == back) {
-#line 1140 "dk4socka07.ctr"
+#line 1159 "dk4socka07.ctr"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, AF_INET6,
+ app, AF_INET6,
(struct sockaddr *)(&sr6), sizeof(sr6),
((0 < lportno) ? ((struct sockaddr *)(&sl6)) : NULL),
((0 < lportno) ? (sizeof(sl6)) : 0),
@@ -1255,7 +1252,7 @@ dk4socket_tcp_client_for_host_port_app(
} else {
/* DEBUG: Connection established (30) */
dk4socket_report_connection_established(
- app, hostname, AF_INET6,
+ app, AF_INET6,
(struct sockaddr *)(&sr6), sizeof(sr6),
((0 < lportno) ? ((struct sockaddr *)(&sl6)) : NULL),
((0 < lportno) ? (sizeof(sl6)) : 0)
@@ -1293,7 +1290,7 @@ dk4socket_tcp_client_for_host_port_app(
}
-#line 1188 "dk4socka07.ctr"
+#line 1207 "dk4socka07.ctr"
return back;
}
@@ -1328,16 +1325,20 @@ dk4socket_tcp_client_for_host_num_service_app(
int res;
-#line 1221 "dk4socka07.ctr"
+#line 1240 "dk4socka07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
-#line 1222 "dk4socka07.ctr"
+#line 1245 "dk4socka07.ctr"
-#line 1223 "dk4socka07.ctr"
+#line 1246 "dk4socka07.ctr"
if ((NULL != hostname) && (NULL != svcname)) {
-#line 1224 "dk4socka07.ctr"
+#line 1247 "dk4socka07.ctr"
DK4_MEMRES(&rhints, sizeof(rhints));
rhints.ai_family = AF_UNSPEC;
rhints.ai_socktype = SOCK_STREAM;
@@ -1347,10 +1348,10 @@ dk4socket_tcp_client_for_host_num_service_app(
res = getaddrinfo(hostname, svcname, &rhints, &raddrst);
if ((0 == res) && (NULL != raddrst)) {
-#line 1232 "dk4socka07.ctr"
+#line 1255 "dk4socka07.ctr"
if (NULL != lsvcname) {
-#line 1233 "dk4socka07.ctr"
+#line 1256 "dk4socka07.ctr"
DK4_MEMRES(&lhints, sizeof(lhints));
lhints.ai_family = AF_UNSPEC;
lhints.ai_socktype = SOCK_STREAM;
@@ -1361,21 +1362,21 @@ dk4socket_tcp_client_for_host_num_service_app(
res = getaddrinfo(NULL, lsvcname, &lhints, &laddrst);
if ((0 == res) && (NULL != laddrst)) {
-#line 1242 "dk4socka07.ctr"
+#line 1265 "dk4socka07.ctr"
back = dk4socket_tcp_client_addresses_app(
hostname, raddrst, laddrst, secs, usecs, app
);
freeaddrinfo(laddrst);
} else {
-#line 1247 "dk4socka07.ctr"
+#line 1270 "dk4socka07.ctr"
/* ERROR: Failed to obtain local addresses (18, 19) */
dk4error_set_idetails(&er, DK4_E_SOCKET_GETADDRINFO, res);
dk4socket_report_gai(NULL, lsvcname, res, 1, app, &er);
}
} else {
-#line 1252 "dk4socka07.ctr"
+#line 1275 "dk4socka07.ctr"
back = dk4socket_tcp_client_addresses_app(
hostname, raddrst, NULL, secs, usecs, app
);
@@ -1383,20 +1384,20 @@ dk4socket_tcp_client_for_host_num_service_app(
freeaddrinfo(raddrst);
} else {
-#line 1258 "dk4socka07.ctr"
+#line 1281 "dk4socka07.ctr"
/* ERROR: Failed to obtain remote addresses (20, 21, 22) */
dk4error_set_idetails(&er, DK4_E_SOCKET_GETADDRINFO, res);
dk4socket_report_gai(hostname, svcname, res, 0, app, &er);
}
} else {
-#line 1263 "dk4socka07.ctr"
+#line 1286 "dk4socka07.ctr"
/* ERROR: Invalid arguments (bug) */
dk4socket_report_invalid_arguments(app);
}
-#line 1267 "dk4socka07.ctr"
+#line 1290 "dk4socka07.ctr"
return back;
}
@@ -1437,7 +1438,11 @@ dk4socket_tcp_client_for_host_port_app(
int res;
-#line 1306 "dk4socka07.ctr"
+#line 1329 "dk4socka07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
res = dk4ma_write_c8_decimal_unsigned(
rpn, sizeof(rpn), (dk4_um_t)portno, 0, NULL
@@ -1468,7 +1473,7 @@ dk4socket_tcp_client_for_host_port_app(
}
-#line 1335 "dk4socka07.ctr"
+#line 1362 "dk4socka07.ctr"
return back;
}
@@ -1500,7 +1505,11 @@ dk4socket_tcp_client_for_host_num_service_app(
unsigned short lport = 0;
-#line 1365 "dk4socka07.ctr"
+#line 1392 "dk4socka07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
res = dk4ma_input_c8_dec_ushort(&rport, svcname, &endptr, 1, NULL);
if (0 == res) {
@@ -1556,7 +1565,7 @@ dk4socket_tcp_client_for_host_num_service_app(
}
-#line 1419 "dk4socka07.ctr"
+#line 1450 "dk4socka07.ctr"
return back;
}
@@ -1603,7 +1612,11 @@ dk4socket_tcp_client_for_host_port_app(
dk4_socket_t back = INVALID_SOCKET;
-#line 1464 "dk4socka07.ctr"
+#line 1495 "dk4socka07.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
dk4error_init(&er);
dk4socket_error_reset();
@@ -1637,10 +1650,10 @@ dk4socket_tcp_client_for_host_port_app(
}
if (INVALID_SOCKET == back) {
-#line 1496 "dk4socka07.ctr"
+#line 1531 "dk4socka07.ctr"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, AF_INET,
+ app, AF_INET,
(struct sockaddr *)(&sr4), sizeof(sr4),
((0 < lportno) ? ((struct sockaddr *)(&sl4)) : NULL),
((0 < lportno) ? (sizeof(sl4)) : 0),
@@ -1649,7 +1662,7 @@ dk4socket_tcp_client_for_host_port_app(
} else {
/* DEBUG: Connection established (30) */
dk4socket_report_connection_established(
- app, hostname, AF_INET,
+ app, AF_INET,
(struct sockaddr *)(&sr4), sizeof(sr4),
((0 < lportno) ? ((struct sockaddr *)(&sl4)) : NULL),
((0 < lportno) ? (sizeof(sl4)) : 0)
@@ -1690,10 +1703,10 @@ dk4socket_tcp_client_for_host_port_app(
}
if (INVALID_SOCKET == back) {
-#line 1547 "dk4socka07.ctr"
+#line 1582 "dk4socka07.ctr"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, AF_INET6,
+ app, AF_INET6,
(struct sockaddr *)(&sr6), sizeof(sr6),
((0 < lportno) ? ((struct sockaddr *)(&sl6)) : NULL),
((0 < lportno) ? (sizeof(sl6)) : 0),
@@ -1702,7 +1715,7 @@ dk4socket_tcp_client_for_host_port_app(
} else {
/* DEBUG: Connection established (30) */
dk4socket_report_connection_established(
- app, hostname, AF_INET6,
+ app, AF_INET6,
(struct sockaddr *)(&sr6), sizeof(sr6),
((0 < lportno) ? ((struct sockaddr *)(&sl6)) : NULL),
((0 < lportno) ? (sizeof(sl6)) : 0)
@@ -1736,7 +1749,7 @@ dk4socket_tcp_client_for_host_port_app(
}
-#line 1591 "dk4socka07.ctr"
+#line 1626 "dk4socka07.ctr"
return back;
}
diff --git a/support/dktools/dk4socka07.ctr b/support/dktools/dk4socka07.ctr
index 1fc622710a..fb20b111a8 100644
--- a/support/dktools/dk4socka07.ctr
+++ b/support/dktools/dk4socka07.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
#include "dk4mem.h"
@@ -26,6 +27,12 @@ license = bsd
#include "dk4maodd.h"
#include "dk4maodh.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -60,7 +67,6 @@ $!end
/** Report error from dk4socket_tcp_client_for_addr().
@param app Application structure for logging.
- @param hostname Host name to connect to.
@param afam Address family.
@param sremote Pointer to remote address buffer.
@param szremote Remote address size.
@@ -72,7 +78,6 @@ static
void
dk4socket_report_connection_error(
dk4_app_t *app,
- const dkChar *hostname,
int afam,
const struct sockaddr *sremote,
size_t szremote,
@@ -216,7 +221,6 @@ dk4socket_report_connection_error(
/** Report error from dk4socket_tcp_client_for_addr().
@param app Application structure for logging.
- @param hostname Host name to connect to.
@param afam Address family.
@param sremote Pointer to remote address buffer.
@param szremote Remote address size.
@@ -228,7 +232,6 @@ static
void
dk4socket_report_connection_established(
dk4_app_t *app,
- const dkChar *hostname,
int afam,
const struct sockaddr *sremote,
size_t szremote,
@@ -470,7 +473,7 @@ dk4socket_tcp_client_addresses_app(
);
if (INVALID_SOCKET != back) {
dk4socket_report_connection_established(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen
);
@@ -478,7 +481,7 @@ dk4socket_tcp_client_addresses_app(
} else { $? "! report failure"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen,
&er
@@ -495,7 +498,7 @@ dk4socket_tcp_client_addresses_app(
);
if (INVALID_SOCKET != back) {
dk4socket_report_connection_established(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
NULL, 0
);
@@ -503,7 +506,7 @@ dk4socket_tcp_client_addresses_app(
} else { $? "! report failure"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app,hostname,ra->ai_family,ra->ai_addr,ra->ai_addrlen,NULL,0,&er
+ app,ra->ai_family,ra->ai_addr,ra->ai_addrlen,NULL,0,&er
);
}
}
@@ -563,7 +566,7 @@ dk4socket_tcp_client_addresses_app(
);
if (INVALID_SOCKET != back) {
dk4socket_report_connection_established(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen
);
@@ -571,7 +574,7 @@ dk4socket_tcp_client_addresses_app(
} else { $? "! report failure"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
la->ai_addr, la->ai_addrlen,
&er
@@ -588,7 +591,7 @@ dk4socket_tcp_client_addresses_app(
);
if (INVALID_SOCKET != back) {
dk4socket_report_connection_established(
- app, hostname, ra->ai_family,
+ app, ra->ai_family,
ra->ai_addr, ra->ai_addrlen,
NULL, 0
);
@@ -596,7 +599,7 @@ dk4socket_tcp_client_addresses_app(
} else { $? "! report failure"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app,hostname,ra->ai_family,ra->ai_addr,ra->ai_addrlen,NULL,0,&er
+ app,ra->ai_family,ra->ai_addr,ra->ai_addrlen,NULL,0,&er
);
}
}
@@ -790,6 +793,10 @@ dk4socket_tcp_client_for_host_num_service_app(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_tcp_client_for_host_num_service_app (wchar_t +getaddrinfo)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) { $? ". args ok"
DK4_MEMRES(&rhints, sizeof(rhints));
rhints.ai_family = AF_UNSPEC;
@@ -874,6 +881,10 @@ dk4socket_tcp_client_for_host_port_app(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_tcp_client_for_host_port_app (wchar_t)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) { $? ". args ok"
dk4error_init(&er);
res = dk4ma_write_decimal_unsigned(
@@ -938,6 +949,10 @@ dk4socket_tcp_client_for_host_num_service_app(
unsigned short lport = 0U;
unsigned short iport = 0U;
$? "+ dk4socket_tcp_client_for_host_num_service_app (wchar_t)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
dk4error_init(&er);
res = dk4ma_input_dk_dec_ushort(&rport, svcname, &endptr, 1, NULL);
@@ -1054,6 +1069,10 @@ dk4socket_tcp_client_for_host_port_app(
dk4_socket_t back = INVALID_SOCKET;
$? "+ dk4socket_tcp_client_for_host_port_app (wchar_t)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
dk4error_init(&er);
if (0 != dk4recode_wchar_t_to_char(hona, sizeof(hona), hostname, &er)) {
@@ -1089,7 +1108,7 @@ dk4socket_tcp_client_for_host_port_app(
if (INVALID_SOCKET == back) { $? "! report failure"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, AF_INET,
+ app, AF_INET,
(struct sockaddr *)(&sr4), sizeof(sr4),
((0 < lportno) ? ((struct sockaddr *)(&sl4)) : NULL),
((0 < lportno) ? (sizeof(sl4)) : 0),
@@ -1098,7 +1117,7 @@ dk4socket_tcp_client_for_host_port_app(
} else {
/* DEBUG: Connection established (30) */
dk4socket_report_connection_established(
- app, hostname, AF_INET,
+ app, AF_INET,
(struct sockaddr *)(&sr4), sizeof(sr4),
((0 < lportno) ? ((struct sockaddr *)(&sl4)) : NULL),
((0 < lportno) ? (sizeof(sl4)) : 0)
@@ -1139,7 +1158,7 @@ dk4socket_tcp_client_for_host_port_app(
if (INVALID_SOCKET == back) { $? "! report failure"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, AF_INET6,
+ app, AF_INET6,
(struct sockaddr *)(&sr6), sizeof(sr6),
((0 < lportno) ? ((struct sockaddr *)(&sl6)) : NULL),
((0 < lportno) ? (sizeof(sl6)) : 0),
@@ -1148,7 +1167,7 @@ dk4socket_tcp_client_for_host_port_app(
} else {
/* DEBUG: Connection established (30) */
dk4socket_report_connection_established(
- app, hostname, AF_INET6,
+ app, AF_INET6,
(struct sockaddr *)(&sr6), sizeof(sr6),
((0 < lportno) ? ((struct sockaddr *)(&sl6)) : NULL),
((0 < lportno) ? (sizeof(sl6)) : 0)
@@ -1218,6 +1237,10 @@ dk4socket_tcp_client_for_host_num_service_app(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_tcp_client_for_host_num_service_app (char)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
$? ". svcname \"%!ds\"", TR_STR(svcname)
$? ". lsvcname \"%!ds\"", TR_STR(lsvcname)
if ((NULL != hostname) && (NULL != svcname)) { $? ". args ok"
@@ -1303,6 +1326,10 @@ dk4socket_tcp_client_for_host_port_app(
dk4_socket_t back = INVALID_SOCKET;
int res;
$? "+ dk4socket_tcp_client_for_host_port_app (char)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
res = dk4ma_write_c8_decimal_unsigned(
rpn, sizeof(rpn), (dk4_um_t)portno, 0, NULL
@@ -1362,6 +1389,10 @@ dk4socket_tcp_client_for_host_num_service_app(
unsigned short rport = 0;
unsigned short lport = 0;
$? "+ dk4socket_tcp_client_for_host_num_service_app (char)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(NULL != svcname);
+#endif
if ((NULL != hostname) && (NULL != svcname)) {
res = dk4ma_input_c8_dec_ushort(&rport, svcname, &endptr, 1, NULL);
if (0 == res) {
@@ -1461,6 +1492,10 @@ dk4socket_tcp_client_for_host_port_app(
struct hostent *hep = NULL;
dk4_socket_t back = INVALID_SOCKET;
$? "+ dk4socket_tcp_client_for_host_port_app (char)"
+#if DK4_USE_ASSERT
+ assert(NULL != hostname);
+ assert(0 < portno);
+#endif
if ((NULL != hostname) && (0 < portno)) {
dk4error_init(&er);
dk4socket_error_reset();
@@ -1495,7 +1530,7 @@ dk4socket_tcp_client_for_host_port_app(
if (INVALID_SOCKET == back) { $? "! report failure"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, AF_INET,
+ app, AF_INET,
(struct sockaddr *)(&sr4), sizeof(sr4),
((0 < lportno) ? ((struct sockaddr *)(&sl4)) : NULL),
((0 < lportno) ? (sizeof(sl4)) : 0),
@@ -1504,7 +1539,7 @@ dk4socket_tcp_client_for_host_port_app(
} else {
/* DEBUG: Connection established (30) */
dk4socket_report_connection_established(
- app, hostname, AF_INET,
+ app, AF_INET,
(struct sockaddr *)(&sr4), sizeof(sr4),
((0 < lportno) ? ((struct sockaddr *)(&sl4)) : NULL),
((0 < lportno) ? (sizeof(sl4)) : 0)
@@ -1546,7 +1581,7 @@ dk4socket_tcp_client_for_host_port_app(
if (INVALID_SOCKET == back) { $? "! report failure"
/* ERROR: Failed */
dk4socket_report_connection_error(
- app, hostname, AF_INET6,
+ app, AF_INET6,
(struct sockaddr *)(&sr6), sizeof(sr6),
((0 < lportno) ? ((struct sockaddr *)(&sl6)) : NULL),
((0 < lportno) ? (sizeof(sl6)) : 0),
@@ -1555,7 +1590,7 @@ dk4socket_tcp_client_for_host_port_app(
} else {
/* DEBUG: Connection established (30) */
dk4socket_report_connection_established(
- app, hostname, AF_INET6,
+ app, AF_INET6,
(struct sockaddr *)(&sr6), sizeof(sr6),
((0 < lportno) ? ((struct sockaddr *)(&sl6)) : NULL),
((0 < lportno) ? (sizeof(sl6)) : 0)
diff --git a/support/dktools/dk4socka08.c b/support/dktools/dk4socka08.c
index 89a9125bb2..f6a12a4e3b 100644
--- a/support/dktools/dk4socka08.c
+++ b/support/dktools/dk4socka08.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka08.ctr
*/
/** @file dk4socka08.c The dk4socka08 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 9 "dk4socka08.ctr"
+#include "dk4conf.h"
#include "dk4socka.h"
#include "dk4mem.h"
#include "dk4maodd.h"
@@ -47,7 +26,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 17 "dk4socka08.ctr"
+#line 18 "dk4socka08.ctr"
diff --git a/support/dktools/dk4socka08.ctr b/support/dktools/dk4socka08.ctr
index 0c47f1fddc..6238503954 100644
--- a/support/dktools/dk4socka08.ctr
+++ b/support/dktools/dk4socka08.ctr
@@ -2,11 +2,12 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4socka.h"
#include "dk4mem.h"
#include "dk4maodd.h"
diff --git a/support/dktools/dk4socka09.c b/support/dktools/dk4socka09.c
index 096f6f2099..c49c2dcd00 100644
--- a/support/dktools/dk4socka09.c
+++ b/support/dktools/dk4socka09.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4socka09.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4socka09.ctr
*/
/** @file dk4socka09.c The dk4socka09 module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dk4socka09.ctr"
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
#include "dk4error.h"
@@ -48,7 +27,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 19 "dk4socka09.ctr"
+#line 20 "dk4socka09.ctr"
diff --git a/support/dktools/dk4socka09.ctr b/support/dktools/dk4socka09.ctr
index 7b3c55b740..0910adc66e 100644
--- a/support/dktools/dk4socka09.ctr
+++ b/support/dktools/dk4socka09.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#include "dk4sock.h"
#include "dk4socka.h"
#include "dk4error.h"
diff --git a/support/dktools/dk4stat.c b/support/dktools/dk4stat.c
index 18764478c4..3d7dfa0804 100644
--- a/support/dktools/dk4stat.c
+++ b/support/dktools/dk4stat.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4stat.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4stat.ctr
*/
/** @file dk4stat.c The dk4stat module.
*/
-#line 78 "dk4stat.ctr"
+#line 96 "dk4stat.ctr"
+#include "dk4conf.h"
#include "dk4stat.h"
#if DK4_CHAR_SIZE > 1
#include "dk4statw.h"
@@ -46,9 +25,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4stat8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 87 "dk4stat.ctr"
+
+
+
+#line 115 "dk4stat.ctr"
@@ -56,6 +44,9 @@ int
dk4stat_is_regular(const dk4_stat_t *stb, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != stb);
+#endif
if (NULL != stb) {
#if DK4_ON_WINDOWS
if (((stb->st_mode) & _S_IFMT) == _S_IFREG) {
@@ -78,6 +69,9 @@ int
dk4stat_is_directory(const dk4_stat_t *stb, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != stb);
+#endif
if (NULL != stb) {
#if DK4_ON_WINDOWS
if (((stb->st_mode) & _S_IFMT) == _S_IFDIR) {
@@ -99,6 +93,9 @@ int
dk4stat_is_symlink(const dk4_stat_t *stb, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != stb);
+#endif
if (NULL != stb) {
#if DK4_ON_WINDOWS
@@ -121,6 +118,9 @@ int
dk4stat_is_unix_domain_socket(const dk4_stat_t *stb, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != stb);
+#endif
if (NULL != stb) {
#if DK4_ON_WINDOWS
diff --git a/support/dktools/dk4stat.ctr b/support/dktools/dk4stat.ctr
index f7b3fce431..388fbd0c0b 100644
--- a/support/dktools/dk4stat.ctr
+++ b/support/dktools/dk4stat.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -23,10 +23,28 @@ license = bsd
CRT on Windows: Required.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -76,6 +94,7 @@ dk4stat_is_unix_domain_socket(const dk4_stat_t *stb, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4stat.h"
#if DK4_CHAR_SIZE > 1
#include "dk4statw.h"
@@ -83,6 +102,15 @@ dk4stat_is_unix_domain_socket(const dk4_stat_t *stb, dk4_er_t *erp);
#include "dk4stat8.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
$!trace-include
@@ -91,6 +119,9 @@ int
dk4stat_is_regular(const dk4_stat_t *stb, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != stb);
+#endif
if (NULL != stb) {
#if DK4_ON_WINDOWS
if (((stb->st_mode) & _S_IFMT) == _S_IFREG) {
@@ -113,6 +144,9 @@ int
dk4stat_is_directory(const dk4_stat_t *stb, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != stb);
+#endif
if (NULL != stb) {
#if DK4_ON_WINDOWS
if (((stb->st_mode) & _S_IFMT) == _S_IFDIR) {
@@ -134,6 +168,9 @@ int
dk4stat_is_symlink(const dk4_stat_t *stb, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != stb);
+#endif
if (NULL != stb) {
#if DK4_ON_WINDOWS
@@ -156,6 +193,9 @@ int
dk4stat_is_unix_domain_socket(const dk4_stat_t *stb, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != stb);
+#endif
if (NULL != stb) {
#if DK4_ON_WINDOWS
diff --git a/support/dktools/dk4stat.h b/support/dktools/dk4stat.h
index 6b1b72f9ec..76453434aa 100644
--- a/support/dktools/dk4stat.h
+++ b/support/dktools/dk4stat.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4stat.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4stat.ctr
*/
#ifndef DK4STAT_H_INCLUDED
@@ -57,10 +35,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Required.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4stat8.c b/support/dktools/dk4stat8.c
index 44f56881fe..14ffea3b72 100644
--- a/support/dktools/dk4stat8.c
+++ b/support/dktools/dk4stat8.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4stat8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4stat8.ctr
*/
/** @file dk4stat8.c The dk4stat8 module.
*/
-#line 77 "dk4stat8.ctr"
+#line 96 "dk4stat8.ctr"
+#include "dk4conf.h"
#include "dk4stat8.h"
#include "dk4mem.h"
@@ -63,9 +42,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
-#line 103 "dk4stat8.ctr"
+
+
+#line 132 "dk4stat8.ctr"
@@ -73,27 +61,54 @@ int
dk4stat_c8(dk4_stat_t *dst, const char *path, dk4_er_t *erp)
{
int back = 0;
- if ((NULL != dst) && (NULL != path)) {
+
+
+#line 140 "dk4stat8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
+ if ((NULL != dst) && (NULL != path)) {
+
+#line 145 "dk4stat8.ctr"
errno = 0;
#if DK4_ON_WINDOWS
+
+
+#line 148 "dk4stat8.ctr"
if (0 == _stat64(path, dst))
#else
#if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE_STAT64
+
+
+#line 152 "dk4stat8.ctr"
if (0 == stat64(path, dst))
#else
+
+
+#line 155 "dk4stat8.ctr"
if (0 == stat(path, dst))
#endif
#endif
- {
+ {
+
+#line 159 "dk4stat8.ctr"
back = 1;
}
else
- {
+ {
+
+#line 163 "dk4stat8.ctr"
dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
}
- } else {
+ } else {
+
+#line 166 "dk4stat8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 169 "dk4stat8.ctr"
return back;
}
@@ -103,6 +118,10 @@ int
dk4stat_l_c8(dk4_stat_t *dst, const char *path, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
if ((NULL != dst) && (NULL != path)) {
#if DK4_ON_WINDOWS
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
diff --git a/support/dktools/dk4stat8.ctr b/support/dktools/dk4stat8.ctr
index 23ceb0da3b..6527937f96 100644
--- a/support/dktools/dk4stat8.ctr
+++ b/support/dktools/dk4stat8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -25,10 +25,29 @@ license = bsd
CRT on Windows: Required.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -75,6 +94,7 @@ dk4stat_l_c8(dk4_stat_t *dst, const char *path, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4stat8.h"
#include "dk4mem.h"
@@ -99,6 +119,15 @@ dk4stat_l_c8(dk4_stat_t *dst, const char *path, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
$!trace-include
@@ -107,27 +136,36 @@ int
dk4stat_c8(dk4_stat_t *dst, const char *path, dk4_er_t *erp)
{
int back = 0;
- if ((NULL != dst) && (NULL != path)) {
+ $? "+ dk4stat_c8"
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
+ if ((NULL != dst) && (NULL != path)) { $? ". args ok"
errno = 0;
#if DK4_ON_WINDOWS
+ $? ". Windows"
if (0 == _stat64(path, dst))
#else
#if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE_STAT64
+ $? ". have 64"
if (0 == stat64(path, dst))
#else
+ $? ". no 64"
if (0 == stat(path, dst))
#endif
#endif
- {
+ { $? ". success"
back = 1;
}
else
- {
+ { $? "! failed"
dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
}
- } else {
+ } else { $? "! args"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4stat_c8 %d", back
return back;
}
@@ -137,6 +175,10 @@ int
dk4stat_l_c8(dk4_stat_t *dst, const char *path, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
if ((NULL != dst) && (NULL != path)) {
#if DK4_ON_WINDOWS
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
diff --git a/support/dktools/dk4stat8.h b/support/dktools/dk4stat8.h
index 74eeff76ef..4188aebaf9 100644
--- a/support/dktools/dk4stat8.h
+++ b/support/dktools/dk4stat8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4stat8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4stat8.ctr
*/
#ifndef DK4STAT8_H_INCLUDED
@@ -57,10 +35,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Required.
*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4statd.c b/support/dktools/dk4statd.c
index 2efefb4fbe..bfe7e13def 100644
--- a/support/dktools/dk4statd.c
+++ b/support/dktools/dk4statd.c
@@ -1,53 +1,42 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4statd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4statd.ctr
*/
/** @file dk4statd.c The dk4statd module.
*/
-#line 70 "dk4statd.ctr"
+#line 88 "dk4statd.ctr"
+#include "dk4conf.h"
#include "dk4statd.h"
#include "dk4stat8.h"
#include "dk4statw.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4stat(dk4_stat_t *dst, const dkChar *path, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4stat_wc(dst, path, erp));
#else
@@ -60,6 +49,10 @@ dk4stat(dk4_stat_t *dst, const dkChar *path, dk4_er_t *erp)
int
dk4stat_l(dk4_stat_t *dst, const dkChar *path, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4stat_l_wc(dst, path, erp));
#else
diff --git a/support/dktools/dk4statd.ctr b/support/dktools/dk4statd.ctr
index bf275bcce5..806b5713a9 100644
--- a/support/dktools/dk4statd.ctr
+++ b/support/dktools/dk4statd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -19,10 +19,28 @@ license = bsd
CRT on Windows: Required.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -68,15 +86,26 @@ dk4stat_l(dk4_stat_t *dst, const dkChar *path, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4statd.h"
#include "dk4stat8.h"
#include "dk4statw.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4stat(dk4_stat_t *dst, const dkChar *path, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4stat_wc(dst, path, erp));
#else
@@ -89,6 +118,10 @@ dk4stat(dk4_stat_t *dst, const dkChar *path, dk4_er_t *erp)
int
dk4stat_l(dk4_stat_t *dst, const dkChar *path, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4stat_l_wc(dst, path, erp));
#else
diff --git a/support/dktools/dk4statd.h b/support/dktools/dk4statd.h
index 2c04dac673..aa1c083587 100644
--- a/support/dktools/dk4statd.h
+++ b/support/dktools/dk4statd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4statd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4statd.ctr
*/
#ifndef DK4STATD_H_INCLUDED
@@ -51,10 +29,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Required.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4statt.h b/support/dktools/dk4statt.h
index cd85489082..8bf6a90c8b 100644
--- a/support/dktools/dk4statt.h
+++ b/support/dktools/dk4statt.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4STATT_H_INCLUDED
#define DK4STATT_H_INCLUDED 1
@@ -15,11 +20,19 @@
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#if DK4_HAVE_SYS_TYPES_H
diff --git a/support/dktools/dk4statw.c b/support/dktools/dk4statw.c
index feb6831427..3a5fcaee94 100644
--- a/support/dktools/dk4statw.c
+++ b/support/dktools/dk4statw.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4statw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4statw.ctr
*/
/** @file dk4statw.c The dk4statw module.
*/
-#line 77 "dk4statw.ctr"
+#line 95 "dk4statw.ctr"
+#include "dk4conf.h"
#include "dk4statw.h"
#include "dk4mem.h"
@@ -70,9 +49,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
-#line 110 "dk4statw.ctr"
+
+#line 138 "dk4statw.ctr"
@@ -80,6 +68,10 @@ int
dk4stat_wc(dk4_stat_t *dst, const wchar_t *path, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
if ((NULL != dst) && (NULL != path)) {
errno = 0;
#if DK4_ON_WINDOWS
@@ -103,6 +95,10 @@ int
dk4stat_l_wc(dk4_stat_t *dst, const wchar_t *path, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
if ((NULL != dst) && (NULL != path)) {
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
} else {
diff --git a/support/dktools/dk4statw.ctr b/support/dktools/dk4statw.ctr
index 46c19515a8..c89d4e8d9d 100644
--- a/support/dktools/dk4statw.ctr
+++ b/support/dktools/dk4statw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -25,10 +25,28 @@ license = bsd
CRT on Windows: Required.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -75,6 +93,7 @@ dk4stat_l_wc(dk4_stat_t *dst, const wchar_t *path, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4statw.h"
#include "dk4mem.h"
@@ -106,6 +125,15 @@ dk4stat_l_wc(dk4_stat_t *dst, const wchar_t *path, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
$!trace-include
@@ -114,6 +142,10 @@ int
dk4stat_wc(dk4_stat_t *dst, const wchar_t *path, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
if ((NULL != dst) && (NULL != path)) {
errno = 0;
#if DK4_ON_WINDOWS
@@ -137,6 +169,10 @@ int
dk4stat_l_wc(dk4_stat_t *dst, const wchar_t *path, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != path);
+#endif
if ((NULL != dst) && (NULL != path)) {
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
} else {
diff --git a/support/dktools/dk4statw.h b/support/dktools/dk4statw.h
index 99e5fc5d5e..6c4aed60c0 100644
--- a/support/dktools/dk4statw.h
+++ b/support/dktools/dk4statw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4statw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4statw.ctr
*/
#ifndef DK4STATW_H_INCLUDED
@@ -57,10 +35,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Required.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
+#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4sto.c b/support/dktools/dk4sto.c
index 816bb21f7a..03858fa76b 100644
--- a/support/dktools/dk4sto.c
+++ b/support/dktools/dk4sto.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sto.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sto.ctr
*/
/** @file dk4sto.c The dk4sto module.
*/
-#line 451 "dk4sto.ctr"
+#line 466 "dk4sto.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4sto.h"
#include "dk4mem.h"
@@ -49,11 +36,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 464 "dk4sto.ctr"
+#line 494 "dk4sto.ctr"
@@ -96,7 +89,7 @@ dk4sto_node_init_for_object(
{
-#line 505 "dk4sto.ctr"
+#line 535 "dk4sto.ctr"
n->p = n->l = n->r = NULL;
n->b = n->w = 0;
n->o = o;
@@ -113,7 +106,7 @@ dk4sto_node_init_for_object(
case DK4STO_COMPARE_DOUBLE: (n->v).d = (*((s->e).d))(o,crit); break;
}
-#line 520 "dk4sto.ctr"
+#line 550 "dk4sto.ctr"
}
@@ -132,7 +125,7 @@ dk4sto_node_data_copy(
{
-#line 537 "dk4sto.ctr"
+#line 567 "dk4sto.ctr"
d->o = s->o;
switch(st->h) {
case DK4STO_COMPARE_CHAR: (d->v).c = (s->v).c ; break;
@@ -148,7 +141,7 @@ dk4sto_node_data_copy(
}
-#line 551 "dk4sto.ctr"
+#line 581 "dk4sto.ctr"
}
@@ -172,78 +165,87 @@ dk4sto_node_compare(
int back = 0;
-#line 573 "dk4sto.ctr"
+#line 603 "dk4sto.ctr"
+ /* Static code analysis: Result of operation is garbage or undefined.
+ Clang static code analysis complains the right operand in comparisons
+ (r->v).xxx could be garbage.
+ I think this is not correct.
+ It assumes the default branch is taken in dk4sto_node_init_for_object()
+ as s->h does not match any of the case values.
+ The same case values are are used here, and there is no change
+ of s->h meanwhile.
+ */
switch(s->h) {
case DK4STO_COMPARE_FCT: {
-#line 575 "dk4sto.ctr"
+#line 614 "dk4sto.ctr"
back = (*((s->e).comp))((void *)(l->o),(void *)(r->o),c);
if(back < 0) back = -1;
if(back > 0) back = 1;
} break;
case DK4STO_COMPARE_CHAR: {
-#line 580 "dk4sto.ctr"
+#line 619 "dk4sto.ctr"
if(((l->v).c) > ((r->v).c)) { back = 1; }
else { if(((l->v).c) < ((r->v).c)) { back = -1; } }
} break;
case DK4STO_COMPARE_UCHAR: {
-#line 584 "dk4sto.ctr"
+#line 623 "dk4sto.ctr"
if(((l->v).uc) > ((r->v).uc)) { back = 1; }
else { if(((l->v).uc) < ((r->v).uc)) { back = -1; } }
} break;
case DK4STO_COMPARE_SHORT: {
-#line 588 "dk4sto.ctr"
+#line 627 "dk4sto.ctr"
if(((l->v).s) > ((r->v).s)) { back = 1; }
else { if(((l->v).s) < ((r->v).s)) { back = -1; } }
} break;
case DK4STO_COMPARE_USHORT: {
-#line 592 "dk4sto.ctr"
+#line 631 "dk4sto.ctr"
if(((l->v).us) > ((r->v).us)) { back = 1; }
else { if(((l->v).us) < ((r->v).us)) { back = -1; } }
} break;
case DK4STO_COMPARE_INT: {
-#line 596 "dk4sto.ctr"
+#line 635 "dk4sto.ctr"
if(((l->v).i) > ((r->v).i)) { back = 1; }
else { if(((l->v).i) < ((r->v).i)) { back = -1; } }
} break;
case DK4STO_COMPARE_UINT: {
-#line 600 "dk4sto.ctr"
+#line 639 "dk4sto.ctr"
if(((l->v).ui) > ((r->v).ui)) { back = 1; }
else { if(((l->v).ui) < ((r->v).ui)) { back = -1; } }
} break;
case DK4STO_COMPARE_LONG: {
-#line 604 "dk4sto.ctr"
+#line 643 "dk4sto.ctr"
if(((l->v).l) > ((r->v).l)) { back = 1; }
else { if(((l->v).l) < ((r->v).l)) { back = -1; } }
} break;
case DK4STO_COMPARE_ULONG: {
-#line 608 "dk4sto.ctr"
+#line 647 "dk4sto.ctr"
if(((l->v).ul) > ((r->v).ul)) { back = 1; }
else { if(((l->v).ul) < ((r->v).ul)) { back = -1; } }
} break;
case DK4STO_COMPARE_FLOAT: {
-#line 612 "dk4sto.ctr"
+#line 651 "dk4sto.ctr"
if(((l->v).f) > ((r->v).f)) { back = 1; }
else { if(((l->v).f) < ((r->v).f)) { back = -1; } }
} break;
case DK4STO_COMPARE_DOUBLE: {
-#line 616 "dk4sto.ctr"
+#line 655 "dk4sto.ctr"
if(((l->v).d) > ((r->v).d)) { back = 1; }
else { if(((l->v).d) < ((r->v).d)) { back = -1; } }
} break;
}
-#line 620 "dk4sto.ctr"
+#line 659 "dk4sto.ctr"
return back;
}
@@ -266,7 +268,7 @@ dk4sto_unsorted_remove(dk4_sto_node_t *ro, dk4_sto_node_t *n)
dk4_sto_node_t *r = NULL; /* Right element. */
-#line 641 "dk4sto.ctr"
+#line 680 "dk4sto.ctr"
back = ro;
l = n->l; r = n->r;
if(r) {
@@ -278,7 +280,7 @@ dk4sto_unsorted_remove(dk4_sto_node_t *ro, dk4_sto_node_t *n)
back = r;
}
-#line 651 "dk4sto.ctr"
+#line 690 "dk4sto.ctr"
return back;
}
@@ -295,14 +297,14 @@ dk4sto_unsorted_add(dk4_sto_node_t *r, dk4_sto_node_t *n)
dk4_sto_node_t *back;
-#line 666 "dk4sto.ctr"
+#line 705 "dk4sto.ctr"
back = n;
n->r = r;
if(r) {
r->l = n;
}
-#line 671 "dk4sto.ctr"
+#line 710 "dk4sto.ctr"
return back;
}
@@ -318,7 +320,7 @@ dk4sto_unsorted_release_all_nodes(dk4_sto_node_t *r)
dk4_sto_node_t *n; /* Next element. */
-#line 685 "dk4sto.ctr"
+#line 724 "dk4sto.ctr"
c = r;
while(c) {
n = c->r;
@@ -330,7 +332,7 @@ dk4sto_unsorted_release_all_nodes(dk4_sto_node_t *r)
}
-#line 695 "dk4sto.ctr"
+#line 734 "dk4sto.ctr"
}
@@ -347,14 +349,14 @@ dk4sto_unsorted_find_next_node(dk4_sto_node_t *n, dk4_sto_node_t *r)
dk4_sto_node_t *back = NULL;
-#line 710 "dk4sto.ctr"
+#line 749 "dk4sto.ctr"
if(n) {
back = n->r;
} else {
back = r;
}
-#line 715 "dk4sto.ctr"
+#line 754 "dk4sto.ctr"
return back;
}
@@ -370,11 +372,11 @@ dk4sto_unsorted_find_last_node(dk4_sto_node_t *n)
dk4_sto_node_t *back = NULL;
-#line 729 "dk4sto.ctr"
+#line 768 "dk4sto.ctr"
if(n) back = n->l;
-#line 731 "dk4sto.ctr"
+#line 770 "dk4sto.ctr"
return back;
}
@@ -392,7 +394,7 @@ dk4sto_unsorted_find_exact(dk4_sto_node_t *r, void const *o)
dk4_sto_node_t *c; /* Current node. */
-#line 747 "dk4sto.ctr"
+#line 786 "dk4sto.ctr"
c = r;
while(c && (!back)) {
if((c->o) == o) {
@@ -401,7 +403,7 @@ dk4sto_unsorted_find_exact(dk4_sto_node_t *r, void const *o)
c = c->r;
}
-#line 754 "dk4sto.ctr"
+#line 793 "dk4sto.ctr"
return back;
}
@@ -432,7 +434,7 @@ dk4sto_left_rotation(dk4_sto_node_t *p)
dk4_sto_node_t *p1;
-#line 783 "dk4sto.ctr"
+#line 822 "dk4sto.ctr"
p1 = p->r;
p->r = p1->l;
if(p->r) (p->r)->p = p;
@@ -440,7 +442,7 @@ dk4sto_left_rotation(dk4_sto_node_t *p)
if(p) p->p = p1;
-#line 789 "dk4sto.ctr"
+#line 828 "dk4sto.ctr"
return p1;
}
@@ -456,7 +458,7 @@ dk4sto_right_rotation(dk4_sto_node_t *p)
dk4_sto_node_t *p1;
-#line 803 "dk4sto.ctr"
+#line 842 "dk4sto.ctr"
p1 = p->l;
p->l = p1->r;
if(p->l) (p->l)->p = p;
@@ -464,7 +466,7 @@ dk4sto_right_rotation(dk4_sto_node_t *p)
if(p) p->p = p1;
-#line 809 "dk4sto.ctr"
+#line 848 "dk4sto.ctr"
return p1;
}
@@ -479,15 +481,15 @@ dk4sto_inc_balance(dk4_sto_node_t *p)
short x; /* New balance value. */
-#line 822 "dk4sto.ctr"
+#line 861 "dk4sto.ctr"
x = p->b;
-#line 823 "dk4sto.ctr"
+#line 862 "dk4sto.ctr"
x++;
if(x > 3) x = 0;
p->b = x;
-#line 826 "dk4sto.ctr"
+#line 865 "dk4sto.ctr"
}
@@ -501,15 +503,15 @@ dk4sto_dec_balance(dk4_sto_node_t *p)
short x; /* New balance value. */
-#line 838 "dk4sto.ctr"
+#line 877 "dk4sto.ctr"
x = p->b;
-#line 839 "dk4sto.ctr"
+#line 878 "dk4sto.ctr"
x--;
if(x < 0) x = 3;
p->b = x;
-#line 842 "dk4sto.ctr"
+#line 881 "dk4sto.ctr"
}
@@ -525,17 +527,18 @@ dk4sto_left_deleted(dk4_sto_node_t *p, short *h)
{
-#line 856 "dk4sto.ctr"
+#line 895 "dk4sto.ctr"
switch(p->b) {
case 0: *h = - *h;
+ /* fall-through */
case 3:
-#line 860 "dk4sto.ctr"
+#line 900 "dk4sto.ctr"
dk4sto_inc_balance(p);
-#line 862 "dk4sto.ctr"
+#line 902 "dk4sto.ctr"
break;
case 1: {
switch((p->r)->b) {
@@ -561,7 +564,7 @@ dk4sto_left_deleted(dk4_sto_node_t *p, short *h)
}
-#line 886 "dk4sto.ctr"
+#line 926 "dk4sto.ctr"
return p;
}
@@ -577,9 +580,10 @@ dk4sto_right_deleted(dk4_sto_node_t *p, short *h)
{
-#line 900 "dk4sto.ctr"
+#line 940 "dk4sto.ctr"
switch(p->b) {
case 0: *h = - *h;
+ /* fall-through */
case 1: dk4sto_dec_balance(p);
break;
case 3: {
@@ -606,7 +610,7 @@ dk4sto_right_deleted(dk4_sto_node_t *p, short *h)
}
-#line 927 "dk4sto.ctr"
+#line 968 "dk4sto.ctr"
return p;
}
@@ -629,7 +633,7 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
dk4_sto_node_t *s = NULL; /* Father of r. */
-#line 948 "dk4sto.ctr"
+#line 989 "dk4sto.ctr"
back = root;
p = r = root; q = s = NULL;
/*
@@ -638,6 +642,10 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
The final new node has an empty "w" field.
*/
while(p) {
+ /*
+ q is either NULL (in first pass) or the parent
+ of the current node in p.
+ */
if(p->b) {
s = q; r = p;
}
@@ -650,8 +658,13 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
p = p->r;
}
}
+ /*
+ q is either NULL or the last node visited.
+ r is the last unbalanced node (critical node).
+ s is either NULL or the parent of the last unbalanced node.
+ */
p = newnode;
- if(!back) {
+ if(NULL == back) {
/*
When inserting into an empty tree we are done here.
*/
@@ -668,10 +681,10 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
q->r = p;
q->w = DK4STO_WALK_RIGHT;
}
+ p->p = q;
/*
Now we must balance the tree again if necessary.
*/
- p->p = q;
if(r) {
/*
There is a critical node.
@@ -702,6 +715,16 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
p->b = 0;
p = dk4sto_right_rotation(p);
} else {
+ /* Static code analyis: Potentially dereferencing NULL pointer.
+ I do not think so. We have to balance at p because the
+ left subtree is too deep. We did not add the new node to
+ the left childs left subtree, so we must have added it to the
+ left childs right subtree. So the left childs right child
+ can not be NULL.
+ */
+#if DK4_USE_ASSERT
+ assert (NULL != (p->l)->r);
+#endif
p->b = (((((p->l)->r)->b) == 3) ? 1 : 0);
(p->l)->b = (((((p->l)->r)->b) == 1) ? 3 : 0);
p->l = dk4sto_left_rotation(p->l);
@@ -713,6 +736,16 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
p->b = 0;
p = dk4sto_left_rotation(p);
} else {
+ /* Static code analyis: Potentially dereferencing NULL pointer.
+ I do not think so. We have to balance at p because the
+ right subtree is too deep. We did not add the new node to
+ the right childs right subtree, so we must have added it to the
+ right childs left subtree. So the right childs left child
+ can not be NULL.
+ */
+#if DK4_USE_ASSERT
+ assert(NULL != (p->r)->l);
+#endif
p->b = (((((p->r)->l)->b) == 1) ? 3 : 0);
(p->r)->b = (((((p->r)->l)->b) == 3) ? 1 : 0);
p->r = dk4sto_right_rotation(p->r);
@@ -743,7 +776,40 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
}
-#line 1060 "dk4sto.ctr"
+#line 1130 "dk4sto.ctr"
+ return back;
+}
+
+
+
+/** Find last node in a tree storage.
+ @param n Node to start search from.
+ @return Last node or NULL.
+*/
+static dk4_sto_node_t *
+dk4sto_tree_find_last_node(dk4_sto_node_t *n)
+{
+ dk4_sto_node_t *back = NULL;
+ dk4_sto_node_t *c; /* Current node. */
+ dk4_sto_node_t *p; /* Father of c. */
+
+
+#line 1146 "dk4sto.ctr"
+ if(n->l) {
+ back = n->l;
+ while(back->r) { back = back->r; }
+ } else {
+ c = n; p = c->p;
+ while(p && (!back)) {
+ if((p->r) == c) {
+ back = p;
+ } else {
+ c = p; p = c->p;
+ }
+ }
+ }
+
+#line 1159 "dk4sto.ctr"
return back;
}
@@ -769,6 +835,8 @@ dk4sto_avlt_delete(
dk4_sto_node_t *q = NULL; /* Father of p. */
dk4_sto_node_t *r = NULL; /* Critical node. */
dk4_sto_node_t *todel = NULL; /* Node to delete. */
+ dk4_sto_node_t *itn = NULL; /* Iterator node. */
+ dk4_sto_it_t *iterat = NULL; /* Iterator */
short x1 = 0; /* Balance value. */
short delroot = 0; /* Flag: Delete tree node. */
int can_continue = 1; /* Flag: Can continue. */
@@ -776,7 +844,7 @@ dk4sto_avlt_delete(
todel = node;
-#line 1091 "dk4sto.ctr"
+#line 1192 "dk4sto.ctr"
/*
Make sure the node to delete has max.
1 subtree.
@@ -784,14 +852,25 @@ dk4sto_avlt_delete(
if((todel->l) && (todel->r)) {
-#line 1097 "dk4sto.ctr"
+#line 1198 "dk4sto.ctr"
todel = todel->l;
while(todel->r) todel = todel->r;
dk4sto_node_data_copy(node,todel,st);
+ /*
+ 2019-03-24 Change iterators again.
+ */
+ itn = dk4sto_tree_find_last_node(todel);
+ iterat = (dk4_sto_it_t *)(st->i);
+ while(NULL != iterat) {
+ if ((iterat->c) == todel) {
+ iterat->c = itn;
+ }
+ iterat = iterat->r;
+ }
}
if(!(todel->p)) {
-#line 1102 "dk4sto.ctr"
+#line 1214 "dk4sto.ctr"
delroot = 1;
}
/*
@@ -803,12 +882,12 @@ dk4sto_avlt_delete(
if((todel->p)->l == todel) {
-#line 1112 "dk4sto.ctr"
+#line 1224 "dk4sto.ctr"
(todel->p)->w = DK4STO_WALK_LEFT;
} else {
-#line 1115 "dk4sto.ctr"
+#line 1227 "dk4sto.ctr"
(todel->p)->w = DK4STO_WALK_RIGHT;
}
todel = todel->p;
@@ -820,49 +899,49 @@ dk4sto_avlt_delete(
while(can_continue) {
-#line 1125 "dk4sto.ctr"
+#line 1237 "dk4sto.ctr"
#if VERSION_BEFORE_20150821
if(p) {
-#line 1127 "dk4sto.ctr"
+#line 1239 "dk4sto.ctr"
#endif
if(p->w) {
-#line 1129 "dk4sto.ctr"
+#line 1241 "dk4sto.ctr"
if(p->b == 0) {
x1 = 0;
-#line 1131 "dk4sto.ctr"
+#line 1243 "dk4sto.ctr"
}
delpath[x1++] = p;
-#line 1133 "dk4sto.ctr"
+#line 1245 "dk4sto.ctr"
if(x1 >= st->l) {
-#line 1134 "dk4sto.ctr"
+#line 1246 "dk4sto.ctr"
/* x1 too large */
*success_indicator = 0;
goto error_mark;
}
if(p->w == DK4STO_WALK_LEFT) {
-#line 1139 "dk4sto.ctr"
+#line 1251 "dk4sto.ctr"
p = p->l;
} else {
-#line 1141 "dk4sto.ctr"
+#line 1253 "dk4sto.ctr"
p = p->r;
}
} else {
can_continue = 0;
-#line 1145 "dk4sto.ctr"
+#line 1257 "dk4sto.ctr"
}
#if VERSION_BEFORE_20150821
} else {
can_continue = 0;
-#line 1149 "dk4sto.ctr"
+#line 1261 "dk4sto.ctr"
}
#endif
}
@@ -877,48 +956,48 @@ dk4sto_avlt_delete(
if(x1 == 0) {
if(delroot) {
-#line 1162 "dk4sto.ctr"
+#line 1274 "dk4sto.ctr"
back = q;
}
}
while(x1 > 0) {
-#line 1166 "dk4sto.ctr"
+#line 1278 "dk4sto.ctr"
x1--;
p = delpath[x1];
if(p->w == DK4STO_WALK_LEFT) {
-#line 1170 "dk4sto.ctr"
+#line 1282 "dk4sto.ctr"
p->l = q; if(q) q->p = p;
q = dk4sto_left_deleted(p, &x1);
-#line 1173 "dk4sto.ctr"
+#line 1285 "dk4sto.ctr"
} else {
-#line 1175 "dk4sto.ctr"
+#line 1287 "dk4sto.ctr"
p->r = q; if(q) q->p = p;
q = dk4sto_right_deleted(p, &x1);
-#line 1178 "dk4sto.ctr"
+#line 1290 "dk4sto.ctr"
}
if(x1 == 0) {
-#line 1181 "dk4sto.ctr"
+#line 1293 "dk4sto.ctr"
if(delpath[x1] == back) {
-#line 1183 "dk4sto.ctr"
+#line 1295 "dk4sto.ctr"
back = q;
}
}
if(x1 < 0) {
-#line 1187 "dk4sto.ctr"
+#line 1299 "dk4sto.ctr"
p = delpath[0 - x1 - 1];
if(p->w == DK4STO_WALK_LEFT) {
p->l = q;
@@ -934,7 +1013,7 @@ error_mark:
}
-#line 1201 "dk4sto.ctr"
+#line 1313 "dk4sto.ctr"
return back;
}
@@ -960,7 +1039,7 @@ dk4sto_tree_find_like(
int testval = 0; /* Comparison result. */
-#line 1225 "dk4sto.ctr"
+#line 1337 "dk4sto.ctr"
c = root;
while(c) {
testval = dk4sto_node_compare(c,testnode,st,crit);
@@ -978,7 +1057,7 @@ dk4sto_tree_find_like(
}
}
-#line 1241 "dk4sto.ctr"
+#line 1353 "dk4sto.ctr"
return back;
}
@@ -1008,7 +1087,7 @@ dk4sto_tree_release_all_nodes(dk4_sto_node_t *r)
{
-#line 1269 "dk4sto.ctr"
+#line 1381 "dk4sto.ctr"
if(r) {
dk4sto_tree_release_all_nodes(r->l);
dk4sto_tree_release_all_nodes(r->r);
@@ -1018,7 +1097,7 @@ dk4sto_tree_release_all_nodes(dk4_sto_node_t *r)
dk4mem_free(r) ;
}
-#line 1277 "dk4sto.ctr"
+#line 1389 "dk4sto.ctr"
}
@@ -1036,7 +1115,7 @@ dk4sto_tree_find_next_node(dk4_sto_node_t *n, dk4_sto_node_t *r)
dk4_sto_node_t *p = NULL; /* Parent of c. */
-#line 1293 "dk4sto.ctr"
+#line 1405 "dk4sto.ctr"
/*
if(n) {
if(n->r) {
@@ -1079,40 +1158,7 @@ dk4sto_tree_find_next_node(dk4_sto_node_t *n, dk4_sto_node_t *r)
}
-#line 1334 "dk4sto.ctr"
- return back;
-}
-
-
-
-/** Find last node in a tree storage.
- @param n Node to start search from.
- @return Last node or NULL.
-*/
-static dk4_sto_node_t *
-dk4sto_tree_find_last_node(dk4_sto_node_t *n)
-{
- dk4_sto_node_t *back = NULL;
- dk4_sto_node_t *c; /* Current node. */
- dk4_sto_node_t *p; /* Father of c. */
-
-
-#line 1350 "dk4sto.ctr"
- if(n->l) {
- back = n->l;
- while(back->r) { back = back->r; }
- } else {
- c = n; p = c->p;
- while(p && (!back)) {
- if((p->r) == c) {
- back = p;
- } else {
- c = p; p = c->p;
- }
- }
- }
-
-#line 1363 "dk4sto.ctr"
+#line 1446 "dk4sto.ctr"
return back;
}
@@ -1134,7 +1180,7 @@ dk4sto_tree_find_exact(dk4_sto_node_t *r, void const *o, dk4_sto_t *s)
int testval = 0; /* Comparison result. */
-#line 1383 "dk4sto.ctr"
+#line 1466 "dk4sto.ctr"
dk4sto_node_init_for_object(&testnode, (void *)o, s, s->c);
c = dk4sto_tree_find_like(r, &testnode, s, s->c, &candidate);
while(c && (!back)) {
@@ -1150,7 +1196,7 @@ dk4sto_tree_find_exact(dk4_sto_node_t *r, void const *o, dk4_sto_t *s)
}
}
-#line 1397 "dk4sto.ctr"
+#line 1480 "dk4sto.ctr"
return back;
}
@@ -1200,7 +1246,7 @@ dk4sto_list_find_like(
int testval = 0; /* Comparison result. */
-#line 1445 "dk4sto.ctr"
+#line 1528 "dk4sto.ctr"
c = root;
while(c && (!back)) {
testval = dk4sto_node_compare(c,testnode,st,crit);
@@ -1218,7 +1264,7 @@ dk4sto_list_find_like(
}
}
-#line 1461 "dk4sto.ctr"
+#line 1544 "dk4sto.ctr"
return back;
}
@@ -1227,20 +1273,19 @@ dk4sto_list_find_like(
/** Find node for an object (exact search).
@param r Root node.
@param o Object.
- @param s Storage.
@return Pointer to the objects node or NULL.
*/
static dk4_sto_node_t *
-dk4sto_list_find_exact(dk4_sto_node_t *r, void const *o, dk4_sto_t *s)
+dk4sto_list_find_exact(dk4_sto_node_t *r, void const *o)
{
dk4_sto_node_t *back;
-#line 1477 "dk4sto.ctr"
+#line 1559 "dk4sto.ctr"
back = dk4sto_unsorted_find_exact(r,o);
-#line 1479 "dk4sto.ctr"
+#line 1561 "dk4sto.ctr"
return back;
}
@@ -1262,7 +1307,7 @@ dk4sto_list_add(dk4_sto_node_t *r, dk4_sto_node_t *n, dk4_sto_t *s)
int ende;
-#line 1499 "dk4sto.ctr"
+#line 1581 "dk4sto.ctr"
back = r;
if(r) {
larger = smaller = NULL;
@@ -1299,7 +1344,7 @@ dk4sto_list_add(dk4_sto_node_t *r, dk4_sto_node_t *n, dk4_sto_t *s)
back = n;
}
-#line 1534 "dk4sto.ctr"
+#line 1616 "dk4sto.ctr"
return back;
}
@@ -1313,11 +1358,11 @@ dk4sto_list_release_all_nodes(dk4_sto_node_t *r)
{
-#line 1546 "dk4sto.ctr"
+#line 1628 "dk4sto.ctr"
dk4sto_unsorted_release_all_nodes(r);
-#line 1548 "dk4sto.ctr"
+#line 1630 "dk4sto.ctr"
}
@@ -1333,11 +1378,11 @@ dk4sto_list_find_next_node(dk4_sto_node_t *n, dk4_sto_node_t *r)
dk4_sto_node_t *back;
-#line 1562 "dk4sto.ctr"
+#line 1644 "dk4sto.ctr"
back = dk4sto_unsorted_find_next_node(n,r);
-#line 1564 "dk4sto.ctr"
+#line 1646 "dk4sto.ctr"
return back;
}
@@ -1353,11 +1398,11 @@ dk4sto_list_find_last_node(dk4_sto_node_t *n)
dk4_sto_node_t *back;
-#line 1578 "dk4sto.ctr"
+#line 1660 "dk4sto.ctr"
back = dk4sto_unsorted_find_last_node(n);
-#line 1580 "dk4sto.ctr"
+#line 1662 "dk4sto.ctr"
return back;
}
@@ -1366,24 +1411,18 @@ dk4sto_list_find_last_node(dk4_sto_node_t *n)
/** Remove storage node from list storage.
@param ro Root node.
@param n Node to remove.
- @param st Storage.
- @param sci ???
- @param toremove ???
*/
static dk4_sto_node_t *
-dk4sto_list_remove(
- dk4_sto_node_t *ro, dk4_sto_node_t *n, dk4_sto_t *st, int *sci,
- dk4_sto_node_t **toremove
-)
+dk4sto_list_remove(dk4_sto_node_t *ro, dk4_sto_node_t *n)
{
dk4_sto_node_t *back;
-#line 1600 "dk4sto.ctr"
+#line 1676 "dk4sto.ctr"
back = dk4sto_unsorted_remove(ro,n);
-#line 1602 "dk4sto.ctr"
+#line 1678 "dk4sto.ctr"
return back;
}
@@ -1405,7 +1444,11 @@ dk4sto_traverse_iterators_for(void *it, void *o)
dk4_sto_it_t *c = NULL; /* Current node. */
-#line 1622 "dk4sto.ctr"
+#line 1698 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != it);
+ assert(NULL != o);
+#endif
if(it) {
c = (dk4_sto_it_t *)it;
while(c && (!back)) {
@@ -1418,7 +1461,7 @@ dk4sto_traverse_iterators_for(void *it, void *o)
}
}
-#line 1633 "dk4sto.ctr"
+#line 1713 "dk4sto.ctr"
return back;
}
@@ -1435,7 +1478,10 @@ dk4sto_find_last_node(dk4_sto_node_t *n, dk4_sto_t *st)
dk4_sto_node_t *back = NULL;
-#line 1648 "dk4sto.ctr"
+#line 1728 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st->h) {
if(st->t) {
back = dk4sto_tree_find_last_node(n);
@@ -1447,7 +1493,7 @@ dk4sto_find_last_node(dk4_sto_node_t *n, dk4_sto_t *st)
}
-#line 1658 "dk4sto.ctr"
+#line 1741 "dk4sto.ctr"
return back;
}
@@ -1465,7 +1511,10 @@ dk4sto_storage_init(dk4_sto_t *st, dk4_er_t *erp)
short l = 0; /* Critical path length. */
-#line 1674 "dk4sto.ctr"
+#line 1757 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
/* delpath begin address and length */
st->d = NULL; st->l = 0;
/* root node */
@@ -1483,7 +1532,7 @@ dk4sto_storage_init(dk4_sto_t *st, dk4_er_t *erp)
back = 1;
}
-#line 1690 "dk4sto.ctr"
+#line 1776 "dk4sto.ctr"
return back;
}
@@ -1497,7 +1546,10 @@ dk4sto_storage_end(dk4_sto_t *st)
{
-#line 1702 "dk4sto.ctr"
+#line 1788 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
/* release iterators */
{
dk4_sto_it_t *c = NULL; /* Current iterator. */
@@ -1507,7 +1559,7 @@ dk4sto_storage_end(dk4_sto_t *st)
while(c) {
-#line 1710 "dk4sto.ctr"
+#line 1799 "dk4sto.ctr"
n = c->r;
c->r = NULL;
c->l = NULL;
@@ -1520,7 +1572,7 @@ dk4sto_storage_end(dk4_sto_t *st)
}
-#line 1721 "dk4sto.ctr"
+#line 1810 "dk4sto.ctr"
/* release nodes */
{
if(st->h) {
@@ -1536,7 +1588,7 @@ dk4sto_storage_end(dk4_sto_t *st)
}
-#line 1735 "dk4sto.ctr"
+#line 1824 "dk4sto.ctr"
/* release delpath */
{
dk4_sto_node_p *p;
@@ -1546,7 +1598,7 @@ dk4sto_storage_end(dk4_sto_t *st)
}
-#line 1743 "dk4sto.ctr"
+#line 1832 "dk4sto.ctr"
/* set pointers to NULL */
{
st->h = 0;
@@ -1554,10 +1606,10 @@ dk4sto_storage_end(dk4_sto_t *st)
}
-#line 1749 "dk4sto.ctr"
+#line 1838 "dk4sto.ctr"
-#line 1750 "dk4sto.ctr"
+#line 1839 "dk4sto.ctr"
}
@@ -1573,7 +1625,7 @@ dk4sto_open(dk4_er_t *erp)
dk4_sto_t *back = NULL;
-#line 1764 "dk4sto.ctr"
+#line 1853 "dk4sto.ctr"
back = dk4mem_new(dk4_sto_t,1,erp) ;
if(back) {
if(!dk4sto_storage_init(back,erp)) {
@@ -1582,7 +1634,7 @@ dk4sto_open(dk4_er_t *erp)
}
}
-#line 1771 "dk4sto.ctr"
+#line 1860 "dk4sto.ctr"
return back;
}
@@ -1593,13 +1645,16 @@ dk4sto_close(dk4_sto_t *st)
{
-#line 1780 "dk4sto.ctr"
+#line 1869 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st) {
dk4sto_storage_end(st);
dk4mem_free(st) ;
}
-#line 1784 "dk4sto.ctr"
+#line 1876 "dk4sto.ctr"
}
@@ -1607,6 +1662,9 @@ dk4sto_close(dk4_sto_t *st)
void
dk4sto_remove_all(dk4_sto_t *st)
{
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st) {
/* reset all iterators */
dk4_sto_it_t *c = NULL; /* Curent iterator. */
@@ -1644,15 +1702,19 @@ dk4sto_remove(dk4_sto_t *st, void *o, dk4_er_t *erp)
dk4_sto_it_t *iterator = NULL; /* Traverse all iterators. */
-#line 1827 "dk4sto.ctr"
- if(st && o) {
+#line 1922 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != o);
+#endif
+ if((NULL != st) && (NULL != o)) {
node_to_remove = dk4sto_traverse_iterators_for(st->i, o);
if(!node_to_remove) {
if(st->h) {
if(st->t) {
node_to_remove = dk4sto_tree_find_exact(st->r,o,st);
} else {
- node_to_remove = dk4sto_list_find_exact(st->r,o,st);
+ node_to_remove = dk4sto_list_find_exact(st->r,o);
}
} else {
node_to_remove = dk4sto_unsorted_find_exact(st->r,o);
@@ -1674,7 +1736,7 @@ dk4sto_remove(dk4_sto_t *st, void *o, dk4_er_t *erp)
dk4sto_tree_remove(st->r,node_to_remove,st,&back,&node_to_remove);
} else {
st->r =
- dk4sto_list_remove(st->r,node_to_remove,st,&back,&node_to_remove);
+ dk4sto_list_remove(st->r,node_to_remove);
}
} else {
st->r = dk4sto_unsorted_remove(st->r,node_to_remove);
@@ -1689,7 +1751,7 @@ dk4sto_remove(dk4_sto_t *st, void *o, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 1870 "dk4sto.ctr"
+#line 1969 "dk4sto.ctr"
return back;
}
@@ -1702,8 +1764,12 @@ dk4sto_add(dk4_sto_t *st, void *o, dk4_er_t *erp)
dk4_sto_node_t *n = NULL; /* New node. */
-#line 1881 "dk4sto.ctr"
- if(st && o) {
+#line 1980 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != o);
+#endif
+ if((NULL != st) && (NULL != o)) {
n = dk4mem_new(dk4_sto_node_t,1,erp);
if(n) {
dk4sto_node_init_for_object(n,o,st,st->c);
@@ -1722,7 +1788,7 @@ dk4sto_add(dk4_sto_t *st, void *o, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 1899 "dk4sto.ctr"
+#line 2002 "dk4sto.ctr"
return back;
}
@@ -1734,7 +1800,10 @@ dk4sto_it_open(dk4_sto_t *st, dk4_er_t *erp)
dk4_sto_it_t *back = NULL;
-#line 1909 "dk4sto.ctr"
+#line 2012 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st) {
back = dk4mem_new(dk4_sto_it_t,1,erp);
if(back) {
@@ -1748,7 +1817,7 @@ dk4sto_it_open(dk4_sto_t *st, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 1921 "dk4sto.ctr"
+#line 2027 "dk4sto.ctr"
return back;
}
@@ -1762,7 +1831,10 @@ dk4sto_it_close(dk4_sto_it_t *it)
dk4_sto_t *s = NULL; /* The storage. */
-#line 1933 "dk4sto.ctr"
+#line 2039 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != it);
+#endif
if(it) {
s = it->s;
l = it->l;
@@ -1781,7 +1853,7 @@ dk4sto_it_close(dk4_sto_it_t *it)
dk4mem_free(it) ;
}
-#line 1950 "dk4sto.ctr"
+#line 2059 "dk4sto.ctr"
}
@@ -1791,12 +1863,15 @@ dk4sto_it_reset(dk4_sto_it_t *it)
{
-#line 1958 "dk4sto.ctr"
+#line 2067 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != it);
+#endif
if(it) {
it->c = NULL;
}
-#line 1961 "dk4sto.ctr"
+#line 2073 "dk4sto.ctr"
}
@@ -1807,7 +1882,10 @@ dk4sto_it_next(dk4_sto_it_t *it)
void *back = NULL;
-#line 1970 "dk4sto.ctr"
+#line 2082 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != it);
+#endif
if(it) {
if(it->s) {
if((it->s)->h) {
@@ -1825,7 +1903,7 @@ dk4sto_it_next(dk4_sto_it_t *it)
}
}
-#line 1986 "dk4sto.ctr"
+#line 2101 "dk4sto.ctr"
return back;
}
@@ -1837,14 +1915,18 @@ dk4sto_it_find_exact(dk4_sto_it_t *i, void const *o)
void *back = NULL;
-#line 1996 "dk4sto.ctr"
- if(i && o) {
+#line 2111 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+ assert(NULL != o);
+#endif
+ if((NULL != i) && (NULL != o)) {
if(i->s) {
if((i->s)->h) {
if((i->s)->t) {
i->c = dk4sto_tree_find_exact((i->s)->r, o, i->s);
} else {
- i->c = dk4sto_list_find_exact((i->s)->r, o, i->s);
+ i->c = dk4sto_list_find_exact((i->s)->r, o);
}
} else {
i->c = dk4sto_unsorted_find_exact((i->s)->r, o);
@@ -1855,7 +1937,7 @@ dk4sto_it_find_exact(dk4_sto_it_t *i, void const *o)
}
}
-#line 2012 "dk4sto.ctr"
+#line 2131 "dk4sto.ctr"
return back;
}
@@ -1869,8 +1951,12 @@ dk4sto_it_find_like(dk4_sto_it_t *i, void const *o, int cr)
dk4_sto_node_t *candidate = NULL; /* Candicate node. */
-#line 2024 "dk4sto.ctr"
- if(i && o) {
+#line 2143 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+ assert(NULL != o);
+#endif
+ if((NULL != i) && (NULL != o)) {
if(i->s) {
candidate = NULL;
if((i->s)->h) {
@@ -1893,7 +1979,7 @@ dk4sto_it_find_like(dk4_sto_it_t *i, void const *o, int cr)
}
}
-#line 2046 "dk4sto.ctr"
+#line 2169 "dk4sto.ctr"
return back;
}
@@ -1905,7 +1991,11 @@ dk4sto_set_eval_c(dk4_sto_t *st, dk4_fct_eval_c_t *f, int cr)
int back = 0;
-#line 2056 "dk4sto.ctr"
+#line 2179 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -1915,7 +2005,7 @@ dk4sto_set_eval_c(dk4_sto_t *st, dk4_fct_eval_c_t *f, int cr)
}
}
-#line 2064 "dk4sto.ctr"
+#line 2191 "dk4sto.ctr"
return back;
}
@@ -1927,7 +2017,11 @@ dk4sto_set_eval_uc(dk4_sto_t *st, dk4_fct_eval_uc_t *f, int cr)
int back = 0;
-#line 2074 "dk4sto.ctr"
+#line 2201 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -1937,7 +2031,7 @@ dk4sto_set_eval_uc(dk4_sto_t *st, dk4_fct_eval_uc_t *f, int cr)
}
}
-#line 2082 "dk4sto.ctr"
+#line 2213 "dk4sto.ctr"
return back;
}
@@ -1949,7 +2043,11 @@ dk4sto_set_eval_s(dk4_sto_t *st, dk4_fct_eval_s_t *f, int cr)
int back = 0;
-#line 2092 "dk4sto.ctr"
+#line 2223 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -1959,7 +2057,7 @@ dk4sto_set_eval_s(dk4_sto_t *st, dk4_fct_eval_s_t *f, int cr)
}
}
-#line 2100 "dk4sto.ctr"
+#line 2235 "dk4sto.ctr"
return back;
}
@@ -1971,7 +2069,11 @@ dk4sto_set_eval_us(dk4_sto_t *st, dk4_fct_eval_us_t *f, int cr)
int back = 0;
-#line 2110 "dk4sto.ctr"
+#line 2245 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -1981,7 +2083,7 @@ dk4sto_set_eval_us(dk4_sto_t *st, dk4_fct_eval_us_t *f, int cr)
}
}
-#line 2118 "dk4sto.ctr"
+#line 2257 "dk4sto.ctr"
return back;
}
@@ -1993,7 +2095,11 @@ dk4sto_set_eval_i(dk4_sto_t *st, dk4_fct_eval_i_t *f, int cr)
int back = 0;
-#line 2128 "dk4sto.ctr"
+#line 2267 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2003,7 +2109,7 @@ dk4sto_set_eval_i(dk4_sto_t *st, dk4_fct_eval_i_t *f, int cr)
}
}
-#line 2136 "dk4sto.ctr"
+#line 2279 "dk4sto.ctr"
return back;
}
@@ -2015,7 +2121,11 @@ dk4sto_set_eval_ui(dk4_sto_t *st, dk4_fct_eval_ui_t *f, int cr)
int back = 0;
-#line 2146 "dk4sto.ctr"
+#line 2289 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2025,7 +2135,7 @@ dk4sto_set_eval_ui(dk4_sto_t *st, dk4_fct_eval_ui_t *f, int cr)
}
}
-#line 2154 "dk4sto.ctr"
+#line 2301 "dk4sto.ctr"
return back;
}
@@ -2037,7 +2147,11 @@ dk4sto_set_eval_l(dk4_sto_t *st, dk4_fct_eval_l_t *f, int cr)
int back = 0;
-#line 2164 "dk4sto.ctr"
+#line 2311 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2047,7 +2161,7 @@ dk4sto_set_eval_l(dk4_sto_t *st, dk4_fct_eval_l_t *f, int cr)
}
}
-#line 2172 "dk4sto.ctr"
+#line 2323 "dk4sto.ctr"
return back;
}
@@ -2059,7 +2173,11 @@ dk4sto_set_eval_ul(dk4_sto_t *st, dk4_fct_eval_ul_t *f, int cr)
int back = 0;
-#line 2182 "dk4sto.ctr"
+#line 2333 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2069,7 +2187,7 @@ dk4sto_set_eval_ul(dk4_sto_t *st, dk4_fct_eval_ul_t *f, int cr)
}
}
-#line 2190 "dk4sto.ctr"
+#line 2345 "dk4sto.ctr"
return back;
}
@@ -2081,7 +2199,11 @@ dk4sto_set_eval_f(dk4_sto_t *st, dk4_fct_eval_f_t *f, int cr)
int back = 0;
-#line 2200 "dk4sto.ctr"
+#line 2355 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2091,7 +2213,7 @@ dk4sto_set_eval_f(dk4_sto_t *st, dk4_fct_eval_f_t *f, int cr)
}
}
-#line 2208 "dk4sto.ctr"
+#line 2367 "dk4sto.ctr"
return back;
}
@@ -2103,7 +2225,11 @@ dk4sto_set_eval_d(dk4_sto_t *st, dk4_fct_eval_d_t *f, int cr)
int back = 0;
-#line 2218 "dk4sto.ctr"
+#line 2377 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2113,7 +2239,7 @@ dk4sto_set_eval_d(dk4_sto_t *st, dk4_fct_eval_d_t *f, int cr)
}
}
-#line 2226 "dk4sto.ctr"
+#line 2389 "dk4sto.ctr"
return back;
}
@@ -2125,7 +2251,11 @@ dk4sto_set_comp(dk4_sto_t *st, dk4_fct_comp_t *f, int cr)
int back = 0;
-#line 2236 "dk4sto.ctr"
+#line 2399 "dk4sto.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2135,7 +2265,7 @@ dk4sto_set_comp(dk4_sto_t *st, dk4_fct_comp_t *f, int cr)
}
}
-#line 2244 "dk4sto.ctr"
+#line 2411 "dk4sto.ctr"
return back;
}
@@ -2145,6 +2275,9 @@ int
dk4sto_use_trees(dk4_sto_t *st,int ok)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st) {
if(!(st->r)) {
st->t = (ok ? 1 : 0);
@@ -2156,9 +2289,12 @@ dk4sto_use_trees(dk4_sto_t *st,int ok)
void *
-dk4sto_find_root(dk4_sto_t *s)
+dk4sto_find_root(dk4_sto_t const *s)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != s);
+#endif
if(s) {
if(s->r) {
back = (s->r)->o;
@@ -2170,9 +2306,12 @@ dk4sto_find_root(dk4_sto_t *s)
void *
-dk4sto_it_find_parent(dk4_sto_it_t *i)
+dk4sto_it_find_parent(dk4_sto_it_t const *i)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+#endif
if(i) {
if(i->c) {
if((i->c)->p) {
@@ -2186,9 +2325,12 @@ dk4sto_it_find_parent(dk4_sto_it_t *i)
void *
-dk4sto_it_find_left(dk4_sto_it_t *i)
+dk4sto_it_find_left(dk4_sto_it_t const *i)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+#endif
if(i) {
if(i->c) {
if((i->c)->l) {
@@ -2202,9 +2344,12 @@ dk4sto_it_find_left(dk4_sto_it_t *i)
void *
-dk4sto_it_find_right(dk4_sto_it_t *i)
+dk4sto_it_find_right(dk4_sto_it_t const *i)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+#endif
if(i) {
if(i->c) {
if((i->c)->r) {
@@ -2218,9 +2363,12 @@ dk4sto_it_find_right(dk4_sto_it_t *i)
void *
-dk4sto_it_find_root(dk4_sto_it_t *i)
+dk4sto_it_find_root(dk4_sto_it_t const *i)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+#endif
if(i) {
if(i->s) {
back = dk4sto_find_root(i->s);
diff --git a/support/dktools/dk4sto.ctr b/support/dktools/dk4sto.ctr
index 1ba6b42b34..d3d15da464 100644
--- a/support/dktools/dk4sto.ctr
+++ b/support/dktools/dk4sto.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -49,11 +61,11 @@ typedef union {
This structure is used internally by the dksto module.
*/
struct dk4__sto__node {
- dk4_object_eval_res_t v; /**< Object evaluation of @a o. */
struct dk4__sto__node *p; /**< Parent node in tree. */
struct dk4__sto__node *l; /**< Left child (tree) or neighbour (list). */
struct dk4__sto__node *r; /**< Right child (tree) or neighbour (list). */
void *o; /**< Object to store. */
+ dk4_object_eval_res_t v; /**< Object evaluation of @a o. */
short b; /**< Balance flag (used in tree only). */
short w; /**< Direction to walk. */
};
@@ -209,6 +221,9 @@ void
dk4sto_remove_all(dk4_sto_t *st);
/** Remove one pointer from storage.
+ <b>Warning:</b> Do not use dk4sto_it_next() on any iterator
+ of the storage after removing data from a storage.
+ Reset the iterator!
@param st Storage.
@param o Object pointer to remove.
@param erp Error report, may be NULL.
@@ -409,7 +424,7 @@ dk4sto_use_trees(dk4_sto_t *st,int ok);
@param s Storage.
*/
void *
-dk4sto_find_root(dk4_sto_t *s);
+dk4sto_find_root(dk4_sto_t const *s);
/** Find object pointer for the parent node
of the last found object.
@@ -417,27 +432,27 @@ dk4sto_find_root(dk4_sto_t *s);
@return Object pointer on success, NULL on error.
*/
void *
-dk4sto_it_find_parent(dk4_sto_it_t *i);
+dk4sto_it_find_parent(dk4_sto_it_t const *i);
/** Find object pointer for node on left child of the last found object.
@param i Iterator.
@return Object pointer on success, NULL on error.
*/
void *
-dk4sto_it_find_left(dk4_sto_it_t *i);
+dk4sto_it_find_left(dk4_sto_it_t const *i);
/** Find object pointer for node on right child of the last found object.
@param i Iterator.
@return Object pointer on success, NULL on error.
*/
void *
-dk4sto_it_find_right(dk4_sto_it_t *i);
+dk4sto_it_find_right(dk4_sto_it_t const *i);
/** Find object pointer at the trees root.
@param i Iterator.
*/
void *
-dk4sto_it_find_root(dk4_sto_it_t *i);
+dk4sto_it_find_root(dk4_sto_it_t const *i);
@@ -449,6 +464,15 @@ dk4sto_it_find_root(dk4_sto_it_t *i);
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4sto.h"
#include "dk4mem.h"
@@ -459,6 +483,12 @@ dk4sto_it_find_root(dk4_sto_it_t *i);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$(trace-include)
@@ -570,6 +600,15 @@ dk4sto_node_compare(
{
int back = 0;
$? "+ dk4sto_node_compare PTR=%d PTR=%d PTR=%d %d", TR_IPTR(l), TR_IPTR(r), TR_IPTR(s), c
+ /* Static code analysis: Result of operation is garbage or undefined.
+ Clang static code analysis complains the right operand in comparisons
+ (r->v).xxx could be garbage.
+ I think this is not correct.
+ It assumes the default branch is taken in dk4sto_node_init_for_object()
+ as s->h does not match any of the case values.
+ The same case values are are used here, and there is no change
+ of s->h meanwhile.
+ */
switch(s->h) {
case DK4STO_COMPARE_FCT: { $? ". compare by function"
back = (*((s->e).comp))((void *)(l->o),(void *)(r->o),c);
@@ -855,6 +894,7 @@ dk4sto_left_deleted(dk4_sto_node_t *p, short *h)
$? "+ dk4sto_left_deleted PTR=%d PTR=%d", TR_IPTR(p), TR_IPTR(h)
switch(p->b) {
case 0: *h = - *h;
+ /* fall-through */
case 3:
$? ". going to increment balance field of PTR=%d", TR_IPTR(p)
dk4sto_inc_balance(p);
@@ -899,6 +939,7 @@ dk4sto_right_deleted(dk4_sto_node_t *p, short *h)
$? "+ dk4sto_right_deleted PTR=%d PTR=%d", TR_IPTR(p), TR_IPTR(h)
switch(p->b) {
case 0: *h = - *h;
+ /* fall-through */
case 1: dk4sto_dec_balance(p);
break;
case 3: {
@@ -953,6 +994,10 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
The final new node has an empty "w" field.
*/
while(p) {
+ /*
+ q is either NULL (in first pass) or the parent
+ of the current node in p.
+ */
if(p->b) {
s = q; r = p;
}
@@ -965,8 +1010,13 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
p = p->r;
}
}
+ /*
+ q is either NULL or the last node visited.
+ r is the last unbalanced node (critical node).
+ s is either NULL or the parent of the last unbalanced node.
+ */
p = newnode;
- if(!back) {
+ if(NULL == back) {
/*
When inserting into an empty tree we are done here.
*/
@@ -983,10 +1033,10 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
q->r = p;
q->w = DK4STO_WALK_RIGHT;
}
+ p->p = q;
/*
Now we must balance the tree again if necessary.
*/
- p->p = q;
if(r) {
/*
There is a critical node.
@@ -1017,6 +1067,16 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
p->b = 0;
p = dk4sto_right_rotation(p);
} else {
+ /* Static code analyis: Potentially dereferencing NULL pointer.
+ I do not think so. We have to balance at p because the
+ left subtree is too deep. We did not add the new node to
+ the left childs left subtree, so we must have added it to the
+ left childs right subtree. So the left childs right child
+ can not be NULL.
+ */
+#if DK4_USE_ASSERT
+ assert (NULL != (p->l)->r);
+#endif
p->b = (((((p->l)->r)->b) == 3) ? 1 : 0);
(p->l)->b = (((((p->l)->r)->b) == 1) ? 3 : 0);
p->l = dk4sto_left_rotation(p->l);
@@ -1028,6 +1088,16 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
p->b = 0;
p = dk4sto_left_rotation(p);
} else {
+ /* Static code analyis: Potentially dereferencing NULL pointer.
+ I do not think so. We have to balance at p because the
+ right subtree is too deep. We did not add the new node to
+ the right childs right subtree, so we must have added it to the
+ right childs left subtree. So the right childs left child
+ can not be NULL.
+ */
+#if DK4_USE_ASSERT
+ assert(NULL != (p->r)->l);
+#endif
p->b = (((((p->r)->l)->b) == 1) ? 3 : 0);
(p->r)->b = (((((p->r)->l)->b) == 3) ? 1 : 0);
p->r = dk4sto_right_rotation(p->r);
@@ -1062,6 +1132,35 @@ dk4sto_avlt_add(dk4_sto_node_t *root, dk4_sto_node_t *newnode, dk4_sto_t *st)
+/** Find last node in a tree storage.
+ @param n Node to start search from.
+ @return Last node or NULL.
+*/
+static dk4_sto_node_t *
+dk4sto_tree_find_last_node(dk4_sto_node_t *n)
+{
+ dk4_sto_node_t *back = NULL;
+ dk4_sto_node_t *c; /* Current node. */
+ dk4_sto_node_t *p; /* Father of c. */
+ $? "+ sorted_find_last_node PTR=%d", TR_IPTR(n)
+ if(n->l) {
+ back = n->l;
+ while(back->r) { back = back->r; }
+ } else {
+ c = n; p = c->p;
+ while(p && (!back)) {
+ if((p->r) == c) {
+ back = p;
+ } else {
+ c = p; p = c->p;
+ }
+ }
+ } $? "- sorted_find_last_node PTR=%d", TR_IPTR(back)
+ return back;
+}
+
+
+
/** Remove storage node from tree storage.
@param root Root object.
@param node Node to remove.
@@ -1082,6 +1181,8 @@ dk4sto_avlt_delete(
dk4_sto_node_t *q = NULL; /* Father of p. */
dk4_sto_node_t *r = NULL; /* Critical node. */
dk4_sto_node_t *todel = NULL; /* Node to delete. */
+ dk4_sto_node_t *itn = NULL; /* Iterator node. */
+ dk4_sto_it_t *iterat = NULL; /* Iterator */
short x1 = 0; /* Balance value. */
short delroot = 0; /* Flag: Delete tree node. */
int can_continue = 1; /* Flag: Can continue. */
@@ -1097,6 +1198,17 @@ dk4sto_avlt_delete(
todel = todel->l;
while(todel->r) todel = todel->r;
dk4sto_node_data_copy(node,todel,st);
+ /*
+ 2019-03-24 Change iterators again.
+ */
+ itn = dk4sto_tree_find_last_node(todel);
+ iterat = (dk4_sto_it_t *)(st->i);
+ while(NULL != iterat) {
+ if ((iterat->c) == todel) {
+ iterat->c = itn;
+ }
+ iterat = iterat->r;
+ }
}
if(!(todel->p)) { $? ". deleting the root node"
delroot = 1;
@@ -1336,35 +1448,6 @@ dk4sto_tree_find_next_node(dk4_sto_node_t *n, dk4_sto_node_t *r)
-/** Find last node in a tree storage.
- @param n Node to start search from.
- @return Last node or NULL.
-*/
-static dk4_sto_node_t *
-dk4sto_tree_find_last_node(dk4_sto_node_t *n)
-{
- dk4_sto_node_t *back = NULL;
- dk4_sto_node_t *c; /* Current node. */
- dk4_sto_node_t *p; /* Father of c. */
- $? "+ sorted_find_last_node PTR=%d", TR_IPTR(n)
- if(n->l) {
- back = n->l;
- while(back->r) { back = back->r; }
- } else {
- c = n; p = c->p;
- while(p && (!back)) {
- if((p->r) == c) {
- back = p;
- } else {
- c = p; p = c->p;
- }
- }
- } $? "- sorted_find_last_node PTR=%d", TR_IPTR(back)
- return back;
-}
-
-
-
/** Find node for object in tree storage (exact search).
@param r Root node.
@param o Object to find node for.
@@ -1466,14 +1549,13 @@ dk4sto_list_find_like(
/** Find node for an object (exact search).
@param r Root node.
@param o Object.
- @param s Storage.
@return Pointer to the objects node or NULL.
*/
static dk4_sto_node_t *
-dk4sto_list_find_exact(dk4_sto_node_t *r, void const *o, dk4_sto_t *s)
+dk4sto_list_find_exact(dk4_sto_node_t *r, void const *o)
{
dk4_sto_node_t *back;
- $? "+ sorted_find_exact PTRS= %d %d %d", TR_IPTR(r), TR_IPTR(o), TR_IPTR(s)
+ $? "+ sorted_find_exact PTRS= %d %d", TR_IPTR(r), TR_IPTR(o)
back = dk4sto_unsorted_find_exact(r,o);
$? "- sorted_find_exact PTR=%d", TR_IPTR(back)
return back;
@@ -1585,18 +1667,12 @@ dk4sto_list_find_last_node(dk4_sto_node_t *n)
/** Remove storage node from list storage.
@param ro Root node.
@param n Node to remove.
- @param st Storage.
- @param sci ???
- @param toremove ???
*/
static dk4_sto_node_t *
-dk4sto_list_remove(
- dk4_sto_node_t *ro, dk4_sto_node_t *n, dk4_sto_t *st, int *sci,
- dk4_sto_node_t **toremove
-)
+dk4sto_list_remove(dk4_sto_node_t *ro, dk4_sto_node_t *n)
{
dk4_sto_node_t *back;
- $? "+ sorted_remove PTRS= %d %d %d", TR_IPTR(ro), TR_IPTR(n), TR_IPTR(st)
+ $? "+ sorted_remove PTRS= %d %d", TR_IPTR(ro), TR_IPTR(n)
back = dk4sto_unsorted_remove(ro,n);
$? "- sorted_remove PTR=%d", TR_IPTR(back)
return back;
@@ -1619,6 +1695,10 @@ dk4sto_traverse_iterators_for(void *it, void *o)
dk4_sto_node_t *back = NULL;
dk4_sto_it_t *c = NULL; /* Current node. */
$? "+ dk4sto_traverse_iterators_for PTR=%d PTR=%d", TR_IPTR(it), TR_IPTR(o)
+#if DK4_USE_ASSERT
+ assert(NULL != it);
+ assert(NULL != o);
+#endif
if(it) {
c = (dk4_sto_it_t *)it;
while(c && (!back)) {
@@ -1645,6 +1725,9 @@ dk4sto_find_last_node(dk4_sto_node_t *n, dk4_sto_t *st)
{
dk4_sto_node_t *back = NULL;
$? "+ dk4sto_find_last_node PTR=%d PTR=%d", TR_IPTR(n), TR_IPTR(st)
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st->h) {
if(st->t) {
back = dk4sto_tree_find_last_node(n);
@@ -1671,6 +1754,9 @@ dk4sto_storage_init(dk4_sto_t *st, dk4_er_t *erp)
int back = 0;
short l = 0; /* Critical path length. */
$? "+ dk4sto_storage_init PTR=%d", TR_IPTR(st)
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
/* delpath begin address and length */
st->d = NULL; st->l = 0;
/* root node */
@@ -1699,6 +1785,9 @@ static void
dk4sto_storage_end(dk4_sto_t *st)
{
$? "+ dk4sto_storage_end PTR=%d", TR_IPTR(st)
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
/* release iterators */
{
dk4_sto_it_t *c = NULL; /* Current iterator. */
@@ -1777,6 +1866,9 @@ void
dk4sto_close(dk4_sto_t *st)
{
$? "+ dk4sto_close PTR=%d", TR_IPTR(st)
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st) {
dk4sto_storage_end(st);
dk4mem_free(st) ;
@@ -1788,6 +1880,9 @@ dk4sto_close(dk4_sto_t *st)
void
dk4sto_remove_all(dk4_sto_t *st)
{
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st) {
/* reset all iterators */
dk4_sto_it_t *c = NULL; /* Curent iterator. */
@@ -1824,14 +1919,18 @@ dk4sto_remove(dk4_sto_t *st, void *o, dk4_er_t *erp)
dk4_sto_node_t *ln = NULL; /* Last node. */
dk4_sto_it_t *iterator = NULL; /* Traverse all iterators. */
$? "+ dk4sto_remove PTR=%d PTR=%d", TR_IPTR(st), TR_IPTR(o)
- if(st && o) {
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != o);
+#endif
+ if((NULL != st) && (NULL != o)) {
node_to_remove = dk4sto_traverse_iterators_for(st->i, o);
if(!node_to_remove) {
if(st->h) {
if(st->t) {
node_to_remove = dk4sto_tree_find_exact(st->r,o,st);
} else {
- node_to_remove = dk4sto_list_find_exact(st->r,o,st);
+ node_to_remove = dk4sto_list_find_exact(st->r,o);
}
} else {
node_to_remove = dk4sto_unsorted_find_exact(st->r,o);
@@ -1853,7 +1952,7 @@ dk4sto_remove(dk4_sto_t *st, void *o, dk4_er_t *erp)
dk4sto_tree_remove(st->r,node_to_remove,st,&back,&node_to_remove);
} else {
st->r =
- dk4sto_list_remove(st->r,node_to_remove,st,&back,&node_to_remove);
+ dk4sto_list_remove(st->r,node_to_remove);
}
} else {
st->r = dk4sto_unsorted_remove(st->r,node_to_remove);
@@ -1878,7 +1977,11 @@ dk4sto_add(dk4_sto_t *st, void *o, dk4_er_t *erp)
int back = 0;
dk4_sto_node_t *n = NULL; /* New node. */
$? "+ dk4sto_add st=PTR:%d o=PTR:%d", TR_IPTR(st), TR_IPTR(o)
- if(st && o) {
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != o);
+#endif
+ if((NULL != st) && (NULL != o)) {
n = dk4mem_new(dk4_sto_node_t,1,erp);
if(n) {
dk4sto_node_init_for_object(n,o,st,st->c);
@@ -1906,6 +2009,9 @@ dk4sto_it_open(dk4_sto_t *st, dk4_er_t *erp)
{
dk4_sto_it_t *back = NULL;
$? "+ dk4sto_it_open PTR=%d", TR_IPTR(st)
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st) {
back = dk4mem_new(dk4_sto_it_t,1,erp);
if(back) {
@@ -1930,6 +2036,9 @@ dk4sto_it_close(dk4_sto_it_t *it)
dk4_sto_it_t *r = NULL; /* Right iterator. */
dk4_sto_t *s = NULL; /* The storage. */
$? "+ dk4sto_it_close PTR=%d", TR_IPTR(it)
+#if DK4_USE_ASSERT
+ assert(NULL != it);
+#endif
if(it) {
s = it->s;
l = it->l;
@@ -1955,6 +2064,9 @@ void
dk4sto_it_reset(dk4_sto_it_t *it)
{
$? "+ dk4sto_it_reset PTR=%d", TR_IPTR(it)
+#if DK4_USE_ASSERT
+ assert(NULL != it);
+#endif
if(it) {
it->c = NULL;
} $? "- dk4sto_it_reset"
@@ -1967,6 +2079,9 @@ dk4sto_it_next(dk4_sto_it_t *it)
{
void *back = NULL;
$? "+ dk4sto_it_next PTR=%d", TR_IPTR(it)
+#if DK4_USE_ASSERT
+ assert(NULL != it);
+#endif
if(it) {
if(it->s) {
if((it->s)->h) {
@@ -1993,13 +2108,17 @@ dk4sto_it_find_exact(dk4_sto_it_t *i, void const *o)
{
void *back = NULL;
$? "+ dk4sto_it_find_exact i=PTR:%d o=PTR:%d", TR_IPTR(i), TR_IPTR(o)
- if(i && o) {
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+ assert(NULL != o);
+#endif
+ if((NULL != i) && (NULL != o)) {
if(i->s) {
if((i->s)->h) {
if((i->s)->t) {
i->c = dk4sto_tree_find_exact((i->s)->r, o, i->s);
} else {
- i->c = dk4sto_list_find_exact((i->s)->r, o, i->s);
+ i->c = dk4sto_list_find_exact((i->s)->r, o);
}
} else {
i->c = dk4sto_unsorted_find_exact((i->s)->r, o);
@@ -2021,7 +2140,11 @@ dk4sto_it_find_like(dk4_sto_it_t *i, void const *o, int cr)
dk4_sto_node_t testnode; /* Test node for comparisons. */
dk4_sto_node_t *candidate = NULL; /* Candicate node. */
$? "+ dk4sto_it_find_like i=PTR:%d o=PTR:%d %d", TR_IPTR(i), TR_IPTR(o), cr
- if(i && o) {
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+ assert(NULL != o);
+#endif
+ if((NULL != i) && (NULL != o)) {
if(i->s) {
candidate = NULL;
if((i->s)->h) {
@@ -2053,6 +2176,10 @@ dk4sto_set_eval_c(dk4_sto_t *st, dk4_fct_eval_c_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_c st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2071,6 +2198,10 @@ dk4sto_set_eval_uc(dk4_sto_t *st, dk4_fct_eval_uc_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_uc st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2089,6 +2220,10 @@ dk4sto_set_eval_s(dk4_sto_t *st, dk4_fct_eval_s_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_s st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2107,6 +2242,10 @@ dk4sto_set_eval_us(dk4_sto_t *st, dk4_fct_eval_us_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_us %s %s %d", TR_PTR(st), TR_PTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2125,6 +2264,10 @@ dk4sto_set_eval_i(dk4_sto_t *st, dk4_fct_eval_i_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_i st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2143,6 +2286,10 @@ dk4sto_set_eval_ui(dk4_sto_t *st, dk4_fct_eval_ui_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_ui st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2161,6 +2308,10 @@ dk4sto_set_eval_l(dk4_sto_t *st, dk4_fct_eval_l_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_l st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2179,6 +2330,10 @@ dk4sto_set_eval_ul(dk4_sto_t *st, dk4_fct_eval_ul_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_ul st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2197,6 +2352,10 @@ dk4sto_set_eval_f(dk4_sto_t *st, dk4_fct_eval_f_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_f st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2215,6 +2374,10 @@ dk4sto_set_eval_d(dk4_sto_t *st, dk4_fct_eval_d_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_d st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2233,6 +2396,10 @@ dk4sto_set_comp(dk4_sto_t *st, dk4_fct_comp_t *f, int cr)
{
int back = 0;
$? "+ dk4sto_set_eval_d st=PTR:%d f=PTR:%d %d", TR_IPTR(st), TR_IPTR(f), cr
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+ assert(NULL != f);
+#endif
if(st) {
if(!(st->r)) {
back = 1;
@@ -2250,6 +2417,9 @@ int
dk4sto_use_trees(dk4_sto_t *st,int ok)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != st);
+#endif
if(st) {
if(!(st->r)) {
st->t = (ok ? 1 : 0);
@@ -2261,9 +2431,12 @@ dk4sto_use_trees(dk4_sto_t *st,int ok)
void *
-dk4sto_find_root(dk4_sto_t *s)
+dk4sto_find_root(dk4_sto_t const *s)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != s);
+#endif
if(s) {
if(s->r) {
back = (s->r)->o;
@@ -2275,9 +2448,12 @@ dk4sto_find_root(dk4_sto_t *s)
void *
-dk4sto_it_find_parent(dk4_sto_it_t *i)
+dk4sto_it_find_parent(dk4_sto_it_t const *i)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+#endif
if(i) {
if(i->c) {
if((i->c)->p) {
@@ -2291,9 +2467,12 @@ dk4sto_it_find_parent(dk4_sto_it_t *i)
void *
-dk4sto_it_find_left(dk4_sto_it_t *i)
+dk4sto_it_find_left(dk4_sto_it_t const *i)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+#endif
if(i) {
if(i->c) {
if((i->c)->l) {
@@ -2307,9 +2486,12 @@ dk4sto_it_find_left(dk4_sto_it_t *i)
void *
-dk4sto_it_find_right(dk4_sto_it_t *i)
+dk4sto_it_find_right(dk4_sto_it_t const *i)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+#endif
if(i) {
if(i->c) {
if((i->c)->r) {
@@ -2323,9 +2505,12 @@ dk4sto_it_find_right(dk4_sto_it_t *i)
void *
-dk4sto_it_find_root(dk4_sto_it_t *i)
+dk4sto_it_find_root(dk4_sto_it_t const *i)
{
void *back = NULL;
+#if DK4_USE_ASSERT
+ assert(NULL != i);
+#endif
if(i) {
if(i->s) {
back = dk4sto_find_root(i->s);
diff --git a/support/dktools/dk4sto.h b/support/dktools/dk4sto.h
index 392ae59210..bd966ced48 100644
--- a/support/dktools/dk4sto.h
+++ b/support/dktools/dk4sto.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4sto.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4sto.ctr
*/
#ifndef DK4STO_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -81,11 +71,11 @@ typedef union {
This structure is used internally by the dksto module.
*/
struct dk4__sto__node {
- dk4_object_eval_res_t v; /**< Object evaluation of @a o. */
struct dk4__sto__node *p; /**< Parent node in tree. */
struct dk4__sto__node *l; /**< Left child (tree) or neighbour (list). */
struct dk4__sto__node *r; /**< Right child (tree) or neighbour (list). */
void *o; /**< Object to store. */
+ dk4_object_eval_res_t v; /**< Object evaluation of @a o. */
short b; /**< Balance flag (used in tree only). */
short w; /**< Direction to walk. */
};
@@ -241,6 +231,9 @@ void
dk4sto_remove_all(dk4_sto_t *st);
/** Remove one pointer from storage.
+ <b>Warning:</b> Do not use dk4sto_it_next() on any iterator
+ of the storage after removing data from a storage.
+ Reset the iterator!
@param st Storage.
@param o Object pointer to remove.
@param erp Error report, may be NULL.
@@ -441,7 +434,7 @@ dk4sto_use_trees(dk4_sto_t *st,int ok);
@param s Storage.
*/
void *
-dk4sto_find_root(dk4_sto_t *s);
+dk4sto_find_root(dk4_sto_t const *s);
/** Find object pointer for the parent node
of the last found object.
@@ -449,27 +442,27 @@ dk4sto_find_root(dk4_sto_t *s);
@return Object pointer on success, NULL on error.
*/
void *
-dk4sto_it_find_parent(dk4_sto_it_t *i);
+dk4sto_it_find_parent(dk4_sto_it_t const *i);
/** Find object pointer for node on left child of the last found object.
@param i Iterator.
@return Object pointer on success, NULL on error.
*/
void *
-dk4sto_it_find_left(dk4_sto_it_t *i);
+dk4sto_it_find_left(dk4_sto_it_t const *i);
/** Find object pointer for node on right child of the last found object.
@param i Iterator.
@return Object pointer on success, NULL on error.
*/
void *
-dk4sto_it_find_right(dk4_sto_it_t *i);
+dk4sto_it_find_right(dk4_sto_it_t const *i);
/** Find object pointer at the trees root.
@param i Iterator.
*/
void *
-dk4sto_it_find_root(dk4_sto_it_t *i);
+dk4sto_it_find_root(dk4_sto_it_t const *i);
diff --git a/support/dktools/dk4str.c b/support/dktools/dk4str.c
index cace727448..68b92a785d 100644
--- a/support/dktools/dk4str.c
+++ b/support/dktools/dk4str.c
@@ -1,4 +1,9 @@
/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
diff --git a/support/dktools/dk4str8.c b/support/dktools/dk4str8.c
index a529edb081..ecad1ea5ae 100644
--- a/support/dktools/dk4str8.c
+++ b/support/dktools/dk4str8.c
@@ -1,46 +1,28 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4str8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4str8.ctr
*/
/** @file dk4str8.c The dk4str8 module.
*/
-#line 402 "dk4str8.ctr"
+#line 423 "dk4str8.ctr"
#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
@@ -64,6 +46,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
#ifndef DK4NUMCO_H_INCLUDED
#include "dk4numco.h"
#endif
@@ -79,7 +69,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 442 "dk4str8.ctr"
+#line 475 "dk4str8.ctr"
@@ -92,7 +82,7 @@ static const char * const dk4str8_modkw[] = {
NULL
-#line 454 "dk4str8.ctr"
+#line 487 "dk4str8.ctr"
};
@@ -141,14 +131,16 @@ static const char * const dk4str8_boolkw[] = {
NULL
-#line 485 "dk4str8.ctr"
+#line 518 "dk4str8.ctr"
};
+#if 0
/** Number of significant digits.
*/
static const int dk4str8_dbl_digits = DK4_DBL_DIGITS;
+#endif
void
@@ -156,6 +148,10 @@ dk4str8_cpy_to_left(char *dst, const char *src)
{
register char *dptr;
register const char *sptr;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+#endif
if (NULL != dst) {
*dst = '\0';
if (NULL != src) {
@@ -252,12 +248,20 @@ dk4str8_chr(const char *s, char c)
return back;
}
#else
+#ifdef __cplusplus
+ return ((char *)strchr(s, (int)((unsigned char)c)));
+#else
return (strchr(s, (int)((unsigned char)c)));
#endif
+#endif
/* --- Windows */
#else
/* +++ non-Windows */
+#ifdef __cplusplus
+ return ((char *)strchr(s, (int)((unsigned char)c)));
+#else
return (strchr(s, (int)((unsigned char)c)));
+#endif
/* --- non-Windows */
#endif
}
@@ -281,11 +285,19 @@ dk4str8_rchr(const char *s, char c)
return back;
}
#else
+#ifdef __cplusplus
+ return ((char *)strrchr(s, (int)((unsigned char)c)));
+#else
return (strrchr(s, (int)((unsigned char)c)));
#endif
+#endif
+#else
+#ifdef __cplusplus
+ return ((char *)strrchr(s, (int)((unsigned char)c)));
#else
return (strrchr(s, (int)((unsigned char)c)));
#endif
+#endif
}
@@ -294,6 +306,10 @@ int
dk4str8_cpy_s(char *dst, size_t sz, const char *src, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (0 < sz)) {
*dst = '\0';
if (NULL != src) {
@@ -303,9 +319,14 @@ dk4str8_cpy_s(char *dst, size_t sz, const char *src, dk4_er_t *erp)
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
(void)lstrcpyA(dst, (char *)src);
#else
-#pragma warning (disable:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4996 )
+#endif
(void)strcpy(dst, src);
-#pragma warning (default:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
+#endif
#endif
/* --- Windows */
#else
@@ -335,6 +356,10 @@ dk4str8_cat_s(char *dst, size_t sz, const char *src, dk4_er_t *erp)
size_t la;
size_t lb;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (0 < sz) && (NULL != src)) {
la = dk4str8_len(dst);
lb = dk4str8_len(src);
@@ -345,9 +370,14 @@ dk4str8_cat_s(char *dst, size_t sz, const char *src, dk4_er_t *erp)
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
(void)lstrcatA(dst, (char *)src);
#else
-#pragma warning (disable:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4996 )
+#endif
(void)strcat(dst, src);
-#pragma warning (default:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
+#endif
#endif
/* --- Windows */
#else
@@ -499,8 +529,7 @@ dk4str8_casecmp(const char *s1, const char *s2)
-#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
- || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
char *
dk4str8_dup(const char *src, dk4_er_t *erp)
@@ -510,7 +539,7 @@ dk4str8_dup(const char *src, dk4_er_t *erp)
if (NULL != src) {
lgt = dk4str8_len(src);
if (SIZE_MAX > lgt) {
- back = dk4mem_malloc_bytes((1+lgt), erp);
+ back = (char *)dk4mem_malloc_bytes((1+lgt), erp);
if (NULL != back) {
(void)dk4str8_cpy_s(back, (1+lgt), src, erp);
}
@@ -524,7 +553,6 @@ dk4str8_dup(const char *src, dk4_er_t *erp)
}
#endif
-/* if (defined(_WIN32) ... */
@@ -600,7 +628,10 @@ dk4str8_sep(char **stringp, const char *delim)
char *back = NULL;
-#line 942 "dk4str8.ctr"
+#line 1013 "dk4str8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != stringp);
+#endif
if (NULL != stringp) {
if (NULL != *stringp) {
if (NULL == delim) { delim = dk4str8_modkw[0]; }
@@ -613,7 +644,7 @@ dk4str8_sep(char **stringp, const char *delim)
}
}
-#line 953 "dk4str8.ctr"
+#line 1027 "dk4str8.ctr"
return back;
}
@@ -627,6 +658,10 @@ dk4str8_tokenize(
char *context;
char *token;
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dpp);
+ assert(0 < szdpp);
+#endif
if ((NULL != dpp) && (0 < szdpp) && (NULL != src)) {
if (NULL == delim) { delim = dk4str8_modkw[0]; }
context = src;
@@ -656,7 +691,6 @@ dk4str8_normalize(char *src, const char *delim)
char *p1; /* Pointer to traverse text. */
char *p2; /* Start of next token. */
int cc; /* Flag: Can continue. */
-
if (NULL != src) {
/*
Set up delimiter set, correct if necessary.
@@ -720,6 +754,9 @@ dk4str8_array_index(const char * const *arr, const char *str, int cs)
{
int back = -1;
int cand = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != arr);
+#endif
if ((NULL != arr) && (NULL != str)) {
while((NULL != *arr) && (-1 == back)) {
if (0 != cs) {
@@ -747,7 +784,10 @@ dk4str8_is_abbr(const char *str, const char *pattern, char spec, int cs)
char cp;
-#line 1085 "dk4str8.ctr"
+#line 1165 "dk4str8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pattern);
+#endif
if ((NULL != str) && (NULL != pattern)) {
lptr = str; pptr = pattern;
while (0 != cc) {
@@ -775,7 +815,7 @@ dk4str8_is_abbr(const char *str, const char *pattern, char spec, int cs)
}
}
-#line 1111 "dk4str8.ctr"
+#line 1194 "dk4str8.ctr"
return back;
}
@@ -788,7 +828,10 @@ dk4str8_abbr_index(const char * const *arr, char spec, const char *str, int cs)
int cand = 0;
-#line 1122 "dk4str8.ctr"
+#line 1205 "dk4str8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != arr);
+#endif
if ((NULL != arr) && (NULL != str)) {
while ((NULL != *arr) && (-1 == back)) {
if (0 != dk4str8_is_abbr(str, *arr, spec, cs)) {
@@ -799,7 +842,7 @@ dk4str8_abbr_index(const char * const *arr, char spec, const char *str, int cs)
}
-#line 1131 "dk4str8.ctr"
+#line 1217 "dk4str8.ctr"
return back;
}
@@ -825,7 +868,7 @@ dk4str8_is_on(const char *str)
int back = 0;
-#line 1155 "dk4str8.ctr"
+#line 1241 "dk4str8.ctr"
if (NULL != str) {
back = dk4str8_abbr_index(dk4str8_boolkw, '$', str, 0);
if (-1 < back) {
@@ -840,7 +883,7 @@ dk4str8_is_on(const char *str)
}
-#line 1168 "dk4str8.ctr"
+#line 1254 "dk4str8.ctr"
return back;
}
@@ -944,6 +987,10 @@ int
dk4str8_buffer_sanitize(char *str, size_t sz)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+ assert(0 < sz);
+#endif
if (NULL != str) {
if (0 < sz) {
back = dk4mem_reset_secure(str, sz, NULL);
@@ -961,7 +1008,7 @@ dk4str8_sanitize(char *str)
{
int back = 0;
if (NULL != str) {
- back = dk4str8_buffer_sanitize(str, strlen(str));
+ back = dk4str8_buffer_sanitize(str, dk4str8_len(str));
}
return back;
}
diff --git a/support/dktools/dk4str8.ctr b/support/dktools/dk4str8.ctr
index 8b5bcd1fa5..24c7889f80 100644
--- a/support/dktools/dk4str8.ctr
+++ b/support/dktools/dk4str8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -21,15 +21,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -42,7 +54,7 @@ extern "C" {
#endif
/** Copy string, check destination buffer size.
-
+
CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@@ -60,7 +72,7 @@ int
dk4str8_cpy_s(char *dst, size_t sz, const char *src, dk4_er_t *erp);
/** Concatenate strings, check destination buffer size.
-
+
CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@@ -86,7 +98,7 @@ dk4str8_cat_s(char *dst, size_t sz, const char *src, dk4_er_t *erp);
any error.
For normal string copy operations, use the dk4str8_cpy_s()
function instead.
-
+
CRT on Windows: Not used.
@param dst Destination buffer address.
@param src Source string.
@@ -95,7 +107,7 @@ void
dk4str8_cpy_to_left(char *dst, const char *src);
/** Find string length.
-
+
CRT on Windows: Optional.
@param src Source string.
@return String length.
@@ -145,7 +157,7 @@ int
dk4str8_pathcmp(const char *s1, const char *s2);
/** Find first occurance of character c in string s.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param s String to search for c.
@param c Character to find.
@@ -155,7 +167,7 @@ char *
dk4str8_chr(const char *s, char c);
/** Find last occurance of character c in string s.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param s String to search for c.
@param c Character to find.
@@ -165,7 +177,7 @@ char *
dk4str8_rchr(const char *s, char c);
/** Retrieve first token from *stringp.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param stringp Adress of string pointer.
@param delim String containing the delimiter set,
@@ -202,7 +214,7 @@ char *
dk4str8_next(char *src, const char *delim);
/** Split a string into tokens.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param dpp Pointer to string pointer array.
@param szdpp Size of destination string pointer array.
@@ -227,7 +239,7 @@ dk4str8_tokenize(
/** Normalize a string (remove leading and trailing delimiters,
replace delimiter sequences by just one delimiter).
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param src Buffer containing the string to normalize.
@param delim String containing delimiter characters,
@@ -237,7 +249,7 @@ void
dk4str8_normalize(char *src, const char *delim);
/** Find index of a string in an array of strings.
-
+
CRT on Windows: Optional.
@param arr Array of strings.
@param str String to find in array.
@@ -248,7 +260,7 @@ int
dk4str8_array_index(const char * const *arr, const char *str, int cs);
/** Find index of a string in an array of strings.
-
+
CRT on Windows: Optional, disabling CRT degrades performances
and reduces to upper-case conversion to characters 'a' to 'z'.
@param arr Array of string allowing abbreviations.
@@ -261,7 +273,7 @@ int
dk4str8_abbr_index(const char * const *arr, char spec, const char *str, int cs);
/** Check whether a text matches a pattern, the text may be abbreviated.
-
+
CRT on Windows: Optional, disabling CRT degrades performances
and reduces to upper-case conversion to characters 'a' to 'z'
in case-insensitive comparisons.
@@ -293,11 +305,10 @@ dk4str8_is_bool(const char *str);
int
dk4str8_is_on(const char *str);
-#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
- || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
/** Duplicate string in dynamically allocated memory.
-
+
CRT on Windows: Optional, disabling CRT reduces functionality
to strings with length fitting to int and overall size in
bytes - including finalizer - fitting into a DWORD.
@@ -318,7 +329,7 @@ char *
dk4str8_dup(const char *src, dk4_er_t *erp);
#endif
-/* if (defined(_WIN32) ... */
+
/** Remove trailing white spaces.
@@ -350,6 +361,8 @@ char
dk4str8_tolower(char c);
/** Remove trailing newline from line.
+
+ CRT on Windows: Not used.
@param lptr Line pointer.
*/
void
@@ -357,6 +370,8 @@ dk4str8_delnl(char *lptr);
/** Skip the first text words in a line, return pointer to start
of next word.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param line Line to process.
@param skip Number of words to skip.
@return Pointer to next word on success, NULL on error.
@@ -365,6 +380,8 @@ const char *
dk4str8_skip(const char *line, size_t skip);
/** Sanitize string (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize.
@return 1 on success, 0 on error.
*/
@@ -372,6 +389,8 @@ int
dk4str8_sanitize(char *str);
/** Sanitize string buffer (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string buffer.
@param sz Size of string buffer (number of elements).
@return 1 on success, 0 on error.
@@ -380,6 +399,8 @@ int
dk4str8_buffer_sanitize(char *str, size_t sz);
/** Sanitize dynamically allocated memory and release it.
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize and release.
@return 1 on success, 0 on error.
*/
@@ -402,6 +423,10 @@ do { if (NULL != p) { (void)dk4str8_free_sanitized(p); } p = NULL; } while (0)
#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
@@ -425,6 +450,14 @@ do { if (NULL != p) { (void)dk4str8_free_sanitized(p); } p = NULL; } while (0)
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
#ifndef DK4NUMCO_H_INCLUDED
#include "dk4numco.h"
#endif
@@ -486,9 +519,11 @@ $!end
+#if 0
/** Number of significant digits.
*/
static const int dk4str8_dbl_digits = DK4_DBL_DIGITS;
+#endif
void
@@ -496,6 +531,10 @@ dk4str8_cpy_to_left(char *dst, const char *src)
{
register char *dptr;
register const char *sptr;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+#endif
if (NULL != dst) {
*dst = '\0';
if (NULL != src) {
@@ -592,12 +631,20 @@ dk4str8_chr(const char *s, char c)
return back;
}
#else
+#ifdef __cplusplus
+ return ((char *)strchr(s, (int)((unsigned char)c)));
+#else
return (strchr(s, (int)((unsigned char)c)));
#endif
+#endif
/* --- Windows */
#else
/* +++ non-Windows */
+#ifdef __cplusplus
+ return ((char *)strchr(s, (int)((unsigned char)c)));
+#else
return (strchr(s, (int)((unsigned char)c)));
+#endif
/* --- non-Windows */
#endif
}
@@ -621,11 +668,19 @@ dk4str8_rchr(const char *s, char c)
return back;
}
#else
+#ifdef __cplusplus
+ return ((char *)strrchr(s, (int)((unsigned char)c)));
+#else
return (strrchr(s, (int)((unsigned char)c)));
#endif
+#endif
+#else
+#ifdef __cplusplus
+ return ((char *)strrchr(s, (int)((unsigned char)c)));
#else
return (strrchr(s, (int)((unsigned char)c)));
#endif
+#endif
}
@@ -634,6 +689,10 @@ int
dk4str8_cpy_s(char *dst, size_t sz, const char *src, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (0 < sz)) {
*dst = '\0';
if (NULL != src) {
@@ -643,9 +702,14 @@ dk4str8_cpy_s(char *dst, size_t sz, const char *src, dk4_er_t *erp)
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
(void)lstrcpyA(dst, (char *)src);
#else
-#pragma warning (disable:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4996 )
+#endif
(void)strcpy(dst, src);
-#pragma warning (default:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
+#endif
#endif
/* --- Windows */
#else
@@ -675,6 +739,10 @@ dk4str8_cat_s(char *dst, size_t sz, const char *src, dk4_er_t *erp)
size_t la;
size_t lb;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (0 < sz) && (NULL != src)) {
la = dk4str8_len(dst);
lb = dk4str8_len(src);
@@ -685,9 +753,14 @@ dk4str8_cat_s(char *dst, size_t sz, const char *src, dk4_er_t *erp)
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
(void)lstrcatA(dst, (char *)src);
#else
-#pragma warning (disable:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4996 )
+#endif
(void)strcat(dst, src);
-#pragma warning (default:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
+#endif
#endif
/* --- Windows */
#else
@@ -839,8 +912,7 @@ dk4str8_casecmp(const char *s1, const char *s2)
-#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
- || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
char *
dk4str8_dup(const char *src, dk4_er_t *erp)
@@ -850,7 +922,7 @@ dk4str8_dup(const char *src, dk4_er_t *erp)
if (NULL != src) {
lgt = dk4str8_len(src);
if (SIZE_MAX > lgt) {
- back = dk4mem_malloc_bytes((1+lgt), erp);
+ back = (char *)dk4mem_malloc_bytes((1+lgt), erp);
if (NULL != back) {
(void)dk4str8_cpy_s(back, (1+lgt), src, erp);
}
@@ -864,7 +936,6 @@ dk4str8_dup(const char *src, dk4_er_t *erp)
}
#endif
-/* if (defined(_WIN32) ... */
@@ -939,6 +1010,9 @@ dk4str8_sep(char **stringp, const char *delim)
{
char *back = NULL;
$? "+ dk4str8_sep \"%!8s\" \"%!8s\"", TR_8STR(*stringp), TR_8STR(delim)
+#if DK4_USE_ASSERT
+ assert(NULL != stringp);
+#endif
if (NULL != stringp) {
if (NULL != *stringp) {
if (NULL == delim) { delim = dk4str8_modkw[0]; }
@@ -963,6 +1037,10 @@ dk4str8_tokenize(
char *context;
char *token;
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dpp);
+ assert(0 < szdpp);
+#endif
if ((NULL != dpp) && (0 < szdpp) && (NULL != src)) {
if (NULL == delim) { delim = dk4str8_modkw[0]; }
context = src;
@@ -992,7 +1070,6 @@ dk4str8_normalize(char *src, const char *delim)
char *p1; /* Pointer to traverse text. */
char *p2; /* Start of next token. */
int cc; /* Flag: Can continue. */
-
if (NULL != src) {
/*
Set up delimiter set, correct if necessary.
@@ -1056,6 +1133,9 @@ dk4str8_array_index(const char * const *arr, const char *str, int cs)
{
int back = -1;
int cand = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != arr);
+#endif
if ((NULL != arr) && (NULL != str)) {
while((NULL != *arr) && (-1 == back)) {
if (0 != cs) {
@@ -1082,6 +1162,9 @@ dk4str8_is_abbr(const char *str, const char *pattern, char spec, int cs)
char cl;
char cp;
$? "+ dk4str8_is_abbr \"%!8s\" \"%!8s\" \"%!8c\"", pattern, str, spec
+#if DK4_USE_ASSERT
+ assert(NULL != pattern);
+#endif
if ((NULL != str) && (NULL != pattern)) {
lptr = str; pptr = pattern;
while (0 != cc) {
@@ -1119,6 +1202,9 @@ dk4str8_abbr_index(const char * const *arr, char spec, const char *str, int cs)
int back = -1;
int cand = 0;
$? "+ dk4str8_abbr_index"
+#if DK4_USE_ASSERT
+ assert(NULL != arr);
+#endif
if ((NULL != arr) && (NULL != str)) {
while ((NULL != *arr) && (-1 == back)) {
if (0 != dk4str8_is_abbr(str, *arr, spec, cs)) {
@@ -1268,6 +1354,10 @@ int
dk4str8_buffer_sanitize(char *str, size_t sz)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+ assert(0 < sz);
+#endif
if (NULL != str) {
if (0 < sz) {
back = dk4mem_reset_secure(str, sz, NULL);
@@ -1285,7 +1375,7 @@ dk4str8_sanitize(char *str)
{
int back = 0;
if (NULL != str) {
- back = dk4str8_buffer_sanitize(str, strlen(str));
+ back = dk4str8_buffer_sanitize(str, dk4str8_len(str));
}
return back;
}
diff --git a/support/dktools/dk4str8.h b/support/dktools/dk4str8.h
index 743db89c80..2fab36263f 100644
--- a/support/dktools/dk4str8.h
+++ b/support/dktools/dk4str8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4str8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4str8.ctr
*/
#ifndef DK4STR8_H_INCLUDED
@@ -53,15 +31,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -74,7 +64,7 @@ extern "C" {
#endif
/** Copy string, check destination buffer size.
-
+
CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@@ -92,7 +82,7 @@ int
dk4str8_cpy_s(char *dst, size_t sz, const char *src, dk4_er_t *erp);
/** Concatenate strings, check destination buffer size.
-
+
CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@@ -118,7 +108,7 @@ dk4str8_cat_s(char *dst, size_t sz, const char *src, dk4_er_t *erp);
any error.
For normal string copy operations, use the dk4str8_cpy_s()
function instead.
-
+
CRT on Windows: Not used.
@param dst Destination buffer address.
@param src Source string.
@@ -127,7 +117,7 @@ void
dk4str8_cpy_to_left(char *dst, const char *src);
/** Find string length.
-
+
CRT on Windows: Optional.
@param src Source string.
@return String length.
@@ -177,7 +167,7 @@ int
dk4str8_pathcmp(const char *s1, const char *s2);
/** Find first occurance of character c in string s.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param s String to search for c.
@param c Character to find.
@@ -187,7 +177,7 @@ char *
dk4str8_chr(const char *s, char c);
/** Find last occurance of character c in string s.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param s String to search for c.
@param c Character to find.
@@ -197,7 +187,7 @@ char *
dk4str8_rchr(const char *s, char c);
/** Retrieve first token from *stringp.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param stringp Adress of string pointer.
@param delim String containing the delimiter set,
@@ -234,7 +224,7 @@ char *
dk4str8_next(char *src, const char *delim);
/** Split a string into tokens.
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param dpp Pointer to string pointer array.
@param szdpp Size of destination string pointer array.
@@ -259,7 +249,7 @@ dk4str8_tokenize(
/** Normalize a string (remove leading and trailing delimiters,
replace delimiter sequences by just one delimiter).
-
+
CRT on Windows: Optional, disabling CRT degrades performance.
@param src Buffer containing the string to normalize.
@param delim String containing delimiter characters,
@@ -269,7 +259,7 @@ void
dk4str8_normalize(char *src, const char *delim);
/** Find index of a string in an array of strings.
-
+
CRT on Windows: Optional.
@param arr Array of strings.
@param str String to find in array.
@@ -280,7 +270,7 @@ int
dk4str8_array_index(const char * const *arr, const char *str, int cs);
/** Find index of a string in an array of strings.
-
+
CRT on Windows: Optional, disabling CRT degrades performances
and reduces to upper-case conversion to characters 'a' to 'z'.
@param arr Array of string allowing abbreviations.
@@ -293,7 +283,7 @@ int
dk4str8_abbr_index(const char * const *arr, char spec, const char *str, int cs);
/** Check whether a text matches a pattern, the text may be abbreviated.
-
+
CRT on Windows: Optional, disabling CRT degrades performances
and reduces to upper-case conversion to characters 'a' to 'z'
in case-insensitive comparisons.
@@ -325,11 +315,10 @@ dk4str8_is_bool(const char *str);
int
dk4str8_is_on(const char *str);
-#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
- || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
/** Duplicate string in dynamically allocated memory.
-
+
CRT on Windows: Optional, disabling CRT reduces functionality
to strings with length fitting to int and overall size in
bytes - including finalizer - fitting into a DWORD.
@@ -350,7 +339,7 @@ char *
dk4str8_dup(const char *src, dk4_er_t *erp);
#endif
-/* if (defined(_WIN32) ... */
+
/** Remove trailing white spaces.
@@ -382,6 +371,8 @@ char
dk4str8_tolower(char c);
/** Remove trailing newline from line.
+
+ CRT on Windows: Not used.
@param lptr Line pointer.
*/
void
@@ -389,6 +380,8 @@ dk4str8_delnl(char *lptr);
/** Skip the first text words in a line, return pointer to start
of next word.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param line Line to process.
@param skip Number of words to skip.
@return Pointer to next word on success, NULL on error.
@@ -397,6 +390,8 @@ const char *
dk4str8_skip(const char *line, size_t skip);
/** Sanitize string (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize.
@return 1 on success, 0 on error.
*/
@@ -404,6 +399,8 @@ int
dk4str8_sanitize(char *str);
/** Sanitize string buffer (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string buffer.
@param sz Size of string buffer (number of elements).
@return 1 on success, 0 on error.
@@ -412,6 +409,8 @@ int
dk4str8_buffer_sanitize(char *str, size_t sz);
/** Sanitize dynamically allocated memory and release it.
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize and release.
@return 1 on success, 0 on error.
*/
diff --git a/support/dktools/dk4strd.c b/support/dktools/dk4strd.c
index ef9984c65b..88f5e64678 100644
--- a/support/dktools/dk4strd.c
+++ b/support/dktools/dk4strd.c
@@ -1,45 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strd.ctr
*/
/** @file dk4strd.c The dk4strd module.
*/
-#line 333 "dk4strd.ctr"
+#line 405 "dk4strd.ctr"
+#include "dk4conf.h"
#include "dk4strd.h"
#if DK4_CHAR_SIZE > 1
diff --git a/support/dktools/dk4strd.ctr b/support/dktools/dk4strd.ctr
index d9bee9dab5..113c429f2f 100644
--- a/support/dktools/dk4strd.ctr
+++ b/support/dktools/dk4strd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,15 +13,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -29,6 +41,8 @@ extern "C" {
#endif
/** Copy string, check destination buffer size.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@param src Source string.
@@ -45,6 +59,8 @@ int
dk4str_cpy_s(dkChar *dst, size_t sz, const dkChar *src, dk4_er_t *erp);
/** Concatenate strings, check destination buffer size.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@param src Source string.
@@ -69,6 +85,8 @@ dk4str_cat_s(dkChar *dst, size_t sz, const dkChar *src, dk4_er_t *erp);
any error.
For normal string copy operations, use the dk4str_cpy_s()
function instead.
+
+ CRT on Windows: Not used.
@param dst Destination buffer address.
@param src Source string.
*/
@@ -76,6 +94,9 @@ void
dk4str_cpy_to_left(dkChar *dst, const dkChar *src);
/** Find string length.
+
+ CRT on Windows: Optional, disabling CRT reduces functionality
+ to strings with length fitting to int.
@param src Source string.
@return String length.
*/
@@ -83,6 +104,8 @@ size_t
dk4str_len(const dkChar *src);
/** Compare two strings.
+
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@return 1 if s1>s2, 0 if s1==s2, -1 if s1<s2.
@@ -91,6 +114,8 @@ int
dk4str_cmp(const dkChar *s1, const dkChar *s2);
/** Compare two strings.
+
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@param n Maximum number of characters to compare.
@@ -100,6 +125,8 @@ int
dk4str_ncmp(const dkChar *s1, const dkChar *s2, size_t n);
/** Compare two strings, case-insensitive comparison.
+
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@return 1 if s1>s2, 0 if s1==s2, -1 if s1<s2.
@@ -108,6 +135,8 @@ int
dk4str_casecmp(const dkChar *s1, const dkChar *s2);
/** Compare two file path names.
+
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@return 1 if s1>s2, 0 if s1==s2, -1 if s1<s2.
@@ -116,6 +145,8 @@ int
dk4str_pathcmp(const dkChar *s1, const dkChar *s2);
/** Find first occurance of character c in string s.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s String to search for c.
@param c Character to find.
@return Pointer to first occurance if found, NULL otherwise.
@@ -124,6 +155,8 @@ dkChar *
dk4str_chr(const dkChar *s, dkChar c);
/** Find last occurance of character c in string s.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s String to search for c.
@param c Character to find.
@return Pointer to last occurance if found, NULL otherwise.
@@ -132,6 +165,8 @@ dkChar *
dk4str_rchr(const dkChar *s, dkChar c);
/** Retrieve first token from *stringp.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param stringp Adress of string pointer.
@param delim String containing the delimiter set,
my be NULL to use the default delimiter
@@ -143,6 +178,8 @@ dkChar *
dk4str_sep(dkChar **stringp, const dkChar *delim);
/** Find first token in string.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param src String to search for tokens.
@param delim String containing the delimiter characters,
may be NULL to use the default delimiter set.
@@ -152,6 +189,8 @@ dkChar *
dk4str_start(const dkChar *src, const dkChar *delim);
/** Cut string after first token, find start of second token in string.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param src String to search for tokens,
normally the result of dk4str_start() or a
previous dk4str_next() call.
@@ -163,6 +202,8 @@ dkChar *
dk4str_next(dkChar *src, const dkChar *delim);
/** Split a string into tokens.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param dpp Pointer to string pointer array.
@param szdpp Size of destination string pointer array.
@param src Source string to process.
@@ -186,6 +227,8 @@ dk4str_tokenize(
/** Normalize a string (remove leading and trailing delimiters,
replace delimiter sequences by just one delimiter).
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param src Buffer containing the string to normalize.
@param delim String containing delimiter characters,
may be NULL to use the default delimiter set.
@@ -194,6 +237,8 @@ void
dk4str_normalize(dkChar *src, const dkChar *delim);
/** Find index of a string in an array of strings.
+
+ CRT on Windows: Optional.
@param arr Array of strings.
@param str String to find in array.
@param cs Flag: Case-sensitive search (0=no, other=yes).
@@ -203,6 +248,9 @@ int
dk4str_array_index(const dkChar * const *arr, const dkChar *str, int cs);
/** Find index of a string in an array of strings.
+
+ CRT on Windows: Optional, disabling CRT degrades performance
+ for case-insensitive comparisons.
@param arr Array of strings allowing abbreviation.
@param spec Special character indicating start of optional text.
@param str String to find in array.
@@ -218,6 +266,9 @@ dk4str_abbr_index(
);
/** Check whether a text matches a pattern, the text may be abbreviated.
+
+ CRT on windows: Optional, disabling CRT degrades performance
+ for case-insensitive comparisons.
@param str Text to check.
@param pattern Pattern for comparison.
@param spec Special character marking the abbreviation in the
@@ -236,6 +287,8 @@ int
dk4str_is_bool(const dkChar *str);
/** Check whether a string represents the boolean value TRUE.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param str String to check.
@return 1 if str represents the boolean value TRUE, 0 otherwise.
*/
@@ -246,6 +299,9 @@ dk4str_is_on(const dkChar *str);
|| (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
/** Duplicate string in dynamically allocated memory.
+
+ CRT on Windows: Optional, disabling CRT reduces functionality
+ to strings with length fitting to int and overall size in
@param src String to duplicate.
@param erp Error report, may be NULL.
@return Pointer to string in new memory on succes, NULL on error.
@@ -266,6 +322,8 @@ dk4str_dup(const dkChar *src, dk4_er_t *erp);
/* if (defined(_WIN32) ... */
/** Remove trailing white spaces.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param str String to remove white spaces from.
@param whsp White spaces set.
*/
@@ -273,6 +331,8 @@ void
dk4str_rtwh(dkChar *str, const dkChar *whsp);
/** Remove trailing newline from line.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param lptr Line pointer.
*/
void
@@ -280,6 +340,8 @@ dk4str_delnl(dkChar *lptr);
/** Skip the first text words in a line, return pointer to start
of next word.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param line Line to process.
@param skip Number of words to skip.
@return Pointer to next word on success, NULL on error.
@@ -289,6 +351,8 @@ dk4str_skip(const dkChar *line, size_t skip);
/** Sanitize string (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize.
@return 1 on success, 0 on error.
*/
@@ -296,6 +360,8 @@ int
dk4str_sanitize(dkChar *str);
/** Sanitize string buffer (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string buffer.
@param sz Size of string buffer (number of dkChar).
@return 1 on success, 0 on error.
@@ -304,6 +370,8 @@ int
dk4str_buffer_sanitize(dkChar *str, size_t sz);
/** Sanitize dynamically allocated memory and release it.
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize and release.
@return 1 on success, 0 on error.
*/
@@ -317,12 +385,16 @@ dk4str_free_sanitized(dkChar *str);
#if DK4_CHAR_SIZE > 1
/** Sanitize string and release it, set pointer to NULL.
+
+ CRT on Windows: Optional.
@param p Pointer to string to release.
*/
#define dk4str_release_sanitized(p) \
do { if (NULL != p) { (void)dk4strw_free_sanitized(p); } p = NULL; } while (0)
#else
/** Sanitize string and release it, set pointer to NULL.
+
+ CRT on Windows: Optional.
@param p Pointer to string to release.
*/
#define dk4str_release_sanitized(p) \
@@ -332,6 +404,7 @@ do { if (NULL != p) { (void)dk4str8_free_sanitized(p); } p = NULL; } while (0)
%% module
+#include "dk4conf.h"
#include "dk4strd.h"
#if DK4_CHAR_SIZE > 1
diff --git a/support/dktools/dk4strd.h b/support/dktools/dk4strd.h
index 7ff914675c..ca380d2515 100644
--- a/support/dktools/dk4strd.h
+++ b/support/dktools/dk4strd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strd.ctr
*/
#ifndef DK4STRD_H_INCLUDED
@@ -45,15 +23,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -61,6 +51,8 @@ extern "C" {
#endif
/** Copy string, check destination buffer size.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@param src Source string.
@@ -77,6 +69,8 @@ int
dk4str_cpy_s(dkChar *dst, size_t sz, const dkChar *src, dk4_er_t *erp);
/** Concatenate strings, check destination buffer size.
+
+ CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@param src Source string.
@@ -101,6 +95,8 @@ dk4str_cat_s(dkChar *dst, size_t sz, const dkChar *src, dk4_er_t *erp);
any error.
For normal string copy operations, use the dk4str_cpy_s()
function instead.
+
+ CRT on Windows: Not used.
@param dst Destination buffer address.
@param src Source string.
*/
@@ -108,6 +104,9 @@ void
dk4str_cpy_to_left(dkChar *dst, const dkChar *src);
/** Find string length.
+
+ CRT on Windows: Optional, disabling CRT reduces functionality
+ to strings with length fitting to int.
@param src Source string.
@return String length.
*/
@@ -115,6 +114,8 @@ size_t
dk4str_len(const dkChar *src);
/** Compare two strings.
+
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@return 1 if s1>s2, 0 if s1==s2, -1 if s1<s2.
@@ -123,6 +124,8 @@ int
dk4str_cmp(const dkChar *s1, const dkChar *s2);
/** Compare two strings.
+
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@param n Maximum number of characters to compare.
@@ -132,6 +135,8 @@ int
dk4str_ncmp(const dkChar *s1, const dkChar *s2, size_t n);
/** Compare two strings, case-insensitive comparison.
+
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@return 1 if s1>s2, 0 if s1==s2, -1 if s1<s2.
@@ -140,6 +145,8 @@ int
dk4str_casecmp(const dkChar *s1, const dkChar *s2);
/** Compare two file path names.
+
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@return 1 if s1>s2, 0 if s1==s2, -1 if s1<s2.
@@ -148,6 +155,8 @@ int
dk4str_pathcmp(const dkChar *s1, const dkChar *s2);
/** Find first occurance of character c in string s.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s String to search for c.
@param c Character to find.
@return Pointer to first occurance if found, NULL otherwise.
@@ -156,6 +165,8 @@ dkChar *
dk4str_chr(const dkChar *s, dkChar c);
/** Find last occurance of character c in string s.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param s String to search for c.
@param c Character to find.
@return Pointer to last occurance if found, NULL otherwise.
@@ -164,6 +175,8 @@ dkChar *
dk4str_rchr(const dkChar *s, dkChar c);
/** Retrieve first token from *stringp.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param stringp Adress of string pointer.
@param delim String containing the delimiter set,
my be NULL to use the default delimiter
@@ -175,6 +188,8 @@ dkChar *
dk4str_sep(dkChar **stringp, const dkChar *delim);
/** Find first token in string.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param src String to search for tokens.
@param delim String containing the delimiter characters,
may be NULL to use the default delimiter set.
@@ -184,6 +199,8 @@ dkChar *
dk4str_start(const dkChar *src, const dkChar *delim);
/** Cut string after first token, find start of second token in string.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param src String to search for tokens,
normally the result of dk4str_start() or a
previous dk4str_next() call.
@@ -195,6 +212,8 @@ dkChar *
dk4str_next(dkChar *src, const dkChar *delim);
/** Split a string into tokens.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param dpp Pointer to string pointer array.
@param szdpp Size of destination string pointer array.
@param src Source string to process.
@@ -218,6 +237,8 @@ dk4str_tokenize(
/** Normalize a string (remove leading and trailing delimiters,
replace delimiter sequences by just one delimiter).
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param src Buffer containing the string to normalize.
@param delim String containing delimiter characters,
may be NULL to use the default delimiter set.
@@ -226,6 +247,8 @@ void
dk4str_normalize(dkChar *src, const dkChar *delim);
/** Find index of a string in an array of strings.
+
+ CRT on Windows: Optional.
@param arr Array of strings.
@param str String to find in array.
@param cs Flag: Case-sensitive search (0=no, other=yes).
@@ -235,6 +258,9 @@ int
dk4str_array_index(const dkChar * const *arr, const dkChar *str, int cs);
/** Find index of a string in an array of strings.
+
+ CRT on Windows: Optional, disabling CRT degrades performance
+ for case-insensitive comparisons.
@param arr Array of strings allowing abbreviation.
@param spec Special character indicating start of optional text.
@param str String to find in array.
@@ -250,6 +276,9 @@ dk4str_abbr_index(
);
/** Check whether a text matches a pattern, the text may be abbreviated.
+
+ CRT on windows: Optional, disabling CRT degrades performance
+ for case-insensitive comparisons.
@param str Text to check.
@param pattern Pattern for comparison.
@param spec Special character marking the abbreviation in the
@@ -268,6 +297,8 @@ int
dk4str_is_bool(const dkChar *str);
/** Check whether a string represents the boolean value TRUE.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param str String to check.
@return 1 if str represents the boolean value TRUE, 0 otherwise.
*/
@@ -278,6 +309,9 @@ dk4str_is_on(const dkChar *str);
|| (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
/** Duplicate string in dynamically allocated memory.
+
+ CRT on Windows: Optional, disabling CRT reduces functionality
+ to strings with length fitting to int and overall size in
@param src String to duplicate.
@param erp Error report, may be NULL.
@return Pointer to string in new memory on succes, NULL on error.
@@ -298,6 +332,8 @@ dk4str_dup(const dkChar *src, dk4_er_t *erp);
/* if (defined(_WIN32) ... */
/** Remove trailing white spaces.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param str String to remove white spaces from.
@param whsp White spaces set.
*/
@@ -305,6 +341,8 @@ void
dk4str_rtwh(dkChar *str, const dkChar *whsp);
/** Remove trailing newline from line.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param lptr Line pointer.
*/
void
@@ -312,6 +350,8 @@ dk4str_delnl(dkChar *lptr);
/** Skip the first text words in a line, return pointer to start
of next word.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param line Line to process.
@param skip Number of words to skip.
@return Pointer to next word on success, NULL on error.
@@ -321,6 +361,8 @@ dk4str_skip(const dkChar *line, size_t skip);
/** Sanitize string (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize.
@return 1 on success, 0 on error.
*/
@@ -328,6 +370,8 @@ int
dk4str_sanitize(dkChar *str);
/** Sanitize string buffer (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string buffer.
@param sz Size of string buffer (number of dkChar).
@return 1 on success, 0 on error.
@@ -336,6 +380,8 @@ int
dk4str_buffer_sanitize(dkChar *str, size_t sz);
/** Sanitize dynamically allocated memory and release it.
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize and release.
@return 1 on success, 0 on error.
*/
@@ -349,12 +395,16 @@ dk4str_free_sanitized(dkChar *str);
#if DK4_CHAR_SIZE > 1
/** Sanitize string and release it, set pointer to NULL.
+
+ CRT on Windows: Optional.
@param p Pointer to string to release.
*/
#define dk4str_release_sanitized(p) \
do { if (NULL != p) { (void)dk4strw_free_sanitized(p); } p = NULL; } while (0)
#else
/** Sanitize string and release it, set pointer to NULL.
+
+ CRT on Windows: Optional.
@param p Pointer to string to release.
*/
#define dk4str_release_sanitized(p) \
diff --git a/support/dktools/dk4strda.c b/support/dktools/dk4strda.c
index 6457ac3b8c..e47a08ff82 100644
--- a/support/dktools/dk4strda.c
+++ b/support/dktools/dk4strda.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strda.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strda.ctr
*/
/** @file dk4strda.c The dk4strda module.
*/
-#line 51 "dk4strda.ctr"
+#line 63 "dk4strda.ctr"
+#include "dk4conf.h"
#include "dk4strda.h"
#ifndef DK4NUMCO_H_INCLUDED
@@ -57,11 +36,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4const.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 73 "dk4strda.ctr"
+#line 92 "dk4strda.ctr"
@@ -70,6 +55,9 @@ dk4str_dup_app(const dkChar *src, dk4_app_t *app)
{
dkChar *back = NULL;
size_t sz;
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
sz = dk4str_len(src);
if (SIZE_MAX > sz) {
diff --git a/support/dktools/dk4strda.ctr b/support/dktools/dk4strda.ctr
index a23964c2d8..0454aae96b 100644
--- a/support/dktools/dk4strda.ctr
+++ b/support/dktools/dk4strda.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
@@ -49,6 +61,7 @@ dk4str_dup_app(const dkChar *src, dk4_app_t *app);
%% module
+#include "dk4conf.h"
#include "dk4strda.h"
#ifndef DK4NUMCO_H_INCLUDED
@@ -67,6 +80,12 @@ dk4str_dup_app(const dkChar *src, dk4_app_t *app);
#include "dk4const.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -78,6 +97,9 @@ dk4str_dup_app(const dkChar *src, dk4_app_t *app)
{
dkChar *back = NULL;
size_t sz;
+#if DK4_USE_ASSERT
+ assert(NULL != src);
+#endif
if (NULL != src) {
sz = dk4str_len(src);
if (SIZE_MAX > sz) {
diff --git a/support/dktools/dk4strda.h b/support/dktools/dk4strda.h
index b266cf9131..3b3e195b82 100644
--- a/support/dktools/dk4strda.h
+++ b/support/dktools/dk4strda.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strda.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strda.ctr
*/
#ifndef DK4STRDA_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
diff --git a/support/dktools/dk4strm.c b/support/dktools/dk4strm.c
index 744623b554..6d4b16928c 100644
--- a/support/dktools/dk4strm.c
+++ b/support/dktools/dk4strm.c
@@ -1,56 +1,41 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strm.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strm.ctr
*/
/** @file dk4strm.c The dk4strm module.
*/
-#line 358 "dk4strm.ctr"
+#line 370 "dk4strm.ctr"
+#include "dk4conf.h"
#include "dk4strm.h"
#include "dk4mem.h"
#include "dk4enc.h"
#include "dk4numco.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 369 "dk4strm.ctr"
+#line 388 "dk4strm.ctr"
@@ -61,7 +46,10 @@ dk4stream_api_init(dk4_stream_api_t *ptr)
{
-#line 378 "dk4strm.ctr"
+#line 397 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
DK4_MEMRES(ptr, sizeof(dk4_stream_api_t));
ptr->d = NULL;
ptr->b = NULL;
@@ -71,7 +59,7 @@ dk4stream_api_init(dk4_stream_api_t *ptr)
ptr->cmd = 0;
-#line 386 "dk4strm.ctr"
+#line 408 "dk4strm.ctr"
}
@@ -85,7 +73,10 @@ dk4stream_release_memory(dk4_stream_t *strm)
{
-#line 398 "dk4strm.ctr"
+#line 420 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
dk4mem_release(strm->bi);
dk4mem_release(strm->bo);
@@ -103,7 +94,7 @@ dk4stream_release_memory(dk4_stream_t *strm)
dk4mem_free(strm);
}
-#line 414 "dk4strm.ctr"
+#line 439 "dk4strm.ctr"
}
@@ -119,12 +110,15 @@ dk4stream_i_flush_write(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
int back = 1;
-#line 428 "dk4strm.ctr"
+#line 453 "dk4strm.ctr"
/* Write buffer contents (if any) downwards.
*/
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (0 != strm->usbo) {
-#line 431 "dk4strm.ctr"
+#line 459 "dk4strm.ctr"
dk4stream_api_init(&api);
api.cmd = DK4_STREAM_API_WRITE;
api.d = strm->d;
@@ -140,7 +134,7 @@ dk4stream_i_flush_write(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
*/
if (0 < flfl) {
-#line 445 "dk4strm.ctr"
+#line 473 "dk4strm.ctr"
dk4stream_api_init(&api);
api.cmd = DK4_STREAM_API_FLUSH;
api.d = strm->d;
@@ -155,7 +149,7 @@ dk4stream_i_flush_write(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
strm->usbo = 0;
-#line 458 "dk4strm.ctr"
+#line 486 "dk4strm.ctr"
return back;
}
@@ -174,7 +168,10 @@ dk4stream_i_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp)
int back = 0;
-#line 475 "dk4strm.ctr"
+#line 503 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (strm->usbo < strm->szbo) {
(strm->bo)[strm->usbo] = c;
strm->usbo += 1;
@@ -186,7 +183,7 @@ dk4stream_i_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp)
}
}
-#line 485 "dk4strm.ctr"
+#line 516 "dk4strm.ctr"
return back;
}
@@ -196,22 +193,25 @@ dk4stream_i_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp)
/** Internal function to read a single character.
@param dst Pointer to variable for result.
@param strm Stream to read from.
- @param erp Error report, may be NULL.
@return 1 on success, 0 on error.
*/
static
int
-dk4stream_i_c8_read_byte(char *dst, dk4_stream_t *strm, dk4_er_t *erp)
+dk4stream_i_c8_read_byte(char *dst, dk4_stream_t *strm)
{
dk4_stream_api_t api;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != dst);
+#endif
-#line 504 "dk4strm.ctr"
+#line 538 "dk4strm.ctr"
if ((0 == strm->feoi) && ((strm->usbi == 0) || (strm->rebi >= strm->usbi))) {
-#line 506 "dk4strm.ctr"
+#line 540 "dk4strm.ctr"
dk4stream_api_init(&api);
api.cmd = DK4_STREAM_API_READ;
api.d = strm->d;
@@ -220,12 +220,12 @@ dk4stream_i_c8_read_byte(char *dst, dk4_stream_t *strm, dk4_er_t *erp)
(*(strm->fct))(&api);
if (0 != api.res) {
-#line 513 "dk4strm.ctr"
+#line 547 "dk4strm.ctr"
strm->rebi = 0;
strm->usbi = api.sz_out;
if (api.sz_out < strm->szbi) {
-#line 516 "dk4strm.ctr"
+#line 550 "dk4strm.ctr"
if (0 == strm->zreof) {
dk4stream_api_init(&api);
api.cmd = DK4_STREAM_API_AT_END;
@@ -233,14 +233,14 @@ dk4stream_i_c8_read_byte(char *dst, dk4_stream_t *strm, dk4_er_t *erp)
(*(strm->fct))(&api);
if (0 != api.res) {
-#line 522 "dk4strm.ctr"
+#line 556 "dk4strm.ctr"
strm->feoi = 1;
}
}
}
} else {
-#line 527 "dk4strm.ctr"
+#line 561 "dk4strm.ctr"
if (0 != strm->zreof) {
strm->feoi = 1;
} else {
@@ -250,29 +250,29 @@ dk4stream_i_c8_read_byte(char *dst, dk4_stream_t *strm, dk4_er_t *erp)
(*(strm->fct))(&api);
if (0 != api.res) {
-#line 535 "dk4strm.ctr"
+#line 569 "dk4strm.ctr"
strm->feoi = 1;
}
}
}
} else {
-#line 540 "dk4strm.ctr"
+#line 574 "dk4strm.ctr"
}
if ((0 < strm->usbi) && (strm->rebi < strm->usbi)) {
-#line 543 "dk4strm.ctr"
+#line 577 "dk4strm.ctr"
*dst = (strm->bi)[strm->rebi];
strm->rebi += 1;
back = 1;
} else {
-#line 547 "dk4strm.ctr"
+#line 581 "dk4strm.ctr"
}
-#line 549 "dk4strm.ctr"
+#line 583 "dk4strm.ctr"
return back;
}
@@ -293,9 +293,13 @@ dk4stream_open(
dk4_stream_t *back = NULL;
-#line 568 "dk4strm.ctr"
+#line 602 "dk4strm.ctr"
/* Check arguments
*/
+#if DK4_USE_ASSERT
+ assert(NULL != obj);
+ assert(NULL != fct);
+#endif
if ((NULL == obj) || (NULL == fct)) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -321,7 +325,11 @@ dk4stream_open(
back->usbi = 0; back->usbo = 0; back->rebi = 0;
back->fl = fl; back->feoi = 0;
back->bwo = 0;
- back->oenc = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back->oenc = DK4_FILE_ENCODING_WIN1252;
+#else
+ back->oenc = DK4_FILE_ENCODING_PLAIN;
+#endif
back->zreof = 0;
/* Allocate input buffer or destroy object
*/
@@ -355,7 +363,7 @@ dk4stream_open(
finished:
-#line 628 "dk4strm.ctr"
+#line 670 "dk4strm.ctr"
return back;
}
@@ -368,9 +376,12 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
int back = 0;
-#line 639 "dk4strm.ctr"
+#line 681 "dk4strm.ctr"
/* Check argument.
*/
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL == strm) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -382,7 +393,7 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
/* Write bytes in output buffer downwards.
*/
- if ((strm->fl) & DK4_STREAM_WRITE) {
+ if ((0 != ((strm->fl) & DK4_STREAM_WRITE)) && (0 < strm->usbo)) {
dk4stream_api_init(&api);
api.cmd = DK4_STREAM_API_WRITE;
api.d = strm->d;
@@ -390,7 +401,9 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
api.sz_in = strm->usbo;
(*(strm->fct))(&api);
if (0 == api.res) {
- back = 0;
+ back = 0;
+
+#line 706 "dk4strm.ctr"
dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
}
}
@@ -403,7 +416,9 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
api.d = strm->d;
(*(strm->fct))(&api);
if (0 == api.res) {
- back = 0;
+ back = 0;
+
+#line 719 "dk4strm.ctr"
dk4error_set_simple_error_code(erp, DK4_E_FLUSH_FAILED);
}
}
@@ -415,7 +430,9 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
api.d = strm->d;
(*(strm->fct))(&api);
if (0 == api.res) {
- back = 0;
+ back = 0;
+
+#line 731 "dk4strm.ctr"
dk4error_set_simple_error_code(erp, DK4_E_CLOSE_FAILED);
}
@@ -426,7 +443,7 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
finished:
-#line 695 "dk4strm.ctr"
+#line 740 "dk4strm.ctr"
return back;
}
@@ -438,7 +455,10 @@ dk4stream_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp)
int back = 0;
-#line 705 "dk4strm.ctr"
+#line 750 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if ((strm->fl) & DK4_STREAM_WRITE) {
back = dk4stream_i_write_byte(strm, c, erp);
@@ -449,7 +469,7 @@ dk4stream_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 714 "dk4strm.ctr"
+#line 762 "dk4strm.ctr"
return back;
}
@@ -464,7 +484,12 @@ dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp)
int back = 0;
-#line 727 "dk4strm.ctr"
+#line 775 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != b);
+ assert(0 < sz);
+#endif
if ((NULL != strm) && (NULL != b) && (0 < sz)) {
if ((strm->fl) & DK4_STREAM_WRITE) {
back = 1;
@@ -481,7 +506,7 @@ dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 742 "dk4strm.ctr"
+#line 795 "dk4strm.ctr"
return back;
}
@@ -497,7 +522,12 @@ dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp)
-#line 756 "dk4strm.ctr"
+#line 809 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != b);
+ assert(0 < sz);
+#endif
if ((NULL != strm) && (NULL != b) && (0 < sz)) {
if ((strm->fl) & DK4_STREAM_WRITE) {
back = 1;
@@ -505,69 +535,69 @@ dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp)
do {
cc = 0;
-#line 762 "dk4strm.ctr"
+#line 820 "dk4strm.ctr"
if (0 < sz) {
if (strm->usbo < strm->szbo) {
-#line 764 "dk4strm.ctr"
+#line 822 "dk4strm.ctr"
/* Attempt to copy as many bytes as still free in output buffer */
bc = strm->szbo - strm->usbo;
-#line 766 "dk4strm.ctr"
+#line 824 "dk4strm.ctr"
/* If not enough bytes available, correct number of bytes */
if (bc > sz) { bc = sz; }
-#line 768 "dk4strm.ctr"
+#line 826 "dk4strm.ctr"
DK4_MEMCPY(&((strm->bo)[strm->usbo]), cptr, bc);
strm->usbo += bc;
-#line 770 "dk4strm.ctr"
+#line 828 "dk4strm.ctr"
cptr = &(cptr[bc]);
sz -= bc;
-#line 772 "dk4strm.ctr"
+#line 830 "dk4strm.ctr"
if ((DK4_UM_MAX - (dk4_um_t)bc) < strm->bwr) {
strm->bwo = 1;
-#line 774 "dk4strm.ctr"
+#line 832 "dk4strm.ctr"
back = 0;
}
strm->bwr += (dk4_um_t)bc;
-#line 777 "dk4strm.ctr"
+#line 835 "dk4strm.ctr"
if (strm->usbo >= strm->szbo) {
-#line 778 "dk4strm.ctr"
+#line 836 "dk4strm.ctr"
if (0 == dk4stream_i_flush_write(strm, 0, erp)) {
back = 0;
-#line 780 "dk4strm.ctr"
+#line 838 "dk4strm.ctr"
}
}
if (0 < sz) { cc = 1; }
} else {
-#line 784 "dk4strm.ctr"
+#line 842 "dk4strm.ctr"
if (0 == dk4stream_i_flush_write(strm, 0, erp)) {
back = 0;
-#line 786 "dk4strm.ctr"
+#line 844 "dk4strm.ctr"
}
}
}
} while(0 != cc);
} else {
-#line 791 "dk4strm.ctr"
+#line 849 "dk4strm.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 794 "dk4strm.ctr"
+#line 852 "dk4strm.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 796 "dk4strm.ctr"
+#line 854 "dk4strm.ctr"
return back;
}
@@ -580,6 +610,10 @@ dk4stream_write_char_string(dk4_stream_t *strm, const char *str, dk4_er_t *erp)
{
size_t sl;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != str);
+#endif
if ((NULL != strm) && (NULL != str)) {
sl = strlen(str);
back = dk4stream_write(strm, str, sl, erp);
@@ -598,7 +632,10 @@ dk4stream_flush_read(dk4_stream_t *strm, dk4_er_t *erp)
int back = 0;
-#line 825 "dk4strm.ctr"
+#line 887 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if ((strm->fl) & DK4_STREAM_READ) {
back = 1;
@@ -611,7 +648,7 @@ dk4stream_flush_read(dk4_stream_t *strm, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 836 "dk4strm.ctr"
+#line 901 "dk4strm.ctr"
return back;
}
@@ -623,7 +660,10 @@ dk4stream_flush_write(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
int back = 0;
-#line 846 "dk4strm.ctr"
+#line 911 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if ((strm->fl) & DK4_STREAM_WRITE) {
back = dk4stream_i_flush_write(strm, flfl, erp);
@@ -634,7 +674,7 @@ dk4stream_flush_write(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 855 "dk4strm.ctr"
+#line 923 "dk4strm.ctr"
return back;
}
@@ -646,7 +686,10 @@ dk4stream_flush(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
int back = 0;
-#line 865 "dk4strm.ctr"
+#line 933 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
back = 1;
if ((strm->fl) & DK4_STREAM_WRITE) {
@@ -663,7 +706,7 @@ dk4stream_flush(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 880 "dk4strm.ctr"
+#line 951 "dk4strm.ctr"
return back;
}
@@ -675,14 +718,18 @@ dk4stream_c8_read_byte(char *dst, dk4_stream_t *strm, dk4_er_t *erp)
int back = 0;
-#line 890 "dk4strm.ctr"
+#line 961 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != dst);
+#endif
if ((NULL != dst) && (NULL != strm)) {
-#line 891 "dk4strm.ctr"
+#line 966 "dk4strm.ctr"
if ((strm->fl) & DK4_STREAM_READ) {
-#line 892 "dk4strm.ctr"
- back = dk4stream_i_c8_read_byte(dst, strm, erp);
+#line 967 "dk4strm.ctr"
+ back = dk4stream_i_c8_read_byte(dst, strm);
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
@@ -690,7 +737,7 @@ dk4stream_c8_read_byte(char *dst, dk4_stream_t *strm, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 899 "dk4strm.ctr"
+#line 974 "dk4strm.ctr"
return back;
}
@@ -706,13 +753,19 @@ dk4stream_read(void *b, size_t *szptr, dk4_stream_t *strm, dk4_er_t *erp)
int cc = 1; /* Flag: Can continue */
-#line 913 "dk4strm.ctr"
+#line 988 "dk4strm.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != b);
+ assert(NULL != szptr);
+ assert(0 < *szptr);
+#endif
if ((NULL != b) && (NULL != szptr) && (NULL != strm)) {
if (((strm->fl) & DK4_STREAM_READ) && (0 < *szptr)) {
szin = *szptr; szout = 0;
cptr = (char *)b;
do {
- if (0 != dk4stream_i_c8_read_byte(cptr++, strm, erp)) {
+ if (0 != dk4stream_i_c8_read_byte(cptr++, strm)) {
szout++;
if (szout >= szin) {
cc = 0;
@@ -739,7 +792,7 @@ dk4stream_read(void *b, size_t *szptr, dk4_stream_t *strm, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 944 "dk4strm.ctr"
+#line 1025 "dk4strm.ctr"
return back;
}
@@ -749,6 +802,9 @@ dk4_um_t
dk4stream_bytes_written(const dk4_stream_t *strm)
{
dk4_um_t back = (dk4_um_t)0UL;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) { back = strm->bwr; }
return back;
}
@@ -759,6 +815,9 @@ int
dk4stream_overflow_bytes_written(const dk4_stream_t *strm)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) { back = strm->bwo; }
return back;
}
@@ -769,6 +828,9 @@ int
dk4stream_found_eof(const dk4_stream_t *strm)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
back = strm->feoi;
}
diff --git a/support/dktools/dk4strm.ctr b/support/dktools/dk4strm.ctr
index f26d0f93cb..137ca68898 100644
--- a/support/dktools/dk4strm.ctr
+++ b/support/dktools/dk4strm.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -50,8 +62,8 @@ typedef void dk4_stream_api_fct_t(dk4_stream_api_t *);
/** Generic I/O stream.
*/
typedef struct {
- void *d; /**< Low level data object. */
dk4_stream_api_fct_t *fct; /**< Function for low level operations. */
+ void *d; /**< Low level data object. */
char *bi; /**< Buffer for input. */
char *bo; /**< Buffer for output. */
dk4_um_t bwr; /**< Number of bytes written. */
@@ -129,7 +141,7 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp);
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
int
dk4stream_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp);
@@ -147,7 +159,7 @@ dk4stream_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp);
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
int
dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp);
@@ -165,7 +177,7 @@ dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp);
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
int
dk4stream_write_char_string(dk4_stream_t *strm, const char *str, dk4_er_t *erp);
@@ -184,7 +196,7 @@ dk4stream_write_char_string(dk4_stream_t *strm, const char *str, dk4_er_t *erp);
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
int
dk4stream_flush(dk4_stream_t *strm, int flfl, dk4_er_t *erp);
@@ -358,11 +370,18 @@ enum {
+#include "dk4conf.h"
#include "dk4strm.h"
#include "dk4mem.h"
#include "dk4enc.h"
#include "dk4numco.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -375,6 +394,9 @@ void
dk4stream_api_init(dk4_stream_api_t *ptr)
{
$? "+ dk4stream_api_init"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
DK4_MEMRES(ptr, sizeof(dk4_stream_api_t));
ptr->d = NULL;
ptr->b = NULL;
@@ -395,6 +417,9 @@ void
dk4stream_release_memory(dk4_stream_t *strm)
{
$? "+ dk4stream_release_memory PTR=%d", TR_IPTR(strm)
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
dk4mem_release(strm->bi);
dk4mem_release(strm->bo);
@@ -427,6 +452,9 @@ dk4stream_i_flush_write(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
$? "+ dk4stream_i_flush_write"
/* Write buffer contents (if any) downwards.
*/
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (0 != strm->usbo) { $? ". bytes in output buffer"
dk4stream_api_init(&api);
api.cmd = DK4_STREAM_API_WRITE;
@@ -472,6 +500,9 @@ dk4stream_i_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp)
{
int back = 0;
$? "+ dk4stream_i_write_byte"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (strm->usbo < strm->szbo) {
(strm->bo)[strm->usbo] = c;
strm->usbo += 1;
@@ -491,15 +522,18 @@ dk4stream_i_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp)
/** Internal function to read a single character.
@param dst Pointer to variable for result.
@param strm Stream to read from.
- @param erp Error report, may be NULL.
@return 1 on success, 0 on error.
*/
static
int
-dk4stream_i_c8_read_byte(char *dst, dk4_stream_t *strm, dk4_er_t *erp)
+dk4stream_i_c8_read_byte(char *dst, dk4_stream_t *strm)
{
dk4_stream_api_t api;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != dst);
+#endif
$? "+ dk4stream_i_c8_read_byte"
if ((0 == strm->feoi) && ((strm->usbi == 0) || (strm->rebi >= strm->usbi))) {
$? ". low level read required"
@@ -567,6 +601,10 @@ dk4stream_open(
$? "+ dk4stream_open"
/* Check arguments
*/
+#if DK4_USE_ASSERT
+ assert(NULL != obj);
+ assert(NULL != fct);
+#endif
if ((NULL == obj) || (NULL == fct)) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -592,7 +630,11 @@ dk4stream_open(
back->usbi = 0; back->usbo = 0; back->rebi = 0;
back->fl = fl; back->feoi = 0;
back->bwo = 0;
- back->oenc = DK4_FILE_ENCODING_ASCII;
+#if DK4_ON_WINDOWS
+ back->oenc = DK4_FILE_ENCODING_WIN1252;
+#else
+ back->oenc = DK4_FILE_ENCODING_PLAIN;
+#endif
back->zreof = 0;
/* Allocate input buffer or destroy object
*/
@@ -638,6 +680,9 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
$? "+ dk4stream_close"
/* Check argument.
*/
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL == strm) {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
goto finished;
@@ -649,7 +694,7 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
/* Write bytes in output buffer downwards.
*/
- if ((strm->fl) & DK4_STREAM_WRITE) {
+ if ((0 != ((strm->fl) & DK4_STREAM_WRITE)) && (0 < strm->usbo)) {
dk4stream_api_init(&api);
api.cmd = DK4_STREAM_API_WRITE;
api.d = strm->d;
@@ -657,7 +702,7 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
api.sz_in = strm->usbo;
(*(strm->fct))(&api);
if (0 == api.res) {
- back = 0;
+ back = 0; $? "! final write failed"
dk4error_set_simple_error_code(erp, DK4_E_WRITE_FAILED);
}
}
@@ -670,7 +715,7 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
api.d = strm->d;
(*(strm->fct))(&api);
if (0 == api.res) {
- back = 0;
+ back = 0; $? "! final flush failed"
dk4error_set_simple_error_code(erp, DK4_E_FLUSH_FAILED);
}
}
@@ -682,7 +727,7 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp)
api.d = strm->d;
(*(strm->fct))(&api);
if (0 == api.res) {
- back = 0;
+ back = 0; $? "! close data failed"
dk4error_set_simple_error_code(erp, DK4_E_CLOSE_FAILED);
}
@@ -702,6 +747,9 @@ dk4stream_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp)
{
int back = 0;
$? "+ dk4stream_write_byte"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if ((strm->fl) & DK4_STREAM_WRITE) {
back = dk4stream_i_write_byte(strm, c, erp);
@@ -724,6 +772,11 @@ dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp)
char *cptr; /* Traverse buffer */
int back = 0;
$? "+ dk4stream_write"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != b);
+ assert(0 < sz);
+#endif
if ((NULL != strm) && (NULL != b) && (0 < sz)) {
if ((strm->fl) & DK4_STREAM_WRITE) {
back = 1;
@@ -753,6 +806,11 @@ dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp)
int cc;
$? "+ dk4stream_write %lu", (unsigned long)sz
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != b);
+ assert(0 < sz);
+#endif
if ((NULL != strm) && (NULL != b) && (0 < sz)) {
if ((strm->fl) & DK4_STREAM_WRITE) {
back = 1;
@@ -805,6 +863,10 @@ dk4stream_write_char_string(dk4_stream_t *strm, const char *str, dk4_er_t *erp)
{
size_t sl;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != str);
+#endif
if ((NULL != strm) && (NULL != str)) {
sl = strlen(str);
back = dk4stream_write(strm, str, sl, erp);
@@ -822,6 +884,9 @@ dk4stream_flush_read(dk4_stream_t *strm, dk4_er_t *erp)
{
int back = 0;
$? "+ dk4stream_flush_read"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if ((strm->fl) & DK4_STREAM_READ) {
back = 1;
@@ -843,6 +908,9 @@ dk4stream_flush_write(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
{
int back = 0;
$? "+ dk4stream_flush_write"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if ((strm->fl) & DK4_STREAM_WRITE) {
back = dk4stream_i_flush_write(strm, flfl, erp);
@@ -862,6 +930,9 @@ dk4stream_flush(dk4_stream_t *strm, int flfl, dk4_er_t *erp)
{
int back = 0;
$? "+ dk4stream_flush"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
back = 1;
if ((strm->fl) & DK4_STREAM_WRITE) {
@@ -887,9 +958,13 @@ dk4stream_c8_read_byte(char *dst, dk4_stream_t *strm, dk4_er_t *erp)
{
int back = 0;
$? "+ dk4stream_c8_read_byte"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != dst);
+#endif
if ((NULL != dst) && (NULL != strm)) { $? ". pointers ok"
if ((strm->fl) & DK4_STREAM_READ) { $? ". read"
- back = dk4stream_i_c8_read_byte(dst, strm, erp);
+ back = dk4stream_i_c8_read_byte(dst, strm);
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
@@ -910,12 +985,18 @@ dk4stream_read(void *b, size_t *szptr, dk4_stream_t *strm, dk4_er_t *erp)
int back = 0; /* Function result */
int cc = 1; /* Flag: Can continue */
$? "+ dk4stream_read"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != b);
+ assert(NULL != szptr);
+ assert(0 < *szptr);
+#endif
if ((NULL != b) && (NULL != szptr) && (NULL != strm)) {
if (((strm->fl) & DK4_STREAM_READ) && (0 < *szptr)) {
szin = *szptr; szout = 0;
cptr = (char *)b;
do {
- if (0 != dk4stream_i_c8_read_byte(cptr++, strm, erp)) {
+ if (0 != dk4stream_i_c8_read_byte(cptr++, strm)) {
szout++;
if (szout >= szin) {
cc = 0;
@@ -950,6 +1031,9 @@ dk4_um_t
dk4stream_bytes_written(const dk4_stream_t *strm)
{
dk4_um_t back = (dk4_um_t)0UL;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) { back = strm->bwr; }
return back;
}
@@ -960,6 +1044,9 @@ int
dk4stream_overflow_bytes_written(const dk4_stream_t *strm)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) { back = strm->bwo; }
return back;
}
@@ -970,6 +1057,9 @@ int
dk4stream_found_eof(const dk4_stream_t *strm)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
back = strm->feoi;
}
diff --git a/support/dktools/dk4strm.h b/support/dktools/dk4strm.h
index aa02a5ef28..10e5ca89d4 100644
--- a/support/dktools/dk4strm.h
+++ b/support/dktools/dk4strm.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strm.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strm.ctr
*/
#ifndef DK4STRM_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -82,8 +72,8 @@ typedef void dk4_stream_api_fct_t(dk4_stream_api_t *);
/** Generic I/O stream.
*/
typedef struct {
- void *d; /**< Low level data object. */
dk4_stream_api_fct_t *fct; /**< Function for low level operations. */
+ void *d; /**< Low level data object. */
char *bi; /**< Buffer for input. */
char *bo; /**< Buffer for output. */
dk4_um_t bwr; /**< Number of bytes written. */
@@ -161,7 +151,7 @@ dk4stream_close(dk4_stream_t *strm, dk4_er_t *erp);
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
int
dk4stream_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp);
@@ -179,7 +169,7 @@ dk4stream_write_byte(dk4_stream_t *strm, char c, dk4_er_t *erp);
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
int
dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp);
@@ -197,7 +187,7 @@ dk4stream_write(dk4_stream_t *strm, const void *b, size_t sz, dk4_er_t *erp);
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed,
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
int
dk4stream_write_char_string(dk4_stream_t *strm, const char *str, dk4_er_t *erp);
@@ -216,7 +206,7 @@ dk4stream_write_char_string(dk4_stream_t *strm, const char *str, dk4_er_t *erp);
- DK4_E_WRITE_FAILED<br>
if writing one ore multiple bytes to the stream failed
- DK4_E_FLUSH_FAILED<br>
- if flusing data downwards failed.
+ if flushing data downwards failed.
*/
int
dk4stream_flush(dk4_stream_t *strm, int flfl, dk4_er_t *erp);
diff --git a/support/dktools/dk4strmb.c b/support/dktools/dk4strmb.c
index 141f1aef2b..0ab4981c15 100644
--- a/support/dktools/dk4strmb.c
+++ b/support/dktools/dk4strmb.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmb.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmb.ctr
*/
/** @file dk4strmb.c The dk4strmb module.
*/
-#line 94 "dk4strmb.ctr"
+#line 102 "dk4strmb.ctr"
#include "dk4conf.h"
@@ -46,6 +24,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4strm.h"
#include "dk4strmb.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
void
@@ -53,6 +37,9 @@ dk4stream_bzfile_with_close_function(dk4_stream_api_t *api)
{
BZFILE *fipo;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -67,12 +54,16 @@ dk4stream_bzfile_with_close_function(dk4_stream_api_t *api)
}
} break;
case DK4_STREAM_API_WRITE: {
- res = BZ2_bzwrite(fipo, api->b, (int)(api->sz_in));
- if (0 < res) {
- if (res == (int)(api->sz_in)) {
- api->res = 1;
+ if (0 < api->sz_in) {
+ res = BZ2_bzwrite(fipo, api->b, (int)(api->sz_in));
+ if (0 < res) {
+ if (res == (int)(api->sz_in)) {
+ api->res = 1;
+ }
+ api->sz_out = (size_t)res;
}
- api->sz_out = (size_t)res;
+ } else {
+ api->res = 1;
}
} break;
case DK4_STREAM_API_FLUSH: {
@@ -98,6 +89,9 @@ dk4stream_bzfile_with_close_function(dk4_stream_api_t *api)
void
dk4stream_bzfile_function(dk4_stream_api_t *api)
{
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
switch (api->cmd) {
case DK4_STREAM_API_CLOSE: {
@@ -122,6 +116,9 @@ dk4stream_open_for_bzfile(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open( (void *)fipo, dk4stream_bzfile_function, fl, ibs, obs, erp)
);
@@ -138,6 +135,9 @@ dk4stream_open_for_bzfile_with_close(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open(
(void *)fipo, dk4stream_bzfile_with_close_function, fl, ibs, obs, erp
diff --git a/support/dktools/dk4strmb.ctr b/support/dktools/dk4strmb.ctr
index 5e9d6d737c..35aa708328 100644
--- a/support/dktools/dk4strmb.ctr
+++ b/support/dktools/dk4strmb.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,13 +16,21 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_BZLIB_H
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef BZLIB_H_INCLUDED
@@ -99,6 +107,12 @@ dk4stream_open_for_bzfile_with_close(
#include "dk4strm.h"
#include "dk4strmb.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
void
@@ -106,6 +120,9 @@ dk4stream_bzfile_with_close_function(dk4_stream_api_t *api)
{
BZFILE *fipo;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -120,12 +137,16 @@ dk4stream_bzfile_with_close_function(dk4_stream_api_t *api)
}
} break;
case DK4_STREAM_API_WRITE: {
- res = BZ2_bzwrite(fipo, api->b, (int)(api->sz_in));
- if (0 < res) {
- if (res == (int)(api->sz_in)) {
- api->res = 1;
+ if (0 < api->sz_in) {
+ res = BZ2_bzwrite(fipo, api->b, (int)(api->sz_in));
+ if (0 < res) {
+ if (res == (int)(api->sz_in)) {
+ api->res = 1;
+ }
+ api->sz_out = (size_t)res;
}
- api->sz_out = (size_t)res;
+ } else {
+ api->res = 1;
}
} break;
case DK4_STREAM_API_FLUSH: {
@@ -151,6 +172,9 @@ dk4stream_bzfile_with_close_function(dk4_stream_api_t *api)
void
dk4stream_bzfile_function(dk4_stream_api_t *api)
{
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
switch (api->cmd) {
case DK4_STREAM_API_CLOSE: {
@@ -175,6 +199,9 @@ dk4stream_open_for_bzfile(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open( (void *)fipo, dk4stream_bzfile_function, fl, ibs, obs, erp)
);
@@ -191,6 +218,9 @@ dk4stream_open_for_bzfile_with_close(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open(
(void *)fipo, dk4stream_bzfile_with_close_function, fl, ibs, obs, erp
diff --git a/support/dktools/dk4strmb.h b/support/dktools/dk4strmb.h
index c870defb98..43470690c7 100644
--- a/support/dktools/dk4strmb.h
+++ b/support/dktools/dk4strmb.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmb.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmb.ctr
*/
#ifndef DK4STRMB_H_INCLUDED
@@ -48,13 +26,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_BZLIB_H
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef BZLIB_H_INCLUDED
diff --git a/support/dktools/dk4strmco.c b/support/dktools/dk4strmco.c
index 6c8609aaf4..c0993ffb89 100644
--- a/support/dktools/dk4strmco.c
+++ b/support/dktools/dk4strmco.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmco.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmco.ctr
*/
/** @file dk4strmco.c The dk4strmco module.
*/
-#line 116 "dk4strmco.ctr"
+#line 137 "dk4strmco.ctr"
#include "dk4conf.h"
@@ -48,6 +26,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_LIMITS_H
+#ifndef LIMITS_H_INCLUDED
+#include <limits.h>
+#define LIMITS_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4rle.h"
#include "dk4a85e.h"
#include "dk4strmco.h"
@@ -55,10 +40,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4memrs.h"
#include "dk4lzwe.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 135 "dk4strmco.ctr"
+#line 169 "dk4strmco.ctr"
@@ -155,7 +146,10 @@ dk4strmco_nl(compressor_t *co)
int back = 0;
-#line 230 "dk4strmco.ctr"
+#line 264 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
if (0 != (DK4_STRMCO_FL_CR_NL & (co->fl))) {
back = dk4stream_write(co->dststrm, crnl, 2, NULL);
}
@@ -164,7 +158,7 @@ dk4strmco_nl(compressor_t *co)
}
-#line 237 "dk4strmco.ctr"
+#line 274 "dk4strmco.ctr"
return back;
}
@@ -199,12 +193,17 @@ dk4strmco_co_oe(
unsigned char uc; /* UC version of current character */
-#line 270 "dk4strmco.ctr"
+#line 307 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+ assert(NULL != b);
+ assert(0 < sz);
+#endif
switch (co->oe) {
case DK4_STRMCO_OE_ASCII85 : {
-#line 273 "dk4strmco.ctr"
+#line 315 "dk4strmco.ctr"
back = 1;
for (i = 0; ((i < sz) && (1 == back)); i++) {
switch (dk4a85_enc_add(&(co->u_oe.a85), b[i], NULL)) {
@@ -283,7 +282,7 @@ dk4strmco_co_oe(
case DK4_STRMCO_OE_HEX : {
-#line 350 "dk4strmco.ctr"
+#line 392 "dk4strmco.ctr"
back = 1;
buf[2] = '\0';
for (i = 0; ((i < sz) && (1 == back)); i++) {
@@ -326,7 +325,7 @@ dk4strmco_co_oe(
default : {
-#line 391 "dk4strmco.ctr"
+#line 433 "dk4strmco.ctr"
back = dk4stream_write(co->dststrm, b, sz, NULL);
if (0 != back) {
osz = sz;
@@ -336,7 +335,7 @@ dk4strmco_co_oe(
if (NULL != szo) { *szo = osz; }
-#line 399 "dk4strmco.ctr"
+#line 441 "dk4strmco.ctr"
return back;
}
@@ -367,41 +366,51 @@ dk4strmco_co_co(
int res = 0; /* Result from various operations. */
-#line 428 "dk4strmco.ctr"
+#line 470 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+ assert(NULL != b);
+ assert(0 < sz);
+#endif
switch (co->co) {
case DK4_STRMCO_CO_FLATE : {
-#line 431 "dk4strmco.ctr"
- back = 1;
- co->u_co.zs.next_in = (unsigned char *)b;
- co->u_co.zs.avail_in = sz;
- do {
- co->u_co.zs.next_out = (unsigned char *)(&(co->zbuf[0]));
- co->u_co.zs.avail_out = DK4_STRMCO_ZBUF_SIZE;
- res = deflate(&(co->u_co.zs), Z_NO_FLUSH);
- switch (res) {
- case Z_OK : {
- used = DK4_STRMCO_ZBUF_SIZE - co->u_co.zs.avail_out;
- if (0 < used) {
- res = dk4strmco_co_oe(co,&(co->zbuf[0]),used,NULL);
- if (0 < res) {
- osz = sz - co->u_co.zs.avail_in;
+#line 478 "dk4strmco.ctr"
+ if (((dk4_um_t)(UINT_MAX)) >= ((dk4_um_t)sz)) {
+ back = 1;
+ co->u_co.zs.next_in = (unsigned char *)b;
+ co->u_co.zs.avail_in = (unsigned int)sz;
+ do {
+ co->u_co.zs.next_out = (unsigned char *)(&(co->zbuf[0]));
+ co->u_co.zs.avail_out = DK4_STRMCO_ZBUF_SIZE;
+ res = deflate(&(co->u_co.zs), Z_NO_FLUSH);
+ switch (res) {
+ case Z_OK : {
+ used = DK4_STRMCO_ZBUF_SIZE - co->u_co.zs.avail_out;
+ if (0 < used) {
+ res = dk4strmco_co_oe(
+ co, &(co->zbuf[0]), used, NULL
+ );
+ if (0 < res) {
+ osz = sz - co->u_co.zs.avail_in;
+ }
+ else {
+ back = 0;
+ }
}
else {
- back = 0;
+ osz = sz - co->u_co.zs.avail_in;
}
- }
- else {
- osz = sz - co->u_co.zs.avail_in;
- }
- } break;
- default : {
- back = 0;
- } break;
- }
- } while ((0 < co->u_co.zs.avail_in) && (1 == back));
- if (NULL != szo) { *szo = osz; }
+ } break;
+ default : {
+ back = 0;
+ } break;
+ }
+ } while ((0 < co->u_co.zs.avail_in) && (1 == back));
+ if (NULL != szo) { *szo = osz; }
+ } else {
+ }
} break;
case DK4_STRMCO_CO_LZW : {
back = 1;
@@ -439,13 +448,13 @@ dk4strmco_co_co(
default : {
-#line 496 "dk4strmco.ctr"
+#line 548 "dk4strmco.ctr"
back = dk4strmco_co_oe(co, b, sz, szo);
} break;
}
-#line 500 "dk4strmco.ctr"
+#line 552 "dk4strmco.ctr"
return back;
}
@@ -475,12 +484,15 @@ dk4strmco_co_write(
int res; /* Result from various operations */
-#line 528 "dk4strmco.ctr"
+#line 580 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
switch (co->pp) {
case DK4_STRMCO_PP_RUNLENGTH : {
-#line 531 "dk4strmco.ctr"
+#line 586 "dk4strmco.ctr"
back = 1;
for (i = 0; ((i < sz) && (0 != back)); i++) {
switch (dk4rle_add(&(co->u_pp.rle),(unsigned char)(b[i]),NULL))
@@ -519,13 +531,13 @@ dk4strmco_co_write(
default : {
-#line 568 "dk4strmco.ctr"
+#line 623 "dk4strmco.ctr"
back = dk4strmco_co_co(co, b, sz, szo);
} break;
}
-#line 572 "dk4strmco.ctr"
+#line 627 "dk4strmco.ctr"
return back;
}
@@ -546,16 +558,16 @@ dk4strmco_co_oe_close(compressor_t *co)
int res = 0;
-#line 591 "dk4strmco.ctr"
+#line 646 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
switch (co->oe) {
case DK4_STRMCO_OE_ASCII85 : {
-#line 594 "dk4strmco.ctr"
+#line 652 "dk4strmco.ctr"
switch (dk4a85_enc_finish(&(co->u_oe.a85), NULL)) {
-
-
-#line 596 "dk4strmco.ctr"
case DK4_EDSTM_FINISHED : {
if (0 < dk4a85_enc_output(&dptr,&sz,&(co->u_oe.a85),NULL)) {
if (0 < sz) {
@@ -594,7 +606,7 @@ dk4strmco_co_oe_close(compressor_t *co)
if (0 != (DK4_STRMCO_FL_EOD_OE & (co->fl))) {
-#line 633 "dk4strmco.ctr"
+#line 690 "dk4strmco.ctr"
res = dk4stream_write(co->dststrm, a85fin, 2, NULL);
if (0 == res) {
back = 0;
@@ -603,7 +615,7 @@ dk4strmco_co_oe_close(compressor_t *co)
if (0 != (DK4_STRMCO_FL_NL_OE & (co->fl))) {
-#line 640 "dk4strmco.ctr"
+#line 697 "dk4strmco.ctr"
if (0 == dk4strmco_nl(co)) {
back = 0;
}
@@ -613,13 +625,13 @@ dk4strmco_co_oe_close(compressor_t *co)
if (0 != (DK4_STRMCO_FL_EOD_OE & (co->fl))) {
-#line 648 "dk4strmco.ctr"
+#line 705 "dk4strmco.ctr"
back = dk4stream_write(co->dststrm, ahfin, 1, NULL);
}
if (0 != (DK4_STRMCO_FL_NL_OE & (co->fl))) {
-#line 652 "dk4strmco.ctr"
+#line 709 "dk4strmco.ctr"
if (0 == dk4strmco_nl(co)) {
back = 0;
}
@@ -628,7 +640,7 @@ dk4strmco_co_oe_close(compressor_t *co)
}
-#line 659 "dk4strmco.ctr"
+#line 716 "dk4strmco.ctr"
return back;
}
@@ -649,12 +661,15 @@ dk4strmco_co_co_close(compressor_t *co)
int res = 0;
-#line 678 "dk4strmco.ctr"
+#line 735 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
switch (co->co) {
case DK4_STRMCO_CO_FLATE : {
-#line 681 "dk4strmco.ctr"
+#line 741 "dk4strmco.ctr"
co->u_co.zs.next_in = (unsigned char *)nl;
co->u_co.zs.avail_in = 0;
do {
@@ -663,13 +678,13 @@ dk4strmco_co_co_close(compressor_t *co)
zres = deflate(&(co->u_co.zs), Z_FINISH);
-#line 688 "dk4strmco.ctr"
+#line 748 "dk4strmco.ctr"
switch (zres) {
case Z_OK : case Z_STREAM_END : {
used = DK4_STRMCO_ZBUF_SIZE - co->u_co.zs.avail_out;
-#line 692 "dk4strmco.ctr"
+#line 752 "dk4strmco.ctr"
if (0 < used) {
res = dk4strmco_co_oe(co,&(co->zbuf[0]),used,NULL);
if (0 == res) {
@@ -684,7 +699,7 @@ dk4strmco_co_co_close(compressor_t *co)
} while ((Z_OK == zres) && (1 == back));
-#line 705 "dk4strmco.ctr"
+#line 765 "dk4strmco.ctr"
if (Z_OK != deflateEnd(&(co->u_co.zs))) {
back = 0;
}
@@ -715,7 +730,7 @@ dk4strmco_co_co_close(compressor_t *co)
}
-#line 734 "dk4strmco.ctr"
+#line 794 "dk4strmco.ctr"
return back;
}
@@ -735,32 +750,35 @@ dk4strmco_co_pp_close(compressor_t *co)
int res;
-#line 752 "dk4strmco.ctr"
+#line 812 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
switch (co->pp) {
case DK4_STRMCO_PP_RUNLENGTH : {
-#line 755 "dk4strmco.ctr"
+#line 818 "dk4strmco.ctr"
switch (dk4rle_finish(&(co->u_pp.rle), NULL)) {
case DK4_EDSTM_ACCEPT : {
} break;
case DK4_EDSTM_FINISHED : {
-#line 760 "dk4strmco.ctr"
+#line 823 "dk4strmco.ctr"
if (0 < dk4rle_output(&dptr, &szd, &(co->u_pp.rle), NULL)) {
res = dk4strmco_co_write(
co, (const char *)dptr, szd, NULL
);
if (0 == res) {
-#line 765 "dk4strmco.ctr"
+#line 828 "dk4strmco.ctr"
back = 0;
}
}
else {
-#line 769 "dk4strmco.ctr"
+#line 832 "dk4strmco.ctr"
back = 0;
}
} break;
@@ -771,7 +789,7 @@ dk4strmco_co_pp_close(compressor_t *co)
}
-#line 778 "dk4strmco.ctr"
+#line 841 "dk4strmco.ctr"
return back;
}
@@ -788,7 +806,10 @@ dk4strmco_co_close(compressor_t *co)
int back = 1;
-#line 793 "dk4strmco.ctr"
+#line 856 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
/* Flush preprocessor (run-length encoder).
*/
if (0 == dk4strmco_co_pp_close(co)) {
@@ -808,29 +829,33 @@ dk4strmco_co_close(compressor_t *co)
*/
-#line 811 "dk4strmco.ctr"
+#line 877 "dk4strmco.ctr"
if (0 == dk4mem_reset_secure(co, sizeof(compressor_t), NULL)) {
back = 0;
}
-#line 815 "dk4strmco.ctr"
+#line 881 "dk4strmco.ctr"
dk4mem_free(co);
-#line 817 "dk4strmco.ctr"
+#line 883 "dk4strmco.ctr"
return back;
}
+static
void
dk4strmco_handler(dk4_stream_api_t *api)
{
compressor_t *co = NULL;
-#line 827 "dk4strmco.ctr"
+#line 894 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -838,14 +863,19 @@ dk4strmco_handler(dk4_stream_api_t *api)
switch (api->cmd) {
case DK4_STREAM_API_WRITE : {
-#line 833 "dk4strmco.ctr"
- api->res = dk4strmco_co_write(
- co, api->b, api->sz_in, &(api->sz_out)
- );
+#line 903 "dk4strmco.ctr"
+ if (0 < api->sz_in) {
+ api->res = dk4strmco_co_write(
+ co, api->b, api->sz_in, &(api->sz_out)
+ );
+ }
+ else {
+ api->res = 1;
+ }
} break;
case DK4_STREAM_API_FLUSH : {
-#line 838 "dk4strmco.ctr"
+#line 913 "dk4strmco.ctr"
/*
Do nothing but indicate success.
Otherwise closing a stream will return an error.
@@ -854,24 +884,24 @@ dk4strmco_handler(dk4_stream_api_t *api)
} break;
case DK4_STREAM_API_CLOSE : {
-#line 845 "dk4strmco.ctr"
+#line 920 "dk4strmco.ctr"
api->res = dk4strmco_co_close(co);
} break;
case DK4_STREAM_API_ZERO_READ_IS_EOF : {
-#line 848 "dk4strmco.ctr"
+#line 923 "dk4strmco.ctr"
api->res = 0;
} break;
default : {
-#line 851 "dk4strmco.ctr"
+#line 926 "dk4strmco.ctr"
/* Error: Functions not available */
} break;
}
}
-#line 856 "dk4strmco.ctr"
+#line 931 "dk4strmco.ctr"
}
@@ -890,140 +920,149 @@ dk4strmco_open(
compressor_t *cc = NULL;
-#line 873 "dk4strmco.ctr"
- /* Allocate compressor and set up.
- */
-
-
-#line 876 "dk4strmco.ctr"
- cc = dk4mem_new(compressor_t,1,erp);
- if (NULL != cc) {
- cc->dststrm = strm;
- cc->pp = pp;
- cc->co = co;
- cc->oe = oe;
- cc->fl = fl;
- cc->ll = 0;
- switch (pp) {
- case DK4_STRMCO_PP_RUNLENGTH : {
-
-
-#line 887 "dk4strmco.ctr"
- dk4rle_init(
- &(cc->u_pp.rle),
- ((0 != (DK4_STRMCO_FL_EOD_PP & fl)) ? 1 : 0),
- erp
- );
- } break;
- default : {
- } break;
- }
- switch (co) {
- case DK4_STRMCO_CO_FLATE : {
-
+#line 948 "dk4strmco.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
+ if (NULL != strm) {
+ /* Allocate compressor and set up.
+ */
+
-#line 899 "dk4strmco.ctr"
- cc->u_co.zs.zalloc = Z_NULL;
- cc->u_co.zs.zfree = Z_NULL;
- cc->u_co.zs.opaque = Z_NULL;
-
+#line 955 "dk4strmco.ctr"
+ cc = dk4mem_new(compressor_t,1,erp);
+ if (NULL != cc) {
+ cc->dststrm = strm;
+ cc->pp = pp;
+ cc->co = co;
+ cc->oe = oe;
+ cc->fl = fl;
+ cc->ll = 0;
+ switch (pp) {
+ case DK4_STRMCO_PP_RUNLENGTH : {
+
-#line 903 "dk4strmco.ctr"
- if (Z_OK != deflateInit(&(cc->u_co.zs), 9)) {
+#line 966 "dk4strmco.ctr"
+ dk4rle_init(
+ &(cc->u_pp.rle),
+ ((0 != (DK4_STRMCO_FL_EOD_PP & fl)) ? 1 : 0),
+ NULL
+ );
+ } break;
+ default : {
+ } break;
+ }
+ switch (co) {
+ case DK4_STRMCO_CO_FLATE : {
-#line 905 "dk4strmco.ctr"
- dk4mem_free(cc);
- cc = NULL;
+#line 978 "dk4strmco.ctr"
+ cc->u_co.zs.zalloc = Z_NULL;
+ cc->u_co.zs.zfree = Z_NULL;
+ cc->u_co.zs.opaque = Z_NULL;
-#line 908 "dk4strmco.ctr"
- }
- } break;
- case DK4_STRMCO_CO_LZW : {
-
+#line 982 "dk4strmco.ctr"
+ if (Z_OK != deflateInit(&(cc->u_co.zs), 9)) {
+
-#line 912 "dk4strmco.ctr"
- if (0 == dk4lzwe_init(&(cc->u_co.lzw), NULL)) {
-
+#line 984 "dk4strmco.ctr"
+ dk4mem_free(cc);
+ cc = NULL;
+
-#line 914 "dk4strmco.ctr"
- dk4mem_free(cc);
- cc = NULL;
+#line 987 "dk4strmco.ctr"
+ }
+ } break;
+ case DK4_STRMCO_CO_LZW : {
-#line 917 "dk4strmco.ctr"
- }
- } break;
- default : {
- } break;
- }
- switch (oe) {
- case DK4_STRMCO_OE_ASCII85 : {
-
+#line 991 "dk4strmco.ctr"
+ if (0 == dk4lzwe_init(&(cc->u_co.lzw), NULL)) {
+
-#line 925 "dk4strmco.ctr"
- dk4a85_enc_init(&(cc->u_oe.a85), 1, erp);
- } break;
- default : {
- } break;
+#line 993 "dk4strmco.ctr"
+ dk4mem_free(cc);
+ cc = NULL;
+
+
+#line 996 "dk4strmco.ctr"
+ }
+ } break;
+ default : {
+ } break;
+ }
+ switch (oe) {
+ case DK4_STRMCO_OE_ASCII85 : {
+
+
+#line 1004 "dk4strmco.ctr"
+ dk4a85_enc_init(&(cc->u_oe.a85), 1, NULL);
+ } break;
+ default : {
+ } break;
+ }
}
- }
#if TRACE_DEBUG
- else {
+ else {
-#line 933 "dk4strmco.ctr"
- }
+#line 1012 "dk4strmco.ctr"
+ }
#endif
-
- /* If the compressor was set up successfully, create stream.
- */
- if (NULL != cc) {
-
-
-#line 940 "dk4strmco.ctr"
- back = dk4stream_open(cc,dk4strmco_handler,DK4_STREAM_WRITE,0,4096,erp);
- /*
- When failed to create stream, we must release the compressor.
+ /* If the compressor was set up successfully, create stream.
*/
- if (NULL == back) {
+ if (NULL != cc) {
+
+
+#line 1018 "dk4strmco.ctr"
+ back = dk4stream_open(
+ cc, dk4strmco_handler, DK4_STREAM_WRITE, 0, 4096, erp
+ );
/*
- Release dynamic resources assigned to components.
+ When failed to create stream, we must release the compressor.
*/
-
+ if (NULL == back) {
+ /*
+ Release dynamic resources assigned to components.
+ */
+
-#line 949 "dk4strmco.ctr"
- switch (co) {
- case DK4_STRMCO_CO_FLATE : {
-
+#line 1029 "dk4strmco.ctr"
+ switch (co) {
+ case DK4_STRMCO_CO_FLATE : {
+
-#line 952 "dk4strmco.ctr"
- (void)deflateEnd(&(cc->u_co.zs));
- } break;
- case DK4_STRMCO_CO_LZW : {
-
+#line 1032 "dk4strmco.ctr"
+ (void)deflateEnd(&(cc->u_co.zs));
+ } break;
+ case DK4_STRMCO_CO_LZW : {
+
-#line 956 "dk4strmco.ctr"
- (void)dk4lzwe_finish(&(cc->u_co.lzw), NULL);
- } break;
- default : {
- } break;
- }
-
+#line 1036 "dk4strmco.ctr"
+ (void)dk4lzwe_finish(&(cc->u_co.lzw), NULL);
+ } break;
+ default : {
+ } break;
+ }
+
-#line 962 "dk4strmco.ctr"
- dk4mem_free(cc);
- }
+#line 1042 "dk4strmco.ctr"
+ dk4mem_free(cc);
+ }
#if TRACE_DEBUG
- else {
+ else {
-#line 966 "dk4strmco.ctr"
- }
+#line 1046 "dk4strmco.ctr"
+ }
#endif
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 970 "dk4strmco.ctr"
+#line 1054 "dk4strmco.ctr"
return back;
}
diff --git a/support/dktools/dk4strmco.ctr b/support/dktools/dk4strmco.ctr
index 6bd073c309..57b1f36ff7 100644
--- a/support/dktools/dk4strmco.ctr
+++ b/support/dktools/dk4strmco.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -32,15 +32,27 @@ stream.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
@@ -95,6 +107,15 @@ extern "C" {
@param fl Flags.
@param erp Error report, may be NULL.
@return Valid pointer to new stream on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the product of elsize and nelem,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
*/
dk4_stream_t *
dk4strmco_open(
@@ -123,6 +144,13 @@ dk4strmco_open(
#endif
#endif
+#if DK4_HAVE_LIMITS_H
+#ifndef LIMITS_H_INCLUDED
+#include <limits.h>
+#define LIMITS_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4rle.h"
#include "dk4a85e.h"
#include "dk4strmco.h"
@@ -130,6 +158,12 @@ dk4strmco_open(
#include "dk4memrs.h"
#include "dk4lzwe.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -227,6 +261,9 @@ dk4strmco_nl(compressor_t *co)
{
int back = 0;
$? "+ dk4strmco_nl"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
if (0 != (DK4_STRMCO_FL_CR_NL & (co->fl))) {
back = dk4stream_write(co->dststrm, crnl, 2, NULL);
}
@@ -267,6 +304,11 @@ dk4strmco_co_oe(
unsigned us; /* Index in hex digits array. */
unsigned char uc; /* UC version of current character */
$? "+ dk4strmco_co_oe"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+ assert(NULL != b);
+ assert(0 < sz);
+#endif
switch (co->oe) {
case DK4_STRMCO_OE_ASCII85 : {
$? ". ASCII-85 encoding"
@@ -425,38 +467,48 @@ dk4strmco_co_co(
int back = 0; /* Function result. */
int res = 0; /* Result from various operations. */
$? "+ dk4strmco_co_co"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+ assert(NULL != b);
+ assert(0 < sz);
+#endif
switch (co->co) {
case DK4_STRMCO_CO_FLATE : {
$? ". flate compression"
- back = 1;
- co->u_co.zs.next_in = (unsigned char *)b;
- co->u_co.zs.avail_in = sz;
- do {
- co->u_co.zs.next_out = (unsigned char *)(&(co->zbuf[0]));
- co->u_co.zs.avail_out = DK4_STRMCO_ZBUF_SIZE;
- res = deflate(&(co->u_co.zs), Z_NO_FLUSH);
- switch (res) {
- case Z_OK : {
- used = DK4_STRMCO_ZBUF_SIZE - co->u_co.zs.avail_out;
- if (0 < used) {
- res = dk4strmco_co_oe(co,&(co->zbuf[0]),used,NULL);
- if (0 < res) {
- osz = sz - co->u_co.zs.avail_in;
+ if (((dk4_um_t)(UINT_MAX)) >= ((dk4_um_t)sz)) {
+ back = 1;
+ co->u_co.zs.next_in = (unsigned char *)b;
+ co->u_co.zs.avail_in = (unsigned int)sz;
+ do {
+ co->u_co.zs.next_out = (unsigned char *)(&(co->zbuf[0]));
+ co->u_co.zs.avail_out = DK4_STRMCO_ZBUF_SIZE;
+ res = deflate(&(co->u_co.zs), Z_NO_FLUSH);
+ switch (res) {
+ case Z_OK : {
+ used = DK4_STRMCO_ZBUF_SIZE - co->u_co.zs.avail_out;
+ if (0 < used) {
+ res = dk4strmco_co_oe(
+ co, &(co->zbuf[0]), used, NULL
+ );
+ if (0 < res) {
+ osz = sz - co->u_co.zs.avail_in;
+ }
+ else {
+ back = 0;
+ }
}
else {
- back = 0;
+ osz = sz - co->u_co.zs.avail_in;
}
- }
- else {
- osz = sz - co->u_co.zs.avail_in;
- }
- } break;
- default : {
- back = 0;
- } break;
- }
- } while ((0 < co->u_co.zs.avail_in) && (1 == back));
- if (NULL != szo) { *szo = osz; }
+ } break;
+ default : {
+ back = 0;
+ } break;
+ }
+ } while ((0 < co->u_co.zs.avail_in) && (1 == back));
+ if (NULL != szo) { *szo = osz; }
+ } else {
+ }
} break;
case DK4_STRMCO_CO_LZW : {
back = 1;
@@ -525,6 +577,9 @@ dk4strmco_co_write(
int back = 0; /* Function result */
int res; /* Result from various operations */
$? "+ dk4strmco_co_write"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
switch (co->pp) {
case DK4_STRMCO_PP_RUNLENGTH : {
$? ". run-length preprocessing"
@@ -588,11 +643,13 @@ dk4strmco_co_oe_close(compressor_t *co)
int back = 1;
int res = 0;
$? "+ dk4strmco_co_oe_close"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
switch (co->oe) {
case DK4_STRMCO_OE_ASCII85 : {
$? ". ASCII-85"
switch (dk4a85_enc_finish(&(co->u_oe.a85), NULL)) {
- $? ". handle final A85 data"
case DK4_EDSTM_FINISHED : {
if (0 < dk4a85_enc_output(&dptr,&sz,&(co->u_oe.a85),NULL)) {
if (0 < sz) {
@@ -675,6 +732,9 @@ dk4strmco_co_co_close(compressor_t *co)
int zres = Z_OK;
int res = 0;
$? "+ dk4strmco_co_co_close"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
switch (co->co) {
case DK4_STRMCO_CO_FLATE : {
$? ". flate compression used"
@@ -749,6 +809,9 @@ dk4strmco_co_pp_close(compressor_t *co)
int back = 1;
int res;
$? "+ dk4strmco_co_pp_close"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
switch (co->pp) {
case DK4_STRMCO_PP_RUNLENGTH : {
$? ". run-length preprocessing used"
@@ -790,6 +853,9 @@ dk4strmco_co_close(compressor_t *co)
{
int back = 1;
$? "+ dk4strmco_co_close"
+#if DK4_USE_ASSERT
+ assert(NULL != co);
+#endif
/* Flush preprocessor (run-length encoder).
*/
if (0 == dk4strmco_co_pp_close(co)) {
@@ -819,20 +885,29 @@ dk4strmco_co_close(compressor_t *co)
+static
void
dk4strmco_handler(dk4_stream_api_t *api)
{
compressor_t *co = NULL;
$? "+ dk4strmco_handler %d", api->cmd
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
co = (compressor_t *)(api->d);
switch (api->cmd) {
case DK4_STREAM_API_WRITE : { $? ". write"
- api->res = dk4strmco_co_write(
- co, api->b, api->sz_in, &(api->sz_out)
- );
+ if (0 < api->sz_in) {
+ api->res = dk4strmco_co_write(
+ co, api->b, api->sz_in, &(api->sz_out)
+ );
+ }
+ else {
+ api->res = 1;
+ }
} break;
case DK4_STREAM_API_FLUSH : { $? ". flush (ignored)"
/*
@@ -870,101 +945,110 @@ dk4strmco_open(
dk4_stream_t *back = NULL;
compressor_t *cc = NULL;
$? "+ dk4strmco_open"
- /* Allocate compressor and set up.
- */
- $? ". allocate memory"
- cc = dk4mem_new(compressor_t,1,erp);
- if (NULL != cc) {
- cc->dststrm = strm;
- cc->pp = pp;
- cc->co = co;
- cc->oe = oe;
- cc->fl = fl;
- cc->ll = 0;
- switch (pp) {
- case DK4_STRMCO_PP_RUNLENGTH : {
- $? ". initialize run-length encoder"
- dk4rle_init(
- &(cc->u_pp.rle),
- ((0 != (DK4_STRMCO_FL_EOD_PP & fl)) ? 1 : 0),
- erp
- );
- } break;
- default : {
- } break;
- }
- switch (co) {
- case DK4_STRMCO_CO_FLATE : {
- $? ". initialize flate compression"
- cc->u_co.zs.zalloc = Z_NULL;
- cc->u_co.zs.zfree = Z_NULL;
- cc->u_co.zs.opaque = Z_NULL;
- $? ". deflateInit"
- if (Z_OK != deflateInit(&(cc->u_co.zs), 9)) {
- $? ". release memory"
- dk4mem_free(cc);
- cc = NULL;
- $? "! failed to initialize flate compression"
- }
- } break;
- case DK4_STRMCO_CO_LZW : {
- $? ". initialize LZW compression"
- if (0 == dk4lzwe_init(&(cc->u_co.lzw), NULL)) {
- $? ". release memory"
- dk4mem_free(cc);
- cc = NULL;
- $? "! failed to initialize LZW compression"
- }
- } break;
- default : {
- } break;
- }
- switch (oe) {
- case DK4_STRMCO_OE_ASCII85 : {
- $? ". initialize ASCII-85 output encoding"
- dk4a85_enc_init(&(cc->u_oe.a85), 1, erp);
- } break;
- default : {
- } break;
- }
- }
-#if TRACE_DEBUG
- else { $? "! memory"
- }
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
#endif
-
- /* If the compressor was set up successfully, create stream.
- */
- if (NULL != cc) {
- $? ". create stream"
- back = dk4stream_open(cc,dk4strmco_handler,DK4_STREAM_WRITE,0,4096,erp);
- /*
- When failed to create stream, we must release the compressor.
+ if (NULL != strm) {
+ /* Allocate compressor and set up.
*/
- if (NULL == back) {
- /*
- Release dynamic resources assigned to components.
- */
- $? "! failed to create stream"
+ $? ". allocate memory"
+ cc = dk4mem_new(compressor_t,1,erp);
+ if (NULL != cc) {
+ cc->dststrm = strm;
+ cc->pp = pp;
+ cc->co = co;
+ cc->oe = oe;
+ cc->fl = fl;
+ cc->ll = 0;
+ switch (pp) {
+ case DK4_STRMCO_PP_RUNLENGTH : {
+ $? ". initialize run-length encoder"
+ dk4rle_init(
+ &(cc->u_pp.rle),
+ ((0 != (DK4_STRMCO_FL_EOD_PP & fl)) ? 1 : 0),
+ NULL
+ );
+ } break;
+ default : {
+ } break;
+ }
switch (co) {
case DK4_STRMCO_CO_FLATE : {
- $? ". deflateEnd"
- (void)deflateEnd(&(cc->u_co.zs));
+ $? ". initialize flate compression"
+ cc->u_co.zs.zalloc = Z_NULL;
+ cc->u_co.zs.zfree = Z_NULL;
+ cc->u_co.zs.opaque = Z_NULL;
+ $? ". deflateInit"
+ if (Z_OK != deflateInit(&(cc->u_co.zs), 9)) {
+ $? ". release memory"
+ dk4mem_free(cc);
+ cc = NULL;
+ $? "! failed to initialize flate compression"
+ }
} break;
case DK4_STRMCO_CO_LZW : {
- $? ". LZW finish"
- (void)dk4lzwe_finish(&(cc->u_co.lzw), NULL);
+ $? ". initialize LZW compression"
+ if (0 == dk4lzwe_init(&(cc->u_co.lzw), NULL)) {
+ $? ". release memory"
+ dk4mem_free(cc);
+ cc = NULL;
+ $? "! failed to initialize LZW compression"
+ }
+ } break;
+ default : {
+ } break;
+ }
+ switch (oe) {
+ case DK4_STRMCO_OE_ASCII85 : {
+ $? ". initialize ASCII-85 output encoding"
+ dk4a85_enc_init(&(cc->u_oe.a85), 1, NULL);
} break;
default : {
} break;
}
- $? ". release memory"
- dk4mem_free(cc);
}
#if TRACE_DEBUG
- else { $? ". stream created"
+ else { $? "! memory"
}
#endif
+ /* If the compressor was set up successfully, create stream.
+ */
+ if (NULL != cc) {
+ $? ". create stream"
+ back = dk4stream_open(
+ cc, dk4strmco_handler, DK4_STREAM_WRITE, 0, 4096, erp
+ );
+ /*
+ When failed to create stream, we must release the compressor.
+ */
+ if (NULL == back) {
+ /*
+ Release dynamic resources assigned to components.
+ */
+ $? "! failed to create stream"
+ switch (co) {
+ case DK4_STRMCO_CO_FLATE : {
+ $? ". deflateEnd"
+ (void)deflateEnd(&(cc->u_co.zs));
+ } break;
+ case DK4_STRMCO_CO_LZW : {
+ $? ". LZW finish"
+ (void)dk4lzwe_finish(&(cc->u_co.lzw), NULL);
+ } break;
+ default : {
+ } break;
+ }
+ $? ". release memory"
+ dk4mem_free(cc);
+ }
+#if TRACE_DEBUG
+ else { $? ". stream created"
+ }
+#endif
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
$? "- dk4strmco_open %d", TR_IPTR(back)
return back;
diff --git a/support/dktools/dk4strmco.h b/support/dktools/dk4strmco.h
index c698b3c9f9..f39034e633 100644
--- a/support/dktools/dk4strmco.h
+++ b/support/dktools/dk4strmco.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmco.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmco.ctr
*/
#ifndef DK4STRMCO_H_INCLUDED
@@ -65,15 +43,27 @@ stream.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
@@ -128,6 +118,15 @@ extern "C" {
@param fl Flags.
@param erp Error report, may be NULL.
@return Valid pointer to new stream on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the product of elsize and nelem,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
*/
dk4_stream_t *
dk4strmco_open(
diff --git a/support/dktools/dk4strmf.c b/support/dktools/dk4strmf.c
index e042de4e6c..e91626c4e9 100644
--- a/support/dktools/dk4strmf.c
+++ b/support/dktools/dk4strmf.c
@@ -1,45 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmf.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmf.ctr
*/
/** @file dk4strmf.c The dk4strmf module.
*/
-#line 105 "dk4strmf.ctr"
+#line 113 "dk4strmf.ctr"
+#include "dk4conf.h"
#include "dk4strmf.h"
#ifndef STDIO_H_INCLUDED
@@ -47,12 +26,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define STDIO_H_INCLUDED 1
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
void
dk4stream_file_with_close_function(dk4_stream_api_t *api)
{
FILE *fipo;
size_t res;
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -67,11 +56,15 @@ dk4stream_file_with_close_function(dk4_stream_api_t *api)
}
} break;
case DK4_STREAM_API_WRITE: {
- res = fwrite(api->b, 1, api->sz_in, fipo);
- if (res == api->sz_in) {
+ if (0 < api->sz_in) {
+ res = fwrite(api->b, 1, api->sz_in, fipo);
+ if (res == api->sz_in) {
+ api->res = 1;
+ }
+ api->sz_out = res;
+ } else {
api->res = 1;
}
- api->sz_out = res;
} break;
case DK4_STREAM_API_FLUSH: {
if (0 == fflush(fipo)) {
@@ -98,6 +91,9 @@ dk4stream_file_with_close_function(dk4_stream_api_t *api)
void
dk4stream_file_function(dk4_stream_api_t *api)
{
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
switch (api->cmd) {
case DK4_STREAM_API_CLOSE: {
@@ -122,6 +118,9 @@ dk4stream_open_for_file(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open( (void *)fipo, dk4stream_file_function, fl, ibs, obs, erp )
);
@@ -138,6 +137,9 @@ dk4stream_open_for_file_with_close(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open(
(void *)fipo, dk4stream_file_with_close_function, fl, ibs, obs, erp
diff --git a/support/dktools/dk4strmf.ctr b/support/dktools/dk4strmf.ctr
index 24851d08c3..8180acce80 100644
--- a/support/dktools/dk4strmf.ctr
+++ b/support/dktools/dk4strmf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,11 +16,19 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -47,7 +55,7 @@ dk4stream_file_with_close_function(dk4_stream_api_t *api);
/** Open a stream for an existing file.
@param fipo Existing file, not closed on dk4stream_close().
- @param fl Access flag: DK4_STREAM_READ,, DK4_STREAM_WRITE
+ @param fl Access flag: DK4_STREAM_READ, DK4_STREAM_WRITE
or (DK4_STREAM_READ | DK4_STREAM_WRITE).
@param ibs Input buffer size (0 for default).
@param obs Output buffer size (0 for default).
@@ -104,6 +112,7 @@ dk4stream_open_for_file_with_close(
%% module
+#include "dk4conf.h"
#include "dk4strmf.h"
#ifndef STDIO_H_INCLUDED
@@ -111,12 +120,22 @@ dk4stream_open_for_file_with_close(
#define STDIO_H_INCLUDED 1
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
void
dk4stream_file_with_close_function(dk4_stream_api_t *api)
{
FILE *fipo;
size_t res;
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -131,11 +150,15 @@ dk4stream_file_with_close_function(dk4_stream_api_t *api)
}
} break;
case DK4_STREAM_API_WRITE: {
- res = fwrite(api->b, 1, api->sz_in, fipo);
- if (res == api->sz_in) {
+ if (0 < api->sz_in) {
+ res = fwrite(api->b, 1, api->sz_in, fipo);
+ if (res == api->sz_in) {
+ api->res = 1;
+ }
+ api->sz_out = res;
+ } else {
api->res = 1;
}
- api->sz_out = res;
} break;
case DK4_STREAM_API_FLUSH: {
if (0 == fflush(fipo)) {
@@ -162,6 +185,9 @@ dk4stream_file_with_close_function(dk4_stream_api_t *api)
void
dk4stream_file_function(dk4_stream_api_t *api)
{
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
switch (api->cmd) {
case DK4_STREAM_API_CLOSE: {
@@ -186,6 +212,9 @@ dk4stream_open_for_file(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open( (void *)fipo, dk4stream_file_function, fl, ibs, obs, erp )
);
@@ -202,6 +231,9 @@ dk4stream_open_for_file_with_close(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open(
(void *)fipo, dk4stream_file_with_close_function, fl, ibs, obs, erp
diff --git a/support/dktools/dk4strmf.h b/support/dktools/dk4strmf.h
index d61962aadf..d3aba31cec 100644
--- a/support/dktools/dk4strmf.h
+++ b/support/dktools/dk4strmf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmf.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmf.ctr
*/
#ifndef DK4STRMF_H_INCLUDED
@@ -48,11 +26,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -79,7 +65,7 @@ dk4stream_file_with_close_function(dk4_stream_api_t *api);
/** Open a stream for an existing file.
@param fipo Existing file, not closed on dk4stream_close().
- @param fl Access flag: DK4_STREAM_READ,, DK4_STREAM_WRITE
+ @param fl Access flag: DK4_STREAM_READ, DK4_STREAM_WRITE
or (DK4_STREAM_READ | DK4_STREAM_WRITE).
@param ibs Input buffer size (0 for default).
@param obs Output buffer size (0 for default).
diff --git a/support/dktools/dk4strmg.c b/support/dktools/dk4strmg.c
index 3bfb99fa6f..d48617cd46 100644
--- a/support/dktools/dk4strmg.c
+++ b/support/dktools/dk4strmg.c
@@ -1,46 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmg.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmg.ctr
*/
/** @file dk4strmg.c The dk4strmg module.
*/
-#line 93 "dk4strmg.ctr"
+#line 101 "dk4strmg.ctr"
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_ZLIB_H
#include "dk4strm.h"
@@ -53,6 +38,9 @@ dk4stream_gzfile_with_close_function(dk4_stream_api_t *api)
{
gzFile fipo;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -67,12 +55,16 @@ dk4stream_gzfile_with_close_function(dk4_stream_api_t *api)
}
} break;
case DK4_STREAM_API_WRITE: {
- res = gzwrite(fipo, api->b, (int)(api->sz_in));
- if (res == (int)(api->sz_in)) {
+ if (0 < api->sz_in) {
+ res = gzwrite(fipo, api->b, (int)(api->sz_in));
+ if (res == (int)(api->sz_in)) {
+ api->res = 1;
+ }
+ if (0 <= res) { api->sz_out = (size_t)res; }
+ else { api->sz_out = 0; }
+ } else {
api->res = 1;
}
- if (0 <= res) { api->sz_out = (size_t)res; }
- else { api->sz_out = 0; }
} break;
case DK4_STREAM_API_FLUSH: {
if (Z_OK == gzflush(fipo, Z_FULL_FLUSH)) {
@@ -100,6 +92,9 @@ dk4stream_gzfile_with_close_function(dk4_stream_api_t *api)
void
dk4stream_gzfile_function(dk4_stream_api_t *api)
{
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
switch (api->cmd) {
case DK4_STREAM_API_CLOSE: {
@@ -123,6 +118,9 @@ dk4stream_open_for_gzfile(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open( (void *)fipo, dk4stream_gzfile_function, fl, ibs, obs, erp )
);
@@ -139,6 +137,9 @@ dk4stream_open_for_gzfile_with_close(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open(
(void *)fipo, dk4stream_gzfile_with_close_function, fl, ibs, obs, erp
diff --git a/support/dktools/dk4strmg.ctr b/support/dktools/dk4strmg.ctr
index 31678d0be3..5dd5fcd74f 100644
--- a/support/dktools/dk4strmg.ctr
+++ b/support/dktools/dk4strmg.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,13 +16,21 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_ZLIB_H
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef ZLIB_H_INCLUDED
@@ -93,6 +101,13 @@ dk4stream_open_for_gzfile_with_close(
#include "dk4conf.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#if DK4_HAVE_ZLIB_H
#include "dk4strm.h"
@@ -105,6 +120,9 @@ dk4stream_gzfile_with_close_function(dk4_stream_api_t *api)
{
gzFile fipo;
int res;
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
api->res = 0;
api->sz_out = 0;
@@ -119,12 +137,16 @@ dk4stream_gzfile_with_close_function(dk4_stream_api_t *api)
}
} break;
case DK4_STREAM_API_WRITE: {
- res = gzwrite(fipo, api->b, (int)(api->sz_in));
- if (res == (int)(api->sz_in)) {
+ if (0 < api->sz_in) {
+ res = gzwrite(fipo, api->b, (int)(api->sz_in));
+ if (res == (int)(api->sz_in)) {
+ api->res = 1;
+ }
+ if (0 <= res) { api->sz_out = (size_t)res; }
+ else { api->sz_out = 0; }
+ } else {
api->res = 1;
}
- if (0 <= res) { api->sz_out = (size_t)res; }
- else { api->sz_out = 0; }
} break;
case DK4_STREAM_API_FLUSH: {
if (Z_OK == gzflush(fipo, Z_FULL_FLUSH)) {
@@ -152,6 +174,9 @@ dk4stream_gzfile_with_close_function(dk4_stream_api_t *api)
void
dk4stream_gzfile_function(dk4_stream_api_t *api)
{
+#if DK4_USE_ASSERT
+ assert(NULL != api);
+#endif
if (NULL != api) {
switch (api->cmd) {
case DK4_STREAM_API_CLOSE: {
@@ -175,6 +200,9 @@ dk4stream_open_for_gzfile(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open( (void *)fipo, dk4stream_gzfile_function, fl, ibs, obs, erp )
);
@@ -191,6 +219,9 @@ dk4stream_open_for_gzfile_with_close(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
return (
dk4stream_open(
(void *)fipo, dk4stream_gzfile_with_close_function, fl, ibs, obs, erp
diff --git a/support/dktools/dk4strmg.h b/support/dktools/dk4strmg.h
index e506bab3c9..6fd6fbbee0 100644
--- a/support/dktools/dk4strmg.h
+++ b/support/dktools/dk4strmg.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmg.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmg.ctr
*/
#ifndef DK4STRMG_H_INCLUDED
@@ -48,13 +26,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_HAVE_ZLIB_H
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef ZLIB_H_INCLUDED
diff --git a/support/dktools/dk4strmh.c b/support/dktools/dk4strmh.c
index 5fbc629c9c..a2edca00d9 100644
--- a/support/dktools/dk4strmh.c
+++ b/support/dktools/dk4strmh.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmh.ctr
*/
/** @file dk4strmh.c The dk4strmh module.
*/
-#line 112 "dk4strmh.ctr"
+#line 128 "dk4strmh.ctr"
#include "dk4conf.h"
@@ -85,17 +63,21 @@ dk4stream_windows_handle_static_function(dk4_stream_api_t *api, int wc)
}
} break;
case DK4_STREAM_API_WRITE : {
- if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)(api->sz_in)) {
- dwi = (DWORD)(api->sz_in);
- dwo = (DWORD)0UL;
- if (WriteFile(sh->ha, api->b, dwi, &dwo, NULL)) {
- api->sz_out = dwo;
- if (dwo == dwi) {
- api->res = 1;
+ if (0 < api->sz_in) {
+ if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)(api->sz_in)) {
+ dwi = (DWORD)(api->sz_in);
+ dwo = (DWORD)0UL;
+ if (WriteFile(sh->ha, api->b, dwi, &dwo, NULL)) {
+ api->sz_out = dwo;
+ if (dwo == dwi) {
+ api->res = 1;
+ }
}
+ } else {
+ /* ERROR: Size too large */
}
} else {
- /* ERROR: Size too large */
+ api->res = 1;
}
} break;
case DK4_STREAM_API_FLUSH : {
diff --git a/support/dktools/dk4strmh.ctr b/support/dktools/dk4strmh.ctr
index 05df699e2f..cddea77248 100644
--- a/support/dktools/dk4strmh.ctr
+++ b/support/dktools/dk4strmh.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,13 +14,21 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_ON_WINDOWS
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WINDOWS_H_INCLUDED
@@ -29,11 +37,19 @@ license = bsd
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -156,17 +172,21 @@ dk4stream_windows_handle_static_function(dk4_stream_api_t *api, int wc)
}
} break;
case DK4_STREAM_API_WRITE : {
- if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)(api->sz_in)) {
- dwi = (DWORD)(api->sz_in);
- dwo = (DWORD)0UL;
- if (WriteFile(sh->ha, api->b, dwi, &dwo, NULL)) {
- api->sz_out = dwo;
- if (dwo == dwi) {
- api->res = 1;
+ if (0 < api->sz_in) {
+ if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)(api->sz_in)) {
+ dwi = (DWORD)(api->sz_in);
+ dwo = (DWORD)0UL;
+ if (WriteFile(sh->ha, api->b, dwi, &dwo, NULL)) {
+ api->sz_out = dwo;
+ if (dwo == dwi) {
+ api->res = 1;
+ }
}
+ } else {
+ /* ERROR: Size too large */
}
} else {
- /* ERROR: Size too large */
+ api->res = 1;
}
} break;
case DK4_STREAM_API_FLUSH : {
diff --git a/support/dktools/dk4strmh.h b/support/dktools/dk4strmh.h
index f107ae4fd8..495837cd6c 100644
--- a/support/dktools/dk4strmh.h
+++ b/support/dktools/dk4strmh.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmh.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmh.ctr
*/
#ifndef DK4STRMH_H_INCLUDED
@@ -46,13 +24,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#if DK4_ON_WINDOWS
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WINDOWS_H_INCLUDED
@@ -61,11 +47,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
diff --git a/support/dktools/dk4strmo08.c b/support/dktools/dk4strmo08.c
index bf665e9e2f..12b5be416e 100644
--- a/support/dktools/dk4strmo08.c
+++ b/support/dktools/dk4strmo08.c
@@ -1,50 +1,44 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmo08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmo08.ctr
*/
/** @file dk4strmo08.c The dk4strmo08 module.
*/
-#line 51 "dk4strmo08.ctr"
+#line 65 "dk4strmo08.ctr"
+#include "dk4conf.h"
#include "dk4strm.h"
+#include "dk4strmo08.h"
#include "dk4strmo32.h"
#include "dk4enc.h"
#include "dk4ansi.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 83 "dk4strmo08.ctr"
+
+
+
int
dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp)
{
@@ -53,11 +47,15 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp)
int back = 0;
char c;
unsigned char uc;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != txt);
+#endif
if ((NULL != strm) && (NULL != txt)) {
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
switch (ie) {
- case DK4_ENCODING_ASCII:
- case DK4_ENCODING_ANSI:
+ case DK4_ENCODING_PLAIN:
+ case DK4_ENCODING_WIN1252:
case DK4_ENCODING_UTF8:
{
if (strm->oenc == ie) {
@@ -69,7 +67,7 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp)
}
} else {
switch (ie) {
- case DK4_ENCODING_ASCII: {
+ case DK4_ENCODING_PLAIN: {
back = 1;
while (('\0' != *txt) && (1 == back)) {
c = *(txt++);
@@ -80,7 +78,7 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp)
}
}
} break;
- case DK4_ENCODING_ANSI: {
+ case DK4_ENCODING_WIN1252: {
back = 1;
while (('\0' != *txt) && (1 == back)) {
if (0 != dk4ansi_decode(&c32, (unsigned char)(*(txt++)))) {
diff --git a/support/dktools/dk4strmo08.ctr b/support/dktools/dk4strmo08.ctr
index 02929a7042..b1880c47f1 100644
--- a/support/dktools/dk4strmo08.ctr
+++ b/support/dktools/dk4strmo08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,7 +15,21 @@ license = bsd
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
#ifdef __cplusplus
extern "C" {
@@ -49,12 +63,26 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4strm.h"
+#include "dk4strmo08.h"
#include "dk4strmo32.h"
#include "dk4enc.h"
#include "dk4ansi.h"
#include "dk4utf8.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
int
dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp)
{
@@ -63,11 +91,15 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp)
int back = 0;
char c;
unsigned char uc;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != txt);
+#endif
if ((NULL != strm) && (NULL != txt)) {
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
switch (ie) {
- case DK4_ENCODING_ASCII:
- case DK4_ENCODING_ANSI:
+ case DK4_ENCODING_PLAIN:
+ case DK4_ENCODING_WIN1252:
case DK4_ENCODING_UTF8:
{
if (strm->oenc == ie) {
@@ -79,7 +111,7 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp)
}
} else {
switch (ie) {
- case DK4_ENCODING_ASCII: {
+ case DK4_ENCODING_PLAIN: {
back = 1;
while (('\0' != *txt) && (1 == back)) {
c = *(txt++);
@@ -90,7 +122,7 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp)
}
}
} break;
- case DK4_ENCODING_ANSI: {
+ case DK4_ENCODING_WIN1252: {
back = 1;
while (('\0' != *txt) && (1 == back)) {
if (0 != dk4ansi_decode(&c32, (unsigned char)(*(txt++)))) {
diff --git a/support/dktools/dk4strmo08.h b/support/dktools/dk4strmo08.h
index 1cb54927df..a39b081562 100644
--- a/support/dktools/dk4strmo08.h
+++ b/support/dktools/dk4strmo08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmo08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmo08.ctr
*/
#ifndef DK4STRMO08_H_INCLUDED
@@ -47,7 +25,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4strmo16.c b/support/dktools/dk4strmo16.c
index 9afb4d709e..01862f8726 100644
--- a/support/dktools/dk4strmo16.c
+++ b/support/dktools/dk4strmo16.c
@@ -1,49 +1,36 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmo16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmo16.ctr
*/
/** @file dk4strmo16.c The dk4strmo16 module.
*/
-#line 53 "dk4strmo16.ctr"
+#line 74 "dk4strmo16.ctr"
+#include "dk4conf.h"
#include "dk4strmo16.h"
#include "dk4strmo32.h"
#include "dk4enc.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4stream_c16_puts(dk4_stream_t *strm, const dk4_c16_t *txt, dk4_er_t *erp)
@@ -53,6 +40,10 @@ dk4stream_c16_puts(dk4_stream_t *strm, const dk4_c16_t *txt, dk4_er_t *erp)
dk4_c32_t c32;
int back = 0;
char c8;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != txt);
+#endif
if ((NULL != strm) && (NULL != txt)) {
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
switch (strm->oenc) {
diff --git a/support/dktools/dk4strmo16.ctr b/support/dktools/dk4strmo16.ctr
index f7a562c26d..e2c75d9973 100644
--- a/support/dktools/dk4strmo16.ctr
+++ b/support/dktools/dk4strmo16.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,9 +15,30 @@ license = bsd
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -51,11 +72,20 @@ dk4stream_c16_puts(dk4_stream_t *strm, const dk4_c16_t *txt, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4strmo16.h"
#include "dk4strmo32.h"
#include "dk4enc.h"
#include "dk4utf16.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
dk4stream_c16_puts(dk4_stream_t *strm, const dk4_c16_t *txt, dk4_er_t *erp)
@@ -65,6 +95,10 @@ dk4stream_c16_puts(dk4_stream_t *strm, const dk4_c16_t *txt, dk4_er_t *erp)
dk4_c32_t c32;
int back = 0;
char c8;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != txt);
+#endif
if ((NULL != strm) && (NULL != txt)) {
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
switch (strm->oenc) {
diff --git a/support/dktools/dk4strmo16.h b/support/dktools/dk4strmo16.h
index c5a5ab626f..62a57db14e 100644
--- a/support/dktools/dk4strmo16.h
+++ b/support/dktools/dk4strmo16.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmo16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmo16.ctr
*/
#ifndef DK4STRMO16_H_INCLUDED
@@ -47,9 +25,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4strmo32.c b/support/dktools/dk4strmo32.c
index e2417e7cab..83ba2a9290 100644
--- a/support/dktools/dk4strmo32.c
+++ b/support/dktools/dk4strmo32.c
@@ -1,56 +1,42 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmo32.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmo32.ctr
*/
/** @file dk4strmo32.c The dk4strmo32 module.
*/
-#line 95 "dk4strmo32.ctr"
+#line 110 "dk4strmo32.ctr"
+#include "dk4conf.h"
#include "dk4strmo32.h"
#include "dk4mem.h"
#include "dk4ansi.h"
#include "dk4utf8.h"
#include "dk4utf16.h"
#include "dk4enc.h"
+#include "dk4rec26.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 106 "dk4strmo32.ctr"
+#line 129 "dk4strmo32.ctr"
@@ -59,11 +45,14 @@ dk4stream_set_output_encoding(dk4_stream_t *strm, int oe)
{
-#line 113 "dk4strmo32.ctr"
+#line 136 "dk4strmo32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
switch (oe) {
- case DK4_FILE_ENCODING_ASCII:
- case DK4_FILE_ENCODING_ANSI:
+ case DK4_FILE_ENCODING_PLAIN:
+ case DK4_FILE_ENCODING_WIN1252:
case DK4_FILE_ENCODING_UTF8:
case DK4_FILE_ENCODING_UTF16_LE:
case DK4_FILE_ENCODING_UTF16_BE:
@@ -75,7 +64,7 @@ dk4stream_set_output_encoding(dk4_stream_t *strm, int oe)
}
}
-#line 127 "dk4strmo32.ctr"
+#line 153 "dk4strmo32.ctr"
}
@@ -89,26 +78,29 @@ dk4stream_c32_putc(dk4_stream_t *strm, dk4_c32_t c32, dk4_er_t *erp)
int back = 0;
-#line 139 "dk4strmo32.ctr"
+#line 165 "dk4strmo32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
-#line 140 "dk4strmo32.ctr"
+#line 169 "dk4strmo32.ctr"
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
-#line 141 "dk4strmo32.ctr"
+#line 170 "dk4strmo32.ctr"
switch (strm->oenc) {
- case DK4_FILE_ENCODING_ASCII: {
+ case DK4_FILE_ENCODING_PLAIN: {
-#line 143 "dk4strmo32.ctr"
+#line 172 "dk4strmo32.ctr"
if (dkC32(0x00000100) > c32) {
back = dk4stream_write_byte(strm, (unsigned char)c32, erp);
} else {
dk4error_set_simple_error_code(erp, DK4_E_ENCODING_FAILED);
}
} break;
- case DK4_FILE_ENCODING_ANSI: {
+ case DK4_FILE_ENCODING_WIN1252: {
-#line 150 "dk4strmo32.ctr"
+#line 179 "dk4strmo32.ctr"
if (0 != dk4ansi_encode(buf, c32)) {
back = dk4stream_write_byte(strm, buf[0], erp);
} else {
@@ -117,7 +109,7 @@ dk4stream_c32_putc(dk4_stream_t *strm, dk4_c32_t c32, dk4_er_t *erp)
} break;
case DK4_FILE_ENCODING_UTF8: {
-#line 157 "dk4strmo32.ctr"
+#line 186 "dk4strmo32.ctr"
sz = sizeof(buf);
if (0 != dk4utf8_encode(buf, &sz, c32, NULL)) {
back = dk4stream_write(strm, (void *)buf, sz, erp);
@@ -127,29 +119,29 @@ dk4stream_c32_putc(dk4_stream_t *strm, dk4_c32_t c32, dk4_er_t *erp)
} break;
case DK4_FILE_ENCODING_UTF16_LE: {
-#line 165 "dk4strmo32.ctr"
+#line 194 "dk4strmo32.ctr"
sz = DK4_SIZEOF(b16,dk4_c16_t);
if (0 != dk4utf16_encode(b16, &sz, c32, erp)) {
-#line 167 "dk4strmo32.ctr"
+#line 196 "dk4strmo32.ctr"
if ((1 == sz) || (2 == sz)) {
buf[0] = (unsigned char)( b16[0] & 0x00FF);
buf[1] = (unsigned char)((b16[0] >> 8) & 0x00FF);
if (2 == sz) {
-#line 171 "dk4strmo32.ctr"
+#line 200 "dk4strmo32.ctr"
buf[2] = (unsigned char)( b16[1] & 0x00FF);
buf[3] = (unsigned char)((b16[1] >> 8) & 0x00FF);
-#line 174 "dk4strmo32.ctr"
+#line 203 "dk4strmo32.ctr"
back = dk4stream_write(strm, (void *)buf, 4, erp);
} else {
-#line 176 "dk4strmo32.ctr"
+#line 205 "dk4strmo32.ctr"
-#line 177 "dk4strmo32.ctr"
+#line 206 "dk4strmo32.ctr"
back = dk4stream_write(strm, (void *)buf, 2, erp);
}
} else {
@@ -157,45 +149,45 @@ dk4stream_c32_putc(dk4_stream_t *strm, dk4_c32_t c32, dk4_er_t *erp)
}
} else {
-#line 183 "dk4strmo32.ctr"
+#line 212 "dk4strmo32.ctr"
dk4error_set_simple_error_code(erp, DK4_E_ENCODING_FAILED);
}
} break;
case DK4_FILE_ENCODING_UTF16_BE: {
-#line 187 "dk4strmo32.ctr"
+#line 216 "dk4strmo32.ctr"
sz = DK4_SIZEOF(b16,dk4_c16_t);
if (0 != dk4utf16_encode(b16, &sz, c32, erp)) {
-#line 189 "dk4strmo32.ctr"
+#line 218 "dk4strmo32.ctr"
if ((1 == sz) || (2 == sz)) {
buf[1] = (unsigned char)( b16[0] & 0x00FF);
buf[0] = (unsigned char)((b16[0] >> 8) & 0x00FF);
if (2 == sz) {
-#line 193 "dk4strmo32.ctr"
+#line 222 "dk4strmo32.ctr"
buf[3] = (unsigned char)( b16[1] & 0x00FF);
buf[2] = (unsigned char)((b16[1] >> 8) & 0x00FF);
back = dk4stream_write(strm, (void *)buf, 4, erp);
} else {
-#line 197 "dk4strmo32.ctr"
+#line 226 "dk4strmo32.ctr"
back = dk4stream_write(strm, (void *)buf, 2, erp);
}
} else {
-#line 200 "dk4strmo32.ctr"
+#line 229 "dk4strmo32.ctr"
dk4error_set_simple_error_code(erp, DK4_E_ENCODING_FAILED);
}
} else {
-#line 203 "dk4strmo32.ctr"
+#line 232 "dk4strmo32.ctr"
dk4error_set_simple_error_code(erp, DK4_E_ENCODING_FAILED);
}
} break;
case DK4_FILE_ENCODING_32_LE: {
-#line 207 "dk4strmo32.ctr"
+#line 236 "dk4strmo32.ctr"
buf[0] = (unsigned char)( c32 & dkC32(0x000000FF));
buf[1] = (unsigned char)((c32 >> 8) & dkC32(0x000000FF));
buf[2] = (unsigned char)((c32 >> 16) & dkC32(0x000000FF));
@@ -204,7 +196,7 @@ dk4stream_c32_putc(dk4_stream_t *strm, dk4_c32_t c32, dk4_er_t *erp)
} break;
case DK4_FILE_ENCODING_32_BE: {
-#line 214 "dk4strmo32.ctr"
+#line 243 "dk4strmo32.ctr"
buf[3] = (unsigned char)( c32 & dkC32(0x000000FF));
buf[2] = (unsigned char)((c32 >> 8) & dkC32(0x000000FF));
buf[1] = (unsigned char)((c32 >> 16) & dkC32(0x000000FF));
@@ -222,7 +214,7 @@ dk4stream_c32_putc(dk4_stream_t *strm, dk4_c32_t c32, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 230 "dk4strmo32.ctr"
+#line 259 "dk4strmo32.ctr"
return back;
}
@@ -232,6 +224,10 @@ int
dk4stream_c32_puts(dk4_stream_t *strm, const dk4_c32_t *txt, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != txt);
+#endif
if ((NULL != strm) && (NULL != txt)) {
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
back = 1;
@@ -257,7 +253,10 @@ dk4stream_write_bom_if_necessary(dk4_stream_t *strm, dk4_er_t *erp)
int back = 0;
-#line 263 "dk4strmo32.ctr"
+#line 296 "dk4strmo32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
switch (strm->oenc) {
@@ -276,7 +275,7 @@ dk4stream_write_bom_if_necessary(dk4_stream_t *strm, dk4_er_t *erp)
case DK4_FILE_ENCODING_32_BE:
{
-#line 280 "dk4strmo32.ctr"
+#line 316 "dk4strmo32.ctr"
back = dk4stream_c32_putc(strm, dkC32(0x0000FEFF), erp);
} break;
default: {
@@ -290,7 +289,7 @@ dk4stream_write_bom_if_necessary(dk4_stream_t *strm, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 292 "dk4strmo32.ctr"
+#line 328 "dk4strmo32.ctr"
return back;
}
diff --git a/support/dktools/dk4strmo32.ctr b/support/dktools/dk4strmo32.ctr
index 8a1037aaa5..86ab956722 100644
--- a/support/dktools/dk4strmo32.ctr
+++ b/support/dktools/dk4strmo32.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,7 +14,22 @@ license = bsd
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -93,13 +108,21 @@ dk4stream_write_bom_if_necessary(dk4_stream_t *strm, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4strmo32.h"
#include "dk4mem.h"
#include "dk4ansi.h"
#include "dk4utf8.h"
#include "dk4utf16.h"
#include "dk4enc.h"
+#include "dk4rec26.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -110,10 +133,13 @@ void
dk4stream_set_output_encoding(dk4_stream_t *strm, int oe)
{
$? "+ dk4stream_set_output_encoding %d", oe
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
switch (oe) {
- case DK4_FILE_ENCODING_ASCII:
- case DK4_FILE_ENCODING_ANSI:
+ case DK4_FILE_ENCODING_PLAIN:
+ case DK4_FILE_ENCODING_WIN1252:
case DK4_FILE_ENCODING_UTF8:
case DK4_FILE_ENCODING_UTF16_LE:
case DK4_FILE_ENCODING_UTF16_BE:
@@ -135,18 +161,21 @@ dk4stream_c32_putc(dk4_stream_t *strm, dk4_c32_t c32, dk4_er_t *erp)
dk4_c16_t b16[4];
size_t sz;
int back = 0;
- $? "+ dk4stream_c32_putc %lx", (unsigned long)c32
+ $? "+ dk4stream_c32_putc %lx", dk4recode_dk_to_ul(c32)
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) { $? ". stream ok"
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) { $? ". wr flag ok"
switch (strm->oenc) {
- case DK4_FILE_ENCODING_ASCII: { $? ". ASCII"
+ case DK4_FILE_ENCODING_PLAIN: { $? ". ASCII"
if (dkC32(0x00000100) > c32) {
back = dk4stream_write_byte(strm, (unsigned char)c32, erp);
} else {
dk4error_set_simple_error_code(erp, DK4_E_ENCODING_FAILED);
}
} break;
- case DK4_FILE_ENCODING_ANSI: { $? ". ANSI"
+ case DK4_FILE_ENCODING_WIN1252: { $? ". ANSI"
if (0 != dk4ansi_encode(buf, c32)) {
back = dk4stream_write_byte(strm, buf[0], erp);
} else {
@@ -236,6 +265,10 @@ int
dk4stream_c32_puts(dk4_stream_t *strm, const dk4_c32_t *txt, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != txt);
+#endif
if ((NULL != strm) && (NULL != txt)) {
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
back = 1;
@@ -260,6 +293,9 @@ dk4stream_write_bom_if_necessary(dk4_stream_t *strm, dk4_er_t *erp)
{
int back = 0;
$? "+ dk4stream_write_bom_if_necessary"
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if (0 != ((strm->fl) & DK4_STREAM_WRITE)) {
switch (strm->oenc) {
diff --git a/support/dktools/dk4strmo32.h b/support/dktools/dk4strmo32.h
index efdcdb9fd8..487878678f 100644
--- a/support/dktools/dk4strmo32.h
+++ b/support/dktools/dk4strmo32.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmo32.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmo32.ctr
*/
#ifndef DK4STRMO32_H_INCLUDED
@@ -47,7 +25,22 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4strmodk.c b/support/dktools/dk4strmodk.c
index ec591fe457..5ccf1989a0 100644
--- a/support/dktools/dk4strmodk.c
+++ b/support/dktools/dk4strmodk.c
@@ -1,53 +1,58 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmodk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmodk.ctr
*/
/** @file dk4strmodk.c The dk4strmodk module.
*/
-#line 53 "dk4strmodk.ctr"
+#line 74 "dk4strmodk.ctr"
+#include "dk4conf.h"
#include "dk4strmodk.h"
#include "dk4strmo32.h"
#include "dk4strmo16.h"
#include "dk4strmo08.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
-dk4stream_dk_puts(dk4_stream_t *strm, const dkChar *txt, int ie, dk4_er_t *erp)
+dk4stream_dk_puts(
+ dk4_stream_t *strm,
+ const dkChar *txt,
+#if 1 == DK4_CHAR_SIZE
+ int ie,
+#else
+ int DK4_ARG_UNUSED(ie),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(ie)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != txt);
+#endif
+#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4stream_c32_puts(strm, txt, erp));
#else
diff --git a/support/dktools/dk4strmodk.ctr b/support/dktools/dk4strmodk.ctr
index 3ac8e5a8e4..601e839b8f 100644
--- a/support/dktools/dk4strmodk.ctr
+++ b/support/dktools/dk4strmodk.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,9 +15,30 @@ license = bsd
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -51,15 +72,42 @@ dk4stream_dk_puts(dk4_stream_t *strm, const dkChar *txt, int ie, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4strmodk.h"
#include "dk4strmo32.h"
#include "dk4strmo16.h"
#include "dk4strmo08.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
int
-dk4stream_dk_puts(dk4_stream_t *strm, const dkChar *txt, int ie, dk4_er_t *erp)
+dk4stream_dk_puts(
+ dk4_stream_t *strm,
+ const dkChar *txt,
+#if 1 == DK4_CHAR_SIZE
+ int ie,
+#else
+ int DK4_ARG_UNUSED(ie),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(ie)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != txt);
+#endif
+#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4stream_c32_puts(strm, txt, erp));
#else
diff --git a/support/dktools/dk4strmodk.h b/support/dktools/dk4strmodk.h
index e1b526f5e0..7a458b8070 100644
--- a/support/dktools/dk4strmodk.h
+++ b/support/dktools/dk4strmodk.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmodk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmodk.ctr
*/
#ifndef DK4STRMODK_H_INCLUDED
@@ -47,9 +25,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
+#endif
+
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/dk4strmr.c b/support/dktools/dk4strmr.c
index 482885711b..1786f4fa83 100644
--- a/support/dktools/dk4strmr.c
+++ b/support/dktools/dk4strmr.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmr.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmr.ctr
*/
/** @file dk4strmr.c The dk4strmr module.
*/
-#line 69 "dk4strmr.ctr"
+#line 97 "dk4strmr.ctr"
#include "dk4conf.h"
@@ -51,6 +29,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4strmr.h"
#ifndef DK4FD_H_INCLUDED
@@ -73,7 +58,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 103 "dk4strmr.ctr"
+#line 138 "dk4strmr.ctr"
@@ -92,7 +77,7 @@ dkT(".svgz"),
NULL
-#line 114 "dk4strmr.ctr"
+#line 149 "dk4strmr.ctr"
};
@@ -128,23 +113,26 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp)
#endif
-#line 148 "dk4strmr.ctr"
+#line 183 "dk4strmr.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
p1 = dk4path_get_suffix(filename, erp);
if (NULL != p1) {
-#line 151 "dk4strmr.ctr"
+#line 189 "dk4strmr.ctr"
coi = dk4str_array_index(
dk4strmr_co_su, p1, DK4_HAVE_CASE_INSENSITIVE_PATHNAMES
);
if (0 > coi) coi = -1;
-#line 155 "dk4strmr.ctr"
+#line 193 "dk4strmr.ctr"
}
if (0 != dk4fopen_check(filename, 0, DK4_FOPEN_SC_IS_REGULAR, erp)) {
-#line 158 "dk4strmr.ctr"
+#line 196 "dk4strmr.ctr"
switch (coi) {
case 1: {
#if DK4_HAVE_BZLIB_H && (!(DK4_ON_WINDOWS && DK4_WIN_DENY_CRT))
@@ -152,7 +140,7 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp)
/* +++++ bzip2, wchar_t */
-#line 164 "dk4strmr.ctr"
+#line 202 "dk4strmr.ctr"
fd = dk4fd_wc_open(filename, (DK4_O_RDONLY | DK4_O_BINARY), erp);
if (-1 < fd) {
bzf = BZ2_bzdopen(fd, dk4strmr_c8_mode);
@@ -175,7 +163,7 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp)
/* +++++ bzip2, char */
-#line 185 "dk4strmr.ctr"
+#line 223 "dk4strmr.ctr"
bzf = BZ2_bzopen(filename, dk4strmr_c8_mode);
if (NULL != bzf) {
back = dk4stream_open_for_bzfile_with_close(
@@ -195,12 +183,12 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp)
} break;
case 0: case 2: {
-#line 203 "dk4strmr.ctr"
+#line 241 "dk4strmr.ctr"
#if DK4_HAVE_ZLIB_H && (!(DK4_ON_WINDOWS && DK4_WIN_DENY_CRT))
#if DK4_CHAR_SIZE > 1
-#line 206 "dk4strmr.ctr"
+#line 244 "dk4strmr.ctr"
/* +++++ gzip, wchar_t */
fd = dk4fd_wc_open(filename, (DK4_O_RDONLY | DK4_O_BINARY), erp);
if (-1 < fd) {
@@ -221,7 +209,7 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp)
#else
-#line 225 "dk4strmr.ctr"
+#line 263 "dk4strmr.ctr"
/* +++++ gzip, char */
gzf = gzopen(filename, dk4strmr_c8_mode);
if (NULL != gzf) {
@@ -242,7 +230,7 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp)
} break;
default: {
-#line 244 "dk4strmr.ctr"
+#line 282 "dk4strmr.ctr"
#if DK4_ON_WINDOWS && DK4_WIN_DENY_CRT
dwattr = FILE_ATTRIBUTE_NORMAL;
dwattr |= FILE_FLAG_BACKUP_SEMANTICS;
@@ -274,34 +262,34 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp)
);
if (NULL != fipo) {
-#line 274 "dk4strmr.ctr"
+#line 312 "dk4strmr.ctr"
back = dk4stream_open_for_file_with_close(
fipo, DK4_STREAM_READ, 4096, 1024, erp
);
if (NULL == back) {
-#line 278 "dk4strmr.ctr"
+#line 316 "dk4strmr.ctr"
(void)fclose(fipo);
}
} else {
-#line 281 "dk4strmr.ctr"
+#line 319 "dk4strmr.ctr"
}
#endif
-#line 284 "dk4strmr.ctr"
+#line 322 "dk4strmr.ctr"
} break;
}
} else {
-#line 287 "dk4strmr.ctr"
+#line 325 "dk4strmr.ctr"
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 291 "dk4strmr.ctr"
+#line 329 "dk4strmr.ctr"
return back;
}
diff --git a/support/dktools/dk4strmr.ctr b/support/dktools/dk4strmr.ctr
index 2cdba61daf..20a43072a6 100644
--- a/support/dktools/dk4strmr.ctr
+++ b/support/dktools/dk4strmr.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -12,31 +12,59 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4STRMF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmf.h"
+#else
+#include <dktools-4/dk4strmf.h>
+#endif
#endif
#ifndef DK4STRMG_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmg.h"
+#else
+#include <dktools-4/dk4strmg.h>
+#endif
#endif
#ifndef DK4STRMB_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmb.h"
+#else
+#include <dktools-4/dk4strmb.h>
+#endif
#endif
@@ -79,6 +107,13 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4strmr.h"
#ifndef DK4FD_H_INCLUDED
@@ -145,6 +180,9 @@ dk4stream_open_file_reader(const dkChar *filename, dk4_er_t *erp)
int fd = -1; /* File descriptor */
#endif
$? "+ dk4stream_open_file_reader \"%!ds\"", filename
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
p1 = dk4path_get_suffix(filename, erp);
if (NULL != p1) { $? ". file name suffix \"%!ds\"", p1
diff --git a/support/dktools/dk4strmr.h b/support/dktools/dk4strmr.h
index eb6e30dee5..be2160c7bb 100644
--- a/support/dktools/dk4strmr.h
+++ b/support/dktools/dk4strmr.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmr.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmr.ctr
*/
#ifndef DK4STRMR_H_INCLUDED
@@ -45,31 +23,59 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4STRMF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmf.h"
+#else
+#include <dktools-4/dk4strmf.h>
+#endif
#endif
#ifndef DK4STRMG_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmg.h"
+#else
+#include <dktools-4/dk4strmg.h>
+#endif
#endif
#ifndef DK4STRMB_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmb.h"
+#else
+#include <dktools-4/dk4strmb.h>
+#endif
#endif
diff --git a/support/dktools/dk4strms.c b/support/dktools/dk4strms.c
index a96e3a350c..2c5a50fde0 100644
--- a/support/dktools/dk4strms.c
+++ b/support/dktools/dk4strms.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strms.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strms.ctr
*/
/** @file dk4strms.c The dk4strms module.
*/
-#line 226 "dk4strms.ctr"
+#line 242 "dk4strms.ctr"
#include "dk4conf.h"
@@ -51,11 +29,23 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if DK4_HAVE_MATH_H
#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4strms.h"
#include "dk4mao8dbl.h"
@@ -65,7 +55,9 @@ dk4stream_serialize_u32(dk4_stream_t *strm, uint32_t u32, dk4_er_t *erp)
{
unsigned char buf[8];
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
buf[0] = (unsigned char)( u32 & 0x000000FFUL);
buf[1] = (unsigned char)((u32 >> 8) & 0x000000FFUL);
@@ -84,6 +76,9 @@ dk4stream_serialize_u32(dk4_stream_t *strm, uint32_t u32, dk4_er_t *erp)
int
dk4stream_serialize_i32(dk4_stream_t *strm, int32_t i32, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
return ( dk4stream_serialize_u32(strm, (uint32_t)i32, erp) );
}
@@ -94,7 +89,9 @@ dk4stream_serialize_u16(dk4_stream_t *strm, uint16_t u16, dk4_er_t *erp)
{
unsigned char buf[8];
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
buf[0] = (unsigned char)( u16 & 0x00FFU);
buf[1] = (unsigned char)((u16 >> 8) & 0x00FFU);
@@ -111,6 +108,9 @@ dk4stream_serialize_u16(dk4_stream_t *strm, uint16_t u16, dk4_er_t *erp)
int
dk4stream_serialize_i16(dk4_stream_t *strm, int16_t i16, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
return ( dk4stream_serialize_u16(strm, (uint16_t)i16, erp) );
}
@@ -121,7 +121,9 @@ dk4stream_serialize_u8(dk4_stream_t *strm, uint8_t u8, dk4_er_t *erp)
{
unsigned char uc;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
uc = (unsigned char)u8;
back = dk4stream_write(strm, &uc, 1, erp);
@@ -137,6 +139,9 @@ dk4stream_serialize_u8(dk4_stream_t *strm, uint8_t u8, dk4_er_t *erp)
int
dk4stream_serialize_i8(dk4_stream_t *strm, int8_t i8, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
return ( dk4stream_serialize_u8(strm, (uint8_t)i8, erp) );
}
@@ -147,7 +152,10 @@ dk4stream_serialize_string(dk4_stream_t *strm, const char *str, dk4_er_t *erp)
{
size_t sl = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != str);
+#endif
if ((NULL != strm) && (NULL != str)) {
sl = strlen(str);
if (((size_t)0xFFFFU) > sl) {
@@ -177,6 +185,9 @@ dk4stream_serialize_double(dk4_stream_t *strm,double d,double e,dk4_er_t *erp)
char buf[16*sizeof(double)];
size_t szbuf = sizeof(buf);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if (fabs(d) < e) {
back = dk4stream_serialize_u16(strm, (uint16_t)0U, erp);
@@ -203,6 +214,9 @@ dk4stream_serialize_double_0(dk4_stream_t *strm, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
back = dk4stream_serialize_u16(strm, 0U, erp);
}
diff --git a/support/dktools/dk4strms.ctr b/support/dktools/dk4strms.ctr
index a6b292ec32..fec6544229 100644
--- a/support/dktools/dk4strms.ctr
+++ b/support/dktools/dk4strms.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -28,19 +28,35 @@ to the stream instead, no string is written.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
-#include <dk4strm.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
@@ -236,11 +252,23 @@ dk4stream_serialize_double_0(dk4_stream_t *strm, dk4_er_t *erp);
#if DK4_HAVE_MATH_H
#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4strms.h"
#include "dk4mao8dbl.h"
@@ -250,7 +278,9 @@ dk4stream_serialize_u32(dk4_stream_t *strm, uint32_t u32, dk4_er_t *erp)
{
unsigned char buf[8];
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
buf[0] = (unsigned char)( u32 & 0x000000FFUL);
buf[1] = (unsigned char)((u32 >> 8) & 0x000000FFUL);
@@ -269,6 +299,9 @@ dk4stream_serialize_u32(dk4_stream_t *strm, uint32_t u32, dk4_er_t *erp)
int
dk4stream_serialize_i32(dk4_stream_t *strm, int32_t i32, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
return ( dk4stream_serialize_u32(strm, (uint32_t)i32, erp) );
}
@@ -279,7 +312,9 @@ dk4stream_serialize_u16(dk4_stream_t *strm, uint16_t u16, dk4_er_t *erp)
{
unsigned char buf[8];
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
buf[0] = (unsigned char)( u16 & 0x00FFU);
buf[1] = (unsigned char)((u16 >> 8) & 0x00FFU);
@@ -296,6 +331,9 @@ dk4stream_serialize_u16(dk4_stream_t *strm, uint16_t u16, dk4_er_t *erp)
int
dk4stream_serialize_i16(dk4_stream_t *strm, int16_t i16, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
return ( dk4stream_serialize_u16(strm, (uint16_t)i16, erp) );
}
@@ -306,7 +344,9 @@ dk4stream_serialize_u8(dk4_stream_t *strm, uint8_t u8, dk4_er_t *erp)
{
unsigned char uc;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
uc = (unsigned char)u8;
back = dk4stream_write(strm, &uc, 1, erp);
@@ -322,6 +362,9 @@ dk4stream_serialize_u8(dk4_stream_t *strm, uint8_t u8, dk4_er_t *erp)
int
dk4stream_serialize_i8(dk4_stream_t *strm, int8_t i8, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
return ( dk4stream_serialize_u8(strm, (uint8_t)i8, erp) );
}
@@ -332,7 +375,10 @@ dk4stream_serialize_string(dk4_stream_t *strm, const char *str, dk4_er_t *erp)
{
size_t sl = 0;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != str);
+#endif
if ((NULL != strm) && (NULL != str)) {
sl = strlen(str);
if (((size_t)0xFFFFU) > sl) {
@@ -362,6 +408,9 @@ dk4stream_serialize_double(dk4_stream_t *strm,double d,double e,dk4_er_t *erp)
char buf[16*sizeof(double)];
size_t szbuf = sizeof(buf);
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
if (fabs(d) < e) {
back = dk4stream_serialize_u16(strm, (uint16_t)0U, erp);
@@ -388,6 +437,9 @@ dk4stream_serialize_double_0(dk4_stream_t *strm, dk4_er_t *erp)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+#endif
if (NULL != strm) {
back = dk4stream_serialize_u16(strm, 0U, erp);
}
diff --git a/support/dktools/dk4strms.h b/support/dktools/dk4strms.h
index 6113340e8b..8abd2d4282 100644
--- a/support/dktools/dk4strms.h
+++ b/support/dktools/dk4strms.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strms.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strms.ctr
*/
#ifndef DK4STRMS_H_INCLUDED
@@ -62,19 +40,35 @@ to the stream instead, no string is written.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
-#include <dk4strm.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
diff --git a/support/dktools/dk4strmu.c b/support/dktools/dk4strmu.c
index 8c3d234efb..4269e0c9c4 100644
--- a/support/dktools/dk4strmu.c
+++ b/support/dktools/dk4strmu.c
@@ -1,45 +1,31 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmu.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmu.ctr
*/
/** @file dk4strmu.c The dk4strmu module.
*/
-#line 222 "dk4strmu.ctr"
+#line 238 "dk4strmu.ctr"
#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4strmu.h"
#include "dk4mai8dbl.h"
#include "dk4mem.h"
@@ -53,6 +39,10 @@ dk4stream_unser_u32(uint32_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
unsigned long res = 0UL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if ((NULL != ptr) && (NULL != strm)) {
if (0 < dk4stream_read(buf, &sz, strm, erp)) {
if (4 == sz) {
@@ -94,6 +84,10 @@ dk4stream_unser_i32(int32_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
uint32_t res = 0UL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4stream_unser_u32(&res, strm, erp);
if (0 < back) {
@@ -117,6 +111,10 @@ dk4stream_unser_u16(uint16_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
unsigned res = 0U;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if ((NULL != ptr) && (NULL != strm)) {
if (0 < dk4stream_read(buf, &sz, strm, erp)) {
if (2 == sz) {
@@ -152,6 +150,10 @@ dk4stream_unser_i16(int16_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
uint16_t res = 0UL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4stream_unser_u16(&res, strm, erp);
if (0 < back) {
@@ -173,6 +175,10 @@ dk4stream_unser_u8(uint8_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
size_t sz = 1;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if ((NULL != ptr) && (NULL != strm)) {
if (0 < dk4stream_read(buf, &sz, strm, erp)) {
if (1 == sz) {
@@ -201,6 +207,10 @@ dk4stream_unser_i8(int8_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
uint8_t res = 0UL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4stream_unser_u8(&res, strm, erp);
if (0 < back) {
@@ -224,6 +234,10 @@ dk4stream_unser_string(char **strptr, dk4_stream_t *strm, dk4_er_t *erp)
int res = 0;
uint16_t sl = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != strptr);
+#endif
if ((NULL != strptr) && (NULL != strm)) {
res = dk4stream_unser_u16(&sl, strm, erp);
if (0 < res) {
@@ -299,6 +313,10 @@ dk4stream_unser_double(double *ptr, dk4_stream_t *strm, dk4_er_t *erp)
int back = 0;
uint16_t sl = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if ((NULL != ptr) && (NULL != strm)) {
if (0 < dk4stream_unser_u16(&sl, strm, erp)) {
if (0U == sl) {
diff --git a/support/dktools/dk4strmu.ctr b/support/dktools/dk4strmu.ctr
index 8b2d38ec1e..21faa448ac 100644
--- a/support/dktools/dk4strmu.ctr
+++ b/support/dktools/dk4strmu.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,19 +10,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
-#include <dk4strm.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
@@ -221,6 +237,14 @@ dk4stream_unser_double(double *ptr, dk4_stream_t *strm, dk4_er_t *erp);
%% module
#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4strmu.h"
#include "dk4mai8dbl.h"
#include "dk4mem.h"
@@ -234,6 +258,10 @@ dk4stream_unser_u32(uint32_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
unsigned long res = 0UL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if ((NULL != ptr) && (NULL != strm)) {
if (0 < dk4stream_read(buf, &sz, strm, erp)) {
if (4 == sz) {
@@ -275,6 +303,10 @@ dk4stream_unser_i32(int32_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
uint32_t res = 0UL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4stream_unser_u32(&res, strm, erp);
if (0 < back) {
@@ -298,6 +330,10 @@ dk4stream_unser_u16(uint16_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
unsigned res = 0U;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if ((NULL != ptr) && (NULL != strm)) {
if (0 < dk4stream_read(buf, &sz, strm, erp)) {
if (2 == sz) {
@@ -333,6 +369,10 @@ dk4stream_unser_i16(int16_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
uint16_t res = 0UL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4stream_unser_u16(&res, strm, erp);
if (0 < back) {
@@ -354,6 +394,10 @@ dk4stream_unser_u8(uint8_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
size_t sz = 1;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if ((NULL != ptr) && (NULL != strm)) {
if (0 < dk4stream_read(buf, &sz, strm, erp)) {
if (1 == sz) {
@@ -382,6 +426,10 @@ dk4stream_unser_i8(int8_t *ptr, dk4_stream_t *strm, dk4_er_t *erp)
uint8_t res = 0UL;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4stream_unser_u8(&res, strm, erp);
if (0 < back) {
@@ -405,6 +453,10 @@ dk4stream_unser_string(char **strptr, dk4_stream_t *strm, dk4_er_t *erp)
int res = 0;
uint16_t sl = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != strptr);
+#endif
if ((NULL != strptr) && (NULL != strm)) {
res = dk4stream_unser_u16(&sl, strm, erp);
if (0 < res) {
@@ -480,6 +532,10 @@ dk4stream_unser_double(double *ptr, dk4_stream_t *strm, dk4_er_t *erp)
int back = 0;
uint16_t sl = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != strm);
+ assert(NULL != ptr);
+#endif
if ((NULL != ptr) && (NULL != strm)) {
if (0 < dk4stream_unser_u16(&sl, strm, erp)) {
if (0U == sl) {
diff --git a/support/dktools/dk4strmu.h b/support/dktools/dk4strmu.h
index f20886a106..cc73a81503 100644
--- a/support/dktools/dk4strmu.h
+++ b/support/dktools/dk4strmu.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmu.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmu.ctr
*/
#ifndef DK4STRMU_H_INCLUDED
@@ -44,19 +22,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
-#include <dk4strm.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
diff --git a/support/dktools/dk4strmw.c b/support/dktools/dk4strmw.c
index 45a50a3663..ab7c60dd44 100644
--- a/support/dktools/dk4strmw.c
+++ b/support/dktools/dk4strmw.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmw.ctr
*/
/** @file dk4strmw.c The dk4strmw module.
*/
-#line 72 "dk4strmw.ctr"
+#line 100 "dk4strmw.ctr"
#include "dk4conf.h"
@@ -51,6 +29,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4strmw.h"
#ifndef DK4FD_H_INCLUDED
@@ -73,7 +58,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 106 "dk4strmw.ctr"
+#line 141 "dk4strmw.ctr"
@@ -92,7 +77,7 @@ dkT(".bz2"),
NULL
-#line 117 "dk4strmw.ctr"
+#line 152 "dk4strmw.ctr"
};
@@ -132,12 +117,15 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
-#line 155 "dk4strmw.ctr"
+#line 190 "dk4strmw.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
p1 = dk4path_get_suffix(filename, erp);
if (NULL != p1) {
-#line 158 "dk4strmw.ctr"
+#line 196 "dk4strmw.ctr"
coi = dk4str_array_index(
dk4strmw_co_su, p1, DK4_HAVE_CASE_INSENSITIVE_PATHNAMES
);
@@ -146,20 +134,20 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
#if TRACE_DEBUG
else {
-#line 165 "dk4strmw.ctr"
+#line 203 "dk4strmw.ctr"
}
#endif
if (0 != dk4fopen_check(filename, 1, DK4_FOPEN_SC_IS_REGULAR, erp)) {
switch (coi) {
case 0: case 1: {
-#line 170 "dk4strmw.ctr"
+#line 208 "dk4strmw.ctr"
#if DK4_HAVE_ZLIB_H && (!(DK4_ON_WINDOWS && DK4_WIN_DENY_CRT))
#if DK4_CHAR_SIZE > 1
/* +++++ gzip, wchar_t */
-#line 174 "dk4strmw.ctr"
+#line 212 "dk4strmw.ctr"
fd = dk4fd_wc_open(
filename,
(DK4_O_WRONLY | DK4_O_BINARY | DK4_O_TRUNC | DK4_O_CREAT),
@@ -173,18 +161,18 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
);
if (NULL == back) {
-#line 186 "dk4strmw.ctr"
+#line 224 "dk4strmw.ctr"
gzclose(gzf);
}
#if TRACE_DEBUG
else {
-#line 190 "dk4strmw.ctr"
+#line 228 "dk4strmw.ctr"
}
#endif
} else {
-#line 193 "dk4strmw.ctr"
+#line 231 "dk4strmw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_OPEN_WRITE_FAILED);
(void)dk4fd_close(fd, NULL);
}
@@ -192,7 +180,7 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
#if TRACE_DEBUG
else {
-#line 199 "dk4strmw.ctr"
+#line 237 "dk4strmw.ctr"
}
#endif
/* ----- gzip, wchar_t */
@@ -200,7 +188,7 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
/* +++++ gzip, char */
-#line 205 "dk4strmw.ctr"
+#line 243 "dk4strmw.ctr"
gzf = gzopen(filename, dk4strmw_c8_mode);
if (NULL != gzf) {
back = dk4stream_open_for_gzfile_with_close(
@@ -208,18 +196,18 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
);
if (NULL == back) {
-#line 211 "dk4strmw.ctr"
+#line 249 "dk4strmw.ctr"
gzclose(gzf);
}
#if TRACE_DEBUG
else {
-#line 215 "dk4strmw.ctr"
+#line 253 "dk4strmw.ctr"
}
#endif
} else {
-#line 218 "dk4strmw.ctr"
+#line 256 "dk4strmw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_OPEN_WRITE_FAILED);
}
/* ----- gzip, char */
@@ -230,13 +218,13 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
} break;
case 2: {
-#line 227 "dk4strmw.ctr"
+#line 265 "dk4strmw.ctr"
#if DK4_HAVE_BZLIB_H && (!(DK4_ON_WINDOWS && DK4_WIN_DENY_CRT))
#if DK4_CHAR_SIZE > 1
/* +++++ bzip2, wchar_t */
-#line 231 "dk4strmw.ctr"
+#line 269 "dk4strmw.ctr"
fd = dk4fd_wc_open(
filename,
(DK4_O_WRONLY | DK4_O_BINARY | DK4_O_TRUNC | DK4_O_CREAT),
@@ -250,24 +238,24 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
);
if (NULL == back) {
-#line 243 "dk4strmw.ctr"
+#line 281 "dk4strmw.ctr"
BZ2_bzclose(bzf);
}
#if TRACE_DEBUG
else {
-#line 247 "dk4strmw.ctr"
+#line 285 "dk4strmw.ctr"
}
#endif
} else {
-#line 250 "dk4strmw.ctr"
+#line 288 "dk4strmw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_OPEN_WRITE_FAILED);
(void)dk4fd_close(fd, NULL);
}
} else {
-#line 254 "dk4strmw.ctr"
+#line 292 "dk4strmw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_OPEN_WRITE_FAILED);
}
/* ----- bzip2, wchar_t */
@@ -275,7 +263,7 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
/* +++++ bzip2, char */
-#line 260 "dk4strmw.ctr"
+#line 298 "dk4strmw.ctr"
bzf = BZ2_bzopen(filename, dk4strmw_c8_mode);
if (NULL != bzf) {
back = dk4stream_open_for_bzfile_with_close(
@@ -283,18 +271,18 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
);
if (NULL == back) {
-#line 266 "dk4strmw.ctr"
+#line 304 "dk4strmw.ctr"
BZ2_bzclose(bzf);
}
#if TRACE_DEBUG
else {
-#line 270 "dk4strmw.ctr"
+#line 308 "dk4strmw.ctr"
}
#endif
} else {
-#line 273 "dk4strmw.ctr"
+#line 311 "dk4strmw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_OPEN_WRITE_FAILED);
}
/* ----- bzip2, char */
@@ -305,11 +293,11 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
} break;
default: {
-#line 282 "dk4strmw.ctr"
+#line 320 "dk4strmw.ctr"
#if DK4_ON_WINDOWS && DK4_WIN_DENY_CRT
-#line 284 "dk4strmw.ctr"
+#line 322 "dk4strmw.ctr"
dwattr = FILE_ATTRIBUTE_NORMAL;
dwattr |= FILE_FLAG_BACKUP_SEMANTICS;
dwattr |= FILE_FLAG_SEQUENTIAL_SCAN;
@@ -330,24 +318,24 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
);
if (NULL == back) {
-#line 303 "dk4strmw.ctr"
+#line 341 "dk4strmw.ctr"
(void)CloseHandle(fha);
}
#if TRACE_DEBUG
else {
-#line 307 "dk4strmw.ctr"
+#line 345 "dk4strmw.ctr"
}
#endif
} else {
-#line 310 "dk4strmw.ctr"
+#line 348 "dk4strmw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_OPEN_WRITE_FAILED);
}
#else
-#line 314 "dk4strmw.ctr"
+#line 352 "dk4strmw.ctr"
fipo = dk4fopen(
filename, dk4strmw_dk_mode, DK4_FOPEN_SC_IS_REGULAR, erp
);
@@ -357,34 +345,34 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
);
if (NULL == back) {
-#line 322 "dk4strmw.ctr"
+#line 360 "dk4strmw.ctr"
(void)fclose(fipo);
}
#if TRACE_DEBUG
else {
-#line 326 "dk4strmw.ctr"
+#line 364 "dk4strmw.ctr"
}
#endif
} else {
-#line 329 "dk4strmw.ctr"
+#line 367 "dk4strmw.ctr"
}
#endif
} break;
}
} else {
-#line 334 "dk4strmw.ctr"
+#line 372 "dk4strmw.ctr"
}
} else {
-#line 336 "dk4strmw.ctr"
+#line 374 "dk4strmw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 339 "dk4strmw.ctr"
+#line 377 "dk4strmw.ctr"
return back;
}
diff --git a/support/dktools/dk4strmw.ctr b/support/dktools/dk4strmw.ctr
index 1f69ad78a8..91c42ffb97 100644
--- a/support/dktools/dk4strmw.ctr
+++ b/support/dktools/dk4strmw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -12,31 +12,59 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4STRMF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmf.h"
+#else
+#include <dktools-4/dk4strmf.h>
+#endif
#endif
#ifndef DK4STRMG_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmg.h"
+#else
+#include <dktools-4/dk4strmg.h>
+#endif
#endif
#ifndef DK4STRMB_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmb.h"
+#else
+#include <dktools-4/dk4strmb.h>
+#endif
#endif
@@ -82,6 +110,13 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4strmw.h"
#ifndef DK4FD_H_INCLUDED
@@ -152,6 +187,9 @@ dk4stream_open_file_writer(const dkChar *filename, dk4_er_t *erp)
#endif
$? "+ dk4stream_open_file_writer \"%!ds\"", TR_STR(filename)
+#if DK4_USE_ASSERT
+ assert(NULL != filename);
+#endif
if (NULL != filename) {
p1 = dk4path_get_suffix(filename, erp);
if (NULL != p1) { $? ". suffix \"%!ds\"", p1
diff --git a/support/dktools/dk4strmw.h b/support/dktools/dk4strmw.h
index 6c31d8e218..d35e815da4 100644
--- a/support/dktools/dk4strmw.h
+++ b/support/dktools/dk4strmw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strmw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strmw.ctr
*/
#ifndef DK4STRMW_H_INCLUDED
@@ -45,31 +23,59 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4STRMF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmf.h"
+#else
+#include <dktools-4/dk4strmf.h>
+#endif
#endif
#ifndef DK4STRMG_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmg.h"
+#else
+#include <dktools-4/dk4strmg.h>
+#endif
#endif
#ifndef DK4STRMB_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmb.h"
+#else
+#include <dktools-4/dk4strmb.h>
+#endif
#endif
diff --git a/support/dktools/dk4strw.c b/support/dktools/dk4strw.c
index e4fc7e58f3..8b8404b5f6 100644
--- a/support/dktools/dk4strw.c
+++ b/support/dktools/dk4strw.c
@@ -1,46 +1,28 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strw.ctr
*/
/** @file dk4strw.c The dk4strw module.
*/
-#line 413 "dk4strw.ctr"
+#line 432 "dk4strw.ctr"
#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
@@ -60,6 +42,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#ifndef DK4MEMRS_H_INCLUDED
#include "dk4memrs.h"
#endif
@@ -68,7 +57,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 442 "dk4strw.ctr"
+#line 472 "dk4strw.ctr"
@@ -81,7 +70,7 @@ L" \t\r\n",
NULL
-#line 454 "dk4strw.ctr"
+#line 484 "dk4strw.ctr"
};
@@ -130,14 +119,15 @@ L"ok",
NULL
-#line 485 "dk4strw.ctr"
+#line 515 "dk4strw.ctr"
};
-
+#if 0
/** Number of significant digits when printing a double.
*/
static const int dk4strw_dbl_digits = DK4_DBL_DIGITS;
+#endif
@@ -146,6 +136,10 @@ dk4strw_cpy_to_left(wchar_t *dst, const wchar_t *src)
{
register wchar_t *dptr;
register const wchar_t *sptr;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+#endif
if ((NULL != dst) && (NULL != src)) {
dptr = dst; sptr = src;
while(L'\0' != *sptr) { *(dptr++) = *(sptr++); }
@@ -200,13 +194,21 @@ dk4strw_chr(const wchar_t *s, wchar_t c)
return back;
}
#else
+#ifdef __cplusplus
+ return ((wchar_t *)wcschr(s, c));
+#else
return (wcschr(s, c));
#endif
+#endif
/* --- Windows */
#else
/* +++ non-Windows */
#if DK4_HAVE_WCSCHR
+#ifdef __cplusplus
+ return ((wchar_t *)wcschr(s, c));
+#else
return (wcschr(s, c));
+#endif
#else
{
wchar_t *back = NULL;
@@ -243,13 +245,21 @@ dk4strw_rchr(const wchar_t *s, wchar_t c)
return back;
}
#else
+#ifdef __cplusplus
+ return ((wchar_t *)wcsrchr(s, c));
+#else
return (wcsrchr(s, c));
#endif
+#endif
/* --- Windows */
#else
/* +++ non-Windows */
#if DK4_HAVE_WCSRCHR
+#ifdef __cplusplus
+ return ((wchar_t *)wcsrchr(s, c));
+#else
return (wcsrchr(s, c));
+#endif
#else
{
wchar_t *back = NULL;
@@ -321,6 +331,10 @@ dk4strw_cpy_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp)
{
int back = 0;
size_t sl;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (0 < sz)) {
*dst = L'\0';
if (NULL != src) {
@@ -331,9 +345,14 @@ dk4strw_cpy_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp)
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
(void)lstrcpyW(dst, (wchar_t *)src);
#else
-#pragma warning (disable:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4996 )
+#endif
(void)wcscpy(dst, src);
-#pragma warning (default:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
+#endif
#endif
/* --- Windows */
#else
@@ -382,6 +401,10 @@ dk4strw_cat_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp)
size_t la; /* Size of string in destination buffer */
size_t lb; /* Source string size */
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (0 < sz) && (NULL != src)) {
la = dk4strw_len(dst);
lb = dk4strw_len(src);
@@ -391,9 +414,14 @@ dk4strw_cat_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp)
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
(void)lstrcatW(dst, src);
#else
-#pragma warning (disable:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4996 )
+#endif
(void)wcscat(dst, src);
-#pragma warning (default:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
+#endif
#endif
/* --- Windows */
#else
@@ -623,8 +651,7 @@ dk4strw_casecmp(const wchar_t *s1, const wchar_t *s2)
-#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
- || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
wchar_t *
dk4strw_dup(const wchar_t *src, dk4_er_t *erp)
@@ -648,7 +675,6 @@ dk4strw_dup(const wchar_t *src, dk4_er_t *erp)
}
#endif
-/* if (defined(_WIN32) ... */
@@ -748,7 +774,10 @@ dk4strw_sep(wchar_t **stringp, const wchar_t *delim)
wchar_t *back = NULL;
-#line 1101 "dk4strw.ctr"
+#line 1168 "dk4strw.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != stringp);
+#endif
if (NULL != stringp) {
if (NULL != *stringp) {
if (NULL == delim) { delim = dk4strw_modkw[0]; }
@@ -761,7 +790,7 @@ dk4strw_sep(wchar_t **stringp, const wchar_t *delim)
}
}
-#line 1112 "dk4strw.ctr"
+#line 1182 "dk4strw.ctr"
return back;
}
@@ -775,6 +804,10 @@ dk4strw_tokenize(
wchar_t *context;
wchar_t *token;
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dpp);
+ assert(0 < szdpp);
+#endif
if ((NULL != dpp) && (0 < szdpp) && (NULL != src)) {
if (NULL == delim) { delim = dk4strw_modkw[0]; }
context = src;
@@ -860,6 +893,9 @@ dk4strw_array_index(const wchar_t * const *arr, const wchar_t *str, int cs)
{
int back = -1;
int cand = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != arr);
+#endif
while ((NULL != *arr) && (-1 == back)) {
if (0 != cs) {
if (0 == dk4strw_cmp(*arr, str)) { back = cand; }
@@ -886,7 +922,10 @@ dk4strw_is_abbr(const wchar_t *str,const wchar_t *pattern,wchar_t spec,int cs)
wchar_t cp;
-#line 1235 "dk4strw.ctr"
+#line 1312 "dk4strw.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pattern);
+#endif
if ((NULL != str) && (NULL != pattern)) {
lptr = str; pptr = pattern;
while (0 != cc) {
@@ -915,7 +954,7 @@ dk4strw_is_abbr(const wchar_t *str,const wchar_t *pattern,wchar_t spec,int cs)
}
-#line 1262 "dk4strw.ctr"
+#line 1342 "dk4strw.ctr"
return back;
}
@@ -933,7 +972,10 @@ dk4strw_abbr_index(
int cand = 0; /* Traverse array */
-#line 1278 "dk4strw.ctr"
+#line 1358 "dk4strw.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != arr);
+#endif
if ((NULL != arr) && (NULL != str)) {
while ((NULL != *arr) && (-1 == back)) {
if (0 != dk4strw_is_abbr(str, *arr, spec, cs)) {
@@ -944,7 +986,7 @@ dk4strw_abbr_index(
}
-#line 1287 "dk4strw.ctr"
+#line 1370 "dk4strw.ctr"
return back;
}
@@ -970,28 +1012,28 @@ dk4strw_is_on(const wchar_t *str)
int back = 0;
-#line 1311 "dk4strw.ctr"
+#line 1394 "dk4strw.ctr"
if (NULL != str) {
back = dk4strw_abbr_index(dk4strw_boolkw, L'$', str, 0);
if (-1 < back) {
if (DK4STRW_FIRST_TRUE <= back) {
back = 1;
-#line 1316 "dk4strw.ctr"
+#line 1399 "dk4strw.ctr"
} else {
back = 0;
-#line 1318 "dk4strw.ctr"
+#line 1401 "dk4strw.ctr"
}
} else {
back = 0;
-#line 1321 "dk4strw.ctr"
+#line 1404 "dk4strw.ctr"
}
}
-#line 1324 "dk4strw.ctr"
+#line 1407 "dk4strw.ctr"
return back;
}
@@ -1106,7 +1148,10 @@ dk4strw_buffer_sanitize(wchar_t *str, size_t sz)
{
size_t i;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+ assert(0 < sz);
+#endif
if (NULL != str) {
if (0 < sz) {
if ((SIZE_MAX / sizeof(wchar_t)) >= sz) {
diff --git a/support/dktools/dk4strw.ctr b/support/dktools/dk4strw.ctr
index 8e0b560ab5..2b7db16a95 100644
--- a/support/dktools/dk4strw.ctr
+++ b/support/dktools/dk4strw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -21,15 +21,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -50,7 +62,7 @@ extern "C" {
#endif
/** Copy string, check destination buffer size.
-
+
CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@@ -68,7 +80,7 @@ int
dk4strw_cpy_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp);
/** Concatenate strings, check destination buffer size.
-
+
CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@@ -135,7 +147,7 @@ dk4strw_ncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
/** Compare two strings, case-insensitive comparison.
- CRT on Windows: Optional, disabling CRT probably degrades performance.
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@return 1 if s1>s2, 0 if s1==s2, -1 if s1<s2.
@@ -192,7 +204,6 @@ wchar_t
dk4strw_tolower(wchar_t c);
/** Retrieve first token from *stringp.
-
CRT on Windows: Optional, disabling CRT degrades performance.
@param stringp Adress of string pointer.
@param delim String containing the delimiter set,
@@ -229,7 +240,6 @@ wchar_t *
dk4strw_next(wchar_t *src, const wchar_t *delim);
/** Split a string into tokens.
-
CRT on Windows: Optional, disabling CRT degrades performance.
@param dpp Pointer to string pointer array.
@param szdpp Size of destination string pointer array.
@@ -264,7 +274,7 @@ void
dk4strw_normalize(wchar_t *src, const wchar_t *delim);
/** Find index of a string in an array of strings.
-
+
CRT on Windows: Optional.
@param arr Array of strings.
@param str String to find in array.
@@ -275,7 +285,7 @@ int
dk4strw_array_index(const wchar_t * const *arr, const wchar_t *str, int cs);
/** Find index of a string in an array of strings.
-
+
CRT on windows: Optional, disabling CRT degrades performance
for case-insensitive comparisons.
@param arr Array of strings allowing abbreviation.
@@ -293,7 +303,7 @@ dk4strw_abbr_index(
);
/** Check whether a text matches a pattern, the text may be abbreviated.
-
+
CRT on windows: Optional, disabling CRT degrades performance
for case-insensitive comparisons.
@param str Text to check.
@@ -324,8 +334,7 @@ dk4strw_is_bool(const wchar_t *str);
int
dk4strw_is_on(const wchar_t *str);
-#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
- || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
/** Duplicate string in dynamically allocated memory.
@@ -349,7 +358,7 @@ wchar_t *
dk4strw_dup(const wchar_t *src, dk4_er_t *erp);
#endif
-/* if (defined(_WIN32) ... */
+
/** Remove trailing white spaces.
@@ -362,6 +371,8 @@ void
dk4strw_rtwh(wchar_t *str, const wchar_t *whsp);
/** Remove trailing newline from line.
+
+ CRT on Windows: Not used.
@param lptr Line pointer.
*/
void
@@ -369,6 +380,8 @@ dk4strw_delnl(wchar_t *lptr);
/** Skip the first text words in a line, return pointer to start
of next word.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param line Line to process.
@param skip Number of words to skip.
@return Pointer to next word on success, NULL on error.
@@ -377,6 +390,8 @@ const wchar_t *
dk4strw_skip(const wchar_t *line, size_t skip);
/** Sanitize string (overwrite using 0).
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize.
@return 1 on success, 0 on error.
*/
@@ -384,6 +399,8 @@ int
dk4strw_sanitize(wchar_t *str);
/** Sanitize string buffer (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string buffer.
@param sz Size of string buffer (number of wchar_t).
@return 1 on success, 0 on error.
@@ -392,6 +409,8 @@ int
dk4strw_buffer_sanitize(wchar_t *str, size_t sz);
/** Sanitize dynamically allocated memory and release it.
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize and release.
@return 1 on success, 0 on error.
*/
@@ -413,6 +432,10 @@ do { if (NULL != p) { (void)dk4strw_free_sanitized(p); } p = NULL; } while (0)
#include "dk4conf.h"
+#ifndef DK4USE_H_INCLUDED
+#include "dk4use.h"
+#endif
+
#if DK4_ON_WINDOWS && (DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT)
#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
@@ -432,6 +455,13 @@ do { if (NULL != p) { (void)dk4strw_free_sanitized(p); } p = NULL; } while (0)
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#ifndef DK4MEMRS_H_INCLUDED
#include "dk4memrs.h"
#endif
@@ -485,10 +515,11 @@ $!end
};
-
+#if 0
/** Number of significant digits when printing a double.
*/
static const int dk4strw_dbl_digits = DK4_DBL_DIGITS;
+#endif
@@ -497,6 +528,10 @@ dk4strw_cpy_to_left(wchar_t *dst, const wchar_t *src)
{
register wchar_t *dptr;
register const wchar_t *sptr;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(NULL != src);
+#endif
if ((NULL != dst) && (NULL != src)) {
dptr = dst; sptr = src;
while(L'\0' != *sptr) { *(dptr++) = *(sptr++); }
@@ -551,13 +586,21 @@ dk4strw_chr(const wchar_t *s, wchar_t c)
return back;
}
#else
+#ifdef __cplusplus
+ return ((wchar_t *)wcschr(s, c));
+#else
return (wcschr(s, c));
#endif
+#endif
/* --- Windows */
#else
/* +++ non-Windows */
#if DK4_HAVE_WCSCHR
+#ifdef __cplusplus
+ return ((wchar_t *)wcschr(s, c));
+#else
return (wcschr(s, c));
+#endif
#else
{
wchar_t *back = NULL;
@@ -594,13 +637,21 @@ dk4strw_rchr(const wchar_t *s, wchar_t c)
return back;
}
#else
+#ifdef __cplusplus
+ return ((wchar_t *)wcsrchr(s, c));
+#else
return (wcsrchr(s, c));
#endif
+#endif
/* --- Windows */
#else
/* +++ non-Windows */
#if DK4_HAVE_WCSRCHR
+#ifdef __cplusplus
+ return ((wchar_t *)wcsrchr(s, c));
+#else
return (wcsrchr(s, c));
+#endif
#else
{
wchar_t *back = NULL;
@@ -672,6 +723,10 @@ dk4strw_cpy_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp)
{
int back = 0;
size_t sl;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (0 < sz)) {
*dst = L'\0';
if (NULL != src) {
@@ -682,9 +737,14 @@ dk4strw_cpy_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp)
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
(void)lstrcpyW(dst, (wchar_t *)src);
#else
-#pragma warning (disable:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4996 )
+#endif
(void)wcscpy(dst, src);
-#pragma warning (default:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
+#endif
#endif
/* --- Windows */
#else
@@ -733,6 +793,10 @@ dk4strw_cat_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp)
size_t la; /* Size of string in destination buffer */
size_t lb; /* Source string size */
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dst);
+ assert(0 < sz);
+#endif
if ((NULL != dst) && (0 < sz) && (NULL != src)) {
la = dk4strw_len(dst);
lb = dk4strw_len(src);
@@ -742,9 +806,14 @@ dk4strw_cat_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp)
#if DK4_WIN_AVOID_CRT || DK4_WIN_DENY_CRT
(void)lstrcatW(dst, src);
#else
-#pragma warning (disable:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( push )
+#pragma warning( disable: 4996 )
+#endif
(void)wcscat(dst, src);
-#pragma warning (default:4996)
+#if DK4_USE_PRAGMA_WARNING_DISABLE
+#pragma warning( pop )
+#endif
#endif
/* --- Windows */
#else
@@ -974,8 +1043,7 @@ dk4strw_casecmp(const wchar_t *s1, const wchar_t *s2)
-#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
- || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
wchar_t *
dk4strw_dup(const wchar_t *src, dk4_er_t *erp)
@@ -999,7 +1067,6 @@ dk4strw_dup(const wchar_t *src, dk4_er_t *erp)
}
#endif
-/* if (defined(_WIN32) ... */
@@ -1098,6 +1165,9 @@ dk4strw_sep(wchar_t **stringp, const wchar_t *delim)
{
wchar_t *back = NULL;
$? "+ dk4strw_sep \"%ls\" \"%ls\"", TR_LSTR(*stringp), TR_LSTR(delim)
+#if DK4_USE_ASSERT
+ assert(NULL != stringp);
+#endif
if (NULL != stringp) {
if (NULL != *stringp) {
if (NULL == delim) { delim = dk4strw_modkw[0]; }
@@ -1122,6 +1192,10 @@ dk4strw_tokenize(
wchar_t *context;
wchar_t *token;
size_t back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dpp);
+ assert(0 < szdpp);
+#endif
if ((NULL != dpp) && (0 < szdpp) && (NULL != src)) {
if (NULL == delim) { delim = dk4strw_modkw[0]; }
context = src;
@@ -1207,6 +1281,9 @@ dk4strw_array_index(const wchar_t * const *arr, const wchar_t *str, int cs)
{
int back = -1;
int cand = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != arr);
+#endif
while ((NULL != *arr) && (-1 == back)) {
if (0 != cs) {
if (0 == dk4strw_cmp(*arr, str)) { back = cand; }
@@ -1232,6 +1309,9 @@ dk4strw_is_abbr(const wchar_t *str,const wchar_t *pattern,wchar_t spec,int cs)
wchar_t cl;
wchar_t cp;
$? "+ dk4strw_is_abbr str=\"%ls\" pattern=\"%ls\"", TR_LSTR(str), TR_LSTR(pattern)
+#if DK4_USE_ASSERT
+ assert(NULL != pattern);
+#endif
if ((NULL != str) && (NULL != pattern)) {
lptr = str; pptr = pattern;
while (0 != cc) {
@@ -1275,6 +1355,9 @@ dk4strw_abbr_index(
int back = -1;
int cand = 0; /* Traverse array */
$? "+ dk4strw_abbr_index"
+#if DK4_USE_ASSERT
+ assert(NULL != arr);
+#endif
if ((NULL != arr) && (NULL != str)) {
while ((NULL != *arr) && (-1 == back)) {
if (0 != dk4strw_is_abbr(str, *arr, spec, cs)) {
@@ -1435,7 +1518,10 @@ dk4strw_buffer_sanitize(wchar_t *str, size_t sz)
{
size_t i;
int back = 0;
-
+#if DK4_USE_ASSERT
+ assert(NULL != str);
+ assert(0 < sz);
+#endif
if (NULL != str) {
if (0 < sz) {
if ((SIZE_MAX / sizeof(wchar_t)) >= sz) {
diff --git a/support/dktools/dk4strw.h b/support/dktools/dk4strw.h
index 454b893a48..714a60c019 100644
--- a/support/dktools/dk4strw.h
+++ b/support/dktools/dk4strw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strw.ctr
*/
#ifndef DK4STRW_H_INCLUDED
@@ -53,15 +31,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef STDLIB_H_INCLUDED
@@ -82,7 +72,7 @@ extern "C" {
#endif
/** Copy string, check destination buffer size.
-
+
CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@@ -100,7 +90,7 @@ int
dk4strw_cpy_s(wchar_t *dst, size_t sz, const wchar_t *src, dk4_er_t *erp);
/** Concatenate strings, check destination buffer size.
-
+
CRT on Windows: Optional.
@param dst Destination buffer address.
@param sz Destination buffer size.
@@ -167,7 +157,7 @@ dk4strw_ncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
/** Compare two strings, case-insensitive comparison.
- CRT on Windows: Optional, disabling CRT probably degrades performance.
+ CRT on Windows: Optional.
@param s1 Left string, may be NULL.
@param s2 Right string, may be NULL.
@return 1 if s1>s2, 0 if s1==s2, -1 if s1<s2.
@@ -224,7 +214,6 @@ wchar_t
dk4strw_tolower(wchar_t c);
/** Retrieve first token from *stringp.
-
CRT on Windows: Optional, disabling CRT degrades performance.
@param stringp Adress of string pointer.
@param delim String containing the delimiter set,
@@ -261,7 +250,6 @@ wchar_t *
dk4strw_next(wchar_t *src, const wchar_t *delim);
/** Split a string into tokens.
-
CRT on Windows: Optional, disabling CRT degrades performance.
@param dpp Pointer to string pointer array.
@param szdpp Size of destination string pointer array.
@@ -296,7 +284,7 @@ void
dk4strw_normalize(wchar_t *src, const wchar_t *delim);
/** Find index of a string in an array of strings.
-
+
CRT on Windows: Optional.
@param arr Array of strings.
@param str String to find in array.
@@ -307,7 +295,7 @@ int
dk4strw_array_index(const wchar_t * const *arr, const wchar_t *str, int cs);
/** Find index of a string in an array of strings.
-
+
CRT on windows: Optional, disabling CRT degrades performance
for case-insensitive comparisons.
@param arr Array of strings allowing abbreviation.
@@ -325,7 +313,7 @@ dk4strw_abbr_index(
);
/** Check whether a text matches a pattern, the text may be abbreviated.
-
+
CRT on windows: Optional, disabling CRT degrades performance
for case-insensitive comparisons.
@param str Text to check.
@@ -356,8 +344,7 @@ dk4strw_is_bool(const wchar_t *str);
int
dk4strw_is_on(const wchar_t *str);
-#if (defined(_WIN32) && DK4_USE_WINDOWS_LOCAL_ALLOC) \
- || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
+#if (DK4_ON_WINDOWS) || (DK4_HAVE_MALLOC && DK4_HAVE_FREE)
/** Duplicate string in dynamically allocated memory.
@@ -381,7 +368,7 @@ wchar_t *
dk4strw_dup(const wchar_t *src, dk4_er_t *erp);
#endif
-/* if (defined(_WIN32) ... */
+
/** Remove trailing white spaces.
@@ -394,6 +381,8 @@ void
dk4strw_rtwh(wchar_t *str, const wchar_t *whsp);
/** Remove trailing newline from line.
+
+ CRT on Windows: Not used.
@param lptr Line pointer.
*/
void
@@ -401,6 +390,8 @@ dk4strw_delnl(wchar_t *lptr);
/** Skip the first text words in a line, return pointer to start
of next word.
+
+ CRT on Windows: Optional, disabling CRT degrades performance.
@param line Line to process.
@param skip Number of words to skip.
@return Pointer to next word on success, NULL on error.
@@ -409,6 +400,8 @@ const wchar_t *
dk4strw_skip(const wchar_t *line, size_t skip);
/** Sanitize string (overwrite using 0).
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize.
@return 1 on success, 0 on error.
*/
@@ -416,6 +409,8 @@ int
dk4strw_sanitize(wchar_t *str);
/** Sanitize string buffer (overwrite using 0 bytes).
+
+ CRT on Windows: Optional.
@param str Address of string buffer.
@param sz Size of string buffer (number of wchar_t).
@return 1 on success, 0 on error.
@@ -424,6 +419,8 @@ int
dk4strw_buffer_sanitize(wchar_t *str, size_t sz);
/** Sanitize dynamically allocated memory and release it.
+
+ CRT on Windows: Optional.
@param str Address of string to sanitize and release.
@return 1 on success, 0 on error.
*/
diff --git a/support/dktools/dk4strx.cpp b/support/dktools/dk4strx.cpp
index d60a284b34..16ec94b290 100644
--- a/support/dktools/dk4strx.cpp
+++ b/support/dktools/dk4strx.cpp
@@ -1,58 +1,47 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strx.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strx.cpt
*/
/** @file dk4strx.cpp The dk4strx module.
*/
-#line 313 "dk4strx.cpt"
+#line 573 "dk4strx.cpt"
-#include "dk4strx.h"
+#include "dk4conf.h"
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
+#include "dk4strx.h"
+#include "dk4mem.h"
+#include "dk4mpl.h"
#if DK4_SIZEOF_WXCHAR > 1
#include "dk4strw.h"
+#include "dk4pathw.h"
#else
#include "dk4str8.h"
+#include "dk4path8.h"
#endif
-#line 326 "dk4strx.cpt"
+#line 597 "dk4strx.cpt"
@@ -329,3 +318,237 @@ dk4strx_delnl(wxChar *lptr)
#endif
}
+
+wxChar const *
+dk4strx_get_path_suffix(wxChar const *filename, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_get_suffix(filename, erp));
+#else
+ return (dk4path8_get_suffix(filename, erp));
+#endif
+}
+
+
+
+int
+dk4strx_path_is_absolute(const wxChar *path)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_is_absolute(path));
+#else
+ return (dk4path8_is_absolute(path));
+#endif
+}
+
+
+
+int
+dk4strx_path_is_relative(const wxChar *path)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_is_relative(path));
+#else
+ return (dk4path8_is_relative(path));
+#endif
+}
+
+
+
+int
+dk4strx_path_append(
+ wxChar *buffer, size_t sz, const wxChar *filename, dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_append(buffer, sz, filename, erp));
+#else
+ return (dk4path8_append(buffer, sz, filename, erp));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_path_get_suffix(const wxChar *filename, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_get_suffix(filename, erp));
+#else
+ return (dk4path8_get_suffix(filename, erp));
+#endif
+}
+
+
+
+void
+dk4strx_path_correct_sep(wxChar *filename)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4pathw_correct_sep(filename);
+#else
+ dk4path8_correct_sep(filename);
+#endif
+}
+
+
+
+int
+dk4strx_path_must_expand(const wxChar *filename)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_must_expand(filename));
+#else
+ return (dk4path8_must_expand(filename));
+#endif
+}
+
+
+
+int
+dk4strx_path_set_suffix(
+ wxChar *pdst,
+ size_t szdst,
+ wxChar const *srcname,
+ wxChar const *newsu,
+ dk4_er_t *erp
+)
+{
+
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_set_suffix(pdst, szdst, srcname, newsu, erp));
+#else
+ return (dk4path8_set_suffix(pdst, szdst, srcname, newsu, erp));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_path_dup_change_suffix(
+ wxChar const *srcname,
+ wxChar const *newsu,
+ dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_dup_change_suffix(srcname, newsu, erp));
+#else
+ return (dk4path8_dup_change_suffix(srcname, newsu, erp));
+#endif
+}
+
+
+
+size_t
+dk4strx_path_concatenate_size(
+ wxChar const *dirname,
+ wxChar const *filename,
+ dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_concatenate_size(dirname, filename, erp));
+#else
+ return (dk4path8_concatenate_size(dirname, filename, erp));
+#endif
+}
+
+
+
+int
+dk4strx_path_concatenate_buffer(
+ wxChar *buffer,
+ size_t szbuf,
+ wxChar const *dirn,
+ wxChar const *filen,
+ dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_concatenate_buffer(buffer, szbuf, dirn, filen, erp));
+#else
+ return (dk4path8_concatenate_buffer(buffer, szbuf, dirn, filen, erp));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_path_concatenate_new(
+ wxChar const *dirn,
+ wxChar const *filen,
+ dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_concatenate_new(dirn, filen, erp));
+#else
+ return (dk4path8_concatenate_new(dirn, filen, erp));
+#endif
+}
+
+
+
+int
+dk4strx_path_is_in_subdir(
+ const wxChar *filename,const wxChar *parent,dk4_er_t *erp
+)
+{
+ wxChar buf[DK4_MAX_PATH];
+ size_t szf;
+ size_t szp;
+ int back = 0;
+
+
+#line 1055 "dk4strx.cpt"
+ if ((NULL != filename) && (NULL != parent)) {
+ if (0 != dk4strx_cpy_s(buf, DK4_SIZEOF(buf,wxChar), filename, erp)) {
+ szf = dk4strx_len(buf);
+ szp = dk4strx_len(parent);
+ if (szf > szp) {
+
+#line 1060 "dk4strx.cpt"
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
+ if (buf[szp] == wxT('\\'))
+#else
+ if (buf[szp] == wxT('/'))
+#endif
+ {
+
+#line 1066 "dk4strx.cpt"
+ buf[szp] = wxT('\0');
+ if (0 == dk4strx_pathcmp(buf, parent)) {
+ back = 1;
+
+#line 1069 "dk4strx.cpt"
+ }
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
+ buf[szp] = wxT('\\');
+#else
+ buf[szp] = wxT('/');
+#endif
+ }
+ } else {
+ if (szf == szp) {
+
+#line 1078 "dk4strx.cpt"
+ if (0 == dk4strx_pathcmp(buf, parent)) {
+ back = 1;
+
+#line 1080 "dk4strx.cpt"
+ }
+ }
+ }
+ }
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+#line 1087 "dk4strx.cpt"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4strx.cpt b/support/dktools/dk4strx.cpt
index cf8b9c8ea9..7ac7d0bff1 100644
--- a/support/dktools/dk4strx.cpt
+++ b/support/dktools/dk4strx.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,23 +10,43 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
@@ -58,6 +78,20 @@ license = bsd
#endif
#endif
+
+
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH
+/** File name separator.
+*/
+#define DK4_WX_CHAR_SEP wxT('\\')
+#else
+/** File name separator.
+*/
+#define DK4_WX_CHAR_SEP wxT('/')
+#endif
+
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -303,21 +337,258 @@ dk4strx_rtwh(wxChar *str, const wxChar *whsp);
void
dk4strx_delnl(wxChar *lptr);
+/** Find file name suffix.
+ @param filename File name to find suffix from.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+wxChar const *
+dk4strx_get_path_suffix(wxChar const *filename, dk4_er_t *erp);
+
+/** Check whether a file name is an absolute path.
+ CRT on Windows: Not used.
+ @param path Path name to check.
+ @return 1 for absolute path, 0 for other path.
+*/
+int
+dk4strx_path_is_absolute(const wxChar *path);
+
+/** Check whether a file name is a relative path.
+ CRT on Windows: Not used.
+ @param path Path name to check.
+ @return 1 for absolute path, 0 for other path.
+*/
+int
+dk4strx_path_is_relative(const wxChar *path);
+
+/** Append path filename to path name already stored in buffer.
+ Resolve . and .. for current directory and parent directory.
+ CRT on Windows: Optional, disabling CRT degrades performance.
+ @param buffer Buffer already containing a path.
+ @param sz Buffer size.
+ @param filename Relative file name to append to buffer.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer or filename is NULL or sz is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ if filename is too long,
+ - DK4_E_MEMORY<br>
+ if allocation of a filename copy fails,
+ - DK4_E_SYNTAX<br>
+ if too many .. in filename,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if buffer size is too small.
+*/
+int
+dk4strx_path_append(
+ wxChar *buffer, size_t sz, const wxChar *filename, dk4_er_t *erp
+);
+
+
+/** Find pointer to suffix.
+ CRT on Windows: Not used.
+ @param filename File name to find suffix for.
+ @param erp Error report, may be NULL.
+ @return Pointer to suffix dot if found, NULL otherwise.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if filename is NULL,
+ - DK4_E_NOT_FOUND<br>
+ if the file name does not contain a suffix.
+*/
+wxChar *
+dk4strx_path_get_suffix(const wxChar *filename, dk4_er_t *erp);
+
+
+/** Correct file name separators from slash to backslash on Windows,
+ vice versa on other systems.
+ CRT on Windows: Not used.
+ @param filename File name to correct.
+*/
+void
+dk4strx_path_correct_sep(wxChar *filename);
+
+/** Check whether file name needs expansion on Windows.
+ CRT on Windows: Not used.
+ @param filename File name to check.
+ @return 1 if expansion is necessary, 0 otherwise.
+*/
+int
+dk4strx_path_must_expand(const wxChar *filename);
+
+/** Create file name with specified suffix.
+ @param pdst Destination buffer.
+ @param szdst Size of pdst (number of wxChar).
+ @param srcname Source file name.
+ @param newsu New file suffix.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdst or srcname or newsu is NULL or szdst is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dst buffer is too small.
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+*/
+int
+dk4strx_path_set_suffix(
+ wxChar *pdst,
+ size_t szdst,
+ wxChar const *srcname,
+ wxChar const *newsu,
+ dk4_er_t *erp
+);
+
+/** Create a dynamic copy of a file name with changed suffix.
+ @param srcname Old file name.
+ @param newsu New suffix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to changed file name on success, NULL on error.
+ On success call dk4mem_free() on the pointer when no longer needed
+ to release the memory.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if srcname or newsu is NULL,
+ - DK4_E_BUG<br>
+ if a bug occured,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+wxChar *
+dk4strx_path_dup_change_suffix(
+ wxChar const *srcname,
+ wxChar const *newsu,
+ dk4_er_t *erp
+);
+
+/** Calculate buffer size required to concatenate a directory
+ name and a file name.
+ @param dirname Directory name.
+ @param filename File name.
+ @param erp Error report, may be NULL.
+ @return Buffer size for concatenated names including the finalizer
+ byte on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirname or filename is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the calculation results in a numeric overflow.
+*/
+size_t
+dk4strx_path_concatenate_size(
+ wxChar const *dirname,
+ wxChar const *filename,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into an existing buffer.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param buffer Result buffer for combined file name.
+ @param szbuf Buffer size (number of wxChar).
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4strx_path_concatenate_buffer(
+ wxChar *buffer,
+ size_t szbuf,
+ wxChar const *dirn,
+ wxChar const *filen,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into newly
+ allocated memory.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing the
+ concatenation on success, NULL on error.
+ On success use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirn or filen is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+wxChar *
+dk4strx_path_concatenate_new(
+ wxChar const *dirn,
+ wxChar const *filen,
+ dk4_er_t *erp
+);
+
+
+/** Check whether a file name is in specified directory.
+ There is no check for the presence of the file, just
+ a name check.
+ @param filename File name to check.
+ @param parent Directory the file should be in.
+ @param erp Error report, may be NULL.
+ @return Non-zero value if file is in directory, 0 otherwise.
+*/
+int
+dk4strx_path_is_in_subdir(
+ const wxChar *filename,
+ const wxChar *parent,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
+/* vim: set ai sw=4 ts=4 : */
%% module
-#include "dk4strx.h"
+#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
+
+#include "dk4strx.h"
+#include "dk4mem.h"
+#include "dk4mpl.h"
#if DK4_SIZEOF_WXCHAR > 1
#include "dk4strw.h"
+#include "dk4pathw.h"
#else
#include "dk4str8.h"
+#include "dk4path8.h"
#endif
@@ -599,3 +870,223 @@ dk4strx_delnl(wxChar *lptr)
#endif
}
+
+wxChar const *
+dk4strx_get_path_suffix(wxChar const *filename, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_get_suffix(filename, erp));
+#else
+ return (dk4path8_get_suffix(filename, erp));
+#endif
+}
+
+
+
+int
+dk4strx_path_is_absolute(const wxChar *path)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_is_absolute(path));
+#else
+ return (dk4path8_is_absolute(path));
+#endif
+}
+
+
+
+int
+dk4strx_path_is_relative(const wxChar *path)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_is_relative(path));
+#else
+ return (dk4path8_is_relative(path));
+#endif
+}
+
+
+
+int
+dk4strx_path_append(
+ wxChar *buffer, size_t sz, const wxChar *filename, dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_append(buffer, sz, filename, erp));
+#else
+ return (dk4path8_append(buffer, sz, filename, erp));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_path_get_suffix(const wxChar *filename, dk4_er_t *erp)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_get_suffix(filename, erp));
+#else
+ return (dk4path8_get_suffix(filename, erp));
+#endif
+}
+
+
+
+void
+dk4strx_path_correct_sep(wxChar *filename)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ dk4pathw_correct_sep(filename);
+#else
+ dk4path8_correct_sep(filename);
+#endif
+}
+
+
+
+int
+dk4strx_path_must_expand(const wxChar *filename)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_must_expand(filename));
+#else
+ return (dk4path8_must_expand(filename));
+#endif
+}
+
+
+
+int
+dk4strx_path_set_suffix(
+ wxChar *pdst,
+ size_t szdst,
+ wxChar const *srcname,
+ wxChar const *newsu,
+ dk4_er_t *erp
+)
+{
+
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_set_suffix(pdst, szdst, srcname, newsu, erp));
+#else
+ return (dk4path8_set_suffix(pdst, szdst, srcname, newsu, erp));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_path_dup_change_suffix(
+ wxChar const *srcname,
+ wxChar const *newsu,
+ dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_dup_change_suffix(srcname, newsu, erp));
+#else
+ return (dk4path8_dup_change_suffix(srcname, newsu, erp));
+#endif
+}
+
+
+
+size_t
+dk4strx_path_concatenate_size(
+ wxChar const *dirname,
+ wxChar const *filename,
+ dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_concatenate_size(dirname, filename, erp));
+#else
+ return (dk4path8_concatenate_size(dirname, filename, erp));
+#endif
+}
+
+
+
+int
+dk4strx_path_concatenate_buffer(
+ wxChar *buffer,
+ size_t szbuf,
+ wxChar const *dirn,
+ wxChar const *filen,
+ dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_concatenate_buffer(buffer, szbuf, dirn, filen, erp));
+#else
+ return (dk4path8_concatenate_buffer(buffer, szbuf, dirn, filen, erp));
+#endif
+}
+
+
+
+wxChar *
+dk4strx_path_concatenate_new(
+ wxChar const *dirn,
+ wxChar const *filen,
+ dk4_er_t *erp
+)
+{
+#if DK4_SIZEOF_WXCHAR > 1
+ return (dk4pathw_concatenate_new(dirn, filen, erp));
+#else
+ return (dk4path8_concatenate_new(dirn, filen, erp));
+#endif
+}
+
+
+
+int
+dk4strx_path_is_in_subdir(
+ const wxChar *filename,const wxChar *parent,dk4_er_t *erp
+)
+{
+ wxChar buf[DK4_MAX_PATH];
+ size_t szf;
+ size_t szp;
+ int back = 0;
+ $? "+ dk4path_is_in_subdir f=\"%!ws\" p=\"%!ws\"", filename, parent
+ if ((NULL != filename) && (NULL != parent)) {
+ if (0 != dk4strx_cpy_s(buf, DK4_SIZEOF(buf,wxChar), filename, erp)) {
+ szf = dk4strx_len(buf);
+ szp = dk4strx_len(parent);
+ if (szf > szp) { $? ". filename larger than parent"
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
+ if (buf[szp] == wxT('\\'))
+#else
+ if (buf[szp] == wxT('/'))
+#endif
+ { $? ". separator at right place"
+ buf[szp] = wxT('\0');
+ if (0 == dk4strx_pathcmp(buf, parent)) {
+ back = 1; $? ". match"
+ }
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
+ buf[szp] = wxT('\\');
+#else
+ buf[szp] = wxT('/');
+#endif
+ }
+ } else {
+ if (szf == szp) { $? ". equal lengths"
+ if (0 == dk4strx_pathcmp(buf, parent)) {
+ back = 1; $? ". match"
+ }
+ }
+ }
+ }
+ } else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ } $? "- dk4path_is_in_subdir %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dk4strx.h b/support/dktools/dk4strx.h
index cadf1843bc..c8c9c0b99d 100644
--- a/support/dktools/dk4strx.h
+++ b/support/dktools/dk4strx.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4strx.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4strx.cpt
*/
#ifndef DK4STRX_H_INCLUDED
@@ -44,23 +22,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
@@ -92,6 +90,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+
+
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH
+/** File name separator.
+*/
+#define DK4_WX_CHAR_SEP wxT('\\')
+#else
+/** File name separator.
+*/
+#define DK4_WX_CHAR_SEP wxT('/')
+#endif
+
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -337,11 +349,237 @@ dk4strx_rtwh(wxChar *str, const wxChar *whsp);
void
dk4strx_delnl(wxChar *lptr);
+/** Find file name suffix.
+ @param filename File name to find suffix from.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+wxChar const *
+dk4strx_get_path_suffix(wxChar const *filename, dk4_er_t *erp);
+
+/** Check whether a file name is an absolute path.
+ CRT on Windows: Not used.
+ @param path Path name to check.
+ @return 1 for absolute path, 0 for other path.
+*/
+int
+dk4strx_path_is_absolute(const wxChar *path);
+
+/** Check whether a file name is a relative path.
+ CRT on Windows: Not used.
+ @param path Path name to check.
+ @return 1 for absolute path, 0 for other path.
+*/
+int
+dk4strx_path_is_relative(const wxChar *path);
+
+/** Append path filename to path name already stored in buffer.
+ Resolve . and .. for current directory and parent directory.
+ CRT on Windows: Optional, disabling CRT degrades performance.
+ @param buffer Buffer already containing a path.
+ @param sz Buffer size.
+ @param filename Relative file name to append to buffer.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer or filename is NULL or sz is 0,
+ - DK4_E_MATH_OVERFLOW<br>
+ if filename is too long,
+ - DK4_E_MEMORY<br>
+ if allocation of a filename copy fails,
+ - DK4_E_SYNTAX<br>
+ if too many .. in filename,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if buffer size is too small.
+*/
+int
+dk4strx_path_append(
+ wxChar *buffer, size_t sz, const wxChar *filename, dk4_er_t *erp
+);
+
+
+/** Find pointer to suffix.
+ CRT on Windows: Not used.
+ @param filename File name to find suffix for.
+ @param erp Error report, may be NULL.
+ @return Pointer to suffix dot if found, NULL otherwise.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if filename is NULL,
+ - DK4_E_NOT_FOUND<br>
+ if the file name does not contain a suffix.
+*/
+wxChar *
+dk4strx_path_get_suffix(const wxChar *filename, dk4_er_t *erp);
+
+
+/** Correct file name separators from slash to backslash on Windows,
+ vice versa on other systems.
+ CRT on Windows: Not used.
+ @param filename File name to correct.
+*/
+void
+dk4strx_path_correct_sep(wxChar *filename);
+
+/** Check whether file name needs expansion on Windows.
+ CRT on Windows: Not used.
+ @param filename File name to check.
+ @return 1 if expansion is necessary, 0 otherwise.
+*/
+int
+dk4strx_path_must_expand(const wxChar *filename);
+
+/** Create file name with specified suffix.
+ @param pdst Destination buffer.
+ @param szdst Size of pdst (number of wxChar).
+ @param srcname Source file name.
+ @param newsu New file suffix.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if pdst or srcname or newsu is NULL or szdst is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the dst buffer is too small.
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+*/
+int
+dk4strx_path_set_suffix(
+ wxChar *pdst,
+ size_t szdst,
+ wxChar const *srcname,
+ wxChar const *newsu,
+ dk4_er_t *erp
+);
+
+/** Create a dynamic copy of a file name with changed suffix.
+ @param srcname Old file name.
+ @param newsu New suffix.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to changed file name on success, NULL on error.
+ On success call dk4mem_free() on the pointer when no longer needed
+ to release the memory.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if srcname or newsu is NULL,
+ - DK4_E_BUG<br>
+ if a bug occured,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+wxChar *
+dk4strx_path_dup_change_suffix(
+ wxChar const *srcname,
+ wxChar const *newsu,
+ dk4_er_t *erp
+);
+
+/** Calculate buffer size required to concatenate a directory
+ name and a file name.
+ @param dirname Directory name.
+ @param filename File name.
+ @param erp Error report, may be NULL.
+ @return Buffer size for concatenated names including the finalizer
+ byte on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirname or filename is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the calculation results in a numeric overflow.
+*/
+size_t
+dk4strx_path_concatenate_size(
+ wxChar const *dirname,
+ wxChar const *filename,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into an existing buffer.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param buffer Result buffer for combined file name.
+ @param szbuf Buffer size (number of wxChar).
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buffer, dirn or filen is NULL or szbuf is 0,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+int
+dk4strx_path_concatenate_buffer(
+ wxChar *buffer,
+ size_t szbuf,
+ wxChar const *dirn,
+ wxChar const *filen,
+ dk4_er_t *erp
+);
+
+/** Concatenate a directory name and a file name into newly
+ allocated memory.
+ This function simply concatenates directory name and file name,
+ . and .. for current and parent directory are not resolved.
+ @param dirn Directory name.
+ @param filen File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to newly allocated memory containing the
+ concatenation on success, NULL on error.
+ On success use dk4mem_free() to release the memory when done
+ with it.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if dirn or filen is NULL,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the size calculation results in a numeric overflow.
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if the memory allocation failed,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the buffer is too small.
+*/
+wxChar *
+dk4strx_path_concatenate_new(
+ wxChar const *dirn,
+ wxChar const *filen,
+ dk4_er_t *erp
+);
+
+
+/** Check whether a file name is in specified directory.
+ There is no check for the presence of the file, just
+ a name check.
+ @param filename File name to check.
+ @param parent Directory the file should be in.
+ @param erp Error report, may be NULL.
+ @return Non-zero value if file is in directory, 0 otherwise.
+*/
+int
+dk4strx_path_is_in_subdir(
+ const wxChar *filename,
+ const wxChar *parent,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
+/* vim: set ai sw=4 ts=4 : */
#endif
diff --git a/support/dktools/dk4stt.c b/support/dktools/dk4stt.c
index d1f9417479..430e5fcbd0 100644
--- a/support/dktools/dk4stt.c
+++ b/support/dktools/dk4stt.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4stt.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4stt.ctr
*/
/** @file dk4stt.c The dk4stt module.
*/
-#line 99 "dk4stt.ctr"
+#line 113 "dk4stt.ctr"
+#include "dk4conf.h"
#include "dk4error.h"
#include "dk4mem.h"
#include "dk4strd.h"
@@ -46,11 +25,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4stt.h"
#include "dk4tspdk.h"
#include "dk4enc.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 110 "dk4stt.ctr"
+
+#line 133 "dk4stt.ctr"
@@ -61,7 +48,10 @@ dk4stt_close(dk4_string_table_t *ptr)
size_t nstrings;
-#line 119 "dk4stt.ctr"
+#line 142 "dk4stt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (NULL != ptr->strings) {
stptr = ptr->strings;
@@ -77,7 +67,7 @@ dk4stt_close(dk4_string_table_t *ptr)
dk4mem_free(ptr);
}
-#line 133 "dk4stt.ctr"
+#line 159 "dk4stt.ctr"
}
@@ -90,7 +80,11 @@ dk4stt_open(const dkChar *fn, size_t sz, dk4_er_t *erp)
int ok = 0;
-#line 144 "dk4stt.ctr"
+#line 170 "dk4stt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert(0 < sz);
+#endif
if ((NULL != fn) && (0 < sz)) {
back = dk4mem_new(dk4_string_table_t,1,erp);
if (NULL != back) {
@@ -115,7 +109,7 @@ dk4stt_open(const dkChar *fn, size_t sz, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 167 "dk4stt.ctr"
+#line 197 "dk4stt.ctr"
return back;
}
@@ -193,8 +187,8 @@ int
dk4stt_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_string_table_reader_t *reader; /* Reader structure */
@@ -205,18 +199,20 @@ dk4stt_line_handler(
int back = DK4_TSP_RES_ERROR;
-#line 255 "dk4stt.ctr"
+#line 285 "dk4stt.ctr"
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
reader = (dk4_string_table_reader_t *)obj;
if (dkT('#') != line[0]) {
-#line 257 "dk4stt.ctr"
+#line 289 "dk4stt.ctr"
if (reader->curpos < reader->dptr->nstrings) {
-#line 258 "dk4stt.ctr"
+#line 290 "dk4stt.ctr"
linecp = dk4str_dup(line, NULL);
if (NULL != linecp) {
-#line 260 "dk4stt.ctr"
+#line 292 "dk4stt.ctr"
#if TRACE_DEBUG
olcp = linecp;
#endif
@@ -258,27 +254,27 @@ dk4stt_line_handler(
linecp++;
}
-#line 300 "dk4stt.ctr"
+#line 332 "dk4stt.ctr"
} else {
-#line 301 "dk4stt.ctr"
+#line 333 "dk4stt.ctr"
/* Not enough memory. */
back = DK4_TSP_RES_FATAL;
}
} else {
-#line 305 "dk4stt.ctr"
+#line 337 "dk4stt.ctr"
/* More lines than expected, ignore additional lines. */
back = DK4_TSP_RES_OK;
}
} else {
-#line 309 "dk4stt.ctr"
+#line 341 "dk4stt.ctr"
/* Comment line, no processing required. */
back = DK4_TSP_RES_OK;
}
-#line 312 "dk4stt.ctr"
+#line 344 "dk4stt.ctr"
return back;
}
@@ -289,7 +285,6 @@ dk4stt_apply_stream(
dk4_string_table_t *tptr,
dk4_stream_t *strm,
int pre,
- dk4_er_t *erp1,
dk4_er_t *erp2
)
{
@@ -304,10 +299,14 @@ dk4stt_apply_stream(
int back = 0;
-#line 336 "dk4stt.ctr"
+#line 367 "dk4stt.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tptr);
+ assert(NULL != strm);
+#endif
if ((NULL != tptr) && (NULL != strm)) {
-#line 337 "dk4stt.ctr"
+#line 372 "dk4stt.ctr"
dk4error_init(&e1);
dk4error_init(&e2);
reader.dptr = tptr;
@@ -319,7 +318,7 @@ dk4stt_apply_stream(
);
if (0 < back) {
-#line 347 "dk4stt.ctr"
+#line 382 "dk4stt.ctr"
#if VERSION_BEFORE_20150821
cc = 1;
#endif
@@ -329,68 +328,68 @@ dk4stt_apply_stream(
if (0 < dk4stream_read(buf, &rdb, strm, NULL)) {
if (0 < rdb) {
-#line 355 "dk4stt.ctr"
+#line 390 "dk4stt.ctr"
switch (dk4tspdk_add_bytes(&tspdk, (unsigned char *)buf, rdb)) {
case DK4_TSP_RES_OK: {
-#line 357 "dk4stt.ctr"
+#line 392 "dk4stt.ctr"
cc = 1;
} break;
case DK4_TSP_RES_ERROR: {
-#line 360 "dk4stt.ctr"
+#line 395 "dk4stt.ctr"
cc = 1;
} break;
default: {
-#line 363 "dk4stt.ctr"
+#line 398 "dk4stt.ctr"
back = 0;
} break;
}
} else {
-#line 367 "dk4stt.ctr"
+#line 402 "dk4stt.ctr"
}
} else {
-#line 369 "dk4stt.ctr"
+#line 404 "dk4stt.ctr"
}
} while (cc);
if (0 < back) {
-#line 372 "dk4stt.ctr"
+#line 407 "dk4stt.ctr"
if (DK4_TSP_RES_FATAL == dk4tspdk_finish(&tspdk)) {
back = 0;
-#line 374 "dk4stt.ctr"
+#line 409 "dk4stt.ctr"
}
if (0 < back) {
-#line 376 "dk4stt.ctr"
+#line 411 "dk4stt.ctr"
if (reader.curpos < (reader.dptr)->nstrings) {
back = 0;
-#line 378 "dk4stt.ctr"
+#line 413 "dk4stt.ctr"
-#line 379 "dk4stt.ctr"
+#line 414 "dk4stt.ctr"
-#line 380 "dk4stt.ctr"
+#line 415 "dk4stt.ctr"
}
}
}
} else {
-#line 384 "dk4stt.ctr"
+#line 419 "dk4stt.ctr"
}
} else {
-#line 386 "dk4stt.ctr"
+#line 421 "dk4stt.ctr"
dk4error_set_simple_error_code(erp2, DK4_E_INVALID_ARGUMENTS);
}
-#line 388 "dk4stt.ctr"
+#line 423 "dk4stt.ctr"
return back;
}
diff --git a/support/dktools/dk4stt.ctr b/support/dktools/dk4stt.ctr
index c25271ed27..24583f4b09 100644
--- a/support/dktools/dk4stt.ctr
+++ b/support/dktools/dk4stt.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -17,19 +17,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** String table.
@@ -60,7 +76,6 @@ dk4stt_open(const dkChar *fn, size_t sz, dk4_er_t *erp);
@param tptr String table to configure.
@param strm Text stream, opened for reading.
@param pre Processing encoding.
- @param erp1 Error report for decoding/encoding, may be NULL.
@param erp2 Error report for processing, may be NULL.
@return 1 on success, 0 on error.
*/
@@ -69,7 +84,6 @@ dk4stt_apply_stream(
dk4_string_table_t *tptr,
dk4_stream_t *strm,
int pre,
- dk4_er_t *erp1,
dk4_er_t *erp2
);
@@ -97,6 +111,7 @@ dk4stt_compare(const void *l, const void *r, int cr);
%% module
+#include "dk4conf.h"
#include "dk4error.h"
#include "dk4mem.h"
#include "dk4strd.h"
@@ -104,6 +119,14 @@ dk4stt_compare(const void *l, const void *r, int cr);
#include "dk4stt.h"
#include "dk4tspdk.h"
#include "dk4enc.h"
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -116,6 +139,9 @@ dk4stt_close(dk4_string_table_t *ptr)
dkChar **stptr;
size_t nstrings;
$? "+ dk4stt_close"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (NULL != ptr->strings) {
stptr = ptr->strings;
@@ -141,6 +167,10 @@ dk4stt_open(const dkChar *fn, size_t sz, dk4_er_t *erp)
dkChar **stptr = NULL;
int ok = 0;
$? "+ dk4stt_open \"%!ds\" %u", TR_DKSTR(fn), (unsigned)sz
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert(0 < sz);
+#endif
if ((NULL != fn) && (0 < sz)) {
back = dk4mem_new(dk4_string_table_t,1,erp);
if (NULL != back) {
@@ -241,8 +271,8 @@ int
dk4stt_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t DK4_ARG_UNUSED(lineno),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
dk4_string_table_reader_t *reader; /* Reader structure */
@@ -252,6 +282,8 @@ dk4stt_line_handler(
dkChar *linecp; /* Copy of line */
int back = DK4_TSP_RES_ERROR;
$? "+ dk4stt_line_handler \"%!ds\"", line
+ DK4_UNUSED_ARG(lineno)
+ DK4_UNUSED_ARG(erp)
reader = (dk4_string_table_reader_t *)obj;
if (dkT('#') != line[0]) { $? ". data line %lu", (unsigned long)(reader->curpos)
if (reader->curpos < reader->dptr->nstrings) { $? ". need processing"
@@ -319,7 +351,6 @@ dk4stt_apply_stream(
dk4_string_table_t *tptr,
dk4_stream_t *strm,
int pre,
- dk4_er_t *erp1,
dk4_er_t *erp2
)
{
@@ -333,6 +364,10 @@ dk4stt_apply_stream(
int cc; /* Flag: Can continue */
int back = 0;
$? "+ dk4stt_apply_stream"
+#if DK4_USE_ASSERT
+ assert(NULL != tptr);
+ assert(NULL != strm);
+#endif
if ((NULL != tptr) && (NULL != strm)) { $? ". args ok"
dk4error_init(&e1);
dk4error_init(&e2);
diff --git a/support/dktools/dk4stt.h b/support/dktools/dk4stt.h
index 3edd818bf6..642ee126da 100644
--- a/support/dktools/dk4stt.h
+++ b/support/dktools/dk4stt.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4stt.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4stt.ctr
*/
#ifndef DK4STT_H_INCLUDED
@@ -50,19 +28,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** String table.
@@ -93,7 +87,6 @@ dk4stt_open(const dkChar *fn, size_t sz, dk4_er_t *erp);
@param tptr String table to configure.
@param strm Text stream, opened for reading.
@param pre Processing encoding.
- @param erp1 Error report for decoding/encoding, may be NULL.
@param erp2 Error report for processing, may be NULL.
@return 1 on success, 0 on error.
*/
@@ -102,7 +95,6 @@ dk4stt_apply_stream(
dk4_string_table_t *tptr,
dk4_stream_t *strm,
int pre,
- dk4_er_t *erp1,
dk4_er_t *erp2
);
diff --git a/support/dktools/dk4svbuf.c b/support/dktools/dk4svbuf.c
index eb5c75d8ba..53c9edb29d 100644
--- a/support/dktools/dk4svbuf.c
+++ b/support/dktools/dk4svbuf.c
@@ -1,51 +1,43 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4svbuf.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4svbuf.ctr
*/
/** @file dk4svbuf.c The dk4svbuf module.
*/
-#line 60 "dk4svbuf.ctr"
+#line 77 "dk4svbuf.ctr"
+#include "dk4conf.h"
#include "dk4svbuf.h"
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 66 "dk4svbuf.ctr"
+#line 97 "dk4svbuf.ctr"
@@ -71,6 +63,9 @@ dk4setvbuf(
#endif
int btp;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
btp = (
((0 <= (int)tp) && (3 > (int)tp))
@@ -78,6 +73,7 @@ dk4setvbuf(
: (buffering_types[2])
);
#if DK4_HAVE_SETVBUF
+ errno = 0;
svbres = setvbuf(
fipo,
((0 < szbuf) ? (pbuf) : (NULL)),
@@ -88,7 +84,7 @@ dk4setvbuf(
back = 1;
}
else {
- dk4error_set_simple_error_code(erp, DK4_E_SYSTEM);
+ dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
}
#else
#if DK4_HAVE_SETBUFFER
diff --git a/support/dktools/dk4svbuf.ctr b/support/dktools/dk4svbuf.ctr
index 4bba80db63..7abd3768fd 100644
--- a/support/dktools/dk4svbuf.ctr
+++ b/support/dktools/dk4svbuf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,7 +10,11 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -19,7 +23,11 @@ license = bsd
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** How to buffer a file.
@@ -41,6 +49,15 @@ extern "C" {
@param szbuf Size of buffer, may be 0.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fipo is NULL,
+ - DK4_E_NOT_SUPPORTED<br>
+ if neither the setbuffer function nor the setvbuf() function
+ is available on the system.
+ - DK4_E_SYSTEM<br>
+ if setvbuf() indicated an error.
*/
int
dk4setvbuf(
@@ -59,8 +76,22 @@ dk4setvbuf(
%% module
+#include "dk4conf.h"
#include "dk4svbuf.h"
+#if DK4_HAVE_ERRNO_H
+#ifndef ERRNO_H_INCLUDED
+#include <errno.h>
+#define ERRNO_H_INCLUDED 1
+#endif
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -88,6 +119,9 @@ dk4setvbuf(
#endif
int btp;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
btp = (
((0 <= (int)tp) && (3 > (int)tp))
@@ -95,6 +129,7 @@ dk4setvbuf(
: (buffering_types[2])
);
#if DK4_HAVE_SETVBUF
+ errno = 0;
svbres = setvbuf(
fipo,
((0 < szbuf) ? (pbuf) : (NULL)),
@@ -105,7 +140,7 @@ dk4setvbuf(
back = 1;
}
else {
- dk4error_set_simple_error_code(erp, DK4_E_SYSTEM);
+ dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
}
#else
#if DK4_HAVE_SETBUFFER
diff --git a/support/dktools/dk4svbuf.h b/support/dktools/dk4svbuf.h
index a609b79009..84340eee43 100644
--- a/support/dktools/dk4svbuf.h
+++ b/support/dktools/dk4svbuf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4svbuf.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4svbuf.ctr
*/
#ifndef DK4SVBUF_H_INCLUDED
@@ -44,7 +22,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -53,7 +35,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
/** How to buffer a file.
@@ -75,6 +61,15 @@ extern "C" {
@param szbuf Size of buffer, may be 0.
@param erp Error report, may be NULL.
@return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if fipo is NULL,
+ - DK4_E_NOT_SUPPORTED<br>
+ if neither the setbuffer function nor the setvbuf() function
+ is available on the system.
+ - DK4_E_SYSTEM<br>
+ if setvbuf() indicated an error.
*/
int
dk4setvbuf(
diff --git a/support/dktools/dk4svbufa.c b/support/dktools/dk4svbufa.c
index 3ae3743205..ef2d404bb2 100644
--- a/support/dktools/dk4svbufa.c
+++ b/support/dktools/dk4svbufa.c
@@ -1,52 +1,37 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4svbufa.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4svbufa.ctr
*/
/** @file dk4svbufa.c The dk4svbufa module.
*/
-#line 60 "dk4svbufa.ctr"
+#line 72 "dk4svbufa.ctr"
+#include "dk4conf.h"
#include "dk4svbufa.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 67 "dk4svbufa.ctr"
+#line 86 "dk4svbufa.ctr"
@@ -56,7 +41,7 @@ dk4setvbuf_app(
dk4_file_buffering_t btype,
char *pbuf,
size_t szbuf,
- const char *fn,
+ const dkChar *fn,
dk4_app_t *app
)
{
@@ -64,6 +49,9 @@ dk4setvbuf_app(
int back = 0;
int ll = DK4_LL_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
dk4error_init(&er);
back = dk4setvbuf(fipo, btype, pbuf, szbuf, &er);
@@ -71,16 +59,14 @@ dk4setvbuf_app(
if (0 != back) {
ll = DK4_LL_WARNING;
}
- switch (er.ec) {
- if (NULL != fn) {
- dk4app_log_base3(app, ll, 156, 157, fn);
- }
- else {
- dk4app_log_base1(app, ll, 155);
- }
- if (DK4_E_NOT_SUPPORTED == er.ec) {
- dk4app_log_base1(app, ll, 158);
- }
+ if (NULL != fn) {
+ dk4app_log_base3(app, ll, 156, 157, fn);
+ }
+ else {
+ dk4app_log_base1(app, ll, 155);
+ }
+ if (DK4_E_NOT_SUPPORTED == er.ec) {
+ dk4app_log_base1(app, ll, 158);
}
}
}
diff --git a/support/dktools/dk4svbufa.ctr b/support/dktools/dk4svbufa.ctr
index 955b8a9613..3a7b1c186c 100644
--- a/support/dktools/dk4svbufa.ctr
+++ b/support/dktools/dk4svbufa.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -10,7 +10,11 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -19,11 +23,19 @@ license = bsd
#endif
#ifndef DK4SVBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4svbuf.h"
+#else
+#include <dktools-4/dk4svbuf.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
@@ -47,7 +59,7 @@ dk4setvbuf_app(
dk4_file_buffering_t btype,
char *pbuf,
size_t szbuf,
- const char *fn,
+ const dkChar *fn,
dk4_app_t *app
);
@@ -59,8 +71,15 @@ dk4setvbuf_app(
%% module
+#include "dk4conf.h"
#include "dk4svbufa.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -73,7 +92,7 @@ dk4setvbuf_app(
dk4_file_buffering_t btype,
char *pbuf,
size_t szbuf,
- const char *fn,
+ const dkChar *fn,
dk4_app_t *app
)
{
@@ -81,6 +100,9 @@ dk4setvbuf_app(
int back = 0;
int ll = DK4_LL_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != fipo);
+#endif
if (NULL != fipo) {
dk4error_init(&er);
back = dk4setvbuf(fipo, btype, pbuf, szbuf, &er);
@@ -88,16 +110,14 @@ dk4setvbuf_app(
if (0 != back) {
ll = DK4_LL_WARNING;
}
- switch (er.ec) {
- if (NULL != fn) {
- dk4app_log_base3(app, ll, 156, 157, fn);
- }
- else {
- dk4app_log_base1(app, ll, 155);
- }
- if (DK4_E_NOT_SUPPORTED == er.ec) {
- dk4app_log_base1(app, ll, 158);
- }
+ if (NULL != fn) {
+ dk4app_log_base3(app, ll, 156, 157, fn);
+ }
+ else {
+ dk4app_log_base1(app, ll, 155);
+ }
+ if (DK4_E_NOT_SUPPORTED == er.ec) {
+ dk4app_log_base1(app, ll, 158);
}
}
}
diff --git a/support/dktools/dk4svbufa.h b/support/dktools/dk4svbufa.h
index ef279fb714..2261b069e2 100644
--- a/support/dktools/dk4svbufa.h
+++ b/support/dktools/dk4svbufa.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4svbufa.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4svbufa.ctr
*/
#ifndef DK4SVBUFA_H_INCLUDED
@@ -44,7 +22,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef STDIO_H_INCLUDED
@@ -53,11 +35,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef DK4SVBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4svbuf.h"
+#else
+#include <dktools-4/dk4svbuf.h>
+#endif
#endif
#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
#endif
@@ -81,7 +71,7 @@ dk4setvbuf_app(
dk4_file_buffering_t btype,
char *pbuf,
size_t szbuf,
- const char *fn,
+ const dkChar *fn,
dk4_app_t *app
);
diff --git a/support/dktools/dk4symlink.c b/support/dktools/dk4symlink.c
index 39f4fb57ea..d1cd97dece 100644
--- a/support/dktools/dk4symlink.c
+++ b/support/dktools/dk4symlink.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4symlink.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4symlink.ctr
*/
/** @file dk4symlink.c The dk4symlink module.
*/
-#line 61 "dk4symlink.ctr"
+#line 73 "dk4symlink.ctr"
+#include "dk4conf.h"
#include "dk4symlink.h"
#if DK4_ON_WINDOWS
@@ -68,6 +47,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mpl.h"
#include "dk4mem.h"
#include "dk4strd.h"
@@ -76,7 +62,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 98 "dk4symlink.ctr"
+#line 118 "dk4symlink.ctr"
@@ -148,6 +134,11 @@ dk4symlink_copy_string(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < szb);
+ assert(NULL != sptr);
+#endif
if ((length / sizeof(wchar_t)) < szb) {
DK4_MEMCPY(bptr,&(sptr[offs / sizeof(wchar_t)]),length);
bptr[length / sizeof(wchar_t)] = L'\0';
@@ -178,7 +169,12 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
-#line 198 "dk4symlink.ctr"
+#line 223 "dk4symlink.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < szb);
+ assert(NULL != fn);
+#endif
if ((NULL != bptr) && (NULL != fn) && (0 < szb)) {
*bptr = dkT('\0');
#if DK4_ON_WINDOWS
@@ -205,14 +201,14 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
#else
-#line 223 "dk4symlink.ctr"
+#line 253 "dk4symlink.ctr"
#endif
if (0 == back) {
#if defined(FSCTL_GET_REPARSE_POINT)
/* !!!!! Second attempt with legacy procedure */
-#line 228 "dk4symlink.ctr"
+#line 258 "dk4symlink.ctr"
fh = CreateFileW(
fn,
FILE_READ_ATTRIBUTES,
@@ -229,7 +225,7 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
if (INVALID_HANDLE_VALUE != fh) {
dwres = 0;
-#line 243 "dk4symlink.ctr"
+#line 273 "dk4symlink.ctr"
result = DeviceIoControl(
fh,
FSCTL_GET_REPARSE_POINT,
@@ -242,12 +238,12 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
);
if (result) {
-#line 254 "dk4symlink.ctr"
+#line 284 "dk4symlink.ctr"
rdb = (REPARSE_DATA_BUFFER *)repdabuf;
if (IO_REPARSE_TAG_MOUNT_POINT == rdb->ReparseTag) {
-#line 257 "dk4symlink.ctr"
+#line 287 "dk4symlink.ctr"
back = dk4symlink_copy_string(
bptr, szb,
&(rdb->MountPointReparseBuffer.PathBuffer[0]),
@@ -259,7 +255,7 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
if (IO_REPARSE_TAG_SYMLINK == rdb->ReparseTag) {
-#line 267 "dk4symlink.ctr"
+#line 297 "dk4symlink.ctr"
back = dk4symlink_copy_string(
bptr, szb,
&(rdb->SymbolicLinkReparseBuffer.PathBuffer[0]),
@@ -271,18 +267,18 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
/* !!!!! Not mount point, not symlink */
-#line 277 "dk4symlink.ctr"
+#line 307 "dk4symlink.ctr"
}
}
} else {
-#line 280 "dk4symlink.ctr"
+#line 310 "dk4symlink.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
CloseHandle(fh);
} else {
-#line 284 "dk4symlink.ctr"
+#line 314 "dk4symlink.ctr"
dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
}
#else
@@ -335,18 +331,18 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
errno = 0;
res = readlink(fn, bptr, szb);
if (0 < res) {
- if (res < szb) {
+ if ((size_t)res < szb) {
bptr[res] = dkT('\0');
back = 1;
} else {
-#line 340 "dk4symlink.ctr"
+#line 370 "dk4symlink.ctr"
bptr[0] = dkT('\0');
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 344 "dk4symlink.ctr"
+#line 374 "dk4symlink.ctr"
bptr[0] = dkT('\0');
if (0 > res) {
dk4error_set_idetails(erp, DK4_E_SYSTEM, errno);
@@ -359,7 +355,7 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 355 "dk4symlink.ctr"
+#line 385 "dk4symlink.ctr"
return back;
}
diff --git a/support/dktools/dk4symlink.ctr b/support/dktools/dk4symlink.ctr
index 1b3138b0e6..9b76ec0ac4 100644
--- a/support/dktools/dk4symlink.ctr
+++ b/support/dktools/dk4symlink.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,15 +12,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -59,6 +71,7 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4symlink.h"
#if DK4_ON_WINDOWS
@@ -88,6 +101,13 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mpl.h"
#include "dk4mem.h"
#include "dk4strd.h"
@@ -166,6 +186,11 @@ dk4symlink_copy_string(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < szb);
+ assert(NULL != sptr);
+#endif
if ((length / sizeof(wchar_t)) < szb) {
DK4_MEMCPY(bptr,&(sptr[offs / sizeof(wchar_t)]),length);
bptr[length / sizeof(wchar_t)] = L'\0';
@@ -195,6 +220,11 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
int back = 0;
$? "+ dk4symlink_target"
+#if DK4_USE_ASSERT
+ assert(NULL != bptr);
+ assert(0 < szb);
+ assert(NULL != fn);
+#endif
if ((NULL != bptr) && (NULL != fn) && (0 < szb)) {
*bptr = dkT('\0');
#if DK4_ON_WINDOWS
@@ -333,7 +363,7 @@ dk4symlink_target(dkChar *bptr, size_t szb, const dkChar *fn, dk4_er_t *erp)
errno = 0;
res = readlink(fn, bptr, szb);
if (0 < res) {
- if (res < szb) {
+ if ((size_t)res < szb) {
bptr[res] = dkT('\0');
back = 1;
} else { $? "! readlink requires larger buffer"
diff --git a/support/dktools/dk4symlink.h b/support/dktools/dk4symlink.h
index f9844ebeae..6e2cb8c44b 100644
--- a/support/dktools/dk4symlink.h
+++ b/support/dktools/dk4symlink.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4symlink.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4symlink.ctr
*/
#ifndef DK4SYMLINK_H_INCLUDED
@@ -44,15 +22,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4time.c b/support/dktools/dk4time.c
index df2fc9ec13..8e92613c72 100644
--- a/support/dktools/dk4time.c
+++ b/support/dktools/dk4time.c
@@ -1,60 +1,52 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4time.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4time.ctr
*/
/** @file dk4time.c The dk4time module.
*/
-#line 81 "dk4time.ctr"
+#line 93 "dk4time.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4time.h"
+#if 0
static const char * const dk4time_kw[] = {
/* 0 */ "0",
/* 1 */ " ",
/* 2 */ "-",
/* 3 */ ":"
};
+#endif
void
dk4time_get(dk4_time_t *timer)
{
+#if DK4_USE_ASSERT
+ assert(NULL != timer);
+#endif
#if DK4_ON_WINDOWS
(void)_time64(timer);
#else
diff --git a/support/dktools/dk4time.ctr b/support/dktools/dk4time.ctr
index 374c3abac3..23c7fb9cbf 100644
--- a/support/dktools/dk4time.ctr
+++ b/support/dktools/dk4time.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,15 +16,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_TIME_WITH_SYS_TIME
@@ -79,22 +91,36 @@ dk4time_get(dk4_time_t *timer);
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4time.h"
+#if 0
static const char * const dk4time_kw[] = {
/* 0 */ "0",
/* 1 */ " ",
/* 2 */ "-",
/* 3 */ ":"
};
+#endif
void
dk4time_get(dk4_time_t *timer)
{
+#if DK4_USE_ASSERT
+ assert(NULL != timer);
+#endif
#if DK4_ON_WINDOWS
(void)_time64(timer);
#else
diff --git a/support/dktools/dk4time.h b/support/dktools/dk4time.h
index 4b8a22650a..c0341f0f75 100644
--- a/support/dktools/dk4time.h
+++ b/support/dktools/dk4time.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4time.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4time.ctr
*/
#ifndef DK4TIME_H_INCLUDED
@@ -48,15 +26,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_TIME_WITH_SYS_TIME
diff --git a/support/dktools/dk4time08.c b/support/dktools/dk4time08.c
index e3f9449f34..8d0b2a6f7e 100644
--- a/support/dktools/dk4time08.c
+++ b/support/dktools/dk4time08.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4time08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4time08.ctr
*/
/** @file dk4time08.c The dk4time08 module.
*/
-#line 132 "dk4time08.ctr"
+#line 152 "dk4time08.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4time08.h"
@@ -53,7 +40,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 146 "dk4time08.ctr"
+#line 175 "dk4time08.ctr"
@@ -81,7 +68,7 @@ static const char * const dk4time08_kw[] = {
NULL
-#line 160 "dk4time08.ctr"
+#line 189 "dk4time08.ctr"
};
@@ -108,6 +95,10 @@ dk4time_to_text_c8(
char bse[8];
int res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) {
back = 1;
res = dk4ma_write_c8_decimal_unsigned(
@@ -215,13 +206,22 @@ dk4time_convert_to_text_c8(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != tm);
+#endif
if ((NULL != dptr) && (0 < dsz)) {
*dptr = '\0';
if (NULL != tm) {
back = dk4time_to_text_c8(
dptr, dsz, DK4_TIMEFORMAT_DATE_TIME,
- (1900 + tm->tm_year), (1 + tm->tm_mon), tm->tm_mday,
- tm->tm_hour, tm->tm_min, tm->tm_sec,
+ (unsigned short)(1900 + tm->tm_year),
+ (unsigned short)(1 + tm->tm_mon),
+ (unsigned short)(tm->tm_mday),
+ (unsigned short)(tm->tm_hour),
+ (unsigned short)(tm->tm_min),
+ (unsigned short)(tm->tm_sec),
erp
);
} else {
@@ -245,6 +245,11 @@ dk4time_i_as_text_c8(
/* +++ Windows */
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if (0 == _localtime64_s(&lct, timer)) {
back = dk4time_convert_to_text_c8(dptr, dsz, &lct, erp);
} else {
@@ -257,6 +262,11 @@ dk4time_i_as_text_c8(
#if DK4_HAVE_LOCALTIME_R
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if (NULL != localtime_r(timer, &lct)) {
back = dk4time_convert_to_text_c8(dptr, dsz, &lct, erp);
} else {
@@ -279,6 +289,11 @@ dk4time_as_text_c8(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if ((NULL != dptr) && (0 < dsz)) {
*dptr = '\0';
if (NULL != timer) {
diff --git a/support/dktools/dk4time08.ctr b/support/dktools/dk4time08.ctr
index a85cba406e..6abffd9f12 100644
--- a/support/dktools/dk4time08.ctr
+++ b/support/dktools/dk4time08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -16,23 +16,43 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#ifndef DK4TIMEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4timec.h"
+#else
+#include <dktools-4/dk4timec.h>
+#endif
#endif
#ifdef __cplusplus
@@ -130,6 +150,15 @@ dk4time_as_text_c8(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4time08.h"
#ifndef DK4STR8_H_INCLUDED
@@ -183,6 +212,10 @@ dk4time_to_text_c8(
char bse[8];
int res;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
if ((NULL != dptr) && (0 < dsz)) {
back = 1;
res = dk4ma_write_c8_decimal_unsigned(
@@ -290,13 +323,22 @@ dk4time_convert_to_text_c8(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != tm);
+#endif
if ((NULL != dptr) && (0 < dsz)) {
*dptr = '\0';
if (NULL != tm) {
back = dk4time_to_text_c8(
dptr, dsz, DK4_TIMEFORMAT_DATE_TIME,
- (1900 + tm->tm_year), (1 + tm->tm_mon), tm->tm_mday,
- tm->tm_hour, tm->tm_min, tm->tm_sec,
+ (unsigned short)(1900 + tm->tm_year),
+ (unsigned short)(1 + tm->tm_mon),
+ (unsigned short)(tm->tm_mday),
+ (unsigned short)(tm->tm_hour),
+ (unsigned short)(tm->tm_min),
+ (unsigned short)(tm->tm_sec),
erp
);
} else {
@@ -320,6 +362,11 @@ dk4time_i_as_text_c8(
/* +++ Windows */
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if (0 == _localtime64_s(&lct, timer)) {
back = dk4time_convert_to_text_c8(dptr, dsz, &lct, erp);
} else {
@@ -332,6 +379,11 @@ dk4time_i_as_text_c8(
#if DK4_HAVE_LOCALTIME_R
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if (NULL != localtime_r(timer, &lct)) {
back = dk4time_convert_to_text_c8(dptr, dsz, &lct, erp);
} else {
@@ -354,6 +406,11 @@ dk4time_as_text_c8(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if ((NULL != dptr) && (0 < dsz)) {
*dptr = '\0';
if (NULL != timer) {
diff --git a/support/dktools/dk4time08.h b/support/dktools/dk4time08.h
index 555a7873a1..f9804ca02e 100644
--- a/support/dktools/dk4time08.h
+++ b/support/dktools/dk4time08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4time08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4time08.ctr
*/
#ifndef DK4TIME08_H_INCLUDED
@@ -49,23 +27,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#ifndef DK4TIMEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4timec.h"
+#else
+#include <dktools-4/dk4timec.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4timec.h b/support/dktools/dk4timec.h
index 6a8219dc98..a66b1b155c 100644
--- a/support/dktools/dk4timec.h
+++ b/support/dktools/dk4timec.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4TIMEC_H_INCLUDED
/** Protection against multiple inclusions */
#define DK4TIMEC_H_INCLUDED 1
diff --git a/support/dktools/dk4timedk.c b/support/dktools/dk4timedk.c
index abe6c20ffe..42ef66a4b5 100644
--- a/support/dktools/dk4timedk.c
+++ b/support/dktools/dk4timedk.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4timedk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4timedk.ctr
*/
/** @file dk4timedk.c The dk4timedk module.
*/
-#line 132 "dk4timedk.ctr"
+#line 152 "dk4timedk.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4timedk.h"
@@ -67,6 +54,10 @@ dk4time_to_text(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4time_to_text_wc(dptr,dsz,format,year,month,mday,hour,min,sec,erp));
#else
@@ -81,6 +72,11 @@ dk4time_convert_to_text(
dkChar *dptr, size_t dsz, const struct tm *tm, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != tm);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4time_convert_to_text_wc(dptr, dsz, tm, erp));
#else
@@ -95,6 +91,11 @@ dk4time_as_text(
dkChar *dptr, size_t dsz, const dk4_time_t *timer, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4time_as_text_wc(dptr, dsz, timer, erp));
#else
diff --git a/support/dktools/dk4timedk.ctr b/support/dktools/dk4timedk.ctr
index 5628a52faf..2a1205cfd5 100644
--- a/support/dktools/dk4timedk.ctr
+++ b/support/dktools/dk4timedk.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,23 +15,43 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#ifndef DK4TIMEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4timec.h"
+#else
+#include <dktools-4/dk4timec.h>
+#endif
#endif
#ifdef __cplusplus
@@ -130,6 +150,15 @@ dk4time_as_text(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4timedk.h"
#if DK4_CHAR_SIZE > 1
@@ -158,6 +187,10 @@ dk4time_to_text(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4time_to_text_wc(dptr,dsz,format,year,month,mday,hour,min,sec,erp));
#else
@@ -172,6 +205,11 @@ dk4time_convert_to_text(
dkChar *dptr, size_t dsz, const struct tm *tm, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != tm);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4time_convert_to_text_wc(dptr, dsz, tm, erp));
#else
@@ -186,6 +224,11 @@ dk4time_as_text(
dkChar *dptr, size_t dsz, const dk4_time_t *timer, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4time_as_text_wc(dptr, dsz, timer, erp));
#else
diff --git a/support/dktools/dk4timedk.h b/support/dktools/dk4timedk.h
index 76ff344f31..6df4975333 100644
--- a/support/dktools/dk4timedk.h
+++ b/support/dktools/dk4timedk.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4timedk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4timedk.ctr
*/
#ifndef DK4TIMEDK_H_INCLUDED
@@ -47,23 +25,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#ifndef DK4TIMEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4timec.h"
+#else
+#include <dktools-4/dk4timec.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4timewc.c b/support/dktools/dk4timewc.c
index 635aad3bd4..d810790efb 100644
--- a/support/dktools/dk4timewc.c
+++ b/support/dktools/dk4timewc.c
@@ -1,43 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4timewc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4timewc.ctr
*/
/** @file dk4timewc.c The dk4timewc module.
*/
-#line 132 "dk4timewc.ctr"
+#line 152 "dk4timewc.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
#include "dk4timewc.h"
@@ -67,6 +54,10 @@ dk4time_to_text_wc(
{
char buffer[64];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
back = dk4time_to_text_c8(
buffer, sizeof(buffer), format, year, month, mday, hour, min, sec, erp
);
@@ -84,13 +75,22 @@ dk4time_convert_to_text_wc(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != tm);
+#endif
if ((NULL != dptr) && (0 < dsz)) {
*dptr = L'\0';
if (NULL != tm) {
back = dk4time_to_text_wc(
dptr, dsz, DK4_TIMEFORMAT_DATE_TIME,
- (1900 + tm->tm_year), (1 + tm->tm_mon), tm->tm_mday,
- tm->tm_hour, tm->tm_min, tm->tm_sec,
+ (unsigned short)(1900 + tm->tm_year),
+ (unsigned short)(1 + tm->tm_mon),
+ (unsigned short)(tm->tm_mday),
+ (unsigned short)(tm->tm_hour),
+ (unsigned short)(tm->tm_min),
+ (unsigned short)(tm->tm_sec),
erp
);
} else {
@@ -114,6 +114,11 @@ dk4time_i_as_text_wc(
/* +++ Windows */
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if (0 == _localtime64_s(&lct, timer)) {
back = dk4time_convert_to_text_wc(dptr, dsz, &lct, erp);
} else {
@@ -126,6 +131,11 @@ dk4time_i_as_text_wc(
#if DK4_HAVE_LOCALTIME_R
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if (NULL != localtime_r(timer, &lct)) {
back = dk4time_convert_to_text_wc(dptr, dsz, &lct, erp);
} else {
@@ -148,6 +158,11 @@ dk4time_as_text_wc(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if ((dptr != NULL) && (0 < dsz)) {
*dptr = L'\0';
if (NULL != timer) {
diff --git a/support/dktools/dk4timewc.ctr b/support/dktools/dk4timewc.ctr
index 70c74ff278..54fedc4d16 100644
--- a/support/dktools/dk4timewc.ctr
+++ b/support/dktools/dk4timewc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,23 +15,43 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#ifndef DK4TIMEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4timec.h"
+#else
+#include <dktools-4/dk4timec.h>
+#endif
#endif
#ifdef __cplusplus
@@ -130,6 +150,15 @@ dk4time_as_text_wc(
%% module
+#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4timewc.h"
#ifndef DK4TIME08_H_INCLUDED
@@ -158,6 +187,10 @@ dk4time_to_text_wc(
{
char buffer[64];
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+#endif
back = dk4time_to_text_c8(
buffer, sizeof(buffer), format, year, month, mday, hour, min, sec, erp
);
@@ -175,13 +208,22 @@ dk4time_convert_to_text_wc(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != tm);
+#endif
if ((NULL != dptr) && (0 < dsz)) {
*dptr = L'\0';
if (NULL != tm) {
back = dk4time_to_text_wc(
dptr, dsz, DK4_TIMEFORMAT_DATE_TIME,
- (1900 + tm->tm_year), (1 + tm->tm_mon), tm->tm_mday,
- tm->tm_hour, tm->tm_min, tm->tm_sec,
+ (unsigned short)(1900 + tm->tm_year),
+ (unsigned short)(1 + tm->tm_mon),
+ (unsigned short)(tm->tm_mday),
+ (unsigned short)(tm->tm_hour),
+ (unsigned short)(tm->tm_min),
+ (unsigned short)(tm->tm_sec),
erp
);
} else {
@@ -205,6 +247,11 @@ dk4time_i_as_text_wc(
/* +++ Windows */
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if (0 == _localtime64_s(&lct, timer)) {
back = dk4time_convert_to_text_wc(dptr, dsz, &lct, erp);
} else {
@@ -217,6 +264,11 @@ dk4time_i_as_text_wc(
#if DK4_HAVE_LOCALTIME_R
struct tm lct;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if (NULL != localtime_r(timer, &lct)) {
back = dk4time_convert_to_text_wc(dptr, dsz, &lct, erp);
} else {
@@ -239,6 +291,11 @@ dk4time_as_text_wc(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != timer);
+#endif
if ((dptr != NULL) && (0 < dsz)) {
*dptr = L'\0';
if (NULL != timer) {
diff --git a/support/dktools/dk4timewc.h b/support/dktools/dk4timewc.h
index f5dbf1c70e..23869b2f16 100644
--- a/support/dktools/dk4timewc.h
+++ b/support/dktools/dk4timewc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4timewc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4timewc.ctr
*/
#ifndef DK4TIMEWC_H_INCLUDED
@@ -47,23 +25,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4TIME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4time.h"
+#else
+#include <dktools-4/dk4time.h>
+#endif
#endif
#ifndef DK4TIMEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4timec.h"
+#else
+#include <dktools-4/dk4timec.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4tsp.h b/support/dktools/dk4tsp.h
index d231af5a5a..fd20ba0015 100644
--- a/support/dktools/dk4tsp.h
+++ b/support/dktools/dk4tsp.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4TSP_H_INCLUDED
#define DK4TSP_H_INCLUDED 1
@@ -5,11 +10,19 @@
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
/** Position in a data stream.
diff --git a/support/dktools/dk4tsp08.c b/support/dktools/dk4tsp08.c
index 0a42521f52..12ecc9c87e 100644
--- a/support/dktools/dk4tsp08.c
+++ b/support/dktools/dk4tsp08.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tsp08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tsp08.ctr
*/
/** @file dk4tsp08.c The dk4tsp08 module.
*/
-#line 254 "dk4tsp08.ctr"
+#line 286 "dk4tsp08.ctr"
+#include "dk4conf.h"
#include "dk4tsp.h"
#include "dk4tsp08.h"
#include "dk4mem.h"
@@ -48,12 +27,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4utf16.h"
#include "dk4c32.h"
#include "dk4bom.h"
+#include "dk4rec26.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 268 "dk4tsp08.ctr"
+#line 308 "dk4tsp08.ctr"
@@ -67,7 +53,10 @@ dk4tsp08_init(dk4_tsp08_t *tsp, int eie)
{
-#line 280 "dk4tsp08.ctr"
+#line 320 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
DK4_MEMRES(tsp, sizeof(dk4_tsp08_t));
dk4bom_detect_init(&(tsp->bomd), eie);
dk4error_init(&(tsp->er_en));
@@ -81,18 +70,18 @@ dk4tsp08_init(dk4_tsp08_t *tsp, int eie)
tsp->upt = 0;
tsp->pen = 0;
-#line 292 "dk4tsp08.ctr"
+#line 335 "dk4tsp08.ctr"
tsp->pst = 0;
tsp->pth = 0;
(tsp->pos).bytes = (dk4_um_t)0UL;
(tsp->pos).chars = (dk4_um_t)1UL;
-#line 296 "dk4tsp08.ctr"
+#line 339 "dk4tsp08.ctr"
(tsp->pos).lineno = (dk4_um_t)1UL;
(tsp->pos).charil = (dk4_um_t)1UL;
-#line 299 "dk4tsp08.ctr"
+#line 342 "dk4tsp08.ctr"
}
@@ -106,7 +95,10 @@ dk4tsp08_initialize_decoder(dk4_tsp08_t *tsp)
{
-#line 311 "dk4tsp08.ctr"
+#line 354 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (0 == tsp->pth) {
switch (tsp->ief) {
case DK4_FILE_ENCODING_UTF8: {
@@ -127,7 +119,7 @@ dk4tsp08_initialize_decoder(dk4_tsp08_t *tsp)
}
}
-#line 330 "dk4tsp08.ctr"
+#line 376 "dk4tsp08.ctr"
}
@@ -152,12 +144,17 @@ dk4tsp08_process_group(dk4_tsp08_t *tsp, char *buf, size_t sz)
int res;
-#line 353 "dk4tsp08.ctr"
+#line 399 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buf);
+ assert(0 < sz);
+#endif
/* Increase character numbers
*/
(tsp->pos).chars += (dk4_um_t)1UL;
-#line 356 "dk4tsp08.ctr"
+#line 407 "dk4tsp08.ctr"
(tsp->pos).charil += (dk4_um_t)1UL;
/* Decide between line by line or char by char processing */
if ((NULL != tsp->inbuf) && (0 < tsp->in_sz) && (NULL != (tsp->fct).lh)) {
@@ -232,7 +229,7 @@ dk4tsp08_process_group(dk4_tsp08_t *tsp, char *buf, size_t sz)
}
}
-#line 429 "dk4tsp08.ctr"
+#line 480 "dk4tsp08.ctr"
return back;
}
@@ -251,7 +248,7 @@ dk4tsp08_process_byte(
)
{
unsigned char buf[8];
- dk4_c32_t c32;
+ dk4_c32_t c32 = dkC32(0);
size_t sz;
int back = DK4_TSP_RES_FATAL;
int cuc32 = 0;
@@ -260,30 +257,33 @@ dk4tsp08_process_byte(
char c08;
-#line 455 "dk4tsp08.ctr"
+#line 506 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (0 != tsp->pth) {
-#line 456 "dk4tsp08.ctr"
+#line 510 "dk4tsp08.ctr"
back = dk4tsp08_process_group(tsp, (char *)(&inbyte), 1);
} else {
-#line 458 "dk4tsp08.ctr"
+#line 512 "dk4tsp08.ctr"
/* Decode and process */
switch (tsp->ief) {
- case DK4_FILE_ENCODING_ASCII: {
+ case DK4_FILE_ENCODING_PLAIN: {
-#line 461 "dk4tsp08.ctr"
+#line 515 "dk4tsp08.ctr"
c32 = (dk4_c32_t)inbyte;
cuc32 = 1;
} break;
- case DK4_FILE_ENCODING_ANSI: {
+ case DK4_FILE_ENCODING_WIN1252: {
-#line 465 "dk4tsp08.ctr"
+#line 519 "dk4tsp08.ctr"
if (0 != dk4ansi_decode(&c32, inbyte)) {
cuc32 = 1;
} else {
-#line 468 "dk4tsp08.ctr"
+#line 522 "dk4tsp08.ctr"
dk4error_set_with_position(
&(tsp->er_en), DK4_E_DECODING_FAILED,
(tsp->pos).bytes, (tsp->pos).lineno,
@@ -293,12 +293,12 @@ dk4tsp08_process_byte(
} break;
case DK4_FILE_ENCODING_UTF8: {
-#line 476 "dk4tsp08.ctr"
+#line 530 "dk4tsp08.ctr"
res = dk4utf8_add(&((tsp->dec).u08), inbyte);
switch (res) {
case DK4_EDSTM_ERROR: {
-#line 479 "dk4tsp08.ctr"
+#line 533 "dk4tsp08.ctr"
/* Decoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_DECODING_FAILED,
@@ -318,12 +318,12 @@ dk4tsp08_process_byte(
} break;
case DK4_FILE_ENCODING_UTF16_LE: {
-#line 497 "dk4tsp08.ctr"
+#line 551 "dk4tsp08.ctr"
res = dk4utf16_byte_add(&((tsp->dec).u16), inbyte);
switch (res) {
case DK4_EDSTM_ERROR: {
-#line 500 "dk4tsp08.ctr"
+#line 554 "dk4tsp08.ctr"
/* Decoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_DECODING_FAILED,
@@ -343,12 +343,12 @@ dk4tsp08_process_byte(
} break;
case DK4_FILE_ENCODING_UTF16_BE: {
-#line 518 "dk4tsp08.ctr"
+#line 572 "dk4tsp08.ctr"
res = dk4utf16_byte_add(&((tsp->dec).u16), inbyte);
switch (res) {
case DK4_EDSTM_ERROR: {
-#line 521 "dk4tsp08.ctr"
+#line 575 "dk4tsp08.ctr"
/* Decoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_DECODING_FAILED,
@@ -368,12 +368,12 @@ dk4tsp08_process_byte(
} break;
case DK4_FILE_ENCODING_32_LE: {
-#line 539 "dk4tsp08.ctr"
+#line 593 "dk4tsp08.ctr"
res = dk4c32_decoder_add(&((tsp->dec).c32), inbyte);
switch (res) {
case DK4_EDSTM_ERROR: {
-#line 542 "dk4tsp08.ctr"
+#line 596 "dk4tsp08.ctr"
/* Decoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_DECODING_FAILED,
@@ -393,12 +393,12 @@ dk4tsp08_process_byte(
} break;
case DK4_FILE_ENCODING_32_BE: {
-#line 560 "dk4tsp08.ctr"
+#line 614 "dk4tsp08.ctr"
res = dk4c32_decoder_add(&((tsp->dec).c32), inbyte);
switch (res) {
case DK4_EDSTM_ERROR: {
-#line 563 "dk4tsp08.ctr"
+#line 617 "dk4tsp08.ctr"
/* Decoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_DECODING_FAILED,
@@ -419,15 +419,15 @@ dk4tsp08_process_byte(
}
if (0 != cuc32) {
switch (tsp->pen) {
- case DK4_ENCODING_ASCII: {
+ case DK4_ENCODING_PLAIN: {
-#line 584 "dk4tsp08.ctr"
+#line 638 "dk4tsp08.ctr"
if (dkC32(0x00000100) > c32) {
c08 = (char)c32;
back = dk4tsp08_process_group(tsp, &c08, 1);
} else {
-#line 588 "dk4tsp08.ctr"
+#line 642 "dk4tsp08.ctr"
/* Encoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_ENCODING_FAILED,
@@ -436,15 +436,15 @@ dk4tsp08_process_byte(
);
}
} break;
- case DK4_ENCODING_ANSI: {
+ case DK4_ENCODING_WIN1252: {
-#line 597 "dk4tsp08.ctr"
+#line 651 "dk4tsp08.ctr"
if (0 != dk4ansi_encode(&uc, c32)) {
c08 = (char)uc;
back = dk4tsp08_process_group(tsp, &c08, 1);
} else {
-#line 601 "dk4tsp08.ctr"
+#line 655 "dk4tsp08.ctr"
/* Encoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_ENCODING_FAILED,
@@ -455,13 +455,13 @@ dk4tsp08_process_byte(
} break;
case DK4_ENCODING_UTF8: {
-#line 610 "dk4tsp08.ctr"
+#line 664 "dk4tsp08.ctr"
sz = sizeof(buf);
if (0 != dk4utf8_encode(buf, &sz, c32, NULL)) {
back = dk4tsp08_process_group(tsp, (char *)buf, sz);
} else {
-#line 614 "dk4tsp08.ctr"
+#line 668 "dk4tsp08.ctr"
/* Encoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_ENCODING_FAILED,
@@ -478,7 +478,7 @@ dk4tsp08_process_byte(
}
-#line 629 "dk4tsp08.ctr"
+#line 683 "dk4tsp08.ctr"
return back;
}
@@ -505,13 +505,16 @@ dk4tsp08_i_add_one_byte(
unsigned char uc;
-#line 654 "dk4tsp08.ctr"
+#line 708 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
(tsp->pos).bytes += (dk4_um_t)1UL;
switch (tsp->pst) {
case 0: { /* BOM detection */
-#line 658 "dk4tsp08.ctr"
+#line 715 "dk4tsp08.ctr"
res = dk4bom_detect_add(&(tsp->bomd), inbyte);
switch (res) {
case DK4_EDSTM_ACCEPT: {
@@ -521,7 +524,7 @@ dk4tsp08_i_add_one_byte(
case DK4_EDSTM_FINISHED_WITH_UNUSED: {
-#line 666 "dk4tsp08.ctr"
+#line 723 "dk4tsp08.ctr"
/* This result is ok. */
back = DK4_TSP_RES_OK;
/* Retrieve found encoding */
@@ -536,8 +539,8 @@ dk4tsp08_i_add_one_byte(
encoded bytes, better use a run-time
decision.
*/
- case DK4_ENCODING_ASCII:
- case DK4_ENCODING_ANSI:
+ case DK4_ENCODING_PLAIN:
+ case DK4_ENCODING_WIN1252:
#if 0
/* 2014-12-01
We must make sure to process the complete UTF-8
@@ -548,12 +551,12 @@ dk4tsp08_i_add_one_byte(
{
tsp->pth = 1;
-#line 691 "dk4tsp08.ctr"
+#line 748 "dk4tsp08.ctr"
} break;
#endif
- case DK4_ENCODING_ASCII :
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_PLAIN :
+ case DK4_ENCODING_WIN1252 : {
tsp->pth = 1;
} break;
case DK4_ENCODING_UTF8 : {
@@ -571,22 +574,22 @@ dk4tsp08_i_add_one_byte(
if (0 < nrej) {
-#line 712 "dk4tsp08.ctr"
+#line 769 "dk4tsp08.ctr"
for (i = 0; ((i < nrej) && (DK4_TSP_RES_FATAL != back)); i++) {
uc = dk4bom_detect_unused_byte(&(tsp->bomd), i);
-#line 715 "dk4tsp08.ctr"
+#line 772 "dk4tsp08.ctr"
switch (dk4tsp08_process_byte(tsp, uc)) {
case DK4_TSP_RES_FATAL: {
-#line 717 "dk4tsp08.ctr"
+#line 774 "dk4tsp08.ctr"
back = DK4_TSP_RES_FATAL;
} break;
case DK4_TSP_RES_ERROR: {
if (DK4_TSP_RES_OK == back) {
-#line 721 "dk4tsp08.ctr"
+#line 778 "dk4tsp08.ctr"
back = DK4_TSP_RES_ERROR;
}
} break;
@@ -597,14 +600,14 @@ dk4tsp08_i_add_one_byte(
} break;
case DK4_EDSTM_ERROR: {
-#line 730 "dk4tsp08.ctr"
+#line 787 "dk4tsp08.ctr"
} break;
}
} break;
case 1: { /* Normal processing */
-#line 735 "dk4tsp08.ctr"
+#line 792 "dk4tsp08.ctr"
back = dk4tsp08_process_byte(tsp, inbyte);
} break;
/*
@@ -616,7 +619,7 @@ dk4tsp08_i_add_one_byte(
}
-#line 745 "dk4tsp08.ctr"
+#line 802 "dk4tsp08.ctr"
return back;
}
@@ -635,17 +638,20 @@ dk4tsp08_setup_char(
int back = 0;
-#line 762 "dk4tsp08.ctr"
+#line 819 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
-#line 763 "dk4tsp08.ctr"
+#line 823 "dk4tsp08.ctr"
dk4tsp08_init(tsp, eie);
if (NULL != fct) {
-#line 765 "dk4tsp08.ctr"
+#line 825 "dk4tsp08.ctr"
switch (pre) {
- case DK4_ENCODING_ASCII:
- case DK4_ENCODING_ANSI:
+ case DK4_ENCODING_PLAIN:
+ case DK4_ENCODING_WIN1252:
case DK4_ENCODING_UTF8:
{
tsp->obj = obj;
@@ -653,30 +659,30 @@ dk4tsp08_setup_char(
tsp->pen = pre;
tsp->iee = eie;
-#line 774 "dk4tsp08.ctr"
+#line 834 "dk4tsp08.ctr"
tsp->ief = eie;
back = 1;
} break;
default: {
-#line 778 "dk4tsp08.ctr"
+#line 838 "dk4tsp08.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
tsp->pst = 2;
} break;
}
} else {
-#line 783 "dk4tsp08.ctr"
+#line 843 "dk4tsp08.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
tsp->pst = 2;
}
} else {
-#line 787 "dk4tsp08.ctr"
+#line 847 "dk4tsp08.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 789 "dk4tsp08.ctr"
+#line 849 "dk4tsp08.ctr"
return back;
}
@@ -696,18 +702,23 @@ dk4tsp08_setup_line(
int back = 0;
-#line 807 "dk4tsp08.ctr"
+#line 867 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != inbuf);
+ assert(0 < szin);
+#endif
if (NULL != tsp) {
-#line 808 "dk4tsp08.ctr"
+#line 873 "dk4tsp08.ctr"
dk4tsp08_init(tsp, eie);
if ((NULL != fct) && (NULL != inbuf) && (0 < szin)) {
-#line 811 "dk4tsp08.ctr"
+#line 876 "dk4tsp08.ctr"
switch (pre) {
- case DK4_ENCODING_ASCII:
- case DK4_ENCODING_ANSI:
+ case DK4_ENCODING_PLAIN:
+ case DK4_ENCODING_WIN1252:
case DK4_ENCODING_UTF8:
{
tsp->obj = obj;
@@ -722,24 +733,24 @@ dk4tsp08_setup_line(
} break;
default: {
-#line 827 "dk4tsp08.ctr"
+#line 892 "dk4tsp08.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
tsp->pst = 2;
} break;
}
} else {
-#line 832 "dk4tsp08.ctr"
+#line 897 "dk4tsp08.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
tsp->pst = 2;
}
} else {
-#line 836 "dk4tsp08.ctr"
+#line 901 "dk4tsp08.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 838 "dk4tsp08.ctr"
+#line 903 "dk4tsp08.ctr"
return back;
}
@@ -754,14 +765,17 @@ dk4tsp08_add_one_byte(
int back = DK4_TSP_RES_FATAL;
-#line 851 "dk4tsp08.ctr"
+#line 916 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (2 > tsp->pst) {
back = dk4tsp08_i_add_one_byte(tsp, inbyte);
}
}
-#line 856 "dk4tsp08.ctr"
+#line 924 "dk4tsp08.ctr"
return back;
}
@@ -778,7 +792,12 @@ dk4tsp08_add_bytes(
int res;
-#line 871 "dk4tsp08.ctr"
+#line 939 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != tsp) && (NULL != buffer) && (0 < sz)) {
if (2 > tsp->pst) {
back = DK4_TSP_RES_OK;
@@ -787,13 +806,13 @@ dk4tsp08_add_bytes(
switch (res) {
case DK4_TSP_RES_FATAL: {
-#line 878 "dk4tsp08.ctr"
+#line 951 "dk4tsp08.ctr"
back = DK4_TSP_RES_FATAL;
} break;
case DK4_TSP_RES_ERROR: {
if (DK4_TSP_RES_OK == back) {
-#line 882 "dk4tsp08.ctr"
+#line 955 "dk4tsp08.ctr"
back = DK4_TSP_RES_ERROR;
}
} break;
@@ -802,7 +821,7 @@ dk4tsp08_add_bytes(
}
}
-#line 889 "dk4tsp08.ctr"
+#line 962 "dk4tsp08.ctr"
return back;
}
@@ -818,13 +837,16 @@ dk4tsp08_finish(dk4_tsp08_t *tsp)
unsigned char uc;
-#line 903 "dk4tsp08.ctr"
+#line 976 "dk4tsp08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
/* Retrieve rejected bytes from BOM detector */
back = DK4_TSP_RES_OK;
if (0 == tsp->pst) {
-#line 907 "dk4tsp08.ctr"
+#line 983 "dk4tsp08.ctr"
tsp->pst = 1;
nrej = dk4bom_detect_num_unused_bytes(&(tsp->bomd));
if (0 < nrej) {
@@ -833,17 +855,17 @@ dk4tsp08_finish(dk4_tsp08_t *tsp)
uc = dk4bom_detect_unused_byte(&(tsp->bomd), i);
-#line 914 "dk4tsp08.ctr"
+#line 990 "dk4tsp08.ctr"
switch (dk4tsp08_process_byte(tsp, uc)) {
case DK4_TSP_RES_FATAL: {
-#line 916 "dk4tsp08.ctr"
+#line 992 "dk4tsp08.ctr"
back = DK4_TSP_RES_FATAL;
tsp->pst = 2;
} break;
case DK4_TSP_RES_ERROR: {
-#line 920 "dk4tsp08.ctr"
+#line 996 "dk4tsp08.ctr"
if (DK4_TSP_RES_OK == back) { back = DK4_TSP_RES_ERROR; }
} break;
}
@@ -851,21 +873,21 @@ dk4tsp08_finish(dk4_tsp08_t *tsp)
}
} else {
-#line 926 "dk4tsp08.ctr"
+#line 1002 "dk4tsp08.ctr"
}
/* Process final line */
if ((NULL != tsp->inbuf) && (0 < tsp->in_sz) && (NULL != (tsp->fct).lh)) {
if (0 < tsp->in_us) {
-#line 931 "dk4tsp08.ctr"
+#line 1007 "dk4tsp08.ctr"
if (2 > tsp->pst) {
if (tsp->in_us < tsp->in_sz) {
-#line 933 "dk4tsp08.ctr"
+#line 1009 "dk4tsp08.ctr"
(tsp->inbuf)[tsp->in_us] = '\0';
-#line 934 "dk4tsp08.ctr"
+#line 1010 "dk4tsp08.ctr"
res =
(*((tsp->fct).lh))(
tsp->obj,tsp->inbuf,(tsp->pos).lineno,&(tsp->er_pr)
@@ -873,19 +895,19 @@ dk4tsp08_finish(dk4_tsp08_t *tsp)
switch (res) {
case DK4_TSP_RES_FATAL: {
-#line 940 "dk4tsp08.ctr"
+#line 1016 "dk4tsp08.ctr"
back = DK4_TSP_RES_FATAL;
tsp->pst = 2;
} break;
case DK4_TSP_RES_ERROR: {
-#line 944 "dk4tsp08.ctr"
+#line 1020 "dk4tsp08.ctr"
if (DK4_TSP_RES_OK == back) { back = DK4_TSP_RES_ERROR; }
} break;
}
} else {
-#line 948 "dk4tsp08.ctr"
+#line 1024 "dk4tsp08.ctr"
back = DK4_TSP_RES_FATAL;
tsp->pst = 2;
/* ERROR: Line too long! */
@@ -897,22 +919,25 @@ dk4tsp08_finish(dk4_tsp08_t *tsp)
}
} else {
-#line 958 "dk4tsp08.ctr"
+#line 1034 "dk4tsp08.ctr"
}
}
}
}
-#line 963 "dk4tsp08.ctr"
+#line 1039 "dk4tsp08.ctr"
return back;
}
void
-dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t *tsp)
+dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t const *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (NULL != er_en) {
DK4_MEMCPY(er_en, &(tsp->er_en), sizeof(dk4_er_t));
@@ -928,6 +953,9 @@ dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t *tsp)
void
dk4tsp08_enable_utf8_pass_through(dk4_tsp08_t *tsp, int fl)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
tsp->upt = ((0 != fl) ? 1 : 0);
}
diff --git a/support/dktools/dk4tsp08.ctr b/support/dktools/dk4tsp08.ctr
index e8a0ceec5e..f3639a7872 100644
--- a/support/dktools/dk4tsp08.ctr
+++ b/support/dktools/dk4tsp08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,35 +14,67 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4BOM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4bom.h"
+#else
+#include <dktools-4/dk4bom.h>
+#endif
#endif
#ifndef DK4TSP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp.h"
+#else
+#include <dktools-4/dk4tsp.h>
+#endif
#endif
#ifndef DK4UTF8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf8.h"
+#else
+#include <dktools-4/dk4utf8.h>
+#endif
#endif
#ifndef DK4UTF16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf16.h"
+#else
+#include <dktools-4/dk4utf16.h>
+#endif
#endif
#ifndef DK4C32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4c32.h"
+#else
+#include <dktools-4/dk4c32.h>
+#endif
#endif
/** Handler function for single characters.
@@ -242,7 +274,7 @@ dk4tsp08_finish(dk4_tsp08_t *tsp);
function.
*/
void
-dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t *tsp);
+dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t const *tsp);
#ifdef __cplusplus
}
@@ -252,6 +284,7 @@ dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t *tsp);
%% module
+#include "dk4conf.h"
#include "dk4tsp.h"
#include "dk4tsp08.h"
#include "dk4mem.h"
@@ -261,7 +294,14 @@ dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t *tsp);
#include "dk4utf16.h"
#include "dk4c32.h"
#include "dk4bom.h"
+#include "dk4rec26.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -277,6 +317,9 @@ void
dk4tsp08_init(dk4_tsp08_t *tsp, int eie)
{
$? "+ dk4tsp08_init"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
DK4_MEMRES(tsp, sizeof(dk4_tsp08_t));
dk4bom_detect_init(&(tsp->bomd), eie);
dk4error_init(&(tsp->er_en));
@@ -308,6 +351,9 @@ void
dk4tsp08_initialize_decoder(dk4_tsp08_t *tsp)
{
$? "+ dk4tsp08_initialize_decoder"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (0 == tsp->pth) {
switch (tsp->ief) {
case DK4_FILE_ENCODING_UTF8: {
@@ -350,6 +396,11 @@ dk4tsp08_process_group(dk4_tsp08_t *tsp, char *buf, size_t sz)
int back = DK4_TSP_RES_FATAL;
int res;
$? "+ dk4tsp08_process_group %u", (unsigned)sz
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buf);
+ assert(0 < sz);
+#endif
/* Increase character numbers
*/
(tsp->pos).chars += (dk4_um_t)1UL; $? ". increase chars %u", (unsigned)((tsp->pos).chars)
@@ -444,7 +495,7 @@ dk4tsp08_process_byte(
)
{
unsigned char buf[8];
- dk4_c32_t c32;
+ dk4_c32_t c32 = dkC32(0);
size_t sz;
int back = DK4_TSP_RES_FATAL;
int cuc32 = 0;
@@ -452,16 +503,19 @@ dk4tsp08_process_byte(
unsigned char uc = '\0';
char c08;
$? "+ dk4tsp08_process_byte %02x", (int)inbyte
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (0 != tsp->pth) { $? ". pass through"
back = dk4tsp08_process_group(tsp, (char *)(&inbyte), 1);
} else { $? ". decode and encode"
/* Decode and process */
switch (tsp->ief) {
- case DK4_FILE_ENCODING_ASCII: { $? ". ASCII found"
+ case DK4_FILE_ENCODING_PLAIN: { $? ". ASCII found"
c32 = (dk4_c32_t)inbyte;
cuc32 = 1;
} break;
- case DK4_FILE_ENCODING_ANSI: { $? ". ANSI found"
+ case DK4_FILE_ENCODING_WIN1252: { $? ". ANSI found"
if (0 != dk4ansi_decode(&c32, inbyte)) {
cuc32 = 1;
} else { $? "! ANSI decoding failed"
@@ -580,11 +634,11 @@ dk4tsp08_process_byte(
}
if (0 != cuc32) {
switch (tsp->pen) {
- case DK4_ENCODING_ASCII: { $? ". ASCII required"
+ case DK4_ENCODING_PLAIN: { $? ". ASCII required"
if (dkC32(0x00000100) > c32) {
c08 = (char)c32;
back = dk4tsp08_process_group(tsp, &c08, 1);
- } else { $? "! ASCII encoding failed for %lu",(unsigned long)c32
+ } else { $? "! ASCII encoding failed for %lu",dk4recode_dk_to_ul(c32)
/* Encoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_ENCODING_FAILED,
@@ -593,11 +647,11 @@ dk4tsp08_process_byte(
);
}
} break;
- case DK4_ENCODING_ANSI: { $? ". ANSI required"
+ case DK4_ENCODING_WIN1252: { $? ". ANSI required"
if (0 != dk4ansi_encode(&uc, c32)) {
c08 = (char)uc;
back = dk4tsp08_process_group(tsp, &c08, 1);
- } else { $? "! ANSI encoding failed for %lu", (unsigned long)c32
+ } else { $? "! ANSI encoding failed for %lu", dk4recode_dk_to_ul(c32)
/* Encoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_ENCODING_FAILED,
@@ -610,7 +664,7 @@ dk4tsp08_process_byte(
sz = sizeof(buf);
if (0 != dk4utf8_encode(buf, &sz, c32, NULL)) {
back = dk4tsp08_process_group(tsp, (char *)buf, sz);
- } else { $? "! UTF-8 encoding failed for %lu", (unsigned long)c32
+ } else { $? "! UTF-8 encoding failed for %lu", dk4recode_dk_to_ul(c32)
/* Encoding error */
dk4error_set_with_position(
&(tsp->er_en), DK4_E_ENCODING_FAILED,
@@ -651,6 +705,9 @@ dk4tsp08_i_add_one_byte(
int res;
unsigned char uc;
$? "+ dk4tsp08_i_add_one_byte %02x", (int)inbyte
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
(tsp->pos).bytes += (dk4_um_t)1UL;
switch (tsp->pst) {
case 0: { /* BOM detection */
@@ -677,8 +734,8 @@ dk4tsp08_i_add_one_byte(
encoded bytes, better use a run-time
decision.
*/
- case DK4_ENCODING_ASCII:
- case DK4_ENCODING_ANSI:
+ case DK4_ENCODING_PLAIN:
+ case DK4_ENCODING_WIN1252:
#if 0
/* 2014-12-01
We must make sure to process the complete UTF-8
@@ -691,8 +748,8 @@ dk4tsp08_i_add_one_byte(
} break;
#endif
- case DK4_ENCODING_ASCII :
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_PLAIN :
+ case DK4_ENCODING_WIN1252 : {
tsp->pth = 1;
} break;
case DK4_ENCODING_UTF8 : {
@@ -759,12 +816,15 @@ dk4tsp08_setup_char(
{
int back = 0;
$? "+ dk4tsp08_setup_char"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) { $? ". tsp ok"
dk4tsp08_init(tsp, eie);
if (NULL != fct) { $? ". args ok"
switch (pre) {
- case DK4_ENCODING_ASCII:
- case DK4_ENCODING_ANSI:
+ case DK4_ENCODING_PLAIN:
+ case DK4_ENCODING_WIN1252:
case DK4_ENCODING_UTF8:
{
tsp->obj = obj;
@@ -804,13 +864,18 @@ dk4tsp08_setup_line(
{
int back = 0;
$? "+ dk4tsp08_setup_line"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != inbuf);
+ assert(0 < szin);
+#endif
if (NULL != tsp) { $? ". tsp ok"
dk4tsp08_init(tsp, eie);
if ((NULL != fct) && (NULL != inbuf) && (0 < szin)) {
$? ". args ok"
switch (pre) {
- case DK4_ENCODING_ASCII:
- case DK4_ENCODING_ANSI:
+ case DK4_ENCODING_PLAIN:
+ case DK4_ENCODING_WIN1252:
case DK4_ENCODING_UTF8:
{
tsp->obj = obj;
@@ -848,6 +913,9 @@ dk4tsp08_add_one_byte(
{
int back = DK4_TSP_RES_FATAL;
$? "+ dk4tsp08_add_one_byte"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (2 > tsp->pst) {
back = dk4tsp08_i_add_one_byte(tsp, inbyte);
@@ -868,6 +936,11 @@ dk4tsp08_add_bytes(
int back = DK4_TSP_RES_FATAL;
int res;
$? "+ dk4tsp08_add_bytes"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != tsp) && (NULL != buffer) && (0 < sz)) {
if (2 > tsp->pst) {
back = DK4_TSP_RES_OK;
@@ -900,6 +973,9 @@ dk4tsp08_finish(dk4_tsp08_t *tsp)
int res;
unsigned char uc;
$? "+ dk4tsp08_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
/* Retrieve rejected bytes from BOM detector */
back = DK4_TSP_RES_OK;
@@ -966,8 +1042,11 @@ dk4tsp08_finish(dk4_tsp08_t *tsp)
void
-dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t *tsp)
+dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t const *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (NULL != er_en) {
DK4_MEMCPY(er_en, &(tsp->er_en), sizeof(dk4_er_t));
@@ -983,6 +1062,9 @@ dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t *tsp)
void
dk4tsp08_enable_utf8_pass_through(dk4_tsp08_t *tsp, int fl)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
tsp->upt = ((0 != fl) ? 1 : 0);
}
diff --git a/support/dktools/dk4tsp08.h b/support/dktools/dk4tsp08.h
index 88182bad77..ce0fd15868 100644
--- a/support/dktools/dk4tsp08.h
+++ b/support/dktools/dk4tsp08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tsp08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tsp08.ctr
*/
#ifndef DK4TSP08_H_INCLUDED
@@ -46,35 +24,67 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4BOM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4bom.h"
+#else
+#include <dktools-4/dk4bom.h>
+#endif
#endif
#ifndef DK4TSP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp.h"
+#else
+#include <dktools-4/dk4tsp.h>
+#endif
#endif
#ifndef DK4UTF8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf8.h"
+#else
+#include <dktools-4/dk4utf8.h>
+#endif
#endif
#ifndef DK4UTF16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf16.h"
+#else
+#include <dktools-4/dk4utf16.h>
+#endif
#endif
#ifndef DK4C32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4c32.h"
+#else
+#include <dktools-4/dk4c32.h>
+#endif
#endif
/** Handler function for single characters.
@@ -274,7 +284,7 @@ dk4tsp08_finish(dk4_tsp08_t *tsp);
function.
*/
void
-dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t *tsp);
+dk4tsp08_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp08_t const *tsp);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4tsp16.c b/support/dktools/dk4tsp16.c
index e90fc5e8c5..9d1f865176 100644
--- a/support/dktools/dk4tsp16.c
+++ b/support/dktools/dk4tsp16.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tsp16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tsp16.ctr
*/
/** @file dk4tsp16.c The dk4tsp16 module.
*/
-#line 214 "dk4tsp16.ctr"
+#line 246 "dk4tsp16.ctr"
+#include "dk4conf.h"
#include "dk4tsp16.h"
#include "dk4enc.h"
#include "dk4mem.h"
@@ -47,11 +26,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4utf16.h"
#include "dk4c32.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 226 "dk4tsp16.ctr"
+#line 265 "dk4tsp16.ctr"
@@ -63,6 +48,9 @@ static
void
dk4tsp16_init(dk4_tsp16_t *tsp, int eie)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
DK4_MEMRES(tsp, sizeof(dk4_tsp16_t));
dk4bom_detect_init(&(tsp->bomd), eie);
dk4error_init(&(tsp->er_en));
@@ -89,6 +77,9 @@ static
void
dk4tsp16_initialize_decoder(dk4_tsp16_t *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
switch (tsp->ief) {
case DK4_FILE_ENCODING_UTF8: {
dk4utf8_init(&((tsp->dec).u08));
@@ -121,7 +112,7 @@ dk4tsp16_process_character(
int back = DK4_TSP_RES_FATAL;
-#line 294 "dk4tsp16.ctr"
+#line 339 "dk4tsp16.ctr"
/* Increase position */
(tsp->pos).chars += (dk4_um_t)1UL;
(tsp->pos).charil += (dk4_um_t)1UL;
@@ -129,7 +120,7 @@ dk4tsp16_process_character(
if ((NULL != tsp->inbuf) && (0 < tsp->in_sz) && (NULL != (tsp->fct).lh)) {
-#line 300 "dk4tsp16.ctr"
+#line 345 "dk4tsp16.ctr"
if (tsp->in_us < tsp->in_sz) {
(tsp->inbuf)[tsp->in_us] = chr;
tsp->in_us += 1;
@@ -160,7 +151,7 @@ dk4tsp16_process_character(
} else {
-#line 329 "dk4tsp16.ctr"
+#line 374 "dk4tsp16.ctr"
if (NULL != (tsp->fct).ch) {
back = (*((tsp->fct).ch))(tsp->obj, chr, &(tsp->pos), &(tsp->er_pr));
}
@@ -171,7 +162,7 @@ dk4tsp16_process_character(
(tsp->pos).charil = (dk4_um_t)1UL;
}
-#line 338 "dk4tsp16.ctr"
+#line 383 "dk4tsp16.ctr"
return back;
}
#endif
@@ -199,7 +190,12 @@ dk4tsp16_process_group(dk4_tsp16_t *tsp, dk4_c16_t *buf, size_t sz)
int res = DK4_TSP_RES_FATAL;
-#line 364 "dk4tsp16.ctr"
+#line 409 "dk4tsp16.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buf);
+ assert(0 < sz);
+#endif
/* Increase position */
(tsp->pos).chars += (dk4_um_t)1UL;
(tsp->pos).charil += (dk4_um_t)1UL;
@@ -207,7 +203,7 @@ dk4tsp16_process_group(dk4_tsp16_t *tsp, dk4_c16_t *buf, size_t sz)
if ((NULL != tsp->inbuf) && (0 < tsp->in_sz) && (NULL != (tsp->fct).lh)) {
-#line 370 "dk4tsp16.ctr"
+#line 420 "dk4tsp16.ctr"
if (sz < tsp->in_sz) {
if (tsp->in_us < (tsp->in_sz - sz)) {
/* Append group to line and increase used size */
@@ -253,7 +249,7 @@ dk4tsp16_process_group(dk4_tsp16_t *tsp, dk4_c16_t *buf, size_t sz)
} else {
-#line 414 "dk4tsp16.ctr"
+#line 464 "dk4tsp16.ctr"
if (NULL != (tsp->fct).ch) {
back = DK4_TSP_RES_OK;
for (i = 0; i < sz; i++) {
@@ -284,7 +280,7 @@ dk4tsp16_process_group(dk4_tsp16_t *tsp, dk4_c16_t *buf, size_t sz)
}
-#line 443 "dk4tsp16.ctr"
+#line 493 "dk4tsp16.ctr"
return back;
}
@@ -304,18 +300,21 @@ int
dk4tsp16_process_byte(dk4_tsp16_t *tsp, unsigned char inbyte)
{
dk4_c16_t buf[8];
- dk4_c32_t c32;
+ dk4_c32_t c32 = dkC32(0);
size_t sz;
int back = DK4_TSP_RES_FATAL;
int cuc32 = 0;
int res = 0;
/* Add byte to decoder, attempt to retrieve a 32 bit character */
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
switch (tsp->ief) {
- case DK4_FILE_ENCODING_ASCII: {
+ case DK4_FILE_ENCODING_PLAIN: {
c32 = (dk4_c32_t)inbyte;
cuc32 = 1;
} break;
- case DK4_FILE_ENCODING_ANSI: {
+ case DK4_FILE_ENCODING_WIN1252: {
if (0 != dk4ansi_decode(&c32, inbyte)) {
cuc32 = 1;
} else {
@@ -483,12 +482,15 @@ dk4tsp16_i_add_one_byte(
unsigned char uc;
-#line 640 "dk4tsp16.ctr"
+#line 693 "dk4tsp16.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
(tsp->pos).bytes += (dk4_um_t)1UL;
switch (tsp->pst) {
case 0: {
-#line 643 "dk4tsp16.ctr"
+#line 699 "dk4tsp16.ctr"
res = dk4bom_detect_add(&(tsp->bomd), inbyte);
switch (res) {
case DK4_EDSTM_ACCEPT: {
@@ -527,7 +529,7 @@ dk4tsp16_i_add_one_byte(
} break;
case 1: {
-#line 680 "dk4tsp16.ctr"
+#line 736 "dk4tsp16.ctr"
back = dk4tsp16_process_byte(tsp, inbyte);
} break;
/*
@@ -539,7 +541,7 @@ dk4tsp16_i_add_one_byte(
}
-#line 690 "dk4tsp16.ctr"
+#line 746 "dk4tsp16.ctr"
return back;
}
@@ -555,6 +557,9 @@ dk4tsp16_setup_char(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
dk4tsp16_init(tsp, eie);
if (NULL != fct) {
@@ -588,6 +593,11 @@ dk4tsp16_setup_line(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != inbuf);
+ assert(0 < szin);
+#endif
if (NULL != tsp) {
dk4tsp16_init(tsp, eie);
if ((NULL != fct) && (NULL != inbuf) && (0 < szin)) {
@@ -619,6 +629,9 @@ dk4tsp16_add_one_byte(
)
{
int back = DK4_TSP_RES_FATAL;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (2 > tsp->pst) {
back = dk4tsp16_i_add_one_byte(tsp, inbyte);
@@ -638,6 +651,11 @@ dk4tsp16_add_bytes(
{
int back = DK4_TSP_RES_FATAL; /* Function result */
int res; /* Processing result */
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != tsp) && (NULL != buffer) && (0 < sz)) {
if (2 > tsp->pst) {
back = DK4_TSP_RES_OK;
@@ -669,6 +687,9 @@ dk4tsp16_finish(dk4_tsp16_t *tsp)
int back = DK4_TSP_RES_FATAL; /* Function result */
int res; /* Operation result */
unsigned char uc; /* Current unused byte */
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
/* Flush all unprocessed output
1. If there are unprocessed bytes in the BOM detector as BOM
@@ -735,8 +756,11 @@ dk4tsp16_finish(dk4_tsp16_t *tsp)
void
-dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t *tsp)
+dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t const *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (NULL != er_en) {
DK4_MEMCPY(er_en, &(tsp->er_en), sizeof(dk4_er_t));
diff --git a/support/dktools/dk4tsp16.ctr b/support/dktools/dk4tsp16.ctr
index 3a0c9e88cf..4bdb833b4f 100644
--- a/support/dktools/dk4tsp16.ctr
+++ b/support/dktools/dk4tsp16.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -14,35 +14,67 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4BOM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4bom.h"
+#else
+#include <dktools-4/dk4bom.h>
+#endif
#endif
#ifndef DK4TSP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp.h"
+#else
+#include <dktools-4/dk4tsp.h>
+#endif
#endif
#ifndef DK4UTF8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf8.h"
+#else
+#include <dktools-4/dk4utf8.h>
+#endif
#endif
#ifndef DK4UTF16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf16.h"
+#else
+#include <dktools-4/dk4utf16.h>
+#endif
#endif
#ifndef DK4C32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4c32.h"
+#else
+#include <dktools-4/dk4c32.h>
+#endif
#endif
/** Handler function for single characters.
@@ -202,7 +234,7 @@ dk4tsp16_finish(dk4_tsp16_t *tsp);
@param tsp Text stream processor to retrieve errors from.
*/
void
-dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t *tsp);
+dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t const *tsp);
#ifdef __cplusplus
}
@@ -212,6 +244,7 @@ dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t *tsp);
%% module
+#include "dk4conf.h"
#include "dk4tsp16.h"
#include "dk4enc.h"
#include "dk4mem.h"
@@ -220,6 +253,12 @@ dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t *tsp);
#include "dk4utf16.h"
#include "dk4c32.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -234,6 +273,9 @@ static
void
dk4tsp16_init(dk4_tsp16_t *tsp, int eie)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
DK4_MEMRES(tsp, sizeof(dk4_tsp16_t));
dk4bom_detect_init(&(tsp->bomd), eie);
dk4error_init(&(tsp->er_en));
@@ -260,6 +302,9 @@ static
void
dk4tsp16_initialize_decoder(dk4_tsp16_t *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
switch (tsp->ief) {
case DK4_FILE_ENCODING_UTF8: {
dk4utf8_init(&((tsp->dec).u08));
@@ -361,6 +406,11 @@ dk4tsp16_process_group(dk4_tsp16_t *tsp, dk4_c16_t *buf, size_t sz)
int back = DK4_TSP_RES_FATAL;
int res = DK4_TSP_RES_FATAL;
$? "+ dk4tsp16_process_group"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buf);
+ assert(0 < sz);
+#endif
/* Increase position */
(tsp->pos).chars += (dk4_um_t)1UL;
(tsp->pos).charil += (dk4_um_t)1UL;
@@ -459,18 +509,21 @@ int
dk4tsp16_process_byte(dk4_tsp16_t *tsp, unsigned char inbyte)
{
dk4_c16_t buf[8];
- dk4_c32_t c32;
+ dk4_c32_t c32 = dkC32(0);
size_t sz;
int back = DK4_TSP_RES_FATAL;
int cuc32 = 0;
int res = 0;
/* Add byte to decoder, attempt to retrieve a 32 bit character */
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
switch (tsp->ief) {
- case DK4_FILE_ENCODING_ASCII: {
+ case DK4_FILE_ENCODING_PLAIN: {
c32 = (dk4_c32_t)inbyte;
cuc32 = 1;
} break;
- case DK4_FILE_ENCODING_ANSI: {
+ case DK4_FILE_ENCODING_WIN1252: {
if (0 != dk4ansi_decode(&c32, inbyte)) {
cuc32 = 1;
} else {
@@ -637,6 +690,9 @@ dk4tsp16_i_add_one_byte(
int res;
unsigned char uc;
$? "+ dk4tsp16_i_add_one_byte"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
(tsp->pos).bytes += (dk4_um_t)1UL;
switch (tsp->pst) {
case 0: { $? ". bom detection"
@@ -702,6 +758,9 @@ dk4tsp16_setup_char(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
dk4tsp16_init(tsp, eie);
if (NULL != fct) {
@@ -735,6 +794,11 @@ dk4tsp16_setup_line(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != inbuf);
+ assert(0 < szin);
+#endif
if (NULL != tsp) {
dk4tsp16_init(tsp, eie);
if ((NULL != fct) && (NULL != inbuf) && (0 < szin)) {
@@ -766,6 +830,9 @@ dk4tsp16_add_one_byte(
)
{
int back = DK4_TSP_RES_FATAL;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (2 > tsp->pst) {
back = dk4tsp16_i_add_one_byte(tsp, inbyte);
@@ -785,6 +852,11 @@ dk4tsp16_add_bytes(
{
int back = DK4_TSP_RES_FATAL; /* Function result */
int res; /* Processing result */
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != tsp) && (NULL != buffer) && (0 < sz)) {
if (2 > tsp->pst) {
back = DK4_TSP_RES_OK;
@@ -816,6 +888,9 @@ dk4tsp16_finish(dk4_tsp16_t *tsp)
int back = DK4_TSP_RES_FATAL; /* Function result */
int res; /* Operation result */
unsigned char uc; /* Current unused byte */
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
/* Flush all unprocessed output
1. If there are unprocessed bytes in the BOM detector as BOM
@@ -882,8 +957,11 @@ dk4tsp16_finish(dk4_tsp16_t *tsp)
void
-dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t *tsp)
+dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t const *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (NULL != er_en) {
DK4_MEMCPY(er_en, &(tsp->er_en), sizeof(dk4_er_t));
diff --git a/support/dktools/dk4tsp16.h b/support/dktools/dk4tsp16.h
index 1cabc17d3c..077c823901 100644
--- a/support/dktools/dk4tsp16.h
+++ b/support/dktools/dk4tsp16.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tsp16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tsp16.ctr
*/
#ifndef DK4TSP16_H_INCLUDED
@@ -47,35 +25,67 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4BOM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4bom.h"
+#else
+#include <dktools-4/dk4bom.h>
+#endif
#endif
#ifndef DK4TSP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp.h"
+#else
+#include <dktools-4/dk4tsp.h>
+#endif
#endif
#ifndef DK4UTF8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf8.h"
+#else
+#include <dktools-4/dk4utf8.h>
+#endif
#endif
#ifndef DK4UTF16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf16.h"
+#else
+#include <dktools-4/dk4utf16.h>
+#endif
#endif
#ifndef DK4C32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4c32.h"
+#else
+#include <dktools-4/dk4c32.h>
+#endif
#endif
/** Handler function for single characters.
@@ -235,7 +245,7 @@ dk4tsp16_finish(dk4_tsp16_t *tsp);
@param tsp Text stream processor to retrieve errors from.
*/
void
-dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t *tsp);
+dk4tsp16_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp16_t const *tsp);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4tsp32.c b/support/dktools/dk4tsp32.c
index ac1a18b121..ace703b54e 100644
--- a/support/dktools/dk4tsp32.c
+++ b/support/dktools/dk4tsp32.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tsp32.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tsp32.ctr
*/
/** @file dk4tsp32.c The dk4tsp32 module.
*/
-#line 215 "dk4tsp32.ctr"
+#line 247 "dk4tsp32.ctr"
+#include "dk4conf.h"
#include "dk4tsp32.h"
#include "dk4enc.h"
#include "dk4mem.h"
@@ -47,11 +26,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4utf16.h"
#include "dk4c32.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 227 "dk4tsp32.ctr"
+#line 266 "dk4tsp32.ctr"
@@ -63,6 +48,9 @@ static
void
dk4tsp32_init(dk4_tsp32_t *tsp, int eie)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
DK4_MEMRES(tsp, sizeof(dk4_tsp32_t));
dk4bom_detect_init(&(tsp->bomd), eie);
dk4error_init(&(tsp->er_en));
@@ -102,7 +90,10 @@ dk4tsp32_process_character(
int back = DK4_TSP_RES_FATAL;
-#line 276 "dk4tsp32.ctr"
+#line 318 "dk4tsp32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
/* Increase position */
(tsp->pos).chars += (dk4_um_t)1UL;
(tsp->pos).charil += (dk4_um_t)1UL;
@@ -110,10 +101,10 @@ dk4tsp32_process_character(
if ((NULL != tsp->inbuf) && (0 < tsp->in_sz) && (NULL != (tsp->fct).lh)) {
-#line 282 "dk4tsp32.ctr"
+#line 327 "dk4tsp32.ctr"
if (tsp->in_us < tsp->in_sz) {
-#line 283 "dk4tsp32.ctr"
+#line 328 "dk4tsp32.ctr"
(tsp->inbuf)[tsp->in_us] = chr;
tsp->in_us += 1;
back = DK4_TSP_RES_OK;
@@ -139,7 +130,7 @@ dk4tsp32_process_character(
}
} else {
-#line 307 "dk4tsp32.ctr"
+#line 352 "dk4tsp32.ctr"
dk4error_set_with_position(
&(tsp->er_en), DK4_E_BUFFER_TOO_SMALL,
(tsp->pos).bytes, (tsp->pos).lineno,
@@ -149,7 +140,7 @@ dk4tsp32_process_character(
} else {
-#line 315 "dk4tsp32.ctr"
+#line 360 "dk4tsp32.ctr"
if (NULL != (tsp->fct).ch) {
back = (*((tsp->fct).ch))(tsp->obj, chr, &(tsp->pos), &(tsp->er_pr));
}
@@ -160,7 +151,7 @@ dk4tsp32_process_character(
}
-#line 324 "dk4tsp32.ctr"
+#line 369 "dk4tsp32.ctr"
return back;
}
@@ -185,12 +176,15 @@ dk4tsp32_process_byte(
int back = DK4_TSP_RES_FATAL; /* Function result */
int cuc32 = 0; /* Flag: Have 32 bit char */
int res = 0; /* Operation result */
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
switch (tsp->ief) {
- case DK4_FILE_ENCODING_ASCII: {
+ case DK4_FILE_ENCODING_PLAIN: {
c32 = (dk4_c32_t)inbyte;
cuc32 = 1;
} break;
- case DK4_FILE_ENCODING_ANSI: {
+ case DK4_FILE_ENCODING_WIN1252: {
if (0 != dk4ansi_decode(&c32, inbyte)) {
cuc32 = 1;
} else {
@@ -320,6 +314,9 @@ static
void
dk4tsp32_initialize_decoder(dk4_tsp32_t *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
switch (tsp->ief) {
case DK4_FILE_ENCODING_UTF8: {
dk4utf8_init(&((tsp->dec).u08));
@@ -369,7 +366,10 @@ dk4tsp32_i_add_one_byte(
unsigned char uc; /* Current unused byte */
-#line 531 "dk4tsp32.ctr"
+#line 582 "dk4tsp32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
(tsp->pos).bytes += (dk4_um_t)1UL;
switch (tsp->pst) {
case 0: {
@@ -416,7 +416,7 @@ dk4tsp32_i_add_one_byte(
}
-#line 576 "dk4tsp32.ctr"
+#line 630 "dk4tsp32.ctr"
return back;
}
@@ -432,6 +432,9 @@ dk4tsp32_setup_char(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
dk4tsp32_init(tsp, eie);
if (NULL != fct) {
@@ -465,6 +468,11 @@ dk4tsp32_setup_line(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != inbuf);
+ assert(0 < szin);
+#endif
if (NULL != tsp) {
dk4tsp32_init(tsp, eie);
if ((NULL != fct) && (NULL != inbuf) && (0 < szin)) {
@@ -498,7 +506,10 @@ dk4tsp32_add_one_byte(
int back = DK4_TSP_RES_FATAL;
-#line 656 "dk4tsp32.ctr"
+#line 718 "dk4tsp32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (2 > tsp->pst) {
back = dk4tsp32_i_add_one_byte(tsp, inbyte);
@@ -506,7 +517,7 @@ dk4tsp32_add_one_byte(
}
-#line 662 "dk4tsp32.ctr"
+#line 727 "dk4tsp32.ctr"
return back;
}
@@ -523,7 +534,12 @@ dk4tsp32_add_bytes(
int res; /* Processing result */
-#line 677 "dk4tsp32.ctr"
+#line 742 "dk4tsp32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != tsp) && (NULL != buffer) && (0 < sz)) {
if (2 > tsp->pst) {
back = DK4_TSP_RES_OK;
@@ -544,7 +560,7 @@ dk4tsp32_add_bytes(
}
-#line 696 "dk4tsp32.ctr"
+#line 766 "dk4tsp32.ctr"
return back;
}
@@ -560,7 +576,10 @@ dk4tsp32_finish(dk4_tsp32_t *tsp)
unsigned char uc; /* Current unused byte */
-#line 710 "dk4tsp32.ctr"
+#line 780 "dk4tsp32.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
/* Flush all unprocessed output
1. If there are unprocessed bytes in the BOM detector as BOM
@@ -623,15 +642,18 @@ dk4tsp32_finish(dk4_tsp32_t *tsp)
}
-#line 771 "dk4tsp32.ctr"
+#line 844 "dk4tsp32.ctr"
return back;
}
void
-dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t *tsp)
+dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t const *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (NULL != er_en) {
DK4_MEMCPY(er_en, &(tsp->er_en), sizeof(dk4_er_t));
diff --git a/support/dktools/dk4tsp32.ctr b/support/dktools/dk4tsp32.ctr
index 3c1211c62c..498570ddc8 100644
--- a/support/dktools/dk4tsp32.ctr
+++ b/support/dktools/dk4tsp32.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,35 +15,67 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4BOM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4bom.h"
+#else
+#include <dktools-4/dk4bom.h>
+#endif
#endif
#ifndef DK4TSP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp.h"
+#else
+#include <dktools-4/dk4tsp.h>
+#endif
#endif
#ifndef DK4UTF8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf8.h"
+#else
+#include <dktools-4/dk4utf8.h>
+#endif
#endif
#ifndef DK4UTF16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf16.h"
+#else
+#include <dktools-4/dk4utf16.h>
+#endif
#endif
#ifndef DK4C32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4c32.h"
+#else
+#include <dktools-4/dk4c32.h>
+#endif
#endif
/** Handler function for single characters.
@@ -203,7 +235,7 @@ dk4tsp32_finish(dk4_tsp32_t *tsp);
@param tsp Text stream processor to retrieve errors from.
*/
void
-dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t *tsp);
+dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t const *tsp);
#ifdef __cplusplus
}
@@ -213,6 +245,7 @@ dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t *tsp);
%% module
+#include "dk4conf.h"
#include "dk4tsp32.h"
#include "dk4enc.h"
#include "dk4mem.h"
@@ -221,6 +254,12 @@ dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t *tsp);
#include "dk4utf16.h"
#include "dk4c32.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -235,6 +274,9 @@ static
void
dk4tsp32_init(dk4_tsp32_t *tsp, int eie)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
DK4_MEMRES(tsp, sizeof(dk4_tsp32_t));
dk4bom_detect_init(&(tsp->bomd), eie);
dk4error_init(&(tsp->er_en));
@@ -273,6 +315,9 @@ dk4tsp32_process_character(
{
int back = DK4_TSP_RES_FATAL;
$? "+ dk4tsp32_process_character"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
/* Increase position */
(tsp->pos).chars += (dk4_um_t)1UL;
(tsp->pos).charil += (dk4_um_t)1UL;
@@ -345,12 +390,15 @@ dk4tsp32_process_byte(
int back = DK4_TSP_RES_FATAL; /* Function result */
int cuc32 = 0; /* Flag: Have 32 bit char */
int res = 0; /* Operation result */
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
switch (tsp->ief) {
- case DK4_FILE_ENCODING_ASCII: {
+ case DK4_FILE_ENCODING_PLAIN: {
c32 = (dk4_c32_t)inbyte;
cuc32 = 1;
} break;
- case DK4_FILE_ENCODING_ANSI: {
+ case DK4_FILE_ENCODING_WIN1252: {
if (0 != dk4ansi_decode(&c32, inbyte)) {
cuc32 = 1;
} else {
@@ -480,6 +528,9 @@ static
void
dk4tsp32_initialize_decoder(dk4_tsp32_t *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
switch (tsp->ief) {
case DK4_FILE_ENCODING_UTF8: {
dk4utf8_init(&((tsp->dec).u08));
@@ -528,6 +579,9 @@ dk4tsp32_i_add_one_byte(
int res; /* Operation result */
unsigned char uc; /* Current unused byte */
$? "+ dk4tsp32_i_add_one_byte index=%lu '%!8c' 0x%02x", byte_number++, inbyte, (unsigned)inbyte
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
(tsp->pos).bytes += (dk4_um_t)1UL;
switch (tsp->pst) {
case 0: {
@@ -588,6 +642,9 @@ dk4tsp32_setup_char(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
dk4tsp32_init(tsp, eie);
if (NULL != fct) {
@@ -621,6 +678,11 @@ dk4tsp32_setup_line(
)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != inbuf);
+ assert(0 < szin);
+#endif
if (NULL != tsp) {
dk4tsp32_init(tsp, eie);
if ((NULL != fct) && (NULL != inbuf) && (0 < szin)) {
@@ -653,6 +715,9 @@ dk4tsp32_add_one_byte(
{
int back = DK4_TSP_RES_FATAL;
$? "+ dk4tsp32_add_one_byte"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (2 > tsp->pst) {
back = dk4tsp32_i_add_one_byte(tsp, inbyte);
@@ -674,6 +739,11 @@ dk4tsp32_add_bytes(
int back = DK4_TSP_RES_FATAL; /* Function result */
int res; /* Processing result */
$? "+ dk4tsp32_add_bytes"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
if ((NULL != tsp) && (NULL != buffer) && (0 < sz)) {
if (2 > tsp->pst) {
back = DK4_TSP_RES_OK;
@@ -707,6 +777,9 @@ dk4tsp32_finish(dk4_tsp32_t *tsp)
int res; /* Operation result */
unsigned char uc; /* Current unused byte */
$? "+ dk4tsp32_finish"
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
/* Flush all unprocessed output
1. If there are unprocessed bytes in the BOM detector as BOM
@@ -774,8 +847,11 @@ dk4tsp32_finish(dk4_tsp32_t *tsp)
void
-dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t *tsp)
+dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t const *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
if (NULL != tsp) {
if (NULL != er_en) {
DK4_MEMCPY(er_en, &(tsp->er_en), sizeof(dk4_er_t));
diff --git a/support/dktools/dk4tsp32.h b/support/dktools/dk4tsp32.h
index e082fe71c3..e66ec012b1 100644
--- a/support/dktools/dk4tsp32.h
+++ b/support/dktools/dk4tsp32.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tsp32.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tsp32.ctr
*/
#ifndef DK4TSP32_H_INCLUDED
@@ -47,35 +25,67 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4BOM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4bom.h"
+#else
+#include <dktools-4/dk4bom.h>
+#endif
#endif
#ifndef DK4TSP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp.h"
+#else
+#include <dktools-4/dk4tsp.h>
+#endif
#endif
#ifndef DK4UTF8_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf8.h"
+#else
+#include <dktools-4/dk4utf8.h>
+#endif
#endif
#ifndef DK4UTF16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4utf16.h"
+#else
+#include <dktools-4/dk4utf16.h>
+#endif
#endif
#ifndef DK4C32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4c32.h"
+#else
+#include <dktools-4/dk4c32.h>
+#endif
#endif
/** Handler function for single characters.
@@ -235,7 +245,7 @@ dk4tsp32_finish(dk4_tsp32_t *tsp);
@param tsp Text stream processor to retrieve errors from.
*/
void
-dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t *tsp);
+dk4tsp32_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tsp32_t const *tsp);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4tspdk.c b/support/dktools/dk4tspdk.c
index 2ad76eaa1b..f6e6faca7c 100644
--- a/support/dktools/dk4tspdk.c
+++ b/support/dktools/dk4tspdk.c
@@ -1,48 +1,34 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tspdk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tspdk.ctr
*/
/** @file dk4tspdk.c The dk4tspdk module.
*/
-#line 205 "dk4tspdk.ctr"
+#line 229 "dk4tspdk.ctr"
+#include "dk4conf.h"
#include "dk4tspdk.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -50,12 +36,22 @@ dk4tspdk_setup_char(
dk4_tspdk_t *tsp,
void *obj,
dk4_dk_handler_t *fct,
+#if 1 == DK4_CHAR_SIZE
int pre,
+#else
+ int DK4_ARG_UNUSED(pre),
+#endif
int eie,
dk4_er_t *erp
)
{
#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(pre)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
+#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_setup_char(tsp, obj, fct, eie, erp));
#else
@@ -75,12 +71,24 @@ dk4tspdk_setup_line(
dk4_dk_line_handler_t *fct,
dkChar *inbuf,
size_t szin,
+#if 1 == DK4_CHAR_SIZE
int pre,
+#else
+ int DK4_ARG_UNUSED(pre),
+#endif
int eie,
dk4_er_t *erp
)
{
#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(pre)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != inbuf);
+ assert(0 < szin);
+#endif
+#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_setup_line(tsp, obj, fct, inbuf, szin, eie, erp));
#else
@@ -99,6 +107,9 @@ dk4tspdk_add_one_byte(
unsigned char inbyte
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_add_one_byte(tsp, inbyte));
@@ -119,6 +130,11 @@ dk4tspdk_add_bytes(
size_t sz
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_add_bytes(tsp, buffer, sz));
@@ -135,6 +151,9 @@ dk4tspdk_add_bytes(
int
dk4tspdk_finish(dk4_tspdk_t *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_finish(tsp));
@@ -149,8 +168,11 @@ dk4tspdk_finish(dk4_tspdk_t *tsp)
void
-dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t *tsp)
+dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t const *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
dk4tsp32_get_errors(er_en, er_pr, tsp);
@@ -165,8 +187,23 @@ dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t *tsp)
void
-dk4tspdk_enable_utf8_pass_through(dk4_tspdk_t *tsp, int fl)
+dk4tspdk_enable_utf8_pass_through(
+#if 1 == DK4_CHAR_SIZE
+ dk4_tspdk_t *tsp,
+ int fl
+#else
+ dk4_tspdk_t * DK4_ARG_UNUSED(tsp),
+ int DK4_ARG_UNUSED(fl)
+#endif
+)
{
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(tsp)
+ DK4_UNUSED_ARG(fl)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
#if DK4_CHAR_SIZE == 1
dk4tsp08_enable_utf8_pass_through(tsp, fl);
#endif
diff --git a/support/dktools/dk4tspdk.ctr b/support/dktools/dk4tspdk.ctr
index 7ea2d7d7c4..239eaff81d 100644
--- a/support/dktools/dk4tspdk.ctr
+++ b/support/dktools/dk4tspdk.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,15 +15,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_CHAR_SIZE > 1
@@ -31,7 +43,11 @@ license = bsd
/* +++++ dkChar 4 bytes */
#ifndef DK4TSP32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp32.h"
+#else
+#include <dktools-4/dk4tsp32.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -51,7 +67,11 @@ typedef dk4_tsp32_t dk4_tspdk_t;
/* +++++ dkChar 2 bytes */
#ifndef DK4TSP16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp16.h"
+#else
+#include <dktools-4/dk4tsp16.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -72,7 +92,11 @@ typedef dk4_tsp16_t dk4_tspdk_t;
/* +++++ dkChar 1 byte */
#ifndef DK4TSP08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp08.h"
+#else
+#include <dktools-4/dk4tsp08.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -195,7 +219,7 @@ dk4tspdk_finish(dk4_tspdk_t *tsp);
@param tsp Text stream processor to retrieve errors from.
*/
void
-dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t *tsp);
+dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t const *tsp);
#ifdef __cplusplus
}
@@ -205,8 +229,16 @@ dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t *tsp);
+#include "dk4conf.h"
#include "dk4tspdk.h"
+#include "dk4unused.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
@@ -214,12 +246,22 @@ dk4tspdk_setup_char(
dk4_tspdk_t *tsp,
void *obj,
dk4_dk_handler_t *fct,
+#if 1 == DK4_CHAR_SIZE
int pre,
+#else
+ int DK4_ARG_UNUSED(pre),
+#endif
int eie,
dk4_er_t *erp
)
{
#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(pre)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
+#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_setup_char(tsp, obj, fct, eie, erp));
#else
@@ -239,12 +281,24 @@ dk4tspdk_setup_line(
dk4_dk_line_handler_t *fct,
dkChar *inbuf,
size_t szin,
+#if 1 == DK4_CHAR_SIZE
int pre,
+#else
+ int DK4_ARG_UNUSED(pre),
+#endif
int eie,
dk4_er_t *erp
)
{
#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(pre)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != inbuf);
+ assert(0 < szin);
+#endif
+#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_setup_line(tsp, obj, fct, inbuf, szin, eie, erp));
#else
@@ -263,6 +317,9 @@ dk4tspdk_add_one_byte(
unsigned char inbyte
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_add_one_byte(tsp, inbyte));
@@ -283,6 +340,11 @@ dk4tspdk_add_bytes(
size_t sz
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+ assert(NULL != buffer);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_add_bytes(tsp, buffer, sz));
@@ -299,6 +361,9 @@ dk4tspdk_add_bytes(
int
dk4tspdk_finish(dk4_tspdk_t *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
return (dk4tsp32_finish(tsp));
@@ -313,8 +378,11 @@ dk4tspdk_finish(dk4_tspdk_t *tsp)
void
-dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t *tsp)
+dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t const *tsp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
#if DK4_CHAR_SIZE > 1
#if DK4_CHAR_SIZE > 2
dk4tsp32_get_errors(er_en, er_pr, tsp);
@@ -329,8 +397,23 @@ dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t *tsp)
void
-dk4tspdk_enable_utf8_pass_through(dk4_tspdk_t *tsp, int fl)
+dk4tspdk_enable_utf8_pass_through(
+#if 1 == DK4_CHAR_SIZE
+ dk4_tspdk_t *tsp,
+ int fl
+#else
+ dk4_tspdk_t * DK4_ARG_UNUSED(tsp),
+ int DK4_ARG_UNUSED(fl)
+#endif
+)
{
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(tsp)
+ DK4_UNUSED_ARG(fl)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != tsp);
+#endif
#if DK4_CHAR_SIZE == 1
dk4tsp08_enable_utf8_pass_through(tsp, fl);
#endif
diff --git a/support/dktools/dk4tspdk.h b/support/dktools/dk4tspdk.h
index 50a98ccf69..231e7c1eae 100644
--- a/support/dktools/dk4tspdk.h
+++ b/support/dktools/dk4tspdk.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tspdk.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tspdk.ctr
*/
#ifndef DK4TSPDK_H_INCLUDED
@@ -47,15 +25,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_CHAR_SIZE > 1
@@ -63,7 +53,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* +++++ dkChar 4 bytes */
#ifndef DK4TSP32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp32.h"
+#else
+#include <dktools-4/dk4tsp32.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -83,7 +77,11 @@ typedef dk4_tsp32_t dk4_tspdk_t;
/* +++++ dkChar 2 bytes */
#ifndef DK4TSP16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp16.h"
+#else
+#include <dktools-4/dk4tsp16.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -104,7 +102,11 @@ typedef dk4_tsp16_t dk4_tspdk_t;
/* +++++ dkChar 1 byte */
#ifndef DK4TSP08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp08.h"
+#else
+#include <dktools-4/dk4tsp08.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -227,7 +229,7 @@ dk4tspdk_finish(dk4_tspdk_t *tsp);
@param tsp Text stream processor to retrieve errors from.
*/
void
-dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t *tsp);
+dk4tspdk_get_errors(dk4_er_t *er_en, dk4_er_t *er_pr, dk4_tspdk_t const *tsp);
#ifdef __cplusplus
}
diff --git a/support/dktools/dk4tspwx.cpp b/support/dktools/dk4tspwx.cpp
index 48c87e3102..e119b9da1c 100644
--- a/support/dktools/dk4tspwx.cpp
+++ b/support/dktools/dk4tspwx.cpp
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tspwx.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tspwx.cpt
*/
/** @file dk4tspwx.cpp The dk4tspwx module.
*/
-#line 233 "dk4tspwx.cpt"
+#line 283 "dk4tspwx.cpt"
#include "dk4tspwx.h"
@@ -45,7 +23,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 239 "dk4tspwx.cpt"
+#line 289 "dk4tspwx.cpt"
@@ -54,7 +32,11 @@ dk4tspwx_setup_char(
dk4_tspwx_t *tsp,
void *obj,
dk4_wx_handler_t *fct,
+#if DK4_SIZEOF_WXCHAR == 1
int pre,
+#else
+ int WXUNUSED(pre),
+#endif
int eie,
dk4_er_t *erp
)
@@ -79,7 +61,11 @@ dk4tspwx_setup_line(
dk4_wx_line_handler_t *fct,
wxChar *inbuf,
size_t szin,
+#if DK4_SIZEOF_WXCHAR == 1
int pre,
+#else
+ int WXUNUSED(pre),
+#endif
int eie,
dk4_er_t *erp
)
@@ -98,7 +84,13 @@ dk4tspwx_setup_line(
void
-dk4tspwx_enable_utf8_pass_through(dk4_tspwx_t *tsp, int fl)
+dk4tspwx_enable_utf8_pass_through(
+#if DK4_SIZEOF_WXCHAR == 1
+ dk4_tspwx_t *tsp, int fl
+#else
+ dk4_tspwx_t * WXUNUSED(tsp), int WXUNUSED(fl)
+#endif
+)
{
#if DK4_SIZEOF_WXCHAR == 1
dk4tsp08_enable_utf8_pass_through(tsp, fl);
@@ -120,7 +112,7 @@ dk4tspwx_add_one_byte(
{
-#line 312 "dk4tspwx.cpt"
+#line 376 "dk4tspwx.cpt"
#if DK4_SIZEOF_WXCHAR > 1
#if DK4_SIZEOF_WXCHAR > 2
return (dk4tsp32_add_one_byte(tsp, inbyte));
@@ -143,7 +135,7 @@ dk4tspwx_add_bytes(
{
-#line 333 "dk4tspwx.cpt"
+#line 397 "dk4tspwx.cpt"
#if TRACE_DEBUG
if (NULL != dktrace_file()) {
fputc('"', dktrace_file());
diff --git a/support/dktools/dk4tspwx.cpt b/support/dktools/dk4tspwx.cpt
index b9b6e8cb59..fe72a9a1b8 100644
--- a/support/dktools/dk4tspwx.cpt
+++ b/support/dktools/dk4tspwx.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,19 +11,45 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
@@ -36,12 +62,24 @@ license = bsd
#endif
#ifndef WX_PRECOMP
#if DK4_HAVE_WX_CHARTYPE_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_CHARTYPE_H_INCLUDED
#include <wx/chartype.h>
#define WX_CHARTYPE_H_INCLUDED 1
#endif
#else
#if DK4_HAVE_WX_WXCHAR_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_WXCHAR_H_INCLUDED
#include <wx/wxchar.h>
#define WX_WXCHAR_H_INCLUDED 1
@@ -61,7 +99,11 @@ license = bsd
/* +++++ dkChar 4 bytes */
#ifndef DK4TSP32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp32.h"
+#else
+#include <dktools-4/dk4tsp32.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -81,7 +123,11 @@ typedef dk4_tsp32_t dk4_tspwx_t;
/* +++++ dkChar 2 bytes */
#ifndef DK4TSP16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp16.h"
+#else
+#include <dktools-4/dk4tsp16.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -102,7 +148,11 @@ typedef dk4_tsp16_t dk4_tspwx_t;
/* +++++ dkChar 1 byte */
#ifndef DK4TSP08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp08.h"
+#else
+#include <dktools-4/dk4tsp08.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -244,7 +294,11 @@ dk4tspwx_setup_char(
dk4_tspwx_t *tsp,
void *obj,
dk4_wx_handler_t *fct,
+#if DK4_SIZEOF_WXCHAR == 1
int pre,
+#else
+ int WXUNUSED(pre),
+#endif
int eie,
dk4_er_t *erp
)
@@ -269,7 +323,11 @@ dk4tspwx_setup_line(
dk4_wx_line_handler_t *fct,
wxChar *inbuf,
size_t szin,
+#if DK4_SIZEOF_WXCHAR == 1
int pre,
+#else
+ int WXUNUSED(pre),
+#endif
int eie,
dk4_er_t *erp
)
@@ -288,7 +346,13 @@ dk4tspwx_setup_line(
void
-dk4tspwx_enable_utf8_pass_through(dk4_tspwx_t *tsp, int fl)
+dk4tspwx_enable_utf8_pass_through(
+#if DK4_SIZEOF_WXCHAR == 1
+ dk4_tspwx_t *tsp, int fl
+#else
+ dk4_tspwx_t * WXUNUSED(tsp), int WXUNUSED(fl)
+#endif
+)
{
#if DK4_SIZEOF_WXCHAR == 1
dk4tsp08_enable_utf8_pass_through(tsp, fl);
diff --git a/support/dktools/dk4tspwx.h b/support/dktools/dk4tspwx.h
index cccda351dc..e8128e84e3 100644
--- a/support/dktools/dk4tspwx.h
+++ b/support/dktools/dk4tspwx.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4tspwx.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4tspwx.cpt
*/
#ifndef DK4TSPWX_H_INCLUDED
@@ -44,19 +22,45 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
@@ -69,12 +73,24 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef WX_PRECOMP
#if DK4_HAVE_WX_CHARTYPE_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_CHARTYPE_H_INCLUDED
#include <wx/chartype.h>
#define WX_CHARTYPE_H_INCLUDED 1
#endif
#else
#if DK4_HAVE_WX_WXCHAR_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED
+#endif
+#endif
#ifndef WX_WXCHAR_H_INCLUDED
#include <wx/wxchar.h>
#define WX_WXCHAR_H_INCLUDED 1
@@ -94,7 +110,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* +++++ dkChar 4 bytes */
#ifndef DK4TSP32_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp32.h"
+#else
+#include <dktools-4/dk4tsp32.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -114,7 +134,11 @@ typedef dk4_tsp32_t dk4_tspwx_t;
/* +++++ dkChar 2 bytes */
#ifndef DK4TSP16_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp16.h"
+#else
+#include <dktools-4/dk4tsp16.h>
+#endif
#endif
/** Handler function to process a single character.
@@ -135,7 +159,11 @@ typedef dk4_tsp16_t dk4_tspwx_t;
/* +++++ dkChar 1 byte */
#ifndef DK4TSP08_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4tsp08.h"
+#else
+#include <dktools-4/dk4tsp08.h>
+#endif
#endif
/** Handler function to process a single character.
diff --git a/support/dktools/dk4types.h b/support/dktools/dk4types.h
index 2b7c90c167..ffc4f473b7 100644
--- a/support/dktools/dk4types.h
+++ b/support/dktools/dk4types.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file dk4types.h Data types for DK libraries.
The dkChar data type is mapped to char on all non-Windows platforms,
@@ -7,6 +12,8 @@ The dk4_c16_t and dk4_c32_t types are for 16 and 32 bit characters.
The dk4_im_t and dk4_um_t are signed and unsigned integer types
of largest size available on the system. All integer values can
be cast to these types without loss.
+Functionality is the same as intmax_t/uintmax_t, the definition is
+for systems with older compilers not supporting intmax_t/uintmax_t.
*/
#ifndef DK4TYPES_H_INCLUDED
@@ -15,7 +22,11 @@ be cast to these types without loss.
#define DK4TYPES_H_INCLUDED 1
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
@@ -80,7 +91,7 @@ be cast to these types without loss.
#endif
#endif
-#ifdef _WIN32
+#if _WIN32
/** 16 bit character.
The dkChar type is mapped to wchar_t on Windows, char on all
@@ -97,7 +108,7 @@ typedef wchar_t dkChar;
#define dkT(x) L ## x
#else
-/* ifdef _WIN32 */
+/* if _WIN32 */
/** Simple 8 bit character.
The dkChar type is mapped to wchar_t on Windows, char on all
@@ -114,7 +125,7 @@ typedef char dkChar;
#define dkT(x) x
#endif
-/* ifdef _WIN32 */
+/* if _WIN32 */
@@ -125,7 +136,7 @@ typedef unsigned short dk4_c16_t;
/** Notation for 16 bit values.
*/
-#define dkC16(x) x ## U
+#define dkC16(x) ((dk4_c16_t)(x ## U))
#else
#if DK4_SIZEOF_INT >= 2
/** 16 bit character, UTF-16 encoded.
@@ -134,7 +145,7 @@ typedef unsigned int dk4_c16_t;
/** Notation for 16 bit values.
*/
-#define dkC16(x) x ## U
+#define dkC16(x) ((dk4_c16_t)(x ## U))
#else
#if DK4_SIZEOF_LONG >= 2
/** 16 bit character, UTF-16 encoded.
@@ -143,7 +154,7 @@ typedef unsigned long dk4_c16_t;
/** Notation for 16 bit values.
*/
-#define dkC16(x) x ## UL
+#define dkC16(x) ((dk4_c16_t)(x ## UL))
#else
#error "No integer type long enough for 16 bits!"
#endif
@@ -163,7 +174,7 @@ typedef unsigned short dk4_dword_t;
/** Notation for 32 bit values.
*/
-#define dkC32(x) x ## U
+#define dkC32(x) ((dk4_c32_t)(x ## U))
#else
#if DK4_SIZEOF_INT >= 4
/** 32 bit Unicode character.
@@ -176,7 +187,7 @@ typedef unsigned int dk4_dword_t;
/** Notation for 32 bit values.
*/
-#define dkC32(x) x ## U
+#define dkC32(x) ((dk4_c32_t)(x ## U))
#else
#if DK4_SIZEOF_LONG >= 4
/** 32 bit Unicode character.
@@ -189,7 +200,7 @@ typedef unsigned long dk4_dword_t;
/** Notation for 32 bit values.
*/
-#define dkC32(x) x ## UL
+#define dkC32(x) ((dk4_c32_t)(x ## UL))
#else
#error "No integer type long enough for 32 bits!"
#endif
@@ -198,25 +209,25 @@ typedef unsigned long dk4_dword_t;
#if DK4_HAVE_INTMAX_T
-/** Maximum unsigned integer.
+/** Maximum unsigned integer type.
*/
typedef uintmax_t dk4_um_t;
-/** Maximum signed integer.
+/** Maximum signed integer type.
*/
typedef intmax_t dk4_im_t;
#else
#if DK4_HAVE_LONG_LONG
-/** Maximum unsigned integer.
+/** Maximum unsigned integer type.
*/
typedef unsigned long long dk4_um_t;
-/** Maximum signed integer.
+/** Maximum signed integer type.
*/
typedef long long dk4_im_t;
#else
-/** Maximum unsigned integer.
+/** Maximum unsigned integer type.
*/
typedef unsigned long dk4_um_t;
-/** Maximum signed integer.
+/** Maximum signed integer type.
*/
typedef long dk4_im_t;
#endif
@@ -233,7 +244,7 @@ typedef sig_atomic_t dk4_sig_atomic_t;
typedef char dk4_sig_atomic_t;
#endif
-/** Protorype for signal handlers.
+/** Prototype for signal handlers.
*/
typedef void dk4_sig_handler_t(int);
@@ -253,6 +264,13 @@ typedef void dk4_sig_handler_t(int);
typedef unsigned char uint8_t;
#endif
+#ifndef DK4_UINT8_0
+/** 0 (8 bits unsigned).
+*/
+#define DK4_UINT8_0 ((uint8_t)0U)
+#endif
+
+
#if !DK4_HAVE_UINT16_T
#if DK4_SIZEOF_SHORT >= 2
/** 16 bit data type.
@@ -275,13 +293,25 @@ typedef unsigned long uint16_t;
#endif
#endif
+#ifndef DK4_UINT16_0
+/** 0 (16 bits unsigned).
+*/
+#define DK4_UINT16_0 ((uint16_t)0U)
+#endif
+
#if !DK4_HAVE_INT8_T
/** 8 bit signed data type.
*/
typedef signed char int8_t;
#endif
-#if !DK4_HAVE_INT16_t
+#ifndef DK4_INT8_0
+/** 0 (8 bits signed).
+*/
+#define DK4_INT8_0 ((int8_t)0)
+#endif
+
+#if !DK4_HAVE_INT16_T
#if DK4_SIZEOF_SHORT >= 2
/** 16 bit signed data type.
*/
@@ -303,6 +333,11 @@ typedef long int16_t;
#endif
#endif
+#ifndef DK4_INT16_0
+/** 0 (16 bits signed).
+*/
+#define DK4_INT16_0 ((int16_t)0)
+#endif
#if !DK4_HAVE_UINT32_T
#if DK4_SIZEOF_SHORT >= 4
@@ -326,6 +361,18 @@ typedef unsigned long uint32_t;
#endif
#endif
+#ifndef DK4_UINT32_0
+#if DK4_SIZEOF_INT >= 4
+/** 0 (32 bits unsigned).
+*/
+#define DK4_UINT32_0 ((uint32_t)0U)
+#else
+/** 0 (32 bits unsigned).
+*/
+#define DK4_UINT32_0 ((uint32_t)0UL)
+#endif
+#endif
+
#if !DK4_HAVE_INT32_T
#if DK4_SIZEOF_SHORT >= 4
/** 32 bit signed data type.
@@ -348,6 +395,19 @@ typedef int int32_t;
#endif
#endif
+#ifndef DK4_INT32_0
+#if DK4_SIZEOF_INT >= 4
+/** 0 (32 bits signed).
+*/
+#define DK4_INT32_0 ((int32_t)0)
+#else
+/** 0 (32 bits signed).
+*/
+#define DK4_INT32_0 ((int32_t)0L)
+#endif
+#endif
+
+
#ifndef DK4_U16_MAX
/** Maximum value for 16 bit unsigned integer.
*/
@@ -387,20 +447,29 @@ typedef int int32_t;
#ifndef DK4_DBL_DIGITS
#ifdef DBL_DECIMAL_DIG
/** Number of digits to printf or scanf a double without precision loss.
+ DBL_DECIMAL_DIG specifies the number of decimal digits that can be
+ rounded to a floating-point number without change to the value.
+ Available in C11.
*/
#define DK4_DBL_DIGITS (DBL_DECIMAL_DIG)
#else
#ifdef DECIMAL_DIG
/** Number of digits to printf or scanf a double without precision loss.
+ DECIMAL_DIG specifies the number of decimal digits that can be
+ rounded to a floating-point number without change to the value.
+ Available in C99.
*/
#define DK4_DBL_DIGITS (DECIMAL_DIG)
#else
#ifdef DBL_DIG
/** Number of digits to printf or scanf a double without precision loss.
+ DBL_DIG is the number of significant digits in a floating point number.
*/
#define DK4_DBL_DIGITS ((DBL_DIG) + 3)
#else
/** Number of digits to printf or scanf a double without precision loss.
+ As neither DBL_DECIMAL_DIG, DECIMAL_DIG nor DBL_DIG is defined we
+ use a fallback value 17 here.
*/
#define DK4_DBL_DIGITS 17
#endif
diff --git a/support/dktools/dk4uc2l.c b/support/dktools/dk4uc2l.c
index 3f8d54446f..4f71eb2700 100644
--- a/support/dktools/dk4uc2l.c
+++ b/support/dktools/dk4uc2l.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4uc2l.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4uc2l.ctr
*/
/** @file dk4uc2l.c The dk4uc2l module.
*/
-#line 238 "dk4uc2l.ctr"
+#line 410 "dk4uc2l.ctr"
#include "dk4conf.h"
@@ -53,11 +31,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4const.h"
#include "dk4uc2l.h"
+#include "dk4inst.h"
#include "dk4mem.h"
#include "dk4mema.h"
#include "dk4str8.h"
#include "dk4strd.h"
+#include "dk4utf16.h"
+#include "dk4utf8.h"
+#include "dk4ansi.h"
#include "dk4maasz.h"
+#include "dk4maaul.h"
+#include "dk4maadu.h"
#include "dk4filed.h"
#include "dk4mpl.h"
#include "dk4strm.h"
@@ -67,172 +51,140 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4pathd.h"
#include "dk4tsp08.h"
#include "dk4enc.h"
-#include "dk4mai8hdu.h"
+#include "dk4mai8hul.h"
#include "dk4maodh.h"
#include "dk4maodd.h"
+#include "dk4unused.h"
+#include "dk4rec26.h"
+#include "dk4strmo08.h"
+#ifndef UC2L_H_INCLUDED
+#include "uc2l.h"
+#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 274 "dk4uc2l.ctr"
+#line 465 "dk4uc2l.ctr"
-typedef char *dk4_uc2l_char_ptr;
-typedef dk4_uc2l_pkg_t *dk4_uc2l_pkg_ptr;
+#define UL(x) ((unsigned long)(x))
-typedef dk4_uc2l_pkg_ptr *dk4_uc2l_pkg_ptr_ptr;
-/** Data passed to the line handler.
+/** Object to use and modify from line handler.
*/
typedef struct {
- dk4_uc2l_t *ulptr; /**< Conversion structure. */
- dk4_app_t *app; /**< Application for diagnostics, may be NULL. */
- const dkChar *sfn; /**< Short file name (pass 1). */
- dk4_sto_t *s_r; /**< Storage for file ranges. */
- dk4_sto_it_t *i_r; /**< Iterator for file ranges. */
- int e_d; /**< Decoding errors. */
- int e_e; /**< Encoding errors. */
- int e_p; /**< Processing errors. */
-} dk4_uc2l_lhobj;
+ dk4_uc2l_t *ulptr; /**< Conversion structure. */
+ dk4_sto_t *s_ra; /**< Local range storage. */
+ dk4_sto_it_t *i_ra; /**< Local range iterator. */
+ dk4_uc2l_file_t *file; /**< File structure. */
+ dk4_uc2l_range_t *rpc; /**< Range pointer cache, pass 2. */
+} handler_object_t;
-/** Fixed keywords used by the module, not localized.
+/** File name suffixes to process.
*/
-static const dkChar * const dk4uc2l_kwnl[] = {
+static const dkChar * const dk4uc2l_suffixes[] = {
/* 0 */
-dkT("dir.charmap"),
-
-/* 1 */
-dkT("/dktools/charmap"),
-
-/* 2 */
-dkT("/dk4app/charmap"),
-
-/* 3 */
-dkT("/dk3app/charmap"),
-
-/* 4 */
dkT(".t2l"),
-/* 5 */
+/* 1 */
dkT(".t2l.gz"),
-/* 6 */
+/* 2 */
dkT(".t2l.bz2"),
-/* 7 */
-dkT("/"),
-
-/* 8 */
-dkT("dk4uc2l.str"),
-
NULL
-#line 327 "dk4uc2l.ctr"
+#line 491 "dk4uc2l.ctr"
};
-/** Localized texts.
+/** Keywords allowed in a data line.
*/
-static const dkChar * const dk4uc2l_kw_def[] = {
+static const char * const dk4uc2l_keywords[] = {
/* 0 */
-dkT("Syntax error!\n\tHexadecimal number required at start of line!"),
+"b$oth",
/* 1 */
-dkT("Syntax error!\n\tHexadecimal value outside allowed 32 bit range!"),
+"t$ext",
/* 2 */
-dkT("Syntax error!\n\tRedefinition of "),
+"m$ath",
/* 3 */
-dkT("!"),
+"e$ncoding",
/* 4 */
-dkT("Syntax error! Redefintion of character!"),
-
-/* 5 */
-dkT("Failed to set up text processing!"),
-
-/* 6 */
-dkT("Failed to open file for reading:\n\t\""),
-
-/* 7 */
-dkT("\"!"),
-
-/* 8 */
-dkT("Syntax error!\n\tIllegal font encoding name!"),
-
-/* 9 */
-dkT("Syntax error!\n\t1 to 15 packages names are allowed!"),
+"p$ackages",
-/* 10 */
-dkT("Syntax error!\n\tIllegal attribute name!"),
+NULL
-/* 11 */
-dkT("Syntax error!\n\tAttribute specified without value!"),
-/* 12 */
-dkT("Conversion to UTF-8 failed for 0x"),
+#line 520 "dk4uc2l.ctr"
+};
-/* 13 */
-dkT("!"),
-/* 14 */
-dkT("Conversion to UTF-8 failed for a character!"),
-/* 15 */
-dkT("No directory for character mapping information found!"),
+/** Font encoding names.
+*/
+static const char * const dk4uc2l_font_encodings[] = {
+/* 0 */
+"ot1",
-/* 16 */
-dkT("Decoding failed!\n\tByte:"),
+/* 1 */
+"t1",
-/* 17 */
-dkT("Encoding failed!\n\tByte:"),
+/* 2 */
+"t4",
-/* 18 */
-dkT("Processing failed!\n\tByte:"),
+/* 3 */
+"t5",
-/* 19 */
-dkT(",\n\tCharacter:"),
+NULL
-/* 20 */
-dkT(",\n\tPosition in line:"),
-/* 21 */
-dkT("."),
+#line 533 "dk4uc2l.ctr"
+};
-/* 22 */
-dkT("Decoding failed!"),
-/* 23 */
-dkT("Encoding failed!"),
-/* 24 */
-dkT("Processing failed!"),
+/** Subdirectory names.
+*/
+static const dkChar * const dk4uc2l_kwnl[] = {
+/* 0 */
+dkT("/dktools/charmap"),
-/* 25 */
-dkT("Further decoding failures!"),
+/* 1 */
+dkT("/dk4app/charmap"),
-/* 26 */
-dkT("Further encoding failures!"),
+/* 2 */
+dkT("/dk3app/charmap"),
-/* 27 */
-dkT("Further processing failures!"),
+/* 3 */
+dkT("/"),
NULL
-#line 403 "dk4uc2l.ctr"
+#line 555 "dk4uc2l.ctr"
};
+/** Constant text strings for recommendations.
+*/
static const char * const dk4uc2l_kw8[] = {
/* 0 */
"% Font encodings:",
@@ -255,392 +207,617 @@ static const char * const dk4uc2l_kw8[] = {
NULL
-#line 428 "dk4uc2l.ctr"
+#line 582 "dk4uc2l.ctr"
};
-/** Attribute names.
+
+/** Opening and closing tag for math mode.
*/
-static const char * const dk4uc2l_attribute_names[] = {
-/* 0 */
-"b$oth",
+static const char * const dk4uc2l_mm[] = {
+"\\(", "\\)"
+};
-/* 1 */
-"t$ext",
-/* 2 */
-"m$ath",
+/** Number of elements in dk4uc2l_suffixes array.
+*/
+static const size_t sz_suffixes =
+DK4_SIZEOF(dk4uc2l_suffixes,DK4_PDKCHAR) - 1;
-/* 3 */
-"e$ncoding",
-/* 4 */
-"p$ackages",
-NULL
+/** Compare two LaTeX package structures.
+ @param l Left pointer, always a package structure.
+ @param r Right pointer.
+ @param cr Comparison criteria: 0 if r is a package pointer,
+ 1 if r is just a package name string.
+ @return Comparison result: 1 if l>r, 0 if l==r, -1 if l<r.
+*/
+static
+int
+dk4uc2l_pkg_compare(const void *l, const void *r, int cr)
+{
+
+ const dk4_uc2l_pkg_t *pl;
+ const dk4_uc2l_pkg_t *pr;
+ int back = 0;
+
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_uc2l_pkg_t *)l;
+ switch (cr) {
+ case 1: {
+ back = strcmp(pl->pn, (const char *)r);
+ } break;
+ default: {
+ pr = (const dk4_uc2l_pkg_t *)r;
+ back = strcmp(pl->pn, pr->pn);
+ } break;
+ }
+ if (-1 > back) back = -1;
+ if ( 1 < back) back = 1;
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) { back = -1; }
+ }
+ return back;
+}
-#line 441 "dk4uc2l.ctr"
-};
+
+/** Compare two file information structures.
+ @param l Left pointer, always a file information structure.
+ @param r Right pointer.
+ @param cr Comparison criteria:
+ 0 if the right pointer is a file information structure
+ pointer,
+ 1 if the right pointer is a file name string.
+ @return Comparison result: 0 if file names are equal, -1 if l<r,
+ 1 if l>r.
+*/
+static
+int
+dk4uc2l_file_compare(const void *l, const void *r, int cr)
+{
+ const dk4_uc2l_file_t *pl;
+ const dk4_uc2l_file_t *pr;
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_uc2l_file_t *)l;
+ switch (cr) {
+ case 1: {
+ back = dk4str_pathcmp(pl->fn, (const dkChar *)r);
+ } break;
+ default: {
+ pr = (const dk4_uc2l_file_t *)r;
+ back = dk4str_pathcmp(pl->fn, pr->fn);
+ } break;
+ }
+ if (-1 > back) { back = -1; }
+ if ( 1 < back) { back = 1; }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
-static const char * const dk4uc2l_font_encodings[] = {
-/* 0 */
-"ot1",
+/** Compare two range informations or a range information against a
+ character.
+ @param l Left pointer, always a range information structure.
+ @param r Right pointer.
+ @param cr Comparison criteria:
+ 0 if the right pointer is a range information strucutre,
+ 1 if the right pointer is a pointer to a dk4_c32_t.
+ @return Comparison result: -1 if l<r, 0 if l=r, 1 if l>r.
+*/
+int
+dk4uc2l_i_range_compare(const void *l, const void *r, int cr)
+{
+ const dk4_uc2l_range_t *pl;
+ const dk4_uc2l_range_t *pr;
+ const dk4_c32_t *pc;
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_uc2l_range_t *)l;
+ switch (cr) {
+ case 1: {
+ pc = (const dk4_c32_t *)r;
+ if (pl->start > *pc) {
+ back = 1;
+ }
+ else {
+ if (pl->end < *pc) {
+ back = -1;
+ }
+ }
+ } break;
+ default: {
+ pr = (const dk4_uc2l_range_t *)r;
+ if (pl->start < pr->start) {
+ back = -1;
+ }
+ else {
+ if (pl->start > pr->start) {
+ back = 1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
-/* 1 */
-"t1",
-/* 2 */
-"t4",
-/* 3 */
-"t5",
+int
+dk4uc2l_i_suffix_index_supported(int i)
+{
+ int back = 1;
+ switch (i) {
+ case 1: {
+#if !DK4_HAVE_ZLIB_H
+ back = 0;
+#endif
+ } break;
+ case 2: {
+#if !DK4_HAVE_BZLIB_H
+ back = 0;
+#endif
+ } break;
+ }
+ return back;
+}
-NULL
-#line 452 "dk4uc2l.ctr"
-};
+int
+dk4uc2l_i_find_suffix_index(const dkChar *fn)
+{
+ size_t sz = 0;
+ size_t i = 0;
+ size_t susz = 0;
+ int back = -1;
+
+ if (NULL != fn) {
+ sz = dk4str_len(fn);
+ for (i = 0; ((i < sz_suffixes) && (0 > back)); i++) {
+ susz = dk4str_len(dk4uc2l_suffixes[i]);
+ if (sz > susz) {
+ if (0 == dk4str_pathcmp(&(fn[sz - susz]), dk4uc2l_suffixes[i])) {
+ back = (int)i; i = sz_suffixes;
+ }
+ }
+ }
+ }
+ return back;
+}
-/** Destroy LaTeX package structure, release memory.
- @param pptr Package to destroy.
-*/
-static
void
-dk4uc2l_pkg_close(dk4_uc2l_pkg_t *pptr)
+dk4uc2l_i_close_file(dk4_uc2l_file_t *fptr)
{
-
+
+
+#line 796 "dk4uc2l.ctr"
+ if (NULL != fptr) {
+
-#line 464 "dk4uc2l.ctr"
- if (NULL != pptr) {
- pptr->used = 0x00;
- dk4mem_release(pptr->pn);
- dk4mem_free(pptr);
- }
-
+#line 798 "dk4uc2l.ctr"
+ dk4mem_release(fptr->fn);
+ fptr->loaded = 0x00;
+ dk4mem_free(fptr);
+ }
+
-#line 470 "dk4uc2l.ctr"
+#line 803 "dk4uc2l.ctr"
}
-/** Create LaTeX package structure, allocate memory.
- @param pn Package name.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to new structure on success, NULL on error.
-*/
-static
-dk4_uc2l_pkg_t *
-dk4uc2l_pkg_open(const char *pn, dk4_app_t *app)
+dk4_uc2l_file_t *
+dk4uc2l_i_open_file(const dkChar *fn, dk4_er_t *erp)
{
- dk4_uc2l_pkg_t *back = NULL;
-
-
-#line 485 "dk4uc2l.ctr"
- if (NULL != pn) {
- back = dk4mem_new_app(dk4_uc2l_pkg_t,1,app);
- if (NULL != back) {
- back->used = 0x00;
- back->pn = dk4str8_dup(pn, NULL);
- if (NULL == back->pn) {
- dk4uc2l_pkg_close(back);
- back = NULL;
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- }
- }
- }
-
-#line 497 "dk4uc2l.ctr"
- return back;
-}
-
+ dk4_uc2l_file_t *back = NULL;
+
+
+#line 812 "dk4uc2l.ctr"
+ if (NULL != fn) {
+ back = dk4mem_new(dk4_uc2l_file_t,1,erp);
+ if (NULL != back) {
+ back->loaded = 0x00;
+ back->fn = dk4str_dup(fn, erp);
+ if (NULL == back->fn) {
+
+#line 818 "dk4uc2l.ctr"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+#line 824 "dk4uc2l.ctr"
+ }
+#endif
+ }
+ else {
-/** Compare two LaTeX package structures.
- @param l Left pointer, always a package structure.
- @param r Right pointer.
- @param cr Comparison criteria: 0 if r is a package pointer,
- 1 if r is just a package name string.
- @return Comparison result: 1 if l>r, 0 if l==r, -1 if l<r.
-*/
-static
-int
-dk4uc2l_pkg_compare(const void *l, const void *r, int cr)
-{
+#line 828 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
- const dk4_uc2l_pkg_t *pl;
- const dk4_uc2l_pkg_t *pr;
- int back = 0;
-
- if (NULL != l) {
- if (NULL != r) {
- pl = (const dk4_uc2l_pkg_t *)l;
- switch (cr) {
- case 1: {
- back = strcmp(pl->pn, (const char *)r);
- } break;
- default: {
- pr = (const dk4_uc2l_pkg_t *)r;
- back = strcmp(pl->pn, pr->pn);
- } break;
- }
- if (-1 > back) back = -1;
- if ( 1 < back) back = 1;
- } else { back = 1; }
- } else {
- if (NULL != r) { back = -1; }
- }
- return back;
+#line 831 "dk4uc2l.ctr"
+ return back;
}
-/** Destroy file information structure, release memory.
- @param fptr File information structure to destroy.
-*/
-static
void
-dk4uc2l_file_close(dk4_uc2l_file_t *fptr)
+dk4uc2l_i_close_pkg(dk4_uc2l_pkg_t *pptr)
{
-
+
+
+#line 840 "dk4uc2l.ctr"
+ if (NULL != pptr) {
+
-#line 549 "dk4uc2l.ctr"
- if (NULL != fptr) {
- fptr->loaded = 0x00;
- dk4mem_release(fptr->fn);
- dk4mem_free(fptr);
- }
+#line 842 "dk4uc2l.ctr"
+ dk4mem_release(pptr->pn);
+ pptr->used = 0x00;
+ dk4mem_free(pptr);
+ }
+
-#line 554 "dk4uc2l.ctr"
+#line 847 "dk4uc2l.ctr"
}
-/** Create file information structure, allocate memory.
- @param fn File name to create structure for.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to new structure on success, NULL on error.
-*/
-static
-dk4_uc2l_file_t *
-dk4uc2l_file_open(const dkChar *fn, dk4_app_t *app)
+dk4_uc2l_pkg_t *
+dk4uc2l_i_open_pkg(const char *pn, dk4_er_t *erp)
{
- dk4_uc2l_file_t *back = NULL;
-
-
-#line 569 "dk4uc2l.ctr"
- if (NULL != fn) {
- back = dk4mem_new_app(dk4_uc2l_file_t,1,app);
- if (NULL != back) {
- back->loaded = 0x00;
- back->fn = dk4str_dup(fn, NULL);
- if (NULL == back->fn) {
- dk4uc2l_file_close(back);
- back = NULL;
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- }
- }
- }
-
-#line 581 "dk4uc2l.ctr"
- return back;
-}
+ dk4_uc2l_pkg_t *back = NULL;
+
+
+#line 856 "dk4uc2l.ctr"
+ if (NULL != pn) {
+ back = dk4mem_new(dk4_uc2l_pkg_t,1,erp);
+ if (NULL != back) {
+ back->used = 0x00;
+ back->pn = dk4str8_dup(pn, erp);
+ if (NULL == back->pn) {
+ dk4mem_free(back);
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+#line 867 "dk4uc2l.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+#line 872 "dk4uc2l.ctr"
+ }
+#endif
+ }
+ else {
-/** Compare two file information structures.
- @param l Left pointer, always a file information structure.
- @param r Right pointer.
- @param cr Comparison criteria:
- 0 if the right pointer is a file information structure
- pointer,
- 1 if the right pointer is a file name string.
- @return Comparison result: 0 if file names are equal, -1 if l<r,
- 1 if l>r.
-*/
-static
-int
-dk4uc2l_file_compare(const void *l, const void *r, int cr)
-{
- const dk4_uc2l_file_t *pl;
- const dk4_uc2l_file_t *pr;
- int back = 0;
- if (NULL != l) {
- if (NULL != r) {
- pl = (const dk4_uc2l_file_t *)l;
- switch (cr) {
- case 1: {
- back = dk4str_pathcmp(pl->fn, (const dkChar *)r);
- } break;
- default: {
- pr = (const dk4_uc2l_file_t *)r;
- back = dk4str_pathcmp(pl->fn, pr->fn);
- } break;
- }
- if (-1 > back) { back = -1; }
- if ( 1 < back) { back = 1; }
- } else { back = 1; }
- } else {
- if (NULL != r) { back = -1; }
- }
- return back;
+#line 876 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 879 "dk4uc2l.ctr"
+ return back;
}
-/** Destroy range structure, release memory.
- @param rptr Range structure to destroy.
-*/
-static
+
void
-dk4uc2l_range_close(dk4_uc2l_range_t *rptr)
+dk4uc2l_i_close_range(dk4_uc2l_range_t *rptr)
{
- dk4_er_t er;
- size_t nelem;
- size_t i;
-
+ dk4_er_t er; /* Error report to detect numeric overflow */
+ unsigned long n; /* Number of elements in range */
+ size_t nn; /* Size_t version of n */
+ size_t i; /* Traverse all elements */
+
-#line 637 "dk4uc2l.ctr"
+#line 893 "dk4uc2l.ctr"
+ if (NULL != rptr) {
+
+
+#line 895 "dk4uc2l.ctr"
#if TRACE_DEBUG
- if (NULL != rptr->file) {
- if (NULL != (rptr->file)->fn) {
-
+ if (NULL != rptr->file) {
+ if (NULL != rptr->file->fn) {
+
-#line 641 "dk4uc2l.ctr"
- }
- }
+#line 899 "dk4uc2l.ctr"
+ }
+ }
#endif
- if (NULL != rptr) {
- /*
- Overflow check when calculating number of elements in range
- as end-start+1
- */
- dk4error_init(&er);
- nelem = dk4ma_size_t_add(
- dk4ma_size_t_sub((size_t)(rptr->end), (size_t)(rptr->start), &er),
- (size_t)1U,
- &er
- );
- if (DK4_E_NONE == er.ec) {
- /*
- Release dynamic memory.
- */
- if (NULL != rptr->both) {
- for (i = 0; i < nelem; i++) { dk4mem_release((rptr->both)[i]); }
- dk4mem_release(rptr->both);
- }
- if (NULL != rptr->text) {
- for (i = 0; i < nelem; i++) { dk4mem_release((rptr->text)[i]); }
- dk4mem_release(rptr->text);
- }
- if (NULL != rptr->math) {
- for (i = 0; i < nelem; i++) { dk4mem_release((rptr->math)[i]); }
- dk4mem_release(rptr->math);
- }
- if (NULL != rptr->pkgs) {
- for (i = 0; i < nelem; i++) { dk4mem_release((rptr->pkgs)[i]); }
- dk4mem_release(rptr->pkgs);
- }
- if (NULL != rptr->fenc) {
- dk4mem_release(rptr->fenc);
- }
- }
- rptr->file = NULL;
- rptr->start = rptr->end = (dk4_c32_t)0UL;
- rptr->ia = 0x00;
- dk4mem_free(rptr);
- }
-
-#line 684 "dk4uc2l.ctr"
+ dk4error_init(&er);
+ n = dk4ma_ulong_sub(rptr->end, rptr->start, &er);
+ n = dk4ma_ulong_add(n, 1UL, &er);
+#if 0
+ if ((DK4_E_NONE == er.ec) && ((dk4_um_t)n <= (dk4_um_t)(SIZE_MAX)))
+#endif
+ if ((DK4_E_NONE == er.ec) && (dk4ma_um_isgeq(SIZE_MAX, n))) {
+ nn = (size_t)n;
+ if (NULL != rptr->both) {
+ for (i = 0; i < nn; i++) {
+ dk4mem_release((rptr->both)[i]);
+ }
+ dk4mem_free(rptr->both); rptr->both = NULL;
+ }
+ if (NULL != rptr->text) {
+ for (i = 0; i < nn; i++) {
+ dk4mem_release((rptr->text)[i]);
+ }
+ dk4mem_free(rptr->text); rptr->text = NULL;
+ }
+ if (NULL != rptr->math) {
+ for (i = 0; i < nn; i++) {
+ dk4mem_release((rptr->math)[i]);
+ }
+ dk4mem_free(rptr->math); rptr->math = NULL;
+ }
+ if (NULL != rptr->pkgs) {
+ for (i = 0; i < nn; i++) {
+ dk4mem_release((rptr->pkgs)[i]);
+ }
+ dk4mem_free(rptr->pkgs); rptr->pkgs = NULL;
+ }
+ if (NULL != rptr->fenc) {
+ dk4mem_free(rptr->fenc); rptr->fenc = NULL;
+ }
+ if (NULL != rptr->lno) {
+ dk4mem_free(rptr->lno); rptr->lno = NULL;
+ }
+ }
+ rptr->file = NULL;
+ rptr->start = (dk4_c32_t)0UL;
+ rptr->end = (dk4_c32_t)0UL;
+ rptr->ia = 0x00;
+ dk4mem_free(rptr);
+ }
+
+
+#line 948 "dk4uc2l.ctr"
}
-/** Create range structure, partially allocate memory.
- @param c Character, initially start and end of range.
- @param fptr Pointer to exisiting file information structure.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to new structure on success, NULL on error.
-*/
-static
-dk4_uc2l_range_t *
-dk4uc2l_range_open(dk4_c32_t c, dk4_uc2l_file_t *fptr, dk4_app_t *app)
+int
+dk4uc2l_i_init_range(
+ dk4_uc2l_range_t *rptr,
+ dk4_er_t *erp
+)
{
- dk4_uc2l_range_t *back = NULL;
-
-
-#line 700 "dk4uc2l.ctr"
- if (NULL != fptr) {
- back = dk4mem_new_app(dk4_uc2l_range_t,1,app);
- if (NULL != back) {
- back->file = fptr;
- back->both = NULL;
- back->text = NULL;
- back->math = NULL;
- back->pkgs = NULL;
- back->fenc = NULL;
- back->start = back->end = c;
- back->ia = 0x00;
- }
- }
-
-#line 713 "dk4uc2l.ctr"
- return back;
+ dk4_er_t er;
+ char **ppchr;
+ dk4_uc2l_pkg_pp *pppkg;
+ unsigned char *puc;
+ dk4_um_t *pum;
+ size_t sznum = 0;
+ size_t i = 0;
+ unsigned long num = 0UL;
+ int back = 0;
+
+
+#line 968 "dk4uc2l.ctr"
+
+ /* Avoid second initialization
+ */
+ if (0x00 != rptr->ia) {
+
+#line 972 "dk4uc2l.ctr"
+ back = 1;
+ goto finished;
+ }
+
+ /* Find number of elements
+ */
+ dk4error_init(&er);
+ num = dk4ma_ulong_add(
+ dk4ma_ulong_sub(
+ (unsigned long)(rptr->end), (unsigned long)(rptr->start), &er
+ ), 1UL, &er
+ );
+ if (DK4_E_NONE != er.ec) {
+
+#line 985 "dk4uc2l.ctr"
+ dk4error_copy(erp, &er);
+ goto finished;
+ }
+#if 0
+ if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)num)
+#endif
+ if (0 != dk4ma_um_isgeq(SIZE_MAX, num)) {
+ sznum = (size_t)num;
+ }
+ else {
+
+#line 995 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ goto finished;
+ }
+
+ /* both
+ */
+ if (NULL == rptr->both) {
+ rptr->both = dk4mem_new(DK4_PCHAR,sznum,erp);
+ if (NULL != rptr->both) {
+ ppchr = rptr->both;
+ for (i = 0; i < sznum; i++) { *(ppchr++) = NULL; }
+ }
+ else {
+
+#line 1008 "dk4uc2l.ctr"
+ goto finished;
+ }
+ }
+
+ /* text
+ */
+ if (NULL == rptr->text) {
+ rptr->text = dk4mem_new(DK4_PCHAR,sznum,erp);
+ if (NULL != rptr->text) {
+ ppchr = rptr->text;
+ for (i = 0; i < sznum; i++) { *(ppchr++) = NULL; }
+ }
+ else {
+
+#line 1021 "dk4uc2l.ctr"
+ goto finished;
+ }
+ }
+
+ /* math
+ */
+ if (NULL == rptr->math) {
+ rptr->math = dk4mem_new(DK4_PCHAR,sznum,erp);
+ if (NULL != rptr->math) {
+ ppchr = rptr->math;
+ for (i = 0; i < sznum; i++) { *(ppchr++) = NULL; }
+ }
+ else {
+
+#line 1034 "dk4uc2l.ctr"
+ goto finished;
+ }
+ }
+
+ /* pkgs
+ */
+ if (NULL == rptr->pkgs) {
+ rptr->pkgs = dk4mem_new(dk4_uc2l_pkg_pp,sznum,erp);
+ if (NULL != rptr->pkgs) {
+ pppkg = rptr->pkgs;
+ for (i = 0; i < sznum; i++) { *(pppkg++) = NULL; }
+ }
+ else{
+
+#line 1047 "dk4uc2l.ctr"
+ goto finished;
+ }
+ }
+
+ /* fenc
+ */
+ if (NULL == rptr->fenc) {
+ rptr->fenc = dk4mem_new(unsigned char,sznum,erp);
+ if (NULL != rptr->fenc) {
+ puc = rptr->fenc;
+ for (i = 0; i < sznum; i++) { *(puc++) = 0xFF; }
+ }
+ else {
+
+#line 1060 "dk4uc2l.ctr"
+ goto finished;
+ }
+ }
+
+ /* lno
+ */
+ if (NULL == rptr->lno) {
+ rptr->lno = dk4mem_new(dk4_um_t,sznum,erp);
+ if (NULL != rptr->lno) {
+ pum = rptr->lno;
+ for (i = 0; i < sznum; i++) { *(pum++) = (dk4_um_t)0UL; }
+ }
+ else {
+
+#line 1073 "dk4uc2l.ctr"
+ goto finished;
+ }
+ }
+
+ /* Success
+ */
+ back = 1;
+
+ /* Return
+ */
+ finished:
+
+
+#line 1085 "dk4uc2l.ctr"
+ return back;
}
-/** Compare two range informations or a range information against a
- character.
- @param l Left pointer, always a range information strucutre.
- @param r Right pointer.
- @param cr Comparison criteria:
- 0 if the right pointer is a range information strucutre,
- 1 if the right pointer is a pointer to a dk4_c32_t.
- @return Comparison result: -1 if l<r, 0 if l=r, 1 if l>r.
-*/
-static
-int
-dk4uc2l_range_compare(const void *l, const void *r, int cr)
+dk4_uc2l_range_t *
+dk4uc2l_i_open_range(
+ dk4_c32_t c32,
+ dk4_uc2l_file_t *fptr,
+ dk4_er_t *erp
+)
{
- const dk4_uc2l_range_t *pl;
- const dk4_uc2l_range_t *pr;
- const dk4_c32_t *pc;
- int back = 0;
- if (NULL != l) {
- if (NULL != r) {
- pl = (const dk4_uc2l_range_t *)l;
- switch (cr) {
- case 1: {
- pc = (const dk4_c32_t *)r;
- if (pl->start > *pc) {
- back = 1;
- } else {
- if (pl->end < *pc) {
- back = -1;
- }
- }
- } break;
- default: {
- pr = (const dk4_uc2l_range_t *)r;
- if (pl->start < pr->start) {
- back = -1;
- } else {
- if (pl->start > pr->start) {
- back = 1;
- }
- }
- } break;
- }
- } else { back = 1; }
- } else {
- if (NULL != r) { back = -1; }
- }
- return back;
+ dk4_uc2l_range_t *back = NULL;
+
+
+#line 1099 "dk4uc2l.ctr"
+ if (NULL != fptr) {
+ back = dk4mem_new(dk4_uc2l_range_t,1,erp);
+ if (NULL != back) {
+ back->file = fptr;
+ back->both = NULL;
+ back->text = NULL;
+ back->math = NULL;
+ back->pkgs = NULL;
+ back->fenc = NULL;
+ back->lno = NULL;
+ back->start = back->end = c32;
+ back->ia = 0x00;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1114 "dk4uc2l.ctr"
+ }
+#endif
+ }
+ else {
+
+#line 1118 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1121 "dk4uc2l.ctr"
+ return back;
}
@@ -648,1711 +825,2185 @@ dk4uc2l_range_compare(const void *l, const void *r, int cr)
void
dk4uc2l_close(dk4_uc2l_t *ulptr)
{
- dk4_uc2l_pkg_t *pptr;
- dk4_uc2l_file_t *fptr;
- dk4_uc2l_range_t *rptr;
-
-
-#line 776 "dk4uc2l.ctr"
- if (NULL != ulptr) {
- /*
- Directory name.
- */
- dk4mem_release(ulptr->dname);
- /*
- Ranges.
- */
- if (NULL != ulptr->s_ranges) {
- if (NULL != ulptr->i_ranges) {
- dk4sto_it_reset(ulptr->i_ranges);
- do {
- rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ulptr->i_ranges);
- if (NULL != rptr) { dk4uc2l_range_close(rptr); }
- } while (NULL != rptr);
- dk4sto_it_close(ulptr->i_ranges);
- }
- dk4sto_close(ulptr->s_ranges);
- }
- /*
- File information.
- */
- if (NULL != ulptr->s_files) {
- if (NULL != ulptr->i_files) {
- dk4sto_it_reset(ulptr->i_files);
- do {
- fptr = (dk4_uc2l_file_t *)dk4sto_it_next(ulptr->i_files);
- if (NULL != fptr) { dk4uc2l_file_close(fptr); }
- } while (NULL != fptr);
- dk4sto_it_close(ulptr->i_files);
- }
- dk4sto_close(ulptr->s_files);
- }
- /*
- Package information.
- */
- if (NULL != ulptr->s_pkgs) {
- if (NULL != ulptr->i_pkgs) {
- dk4sto_it_reset(ulptr->i_pkgs);
- do {
- pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
- if (NULL != pptr) { dk4uc2l_pkg_close(pptr); }
- } while (NULL != pptr);
- dk4sto_it_close(ulptr->i_pkgs);
- }
- dk4sto_close(ulptr->s_pkgs);
- }
- ulptr->s_ranges = NULL;
- ulptr->i_ranges = NULL;
- ulptr->s_files = NULL;
- ulptr->i_files = NULL;
- ulptr->s_pkgs = NULL;
- ulptr->i_pkgs = NULL;
- ulptr->msgs = NULL;
- ulptr->szmsgs = 0;
- dk4mem_free(ulptr);
- }
-
-#line 833 "dk4uc2l.ctr"
+ dk4_uc2l_pkg_t *pptr;
+ dk4_uc2l_file_t *fptr;
+ dk4_uc2l_range_t *rptr;
+
+
+#line 1133 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ dk4mem_release(ulptr->dname);
+ if (NULL != ulptr->s_ranges) {
+ if (NULL != ulptr->i_ranges) {
+ dk4sto_it_reset(ulptr->i_ranges);
+ do {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ulptr->i_ranges);
+ if (NULL != rptr) {
+ dk4uc2l_i_close_range(rptr);
+ }
+ } while (NULL != rptr);
+ dk4sto_it_close(ulptr->i_ranges);
+ }
+ dk4sto_close(ulptr->s_ranges);
+ }
+ ulptr->s_ranges = NULL;
+ ulptr->i_ranges = NULL;
+ if (NULL != ulptr->s_files) {
+ if (NULL != ulptr->i_files) {
+ dk4sto_it_reset(ulptr->i_files);
+ do {
+ fptr = (dk4_uc2l_file_t *)dk4sto_it_next(ulptr->i_files);
+ if (NULL != fptr) {
+ dk4uc2l_i_close_file(fptr);
+ }
+ } while (NULL != fptr);
+ dk4sto_it_close(ulptr->i_files);
+ }
+ dk4sto_close(ulptr->s_files);
+ }
+ ulptr->s_files = NULL;
+ ulptr->i_files = NULL;
+ if (NULL != ulptr->s_pkgs) {
+ if (NULL != ulptr->i_pkgs) {
+ dk4sto_it_reset(ulptr->i_pkgs);
+ do {
+ pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
+ if (NULL != pptr) {
+ dk4uc2l_i_close_pkg(pptr);
+ }
+ } while (NULL != pptr);
+ dk4sto_it_close(ulptr->i_pkgs);
+ }
+ dk4sto_close(ulptr->s_pkgs);
+ }
+ ulptr->s_pkgs = NULL;
+ ulptr->i_pkgs = NULL;
+ dk4mem_free(ulptr);
+ }
+
+
+#line 1186 "dk4uc2l.ctr"
}
-static
dk4_uc2l_t *
-dk4uc2l_create(const dkChar *dn, dk4_app_t *app)
+dk4uc2l_i_new(const dkChar *dn, dk4_er_t *erp)
{
- dk4_uc2l_t *back = NULL;
- int ok = 0;
-
-
-#line 844 "dk4uc2l.ctr"
- if (NULL != dn) {
- back = dk4mem_new_app(dk4_uc2l_t,1,app);
- if (NULL != back) {
- back->dname = NULL;
- back->s_ranges = NULL;
- back->i_ranges = NULL;
- back->s_files = NULL;
- back->i_files = NULL;
- back->s_pkgs = NULL;
- back->i_pkgs = NULL;
- back->fallowed = 0xFF;
- back->utf8allowed = 0x00;
- back->had_error = 0;
- back->msgs = NULL;
- back->szmsgs = 0;
- back->dname = dk4str_dup(dn, NULL);
- if (NULL != back->dname) {
- back->s_ranges = dk4sto_open(NULL);
- if (NULL != back->s_ranges) {
- dk4sto_set_comp(back->s_ranges, dk4uc2l_range_compare, 0);
- back->s_files = dk4sto_open(NULL);
- if (NULL != back->s_files) {
- dk4sto_set_comp(back->s_files, dk4uc2l_file_compare, 0);
- back->s_pkgs = dk4sto_open(NULL);
- if (NULL != back->s_pkgs) {
- dk4sto_set_comp(back->s_pkgs, dk4uc2l_pkg_compare, 0);
- back->i_ranges = dk4sto_it_open(back->s_ranges, NULL);
- if (NULL != back->i_ranges) {
- back->i_files = dk4sto_it_open(back->s_files, NULL);
- if (NULL != back->i_files) {
- back->i_pkgs = dk4sto_it_open(back->s_pkgs, NULL);
- if (NULL != back->i_pkgs) {
- if (NULL != app) {
- back->msgs = dk4app_string_table(
- app, dk4uc2l_kwnl[8], dk4uc2l_kw_def
- );
- } else {
- back->msgs = dk4uc2l_kw_def;
- }
- back->szmsgs = dk4app_string_table_size(dk4uc2l_kw_def);
- ok = 1;
- }
- }
- }
- }
- }
- }
- }
- if (0 == ok) {
- dk4uc2l_close(back);
- back = NULL;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- }
- }
- }
-
-#line 900 "dk4uc2l.ctr"
- return back;
+ dk4_uc2l_t *back = NULL;
+ int ok = 0;
+
+
+#line 1196 "dk4uc2l.ctr"
+ back = dk4mem_new(dk4_uc2l_t,1,erp);
+ if (NULL != back) {
+
+#line 1198 "dk4uc2l.ctr"
+ back->buf[0] = '\0';
+ back->dname = NULL;
+ back->s_ranges = NULL;
+ back->i_ranges = NULL;
+ back->s_files = NULL;
+ back->i_files = NULL;
+ back->s_pkgs = NULL;
+ back->i_pkgs = NULL;
+ back->had_error = 0;
+ back->utf8allowed = 0;
+ back->fallowed = 0xFF;
+ back->dname = dk4str_dup(dn, erp);
+ if (NULL != back->dname) {
+
+#line 1211 "dk4uc2l.ctr"
+ back->s_ranges = dk4sto_open(erp);
+ back->s_files = dk4sto_open(erp);
+ back->s_pkgs = dk4sto_open(erp);
+ if (
+ (NULL != back->s_ranges)
+ && (NULL != back->s_files)
+ && (NULL != back->s_pkgs)
+ ) {
+
+#line 1219 "dk4uc2l.ctr"
+ dk4sto_set_comp(back->s_ranges, dk4uc2l_i_range_compare, 0);
+ dk4sto_set_comp(back->s_files, dk4uc2l_file_compare, 0);
+ dk4sto_set_comp(back->s_pkgs, dk4uc2l_pkg_compare, 0);
+ back->i_ranges = dk4sto_it_open(back->s_ranges, erp);
+ back->i_files = dk4sto_it_open(back->s_files, erp);
+ back->i_pkgs = dk4sto_it_open(back->s_pkgs, erp);
+ if (
+ (NULL != back->i_ranges)
+ && (NULL != back->i_files)
+ && (NULL != back->i_pkgs)
+ ) {
+
+#line 1230 "dk4uc2l.ctr"
+ ok = 1;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1234 "dk4uc2l.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1239 "dk4uc2l.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1244 "dk4uc2l.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1249 "dk4uc2l.ctr"
+ }
+#endif
+ if ((NULL != back) && (0 == ok)) {
+ dk4uc2l_close(back);
+ back = NULL;
+ }
+
+
+#line 1256 "dk4uc2l.ctr"
+ return back;
}
-/** Handler function for text lines.
- @param obj Object to modify while processing the character.
- @param line Text line to process.
+/** Handler to process a line during pass 1.
+ @param obj Object to use and modify during processing.
+ @param line Current text line to process.
@param lineno Current line number.
- @param erp Error report, may be NULL.
- @return DK4_TSP_RES_OK if the character was processed
- successfully,
- DK4_TSP_RES_ERROR if there was an error but we can
- continue,
- DK4_TSP_RES_FATAL if there was a fatal error so we
- should abort processing.
+ @param erp Error report, may be NULL.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on recoverable
+ errors, DK4_TSP_RES_FATAL on fatal errors requiring an abort.
*/
static
int
-dk4uc2l_fp_handler(
- void *obj,
- char *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+dk4uc2l_handler_pass1(
+ void *obj,
+ char *line,
+ dk4_um_t DK4_ARG_UNUSED(lineno) ,
+ dk4_er_t *erp
)
{
- dkChar numbuf[16*sizeof(dk4_um_t)];
- dk4_uc2l_range_t *rptr;
- dk4_uc2l_range_t *rptrn;
- dk4_uc2l_file_t *fptr;
- dk4_uc2l_lhobj *lhobj;
- dk4_app_t *app;
- dk4_uc2l_t *ulptr;
- char *p1;
-#if VERSION_BEFORE_20150821
- char *p2;
+ handler_object_t *pho;
+ char *p1;
+ dk4_uc2l_range_t *rptr;
+ dk4_uc2l_range_t *r2;
+ const char *pe = NULL;
+ unsigned long ul = 0UL;
+ dk4_c32_t c32;
+ dk4_c32_t rbo;
+ int res;
+ int back = DK4_TSP_RES_OK;
+
+ DK4_UNUSED_ARG(lineno)
+#if TRACE_DEBUG
+ dk4str8_delnl(line);
#endif
- const char *p3;
- dk4_um_t um;
- dk4_c32_t c32;
- dk4_c32_t c32a;
- size_t sznumbuf;
- int back = DK4_TSP_RES_OK;
- int res = 0;
-
-
-#line 945 "dk4uc2l.ctr"
-
- /* Obtain contents from object.
- */
- lhobj = (dk4_uc2l_lhobj *)obj;
- ulptr = lhobj->ulptr;
- app = lhobj->app;
- dk4app_set_log_source_line(app, lineno);
-
- /* Check for any text. Empty lines ok, comments ok.
- */
- p1 = dk4str8_start(line, NULL);
- if (NULL == p1) {
-
-#line 957 "dk4uc2l.ctr"
- goto finished;
- }
- if ('#' == *p1) {
-
-#line 960 "dk4uc2l.ctr"
- goto finished;
- }
-
- /* Retrieve hexadecimal number.
- */
-#if VERSION_BEFORE_20150821
- p2 = dk4str8_next(p1, NULL);
-#else
- (void)dk4str8_next(p1, NULL);
+
+
+#line 1294 "dk4uc2l.ctr"
+ pho = (handler_object_t *)obj;
+
+ /* Find start of line.
+ */
+ p1 = dk4str8_start(line, NULL);
+
+ /* Ignore empty lines and comment lines
+ */
+ if (NULL == p1) {
+ goto finished;
+ }
+ if ('#' == *p1) {
+ goto finished;
+ }
+
+ /* Retrieve hexadecimal number
+ */
+ (void)dk4str8_next(p1, NULL);
+ res = dk4ma_input_c8_hex_ulong(&ul, p1, &pe, 1, erp);
+ if (0 == res) {
+ /* ERROR: Syntax, not a number */
+ goto finished;
+ }
+ c32 = (dk4_c32_t)ul;
+
+ /* Check for number in global storage
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->ulptr->i_ranges, &c32, 1
+ );
+ if (NULL != rptr) {
+ /* WARNING erp: Ignoring redefinition */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+
+ /* Check for number in storage for file
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &c32, 1);
+ if (NULL != rptr) {
+ /* WARNING erp: Ignoring redefinition */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+
+ /* Check whether appending to existing range
+ */
+ if (0UL < c32) {
+ rbo = c32 - 1UL;
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &rbo, 1);
+ if (NULL != rptr) {
+ rptr->end = c32;
+#if DK4_SIZEOF_LONG <= 4
+ if ((dk4_um_t)(ULONG_MAX) > (dk4_um_t)c32) {
#endif
- um = (dk4_um_t)0UL;
-#if VERSION_BEFORE_20150821
- p2 = NULL;
+ rbo = c32 + 1UL;
+ r2 = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->i_ra, &rbo, 1
+ );
+ if (NULL != r2) {
+ dk4sto_remove(pho->s_ra, r2, NULL);
+ rptr->end = r2->end;
+ dk4uc2l_i_close_range(r2);
+ }
+#if DK4_SIZEOF_LONG <= 4
+ }
#endif
- p3 = NULL;
- res = dk4ma_input_c8_hex_dk4_um_t(&um, p1, &p3, 1, NULL);
- if (0 == res) {
-
-#line 977 "dk4uc2l.ctr"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Syntax, not a number */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 0);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
-
-#line 983 "dk4uc2l.ctr"
- c32 = (dk4_c32_t)um;
-
-#line 984 "dk4uc2l.ctr"
-
- /* Check numeric range.
- */
- if ((dk4_um_t)0xFFFFFFFFUL < um) {
-
-#line 988 "dk4uc2l.ctr"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Syntax, out of range */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 1);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
-
- /* Check whether number is already contained in a range.
- */
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lhobj->i_r, &c32, 1);
- if (NULL != rptr) {
-
-#line 999 "dk4uc2l.ctr"
-
-
-#line 1000 "dk4uc2l.ctr"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Already defined */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- if (0 != dk4ma_write_hex_unsigned(numbuf,sznumbuf,(dk4_um_t)c32,8,NULL)) {
- dk4app_log_3(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf);
- } else {
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(ulptr->i_ranges, &c32, 1);
- if (NULL != rptr) {
-
-#line 1013 "dk4uc2l.ctr"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Already defined */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- if (0 != dk4ma_write_hex_unsigned(numbuf,sznumbuf,(dk4_um_t)c32,8,NULL)) {
- dk4app_log_3(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf);
- } else {
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
-
- /* Check whether we can append to an existing range.
- */
- if (dkC32(0) < c32) {
- c32a = c32 - dkC32(1);
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lhobj->i_r, &c32a, 1);
- if (NULL != rptr) {
- rptr->end = c32;
-
-#line 1032 "dk4uc2l.ctr"
- /* Also check if c32 closes a gap between two ranges.
- */
- if (dkC32(0xFFFFFFFF) > c32) {
- c32a = c32 + dkC32(1);
- rptrn = (dk4_uc2l_range_t *)dk4sto_it_find_like(lhobj->i_r, &c32a, 1);
- if (NULL != rptrn) {
-
-#line 1038 "dk4uc2l.ctr"
- c32a = rptrn->end;
- dk4sto_remove(lhobj->s_r, rptrn, NULL);
- rptr->end = c32a;
- }
- }
- goto finished;
- }
- }
-
- /* Check whether we can prepend before an existing range.
- */
- if (dkC32(0xFFFFFFFF) > c32) {
- c32a = c32 + dkC32(1);
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lhobj->i_r, &c32a, 1);
- if (NULL != rptr) {
-
-#line 1053 "dk4uc2l.ctr"
- rptr->start = c32;
- goto finished;
- }
- }
-
- /* Create a new range.
- */
+ goto finished;
+ }
+ }
-#line 1060 "dk4uc2l.ctr"
- fptr = (dk4_uc2l_file_t *)dk4sto_it_find_like(ulptr->i_files, lhobj->sfn, 1);
- if (NULL == fptr) {
- fptr = dk4uc2l_file_open(lhobj->sfn, app);
- if (NULL != fptr) {
- if (0 == dk4sto_add(ulptr->s_files, fptr, NULL)) {
- dk4uc2l_file_close(fptr);
-
-#line 1066 "dk4uc2l.ctr"
- fptr = NULL;
- }
- }
- }
- if (NULL == fptr) {
-
-#line 1071 "dk4uc2l.ctr"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- goto finished;
- }
- rptr = dk4uc2l_range_open(c32, fptr, app);
- if (NULL != rptr) {
- if (0 == dk4sto_add(lhobj->s_r, rptr, NULL)) {
- dk4uc2l_range_close(rptr);
-
-#line 1081 "dk4uc2l.ctr"
- rptr = NULL;
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- }
- } else {
-
-#line 1087 "dk4uc2l.ctr"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
-
-#line 1092 "dk4uc2l.ctr"
-
- finished:
-
-
-#line 1095 "dk4uc2l.ctr"
- return back;
+ /* Check whether prepending to existing range
+ */
+#if DK4_SIZEOF_LONG <= 4
+ if ((dk4_um_t)(ULONG_MAX) > (dk4_um_t)c32) {
+#endif
+ rbo = c32 + 1UL;
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &rbo, 1);
+ if (NULL != rptr) {
+ rptr->start = c32;
+ if ((dk4_c32_t)0UL < c32) {
+ rbo = c32 - 1UL;
+ r2 = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->i_ra, &rbo, 1
+ );
+ if (NULL != r2) {
+ dk4sto_remove(pho->s_ra, r2, NULL);
+ rptr->start = r2->start;
+ dk4uc2l_i_close_range(r2);
+ }
+ }
+ goto finished;
+ }
+#if DK4_SIZEOF_LONG <= 4
+ }
+#endif
+ /* Create range on its own
+ */
+ rptr = dk4uc2l_i_open_range(c32, pho->file, erp);
+ if (NULL == rptr) {
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ if (0 == dk4sto_add(pho->ulptr->s_ranges, rptr, erp)) {
+ dk4uc2l_i_close_range(rptr);
+ back = DK4_TSP_RES_FATAL;
+ }
+
+ finished:
+
+
+#line 1404 "dk4uc2l.ctr"
+ return back;
}
-/** Report an error with position in source line.
- @param ulptr Conversion structure.
- @param i1 Index of first message part in array.
- @param i2 Index of alternative first message part.
- @param bno Byte processed.
- @param lno Current line number.
- @param cno Current character number.
- @param cil Current character number in line.
+/** Process one file in pass 1 specified by absolute path name.
+ @param ulptr Conversion structure to set up.
+ @param rstrm Stream, opened for binary reading.
+ @param puc2lf File structure.
+ @param erp Error report, may be NULL.
+ @param bptr Address of success variable to reset on errors.
*/
static
void
-dk4uc2l_report_with_pos(
- dk4_uc2l_t *ulptr,
- dk4_app_t *app,
- size_t i1,
- size_t i2,
- dk4_um_t bno,
- dk4_um_t lno,
- dk4_um_t cno,
- dk4_um_t cil
+dk4uc2l_i_process_stream_pass1(
+ dk4_uc2l_t *ulptr,
+ dk4_stream_t *rstrm,
+ dk4_uc2l_file_t *puc2lf,
+ int *bptr,
+ dk4_er_t *erp
)
{
- dkChar b1[8*(1+sizeof(dk4_um_t))];
- dkChar b2[8*(1+sizeof(dk4_um_t))];
- dkChar b3[8*(1+sizeof(dk4_um_t))];
- dk4_um_t oldlogline = (dk4_um_t)0UL;
- int allbuffersok = 0;
-
- oldlogline = dk4app_get_log_source_line(app);
- dk4app_set_log_source_line(app, lno);
- if (0 != dk4ma_write_decimal_unsigned(b3,DK4_SIZEOF(b3,dkChar),cil,0,NULL)) {
- if (0 != dk4ma_write_decimal_unsigned(b2,DK4_SIZEOF(b2,dkChar),cno,0,NULL)) {
- if (0 != dk4ma_write_decimal_unsigned(b1,DK4_SIZEOF(b1,dkChar),bno,0,NULL)) {
- allbuffersok = 1;
- }
- }
- }
- if (0 != allbuffersok) {
- dk4app_log_7(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, i1, 19, 20, 21, b1, b2, b3
- );
- } else {
- dk4app_log_1(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, i2
- );
- }
- dk4app_set_log_source_line(app, oldlogline);
-}
+ char lnbuf[256]; /* Line buffer */
+ dk4_tsp08_t tsp08; /* Text stream processor */
+ handler_object_t ho; /* Handler object */
+ dk4_uc2l_range_t *rptr; /* Current range */
+ int res; /* Operation result */
+ int cc; /* Flag: Can continue */
+ char c; /* Current character to process */
+
+
+#line 1434 "dk4uc2l.ctr"
+
+ /* Initialize handler object
+ */
+ ho.file = puc2lf;
+ ho.ulptr = ulptr;
+ ho.s_ra = NULL;
+ ho.i_ra = NULL;
+
+ /* Create storage and iterator
+ */
+ ho.s_ra = dk4sto_open(erp);
+ if (NULL == ho.s_ra) {
+
+#line 1446 "dk4uc2l.ctr"
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ goto finished;
+ }
+ dk4sto_set_comp(ho.s_ra, dk4uc2l_i_range_compare, 0);
+ ho.i_ra = dk4sto_it_open(ho.s_ra, erp);
+ if (NULL == ho.i_ra) {
+
+#line 1453 "dk4uc2l.ctr"
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ goto finished;
+ }
+
+ /* Initialize text stream processor
+ */
+ res = dk4tsp08_setup_line(
+ &tsp08, (void *)(&ho), dk4uc2l_handler_pass1, lnbuf, sizeof(lnbuf),
+ DK4_ENCODING_PLAIN, DK4_ENCODING_PLAIN, erp
+ );
+ if (0 == res) {
+
+#line 1465 "dk4uc2l.ctr"
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+
+ /* Process file contents
+ */
+ do {
+ cc = 0;
+ res = dk4stream_c8_read_byte(&c, rstrm, NULL);
+ if (0 != res) {
+ cc = 1;
+ res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ } break;
+ case DK4_TSP_RES_FATAL : {
+
+#line 1484 "dk4uc2l.ctr"
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ goto finished;
+ } break;
+ }
+ }
+ } while (0 < cc);
+
+ /* Finalize text stream processor
+ */
+ res = dk4tsp08_finish(&tsp08);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : case DK4_TSP_RES_FATAL : {
+ *bptr = 0;
+
+#line 1498 "dk4uc2l.ctr"
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ } break;
+ }
+
+ /* Transfer ranges to global storage
+ */
+ do {
+ dk4sto_it_reset(ho.i_ra);
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ho.i_ra);
+ if (NULL != rptr) {
+ dk4sto_remove(ho.s_ra, rptr, erp);
+ if (0 == dk4sto_add(ulptr->s_ranges, rptr, erp)) {
+ dk4uc2l_i_close_range(rptr);
+ *bptr = 0;
+
+#line 1513 "dk4uc2l.ctr"
+ goto finished;
+ }
+ }
+ } while (NULL != rptr);
+ /* Release resources
+ */
+ finished:
+ if (NULL != ho.s_ra) {
+ if (NULL != ho.i_ra) {
+ dk4sto_it_reset(ho.i_ra);
+ do {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ho.i_ra);
+ if (NULL != rptr) {
+ dk4uc2l_i_close_range(rptr);
+ }
+ } while (NULL != rptr);
+ dk4sto_it_close(ho.i_ra);
+ }
+ dk4sto_close(ho.s_ra);
+ }
+
-static
-void
-dk4uc2l_report_errors(
- dk4_uc2l_t *ulptr,
- dk4_app_t *app,
- dk4_uc2l_lhobj *obj,
- dk4_er_t *er_en,
- dk4_er_t *er_pr
+#line 1536 "dk4uc2l.ctr"
+}
+
+
+/** Process one file in pass 1 specified by absolute path name.
+ @param ulptr Conversion structure to set up.
+ @param fn Full (absolute) file name.
+ @param sfn Short file name within given directory.
+ @param erp Error report, may be NULL.
+ @param bptr Address of success variable to reset on errors.
+*/
+static
+void
+dk4uc2l_i_process_one_full_file_pass1(
+ dk4_uc2l_t *ulptr,
+ const dkChar *fn,
+ const dkChar *sfn,
+ int *bptr,
+ dk4_er_t *erp
)
{
- if (NULL != er_en) {
- switch (er_en->ec) {
- case DK4_E_DECODING_FAILED: {
- switch (obj->e_d) {
- case 0: case 1: {
- dk4uc2l_report_with_pos(
- ulptr, app, 16, 22,
- er_en->dt.fpos.byteno,
- er_en->dt.fpos.lineno,
- er_en->dt.fpos.charno,
- er_en->dt.fpos.charinline
- );
- } break;
- case 2: {
- dk4app_log_1(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 25
- );
- } break;
- }
- if (3 > obj->e_d) { obj->e_d += 1; }
- } break;
- case DK4_E_ENCODING_FAILED: {
- switch (obj->e_e) {
- case 0: case 1: {
- dk4uc2l_report_with_pos(
- ulptr, app, 17, 23,
- er_en->dt.fpos.byteno,
- er_en->dt.fpos.lineno,
- er_en->dt.fpos.charno,
- er_en->dt.fpos.charinline
- );
- } break;
- case 2: {
- dk4app_log_1(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 26
- );
- } break;
- }
- if (3 > obj->e_e) { obj->e_e += 1; }
- } break;
- }
- }
- if (NULL != er_pr) {
- if (DK4_E_NONE != er_pr->ec) {
- switch (obj->e_p) {
- case 0: case 1: {
- dk4uc2l_report_with_pos(
- ulptr, app, 18, 24,
- er_pr->dt.fpos.byteno,
- er_pr->dt.fpos.lineno,
- er_pr->dt.fpos.charno,
- er_pr->dt.fpos.charinline
- );
- } break;
- case 2: {
- dk4app_log_1(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 27
- );
- } break;
- }
- if (3 > obj->e_p) { obj->e_p += 1; }
- }
- }
+ dk4_stream_t *rstrm;
+ dk4_uc2l_file_t *puc2lf;
+ int fnsi;
+
+
+#line 1560 "dk4uc2l.ctr"
+
+ puc2lf = (dk4_uc2l_file_t *)dk4sto_it_find_like(ulptr->i_files, sfn, 1);
+ if (NULL == puc2lf) {
+ puc2lf = dk4uc2l_i_open_file(sfn, erp);
+ if (NULL != puc2lf) {
+ if (0 != dk4sto_add(ulptr->s_files, puc2lf, erp)) {
+ fnsi = dk4uc2l_i_find_suffix_index(fn);
+ if (-1 < fnsi) {
+ if (0 != dk4uc2l_i_suffix_index_supported(fnsi)) {
+ rstrm = dk4stream_open_file_reader(fn, erp);
+ if (NULL != rstrm) {
+ /* Process stream */
+ dk4uc2l_i_process_stream_pass1(
+ ulptr, rstrm, puc2lf, bptr, erp
+ );
+ dk4stream_close(rstrm, NULL);
+ }
+ else {
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ *bptr = 0;
+ }
+ }
+ else {
+
+#line 1583 "dk4uc2l.ctr"
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ *bptr = 0;
+ /* ERROR erp: Compression type not supported */
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+ }
+ }
+ else {
+
+#line 1590 "dk4uc2l.ctr"
+ /* Ignoring unsupported file */
+ }
+ }
+ else {
+
+#line 1594 "dk4uc2l.ctr"
+ dk4uc2l_i_close_file(puc2lf);
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1599 "dk4uc2l.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1604 "dk4uc2l.ctr"
+ }
+#endif
+
+
+#line 1607 "dk4uc2l.ctr"
}
-/** Process data from a stream.
- @param ulptr Conversion structure.
- @param rstrm Stream to read data from.
- @param sfn Short file name.
- @param app Application structure for diagnostics, may be NULL.
- @return 1 on success, 0 on error.
+/** Process one file in pass 1.
+ @param ulptr Conversion structure to set up.
+ @param pth Directory path name, may be NULL.
+ @param fn Short file name within given directory.
+ @param erp Error report, may be NULL.
+ @param bptr Address of success variable to reset on errors.
*/
static
-int
-dk4uc2l_fp_process_stream(
- dk4_uc2l_t *ulptr,
- dk4_stream_t *rstrm,
- const dkChar *sfn,
- dk4_app_t *app
+void
+dk4uc2l_i_process_one_file_pass1(
+ dk4_uc2l_t *ulptr,
+ const dkChar *pth,
+ const dkChar *fn,
+ int *bptr,
+ dk4_er_t *erp
)
{
- char buf[256]; /* Line buffer */
- dk4_tsp08_t tsp08; /* Text stream processor */
- dk4_er_t er; /* General error report */
- dk4_er_t er_en; /* Error report for decoding/encoding */
- dk4_er_t er_pr; /* Error report for processing */
- dk4_uc2l_lhobj obj; /* Processing object */
- dk4_uc2l_range_t *rptr; /* Range to append to */
- int back = 1;
- int res; /* Line processing result */
- int cc; /* Flag: Can continue */
- char c; /* Current character */
-
+ dkChar fnb[DK4_MAX_PATH];
+ size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+
-#line 1256 "dk4uc2l.ctr"
- dk4error_init(&er);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- obj.ulptr = ulptr;
- obj.app = app;
- obj.sfn = sfn;
- obj.e_d = 0;
- obj.e_e = 0;
- obj.e_p = 0;
- obj.s_r = dk4sto_open(NULL);
- if (NULL != obj.s_r) {
- dk4sto_set_comp(obj.s_r, dk4uc2l_range_compare, 0);
- obj.i_r = dk4sto_it_open(obj.s_r, NULL);
- if (NULL != obj.i_r) {
- res = dk4tsp08_setup_line(
- &tsp08, (void *)(&obj), dk4uc2l_fp_handler, buf, sizeof(buf),
- DK4_ENCODING_ASCII, DK4_ENCODING_ASCII, &er
- );
- if (0 != res) {
- cc = 1;
- while (1 == cc) {
- res = dk4stream_c8_read_byte(&c, rstrm, &er);
- if (0 != res) {
- res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
- switch (res) {
- case DK4_TSP_RES_ERROR: {
- back = 0;
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- case DK4_TSP_RES_FATAL: {
- back = 0;
- cc = -1;
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- }
- } else {
- cc = 0;
- }
- }
- if (0 == cc) {
- res = dk4tsp08_finish(&tsp08);
- switch (res) {
- case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
- back = 0;
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- }
- }
- } else {
- /* ERROR: Failed to set up text processing */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 5);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- /*
- Move range descriptions from local storage to global storage.
- */
- dk4sto_it_reset(obj.i_r);
- do {
- rptr = (dk4_uc2l_range_t *)dk4sto_it_next(obj.i_r);
- if (NULL != rptr) {
- if (0 == dk4sto_add(ulptr->s_ranges, rptr, NULL)) {
- back = 0;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- dk4uc2l_range_close(rptr);
- }
- }
- } while (NULL != rptr);
- dk4sto_it_close(obj.i_r);
- } else {
- back = 0;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- dk4sto_close(obj.s_r);
- obj.s_r = NULL;
- } else {
- back = 0;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
-
-
-
-#line 1354 "dk4uc2l.ctr"
- return back;
+#line 1631 "dk4uc2l.ctr"
+ if (NULL != pth) {
+ if (0 != dk4str_cpy_s(fnb, szfnb, pth, erp)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, dk4uc2l_kwnl[3], erp)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, fn, erp)) {
+ dk4path_correct_sep(fnb);
+ dk4uc2l_i_process_one_full_file_pass1(
+ ulptr, fnb, fn, bptr, erp
+ );
+ }
+ else {
+ *bptr = 0;
+ }
+ }
+ else {
+ *bptr = 0;
+ }
+ }
+ else {
+ *bptr = 0;
+ }
+ }
+ else {
+ dk4uc2l_i_process_one_full_file_pass1(ulptr, fn, fn, bptr, erp);
+ }
+
+
+#line 1656 "dk4uc2l.ctr"
}
-/** Process one data file in the first pass.
+/** First pass to gather information which Unicode position is configured
+ in which data file.
+ This function is run while creating a new conversion structure
+ to fill the range structures so we can later find a file for a
+ Unicode position.
+ If this function fails, the conversion structure is considered
+ unusable.
+ The function fails only on memory allocation failures, not on
+ syntax errors in translation files.
@param ulptr Conversion structure.
- @param fn Full file name.
- @param sfn Short file name.
- @param app Application structure for diagnostics, may be NULL.
+ @param erp Error report, may be NULL.
@return 1 on success, 0 on error.
*/
static
int
-dk4uc2l_fp_process_file_name(
- dk4_uc2l_t *ulptr,
- const dkChar *fn,
- const dkChar *sfn,
- dk4_app_t *app
-)
+dk4uc2l_i_pass1(dk4_uc2l_t *ulptr, dk4_er_t *erp)
{
- dk4_er_t er; /* Error report */
- dk4_stream_t *rstrm; /* Stream to read file */
- const dkChar *oldsourcefile; /* Previous source file */
- dk4_um_t oldsourceline; /* Previous source line */
- size_t fnl; /* File name length */
- size_t fns; /* Suffix length */
- size_t i; /* Traverse suffix list */
- int back = 1;
- int done = 0; /* Flag: Attempted to open file */
-
-
-#line 1385 "dk4uc2l.ctr"
- fnl = dk4str_len(fn);
- for (i = 4; ((i < 7) && (0 == done)); i++) {
-
-#line 1387 "dk4uc2l.ctr"
- fns = dk4str_len(dk4uc2l_kwnl[i]);
- if (fnl > fns) {
-
-#line 1389 "dk4uc2l.ctr"
- if (0 == dk4str_pathcmp(&(fn[fnl - fns]), dk4uc2l_kwnl[i])) {
- done = 1;
-
-#line 1391 "dk4uc2l.ctr"
- dk4error_init(&er);
- rstrm = dk4stream_open_file_reader(fn, &er);
- if (NULL != rstrm) {
-
-#line 1394 "dk4uc2l.ctr"
- oldsourcefile = dk4app_get_log_source_file(app);
- oldsourceline = dk4app_get_log_source_line(app);
- dk4app_set_log_source_file(app, fn);
- dk4app_set_log_source_line(app, (dk4_um_t)0UL);
- back = dk4uc2l_fp_process_stream(ulptr, rstrm, sfn, app);
- dk4app_set_log_source_file(app, oldsourcefile);
- dk4app_set_log_source_line(app, oldsourceline);
- dk4stream_close(rstrm, NULL);
- } else {
-
-#line 1403 "dk4uc2l.ctr"
- back = 0;
- /* ERROR: Failed to open file */
- dk4app_log_3(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 6, 7, fn);
- ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
- }
- } else {
-
-#line 1409 "dk4uc2l.ctr"
- }
- } else {
-
-#line 1411 "dk4uc2l.ctr"
- }
- }
-
-
-#line 1414 "dk4uc2l.ctr"
- return back;
+ const dkChar *fn = NULL;
+ const dkChar *pth = NULL;
+ dk4_dir_t *pdir = NULL;
+ int back = 0;
+
+
+#line 1682 "dk4uc2l.ctr"
+ pdir = dk4dir_open(ulptr->dname, DK4_DIR_OPEN_SORTED, erp);
+ if (NULL != pdir) {
+ pth = dk4dir_get_path(pdir);
+ back = 1;
+ do {
+ fn = dk4dir_next_file(pdir);
+ if (NULL != fn) {
+ if (-1 < dk4uc2l_i_find_suffix_index(fn)) {
+ dk4uc2l_i_process_one_file_pass1(ulptr,pth,fn,&back,erp);
+ }
+ }
+ } while (NULL != fn);
+ dk4dir_close(pdir);
+ }
+ else {
+
+#line 1697 "dk4uc2l.ctr"
+ /* ERROR: Failed to open directory */
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ }
+
+
+#line 1701 "dk4uc2l.ctr"
+ return back;
}
-/** First pass to fill information to the structure,
- obtain information which character is handled by which file.
- @param ulptr New structure to fill with data.
- @param app Application structure for diagnostics.
- @return 1 on success, 0 on error.
+/** Internal function to open a new conversion structure.
+ @param dn Directory name (must be the name of an existing directory).
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
*/
static
-int
-dk4uc2l_first_pass(dk4_uc2l_t *ulptr, dk4_app_t *app)
+dk4_uc2l_t *
+dk4uc2l_i_open(const dkChar *dn, dk4_er_t *erp)
{
- dkChar fnb[DK4_MAX_PATH]; /* File name buffer */
- const dkChar *pth = NULL; /* Path for directory */
- const dkChar *fn = NULL; /* Current file to process */
- dk4_dir_t *dir = NULL; /* Traverse the directory */
- int back = 0;
-
-
-#line 1435 "dk4uc2l.ctr"
- dir = dk4dir_open_app(ulptr->dname, 0, app);
- if (NULL != dir) {
- back = 1;
- do {
- fn = dk4dir_next_file(dir);
- if (NULL != fn) {
- pth = dk4dir_get_path(dir);
- if (NULL != pth) {
- if (dk4str_cpy_s(fnb,DK4_SIZEOF(fnb,dkChar),pth,NULL)) {
- if (dk4str_cat_s(fnb,DK4_SIZEOF(fnb,dkChar),dk4uc2l_kwnl[7],NULL)) {
- if (dk4str_cat_s(fnb,DK4_SIZEOF(fnb,dkChar),fn,NULL)) {
- dk4path_correct_sep(fnb);
- if (0 == dk4uc2l_fp_process_file_name(ulptr, fnb, fn, app)) {
- back = 0;
- }
- } else {
- back = 0;
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else {
- back = 0;
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else {
- back = 0;
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else {
- if (0 == dk4uc2l_fp_process_file_name(ulptr, fn, fn, app)) {
- back = 0;
- }
- }
- }
- } while (NULL != fn);
- dk4dir_close(dir);
- } else {
- /* ERROR: Failed to open directory */
- ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
- }
-
-#line 1480 "dk4uc2l.ctr"
- return back;
+ dk4_uc2l_t *back = NULL;
+
+
+#line 1717 "dk4uc2l.ctr"
+ back = dk4uc2l_i_new(dn, erp);
+ if (NULL != back) {
+ if (0 == dk4uc2l_i_pass1(back, erp)) {
+ dk4uc2l_close(back);
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1725 "dk4uc2l.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1730 "dk4uc2l.ctr"
+ /* ERROR: Memory (already reported) */
+ }
+#endif
+
+
+#line 1734 "dk4uc2l.ctr"
+ return back;
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open(const dkChar *dn, dk4_er_t *erp)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ const dkChar *shdn = NULL;
+ dk4_uc2l_t *back = NULL;
+ const size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+ size_t i = 0;
+
+
+
+#line 1749 "dk4uc2l.ctr"
+ if (NULL != dn) {
+
+#line 1750 "dk4uc2l.ctr"
+ if (0 != dk4file_is_directory(dn, erp)) {
+ back = dk4uc2l_i_open(dn, erp);
+ }
+ }
+ else {
+
+#line 1755 "dk4uc2l.ctr"
+ shdn = dk4inst_get_directory(2);
+ for (i = 0; ((i < 3) && (NULL == dn)); i++) {
+ if (0 != dk4str_cpy_s(fnb, szfnb, shdn, NULL)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, dk4uc2l_kwnl[i], NULL)) {
+ dk4path_correct_sep(fnb);
+ if (0 != dk4file_is_directory(fnb, NULL)) {
+ dn = fnb;
+ }
+ }
+ }
+ }
+ if (NULL != dn) {
+
+#line 1767 "dk4uc2l.ctr"
+ back = dk4uc2l_i_open(dn, erp);
+ }
+ else {
+
+#line 1770 "dk4uc2l.ctr"
+ /* ERROR: No directory found */
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
+ }
+ }
+
+
+#line 1775 "dk4uc2l.ctr"
+ return back;
+}
+
+
+
+void
+dk4uc2l_allow_utf8(dk4_uc2l_t *ulptr, int enabled)
+{
+
+
+#line 1784 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ ulptr->utf8allowed = ((0 != enabled) ? 0x01 : 0x00);
+ }
+
+
+#line 1791 "dk4uc2l.ctr"
}
-static
void
-dk4uc2l_initialize_range(
- dk4_uc2l_t *ulptr,
- dk4_uc2l_range_t *rptr,
- dk4_app_t *app
+dk4uc2l_clean_packages_and_fonts(dk4_uc2l_t *ulptr)
+{
+ dk4_uc2l_pkg_t *pptr;
+
+
+#line 1800 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ ulptr->fallowed = DK4_UC2L_FONT_ENCODING_ALL;
+ dk4sto_it_reset(ulptr->i_pkgs);
+ do {
+ pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
+ if (NULL != pptr) {
+ pptr->used = 0x00;
+ }
+ } while (NULL != pptr);
+ }
+
+#line 1813 "dk4uc2l.ctr"
+}
+
+
+
+unsigned char
+dk4uc2l_retrieve_allowed_fe(dk4_uc2l_t *ulptr)
+{
+ unsigned char back = 0x00;
+
+
+#line 1822 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ back = ulptr->fallowed;
+ }
+
+
+#line 1829 "dk4uc2l.ctr"
+ return back;
+}
+
+
+
+int
+dk4uc2lat_direct(dk4_c32_t c32)
+{
+ int back = 0;
+ char c; /* 8-bit character version of c32. */
+
+
+#line 1840 "dk4uc2l.ctr"
+ if(128UL > dk4recode_c32_to_ul(c32)) {
+ c = (char)c32;
+ switch(c) {
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+ case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z': case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V':
+ case 'W': case 'X': case 'Y': case 'Z': case '0': case '1':
+ case '2': case '3': case '4': case '5': case '6': case '7':
+ case '8': case '9': case ',': case '.': case ':': case ';':
+ case '+': case '-': case '?': case '!': case '|': case '@':
+ case '(': case ')': case '/': case '=': case ' ':
+ {
+ back = 1;
+ }
+ break;
+ }
+ }
+
+#line 1862 "dk4uc2l.ctr"
+ return back;
+}
+
+
+
+int
+dk4uc2l_i_keyword_index(const char *pkey)
+{
+ return (dk4str8_abbr_index(dk4uc2l_keywords, '$', pkey, 0));
+}
+
+
+
+
+unsigned char
+dk4uc2l_font_encoding_from_name(const char *pname)
+{
+ unsigned char back = 0x00;
+ switch (dk4str8_array_index(dk4uc2l_font_encodings, pname, 0)) {
+ case 0: {
+ back = DK4_UC2L_FONT_ENCODING_OT1;
+ } break;
+ case 1: {
+ back = DK4_UC2L_FONT_ENCODING_T1;
+ } break;
+ case 2: {
+ back = DK4_UC2L_FONT_ENCODING_T4;
+ } break;
+ case 3: {
+ back = DK4_UC2L_FONT_ENCODING_T5;
+ } break;
+ }
+ return back;
+}
+
+
+
+dk4_uc2l_pkg_t *
+dk4uc2l_i_create_pkg(
+ dk4_sto_t *s_pkgs,
+ const char *pname
)
{
- dk4_er_t er;
- size_t nelem;
- size_t i;
- int errmem;
- dk4error_init(&er);
- nelem = dk4ma_size_t_add(
- dk4ma_size_t_sub((size_t)(rptr->end), (size_t)(rptr->start), &er),
- (size_t)1U,
- &er
- );
- if (DK4_E_NONE == er.ec) {
- errmem = 0;
- rptr->both = dk4mem_new_app(dk4_uc2l_char_ptr,nelem,app);
- if (NULL != rptr->both) {
- for (i = 0; i < nelem; i++) { (rptr->both)[i] = NULL; }
- } else { errmem = 1; }
- rptr->text = dk4mem_new_app(dk4_uc2l_char_ptr,nelem,app);
- if (NULL != rptr->text) {
- for (i = 0; i < nelem; i++) { (rptr->text)[i] = NULL; }
- } else { errmem = 1; }
- rptr->math = dk4mem_new_app(dk4_uc2l_char_ptr,nelem,app);
- if (NULL != rptr->math) {
- for (i = 0; i < nelem; i++) { (rptr->math)[i] = NULL; }
- } else { errmem = 1; }
- rptr->pkgs = dk4mem_new_app(dk4_uc2l_pkg_ptr_ptr, nelem, app);
- if (NULL != rptr->pkgs) {
- for (i = 0; i < nelem; i++) { (rptr->pkgs)[i] = NULL; }
- } else { errmem = 1; }
- rptr->fenc = dk4mem_new_app(unsigned char,nelem,app);
- if (NULL != rptr->fenc) {
- for (i = 0; i < nelem; i++) {
- (rptr->fenc)[i] = (unsigned char)DK4_UC2L_FONT_ENCODING_ALL;
- }
- } else { errmem = 1; }
- if (0 != errmem) {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- }
+ dk4_uc2l_pkg_t *back = NULL;
+ back = dk4uc2l_i_open_pkg(pname, NULL);
+ if (NULL != back) {
+ if (0 == dk4sto_add(s_pkgs, back, NULL)) {
+ dk4uc2l_i_close_pkg(back);
+ back = NULL;
+ }
+ }
+ return back;
}
-/** Handler function for text lines.
- @param obj Object to modify while processing the character.
- @param line Text line to process.
+/** Handler to process a line during pass 1.
+ @param obj Object to use and modify during processing.
+ @param line Current text line to process.
@param lineno Current line number.
- @param erp Error report, may be NULL.
- @return DK4_TSP_RES_OK if the character was processed
- successfully,
- DK4_TSP_RES_ERROR if there was an error but we can
- continue,
- DK4_TSP_RES_FATAL if there was a fatal error so we
- should abort processing.
+ @param erp Error report, may be NULL.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on recoverable
+ errors, DK4_TSP_RES_FATAL on fatal errors requiring an abort.
*/
static
int
-dk4uc2l_sp_handler(
- void *obj,
- char *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+dk4uc2l_handler_pass2(
+ void *obj,
+ char *line,
+ dk4_um_t lineno,
+ dk4_er_t *erp
)
{
- dkChar numbuf[16*sizeof(dk4_um_t)];
- dk4_er_t er; /* Error report */
- dk4_uc2l_lhobj *lhobj; /* Handler object */
- dk4_app_t *app; /* Application */
- dk4_uc2l_range_t *rptr; /* Current range to modify */
- dk4_uc2l_pkg_t *pkgptr; /* Current package to create */
- dk4_uc2l_t *ulptr; /* Conversion structure */
- char *pkgn[16]; /* Package names */
- char *p1; /* Attribute name */
- char *p2; /* Next attribute to process */
- char *p4; /* Value, current value part */
- char *p5; /* Next value part */
- const char *pe; /* End of text when reading number */
- dk4_um_t um; /* Number read at start of line */
- size_t sznumbuf; /* Buffer size */
- size_t ind; /* Index of current char in range */
- size_t numpkg; /* Number of package names found */
- size_t i; /* Current package index */
- dk4_c32_t c32; /* Current character to configure */
- int numres; /* Number conversion result */
- int encadd; /* Flag: Add font encodings */
- int res; /* Operation result */
- int back = DK4_TSP_RES_OK;
-
-
-#line 1582 "dk4uc2l.ctr"
- /*
- Set variables.
- */
- lhobj = (dk4_uc2l_lhobj *)obj;
- ulptr = lhobj->ulptr;
- app = lhobj->app;
- dk4app_set_log_source_line(app, lineno);
-
- /*
- Skip empty lines and comments.
- */
- p1 = dk4str8_start(line, NULL);
- if (NULL == p1) {
- goto finished;
- }
- if ('#' == *p1) {
- goto finished;
- }
- p2 = dk4str8_next(p1, NULL);
-
- /*
- Retrieve character number.
- */
- um = (dk4_um_t)0UL;
- pe = NULL;
- res = dk4ma_input_c8_hex_dk4_um_t(&um, p1, &pe, 1, NULL);
- if (0 == res) {
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Syntax, not a number, already reported in first pass. */
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
- c32 = (dk4_c32_t)um;
- if ((dk4_um_t)0xFFFFFFFFUL < um) {
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Syntax, out of range, already reported in first pass. */
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
-
- /*
- Find range.
- */
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(ulptr->i_ranges, &c32, 1);
- if (NULL == rptr) {
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Bug, range not found, must be memory problem reported in pass 1 */
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- goto finished;
- }
-
- /*
- Initialize range if not yet done.
- */
- if (0x00 == rptr->ia) {
- rptr->ia = 0x01;
- dk4uc2l_initialize_range(ulptr, rptr, app);
- }
-
- ind = (size_t)(c32 - rptr->start);
- p1 = p2;
- while (NULL != p1) {
- p2 = dk4str8_next(p1, NULL);
- p4 = dk4str8_chr(p1, '=');
- if (NULL != p4) {
- *(p4++) = '\0';
- p4 = dk4str8_start(p4, NULL);
- if (NULL != p4) {
- switch (dk4str8_abbr_index(dk4uc2l_attribute_names, '$', p1, 0)) {
- case 0: { /* both */
- if (NULL != rptr->both) {
- if (NULL == (rptr->both)[ind]) {
- (rptr->both)[ind] = dk4str8_dup(p4, NULL);
- if (NULL == (rptr->both)[ind]) {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR: Already defined, reported in first pass */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c32, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR */
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } break;
- case 1: { /* text */
- if (NULL != rptr->text) {
- if (NULL == (rptr->text)[ind]) {
- (rptr->text)[ind] = dk4str8_dup(p4, NULL);
- if (NULL == (rptr->text)[ind]) {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR: Already defined, reported in first pass */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c32, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR */
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } break;
- case 2: { /* math */
- if (NULL != rptr->math) {
- if (NULL == (rptr->math)[ind]) {
- (rptr->math)[ind] = dk4str8_dup(p4, NULL);
- if (NULL == (rptr->math)[ind]) {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR: Already defined */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c32, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs,ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR */
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } break;
- case 3: { /* encoding */
- encadd = 1;
- if (NULL != rptr->fenc) {
- if ('!' == *p4) {
- p4++;
- encadd = 0;
- (rptr->fenc)[ind] = (unsigned char)DK4_UC2L_FONT_ENCODING_ALL;
- } else {
- (rptr->fenc)[ind] = 0x00;
- }
- while (NULL != p4) {
- p5 = dk4str8_chr(p4, ',');
- if (NULL != p5) { *(p5++) = '\0'; }
- switch (dk4str8_array_index(dk4uc2l_font_encodings, p4, 0)) {
- case 0: { /* OT1 */
- if (0 != encadd) {
- (rptr->fenc)[ind] |=
- (unsigned char)DK4_UC2L_FONT_ENCODING_OT1;
- } else {
- (rptr->fenc)[ind] &=
- (~((unsigned char)DK4_UC2L_FONT_ENCODING_OT1));
- }
- } break;
- case 1: { /* T1 */
- if (0 != encadd) {
- (rptr->fenc)[ind] |=
- (unsigned char)DK4_UC2L_FONT_ENCODING_T1;
- } else {
- (rptr->fenc)[ind] &=
- (~((unsigned char)DK4_UC2L_FONT_ENCODING_T1));
- }
- } break;
- case 2: { /* T4 */
- if (0 != encadd) {
- (rptr->fenc)[ind] |=
- (unsigned char)DK4_UC2L_FONT_ENCODING_T4;
- } else {
- (rptr->fenc)[ind] &=
- (~((unsigned char)DK4_UC2L_FONT_ENCODING_T4));
- }
- } break;
- case 3: { /* T5 */
- if (0 != encadd) {
- (rptr->fenc)[ind] |=
- (unsigned char)DK4_UC2L_FONT_ENCODING_T5;
- } else {
- (rptr->fenc)[ind] &=
- (~((unsigned char)DK4_UC2L_FONT_ENCODING_T5));
- }
- } break;
- default : {
- /* ERROR: Syntax, undefined encoding */
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,8);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- } break;
- }
- p4 = p5;
- }
- } else {
- /* ERROR */
- }
- } break;
- case 4: { /* packages */
- dk4error_init(&er);
- numpkg = dk4str8_tokenize(pkgn, 16, p4, ",", &er);
- if (0 < numpkg) {
- if (NULL != rptr->pkgs) {
- if (NULL == (rptr->pkgs)[ind]) {
- (rptr->pkgs)[ind] =
- dk4mem_new_app(dk4_uc2l_pkg_ptr,(numpkg+1),app);
- if (NULL != (rptr->pkgs)[ind]) {
- for (i = 0; i <= numpkg; i++) {
- ((rptr->pkgs)[ind])[i] = NULL;
- }
- for (i = 0; i < numpkg; i++) {
- pkgptr = (dk4_uc2l_pkg_t *)dk4sto_it_find_like(
- ulptr->i_pkgs, pkgn[i], 1
- );
- if (NULL != pkgptr) {
- ((rptr->pkgs)[ind])[i] = pkgptr;
- } else {
- pkgptr = dk4uc2l_pkg_open(pkgn[i], app);
- if (NULL != pkgptr) {
- if (0 == dk4sto_add(ulptr->s_pkgs, pkgptr, NULL)) {
- dk4uc2l_pkg_close(pkgptr);
- pkgptr = NULL;
- }
+ dk4_er_t er;
+ char *pkgn[16];
+ handler_object_t *lho = NULL;
+ const char *pe = NULL;
+ char *p1 = NULL;
+ char *p2 = NULL;
+ char *p3 = NULL;
+ char *p4 = NULL;
+ dk4_uc2l_range_t *rptr = NULL;
+ dk4_uc2l_pkg_t *pptr = NULL;
+ size_t ind = 0;
+ size_t numpkg = 0;
+ size_t i = 0;
+ unsigned long ul = 0UL;
+ dk4_c32_t c32 = (dk4_c32_t)0UL;
+ int back = DK4_TSP_RES_OK;
+ int res = 0;
+ int adding = 0;
+ unsigned char fex = 0;
+ unsigned char feval = 0;
+
+
+#line 1956 "dk4uc2l.ctr"
+#if TRACE_DEBUG
+ dk4str8_delnl(line);
+
+
+#line 1959 "dk4uc2l.ctr"
+#endif
+
+ /* Line handler object
+ */
+ lho = (handler_object_t *)obj;
+
+ /* Find start of line, ignore empty lines and comments
+ */
+ p1 = dk4str8_start(line, NULL);
+ if (NULL == p1) {
+
+#line 1969 "dk4uc2l.ctr"
+ goto finished;
+ }
+ if ('#' == *p1) {
+
+#line 1972 "dk4uc2l.ctr"
+ goto finished;
+ }
+
+ /* Retrieve character number
+ */
+ p2 = dk4str8_next(p1, NULL);
+ res = dk4ma_input_c8_hex_ulong(&ul, p1, &pe, 1, erp);
+ if (0 == res) {
+
+#line 1980 "dk4uc2l.ctr"
+ /* WARNING: Syntax, no number.
+ Already reported in pass 1.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+ c32 = (dk4_c32_t)ul;
+
+ /* Find and check range structure, attempt cached range pointer first
+ */
+ if (NULL != lho->rpc) {
+ if ((lho->rpc->start <= c32) && (c32 <= lho->rpc->end)) {
+ rptr = lho->rpc;
+ }
+ }
+ if (NULL == rptr) {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lho->ulptr->i_ranges,&c32,1);
+ }
+ if (NULL == rptr) {
+
+#line 1999 "dk4uc2l.ctr"
+ /* ERROR: No range found.
+ Already reported in pass 1.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ if (0 != dk4str_cmp(lho->file->fn, rptr->file->fn)) {
+ /* ERROR: Not owned by current file.
+ Already reported in pass 1.
+ */
+
+
+#line 2011 "dk4uc2l.ctr"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+
+ /* Initialize range structure (allocate memory) if not yet done
+ */
+ if (0x00 == rptr->ia) {
+
+#line 2018 "dk4uc2l.ctr"
+ if (0 == dk4uc2l_i_init_range(rptr, erp)) {
+
+
+#line 2020 "dk4uc2l.ctr"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ rptr->ia = 0x01;
+
+#line 2025 "dk4uc2l.ctr"
+ }
+ else {
+
+#line 2027 "dk4uc2l.ctr"
+ }
+
+ /* Find index
+ */
+ ind = (size_t)(c32 - rptr->start);
+
+ /* Check whether character already defined
+ */
+ if (NULL != rptr->lno) {
+ if ((dk4_um_t)0UL != (rptr->lno)[ind]) {
+ /* ERROR: Redefinition.
+ Already reported in pass 1.
+ */
+
+
+#line 2041 "dk4uc2l.ctr"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+ else {
+ (rptr->lno)[ind] = lineno;
+ }
+ }
+
+ /* Traverse all strings in line
+ */
+ p1 = p2;
+ while (NULL != p1) {
+
+#line 2053 "dk4uc2l.ctr"
+ p2 = dk4str8_next(p1, NULL);
+ p3 = dk4str8_chr(p1, '=');
+ if (NULL != p3) {
+ *(p3++) = '\0';
+ p3 = dk4str8_start(p3, NULL);
+ if (NULL != p3) {
+
+
+#line 2060 "dk4uc2l.ctr"
+ res = dk4uc2l_i_keyword_index(p1);
+ switch (res) {
+ case 0 : {
+
+#line 2063 "dk4uc2l.ctr"
+ if (NULL != rptr->both) {
+ if (NULL == (rptr->both)[ind]) {
+ (rptr->both)[ind] = dk4str8_dup(p3, erp);
+ if (NULL == (rptr->both)[ind]) {
+
+
+#line 2068 "dk4uc2l.ctr"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else {
+
+#line 2073 "dk4uc2l.ctr"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 2080 "dk4uc2l.ctr"
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 1 : {
+
+#line 2087 "dk4uc2l.ctr"
+ if (NULL != rptr->text) {
+ if (NULL == (rptr->text)[ind]) {
+ (rptr->text)[ind] = dk4str8_dup(p3, erp);
+ if (NULL == (rptr->text)[ind]) {
+
+
+#line 2092 "dk4uc2l.ctr"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else {
+
+#line 2097 "dk4uc2l.ctr"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 2104 "dk4uc2l.ctr"
+ /* ERROR: Memory
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 2 : {
+
+#line 2111 "dk4uc2l.ctr"
+ if (NULL != rptr->math) {
+ if (NULL == (rptr->math)[ind]) {
+ (rptr->math)[ind] = dk4str8_dup(p3, erp);
+ if (NULL == (rptr->math)[ind]) {
+
+
+#line 2116 "dk4uc2l.ctr"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else {
+
+#line 2121 "dk4uc2l.ctr"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 2128 "dk4uc2l.ctr"
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 3 : {
+
+#line 2135 "dk4uc2l.ctr"
+ if (NULL != rptr->fenc) {
+ adding = 1;
+ feval = 0x00;
+ if ('!' == *p3) {
+ adding = 0;
+ p3++;
+ feval = DK4_UC2L_FONT_ENCODING_ALL;
+ }
+ while (NULL != p3) {
+ p4 = dk4str8_chr(p3, ',');
+ if (NULL != p4) {
+ *(p4++) = '\0';
+ }
+ fex = dk4uc2l_font_encoding_from_name(p3);
+ if (0x00 != fex) {
+ if (0 != adding) {
+ feval |= fex;
+ }
+ else {
+ feval &= (~(fex));
+ }
+ }
+ else {
+
+#line 2158 "dk4uc2l.ctr"
+ /* ERROR: Illegal encoding name */
+ dk4error_set_simple_error_code(
+ erp, DK4_E_SYNTAX
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_SYNTAX;
+ }
+ p3 = p4;
+ }
+ (rptr->fenc)[ind] = feval;
+ }
+ else {
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 4 : {
+
+#line 2177 "dk4uc2l.ctr"
+ if (NULL != rptr->pkgs) {
+ if (NULL == (rptr->pkgs)[ind]) {
+ dk4error_init(&er);
+ numpkg = dk4str8_tokenize(
+ pkgn, 16, p3, ",", &er
+ );
+ if (0 < numpkg) {
+ (rptr->pkgs)[ind] =
+ dk4mem_new(dk4_uc2l_pkg_p,(numpkg+1),erp);
+ if (NULL != (rptr->pkgs)[ind]) {
+ for (i = 0; i <= numpkg; i++) {
+ ((rptr->pkgs)[ind])[i] = NULL;
+ }
+ for (i = 0; i < numpkg; i++) {
+ pptr =
+ (dk4_uc2l_pkg_t *)dk4sto_it_find_like(
+ lho->ulptr->i_pkgs, pkgn[i], 1
+ );
+ if (NULL != pptr) {
+ ((rptr->pkgs)[ind])[i] = pptr;
+ }
+ else {
+ pptr = dk4uc2l_i_create_pkg(
+ lho->ulptr->s_pkgs, pkgn[i]
+ );
+ if (NULL != pptr) {
+ ((rptr->pkgs)[ind])[i] =
+ pptr;
+ }
+ else {
+
+#line 2207 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(
+ erp,
+ DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ }
+ }
+ else {
+
+#line 2218 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(
+ erp,
+ DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else {
+
+#line 2227 "dk4uc2l.ctr"
+ /* ERROR: Syntax, empty list */
+ dk4error_set_simple_error_code(
+ erp, DK4_E_SYNTAX
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 2236 "dk4uc2l.ctr"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 2243 "dk4uc2l.ctr"
+ /* ERROR: Memory.
+ Already reported during range initalization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ default : {
+
+#line 2250 "dk4uc2l.ctr"
+ /* ERROR: Illegal key name */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ } break;
+ }
+ p1 = p2;
}
- if (NULL != pkgptr) {
- ((rptr->pkgs)[ind])[i] = pkgptr;
- } else {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ else {
+
+#line 2258 "dk4uc2l.ctr"
+ /* ERROR: Syntax, not a key=value */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ p1 = NULL;
}
- }
- }
- } else {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR: Redefinition */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c32, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs,ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR Syntax */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 9);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } break;
- default: {
- /* ERROR: Syntax error */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 10);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- } break;
- }
- } else {
- /* ERROR: Syntax */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 11);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR: Syntax */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 11);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- p1 = p2;
- }
-
- finished:
-
-
-#line 1887 "dk4uc2l.ctr"
- return back;
+ }
+ else {
+
+#line 2265 "dk4uc2l.ctr"
+ /* ERROR: Syntax, not a key=value */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ p1 = NULL;
+ }
+ }
+
+ finished:
+
+
+#line 2274 "dk4uc2l.ctr"
+ return back;
}
+/** Load data file.
+ @param ulptr Conversion structure.
+ @param fptr File structure to load.
+ @param erp Error report, may be NULL.
+*/
static
void
-dk4uc2l_sp_process_stream(
- dk4_uc2l_t *ulptr,
- dk4_stream_t *rstrm,
- const dkChar *fnb,
- dk4_app_t *app
+dk4uc2l_load_data_file(
+ dk4_uc2l_t *ulptr,
+ dk4_uc2l_file_t *fptr,
+ dk4_er_t *erp
)
{
- char buf[256]; /* Line buffer */
- dk4_uc2l_lhobj obj; /* Processing object */
- dk4_tsp08_t tsp08; /* Text stream processor */
- dk4_er_t er; /* General error report */
- dk4_er_t er_en; /* Error report encoding/decoding */
- dk4_er_t er_pr; /* Error report processing */
- int res; /* Operation result */
- int cc; /* Flag: Can continue */
- char c; /* Current character to process */
-
- obj.ulptr = ulptr;
- obj.app = app;
- obj.sfn = fnb;
- obj.e_d = 0;
- obj.e_e = 0;
- obj.e_p = 0;
- dk4error_init(&er);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- res = dk4tsp08_setup_line(
- &tsp08, (void *)(&obj), dk4uc2l_sp_handler, buf, sizeof(buf),
- DK4_ENCODING_ASCII, DK4_ENCODING_ASCII, &er
- );
- if (0 != res) {
- cc = 1;
- while (1 == cc) {
- res = dk4stream_c8_read_byte(&c, rstrm, &er);
- if (0 != res) {
- res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ dkChar fnb[DK4_MAX_PATH];
+ char lnb[256];
+ handler_object_t ho;
+ dk4_tsp08_t tsp08;
+ dk4_stream_t *rstrm = NULL;
+ size_t fnbsz = DK4_SIZEOF(fnb,dkChar);
+ size_t szlnb = sizeof(lnb);
+ int res;
+ int cc;
+ char c;
+
+
+
+#line 2304 "dk4uc2l.ctr"
+
+ /* Initialize handler object
+ */
+ ho.ulptr = ulptr;
+ ho.s_ra = NULL;
+ ho.i_ra = NULL;
+ ho.file = fptr;
+ ho.rpc = NULL;
+
+ /* Save source file name and line number
+ */
+
+ /* Each file should be loaded only once
+ */
+ if (0x00 != fptr->loaded) {
+ goto finished;
+ }
+ fptr->loaded = 0x01;
+
+ /* Construct full path name
+ */
+ if (0 == dk4str_cpy_s(fnb, fnbsz, ulptr->dname, erp)) {
+ /* ERROR: Directory name too long */
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ if (0 == dk4str_cat_s(fnb, fnbsz, dk4uc2l_kwnl[3], erp)) {
+ /* ERROR: Directory name too long */
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ if (0 == dk4str_cat_s(fnb, fnbsz, fptr->fn, erp)) {
+ /* ERROR: Directory name too long */
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ dk4path_correct_sep(fnb);
+
+ /* Open reader stream
+ */
+ rstrm = dk4stream_open_file_reader(fnb, erp);
+ if (NULL == rstrm) {
+ /* ERROR: Failed to read file */
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ goto finished;
+ }
+
+ /* Initialize text processing
+ */
+ res = dk4tsp08_setup_line(
+ &tsp08, (void *)(&ho), dk4uc2l_handler_pass2, lnb, szlnb,
+ DK4_ENCODING_PLAIN, DK4_ENCODING_PLAIN, erp
+ );
+ if (0 == res) {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ /* ERROR: Memory */
+ goto finished;
+ }
+
+ /* Process contents
+ */
+ do {
+ cc = 0;
+ res = dk4stream_c8_read_byte(&c, rstrm, erp);
+ if (0 < res) {
+ cc = 1;
+ res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ } break;
+ case DK4_TSP_RES_FATAL : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ } break;
+ }
+ }
+ } while (0 < cc);
+
+ /* Finish text processing
+ */
+ res = dk4tsp08_finish(&tsp08);
switch (res) {
- case DK4_TSP_RES_ERROR: {
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- case DK4_TSP_RES_FATAL: {
- cc = -1;
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- }
- } else {
- cc = 0;
- }
- }
- if (0 == cc) {
- res = dk4tsp08_finish(&tsp08);
- switch (res) {
- case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- }
- }
- } else {
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
+ case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ } break;
+ }
+
+ /* Clean up
+ */
+ finished:
+ if (NULL != rstrm) {
+ dk4stream_close(rstrm, NULL);
+ }
+
+
+#line 2399 "dk4uc2l.ctr"
+}
+
+
+
+const char *
+dk4uc2l_find(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_er_t *erp)
+{
+ dk4_uc2l_range_t *rptr;
+ dk4_uc2l_pkg_t **pkgpp;
+ dk4_uc2l_file_t *fptr;
+ const char *back = NULL;
+ size_t ind;
+ size_t blgt;
+ int res;
+
+
+#line 2414 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ /* Check ulptr usability
+ */
+ if (NULL == ulptr) {
+
+#line 2420 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ /* Attempt direct output
+ */
+ if (0 != dk4uc2lat_direct(c)) {
+
+#line 2427 "dk4uc2l.ctr"
+ ulptr->buf[0] = (char)c;
+ ulptr->buf[1] = '\0';
+ back = &(ulptr->buf[0]);
+ goto finished;
+ }
+
+ /* Attempt data loaded from files
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(ulptr->i_ranges, &c, 1);
+ if (NULL != rptr) {
+
+#line 2437 "dk4uc2l.ctr"
+ fptr = rptr->file;
+ if (0x00 == fptr->loaded) {
+
+#line 2439 "dk4uc2l.ctr"
+ dk4uc2l_load_data_file(ulptr, fptr, erp);
+ }
+ ind = (size_t)(c - rptr->start);
+ if (0 != mm) {
+
+#line 2443 "dk4uc2l.ctr"
+ if (NULL != rptr->math) {
+ back = (rptr->math)[ind];
+ }
+ }
+ else {
+
+#line 2448 "dk4uc2l.ctr"
+ if (NULL != rptr->text) {
+ back = (rptr->text)[ind];
+ }
+ }
+ if (NULL == back) {
+
+#line 2453 "dk4uc2l.ctr"
+ if (NULL != rptr->both) {
+ back = (rptr->both)[ind];
+ }
+ }
+ if (NULL != back) {
+
+#line 2458 "dk4uc2l.ctr"
+ if (NULL != rptr->pkgs) {
+
+#line 2459 "dk4uc2l.ctr"
+ pkgpp = (rptr->pkgs)[ind];
+ if (NULL != pkgpp) {
+ while (NULL != *pkgpp) {
+ (*(pkgpp++))->used = 0x01;
+ }
+ }
+ }
+ if (NULL != rptr->fenc) {
+
+#line 2467 "dk4uc2l.ctr"
+ ulptr->fallowed &= (rptr->fenc)[ind];
+ }
+ goto finished;
+ }
+ }
+
+ /* Attempt to use UTF-8 encoded data or ASCII data directly
+ */
+
+
+#line 2476 "dk4uc2l.ctr"
+ if (0 == mm) {
+ if (0x00 != ulptr->utf8allowed) {
+
+#line 2478 "dk4uc2l.ctr"
+ blgt = 15;
+ res = dk4utf8_encode(
+ (unsigned char *)(&(ulptr->buf[0])), &blgt, c, erp
+ );
+ if (0 != res) {
+ ulptr->buf[blgt] = '\0';
+ back = &(ulptr->buf[0]);
+ }
+ }
+ else {
+
+#line 2488 "dk4uc2l.ctr"
+ if (dkC32(0x00000100) > c) {
+ ulptr->buf[0] = (char)c;
+ ulptr->buf[1] = '\0';
+ back = &(ulptr->buf[0]);
+ }
+ }
+ }
+
+ finished:
+
+
+#line 2498 "dk4uc2l.ctr"
+
+
+#line 2499 "dk4uc2l.ctr"
+
+
+#line 2500 "dk4uc2l.ctr"
+
+
+#line 2501 "dk4uc2l.ctr"
+ return back;
}
-/** Attempt to load one data file if not yet loaded.
- @param ulptr Conversion structure.
- @param rptr Pointer to range causing the attempt to load.
- @param app Application structure for diagnostics, may be NULL.
-*/
static
-void
-dk4uc2l_load_if_not_yet_done(
- dk4_uc2l_t *ulptr,
- dk4_uc2l_range_t *rptr,
- dk4_app_t *app
+int
+dk4uc2l_i_encoding(
+ unsigned char enclist,
+ unsigned char oneenc
)
{
- dkChar fnb[DK4_MAX_PATH];
- dk4_er_t er;
- const dkChar *oldsourcefile;
- dk4_uc2l_file_t *fptr;
- dk4_stream_t *rstrm;
- dk4_um_t oldsourceline;
- size_t fnbsz;
-
-
-#line 1992 "dk4uc2l.ctr"
- fptr = rptr->file;
- if (NULL != fptr) {
-
-#line 1994 "dk4uc2l.ctr"
- if (0x00 == fptr->loaded) {
-
-#line 1995 "dk4uc2l.ctr"
- fptr->loaded = 0x01;
- fnbsz = DK4_SIZEOF(fnb, dkChar);
- if (0 != dk4str_cpy_s(fnb, fnbsz, ulptr->dname, NULL)) {
- if (0 != dk4str_cat_s(fnb, fnbsz, dk4uc2l_kwnl[7], NULL)) {
- if (0 != dk4str_cat_s(fnb, fnbsz, fptr->fn, NULL)) {
- dk4path_correct_sep(fnb);
- dk4error_init(&er);
- rstrm = dk4stream_open_file_reader(fnb, &er);
- if (NULL != rstrm) {
- oldsourcefile = dk4app_get_log_source_file(app);
- oldsourceline = dk4app_get_log_source_line(app);
- dk4app_set_log_source_file(app, fnb);
- dk4app_set_log_source_line(app, (dk4_um_t)0UL);
- dk4uc2l_sp_process_stream(ulptr, rstrm, fnb, app);
- dk4app_set_log_source_file(app, oldsourcefile);
- dk4app_set_log_source_line(app, oldsourceline);
- dk4stream_close(rstrm, NULL);
- } else {
-
-#line 2013 "dk4uc2l.ctr"
- /* ERROR: Failed to open file */
- dk4app_log_3(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 6, 7, fnb
- );
- ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
- }
- } else {
+ int back = 0;
+ if (0x00 != (enclist & ((unsigned char)oneenc))) {
+ back = 1;
+ }
+ return back;
+}
-#line 2020 "dk4uc2l.ctr"
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else {
-#line 2025 "dk4uc2l.ctr"
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+
+void
+dk4uc2l_recommendations(dk4_uc2l_t *ulptr, dk4_stream_t *wstrm, dk4_er_t *erp)
+{
+ dk4_uc2l_pkg_t *pptr;
+
+
+#line 2527 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+#endif
+ if ((NULL != ulptr) && (NULL != wstrm)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[0], erp
+ );
+ if (dk4uc2l_i_encoding(ulptr->fallowed,DK4_UC2L_FONT_ENCODING_T1)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[3], erp
+ );
+ }
+ if (dk4uc2l_i_encoding(ulptr->fallowed,DK4_UC2L_FONT_ENCODING_OT1)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[2], erp
+ );
+ }
+ if (dk4uc2l_i_encoding(ulptr->fallowed,DK4_UC2L_FONT_ENCODING_T4)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[4], erp
+ );
+ }
+ if (dk4uc2l_i_encoding(ulptr->fallowed,DK4_UC2L_FONT_ENCODING_T5)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[5], erp
+ );
+ }
+ dk4stream_write_byte(wstrm, '\n', erp);
+ dk4sto_it_reset(ulptr->i_pkgs);
+ do {
+ pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
+ if (NULL != pptr) {
+ if (0x00 != pptr->used) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[1], erp
+ );
+ dk4stream_write_char_string(
+ wstrm, pptr->pn, erp
+ );
+ dk4stream_write_byte(wstrm, '\n', erp);
+ }
+ }
+ } while (NULL != pptr);
}
- } else {
+
+
+#line 2573 "dk4uc2l.ctr"
+}
-#line 2030 "dk4uc2l.ctr"
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else {
-#line 2035 "dk4uc2l.ctr"
- }
- } else {
-#line 2037 "dk4uc2l.ctr"
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
+int
+dk4uc2l_retrieve_errors(dk4_uc2l_t *ulptr)
+{
+ int back = 0;
+
-#line 2039 "dk4uc2l.ctr"
+#line 2582 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ back = ulptr->had_error;
+ }
+
+
+#line 2589 "dk4uc2l.ctr"
+ return back;
}
-const char *
-dk4uc2l_find(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app)
+void
+dk4uc2l_reset_errors(dk4_uc2l_t *ulptr)
{
- dkChar numbuf[16*sizeof(dk4_um_t)];
- dk4_uc2l_range_t *rptr;
- dk4_uc2l_pkg_t **pptr;
- dk4_uc2l_pkg_t *xpptr;
- const char *back = NULL;
- size_t blgt;
- size_t sznumbuf;
- int numres;
-
-
-#line 2055 "dk4uc2l.ctr"
- if (NULL != ulptr) {
- /*
- Attempt direct output.
- */
- if (0 != dk4uc2lat_direct(c)) {
- ulptr->buf[0] = (char)c;
- ulptr->buf[1] = '\0';
- back = &(ulptr->buf[0]);
- goto finished;
- }
-
- /*
- Attempt to find output string in data.
- */
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(
- ulptr->i_ranges, &c, 1
- );
- if (NULL != rptr) {
- dk4uc2l_load_if_not_yet_done(ulptr, rptr, app);
- if (0 != mm) {
- if (NULL != rptr->math) {
- back = (rptr->math)[(size_t)(c - rptr->start)];
- }
- if (NULL == back) {
- if (NULL != rptr->both) {
- back = (rptr->both)[(size_t)(c - rptr->start)];
- }
- }
- } else {
- if (NULL != rptr->text) {
- back = (rptr->text)[(size_t)(c - rptr->start)];
- }
- if (NULL == back) {
- if (NULL != rptr->both) {
- back = (rptr->both)[(size_t)(c - rptr->start)];
- }
- }
- }
- if (NULL != back) {
- if (NULL != rptr->fenc) {
- ulptr->fallowed &= (rptr->fenc)[(size_t)(c - rptr->start)];
- }
- if (NULL != rptr->pkgs) {
- if (NULL != (rptr->pkgs)[(size_t)(c - rptr->start)]) {
- pptr = (rptr->pkgs)[(size_t)(c - rptr->start)];
- while (NULL != *pptr) {
- xpptr = *(pptr++);
- xpptr->used = 0x01;
- }
- }
- }
- }
- }
- if (NULL != back) { goto finished; }
-
- /*
- If everything failed so far, attempt to use UTF-8 output
- or direct output.
- */
- if (0 != mm) { goto finished; }
- if (0x00 != ulptr->utf8allowed) {
- blgt = 15;
- if (0 != dk4utf8_encode((unsigned char *)(&(ulptr->buf[0])),&blgt,c,NULL))
- {
- ulptr->buf[blgt] = '\0';
- back = &(ulptr->buf[0]);
- }
- else
- {
- /* ERROR: UTF-8 encoding failed */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs,ulptr->szmsgs, DK4_LL_ERROR, 12, 13, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,14);
- }
-
- }
- } else {
- if (dkC32(0x00000100) > c) {
- ulptr->buf[0] = (char)c;
- ulptr->buf[1] = '\0';
- back = &(ulptr->buf[0]);
- } else {
- /* ERROR: No encoding found */
- }
- }
- }
- finished:
-
-
-#line 2150 "dk4uc2l.ctr"
- return back;
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ ulptr->had_error = 0;
+ }
}
-dk4_uc2l_t *
-dk4uc2l_open(const dkChar *dn, dk4_app_t *app)
+/* ##### untested */
+static
+void
+dk4uc2l_putc32(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ dk4_c32_t c32,
+ int *pmm,
+ int *pback,
+ dk4_er_t *erp
+)
{
- dk4_er_t er;
- dk4_uc2l_t *back = NULL;
-
-
-#line 2161 "dk4uc2l.ctr"
- dk4error_init(&er);
- if (NULL != dn) {
- if (0 != dk4file_is_directory(dn, &er)) {
- back = dk4uc2l_create(dn, app);
- if (NULL != back) {
- if (0 == dk4uc2l_first_pass(back, app)) {
- dk4uc2l_close(back);
- back = NULL;
- }
- }
- } else {
- /* ERROR: Not a directory */
- dk4app_log_base3(app, DK4_LL_ERROR, 152, 153, dn);
- }
- }
-
-#line 2176 "dk4uc2l.ctr"
- return back;
+ dk4_er_t er;
+ const char *le = NULL;
+
+
+#line 2622 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+#endif
+ dk4error_init(&er);
+ le = dk4uc2l_find(ulptr, c32, 0, &er);
+ if (NULL != le) {
+
+#line 2629 "dk4uc2l.ctr"
+ if (0 != *pmm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ *pback = 0;
+
+#line 2632 "dk4uc2l.ctr"
+ }
+ *pmm = 0;
+ }
+ if (0 == dk4stream_write_char_string(wstrm, le, erp)) {
+ *pback = 0;
+
+#line 2637 "dk4uc2l.ctr"
+ }
+ }
+ else {
+ le = dk4uc2l_find(ulptr, c32, 1, &er);
+ if (NULL != le) {
+
+#line 2642 "dk4uc2l.ctr"
+ if (0 == *pmm) {
+ if (0 == dk4stream_write_char_string(wstrm,dk4uc2l_mm[0],erp)) {
+ *pback = 0;
+
+#line 2645 "dk4uc2l.ctr"
+ }
+ *pmm = 1;
+ }
+ if (0 == dk4stream_write_char_string(wstrm, le, erp)) {
+ *pback = 0;
+
+#line 2650 "dk4uc2l.ctr"
+ }
+ }
+ else {
+
+#line 2653 "dk4uc2l.ctr"
+ *pback = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
+ }
+ }
+
+
+#line 2658 "dk4uc2l.ctr"
}
-dk4_uc2l_t *
-dk4uc2l_open_from_app(dk4_app_t *app)
+/* ##### untested */
+int
+dk4uc2l_string_c32(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c32_t *str,
+ dk4_er_t *erp
+)
{
- dkChar fnb[DK4_MAX_PATH]; /* Buffer to construct name */
- const dkChar * const *debmsg;
- dk4_uc2l_t *back = NULL;
- size_t i = 0; /* Traverse possible dirs */
- size_t szdm = 0;
- int done = 0; /* Flag: Attempted */
- int toolo = 0; /* Flag: Name too long */
- int res = 0; /* Operation result */
-
-
-#line 2193 "dk4uc2l.ctr"
- if (NULL != app) {
- res = dk4app_pref_get(fnb,DK4_SIZEOF(fnb,dkChar),app,dk4uc2l_kwnl[0],0);
- if (0 != res) {
- dk4path_correct_sep(fnb);
- if (0 != dk4file_is_directory(fnb, NULL)) {
- done = 1;
- back = dk4uc2l_open(fnb, app);
- }
- }
- for (i = 1; i < 4; i++) {
- if ((0 == done) && (NULL == back)) {
- if (0 != dk4str_cpy_s(fnb,DK4_SIZEOF(fnb,dkChar),app->dir_share,NULL)) {
- if (0 != dk4str_cat_s(fnb,DK4_SIZEOF(fnb,dkChar),dk4uc2l_kwnl[i],NULL))
- {
- dk4path_correct_sep(fnb);
- if (0 != dk4file_is_directory(fnb, NULL)) {
- done = 1;
- back = dk4uc2l_open(fnb, app);
- }
- } else {
- toolo = 1;
- }
- } else {
- toolo = 1;
- }
- }
- }
- }
- if (NULL == back) {
- if (0 == done) {
- if (0 != toolo) {
- /* ERROR: shared directory name too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, app->dir_share);
- } else {
- /* ERROR: No charmap directory found */
- debmsg = dk4app_string_table(app, dk4uc2l_kwnl[8], dk4uc2l_kw_def);
- szdm = dk4app_string_table_size(dk4uc2l_kw_def);
- dk4app_log_1(app, debmsg, szdm, DK4_LL_ERROR, 15);
- }
- }
- }
-
-#line 2234 "dk4uc2l.ctr"
- return back;
+ int back = 0;
+ int mm = 0;
+
+
+
+#line 2675 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ /* Process all characters from string
+ */
+ back = 1;
+ while (dkC32(0) != *str) {
+ dk4uc2l_putc32(wstrm, ulptr, *(str++), &mm, &back, erp);
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+ }
+ }
+
+ finished:
+
+
+#line 2704 "dk4uc2l.ctr"
+ return back;
}
-void
-dk4uc2l_clean_packages_and_fonts(dk4_uc2l_t *ulptr)
+/* ##### untested */
+int
+dk4uc2l_string_c16(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c16_t *str,
+ dk4_er_t *erp
+)
{
- dk4_uc2l_pkg_t *pptr;
-
-
-#line 2244 "dk4uc2l.ctr"
- if (NULL != ulptr) {
- ulptr->fallowed = DK4_UC2L_FONT_ENCODING_ALL;
- dk4sto_it_reset(ulptr->i_pkgs);
- do {
- pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
- if (NULL != pptr) {
- pptr->used = 0x00;
- }
- } while (NULL != pptr);
- }
-
-#line 2254 "dk4uc2l.ctr"
+ dk4_utf16_decoder_t dec;
+ dk4_c32_t c32;
+ int mm = 0;
+ int back = 0;
+ int err = 0;
+
+
+#line 2724 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+
+#line 2732 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ back = 1;
+ dk4utf16_init(&dec);
+ while ((dkC16(0) != *str) && (0 == err)) {
+
+#line 2739 "dk4uc2l.ctr"
+ switch (dk4utf16_add(&dec, *(str++))) {
+ case DK4_EDSTM_FINISHED : {
+ c32 = dk4utf16_get(&dec);
+ dk4utf16_init(&dec);
+ dk4uc2l_putc32(wstrm, ulptr, c32, &mm, &back, erp);
+
+
+#line 2745 "dk4uc2l.ctr"
+ } break;
+ case DK4_EDSTM_ERROR : {
+
+#line 2747 "dk4uc2l.ctr"
+ err = 1;
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ } break;
+ }
+ }
+ if (0 == err) {
+ if (0 == dk4utf16_is_empty(&dec)) {
+
+#line 2755 "dk4uc2l.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ }
+ }
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+
+#line 2762 "dk4uc2l.ctr"
+ }
+ }
+
+ finished:
+
+
+#line 2767 "dk4uc2l.ctr"
+ return back;
}
-unsigned char
-dk4uc2l_retrieve_allowed_fe(dk4_uc2l_t *ulptr)
+/* ##### untested */
+int
+dk4uc2l_string_utf8(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+)
{
- unsigned char back = 0x00;
-
+ dk4_utf8_decoder_t dec;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+ int err = 0;
+
+
+#line 2787 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ back = 1;
+ dk4utf8_init(&dec);
+ while(('\0' != *str) && (0 == err)) {
+ switch (dk4utf8_add(&dec, (unsigned char)(*(str++)))) {
+ case DK4_EDSTM_FINISHED : {
+ c32 = dk4utf8_get(&dec);
+ dk4utf8_init(&dec);
+ dk4uc2l_putc32(wstrm, ulptr, c32, &mm, &back, erp);
+ } break;
+ case DK4_EDSTM_ERROR : {
+ err = 1;
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ } break;
+ }
+ }
+ if (0 == err) {
+ if (0 == dk4utf8_is_empty(&dec)) {
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ }
+ }
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+ }
+ }
-#line 2263 "dk4uc2l.ctr"
- if (NULL != ulptr) {
- back = ulptr->fallowed;
- }
+ finished:
+
-#line 2266 "dk4uc2l.ctr"
- return back;
+#line 2827 "dk4uc2l.ctr"
+ return back;
}
-void
-dk4uc2l_allow_utf8(dk4_uc2l_t *ulptr, int enabled)
+/* ##### untested */
+int
+dk4uc2l_string_ansi(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+)
{
- if (NULL != ulptr) {
- ulptr->utf8allowed = ((0 != enabled) ? 0x01 : 0x00);
- }
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+
+
+#line 2845 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ while ('\0' != *str) {
+ if (0 != dk4ansi_decode(&c32, (unsigned char)(*(str++)))) {
+ dk4uc2l_putc32(wstrm, ulptr, c32, &mm, &back, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ }
+ }
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+ }
+ }
+
+ finished:
+
+
+#line 2872 "dk4uc2l.ctr"
+ return back;
}
+/* ##### untested */
int
-dk4uc2lat_direct(dk4_c32_t c32)
+dk4uc2l_string_ascii(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+)
{
- int back = 0;
- char c; /* 8-bit character version of c32. */
-
-
-#line 2287 "dk4uc2l.ctr"
- if((unsigned long)c32 < 128UL) {
- c = (char)c32;
- switch(c) {
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g':
- case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
- case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u':
- case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B':
- case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I':
- case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P':
- case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W':
- case 'X': case 'Y': case 'Z': case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7': case '8': case '9': case ',':
- case '.': case ':': case ';': case '+': case '-': case '?': case '!':
- case '|': case '@': case '(': case ')': case '/': case '=': case ' ':
- {
- back = 1;
- }
- break;
- }
- }
-
-#line 2307 "dk4uc2l.ctr"
- return back;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+
+
+#line 2890 "dk4uc2l.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ back = 1;
+ while ('\0' != *str) {
+ c32 = (dk4_c32_t)((unsigned char)(*(str++)));
+ dk4uc2l_putc32(wstrm, ulptr, c32, &mm, &back, erp);
+ }
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+ }
+ }
+
+ finished:
+
+
+#line 2913 "dk4uc2l.ctr"
+ return back;
}
-void
-dk4uc2l_recommendations(dk4_uc2l_t *ulptr, FILE *fipo)
+/* ##### untested */
+int
+dk4uc2l_string_c8(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ int ie,
+ dk4_er_t *erp
+)
{
- dk4_uc2l_pkg_t *pptr;
- if ((NULL != ulptr) && (NULL != fipo)) {
- fputs(dk4uc2l_kw8[0], fipo);
- if (0x00 != (ulptr->fallowed & (unsigned char)DK4_UC2L_FONT_ENCODING_T1)) {
- fputs(dk4uc2l_kw8[3], fipo);
- }
- if (0x00 != (ulptr->fallowed & (unsigned char)DK4_UC2L_FONT_ENCODING_OT1)) {
- fputs(dk4uc2l_kw8[2], fipo);
- }
- if (0x00 != (ulptr->fallowed & (unsigned char)DK4_UC2L_FONT_ENCODING_T4)) {
- fputs(dk4uc2l_kw8[4], fipo);
- }
- if (0x00 != (ulptr->fallowed & (unsigned char)DK4_UC2L_FONT_ENCODING_T5)) {
- fputs(dk4uc2l_kw8[5], fipo);
- }
- fputc('\n', stdout);
- dk4sto_it_reset(ulptr->i_pkgs);
- do {
- pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
- if (NULL != pptr) {
- if (0x00 != pptr->used) {
- fputs(dk4uc2l_kw8[1], fipo);
- fputs(pptr->pn, fipo);
- fputc('\n', fipo);
- }
- }
- } while (NULL != pptr);
- }
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ switch (ie) {
+ case DK4_ENCODING_UTF8 : {
+ return (dk4uc2l_string_utf8(wstrm, ulptr, str, erp));
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ return (dk4uc2l_string_ansi(wstrm, ulptr, str, erp));
+ } break;
+ default : {
+ return (dk4uc2l_string_ascii(wstrm, ulptr, str, erp));
+ } break;
+ }
}
+/* ##### untested */
int
-dk4uc2l_retrieve_errors(dk4_uc2l_t *ulptr)
+dk4uc2l_string_dk(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dkChar *str,
+#if 1 == DK4_CHAR_SIZE
+ int ie,
+#else
+ int DK4_ARG_UNUSED(ie),
+#endif
+ dk4_er_t *erp
+)
+{
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(ie)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+
+
+#line 2973 "dk4uc2l.ctr"
+ return (dk4uc2l_string_c32(wstrm, ulptr, str, erp));
+#else
+
+
+#line 2976 "dk4uc2l.ctr"
+ return (dk4uc2l_string_c16(wstrm, ulptr, str, erp));
+#endif
+#else
+
+
+#line 2980 "dk4uc2l.ctr"
+ return (dk4uc2l_string_c8(wstrm, ulptr, str, ie, erp));
+#endif
+}
+
+
+
+int
+dk4uc2l_string_encoded(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const void *str,
+ int ie,
+ dk4_er_t *erp
+)
{
- int back = 0;
- if (NULL != ulptr) {
- back = ulptr->had_error;
- }
- return back;
+ int back = 0;
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(ie)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ switch (ie) {
+ case DK4_ENCODING_32 : {
+
+#line 3006 "dk4uc2l.ctr"
+ back = dk4uc2l_string_c32(wstrm, ulptr, str, erp);
+ } break;
+ case DK4_ENCODING_UTF16 : {
+
+#line 3009 "dk4uc2l.ctr"
+ back = dk4uc2l_string_c16(wstrm, ulptr, str, erp);
+ } break;
+ default : {
+
+#line 3012 "dk4uc2l.ctr"
+ back = dk4uc2l_string_c8(wstrm, ulptr, str, ie, erp);
+ } break;
+ }
+ return back;
}
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4uc2l.ctr b/support/dktools/dk4uc2l.ctr
index eff48fb915..0ea8697fee 100644
--- a/support/dktools/dk4uc2l.ctr
+++ b/support/dktools/dk4uc2l.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -17,93 +17,141 @@ LaTeX sequences.
After finishing output you can write recommendations (i.e. LaTeX packages
to include, font encoding to use) as comments to the file.
+
+The functions in this module use a dk4_er_t structure to report errors
+to the calling function as good as possible.
+The functions from the dk4uc2la module use a dk4_app_t structure to
+report errors immediately.
+
+Functions from the dk4uc2la and dk4uc2l module can be used combined.
+A typical scenario is to use the dk4uc2l_open_app_ex1() function with la
+set to 1 to open a conversion structure. This will read all the data files
+and store all contained LaTeX encodings in memory when opening the structure.
+Errors - i.e. failed memory allocations or syntax error in data files - are
+reported immediately.
+Later the dk4uc2l_find() function can be used. As problematic errors like
+failed memory allocations are already reported, a NULL return value can
+only indicate a missing encoding.
*/
-#ifndef DK4ERROR_H_INCLUDED
-#include "dk4app.h"
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
/** Information about a package.
*/
typedef struct {
- char *pn; /**< Package name. */
- unsigned char used; /**< Flag: Package used. */
+ char *pn; /**< Package name. */
+ unsigned char used; /**< Flag: Package used. */
} dk4_uc2l_pkg_t;
+/** Pointer to a package or an array of packages.
+*/
+typedef dk4_uc2l_pkg_t *dk4_uc2l_pkg_p;
+
+/** Pointer to an array of package pointers.
+*/
+typedef dk4_uc2l_pkg_p *dk4_uc2l_pkg_pp;
+
/** Data for contents of one file.
The structure contains information about the character
ranges covered by the file.
*/
typedef struct {
- dkChar *fn; /**< Short file name. */
- unsigned char loaded; /**< Flag: File loaded. */
+ dkChar *fn; /**< Short file name. */
+ unsigned char loaded; /**< Flag: File loaded. */
} dk4_uc2l_file_t;
/** Range of characters.
*/
typedef struct {
- dk4_uc2l_file_t *file; /**< File containing data. */
- char **both; /**< LaTeX text both modes. */
- char **text; /**< LaTeX text text mode. */
- char **math; /**< LaTeX text math mode. */
- dk4_uc2l_pkg_t ***pkgs; /**< Packages for characters. */
- unsigned char *fenc; /**< Required font encodings. */
- dk4_c32_t start; /**< First character of range. */
- dk4_c32_t end; /**< Final character of range. */
- unsigned char ia; /**< Flag: Initialisation att. */
+ dk4_uc2l_file_t *file; /**< File containing data. */
+ char **both; /**< LaTeX text both modes. */
+ char **text; /**< LaTeX text text mode. */
+ char **math; /**< LaTeX text math mode. */
+ dk4_uc2l_pkg_t ***pkgs; /**< Packages for characters. */
+ unsigned char *fenc; /**< Required font encodings. */
+ dk4_um_t *lno; /**< Line numbers. */
+ dk4_c32_t start; /**< First character of range. */
+ dk4_c32_t end; /**< Final character of range. */
+ unsigned char ia; /**< Flag: Initialisation att. */
} dk4_uc2l_range_t;
/** Text to LaTeX conversion structure.
*/
typedef struct {
- char buf[16]; /**< Buffer for direct output. */
- const dkChar * const *msgs; /**< Localized messages */
- dkChar *dname; /**< Directory name. */
- dk4_sto_t *s_ranges; /**< Ranges container. */
- dk4_sto_it_t *i_ranges; /**< Ranges container iterator. */
- dk4_sto_t *s_files; /**< Files container. */
- dk4_sto_it_t *i_files; /**< Files container iterator. */
- dk4_sto_t *s_pkgs; /**< Package information container. */
- dk4_sto_it_t *i_pkgs; /**< Package information iterator. */
- size_t szmsgs; /**< Number of messages in msgs. */
- int had_error; /**< Flag: Errors occured. */
- unsigned char utf8allowed; /**< Flag: UTF-8 output allowed. */
- unsigned char fallowed; /**< Allowed font encodings. */
+ char buf[16]; /**< Buffer for direct output. */
+ dkChar *dname; /**< Directory name. */
+ dk4_sto_t *s_ranges; /**< Ranges container. */
+ dk4_sto_it_t *i_ranges; /**< Ranges container iterator. */
+ dk4_sto_t *s_files; /**< Files container. */
+ dk4_sto_it_t *i_files; /**< Files container iterator. */
+ dk4_sto_t *s_pkgs; /**< Package information container. */
+ dk4_sto_it_t *i_pkgs; /**< Package information iterator. */
+ int had_error; /**< Flag: Errors occured. */
+ unsigned char utf8allowed; /**< Flag: UTF-8 output allowed. */
+ unsigned char fallowed; /**< Allowed font encodings. */
} dk4_uc2l_t;
/** Font encodings
*/
enum {
- /** OT1 font encoding.
- */
- DK4_UC2L_FONT_ENCODING_OT1 = 1 ,
-
- /** T1 font encoding.
- */
- DK4_UC2L_FONT_ENCODING_T1 = 2 ,
-
- /** T4 font encoding.
- */
- DK4_UC2L_FONT_ENCODING_T4 = 4 ,
-
- /** T5 font encoding.
- */
- DK4_UC2L_FONT_ENCODING_T5 = 8 ,
-
- DK4_UC2L_FONT_ENCODING_ALL = (
- 0
- | DK4_UC2L_FONT_ENCODING_OT1
- | DK4_UC2L_FONT_ENCODING_T1
- | DK4_UC2L_FONT_ENCODING_T4
- | DK4_UC2L_FONT_ENCODING_T5
- )
+ /** OT1 font encoding.
+ */
+ DK4_UC2L_FONT_ENCODING_OT1 = 1 ,
+
+ /** T1 font encoding.
+ */
+ DK4_UC2L_FONT_ENCODING_T1 = 2 ,
+
+ /** T4 font encoding.
+ */
+ DK4_UC2L_FONT_ENCODING_T4 = 4 ,
+
+ /** T5 font encoding.
+ */
+ DK4_UC2L_FONT_ENCODING_T5 = 8 ,
+
+ /** All encodings mentioned above.
+ */
+ DK4_UC2L_FONT_ENCODING_ALL = (
+ 0
+ | DK4_UC2L_FONT_ENCODING_OT1
+ | DK4_UC2L_FONT_ENCODING_T1
+ | DK4_UC2L_FONT_ENCODING_T4
+ | DK4_UC2L_FONT_ENCODING_T5
+ )
};
@@ -112,25 +160,25 @@ enum {
*/
enum {
- /** Memory allocation failed.
- */
- DK4_UC2L_ERROR_MEMORY = 1 ,
+ /** Memory allocation failed.
+ */
+ DK4_UC2L_ERROR_MEMORY = 1 ,
- /** Syntax error in configuration file.
- */
- DK4_UC2L_ERROR_SYNTAX = 2 ,
+ /** Syntax error in configuration file.
+ */
+ DK4_UC2L_ERROR_SYNTAX = 2 ,
- /** Decoding error in configuration file.
- */
- DK4_UC2L_ERROR_DECODING = 4 ,
+ /** Decoding error in configuration file.
+ */
+ DK4_UC2L_ERROR_DECODING = 4 ,
- /** Other processing errors while reading data.
- */
- DK4_UC2L_ERROR_PROCESSING = 8 ,
+ /** Other processing errors while reading data.
+ */
+ DK4_UC2L_ERROR_PROCESSING = 8 ,
- /** Failed to open one of the data files.
- */
- DK4_UC2L_ERROR_FOPEN = 16 ,
+ /** Failed to open one of the data files.
+ */
+ DK4_UC2L_ERROR_FOPEN = 16 ,
};
@@ -139,30 +187,13 @@ enum {
extern "C" {
#endif
-/** Open conversion structure, dynamically allocate memory.
- @param dn Directory name containing the data files.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to conversion structure on success, NULL on error.
-
- Use dk4uc2l_close() to close the conversion structure when done
- with it.
-*/
-dk4_uc2l_t *
-dk4uc2l_open(const dkChar *dn, dk4_app_t *app);
-
-
-/** Open conversion structure, dynamically allocate memory.
- The directory containing the data files is obtained from
- the application (if not NULL), ${datarootdir}/dktools/charmap
- is used by default.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to conversion structure on success, NULL on error.
-
- Use dk4uc2l_close() to close the conversion structure when done
- with it.
+/** Open conversion structure.
+ @param dn Directory containing the data files.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
*/
dk4_uc2l_t *
-dk4uc2l_open_from_app(dk4_app_t *app);
+dk4uc2l_open(const dkChar *dn, dk4_er_t *erp);
/** Close conversion structure, release memory.
@param ulptr Conversion structure to close.
@@ -170,6 +201,16 @@ dk4uc2l_open_from_app(dk4_app_t *app);
void
dk4uc2l_close(dk4_uc2l_t *ulptr);
+/** Find LaTeX encoding for one 32 bit character.
+ @param ulptr Conversion structure.
+ @param c Character to search encoding for.
+ @param mm Flag: Math mode (1) or text mode (0).
+ @param erp Error report, may be NULL.
+ @return Pointer to encoding string on success, NULL on error.
+*/
+const char *
+dk4uc2l_find(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_er_t *erp);
+
/** Enable or disable direct UTF-8 output.
If you use usepackage[utf-8]{inputenc} you might want to
enable UTF-8 output.
@@ -188,16 +229,6 @@ dk4uc2l_allow_utf8(dk4_uc2l_t *ulptr, int enabled);
void
dk4uc2l_clean_packages_and_fonts(dk4_uc2l_t *ulptr);
-/** Find LaTeX encoding for one 32 bit character.
- @param ulptr Conversion structure.
- @param c Character to search encoding for.
- @param mm Flag: Math mode (1) or text mode (0).
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to encoding string on success, NULL on error.
-*/
-const char *
-dk4uc2l_find(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app);
-
/** Retrieve or-combination of all allowed font encodings.
You should use this function after processing all characters.
*/
@@ -214,10 +245,11 @@ dk4uc2lat_direct(dk4_c32_t c32);
/** Issue recommendations about font encodings and packages.
Use this function after processing all characters.
@param ulptr Conversion structure.
- @param fipo File to write to.
+ @param wstrm Destination stream to write to.
+ @param erp Error report, may be NULL.
*/
void
-dk4uc2l_recommendations(dk4_uc2l_t *ulptr, FILE *fipo);
+dk4uc2l_recommendations(dk4_uc2l_t *ulptr, dk4_stream_t *wstrm, dk4_er_t *erp);
/** Retrieve internal error status from conversion structure.
@param ulptr Conversion structure.
@@ -228,6 +260,146 @@ dk4uc2l_recommendations(dk4_uc2l_t *ulptr, FILE *fipo);
int
dk4uc2l_retrieve_errors(dk4_uc2l_t *ulptr);
+/** Retrieve internal error status from conversion structure.
+ @param ulptr Conversion structure.
+ @return Error status, 0 or combination of DK4_UC2L_ERROR_MEMORY,
+ DK4_UC2L_ERROR_SYNTAX, DK4_UC2L_ERROR_DECODING,
+ DK4_UC2L_ERROR_PROCESSING, and DK4_UC2L_ERROR_FOPEN.
+*/
+void
+dk4uc2l_reset_errors(dk4_uc2l_t *ulptr);
+
+/** Write dkChar string LaTeX encoded to stream.
+ The method is primarily selected by DK4_CHAR_SIZE.
+ Use this function if you want to output a dkChar string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String.
+ @param ie Input encoding, only used if dkChar is char.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_dk(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dkChar *str,
+ int ie,
+ dk4_er_t *erp
+);
+
+/** Write encoded string LaTeX encoded to stream.
+ The method is selected by the ie parameter.
+ Use this function if your string is not necessarily a dkChar string
+ but you know the encoding.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String.
+ @param ie Input encoding, only used if dkChar is char.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_encoded(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const void *str,
+ int ie,
+ dk4_er_t *erp
+);
+
+/** Write dk4_c32_t string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c32(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c32_t *str,
+ dk4_er_t *erp
+);
+
+/** Write UTF-16 encoded dk_c32_t string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c16(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c16_t *str,
+ dk4_er_t *erp
+);
+
+/** Write UTF-8 encoded char string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_utf8(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+);
+
+/** Write ANSI encoded char string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_ansi(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+);
+
+/** Write ASCII encoded char string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_ascii(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+);
+
+/** Write char string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param ie Input encoding.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c8(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ int ie,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
@@ -250,11 +422,17 @@ dk4uc2l_retrieve_errors(dk4_uc2l_t *ulptr);
#include "dk4const.h"
#include "dk4uc2l.h"
+#include "dk4inst.h"
#include "dk4mem.h"
#include "dk4mema.h"
#include "dk4str8.h"
#include "dk4strd.h"
+#include "dk4utf16.h"
+#include "dk4utf8.h"
+#include "dk4ansi.h"
#include "dk4maasz.h"
+#include "dk4maaul.h"
+#include "dk4maadu.h"
#include "dk4filed.h"
#include "dk4mpl.h"
#include "dk4strm.h"
@@ -264,146 +442,122 @@ dk4uc2l_retrieve_errors(dk4_uc2l_t *ulptr);
#include "dk4pathd.h"
#include "dk4tsp08.h"
#include "dk4enc.h"
-#include "dk4mai8hdu.h"
+#include "dk4mai8hul.h"
#include "dk4maodh.h"
#include "dk4maodd.h"
+#include "dk4unused.h"
+#include "dk4rec26.h"
+#include "dk4strmo08.h"
+#ifndef UC2L_H_INCLUDED
+#include "uc2l.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
-typedef char *dk4_uc2l_char_ptr;
-
-typedef dk4_uc2l_pkg_t *dk4_uc2l_pkg_ptr;
+#define UL(x) ((unsigned long)(x))
-typedef dk4_uc2l_pkg_ptr *dk4_uc2l_pkg_ptr_ptr;
-/** Data passed to the line handler.
+/** Object to use and modify from line handler.
*/
typedef struct {
- dk4_uc2l_t *ulptr; /**< Conversion structure. */
- dk4_app_t *app; /**< Application for diagnostics, may be NULL. */
- const dkChar *sfn; /**< Short file name (pass 1). */
- dk4_sto_t *s_r; /**< Storage for file ranges. */
- dk4_sto_it_t *i_r; /**< Iterator for file ranges. */
- int e_d; /**< Decoding errors. */
- int e_e; /**< Encoding errors. */
- int e_p; /**< Processing errors. */
-} dk4_uc2l_lhobj;
+ dk4_uc2l_t *ulptr; /**< Conversion structure. */
+ dk4_sto_t *s_ra; /**< Local range storage. */
+ dk4_sto_it_t *i_ra; /**< Local range iterator. */
+ dk4_uc2l_file_t *file; /**< File structure. */
+ dk4_uc2l_range_t *rpc; /**< Range pointer cache, pass 2. */
+} handler_object_t;
-/** Fixed keywords used by the module, not localized.
+/** File name suffixes to process.
*/
-static const dkChar * const dk4uc2l_kwnl[] = {
+static const dkChar * const dk4uc2l_suffixes[] = {
$!string-table macro=dkT
-#
-# 0 Preference: Directory containing map data.
-#
-dir.charmap
-#
-# 1 2 3 Subdirectories to search for.
-#
-/dktools/charmap
-/dk4app/charmap
-/dk3app/charmap
-#
-# 4 5 6 File name suffixes
-#
.t2l
.t2l.gz
.t2l.bz2
-#
-# 7 Path separator
-#
-/
-#
-# 8 String table file name.
-#
-dk4uc2l.str
$!end
};
-/** Localized texts.
+/** Keywords allowed in a data line.
*/
-static const dkChar * const dk4uc2l_kw_def[] = {
-$!string-table macro=dkT
-#
-# 0 Error: Syntax
-#
-Syntax error!\n\tHexadecimal number required at start of line!
-#
-# 1 Error: Syntax
-#
-Syntax error!\n\tHexadecimal value outside allowed 32 bit range!
-#
-# 2 3 4 Error: Syntax error! Redefintion of character!
-#
-Syntax error!\n\tRedefinition of
-!
-Syntax error! Redefintion of character!
-#
-# 5 Error: Failed to set up text processing!
-#
-Failed to set up text processing!
-#
-# 6 7 Error: Failed to open file for reading: ...
+static const char * const dk4uc2l_keywords[] = {
+$!string-table
#
-Failed to open file for reading:\n\t"
-"!
+# 0
#
-# 8 Error: Syntax error!\n\tIllegal font encoding name!
+b$oth
#
-Syntax error!\n\tIllegal font encoding name!
+# 1
#
-# 9 Error: Syntax error!\n\t1 to 15 packages names are allowed!
+t$ext
#
-Syntax error!\n\t1 to 15 packages names are allowed!
+# 2
#
-# 10 Error: Syntax error!\n\tIllegal attribute name!
+m$ath
#
-Syntax error!\n\tIllegal attribute name!
+# 3
#
-# 11 Error: Syntax error!\n\tAttribute specified without value!
+e$ncoding
#
-Syntax error!\n\tAttribute specified without value!
+# 4
#
-# 12 13 14 Error: Conversion to UTF-8 failed for a character!
+p$ackages
+$!end
+};
+
+
+
+/** Font encoding names.
+*/
+static const char * const dk4uc2l_font_encodings[] = {
+$!string-table
+ot1
+t1
+t4
+t5
+$!end
+};
+
+
+
+/** Subdirectory names.
+*/
+static const dkChar * const dk4uc2l_kwnl[] = {
+$!string-table macro=dkT
#
-Conversion to UTF-8 failed for 0x
-!
-Conversion to UTF-8 failed for a character!
+# 0 1 2 Subdirectories to search
#
-# 15 Error: No directory for character mapping information found!
+/dktools/charmap
+/dk4app/charmap
+/dk3app/charmap
#
-No directory for character mapping information found!
+# 3 File name separator
#
-# 16 ... 21 Error messages.
+/
#
-Decoding failed!\n\tByte:
-Encoding failed!\n\tByte:
-Processing failed!\n\tByte:
-,\n\tCharacter:
-,\n\tPosition in line:
-.
#
-# 22 ... 27 Error messages.
#
-Decoding failed!
-Encoding failed!
-Processing failed!
-Further decoding failures!
-Further encoding failures!
-Further processing failures!
$!end
};
+/** Constant text strings for recommendations.
+*/
static const char * const dk4uc2l_kw8[] = {
$!string-table
#
@@ -428,340 +582,543 @@ $!end
};
-/** Attribute names.
+
+/** Opening and closing tag for math mode.
*/
-static const char * const dk4uc2l_attribute_names[] = {
-$!string-table
-b$oth
-t$ext
-m$ath
-e$ncoding
-p$ackages
-$!end
+static const char * const dk4uc2l_mm[] = {
+"\\(", "\\)"
};
-
-static const char * const dk4uc2l_font_encodings[] = {
-$!string-table
-ot1
-t1
-t4
-t5
-$!end
-};
+/** Number of elements in dk4uc2l_suffixes array.
+*/
+static const size_t sz_suffixes =
+DK4_SIZEOF(dk4uc2l_suffixes,DK4_PDKCHAR) - 1;
-/** Destroy LaTeX package structure, release memory.
- @param pptr Package to destroy.
+/** Compare two LaTeX package structures.
+ @param l Left pointer, always a package structure.
+ @param r Right pointer.
+ @param cr Comparison criteria: 0 if r is a package pointer,
+ 1 if r is just a package name string.
+ @return Comparison result: 1 if l>r, 0 if l==r, -1 if l<r.
*/
static
-void
-dk4uc2l_pkg_close(dk4_uc2l_pkg_t *pptr)
+int
+dk4uc2l_pkg_compare(const void *l, const void *r, int cr)
{
- $? "+ dk4uc2l_pkg_close PTR=%d", TR_IPTR(pptr)
- if (NULL != pptr) {
- pptr->used = 0x00;
- dk4mem_release(pptr->pn);
- dk4mem_free(pptr);
- }
- $? "- dk4uc2l_pkg_close"
+
+ const dk4_uc2l_pkg_t *pl;
+ const dk4_uc2l_pkg_t *pr;
+ int back = 0;
+
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_uc2l_pkg_t *)l;
+ switch (cr) {
+ case 1: {
+ back = strcmp(pl->pn, (const char *)r);
+ } break;
+ default: {
+ pr = (const dk4_uc2l_pkg_t *)r;
+ back = strcmp(pl->pn, pr->pn);
+ } break;
+ }
+ if (-1 > back) back = -1;
+ if ( 1 < back) back = 1;
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) { back = -1; }
+ }
+ return back;
}
-/** Create LaTeX package structure, allocate memory.
- @param pn Package name.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to new structure on success, NULL on error.
+/** Compare two file information structures.
+ @param l Left pointer, always a file information structure.
+ @param r Right pointer.
+ @param cr Comparison criteria:
+ 0 if the right pointer is a file information structure
+ pointer,
+ 1 if the right pointer is a file name string.
+ @return Comparison result: 0 if file names are equal, -1 if l<r,
+ 1 if l>r.
*/
static
-dk4_uc2l_pkg_t *
-dk4uc2l_pkg_open(const char *pn, dk4_app_t *app)
+int
+dk4uc2l_file_compare(const void *l, const void *r, int cr)
{
- dk4_uc2l_pkg_t *back = NULL;
- $? "+ dk4uc2l_pkg_open"
- if (NULL != pn) {
- back = dk4mem_new_app(dk4_uc2l_pkg_t,1,app);
- if (NULL != back) {
- back->used = 0x00;
- back->pn = dk4str8_dup(pn, NULL);
- if (NULL == back->pn) {
- dk4uc2l_pkg_close(back);
- back = NULL;
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- }
- }
- } $? "- dk4uc2l_pkg_open PTR=%d", TR_IPTR(back)
- return back;
+ const dk4_uc2l_file_t *pl;
+ const dk4_uc2l_file_t *pr;
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_uc2l_file_t *)l;
+ switch (cr) {
+ case 1: {
+ back = dk4str_pathcmp(pl->fn, (const dkChar *)r);
+ } break;
+ default: {
+ pr = (const dk4_uc2l_file_t *)r;
+ back = dk4str_pathcmp(pl->fn, pr->fn);
+ } break;
+ }
+ if (-1 > back) { back = -1; }
+ if ( 1 < back) { back = 1; }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
}
-/** Compare two LaTeX package structures.
- @param l Left pointer, always a package structure.
+/** Compare two range informations or a range information against a
+ character.
+ @param l Left pointer, always a range information structure.
@param r Right pointer.
- @param cr Comparison criteria: 0 if r is a package pointer,
- 1 if r is just a package name string.
- @return Comparison result: 1 if l>r, 0 if l==r, -1 if l<r.
+ @param cr Comparison criteria:
+ 0 if the right pointer is a range information strucutre,
+ 1 if the right pointer is a pointer to a dk4_c32_t.
+ @return Comparison result: -1 if l<r, 0 if l=r, 1 if l>r.
*/
-static
int
-dk4uc2l_pkg_compare(const void *l, const void *r, int cr)
+dk4uc2l_i_range_compare(const void *l, const void *r, int cr)
{
+ const dk4_uc2l_range_t *pl;
+ const dk4_uc2l_range_t *pr;
+ const dk4_c32_t *pc;
+ int back = 0;
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const dk4_uc2l_range_t *)l;
+ switch (cr) {
+ case 1: {
+ pc = (const dk4_c32_t *)r;
+ if (pl->start > *pc) {
+ back = 1;
+ }
+ else {
+ if (pl->end < *pc) {
+ back = -1;
+ }
+ }
+ } break;
+ default: {
+ pr = (const dk4_uc2l_range_t *)r;
+ if (pl->start < pr->start) {
+ back = -1;
+ }
+ else {
+ if (pl->start > pr->start) {
+ back = 1;
+ }
+ }
+ } break;
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ return back;
+}
- const dk4_uc2l_pkg_t *pl;
- const dk4_uc2l_pkg_t *pr;
- int back = 0;
-
- if (NULL != l) {
- if (NULL != r) {
- pl = (const dk4_uc2l_pkg_t *)l;
- switch (cr) {
- case 1: {
- back = strcmp(pl->pn, (const char *)r);
- } break;
- default: {
- pr = (const dk4_uc2l_pkg_t *)r;
- back = strcmp(pl->pn, pr->pn);
- } break;
- }
- if (-1 > back) back = -1;
- if ( 1 < back) back = 1;
- } else { back = 1; }
- } else {
- if (NULL != r) { back = -1; }
- }
- return back;
+
+
+int
+dk4uc2l_i_suffix_index_supported(int i)
+{
+ int back = 1;
+ switch (i) {
+ case 1: {
+#if !DK4_HAVE_ZLIB_H
+ back = 0;
+#endif
+ } break;
+ case 2: {
+#if !DK4_HAVE_BZLIB_H
+ back = 0;
+#endif
+ } break;
+ }
+ return back;
+}
+
+
+
+int
+dk4uc2l_i_find_suffix_index(const dkChar *fn)
+{
+ size_t sz = 0;
+ size_t i = 0;
+ size_t susz = 0;
+ int back = -1;
+
+ if (NULL != fn) {
+ sz = dk4str_len(fn);
+ for (i = 0; ((i < sz_suffixes) && (0 > back)); i++) {
+ susz = dk4str_len(dk4uc2l_suffixes[i]);
+ if (sz > susz) {
+ if (0 == dk4str_pathcmp(&(fn[sz - susz]), dk4uc2l_suffixes[i])) {
+ back = (int)i; i = sz_suffixes;
+ }
+ }
+ }
+ }
+ return back;
}
-/** Destroy file information structure, release memory.
- @param fptr File information structure to destroy.
-*/
-static
void
-dk4uc2l_file_close(dk4_uc2l_file_t *fptr)
+dk4uc2l_i_close_file(dk4_uc2l_file_t *fptr)
{
- $? "+ dk4uc2l_file_close"
- if (NULL != fptr) {
- fptr->loaded = 0x00;
- dk4mem_release(fptr->fn);
- dk4mem_free(fptr);
- } $? "- dk4uc2l_file_close"
+ $? "+ dk4uc2l_i_close_file %d", TR_IPTR(fptr)
+ if (NULL != fptr) {
+ $? ". \"%!ds\"", TR_STR(fptr->fn)
+ dk4mem_release(fptr->fn);
+ fptr->loaded = 0x00;
+ dk4mem_free(fptr);
+ }
+ $? "- dk4uc2l_i_close_file"
}
-/** Create file information structure, allocate memory.
- @param fn File name to create structure for.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to new structure on success, NULL on error.
-*/
-static
dk4_uc2l_file_t *
-dk4uc2l_file_open(const dkChar *fn, dk4_app_t *app)
+dk4uc2l_i_open_file(const dkChar *fn, dk4_er_t *erp)
{
- dk4_uc2l_file_t *back = NULL;
- $? "+ dk4uc2l_file_open"
- if (NULL != fn) {
- back = dk4mem_new_app(dk4_uc2l_file_t,1,app);
- if (NULL != back) {
- back->loaded = 0x00;
- back->fn = dk4str_dup(fn, NULL);
- if (NULL == back->fn) {
- dk4uc2l_file_close(back);
- back = NULL;
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- }
- }
- } $? "- dk4uc2l_file_open PTR=%d", TR_IPTR(back)
- return back;
+ dk4_uc2l_file_t *back = NULL;
+ $? "+ dk4uc2l_i_open_file \"%!ds\"", TR_STR(fn)
+ if (NULL != fn) {
+ back = dk4mem_new(dk4_uc2l_file_t,1,erp);
+ if (NULL != back) {
+ back->loaded = 0x00;
+ back->fn = dk4str_dup(fn, erp);
+ if (NULL == back->fn) { $? "! allocation fn"
+ dk4mem_free(back);
+ back = NULL;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! allocation back"
+ }
+#endif
+ }
+ else { $? "! pn"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4uc2l_i_open_file %d", TR_IPTR(back)
+ return back;
}
-/** Compare two file information structures.
- @param l Left pointer, always a file information structure.
- @param r Right pointer.
- @param cr Comparison criteria:
- 0 if the right pointer is a file information structure
- pointer,
- 1 if the right pointer is a file name string.
- @return Comparison result: 0 if file names are equal, -1 if l<r,
- 1 if l>r.
-*/
-static
-int
-dk4uc2l_file_compare(const void *l, const void *r, int cr)
+void
+dk4uc2l_i_close_pkg(dk4_uc2l_pkg_t *pptr)
{
- const dk4_uc2l_file_t *pl;
- const dk4_uc2l_file_t *pr;
- int back = 0;
- if (NULL != l) {
- if (NULL != r) {
- pl = (const dk4_uc2l_file_t *)l;
- switch (cr) {
- case 1: {
- back = dk4str_pathcmp(pl->fn, (const dkChar *)r);
- } break;
- default: {
- pr = (const dk4_uc2l_file_t *)r;
- back = dk4str_pathcmp(pl->fn, pr->fn);
- } break;
- }
- if (-1 > back) { back = -1; }
- if ( 1 < back) { back = 1; }
- } else { back = 1; }
- } else {
- if (NULL != r) { back = -1; }
- }
- return back;
+ $? "+ dk4uc2l_i_close_pkg %d", TR_IPTR(pptr)
+ if (NULL != pptr) {
+ $? ". \"%!8s\"", TR_8STR(pptr->pn)
+ dk4mem_release(pptr->pn);
+ pptr->used = 0x00;
+ dk4mem_free(pptr);
+ }
+ $? "- dk4uc2l_i_close_pkg"
}
-/** Destroy range structure, release memory.
- @param rptr Range structure to destroy.
-*/
-static
-void
-dk4uc2l_range_close(dk4_uc2l_range_t *rptr)
+dk4_uc2l_pkg_t *
+dk4uc2l_i_open_pkg(const char *pn, dk4_er_t *erp)
{
- dk4_er_t er;
- size_t nelem;
- size_t i;
- $? "+ dk4uc2l_range_close %lu %lu (0x%lx 0x%lx)", (unsigned long)(rptr->start), (unsigned long)(rptr->end), (unsigned long)(rptr->start), (unsigned long)(rptr->end)
+ dk4_uc2l_pkg_t *back = NULL;
+ $? "+ dk4_uc2l_pkg_t \"%!8s\"", TR_8STR(pn)
+ if (NULL != pn) {
+ back = dk4mem_new(dk4_uc2l_pkg_t,1,erp);
+ if (NULL != back) {
+ back->used = 0x00;
+ back->pn = dk4str8_dup(pn, erp);
+ if (NULL == back->pn) {
+ dk4mem_free(back);
+ back = NULL;
+ }
#if TRACE_DEBUG
- if (NULL != rptr->file) {
- if (NULL != (rptr->file)->fn) {
- $? ". file name \"%!ds\"", (rptr->file)->fn
- }
- }
+ else { $? "! allocation pn"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! allocation back"
+ }
#endif
- if (NULL != rptr) {
- /*
- Overflow check when calculating number of elements in range
- as end-start+1
- */
- dk4error_init(&er);
- nelem = dk4ma_size_t_add(
- dk4ma_size_t_sub((size_t)(rptr->end), (size_t)(rptr->start), &er),
- (size_t)1U,
- &er
- );
- if (DK4_E_NONE == er.ec) {
- /*
- Release dynamic memory.
- */
- if (NULL != rptr->both) {
- for (i = 0; i < nelem; i++) { dk4mem_release((rptr->both)[i]); }
- dk4mem_release(rptr->both);
- }
- if (NULL != rptr->text) {
- for (i = 0; i < nelem; i++) { dk4mem_release((rptr->text)[i]); }
- dk4mem_release(rptr->text);
- }
- if (NULL != rptr->math) {
- for (i = 0; i < nelem; i++) { dk4mem_release((rptr->math)[i]); }
- dk4mem_release(rptr->math);
- }
- if (NULL != rptr->pkgs) {
- for (i = 0; i < nelem; i++) { dk4mem_release((rptr->pkgs)[i]); }
- dk4mem_release(rptr->pkgs);
- }
- if (NULL != rptr->fenc) {
- dk4mem_release(rptr->fenc);
- }
- }
- rptr->file = NULL;
- rptr->start = rptr->end = (dk4_c32_t)0UL;
- rptr->ia = 0x00;
- dk4mem_free(rptr);
- } $? "- dk4uc2l_range_close"
+ }
+ else { $? "! pn"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4_uc2l_pkg_t %d", TR_IPTR(back)
+ return back;
}
-/** Create range structure, partially allocate memory.
- @param c Character, initially start and end of range.
- @param fptr Pointer to exisiting file information structure.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to new structure on success, NULL on error.
-*/
-static
-dk4_uc2l_range_t *
-dk4uc2l_range_open(dk4_c32_t c, dk4_uc2l_file_t *fptr, dk4_app_t *app)
+
+void
+dk4uc2l_i_close_range(dk4_uc2l_range_t *rptr)
{
- dk4_uc2l_range_t *back = NULL;
- $? "+ dk4uc2l_range_open"
- if (NULL != fptr) {
- back = dk4mem_new_app(dk4_uc2l_range_t,1,app);
- if (NULL != back) {
- back->file = fptr;
- back->both = NULL;
- back->text = NULL;
- back->math = NULL;
- back->pkgs = NULL;
- back->fenc = NULL;
- back->start = back->end = c;
- back->ia = 0x00;
- }
- } $? "- dk4uc2l_range_open PTR=%d", TR_IPTR(back)
- return back;
+ dk4_er_t er; /* Error report to detect numeric overflow */
+ unsigned long n; /* Number of elements in range */
+ size_t nn; /* Size_t version of n */
+ size_t i; /* Traverse all elements */
+ $? "+ dk4uc2l_i_close_range %d", TR_IPTR(rptr)
+ if (NULL != rptr) {
+ $? ". range %lu %lu",(unsigned long)(rptr->start),(unsigned long)(rptr->end)
+#if TRACE_DEBUG
+ if (NULL != rptr->file) {
+ if (NULL != rptr->file->fn) {
+ $? ". \"%!ds\"", rptr->file->fn
+ }
+ }
+#endif
+ dk4error_init(&er);
+ n = dk4ma_ulong_sub(rptr->end, rptr->start, &er);
+ n = dk4ma_ulong_add(n, 1UL, &er);
+#if 0
+ if ((DK4_E_NONE == er.ec) && ((dk4_um_t)n <= (dk4_um_t)(SIZE_MAX)))
+#endif
+ if ((DK4_E_NONE == er.ec) && (dk4ma_um_isgeq(SIZE_MAX, n))) {
+ nn = (size_t)n;
+ if (NULL != rptr->both) {
+ for (i = 0; i < nn; i++) {
+ dk4mem_release((rptr->both)[i]);
+ }
+ dk4mem_free(rptr->both); rptr->both = NULL;
+ }
+ if (NULL != rptr->text) {
+ for (i = 0; i < nn; i++) {
+ dk4mem_release((rptr->text)[i]);
+ }
+ dk4mem_free(rptr->text); rptr->text = NULL;
+ }
+ if (NULL != rptr->math) {
+ for (i = 0; i < nn; i++) {
+ dk4mem_release((rptr->math)[i]);
+ }
+ dk4mem_free(rptr->math); rptr->math = NULL;
+ }
+ if (NULL != rptr->pkgs) {
+ for (i = 0; i < nn; i++) {
+ dk4mem_release((rptr->pkgs)[i]);
+ }
+ dk4mem_free(rptr->pkgs); rptr->pkgs = NULL;
+ }
+ if (NULL != rptr->fenc) {
+ dk4mem_free(rptr->fenc); rptr->fenc = NULL;
+ }
+ if (NULL != rptr->lno) {
+ dk4mem_free(rptr->lno); rptr->lno = NULL;
+ }
+ }
+ rptr->file = NULL;
+ rptr->start = (dk4_c32_t)0UL;
+ rptr->end = (dk4_c32_t)0UL;
+ rptr->ia = 0x00;
+ dk4mem_free(rptr);
+ }
+ $? "- dk4uc2l_i_close_range"
}
-/** Compare two range informations or a range information against a
- character.
- @param l Left pointer, always a range information strucutre.
- @param r Right pointer.
- @param cr Comparison criteria:
- 0 if the right pointer is a range information strucutre,
- 1 if the right pointer is a pointer to a dk4_c32_t.
- @return Comparison result: -1 if l<r, 0 if l=r, 1 if l>r.
-*/
-static
int
-dk4uc2l_range_compare(const void *l, const void *r, int cr)
+dk4uc2l_i_init_range(
+ dk4_uc2l_range_t *rptr,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+ char **ppchr;
+ dk4_uc2l_pkg_pp *pppkg;
+ unsigned char *puc;
+ dk4_um_t *pum;
+ size_t sznum = 0;
+ size_t i = 0;
+ unsigned long num = 0UL;
+ int back = 0;
+ $? "+ dk4uc2l_i_init_range 0x%lx...0x%lx", UL(rptr->start), UL(rptr->end)
+
+ /* Avoid second initialization
+ */
+ if (0x00 != rptr->ia) { $? ". already initialized"
+ back = 1;
+ goto finished;
+ }
+
+ /* Find number of elements
+ */
+ dk4error_init(&er);
+ num = dk4ma_ulong_add(
+ dk4ma_ulong_sub(
+ (unsigned long)(rptr->end), (unsigned long)(rptr->start), &er
+ ), 1UL, &er
+ );
+ if (DK4_E_NONE != er.ec) { $? "! math problem"
+ dk4error_copy(erp, &er);
+ goto finished;
+ }
+#if 0
+ if ((dk4_um_t)(SIZE_MAX) >= (dk4_um_t)num)
+#endif
+ if (0 != dk4ma_um_isgeq(SIZE_MAX, num)) {
+ sznum = (size_t)num;
+ }
+ else { $? "! overflow"
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ goto finished;
+ }
+
+ /* both
+ */
+ if (NULL == rptr->both) {
+ rptr->both = dk4mem_new(DK4_PCHAR,sznum,erp);
+ if (NULL != rptr->both) {
+ ppchr = rptr->both;
+ for (i = 0; i < sznum; i++) { *(ppchr++) = NULL; }
+ }
+ else { $? "! both"
+ goto finished;
+ }
+ }
+
+ /* text
+ */
+ if (NULL == rptr->text) {
+ rptr->text = dk4mem_new(DK4_PCHAR,sznum,erp);
+ if (NULL != rptr->text) {
+ ppchr = rptr->text;
+ for (i = 0; i < sznum; i++) { *(ppchr++) = NULL; }
+ }
+ else { $? "! text"
+ goto finished;
+ }
+ }
+
+ /* math
+ */
+ if (NULL == rptr->math) {
+ rptr->math = dk4mem_new(DK4_PCHAR,sznum,erp);
+ if (NULL != rptr->math) {
+ ppchr = rptr->math;
+ for (i = 0; i < sznum; i++) { *(ppchr++) = NULL; }
+ }
+ else { $? "! math"
+ goto finished;
+ }
+ }
+
+ /* pkgs
+ */
+ if (NULL == rptr->pkgs) {
+ rptr->pkgs = dk4mem_new(dk4_uc2l_pkg_pp,sznum,erp);
+ if (NULL != rptr->pkgs) {
+ pppkg = rptr->pkgs;
+ for (i = 0; i < sznum; i++) { *(pppkg++) = NULL; }
+ }
+ else{ $? "! pkgs"
+ goto finished;
+ }
+ }
+
+ /* fenc
+ */
+ if (NULL == rptr->fenc) {
+ rptr->fenc = dk4mem_new(unsigned char,sznum,erp);
+ if (NULL != rptr->fenc) {
+ puc = rptr->fenc;
+ for (i = 0; i < sznum; i++) { *(puc++) = 0xFF; }
+ }
+ else { $? "! fenc"
+ goto finished;
+ }
+ }
+
+ /* lno
+ */
+ if (NULL == rptr->lno) {
+ rptr->lno = dk4mem_new(dk4_um_t,sznum,erp);
+ if (NULL != rptr->lno) {
+ pum = rptr->lno;
+ for (i = 0; i < sznum; i++) { *(pum++) = (dk4_um_t)0UL; }
+ }
+ else { $? "! lno"
+ goto finished;
+ }
+ }
+
+ /* Success
+ */
+ back = 1;
+
+ /* Return
+ */
+ finished:
+ $? "- dk4uc2l_i_init_range %d", back
+ return back;
+}
+
+
+
+dk4_uc2l_range_t *
+dk4uc2l_i_open_range(
+ dk4_c32_t c32,
+ dk4_uc2l_file_t *fptr,
+ dk4_er_t *erp
+)
{
- const dk4_uc2l_range_t *pl;
- const dk4_uc2l_range_t *pr;
- const dk4_c32_t *pc;
- int back = 0;
- if (NULL != l) {
- if (NULL != r) {
- pl = (const dk4_uc2l_range_t *)l;
- switch (cr) {
- case 1: {
- pc = (const dk4_c32_t *)r;
- if (pl->start > *pc) {
- back = 1;
- } else {
- if (pl->end < *pc) {
- back = -1;
- }
- }
- } break;
- default: {
- pr = (const dk4_uc2l_range_t *)r;
- if (pl->start < pr->start) {
- back = -1;
- } else {
- if (pl->start > pr->start) {
- back = 1;
- }
- }
- } break;
- }
- } else { back = 1; }
- } else {
- if (NULL != r) { back = -1; }
- }
- return back;
+ dk4_uc2l_range_t *back = NULL;
+ $? "+ dk4uc2l_i_open_range %lu", (unsigned long)c32
+ if (NULL != fptr) {
+ back = dk4mem_new(dk4_uc2l_range_t,1,erp);
+ if (NULL != back) {
+ back->file = fptr;
+ back->both = NULL;
+ back->text = NULL;
+ back->math = NULL;
+ back->pkgs = NULL;
+ back->fenc = NULL;
+ back->lno = NULL;
+ back->start = back->end = c32;
+ back->ia = 0x00;
+ }
+#if TRACE_DEBUG
+ else { $? "! allocation back"
+ }
+#endif
+ }
+ else { $? "! fptr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4uc2l_i_open_range %d", TR_IPTR(back)
+ return back;
}
@@ -769,1589 +1126,1895 @@ dk4uc2l_range_compare(const void *l, const void *r, int cr)
void
dk4uc2l_close(dk4_uc2l_t *ulptr)
{
- dk4_uc2l_pkg_t *pptr;
- dk4_uc2l_file_t *fptr;
- dk4_uc2l_range_t *rptr;
- $? "+ dk4uc2l_close"
- if (NULL != ulptr) {
- /*
- Directory name.
- */
- dk4mem_release(ulptr->dname);
- /*
- Ranges.
- */
- if (NULL != ulptr->s_ranges) {
- if (NULL != ulptr->i_ranges) {
- dk4sto_it_reset(ulptr->i_ranges);
- do {
- rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ulptr->i_ranges);
- if (NULL != rptr) { dk4uc2l_range_close(rptr); }
- } while (NULL != rptr);
- dk4sto_it_close(ulptr->i_ranges);
- }
- dk4sto_close(ulptr->s_ranges);
- }
- /*
- File information.
- */
- if (NULL != ulptr->s_files) {
- if (NULL != ulptr->i_files) {
- dk4sto_it_reset(ulptr->i_files);
- do {
- fptr = (dk4_uc2l_file_t *)dk4sto_it_next(ulptr->i_files);
- if (NULL != fptr) { dk4uc2l_file_close(fptr); }
- } while (NULL != fptr);
- dk4sto_it_close(ulptr->i_files);
- }
- dk4sto_close(ulptr->s_files);
- }
- /*
- Package information.
- */
- if (NULL != ulptr->s_pkgs) {
- if (NULL != ulptr->i_pkgs) {
- dk4sto_it_reset(ulptr->i_pkgs);
- do {
- pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
- if (NULL != pptr) { dk4uc2l_pkg_close(pptr); }
- } while (NULL != pptr);
- dk4sto_it_close(ulptr->i_pkgs);
- }
- dk4sto_close(ulptr->s_pkgs);
- }
- ulptr->s_ranges = NULL;
- ulptr->i_ranges = NULL;
- ulptr->s_files = NULL;
- ulptr->i_files = NULL;
- ulptr->s_pkgs = NULL;
- ulptr->i_pkgs = NULL;
- ulptr->msgs = NULL;
- ulptr->szmsgs = 0;
- dk4mem_free(ulptr);
- } $? "- dk4uc2l_close"
+ dk4_uc2l_pkg_t *pptr;
+ dk4_uc2l_file_t *fptr;
+ dk4_uc2l_range_t *rptr;
+ $? "+ dk4uc2l_close %d", TR_IPTR(ulptr)
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ dk4mem_release(ulptr->dname);
+ if (NULL != ulptr->s_ranges) {
+ if (NULL != ulptr->i_ranges) {
+ dk4sto_it_reset(ulptr->i_ranges);
+ do {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ulptr->i_ranges);
+ if (NULL != rptr) {
+ dk4uc2l_i_close_range(rptr);
+ }
+ } while (NULL != rptr);
+ dk4sto_it_close(ulptr->i_ranges);
+ }
+ dk4sto_close(ulptr->s_ranges);
+ }
+ ulptr->s_ranges = NULL;
+ ulptr->i_ranges = NULL;
+ if (NULL != ulptr->s_files) {
+ if (NULL != ulptr->i_files) {
+ dk4sto_it_reset(ulptr->i_files);
+ do {
+ fptr = (dk4_uc2l_file_t *)dk4sto_it_next(ulptr->i_files);
+ if (NULL != fptr) {
+ dk4uc2l_i_close_file(fptr);
+ }
+ } while (NULL != fptr);
+ dk4sto_it_close(ulptr->i_files);
+ }
+ dk4sto_close(ulptr->s_files);
+ }
+ ulptr->s_files = NULL;
+ ulptr->i_files = NULL;
+ if (NULL != ulptr->s_pkgs) {
+ if (NULL != ulptr->i_pkgs) {
+ dk4sto_it_reset(ulptr->i_pkgs);
+ do {
+ pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
+ if (NULL != pptr) {
+ dk4uc2l_i_close_pkg(pptr);
+ }
+ } while (NULL != pptr);
+ dk4sto_it_close(ulptr->i_pkgs);
+ }
+ dk4sto_close(ulptr->s_pkgs);
+ }
+ ulptr->s_pkgs = NULL;
+ ulptr->i_pkgs = NULL;
+ dk4mem_free(ulptr);
+ }
+ $? "- dk4uc2l_close"
}
-static
dk4_uc2l_t *
-dk4uc2l_create(const dkChar *dn, dk4_app_t *app)
+dk4uc2l_i_new(const dkChar *dn, dk4_er_t *erp)
{
- dk4_uc2l_t *back = NULL;
- int ok = 0;
- $? "+ dk4uc2l_create"
- if (NULL != dn) {
- back = dk4mem_new_app(dk4_uc2l_t,1,app);
- if (NULL != back) {
- back->dname = NULL;
- back->s_ranges = NULL;
- back->i_ranges = NULL;
- back->s_files = NULL;
- back->i_files = NULL;
- back->s_pkgs = NULL;
- back->i_pkgs = NULL;
- back->fallowed = 0xFF;
- back->utf8allowed = 0x00;
- back->had_error = 0;
- back->msgs = NULL;
- back->szmsgs = 0;
- back->dname = dk4str_dup(dn, NULL);
- if (NULL != back->dname) {
- back->s_ranges = dk4sto_open(NULL);
- if (NULL != back->s_ranges) {
- dk4sto_set_comp(back->s_ranges, dk4uc2l_range_compare, 0);
- back->s_files = dk4sto_open(NULL);
- if (NULL != back->s_files) {
- dk4sto_set_comp(back->s_files, dk4uc2l_file_compare, 0);
- back->s_pkgs = dk4sto_open(NULL);
- if (NULL != back->s_pkgs) {
- dk4sto_set_comp(back->s_pkgs, dk4uc2l_pkg_compare, 0);
- back->i_ranges = dk4sto_it_open(back->s_ranges, NULL);
- if (NULL != back->i_ranges) {
- back->i_files = dk4sto_it_open(back->s_files, NULL);
- if (NULL != back->i_files) {
- back->i_pkgs = dk4sto_it_open(back->s_pkgs, NULL);
- if (NULL != back->i_pkgs) {
- if (NULL != app) {
- back->msgs = dk4app_string_table(
- app, dk4uc2l_kwnl[8], dk4uc2l_kw_def
- );
- } else {
- back->msgs = dk4uc2l_kw_def;
- }
- back->szmsgs = dk4app_string_table_size(dk4uc2l_kw_def);
- ok = 1;
- }
- }
- }
- }
- }
- }
- }
- if (0 == ok) {
- dk4uc2l_close(back);
- back = NULL;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- }
- }
- } $? "- dk4uc2l_create PTR=%d", TR_IPTR(back)
- return back;
+ dk4_uc2l_t *back = NULL;
+ int ok = 0;
+ $? "+ dk4uc2l_i_new \"%!ds\"", TR_STR(dn)
+ back = dk4mem_new(dk4_uc2l_t,1,erp);
+ if (NULL != back) { $? ". allocation ok"
+ back->buf[0] = '\0';
+ back->dname = NULL;
+ back->s_ranges = NULL;
+ back->i_ranges = NULL;
+ back->s_files = NULL;
+ back->i_files = NULL;
+ back->s_pkgs = NULL;
+ back->i_pkgs = NULL;
+ back->had_error = 0;
+ back->utf8allowed = 0;
+ back->fallowed = 0xFF;
+ back->dname = dk4str_dup(dn, erp);
+ if (NULL != back->dname) { $? ". dname"
+ back->s_ranges = dk4sto_open(erp);
+ back->s_files = dk4sto_open(erp);
+ back->s_pkgs = dk4sto_open(erp);
+ if (
+ (NULL != back->s_ranges)
+ && (NULL != back->s_files)
+ && (NULL != back->s_pkgs)
+ ) { $? ". storages ok"
+ dk4sto_set_comp(back->s_ranges, dk4uc2l_i_range_compare, 0);
+ dk4sto_set_comp(back->s_files, dk4uc2l_file_compare, 0);
+ dk4sto_set_comp(back->s_pkgs, dk4uc2l_pkg_compare, 0);
+ back->i_ranges = dk4sto_it_open(back->s_ranges, erp);
+ back->i_files = dk4sto_it_open(back->s_files, erp);
+ back->i_pkgs = dk4sto_it_open(back->s_pkgs, erp);
+ if (
+ (NULL != back->i_ranges)
+ && (NULL != back->i_files)
+ && (NULL != back->i_pkgs)
+ ) { $? ". iterators"
+ ok = 1;
+ }
+#if TRACE_DEBUG
+ else { $? "! iterators"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! storages"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! dname"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! allocation failed"
+ }
+#endif
+ if ((NULL != back) && (0 == ok)) {
+ dk4uc2l_close(back);
+ back = NULL;
+ }
+ $? "- dk4uc2l_i_new %d", TR_IPTR(back)
+ return back;
}
-/** Handler function for text lines.
- @param obj Object to modify while processing the character.
- @param line Text line to process.
+/** Handler to process a line during pass 1.
+ @param obj Object to use and modify during processing.
+ @param line Current text line to process.
@param lineno Current line number.
- @param erp Error report, may be NULL.
- @return DK4_TSP_RES_OK if the character was processed
- successfully,
- DK4_TSP_RES_ERROR if there was an error but we can
- continue,
- DK4_TSP_RES_FATAL if there was a fatal error so we
- should abort processing.
+ @param erp Error report, may be NULL.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on recoverable
+ errors, DK4_TSP_RES_FATAL on fatal errors requiring an abort.
*/
static
int
-dk4uc2l_fp_handler(
- void *obj,
- char *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+dk4uc2l_handler_pass1(
+ void *obj,
+ char *line,
+ dk4_um_t DK4_ARG_UNUSED(lineno) ,
+ dk4_er_t *erp
)
{
- dkChar numbuf[16*sizeof(dk4_um_t)];
- dk4_uc2l_range_t *rptr;
- dk4_uc2l_range_t *rptrn;
- dk4_uc2l_file_t *fptr;
- dk4_uc2l_lhobj *lhobj;
- dk4_app_t *app;
- dk4_uc2l_t *ulptr;
- char *p1;
-#if VERSION_BEFORE_20150821
- char *p2;
+ handler_object_t *pho;
+ char *p1;
+ dk4_uc2l_range_t *rptr;
+ dk4_uc2l_range_t *r2;
+ const char *pe = NULL;
+ unsigned long ul = 0UL;
+ dk4_c32_t c32;
+ dk4_c32_t rbo;
+ int res;
+ int back = DK4_TSP_RES_OK;
+
+ DK4_UNUSED_ARG(lineno)
+#if TRACE_DEBUG
+ dk4str8_delnl(line);
#endif
- const char *p3;
- dk4_um_t um;
- dk4_c32_t c32;
- dk4_c32_t c32a;
- size_t sznumbuf;
- int back = DK4_TSP_RES_OK;
- int res = 0;
- $? "+ dk4uc2l_fp_handler"
-
- /* Obtain contents from object.
- */
- lhobj = (dk4_uc2l_lhobj *)obj;
- ulptr = lhobj->ulptr;
- app = lhobj->app;
- dk4app_set_log_source_line(app, lineno);
-
- /* Check for any text. Empty lines ok, comments ok.
- */
- p1 = dk4str8_start(line, NULL);
- if (NULL == p1) { $? ". empty line"
- goto finished;
- }
- if ('#' == *p1) { $? ". comment line"
- goto finished;
- }
-
- /* Retrieve hexadecimal number.
- */
-#if VERSION_BEFORE_20150821
- p2 = dk4str8_next(p1, NULL);
-#else
- (void)dk4str8_next(p1, NULL);
+ $? "+ dk4uc2l_handler_pass1 \"%!8s\"", TR_8STR(line)
+ pho = (handler_object_t *)obj;
+
+ /* Find start of line.
+ */
+ p1 = dk4str8_start(line, NULL);
+
+ /* Ignore empty lines and comment lines
+ */
+ if (NULL == p1) {
+ goto finished;
+ }
+ if ('#' == *p1) {
+ goto finished;
+ }
+
+ /* Retrieve hexadecimal number
+ */
+ (void)dk4str8_next(p1, NULL);
+ res = dk4ma_input_c8_hex_ulong(&ul, p1, &pe, 1, erp);
+ if (0 == res) {
+ /* ERROR: Syntax, not a number */
+ goto finished;
+ }
+ c32 = (dk4_c32_t)ul;
+
+ /* Check for number in global storage
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->ulptr->i_ranges, &c32, 1
+ );
+ if (NULL != rptr) {
+ /* WARNING erp: Ignoring redefinition */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+
+ /* Check for number in storage for file
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &c32, 1);
+ if (NULL != rptr) {
+ /* WARNING erp: Ignoring redefinition */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ goto finished;
+ }
+
+ /* Check whether appending to existing range
+ */
+ if (0UL < c32) {
+ rbo = c32 - 1UL;
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &rbo, 1);
+ if (NULL != rptr) {
+ rptr->end = c32;
+#if DK4_SIZEOF_LONG <= 4
+ if ((dk4_um_t)(ULONG_MAX) > (dk4_um_t)c32) {
+#endif
+ rbo = c32 + 1UL;
+ r2 = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->i_ra, &rbo, 1
+ );
+ if (NULL != r2) {
+ dk4sto_remove(pho->s_ra, r2, NULL);
+ rptr->end = r2->end;
+ dk4uc2l_i_close_range(r2);
+ }
+#if DK4_SIZEOF_LONG <= 4
+ }
+#endif
+ goto finished;
+ }
+ }
+
+ /* Check whether prepending to existing range
+ */
+#if DK4_SIZEOF_LONG <= 4
+ if ((dk4_um_t)(ULONG_MAX) > (dk4_um_t)c32) {
#endif
- um = (dk4_um_t)0UL;
-#if VERSION_BEFORE_20150821
- p2 = NULL;
+ rbo = c32 + 1UL;
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &rbo, 1);
+ if (NULL != rptr) {
+ rptr->start = c32;
+ if ((dk4_c32_t)0UL < c32) {
+ rbo = c32 - 1UL;
+ r2 = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->i_ra, &rbo, 1
+ );
+ if (NULL != r2) {
+ dk4sto_remove(pho->s_ra, r2, NULL);
+ rptr->start = r2->start;
+ dk4uc2l_i_close_range(r2);
+ }
+ }
+ goto finished;
+ }
+#if DK4_SIZEOF_LONG <= 4
+ }
#endif
- p3 = NULL;
- res = dk4ma_input_c8_hex_dk4_um_t(&um, p1, &p3, 1, NULL);
- if (0 == res) { $? "! hex number"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Syntax, not a number */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 0);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- } $? ". %lu", (unsigned long)um
- c32 = (dk4_c32_t)um; $? ". 0x%lx", (unsigned long)um
-
- /* Check numeric range.
- */
- if ((dk4_um_t)0xFFFFFFFFUL < um) { $? "! out of range"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Syntax, out of range */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 1);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
-
- /* Check whether number is already contained in a range.
- */
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lhobj->i_r, &c32, 1);
- if (NULL != rptr) { $? "! already defined"
- $? ". start %lu end %lu char %lu", (unsigned long)(rptr->start), (unsigned long)(rptr->end), (unsigned long)c32
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Already defined */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- if (0 != dk4ma_write_hex_unsigned(numbuf,sznumbuf,(dk4_um_t)c32,8,NULL)) {
- dk4app_log_3(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf);
- } else {
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(ulptr->i_ranges, &c32, 1);
- if (NULL != rptr) { $? "! already defined"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Already defined */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- if (0 != dk4ma_write_hex_unsigned(numbuf,sznumbuf,(dk4_um_t)c32,8,NULL)) {
- dk4app_log_3(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf);
- } else {
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
-
- /* Check whether we can append to an existing range.
- */
- if (dkC32(0) < c32) {
- c32a = c32 - dkC32(1);
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lhobj->i_r, &c32a, 1);
- if (NULL != rptr) {
- rptr->end = c32; $? ". extend existing range"
- /* Also check if c32 closes a gap between two ranges.
- */
- if (dkC32(0xFFFFFFFF) > c32) {
- c32a = c32 + dkC32(1);
- rptrn = (dk4_uc2l_range_t *)dk4sto_it_find_like(lhobj->i_r, &c32a, 1);
- if (NULL != rptrn) { $? ". close gap"
- c32a = rptrn->end;
- dk4sto_remove(lhobj->s_r, rptrn, NULL);
- rptr->end = c32a;
- }
- }
- goto finished;
- }
- }
-
- /* Check whether we can prepend before an existing range.
- */
- if (dkC32(0xFFFFFFFF) > c32) {
- c32a = c32 + dkC32(1);
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lhobj->i_r, &c32a, 1);
- if (NULL != rptr) { $? ". extend existing range"
- rptr->start = c32;
- goto finished;
- }
- }
-
- /* Create a new range.
- */ $? ". create new range"
- fptr = (dk4_uc2l_file_t *)dk4sto_it_find_like(ulptr->i_files, lhobj->sfn, 1);
- if (NULL == fptr) {
- fptr = dk4uc2l_file_open(lhobj->sfn, app);
- if (NULL != fptr) {
- if (0 == dk4sto_add(ulptr->s_files, fptr, NULL)) {
- dk4uc2l_file_close(fptr); $? "! memory"
- fptr = NULL;
- }
- }
- }
- if (NULL == fptr) { $? "! memory"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- goto finished;
- }
- rptr = dk4uc2l_range_open(c32, fptr, app);
- if (NULL != rptr) {
- if (0 == dk4sto_add(lhobj->s_r, rptr, NULL)) {
- dk4uc2l_range_close(rptr); $? "! memory"
- rptr = NULL;
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- }
- } else { $? "! memory"
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- } $? ". success"
-
- finished:
- $? "- dk4uc2l_fp_handler %d", back
- return back;
+ /* Create range on its own
+ */
+ rptr = dk4uc2l_i_open_range(c32, pho->file, erp);
+ if (NULL == rptr) {
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ if (0 == dk4sto_add(pho->ulptr->s_ranges, rptr, erp)) {
+ dk4uc2l_i_close_range(rptr);
+ back = DK4_TSP_RES_FATAL;
+ }
+
+ finished:
+ $? "- dk4uc2l_handler_pass1 %d", back
+ return back;
}
-/** Report an error with position in source line.
- @param ulptr Conversion structure.
- @param i1 Index of first message part in array.
- @param i2 Index of alternative first message part.
- @param bno Byte processed.
- @param lno Current line number.
- @param cno Current character number.
- @param cil Current character number in line.
+/** Process one file in pass 1 specified by absolute path name.
+ @param ulptr Conversion structure to set up.
+ @param rstrm Stream, opened for binary reading.
+ @param puc2lf File structure.
+ @param erp Error report, may be NULL.
+ @param bptr Address of success variable to reset on errors.
*/
static
void
-dk4uc2l_report_with_pos(
- dk4_uc2l_t *ulptr,
- dk4_app_t *app,
- size_t i1,
- size_t i2,
- dk4_um_t bno,
- dk4_um_t lno,
- dk4_um_t cno,
- dk4_um_t cil
+dk4uc2l_i_process_stream_pass1(
+ dk4_uc2l_t *ulptr,
+ dk4_stream_t *rstrm,
+ dk4_uc2l_file_t *puc2lf,
+ int *bptr,
+ dk4_er_t *erp
)
{
- dkChar b1[8*(1+sizeof(dk4_um_t))];
- dkChar b2[8*(1+sizeof(dk4_um_t))];
- dkChar b3[8*(1+sizeof(dk4_um_t))];
- dk4_um_t oldlogline = (dk4_um_t)0UL;
- int allbuffersok = 0;
-
- oldlogline = dk4app_get_log_source_line(app);
- dk4app_set_log_source_line(app, lno);
- if (0 != dk4ma_write_decimal_unsigned(b3,DK4_SIZEOF(b3,dkChar),cil,0,NULL)) {
- if (0 != dk4ma_write_decimal_unsigned(b2,DK4_SIZEOF(b2,dkChar),cno,0,NULL)) {
- if (0 != dk4ma_write_decimal_unsigned(b1,DK4_SIZEOF(b1,dkChar),bno,0,NULL)) {
- allbuffersok = 1;
- }
- }
- }
- if (0 != allbuffersok) {
- dk4app_log_7(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, i1, 19, 20, 21, b1, b2, b3
- );
- } else {
- dk4app_log_1(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, i2
- );
- }
- dk4app_set_log_source_line(app, oldlogline);
-}
+ char lnbuf[256]; /* Line buffer */
+ dk4_tsp08_t tsp08; /* Text stream processor */
+ handler_object_t ho; /* Handler object */
+ dk4_uc2l_range_t *rptr; /* Current range */
+ int res; /* Operation result */
+ int cc; /* Flag: Can continue */
+ char c; /* Current character to process */
+ $? "+ dk4uc2l_i_process_stream_pass1"
+
+ /* Initialize handler object
+ */
+ ho.file = puc2lf;
+ ho.ulptr = ulptr;
+ ho.s_ra = NULL;
+ ho.i_ra = NULL;
+
+ /* Create storage and iterator
+ */
+ ho.s_ra = dk4sto_open(erp);
+ if (NULL == ho.s_ra) { $? "! failed to create storage"
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ goto finished;
+ }
+ dk4sto_set_comp(ho.s_ra, dk4uc2l_i_range_compare, 0);
+ ho.i_ra = dk4sto_it_open(ho.s_ra, erp);
+ if (NULL == ho.i_ra) { $? "! failed to create iterator"
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ goto finished;
+ }
+
+ /* Initialize text stream processor
+ */
+ res = dk4tsp08_setup_line(
+ &tsp08, (void *)(&ho), dk4uc2l_handler_pass1, lnbuf, sizeof(lnbuf),
+ DK4_ENCODING_PLAIN, DK4_ENCODING_PLAIN, erp
+ );
+ if (0 == res) { $? "! failed to set up text processor"
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+
+ /* Process file contents
+ */
+ do {
+ cc = 0;
+ res = dk4stream_c8_read_byte(&c, rstrm, NULL);
+ if (0 != res) {
+ cc = 1;
+ res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ } break;
+ case DK4_TSP_RES_FATAL : { $? "! fatal error"
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ goto finished;
+ } break;
+ }
+ }
+ } while (0 < cc);
+
+ /* Finalize text stream processor
+ */
+ res = dk4tsp08_finish(&tsp08);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : case DK4_TSP_RES_FATAL : {
+ *bptr = 0; $? "! fatal error"
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ } break;
+ }
+ /* Transfer ranges to global storage
+ */
+ do {
+ dk4sto_it_reset(ho.i_ra);
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ho.i_ra);
+ if (NULL != rptr) {
+ dk4sto_remove(ho.s_ra, rptr, erp);
+ if (0 == dk4sto_add(ulptr->s_ranges, rptr, erp)) {
+ dk4uc2l_i_close_range(rptr);
+ *bptr = 0; $? "! dk4sto_add"
+ goto finished;
+ }
+ }
+ } while (NULL != rptr);
+
+ /* Release resources
+ */
+ finished:
+ if (NULL != ho.s_ra) {
+ if (NULL != ho.i_ra) {
+ dk4sto_it_reset(ho.i_ra);
+ do {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ho.i_ra);
+ if (NULL != rptr) {
+ dk4uc2l_i_close_range(rptr);
+ }
+ } while (NULL != rptr);
+ dk4sto_it_close(ho.i_ra);
+ }
+ dk4sto_close(ho.s_ra);
+ }
+
+ $? "- dk4uc2l_i_process_stream_pass1"
+}
-static
-void
-dk4uc2l_report_errors(
- dk4_uc2l_t *ulptr,
- dk4_app_t *app,
- dk4_uc2l_lhobj *obj,
- dk4_er_t *er_en,
- dk4_er_t *er_pr
+/** Process one file in pass 1 specified by absolute path name.
+ @param ulptr Conversion structure to set up.
+ @param fn Full (absolute) file name.
+ @param sfn Short file name within given directory.
+ @param erp Error report, may be NULL.
+ @param bptr Address of success variable to reset on errors.
+*/
+static
+void
+dk4uc2l_i_process_one_full_file_pass1(
+ dk4_uc2l_t *ulptr,
+ const dkChar *fn,
+ const dkChar *sfn,
+ int *bptr,
+ dk4_er_t *erp
)
{
- if (NULL != er_en) {
- switch (er_en->ec) {
- case DK4_E_DECODING_FAILED: {
- switch (obj->e_d) {
- case 0: case 1: {
- dk4uc2l_report_with_pos(
- ulptr, app, 16, 22,
- er_en->dt.fpos.byteno,
- er_en->dt.fpos.lineno,
- er_en->dt.fpos.charno,
- er_en->dt.fpos.charinline
- );
- } break;
- case 2: {
- dk4app_log_1(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 25
- );
- } break;
- }
- if (3 > obj->e_d) { obj->e_d += 1; }
- } break;
- case DK4_E_ENCODING_FAILED: {
- switch (obj->e_e) {
- case 0: case 1: {
- dk4uc2l_report_with_pos(
- ulptr, app, 17, 23,
- er_en->dt.fpos.byteno,
- er_en->dt.fpos.lineno,
- er_en->dt.fpos.charno,
- er_en->dt.fpos.charinline
- );
- } break;
- case 2: {
- dk4app_log_1(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 26
- );
- } break;
- }
- if (3 > obj->e_e) { obj->e_e += 1; }
- } break;
- }
- }
- if (NULL != er_pr) {
- if (DK4_E_NONE != er_pr->ec) {
- switch (obj->e_p) {
- case 0: case 1: {
- dk4uc2l_report_with_pos(
- ulptr, app, 18, 24,
- er_pr->dt.fpos.byteno,
- er_pr->dt.fpos.lineno,
- er_pr->dt.fpos.charno,
- er_pr->dt.fpos.charinline
- );
- } break;
- case 2: {
- dk4app_log_1(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 27
- );
- } break;
- }
- if (3 > obj->e_p) { obj->e_p += 1; }
- }
- }
+ dk4_stream_t *rstrm;
+ dk4_uc2l_file_t *puc2lf;
+ int fnsi;
+ $? "+ dk4uc2l_i_process_one_full_file_pass1 \"%!ds\"", TR_STR(fn)
+
+ puc2lf = (dk4_uc2l_file_t *)dk4sto_it_find_like(ulptr->i_files, sfn, 1);
+ if (NULL == puc2lf) {
+ puc2lf = dk4uc2l_i_open_file(sfn, erp);
+ if (NULL != puc2lf) {
+ if (0 != dk4sto_add(ulptr->s_files, puc2lf, erp)) {
+ fnsi = dk4uc2l_i_find_suffix_index(fn);
+ if (-1 < fnsi) {
+ if (0 != dk4uc2l_i_suffix_index_supported(fnsi)) {
+ rstrm = dk4stream_open_file_reader(fn, erp);
+ if (NULL != rstrm) {
+ /* Process stream */
+ dk4uc2l_i_process_stream_pass1(
+ ulptr, rstrm, puc2lf, bptr, erp
+ );
+ dk4stream_close(rstrm, NULL);
+ }
+ else {
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ *bptr = 0;
+ }
+ }
+ else { $? "! compression type not supported"
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ *bptr = 0;
+ /* ERROR erp: Compression type not supported */
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
+ }
+ }
+ else { $? "! file type not supported"
+ /* Ignoring unsupported file */
+ }
+ }
+ else { $? "! failed to store"
+ dk4uc2l_i_close_file(puc2lf);
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! allocation failed"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! bug, file already exists"
+ }
+#endif
+ $? "- dk4uc2l_i_process_one_full_file_pass1"
}
-/** Process data from a stream.
- @param ulptr Conversion structure.
- @param rstrm Stream to read data from.
- @param sfn Short file name.
- @param app Application structure for diagnostics, may be NULL.
- @return 1 on success, 0 on error.
+/** Process one file in pass 1.
+ @param ulptr Conversion structure to set up.
+ @param pth Directory path name, may be NULL.
+ @param fn Short file name within given directory.
+ @param erp Error report, may be NULL.
+ @param bptr Address of success variable to reset on errors.
*/
static
-int
-dk4uc2l_fp_process_stream(
- dk4_uc2l_t *ulptr,
- dk4_stream_t *rstrm,
- const dkChar *sfn,
- dk4_app_t *app
+void
+dk4uc2l_i_process_one_file_pass1(
+ dk4_uc2l_t *ulptr,
+ const dkChar *pth,
+ const dkChar *fn,
+ int *bptr,
+ dk4_er_t *erp
)
{
- char buf[256]; /* Line buffer */
- dk4_tsp08_t tsp08; /* Text stream processor */
- dk4_er_t er; /* General error report */
- dk4_er_t er_en; /* Error report for decoding/encoding */
- dk4_er_t er_pr; /* Error report for processing */
- dk4_uc2l_lhobj obj; /* Processing object */
- dk4_uc2l_range_t *rptr; /* Range to append to */
- int back = 1;
- int res; /* Line processing result */
- int cc; /* Flag: Can continue */
- char c; /* Current character */
- $? "+ dk4uc2l_fp_process_stream"
- dk4error_init(&er);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- obj.ulptr = ulptr;
- obj.app = app;
- obj.sfn = sfn;
- obj.e_d = 0;
- obj.e_e = 0;
- obj.e_p = 0;
- obj.s_r = dk4sto_open(NULL);
- if (NULL != obj.s_r) {
- dk4sto_set_comp(obj.s_r, dk4uc2l_range_compare, 0);
- obj.i_r = dk4sto_it_open(obj.s_r, NULL);
- if (NULL != obj.i_r) {
- res = dk4tsp08_setup_line(
- &tsp08, (void *)(&obj), dk4uc2l_fp_handler, buf, sizeof(buf),
- DK4_ENCODING_ASCII, DK4_ENCODING_ASCII, &er
- );
- if (0 != res) {
- cc = 1;
- while (1 == cc) {
- res = dk4stream_c8_read_byte(&c, rstrm, &er);
- if (0 != res) {
- res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
- switch (res) {
- case DK4_TSP_RES_ERROR: {
- back = 0;
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- case DK4_TSP_RES_FATAL: {
- back = 0;
- cc = -1;
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- }
- } else {
- cc = 0;
- }
- }
- if (0 == cc) {
- res = dk4tsp08_finish(&tsp08);
- switch (res) {
- case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
- back = 0;
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- }
- }
- } else {
- /* ERROR: Failed to set up text processing */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 5);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- /*
- Move range descriptions from local storage to global storage.
- */
- dk4sto_it_reset(obj.i_r);
- do {
- rptr = (dk4_uc2l_range_t *)dk4sto_it_next(obj.i_r);
- if (NULL != rptr) {
- if (0 == dk4sto_add(ulptr->s_ranges, rptr, NULL)) {
- back = 0;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- dk4uc2l_range_close(rptr);
- }
- }
- } while (NULL != rptr);
- dk4sto_it_close(obj.i_r);
- } else {
- back = 0;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- dk4sto_close(obj.s_r);
- obj.s_r = NULL;
- } else {
- back = 0;
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
-
- $? "- dk4uc2l_fp_process_stream %d", back
- return back;
+ dkChar fnb[DK4_MAX_PATH];
+ size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+ $? "+ dk4uc2l_i_process_one_file_pass1 \"%!ds\" \"%!ds\"", TR_STR(pth), TR_STR(fn)
+ if (NULL != pth) {
+ if (0 != dk4str_cpy_s(fnb, szfnb, pth, erp)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, dk4uc2l_kwnl[3], erp)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, fn, erp)) {
+ dk4path_correct_sep(fnb);
+ dk4uc2l_i_process_one_full_file_pass1(
+ ulptr, fnb, fn, bptr, erp
+ );
+ }
+ else {
+ *bptr = 0;
+ }
+ }
+ else {
+ *bptr = 0;
+ }
+ }
+ else {
+ *bptr = 0;
+ }
+ }
+ else {
+ dk4uc2l_i_process_one_full_file_pass1(ulptr, fn, fn, bptr, erp);
+ }
+ $? "- dk4uc2l_i_process_one_file_pass1"
}
-/** Process one data file in the first pass.
+/** First pass to gather information which Unicode position is configured
+ in which data file.
+ This function is run while creating a new conversion structure
+ to fill the range structures so we can later find a file for a
+ Unicode position.
+ If this function fails, the conversion structure is considered
+ unusable.
+ The function fails only on memory allocation failures, not on
+ syntax errors in translation files.
@param ulptr Conversion structure.
- @param fn Full file name.
- @param sfn Short file name.
- @param app Application structure for diagnostics, may be NULL.
+ @param erp Error report, may be NULL.
@return 1 on success, 0 on error.
*/
static
int
-dk4uc2l_fp_process_file_name(
- dk4_uc2l_t *ulptr,
- const dkChar *fn,
- const dkChar *sfn,
- dk4_app_t *app
-)
+dk4uc2l_i_pass1(dk4_uc2l_t *ulptr, dk4_er_t *erp)
{
- dk4_er_t er; /* Error report */
- dk4_stream_t *rstrm; /* Stream to read file */
- const dkChar *oldsourcefile; /* Previous source file */
- dk4_um_t oldsourceline; /* Previous source line */
- size_t fnl; /* File name length */
- size_t fns; /* Suffix length */
- size_t i; /* Traverse suffix list */
- int back = 1;
- int done = 0; /* Flag: Attempted to open file */
- $? "+ dk4uc2l_fp_process_file_name \"%!ds\"", fn
- fnl = dk4str_len(fn);
- for (i = 4; ((i < 7) && (0 == done)); i++) { $? ". i = %u", (unsigned)i
- fns = dk4str_len(dk4uc2l_kwnl[i]);
- if (fnl > fns) { $? ". file name long enough"
- if (0 == dk4str_pathcmp(&(fn[fnl - fns]), dk4uc2l_kwnl[i])) {
- done = 1; $? ". suffix ok"
- dk4error_init(&er);
- rstrm = dk4stream_open_file_reader(fn, &er);
- if (NULL != rstrm) { $? ". stream ok"
- oldsourcefile = dk4app_get_log_source_file(app);
- oldsourceline = dk4app_get_log_source_line(app);
- dk4app_set_log_source_file(app, fn);
- dk4app_set_log_source_line(app, (dk4_um_t)0UL);
- back = dk4uc2l_fp_process_stream(ulptr, rstrm, sfn, app);
- dk4app_set_log_source_file(app, oldsourcefile);
- dk4app_set_log_source_line(app, oldsourceline);
- dk4stream_close(rstrm, NULL);
- } else { $? "! stream"
- back = 0;
- /* ERROR: Failed to open file */
- dk4app_log_3(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 6, 7, fn);
- ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
- }
- } else { $? "! invalid suffix"
- }
- } else { $? "! file name too short"
- }
- }
- $? "- dk4uc2l_fp_process_file_name %d", back
- return back;
+ const dkChar *fn = NULL;
+ const dkChar *pth = NULL;
+ dk4_dir_t *pdir = NULL;
+ int back = 0;
+ $? "+ dk4uc2l_i_pass1"
+ pdir = dk4dir_open(ulptr->dname, DK4_DIR_OPEN_SORTED, erp);
+ if (NULL != pdir) {
+ pth = dk4dir_get_path(pdir);
+ back = 1;
+ do {
+ fn = dk4dir_next_file(pdir);
+ if (NULL != fn) {
+ if (-1 < dk4uc2l_i_find_suffix_index(fn)) {
+ dk4uc2l_i_process_one_file_pass1(ulptr,pth,fn,&back,erp);
+ }
+ }
+ } while (NULL != fn);
+ dk4dir_close(pdir);
+ }
+ else { $? "! failed to open dir"
+ /* ERROR: Failed to open directory */
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ }
+ $? "- dk4uc2l_i_pass1 %d", back
+ return back;
}
-/** First pass to fill information to the structure,
- obtain information which character is handled by which file.
- @param ulptr New structure to fill with data.
- @param app Application structure for diagnostics.
- @return 1 on success, 0 on error.
+/** Internal function to open a new conversion structure.
+ @param dn Directory name (must be the name of an existing directory).
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
*/
static
-int
-dk4uc2l_first_pass(dk4_uc2l_t *ulptr, dk4_app_t *app)
+dk4_uc2l_t *
+dk4uc2l_i_open(const dkChar *dn, dk4_er_t *erp)
{
- dkChar fnb[DK4_MAX_PATH]; /* File name buffer */
- const dkChar *pth = NULL; /* Path for directory */
- const dkChar *fn = NULL; /* Current file to process */
- dk4_dir_t *dir = NULL; /* Traverse the directory */
- int back = 0;
- $? "+ dk4uc2l_first_pass"
- dir = dk4dir_open_app(ulptr->dname, 0, app);
- if (NULL != dir) {
- back = 1;
- do {
- fn = dk4dir_next_file(dir);
- if (NULL != fn) {
- pth = dk4dir_get_path(dir);
- if (NULL != pth) {
- if (dk4str_cpy_s(fnb,DK4_SIZEOF(fnb,dkChar),pth,NULL)) {
- if (dk4str_cat_s(fnb,DK4_SIZEOF(fnb,dkChar),dk4uc2l_kwnl[7],NULL)) {
- if (dk4str_cat_s(fnb,DK4_SIZEOF(fnb,dkChar),fn,NULL)) {
- dk4path_correct_sep(fnb);
- if (0 == dk4uc2l_fp_process_file_name(ulptr, fnb, fn, app)) {
- back = 0;
- }
- } else {
- back = 0;
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else {
- back = 0;
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else {
- back = 0;
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else {
- if (0 == dk4uc2l_fp_process_file_name(ulptr, fn, fn, app)) {
- back = 0;
- }
- }
- }
- } while (NULL != fn);
- dk4dir_close(dir);
- } else {
- /* ERROR: Failed to open directory */
- ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
- } $? "- dk4uc2l_first_pass %d", back
- return back;
+ dk4_uc2l_t *back = NULL;
+ $? "+ dk4uc2l_i_open \"%!ds\"", dn
+ back = dk4uc2l_i_new(dn, erp);
+ if (NULL != back) {
+ if (0 == dk4uc2l_i_pass1(back, erp)) {
+ dk4uc2l_close(back);
+ back = NULL;
+ }
+#if TRACE_DEBUG
+ else { $? "! pass 1"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! mem"
+ /* ERROR: Memory (already reported) */
+ }
+#endif
+ $? "- dk4uc2l_i_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open(const dkChar *dn, dk4_er_t *erp)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ const dkChar *shdn = NULL;
+ dk4_uc2l_t *back = NULL;
+ const size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+ size_t i = 0;
+
+ $? "+ dk4uc2l_open \"%!ds\"", TR_STR(dn)
+ if (NULL != dn) { $? ". use specified directory name"
+ if (0 != dk4file_is_directory(dn, erp)) {
+ back = dk4uc2l_i_open(dn, erp);
+ }
+ }
+ else { $? ". no directory name specified"
+ shdn = dk4inst_get_directory(2);
+ for (i = 0; ((i < 3) && (NULL == dn)); i++) {
+ if (0 != dk4str_cpy_s(fnb, szfnb, shdn, NULL)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, dk4uc2l_kwnl[i], NULL)) {
+ dk4path_correct_sep(fnb);
+ if (0 != dk4file_is_directory(fnb, NULL)) {
+ dn = fnb;
+ }
+ }
+ }
+ }
+ if (NULL != dn) { $? ". directory name found"
+ back = dk4uc2l_i_open(dn, erp);
+ }
+ else { $? "! no directory name found"
+ /* ERROR: No directory found */
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
+ }
+ }
+ $? "- dk4uc2l_open %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+void
+dk4uc2l_allow_utf8(dk4_uc2l_t *ulptr, int enabled)
+{
+ $? "+ dk4uc2l_allow_utf8"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ ulptr->utf8allowed = ((0 != enabled) ? 0x01 : 0x00);
+ }
+ $? "- dk4uc2l_allow_utf8"
}
-static
void
-dk4uc2l_initialize_range(
- dk4_uc2l_t *ulptr,
- dk4_uc2l_range_t *rptr,
- dk4_app_t *app
+dk4uc2l_clean_packages_and_fonts(dk4_uc2l_t *ulptr)
+{
+ dk4_uc2l_pkg_t *pptr;
+ $? "+ dk4uc2l_clean_packages_and_fonts"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ ulptr->fallowed = DK4_UC2L_FONT_ENCODING_ALL;
+ dk4sto_it_reset(ulptr->i_pkgs);
+ do {
+ pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
+ if (NULL != pptr) {
+ pptr->used = 0x00;
+ }
+ } while (NULL != pptr);
+ } $? "- dk4uc2l_clean_packages_and_fonts"
+}
+
+
+
+unsigned char
+dk4uc2l_retrieve_allowed_fe(dk4_uc2l_t *ulptr)
+{
+ unsigned char back = 0x00;
+ $? "+ dk4uc2l_retrieve_allowed_fe"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ back = ulptr->fallowed;
+ }
+ $? "- dk4uc2l_retrieve_allowed_fe %u", (unsigned)back
+ return back;
+}
+
+
+
+int
+dk4uc2lat_direct(dk4_c32_t c32)
+{
+ int back = 0;
+ char c; /* 8-bit character version of c32. */
+ $? "+ dk4uc2lat_direct %lx", dk4recode_dk_to_ul(c32)
+ if(128UL > dk4recode_c32_to_ul(c32)) {
+ c = (char)c32;
+ switch(c) {
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+ case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z': case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V':
+ case 'W': case 'X': case 'Y': case 'Z': case '0': case '1':
+ case '2': case '3': case '4': case '5': case '6': case '7':
+ case '8': case '9': case ',': case '.': case ':': case ';':
+ case '+': case '-': case '?': case '!': case '|': case '@':
+ case '(': case ')': case '/': case '=': case ' ':
+ {
+ back = 1;
+ }
+ break;
+ }
+ } $? "- dk4uc2lat_direct %d", back
+ return back;
+}
+
+
+
+int
+dk4uc2l_i_keyword_index(const char *pkey)
+{
+ return (dk4str8_abbr_index(dk4uc2l_keywords, '$', pkey, 0));
+}
+
+
+
+
+unsigned char
+dk4uc2l_font_encoding_from_name(const char *pname)
+{
+ unsigned char back = 0x00;
+ switch (dk4str8_array_index(dk4uc2l_font_encodings, pname, 0)) {
+ case 0: {
+ back = DK4_UC2L_FONT_ENCODING_OT1;
+ } break;
+ case 1: {
+ back = DK4_UC2L_FONT_ENCODING_T1;
+ } break;
+ case 2: {
+ back = DK4_UC2L_FONT_ENCODING_T4;
+ } break;
+ case 3: {
+ back = DK4_UC2L_FONT_ENCODING_T5;
+ } break;
+ }
+ return back;
+}
+
+
+
+dk4_uc2l_pkg_t *
+dk4uc2l_i_create_pkg(
+ dk4_sto_t *s_pkgs,
+ const char *pname
)
{
- dk4_er_t er;
- size_t nelem;
- size_t i;
- int errmem;
- dk4error_init(&er);
- nelem = dk4ma_size_t_add(
- dk4ma_size_t_sub((size_t)(rptr->end), (size_t)(rptr->start), &er),
- (size_t)1U,
- &er
- );
- if (DK4_E_NONE == er.ec) {
- errmem = 0;
- rptr->both = dk4mem_new_app(dk4_uc2l_char_ptr,nelem,app);
- if (NULL != rptr->both) {
- for (i = 0; i < nelem; i++) { (rptr->both)[i] = NULL; }
- } else { errmem = 1; }
- rptr->text = dk4mem_new_app(dk4_uc2l_char_ptr,nelem,app);
- if (NULL != rptr->text) {
- for (i = 0; i < nelem; i++) { (rptr->text)[i] = NULL; }
- } else { errmem = 1; }
- rptr->math = dk4mem_new_app(dk4_uc2l_char_ptr,nelem,app);
- if (NULL != rptr->math) {
- for (i = 0; i < nelem; i++) { (rptr->math)[i] = NULL; }
- } else { errmem = 1; }
- rptr->pkgs = dk4mem_new_app(dk4_uc2l_pkg_ptr_ptr, nelem, app);
- if (NULL != rptr->pkgs) {
- for (i = 0; i < nelem; i++) { (rptr->pkgs)[i] = NULL; }
- } else { errmem = 1; }
- rptr->fenc = dk4mem_new_app(unsigned char,nelem,app);
- if (NULL != rptr->fenc) {
- for (i = 0; i < nelem; i++) {
- (rptr->fenc)[i] = (unsigned char)DK4_UC2L_FONT_ENCODING_ALL;
- }
- } else { errmem = 1; }
- if (0 != errmem) {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- }
+ dk4_uc2l_pkg_t *back = NULL;
+ back = dk4uc2l_i_open_pkg(pname, NULL);
+ if (NULL != back) {
+ if (0 == dk4sto_add(s_pkgs, back, NULL)) {
+ dk4uc2l_i_close_pkg(back);
+ back = NULL;
+ }
+ }
+ return back;
}
-/** Handler function for text lines.
- @param obj Object to modify while processing the character.
- @param line Text line to process.
+/** Handler to process a line during pass 1.
+ @param obj Object to use and modify during processing.
+ @param line Current text line to process.
@param lineno Current line number.
- @param erp Error report, may be NULL.
- @return DK4_TSP_RES_OK if the character was processed
- successfully,
- DK4_TSP_RES_ERROR if there was an error but we can
- continue,
- DK4_TSP_RES_FATAL if there was a fatal error so we
- should abort processing.
+ @param erp Error report, may be NULL.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on recoverable
+ errors, DK4_TSP_RES_FATAL on fatal errors requiring an abort.
*/
static
int
-dk4uc2l_sp_handler(
- void *obj,
- char *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+dk4uc2l_handler_pass2(
+ void *obj,
+ char *line,
+ dk4_um_t lineno,
+ dk4_er_t *erp
)
{
- dkChar numbuf[16*sizeof(dk4_um_t)];
- dk4_er_t er; /* Error report */
- dk4_uc2l_lhobj *lhobj; /* Handler object */
- dk4_app_t *app; /* Application */
- dk4_uc2l_range_t *rptr; /* Current range to modify */
- dk4_uc2l_pkg_t *pkgptr; /* Current package to create */
- dk4_uc2l_t *ulptr; /* Conversion structure */
- char *pkgn[16]; /* Package names */
- char *p1; /* Attribute name */
- char *p2; /* Next attribute to process */
- char *p4; /* Value, current value part */
- char *p5; /* Next value part */
- const char *pe; /* End of text when reading number */
- dk4_um_t um; /* Number read at start of line */
- size_t sznumbuf; /* Buffer size */
- size_t ind; /* Index of current char in range */
- size_t numpkg; /* Number of package names found */
- size_t i; /* Current package index */
- dk4_c32_t c32; /* Current character to configure */
- int numres; /* Number conversion result */
- int encadd; /* Flag: Add font encodings */
- int res; /* Operation result */
- int back = DK4_TSP_RES_OK;
- $? "+ dk4uc2l_sp_handler"
- /*
- Set variables.
- */
- lhobj = (dk4_uc2l_lhobj *)obj;
- ulptr = lhobj->ulptr;
- app = lhobj->app;
- dk4app_set_log_source_line(app, lineno);
-
- /*
- Skip empty lines and comments.
- */
- p1 = dk4str8_start(line, NULL);
- if (NULL == p1) {
- goto finished;
- }
- if ('#' == *p1) {
- goto finished;
- }
- p2 = dk4str8_next(p1, NULL);
-
- /*
- Retrieve character number.
- */
- um = (dk4_um_t)0UL;
- pe = NULL;
- res = dk4ma_input_c8_hex_dk4_um_t(&um, p1, &pe, 1, NULL);
- if (0 == res) {
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Syntax, not a number, already reported in first pass. */
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
- c32 = (dk4_c32_t)um;
- if ((dk4_um_t)0xFFFFFFFFUL < um) {
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Syntax, out of range, already reported in first pass. */
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- goto finished;
- }
-
- /*
- Find range.
- */
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(ulptr->i_ranges, &c32, 1);
- if (NULL == rptr) {
- back = DK4_TSP_RES_ERROR;
- /* ERROR: Bug, range not found, must be memory problem reported in pass 1 */
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- goto finished;
- }
-
- /*
- Initialize range if not yet done.
- */
- if (0x00 == rptr->ia) {
- rptr->ia = 0x01;
- dk4uc2l_initialize_range(ulptr, rptr, app);
- }
-
- ind = (size_t)(c32 - rptr->start);
- p1 = p2;
- while (NULL != p1) {
- p2 = dk4str8_next(p1, NULL);
- p4 = dk4str8_chr(p1, '=');
- if (NULL != p4) {
- *(p4++) = '\0';
- p4 = dk4str8_start(p4, NULL);
- if (NULL != p4) {
- switch (dk4str8_abbr_index(dk4uc2l_attribute_names, '$', p1, 0)) {
- case 0: { /* both */
- if (NULL != rptr->both) {
- if (NULL == (rptr->both)[ind]) {
- (rptr->both)[ind] = dk4str8_dup(p4, NULL);
- if (NULL == (rptr->both)[ind]) {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR: Already defined, reported in first pass */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c32, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR */
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } break;
- case 1: { /* text */
- if (NULL != rptr->text) {
- if (NULL == (rptr->text)[ind]) {
- (rptr->text)[ind] = dk4str8_dup(p4, NULL);
- if (NULL == (rptr->text)[ind]) {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR: Already defined, reported in first pass */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c32, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR */
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } break;
- case 2: { /* math */
- if (NULL != rptr->math) {
- if (NULL == (rptr->math)[ind]) {
- (rptr->math)[ind] = dk4str8_dup(p4, NULL);
- if (NULL == (rptr->math)[ind]) {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR: Already defined */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c32, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs,ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR */
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } break;
- case 3: { /* encoding */
- encadd = 1;
- if (NULL != rptr->fenc) {
- if ('!' == *p4) {
- p4++;
- encadd = 0;
- (rptr->fenc)[ind] = (unsigned char)DK4_UC2L_FONT_ENCODING_ALL;
- } else {
- (rptr->fenc)[ind] = 0x00;
- }
- while (NULL != p4) {
- p5 = dk4str8_chr(p4, ',');
- if (NULL != p5) { *(p5++) = '\0'; }
- switch (dk4str8_array_index(dk4uc2l_font_encodings, p4, 0)) {
- case 0: { /* OT1 */
- if (0 != encadd) {
- (rptr->fenc)[ind] |=
- (unsigned char)DK4_UC2L_FONT_ENCODING_OT1;
- } else {
- (rptr->fenc)[ind] &=
- (~((unsigned char)DK4_UC2L_FONT_ENCODING_OT1));
- }
- } break;
- case 1: { /* T1 */
- if (0 != encadd) {
- (rptr->fenc)[ind] |=
- (unsigned char)DK4_UC2L_FONT_ENCODING_T1;
- } else {
- (rptr->fenc)[ind] &=
- (~((unsigned char)DK4_UC2L_FONT_ENCODING_T1));
- }
- } break;
- case 2: { /* T4 */
- if (0 != encadd) {
- (rptr->fenc)[ind] |=
- (unsigned char)DK4_UC2L_FONT_ENCODING_T4;
- } else {
- (rptr->fenc)[ind] &=
- (~((unsigned char)DK4_UC2L_FONT_ENCODING_T4));
- }
- } break;
- case 3: { /* T5 */
- if (0 != encadd) {
- (rptr->fenc)[ind] |=
- (unsigned char)DK4_UC2L_FONT_ENCODING_T5;
- } else {
- (rptr->fenc)[ind] &=
- (~((unsigned char)DK4_UC2L_FONT_ENCODING_T5));
- }
- } break;
- default : {
- /* ERROR: Syntax, undefined encoding */
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,8);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- } break;
- }
- p4 = p5;
- }
- } else {
- /* ERROR */
- }
- } break;
- case 4: { /* packages */
- dk4error_init(&er);
- numpkg = dk4str8_tokenize(pkgn, 16, p4, ",", &er);
- if (0 < numpkg) {
- if (NULL != rptr->pkgs) {
- if (NULL == (rptr->pkgs)[ind]) {
- (rptr->pkgs)[ind] =
- dk4mem_new_app(dk4_uc2l_pkg_ptr,(numpkg+1),app);
- if (NULL != (rptr->pkgs)[ind]) {
- for (i = 0; i <= numpkg; i++) {
- ((rptr->pkgs)[ind])[i] = NULL;
- }
- for (i = 0; i < numpkg; i++) {
- pkgptr = (dk4_uc2l_pkg_t *)dk4sto_it_find_like(
- ulptr->i_pkgs, pkgn[i], 1
- );
- if (NULL != pkgptr) {
- ((rptr->pkgs)[ind])[i] = pkgptr;
- } else {
- pkgptr = dk4uc2l_pkg_open(pkgn[i], app);
- if (NULL != pkgptr) {
- if (0 == dk4sto_add(ulptr->s_pkgs, pkgptr, NULL)) {
- dk4uc2l_pkg_close(pkgptr);
- pkgptr = NULL;
- }
+ dk4_er_t er;
+ char *pkgn[16];
+ handler_object_t *lho = NULL;
+ const char *pe = NULL;
+ char *p1 = NULL;
+ char *p2 = NULL;
+ char *p3 = NULL;
+ char *p4 = NULL;
+ dk4_uc2l_range_t *rptr = NULL;
+ dk4_uc2l_pkg_t *pptr = NULL;
+ size_t ind = 0;
+ size_t numpkg = 0;
+ size_t i = 0;
+ unsigned long ul = 0UL;
+ dk4_c32_t c32 = (dk4_c32_t)0UL;
+ int back = DK4_TSP_RES_OK;
+ int res = 0;
+ int adding = 0;
+ unsigned char fex = 0;
+ unsigned char feval = 0;
+ $? "+ dk4uc2l_handler_pass2"
+#if TRACE_DEBUG
+ dk4str8_delnl(line);
+ $? ". line=\"%!8s\"", line
+#endif
+
+ /* Line handler object
+ */
+ lho = (handler_object_t *)obj;
+
+ /* Find start of line, ignore empty lines and comments
+ */
+ p1 = dk4str8_start(line, NULL);
+ if (NULL == p1) { $? ". ignore empty line"
+ goto finished;
+ }
+ if ('#' == *p1) { $? ". ignore comment"
+ goto finished;
+ }
+
+ /* Retrieve character number
+ */
+ p2 = dk4str8_next(p1, NULL);
+ res = dk4ma_input_c8_hex_ulong(&ul, p1, &pe, 1, erp);
+ if (0 == res) { $? "! failed to retrieve character number"
+ /* WARNING: Syntax, no number.
+ Already reported in pass 1.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+ c32 = (dk4_c32_t)ul;
+
+ /* Find and check range structure, attempt cached range pointer first
+ */
+ if (NULL != lho->rpc) {
+ if ((lho->rpc->start <= c32) && (c32 <= lho->rpc->end)) {
+ rptr = lho->rpc;
+ }
+ }
+ if (NULL == rptr) {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lho->ulptr->i_ranges,&c32,1);
+ }
+ if (NULL == rptr) { $? "! rptr"
+ /* ERROR: No range found.
+ Already reported in pass 1.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ if (0 != dk4str_cmp(lho->file->fn, rptr->file->fn)) {
+ /* ERROR: Not owned by current file.
+ Already reported in pass 1.
+ */
+ $? "! redefinition"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+
+ /* Initialize range structure (allocate memory) if not yet done
+ */
+ if (0x00 == rptr->ia) { $? ". must initialize range"
+ if (0 == dk4uc2l_i_init_range(rptr, erp)) {
+ $? "! memory"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ rptr->ia = 0x01; $? ". marking range as initialized"
+ }
+ else { $? ". range is already initialized"
+ }
+
+ /* Find index
+ */
+ ind = (size_t)(c32 - rptr->start);
+
+ /* Check whether character already defined
+ */
+ if (NULL != rptr->lno) {
+ if ((dk4_um_t)0UL != (rptr->lno)[ind]) {
+ /* ERROR: Redefinition.
+ Already reported in pass 1.
+ */
+ $? "! redefinition"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+ else {
+ (rptr->lno)[ind] = lineno;
+ }
+ }
+
+ /* Traverse all strings in line
+ */
+ p1 = p2;
+ while (NULL != p1) { $? ". p1=\"%!8s\"", p1
+ p2 = dk4str8_next(p1, NULL);
+ p3 = dk4str8_chr(p1, '=');
+ if (NULL != p3) {
+ *(p3++) = '\0';
+ p3 = dk4str8_start(p3, NULL);
+ if (NULL != p3) {
+ $? ". p1=\"%!8s\" p3=\"%!8s\"", p1, p3
+ res = dk4uc2l_i_keyword_index(p1);
+ switch (res) {
+ case 0 : { $? ". both=..."
+ if (NULL != rptr->both) {
+ if (NULL == (rptr->both)[ind]) {
+ (rptr->both)[ind] = dk4str8_dup(p3, erp);
+ if (NULL == (rptr->both)[ind]) {
+ $? "! memory"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else { $? "! bug"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! rptr->both"
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 1 : { $? ". text=..."
+ if (NULL != rptr->text) {
+ if (NULL == (rptr->text)[ind]) {
+ (rptr->text)[ind] = dk4str8_dup(p3, erp);
+ if (NULL == (rptr->text)[ind]) {
+ $? "! memory"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else { $? "! bug"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! rptr->text"
+ /* ERROR: Memory
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 2 : { $? ". math=..."
+ if (NULL != rptr->math) {
+ if (NULL == (rptr->math)[ind]) {
+ (rptr->math)[ind] = dk4str8_dup(p3, erp);
+ if (NULL == (rptr->math)[ind]) {
+ $? "! memory"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else { $? "! bug"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! rptr->math"
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 3 : { $? ". encoding=..."
+ if (NULL != rptr->fenc) {
+ adding = 1;
+ feval = 0x00;
+ if ('!' == *p3) {
+ adding = 0;
+ p3++;
+ feval = DK4_UC2L_FONT_ENCODING_ALL;
+ }
+ while (NULL != p3) {
+ p4 = dk4str8_chr(p3, ',');
+ if (NULL != p4) {
+ *(p4++) = '\0';
+ }
+ fex = dk4uc2l_font_encoding_from_name(p3);
+ if (0x00 != fex) {
+ if (0 != adding) {
+ feval |= fex;
+ }
+ else {
+ feval &= (~(fex));
+ }
+ }
+ else { $? "! illegal encoding \"%!8s\"", p3
+ /* ERROR: Illegal encoding name */
+ dk4error_set_simple_error_code(
+ erp, DK4_E_SYNTAX
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_SYNTAX;
+ }
+ p3 = p4;
+ }
+ (rptr->fenc)[ind] = feval;
+ }
+ else {
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 4 : { $? ". packages=..."
+ if (NULL != rptr->pkgs) {
+ if (NULL == (rptr->pkgs)[ind]) {
+ dk4error_init(&er);
+ numpkg = dk4str8_tokenize(
+ pkgn, 16, p3, ",", &er
+ );
+ if (0 < numpkg) {
+ (rptr->pkgs)[ind] =
+ dk4mem_new(dk4_uc2l_pkg_p,(numpkg+1),erp);
+ if (NULL != (rptr->pkgs)[ind]) {
+ for (i = 0; i <= numpkg; i++) {
+ ((rptr->pkgs)[ind])[i] = NULL;
+ }
+ for (i = 0; i < numpkg; i++) {
+ pptr =
+ (dk4_uc2l_pkg_t *)dk4sto_it_find_like(
+ lho->ulptr->i_pkgs, pkgn[i], 1
+ );
+ if (NULL != pptr) {
+ ((rptr->pkgs)[ind])[i] = pptr;
+ }
+ else {
+ pptr = dk4uc2l_i_create_pkg(
+ lho->ulptr->s_pkgs, pkgn[i]
+ );
+ if (NULL != pptr) {
+ ((rptr->pkgs)[ind])[i] =
+ pptr;
+ }
+ else { $? "! memory"
+ dk4error_set_simple_error_code(
+ erp,
+ DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ }
+ }
+ else { $? "! memory"
+ dk4error_set_simple_error_code(
+ erp,
+ DK4_E_MEMORY_ALLOCATION_FAILED
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else { $? "! empty list"
+ /* ERROR: Syntax, empty list */
+ dk4error_set_simple_error_code(
+ erp, DK4_E_SYNTAX
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! bug"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! memory"
+ /* ERROR: Memory.
+ Already reported during range initalization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ default : { $? "! illegal key \"%!8s\"", p1
+ /* ERROR: Illegal key name */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ } break;
+ }
+ p1 = p2;
}
- if (NULL != pkgptr) {
- ((rptr->pkgs)[ind])[i] = pkgptr;
- } else {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ else { $? "! not key=value"
+ /* ERROR: Syntax, not a key=value */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ p1 = NULL;
}
- }
- }
- } else {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR: Redefinition */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c32, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs,ulptr->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,4);
- }
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR: Memory */
- dk4app_log_base1(app, DK4_LL_ERROR, 90);
- ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
- }
- } else {
- /* ERROR Syntax */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 9);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } break;
- default: {
- /* ERROR: Syntax error */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 10);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- } break;
- }
- } else {
- /* ERROR: Syntax */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 11);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- } else {
- /* ERROR: Syntax */
- dk4app_log_1(app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 11);
- ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
- }
- p1 = p2;
- }
-
- finished:
- $? "- dk4uc2l_sp_handler %d", back
- return back;
+ }
+ else { $? "! not key=value"
+ /* ERROR: Syntax, not a key=value */
+ dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ p1 = NULL;
+ }
+ }
+
+ finished:
+ $? "- dk4uc2l_handler_pass2 %d", back
+ return back;
}
+/** Load data file.
+ @param ulptr Conversion structure.
+ @param fptr File structure to load.
+ @param erp Error report, may be NULL.
+*/
static
void
-dk4uc2l_sp_process_stream(
- dk4_uc2l_t *ulptr,
- dk4_stream_t *rstrm,
- const dkChar *fnb,
- dk4_app_t *app
+dk4uc2l_load_data_file(
+ dk4_uc2l_t *ulptr,
+ dk4_uc2l_file_t *fptr,
+ dk4_er_t *erp
)
{
- char buf[256]; /* Line buffer */
- dk4_uc2l_lhobj obj; /* Processing object */
- dk4_tsp08_t tsp08; /* Text stream processor */
- dk4_er_t er; /* General error report */
- dk4_er_t er_en; /* Error report encoding/decoding */
- dk4_er_t er_pr; /* Error report processing */
- int res; /* Operation result */
- int cc; /* Flag: Can continue */
- char c; /* Current character to process */
-
- obj.ulptr = ulptr;
- obj.app = app;
- obj.sfn = fnb;
- obj.e_d = 0;
- obj.e_e = 0;
- obj.e_p = 0;
- dk4error_init(&er);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- res = dk4tsp08_setup_line(
- &tsp08, (void *)(&obj), dk4uc2l_sp_handler, buf, sizeof(buf),
- DK4_ENCODING_ASCII, DK4_ENCODING_ASCII, &er
- );
- if (0 != res) {
- cc = 1;
- while (1 == cc) {
- res = dk4stream_c8_read_byte(&c, rstrm, &er);
- if (0 != res) {
- res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ dkChar fnb[DK4_MAX_PATH];
+ char lnb[256];
+ handler_object_t ho;
+ dk4_tsp08_t tsp08;
+ dk4_stream_t *rstrm = NULL;
+ size_t fnbsz = DK4_SIZEOF(fnb,dkChar);
+ size_t szlnb = sizeof(lnb);
+ int res;
+ int cc;
+ char c;
+
+ $? "+ dk4uc2l_load_data_file \"%!ds\"", fptr->fn
+
+ /* Initialize handler object
+ */
+ ho.ulptr = ulptr;
+ ho.s_ra = NULL;
+ ho.i_ra = NULL;
+ ho.file = fptr;
+ ho.rpc = NULL;
+
+ /* Save source file name and line number
+ */
+
+ /* Each file should be loaded only once
+ */
+ if (0x00 != fptr->loaded) {
+ goto finished;
+ }
+ fptr->loaded = 0x01;
+
+ /* Construct full path name
+ */
+ if (0 == dk4str_cpy_s(fnb, fnbsz, ulptr->dname, erp)) {
+ /* ERROR: Directory name too long */
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ if (0 == dk4str_cat_s(fnb, fnbsz, dk4uc2l_kwnl[3], erp)) {
+ /* ERROR: Directory name too long */
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ if (0 == dk4str_cat_s(fnb, fnbsz, fptr->fn, erp)) {
+ /* ERROR: Directory name too long */
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ dk4path_correct_sep(fnb);
+
+ /* Open reader stream
+ */
+ rstrm = dk4stream_open_file_reader(fnb, erp);
+ if (NULL == rstrm) {
+ /* ERROR: Failed to read file */
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ goto finished;
+ }
+
+ /* Initialize text processing
+ */
+ res = dk4tsp08_setup_line(
+ &tsp08, (void *)(&ho), dk4uc2l_handler_pass2, lnb, szlnb,
+ DK4_ENCODING_PLAIN, DK4_ENCODING_PLAIN, erp
+ );
+ if (0 == res) {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ /* ERROR: Memory */
+ goto finished;
+ }
+
+ /* Process contents
+ */
+ do {
+ cc = 0;
+ res = dk4stream_c8_read_byte(&c, rstrm, erp);
+ if (0 < res) {
+ cc = 1;
+ res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ } break;
+ case DK4_TSP_RES_FATAL : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ } break;
+ }
+ }
+ } while (0 < cc);
+
+ /* Finish text processing
+ */
+ res = dk4tsp08_finish(&tsp08);
switch (res) {
- case DK4_TSP_RES_ERROR: {
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- case DK4_TSP_RES_FATAL: {
- cc = -1;
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- dk4error_init(&er_en);
- dk4error_init(&er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- }
- } else {
- cc = 0;
- }
- }
- if (0 == cc) {
- res = dk4tsp08_finish(&tsp08);
- switch (res) {
- case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
- dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
- /* Report errors */
- dk4uc2l_report_errors(ulptr, app, &obj, &er_en, &er_pr);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } break;
- }
- }
- } else {
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
+ case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ } break;
+ }
+
+ /* Clean up
+ */
+ finished:
+ if (NULL != rstrm) {
+ dk4stream_close(rstrm, NULL);
+ }
+ $? "- dk4uc2l_load_data_file"
+}
+
+
+
+const char *
+dk4uc2l_find(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_er_t *erp)
+{
+ dk4_uc2l_range_t *rptr;
+ dk4_uc2l_pkg_t **pkgpp;
+ dk4_uc2l_file_t *fptr;
+ const char *back = NULL;
+ size_t ind;
+ size_t blgt;
+ int res;
+ $? "+ dk4uc2l_find 0x%lx", (unsigned long)c
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ /* Check ulptr usability
+ */
+ if (NULL == ulptr) { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ /* Attempt direct output
+ */
+ if (0 != dk4uc2lat_direct(c)) { $? ". direct output"
+ ulptr->buf[0] = (char)c;
+ ulptr->buf[1] = '\0';
+ back = &(ulptr->buf[0]);
+ goto finished;
+ }
+
+ /* Attempt data loaded from files
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(ulptr->i_ranges, &c, 1);
+ if (NULL != rptr) { $? ". found in overview data"
+ fptr = rptr->file;
+ if (0x00 == fptr->loaded) { $? ". must load data file"
+ dk4uc2l_load_data_file(ulptr, fptr, erp);
+ }
+ ind = (size_t)(c - rptr->start);
+ if (0 != mm) { $? ". search in math mode"
+ if (NULL != rptr->math) {
+ back = (rptr->math)[ind];
+ }
+ }
+ else { $? ". search in non-math mode"
+ if (NULL != rptr->text) {
+ back = (rptr->text)[ind];
+ }
+ }
+ if (NULL == back) { $? ". not yet found"
+ if (NULL != rptr->both) {
+ back = (rptr->both)[ind];
+ }
+ }
+ if (NULL != back) { $? ". found"
+ if (NULL != rptr->pkgs) { $? ". modify package usage"
+ pkgpp = (rptr->pkgs)[ind];
+ if (NULL != pkgpp) {
+ while (NULL != *pkgpp) {
+ (*(pkgpp++))->used = 0x01;
+ }
+ }
+ }
+ if (NULL != rptr->fenc) { $? ". modify encoding usage"
+ ulptr->fallowed &= (rptr->fenc)[ind];
+ }
+ goto finished;
+ }
+ }
+
+ /* Attempt to use UTF-8 encoded data or ASCII data directly
+ */
+ $? ". not yet found"
+ if (0 == mm) {
+ if (0x00 != ulptr->utf8allowed) { $? ". attempt utf-8"
+ blgt = 15;
+ res = dk4utf8_encode(
+ (unsigned char *)(&(ulptr->buf[0])), &blgt, c, erp
+ );
+ if (0 != res) {
+ ulptr->buf[blgt] = '\0';
+ back = &(ulptr->buf[0]);
+ }
+ }
+ else { $? ". attempt direct usage"
+ if (dkC32(0x00000100) > c) {
+ ulptr->buf[0] = (char)c;
+ ulptr->buf[1] = '\0';
+ back = &(ulptr->buf[0]);
+ }
+ }
+ }
+
+ finished:
+ $!trace-code if (NULL == back) {
+ $? "! not found"
+ $!trace-code }
+ $? "- dk4uc2l_find \"%!8s\"", TR_8STR(back)
+ return back;
}
-/** Attempt to load one data file if not yet loaded.
- @param ulptr Conversion structure.
- @param rptr Pointer to range causing the attempt to load.
- @param app Application structure for diagnostics, may be NULL.
-*/
static
-void
-dk4uc2l_load_if_not_yet_done(
- dk4_uc2l_t *ulptr,
- dk4_uc2l_range_t *rptr,
- dk4_app_t *app
+int
+dk4uc2l_i_encoding(
+ unsigned char enclist,
+ unsigned char oneenc
)
{
- dkChar fnb[DK4_MAX_PATH];
- dk4_er_t er;
- const dkChar *oldsourcefile;
- dk4_uc2l_file_t *fptr;
- dk4_stream_t *rstrm;
- dk4_um_t oldsourceline;
- size_t fnbsz;
- $? "+ dk4uc2l_load_if_not_yet_done"
- fptr = rptr->file;
- if (NULL != fptr) { $? ". fptr"
- if (0x00 == fptr->loaded) { $? ". must load"
- fptr->loaded = 0x01;
- fnbsz = DK4_SIZEOF(fnb, dkChar);
- if (0 != dk4str_cpy_s(fnb, fnbsz, ulptr->dname, NULL)) {
- if (0 != dk4str_cat_s(fnb, fnbsz, dk4uc2l_kwnl[7], NULL)) {
- if (0 != dk4str_cat_s(fnb, fnbsz, fptr->fn, NULL)) {
- dk4path_correct_sep(fnb);
- dk4error_init(&er);
- rstrm = dk4stream_open_file_reader(fnb, &er);
- if (NULL != rstrm) {
- oldsourcefile = dk4app_get_log_source_file(app);
- oldsourceline = dk4app_get_log_source_line(app);
- dk4app_set_log_source_file(app, fnb);
- dk4app_set_log_source_line(app, (dk4_um_t)0UL);
- dk4uc2l_sp_process_stream(ulptr, rstrm, fnb, app);
- dk4app_set_log_source_file(app, oldsourcefile);
- dk4app_set_log_source_line(app, oldsourceline);
- dk4stream_close(rstrm, NULL);
- } else { $? "! stream open"
- /* ERROR: Failed to open file */
- dk4app_log_3(
- app, ulptr->msgs, ulptr->szmsgs, DK4_LL_ERROR, 6, 7, fnb
- );
- ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
- }
- } else { $? "! path too long"
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else { $? "! path too long"
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else { $? "! path too long"
- /* ERROR: Path too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- }
- } else { $? ". already loaded"
- }
- } else { $? "! fptr"
- ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
- } $? "- dk4uc2l_load_if_not_yet_done"
+ int back = 0;
+ if (0x00 != (enclist & ((unsigned char)oneenc))) {
+ back = 1;
+ }
+ return back;
}
-const char *
-dk4uc2l_find(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app)
+void
+dk4uc2l_recommendations(dk4_uc2l_t *ulptr, dk4_stream_t *wstrm, dk4_er_t *erp)
{
- dkChar numbuf[16*sizeof(dk4_um_t)];
- dk4_uc2l_range_t *rptr;
- dk4_uc2l_pkg_t **pptr;
- dk4_uc2l_pkg_t *xpptr;
- const char *back = NULL;
- size_t blgt;
- size_t sznumbuf;
- int numres;
- $? "+ dk4uc2l_find %lx", (unsigned long)c
- if (NULL != ulptr) {
- /*
- Attempt direct output.
- */
- if (0 != dk4uc2lat_direct(c)) {
- ulptr->buf[0] = (char)c;
- ulptr->buf[1] = '\0';
- back = &(ulptr->buf[0]);
- goto finished;
- }
-
- /*
- Attempt to find output string in data.
- */
- rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(
- ulptr->i_ranges, &c, 1
- );
- if (NULL != rptr) {
- dk4uc2l_load_if_not_yet_done(ulptr, rptr, app);
- if (0 != mm) {
- if (NULL != rptr->math) {
- back = (rptr->math)[(size_t)(c - rptr->start)];
- }
- if (NULL == back) {
- if (NULL != rptr->both) {
- back = (rptr->both)[(size_t)(c - rptr->start)];
- }
- }
- } else {
- if (NULL != rptr->text) {
- back = (rptr->text)[(size_t)(c - rptr->start)];
- }
- if (NULL == back) {
- if (NULL != rptr->both) {
- back = (rptr->both)[(size_t)(c - rptr->start)];
- }
- }
- }
- if (NULL != back) {
- if (NULL != rptr->fenc) {
- ulptr->fallowed &= (rptr->fenc)[(size_t)(c - rptr->start)];
- }
- if (NULL != rptr->pkgs) {
- if (NULL != (rptr->pkgs)[(size_t)(c - rptr->start)]) {
- pptr = (rptr->pkgs)[(size_t)(c - rptr->start)];
- while (NULL != *pptr) {
- xpptr = *(pptr++);
- xpptr->used = 0x01;
- }
- }
- }
- }
- }
- if (NULL != back) { goto finished; }
-
- /*
- If everything failed so far, attempt to use UTF-8 output
- or direct output.
- */
- if (0 != mm) { goto finished; }
- if (0x00 != ulptr->utf8allowed) {
- blgt = 15;
- if (0 != dk4utf8_encode((unsigned char *)(&(ulptr->buf[0])),&blgt,c,NULL))
- {
- ulptr->buf[blgt] = '\0';
- back = &(ulptr->buf[0]);
- }
- else
- {
- /* ERROR: UTF-8 encoding failed */
- sznumbuf = DK4_SIZEOF(numbuf,dkChar);
- numres = dk4ma_write_hex_unsigned(
- numbuf, sznumbuf, (dk4_um_t)c, 8, NULL
- );
- if (0 != numres) {
- dk4app_log_3(
- app, ulptr->msgs,ulptr->szmsgs, DK4_LL_ERROR, 12, 13, numbuf
- );
- } else {
- dk4app_log_1(app,ulptr->msgs,ulptr->szmsgs,DK4_LL_ERROR,14);
- }
-
- }
- } else {
- if (dkC32(0x00000100) > c) {
- ulptr->buf[0] = (char)c;
- ulptr->buf[1] = '\0';
- back = &(ulptr->buf[0]);
- } else {
- /* ERROR: No encoding found */
- }
- }
- }
- finished:
- $? "- dk4uc2l_find PTR=%d", TR_IPTR(back)
- return back;
+ dk4_uc2l_pkg_t *pptr;
+ $? "+ dk4uc2l_recommendations"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+#endif
+ if ((NULL != ulptr) && (NULL != wstrm)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[0], erp
+ );
+ if (dk4uc2l_i_encoding(ulptr->fallowed,DK4_UC2L_FONT_ENCODING_T1)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[3], erp
+ );
+ }
+ if (dk4uc2l_i_encoding(ulptr->fallowed,DK4_UC2L_FONT_ENCODING_OT1)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[2], erp
+ );
+ }
+ if (dk4uc2l_i_encoding(ulptr->fallowed,DK4_UC2L_FONT_ENCODING_T4)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[4], erp
+ );
+ }
+ if (dk4uc2l_i_encoding(ulptr->fallowed,DK4_UC2L_FONT_ENCODING_T5)) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[5], erp
+ );
+ }
+ dk4stream_write_byte(wstrm, '\n', erp);
+ dk4sto_it_reset(ulptr->i_pkgs);
+ do {
+ pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
+ if (NULL != pptr) {
+ if (0x00 != pptr->used) {
+ dk4stream_write_char_string(
+ wstrm, dk4uc2l_kw8[1], erp
+ );
+ dk4stream_write_char_string(
+ wstrm, pptr->pn, erp
+ );
+ dk4stream_write_byte(wstrm, '\n', erp);
+ }
+ }
+ } while (NULL != pptr);
+ }
+ $? "- dk4uc2l_recommendations"
}
-dk4_uc2l_t *
-dk4uc2l_open(const dkChar *dn, dk4_app_t *app)
+int
+dk4uc2l_retrieve_errors(dk4_uc2l_t *ulptr)
{
- dk4_er_t er;
- dk4_uc2l_t *back = NULL;
- $? "+ dk4uc2l_open"
- dk4error_init(&er);
- if (NULL != dn) {
- if (0 != dk4file_is_directory(dn, &er)) {
- back = dk4uc2l_create(dn, app);
- if (NULL != back) {
- if (0 == dk4uc2l_first_pass(back, app)) {
- dk4uc2l_close(back);
- back = NULL;
- }
- }
- } else {
- /* ERROR: Not a directory */
- dk4app_log_base3(app, DK4_LL_ERROR, 152, 153, dn);
- }
- } $? "- dk4uc2l_open PTR=%d", TR_IPTR(back)
- return back;
+ int back = 0;
+ $? "+ dk4uc2l_retrieve_errors"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ back = ulptr->had_error;
+ }
+ $? "- dk4uc2l_retrieve_errors %d", back
+ return back;
}
-dk4_uc2l_t *
-dk4uc2l_open_from_app(dk4_app_t *app)
+void
+dk4uc2l_reset_errors(dk4_uc2l_t *ulptr)
{
- dkChar fnb[DK4_MAX_PATH]; /* Buffer to construct name */
- const dkChar * const *debmsg;
- dk4_uc2l_t *back = NULL;
- size_t i = 0; /* Traverse possible dirs */
- size_t szdm = 0;
- int done = 0; /* Flag: Attempted */
- int toolo = 0; /* Flag: Name too long */
- int res = 0; /* Operation result */
- $? "+ dk4uc2l_open_from_app"
- if (NULL != app) {
- res = dk4app_pref_get(fnb,DK4_SIZEOF(fnb,dkChar),app,dk4uc2l_kwnl[0],0);
- if (0 != res) {
- dk4path_correct_sep(fnb);
- if (0 != dk4file_is_directory(fnb, NULL)) {
- done = 1;
- back = dk4uc2l_open(fnb, app);
- }
- }
- for (i = 1; i < 4; i++) {
- if ((0 == done) && (NULL == back)) {
- if (0 != dk4str_cpy_s(fnb,DK4_SIZEOF(fnb,dkChar),app->dir_share,NULL)) {
- if (0 != dk4str_cat_s(fnb,DK4_SIZEOF(fnb,dkChar),dk4uc2l_kwnl[i],NULL))
- {
- dk4path_correct_sep(fnb);
- if (0 != dk4file_is_directory(fnb, NULL)) {
- done = 1;
- back = dk4uc2l_open(fnb, app);
- }
- } else {
- toolo = 1;
- }
- } else {
- toolo = 1;
- }
- }
- }
- }
- if (NULL == back) {
- if (0 == done) {
- if (0 != toolo) {
- /* ERROR: shared directory name too long */
- dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, app->dir_share);
- } else {
- /* ERROR: No charmap directory found */
- debmsg = dk4app_string_table(app, dk4uc2l_kwnl[8], dk4uc2l_kw_def);
- szdm = dk4app_string_table_size(dk4uc2l_kw_def);
- dk4app_log_1(app, debmsg, szdm, DK4_LL_ERROR, 15);
- }
- }
- } $? "- dk4uc2l_open_from_app PTR=%d", TR_IPTR(back)
- return back;
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ ulptr->had_error = 0;
+ }
}
+/* ##### untested */
+static
void
-dk4uc2l_clean_packages_and_fonts(dk4_uc2l_t *ulptr)
+dk4uc2l_putc32(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ dk4_c32_t c32,
+ int *pmm,
+ int *pback,
+ dk4_er_t *erp
+)
{
- dk4_uc2l_pkg_t *pptr;
- $? "+ dk4uc2l_clean_packages_and_fonts"
- if (NULL != ulptr) {
- ulptr->fallowed = DK4_UC2L_FONT_ENCODING_ALL;
- dk4sto_it_reset(ulptr->i_pkgs);
- do {
- pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
- if (NULL != pptr) {
- pptr->used = 0x00;
- }
- } while (NULL != pptr);
- } $? "- dk4uc2l_clean_packages_and_fonts"
+ dk4_er_t er;
+ const char *le = NULL;
+ $? "+ dk4uc2l_putc32 0x%08lx", UL(c32)
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+#endif
+ dk4error_init(&er);
+ le = dk4uc2l_find(ulptr, c32, 0, &er);
+ if (NULL != le) { $? ". found char, no mm"
+ if (0 != *pmm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ *pback = 0; $? "! end mm"
+ }
+ *pmm = 0;
+ }
+ if (0 == dk4stream_write_char_string(wstrm, le, erp)) {
+ *pback = 0; $? "! le"
+ }
+ }
+ else {
+ le = dk4uc2l_find(ulptr, c32, 1, &er);
+ if (NULL != le) { $? ". found char mm"
+ if (0 == *pmm) {
+ if (0 == dk4stream_write_char_string(wstrm,dk4uc2l_mm[0],erp)) {
+ *pback = 0; $? "! start mm"
+ }
+ *pmm = 1;
+ }
+ if (0 == dk4stream_write_char_string(wstrm, le, erp)) {
+ *pback = 0; $? "! le"
+ }
+ }
+ else { $? "! not found"
+ *pback = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
+ }
+ }
+ $? "- dk4uc2l_putc32"
}
-unsigned char
-dk4uc2l_retrieve_allowed_fe(dk4_uc2l_t *ulptr)
+/* ##### untested */
+int
+dk4uc2l_string_c32(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c32_t *str,
+ dk4_er_t *erp
+)
{
- unsigned char back = 0x00;
- $? "+ dk4uc2l_retrieve_allowed_fe"
- if (NULL != ulptr) {
- back = ulptr->fallowed;
- } $? "- dk4uc2l_retrieve_allowed_fe %u", (unsigned)back
- return back;
+ int back = 0;
+ int mm = 0;
+
+ $? "+ dk4uc2l_string_c32"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ /* Process all characters from string
+ */
+ back = 1;
+ while (dkC32(0) != *str) {
+ dk4uc2l_putc32(wstrm, ulptr, *(str++), &mm, &back, erp);
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+ }
+ }
+
+ finished:
+ $? "- dk4uc2l_string_c32 %d", back
+ return back;
}
-void
-dk4uc2l_allow_utf8(dk4_uc2l_t *ulptr, int enabled)
+/* ##### untested */
+int
+dk4uc2l_string_c16(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c16_t *str,
+ dk4_er_t *erp
+)
{
- if (NULL != ulptr) {
- ulptr->utf8allowed = ((0 != enabled) ? 0x01 : 0x00);
- }
+ dk4_utf16_decoder_t dec;
+ dk4_c32_t c32;
+ int mm = 0;
+ int back = 0;
+ int err = 0;
+ $? "+ dk4uc2l_string_c16"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) { $? "! arguments"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ back = 1;
+ dk4utf16_init(&dec);
+ while ((dkC16(0) != *str) && (0 == err)) { $? ". have char to add"
+ switch (dk4utf16_add(&dec, *(str++))) {
+ case DK4_EDSTM_FINISHED : {
+ c32 = dk4utf16_get(&dec);
+ dk4utf16_init(&dec);
+ dk4uc2l_putc32(wstrm, ulptr, c32, &mm, &back, erp);
+ $? ". back = %d, err = %d", back, err
+ } break;
+ case DK4_EDSTM_ERROR : { $? "! failed to add"
+ err = 1;
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ } break;
+ }
+ }
+ if (0 == err) {
+ if (0 == dk4utf16_is_empty(&dec)) { $? "! decoder not empty"
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ }
+ }
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0; $? "! failed to close mm"
+ }
+ }
+
+ finished:
+ $? "- dk4uc2l_string_c16 %d", back
+ return back;
}
+/* ##### untested */
int
-dk4uc2lat_direct(dk4_c32_t c32)
+dk4uc2l_string_utf8(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+)
{
- int back = 0;
- char c; /* 8-bit character version of c32. */
- $? "+ dk4uc2lat_direct %lx", (unsigned long)c32
- if((unsigned long)c32 < 128UL) {
- c = (char)c32;
- switch(c) {
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g':
- case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
- case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u':
- case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B':
- case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I':
- case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P':
- case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W':
- case 'X': case 'Y': case 'Z': case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7': case '8': case '9': case ',':
- case '.': case ':': case ';': case '+': case '-': case '?': case '!':
- case '|': case '@': case '(': case ')': case '/': case '=': case ' ':
- {
- back = 1;
- }
- break;
- }
- } $? "- dk4uc2lat_direct %d", back
- return back;
+ dk4_utf8_decoder_t dec;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+ int err = 0;
+ $? "+ dk4uc2l_string_utf8"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ back = 1;
+ dk4utf8_init(&dec);
+ while(('\0' != *str) && (0 == err)) {
+ switch (dk4utf8_add(&dec, (unsigned char)(*(str++)))) {
+ case DK4_EDSTM_FINISHED : {
+ c32 = dk4utf8_get(&dec);
+ dk4utf8_init(&dec);
+ dk4uc2l_putc32(wstrm, ulptr, c32, &mm, &back, erp);
+ } break;
+ case DK4_EDSTM_ERROR : {
+ err = 1;
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ } break;
+ }
+ }
+ if (0 == err) {
+ if (0 == dk4utf8_is_empty(&dec)) {
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ }
+ }
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+ }
+ }
+
+ finished:
+ $? "- dk4uc2l_string_utf8 %d", back
+ return back;
}
-void
-dk4uc2l_recommendations(dk4_uc2l_t *ulptr, FILE *fipo)
+/* ##### untested */
+int
+dk4uc2l_string_ansi(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+)
{
- dk4_uc2l_pkg_t *pptr;
- if ((NULL != ulptr) && (NULL != fipo)) {
- fputs(dk4uc2l_kw8[0], fipo);
- if (0x00 != (ulptr->fallowed & (unsigned char)DK4_UC2L_FONT_ENCODING_T1)) {
- fputs(dk4uc2l_kw8[3], fipo);
- }
- if (0x00 != (ulptr->fallowed & (unsigned char)DK4_UC2L_FONT_ENCODING_OT1)) {
- fputs(dk4uc2l_kw8[2], fipo);
- }
- if (0x00 != (ulptr->fallowed & (unsigned char)DK4_UC2L_FONT_ENCODING_T4)) {
- fputs(dk4uc2l_kw8[4], fipo);
- }
- if (0x00 != (ulptr->fallowed & (unsigned char)DK4_UC2L_FONT_ENCODING_T5)) {
- fputs(dk4uc2l_kw8[5], fipo);
- }
- fputc('\n', stdout);
- dk4sto_it_reset(ulptr->i_pkgs);
- do {
- pptr = (dk4_uc2l_pkg_t *)dk4sto_it_next(ulptr->i_pkgs);
- if (NULL != pptr) {
- if (0x00 != pptr->used) {
- fputs(dk4uc2l_kw8[1], fipo);
- fputs(pptr->pn, fipo);
- fputc('\n', fipo);
- }
- }
- } while (NULL != pptr);
- }
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+ $? "+ dk4uc2l_string_ansi"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ back = 1;
+ while ('\0' != *str) {
+ if (0 != dk4ansi_decode(&c32, (unsigned char)(*(str++)))) {
+ dk4uc2l_putc32(wstrm, ulptr, c32, &mm, &back, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_DECODING_FAILED);
+ back = 0;
+ }
+ }
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+ }
+ }
+
+ finished:
+ $? "- dk4uc2l_string_ansi %d", back
+ return back;
}
+/* ##### untested */
int
-dk4uc2l_retrieve_errors(dk4_uc2l_t *ulptr)
+dk4uc2l_string_ascii(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+)
+{
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+ $? "+ dk4uc2l_string_ascii"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+
+ back = 1;
+ while ('\0' != *str) {
+ c32 = (dk4_c32_t)((unsigned char)(*(str++)));
+ dk4uc2l_putc32(wstrm, ulptr, c32, &mm, &back, erp);
+ }
+ if (0 != mm) {
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], erp)) {
+ back = 0;
+ }
+ }
+
+ finished:
+ $? "- dk4uc2l_string_ascii %d", back
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_c8(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ int ie,
+ dk4_er_t *erp
+)
{
- int back = 0;
- if (NULL != ulptr) {
- back = ulptr->had_error;
- }
- return back;
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ switch (ie) {
+ case DK4_ENCODING_UTF8 : {
+ return (dk4uc2l_string_utf8(wstrm, ulptr, str, erp));
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ return (dk4uc2l_string_ansi(wstrm, ulptr, str, erp));
+ } break;
+ default : {
+ return (dk4uc2l_string_ascii(wstrm, ulptr, str, erp));
+ } break;
+ }
}
+
+/* ##### untested */
+int
+dk4uc2l_string_dk(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dkChar *str,
+#if 1 == DK4_CHAR_SIZE
+ int ie,
+#else
+ int DK4_ARG_UNUSED(ie),
+#endif
+ dk4_er_t *erp
+)
+{
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(ie)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ $? "= dk4uc2l_string_dk"
+ return (dk4uc2l_string_c32(wstrm, ulptr, str, erp));
+#else
+ $? "= dk4uc2l_string_dk"
+ return (dk4uc2l_string_c16(wstrm, ulptr, str, erp));
+#endif
+#else
+ $? "= dk4uc2l_string_dk"
+ return (dk4uc2l_string_c8(wstrm, ulptr, str, ie, erp));
+#endif
+}
+
+
+
+int
+dk4uc2l_string_encoded(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const void *str,
+ int ie,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(ie)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ switch (ie) {
+ case DK4_ENCODING_32 : { $? ". 32 bit encoding"
+ back = dk4uc2l_string_c32(wstrm, ulptr, str, erp);
+ } break;
+ case DK4_ENCODING_UTF16 : { $? ". 16 bit encoding"
+ back = dk4uc2l_string_c16(wstrm, ulptr, str, erp);
+ } break;
+ default : { $? ". 8 bit encoding"
+ back = dk4uc2l_string_c8(wstrm, ulptr, str, ie, erp);
+ } break;
+ }
+ return back;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4uc2l.h b/support/dktools/dk4uc2l.h
index 501acc8072..6e065098a5 100644
--- a/support/dktools/dk4uc2l.h
+++ b/support/dktools/dk4uc2l.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4uc2l.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4uc2l.ctr
*/
#ifndef DK4UC2L_H_INCLUDED
@@ -49,93 +27,141 @@ LaTeX sequences.
After finishing output you can write recommendations (i.e. LaTeX packages
to include, font encoding to use) as comments to the file.
+
+The functions in this module use a dk4_er_t structure to report errors
+to the calling function as good as possible.
+The functions from the dk4uc2la module use a dk4_app_t structure to
+report errors immediately.
+
+Functions from the dk4uc2la and dk4uc2l module can be used combined.
+A typical scenario is to use the dk4uc2l_open_app_ex1() function with la
+set to 1 to open a conversion structure. This will read all the data files
+and store all contained LaTeX encodings in memory when opening the structure.
+Errors - i.e. failed memory allocations or syntax error in data files - are
+reported immediately.
+Later the dk4uc2l_find() function can be used. As problematic errors like
+failed memory allocations are already reported, a NULL return value can
+only indicate a missing encoding.
*/
-#ifndef DK4ERROR_H_INCLUDED
-#include "dk4app.h"
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
+#endif
+
+#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
/** Information about a package.
*/
typedef struct {
- char *pn; /**< Package name. */
- unsigned char used; /**< Flag: Package used. */
+ char *pn; /**< Package name. */
+ unsigned char used; /**< Flag: Package used. */
} dk4_uc2l_pkg_t;
+/** Pointer to a package or an array of packages.
+*/
+typedef dk4_uc2l_pkg_t *dk4_uc2l_pkg_p;
+
+/** Pointer to an array of package pointers.
+*/
+typedef dk4_uc2l_pkg_p *dk4_uc2l_pkg_pp;
+
/** Data for contents of one file.
The structure contains information about the character
ranges covered by the file.
*/
typedef struct {
- dkChar *fn; /**< Short file name. */
- unsigned char loaded; /**< Flag: File loaded. */
+ dkChar *fn; /**< Short file name. */
+ unsigned char loaded; /**< Flag: File loaded. */
} dk4_uc2l_file_t;
/** Range of characters.
*/
typedef struct {
- dk4_uc2l_file_t *file; /**< File containing data. */
- char **both; /**< LaTeX text both modes. */
- char **text; /**< LaTeX text text mode. */
- char **math; /**< LaTeX text math mode. */
- dk4_uc2l_pkg_t ***pkgs; /**< Packages for characters. */
- unsigned char *fenc; /**< Required font encodings. */
- dk4_c32_t start; /**< First character of range. */
- dk4_c32_t end; /**< Final character of range. */
- unsigned char ia; /**< Flag: Initialisation att. */
+ dk4_uc2l_file_t *file; /**< File containing data. */
+ char **both; /**< LaTeX text both modes. */
+ char **text; /**< LaTeX text text mode. */
+ char **math; /**< LaTeX text math mode. */
+ dk4_uc2l_pkg_t ***pkgs; /**< Packages for characters. */
+ unsigned char *fenc; /**< Required font encodings. */
+ dk4_um_t *lno; /**< Line numbers. */
+ dk4_c32_t start; /**< First character of range. */
+ dk4_c32_t end; /**< Final character of range. */
+ unsigned char ia; /**< Flag: Initialisation att. */
} dk4_uc2l_range_t;
/** Text to LaTeX conversion structure.
*/
typedef struct {
- char buf[16]; /**< Buffer for direct output. */
- const dkChar * const *msgs; /**< Localized messages */
- dkChar *dname; /**< Directory name. */
- dk4_sto_t *s_ranges; /**< Ranges container. */
- dk4_sto_it_t *i_ranges; /**< Ranges container iterator. */
- dk4_sto_t *s_files; /**< Files container. */
- dk4_sto_it_t *i_files; /**< Files container iterator. */
- dk4_sto_t *s_pkgs; /**< Package information container. */
- dk4_sto_it_t *i_pkgs; /**< Package information iterator. */
- size_t szmsgs; /**< Number of messages in msgs. */
- int had_error; /**< Flag: Errors occured. */
- unsigned char utf8allowed; /**< Flag: UTF-8 output allowed. */
- unsigned char fallowed; /**< Allowed font encodings. */
+ char buf[16]; /**< Buffer for direct output. */
+ dkChar *dname; /**< Directory name. */
+ dk4_sto_t *s_ranges; /**< Ranges container. */
+ dk4_sto_it_t *i_ranges; /**< Ranges container iterator. */
+ dk4_sto_t *s_files; /**< Files container. */
+ dk4_sto_it_t *i_files; /**< Files container iterator. */
+ dk4_sto_t *s_pkgs; /**< Package information container. */
+ dk4_sto_it_t *i_pkgs; /**< Package information iterator. */
+ int had_error; /**< Flag: Errors occured. */
+ unsigned char utf8allowed; /**< Flag: UTF-8 output allowed. */
+ unsigned char fallowed; /**< Allowed font encodings. */
} dk4_uc2l_t;
/** Font encodings
*/
enum {
- /** OT1 font encoding.
- */
- DK4_UC2L_FONT_ENCODING_OT1 = 1 ,
-
- /** T1 font encoding.
- */
- DK4_UC2L_FONT_ENCODING_T1 = 2 ,
-
- /** T4 font encoding.
- */
- DK4_UC2L_FONT_ENCODING_T4 = 4 ,
-
- /** T5 font encoding.
- */
- DK4_UC2L_FONT_ENCODING_T5 = 8 ,
-
- DK4_UC2L_FONT_ENCODING_ALL = (
- 0
- | DK4_UC2L_FONT_ENCODING_OT1
- | DK4_UC2L_FONT_ENCODING_T1
- | DK4_UC2L_FONT_ENCODING_T4
- | DK4_UC2L_FONT_ENCODING_T5
- )
+ /** OT1 font encoding.
+ */
+ DK4_UC2L_FONT_ENCODING_OT1 = 1 ,
+
+ /** T1 font encoding.
+ */
+ DK4_UC2L_FONT_ENCODING_T1 = 2 ,
+
+ /** T4 font encoding.
+ */
+ DK4_UC2L_FONT_ENCODING_T4 = 4 ,
+
+ /** T5 font encoding.
+ */
+ DK4_UC2L_FONT_ENCODING_T5 = 8 ,
+
+ /** All encodings mentioned above.
+ */
+ DK4_UC2L_FONT_ENCODING_ALL = (
+ 0
+ | DK4_UC2L_FONT_ENCODING_OT1
+ | DK4_UC2L_FONT_ENCODING_T1
+ | DK4_UC2L_FONT_ENCODING_T4
+ | DK4_UC2L_FONT_ENCODING_T5
+ )
};
@@ -144,25 +170,25 @@ enum {
*/
enum {
- /** Memory allocation failed.
- */
- DK4_UC2L_ERROR_MEMORY = 1 ,
+ /** Memory allocation failed.
+ */
+ DK4_UC2L_ERROR_MEMORY = 1 ,
- /** Syntax error in configuration file.
- */
- DK4_UC2L_ERROR_SYNTAX = 2 ,
+ /** Syntax error in configuration file.
+ */
+ DK4_UC2L_ERROR_SYNTAX = 2 ,
- /** Decoding error in configuration file.
- */
- DK4_UC2L_ERROR_DECODING = 4 ,
+ /** Decoding error in configuration file.
+ */
+ DK4_UC2L_ERROR_DECODING = 4 ,
- /** Other processing errors while reading data.
- */
- DK4_UC2L_ERROR_PROCESSING = 8 ,
+ /** Other processing errors while reading data.
+ */
+ DK4_UC2L_ERROR_PROCESSING = 8 ,
- /** Failed to open one of the data files.
- */
- DK4_UC2L_ERROR_FOPEN = 16 ,
+ /** Failed to open one of the data files.
+ */
+ DK4_UC2L_ERROR_FOPEN = 16 ,
};
@@ -171,30 +197,13 @@ enum {
extern "C" {
#endif
-/** Open conversion structure, dynamically allocate memory.
- @param dn Directory name containing the data files.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to conversion structure on success, NULL on error.
-
- Use dk4uc2l_close() to close the conversion structure when done
- with it.
+/** Open conversion structure.
+ @param dn Directory containing the data files.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
*/
dk4_uc2l_t *
-dk4uc2l_open(const dkChar *dn, dk4_app_t *app);
-
-
-/** Open conversion structure, dynamically allocate memory.
- The directory containing the data files is obtained from
- the application (if not NULL), ${datarootdir}/dktools/charmap
- is used by default.
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to conversion structure on success, NULL on error.
-
- Use dk4uc2l_close() to close the conversion structure when done
- with it.
-*/
-dk4_uc2l_t *
-dk4uc2l_open_from_app(dk4_app_t *app);
+dk4uc2l_open(const dkChar *dn, dk4_er_t *erp);
/** Close conversion structure, release memory.
@param ulptr Conversion structure to close.
@@ -202,6 +211,16 @@ dk4uc2l_open_from_app(dk4_app_t *app);
void
dk4uc2l_close(dk4_uc2l_t *ulptr);
+/** Find LaTeX encoding for one 32 bit character.
+ @param ulptr Conversion structure.
+ @param c Character to search encoding for.
+ @param mm Flag: Math mode (1) or text mode (0).
+ @param erp Error report, may be NULL.
+ @return Pointer to encoding string on success, NULL on error.
+*/
+const char *
+dk4uc2l_find(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_er_t *erp);
+
/** Enable or disable direct UTF-8 output.
If you use usepackage[utf-8]{inputenc} you might want to
enable UTF-8 output.
@@ -220,16 +239,6 @@ dk4uc2l_allow_utf8(dk4_uc2l_t *ulptr, int enabled);
void
dk4uc2l_clean_packages_and_fonts(dk4_uc2l_t *ulptr);
-/** Find LaTeX encoding for one 32 bit character.
- @param ulptr Conversion structure.
- @param c Character to search encoding for.
- @param mm Flag: Math mode (1) or text mode (0).
- @param app Application structure for diagnostics, may be NULL.
- @return Pointer to encoding string on success, NULL on error.
-*/
-const char *
-dk4uc2l_find(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app);
-
/** Retrieve or-combination of all allowed font encodings.
You should use this function after processing all characters.
*/
@@ -246,10 +255,11 @@ dk4uc2lat_direct(dk4_c32_t c32);
/** Issue recommendations about font encodings and packages.
Use this function after processing all characters.
@param ulptr Conversion structure.
- @param fipo File to write to.
+ @param wstrm Destination stream to write to.
+ @param erp Error report, may be NULL.
*/
void
-dk4uc2l_recommendations(dk4_uc2l_t *ulptr, FILE *fipo);
+dk4uc2l_recommendations(dk4_uc2l_t *ulptr, dk4_stream_t *wstrm, dk4_er_t *erp);
/** Retrieve internal error status from conversion structure.
@param ulptr Conversion structure.
@@ -260,6 +270,146 @@ dk4uc2l_recommendations(dk4_uc2l_t *ulptr, FILE *fipo);
int
dk4uc2l_retrieve_errors(dk4_uc2l_t *ulptr);
+/** Retrieve internal error status from conversion structure.
+ @param ulptr Conversion structure.
+ @return Error status, 0 or combination of DK4_UC2L_ERROR_MEMORY,
+ DK4_UC2L_ERROR_SYNTAX, DK4_UC2L_ERROR_DECODING,
+ DK4_UC2L_ERROR_PROCESSING, and DK4_UC2L_ERROR_FOPEN.
+*/
+void
+dk4uc2l_reset_errors(dk4_uc2l_t *ulptr);
+
+/** Write dkChar string LaTeX encoded to stream.
+ The method is primarily selected by DK4_CHAR_SIZE.
+ Use this function if you want to output a dkChar string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String.
+ @param ie Input encoding, only used if dkChar is char.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_dk(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dkChar *str,
+ int ie,
+ dk4_er_t *erp
+);
+
+/** Write encoded string LaTeX encoded to stream.
+ The method is selected by the ie parameter.
+ Use this function if your string is not necessarily a dkChar string
+ but you know the encoding.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String.
+ @param ie Input encoding, only used if dkChar is char.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_encoded(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const void *str,
+ int ie,
+ dk4_er_t *erp
+);
+
+/** Write dk4_c32_t string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c32(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c32_t *str,
+ dk4_er_t *erp
+);
+
+/** Write UTF-16 encoded dk_c32_t string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c16(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c16_t *str,
+ dk4_er_t *erp
+);
+
+/** Write UTF-8 encoded char string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_utf8(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+);
+
+/** Write ANSI encoded char string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_ansi(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+);
+
+/** Write ASCII encoded char string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_ascii(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_er_t *erp
+);
+
+/** Write char string LaTeX encoded to stream.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param ie Input encoding.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c8(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ int ie,
+ dk4_er_t *erp
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dk4uc2la.c b/support/dktools/dk4uc2la.c
new file mode 100644
index 0000000000..855e157ac5
--- /dev/null
+++ b/support/dktools/dk4uc2la.c
@@ -0,0 +1,2445 @@
+/*
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4uc2la.ctr
+*/
+
+/** @file dk4uc2la.c The dk4uc2la module.
+*/
+
+
+#line 250 "dk4uc2la.ctr"
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_STRING_H
+#ifndef STRING_H_INCLUDED
+#include <string.h>
+#define STRING_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4const.h"
+#include "dk4uc2la.h"
+#include "dk4mem.h"
+#include "dk4mema.h"
+#include "dk4str8.h"
+#include "dk4strd.h"
+#include "dk4utf8.h"
+#include "dk4utf16.h"
+#include "dk4ansi.h"
+#include "dk4maasz.h"
+#include "dk4filed.h"
+#include "dk4mpl.h"
+#include "dk4strm.h"
+#include "dk4strmr.h"
+#include "dk4dir.h"
+#include "dk4dira.h"
+#include "dk4pathd.h"
+#include "dk4tsp08.h"
+#include "dk4enc.h"
+#include "dk4mai8hul.h"
+#include "dk4maodh.h"
+#include "dk4maodd.h"
+#include "dk4unused.h"
+#include "dk4rec26.h"
+#include "uc2l.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 298 "dk4uc2la.ctr"
+
+
+
+/** Convert to unsigned long.
+*/
+#define UL(x) ((unsigned long)(x))
+
+
+
+/** Object to use and modify from line handler.
+*/
+typedef struct {
+ dk4_uc2l_t *ulptr; /**< Conversion structure. */
+ dk4_sto_t *s_ra; /**< Local range storage. */
+ dk4_sto_it_t *i_ra; /**< Local range iterator. */
+ dk4_uc2l_file_t *file; /**< File structure. */
+ dk4_uc2l_range_t *rpc; /**< Range pointer cache, pass 2. */
+ dk4_app_t *app; /**< Application structure. */
+ const dkChar * const *msgs; /**< Localized message texts. */
+ size_t szmsgs; /**< Number of elements in msgs. */
+ int e_d; /**< Reported decoding errors. */
+ int e_e; /**< Reported encoding errors. */
+ int e_p; /**< Reported processing errors. */
+} handler_object_t;
+
+
+
+/** Fixed keywords used by the module, not localized.
+*/
+static const dkChar * const dk4uc2l_kwnl[] = {
+/* 0 */
+dkT("dir.charmap"),
+
+/* 1 */
+dkT("/dktools/charmap"),
+
+/* 2 */
+dkT("/dk4app/charmap"),
+
+/* 3 */
+dkT("/dk3app/charmap"),
+
+/* 4 */
+dkT(".t2l"),
+
+/* 5 */
+dkT(".t2l.gz"),
+
+/* 6 */
+dkT(".t2l.bz2"),
+
+/* 7 */
+dkT("/"),
+
+/* 8 */
+dkT("dk4uc2l.str"),
+
+NULL
+
+
+#line 354 "dk4uc2la.ctr"
+};
+
+
+
+/** Localized texts.
+*/
+static const dkChar * const dk4uc2l_kw_def[] = {
+/* 0 */
+dkT("Syntax error!\n\tHexadecimal number required at start of line!"),
+
+/* 1 */
+dkT("Syntax error!\n\tHexadecimal value outside allowed 32 bit range!"),
+
+/* 2 */
+dkT("Syntax error!\n\tIgnoring redefinition of 0x"),
+
+/* 3 */
+dkT("!"),
+
+/* 4 */
+dkT("Syntax error!\n\tIgnoring redefinition of character!"),
+
+/* 5 */
+dkT("Failed to set up text processing!"),
+
+/* 6 */
+dkT("Failed to open file for reading:\n\t\""),
+
+/* 7 */
+dkT("\"!"),
+
+/* 8 */
+dkT("Syntax error!\n\tIllegal font encoding name!"),
+
+/* 9 */
+dkT("Syntax error!\n\t1 to 15 packages names are allowed!"),
+
+/* 10 */
+dkT("Syntax error!\n\tIllegal attribute name!"),
+
+/* 11 */
+dkT("Syntax error!\n\tAttribute specified without value!"),
+
+/* 12 */
+dkT("Conversion to UTF-8 failed for 0x"),
+
+/* 13 */
+dkT("!"),
+
+/* 14 */
+dkT("Conversion to UTF-8 failed for a character!"),
+
+/* 15 */
+dkT("No directory for character mapping information found!"),
+
+/* 16 */
+dkT("Decoding failed!\n\tByte:"),
+
+/* 17 */
+dkT("Encoding failed!\n\tByte:"),
+
+/* 18 */
+dkT("Processing failed!\n\tByte:"),
+
+/* 19 */
+dkT(",\n\tCharacter:"),
+
+/* 20 */
+dkT(",\n\tPosition in line:"),
+
+/* 21 */
+dkT("."),
+
+/* 22 */
+dkT("Decoding failed!"),
+
+/* 23 */
+dkT("Encoding failed!"),
+
+/* 24 */
+dkT("Processing failed!"),
+
+/* 25 */
+dkT("Further decoding failures!"),
+
+/* 26 */
+dkT("Further encoding failures!"),
+
+/* 27 */
+dkT("Further processing failures!"),
+
+/* 28 */
+dkT("Syntax error!\n\tIgnoring redefinition of 0x"),
+
+/* 29 */
+dkT("\n\tpreviously defined in \""),
+
+/* 30 */
+dkT("\"!"),
+
+/* 31 */
+dkT("No LaTeX encoding found for U+"),
+
+/* 32 */
+dkT("!"),
+
+NULL
+
+
+#line 444 "dk4uc2la.ctr"
+};
+
+
+
+/** Opening and closing tag for math mode.
+*/
+static const char * const dk4uc2l_mm[] = {
+"\\(", "\\)"
+};
+
+
+
+
+/** Handler to process a line during pass 1.
+ @param obj Object to use and modify during processing.
+ @param line Current text line to process.
+ @param lineno Current line number.
+ @param erp Error report, may be NULL.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on recoverable
+ errors, DK4_TSP_RES_FATAL on fatal errors requiring an abort.
+*/
+static
+int
+dk4uc2l_handler_pass1(
+ void *obj,
+ char *line,
+ dk4_um_t lineno,
+ dk4_er_t *erp
+)
+{
+ dkChar numbuf[16*sizeof(dk4_um_t)];
+ handler_object_t *pho;
+ char *p1;
+ dk4_uc2l_range_t *rptr;
+ dk4_uc2l_range_t *r2;
+ const char *pe = NULL;
+ size_t sznb = DK4_SIZEOF(numbuf,dkChar);
+ size_t padsz = 8;
+ unsigned long ul = 0UL;
+ dk4_c32_t c32;
+ dk4_c32_t rbo;
+ int res;
+ int back = DK4_TSP_RES_OK;
+#if TRACE_DEBUG
+ dk4str8_delnl(line);
+#endif
+
+
+#line 491 "dk4uc2la.ctr"
+ pho = (handler_object_t *)obj;
+ dk4app_set_log_source_line(pho->app, lineno);
+
+ /* Find start of line, ignore empty lines and comments
+ */
+ p1 = dk4str8_start(line, NULL);
+ if (NULL == p1) {
+ goto finished;
+ }
+ if ('#' == *p1) {
+ goto finished;
+ }
+
+ /* Retrieve hexadecimal number at start
+ */
+ (void)dk4str8_next(p1, NULL);
+ res = dk4ma_input_c8_hex_ulong(&ul, p1, &pe, 1, erp);
+ if (0 == res) {
+ /* ERROR: Syntax, not a number */
+ dk4app_log_1(pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ c32 = (dk4_c32_t)ul;
+
+#line 514 "dk4uc2la.ctr"
+
+ /* Check for number in global storage
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->ulptr->i_ranges, &c32, 1
+ );
+ if (NULL != rptr) {
+
+#line 521 "dk4uc2la.ctr"
+ /* ERROR: Ignoring redefinition */
+ if ((dk4_c32_t)0xFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFFFUL < c32) {
+ padsz = 8;
+ }
+ else {
+ padsz = 6;
+ }
+ }
+ else {
+ padsz = 4;
+ }
+ }
+ else {
+ padsz = 2;
+ }
+ if (0 != dk4ma_write_hex_unsigned(numbuf, sznb, c32, padsz, NULL)) {
+ dk4app_log_5(
+ pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR,
+ 28, 29, 30, numbuf, rptr->file->fn
+ );
+ }
+ else {
+ dk4app_log_1(pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR, 4);
+ }
+ goto finished;
+ }
+
+ /* Check for number in storage for file
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &c32, 1);
+ if (NULL != rptr) {
+
+#line 554 "dk4uc2la.ctr"
+ /* ERROR: Ignoring redefinition */
+ if ((dk4_c32_t)0xFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFFFUL < c32) {
+ padsz = 8;
+ }
+ else {
+ padsz = 6;
+ }
+ }
+ else {
+ padsz = 4;
+ }
+ }
+ else {
+ padsz = 2;
+ }
+ if (0 != dk4ma_write_hex_unsigned(numbuf, sznb, c32, padsz, NULL)) {
+ dk4app_log_3(
+ pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
+ );
+ }
+ else {
+ dk4app_log_1(pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR, 4);
+ }
+ goto finished;
+ }
+
+ /* Check whether appending to an existing range
+ */
+ if (0UL < c32) {
+ rbo = c32 - 1UL;
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &rbo, 1);
+ if (NULL != rptr) {
+ rptr->end = c32;
+#if DK4_SIZEOF_LONG <= 4
+ if ((dk4_um_t)(ULONG_MAX) > (dk4_um_t)c32) {
+#endif
+ rbo = c32 + 1UL;
+ r2 = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->i_ra, &rbo, 1
+ );
+ if (NULL != r2) {
+ dk4sto_remove(pho->s_ra, r2, NULL);
+ rptr->end = r2->end;
+ dk4uc2l_i_close_range(r2);
+ }
+#if DK4_SIZEOF_LONG <= 4
+ }
+#endif
+ goto finished;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 608 "dk4uc2la.ctr"
+ }
+#endif
+ }
+
+ /* Check whether prepending to an existing range
+ */
+#if DK4_SIZEOF_LONG <= 4
+ if ((dk4_um_t)(ULONG_MAX) > (dk4_um_t)c32) {
+#endif
+ rbo = c32 + 1UL;
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &rbo, 1);
+ if (NULL != rptr) {
+ rptr->start = c32;
+ if ((dk4_c32_t)0UL < c32) {
+ rbo = c32 - 1UL;
+ r2 = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->i_ra, &rbo, 1
+ );
+ if (NULL != r2) {
+ dk4sto_remove(pho->s_ra, r2, NULL);
+ rptr->start = r2->start;
+ dk4uc2l_i_close_range(r2);
+ }
+ }
+ goto finished;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 636 "dk4uc2la.ctr"
+ }
+#endif
+#if DK4_SIZEOF_LONG <= 4
+ }
+#endif
+
+ /* Create new range for one character on its own
+ */
+ rptr = dk4uc2l_i_open_range(c32, pho->file, erp);
+ if (NULL == rptr) {
+ back = DK4_TSP_RES_FATAL;
+ /* ERROR: Memory */
+ dk4app_log_base1(pho->app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+ if (0 == dk4sto_add(pho->s_ra, rptr, erp)) {
+ dk4uc2l_i_close_range(rptr);
+ /* ERROR: Memory */
+ dk4app_log_base1(pho->app, DK4_LL_ERROR, 90);
+ back = DK4_TSP_RES_FATAL;
+ }
+
+ finished:
+
+
+#line 660 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+/** Report an error with position in source line.
+ @param i1 Index of first message part in array.
+ @param i2 Index of alternative first message part.
+ @param bno Byte processed.
+ @param lno Current line number.
+ @param cno Current character number.
+ @param cil Current character number in line.
+ @param dmsg Localized error message texts.
+ @param szdmsg Number of elements in dmsg array.
+*/
+static
+void
+dk4uc2l_report_with_pos(
+ dk4_app_t *app,
+ size_t i1,
+ size_t i2,
+ dk4_um_t bno,
+ dk4_um_t lno,
+ dk4_um_t cno,
+ dk4_um_t cil,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dkChar b1[8*(1+sizeof(dk4_um_t))];
+ dkChar b2[DK4_SIZEOF(b1,dkChar)];
+ dkChar b3[DK4_SIZEOF(b1,dkChar)];
+ size_t szbuf = DK4_SIZEOF(b1,dkChar);
+ dk4_um_t oldlogline = (dk4_um_t)0UL;
+ int allbuffersok = 0;
+
+ oldlogline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_line(app, lno);
+ if (0 != dk4ma_write_decimal_unsigned(b3, szbuf, cil, 0, NULL)) {
+ if (0 != dk4ma_write_decimal_unsigned(b2, szbuf, cno, 0, NULL)) {
+ if (0 != dk4ma_write_decimal_unsigned(b1, szbuf, bno, 0, NULL)) {
+ allbuffersok = 1;
+ }
+ }
+ }
+ if (0 != allbuffersok) {
+ dk4app_log_7(
+ app, dmsg, szdmsg, DK4_LL_ERROR, i1, 19, 20, 21, b1, b2, b3
+ );
+ }
+ else {
+ dk4app_log_1(
+ app, dmsg, szdmsg, DK4_LL_ERROR, i2
+ );
+ }
+ dk4app_set_log_source_line(app, oldlogline);
+}
+
+
+
+/** Report errors from text stream processing.
+ @param app Application structure, may be NULL.
+ @param obj Object modified by line handler.
+ @param er_en Error report for decoding and encoding errors.
+ @param er_pr Error report for processing errors.
+ @param dmsg Localized error message texts.
+ @param szmsg Number of elements in dmsg array.
+*/
+static
+void
+dk4uc2l_report_errors(
+ dk4_app_t *app,
+ handler_object_t *obj,
+ dk4_er_t *er_en,
+ dk4_er_t *er_pr,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ if (NULL != er_en) {
+ switch (er_en->ec) {
+ case DK4_E_DECODING_FAILED: {
+ switch (obj->e_d) {
+ case 0: case 1: {
+ dk4uc2l_report_with_pos(
+ app, 16, 22,
+ er_en->dt.fpos.byteno,
+ er_en->dt.fpos.lineno,
+ er_en->dt.fpos.charno,
+ er_en->dt.fpos.charinline,
+ dmsg, szdmsg
+ );
+ } break;
+ case 2: {
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 25); } break; }
+ if (3 > obj->e_d) { obj->e_d += 1; }
+ } break;
+ case DK4_E_ENCODING_FAILED: {
+ switch (obj->e_e) {
+ case 0: case 1: {
+ dk4uc2l_report_with_pos(
+ app, 17, 23,
+ er_en->dt.fpos.byteno,
+ er_en->dt.fpos.lineno,
+ er_en->dt.fpos.charno,
+ er_en->dt.fpos.charinline,
+ dmsg, szdmsg
+ );
+ } break;
+ case 2: {
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 26);
+ } break;
+ }
+ if (3 > obj->e_e) { obj->e_e += 1; }
+ } break;
+ }
+ }
+ if (NULL != er_pr) {
+ if (DK4_E_NONE != er_pr->ec) {
+ switch (obj->e_p) {
+ case 0: case 1: {
+ dk4uc2l_report_with_pos(
+ app, 18, 24,
+ er_pr->dt.fpos.byteno,
+ er_pr->dt.fpos.lineno,
+ er_pr->dt.fpos.charno,
+ er_pr->dt.fpos.charinline,
+ dmsg, szdmsg
+ );
+ } break;
+ case 2: {
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 27);
+ } break;
+ }
+ if (3 > obj->e_p) { obj->e_p += 1; }
+ }
+ }
+}
+
+
+/** Process one stream from file in pass 1.
+ @param ulptr Conversion structure to set up.
+ @param rstrm Stream to read data from.
+ @param puc2lf File structure.
+ @param bptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics.
+ @param dmsg Localized messages texts.
+ @param szdmsg Size of dmsg array (number of string pointers).
+*/
+static
+void
+dk4uc2l_i_process_stream_pass1(
+ dk4_uc2l_t *ulptr,
+ dk4_stream_t *rstrm,
+ dk4_uc2l_file_t *puc2lf,
+ int *bptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ char lnbuf[256];
+ dk4_tsp08_t tsp08;
+ handler_object_t ho;
+ dk4_er_t er_en;
+ dk4_er_t er_pr;
+ dk4_uc2l_range_t *rptr;
+ int res;
+ int cc;
+ char c;
+
+
+#line 831 "dk4uc2la.ctr"
+
+ /* Initialize handler object
+ */
+ ho.file = puc2lf;
+ ho.ulptr = ulptr;
+ ho.s_ra = NULL;
+ ho.i_ra = NULL;
+ ho.app = app;
+ ho.msgs = dmsg;
+ ho.szmsgs = szdmsg;
+ ho.e_d = 0;
+ ho.e_e = 0;
+ ho.e_p = 0;
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+
+ /* Allocate storage and iterator
+ */
+ ho.s_ra = dk4sto_open(NULL);
+ if (NULL == ho.s_ra) {
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+ dk4sto_set_comp(ho.s_ra, dk4uc2l_i_range_compare, 0);
+ ho.i_ra = dk4sto_it_open(ho.s_ra, NULL);
+ if (NULL == ho.i_ra) {
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+
+ /* Initialize text stream processor
+ */
+ res = dk4tsp08_setup_line(
+ &tsp08, (void *)(&ho), dk4uc2l_handler_pass1, lnbuf, sizeof(lnbuf),
+ DK4_ENCODING_PLAIN, DK4_ENCODING_PLAIN, NULL
+ );
+ if (0 == res) {
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ /* ERROR: Failed to initialize text stream processor */
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 5);
+ goto finished;
+ }
+
+ /* Process input data
+ */
+ do {
+ cc = 0;
+ res = dk4stream_c8_read_byte(&c, rstrm, NULL);
+ if (0 != res) {
+ cc = 1;
+ res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ } break;
+ case DK4_TSP_RES_FATAL : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ goto finished;
+ } break;
+ }
+ }
+ } while (0 < cc);
+
+ /* Finalize text stream processor
+ */
+ res = dk4tsp08_finish(&tsp08);
+ switch (res) {
+ case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ goto finished;
+ } break;
+ }
+
+ /* Transfer ranges to global storage
+ */
+ do {
+ dk4sto_it_reset(ho.i_ra);
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ho.i_ra);
+ if (NULL != rptr) {
+ dk4sto_remove(ho.s_ra, rptr, NULL);
+ if (0 == dk4sto_add(ulptr->s_ranges, rptr, NULL)) {
+ dk4uc2l_i_close_range(rptr);
+ *bptr = 0;
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+ }
+ } while (NULL != rptr);
+
+ /* Release resources
+ */
+ finished:
+ if (NULL != ho.s_ra) {
+ if (NULL != ho.i_ra) {
+ dk4sto_it_reset(ho.i_ra);
+ do {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ho.i_ra);
+ if (NULL != rptr) {
+ dk4uc2l_i_close_range(rptr);
+ }
+ } while (NULL != rptr);
+ dk4sto_it_close(ho.i_ra);
+ }
+ dk4sto_close(ho.s_ra);
+ }
+
+
+
+#line 965 "dk4uc2la.ctr"
+}
+
+
+
+
+/** Process one file in pass 1 specified by absolute path name.
+ @param ulptr Conversion structure to set up.
+ @param fn Absolute file name.
+ @param sfn Short (relative) file name within given directory.
+ @param bptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics.
+ @param dmsg Localized messages texts.
+ @param szdmsg Size of dmsg array (number of string pointers).
+*/
+static
+void
+dk4uc2l_i_process_one_full_file_pass1(
+ dk4_uc2l_t *ulptr,
+ const dkChar *fn,
+ const dkChar *sfn,
+ int *bptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ const dkChar *oldsourcefile;
+ dk4_stream_t *rstrm;
+ dk4_uc2l_file_t *puc2lf;
+ dk4_um_t oldsourceline;
+ int fnsi;
+
+
+#line 997 "dk4uc2la.ctr"
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ puc2lf = (dk4_uc2l_file_t *)dk4sto_it_find_like(ulptr->i_files, sfn, 1);
+ if (NULL == puc2lf) {
+ puc2lf = dk4uc2l_i_open_file(sfn, NULL);
+ if (NULL != puc2lf) {
+ if (0 != dk4sto_add(ulptr->s_files, puc2lf, NULL)) {
+ fnsi = dk4uc2l_i_find_suffix_index(fn);
+ if (-1 < fnsi) {
+ if (0 != dk4uc2l_i_suffix_index_supported(fnsi)) {
+ rstrm = dk4stream_open_file_reader(fn, NULL);
+ if (NULL != rstrm) {
+ dk4uc2l_i_process_stream_pass1(
+ ulptr, rstrm, puc2lf, bptr, app, dmsg, szdmsg
+ );
+ dk4stream_close(rstrm, NULL);
+ }
+ else {
+
+#line 1017 "dk4uc2la.ctr"
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ /* ERROR: Failed to read file */
+ dk4app_log_3(app,dmsg,szdmsg,DK4_LL_ERROR,6,7,fn);
+ *bptr = 0;
+ }
+ }
+ else {
+
+#line 1024 "dk4uc2la.ctr"
+ /* ERROR: Unsupported compression mechanism */
+ dk4app_log_3(app,dmsg,szdmsg,DK4_LL_ERROR,6,7,fn);
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ *bptr = 0;
+ }
+ }
+ else {
+
+#line 1031 "dk4uc2la.ctr"
+ /* Warning: Unsupported file type */
+ dk4app_log_3(app,dmsg,szdmsg,DK4_LL_ERROR,6,7,fn);
+ }
+ }
+ else {
+
+#line 1036 "dk4uc2la.ctr"
+ dk4uc2l_i_close_file(puc2lf);
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+
+#line 1042 "dk4uc2la.ctr"
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+
+#line 1047 "dk4uc2la.ctr"
+ /* BUG file already processed */
+ }
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+
+
+#line 1052 "dk4uc2la.ctr"
+}
+
+
+
+/** Process one file in pass 1.
+ @param ulptr Conversion structure to set up.
+ @param pth Directory path name, may be NULL.
+ @param fn Short file name within given directory.
+ @param bptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics.
+ @param dmsg Localized messages texts.
+ @param szdmsg Size of dmsg array (number of string pointers).
+*/
+static
+void
+dk4uc2l_i_process_one_file_pass1(
+ dk4_uc2l_t *ulptr,
+ const dkChar *pth,
+ const dkChar *fn,
+ int *bptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+
+
+#line 1080 "dk4uc2la.ctr"
+ if (NULL != pth) {
+ if (0 != dk4str_cpy_s(fnb, szfnb, pth, NULL)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, dk4uc2l_kwnl[7], NULL)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, fn, NULL)) {
+ dk4path_correct_sep(fnb);
+ dk4uc2l_i_process_one_full_file_pass1(
+ ulptr, fnb, fn, bptr, app, dmsg, szdmsg
+ );
+ }
+ else {
+ *bptr = 0;
+ /* ERROR pth and/or fn too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
+ }
+ }
+ else {
+ *bptr = 0;
+ /* ERROR: pth too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
+ }
+ }
+ else {
+ *bptr = 0;
+ /* ERROR: pth too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
+ }
+ }
+ else {
+ dk4uc2l_i_process_one_full_file_pass1(ulptr,fn,fn,bptr,app,dmsg,szdmsg);
+ }
+
+
+#line 1111 "dk4uc2la.ctr"
+}
+
+
+
+/** First pass to gather information which Unicode position is configured
+ in which data file.
+ This function is run while creating a new conversion structure
+ to fill the range structures so we can later find a file for a
+ Unicode position.
+ If this function fails, the conversion structure is considered
+ unusable.
+ The function fails only on memory allocation failures.
+ Syntax errors in translation files are reported as errors through
+ app, but the function indicates success.
+ @param ulptr Conversion structure.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4uc2l_i_pass1(
+ dk4_uc2l_t *ulptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ const dkChar *fn = NULL;
+ const dkChar *pth = NULL;
+ dk4_dir_t *pdir = NULL;
+ int back = 0;
+
+
+#line 1143 "dk4uc2la.ctr"
+ pdir = dk4dir_open_app(ulptr->dname, 0, app);
+ if (NULL != pdir) {
+ pth = dk4dir_get_path(pdir);
+ back = 1;
+ do {
+ fn = dk4dir_next_file(pdir);
+ if (NULL != fn) {
+ if (-1 < dk4uc2l_i_find_suffix_index(fn)) {
+ dk4uc2l_i_process_one_file_pass1(
+ ulptr, pth, fn, &back, app, dmsg, szdmsg
+ );
+ }
+ }
+ } while (NULL != fn);
+ dk4dir_close(pdir);
+ }
+ else {
+
+#line 1160 "dk4uc2la.ctr"
+ /* ERROR: Failed to open directory (already reported) */
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ }
+
+
+#line 1164 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+/** Handler to process a line during pass 1.
+ @param obj Object to use and modify during processing.
+ @param line Current text line to process.
+ @param lineno Current line number.
+ @param erp Error report, may be NULL.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on recoverable
+ errors, DK4_TSP_RES_FATAL on fatal errors requiring an abort.
+*/
+static
+int
+dk4uc2l_handler_pass2(
+ void *obj,
+ char *line,
+ dk4_um_t lineno,
+ dk4_er_t * DK4_ARG_UNUSED(erp)
+)
+{
+ dk4_er_t er;
+ char *pkgn[16];
+ handler_object_t *lho = NULL;
+ const char *pe = NULL;
+ char *p1 = NULL;
+ char *p2 = NULL;
+ char *p3 = NULL;
+ char *p4 = NULL;
+ dk4_uc2l_range_t *rptr = NULL;
+ dk4_uc2l_pkg_t *pptr = NULL;
+ size_t ind = 0;
+ size_t numpkg = 0;
+ size_t i = 0;
+ unsigned long ul = 0UL;
+ dk4_c32_t c32 = (dk4_c32_t)0UL;
+ int back = DK4_TSP_RES_OK;
+ int res = 0;
+ int adding = 0;
+ unsigned char fex = 0;
+ unsigned char feval = 0;
+
+ DK4_UNUSED_ARG(erp)
+
+
+#line 1209 "dk4uc2la.ctr"
+#if TRACE_DEBUG
+ dk4str8_delnl(line);
+
+
+#line 1212 "dk4uc2la.ctr"
+#endif
+
+ /* Line handler object
+ */
+ lho = (handler_object_t *)obj;
+ dk4app_set_log_source_line(lho->app, lineno);
+
+ /* Find start of line, ignore empty lines and comments
+ */
+ p1 = dk4str8_start(line, NULL);
+ if (NULL == p1) {
+
+#line 1223 "dk4uc2la.ctr"
+ goto finished;
+ }
+ if ('#' == *p1) {
+
+#line 1226 "dk4uc2la.ctr"
+ goto finished;
+ }
+
+ /* Retrieve character number
+ */
+ p2 = dk4str8_next(p1, NULL);
+ res = dk4ma_input_c8_hex_ulong(&ul, p1, &pe, 1, NULL);
+ if (0 == res) {
+
+#line 1234 "dk4uc2la.ctr"
+ /* WARNING: Syntax, no number.
+ Already reported in pass 1.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+ c32 = (dk4_c32_t)ul;
+
+ /* Find and check range structure, attempt cached range pointer first
+ */
+ if (NULL != lho->rpc) {
+ if ((lho->rpc->start <= c32) && (c32 <= lho->rpc->end)) {
+ rptr = lho->rpc;
+ }
+ }
+ if (NULL == rptr) {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lho->ulptr->i_ranges,&c32,1);
+ }
+ if (NULL == rptr) {
+
+#line 1253 "dk4uc2la.ctr"
+ /* ERROR: No range found.
+ Already reported in pass 1.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ if (0 != dk4str_cmp(lho->file->fn, rptr->file->fn)) {
+ /* ERROR: Not owned by current file.
+ Already reported in pass 1.
+ */
+
+
+#line 1265 "dk4uc2la.ctr"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+
+ /* Initialize range structure (allocate memory) if not yet done
+ */
+ if (0x00 == rptr->ia) {
+ if (0 == dk4uc2l_i_init_range(rptr, NULL)) {
+ /* ERROR: Memory */
+ dk4app_log_base1(lho->app, DK4_LL_ERROR, 90);
+
+
+#line 1276 "dk4uc2la.ctr"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ rptr->ia = 0x01;
+ }
+
+ /* Find index
+ */
+ ind = (size_t)(c32 - rptr->start);
+
+ /* Check whether character already defined
+ */
+ if (NULL != rptr->lno) {
+ if ((dk4_um_t)0UL != (rptr->lno)[ind]) {
+ /* ERROR: Redefinition.
+ Already reported in pass 1.
+ */
+
+
+#line 1295 "dk4uc2la.ctr"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+ else {
+ (rptr->lno)[ind] = lineno;
+ }
+ }
+
+ /* Traverse all strings in line
+ */
+ p1 = p2;
+ while (NULL != p1) {
+
+#line 1307 "dk4uc2la.ctr"
+ p2 = dk4str8_next(p1, NULL);
+ p3 = dk4str8_chr(p1, '=');
+ if (NULL != p3) {
+ *(p3++) = '\0';
+ p3 = dk4str8_start(p3, NULL);
+ if (NULL != p3) {
+
+
+#line 1314 "dk4uc2la.ctr"
+ res = dk4uc2l_i_keyword_index(p1);
+ switch (res) {
+ case 0 : {
+
+#line 1317 "dk4uc2la.ctr"
+ if (NULL != rptr->both) {
+ if (NULL == (rptr->both)[ind]) {
+ (rptr->both)[ind] = dk4str8_dup(p3, NULL);
+ if (NULL == (rptr->both)[ind]) {
+ /* ERROR: Memory */
+ dk4app_log_base1(lho->app, DK4_LL_ERROR, 90);
+
+
+#line 1324 "dk4uc2la.ctr"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else {
+
+#line 1329 "dk4uc2la.ctr"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 1336 "dk4uc2la.ctr"
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 1 : {
+
+#line 1343 "dk4uc2la.ctr"
+ if (NULL != rptr->text) {
+ if (NULL == (rptr->text)[ind]) {
+ (rptr->text)[ind] = dk4str8_dup(p3, NULL);
+ if (NULL == (rptr->text)[ind]) {
+ /* ERROR: Memory */
+ dk4app_log_base1(lho->app, DK4_LL_ERROR, 90);
+
+
+#line 1350 "dk4uc2la.ctr"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else {
+
+#line 1355 "dk4uc2la.ctr"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 1362 "dk4uc2la.ctr"
+ /* ERROR: Memory
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 2 : {
+
+#line 1369 "dk4uc2la.ctr"
+ if (NULL != rptr->math) {
+ if (NULL == (rptr->math)[ind]) {
+ (rptr->math)[ind] = dk4str8_dup(p3, NULL);
+ if (NULL == (rptr->math)[ind]) {
+ /* ERROR: Memory */
+ dk4app_log_base1(lho->app, DK4_LL_ERROR, 90);
+
+
+#line 1376 "dk4uc2la.ctr"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else {
+
+#line 1381 "dk4uc2la.ctr"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 1388 "dk4uc2la.ctr"
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 3 : {
+
+#line 1395 "dk4uc2la.ctr"
+ if (NULL != rptr->fenc) {
+ adding = 1;
+ feval = 0x00;
+ if ('!' == *p3) {
+ adding = 0;
+ p3++;
+ feval = DK4_UC2L_FONT_ENCODING_ALL;
+ }
+ while (NULL != p3) {
+ p4 = dk4str8_chr(p3, ',');
+ if (NULL != p4) {
+ *(p4++) = '\0';
+ }
+ fex = dk4uc2l_font_encoding_from_name(p3);
+ if (0x00 != fex) {
+ if (0 != adding) {
+ feval |= fex;
+ }
+ else {
+ feval &= (~(fex));
+ }
+ }
+ else {
+
+#line 1418 "dk4uc2la.ctr"
+ /* ERROR: Illegal encoding name */
+ dk4app_log_1(
+ lho->app, lho->msgs, lho->szmsgs,
+ DK4_LL_ERROR, 8
+ );
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ p3 = p4;
+ }
+ (rptr->fenc)[ind] = feval;
+ }
+ else {
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 4 : {
+
+#line 1437 "dk4uc2la.ctr"
+ if (NULL != rptr->pkgs) {
+ if (NULL == (rptr->pkgs)[ind]) {
+ dk4error_init(&er);
+ numpkg = dk4str8_tokenize(
+ pkgn, 16, p3, ",", &er
+ );
+ if (0 < numpkg) {
+ (rptr->pkgs)[ind] =
+ dk4mem_new(dk4_uc2l_pkg_p,(numpkg+1),NULL);
+ if (NULL != (rptr->pkgs)[ind]) {
+ for (i = 0; i <= numpkg; i++) {
+ ((rptr->pkgs)[ind])[i] = NULL;
+ }
+ for (i = 0; i < numpkg; i++) {
+ pptr =
+ (dk4_uc2l_pkg_t *)dk4sto_it_find_like(
+ lho->ulptr->i_pkgs, pkgn[i], 1
+ );
+ if (NULL != pptr) {
+ ((rptr->pkgs)[ind])[i] = pptr;
+ }
+ else {
+ pptr = dk4uc2l_i_create_pkg(
+ lho->ulptr->s_pkgs, pkgn[i]
+ );
+ if (NULL != pptr) {
+ ((rptr->pkgs)[ind])[i] =
+ pptr;
+ }
+ else {
+
+#line 1467 "dk4uc2la.ctr"
+ /* ERROR: Memory */
+ dk4app_log_base1(
+ lho->app,DK4_LL_ERROR,90
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ }
+ }
+ else {
+
+#line 1478 "dk4uc2la.ctr"
+ /* ERROR: Memory */
+ dk4app_log_base1(
+ lho->app, DK4_LL_ERROR, 90
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else {
+
+#line 1487 "dk4uc2la.ctr"
+ dk4app_log_1(
+ lho->app, lho->msgs, lho->szmsgs,
+ DK4_LL_ERROR, 9
+ );
+ }
+ }
+ else {
+
+#line 1494 "dk4uc2la.ctr"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else {
+
+#line 1501 "dk4uc2la.ctr"
+ /* ERROR: Memory.
+ Already reported during range initalization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ default : {
+
+#line 1508 "dk4uc2la.ctr"
+ /* ERROR: Illegal key name */
+ dk4app_log_1(
+ lho->app, lho->msgs, lho->szmsgs, DK4_LL_ERROR, 10
+ );
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ } break;
+ }
+ p1 = p2;
+ }
+ else {
+
+#line 1518 "dk4uc2la.ctr"
+ /* ERROR: Syntax, not a key=value */
+ dk4app_log_1(lho->app,lho->msgs,lho->szmsgs,DK4_LL_ERROR,11);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ p1 = NULL;
+ }
+ }
+ else {
+
+#line 1525 "dk4uc2la.ctr"
+ /* ERROR: Syntax, not a key=value */
+ dk4app_log_1(lho->app, lho->msgs, lho->szmsgs, DK4_LL_ERROR, 11);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ p1 = NULL;
+ }
+ }
+
+ finished:
+
+
+#line 1534 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+/** Load one data file.
+ @param ulptr Conversion structure.
+ @param fptr File to load.
+ @param app Application structure for diagnostics.
+ @param dmsg Localized message texts.
+ @param szdmsg Number of elements in dmsg array.
+*/
+static
+void
+dk4uc2l_load_data_file(
+ dk4_uc2l_t *ulptr,
+ dk4_uc2l_file_t *fptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ char lnb[256];
+ handler_object_t ho;
+ dk4_er_t er_en;
+ dk4_er_t er_pr;
+ dk4_tsp08_t tsp08;
+ dk4_stream_t *rstrm = NULL;
+ const dkChar *oldsourcefile = NULL;
+ dk4_um_t oldsourceline = (dk4_um_t)0UL;
+ size_t fnbsz = DK4_SIZEOF(fnb,dkChar);
+ size_t szlnb = sizeof(lnb);
+ int res;
+ int cc;
+ char c;
+
+
+
+#line 1572 "dk4uc2la.ctr"
+
+ /* Save old source file and line, set new source file
+ */
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fptr->fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+
+ /* Initialize handler object
+ */
+ ho.ulptr = ulptr;
+ ho.s_ra = NULL;
+ ho.i_ra = NULL;
+ ho.file = fptr;
+ ho.rpc = NULL;
+ ho.app = app;
+ ho.msgs = dmsg;
+ ho.szmsgs = szdmsg;
+ ho.e_d = 0;
+ ho.e_e = 0;
+ ho.e_p = 0;
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+
+ /* Save source file name and line number
+ */
+
+ /* Each file should be loaded only once
+ */
+ if (0x00 != fptr->loaded) {
+ goto finished;
+ }
+ fptr->loaded = 0x01;
+
+ /* Construct full path name
+ */
+ if (0 == dk4str_cpy_s(fnb, fnbsz, ulptr->dname, NULL)) {
+ /* ERROR: Directory name too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ if (0 == dk4str_cat_s(fnb, fnbsz, dk4uc2l_kwnl[7], NULL)) {
+ /* ERROR: Directory name too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ if (0 == dk4str_cat_s(fnb, fnbsz, fptr->fn, NULL)) {
+ /* ERROR: Directory name too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ dk4path_correct_sep(fnb);
+ dk4app_set_log_source_file(app, fnb);
+
+ /* Open reader stream
+ */
+ rstrm = dk4stream_open_file_reader(fnb, NULL);
+ if (NULL == rstrm) {
+ /* ERROR: Failed to read file */
+ dk4app_log_3(app, dmsg, szdmsg, DK4_LL_ERROR, 6, 7, fnb);
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ goto finished;
+ }
+
+ /* Initialize text processing
+ */
+ res = dk4tsp08_setup_line(
+ &tsp08, (void *)(&ho), dk4uc2l_handler_pass2, lnb, szlnb,
+ DK4_ENCODING_PLAIN, DK4_ENCODING_PLAIN, NULL
+ );
+ if (0 == res) {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+
+ /* Process contents
+ */
+ do {
+ cc = 0;
+ res = dk4stream_c8_read_byte(&c, rstrm, NULL);
+ if (0 < res) {
+ cc = 1;
+ res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ } break;
+ case DK4_TSP_RES_FATAL : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ goto finished;
+ } break;
+ }
+ }
+ } while (0 < cc);
+
+ /* Finish text processing
+ */
+ res = dk4tsp08_finish(&tsp08);
+ switch (res) {
+ case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ } break;
+ }
+
+ /* Clean up
+ */
+ finished:
+ if (NULL != rstrm) {
+ dk4stream_close(rstrm, NULL);
+ }
+
+ /* Restore source file name and line number
+ */
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+
+
+#line 1709 "dk4uc2la.ctr"
+}
+
+
+/** Second pass to load all data files immediately.
+ @param ulptr Conversion structure.
+ @param app Application structure for diagnostics, may be NULL.
+ @param dmsg Localized message texts.
+ @param szdmsg Number of elements in dmsg array.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4uc2l_i_pass2(
+ dk4_uc2l_t *ulptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dk4_sto_it_t *i_files = NULL;
+ dk4_uc2l_file_t *fptr;
+ int back = 0;
+
+ /* Create iterator through files
+ */
+ i_files = dk4sto_it_open(ulptr->s_files, NULL);
+ if (NULL == i_files) {
+ goto finished;
+ }
+
+ back = 1;
+ dk4sto_it_reset(i_files);
+ do {
+ fptr = (dk4_uc2l_file_t *)dk4sto_it_next(i_files);
+ if (NULL != fptr) {
+ dk4uc2l_load_data_file(
+ ulptr, fptr, app, dmsg, szdmsg
+ );
+ }
+ } while (NULL != fptr);
+
+ /* Clean up
+ */
+ finished:
+ if (NULL != i_files) {
+ dk4sto_it_close(i_files);
+ }
+ return back;
+}
+
+
+
+/** Open Unicode to LaTeX conversion structure with application support.
+ @param dn Directory name containing the translation files.
+ @param app Application structure for diagnostics.
+ @param la Flag: Load all data files immediately.
+ @param dmsg Localized messages array.
+ @param szdmsg Localized messages array size.
+ @return Valid pointer on success (use dk4uc2l_close() to release
+ resources after use), NULL on error.
+*/
+static
+dk4_uc2l_t *
+dk4uc2l_i_open_app(
+ const dkChar *dn,
+ dk4_app_t *app,
+ int la,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dk4_er_t er;
+ dk4_uc2l_t *back = NULL;
+
+
+#line 1783 "dk4uc2la.ctr"
+ dk4error_init(&er);
+ back = dk4uc2l_i_new(dn, &er);
+ if (NULL != back) {
+ if (0 == dk4uc2l_i_pass1(back, app, dmsg, szdmsg)) {
+ dk4uc2l_close(back);
+ back = NULL;
+ }
+ else {
+ if (0 != la) {
+ if (0 == dk4uc2l_i_pass2(back, app, dmsg, szdmsg)) {
+ dk4uc2l_close(back);
+ back = NULL;
+ }
+ }
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ }
+
+
+#line 1804 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open_app_ex1(const dkChar *dn, dk4_app_t *app, int la)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ const dkChar * const *dmsg = NULL;
+ dk4_uc2l_t *back = NULL;
+ size_t i;
+ size_t szdmsg = 0;
+ const size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+ int toolo = 0;
+
+
+#line 1820 "dk4uc2la.ctr"
+ if (NULL != app) {
+ szdmsg = dk4app_string_table_size(dk4uc2l_kw_def);
+ dmsg = dk4app_string_table(app, dk4uc2l_kwnl[8], dk4uc2l_kw_def);
+ /*
+ Retrieve fallback from preferences
+ */
+ if (NULL == dn) {
+ if (0 != dk4app_pref_get(fnb, szfnb, app, dk4uc2l_kwnl[0], 0)) {
+ dk4path_correct_sep(fnb);
+ if (0 != dk4file_is_directory(fnb, NULL)) {
+ dn = fnb;
+ }
+ else {
+ /* ERROR: Not a directory */
+ dk4app_log_base3(app, DK4_LL_ERROR, 152, 153, fnb);
+ }
+ }
+ }
+ /* Retrieve builtin fallbacks
+ */
+ if (NULL == dn) {
+ for (i = 1; ((i < 4) && (NULL == dn)); i++) {
+ if (0 != dk4str_cpy_s(fnb, szfnb, app->dir_share, NULL)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, dk4uc2l_kwnl[i], NULL)) {
+ dk4path_correct_sep(fnb);
+ if (0 != dk4file_is_directory(fnb, NULL)) {
+ dn = fnb;
+ }
+ }
+ else {
+ toolo = 1;
+ }
+ }
+ else {
+ toolo = 1;
+ }
+ }
+ }
+ if (NULL != dn) {
+ if (0 != dk4file_is_directory(dn, NULL)) {
+ back = dk4uc2l_i_open_app(dn, app, la, dmsg, szdmsg);
+ }
+ else {
+ /* ERROR: Not a directory */
+ dk4app_log_base3(app, DK4_LL_ERROR, 152, 153, dn);
+ }
+ }
+ else {
+ if (0 != toolo) {
+ /* ERROR: Shared directory name too long! */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, app->dir_share);
+ }
+ else {
+ /* ERROR: No directory found */
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 15);
+ }
+ }
+ }
+ else {
+ back = dk4uc2l_open(dn, NULL);
+ }
+
+
+#line 1882 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open_app(const dkChar *dn, dk4_app_t *app)
+{
+ return (dk4uc2l_open_app_ex1(dn, app, 0));
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open_from_app(dk4_app_t *app)
+{
+ return (dk4uc2l_open_app(NULL, app));
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open_from_app_ex1(dk4_app_t *app, int la)
+{
+ return (dk4uc2l_open_app_ex1(NULL, app, la));
+}
+
+
+
+static
+const char *
+dk4uc2l_i_find_app(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app)
+{
+ dk4_uc2l_range_t *rptr;
+ dk4_uc2l_pkg_t **pkgpp;
+ dk4_uc2l_file_t *fptr;
+ const char *back = NULL;
+ const dkChar * const *dmsg;
+ size_t ind;
+ size_t szdmsg;
+ size_t blgt;
+ int res;
+
+
+#line 1925 "dk4uc2la.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ /* Attempt direct output
+ */
+ if (0 != dk4uc2lat_direct(c)) {
+ ulptr->buf[0] = (char)c;
+ ulptr->buf[1] = '\0';
+ back = &(ulptr->buf[0]);
+ goto finished;
+ }
+
+ /* Attempt data loaded from file
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(ulptr->i_ranges, &c, 1);
+ if (NULL != rptr) {
+ fptr = rptr->file;
+ if (0x00 == fptr->loaded) {
+ szdmsg = dk4app_string_table_size(dk4uc2l_kw_def);
+ dmsg = dk4app_string_table(app, dk4uc2l_kwnl[8], dk4uc2l_kw_def);
+ dk4uc2l_load_data_file(ulptr, fptr, app, dmsg, szdmsg);
+ }
+ ind = (size_t)(c - rptr->start);
+ if (0 != mm) {
+ if (NULL != rptr->math) {
+ back = (rptr->math)[ind];
+ }
+ }
+ else {
+ if (NULL != rptr->text) {
+ back = (rptr->text)[ind];
+ }
+ }
+ if (NULL == back) {
+ if (NULL != rptr->both) {
+ back = (rptr->both)[ind];
+ }
+ }
+ if (NULL != back) {
+ if (NULL != rptr->pkgs) {
+ pkgpp = (rptr->pkgs)[ind];
+ if (NULL != pkgpp) {
+ while (NULL != *pkgpp) {
+ (*(pkgpp++))->used = 0x01;
+ }
+ }
+ }
+ if (NULL != rptr->fenc) {
+ ulptr->fallowed &= (rptr->fenc)[ind];
+ }
+ goto finished;
+ }
+ }
+
+ /* Attempt to use UTF-8 encoded or ASCII data directly
+ */
+ if (0 == mm) {
+ if (0x00 != ulptr->utf8allowed) {
+ blgt = 15;
+ res = dk4utf8_encode(
+ (unsigned char *)(&(ulptr->buf[0])), &blgt, c, NULL
+ );
+ if (0 != res) {
+ ulptr->buf[blgt] = '\0';
+ back = &(ulptr->buf[0]);
+ }
+ else {
+ /* ##### ERROR: UTF-8 encoding failed */
+ }
+ }
+ else {
+ if (dkC32(0x00000100) > c) {
+ ulptr->buf[0] = (char)c;
+ ulptr->buf[1] = '\0';
+ back = &(ulptr->buf[0]);
+ }
+ }
+ }
+
+ finished:
+ if (NULL != back) {
+ /* ERROR: No LaTeX encoding found for ...
+ The calling application should attempt to recover from this
+ error or report it.
+ */
+ }
+
+
+#line 2012 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+const char *
+dk4uc2l_find_app(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app)
+{
+
+ const char *back = NULL;
+
+
+#line 2023 "dk4uc2la.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ if (NULL != app) {
+ back = dk4uc2l_i_find_app(ulptr, c, mm, app);
+ }
+ else {
+ back = dk4uc2l_find(ulptr, c, mm, NULL);
+ }
+ }
+
+
+#line 2035 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+/* ##### untested */
+static
+void
+dk4uc2l_putc32_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ dk4_c32_t c32,
+ int *pmm,
+ int *pback,
+ dk4_app_t *app
+)
+{
+ dkChar nb[16*sizeof(dk4_um_t)];
+ dk4_er_t er;
+ const dkChar * const *dmsg;
+ const char *le = NULL;
+ size_t padsz = 8;
+ size_t szdmsg = 0;
+ size_t sznb = DK4_SIZEOF(nb,dkChar);
+
+
+#line 2060 "dk4uc2la.ctr"
+ le = dk4uc2l_find(ulptr, c32, 0, NULL);
+ if (NULL != le) {
+ if (0 != *pmm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ *pback = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ *pmm = 0;
+ }
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, le, &er)) {
+ *pback = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ else {
+ dk4error_init(&er);
+ le = dk4uc2l_find(ulptr, c32, 1, &er);
+ if (NULL != le) {
+ if (0 == *pmm) {
+ if (0 == dk4stream_write_char_string(wstrm,dk4uc2l_mm[0],&er)) {
+ *pback = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ *pmm = 1;
+ }
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, le, &er)) {
+ *pback = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ else {
+ *pback = 0;
+ /* ERROR: Not found */
+ szdmsg = dk4app_string_table_size(dk4uc2l_kw_def);
+ dmsg = dk4app_string_table(app, dk4uc2l_kwnl[8], dk4uc2l_kw_def);
+ if ((dk4_c32_t)0xFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFFFUL < c32) {
+ padsz = 8;
+ }
+ else {
+ padsz = 6;
+ }
+ }
+ else {
+ padsz = 4;
+ }
+ }
+ else {
+ padsz = 2;
+ }
+ if (0 != dk4ma_write_hex_unsigned(nb, sznb, c32, padsz, NULL)) {
+ dk4app_log_3(app, dmsg, szdmsg, DK4_LL_ERROR, 31, 32, nb);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 2123 "dk4uc2la.ctr"
+ }
+#endif
+ }
+ }
+
+
+#line 2128 "dk4uc2la.ctr"
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_c32_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c32_t *str,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ int back = 0;
+ int mm = 0;
+
+
+#line 2145 "dk4uc2la.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ while (dkC32(0) != *str) {
+ dk4uc2l_putc32_app(wstrm, ulptr, *(str++), &mm, &back, app);
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+
+ finished:
+
+
+#line 2176 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_c16_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c16_t *str,
+ dk4_app_t *app
+)
+{
+ dk4_utf16_decoder_t dec;
+ dk4_er_t er;
+ dk4_c32_t c32;
+ int mm = 0;
+ int back = 0;
+ int err = 0;
+
+
+#line 2197 "dk4uc2la.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ dk4utf16_init(&dec);
+ while ((dkC16(0) != *str) && (0 == err)) {
+ switch (dk4utf16_add(&dec, *(str++))) {
+ case DK4_EDSTM_FINISHED : {
+ c32 = dk4utf16_get(&dec);
+ dk4utf16_init(&dec);
+ dk4uc2l_putc32_app(wstrm, ulptr, c32, &mm, &back, app);
+ } break;
+ case DK4_EDSTM_ERROR : {
+ err = 1;
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ } break;
+ }
+ }
+ if (0 == err) {
+ if (0 == dk4utf16_is_empty(&dec)) {
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ }
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ finished:
+
+
+#line 2245 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_utf8_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+)
+{
+ dk4_utf8_decoder_t dec;
+ dk4_er_t er;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+ int err = 0;
+
+
+#line 2266 "dk4uc2la.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ dk4utf8_init(&dec);
+ while(('\0' != *str) && (0 == err)) {
+ switch (dk4utf8_add(&dec, (unsigned char)(*(str++)))) {
+ case DK4_EDSTM_FINISHED : {
+ c32 = dk4utf8_get(&dec);
+ dk4utf8_init(&dec);
+ dk4uc2l_putc32_app(wstrm, ulptr, c32, &mm, &back, app);
+ } break;
+ case DK4_EDSTM_ERROR : {
+ err = 1;
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ } break;
+ }
+ }
+ if (0 == err) {
+ if (0 == dk4utf8_is_empty(&dec)) {
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ }
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ finished:
+
+
+#line 2314 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_ansi_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+
+
+#line 2333 "dk4uc2la.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ while ('\0' != *str) {
+ if (0 != dk4ansi_decode(&c32, (unsigned char)(*(str++)))) {
+ dk4uc2l_putc32_app(wstrm, ulptr, c32, &mm, &back, app);
+ }
+ else {
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ }
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ finished:
+
+
+#line 2369 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_ascii_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+
+
+#line 2388 "dk4uc2la.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ while ('\0' != *str) {
+ c32 = (dk4_c32_t)((unsigned char)(*(str++)));
+ dk4uc2l_putc32_app(wstrm, ulptr, c32, &mm, &back, app);
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ finished:
+
+
+#line 2419 "dk4uc2la.ctr"
+ return back;
+}
+
+
+
+int
+dk4uc2l_string_c8_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ int ie,
+ dk4_app_t *app
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ switch (ie) {
+ case DK4_ENCODING_UTF8 : {
+ return (dk4uc2l_string_utf8_app(wstrm, ulptr, str, app));
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ return (dk4uc2l_string_ansi_app(wstrm, ulptr, str, app));
+ } break;
+ default : {
+ return (dk4uc2l_string_ascii_app(wstrm, ulptr, str, app));
+ } break;
+ }
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_dk_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dkChar *str,
+#if DK4_CHAR_SIZE > 1
+ int DK4_ARG_UNUSED(ie),
+#else
+ int ie,
+#endif
+ dk4_app_t *app
+)
+{
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(ie)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ return (dk4uc2l_string_c32_app(wstrm, ulptr, str, app));
+#else
+ return (dk4uc2l_string_c16_app(wstrm, ulptr, str, app));
+#endif
+#else
+ return (dk4uc2l_string_c8_app(wstrm, ulptr, str, ie, app));
+#endif
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4uc2la.ctr b/support/dktools/dk4uc2la.ctr
new file mode 100644
index 0000000000..7ce6c15d84
--- /dev/null
+++ b/support/dktools/dk4uc2la.ctr
@@ -0,0 +1,2489 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2015-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+
+%% header
+
+/** @file dk4uc2la.h Text to LaTeX conversion.
+
+LaTeX sequences to represent a 32 bit character are found in lookup tables
+in the ${datarootdir}/dktools/charmap directory. The functions in this
+module read those lookup tables needed, cache the contents and provide
+LaTeX sequences.
+
+After finishing output you can write recommendations (i.e. LaTeX packages
+to include, font encoding to use) as comments to the file.
+
+The functions in this module supported immediate error reporting
+using the dk4_app_t data type.
+The functions in the dk4uc2l module support restricted and delayed
+error reporting using the dk4_er_t module.
+
+Functions from the dk4uc2la and dk4uc2l module can be used combined.
+A typical scenario is to use the dk4uc2l_open_app_ex1() function with la
+set to 1 to open a conversion structure. This will read all the data files
+and store all contained LaTeX encodings in memory when opening the structure.
+Errors - i.e. failed memory allocations or syntax error in data files - are
+reported immediately.
+Later the dk4uc2l_find() function can be used. As problematic errors like
+failed memory allocations are already reported, a NULL return value can
+only indicate a missing encoding.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4UC2L_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4uc2l.h"
+#else
+#include <dktools-4/dk4uc2l.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open conversion structure, dynamically allocate memory.
+ Extended version 1.
+ @param dn Directory name containing the data files.
+ @param app Application structure for diagnostics, may be NULL.
+ @param la Flag: Immediately load all data files.
+ @return Pointer to conversion structure on success, NULL on error.
+
+ Use dk4uc2l_close() to close the conversion structure when done
+ with it.
+*/
+dk4_uc2l_t *
+dk4uc2l_open_app_ex1(const dkChar *dn, dk4_app_t *app, int la);
+
+/** Open conversion structure, dynamically allocate memory.
+ @param dn Directory name containing the data files.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Pointer to conversion structure on success, NULL on error.
+
+ Use dk4uc2l_close() to close the conversion structure when done
+ with it.
+*/
+dk4_uc2l_t *
+dk4uc2l_open_app(const dkChar *dn, dk4_app_t *app);
+
+/** Open conversion structure, dynamically allocate memory.
+ Extended version 1.
+ The directory containing the data files is obtained from
+ the application (if not NULL), ${datarootdir}/dktools/charmap
+ is used by default.
+ @param app Application structure for diagnostics, may be NULL.
+ @param la Flag: Immediately load all data files.
+ @return Pointer to conversion structure on success, NULL on error.
+
+ Use dk4uc2l_close() to close the conversion structure when done
+ with it.
+*/
+dk4_uc2l_t *
+dk4uc2l_open_from_app_ex1(dk4_app_t *app, int la);
+
+/** Open conversion structure, dynamically allocate memory.
+ The directory containing the data files is obtained from
+ the application (if not NULL), ${datarootdir}/dktools/charmap
+ is used by default.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Pointer to conversion structure on success, NULL on error.
+
+ Use dk4uc2l_close() to close the conversion structure when done
+ with it.
+*/
+dk4_uc2l_t *
+dk4uc2l_open_from_app(dk4_app_t *app);
+
+/** Find LaTeX encoding for one 32 bit character.
+ Error messages are written using app only for internal errors
+ (like "not enough memory" or syntax errors in data files).
+ No error message is written if no LaTeX encoding was found,
+ writing such error messages is left up to the calling code
+ (as you probably want to restrict the number of such messages).
+ @param ulptr Conversion structure.
+ @param c Character to search encoding for.
+ @param mm Flag: Math mode (1) or text mode (0).
+ @param app Application structure for diagnostics, may be NULL.
+ @return Pointer to encoding string on success, NULL on failure
+ (error or not found).
+*/
+const char *
+dk4uc2l_find_app(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app);
+
+/** Write string of 32 bit characters.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c32_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c32_t *str,
+ dk4_app_t *app
+);
+
+/** Write string of 16 bit characters.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c16_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c16_t *str,
+ dk4_app_t *app
+);
+
+/** Write UTF-8 encoded string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_utf8_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+);
+
+/** Write ANSI encoded string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_ansi_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+);
+
+/** Write ASCII encoded string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_ascii_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+);
+
+/** Write char string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param ie Input encoding.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c8_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ int ie,
+ dk4_app_t *app
+);
+
+/** Write dkChar string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param ie Input encoding.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_dk_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dkChar *str,
+ int ie,
+ dk4_app_t *app
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+%% module
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#if DK4_HAVE_STRING_H
+#ifndef STRING_H_INCLUDED
+#include <string.h>
+#define STRING_H_INCLUDED 1
+#endif
+#endif
+
+#include "dk4const.h"
+#include "dk4uc2la.h"
+#include "dk4mem.h"
+#include "dk4mema.h"
+#include "dk4str8.h"
+#include "dk4strd.h"
+#include "dk4utf8.h"
+#include "dk4utf16.h"
+#include "dk4ansi.h"
+#include "dk4maasz.h"
+#include "dk4filed.h"
+#include "dk4mpl.h"
+#include "dk4strm.h"
+#include "dk4strmr.h"
+#include "dk4dir.h"
+#include "dk4dira.h"
+#include "dk4pathd.h"
+#include "dk4tsp08.h"
+#include "dk4enc.h"
+#include "dk4mai8hul.h"
+#include "dk4maodh.h"
+#include "dk4maodd.h"
+#include "dk4unused.h"
+#include "dk4rec26.h"
+#include "uc2l.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Convert to unsigned long.
+*/
+#define UL(x) ((unsigned long)(x))
+
+
+
+/** Object to use and modify from line handler.
+*/
+typedef struct {
+ dk4_uc2l_t *ulptr; /**< Conversion structure. */
+ dk4_sto_t *s_ra; /**< Local range storage. */
+ dk4_sto_it_t *i_ra; /**< Local range iterator. */
+ dk4_uc2l_file_t *file; /**< File structure. */
+ dk4_uc2l_range_t *rpc; /**< Range pointer cache, pass 2. */
+ dk4_app_t *app; /**< Application structure. */
+ const dkChar * const *msgs; /**< Localized message texts. */
+ size_t szmsgs; /**< Number of elements in msgs. */
+ int e_d; /**< Reported decoding errors. */
+ int e_e; /**< Reported encoding errors. */
+ int e_p; /**< Reported processing errors. */
+} handler_object_t;
+
+
+
+/** Fixed keywords used by the module, not localized.
+*/
+static const dkChar * const dk4uc2l_kwnl[] = {
+$!string-table macro=dkT
+#
+# 0 Preference: Directory containing map data.
+#
+dir.charmap
+#
+# 1 2 3 Subdirectories to search for.
+#
+/dktools/charmap
+/dk4app/charmap
+/dk3app/charmap
+#
+# 4 5 6 File name suffixes
+#
+.t2l
+.t2l.gz
+.t2l.bz2
+#
+# 7 Path separator
+#
+/
+#
+# 8 String table file name.
+#
+dk4uc2l.str
+$!end
+};
+
+
+
+/** Localized texts.
+*/
+static const dkChar * const dk4uc2l_kw_def[] = {
+$!string-table macro=dkT
+#
+# 0 Error: Syntax
+#
+Syntax error!\n\tHexadecimal number required at start of line!
+#
+# 1 Error: Syntax
+#
+Syntax error!\n\tHexadecimal value outside allowed 32 bit range!
+#
+# 2 3 4 Error: Syntax error! Redefintion of character!
+#
+Syntax error!\n\tIgnoring redefinition of 0x
+!
+Syntax error!\n\tIgnoring redefinition of character!
+#
+# 5 Error: Failed to set up text processing!
+#
+Failed to set up text processing!
+#
+# 6 7 Error: Failed to open file for reading: ...
+#
+Failed to open file for reading:\n\t"
+"!
+#
+# 8 Error: Syntax error!\n\tIllegal font encoding name!
+#
+Syntax error!\n\tIllegal font encoding name!
+#
+# 9 Error: Syntax error!\n\t1 to 15 packages names are allowed!
+#
+Syntax error!\n\t1 to 15 packages names are allowed!
+#
+# 10 Error: Syntax error!\n\tIllegal attribute name!
+#
+Syntax error!\n\tIllegal attribute name!
+#
+# 11 Error: Syntax error!\n\tAttribute specified without value!
+#
+Syntax error!\n\tAttribute specified without value!
+#
+# 12 13 14 Error: Conversion to UTF-8 failed for a character!
+#
+Conversion to UTF-8 failed for 0x
+!
+Conversion to UTF-8 failed for a character!
+#
+# 15 Error: No directory for character mapping information found!
+#
+No directory for character mapping information found!
+#
+# 16 ... 21 Error messages.
+#
+Decoding failed!\n\tByte:
+Encoding failed!\n\tByte:
+Processing failed!\n\tByte:
+,\n\tCharacter:
+,\n\tPosition in line:
+.
+#
+# 22 ... 27 Error messages.
+#
+Decoding failed!
+Encoding failed!
+Processing failed!
+Further decoding failures!
+Further encoding failures!
+Further processing failures!
+#
+# 28 29 30
+#
+Syntax error!\n\tIgnoring redefinition of 0x
+\n\tpreviously defined in "
+"!
+#
+# 31 32 ERROR: No LaTeX encoding found for ...!
+#
+No LaTeX encoding found for U+
+!
+#
+#
+#
+$!end
+};
+
+
+
+/** Opening and closing tag for math mode.
+*/
+static const char * const dk4uc2l_mm[] = {
+"\\(", "\\)"
+};
+
+
+
+
+/** Handler to process a line during pass 1.
+ @param obj Object to use and modify during processing.
+ @param line Current text line to process.
+ @param lineno Current line number.
+ @param erp Error report, may be NULL.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on recoverable
+ errors, DK4_TSP_RES_FATAL on fatal errors requiring an abort.
+*/
+static
+int
+dk4uc2l_handler_pass1(
+ void *obj,
+ char *line,
+ dk4_um_t lineno,
+ dk4_er_t *erp
+)
+{
+ dkChar numbuf[16*sizeof(dk4_um_t)];
+ handler_object_t *pho;
+ char *p1;
+ dk4_uc2l_range_t *rptr;
+ dk4_uc2l_range_t *r2;
+ const char *pe = NULL;
+ size_t sznb = DK4_SIZEOF(numbuf,dkChar);
+ size_t padsz = 8;
+ unsigned long ul = 0UL;
+ dk4_c32_t c32;
+ dk4_c32_t rbo;
+ int res;
+ int back = DK4_TSP_RES_OK;
+#if TRACE_DEBUG
+ dk4str8_delnl(line);
+#endif
+ $? "+ dk4uc2l_handler_pass1 \"%!8s\"", TR_8STR(line)
+ pho = (handler_object_t *)obj;
+ dk4app_set_log_source_line(pho->app, lineno);
+
+ /* Find start of line, ignore empty lines and comments
+ */
+ p1 = dk4str8_start(line, NULL);
+ if (NULL == p1) {
+ goto finished;
+ }
+ if ('#' == *p1) {
+ goto finished;
+ }
+
+ /* Retrieve hexadecimal number at start
+ */
+ (void)dk4str8_next(p1, NULL);
+ res = dk4ma_input_c8_hex_ulong(&ul, p1, &pe, 1, erp);
+ if (0 == res) {
+ /* ERROR: Syntax, not a number */
+ dk4app_log_1(pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR, 0);
+ goto finished;
+ }
+ c32 = (dk4_c32_t)ul; $? ". c32=%lu 0x%lx", ul, ul
+
+ /* Check for number in global storage
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->ulptr->i_ranges, &c32, 1
+ );
+ if (NULL != rptr) { $? "! found in global storage"
+ /* ERROR: Ignoring redefinition */
+ if ((dk4_c32_t)0xFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFFFUL < c32) {
+ padsz = 8;
+ }
+ else {
+ padsz = 6;
+ }
+ }
+ else {
+ padsz = 4;
+ }
+ }
+ else {
+ padsz = 2;
+ }
+ if (0 != dk4ma_write_hex_unsigned(numbuf, sznb, c32, padsz, NULL)) {
+ dk4app_log_5(
+ pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR,
+ 28, 29, 30, numbuf, rptr->file->fn
+ );
+ }
+ else {
+ dk4app_log_1(pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR, 4);
+ }
+ goto finished;
+ }
+
+ /* Check for number in storage for file
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &c32, 1);
+ if (NULL != rptr) { $? "! found in file storage"
+ /* ERROR: Ignoring redefinition */
+ if ((dk4_c32_t)0xFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFFFUL < c32) {
+ padsz = 8;
+ }
+ else {
+ padsz = 6;
+ }
+ }
+ else {
+ padsz = 4;
+ }
+ }
+ else {
+ padsz = 2;
+ }
+ if (0 != dk4ma_write_hex_unsigned(numbuf, sznb, c32, padsz, NULL)) {
+ dk4app_log_3(
+ pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR, 2, 3, numbuf
+ );
+ }
+ else {
+ dk4app_log_1(pho->app, pho->msgs, pho->szmsgs, DK4_LL_ERROR, 4);
+ }
+ goto finished;
+ }
+
+ /* Check whether appending to an existing range
+ */
+ if (0UL < c32) {
+ rbo = c32 - 1UL;
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &rbo, 1);
+ if (NULL != rptr) {
+ rptr->end = c32;
+#if DK4_SIZEOF_LONG <= 4
+ if ((dk4_um_t)(ULONG_MAX) > (dk4_um_t)c32) {
+#endif
+ rbo = c32 + 1UL;
+ r2 = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->i_ra, &rbo, 1
+ );
+ if (NULL != r2) {
+ dk4sto_remove(pho->s_ra, r2, NULL);
+ rptr->end = r2->end;
+ dk4uc2l_i_close_range(r2);
+ }
+#if DK4_SIZEOF_LONG <= 4
+ }
+#endif
+ goto finished;
+ }
+#if TRACE_DEBUG
+ else { $? ". no range for %lu 0x%lx", (ul-1UL), (ul-1UL)
+ }
+#endif
+ }
+
+ /* Check whether prepending to an existing range
+ */
+#if DK4_SIZEOF_LONG <= 4
+ if ((dk4_um_t)(ULONG_MAX) > (dk4_um_t)c32) {
+#endif
+ rbo = c32 + 1UL;
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(pho->i_ra, &rbo, 1);
+ if (NULL != rptr) {
+ rptr->start = c32;
+ if ((dk4_c32_t)0UL < c32) {
+ rbo = c32 - 1UL;
+ r2 = (dk4_uc2l_range_t *)dk4sto_it_find_like(
+ pho->i_ra, &rbo, 1
+ );
+ if (NULL != r2) {
+ dk4sto_remove(pho->s_ra, r2, NULL);
+ rptr->start = r2->start;
+ dk4uc2l_i_close_range(r2);
+ }
+ }
+ goto finished;
+ }
+#if TRACE_DEBUG
+ else { $? ". no range for %lu %lx", (ul+1UL), (ul+1UL)
+ }
+#endif
+#if DK4_SIZEOF_LONG <= 4
+ }
+#endif
+
+ /* Create new range for one character on its own
+ */
+ rptr = dk4uc2l_i_open_range(c32, pho->file, erp);
+ if (NULL == rptr) {
+ back = DK4_TSP_RES_FATAL;
+ /* ERROR: Memory */
+ dk4app_log_base1(pho->app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+ if (0 == dk4sto_add(pho->s_ra, rptr, erp)) {
+ dk4uc2l_i_close_range(rptr);
+ /* ERROR: Memory */
+ dk4app_log_base1(pho->app, DK4_LL_ERROR, 90);
+ back = DK4_TSP_RES_FATAL;
+ }
+
+ finished:
+ $? "- dk4uc2l_handler_pass1 %d", back
+ return back;
+}
+
+
+
+/** Report an error with position in source line.
+ @param i1 Index of first message part in array.
+ @param i2 Index of alternative first message part.
+ @param bno Byte processed.
+ @param lno Current line number.
+ @param cno Current character number.
+ @param cil Current character number in line.
+ @param dmsg Localized error message texts.
+ @param szdmsg Number of elements in dmsg array.
+*/
+static
+void
+dk4uc2l_report_with_pos(
+ dk4_app_t *app,
+ size_t i1,
+ size_t i2,
+ dk4_um_t bno,
+ dk4_um_t lno,
+ dk4_um_t cno,
+ dk4_um_t cil,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dkChar b1[8*(1+sizeof(dk4_um_t))];
+ dkChar b2[DK4_SIZEOF(b1,dkChar)];
+ dkChar b3[DK4_SIZEOF(b1,dkChar)];
+ size_t szbuf = DK4_SIZEOF(b1,dkChar);
+ dk4_um_t oldlogline = (dk4_um_t)0UL;
+ int allbuffersok = 0;
+
+ oldlogline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_line(app, lno);
+ if (0 != dk4ma_write_decimal_unsigned(b3, szbuf, cil, 0, NULL)) {
+ if (0 != dk4ma_write_decimal_unsigned(b2, szbuf, cno, 0, NULL)) {
+ if (0 != dk4ma_write_decimal_unsigned(b1, szbuf, bno, 0, NULL)) {
+ allbuffersok = 1;
+ }
+ }
+ }
+ if (0 != allbuffersok) {
+ dk4app_log_7(
+ app, dmsg, szdmsg, DK4_LL_ERROR, i1, 19, 20, 21, b1, b2, b3
+ );
+ }
+ else {
+ dk4app_log_1(
+ app, dmsg, szdmsg, DK4_LL_ERROR, i2
+ );
+ }
+ dk4app_set_log_source_line(app, oldlogline);
+}
+
+
+
+/** Report errors from text stream processing.
+ @param app Application structure, may be NULL.
+ @param obj Object modified by line handler.
+ @param er_en Error report for decoding and encoding errors.
+ @param er_pr Error report for processing errors.
+ @param dmsg Localized error message texts.
+ @param szmsg Number of elements in dmsg array.
+*/
+static
+void
+dk4uc2l_report_errors(
+ dk4_app_t *app,
+ handler_object_t *obj,
+ dk4_er_t *er_en,
+ dk4_er_t *er_pr,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ if (NULL != er_en) {
+ switch (er_en->ec) {
+ case DK4_E_DECODING_FAILED: {
+ switch (obj->e_d) {
+ case 0: case 1: {
+ dk4uc2l_report_with_pos(
+ app, 16, 22,
+ er_en->dt.fpos.byteno,
+ er_en->dt.fpos.lineno,
+ er_en->dt.fpos.charno,
+ er_en->dt.fpos.charinline,
+ dmsg, szdmsg
+ );
+ } break;
+ case 2: {
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 25); } break; }
+ if (3 > obj->e_d) { obj->e_d += 1; }
+ } break;
+ case DK4_E_ENCODING_FAILED: {
+ switch (obj->e_e) {
+ case 0: case 1: {
+ dk4uc2l_report_with_pos(
+ app, 17, 23,
+ er_en->dt.fpos.byteno,
+ er_en->dt.fpos.lineno,
+ er_en->dt.fpos.charno,
+ er_en->dt.fpos.charinline,
+ dmsg, szdmsg
+ );
+ } break;
+ case 2: {
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 26);
+ } break;
+ }
+ if (3 > obj->e_e) { obj->e_e += 1; }
+ } break;
+ }
+ }
+ if (NULL != er_pr) {
+ if (DK4_E_NONE != er_pr->ec) {
+ switch (obj->e_p) {
+ case 0: case 1: {
+ dk4uc2l_report_with_pos(
+ app, 18, 24,
+ er_pr->dt.fpos.byteno,
+ er_pr->dt.fpos.lineno,
+ er_pr->dt.fpos.charno,
+ er_pr->dt.fpos.charinline,
+ dmsg, szdmsg
+ );
+ } break;
+ case 2: {
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 27);
+ } break;
+ }
+ if (3 > obj->e_p) { obj->e_p += 1; }
+ }
+ }
+}
+
+
+/** Process one stream from file in pass 1.
+ @param ulptr Conversion structure to set up.
+ @param rstrm Stream to read data from.
+ @param puc2lf File structure.
+ @param bptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics.
+ @param dmsg Localized messages texts.
+ @param szdmsg Size of dmsg array (number of string pointers).
+*/
+static
+void
+dk4uc2l_i_process_stream_pass1(
+ dk4_uc2l_t *ulptr,
+ dk4_stream_t *rstrm,
+ dk4_uc2l_file_t *puc2lf,
+ int *bptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ char lnbuf[256];
+ dk4_tsp08_t tsp08;
+ handler_object_t ho;
+ dk4_er_t er_en;
+ dk4_er_t er_pr;
+ dk4_uc2l_range_t *rptr;
+ int res;
+ int cc;
+ char c;
+ $? "+ dk4uc2l_i_process_stream_pass1"
+
+ /* Initialize handler object
+ */
+ ho.file = puc2lf;
+ ho.ulptr = ulptr;
+ ho.s_ra = NULL;
+ ho.i_ra = NULL;
+ ho.app = app;
+ ho.msgs = dmsg;
+ ho.szmsgs = szdmsg;
+ ho.e_d = 0;
+ ho.e_e = 0;
+ ho.e_p = 0;
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+
+ /* Allocate storage and iterator
+ */
+ ho.s_ra = dk4sto_open(NULL);
+ if (NULL == ho.s_ra) {
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+ dk4sto_set_comp(ho.s_ra, dk4uc2l_i_range_compare, 0);
+ ho.i_ra = dk4sto_it_open(ho.s_ra, NULL);
+ if (NULL == ho.i_ra) {
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+
+ /* Initialize text stream processor
+ */
+ res = dk4tsp08_setup_line(
+ &tsp08, (void *)(&ho), dk4uc2l_handler_pass1, lnbuf, sizeof(lnbuf),
+ DK4_ENCODING_PLAIN, DK4_ENCODING_PLAIN, NULL
+ );
+ if (0 == res) {
+ *bptr = 0;
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ /* ERROR: Failed to initialize text stream processor */
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 5);
+ goto finished;
+ }
+
+ /* Process input data
+ */
+ do {
+ cc = 0;
+ res = dk4stream_c8_read_byte(&c, rstrm, NULL);
+ if (0 != res) {
+ cc = 1;
+ res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ } break;
+ case DK4_TSP_RES_FATAL : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ goto finished;
+ } break;
+ }
+ }
+ } while (0 < cc);
+
+ /* Finalize text stream processor
+ */
+ res = dk4tsp08_finish(&tsp08);
+ switch (res) {
+ case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ *bptr = 0;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ goto finished;
+ } break;
+ }
+
+ /* Transfer ranges to global storage
+ */
+ do {
+ dk4sto_it_reset(ho.i_ra);
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ho.i_ra);
+ if (NULL != rptr) {
+ dk4sto_remove(ho.s_ra, rptr, NULL);
+ if (0 == dk4sto_add(ulptr->s_ranges, rptr, NULL)) {
+ dk4uc2l_i_close_range(rptr);
+ *bptr = 0;
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+ }
+ } while (NULL != rptr);
+
+ /* Release resources
+ */
+ finished:
+ if (NULL != ho.s_ra) {
+ if (NULL != ho.i_ra) {
+ dk4sto_it_reset(ho.i_ra);
+ do {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_next(ho.i_ra);
+ if (NULL != rptr) {
+ dk4uc2l_i_close_range(rptr);
+ }
+ } while (NULL != rptr);
+ dk4sto_it_close(ho.i_ra);
+ }
+ dk4sto_close(ho.s_ra);
+ }
+
+ $? "- dk4uc2l_i_process_stream_pass1"
+}
+
+
+
+
+/** Process one file in pass 1 specified by absolute path name.
+ @param ulptr Conversion structure to set up.
+ @param fn Absolute file name.
+ @param sfn Short (relative) file name within given directory.
+ @param bptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics.
+ @param dmsg Localized messages texts.
+ @param szdmsg Size of dmsg array (number of string pointers).
+*/
+static
+void
+dk4uc2l_i_process_one_full_file_pass1(
+ dk4_uc2l_t *ulptr,
+ const dkChar *fn,
+ const dkChar *sfn,
+ int *bptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ const dkChar *oldsourcefile;
+ dk4_stream_t *rstrm;
+ dk4_uc2l_file_t *puc2lf;
+ dk4_um_t oldsourceline;
+ int fnsi;
+ $? "+ dk4uc2l_i_process_one_full_file_pass1 \"%!ds\"", TR_STR(fn)
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+ puc2lf = (dk4_uc2l_file_t *)dk4sto_it_find_like(ulptr->i_files, sfn, 1);
+ if (NULL == puc2lf) {
+ puc2lf = dk4uc2l_i_open_file(sfn, NULL);
+ if (NULL != puc2lf) {
+ if (0 != dk4sto_add(ulptr->s_files, puc2lf, NULL)) {
+ fnsi = dk4uc2l_i_find_suffix_index(fn);
+ if (-1 < fnsi) {
+ if (0 != dk4uc2l_i_suffix_index_supported(fnsi)) {
+ rstrm = dk4stream_open_file_reader(fn, NULL);
+ if (NULL != rstrm) {
+ dk4uc2l_i_process_stream_pass1(
+ ulptr, rstrm, puc2lf, bptr, app, dmsg, szdmsg
+ );
+ dk4stream_close(rstrm, NULL);
+ }
+ else { $? "! failed to open file for reading"
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ /* ERROR: Failed to read file */
+ dk4app_log_3(app,dmsg,szdmsg,DK4_LL_ERROR,6,7,fn);
+ *bptr = 0;
+ }
+ }
+ else { $? "! unsupported compression type"
+ /* ERROR: Unsupported compression mechanism */
+ dk4app_log_3(app,dmsg,szdmsg,DK4_LL_ERROR,6,7,fn);
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ *bptr = 0;
+ }
+ }
+ else { $? "! unsupported file type"
+ /* Warning: Unsupported file type */
+ dk4app_log_3(app,dmsg,szdmsg,DK4_LL_ERROR,6,7,fn);
+ }
+ }
+ else { $? "! failed to store"
+ dk4uc2l_i_close_file(puc2lf);
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ }
+ }
+ else { $? "! allocation failed"
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ }
+ }
+ else { $? "! bug, already processed"
+ /* BUG file already processed */
+ }
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ $? "- dk4uc2l_i_process_one_full_file_pass1"
+}
+
+
+
+/** Process one file in pass 1.
+ @param ulptr Conversion structure to set up.
+ @param pth Directory path name, may be NULL.
+ @param fn Short file name within given directory.
+ @param bptr Address of success variable to reset on error.
+ @param app Application structure for diagnostics.
+ @param dmsg Localized messages texts.
+ @param szdmsg Size of dmsg array (number of string pointers).
+*/
+static
+void
+dk4uc2l_i_process_one_file_pass1(
+ dk4_uc2l_t *ulptr,
+ const dkChar *pth,
+ const dkChar *fn,
+ int *bptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+ $? "+ dk4uc2l_i_process_one_file_pass1 \"%!ds\" \"%!ds\"", TR_STR(pth), TR_STR(fn)
+ if (NULL != pth) {
+ if (0 != dk4str_cpy_s(fnb, szfnb, pth, NULL)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, dk4uc2l_kwnl[7], NULL)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, fn, NULL)) {
+ dk4path_correct_sep(fnb);
+ dk4uc2l_i_process_one_full_file_pass1(
+ ulptr, fnb, fn, bptr, app, dmsg, szdmsg
+ );
+ }
+ else {
+ *bptr = 0;
+ /* ERROR pth and/or fn too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
+ }
+ }
+ else {
+ *bptr = 0;
+ /* ERROR: pth too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
+ }
+ }
+ else {
+ *bptr = 0;
+ /* ERROR: pth too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, pth);
+ }
+ }
+ else {
+ dk4uc2l_i_process_one_full_file_pass1(ulptr,fn,fn,bptr,app,dmsg,szdmsg);
+ }
+ $? "- dk4uc2l_i_process_one_file_pass1"
+}
+
+
+
+/** First pass to gather information which Unicode position is configured
+ in which data file.
+ This function is run while creating a new conversion structure
+ to fill the range structures so we can later find a file for a
+ Unicode position.
+ If this function fails, the conversion structure is considered
+ unusable.
+ The function fails only on memory allocation failures.
+ Syntax errors in translation files are reported as errors through
+ app, but the function indicates success.
+ @param ulptr Conversion structure.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4uc2l_i_pass1(
+ dk4_uc2l_t *ulptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ const dkChar *fn = NULL;
+ const dkChar *pth = NULL;
+ dk4_dir_t *pdir = NULL;
+ int back = 0;
+ $? "+ dk4uc2l_i_pass1"
+ pdir = dk4dir_open_app(ulptr->dname, 0, app);
+ if (NULL != pdir) {
+ pth = dk4dir_get_path(pdir);
+ back = 1;
+ do {
+ fn = dk4dir_next_file(pdir);
+ if (NULL != fn) {
+ if (-1 < dk4uc2l_i_find_suffix_index(fn)) {
+ dk4uc2l_i_process_one_file_pass1(
+ ulptr, pth, fn, &back, app, dmsg, szdmsg
+ );
+ }
+ }
+ } while (NULL != fn);
+ dk4dir_close(pdir);
+ }
+ else { $? "! failed to open dir"
+ /* ERROR: Failed to open directory (already reported) */
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ }
+ $? "- dk4uc2l_i_pass1 %d", back
+ return back;
+}
+
+
+
+/** Handler to process a line during pass 1.
+ @param obj Object to use and modify during processing.
+ @param line Current text line to process.
+ @param lineno Current line number.
+ @param erp Error report, may be NULL.
+ @return DK4_TSP_RES_OK on success, DK4_TSP_RES_ERROR on recoverable
+ errors, DK4_TSP_RES_FATAL on fatal errors requiring an abort.
+*/
+static
+int
+dk4uc2l_handler_pass2(
+ void *obj,
+ char *line,
+ dk4_um_t lineno,
+ dk4_er_t * DK4_ARG_UNUSED(erp)
+)
+{
+ dk4_er_t er;
+ char *pkgn[16];
+ handler_object_t *lho = NULL;
+ const char *pe = NULL;
+ char *p1 = NULL;
+ char *p2 = NULL;
+ char *p3 = NULL;
+ char *p4 = NULL;
+ dk4_uc2l_range_t *rptr = NULL;
+ dk4_uc2l_pkg_t *pptr = NULL;
+ size_t ind = 0;
+ size_t numpkg = 0;
+ size_t i = 0;
+ unsigned long ul = 0UL;
+ dk4_c32_t c32 = (dk4_c32_t)0UL;
+ int back = DK4_TSP_RES_OK;
+ int res = 0;
+ int adding = 0;
+ unsigned char fex = 0;
+ unsigned char feval = 0;
+
+ DK4_UNUSED_ARG(erp)
+ $? "+ dk4uc2l_handler_pass2"
+#if TRACE_DEBUG
+ dk4str8_delnl(line);
+ $? ". line=\"%!8s\"", line
+#endif
+
+ /* Line handler object
+ */
+ lho = (handler_object_t *)obj;
+ dk4app_set_log_source_line(lho->app, lineno);
+
+ /* Find start of line, ignore empty lines and comments
+ */
+ p1 = dk4str8_start(line, NULL);
+ if (NULL == p1) { $? ". ignore empty line"
+ goto finished;
+ }
+ if ('#' == *p1) { $? ". ignore comment"
+ goto finished;
+ }
+
+ /* Retrieve character number
+ */
+ p2 = dk4str8_next(p1, NULL);
+ res = dk4ma_input_c8_hex_ulong(&ul, p1, &pe, 1, NULL);
+ if (0 == res) { $? "! failed to retrieve character number"
+ /* WARNING: Syntax, no number.
+ Already reported in pass 1.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+ c32 = (dk4_c32_t)ul;
+
+ /* Find and check range structure, attempt cached range pointer first
+ */
+ if (NULL != lho->rpc) {
+ if ((lho->rpc->start <= c32) && (c32 <= lho->rpc->end)) {
+ rptr = lho->rpc;
+ }
+ }
+ if (NULL == rptr) {
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(lho->ulptr->i_ranges,&c32,1);
+ }
+ if (NULL == rptr) { $? "! rptr"
+ /* ERROR: No range found.
+ Already reported in pass 1.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ if (0 != dk4str_cmp(lho->file->fn, rptr->file->fn)) {
+ /* ERROR: Not owned by current file.
+ Already reported in pass 1.
+ */
+ $? "! redefinition"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+
+ /* Initialize range structure (allocate memory) if not yet done
+ */
+ if (0x00 == rptr->ia) {
+ if (0 == dk4uc2l_i_init_range(rptr, NULL)) {
+ /* ERROR: Memory */
+ dk4app_log_base1(lho->app, DK4_LL_ERROR, 90);
+ $? "! memory"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ back = DK4_TSP_RES_FATAL;
+ goto finished;
+ }
+ rptr->ia = 0x01;
+ }
+
+ /* Find index
+ */
+ ind = (size_t)(c32 - rptr->start);
+
+ /* Check whether character already defined
+ */
+ if (NULL != rptr->lno) {
+ if ((dk4_um_t)0UL != (rptr->lno)[ind]) {
+ /* ERROR: Redefinition.
+ Already reported in pass 1.
+ */
+ $? "! redefinition"
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ goto finished;
+ }
+ else {
+ (rptr->lno)[ind] = lineno;
+ }
+ }
+
+ /* Traverse all strings in line
+ */
+ p1 = p2;
+ while (NULL != p1) { $? ". p1=\"%!8s\"", p1
+ p2 = dk4str8_next(p1, NULL);
+ p3 = dk4str8_chr(p1, '=');
+ if (NULL != p3) {
+ *(p3++) = '\0';
+ p3 = dk4str8_start(p3, NULL);
+ if (NULL != p3) {
+ $? ". p1=\"%!8s\" p3=\"%!8s\"", p1, p3
+ res = dk4uc2l_i_keyword_index(p1);
+ switch (res) {
+ case 0 : { $? ". both=..."
+ if (NULL != rptr->both) {
+ if (NULL == (rptr->both)[ind]) {
+ (rptr->both)[ind] = dk4str8_dup(p3, NULL);
+ if (NULL == (rptr->both)[ind]) {
+ /* ERROR: Memory */
+ dk4app_log_base1(lho->app, DK4_LL_ERROR, 90);
+ $? "! memory"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else { $? "! bug"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! rptr->both"
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 1 : { $? ". text=..."
+ if (NULL != rptr->text) {
+ if (NULL == (rptr->text)[ind]) {
+ (rptr->text)[ind] = dk4str8_dup(p3, NULL);
+ if (NULL == (rptr->text)[ind]) {
+ /* ERROR: Memory */
+ dk4app_log_base1(lho->app, DK4_LL_ERROR, 90);
+ $? "! memory"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else { $? "! bug"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! rptr->text"
+ /* ERROR: Memory
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 2 : { $? ". math=..."
+ if (NULL != rptr->math) {
+ if (NULL == (rptr->math)[ind]) {
+ (rptr->math)[ind] = dk4str8_dup(p3, NULL);
+ if (NULL == (rptr->math)[ind]) {
+ /* ERROR: Memory */
+ dk4app_log_base1(lho->app, DK4_LL_ERROR, 90);
+ $? "! memory"
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else { $? "! bug"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! rptr->math"
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 3 : { $? ". encoding=..."
+ if (NULL != rptr->fenc) {
+ adding = 1;
+ feval = 0x00;
+ if ('!' == *p3) {
+ adding = 0;
+ p3++;
+ feval = DK4_UC2L_FONT_ENCODING_ALL;
+ }
+ while (NULL != p3) {
+ p4 = dk4str8_chr(p3, ',');
+ if (NULL != p4) {
+ *(p4++) = '\0';
+ }
+ fex = dk4uc2l_font_encoding_from_name(p3);
+ if (0x00 != fex) {
+ if (0 != adding) {
+ feval |= fex;
+ }
+ else {
+ feval &= (~(fex));
+ }
+ }
+ else { $? "! illegal encoding \"%!8s\"", p3
+ /* ERROR: Illegal encoding name */
+ dk4app_log_1(
+ lho->app, lho->msgs, lho->szmsgs,
+ DK4_LL_ERROR, 8
+ );
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ p3 = p4;
+ }
+ (rptr->fenc)[ind] = feval;
+ }
+ else {
+ /* ERROR: Memory.
+ Already reported during range initialization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ case 4 : { $? ". packages=..."
+ if (NULL != rptr->pkgs) {
+ if (NULL == (rptr->pkgs)[ind]) {
+ dk4error_init(&er);
+ numpkg = dk4str8_tokenize(
+ pkgn, 16, p3, ",", &er
+ );
+ if (0 < numpkg) {
+ (rptr->pkgs)[ind] =
+ dk4mem_new(dk4_uc2l_pkg_p,(numpkg+1),NULL);
+ if (NULL != (rptr->pkgs)[ind]) {
+ for (i = 0; i <= numpkg; i++) {
+ ((rptr->pkgs)[ind])[i] = NULL;
+ }
+ for (i = 0; i < numpkg; i++) {
+ pptr =
+ (dk4_uc2l_pkg_t *)dk4sto_it_find_like(
+ lho->ulptr->i_pkgs, pkgn[i], 1
+ );
+ if (NULL != pptr) {
+ ((rptr->pkgs)[ind])[i] = pptr;
+ }
+ else {
+ pptr = dk4uc2l_i_create_pkg(
+ lho->ulptr->s_pkgs, pkgn[i]
+ );
+ if (NULL != pptr) {
+ ((rptr->pkgs)[ind])[i] =
+ pptr;
+ }
+ else { $? "! memory"
+ /* ERROR: Memory */
+ dk4app_log_base1(
+ lho->app,DK4_LL_ERROR,90
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ }
+ }
+ else { $? "! memory"
+ /* ERROR: Memory */
+ dk4app_log_base1(
+ lho->app, DK4_LL_ERROR, 90
+ );
+ lho->ulptr->had_error |=
+ DK4_UC2L_ERROR_MEMORY;
+ }
+ }
+ else { $? "! empty list"
+ dk4app_log_1(
+ lho->app, lho->msgs, lho->szmsgs,
+ DK4_LL_ERROR, 9
+ );
+ }
+ }
+ else { $? "! bug"
+ /* ERROR: Already defined.
+ Bug: Should not happen.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ }
+ }
+ else { $? "! memory"
+ /* ERROR: Memory.
+ Already reported during range initalization.
+ */
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_MEMORY;
+ }
+ } break;
+ default : { $? "! illegal key \"%!8s\"", p1
+ /* ERROR: Illegal key name */
+ dk4app_log_1(
+ lho->app, lho->msgs, lho->szmsgs, DK4_LL_ERROR, 10
+ );
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ } break;
+ }
+ p1 = p2;
+ }
+ else { $? "! not key=value"
+ /* ERROR: Syntax, not a key=value */
+ dk4app_log_1(lho->app,lho->msgs,lho->szmsgs,DK4_LL_ERROR,11);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ p1 = NULL;
+ }
+ }
+ else { $? "! not key=value"
+ /* ERROR: Syntax, not a key=value */
+ dk4app_log_1(lho->app, lho->msgs, lho->szmsgs, DK4_LL_ERROR, 11);
+ lho->ulptr->had_error |= DK4_UC2L_ERROR_SYNTAX;
+ p1 = NULL;
+ }
+ }
+
+ finished:
+ $? "- dk4uc2l_handler_pass2 %d", back
+ return back;
+}
+
+
+
+/** Load one data file.
+ @param ulptr Conversion structure.
+ @param fptr File to load.
+ @param app Application structure for diagnostics.
+ @param dmsg Localized message texts.
+ @param szdmsg Number of elements in dmsg array.
+*/
+static
+void
+dk4uc2l_load_data_file(
+ dk4_uc2l_t *ulptr,
+ dk4_uc2l_file_t *fptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ char lnb[256];
+ handler_object_t ho;
+ dk4_er_t er_en;
+ dk4_er_t er_pr;
+ dk4_tsp08_t tsp08;
+ dk4_stream_t *rstrm = NULL;
+ const dkChar *oldsourcefile = NULL;
+ dk4_um_t oldsourceline = (dk4_um_t)0UL;
+ size_t fnbsz = DK4_SIZEOF(fnb,dkChar);
+ size_t szlnb = sizeof(lnb);
+ int res;
+ int cc;
+ char c;
+
+ $? "+ dk4uc2l_load_data_file \"%!ds\"", fptr->fn
+
+ /* Save old source file and line, set new source file
+ */
+ oldsourcefile = dk4app_get_log_source_file(app);
+ oldsourceline = dk4app_get_log_source_line(app);
+ dk4app_set_log_source_file(app, fptr->fn);
+ dk4app_set_log_source_line(app, (dk4_um_t)0UL);
+
+ /* Initialize handler object
+ */
+ ho.ulptr = ulptr;
+ ho.s_ra = NULL;
+ ho.i_ra = NULL;
+ ho.file = fptr;
+ ho.rpc = NULL;
+ ho.app = app;
+ ho.msgs = dmsg;
+ ho.szmsgs = szdmsg;
+ ho.e_d = 0;
+ ho.e_e = 0;
+ ho.e_p = 0;
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+
+ /* Save source file name and line number
+ */
+
+ /* Each file should be loaded only once
+ */
+ if (0x00 != fptr->loaded) {
+ goto finished;
+ }
+ fptr->loaded = 0x01;
+
+ /* Construct full path name
+ */
+ if (0 == dk4str_cpy_s(fnb, fnbsz, ulptr->dname, NULL)) {
+ /* ERROR: Directory name too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ if (0 == dk4str_cat_s(fnb, fnbsz, dk4uc2l_kwnl[7], NULL)) {
+ /* ERROR: Directory name too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ if (0 == dk4str_cat_s(fnb, fnbsz, fptr->fn, NULL)) {
+ /* ERROR: Directory name too long */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, ulptr->dname);
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ goto finished;
+ }
+ dk4path_correct_sep(fnb);
+ dk4app_set_log_source_file(app, fnb);
+
+ /* Open reader stream
+ */
+ rstrm = dk4stream_open_file_reader(fnb, NULL);
+ if (NULL == rstrm) {
+ /* ERROR: Failed to read file */
+ dk4app_log_3(app, dmsg, szdmsg, DK4_LL_ERROR, 6, 7, fnb);
+ ulptr->had_error |= DK4_UC2L_ERROR_FOPEN;
+ goto finished;
+ }
+
+ /* Initialize text processing
+ */
+ res = dk4tsp08_setup_line(
+ &tsp08, (void *)(&ho), dk4uc2l_handler_pass2, lnb, szlnb,
+ DK4_ENCODING_PLAIN, DK4_ENCODING_PLAIN, NULL
+ );
+ if (0 == res) {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ goto finished;
+ }
+
+ /* Process contents
+ */
+ do {
+ cc = 0;
+ res = dk4stream_c8_read_byte(&c, rstrm, NULL);
+ if (0 < res) {
+ cc = 1;
+ res = dk4tsp08_add_one_byte(&tsp08, (unsigned char)c);
+ switch (res) {
+ case DK4_TSP_RES_ERROR : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ } break;
+ case DK4_TSP_RES_FATAL : {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ dk4error_init(&er_en);
+ dk4error_init(&er_pr);
+ goto finished;
+ } break;
+ }
+ }
+ } while (0 < cc);
+
+ /* Finish text processing
+ */
+ res = dk4tsp08_finish(&tsp08);
+ switch (res) {
+ case DK4_TSP_RES_ERROR: case DK4_TSP_RES_FATAL: {
+ ulptr->had_error |= DK4_UC2L_ERROR_PROCESSING;
+ dk4tsp08_get_errors(&er_en, &er_pr, &tsp08);
+ dk4uc2l_report_errors(
+ app, &ho, &er_en, &er_pr, dmsg, szdmsg
+ );
+ } break;
+ }
+
+ /* Clean up
+ */
+ finished:
+ if (NULL != rstrm) {
+ dk4stream_close(rstrm, NULL);
+ }
+
+ /* Restore source file name and line number
+ */
+ dk4app_set_log_source_file(app, oldsourcefile);
+ dk4app_set_log_source_line(app, oldsourceline);
+ $? "- dk4uc2l_load_data_file"
+}
+
+
+/** Second pass to load all data files immediately.
+ @param ulptr Conversion structure.
+ @param app Application structure for diagnostics, may be NULL.
+ @param dmsg Localized message texts.
+ @param szdmsg Number of elements in dmsg array.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+dk4uc2l_i_pass2(
+ dk4_uc2l_t *ulptr,
+ dk4_app_t *app,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dk4_sto_it_t *i_files = NULL;
+ dk4_uc2l_file_t *fptr;
+ int back = 0;
+
+ /* Create iterator through files
+ */
+ i_files = dk4sto_it_open(ulptr->s_files, NULL);
+ if (NULL == i_files) {
+ goto finished;
+ }
+
+ back = 1;
+ dk4sto_it_reset(i_files);
+ do {
+ fptr = (dk4_uc2l_file_t *)dk4sto_it_next(i_files);
+ if (NULL != fptr) {
+ dk4uc2l_load_data_file(
+ ulptr, fptr, app, dmsg, szdmsg
+ );
+ }
+ } while (NULL != fptr);
+
+ /* Clean up
+ */
+ finished:
+ if (NULL != i_files) {
+ dk4sto_it_close(i_files);
+ }
+ return back;
+}
+
+
+
+/** Open Unicode to LaTeX conversion structure with application support.
+ @param dn Directory name containing the translation files.
+ @param app Application structure for diagnostics.
+ @param la Flag: Load all data files immediately.
+ @param dmsg Localized messages array.
+ @param szdmsg Localized messages array size.
+ @return Valid pointer on success (use dk4uc2l_close() to release
+ resources after use), NULL on error.
+*/
+static
+dk4_uc2l_t *
+dk4uc2l_i_open_app(
+ const dkChar *dn,
+ dk4_app_t *app,
+ int la,
+ const dkChar * const *dmsg,
+ size_t szdmsg
+)
+{
+ dk4_er_t er;
+ dk4_uc2l_t *back = NULL;
+ $? "+ dk4uc2l_i_open_app \"%!ds\"", TR_STR(dn)
+ dk4error_init(&er);
+ back = dk4uc2l_i_new(dn, &er);
+ if (NULL != back) {
+ if (0 == dk4uc2l_i_pass1(back, app, dmsg, szdmsg)) {
+ dk4uc2l_close(back);
+ back = NULL;
+ }
+ else {
+ if (0 != la) {
+ if (0 == dk4uc2l_i_pass2(back, app, dmsg, szdmsg)) {
+ dk4uc2l_close(back);
+ back = NULL;
+ }
+ }
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4app_log_base1(app, DK4_LL_ERROR, 90);
+ }
+ $? "- dk4uc2l_i_open_app %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open_app_ex1(const dkChar *dn, dk4_app_t *app, int la)
+{
+ dkChar fnb[DK4_MAX_PATH];
+ const dkChar * const *dmsg = NULL;
+ dk4_uc2l_t *back = NULL;
+ size_t i;
+ size_t szdmsg = 0;
+ const size_t szfnb = DK4_SIZEOF(fnb,dkChar);
+ int toolo = 0;
+ $? "+ dk4uc2l_open_app \"%!ds\"", TR_STR(dn)
+ if (NULL != app) {
+ szdmsg = dk4app_string_table_size(dk4uc2l_kw_def);
+ dmsg = dk4app_string_table(app, dk4uc2l_kwnl[8], dk4uc2l_kw_def);
+ /*
+ Retrieve fallback from preferences
+ */
+ if (NULL == dn) {
+ if (0 != dk4app_pref_get(fnb, szfnb, app, dk4uc2l_kwnl[0], 0)) {
+ dk4path_correct_sep(fnb);
+ if (0 != dk4file_is_directory(fnb, NULL)) {
+ dn = fnb;
+ }
+ else {
+ /* ERROR: Not a directory */
+ dk4app_log_base3(app, DK4_LL_ERROR, 152, 153, fnb);
+ }
+ }
+ }
+ /* Retrieve builtin fallbacks
+ */
+ if (NULL == dn) {
+ for (i = 1; ((i < 4) && (NULL == dn)); i++) {
+ if (0 != dk4str_cpy_s(fnb, szfnb, app->dir_share, NULL)) {
+ if (0 != dk4str_cat_s(fnb, szfnb, dk4uc2l_kwnl[i], NULL)) {
+ dk4path_correct_sep(fnb);
+ if (0 != dk4file_is_directory(fnb, NULL)) {
+ dn = fnb;
+ }
+ }
+ else {
+ toolo = 1;
+ }
+ }
+ else {
+ toolo = 1;
+ }
+ }
+ }
+ if (NULL != dn) {
+ if (0 != dk4file_is_directory(dn, NULL)) {
+ back = dk4uc2l_i_open_app(dn, app, la, dmsg, szdmsg);
+ }
+ else {
+ /* ERROR: Not a directory */
+ dk4app_log_base3(app, DK4_LL_ERROR, 152, 153, dn);
+ }
+ }
+ else {
+ if (0 != toolo) {
+ /* ERROR: Shared directory name too long! */
+ dk4app_log_base3(app, DK4_LL_ERROR, 98, 99, app->dir_share);
+ }
+ else {
+ /* ERROR: No directory found */
+ dk4app_log_1(app, dmsg, szdmsg, DK4_LL_ERROR, 15);
+ }
+ }
+ }
+ else {
+ back = dk4uc2l_open(dn, NULL);
+ }
+ $? "- dk4uc2l_open_app %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open_app(const dkChar *dn, dk4_app_t *app)
+{
+ return (dk4uc2l_open_app_ex1(dn, app, 0));
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open_from_app(dk4_app_t *app)
+{
+ return (dk4uc2l_open_app(NULL, app));
+}
+
+
+
+dk4_uc2l_t *
+dk4uc2l_open_from_app_ex1(dk4_app_t *app, int la)
+{
+ return (dk4uc2l_open_app_ex1(NULL, app, la));
+}
+
+
+
+static
+const char *
+dk4uc2l_i_find_app(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app)
+{
+ dk4_uc2l_range_t *rptr;
+ dk4_uc2l_pkg_t **pkgpp;
+ dk4_uc2l_file_t *fptr;
+ const char *back = NULL;
+ const dkChar * const *dmsg;
+ size_t ind;
+ size_t szdmsg;
+ size_t blgt;
+ int res;
+ $? "+ dk4uc2l_i_find_app 0x%lx", (unsigned long)c
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ /* Attempt direct output
+ */
+ if (0 != dk4uc2lat_direct(c)) {
+ ulptr->buf[0] = (char)c;
+ ulptr->buf[1] = '\0';
+ back = &(ulptr->buf[0]);
+ goto finished;
+ }
+
+ /* Attempt data loaded from file
+ */
+ rptr = (dk4_uc2l_range_t *)dk4sto_it_find_like(ulptr->i_ranges, &c, 1);
+ if (NULL != rptr) {
+ fptr = rptr->file;
+ if (0x00 == fptr->loaded) {
+ szdmsg = dk4app_string_table_size(dk4uc2l_kw_def);
+ dmsg = dk4app_string_table(app, dk4uc2l_kwnl[8], dk4uc2l_kw_def);
+ dk4uc2l_load_data_file(ulptr, fptr, app, dmsg, szdmsg);
+ }
+ ind = (size_t)(c - rptr->start);
+ if (0 != mm) {
+ if (NULL != rptr->math) {
+ back = (rptr->math)[ind];
+ }
+ }
+ else {
+ if (NULL != rptr->text) {
+ back = (rptr->text)[ind];
+ }
+ }
+ if (NULL == back) {
+ if (NULL != rptr->both) {
+ back = (rptr->both)[ind];
+ }
+ }
+ if (NULL != back) {
+ if (NULL != rptr->pkgs) {
+ pkgpp = (rptr->pkgs)[ind];
+ if (NULL != pkgpp) {
+ while (NULL != *pkgpp) {
+ (*(pkgpp++))->used = 0x01;
+ }
+ }
+ }
+ if (NULL != rptr->fenc) {
+ ulptr->fallowed &= (rptr->fenc)[ind];
+ }
+ goto finished;
+ }
+ }
+
+ /* Attempt to use UTF-8 encoded or ASCII data directly
+ */
+ if (0 == mm) {
+ if (0x00 != ulptr->utf8allowed) {
+ blgt = 15;
+ res = dk4utf8_encode(
+ (unsigned char *)(&(ulptr->buf[0])), &blgt, c, NULL
+ );
+ if (0 != res) {
+ ulptr->buf[blgt] = '\0';
+ back = &(ulptr->buf[0]);
+ }
+ else {
+ /* ##### ERROR: UTF-8 encoding failed */
+ }
+ }
+ else {
+ if (dkC32(0x00000100) > c) {
+ ulptr->buf[0] = (char)c;
+ ulptr->buf[1] = '\0';
+ back = &(ulptr->buf[0]);
+ }
+ }
+ }
+
+ finished:
+ if (NULL != back) {
+ /* ERROR: No LaTeX encoding found for ...
+ The calling application should attempt to recover from this
+ error or report it.
+ */
+ }
+ $? "- dk4uc2l_i_find_app %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+const char *
+dk4uc2l_find_app(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app)
+{
+
+ const char *back = NULL;
+ $? "+ dk4uc2l_find_app 0x%lx", (unsigned long)c
+#if DK4_USE_ASSERT
+ assert(NULL != ulptr);
+#endif
+ if (NULL != ulptr) {
+ if (NULL != app) {
+ back = dk4uc2l_i_find_app(ulptr, c, mm, app);
+ }
+ else {
+ back = dk4uc2l_find(ulptr, c, mm, NULL);
+ }
+ }
+ $? "- dk4uc2l_find_app %d", TR_IPTR(back)
+ return back;
+}
+
+
+
+/* ##### untested */
+static
+void
+dk4uc2l_putc32_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ dk4_c32_t c32,
+ int *pmm,
+ int *pback,
+ dk4_app_t *app
+)
+{
+ dkChar nb[16*sizeof(dk4_um_t)];
+ dk4_er_t er;
+ const dkChar * const *dmsg;
+ const char *le = NULL;
+ size_t padsz = 8;
+ size_t szdmsg = 0;
+ size_t sznb = DK4_SIZEOF(nb,dkChar);
+ $? "+ dk4uc2l_putc32_app 0x%08lx", UL(c32)
+ le = dk4uc2l_find(ulptr, c32, 0, NULL);
+ if (NULL != le) {
+ if (0 != *pmm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ *pback = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ *pmm = 0;
+ }
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, le, &er)) {
+ *pback = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ else {
+ dk4error_init(&er);
+ le = dk4uc2l_find(ulptr, c32, 1, &er);
+ if (NULL != le) {
+ if (0 == *pmm) {
+ if (0 == dk4stream_write_char_string(wstrm,dk4uc2l_mm[0],&er)) {
+ *pback = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ *pmm = 1;
+ }
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, le, &er)) {
+ *pback = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ else {
+ *pback = 0;
+ /* ERROR: Not found */
+ szdmsg = dk4app_string_table_size(dk4uc2l_kw_def);
+ dmsg = dk4app_string_table(app, dk4uc2l_kwnl[8], dk4uc2l_kw_def);
+ if ((dk4_c32_t)0xFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFUL < c32) {
+ if ((dk4_c32_t)0xFFFFFFUL < c32) {
+ padsz = 8;
+ }
+ else {
+ padsz = 6;
+ }
+ }
+ else {
+ padsz = 4;
+ }
+ }
+ else {
+ padsz = 2;
+ }
+ if (0 != dk4ma_write_hex_unsigned(nb, sznb, c32, padsz, NULL)) {
+ dk4app_log_3(app, dmsg, szdmsg, DK4_LL_ERROR, 31, 32, nb);
+ }
+#if TRACE_DEBUG
+ else { $? "! Bug, should not happen"
+ }
+#endif
+ }
+ }
+ $? "- dk4uc2l_putc32_app"
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_c32_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c32_t *str,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ int back = 0;
+ int mm = 0;
+ $? "+ dk4uc2l_string_c32_app"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ while (dkC32(0) != *str) {
+ dk4uc2l_putc32_app(wstrm, ulptr, *(str++), &mm, &back, app);
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+
+ finished:
+ $? "- dk4uc2l_string_c32_app %d", back
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_c16_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c16_t *str,
+ dk4_app_t *app
+)
+{
+ dk4_utf16_decoder_t dec;
+ dk4_er_t er;
+ dk4_c32_t c32;
+ int mm = 0;
+ int back = 0;
+ int err = 0;
+ $? "+ dk4uc2l_string_c16_app"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ dk4utf16_init(&dec);
+ while ((dkC16(0) != *str) && (0 == err)) {
+ switch (dk4utf16_add(&dec, *(str++))) {
+ case DK4_EDSTM_FINISHED : {
+ c32 = dk4utf16_get(&dec);
+ dk4utf16_init(&dec);
+ dk4uc2l_putc32_app(wstrm, ulptr, c32, &mm, &back, app);
+ } break;
+ case DK4_EDSTM_ERROR : {
+ err = 1;
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ } break;
+ }
+ }
+ if (0 == err) {
+ if (0 == dk4utf16_is_empty(&dec)) {
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ }
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ finished:
+ $? "- dk4uc2l_string_c16_app %d", back
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_utf8_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+)
+{
+ dk4_utf8_decoder_t dec;
+ dk4_er_t er;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+ int err = 0;
+ $? "+ dk4uc2l_string_utf8_app"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ dk4utf8_init(&dec);
+ while(('\0' != *str) && (0 == err)) {
+ switch (dk4utf8_add(&dec, (unsigned char)(*(str++)))) {
+ case DK4_EDSTM_FINISHED : {
+ c32 = dk4utf8_get(&dec);
+ dk4utf8_init(&dec);
+ dk4uc2l_putc32_app(wstrm, ulptr, c32, &mm, &back, app);
+ } break;
+ case DK4_EDSTM_ERROR : {
+ err = 1;
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ } break;
+ }
+ }
+ if (0 == err) {
+ if (0 == dk4utf8_is_empty(&dec)) {
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ }
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ finished:
+ $? "- dk4uc2l_string_utf8_app %d", back
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_ansi_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+ $? "+ dk4uc2l_string_ansi_app"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ while ('\0' != *str) {
+ if (0 != dk4ansi_decode(&c32, (unsigned char)(*(str++)))) {
+ dk4uc2l_putc32_app(wstrm, ulptr, c32, &mm, &back, app);
+ }
+ else {
+ back = 0;
+ /* ##### ERROR: Decoding failed */
+ }
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ finished:
+ $? "- dk4uc2l_string_ansi_app %d", back
+ return back;
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_ascii_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+)
+{
+ dk4_er_t er;
+ dk4_c32_t c32;
+ int back = 0;
+ int mm = 0;
+ $? "+ dk4uc2l_string_ascii_app"
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ /* Check arguments
+ */
+ if ((NULL == wstrm) || (NULL == ulptr) || (NULL == str)) {
+ goto finished;
+ }
+
+ /* Process string
+ */
+ back = 1;
+ while ('\0' != *str) {
+ c32 = (dk4_c32_t)((unsigned char)(*(str++)));
+ dk4uc2l_putc32_app(wstrm, ulptr, c32, &mm, &back, app);
+ }
+
+ /* Finalize math mode if necessary
+ */
+ if (0 != mm) {
+ dk4error_init(&er);
+ if (0 == dk4stream_write_char_string(wstrm, dk4uc2l_mm[1], &er)) {
+ back = 0;
+ /* ERROR: Write failed */
+ dk4app_log_base1(app, DK4_LL_ERROR, 128);
+ }
+ }
+ finished:
+ $? "- dk4uc2l_string_ascii_app %d", back
+ return back;
+}
+
+
+
+int
+dk4uc2l_string_c8_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ int ie,
+ dk4_app_t *app
+)
+{
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+ switch (ie) {
+ case DK4_ENCODING_UTF8 : {
+ return (dk4uc2l_string_utf8_app(wstrm, ulptr, str, app));
+ } break;
+ case DK4_ENCODING_WIN1252 : {
+ return (dk4uc2l_string_ansi_app(wstrm, ulptr, str, app));
+ } break;
+ default : {
+ return (dk4uc2l_string_ascii_app(wstrm, ulptr, str, app));
+ } break;
+ }
+}
+
+
+
+/* ##### untested */
+int
+dk4uc2l_string_dk_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dkChar *str,
+#if DK4_CHAR_SIZE > 1
+ int DK4_ARG_UNUSED(ie),
+#else
+ int ie,
+#endif
+ dk4_app_t *app
+)
+{
+#if DK4_CHAR_SIZE > 1
+ DK4_UNUSED_ARG(ie)
+#endif
+#if DK4_USE_ASSERT
+ assert(NULL != wstrm);
+ assert(NULL != ulptr);
+ assert(NULL != str);
+#endif
+#if DK4_CHAR_SIZE > 1
+#if DK4_CHAR_SIZE > 2
+ return (dk4uc2l_string_c32_app(wstrm, ulptr, str, app));
+#else
+ return (dk4uc2l_string_c16_app(wstrm, ulptr, str, app));
+#endif
+#else
+ return (dk4uc2l_string_c8_app(wstrm, ulptr, str, ie, app));
+#endif
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4uc2la.h b/support/dktools/dk4uc2la.h
new file mode 100644
index 0000000000..7387a231a8
--- /dev/null
+++ b/support/dktools/dk4uc2la.h
@@ -0,0 +1,260 @@
+/*
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4uc2la.ctr
+*/
+
+#ifndef DK4UC2LA_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4UC2LA_H_INCLUDED 1
+
+
+#line 10 "dk4uc2la.ctr"
+
+/** @file dk4uc2la.h Text to LaTeX conversion.
+
+LaTeX sequences to represent a 32 bit character are found in lookup tables
+in the ${datarootdir}/dktools/charmap directory. The functions in this
+module read those lookup tables needed, cache the contents and provide
+LaTeX sequences.
+
+After finishing output you can write recommendations (i.e. LaTeX packages
+to include, font encoding to use) as comments to the file.
+
+The functions in this module supported immediate error reporting
+using the dk4_app_t data type.
+The functions in the dk4uc2l module support restricted and delayed
+error reporting using the dk4_er_t module.
+
+Functions from the dk4uc2la and dk4uc2l module can be used combined.
+A typical scenario is to use the dk4uc2l_open_app_ex1() function with la
+set to 1 to open a conversion structure. This will read all the data files
+and store all contained LaTeX encodings in memory when opening the structure.
+Errors - i.e. failed memory allocations or syntax error in data files - are
+reported immediately.
+Later the dk4uc2l_find() function can be used. As problematic errors like
+failed memory allocations are already reported, a NULL return value can
+only indicate a missing encoding.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4UC2L_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4uc2l.h"
+#else
+#include <dktools-4/dk4uc2l.h>
+#endif
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4app.h"
+#else
+#include <dktools-4/dk4app.h>
+#endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open conversion structure, dynamically allocate memory.
+ Extended version 1.
+ @param dn Directory name containing the data files.
+ @param app Application structure for diagnostics, may be NULL.
+ @param la Flag: Immediately load all data files.
+ @return Pointer to conversion structure on success, NULL on error.
+
+ Use dk4uc2l_close() to close the conversion structure when done
+ with it.
+*/
+dk4_uc2l_t *
+dk4uc2l_open_app_ex1(const dkChar *dn, dk4_app_t *app, int la);
+
+/** Open conversion structure, dynamically allocate memory.
+ @param dn Directory name containing the data files.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Pointer to conversion structure on success, NULL on error.
+
+ Use dk4uc2l_close() to close the conversion structure when done
+ with it.
+*/
+dk4_uc2l_t *
+dk4uc2l_open_app(const dkChar *dn, dk4_app_t *app);
+
+/** Open conversion structure, dynamically allocate memory.
+ Extended version 1.
+ The directory containing the data files is obtained from
+ the application (if not NULL), ${datarootdir}/dktools/charmap
+ is used by default.
+ @param app Application structure for diagnostics, may be NULL.
+ @param la Flag: Immediately load all data files.
+ @return Pointer to conversion structure on success, NULL on error.
+
+ Use dk4uc2l_close() to close the conversion structure when done
+ with it.
+*/
+dk4_uc2l_t *
+dk4uc2l_open_from_app_ex1(dk4_app_t *app, int la);
+
+/** Open conversion structure, dynamically allocate memory.
+ The directory containing the data files is obtained from
+ the application (if not NULL), ${datarootdir}/dktools/charmap
+ is used by default.
+ @param app Application structure for diagnostics, may be NULL.
+ @return Pointer to conversion structure on success, NULL on error.
+
+ Use dk4uc2l_close() to close the conversion structure when done
+ with it.
+*/
+dk4_uc2l_t *
+dk4uc2l_open_from_app(dk4_app_t *app);
+
+/** Find LaTeX encoding for one 32 bit character.
+ Error messages are written using app only for internal errors
+ (like "not enough memory" or syntax errors in data files).
+ No error message is written if no LaTeX encoding was found,
+ writing such error messages is left up to the calling code
+ (as you probably want to restrict the number of such messages).
+ @param ulptr Conversion structure.
+ @param c Character to search encoding for.
+ @param mm Flag: Math mode (1) or text mode (0).
+ @param app Application structure for diagnostics, may be NULL.
+ @return Pointer to encoding string on success, NULL on failure
+ (error or not found).
+*/
+const char *
+dk4uc2l_find_app(dk4_uc2l_t *ulptr, dk4_c32_t c, int mm, dk4_app_t *app);
+
+/** Write string of 32 bit characters.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c32_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c32_t *str,
+ dk4_app_t *app
+);
+
+/** Write string of 16 bit characters.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c16_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dk4_c16_t *str,
+ dk4_app_t *app
+);
+
+/** Write UTF-8 encoded string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_utf8_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+);
+
+/** Write ANSI encoded string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_ansi_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+);
+
+/** Write ASCII encoded string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_ascii_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ dk4_app_t *app
+);
+
+/** Write char string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param ie Input encoding.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_c8_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const char *str,
+ int ie,
+ dk4_app_t *app
+);
+
+/** Write dkChar string.
+ @param wstrm Stream to write to.
+ @param ulptr Conversion structure.
+ @param str String to write.
+ @param ie Input encoding.
+ @param app Application structure for diagnostics, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_string_dk_app(
+ dk4_stream_t *wstrm,
+ dk4_uc2l_t *ulptr,
+ const dkChar *str,
+ int ie,
+ dk4_app_t *app
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+
+#endif
diff --git a/support/dktools/dk4ufi.c b/support/dktools/dk4ufi.c
index 9d0339ead0..295cea7402 100644
--- a/support/dktools/dk4ufi.c
+++ b/support/dktools/dk4ufi.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ufi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ufi.ctr
*/
/** @file dk4ufi.c The dk4ufi module.
*/
-#line 58 "dk4ufi.ctr"
+#line 74 "dk4ufi.ctr"
#include "dk4conf.h"
@@ -49,11 +27,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4ufi08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4ufi_get(dk4_ufi_t *dptr, const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ufi_get_wc(dptr, fn, erp));
#else
@@ -66,6 +54,10 @@ dk4ufi_get(dk4_ufi_t *dptr, const dkChar *fn, dk4_er_t *erp)
int
dk4ufi_get_l(dk4_ufi_t *dptr, const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ufi_get_l_wc(dptr, fn, erp));
#else
diff --git a/support/dktools/dk4ufi.ctr b/support/dktools/dk4ufi.ctr
index 9ebf98da17..9a42e66f0b 100644
--- a/support/dktools/dk4ufi.ctr
+++ b/support/dktools/dk4ufi.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -18,12 +18,28 @@ license = bsd
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4UFIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -66,11 +82,21 @@ dk4ufi_get_l(dk4_ufi_t *dptr, const dkChar *fn, dk4_er_t *erp);
#include "dk4ufi08.h"
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
int
dk4ufi_get(dk4_ufi_t *dptr, const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ufi_get_wc(dptr, fn, erp));
#else
@@ -83,6 +109,10 @@ dk4ufi_get(dk4_ufi_t *dptr, const dkChar *fn, dk4_er_t *erp)
int
dk4ufi_get_l(dk4_ufi_t *dptr, const dkChar *fn, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4ufi_get_l_wc(dptr, fn, erp));
#else
diff --git a/support/dktools/dk4ufi.h b/support/dktools/dk4ufi.h
index 6ebdb4d194..9ee13016c1 100644
--- a/support/dktools/dk4ufi.h
+++ b/support/dktools/dk4ufi.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ufi.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ufi.ctr
*/
#ifndef DK4UFI_H_INCLUDED
@@ -50,12 +28,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4UFIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4ufi08.c b/support/dktools/dk4ufi08.c
index 4bd00406f8..931ce8386d 100644
--- a/support/dktools/dk4ufi08.c
+++ b/support/dktools/dk4ufi08.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ufi08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ufi08.ctr
*/
/** @file dk4ufi08.c The dk4ufi08 module.
*/
-#line 92 "dk4ufi08.ctr"
+#line 108 "dk4ufi08.ctr"
#include "dk4conf.h"
@@ -53,6 +31,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4ufi08.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 132 "dk4ufi08.ctr"
+
+
int
dk4ufi_get_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
@@ -64,6 +55,10 @@ dk4ufi_get_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
DWORD dwattr;
int i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dwattr = GetFileAttributesA(fn);
if (INVALID_FILE_ATTRIBUTES == dwattr) {
@@ -122,15 +117,29 @@ dk4ufi_get_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
#else
dk4_stat_t stb;
int back = 0;
+
+
+#line 208 "dk4ufi08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
if (0 != dk4stat_c8(&stb, fn, erp)) {
- dptr->dev = stb.st_dev;
- dptr->ino = stb.st_ino;
+ dptr->dev = stb.st_dev;
+
+#line 215 "dk4ufi08.ctr"
+ dptr->ino = stb.st_ino;
+
+#line 216 "dk4ufi08.ctr"
back = 1;
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 222 "dk4ufi08.ctr"
return back;
#endif
}
@@ -147,6 +156,10 @@ dk4ufi_get_l_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
DWORD dwattr;
int i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dwattr = GetFileAttributesA(fn);
if (INVALID_FILE_ATTRIBUTES == dwattr) {
@@ -205,15 +218,29 @@ dk4ufi_get_l_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
#else
dk4_stat_t stb;
int back = 0;
+
+
+#line 301 "dk4ufi08.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
if (0 != dk4stat_l_c8(&stb, fn, erp)) {
- dptr->dev = stb.st_dev;
- dptr->ino = stb.st_ino;
+ dptr->dev = stb.st_dev;
+
+#line 308 "dk4ufi08.ctr"
+ dptr->ino = stb.st_ino;
+
+#line 309 "dk4ufi08.ctr"
back = 1;
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+
+
+#line 315 "dk4ufi08.ctr"
return back;
#endif
}
diff --git a/support/dktools/dk4ufi08.ctr b/support/dktools/dk4ufi08.ctr
index 5bfdd4d4dc..8899b98902 100644
--- a/support/dktools/dk4ufi08.ctr
+++ b/support/dktools/dk4ufi08.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -15,12 +15,28 @@ license = bsd
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4UFI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -104,6 +120,17 @@ dk4ufi_get_l_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp);
#include "dk4ufi08.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
int
dk4ufi_get_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
@@ -115,6 +142,10 @@ dk4ufi_get_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
DWORD dwattr;
int i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dwattr = GetFileAttributesA(fn);
if (INVALID_FILE_ATTRIBUTES == dwattr) {
@@ -173,15 +204,21 @@ dk4ufi_get_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
#else
dk4_stat_t stb;
int back = 0;
+ $? "+ dk4ufi_get_c8 \"%!8s\"", TR_8STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
if (0 != dk4stat_c8(&stb, fn, erp)) {
- dptr->dev = stb.st_dev;
- dptr->ino = stb.st_ino;
+ dptr->dev = stb.st_dev; $? ". dev = %lu", (unsigned long)(stb.st_dev)
+ dptr->ino = stb.st_ino; $? ". ino = %lu", (unsigned long)(stb.st_ino)
back = 1;
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4ufi_get_c8 %d", back
return back;
#endif
}
@@ -198,6 +235,10 @@ dk4ufi_get_l_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
DWORD dwattr;
int i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dwattr = GetFileAttributesA(fn);
if (INVALID_FILE_ATTRIBUTES == dwattr) {
@@ -256,15 +297,21 @@ dk4ufi_get_l_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp)
#else
dk4_stat_t stb;
int back = 0;
+ $? "+ dk4ufi_get_l_c8 \"%!8s\"", TR_8STR(fn)
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
if (0 != dk4stat_l_c8(&stb, fn, erp)) {
- dptr->dev = stb.st_dev;
- dptr->ino = stb.st_ino;
+ dptr->dev = stb.st_dev; $? ". dev = %lu", (unsigned long)(stb.st_dev)
+ dptr->ino = stb.st_ino; $? ". dev = %lu", (unsigned long)(stb.st_ino)
back = 1;
}
} else {
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
+ $? "- dk4ufi_get_l_c8 %d", back
return back;
#endif
}
diff --git a/support/dktools/dk4ufi08.h b/support/dktools/dk4ufi08.h
index 97571d5914..1833ffe3b2 100644
--- a/support/dktools/dk4ufi08.h
+++ b/support/dktools/dk4ufi08.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ufi08.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ufi08.ctr
*/
#ifndef DK4UFI08_H_INCLUDED
@@ -49,12 +27,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4UFI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4ufic.c b/support/dktools/dk4ufic.c
index b8a0fe203c..adbb0dc531 100644
--- a/support/dktools/dk4ufic.c
+++ b/support/dktools/dk4ufic.c
@@ -1,49 +1,40 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ufic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ufic.ctr
*/
/** @file dk4ufic.c The dk4ufic module.
*/
-#line 36 "dk4ufic.ctr"
+#line 48 "dk4ufic.ctr"
+#include "dk4conf.h"
#include "dk4ufic.h"
+
+
+
+
+#line 55 "dk4ufic.ctr"
+
+
+
int
dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r)
{
+ int back = 0;
+
+
+#line 63 "dk4ufic.ctr"
if (NULL != l) {
if (NULL != r) {
#if DK4_ON_WINDOWS
@@ -74,21 +65,32 @@ dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r)
}
#else
if (l->dev > r->dev) {
- back = 1;
+ back = 1;
+
+#line 94 "dk4ufic.ctr"
} else {
if (l->dev < r->dev) {
- back = -1;
+ back = -1;
+
+#line 97 "dk4ufic.ctr"
}
}
if (0 == back) {
if (l->ino > r->ino) {
- back = 1;
+ back = 1;
+
+#line 102 "dk4ufic.ctr"
} else {
if (l->ino < r->ino) {
- back = -1;
+ back = -1;
+
+#line 105 "dk4ufic.ctr"
}
}
}
+
+
+#line 109 "dk4ufic.ctr"
#endif
} else {
back = 1;
@@ -98,5 +100,9 @@ dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r)
back = -1;
}
}
+
+
+#line 119 "dk4ufic.ctr"
+ return back;
}
diff --git a/support/dktools/dk4ufic.ctr b/support/dktools/dk4ufic.ctr
index e32216d0a9..70d47eca2a 100644
--- a/support/dktools/dk4ufic.ctr
+++ b/support/dktools/dk4ufic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -11,8 +11,20 @@ license = bsd
Compare unique file identifiers.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4UFIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
#endif
#ifdef __cplusplus
@@ -34,11 +46,20 @@ dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r);
%% module
+#include "dk4conf.h"
#include "dk4ufic.h"
+
+
+$!trace-include
+
+
+
int
dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r)
{
+ int back = 0;
+ $? "+ dk4ufi_compare"
if (NULL != l) {
if (NULL != r) {
#if DK4_ON_WINDOWS
@@ -69,21 +90,22 @@ dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r)
}
#else
if (l->dev > r->dev) {
- back = 1;
+ back = 1; $? ". left dev larger"
} else {
if (l->dev < r->dev) {
- back = -1;
+ back = -1; $? ". right dev larger"
}
}
if (0 == back) {
if (l->ino > r->ino) {
- back = 1;
+ back = 1; $? ". left ino larger"
} else {
if (l->ino < r->ino) {
- back = -1;
+ back = -1; $? ". right ino larger"
}
}
}
+ $? ". %lu/%lu %lu/%lu", (unsigned long)(l->dev), (unsigned long)(l->ino), (unsigned long)(r->dev), (unsigned long)(r->ino)
#endif
} else {
back = 1;
@@ -93,5 +115,7 @@ dk4ufi_compare(const dk4_ufi_t *l, const dk4_ufi_t *r)
back = -1;
}
}
+ $? "- dk4ufi_compare %d", back
+ return back;
}
diff --git a/support/dktools/dk4ufic.h b/support/dktools/dk4ufic.h
index b5ae1112c0..8c91ba0d82 100644
--- a/support/dktools/dk4ufic.h
+++ b/support/dktools/dk4ufic.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ufic.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ufic.ctr
*/
#ifndef DK4UFIC_H_INCLUDED
@@ -44,8 +22,20 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Compare unique file identifiers.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4UFIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4ufit.h b/support/dktools/dk4ufit.h
index 8ddaf35c8c..d889b91d72 100644
--- a/support/dktools/dk4ufit.h
+++ b/support/dktools/dk4ufit.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4UFIT_H_INCLUDED
/** Protection against multiple inclusion. */
#define DK4UFIT_H_INCLUDED 1
@@ -6,16 +11,28 @@
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#if !DK4_ON_WINDOWS
#ifndef DK4STATT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4statt.h"
+#else
+#include <dktools-4/dk4statt.h>
+#endif
#endif
#endif
diff --git a/support/dktools/dk4ufiwc.c b/support/dktools/dk4ufiwc.c
index 7accaca7b5..0efb040db9 100644
--- a/support/dktools/dk4ufiwc.c
+++ b/support/dktools/dk4ufiwc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ufiwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ufiwc.ctr
*/
/** @file dk4ufiwc.c The dk4ufiwc module.
*/
-#line 93 "dk4ufiwc.ctr"
+#line 109 "dk4ufiwc.ctr"
#include "dk4conf.h"
@@ -48,11 +26,29 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ufiwc.h"
+#include "dk4unused.h"
+
int
-dk4ufi_get_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
+dk4ufi_get_wc(
+#if DK4_ON_WINDOWS
+ dk4_ufi_t *dptr,
+ const wchar_t *fn,
+#else
+ dk4_ufi_t * DK4_ARG_UNUSED(dptr),
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
BY_HANDLE_FILE_INFORMATION bhfi;
@@ -61,6 +57,10 @@ dk4ufi_get_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
DWORD dwattr;
int i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES == dwattr) {
@@ -117,6 +117,8 @@ dk4ufi_get_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -125,7 +127,16 @@ dk4ufi_get_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
int
-dk4ufi_get_l_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
+dk4ufi_get_l_wc(
+#if DK4_ON_WINDOWS
+ dk4_ufi_t *dptr,
+ const wchar_t *fn,
+#else
+ dk4_ufi_t * DK4_ARG_UNUSED(dptr),
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
BY_HANDLE_FILE_INFORMATION bhfi;
@@ -134,6 +145,10 @@ dk4ufi_get_l_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
DWORD dwattr;
int i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES == dwattr) {
@@ -191,6 +206,8 @@ dk4ufi_get_l_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4ufiwc.ctr b/support/dktools/dk4ufiwc.ctr
index ac75b44327..8163a76f38 100644
--- a/support/dktools/dk4ufiwc.ctr
+++ b/support/dktools/dk4ufiwc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -16,12 +16,28 @@ license = bsd
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4UFI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
@@ -100,11 +116,29 @@ dk4ufi_get_l_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4ufiwc.h"
+#include "dk4unused.h"
+
int
-dk4ufi_get_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
+dk4ufi_get_wc(
+#if DK4_ON_WINDOWS
+ dk4_ufi_t *dptr,
+ const wchar_t *fn,
+#else
+ dk4_ufi_t * DK4_ARG_UNUSED(dptr),
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
BY_HANDLE_FILE_INFORMATION bhfi;
@@ -113,6 +147,10 @@ dk4ufi_get_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
DWORD dwattr;
int i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES == dwattr) {
@@ -169,6 +207,8 @@ dk4ufi_get_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -177,7 +217,16 @@ dk4ufi_get_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
int
-dk4ufi_get_l_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
+dk4ufi_get_l_wc(
+#if DK4_ON_WINDOWS
+ dk4_ufi_t *dptr,
+ const wchar_t *fn,
+#else
+ dk4_ufi_t * DK4_ARG_UNUSED(dptr),
+ const wchar_t * DK4_ARG_UNUSED(fn),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
BY_HANDLE_FILE_INFORMATION bhfi;
@@ -186,6 +235,10 @@ dk4ufi_get_l_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
DWORD dwattr;
int i;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fn);
+#endif
if ((NULL != dptr) && (NULL != fn)) {
dwattr = GetFileAttributesW(fn);
if (INVALID_FILE_ATTRIBUTES == dwattr) {
@@ -243,6 +296,8 @@ dk4ufi_get_l_wc(dk4_ufi_t *dptr, const wchar_t *fn, dk4_er_t *erp)
}
return back;
#else
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(fn)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4ufiwc.h b/support/dktools/dk4ufiwc.h
index a86407553a..3766db6d54 100644
--- a/support/dktools/dk4ufiwc.h
+++ b/support/dktools/dk4ufiwc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4ufiwc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4ufiwc.ctr
*/
#ifndef DK4UFIWC_H_INCLUDED
@@ -49,12 +27,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CRT on Windows: Not used.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef DK4UFI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4unused.h b/support/dktools/dk4unused.h
new file mode 100644
index 0000000000..77967441e9
--- /dev/null
+++ b/support/dktools/dk4unused.h
@@ -0,0 +1,104 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef DK4UNUSED_H_INCLUDED
+
+/** @file dk4unused.h Mark function arguments as unused by intent.
+*/
+
+/** Protection against multiple inclusions.
+*/
+#define DK4UNUSED_H_INCLUDED 1
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+
+
+/*
+ Unused arguments can occur in callback functions which
+ must follow a given prototype.
+ ------------------------------------------------------
+*/
+
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+/** Mark function argument x as intentionally unused.
+*/
+#define DK4_ARG_UNUSED(x) x __attribute__((unused))
+#else
+/** Mark function argument x as intentionally unused.
+*/
+#define DK4_ARG_UNUSED(x) x
+#endif
+
+
+
+/*
+ For some functions I used an equal style prototype.
+ There is no need for the unused arguments in the prototype.
+ Removing the unused arguments from the function declaration would mean
+ removing the appropriate arguments from all function calls.
+ The involved arguments are typically items in lists of same type
+ arguments.
+ Accidently removing a wrong argument from the call would not result in
+ compiler warnings, so there would be a high risk of introducing
+ new bugs.
+ ----------------------------------------------------------------------
+*/
+
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+/** Mark function argument x as intentionally unused.
+*/
+#define DK4_SILENCE_ARG_UNUSED(x) x __attribute__((unused))
+#else
+/** Mark function argument x as intentionally unused.
+*/
+#define DK4_SILENCE_ARG_UNUSED(x) x
+#endif
+
+
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+/** Mark variable x as intentionally unused.
+*/
+#define DK4_VAR_UNUSED(x) x __attribute__((unused))
+#else
+#if defined(_MSC_VER) && (_MSC_VER >= 1700)
+/** Mark variable x as intentionally unused.
+*/
+#define DK4_VAR_UNUSED(x) __pragma(warning(suppress: 4100)) x
+#else
+/** Mark variable x as intentionally unused.
+*/
+#define DK4_VAR_UNUSED(x) x
+#endif
+#endif
+
+
+
+#if DK4_HAVE_ATTRIBUTE_UNUSED
+/** Do anything with an unused function argument to suppress compiler
+ warnings.
+*/
+#define DK4_UNUSED_ARG(x)
+#else
+/** Do anything with an unused function argument to suppress compiler
+ warnings.
+*/
+#if (_WIN32) && defined(_MSC_VER)
+/* define DK4_UNUSED_ARG(x) UNREFERENCED_PARAMETER(x); */
+#define DK4_UNUSED_ARG(x) (void)(x);
+#else
+#define DK4_UNUSED_ARG(x) (void)(x);
+#endif
+#endif
+
+
+
+#endif
diff --git a/support/dktools/dk4use.ctr b/support/dktools/dk4use.ctr
new file mode 100644
index 0000000000..3445bd031b
--- /dev/null
+++ b/support/dktools/dk4use.ctr
@@ -0,0 +1,87 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2019-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4use.h Define constants which feature to use.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+/*
+ For cross-compiled programs wchar_t string output failed
+ after _setmode(_fileno(stdout), _O_U16TEXT);
+ So we use it only when using MS C compiler.
+*/
+#ifndef DK4_USE_SETMODE_UTF16
+#if (_WIN32) && (DK4_CHAR_SIZE > 1) && defined(_MSC_VER) \
+ && DK4_HAVE__SETMODE && defined(_O_U16TEXT)
+
+/** Use _setmode() before writing wchar_t strings on Windows.
+*/
+#define DK4_USE_SETMODE_UTF16 1
+#else
+/** Do not use _setmode() before writing wchar_t strings on Windows.
+*/
+#define DK4_USE_SETMODE_UTF16 0
+#endif
+#endif
+
+/*
+ Here we keep the possibility to select more detailed
+ where to use _setmode(_fileno(stdout), _O_BINARY); and back.
+*/
+#ifndef DK4_USE_SETMODE_BINARY
+#if (_WIN32) && defined (_MSC_VER) && DK_HAVE__SETMODE && defined(_O_BINARY)
+/** Switch between binary mode and text mode.
+*/
+#define DK4_USE_SETMODE_BINARY 1
+#else
+/** Do not switch between binary and text mode.
+*/
+#define DK4_USE_SETMODE_BINARY 0
+#endif
+#endif
+
+#ifndef DK4_USE_PRAGMA_WARNING_DISABLE
+#if (_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1700)
+/** Use "pragma warning (disable:4206)" and alike.
+*/
+#define DK4_USE_PRAGMA_WARNING_DISABLE 1
+#else
+/** Do not use "pragma warning (disable:4206)" and alike.
+*/
+#define DK4_USE_PRAGMA_WARNING_DISABLE 0
+#endif
+#endif
+
+#ifndef DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS
+#if (_WIN32) && defined(_MSC_VER)
+/** Use Windows floating point exceptions.
+*/
+#define DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS 1
+#else
+/** Do not use Windows floating point exceptions.
+*/
+#define DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS 0
+#endif
+#endif
+
+#ifndef DK4_USE_PARANOID_MEMORY_CHECK
+/** Paranoid memory check is not enabled as this is self-made
+ code probably decreasing performance.
+ When calling dk4mem_reset_secure() this check checks each
+ byte to be zero.
+*/
+#define DK4_USE_PARANOID_MEMORY_CHECK 0
+#endif
+
diff --git a/support/dktools/dk4use.h b/support/dktools/dk4use.h
new file mode 100644
index 0000000000..b8331ee0ff
--- /dev/null
+++ b/support/dktools/dk4use.h
@@ -0,0 +1,101 @@
+/*
+Copyright (C) 2019-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4use.ctr
+*/
+
+#ifndef DK4USE_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4USE_H_INCLUDED 1
+
+
+#line 8 "dk4use.ctr"
+
+/** @file dk4use.h Define constants which feature to use.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+/*
+ For cross-compiled programs wchar_t string output failed
+ after _setmode(_fileno(stdout), _O_U16TEXT);
+ So we use it only when using MS C compiler.
+*/
+#ifndef DK4_USE_SETMODE_UTF16
+#if (_WIN32) && (DK4_CHAR_SIZE > 1) && defined(_MSC_VER) \
+ && DK4_HAVE__SETMODE && defined(_O_U16TEXT)
+
+/** Use _setmode() before writing wchar_t strings on Windows.
+*/
+#define DK4_USE_SETMODE_UTF16 1
+#else
+/** Do not use _setmode() before writing wchar_t strings on Windows.
+*/
+#define DK4_USE_SETMODE_UTF16 0
+#endif
+#endif
+
+/*
+ Here we keep the possibility to select more detailed
+ where to use _setmode(_fileno(stdout), _O_BINARY); and back.
+*/
+#ifndef DK4_USE_SETMODE_BINARY
+#if (_WIN32) && defined (_MSC_VER) && DK_HAVE__SETMODE && defined(_O_BINARY)
+/** Switch between binary mode and text mode.
+*/
+#define DK4_USE_SETMODE_BINARY 1
+#else
+/** Do not switch between binary and text mode.
+*/
+#define DK4_USE_SETMODE_BINARY 0
+#endif
+#endif
+
+#ifndef DK4_USE_PRAGMA_WARNING_DISABLE
+#if (_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1700)
+/** Use "pragma warning (disable:4206)" and alike.
+*/
+#define DK4_USE_PRAGMA_WARNING_DISABLE 1
+#else
+/** Do not use "pragma warning (disable:4206)" and alike.
+*/
+#define DK4_USE_PRAGMA_WARNING_DISABLE 0
+#endif
+#endif
+
+#ifndef DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS
+#if (_WIN32) && defined(_MSC_VER)
+/** Use Windows floating point exceptions.
+*/
+#define DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS 1
+#else
+/** Do not use Windows floating point exceptions.
+*/
+#define DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS 0
+#endif
+#endif
+
+#ifndef DK4_USE_PARANOID_MEMORY_CHECK
+/** Paranoid memory check is not enabled as this is self-made
+ code probably decreasing performance.
+ When calling dk4mem_reset_secure() this check checks each
+ byte to be zero.
+*/
+#define DK4_USE_PARANOID_MEMORY_CHECK 0
+#endif
+
+
+#endif
diff --git a/support/dktools/dk4user.c b/support/dktools/dk4user.c
index 222e6a2ee8..2b0be98b29 100644
--- a/support/dktools/dk4user.c
+++ b/support/dktools/dk4user.c
@@ -1,45 +1,24 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4user.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4user.ctr
*/
/** @file dk4user.c The dk4user module.
*/
-#line 87 "dk4user.ctr"
+#line 99 "dk4user.ctr"
+#include "dk4conf.h"
#include "dk4user.h"
#include "dk4str8.h"
#include "dk4strw.h"
@@ -50,6 +29,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4error.h"
#include "dk4masz.h"
#include "dk4mpl.h"
+#include "dk4unused.h"
#if DK4_ON_WINDOWS
@@ -88,11 +68,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 140 "dk4user.ctr"
+#line 160 "dk4user.ctr"
@@ -122,19 +108,33 @@ L"HOMEPATH",
NULL
-#line 160 "dk4user.ctr"
+#line 180 "dk4user.ctr"
};
#endif
int
-dk4user_get_logname(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
+dk4user_get_logname(
+ dkChar *pdst,
+ size_t szdst,
+#if DK4_ON_WINDOWS
+ int DK4_ARG_UNUSED(eff),
+#else
+ int eff,
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD sz;
int back = 0;
-#line 170 "dk4user.ctr"
+#line 199 "dk4user.ctr"
+ DK4_UNUSED_ARG(eff)
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
if ((NULL != pdst) && (0 < szdst)) {
sz = (DWORD)szdst;
#if DK4_CHAR_SIZE > 1
@@ -158,7 +158,7 @@ dk4user_get_logname(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 192 "dk4user.ctr"
+#line 226 "dk4user.ctr"
return back;
#else
#if DK4_CHAR_SIZE > 1
@@ -170,7 +170,11 @@ dk4user_get_logname(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
int back = 0;
-#line 202 "dk4user.ctr"
+#line 236 "dk4user.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
if ((NULL != pdst) && (0 < szdst)) {
if (0 != eff) { uid = geteuid(); } else { uid = getuid(); }
pwent = getpwuid(uid);
@@ -189,7 +193,7 @@ dk4user_get_logname(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 219 "dk4user.ctr"
+#line 257 "dk4user.ctr"
return back;
#endif
#endif
@@ -228,23 +232,27 @@ dk4user_get_i_ls_homedir(
NET_API_STATUS nStatus = 0; /* Network op result */
-#line 256 "dk4user.ctr"
+#line 294 "dk4user.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
dk4error_init(&er);
if (GetUserNameW(logname, &szlog)) {
-#line 258 "dk4user.ctr"
+#line 300 "dk4user.ctr"
if (DK4_SIZEOF(logname,wchar_t) >= szlog) {
-#line 259 "dk4user.ctr"
+#line 301 "dk4user.ctr"
logname[szlog] = L'\0';
nStatus = NetUserGetInfo(lsn, logname, (DWORD)4, (LPBYTE *)(&pbuf4));
if ((NERR_Success == nStatus) && (NULL != pbuf4)) {
-#line 262 "dk4user.ctr"
+#line 304 "dk4user.ctr"
if (ConvertSidToStringSidW(pbuf4->usri4_user_sid, &pStringSid)) {
-#line 264 "dk4user.ctr"
+#line 306 "dk4user.ctr"
sz = dk4ma_size_t_add(
dk4ma_size_t_add(
1,
@@ -260,22 +268,22 @@ dk4user_get_i_ls_homedir(
);
if (DK4_E_NONE == er.ec) {
-#line 278 "dk4user.ctr"
+#line 320 "dk4user.ctr"
(void)dk4ma_size_t_mul(sizeof(wchar_t), sz, &er);
if (DK4_E_NONE == er.ec) {
-#line 280 "dk4user.ctr"
+#line 322 "dk4user.ctr"
keyname = dk4mem_calloc(sizeof(wchar_t),sz,&er);
if (NULL != keyname) {
-#line 282 "dk4user.ctr"
+#line 324 "dk4user.ctr"
(void)dk4strw_cpy_s(keyname, sz, dk4user_kw[0], NULL);
(void)dk4strw_cat_s(keyname, sz, dk4user_kw[1], NULL);
(void)dk4strw_cat_s(keyname, sz, pStringSid, NULL);
wrkey = dk4wreg_open_key_wc(DK4_WREGKEY_HKLM, keyname, 0, &er);
if (NULL != wrkey) {
-#line 287 "dk4user.ctr"
+#line 329 "dk4user.ctr"
back = dk4wreg_get_expanded_string_wc(
wrkey,
dk4user_kw[2],
@@ -285,32 +293,32 @@ dk4user_get_i_ls_homedir(
&er
);
-#line 295 "dk4user.ctr"
+#line 337 "dk4user.ctr"
dk4wreg_close_key(wrkey);
} else {
-#line 297 "dk4user.ctr"
+#line 339 "dk4user.ctr"
/* ERROR: Failed to open key (reported) */
}
dk4mem_free(keyname);
} else {
-#line 301 "dk4user.ctr"
+#line 343 "dk4user.ctr"
/* ERROR: Memory (reported) */
}
} else {
-#line 304 "dk4user.ctr"
+#line 346 "dk4user.ctr"
/* ERROR: Overflow in size calculation (reported) */
}
} else {
-#line 307 "dk4user.ctr"
+#line 349 "dk4user.ctr"
/* ERROR: Overflow in size calculation (reported) */
}
} else {
-#line 310 "dk4user.ctr"
+#line 352 "dk4user.ctr"
/* ERROR: Failed to convert SID */
dk4error_set_simple_error_code(&er, DK4_E_NOT_FOUND);
}
@@ -319,7 +327,7 @@ dk4user_get_i_ls_homedir(
}
} else {
-#line 317 "dk4user.ctr"
+#line 359 "dk4user.ctr"
/* ERROR: No user info */
}
if (NULL != pbuf4) {
@@ -327,13 +335,13 @@ dk4user_get_i_ls_homedir(
}
} else {
-#line 323 "dk4user.ctr"
+#line 365 "dk4user.ctr"
/* ERROR: User name too long */
dk4error_set_simple_error_code(&er, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 327 "dk4user.ctr"
+#line 369 "dk4user.ctr"
/* ERROR: User name not found */
}
if (0 == back) {
@@ -341,7 +349,7 @@ dk4user_get_i_ls_homedir(
}
-#line 333 "dk4user.ctr"
+#line 375 "dk4user.ctr"
return back;
}
@@ -363,86 +371,90 @@ dk4user_get_i_homedir(wchar_t *pdst, size_t szdst, dk4_er_t *erp)
int back = 0;
-#line 353 "dk4user.ctr"
+#line 395 "dk4user.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
dk4error_init(&myerp);
back = dk4user_get_i_ls_homedir(pdst, szdst, NULL, &myerp);
-#line 356 "dk4user.ctr"
+#line 402 "dk4user.ctr"
if ((0 == back) && (DK4_E_NONE == myerp.ec)) {
-#line 357 "dk4user.ctr"
+#line 403 "dk4user.ctr"
lsn = _wgetenv(dk4user_kw[4]);
-#line 358 "dk4user.ctr"
+#line 404 "dk4user.ctr"
if (NULL != lsn) {
back = dk4strw_cpy_s(pdst, szdst, lsn, &myerp);
-#line 361 "dk4user.ctr"
+#line 407 "dk4user.ctr"
} else {
-#line 362 "dk4user.ctr"
+#line 408 "dk4user.ctr"
}
}
if ((0 == back) && (DK4_E_NONE == myerp.ec)) {
-#line 365 "dk4user.ctr"
+#line 411 "dk4user.ctr"
lsn = _wgetenv(dk4user_kw[5]);
hop = _wgetenv(dk4user_kw[6]);
if ((NULL != lsn) && (NULL != hop)) {
-#line 368 "dk4user.ctr"
+#line 414 "dk4user.ctr"
if (0 != dk4strw_cpy_s(pdst, szdst, lsn, &myerp)) {
back = dk4strw_cat_s(pdst, szdst, hop, &myerp);
-#line 371 "dk4user.ctr"
+#line 417 "dk4user.ctr"
} else {
-#line 372 "dk4user.ctr"
+#line 418 "dk4user.ctr"
}
} else {
-#line 374 "dk4user.ctr"
+#line 420 "dk4user.ctr"
}
}
if ((0 == back) && (DK4_E_NONE == myerp.ec)) {
-#line 377 "dk4user.ctr"
+#line 423 "dk4user.ctr"
lsn = _wgetenv(dk4user_kw[3]);
if (NULL != lsn) {
-#line 379 "dk4user.ctr"
+#line 425 "dk4user.ctr"
back = dk4user_get_i_ls_homedir(pdst, szdst, lsn, &myerp);
-#line 381 "dk4user.ctr"
+#line 427 "dk4user.ctr"
}
}
if ((0 == back) && (DK4_E_NONE == myerp.ec)) {
-#line 384 "dk4user.ctr"
+#line 430 "dk4user.ctr"
if (NULL != lsn) {
-#line 385 "dk4user.ctr"
+#line 431 "dk4user.ctr"
if (L'\\' == lsn[0]) {
if (L'\\' == lsn[1]) {
back = dk4user_get_i_ls_homedir(pdst, szdst, &(lsn[2]), &myerp);
-#line 389 "dk4user.ctr"
+#line 435 "dk4user.ctr"
} else {
-#line 390 "dk4user.ctr"
+#line 436 "dk4user.ctr"
}
} else {
-#line 392 "dk4user.ctr"
+#line 438 "dk4user.ctr"
}
} else {
-#line 394 "dk4user.ctr"
+#line 440 "dk4user.ctr"
}
}
if ((0 == back) && (DK4_E_NONE == myerp.ec)) {
@@ -452,7 +464,7 @@ dk4user_get_i_homedir(wchar_t *pdst, size_t szdst, dk4_er_t *erp)
dk4error_copy(erp, &myerp);
}
-#line 402 "dk4user.ctr"
+#line 448 "dk4user.ctr"
return back;
}
@@ -460,7 +472,16 @@ dk4user_get_i_homedir(wchar_t *pdst, size_t szdst, dk4_er_t *erp)
int
-dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
+dk4user_get_homedir(
+ dkChar *pdst,
+ size_t szdst,
+#if DK4_ON_WINDOWS
+ int DK4_ARG_UNUSED(eff),
+#else
+ int eff,
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
/* +++++ Windows +++++ */
@@ -470,20 +491,25 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
int back = 0;
-#line 418 "dk4user.ctr"
+#line 473 "dk4user.ctr"
+ DK4_UNUSED_ARG(eff)
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
if ((NULL != pdst) && (0 < szdst)) {
-#line 419 "dk4user.ctr"
+#line 479 "dk4user.ctr"
*pdst = dkT('\0');
#if DK4_CHAR_SIZE > 1
-#line 422 "dk4user.ctr"
+#line 482 "dk4user.ctr"
back = dk4user_get_i_homedir(pdst, szdst, erp);
#else
-#line 425 "dk4user.ctr"
+#line 485 "dk4user.ctr"
if (0 != dk4user_get_i_homedir(homew, DK4_SIZEOF(homew,wchar_t), erp)) {
back = dk4recode_utf16_to_ansi(pdst, szdst, homew, erp);
}
@@ -492,7 +518,7 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 432 "dk4user.ctr"
+#line 492 "dk4user.ctr"
return back;
/* ----- Windows ----- */
#else
@@ -509,7 +535,11 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
int back = 0;
-#line 447 "dk4user.ctr"
+#line 507 "dk4user.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
if ((NULL != pdst) && (0 < szdst)) {
if (0 != eff) { uid = geteuid(); } else { uid = getuid(); }
pwent = getpwuid(uid);
@@ -528,7 +558,7 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 464 "dk4user.ctr"
+#line 528 "dk4user.ctr"
return back;
/* ----- non-Windows char ----- */
#endif
diff --git a/support/dktools/dk4user.ctr b/support/dktools/dk4user.ctr
index 4d9d89afe4..0e339118a7 100644
--- a/support/dktools/dk4user.ctr
+++ b/support/dktools/dk4user.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,15 +14,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
@@ -86,6 +98,7 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4user.h"
#include "dk4str8.h"
#include "dk4strw.h"
@@ -96,6 +109,7 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp);
#include "dk4error.h"
#include "dk4masz.h"
#include "dk4mpl.h"
+#include "dk4unused.h"
#if DK4_ON_WINDOWS
@@ -134,6 +148,12 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp);
#endif
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -161,12 +181,26 @@ $!end
#endif
int
-dk4user_get_logname(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
+dk4user_get_logname(
+ dkChar *pdst,
+ size_t szdst,
+#if DK4_ON_WINDOWS
+ int DK4_ARG_UNUSED(eff),
+#else
+ int eff,
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
DWORD sz;
int back = 0;
$? "+ dk4user_get_logname (Windows)"
+ DK4_UNUSED_ARG(eff)
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
if ((NULL != pdst) && (0 < szdst)) {
sz = (DWORD)szdst;
#if DK4_CHAR_SIZE > 1
@@ -199,6 +233,10 @@ dk4user_get_logname(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
uid_t uid;
int back = 0;
$? "+ dk4user_get_logname (non-Windows, char)"
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
if ((NULL != pdst) && (0 < szdst)) {
if (0 != eff) { uid = geteuid(); } else { uid = getuid(); }
pwent = getpwuid(uid);
@@ -253,6 +291,10 @@ dk4user_get_i_ls_homedir(
int back = 0; /* Result */
NET_API_STATUS nStatus = 0; /* Network op result */
$? "+ dk4user_get_i_ls_homedir lsn=\"%!ws\"", TR_LSTR(lsn)
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
dk4error_init(&er);
if (GetUserNameW(logname, &szlog)) { $? ". user name found"
if (DK4_SIZEOF(logname,wchar_t) >= szlog) { $? ". name size ok"
@@ -350,6 +392,10 @@ dk4user_get_i_homedir(wchar_t *pdst, size_t szdst, dk4_er_t *erp)
wchar_t *hop = NULL;
int back = 0;
$? "+ dk4user_get_i_homedir"
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
dk4error_init(&myerp);
back = dk4user_get_i_ls_homedir(pdst, szdst, NULL, &myerp);
$? ". back = %d", back
@@ -406,7 +452,16 @@ dk4user_get_i_homedir(wchar_t *pdst, size_t szdst, dk4_er_t *erp)
int
-dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
+dk4user_get_homedir(
+ dkChar *pdst,
+ size_t szdst,
+#if DK4_ON_WINDOWS
+ int DK4_ARG_UNUSED(eff),
+#else
+ int eff,
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
/* +++++ Windows +++++ */
@@ -415,6 +470,11 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
#endif
int back = 0;
$? "+ dk4user_get_homedir"
+ DK4_UNUSED_ARG(eff)
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
if ((NULL != pdst) && (0 < szdst)) { $? ". arguments"
*pdst = dkT('\0');
#if DK4_CHAR_SIZE > 1
@@ -444,6 +504,10 @@ dk4user_get_homedir(dkChar *pdst, size_t szdst, int eff, dk4_er_t *erp)
uid_t uid;
int back = 0;
$? "+ dk4user_get_homedir (non-windows, char)"
+#if DK4_USE_ASSERT
+ assert(NULL != pdst);
+ assert(0 < szdst);
+#endif
if ((NULL != pdst) && (0 < szdst)) {
if (0 != eff) { uid = geteuid(); } else { uid = getuid(); }
pwent = getpwuid(uid);
diff --git a/support/dktools/dk4user.h b/support/dktools/dk4user.h
index 62bf5c3ef8..0c4070cbd8 100644
--- a/support/dktools/dk4user.h
+++ b/support/dktools/dk4user.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4user.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4user.ctr
*/
#ifndef DK4USER_H_INCLUDED
@@ -46,15 +24,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
diff --git a/support/dktools/dk4userf.c b/support/dktools/dk4userf.c
index 29b7a6b07a..77b5ac4ce2 100644
--- a/support/dktools/dk4userf.c
+++ b/support/dktools/dk4userf.c
@@ -1,44 +1,23 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4userf.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4userf.ctr
*/
/** @file dk4userf.c The dk4userf module.
*/
-#line 147 "dk4userf.ctr"
+#line 159 "dk4userf.ctr"
+#include "dk4conf.h"
#include "dk4userf.h"
#if DK4_HAVE_ERRNO_H
@@ -48,11 +27,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
-#ifdef _WIN32
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES 1
#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -72,10 +53,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4rec11.h"
#include "dk4rec17.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 183 "dk4userf.ctr"
+#line 204 "dk4userf.ctr"
@@ -86,6 +73,10 @@ dk4unserialize_file_uint16_t(uint16_t *dptr, FILE *fipo, dk4_er_t *erp)
uint16_t ui16;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
if (2 == fread(uc, 1, 2, fipo)) {
ui16 = (((uint16_t)(uc[0]) << 8) & 0xFF00U)
@@ -109,6 +100,10 @@ dk4unserialize_file_int16_t(int16_t *dptr, FILE *fipo, dk4_er_t *erp)
uint16_t ui;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
back = dk4unserialize_file_uint16_t(&ui, fipo, erp);
if (0 != back) {
@@ -130,13 +125,17 @@ dk4unserialize_file_uint32_t(uint32_t *dptr, FILE *fipo, dk4_er_t *erp)
int back = 0;
-#line 236 "dk4userf.ctr"
+#line 265 "dk4userf.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
-#line 237 "dk4userf.ctr"
+#line 270 "dk4userf.ctr"
if (4 == fread(uc, 1, 4, fipo)) {
-#line 238 "dk4userf.ctr"
+#line 271 "dk4userf.ctr"
ui32 = ((((uint32_t)(uc[0])) << 24) & 0xFF000000UL)
| ((((uint32_t)(uc[1])) << 16) & 0x00FF0000UL)
| ((((uint32_t)(uc[2])) << 8) & 0x0000FF00UL)
@@ -145,17 +144,17 @@ dk4unserialize_file_uint32_t(uint32_t *dptr, FILE *fipo, dk4_er_t *erp)
back = 1;
} else {
-#line 245 "dk4userf.ctr"
+#line 278 "dk4userf.ctr"
dk4error_set_simple_error_code(erp, DK4_E_READ_FAILED);
}
} else {
-#line 248 "dk4userf.ctr"
+#line 281 "dk4userf.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 251 "dk4userf.ctr"
+#line 284 "dk4userf.ctr"
return back;
}
@@ -166,6 +165,10 @@ dk4unserialize_file_int32_t(int32_t *dptr, FILE *fipo, dk4_er_t *erp)
{
uint32_t ui32;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
back = dk4unserialize_file_uint32_t(&ui32, fipo, erp);
if (0 != back) {
@@ -186,6 +189,10 @@ dk4unserialize_file_utf8_string(char **dptr, FILE *fipo, dk4_er_t *erp)
size_t ls = 0;
int back = 0;
uint16_t lgt = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
if (0 != dk4unserialize_file_uint16_t(&lgt, fipo, erp)) {
if (0 < lgt) {
@@ -224,6 +231,10 @@ dk4unserialize_file_double(double *dptr, FILE *fipo, dk4_er_t *erp)
char *tg = NULL;
double dv = 0.0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
if (0 != dk4unserialize_file_utf8_string(&bptr, fipo, erp)) {
if (NULL != bptr) {
@@ -274,6 +285,10 @@ dk4unserialize_file_dk_string(dkChar **dptr, int de, FILE *fipo, dk4_er_t *erp)
char *putf8 = NULL;
size_t szdk = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
if (0 != dk4unserialize_file_utf8_string(&putf8, fipo, erp)) {
if (NULL != putf8) {
@@ -325,7 +340,7 @@ dk4unserialize_file_dk_string(dkChar **dptr, int de, FILE *fipo, dk4_er_t *erp)
} break;
#endif
#else
- case DK4_ENCODING_ASCII : {
+ case DK4_ENCODING_PLAIN : {
szdk = dk4recode_size_utf8_to_ascii(putf8, erp);
if (0 < szdk) {
resb = dk4mem_new(char,szdk,erp);
@@ -344,7 +359,7 @@ dk4unserialize_file_dk_string(dkChar **dptr, int de, FILE *fipo, dk4_er_t *erp)
}
}
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
szdk = dk4recode_size_utf8_to_ansi(putf8, erp);
if (0 < szdk) {
resb = dk4mem_new(char,szdk,erp);
diff --git a/support/dktools/dk4userf.ctr b/support/dktools/dk4userf.ctr
index 0166022078..475ede61a1 100644
--- a/support/dktools/dk4userf.ctr
+++ b/support/dktools/dk4userf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,15 +12,27 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
@@ -145,6 +157,7 @@ dk4unserialize_file_double(double *dptr, FILE *fipo, dk4_er_t *erp);
%% module
+#include "dk4conf.h"
#include "dk4userf.h"
#if DK4_HAVE_ERRNO_H
@@ -154,11 +167,13 @@ dk4unserialize_file_double(double *dptr, FILE *fipo, dk4_er_t *erp);
#endif
#endif
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
-#ifdef _WIN32
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES 1
#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -178,6 +193,12 @@ dk4unserialize_file_double(double *dptr, FILE *fipo, dk4_er_t *erp);
#include "dk4rec11.h"
#include "dk4rec17.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -190,6 +211,10 @@ dk4unserialize_file_uint16_t(uint16_t *dptr, FILE *fipo, dk4_er_t *erp)
uint16_t ui16;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
if (2 == fread(uc, 1, 2, fipo)) {
ui16 = (((uint16_t)(uc[0]) << 8) & 0xFF00U)
@@ -213,6 +238,10 @@ dk4unserialize_file_int16_t(int16_t *dptr, FILE *fipo, dk4_er_t *erp)
uint16_t ui;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
back = dk4unserialize_file_uint16_t(&ui, fipo, erp);
if (0 != back) {
@@ -233,6 +262,10 @@ dk4unserialize_file_uint32_t(uint32_t *dptr, FILE *fipo, dk4_er_t *erp)
uint32_t ui32;
int back = 0;
$? "+ dk4unserialize_file_uint32_t"
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) { $? ". args ok"
if (4 == fread(uc, 1, 4, fipo)) { $? ". fread"
ui32 = ((((uint32_t)(uc[0])) << 24) & 0xFF000000UL)
@@ -258,6 +291,10 @@ dk4unserialize_file_int32_t(int32_t *dptr, FILE *fipo, dk4_er_t *erp)
{
uint32_t ui32;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
back = dk4unserialize_file_uint32_t(&ui32, fipo, erp);
if (0 != back) {
@@ -278,6 +315,10 @@ dk4unserialize_file_utf8_string(char **dptr, FILE *fipo, dk4_er_t *erp)
size_t ls = 0;
int back = 0;
uint16_t lgt = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
if (0 != dk4unserialize_file_uint16_t(&lgt, fipo, erp)) {
if (0 < lgt) {
@@ -316,6 +357,10 @@ dk4unserialize_file_double(double *dptr, FILE *fipo, dk4_er_t *erp)
char *tg = NULL;
double dv = 0.0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
if (0 != dk4unserialize_file_utf8_string(&bptr, fipo, erp)) {
if (NULL != bptr) {
@@ -366,6 +411,10 @@ dk4unserialize_file_dk_string(dkChar **dptr, int de, FILE *fipo, dk4_er_t *erp)
char *putf8 = NULL;
size_t szdk = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != dptr);
+ assert(NULL != fipo);
+#endif
if ((NULL != dptr) && (NULL != fipo)) {
if (0 != dk4unserialize_file_utf8_string(&putf8, fipo, erp)) {
if (NULL != putf8) {
@@ -417,7 +466,7 @@ dk4unserialize_file_dk_string(dkChar **dptr, int de, FILE *fipo, dk4_er_t *erp)
} break;
#endif
#else
- case DK4_ENCODING_ASCII : {
+ case DK4_ENCODING_PLAIN : {
szdk = dk4recode_size_utf8_to_ascii(putf8, erp);
if (0 < szdk) {
resb = dk4mem_new(char,szdk,erp);
@@ -436,7 +485,7 @@ dk4unserialize_file_dk_string(dkChar **dptr, int de, FILE *fipo, dk4_er_t *erp)
}
}
} break;
- case DK4_ENCODING_ANSI : {
+ case DK4_ENCODING_WIN1252 : {
szdk = dk4recode_size_utf8_to_ansi(putf8, erp);
if (0 < szdk) {
resb = dk4mem_new(char,szdk,erp);
diff --git a/support/dktools/dk4userf.h b/support/dktools/dk4userf.h
index 740662eda9..18996b4d54 100644
--- a/support/dktools/dk4userf.h
+++ b/support/dktools/dk4userf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4userf.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4userf.ctr
*/
#ifndef DK4USERF_H_INCLUDED
@@ -44,15 +22,27 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#if DK4_HAVE_STDLIB_H
diff --git a/support/dktools/dk4utf16.c b/support/dktools/dk4utf16.c
index 0f763e4028..be4ac8ad57 100644
--- a/support/dktools/dk4utf16.c
+++ b/support/dktools/dk4utf16.c
@@ -1,55 +1,41 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4utf16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4utf16.ctr
*/
/** @file dk4utf16.c The dk4utf16 module.
*/
-#line 171 "dk4utf16.ctr"
+#line 212 "dk4utf16.ctr"
#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4types.h"
#include "dk4error.h"
#include "dk4utf16.h"
#include "dk4mem.h"
+#include "dk4rec26.h"
-
-#line 181 "dk4utf16.ctr"
+#line 230 "dk4utf16.ctr"
@@ -78,6 +64,9 @@ enum {
void
dk4utf16_init(dk4_utf16_decoder_t *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
ptr->uc = dkC32(0);
ptr->state = DK4_UTF16_DEC_ST_EMPTY;
@@ -90,6 +79,9 @@ int
dk4utf16_add(dk4_utf16_decoder_t *ptr, dk4_c16_t word)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
switch (ptr->state) {
case DK4_UTF16_DEC_ST_EMPTY: {
@@ -138,9 +130,12 @@ dk4utf16_add(dk4_utf16_decoder_t *ptr, dk4_c16_t word)
dk4_c32_t
-dk4utf16_get(dk4_utf16_decoder_t *ptr)
+dk4utf16_get(dk4_utf16_decoder_t const *ptr)
{
dk4_c32_t back = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = ptr->uc;
}
@@ -150,9 +145,12 @@ dk4utf16_get(dk4_utf16_decoder_t *ptr)
int
-dk4utf16_is_empty(dk4_utf16_decoder_t *ptr)
+dk4utf16_is_empty(dk4_utf16_decoder_t const *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (DK4_UTF16_DEC_ST_EMPTY == ptr->state) { back = 1; }
}
@@ -167,17 +165,22 @@ dk4utf16_encode(dk4_c16_t *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp)
int back = 0;
-#line 297 "dk4utf16.ctr"
+#line 358 "dk4utf16.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rb);
+ assert(NULL != pszrb);
+ assert(2 < *pszrb);
+#endif
if ((NULL != rb) && (NULL != pszrb)) {
if (2 < *pszrb) {
-#line 299 "dk4utf16.ctr"
+#line 365 "dk4utf16.ctr"
if ( dkC32(0x00010000) <= c ) {
-#line 300 "dk4utf16.ctr"
+#line 366 "dk4utf16.ctr"
if ( dkC32(0x0010FFFF) >= c ) {
-#line 301 "dk4utf16.ctr"
+#line 367 "dk4utf16.ctr"
back = 1;
*pszrb = 2;
rb[0] =
@@ -187,61 +190,61 @@ dk4utf16_encode(dk4_c16_t *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp)
rb[2] = (dk4_c16_t)0;
} else {
-#line 309 "dk4utf16.ctr"
+#line 375 "dk4utf16.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} else {
-#line 312 "dk4utf16.ctr"
+#line 378 "dk4utf16.ctr"
#if VERSION_BEFORE_20141125
if ((0x0000DC00 & c) != dkC32(0x0000DC00)) {
-#line 314 "dk4utf16.ctr"
+#line 380 "dk4utf16.ctr"
if ((0x0000DC00 & c) != dkC32(0x0000D800)) {
-#line 315 "dk4utf16.ctr"
+#line 381 "dk4utf16.ctr"
back = 1;
*pszrb = 1;
rb[0] = (dk4_c16_t)(c & dkC32(0x0000FFFF));
rb[1] = (dk4_c16_t)0;
} else {
-#line 320 "dk4utf16.ctr"
+#line 386 "dk4utf16.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
} else {
-#line 323 "dk4utf16.ctr"
+#line 389 "dk4utf16.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
#else
if ((dkC32(0x0000DFFF) < c) || (dkC32(0x0000D800) > c)) {
-#line 328 "dk4utf16.ctr"
+#line 394 "dk4utf16.ctr"
back = 1;
*pszrb = 1;
rb[0] = (dk4_c16_t)(c & dkC32(0x0000FFFF));
rb[1] = (dk4_c16_t)0;
} else {
-#line 333 "dk4utf16.ctr"
+#line 399 "dk4utf16.ctr"
dk4error_set_simple_error_code(erp, DK4_E_SYNTAX);
}
#endif
}
} else {
-#line 338 "dk4utf16.ctr"
+#line 404 "dk4utf16.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 341 "dk4utf16.ctr"
+#line 407 "dk4utf16.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 343 "dk4utf16.ctr"
+#line 409 "dk4utf16.ctr"
return back;
}
@@ -250,6 +253,9 @@ dk4utf16_encode(dk4_c16_t *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp)
void
dk4utf16_byte_init(dk4_utf16_byte_decoder_t *ptr, int msb)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4utf16_init(&(ptr->dec));
ptr->msb = msb;
@@ -264,6 +270,9 @@ int
dk4utf16_byte_add(dk4_utf16_byte_decoder_t *ptr, unsigned char byte)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (0 != ptr->state) {
ptr->state = 0;
@@ -293,6 +302,9 @@ dk4_c32_t
dk4utf16_byte_get(dk4_utf16_byte_decoder_t *ptr)
{
dk4_c32_t back = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4utf16_get(&(ptr->dec));
}
@@ -305,6 +317,9 @@ int
dk4utf16_byte_is_empty(dk4_utf16_byte_decoder_t *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4utf16_is_empty(&(ptr->dec));
if (0 != ptr->state) { back = 0; }
@@ -322,6 +337,11 @@ dk4utf16_byte_encode(
dk4_c16_t buf[3];
size_t sz;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rb);
+ assert(NULL != pszrb);
+ assert(4 < pszrb);
+#endif
if ((NULL != rb) && (NULL != pszrb)) {
if (4 < *pszrb) {
sz = DK4_SIZEOF(buf,dk4_c16_t);
diff --git a/support/dktools/dk4utf16.ctr b/support/dktools/dk4utf16.ctr
index 8ee3ff313b..db1c5deab3 100644
--- a/support/dktools/dk4utf16.ctr
+++ b/support/dktools/dk4utf16.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -13,22 +13,63 @@ license = bsd
in UTF-16 encoding.
CRT on Windows: Not used.
+
+ The character to encode to UTF-16 must be in
+ range U+00000000 to U+0010FFFF.
+ (the hexadecimal numbers range defined by UNICODE).
+
+ The character must not be in range U+0000D800 to U+0000DFFF which
+ is reserved for surrogate pairs.
+
+ Characters up to U+0000FFFF are converted to 16 bits and passed
+ "as is".
+
+ For characters above, we substract U+00010000 and split the result
+ in two 10-bit blocks.
+ We prepend bits 110110 to the higher 10 bits, this results in the
+ "high surrogate".
+ We prepend bits 110111 to the lower 10 bits, this results in the
+ "low surrogate".
+
+ When decoding we have to check for a byte order marker (BOM) at
+ start of stream. The character U+0000FEFF as first character in the
+ stream can be used to mark encoding and/or byte order.
+ If we read an UTF-16 encoded stream and have 0xFEFF as first character
+ we can leave byte order as is. If the first character is 0xFFFE we
+ have to change byte order in each word.
+
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4DEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4edstm.h"
+#else
+#include <dktools-4/dk4edstm.h>
+#endif
#endif
/** Decode UTF-16 encoded data.
@@ -78,14 +119,14 @@ dk4utf16_add(dk4_utf16_decoder_t *ptr, dk4_c16_t word);
@param ptr Decoder to obtain character from.
*/
dk4_c32_t
-dk4utf16_get(dk4_utf16_decoder_t *ptr);
+dk4utf16_get(dk4_utf16_decoder_t const *ptr);
/** Check whether the decoder is empty.
@param ptr Decoder to check.
@return 1 on success, 0 on error.
*/
int
-dk4utf16_is_empty(dk4_utf16_decoder_t *ptr);
+dk4utf16_is_empty(dk4_utf16_decoder_t const *ptr);
/** UTF-16 encode UNICODE character.
@param rb Result buffer, should be at least 3 dk4_c16_t.
@@ -170,11 +211,19 @@ dk4utf16_byte_encode(
%% module
#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4types.h"
#include "dk4error.h"
#include "dk4utf16.h"
#include "dk4mem.h"
-
+#include "dk4rec26.h"
$!trace-include
@@ -206,6 +255,9 @@ enum {
void
dk4utf16_init(dk4_utf16_decoder_t *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
ptr->uc = dkC32(0);
ptr->state = DK4_UTF16_DEC_ST_EMPTY;
@@ -218,6 +270,9 @@ int
dk4utf16_add(dk4_utf16_decoder_t *ptr, dk4_c16_t word)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
switch (ptr->state) {
case DK4_UTF16_DEC_ST_EMPTY: {
@@ -266,9 +321,12 @@ dk4utf16_add(dk4_utf16_decoder_t *ptr, dk4_c16_t word)
dk4_c32_t
-dk4utf16_get(dk4_utf16_decoder_t *ptr)
+dk4utf16_get(dk4_utf16_decoder_t const *ptr)
{
dk4_c32_t back = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = ptr->uc;
}
@@ -278,9 +336,12 @@ dk4utf16_get(dk4_utf16_decoder_t *ptr)
int
-dk4utf16_is_empty(dk4_utf16_decoder_t *ptr)
+dk4utf16_is_empty(dk4_utf16_decoder_t const *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (DK4_UTF16_DEC_ST_EMPTY == ptr->state) { back = 1; }
}
@@ -293,7 +354,12 @@ int
dk4utf16_encode(dk4_c16_t *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp)
{
int back = 0;
- $? "+ dk4utf16_encode %08lx", (unsigned long)c
+ $? "+ dk4utf16_encode %08lx", dk4recode_c32_to_ul(c)
+#if DK4_USE_ASSERT
+ assert(NULL != rb);
+ assert(NULL != pszrb);
+ assert(2 < *pszrb);
+#endif
if ((NULL != rb) && (NULL != pszrb)) {
if (2 < *pszrb) { $? ". args ok"
if ( dkC32(0x00010000) <= c ) { $? ". surrogate pair"
@@ -348,6 +414,9 @@ dk4utf16_encode(dk4_c16_t *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp)
void
dk4utf16_byte_init(dk4_utf16_byte_decoder_t *ptr, int msb)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
dk4utf16_init(&(ptr->dec));
ptr->msb = msb;
@@ -362,6 +431,9 @@ int
dk4utf16_byte_add(dk4_utf16_byte_decoder_t *ptr, unsigned char byte)
{
int back = DK4_EDSTM_ERROR;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (0 != ptr->state) {
ptr->state = 0;
@@ -391,6 +463,9 @@ dk4_c32_t
dk4utf16_byte_get(dk4_utf16_byte_decoder_t *ptr)
{
dk4_c32_t back = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4utf16_get(&(ptr->dec));
}
@@ -403,6 +478,9 @@ int
dk4utf16_byte_is_empty(dk4_utf16_byte_decoder_t *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = dk4utf16_is_empty(&(ptr->dec));
if (0 != ptr->state) { back = 0; }
@@ -420,6 +498,11 @@ dk4utf16_byte_encode(
dk4_c16_t buf[3];
size_t sz;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != rb);
+ assert(NULL != pszrb);
+ assert(4 < pszrb);
+#endif
if ((NULL != rb) && (NULL != pszrb)) {
if (4 < *pszrb) {
sz = DK4_SIZEOF(buf,dk4_c16_t);
diff --git a/support/dktools/dk4utf16.h b/support/dktools/dk4utf16.h
index 826a8f3abc..87fa0a5d57 100644
--- a/support/dktools/dk4utf16.h
+++ b/support/dktools/dk4utf16.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4utf16.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4utf16.ctr
*/
#ifndef DK4UTF16_H_INCLUDED
@@ -45,22 +23,63 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
in UTF-16 encoding.
CRT on Windows: Not used.
+
+ The character to encode to UTF-16 must be in
+ range U+00000000 to U+0010FFFF.
+ (the hexadecimal numbers range defined by UNICODE).
+
+ The character must not be in range U+0000D800 to U+0000DFFF which
+ is reserved for surrogate pairs.
+
+ Characters up to U+0000FFFF are converted to 16 bits and passed
+ "as is".
+
+ For characters above, we substract U+00010000 and split the result
+ in two 10-bit blocks.
+ We prepend bits 110110 to the higher 10 bits, this results in the
+ "high surrogate".
+ We prepend bits 110111 to the lower 10 bits, this results in the
+ "low surrogate".
+
+ When decoding we have to check for a byte order marker (BOM) at
+ start of stream. The character U+0000FEFF as first character in the
+ stream can be used to mark encoding and/or byte order.
+ If we read an UTF-16 encoded stream and have 0xFEFF as first character
+ we can leave byte order as is. If the first character is 0xFFFE we
+ have to change byte order in each word.
+
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4DEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4edstm.h"
+#else
+#include <dktools-4/dk4edstm.h>
+#endif
#endif
/** Decode UTF-16 encoded data.
@@ -110,14 +129,14 @@ dk4utf16_add(dk4_utf16_decoder_t *ptr, dk4_c16_t word);
@param ptr Decoder to obtain character from.
*/
dk4_c32_t
-dk4utf16_get(dk4_utf16_decoder_t *ptr);
+dk4utf16_get(dk4_utf16_decoder_t const *ptr);
/** Check whether the decoder is empty.
@param ptr Decoder to check.
@return 1 on success, 0 on error.
*/
int
-dk4utf16_is_empty(dk4_utf16_decoder_t *ptr);
+dk4utf16_is_empty(dk4_utf16_decoder_t const *ptr);
/** UTF-16 encode UNICODE character.
@param rb Result buffer, should be at least 3 dk4_c16_t.
diff --git a/support/dktools/dk4utf8.c b/support/dktools/dk4utf8.c
index 5402fb1f4d..857842f4c7 100644
--- a/support/dktools/dk4utf8.c
+++ b/support/dktools/dk4utf8.c
@@ -1,60 +1,50 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4utf8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4utf8.ctr
*/
/** @file dk4utf8.c The dk4utf8 module.
*/
-#line 121 "dk4utf8.ctr"
+#line 137 "dk4utf8.ctr"
#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4types.h"
#include "dk4error.h"
#include "dk4utf8.h"
+#include "dk4rec26.h"
-#line 130 "dk4utf8.ctr"
+#line 155 "dk4utf8.ctr"
void
dk4utf8_init(dk4_utf8_decoder_t *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
ptr->uc = dkC32(0);
ptr->bfc = 0;
@@ -68,7 +58,9 @@ int
dk4utf8_add(dk4_utf8_decoder_t *ptr, unsigned char byte)
{
int back = DK4_EDSTM_ERROR;
-
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
switch (ptr->bfc) {
case 0: {
@@ -254,9 +246,12 @@ dk4utf8_add(dk4_utf8_decoder_t *ptr, unsigned char byte)
dk4_c32_t
-dk4utf8_get(dk4_utf8_decoder_t *ptr)
+dk4utf8_get(dk4_utf8_decoder_t const *ptr)
{
dk4_c32_t back = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = ptr->uc;
}
@@ -266,9 +261,12 @@ dk4utf8_get(dk4_utf8_decoder_t *ptr)
int
-dk4utf8_is_empty(dk4_utf8_decoder_t *ptr)
+dk4utf8_is_empty(dk4_utf8_decoder_t const *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (0 == ptr->bfc) {
back = 1;
@@ -285,7 +283,12 @@ dk4utf8_encode(unsigned char *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp)
int back = 0;
-#line 365 "dk4utf8.ctr"
+#line 401 "dk4utf8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != rb);
+ assert(NULL != pszrb);
+ assert(6 < *pszrb);
+#endif
if ((NULL != rb) && (NULL != pszrb)) {
if (6 < *pszrb) {
if (dkC32(0x7F) < c) {
@@ -349,7 +352,7 @@ dk4utf8_encode(unsigned char *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp)
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 427 "dk4utf8.ctr"
+#line 468 "dk4utf8.ctr"
return back;
}
diff --git a/support/dktools/dk4utf8.ctr b/support/dktools/dk4utf8.ctr
index e487d239fe..0b092e8def 100644
--- a/support/dktools/dk4utf8.ctr
+++ b/support/dktools/dk4utf8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -33,19 +33,35 @@ CRT on Windows: Not used.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4DEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4edstm.h"
+#else
+#include <dktools-4/dk4edstm.h>
+#endif
#endif
@@ -86,14 +102,14 @@ dk4utf8_add(dk4_utf8_decoder_t *ptr, unsigned char byte);
@param ptr Decoder to obtain character from.
*/
dk4_c32_t
-dk4utf8_get(dk4_utf8_decoder_t *ptr);
+dk4utf8_get(dk4_utf8_decoder_t const *ptr);
/** Check whether the decoder is empty.
@param ptr Decoder to check.
@return 1 on success, 0 on error.
*/
int
-dk4utf8_is_empty(dk4_utf8_decoder_t *ptr);
+dk4utf8_is_empty(dk4_utf8_decoder_t const *ptr);
/** UTF-8 encode UNICODE character.
@param rb Result buffer, at least 7 bytes.
@@ -120,9 +136,18 @@ dk4utf8_encode(unsigned char *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp);
%% module
#include "dk4conf.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4types.h"
#include "dk4error.h"
#include "dk4utf8.h"
+#include "dk4rec26.h"
@@ -133,6 +158,9 @@ $!trace-include
void
dk4utf8_init(dk4_utf8_decoder_t *ptr)
{
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
ptr->uc = dkC32(0);
ptr->bfc = 0;
@@ -146,7 +174,9 @@ int
dk4utf8_add(dk4_utf8_decoder_t *ptr, unsigned char byte)
{
int back = DK4_EDSTM_ERROR;
-
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
switch (ptr->bfc) {
case 0: {
@@ -332,9 +362,12 @@ dk4utf8_add(dk4_utf8_decoder_t *ptr, unsigned char byte)
dk4_c32_t
-dk4utf8_get(dk4_utf8_decoder_t *ptr)
+dk4utf8_get(dk4_utf8_decoder_t const *ptr)
{
dk4_c32_t back = dkC32(0);
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
back = ptr->uc;
}
@@ -344,9 +377,12 @@ dk4utf8_get(dk4_utf8_decoder_t *ptr)
int
-dk4utf8_is_empty(dk4_utf8_decoder_t *ptr)
+dk4utf8_is_empty(dk4_utf8_decoder_t const *ptr)
{
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
if (0 == ptr->bfc) {
back = 1;
@@ -361,7 +397,12 @@ int
dk4utf8_encode(unsigned char *rb, size_t *pszrb, dk4_c32_t c, dk4_er_t *erp)
{
int back = 0;
- $? "+ dk4utf8_encode %08lx", (unsigned long)c
+ $? "+ dk4utf8_encode %08lx", dk4recode_c32_to_ul(c)
+#if DK4_USE_ASSERT
+ assert(NULL != rb);
+ assert(NULL != pszrb);
+ assert(6 < *pszrb);
+#endif
if ((NULL != rb) && (NULL != pszrb)) {
if (6 < *pszrb) {
if (dkC32(0x7F) < c) {
diff --git a/support/dktools/dk4utf8.h b/support/dktools/dk4utf8.h
index 5ee7b4db87..fd25dba758 100644
--- a/support/dktools/dk4utf8.h
+++ b/support/dktools/dk4utf8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4utf8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4utf8.ctr
*/
#ifndef DK4UTF8_H_INCLUDED
@@ -65,19 +43,35 @@ CRT on Windows: Not used.
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4DEC_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4edstm.h"
+#else
+#include <dktools-4/dk4edstm.h>
+#endif
#endif
@@ -118,14 +112,14 @@ dk4utf8_add(dk4_utf8_decoder_t *ptr, unsigned char byte);
@param ptr Decoder to obtain character from.
*/
dk4_c32_t
-dk4utf8_get(dk4_utf8_decoder_t *ptr);
+dk4utf8_get(dk4_utf8_decoder_t const *ptr);
/** Check whether the decoder is empty.
@param ptr Decoder to check.
@return 1 on success, 0 on error.
*/
int
-dk4utf8_is_empty(dk4_utf8_decoder_t *ptr);
+dk4utf8_is_empty(dk4_utf8_decoder_t const *ptr);
/** UTF-8 encode UNICODE character.
@param rb Result buffer, at least 7 bytes.
diff --git a/support/dktools/dk4vers.h b/support/dktools/dk4vers.h
index 40ce3f17d2..3ee516470b 100644
--- a/support/dktools/dk4vers.h
+++ b/support/dktools/dk4vers.h
@@ -1,3 +1,8 @@
+/*
+Copyright (C) 2001-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4VERS_H_INCLUDED
#define DK4VERS_H_INCLUDED 1
@@ -6,10 +11,10 @@
/** Version number in 8 bit characters.
*/
-#define DKT_VERSION_C8 "4.8.3"
+#define DKT_VERSION_C8 "4.30.2"
/** Version number in dkChar.
*/
-#define DKT_VERSION_DK dkT("4.8.3")
+#define DKT_VERSION_DK dkT("4.30.2")
#endif
diff --git a/support/dktools/dk4verswx.h b/support/dktools/dk4verswx.h
index 366c25826c..bd5df60b44 100644
--- a/support/dktools/dk4verswx.h
+++ b/support/dktools/dk4verswx.h
@@ -1,3 +1,8 @@
+/*
+Copyright (C) 2001-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4VERSWX_H_INCLUDED
/** Protection against multiple inclusions. */
#define DK4VERSWX_H_INCLUDED 1
@@ -22,6 +27,6 @@
/** Version number as wxChar string.
*/
-#define DKT_VERSION_WX wxT("4.8.3")
+#define DKT_VERSION_WX wxT("4.30.2")
#endif
diff --git a/support/dktools/dk4wmain.h b/support/dktools/dk4wmain.h
new file mode 100644
index 0000000000..fc8647253b
--- /dev/null
+++ b/support/dktools/dk4wmain.h
@@ -0,0 +1,15 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef DK4WMAIN_H_INCLUDED
+#define DK4WMAIN_H_INCLUDED
+
+#if DK4_CHAR_SIZE > 1
+
+int wmain(int argc, wchar_t *argv[]);
+
+#endif
+
+#endif
diff --git a/support/dktools/dk4wreg.c b/support/dktools/dk4wreg.c
index 3064969fbc..1d05aca0de 100644
--- a/support/dktools/dk4wreg.c
+++ b/support/dktools/dk4wreg.c
@@ -1,4 +1,9 @@
/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
diff --git a/support/dktools/dk4wreg8.c b/support/dktools/dk4wreg8.c
index 6b4c7751bb..038d238b67 100644
--- a/support/dktools/dk4wreg8.c
+++ b/support/dktools/dk4wreg8.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wreg8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wreg8.ctr
*/
/** @file dk4wreg8.c The dk4wreg8 module.
*/
-#line 193 "dk4wreg8.ctr"
+#line 209 "dk4wreg8.ctr"
#include "dk4conf.h"
#include "dk4wregt.h"
@@ -68,22 +46,44 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4str8.h"
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 226 "dk4wreg8.ctr"
+#line 250 "dk4wreg8.ctr"
void *
-dk4wreg_open_key_c8(int pk, const char *keyname, int wr, dk4_er_t *erp)
+dk4wreg_open_key_c8(
+#if DK4_ON_WINDOWS
+ int pk,
+ const char *keyname,
+ int wr,
+#else
+ int DK4_ARG_UNUSED(pk),
+ const char * DK4_ARG_UNUSED(keyname),
+ int DK4_ARG_UNUSED(wr),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
dk4_wreg_key_t *back = NULL;
HKEY park = HKEY_LOCAL_MACHINE;
LONG res;
DWORD disp;
+#if DK4_USE_ASSERT
+ assert(NULL != keyname);
+#endif
if (NULL != keyname) {
switch (pk) {
case DK4_WREGKEY_HKLM:
@@ -137,6 +137,9 @@ dk4wreg_open_key_c8(int pk, const char *keyname, int wr, dk4_er_t *erp)
}
return ((void *)back);
#else
+ DK4_UNUSED_ARG(pk)
+ DK4_UNUSED_ARG(keyname)
+ DK4_UNUSED_ARG(wr)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return NULL;
#endif
@@ -146,7 +149,18 @@ dk4wreg_open_key_c8(int pk, const char *keyname, int wr, dk4_er_t *erp)
int
dk4wreg_set_string_c8(
- void *kptr, const char *name, const char *val, int expand, dk4_er_t *erp
+#if DK4_ON_WINDOWS
+ void *kptr,
+ const char *name,
+ const char *val,
+ int expand,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ const char * DK4_ARG_UNUSED(val),
+ int DK4_ARG_UNUSED(expand),
+#endif
+ dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
@@ -158,6 +172,11 @@ dk4wreg_set_string_c8(
DWORD dw0 = (DWORD)0UL;
DWORD sz;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != val);
+#endif
if ((NULL != kptr) && (NULL != val)) {
if (0 != expand) { dwt = REG_EXPAND_SZ; }
dk4error_init(&er);
@@ -190,6 +209,10 @@ dk4wreg_set_string_c8(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(val)
+ DK4_UNUSED_ARG(expand)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -199,11 +222,19 @@ dk4wreg_set_string_c8(
int
dk4wreg_get_string_c8(
+#if DK4_ON_WINDOWS
void *kptr,
const char *name,
char *bptr,
size_t sz,
int *expand,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ char * DK4_ARG_UNUSED(bptr),
+ size_t DK4_ARG_UNUSED(sz),
+ int * DK4_ARG_UNUSED(expand),
+#endif
dk4_er_t *erp
)
{
@@ -214,6 +245,12 @@ dk4wreg_get_string_c8(
DWORD dws;
DWORD dwsbck;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
if ((NULL != bptr) && (0 < sz)) {
*bptr = '\0';
}
@@ -265,6 +302,11 @@ dk4wreg_get_string_c8(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(bptr)
+ DK4_UNUSED_ARG(sz)
+ DK4_UNUSED_ARG(expand)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -274,7 +316,16 @@ dk4wreg_get_string_c8(
int
dk4wreg_set_dword_c8(
- void *kptr, const char *name, dk4_dword_t val, dk4_er_t *erp
+#if DK4_ON_WINDOWS
+ void *kptr,
+ const char *name,
+ dk4_dword_t val,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ dk4_dword_t DK4_ARG_UNUSED(val),
+#endif
+ dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
@@ -284,6 +335,10 @@ dk4wreg_set_dword_c8(
DWORD dws = sizeof(DWORD);
DWORD dw0 = (DWORD)0L;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+#endif
if (NULL != kptr) {
hptr = (dk4_wreg_key_t *)kptr;
res = RegSetValueExA(
@@ -304,6 +359,9 @@ dk4wreg_set_dword_c8(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(val)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -313,9 +371,15 @@ dk4wreg_set_dword_c8(
int
dk4wreg_get_dword_c8(
+#if DK4_ON_WINDOWS
void *kptr,
const char *name,
dk4_dword_t *vptr,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ dk4_dword_t * DK4_ARG_UNUSED(vptr),
+#endif
dk4_er_t *erp
)
{
@@ -325,6 +389,11 @@ dk4wreg_get_dword_c8(
DWORD dwt = REG_DWORD;
DWORD dws = (DWORD)sizeof(DWORD);
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != vptr);
+#endif
if ((NULL != kptr) && (NULL != vptr)) {
hptr = (dk4_wreg_key_t *)kptr;
res = RegQueryValueExA(
@@ -353,6 +422,9 @@ dk4wreg_get_dword_c8(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(vptr)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -362,6 +434,7 @@ dk4wreg_get_dword_c8(
int
dk4wreg_get_expanded_string_c8(
+#if DK4_ON_WINDOWS
void *kptr,
const char *name,
char *dptr,
@@ -371,6 +444,17 @@ dk4wreg_get_expanded_string_c8(
char *b2,
size_t b2sz,
dk4_er_t *erp
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ char * DK4_ARG_UNUSED(dptr),
+ size_t DK4_ARG_UNUSED(dsz),
+ char * DK4_ARG_UNUSED(b1),
+ size_t DK4_ARG_UNUSED(b1sz),
+ char * DK4_ARG_UNUSED(b2),
+ size_t DK4_ARG_UNUSED(b2sz),
+ dk4_er_t *erp
+#endif
)
{
#if DK4_ON_WINDOWS
@@ -380,78 +464,96 @@ dk4wreg_get_expanded_string_c8(
int back = 0;
-#line 532 "dk4wreg8.ctr"
+#line 654 "dk4wreg8.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != b1);
+ assert(0 < b1sz);
+ assert(NULL != b2);
+ assert(0 < b2sz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != kptr) && (NULL != name) && (NULL != dptr) && (0 < dsz)) {
if ((NULL != b1) && (NULL != b2) && (0 < b1sz) && (2 < b2sz)) {
back = dk4wreg_get_string_c8(kptr, name, b1, b1sz, &expand, erp);
if (0 != back) {
-#line 537 "dk4wreg8.ctr"
+#line 669 "dk4wreg8.ctr"
if (0 != expand) {
-#line 538 "dk4wreg8.ctr"
+#line 670 "dk4wreg8.ctr"
if ((dk4_um_t)(0x7FFFFFFFUL) >= (dk4_um_t)b2sz) {
dws = (DWORD)b2sz;
-#line 540 "dk4wreg8.ctr"
+#line 672 "dk4wreg8.ctr"
} else {
dws = 0x7FFFFFFFUL;
-#line 542 "dk4wreg8.ctr"
+#line 674 "dk4wreg8.ctr"
}
dws = dws - 2;
nc = ExpandEnvironmentStringsA(b1, b2, dws);
if ((0 < nc) && (nc <= dws)) {
-#line 546 "dk4wreg8.ctr"
+#line 678 "dk4wreg8.ctr"
back = dk4str8_cpy_s(dptr, dsz, b2, erp);
-#line 548 "dk4wreg8.ctr"
+#line 680 "dk4wreg8.ctr"
-#line 549 "dk4wreg8.ctr"
+#line 681 "dk4wreg8.ctr"
-#line 550 "dk4wreg8.ctr"
+#line 682 "dk4wreg8.ctr"
} else {
-#line 551 "dk4wreg8.ctr"
+#line 683 "dk4wreg8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 554 "dk4wreg8.ctr"
+#line 686 "dk4wreg8.ctr"
back = dk4str8_cpy_s(dptr, dsz, b1, erp);
-#line 556 "dk4wreg8.ctr"
+#line 688 "dk4wreg8.ctr"
-#line 557 "dk4wreg8.ctr"
+#line 689 "dk4wreg8.ctr"
-#line 558 "dk4wreg8.ctr"
+#line 690 "dk4wreg8.ctr"
}
} else {
-#line 560 "dk4wreg8.ctr"
+#line 692 "dk4wreg8.ctr"
}
} else {
-#line 562 "dk4wreg8.ctr"
+#line 694 "dk4wreg8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 565 "dk4wreg8.ctr"
+#line 697 "dk4wreg8.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
-#line 567 "dk4wreg8.ctr"
+#line 699 "dk4wreg8.ctr"
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(dsz)
+ DK4_UNUSED_ARG(b1)
+ DK4_UNUSED_ARG(b1sz)
+ DK4_UNUSED_ARG(b2)
+ DK4_UNUSED_ARG(b2sz)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4wreg8.ctr b/support/dktools/dk4wreg8.ctr
index cda903a275..904709ca7e 100644
--- a/support/dktools/dk4wreg8.ctr
+++ b/support/dktools/dk4wreg8.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,19 +16,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WREGK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wregk.h"
+#else
+#include <dktools-4/dk4wregk.h>
+#endif
#endif
#ifdef __cplusplus
@@ -220,6 +236,14 @@ dk4wreg_get_expanded_string_c8(
#include "dk4str8.h"
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -227,13 +251,27 @@ $!trace-include
void *
-dk4wreg_open_key_c8(int pk, const char *keyname, int wr, dk4_er_t *erp)
+dk4wreg_open_key_c8(
+#if DK4_ON_WINDOWS
+ int pk,
+ const char *keyname,
+ int wr,
+#else
+ int DK4_ARG_UNUSED(pk),
+ const char * DK4_ARG_UNUSED(keyname),
+ int DK4_ARG_UNUSED(wr),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
dk4_wreg_key_t *back = NULL;
HKEY park = HKEY_LOCAL_MACHINE;
LONG res;
DWORD disp;
+#if DK4_USE_ASSERT
+ assert(NULL != keyname);
+#endif
if (NULL != keyname) {
switch (pk) {
case DK4_WREGKEY_HKLM:
@@ -287,6 +325,9 @@ dk4wreg_open_key_c8(int pk, const char *keyname, int wr, dk4_er_t *erp)
}
return ((void *)back);
#else
+ DK4_UNUSED_ARG(pk)
+ DK4_UNUSED_ARG(keyname)
+ DK4_UNUSED_ARG(wr)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return NULL;
#endif
@@ -296,7 +337,18 @@ dk4wreg_open_key_c8(int pk, const char *keyname, int wr, dk4_er_t *erp)
int
dk4wreg_set_string_c8(
- void *kptr, const char *name, const char *val, int expand, dk4_er_t *erp
+#if DK4_ON_WINDOWS
+ void *kptr,
+ const char *name,
+ const char *val,
+ int expand,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ const char * DK4_ARG_UNUSED(val),
+ int DK4_ARG_UNUSED(expand),
+#endif
+ dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
@@ -308,6 +360,11 @@ dk4wreg_set_string_c8(
DWORD dw0 = (DWORD)0UL;
DWORD sz;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != val);
+#endif
if ((NULL != kptr) && (NULL != val)) {
if (0 != expand) { dwt = REG_EXPAND_SZ; }
dk4error_init(&er);
@@ -340,6 +397,10 @@ dk4wreg_set_string_c8(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(val)
+ DK4_UNUSED_ARG(expand)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -349,11 +410,19 @@ dk4wreg_set_string_c8(
int
dk4wreg_get_string_c8(
+#if DK4_ON_WINDOWS
void *kptr,
const char *name,
char *bptr,
size_t sz,
int *expand,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ char * DK4_ARG_UNUSED(bptr),
+ size_t DK4_ARG_UNUSED(sz),
+ int * DK4_ARG_UNUSED(expand),
+#endif
dk4_er_t *erp
)
{
@@ -364,6 +433,12 @@ dk4wreg_get_string_c8(
DWORD dws;
DWORD dwsbck;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
if ((NULL != bptr) && (0 < sz)) {
*bptr = '\0';
}
@@ -415,6 +490,11 @@ dk4wreg_get_string_c8(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(bptr)
+ DK4_UNUSED_ARG(sz)
+ DK4_UNUSED_ARG(expand)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -424,7 +504,16 @@ dk4wreg_get_string_c8(
int
dk4wreg_set_dword_c8(
- void *kptr, const char *name, dk4_dword_t val, dk4_er_t *erp
+#if DK4_ON_WINDOWS
+ void *kptr,
+ const char *name,
+ dk4_dword_t val,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ dk4_dword_t DK4_ARG_UNUSED(val),
+#endif
+ dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
@@ -434,6 +523,10 @@ dk4wreg_set_dword_c8(
DWORD dws = sizeof(DWORD);
DWORD dw0 = (DWORD)0L;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+#endif
if (NULL != kptr) {
hptr = (dk4_wreg_key_t *)kptr;
res = RegSetValueExA(
@@ -454,6 +547,9 @@ dk4wreg_set_dword_c8(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(val)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -463,9 +559,15 @@ dk4wreg_set_dword_c8(
int
dk4wreg_get_dword_c8(
+#if DK4_ON_WINDOWS
void *kptr,
const char *name,
dk4_dword_t *vptr,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ dk4_dword_t * DK4_ARG_UNUSED(vptr),
+#endif
dk4_er_t *erp
)
{
@@ -475,6 +577,11 @@ dk4wreg_get_dword_c8(
DWORD dwt = REG_DWORD;
DWORD dws = (DWORD)sizeof(DWORD);
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != vptr);
+#endif
if ((NULL != kptr) && (NULL != vptr)) {
hptr = (dk4_wreg_key_t *)kptr;
res = RegQueryValueExA(
@@ -503,6 +610,9 @@ dk4wreg_get_dword_c8(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(vptr)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -512,6 +622,7 @@ dk4wreg_get_dword_c8(
int
dk4wreg_get_expanded_string_c8(
+#if DK4_ON_WINDOWS
void *kptr,
const char *name,
char *dptr,
@@ -521,6 +632,17 @@ dk4wreg_get_expanded_string_c8(
char *b2,
size_t b2sz,
dk4_er_t *erp
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const char * DK4_ARG_UNUSED(name),
+ char * DK4_ARG_UNUSED(dptr),
+ size_t DK4_ARG_UNUSED(dsz),
+ char * DK4_ARG_UNUSED(b1),
+ size_t DK4_ARG_UNUSED(b1sz),
+ char * DK4_ARG_UNUSED(b2),
+ size_t DK4_ARG_UNUSED(b2sz),
+ dk4_er_t *erp
+#endif
)
{
#if DK4_ON_WINDOWS
@@ -529,6 +651,16 @@ dk4wreg_get_expanded_string_c8(
int expand = 0;
int back = 0;
$? "+ dk4wreg_get_expanded_string_c8 \"%!8s\"", TR_8STR(name)
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != b1);
+ assert(0 < b1sz);
+ assert(NULL != b2);
+ assert(0 < b2sz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = '\0'; }
if ((NULL != kptr) && (NULL != name) && (NULL != dptr) && (0 < dsz)) {
if ((NULL != b1) && (NULL != b2) && (0 < b1sz) && (2 < b2sz)) {
@@ -566,6 +698,14 @@ dk4wreg_get_expanded_string_c8(
} $? "- dk4wreg_get_expanded_string_c8 %d", back
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(dsz)
+ DK4_UNUSED_ARG(b1)
+ DK4_UNUSED_ARG(b1sz)
+ DK4_UNUSED_ARG(b2)
+ DK4_UNUSED_ARG(b2sz)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4wreg8.h b/support/dktools/dk4wreg8.h
index 613c9069c7..de9347537e 100644
--- a/support/dktools/dk4wreg8.h
+++ b/support/dktools/dk4wreg8.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wreg8.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wreg8.ctr
*/
#ifndef DK4WREG8_H_INCLUDED
@@ -48,19 +26,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WREGK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wregk.h"
+#else
+#include <dktools-4/dk4wregk.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4wregc.c b/support/dktools/dk4wregc.c
index 3b5e1ef16e..96efc544e7 100644
--- a/support/dktools/dk4wregc.c
+++ b/support/dktools/dk4wregc.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wregc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wregc.ctr
*/
/** @file dk4wregc.c The dk4wregc module.
*/
-#line 49 "dk4wregc.ctr"
+#line 65 "dk4wregc.ctr"
#include "dk4conf.h"
@@ -64,11 +42,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 78 "dk4wregc.ctr"
+#line 100 "dk4wregc.ctr"
@@ -78,6 +62,9 @@ dk4wreg_close_key(void *kptr)
#if DK4_ON_WINDOWS
dk4_wreg_key_t *hptr;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+#endif
if (kptr) {
#if DK4_ON_WINDOWS
hptr = (dk4_wreg_key_t *)kptr;
diff --git a/support/dktools/dk4wregc.ctr b/support/dktools/dk4wregc.ctr
index be050baa23..bce8db6c88 100644
--- a/support/dktools/dk4wregc.ctr
+++ b/support/dktools/dk4wregc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,19 +15,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WREGK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wregk.h"
+#else
+#include <dktools-4/dk4wregk.h>
+#endif
#endif
#ifdef __cplusplus
@@ -72,6 +88,12 @@ dk4wreg_close_key(void *kptr);
#endif
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -84,6 +106,9 @@ dk4wreg_close_key(void *kptr)
#if DK4_ON_WINDOWS
dk4_wreg_key_t *hptr;
#endif
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+#endif
if (kptr) {
#if DK4_ON_WINDOWS
hptr = (dk4_wreg_key_t *)kptr;
diff --git a/support/dktools/dk4wregc.h b/support/dktools/dk4wregc.h
index 4732a6173a..0b67097873 100644
--- a/support/dktools/dk4wregc.h
+++ b/support/dktools/dk4wregc.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wregc.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wregc.ctr
*/
#ifndef DK4WREGC_H_INCLUDED
@@ -47,19 +25,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WREGK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wregk.h"
+#else
+#include <dktools-4/dk4wregk.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4wregd.c b/support/dktools/dk4wregd.c
index 4d7d5dc32f..8ea85f288b 100644
--- a/support/dktools/dk4wregd.c
+++ b/support/dktools/dk4wregd.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wregd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wregd.ctr
*/
/** @file dk4wregd.c The dk4wregd module.
*/
-#line 194 "dk4wregd.ctr"
+#line 210 "dk4wregd.ctr"
#include "dk4conf.h"
@@ -51,17 +29,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4wregd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 210 "dk4wregd.ctr"
+#line 232 "dk4wregd.ctr"
void *
dk4wreg_open_key(int pk, const dkChar *keyname, int wr, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != keyname);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_open_key_wc(pk, keyname, wr, erp));
#else
@@ -76,6 +63,11 @@ dk4wreg_set_string(
void *kptr, const dkChar *name, const dkChar *val, int expand, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != val);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_set_string_wc(kptr, name, val, expand, erp));
#else
@@ -95,6 +87,12 @@ dk4wreg_get_string(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_get_string_wc(kptr, name, bptr, sz, expand, erp));
#else
@@ -109,6 +107,10 @@ dk4wreg_set_dword(
void *kptr, const dkChar *name, dk4_dword_t val, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_set_dword_wc(kptr, name, val, erp));
#else
@@ -126,6 +128,11 @@ dk4wreg_get_dword(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != vptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_get_dword_wc(kptr, name, vptr, erp));
#else
@@ -148,6 +155,16 @@ dk4wreg_get_expanded_string(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != b1);
+ assert(0 < b1sz);
+ assert(NULL != b2);
+ assert(0 < b2sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4wreg_get_expanded_string_wc(
diff --git a/support/dktools/dk4wregd.ctr b/support/dktools/dk4wregd.ctr
index e6d6b267d6..fdc1975d99 100644
--- a/support/dktools/dk4wregd.ctr
+++ b/support/dktools/dk4wregd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,19 +16,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WREGK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wregk.h"
+#else
+#include <dktools-4/dk4wregk.h>
+#endif
#endif
#ifdef __cplusplus
@@ -204,6 +220,12 @@ dk4wreg_get_expanded_string(
#include "dk4wregd.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -213,6 +235,9 @@ $!trace-include
void *
dk4wreg_open_key(int pk, const dkChar *keyname, int wr, dk4_er_t *erp)
{
+#if DK4_USE_ASSERT
+ assert(NULL != keyname);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_open_key_wc(pk, keyname, wr, erp));
#else
@@ -227,6 +252,11 @@ dk4wreg_set_string(
void *kptr, const dkChar *name, const dkChar *val, int expand, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != val);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_set_string_wc(kptr, name, val, expand, erp));
#else
@@ -246,6 +276,12 @@ dk4wreg_get_string(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_get_string_wc(kptr, name, bptr, sz, expand, erp));
#else
@@ -260,6 +296,10 @@ dk4wreg_set_dword(
void *kptr, const dkChar *name, dk4_dword_t val, dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_set_dword_wc(kptr, name, val, erp));
#else
@@ -277,6 +317,11 @@ dk4wreg_get_dword(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != vptr);
+#endif
#if DK4_CHAR_SIZE > 1
return (dk4wreg_get_dword_wc(kptr, name, vptr, erp));
#else
@@ -299,6 +344,16 @@ dk4wreg_get_expanded_string(
dk4_er_t *erp
)
{
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != b1);
+ assert(0 < b1sz);
+ assert(NULL != b2);
+ assert(0 < b2sz);
+#endif
#if DK4_CHAR_SIZE > 1
return (
dk4wreg_get_expanded_string_wc(
diff --git a/support/dktools/dk4wregd.h b/support/dktools/dk4wregd.h
index 47191d01b8..4b9ecfaa07 100644
--- a/support/dktools/dk4wregd.h
+++ b/support/dktools/dk4wregd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wregd.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wregd.ctr
*/
#ifndef DK4WREGD_H_INCLUDED
@@ -48,19 +26,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WREGK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wregk.h"
+#else
+#include <dktools-4/dk4wregk.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4wregk.h b/support/dktools/dk4wregk.h
index e06823d614..cbb3f592d1 100644
--- a/support/dktools/dk4wregk.h
+++ b/support/dktools/dk4wregk.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4WREGK_H_INCLUDED
#define DK4WREGK_H_INCLUDED 1
diff --git a/support/dktools/dk4wregt.h b/support/dktools/dk4wregt.h
index 00ce1c9e57..8006e5a328 100644
--- a/support/dktools/dk4wregt.h
+++ b/support/dktools/dk4wregt.h
@@ -1,9 +1,22 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4WREGT_H_INCLUDED
#define DK4WREGT_H_INCLUDED 1
/** @file dk4wregt.h Type definitions for Windows registry access.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#if DK4_ON_WINDOWS
#ifndef WINDOWS_H_INCLUDED
diff --git a/support/dktools/dk4wregw.c b/support/dktools/dk4wregw.c
index 83b7ba4ac1..d06cbac6e6 100644
--- a/support/dktools/dk4wregw.c
+++ b/support/dktools/dk4wregw.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wregw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wregw.ctr
*/
/** @file dk4wregw.c The dk4wregw module.
*/
-#line 192 "dk4wregw.ctr"
+#line 208 "dk4wregw.ctr"
#include "dk4conf.h"
#include "dk4wregt.h"
@@ -66,21 +44,44 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 222 "dk4wregw.ctr"
+
+#line 247 "dk4wregw.ctr"
void *
-dk4wreg_open_key_wc(int pk, const wchar_t *keyname, int wr, dk4_er_t *erp)
+dk4wreg_open_key_wc(
+#if DK4_ON_WINDOWS
+ int pk,
+ const wchar_t *keyname,
+ int wr,
+#else
+ int DK4_ARG_UNUSED(pk),
+ const wchar_t * DK4_ARG_UNUSED(keyname),
+ int DK4_ARG_UNUSED(wr),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
dk4_wreg_key_t *back = NULL;
HKEY park = HKEY_LOCAL_MACHINE;
LONG res;
DWORD disp;
+#if DK4_USE_ASSERT
+ assert(NULL != keyname);
+#endif
if (NULL != keyname) {
switch (pk) {
case DK4_WREGKEY_HKLM:
@@ -134,6 +135,9 @@ dk4wreg_open_key_wc(int pk, const wchar_t *keyname, int wr, dk4_er_t *erp)
}
return ((void *)back);
#else
+ DK4_UNUSED_ARG(pk)
+ DK4_UNUSED_ARG(keyname)
+ DK4_UNUSED_ARG(wr)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return NULL;
#endif
@@ -143,7 +147,18 @@ dk4wreg_open_key_wc(int pk, const wchar_t *keyname, int wr, dk4_er_t *erp)
int
dk4wreg_set_string_wc(
- void *kptr, const wchar_t *name, const wchar_t *val, int expand, dk4_er_t *erp
+#if DK4_ON_WINDOWS
+ void *kptr,
+ const wchar_t *name,
+ const wchar_t *val,
+ int expand,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ const wchar_t * DK4_ARG_UNUSED(val),
+ int DK4_ARG_UNUSED(expand),
+#endif
+ dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
@@ -155,6 +170,11 @@ dk4wreg_set_string_wc(
DWORD dw0 = (DWORD)0UL;
DWORD sz;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != val);
+#endif
if ((NULL != kptr) && (NULL != val)) {
if (0 != expand) { dwt = REG_EXPAND_SZ; }
dk4error_init(&er);
@@ -188,6 +208,10 @@ dk4wreg_set_string_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(val)
+ DK4_UNUSED_ARG(expand)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -197,11 +221,19 @@ dk4wreg_set_string_wc(
int
dk4wreg_get_string_wc(
+#if DK4_ON_WINDOWS
void *kptr,
const wchar_t *name,
wchar_t *bptr,
size_t sz,
int *expand,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ wchar_t * DK4_ARG_UNUSED(bptr),
+ size_t DK4_ARG_UNUSED(sz),
+ int * DK4_ARG_UNUSED(expand),
+#endif
dk4_er_t *erp
)
{
@@ -211,9 +243,17 @@ dk4wreg_get_string_wc(
int back = 0;
DWORD dwt = REG_SZ;
DWORD dws;
+#if 0
DWORD dwsbck;
+#endif
LONG res;
size_t rsz;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
if ((NULL != bptr) && (0 < sz)) {
*bptr = '\0';
}
@@ -226,7 +266,9 @@ dk4wreg_get_string_wc(
} else {
dws = (DWORD)0x7FFFFFFFUL;
}
+#if 0
dwsbck = dws;
+#endif
hptr = (dk4_wreg_key_t *)kptr;
res = RegQueryValueExW(
hptr->hk,
@@ -270,6 +312,11 @@ dk4wreg_get_string_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(bptr)
+ DK4_UNUSED_ARG(sz)
+ DK4_UNUSED_ARG(expand)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -279,7 +326,16 @@ dk4wreg_get_string_wc(
int
dk4wreg_set_dword_wc(
- void *kptr, const wchar_t *name, dk4_dword_t val, dk4_er_t *erp
+#if DK4_ON_WINDOWS
+ void *kptr,
+ const wchar_t *name,
+ dk4_dword_t val,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ dk4_dword_t DK4_ARG_UNUSED(val),
+#endif
+ dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
@@ -289,6 +345,10 @@ dk4wreg_set_dword_wc(
DWORD dws = sizeof(DWORD);
DWORD dw0 = (DWORD)0L;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+#endif
if (NULL != kptr) {
hptr = (dk4_wreg_key_t *)kptr;
res = RegSetValueExW(
@@ -309,6 +369,9 @@ dk4wreg_set_dword_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(val)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -318,9 +381,15 @@ dk4wreg_set_dword_wc(
int
dk4wreg_get_dword_wc(
+#if DK4_ON_WINDOWS
void *kptr,
const wchar_t *name,
dk4_dword_t *vptr,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ dk4_dword_t * DK4_ARG_UNUSED(vptr),
+#endif
dk4_er_t *erp
)
{
@@ -330,6 +399,11 @@ dk4wreg_get_dword_wc(
DWORD dwt = REG_DWORD;
DWORD dws = (DWORD)sizeof(DWORD);
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != vptr);
+#endif
if ((NULL != kptr) && (NULL != vptr)) {
hptr = (dk4_wreg_key_t *)kptr;
res = RegQueryValueExW(
@@ -358,6 +432,9 @@ dk4wreg_get_dword_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(vptr)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -367,6 +444,7 @@ dk4wreg_get_dword_wc(
int
dk4wreg_get_expanded_string_wc(
+#if DK4_ON_WINDOWS
void *kptr,
const wchar_t *name,
wchar_t *dptr,
@@ -375,6 +453,16 @@ dk4wreg_get_expanded_string_wc(
size_t b1sz,
wchar_t *b2,
size_t b2sz,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ wchar_t * DK4_ARG_UNUSED(dptr),
+ size_t DK4_ARG_UNUSED(dsz),
+ wchar_t * DK4_ARG_UNUSED(b1),
+ size_t DK4_ARG_UNUSED(b1sz),
+ wchar_t * DK4_ARG_UNUSED(b2),
+ size_t DK4_ARG_UNUSED(b2sz),
+#endif
dk4_er_t *erp
)
{
@@ -383,6 +471,16 @@ dk4wreg_get_expanded_string_wc(
DWORD nc;
int expand = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != b1);
+ assert(0 < b1sz);
+ assert(NULL != b2);
+ assert(0 < b2sz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = L'\0'; }
if ((NULL != kptr) && (NULL != name) && (NULL != dptr) && (0 < dsz)) {
if ((NULL != b1) && (NULL != b2) && (0 < b1sz) && (2 < b2sz)) {
@@ -390,66 +488,74 @@ dk4wreg_get_expanded_string_wc(
if (0 != back) {
if (0 != expand) {
-#line 541 "dk4wregw.ctr"
+#line 677 "dk4wregw.ctr"
if ((dk4_um_t)0x7FFFFFFFUL >= (dk4_um_t)b2sz) {
dws = (DWORD)b2sz;
-#line 543 "dk4wregw.ctr"
+#line 679 "dk4wregw.ctr"
} else {
dws = 0x7FFFFFFFUL;
-#line 545 "dk4wregw.ctr"
+#line 681 "dk4wregw.ctr"
}
dws = dws - 2;
nc = ExpandEnvironmentStringsW(b1, b2, dws);
if ((0 < nc) && (nc <= dws)) {
-#line 549 "dk4wregw.ctr"
+#line 685 "dk4wregw.ctr"
back = dk4strw_cpy_s(dptr, dsz, b2, erp);
-#line 551 "dk4wregw.ctr"
+#line 687 "dk4wregw.ctr"
-#line 552 "dk4wregw.ctr"
+#line 688 "dk4wregw.ctr"
-#line 553 "dk4wregw.ctr"
+#line 689 "dk4wregw.ctr"
} else {
-#line 554 "dk4wregw.ctr"
+#line 690 "dk4wregw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_BUFFER_TOO_SMALL);
}
} else {
-#line 557 "dk4wregw.ctr"
+#line 693 "dk4wregw.ctr"
back = dk4strw_cpy_s(dptr, dsz, b1, erp);
-#line 559 "dk4wregw.ctr"
+#line 695 "dk4wregw.ctr"
-#line 560 "dk4wregw.ctr"
+#line 696 "dk4wregw.ctr"
-#line 561 "dk4wregw.ctr"
+#line 697 "dk4wregw.ctr"
}
} else {
-#line 563 "dk4wregw.ctr"
+#line 699 "dk4wregw.ctr"
}
} else {
-#line 565 "dk4wregw.ctr"
+#line 701 "dk4wregw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
} else {
-#line 568 "dk4wregw.ctr"
+#line 704 "dk4wregw.ctr"
dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(dsz)
+ DK4_UNUSED_ARG(b1)
+ DK4_UNUSED_ARG(b1sz)
+ DK4_UNUSED_ARG(b2)
+ DK4_UNUSED_ARG(b2sz)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4wregw.ctr b/support/dktools/dk4wregw.ctr
index 21c840f10e..6d4ddd9be1 100644
--- a/support/dktools/dk4wregw.ctr
+++ b/support/dktools/dk4wregw.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -16,19 +16,35 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WREGK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wregk.h"
+#else
+#include <dktools-4/dk4wregk.h>
+#endif
#endif
#ifdef __cplusplus
@@ -217,19 +233,42 @@ dk4wreg_get_expanded_string_wc(
#endif
+#include "dk4unused.h"
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
$!trace-include
void *
-dk4wreg_open_key_wc(int pk, const wchar_t *keyname, int wr, dk4_er_t *erp)
+dk4wreg_open_key_wc(
+#if DK4_ON_WINDOWS
+ int pk,
+ const wchar_t *keyname,
+ int wr,
+#else
+ int DK4_ARG_UNUSED(pk),
+ const wchar_t * DK4_ARG_UNUSED(keyname),
+ int DK4_ARG_UNUSED(wr),
+#endif
+ dk4_er_t *erp
+)
{
#if DK4_ON_WINDOWS
dk4_wreg_key_t *back = NULL;
HKEY park = HKEY_LOCAL_MACHINE;
LONG res;
DWORD disp;
+#if DK4_USE_ASSERT
+ assert(NULL != keyname);
+#endif
if (NULL != keyname) {
switch (pk) {
case DK4_WREGKEY_HKLM:
@@ -283,6 +322,9 @@ dk4wreg_open_key_wc(int pk, const wchar_t *keyname, int wr, dk4_er_t *erp)
}
return ((void *)back);
#else
+ DK4_UNUSED_ARG(pk)
+ DK4_UNUSED_ARG(keyname)
+ DK4_UNUSED_ARG(wr)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return NULL;
#endif
@@ -292,7 +334,18 @@ dk4wreg_open_key_wc(int pk, const wchar_t *keyname, int wr, dk4_er_t *erp)
int
dk4wreg_set_string_wc(
- void *kptr, const wchar_t *name, const wchar_t *val, int expand, dk4_er_t *erp
+#if DK4_ON_WINDOWS
+ void *kptr,
+ const wchar_t *name,
+ const wchar_t *val,
+ int expand,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ const wchar_t * DK4_ARG_UNUSED(val),
+ int DK4_ARG_UNUSED(expand),
+#endif
+ dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
@@ -304,6 +357,11 @@ dk4wreg_set_string_wc(
DWORD dw0 = (DWORD)0UL;
DWORD sz;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != val);
+#endif
if ((NULL != kptr) && (NULL != val)) {
if (0 != expand) { dwt = REG_EXPAND_SZ; }
dk4error_init(&er);
@@ -337,6 +395,10 @@ dk4wreg_set_string_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(val)
+ DK4_UNUSED_ARG(expand)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -346,11 +408,19 @@ dk4wreg_set_string_wc(
int
dk4wreg_get_string_wc(
+#if DK4_ON_WINDOWS
void *kptr,
const wchar_t *name,
wchar_t *bptr,
size_t sz,
int *expand,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ wchar_t * DK4_ARG_UNUSED(bptr),
+ size_t DK4_ARG_UNUSED(sz),
+ int * DK4_ARG_UNUSED(expand),
+#endif
dk4_er_t *erp
)
{
@@ -360,9 +430,17 @@ dk4wreg_get_string_wc(
int back = 0;
DWORD dwt = REG_SZ;
DWORD dws;
+#if 0
DWORD dwsbck;
+#endif
LONG res;
size_t rsz;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != bptr);
+ assert(0 < sz);
+#endif
if ((NULL != bptr) && (0 < sz)) {
*bptr = '\0';
}
@@ -375,7 +453,9 @@ dk4wreg_get_string_wc(
} else {
dws = (DWORD)0x7FFFFFFFUL;
}
+#if 0
dwsbck = dws;
+#endif
hptr = (dk4_wreg_key_t *)kptr;
res = RegQueryValueExW(
hptr->hk,
@@ -419,6 +499,11 @@ dk4wreg_get_string_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(bptr)
+ DK4_UNUSED_ARG(sz)
+ DK4_UNUSED_ARG(expand)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -428,7 +513,16 @@ dk4wreg_get_string_wc(
int
dk4wreg_set_dword_wc(
- void *kptr, const wchar_t *name, dk4_dword_t val, dk4_er_t *erp
+#if DK4_ON_WINDOWS
+ void *kptr,
+ const wchar_t *name,
+ dk4_dword_t val,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ dk4_dword_t DK4_ARG_UNUSED(val),
+#endif
+ dk4_er_t *erp
)
{
#if DK4_ON_WINDOWS
@@ -438,6 +532,10 @@ dk4wreg_set_dword_wc(
DWORD dws = sizeof(DWORD);
DWORD dw0 = (DWORD)0L;
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+#endif
if (NULL != kptr) {
hptr = (dk4_wreg_key_t *)kptr;
res = RegSetValueExW(
@@ -458,6 +556,9 @@ dk4wreg_set_dword_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(val)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -467,9 +568,15 @@ dk4wreg_set_dword_wc(
int
dk4wreg_get_dword_wc(
+#if DK4_ON_WINDOWS
void *kptr,
const wchar_t *name,
dk4_dword_t *vptr,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ dk4_dword_t * DK4_ARG_UNUSED(vptr),
+#endif
dk4_er_t *erp
)
{
@@ -479,6 +586,11 @@ dk4wreg_get_dword_wc(
DWORD dwt = REG_DWORD;
DWORD dws = (DWORD)sizeof(DWORD);
LONG res;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != vptr);
+#endif
if ((NULL != kptr) && (NULL != vptr)) {
hptr = (dk4_wreg_key_t *)kptr;
res = RegQueryValueExW(
@@ -507,6 +619,9 @@ dk4wreg_get_dword_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(vptr)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
@@ -516,6 +631,7 @@ dk4wreg_get_dword_wc(
int
dk4wreg_get_expanded_string_wc(
+#if DK4_ON_WINDOWS
void *kptr,
const wchar_t *name,
wchar_t *dptr,
@@ -524,6 +640,16 @@ dk4wreg_get_expanded_string_wc(
size_t b1sz,
wchar_t *b2,
size_t b2sz,
+#else
+ void * DK4_ARG_UNUSED(kptr),
+ const wchar_t * DK4_ARG_UNUSED(name),
+ wchar_t * DK4_ARG_UNUSED(dptr),
+ size_t DK4_ARG_UNUSED(dsz),
+ wchar_t * DK4_ARG_UNUSED(b1),
+ size_t DK4_ARG_UNUSED(b1sz),
+ wchar_t * DK4_ARG_UNUSED(b2),
+ size_t DK4_ARG_UNUSED(b2sz),
+#endif
dk4_er_t *erp
)
{
@@ -532,6 +658,16 @@ dk4wreg_get_expanded_string_wc(
DWORD nc;
int expand = 0;
int back = 0;
+#if DK4_USE_ASSERT
+ assert(NULL != kptr);
+ assert(NULL != name);
+ assert(NULL != dptr);
+ assert(0 < dsz);
+ assert(NULL != b1);
+ assert(0 < b1sz);
+ assert(NULL != b2);
+ assert(0 < b2sz);
+#endif
if ((NULL != dptr) && (0 < dsz)) { *dptr = L'\0'; }
if ((NULL != kptr) && (NULL != name) && (NULL != dptr) && (0 < dsz)) {
if ((NULL != b1) && (NULL != b2) && (0 < b1sz) && (2 < b2sz)) {
@@ -569,6 +705,14 @@ dk4wreg_get_expanded_string_wc(
}
return back;
#else
+ DK4_UNUSED_ARG(kptr)
+ DK4_UNUSED_ARG(name)
+ DK4_UNUSED_ARG(dptr)
+ DK4_UNUSED_ARG(dsz)
+ DK4_UNUSED_ARG(b1)
+ DK4_UNUSED_ARG(b1sz)
+ DK4_UNUSED_ARG(b2)
+ DK4_UNUSED_ARG(b2sz)
dk4error_set_simple_error_code(erp, DK4_E_NOT_SUPPORTED);
return 0;
#endif
diff --git a/support/dktools/dk4wregw.h b/support/dktools/dk4wregw.h
index 6060bd0ef5..aaf0f600f3 100644
--- a/support/dktools/dk4wregw.h
+++ b/support/dktools/dk4wregw.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wregw.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wregw.ctr
*/
#ifndef DK4WREGW_H_INCLUDED
@@ -48,19 +26,35 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WREGK_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wregk.h"
+#else
+#include <dktools-4/dk4wregk.h>
+#endif
#endif
#ifdef __cplusplus
diff --git a/support/dktools/dk4wxcs.cpp b/support/dktools/dk4wxcs.cpp
new file mode 100644
index 0000000000..28422a3e49
--- /dev/null
+++ b/support/dktools/dk4wxcs.cpp
@@ -0,0 +1,101 @@
+/** @file dk4wxcs.cpp Fix configure results.
+ Redirect output from this program to the dk4conf.h file.
+*/
+
+#include "config.h"
+
+#if HAVE_LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
+
+#include <stdio.h>
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+/* wxWidgets_header_start */
+#if HAVE_WXWIDGETS
+#include <wx/wxprec.h>
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#if HAVE_WX_CHARTYPE_H
+#if HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED 1
+#endif
+#endif
+#ifndef WX_CHARTYPE_H_INCLUDED
+#include <wx/chartype.h>
+#define WX_CHARTYPE_H_INCLUDED 1
+#endif
+#else
+#if HAVE_WX_WXCHAR_H
+#if HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED 1
+#endif
+#endif
+#ifndef WX_WXCHAR_H_INCLUDED
+#include <wx/wxchar.h>
+#define WX_WXCHAR_H_INCLUDED 1
+#endif
+#else
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+#endif
+#endif
+#endif
+/* wxWidgets_header_end*/
+
+#include <dk3trace.h>
+#ifndef TRACE_DEBUG
+#define TRACE_DEBUG 1
+#endif
+
+
+
+int
+main(void)
+{
+ fputs("/*\nCopyright (C) 2020, Dirk Krause.", stdout);
+ fputs(" All rights reserved.\n", stdout);
+ fputs("SPDX-License-Identifier: BSD-3-Clause\n", stdout);
+ fputs("*/\n\n", stdout);
+ fputs("#ifndef DK4WXCS_H_INCLUDED\n", stdout);
+ fputs("/** Multiple inclusion protection.*/\n",stdout);
+ fputs("#define DK4WXCS_H_INCLUDED 1\n\n", stdout);
+/* wxWidgets_body_start */
+#if HAVE_WXWIDGETS
+ fputs("/** Size of wxChar.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_WXCHAR %u\n\n", (unsigned)sizeof(wxChar));
+#if HAVE_WX_CHARTYPE_H
+ fputs("/** Size of wxStringCharType.\n*/\n", stdout);
+ printf("#define DK4_SIZEOF_WXSTRINGCHARTYPE %u\n\n", (unsigned)sizeof(wxStringCharType));
+#else
+ fputs("/** Size of wxStringCharType.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_WXSTRINGCHARTYPE 0\n\n", stdout);
+#endif
+#else
+ fputs("/** Size of wxChar.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_WXCHAR 0\n\n", stdout);
+ fputs("/** Size of wxStringCharType.\n*/\n", stdout);
+ fputs("#define DK4_SIZEOF_WXSTRINGCHARTYPE 0\n\n", stdout);
+#endif
+/* wxWidgets_body_end */
+
+ fputs("\n\n#endif\n\n", stdout);
+ return 0;
+}
diff --git a/support/dktools/dk4wxcs.cross b/support/dktools/dk4wxcs.cross
index 1b3a46a143..e38983a36a 100644
--- a/support/dktools/dk4wxcs.cross
+++ b/support/dktools/dk4wxcs.cross
@@ -10,18 +10,11 @@
#if DK4_HAVE_WXWIDGETS
-#include "wx/wxprec.h"
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-#if wxUSE_UNICODE
+#if _WIN32
#define DK4_SIZEOF_WXCHAR 2
#else
-#define DK4_SIZEOF_WXCHAR 1
+#define DK4_SIZEOF_WXCHAR 4
#endif
#else
diff --git a/support/dktools/dk4wxcs.h b/support/dktools/dk4wxcs.h
index 34dccd8e11..5ab0e2e5a0 100644
--- a/support/dktools/dk4wxcs.h
+++ b/support/dktools/dk4wxcs.h
@@ -1,12 +1,21 @@
-/** @file dk4wxcs.h Configure size of wide characters.
+/*
+Copyright (C) 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef DK4WXCSZ_H_INCLUDED
-/** Protection against multiple inclusions. */
-#define DK4WXCSZ_H_INCLUDED 1
+#ifndef DK4WXCS_H_INCLUDED
+/** Multiple inclusion protection.*/
+#define DK4WXCS_H_INCLUDED 1
-/** Size of wxChar.
+/** Size of wxChar.
*/
#define DK4_SIZEOF_WXCHAR 4
+/** Size of wxStringCharType.
+*/
+#define DK4_SIZEOF_WXSTRINGCHARTYPE 4
+
+
+
#endif
+
diff --git a/support/dktools/dk4wxpref.cpp b/support/dktools/dk4wxpref.cpp
index 979f930efc..e3b76bbd9c 100644
--- a/support/dktools/dk4wxpref.cpp
+++ b/support/dktools/dk4wxpref.cpp
@@ -1,45 +1,22 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wxpref.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wxpref.cpt
*/
/** @file dk4wxpref.cpp The dk4wxpref module.
*/
-#line 160 "dk4wxpref.cpt"
+#line 188 "dk4wxpref.cpt"
-#include "dk4wxpref.h"
#include "dk4strd.h"
#include "dk4strx.h"
#include "dk4recwx.h"
@@ -47,12 +24,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mpl.h"
#include "dk4tspdk.h"
#include "dk4fs.h"
+#include "dk4wxpref.h"
-
-#line 173 "dk4wxpref.cpt"
+#line 200 "dk4wxpref.cpt"
@@ -94,7 +71,7 @@ dkT("*"),
NULL
-#line 213 "dk4wxpref.cpt"
+#line 240 "dk4wxpref.cpt"
};
@@ -129,7 +106,7 @@ dkT("region"),
NULL
-#line 254 "dk4wxpref.cpt"
+#line 281 "dk4wxpref.cpt"
};
@@ -393,8 +370,8 @@ int
dk4wxpref_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t WXUNUSED(lineno),
+ dk4_er_t * WXUNUSED(erp)
)
{
dk4_wx_pref_rd_t *rd; /* Reader object */
@@ -414,7 +391,7 @@ dk4wxpref_line_handler(
if (dkT('#') != *p1) {
if (dkT('[') == *p1) {
-#line 537 "dk4wxpref.cpt"
+#line 564 "dk4wxpref.cpt"
if (0 == rd->lasc) {
rd->insc = 0;
}
@@ -442,7 +419,7 @@ dk4wxpref_line_handler(
rd->lasc = 1;
} else {
-#line 563 "dk4wxpref.cpt"
+#line 590 "dk4wxpref.cpt"
if (rd->insc) {
p2 = dk4str_chr(p1, dkT('='));
if (NULL != p2) {
@@ -490,11 +467,11 @@ dk4wxpref_line_handler(
}
} else {
-#line 609 "dk4wxpref.cpt"
+#line 636 "dk4wxpref.cpt"
}
} else {
-#line 611 "dk4wxpref.cpt"
+#line 638 "dk4wxpref.cpt"
}
return back;
}
diff --git a/support/dktools/dk4wxpref.cpt b/support/dktools/dk4wxpref.cpt
index 84b9a1e7d8..2dc697d4b0 100644
--- a/support/dktools/dk4wxpref.cpt
+++ b/support/dktools/dk4wxpref.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,31 +12,59 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4STRMR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmr.h"
+#else
+#include <dktools-4/dk4strmr.h>
+#endif
#endif
@@ -158,7 +186,6 @@ dk4wxpref_one_pass(
%% module
-#include "dk4wxpref.h"
#include "dk4strd.h"
#include "dk4strx.h"
#include "dk4recwx.h"
@@ -166,7 +193,7 @@ dk4wxpref_one_pass(
#include "dk4mpl.h"
#include "dk4tspdk.h"
#include "dk4fs.h"
-
+#include "dk4wxpref.h"
$!trace-include
@@ -514,8 +541,8 @@ int
dk4wxpref_line_handler(
void *obj,
dkChar *line,
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t WXUNUSED(lineno),
+ dk4_er_t * WXUNUSED(erp)
)
{
dk4_wx_pref_rd_t *rd; /* Reader object */
diff --git a/support/dktools/dk4wxpref.h b/support/dktools/dk4wxpref.h
index 4f777ee7c9..b6c7cd1ba8 100644
--- a/support/dktools/dk4wxpref.h
+++ b/support/dktools/dk4wxpref.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wxpref.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wxpref.cpt
*/
#ifndef DK4WXPREF_H_INCLUDED
@@ -44,31 +22,59 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4CONST_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4const.h"
+#else
+#include <dktools-4/dk4const.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4STO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4sto.h"
+#else
+#include <dktools-4/dk4sto.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4STRMR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strmr.h"
+#else
+#include <dktools-4/dk4strmr.h>
+#endif
#endif
diff --git a/support/dktools/dk4wxstt.cpp b/support/dktools/dk4wxstt.cpp
index ecca665f24..308ff890b5 100644
--- a/support/dktools/dk4wxstt.cpp
+++ b/support/dktools/dk4wxstt.cpp
@@ -1,45 +1,29 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wxstt.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wxstt.cpt
*/
/** @file dk4wxstt.cpp The dk4wxstt module.
*/
-#line 146 "dk4wxstt.cpt"
+#line 166 "dk4wxstt.cpt"
+#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#include "dk4mem.h"
#include "dk4enc.h"
@@ -49,11 +33,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4wxstt.h"
#include "dk4tspwx.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
-#line 160 "dk4wxstt.cpt"
+#line 192 "dk4wxstt.cpt"
@@ -64,29 +54,32 @@ dk4wxstt_shutdown(dk4_wx_string_table_t *ptr)
size_t nstrings;
-#line 169 "dk4wxstt.cpt"
+#line 201 "dk4wxstt.cpt"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
-#line 170 "dk4wxstt.cpt"
+#line 205 "dk4wxstt.cpt"
if (NULL != ptr->strings) {
-#line 171 "dk4wxstt.cpt"
+#line 206 "dk4wxstt.cpt"
stptr = ptr->strings;
nstrings = ptr->nstrings;
while (0 < nstrings--) {
-#line 174 "dk4wxstt.cpt"
+#line 209 "dk4wxstt.cpt"
dk4mem_release(*stptr);
stptr++;
}
-#line 177 "dk4wxstt.cpt"
+#line 212 "dk4wxstt.cpt"
dk4mem_release(ptr->strings);
}
}
-#line 181 "dk4wxstt.cpt"
+#line 216 "dk4wxstt.cpt"
}
@@ -95,22 +88,25 @@ dk4wxstt_close(dk4_wx_string_table_t *ptr)
{
-#line 188 "dk4wxstt.cpt"
+#line 223 "dk4wxstt.cpt"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) {
-#line 189 "dk4wxstt.cpt"
+#line 227 "dk4wxstt.cpt"
dk4wxstt_shutdown(ptr);
-#line 190 "dk4wxstt.cpt"
+#line 228 "dk4wxstt.cpt"
dk4mem_release(ptr->shrtfn);
ptr->nstrings = 0;
-#line 192 "dk4wxstt.cpt"
+#line 230 "dk4wxstt.cpt"
dk4mem_free(ptr);
}
-#line 195 "dk4wxstt.cpt"
+#line 233 "dk4wxstt.cpt"
}
@@ -123,25 +119,29 @@ dk4wxstt_open(const dkChar *fn, size_t sz, dk4_er_t *erp)
int ok = 0;
-#line 206 "dk4wxstt.cpt"
+#line 244 "dk4wxstt.cpt"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert(0 < sz);
+#endif
if ((NULL != fn) && (0 < sz)) {
-#line 207 "dk4wxstt.cpt"
+#line 249 "dk4wxstt.cpt"
back = dk4mem_new(dk4_wx_string_table_t,1,erp);
if (NULL != back) {
-#line 209 "dk4wxstt.cpt"
+#line 251 "dk4wxstt.cpt"
back->strings = NULL;
back->nstrings = 0;
back->shrtfn = dk4str_dup(fn, erp);
if (NULL != back->shrtfn) {
-#line 213 "dk4wxstt.cpt"
+#line 255 "dk4wxstt.cpt"
back->nstrings = sz;
back->strings = dk4mem_new(DK4_PWXCHAR,sz,erp);
if (NULL != back->strings) {
-#line 216 "dk4wxstt.cpt"
+#line 258 "dk4wxstt.cpt"
stptr = back->strings;
while (0 < sz--) { *(stptr++) = NULL; }
ok = 1;
@@ -149,7 +149,7 @@ dk4wxstt_open(const dkChar *fn, size_t sz, dk4_er_t *erp)
}
if (1 > ok) {
-#line 222 "dk4wxstt.cpt"
+#line 264 "dk4wxstt.cpt"
dk4wxstt_close(back);
back = NULL;
}
@@ -159,7 +159,7 @@ dk4wxstt_open(const dkChar *fn, size_t sz, dk4_er_t *erp)
}
-#line 230 "dk4wxstt.cpt"
+#line 272 "dk4wxstt.cpt"
return back;
}
@@ -246,8 +246,8 @@ dk4wxstt_line_handler(
#else
char *line,
#endif
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t WXUNUSED(lineno),
+ dk4_er_t * WXUNUSED(erp)
)
{
dk4_wx_string_table_reader_t *reader;
@@ -255,14 +255,14 @@ dk4wxstt_line_handler(
int back = DK4_TSP_RES_ERROR;
-#line 324 "dk4wxstt.cpt"
+#line 366 "dk4wxstt.cpt"
reader = (dk4_wx_string_table_reader_t *)obj;
if (wxT('#') != (wxChar)(*line)) {
-#line 326 "dk4wxstt.cpt"
+#line 368 "dk4wxstt.cpt"
if (reader->curpos < reader->dptr->nstrings) {
-#line 327 "dk4wxstt.cpt"
+#line 369 "dk4wxstt.cpt"
linecp = dk4strx_dup((wxChar *)line, NULL);
if (NULL != linecp) {
(reader->dptr->strings)[reader->curpos] = linecp;
@@ -315,14 +315,14 @@ dk4wxstt_line_handler(
}
} else {
-#line 378 "dk4wxstt.cpt"
+#line 420 "dk4wxstt.cpt"
back = DK4_TSP_RES_OK;
}
} else {
back = DK4_TSP_RES_OK;
}
-#line 383 "dk4wxstt.cpt"
+#line 425 "dk4wxstt.cpt"
return back;
}
@@ -333,7 +333,7 @@ dk4wxstt_apply_stream(
dk4_wx_string_table_t *tptr,
dk4_stream_t *strm,
int pre,
- dk4_er_t *erp1,
+ dk4_er_t * WXUNUSED(erp1),
dk4_er_t *erp2
)
{
@@ -348,10 +348,14 @@ dk4wxstt_apply_stream(
bool back = false; /* Function result */
-#line 407 "dk4wxstt.cpt"
+#line 449 "dk4wxstt.cpt"
+#if DK4_USE_ASSERT
+ assert(NULL != tptr);
+ assert(NULL != strm);
+#endif
if ((NULL != tptr) && (NULL != strm)) {
-#line 408 "dk4wxstt.cpt"
+#line 454 "dk4wxstt.cpt"
dk4error_init(&e1);
dk4error_init(&e2);
reader.dptr = tptr;
@@ -363,7 +367,7 @@ dk4wxstt_apply_stream(
); back = ((cc != 0) ? true : false);
if (back) {
-#line 418 "dk4wxstt.cpt"
+#line 464 "dk4wxstt.cpt"
#if VERSION_BEFORE_20150821
cc = 1;
#endif
@@ -373,22 +377,22 @@ dk4wxstt_apply_stream(
if (0 < dk4stream_read(buf, &rdb, strm, NULL)) {
if (0 < rdb) {
-#line 426 "dk4wxstt.cpt"
+#line 472 "dk4wxstt.cpt"
switch (dk4tspwx_add_bytes(&tspwx, (unsigned char *)buf, rdb)) {
case DK4_TSP_RES_OK: {
cc = 1;
-#line 429 "dk4wxstt.cpt"
+#line 475 "dk4wxstt.cpt"
} break;
case DK4_TSP_RES_ERROR: {
cc = 1;
-#line 432 "dk4wxstt.cpt"
+#line 478 "dk4wxstt.cpt"
} break;
default: {
back = false;
-#line 435 "dk4wxstt.cpt"
+#line 481 "dk4wxstt.cpt"
} break;
}
}
@@ -396,30 +400,30 @@ dk4wxstt_apply_stream(
} while (0 != cc);
if (back) {
-#line 441 "dk4wxstt.cpt"
+#line 487 "dk4wxstt.cpt"
if (DK4_TSP_RES_FATAL == dk4tspwx_finish(&tspwx)) {
back = false;
-#line 443 "dk4wxstt.cpt"
+#line 489 "dk4wxstt.cpt"
}
if (back) {
if (reader.curpos < (reader.dptr)->nstrings) {
back = false;
-#line 447 "dk4wxstt.cpt"
+#line 493 "dk4wxstt.cpt"
}
}
}
} else {
-#line 451 "dk4wxstt.cpt"
+#line 497 "dk4wxstt.cpt"
}
} else {
dk4error_set_simple_error_code(erp2, DK4_E_INVALID_ARGUMENTS);
}
-#line 456 "dk4wxstt.cpt"
+#line 502 "dk4wxstt.cpt"
return back;
}
diff --git a/support/dktools/dk4wxstt.cpt b/support/dktools/dk4wxstt.cpt
index c1ca226365..b71fe2f2ab 100644
--- a/support/dktools/dk4wxstt.cpt
+++ b/support/dktools/dk4wxstt.cpt
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -12,23 +12,43 @@ license = bsd
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
@@ -144,7 +164,13 @@ dk4wxstt_compare(const void *l, const void *r, int cr);
%% module
+#include "dk4conf.h"
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#include "dk4mem.h"
#include "dk4enc.h"
@@ -154,6 +180,12 @@ dk4wxstt_compare(const void *l, const void *r, int cr);
#include "dk4wxstt.h"
#include "dk4tspwx.h"
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
$!trace-include
@@ -166,6 +198,9 @@ dk4wxstt_shutdown(dk4_wx_string_table_t *ptr)
wxChar **stptr;
size_t nstrings;
$? "+ dk4wxstt_shutdown"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) { $? ". arg ok"
if (NULL != ptr->strings) { $? ". strings ok"
stptr = ptr->strings;
@@ -185,6 +220,9 @@ void
dk4wxstt_close(dk4_wx_string_table_t *ptr)
{
$? "+ dk4wxstt_close"
+#if DK4_USE_ASSERT
+ assert(NULL != ptr);
+#endif
if (NULL != ptr) { $? ". arg ok"
dk4wxstt_shutdown(ptr); $? ". release short file name"
dk4mem_release(ptr->shrtfn);
@@ -203,6 +241,10 @@ dk4wxstt_open(const dkChar *fn, size_t sz, dk4_er_t *erp)
wxChar **stptr = NULL;
int ok = 0;
$? "+ dk4wxstt_open"
+#if DK4_USE_ASSERT
+ assert(NULL != fn);
+ assert(0 < sz);
+#endif
if ((NULL != fn) && (0 < sz)) { $? ". fn, sz ok"
back = dk4mem_new(dk4_wx_string_table_t,1,erp);
if (NULL != back) { $? ". allocated"
@@ -313,8 +355,8 @@ dk4wxstt_line_handler(
#else
char *line,
#endif
- dk4_um_t lineno,
- dk4_er_t *erp
+ dk4_um_t WXUNUSED(lineno),
+ dk4_er_t * WXUNUSED(erp)
)
{
dk4_wx_string_table_reader_t *reader;
@@ -390,7 +432,7 @@ dk4wxstt_apply_stream(
dk4_wx_string_table_t *tptr,
dk4_stream_t *strm,
int pre,
- dk4_er_t *erp1,
+ dk4_er_t * WXUNUSED(erp1),
dk4_er_t *erp2
)
{
@@ -404,6 +446,10 @@ dk4wxstt_apply_stream(
int cc; /* Flag: Can continue */
bool back = false; /* Function result */
$? "+ dk4wxstt_apply_stream"
+#if DK4_USE_ASSERT
+ assert(NULL != tptr);
+ assert(NULL != strm);
+#endif
if ((NULL != tptr) && (NULL != strm)) { $? ". args ok"
dk4error_init(&e1);
dk4error_init(&e2);
diff --git a/support/dktools/dk4wxstt.h b/support/dktools/dk4wxstt.h
index b6b0dad2de..ef72c532df 100644
--- a/support/dktools/dk4wxstt.h
+++ b/support/dktools/dk4wxstt.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dk4wxstt.cpt
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4wxstt.cpt
*/
#ifndef DK4WXSTT_H_INCLUDED
@@ -44,23 +22,43 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef DK4STRM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4strm.h"
+#else
+#include <dktools-4/dk4strm.h>
+#endif
#endif
#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
#endif
#ifndef DK4WXCS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include "dk4wxcs.h"
+#else
+#include <dktools-4/dk4wxcs.h>
+#endif
#endif
diff --git a/support/dktools/dk4wxtypes.h b/support/dktools/dk4wxtypes.h
index 41ab0ba314..999083877c 100644
--- a/support/dktools/dk4wxtypes.h
+++ b/support/dktools/dk4wxtypes.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef DK4WXTYPES_H_INCLUDED
/** Protection against multiple inclusions. */
#define DK4WXTYPES_H_INCLUDED 1
@@ -5,6 +10,14 @@
/** @file dk4wxtypes.h Types definitions for use with wxWidgets.
*/
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
#ifndef WX_WXPREC_H_INCLUDED
#include <wx/wxprec.h>
diff --git a/support/dktools/dk4xsp.c b/support/dktools/dk4xsp.c
new file mode 100644
index 0000000000..d8f32255fa
--- /dev/null
+++ b/support/dktools/dk4xsp.c
@@ -0,0 +1,1301 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4xsp.ctr
+*/
+
+/** @file dk4xsp.c The dk4xsp module.
+*/
+
+
+#line 436 "dk4xsp.ctr"
+
+
+#include "dk4xsp.h"
+
+
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+
+
+#line 459 "dk4xsp.ctr"
+
+
+
+/** Approximation function.
+*/
+#define FCT_F(u,p) \
+u*u*u*(u*(u*(6.0-p)+2.0*p-15.0)+10.0-p)
+
+/** Interpolation function for 0<=u<=1.
+*/
+#define FCT_G(u,p,q) \
+u*(u*(u*(u*(u*(6.0-5.0*q-p)+2.0*p+14.0*q-15.0)+10.0-12.0*q-p)+2.0*q)+q)
+
+/** Interpolation function for -1<=u<0.
+*/
+#define FCT_H(u,q) \
+u*(u*(u*u*(-2.0*q-q*u)+2.0*q)+q)
+
+/** First derivative of approximation function.
+*/
+#define FCT_DFDU(u,p) \
+u*u*(u*(u*(30.0-5.0*p)+8.0*p-60.0)+30.0-3.0*p)
+
+/** First derivative of interpolation function for 0<=u<=1.
+*/
+#define FCT_DGDU(u,p,q) \
+u*(u*(u*(u*(30.0-25.0*q-5.0*p)+8.0*p+56.0*q-60.0)+30.0-36.0*q-3.0*p)+4.0*q)+q
+
+/** First derivative of interpolation function for -1<=u<0.
+*/
+#define FCT_DHDU(u,q) \
+u*(4.0*q-u*u*(8.0*q+5.0*q*u))+q
+
+
+
+#if TRACE_DEBUG
+/** Show one array contents.
+ @param ptr Array start address.
+*/
+static
+void
+dk4xsp_show_array4(double const *ptr)
+{
+ size_t i;
+ for (i = 0; i < 4; i++) {
+
+
+#line 505 "dk4xsp.ctr"
+ }
+}
+#endif
+
+
+
+/** Calculate approximation blending function value.
+ @param u Parameter u.
+ @param p Constant value p derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_f(double u, double p)
+{
+#if TRACE_DEBUG
+ double back = 0.0;
+ back = FCT_F(u,p);
+
+
+#line 524 "dk4xsp.ctr"
+ return back;
+#else
+ return ( FCT_F(u,p) );
+#endif
+}
+
+
+
+/** Calculate interpolation blending function value for positive u arguments.
+ @param u Parameter u.
+ @param p Constant value p derived from shape factor.
+ @param q Constant value q derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_g(double u, double p, double q)
+{
+#if TRACE_DEBUG
+ double back = 0.0;
+ back = FCT_G(u,p,q);
+
+
+#line 546 "dk4xsp.ctr"
+ return back;
+#else
+ return ( FCT_G(u,p,q) );
+#endif
+}
+
+
+
+/** Calculate interpolation blending function value for negative u arguments.
+ @param u Parameter u.
+ @param q Constant value q derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_h(double u, double q)
+{
+#if TRACE_DEBUG
+ double back = 0.0;
+ back = FCT_H(u,q);
+
+
+#line 567 "dk4xsp.ctr"
+ return back;
+#else
+ return ( FCT_H(u,q) );
+#endif
+}
+
+
+
+/** Calculate approximation blending function derivative value.
+ @param u Parameter u.
+ @param p Constant value p derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_dfdu(double u, double p)
+{
+#if TRACE_DEBUG
+ double back;
+ back = FCT_DFDU(u,p);
+
+
+#line 588 "dk4xsp.ctr"
+ return back;
+#else
+ return ( FCT_DFDU(u,p) );
+#endif
+}
+
+
+
+/** Calculate interpolation blending function derivative value
+ for positive u arguments.
+ @param u Parameter u.
+ @param p Constant value p derived from shape factor.
+ @param q Constant value q derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_dgdu(double u, double p, double q)
+{
+#if TRACE_DEBUG
+ double back;
+ back = FCT_DGDU(u,p,q);
+
+
+#line 611 "dk4xsp.ctr"
+ return back;
+#else
+ return ( FCT_DGDU(u,p,q) );
+#endif
+}
+
+
+
+/** Calculate interpolation blending function derivative value
+ for negative u arguments.
+ @param u Parameter u.
+ @param q Constant value q derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_dhdu(double u, double q)
+{
+#if TRACE_DEBUG
+ double back;
+ back = FCT_DHDU(u,q);
+
+
+#line 633 "dk4xsp.ctr"
+ return back;
+#else
+ return ( FCT_DHDU(u,q) );
+#endif
+}
+
+
+
+/** Prepare a coordinates calculation, calculate blending functions
+ values and optionally blending functions derivatives values.
+ @param xsp Spline structure to use.
+ @param t Parameter t in range 0 to 1.
+ @param d Flag: Derivatives required.
+*/
+
+static
+void
+dk4xsp_i_prepare(
+ dk4_xsp_t *xsp,
+ double t,
+ int d
+)
+{
+ size_t i;
+
+
+#line 658 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ for (i = 0; i < 4; i++) { xsp->f[i] = xsp->u[i] = 0.0; }
+ if (0.0 > xsp->s[1]) {
+
+#line 663 "dk4xsp.ctr"
+ xsp->u[0] = 0.0 - t;
+ xsp->u[2] = t;
+ if ((uint8_t)0U != xsp->h[0]) {
+ xsp->f[0] = fct_h(xsp->u[0], xsp->q[0]);
+ }
+ xsp->f[2] = fct_g(xsp->u[2], xsp->p[2], xsp->q[2]);
+ }
+ else {
+
+#line 671 "dk4xsp.ctr"
+ xsp->u[0] = (xsp->s[1] - t) / (1.0 + xsp->s[1]);
+ xsp->u[2] = (xsp->s[1] + t) / (1.0 + xsp->s[1]);
+ if (t < xsp->s[1]) {
+
+#line 674 "dk4xsp.ctr"
+ if ((uint8_t)0U != xsp->h[0]) {
+
+#line 675 "dk4xsp.ctr"
+ xsp->f[0] = fct_f(xsp->u[0], xsp->p[0]);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 679 "dk4xsp.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 684 "dk4xsp.ctr"
+ }
+#endif
+ xsp->f[2] = fct_f(xsp->u[2], xsp->p[2]);
+ }
+ if (0.0 > xsp->s[2]) {
+
+#line 689 "dk4xsp.ctr"
+ xsp->u[1] = 1.0 - t;
+ xsp->u[3] = t - 1.0;
+ xsp->f[1] = fct_g(xsp->u[1], xsp->p[1], xsp->q[1]);
+ if ((uint8_t)0U != xsp->h[3]) {
+ xsp->f[3] = fct_h(xsp->u[3], xsp->q[3]);
+ }
+ }
+ else {
+
+#line 697 "dk4xsp.ctr"
+ xsp->u[1] = (1.0 + xsp->s[2] - t) / (1.0 + xsp->s[2]);
+ xsp->u[3] = (t + xsp->s[2] - 1.0) / (1.0 + xsp->s[2]);
+ xsp->f[1] = fct_f(xsp->u[1], xsp->p[1]);
+ if (t > (1.0 - xsp->s[2])) {
+
+#line 701 "dk4xsp.ctr"
+ if ((uint8_t)0U != xsp->h[3]) {
+
+#line 702 "dk4xsp.ctr"
+ xsp->f[3] = fct_f(xsp->u[3], xsp->p[3]);
+ }
+ else {
+
+#line 705 "dk4xsp.ctr"
+ }
+ }
+ else {
+
+#line 708 "dk4xsp.ctr"
+ }
+ }
+
+ if (0 == d) { goto finished; }
+
+ for (i = 0; i < 4; i++) { xsp->dfdt[i] = 0.0; }
+ if (0.0 > xsp->s[1]) {
+ if ((uint8_t)0U != xsp->h[0]) {
+ xsp->dfdt[0] = fct_dhdu(xsp->u[0], xsp->q[0]);
+ xsp->dfdt[0] *= xsp->dudt[0];
+ }
+ xsp->dfdt[2] = fct_dgdu(xsp->u[2], xsp->p[2], xsp->q[2]);
+ xsp->dfdt[2] *= xsp->dudt[2];
+ }
+ else {
+ if (t < xsp->s[1]) {
+
+#line 724 "dk4xsp.ctr"
+ if ((uint8_t)0U != xsp->h[0]) {
+
+#line 725 "dk4xsp.ctr"
+ xsp->dfdt[0] = fct_dfdu(xsp->u[0], xsp->p[0]);
+ xsp->dfdt[0] *= xsp->dudt[0];
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 730 "dk4xsp.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 735 "dk4xsp.ctr"
+ }
+#endif
+
+ xsp->dfdt[2] = fct_dfdu(xsp->u[2], xsp->p[2]);
+ xsp->dfdt[2] *= xsp->dudt[2];
+ }
+
+ if (0.0 > xsp->s[2]) {
+ xsp->dfdt[1] = fct_dgdu(xsp->u[1], xsp->p[1], xsp->q[1]);
+ xsp->dfdt[1] *= xsp->dudt[1];
+ if ((uint8_t)0U != xsp->h[3]) {
+ xsp->dfdt[3] = fct_dhdu(xsp->u[3], xsp->q[3]);
+ xsp->dfdt[3] *= xsp->dudt[3];
+ }
+ }
+ else {
+ xsp->dfdt[1] = fct_dfdu(xsp->u[1], xsp->p[1]);
+ xsp->dfdt[1] *= xsp->dudt[1];
+ if (t > (1.0 - xsp->s[2])) {
+
+#line 754 "dk4xsp.ctr"
+ if ((uint8_t)0U != xsp->h[3]) {
+
+#line 755 "dk4xsp.ctr"
+ xsp->dfdt[3] = fct_dfdu(xsp->u[3], xsp->p[3]);
+ xsp->dfdt[3] *= xsp->dudt[3];
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 760 "dk4xsp.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 765 "dk4xsp.ctr"
+ }
+#endif
+ }
+
+ finished:
+
+
+#line 771 "dk4xsp.ctr"
+
+
+#line 772 "dk4xsp.ctr"
+
+
+#line 773 "dk4xsp.ctr"
+
+
+#line 774 "dk4xsp.ctr"
+
+
+#line 775 "dk4xsp.ctr"
+
+
+#line 776 "dk4xsp.ctr"
+
+
+#line 777 "dk4xsp.ctr"
+
+
+#line 778 "dk4xsp.ctr"
+
+
+#line 779 "dk4xsp.ctr"
+
+
+#line 780 "dk4xsp.ctr"
+
+
+#line 781 "dk4xsp.ctr"
+
+
+#line 782 "dk4xsp.ctr"
+
+
+#line 783 "dk4xsp.ctr"
+
+
+#line 784 "dk4xsp.ctr"
+
+
+#line 785 "dk4xsp.ctr"
+ return;
+}
+
+
+
+/** Calculate coordinates for one dimension.
+ @param rp Address of result variable or result array.
+ When calculating the derivative, rp must be a
+ 2 elements array.
+ @param xsp Spline structure to use.
+ @param x Array of 4 coordinates.
+ @param d Flag: Calculate derivative.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+dk4xsp_i_calculate(
+ double *rp,
+ dk4_xsp_t const *xsp,
+ double const *x,
+ int d,
+ dk4_er_t *erp
+)
+{
+ double z;
+ double n;
+ double dzdt;
+ double dndt;
+ int back = 1;
+
+
+#line 817 "dk4xsp.ctr"
+
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != xsp);
+#endif
+ /* Calculate coordinates
+ */
+ z = x[1] * xsp->f[1] + x[2] * xsp->f[2];
+ n = xsp->f[1] + xsp->f[2];
+ if (DK4_UINT8_0 != xsp->h[0]) {
+ z += x[0] * xsp->f[0];
+ n += xsp->f[0];
+ }
+ if (DK4_UINT8_0 != xsp->h[3]) {
+ z += x[3] * xsp->f[3];
+ n += xsp->f[3];
+ }
+ *rp = z / n;
+ if (!(dk4ma_is_finite(*rp))) {
+
+#line 836 "dk4xsp.ctr"
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+
+ /* Abort on errors or if no derivative needed
+ */
+ if ((0 == d) || (0 == back)) { goto finished; }
+
+ /* Calculate derivative
+ */
+ dzdt = x[1] * xsp->dfdt[1] + x[2] * xsp->dfdt[2];
+ dndt = xsp->dfdt[1] + xsp->dfdt[2];
+ if (DK4_UINT8_0 != xsp->h[0]) {
+ dzdt += x[0] * xsp->dfdt[0];
+ dndt += xsp->dfdt[0];
+ }
+ if (DK4_UINT8_0 != xsp->h[3]) {
+ dzdt += x[3] * xsp->dfdt[3];
+ dndt += xsp->dfdt[3];
+ }
+ rp[1] = (n * dzdt - z * dndt) / (n * n);
+ if (!(dk4ma_is_finite(rp[1]))) {
+
+#line 858 "dk4xsp.ctr"
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+
+ finished:
+
+
+#line 864 "dk4xsp.ctr"
+
+
+#line 865 "dk4xsp.ctr"
+
+
+#line 866 "dk4xsp.ctr"
+
+
+#line 867 "dk4xsp.ctr"
+
+
+#line 868 "dk4xsp.ctr"
+ return back;
+}
+
+
+
+void
+dk4xsp_reset_data(dk4_xsp_t *xsp)
+{
+ size_t i; /* Traverse arrays */
+
+
+#line 878 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ if (NULL != xsp) {
+ for (i = 0; i < 4; i++) {
+ xsp->s[i] = xsp->q[i] = 0.0;
+ xsp->p[i] = 2.0;
+ xsp->h[i] = ((uint8_t)0U);
+ }
+ xsp->dudt[0] = xsp->dudt[1] = -1.0;
+ xsp->dudt[2] = xsp->dudt[3] = 1.0;
+ }
+
+
+#line 891 "dk4xsp.ctr"
+
+
+#line 892 "dk4xsp.ctr"
+
+
+#line 893 "dk4xsp.ctr"
+}
+
+
+
+void
+dk4xsp_reset(dk4_xsp_t *xsp)
+{
+
+
+#line 901 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ if (NULL != xsp) {
+ DK4_MEMRES(xsp,sizeof(dk4_xsp_t));
+ dk4xsp_reset_data(xsp);
+ xsp->xfig = ((uint8_t)0U);
+ }
+
+
+#line 910 "dk4xsp.ctr"
+}
+
+
+
+void
+dk4xsp_set_xfig(dk4_xsp_t *xsp, uint8_t val)
+{
+
+
+#line 918 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ if (NULL != xsp) {
+ xsp->xfig = val;
+ }
+
+
+#line 925 "dk4xsp.ctr"
+}
+
+
+
+void
+dk4xsp_set_point(
+ dk4_xsp_t *xsp,
+ double s,
+ size_t i
+)
+{
+
+
+#line 937 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ if ((NULL != xsp) && (4 > i)) {
+ xsp->s[i] = s;
+ xsp->h[i] = ((uint8_t)1U);
+ switch ((int)i) {
+ case 1: { /* Start of segment */
+ if (0.0 > s) { /* Interpolation */
+ if (((uint8_t)0U) != xsp->xfig) {
+ xsp->q[0] = xsp->q[2] = 0.0 - s;
+ }
+ else {
+ xsp->q[0] = xsp->q[2] = -0.5 * s;
+ }
+ }
+ else { /* Approximation */
+ xsp->p[0] = xsp->p[2] = 2.0 * (1.0 + s) * (1.0 + s);
+ xsp->dudt[2] = 1.0 / (1.0 + s);
+ xsp->dudt[0] = 0.0 - xsp->dudt[2];
+ }
+ } break;
+ case 2: { /* End of segment */
+ if (0.0 > s) { /* Interpolation */
+ if (((uint8_t)0U) != xsp->xfig) {
+ xsp->q[1] = xsp->q[3] = 0.0 - s;
+ }
+ else {
+ xsp->q[1] = xsp->q[3] = -0.5 * s;
+ }
+ }
+ else { /* Approximation */
+ xsp->p[1] = xsp->p[3] = 2.0 * (1.0 + s) * (1.0 + s);
+ xsp->dudt[3] = 1.0 / (1.0 + s);
+ xsp->dudt[1] = 0.0 - xsp->dudt[3];
+ }
+ } break;
+ }
+ }
+
+
+#line 977 "dk4xsp.ctr"
+}
+
+
+
+int
+dk4xsp_prepare(
+ dk4_xsp_t *xsp,
+ double t,
+ int d,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 991 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+ assert(0.0 <= t);
+ assert(1.0 >= t);
+#endif
+ if ( (NULL != xsp) && (0.0 <= t) && (1.0 >= t)) {
+ if (((uint8_t)0U != xsp->h[1]) && ((uint8_t)0U != xsp->h[2])) {
+ back = 1;
+ dk4xsp_i_prepare(xsp, t, d);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1009 "dk4xsp.ctr"
+ return back;
+}
+
+
+
+int
+dk4xsp_calculate(
+ double *rp,
+ dk4_xsp_t const *xsp,
+ double const *x,
+ int d,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+
+
+#line 1025 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+ assert(NULL != rp);
+#endif
+ if ((NULL != rp) && (NULL != xsp) && (NULL != x)) {
+ if (((uint8_t)0U != xsp->h[1]) && ((uint8_t)0U != xsp->h[2])) {
+ back = dk4xsp_i_calculate(rp, xsp, x, d, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1041 "dk4xsp.ctr"
+ return back;
+}
+
+
+
+void
+dk4xsp2d_reset(
+ dk4_xsp_2d_t *sp
+)
+{
+ size_t i;
+
+
+#line 1053 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if (NULL != sp) {
+ DK4_MEMRES(sp,sizeof(dk4_xsp_2d_t));
+ dk4xsp_reset(&(sp->xsp));
+ for (i = 0; i < 4; i++) { sp->x[i] = sp->y[i] = 0.0; }
+ }
+
+
+#line 1062 "dk4xsp.ctr"
+}
+
+
+
+void
+dk4xsp2d_set_xfig(
+ dk4_xsp_2d_t *sp,
+ uint8_t val
+)
+{
+
+
+#line 1073 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if (NULL != sp) {
+ dk4xsp_set_xfig(&(sp->xsp), val);
+ }
+
+
+#line 1080 "dk4xsp.ctr"
+}
+
+
+
+void
+dk4xsp2d_reset_points(
+ dk4_xsp_2d_t *sp
+)
+{
+ size_t i;
+
+
+#line 1091 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if (NULL != sp) {
+ dk4xsp_reset_data(&(sp->xsp));
+ for (i = 0; i < 4; i++) { sp->x[i] = sp->y[i] = 0.0; }
+ }
+
+
+#line 1099 "dk4xsp.ctr"
+}
+
+
+
+void
+dk4xsp2d_set_point(
+ dk4_xsp_2d_t *sp,
+ double x,
+ double y,
+ double s,
+ size_t i
+)
+{
+
+
+#line 1113 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if ((NULL != sp) && (4 > i)) {
+ sp->x[i] = x;
+ sp->y[i] = y;
+ dk4xsp_set_point(&(sp->xsp), s, i);
+ }
+
+
+#line 1122 "dk4xsp.ctr"
+}
+
+
+
+int
+dk4xsp2d_calculate_value(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double t,
+ dk4_er_t *erp
+)
+{
+ int res;
+ int back = 0;
+
+
+#line 1137 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+ assert(NULL != rp);
+ assert(0.0 <= t);
+ assert(1.0 >= t);
+#endif
+ if ((NULL != rp) && (NULL != sp) && (0.0 <= t) && (1.0 >= t)) {
+ if (((uint8_t)0U != sp->xsp.h[1]) && ((uint8_t)0U != sp->xsp.h[2])) {
+ back = 1;
+ dk4xsp_i_prepare(&(sp->xsp), t, 0);
+ res = dk4xsp_i_calculate(&(rp[0]), &(sp->xsp), &(sp->x[0]), 0, erp);
+ if (0 == res) {
+
+#line 1149 "dk4xsp.ctr"
+ back = 0;
+ }
+ res = dk4xsp_i_calculate(&(rp[1]), &(sp->xsp), &(sp->y[0]), 0, erp);
+ if (0 == res) {
+
+#line 1153 "dk4xsp.ctr"
+ back = 0;
+ }
+
+
+#line 1156 "dk4xsp.ctr"
+
+
+#line 1157 "dk4xsp.ctr"
+ }
+ else {
+
+#line 1159 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+
+#line 1163 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1166 "dk4xsp.ctr"
+ return back;
+}
+
+
+
+int
+dk4xsp2d_calculate_value_derivative(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double t,
+ dk4_er_t *erp
+)
+{
+ int res;
+ int back = 0;
+
+
+#line 1182 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+ assert(NULL != rp);
+ assert(0.0 <= t);
+ assert(1.0 >= t);
+#endif
+ if ((NULL != rp) && (NULL != sp) && (0.0 <= t) && (1.0 >= t)) {
+ if (((uint8_t)0U != sp->xsp.h[1]) && ((uint8_t)0U != sp->xsp.h[2])) {
+ back = 1;
+ dk4xsp_i_prepare(&(sp->xsp), t, 1);
+ res = dk4xsp_i_calculate(&(rp[0]), &(sp->xsp), &(sp->x[0]), 1, erp);
+ if (0 == res) {
+
+#line 1194 "dk4xsp.ctr"
+ back = 0;
+ }
+ res = dk4xsp_i_calculate(&(rp[2]), &(sp->xsp), &(sp->y[0]), 1, erp);
+ if (0 == res) {
+
+#line 1198 "dk4xsp.ctr"
+ back = 0;
+ }
+
+
+#line 1201 "dk4xsp.ctr"
+
+
+#line 1202 "dk4xsp.ctr"
+
+
+#line 1203 "dk4xsp.ctr"
+
+
+#line 1204 "dk4xsp.ctr"
+ }
+ else {
+
+#line 1206 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+
+#line 1210 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+
+
+#line 1213 "dk4xsp.ctr"
+ return back;
+}
+
+
+
+int
+dk4xsp2d_is_line(dk4_xsp_2d_t const *sp)
+{
+ int back = 0;
+
+
+#line 1223 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if (NULL != sp) {
+ if (1.0e-8 > fabs(sp->xsp.s[1])) {
+ if (1.0e-8 > fabs(sp->xsp.s[2])) {
+ back = 1;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1235 "dk4xsp.ctr"
+ }
+#endif
+
+
+#line 1238 "dk4xsp.ctr"
+ return back;
+}
+
+
+
+int
+dk4xsp2d_calculate_length(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double eps,
+ dk4_er_t *erp
+)
+{
+ double v0[2]; /* Previous point */
+ double v1[2]; /* Current point */
+ double oldres; /* Length result from previous pass */
+ double res; /* Length result from current pass */
+ double dx; /* X difference */
+ double dy; /* Y difference */
+ double t; /* t value at end of current sub segment */
+ size_t nsegs; /* Number of sub segments in current pass */
+ size_t i; /* Current sub segment */
+ unsigned passno; /* Pass number */
+ int back = 0; /* Function result */
+
+
+#line 1263 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+ assert(NULL != rp);
+ assert(0.0 < eps);
+#endif
+ if ((NULL != rp) && (NULL != sp) && (0.0 < eps)) {
+ if (0 != dk4xsp2d_is_line(sp)) {
+
+#line 1270 "dk4xsp.ctr"
+ dx = sp->x[2] - sp->x[1];
+ dy = sp->y[2] - sp->y[1];
+ res = sqrt(dx * dx + dy * dy);
+ if (0 != dk4ma_is_finite(res)) {
+ *rp = res;
+ back = 1;
+ }
+ else {
+
+#line 1278 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ else {
+
+#line 1282 "dk4xsp.ctr"
+ nsegs = (size_t)256U;
+ oldres = -1.0;
+ for (passno = 0U; ((0 == back) && (passno < 16U)); passno++) {
+ res = 0.0;
+ if (0 != dk4xsp2d_calculate_value(v0, sp, 0.0, erp)) {
+ for (i = (size_t)0U; i < nsegs; i++) {
+ t = ((double)(i + (size_t)1U)) / ((double)nsegs);
+ if (0 != dk4xsp2d_calculate_value(v1, sp, t, erp)) {
+ dx = v1[0] - v0[0];
+ dy = v1[1] - v0[1];
+ res += sqrt(dx * dx + dy * dy);
+ }
+ else {
+
+#line 1295 "dk4xsp.ctr"
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+
+#line 1302 "dk4xsp.ctr"
+ if (0 != dk4ma_is_finite(res)) {
+#if TRACE_DEBUG
+ if (0U != passno) {
+
+
+#line 1306 "dk4xsp.ctr"
+ }
+#endif
+ if ((0U != passno) && (eps > fabs(res - oldres))) {
+ back = 1;
+
+#line 1310 "dk4xsp.ctr"
+ *rp = res;
+ }
+ else {
+ oldres = res;
+ nsegs *= (size_t)2U;
+ }
+ }
+ else {
+
+#line 1318 "dk4xsp.ctr"
+ back = -1;
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ }
+ else {
+
+#line 1323 "dk4xsp.ctr"
+ back = -1;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ if (0 == back) {
+
+#line 1328 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
+ }
+ }
+ }
+ else {
+
+#line 1333 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (-1 == back) { back = 0; }
+
+
+#line 1337 "dk4xsp.ctr"
+ return back;
+}
+
+
+
+int
+dk4xsp2d_calculate_partial_length(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double tend,
+ double eps,
+ dk4_er_t *erp
+)
+{
+ double v0[2]; /* Previous point */
+ double v1[2]; /* Current point */
+ double oldres; /* Length result from previous pass */
+ double res; /* Length result from current pass */
+ double dx; /* X difference */
+ double dy; /* Y difference */
+ double t; /* t value at end of current sub segment */
+ size_t nsegs; /* Number of sub segments in current pass */
+ size_t i; /* Current sub segment */
+ unsigned passno; /* Pass number */
+ int back = 0; /* Function result */
+
+
+#line 1363 "dk4xsp.ctr"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+ assert(NULL != rp);
+ assert(0.0 < eps);
+ assert(0.0 <= tend);
+ assert(1.0 >= tend);
+#endif
+ if (
+ (NULL != rp) && (NULL != sp) && (0.0 < eps)
+ && (0.0 <= tend) && (1.0 >= tend)
+ ) {
+ if (0.0 >= tend) {
+ *rp = 0.0;
+ back = 1;
+ }
+ else {
+ if (1.0 <= tend) {
+ back = dk4xsp2d_calculate_length(rp, sp, eps, erp);
+ }
+ else {
+ if (0 != dk4xsp2d_is_line(sp)) {
+
+#line 1384 "dk4xsp.ctr"
+ if (0 != dk4xsp2d_calculate_value(v0, sp, tend, erp)) {
+ dx = v0[0] - sp->x[1];
+ dy = v0[1] - sp->y[1];
+ res = sqrt(dx * dx + dy * dy);
+ if (0 != dk4ma_is_finite(res)) {
+ *rp = res;
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ }
+ else {
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ }
+ else {
+
+#line 1406 "dk4xsp.ctr"
+ nsegs = (size_t)256U;
+ oldres = -1.0;
+ for (passno = 0U;((0 == back) && (passno < 16U));passno++) {
+ res = 0.0;
+ if (0 != dk4xsp2d_calculate_value(v0, sp, 0.0, erp)) {
+ for (i = (size_t)0U; i < nsegs; i++) {
+ t = (tend * ((double)(i + (size_t)1U)))
+ / ((double)nsegs);
+ if (
+ 0 != dk4xsp2d_calculate_value(v1,sp,t,erp)
+ ) {
+ dx = v1[0] - v0[0];
+ dy = v1[1] - v0[1];
+ res += sqrt(dx * dx + dy * dy);
+ }
+ else {
+
+#line 1422 "dk4xsp.ctr"
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+
+#line 1429 "dk4xsp.ctr"
+ if (0 != dk4ma_is_finite(res)) {
+#if TRACE_DEBUG
+ if (0U != passno) {
+
+
+#line 1433 "dk4xsp.ctr"
+ }
+#endif
+ if (
+ (0U != passno) && (eps > fabs(res - oldres))
+ ) {
+ back = 1;
+
+#line 1439 "dk4xsp.ctr"
+ *rp = res;
+ }
+ else {
+ oldres = res;
+ nsegs *= (size_t)2U;
+ }
+ }
+ else {
+
+#line 1447 "dk4xsp.ctr"
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ }
+ else {
+
+#line 1454 "dk4xsp.ctr"
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ }
+ if (0 == back) {
+
+#line 1461 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
+ }
+ }
+ }
+ }
+ }
+ else {
+
+#line 1468 "dk4xsp.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (-1 == back) { back = 0; }
+
+
+#line 1472 "dk4xsp.ctr"
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4xsp.ctr b/support/dktools/dk4xsp.ctr
new file mode 100644
index 0000000000..852a68e444
--- /dev/null
+++ b/support/dktools/dk4xsp.ctr
@@ -0,0 +1,1478 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file dk4xsp.h X-spline segments.
+
+@section secxspoverview Overview
+
+X-splines were introduced by C. Blanc and C. Schlick on the SIGGRAPH'95,
+they are described in detail in the paper:
+"X-Splines: A Spline Model Designed for the End-User".
+
+Unfortunately the X-spline implementation in XFig contained a bug for
+many years, for interpolated splines a wrong coefficient calculation
+(q=-s instead of q=-0.5s) was used.
+Probably the resulting unexpected strong curvature and sometimes unwanted
+oscillations kept people from using interpolated X-splines in XFig.
+Fixing the bug and introducing the correct calculation would break
+appearance of existing *.fig files containing interpolated X-splines.
+So the decision was made to keep the calculation as is. For new
+interpolated X-splines a factor s=-0.5 is used instead of -1, so the
+q value does not exceed 0.5.
+
+This module contains functions for X-spline calculations, both
+in correct mode and in XFig compatibility mode.
+
+An X-spline is a continuous curve represented by a set of discrete
+control points. Each control point consists of coordinates (x, y, optionally
+z) and a shape factor s in range -1 to 1 (positive for approximation points,
+0 for corner points, negative for interpolation points).
+
+An X-spline segment is the curve range corresponding to two consecutive
+control points. It is controlled by up to 4 control points:
+- Control point corresponding to start of segment (index 1),
+- Control point corresponding to end of segment (index 2),
+- Neighbour control point "left" from segment start control point (index 0),
+- Neighbour control point "right" from segment end control point (index 3).
+
+For open X-splines there is no left neighbour for the first segment
+and no right neighbour for the final segment.
+
+For closed X-splines the final point is the left neighbour of the first segment
+and the first point is the right neighbour of the final segment.
+
+The t parameter is relative to the segment, it is in the range
+0.0<=t<=1.0.
+
+@section secxsphighlevel High level API
+
+A high level API is available for 2D X-splines using the dk4_xsp_2d_t
+data type.
+
+Before doing any calculation, use dk4xsp2d_reset() to reset the entire
+structure. Optionally use dk4xsp2d_set_xfig() to set up XFig compatibility
+mode.
+
+For each segment use dk4xsp2d_reset_points() to
+reset the data in the dk4_xsp_2d_t structure.
+Now use dk4xsp2d_set_point() with index 0, 1, 2, 3
+to set coordinates and shape factors for left neighbour control point
+of segment, start of segment, end of segment and right neighbour.
+For the first segment of open X-splines skip index 0 as there is no
+"left" neighbour. For the final segment of open X-splines skip index 3 as
+there is no "right" neighbour.
+
+To draw an X-spline using polyline/polygon approximation you need to
+calculate point coordinates, use the dk4xsp2d_calculate_value() function.
+The t paramater is in the range 0<=t<=1.
+A pointer to an array of at least 2 elements is required as rp argument,
+x and y value are stored here.
+I suggest to use at least 32 subsegments for each X-spline segment.
+
+To draw an X-spline using a sequence of Bezier curves you need to calculate
+point coordinates (x, y) and the first derivatives (dx/dt, dy/dt),
+use the dk4xsp2d_calculate_value_derivative function.
+The function stores x, dx/dt, y, dy/dt in the array rp points to.
+A pointer to an array of at least 4 elements is required as rp argument.
+I suggest to use at least 4 subsegments for each X-spline segment,
+8 subsegments are recommended.
+
+@section secxsplowlevel Low level API
+
+The low level API calculates values for just one coordinate.
+
+Before doing any calculation, use dk4xsp_reset() to reset the entire
+structure, optionally use dk4xsp_set_xfig() to set up XFig compatibility
+mode.
+
+For each segment use dk4xsp_reset_data() to reset all data components,
+use dk4xsp_set_point() multiple times with i=(0),1,2,(3) to set shape factors
+for the control points. Omitted calls with i=0 or i=3 indicate that the
+neighbour control points are not present.
+
+Each point within a segment is represented by a t value in range 0 to 1.
+For each point use dk4xsp_prepare() first to set up internal coefficients
+(blending functions values and optionally blending functions derivative
+values) corresponding to the t value.
+Next use dk4xsp_calculate() to calculate the
+coordinate value and optionally the first derivative.
+After using dk4xsp_prepare() once to set up the segment you can use
+dk4xsp_calculate() multiple times for different coordinates.
+The dk4xsp_prepare() function calculates the blending function values and
+optionally the derivatives value. The dk4xsp_calculate() function applies the
+blending function values and optionally derivatives to a set of
+x, y or z coordinates of control points.
+The same d value must be used in both calls, you can not calculate a
+derivative value if the structure was not prepared to do so.
+
+*/
+
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+/** X-spline coefficients without coordinates.
+ The dk4xsp_set_point() function sets h, s, p, q, dudt.
+ The dk4xsp_prepare() function sets u, f, dfdt.
+*/
+typedef struct {
+ double s[4]; /**< Shape factors. */
+ double p[4]; /**< Coefficients p for blending functions. */
+ double q[4]; /**< Coefficients q for blending functions. */
+ double u[4]; /**< Parameter u for blending functions. */
+ double dudt[4]; /**< Derivative du/dt. */
+ double f[4]; /**< Blending function results. */
+ double dfdt[4]; /**< Derivatives df/dt of the blending functions. */
+ uint8_t h[4]; /**< Availability of coordinates and shape factors. */
+ uint8_t xfig; /**< Flag: XFig compatibility. */
+} dk4_xsp_t;
+
+
+
+/** X-spline segment in two dimensions.
+*/
+typedef struct {
+ double x[4]; /**< X coordinates. */
+ double y[4]; /**< Y coordinates. */
+ dk4_xsp_t xsp; /**< Shape factors and coefficients. */
+} dk4_xsp_2d_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+ LOW LEVEL API
+ -------------
+*/
+
+/** Reset X-spline structure including the Xfig compatibility flag.
+ @param xsp Spline structure to reset.
+*/
+
+void
+dk4xsp_reset(dk4_xsp_t *xsp);
+
+
+/** Reset data components in X-spline structure, leave Xfig compatibility
+ flag unchanged.
+ @param xsp Spline structure to reset.
+*/
+
+void
+dk4xsp_reset_data(dk4_xsp_t *xsp);
+
+
+/** Set or reset xfig compatibility flag.
+ @param xsp Spline structure to modify.
+ @param val New Xfig compatibility flag value.
+*/
+
+void
+dk4xsp_set_xfig(dk4_xsp_t *xsp, uint8_t val);
+
+
+/** Set shape factor for one control point, calculate values derived
+ from shape factor.
+ Used 2 to 4 times to set up a segment.
+ @param xsp Spline structure to modify.
+ @param s Shape factor
+ @param i Index of control point:
+ 0=left neighbour, 1=segment start, 2=segment end,
+ 3=right neighbour.
+*/
+
+void
+dk4xsp_set_point(
+ dk4_xsp_t *xsp,
+ double s,
+ size_t i
+);
+
+
+
+/** Prepare calculations for one t value.
+ @param xsp Spline structure to prepare.
+ @param t Parameter t in range 0 to 1.
+ @param d Prepare to calculate derivative.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function.
+*/
+
+int
+dk4xsp_prepare(
+ dk4_xsp_t *xsp,
+ double t,
+ int d,
+ dk4_er_t *erp
+);
+
+
+
+/** Calculations for one t value.
+ For d=0 the function just calculates the position, rp is a
+ pointer to one result variable.
+ For other d values the function also calculates the first derivative,
+ rp is a pointer to an array of two elements: position and derivative.
+ @param rp Result variable or array address.
+ @param xsp Spline structure to use.
+ @param x Coordinates values: 4 elements for values at
+ left neighbour, left border, right border and right neighbour.
+ @param d Flag: Calculate derivative too.
+ @param erp Error report for diagnostics.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in the calculation.
+*/
+
+int
+dk4xsp_calculate(
+ double *rp,
+ dk4_xsp_t const *xsp,
+ double const *x,
+ int d,
+ dk4_er_t *erp
+);
+
+
+/*
+ HIGH LEVEL API FOR 2D X-SPLINES
+ -------------------------------
+*/
+
+/** Reset spline structure completely.
+ @param sp Spline structure to reset.
+*/
+
+void
+dk4xsp2d_reset(
+ dk4_xsp_2d_t *sp
+);
+
+
+/** Set or reset XFig compatibility flag.
+ @param sp Spline structure to set up.
+ @param val New flag value.
+*/
+
+void
+dk4xsp2d_set_xfig(
+ dk4_xsp_2d_t *sp,
+ uint8_t val
+);
+
+/** Reset spline structure to "all points unset".
+ @param sp Spline structure to reset.
+*/
+
+void
+dk4xsp2d_reset_points(
+ dk4_xsp_2d_t *sp
+);
+
+
+/** Set one point in spline structure.
+ @param sp Spline structure to set up.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param s Shape factor.
+ @param i Index (0=A, 1=B, 2=C, 3=D).
+*/
+
+void
+dk4xsp2d_set_point(
+ dk4_xsp_2d_t *sp,
+ double x,
+ double y,
+ double s,
+ size_t i
+);
+
+
+/** Calculate just the value at a given point.
+ @param rp Address of results array, 2 elements: rp[0]=x, rp[1]=y.
+ @param sp Spline structure to use.
+ @param t Value t in range 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occured in calculation.
+*/
+
+int
+dk4xsp2d_calculate_value(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double t,
+ dk4_er_t *erp
+);
+
+
+/** Calculate values and first derivative.
+ @param rp Address of results array, 4 elements:
+ rp[0]=x, rp[1]=dx/dt, rp[2]=y, rp[3]=dy/dt.
+ @param sp Spline structure to use.
+ @param t Value t in range 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occured in calculation.
+*/
+
+int
+dk4xsp2d_calculate_value_derivative(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double t,
+ dk4_er_t *erp
+);
+
+
+/** Check whether the segment is a line (Shape factor s is 0 for
+ points 1 and 2).
+ This check can be applied after setting the control points for the
+ segment.
+ @param sp Spline segment to check.
+ @return 1 for lines, 0 for curved spline segment.
+*/
+
+int
+dk4xsp2d_is_line(dk4_xsp_2d_t const *sp);
+
+
+/** Calculate X-spline segment length.
+ @param rp Address of result variable.
+ @param sp Spline segment to calculate length for.
+ @param eps Tolerance to stop iteration.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occured in calculation,
+ - DK4_E_NOT_FOUND<br>
+ if the iteration did not succeed.
+*/
+
+int
+dk4xsp2d_calculate_length(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double eps,
+ dk4_er_t *erp
+);
+
+
+/** Calculate partial X-spline segment length from 0 to t_end.
+ @param rp Address of result variable.
+ @param sp Spline segment to calculate length for.
+ @param tend End value for parameter t.
+ @param eps Tolerance to stop iteration.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occured in calculation,
+ - DK4_E_NOT_FOUND<br>
+ if the iteration did not succeed.
+*/
+
+int
+dk4xsp2d_calculate_partial_length(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double tend,
+ double eps,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#include "dk4xsp.h"
+
+
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+
+$!trace-include
+
+
+
+/** Approximation function.
+*/
+#define FCT_F(u,p) \
+u*u*u*(u*(u*(6.0-p)+2.0*p-15.0)+10.0-p)
+
+/** Interpolation function for 0<=u<=1.
+*/
+#define FCT_G(u,p,q) \
+u*(u*(u*(u*(u*(6.0-5.0*q-p)+2.0*p+14.0*q-15.0)+10.0-12.0*q-p)+2.0*q)+q)
+
+/** Interpolation function for -1<=u<0.
+*/
+#define FCT_H(u,q) \
+u*(u*(u*u*(-2.0*q-q*u)+2.0*q)+q)
+
+/** First derivative of approximation function.
+*/
+#define FCT_DFDU(u,p) \
+u*u*(u*(u*(30.0-5.0*p)+8.0*p-60.0)+30.0-3.0*p)
+
+/** First derivative of interpolation function for 0<=u<=1.
+*/
+#define FCT_DGDU(u,p,q) \
+u*(u*(u*(u*(30.0-25.0*q-5.0*p)+8.0*p+56.0*q-60.0)+30.0-36.0*q-3.0*p)+4.0*q)+q
+
+/** First derivative of interpolation function for -1<=u<0.
+*/
+#define FCT_DHDU(u,q) \
+u*(4.0*q-u*u*(8.0*q+5.0*q*u))+q
+
+
+
+#if TRACE_DEBUG
+/** Show one array contents.
+ @param ptr Array start address.
+*/
+static
+void
+dk4xsp_show_array4(double const *ptr)
+{
+ size_t i;
+ for (i = 0; i < 4; i++) {
+ $? ". [%u] = %lg", (unsigned)i, ptr[i]
+ }
+}
+#endif
+
+
+
+/** Calculate approximation blending function value.
+ @param u Parameter u.
+ @param p Constant value p derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_f(double u, double p)
+{
+#if TRACE_DEBUG
+ double back = 0.0;
+ back = FCT_F(u,p);
+ $? "= fct_f(u=%lg,p=%lg) = %lg", u, p, back
+ return back;
+#else
+ return ( FCT_F(u,p) );
+#endif
+}
+
+
+
+/** Calculate interpolation blending function value for positive u arguments.
+ @param u Parameter u.
+ @param p Constant value p derived from shape factor.
+ @param q Constant value q derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_g(double u, double p, double q)
+{
+#if TRACE_DEBUG
+ double back = 0.0;
+ back = FCT_G(u,p,q);
+ $? "= fct_g(u=%lg,p=%lg,q=%lg) = %lg", u, p, q, back
+ return back;
+#else
+ return ( FCT_G(u,p,q) );
+#endif
+}
+
+
+
+/** Calculate interpolation blending function value for negative u arguments.
+ @param u Parameter u.
+ @param q Constant value q derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_h(double u, double q)
+{
+#if TRACE_DEBUG
+ double back = 0.0;
+ back = FCT_H(u,q);
+ $? "= fct_h(u=%lg,q=%lg) = %lg", u, q, back
+ return back;
+#else
+ return ( FCT_H(u,q) );
+#endif
+}
+
+
+
+/** Calculate approximation blending function derivative value.
+ @param u Parameter u.
+ @param p Constant value p derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_dfdu(double u, double p)
+{
+#if TRACE_DEBUG
+ double back;
+ back = FCT_DFDU(u,p);
+ $? "= fct_dfdu(u=%lg,p=%lg) = %lg", u, p, back
+ return back;
+#else
+ return ( FCT_DFDU(u,p) );
+#endif
+}
+
+
+
+/** Calculate interpolation blending function derivative value
+ for positive u arguments.
+ @param u Parameter u.
+ @param p Constant value p derived from shape factor.
+ @param q Constant value q derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_dgdu(double u, double p, double q)
+{
+#if TRACE_DEBUG
+ double back;
+ back = FCT_DGDU(u,p,q);
+ $? "= fct_dgdu(u=%lg,p=%lg,q=%lg) = %lg", u, p, q, back
+ return back;
+#else
+ return ( FCT_DGDU(u,p,q) );
+#endif
+}
+
+
+
+/** Calculate interpolation blending function derivative value
+ for negative u arguments.
+ @param u Parameter u.
+ @param q Constant value q derived from shape factor.
+ @return Calculation result.
+*/
+
+static
+double fct_dhdu(double u, double q)
+{
+#if TRACE_DEBUG
+ double back;
+ back = FCT_DHDU(u,q);
+ $? "= fct_dhdu(u=%lg,q=%lg) = %lg", u, q, back
+ return back;
+#else
+ return ( FCT_DHDU(u,q) );
+#endif
+}
+
+
+
+/** Prepare a coordinates calculation, calculate blending functions
+ values and optionally blending functions derivatives values.
+ @param xsp Spline structure to use.
+ @param t Parameter t in range 0 to 1.
+ @param d Flag: Derivatives required.
+*/
+
+static
+void
+dk4xsp_i_prepare(
+ dk4_xsp_t *xsp,
+ double t,
+ int d
+)
+{
+ size_t i;
+ $? "+ dk4xsp_i_prepare t=%lg", t
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ for (i = 0; i < 4; i++) { xsp->f[i] = xsp->u[i] = 0.0; }
+ if (0.0 > xsp->s[1]) { $? ". point 1 s < 0"
+ xsp->u[0] = 0.0 - t;
+ xsp->u[2] = t;
+ if ((uint8_t)0U != xsp->h[0]) {
+ xsp->f[0] = fct_h(xsp->u[0], xsp->q[0]);
+ }
+ xsp->f[2] = fct_g(xsp->u[2], xsp->p[2], xsp->q[2]);
+ }
+ else { $? ". point 1 s >= 0"
+ xsp->u[0] = (xsp->s[1] - t) / (1.0 + xsp->s[1]);
+ xsp->u[2] = (xsp->s[1] + t) / (1.0 + xsp->s[1]);
+ if (t < xsp->s[1]) { $? ". t allows f[0]"
+ if ((uint8_t)0U != xsp->h[0]) { $? ". have 0"
+ xsp->f[0] = fct_f(xsp->u[0], xsp->p[0]);
+ }
+#if TRACE_DEBUG
+ else { $? ". do not have 0"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? ". t does not allow f[0]"
+ }
+#endif
+ xsp->f[2] = fct_f(xsp->u[2], xsp->p[2]);
+ }
+ if (0.0 > xsp->s[2]) { $? ". point 2 s < 0"
+ xsp->u[1] = 1.0 - t;
+ xsp->u[3] = t - 1.0;
+ xsp->f[1] = fct_g(xsp->u[1], xsp->p[1], xsp->q[1]);
+ if ((uint8_t)0U != xsp->h[3]) {
+ xsp->f[3] = fct_h(xsp->u[3], xsp->q[3]);
+ }
+ }
+ else { $? ". point 2 s >= 0"
+ xsp->u[1] = (1.0 + xsp->s[2] - t) / (1.0 + xsp->s[2]);
+ xsp->u[3] = (t + xsp->s[2] - 1.0) / (1.0 + xsp->s[2]);
+ xsp->f[1] = fct_f(xsp->u[1], xsp->p[1]);
+ if (t > (1.0 - xsp->s[2])) { $? ". t allows f[3]"
+ if ((uint8_t)0U != xsp->h[3]) { $? ". have f[3]"
+ xsp->f[3] = fct_f(xsp->u[3], xsp->p[3]);
+ }
+ else { $? ". no f[3]"
+ }
+ }
+ else { $? ". t does not allow f[3]"
+ }
+ }
+
+ if (0 == d) { goto finished; }
+
+ for (i = 0; i < 4; i++) { xsp->dfdt[i] = 0.0; }
+ if (0.0 > xsp->s[1]) {
+ if ((uint8_t)0U != xsp->h[0]) {
+ xsp->dfdt[0] = fct_dhdu(xsp->u[0], xsp->q[0]);
+ xsp->dfdt[0] *= xsp->dudt[0];
+ }
+ xsp->dfdt[2] = fct_dgdu(xsp->u[2], xsp->p[2], xsp->q[2]);
+ xsp->dfdt[2] *= xsp->dudt[2];
+ }
+ else {
+ if (t < xsp->s[1]) { $? ". t allows f[0]"
+ if ((uint8_t)0U != xsp->h[0]) { $? ". have f[0]"
+ xsp->dfdt[0] = fct_dfdu(xsp->u[0], xsp->p[0]);
+ xsp->dfdt[0] *= xsp->dudt[0];
+ }
+#if TRACE_DEBUG
+ else { $? ". no f[0]"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? ". t does not allow f[0]"
+ }
+#endif
+
+ xsp->dfdt[2] = fct_dfdu(xsp->u[2], xsp->p[2]);
+ xsp->dfdt[2] *= xsp->dudt[2];
+ }
+
+ if (0.0 > xsp->s[2]) {
+ xsp->dfdt[1] = fct_dgdu(xsp->u[1], xsp->p[1], xsp->q[1]);
+ xsp->dfdt[1] *= xsp->dudt[1];
+ if ((uint8_t)0U != xsp->h[3]) {
+ xsp->dfdt[3] = fct_dhdu(xsp->u[3], xsp->q[3]);
+ xsp->dfdt[3] *= xsp->dudt[3];
+ }
+ }
+ else {
+ xsp->dfdt[1] = fct_dfdu(xsp->u[1], xsp->p[1]);
+ xsp->dfdt[1] *= xsp->dudt[1];
+ if (t > (1.0 - xsp->s[2])) { $? ". t allows f[3]"
+ if ((uint8_t)0U != xsp->h[3]) { $? ". have f[3]"
+ xsp->dfdt[3] = fct_dfdu(xsp->u[3], xsp->p[3]);
+ xsp->dfdt[3] *= xsp->dudt[3];
+ }
+#if TRACE_DEBUG
+ else { $? ". no f[3]"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? ". t does not allow f[3]"
+ }
+#endif
+ }
+
+ finished:
+ $? ". s"
+ $!trace-code dk4xsp_show_array4(&(xsp->s[0]));
+ $? ". p"
+ $!trace-code dk4xsp_show_array4(&(xsp->p[0]));
+ $? ". q"
+ $!trace-code dk4xsp_show_array4(&(xsp->q[0]));
+ $? ". u"
+ $!trace-code dk4xsp_show_array4(&(xsp->u[0]));
+ $? ". dudt"
+ $!trace-code dk4xsp_show_array4(&(xsp->dudt[0]));
+ $? ". f"
+ $!trace-code dk4xsp_show_array4(&(xsp->f[0]));
+ $? ". dfdt"
+ $!trace-code dk4xsp_show_array4(&(xsp->dfdt[0]));
+ $? "- dk4xsp_i_prepare"
+ return;
+}
+
+
+
+/** Calculate coordinates for one dimension.
+ @param rp Address of result variable or result array.
+ When calculating the derivative, rp must be a
+ 2 elements array.
+ @param xsp Spline structure to use.
+ @param x Array of 4 coordinates.
+ @param d Flag: Calculate derivative.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+dk4xsp_i_calculate(
+ double *rp,
+ dk4_xsp_t const *xsp,
+ double const *x,
+ int d,
+ dk4_er_t *erp
+)
+{
+ double z;
+ double n;
+ double dzdt;
+ double dndt;
+ int back = 1;
+ $? "+ dk4xsp_i_calculate"
+
+#if DK4_USE_ASSERT
+ assert(NULL != rp);
+ assert(NULL != xsp);
+#endif
+ /* Calculate coordinates
+ */
+ z = x[1] * xsp->f[1] + x[2] * xsp->f[2];
+ n = xsp->f[1] + xsp->f[2];
+ if (DK4_UINT8_0 != xsp->h[0]) {
+ z += x[0] * xsp->f[0];
+ n += xsp->f[0];
+ }
+ if (DK4_UINT8_0 != xsp->h[3]) {
+ z += x[3] * xsp->f[3];
+ n += xsp->f[3];
+ }
+ *rp = z / n;
+ if (!(dk4ma_is_finite(*rp))) { $? "! math problem"
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+
+ /* Abort on errors or if no derivative needed
+ */
+ if ((0 == d) || (0 == back)) { goto finished; }
+
+ /* Calculate derivative
+ */
+ dzdt = x[1] * xsp->dfdt[1] + x[2] * xsp->dfdt[2];
+ dndt = xsp->dfdt[1] + xsp->dfdt[2];
+ if (DK4_UINT8_0 != xsp->h[0]) {
+ dzdt += x[0] * xsp->dfdt[0];
+ dndt += xsp->dfdt[0];
+ }
+ if (DK4_UINT8_0 != xsp->h[3]) {
+ dzdt += x[3] * xsp->dfdt[3];
+ dndt += xsp->dfdt[3];
+ }
+ rp[1] = (n * dzdt - z * dndt) / (n * n);
+ if (!(dk4ma_is_finite(rp[1]))) { $? "! math problem"
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+
+ finished:
+ $? ". rp x = %lg", rp[0]
+ $!trace-code if (0 != d) {
+ $? ". rp dx/dt = %lg", rp[1]
+ $!trace-code }
+ $? "- dk4xsp_i_calculate %d", back
+ return back;
+}
+
+
+
+void
+dk4xsp_reset_data(dk4_xsp_t *xsp)
+{
+ size_t i; /* Traverse arrays */
+ $? "+ dk4xsp_reset_data"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ if (NULL != xsp) {
+ for (i = 0; i < 4; i++) {
+ xsp->s[i] = xsp->q[i] = 0.0;
+ xsp->p[i] = 2.0;
+ xsp->h[i] = ((uint8_t)0U);
+ }
+ xsp->dudt[0] = xsp->dudt[1] = -1.0;
+ xsp->dudt[2] = xsp->dudt[3] = 1.0;
+ }
+ $? ". f"
+ $!trace-code dk4xsp_show_array4(&(xsp->f[0]));
+ $? "- dk4xsp_reset_data"
+}
+
+
+
+void
+dk4xsp_reset(dk4_xsp_t *xsp)
+{
+ $? "+ dk4xsp_reset"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ if (NULL != xsp) {
+ DK4_MEMRES(xsp,sizeof(dk4_xsp_t));
+ dk4xsp_reset_data(xsp);
+ xsp->xfig = ((uint8_t)0U);
+ }
+ $? "- dk4xsp_reset"
+}
+
+
+
+void
+dk4xsp_set_xfig(dk4_xsp_t *xsp, uint8_t val)
+{
+ $? "+ dk4xsp_set_xfig %u", (unsigned)val
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ if (NULL != xsp) {
+ xsp->xfig = val;
+ }
+ $? "- dk4xsp_set_xfig"
+}
+
+
+
+void
+dk4xsp_set_point(
+ dk4_xsp_t *xsp,
+ double s,
+ size_t i
+)
+{
+ $? "+ dk4xsp_set_point i=%u s=%lg", (unsigned)i, s
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+#endif
+ if ((NULL != xsp) && (4 > i)) {
+ xsp->s[i] = s;
+ xsp->h[i] = ((uint8_t)1U);
+ switch ((int)i) {
+ case 1: { /* Start of segment */
+ if (0.0 > s) { /* Interpolation */
+ if (((uint8_t)0U) != xsp->xfig) {
+ xsp->q[0] = xsp->q[2] = 0.0 - s;
+ }
+ else {
+ xsp->q[0] = xsp->q[2] = -0.5 * s;
+ }
+ }
+ else { /* Approximation */
+ xsp->p[0] = xsp->p[2] = 2.0 * (1.0 + s) * (1.0 + s);
+ xsp->dudt[2] = 1.0 / (1.0 + s);
+ xsp->dudt[0] = 0.0 - xsp->dudt[2];
+ }
+ } break;
+ case 2: { /* End of segment */
+ if (0.0 > s) { /* Interpolation */
+ if (((uint8_t)0U) != xsp->xfig) {
+ xsp->q[1] = xsp->q[3] = 0.0 - s;
+ }
+ else {
+ xsp->q[1] = xsp->q[3] = -0.5 * s;
+ }
+ }
+ else { /* Approximation */
+ xsp->p[1] = xsp->p[3] = 2.0 * (1.0 + s) * (1.0 + s);
+ xsp->dudt[3] = 1.0 / (1.0 + s);
+ xsp->dudt[1] = 0.0 - xsp->dudt[3];
+ }
+ } break;
+ }
+ }
+ $? "- dk4xsp_set_point"
+}
+
+
+
+int
+dk4xsp_prepare(
+ dk4_xsp_t *xsp,
+ double t,
+ int d,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4xsp_prepare"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+ assert(0.0 <= t);
+ assert(1.0 >= t);
+#endif
+ if ( (NULL != xsp) && (0.0 <= t) && (1.0 >= t)) {
+ if (((uint8_t)0U != xsp->h[1]) && ((uint8_t)0U != xsp->h[2])) {
+ back = 1;
+ dk4xsp_i_prepare(xsp, t, d);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4xsp_prepare %d", back
+ return back;
+}
+
+
+
+int
+dk4xsp_calculate(
+ double *rp,
+ dk4_xsp_t const *xsp,
+ double const *x,
+ int d,
+ dk4_er_t *erp
+)
+{
+ int back = 0;
+ $? "+ dk4xsp_calculate"
+#if DK4_USE_ASSERT
+ assert(NULL != xsp);
+ assert(NULL != rp);
+#endif
+ if ((NULL != rp) && (NULL != xsp) && (NULL != x)) {
+ if (((uint8_t)0U != xsp->h[1]) && ((uint8_t)0U != xsp->h[2])) {
+ back = dk4xsp_i_calculate(rp, xsp, x, d, erp);
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4xsp_calculate %d", back
+ return back;
+}
+
+
+
+void
+dk4xsp2d_reset(
+ dk4_xsp_2d_t *sp
+)
+{
+ size_t i;
+ $? "+ dk4xsp2d_reset"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if (NULL != sp) {
+ DK4_MEMRES(sp,sizeof(dk4_xsp_2d_t));
+ dk4xsp_reset(&(sp->xsp));
+ for (i = 0; i < 4; i++) { sp->x[i] = sp->y[i] = 0.0; }
+ }
+ $? "- dk4xsp2d_reset"
+}
+
+
+
+void
+dk4xsp2d_set_xfig(
+ dk4_xsp_2d_t *sp,
+ uint8_t val
+)
+{
+ $? "+ dk4xsp2d_set_xfig %u", (unsigned)val
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if (NULL != sp) {
+ dk4xsp_set_xfig(&(sp->xsp), val);
+ }
+ $? "- dk4xsp2d_set_xfig"
+}
+
+
+
+void
+dk4xsp2d_reset_points(
+ dk4_xsp_2d_t *sp
+)
+{
+ size_t i;
+ $? "+ dk4xsp2d_reset_points"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if (NULL != sp) {
+ dk4xsp_reset_data(&(sp->xsp));
+ for (i = 0; i < 4; i++) { sp->x[i] = sp->y[i] = 0.0; }
+ }
+ $? "- dk4xsp2d_reset_points"
+}
+
+
+
+void
+dk4xsp2d_set_point(
+ dk4_xsp_2d_t *sp,
+ double x,
+ double y,
+ double s,
+ size_t i
+)
+{
+ $? "+ dk4xsp2d_set_point i=%u x=%lg y=%lg s=%lg", (unsigned)i, x, y, s
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if ((NULL != sp) && (4 > i)) {
+ sp->x[i] = x;
+ sp->y[i] = y;
+ dk4xsp_set_point(&(sp->xsp), s, i);
+ }
+ $? "- dk4xsp2d_set_point"
+}
+
+
+
+int
+dk4xsp2d_calculate_value(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double t,
+ dk4_er_t *erp
+)
+{
+ int res;
+ int back = 0;
+ $? "+ dk4xsp2d_calculate_value"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+ assert(NULL != rp);
+ assert(0.0 <= t);
+ assert(1.0 >= t);
+#endif
+ if ((NULL != rp) && (NULL != sp) && (0.0 <= t) && (1.0 >= t)) {
+ if (((uint8_t)0U != sp->xsp.h[1]) && ((uint8_t)0U != sp->xsp.h[2])) {
+ back = 1;
+ dk4xsp_i_prepare(&(sp->xsp), t, 0);
+ res = dk4xsp_i_calculate(&(rp[0]), &(sp->xsp), &(sp->x[0]), 0, erp);
+ if (0 == res) { $? "! x calculation"
+ back = 0;
+ }
+ res = dk4xsp_i_calculate(&(rp[1]), &(sp->xsp), &(sp->y[0]), 0, erp);
+ if (0 == res) { $? "! y calculation"
+ back = 0;
+ }
+ $? ". x = %lg", rp[0]
+ $? ". y = %lg", rp[1]
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4xsp2d_calculate_value"
+ return back;
+}
+
+
+
+int
+dk4xsp2d_calculate_value_derivative(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double t,
+ dk4_er_t *erp
+)
+{
+ int res;
+ int back = 0;
+ $? "+ dk4xsp2d_calculate_value_derivative"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+ assert(NULL != rp);
+ assert(0.0 <= t);
+ assert(1.0 >= t);
+#endif
+ if ((NULL != rp) && (NULL != sp) && (0.0 <= t) && (1.0 >= t)) {
+ if (((uint8_t)0U != sp->xsp.h[1]) && ((uint8_t)0U != sp->xsp.h[2])) {
+ back = 1;
+ dk4xsp_i_prepare(&(sp->xsp), t, 1);
+ res = dk4xsp_i_calculate(&(rp[0]), &(sp->xsp), &(sp->x[0]), 1, erp);
+ if (0 == res) { $? "! x calculation"
+ back = 0;
+ }
+ res = dk4xsp_i_calculate(&(rp[2]), &(sp->xsp), &(sp->y[0]), 1, erp);
+ if (0 == res) { $? "! y calculation"
+ back = 0;
+ }
+ $? ". x = %lg", rp[0]
+ $? ". dx/dt = %lg", rp[1]
+ $? ". y = %lg", rp[2]
+ $? ". dy/dt = %lg", rp[3]
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ $? "- dk4xsp2d_calculate_value_derivative"
+ return back;
+}
+
+
+
+int
+dk4xsp2d_is_line(dk4_xsp_2d_t const *sp)
+{
+ int back = 0;
+ $? "+ dk4xsp2d_is_line"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+#endif
+ if (NULL != sp) {
+ if (1.0e-8 > fabs(sp->xsp.s[1])) {
+ if (1.0e-8 > fabs(sp->xsp.s[2])) {
+ back = 1;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! args"
+ }
+#endif
+ $? "- dk4xsp2d_is_line %d", back
+ return back;
+}
+
+
+
+int
+dk4xsp2d_calculate_length(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double eps,
+ dk4_er_t *erp
+)
+{
+ double v0[2]; /* Previous point */
+ double v1[2]; /* Current point */
+ double oldres; /* Length result from previous pass */
+ double res; /* Length result from current pass */
+ double dx; /* X difference */
+ double dy; /* Y difference */
+ double t; /* t value at end of current sub segment */
+ size_t nsegs; /* Number of sub segments in current pass */
+ size_t i; /* Current sub segment */
+ unsigned passno; /* Pass number */
+ int back = 0; /* Function result */
+ $? "+ dk4xsp2d_calculate_length"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+ assert(NULL != rp);
+ assert(0.0 < eps);
+#endif
+ if ((NULL != rp) && (NULL != sp) && (0.0 < eps)) {
+ if (0 != dk4xsp2d_is_line(sp)) { $? ". straight line"
+ dx = sp->x[2] - sp->x[1];
+ dy = sp->y[2] - sp->y[1];
+ res = sqrt(dx * dx + dy * dy);
+ if (0 != dk4ma_is_finite(res)) {
+ *rp = res;
+ back = 1;
+ }
+ else { $? "! math overflow"
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ else { $? ". curved segment"
+ nsegs = (size_t)256U;
+ oldres = -1.0;
+ for (passno = 0U; ((0 == back) && (passno < 16U)); passno++) {
+ res = 0.0;
+ if (0 != dk4xsp2d_calculate_value(v0, sp, 0.0, erp)) {
+ for (i = (size_t)0U; i < nsegs; i++) {
+ t = ((double)(i + (size_t)1U)) / ((double)nsegs);
+ if (0 != dk4xsp2d_calculate_value(v1, sp, t, erp)) {
+ dx = v1[0] - v0[0];
+ dy = v1[1] - v0[1];
+ res += sqrt(dx * dx + dy * dy);
+ }
+ else { $? "! calculation failed %g", t
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ } $? ". pass %u result %g", passno, res
+ if (0 != dk4ma_is_finite(res)) {
+#if TRACE_DEBUG
+ if (0U != passno) {
+ $? ". pass %u delta = %g",passno,fabs(res - oldres)
+ }
+#endif
+ if ((0U != passno) && (eps > fabs(res - oldres))) {
+ back = 1; $? ". success pass %u", passno
+ *rp = res;
+ }
+ else {
+ oldres = res;
+ nsegs *= (size_t)2U;
+ }
+ }
+ else { $? "! math overflow"
+ back = -1;
+ dk4error_set_simple_error_code(erp,DK4_E_MATH_OVERFLOW);
+ }
+ }
+ else { $? "! calculation failed"
+ back = -1;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+ if (0 == back) { $? "! number of passes exceeded"
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
+ }
+ }
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (-1 == back) { back = 0; }
+ $? "- dk4xsp2d_calculate_length %d", back
+ return back;
+}
+
+
+
+int
+dk4xsp2d_calculate_partial_length(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double tend,
+ double eps,
+ dk4_er_t *erp
+)
+{
+ double v0[2]; /* Previous point */
+ double v1[2]; /* Current point */
+ double oldres; /* Length result from previous pass */
+ double res; /* Length result from current pass */
+ double dx; /* X difference */
+ double dy; /* Y difference */
+ double t; /* t value at end of current sub segment */
+ size_t nsegs; /* Number of sub segments in current pass */
+ size_t i; /* Current sub segment */
+ unsigned passno; /* Pass number */
+ int back = 0; /* Function result */
+ $? "+ dk4xsp2d_calculate_partial_length"
+#if DK4_USE_ASSERT
+ assert(NULL != sp);
+ assert(NULL != rp);
+ assert(0.0 < eps);
+ assert(0.0 <= tend);
+ assert(1.0 >= tend);
+#endif
+ if (
+ (NULL != rp) && (NULL != sp) && (0.0 < eps)
+ && (0.0 <= tend) && (1.0 >= tend)
+ ) {
+ if (0.0 >= tend) {
+ *rp = 0.0;
+ back = 1;
+ }
+ else {
+ if (1.0 <= tend) {
+ back = dk4xsp2d_calculate_length(rp, sp, eps, erp);
+ }
+ else {
+ if (0 != dk4xsp2d_is_line(sp)) { $? ". straight line"
+ if (0 != dk4xsp2d_calculate_value(v0, sp, tend, erp)) {
+ dx = v0[0] - sp->x[1];
+ dy = v0[1] - sp->y[1];
+ res = sqrt(dx * dx + dy * dy);
+ if (0 != dk4ma_is_finite(res)) {
+ *rp = res;
+ back = 1;
+ }
+ else {
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ }
+ else {
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ }
+ else { $? ". curved segment"
+ nsegs = (size_t)256U;
+ oldres = -1.0;
+ for (passno = 0U;((0 == back) && (passno < 16U));passno++) {
+ res = 0.0;
+ if (0 != dk4xsp2d_calculate_value(v0, sp, 0.0, erp)) {
+ for (i = (size_t)0U; i < nsegs; i++) {
+ t = (tend * ((double)(i + (size_t)1U)))
+ / ((double)nsegs);
+ if (
+ 0 != dk4xsp2d_calculate_value(v1,sp,t,erp)
+ ) {
+ dx = v1[0] - v0[0];
+ dy = v1[1] - v0[1];
+ res += sqrt(dx * dx + dy * dy);
+ }
+ else { $? "! calculation failed %g", t
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ } $? ". pass %u result %g", passno, res
+ if (0 != dk4ma_is_finite(res)) {
+#if TRACE_DEBUG
+ if (0U != passno) {
+ $? ". pass %u delta = %g",passno,fabs(res - oldres)
+ }
+#endif
+ if (
+ (0U != passno) && (eps > fabs(res - oldres))
+ ) {
+ back = 1; $? ". success pass %u", passno
+ *rp = res;
+ }
+ else {
+ oldres = res;
+ nsegs *= (size_t)2U;
+ }
+ }
+ else { $? "! math overflow"
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ }
+ else { $? "! calculation failed"
+ back = -1;
+ dk4error_set_simple_error_code(
+ erp, DK4_E_MATH_OVERFLOW
+ );
+ }
+ }
+ if (0 == back) { $? "! number of passes exceeded"
+ dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND);
+ }
+ }
+ }
+ }
+ }
+ else { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ }
+ if (-1 == back) { back = 0; }
+ $? "- dk4xsp2d_calculate_partial_length %d", back
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/dk4xsp.h b/support/dktools/dk4xsp.h
new file mode 100644
index 0000000000..87fcb8c7f3
--- /dev/null
+++ b/support/dktools/dk4xsp.h
@@ -0,0 +1,447 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dk4xsp.ctr
+*/
+
+#ifndef DK4XSP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define DK4XSP_H_INCLUDED 1
+
+
+#line 9 "dk4xsp.ctr"
+
+/** @file dk4xsp.h X-spline segments.
+
+@section secxspoverview Overview
+
+X-splines were introduced by C. Blanc and C. Schlick on the SIGGRAPH'95,
+they are described in detail in the paper:
+"X-Splines: A Spline Model Designed for the End-User".
+
+Unfortunately the X-spline implementation in XFig contained a bug for
+many years, for interpolated splines a wrong coefficient calculation
+(q=-s instead of q=-0.5s) was used.
+Probably the resulting unexpected strong curvature and sometimes unwanted
+oscillations kept people from using interpolated X-splines in XFig.
+Fixing the bug and introducing the correct calculation would break
+appearance of existing *.fig files containing interpolated X-splines.
+So the decision was made to keep the calculation as is. For new
+interpolated X-splines a factor s=-0.5 is used instead of -1, so the
+q value does not exceed 0.5.
+
+This module contains functions for X-spline calculations, both
+in correct mode and in XFig compatibility mode.
+
+An X-spline is a continuous curve represented by a set of discrete
+control points. Each control point consists of coordinates (x, y, optionally
+z) and a shape factor s in range -1 to 1 (positive for approximation points,
+0 for corner points, negative for interpolation points).
+
+An X-spline segment is the curve range corresponding to two consecutive
+control points. It is controlled by up to 4 control points:
+- Control point corresponding to start of segment (index 1),
+- Control point corresponding to end of segment (index 2),
+- Neighbour control point "left" from segment start control point (index 0),
+- Neighbour control point "right" from segment end control point (index 3).
+
+For open X-splines there is no left neighbour for the first segment
+and no right neighbour for the final segment.
+
+For closed X-splines the final point is the left neighbour of the first segment
+and the first point is the right neighbour of the final segment.
+
+The t parameter is relative to the segment, it is in the range
+0.0<=t<=1.0.
+
+@section secxsphighlevel High level API
+
+A high level API is available for 2D X-splines using the dk4_xsp_2d_t
+data type.
+
+Before doing any calculation, use dk4xsp2d_reset() to reset the entire
+structure. Optionally use dk4xsp2d_set_xfig() to set up XFig compatibility
+mode.
+
+For each segment use dk4xsp2d_reset_points() to
+reset the data in the dk4_xsp_2d_t structure.
+Now use dk4xsp2d_set_point() with index 0, 1, 2, 3
+to set coordinates and shape factors for left neighbour control point
+of segment, start of segment, end of segment and right neighbour.
+For the first segment of open X-splines skip index 0 as there is no
+"left" neighbour. For the final segment of open X-splines skip index 3 as
+there is no "right" neighbour.
+
+To draw an X-spline using polyline/polygon approximation you need to
+calculate point coordinates, use the dk4xsp2d_calculate_value() function.
+The t paramater is in the range 0<=t<=1.
+A pointer to an array of at least 2 elements is required as rp argument,
+x and y value are stored here.
+I suggest to use at least 32 subsegments for each X-spline segment.
+
+To draw an X-spline using a sequence of Bezier curves you need to calculate
+point coordinates (x, y) and the first derivatives (dx/dt, dy/dt),
+use the dk4xsp2d_calculate_value_derivative function.
+The function stores x, dx/dt, y, dy/dt in the array rp points to.
+A pointer to an array of at least 4 elements is required as rp argument.
+I suggest to use at least 4 subsegments for each X-spline segment,
+8 subsegments are recommended.
+
+@section secxsplowlevel Low level API
+
+The low level API calculates values for just one coordinate.
+
+Before doing any calculation, use dk4xsp_reset() to reset the entire
+structure, optionally use dk4xsp_set_xfig() to set up XFig compatibility
+mode.
+
+For each segment use dk4xsp_reset_data() to reset all data components,
+use dk4xsp_set_point() multiple times with i=(0),1,2,(3) to set shape factors
+for the control points. Omitted calls with i=0 or i=3 indicate that the
+neighbour control points are not present.
+
+Each point within a segment is represented by a t value in range 0 to 1.
+For each point use dk4xsp_prepare() first to set up internal coefficients
+(blending functions values and optionally blending functions derivative
+values) corresponding to the t value.
+Next use dk4xsp_calculate() to calculate the
+coordinate value and optionally the first derivative.
+After using dk4xsp_prepare() once to set up the segment you can use
+dk4xsp_calculate() multiple times for different coordinates.
+The dk4xsp_prepare() function calculates the blending function values and
+optionally the derivatives value. The dk4xsp_calculate() function applies the
+blending function values and optionally derivatives to a set of
+x, y or z coordinates of control points.
+The same d value must be used in both calls, you can not calculate a
+derivative value if the structure was not prepared to do so.
+
+*/
+
+
+#ifndef DK4ERROR_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4error.h"
+#else
+#include <dktools-4/dk4error.h>
+#endif
+#endif
+
+
+
+/** X-spline coefficients without coordinates.
+ The dk4xsp_set_point() function sets h, s, p, q, dudt.
+ The dk4xsp_prepare() function sets u, f, dfdt.
+*/
+typedef struct {
+ double s[4]; /**< Shape factors. */
+ double p[4]; /**< Coefficients p for blending functions. */
+ double q[4]; /**< Coefficients q for blending functions. */
+ double u[4]; /**< Parameter u for blending functions. */
+ double dudt[4]; /**< Derivative du/dt. */
+ double f[4]; /**< Blending function results. */
+ double dfdt[4]; /**< Derivatives df/dt of the blending functions. */
+ uint8_t h[4]; /**< Availability of coordinates and shape factors. */
+ uint8_t xfig; /**< Flag: XFig compatibility. */
+} dk4_xsp_t;
+
+
+
+/** X-spline segment in two dimensions.
+*/
+typedef struct {
+ double x[4]; /**< X coordinates. */
+ double y[4]; /**< Y coordinates. */
+ dk4_xsp_t xsp; /**< Shape factors and coefficients. */
+} dk4_xsp_2d_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+ LOW LEVEL API
+ -------------
+*/
+
+/** Reset X-spline structure including the Xfig compatibility flag.
+ @param xsp Spline structure to reset.
+*/
+
+void
+dk4xsp_reset(dk4_xsp_t *xsp);
+
+
+/** Reset data components in X-spline structure, leave Xfig compatibility
+ flag unchanged.
+ @param xsp Spline structure to reset.
+*/
+
+void
+dk4xsp_reset_data(dk4_xsp_t *xsp);
+
+
+/** Set or reset xfig compatibility flag.
+ @param xsp Spline structure to modify.
+ @param val New Xfig compatibility flag value.
+*/
+
+void
+dk4xsp_set_xfig(dk4_xsp_t *xsp, uint8_t val);
+
+
+/** Set shape factor for one control point, calculate values derived
+ from shape factor.
+ Used 2 to 4 times to set up a segment.
+ @param xsp Spline structure to modify.
+ @param s Shape factor
+ @param i Index of control point:
+ 0=left neighbour, 1=segment start, 2=segment end,
+ 3=right neighbour.
+*/
+
+void
+dk4xsp_set_point(
+ dk4_xsp_t *xsp,
+ double s,
+ size_t i
+);
+
+
+
+/** Prepare calculations for one t value.
+ @param xsp Spline structure to prepare.
+ @param t Parameter t in range 0 to 1.
+ @param d Prepare to calculate derivative.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function.
+*/
+
+int
+dk4xsp_prepare(
+ dk4_xsp_t *xsp,
+ double t,
+ int d,
+ dk4_er_t *erp
+);
+
+
+
+/** Calculations for one t value.
+ For d=0 the function just calculates the position, rp is a
+ pointer to one result variable.
+ For other d values the function also calculates the first derivative,
+ rp is a pointer to an array of two elements: position and derivative.
+ @param rp Result variable or array address.
+ @param xsp Spline structure to use.
+ @param x Coordinates values: 4 elements for values at
+ left neighbour, left border, right border and right neighbour.
+ @param d Flag: Calculate derivative too.
+ @param erp Error report for diagnostics.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a mathematical overflow occured in the calculation.
+*/
+
+int
+dk4xsp_calculate(
+ double *rp,
+ dk4_xsp_t const *xsp,
+ double const *x,
+ int d,
+ dk4_er_t *erp
+);
+
+
+/*
+ HIGH LEVEL API FOR 2D X-SPLINES
+ -------------------------------
+*/
+
+/** Reset spline structure completely.
+ @param sp Spline structure to reset.
+*/
+
+void
+dk4xsp2d_reset(
+ dk4_xsp_2d_t *sp
+);
+
+
+/** Set or reset XFig compatibility flag.
+ @param sp Spline structure to set up.
+ @param val New flag value.
+*/
+
+void
+dk4xsp2d_set_xfig(
+ dk4_xsp_2d_t *sp,
+ uint8_t val
+);
+
+/** Reset spline structure to "all points unset".
+ @param sp Spline structure to reset.
+*/
+
+void
+dk4xsp2d_reset_points(
+ dk4_xsp_2d_t *sp
+);
+
+
+/** Set one point in spline structure.
+ @param sp Spline structure to set up.
+ @param x X coordinate.
+ @param y Y coordinate.
+ @param s Shape factor.
+ @param i Index (0=A, 1=B, 2=C, 3=D).
+*/
+
+void
+dk4xsp2d_set_point(
+ dk4_xsp_2d_t *sp,
+ double x,
+ double y,
+ double s,
+ size_t i
+);
+
+
+/** Calculate just the value at a given point.
+ @param rp Address of results array, 2 elements: rp[0]=x, rp[1]=y.
+ @param sp Spline structure to use.
+ @param t Value t in range 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occured in calculation.
+*/
+
+int
+dk4xsp2d_calculate_value(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double t,
+ dk4_er_t *erp
+);
+
+
+/** Calculate values and first derivative.
+ @param rp Address of results array, 4 elements:
+ rp[0]=x, rp[1]=dx/dt, rp[2]=y, rp[3]=dy/dt.
+ @param sp Spline structure to use.
+ @param t Value t in range 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occured in calculation.
+*/
+
+int
+dk4xsp2d_calculate_value_derivative(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double t,
+ dk4_er_t *erp
+);
+
+
+/** Check whether the segment is a line (Shape factor s is 0 for
+ points 1 and 2).
+ This check can be applied after setting the control points for the
+ segment.
+ @param sp Spline segment to check.
+ @return 1 for lines, 0 for curved spline segment.
+*/
+
+int
+dk4xsp2d_is_line(dk4_xsp_2d_t const *sp);
+
+
+/** Calculate X-spline segment length.
+ @param rp Address of result variable.
+ @param sp Spline segment to calculate length for.
+ @param eps Tolerance to stop iteration.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occured in calculation,
+ - DK4_E_NOT_FOUND<br>
+ if the iteration did not succeed.
+*/
+
+int
+dk4xsp2d_calculate_length(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double eps,
+ dk4_er_t *erp
+);
+
+
+/** Calculate partial X-spline segment length from 0 to t_end.
+ @param rp Address of result variable.
+ @param sp Spline segment to calculate length for.
+ @param tend End value for parameter t.
+ @param eps Tolerance to stop iteration.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if invalid arguments were passed to the function,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric overflow occured in calculation,
+ - DK4_E_NOT_FOUND<br>
+ if the iteration did not succeed.
+*/
+
+int
+dk4xsp2d_calculate_partial_length(
+ double *rp,
+ dk4_xsp_2d_t *sp,
+ double tend,
+ double eps,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/dkclock.ico b/support/dktools/dkclock.ico
index d5aadad6ad..390ebd3e02 100644
--- a/support/dktools/dkclock.ico
+++ b/support/dktools/dkclock.ico
Binary files differ
diff --git a/support/dktools/dkclock.xpm b/support/dktools/dkclock.xpm
deleted file mode 100644
index d48908e19b..0000000000
--- a/support/dktools/dkclock.xpm
+++ /dev/null
@@ -1,40 +0,0 @@
-/* XPM */
-static const char *xpm_dkclock[] = {
-/* width height ncolors chars_per_pixel */
-"16 16 17 1",
-/* colors */
-" c #514300",
-". c #DCB700",
-"X c #342B00",
-"o c #1D1900",
-"O c #FFD400",
-"+ c #FCD200",
-"@ c #584900",
-"# c #8E7700",
-"$ c #120E00",
-"% c #F8CE00",
-"& c #1D1800",
-"* c #F5CC00",
-"= c #5A4B00",
-"- c #F9CF00",
-"; c #2F2700",
-": c #F6CD00",
-"> c None",
-/* pixels */
-"OOOOOOO++OOOOOOO",
-"OOOO..+XX+..OOOO",
-"OOO%&&*XX*&&%OOO",
-"OO%O==O##O==O-OO",
-"O.&=OOO;;OOO@o.O",
-"O.&=OOO;;OOO@o.O",
-"O+*OOOO;;OOOO:+O",
-"+XX+OOO&$;#O+XX+",
-"+XX+OOO &;#O+XX+",
-"O+*OOOOOOOOOO:+O",
-"O.&=OOOOOOOO@o.O",
-"O.&=OOOOOOOO@o.O",
-"OO%O@@O++O@@O-OO",
-"OOO-oo:XX:oo-OOO",
-"OOOO..+XX+..OOOO",
-"OOOOOOO++OOOOOOO"
-};
diff --git a/support/dktools/dkct-au.c b/support/dktools/dkct-au.c
index 5b1cab728c..f70625bf04 100644
--- a/support/dktools/dkct-au.c
+++ b/support/dktools/dkct-au.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct-au.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct-au.ctr
*/
/** @file dkct-au.c The dkct-au module.
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dkct-au.ctr"
+#include "dk4conf.h"
#if DK3_USE_WX
#include "dkwxtrace.h"
@@ -46,10 +25,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dkct.h"
#endif
+#include "dk3maodd.h"
+#include "dk3unused.h"
+
-#line 20 "dkct-au.ctr"
+
+#line 25 "dkct-au.ctr"
@@ -184,6 +167,16 @@ static char const * const dkct_au_kw8[] = {
/* 75 */ "_step state=%d output=%d\\n\", ((st) ? *st : 0), back);\n",
/* 76 */ " return back;\n",
/* 77 */ " *st = ns;\n",
+/* 78 */ "/**\tStates for state machine ",
+/* 79 */ "/**\tInputs for state machine ",
+/* 80 */ "/**\tOutputs for state machine ",
+/* 81 */ ".\n*/\n",
+/* 82 */ "enum {\n",
+/* 83 */ "\n};\n\n",
+/* 84 */ ",\n\n",
+/* 85 */ "\t*/\n",
+/* 86 */ " = ",
+/* 87 */ "%d",
NULL
};
@@ -194,6 +187,7 @@ NULL
static char const * const dkct_au_option_names[] = {
/* 0 */ "name",
/* 1 */ "write-header",
+/* 2 */ "use-defines",
NULL
};
@@ -262,7 +256,7 @@ dkct_au_entry_delete(DKCT_STM_ENTRY *p)
{
if(p) {
-#line 231 "dkct-au.ctr"
+#line 247 "dkct-au.ctr"
dk3_release(p->name);
dk3_release(p->comment);
p->lineno = 0UL; p->value = 0; p->flag = 0x00;
@@ -281,6 +275,7 @@ dkct_au_entry_delete(DKCT_STM_ENTRY *p)
@param app Application structure for diagnostics, may be NULL.
@return Pointer to new entry on success, NULL on error.
*/
+static
DKCT_STM_ENTRY *
dkct_au_entry_new(
char const *name,
@@ -294,7 +289,7 @@ dkct_au_entry_new(
DKCT_STM_ENTRY *back = NULL;
-#line 261 "dkct-au.ctr"
+#line 278 "dkct-au.ctr"
if(name) {
back = dk3_new_app(DKCT_STM_ENTRY,1,app);
if(back) {
@@ -318,7 +313,7 @@ dkct_au_entry_new(
}
}
-#line 283 "dkct-au.ctr"
+#line 300 "dkct-au.ctr"
return back;
}
@@ -429,12 +424,13 @@ dkct_au_rule_compare(void const *l, void const *r, int cr)
/** Delete rule.
@param rp Rule to delete.
*/
+static
void
dkct_au_rule_delete(DKCT_STM_RULE *rp)
{
if(rp) {
-#line 397 "dkct-au.ctr"
+#line 415 "dkct-au.ctr"
rp->state = NULL;
rp->input = NULL;
rp->newstate = NULL;
@@ -455,6 +451,7 @@ dkct_au_rule_delete(DKCT_STM_RULE *rp)
@param app Application structure for diagnostics, may be NULL.
@return Pointer to new element on success, NULL on error.
*/
+static
DKCT_STM_RULE *
dkct_au_rule_new(
DKCT_STM_ENTRY *os,
@@ -469,7 +466,7 @@ dkct_au_rule_new(
int ok = 1; /* Flag: No errors occured. */
-#line 430 "dkct-au.ctr"
+#line 449 "dkct-au.ctr"
back = dk3_new_app(DKCT_STM_RULE,1,app);
if(back) {
back->state = os;
@@ -483,7 +480,7 @@ dkct_au_rule_new(
}
}
-#line 442 "dkct-au.ctr"
+#line 461 "dkct-au.ctr"
return back;
}
@@ -500,7 +497,7 @@ dkct_au_stm_rules_delete(dk3_sto_t *s, dk3_sto_it_t *i)
DKCT_STM_RULE *r; /* Current rule to delete. */
-#line 457 "dkct-au.ctr"
+#line 476 "dkct-au.ctr"
if(s) {
if(i) {
dk3sto_it_reset(i);
@@ -512,7 +509,7 @@ dkct_au_stm_rules_delete(dk3_sto_t *s, dk3_sto_it_t *i)
dk3sto_close(s);
}
-#line 467 "dkct-au.ctr"
+#line 486 "dkct-au.ctr"
}
@@ -528,7 +525,7 @@ dkct_au_stm_entries_delete(dk3_sto_t *s, dk3_sto_it_t *i)
DKCT_STM_ENTRY *e; /* Current entry to delete. */
-#line 481 "dkct-au.ctr"
+#line 500 "dkct-au.ctr"
if(s) {
if(i) {
dk3sto_it_reset(i);
@@ -540,7 +537,7 @@ dkct_au_stm_entries_delete(dk3_sto_t *s, dk3_sto_it_t *i)
dk3sto_close(s);
}
-#line 491 "dkct-au.ctr"
+#line 510 "dkct-au.ctr"
}
@@ -553,7 +550,7 @@ dkct_au_stm_delete(DKCT_STM *p)
{
-#line 502 "dkct-au.ctr"
+#line 521 "dkct-au.ctr"
if(p) {
dkct_au_stm_rules_delete(p->s_wildcard, p->i_wildcard);
dkct_au_stm_rules_delete(p->s_exact, p->i_exact);
@@ -572,10 +569,11 @@ dkct_au_stm_delete(DKCT_STM *p)
p->ds = NULL;
p->dout = NULL;
p->lngr = 0UL;
+ p->usedef = 0;
dk3_delete(p);
}
-#line 522 "dkct-au.ctr"
+#line 542 "dkct-au.ctr"
}
@@ -592,7 +590,7 @@ dkct_au_stm_new(unsigned long lineno, dk3_app_t *app)
int ok = 0; /* Flag: Successfully initialized. */
-#line 537 "dkct-au.ctr"
+#line 557 "dkct-au.ctr"
back = dk3_new_app(DKCT_STM,1,app);
if(back) {
back->s_wildcard = NULL; back->i_wildcard = NULL;
@@ -609,6 +607,7 @@ dkct_au_stm_new(unsigned long lineno, dk3_app_t *app)
back->dout = NULL;
back->lngr = 0UL;
back->stmno = 0UL;
+ back->usedef = 0;
back->s_states = dk3sto_open_app(app);
back->s_inputs = dk3sto_open_app(app);
back->s_outputs = dk3sto_open_app(app);
@@ -641,7 +640,49 @@ dkct_au_stm_new(unsigned long lineno, dk3_app_t *app)
}
}
-#line 584 "dkct-au.ctr"
+#line 605 "dkct-au.ctr"
+ return back;
+}
+
+
+
+/** Check whether a name is a C identifier.
+ @param nptr Name to check.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+is_c_identifier(const char *nptr)
+{
+ int back = 0;
+ if (NULL != nptr) {
+ if (('a' <= *nptr) && ('z' >= *nptr)) {
+ back = 1;
+ } else {
+ if (('A' <= *nptr) && ('Z' >= *nptr)) {
+ back = 1;
+ } else {
+ if ('_' == *nptr) {
+ back = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ nptr++;
+ while ((0 != back) && ('\0' != *nptr)) {
+ if (('a' > *nptr) || ('z' < *nptr)) {
+ if (('A' > *nptr) || ('Z' < *nptr)) {
+ if (('0' > *nptr) || ('9' < *nptr)) {
+ if ('_' != *nptr) {
+ back = 0;
+ }
+ }
+ }
+ }
+ nptr++;
+ }
+ }
+ }
return back;
}
@@ -657,7 +698,10 @@ dkct_au_stm_new(unsigned long lineno, dk3_app_t *app)
static
int
dkct_au_add_option(
- DKCT_STM *stm, DKCT_SRC *psrc, char *line, unsigned long lineno
+ DKCT_STM *stm,
+ DKCT_SRC *psrc,
+ char *line,
+ unsigned long DK3_SILENCE_ARG_UNUSED(lineno)
)
{
int back = 0;
@@ -666,7 +710,8 @@ dkct_au_add_option(
int ai; /* Array index of option name. */
-#line 607 "dkct-au.ctr"
+#line 673 "dkct-au.ctr"
+ DK3_UNUSED_ARG(lineno)
p1 = dk3str_c8_start(line, NULL);
if(p1) {
p2 = dk3str_c8_chr(p1, '=');
@@ -679,7 +724,7 @@ dkct_au_add_option(
switch(ai) {
case 0: {
-#line 618 "dkct-au.ctr"
+#line 685 "dkct-au.ctr"
if(stm->name) {
/* Warning: Redefinition of name */
dkct_to_log_1(psrc, 1, DK3_LL_WARNING, 28);
@@ -687,7 +732,15 @@ dkct_au_add_option(
}
stm->name = dk3str_c8_dup_app(p2, psrc->app);
if(stm->name) {
- back = 1;
+ if (0 != is_c_identifier(stm->name)) {
+ back = 1;
+ } else {
+ /* ##### ERROR: Not a C identifier */
+ if (DK3_ERROR_NONE == psrc->ec) {
+ psrc->ec = DK3_ERROR_SYNTAX;
+ }
+ dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 122, 123, stm->name);
+ }
} else {
/* ERROR: Memory */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 29);
@@ -695,7 +748,7 @@ dkct_au_add_option(
} break;
case 1: {
-#line 632 "dkct-au.ctr"
+#line 707 "dkct-au.ctr"
if(dk3str_c8_is_bool(p2)) {
stm->wrh = (dk3str_c8_is_on(p2) ? 1 : 0);
back = 1;
@@ -704,6 +757,15 @@ dkct_au_add_option(
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 30);
}
} break;
+ case 2: {
+ if(dk3str_c8_is_bool(p2)) {
+ stm->usedef = (dk3str_c8_is_on(p2) ? 1 : 0);
+ back = 1;
+ } else {
+ /* ERROR: Syntax (not boolean)! */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 30);
+ }
+ } break;
default: {
dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 10, 11, p1);
} break;
@@ -719,7 +781,7 @@ dkct_au_add_option(
}
-#line 654 "dkct-au.ctr"
+#line 738 "dkct-au.ctr"
return back;
}
@@ -759,7 +821,7 @@ dkct_au_add_entry(
int f; /* Flag: Value defined. */
-#line 692 "dkct-au.ctr"
+#line 776 "dkct-au.ctr"
nptr = vptr = NULL;
i = f = 0;
nptr = dk3str_c8_start(line, NULL);
@@ -777,44 +839,52 @@ dkct_au_add_entry(
}
if(back) {
back = 0;
- e = dkct_au_entry_new(
- nptr, co, lineno, i, f, psrc->app
- );
- if(e) {
- ep = (DKCT_STM_ENTRY *)dk3sto_it_find_like(iterator, (void *)e, 0);
- if(ep) {
- /* ERROR: Redefinition */
- dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 32);
- dkct_au_entry_delete(e);
- } else {
- if(dk3sto_add(storage, (void *)e)) {
- back = 1;
- switch(tp) {
- case 0: {
- /*
- First state is reset state.
- */
- if(!(stm->rs)) { stm->rs = e; }
- /*
- First state is general rule next state default.
- */
- if(!(stm->ds)) { stm->ds = e; }
- } break;
- case 2: {
- /*
- First output is general rule output default.
- */
- if(!(stm->dout)) { stm->dout = e; }
- } break;
- }
- } else {
- dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ if (0 != is_c_identifier(nptr)) {
+ e = dkct_au_entry_new(
+ nptr, co, lineno, i, f, psrc->app
+ );
+ if(e) {
+ ep = (DKCT_STM_ENTRY *)dk3sto_it_find_like(iterator, (void *)e, 0);
+ if(ep) {
+ /* ERROR: Redefinition */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 32);
dkct_au_entry_delete(e);
+ } else {
+ if(dk3sto_add(storage, (void *)e)) {
+ back = 1;
+ switch(tp) {
+ case 0: {
+ /*
+ First state is reset state.
+ */
+ if(!(stm->rs)) { stm->rs = e; }
+ /*
+ First state is general rule next state default.
+ */
+ if(!(stm->ds)) { stm->ds = e; }
+ } break;
+ case 2: {
+ /*
+ First output is general rule output default.
+ */
+ if(!(stm->dout)) { stm->dout = e; }
+ } break;
+ }
+ } else {
+ dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ dkct_au_entry_delete(e);
+ }
}
- }
+ } else {
+ /* ERROR Memory */
+ dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ }
} else {
- /* ERROR Memory */
- dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ /* ERROR: Not a C identifier */
+ if (DK3_ERROR_NONE == psrc->ec) {
+ psrc->ec = DK3_ERROR_SYNTAX;
+ }
+ dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 122, 123, nptr);
}
}
} else {
@@ -822,7 +892,7 @@ dkct_au_add_entry(
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 33);
}
-#line 753 "dkct-au.ctr"
+#line 845 "dkct-au.ctr"
return back;
}
@@ -841,16 +911,18 @@ dkct_au_add_entry(
static
DKCT_STM_ENTRY *
dkct_au_find_entry(
- DKCT_SRC *psrc,
- dk3_sto_t *sto,
- dk3_sto_it_t *ist,
- char *name,
- unsigned long lineno,
- int *ok,
- int t
+ DKCT_SRC *psrc,
+ dk3_sto_t *sto,
+ dk3_sto_it_t *ist,
+ char *name,
+ unsigned long lineno,
+ int *ok,
+ int DK3_SILENCE_ARG_UNUSED(t)
)
{
DKCT_STM_ENTRY *back = NULL;
+
+ DK3_UNUSED_ARG(t)
if(dk3str_c8_cmp(dkct_au_kw8[0], name) == 0) {
*ok = 1;
} else {
@@ -886,7 +958,11 @@ dkct_au_find_entry(
static
int
dkct_au_add_rule(
- DKCT_STM *stm, DKCT_SRC *psrc, char *line, char *co, unsigned long lineno
+ DKCT_STM *stm,
+ DKCT_SRC *psrc,
+ char *line,
+ char * DK3_SILENCE_ARG_UNUSED(co),
+ unsigned long lineno
)
{
int back = 0;
@@ -907,7 +983,8 @@ dkct_au_add_rule(
int can_add; /* Flag: Rule ok, add. */
-#line 836 "dkct-au.ctr"
+#line 934 "dkct-au.ctr"
+ DK3_UNUSED_ARG(co)
e1 = e2 = e3 = e4 = NULL; ok1 = ok2 = ok3 = ok4 = 0;
p1 = dk3str_c8_start(line, NULL);
if(p1) {
@@ -1010,7 +1087,7 @@ dkct_au_add_rule(
}
-#line 937 "dkct-au.ctr"
+#line 1036 "dkct-au.ctr"
return back;
}
@@ -1034,21 +1111,21 @@ dkct_au_add_line(
int ai; /* Array index. */
-#line 959 "dkct-au.ctr"
+#line 1058 "dkct-au.ctr"
if((stm) && (line)) {
-#line 960 "dkct-au.ctr"
+#line 1059 "dkct-au.ctr"
lstart = dk3str_c8_start(line, NULL);
if(lstart) {
-#line 962 "dkct-au.ctr"
+#line 1061 "dkct-au.ctr"
pc = NULL;
if(*lstart != '#') {
-#line 964 "dkct-au.ctr"
+#line 1063 "dkct-au.ctr"
if(*lstart == '[') {
-#line 965 "dkct-au.ctr"
+#line 1064 "dkct-au.ctr"
lstart++;
lstart = dk3str_c8_start(lstart, NULL);
if(lstart) {
@@ -1058,11 +1135,11 @@ dkct_au_add_line(
*pc = '\0';
dk3str_c8_chomp(lstart, NULL);
-#line 973 "dkct-au.ctr"
+#line 1072 "dkct-au.ctr"
ai = dk3str_c8_array_index(dkct_au_section_names, lstart, 0);
-#line 975 "dkct-au.ctr"
+#line 1074 "dkct-au.ctr"
switch(ai) {
case 0: case 5: {
stm->section = DKCT_AU_SECTION_OPTIONS; back = 1;
@@ -1092,39 +1169,39 @@ dkct_au_add_line(
}
} else {
-#line 1003 "dkct-au.ctr"
+#line 1102 "dkct-au.ctr"
pc = dk3str_c8_chr(lstart, '#');
if(pc) { *(pc++) = '\0'; pc = dk3str_c8_start(pc, NULL); }
switch(stm->section) {
case DKCT_AU_SECTION_OPTIONS: {
-#line 1007 "dkct-au.ctr"
+#line 1106 "dkct-au.ctr"
back = dkct_au_add_option(stm, psrc, lstart, lineno);
} break;
case DKCT_AU_SECTION_STATES: {
-#line 1010 "dkct-au.ctr"
+#line 1109 "dkct-au.ctr"
back = dkct_au_add_entry(
stm, psrc, lstart, pc, lineno, stm->s_states, stm->i_states, 0
);
} break;
case DKCT_AU_SECTION_INPUTS: {
-#line 1015 "dkct-au.ctr"
+#line 1114 "dkct-au.ctr"
back = dkct_au_add_entry(
stm, psrc, lstart, pc, lineno, stm->s_inputs, stm->i_inputs, 1
);
} break;
case DKCT_AU_SECTION_OUTPUTS: {
-#line 1020 "dkct-au.ctr"
+#line 1119 "dkct-au.ctr"
back = dkct_au_add_entry(
stm, psrc, lstart, pc, lineno, stm->s_outputs, stm->i_outputs, 2
);
} break;
case DKCT_AU_SECTION_RULES: {
-#line 1025 "dkct-au.ctr"
+#line 1124 "dkct-au.ctr"
back = dkct_au_add_rule(stm, psrc, lstart, pc, lineno);
} break;
}
@@ -1137,7 +1214,7 @@ dkct_au_add_line(
}
}
-#line 1036 "dkct-au.ctr"
+#line 1135 "dkct-au.ctr"
return back;
}
@@ -1165,15 +1242,24 @@ dkct_au_stm_entries_check(dk3_sto_it_t *it)
@param psrc Source structure.
@param stm State machine to modify.
@param it Iterator for state/input/output storage.
+ @param tp Storage type (0=states, 1=inputs, 2=outputs).
@return 1 on success, 0 on error.
*/
static
int
-dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
+dkct_au_set_values(
+ DKCT_SRC *psrc,
+ DKCT_STM * DK3_SILENCE_ARG_UNUSED(stm),
+ dk3_sto_it_t *it,
+ int tp
+)
{
+ dkChar buf[32*sizeof(dk3_im_t)];
int back = 1;
DKCT_STM_ENTRY *ep = NULL; /* Current entry to process. */
dk3_bf_t *bf = NULL; /* Bit field, used values. */
+ size_t szbuf = sizeof(buf)/sizeof(dkChar); /* Buf size. */
+ size_t i1; /* Index of first error msg */
int min = 0; /* Minimum value so far. */
int max = 0; /* Maximum value so far. */
int valfound = 0; /* Flag: Values specified. */
@@ -1181,31 +1267,32 @@ dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
int cc = 0; /* Flag: Continue search. */
-#line 1078 "dkct-au.ctr"
+#line 1186 "dkct-au.ctr"
+ DK3_UNUSED_ARG(stm)
dk3sto_it_reset(it);
while((ep = (DKCT_STM_ENTRY *)dk3sto_it_next(it)) != NULL) {
if(ep->flag) {
-#line 1081 "dkct-au.ctr"
+#line 1190 "dkct-au.ctr"
if(valfound) {
-#line 1082 "dkct-au.ctr"
+#line 1191 "dkct-au.ctr"
if(ep->value < min) min = ep->value;
if(ep->value > max) max = ep->value;
} else {
-#line 1085 "dkct-au.ctr"
+#line 1194 "dkct-au.ctr"
min = max = ep->value;
}
valfound = 1;
} else {
-#line 1089 "dkct-au.ctr"
+#line 1198 "dkct-au.ctr"
}
}
if(valfound) {
-#line 1092 "dkct-au.ctr"
+#line 1201 "dkct-au.ctr"
bf = dk3bf_open_app((max - min + 1), psrc->app);
if(bf) {
/*
@@ -1214,6 +1301,25 @@ dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
dk3sto_it_reset(it);
while((ep = (DKCT_STM_ENTRY *)dk3sto_it_next(it)) != NULL) {
if(ep->flag) {
+ if (0 != dk3bf_get(bf, (ep->value - min))) {
+ /* ERROR/WARNING: Already in use */
+ if (0 != dk3ma_im_to_string(buf, szbuf, ep->value)) {
+ i1 = 116;
+ if (DK3_ERROR_NONE == psrc->ec) {
+ psrc->ec = DK3_ERROR_SYNTAX;
+ }
+ switch (tp) {
+ case 2: {
+ i1 = 120;
+ } break;
+ case 1: {
+ i1 = 118;
+ } break;
+ }
+ psrc->lineno = ep->lineno;
+ dkct_to_log_dk_3(psrc, 1, DK3_LL_ERROR, i1, (i1+1), buf);
+ }
+ }
dk3bf_set(bf, (ep->value - min), 1);
}
}
@@ -1226,17 +1332,17 @@ dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
if(!(ep->flag)) {
do {
-#line 1111 "dkct-au.ctr"
+#line 1239 "dkct-au.ctr"
cc = 0;
if((cv >= min) && (cv <= max)) {
if(dk3bf_get(bf, (cv - min))) {
cc = 1;
-#line 1115 "dkct-au.ctr"
+#line 1243 "dkct-au.ctr"
cv++;
if(cv == 0) {
-#line 1117 "dkct-au.ctr"
+#line 1245 "dkct-au.ctr"
cc = 0;
back = 0;
/* ERROR: Overflow */
@@ -1255,11 +1361,11 @@ dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
}
if(cc) {
-#line 1134 "dkct-au.ctr"
+#line 1262 "dkct-au.ctr"
ep->value = cv++;
if(cv == 0) {
-#line 1136 "dkct-au.ctr"
+#line 1264 "dkct-au.ctr"
back = 0;
/* ERROR: Overflow */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 38);
@@ -1270,21 +1376,21 @@ dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
dk3bf_close(bf);
} else {
-#line 1145 "dkct-au.ctr"
+#line 1273 "dkct-au.ctr"
back = 0;
/* ERROR: Memory */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 29);
}
} else {
-#line 1150 "dkct-au.ctr"
+#line 1278 "dkct-au.ctr"
cv = 0;
dk3sto_it_reset(it);
while((ep = (DKCT_STM_ENTRY *)dk3sto_it_next(it)) != NULL) {
ep->value = cv++;
if(cv == 0) {
-#line 1155 "dkct-au.ctr"
+#line 1283 "dkct-au.ctr"
back = 0;
/* ERROR: Overflow */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 38);
@@ -1292,7 +1398,7 @@ dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
}
}
-#line 1161 "dkct-au.ctr"
+#line 1289 "dkct-au.ctr"
return back;
}
@@ -1312,9 +1418,9 @@ dkct_au_stm_check(DKCT_SRC *psrc, DKCT_STM *stm)
ofound = dkct_au_stm_entries_check(stm->i_outputs);
if((sfound) && (ifound) && (ofound)) {
back = 1;
- if(!dkct_au_set_values(psrc, stm, stm->i_states)) { back = 0; }
- if(!dkct_au_set_values(psrc, stm, stm->i_inputs)) { back = 0; }
- if(!dkct_au_set_values(psrc, stm, stm->i_outputs)) { back = 0; }
+ if(!dkct_au_set_values(psrc, stm, stm->i_states, 0)) { back = 0; }
+ if(!dkct_au_set_values(psrc, stm, stm->i_inputs, 1)) { back = 0; }
+ if(!dkct_au_set_values(psrc, stm, stm->i_outputs, 2)) { back = 0; }
} else {
if(!(sfound)) {
/* ERROR: No states declared! */
@@ -1343,12 +1449,16 @@ dkct_au_stm_check(DKCT_SRC *psrc, DKCT_STM *stm)
static
void
dkct_au_write_one_entry(
- DKCT_SRC *psrc, DKCT_STM *stm, DKCT_STM_ENTRY *ep, size_t commi
+ DKCT_SRC *psrc,
+ DKCT_STM * DK3_SILENCE_ARG_UNUSED(stm),
+ DKCT_STM_ENTRY *ep,
+ size_t commi
)
{
-#line 1215 "dkct-au.ctr"
+#line 1346 "dkct-au.ctr"
+ DK3_UNUSED_ARG(stm)
fputs(dkct_au_kw8[3], psrc->fipo);
fputs(ep->name, psrc->fipo);
fputs(dkct_au_kw8[1], psrc->fipo);
@@ -1378,7 +1488,7 @@ dkct_au_write_one_entry(
fputs(dkct_au_kw8[5], psrc->fipo); /* endif */
-#line 1243 "dkct-au.ctr"
+#line 1375 "dkct-au.ctr"
}
@@ -1398,13 +1508,13 @@ dkct_au_write_entry_storage(
DKCT_STM_ENTRY *ep; /* Current entry. */
-#line 1261 "dkct-au.ctr"
+#line 1393 "dkct-au.ctr"
dk3sto_it_reset(it);
while((ep = (DKCT_STM_ENTRY *)dk3sto_it_next(it)) != NULL) {
dkct_au_write_one_entry(psrc, stm, ep, commi);
}
-#line 1265 "dkct-au.ctr"
+#line 1397 "dkct-au.ctr"
}
@@ -1426,6 +1536,75 @@ dkct_au_write_stm_name(DKCT_SRC *psrc, DKCT_STM *stm)
+/** Write one storage to output.
+ @param psrc Source structure.
+ @param stm State machine.
+ @param it Storage iterator containing items to write.
+ @param stri1 First string index.
+ @param stri2 Second string index.
+*/
+static
+void
+dkct_au_write_enum_entry_storage(
+ DKCT_SRC *psrc,
+ DKCT_STM *stm,
+ dk3_sto_it_t *it,
+ size_t stri1,
+ size_t stri2
+)
+{
+ DKCT_STM_ENTRY *ep; /* Current entry. */
+ int had_item = 0;
+
+
+
+#line 1439 "dkct-au.ctr"
+ /* Doxygen comment */
+ fputs(dkct_au_kw8[stri2], psrc->fipo);
+ if (NULL != stm->name) {
+ fputs(stm->name, psrc->fipo);
+ }
+ fputs(dkct_au_kw8[81], psrc->fipo);
+ /* enum { */
+ fputs(dkct_au_kw8[82], psrc->fipo);
+ dk3sto_it_reset(it);
+ while(NULL != (ep = (DKCT_STM_ENTRY *)dk3sto_it_next(it))) {
+ if (0 != had_item) {
+ /* , and newline */
+ fputs(dkct_au_kw8[84], psrc->fipo);
+ }
+ /* Doxygen comment */
+ fputc('\t', psrc->fipo);
+ fputs(dkct_au_kw8[11], psrc->fipo);
+ fputs(dkct_au_kw8[stri1], psrc->fipo);
+ if (NULL != ep->comment) {
+ fputs(ep->comment, psrc->fipo);
+ } else {
+ fputs(ep->name, psrc->fipo);
+ }
+ fputs(dkct_au_kw8[1], psrc->fipo);
+ fputs(dkct_au_kw8[85], psrc->fipo);
+ /* Line number if required */
+ if((psrc->dkcto).lnn) {
+ psrc->lineno = ep->lineno;
+ dkct_tr_show_source_line(psrc, 0);
+ }
+ /* Name = Wert */
+ fputc('\t', psrc->fipo);
+ fputs(ep->name, psrc->fipo);
+ fputs(dkct_au_kw8[86], psrc->fipo);
+ fprintf(psrc->fipo, dkct_au_kw8[87], ep->value);
+ had_item = 1;
+ }
+ /* newlines }; */
+ fputs(dkct_au_kw8[83], psrc->fipo);
+
+
+#line 1479 "dkct-au.ctr"
+}
+
+
+
/** Write state/input/output entry definitions.
@param psrc Source structure.
@param stm State machine.
@@ -1433,24 +1612,36 @@ dkct_au_write_stm_name(DKCT_SRC *psrc, DKCT_STM *stm)
void
dkct_au_write_entries(DKCT_SRC *psrc, DKCT_STM *stm)
{
- /*
- Begin doxygen group
- */
- fputs(dkct_au_kw8[17], psrc->fipo);
- dkct_au_write_stm_name(psrc, stm);
- fputs(dkct_au_kw8[18], psrc->fipo);
- dkct_au_write_stm_name(psrc, stm);
- fputs(dkct_au_kw8[19], psrc->fipo);
- /*
- Write the entries
- */
- dkct_au_write_entry_storage(psrc, stm, stm->i_states, 13);
- dkct_au_write_entry_storage(psrc, stm, stm->i_inputs, 14);
- dkct_au_write_entry_storage(psrc, stm, stm->i_outputs, 15);
- /*
- End doxygen group
- */
- fputs(dkct_au_kw8[20], psrc->fipo);
+ if (0 != stm->usedef) {
+ /*
+ Begin doxygen group
+ */
+ fputs(dkct_au_kw8[17], psrc->fipo);
+ dkct_au_write_stm_name(psrc, stm);
+ fputs(dkct_au_kw8[18], psrc->fipo);
+ dkct_au_write_stm_name(psrc, stm);
+ fputs(dkct_au_kw8[19], psrc->fipo);
+ /*
+ Write the entries
+ */
+ dkct_au_write_entry_storage(psrc, stm, stm->i_states, 13);
+ dkct_au_write_entry_storage(psrc, stm, stm->i_inputs, 14);
+ dkct_au_write_entry_storage(psrc, stm, stm->i_outputs, 15);
+ /*
+ End doxygen group
+ */
+ fputs(dkct_au_kw8[20], psrc->fipo);
+ } else {
+ dkct_au_write_enum_entry_storage(
+ psrc, stm, stm->i_states, 13, 78
+ );
+ dkct_au_write_enum_entry_storage(
+ psrc, stm, stm->i_inputs, 14, 79
+ );
+ dkct_au_write_enum_entry_storage(
+ psrc, stm, stm->i_outputs, 15, 80
+ );
+ }
}
diff --git a/support/dktools/dkct-au.ctr b/support/dktools/dkct-au.ctr
index 45046c9c5e..6f83c9f24b 100644
--- a/support/dktools/dkct-au.ctr
+++ b/support/dktools/dkct-au.ctr
@@ -2,12 +2,13 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
#if DK3_USE_WX
#include "dkwxtrace.h"
@@ -15,6 +16,10 @@ license = bsd
#include "dkct.h"
#endif
+#include "dk3maodd.h"
+#include "dk3unused.h"
+
+
$!trace-include
@@ -151,6 +156,16 @@ static char const * const dkct_au_kw8[] = {
/* 75 */ "_step state=%d output=%d\\n\", ((st) ? *st : 0), back);\n",
/* 76 */ " return back;\n",
/* 77 */ " *st = ns;\n",
+/* 78 */ "/**\tStates for state machine ",
+/* 79 */ "/**\tInputs for state machine ",
+/* 80 */ "/**\tOutputs for state machine ",
+/* 81 */ ".\n*/\n",
+/* 82 */ "enum {\n",
+/* 83 */ "\n};\n\n",
+/* 84 */ ",\n\n",
+/* 85 */ "\t*/\n",
+/* 86 */ " = ",
+/* 87 */ "%d",
NULL
};
@@ -161,6 +176,7 @@ NULL
static char const * const dkct_au_option_names[] = {
/* 0 */ "name",
/* 1 */ "write-header",
+/* 2 */ "use-defines",
NULL
};
@@ -246,6 +262,7 @@ dkct_au_entry_delete(DKCT_STM_ENTRY *p)
@param app Application structure for diagnostics, may be NULL.
@return Pointer to new entry on success, NULL on error.
*/
+static
DKCT_STM_ENTRY *
dkct_au_entry_new(
char const *name,
@@ -390,6 +407,7 @@ dkct_au_rule_compare(void const *l, void const *r, int cr)
/** Delete rule.
@param rp Rule to delete.
*/
+static
void
dkct_au_rule_delete(DKCT_STM_RULE *rp)
{
@@ -414,6 +432,7 @@ dkct_au_rule_delete(DKCT_STM_RULE *rp)
@param app Application structure for diagnostics, may be NULL.
@return Pointer to new element on success, NULL on error.
*/
+static
DKCT_STM_RULE *
dkct_au_rule_new(
DKCT_STM_ENTRY *os,
@@ -517,6 +536,7 @@ dkct_au_stm_delete(DKCT_STM *p)
p->ds = NULL;
p->dout = NULL;
p->lngr = 0UL;
+ p->usedef = 0;
dk3_delete(p);
} $? "- dkct_au_stm_delete"
}
@@ -550,6 +570,7 @@ dkct_au_stm_new(unsigned long lineno, dk3_app_t *app)
back->dout = NULL;
back->lngr = 0UL;
back->stmno = 0UL;
+ back->usedef = 0;
back->s_states = dk3sto_open_app(app);
back->s_inputs = dk3sto_open_app(app);
back->s_outputs = dk3sto_open_app(app);
@@ -586,6 +607,48 @@ dkct_au_stm_new(unsigned long lineno, dk3_app_t *app)
+/** Check whether a name is a C identifier.
+ @param nptr Name to check.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+is_c_identifier(const char *nptr)
+{
+ int back = 0;
+ if (NULL != nptr) {
+ if (('a' <= *nptr) && ('z' >= *nptr)) {
+ back = 1;
+ } else {
+ if (('A' <= *nptr) && ('Z' >= *nptr)) {
+ back = 1;
+ } else {
+ if ('_' == *nptr) {
+ back = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ nptr++;
+ while ((0 != back) && ('\0' != *nptr)) {
+ if (('a' > *nptr) || ('z' < *nptr)) {
+ if (('A' > *nptr) || ('Z' < *nptr)) {
+ if (('0' > *nptr) || ('9' < *nptr)) {
+ if ('_' != *nptr) {
+ back = 0;
+ }
+ }
+ }
+ }
+ nptr++;
+ }
+ }
+ }
+ return back;
+}
+
+
+
/** Process one option line.
@param stm State machine description.
@param psrc Source structure.
@@ -596,7 +659,10 @@ dkct_au_stm_new(unsigned long lineno, dk3_app_t *app)
static
int
dkct_au_add_option(
- DKCT_STM *stm, DKCT_SRC *psrc, char *line, unsigned long lineno
+ DKCT_STM *stm,
+ DKCT_SRC *psrc,
+ char *line,
+ unsigned long DK3_SILENCE_ARG_UNUSED(lineno)
)
{
int back = 0;
@@ -604,6 +670,7 @@ dkct_au_add_option(
char *p2; /* Value. */
int ai; /* Array index of option name. */
$? "+ dkct_au_add_option %lu \"%!8s\"", lineno, TR_8STR(line)
+ DK3_UNUSED_ARG(lineno)
p1 = dk3str_c8_start(line, NULL);
if(p1) {
p2 = dk3str_c8_chr(p1, '=');
@@ -622,7 +689,15 @@ dkct_au_add_option(
}
stm->name = dk3str_c8_dup_app(p2, psrc->app);
if(stm->name) {
- back = 1;
+ if (0 != is_c_identifier(stm->name)) {
+ back = 1;
+ } else {
+ /* ##### ERROR: Not a C identifier */
+ if (DK3_ERROR_NONE == psrc->ec) {
+ psrc->ec = DK3_ERROR_SYNTAX;
+ }
+ dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 122, 123, stm->name);
+ }
} else {
/* ERROR: Memory */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 29);
@@ -637,6 +712,15 @@ dkct_au_add_option(
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 30);
}
} break;
+ case 2: {
+ if(dk3str_c8_is_bool(p2)) {
+ stm->usedef = (dk3str_c8_is_on(p2) ? 1 : 0);
+ back = 1;
+ } else {
+ /* ERROR: Syntax (not boolean)! */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 30);
+ }
+ } break;
default: {
dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 10, 11, p1);
} break;
@@ -706,44 +790,52 @@ dkct_au_add_entry(
}
if(back) {
back = 0;
- e = dkct_au_entry_new(
- nptr, co, lineno, i, f, psrc->app
- );
- if(e) {
- ep = (DKCT_STM_ENTRY *)dk3sto_it_find_like(iterator, (void *)e, 0);
- if(ep) {
- /* ERROR: Redefinition */
- dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 32);
- dkct_au_entry_delete(e);
- } else {
- if(dk3sto_add(storage, (void *)e)) {
- back = 1;
- switch(tp) {
- case 0: {
- /*
- First state is reset state.
- */
- if(!(stm->rs)) { stm->rs = e; }
- /*
- First state is general rule next state default.
- */
- if(!(stm->ds)) { stm->ds = e; }
- } break;
- case 2: {
- /*
- First output is general rule output default.
- */
- if(!(stm->dout)) { stm->dout = e; }
- } break;
- }
- } else {
- dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ if (0 != is_c_identifier(nptr)) {
+ e = dkct_au_entry_new(
+ nptr, co, lineno, i, f, psrc->app
+ );
+ if(e) {
+ ep = (DKCT_STM_ENTRY *)dk3sto_it_find_like(iterator, (void *)e, 0);
+ if(ep) {
+ /* ERROR: Redefinition */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 32);
dkct_au_entry_delete(e);
+ } else {
+ if(dk3sto_add(storage, (void *)e)) {
+ back = 1;
+ switch(tp) {
+ case 0: {
+ /*
+ First state is reset state.
+ */
+ if(!(stm->rs)) { stm->rs = e; }
+ /*
+ First state is general rule next state default.
+ */
+ if(!(stm->ds)) { stm->ds = e; }
+ } break;
+ case 2: {
+ /*
+ First output is general rule output default.
+ */
+ if(!(stm->dout)) { stm->dout = e; }
+ } break;
+ }
+ } else {
+ dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ dkct_au_entry_delete(e);
+ }
}
- }
+ } else {
+ /* ERROR Memory */
+ dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ }
} else {
- /* ERROR Memory */
- dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ /* ERROR: Not a C identifier */
+ if (DK3_ERROR_NONE == psrc->ec) {
+ psrc->ec = DK3_ERROR_SYNTAX;
+ }
+ dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 122, 123, nptr);
}
}
} else {
@@ -768,16 +860,18 @@ dkct_au_add_entry(
static
DKCT_STM_ENTRY *
dkct_au_find_entry(
- DKCT_SRC *psrc,
- dk3_sto_t *sto,
- dk3_sto_it_t *ist,
- char *name,
- unsigned long lineno,
- int *ok,
- int t
+ DKCT_SRC *psrc,
+ dk3_sto_t *sto,
+ dk3_sto_it_t *ist,
+ char *name,
+ unsigned long lineno,
+ int *ok,
+ int DK3_SILENCE_ARG_UNUSED(t)
)
{
DKCT_STM_ENTRY *back = NULL;
+
+ DK3_UNUSED_ARG(t)
if(dk3str_c8_cmp(dkct_au_kw8[0], name) == 0) {
*ok = 1;
} else {
@@ -813,7 +907,11 @@ dkct_au_find_entry(
static
int
dkct_au_add_rule(
- DKCT_STM *stm, DKCT_SRC *psrc, char *line, char *co, unsigned long lineno
+ DKCT_STM *stm,
+ DKCT_SRC *psrc,
+ char *line,
+ char * DK3_SILENCE_ARG_UNUSED(co),
+ unsigned long lineno
)
{
int back = 0;
@@ -833,6 +931,7 @@ dkct_au_add_rule(
int ok4; /* Flag: Output *. */
int can_add; /* Flag: Rule ok, add. */
$? "+ dkct_au_add_rule %lu \"%!8s\" \"%!8s\"", lineno, TR_8STR(line), TR_8STR(co)
+ DK3_UNUSED_ARG(co)
e1 = e2 = e3 = e4 = NULL; ok1 = ok2 = ok3 = ok4 = 0;
p1 = dk3str_c8_start(line, NULL);
if(p1) {
@@ -1060,21 +1159,31 @@ dkct_au_stm_entries_check(dk3_sto_it_t *it)
@param psrc Source structure.
@param stm State machine to modify.
@param it Iterator for state/input/output storage.
+ @param tp Storage type (0=states, 1=inputs, 2=outputs).
@return 1 on success, 0 on error.
*/
static
int
-dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
+dkct_au_set_values(
+ DKCT_SRC *psrc,
+ DKCT_STM * DK3_SILENCE_ARG_UNUSED(stm),
+ dk3_sto_it_t *it,
+ int tp
+)
{
+ dkChar buf[32*sizeof(dk3_im_t)];
int back = 1;
DKCT_STM_ENTRY *ep = NULL; /* Current entry to process. */
dk3_bf_t *bf = NULL; /* Bit field, used values. */
+ size_t szbuf = sizeof(buf)/sizeof(dkChar); /* Buf size. */
+ size_t i1; /* Index of first error msg */
int min = 0; /* Minimum value so far. */
int max = 0; /* Maximum value so far. */
int valfound = 0; /* Flag: Values specified. */
int cv = 0; /* Current value. */
int cc = 0; /* Flag: Continue search. */
$? "+ dkct_au_set_values"
+ DK3_UNUSED_ARG(stm)
dk3sto_it_reset(it);
while((ep = (DKCT_STM_ENTRY *)dk3sto_it_next(it)) != NULL) {
if(ep->flag) { $? ". have value %d", ep->value
@@ -1097,6 +1206,25 @@ dkct_au_set_values(DKCT_SRC *psrc, DKCT_STM *stm, dk3_sto_it_t *it)
dk3sto_it_reset(it);
while((ep = (DKCT_STM_ENTRY *)dk3sto_it_next(it)) != NULL) {
if(ep->flag) {
+ if (0 != dk3bf_get(bf, (ep->value - min))) {
+ /* ERROR/WARNING: Already in use */
+ if (0 != dk3ma_im_to_string(buf, szbuf, ep->value)) {
+ i1 = 116;
+ if (DK3_ERROR_NONE == psrc->ec) {
+ psrc->ec = DK3_ERROR_SYNTAX;
+ }
+ switch (tp) {
+ case 2: {
+ i1 = 120;
+ } break;
+ case 1: {
+ i1 = 118;
+ } break;
+ }
+ psrc->lineno = ep->lineno;
+ dkct_to_log_dk_3(psrc, 1, DK3_LL_ERROR, i1, (i1+1), buf);
+ }
+ }
dk3bf_set(bf, (ep->value - min), 1);
}
}
@@ -1177,9 +1305,9 @@ dkct_au_stm_check(DKCT_SRC *psrc, DKCT_STM *stm)
ofound = dkct_au_stm_entries_check(stm->i_outputs);
if((sfound) && (ifound) && (ofound)) {
back = 1;
- if(!dkct_au_set_values(psrc, stm, stm->i_states)) { back = 0; }
- if(!dkct_au_set_values(psrc, stm, stm->i_inputs)) { back = 0; }
- if(!dkct_au_set_values(psrc, stm, stm->i_outputs)) { back = 0; }
+ if(!dkct_au_set_values(psrc, stm, stm->i_states, 0)) { back = 0; }
+ if(!dkct_au_set_values(psrc, stm, stm->i_inputs, 1)) { back = 0; }
+ if(!dkct_au_set_values(psrc, stm, stm->i_outputs, 2)) { back = 0; }
} else {
if(!(sfound)) {
/* ERROR: No states declared! */
@@ -1208,10 +1336,14 @@ dkct_au_stm_check(DKCT_SRC *psrc, DKCT_STM *stm)
static
void
dkct_au_write_one_entry(
- DKCT_SRC *psrc, DKCT_STM *stm, DKCT_STM_ENTRY *ep, size_t commi
+ DKCT_SRC *psrc,
+ DKCT_STM * DK3_SILENCE_ARG_UNUSED(stm),
+ DKCT_STM_ENTRY *ep,
+ size_t commi
)
{
$? "+ dkct_au_write_one_entry"
+ DK3_UNUSED_ARG(stm)
fputs(dkct_au_kw8[3], psrc->fipo);
fputs(ep->name, psrc->fipo);
fputs(dkct_au_kw8[1], psrc->fipo);
@@ -1283,6 +1415,71 @@ dkct_au_write_stm_name(DKCT_SRC *psrc, DKCT_STM *stm)
+/** Write one storage to output.
+ @param psrc Source structure.
+ @param stm State machine.
+ @param it Storage iterator containing items to write.
+ @param stri1 First string index.
+ @param stri2 Second string index.
+*/
+static
+void
+dkct_au_write_enum_entry_storage(
+ DKCT_SRC *psrc,
+ DKCT_STM *stm,
+ dk3_sto_it_t *it,
+ size_t stri1,
+ size_t stri2
+)
+{
+ DKCT_STM_ENTRY *ep; /* Current entry. */
+ int had_item = 0;
+
+ $? "+ dkct_au_write_enum_entry_storage"
+ /* Doxygen comment */
+ fputs(dkct_au_kw8[stri2], psrc->fipo);
+ if (NULL != stm->name) {
+ fputs(stm->name, psrc->fipo);
+ }
+ fputs(dkct_au_kw8[81], psrc->fipo);
+ /* enum { */
+ fputs(dkct_au_kw8[82], psrc->fipo);
+ dk3sto_it_reset(it);
+ while(NULL != (ep = (DKCT_STM_ENTRY *)dk3sto_it_next(it))) {
+ if (0 != had_item) {
+ /* , and newline */
+ fputs(dkct_au_kw8[84], psrc->fipo);
+ }
+ /* Doxygen comment */
+ fputc('\t', psrc->fipo);
+ fputs(dkct_au_kw8[11], psrc->fipo);
+ fputs(dkct_au_kw8[stri1], psrc->fipo);
+ if (NULL != ep->comment) {
+ fputs(ep->comment, psrc->fipo);
+ } else {
+ fputs(ep->name, psrc->fipo);
+ }
+ fputs(dkct_au_kw8[1], psrc->fipo);
+ fputs(dkct_au_kw8[85], psrc->fipo);
+ /* Line number if required */
+ if((psrc->dkcto).lnn) {
+ psrc->lineno = ep->lineno;
+ dkct_tr_show_source_line(psrc, 0);
+ }
+ /* Name = Wert */
+ fputc('\t', psrc->fipo);
+ fputs(ep->name, psrc->fipo);
+ fputs(dkct_au_kw8[86], psrc->fipo);
+ fprintf(psrc->fipo, dkct_au_kw8[87], ep->value);
+ had_item = 1;
+ }
+ /* newlines }; */
+ fputs(dkct_au_kw8[83], psrc->fipo);
+ $? "- dkct_au_write_enum_entry_storage"
+}
+
+
+
/** Write state/input/output entry definitions.
@param psrc Source structure.
@param stm State machine.
@@ -1290,24 +1487,36 @@ dkct_au_write_stm_name(DKCT_SRC *psrc, DKCT_STM *stm)
void
dkct_au_write_entries(DKCT_SRC *psrc, DKCT_STM *stm)
{
- /*
- Begin doxygen group
- */
- fputs(dkct_au_kw8[17], psrc->fipo);
- dkct_au_write_stm_name(psrc, stm);
- fputs(dkct_au_kw8[18], psrc->fipo);
- dkct_au_write_stm_name(psrc, stm);
- fputs(dkct_au_kw8[19], psrc->fipo);
- /*
- Write the entries
- */
- dkct_au_write_entry_storage(psrc, stm, stm->i_states, 13);
- dkct_au_write_entry_storage(psrc, stm, stm->i_inputs, 14);
- dkct_au_write_entry_storage(psrc, stm, stm->i_outputs, 15);
- /*
- End doxygen group
- */
- fputs(dkct_au_kw8[20], psrc->fipo);
+ if (0 != stm->usedef) {
+ /*
+ Begin doxygen group
+ */
+ fputs(dkct_au_kw8[17], psrc->fipo);
+ dkct_au_write_stm_name(psrc, stm);
+ fputs(dkct_au_kw8[18], psrc->fipo);
+ dkct_au_write_stm_name(psrc, stm);
+ fputs(dkct_au_kw8[19], psrc->fipo);
+ /*
+ Write the entries
+ */
+ dkct_au_write_entry_storage(psrc, stm, stm->i_states, 13);
+ dkct_au_write_entry_storage(psrc, stm, stm->i_inputs, 14);
+ dkct_au_write_entry_storage(psrc, stm, stm->i_outputs, 15);
+ /*
+ End doxygen group
+ */
+ fputs(dkct_au_kw8[20], psrc->fipo);
+ } else {
+ dkct_au_write_enum_entry_storage(
+ psrc, stm, stm->i_states, 13, 78
+ );
+ dkct_au_write_enum_entry_storage(
+ psrc, stm, stm->i_inputs, 14, 79
+ );
+ dkct_au_write_enum_entry_storage(
+ psrc, stm, stm->i_outputs, 15, 80
+ );
+ }
}
diff --git a/support/dktools/dkct-gui.c b/support/dktools/dkct-gui.c
index df75933777..2267fc82f2 100644
--- a/support/dktools/dkct-gui.c
+++ b/support/dktools/dkct-gui.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct-gui.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct-gui.ctr
*/
/** @file dkct-gui.c The dkct-gui module.
@@ -39,15 +17,21 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 594 "dkct-gui.ctr"
+#include "dk4conf.h"
+
#if DK3_USE_WX
#include "dkwxtrace.h"
#else
#include "dkct.h"
#endif
+#include "dk3unused.h"
+
+
-#line 602 "dkct-gui.ctr"
+
+#line 608 "dkct-gui.ctr"
@@ -96,6 +80,12 @@ static char const * const dkct_gui_class_names[] = {
/* 39 */ "wxStatusBar",
/* 40 */ "wxToolBarToolBase", /* Not a wxWidgets class! */
/* 41 */ "wxGrid",
+/* 42 */ "wxChoicebook",
+/* 43 */ "wxListbook",
+/* 44 */ "wxSimplebook",
+/* 45 */ "wxToolbook",
+/* 46 */ "wxTreebook",
+/* 47 */ "wxScrolled<wxPanel>",
NULL
};
@@ -620,6 +610,15 @@ char const * const dkct_gui_out_kw[] = {
/* 217 */ "->SetColLabelSize(wxGRID_AUTOSIZE",
/* 218 */ "if(",
/* 219 */ ") { ",
+/* 220 */ "->AddPage(",
+/* 221 */ "wxCHB_TOP",
+/* 222 */ "wxLB_TOP",
+/* 223 */ "wxCHB_LEFT",
+/* 224 */ "wxLB_LEFT",
+/* 225 */ "wxCHB_RIGHT",
+/* 226 */ "wxLB_RIGHT",
+/* 227 */ "wxCHB_BOTTOM",
+/* 228 */ "wxLB_BOTTOM",
NULL
};
@@ -636,6 +635,233 @@ NULL
+/** IDs for stock buttons and menu items.
+*/
+static char const * const dkct_gui_stock_item_names[] = {
+/* 0 */
+"wxID_ABOUT",
+
+/* 1 */
+"wxID_ADD",
+
+/* 2 */
+"wxID_APPLY",
+
+/* 3 */
+"wxID_BACKWARD",
+
+/* 4 */
+"wxID_BOLD",
+
+/* 5 */
+"wxID_BOTTOM",
+
+/* 6 */
+"wxID_CANCEL",
+
+/* 7 */
+"wxID_CDROM",
+
+/* 8 */
+"wxID_CLEAR",
+
+/* 9 */
+"wxID_CLOSE",
+
+/* 10 */
+"wxID_CONVERT",
+
+/* 11 */
+"wxID_COPY",
+
+/* 12 */
+"wxID_CUT",
+
+/* 13 */
+"wxID_DELETE",
+
+/* 14 */
+"wxID_DOWN",
+
+/* 15 */
+"wxID_EDIT",
+
+/* 16 */
+"wxID_EXECUTE",
+
+/* 17 */
+"wxID_EXIT",
+
+/* 18 */
+"wxID_FILE",
+
+/* 19 */
+"wxID_FIND",
+
+/* 20 */
+"wxID_FIRST",
+
+/* 21 */
+"wxID_FLOPPY",
+
+/* 22 */
+"wxID_FORWARD",
+
+/* 23 */
+"wxID_HARDDISK",
+
+/* 24 */
+"wxID_HELP",
+
+/* 25 */
+"wxID_HOME",
+
+/* 26 */
+"wxID_INDENT",
+
+/* 27 */
+"wxID_INDEX",
+
+/* 28 */
+"wxID_INFO",
+
+/* 29 */
+"wxID_ITALIC",
+
+/* 30 */
+"wxID_JUMP_TO \t",
+
+/* 31 */
+"wxID_JUSTIFY_CENTER \t",
+
+/* 32 */
+"wxID_JUSTIFY_FILL",
+
+/* 33 */
+"wxID_JUSTIFY_LEFT \t",
+
+/* 34 */
+"wxID_JUSTIFY_RIGHT",
+
+/* 35 */
+"wxID_LAST",
+
+/* 36 */
+"wxID_NETWORK \t",
+
+/* 37 */
+"wxID_NEW",
+
+/* 38 */
+"wxID_NO",
+
+/* 39 */
+"wxID_OK",
+
+/* 40 */
+"wxID_OPEN",
+
+/* 41 */
+"wxID_PASTE",
+
+/* 42 */
+"wxID_PREFERENCES",
+
+/* 43 */
+"wxID_PREVIEW",
+
+/* 44 */
+"wxID_PRINT",
+
+/* 45 */
+"wxID_PROPERTIES",
+
+/* 46 */
+"wxID_REDO",
+
+/* 47 */
+"wxID_REFRESH",
+
+/* 48 */
+"wxID_REMOVE",
+
+/* 49 */
+"wxID_REPLACE",
+
+/* 50 */
+"wxID_REVERT_TO_SAVED",
+
+/* 51 */
+"wxID_SAVE",
+
+/* 52 */
+"wxID_SAVEAS",
+
+/* 53 */
+"wxID_SELECTALL",
+
+/* 54 */
+"wxID_SELECT_COLOR",
+
+/* 55 */
+"wxID_SELECT_FONT",
+
+/* 56 */
+"wxID_SORT_ASCENDING \t",
+
+/* 57 */
+"wxID_SORT_DESCENDING",
+
+/* 58 */
+"wxID_SPELL_CHECK",
+
+/* 59 */
+"wxID_STOP",
+
+/* 60 */
+"wxID_STRIKETHROUGH",
+
+/* 61 */
+"wxID_TOP",
+
+/* 62 */
+"wxID_UNDELETE",
+
+/* 63 */
+"wxID_UNDERLINE",
+
+/* 64 */
+"wxID_UNDO",
+
+/* 65 */
+"wxID_UNINDENT",
+
+/* 66 */
+"wxID_UP",
+
+/* 67 */
+"wxID_YES",
+
+/* 68 */
+"wxID_ZOOM_100",
+
+/* 69 */
+"wxID_ZOOM_FIT",
+
+/* 70 */
+"wxID_ZOOM_IN",
+
+/* 71 */
+"wxID_ZOOM_OUT",
+
+NULL
+
+
+#line 1288 "dkct-gui.ctr"
+};
+
+
+
/** Delete grid header data.
@param gh Header data to delete.
*/
@@ -712,12 +938,13 @@ dkct_grid_cell_new(char const *txt, int r, int c, DKCT_SRC *psrc)
static
int
-dkct_grid_cell_compare(const void *l, const void *r, int cr)
+dkct_grid_cell_compare(const void *l, const void *r, int DK3_ARG_UNUSED(cr) )
{
DKCT_CELL_DATA *pl;
DKCT_CELL_DATA *pr;
int back = 0;
+ DK3_UNUSED_ARG(cr)
if (l) {
if (r) {
pl = (DKCT_CELL_DATA *)l;
@@ -753,11 +980,13 @@ dkct_grid_cell_compare(const void *l, const void *r, int cr)
*/
static
int
-dkct_grid_head_compare(void const *l, void const *r, int cr)
+dkct_grid_head_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
DKCT_GRID_HEAD const *pl;
DKCT_GRID_HEAD const *pr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (DKCT_GRID_HEAD const *)l; pr = (DKCT_GRID_HEAD const *)r;
@@ -918,7 +1147,7 @@ dkct_gui_elem_delete(DKCT_GUI_ELEMENT *elp)
{
-#line 1471 "dkct-gui.ctr"
+#line 1576 "dkct-gui.ctr"
if(elp) {
dkct_remove_grid_cell_data(elp->sCellData, elp->iCellData);
elp->sCellData = NULL; elp->iCellData = NULL;
@@ -956,22 +1185,22 @@ dkct_gui_elem_delete(DKCT_GUI_ELEMENT *elp)
elp->parent = NULL;
-#line 1507 "dkct-gui.ctr"
+#line 1612 "dkct-gui.ctr"
elp->number = 0;
-#line 1509 "dkct-gui.ctr"
+#line 1614 "dkct-gui.ctr"
elp->lndef = 0UL;
-#line 1511 "dkct-gui.ctr"
+#line 1616 "dkct-gui.ctr"
elp->lndecl = 0UL;
elp->cln = 0;
elp->align = 0x00;
dk3_delete(elp);
}
-#line 1516 "dkct-gui.ctr"
+#line 1621 "dkct-gui.ctr"
}
@@ -999,7 +1228,7 @@ dkct_gui_elem_new(
int ok = 0; /* Flag: OK so far. */
-#line 1542 "dkct-gui.ctr"
+#line 1647 "dkct-gui.ctr"
back = dk3_new_app(DKCT_GUI_ELEMENT,1,psrc->app);
if(back) {
/*
@@ -1120,12 +1349,12 @@ dkct_gui_elem_new(
back->number = number;
if(!(ok)) {
-#line 1661 "dkct-gui.ctr"
+#line 1766 "dkct-gui.ctr"
dkct_gui_elem_delete(back); back = NULL;
}
}
-#line 1664 "dkct-gui.ctr"
+#line 1769 "dkct-gui.ctr"
return back;
}
@@ -1186,7 +1415,7 @@ dkct_gui_new(DKCT_SRC *psrc)
DKCT_GUI_ELEMENT *el; /* New element. */
-#line 1723 "dkct-gui.ctr"
+#line 1828 "dkct-gui.ctr"
back = dk3_new_app(DKCT_GUI,1,psrc->app);
if(back) {
/*
@@ -1236,7 +1465,7 @@ dkct_gui_new(DKCT_SRC *psrc)
}
}
-#line 1771 "dkct-gui.ctr"
+#line 1876 "dkct-gui.ctr"
return back;
}
@@ -1248,7 +1477,7 @@ dkct_gui_delete(DKCT_GUI *pg)
DKCT_GUI_ELEMENT *el; /* Current element to process. */
-#line 1781 "dkct-gui.ctr"
+#line 1886 "dkct-gui.ctr"
if(pg) {
pg->psrc = NULL;
pg->c_el = NULL;
@@ -1278,7 +1507,7 @@ dkct_gui_delete(DKCT_GUI *pg)
dk3_delete(pg);
}
-#line 1809 "dkct-gui.ctr"
+#line 1914 "dkct-gui.ctr"
}
@@ -1291,7 +1520,7 @@ void
dkct_gui_initialize_object_for_class(DKCT_GUI_ELEMENT *el)
{
switch(el->cln) {
- case 13: {
+ case 13: case 47: {
el->direction = DKCT_GUI_DIRECTION_BOTH;
} break;
}
@@ -1313,7 +1542,7 @@ dkct_gui_start_new_object_definition(DKCT_GUI *gui, char *il)
DKCT_GUI_ELEMENT *elp; /* Element to process. */
-#line 1842 "dkct-gui.ctr"
+#line 1947 "dkct-gui.ctr"
gui->c_el = NULL;
p2 = dk3str_c8_rchr(il, ']');
if(p2) {
@@ -1369,7 +1598,7 @@ dkct_gui_start_new_object_definition(DKCT_GUI *gui, char *il)
}
-#line 1896 "dkct-gui.ctr"
+#line 2001 "dkct-gui.ctr"
return back;
}
@@ -1388,12 +1617,12 @@ dkct_gui_set_menu_bar(DKCT_GUI *gui, char *il)
DKCT_GUI_ELEMENT *elp; /* Element to modify. */
-#line 1913 "dkct-gui.ctr"
+#line 2018 "dkct-gui.ctr"
if(gui->c_el) {
if(((gui->c_el)->number != 0) && (!((gui->c_el)->parent))) {
-#line 1916 "dkct-gui.ctr"
+#line 2021 "dkct-gui.ctr"
/* Warning: Attribute applicable to root element only! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 55);
}
@@ -1420,7 +1649,7 @@ dkct_gui_set_menu_bar(DKCT_GUI *gui, char *il)
}
}
-#line 1941 "dkct-gui.ctr"
+#line 2046 "dkct-gui.ctr"
return back;
}
@@ -1439,12 +1668,12 @@ dkct_gui_set_tool_bar(DKCT_GUI *gui, char *il)
DKCT_GUI_ELEMENT *elp; /* Toolbar object. */
-#line 1958 "dkct-gui.ctr"
+#line 2063 "dkct-gui.ctr"
if(gui->c_el) {
if(((gui->c_el)->number != 0) && (!((gui->c_el)->parent))) {
-#line 1961 "dkct-gui.ctr"
+#line 2066 "dkct-gui.ctr"
/* Warning: Attribute applicable to root object only! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 55);
}
@@ -1473,7 +1702,7 @@ dkct_gui_set_tool_bar(DKCT_GUI *gui, char *il)
}
-#line 1988 "dkct-gui.ctr"
+#line 2093 "dkct-gui.ctr"
return back;
}
@@ -1494,12 +1723,12 @@ dkct_gui_set_status_bar(DKCT_GUI *gui, char *il)
char *p2; /* Initial status text. */
-#line 2007 "dkct-gui.ctr"
+#line 2112 "dkct-gui.ctr"
if(gui->c_el) {
if(((gui->c_el)->number != 0) && (!((gui->c_el)->parent))) {
-#line 2010 "dkct-gui.ctr"
+#line 2115 "dkct-gui.ctr"
/* Warning: Attribute applicable to root element only! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 55);
}
@@ -1536,7 +1765,7 @@ dkct_gui_set_status_bar(DKCT_GUI *gui, char *il)
}
-#line 2045 "dkct-gui.ctr"
+#line 2150 "dkct-gui.ctr"
return back;
}
@@ -1555,13 +1784,13 @@ dkct_gui_set_id(DKCT_GUI *gui, char *il)
char *p1; /* Start of text. */
-#line 2062 "dkct-gui.ctr"
+#line 2167 "dkct-gui.ctr"
if(gui->c_el) {
switch((gui->c_el)->cln) {
case 5: case 6: case 7: case 8: case 9: case 10: {
-#line 2066 "dkct-gui.ctr"
+#line 2171 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -1590,7 +1819,7 @@ dkct_gui_set_id(DKCT_GUI *gui, char *il)
}
-#line 2093 "dkct-gui.ctr"
+#line 2198 "dkct-gui.ctr"
return back;
}
@@ -1609,11 +1838,11 @@ dkct_gui_set_constructor(DKCT_GUI *gui, char *il)
char *p1; /* Start of text. */
-#line 2110 "dkct-gui.ctr"
+#line 2215 "dkct-gui.ctr"
if(gui->c_el) {
if((gui->c_el)->cln >= 0) {
-#line 2112 "dkct-gui.ctr"
+#line 2217 "dkct-gui.ctr"
/* Warning: Constructor attribute not recommended for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
}
@@ -1641,7 +1870,7 @@ dkct_gui_set_constructor(DKCT_GUI *gui, char *il)
}
}
-#line 2138 "dkct-gui.ctr"
+#line 2243 "dkct-gui.ctr"
return back;
}
@@ -1662,12 +1891,12 @@ dkct_gui_set_border(DKCT_GUI *gui, char *il)
char *p2 = NULL; /* Next string to process. */
-#line 2157 "dkct-gui.ctr"
+#line 2262 "dkct-gui.ctr"
if(gui->c_el) {
switch((gui->c_el)->cln) {
case 0: case 1: case 2: case 3: case 4: {
-#line 2160 "dkct-gui.ctr"
+#line 2265 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -1717,7 +1946,7 @@ dkct_gui_set_border(DKCT_GUI *gui, char *il)
}
-#line 2208 "dkct-gui.ctr"
+#line 2313 "dkct-gui.ctr"
return back;
}
@@ -1736,12 +1965,12 @@ dkct_gui_set_proportion(DKCT_GUI *gui, char *il)
int i; /* Proportion value. */
-#line 2225 "dkct-gui.ctr"
+#line 2330 "dkct-gui.ctr"
if(gui->c_el) {
switch((gui->c_el)->cln) {
case 0: case 1: case 2: case 3: {
-#line 2228 "dkct-gui.ctr"
+#line 2333 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -1758,7 +1987,7 @@ dkct_gui_set_proportion(DKCT_GUI *gui, char *il)
}
-#line 2243 "dkct-gui.ctr"
+#line 2348 "dkct-gui.ctr"
return back;
}
@@ -1778,7 +2007,7 @@ dkct_gui_set_status_text(DKCT_GUI *gui, char *il)
int back = 0;
-#line 2261 "dkct-gui.ctr"
+#line 2366 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -1790,7 +2019,7 @@ dkct_gui_set_status_text(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 2271 "dkct-gui.ctr"
+#line 2376 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -1815,7 +2044,7 @@ dkct_gui_set_status_text(DKCT_GUI *gui, char *il)
}
-#line 2294 "dkct-gui.ctr"
+#line 2399 "dkct-gui.ctr"
return back;
}
@@ -1834,7 +2063,7 @@ dkct_gui_set_expand(DKCT_GUI *gui, char *il)
char *p1; /* Start of text. */
-#line 2311 "dkct-gui.ctr"
+#line 2416 "dkct-gui.ctr"
if(gui->c_el) {
p1 = dk3str_c8_start(il, NULL);
if(p1) {
@@ -1854,7 +2083,7 @@ dkct_gui_set_expand(DKCT_GUI *gui, char *il)
}
}
-#line 2329 "dkct-gui.ctr"
+#line 2434 "dkct-gui.ctr"
return back;
}
@@ -1872,7 +2101,7 @@ dkct_gui_set_text(DKCT_GUI *gui, char *il)
char *p1; /* Start of text. */
-#line 2345 "dkct-gui.ctr"
+#line 2450 "dkct-gui.ctr"
if(gui->c_el) {
switch((gui->c_el)->cln) {
case -1:
@@ -1882,6 +2111,7 @@ dkct_gui_set_text(DKCT_GUI *gui, char *il)
case 3:
case 4:
case 9:
+ case 11:
case 15:
case 16:
case 19:
@@ -1892,14 +2122,16 @@ dkct_gui_set_text(DKCT_GUI *gui, char *il)
case 28:
case 29:
case 31:
+ case 34:
case 36:
case 37:
case 40:
{
} break;
- default: {
+ default: {
+
-#line 2370 "dkct-gui.ctr"
+#line 2478 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -1928,7 +2160,7 @@ dkct_gui_set_text(DKCT_GUI *gui, char *il)
}
}
-#line 2397 "dkct-gui.ctr"
+#line 2505 "dkct-gui.ctr"
return back;
}
@@ -1947,7 +2179,7 @@ dkct_gui_set_tip_text(DKCT_GUI *gui, char *il)
char *p1; /* Start of text. */
-#line 2414 "dkct-gui.ctr"
+#line 2522 "dkct-gui.ctr"
if(gui->c_el) {
switch((gui->c_el)->cln) {
case -1:
@@ -1966,15 +2198,21 @@ dkct_gui_set_tip_text(DKCT_GUI *gui, char *il)
case 28:
case 29:
case 30:
+ case 31:
case 36:
case 37: /* wxMenuItem */
case 39:
case 40:
+ case 42:
+ case 43:
+ case 44:
+ case 45:
+ case 46:
{
} break;
default: {
-#line 2439 "dkct-gui.ctr"
+#line 2553 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -2003,7 +2241,7 @@ dkct_gui_set_tip_text(DKCT_GUI *gui, char *il)
}
}
-#line 2466 "dkct-gui.ctr"
+#line 2580 "dkct-gui.ctr"
return back;
}
@@ -2021,7 +2259,7 @@ dkct_gui_set_type(DKCT_GUI *gui, char *il)
int back = 0;
-#line 2482 "dkct-gui.ctr"
+#line 2596 "dkct-gui.ctr"
if(gui->c_el) {
if(((gui->c_el)->number == 0) && (!((gui->c_el)->parent))) {
switch(dk3str_c8_array_index(dkct_gui_base_type_names, il, 0)) {
@@ -2041,14 +2279,14 @@ dkct_gui_set_type(DKCT_GUI *gui, char *il)
}
} else {
-#line 2500 "dkct-gui.ctr"
+#line 2614 "dkct-gui.ctr"
/* ERROR: Attribute applicable to root element only! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 55);
(gui->psrc)->ec = DK3_ERROR_SYNTAX;
}
}
-#line 2505 "dkct-gui.ctr"
+#line 2619 "dkct-gui.ctr"
return back;
}
@@ -2173,7 +2411,7 @@ dkct_gui_add_additional_placement_info(
int h; /* Number of rows. */
-#line 2628 "dkct-gui.ctr"
+#line 2742 "dkct-gui.ctr"
switch((gui->c_el)->cln) {
case 5: case 9: {
/*
@@ -2253,7 +2491,7 @@ dkct_gui_add_additional_placement_info(
} break;
}
-#line 2706 "dkct-gui.ctr"
+#line 2820 "dkct-gui.ctr"
return back;
}
@@ -2279,7 +2517,7 @@ dkct_gui_add_contents(DKCT_GUI *gui, char *il)
int i;
-#line 2730 "dkct-gui.ctr"
+#line 2844 "dkct-gui.ctr"
if(gui->c_el) {
switch((gui->c_el)->cln) {
case 0: /* wxFrame */
@@ -2296,44 +2534,51 @@ dkct_gui_add_contents(DKCT_GUI *gui, char *il)
case 12: /* wxNotebook */
case 13: /* wxScrolledWindow */
case 14: /* wxSplitterWindow */
+ case 34: /* wxStaticBox */
case 35: /* wxMenuBar */
case 36: /* wxMenu */
case 38: /* wxToolBar */
case 39: /* wxStatusBar */
+ case 42: /* wxChoicebook */
+ case 43: /* wxListbook */
+ case 44: /* wxSimplebook */
+ case 45: /* wxToolbook */
+ case 46: /* wxTreebook */
+ case 47: /* wxScrolled<wxPanel> */
{
} break;
default: {
-#line 2753 "dkct-gui.ctr"
+#line 2874 "dkct-gui.ctr"
/* Warning: Attribute not applicable to this class! */
- dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
+ dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 125);
} break;
}
for(szp = 0; szp < 16; szp++) { p[szp] = NULL; }
szp = dk3str_c8_explode(p, 15, il, NULL);
if(szp > 0) {
-#line 2760 "dkct-gui.ctr"
+#line 2881 "dkct-gui.ctr"
gel = dkct_gui_elem_next(gui, p[0]);
if(gel) {
-#line 2762 "dkct-gui.ctr"
+#line 2883 "dkct-gui.ctr"
if(dk3sto_add((gui->c_el)->s_contents, gel)) {
-#line 2763 "dkct-gui.ctr"
+#line 2884 "dkct-gui.ctr"
if(*(p[0]) == '$') {
-#line 2764 "dkct-gui.ctr"
+#line 2885 "dkct-gui.ctr"
p1 = p[0]; p2 = NULL; p3 = NULL;
p2 = dk3str_c8_chr(p1, '(');
if(p2) {
-#line 2767 "dkct-gui.ctr"
+#line 2888 "dkct-gui.ctr"
*(p2++) = '\0';
p3 = dk3str_c8_rchr(p2, ')');
if(p3) {
-#line 2770 "dkct-gui.ctr"
+#line 2891 "dkct-gui.ctr"
*p3 = '\0';
}
}
@@ -2347,7 +2592,7 @@ dkct_gui_add_contents(DKCT_GUI *gui, char *il)
case 0: case 1: {
if(pso == 0) {
-#line 2782 "dkct-gui.ctr"
+#line 2903 "dkct-gui.ctr"
gel->proportion = 1;
#if 0
/*
@@ -2358,12 +2603,12 @@ dkct_gui_add_contents(DKCT_GUI *gui, char *il)
}
if(p2) {
-#line 2791 "dkct-gui.ctr"
+#line 2912 "dkct-gui.ctr"
p3 = dk3str_c8_chr(p2, ',');
if(p3) *(p3++) = '\0';
if(sscanf(p2, "%d", &i) == 1) {
-#line 2794 "dkct-gui.ctr"
+#line 2915 "dkct-gui.ctr"
gel->sizex = i;
gel->sizey = i;
} else {
@@ -2374,12 +2619,12 @@ dkct_gui_add_contents(DKCT_GUI *gui, char *il)
}
if(p3) {
-#line 2803 "dkct-gui.ctr"
+#line 2924 "dkct-gui.ctr"
p2 = dk3str_c8_chr(p3, ',');
if(p2) *(p2++) = '\0';
if(sscanf(p3, "%d", &i) == 1) {
-#line 2806 "dkct-gui.ctr"
+#line 2927 "dkct-gui.ctr"
gel->sizey = i;
} else {
/* ERROR: Not an integer! */
@@ -2389,10 +2634,10 @@ dkct_gui_add_contents(DKCT_GUI *gui, char *il)
}
if(p2) {
-#line 2814 "dkct-gui.ctr"
+#line 2935 "dkct-gui.ctr"
if(sscanf(p2, "%d", &i) == 1) {
-#line 2815 "dkct-gui.ctr"
+#line 2936 "dkct-gui.ctr"
gel->proportion = i;
} else {
/* ERROR: Not an integer! */
@@ -2413,38 +2658,38 @@ dkct_gui_add_contents(DKCT_GUI *gui, char *il)
}
} else {
-#line 2834 "dkct-gui.ctr"
+#line 2955 "dkct-gui.ctr"
back = dkct_gui_add_additional_placement_info(
gui, gui->c_el, gel, p, szp
);
}
} else {
-#line 2839 "dkct-gui.ctr"
+#line 2960 "dkct-gui.ctr"
/* ERROR: Memory */
(gui->psrc)->ec = DK3_ERROR_MEMORY;
dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 57);
}
} else {
-#line 2844 "dkct-gui.ctr"
+#line 2965 "dkct-gui.ctr"
/* ERROR: Memory */
(gui->psrc)->ec = DK3_ERROR_MEMORY;
dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 57);
}
} else {
-#line 2849 "dkct-gui.ctr"
+#line 2970 "dkct-gui.ctr"
/* ERROR: Empty line */
(gui->psrc)->ec = DK3_ERROR_SYNTAX;
dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 66);
}
} else {
-#line 2854 "dkct-gui.ctr"
+#line 2975 "dkct-gui.ctr"
}
-#line 2855 "dkct-gui.ctr"
+#line 2976 "dkct-gui.ctr"
return back;
}
@@ -2472,7 +2717,7 @@ dkct_gui_set_grid(DKCT_GUI *gui, char *pv)
int i4 = 0; /* Fourth int value. */
-#line 2881 "dkct-gui.ctr"
+#line 3002 "dkct-gui.ctr"
co = gui->c_el;
if(co) {
switch(co->cln) {
@@ -2481,7 +2726,7 @@ dkct_gui_set_grid(DKCT_GUI *gui, char *pv)
} break;
default: {
-#line 2888 "dkct-gui.ctr"
+#line 3009 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -2563,7 +2808,7 @@ dkct_gui_set_grid(DKCT_GUI *gui, char *pv)
(gui->psrc)->ec = DK3_ERROR_SYNTAX;
}
-#line 2968 "dkct-gui.ctr"
+#line 3089 "dkct-gui.ctr"
return back;
}
@@ -2583,7 +2828,7 @@ dkct_gui_set_sash(DKCT_GUI *gui, char *pv)
int back = 0;
-#line 2986 "dkct-gui.ctr"
+#line 3107 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -2591,7 +2836,7 @@ dkct_gui_set_sash(DKCT_GUI *gui, char *pv)
} break;
default: {
-#line 2992 "dkct-gui.ctr"
+#line 3113 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -2606,7 +2851,7 @@ dkct_gui_set_sash(DKCT_GUI *gui, char *pv)
}
-#line 3005 "dkct-gui.ctr"
+#line 3126 "dkct-gui.ctr"
return back;
}
@@ -2626,7 +2871,7 @@ dkct_gui_set_min_pane_size(DKCT_GUI *gui, char *pv)
int back = 0;
-#line 3023 "dkct-gui.ctr"
+#line 3144 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -2634,7 +2879,7 @@ dkct_gui_set_min_pane_size(DKCT_GUI *gui, char *pv)
} break;
default: {
-#line 3029 "dkct-gui.ctr"
+#line 3150 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -2650,7 +2895,7 @@ dkct_gui_set_min_pane_size(DKCT_GUI *gui, char *pv)
}
-#line 3043 "dkct-gui.ctr"
+#line 3164 "dkct-gui.ctr"
return back;
}
@@ -2671,7 +2916,7 @@ dkct_gui_start_radio_button_group(DKCT_GUI *gui, char *pv)
char *p1; /* Start of text. */
-#line 3062 "dkct-gui.ctr"
+#line 3183 "dkct-gui.ctr"
co = gui->c_el;
if(co) {
p1 = dk3str_c8_start(pv, NULL);
@@ -2698,7 +2943,7 @@ dkct_gui_start_radio_button_group(DKCT_GUI *gui, char *pv)
}
-#line 3087 "dkct-gui.ctr"
+#line 3208 "dkct-gui.ctr"
return back;
}
@@ -2721,7 +2966,7 @@ dkct_gui_set_size_for_object(DKCT_GUI *gui, char *pv)
int back = 0;
-#line 3108 "dkct-gui.ctr"
+#line 3229 "dkct-gui.ctr"
if(gui->c_el) {
el = gui->c_el;
p1 = dk3str_c8_start(pv, NULL);
@@ -2747,7 +2992,7 @@ dkct_gui_set_size_for_object(DKCT_GUI *gui, char *pv)
}
-#line 3132 "dkct-gui.ctr"
+#line 3253 "dkct-gui.ctr"
return back;
}
@@ -2767,25 +3012,27 @@ dkct_gui_set_direction(DKCT_GUI *gui, char *il)
char *p1; /* Start of text. */
-#line 3150 "dkct-gui.ctr"
+#line 3271 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
p1 = dk3str_c8_start(il, NULL);
if(p1) {
dk3str_c8_next(p1, NULL);
switch(el->cln) {
- case 5: /* box sizer */
- case 9: /* static box sizer */
- case 25: /* spin button */
- case 26: /* spin control */
- case 13: /* scrolled window */
- case 30: /* gauge */
- case 33: /* static line */
+ case 5: /* box sizer */
+ case 9: /* static box sizer */
+ case 24: /* scrollbar */
+ case 25: /* spin button */
+ case 26: /* spin control */
+ case 27: /* slider control */
+ case 13: case 47: /* scrolled window */
+ case 30: /* gauge */
+ case 33: /* static line */
{
} break;
default: {
-#line 3166 "dkct-gui.ctr"
+#line 3289 "dkct-gui.ctr"
/* Warning: Direction ignored for this class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -2800,7 +3047,7 @@ dkct_gui_set_direction(DKCT_GUI *gui, char *il)
back = 1;
} break;
case 2: {
- if(el->cln == 13) {
+ if((el->cln == 13) || (el->cln == 47)) {
el->direction = DKCT_GUI_DIRECTION_BOTH;
back = 1;
} else {
@@ -2819,7 +3066,7 @@ dkct_gui_set_direction(DKCT_GUI *gui, char *il)
}
-#line 3198 "dkct-gui.ctr"
+#line 3321 "dkct-gui.ctr"
return back;
}
@@ -2842,7 +3089,7 @@ dkct_gui_set_range(DKCT_GUI *gui, char *il)
int i2 = 100; /* Maximum. */
-#line 3219 "dkct-gui.ctr"
+#line 3342 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -2886,7 +3133,7 @@ dkct_gui_set_range(DKCT_GUI *gui, char *il)
}
-#line 3261 "dkct-gui.ctr"
+#line 3384 "dkct-gui.ctr"
return back;
}
@@ -2907,7 +3154,7 @@ dkct_gui_set_value(DKCT_GUI *gui, char *il)
int i1 = 0; /* Value. */
-#line 3280 "dkct-gui.ctr"
+#line 3403 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -2936,7 +3183,7 @@ dkct_gui_set_value(DKCT_GUI *gui, char *il)
}
-#line 3307 "dkct-gui.ctr"
+#line 3430 "dkct-gui.ctr"
return back;
}
@@ -2956,7 +3203,7 @@ dkct_gui_set_wrap(DKCT_GUI *gui, char *il)
DKCT_GUI_ELEMENT *el; /* Element to modify. */
-#line 3325 "dkct-gui.ctr"
+#line 3448 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -2987,7 +3234,7 @@ dkct_gui_set_wrap(DKCT_GUI *gui, char *il)
}
}
-#line 3354 "dkct-gui.ctr"
+#line 3477 "dkct-gui.ctr"
return back;
}
@@ -3007,7 +3254,7 @@ dkct_gui_set_keys(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3372 "dkct-gui.ctr"
+#line 3495 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3017,7 +3264,7 @@ dkct_gui_set_keys(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 3380 "dkct-gui.ctr"
+#line 3503 "dkct-gui.ctr"
/* Warning: Keys setting ignored for this class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3040,7 +3287,7 @@ dkct_gui_set_keys(DKCT_GUI *gui, char *il)
}
}
-#line 3401 "dkct-gui.ctr"
+#line 3524 "dkct-gui.ctr"
return back;
}
@@ -3059,7 +3306,7 @@ dkct_gui_set_validator(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3418 "dkct-gui.ctr"
+#line 3541 "dkct-gui.ctr"
co = gui->c_el;
if(co) {
switch(co->cln) {
@@ -3083,7 +3330,7 @@ dkct_gui_set_validator(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 3440 "dkct-gui.ctr"
+#line 3563 "dkct-gui.ctr"
/* Warning: Setting a validator is not recommended! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3103,7 +3350,7 @@ dkct_gui_set_validator(DKCT_GUI *gui, char *il)
}
-#line 3458 "dkct-gui.ctr"
+#line 3581 "dkct-gui.ctr"
return back;
}
@@ -3124,7 +3371,7 @@ dkct_gui_set_text_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3477 "dkct-gui.ctr"
+#line 3600 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3135,7 +3382,7 @@ dkct_gui_set_text_style(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 3486 "dkct-gui.ctr"
+#line 3609 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3216,7 +3463,7 @@ dkct_gui_set_text_style(DKCT_GUI *gui, char *il)
}
-#line 3565 "dkct-gui.ctr"
+#line 3688 "dkct-gui.ctr"
return back;
}
@@ -3237,7 +3484,7 @@ dkct_gui_set_button_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3584 "dkct-gui.ctr"
+#line 3707 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
p1 = dk3str_c8_start(il, NULL);
@@ -3277,7 +3524,7 @@ dkct_gui_set_button_style(DKCT_GUI *gui, char *il)
}
-#line 3622 "dkct-gui.ctr"
+#line 3745 "dkct-gui.ctr"
return back;
}
@@ -3298,15 +3545,21 @@ dkct_gui_set_notebook_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3641 "dkct-gui.ctr"
+#line 3764 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
- case 12: {
+ case 12:
+ case 42: /* 2018-05-29 Further books added */
+ case 43:
+ case 44:
+ case 45:
+ case 46:
+ {
} break;
default: {
-#line 3647 "dkct-gui.ctr"
+#line 3776 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3356,7 +3609,7 @@ dkct_gui_set_notebook_style(DKCT_GUI *gui, char *il)
}
-#line 3695 "dkct-gui.ctr"
+#line 3824 "dkct-gui.ctr"
return back;
}
@@ -3377,7 +3630,7 @@ dkct_gui_set_slider_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3714 "dkct-gui.ctr"
+#line 3843 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3385,7 +3638,7 @@ dkct_gui_set_slider_style(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 3720 "dkct-gui.ctr"
+#line 3849 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3433,7 +3686,7 @@ dkct_gui_set_slider_style(DKCT_GUI *gui, char *il)
}
-#line 3766 "dkct-gui.ctr"
+#line 3895 "dkct-gui.ctr"
return back;
}
@@ -3454,7 +3707,7 @@ dkct_gui_set_splitter_window_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3785 "dkct-gui.ctr"
+#line 3914 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3462,7 +3715,7 @@ dkct_gui_set_splitter_window_style(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 3791 "dkct-gui.ctr"
+#line 3920 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3511,7 +3764,7 @@ dkct_gui_set_splitter_window_style(DKCT_GUI *gui, char *il)
}
-#line 3838 "dkct-gui.ctr"
+#line 3967 "dkct-gui.ctr"
return back;
}
@@ -3532,7 +3785,7 @@ dkct_gui_set_bitmap_button_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3857 "dkct-gui.ctr"
+#line 3986 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3543,7 +3796,7 @@ dkct_gui_set_bitmap_button_style(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 3866 "dkct-gui.ctr"
+#line 3995 "dkct-gui.ctr"
/* Warning: Attribute not applicable to object! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3585,7 +3838,7 @@ dkct_gui_set_bitmap_button_style(DKCT_GUI *gui, char *il)
}
-#line 3906 "dkct-gui.ctr"
+#line 4035 "dkct-gui.ctr"
return back;
}
@@ -3606,7 +3859,7 @@ dkct_gui_set_gauge_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3925 "dkct-gui.ctr"
+#line 4054 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3641,7 +3894,7 @@ dkct_gui_set_gauge_style(DKCT_GUI *gui, char *il)
}
-#line 3958 "dkct-gui.ctr"
+#line 4087 "dkct-gui.ctr"
return back;
}
@@ -3661,7 +3914,7 @@ dkct_gui_set_icon(DKCT_GUI *gui, char *il)
int back = 0;
-#line 3976 "dkct-gui.ctr"
+#line 4105 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
dk3_release(el->icon);
@@ -3687,7 +3940,7 @@ dkct_gui_set_icon(DKCT_GUI *gui, char *il)
}
-#line 4000 "dkct-gui.ctr"
+#line 4129 "dkct-gui.ctr"
return back;
}
@@ -3708,7 +3961,7 @@ dkct_gui_set_menu_item_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4019 "dkct-gui.ctr"
+#line 4148 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3718,7 +3971,7 @@ dkct_gui_set_menu_item_style(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 4027 "dkct-gui.ctr"
+#line 4156 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3763,7 +4016,7 @@ dkct_gui_set_menu_item_style(DKCT_GUI *gui, char *il)
}
-#line 4070 "dkct-gui.ctr"
+#line 4199 "dkct-gui.ctr"
return back;
}
@@ -3784,7 +4037,7 @@ dkct_gui_set_toolbar_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4089 "dkct-gui.ctr"
+#line 4218 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3792,7 +4045,7 @@ dkct_gui_set_toolbar_style(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 4095 "dkct-gui.ctr"
+#line 4224 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3845,7 +4098,7 @@ dkct_gui_set_toolbar_style(DKCT_GUI *gui, char *il)
}
-#line 4146 "dkct-gui.ctr"
+#line 4275 "dkct-gui.ctr"
return back;
}
@@ -3867,7 +4120,7 @@ dkct_gui_set_choices(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4166 "dkct-gui.ctr"
+#line 4295 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3880,7 +4133,7 @@ dkct_gui_set_choices(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 4177 "dkct-gui.ctr"
+#line 4306 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3891,7 +4144,7 @@ dkct_gui_set_choices(DKCT_GUI *gui, char *il)
p2 = dk3str_c8_next(p1, NULL);
if(p2) {
-#line 4186 "dkct-gui.ctr"
+#line 4315 "dkct-gui.ctr"
if(sscanf(p1, "%i", &i) == 1) {
if(i > 0) {
el->nChoices = i;
@@ -3912,7 +4165,7 @@ dkct_gui_set_choices(DKCT_GUI *gui, char *il)
}
} else {
-#line 4205 "dkct-gui.ctr"
+#line 4334 "dkct-gui.ctr"
if(el->choices) {
/* Warning: Redefinition */
dkct_to_log_3(gui->psrc,1,DK3_LL_WARNING,74,75,el->choices);
@@ -3933,7 +4186,7 @@ dkct_gui_set_choices(DKCT_GUI *gui, char *il)
}
-#line 4224 "dkct-gui.ctr"
+#line 4353 "dkct-gui.ctr"
return back;
}
@@ -3953,7 +4206,7 @@ dkct_gui_set_list_box_style(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4242 "dkct-gui.ctr"
+#line 4371 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -3963,7 +4216,7 @@ dkct_gui_set_list_box_style(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 4250 "dkct-gui.ctr"
+#line 4379 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -3992,7 +4245,7 @@ dkct_gui_set_list_box_style(DKCT_GUI *gui, char *il)
}
-#line 4277 "dkct-gui.ctr"
+#line 4406 "dkct-gui.ctr"
return back;
}
@@ -4014,7 +4267,7 @@ dkct_gui_set_rb_max(DKCT_GUI *gui, char *il, int how)
int back = 0;
-#line 4297 "dkct-gui.ctr"
+#line 4426 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -4023,7 +4276,7 @@ dkct_gui_set_rb_max(DKCT_GUI *gui, char *il, int how)
} break;
default: {
-#line 4304 "dkct-gui.ctr"
+#line 4433 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -4058,7 +4311,7 @@ dkct_gui_set_rb_max(DKCT_GUI *gui, char *il, int how)
case 41: {
p1 = dk3str_c8_start(il, NULL);
-#line 4337 "dkct-gui.ctr"
+#line 4466 "dkct-gui.ctr"
if(p1) {
if(sscanf(p1, "%d", &i) == 1) {
if(i > 0) {
@@ -4070,26 +4323,26 @@ dkct_gui_set_rb_max(DKCT_GUI *gui, char *il, int how)
}
} else {
-#line 4347 "dkct-gui.ctr"
+#line 4476 "dkct-gui.ctr"
(gui->psrc)->ec = DK3_ERROR_SYNTAX;
dkct_to_log_3(gui->psrc, 1, DK3_LL_ERROR, 82, 83, p1);
}
} else {
-#line 4351 "dkct-gui.ctr"
+#line 4480 "dkct-gui.ctr"
(gui->psrc)->ec = DK3_ERROR_SYNTAX;
dkct_to_log_3(gui->psrc, 1, DK3_LL_ERROR, 76, 77, p1);
}
}
-#line 4355 "dkct-gui.ctr"
+#line 4484 "dkct-gui.ctr"
} break;
}
}
}
-#line 4360 "dkct-gui.ctr"
+#line 4489 "dkct-gui.ctr"
return back;
}
@@ -4111,7 +4364,7 @@ dkct_gui_set_states(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4380 "dkct-gui.ctr"
+#line 4509 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -4120,7 +4373,7 @@ dkct_gui_set_states(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 4387 "dkct-gui.ctr"
+#line 4516 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -4173,7 +4426,7 @@ dkct_gui_set_states(DKCT_GUI *gui, char *il)
}
-#line 4438 "dkct-gui.ctr"
+#line 4567 "dkct-gui.ctr"
return back;
}
@@ -4193,7 +4446,7 @@ dkct_gui_set_bitmap(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4456 "dkct-gui.ctr"
+#line 4585 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
switch(el->cln) {
@@ -4205,7 +4458,7 @@ dkct_gui_set_bitmap(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 4466 "dkct-gui.ctr"
+#line 4595 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -4228,7 +4481,7 @@ dkct_gui_set_bitmap(DKCT_GUI *gui, char *il)
}
-#line 4487 "dkct-gui.ctr"
+#line 4616 "dkct-gui.ctr"
return back;
}
@@ -4248,12 +4501,12 @@ dkct_gui_set_bitmap_disabled(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4505 "dkct-gui.ctr"
+#line 4634 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
if(!((el->cln == 16) || (el->cln == 40))) {
-#line 4508 "dkct-gui.ctr"
+#line 4637 "dkct-gui.ctr"
/* Warning: Attribute not applicable to class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
}
@@ -4273,7 +4526,7 @@ dkct_gui_set_bitmap_disabled(DKCT_GUI *gui, char *il)
}
-#line 4526 "dkct-gui.ctr"
+#line 4655 "dkct-gui.ctr"
return back;
}
@@ -4293,12 +4546,12 @@ dkct_gui_set_bitmap_selected(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4544 "dkct-gui.ctr"
+#line 4673 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
if(el->cln != 16) {
-#line 4547 "dkct-gui.ctr"
+#line 4676 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
}
@@ -4320,7 +4573,7 @@ dkct_gui_set_bitmap_selected(DKCT_GUI *gui, char *il)
}
-#line 4567 "dkct-gui.ctr"
+#line 4696 "dkct-gui.ctr"
return back;
}
@@ -4340,12 +4593,12 @@ dkct_gui_set_bitmap_focus(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4585 "dkct-gui.ctr"
+#line 4714 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
if(el->cln != 16) {
-#line 4588 "dkct-gui.ctr"
+#line 4717 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
}
@@ -4367,7 +4620,7 @@ dkct_gui_set_bitmap_focus(DKCT_GUI *gui, char *il)
}
-#line 4608 "dkct-gui.ctr"
+#line 4737 "dkct-gui.ctr"
return back;
}
@@ -4387,12 +4640,12 @@ dkct_gui_set_bitmap_hover(DKCT_GUI *gui, char *il)
int back = 0;
-#line 4626 "dkct-gui.ctr"
+#line 4755 "dkct-gui.ctr"
el = gui->c_el;
if(el) {
if(el->cln != 16) {
-#line 4629 "dkct-gui.ctr"
+#line 4758 "dkct-gui.ctr"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
}
@@ -4414,7 +4667,7 @@ dkct_gui_set_bitmap_hover(DKCT_GUI *gui, char *il)
}
-#line 4649 "dkct-gui.ctr"
+#line 4778 "dkct-gui.ctr"
return back;
}
@@ -4434,13 +4687,13 @@ dkct_add_grid_head(DKCT_GUI *gui, char const *pv, int how)
int back = 0;
-#line 4667 "dkct-gui.ctr"
+#line 4796 "dkct-gui.ctr"
if((gui->c_el) && (pv)) {
switch((gui->c_el)->cln) {
case 41: {
if(how) {
-#line 4671 "dkct-gui.ctr"
+#line 4800 "dkct-gui.ctr"
if(!((gui->c_el)->sColumnHeads)) {
(gui->c_el)->sColumnHeads = dk3sto_open_app((gui->psrc)->app);
if((gui->c_el)->sColumnHeads) {
@@ -4473,7 +4726,7 @@ dkct_add_grid_head(DKCT_GUI *gui, char const *pv, int how)
}
} else {
-#line 4702 "dkct-gui.ctr"
+#line 4831 "dkct-gui.ctr"
if(!((gui->c_el)->sRowHeads)) {
(gui->c_el)->sRowHeads = dk3sto_open_app((gui->psrc)->app);
if((gui->c_el)->sRowHeads) {
@@ -4510,7 +4763,7 @@ dkct_add_grid_head(DKCT_GUI *gui, char const *pv, int how)
}
}
-#line 4737 "dkct-gui.ctr"
+#line 4866 "dkct-gui.ctr"
return back;
}
@@ -4797,11 +5050,13 @@ dkct_set_minimum_size(DKCT_GUI *gui, char *pv)
*/
static
int
-dkct_int_compare(void const *l, void const *r, int cr)
+dkct_int_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int const *pl;
int const *pr;
int back = 0;
+
+ DK3_UNUSED_ARG(cr)
pl = (int const *)l; pr = (int const *)r;
if(pl) {
if(pr) {
@@ -4983,7 +5238,7 @@ dkct_gui_process_object_line(DKCT_GUI *gui, char *il)
int action; /* Attribute index. */
-#line 5208 "dkct-gui.ctr"
+#line 5339 "dkct-gui.ctr"
if(gui->c_el) {
pv = dk3str_c8_chr(il, '=');
if(pv) {
@@ -4995,67 +5250,67 @@ dkct_gui_process_object_line(DKCT_GUI *gui, char *il)
switch(action) {
case 0: case 23: {
-#line 5218 "dkct-gui.ctr"
+#line 5349 "dkct-gui.ctr"
back = dkct_gui_set_expand(gui, pv);
} break;
case 1: {
-#line 5221 "dkct-gui.ctr"
+#line 5352 "dkct-gui.ctr"
back = dkct_gui_set_type(gui, pv);
} break;
case 2: {
-#line 5224 "dkct-gui.ctr"
+#line 5355 "dkct-gui.ctr"
back = dkct_gui_set_menu_bar(gui, pv);
} break;
case 3: {
-#line 5227 "dkct-gui.ctr"
+#line 5358 "dkct-gui.ctr"
back = dkct_gui_set_tool_bar(gui, pv);
} break;
case 4: {
-#line 5230 "dkct-gui.ctr"
+#line 5361 "dkct-gui.ctr"
back = dkct_gui_set_status_bar(gui, pv);
} break;
case 5: {
-#line 5233 "dkct-gui.ctr"
+#line 5364 "dkct-gui.ctr"
back = dkct_gui_add_contents(gui, pv);
} break;
case 6: {
-#line 5236 "dkct-gui.ctr"
+#line 5367 "dkct-gui.ctr"
back = dkct_gui_set_text(gui, pv);
} break;
case 7: {
-#line 5239 "dkct-gui.ctr"
+#line 5370 "dkct-gui.ctr"
back = dkct_gui_set_id(gui, pv);
} break;
case 8: {
-#line 5242 "dkct-gui.ctr"
+#line 5373 "dkct-gui.ctr"
back = dkct_gui_set_tip_text(gui, pv);
} break;
case 9: {
-#line 5245 "dkct-gui.ctr"
+#line 5376 "dkct-gui.ctr"
back = dkct_gui_set_proportion(gui, pv);
} break;
case 10: {
-#line 5248 "dkct-gui.ctr"
+#line 5379 "dkct-gui.ctr"
back = dkct_gui_set_status_text(gui, pv);
} break;
case 11: {
-#line 5251 "dkct-gui.ctr"
+#line 5382 "dkct-gui.ctr"
back = dkct_gui_set_border(gui, pv);
} break;
case 12: {
-#line 5254 "dkct-gui.ctr"
+#line 5385 "dkct-gui.ctr"
back = dkct_gui_set_constructor(gui, pv);
} break;
case 13: {
@@ -5209,7 +5464,7 @@ dkct_gui_process_object_line(DKCT_GUI *gui, char *il)
}
-#line 5406 "dkct-gui.ctr"
+#line 5537 "dkct-gui.ctr"
return back;
}
@@ -5230,7 +5485,7 @@ dkct_gui_process_option(DKCT_GUI *gui, char *il)
char *p2; /* Next string to process. */
-#line 5425 "dkct-gui.ctr"
+#line 5556 "dkct-gui.ctr"
if(gui->c_el) {
pv = dk3str_c8_chr(il, '=');
if(pv) {
@@ -5266,7 +5521,7 @@ dkct_gui_process_option(DKCT_GUI *gui, char *il)
}
-#line 5459 "dkct-gui.ctr"
+#line 5590 "dkct-gui.ctr"
return back;
}
@@ -5284,18 +5539,18 @@ dkct_gui_add_line(DKCT_GUI *gui, char *il)
char *p1; /* Start of input line. */
-#line 5475 "dkct-gui.ctr"
+#line 5606 "dkct-gui.ctr"
p1 = dk3str_c8_start(il, NULL);
if(p1) {
switch(*p1) {
case '#': {
-#line 5479 "dkct-gui.ctr"
+#line 5610 "dkct-gui.ctr"
back = 1;
} break;
case '.': {
-#line 5482 "dkct-gui.ctr"
+#line 5613 "dkct-gui.ctr"
p1++;
p1 = dk3str_c8_start(p1, NULL);
if(p1) {
@@ -5308,7 +5563,7 @@ dkct_gui_add_line(DKCT_GUI *gui, char *il)
} break;
case '[': {
-#line 5493 "dkct-gui.ctr"
+#line 5624 "dkct-gui.ctr"
p1++;
p1 = dk3str_c8_start(p1, NULL);
if(p1) {
@@ -5321,14 +5576,14 @@ dkct_gui_add_line(DKCT_GUI *gui, char *il)
} break;
default: {
-#line 5504 "dkct-gui.ctr"
+#line 5635 "dkct-gui.ctr"
back = dkct_gui_process_object_line(gui, p1);
} break;
}
}
-#line 5509 "dkct-gui.ctr"
+#line 5640 "dkct-gui.ctr"
return back;
}
@@ -5368,7 +5623,7 @@ dkct_gui_report_illegal_parent_child(
char const *pname;
-#line 5547 "dkct-gui.ctr"
+#line 5678 "dkct-gui.ctr"
cname = pname = dkct_gui_out_kw[197];
if(co) {
if(co->cln >= 0) {
@@ -5383,7 +5638,36 @@ dkct_gui_report_illegal_parent_child(
dkct_to_log_5(psrc, 1, DK3_LL_ERROR, 88, 89, 90, pname, cname);
-#line 5560 "dkct-gui.ctr"
+#line 5691 "dkct-gui.ctr"
+}
+
+
+
+static
+int
+dkct_gui_is_stock_element(DKCT_GUI_ELEMENT *el)
+{
+ int back = 0;
+
+
+#line 5701 "dkct-gui.ctr"
+ if ((15 == el->cln) || (37 == el->cln)) {
+
+#line 5702 "dkct-gui.ctr"
+ if (NULL != el->idname) {
+
+#line 5703 "dkct-gui.ctr"
+ if (0 < dk3str_c8_array_index(dkct_gui_stock_item_names, el->idname, 1)) {
+ back = 1;
+
+#line 5705 "dkct-gui.ctr"
+ }
+ }
+ }
+
+
+#line 5709 "dkct-gui.ctr"
+ return back;
}
@@ -5404,7 +5688,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
int szfound = 0; /* Flag: Sizer found. */
-#line 5579 "dkct-gui.ctr"
+#line 5729 "dkct-gui.ctr"
dp = (DKCT_GUI_ELEMENT *)(el->parent);
psrc->lineno = ((el->lndef) > 0UL) ? (el->lndef) : (el->lndecl);
dk3app_set_source_line(psrc->app, psrc->lineno);
@@ -5415,6 +5699,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
case 9: case 10: case 11: case 12: case 13: case 14: case 35: case 36:
case 38:
+ case 42: case 43: case 44: case 45: case 46: case 47: /* 2018-05-29 */
{
back = 0;
nco = dkct_gui_get_number_contents(el);
@@ -5435,7 +5720,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
}
if(!(back)) {
-#line 5608 "dkct-gui.ctr"
+#line 5759 "dkct-gui.ctr"
}
} break;
}
@@ -5452,14 +5737,29 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
|| (el->menuItemStyle != DKCT_GUI_MENU_ITEM_SEPARATOR)
)
{
- if(el->cln == 28) {
- /* ERROR: Missing text! */
+ if((el->cln == 28) || (0 != dkct_gui_is_stock_element(el))) {
+ /* Info: Missing text! */
+
+
+#line 5778 "dkct-gui.ctr"
+#if 0
+ /* 2018-05-28 Removed
+ Do not issue message about wxTextCtrl, wxMenuItem, wxButton
+ without text.
+ For wxTextCtrl the field is empty, user should type text.
+ For wxMenuItem and wxButton create stock objects if
+ no text present.
+ */
dkct_to_log_1(psrc, 1, DK3_LL_INFO, 49);
+#endif
} else {
back = 0;
-#line 5629 "dkct-gui.ctr"
+#line 5790 "dkct-gui.ctr"
/* ERROR: Missing text! */
+
+
+#line 5792 "dkct-gui.ctr"
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 49);
}
}
@@ -5477,7 +5777,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
if(!(el->idname)) {
back = 0;
-#line 5646 "dkct-gui.ctr"
+#line 5808 "dkct-gui.ctr"
/* ERROR: Missing ID! */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 46);
}
@@ -5493,7 +5793,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
if(el->gridcolumns == 0) {
back = 0;
-#line 5660 "dkct-gui.ctr"
+#line 5822 "dkct-gui.ctr"
/* ERROR: Missing grid! */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 50);
}
@@ -5515,7 +5815,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
{
back = 0;
-#line 5680 "dkct-gui.ctr"
+#line 5842 "dkct-gui.ctr"
/* ERROR: Missing bitmap! */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 51);
}
@@ -5532,7 +5832,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
if((!(el->choices)) || (el->nChoices == 0)) {
back = 0;
-#line 5695 "dkct-gui.ctr"
+#line 5857 "dkct-gui.ctr"
/* ERROR: Missing choices! */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 52);
}
@@ -5544,10 +5844,14 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
*/
if(back) {
switch(el->cln) {
- case 12: case 13: case 28: {
+ /*
+ 2018-05-29 Removed case 12 branch
+ Requiring a size is not necessary for a wxNotebook.
+ */
+ case 13: case 47: case 28: {
if(!((el->sizex > 0) && (el->sizey > 0))) {
-#line 5708 "dkct-gui.ctr"
+#line 5874 "dkct-gui.ctr"
if(el->cln == 28) {
/*
Warning: Missing size.
@@ -5574,7 +5878,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
if(el->maxRowsCols < 1) {
back = 0;
-#line 5733 "dkct-gui.ctr"
+#line 5899 "dkct-gui.ctr"
/* ERROR: Missing rows or columns maximum! */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 54);
}
@@ -5597,7 +5901,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
} else {
back = 0;
-#line 5754 "dkct-gui.ctr"
+#line 5920 "dkct-gui.ctr"
/* ERROR: Illegal parent/child combination. */
dkct_gui_report_illegal_parent_child(el, dp, psrc);
}
@@ -5619,7 +5923,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
} else {
back = 0;
-#line 5774 "dkct-gui.ctr"
+#line 5940 "dkct-gui.ctr"
/* ERROR: Illegal parent/child combination. */
dkct_gui_report_illegal_parent_child(el, dp, psrc);
}
@@ -5634,7 +5938,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
if((dp->cln == 35) || (dp->cln == 36)) {
} else {
-#line 5787 "dkct-gui.ctr"
+#line 5953 "dkct-gui.ctr"
/* ERROR: Illegal parent/child combination. */
dkct_gui_report_illegal_parent_child(el, dp, psrc);
}
@@ -5668,7 +5972,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
}
}
-#line 5819 "dkct-gui.ctr"
+#line 5985 "dkct-gui.ctr"
return back;
}
@@ -5687,7 +5991,7 @@ dkct_gui_classnames_check(DKCT_SRC *psrc)
int back = 1;
-#line 5836 "dkct-gui.ctr"
+#line 6002 "dkct-gui.ctr"
if(psrc->gui) {
gui = (DKCT_GUI *)(psrc->gui);
dk3sto_it_reset(gui->i_el_by_num);
@@ -5704,7 +6008,7 @@ dkct_gui_classnames_check(DKCT_SRC *psrc)
if(!(el->cname)) {
back = 0;
-#line 5851 "dkct-gui.ctr"
+#line 6017 "dkct-gui.ctr"
/* ERROR: Missing object class name! */
if(el->name) {
dkct_to_log_3(gui->psrc, 1, DK3_LL_ERROR, 93, 94, el->name);
@@ -5721,7 +6025,7 @@ dkct_gui_classnames_check(DKCT_SRC *psrc)
}
}
-#line 5866 "dkct-gui.ctr"
+#line 6032 "dkct-gui.ctr"
return back;
}
@@ -5745,7 +6049,7 @@ dkct_gui_dependency_check(DKCT_SRC *psrc)
size_t i; /* Current index to check. */
-#line 5888 "dkct-gui.ctr"
+#line 6054 "dkct-gui.ctr"
if(psrc->gui) {
gui = (DKCT_GUI *)(psrc->gui);
bm = dk3bm_open(gui->no, gui->no, psrc->app);
@@ -5796,7 +6100,7 @@ dkct_gui_dependency_check(DKCT_SRC *psrc)
}
}
-#line 5937 "dkct-gui.ctr"
+#line 6103 "dkct-gui.ctr"
return back;
}
@@ -5808,14 +6112,14 @@ dkct_gui_check(DKCT_SRC *psrc)
int back = 0;
-#line 5947 "dkct-gui.ctr"
+#line 6113 "dkct-gui.ctr"
if(dkct_gui_classnames_check(psrc)) {
if(dkct_gui_dependency_check(psrc)) {
back = 1;
}
}
-#line 5952 "dkct-gui.ctr"
+#line 6118 "dkct-gui.ctr"
return back;
}
@@ -6151,14 +6455,15 @@ dkct_gui_add_object_to_sizer(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *pa,
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
char bu[64]; /* Buffer for integer values. */
int det = 0; /* Details to use. */
-#line 6293 "dkct-gui.ctr"
+#line 6459 "dkct-gui.ctr"
+ DK3_UNUSED_ARG(gui)
/*
Last modifications to object before adding it to parent.
*/
@@ -6175,17 +6480,17 @@ dkct_gui_add_object_to_sizer(
switch(pa->cln) {
case 7: {
-#line 6308 "dkct-gui.ctr"
+#line 6475 "dkct-gui.ctr"
/* sizer */
if(dkct_gui_need_flags(co)) {
det = 1;
-#line 6311 "dkct-gui.ctr"
+#line 6478 "dkct-gui.ctr"
}
if((co->border >= 0) && (co->borderPos)) {
det = 2;
-#line 6314 "dkct-gui.ctr"
+#line 6481 "dkct-gui.ctr"
}
fputs(dkct_gui_out_kw[8], psrc->fipo);
fputs(pa->name, psrc->fipo);
@@ -6249,7 +6554,7 @@ dkct_gui_add_object_to_sizer(
} break;
case 5: case 6: case 8: case 9: case 10: {
-#line 6376 "dkct-gui.ctr"
+#line 6543 "dkct-gui.ctr"
/*
sizer->Add(object, proportion, flags, border);
*/
@@ -6257,17 +6562,17 @@ dkct_gui_add_object_to_sizer(
if(co->proportion) {
det = 1;
-#line 6382 "dkct-gui.ctr"
+#line 6549 "dkct-gui.ctr"
}
if(dkct_gui_need_flags(co)) {
det = 2;
-#line 6385 "dkct-gui.ctr"
+#line 6552 "dkct-gui.ctr"
}
if((co->border >= 0) && (co->borderPos)) {
det = 3;
-#line 6388 "dkct-gui.ctr"
+#line 6555 "dkct-gui.ctr"
}
fputs(dkct_gui_out_kw[8], psrc->fipo);
fputs(pa->name, psrc->fipo);
@@ -6327,7 +6632,7 @@ dkct_gui_add_object_to_sizer(
}
-#line 6446 "dkct-gui.ctr"
+#line 6613 "dkct-gui.ctr"
}
@@ -6344,16 +6649,23 @@ dkct_gui_set_parents_sizer(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *pa,
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
char const *pname = NULL; /* Parent object name. */
-#line 6467 "dkct-gui.ctr"
+#line 6634 "dkct-gui.ctr"
+ DK3_UNUSED_ARG(gui)
if(pa) { pname = pa->name; }
if(!(pname)) {
- if(pa->cln != 1) { pname = dkct_gui_out_kw[30]; }
+ if (pa) {
+ if(pa->cln != 1) {
+ pname = dkct_gui_out_kw[30];
+ }
+ } else {
+ pname = dkct_gui_out_kw[30];
+ }
}
fputs(dkct_gui_out_kw[8], psrc->fipo);
if(pname) {
@@ -6366,7 +6678,7 @@ dkct_gui_set_parents_sizer(
fputs(dkct_gui_out_kw[0], psrc->fipo);
-#line 6481 "dkct-gui.ctr"
+#line 6655 "dkct-gui.ctr"
}
@@ -6439,9 +6751,13 @@ dkct_gui_write_idname(DKCT_GUI_ELEMENT *co, DKCT_SRC *psrc)
*/
static
void
-dkct_gui_write_size(DKCT_SRC *psrc, int w, int h, int rec, DKCT_GUI_ELEMENT *co)
+dkct_gui_write_size(
+ DKCT_SRC *psrc, int w, int h, int rec,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(co)
+)
{
char bu[256];
+ DK3_UNUSED_ARG(co)
if((w > 0) && (h > 0)) {
sprintf(bu, "%d, %d", w, h);
fputs(dkct_gui_out_kw[81], psrc->fipo);
@@ -6464,7 +6780,7 @@ static
void
dkct_gui_constructor_frame_dialog(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6472,6 +6788,7 @@ dkct_gui_constructor_frame_dialog(
{
int det = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if(co->text) det = 1;
if((co->sizex > 0) && (co->sizey > 0)) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -6508,12 +6825,15 @@ static
void
dkct_gui_constructor_boxsizer(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
fputs(dkct_gui_out_kw[2], psrc->fipo);
switch(co->direction) {
case DKCT_GUI_DIRECTION_VERTICAL: {
@@ -6562,10 +6882,10 @@ static
void
dkct_gui_constructor_gridsizer(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
char bu[256]; /* Buffer for integer values. */
@@ -6574,6 +6894,9 @@ dkct_gui_constructor_gridsizer(
int y = 0; /* Start row. */
int x = 0; /* Start column. */
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
c = co->gridcolumns;
r = co->gridrows;
x = co->gridgapx;
@@ -6611,16 +6934,19 @@ static
void
dkct_gui_constructor_gridbagsizer(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
char bu[128]; /* Buffer for integer values. */
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
bu[0] = '\0';
- if((co->gridgapy > -1) || (co->gridgapy > -1)) {
+ if((co->gridgapx > -1) || (co->gridgapy > -1)) {
fputs(dkct_gui_out_kw[2], psrc->fipo);
if(co->gridgapx > -1) {
sprintf(
@@ -6649,12 +6975,13 @@ static
void
dkct_gui_constructor_staticboxsizer(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
)
{
+ DK3_UNUSED_ARG(dp)
fputs(dkct_gui_out_kw[2], psrc->fipo);
fputs(dkct_gui_out_kw[(co->direction) ? 35 : 34], psrc->fipo);
dkct_gui_next_argument(psrc);
@@ -6679,7 +7006,7 @@ static
void
dkct_gui_constructor_panel(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6687,6 +7014,7 @@ dkct_gui_constructor_panel(
{
int det = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
@@ -6716,7 +7044,7 @@ static
void
dkct_gui_constructor_notebook(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6725,6 +7053,7 @@ dkct_gui_constructor_notebook(
int det = 0; /* Details level. */
int fe = 0; /* Flag: Found elements. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->notebookStyle) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -6738,36 +7067,89 @@ dkct_gui_constructor_notebook(
dkct_gui_write_size(psrc, co->sizex, co->sizey, 0, co);
if(det > 1) {
if((co->notebookStyle) & DKCT_GUI_NB_TOP) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[113], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_LEFT) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[114], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_RIGHT) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[115], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_BOTTOM) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[116], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_FIXEDWIDTH) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[117], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_MULTILINE) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[118], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_NOPAGETHEME) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[119], psrc->fipo);
+ switch (co->cln) {
+ case 12: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[113], psrc->fipo);
+ } break;
+ case 42: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[221], psrc->fipo);
+ } break;
+ case 43: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[222], psrc->fipo);
+ } break;
+ }
+ } else {
+ if((co->notebookStyle) & DKCT_GUI_NB_LEFT) {
+ switch (co->cln) {
+ case 12: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[114], psrc->fipo);
+ } break;
+ case 42: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[223], psrc->fipo);
+ } break;
+ case 43: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[224], psrc->fipo);
+ } break;
+ }
+ } else {
+ if((co->notebookStyle) & DKCT_GUI_NB_RIGHT) {
+ switch (co->cln) {
+ case 12: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[115], psrc->fipo);
+ } break;
+ case 42: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[225], psrc->fipo);
+ } break;
+ case 43: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[226], psrc->fipo);
+ } break;
+ }
+ } else {
+ if((co->notebookStyle) & DKCT_GUI_NB_BOTTOM) {
+ switch (co->cln) {
+ case 12: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[116], psrc->fipo);
+ } break;
+ case 42: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[227], psrc->fipo);
+ } break;
+ case 43: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[228], psrc->fipo);
+ } break;
+ }
+ }
+ }
+ }
}
- if((co->notebookStyle) & DKCT_GUI_NB_FLAT) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[120], psrc->fipo);
+ if (12 == co->cln) {
+ if((co->notebookStyle) & DKCT_GUI_NB_FIXEDWIDTH) {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[117], psrc->fipo);
+ }
+ if((co->notebookStyle) & DKCT_GUI_NB_MULTILINE) {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[118], psrc->fipo);
+ }
+ if((co->notebookStyle) & DKCT_GUI_NB_NOPAGETHEME) {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[119], psrc->fipo);
+ }
+ if((co->notebookStyle) & DKCT_GUI_NB_FLAT) {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[120], psrc->fipo);
+ }
}
if(!(fe)) { fputs(dkct_gui_out_kw[52], psrc->fipo); }
}
@@ -6788,7 +7170,7 @@ static
void
dkct_gui_constructor_scrolledwindow(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6796,6 +7178,7 @@ dkct_gui_constructor_scrolledwindow(
{
int det = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->direction != DKCT_GUI_DIRECTION_BOTH) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -6838,7 +7221,7 @@ static
void
dkct_gui_constructor_splitterwindow(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6847,6 +7230,7 @@ dkct_gui_constructor_splitterwindow(
int det = 0; /* Details level. */
int fe = 0; /* Flag: Found an element. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->splitterStyle != DKCT_GUI_SPLITTERW_3D) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -6916,7 +7300,7 @@ static
void
dkct_gui_constructor_button(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6925,6 +7309,7 @@ dkct_gui_constructor_button(
int det = 0; /* Details level. */
int fe = 0; /* Flag: Found an entry. */
+ DK3_UNUSED_ARG(dp)
if(co->text) det = 1;
if((co->sizex > 0) && (co->sizey > 0)) det = 2;
if(co->buttonStyle) det = 3;
@@ -6998,7 +7383,7 @@ static
void
dkct_gui_constructor_bitmapbutton(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7007,6 +7392,7 @@ dkct_gui_constructor_bitmapbutton(
int det = 0; /* Details level. */
int fe = 0; /* Flag: Found entry. */
+ DK3_UNUSED_ARG(dp)
if(co->bitmapVarName) {
det = 1;
if((co->sizex > 0) && (co->sizey > 0)) det = 2;
@@ -7073,7 +7459,7 @@ static
void
dkct_gui_constructor_choice_combo(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui,
@@ -7082,6 +7468,7 @@ dkct_gui_constructor_choice_combo(
{
char bu[64]; /* Buffer for integer values. */
int details = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
/*
parent, id, pos, size (1) , n (2), texts (3), validator (4)
parent, id, text, pos, size (1), n (2), texts (3), validator (4)
@@ -7143,7 +7530,7 @@ static
void
dkct_gui_constructor_checkbox(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7151,6 +7538,7 @@ dkct_gui_constructor_checkbox(
{
int need_full_arguments = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if(co->text) need_full_arguments = 1;
if((co->sizex > 0) && (co->sizey > 0)) { need_full_arguments = 2; }
if(co->nStates == 0x03) {
@@ -7215,7 +7603,7 @@ static
void
dkct_gui_constructor_listbox(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7223,6 +7611,7 @@ dkct_gui_constructor_listbox(
{
char bu[64]; /* Buffer for numeric values. */
+ DK3_UNUSED_ARG(dp)
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
dkct_gui_next_argument(psrc);
@@ -7298,7 +7687,7 @@ static
void
dkct_gui_constructor_radiobox(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7311,6 +7700,7 @@ dkct_gui_constructor_radiobox(
int det = 0; /* Details level. */
char bu[64]; /* Buffer for numeric values. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if((co->nChoices > 0) || (co->nChoices == -1)) det = 2;
if(co->choices) det = 3;
@@ -7384,7 +7774,7 @@ static
void
dkct_gui_constructor_radiobutton(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7392,6 +7782,7 @@ dkct_gui_constructor_radiobutton(
{
int det = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->startGroup) det = 2;
if(co->validator) det = 3;
@@ -7439,7 +7830,7 @@ static
void
dkct_gui_constructor_scrollbar(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7447,6 +7838,7 @@ dkct_gui_constructor_scrollbar(
{
int must_write_details = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
dkct_gui_next_argument(psrc);
@@ -7495,7 +7887,7 @@ static
void
dkct_gui_constructor_spinbutton(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7503,6 +7895,7 @@ dkct_gui_constructor_spinbutton(
{
int need_details = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if(co->sizex > 0) { need_details = 1; }
if(co->sizey > 0) { need_details = 1; }
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) { need_details = 2; }
@@ -7548,7 +7941,7 @@ static
void
dkct_gui_constructor_spincontrol(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7557,6 +7950,7 @@ dkct_gui_constructor_spincontrol(
char bu[64]; /* Buffer for numeric values. */
int need_details = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if(co->text) { need_details = 1; }
if((co->sizex > 0) && (co->sizey > 0)) { need_details = 2; }
if(co->useKeys) { need_details = 3; }
@@ -7646,7 +8040,7 @@ static
void
dkct_gui_constructor_slider(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7656,6 +8050,7 @@ dkct_gui_constructor_slider(
/*
parent, id, value, min, max, pos, size (1), style (2), validator (3)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->sliderStyle) det = 2;
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) det = 2;
@@ -7676,6 +8071,7 @@ dkct_gui_constructor_slider(
dkct_gui_next_argument(psrc);
dkct_gui_write_size(psrc, co->sizex, co->sizey, 0, co);
if(det > 1) {
+ dkct_gui_next_argument(psrc);
if(co->direction == DKCT_GUI_DIRECTION_HORIZONTAL) {
fputs(dkct_gui_out_kw[103], psrc->fipo);
} else {
@@ -7727,7 +8123,7 @@ static
void
dkct_gui_constructor_textctrl(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7738,6 +8134,7 @@ dkct_gui_constructor_textctrl(
/*
parent, id, value (1), pos, size (2), style (3), validator (4)
*/
+ DK3_UNUSED_ARG(dp)
if(co->text) det = 1;
if((co->sizex > 0) && (co->sizey > 0)) det = 2;
if(co->textStyle) det = 3;
@@ -7848,7 +8245,7 @@ static
void
dkct_gui_constructor_togglebutton(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7858,6 +8255,7 @@ dkct_gui_constructor_togglebutton(
/*
parent, id, label, pos, size (1), style (2), validator (3)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->validator) det = 3;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -7899,7 +8297,7 @@ static
void
dkct_gui_constructor_gauge(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7910,6 +8308,7 @@ dkct_gui_constructor_gauge(
/*
parent, id, range, pos, size (1), style (2), validator (3)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) det = 2;
if(co->gaugeStyle) det = 2;
@@ -7958,7 +8357,7 @@ static
void
dkct_gui_constructor_statictext(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7970,6 +8369,7 @@ dkct_gui_constructor_statictext(
/*
parent, id, label, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
mask = DKCT_GUI_TEXT_LEFT;
mask |= DKCT_GUI_TEXT_CENTRE;
@@ -8028,7 +8428,7 @@ static
void
dkct_gui_constructor_staticbitmap(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8038,6 +8438,7 @@ dkct_gui_constructor_staticbitmap(
/*
parent, id, bitmap, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->bitmapVarName) {
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -8072,7 +8473,7 @@ static
void
dkct_gui_constructor_staticline(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8082,6 +8483,7 @@ dkct_gui_constructor_staticline(
/*
parent, id, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -8118,7 +8520,7 @@ static
void
dkct_gui_constructor_staticbox(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT *DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8128,11 +8530,18 @@ dkct_gui_constructor_staticbox(
/*
parent, id, label, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
dkct_gui_next_argument(psrc);
dkct_gui_write_idname(co, psrc);
+ dkct_gui_next_argument(psrc);
+ if (NULL != co->text) {
+ fputs(co->text, psrc->fipo);
+ } else {
+ fputs(dkct_gui_out_kw[73], psrc->fipo);
+ }
if(det) {
dkct_gui_next_argument(psrc);
fputs(dkct_gui_out_kw[74], psrc->fipo);
@@ -8156,16 +8565,21 @@ dkct_gui_constructor_staticbox(
static
void
dkct_gui_constructor_menubar(
- DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
- DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(co),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
+ DKCT_SRC * DK3_SILENCE_ARG_UNUSED(psrc),
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
/*
No constructor arguments.
*/
+ DK3_UNUSED_ARG(co)
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(psrc)
+ DK3_UNUSED_ARG(gui)
}
@@ -8180,16 +8594,21 @@ dkct_gui_constructor_menubar(
static
void
dkct_gui_constructor_menu(
- DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
- DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(co),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
+ DKCT_SRC * DK3_SILENCE_ARG_UNUSED(psrc),
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
/*
No constructor arguments.
*/
+ DK3_UNUSED_ARG(co)
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(psrc)
+ DK3_UNUSED_ARG(gui)
}
@@ -8206,14 +8625,16 @@ void
dkct_gui_constructor_menuitem(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
/*
parent->Append(id, label, helpstring, kind);
*/
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
#if 0
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
@@ -8320,14 +8741,16 @@ void
dkct_gui_constructor_toolbartoolbase(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
/*
id, text, bitmap, disbitmap (1), kind (2), tip (3)
*/
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
fputs(dkct_gui_out_kw[8], psrc->fipo);
if(co->menuItemStyle != DKCT_GUI_MENU_ITEM_SEPARATOR) {
fputs(co->name, psrc->fipo);
@@ -8391,15 +8814,17 @@ void
dkct_gui_constructor_toolbar(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
int det = 0; /* Details level. */
/*
parent, id, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) det = 2;
if(co->toolbarStyle != DKCT_GUI_TOOLBAR_FLAT) det = 2;
@@ -8482,7 +8907,7 @@ static
void
dkct_gui_constructor_grid(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8490,6 +8915,7 @@ dkct_gui_constructor_grid(
{
/* parent, id, pos, size (1), style, name */
int det = 0;
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
@@ -8615,10 +9041,10 @@ static
void
dkct_gui_finalize_after_constructor(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
DKCT_GRID_HEAD *gh = NULL;
@@ -8628,7 +9054,10 @@ dkct_gui_finalize_after_constructor(
int columns= 0;
-#line 8741 "dkct-gui.ctr"
+#line 9029 "dkct-gui.ctr"
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
/*
Jump to end if construction failed.
if(!(object)) {
@@ -8642,7 +9071,7 @@ dkct_gui_finalize_after_constructor(
if((psrc->dkcto).deb) {
-#line 8753 "dkct-gui.ctr"
+#line 9044 "dkct-gui.ctr"
fputs(dkct_tr_get_kw8(24), psrc->fipo);
if((psrc->dkcto).win) {
fputs(dkct_tr_get_kw8(21), psrc->fipo);
@@ -8713,14 +9142,14 @@ dkct_gui_finalize_after_constructor(
}
-#line 8822 "dkct-gui.ctr"
+#line 9113 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[27], psrc->fipo);
fputs(dkct_gui_out_kw[28], psrc->fipo);
/* SUCCESS DEBUG CODE */
if((psrc->dkcto).deb) {
-#line 8827 "dkct-gui.ctr"
+#line 9118 "dkct-gui.ctr"
fputs(dkct_tr_get_kw8(24), psrc->fipo);
if((psrc->dkcto).win) {
fputs(dkct_tr_get_kw8(21), psrc->fipo);
@@ -8795,72 +9224,72 @@ dkct_gui_finalize_after_constructor(
switch(co->cln) {
case 0: {
-#line 8900 "dkct-gui.ctr"
+#line 9191 "dkct-gui.ctr"
} break;
case 1: {
-#line 8902 "dkct-gui.ctr"
+#line 9193 "dkct-gui.ctr"
} break;
case 2: {
-#line 8904 "dkct-gui.ctr"
+#line 9195 "dkct-gui.ctr"
} break;
case 3: {
-#line 8906 "dkct-gui.ctr"
+#line 9197 "dkct-gui.ctr"
} break;
case 4: {
-#line 8908 "dkct-gui.ctr"
+#line 9199 "dkct-gui.ctr"
} break;
case 5: {
-#line 8910 "dkct-gui.ctr"
+#line 9201 "dkct-gui.ctr"
} break;
case 6: {
-#line 8912 "dkct-gui.ctr"
+#line 9203 "dkct-gui.ctr"
} break;
case 7: {
-#line 8914 "dkct-gui.ctr"
+#line 9205 "dkct-gui.ctr"
} break;
case 8: {
-#line 8916 "dkct-gui.ctr"
+#line 9207 "dkct-gui.ctr"
} break;
case 9: {
-#line 8918 "dkct-gui.ctr"
+#line 9209 "dkct-gui.ctr"
} break;
case 10: {
-#line 8920 "dkct-gui.ctr"
+#line 9211 "dkct-gui.ctr"
} break;
case 11: {
-#line 8922 "dkct-gui.ctr"
+#line 9213 "dkct-gui.ctr"
} break;
case 12: {
-#line 8924 "dkct-gui.ctr"
+#line 9215 "dkct-gui.ctr"
} break;
- case 13: {
+ case 13: case 47: {
-#line 8926 "dkct-gui.ctr"
+#line 9217 "dkct-gui.ctr"
/* Set size */
} break;
case 14: {
-#line 8929 "dkct-gui.ctr"
+#line 9220 "dkct-gui.ctr"
} break;
case 15: {
-#line 8931 "dkct-gui.ctr"
+#line 9222 "dkct-gui.ctr"
} break;
case 16: {
-#line 8933 "dkct-gui.ctr"
+#line 9224 "dkct-gui.ctr"
if(co->bitmapDisabled) {
dkct_gui_write_set_bitmap(co, psrc, 156, co->bitmapDisabled);
}
@@ -8876,15 +9305,15 @@ dkct_gui_finalize_after_constructor(
} break;
case 17: {
-#line 8947 "dkct-gui.ctr"
+#line 9238 "dkct-gui.ctr"
} break;
case 18: {
-#line 8949 "dkct-gui.ctr"
+#line 9240 "dkct-gui.ctr"
} break;
case 19: {
-#line 8951 "dkct-gui.ctr"
+#line 9242 "dkct-gui.ctr"
if(co->state != 0x00) {
fputs(co->name, psrc->fipo);
if(co->nStates == 0x03) {
@@ -8900,90 +9329,90 @@ dkct_gui_finalize_after_constructor(
} break;
case 20: {
-#line 8965 "dkct-gui.ctr"
+#line 9256 "dkct-gui.ctr"
} break;
case 21: {
-#line 8967 "dkct-gui.ctr"
+#line 9258 "dkct-gui.ctr"
} break;
case 22: {
-#line 8969 "dkct-gui.ctr"
+#line 9260 "dkct-gui.ctr"
} break;
case 23: {
-#line 8971 "dkct-gui.ctr"
+#line 9262 "dkct-gui.ctr"
} break;
case 24: {
-#line 8973 "dkct-gui.ctr"
+#line 9264 "dkct-gui.ctr"
} break;
case 25: {
-#line 8975 "dkct-gui.ctr"
+#line 9266 "dkct-gui.ctr"
} break;
case 26: {
-#line 8977 "dkct-gui.ctr"
+#line 9268 "dkct-gui.ctr"
} break;
case 27: {
-#line 8979 "dkct-gui.ctr"
+#line 9270 "dkct-gui.ctr"
} break;
case 28: {
-#line 8981 "dkct-gui.ctr"
+#line 9272 "dkct-gui.ctr"
} break;
case 29: {
-#line 8983 "dkct-gui.ctr"
+#line 9274 "dkct-gui.ctr"
} break;
case 30: {
-#line 8985 "dkct-gui.ctr"
+#line 9276 "dkct-gui.ctr"
} break;
case 31: {
-#line 8987 "dkct-gui.ctr"
+#line 9278 "dkct-gui.ctr"
} break;
case 32: {
-#line 8989 "dkct-gui.ctr"
+#line 9280 "dkct-gui.ctr"
} break;
case 33: {
-#line 8991 "dkct-gui.ctr"
+#line 9282 "dkct-gui.ctr"
} break;
case 34: {
-#line 8993 "dkct-gui.ctr"
+#line 9284 "dkct-gui.ctr"
} break;
case 35: {
-#line 8995 "dkct-gui.ctr"
+#line 9286 "dkct-gui.ctr"
} break;
case 36: {
-#line 8997 "dkct-gui.ctr"
+#line 9288 "dkct-gui.ctr"
} break;
case 37: {
-#line 8999 "dkct-gui.ctr"
+#line 9290 "dkct-gui.ctr"
} break;
case 38: {
-#line 9001 "dkct-gui.ctr"
+#line 9292 "dkct-gui.ctr"
} break;
case 39: {
-#line 9003 "dkct-gui.ctr"
+#line 9294 "dkct-gui.ctr"
} break;
case 41: {
-#line 9005 "dkct-gui.ctr"
+#line 9296 "dkct-gui.ctr"
if(co->gridTable) {
-#line 9006 "dkct-gui.ctr"
+#line 9297 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[8], psrc->fipo);
fputs(co->name, psrc->fipo);
fputs(dkct_gui_out_kw[198], psrc->fipo);
@@ -8996,7 +9425,7 @@ dkct_gui_finalize_after_constructor(
fputs(dkct_gui_out_kw[0], psrc->fipo);
} else {
-#line 9017 "dkct-gui.ctr"
+#line 9308 "dkct-gui.ctr"
#if VERSION_BEFORE_20150821
rows = columns = 0;
#endif
@@ -9096,6 +9525,26 @@ dkct_gui_finalize_after_constructor(
fputs(dkct_gui_out_kw[0], psrc->fipo);
}
} break;
+ case 42: {
+
+#line 9408 "dkct-gui.ctr"
+ } break;
+ case 43: {
+
+#line 9410 "dkct-gui.ctr"
+ } break;
+ case 44: {
+
+#line 9412 "dkct-gui.ctr"
+ } break;
+ case 45: {
+
+#line 9414 "dkct-gui.ctr"
+ } break;
+ case 46: {
+
+#line 9416 "dkct-gui.ctr"
+ } break;
}
/*
Minimal size, if any.
@@ -9110,7 +9559,7 @@ dkct_gui_finalize_after_constructor(
}
-#line 9129 "dkct-gui.ctr"
+#line 9430 "dkct-gui.ctr"
}
@@ -9127,13 +9576,14 @@ static
void
dkct_gui_constructor_constructor(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui,
int comma
)
{
+ DK3_UNUSED_ARG(dp)
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
fputs(dkct_gui_out_kw[209], psrc->fipo);
@@ -9170,7 +9620,7 @@ dkct_gui_write_element_constructor(
{
-#line 9187 "dkct-gui.ctr"
+#line 9489 "dkct-gui.ctr"
/*
Write tests to check constructor prerequisitions.
*/
@@ -9185,7 +9635,7 @@ dkct_gui_write_element_constructor(
if(co->bitmapVarName) {
-#line 9200 "dkct-gui.ctr"
+#line 9502 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[25], psrc->fipo);
fputs(co->bitmapVarName, psrc->fipo);
fputs(dkct_gui_out_kw[26], psrc->fipo);
@@ -9203,18 +9653,21 @@ dkct_gui_write_element_constructor(
case 37: {
if(dp) {
if(dp->cln == 36) {
- if(co->text) {
+ if((NULL != co->text) || (0 != dkct_gui_is_stock_element(co))) {
dkct_gui_constructor_menuitem(co, dp, pw, psrc, gui);
if(co->menuItemStyle != DKCT_GUI_MENU_ITEM_SEPARATOR) {
dkct_gui_finalize_after_constructor(co, dp, pw, psrc, gui);
}
} else {
/* ERROR: No text specified */
+
+
+#line 9527 "dkct-gui.ctr"
dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 49);
}
} else {
-#line 9227 "dkct-gui.ctr"
+#line 9530 "dkct-gui.ctr"
/* ERROR: Parent is not a menu */
dkct_gui_report_illegal_parent_child(co, dp, gui->psrc);
}
@@ -9235,6 +9688,9 @@ dkct_gui_write_element_constructor(
}
} else {
/* ERROR: No text */
+
+
+#line 9551 "dkct-gui.ctr"
dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 49);
}
} else {
@@ -9247,7 +9703,7 @@ dkct_gui_write_element_constructor(
}
} else {
-#line 9258 "dkct-gui.ctr"
+#line 9562 "dkct-gui.ctr"
/* ERROR: Parent is not a toolbar */
dkct_gui_report_illegal_parent_child(co, dp, gui->psrc);
}
@@ -9279,192 +9735,192 @@ dkct_gui_write_element_constructor(
switch(co->cln) {
case 0: {
-#line 9288 "dkct-gui.ctr"
+#line 9592 "dkct-gui.ctr"
dkct_gui_constructor_frame_dialog(co,dp,pw,psrc,gui);
} break;
case 1: {
-#line 9291 "dkct-gui.ctr"
+#line 9595 "dkct-gui.ctr"
dkct_gui_constructor_frame_dialog(co,dp,pw,psrc,gui);
} break;
case 2: {
-#line 9294 "dkct-gui.ctr"
+#line 9598 "dkct-gui.ctr"
dkct_gui_constructor_frame_dialog(co,dp,pw,psrc,gui);
} break;
case 3: {
-#line 9297 "dkct-gui.ctr"
+#line 9601 "dkct-gui.ctr"
dkct_gui_constructor_frame_dialog(co,dp,pw,psrc,gui);
} break;
case 4: {
-#line 9300 "dkct-gui.ctr"
+#line 9604 "dkct-gui.ctr"
} break;
case 5: {
-#line 9302 "dkct-gui.ctr"
+#line 9606 "dkct-gui.ctr"
dkct_gui_constructor_boxsizer(co, dp, pw, psrc, gui);
} break;
case 6: {
-#line 9305 "dkct-gui.ctr"
+#line 9609 "dkct-gui.ctr"
dkct_gui_constructor_gridsizer(co,dp,pw,psrc,gui);
} break;
case 7: {
-#line 9308 "dkct-gui.ctr"
+#line 9612 "dkct-gui.ctr"
dkct_gui_constructor_gridbagsizer(co,dp,pw,psrc,gui);
} break;
case 8: {
-#line 9311 "dkct-gui.ctr"
+#line 9615 "dkct-gui.ctr"
dkct_gui_constructor_gridsizer(co,dp,pw,psrc,gui);
} break;
case 9: {
-#line 9314 "dkct-gui.ctr"
+#line 9618 "dkct-gui.ctr"
dkct_gui_constructor_staticboxsizer(co,dp,pw,psrc,gui);
} break;
case 10: {
-#line 9317 "dkct-gui.ctr"
+#line 9621 "dkct-gui.ctr"
/* No constructor arguments at all. */
} break;
case 11: {
-#line 9320 "dkct-gui.ctr"
+#line 9624 "dkct-gui.ctr"
dkct_gui_constructor_panel(co, dp, pw, psrc, gui);
} break;
case 12: {
-#line 9323 "dkct-gui.ctr"
+#line 9627 "dkct-gui.ctr"
dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
} break;
- case 13: {
+ case 13: case 47 : {
-#line 9326 "dkct-gui.ctr"
+#line 9630 "dkct-gui.ctr"
dkct_gui_constructor_scrolledwindow(co, dp, pw, psrc, gui);
} break;
case 14: {
-#line 9329 "dkct-gui.ctr"
+#line 9633 "dkct-gui.ctr"
dkct_gui_constructor_splitterwindow(co, dp, pw, psrc, gui);
} break;
case 15: {
-#line 9332 "dkct-gui.ctr"
+#line 9636 "dkct-gui.ctr"
dkct_gui_constructor_button(co, dp, pw, psrc, gui);
} break;
case 16: {
-#line 9335 "dkct-gui.ctr"
+#line 9639 "dkct-gui.ctr"
dkct_gui_constructor_bitmapbutton(co, dp, pw, psrc, gui);
} break;
case 17: {
-#line 9338 "dkct-gui.ctr"
+#line 9642 "dkct-gui.ctr"
dkct_gui_constructor_choice_combo(co, dp, pw, psrc, gui, 0);
} break;
case 18: {
-#line 9341 "dkct-gui.ctr"
+#line 9645 "dkct-gui.ctr"
dkct_gui_constructor_choice_combo(co, dp, pw, psrc, gui, 1);
} break;
case 19: {
-#line 9344 "dkct-gui.ctr"
+#line 9648 "dkct-gui.ctr"
dkct_gui_constructor_checkbox(co, dp, pw, psrc, gui);
} break;
case 20: {
-#line 9347 "dkct-gui.ctr"
+#line 9651 "dkct-gui.ctr"
dkct_gui_constructor_listbox(co, dp, pw, psrc, gui);
} break;
case 21: {
-#line 9350 "dkct-gui.ctr"
+#line 9654 "dkct-gui.ctr"
dkct_gui_constructor_checklistbox(co, dp, pw, psrc, gui);
} break;
case 22: {
-#line 9353 "dkct-gui.ctr"
+#line 9657 "dkct-gui.ctr"
dkct_gui_constructor_radiobox(co, dp, pw, psrc, gui);
} break;
case 23: {
-#line 9356 "dkct-gui.ctr"
+#line 9660 "dkct-gui.ctr"
dkct_gui_constructor_radiobutton(co, dp, pw, psrc, gui);
} break;
case 24: {
-#line 9359 "dkct-gui.ctr"
+#line 9663 "dkct-gui.ctr"
dkct_gui_constructor_scrollbar(co, dp, pw, psrc, gui);
} break;
case 25: {
-#line 9362 "dkct-gui.ctr"
+#line 9666 "dkct-gui.ctr"
dkct_gui_constructor_spinbutton(co, dp, pw, psrc, gui);
} break;
case 26: {
-#line 9365 "dkct-gui.ctr"
+#line 9669 "dkct-gui.ctr"
dkct_gui_constructor_spincontrol(co, dp, pw, psrc, gui);
} break;
case 27: {
-#line 9368 "dkct-gui.ctr"
+#line 9672 "dkct-gui.ctr"
dkct_gui_constructor_slider(co, dp, pw, psrc, gui);
} break;
case 28: {
-#line 9371 "dkct-gui.ctr"
+#line 9675 "dkct-gui.ctr"
dkct_gui_constructor_textctrl(co, dp, pw, psrc, gui);
} break;
case 29: {
-#line 9374 "dkct-gui.ctr"
+#line 9678 "dkct-gui.ctr"
dkct_gui_constructor_togglebutton(co, dp, pw, psrc, gui);
} break;
case 30: {
-#line 9377 "dkct-gui.ctr"
+#line 9681 "dkct-gui.ctr"
dkct_gui_constructor_gauge(co, dp, pw, psrc, gui);
} break;
case 31: {
-#line 9380 "dkct-gui.ctr"
+#line 9684 "dkct-gui.ctr"
dkct_gui_constructor_statictext(co, dp, pw, psrc, gui);
} break;
case 32: {
-#line 9383 "dkct-gui.ctr"
+#line 9687 "dkct-gui.ctr"
dkct_gui_constructor_staticbitmap(co, dp, pw, psrc, gui);
} break;
case 33: {
-#line 9386 "dkct-gui.ctr"
+#line 9690 "dkct-gui.ctr"
dkct_gui_constructor_staticline(co, dp, pw, psrc, gui);
} break;
case 34: {
-#line 9389 "dkct-gui.ctr"
+#line 9693 "dkct-gui.ctr"
dkct_gui_constructor_staticbox(co, dp, pw, psrc, gui);
} break;
case 35: {
-#line 9392 "dkct-gui.ctr"
+#line 9696 "dkct-gui.ctr"
dkct_gui_constructor_menubar(co, dp, pw, psrc, gui);
} break;
case 36: {
-#line 9395 "dkct-gui.ctr"
+#line 9699 "dkct-gui.ctr"
dkct_gui_constructor_menu(co, dp, pw, psrc, gui);
} break;
#if 0
case 37: {
-#line 9399 "dkct-gui.ctr"
+#line 9703 "dkct-gui.ctr"
/*
Never happens.
*/
@@ -9472,16 +9928,43 @@ dkct_gui_write_element_constructor(
#endif
case 38: {
-#line 9405 "dkct-gui.ctr"
+#line 9709 "dkct-gui.ctr"
dkct_gui_constructor_toolbar(co, dp, pw, psrc, gui);
} break;
case 39: {
-#line 9408 "dkct-gui.ctr"
+#line 9712 "dkct-gui.ctr"
} break;
- case 41: {
+ case 41: {
+
+#line 9714 "dkct-gui.ctr"
dkct_gui_constructor_grid(co, dp, pw, psrc, gui);
} break;
+ case 42: {
+
+#line 9717 "dkct-gui.ctr"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
+ case 43: {
+
+#line 9720 "dkct-gui.ctr"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
+ case 44: {
+
+#line 9723 "dkct-gui.ctr"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
+ case 45: {
+
+#line 9726 "dkct-gui.ctr"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
+ case 46: {
+
+#line 9729 "dkct-gui.ctr"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
default: {
if(!(co->compConst)) {
dkct_gui_constructor_constructor(co,dp,pw,psrc,gui,0);
@@ -9495,7 +9978,7 @@ dkct_gui_write_element_constructor(
}
-#line 9424 "dkct-gui.ctr"
+#line 9743 "dkct-gui.ctr"
}
@@ -9512,7 +9995,7 @@ void
dkct_gui_add_pseudo_object(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
DKCT_GUI *gui
)
@@ -9520,14 +10003,15 @@ dkct_gui_add_pseudo_object(
char bu[256]; /* Buffer for numeric values. */
-#line 9447 "dkct-gui.ctr"
+#line 9766 "dkct-gui.ctr"
+ DK3_UNUSED_ARG(pw)
if(dp) {
switch(dp->cln) {
case 7: { /* gridbag sizer */
switch(co->pseudoobj) {
case 1: case 2: {
-#line 9452 "dkct-gui.ctr"
+#line 9772 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[8], psrc->fipo);
if(dp->name) {
fputs(dp->name, psrc->fipo);
@@ -9573,7 +10057,7 @@ dkct_gui_add_pseudo_object(
switch(co->pseudoobj) {
case 1: case 2: {
-#line 9496 "dkct-gui.ctr"
+#line 9816 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[8], psrc->fipo);
if(dp->name) {
fputs(dp->name, psrc->fipo);
@@ -9640,7 +10124,7 @@ dkct_gui_add_pseudo_object(
}
-#line 9561 "dkct-gui.ctr"
+#line 9881 "dkct-gui.ctr"
}
@@ -9740,7 +10224,7 @@ dkct_gui_finish_current_element(
{
-#line 9659 "dkct-gui.ctr"
+#line 9979 "dkct-gui.ctr"
/*
Class-dependant finish.
*/
@@ -9749,7 +10233,7 @@ dkct_gui_finish_current_element(
case 38: /* toolbar */
{
-#line 9666 "dkct-gui.ctr"
+#line 9986 "dkct-gui.ctr"
/*
Call ->Realize() for the standard diaglog button sizer.
*/
@@ -9759,7 +10243,7 @@ dkct_gui_finish_current_element(
} break;
case 14: {
-#line 9674 "dkct-gui.ctr"
+#line 9994 "dkct-gui.ctr"
/*
Set wxSplitterWindow children and sash.
*/
@@ -9786,7 +10270,7 @@ dkct_gui_finish_current_element(
}
if(co->tipText) {
-#line 9699 "dkct-gui.ctr"
+#line 10019 "dkct-gui.ctr"
switch(co->cln) {
case 36: /* wxMenu */
case 37: /* wxMenuItem */
@@ -9796,7 +10280,7 @@ dkct_gui_finish_current_element(
} break;
default: {
-#line 9707 "dkct-gui.ctr"
+#line 10027 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[8], psrc->fipo);
if ((NULL != co->ttflag) || (NULL != gui->ttflag)) {
fputs(dkct_gui_out_kw[218], psrc->fipo);
@@ -9868,7 +10352,7 @@ dkct_gui_finish_current_element(
}
-#line 9777 "dkct-gui.ctr"
+#line 10097 "dkct-gui.ctr"
}
@@ -9912,7 +10396,7 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
int pcln; /* Parent class name. */
-#line 9819 "dkct-gui.ctr"
+#line 10139 "dkct-gui.ctr"
fnptr = dkct_tr_get_kw8(((psrc->dkcto).deb == 2) ? 28 : 29);
co = gui->r_el;
if(co->cln != 1) {
@@ -9926,7 +10410,7 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
if((psrc->dkcto).deb) {
-#line 9831 "dkct-gui.ctr"
+#line 10151 "dkct-gui.ctr"
fputs(dkct_tr_get_kw8(24), psrc->fipo);
if((psrc->dkcto).win) {
fputs(dkct_tr_get_kw8(21), psrc->fipo);
@@ -9996,7 +10480,7 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
if((psrc->dkcto).deb) {
-#line 9899 "dkct-gui.ctr"
+#line 10219 "dkct-gui.ctr"
fputs(dkct_tr_get_kw8(24), psrc->fipo);
if((psrc->dkcto).win) {
fputs(dkct_tr_get_kw8(21), psrc->fipo);
@@ -10065,7 +10549,7 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
dk3sto_it_reset(co->i_contents);
while(co) {
-#line 9966 "dkct-gui.ctr"
+#line 10286 "dkct-gui.ctr"
psrc->lineno = ((co->lndef) > 0UL) ? (co->lndef) : (co->lndecl);
dk3app_set_source_line(psrc->app, psrc->lineno);
dp = pw = (DKCT_GUI_ELEMENT *)(co->parent);
@@ -10086,27 +10570,27 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
if(dkct_gui_need_element_constructor(co)) {
-#line 9985 "dkct-gui.ctr"
+#line 10305 "dkct-gui.ctr"
dkct_gui_write_element_constructor(co, dp, pw, psrc, gui);
}
}
dk3sto_it_reset(co->i_contents);
if(co->menubar) {
-#line 9990 "dkct-gui.ctr"
+#line 10310 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[19], psrc->fipo);
co->prost = DKCT_GUI_PROCESSING_STATE_MENU;
co = (DKCT_GUI_ELEMENT *)(co->menubar);
} else {
if(co->toolbar) {
-#line 9995 "dkct-gui.ctr"
+#line 10315 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[20], psrc->fipo);
co->prost = DKCT_GUI_PROCESSING_STATE_TOOL;
co = (DKCT_GUI_ELEMENT *)(co->toolbar);
} else {
-#line 9999 "dkct-gui.ctr"
+#line 10319 "dkct-gui.ctr"
co->prost = DKCT_GUI_PROCESSING_STATE_CONTENTS;
}
}
@@ -10119,13 +10603,13 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
fputs(dkct_gui_out_kw[22], psrc->fipo);
if(co->toolbar) {
-#line 10010 "dkct-gui.ctr"
+#line 10330 "dkct-gui.ctr"
fputs(dkct_gui_out_kw[20], psrc->fipo);
co->prost = DKCT_GUI_PROCESSING_STATE_TOOL;
co = (DKCT_GUI_ELEMENT *)(co->toolbar);
} else {
-#line 10014 "dkct-gui.ctr"
+#line 10334 "dkct-gui.ctr"
co->prost = DKCT_GUI_PROCESSING_STATE_CONTENTS;
}
} break;
@@ -10136,21 +10620,21 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
fputs(dkct_gui_out_kw[22], psrc->fipo);
co->prost = DKCT_GUI_PROCESSING_STATE_CONTENTS;
-#line 10023 "dkct-gui.ctr"
+#line 10343 "dkct-gui.ctr"
} break;
case DKCT_GUI_PROCESSING_STATE_CONTENTS: {
-#line 10025 "dkct-gui.ctr"
+#line 10345 "dkct-gui.ctr"
ne = (DKCT_GUI_ELEMENT *)dk3sto_it_next(co->i_contents);
-#line 10026 "dkct-gui.ctr"
+#line 10346 "dkct-gui.ctr"
if(ne) {
-#line 10027 "dkct-gui.ctr"
+#line 10347 "dkct-gui.ctr"
co = ne;
} else {
-#line 10029 "dkct-gui.ctr"
+#line 10349 "dkct-gui.ctr"
co->prost = DKCT_GUI_PROCESSING_STATE_DONE;
/*
Finish current element.
@@ -10216,6 +10700,9 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
default: {
pcln = -1;
if(dp) { pcln = dp->cln; }
+
+
+#line 10415 "dkct-gui.ctr"
switch(pcln) {
case 35: { /* Appending to a menu bar. */
switch(co->cln) {
@@ -10317,6 +10804,26 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
the splitter window.
*/
} break;
+ case 12: case 42: case 43: case 44: case 45: case 46: {
+ /* Parent is wxNotebook */
+ if (
+ (NULL != co->name) && (NULL != dp->name)
+ && (NULL != co->text))
+ {
+ fputs(dkct_gui_out_kw[8], psrc->fipo);
+ fputs(dp->name, psrc->fipo);
+ fputs(dkct_gui_out_kw[220], psrc->fipo);
+ fputs(co->name, psrc->fipo);
+ fputs(dkct_gui_out_kw[55], psrc->fipo);
+ fputs(co->text, psrc->fipo);
+ fputs(dkct_gui_out_kw[24], psrc->fipo);
+ fputs(dkct_gui_out_kw[0], psrc->fipo);
+ }
+ else {
+ /* ERROR: Missing text */
+ dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 124);
+ }
+ } break;
default: {
if((co->number) && (co->parent)) {
char const *pname;
@@ -10344,7 +10851,45 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
}
}
-#line 10221 "dkct-gui.ctr"
+#line 10562 "dkct-gui.ctr"
+}
+
+
+
+/** Complain if an element is not in the contents of a parent object.
+ @param psrc Source structure.
+ @param el Element to complain about.
+*/
+static
+void
+complain_about_missing_parent(
+ DKCT_SRC *gpsrc, DKCT_SRC *psrc, DKCT_GUI_ELEMENT *el
+)
+{
+ DKCT_SRC *xpsrc;
+ unsigned long oldlineno;
+ int must_complain;
+
+
+
+#line 10581 "dkct-gui.ctr"
+ /*
+ Check element el whether complaint is really necessary
+ */
+ must_complain = 1;
+ /*
+ Write warning
+ */
+ xpsrc = ((NULL != gpsrc) ? (gpsrc) : (psrc));
+ if ((0 != must_complain) && (NULL != xpsrc)) {
+ oldlineno = xpsrc->lineno;
+ xpsrc->lineno = el->lndef;
+ dkct_to_log_3(xpsrc, 1, DK3_LL_WARNING, 126, 127, el->name);
+ xpsrc->lineno = oldlineno;
+ }
+
+
+#line 10596 "dkct-gui.ctr"
}
@@ -10384,6 +10929,9 @@ dkct_gui_write_constructor(DKCT_SRC *psrc)
fputs(dkct_gui_out_kw[8], psrc->fipo);
fputs(el->name, psrc->fipo);
fputs(dkct_gui_out_kw[14], psrc->fipo);
+ if (NULL == el->parent) {
+ complain_about_missing_parent(gui->psrc, psrc, el);
+ }
}
}
}
@@ -10398,10 +10946,10 @@ dkct_gui_write_constructor(DKCT_SRC *psrc)
el = gui->r_el;
if(el) {
-#line 10273 "dkct-gui.ctr"
+#line 10651 "dkct-gui.ctr"
w = el->sizex; h = el->sizey;
-#line 10274 "dkct-gui.ctr"
+#line 10652 "dkct-gui.ctr"
}
fputs(dkct_gui_out_kw[8], psrc->fipo);
fputs(dkct_gui_out_kw[10], psrc->fipo);
diff --git a/support/dktools/dkct-gui.ctr b/support/dktools/dkct-gui.ctr
index bcf1a8ba6c..4436cb73cf 100644
--- a/support/dktools/dkct-gui.ctr
+++ b/support/dktools/dkct-gui.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -592,12 +592,18 @@ dkct_gui_write_constructor(DKCT_SRC *psrc);
%% module
+#include "dk4conf.h"
+
#if DK3_USE_WX
#include "dkwxtrace.h"
#else
#include "dkct.h"
#endif
+#include "dk3unused.h"
+
+
+
$!trace-include
@@ -647,6 +653,12 @@ static char const * const dkct_gui_class_names[] = {
/* 39 */ "wxStatusBar",
/* 40 */ "wxToolBarToolBase", /* Not a wxWidgets class! */
/* 41 */ "wxGrid",
+/* 42 */ "wxChoicebook",
+/* 43 */ "wxListbook",
+/* 44 */ "wxSimplebook",
+/* 45 */ "wxToolbook",
+/* 46 */ "wxTreebook",
+/* 47 */ "wxScrolled<wxPanel>",
NULL
};
@@ -1171,6 +1183,15 @@ char const * const dkct_gui_out_kw[] = {
/* 217 */ "->SetColLabelSize(wxGRID_AUTOSIZE",
/* 218 */ "if(",
/* 219 */ ") { ",
+/* 220 */ "->AddPage(",
+/* 221 */ "wxCHB_TOP",
+/* 222 */ "wxLB_TOP",
+/* 223 */ "wxCHB_LEFT",
+/* 224 */ "wxLB_LEFT",
+/* 225 */ "wxCHB_RIGHT",
+/* 226 */ "wxLB_RIGHT",
+/* 227 */ "wxCHB_BOTTOM",
+/* 228 */ "wxLB_BOTTOM",
NULL
};
@@ -1187,6 +1208,87 @@ NULL
+/** IDs for stock buttons and menu items.
+*/
+static char const * const dkct_gui_stock_item_names[] = {
+$!string-table
+wxID_ABOUT
+wxID_ADD
+wxID_APPLY
+wxID_BACKWARD
+wxID_BOLD
+wxID_BOTTOM
+wxID_CANCEL
+wxID_CDROM
+wxID_CLEAR
+wxID_CLOSE
+wxID_CONVERT
+wxID_COPY
+wxID_CUT
+wxID_DELETE
+wxID_DOWN
+wxID_EDIT
+wxID_EXECUTE
+wxID_EXIT
+wxID_FILE
+wxID_FIND
+wxID_FIRST
+wxID_FLOPPY
+wxID_FORWARD
+wxID_HARDDISK
+wxID_HELP
+wxID_HOME
+wxID_INDENT
+wxID_INDEX
+wxID_INFO
+wxID_ITALIC
+wxID_JUMP_TO
+wxID_JUSTIFY_CENTER
+wxID_JUSTIFY_FILL
+wxID_JUSTIFY_LEFT
+wxID_JUSTIFY_RIGHT
+wxID_LAST
+wxID_NETWORK
+wxID_NEW
+wxID_NO
+wxID_OK
+wxID_OPEN
+wxID_PASTE
+wxID_PREFERENCES
+wxID_PREVIEW
+wxID_PRINT
+wxID_PROPERTIES
+wxID_REDO
+wxID_REFRESH
+wxID_REMOVE
+wxID_REPLACE
+wxID_REVERT_TO_SAVED
+wxID_SAVE
+wxID_SAVEAS
+wxID_SELECTALL
+wxID_SELECT_COLOR
+wxID_SELECT_FONT
+wxID_SORT_ASCENDING
+wxID_SORT_DESCENDING
+wxID_SPELL_CHECK
+wxID_STOP
+wxID_STRIKETHROUGH
+wxID_TOP
+wxID_UNDELETE
+wxID_UNDERLINE
+wxID_UNDO
+wxID_UNINDENT
+wxID_UP
+wxID_YES
+wxID_ZOOM_100
+wxID_ZOOM_FIT
+wxID_ZOOM_IN
+wxID_ZOOM_OUT
+$!end
+};
+
+
+
/** Delete grid header data.
@param gh Header data to delete.
*/
@@ -1263,12 +1365,13 @@ dkct_grid_cell_new(char const *txt, int r, int c, DKCT_SRC *psrc)
static
int
-dkct_grid_cell_compare(const void *l, const void *r, int cr)
+dkct_grid_cell_compare(const void *l, const void *r, int DK3_ARG_UNUSED(cr) )
{
DKCT_CELL_DATA *pl;
DKCT_CELL_DATA *pr;
int back = 0;
+ DK3_UNUSED_ARG(cr)
if (l) {
if (r) {
pl = (DKCT_CELL_DATA *)l;
@@ -1304,11 +1407,13 @@ dkct_grid_cell_compare(const void *l, const void *r, int cr)
*/
static
int
-dkct_grid_head_compare(void const *l, void const *r, int cr)
+dkct_grid_head_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
DKCT_GRID_HEAD const *pl;
DKCT_GRID_HEAD const *pr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (DKCT_GRID_HEAD const *)l; pr = (DKCT_GRID_HEAD const *)r;
@@ -1818,7 +1923,7 @@ void
dkct_gui_initialize_object_for_class(DKCT_GUI_ELEMENT *el)
{
switch(el->cln) {
- case 13: {
+ case 13: case 47: {
el->direction = DKCT_GUI_DIRECTION_BOTH;
} break;
}
@@ -2351,6 +2456,7 @@ dkct_gui_set_text(DKCT_GUI *gui, char *il)
case 3:
case 4:
case 9:
+ case 11:
case 15:
case 16:
case 19:
@@ -2361,12 +2467,14 @@ dkct_gui_set_text(DKCT_GUI *gui, char *il)
case 28:
case 29:
case 31:
+ case 34:
case 36:
case 37:
case 40:
{
} break;
- default: { $? "! not applicable"
+ default: {
+ $? "! not applicable"
/* Warning: Attribute not applicable for class! */
dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
} break;
@@ -2429,10 +2537,16 @@ dkct_gui_set_tip_text(DKCT_GUI *gui, char *il)
case 28:
case 29:
case 30:
+ case 31:
case 36:
case 37: /* wxMenuItem */
case 39:
case 40:
+ case 42:
+ case 43:
+ case 44:
+ case 45:
+ case 46:
{
} break;
default: { $? "! not applicable"
@@ -2743,15 +2857,22 @@ dkct_gui_add_contents(DKCT_GUI *gui, char *il)
case 12: /* wxNotebook */
case 13: /* wxScrolledWindow */
case 14: /* wxSplitterWindow */
+ case 34: /* wxStaticBox */
case 35: /* wxMenuBar */
case 36: /* wxMenu */
case 38: /* wxToolBar */
case 39: /* wxStatusBar */
+ case 42: /* wxChoicebook */
+ case 43: /* wxListbook */
+ case 44: /* wxSimplebook */
+ case 45: /* wxToolbook */
+ case 46: /* wxTreebook */
+ case 47: /* wxScrolled<wxPanel> */
{
} break;
default: { $? "! not applicable"
/* Warning: Attribute not applicable to this class! */
- dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 56);
+ dkct_to_log_1(gui->psrc, 1, DK3_LL_WARNING, 125);
} break;
}
for(szp = 0; szp < 16; szp++) { p[szp] = NULL; }
@@ -3153,13 +3274,15 @@ dkct_gui_set_direction(DKCT_GUI *gui, char *il)
if(p1) {
dk3str_c8_next(p1, NULL);
switch(el->cln) {
- case 5: /* box sizer */
- case 9: /* static box sizer */
- case 25: /* spin button */
- case 26: /* spin control */
- case 13: /* scrolled window */
- case 30: /* gauge */
- case 33: /* static line */
+ case 5: /* box sizer */
+ case 9: /* static box sizer */
+ case 24: /* scrollbar */
+ case 25: /* spin button */
+ case 26: /* spin control */
+ case 27: /* slider control */
+ case 13: case 47: /* scrolled window */
+ case 30: /* gauge */
+ case 33: /* static line */
{
} break;
default: { $? "! not applicable"
@@ -3177,7 +3300,7 @@ dkct_gui_set_direction(DKCT_GUI *gui, char *il)
back = 1;
} break;
case 2: {
- if(el->cln == 13) {
+ if((el->cln == 13) || (el->cln == 47)) {
el->direction = DKCT_GUI_DIRECTION_BOTH;
back = 1;
} else {
@@ -3641,7 +3764,13 @@ dkct_gui_set_notebook_style(DKCT_GUI *gui, char *il)
el = gui->c_el;
if(el) {
switch(el->cln) {
- case 12: {
+ case 12:
+ case 42: /* 2018-05-29 Further books added */
+ case 43:
+ case 44:
+ case 45:
+ case 46:
+ {
} break;
default: { $? "! not applicable"
/* Warning: Attribute not applicable for class! */
@@ -5020,11 +5149,13 @@ dkct_set_minimum_size(DKCT_GUI *gui, char *pv)
*/
static
int
-dkct_int_compare(void const *l, void const *r, int cr)
+dkct_int_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int const *pl;
int const *pr;
int back = 0;
+
+ DK3_UNUSED_ARG(cr)
pl = (int const *)l; pr = (int const *)r;
if(pl) {
if(pr) {
@@ -5561,6 +5692,25 @@ dkct_gui_report_illegal_parent_child(
+static
+int
+dkct_gui_is_stock_element(DKCT_GUI_ELEMENT *el)
+{
+ int back = 0;
+ $? "+ dkct_gui_is_stock_element"
+ if ((15 == el->cln) || (37 == el->cln)) { $? ". cln = %d", el->cln
+ if (NULL != el->idname) { $? ". idname = \"%s\"", el->idname
+ if (0 < dk3str_c8_array_index(dkct_gui_stock_item_names, el->idname, 1)) {
+ back = 1; $? ". idname in list"
+ }
+ }
+ }
+ $? "- dkct_gui_is_stock_element %d", back
+ return back;
+}
+
+
+
/** Check GUI element setup.
@param el Element to check.
@param psrc Source structure.
@@ -5586,6 +5736,7 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
case 9: case 10: case 11: case 12: case 13: case 14: case 35: case 36:
case 38:
+ case 42: case 43: case 44: case 45: case 46: case 47: /* 2018-05-29 */
{
back = 0;
nco = dkct_gui_get_number_contents(el);
@@ -5621,12 +5772,23 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
|| (el->menuItemStyle != DKCT_GUI_MENU_ITEM_SEPARATOR)
)
{
- if(el->cln == 28) {
- /* ERROR: Missing text! */
+ if((el->cln == 28) || (0 != dkct_gui_is_stock_element(el))) {
+ /* Info: Missing text! */
+ $? ". no text (info)"
+#if 0
+ /* 2018-05-28 Removed
+ Do not issue message about wxTextCtrl, wxMenuItem, wxButton
+ without text.
+ For wxTextCtrl the field is empty, user should type text.
+ For wxMenuItem and wxButton create stock objects if
+ no text present.
+ */
dkct_to_log_1(psrc, 1, DK3_LL_INFO, 49);
+#endif
} else {
back = 0; $? "! missing text"
/* ERROR: Missing text! */
+ $? "! no text, no stock element"
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 49);
}
}
@@ -5703,7 +5865,11 @@ dkct_gui_element_check(DKCT_GUI_ELEMENT *el, DKCT_SRC *psrc)
*/
if(back) {
switch(el->cln) {
- case 12: case 13: case 28: {
+ /*
+ 2018-05-29 Removed case 12 branch
+ Requiring a size is not necessary for a wxNotebook.
+ */
+ case 13: case 47: case 28: {
if(!((el->sizex > 0) && (el->sizey > 0))) { $? "! missing size"
if(el->cln == 28) {
/*
@@ -6284,12 +6450,13 @@ dkct_gui_add_object_to_sizer(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *pa,
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
char bu[64]; /* Buffer for integer values. */
int det = 0; /* Details to use. */
$? "+ dkct_gui_add_object_to_sizer"
+ DK3_UNUSED_ARG(gui)
/*
Last modifications to object before adding it to parent.
*/
@@ -6459,14 +6626,21 @@ dkct_gui_set_parents_sizer(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *pa,
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
char const *pname = NULL; /* Parent object name. */
$? "+ dkct_gui_set_parents_sizer"
+ DK3_UNUSED_ARG(gui)
if(pa) { pname = pa->name; }
if(!(pname)) {
- if(pa->cln != 1) { pname = dkct_gui_out_kw[30]; }
+ if (pa) {
+ if(pa->cln != 1) {
+ pname = dkct_gui_out_kw[30];
+ }
+ } else {
+ pname = dkct_gui_out_kw[30];
+ }
}
fputs(dkct_gui_out_kw[8], psrc->fipo);
if(pname) {
@@ -6550,9 +6724,13 @@ dkct_gui_write_idname(DKCT_GUI_ELEMENT *co, DKCT_SRC *psrc)
*/
static
void
-dkct_gui_write_size(DKCT_SRC *psrc, int w, int h, int rec, DKCT_GUI_ELEMENT *co)
+dkct_gui_write_size(
+ DKCT_SRC *psrc, int w, int h, int rec,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(co)
+)
{
char bu[256];
+ DK3_UNUSED_ARG(co)
if((w > 0) && (h > 0)) {
sprintf(bu, "%d, %d", w, h);
fputs(dkct_gui_out_kw[81], psrc->fipo);
@@ -6575,7 +6753,7 @@ static
void
dkct_gui_constructor_frame_dialog(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6583,6 +6761,7 @@ dkct_gui_constructor_frame_dialog(
{
int det = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if(co->text) det = 1;
if((co->sizex > 0) && (co->sizey > 0)) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -6619,12 +6798,15 @@ static
void
dkct_gui_constructor_boxsizer(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
fputs(dkct_gui_out_kw[2], psrc->fipo);
switch(co->direction) {
case DKCT_GUI_DIRECTION_VERTICAL: {
@@ -6673,10 +6855,10 @@ static
void
dkct_gui_constructor_gridsizer(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
char bu[256]; /* Buffer for integer values. */
@@ -6685,6 +6867,9 @@ dkct_gui_constructor_gridsizer(
int y = 0; /* Start row. */
int x = 0; /* Start column. */
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
c = co->gridcolumns;
r = co->gridrows;
x = co->gridgapx;
@@ -6722,16 +6907,19 @@ static
void
dkct_gui_constructor_gridbagsizer(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
char bu[128]; /* Buffer for integer values. */
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
bu[0] = '\0';
- if((co->gridgapy > -1) || (co->gridgapy > -1)) {
+ if((co->gridgapx > -1) || (co->gridgapy > -1)) {
fputs(dkct_gui_out_kw[2], psrc->fipo);
if(co->gridgapx > -1) {
sprintf(
@@ -6760,12 +6948,13 @@ static
void
dkct_gui_constructor_staticboxsizer(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
)
{
+ DK3_UNUSED_ARG(dp)
fputs(dkct_gui_out_kw[2], psrc->fipo);
fputs(dkct_gui_out_kw[(co->direction) ? 35 : 34], psrc->fipo);
dkct_gui_next_argument(psrc);
@@ -6790,7 +6979,7 @@ static
void
dkct_gui_constructor_panel(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6798,6 +6987,7 @@ dkct_gui_constructor_panel(
{
int det = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
@@ -6827,7 +7017,7 @@ static
void
dkct_gui_constructor_notebook(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6836,6 +7026,7 @@ dkct_gui_constructor_notebook(
int det = 0; /* Details level. */
int fe = 0; /* Flag: Found elements. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->notebookStyle) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -6849,36 +7040,89 @@ dkct_gui_constructor_notebook(
dkct_gui_write_size(psrc, co->sizex, co->sizey, 0, co);
if(det > 1) {
if((co->notebookStyle) & DKCT_GUI_NB_TOP) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[113], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_LEFT) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[114], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_RIGHT) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[115], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_BOTTOM) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[116], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_FIXEDWIDTH) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[117], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_MULTILINE) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[118], psrc->fipo);
- }
- if((co->notebookStyle) & DKCT_GUI_NB_NOPAGETHEME) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[119], psrc->fipo);
+ switch (co->cln) {
+ case 12: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[113], psrc->fipo);
+ } break;
+ case 42: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[221], psrc->fipo);
+ } break;
+ case 43: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[222], psrc->fipo);
+ } break;
+ }
+ } else {
+ if((co->notebookStyle) & DKCT_GUI_NB_LEFT) {
+ switch (co->cln) {
+ case 12: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[114], psrc->fipo);
+ } break;
+ case 42: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[223], psrc->fipo);
+ } break;
+ case 43: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[224], psrc->fipo);
+ } break;
+ }
+ } else {
+ if((co->notebookStyle) & DKCT_GUI_NB_RIGHT) {
+ switch (co->cln) {
+ case 12: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[115], psrc->fipo);
+ } break;
+ case 42: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[225], psrc->fipo);
+ } break;
+ case 43: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[226], psrc->fipo);
+ } break;
+ }
+ } else {
+ if((co->notebookStyle) & DKCT_GUI_NB_BOTTOM) {
+ switch (co->cln) {
+ case 12: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[116], psrc->fipo);
+ } break;
+ case 42: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[227], psrc->fipo);
+ } break;
+ case 43: {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[228], psrc->fipo);
+ } break;
+ }
+ }
+ }
+ }
}
- if((co->notebookStyle) & DKCT_GUI_NB_FLAT) {
- if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
- fputs(dkct_gui_out_kw[120], psrc->fipo);
+ if (12 == co->cln) {
+ if((co->notebookStyle) & DKCT_GUI_NB_FIXEDWIDTH) {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[117], psrc->fipo);
+ }
+ if((co->notebookStyle) & DKCT_GUI_NB_MULTILINE) {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[118], psrc->fipo);
+ }
+ if((co->notebookStyle) & DKCT_GUI_NB_NOPAGETHEME) {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[119], psrc->fipo);
+ }
+ if((co->notebookStyle) & DKCT_GUI_NB_FLAT) {
+ if(fe) { fputs(dkct_gui_out_kw[44], psrc->fipo); } fe = 1;
+ fputs(dkct_gui_out_kw[120], psrc->fipo);
+ }
}
if(!(fe)) { fputs(dkct_gui_out_kw[52], psrc->fipo); }
}
@@ -6899,7 +7143,7 @@ static
void
dkct_gui_constructor_scrolledwindow(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6907,6 +7151,7 @@ dkct_gui_constructor_scrolledwindow(
{
int det = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->direction != DKCT_GUI_DIRECTION_BOTH) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -6949,7 +7194,7 @@ static
void
dkct_gui_constructor_splitterwindow(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -6958,6 +7203,7 @@ dkct_gui_constructor_splitterwindow(
int det = 0; /* Details level. */
int fe = 0; /* Flag: Found an element. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->splitterStyle != DKCT_GUI_SPLITTERW_3D) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -7027,7 +7273,7 @@ static
void
dkct_gui_constructor_button(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7036,6 +7282,7 @@ dkct_gui_constructor_button(
int det = 0; /* Details level. */
int fe = 0; /* Flag: Found an entry. */
+ DK3_UNUSED_ARG(dp)
if(co->text) det = 1;
if((co->sizex > 0) && (co->sizey > 0)) det = 2;
if(co->buttonStyle) det = 3;
@@ -7109,7 +7356,7 @@ static
void
dkct_gui_constructor_bitmapbutton(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7118,6 +7365,7 @@ dkct_gui_constructor_bitmapbutton(
int det = 0; /* Details level. */
int fe = 0; /* Flag: Found entry. */
+ DK3_UNUSED_ARG(dp)
if(co->bitmapVarName) {
det = 1;
if((co->sizex > 0) && (co->sizey > 0)) det = 2;
@@ -7184,7 +7432,7 @@ static
void
dkct_gui_constructor_choice_combo(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui,
@@ -7193,6 +7441,7 @@ dkct_gui_constructor_choice_combo(
{
char bu[64]; /* Buffer for integer values. */
int details = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
/*
parent, id, pos, size (1) , n (2), texts (3), validator (4)
parent, id, text, pos, size (1), n (2), texts (3), validator (4)
@@ -7254,7 +7503,7 @@ static
void
dkct_gui_constructor_checkbox(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7262,6 +7511,7 @@ dkct_gui_constructor_checkbox(
{
int need_full_arguments = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if(co->text) need_full_arguments = 1;
if((co->sizex > 0) && (co->sizey > 0)) { need_full_arguments = 2; }
if(co->nStates == 0x03) {
@@ -7326,7 +7576,7 @@ static
void
dkct_gui_constructor_listbox(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7334,6 +7584,7 @@ dkct_gui_constructor_listbox(
{
char bu[64]; /* Buffer for numeric values. */
+ DK3_UNUSED_ARG(dp)
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
dkct_gui_next_argument(psrc);
@@ -7409,7 +7660,7 @@ static
void
dkct_gui_constructor_radiobox(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7422,6 +7673,7 @@ dkct_gui_constructor_radiobox(
int det = 0; /* Details level. */
char bu[64]; /* Buffer for numeric values. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if((co->nChoices > 0) || (co->nChoices == -1)) det = 2;
if(co->choices) det = 3;
@@ -7495,7 +7747,7 @@ static
void
dkct_gui_constructor_radiobutton(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7503,6 +7755,7 @@ dkct_gui_constructor_radiobutton(
{
int det = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->startGroup) det = 2;
if(co->validator) det = 3;
@@ -7550,7 +7803,7 @@ static
void
dkct_gui_constructor_scrollbar(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7558,6 +7811,7 @@ dkct_gui_constructor_scrollbar(
{
int must_write_details = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
dkct_gui_next_argument(psrc);
@@ -7606,7 +7860,7 @@ static
void
dkct_gui_constructor_spinbutton(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7614,6 +7868,7 @@ dkct_gui_constructor_spinbutton(
{
int need_details = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if(co->sizex > 0) { need_details = 1; }
if(co->sizey > 0) { need_details = 1; }
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) { need_details = 2; }
@@ -7659,7 +7914,7 @@ static
void
dkct_gui_constructor_spincontrol(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7668,6 +7923,7 @@ dkct_gui_constructor_spincontrol(
char bu[64]; /* Buffer for numeric values. */
int need_details = 0; /* Details level. */
+ DK3_UNUSED_ARG(dp)
if(co->text) { need_details = 1; }
if((co->sizex > 0) && (co->sizey > 0)) { need_details = 2; }
if(co->useKeys) { need_details = 3; }
@@ -7757,7 +8013,7 @@ static
void
dkct_gui_constructor_slider(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7767,6 +8023,7 @@ dkct_gui_constructor_slider(
/*
parent, id, value, min, max, pos, size (1), style (2), validator (3)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->sliderStyle) det = 2;
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) det = 2;
@@ -7787,6 +8044,7 @@ dkct_gui_constructor_slider(
dkct_gui_next_argument(psrc);
dkct_gui_write_size(psrc, co->sizex, co->sizey, 0, co);
if(det > 1) {
+ dkct_gui_next_argument(psrc);
if(co->direction == DKCT_GUI_DIRECTION_HORIZONTAL) {
fputs(dkct_gui_out_kw[103], psrc->fipo);
} else {
@@ -7838,7 +8096,7 @@ static
void
dkct_gui_constructor_textctrl(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7849,6 +8107,7 @@ dkct_gui_constructor_textctrl(
/*
parent, id, value (1), pos, size (2), style (3), validator (4)
*/
+ DK3_UNUSED_ARG(dp)
if(co->text) det = 1;
if((co->sizex > 0) && (co->sizey > 0)) det = 2;
if(co->textStyle) det = 3;
@@ -7959,7 +8218,7 @@ static
void
dkct_gui_constructor_togglebutton(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -7969,6 +8228,7 @@ dkct_gui_constructor_togglebutton(
/*
parent, id, label, pos, size (1), style (2), validator (3)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->validator) det = 3;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -8010,7 +8270,7 @@ static
void
dkct_gui_constructor_gauge(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8021,6 +8281,7 @@ dkct_gui_constructor_gauge(
/*
parent, id, range, pos, size (1), style (2), validator (3)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) det = 2;
if(co->gaugeStyle) det = 2;
@@ -8069,7 +8330,7 @@ static
void
dkct_gui_constructor_statictext(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8081,6 +8342,7 @@ dkct_gui_constructor_statictext(
/*
parent, id, label, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
mask = DKCT_GUI_TEXT_LEFT;
mask |= DKCT_GUI_TEXT_CENTRE;
@@ -8139,7 +8401,7 @@ static
void
dkct_gui_constructor_staticbitmap(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8149,6 +8411,7 @@ dkct_gui_constructor_staticbitmap(
/*
parent, id, bitmap, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->bitmapVarName) {
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -8183,7 +8446,7 @@ static
void
dkct_gui_constructor_staticline(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8193,6 +8456,7 @@ dkct_gui_constructor_staticline(
/*
parent, id, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) det = 2;
fputs(dkct_gui_out_kw[2], psrc->fipo);
@@ -8229,7 +8493,7 @@ static
void
dkct_gui_constructor_staticbox(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT *DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8239,11 +8503,18 @@ dkct_gui_constructor_staticbox(
/*
parent, id, label, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
dkct_gui_next_argument(psrc);
dkct_gui_write_idname(co, psrc);
+ dkct_gui_next_argument(psrc);
+ if (NULL != co->text) {
+ fputs(co->text, psrc->fipo);
+ } else {
+ fputs(dkct_gui_out_kw[73], psrc->fipo);
+ }
if(det) {
dkct_gui_next_argument(psrc);
fputs(dkct_gui_out_kw[74], psrc->fipo);
@@ -8267,16 +8538,21 @@ dkct_gui_constructor_staticbox(
static
void
dkct_gui_constructor_menubar(
- DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
- DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(co),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
+ DKCT_SRC * DK3_SILENCE_ARG_UNUSED(psrc),
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
/*
No constructor arguments.
*/
+ DK3_UNUSED_ARG(co)
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(psrc)
+ DK3_UNUSED_ARG(gui)
}
@@ -8291,16 +8567,21 @@ dkct_gui_constructor_menubar(
static
void
dkct_gui_constructor_menu(
- DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
- DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(co),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
+ DKCT_SRC * DK3_SILENCE_ARG_UNUSED(psrc),
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
/*
No constructor arguments.
*/
+ DK3_UNUSED_ARG(co)
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(psrc)
+ DK3_UNUSED_ARG(gui)
}
@@ -8317,14 +8598,16 @@ void
dkct_gui_constructor_menuitem(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
/*
parent->Append(id, label, helpstring, kind);
*/
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
#if 0
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
@@ -8431,14 +8714,16 @@ void
dkct_gui_constructor_toolbartoolbase(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
/*
id, text, bitmap, disbitmap (1), kind (2), tip (3)
*/
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
fputs(dkct_gui_out_kw[8], psrc->fipo);
if(co->menuItemStyle != DKCT_GUI_MENU_ITEM_SEPARATOR) {
fputs(co->name, psrc->fipo);
@@ -8502,15 +8787,17 @@ void
dkct_gui_constructor_toolbar(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
int det = 0; /* Details level. */
/*
parent, id, pos, size (1), style (2)
*/
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
if(co->direction != DKCT_GUI_DIRECTION_HORIZONTAL) det = 2;
if(co->toolbarStyle != DKCT_GUI_TOOLBAR_FLAT) det = 2;
@@ -8593,7 +8880,7 @@ static
void
dkct_gui_constructor_grid(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui
@@ -8601,6 +8888,7 @@ dkct_gui_constructor_grid(
{
/* parent, id, pos, size (1), style, name */
int det = 0;
+ DK3_UNUSED_ARG(dp)
if((co->sizex > 0) && (co->sizey > 0)) det = 1;
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
@@ -8726,10 +9014,10 @@ static
void
dkct_gui_finalize_after_constructor(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
- DKCT_GUI *gui
+ DKCT_GUI * DK3_SILENCE_ARG_UNUSED(gui)
)
{
DKCT_GRID_HEAD *gh = NULL;
@@ -8738,6 +9026,9 @@ dkct_gui_finalize_after_constructor(
int rows = 0;
int columns= 0;
$? "+ dkct_gui_finalize_after_constructor"
+ DK3_UNUSED_ARG(dp)
+ DK3_UNUSED_ARG(pw)
+ DK3_UNUSED_ARG(gui)
/*
Jump to end if construction failed.
if(!(object)) {
@@ -8922,7 +9213,7 @@ dkct_gui_finalize_after_constructor(
} break;
case 12: { $? ". wxNotebook"
} break;
- case 13: { $? ". wxScrolledWindow"
+ case 13: case 47: { $? ". wxScrolledWindow or wxScrolled<wxPanel>"
/* Set size */
} break;
case 14: { $? ". wxSplitterWindow"
@@ -9113,6 +9404,16 @@ dkct_gui_finalize_after_constructor(
fputs(dkct_gui_out_kw[0], psrc->fipo);
}
} break;
+ case 42: { $? ". wxChoicebook"
+ } break;
+ case 43: { $? ". wxListbook"
+ } break;
+ case 44: { $? ". wxSimplebook"
+ } break;
+ case 45: { $? ". wxToolbook"
+ } break;
+ case 46: { $? ". wxTreebook"
+ } break;
}
/*
Minimal size, if any.
@@ -9142,13 +9443,14 @@ static
void
dkct_gui_constructor_constructor(
DKCT_GUI_ELEMENT *co,
- DKCT_GUI_ELEMENT *dp,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(dp),
DKCT_GUI_ELEMENT *pw,
DKCT_SRC *psrc,
DKCT_GUI *gui,
int comma
)
{
+ DK3_UNUSED_ARG(dp)
fputs(dkct_gui_out_kw[2], psrc->fipo);
dkct_gui_write_parent_name(pw, psrc, gui);
fputs(dkct_gui_out_kw[209], psrc->fipo);
@@ -9214,13 +9516,14 @@ dkct_gui_write_element_constructor(
case 37: {
if(dp) {
if(dp->cln == 36) {
- if(co->text) {
+ if((NULL != co->text) || (0 != dkct_gui_is_stock_element(co))) {
dkct_gui_constructor_menuitem(co, dp, pw, psrc, gui);
if(co->menuItemStyle != DKCT_GUI_MENU_ITEM_SEPARATOR) {
dkct_gui_finalize_after_constructor(co, dp, pw, psrc, gui);
}
} else {
/* ERROR: No text specified */
+ $? "! no text, no stock element"
dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 49);
}
} else { $? "! illegal parent/child"
@@ -9244,6 +9547,7 @@ dkct_gui_write_element_constructor(
}
} else {
/* ERROR: No text */
+ $? "! not text"
dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 49);
}
} else {
@@ -9322,7 +9626,7 @@ dkct_gui_write_element_constructor(
case 12: { $? ". wxNotebook"
dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
} break;
- case 13: { $? ". wxScrolledWindow"
+ case 13: case 47 : { $? ". wxScrolledWindow wxScrolled<wxPanel>"
dkct_gui_constructor_scrolledwindow(co, dp, pw, psrc, gui);
} break;
case 14: { $? ". wxSplitterWindow"
@@ -9406,9 +9710,24 @@ dkct_gui_write_element_constructor(
} break;
case 39: { $? ". wxStatusBar"
} break;
- case 41: {
+ case 41: { $? ". wxGrid"
dkct_gui_constructor_grid(co, dp, pw, psrc, gui);
} break;
+ case 42: { $? ". wxChoicebook"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
+ case 43: { $? ". wxListbook"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
+ case 44: { $? ". wxSimplebook"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
+ case 45: { $? ". wxToolbook"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
+ case 46: { $? ". wxTreebook"
+ dkct_gui_constructor_notebook(co, dp, pw, psrc, gui);
+ } break;
default: {
if(!(co->compConst)) {
dkct_gui_constructor_constructor(co,dp,pw,psrc,gui,0);
@@ -9437,13 +9756,14 @@ void
dkct_gui_add_pseudo_object(
DKCT_GUI_ELEMENT *co,
DKCT_GUI_ELEMENT *dp,
- DKCT_GUI_ELEMENT *pw,
+ DKCT_GUI_ELEMENT * DK3_SILENCE_ARG_UNUSED(pw),
DKCT_SRC *psrc,
DKCT_GUI *gui
)
{
char bu[256]; /* Buffer for numeric values. */
$? "+ dkct_gui_add_pseudo_object \"%!8s\"", TR_8STR(co->name)
+ DK3_UNUSED_ARG(pw)
if(dp) {
switch(dp->cln) {
case 7: { /* gridbag sizer */
@@ -10091,6 +10411,7 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
default: {
pcln = -1;
if(dp) { pcln = dp->cln; }
+ $? ". pcln = %d", pcln
switch(pcln) {
case 35: { /* Appending to a menu bar. */
switch(co->cln) {
@@ -10192,6 +10513,26 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
the splitter window.
*/
} break;
+ case 12: case 42: case 43: case 44: case 45: case 46: {
+ /* Parent is wxNotebook */
+ if (
+ (NULL != co->name) && (NULL != dp->name)
+ && (NULL != co->text))
+ {
+ fputs(dkct_gui_out_kw[8], psrc->fipo);
+ fputs(dp->name, psrc->fipo);
+ fputs(dkct_gui_out_kw[220], psrc->fipo);
+ fputs(co->name, psrc->fipo);
+ fputs(dkct_gui_out_kw[55], psrc->fipo);
+ fputs(co->text, psrc->fipo);
+ fputs(dkct_gui_out_kw[24], psrc->fipo);
+ fputs(dkct_gui_out_kw[0], psrc->fipo);
+ }
+ else {
+ /* ERROR: Missing text */
+ dkct_to_log_1(gui->psrc, 1, DK3_LL_ERROR, 124);
+ }
+ } break;
default: {
if((co->number) && (co->parent)) {
char const *pname;
@@ -10222,6 +10563,40 @@ dkct_gui_write_members(DKCT_SRC *psrc, DKCT_GUI *gui)
+/** Complain if an element is not in the contents of a parent object.
+ @param psrc Source structure.
+ @param el Element to complain about.
+*/
+static
+void
+complain_about_missing_parent(
+ DKCT_SRC *gpsrc, DKCT_SRC *psrc, DKCT_GUI_ELEMENT *el
+)
+{
+ DKCT_SRC *xpsrc;
+ unsigned long oldlineno;
+ int must_complain;
+
+ $? "+ complain_about_missing_parent"
+ /*
+ Check element el whether complaint is really necessary
+ */
+ must_complain = 1;
+ /*
+ Write warning
+ */
+ xpsrc = ((NULL != gpsrc) ? (gpsrc) : (psrc));
+ if ((0 != must_complain) && (NULL != xpsrc)) {
+ oldlineno = xpsrc->lineno;
+ xpsrc->lineno = el->lndef;
+ dkct_to_log_3(xpsrc, 1, DK3_LL_WARNING, 126, 127, el->name);
+ xpsrc->lineno = oldlineno;
+ }
+ $? "- complain_about_missing_parent"
+}
+
+
+
/** Write top level class constructor.
@param psrc Source structure.
*/
@@ -10257,6 +10632,9 @@ dkct_gui_write_constructor(DKCT_SRC *psrc)
fputs(dkct_gui_out_kw[8], psrc->fipo);
fputs(el->name, psrc->fipo);
fputs(dkct_gui_out_kw[14], psrc->fipo);
+ if (NULL == el->parent) {
+ complain_about_missing_parent(gui->psrc, psrc, el);
+ }
}
}
}
diff --git a/support/dktools/dkct-gui.h b/support/dktools/dkct-gui.h
index 7690c792ce..838f9fe467 100644
--- a/support/dktools/dkct-gui.h
+++ b/support/dktools/dkct-gui.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct-gui.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct-gui.ctr
*/
/** @file dkct-gui.h Header file for the dkct-gui module.
diff --git a/support/dktools/dkct-str.c b/support/dktools/dkct-str.c
index e953c7efb0..14bada896b 100644
--- a/support/dktools/dkct-str.c
+++ b/support/dktools/dkct-str.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct-str.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct-str.ctr
*/
/** @file dkct-str.c The dkct-str module.
@@ -39,6 +17,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 46 "dkct-str.ctr"
+#include "dk4conf.h"
+
#if DK3_USE_WX
#include "dkwxtrace.h"
#else
@@ -87,7 +67,7 @@ dkT("Syntax error!\nUnknown option: \""),
dkT("\"!"),
/* 12 */
-dkT("Ouput file name contains non-ASCII: \""),
+dkT("Output file name contains non-ASCII: \""),
/* 13 */
dkT("\"!"),
@@ -303,13 +283,13 @@ dkT("Syntax error!\nNumber out of range: \""),
dkT("\"!"),
/* 84 */
-dkT("Syntax error!\nCan't add object \""),
+dkT("Syntax error!\n\tObject \""),
/* 85 */
-dkT("\" to parent object \""),
+dkT("\", parent object \""),
/* 86 */
-dkT("\"!"),
+dkT("\":\n\tDon't know how to add contents.!"),
/* 87 */
dkT(""),
@@ -398,10 +378,49 @@ dkT("Preprocessor instructions and file=... used in $!text section!"),
/* 115 */
dkT("Redefinition of tooltip flag!"),
+/* 116 */
+dkT("State number "),
+
+/* 117 */
+dkT(" already in use!"),
+
+/* 118 */
+dkT("Input number "),
+
+/* 119 */
+dkT(" already in use!"),
+
+/* 120 */
+dkT("Output number "),
+
+/* 121 */
+dkT(" already in use!"),
+
+/* 122 */
+dkT("Not a C identifier: \""),
+
+/* 123 */
+dkT("\"!"),
+
+/* 124 */
+dkT("Missing \"text\" attribute for wxNotebook contents element!"),
+
+/* 125 */
+dkT("Element is not a container!\n\tAttribute contents will be ignored."),
+
+/* 126 */
+dkT("No parent object for \""),
+
+/* 127 */
+dkT("\"!"),
+
+/* 128 */
+dkT("SPDX-License-identifier redefined!"),
+
NULL
-#line 449 "dkct-str.ctr"
+#line 482 "dkct-str.ctr"
};
diff --git a/support/dktools/dkct-str.ctr b/support/dktools/dkct-str.ctr
index 91d64dd74e..06ab09fb53 100644
--- a/support/dktools/dkct-str.ctr
+++ b/support/dktools/dkct-str.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -44,6 +44,8 @@ dkct_str_get_dest_suffixes(void);
%% module
+#include "dk4conf.h"
+
#if DK3_USE_WX
#include "dkwxtrace.h"
#else
@@ -95,7 +97,7 @@ Syntax error!\nUnknown option: "
#
# 12 / 13: Error: Output file name contains non-ASCII: "..."!
#
-Ouput file name contains non-ASCII: "
+Output file name contains non-ASCII: "
"!
#
# 14: Error: Missing file name!
@@ -350,9 +352,9 @@ Syntax error!\nNumber out of range: "
#
# 84/85/86: Error: Can't add object "..." to parent object "..."!
#
-Syntax error!\nCan't add object "
-" to parent object "
-"!
+Syntax error!\n\tObject "
+", parent object "
+":\n\tDon't know how to add contents.!
#
# 87: UNUSED Object/class name: Not specified.
#
@@ -445,6 +447,37 @@ Preprocessor instructions and file=... used in $!text section!
# 115
#
Redefinition of tooltip flag!
+#
+# 116-121
+#
+State number
+ already in use!
+Input number
+ already in use!
+Output number
+ already in use!
+#
+# 122-123
+#
+Not a C identifier: "
+"!
+#
+# 124
+#
+Missing "text" attribute for wxNotebook contents element!
+#
+# 125
+#
+Element is not a container!\n\tAttribute contents will be ignored.
+#
+# 126 127
+#
+No parent object for "
+"!
+#
+# 128 ERROR: SPDX-License-identifier redefined!
+#
+SPDX-License-identifier redefined!
$!end
};
diff --git a/support/dktools/dkct-str.h b/support/dktools/dkct-str.h
index b73d78f9c3..cee342c877 100644
--- a/support/dktools/dkct-str.h
+++ b/support/dktools/dkct-str.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct-str.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct-str.ctr
*/
/** @file dkct-str.h Header file for the dkct-str module.
diff --git a/support/dktools/dkct-to.c b/support/dktools/dkct-to.c
index 63531e8517..6ea8eeca69 100644
--- a/support/dktools/dkct-to.c
+++ b/support/dktools/dkct-to.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct-to.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct-to.ctr
*/
/** @file dkct-to.c The dkct-to module.
@@ -39,6 +17,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 77 "dkct-to.ctr"
+#include "dk4conf.h"
+
#if DK3_USE_WX
#include "dkwxtrace.h"
#else
diff --git a/support/dktools/dkct-to.ctr b/support/dktools/dkct-to.ctr
index b987fffe54..1be43037b8 100644
--- a/support/dktools/dkct-to.ctr
+++ b/support/dktools/dkct-to.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -75,6 +75,8 @@ dkct_to_log_5(
%% module
+#include "dk4conf.h"
+
#if DK3_USE_WX
#include "dkwxtrace.h"
#else
diff --git a/support/dktools/dkct-to.h b/support/dktools/dkct-to.h
index 8167fb732f..549dd4b16e 100644
--- a/support/dktools/dkct-to.h
+++ b/support/dktools/dkct-to.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct-to.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct-to.ctr
*/
/** @file dkct-to.h Header file for the dkct-to module.
diff --git a/support/dktools/dkct-tr.c b/support/dktools/dkct-tr.c
index a11ec5e4a6..47f92c537b 100644
--- a/support/dktools/dkct-tr.c
+++ b/support/dktools/dkct-tr.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct-tr.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct-tr.ctr
*/
/** @file dkct-tr.c The dkct-tr module.
@@ -39,6 +17,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dkct-tr.ctr"
+#include "dk4conf.h"
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if DK3_USE_WX
#include "dkwxtrace.h"
@@ -50,11 +35,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3wxcs.h"
+#include "dk3unused.h"
-#line 25 "dkct-tr.ctr"
+
+#line 34 "dkct-tr.ctr"
/** Dkct user function.
@@ -179,6 +166,7 @@ static char const * const dkct_option_keywords[] = {
/* 1 */ "copyright-year",
/* 2 */ "license",
/* 3 */ "splint-comment-character",
+/* 4 */ "spdx-license-identifier",
NULL
};
@@ -214,7 +202,8 @@ NULL
*/
static char const * const dkct_tr_mod_warning_start[] = {
"/*",
-" WARNING: This file was generated by dkct.",
+" WARNING: This file was generated by the dkct program (see",
+" http://dktools.sourceforge.net/ for details).",
" Changes you make here will be lost if dkct is run again!",
" You should modify the original source and run dkct on it.",
NULL
@@ -290,11 +279,11 @@ static char const * const dkct_tr_kw8[] = {
/* 53 */ ")",
/* 54 */ ",\n\n",
/* 55 */ "\"",
-/* 56 */ "if(dktrace_file()) {\n",
+/* 56 */ "if(dktrace_file()) {\n#if (_WIN32) && defined(_MSC_VER)\n",
/* 57 */ " _setmode(_fileno(dktrace_file()), _O_U16TEXT);\n",
/* 58 */ " fputwc(0xFEFF, dktrace_file());\n",
-/* 59 */ "}\n",
-/* 60 */ "_setmode(_fileno(stdout), _O_U16TEXT);\n",
+/* 59 */ "#endif\n}\n",
+/* 60 */ "#if (_WIN32) && defined(_MSC_VER)\n_setmode(_fileno(stdout), _O_U16TEXT);\n#endif\n",
/* 61 */ "fputws(L",
/* 62 */ "fwprintf(",
/* 63 */ ", L",
@@ -321,11 +310,21 @@ static char const * const dkct_tr_kw8[] = {
/* 80 */ "/*@-nullassign@*/\n",
/* 81 */ "/*@=nullassign@*/\n",
/* 82 */
-"#if TRACE_WIDE && (defined(_WIN32) || DK3_ON_WINDOWS || DK4_ON_WINDOWS)\n",
+"#if TRACE_WIDE && ((_WIN32) || (DK3_ON_WINDOWS) || (DK4_ON_WINDOWS))\n",
/* 83 */
"#if (SIZEOF_WXCHAR > 1) || (DK4_SIZEOF_WXCHAR > 1) || (DK3_SIZEOF_WXCHAR > 1)\n",
/* 84 */ "#if (DK3_CHAR_SIZE > 1) || (DK4_CHAR_SIZE > 1)\n",
-/* 85 */ "#if (defined(_WIN32)) || (DK3_ON_WINDOWS) || (DK4_ON_WINDOWS)\n",
+/* 85 */ "#if (_WIN32) || (DK3_ON_WINDOWS) || (DK4_ON_WINDOWS)\n",
+/* 86 */ "\\n",
+/* 87 */ "#ifndef\tDK3TRACE_H_INCLUDED\n",
+/* 88 */ "#endif\n",
+/* 89 */ "rb",
+/* 90 */ "0x%02x",
+/* 91 */ "#if\tDK4_BUILDING_DKTOOLS4\n",
+/* 92 */ "#else\n",
+/* 93 */ "#include <dktools-4/dk3trace.h>\n",
+/* 94 */ "#endif\n",
+/* 95 */ "SPDX-License-Identifier: ",
NULL
};
@@ -343,7 +342,7 @@ dkT(".dox"),
NULL
-#line 314 "dkct-tr.ctr"
+#line 335 "dkct-tr.ctr"
};
@@ -359,6 +358,18 @@ NULL
+/** Arguments for the string-table command.
+*/
+static char const * const dkct_tr_long_string_args[] = {
+/* 0 */ "newlines",
+/* 1 */ "macro",
+/* 2 */ "prefix",
+/* 3 */ "preprocessor",
+NULL
+};
+
+
+
/** Text to include in GPL-licensed sources.
*/
static char const * const dkct_tr_gpl_text[] = {
@@ -377,7 +388,7 @@ static char const * const dkct_tr_gpl_text[] = {
NULL
-#line 346 "dkct-tr.ctr"
+#line 379 "dkct-tr.ctr"
};
@@ -400,7 +411,7 @@ static char const * const dkct_tr_lgpl_text[] = {
NULL
-#line 367 "dkct-tr.ctr"
+#line 400 "dkct-tr.ctr"
};
@@ -434,7 +445,7 @@ static char const * const dkct_tr_bsd_text[] = {
NULL
-#line 399 "dkct-tr.ctr"
+#line 432 "dkct-tr.ctr"
};
@@ -446,7 +457,7 @@ static char const * const dkct_tr_commercial_text[] = {
NULL
-#line 409 "dkct-tr.ctr"
+#line 442 "dkct-tr.ctr"
};
#if DK3_USE_WX
@@ -482,7 +493,7 @@ static const int is_dk_wide =
static const int is_on_windows =
-#if DK3_ON_WINDOWS || defined(_WIN32)
+#if DK3_ON_WINDOWS || _WIN32
1
#else
0
@@ -499,11 +510,13 @@ static const int is_on_windows =
*/
static
int
-dkct_tr_line_compare(void const *l, void const *r, int cr)
+dkct_tr_line_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
DKCT_LINE const *pl; /* Left line. */
DKCT_LINE const *pr; /* Right line. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (DKCT_LINE const *)l; pr = (DKCT_LINE const *)r;
@@ -525,16 +538,16 @@ dkct_tr_line_delete(DKCT_LINE *p)
{
-#line 486 "dkct-tr.ctr"
+#line 521 "dkct-tr.ctr"
if(p) {
-#line 487 "dkct-tr.ctr"
+#line 522 "dkct-tr.ctr"
dk3_release(p->t);
p->l = 0UL;
dk3_delete(p);
}
-#line 491 "dkct-tr.ctr"
+#line 526 "dkct-tr.ctr"
}
@@ -545,7 +558,7 @@ dkct_tr_line_new(char const *t, unsigned long l, dk3_app_t *app)
DKCT_LINE *back = NULL;
-#line 500 "dkct-tr.ctr"
+#line 535 "dkct-tr.ctr"
if((t) && (l)) {
back = dk3_new_app(DKCT_LINE,1,app);
if(back) {
@@ -559,7 +572,7 @@ dkct_tr_line_new(char const *t, unsigned long l, dk3_app_t *app)
}
}
-#line 512 "dkct-tr.ctr"
+#line 547 "dkct-tr.ctr"
return back;
}
@@ -573,11 +586,13 @@ dkct_tr_line_new(char const *t, unsigned long l, dk3_app_t *app)
*/
static
int
-dkct_tr_stm_compare(void const *l, void const *r, int cr)
+dkct_tr_stm_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
DKCT_STM const *sl; /* Left state machine. */
DKCT_STM const *sr; /* Right state machine. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
sl = (DKCT_STM const *)l; sr = (DKCT_STM const *)r;
@@ -612,13 +627,13 @@ dkct_tr_cleanup_storage_and_iterator(dk3_sto_t *s, dk3_sto_it_t *i)
DKCT_LINE *l; /* Current line to clean up. */
-#line 563 "dkct-tr.ctr"
+#line 600 "dkct-tr.ctr"
if(s) {
if(i) {
dk3sto_it_reset(i);
while((l = (DKCT_LINE *)dk3sto_it_next(i)) != NULL) {
-#line 567 "dkct-tr.ctr"
+#line 604 "dkct-tr.ctr"
dkct_tr_line_delete(l);
}
dk3sto_it_close(i);
@@ -626,7 +641,7 @@ dkct_tr_cleanup_storage_and_iterator(dk3_sto_t *s, dk3_sto_it_t *i)
dk3sto_close(s);
}
-#line 573 "dkct-tr.ctr"
+#line 610 "dkct-tr.ctr"
}
@@ -637,7 +652,7 @@ dkct_tr_delete(DKCT_SRC *p)
DKCT_STM *stmptr; /* Current state machine to clean up. */
-#line 582 "dkct-tr.ctr"
+#line 619 "dkct-tr.ctr"
if(p) {
if(p->gui) {
dkct_gui_delete((DKCT_GUI *)(p->gui));
@@ -667,19 +682,24 @@ dkct_tr_delete(DKCT_SRC *p)
} p->s_stm = NULL; p->i_stm = NULL; p->cstm = NULL;
if(p->crn) {
-#line 610 "dkct-tr.ctr"
+#line 647 "dkct-tr.ctr"
}
if(p->cry) {
-#line 612 "dkct-tr.ctr"
+#line 649 "dkct-tr.ctr"
+ }
+ if(p->sli) {
+
+#line 651 "dkct-tr.ctr"
}
if(p->lict > -1) {
-#line 614 "dkct-tr.ctr"
+#line 653 "dkct-tr.ctr"
}
p->ffn = NULL;
dk3_release(p->crn);
dk3_release(p->cry);
+ dk3_release(p->sli);
dk3_release(p->sfn);
dk3_release(p->cmdb);
p->szcmd = 0; p->ucmd = 0; p->fipo = NULL;
@@ -687,7 +707,7 @@ dkct_tr_delete(DKCT_SRC *p)
dk3_delete(p);
}
-#line 624 "dkct-tr.ctr"
+#line 664 "dkct-tr.ctr"
}
@@ -706,7 +726,7 @@ dkct_tr_new(
char const *fnptrsfn; /* Pointer to short file name. */
-#line 641 "dkct-tr.ctr"
+#line 681 "dkct-tr.ctr"
if((o) && (fn)) {
back = dk3_new_app(DKCT_SRC,1,app);
if(back) {
@@ -725,6 +745,7 @@ dkct_tr_new(
back->sfn = NULL;
back->crn = NULL;
back->cry = NULL;
+ back->sli = NULL;
back->cmdb = NULL;
back->lict = -1;
back->st = 0;
@@ -788,7 +809,7 @@ dkct_tr_new(
back->sfn = dk3str_c8_dup_app(fnptrsfn, app);
if(back->sfn) {
-#line 721 "dkct-tr.ctr"
+#line 762 "dkct-tr.ctr"
back->cmdb = dk3_new_app(char,DKCT_LINE_SIZE,app);
if(back->cmdb) {
back->szcmd = DKCT_LINE_SIZE;
@@ -808,7 +829,7 @@ dkct_tr_new(
}
}
-#line 739 "dkct-tr.ctr"
+#line 780 "dkct-tr.ctr"
return back;
}
@@ -954,7 +975,7 @@ dkct_tr_check_copyright_year(DKCT_SRC *psrc)
-#line 883 "dkct-tr.ctr"
+#line 924 "dkct-tr.ctr"
if (NULL != psrc) {
if (NULL != psrc->cry) {
p1 = dk3str_c8_rchr(psrc->cry, '-');
@@ -964,16 +985,16 @@ dkct_tr_check_copyright_year(DKCT_SRC *psrc)
p1 = psrc->cry;
}
-#line 891 "dkct-tr.ctr"
+#line 932 "dkct-tr.ctr"
if (0 != dk3ma_i_from_c8_string(&cry, p1, NULL)) {
-#line 893 "dkct-tr.ctr"
+#line 934 "dkct-tr.ctr"
if (0 != dk3sf_time(&currenttime)) {
if (0 != dk3sf_localtime_app(&loctime, &currenttime, NULL)) {
-#line 896 "dkct-tr.ctr"
+#line 937 "dkct-tr.ctr"
if (cry != loctime.Y) {
dk3app_log_1(psrc->app, DK3_LL_WARNING, psrc->msg, 113);
}
@@ -989,7 +1010,7 @@ dkct_tr_check_copyright_year(DKCT_SRC *psrc)
}
}
-#line 910 "dkct-tr.ctr"
+#line 951 "dkct-tr.ctr"
}
@@ -1003,16 +1024,19 @@ dkct_tr_check_copyright_year(DKCT_SRC *psrc)
*/
static
int
-dkct_tr_process_option(DKCT_SRC *psrc, char *key, char *val, int sufi)
+dkct_tr_process_option(
+ DKCT_SRC *psrc, char *key, char *val, int DK3_SILENCE_ARG_UNUSED(sufi)
+)
{
int back = 0;
-#line 927 "dkct-tr.ctr"
+#line 970 "dkct-tr.ctr"
+ DK3_UNUSED_ARG(sufi)
switch(dk3str_c8_array_index(dkct_option_keywords, key, 0)) {
case 0: {
-#line 929 "dkct-tr.ctr"
+#line 973 "dkct-tr.ctr"
if(psrc->crn) {
/* Warning: Redefinition of copyright owner */
dkct_to_log_1(psrc, 1, DK3_LL_WARNING, 4);
@@ -1029,7 +1053,7 @@ dkct_tr_process_option(DKCT_SRC *psrc, char *key, char *val, int sufi)
} break;
case 1: {
-#line 944 "dkct-tr.ctr"
+#line 988 "dkct-tr.ctr"
if(psrc->cry) {
/* Warning: Redefinition of copyright year(s)! */
dkct_to_log_1(psrc, 1, DK3_LL_WARNING, 5);
@@ -1048,7 +1072,7 @@ dkct_tr_process_option(DKCT_SRC *psrc, char *key, char *val, int sufi)
} break;
case 2: {
-#line 961 "dkct-tr.ctr"
+#line 1005 "dkct-tr.ctr"
if(psrc->lict >= 0) {
/* Warning: Redefinition of license! */
dkct_to_log_1(psrc, 1, DK3_LL_WARNING, 6);
@@ -1064,7 +1088,7 @@ dkct_tr_process_option(DKCT_SRC *psrc, char *key, char *val, int sufi)
} break;
case 3: {
-#line 975 "dkct-tr.ctr"
+#line 1019 "dkct-tr.ctr"
if (val) {
(psrc->dkcto).spls = *val;
} else {
@@ -1072,13 +1096,30 @@ dkct_tr_process_option(DKCT_SRC *psrc, char *key, char *val, int sufi)
}
back = 1;
} break;
+ case 4: {
+
+#line 1027 "dkct-tr.ctr"
+ if (psrc->sli) {
+ /* Warning: Redefinition of copyright owner */
+ dkct_to_log_1(psrc, 1, DK3_LL_WARNING, 128);
+ dk3_release(psrc->sli);
+ }
+ psrc->sli = dk3str_c8_dup_app(val, psrc->app);
+ if (psrc->sli) {
+ back = 1;
+ } else {
+ psrc->ec = DK3_ERROR_MEMORY;
+ /* ERROR: Memory */
+ dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ }
+ } break;
default: {
dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 10, 11, key);
back = 0;
} break;
}
-#line 987 "dkct-tr.ctr"
+#line 1046 "dkct-tr.ctr"
return back;
}
@@ -1123,6 +1164,36 @@ dkct_tr_has_doxygen_file_comment(char *inputline)
+/** Find key/value separator, equal sign or colon.
+ @param line Line to search for character.
+ @return Valid pointer on success, NULL on error.
+*/
+static
+char *
+dkct_tr_separate_key_value(char *line)
+{
+ char *back = NULL;
+
+
+#line 1100 "dkct-tr.ctr"
+ if (NULL != line) {
+ while ((NULL == back) && ('\0' != *line)) {
+ if (('=' == *line) || (':' == *line)) {
+ back = line;
+ }
+ else {
+ line++;
+ }
+ }
+ }
+
+
+#line 1111 "dkct-tr.ctr"
+ return back;
+}
+
+
+
int
dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
{
@@ -1138,14 +1209,14 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
char *p2; /* Option value. */
-#line 1045 "dkct-tr.ctr"
+#line 1130 "dkct-tr.ctr"
if((psrc) && (fn)) {
-#line 1046 "dkct-tr.ctr"
+#line 1131 "dkct-tr.ctr"
fipo = dk3sf_fopen_app(fn, dk3app_not_localized(22), psrc->app);
if(fipo) {
-#line 1048 "dkct-tr.ctr"
+#line 1133 "dkct-tr.ctr"
back = 1;
switch(sufi) {
case 4: {
@@ -1166,7 +1237,7 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
dk3app_set_source_line(psrc->app, lineno);
dk3str_c8_delnl(inputline);
-#line 1067 "dkct-tr.ctr"
+#line 1152 "dkct-tr.ctr"
if(dkct_tr_is_section_header(inputline)) {
/*
Start of new section.
@@ -1178,7 +1249,7 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
if(section == -1) {
psrc->ec = DK3_ERROR_SYNTAX;
-#line 1077 "dkct-tr.ctr"
+#line 1162 "dkct-tr.ctr"
cc = 0;
} else {
switch(section) {
@@ -1212,10 +1283,10 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
psrc->cstm = dkct_au_stm_new(lineno, psrc->app);
if(psrc->cstm) {
-#line 1109 "dkct-tr.ctr"
+#line 1194 "dkct-tr.ctr"
if(!dk3sto_add(psrc->s_stm, (void *)(psrc->cstm))) {
-#line 1110 "dkct-tr.ctr"
+#line 1195 "dkct-tr.ctr"
dkct_au_stm_delete(psrc->cstm);
psrc->cstm = NULL;
}
@@ -1246,7 +1317,15 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
p1 = dk3str_c8_start(inputline, NULL);
if(p1) {
if(*p1 != '#') {
+#if 0
+ /* 2020-08-23 Update
+ Replaced by search for equal sign or colon to allow
+ SPDX-License-Identifier: xxx
+ lines.
+ */
p2 = dk3str_c8_chr(p1, '=');
+#endif
+ p2 = dkct_tr_separate_key_value(p1);
if(p2) {
*(p2++) = '\0';
p2 = dk3str_c8_start(p2, NULL);
@@ -1275,7 +1354,7 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
if(!dkct_gui_add_line((DKCT_GUI *)(psrc->gui), inputline)) {
back = 0;
-#line 1168 "dkct-tr.ctr"
+#line 1261 "dkct-tr.ctr"
if(psrc->ec == 0) {
psrc->ec = DK3_ERROR_MEMORY;
}
@@ -1290,7 +1369,7 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
if(!dkct_au_add_line(psrc->cstm, psrc, inputline, lineno)) {
back = 0;
-#line 1181 "dkct-tr.ctr"
+#line 1274 "dkct-tr.ctr"
}
} break;
default: {
@@ -1339,7 +1418,7 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
*/
if(psrc->ec) {
-#line 1228 "dkct-tr.ctr"
+#line 1321 "dkct-tr.ctr"
back = 0;
}
fclose(fipo);
@@ -1349,14 +1428,18 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
}
}
-#line 1236 "dkct-tr.ctr"
+#line 1329 "dkct-tr.ctr"
return back;
}
int
-dkct_tr_check(DKCT_SRC *psrc, dkChar const *fn, int sufi)
+dkct_tr_check(
+ DKCT_SRC * DK3_SILENCE_ARG_UNUSED(psrc),
+ dkChar const * DK3_SILENCE_ARG_UNUSED(fn),
+ int sufi
+)
{
int back = 0;
DKCT_STM *pstm; /* Current state machine to check. */
@@ -1364,7 +1447,9 @@ dkct_tr_check(DKCT_SRC *psrc, dkChar const *fn, int sufi)
-#line 1249 "dkct-tr.ctr"
+#line 1346 "dkct-tr.ctr"
+ DK3_UNUSED_ARG(psrc)
+ DK3_UNUSED_ARG(fn)
switch(sufi) {
case 4: {
back = dkct_gui_check(psrc);
@@ -1375,7 +1460,7 @@ dkct_tr_check(DKCT_SRC *psrc, dkChar const *fn, int sufi)
}
if(back) {
-#line 1258 "dkct-tr.ctr"
+#line 1357 "dkct-tr.ctr"
/*
Check state machines consistency
*/
@@ -1386,12 +1471,12 @@ dkct_tr_check(DKCT_SRC *psrc, dkChar const *fn, int sufi)
if(!dkct_au_stm_check(psrc, pstm)) {
back = 0;
-#line 1267 "dkct-tr.ctr"
+#line 1366 "dkct-tr.ctr"
}
}
}
-#line 1270 "dkct-tr.ctr"
+#line 1369 "dkct-tr.ctr"
return back;
}
@@ -1409,7 +1494,7 @@ dkct_tr_have_header_data(DKCT_SRC *psrc)
DKCT_STM *pstm; /* Current state machine to check for header data. */
-#line 1286 "dkct-tr.ctr"
+#line 1385 "dkct-tr.ctr"
if(psrc->hsi) {
if(dk3sto_it_next(psrc->hsi)) {
back = 1;
@@ -1439,7 +1524,7 @@ dkct_tr_have_header_data(DKCT_SRC *psrc)
}
}
-#line 1314 "dkct-tr.ctr"
+#line 1413 "dkct-tr.ctr"
return back;
}
@@ -1456,35 +1541,45 @@ dkct_tr_have_module_data(DKCT_SRC *psrc)
int back = 0;
-#line 1329 "dkct-tr.ctr"
+#line 1428 "dkct-tr.ctr"
if(psrc->msi) {
if(dk3sto_it_next(psrc->msi)) {
- back = 1;
+ back = 1;
+
+#line 1431 "dkct-tr.ctr"
}
}
if(psrc->mei) {
if(dk3sto_it_next(psrc->mei)) {
- back = 1;
+ back = 1;
+
+#line 1436 "dkct-tr.ctr"
}
}
if(psrc->cosi) {
if(dk3sto_it_next(psrc->cosi)) {
- back = 1;
+ back = 1;
+
+#line 1441 "dkct-tr.ctr"
}
}
if(psrc->coei) {
if(dk3sto_it_next(psrc->coei)) {
- back = 1;
+ back = 1;
+
+#line 1446 "dkct-tr.ctr"
}
}
if(psrc->i_stm) {
dk3sto_it_reset(psrc->i_stm);
while(dk3sto_it_next(psrc->i_stm) != NULL) {
- back = 1;
+ back = 1;
+
+#line 1452 "dkct-tr.ctr"
}
}
-#line 1355 "dkct-tr.ctr"
+#line 1454 "dkct-tr.ctr"
return back;
}
@@ -1501,7 +1596,7 @@ dkct_tr_write_text(FILE *fipo, char const * const *tptr)
char const * const *ptr; /* Write a text to file. */
-#line 1370 "dkct-tr.ctr"
+#line 1469 "dkct-tr.ctr"
ptr = tptr;
while(*ptr) {
fputs(*(ptr++), fipo);
@@ -1523,12 +1618,12 @@ dkct_tr_write_copyright_and_license_internal(
{
-#line 1390 "dkct-tr.ctr"
+#line 1489 "dkct-tr.ctr"
fputs(dkct_tr_kw8[2], psrc->fipo);
fputs(dkct_tr_kw8[0], psrc->fipo);
if(psrc->crn) {
-#line 1393 "dkct-tr.ctr"
+#line 1492 "dkct-tr.ctr"
fputs(dkct_tr_kw8[4], psrc->fipo);
if(psrc->cry) {
fputs(psrc->cry, psrc->fipo);
@@ -1544,7 +1639,7 @@ dkct_tr_write_copyright_and_license_internal(
fputs(dkct_tr_kw8[0], psrc->fipo);
-#line 1407 "dkct-tr.ctr"
+#line 1506 "dkct-tr.ctr"
}
@@ -1560,12 +1655,17 @@ dkct_tr_write_copyright_and_license_internal(
*/
static
int
-dkct_tr_need_file_description(DKCT_SRC *psrc, dkChar const *ofn)
+dkct_tr_need_file_description(
+ DKCT_SRC *DK3_SILENCE_ARG_UNUSED(psrc),
+ dkChar const *ofn
+)
{
dkChar fnb[DK3_MAX_PATH];
dk3_stat_t st;
dkChar *fns;
int back = 1;
+
+ DK3_UNUSED_ARG(psrc)
if(dk3str_len(ofn) < DK3_SIZEOF(fnb,dkChar)) {
dk3str_cpy_not_overlapped(fnb,ofn);
fns = dk3str_get_suffix(fnb);
@@ -1608,43 +1708,73 @@ dkct_tr_need_file_description(DKCT_SRC *psrc, dkChar const *ofn)
static
void
dkct_tr_write_file_start(
- DKCT_SRC *psrc, dkChar const *ofn, dkChar const *sfn, int f_hdr
+ DKCT_SRC *psrc,
+ dkChar const *ofn,
+ dkChar const * DK3_SILENCE_ARG_UNUSED(sfn),
+ int f_hdr
)
{
char const * const *license_text_ptr = NULL; /* Text pointer. */
char myfn[DK3_MAX_PATH]; /* Short file name. */
char *ptr; /* Text pointer. */
char *myshortfn;
+ int lic_done = 0;
-#line 1478 "dkct-tr.ctr"
- dkct_tr_write_text(psrc->fipo, dkct_tr_mod_warning_start);
- if(psrc->sfn) {
+#line 1586 "dkct-tr.ctr"
+ DK3_UNUSED_ARG(sfn)
+ if (NULL != psrc->sli) {
+ fputs(dkct_tr_kw8[2], psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ if (psrc->crn) {
+ fputs(dkct_tr_kw8[4], psrc->fipo);
+ if (psrc->cry) {
+ fputs(psrc->cry, psrc->fipo);
+ fputs(dkct_tr_kw8[5], psrc->fipo);
+ }
+ fputs(psrc->crn, psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[95], psrc->fipo);
+ fputs(psrc->sli, psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ fputs(dkct_tr_kw8[3], psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ lic_done = 1;
+ }
+ if (0 == (psrc->dkcto).nowarn) {
+ dkct_tr_write_text(psrc->fipo, dkct_tr_mod_warning_start);
+ if(psrc->sfn) {
fputs(dkct_tr_kw8[77], psrc->fipo);
fputs(psrc->sfn, psrc->fipo);
fputs(dkct_tr_kw8[0], psrc->fipo);
- }
- dkct_tr_write_text(psrc->fipo, dkct_tr_mod_warning_end);
- if((psrc->crn) || (psrc->cry) || (psrc->lict > -1)) {
- switch(psrc->lict) {
- case 0: { license_text_ptr = dkct_tr_bsd_text; } break;
- case 1: { license_text_ptr = dkct_tr_gpl_text; } break;
- case 2: { license_text_ptr = dkct_tr_lgpl_text; } break;
- case 3: { } break;
- case 4: { license_text_ptr = dkct_tr_commercial_text; } break;
}
- if(license_text_ptr) {
+ dkct_tr_write_text(psrc->fipo, dkct_tr_mod_warning_end);
+ }
+ if (0 == lic_done) {
+ if((psrc->crn) || (psrc->cry) || (psrc->lict > -1)) {
+ switch(psrc->lict) {
+ case 0: { license_text_ptr = dkct_tr_bsd_text; } break;
+ case 1: { license_text_ptr = dkct_tr_gpl_text; } break;
+ case 2: { license_text_ptr = dkct_tr_lgpl_text; } break;
+ case 3: { } break;
+ case 4: { license_text_ptr = dkct_tr_commercial_text; } break;
+ }
+ if(license_text_ptr) {
-#line 1494 "dkct-tr.ctr"
- dkct_tr_write_copyright_and_license_internal(psrc,license_text_ptr);
- } else {
+#line 1626 "dkct-tr.ctr"
+ dkct_tr_write_copyright_and_license_internal(psrc,license_text_ptr);
+ } else {
-#line 1496 "dkct-tr.ctr"
- /* ##### OTHER LICENSE */
+#line 1628 "dkct-tr.ctr"
+ /* ##### OTHER LICENSE */
+ }
}
}
if (((0 != f_hdr)&&(0 == psrc->doxyh))||((0 == f_hdr)&&(0 == psrc->doxym))) {
if(dk3str_string_to_c8_simple_app(myfn, sizeof(myfn), ofn, psrc->app)) {
+ /* ----- Start @file ----- */
fputs(dkct_tr_kw8[11], psrc->fipo);
if(dkct_tr_need_file_description(psrc, ofn)) {
myshortfn = dk3str_c8_rchr(myfn, DKCT_TR_SEP);
@@ -1670,6 +1800,7 @@ dkct_tr_write_file_start(
fputs(dkct_tr_kw8[3], psrc->fipo);
fputs(dkct_tr_kw8[0], psrc->fipo);
fputs(dkct_tr_kw8[0], psrc->fipo);
+ /* ----- End @file ----- */
} else {
/* ERROR: Not a simple file name! */
dkct_to_log_dk_3(psrc, 1, DK3_LL_ERROR, 12, 13, ofn);
@@ -1677,7 +1808,7 @@ dkct_tr_write_file_start(
}
-#line 1532 "dkct-tr.ctr"
+#line 1667 "dkct-tr.ctr"
}
@@ -1774,10 +1905,10 @@ dkct_tr_header_lines(DKCT_SRC *psrc, dk3_sto_it_t *iterator)
while((lp = (DKCT_LINE *)dk3sto_it_next(iterator)) != NULL) {
-#line 1627 "dkct-tr.ctr"
+#line 1762 "dkct-tr.ctr"
if(lp->t) {
-#line 1628 "dkct-tr.ctr"
+#line 1763 "dkct-tr.ctr"
psrc->lineno = lp->l;
if(psrc->shln) {
psrc->shln = 0;
@@ -1787,7 +1918,7 @@ dkct_tr_header_lines(DKCT_SRC *psrc, dk3_sto_it_t *iterator)
fputc('\n', psrc->fipo);
} else {
-#line 1636 "dkct-tr.ctr"
+#line 1771 "dkct-tr.ctr"
}
}
}
@@ -1809,7 +1940,7 @@ dkct_tr_state_machine_transition(int *st, int input)
int ns = 0; /* New state. */
-#line 1656 "dkct-tr.ctr"
+#line 1791 "dkct-tr.ctr"
switch(*st) {
case 0: { /* Initial state. */
switch(input) {
@@ -1943,7 +2074,7 @@ dkct_tr_state_machine_transition(int *st, int input)
}
*st = ns;
-#line 1788 "dkct-tr.ctr"
+#line 1923 "dkct-tr.ctr"
return back;
}
@@ -1954,7 +2085,7 @@ dkct_tr_show_filename_and_lineno(DKCT_SRC *psrc)
{
-#line 1797 "dkct-tr.ctr"
+#line 1932 "dkct-tr.ctr"
fputs(dkct_tr_kw8[18], psrc->fipo);
fputs(psrc->sfn, psrc->fipo);
fputs(dkct_tr_kw8[17], psrc->fipo);
@@ -1967,7 +2098,7 @@ dkct_tr_show_filename_and_lineno(DKCT_SRC *psrc)
fputs(dkct_tr_kw8[18], psrc->fipo);
-#line 1808 "dkct-tr.ctr"
+#line 1943 "dkct-tr.ctr"
}
@@ -2479,54 +2610,54 @@ dkct_tr_function_filename(
int ie;
-#line 2318 "dkct-tr.ctr"
+#line 2453 "dkct-tr.ctr"
if(dk3str_c8_is_abs_path(fn) || (psrc->curdi)) {
-#line 2319 "dkct-tr.ctr"
+#line 2454 "dkct-tr.ctr"
back = fn;
} else {
-#line 2321 "dkct-tr.ctr"
+#line 2456 "dkct-tr.ctr"
ie = dk3app_get_encoding(psrc->app);
if(dk3str_to_c8p_app(fnb, szfnb, psrc->ffn, ie, psrc->app)) {
ptr = dk3str_c8_rchr(fnb, (dkct_tr_kw8[78])[0]);
-#line 2324 "dkct-tr.ctr"
+#line 2459 "dkct-tr.ctr"
if(ptr) {
-#line 2325 "dkct-tr.ctr"
+#line 2460 "dkct-tr.ctr"
*ptr = '\0';
-#line 2326 "dkct-tr.ctr"
+#line 2461 "dkct-tr.ctr"
sz = dk3str_c8_len(fnb);
sz += 1;
sz += dk3str_c8_len(fn);
if(sz < szfnb) {
-#line 2330 "dkct-tr.ctr"
+#line 2465 "dkct-tr.ctr"
strcat(fnb, dkct_tr_kw8[78]);
strcat(fnb, fn);
back = fnb;
} else {
-#line 2334 "dkct-tr.ctr"
+#line 2469 "dkct-tr.ctr"
/* ERROR: Resulting file name too long! 101 */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 101);
}
} else {
-#line 2338 "dkct-tr.ctr"
+#line 2473 "dkct-tr.ctr"
back = fn;
}
} else {
-#line 2341 "dkct-tr.ctr"
+#line 2476 "dkct-tr.ctr"
/* ERROR: Non-ASCII characters in source file name! */
dkct_to_log_dk_3(psrc, 1, DK3_LL_ERROR, 102, 103, psrc->ffn);
}
}
-#line 2345 "dkct-tr.ctr"
+#line 2480 "dkct-tr.ctr"
return back;
}
@@ -2540,8 +2671,9 @@ dkct_tr_function_filename(
*/
static
int
-dkct_tr_fct_trace_off(DKCT_SRC *psrc, char *args)
+dkct_tr_fct_trace_off(DKCT_SRC *psrc, char * DK3_ARG_UNUSED(args) )
{
+ DK3_UNUSED_ARG(args)
(psrc->dkcto).deben = 0;
return 1;
}
@@ -2556,8 +2688,9 @@ dkct_tr_fct_trace_off(DKCT_SRC *psrc, char *args)
*/
static
int
-dkct_tr_fct_trace_on(DKCT_SRC *psrc, char *args)
+dkct_tr_fct_trace_on(DKCT_SRC *psrc, char * DK3_ARG_UNUSED(args) )
{
+ DK3_UNUSED_ARG(args)
(psrc->dkcto).deben = 1;
return 1;
}
@@ -2618,10 +2751,11 @@ dkct_tr_fct_trace_init(DKCT_SRC *psrc, char *args)
*/
static
int
-dkct_tr_fct_trace_end(DKCT_SRC *psrc, char *args)
+dkct_tr_fct_trace_end(DKCT_SRC *psrc, char * DK3_ARG_UNUSED(args) )
{
int back = 1;
+ DK3_UNUSED_ARG(args)
if((psrc->dkcto).deb == 1) {
fputs(dkct_tr_kw8[47], psrc->fipo);
}
@@ -2637,15 +2771,23 @@ dkct_tr_fct_trace_end(DKCT_SRC *psrc, char *args)
*/
static
int
-dkct_tr_fct_trace_include(DKCT_SRC *psrc, char *args)
+dkct_tr_fct_trace_include(DKCT_SRC *psrc, char * DK3_ARG_UNUSED(args) )
{
int back = 0;
+
+ DK3_UNUSED_ARG(args)
if((psrc->dkcto).deb) {
if(!((psrc->dkcto).tip)) {
if((psrc->dkcto).deb == 2) {
fputs(dkct_tr_kw8[68], psrc->fipo);
}
+ fputs(dkct_tr_kw8[87], psrc->fipo);
+ fputs(dkct_tr_kw8[91], psrc->fipo);
fputs(dkct_tr_kw8[44], psrc->fipo);
+ fputs(dkct_tr_kw8[92], psrc->fipo);
+ fputs(dkct_tr_kw8[93], psrc->fipo);
+ fputs(dkct_tr_kw8[94], psrc->fipo);
+ fputs(dkct_tr_kw8[88], psrc->fipo);
fputs(dkct_tr_kw8[79], psrc->fipo);
}
}
@@ -2756,7 +2898,7 @@ dkct_tr_is_end_command(char const *textline)
size_t lpat; /* Pattern length. */
-#line 2573 "dkct-tr.ctr"
+#line 2719 "dkct-tr.ctr"
if(textline) {
p1 = dk3str_c8_start(textline, NULL);
if(p1) {
@@ -2770,7 +2912,7 @@ dkct_tr_is_end_command(char const *textline)
}
}
-#line 2585 "dkct-tr.ctr"
+#line 2731 "dkct-tr.ctr"
return back;
}
@@ -2789,10 +2931,10 @@ dkct_tr_write_splint_tag(DKCT_SRC *psrc, char const *splt)
char const *p1;
-#line 2602 "dkct-tr.ctr"
+#line 2748 "dkct-tr.ctr"
if ((psrc->dkcto).spls) {
-#line 2603 "dkct-tr.ctr"
+#line 2749 "dkct-tr.ctr"
p1 = splt;
while (*p1) {
if ('@' == *p1) {
@@ -2804,10 +2946,10 @@ dkct_tr_write_splint_tag(DKCT_SRC *psrc, char const *splt)
}
} else {
-#line 2613 "dkct-tr.ctr"
+#line 2759 "dkct-tr.ctr"
}
-#line 2614 "dkct-tr.ctr"
+#line 2760 "dkct-tr.ctr"
return back;
}
@@ -2978,6 +3120,246 @@ int dkct_tr_fct_string_table(DKCT_SRC *psrc, char *args)
+/** Generate string table from the following lines.
+ @param psrc Source structure.
+ @param args Command to execute.
+ @return 1 on success, 0 on error.
+*/
+static
+int dkct_tr_fct_string_table_file(DKCT_SRC *psrc, char *args)
+{
+ char inbuf[1024]; /* Input line buffer */
+ FILE *fipo = NULL; /* String table input file */
+ char *pfilen = NULL; /* Input file name */
+ char *pmacro = NULL; /* Macro around strings */
+ char *pprefix = NULL; /* Prefix for strings */
+ char *ptr; /* Process all chars in line */
+ char *pc; /* Current string to process */
+ char *pn; /* Next string to process */
+ char *pk; /* Key string */
+ char *pv; /* Value string */
+ const dkChar *oldfilename = NULL; /* Old file name */
+ unsigned long oldlineno = 0UL; /* Old line number */
+ unsigned long lineno = 0UL; /* Current line number to process */
+ unsigned long valno = 0UL; /* Value number */
+ int isfirst = 1; /* Flag: First argument */
+ int back = 1;
+
+
+#line 2955 "dkct-tr.ctr"
+ if (NULL != args) {
+ pc = dk3str_c8_start(args, NULL);
+ while (NULL != pc) {
+ pk = pv = NULL;
+ pn = dk3str_c8_chr(pc, ',');
+ if (NULL != pn) {
+ *(pn++) = '\0';
+ pn = dk3str_c8_start(pn, NULL);
+ }
+
+#line 2964 "dkct-tr.ctr"
+ pk = dk3str_c8_start(pc, NULL);
+ if (NULL != pk) {
+ pv = dk3str_c8_chr(pk, '=');
+ if(pv) {
+ *(pv++) = '\0';
+ pv = dk3str_c8_start(pv, NULL);
+ switch(dk3str_c8_array_index(dkct_tr_string_table_args, pk, 0)) {
+ case 0: {
+ pfilen = pv;
+ } break;
+ case 1: {
+ pmacro = pv;
+ } break;
+ case 2: {
+ pprefix = pv;
+ } break;
+ default : {
+ /* ERROR: Unknown key! */
+ dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 76, 77, pk);
+ } break;
+ }
+ }
+ else {
+ if (1 == isfirst) {
+ pfilen = pk;
+ }
+ }
+ }
+ else {
+ /* ERROR: No key */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 33);
+ }
+ pc = pn;
+ isfirst = 0;
+ }
+ }
+ else {
+ /* ERROR: File name required */
+ dk3app_log_1(psrc->app, DK3_LL_ERROR, psrc->msg, 14);
+ back = 0;
+ }
+ if (1 == back) {
+ if ((NULL != pmacro) && (NULL != pprefix)) {
+ /* ERROR: macro and prefix are mutually exclusive */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 19);
+ back = 0;
+ }
+ else {
+ if (NULL != pfilen) {
+ fipo = dk3sf_c8_fopen_app(pfilen, dkct_tr_kw8[49], psrc->app);
+ if (NULL != fipo) {
+ oldfilename = dk3app_get_source_file(psrc->app);
+ oldlineno = dk3app_get_source_line(psrc->app);
+#if 1 == DK3_CHAR_SIZE
+ dk3app_set_source_file(psrc->app, pfilen);
+#endif
+ while (NULL != fgets(inbuf, sizeof(inbuf), fipo)) {
+ lineno++;
+#if 1 == DK3_CHAR_SIZE
+ dk3app_set_source_line(psrc->app, lineno);
+#endif
+ dk3str_c8_delnl(inbuf);
+ if ('#' != inbuf[0]) {
+ dk3app_squeeze_line(inbuf);
+ ptr = inbuf;
+ fprintf(psrc->fipo, dkct_tr_kw8[66], valno++);
+ if (NULL != pmacro) {
+ fputs(pmacro, psrc->fipo);
+ fputs(dkct_tr_kw8[52], psrc->fipo);
+ }
+ if (NULL != pprefix) {
+ fputs(pprefix, psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[55], psrc->fipo);
+ while (*ptr) {
+ switch (*ptr) {
+ case '\\': {
+ fputc('\\', psrc->fipo);
+ fputc('\\', psrc->fipo);
+ } break;
+ case '"': {
+ fputc('\\', psrc->fipo);
+ fputc('"', psrc->fipo);
+ } break;
+ case '\n': {
+ fputc('\\', psrc->fipo);
+ fputc('n', psrc->fipo);
+ } break;
+ case '\r': {
+ fputc('\\', psrc->fipo);
+ fputc('r', psrc->fipo);
+ } break;
+ case '\t': {
+ fputc('\\', psrc->fipo);
+ fputc('t', psrc->fipo);
+ } break;
+ default: {
+ fputc(*ptr, psrc->fipo);
+ } break;
+ }
+ ptr++;
+ }
+ fputs(dkct_tr_kw8[55], psrc->fipo);
+ if (NULL != pmacro) {
+ fputs(dkct_tr_kw8[53], psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[54], psrc->fipo);
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 3074 "dkct-tr.ctr"
+ }
+#endif
+ }
+ dk3app_set_source_file(psrc->app, oldfilename);
+ dk3app_set_source_line(psrc->app, oldlineno);
+ fclose(fipo);
+ }
+ else {
+ /* ERROR: Failed to read file (already reported) */
+ back = 0;
+ }
+ }
+ else {
+ /* ERROR: File name required */
+ dk3app_log_1(psrc->app, DK3_LL_ERROR, psrc->msg, 14);
+ }
+ }
+ }
+ dkct_tr_write_splint_tag(psrc, dkct_tr_kw8[80]);
+ fputs(dkct_tr_kw8[65], psrc->fipo);
+ dkct_tr_write_splint_tag(psrc, dkct_tr_kw8[81]);
+
+
+#line 3096 "dkct-tr.ctr"
+ return back;
+}
+
+
+
+/** Insert binary file contents as hexadecimal unsigned characters.
+ @param psrc Source structure.
+ @param args File name to include.
+ @return 1 on success, 0 on error.
+*/
+static
+int dkct_tr_fct_binary(DKCT_SRC *psrc, char *args)
+{
+ unsigned char buffer[4096]; /* Input buffer */
+ FILE *fipo = NULL; /* Input file pointer */
+ size_t szbuf = sizeof(buffer); /* Buffer size */
+ size_t rdb; /* Number of bytes read */
+ size_t i; /* Index to traverse buffer */
+ int back = 1; /* Function result */
+ int haved = 0; /* Flag: Have data */
+ int pos = 0; /* Position in line */
+
+
+#line 3118 "dkct-tr.ctr"
+ if (NULL != args) {
+ fipo = dk3sf_c8_fopen_app(args, dkct_tr_kw8[89], psrc->app);
+ if (NULL != fipo) {
+ do {
+ rdb = fread(buffer, 1, szbuf, fipo);
+ if (0 < rdb) {
+ for (i = 0; i < rdb; i++) {
+ if (0 != haved) {
+ fputc(',', psrc->fipo);
+ if (15 <= pos) {
+ pos = 0;
+ fputc('\n', psrc->fipo);
+ }
+ }
+ fprintf(psrc->fipo, dkct_tr_kw8[90], (unsigned)(buffer[i]));
+ haved = 1;
+ pos++;
+ }
+ }
+ } while (0 < rdb);
+ if (0 != haved) {
+ fputc('\n', psrc->fipo);
+ }
+ fclose(fipo);
+ }
+ else {
+ /* ERROR: Failed to read file (already reported) */
+ back = 0;
+ }
+ }
+ else {
+ /* ERROR: File name required */
+ dk3app_log_1(psrc->app, DK3_LL_ERROR, psrc->msg, 14);
+ back = 0;
+ }
+
+
+#line 3154 "dkct-tr.ctr"
+ return back;
+}
+
+
/** Generate text from the following lines.
@param psrc Source structure.
@param args Command to execute.
@@ -3009,7 +3391,7 @@ int dkct_tr_fct_text(DKCT_SRC *psrc, char *args)
if(pn) { *(pn++) = '\0'; pn = dk3str_c8_start(pn, NULL); }
-#line 2814 "dkct-tr.ctr"
+#line 3188 "dkct-tr.ctr"
pv = dk3str_c8_chr(pc, '=');
if(pv) {
*(pv++) = '\0'; pv = dk3str_c8_start(pv, NULL);
@@ -3027,16 +3409,16 @@ int dkct_tr_fct_text(DKCT_SRC *psrc, char *args)
}
} else {
-#line 2830 "dkct-tr.ctr"
+#line 3204 "dkct-tr.ctr"
switch(indr = dk3str_c8_array_index(dkct_tr_string_table_args, pc, 0)) {
case 3: {
-#line 2832 "dkct-tr.ctr"
+#line 3206 "dkct-tr.ctr"
preprocessor = 1;
} break;
default: {
-#line 2835 "dkct-tr.ctr"
+#line 3209 "dkct-tr.ctr"
/* ERROR: Not key=value pair */
dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 33);
} break;
@@ -3167,20 +3549,185 @@ int dkct_tr_fct_text(DKCT_SRC *psrc, char *args)
+/** Generate text from the following lines.
+ @param psrc Source structure.
+ @param args Command to execute.
+ @return 1 on success, 0 on error.
+*/
+static
+int dkct_tr_fct_long_string(DKCT_SRC *psrc, char *args)
+{
+ int back = 1;
+ char lb[DKCT_LINE_SIZE]; /* Line buffer. */
+ char *pmacro = NULL; /* Macro name. */
+ char *pprefix = NULL; /* Prefix name. */
+ char *pc; /* Current arg to process. */
+ char *pn; /* Next arg to process. */
+ char *pv; /* Value pointer. */
+ char *ptr; /* Current character to process. */
+ DKCT_LINE *lp; /* Current line to process. */
+ int cc; /* Flag: Can continue. */
+ int indr; /* Index search result */
+ int preprocessor = 0; /* Flag: Allow preprocessor */
+ int newlines = 0; /* Flag: Add newlines. */
+
+ pc = dk3str_c8_start(args, NULL);
+ while(pc) {
+ pn = dk3str_c8_chr(pc, ',');
+ if(pn) { *(pn++) = '\0'; pn = dk3str_c8_start(pn, NULL); }
+
+
+#line 3366 "dkct-tr.ctr"
+ pv = dk3str_c8_chr(pc, '=');
+ if(pv) {
+ *(pv++) = '\0'; pv = dk3str_c8_start(pv, NULL);
+ if(pv) {
+ switch(dk3str_c8_array_index(dkct_tr_long_string_args, pc, 0)) {
+ case 0: { newlines = dk3str_c8_is_on(pv); } break;
+ case 1: { pmacro = pv; } break;
+ case 2: { pprefix = pv; } break;
+ case 3: { preprocessor = 1; } break;
+ default: {
+ /* ERROR: Unknown key! */
+ dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 76, 77, pc);
+ } break;
+ }
+ }
+ } else {
+
+#line 3382 "dkct-tr.ctr"
+ switch(indr = dk3str_c8_array_index(dkct_tr_long_string_args, pc, 0)) {
+ case 3: {
+
+#line 3384 "dkct-tr.ctr"
+ preprocessor = 1;
+ } break;
+ case 0: {
+ newlines = 1;
+ } break;
+ default: {
+
+#line 3390 "dkct-tr.ctr"
+ /* ERROR: Not key=value pair */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 33);
+ } break;
+ }
+ }
+ pc = pn;
+ }
+ if(psrc->cursr) {
+ do {
+ cc = 0;
+ lp = (DKCT_LINE *)dk3sto_it_next(psrc->cursr);
+ if(lp) {
+ if(lp->t) {
+ cc = 1;
+ if(dkct_tr_is_end_command(lp->t)) {
+ cc = 0;
+ } else {
+ if(dk3str_c8_len(lp->t) < sizeof(lb)) {
+ dk3str_c8_cpy(lb, lp->t);
+ dk3str_c8_delnl(lb);
+ if (('#' == lb[0]) && (0 != preprocessor)) {
+ fputs(lb, psrc->fipo);
+ fputc('\n', psrc->fipo);
+ } else {
+ if(pmacro) {
+ fputs(pmacro, psrc->fipo);
+ fputs(dkct_tr_kw8[52], psrc->fipo);
+ } else {
+ if(pprefix) {
+ fputs(pprefix, psrc->fipo);
+ }
+ }
+ fputs(dkct_tr_kw8[55], psrc->fipo);
+#if VERSION_BEFORE_20120214
+ /*
+ No need to handle backslash escape sequences.
+ */
+ dk3app_squeeze_line(lb);
+#endif
+ ptr = lb;
+ if (('\\' == *ptr) && ('#' == ptr[1]) && (0 != preprocessor)) {
+ ptr++;
+ }
+ while(*ptr) {
+ switch(*ptr) {
+ case '\\': {
+ switch(ptr[1]) {
+ case '%': {
+ /* Just ignore the backslash, it is used to
+ escape the percent character.
+ */
+ } break;
+ default: {
+ fputc('\\', psrc->fipo);
+ fputc('\\', psrc->fipo);
+ } break;
+ }
+ } break;
+ case '"': {
+ fputc('\\', psrc->fipo);
+ fputc('"', psrc->fipo);
+ } break;
+ case '\n': {
+ fputc('\\', psrc->fipo);
+ fputc('n', psrc->fipo);
+ } break;
+ case '\r': {
+ fputc('\\', psrc->fipo);
+ fputc('r', psrc->fipo);
+ } break;
+ case '\t': {
+ fputc('\\', psrc->fipo);
+ fputc('t', psrc->fipo);
+ } break;
+ default: {
+ fputc(*ptr, psrc->fipo);
+ } break;
+ }
+ ptr++;
+ }
+ if (0 != newlines) {
+ fputs(dkct_tr_kw8[86], psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[55], psrc->fipo);
+ if(pmacro) {
+ fputs(dkct_tr_kw8[53], psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ }
+ } else {
+ /* ERROR: Source line too large. */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 22);
+ }
+ }
+ }
+ }
+ } while(cc);
+ }
+ return back;
+}
+
+
+
/** Function table connecting functions to names.
*/
dkct_tr_fct_table_entry const dkct_tr_fct_table[] = {
- { "trace-init", dkct_tr_fct_trace_init },
- { "trace-end", dkct_tr_fct_trace_end },
- { "trace-include", dkct_tr_fct_trace_include },
- { "trace-code", dkct_tr_fct_trace_code },
- { "!", dkct_tr_fct_trace_code },
- { "pipe", dkct_tr_fct_trace_pipe },
- { "|", dkct_tr_fct_trace_pipe },
- { "string-table", dkct_tr_fct_string_table },
- { "text", dkct_tr_fct_text },
- { "trace-on", dkct_tr_fct_trace_on },
- { "trace-off", dkct_tr_fct_trace_off },
+ { "trace-init", dkct_tr_fct_trace_init },
+ { "trace-end", dkct_tr_fct_trace_end },
+ { "trace-include", dkct_tr_fct_trace_include },
+ { "trace-code", dkct_tr_fct_trace_code },
+ { "!", dkct_tr_fct_trace_code },
+ { "pipe", dkct_tr_fct_trace_pipe },
+ { "|", dkct_tr_fct_trace_pipe },
+ { "string-table", dkct_tr_fct_string_table },
+ { "string-table-file", dkct_tr_fct_string_table_file },
+ { "string", dkct_tr_fct_long_string },
+ { "text", dkct_tr_fct_text },
+ { "trace-on", dkct_tr_fct_trace_on },
+ { "trace-off", dkct_tr_fct_trace_off },
+ { "binary-file", dkct_tr_fct_binary },
{ NULL, NULL }
};
@@ -3294,7 +3841,7 @@ dkct_tr_print_comment_box(DKCT_SRC *psrc)
size_t max; /* Box width. */
-#line 3091 "dkct-tr.ctr"
+#line 3622 "dkct-tr.ctr"
max = psrc->cbmx;
if((size_t)((psrc->dkcto).bw) > (max + 10)) {
max = (size_t)((psrc->dkcto).bw) - 10;
@@ -3311,7 +3858,7 @@ dkct_tr_print_comment_box(DKCT_SRC *psrc)
dkct_tr_comment_box_border(psrc, max);
-#line 3106 "dkct-tr.ctr"
+#line 3637 "dkct-tr.ctr"
}
@@ -3328,7 +3875,7 @@ dkct_tr_process_character(DKCT_SRC *psrc)
int action; /* State machine output. */
-#line 3121 "dkct-tr.ctr"
+#line 3652 "dkct-tr.ctr"
input = psrc->cchr;
if(psrc->cchr == '$') { input = TRACE_CONTROL; }
action = dkct_tr_state_machine_transition(&(psrc->st), input);
@@ -3411,7 +3958,7 @@ dkct_tr_process_character(DKCT_SRC *psrc)
} break;
case DKCT_O_START_BOX: {
-#line 3202 "dkct-tr.ctr"
+#line 3733 "dkct-tr.ctr"
if(psrc->cbfip) {
fclose(psrc->cbfip); psrc->cbfip = NULL;
}
@@ -3421,14 +3968,14 @@ dkct_tr_process_character(DKCT_SRC *psrc)
back = 1;
} else {
-#line 3210 "dkct-tr.ctr"
+#line 3741 "dkct-tr.ctr"
/* ERROR: Failed to open file */
dkct_to_log_3(psrc, 0, DK3_LL_ERROR, 20, 21, psrc->cbfn);
}
} break;
case DKCT_O_ADD_BOX: {
-#line 3215 "dkct-tr.ctr"
+#line 3746 "dkct-tr.ctr"
if(psrc->cbfip) {
if(psrc->cchr == '\t') {
fputc(' ', psrc->cbfip);
@@ -3447,7 +3994,7 @@ dkct_tr_process_character(DKCT_SRC *psrc)
} break;
case DKCT_O_ADD_BOX_NL: {
-#line 3232 "dkct-tr.ctr"
+#line 3763 "dkct-tr.ctr"
if(psrc->cbfip) {
fputc('\n', psrc->cbfip);
psrc->cbcp = 0;
@@ -3456,7 +4003,7 @@ dkct_tr_process_character(DKCT_SRC *psrc)
} break;
case DKCT_O_ADD_BOX_DOLLAR_CHAR: {
-#line 3239 "dkct-tr.ctr"
+#line 3770 "dkct-tr.ctr"
if(psrc->cbfip) {
fputc('$', psrc->cbfip);
psrc->cbcp += 1;
@@ -3477,7 +4024,7 @@ dkct_tr_process_character(DKCT_SRC *psrc)
} break;
case DKCT_O_END_BOX: {
-#line 3258 "dkct-tr.ctr"
+#line 3789 "dkct-tr.ctr"
if(psrc->cbfip) {
fputc('\n', psrc->cbfip);
dkct_tr_print_comment_box(psrc);
@@ -3488,7 +4035,7 @@ dkct_tr_process_character(DKCT_SRC *psrc)
} break;
}
-#line 3267 "dkct-tr.ctr"
+#line 3798 "dkct-tr.ctr"
return back;
}
@@ -3507,14 +4054,14 @@ dkct_tr_module_lines(DKCT_SRC *psrc, dk3_sto_it_t *iterator)
char const *ptr; /* Current character to process. */
-#line 3284 "dkct-tr.ctr"
+#line 3815 "dkct-tr.ctr"
if(iterator) {
psrc->cursr = iterator;
dk3sto_it_reset(iterator);
while((lp = (DKCT_LINE *)dk3sto_it_next(iterator)) != NULL) {
if(lp->t) {
-#line 3289 "dkct-tr.ctr"
+#line 3820 "dkct-tr.ctr"
psrc->lineno = lp->l;
if(psrc->app) { dk3app_set_source_line(psrc->app, lp->l); }
if(psrc->shln) {
@@ -3533,7 +4080,7 @@ dkct_tr_module_lines(DKCT_SRC *psrc, dk3_sto_it_t *iterator)
psrc->cursr = NULL;
}
-#line 3306 "dkct-tr.ctr"
+#line 3837 "dkct-tr.ctr"
return back;
}
@@ -3560,7 +4107,7 @@ dkct_tr_attempt_to_write_file(
DKCT_STM *pstm; /* State machine. */
-#line 3331 "dkct-tr.ctr"
+#line 3862 "dkct-tr.ctr"
if(dk3str_len(sfn) < DK3_SIZEOF(ofn,dkChar)) {
dk3str_cpy_not_overlapped(ofn, sfn);
ps = dk3str_get_suffix(ofn);
@@ -3568,10 +4115,10 @@ dkct_tr_attempt_to_write_file(
if((dk3str_len(ofn) + dk3str_len(osf)) < DK3_SIZEOF(ofn,dkChar)) {
dk3str_cat(ofn, osf);
-#line 3337 "dkct-tr.ctr"
+#line 3868 "dkct-tr.ctr"
if((psrc->dkcto).mak) {
-#line 3338 "dkct-tr.ctr"
+#line 3869 "dkct-tr.ctr"
f_must_run = dk3sf_must_rebuild(ofn, sfn);
}
sofn = dk3str_rchr(ofn, DK3_CHAR_SEP);
@@ -3583,13 +4130,13 @@ dkct_tr_attempt_to_write_file(
dk3app_set_source_line(psrc->app, 0UL);
if(f_must_run) {
-#line 3348 "dkct-tr.ctr"
+#line 3879 "dkct-tr.ctr"
/* Progress: Writing output file. */
dk3app_log_3(psrc->app, DK3_LL_PROGRESS, psrc->msg, 108, 109, sofn);
psrc->fipo = dk3sf_fopen_app(ofn, dk3app_not_localized(24), psrc->app);
if(psrc->fipo) {
-#line 3352 "dkct-tr.ctr"
+#line 3883 "dkct-tr.ctr"
dkct_tr_write_file_start(psrc, ofn, sfn, f_hdr);
if((psrc->dkcto).lnn) { psrc->shln = 1; }
if(f_hdr) {
@@ -3698,7 +4245,7 @@ dkct_tr_attempt_to_write_file(
}
} else {
-#line 3459 "dkct-tr.ctr"
+#line 3990 "dkct-tr.ctr"
/* ERROR: Failed to open file! */
dkct_to_log_dk_3(psrc, 0, DK3_LL_ERROR, 20, 21, ofn);
back = 0;
@@ -3709,20 +4256,20 @@ dkct_tr_attempt_to_write_file(
}
} else {
-#line 3468 "dkct-tr.ctr"
+#line 3999 "dkct-tr.ctr"
/* ERROR: File name too long! */
dkct_to_log_dk_3(psrc, 1, DK3_LL_ERROR, 26, 27, ofn);
back = 0;
}
} else {
-#line 3473 "dkct-tr.ctr"
+#line 4004 "dkct-tr.ctr"
/* File name too long! */
dkct_to_log_dk_3(psrc, 1, DK3_LL_ERROR, 26, 27, sfn);
back = 0;
}
-#line 3477 "dkct-tr.ctr"
+#line 4008 "dkct-tr.ctr"
return back;
}
@@ -3735,7 +4282,7 @@ dkct_tr_write(DKCT_SRC *psrc, dkChar const *fn, int sufi)
char fnb[128]; /* File name for temporary box file. */
-#line 3488 "dkct-tr.ctr"
+#line 4019 "dkct-tr.ctr"
psrc->cbfip = NULL;
psrc->sufi = sufi;
psrc->shln = 0;
@@ -3816,7 +4363,7 @@ dkct_tr_write(DKCT_SRC *psrc, dkChar const *fn, int sufi)
psrc->cbfn = NULL;
-#line 3567 "dkct-tr.ctr"
+#line 4098 "dkct-tr.ctr"
return back;
}
diff --git a/support/dktools/dkct-tr.ctr b/support/dktools/dkct-tr.ctr
index 851f25300e..40d0b7bd8c 100644
--- a/support/dktools/dkct-tr.ctr
+++ b/support/dktools/dkct-tr.ctr
@@ -2,12 +2,19 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
+#include "dk4conf.h"
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
#if DK3_USE_WX
#include "dkwxtrace.h"
@@ -19,6 +26,8 @@ license = bsd
#include "dk3wxcs.h"
+#include "dk3unused.h"
+
$!trace-include
@@ -146,6 +155,7 @@ static char const * const dkct_option_keywords[] = {
/* 1 */ "copyright-year",
/* 2 */ "license",
/* 3 */ "splint-comment-character",
+/* 4 */ "spdx-license-identifier",
NULL
};
@@ -181,7 +191,8 @@ NULL
*/
static char const * const dkct_tr_mod_warning_start[] = {
"/*",
-" WARNING: This file was generated by dkct.",
+" WARNING: This file was generated by the dkct program (see",
+" http://dktools.sourceforge.net/ for details).",
" Changes you make here will be lost if dkct is run again!",
" You should modify the original source and run dkct on it.",
NULL
@@ -257,11 +268,11 @@ static char const * const dkct_tr_kw8[] = {
/* 53 */ ")",
/* 54 */ ",\n\n",
/* 55 */ "\"",
-/* 56 */ "if(dktrace_file()) {\n",
+/* 56 */ "if(dktrace_file()) {\n#if (_WIN32) && defined(_MSC_VER)\n",
/* 57 */ " _setmode(_fileno(dktrace_file()), _O_U16TEXT);\n",
/* 58 */ " fputwc(0xFEFF, dktrace_file());\n",
-/* 59 */ "}\n",
-/* 60 */ "_setmode(_fileno(stdout), _O_U16TEXT);\n",
+/* 59 */ "#endif\n}\n",
+/* 60 */ "#if (_WIN32) && defined(_MSC_VER)\n_setmode(_fileno(stdout), _O_U16TEXT);\n#endif\n",
/* 61 */ "fputws(L",
/* 62 */ "fwprintf(",
/* 63 */ ", L",
@@ -288,11 +299,21 @@ static char const * const dkct_tr_kw8[] = {
/* 80 */ "/*@-nullassign@*/\n",
/* 81 */ "/*@=nullassign@*/\n",
/* 82 */
-"#if TRACE_WIDE && (defined(_WIN32) || DK3_ON_WINDOWS || DK4_ON_WINDOWS)\n",
+"#if TRACE_WIDE && ((_WIN32) || (DK3_ON_WINDOWS) || (DK4_ON_WINDOWS))\n",
/* 83 */
"#if (SIZEOF_WXCHAR > 1) || (DK4_SIZEOF_WXCHAR > 1) || (DK3_SIZEOF_WXCHAR > 1)\n",
/* 84 */ "#if (DK3_CHAR_SIZE > 1) || (DK4_CHAR_SIZE > 1)\n",
-/* 85 */ "#if (defined(_WIN32)) || (DK3_ON_WINDOWS) || (DK4_ON_WINDOWS)\n",
+/* 85 */ "#if (_WIN32) || (DK3_ON_WINDOWS) || (DK4_ON_WINDOWS)\n",
+/* 86 */ "\\n",
+/* 87 */ "#ifndef\tDK3TRACE_H_INCLUDED\n",
+/* 88 */ "#endif\n",
+/* 89 */ "rb",
+/* 90 */ "0x%02x",
+/* 91 */ "#if\tDK4_BUILDING_DKTOOLS4\n",
+/* 92 */ "#else\n",
+/* 93 */ "#include <dktools-4/dk3trace.h>\n",
+/* 94 */ "#endif\n",
+/* 95 */ "SPDX-License-Identifier: ",
NULL
};
@@ -326,6 +347,18 @@ NULL
+/** Arguments for the string-table command.
+*/
+static char const * const dkct_tr_long_string_args[] = {
+/* 0 */ "newlines",
+/* 1 */ "macro",
+/* 2 */ "prefix",
+/* 3 */ "preprocessor",
+NULL
+};
+
+
+
/** Text to include in GPL-licensed sources.
*/
static char const * const dkct_tr_gpl_text[] = {
@@ -441,7 +474,7 @@ static const int is_dk_wide =
static const int is_on_windows =
-#if DK3_ON_WINDOWS || defined(_WIN32)
+#if DK3_ON_WINDOWS || _WIN32
1
#else
0
@@ -458,11 +491,13 @@ static const int is_on_windows =
*/
static
int
-dkct_tr_line_compare(void const *l, void const *r, int cr)
+dkct_tr_line_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
DKCT_LINE const *pl; /* Left line. */
DKCT_LINE const *pr; /* Right line. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (DKCT_LINE const *)l; pr = (DKCT_LINE const *)r;
@@ -522,11 +557,13 @@ dkct_tr_line_new(char const *t, unsigned long l, dk3_app_t *app)
*/
static
int
-dkct_tr_stm_compare(void const *l, void const *r, int cr)
+dkct_tr_stm_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
DKCT_STM const *sl; /* Left state machine. */
DKCT_STM const *sr; /* Right state machine. */
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
sl = (DKCT_STM const *)l; sr = (DKCT_STM const *)r;
@@ -610,11 +647,14 @@ dkct_tr_delete(DKCT_SRC *p)
}
if(p->cry) { $? ". copyright year \"%!8s\"", p->cry
}
+ if(p->sli) { $? ". spdx license identifier \"%!8s\"", p->sli
+ }
if(p->lict > -1) { $? ". license type %d", p->lict
}
p->ffn = NULL;
dk3_release(p->crn);
dk3_release(p->cry);
+ dk3_release(p->sli);
dk3_release(p->sfn);
dk3_release(p->cmdb);
p->szcmd = 0; p->ucmd = 0; p->fipo = NULL;
@@ -656,6 +696,7 @@ dkct_tr_new(
back->sfn = NULL;
back->crn = NULL;
back->cry = NULL;
+ back->sli = NULL;
back->cmdb = NULL;
back->lict = -1;
back->st = 0;
@@ -920,10 +961,13 @@ dkct_tr_check_copyright_year(DKCT_SRC *psrc)
*/
static
int
-dkct_tr_process_option(DKCT_SRC *psrc, char *key, char *val, int sufi)
+dkct_tr_process_option(
+ DKCT_SRC *psrc, char *key, char *val, int DK3_SILENCE_ARG_UNUSED(sufi)
+)
{
int back = 0;
$? "+ dkct_tr_process_option \"%!8s\"=\"%!8s\"", key, val
+ DK3_UNUSED_ARG(sufi)
switch(dk3str_c8_array_index(dkct_option_keywords, key, 0)) {
case 0: { $? ". copyright owner"
if(psrc->crn) {
@@ -979,6 +1023,21 @@ dkct_tr_process_option(DKCT_SRC *psrc, char *key, char *val, int sufi)
}
back = 1;
} break;
+ case 4: { $? ". spdx-license-identifier"
+ if (psrc->sli) {
+ /* Warning: Redefinition of copyright owner */
+ dkct_to_log_1(psrc, 1, DK3_LL_WARNING, 128);
+ dk3_release(psrc->sli);
+ }
+ psrc->sli = dk3str_c8_dup_app(val, psrc->app);
+ if (psrc->sli) {
+ back = 1;
+ } else {
+ psrc->ec = DK3_ERROR_MEMORY;
+ /* ERROR: Memory */
+ dkct_to_log_1(psrc, 0, DK3_LL_ERROR, 29);
+ }
+ } break;
default: {
dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 10, 11, key);
back = 0;
@@ -1028,6 +1087,32 @@ dkct_tr_has_doxygen_file_comment(char *inputline)
+/** Find key/value separator, equal sign or colon.
+ @param line Line to search for character.
+ @return Valid pointer on success, NULL on error.
+*/
+static
+char *
+dkct_tr_separate_key_value(char *line)
+{
+ char *back = NULL;
+ $? "+ dkct_tr_separate_key_value \"%s\"", line
+ if (NULL != line) {
+ while ((NULL == back) && ('\0' != *line)) {
+ if (('=' == *line) || (':' == *line)) {
+ back = line;
+ }
+ else {
+ line++;
+ }
+ }
+ }
+ $? "- dkct_tr_separate_key_value %s", TR_8STR(back)
+ return back;
+}
+
+
+
int
dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
{
@@ -1137,7 +1222,15 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
p1 = dk3str_c8_start(inputline, NULL);
if(p1) {
if(*p1 != '#') {
+#if 0
+ /* 2020-08-23 Update
+ Replaced by search for equal sign or colon to allow
+ SPDX-License-Identifier: xxx
+ lines.
+ */
p2 = dk3str_c8_chr(p1, '=');
+#endif
+ p2 = dkct_tr_separate_key_value(p1);
if(p2) {
*(p2++) = '\0';
p2 = dk3str_c8_start(p2, NULL);
@@ -1239,13 +1332,19 @@ dkct_tr_read(DKCT_SRC *psrc, dkChar const *fn, int sufi)
int
-dkct_tr_check(DKCT_SRC *psrc, dkChar const *fn, int sufi)
+dkct_tr_check(
+ DKCT_SRC * DK3_SILENCE_ARG_UNUSED(psrc),
+ dkChar const * DK3_SILENCE_ARG_UNUSED(fn),
+ int sufi
+)
{
int back = 0;
DKCT_STM *pstm; /* Current state machine to check. */
unsigned long stmno; /* Index of current state machine. */
$? "+ dkct_tr_check"
+ DK3_UNUSED_ARG(psrc)
+ DK3_UNUSED_ARG(fn)
switch(sufi) {
case 4: {
back = dkct_gui_check(psrc);
@@ -1328,28 +1427,28 @@ dkct_tr_have_module_data(DKCT_SRC *psrc)
$? "+ dkct_tr_have_module_data"
if(psrc->msi) {
if(dk3sto_it_next(psrc->msi)) {
- back = 1;
+ back = 1; $? ". msi (module start)"
}
}
if(psrc->mei) {
if(dk3sto_it_next(psrc->mei)) {
- back = 1;
+ back = 1; $? ". mei (module end)"
}
}
if(psrc->cosi) {
if(dk3sto_it_next(psrc->cosi)) {
- back = 1;
+ back = 1; $? ". cosi (constructor start)"
}
}
if(psrc->coei) {
if(dk3sto_it_next(psrc->coei)) {
- back = 1;
+ back = 1; $? ". coei (constructor end)"
}
}
if(psrc->i_stm) {
dk3sto_it_reset(psrc->i_stm);
while(dk3sto_it_next(psrc->i_stm) != NULL) {
- back = 1;
+ back = 1; $? ". stm (state machines)"
}
} $? "- dkct_tr_have_module_data %d", back
return back;
@@ -1419,12 +1518,17 @@ dkct_tr_write_copyright_and_license_internal(
*/
static
int
-dkct_tr_need_file_description(DKCT_SRC *psrc, dkChar const *ofn)
+dkct_tr_need_file_description(
+ DKCT_SRC *DK3_SILENCE_ARG_UNUSED(psrc),
+ dkChar const *ofn
+)
{
dkChar fnb[DK3_MAX_PATH];
dk3_stat_t st;
dkChar *fns;
int back = 1;
+
+ DK3_UNUSED_ARG(psrc)
if(dk3str_len(ofn) < DK3_SIZEOF(fnb,dkChar)) {
dk3str_cpy_not_overlapped(fnb,ofn);
fns = dk3str_get_suffix(fnb);
@@ -1467,37 +1571,67 @@ dkct_tr_need_file_description(DKCT_SRC *psrc, dkChar const *ofn)
static
void
dkct_tr_write_file_start(
- DKCT_SRC *psrc, dkChar const *ofn, dkChar const *sfn, int f_hdr
+ DKCT_SRC *psrc,
+ dkChar const *ofn,
+ dkChar const * DK3_SILENCE_ARG_UNUSED(sfn),
+ int f_hdr
)
{
char const * const *license_text_ptr = NULL; /* Text pointer. */
char myfn[DK3_MAX_PATH]; /* Short file name. */
char *ptr; /* Text pointer. */
char *myshortfn;
+ int lic_done = 0;
$? "+ dkct_tr_write_file_start \"%!ds\"", ofn
- dkct_tr_write_text(psrc->fipo, dkct_tr_mod_warning_start);
- if(psrc->sfn) {
+ DK3_UNUSED_ARG(sfn)
+ if (NULL != psrc->sli) {
+ fputs(dkct_tr_kw8[2], psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ if (psrc->crn) {
+ fputs(dkct_tr_kw8[4], psrc->fipo);
+ if (psrc->cry) {
+ fputs(psrc->cry, psrc->fipo);
+ fputs(dkct_tr_kw8[5], psrc->fipo);
+ }
+ fputs(psrc->crn, psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[95], psrc->fipo);
+ fputs(psrc->sli, psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ fputs(dkct_tr_kw8[3], psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ lic_done = 1;
+ }
+ if (0 == (psrc->dkcto).nowarn) {
+ dkct_tr_write_text(psrc->fipo, dkct_tr_mod_warning_start);
+ if(psrc->sfn) {
fputs(dkct_tr_kw8[77], psrc->fipo);
fputs(psrc->sfn, psrc->fipo);
fputs(dkct_tr_kw8[0], psrc->fipo);
- }
- dkct_tr_write_text(psrc->fipo, dkct_tr_mod_warning_end);
- if((psrc->crn) || (psrc->cry) || (psrc->lict > -1)) {
- switch(psrc->lict) {
- case 0: { license_text_ptr = dkct_tr_bsd_text; } break;
- case 1: { license_text_ptr = dkct_tr_gpl_text; } break;
- case 2: { license_text_ptr = dkct_tr_lgpl_text; } break;
- case 3: { } break;
- case 4: { license_text_ptr = dkct_tr_commercial_text; } break;
}
- if(license_text_ptr) { $? ". license terms internally known"
- dkct_tr_write_copyright_and_license_internal(psrc,license_text_ptr);
- } else { $? "! License not found"
- /* ##### OTHER LICENSE */
+ dkct_tr_write_text(psrc->fipo, dkct_tr_mod_warning_end);
+ }
+ if (0 == lic_done) {
+ if((psrc->crn) || (psrc->cry) || (psrc->lict > -1)) {
+ switch(psrc->lict) {
+ case 0: { license_text_ptr = dkct_tr_bsd_text; } break;
+ case 1: { license_text_ptr = dkct_tr_gpl_text; } break;
+ case 2: { license_text_ptr = dkct_tr_lgpl_text; } break;
+ case 3: { } break;
+ case 4: { license_text_ptr = dkct_tr_commercial_text; } break;
+ }
+ if(license_text_ptr) { $? ". license terms internally known"
+ dkct_tr_write_copyright_and_license_internal(psrc,license_text_ptr);
+ } else { $? "! License not found"
+ /* ##### OTHER LICENSE */
+ }
}
}
if (((0 != f_hdr)&&(0 == psrc->doxyh))||((0 == f_hdr)&&(0 == psrc->doxym))) {
if(dk3str_string_to_c8_simple_app(myfn, sizeof(myfn), ofn, psrc->app)) {
+ /* ----- Start @file ----- */
fputs(dkct_tr_kw8[11], psrc->fipo);
if(dkct_tr_need_file_description(psrc, ofn)) {
myshortfn = dk3str_c8_rchr(myfn, DKCT_TR_SEP);
@@ -1523,6 +1657,7 @@ dkct_tr_write_file_start(
fputs(dkct_tr_kw8[3], psrc->fipo);
fputs(dkct_tr_kw8[0], psrc->fipo);
fputs(dkct_tr_kw8[0], psrc->fipo);
+ /* ----- End @file ----- */
} else {
/* ERROR: Not a simple file name! */
dkct_to_log_dk_3(psrc, 1, DK3_LL_ERROR, 12, 13, ofn);
@@ -2355,8 +2490,9 @@ dkct_tr_function_filename(
*/
static
int
-dkct_tr_fct_trace_off(DKCT_SRC *psrc, char *args)
+dkct_tr_fct_trace_off(DKCT_SRC *psrc, char * DK3_ARG_UNUSED(args) )
{
+ DK3_UNUSED_ARG(args)
(psrc->dkcto).deben = 0;
return 1;
}
@@ -2371,8 +2507,9 @@ dkct_tr_fct_trace_off(DKCT_SRC *psrc, char *args)
*/
static
int
-dkct_tr_fct_trace_on(DKCT_SRC *psrc, char *args)
+dkct_tr_fct_trace_on(DKCT_SRC *psrc, char * DK3_ARG_UNUSED(args) )
{
+ DK3_UNUSED_ARG(args)
(psrc->dkcto).deben = 1;
return 1;
}
@@ -2433,10 +2570,11 @@ dkct_tr_fct_trace_init(DKCT_SRC *psrc, char *args)
*/
static
int
-dkct_tr_fct_trace_end(DKCT_SRC *psrc, char *args)
+dkct_tr_fct_trace_end(DKCT_SRC *psrc, char * DK3_ARG_UNUSED(args) )
{
int back = 1;
+ DK3_UNUSED_ARG(args)
if((psrc->dkcto).deb == 1) {
fputs(dkct_tr_kw8[47], psrc->fipo);
}
@@ -2452,15 +2590,23 @@ dkct_tr_fct_trace_end(DKCT_SRC *psrc, char *args)
*/
static
int
-dkct_tr_fct_trace_include(DKCT_SRC *psrc, char *args)
+dkct_tr_fct_trace_include(DKCT_SRC *psrc, char * DK3_ARG_UNUSED(args) )
{
int back = 0;
+
+ DK3_UNUSED_ARG(args)
if((psrc->dkcto).deb) {
if(!((psrc->dkcto).tip)) {
if((psrc->dkcto).deb == 2) {
fputs(dkct_tr_kw8[68], psrc->fipo);
}
+ fputs(dkct_tr_kw8[87], psrc->fipo);
+ fputs(dkct_tr_kw8[91], psrc->fipo);
fputs(dkct_tr_kw8[44], psrc->fipo);
+ fputs(dkct_tr_kw8[92], psrc->fipo);
+ fputs(dkct_tr_kw8[93], psrc->fipo);
+ fputs(dkct_tr_kw8[94], psrc->fipo);
+ fputs(dkct_tr_kw8[88], psrc->fipo);
fputs(dkct_tr_kw8[79], psrc->fipo);
}
}
@@ -2781,6 +2927,234 @@ int dkct_tr_fct_string_table(DKCT_SRC *psrc, char *args)
+/** Generate string table from the following lines.
+ @param psrc Source structure.
+ @param args Command to execute.
+ @return 1 on success, 0 on error.
+*/
+static
+int dkct_tr_fct_string_table_file(DKCT_SRC *psrc, char *args)
+{
+ char inbuf[1024]; /* Input line buffer */
+ FILE *fipo = NULL; /* String table input file */
+ char *pfilen = NULL; /* Input file name */
+ char *pmacro = NULL; /* Macro around strings */
+ char *pprefix = NULL; /* Prefix for strings */
+ char *ptr; /* Process all chars in line */
+ char *pc; /* Current string to process */
+ char *pn; /* Next string to process */
+ char *pk; /* Key string */
+ char *pv; /* Value string */
+ const dkChar *oldfilename = NULL; /* Old file name */
+ unsigned long oldlineno = 0UL; /* Old line number */
+ unsigned long lineno = 0UL; /* Current line number to process */
+ unsigned long valno = 0UL; /* Value number */
+ int isfirst = 1; /* Flag: First argument */
+ int back = 1;
+ $? "+ dkct_tr_fct_string_table_file"
+ if (NULL != args) {
+ pc = dk3str_c8_start(args, NULL);
+ while (NULL != pc) {
+ pk = pv = NULL;
+ pn = dk3str_c8_chr(pc, ',');
+ if (NULL != pn) {
+ *(pn++) = '\0';
+ pn = dk3str_c8_start(pn, NULL);
+ } $? ". process %s", pc
+ pk = dk3str_c8_start(pc, NULL);
+ if (NULL != pk) {
+ pv = dk3str_c8_chr(pk, '=');
+ if(pv) {
+ *(pv++) = '\0';
+ pv = dk3str_c8_start(pv, NULL);
+ switch(dk3str_c8_array_index(dkct_tr_string_table_args, pk, 0)) {
+ case 0: {
+ pfilen = pv;
+ } break;
+ case 1: {
+ pmacro = pv;
+ } break;
+ case 2: {
+ pprefix = pv;
+ } break;
+ default : {
+ /* ERROR: Unknown key! */
+ dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 76, 77, pk);
+ } break;
+ }
+ }
+ else {
+ if (1 == isfirst) {
+ pfilen = pk;
+ }
+ }
+ }
+ else {
+ /* ERROR: No key */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 33);
+ }
+ pc = pn;
+ isfirst = 0;
+ }
+ }
+ else {
+ /* ERROR: File name required */
+ dk3app_log_1(psrc->app, DK3_LL_ERROR, psrc->msg, 14);
+ back = 0;
+ }
+ if (1 == back) {
+ if ((NULL != pmacro) && (NULL != pprefix)) {
+ /* ERROR: macro and prefix are mutually exclusive */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 19);
+ back = 0;
+ }
+ else {
+ if (NULL != pfilen) {
+ fipo = dk3sf_c8_fopen_app(pfilen, dkct_tr_kw8[49], psrc->app);
+ if (NULL != fipo) {
+ oldfilename = dk3app_get_source_file(psrc->app);
+ oldlineno = dk3app_get_source_line(psrc->app);
+#if 1 == DK3_CHAR_SIZE
+ dk3app_set_source_file(psrc->app, pfilen);
+#endif
+ while (NULL != fgets(inbuf, sizeof(inbuf), fipo)) {
+ lineno++;
+#if 1 == DK3_CHAR_SIZE
+ dk3app_set_source_line(psrc->app, lineno);
+#endif
+ dk3str_c8_delnl(inbuf);
+ if ('#' != inbuf[0]) {
+ dk3app_squeeze_line(inbuf);
+ ptr = inbuf;
+ fprintf(psrc->fipo, dkct_tr_kw8[66], valno++);
+ if (NULL != pmacro) {
+ fputs(pmacro, psrc->fipo);
+ fputs(dkct_tr_kw8[52], psrc->fipo);
+ }
+ if (NULL != pprefix) {
+ fputs(pprefix, psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[55], psrc->fipo);
+ while (*ptr) {
+ switch (*ptr) {
+ case '\\': {
+ fputc('\\', psrc->fipo);
+ fputc('\\', psrc->fipo);
+ } break;
+ case '"': {
+ fputc('\\', psrc->fipo);
+ fputc('"', psrc->fipo);
+ } break;
+ case '\n': {
+ fputc('\\', psrc->fipo);
+ fputc('n', psrc->fipo);
+ } break;
+ case '\r': {
+ fputc('\\', psrc->fipo);
+ fputc('r', psrc->fipo);
+ } break;
+ case '\t': {
+ fputc('\\', psrc->fipo);
+ fputc('t', psrc->fipo);
+ } break;
+ default: {
+ fputc(*ptr, psrc->fipo);
+ } break;
+ }
+ ptr++;
+ }
+ fputs(dkct_tr_kw8[55], psrc->fipo);
+ if (NULL != pmacro) {
+ fputs(dkct_tr_kw8[53], psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[54], psrc->fipo);
+ }
+#if TRACE_DEBUG
+ else { $? ". ignore comment"
+ }
+#endif
+ }
+ dk3app_set_source_file(psrc->app, oldfilename);
+ dk3app_set_source_line(psrc->app, oldlineno);
+ fclose(fipo);
+ }
+ else {
+ /* ERROR: Failed to read file (already reported) */
+ back = 0;
+ }
+ }
+ else {
+ /* ERROR: File name required */
+ dk3app_log_1(psrc->app, DK3_LL_ERROR, psrc->msg, 14);
+ }
+ }
+ }
+ dkct_tr_write_splint_tag(psrc, dkct_tr_kw8[80]);
+ fputs(dkct_tr_kw8[65], psrc->fipo);
+ dkct_tr_write_splint_tag(psrc, dkct_tr_kw8[81]);
+ $? "- dkct_tr_fct_string_table_file %d", back
+ return back;
+}
+
+
+
+/** Insert binary file contents as hexadecimal unsigned characters.
+ @param psrc Source structure.
+ @param args File name to include.
+ @return 1 on success, 0 on error.
+*/
+static
+int dkct_tr_fct_binary(DKCT_SRC *psrc, char *args)
+{
+ unsigned char buffer[4096]; /* Input buffer */
+ FILE *fipo = NULL; /* Input file pointer */
+ size_t szbuf = sizeof(buffer); /* Buffer size */
+ size_t rdb; /* Number of bytes read */
+ size_t i; /* Index to traverse buffer */
+ int back = 1; /* Function result */
+ int haved = 0; /* Flag: Have data */
+ int pos = 0; /* Position in line */
+ $? "+ dkct_tr_fct_binary"
+ if (NULL != args) {
+ fipo = dk3sf_c8_fopen_app(args, dkct_tr_kw8[89], psrc->app);
+ if (NULL != fipo) {
+ do {
+ rdb = fread(buffer, 1, szbuf, fipo);
+ if (0 < rdb) {
+ for (i = 0; i < rdb; i++) {
+ if (0 != haved) {
+ fputc(',', psrc->fipo);
+ if (15 <= pos) {
+ pos = 0;
+ fputc('\n', psrc->fipo);
+ }
+ }
+ fprintf(psrc->fipo, dkct_tr_kw8[90], (unsigned)(buffer[i]));
+ haved = 1;
+ pos++;
+ }
+ }
+ } while (0 < rdb);
+ if (0 != haved) {
+ fputc('\n', psrc->fipo);
+ }
+ fclose(fipo);
+ }
+ else {
+ /* ERROR: Failed to read file (already reported) */
+ back = 0;
+ }
+ }
+ else {
+ /* ERROR: File name required */
+ dk3app_log_1(psrc->app, DK3_LL_ERROR, psrc->msg, 14);
+ back = 0;
+ }
+ $? "- dkct_tr_fct_binary %d", back
+ return back;
+}
+
+
/** Generate text from the following lines.
@param psrc Source structure.
@param args Command to execute.
@@ -2962,20 +3336,177 @@ int dkct_tr_fct_text(DKCT_SRC *psrc, char *args)
+/** Generate text from the following lines.
+ @param psrc Source structure.
+ @param args Command to execute.
+ @return 1 on success, 0 on error.
+*/
+static
+int dkct_tr_fct_long_string(DKCT_SRC *psrc, char *args)
+{
+ int back = 1;
+ char lb[DKCT_LINE_SIZE]; /* Line buffer. */
+ char *pmacro = NULL; /* Macro name. */
+ char *pprefix = NULL; /* Prefix name. */
+ char *pc; /* Current arg to process. */
+ char *pn; /* Next arg to process. */
+ char *pv; /* Value pointer. */
+ char *ptr; /* Current character to process. */
+ DKCT_LINE *lp; /* Current line to process. */
+ int cc; /* Flag: Can continue. */
+ int indr; /* Index search result */
+ int preprocessor = 0; /* Flag: Allow preprocessor */
+ int newlines = 0; /* Flag: Add newlines. */
+
+ pc = dk3str_c8_start(args, NULL);
+ while(pc) {
+ pn = dk3str_c8_chr(pc, ',');
+ if(pn) { *(pn++) = '\0'; pn = dk3str_c8_start(pn, NULL); }
+ $? " pc = \"%!8s\"", pc
+ pv = dk3str_c8_chr(pc, '=');
+ if(pv) {
+ *(pv++) = '\0'; pv = dk3str_c8_start(pv, NULL);
+ if(pv) {
+ switch(dk3str_c8_array_index(dkct_tr_long_string_args, pc, 0)) {
+ case 0: { newlines = dk3str_c8_is_on(pv); } break;
+ case 1: { pmacro = pv; } break;
+ case 2: { pprefix = pv; } break;
+ case 3: { preprocessor = 1; } break;
+ default: {
+ /* ERROR: Unknown key! */
+ dkct_to_log_3(psrc, 1, DK3_LL_ERROR, 76, 77, pc);
+ } break;
+ }
+ }
+ } else { $? ". no pv"
+ switch(indr = dk3str_c8_array_index(dkct_tr_long_string_args, pc, 0)) {
+ case 3: { $? ". 3 found"
+ preprocessor = 1;
+ } break;
+ case 0: {
+ newlines = 1;
+ } break;
+ default: { $? " write error %d", indr
+ /* ERROR: Not key=value pair */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 33);
+ } break;
+ }
+ }
+ pc = pn;
+ }
+ if(psrc->cursr) {
+ do {
+ cc = 0;
+ lp = (DKCT_LINE *)dk3sto_it_next(psrc->cursr);
+ if(lp) {
+ if(lp->t) {
+ cc = 1;
+ if(dkct_tr_is_end_command(lp->t)) {
+ cc = 0;
+ } else {
+ if(dk3str_c8_len(lp->t) < sizeof(lb)) {
+ dk3str_c8_cpy(lb, lp->t);
+ dk3str_c8_delnl(lb);
+ if (('#' == lb[0]) && (0 != preprocessor)) {
+ fputs(lb, psrc->fipo);
+ fputc('\n', psrc->fipo);
+ } else {
+ if(pmacro) {
+ fputs(pmacro, psrc->fipo);
+ fputs(dkct_tr_kw8[52], psrc->fipo);
+ } else {
+ if(pprefix) {
+ fputs(pprefix, psrc->fipo);
+ }
+ }
+ fputs(dkct_tr_kw8[55], psrc->fipo);
+#if VERSION_BEFORE_20120214
+ /*
+ No need to handle backslash escape sequences.
+ */
+ dk3app_squeeze_line(lb);
+#endif
+ ptr = lb;
+ if (('\\' == *ptr) && ('#' == ptr[1]) && (0 != preprocessor)) {
+ ptr++;
+ }
+ while(*ptr) {
+ switch(*ptr) {
+ case '\\': {
+ switch(ptr[1]) {
+ case '%': {
+ /* Just ignore the backslash, it is used to
+ escape the percent character.
+ */
+ } break;
+ default: {
+ fputc('\\', psrc->fipo);
+ fputc('\\', psrc->fipo);
+ } break;
+ }
+ } break;
+ case '"': {
+ fputc('\\', psrc->fipo);
+ fputc('"', psrc->fipo);
+ } break;
+ case '\n': {
+ fputc('\\', psrc->fipo);
+ fputc('n', psrc->fipo);
+ } break;
+ case '\r': {
+ fputc('\\', psrc->fipo);
+ fputc('r', psrc->fipo);
+ } break;
+ case '\t': {
+ fputc('\\', psrc->fipo);
+ fputc('t', psrc->fipo);
+ } break;
+ default: {
+ fputc(*ptr, psrc->fipo);
+ } break;
+ }
+ ptr++;
+ }
+ if (0 != newlines) {
+ fputs(dkct_tr_kw8[86], psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[55], psrc->fipo);
+ if(pmacro) {
+ fputs(dkct_tr_kw8[53], psrc->fipo);
+ }
+ fputs(dkct_tr_kw8[0], psrc->fipo);
+ }
+ } else {
+ /* ERROR: Source line too large. */
+ dkct_to_log_1(psrc, 1, DK3_LL_ERROR, 22);
+ }
+ }
+ }
+ }
+ } while(cc);
+ }
+ return back;
+}
+
+
+
/** Function table connecting functions to names.
*/
dkct_tr_fct_table_entry const dkct_tr_fct_table[] = {
- { "trace-init", dkct_tr_fct_trace_init },
- { "trace-end", dkct_tr_fct_trace_end },
- { "trace-include", dkct_tr_fct_trace_include },
- { "trace-code", dkct_tr_fct_trace_code },
- { "!", dkct_tr_fct_trace_code },
- { "pipe", dkct_tr_fct_trace_pipe },
- { "|", dkct_tr_fct_trace_pipe },
- { "string-table", dkct_tr_fct_string_table },
- { "text", dkct_tr_fct_text },
- { "trace-on", dkct_tr_fct_trace_on },
- { "trace-off", dkct_tr_fct_trace_off },
+ { "trace-init", dkct_tr_fct_trace_init },
+ { "trace-end", dkct_tr_fct_trace_end },
+ { "trace-include", dkct_tr_fct_trace_include },
+ { "trace-code", dkct_tr_fct_trace_code },
+ { "!", dkct_tr_fct_trace_code },
+ { "pipe", dkct_tr_fct_trace_pipe },
+ { "|", dkct_tr_fct_trace_pipe },
+ { "string-table", dkct_tr_fct_string_table },
+ { "string-table-file", dkct_tr_fct_string_table_file },
+ { "string", dkct_tr_fct_long_string },
+ { "text", dkct_tr_fct_text },
+ { "trace-on", dkct_tr_fct_trace_on },
+ { "trace-off", dkct_tr_fct_trace_off },
+ { "binary-file", dkct_tr_fct_binary },
{ NULL, NULL }
};
diff --git a/support/dktools/dkct-tr.h b/support/dktools/dkct-tr.h
index ab2311ccb9..af90e25e21 100644
--- a/support/dktools/dkct-tr.h
+++ b/support/dktools/dkct-tr.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2011-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
/** @file dkct-tr.h Header file for the dkct-tr module.
*/
@@ -57,6 +61,7 @@ typedef struct {
unsigned long lngr; /**< Line number of general rule. */
int wrh; /**< Flag: Write definitions to header. */
int section; /**< Current section. */
+ int usedef; /**< Flag: Use defines instead of enums. */
} DKCT_STM;
@@ -103,6 +108,7 @@ typedef struct {
char const *sfn; /**< Short file name. */
char const *crn; /**< Copyright name. */
char const *cry; /**< Copyright year. */
+ char const *sli; /**< SPDX license identifier. */
char *cmdb; /**< Command buffer. */
char *cbfn; /**< Comment box file name. */
unsigned long lineno; /**< Current line number. */
@@ -324,42 +330,6 @@ dkct_tr_get_kw8(size_t sz);
void
dkct_tr_show_filename_and_lineno(DKCT_SRC *psrc);
-/** Log one message.
- @param psrc Source structure.
- @param scope Scope (0=GUI only, 1=app+GUI).
- @param ll Log level.
- @param i1 Index of message text in \a psrc->msg.
-*/
-void
-dkct_to_log_1(DKCT_SRC *psrc, int scope, int ll, size_t i1);
-
-/** Log one message.
- @param psrc Source structure.
- @param scope Scope (0=GUI only, 1=app+GUI).
- @param ll Log level.
- @param i1 Index of message text in \a psrc->msg.
- @param i2 Index of second fixed text in \a psrc->msg.
- @param text Variable text part.
-*/
-void
-dkct_to_log_3(
- DKCT_SRC *psrc, int scope, int ll, size_t i1, size_t i2, char const *text
-);
-
-/** Log one message.
- @param psrc Source structure.
- @param scope Scope (0=GUI only, 1=app+GUI).
- @param ll Log level.
- @param i1 Index of message text in \a psrc->msg.
- @param i2 Index of second fixed text in \a psrc->msg.
- @param text Variable text part.
-*/
-void
-dkct_to_log_dk_3(
- DKCT_SRC *psrc, int scope, int ll, size_t i1, size_t i2, dkChar const *text
-);
-
-
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/dkct.c b/support/dktools/dkct.c
index 1c4a8944e3..63bf574652 100644
--- a/support/dktools/dkct.c
+++ b/support/dktools/dkct.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkct.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkct.ctr
*/
@@ -39,6 +17,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file dkct.c Dirk Krause's C/C++ tool.
*/
+#include "dk4conf.h"
#if DK3_USE_WX
#include "dkwxtrace.h"
@@ -46,9 +25,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dkct.h"
#endif
+#include "dk3enc.h"
+
-#line 22 "dkct.ctr"
+
+
+#line 27 "dkct.ctr"
@@ -108,7 +91,7 @@ dkT(""),
NULL
-#line 80 "dkct.ctr"
+#line 85 "dkct.ctr"
};
@@ -131,7 +114,8 @@ static dk3_option_t const dkct_options[] = {
{ dkT('w'), dkT("windows-wide-char"), 0 },
{ dkT('p'), dkT("portable-output"), 0 },
{ dkT('S'), dkT("splint"), 0 },
- { dkT('\0'),dkT("splint-comment-char"), 1 }
+ { dkT('\0'),dkT("splint-comment-char"), 1 },
+ { dkT('\0'),dkT("no-modification-warning"), 0 }
};
/** Number of options in the \a dkct_options array.
*/
@@ -221,6 +205,19 @@ dkT("-b <width>"),
dkT("--box-width=<width>"),
dkT("\tBox with for comment boxes."),
dkT(""),
+dkT("-S"),
+dkT("--splint"),
+dkT("\tWrite annotation comments for the splint program."),
+dkT(""),
+dkT("--splint-comment-char=<character>"),
+dkT("\tUse the specified character to mark splint comments."),
+dkT(""),
+dkT("--no-modification-warning"),
+dkT("\tSuppress the warning at the beginning of output files."),
+dkT("\tThese warnings tell the user to not modify the output files produced"),
+dkT("\tby dkct, users should modify the input files processed by dkct"),
+dkT("\tinstead."),
+dkT(""),
dkT("-h"),
dkT("--help"),
dkT("\tShow help text."),
@@ -239,7 +236,7 @@ dkT("The program returns 0 on success, any other value indicates an error."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/dkct%20manual/"),
dkT(""),
dkT("AUTHOR"),
dkT(""),
@@ -254,7 +251,7 @@ dkT(""),
NULL
-#line 224 "dkct.ctr"
+#line 243 "dkct.ctr"
};
@@ -270,6 +267,7 @@ dkct_option_set_init(DKCT_OPTION_SET *o)
o->bw = 78; o->tkw = 0; o->ts = 0; o->win = 0;
o->tip = 0; o->deben = 1; o->port = 0;
o->spls = '\0';
+ o->nowarn = 0;
}
@@ -325,7 +323,7 @@ dkct_process_arguments(DKCT_J *j)
dkChar const *arg; /* Argument value. */
-#line 293 "dkct.ctr"
+#line 313 "dkct.ctr"
j->opt = dk3opt_open_from_app(
dkct_options,
dkct_sz_options,
@@ -339,6 +337,9 @@ dkct_process_arguments(DKCT_J *j)
if(dk3opt_is_set(j->opt, dkT('R'))) {
dkct_option_set_init(&(j->dkcto));
}
+ if (dk3opt_is_set_long(j->opt, dkct_options[16].lo)) {
+ (j->dkcto).nowarn = 1;
+ }
if(dk3opt_is_set(j->opt, dkT('d'))) {
(j->dkcto).deb = 1;
}
@@ -402,49 +403,58 @@ dkct_process_arguments(DKCT_J *j)
#if VERSION_BEFORE_20140611
if (dk3opt_is_set(j->opt, dkT('S'))) {
-#line 368 "dkct.ctr"
+#line 391 "dkct.ctr"
arg = dk3opt_get_short_arg(j->opt, dkT('S'));
if (arg) {
-#line 370 "dkct.ctr"
+#line 393 "dkct.ctr"
if (dk3str_len(arg) == 1) {
-#line 371 "dkct.ctr"
+#line 394 "dkct.ctr"
if (128 > (int)(*arg)) {
-#line 372 "dkct.ctr"
+#line 395 "dkct.ctr"
(j->dkcto).spls = (char)(*arg);
} else {
-#line 374 "dkct.ctr"
+#line 397 "dkct.ctr"
j->exval = DKT_RESULT_ERR_OPTION; back = 0;
/* ##### ERROR: Not an ASCII character */
}
} else {
-#line 378 "dkct.ctr"
+#line 401 "dkct.ctr"
j->exval = DKT_RESULT_ERR_OPTION; back = 0;
/* ##### ERROR: Just one character allowed */
}
} else {
-#line 382 "dkct.ctr"
+#line 405 "dkct.ctr"
j->exval = DKT_RESULT_ERR_OPTION; back = 0;
}
}
#else
if (dk3opt_is_set_long(j->opt, dkct_options[14].lo)) {
-#line 387 "dkct.ctr"
+#line 410 "dkct.ctr"
arg = dk3opt_get_long_arg(j->opt, dkct_options[14].lo);
if (arg) {
if (1 == dk3str_len(arg)) {
- if (128 > (int)(*arg)) {
+#if DK3_CHAR_SIZE > 1
+ if (128UL > dk3enc_dk_to_ul(*arg)) {
(j->dkcto).spls = (char)(*arg);
} else {
/* ##### ERROR: Not an ASCII character! */
j->exval = DKT_RESULT_ERR_OPTION; back = 0;
}
+#else
+ if (128 > (int)((unsigned char)(*arg))) {
+ (j->dkcto).spls = (char)(*arg);
+ } else {
+ /* ##### ERROR: Not an ASCII character! */
+ j->exval = DKT_RESULT_ERR_OPTION; back = 0;
+ }
+#endif
} else {
/* ##### ERROR: Exactly one character required! */
j->exval = DKT_RESULT_ERR_OPTION; back = 0;
@@ -455,17 +465,17 @@ dkct_process_arguments(DKCT_J *j)
}
} else {
-#line 405 "dkct.ctr"
+#line 437 "dkct.ctr"
}
if (dk3opt_is_set(j->opt, dkT('S'))) {
-#line 407 "dkct.ctr"
+#line 439 "dkct.ctr"
if ('\0' == (j->dkcto).spls) {
(j->dkcto).spls = '@';
}
} else {
-#line 411 "dkct.ctr"
+#line 443 "dkct.ctr"
}
#endif
} else {
@@ -475,7 +485,7 @@ dkct_process_arguments(DKCT_J *j)
j->exval = DKT_RESULT_ERR_OPTION;
}
-#line 419 "dkct.ctr"
+#line 451 "dkct.ctr"
return back;
}
@@ -497,7 +507,7 @@ dkct_really_run_for_file(DKCT_J *j, dkChar const *fn, int sufi)
int success; /* Flag: Success so far. */
-#line 439 "dkct.ctr"
+#line 471 "dkct.ctr"
pstart = dk3str_rchr(fn, DK3_CHAR_SEP);
if(pstart) {
pstart++;
@@ -508,21 +518,21 @@ dkct_really_run_for_file(DKCT_J *j, dkChar const *fn, int sufi)
ie = dk3app_get_encoding(j->app);
if(dk3str_to_c8p_app(shn, sizeof(shn), pstart, ie, j->app)) {
-#line 448 "dkct.ctr"
+#line 480 "dkct.ctr"
psrc = dkct_tr_new(&(j->dkcto), shn, sufi, j->app, fn);
if(psrc) {
-#line 450 "dkct.ctr"
+#line 482 "dkct.ctr"
success = 0;
if(j->curdi) { psrc->curdi = 1; }
psrc->msg = j->msg;
dk3app_log_1(j->app, DK3_LL_PROGRESS, j->msg, 106);
if(dkct_tr_read(psrc, fn, sufi)) {
-#line 455 "dkct.ctr"
+#line 487 "dkct.ctr"
if(dkct_tr_check(psrc, fn, sufi)) {
-#line 456 "dkct.ctr"
+#line 488 "dkct.ctr"
if(dkct_tr_write(psrc, fn, sufi)) {
success = 1;
}
@@ -540,6 +550,14 @@ dkct_really_run_for_file(DKCT_J *j, dkChar const *fn, int sufi)
j->exval = DKT_RESULT_ERR_INPUT;
} break;
}
+ } else {
+ if (DK3_ERROR_NONE != psrc->ec) {
+ switch (psrc->ec) {
+ case DK3_ERROR_SYNTAX: {
+ j->exval = DKT_RESULT_ERR_INPUT;
+ } break;
+ }
+ }
}
dkct_tr_delete(psrc); psrc = NULL;
} else {
@@ -549,7 +567,7 @@ dkct_really_run_for_file(DKCT_J *j, dkChar const *fn, int sufi)
}
-#line 481 "dkct.ctr"
+#line 521 "dkct.ctr"
}
@@ -573,7 +591,7 @@ dkct_run_for_file(DKCT_J *j, dkChar const *fn)
unsigned long oldsourceline; /* Old source line number. */
-#line 503 "dkct.ctr"
+#line 543 "dkct.ctr"
oldsourcename = dk3app_get_source_file(j->app);
oldsourceline = dk3app_get_source_line(j->app);
if(j->curdi) {
@@ -635,7 +653,7 @@ dkct_run_for_file(DKCT_J *j, dkChar const *fn)
dk3app_set_source_line(j->app, oldsourceline);
-#line 563 "dkct.ctr"
+#line 603 "dkct.ctr"
}
@@ -839,7 +857,7 @@ dkct_run(DKCT_J *j)
*/
static
void
-dkct_show_license(DKCT_J *j)
+dkct_show_license(void)
{
dkChar const * const *sptr; /* Pointer to traverse text. */
@@ -865,10 +883,10 @@ DK3_MAIN
dkChar cd[DK3_MAX_PATH]; /* Buffer for current directory. */
-#line 791 "dkct.ctr"
+#line 831 "dkct.ctr"
-#line 792 "dkct.ctr"
+#line 832 "dkct.ctr"
dkct_job_init(&j);
j.app = dk3app_open_command(
argc, (dkChar const * const *)argv, dkct_group_name
@@ -892,7 +910,7 @@ DK3_MAIN
dk3sf_fputc(dkT('\n'), stdout);
}
if((j.cmd) & DK3_APP_CMD_LICENSE) {
- dkct_show_license(&j);
+ dkct_show_license();
}
if((j.cmd) & DK3_APP_CMD_HELP) {
dk3app_help(j.app, dkct_help_file_name, dkct_help_text);
@@ -907,10 +925,10 @@ DK3_MAIN
dkct_job_cleanup(&j);
-#line 829 "dkct.ctr"
+#line 869 "dkct.ctr"
-#line 830 "dkct.ctr"
+#line 870 "dkct.ctr"
fflush(stdout);
exit(exval); return exval;
}
diff --git a/support/dktools/dkct.ctr b/support/dktools/dkct.ctr
index 72bddf85cc..ea09cf623c 100644
--- a/support/dktools/dkct.ctr
+++ b/support/dktools/dkct.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,7 @@ license = bsd
/** @file dkct.c Dirk Krause's C/C++ tool.
*/
+#include "dk4conf.h"
#if DK3_USE_WX
#include "dkwxtrace.h"
@@ -18,6 +19,10 @@ license = bsd
#include "dkct.h"
#endif
+#include "dk3enc.h"
+
+
+
$!trace-include
@@ -99,7 +104,8 @@ static dk3_option_t const dkct_options[] = {
{ dkT('w'), dkT("windows-wide-char"), 0 },
{ dkT('p'), dkT("portable-output"), 0 },
{ dkT('S'), dkT("splint"), 0 },
- { dkT('\0'),dkT("splint-comment-char"), 1 }
+ { dkT('\0'),dkT("splint-comment-char"), 1 },
+ { dkT('\0'),dkT("no-modification-warning"), 0 }
};
/** Number of options in the \a dkct_options array.
*/
@@ -190,6 +196,19 @@ OPTIONS
--box-width=<width>
Box with for comment boxes.
+-S
+--splint
+ Write annotation comments for the splint program.
+
+--splint-comment-char=<character>
+ Use the specified character to mark splint comments.
+
+--no-modification-warning
+ Suppress the warning at the beginning of output files.
+ These warnings tell the user to not modify the output files produced
+ by dkct, users should modify the input files processed by dkct
+ instead.
+
-h
--help
Show help text.
@@ -208,7 +227,7 @@ The program returns 0 on success, any other value indicates an error.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/dkct%20manual/
AUTHOR
@@ -236,6 +255,7 @@ dkct_option_set_init(DKCT_OPTION_SET *o)
o->bw = 78; o->tkw = 0; o->ts = 0; o->win = 0;
o->tip = 0; o->deben = 1; o->port = 0;
o->spls = '\0';
+ o->nowarn = 0;
}
@@ -303,6 +323,9 @@ dkct_process_arguments(DKCT_J *j)
if(dk3opt_is_set(j->opt, dkT('R'))) {
dkct_option_set_init(&(j->dkcto));
}
+ if (dk3opt_is_set_long(j->opt, dkct_options[16].lo)) {
+ (j->dkcto).nowarn = 1;
+ }
if(dk3opt_is_set(j->opt, dkT('d'))) {
(j->dkcto).deb = 1;
}
@@ -387,12 +410,21 @@ dkct_process_arguments(DKCT_J *j)
arg = dk3opt_get_long_arg(j->opt, dkct_options[14].lo);
if (arg) {
if (1 == dk3str_len(arg)) {
- if (128 > (int)(*arg)) {
+#if DK3_CHAR_SIZE > 1
+ if (128UL > dk3enc_dk_to_ul(*arg)) {
(j->dkcto).spls = (char)(*arg);
} else {
/* ##### ERROR: Not an ASCII character! */
j->exval = DKT_RESULT_ERR_OPTION; back = 0;
}
+#else
+ if (128 > (int)((unsigned char)(*arg))) {
+ (j->dkcto).spls = (char)(*arg);
+ } else {
+ /* ##### ERROR: Not an ASCII character! */
+ j->exval = DKT_RESULT_ERR_OPTION; back = 0;
+ }
+#endif
} else {
/* ##### ERROR: Exactly one character required! */
j->exval = DKT_RESULT_ERR_OPTION; back = 0;
@@ -470,6 +502,14 @@ dkct_really_run_for_file(DKCT_J *j, dkChar const *fn, int sufi)
j->exval = DKT_RESULT_ERR_INPUT;
} break;
}
+ } else {
+ if (DK3_ERROR_NONE != psrc->ec) {
+ switch (psrc->ec) {
+ case DK3_ERROR_SYNTAX: {
+ j->exval = DKT_RESULT_ERR_INPUT;
+ } break;
+ }
+ }
}
dkct_tr_delete(psrc); psrc = NULL;
} else {
@@ -763,7 +803,7 @@ dkct_run(DKCT_J *j)
*/
static
void
-dkct_show_license(DKCT_J *j)
+dkct_show_license(void)
{
dkChar const * const *sptr; /* Pointer to traverse text. */
@@ -812,7 +852,7 @@ DK3_MAIN
dk3sf_fputc(dkT('\n'), stdout);
}
if((j.cmd) & DK3_APP_CMD_LICENSE) {
- dkct_show_license(&j);
+ dkct_show_license();
}
if((j.cmd) & DK3_APP_CMD_HELP) {
dk3app_help(j.app, dkct_help_file_name, dkct_help_text);
diff --git a/support/dktools/dkct.h b/support/dktools/dkct.h
index 890048290b..45dc39497b 100644
--- a/support/dktools/dkct.h
+++ b/support/dktools/dkct.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2011-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DKCT_H_INCLUDED
#define DKCT_H_INCLUDED 1
@@ -27,6 +31,7 @@ typedef struct {
int win; /**< Flag: Add support for Windows wide chars. */
int port; /**< Flag: Produce portable output (implies win). */
int tip; /**< Flag: trace include printed. */
+ int nowarn; /**< Flag: Do not write warning at start of file. */
char spls; /**< Splint special character. */
} DKCT_OPTION_SET;
diff --git a/support/dktools/dkct.rc b/support/dktools/dkct.rc
index 6fd61494e7..56e649fd99 100644
--- a/support/dktools/dkct.rc
+++ b/support/dktools/dkct.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Dirk Krause's C tool\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Dirk Krause's C tool\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dkct\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dkctinst.ico b/support/dktools/dkctinst.ico
index 6e3d218787..4b639aedc4 100644
--- a/support/dktools/dkctinst.ico
+++ b/support/dktools/dkctinst.ico
Binary files differ
diff --git a/support/dktools/dkctunin.ico b/support/dktools/dkctunin.ico
index ad4acae0ae..76fd38dab1 100644
--- a/support/dktools/dkctunin.ico
+++ b/support/dktools/dkctunin.ico
Binary files differ
diff --git a/support/dktools/dkdbt.c b/support/dktools/dkdbt.c
index 8771fa2569..c2aa0eb9b2 100644
--- a/support/dktools/dkdbt.c
+++ b/support/dktools/dkdbt.c
@@ -1,306 +1,175 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkdbt.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkdbt.ctr
*/
/** @file dkdbt.c The dkdbt module.
*/
-/** @defgroup dkct_state_machine_dkdbt_sql_split The dkdbt_sql_split state machine. */
-/**@{*/
-
-#ifndef ST_BT
-/** State: Backtick text. */
-#line 31 "dkdbt.ctr"
-#define ST_BT 0
-#else
+/** States for state machine dkdbt_sql_split.
+*/
+enum {
+ /** State: Backtick text.
+ */
#line 31 "dkdbt.ctr"
-#error "Redefinition of ST_BT"
-#endif
+ ST_BT = 0,
-#ifndef ST_BT_BS
-/** State: Backtick text, backslash found. */
-#line 32 "dkdbt.ctr"
-#define ST_BT_BS 1
-#else
+ /** State: Backtick text, backslash found.
+ */
#line 32 "dkdbt.ctr"
-#error "Redefinition of ST_BT_BS"
-#endif
+ ST_BT_BS = 1,
-#ifndef ST_CB
-/** State: Normal text, closing bracket found. */
-#line 20 "dkdbt.ctr"
-#define ST_CB 2
-#else
+ /** State: Normal text, closing bracket found.
+ */
#line 20 "dkdbt.ctr"
-#error "Redefinition of ST_CB"
-#endif
+ ST_CB = 2,
-#ifndef ST_CB_CO
-/** State: Normal text, bracket and comma found. */
+ /** State: Normal text, bracket and comma found.
+ */
#line 21 "dkdbt.ctr"
-#define ST_CB_CO 3
-#else
-#line 21 "dkdbt.ctr"
-#error "Redefinition of ST_CB_CO"
-#endif
+ ST_CB_CO = 3,
-#ifndef ST_CO
-/** State: Comment. */
+ /** State: Comment.
+ */
#line 24 "dkdbt.ctr"
-#define ST_CO 4
-#else
-#line 24 "dkdbt.ctr"
-#error "Redefinition of ST_CO"
-#endif
+ ST_CO = 4,
-#ifndef ST_CO_AST
-/** State: Comment, asterisk found. */
+ /** State: Comment, asterisk found.
+ */
#line 25 "dkdbt.ctr"
-#define ST_CO_AST 5
-#else
-#line 25 "dkdbt.ctr"
-#error "Redefinition of ST_CO_AST"
-#endif
+ ST_CO_AST = 5,
-#ifndef ST_DQ
-/** State: Double quote text. */
+ /** State: Double quote text.
+ */
#line 29 "dkdbt.ctr"
-#define ST_DQ 6
-#else
-#line 29 "dkdbt.ctr"
-#error "Redefinition of ST_DQ"
-#endif
+ ST_DQ = 6,
-#ifndef ST_DQ_BS
-/** State: Double quote text, backslash found. */
+ /** State: Double quote text, backslash found.
+ */
#line 30 "dkdbt.ctr"
-#define ST_DQ_BS 7
-#else
-#line 30 "dkdbt.ctr"
-#error "Redefinition of ST_DQ_BS"
-#endif
+ ST_DQ_BS = 7,
-#ifndef ST_ERROR
-/** State: Any error occured. */
+ /** State: Any error occured.
+ */
#line 33 "dkdbt.ctr"
-#define ST_ERROR 8
-#else
-#line 33 "dkdbt.ctr"
-#error "Redefinition of ST_ERROR"
-#endif
+ ST_ERROR = 8,
-#ifndef ST_LCO
-/** State: Line comment. */
-#line 26 "dkdbt.ctr"
-#define ST_LCO 9
-#else
+ /** State: Line comment.
+ */
#line 26 "dkdbt.ctr"
-#error "Redefinition of ST_LCO"
-#endif
+ ST_LCO = 9,
-#ifndef ST_MINUS
-/** State: Normal text, one minus found. */
+ /** State: Normal text, one minus found.
+ */
#line 23 "dkdbt.ctr"
-#define ST_MINUS 10
-#else
-#line 23 "dkdbt.ctr"
-#error "Redefinition of ST_MINUS"
-#endif
+ ST_MINUS = 10,
-#ifndef ST_N
-/** State: Normal text. */
-#line 18 "dkdbt.ctr"
-#define ST_N 11
-#else
+ /** State: Normal text.
+ */
#line 18 "dkdbt.ctr"
-#error "Redefinition of ST_N"
-#endif
+ ST_N = 11,
-#ifndef ST_N_BS
-/** State: Normal text, backslash found. */
-#line 19 "dkdbt.ctr"
-#define ST_N_BS 12
-#else
+ /** State: Normal text, backslash found.
+ */
#line 19 "dkdbt.ctr"
-#error "Redefinition of ST_N_BS"
-#endif
+ ST_N_BS = 12,
-#ifndef ST_Q
-/** State: Single quote text. */
-#line 27 "dkdbt.ctr"
-#define ST_Q 13
-#else
+ /** State: Single quote text.
+ */
#line 27 "dkdbt.ctr"
-#error "Redefinition of ST_Q"
-#endif
+ ST_Q = 13,
-#ifndef ST_Q_BS
-/** State: Single quote text, backslash found. */
+ /** State: Single quote text, backslash found.
+ */
#line 28 "dkdbt.ctr"
-#define ST_Q_BS 14
-#else
-#line 28 "dkdbt.ctr"
-#error "Redefinition of ST_Q_BS"
-#endif
+ ST_Q_BS = 14,
-#ifndef ST_SL
-/** State: Normal text, slash found. */
-#line 22 "dkdbt.ctr"
-#define ST_SL 15
-#else
+ /** State: Normal text, slash found.
+ */
#line 22 "dkdbt.ctr"
-#error "Redefinition of ST_SL"
-#endif
+ ST_SL = 15
+};
-#ifndef I_ANY
-/** State machine input: Any text. */
-#line 36 "dkdbt.ctr"
-#define I_ANY 0
-#else
+/** Inputs for state machine dkdbt_sql_split.
+*/
+enum {
+ /** State machine input: Any text.
+ */
#line 36 "dkdbt.ctr"
-#error "Redefinition of I_ANY"
-#endif
+ I_ANY = 0,
-#ifndef I_AST
-/** State machine input: Asterisk. */
+ /** State machine input: Asterisk.
+ */
#line 39 "dkdbt.ctr"
-#define I_AST 1
-#else
-#line 39 "dkdbt.ctr"
-#error "Redefinition of I_AST"
-#endif
+ I_AST = 1,
-#ifndef I_BS
-/** State machine input: Backslash. */
+ /** State machine input: Backslash.
+ */
#line 37 "dkdbt.ctr"
-#define I_BS 2
-#else
-#line 37 "dkdbt.ctr"
-#error "Redefinition of I_BS"
-#endif
+ I_BS = 2,
-#ifndef I_BT
-/** State machine input: Backtick. */
+ /** State machine input: Backtick.
+ */
#line 42 "dkdbt.ctr"
-#define I_BT 3
-#else
-#line 42 "dkdbt.ctr"
-#error "Redefinition of I_BT"
-#endif
+ I_BT = 3,
-#ifndef I_CL
-/** State machine input: Closing bracket. */
+ /** State machine input: Closing bracket.
+ */
#line 43 "dkdbt.ctr"
-#define I_CL 4
-#else
-#line 43 "dkdbt.ctr"
-#error "Redefinition of I_CL"
-#endif
+ I_CL = 4,
-#ifndef I_COMMA
-/** State machine input: Comma. */
+ /** State machine input: Comma.
+ */
#line 44 "dkdbt.ctr"
-#define I_COMMA 5
-#else
-#line 44 "dkdbt.ctr"
-#error "Redefinition of I_COMMA"
-#endif
+ I_COMMA = 5,
-#ifndef I_DQ
-/** State machine input: Double quote. */
+ /** State machine input: Double quote.
+ */
#line 41 "dkdbt.ctr"
-#define I_DQ 6
-#else
-#line 41 "dkdbt.ctr"
-#error "Redefinition of I_DQ"
-#endif
+ I_DQ = 6,
-#ifndef I_MINUS
-/** State machine input: Minus sign. */
+ /** State machine input: Minus sign.
+ */
#line 45 "dkdbt.ctr"
-#define I_MINUS 7
-#else
-#line 45 "dkdbt.ctr"
-#error "Redefinition of I_MINUS"
-#endif
+ I_MINUS = 7,
-#ifndef I_NL
-/** State machine input: Newline. */
+ /** State machine input: Newline.
+ */
#line 46 "dkdbt.ctr"
-#define I_NL 8
-#else
-#line 46 "dkdbt.ctr"
-#error "Redefinition of I_NL"
-#endif
+ I_NL = 8,
-#ifndef I_Q
-/** State machine input: Single quote. */
-#line 40 "dkdbt.ctr"
-#define I_Q 9
-#else
+ /** State machine input: Single quote.
+ */
#line 40 "dkdbt.ctr"
-#error "Redefinition of I_Q"
-#endif
+ I_Q = 9,
-#ifndef I_SL
-/** State machine input: Slash. */
+ /** State machine input: Slash.
+ */
#line 38 "dkdbt.ctr"
-#define I_SL 10
-#else
-#line 38 "dkdbt.ctr"
-#error "Redefinition of I_SL"
-#endif
+ I_SL = 10
+};
-#ifndef O_NL
-/** State machine output: Append newline to current output. */
-#line 50 "dkdbt.ctr"
-#define O_NL 0
-#else
+/** Outputs for state machine dkdbt_sql_split.
+*/
+enum {
+ /** State machine output: Append newline to current output.
+ */
#line 50 "dkdbt.ctr"
-#error "Redefinition of O_NL"
-#endif
+ O_NL = 0,
-#ifndef O_NORMAL
-/** State machine output: Normal output. */
-#line 49 "dkdbt.ctr"
-#define O_NORMAL 1
-#else
+ /** State machine output: Normal output.
+ */
#line 49 "dkdbt.ctr"
-#error "Redefinition of O_NORMAL"
-#endif
-
-/**@}*/
+ O_NORMAL = 1
+};
/** Reset dkdbt_sql_split state machine.
@param st Pointer to state variable.
@@ -854,7 +723,7 @@ dkT("This software uses code from the following projects either directly"),
dkT("or as a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/ for more information."),
#if DK3_USE_DB
dkT(""),
dkT("Berkeley DB\tBerkeley DB: An embedded database programmatic toolkit."),
diff --git a/support/dktools/dkdbt.ctr b/support/dktools/dkdbt.ctr
index f249fecb38..daca3b691c 100644
--- a/support/dktools/dkdbt.ctr
+++ b/support/dktools/dkdbt.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -488,7 +488,7 @@ dkT("This software uses code from the following projects either directly"),
dkT("or as a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/ for more information."),
#if DK3_USE_DB
dkT(""),
dkT("Berkeley DB\tBerkeley DB: An embedded database programmatic toolkit."),
diff --git a/support/dktools/dkdbt.rc b/support/dktools/dkdbt.rc
index 3c3df1cb0a..1badc8a740 100644
--- a/support/dktools/dkdbt.rc
+++ b/support/dktools/dkdbt.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Database tool\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Database tool\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dkdbt\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dkdbt2.c b/support/dktools/dkdbt2.c
index 425ccca16f..553a5e8dd3 100644
--- a/support/dktools/dkdbt2.c
+++ b/support/dktools/dkdbt2.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkdbt2.ctr
+Copyright (C) 2015-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkdbt2.ctr
*/
/** @file dkdbt2.c The dkdbt2 module.
@@ -55,6 +33,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4app.h"
#include "dk4vers.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
/** Actions the program can perform.
@@ -85,7 +66,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -112,27 +94,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -206,7 +188,7 @@ dkT(""),
NULL
-#line 176 "dkdbt2.ctr"
+#line 180 "dkdbt2.ctr"
};
@@ -286,7 +268,7 @@ dkT(""),
NULL
-#line 208 "dkdbt2.ctr"
+#line 212 "dkdbt2.ctr"
};
@@ -318,7 +300,7 @@ dkT("dkdbt.str"),
NULL
-#line 235 "dkdbt2.ctr"
+#line 239 "dkdbt2.ctr"
};
@@ -335,7 +317,7 @@ dkT("Failed to restore previous signal handlers!"),
NULL
-#line 252 "dkdbt2.ctr"
+#line 256 "dkdbt2.ctr"
};
@@ -404,13 +386,25 @@ static int action = DKDBT_ACTION_COPY;
/** Expected input encoding on stdin.
*/
-static int input_enc_s = DK4_FILE_ENCODING_ASCII;
+static int input_enc_s =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Expected input encoding on input files.
*/
-static int input_enc_f = DK4_FILE_ENCODING_ASCII;
+static int input_enc_f =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
@@ -850,10 +844,10 @@ int main(int argc, char *argv[])
dk4_sig_atomic_t shp = 0;
-#line 765 "dkdbt2.ctr"
+#line 781 "dkdbt2.ctr"
-#line 766 "dkdbt2.ctr"
+#line 782 "dkdbt2.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
@@ -873,12 +867,12 @@ int main(int argc, char *argv[])
#endif
if (0 != shp) {
-#line 784 "dkdbt2.ctr"
+#line 800 "dkdbt2.ctr"
/* ##### ERROR: Writing to pipe failed */
}
if (0 != sig_read_atomic(&sig_had_int)) {
-#line 787 "dkdbt2.ctr"
+#line 803 "dkdbt2.ctr"
/* ##### ERROR: Interrupted */
}
} else {
@@ -894,10 +888,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 801 "dkdbt2.ctr"
+#line 817 "dkdbt2.ctr"
-#line 802 "dkdbt2.ctr"
+#line 818 "dkdbt2.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/dkdbt2.ctr b/support/dktools/dkdbt2.ctr
index 90c8aba497..c279120ca6 100644
--- a/support/dktools/dkdbt2.ctr
+++ b/support/dktools/dkdbt2.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2015-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -23,6 +23,9 @@ license = bsd
#include "dk4app.h"
#include "dk4vers.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
/** Actions the program can perform.
@@ -54,7 +57,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -81,27 +85,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -317,13 +321,25 @@ static int action = DKDBT_ACTION_COPY;
/** Expected input encoding on stdin.
*/
-static int input_enc_s = DK4_FILE_ENCODING_ASCII;
+static int input_enc_s =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
/** Expected input encoding on input files.
*/
-static int input_enc_f = DK4_FILE_ENCODING_ASCII;
+static int input_enc_f =
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+;
diff --git a/support/dktools/dkicon.ico b/support/dktools/dkicon.ico
index c07cdafd81..e348c5e02f 100644
--- a/support/dktools/dkicon.ico
+++ b/support/dktools/dkicon.ico
Binary files differ
diff --git a/support/dktools/dkicon.xpm b/support/dktools/dkicon.xpm
deleted file mode 100644
index 69c420c91e..0000000000
--- a/support/dktools/dkicon.xpm
+++ /dev/null
@@ -1,40 +0,0 @@
-/* XPM */
-static const char *xpm_dkicon[] = {
-/* width height ncolors chars_per_pixel */
-"16 16 17 1",
-/* colors */
-" c #000000",
-". c #FDD200",
-"X c #DCB700",
-"o c #F7CE00",
-"O c #050400",
-"+ c #A48800",
-"@ c #FFD400",
-"# c #241E00",
-"$ c #B29400",
-"% c #685600",
-"& c #BA9A00",
-"* c #EBC300",
-"= c #504200",
-"- c #AB8E00",
-"; c #8D7500",
-": c #CAA800",
-"> c None",
-/* pixels */
-"@@@@@@@@@@@@@@@@",
-"@$---&*@@@@@@@@@",
-"@: $+=O&@@@@@@@@",
-"@X :@@==@@@@@@@@",
-"@X :@@;O.@@@@@@@",
-"@X :@@%#@@@@@@@@",
-"@X :@o#+@@@@@@@@",
-"@- %=#-@@@@@@@@@",
-"@....@@@*%#-@+%X",
-"@@@@@@@@@+O@&%.@",
-"@@@@@@@@@+O&%.@@",
-"@@@@@@@@@+O##*@@",
-"@@@@@@@@@+O*#=.@",
-"@@@@@@@@@+O.:O%o",
-"@@@@@@@@*;;-@&;$",
-"@@@@@@@@@@@@@@@@"
-};
diff --git a/support/dktools/dkt-version.h b/support/dktools/dkt-version.h
index 8c08c3c96a..096e8aa77e 100644
--- a/support/dktools/dkt-version.h
+++ b/support/dktools/dkt-version.h
@@ -1,3 +1,5 @@
+
+
#ifndef DKT_VERSION_H_INCLUDED
/** Protection from multiple inclusions.
*/
@@ -9,16 +11,16 @@
/** Current version.
*/
-#define DKT_CHAR_VERSION "3.18.10"
+#define DKT_CHAR_VERSION "4.26.0"
/** Current version.
*/
-#define DKT_VERSION dkT("3.18.10")
+#define DKT_VERSION dkT("4.26.0")
#if DK3_USE_WX
/** Current version.
*/
-#define DKT_WXCHAR_VERSION wxT("3.18.10")
+#define DKT_WXCHAR_VERSION wxT("4.26.0")
#endif
#endif
diff --git a/support/dktools/dkt.h b/support/dktools/dkt.h
index c7695c9e70..c9709ac5db 100644
--- a/support/dktools/dkt.h
+++ b/support/dktools/dkt.h
@@ -1,4 +1,9 @@
/*
+Copyright 2011-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
@@ -6,7 +11,7 @@
*/
/*
-Copyright (C) 2011-2015, Dirk Krause
+Copyright (C) 2011-2020, Dirk Krause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -43,6 +48,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#line 10 "dkt.ctr"
+#ifndef DK3_CONF_H_INCLUDED
+#include "dk3conf.h"
+#endif
#if DK3_HAVE_OPENSSL_RAND_H
#include <openssl/rand.h>
diff --git a/support/dktools/dktools-el.spec b/support/dktools/dktools-el.spec
index 13237847d4..f6662536ae 100644
--- a/support/dktools/dktools-el.spec
+++ b/support/dktools/dktools-el.spec
@@ -7,7 +7,7 @@ Vendor: Dirk Krause
# Packager: Dirk Krause
Group: Applications/System
License: BSD
-URL: http://dktools.sourceforge.net/index.html
+URL: http://sourceforge.net/p/dktools/wiki/Home/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel wxGTK wxGTK-devel
diff --git a/support/dktools/dktools-el6.spec b/support/dktools/dktools-el6.spec
index a97cdd1883..9616fe8b13 100644
--- a/support/dktools/dktools-el6.spec
+++ b/support/dktools/dktools-el6.spec
@@ -1,37 +1,36 @@
-#
-# If you think the *.spec files need corrections, please send me a
-# complete working *.spec file, not just a bug report.
-# I moved my laptop from Scientific Linux to Debian (they still
-# provide a 32 bit version with recent software), so I do no longer
-# have access to machines I could use to test *.spec files.
+# SPEC file to build Fedora and EL packages.
#
Name: dktools
-Version: 4.8.3
-Source: file:///home/krause/work/dktools-4.8.3.tar.gz
+Version: 4.30.2
+Source: file:///home/krause/work/dktools-4.30.2.tar.gz
Release: 1%{?dist}
Summary: Dirk Krause's tools and libraries
Vendor: Dirk Krause
# Packager: Dirk Krause
Group: Applications/System
License: BSD
-URL: http://dktools.sourceforge.net/index.html
+URL: http://sourceforge.net/p/dktools/wiki/Home/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel wxGTK wxGTK-devel
-Requires: zlib bzip2 openssl mysql-libs libpng libjpeg libtiff net-snmp wxGTK
+BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel db4-devel wxGTK3 wxGTK3-devel
+Requires: zlib bzip2 openssl mysql-libs libpng libjpeg libtiff net-snmp db4 wxGTK3
Conflicts: dktools-rescue
Prefix: %{_prefix}
# ___PROVIDES___
+# ----- RPMLINT (Fedora Core 27) -----
+# In the lines below the spelling checker finds false positives:
+# wxWidgets htb dk fic bmm blks eradisk recoding sqlsplit mysqldump
+# uid pwgen recv dkdbt octpgfpl.
%description
A set of tools for graphics conversion, text conversion, software
development, administration and printing and some general-purpose tools.
bmpp / wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
fig2lat Convert FIG to PGF,EPS+TeX,PDF+TeX,EPS,SVG
- wximgsz Suggest good sizes to rescale bitmap images
+ wximgsz Suggest good sizes to scale bitmap images
htmlbook Publish HTML like a book
- dkct / wxdkct Preprocessor for C, C++, Objective-C and Java
+ dkct Preprocessor for C, C++, Objective-C and Java
(debugging/tracing, state machines, wxWidgets GUIs)
dkwxwiz Create project skeleton for wxWidgets+dktools based programs
wxdkhtb Viewer for *.htb help files
@@ -39,10 +38,11 @@ development, administration and printing and some general-purpose tools.
dk-ls ls clone, configurable column order
dk-fic File integrity checker
dk-bmm Backup media manager (10 tape rotation)
- dk-blks Correct data stream blocksize (for use with dd)
+ dk-blks Correct data stream block size (for use with dd)
dk-eradisk Create data stream to erase a disk
dk-hex Show data in hexadecimal or octal notation
dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-lines Select lines by line start pattern or line numbers
dk-sort sort clone, processes ASCII/UTF-8/UTF-16
dk-t2h Text to HTML converter
dk-t2l Text to LaTeX converter
@@ -64,12 +64,51 @@ development, administration and printing and some general-purpose tools.
%build
-%configure --enable-packaging
+%configure --enable-packaging --with-systemd=no
+echo buildroot %{buildroot}
+echo prefix %{_prefix}
+echo libdir %{_libdir}
+echo unitdir %{_unitdir}
+
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
+echo 'I: chmod 0755' %{buildroot}%{_libdir}/lib*.so.*
+chmod 0755 %{buildroot}%{_libdir}/lib*.so.*
+if [ ! -d "%{buildroot}%{_datadir}/licenses" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses"
+ chmod 755 "%{buildroot}%{_datadir}/licenses"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/licenses/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/licenses/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+if [ ! -d "%{buildroot}%{_datadir}/doc" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc"
+ chmod 755 "%{buildroot}%{_datadir}/doc"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/doc/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/doc/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/doc/dktools/LICENSE
+echo 'I: Copying INSTALL'
+cp INSTALL %{buildroot}%{_datadir}/doc/dktools/INSTALL
+echo 'I: Copying README'
+cp README %{buildroot}%{_datadir}/doc/dktools/README
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/INSTALL
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/README
%clean
rm -rf $RPM_BUILD_ROOT
@@ -81,70 +120,24 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/*
%{_libdir}/libdk3*.so.*
%{_libdir}/libdk4*.so.*
+%{_libexecdir}/dktools/*
%{_datadir}/applications/*
%{_datadir}/dktools
%{_datadir}/dk4app
%{_datadir}/man/man1/*
%{_datadir}/man/man5/*
-%{_sysconfdir}/printqd/printqd.conf.sample
-%{_sysconfdir}/rshdown/rshdown.conf.sample
-%config %{_sysconfdir}/dk3app/dk3paper.conf
+%{_datadir}/doc/dktools/*
+%{_datadir}/licenses/dktools/*
+%config(noreplace) %{_sysconfdir}/dk3app/dk3paper.conf
+%config(noreplace) %{_sysconfdir}/dk4app/dk4gra.conf
%post
-# ##### ATTEMPT TO GUESS USER AND GROUP FOR LPRng LPD DAEMON
-#
-LPUSER=`getent passwd | grep '^daemon:' | cut -f 1 -d :`
-if [ "X$LPUSER" = "X" ]
-then
- LPUSER=`getent passwd | grep '^lp:' | cut -f 1 -d :`
-fi
-if [ "X$LPUSER" = "X" ]
-then
- LPUSER="root"
-fi
-LPGROUP=`getent group | grep '^daemon:' | cut -f 1 -d :`
-if [ "X$LPGROUP" = "X" ]
-then
- LPGROUP=`getent group | grep '^lp:' | cut -f 1 -d :`
-fi
-if [ "X$LPGROUP" = "X" ]
-then
- LPGROUP="root"
-fi
-#
-# #####
-#
-#
-#
-# ##### LINUX DISTRIBUTION PACKAGERS
-# ##### If your distribution contains the LPRng software, please
-# ##### uncomment the two lines below and set LPUSER and LPGROUP to
-# ##### the user and group used to run the LPRng lpd daemon on
-# ##### your distribution.
-# ##### Optionally remove the lines above attempting to guess these names.
-#
-# LPUSER="daemon"
-# LPGROUP="daemon"
-#
-# #####
-for i in /var/printqd /var/log/printqd /var/run/printqd
-do
- [ -d $i ] || mkdir -p $i
- chown -R ${LPUSER}:${LPGROUP} $i
- chmod 770 $i
-done
ldconfig
%postun
-if [ "X$1" = "X0" ]
-then
- [ ! -d /var/run/printqd ] || rm -fr /var/run/printqd
- [ ! -d /var/log/printqd ] || rm -fr /var/log/printqd
-fi
ldconfig
-
#
# The rescue sub-package installs only those binaries useful on
# a rescue live system.
@@ -199,14 +192,44 @@ ldconfig
%postun rescue
ldconfig
+%package rshdown
+Summary: Remote shutdown daemon
+Requires: dktools = %{version}-%{release} zlib bzip2
+Prefix: %{_prefix}
+%description rshdown
+Using rshdown you can initiate a remote shutdown.
+%files rshdown
+%defattr(-,root,root,-)
+%{_sbindir}/rshdown
+%{_sbindir}/rshdown-init
+%{_sysconfdir}/rshdown/rshdown.conf.sample
+%{_sysconfdir}/init.d/rshdown
+%config(noreplace) %{_sysconfdir}/rshdown/rshdown.conf
+
+
+
+%package printqd
+Summary: Print quota daemon for LPRng
+Requires: dktools = %{version}-%{release} zlib bzip2
+Prefix: %{_prefix}
+
+%description printqd
+Printqd is a daemon to enforce print quota for the LPRng print system.
+
+%files printqd
+%defattr(-,root,root,-)
+%{_sbindir}/printqd
+%{_sysconfdir}/printqd/printqd.conf.sample
+%{_sysconfdir}/init.d/printqd
+%config(noreplace) %{_sysconfdir}/printqd/printqd.conf
%package devel
Summary: Development files for libraries from the DK tools project
Group: Development/Libraries
-Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc wxGTK wxGTK-devel
+Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc db4-devel wxGTK3 wxGTK3-devel
Prefix: %{_prefix}
%description devel
@@ -216,12 +239,310 @@ files provided by this project.
%files devel
%defattr(-,root,root,-)
-%{_includedir}/*
+%{_includedir}/dktools-4
%{_libdir}/pkgconfig/dktools.pc
%{_libdir}/libdk3*.so
%{_libdir}/libdk4*.so
%changelog
+* Tue Sep 15 2020 Dirk Krause <krause.dirk@web.de> 4.30.2-1
+- Added SPDX-License-Identifier tags to many files.
+- Corrected full license terms back to original BSD-3-Clause text.
+
+* Sun Aug 23 2020 Dirk Krause <krause.dirk@web.de> 4.30.1-1
+- Upgrade for dkct, can use SPDX-License-Identifier lines.
+
+* Thu Aug 20 2020 Dirk Krause <krause.dirk@web.de> 4.30.0-1
+- Added the Dk4WxYesNoDialog class to the libdk4wx library because
+ the wxMessageBox from the libwxgtk3.0-0v5 package in Debian 10 does
+ not localize the button texts.
+- Bugfix in wxdkdraw, added menu items to create arcs.
+- Bugfix in the dk4gra module, pattern size for octagons now matches
+ the pattern size for circles.
+- Yes / no dialogs with localized button texts in wxdkdraw.
+
+* Thu Jul 16 2020 Dirk Krause <krause.dirk@web.de> 4.29.3-1
+- Bugfix in wxdkdraw: Line width 0 elements are highlighted as
+ selection/copy/move/delete/grouping candidates now.
+- Modified htmlbook again for flexbox placement of navigation menu lists
+ if the navigation menu is shown below the main content.
+
+* Thu Jul 16 2020 Dirk Krause <krause.dirk@web.de> 4.29.2-1
+- Modified htmlbook so we can create more responsive designs.
+
+* Sat Jun 27 2020 Dirk Krause <krause.dirk@web.de> 4.29.1-1
+- More markers are written by the itadmin program to the dhcpd.conf output.
+- Modified mklivesys.sh script. We can now inject files into the
+ initramfs filesystem of a live system.
+- Removed libreoffice-style-galaxy from package lists for live systems.
+
+* Mon Apr 13 2020 Dirk Krause <krause.dirk@web.de> 4.29.0-1
+- Bugfix in wxdkdraw: Draw control sets focus on itself in mouse enter
+ events and mouse click events when compiled on Windows.
+ I hope to get the mouse wheel working on Windows.
+- Bugfix in wximgsz: The string table in German language was completed.
+- New function dk4uc2l_string_encoded() in dk4uc2l module.
+
+* Thu Mar 26 2020 Dirk Krause <krause.dirk@web.de> 4.28.1-1
+- Bugfix in wxdkdraw: Do no longer show "Modify spline point s value"
+ dialog in move spline point operations.
+
+* Wed Feb 19 2020 Dirk Krause <krause.dirk@web.de> 4.28.0-1
+- New program: wxdkdraw, minimalistic drawing program for use with LaTeX.
+- Wximgsz rewritten for DK libraries 4.
+ Uses spin controls for input instead of standard text fields.
+- Library API change: The enum values DK4WX_AUTOSTART_REACTION_IGNORE and
+ alike were moved into a public enum in the Dk4WxAutostartController class.
+- Library API change: The a and b parameters in the
+ dk4gratool_dist_point_point() function were changed to const, the a, b and
+ p parameters in dk4gratool_dist_point_track() too.
+- Library API change: The new dk4bb_add_bb() function in the dk4bb module
+ allows to create a bounding box for a drawing from the object bounding
+ boxes.
+
+* Wed Nov 27 2019 Dirk Krause <krause.dirk@web.de> 4.27.0-1
+- Distinction between K and k in size specifications (K=1024, k=1000),
+ M/m, G/g, T/t, P/p, E/e, Z/z, Y/y (powers of 1024, powers of 1000).
+- Bugfix in build process, size of wxChar calculated in configure script.
+- Bugfix in dkwxwiz, corrected name of XPM source.
+
+* Fri Oct 18 2019 Dirk Krause <krause.dirk@web.de> 4.26.0-1
+- Install header files into the includedir/dktools-4 directory.
+- Daemons rshdown and printqd are systemd compatible now.
+- Module dk4dmt modified for systemd compatibility.
+- PID files now in /run/... when systemd is used, /var/run/... otherwise.
+- Build scripts check for systemd use and install systemd service unit files
+ when systemd in use, traditional start scripts otherwise.
+- Build scripts modified for MinGW-w64 build and later probably cross-builds.
+- Program pjsnmp is now installed into libexec directory.
+- Packaging for RPM and DEB packages changed, separated packages for
+ printqd and rshdown.
+- New module dk4bm for bit matrices.
+- New module dk4bml to levelize graphs represented by bit matrices.
+- Bugfix in the dk4apref module: Parameter pv is const, but the buffer
+ was modified.
+- Bugfix in dk4sock25 and dk4sock31 modules: FreeAddrInfo() replaced
+ by FreeAddrInfoW(). This bug was not relevant when using MSVC to build
+ Windows binaries as the FreeAddrInfo() macro is mapped to the
+ FreeAddrInfoW() function when using makefile.vc.
+- Modification in the dk4mem module: Fallback functions only compiled
+ if needed.
+
+* Thu Sep 26 2019 Dirk Krause <krause.dirk@web.de> 4.25.0-1
+- Bugfix in the dk-cat program. The program attempted to issue a byte order
+ marker depending on the systems default encoding instead of the used
+ output encoding.
+- Module dk4itmin added to search for a local minimum of an unimodal
+ function in an interval.
+
+* Thu Aug 15 2019 Dirk Krause <krause.dirk@web.de> 4.24.2-1
+- Bugfix in the dkwt/dkwtadm program. The program did not properly inform
+ all windows about environment modifications.
+
+* Sun Aug 04 2019 Dirk Krause <krause.dirk@web.de> 4.24.1-1
+- Added dk-bin2c program to convert binary data to C source code
+ (array of unsigned char literals).
+- Added markdown documentation for live systems.
+- Classes Dk4Comparable and Dk4Container modified for C++11/C++17.
+
+* Sun Jul 14 2019 Dirk Krause <krause.dirk@web.de> 4.24.0-1
+- Modifications to follow the "Updating to the latest version of wxWidgets"
+ document.
+
+* Sun Jun 16 2019 Dirk Krause <krause.dirk@web.de> 4.23.0-1
+- Bugfix in 32 bit Linux/Unix build process, 64 bit file size support
+ was inactive on 32 bit Linux/Unix in previous versions.
+- Variables to store leightweight class objects returned by c_str().
+- Font feature "script" added, font feature enumeration values changed.
+
+* Tue Apr 16 2019 Dirk Krause <krause.dirk@web.de> 4.22.0-1
+- Configuration default for cosp in the fig2lat program changed to yes.
+- Added some previously internal functions to the API.
+- Functions to calculate 2D and 3D X-spline segment lengths.
+- Option "x-spline sub segments" for dk4gra.conf, "xsss" for language
+ selection. This option specifies the number of Bezier spline segments
+ to draw for each X-spline segment.
+- Parameter "rot" in the text functions in the dk4grpgf and dk4pppt modules
+ to specify the text rotation in degree.
+- Bugfix in dk-lines program to avoid dereferencing NULL pointer.
+- Cleanup, a new directory gui-img with subdirectories was created.
+ The *.ico and *.xpm files were moved from the source code directory
+ into the subdirectories.
+
+* Sat Nov 17 2018 Dirk Krause <krause.dirk@web.de> 4.21.0-1
+- Added complaint to dkct if GUI object has no parent object
+ (is not mentioned as contents of another object).
+- Modified Dk4WxColourView class to show difference between
+ active/inactive state and to place colour chooser over colour view.
+
+* Thu Nov 01 2018 Dirk Krause <krause.dirk@web.de> 4.20.0-1
+- Function $!string added to dkct.
+- Added functions dk4ma_int_from_double() and dk4ma_uint_from_double()
+ to convert double values to int and unsigned.
+
+* Tue Oct 16 2018 Dirk Krause <krause.dirk@web.de> 4.19.1-1
+- Bugfix in Makefile.in for parallel make.
+
+* Sat Oct 13 2018 Dirk Krause <krause.dirk@web.de> 4.19.0-1
+- Functions to calculate greatest common divisor and least common multiple.
+- Function for conversion to smaller integer types.
+- Function to convert UTF-8 encoded strings to wxChar strings.
+- Added event generation to Dk4WxColourView class.
+- Installing printqd and rshdown to /usr/sbin now.
+- File /etc/init.d/printqd to start and stop printqd service.
+
+* Sun Jul 29 2018 Dirk Krause <krause.dirk@web.de> 4.18.1-1
+- Removed misleading warning from dkct shown when a "direction" attribute
+ was assigned to a wxScrollBar.
+
+* Thu Jul 26 2018 Dirk Krause <krause.dirk@web.de> 4.18.0-1
+- Added --no-modification-warning option to dkct.
+ This option suppresses the warning at the beginning of output files
+ advising users to modify the input files processed by dkct instead
+ of the output files produced by the program.
+- Added new modules dk4mai8du8, dk4mai8di8, dk4mai8du16, dk4mai8di16,
+ dk4mai8du32 and dk4mai8di32 to read uint8_t ... int32_t.
+
+* Sat Jul 07 2018 Dirk Krause <krause.dirk@web.de> 4.17.0-1
+- Added options "privacy link" and "privacy page" to htmlbook configuration.
+- Added comments to HTML output of htmlbook.
+- Changed to a faster iteration algorithm in fig2lat and libdk3fig.
+- Added module dk4iter for numeric iterations to libdk4c.
+
+* Sun May 27 2018 Dirk Krause <krause.dirk@web.de> 4.16.0-1
+- Alternative colour chooser added, uses palettes.
+- Dk4WxColourView can be set to be inactive.
+- Former Dk4WxColorView renamed to Dk4WxColourView for consistence,
+ some methods also renamed for consistence.
+- Containers wxChoicebook, wxListbook, wxSimplebook, wxToolbook and
+ wxTreebook now supported by dkct.
+- Attribute text allowed for wxPanel to add panels to book controls.
+- Stock menu items and stock buttons allowed in dkct.
+
+* Sun May 20 2018 Dirk Krause <krause.dirk@web.de> 4.15.0-1
+- Added dk4xsp module for X-spline calculations.
+- Modified configure.ac due to warnings from Debian package building about
+ symbols not found in any library.
+- Added new constants
+ DK4_UINT8_0, DK4_INT8_0, DK4_UINT16_0, DK4_INT16_0, DK4_UINT32_0, DK4_INT32_0
+ to dktypes.h file.
+
+* Sat May 05 2018 Dirk Krause <krause.dirk@web.de> 4.14.1-1
+- Bugfix in Makefile.in and configure.ac, library libdk4ma.a
+ was not mentioned as dependency for libdk4maio8d.a.
+
+* Thu Apr 19 2018 Dirk Krause <krause.dirk@web.de> 4.14.0-1
+- The configure script now checks the presence of the search.h include
+ file and the availability of the qsort() and bsearch() functions.
+- Modified dkrgra, dk4graa and dk4pppt. A flags set was added to text
+ output functions, so we can order a white box and/or an oval box.
+- Modified dk4fpe.h file, it does no longer include compiler pragmas
+ to enable access to the floating point environment.
+ Users might want to apply the pragma to portions of code only
+ and not necessarily to entire source files.
+
+* Sun Apr 15 2018 Dirk Krause <krause.dirk@web.de> 4.13.0-1
+- Added dk4pppt module.
+- Added functions to configure font size and LaTeX preamble lines in
+ dk4gra and dk4graa modules.
+- Added functions to write a char string LaTeX encoded to a stream
+ in the dk4uc2l and dk4uc2la modules.
+- Corrected some error messages in the dk4graa module.
+- Added dk4rec27 module containing the dk4recode_c8_to_dk() function
+ to convert char strings (plain, Win1252, UTF-8) to dkChar strings.
+
+* Thu Apr 12 2018 Dirk Krause <krause.dirk@web.de> 4.12.1-1
+- Changed default for expected encoding when processing standard input
+ or input from file to DK4_FILE_ENCODING_WIN1252 to allow processing
+ of text containing the Euro currency symbol.
+- Renamed some encodings.
+- Release mechanism modified: Presence of the preview.txt file indicates
+ to build not an official release.
+
+* Fri Apr 06 2018 Dirk Krause <krause.dirk@web.de> 4.12.0-1
+- Rewrote bmpp and wxbmpp for library version 4.
+- Modified dk4align.h for separated enum types for text and image
+ alignment.
+- Added dk4mao8dns module to write double values without scientific notation.
+- Packaging changed, packaging script do no longer deal with directories
+ for printqd. Printqd can only be used with the LPRng print system which
+ is not available as package. Users install that software manually
+ deciding about UID and GID to run LPRng at build time.
+ So our package postinstallation and preremoval scripts can not know
+ which UID and GID is used for LPRng.
+
+* Sat Feb 10 2018 Dirk Krause <krause.dirk@web.de> 4.11.4-1
+- The dkct program now checks state machine descriptions for duplicated
+ numeric values for states, inputs and outputs.
+ State, input and output names are checked whether or not they are
+ valid identifiers in the C programming language.
+- State, input, and output definitions are now written as enums by default
+ instead of defines. When using doxygen, this results in a more readable
+ documentation.
+
+* Thu Feb 08 2018 Dirk Krause <krause.dirk@web.de> 4.11.3-1
+- Added new value 7 for co_gu field in computers database of itadmin
+ to indicate that a computer is retired.
+
+* Fri Feb 02 2018 Dirk Krause <krause.dirk@web.de> 4.11.2-1
+- Bugfix, corrected configure.ac and configure to properly detect
+ Debian and derivative systems.
+
+* Sat Jan 27 2018 Dirk Krause <krause.dirk@web.de> 4.11.1-1
+- Bugfix, some XPM files contained named colors instead of hexadecimal values.
+- GUI applications now restoring window position and size.
+
+* Wed Jan 24 2018 Dirk Krause <krause.dirk@web.de> 4.11.0-1
+- Splitted dk4uc2l module into two modules dk4uc2la and dk4uc2l.
+- Appropriate changes to dk-t2l program.
+
+* Mon Nov 20 2017 Dirk Krause <krause.dirk@web.de> 4.10.0-0.0.1
+- Added dk-lines program.
+- Bugfix in dkct, corrected typo.
+- Added test for __attribute__((unused)) mechanism.
+- Now using DK4_HAVE_INLINE and DK4_USE_INLINE (inline keyword available,
+ want to use inline functions instead of macros).
+
+* Fri Oct 13 2017 Dirk Krause <krause.dirk@web.de> 4.9.7-0.0.1
+- Bugfix in htmlbook, no warning when escaping a leading raute character
+ by a backslash.
+
+* Tue Oct 10 2017 Dirk Krause <krause.dirk@web.de> 4.9.6-0.0.1
+- New "html doctype" option to htmlbook.
+- Docu update for htmlbook, requirement to encode & as &amp; in
+ a.href, img.svg and other attributes.
+- Configuration option SHORTIFNAMES in DKtoolian build script for Debian
+ Stretch, so users can choose whether to use the new long names or the
+ traditional short names for network interfaces.
+
+* Thu Oct 05 2017 Dirk Krause <krause.dirk@web.de> 4.9.5-0.0.1
+- Configuration option "svg wh" for htmlbook to set the default for
+ svgwh attributes in %%img ...%% commands.
+
+* Tue Oct 03 2017 Dirk Krause <krause.dirk@web.de> 4.9.4-0.0.1
+- Bugfix in htmlbook, write correct strings for href and title
+ attribute and hyperlink text now for URLs with multiple
+ ampersand separated parameters like http://x.y.z/test.php?a=b&c=d.
+
+* Fri Sep 29 2017 Dirk Krause <krause.dirk@web.de> 4.9.3-0.0.1
+- Modified htmlbook, the hyperlink title (tool tip text) can be configured
+ to preprend a globe symbol for external links (links outside the
+ current book).
+
+* Wed Sep 20 2017 Dirk Krause <krause.dirk@web.de> 4.9.2-0.0.1
+- Modified debian-stretch-prepare.sh script to install packages
+ libmariadbclient-dev and libmariadb-dev, so the matching header
+ file mariadb/mysql.h and -lmariadbclient library are found.
+
+* Wed Sep 13 2017 Dirk Krause <krause.dirk@web.de> 4.9.1-0.0.1
+- Changes in debian/control to build on Debian Stretch.
+- Statistics summary output for info log level in dk-send and dk-recv.
+- Fixed tests for RAND_egd() function.
+- Bugfix in dk4strm module: No write attempt on closing stream if buffer empty.
+- Correct Bezier curve bounding box calculation.
+
+* Tue Apr 25 2017 Dirk Krause <krause.dirk@web.de> 4.9.0-0.0.1
+- Followed further suggestion from the CTAN team.
* Tue Mar 28 2017 Dirk Krause <krause.dirk@web.de> 4.8.3-0.0.1
- Followed improvement suggestions from the CTAN team.
@@ -288,7 +609,7 @@ files provided by this project.
- Smaller changes related to Debian packaging.
* Sat May 28 2016 Dirk Krause <krause.dirk@web.de> 4.3.3-0.0.1
-- Debian packaging changed, developer package is dktools-lib-$(4.8)-dev.
+- Debian packaging changed, developer package is dktools-lib-$(4.30)-dev.
- RPM packaging changed, shared library symlinks now in devel package.
- New script to generate debian/changelog from dktools-el6.spec.in file.
@@ -563,7 +884,7 @@ files provided by this project.
- More useful error message for malformed path to dkt ls on Windows
(paths in double quotes where backslash escapes closing double quote).
-* Thu Mar 20 2013 Dirk Krause <krause.dirk@web.de> 3.0.6-0.0.1
+* Thu Mar 21 2013 Dirk Krause <krause.dirk@web.de> 3.0.6-0.0.1
- dkct enhanced for unknown classes.
* Wed Mar 20 2013 Dirk Krause <krause.dirk@web.de> 3.0.5-0.0.1
@@ -598,11 +919,11 @@ files provided by this project.
- The "ctrl database-cleanup" operation for prqd now removes
print accounts and page counts with value 0.
-* Sun Jun 06 2011 Dirk Krause <krause.dirk@web.de> 2.2.20-0.0.1
+* Mon Jun 06 2011 Dirk Krause <krause.dirk@web.de> 2.2.20-0.0.1
- Program imgsize renamed to chimgsize to avoid name conflicts
with perl-Image-Size RPM.
-* Sun Apr 19 2011 Dirk Krause <krause.dirk@web.de> 2.2.19-0.0.1
+* Tue Apr 19 2011 Dirk Krause <krause.dirk@web.de> 2.2.19-0.0.1
- Bugfix in text2htm, wrong format specification.
* Sun Nov 14 2010 Dirk Krause <krause.dirk@web.de> 2.2.18-0.0.1
@@ -633,7 +954,7 @@ files provided by this project.
* Tue Sep 14 2010 Dirk Krause <krause.dirk@web.de> 2.2.13-0.0.1
- Corrected typographic errors in the DKrause::Diagram documentation.
-* Tue Sep 13 2010 Dirk Krause <krause.dirk@web.de> 2.2.12-0.0.1
+* Mon Sep 13 2010 Dirk Krause <krause.dirk@web.de> 2.2.12-0.0.1
- The *.jar files were missing in the Windows executable setup of
2.2.11. Here they are back.
diff --git a/support/dktools/dktools-el6.spec.in b/support/dktools/dktools-el6.spec.in
index 743c4d3d26..c72d3b91cf 100644
--- a/support/dktools/dktools-el6.spec.in
+++ b/support/dktools/dktools-el6.spec.in
@@ -1,9 +1,4 @@
-#
-# If you think the *.spec files need corrections, please send me a
-# complete working *.spec file, not just a bug report.
-# I moved my laptop from Scientific Linux to Debian (they still
-# provide a 32 bit version with recent software), so I do no longer
-# have access to machines I could use to test *.spec files.
+# SPEC file to build Fedora and EL packages.
#
Name: dktools
Version: VERSNO
@@ -14,24 +9,29 @@ Vendor: Dirk Krause
# Packager: Dirk Krause
Group: Applications/System
License: BSD
-URL: http://dktools.sourceforge.net/index.html
+URL: http://sourceforge.net/p/dktools/wiki/Home/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel wxGTK wxGTK-devel
-Requires: zlib bzip2 openssl mysql-libs libpng libjpeg libtiff net-snmp wxGTK
+BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel db4-devel wxGTK3 wxGTK3-devel systemd
+%{?systemd_requires}
+Requires: zlib bzip2 openssl mysql-libs libpng libjpeg libtiff net-snmp db4 wxGTK3
Conflicts: dktools-rescue
Prefix: %{_prefix}
# ___PROVIDES___
+# ----- RPMLINT (Fedora Core 27) -----
+# In the lines below the spelling checker finds false positives:
+# wxWidgets htb dk fic bmm blks eradisk recoding sqlsplit mysqldump
+# uid pwgen recv dkdbt octpgfpl.
%description
A set of tools for graphics conversion, text conversion, software
development, administration and printing and some general-purpose tools.
bmpp / wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
fig2lat Convert FIG to PGF,EPS+TeX,PDF+TeX,EPS,SVG
- wximgsz Suggest good sizes to rescale bitmap images
+ wximgsz Suggest good sizes to scale bitmap images
htmlbook Publish HTML like a book
- dkct / wxdkct Preprocessor for C, C++, Objective-C and Java
+ dkct Preprocessor for C, C++, Objective-C and Java
(debugging/tracing, state machines, wxWidgets GUIs)
dkwxwiz Create project skeleton for wxWidgets+dktools based programs
wxdkhtb Viewer for *.htb help files
@@ -39,10 +39,11 @@ development, administration and printing and some general-purpose tools.
dk-ls ls clone, configurable column order
dk-fic File integrity checker
dk-bmm Backup media manager (10 tape rotation)
- dk-blks Correct data stream blocksize (for use with dd)
+ dk-blks Correct data stream block size (for use with dd)
dk-eradisk Create data stream to erase a disk
dk-hex Show data in hexadecimal or octal notation
dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-lines Select lines by line start pattern or line numbers
dk-sort sort clone, processes ASCII/UTF-8/UTF-16
dk-t2h Text to HTML converter
dk-t2l Text to LaTeX converter
@@ -64,12 +65,51 @@ development, administration and printing and some general-purpose tools.
%build
-%configure --enable-packaging
+%configure --enable-packaging --with-systemd=%{_unitdir}
+echo buildroot %{buildroot}
+echo prefix %{_prefix}
+echo libdir %{_libdir}
+echo unitdir %{_unitdir}
+
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
+echo 'I: chmod 0755' %{buildroot}%{_libdir}/lib*.so.*
+chmod 0755 %{buildroot}%{_libdir}/lib*.so.*
+if [ ! -d "%{buildroot}%{_datadir}/licenses" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses"
+ chmod 755 "%{buildroot}%{_datadir}/licenses"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/licenses/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/licenses/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+if [ ! -d "%{buildroot}%{_datadir}/doc" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc"
+ chmod 755 "%{buildroot}%{_datadir}/doc"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/doc/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/doc/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/doc/dktools/LICENSE
+echo 'I: Copying INSTALL'
+cp INSTALL %{buildroot}%{_datadir}/doc/dktools/INSTALL
+echo 'I: Copying README'
+cp README %{buildroot}%{_datadir}/doc/dktools/README
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/INSTALL
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/README
%clean
rm -rf $RPM_BUILD_ROOT
@@ -81,70 +121,24 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/*
%{_libdir}/libdk3*.so.*
%{_libdir}/libdk4*.so.*
+%{_libexecdir}/dktools/*
%{_datadir}/applications/*
%{_datadir}/dktools
%{_datadir}/dk4app
%{_datadir}/man/man1/*
%{_datadir}/man/man5/*
-%{_sysconfdir}/printqd/printqd.conf.sample
-%{_sysconfdir}/rshdown/rshdown.conf.sample
-%config %{_sysconfdir}/dk3app/dk3paper.conf
+%{_datadir}/doc/dktools/*
+%{_datadir}/licenses/dktools/*
+%config(noreplace) %{_sysconfdir}/dk3app/dk3paper.conf
+%config(noreplace) %{_sysconfdir}/dk4app/dk4gra.conf
%post
-# ##### ATTEMPT TO GUESS USER AND GROUP FOR LPRng LPD DAEMON
-#
-LPUSER=`getent passwd | grep '^daemon:' | cut -f 1 -d :`
-if [ "X$LPUSER" = "X" ]
-then
- LPUSER=`getent passwd | grep '^lp:' | cut -f 1 -d :`
-fi
-if [ "X$LPUSER" = "X" ]
-then
- LPUSER="root"
-fi
-LPGROUP=`getent group | grep '^daemon:' | cut -f 1 -d :`
-if [ "X$LPGROUP" = "X" ]
-then
- LPGROUP=`getent group | grep '^lp:' | cut -f 1 -d :`
-fi
-if [ "X$LPGROUP" = "X" ]
-then
- LPGROUP="root"
-fi
-#
-# #####
-#
-#
-#
-# ##### LINUX DISTRIBUTION PACKAGERS
-# ##### If your distribution contains the LPRng software, please
-# ##### uncomment the two lines below and set LPUSER and LPGROUP to
-# ##### the user and group used to run the LPRng lpd daemon on
-# ##### your distribution.
-# ##### Optionally remove the lines above attempting to guess these names.
-#
-# LPUSER="daemon"
-# LPGROUP="daemon"
-#
-# #####
-for i in /var/printqd /var/log/printqd /var/run/printqd
-do
- [ -d $i ] || mkdir -p $i
- chown -R ${LPUSER}:${LPGROUP} $i
- chmod 770 $i
-done
ldconfig
%postun
-if [ "X$1" = "X0" ]
-then
- [ ! -d /var/run/printqd ] || rm -fr /var/run/printqd
- [ ! -d /var/log/printqd ] || rm -fr /var/log/printqd
-fi
ldconfig
-
#
# The rescue sub-package installs only those binaries useful on
# a rescue live system.
@@ -199,14 +193,68 @@ ldconfig
%postun rescue
ldconfig
+%package rshdown
+Summary: Remote shutdown daemon
+Requires: dktools = %{version}-%{release} zlib bzip2
+Prefix: %{_prefix}
+
+%description rshdown
+Using rshdown you can initiate a remote shutdown.
+
+%files rshdown
+%defattr(-,root,root,-)
+%{_sbindir}/rshdown
+%{_sbindir}/rshdown-init
+%{_sysconfdir}/rshdown/rshdown.conf.sample
+%{_unitdir}/rshdown.service
+%config(noreplace) %{_sysconfdir}/rshdown/rshdown.conf
+
+# RSHDOWN_SCRIPTLETS_START
+
+%post rshdown
+%systemd_post rshdown.service
+
+%preun rshdown
+%systemd_preun rshdown.service
+
+%postun rshdown
+%systemd_postun_with_restart rshdown.service
+
+# RSHDOWN_SCRIPTLETS_END
+
+
+%package printqd
+Summary: Print quota daemon for LPRng
+Requires: dktools = %{version}-%{release} zlib bzip2
+Prefix: %{_prefix}
+
+%description printqd
+Printqd is a daemon to enforce print quota for the LPRng print system.
+
+%files printqd
+%defattr(-,root,root,-)
+%{_sbindir}/printqd
+%{_sysconfdir}/printqd/printqd.conf.sample
+%{_unitdir}/printqd.service
+%config(noreplace) %{_sysconfdir}/printqd/printqd.conf
+
+# PRINTQD_SCRIPTLETS_START
+
+%post printqd
+%systemd_post printqd.service
+%preun printqd
+%systemd_preun printqd.service
+%postun printqd
+%systemd_postun_with_restart printqd.service
+# PRINTQD_SCRIPTLETS_END
%package devel
Summary: Development files for libraries from the DK tools project
Group: Development/Libraries
-Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc wxGTK wxGTK-devel
+Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc db4-devel wxGTK3 wxGTK3-devel
Prefix: %{_prefix}
%description devel
@@ -216,12 +264,310 @@ files provided by this project.
%files devel
%defattr(-,root,root,-)
-%{_includedir}/*
+%{_includedir}/dktools-4
%{_libdir}/pkgconfig/dktools.pc
%{_libdir}/libdk3*.so
%{_libdir}/libdk4*.so
%changelog
+* Tue Sep 15 2020 Dirk Krause <krause.dirk@web.de> 4.30.2-1
+- Added SPDX-License-Identifier tags to many files.
+- Corrected full license terms back to original BSD-3-Clause text.
+
+* Sun Aug 23 2020 Dirk Krause <krause.dirk@web.de> 4.30.1-1
+- Upgrade for dkct, can use SPDX-License-Identifier lines.
+
+* Thu Aug 20 2020 Dirk Krause <krause.dirk@web.de> 4.30.0-1
+- Added the Dk4WxYesNoDialog class to the libdk4wx library because
+ the wxMessageBox from the libwxgtk3.0-0v5 package in Debian 10 does
+ not localize the button texts.
+- Bugfix in wxdkdraw, added menu items to create arcs.
+- Bugfix in the dk4gra module, pattern size for octagons now matches
+ the pattern size for circles.
+- Yes / no dialogs with localized button texts in wxdkdraw.
+
+* Thu Jul 16 2020 Dirk Krause <krause.dirk@web.de> 4.29.3-1
+- Bugfix in wxdkdraw: Line width 0 elements are highlighted as
+ selection/copy/move/delete/grouping candidates now.
+- Modified htmlbook again for flexbox placement of navigation menu lists
+ if the navigation menu is shown below the main content.
+
+* Thu Jul 16 2020 Dirk Krause <krause.dirk@web.de> 4.29.2-1
+- Modified htmlbook so we can create more responsive designs.
+
+* Sat Jun 27 2020 Dirk Krause <krause.dirk@web.de> 4.29.1-1
+- More markers are written by the itadmin program to the dhcpd.conf output.
+- Modified mklivesys.sh script. We can now inject files into the
+ initramfs filesystem of a live system.
+- Removed libreoffice-style-galaxy from package lists for live systems.
+
+* Mon Apr 13 2020 Dirk Krause <krause.dirk@web.de> 4.29.0-1
+- Bugfix in wxdkdraw: Draw control sets focus on itself in mouse enter
+ events and mouse click events when compiled on Windows.
+ I hope to get the mouse wheel working on Windows.
+- Bugfix in wximgsz: The string table in German language was completed.
+- New function dk4uc2l_string_encoded() in dk4uc2l module.
+
+* Thu Mar 26 2020 Dirk Krause <krause.dirk@web.de> 4.28.1-1
+- Bugfix in wxdkdraw: Do no longer show "Modify spline point s value"
+ dialog in move spline point operations.
+
+* Wed Feb 19 2020 Dirk Krause <krause.dirk@web.de> 4.28.0-1
+- New program: wxdkdraw, minimalistic drawing program for use with LaTeX.
+- Wximgsz rewritten for DK libraries 4.
+ Uses spin controls for input instead of standard text fields.
+- Library API change: The enum values DK4WX_AUTOSTART_REACTION_IGNORE and
+ alike were moved into a public enum in the Dk4WxAutostartController class.
+- Library API change: The a and b parameters in the
+ dk4gratool_dist_point_point() function were changed to const, the a, b and
+ p parameters in dk4gratool_dist_point_track() too.
+- Library API change: The new dk4bb_add_bb() function in the dk4bb module
+ allows to create a bounding box for a drawing from the object bounding
+ boxes.
+
+* Wed Nov 27 2019 Dirk Krause <krause.dirk@web.de> 4.27.0-1
+- Distinction between K and k in size specifications (K=1024, k=1000),
+ M/m, G/g, T/t, P/p, E/e, Z/z, Y/y (powers of 1024, powers of 1000).
+- Bugfix in build process, size of wxChar calculated in configure script.
+- Bugfix in dkwxwiz, corrected name of XPM source.
+
+* Fri Oct 18 2019 Dirk Krause <krause.dirk@web.de> 4.26.0-1
+- Install header files into the includedir/dktools-4 directory.
+- Daemons rshdown and printqd are systemd compatible now.
+- Module dk4dmt modified for systemd compatibility.
+- PID files now in /run/... when systemd is used, /var/run/... otherwise.
+- Build scripts check for systemd use and install systemd service unit files
+ when systemd in use, traditional start scripts otherwise.
+- Build scripts modified for MinGW-w64 build and later probably cross-builds.
+- Program pjsnmp is now installed into libexec directory.
+- Packaging for RPM and DEB packages changed, separated packages for
+ printqd and rshdown.
+- New module dk4bm for bit matrices.
+- New module dk4bml to levelize graphs represented by bit matrices.
+- Bugfix in the dk4apref module: Parameter pv is const, but the buffer
+ was modified.
+- Bugfix in dk4sock25 and dk4sock31 modules: FreeAddrInfo() replaced
+ by FreeAddrInfoW(). This bug was not relevant when using MSVC to build
+ Windows binaries as the FreeAddrInfo() macro is mapped to the
+ FreeAddrInfoW() function when using makefile.vc.
+- Modification in the dk4mem module: Fallback functions only compiled
+ if needed.
+
+* Thu Sep 26 2019 Dirk Krause <krause.dirk@web.de> 4.25.0-1
+- Bugfix in the dk-cat program. The program attempted to issue a byte order
+ marker depending on the systems default encoding instead of the used
+ output encoding.
+- Module dk4itmin added to search for a local minimum of an unimodal
+ function in an interval.
+
+* Thu Aug 15 2019 Dirk Krause <krause.dirk@web.de> 4.24.2-1
+- Bugfix in the dkwt/dkwtadm program. The program did not properly inform
+ all windows about environment modifications.
+
+* Sun Aug 04 2019 Dirk Krause <krause.dirk@web.de> 4.24.1-1
+- Added dk-bin2c program to convert binary data to C source code
+ (array of unsigned char literals).
+- Added markdown documentation for live systems.
+- Classes Dk4Comparable and Dk4Container modified for C++11/C++17.
+
+* Sun Jul 14 2019 Dirk Krause <krause.dirk@web.de> 4.24.0-1
+- Modifications to follow the "Updating to the latest version of wxWidgets"
+ document.
+
+* Sun Jun 16 2019 Dirk Krause <krause.dirk@web.de> 4.23.0-1
+- Bugfix in 32 bit Linux/Unix build process, 64 bit file size support
+ was inactive on 32 bit Linux/Unix in previous versions.
+- Variables to store leightweight class objects returned by c_str().
+- Font feature "script" added, font feature enumeration values changed.
+
+* Tue Apr 16 2019 Dirk Krause <krause.dirk@web.de> 4.22.0-1
+- Configuration default for cosp in the fig2lat program changed to yes.
+- Added some previously internal functions to the API.
+- Functions to calculate 2D and 3D X-spline segment lengths.
+- Option "x-spline sub segments" for dk4gra.conf, "xsss" for language
+ selection. This option specifies the number of Bezier spline segments
+ to draw for each X-spline segment.
+- Parameter "rot" in the text functions in the dk4grpgf and dk4pppt modules
+ to specify the text rotation in degree.
+- Bugfix in dk-lines program to avoid dereferencing NULL pointer.
+- Cleanup, a new directory gui-img with subdirectories was created.
+ The *.ico and *.xpm files were moved from the source code directory
+ into the subdirectories.
+
+* Sat Nov 17 2018 Dirk Krause <krause.dirk@web.de> 4.21.0-1
+- Added complaint to dkct if GUI object has no parent object
+ (is not mentioned as contents of another object).
+- Modified Dk4WxColourView class to show difference between
+ active/inactive state and to place colour chooser over colour view.
+
+* Thu Nov 01 2018 Dirk Krause <krause.dirk@web.de> 4.20.0-1
+- Function $!string added to dkct.
+- Added functions dk4ma_int_from_double() and dk4ma_uint_from_double()
+ to convert double values to int and unsigned.
+
+* Tue Oct 16 2018 Dirk Krause <krause.dirk@web.de> 4.19.1-1
+- Bugfix in Makefile.in for parallel make.
+
+* Sat Oct 13 2018 Dirk Krause <krause.dirk@web.de> 4.19.0-1
+- Functions to calculate greatest common divisor and least common multiple.
+- Function for conversion to smaller integer types.
+- Function to convert UTF-8 encoded strings to wxChar strings.
+- Added event generation to Dk4WxColourView class.
+- Installing printqd and rshdown to /usr/sbin now.
+- File /etc/init.d/printqd to start and stop printqd service.
+
+* Sun Jul 29 2018 Dirk Krause <krause.dirk@web.de> 4.18.1-1
+- Removed misleading warning from dkct shown when a "direction" attribute
+ was assigned to a wxScrollBar.
+
+* Thu Jul 26 2018 Dirk Krause <krause.dirk@web.de> 4.18.0-1
+- Added --no-modification-warning option to dkct.
+ This option suppresses the warning at the beginning of output files
+ advising users to modify the input files processed by dkct instead
+ of the output files produced by the program.
+- Added new modules dk4mai8du8, dk4mai8di8, dk4mai8du16, dk4mai8di16,
+ dk4mai8du32 and dk4mai8di32 to read uint8_t ... int32_t.
+
+* Sat Jul 07 2018 Dirk Krause <krause.dirk@web.de> 4.17.0-1
+- Added options "privacy link" and "privacy page" to htmlbook configuration.
+- Added comments to HTML output of htmlbook.
+- Changed to a faster iteration algorithm in fig2lat and libdk3fig.
+- Added module dk4iter for numeric iterations to libdk4c.
+
+* Sun May 27 2018 Dirk Krause <krause.dirk@web.de> 4.16.0-1
+- Alternative colour chooser added, uses palettes.
+- Dk4WxColourView can be set to be inactive.
+- Former Dk4WxColorView renamed to Dk4WxColourView for consistence,
+ some methods also renamed for consistence.
+- Containers wxChoicebook, wxListbook, wxSimplebook, wxToolbook and
+ wxTreebook now supported by dkct.
+- Attribute text allowed for wxPanel to add panels to book controls.
+- Stock menu items and stock buttons allowed in dkct.
+
+* Sun May 20 2018 Dirk Krause <krause.dirk@web.de> 4.15.0-1
+- Added dk4xsp module for X-spline calculations.
+- Modified configure.ac due to warnings from Debian package building about
+ symbols not found in any library.
+- Added new constants
+ DK4_UINT8_0, DK4_INT8_0, DK4_UINT16_0, DK4_INT16_0, DK4_UINT32_0, DK4_INT32_0
+ to dktypes.h file.
+
+* Sat May 05 2018 Dirk Krause <krause.dirk@web.de> 4.14.1-1
+- Bugfix in Makefile.in and configure.ac, library libdk4ma.a
+ was not mentioned as dependency for libdk4maio8d.a.
+
+* Thu Apr 19 2018 Dirk Krause <krause.dirk@web.de> 4.14.0-1
+- The configure script now checks the presence of the search.h include
+ file and the availability of the qsort() and bsearch() functions.
+- Modified dkrgra, dk4graa and dk4pppt. A flags set was added to text
+ output functions, so we can order a white box and/or an oval box.
+- Modified dk4fpe.h file, it does no longer include compiler pragmas
+ to enable access to the floating point environment.
+ Users might want to apply the pragma to portions of code only
+ and not necessarily to entire source files.
+
+* Sun Apr 15 2018 Dirk Krause <krause.dirk@web.de> 4.13.0-1
+- Added dk4pppt module.
+- Added functions to configure font size and LaTeX preamble lines in
+ dk4gra and dk4graa modules.
+- Added functions to write a char string LaTeX encoded to a stream
+ in the dk4uc2l and dk4uc2la modules.
+- Corrected some error messages in the dk4graa module.
+- Added dk4rec27 module containing the dk4recode_c8_to_dk() function
+ to convert char strings (plain, Win1252, UTF-8) to dkChar strings.
+
+* Thu Apr 12 2018 Dirk Krause <krause.dirk@web.de> 4.12.1-1
+- Changed default for expected encoding when processing standard input
+ or input from file to DK4_FILE_ENCODING_WIN1252 to allow processing
+ of text containing the Euro currency symbol.
+- Renamed some encodings.
+- Release mechanism modified: Presence of the preview.txt file indicates
+ to build not an official release.
+
+* Fri Apr 06 2018 Dirk Krause <krause.dirk@web.de> 4.12.0-1
+- Rewrote bmpp and wxbmpp for library version 4.
+- Modified dk4align.h for separated enum types for text and image
+ alignment.
+- Added dk4mao8dns module to write double values without scientific notation.
+- Packaging changed, packaging script do no longer deal with directories
+ for printqd. Printqd can only be used with the LPRng print system which
+ is not available as package. Users install that software manually
+ deciding about UID and GID to run LPRng at build time.
+ So our package postinstallation and preremoval scripts can not know
+ which UID and GID is used for LPRng.
+
+* Sat Feb 10 2018 Dirk Krause <krause.dirk@web.de> 4.11.4-1
+- The dkct program now checks state machine descriptions for duplicated
+ numeric values for states, inputs and outputs.
+ State, input and output names are checked whether or not they are
+ valid identifiers in the C programming language.
+- State, input, and output definitions are now written as enums by default
+ instead of defines. When using doxygen, this results in a more readable
+ documentation.
+
+* Thu Feb 08 2018 Dirk Krause <krause.dirk@web.de> 4.11.3-1
+- Added new value 7 for co_gu field in computers database of itadmin
+ to indicate that a computer is retired.
+
+* Fri Feb 02 2018 Dirk Krause <krause.dirk@web.de> 4.11.2-1
+- Bugfix, corrected configure.ac and configure to properly detect
+ Debian and derivative systems.
+
+* Sat Jan 27 2018 Dirk Krause <krause.dirk@web.de> 4.11.1-1
+- Bugfix, some XPM files contained named colors instead of hexadecimal values.
+- GUI applications now restoring window position and size.
+
+* Wed Jan 24 2018 Dirk Krause <krause.dirk@web.de> 4.11.0-1
+- Splitted dk4uc2l module into two modules dk4uc2la and dk4uc2l.
+- Appropriate changes to dk-t2l program.
+
+* Mon Nov 20 2017 Dirk Krause <krause.dirk@web.de> 4.10.0-0.0.1
+- Added dk-lines program.
+- Bugfix in dkct, corrected typo.
+- Added test for __attribute__((unused)) mechanism.
+- Now using DK4_HAVE_INLINE and DK4_USE_INLINE (inline keyword available,
+ want to use inline functions instead of macros).
+
+* Fri Oct 13 2017 Dirk Krause <krause.dirk@web.de> 4.9.7-0.0.1
+- Bugfix in htmlbook, no warning when escaping a leading raute character
+ by a backslash.
+
+* Tue Oct 10 2017 Dirk Krause <krause.dirk@web.de> 4.9.6-0.0.1
+- New "html doctype" option to htmlbook.
+- Docu update for htmlbook, requirement to encode & as &amp; in
+ a.href, img.svg and other attributes.
+- Configuration option SHORTIFNAMES in DKtoolian build script for Debian
+ Stretch, so users can choose whether to use the new long names or the
+ traditional short names for network interfaces.
+
+* Thu Oct 05 2017 Dirk Krause <krause.dirk@web.de> 4.9.5-0.0.1
+- Configuration option "svg wh" for htmlbook to set the default for
+ svgwh attributes in %%img ...%% commands.
+
+* Tue Oct 03 2017 Dirk Krause <krause.dirk@web.de> 4.9.4-0.0.1
+- Bugfix in htmlbook, write correct strings for href and title
+ attribute and hyperlink text now for URLs with multiple
+ ampersand separated parameters like http://x.y.z/test.php?a=b&c=d.
+
+* Fri Sep 29 2017 Dirk Krause <krause.dirk@web.de> 4.9.3-0.0.1
+- Modified htmlbook, the hyperlink title (tool tip text) can be configured
+ to preprend a globe symbol for external links (links outside the
+ current book).
+
+* Wed Sep 20 2017 Dirk Krause <krause.dirk@web.de> 4.9.2-0.0.1
+- Modified debian-stretch-prepare.sh script to install packages
+ libmariadbclient-dev and libmariadb-dev, so the matching header
+ file mariadb/mysql.h and -lmariadbclient library are found.
+
+* Wed Sep 13 2017 Dirk Krause <krause.dirk@web.de> 4.9.1-0.0.1
+- Changes in debian/control to build on Debian Stretch.
+- Statistics summary output for info log level in dk-send and dk-recv.
+- Fixed tests for RAND_egd() function.
+- Bugfix in dk4strm module: No write attempt on closing stream if buffer empty.
+- Correct Bezier curve bounding box calculation.
+
+* Tue Apr 25 2017 Dirk Krause <krause.dirk@web.de> 4.9.0-0.0.1
+- Followed further suggestion from the CTAN team.
* Tue Mar 28 2017 Dirk Krause <krause.dirk@web.de> 4.8.3-0.0.1
- Followed improvement suggestions from the CTAN team.
@@ -563,7 +909,7 @@ files provided by this project.
- More useful error message for malformed path to dkt ls on Windows
(paths in double quotes where backslash escapes closing double quote).
-* Thu Mar 20 2013 Dirk Krause <krause.dirk@web.de> 3.0.6-0.0.1
+* Thu Mar 21 2013 Dirk Krause <krause.dirk@web.de> 3.0.6-0.0.1
- dkct enhanced for unknown classes.
* Wed Mar 20 2013 Dirk Krause <krause.dirk@web.de> 3.0.5-0.0.1
@@ -598,11 +944,11 @@ files provided by this project.
- The "ctrl database-cleanup" operation for prqd now removes
print accounts and page counts with value 0.
-* Sun Jun 06 2011 Dirk Krause <krause.dirk@web.de> 2.2.20-0.0.1
+* Mon Jun 06 2011 Dirk Krause <krause.dirk@web.de> 2.2.20-0.0.1
- Program imgsize renamed to chimgsize to avoid name conflicts
with perl-Image-Size RPM.
-* Sun Apr 19 2011 Dirk Krause <krause.dirk@web.de> 2.2.19-0.0.1
+* Tue Apr 19 2011 Dirk Krause <krause.dirk@web.de> 2.2.19-0.0.1
- Bugfix in text2htm, wrong format specification.
* Sun Nov 14 2010 Dirk Krause <krause.dirk@web.de> 2.2.18-0.0.1
@@ -633,7 +979,7 @@ files provided by this project.
* Tue Sep 14 2010 Dirk Krause <krause.dirk@web.de> 2.2.13-0.0.1
- Corrected typographic errors in the DKrause::Diagram documentation.
-* Tue Sep 13 2010 Dirk Krause <krause.dirk@web.de> 2.2.12-0.0.1
+* Mon Sep 13 2010 Dirk Krause <krause.dirk@web.de> 2.2.12-0.0.1
- The *.jar files were missing in the Windows executable setup of
2.2.11. Here they are back.
diff --git a/support/dktools/dktools-el7.spec b/support/dktools/dktools-el7.spec
index c4c97d5482..ff169a81bf 100644
--- a/support/dktools/dktools-el7.spec
+++ b/support/dktools/dktools-el7.spec
@@ -1,65 +1,70 @@
-#
-# If you think the *.spec files need corrections, please send me a
-# complete working *.spec file, not just a bug report.
-# I moved my laptop from Scientific Linux to Debian (they still
-# provide a 32 bit version with recent software), so I do no longer
-# have access to machines I could use to test *.spec files.
+# SPEC file to build Fedora and EL packages.
#
Name: dktools
-Version: 4.8.3
-Source: file:///home/krause/work/dktools-4.8.3.tar.gz
+Version: 4.30.2
+Source: file:///home/krause/work/dktools-4.30.2.tar.gz
Release: 1%{?dist}
Summary: Dirk Krause's tools and libraries
Vendor: Dirk Krause
# Packager: Dirk Krause
Group: Applications/System
License: BSD
-URL: http://dktools.sourceforge.net/index.html
+URL: http://sourceforge.net/p/dktools/wiki/Home/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel wxGTK wxGTK-devel
-Requires: zlib bzip2 openssl mysql-libs libpng libjpeg libtiff net-snmp wxGTK
+BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel libdb-devel wxGTK3 wxGTK3-devel systemd
+%{?systemd_requires}
+Requires: zlib bzip2 openssl mysql-libs libpng libjpeg libtiff net-snmp libdb wxGTK3
Conflicts: dktools-rescue
Prefix: %{_prefix}
-Provides: libdk3bif.so.4.8()(64bit)
-Provides: libdk3bmeps.so.4.8()(64bit)
-Provides: libdk3c.so.4.8()(64bit)
-Provides: libdk3csrnd.so.4.8()(64bit)
-Provides: libdk3dbi.so.4.8()(64bit)
-Provides: libdk3fig.so.4.8()(64bit)
-Provides: libdk3of.so.4.8()(64bit)
-Provides: libdk3trace.so.4.8()(64bit)
-Provides: libdk3wx.so.4.8()(64bit)
-Provides: libdk4app.so.4.8()(64bit)
-Provides: libdk4base.so.4.8()(64bit)
-Provides: libdk4c.so.4.8()(64bit)
-Provides: libdk4dbia.so.4.8()(64bit)
-Provides: libdk4dbi.so.4.8()(64bit)
-Provides: libdk4lat.so.4.8()(64bit)
-Provides: libdk4maio8d.so.4.8()(64bit)
-Provides: libdk4maio8h.so.4.8()(64bit)
-Provides: libdk4maiodd.so.4.8()(64bit)
-Provides: libdk4maiodh.so.4.8()(64bit)
-Provides: libdk4maiowd.so.4.8()(64bit)
-Provides: libdk4maiowh.so.4.8()(64bit)
-Provides: libdk4maioxd.so.4.8()(64bit)
-Provides: libdk4ma.so.4.8()(64bit)
-Provides: libdk4mdrnd.so.4.8()(64bit)
-Provides: libdk4pppta.so.4.8()(64bit)
-Provides: libdk4pppt.so.4.8()(64bit)
-Provides: libdk4socka.so.4.8()(64bit)
-Provides: libdk4sock.so.4.8()(64bit)
-Provides: libdk4wx.so.4.8()(64bit)
-
+Provides: libdk3bif.so.4.30()(64bit)
+Provides: libdk3bmeps.so.4.30()(64bit)
+Provides: libdk3c.so.4.30()(64bit)
+Provides: libdk3csrnd.so.4.30()(64bit)
+Provides: libdk3dbi.so.4.30()(64bit)
+Provides: libdk3fig.so.4.30()(64bit)
+Provides: libdk3of.so.4.30()(64bit)
+Provides: libdk3trace.so.4.30()(64bit)
+Provides: libdk3wx.so.4.30()(64bit)
+Provides: libdk4app.so.4.30()(64bit)
+Provides: libdk4base.so.4.30()(64bit)
+Provides: libdk4bifa.so.4.30()(64bit)
+Provides: libdk4bif.so.4.30()(64bit)
+Provides: libdk4c.so.4.30()(64bit)
+Provides: libdk4dbia.so.4.30()(64bit)
+Provides: libdk4dbi.so.4.30()(64bit)
+Provides: libdk4graa.so.4.30()(64bit)
+Provides: libdk4gra.so.4.30()(64bit)
+Provides: libdk4lata.so.4.30()(64bit)
+Provides: libdk4lat.so.4.30()(64bit)
+Provides: libdk4maio8d.so.4.30()(64bit)
+Provides: libdk4maio8h.so.4.30()(64bit)
+Provides: libdk4maiodd.so.4.30()(64bit)
+Provides: libdk4maiodh.so.4.30()(64bit)
+Provides: libdk4maiowd.so.4.30()(64bit)
+Provides: libdk4maiowh.so.4.30()(64bit)
+Provides: libdk4maioxd.so.4.30()(64bit)
+Provides: libdk4ma.so.4.30()(64bit)
+Provides: libdk4mdrnd.so.4.30()(64bit)
+Provides: libdk4pppta.so.4.30()(64bit)
+Provides: libdk4pppt.so.4.30()(64bit)
+Provides: libdk4socka.so.4.30()(64bit)
+Provides: libdk4sock.so.4.30()(64bit)
+Provides: libdk4wx.so.4.30()(64bit)
+
+# ----- RPMLINT (Fedora Core 27) -----
+# In the lines below the spelling checker finds false positives:
+# wxWidgets htb dk fic bmm blks eradisk recoding sqlsplit mysqldump
+# uid pwgen recv dkdbt octpgfpl.
%description
A set of tools for graphics conversion, text conversion, software
development, administration and printing and some general-purpose tools.
bmpp / wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
fig2lat Convert FIG to PGF,EPS+TeX,PDF+TeX,EPS,SVG
- wximgsz Suggest good sizes to rescale bitmap images
+ wximgsz Suggest good sizes to scale bitmap images
htmlbook Publish HTML like a book
- dkct / wxdkct Preprocessor for C, C++, Objective-C and Java
+ dkct Preprocessor for C, C++, Objective-C and Java
(debugging/tracing, state machines, wxWidgets GUIs)
dkwxwiz Create project skeleton for wxWidgets+dktools based programs
wxdkhtb Viewer for *.htb help files
@@ -67,10 +72,11 @@ development, administration and printing and some general-purpose tools.
dk-ls ls clone, configurable column order
dk-fic File integrity checker
dk-bmm Backup media manager (10 tape rotation)
- dk-blks Correct data stream blocksize (for use with dd)
+ dk-blks Correct data stream block size (for use with dd)
dk-eradisk Create data stream to erase a disk
dk-hex Show data in hexadecimal or octal notation
dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-lines Select lines by line start pattern or line numbers
dk-sort sort clone, processes ASCII/UTF-8/UTF-16
dk-t2h Text to HTML converter
dk-t2l Text to LaTeX converter
@@ -92,12 +98,51 @@ development, administration and printing and some general-purpose tools.
%build
-%configure --enable-packaging
+%configure --enable-packaging --with-systemd=%{_unitdir}
+echo buildroot %{buildroot}
+echo prefix %{_prefix}
+echo libdir %{_libdir}
+echo unitdir %{_unitdir}
+
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
+echo 'I: chmod 0755' %{buildroot}%{_libdir}/lib*.so.*
+chmod 0755 %{buildroot}%{_libdir}/lib*.so.*
+if [ ! -d "%{buildroot}%{_datadir}/licenses" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses"
+ chmod 755 "%{buildroot}%{_datadir}/licenses"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/licenses/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/licenses/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+if [ ! -d "%{buildroot}%{_datadir}/doc" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc"
+ chmod 755 "%{buildroot}%{_datadir}/doc"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/doc/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/doc/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/doc/dktools/LICENSE
+echo 'I: Copying INSTALL'
+cp INSTALL %{buildroot}%{_datadir}/doc/dktools/INSTALL
+echo 'I: Copying README'
+cp README %{buildroot}%{_datadir}/doc/dktools/README
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/INSTALL
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/README
%clean
rm -rf $RPM_BUILD_ROOT
@@ -109,70 +154,24 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/*
%{_libdir}/libdk3*.so.*
%{_libdir}/libdk4*.so.*
+%{_libexecdir}/dktools/*
%{_datadir}/applications/*
%{_datadir}/dktools
%{_datadir}/dk4app
%{_datadir}/man/man1/*
%{_datadir}/man/man5/*
-%{_sysconfdir}/printqd/printqd.conf.sample
-%{_sysconfdir}/rshdown/rshdown.conf.sample
-%config %{_sysconfdir}/dk3app/dk3paper.conf
+%{_datadir}/doc/dktools/*
+%{_datadir}/licenses/dktools/*
+%config(noreplace) %{_sysconfdir}/dk3app/dk3paper.conf
+%config(noreplace) %{_sysconfdir}/dk4app/dk4gra.conf
%post
-# ##### ATTEMPT TO GUESS USER AND GROUP FOR LPRng LPD DAEMON
-#
-LPUSER=`getent passwd | grep '^daemon:' | cut -f 1 -d :`
-if [ "X$LPUSER" = "X" ]
-then
- LPUSER=`getent passwd | grep '^lp:' | cut -f 1 -d :`
-fi
-if [ "X$LPUSER" = "X" ]
-then
- LPUSER="root"
-fi
-LPGROUP=`getent group | grep '^daemon:' | cut -f 1 -d :`
-if [ "X$LPGROUP" = "X" ]
-then
- LPGROUP=`getent group | grep '^lp:' | cut -f 1 -d :`
-fi
-if [ "X$LPGROUP" = "X" ]
-then
- LPGROUP="root"
-fi
-#
-# #####
-#
-#
-#
-# ##### LINUX DISTRIBUTION PACKAGERS
-# ##### If your distribution contains the LPRng software, please
-# ##### uncomment the two lines below and set LPUSER and LPGROUP to
-# ##### the user and group used to run the LPRng lpd daemon on
-# ##### your distribution.
-# ##### Optionally remove the lines above attempting to guess these names.
-#
-# LPUSER="daemon"
-# LPGROUP="daemon"
-#
-# #####
-for i in /var/printqd /var/log/printqd /var/run/printqd
-do
- [ -d $i ] || mkdir -p $i
- chown -R ${LPUSER}:${LPGROUP} $i
- chmod 770 $i
-done
ldconfig
%postun
-if [ "X$1" = "X0" ]
-then
- [ ! -d /var/run/printqd ] || rm -fr /var/run/printqd
- [ ! -d /var/log/printqd ] || rm -fr /var/log/printqd
-fi
ldconfig
-
#
# The rescue sub-package installs only those binaries useful on
# a rescue live system.
@@ -227,14 +226,68 @@ ldconfig
%postun rescue
ldconfig
+%package rshdown
+Summary: Remote shutdown daemon
+Requires: dktools = %{version}-%{release} zlib bzip2
+Prefix: %{_prefix}
+
+%description rshdown
+Using rshdown you can initiate a remote shutdown.
+
+%files rshdown
+%defattr(-,root,root,-)
+%{_sbindir}/rshdown
+%{_sbindir}/rshdown-init
+%{_sysconfdir}/rshdown/rshdown.conf.sample
+%{_unitdir}/rshdown.service
+%config(noreplace) %{_sysconfdir}/rshdown/rshdown.conf
+
+# RSHDOWN_SCRIPTLETS_START
+
+%post rshdown
+%systemd_post rshdown.service
+
+%preun rshdown
+%systemd_preun rshdown.service
+
+%postun rshdown
+%systemd_postun_with_restart rshdown.service
+
+# RSHDOWN_SCRIPTLETS_END
+
+
+%package printqd
+Summary: Print quota daemon for LPRng
+Requires: dktools = %{version}-%{release} zlib bzip2
+Prefix: %{_prefix}
+
+%description printqd
+Printqd is a daemon to enforce print quota for the LPRng print system.
+
+%files printqd
+%defattr(-,root,root,-)
+%{_sbindir}/printqd
+%{_sysconfdir}/printqd/printqd.conf.sample
+%{_unitdir}/printqd.service
+%config(noreplace) %{_sysconfdir}/printqd/printqd.conf
+
+# PRINTQD_SCRIPTLETS_START
+
+%post printqd
+%systemd_post printqd.service
+%preun printqd
+%systemd_preun printqd.service
+%postun printqd
+%systemd_postun_with_restart printqd.service
+# PRINTQD_SCRIPTLETS_END
%package devel
Summary: Development files for libraries from the DK tools project
Group: Development/Libraries
-Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc wxGTK wxGTK-devel
+Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc libdb-devel wxGTK3 wxGTK3-devel
Prefix: %{_prefix}
%description devel
@@ -244,12 +297,310 @@ files provided by this project.
%files devel
%defattr(-,root,root,-)
-%{_includedir}/*
+%{_includedir}/dktools-4
%{_libdir}/pkgconfig/dktools.pc
%{_libdir}/libdk3*.so
%{_libdir}/libdk4*.so
%changelog
+* Tue Sep 15 2020 Dirk Krause <krause.dirk@web.de> 4.30.2-1
+- Added SPDX-License-Identifier tags to many files.
+- Corrected full license terms back to original BSD-3-Clause text.
+
+* Sun Aug 23 2020 Dirk Krause <krause.dirk@web.de> 4.30.1-1
+- Upgrade for dkct, can use SPDX-License-Identifier lines.
+
+* Thu Aug 20 2020 Dirk Krause <krause.dirk@web.de> 4.30.0-1
+- Added the Dk4WxYesNoDialog class to the libdk4wx library because
+ the wxMessageBox from the libwxgtk3.0-0v5 package in Debian 10 does
+ not localize the button texts.
+- Bugfix in wxdkdraw, added menu items to create arcs.
+- Bugfix in the dk4gra module, pattern size for octagons now matches
+ the pattern size for circles.
+- Yes / no dialogs with localized button texts in wxdkdraw.
+
+* Thu Jul 16 2020 Dirk Krause <krause.dirk@web.de> 4.29.3-1
+- Bugfix in wxdkdraw: Line width 0 elements are highlighted as
+ selection/copy/move/delete/grouping candidates now.
+- Modified htmlbook again for flexbox placement of navigation menu lists
+ if the navigation menu is shown below the main content.
+
+* Thu Jul 16 2020 Dirk Krause <krause.dirk@web.de> 4.29.2-1
+- Modified htmlbook so we can create more responsive designs.
+
+* Sat Jun 27 2020 Dirk Krause <krause.dirk@web.de> 4.29.1-1
+- More markers are written by the itadmin program to the dhcpd.conf output.
+- Modified mklivesys.sh script. We can now inject files into the
+ initramfs filesystem of a live system.
+- Removed libreoffice-style-galaxy from package lists for live systems.
+
+* Mon Apr 13 2020 Dirk Krause <krause.dirk@web.de> 4.29.0-1
+- Bugfix in wxdkdraw: Draw control sets focus on itself in mouse enter
+ events and mouse click events when compiled on Windows.
+ I hope to get the mouse wheel working on Windows.
+- Bugfix in wximgsz: The string table in German language was completed.
+- New function dk4uc2l_string_encoded() in dk4uc2l module.
+
+* Thu Mar 26 2020 Dirk Krause <krause.dirk@web.de> 4.28.1-1
+- Bugfix in wxdkdraw: Do no longer show "Modify spline point s value"
+ dialog in move spline point operations.
+
+* Wed Feb 19 2020 Dirk Krause <krause.dirk@web.de> 4.28.0-1
+- New program: wxdkdraw, minimalistic drawing program for use with LaTeX.
+- Wximgsz rewritten for DK libraries 4.
+ Uses spin controls for input instead of standard text fields.
+- Library API change: The enum values DK4WX_AUTOSTART_REACTION_IGNORE and
+ alike were moved into a public enum in the Dk4WxAutostartController class.
+- Library API change: The a and b parameters in the
+ dk4gratool_dist_point_point() function were changed to const, the a, b and
+ p parameters in dk4gratool_dist_point_track() too.
+- Library API change: The new dk4bb_add_bb() function in the dk4bb module
+ allows to create a bounding box for a drawing from the object bounding
+ boxes.
+
+* Wed Nov 27 2019 Dirk Krause <krause.dirk@web.de> 4.27.0-1
+- Distinction between K and k in size specifications (K=1024, k=1000),
+ M/m, G/g, T/t, P/p, E/e, Z/z, Y/y (powers of 1024, powers of 1000).
+- Bugfix in build process, size of wxChar calculated in configure script.
+- Bugfix in dkwxwiz, corrected name of XPM source.
+
+* Fri Oct 18 2019 Dirk Krause <krause.dirk@web.de> 4.26.0-1
+- Install header files into the includedir/dktools-4 directory.
+- Daemons rshdown and printqd are systemd compatible now.
+- Module dk4dmt modified for systemd compatibility.
+- PID files now in /run/... when systemd is used, /var/run/... otherwise.
+- Build scripts check for systemd use and install systemd service unit files
+ when systemd in use, traditional start scripts otherwise.
+- Build scripts modified for MinGW-w64 build and later probably cross-builds.
+- Program pjsnmp is now installed into libexec directory.
+- Packaging for RPM and DEB packages changed, separated packages for
+ printqd and rshdown.
+- New module dk4bm for bit matrices.
+- New module dk4bml to levelize graphs represented by bit matrices.
+- Bugfix in the dk4apref module: Parameter pv is const, but the buffer
+ was modified.
+- Bugfix in dk4sock25 and dk4sock31 modules: FreeAddrInfo() replaced
+ by FreeAddrInfoW(). This bug was not relevant when using MSVC to build
+ Windows binaries as the FreeAddrInfo() macro is mapped to the
+ FreeAddrInfoW() function when using makefile.vc.
+- Modification in the dk4mem module: Fallback functions only compiled
+ if needed.
+
+* Thu Sep 26 2019 Dirk Krause <krause.dirk@web.de> 4.25.0-1
+- Bugfix in the dk-cat program. The program attempted to issue a byte order
+ marker depending on the systems default encoding instead of the used
+ output encoding.
+- Module dk4itmin added to search for a local minimum of an unimodal
+ function in an interval.
+
+* Thu Aug 15 2019 Dirk Krause <krause.dirk@web.de> 4.24.2-1
+- Bugfix in the dkwt/dkwtadm program. The program did not properly inform
+ all windows about environment modifications.
+
+* Sun Aug 04 2019 Dirk Krause <krause.dirk@web.de> 4.24.1-1
+- Added dk-bin2c program to convert binary data to C source code
+ (array of unsigned char literals).
+- Added markdown documentation for live systems.
+- Classes Dk4Comparable and Dk4Container modified for C++11/C++17.
+
+* Sun Jul 14 2019 Dirk Krause <krause.dirk@web.de> 4.24.0-1
+- Modifications to follow the "Updating to the latest version of wxWidgets"
+ document.
+
+* Sun Jun 16 2019 Dirk Krause <krause.dirk@web.de> 4.23.0-1
+- Bugfix in 32 bit Linux/Unix build process, 64 bit file size support
+ was inactive on 32 bit Linux/Unix in previous versions.
+- Variables to store leightweight class objects returned by c_str().
+- Font feature "script" added, font feature enumeration values changed.
+
+* Tue Apr 16 2019 Dirk Krause <krause.dirk@web.de> 4.22.0-1
+- Configuration default for cosp in the fig2lat program changed to yes.
+- Added some previously internal functions to the API.
+- Functions to calculate 2D and 3D X-spline segment lengths.
+- Option "x-spline sub segments" for dk4gra.conf, "xsss" for language
+ selection. This option specifies the number of Bezier spline segments
+ to draw for each X-spline segment.
+- Parameter "rot" in the text functions in the dk4grpgf and dk4pppt modules
+ to specify the text rotation in degree.
+- Bugfix in dk-lines program to avoid dereferencing NULL pointer.
+- Cleanup, a new directory gui-img with subdirectories was created.
+ The *.ico and *.xpm files were moved from the source code directory
+ into the subdirectories.
+
+* Sat Nov 17 2018 Dirk Krause <krause.dirk@web.de> 4.21.0-1
+- Added complaint to dkct if GUI object has no parent object
+ (is not mentioned as contents of another object).
+- Modified Dk4WxColourView class to show difference between
+ active/inactive state and to place colour chooser over colour view.
+
+* Thu Nov 01 2018 Dirk Krause <krause.dirk@web.de> 4.20.0-1
+- Function $!string added to dkct.
+- Added functions dk4ma_int_from_double() and dk4ma_uint_from_double()
+ to convert double values to int and unsigned.
+
+* Tue Oct 16 2018 Dirk Krause <krause.dirk@web.de> 4.19.1-1
+- Bugfix in Makefile.in for parallel make.
+
+* Sat Oct 13 2018 Dirk Krause <krause.dirk@web.de> 4.19.0-1
+- Functions to calculate greatest common divisor and least common multiple.
+- Function for conversion to smaller integer types.
+- Function to convert UTF-8 encoded strings to wxChar strings.
+- Added event generation to Dk4WxColourView class.
+- Installing printqd and rshdown to /usr/sbin now.
+- File /etc/init.d/printqd to start and stop printqd service.
+
+* Sun Jul 29 2018 Dirk Krause <krause.dirk@web.de> 4.18.1-1
+- Removed misleading warning from dkct shown when a "direction" attribute
+ was assigned to a wxScrollBar.
+
+* Thu Jul 26 2018 Dirk Krause <krause.dirk@web.de> 4.18.0-1
+- Added --no-modification-warning option to dkct.
+ This option suppresses the warning at the beginning of output files
+ advising users to modify the input files processed by dkct instead
+ of the output files produced by the program.
+- Added new modules dk4mai8du8, dk4mai8di8, dk4mai8du16, dk4mai8di16,
+ dk4mai8du32 and dk4mai8di32 to read uint8_t ... int32_t.
+
+* Sat Jul 07 2018 Dirk Krause <krause.dirk@web.de> 4.17.0-1
+- Added options "privacy link" and "privacy page" to htmlbook configuration.
+- Added comments to HTML output of htmlbook.
+- Changed to a faster iteration algorithm in fig2lat and libdk3fig.
+- Added module dk4iter for numeric iterations to libdk4c.
+
+* Sun May 27 2018 Dirk Krause <krause.dirk@web.de> 4.16.0-1
+- Alternative colour chooser added, uses palettes.
+- Dk4WxColourView can be set to be inactive.
+- Former Dk4WxColorView renamed to Dk4WxColourView for consistence,
+ some methods also renamed for consistence.
+- Containers wxChoicebook, wxListbook, wxSimplebook, wxToolbook and
+ wxTreebook now supported by dkct.
+- Attribute text allowed for wxPanel to add panels to book controls.
+- Stock menu items and stock buttons allowed in dkct.
+
+* Sun May 20 2018 Dirk Krause <krause.dirk@web.de> 4.15.0-1
+- Added dk4xsp module for X-spline calculations.
+- Modified configure.ac due to warnings from Debian package building about
+ symbols not found in any library.
+- Added new constants
+ DK4_UINT8_0, DK4_INT8_0, DK4_UINT16_0, DK4_INT16_0, DK4_UINT32_0, DK4_INT32_0
+ to dktypes.h file.
+
+* Sat May 05 2018 Dirk Krause <krause.dirk@web.de> 4.14.1-1
+- Bugfix in Makefile.in and configure.ac, library libdk4ma.a
+ was not mentioned as dependency for libdk4maio8d.a.
+
+* Thu Apr 19 2018 Dirk Krause <krause.dirk@web.de> 4.14.0-1
+- The configure script now checks the presence of the search.h include
+ file and the availability of the qsort() and bsearch() functions.
+- Modified dkrgra, dk4graa and dk4pppt. A flags set was added to text
+ output functions, so we can order a white box and/or an oval box.
+- Modified dk4fpe.h file, it does no longer include compiler pragmas
+ to enable access to the floating point environment.
+ Users might want to apply the pragma to portions of code only
+ and not necessarily to entire source files.
+
+* Sun Apr 15 2018 Dirk Krause <krause.dirk@web.de> 4.13.0-1
+- Added dk4pppt module.
+- Added functions to configure font size and LaTeX preamble lines in
+ dk4gra and dk4graa modules.
+- Added functions to write a char string LaTeX encoded to a stream
+ in the dk4uc2l and dk4uc2la modules.
+- Corrected some error messages in the dk4graa module.
+- Added dk4rec27 module containing the dk4recode_c8_to_dk() function
+ to convert char strings (plain, Win1252, UTF-8) to dkChar strings.
+
+* Thu Apr 12 2018 Dirk Krause <krause.dirk@web.de> 4.12.1-1
+- Changed default for expected encoding when processing standard input
+ or input from file to DK4_FILE_ENCODING_WIN1252 to allow processing
+ of text containing the Euro currency symbol.
+- Renamed some encodings.
+- Release mechanism modified: Presence of the preview.txt file indicates
+ to build not an official release.
+
+* Fri Apr 06 2018 Dirk Krause <krause.dirk@web.de> 4.12.0-1
+- Rewrote bmpp and wxbmpp for library version 4.
+- Modified dk4align.h for separated enum types for text and image
+ alignment.
+- Added dk4mao8dns module to write double values without scientific notation.
+- Packaging changed, packaging script do no longer deal with directories
+ for printqd. Printqd can only be used with the LPRng print system which
+ is not available as package. Users install that software manually
+ deciding about UID and GID to run LPRng at build time.
+ So our package postinstallation and preremoval scripts can not know
+ which UID and GID is used for LPRng.
+
+* Sat Feb 10 2018 Dirk Krause <krause.dirk@web.de> 4.11.4-1
+- The dkct program now checks state machine descriptions for duplicated
+ numeric values for states, inputs and outputs.
+ State, input and output names are checked whether or not they are
+ valid identifiers in the C programming language.
+- State, input, and output definitions are now written as enums by default
+ instead of defines. When using doxygen, this results in a more readable
+ documentation.
+
+* Thu Feb 08 2018 Dirk Krause <krause.dirk@web.de> 4.11.3-1
+- Added new value 7 for co_gu field in computers database of itadmin
+ to indicate that a computer is retired.
+
+* Fri Feb 02 2018 Dirk Krause <krause.dirk@web.de> 4.11.2-1
+- Bugfix, corrected configure.ac and configure to properly detect
+ Debian and derivative systems.
+
+* Sat Jan 27 2018 Dirk Krause <krause.dirk@web.de> 4.11.1-1
+- Bugfix, some XPM files contained named colors instead of hexadecimal values.
+- GUI applications now restoring window position and size.
+
+* Wed Jan 24 2018 Dirk Krause <krause.dirk@web.de> 4.11.0-1
+- Splitted dk4uc2l module into two modules dk4uc2la and dk4uc2l.
+- Appropriate changes to dk-t2l program.
+
+* Mon Nov 20 2017 Dirk Krause <krause.dirk@web.de> 4.10.0-0.0.1
+- Added dk-lines program.
+- Bugfix in dkct, corrected typo.
+- Added test for __attribute__((unused)) mechanism.
+- Now using DK4_HAVE_INLINE and DK4_USE_INLINE (inline keyword available,
+ want to use inline functions instead of macros).
+
+* Fri Oct 13 2017 Dirk Krause <krause.dirk@web.de> 4.9.7-0.0.1
+- Bugfix in htmlbook, no warning when escaping a leading raute character
+ by a backslash.
+
+* Tue Oct 10 2017 Dirk Krause <krause.dirk@web.de> 4.9.6-0.0.1
+- New "html doctype" option to htmlbook.
+- Docu update for htmlbook, requirement to encode & as &amp; in
+ a.href, img.svg and other attributes.
+- Configuration option SHORTIFNAMES in DKtoolian build script for Debian
+ Stretch, so users can choose whether to use the new long names or the
+ traditional short names for network interfaces.
+
+* Thu Oct 05 2017 Dirk Krause <krause.dirk@web.de> 4.9.5-0.0.1
+- Configuration option "svg wh" for htmlbook to set the default for
+ svgwh attributes in %%img ...%% commands.
+
+* Tue Oct 03 2017 Dirk Krause <krause.dirk@web.de> 4.9.4-0.0.1
+- Bugfix in htmlbook, write correct strings for href and title
+ attribute and hyperlink text now for URLs with multiple
+ ampersand separated parameters like http://x.y.z/test.php?a=b&c=d.
+
+* Fri Sep 29 2017 Dirk Krause <krause.dirk@web.de> 4.9.3-0.0.1
+- Modified htmlbook, the hyperlink title (tool tip text) can be configured
+ to preprend a globe symbol for external links (links outside the
+ current book).
+
+* Wed Sep 20 2017 Dirk Krause <krause.dirk@web.de> 4.9.2-0.0.1
+- Modified debian-stretch-prepare.sh script to install packages
+ libmariadbclient-dev and libmariadb-dev, so the matching header
+ file mariadb/mysql.h and -lmariadbclient library are found.
+
+* Wed Sep 13 2017 Dirk Krause <krause.dirk@web.de> 4.9.1-0.0.1
+- Changes in debian/control to build on Debian Stretch.
+- Statistics summary output for info log level in dk-send and dk-recv.
+- Fixed tests for RAND_egd() function.
+- Bugfix in dk4strm module: No write attempt on closing stream if buffer empty.
+- Correct Bezier curve bounding box calculation.
+
+* Tue Apr 25 2017 Dirk Krause <krause.dirk@web.de> 4.9.0-0.0.1
+- Followed further suggestion from the CTAN team.
* Tue Mar 28 2017 Dirk Krause <krause.dirk@web.de> 4.8.3-0.0.1
- Followed improvement suggestions from the CTAN team.
@@ -316,7 +667,7 @@ files provided by this project.
- Smaller changes related to Debian packaging.
* Sat May 28 2016 Dirk Krause <krause.dirk@web.de> 4.3.3-0.0.1
-- Debian packaging changed, developer package is dktools-lib-$(4.8)-dev.
+- Debian packaging changed, developer package is dktools-lib-$(4.30)-dev.
- RPM packaging changed, shared library symlinks now in devel package.
- New script to generate debian/changelog from dktools-el6.spec.in file.
@@ -591,7 +942,7 @@ files provided by this project.
- More useful error message for malformed path to dkt ls on Windows
(paths in double quotes where backslash escapes closing double quote).
-* Thu Mar 20 2013 Dirk Krause <krause.dirk@web.de> 3.0.6-0.0.1
+* Thu Mar 21 2013 Dirk Krause <krause.dirk@web.de> 3.0.6-0.0.1
- dkct enhanced for unknown classes.
* Wed Mar 20 2013 Dirk Krause <krause.dirk@web.de> 3.0.5-0.0.1
@@ -626,11 +977,11 @@ files provided by this project.
- The "ctrl database-cleanup" operation for prqd now removes
print accounts and page counts with value 0.
-* Sun Jun 06 2011 Dirk Krause <krause.dirk@web.de> 2.2.20-0.0.1
+* Mon Jun 06 2011 Dirk Krause <krause.dirk@web.de> 2.2.20-0.0.1
- Program imgsize renamed to chimgsize to avoid name conflicts
with perl-Image-Size RPM.
-* Sun Apr 19 2011 Dirk Krause <krause.dirk@web.de> 2.2.19-0.0.1
+* Tue Apr 19 2011 Dirk Krause <krause.dirk@web.de> 2.2.19-0.0.1
- Bugfix in text2htm, wrong format specification.
* Sun Nov 14 2010 Dirk Krause <krause.dirk@web.de> 2.2.18-0.0.1
@@ -661,7 +1012,7 @@ files provided by this project.
* Tue Sep 14 2010 Dirk Krause <krause.dirk@web.de> 2.2.13-0.0.1
- Corrected typographic errors in the DKrause::Diagram documentation.
-* Tue Sep 13 2010 Dirk Krause <krause.dirk@web.de> 2.2.12-0.0.1
+* Mon Sep 13 2010 Dirk Krause <krause.dirk@web.de> 2.2.12-0.0.1
- The *.jar files were missing in the Windows executable setup of
2.2.11. Here they are back.
diff --git a/support/dktools/dktools-fedora-27.spec b/support/dktools/dktools-fedora-27.spec
new file mode 100644
index 0000000000..6f2f56bb73
--- /dev/null
+++ b/support/dktools/dktools-fedora-27.spec
@@ -0,0 +1,276 @@
+# SPEC file to build Fedora and EL packages.
+#
+Name: dktools
+Version: 4.14.0
+Source: file:///home/krause/work/dktools-4.14.0.tar.gz
+Release: 1%{?dist}
+Summary: Dirk Krause's tools and libraries
+Vendor: Dirk Krause
+# Packager: Dirk Krause
+Group: Applications/System
+License: BSD
+URL: http://sourceforge.net/p/dktools/wiki/Home/
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel libdb-devel wxGTK3 wxGTK3-devel
+Requires: bzip2 openssl net-snmp wxGTK3
+Conflicts: dktools-rescue
+Prefix: %{_prefix}
+
+# ___PROVIDES___
+
+# ----- RPMLINT (Fedora Core 27) -----
+# In the lines below the spelling checker finds false positives:
+# wxWidgets htb dk fic bmm blks eradisk recoding sqlsplit mysqldump
+# uid pwgen recv dkdbt octpgfpl.
+%description
+A set of tools for graphics conversion, text conversion, software
+development, administration and printing and some general-purpose tools.
+ bmpp / wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
+ fig2lat Convert FIG to PGF,EPS+TeX,PDF+TeX,EPS,SVG
+ wximgsz Suggest good sizes to scale bitmap images
+ htmlbook Publish HTML like a book
+ dkct / wxdkct Preprocessor for C, C++, Objective-C and Java
+ (debugging/tracing, state machines, wxWidgets GUIs)
+ dkwxwiz Create project skeleton for wxWidgets+dktools based programs
+ wxdkhtb Viewer for *.htb help files
+ itadmin Use a MySQL database to manage your IT
+ dk-ls ls clone, configurable column order
+ dk-fic File integrity checker
+ dk-bmm Backup media manager (10 tape rotation)
+ dk-blks Correct data stream block size (for use with dd)
+ dk-eradisk Create data stream to erase a disk
+ dk-hex Show data in hexadecimal or octal notation
+ dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-lines Select lines by line start pattern or line numbers
+ dk-sort sort clone, processes ASCII/UTF-8/UTF-16
+ dk-t2h Text to HTML converter
+ dk-t2l Text to LaTeX converter
+ dk-sqlsplit Split overlong SQL lines from mysqldump
+ dk-uid Find user ID in given range
+ dk-pwgen Create passwords, PINs and WiFi keys
+ dk-send Send data stream to one or multiple recipients over TCP
+ dk-recv Receive data stream from a dk-send process
+ dkdbt Tool for simple databases
+ printqd Print quota enforcement for LPRng print systems
+ wxpqdic GUI client to check print quota
+ addctrld Add CTRL-D to end of data stream if not yet present
+ wxdkclock Simple clock, one alert
+ plpdftex Output driver for octpgfpl
+
+%prep
+%setup -q
+# %setup
+
+
+%build
+%configure --enable-packaging
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+echo 'I: chmod 0755' %{buildroot}%{_libdir}/lib*.so.*
+chmod 0755 %{buildroot}%{_libdir}/lib*.so.*
+if [ ! -d "%{buildroot}%{_datadir}/licenses" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses"
+ chmod 755 "%{buildroot}%{_datadir}/licenses"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/licenses/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/licenses/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+if [ ! -d "%{buildroot}%{_datadir}/doc" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc"
+ chmod 755 "%{buildroot}%{_datadir}/doc"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/doc/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/doc/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/doc/dktools/LICENSE
+echo 'I: Copying INSTALL'
+cp INSTALL %{buildroot}%{_datadir}/doc/dktools/INSTALL
+echo 'I: Copying README'
+cp README %{buildroot}%{_datadir}/doc/dktools/README
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/INSTALL
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/README
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%doc README bsdlic.txt
+%{_bindir}/*
+%{_libdir}/libdk3*.so.*
+%{_libdir}/libdk4*.so.*
+%{_datadir}/applications/*
+%{_datadir}/dktools
+%{_datadir}/dk4app
+%{_datadir}/man/man1/*
+%{_datadir}/man/man5/*
+%{_datadir}/doc/dktools/*
+%{_datadir}/licenses/dktools/*
+%config(noreplace) %{_sysconfdir}/printqd/printqd.conf.sample
+%config(noreplace) %{_sysconfdir}/rshdown/rshdown.conf.sample
+%config(noreplace) %{_sysconfdir}/dk3app/dk3paper.conf
+%config(noreplace) %{_sysconfdir}/dk4app/dk4gra.conf
+
+%post
+ldconfig
+
+%postun
+ldconfig
+
+
+
+#
+# The rescue sub-package installs only those binaries useful on
+# a rescue live system.
+#
+%package rescue
+#
+# The devel sub-package installs developer support.
+#
+Summary: Only those DK tools binaries useful on a rescue live system
+Group: Applications/System
+Requires: bzip2 openssl
+Conflicts: dktools
+Prefix: %{_prefix}
+
+%description rescue
+On live systems for system rescue we only need the dknet and dkt program.
+
+%files rescue
+%defattr(-,root,root,-)
+%doc README bsdlic.txt
+%{_bindir}/dk-send
+%{_bindir}/dk-recv
+%{_bindir}/dk-blks
+%{_bindir}/dk-cat
+%{_bindir}/dk-eradisk
+%{_bindir}/dk-ls
+%{_libdir}/libdk4socka.so.*
+%{_libdir}/libdk4sock.so.*
+%{_libdir}/libdk4maiodh.so.*
+%{_libdir}/libdk4maio8h.so.*
+%{_libdir}/libdk4app.so.*
+%{_libdir}/libdk4c.so.*
+%{_libdir}/libdk4maiodd.so.*
+%{_libdir}/libdk4maiowd.so.*
+%{_libdir}/libdk4maio8d.so.*
+%{_libdir}/libdk4base.so.*
+%{_datadir}/dktools/en/dk-send.*
+%{_datadir}/dktools/en/dk-recv.*
+%{_datadir}/dktools/en/dk-cat.*
+%{_datadir}/dktools/en/dk-blks.*
+%{_datadir}/dktools/en/dk-ls.*
+%{_datadir}/dktools/de/dk-send.*
+%{_datadir}/dktools/de/dk-recv.*
+%{_datadir}/dktools/de/dk-cat.*
+%{_datadir}/dktools/de/dk-blks.*
+%{_datadir}/dktools/de/dk-ls.*
+
+
+%post rescue
+ldconfig
+
+%postun rescue
+ldconfig
+
+%package devel
+Summary: Development files for libraries from the DK tools project
+Group: Development/Libraries
+Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc libdb-devel wxGTK3 wxGTK3-devel
+Prefix: %{_prefix}
+
+%description devel
+If you want to use modules from the DK tools project in your programs,
+you need the libraries from the dktools-lib package and the header
+files provided by this project.
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/*
+%{_libdir}/pkgconfig/dktools.pc
+%{_libdir}/libdk3*.so
+%{_libdir}/libdk4*.so
+
+%changelog
+
+* Thu Apr 19 2018 Dirk Krause <krause.dirk@web.de> 4.14.0-1
+- The configure script now checks the presence of the search.h include
+ file and the availability of the qsort() and bsearch() functions.
+- Modified dkrgra, dk4graa and dk4pppt. A flags set was added to text
+ output functions, so we can order a white box and/or an oval box.
+- Modified dk4fpe.h file, it does no longer include compiler pragmas
+ to enable access to the floating point environment.
+ Users might want to apply the pragma to portions of code only
+ and not necessarily to entire source files.
+
+* Sun Apr 15 2018 Dirk Krause <krause.dirk@web.de> 4.13.0-1
+- Added dk4pppt module.
+- Added functions to configure font size and LaTeX preamble lines in
+ dk4gra and dk4graa modules.
+- Added functions to write a char string LaTeX encoded to a stream
+ in the dk4uc2l and dk4uc2la modules.
+- Corrected some error messages in the dk4graa module.
+- Added dk4rec27 module containing the dk4recode_c8_to_dk() function
+ to convert char strings (plain, Win1252, UTF-8) to dkChar strings.
+
+* Thu Apr 12 2018 Dirk Krause <krause.dirk@web.de> 4.12.1-1
+- Changed default for expected encoding when processing standard input
+ or input from file to DK4_FILE_ENCODING_WIN1252 to allow processing
+ of text containing the Euro currency symbol.
+- Renamed some encodings.
+- Release mechanism modified: Presence of the preview.txt file indicates
+ to build not an official release.
+
+* Fri Apr 06 2018 Dirk Krause <krause.dirk@web.de> 4.12.0-1
+- Rewrote bmpp and wxbmpp for library version 4.
+- Modified dk4align.h for separated enum types for text and image
+ alignment.
+- Added dk4mao8dns module to write double values without scientific notation.
+- Packaging changed, packaging script do no longer deal with directories
+ for printqd. Printqd can only be used with the LPRng print system which
+ is not available as package. Users install that software manually
+ deciding about UID and GID to run LPRng at build time.
+ So our package postinstallation and preremoval scripts can not know
+ which UID and GID is used for LPRng.
+
+* Sat Feb 10 2018 Dirk Krause <krause.dirk@web.de> 4.11.4-1
+- The dkct program now checks state machine descriptions for duplicated
+ numeric values for states, inputs and outputs.
+ State, input and output names are checked whether or not they are
+ valid identifiers in the C programming language.
+- State, input, and output definitions are now written as enums by default
+ instead of defines. When using doxygen, this results in a more readable
+ documentation.
+
+* Thu Feb 08 2018 Dirk Krause <krause.dirk@web.de> 4.11.3-1
+- Added new value 7 for co_gu field in computers database of itadmin
+ to indicate that a computer is retired.
+
+* Fri Feb 02 2018 Dirk Krause <krause.dirk@web.de> 4.11.2-1
+- Bugfix, corrected configure.ac and configure to properly detect
+ Debian and derivative systems.
+
+* Sat Jan 27 2018 Dirk Krause <krause.dirk@web.de> 4.11.1-1
+- Bugfix, some XPM files contained named colors instead of hexadecimal values.
+- GUI applications now restoring window position and size.
+
+* Wed Jan 24 2018 Dirk Krause <krause.dirk@web.de> 4.11.0-1
+- Splitted dk4uc2l module into two modules dk4uc2la and dk4uc2l.
+- Appropriate changes to dk-t2l program.
+
diff --git a/support/dktools/dktools-fedora-28.spec b/support/dktools/dktools-fedora-28.spec
new file mode 100644
index 0000000000..4ff73cb128
--- /dev/null
+++ b/support/dktools/dktools-fedora-28.spec
@@ -0,0 +1,329 @@
+# SPEC file to build Fedora and EL packages.
+#
+Name: dktools
+Version: 4.19.1
+Source: file:///home/krause/work/dktools-4.19.1.tar.gz
+Release: 1%{?dist}
+Summary: Dirk Krause's tools and libraries
+Vendor: Dirk Krause
+# Packager: Dirk Krause
+Group: Applications/System
+License: BSD
+URL: http://sourceforge.net/p/dktools/wiki/Home/
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel libdb-devel wxGTK3 wxGTK3-devel
+Requires: bzip2 openssl net-snmp wxGTK3
+Conflicts: dktools-rescue
+Prefix: %{_prefix}
+
+# ___PROVIDES___
+
+# ----- RPMLINT (Fedora Core 27) -----
+# In the lines below the spelling checker finds false positives:
+# wxWidgets htb dk fic bmm blks eradisk recoding sqlsplit mysqldump
+# uid pwgen recv dkdbt octpgfpl.
+%description
+A set of tools for graphics conversion, text conversion, software
+development, administration and printing and some general-purpose tools.
+ bmpp / wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
+ fig2lat Convert FIG to PGF,EPS+TeX,PDF+TeX,EPS,SVG
+ wximgsz Suggest good sizes to scale bitmap images
+ htmlbook Publish HTML like a book
+ dkct / wxdkct Preprocessor for C, C++, Objective-C and Java
+ (debugging/tracing, state machines, wxWidgets GUIs)
+ dkwxwiz Create project skeleton for wxWidgets+dktools based programs
+ wxdkhtb Viewer for *.htb help files
+ itadmin Use a MySQL database to manage your IT
+ dk-ls ls clone, configurable column order
+ dk-fic File integrity checker
+ dk-bmm Backup media manager (10 tape rotation)
+ dk-blks Correct data stream block size (for use with dd)
+ dk-eradisk Create data stream to erase a disk
+ dk-hex Show data in hexadecimal or octal notation
+ dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-lines Select lines by line start pattern or line numbers
+ dk-sort sort clone, processes ASCII/UTF-8/UTF-16
+ dk-t2h Text to HTML converter
+ dk-t2l Text to LaTeX converter
+ dk-sqlsplit Split overlong SQL lines from mysqldump
+ dk-uid Find user ID in given range
+ dk-pwgen Create passwords, PINs and WiFi keys
+ dk-send Send data stream to one or multiple recipients over TCP
+ dk-recv Receive data stream from a dk-send process
+ dkdbt Tool for simple databases
+ printqd Print quota enforcement for LPRng print systems
+ wxpqdic GUI client to check print quota
+ addctrld Add CTRL-D to end of data stream if not yet present
+ wxdkclock Simple clock, one alert
+ plpdftex Output driver for octpgfpl
+
+%prep
+%setup -q
+# %setup
+
+
+%build
+%configure --enable-packaging
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+echo 'I: chmod 0755' %{buildroot}%{_libdir}/lib*.so.*
+chmod 0755 %{buildroot}%{_libdir}/lib*.so.*
+if [ ! -d "%{buildroot}%{_datadir}/licenses" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses"
+ chmod 755 "%{buildroot}%{_datadir}/licenses"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/licenses/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/licenses/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+if [ ! -d "%{buildroot}%{_datadir}/doc" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc"
+ chmod 755 "%{buildroot}%{_datadir}/doc"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/doc/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/doc/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/doc/dktools/LICENSE
+echo 'I: Copying INSTALL'
+cp INSTALL %{buildroot}%{_datadir}/doc/dktools/INSTALL
+echo 'I: Copying README'
+cp README %{buildroot}%{_datadir}/doc/dktools/README
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/INSTALL
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/README
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%doc README bsdlic.txt
+%{_bindir}/*
+%{_sbindir}/*
+%{_libdir}/libdk3*.so.*
+%{_libdir}/libdk4*.so.*
+%{_datadir}/applications/*
+%{_datadir}/dktools
+%{_datadir}/dk4app
+%{_datadir}/man/man1/*
+%{_datadir}/man/man5/*
+%{_datadir}/doc/dktools/*
+%{_datadir}/licenses/dktools/*
+%{_sysconfdir}/init.d/*
+%config(noreplace) %{_sysconfdir}/printqd/printqd.conf.sample
+%config(noreplace) %{_sysconfdir}/rshdown/rshdown.conf.sample
+%config(noreplace) %{_sysconfdir}/dk3app/dk3paper.conf
+%config(noreplace) %{_sysconfdir}/dk4app/dk4gra.conf
+
+%post
+ldconfig
+
+%postun
+ldconfig
+
+
+
+#
+# The rescue sub-package installs only those binaries useful on
+# a rescue live system.
+#
+%package rescue
+#
+# The devel sub-package installs developer support.
+#
+Summary: Only those DK tools binaries useful on a rescue live system
+Group: Applications/System
+Requires: bzip2 openssl
+Conflicts: dktools
+Prefix: %{_prefix}
+
+%description rescue
+On live systems for system rescue we only need the dknet and dkt program.
+
+%files rescue
+%defattr(-,root,root,-)
+%doc README bsdlic.txt
+%{_bindir}/dk-send
+%{_bindir}/dk-recv
+%{_bindir}/dk-blks
+%{_bindir}/dk-cat
+%{_bindir}/dk-eradisk
+%{_bindir}/dk-ls
+%{_libdir}/libdk4socka.so.*
+%{_libdir}/libdk4sock.so.*
+%{_libdir}/libdk4maiodh.so.*
+%{_libdir}/libdk4maio8h.so.*
+%{_libdir}/libdk4app.so.*
+%{_libdir}/libdk4c.so.*
+%{_libdir}/libdk4maiodd.so.*
+%{_libdir}/libdk4maiowd.so.*
+%{_libdir}/libdk4maio8d.so.*
+%{_libdir}/libdk4base.so.*
+%{_datadir}/dktools/en/dk-send.*
+%{_datadir}/dktools/en/dk-recv.*
+%{_datadir}/dktools/en/dk-cat.*
+%{_datadir}/dktools/en/dk-blks.*
+%{_datadir}/dktools/en/dk-ls.*
+%{_datadir}/dktools/de/dk-send.*
+%{_datadir}/dktools/de/dk-recv.*
+%{_datadir}/dktools/de/dk-cat.*
+%{_datadir}/dktools/de/dk-blks.*
+%{_datadir}/dktools/de/dk-ls.*
+
+
+%post rescue
+ldconfig
+
+%postun rescue
+ldconfig
+
+%package devel
+Summary: Development files for libraries from the DK tools project
+Group: Development/Libraries
+Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc libdb-devel wxGTK3 wxGTK3-devel
+Prefix: %{_prefix}
+
+%description devel
+If you want to use modules from the DK tools project in your programs,
+you need the libraries from the dktools-lib package and the header
+files provided by this project.
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/*
+%{_libdir}/pkgconfig/dktools.pc
+%{_libdir}/libdk3*.so
+%{_libdir}/libdk4*.so
+
+%changelog
+
+* Tue Oct 16 2018 Dirk Krause <krause.dirk@web.de> 4.19.1-1
+- Bugfix in Makefile.in for parallel make.
+
+* Sat Oct 13 2018 Dirk Krause <krause.dirk@web.de> 4.19.0-1
+- Functions to calculate greatest common divisor and least common multiple.
+- Function for conversion to smaller integer types.
+- Function to convert UTF-8 encoded strings to wxChar strings.
+- Added event generation to Dk4WxColourView class.
+- Installing printqd and rshdown to /usr/sbin now.
+- File /etc/init.d/printqd to start and stop printqd service.
+
+* Sun Jul 29 2018 Dirk Krause <krause.dirk@web.de> 4.18.1-1
+- Removed misleading warning from dkct shown when a "direction" attribute
+ was assigned to a wxScrollBar.
+
+* Thu Jul 26 2018 Dirk Krause <krause.dirk@web.de> 4.18.0-1
+- Added --no-modification-warning option to dkct.
+ This option suppresses the warning at the beginning of output files
+ advising users to modify the input files processed by dkct instead
+ of the output files produced by the program.
+- Added new modules dk4mai8du8, dk4mai8di8, dk4mai8du16, dk4mai8di16,
+ dk4mai8du32 and dk4mai8di32 to read uint8_t ... int32_t.
+
+* Sat Jul 07 2018 Dirk Krause <krause.dirk@web.de> 4.17.0-1
+- Added options "privacy link" and "privacy page" to htmlbook configuration.
+- Added comments to HTML output of htmlbook.
+- Changed to a faster iteration algorithm in fig2lat and libdk3fig.
+- Added module dk4iter for numeric iterations to libdk4c.
+
+* Sun May 27 2018 Dirk Krause <krause.dirk@web.de> 4.16.0-1
+- Alternative colour chooser added, uses palettes.
+- Dk4WxColourView can be set to be inactive.
+- Former Dk4WxColorView renamed to Dk4WxColourView for consistence,
+ some methods also renamed for consistence.
+- Containers wxChoicebook, wxListbook, wxSimplebook, wxToolbook and
+ wxTreebook now supported by dkct.
+- Attribute text allowed for wxPanel to add panels to book controls.
+- Stock menu items and stock buttons allowed in dkct.
+
+* Sun May 20 2018 Dirk Krause <krause.dirk@web.de> 4.15.0-1
+- Added dk4xsp module for X-spline calculations.
+- Modified configure.ac due to warnings from Debian package building about
+ symbols not found in any library.
+- Added new constants
+ DK4_UINT8_0, DK4_INT8_0, DK4_UINT16_0, DK4_INT16_0, DK4_UINT32_0, DK4_INT32_0
+ to dktypes.h file.
+
+* Sat May 05 2018 Dirk Krause <krause.dirk@web.de> 4.14.1-1
+- Bugfix in Makefile.in and configure.ac, library libdk4ma.a
+ was not mentioned as dependency for libdk4maio8d.a.
+
+* Thu Apr 19 2018 Dirk Krause <krause.dirk@web.de> 4.14.0-1
+- The configure script now checks the presence of the search.h include
+ file and the availability of the qsort() and bsearch() functions.
+- Modified dkrgra, dk4graa and dk4pppt. A flags set was added to text
+ output functions, so we can order a white box and/or an oval box.
+- Modified dk4fpe.h file, it does no longer include compiler pragmas
+ to enable access to the floating point environment.
+ Users might want to apply the pragma to portions of code only
+ and not necessarily to entire source files.
+
+* Sun Apr 15 2018 Dirk Krause <krause.dirk@web.de> 4.13.0-1
+- Added dk4pppt module.
+- Added functions to configure font size and LaTeX preamble lines in
+ dk4gra and dk4graa modules.
+- Added functions to write a char string LaTeX encoded to a stream
+ in the dk4uc2l and dk4uc2la modules.
+- Corrected some error messages in the dk4graa module.
+- Added dk4rec27 module containing the dk4recode_c8_to_dk() function
+ to convert char strings (plain, Win1252, UTF-8) to dkChar strings.
+
+* Thu Apr 12 2018 Dirk Krause <krause.dirk@web.de> 4.12.1-1
+- Changed default for expected encoding when processing standard input
+ or input from file to DK4_FILE_ENCODING_WIN1252 to allow processing
+ of text containing the Euro currency symbol.
+- Renamed some encodings.
+- Release mechanism modified: Presence of the preview.txt file indicates
+ to build not an official release.
+
+* Fri Apr 06 2018 Dirk Krause <krause.dirk@web.de> 4.12.0-1
+- Rewrote bmpp and wxbmpp for library version 4.
+- Modified dk4align.h for separated enum types for text and image
+ alignment.
+- Added dk4mao8dns module to write double values without scientific notation.
+- Packaging changed, packaging script do no longer deal with directories
+ for printqd. Printqd can only be used with the LPRng print system which
+ is not available as package. Users install that software manually
+ deciding about UID and GID to run LPRng at build time.
+ So our package postinstallation and preremoval scripts can not know
+ which UID and GID is used for LPRng.
+
+* Sat Feb 10 2018 Dirk Krause <krause.dirk@web.de> 4.11.4-1
+- The dkct program now checks state machine descriptions for duplicated
+ numeric values for states, inputs and outputs.
+ State, input and output names are checked whether or not they are
+ valid identifiers in the C programming language.
+- State, input, and output definitions are now written as enums by default
+ instead of defines. When using doxygen, this results in a more readable
+ documentation.
+
+* Thu Feb 08 2018 Dirk Krause <krause.dirk@web.de> 4.11.3-1
+- Added new value 7 for co_gu field in computers database of itadmin
+ to indicate that a computer is retired.
+
+* Fri Feb 02 2018 Dirk Krause <krause.dirk@web.de> 4.11.2-1
+- Bugfix, corrected configure.ac and configure to properly detect
+ Debian and derivative systems.
+
+* Sat Jan 27 2018 Dirk Krause <krause.dirk@web.de> 4.11.1-1
+- Bugfix, some XPM files contained named colors instead of hexadecimal values.
+- GUI applications now restoring window position and size.
+
+* Wed Jan 24 2018 Dirk Krause <krause.dirk@web.de> 4.11.0-1
+- Splitted dk4uc2l module into two modules dk4uc2la and dk4uc2l.
+- Appropriate changes to dk-t2l program.
+
diff --git a/support/dktools/dktools-fedora-29.spec b/support/dktools/dktools-fedora-29.spec
new file mode 100644
index 0000000000..b2a8814eb8
--- /dev/null
+++ b/support/dktools/dktools-fedora-29.spec
@@ -0,0 +1,358 @@
+# SPEC file to build Fedora and EL packages.
+#
+Name: dktools
+Version: 4.23.0
+Source: file:///home/krause/work/dktools-4.23.0.tar.gz
+Release: 1%{?dist}
+Summary: Dirk Krause's tools and libraries
+Vendor: Dirk Krause
+# Packager: Dirk Krause
+Group: Applications/System
+License: BSD
+URL: http://sourceforge.net/p/dktools/wiki/Home/
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+BuildRequires: mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel libdb-devel wxGTK3 wxGTK3-devel
+Requires: bzip2 openssl net-snmp wxGTK3
+Conflicts: dktools-rescue
+Prefix: %{_prefix}
+
+# ___PROVIDES___
+
+# ----- RPMLINT (Fedora Core 27) -----
+# In the lines below the spelling checker finds false positives:
+# wxWidgets htb dk fic bmm blks eradisk recoding sqlsplit mysqldump
+# uid pwgen recv dkdbt octpgfpl.
+%description
+A set of tools for graphics conversion, text conversion, software
+development, administration and printing and some general-purpose tools.
+ bmpp / wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
+ fig2lat Convert FIG to PGF,EPS+TeX,PDF+TeX,EPS,SVG
+ wximgsz Suggest good sizes to scale bitmap images
+ htmlbook Publish HTML like a book
+ dkct / wxdkct Preprocessor for C, C++, Objective-C and Java
+ (debugging/tracing, state machines, wxWidgets GUIs)
+ dkwxwiz Create project skeleton for wxWidgets+dktools based programs
+ wxdkhtb Viewer for *.htb help files
+ itadmin Use a MySQL database to manage your IT
+ dk-ls ls clone, configurable column order
+ dk-fic File integrity checker
+ dk-bmm Backup media manager (10 tape rotation)
+ dk-blks Correct data stream block size (for use with dd)
+ dk-eradisk Create data stream to erase a disk
+ dk-hex Show data in hexadecimal or octal notation
+ dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-lines Select lines by line start pattern or line numbers
+ dk-sort sort clone, processes ASCII/UTF-8/UTF-16
+ dk-t2h Text to HTML converter
+ dk-t2l Text to LaTeX converter
+ dk-sqlsplit Split overlong SQL lines from mysqldump
+ dk-uid Find user ID in given range
+ dk-pwgen Create passwords, PINs and WiFi keys
+ dk-send Send data stream to one or multiple recipients over TCP
+ dk-recv Receive data stream from a dk-send process
+ dkdbt Tool for simple databases
+ printqd Print quota enforcement for LPRng print systems
+ wxpqdic GUI client to check print quota
+ addctrld Add CTRL-D to end of data stream if not yet present
+ wxdkclock Simple clock, one alert
+ plpdftex Output driver for octpgfpl
+
+%prep
+%setup -q
+# %setup
+
+
+%build
+%configure --enable-packaging
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+echo 'I: chmod 0755' %{buildroot}%{_libdir}/lib*.so.*
+chmod 0755 %{buildroot}%{_libdir}/lib*.so.*
+if [ ! -d "%{buildroot}%{_datadir}/licenses" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses"
+ chmod 755 "%{buildroot}%{_datadir}/licenses"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/licenses/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/licenses/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+if [ ! -d "%{buildroot}%{_datadir}/doc" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc"
+ chmod 755 "%{buildroot}%{_datadir}/doc"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/doc/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/doc/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/doc/dktools/LICENSE
+echo 'I: Copying INSTALL'
+cp INSTALL %{buildroot}%{_datadir}/doc/dktools/INSTALL
+echo 'I: Copying README'
+cp README %{buildroot}%{_datadir}/doc/dktools/README
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/INSTALL
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/README
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%doc README bsdlic.txt
+%{_bindir}/*
+%{_sbindir}/*
+%{_libdir}/libdk3*.so.*
+%{_libdir}/libdk4*.so.*
+%{_datadir}/applications/*
+%{_datadir}/dktools
+%{_datadir}/dk4app
+%{_datadir}/man/man1/*
+%{_datadir}/man/man5/*
+%{_datadir}/doc/dktools/*
+%{_datadir}/licenses/dktools/*
+%{_sysconfdir}/init.d/*
+%config(noreplace) %{_sysconfdir}/printqd/printqd.conf.sample
+%config(noreplace) %{_sysconfdir}/rshdown/rshdown.conf.sample
+%config(noreplace) %{_sysconfdir}/dk3app/dk3paper.conf
+%config(noreplace) %{_sysconfdir}/dk4app/dk4gra.conf
+
+%post
+ldconfig
+
+%postun
+ldconfig
+
+
+
+#
+# The rescue sub-package installs only those binaries useful on
+# a rescue live system.
+#
+%package rescue
+#
+# The devel sub-package installs developer support.
+#
+Summary: Only those DK tools binaries useful on a rescue live system
+Group: Applications/System
+Requires: bzip2 openssl
+Conflicts: dktools
+Prefix: %{_prefix}
+
+%description rescue
+On live systems for system rescue we only need the dknet and dkt program.
+
+%files rescue
+%defattr(-,root,root,-)
+%doc README bsdlic.txt
+%{_bindir}/dk-send
+%{_bindir}/dk-recv
+%{_bindir}/dk-blks
+%{_bindir}/dk-cat
+%{_bindir}/dk-eradisk
+%{_bindir}/dk-ls
+%{_libdir}/libdk4socka.so.*
+%{_libdir}/libdk4sock.so.*
+%{_libdir}/libdk4maiodh.so.*
+%{_libdir}/libdk4maio8h.so.*
+%{_libdir}/libdk4app.so.*
+%{_libdir}/libdk4c.so.*
+%{_libdir}/libdk4maiodd.so.*
+%{_libdir}/libdk4maiowd.so.*
+%{_libdir}/libdk4maio8d.so.*
+%{_libdir}/libdk4base.so.*
+%{_datadir}/dktools/en/dk-send.*
+%{_datadir}/dktools/en/dk-recv.*
+%{_datadir}/dktools/en/dk-cat.*
+%{_datadir}/dktools/en/dk-blks.*
+%{_datadir}/dktools/en/dk-ls.*
+%{_datadir}/dktools/de/dk-send.*
+%{_datadir}/dktools/de/dk-recv.*
+%{_datadir}/dktools/de/dk-cat.*
+%{_datadir}/dktools/de/dk-blks.*
+%{_datadir}/dktools/de/dk-ls.*
+
+
+%post rescue
+ldconfig
+
+%postun rescue
+ldconfig
+
+%package devel
+Summary: Development files for libraries from the DK tools project
+Group: Development/Libraries
+Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc libdb-devel wxGTK3 wxGTK3-devel
+Prefix: %{_prefix}
+
+%description devel
+If you want to use modules from the DK tools project in your programs,
+you need the libraries from the dktools-lib package and the header
+files provided by this project.
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/*
+%{_libdir}/pkgconfig/dktools.pc
+%{_libdir}/libdk3*.so
+%{_libdir}/libdk4*.so
+
+%changelog
+
+* Tue May 14 2019 Dirk Krause <krause.dirk@web.de> 4.23.0-1
+- Variables to store leightweight class objects returned by c_str().
+- Font feature "script" added, font feature enumeration values changed.
+
+* Tue Apr 16 2019 Dirk Krause <krause.dirk@web.de> 4.22.0-1
+- Configuration default for cosp in the fig2lat program changed to yes.
+- Added some previously internal functions to the API.
+- Functions to calculate 2D and 3D X-spline segment lengths.
+- Option "x-spline sub segments" for dk4gra.conf, "xsss" for language
+ selection. This option specifies the number of Bezier spline segments
+ to draw for each X-spline segment.
+- Parameter "rot" in the text functions in the dk4grpgf and dk4pppt modules
+ to specify the text rotation in degree.
+- Bugfix in dk-lines program to avoid dereferencing NULL pointer.
+- Cleanup, a new directory gui-img with subdirectories was created.
+ The *.ico and *.xpm files were moved from the source code directory
+ into the subdirectories.
+
+* Sat Nov 17 2018 Dirk Krause <krause.dirk@web.de> 4.21.0-1
+- Added complaint to dkct if GUI object has no parent object
+ (is not mentioned as contents of another object).
+- Modified Dk4WxColourView class to show difference between
+ active/inactive state and to place colour chooser over colour view.
+
+* Thu Nov 01 2018 Dirk Krause <krause.dirk@web.de> 4.20.0-1
+- Function $!string added to dkct.
+- Added functions dk4ma_int_from_double() and dk4ma_uint_from_double()
+ to convert double values to int and unsigned.
+
+* Tue Oct 16 2018 Dirk Krause <krause.dirk@web.de> 4.19.1-1
+- Bugfix in Makefile.in for parallel make.
+
+* Sat Oct 13 2018 Dirk Krause <krause.dirk@web.de> 4.19.0-1
+- Functions to calculate greatest common divisor and least common multiple.
+- Function for conversion to smaller integer types.
+- Function to convert UTF-8 encoded strings to wxChar strings.
+- Added event generation to Dk4WxColourView class.
+- Installing printqd and rshdown to /usr/sbin now.
+- File /etc/init.d/printqd to start and stop printqd service.
+
+* Sun Jul 29 2018 Dirk Krause <krause.dirk@web.de> 4.18.1-1
+- Removed misleading warning from dkct shown when a "direction" attribute
+ was assigned to a wxScrollBar.
+
+* Thu Jul 26 2018 Dirk Krause <krause.dirk@web.de> 4.18.0-1
+- Added --no-modification-warning option to dkct.
+ This option suppresses the warning at the beginning of output files
+ advising users to modify the input files processed by dkct instead
+ of the output files produced by the program.
+- Added new modules dk4mai8du8, dk4mai8di8, dk4mai8du16, dk4mai8di16,
+ dk4mai8du32 and dk4mai8di32 to read uint8_t ... int32_t.
+
+* Sat Jul 07 2018 Dirk Krause <krause.dirk@web.de> 4.17.0-1
+- Added options "privacy link" and "privacy page" to htmlbook configuration.
+- Added comments to HTML output of htmlbook.
+- Changed to a faster iteration algorithm in fig2lat and libdk3fig.
+- Added module dk4iter for numeric iterations to libdk4c.
+
+* Sun May 27 2018 Dirk Krause <krause.dirk@web.de> 4.16.0-1
+- Alternative colour chooser added, uses palettes.
+- Dk4WxColourView can be set to be inactive.
+- Former Dk4WxColorView renamed to Dk4WxColourView for consistence,
+ some methods also renamed for consistence.
+- Containers wxChoicebook, wxListbook, wxSimplebook, wxToolbook and
+ wxTreebook now supported by dkct.
+- Attribute text allowed for wxPanel to add panels to book controls.
+- Stock menu items and stock buttons allowed in dkct.
+
+* Sun May 20 2018 Dirk Krause <krause.dirk@web.de> 4.15.0-1
+- Added dk4xsp module for X-spline calculations.
+- Modified configure.ac due to warnings from Debian package building about
+ symbols not found in any library.
+- Added new constants
+ DK4_UINT8_0, DK4_INT8_0, DK4_UINT16_0, DK4_INT16_0, DK4_UINT32_0, DK4_INT32_0
+ to dktypes.h file.
+
+* Sat May 05 2018 Dirk Krause <krause.dirk@web.de> 4.14.1-1
+- Bugfix in Makefile.in and configure.ac, library libdk4ma.a
+ was not mentioned as dependency for libdk4maio8d.a.
+
+* Thu Apr 19 2018 Dirk Krause <krause.dirk@web.de> 4.14.0-1
+- The configure script now checks the presence of the search.h include
+ file and the availability of the qsort() and bsearch() functions.
+- Modified dkrgra, dk4graa and dk4pppt. A flags set was added to text
+ output functions, so we can order a white box and/or an oval box.
+- Modified dk4fpe.h file, it does no longer include compiler pragmas
+ to enable access to the floating point environment.
+ Users might want to apply the pragma to portions of code only
+ and not necessarily to entire source files.
+
+* Sun Apr 15 2018 Dirk Krause <krause.dirk@web.de> 4.13.0-1
+- Added dk4pppt module.
+- Added functions to configure font size and LaTeX preamble lines in
+ dk4gra and dk4graa modules.
+- Added functions to write a char string LaTeX encoded to a stream
+ in the dk4uc2l and dk4uc2la modules.
+- Corrected some error messages in the dk4graa module.
+- Added dk4rec27 module containing the dk4recode_c8_to_dk() function
+ to convert char strings (plain, Win1252, UTF-8) to dkChar strings.
+
+* Thu Apr 12 2018 Dirk Krause <krause.dirk@web.de> 4.12.1-1
+- Changed default for expected encoding when processing standard input
+ or input from file to DK4_FILE_ENCODING_WIN1252 to allow processing
+ of text containing the Euro currency symbol.
+- Renamed some encodings.
+- Release mechanism modified: Presence of the preview.txt file indicates
+ to build not an official release.
+
+* Fri Apr 06 2018 Dirk Krause <krause.dirk@web.de> 4.12.0-1
+- Rewrote bmpp and wxbmpp for library version 4.
+- Modified dk4align.h for separated enum types for text and image
+ alignment.
+- Added dk4mao8dns module to write double values without scientific notation.
+- Packaging changed, packaging script do no longer deal with directories
+ for printqd. Printqd can only be used with the LPRng print system which
+ is not available as package. Users install that software manually
+ deciding about UID and GID to run LPRng at build time.
+ So our package postinstallation and preremoval scripts can not know
+ which UID and GID is used for LPRng.
+
+* Sat Feb 10 2018 Dirk Krause <krause.dirk@web.de> 4.11.4-1
+- The dkct program now checks state machine descriptions for duplicated
+ numeric values for states, inputs and outputs.
+ State, input and output names are checked whether or not they are
+ valid identifiers in the C programming language.
+- State, input, and output definitions are now written as enums by default
+ instead of defines. When using doxygen, this results in a more readable
+ documentation.
+
+* Thu Feb 08 2018 Dirk Krause <krause.dirk@web.de> 4.11.3-1
+- Added new value 7 for co_gu field in computers database of itadmin
+ to indicate that a computer is retired.
+
+* Fri Feb 02 2018 Dirk Krause <krause.dirk@web.de> 4.11.2-1
+- Bugfix, corrected configure.ac and configure to properly detect
+ Debian and derivative systems.
+
+* Sat Jan 27 2018 Dirk Krause <krause.dirk@web.de> 4.11.1-1
+- Bugfix, some XPM files contained named colors instead of hexadecimal values.
+- GUI applications now restoring window position and size.
+
+* Wed Jan 24 2018 Dirk Krause <krause.dirk@web.de> 4.11.0-1
+- Splitted dk4uc2l module into two modules dk4uc2la and dk4uc2l.
+- Appropriate changes to dk-t2l program.
+
diff --git a/support/dktools/dktools-fedora.spec b/support/dktools/dktools-fedora.spec
index 4ba218a0e2..2451c4534d 100644
--- a/support/dktools/dktools-fedora.spec
+++ b/support/dktools/dktools-fedora.spec
@@ -1,37 +1,37 @@
-#
-# If you think the *.spec files need corrections, please send me a
-# complete working *.spec file, not just a bug report.
-# I moved my laptop from Scientific Linux to Debian (they still
-# provide a 32 bit version with recent software), so I do no longer
-# have access to machines I could use to test *.spec files.
+# SPEC file to build Fedora and EL packages.
#
Name: dktools
-Version: 4.8.3
-Source: file:///home/krause/work/dktools-4.8.3.tar.gz
+Version: 4.30.2
+Source: file:///home/krause/work/dktools-4.30.2.tar.gz
Release: 1%{?dist}
Summary: Dirk Krause's tools and libraries
Vendor: Dirk Krause
# Packager: Dirk Krause
Group: Applications/System
License: BSD
-URL: http://dktools.sourceforge.net/index.html
+URL: http://sourceforge.net/p/dktools/wiki/Home/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-BuildRequires: community-mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel wxGTK wxGTK-devel
-Requires: zlib bzip2 openssl mysql-libs libpng libjpeg libtiff net-snmp wxGTK
+BuildRequires: mariadb-devel mariadb-connector-c-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-turbo-devel libtiff-devel net-snmp-devel libdb-devel wxGTK3 wxGTK3-devel systemd
+%{?systemd_requires}
+Requires: zlib bzip2 openssl mariadb-connector-c libpng libjpeg-turbo libtiff net-snmp libdb wxGTK3
Conflicts: dktools-rescue
Prefix: %{_prefix}
# ___PROVIDES___
+# ----- RPMLINT (Fedora Core 27) -----
+# In the lines below the spelling checker finds false positives:
+# wxWidgets htb dk fic bmm blks eradisk recoding sqlsplit mysqldump
+# uid pwgen recv dkdbt octpgfpl.
%description
A set of tools for graphics conversion, text conversion, software
development, administration and printing and some general-purpose tools.
bmpp / wxbmpp Convert PNG/JPEG/TIFF to PS/EPS/PDF
fig2lat Convert FIG to PGF,EPS+TeX,PDF+TeX,EPS,SVG
- wximgsz Suggest good sizes to rescale bitmap images
+ wximgsz Suggest good sizes to scale bitmap images
htmlbook Publish HTML like a book
- dkct / wxdkct Preprocessor for C, C++, Objective-C and Java
+ dkct Preprocessor for C, C++, Objective-C and Java
(debugging/tracing, state machines, wxWidgets GUIs)
dkwxwiz Create project skeleton for wxWidgets+dktools based programs
wxdkhtb Viewer for *.htb help files
@@ -39,10 +39,11 @@ development, administration and printing and some general-purpose tools.
dk-ls ls clone, configurable column order
dk-fic File integrity checker
dk-bmm Backup media manager (10 tape rotation)
- dk-blks Correct data stream blocksize (for use with dd)
+ dk-blks Correct data stream block size (for use with dd)
dk-eradisk Create data stream to erase a disk
dk-hex Show data in hexadecimal or octal notation
dk-cat cat clone, recoding between ASCII/UTF-8/UTF-16
+ dk-lines Select lines by line start pattern or line numbers
dk-sort sort clone, processes ASCII/UTF-8/UTF-16
dk-t2h Text to HTML converter
dk-t2l Text to LaTeX converter
@@ -64,12 +65,51 @@ development, administration and printing and some general-purpose tools.
%build
-%configure --enable-packaging
+%configure --enable-packaging --with-systemd=%{_unitdir}
+echo buildroot %{buildroot}
+echo prefix %{_prefix}
+echo libdir %{_libdir}
+echo unitdir %{_unitdir}
+
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
+echo 'I: chmod 0755' %{buildroot}%{_libdir}/lib*.so.*
+chmod 0755 %{buildroot}%{_libdir}/lib*.so.*
+if [ ! -d "%{buildroot}%{_datadir}/licenses" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses"
+ chmod 755 "%{buildroot}%{_datadir}/licenses"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/licenses/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/licenses/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/licenses/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/licenses/dktools/LICENSE
+if [ ! -d "%{buildroot}%{_datadir}/doc" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc"
+ chmod 755 "%{buildroot}%{_datadir}/doc"
+fi
+if [ ! -d "%{buildroot}%{_datadir}/doc/dktools" ]
+then
+ mkdir -p "%{buildroot}%{_datadir}/doc/dktools"
+ chmod 755 "%{buildroot}%{_datadir}/doc/dktools"
+fi
+echo 'I: Copying bsdlic.txt to LICENSE'
+cp bsdlic.txt %{buildroot}%{_datadir}/doc/dktools/LICENSE
+echo 'I: Copying INSTALL'
+cp INSTALL %{buildroot}%{_datadir}/doc/dktools/INSTALL
+echo 'I: Copying README'
+cp README %{buildroot}%{_datadir}/doc/dktools/README
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/LICENSE
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/INSTALL
+chmod 644 %{buildroot}%{_datadir}/doc/dktools/README
%clean
rm -rf $RPM_BUILD_ROOT
@@ -81,70 +121,24 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/*
%{_libdir}/libdk3*.so.*
%{_libdir}/libdk4*.so.*
+%{_libexecdir}/dktools/*
%{_datadir}/applications/*
%{_datadir}/dktools
%{_datadir}/dk4app
%{_datadir}/man/man1/*
%{_datadir}/man/man5/*
-%{_sysconfdir}/printqd/printqd.conf.sample
-%{_sysconfdir}/rshdown/rshdown.conf.sample
-%config %{_sysconfdir}/dk3app/dk3paper.conf
+%{_datadir}/doc/dktools/*
+%{_datadir}/licenses/dktools/*
+%config(noreplace) %{_sysconfdir}/dk3app/dk3paper.conf
+%config(noreplace) %{_sysconfdir}/dk4app/dk4gra.conf
%post
-# ##### ATTEMPT TO GUESS USER AND GROUP FOR LPRng LPD DAEMON
-#
-LPUSER=`getent passwd | grep '^daemon:' | cut -f 1 -d :`
-if [ "X$LPUSER" = "X" ]
-then
- LPUSER=`getent passwd | grep '^lp:' | cut -f 1 -d :`
-fi
-if [ "X$LPUSER" = "X" ]
-then
- LPUSER="root"
-fi
-LPGROUP=`getent group | grep '^daemon:' | cut -f 1 -d :`
-if [ "X$LPGROUP" = "X" ]
-then
- LPGROUP=`getent group | grep '^lp:' | cut -f 1 -d :`
-fi
-if [ "X$LPGROUP" = "X" ]
-then
- LPGROUP="root"
-fi
-#
-# #####
-#
-#
-#
-# ##### LINUX DISTRIBUTION PACKAGERS
-# ##### If your distribution contains the LPRng software, please
-# ##### uncomment the two lines below and set LPUSER and LPGROUP to
-# ##### the user and group used to run the LPRng lpd daemon on
-# ##### your distribution.
-# ##### Optionally remove the lines above attempting to guess these names.
-#
-# LPUSER="daemon"
-# LPGROUP="daemon"
-#
-# #####
-for i in /var/printqd /var/log/printqd /var/run/printqd
-do
- [ -d $i ] || mkdir -p $i
- chown -R ${LPUSER}:${LPGROUP} $i
- chmod 770 $i
-done
ldconfig
%postun
-if [ "X$1" = "X0" ]
-then
- [ ! -d /var/run/printqd ] || rm -fr /var/run/printqd
- [ ! -d /var/log/printqd ] || rm -fr /var/log/printqd
-fi
ldconfig
-
#
# The rescue sub-package installs only those binaries useful on
# a rescue live system.
@@ -199,475 +193,331 @@ ldconfig
%postun rescue
ldconfig
+%package rshdown
+Summary: Remote shutdown daemon
+Requires: dktools = %{version}-%{release} zlib bzip2
+Prefix: %{_prefix}
+%description rshdown
+Using rshdown you can initiate a remote shutdown.
-
-
-%package devel
-Summary: Development files for libraries from the DK tools project
-Group: Development/Libraries
-Requires: dktools = %{version}-%{release} community-mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc wxGTK wxGTK-devel
-Prefix: %{_prefix}
-
-%description devel
-If you want to use modules from the DK tools project in your programs,
-you need the libraries from the dktools-lib package and the header
-files provided by this project.
-
-%files devel
+%files rshdown
%defattr(-,root,root,-)
-%{_includedir}/*
-%{_libdir}/pkgconfig/dktools.pc
-%{_libdir}/libdk3*.so
-%{_libdir}/libdk4*.so
-
-%changelog
+%{_sbindir}/rshdown
+%{_sbindir}/rshdown-init
+%{_sysconfdir}/rshdown/rshdown.conf.sample
+%{_unitdir}/rshdown.service
+%config(noreplace) %{_sysconfdir}/rshdown/rshdown.conf
-* Tue Mar 28 2017 Dirk Krause <krause.dirk@web.de> 4.8.3-0.0.1
-- Followed improvement suggestions from the CTAN team.
-
-* Fri Mar 24 2017 Dirk Krause <krause.dirk@web.de> 4.8.2-0.0.1
-- Modified bmpp to write a /CropBox in addition to /MediaBox in PDF output.
-
-* Wed Mar 22 2017 Dirk Krause <krause.dirk@web.de> 4.8.1-0.0.1
-- Modified dk-send to stop reading input if all clients disconnected
- unexpectedly.
-
-* Sun Mar 19 2017 Dirk Krause <krause.dirk@web.de> 4.8.0-0.0.1
-- Library libdk4maioxd added (wxChar numbers input and output).
-- Package lshw added to package list for DKtoolian.
-- Configure script and Makefile.in modified to have less warnings from
- Debian package building.
-
-* Fri Feb 03 2017 Dirk Krause <krause.dirk@web.de> 4.7.0-0.0.1
-- "xxxx" can be used as copyright end year in the "copyright year"
- setting in options sections of *.ctr, *.wxc and *.cpt files.
-- New modules dk4paper and dk4papea to read papersizes configuration
- files.
-
-* Sun Dec 11 2016 Dirk Krause <krause.dirk@web.de> 4.6.0-0.0.1
-- New functions in dk4memrs, dk4str8, dk4strw and dk4str to sanitize
- buffers and strings.
-
-* Thu Oct 27 2016 Dirk Krause <krause.dirk@web.de> 4.5.0-0.0.1
-- Added support for meta/description and meta/keywords tags to htmlbook.
-- New modules for arithmetic operations on int16_t, uint16_t, int32_t, uint32_t.
-- New modules to serialize data to stream, unserialize from stream.
-- New module for compressed/encoded output on a dk4_stream_t.
-
-* Wed Sep 07 2016 Dirk Krause <krause.dirk@web.de> 4.4.0-0.0.1
-- Configuration option for itadmin to release lease on shutdown.
-- Markers in dhcpd.conf produced by itadmin for easier post-processing.
-- New module dk4strmw to open a file stream for writing.
-- New module dk4fpe to check for floating point exceptions.
-- New modules to read double from string and write double to string.
-- Mathematical operations on int16_t, int32_t, uint16_t and uint32_t
- including error checking.
-- Inline functions or macros to copy, reset and compare memory buffers.
-- Modules dk4mai8dbl, dk4maiddbl, dk4maiwdbl, dk4mao8dbl, dk4maoddbl
- and dk4maowdbl to read double from string and write double to string.
-- API change in dk4stream_write(): the buffer argument is const now.
-- Optimization in dk4stream_write().
-- Bugfixes in GUI applications: No wxXXX objects must survive OnExit().
-- Bugfixes in the dk4strw module.
-- Bugfixes in checking for mysql.h file.
-- Code cleanup in DkWxBmepsApp.cpt, DkWxImgszApp.cpt and DkWxTraceApp.cpt
- to improve readability.
-
-* Tue Jul 12 2016 Dirk Krause <krause.dirk@web.de> 4.3.6-0.0.1
-- Bugfix for Windows (try multiple sources to get home directory).
-- Replacements for GetVersionEx() function in Windows.
-- Docu update for installation using stow.
-
-* Sat Jul 02 2016 Dirk Krause <krause.dirk@web.de> 4.3.5-0.0.1
-- New hint special command for htmlbook.
-- Scripts to produce live systems.
-
-* Fri Jun 10 2016 Dirk Krause <krause.dirk@web.de> 4.3.4-0.0.1
-- Added span.hint to style.css for htmlbook.
-- Smaller changes related to Debian packaging.
-
-* Sat May 28 2016 Dirk Krause <krause.dirk@web.de> 4.3.3-0.0.1
-- Debian packaging changed, developer package is dktools-lib-$(4.8)-dev.
-- RPM packaging changed, shared library symlinks now in devel package.
-- New script to generate debian/changelog from dktools-el6.spec.in file.
-
-* Fri May 27 2016 Dirk Krause <krause.dirk@web.de> 4.3.2-0.0.1
-- New special command "htmlname" in htmlbook program.
-- Directory structure in build process changed due to lintian complaints.
-- Bugfix in dktools.pc, Libs.private now set correctly.
-- Script itaclean.sh renamed to itaclean (due to lintian complaints).
-
-* Mon Apr 25 2016 Dirk Krause <krause.dirk@web.de> 4.3.1-0.0.1
-- Printqdc now accepts empty input lines.
-
-* Tue Apr 19 2016 Dirk Krause <krause.dirk@web.de> 4.3.0-0.0.1
-- Printqd and related programs rewritten completely.
-- Rshdown is back on a users request, ported to library version 4.
-- Print order character 'N' added to dk-ls (do not show symlink target).
-- Option -b for dk-pwgen on non-Windows systems (create binary random data).
-- New program dk-rand to generate binary random data.
-- Modifications to dk4_app_t and dk3_app_t modules: create log and tmp
- directories only when needed.
-- Modified dk4inst.h header: Compiler constant texts for directories.
-- Module dk4dmt added, tool functions for standing daemons.
-- Modified dk4sock13 module, delete existing UNIX domain sockets.
-- Modified DkWxFrame and Dk4WxFrame, restore position when frame is shown.
-- Bugfix in dkwxwiz data files, typo corrected.
-- Bugfix in dk4dbi module, must set ulen, not size when retrieving data.
-- Retired dk3sock module, all networking programs use library version 4 now.
-
-* Fri Jan 22 2016 Dirk Krause <krause.dirk@web.de> 4.2.2-0.0.1
-- Modified dk-cat, dk-hex, dk-pwgen, dk-t2h, dk-t2l, dk-db2t:
- No error message for SIGPIPE received.
-- Some modifications following suggestions from clang static code analysis.
-
-* Tue Jan 19 2016 Dirk Krause <krause.dirk@web.de> 4.2.1-0.0.1
-- Modifications in Makefile.in and scripts/dkmkproto.pl for SVR4 packaging.
-
-* Mon Jan 18 2016 Dirk Krause <krause.dirk@web.de> 4.2.0-0.0.1
-- Performance fix for dk-send/dk-recv: Use larger buffers.
-- Performance fix for dk-ls: Avoid unnecessary size calculations.
-- Programs dk-t2db, dk-db2t and dk-dbco to replace dkdbt.
-- Libraries dk4dbia and dk4dbi added to replace dk3dbi.
-- Bugfix in dk4loc module, set encoding even if no LANG variable available.
-
-* Mon Dec 14 2015 Dirk Krause <krause.dirk@web.de> 4.1.0-0.0.1
-- Added -s option to dk-ls, show summary at end.
-- Manpage installation avoided, when building on Debian
- (manpage installation on Debian is done by package management).
-- New functions to retrieve and expand strings from Windows registry.
-- Changes in makefiles for Visual Studio for Desktop on Windows.
-- Bugfix in dk4user module: Must expand user profile string from registry.
-- Bugfix in DkClockFrame.wxc: Minimum size specified.
-- Bugfix in DkWxImgszFrame.wxc: Format specifier corrected.
-- Bugfix in DkWxImgszApp.cpt: Load all image handlers wxInitAllImageHandlers()
-
-* Fri Dec 04 2015 Dirk Krause <krause.dirk@web.de> 4.0.10-0.0.1
-- Man pages added, required for Debian packaging.
-- Build process on Windows can now use different library directories.
-- Bugfix in dkdbt program: No longer error messages for comment lines.
-- First release after changing Linux distribution to Debian on my laptop.
-
-* Tue Nov 10 2015 Dirk Krause <krause.dirk@web.de> 4.0.9-0.0.1
-- Bugfix in Makefile.in: Some programs were mentioned twice.
-
-* Sun Nov 08 2015 Dirk Krause <krause.dirk@web.de> 4.0.8-0.0.1
-- Number of duplicated files in source archive reduced by use of hard links.
-
-* Fri Oct 16 2015 Dirk Krause <krause.dirk@web.de> 4.0.7-0.0.1
-- Bugfix in dk4loc module: Use "en" as default language.
-- Bugfix in configure.ac: Install shared libraries for rescue systems too.
-
-* Sat Oct 10 2015 Dirk Krause <krause.dirk@web.de> 4.0.6-0.0.1
-- Added -t option to dk-sort.
-- Only one AC_OUTPUT line in Makefile.in.
-
-* Tue Oct 06 2015 Dirk Krause <krause.dirk@web.de> 4.0.5-0.0.1
-- Help text for dk-recv corrected, host and port are mandatory.
-- Compiler flags for wxcs added in Makefile.in.
-- Removed some dead assignments after static analysis.
-
-* Wed Sep 23 2015 Dirk Krause <krause.dirk@web.de> 4.0.4-0.0.1
-- Makefile.in: Use C++ compiler to drive linker if any C++ module in project.
-- Makefile.in: libdk4wx.a in the LIB_ST_GUI group, not LIB_ST_CLI.
-- dktools.pc.in: Correct variable for version number used now.
-- dk3strkv/dk-sqlsplit: S_ERROR replaced by ST_ERROR.
-- configure.ac: No -Bdynamic -dy -KPIC -D_REENTRANT for static builds.
-- configure.ac: Option --with-corrections for some Solaris systems.
-
-* Tue Aug 11 2015 Dirk Krause <krause.dirk@web.de> 4.0.3-0.0.1
-- Module dk3uc2l rewritten to use the *.t2l files.
-
-* Tue Aug 04 2015 Dirk Krause <krause.dirk@web.de> 4.0.2-0.0.1
-- Setting for tooltip flag added to dkct.
-
-* Tue Aug 04 2015 Dirk Krause <krause.dirk@web.de> 4.0.1-0.0.1
-- dkct: Special placeholders in $? format string.
-- dkct: Option -p added for portable debug output code.
-
-* Tue Aug 04 2015 Dirk Krause <krause.dirk@web.de> 4.0.0-0.0.1
-- New rewritten library modules dk4*.
-- Simplified error reporting from callee to caller via dk4_er_t structure.
-- Reduced use of runtime library on Windows systems.
-- Text stream processing functions recognize BOM at start of data.
-- Multiple dk4sock* modules instead of one large module.
-- wxdkfcs: GUI program to inspect file checksums.
-- dkt: Replaced by multiple smaller programs.
-- dkct: Cell contents for wxGrid in wx gui section.
-
-* Thu Jul 09 2015 Dirk Krause <krause.dirk@web.de> 3.18.10-0.0.1
-- dk-tape: Code simplified.
-
-* Thu Apr 02 2015 Dirk Krause <krause.dirk@web.de> 3.18.9-0.0.1
-- Modified configure script and Makefile for --enable-packaging option.
-
-* Fri Mar 13 2015 Dirk Krause <krause.dirk@web.de> 3.18.8-0.0.1
-- Modified configure script and Makefile.
-
-* Sat Feb 21 2015 Dirk Krause <krause.dirk@web.de> 3.18.7-0.0.1
-- dkct: Bugfix, doxygen allows pure @file lines.
-
-* Wed Jan 28 2015 Dirk Krause <krause.dirk@web.de> 3.18.6-0.0.1
-- Bugfix in plpdftex: smash used only for texts aligned by base line.
-
-* Thu Jan 22 2015 Dirk Krause <krause.dirk@web.de> 3.18.5-0.0.1
-- Bugfix in dkt tape: wrong number printed.
-- Bugfix in plpdftex: smash not for texts in boxes.
-- Modified pjsnmp: Added pjsnmpreadystates configuration option
-- Modified pjsnmp: Message texts modified, distinction errors/warnings.
-
-* Mon Dec 08 2014 Dirk Krause <krause.dirk@web.de> 3.18.4-0.0.1
-- Bugfix in plpdftex: sometimes invalid *.tex output.
-
-* Mon Dec 01 2014 Dirk Krause <krause.dirk@web.de> 3.18.3-0.0.1
-- Bugfix in UTF-16 encoding: Surrogate range was wrong.
-
-* Wed Nov 26 2014 Dirk Krause <krause.dirk@web.de> 3.18.2-0.0.1
-- Modified dkct: No @file line added if @file line is already present.
-- Data type dk3_c32_t changed to unsigned if unsigned is 4 bytes long.
-- Check whether password memory really was reset.
-
-* Tue Oct 21 2014 Dirk Krause <krause.dirk@web.de> 3.18.1-0.0.1
-- Bugfix in multiplication overflow detection in dk3mas/dk3mai/dk3mal modules.
-
-* Thu Oct 16 2014 Dirk Krause <krause.dirk@web.de> 3.18.0-0.0.1
-- Copyright year check in dkct.
-- API bugfix in dk3str32/dk3str16: Use correct character size now.
-- Bugfix in htmlbook for using dkChar.
-- Bugfix in dkdbt for using dkChar.
-- Splitted dk3mastr module into several modules.
-- Most uses of sscanf() and dk3sf_sscanf3() replaced by other functions.
-
-* Wed Sep 24 2014 Dirk Krause <krause.dirk@web.de> 3.17.2-0.0.1
-- Bugfix in dk3sock: WSAEWOULDBLOCK is used for connect in progress.
-
-* Fri Sep 12 2014 Dirk Krause <krause.dirk@web.de> 3.17.1-0.0.1
-- Bugfix in archive creation: Permissions are correct now.
-
-* Wed Sep 03 2014 Dirk Krause <krause.dirk@web.de> 3.17.0-0.0.1
-- Appendices k, M, G for block size added for dkt blks/ dkt ed/dkt rnd.
-- Bugfix in fig2lat: EPS/PDF/PGF output driver, corner radius.
-- Bugfix in wxbmpp dk3paper module.
-- Bugfix in wxbmpp: Fitting to a paper size.
-
-* Thu Aug 07 2014 Dirk Krause <krause.dirk@web.de> 3.16.3-0.0.1
-- Changed build process for Linux/Unix.
-
-* Tue Aug 05 2014 Dirk Krause <krause.dirk@web.de> 3.16.2-0.0.1
-- Changed build process for Linux/Unix, removed options from configure.
-
-* Tue Aug 05 2014 Dirk Krause <krause.dirk@web.de> 3.16.1-0.0.1
-- Use wxFD_OPEN instead of wxOPEN.
-- Bugfix in makefile: CLFAGS was a typo.
-
-* Mon Jul 28 2014 Dirk Krause <krause.dirk@web.de> 3.16.0-0.0.1
-- New program plpdftex added, output driver for octpgfpl.
-- Prefer sigaction() over sigset().
-- Function-like macros replaced by functions.
-- Modified overflow check for conversion from unsigned long to size_t.
-- Modified dk3ma module: Splitted into several smaller modules.
-- Functions dk3strm_double_c8_no_sci()... added.
-- Function dk3pdf_write_double() treats small numbers as 0.
-
-* Sat Jun 28 2014 Dirk Krause <krause.dirk@web.de> 3.15.0-0.0.1
-- Source code reorganized.
-
-* Thu Jun 19 2014 Dirk Krause <krause.dirk@web.de> 3.14.0-0.0.1
-- Options -S... added to dkct and wxdkct.
-- Memory usage reorganized for bit matrices.
-- Cache friendly algorithm for bit matrix expansion.
-- dktools.spec file modified to build sub-packages lib and devel.
-
-* Tue May 27 2014 Dirk Krause <krause.dirk@web.de> 3.13.0-0.0.1
-- Modified htmlbook: Line numbering for source code.
-- Modified dkt html: Line numbering for source code.
-- Added *.desktop files for GUI programs.
-
-* Wed Apr 30 2014 Dirk Krause <krause.dirk@web.de> 3.12.0-0.0.1
-- New application wxdkhtb added to view help text files.
-- Modified htmlbook: enable/disable full text search in *.chm output.
-- Installation bugfix: Forgot to install libdk3wx.so.
-- HTML files for online help now created by htmlbook.
-- API change in DkWxFrame class: Methods added.
-
-* Wed Apr 23 2014 Dirk Krause <krause.dirk@web.de> 3.11.0-0.0.1
-- htmlbook: Writing project.xml file.
-- htmlbook: New option chm full text search.
-- htmlbook: Section number optional before section title in index and pos.
-- htmlbook: Titles for links in keyword index.
-- htmlbook: Bugfix, all *.html files listed in files section.
-- htmlbook: Bugfix, added missing closing OBJECT tag.
-- htmlbook: Bugfix, copy index.hhp, index.hhc and index.hhk to destination.
-- htmlbook: Bugfix, root object now in TOC as first object.
-- printqd: Attempt to remove existing local socket before creating new one.
-- printqd: Bugfix, endless loop.
-- wxdkclock: Save changed options immediately.
-
-* Mon Mar 31 2014 Dirk Krause <krause.dirk@web.de> 3.10.0-0.0.1
-- Modified fig2lat: Fast splines for arrowheads.
-- Modified fig2lat: Configurable base line width.
-
-* Mon Mar 24 2014 Dirk Krause <krause.dirk@web.de> 3.9.0-0.0.1
-- Bugfix in bmpp/wxbmpp: Bits per component analysis rewritten.
-
-* Sun Mar 02 2014 Dirk Krause <krause.dirk@web.de> 3.8.3-0.0.1
-- Bugfix bmpp/wxbmpp: Automatic bits per component analysis disabled.
-- Modified htmlbook: New classes for table cells added to style.css file.
-
-* Thu Feb 06 2014 Dirk Krause <krause.dirk@web.de> 3.8.2-0.0.1
-- Modified htmlbook: New no-vspace option for img special command.
-- Modified htmlbook: Shortcuts for images.
-
-* Wed Jan 29 2014 Dirk Krause <krause.dirk@web.de> 3.8.1.0.0.1
-- Modified htmlbook: Set permissions for destination directory contents.
-- Modified htmlbook: Change in style.css, added top and bottom margin.
-- Bugfix in htmlbook: Crashes on filenames without suffix.
-
-* Tue Jan 21 2014 Dirk Krause <krause.dirk@web.de> 3.8.0-0.0.1
-- New application htmlbook added.
-- Bugfix in dk3enc module: Wrong range delimiter for Unicode characters.
-
-* Fri Nov 29 2013 Dirk Krause <krause.dirk@web.de> 3.7.0-0.0.1
-- Modified dkt latex: Euro currency symbol added to translation table.
-- Modified dkma: long long, unsigned long long, intmax_t, uintmax_t.
-
-* Thu Nov 14 2013 Dirk Krause <krause.dirk@web.de> 3.6.0-0.0.1
-- Modified fig2lat: New cofop option for filled open graphics paths.
-- Bugfix in fig2lat: Must encode some characters.
-- Modified dk3ma: Function and constants names changed for consistent naming.
-
-* Wed Oct 23 2013 Dirk Krause <krause.dirk@web.de> 3.5.0-0.0.1
-- Modified wxbmpp: No automatic start when running on a directory.
-
-* Tue Oct 01 2013 Dirk Krause <krause.dirk@web.de> 3.4.0-0.0.1
-- Modified dkt blocksize: Performance optimizations, use memcpy().
-- Modified dk3sock module: Handle incomplete send requests.
-- Modified dk3str module: Use existing functions if available.
-
-* Fri Sep 20 2013 Dirk Krause <krause.dirk@web.de> 3.3.3-0.0.1
-- Option -s for dkt blocksize added.
-- Modified itadmin: Increased possible length for DHCP options values.
-- Bugfix in itadmin: DHCP options for hosts are written now.
-
-* Tue Jul 30 2013 Dirk Krause <krause.dirk@web.de> 3.3.2-0.0.1
-- Modified dk3sto module: Keyword const added to some functions.
-
-* Mon Jul 29 2013 Dirk Krause <krause.dirk@web.de> 3.3.1-0.0.1
-- Bugfix in distribution and build system.
-
-* Sun Jul 28 2013 Dirk Krause <krause.dirk@web.de> 3.3.0-0.0.1
-- API change, comparison and evaluation functions operate on const * pointers.
-
-* Wed Jul 24 2013 Dirk Krause <krause.dirk@web.de> 3.2.2-0.0.1
-- More useful error message for malformed path to dkt ls on Windows
- (paths in double quotes where backslash escapes closing double quote).
-
-* Thu Mar 20 2013 Dirk Krause <krause.dirk@web.de> 3.0.6-0.0.1
-- dkct enhanced for unknown classes.
-
-* Wed Mar 20 2013 Dirk Krause <krause.dirk@web.de> 3.0.5-0.0.1
-- Bugfix: Use AddButton method of wxStdButtonSizer, not Add.
-
-* Sun Mar 17 2013 Dirk Krause <krause.dirk@web.de> 3.0.4-0.0.1
-- The dk3sock4 module was added.
-
-* Sat Mar 16 2013 Dirk Krause <krause.dirk@web.de> 3.0.3-0.0.1
-- Online documentation updated for the -f option in dknet.
-
-* Thu Mar 14 2013 Dirk Krause <krause.dirk@web.de> 3.0.2-0.0.1
-- The dknet program is more verbose now when run as sender.
-
-* Sun Feb 03 2013 Dirk Krause <krause.dirk@web.de> 3.0.1-0.0.1
-- The dkwxwiz program was added.
-- The winprint program (for Windows) was added.
-- The wprclean program (for Windows) was added.
-- The lprngcl program (for Windows) was added.
-- Option bbts for fig2lat.
-- Bugfix in Win32 setup: The dk3paper.conf file was not installed.
-
-* Thu Jan 31 2013 Dirk Krause <krause.dirk@web.de> 3.0.0-0.0.12
-- Code for 3.0.0 release finished.
-
-* Wed Nov 02 2011 Dirk Krause <krause.dirk@web.de> 2.2.22-0.0.1
-- Bugfix in the configure script: Unnecessary call to wx-config removed.
-
-* Tue Nov 01 2011 Dirk Krause <krause.dirk@web.de> 2.2.21-0.0.1
-- The hostsadm.pl script now adds a netgroup triple containing
- the IP address to the netgroup.ldif file.
-- The "ctrl database-cleanup" operation for prqd now removes
- print accounts and page counts with value 0.
-
-* Sun Jun 06 2011 Dirk Krause <krause.dirk@web.de> 2.2.20-0.0.1
-- Program imgsize renamed to chimgsize to avoid name conflicts
- with perl-Image-Size RPM.
+# RSHDOWN_SCRIPTLETS_START
-* Sun Apr 19 2011 Dirk Krause <krause.dirk@web.de> 2.2.19-0.0.1
-- Bugfix in text2htm, wrong format specification.
+%post rshdown
+%systemd_post rshdown.service
-* Sun Nov 14 2010 Dirk Krause <krause.dirk@web.de> 2.2.18-0.0.1
-- The function dkstr_w_cat() (a fallback implementation for systems without
- the wcscat() function) was added.
-- New programs kwintool and kwindown for Windows.
+%preun rshdown
+%systemd_preun rshdown.service
-* Tue Oct 26 2010 Dirk Krause <krause.dirk@web.de> 2.2.17-0.0.1
-- New option ``create accounts automatically'' for prqd. By default
- we avoid to create personal print accounts automatically to keep
- the database small.
-- Improvements in the GUI of the PrintLimit application.
+%postun rshdown
+%systemd_postun_with_restart rshdown.service
-* Sun Oct 24 2010 Dirk Krause <krause.dirk@web.de> 2.2.16-0.0.1
-- New Java application PrintLimit for users of LPRng/prqd to show
- users print quota information.
-- The dklibsj.html page was improved. Tutorial and short reference added.
+# RSHDOWN_SCRIPTLETS_END
-* Wed Oct 20 2010 Dirk Krause <krause.dirk@web.de> 2.2.15-0.0.1
-- The LANG environment variable is now tested for both ".UTF-8"
- and ".utf8" to indicate the use of UTF-8 encoding.
-* Wed Sep 15 2010 Dirk Krause <krause.dirk@web.de> 2.2.14-0.0.1
-- Documentation update: Notes about differences in the appearance of
- interpolated splines in Xfig/transfig and fig2vect. Recommendations how
- to modify the sources of Xfig and transfig.
+%package printqd
+Summary: Print quota daemon for LPRng
+Requires: dktools = %{version}-%{release} zlib bzip2
+Prefix: %{_prefix}
-* Tue Sep 14 2010 Dirk Krause <krause.dirk@web.de> 2.2.13-0.0.1
-- Corrected typographic errors in the DKrause::Diagram documentation.
+%description printqd
+Printqd is a daemon to enforce print quota for the LPRng print system.
-* Tue Sep 13 2010 Dirk Krause <krause.dirk@web.de> 2.2.12-0.0.1
-- The *.jar files were missing in the Windows executable setup of
- 2.2.11. Here they are back.
+%files printqd
+%defattr(-,root,root,-)
+%{_sbindir}/printqd
+%{_sysconfdir}/printqd/printqd.conf.sample
+%{_unitdir}/printqd.service
+%config(noreplace) %{_sysconfdir}/printqd/printqd.conf
-* Tue Aug 31 2010 Dirk Krause <krause.dirk@web.de> 2.2.11-0.0.1
-- Unnecessary line end correction removed from fig2vect.
-- New Perl module DKrause::Diagram added
+# PRINTQD_SCRIPTLETS_START
-* Tue Jul 20 2010 Dirk Krause <krause.dirk@web.de> 2.2.10-0.0.1
-- Documentation corrections.
+%post printqd
+%systemd_post printqd.service
-* Fri Jul 16 2010 Dirk Krause <krause.dirk@web.de> 2.2.9-0.0.1
-- Bugfix in tracecc, application group name corrected.
+%preun printqd
+%systemd_preun printqd.service
-* Mon Jul 12 2010 Dirk Krause <krause.dirk@web.de> 2.2.8-0.0.1
-- Modifications in configure script for build process on Mac.
+%postun printqd
+%systemd_postun_with_restart printqd.service
-* Sat Jun 26 2010 Dirk Krause <krause.dirk@web.de> 2.2.6-0.0.1
-- Bugfix in bmeps, bits per component reduction disabled.
-- Modifications in HTML documentation due to validation results.
-- New option "doxygen comments" for genau.
-- Script "make-pkg.sh" to build SVR4 packages.
-- Doxygen comments added.
+# PRINTQD_SCRIPTLETS_END
-* Fri Jun 18 2010 Dirk Krause <krause.dirk@web.de> 2.2.5-0.0.1
-- Modified hostsadm: UTF-8 to ISO-LATIN-1 conversion.
-- Code cleanup.
+%package devel
+Summary: Development files for libraries from the DK tools project
+Group: Development/Libraries
+Requires: dktools = %{version}-%{release} mysql-devel zlib-devel bzip2-devel libpng-devel openssl-devel libjpeg-devel libtiff-devel net-snmp-devel gcc libdb-devel wxGTK3 wxGTK3-devel
+Prefix: %{_prefix}
-* Sun Jun 13 2010 Dirk Krause <krause.dirk@web.de> 2.2.4-0.0.1
-- File dktools.spec added.
-- Start scripts for prqd, rshdown, useraud now installed to /etc/init.d.
+%description devel
+If you want to use modules from the DK tools project in your programs,
+you need the libraries from the dktools-lib package and the header
+files provided by this project.
-* Sat Jun 12 2010 Dirk Krause <krause.dirk@web.de> 2.2.3-0.0.1
-- DESTDIR variable added to makefile for RPM builders.
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/dktools-4
+%{_libdir}/pkgconfig/dktools.pc
+%{_libdir}/libdk3*.so
+%{_libdir}/libdk4*.so
-* Thu Jun 03 2010 Dirk Krause <krause.dirk@web.de> 2.2.2-0.0.1
-- Bugfix for preference file location.
+%changelog
+* Tue Sep 15 2020 Dirk Krause <krause.dirk@web.de> 4.30.2-1
+- Added SPDX-License-Identifier tags to many files.
+- Corrected full license terms back to original BSD-3-Clause text.
+
+* Sun Aug 23 2020 Dirk Krause <krause.dirk@web.de> 4.30.1-1
+- Upgrade for dkct, can use SPDX-License-Identifier lines.
+
+* Thu Aug 20 2020 Dirk Krause <krause.dirk@web.de> 4.30.0-1
+- Added the Dk4WxYesNoDialog class to the libdk4wx library because
+ the wxMessageBox from the libwxgtk3.0-0v5 package in Debian 10 does
+ not localize the button texts.
+- Bugfix in wxdkdraw, added menu items to create arcs.
+- Bugfix in the dk4gra module, pattern size for octagons now matches
+ the pattern size for circles.
+- Yes / no dialogs with localized button texts in wxdkdraw.
+
+* Thu Jul 16 2020 Dirk Krause <krause.dirk@web.de> 4.29.3-1
+- Bugfix in wxdkdraw: Line width 0 elements are highlighted as
+ selection/copy/move/delete/grouping candidates now.
+- Modified htmlbook again for flexbox placement of navigation menu lists
+ if the navigation menu is shown below the main content.
+
+* Thu Jul 16 2020 Dirk Krause <krause.dirk@web.de> 4.29.2-1
+- Modified htmlbook so we can create more responsive designs.
+
+* Sat Jun 27 2020 Dirk Krause <krause.dirk@web.de> 4.29.1-1
+- More markers are written by the itadmin program to the dhcpd.conf output.
+- Modified mklivesys.sh script. We can now inject files into the
+ initramfs filesystem of a live system.
+- Removed libreoffice-style-galaxy from package lists for live systems.
+
+* Mon Apr 13 2020 Dirk Krause <krause.dirk@web.de> 4.29.0-1
+- Bugfix in wxdkdraw: Draw control sets focus on itself in mouse enter
+ events and mouse click events when compiled on Windows.
+ I hope to get the mouse wheel working on Windows.
+- Bugfix in wximgsz: The string table in German language was completed.
+- New function dk4uc2l_string_encoded() in dk4uc2l module.
+
+* Thu Mar 26 2020 Dirk Krause <krause.dirk@web.de> 4.28.1-1
+- Bugfix in wxdkdraw: Do no longer show "Modify spline point s value"
+ dialog in move spline point operations.
+
+* Wed Feb 19 2020 Dirk Krause <krause.dirk@web.de> 4.28.0-1
+- New program: wxdkdraw, minimalistic drawing program for use with LaTeX.
+- Wximgsz rewritten for DK libraries 4.
+ Uses spin controls for input instead of standard text fields.
+- Library API change: The enum values DK4WX_AUTOSTART_REACTION_IGNORE and
+ alike were moved into a public enum in the Dk4WxAutostartController class.
+- Library API change: The a and b parameters in the
+ dk4gratool_dist_point_point() function were changed to const, the a, b and
+ p parameters in dk4gratool_dist_point_track() too.
+- Library API change: The new dk4bb_add_bb() function in the dk4bb module
+ allows to create a bounding box for a drawing from the object bounding
+ boxes.
+
+* Wed Nov 27 2019 Dirk Krause <krause.dirk@web.de> 4.27.0-1
+- Distinction between K and k in size specifications (K=1024, k=1000),
+ M/m, G/g, T/t, P/p, E/e, Z/z, Y/y (powers of 1024, powers of 1000).
+- Bugfix in build process, size of wxChar calculated in configure script.
+- Bugfix in dkwxwiz, corrected name of XPM source.
+
+* Fri Oct 18 2019 Dirk Krause <krause.dirk@web.de> 4.26.0-1
+- Install header files into the includedir/dktools-4 directory.
+- Daemons rshdown and printqd are systemd compatible now.
+- Module dk4dmt modified for systemd compatibility.
+- PID files now in /run/... when systemd is used, /var/run/... otherwise.
+- Build scripts check for systemd use and install systemd service unit files
+ when systemd in use, traditional start scripts otherwise.
+- Build scripts modified for MinGW-w64 build and later probably cross-builds.
+- Program pjsnmp is now installed into libexec directory.
+- Packaging for RPM and DEB packages changed, separated packages for
+ printqd and rshdown.
+- New module dk4bm for bit matrices.
+- New module dk4bml to levelize graphs represented by bit matrices.
+- Bugfix in the dk4apref module: Parameter pv is const, but the buffer
+ was modified.
+- Bugfix in dk4sock25 and dk4sock31 modules: FreeAddrInfo() replaced
+ by FreeAddrInfoW(). This bug was not relevant when using MSVC to build
+ Windows binaries as the FreeAddrInfo() macro is mapped to the
+ FreeAddrInfoW() function when using makefile.vc.
+- Modification in the dk4mem module: Fallback functions only compiled
+ if needed.
+
+* Thu Sep 26 2019 Dirk Krause <krause.dirk@web.de> 4.25.0-1
+- Bugfix in the dk-cat program. The program attempted to issue a byte order
+ marker depending on the systems default encoding instead of the used
+ output encoding.
+- Module dk4itmin added to search for a local minimum of an unimodal
+ function in an interval.
+
+* Thu Aug 15 2019 Dirk Krause <krause.dirk@web.de> 4.24.2-1
+- Bugfix in the dkwt/dkwtadm program. The program did not properly inform
+ all windows about environment modifications.
+
+* Sun Aug 04 2019 Dirk Krause <krause.dirk@web.de> 4.24.1-1
+- Added dk-bin2c program to convert binary data to C source code
+ (array of unsigned char literals).
+- Added markdown documentation for live systems.
+- Classes Dk4Comparable and Dk4Container modified for C++11/C++17.
+
+* Sun Jul 14 2019 Dirk Krause <krause.dirk@web.de> 4.24.0-1
+- Modifications to follow the "Updating to the latest version of wxWidgets"
+ document.
+
+* Sun Jun 16 2019 Dirk Krause <krause.dirk@web.de> 4.23.0-1
+- Bugfix in 32 bit Linux/Unix build process, 64 bit file size support
+ was inactive on 32 bit Linux/Unix in previous versions.
+- Variables to store leightweight class objects returned by c_str().
+- Font feature "script" added, font feature enumeration values changed.
+
+* Tue Apr 16 2019 Dirk Krause <krause.dirk@web.de> 4.22.0-1
+- Configuration default for cosp in the fig2lat program changed to yes.
+- Added some previously internal functions to the API.
+- Functions to calculate 2D and 3D X-spline segment lengths.
+- Option "x-spline sub segments" for dk4gra.conf, "xsss" for language
+ selection. This option specifies the number of Bezier spline segments
+ to draw for each X-spline segment.
+- Parameter "rot" in the text functions in the dk4grpgf and dk4pppt modules
+ to specify the text rotation in degree.
+- Bugfix in dk-lines program to avoid dereferencing NULL pointer.
+- Cleanup, a new directory gui-img with subdirectories was created.
+ The *.ico and *.xpm files were moved from the source code directory
+ into the subdirectories.
+
+* Sat Nov 17 2018 Dirk Krause <krause.dirk@web.de> 4.21.0-1
+- Added complaint to dkct if GUI object has no parent object
+ (is not mentioned as contents of another object).
+- Modified Dk4WxColourView class to show difference between
+ active/inactive state and to place colour chooser over colour view.
+
+* Thu Nov 01 2018 Dirk Krause <krause.dirk@web.de> 4.20.0-1
+- Function $!string added to dkct.
+- Added functions dk4ma_int_from_double() and dk4ma_uint_from_double()
+ to convert double values to int and unsigned.
+
+* Tue Oct 16 2018 Dirk Krause <krause.dirk@web.de> 4.19.1-1
+- Bugfix in Makefile.in for parallel make.
+
+* Sat Oct 13 2018 Dirk Krause <krause.dirk@web.de> 4.19.0-1
+- Functions to calculate greatest common divisor and least common multiple.
+- Function for conversion to smaller integer types.
+- Function to convert UTF-8 encoded strings to wxChar strings.
+- Added event generation to Dk4WxColourView class.
+- Installing printqd and rshdown to /usr/sbin now.
+- File /etc/init.d/printqd to start and stop printqd service.
+
+* Sun Jul 29 2018 Dirk Krause <krause.dirk@web.de> 4.18.1-1
+- Removed misleading warning from dkct shown when a "direction" attribute
+ was assigned to a wxScrollBar.
+
+* Thu Jul 26 2018 Dirk Krause <krause.dirk@web.de> 4.18.0-1
+- Added --no-modification-warning option to dkct.
+ This option suppresses the warning at the beginning of output files
+ advising users to modify the input files processed by dkct instead
+ of the output files produced by the program.
+- Added new modules dk4mai8du8, dk4mai8di8, dk4mai8du16, dk4mai8di16,
+ dk4mai8du32 and dk4mai8di32 to read uint8_t ... int32_t.
+
+* Sat Jul 07 2018 Dirk Krause <krause.dirk@web.de> 4.17.0-1
+- Added options "privacy link" and "privacy page" to htmlbook configuration.
+- Added comments to HTML output of htmlbook.
+- Changed to a faster iteration algorithm in fig2lat and libdk3fig.
+- Added module dk4iter for numeric iterations to libdk4c.
+
+* Sun May 27 2018 Dirk Krause <krause.dirk@web.de> 4.16.0-1
+- Alternative colour chooser added, uses palettes.
+- Dk4WxColourView can be set to be inactive.
+- Former Dk4WxColorView renamed to Dk4WxColourView for consistence,
+ some methods also renamed for consistence.
+- Containers wxChoicebook, wxListbook, wxSimplebook, wxToolbook and
+ wxTreebook now supported by dkct.
+- Attribute text allowed for wxPanel to add panels to book controls.
+- Stock menu items and stock buttons allowed in dkct.
+
+* Sun May 20 2018 Dirk Krause <krause.dirk@web.de> 4.15.0-1
+- Added dk4xsp module for X-spline calculations.
+- Modified configure.ac due to warnings from Debian package building about
+ symbols not found in any library.
+- Added new constants
+ DK4_UINT8_0, DK4_INT8_0, DK4_UINT16_0, DK4_INT16_0, DK4_UINT32_0, DK4_INT32_0
+ to dktypes.h file.
+
+* Sat May 05 2018 Dirk Krause <krause.dirk@web.de> 4.14.1-1
+- Bugfix in Makefile.in and configure.ac, library libdk4ma.a
+ was not mentioned as dependency for libdk4maio8d.a.
+
+* Thu Apr 19 2018 Dirk Krause <krause.dirk@web.de> 4.14.0-1
+- The configure script now checks the presence of the search.h include
+ file and the availability of the qsort() and bsearch() functions.
+- Modified dkrgra, dk4graa and dk4pppt. A flags set was added to text
+ output functions, so we can order a white box and/or an oval box.
+- Modified dk4fpe.h file, it does no longer include compiler pragmas
+ to enable access to the floating point environment.
+ Users might want to apply the pragma to portions of code only
+ and not necessarily to entire source files.
+
+* Sun Apr 15 2018 Dirk Krause <krause.dirk@web.de> 4.13.0-1
+- Added dk4pppt module.
+- Added functions to configure font size and LaTeX preamble lines in
+ dk4gra and dk4graa modules.
+- Added functions to write a char string LaTeX encoded to a stream
+ in the dk4uc2l and dk4uc2la modules.
+- Corrected some error messages in the dk4graa module.
+- Added dk4rec27 module containing the dk4recode_c8_to_dk() function
+ to convert char strings (plain, Win1252, UTF-8) to dkChar strings.
+
+* Thu Apr 12 2018 Dirk Krause <krause.dirk@web.de> 4.12.1-1
+- Changed default for expected encoding when processing standard input
+ or input from file to DK4_FILE_ENCODING_WIN1252 to allow processing
+ of text containing the Euro currency symbol.
+- Renamed some encodings.
+- Release mechanism modified: Presence of the preview.txt file indicates
+ to build not an official release.
+
+* Fri Apr 06 2018 Dirk Krause <krause.dirk@web.de> 4.12.0-1
+- Rewrote bmpp and wxbmpp for library version 4.
+- Modified dk4align.h for separated enum types for text and image
+ alignment.
+- Added dk4mao8dns module to write double values without scientific notation.
+- Packaging changed, packaging script do no longer deal with directories
+ for printqd. Printqd can only be used with the LPRng print system which
+ is not available as package. Users install that software manually
+ deciding about UID and GID to run LPRng at build time.
+ So our package postinstallation and preremoval scripts can not know
+ which UID and GID is used for LPRng.
+
+* Sat Feb 10 2018 Dirk Krause <krause.dirk@web.de> 4.11.4-1
+- The dkct program now checks state machine descriptions for duplicated
+ numeric values for states, inputs and outputs.
+ State, input and output names are checked whether or not they are
+ valid identifiers in the C programming language.
+- State, input, and output definitions are now written as enums by default
+ instead of defines. When using doxygen, this results in a more readable
+ documentation.
+
+* Thu Feb 08 2018 Dirk Krause <krause.dirk@web.de> 4.11.3-1
+- Added new value 7 for co_gu field in computers database of itadmin
+ to indicate that a computer is retired.
+
+* Fri Feb 02 2018 Dirk Krause <krause.dirk@web.de> 4.11.2-1
+- Bugfix, corrected configure.ac and configure to properly detect
+ Debian and derivative systems.
+
+* Sat Jan 27 2018 Dirk Krause <krause.dirk@web.de> 4.11.1-1
+- Bugfix, some XPM files contained named colors instead of hexadecimal values.
+- GUI applications now restoring window position and size.
+
+* Wed Jan 24 2018 Dirk Krause <krause.dirk@web.de> 4.11.0-1
+- Splitted dk4uc2l module into two modules dk4uc2la and dk4uc2l.
+- Appropriate changes to dk-t2l program.
diff --git a/support/dktools/dktools.pc.in b/support/dktools/dktools.pc.in
index 4366c90d1d..65f38d3dae 100644
--- a/support/dktools/dktools.pc.in
+++ b/support/dktools/dktools.pc.in
@@ -1,12 +1,13 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-
Name: dktools
Description: Dirk Krause's tools and libraries
Version: @VERSNO@
Requires: zlib libpng
-Libs: -L${libdir} -ldk3fig -ldk3bmeps -ldk3bif -ldk3csrnd -ldk3dbi -ldk3net -ldk3of -ldk3c -ldk4lat -ldk4mdrnd -ldk4socka -ldk4dbia -ldk4app -ldk4sock -ldk4dbi -ldk4c -ldk4ma -ldk4maiowd -ldk4maiodd -ldk4maiowh -ldk4maiowd -ldk4maio8h -ldk4maio8d -ldk4base
+Libs: -L${libdir} -ldk4wx -ldk4maioxd -ldk4graa -ldk4bifa -ldk4dbia -ldk4lata -ldk4socka -ldk4app -ldk4pppt -ldk4gra -ldk4bif -ldk4dbi -ldk4lat -ldk4mdrnd -ldk4sock -ldk4c -ldk4maiodd -ldk4maiodh -ldk4maiowd -ldk4maiowh -ldk4maio8d -ldk4maio8h -ldk4ma -ldk4base -ldk3trace
Libs.private: @LIBSPRIVATE@ -lm
-Cflags: -I${includedir} @WXCPPFLAGS@
+Cflags: -I${includedir}/dktools-4 -I${includedir} @WXCPPFLAGS@
diff --git a/support/dktools/dktools/charmap/currency-europe.t2l b/support/dktools/dktools/charmap/currency-europe.t2l
index a1be35dbde..49469f564e 100644
--- a/support/dktools/dktools/charmap/currency-europe.t2l
+++ b/support/dktools/dktools/charmap/currency-europe.t2l
@@ -1 +1,4 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
20AC t=\euro{} p=eurosym
diff --git a/support/dktools/dktools/charmap/dingbats.t2l b/support/dktools/dktools/charmap/dingbats.t2l
index 4112d73e18..7c676c8f50 100644
--- a/support/dktools/dktools/charmap/dingbats.t2l
+++ b/support/dktools/dktools/charmap/dingbats.t2l
@@ -1,3 +1,6 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
2701 t=\ding{33} p=pifont
2702 t=\ding{34} p=pifont
2703 t=\ding{35} p=pifont
diff --git a/support/dktools/dktools/charmap/iso-latin-1.t2l b/support/dktools/dktools/charmap/iso-latin-1.t2l
index 0150a5b289..0b9a01c65f 100644
--- a/support/dktools/dktools/charmap/iso-latin-1.t2l
+++ b/support/dktools/dktools/charmap/iso-latin-1.t2l
@@ -1,3 +1,6 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
00 t=\keystroke{NUL} p=keystroke
01 t=\SOH{} p=ascii
02 t=\STX{} p=ascii
@@ -84,7 +87,7 @@
9F t=\keystroke{APC} p=keystroke
A0 t=\NBSP{} p=ascii
A1 b=!' t=\textexclamdown{}
-A2 b=\textcent{} p=textcomp
+A2 b=\textcentoldstyle{} p=textcomp
A3 b=\pounds{}
A4 t=\textcurrency{} p=textcomp
A5 t=\textyen{} p=textcomp
@@ -114,74 +117,67 @@ BC t=\textonequarter{} p=textcomp
BD t=\textonehalf{} p=textcomp
BE t=\textthreequarters{} p=textcomp
BF t=\textquestiondown{}
-C0 b=\`{A}
-C1 b=\'{A}
-C2 b=\^{A}
-C3 b=\~{A}
-C4 b=\"{A}
-C5 b=\AA{}
-C6 b=\AE{}
-C7 b=\c{C}
-C8 b=\`{E}
-C9 b=\'{E}
-CA b=\^{E}
-CB b=\"{E}
-CC b=\`{I}
-CD b=\'{I}
-CE b=\^{I}
-CF b=\"{I}
+C0 t=\`{A}
+C1 t=\'{A}
+C2 t=\^{A}
+C3 t=\~{A}
+C4 t=\"{A}
+C5 t=\AA{}
+C6 t=\AE{}
+C7 t=\c{C}
+C8 t=\`{E}
+C9 t=\'{E}
+CA t=\^{E}
+CB t=\"{E}
+CC t=\`{I}
+CD t=\'{I}
+CE t=\^{I}
+CF t=\"{I}
D0 b=\DH{} e=!ot1
-D1 b=\~{N}
-D2 b=\`{O}
-D3 b=\'{O}
-D4 b=\^{O}
-D5 b=\~{O}
-D6 b=\"{O}
+D1 t=\~{N}
+D2 t=\`{O}
+D3 t=\'{O}
+D4 t=\^{O}
+D5 t=\~{O}
+D6 t=\"{O}
D7 t=\texttimes{} m=\times{} p=textcomp
D8 b=\O{}
-D9 b=\`{U}
-DA b=\'{U}
-DB b=\^{U}
-DC b=\"{U}
-DD b=\'{Y}
+D9 t=\`{U}
+DA t=\'{U}
+DB t=\^{U}
+DC t=\"{U}
+DD t=\'{Y}
DE b=\TH{} e=!ot1
DF b=\ss{}
-E0 b=\`{a}
-E1 b=\'{a}
-E2 b=\^{a}
-E3 b=\~{a}
-E4 b=\"{a}
+E0 t=\`{a}
+E1 t=\'{a}
+E2 t=\^{a}
+E3 t=\~{a}
+E4 t=\"{a}
E5 b=\aa{}
E6 b=\ae{}
E7 b=\c{c}
-E8 b=\`{e}
-E9 b=\'{e}
-EA b=\^{e}
-EB b=\"{e}
-EC b=\`{i}
-ED b=\'{i}
-EE b=\^{i}
-EF b=\"{i}
+E8 t=\`{e}
+E9 t=\'{e}
+EA t=\^{e}
+EB t=\"{e}
+EC t=\`{\i}
+ED t=\'{\i}
+EE t=\^{\i}
+EF t=\"{\i}
F0 b=\dh{} e=!ot1
-F1 b=\~{n}
-F2 b=\`{o}
-F3 b=\'{o}
-F4 b=\^{o}
-F5 b=\~{o}
-F6 b=\"{o}
+F1 t=\~{n}
+F2 t=\`{o}
+F3 t=\'{o}
+F4 t=\^{o}
+F5 t=\~{o}
+F6 t=\"{o}
F7 t=\textdiv{} m=\div{} p=textcomp
F8 b=\o{}
-F9 b=\`{u}
-FA b=\'{u}
-FB b=\^{u}
-FC b=\"{u}
-FD b=\'{y}
+F9 t=\`{u}
+FA t=\'{u}
+FB t=\^{u}
+FC t=\"{u}
+FD t=\'{y}
FE b=\th{} e=!ot1
-FF b=\"{y}
-FB00 t=ff
-FB01 t=fi
-FB02 t=fl
-FB03 t=ffi
-FB04 t=ffl
-FB05 t=ft
-FB06 t=st
+FF t=\"{y}
diff --git a/support/dktools/dktools/charmap/latin-extended-a.t2l b/support/dktools/dktools/charmap/latin-extended-a.t2l
index cd26a1a71d..830e4d2ee0 100644
--- a/support/dktools/dktools/charmap/latin-extended-a.t2l
+++ b/support/dktools/dktools/charmap/latin-extended-a.t2l
@@ -1,3 +1,6 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
0100 t=\={A}
0101 t=\={a}
0102 t=\u{A}
@@ -45,7 +48,7 @@
012C t=\u{I}
012D t=\u{\i}
012E t=\k{I} e=!ot1
-012F t=\k{i} e=!ot1
+012F t=\k{\i} e=!ot1
0130 t=\.{I}
0131 t=\i{}
0132 t=IJ
diff --git a/support/dktools/dktools/charmap/latin-extended-additional.t2l b/support/dktools/dktools/charmap/latin-extended-additional.t2l
new file mode 100644
index 0000000000..8c01b4cd2e
--- /dev/null
+++ b/support/dktools/dktools/charmap/latin-extended-additional.t2l
@@ -0,0 +1,259 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+1E00 t=\textsubring{A} p=tipa
+1E01 t=\textsubring{a} p=tipa
+1E02 t=\.{B}
+1E03 t=\.{b}
+1E04 t=\d{B}
+1E05 t=\d{b}
+1E06 t=\b{B}
+1E07 t=\b{b}
+1E08 t=\'{\c{C}}
+1E09 t=\'{\c{c}}
+1E0A t=\.{D}
+1E0B t=\.{d}
+1E0C t=\d{D}
+1E0D t=\d{d}
+1E0E t=\b{D}
+1E0F t=\b{d}
+1E10 t=\c{D}
+1E11 t=\c{d}
+1E12 t=\textsubcircum{D} p=tipa
+1E13 t=\textsubcircum{d} p=tipa
+1E14 t=\`{\={E}}
+1E15 t=\`{\={e}}
+1E16 t=\textacutemacron{E} p=tipa
+1E17 t=\textacutemacron{e} p=tipa
+1E18 t=\textsubcircum{E} p=tipa
+1E19 t=\textsubcircum{e} p=tipa
+1E1A t=\textsubtilde{E} p=tipa
+1E1B t=\textsubtilde{e} p=tipa
+1E1C t=\u{\c{E}} p=tipa
+1E1D t=\u{\c{e}} p=tipa
+1E1E t=\.{F}
+1E1F t=\.{f}
+1E20 t=\={G}
+1E21 t=\={g}
+1E22 t=\.{H}
+1E23 t=\.{h}
+1E24 t=\d{H}
+1E25 t=\d{h}
+1E26 t=\"{H}
+1E27 t=\"{h}
+1E28 t=\c{H}
+1E29 t=\c{h}
+1E2A t=\underarc{H} p=arcs
+1E2B t=\underarc{h} p=arcs
+1E2C t=\textsubtilde{I} p=tipa
+1E2D t=\textsubtilde{i} p=tipa
+1E2E t=\'{\"{I}}
+1E2F t=\'{\"{i}}
+1E30 t=\'{K}
+1E31 t=\'{k}
+1E32 t=\d{K}
+1E33 t=\d{k}
+1E34 t=\b{K}
+1E35 t=\b{k}
+1E36 t=\d{L}
+1E37 t=\d{l}
+1E38 t=\={\d{L}}
+1E39 t=\={\d{l}}
+1E3A t=\b{L}
+1E3B t=\b{l}
+1E3C t=\textsubcircum{L} p=tipa
+1E3D t=\textsubcircum{l} p=tipa
+1E3E t=\'{M}
+1E3F t=\'{m}
+1E40 t=\.{M}
+1E41 t=\.{m}
+1E42 t=\d{M}
+1E43 t=\d{m}
+1E44 t=\.{N}
+1E45 t=\.{n}
+1E46 t=\d{N}
+1E47 t=\d{n}
+1E48 t=\b{N}
+1E49 t=\b{n}
+1E4A t=\textsubcircum{N} p=tipa
+1E4B t=\textsubcircum{n} p=tipa
+1E4C t=\'{\*{O}}
+1E4D t=\'{\*{o}}
+1E4E t=\"{\~{O}}
+1E4F t=\"{\~{o}}
+1E50 t=\`{\={O}}
+1E51 t=\`{\={o}}
+1E52 t=\'{\={O}}
+1E53 t=\'{\={o}}
+1E54 t=\'{P}
+1E55 t=\'{p}
+1E56 t=\.{P}
+1E57 t=\.{p}
+1E58 t=\.{R}
+1E59 t=\.{r}
+1E5A t=\d{R}
+1E5B t=\d{r}
+1E5C t=\d{\={R}}
+1E5D t=\d{\={r}}
+1E5E t=\b{R}
+1E5F t=\b{r}
+1E60 t=\.{S}
+1E61 t=\.{s}
+1E62 t=\d{S}
+1E63 t=\d{s}
+1E64 t=\.{\'{S}}
+1E65 t=\.{\'{s}}
+1E66 t=\.{\v{S}}
+1E67 t=\.{\v{s}}
+1E68 t=\.{\d{S}}
+1E69 t=\.{\d{s}}
+1E6A t=\.{T}
+1E6B t=\.{t}
+1E6C t=\d{T}
+1E6D t=\d{t}
+1E6E t=\b{T}
+1E6F t=\b{t}
+1E70 t=\textsubcircum{T} p=tipa
+1E71 t=\textsubcircum{t} p=tipa
+1E72 t=\textsubumlaut{U} p=tipa
+1E73 t=\textsubumlaut{u} p=tipa
+1E74 t=\textsubtilde{U} p=tipa
+1E75 t=\textsubtilde{u} p=tipa
+1E76 t=\textsubcircum{U} p=tipa
+1E77 t=\textsubcircum{u} p=tipa
+1E78 t=\'{\~{U}}
+1E79 t=\'{\~{u}}
+1E7A t=\"{\={U}}
+1E7B t=\"{\={u}}
+1E7C t=\~{V}
+1E7D t=\~{v}
+1E7E t=\d{V}
+1E7F t=\d{v}
+1E80 t=\`{W}
+1E81 t=\`{w}
+1E82 t=\'{W}
+1E83 t=\'{w}
+1E84 t=\"{W}
+1E85 t=\"{w}
+1E86 t=\.{W}
+1E87 t=\.{w}
+1E88 t=\d{W}
+1E89 t=\d{w}
+1E8A t=\.{X}
+1E8B t=\.{x}
+1E8C t=\"{X}
+1E8D t=\"{x}
+1E8E t=\.{Y}
+1E8F t=\.{y}
+1E90 t=\^{Z}
+1E91 t=\^{z}
+1E92 t=\d{Z}
+1E93 t=\d{z}
+1E94 t=\b{Z}
+1E95 t=\b{z}
+1E96 t=\b{h}
+1E97 t=\"{t}
+1E98 t=\r{w}
+1E99 t=\r{y}
+# 1E9A missing: latin small letter a with right half ring
+# 1E9B missing: latin small letter long s with dot above
+# 1E9C missing: latin small letter long s with diagonal stroke
+# 1E9D missing: latin small letter long s with high stroke
+# 1E9E missing: latin capital letter sharp s
+1E9F t=\textdelta p=textgreek
+1EA0 t=\d{A}
+1EA1 t=\d{a}
+1EA2 t=\h{A} p=vntex e=t5
+1EA3 t=\h{a} p=vntex e=t5
+1EA4 t=\textcircumacute{A} p=tipa
+1EA5 t=\textcircumacute{a} p=tipa
+1EA6 t=\textgravecircum{A} p=tipa
+1EA7 t=\textgravecircum{a} p=tipa
+1EA8 t=\'{\^{A}}
+1EA9 t=\'{\^{a}}
+1EAA t=\*{\^{A}}
+1EAB t=\*{\^{a}}
+1EAC t=\^{\d{A}}
+1EAD t=\^{\d{a}}
+1EAE t=\'{\u{A}}
+1EAF t=\'{\u{a}}
+1EB0 t=\`{\u{A}}
+1EB1 t=\`{\u{a}}
+1EB2 t=\h{\u{A}}
+1EB3 t=\h{\u{a}}
+1EB4 t=\~{\u{A}}
+1EB5 t=\~{\u{a}}
+1EB6 t=\u{\d{A}}
+1EB7 t=\u{\d{a}}
+1EB8 t=\d{E}
+1EB9 t=\d{e}
+1EBA t=\h{E}
+1EBB t=\h{e}
+1EBC t=\~{E}
+1EBD t=\~{e}
+1EBE t=\textcircumacute{E} p=tipa
+1EBF t=\textcircumacute{e} p=tipa
+1EC0 t=\textcircumacute{E} p=tipa
+1EC1 t=\textcircumacute{e} p=tipa
+1EC2 t=\'{\^{E}}
+1EC3 t=\'{\^{e}}
+1EC4 t=\~{\^{E}}
+1EC5 t=\~{\^{e}}
+1EC6 t=\^{\d{E}}
+1EC7 t=\^{\d{e}}
+1EC8 t=\h{I}
+1EC9 t=\h{\i}
+1ECA t=\d{I}
+1ECB t=\d{i}
+1ECC t=\d{O}
+1ECD t=\d{o}
+1ECE t=\h{O}
+1ECF t=\h{o}
+1ED0 t=\textcircumacute{O} p=tipa
+1ED1 t=\textcircumacute{o} p=tipa
+1ED2 t=\textgravecircum{O} p=tipa
+1ED3 t=\textgravecircum{o} p=tipa
+1ED4 t=\h{\^{O}}
+1ED5 t=\h{\^{o}}
+1ED6 t=\~{\^{O}}
+1ED7 t=\~{\^{o}}
+1ED8 t=\^{\d{O}}
+1ED9 t=\^{\d{o}}
+1EDA t=\'{\OHORN} p=vntex e=t5
+1EDB t=\'{\ohorn} p=vntex e=t5
+1EDC t=\`{\OHORN} p=vntex e=t5
+1EDD t=\`{\ohorn} p=vntex e=t5
+1EDE t=\h{\OHORN} p=vntex e=t5
+1EDF t=\h{\ohorn} p=vntex e=t5
+1EE0 t=\~{\OHORN} p=vntex e=t5
+1EE1 t=\~{\ohorn} p=vntex e=t5
+1EE2 t=\d{\OHORN} p=vntex e=t5
+1EE3 t=\d{\ohorn} p=vntex e=t5
+1EE4 t=\d{U}
+1EE5 t=\d{u}
+1EE6 t=\h{U}
+1EE7 t=\h{u}
+1EE8 t=\'{\UHORN} p=vntex e=t5
+1EE9 t=\'{\uhorn} p=vntex e=t5
+1EEA t=\`{\UHORN} p=vntex e=t5
+1EEB t=\`{\uhorn} p=vntex e=t5
+1EEC t=\h{\UHORN} p=vntex e=t5
+1EED t=\h{\uhorn} p=vntex e=t5
+1EEE t=\~{\UHORN} p=vntex e=t5
+1EEF t=\~{\uhorn} p=vntex e=t5
+1EF0 t=\d{\UHORN} p=vntex e=t5
+1EF1 t=\d{\uhorn} p=vntex e=t5
+1EF2 t=\`{Y}
+1EF3 t=\`{y}
+1EF4 t=\d{Y}
+1EF5 t=\d{y}
+1EF6 t=\h{Y}
+1EF7 t=\h{y}
+1EF8 t=\~{Y}
+1EF9 t=\~{y}
+# 1EFA missing: latin capital letter middle-welsh ll
+# 1EFB missing: latin small letter middle-welsh ll
+# 1EFC missing: latin capital letter middle-welsh v
+# 1EFD missing: latin small letter middle-welsh v
+# 1EFE missing: latin capital letter y with loop
+# 1EFF missing: latin small letter y with loop
diff --git a/support/dktools/dktools/charmap/latin-extended-b-phonetic-historic.t2l b/support/dktools/dktools/charmap/latin-extended-b-phonetic-historic.t2l
new file mode 100644
index 0000000000..833c3eff56
--- /dev/null
+++ b/support/dktools/dktools/charmap/latin-extended-b-phonetic-historic.t2l
@@ -0,0 +1,73 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+01DD t=\M{e} e=t4 p=fc
+01DE t=\={\"{A}}
+01DF t=\={\"{a}}
+01E0 t=\={\.{A}}
+01E1 t=\={\.{a}}
+01E2 t=\={\AE{}}
+01E3 t=\={\ae{}}
+# 01E4 missing latin capital letter G with stroke
+# 01E5 missing latin small letter g with stroke
+01E6 t=\v{G}
+01E7 t=\v{g}
+01E8 t=\v{K}
+01E9 t=\v{k}
+01EA t=\k{O} p=ogonek
+01EB t=\k{o} p=ogonek
+01EC t=\={\k{O}} p=ogonek
+01ED t=\={\k{o}} p=ogonek
+# 01EE ... 01F3 missing
+01F4 t=\'{G}
+01F5 t=\'{g}
+# 01F6 ... 01F7 mssing
+01F8 t=\`{N}
+01F9 t=\`{n}
+01FA t=\'{\r{A}}
+01FB t=\'{\r{a}}
+01FC t=\'{\AE{}}
+01FD t=\'{\ae{}}
+01FE t=\'{\O{}}
+01FF t=\'{\o{}}
+0200 t=\G{A} p=fc
+0201 t=\G{a} p=fc
+0202 t=\textroundcap{A} p=tipa
+0203 t=\textroundcap{a} p=tipa
+0204 t=\G{E] p=fc
+0205 t=\G{e} p=fc
+0206 t=\textroundcap{E} p=tipa
+0207 t=\textroundcap{e} p=tipa
+0208 t=\G{I} p=fc
+0209 t=\G{\i} p=fc
+020A t=\textroundcap{I} p=tipa
+020B t=\textroundcap{\i} p=tipa
+020C t=\G{O} p=fc
+020D t=\G{o} p=fc
+020E t=\textroundcap{O} p=tipa
+020F t=\textroundcap{o} p=tipa
+0210 t=\G{R} p=fc
+0211 t=\G{r} p=fc
+0212 t=\textroundcap{R} p=tipa
+0213 t=\textroundcap{r} p=tipa
+0214 t=\G{U} p=fc
+0215 t=\G{u} p=fc
+0216 t=\textroundcap{U} p=tipa
+0217 t=\textroundcap{u} p=tipa
+# 0218 ... 0225 missing
+0226 t=\.{A}
+0227 t=\.{a}
+0228 t=\c{E}
+0229 t=\c{e}
+022A t=\={\"{O}}
+022B t=\={\"{o}}
+022C t=\={\*{O}}
+022D t=\={\*{o}}
+022E t=\.{O}
+022F t=\.{o}
+0230 t=\={\.{O}}
+0231 t=\={\.{o}}
+0232 t=\={Y}
+0233 t=\={y}
+# 0234 ... 024F missing
+
diff --git a/support/dktools/dktools/charmap/latin-extended-b-pinyin-diacritic-vowel.t2l b/support/dktools/dktools/charmap/latin-extended-b-pinyin-diacritic-vowel.t2l
new file mode 100644
index 0000000000..b87fd6afed
--- /dev/null
+++ b/support/dktools/dktools/charmap/latin-extended-b-pinyin-diacritic-vowel.t2l
@@ -0,0 +1,19 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+01CD t=\v{A}
+01CE t=\v{a}
+01CF t=\v{I}
+01D0 t=\v{\i}
+01D1 t=\v{O}
+01D2 t=\v{o}
+01D3 t=\v{U}
+01D4 t=\v{u}
+01D5 t=\={\"{U}}
+01D6 t=\={\"{u}}
+01D7 t=\'{\"{U}}
+01D8 t=\'{\"{u}}
+01D9 t=\v{\"{U}}
+01DA t=\v{\"{u}}
+01DB t=\`{\"{U}}
+01DC t=\`{\"{u}}
diff --git a/support/dktools/dktools/charmap/latin-extended-b-vietnamese.t2l b/support/dktools/dktools/charmap/latin-extended-b-vietnamese.t2l
new file mode 100644
index 0000000000..02560e6911
--- /dev/null
+++ b/support/dktools/dktools/charmap/latin-extended-b-vietnamese.t2l
@@ -0,0 +1,8 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+01A0 t=\OHORN e=t5 p=vntex
+01A1 t=\ohorn e=t5 p=vntex
+01AF t=\UHORN e=t5 p=vntex
+01B0 t=\uhorn e=t5 p=vntex
+
diff --git a/support/dktools/dktools/charmap/ligatures.t2l b/support/dktools/dktools/charmap/ligatures.t2l
new file mode 100644
index 0000000000..cd978435f3
--- /dev/null
+++ b/support/dktools/dktools/charmap/ligatures.t2l
@@ -0,0 +1,10 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+FB00 t=ff
+FB01 t=fi
+FB02 t=fl
+FB03 t=ffi
+FB04 t=ffl
+FB05 t=ft
+FB06 t=st
diff --git a/support/dktools/dktools/charmap/nicefrac.t2l b/support/dktools/dktools/charmap/nicefrac.t2l
new file mode 100644
index 0000000000..8caef79607
--- /dev/null
+++ b/support/dktools/dktools/charmap/nicefrac.t2l
@@ -0,0 +1,25 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+2100 m=\nicefrac{a}{c} p=nicefrac
+2101 m=\nicefrac{a}{s} p=nicefrac
+2105 m=\nicefrac{c}{o} p=nicefrac
+2106 m=\nicefrac{c}{u} p=nicefrac
+214D m=\nicefrac{A}{S} p=nicefrac
+2150 m=\nicefrac{1}{7} p=nicefrac
+2151 m=\nicefrac{1}{9} p=nicefrac
+2152 m=\nicefrac{1}{10} p=nicefrac
+2153 m=\nicefrac{1}{3} p=nicefrac
+2154 m=\nicefrac{2}{3} p=nicefrac
+2155 m=\nicefrac{1}{5} p=nicefrac
+2156 m=\nicefrac{2}{5} p=nicefrac
+2157 m=\nicefrac{3}{5} p=nicefrac
+2158 m=\nicefrac{4}{5} p=nicefrac
+2159 m=\nicefrac{1}{6} p=nicefrac
+215A m=\nicefrac{5}{6} p=nicefrac
+215B m=\nicefrac{1}{8} p=nicefrac
+215C m=\nicefrac{3}{8} p=nicefrac
+215D m=\nicefrac{5}{8} p=nicefrac
+215E m=\nicefrac{7}{8} p=nicefrac
+215F m=\nicefrac{1}{} p=nicefrac
+2189 m=\nicefrac{0}{3} p=nicefrac
diff --git a/support/dktools/dktools/charmap/textsym.t2l b/support/dktools/dktools/charmap/textsym.t2l
index 5d6932cfa9..4a5279f11f 100644
--- a/support/dktools/dktools/charmap/textsym.t2l
+++ b/support/dktools/dktools/charmap/textsym.t2l
@@ -1,3 +1,6 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
2013 t=\textendash{}
2014 t=\textemdash{}
2020 b=\dag{}
diff --git a/support/dktools/dktools/de/bmpp.str b/support/dktools/dktools/de/bmpp.str
new file mode 100644
index 0000000000..3160f5c577
--- /dev/null
+++ b/support/dktools/dktools/de/bmpp.str
@@ -0,0 +1,97 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0-1 Signal handler installation
+#
+Installation der Signal-Handler fehlgeschlagen!
+Wiederherstellung der Signal-Handler fehlgeschlagen!
+#
+# 2 ERROR: The bmpp program can not produce TeX output!
+#
+Bmpp kann keine TeX-Ausgabe erstellen!
+#
+# 3 ERROR: Illegal paper size
+#
+Papiergrößen-Angabe nicht nutzbar!
+#
+# 4 ERROR: Failed to read NetPBM image from standard input!
+#
+NetPBM-Image konnte nicht von Standardeingabe gelesen werden!
+#
+# 5
+#
+Name für Ausgabedatei konnte nicht erstellt werden!\n\tEingabename zu lang!
+#
+# 6
+#
+Voller Pfadname konnte nicht erstellt werden!\n\tVerzeichnis- oder Dateiname zu lang!
+#
+# 7
+#
+Keine reguläre Datei!
+#
+# 8
+#
+Keine passende Datei gefunden!
+#
+# 9
+#
+Ausgabedaten werden erstellt.
+#
+# 10
+#
+Ausgabedaten wurden erstellt.
+#
+# 11
+#
+Ausgabedatei wird geschrieben.
+#
+# 12
+#
+Ausgabedatei wurde geschrieben.
+#
+# 13
+#
+Standardeingabe wird verarbeitet.
+#
+# 14
+#
+Standardeingabe wurde verarbeitet.
+#
+# 15
+#
+NetPBM-Bild wird von Standardeingabe gelesen.
+#
+# 16
+#
+NetPBM-Bild wurde von Standardeingabe gelesen.
+#
+# 17-18
+#
+Ausgabe wird in Standardausgabe geschrieben.
+Ausgabe wurde in Standardausgabe geschrieben.
+#
+# 19-20
+#
+Eingabedatei wird gelesen.
+Eingabedatei wurde gelesen.
+#
+# 21-22
+#
+Datei wird vearbeitet.
+Datei wurde verarbeitet.
+#
+# 23-24
+#
+Verzeichnis wird verarbeitet.
+Verzeichnis wurde vearbeitet.
+#
+# 25-26
+#
+Keine verwendbare Eingabedatei: "
+".
+#
+# 27-28
+#
+Dateinamensmuster wird verarbeitet.
+Dateinamensmuster wurde verarbeitet.
diff --git a/support/dktools/dktools/de/bmpp.txt b/support/dktools/dktools/de/bmpp.txt
index 46947df211..8b9843fa62 100644
--- a/support/dktools/dktools/de/bmpp.txt
+++ b/support/dktools/dktools/de/bmpp.txt
@@ -1,193 +1,596 @@
-BEZEICHNUNG
+NAME
- bmpp - Bitmap to PS/PDF converter
+ bmpp - Konvertiere Bitmaps zu PDF/PS
ÃœBERSICHT
- bmpp [-l<Treiber>[.<Mode>][,<Name>[=<Wert>]...]] [<Option(en)>] <Datei(en)>
+ bmpp [-l<Treiber>[.<Modus>][,<Name>[=<Wert>]...]] [<Option(en)>] <Datei(en)>
BESCHREIBUNG
-Das Programm wandelt Bitmap-Dateien in den Formaten PNG, JPEG und TIFF nach
-PS/EPS und PDF um.
+Das Programm wandelt Bitmap-Dateien in den Formaten PNG, JPEG, TIFF und
+NetPBM nach PDF und PS/EPS um.
-Treiber:
-- ps
- Druckdatei zur Ausgabe auf PostScript-Druckern
-- eps
- Encapsulated PostScript (EPS), Bild kan in Dokument eingebunden werden.
-- pdf
+Für jede auf der Kommandozeile angegebene Eingabedatei wird eine
+korrespondierende Ausgabedatei mit der Endung ".pdf", ".eps", ".ps"
+bzw. ".bb" angelegt.
+
+Wird ein Verzeichnisname angegeben, wird das Verzeichnis durchsucht.
+Für alle gefundenen Dateien, die bmpp verarbeiten kann, wird eine
+Konvertierung durchgeführt.
+Im make-Betrieb werden dabei nur die Dateien konvertiert, für die noch keine
+aktuelle Ausgabedatei vorliegt.
+
+Der Treiber muss passend zum gewünschten Dateityp gewählt werden,
+der erzeugt werden soll:
+
+* pdf
Portable document format (PDF).
-- bb
- Bounding box, Angabe zu Bildgrenzen ohne Bildinhalt.
-
-Ausgabemodi:
-- Objekt (object)
- Datei, die in einer Textverarbeitung oder in einem Graphikprogramm in eine
- andere Datei eingebunden wird (ein Beispiel hierfür sind Dateien, die von
- LaTeX-Dokumenten referenziert werden).
-- Bild (image)
- Bild, das für sich allein stehend betrachtet wird.
-- Dokument (document)
- Bildgröße wird für Ausdruck auf ein bestimmtes Papierformat angepasst.
+
+* eps
+ Encapsulated PostScript (EPS), Bild kann in Dokument eingebunden werden.
+
+* ps
+ Druckdatei zur Ausgabe auf PostScript-Druckern
+
+* bb
+ Bounding box, Angabe zu Bildabmessungen ohne Bildinhalt.
+ Derartige Dateien werden von LaTeX benötigt, um Platz für das
+ Bild zu reservieren.
+
+Der Ausgabemodus gibt an, für welchen Verwendungszweck die Ausgabe
+erzeugt bzw. optimiert werden soll:
+
+* object
+ Objekt. Datei, die in einer Textverarbeitung oder in einem Graphikprogramm
+ in eine andere Datei eingebunden wird (ein Beispiel hierfür sind Dateien,
+ die von LaTeX-Dokumenten referenziert werden).
+
+* image
+ Bild, das für sich allein stehend betrachtet oder verarbeitet wird.
+
+* document
+ Dokument, die Bildgröße wird für den Ausdruck auf ein bestimmtes Papierformat
+ angepasst.
+
OPTIONEN
--h
+-l <Treiber>[.<Modus>][,<Name>[=<Wert>]...]
+--language=<Treiber>[.<Modus>][,<Name>[=<Wert>]...]
+ legt den Ausgabetreiber und den Modus fest. Darüber hinaus
+ können mit Name=Wert-Paaren weitere Einstellungen vorgenommen
+ werden. Siehe Abschnitt "Name-Wert-Paare" unten.
+
+-m
+--make
+ schaltet den make-Betrieb für die Bearbeitung von Verzeichnissen ein.
+ Wird ein Verzeichnis bearbeitet, wird normalerweise jede Datei
+ verarbeitet, die bmpp verarbeiten kann. Im make-Betrieb werden nur
+ die Dateien verarbeitet, für die noch keine aktuelle Ausgabedatei
+ existiert.
+
+-R
+--reset
+ setzt das Programm auf die eingebauten Standardeinstellungen zurück,
+ d.h. die Konfigurationsdateien dk4gra.conf werden ignoriert.
+
--help
- Hilfetext zeigen.
+ zeigt einen kurzen Hilfetext an.
+
+--manual
+ zeigt diesen ausführlichen Hilfetext an.
--v
--version
- Versionsnummer zeigen.
+ zeigt die Versionsnummer an.
--L
---license-terms
- Lizenzbedingungen zeigen.
+--license
+ zeigt die Lizenzbedingungen an, sowohl für bmpp als auch für die
+ benutzten Bibliotheken.
--l <Treiber>[.<Mode>]
- Treiber und Ausgabemodus.
- Es stehen die Treiber "ps", "eps", "pdf" und "bb" zur Verfügung
- sowie die Ausgabemodi "object", "image" und "document".
--t <Typ>
- Eingabe-Datei-Typ ("png", "jpeg" oder "tiff"), falls die
- Standardeingabe verarbeitet wird oder der Typ nicht aus der Endung des
- Dateinamens ermittelt werden kann.
+NAME=WERT-PAARE
--m
- Make mode: unnötige Konvertierungen vermeiden, wenn Ausgabedatei
- bereits aktuell ist. Nur beim Verarbeiten eines Verzeichnisses aktiv.
+Mit Paaren Name=Wert können detaillierte Einstellungen festgelegt werden.
+
+Für die Paare vom Typ Boolean genügt die Nennung des Namens, um die Option
+zu aktivieren. Die Option "-lps.document,duplex" hat die gleiche Auswirkung wie
+die Option "-lps.document,duplex=on". Für Boolean-Werte können "on", "true"
+oder "yes" zum aktivieren benutzt werden, zum deaktivieren "off", "false"
+oder "no".
+
+Folgende Einstellungen sind möglich:
+
+level=Ganzzahl
+ PS language level, 2 oder 3.
+ Voreinstellung: 3.
+
+dsc=Boolean
+ DSC-Kommentare (document structuring comments) in die PS/EPS-Ausgabe
+ schreiben.
+ Voreinstellung: aus.
+
+lzw=Boolean
+ LZW-Komprimierung beim Einbetten von Bitmap-Bildern in
+ PS-Language-Level 2 erlauben.
+ Voreinstellung: aus.
+
+color=Boolean
+ Farbige Ausgabe erlauben. Voreinstellung: ein.
+ Wird diese Option deaktiviert, erfolgt die Ausgabe in Graustufen.
+
+rgb-to-gray=String
+ Methode für die Umwandlung von RGB-Farbangaben nach Grau festlegen.
+ Voreinstellung: bt601.
+ Siehe Abschnitt "Farbraum-Umwandlungen" weiter unten.
+
+rgb-to-cmyk=String
+ Methode für die Umwandlung von RGB-Farbangaben nach CMYK festlegen.
+ Voreinstellung: non-standard.
+ Das Programm bmpp nimmt keine Farbraum-Umwandlungen von RGB nach
+ CMYK vor, dies ist auch auf absehbare Zeit nicht vorgesehen.
+ Die Option wird hier nur vollständigkeitshalber erwähnt, weil die
+ benutzte Bibliothek libdk4gra diese Option unterstützt.
+
+alpha=String
+ Methode für die Verwendung des Alpha-Kanals festlegen, entweder
+ "mix" oder "foreground". Voreinstellung: mix.
+ Siehe Abschnitt "Alpha-Kanal" weiter unten.
+
+bg=Ganzzahl:Ganzzahl:Ganzzahl[:Boolean]
+ Standard-Hintergrundfarbe festlegen, die Zahlen sind RGB-Farbwerte
+ im Bereich 0...255. Voreinstellung: 255:255:255.
+ Optional kann festgelegt werden, ob diese Hintergrundfarbe
+ forciert wird, also auch dann zu verwenden ist, wenn in der Bilddatei
+ eine Hintergrundfarbe angegeben ist. Empfohlen wird jedoch, stattdessen
+ die Option "force-bg" zu verwenden.
+
+force-bg=Boolean
+ Die Angabe zum Forcieren der Hintergrundfarbe kann auch separat
+ erfolgen.
+ Voreinstellung: aus.
+
+interpolation=Boolean
+ Interpolationsflag setzen. Ist dieses Flag gesetzt, dürfen
+ PDF/PS-Anzeigeprogramme versuchen, die Darstellung des entsprechenden
+ Bildes zu optimieren.
+ Voreinstellung: ein.
+
+dct=Boolean
+ Direkte Wiederverwendung von DCT-codierten Daten aus JPEG-Dateien
+ erlauben. Dies erspart das Decodieren und erneute Codieren der
+ Daten, geht somit schneller und erzeugt kleinere Ausgabedateien.
+ Voreinstellung: ein.
+
+dct-interpolation=Boolean
+ Interpolationsflag auch für Bilder mit direkt wiederverwendeten
+ Daten aus JPEG-Dateien setzen.
+ Voreinstellung: aus.
+
+a-bpc=Boolean
+ Anzahl der Bits pro Farbkomponente analysieren und - falls verlustfrei
+ möglich - reduzieren.
+ Voreinstellung: ein.
+
+a-color=Boolean
+ Verwendung von Farben analysieren und Ausgabe in Graustufen
+ veranlassen, falls alle Pixel grau sind.
+ Voreinstellung: ein.
+
+a-alpha=Boolean
+ Alpha-Kanal analysieren und die Ausgabe von SMask-Daten in
+ PDF-Objekte unterbinden, falls alle Pixel vollständig deckend
+ sind.
+ Voreinstellung: ein.
+
+paper=String
+ Papierformat für die Ausgabe von Dokumenten wählen.
+ Das Papierformat muss in einer Datei dk3paper.conf bzw.
+ dk4paper.conf definiert sein.
+ Voreinstellung: a4.
+
+duplex=Boolean
+ PS-Ausgabe von Dokumenten für Duplex-Druck (Bedrucken von Vorder-
+ und Rückseite mit Bindung links wie bei einem Buch) vorbereiten.
+ Voreinstellung: ein.
+
+tumble=Boolean
+ PS-Ausgabe von Dokumenten für Duplex-Tumble-Druck (Bedrucken von
+ Vorder- und Rückseite mit Bindung oben wie bei einem Kalender)
+ vorbereiten.
+ Voreinstellung: aus.
+
+resolution=Auflösung
+ Angabe, wie die Auflösung des Bildes verarbeitet werden soll,
+ folgende Möglichkeiten bestehen:
+ - chunk
+ Die Angaben zur Auflösung werden der Bilddatei entnommen,
+ falls vorhanden.
+ Dies ist die Voreinstellung.
+ Enthält das Bild keine Angaben zur Auflösung, wird 1px1pt verwendet.
+ - 1px1pt
+ Jeder Pixel wird in der Ausgabe als ein Quadrat mit einer Seitenlänge
+ von 1 PS-Point dargestellt. Evtl. in der Bilddatei enthaltene
+ Angaben zur Auflösung werden ignoriert.
+ - <Zahl>
+ Die angegebene Gleitkommazahl wird als Auflösung in dpi
+ (dots per inch, Pixel pro Zoll) sowohl für die x- als auch
+ für die y-Richtung verwendet.
+ - <Zahl>:<Zahl>
+ Die erste Zahl gibt die Auflösung in x-Richtung an, die zweite
+ in y-Richtung.
+ Zur Verwendung empfohlen werden die Varianten <Zahl> und
+ <Zahl>:<Zahl>. Die Varianten "chunk" und "1px1pt" sind nur zur
+ Abwärtskompatibilität vorhanden. Chunk ist ohnehin Standard, anstelle
+ von "resolution=1px1pt" sollte besser "i-res=on" verwendet werden.
+
+i-res=Boolean
+ Daten zur Bildauflösung ignorieren. Die Bildbreite und -höhe in
+ der Ausgabe in PS point ergibt sich aus der Pixelanzahl für
+ Breite und Höhe des Originalbildes.
+ Dies entspricht "resolution=1px1pt".
+ Voreinstellung: aus.
+
+i-aspect=Boolean
+ Seitenverhältnis des Bildes ignorieren.
+ Wird beim Erzeugen eines Dokumentes ein Bild in einen bestimmten
+ Bereich der Seite eingebunden, wird der gesamte verfügbare Bereich
+ voll ausgenutzt. Dabei wird eine Verzerrung des Bildes durch ungleiche
+ Skalierung in x- und y-Richtung in Kauf genommen.
+ Voreinstellung: aus.
+
+rotate=Boolean
+ Drehung des Bildes um 90 Grad erlauben, falls es beim Erstellen
+ eines Dokumentes dadurch besser in den nutzbaren Seitenbereich passt.
+ Voreinstellung: aus.
+ Diese Einstellung bewirkt nicht für alle Bilder eine Drehung,
+ sondern erlaubt eine Drehung für die Bilder, für die es sinnvoll ist.
+
+
+ALPHA-KANAL
+
+PNG/TIFF/NetPBM-Bilder können einen Alpha-Kanal enthalten. Der Alpha-Wert
+eines Pixels gibt die Deckungskraft des Pixels von 0=duchsichtig bis
+Maximalwert=deckend an.
+Bei der Ausgabe in PDF-Dateien wird der Alpha-Kanal in ein entsprechendes
+SMask-Objekt umgewandelt und in die PDF-Datei geschrieben.
+Für die PS/EPS-Ausgabe muss für jeden Pixel ein Farbwert ermittelt werden,
+dies kann auf zweierlei Weise geschehen:
+(1) Mischen der Vordergrundfarbe aus den Pixel-Werten der Datei gegen eine
+ Hintergrundfarbe entsprechend der Deckungskraft laut Alpha-Wert.
+ Dies ist Voreinstellung bzw. wird mit "alpha=mix" eingestellt.
+(2) Es wird einfach die Vordergrundfarbe verwendet.
+ Dies wird mit "alpha=foreground" eingestellt.
+Die Hintergrundfarbe kann als Datensatz mit in der Bilddatei
+enthalten sein, standardmäßig wird diese Hintergrundfarbe verwendet.
+
+Für Bilder ohne Angabe einer Hintergrundfarbe kann mit der Option
+"bg=..." eine Standard-Hintergrundfarbe angegeben werden.
+Optional kann mit "force-bg=on" festgelegt werden, dass die mit "bg=..."
+angegebene Hintergrundfarbe auch dann verwendet wird, wenn in der
+Bilddatei eine Hintergrundfarbe angegeben ist.
+
+Wird ein PDF-Dokument erzeugt, wird jede Seite zunächst komplett
+weiß gefüllt, bevor das Bild aufgetragen wird.
+
+Wird ein PDF-Image für ein Bild mit Transparenz erzeugt, wird zunächst
+die vom Bild belegte Fläche mit der Hintergrundfarbe gefüllt.
+
+Wird ein PDF-Objekt für ein Bild mit Transparenz erzeugt, findet kein
+Füllen mit Hintergrundfarbe statt. Ein PDF-Objekt kann von einem
+Zeichen- oder Textsatz-Programm über andere Objekte platziert werden,
+diese scheinen dann ganz oder teilweise durch das Bild hindurch.
+
+
+KOMPRIMIERUNG
+
+Für die PDF-Ausgabe und für PS Level 3 wird die Flate-Komprimierung
+verwendet.
+
+Für PS Level 2 wird Run-Length-Komprimierung mit getrennten Farbkanälen
+verwendet, falls die pro Farbkanal erforderliche Byte-Anzahl pro Bildzeile
+16384 Bytes nicht übersteigt. Für Bilder mit längeren Zeilen wird keine
+Komprimierung vorgenommen.
+Alternativ dazu kann die LZW-Komprimierung aktiviert werden.
+
+Getrennte Farbkanäle bedeutet, dass der Datenstrom zuerst alle Rot-Werte
+einer Bildzeile enthält, dann alle Grün-Werte, abschließend alle Blau-Werte.
+Ohne getrennte Farbkanäle würde eine horizontale rote Linie im Datenstrom
+"255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 ..." enthalten, hier wäre keine
+Run-Length-Komprimierung möglich. Mit getrennten Farbkanälen enthält
+der Rot-Kanal "255 255 255 255 255 ..." und die Grün- und Blau-Kanäle
+"0 0 0 0 0 ...", was eine Run-Length-Komprimierung ermöglicht.
+
+Das Ergebnis der Komprimierung wird direkt binär in die PDF-Ausgabe eingebettet.
+Für die PS/EPS-Ausgabe wird eine Codierung mit ASCII-85-Encoding vorgenommen,
+damit eine reine Text-Datei entsteht.
+
+
+BILD-ANALYSE
--s
- Ausgabe in Standardausgabe, nicht in Datei.
+Drei verschiedene Analysen können dazu beitragen, die Größe der Ausgabedatei
+zu verringern:
--o <Name>[=<Wert>]
- Weitere Einstellungen.
+* Bitbreite
+ Lässt sich die Bitbreite für alle Komponenten aller Pixel ohne
+ Qualitätsverlust reduzieren, so wird diese Reduktion vorgenommen.
-NAME=WERT-PAARE
+* Farbe
+ Ist der Farbraum (color space) einer Bilddatei RGB oder CMYK, so wird
+ geprüft, ob für alle Pixel R=G=B bzw. C=M=Y gilt. Ist dies der Fall,
+ wird für die Ausgabe der Graustufen-Farbraum verwendet.
+
+* Alpha
+ Gibt für alle Pixel der Alpha-Wert volle Deckungskraft für das Pixel
+ an, wird kein SMask-Objekt in die PDF-Ausgabe geschrieben.
+
+
+FARBRAUM-UMWANDLUNGEN
+
+In den nachfolgenden Formeln werden folgende Größen benutzt:
+
+MAX Maximalwert für eine bestimmte Bitbreite (z.B. 15 für 4 Bits,
+ 255 für 8 Bits)
+R ganzzahlige Rot-Komponente im Bereich 0 ... MAX
+G ganzzahlige Grün-Komponente im Bereich 0 ... MAX
+B ganzzahlige Blau-Komponente im Bereich 0 ... MAX
+E ganzzahliger Grauwert im Bereich 0 ... MAX
+
+Eine theoretisch so einfache Aufgabe wie das Umwandeln von RGB-Daten in
+Graustufen bietet mehrere Möglichkeiten.
+
+bt601
+ Luminanz (Leuchtkraft) wird beibehalten:
+
+ E = (299 * R + 587 * G + 114 * B) / 1000
+
+luminance
+ Selbes Verfahren mit kürzeren Koeffizienten:
+
+ E = (30 * R + 59 * G + 11 * B) / 100
+
+fast
+ Schnelleres Verfahren für ganzzahlige Werte ohne Verwendung
+ einer Division:
+
+ E = (77 * R + 151 * G + 28 * B) >> 8
+
+fastest
+ Noch schnelleres und noch ungenaueres Verfahren für ganzzahlige Werte,
+ ohne Verwendung von Multiplikation und Division:
+
+ E = ((R << 1) + (G << 2) + G + B) >> 3
+
+bt709
+ Beibehaltung der Luminanz, hier mit anderen Koeffizienten:
+
+ E = (2126 * R + 7152 * G + 722 * B) / 1000
+
+average
+ Durchschnittsbildung:
+
+ E = (R + G + B) / 3
+
+desaturation
+ Entsättigung, ergibt flacheres Bild als Luminanz mit weniger Kontrast:
+
+ E = (max{R,G,B} + min{R,G,B}) / 2
+
+min
+ Minimum-Dekomposition, es wird der Minimalwert aller drei
+ Farben verwendet:
+
+ E = min{R,G,B}
+
+median
+ Median-Dekomposition, es wird der Median-Wert aller drei
+ Farben verwendet:
+
+ E = median{R,G,B}
+
+max
+ Maximum-Dekomposition, es wird der Maximalwert aller drei
+ Farben verwendet:
+
+ E = max{R,G,B}
+
+red
+ Der Rot-Wert wird verwendet:
+
+ E = R
+
+green
+ Der Grün-Wert wird verwendet:
+
+ E = G
+
+blue
+ Der Blau-Wert wird verwendet:
+
+ E = B
+
+
+BILDGRÖSSE, AUFLÖSUNG UND DREHUNG
+
+Sind Angaben zur Auflösung vorhanden, wird die reale Bildgröße in PS-Point
+ermittelt, indem die Pixelanzahl mit 72 multipliziert und dann durch die
+Auflösung dividiert wird, anschließend wird zur nächsten ganzen Zahl
+aufgerundet.
+Die Auflösung kann dabei der Bilddatei entnommen werden, falls vorhanden
+(resolution=chunk, Voreinstellung) oder durch den Nutzer vorgegeben werden
+(resolution=<Zahl> bzw. resolution=<Zahl>:<Zahl>).
+
+Gibt der Nutzer vor, die Auflösung zu ignorieren (i-res=true bzw.
+resolution=1px1pt) oder enthält die Bilddatei
+keine Angaben zur Auflösung, wird jeder Pixel in ein Quadrat mit der
+Seitenlänge von einem PS-Point abgebildet. Dies entspricht einer Auflösung
+von 72 dpi. Die Anzahl der PS-Points für Breite und Höhe des erzeugten
+Bildes ist dabei gleich der jeweils entsprechenden Pixelanzahl der
+Bilddatei.
+
+Einige Bilddateien - z.B. TIFF-Bilder von Fax-Gateways - können
+unterschiedliche Auflösungen in x- und y-Richtung enthalten.
+Werden hier die Angaben zur Auflösung ignoriert bzw. wird eine gleiche
+Auflösung für x- und y-Richtung erzwungen, wird das Bild verzerrt dargestellt.
+
+Soll ein Bild in einen bestimmten nutzbaren Seitenbereich eingepasst werden,
+gibt es zwei Möglichkeiten für den Umgang mit dem Seitenverhältnis:
+(1) Das Seitenverhältnis wird beibehalten (Voreinstellung), dabei bleibt ein
+ Teil des nutzbaren Seitenbereiches frei oder
+(2) das Seitenverhältnis wird ignoriert (i-aspect=on), der nutzbare
+ Seitenbereich voll ausgenutzt, obwohl dies zu einer verzerrten Darstellung
+ führt.
+
+Unter bestimmten Umständen - z.B. wenn das Bild mehr breit als hoch,
+das Paper aber mehr hoch als breit ist - ist es sinnvoll, das Bild um
+90 Grad zu drehen, damit der nutzbare Bereich besser ausgenutzt wird.
+Die Option "rotate=on" erteilt hierzu die Erlaubnis.
-Mit diesen Optionen werden weitere Einstellungen getroffen. Bei boolschen
-Einstellungen kann der Wert entfallen, das Aufzählen des Namens setzt die
-Einstellung auf aktiv.
-Folgende Namen (und Werte) stehen zur Verfügung:
-
-level=<PS-Level>
- PS-Sprachlevel, 2 oder 3. Standard: 3.
-
-color[=<Boolean>]
- Farbige PS/EPS-Ausgabe erlauben. Standard: An.
- Hinweis: Wenn DCT-codierte Daten aus JPEG-Dateien direkt verarbeitet
- werden, wird diese Einstellung ignoriert.
-
-dsc[=<Boolean>]
- Schreiben von DSC-Kommentaren (document
- structuring conventions) in PS- oder EPS-Ausgabe erlauben oder
- verbieten. Standard: Aus für Objekte und Images, ein für Dokumente.
-
-draft[=<Boolean>]
- Entwurfs-Mode aktivieren/deaktivieren, dabei wird nur eine kleine
- Platzhalter-Graphik erstellt.
-
-predictor=<Predictor>
- Predictor für die flate-Komprimierung, entweder "tiff",
- "sub", "up", "average" oder "paeth". Standard: Keiner.
-
-duplex[=<Boolean>]
- Ausgabe für zweiseitigen Ausdruck (Vorder- und Rückseite)
- vorbereiten. Standard: Aus.
-
-tumble[=<Boolean>]
- Zweiseitigen Ausdruck als Kalender (ein) oder Buch (aus). Standard: Aus.
-
-dct[=<Boolean>]
- DCT-codierte Daten aus JPEG-Dateien direkt wiederverwerten.
- Standard: Ein.
-
-bg=<Zahl>:<Zahl>:<Zahl>[:<Boolean>]
- Hintergrundfarbe, die Zahlenwerte für Rot, Grün und Blau
- müssen im Bereich 0...255 liegen. Der Wahrheitswert gibt an, ob der
- hier angegebene Hintergrund immer verwendet werden soll oder nur, wenn
- in der Eingabedatei keine Informationen zur Hintergrundfarbe enthalten
- sind. Standard: Weiß:nein.
-
-interpolation[=<Boolean>]
- Interpolation-Flag. Ist das Flag gesetzt, dürfen Bildbetrachter
- versuchen, die Darstellungsqualität zu verbessern. Standard: Ein.
-
-jpeg-interpolation[=<Boolean>]
- Interpolation-Flag, wenn DCT-codierte Daten aus JPEG-Dateien direkt
- verwendet werden. Standard: Aus.
-
-resolution=<Auflösung>
- Auflösung:
- - "1:1" verwendet für jeden Bildpunkt ein Quadrat von 1 x 1 PS-Point.
- - "chunk" verwendet Auflösungsdaten aus der Eingabedatei, falls
- vorhanden. Andernfalls wird auf 1:1 umgeschaltet.
- - Zahlenwert (ganzzahlig) gibt die Auflösung in dpi (Bildpunkte pro
- Zoll) an.
- Standard: 1:1 für Objekte, chunk für Bilder, Anpassung an eine
- Papiergröße für Dokumente.
-
-paper=<Name>
- Papierformat, in das die Ausgabe eingepasst werden soll.
- Das Format muss in einer dk3paper.conf-Datei definiert sein. Es kann
- entweder resolution=... oder paper=... benutzt werden.
-
-make[=<Boolean>]
- Entspricht der Option -m.
- Standard: Aus.
-
-bpc[=<Boolean>]
- Reduktion der Farbtiefe. Standard: Ein.
EXIT-STATUS
0 bei Erfolg, alle anderen Exit-Codes weisen auf Fehler hin.
-PRÄFERENZEN
+BEISPIELE
-/print/ps/level
- Standard-PS-Level: 2 oder 3.
+bmpp -l pdf screenshot.png
+ erstellt ein PDF-Objekt screenshot.pdf, das mit pdflatex verwendet
+ werden kann.
-BEISPIELE
+bmpp -l eps screenshot.png
+ erstellt ein EPS-Objekt screenshot.eps, das mit latex/dvips verwendet
+ werden kann.
+
+bmpp -l pdf.document,paper=A4,duplex fax.tif
+ erstellt eine PDF-Datei fax.pdf für einen Ausdruck.
bmpp -l ps.document,level=2,paper=A4,duplex fax.tif
erstellt eine PS-Datei fax.ps, die auf einem PS-2-Drucker ausgedruckt
werden kann.
+bmpp -l pdf.image file.png
+ erstellt eine Bild-Datei file.pdf.
-bmpp -l pdf.document,paper=A4,duplex fax.tif
- erstellt eine PDF-Datei fax.pdf.
+bmpp -l ps.image file.png
+ erstellt ein PS-Bild file.ps.
-bmpp -l ps.object screenshot.png
- erstellt ein PS-Objekt screenshot.ps, das mit latex/dvips verwendet
- werden kann.
+FAQ
+* Muss ich mich mit der Konfigurationsdatei dk4gra.conf beschäftigen?
-bmpp -l pdf.object screenshot.png
- erstellt ein PDF-Objekt screenshot.pdf, das mit pdflatex verwendet
- werden kann.
+ Die Konfigurationsdatei dk4gra.conf wurde eingeführt, um bei Bedarf
+ Details der Graphikausgabe konfigurieren zu können. Dies heißt nicht,
+ das man dies auch tun muss. Bmpp kommt mit (meiner Meinung nach)
+ sinnvollen Voreinstellungen.
+ Die Bearbeitung einer Konfigurationsdatei dk4gra.conf ist für die meisten
+ Nutzer nur sinnvoll, wenn ein PostScript-Drucker vorhanden ist, der nur
+ PS Level 2 beherrscht.
-bmpp -l ps.image file.png
- erstellt ein PS-Bild file.ps.
+* Wie stelle ich die PS-Ausgabe dauerhaft auf Level 2 um?
+ - Kommandozeile
+ Verwenden Sie "-lps,level=2" anstelle von "-lps".
+
+ - Konfigurationsdatei
+ Erstellen Sie eine Konfigurationsdatei dk4gra.conf mit dem Inhalt
+
+ [ps]
+ level=2
+
+ in einem der folgenden Verzeichnisse:
+ - ${datadir}/dk4app-site
+ um Einstellungen für alle Nutzer des PC vorzunehmen.
+ - ${sysconfdir}/dk4app-site
+ um Einstellungen für alle Nutzer des PC vorzunehmen.
+ - ${HOME}/.dk4app
+ um Einstellungen für Sie selbst vorzunehmen.
+ ${datadir} ist typischerweise /usr/share oder /usr/local/share auf
+ Unix/Linux-Systemen, C:\Program Files\Krause\share auf Windows-Systemen.
+ ${sysconfdir} ist typischerweise /etc oder /usr/local/etc auf
+ Unix/Linux-Systemen, C:\Program Files\Krause\etc auf Windows-Systemen.
+ ${HOME} ist das Homeverzeichnis unter Unix/Linux, das Nutzerprofil-
+ verzeichnis unter Windows.
+
+
+* Wie erlaube ich für PS-Level 2 die LZW-Komprimierung?
+
+ Hinweis: Obwohl das Patent auf die LZW-Komprimierung in den USA im
+ Jahr 2003 ablief und das entsprechende Patent in Deutschland im
+ Jahr 2004, kenne ich natürlich nicht die Situation in allen Staaten
+ weltweit. Deshalb ist die LZW-Komprimierung standardmäßig deaktiviert.
+ Nutzer sollten sie nur aktivieren, falls dies nötig und mit der rechtlichen
+ Situation im jeweiligen Land vereinbar ist.
+
+ - Kommandozeile
+ Verwenden Sie "-lps,level=2,lzw" anstelle von "-lps,level=2".
+
+ - Konfigurationsdatei
+ Erstellen Sie eine Konfigurationsdatei dk4gra.conf mit dem Inhalt
+
+ [ps]
+ level=2
+ lzw=on
+
+ in einem der oben genannten Verzeichnisse.
-bmpp -l pdf.image file.png
- erstellt eine Bild-Datei file.pdf.
DATEIEN
-dk3paper.conf
- ist die Konfigurationsdatei für die Papiergrößen. Wird paper=...
+dk3paper.conf / dk4paper.conf
+ sind die Konfigurationsdateien für die Papiergrößen. Wird paper=...
verwendet, muss die Papiergröße in einer Konfigurationsdatei
- dk3paper.conf definiert sein.
+ dk3paper.conf bzw. dk4paper.conf definiert sein.
+
+dk4gra.conf
+ ist die Konfigurationsdatei für die Graphikausgabe der Bibliotheken
+ aus DK Tools and Libraries.
+ Beim Programmstart sucht bmpp in verschiedenen Verzeichnissen nach
+ einer Datei dk4gra.conf und verarbeitet gefundene Dateien.
+ Das Vorhandensein folgender Dateien wird in der angegebenen
+ Reihenfolge getestet:
+ - ${datadir}/dk4app/dk4gra.conf
+ - ${sysconfdir}/dk4app/dk4gra.conf
+ - ${datadir}/dk4app-site/dk4gra.conf
+ - ${sysconfdir}/dk4app-site/dk4gra.conf
+ - ${datadir}/dktools/dk4gra.conf
+ - ${sysconfdir}/dktools/dk4gra.conf
+ - ${datadir}/dktools-site/dk4gra.conf
+ - ${sysconfdir}/dktools-site/dk4gra.conf
+ - ${datadir}/bmpp/dk4gra.conf
+ - ${sysconfdir}/bmpp/dk4gra.conf
+ - ${datadir}/bmpp-site/dk4gra.conf
+ - ${sysconfdir}/bmpp-site/dk4gra.conf
+ - ${HOME}/.dk4app/dk4gra.conf
+ - ${HOME}/.dk4app/dktools/dk4gra.conf
+ - ${HOME}/.dk4app/bmpp/dk4gra.conf
+ - ./dk4gra.conf
+ Die Dateien werden kumulativ verarbeitet, Einstellungen in zuerst
+ verarbeiteten Dateien können bei der Verarbeitung späterer Dateien
+ überschrieben werden.
+ Die Verzeichnisse ${datadir}/dk4app, ${sysconfdir}/dk4app,
+ ${datadir}/dktools, ${sysconfdir}/dktools, ${datadir}/bmpp
+ und ${sysconfdir}/bmpp werden vom Paketmanagement verwaltet
+ und sind für Konfigurationsdateien vorgesehen, die Bestandteil
+ von Softwarepaketen sind. Angelegte oder geänderte Dateien hier
+ können vom Paketmanagement überschrieben werden, Sie sollten hier
+ keine Dateien anlegen oder ändern.
+ Eigene Versionen von dk4gra.conf sollten Sie in ${datadir}/dk4app-site,
+ ${sysconfdir}/dk4app-site, ${datadir}/dktools-site,
+ ${sysconfdir}/dktools-site, ${datadir}/bmpp-site,
+ ${sysconfdir}/bmpp-site, ${HOME}/.dk4app , ${HOME}/.dk4app/dktools,
+ oder ${HOME}/.dk4app/bmpp unterbringen. Diese Verzeichnisse werden
+ vom Paketmanagement nicht erfasst.
+
EINSCHRÄNKUNGEN
+Die Größe von Dateinamen ist auf die Länge MAXPATHLEN bzw. _PATH_MAX
+des jeweiligen Systems beschränkt. Der volle Pfadname verwendeter
+Dateien muss in diese Länge passen.
+
Das Programm bmpp nutzt zum Lesen von TIFF-Dateien die Funktion
TIFFReadRGBAImage() aus der libtiff-Bibliothek. Damit kann bmpp nur solche
Dateien verarbeiten, die mit dieser Funktion gelesen werden können.
@@ -218,20 +621,23 @@ GESCHICHTE
Das Programm bmpp ersetzt das in früheren Versionen des dktools-Projektes
enthaltene bmeps.
+Für Version 4.12.0 wurde das Programm komplett neu geschrieben,
+einschließlich der Bibliotheken, die zum Einlesen von Bitmap-Bildern und
+zum Erzeugen der Graphikausgabe benutzt werden.
LIZENZBEDINGUNGEN
Mit dem Kommando
- bmpp --license-terms
+ bmpp --license
werden die Lizenzbedingungen angezeigt.
SIEHE AUCH
-http://dktools.sourceforge.net/bmpp.html
+http://sourceforge.net/p/dktools/wiki/bmpp%20manual/
Die Homepage des Projektes "DK tools and libraries" liefert weitere
Informationen zu bmpp und anderen Programmen.
-http://gxhints.sourceforge.net
+http://sourceforge.net/p/gxhints/wiki/Home/
Die Seite "Graphics Conversion Hints" empfiehlt Programme und
Vorgehensweisen für die Konvertierung heute gängiger
Vektorgraphik-Formate.
diff --git a/support/dktools/dktools/de/bmpp3.txt b/support/dktools/dktools/de/bmpp3.txt
new file mode 100644
index 0000000000..e6f16c49bc
--- /dev/null
+++ b/support/dktools/dktools/de/bmpp3.txt
@@ -0,0 +1,243 @@
+
+BEZEICHNUNG
+
+ bmpp - Bitmap to PS/PDF converter
+
+ÃœBERSICHT
+
+ bmpp [-l<Treiber>[.<Mode>][,<Name>[=<Wert>]...]] [<Option(en)>] <Datei(en)>
+
+BESCHREIBUNG
+
+Das Programm wandelt Bitmap-Dateien in den Formaten PNG, JPEG und TIFF nach
+PS/EPS und PDF um.
+
+Treiber:
+- ps
+ Druckdatei zur Ausgabe auf PostScript-Druckern
+- eps
+ Encapsulated PostScript (EPS), Bild kan in Dokument eingebunden werden.
+- pdf
+ Portable document format (PDF).
+- bb
+ Bounding box, Angabe zu Bildgrenzen ohne Bildinhalt.
+
+Ausgabemodi:
+- Objekt (object)
+ Datei, die in einer Textverarbeitung oder in einem Graphikprogramm in eine
+ andere Datei eingebunden wird (ein Beispiel hierfür sind Dateien, die von
+ LaTeX-Dokumenten referenziert werden).
+- Bild (image)
+ Bild, das für sich allein stehend betrachtet wird.
+- Dokument (document)
+ Bildgröße wird für Ausdruck auf ein bestimmtes Papierformat angepasst.
+
+OPTIONEN
+
+-h
+--help
+ Hilfetext zeigen.
+
+-v
+--version
+ Versionsnummer zeigen.
+
+-L
+--license-terms
+ Lizenzbedingungen zeigen.
+
+-l <Treiber>[.<Mode>]
+ Treiber und Ausgabemodus.
+ Es stehen die Treiber "ps", "eps", "pdf" und "bb" zur Verfügung
+ sowie die Ausgabemodi "object", "image" und "document".
+
+-t <Typ>
+ Eingabe-Datei-Typ ("png", "jpeg" oder "tiff"), falls die
+ Standardeingabe verarbeitet wird oder der Typ nicht aus der Endung des
+ Dateinamens ermittelt werden kann.
+
+-m
+ Make mode: unnötige Konvertierungen vermeiden, wenn Ausgabedatei
+ bereits aktuell ist. Nur beim Verarbeiten eines Verzeichnisses aktiv.
+
+-s
+ Ausgabe in Standardausgabe, nicht in Datei.
+
+-o <Name>[=<Wert>]
+ Weitere Einstellungen.
+
+NAME=WERT-PAARE
+
+Mit diesen Optionen werden weitere Einstellungen getroffen. Bei boolschen
+Einstellungen kann der Wert entfallen, das Aufzählen des Namens setzt die
+Einstellung auf aktiv.
+Folgende Namen (und Werte) stehen zur Verfügung:
+
+level=<PS-Level>
+ PS-Sprachlevel, 2 oder 3. Standard: 3.
+
+color[=<Boolean>]
+ Farbige PS/EPS-Ausgabe erlauben. Standard: An.
+ Hinweis: Wenn DCT-codierte Daten aus JPEG-Dateien direkt verarbeitet
+ werden, wird diese Einstellung ignoriert.
+
+dsc[=<Boolean>]
+ Schreiben von DSC-Kommentaren (document
+ structuring conventions) in PS- oder EPS-Ausgabe erlauben oder
+ verbieten. Standard: Aus für Objekte und Images, ein für Dokumente.
+
+draft[=<Boolean>]
+ Entwurfs-Mode aktivieren/deaktivieren, dabei wird nur eine kleine
+ Platzhalter-Graphik erstellt.
+
+predictor=<Predictor>
+ Predictor für die flate-Komprimierung, entweder "tiff",
+ "sub", "up", "average" oder "paeth". Standard: Keiner.
+
+duplex[=<Boolean>]
+ Ausgabe für zweiseitigen Ausdruck (Vorder- und Rückseite)
+ vorbereiten. Standard: Aus.
+
+tumble[=<Boolean>]
+ Zweiseitigen Ausdruck als Kalender (ein) oder Buch (aus). Standard: Aus.
+
+dct[=<Boolean>]
+ DCT-codierte Daten aus JPEG-Dateien direkt wiederverwerten.
+ Standard: Ein.
+
+bg=<Zahl>:<Zahl>:<Zahl>[:<Boolean>]
+ Hintergrundfarbe, die Zahlenwerte für Rot, Grün und Blau
+ müssen im Bereich 0...255 liegen. Der Wahrheitswert gibt an, ob der
+ hier angegebene Hintergrund immer verwendet werden soll oder nur, wenn
+ in der Eingabedatei keine Informationen zur Hintergrundfarbe enthalten
+ sind. Standard: Weiß:nein.
+
+interpolation[=<Boolean>]
+ Interpolation-Flag. Ist das Flag gesetzt, dürfen Bildbetrachter
+ versuchen, die Darstellungsqualität zu verbessern. Standard: Ein.
+
+jpeg-interpolation[=<Boolean>]
+ Interpolation-Flag, wenn DCT-codierte Daten aus JPEG-Dateien direkt
+ verwendet werden. Standard: Aus.
+
+resolution=<Auflösung>
+ Auflösung:
+ - "1:1" verwendet für jeden Bildpunkt ein Quadrat von 1 x 1 PS-Point.
+ - "chunk" verwendet Auflösungsdaten aus der Eingabedatei, falls
+ vorhanden. Andernfalls wird auf 1:1 umgeschaltet.
+ - Zahlenwert (ganzzahlig) gibt die Auflösung in dpi (Bildpunkte pro
+ Zoll) an.
+ Standard: 1:1 für Objekte, chunk für Bilder, Anpassung an eine
+ Papiergröße für Dokumente.
+
+paper=<Name>
+ Papierformat, in das die Ausgabe eingepasst werden soll.
+ Das Format muss in einer dk3paper.conf-Datei definiert sein. Es kann
+ entweder resolution=... oder paper=... benutzt werden.
+
+make[=<Boolean>]
+ Entspricht der Option -m.
+ Standard: Aus.
+
+bpc[=<Boolean>]
+ Reduktion der Farbtiefe. Standard: Ein.
+
+EXIT-STATUS
+
+0 bei Erfolg, alle anderen Exit-Codes weisen auf Fehler hin.
+
+PRÄFERENZEN
+
+/print/ps/level
+ Standard-PS-Level: 2 oder 3.
+
+BEISPIELE
+
+bmpp -l ps.document,level=2,paper=A4,duplex fax.tif
+ erstellt eine PS-Datei fax.ps, die auf einem PS-2-Drucker ausgedruckt
+ werden kann.
+
+
+bmpp -l pdf.document,paper=A4,duplex fax.tif
+ erstellt eine PDF-Datei fax.pdf.
+
+
+bmpp -l ps.object screenshot.png
+ erstellt ein PS-Objekt screenshot.ps, das mit latex/dvips verwendet
+ werden kann.
+
+
+bmpp -l pdf.object screenshot.png
+ erstellt ein PDF-Objekt screenshot.pdf, das mit pdflatex verwendet
+ werden kann.
+
+
+bmpp -l ps.image file.png
+ erstellt ein PS-Bild file.ps.
+
+
+bmpp -l pdf.image file.png
+ erstellt eine Bild-Datei file.pdf.
+
+DATEIEN
+
+dk3paper.conf
+ ist die Konfigurationsdatei für die Papiergrößen. Wird paper=...
+ verwendet, muss die Papiergröße in einer Konfigurationsdatei
+ dk3paper.conf definiert sein.
+
+EINSCHRÄNKUNGEN
+
+Das Programm bmpp nutzt zum Lesen von TIFF-Dateien die Funktion
+TIFFReadRGBAImage() aus der libtiff-Bibliothek. Damit kann bmpp nur solche
+Dateien verarbeiten, die mit dieser Funktion gelesen werden können.
+Die Dateien müssen folgenden Bedingungen genügen:
+- Die Datei muss dem "TIFF baseline v6.0 standard" entsprechen.
+- Die Anzahl Bits pro Farbkomponente darf maximal 8 sein.
+- Jedes Frame darf nicht zu groß sein, das System muss den erforderlichen
+ Hauptspeicher von 4*w*h Bytes am Stück allozieren können.
+
+TIFF bezeichnet eine Gruppe verschiedener Komprimierungs- und
+Codierungsmechanismen. Eine TIFF-Datei besteht aus einer Folge von Datensätzen.
+Jeder Datensatz enthält eine Typangabe (Tag), der die Art des Datensatzes
+angibt. In den Standards - z.B. "TIFF baseline v6.0 standard" ist eine Reihe
+von Tags definiert. Darüber hinaus verwenden verschiedene Softwarehersteller
+auch herstellerspezifische oder (noch) nicht standardisierte Tags.
+Daher ist es nicht ungewöhnlich, wenn beim Einlesen von TIFF-Bildern
+Warnungen oder Fehlermeldungen über unbekannte Tags ausgegeben werden.
+Dies ist kein Fehler in bmpp oder der tifflib-Bibliothek.
+In vielen Fällen kann das Bild dennoch gelesen werden.
+Haben Sie beim Erstellen von Bitmap-Dateien die Möglichkeit, den Bitmap-Typ
+selbst festzulegen, sollten sie besser PNG verwenden, falls möglich.
+
+AUTOR
+
+Dirk Krause
+
+GESCHICHTE
+
+Das Programm bmpp ersetzt das in früheren Versionen des dktools-Projektes
+enthaltene bmeps.
+
+LIZENZBEDINGUNGEN
+
+Mit dem Kommando
+ bmpp --license-terms
+werden die Lizenzbedingungen angezeigt.
+
+SIEHE AUCH
+
+http://sourceforge.net/p/dktools/wiki/bmpp/
+ Die Homepage des Projektes "DK tools and libraries" liefert weitere
+ Informationen zu bmpp und anderen Programmen.
+
+http://sourceforge.net/p/gxhints/wiki/Home/
+ Die Seite "Graphics Conversion Hints" empfiehlt Programme und
+ Vorgehensweisen für die Konvertierung heute gängiger
+ Vektorgraphik-Formate.
+
+http://netpbm.sourceforge.net (insbesondere pnmtops)
+ NetPBM ist ein Toolkit für Bilder, einschließlich Konvertierung
+ zwischen zahlreichen Graphikformaten, insbesondere für
+ Bitmap-Graphiken.
+
diff --git a/support/dktools/dktools/de/dk-bin2c.str b/support/dktools/dktools/de/dk-bin2c.str
new file mode 100644
index 0000000000..e603bbf042
--- /dev/null
+++ b/support/dktools/dktools/de/dk-bin2c.str
@@ -0,0 +1,38 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0 Error: Failed to set up signal handlers!
+#
+Signal-Handler konnten nicht eingerichtet werden!
+#
+# 1 Error: Failed to restore signal handlers!
+#
+Signal-Handler konnten nicht wiederhergestellt werden!
+#
+# 2 Error: Path or file name too long!
+#
+Pfad oder Dateiname zu lang!
+#
+# 3 Error: Path too long!
+#
+Pfad zu lang!
+#
+# 4 Error: No matching file found!
+#
+Keine passende Datei gefunden!
+#
+# 5 Error: Interrupted by SIGINT!
+#
+Abbruch durch SIGINT-Signal!
+#
+# 6 Error: Interrupted by SIGTERM!
+#
+Abbruch durch SIGTERM-Signal!
+#
+# 7 Error: Interrupted by SIGPIPE!
+#
+SIGPIPE-Signal aufgetreten!
+#
+# 8 Error: Failed to write to stdout!
+#
+Schreiben auf Standardausgabe schlug fehl!
diff --git a/support/dktools/dktools/de/dk-bin2c.txt b/support/dktools/dktools/de/dk-bin2c.txt
new file mode 100644
index 0000000000..cb087adb3c
--- /dev/null
+++ b/support/dktools/dktools/de/dk-bin2c.txt
@@ -0,0 +1,71 @@
+
+BEZEICHNUNG
+
+ dk-bin2c - Konvertierung von Binärdaten zu C-Quelltext
+
+ÃœBERSICHT
+
+ dk-bin2c [<Optionen>] [<Datei(en)>]
+
+BESCHREIBUNG
+
+Das Programm dk-bin2c konvertiert den Inhalt der angegebenen Dateien bzw.
+der Standardeingabe zu C-Quelltext (Feld von unsigned-char-Literalen in
+hexadezimaler Darstellung).
+
+OPTIONEN
+
+-o
+--octal
+ Oktale Ausgabe anstelle der standardmäßig hexadezimalen Augabe.
+
+-i Einrückung
+--indent=Einrückung
+ Anzahl der Leerzeichen am Zeilenanfang. Standard: 0.
+
+-s Leerzeichenanzahl
+--spaces=Leerzeichenanzahl
+ Anzahl der Leerzeichen zwischen den Werten einer Zeile. Standard: 0.
+
+-b Werteanzahl
+--bytes-per-line=Werteanzahl
+ Anzahl der Byterepräsentationen pro Zeile. Standard: 15.
+
+--help
+ Kurzen Hilfetext anzeigen.
+
+--manual
+ Diesen ausführlichen Hilfetext anzeigen.
+
+--version
+ Versionsnummer anzeigen.
+
+--license
+ Lizenzbedingungen anzeigen.
+
+EXIT-STATUS
+
+0 bei Erfolg, alle anderen Exit-Codes weisen auf Fehler hin.
+
+UMGEBUNG
+
+Unter Windows wird geprüft, ob die Umgebungsvariablen VIM oder VIMRUNTIME
+existieren. Ist dies der Fall, wurde das Programm von vim aus gestartet,
+Fehlermeldungen und sonstige Diagnoseausgaben werden unterdrückt.
+Damit soll eine Vermischung von 8-Bit-Text der normalen Ausgabe mit
+16-Bit-Text der Diagnoseausgaben verhindert werden.
+
+AUTOR
+
+Dirk Krause
+
+COPYRIGHT UND LIZENZBESTIMMUNGEN
+
+Führen Sie
+ dk-bin2c --license
+aus, um Lizenz-Informationen anzuzeigen.
+
+SIEHE AUCH
+
+http://sourceforge.net/p/dktools/wiki/Home/
+
diff --git a/support/dktools/dktools/de/dk-blks.str b/support/dktools/dktools/de/dk-blks.str
index 7fe6453344..47132c92c3 100644
--- a/support/dktools/dktools/de/dk-blks.str
+++ b/support/dktools/dktools/de/dk-blks.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error message: Not all bytes written
#
diff --git a/support/dktools/dktools/de/dk-blks.txt b/support/dktools/dktools/de/dk-blks.txt
index efead99e3f..dde58430d6 100644
--- a/support/dktools/dktools/de/dk-blks.txt
+++ b/support/dktools/dktools/de/dk-blks.txt
@@ -40,5 +40,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-bmm.str b/support/dktools/dktools/de/dk-bmm.str
index 34a26f463e..84c12e7ae2 100644
--- a/support/dktools/dktools/de/dk-bmm.str
+++ b/support/dktools/dktools/de/dk-bmm.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-bmm.txt b/support/dktools/dktools/de/dk-bmm.txt
index 9a36c5373e..a7480fbf4f 100644
--- a/support/dktools/dktools/de/dk-bmm.txt
+++ b/support/dktools/dktools/de/dk-bmm.txt
@@ -59,5 +59,5 @@ aus, um die Lizenzbedingungen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-cat.str b/support/dktools/dktools/de/dk-cat.str
index 39562451aa..24834d01b7 100644
--- a/support/dktools/dktools/de/dk-cat.str
+++ b/support/dktools/dktools/de/dk-cat.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 1 2 Decoding error
#
diff --git a/support/dktools/dktools/de/dk-cat.txt b/support/dktools/dktools/de/dk-cat.txt
index 102c229271..32fe4f94b3 100644
--- a/support/dktools/dktools/de/dk-cat.txt
+++ b/support/dktools/dktools/de/dk-cat.txt
@@ -87,5 +87,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-db2t.str b/support/dktools/dktools/de/dk-db2t.str
index 3d32ba4b74..6b82002e51 100644
--- a/support/dktools/dktools/de/dk-db2t.str
+++ b/support/dktools/dktools/de/dk-db2t.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-db2t.txt b/support/dktools/dktools/de/dk-db2t.txt
index 9d1f60ae7f..4e253edc85 100644
--- a/support/dktools/dktools/de/dk-db2t.txt
+++ b/support/dktools/dktools/de/dk-db2t.txt
@@ -103,5 +103,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-dbco.str b/support/dktools/dktools/de/dk-dbco.str
index ffdad1ce74..39d99c99d7 100644
--- a/support/dktools/dktools/de/dk-dbco.str
+++ b/support/dktools/dktools/de/dk-dbco.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-dbco.txt b/support/dktools/dktools/de/dk-dbco.txt
index f4a0048dbb..be46bdb3c4 100644
--- a/support/dktools/dktools/de/dk-dbco.txt
+++ b/support/dktools/dktools/de/dk-dbco.txt
@@ -85,5 +85,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-fic.str b/support/dktools/dktools/de/dk-fic.str
index 74b091d28b..a238cf3ed1 100644
--- a/support/dktools/dktools/de/dk-fic.str
+++ b/support/dktools/dktools/de/dk-fic.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error message: Failed to set up signal handlers
#
diff --git a/support/dktools/dktools/de/dk-fic.txt b/support/dktools/dktools/de/dk-fic.txt
index 731d6b1889..73021f7712 100644
--- a/support/dktools/dktools/de/dk-fic.txt
+++ b/support/dktools/dktools/de/dk-fic.txt
@@ -91,5 +91,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-hex.str b/support/dktools/dktools/de/dk-hex.str
index 04f963fcee..bd4d1cb93f 100644
--- a/support/dktools/dktools/de/dk-hex.str
+++ b/support/dktools/dktools/de/dk-hex.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-hex.txt b/support/dktools/dktools/de/dk-hex.txt
index 5394a7eae9..f7deb92632 100644
--- a/support/dktools/dktools/de/dk-hex.txt
+++ b/support/dktools/dktools/de/dk-hex.txt
@@ -46,5 +46,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-lines.str b/support/dktools/dktools/de/dk-lines.str
new file mode 100644
index 0000000000..aec8c7f714
--- /dev/null
+++ b/support/dktools/dktools/de/dk-lines.str
@@ -0,0 +1,132 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0 ERROR: Failed to set up masked signal set for SIGPIPE
+#
+Signalhandler für SIGPIPE konnte nicht eingerichtet werden!
+#
+# 1 ERROR: Failed to set up masked signal set for SIGINT
+#
+Signalhandler für SIGINT konnte nicht eingerichtet werden!
+#
+# 2 ERROR: Failed to set up masked signal set for SIGTERM
+#
+Signalhandler für SIGTERM konnte nicht eingerichtet werden!
+#
+# 3 ERROR: Failed to restore SIGTERM settings!
+#
+Signalhandler für SIGTERM konnte nicht wiederhergestellt werden!
+#
+# 4 ERROR: Failed to restore SIGINT settings
+#
+Signalhandler für SIGINT konnte nicht wiederhergestellt werden!
+#
+# 5 ERROR: Failed to restore SIGPIPE settings
+#
+Signalhandler für SIGPIPE konnte nicht wiederhergestellt werden!
+#
+# 6 ERROR: Illegal line number 0!
+#
+Zeilennummer 0 ist unzulässig!
+#
+# 7 8 ERROR: Number ... too large!
+#
+Zahl zu groß (Bereichsüberlauf): "
+"!
+#
+# 9 10 ERROR: Not a number: ...!
+#
+Keine Zahl: "
+"!
+#
+# 11 ERROR: Start line number larger than end number!
+#
+Zeilennummer für Start größer als für Ende!
+#
+# 12 ERROR: Invalid line range specification (empty string)!
+#
+Ungültiger Zeilenbereich (leerer Text)!
+#
+# 13 ERROR: Missing line range specification!
+#
+Angabe zu Zeilenbereich fehlt!
+#
+# 14 15 ERROR: Illegal input encoding!
+#
+Unzulässiges Eingabe-Encoding: "
+"!
+#
+# 16 ERROR: Missing input encoding!
+#
+Angabe zu Eingabe-Encoding fehlt!
+#
+# 17 ERROR: Invalid line size 0!
+#
+Unzulässige Zeilengröße 0!
+#
+# 18 ERROR: Missing line size specification!
+#
+Angabe zu Zeilengröße fehlt!
+#
+# 19 ERROR: Can not use --today with both --from and --to!
+#
+Option --today kann nicht mit --from und --to benutzt werden!
+#
+# 20 ERROR: Input line too long!
+#
+Eingabezeile zu lang!
+#
+# 21 ERROR: Overflow in line number!
+#
+Zu viele Zeilen, Ãœberlauf der Zeilennummer!
+#
+# 22 ERROR: Overflow in line range calculation!
+#
+Numerischer Ãœberlauf bei Bereichsberechnung!
+#
+# 23 ERROR: End line number is 1 (bug)!
+#
+Nummer der Endzeile ist 1 (Bug)!
+#
+# 24 ERROR: End line number too large!
+#
+Nummer der Endzeile zu groß, numerischer Überlauf!
+#
+# 25 ERROR: Start line number too large!
+#
+Nummer der Startzeile zu groß, numerischer Überlauf!
+#
+# 26 ERROR: Ring buffer size 0!
+#
+Ring-Puffer hat Größe 0 (Bug)!
+#
+# 27 ERROR: Failed to obtain file name!
+#
+Dateiname nicht ermittelbar (Bug)!
+#
+# 28 ERROR: Stopped by SIGPIPE!
+#
+Programmende wegen SIGPIPE!
+#
+# 29 ERROR: I/O errors while writing output!
+#
+I/O-Fehler beim Schreiben!
+#
+# 30 ERROR: Stopped by interrupt!
+#
+Programmende wegen Interrupt!
+#
+# 31 32 33 Error messages for encoding/decoding/processing errors
+#
+Neu-Codieren fehlgeschlagen!
+Decodieren fehlgeschlagen!
+Verarbeitung fehlgeschlagen!
+#
+# 34 ... 39 Error messages with detailed position
+#
+Neu-Codieren fehlgeschlagen!\n\tByte:
+Decodieren fehlgeschlagen!\n\tByte:
+Verarbeitung fehlgeschlagen!\n\tByte:
+,\n\tTextbuchstabe:
+,\n\tPosition in Zeile:
+.
diff --git a/support/dktools/dktools/de/dk-lines.txt b/support/dktools/dktools/de/dk-lines.txt
new file mode 100644
index 0000000000..ebca48c8b8
--- /dev/null
+++ b/support/dktools/dktools/de/dk-lines.txt
@@ -0,0 +1,141 @@
+
+BEZEICHNUNG
+
+dk-lines - Zeilen aus einem Text extrahieren
+
+ÃœBERSICHT
+
+dk-lines [<Option(en)>] [<Datei(en)>]
+
+BESCHREIBUNG
+
+Das Programm extrahiert Zeilen aus einem Text. Der Text wird den angegebenen
+Dateien bzw. der Standardeingabe entnommen.
+
+Die Extraktion erfolgt in zwei Stufen, beide Stufen sind optional.
+
+In der ersten Stufe wird jede Textzeile mit einem Starttext und/oder einem
+Endtext verglichen. Liegt die Zeile lexikographisch zwischen Start- und
+Endtext, wird sie an die zweite Stufe übergeben. Zeilen, die den
+Bereichsgrenzen entsprechen, werden dabei mit berücksichtigt. Ist nur Start-
+oder Endtext gegeben, erfolgt nur ein einfacher Vergleich anstelle des
+Bereichstests.
+
+In der zweiten Stufe werden aus den Ergebnissen der ersten Stufe Zeilen
+anhand der Zeilennummern extrahiert. Dabei wird eine Zeilennummer für die
+Anfangszeile und/oder die Endzeile angegeben.
+Positive Zeilennummern werden vom Dateibeginn an vorwärts gezählt, die
+erste Zeile hat die Zeilennummer 1. Negative Zeilennummern werden vom
+Dateiende an rückwärts gezählt, die letzte Zeile hat die Zeilennummer -1.
+
+OPTIONEN
+
+-f <Starttext>
+--from <Starttext>
+ gibt den Startext für Stufe 1 vor.
+
+-t <Endtext>
+--to <Endtext>
+ gibt den Endtext für Stufe 1 vor.
+
+--today
+ gibt das aktuelle Datum in der Form JJJJ-MM-TT für Start- und
+ Endtext vor, falls diese nicht mit -t bzw. -f angegeben wurden.
+ Wurde sowohl -f als auch -t verwendet, kann --today nicht
+ gleichzeitig verwendet werden.
+
+-l <Zeilenbereich>
+--lines <Zeilenbereich>
+ gibt den Zeilenbereich für Stufe 2 vor. Folgende Formen sind möglich:
+ s Angabe nur der Anfangszeilennummer.
+ s/e Angabe von Anfangs- und Endzeilennummer.
+ /e Angabe nur der Endzeilennummer.
+ Die Anfangszeilennummer gibt die erste auszugebende Zeile an.
+ Die Endzeilennummer gibt die letzte auszugebende Zeile an.
+ Positive Zeilennummern zählen mit 1 für die erste Zeile beginnend
+ vorwärts. Negative Zeilennummern zählen mit -1 für die letzte
+ Zeile beginnend rückwärts.
+ Wurde Stufe 1 verwendet (Optionen -t, -f oder --today benutzt),
+ beziehen sich die Zeilennummern auf die Ergebnisse der Stufe 1.
+
+-o
+--one-stream
+ Bei Angabe mehrerer Eingabedateien werden die Ergebnisse der
+ ersten Stufe zusammengefasst, bevor die Auswahl über den Zeilenbereich
+ erfolgt.
+ Ohne diese Option wird jede Datei einzeln für sich betrachtet.
+
+-i <String>
+--input-encoding=<String>
+ Erwartetes Text-Encoding für die Eingabedaten.
+ Ein Byte-Order-Marker (BOM) am Beginn der Eingabe überschreibt
+ das Encoding.
+
+--line-size <Zeilenpuffergröße>
+ legt die Größe des Zeilenpuffers fest. Voreingestellt sind
+ 4096 Bytes.
+
+-v
+--verbose
+ Detailliertere Fehlerausgabe.
+
+EXIT-STATUS
+
+0 bei Erfolg, alle anderen Exit-Codes weisen auf Fehler hin.
+
+BEISPIELE
+
+Dateien ermitteln, die in einem bestimmten Zeitraum geändert wurden:
+
+ dk-ls -pmn -tf -r | dk-lines --from=2017-11-18 --to=2017-11-19
+
+ Es werden alle Zeilen ausgegeben, die mit mit Text von
+ "2017-11-18" bis "2017-11-19" (einschließlich) beginnen.
+
+Dateien ermitteln, die heute geändert wurden:
+
+ dk-ls -pmn -tf -r | dk-lines --today
+
+Die 10 zuletzt geänderten Dateien ermitteln:
+
+ dk-ls -pmn -tf -r | dk-sort | dk-lines -l -10
+
+ Die Ausgabe beginnt mit der zehntletzten Zeile.
+
+Die 10 ältesten Dateien (hinsichtlich Änderungsdatum) ermitteln:
+
+ dk-ls -pmn -tf -r | dk-sort | dk-lines -l 1/10
+
+ Die Ausgabe beginnt mit der ersten Zeile und endet mit der
+ zehnten Zeile.
+
+Inhalt der Datei "x.txt" ausgeben, dabei erste 3 und letzte 2 Zeilen weglassen:
+
+ dk-lines -l 4/-3 x.txt
+
+ Die Ausgabe beginnt mit der vierten Zeile und endet mit der
+ drittletzten Zeile.
+
+EINSCHRÄNKUNGEN
+
+Unter Windows kann eine Erweiterung von Dateinamen mit Wildcards (* oder ?)
+nur für Dateinamen bis zu einer Länge von _MAX_PATH (260) erfolgen.
+
+AUTOR
+
+Dirk Krause
+
+GESCHICHTE
+
+Das Programm wurde in Version 4.10.0 hinzugefügt.
+
+COPYRIGHT UND LIZENZBESTIMMUNGEN
+
+Führen Sie
+ dk-lines --license
+aus, um Lizenz-Informationen anzuzeigen.
+
+SIEHE AUCH
+
+http://sourceforge.net/p/dktools/wiki/Home/
+
diff --git a/support/dktools/dktools/de/dk-ls.str b/support/dktools/dktools/de/dk-ls.str
index 07c2ec92c3..75d3889816 100644
--- a/support/dktools/dktools/de/dk-ls.str
+++ b/support/dktools/dktools/de/dk-ls.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error message: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-ls.txt b/support/dktools/dktools/de/dk-ls.txt
index f499eca3c3..15ab303878 100644
--- a/support/dktools/dktools/de/dk-ls.txt
+++ b/support/dktools/dktools/de/dk-ls.txt
@@ -284,5 +284,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-pwd.str b/support/dktools/dktools/de/dk-pwd.str
index 4f67be14c6..fe4d0a20d8 100644
--- a/support/dktools/dktools/de/dk-pwd.str
+++ b/support/dktools/dktools/de/dk-pwd.str
@@ -1,2 +1,7 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0
+#
Aktuelles Verzeichnis konnte nicht ermittelt werden!
diff --git a/support/dktools/dktools/de/dk-pwd.txt b/support/dktools/dktools/de/dk-pwd.txt
index d288d5eb05..514fa52c1e 100644
--- a/support/dktools/dktools/de/dk-pwd.txt
+++ b/support/dktools/dktools/de/dk-pwd.txt
@@ -36,5 +36,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-pwgen.str b/support/dktools/dktools/de/dk-pwgen.str
index 2e6f83542a..c9c849592a 100644
--- a/support/dktools/dktools/de/dk-pwgen.str
+++ b/support/dktools/dktools/de/dk-pwgen.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: OpenSSL PRNG not available!
#
diff --git a/support/dktools/dktools/de/dk-pwgen.txt b/support/dktools/dktools/de/dk-pwgen.txt
index 8ee348d2c7..b7473fa016 100644
--- a/support/dktools/dktools/de/dk-pwgen.txt
+++ b/support/dktools/dktools/de/dk-pwgen.txt
@@ -123,5 +123,5 @@ This product includes software written by Tim Hudson (tjh@cryptsoft.com).
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-recv.str b/support/dktools/dktools/de/dk-recv.str
index 1a5ab2f63a..fba264a1aa 100644
--- a/support/dktools/dktools/de/dk-recv.str
+++ b/support/dktools/dktools/de/dk-recv.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 1 Error: Failed to set up / restore signal handlers!
#
@@ -33,3 +35,17 @@ Fehlerhafte Argumente-Anzahl!\n\tHost Port [Dateiname]
Abbruch durch INT-Signal!
Abbruch durch TERM-Signal!
Abbruch durch PIPE-Signal!
+#
+# 11 12 13
+#
+Verbindungsaufbau-Dauer:
+Ãœbertragungsdauer:
+Übertragungsgröße:
+#
+# 14 15
+#
+ Sekunden.
+ Bytes.
+#
+#
+#
diff --git a/support/dktools/dktools/de/dk-recv.txt b/support/dktools/dktools/de/dk-recv.txt
index 491f0e5087..f9820d44d6 100644
--- a/support/dktools/dktools/de/dk-recv.txt
+++ b/support/dktools/dktools/de/dk-recv.txt
@@ -63,5 +63,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-send.str b/support/dktools/dktools/de/dk-send.str
index c52b405cf3..c4d7b4c3c0 100644
--- a/support/dktools/dktools/de/dk-send.str
+++ b/support/dktools/dktools/de/dk-send.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to set up signal handlers!
#
@@ -69,3 +71,17 @@ Timeout-Wert nicht gefunden!
# 19
#
Abbruch, alle Verbindungen zu Empfängern wurden getrennt!
+#
+# 20 21 22
+#
+Verbindungsaufbau-Dauer:
+Ãœbertragungsdauer:
+Übertragungsgröße:
+#
+# 23 24
+#
+ Sekunden.
+ Bytes.
+#
+#
+#
diff --git a/support/dktools/dktools/de/dk-send.txt b/support/dktools/dktools/de/dk-send.txt
index ca30c55704..174d3a628e 100644
--- a/support/dktools/dktools/de/dk-send.txt
+++ b/support/dktools/dktools/de/dk-send.txt
@@ -75,5 +75,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-sort.str b/support/dktools/dktools/de/dk-sort.str
index a6a46d1282..b3820d824b 100644
--- a/support/dktools/dktools/de/dk-sort.str
+++ b/support/dktools/dktools/de/dk-sort.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error message: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-sort.txt b/support/dktools/dktools/de/dk-sort.txt
index 2f2e5b4f44..198244c86b 100644
--- a/support/dktools/dktools/de/dk-sort.txt
+++ b/support/dktools/dktools/de/dk-sort.txt
@@ -17,7 +17,7 @@ OPTIONEN
-i <String>
--input-encoding=<String>
- Erwartetes Text-Encoding für die Eingabedaten an.
+ Erwartetes Text-Encoding für die Eingabedaten.
Ein Byte-Order-Marker (BOM) am Beginn der Eingabe überschreibt
das Encoding.
@@ -108,5 +108,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-sqlsplit.txt b/support/dktools/dktools/de/dk-sqlsplit.txt
index a6f72941f8..8750bc9a60 100644
--- a/support/dktools/dktools/de/dk-sqlsplit.txt
+++ b/support/dktools/dktools/de/dk-sqlsplit.txt
@@ -41,5 +41,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-t2db.str b/support/dktools/dktools/de/dk-t2db.str
index 16d42fa8de..bac8a2a887 100644
--- a/support/dktools/dktools/de/dk-t2db.str
+++ b/support/dktools/dktools/de/dk-t2db.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-t2db.txt b/support/dktools/dktools/de/dk-t2db.txt
index af22883fc5..0ea6916756 100644
--- a/support/dktools/dktools/de/dk-t2db.txt
+++ b/support/dktools/dktools/de/dk-t2db.txt
@@ -120,5 +120,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-t2h.str b/support/dktools/dktools/de/dk-t2h.str
index a95c2eb9d9..5fbc66c19e 100644
--- a/support/dktools/dktools/de/dk-t2h.str
+++ b/support/dktools/dktools/de/dk-t2h.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-t2h.txt b/support/dktools/dktools/de/dk-t2h.txt
index 071d43052c..68b8c6153d 100644
--- a/support/dktools/dktools/de/dk-t2h.txt
+++ b/support/dktools/dktools/de/dk-t2h.txt
@@ -59,5 +59,5 @@ aus, um Lizenz-Inforomationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-t2l.str b/support/dktools/dktools/de/dk-t2l.str
index d7634fe0fa..901da12ef8 100644
--- a/support/dktools/dktools/de/dk-t2l.str
+++ b/support/dktools/dktools/de/dk-t2l.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-t2l.txt b/support/dktools/dktools/de/dk-t2l.txt
index 176b3b51c3..0801c22b3d 100644
--- a/support/dktools/dktools/de/dk-t2l.txt
+++ b/support/dktools/dktools/de/dk-t2l.txt
@@ -43,6 +43,13 @@ OPTIONEN
--verbose Fehlermeldung anzeigen, wenn Abbruch wegen
SIGPIPE erfolgte.
+--check Alle Ãœbersetzungstabellen laden (und dabei
+ Syntaxprüfung vornehmen).
+ Diese Option kann gemeinsam mit Präferenz
+ --dir.charmap=... verwendet werden, um alle
+ Ãœbersetzungstabellen in einem bestimmten
+ Verzeichnis zu testen.
+
EXIT-STATUS
0 bei Erfolg, alle anderen Exit-Codes weisen auf Fehler hin.
@@ -113,5 +120,5 @@ aus, um Lizenz-Inforomationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk-uid.str b/support/dktools/dktools/de/dk-uid.str
index 0e607448e2..ec0f39c34a 100644
--- a/support/dktools/dktools/de/dk-uid.str
+++ b/support/dktools/dktools/de/dk-uid.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Error: Failed to install signal handlers!
#
diff --git a/support/dktools/dktools/de/dk-uid.txt b/support/dktools/dktools/de/dk-uid.txt
index 58b4665188..803a878861 100644
--- a/support/dktools/dktools/de/dk-uid.txt
+++ b/support/dktools/dktools/de/dk-uid.txt
@@ -34,5 +34,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dk3app.str b/support/dktools/dktools/de/dk3app.str
index 3031f247a5..5c441e0c3c 100644
--- a/support/dktools/dktools/de/dk3app.str
+++ b/support/dktools/dktools/de/dk3app.str
@@ -1,3 +1,6 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
# Test with german umlauts and ligatures: äöüÄÖÜß
# PLEASE DO NOT REMOVE THE LINE ABOVE!
# Good editors (like i.e. vim) recognize UTF-8 sequences
@@ -1360,3 +1363,11 @@ Keine Daten für Zeichen 0x
# 411
#
Encoding-Anforderungen stehen in Konflikt miteinander!
+#
+# 412 413
+#
+Pufferung für Datei "
+" nicht geändert!
+#
+#
+#
diff --git a/support/dktools/dktools/de/dk3bifa.str b/support/dktools/dktools/de/dk3bifa.str
index 6f9ba33233..0452a117fa 100644
--- a/support/dktools/dktools/de/dk3bifa.str
+++ b/support/dktools/dktools/de/dk3bifa.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0
#
diff --git a/support/dktools/dktools/de/dk3bmeps.str b/support/dktools/dktools/de/dk3bmeps.str
index 40c86e8e9c..490774965e 100644
--- a/support/dktools/dktools/de/dk3bmeps.str
+++ b/support/dktools/dktools/de/dk3bmeps.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Simple newline.
#
diff --git a/support/dktools/dktools/de/dk3fig.str b/support/dktools/dktools/de/dk3fig.str
index 0c7592906d..82d8616464 100644
--- a/support/dktools/dktools/de/dk3fig.str
+++ b/support/dktools/dktools/de/dk3fig.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: File name.
#
diff --git a/support/dktools/dktools/de/dk3print.str b/support/dktools/dktools/de/dk3print.str
index 0ff1f4c530..20d35a788f 100644
--- a/support/dktools/dktools/de/dk3print.str
+++ b/support/dktools/dktools/de/dk3print.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0
#
diff --git a/support/dktools/dktools/de/dk3wreg.str b/support/dktools/dktools/de/dk3wreg.str
index a8d2f37fa7..78fc0ff4d4 100644
--- a/support/dktools/dktools/de/dk3wreg.str
+++ b/support/dktools/dktools/de/dk3wreg.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0
#
diff --git a/support/dktools/dktools/de/dk4info.str b/support/dktools/dktools/de/dk4info.str
index 5201c9959e..dc50caf681 100644
--- a/support/dktools/dktools/de/dk4info.str
+++ b/support/dktools/dktools/de/dk4info.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 1 Used directories:
#
diff --git a/support/dktools/dktools/de/dk4info.txt b/support/dktools/dktools/de/dk4info.txt
index c8df17c4cc..c6a0d08e08 100644
--- a/support/dktools/dktools/de/dk4info.txt
+++ b/support/dktools/dktools/de/dk4info.txt
@@ -36,5 +36,5 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkct.txt b/support/dktools/dktools/de/dkct.txt
index db3e177658..140c54d549 100644
--- a/support/dktools/dktools/de/dkct.txt
+++ b/support/dktools/dktools/de/dkct.txt
@@ -62,6 +62,19 @@ OPTIONEN
--box-width=<Weite>
Box-Weite für Kommentarboxen festlegen.
+-S
+--splint
+ Kommentare für splint in die Ausgabe schreiben.
+
+--splint-comment-char=<Zeichen>
+ Das angegebene Zeichen wird in splint-Kommentaren benutzt.
+
+--no-modification-warning
+ Die Warnungen am Beginn der Ausgabedateien werden unterdrückt.
+ Diese Warnungen weisen Nutzer darauf hin, nicht die Ausgabedatei
+ direkt zu bearbeiten, sondern die zugehörige von dkct verarbeitete
+ Quelle.
+
-h
--help
Hilfe-Text anzeigen.
@@ -80,7 +93,7 @@ EXIT-STATUS
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
AUTOR
diff --git a/support/dktools/dktools/de/dkct3.str b/support/dktools/dktools/de/dkct3.str
index 850d0134bf..9f41e04e47 100644
--- a/support/dktools/dktools/de/dkct3.str
+++ b/support/dktools/dktools/de/dkct3.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 / 1: Error: Not an input file (wrong suffix): "..."!
#
@@ -292,9 +294,9 @@ Syntax-Fehler!\nNicht im erlaubten Bereich: "
#
# 84/85/86: Error: Can't add object "..." to parent object "..."!
#
-Syntax-Fehler!\nObjekt "
-" kann nicht zu Elternobjekt "
-" hinzugefügt werden!
+Syntax-Fehler!\n\tObjekt "
+", Elternobjekt "
+":\n\tMethode zum Hinzufügen unbekannt!
#
# 87: UNUSED Object/class name: Not specified.
#
@@ -387,3 +389,34 @@ Präprozessor-Direktive in $!text mit file=...!
# 115: Warning: Redefinition of tooltip flag!
#
Neudefinition von "tooltip flag"!
+#
+# 116-121
+#
+Kennzahl
+ für Zustand mehrfach benutzt!
+Kennzahl
+ für Eingabe mehrfach benutzt!
+Kennzahl
+ für Ausgabe mehrfach benutzt!
+#
+# 122-123
+#
+Kein C-Identifier: "
+"!
+#
+# 124
+#
+Attribut "text" fehlt an wxNotebook-Inhaltselement!
+#
+# 125
+#
+Element ist kein Container!\n\tAngabe contents wird ignoriert!
+#
+# 126-127 No parent object for "..."!
+#
+Kein Elternobject für "
+"!
+#
+# 128 Error: SPDX-License-Identifier redefined!
+#
+Redefinition von "SPDX-License-Identifier"!
diff --git a/support/dktools/dktools/de/dkdbtool.str b/support/dktools/dktools/de/dkdbtool.str
index 8719a0a33f..6f8a78615c 100644
--- a/support/dktools/dktools/de/dkdbtool.str
+++ b/support/dktools/dktools/de/dkdbtool.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0
#
diff --git a/support/dktools/dktools/de/dkdbtool.txt b/support/dktools/dktools/de/dkdbtool.txt
index 5772d4b94c..c76f4202b5 100644
--- a/support/dktools/dktools/de/dkdbtool.txt
+++ b/support/dktools/dktools/de/dkdbtool.txt
@@ -97,7 +97,7 @@ Ende der Zeile (Newline oder Zeilenvorschub).
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
AUTOR
diff --git a/support/dktools/dktools/de/dknet4.str b/support/dktools/dktools/de/dknet4.str
index 45321b5935..109b44249d 100644
--- a/support/dktools/dktools/de/dknet4.str
+++ b/support/dktools/dktools/de/dknet4.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: File name <<standard input>> used if no file name specified
#
diff --git a/support/dktools/dktools/de/dknet4.txt b/support/dktools/dktools/de/dknet4.txt
index 01e18d59ed..55c6f5bed7 100644
--- a/support/dktools/dktools/de/dknet4.txt
+++ b/support/dktools/dktools/de/dknet4.txt
@@ -66,5 +66,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-boot.txt b/support/dktools/dktools/de/dkwt-boot.txt
index 30f0d2ace4..50cb5f0adb 100644
--- a/support/dktools/dktools/de/dkwt-boot.txt
+++ b/support/dktools/dktools/de/dkwt-boot.txt
@@ -51,5 +51,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-clp.txt b/support/dktools/dktools/de/dkwt-clp.txt
index 8639bbd4be..016b4a0be5 100644
--- a/support/dktools/dktools/de/dkwt-clp.txt
+++ b/support/dktools/dktools/de/dkwt-clp.txt
@@ -40,5 +40,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-env.txt b/support/dktools/dktools/de/dkwt-env.txt
index db8996f59a..b5b7944a92 100644
--- a/support/dktools/dktools/de/dkwt-env.txt
+++ b/support/dktools/dktools/de/dkwt-env.txt
@@ -113,5 +113,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-groups.txt b/support/dktools/dktools/de/dkwt-groups.txt
index d2cbbda4d8..72a973a4a9 100644
--- a/support/dktools/dktools/de/dkwt-groups.txt
+++ b/support/dktools/dktools/de/dkwt-groups.txt
@@ -37,5 +37,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-help.txt b/support/dktools/dktools/de/dkwt-help.txt
index ab50d7ced0..8d12a0aaca 100644
--- a/support/dktools/dktools/de/dkwt-help.txt
+++ b/support/dktools/dktools/de/dkwt-help.txt
@@ -198,5 +198,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-keep.txt b/support/dktools/dktools/de/dkwt-keep.txt
index a4789bbaf4..056fe0d6c5 100644
--- a/support/dktools/dktools/de/dkwt-keep.txt
+++ b/support/dktools/dktools/de/dkwt-keep.txt
@@ -38,5 +38,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-login.txt b/support/dktools/dktools/de/dkwt-login.txt
index f76556e901..3b11588ae3 100644
--- a/support/dktools/dktools/de/dkwt-login.txt
+++ b/support/dktools/dktools/de/dkwt-login.txt
@@ -51,5 +51,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-logout.txt b/support/dktools/dktools/de/dkwt-logout.txt
index 4adb7e06bc..85e09c3fc1 100644
--- a/support/dktools/dktools/de/dkwt-logout.txt
+++ b/support/dktools/dktools/de/dkwt-logout.txt
@@ -51,5 +51,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-print.txt b/support/dktools/dktools/de/dkwt-print.txt
index 3f351f8666..fa48af4bdc 100644
--- a/support/dktools/dktools/de/dkwt-print.txt
+++ b/support/dktools/dktools/de/dkwt-print.txt
@@ -33,5 +33,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-printers.txt b/support/dktools/dktools/de/dkwt-printers.txt
index 91b29b0275..3eabd5cf1a 100644
--- a/support/dktools/dktools/de/dkwt-printers.txt
+++ b/support/dktools/dktools/de/dkwt-printers.txt
@@ -33,5 +33,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-shutdown.txt b/support/dktools/dktools/de/dkwt-shutdown.txt
index a5927da0b8..6246a933a2 100644
--- a/support/dktools/dktools/de/dkwt-shutdown.txt
+++ b/support/dktools/dktools/de/dkwt-shutdown.txt
@@ -51,5 +51,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-unkeep.txt b/support/dktools/dktools/de/dkwt-unkeep.txt
index d679bc402e..1b4c116763 100644
--- a/support/dktools/dktools/de/dkwt-unkeep.txt
+++ b/support/dktools/dktools/de/dkwt-unkeep.txt
@@ -34,5 +34,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt-users.txt b/support/dktools/dktools/de/dkwt-users.txt
index 9432d74df3..a7560bdad0 100644
--- a/support/dktools/dktools/de/dkwt-users.txt
+++ b/support/dktools/dktools/de/dkwt-users.txt
@@ -37,5 +37,5 @@ zeigt die Lizenzbedingungen an.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/dkwt.str b/support/dktools/dktools/de/dkwt.str
index da80f6fa31..1375b4877c 100644
--- a/support/dktools/dktools/de/dkwt.str
+++ b/support/dktools/dktools/de/dkwt.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Attribute label: FUll user name
#
diff --git a/support/dktools/dktools/de/dkwx.str b/support/dktools/dktools/de/dkwx.str
index cdda8a3f08..47b0a6bd6e 100644
--- a/support/dktools/dktools/de/dkwx.str
+++ b/support/dktools/dktools/de/dkwx.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Log level: Worse than panic
#
@@ -42,4 +44,7 @@ Zu wenig Hauptspeicher!
# 10: Error: Help file not found!
#
Hilfe-Datei nicht gefunden!
-
+#
+# 11: Error: Failed to recode command line!
+#
+Recoding der Kommandozeile fehlgeschlagen!
diff --git a/support/dktools/dktools/de/dkwxpath.str b/support/dktools/dktools/de/dkwxpath.str
index a603707293..c71cf89f9a 100644
--- a/support/dktools/dktools/de/dkwxpath.str
+++ b/support/dktools/dktools/de/dkwxpath.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Program name
#
diff --git a/support/dktools/dktools/de/dkwxwiz.str b/support/dktools/dktools/de/dkwxwiz.str
index e57bf39b9a..f62f489dc1 100644
--- a/support/dktools/dktools/de/dkwxwiz.str
+++ b/support/dktools/dktools/de/dkwxwiz.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Program name.
#
diff --git a/support/dktools/dktools/de/dkwxwiz.txt b/support/dktools/dktools/de/dkwxwiz.txt
index f978764819..3c0f3bb0e4 100644
--- a/support/dktools/dktools/de/dkwxwiz.txt
+++ b/support/dktools/dktools/de/dkwxwiz.txt
@@ -75,7 +75,7 @@ und Lizenztyp festzulegen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
AUTOR
diff --git a/support/dktools/dktools/de/fig2lat.str b/support/dktools/dktools/de/fig2lat.str
index 8b2159b193..dc5ddf85f4 100644
--- a/support/dktools/dktools/de/fig2lat.str
+++ b/support/dktools/dktools/de/fig2lat.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 1: Invalid PS level preference value!
#
diff --git a/support/dktools/dktools/de/fig2lat.txt b/support/dktools/dktools/de/fig2lat.txt
index dfad2d9715..c8d697c974 100644
--- a/support/dktools/dktools/de/fig2lat.txt
+++ b/support/dktools/dktools/de/fig2lat.txt
@@ -261,5 +261,5 @@ SIEHE AUCH
X-Splines: A Spline Model Designed for the End-User
Proceedings of the SIGGRAPH 1995
-[fig2lat] http://dktools.sourceforge.net
+[fig2lat] http://sourceforge.net/p/dktools/wiki/fig2lat%20manual/
diff --git a/support/dktools/dktools/de/htmlbook.str b/support/dktools/dktools/de/htmlbook.str
index 7551a83305..7603df9c4e 100644
--- a/support/dktools/dktools/de/htmlbook.str
+++ b/support/dktools/dktools/de/htmlbook.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Title for impressum page
#
@@ -311,3 +313,33 @@ Syntax error, Wert fehlt!
Bisheriger Wert der Einstellung ``meta description'' überschrieben!
Bisheriger Wert der Einstellung ``meta keywords'' überschrieben!
Bisheriger Wert der Einstellung ``location'' überschrieben!
+#
+# 100 101
+#
+Syntax-Fehler, keine Hexadezimal-Zahl!
+Zahlenbereichsüberlauf, Maximalwert ist FFFFFF!
+#
+# 102
+#
+Syntax-Fehler, ungültiger DOCTYPE!
+#
+# 103
+#
+DOCTYPE wird überschrieben.
+#
+# 104
+#
+Datenschutz
+#
+# 105
+#
+Datenschutzerklärung
+#
+# 106
+#
+Seiteninhalt
+#
+# 107, 108
+#
+[anzeigen]
+[verbergen]
diff --git a/support/dktools/dktools/de/htmlbook.txt b/support/dktools/dktools/de/htmlbook.txt
index ad94361eef..1749e132df 100644
--- a/support/dktools/dktools/de/htmlbook.txt
+++ b/support/dktools/dktools/de/htmlbook.txt
@@ -311,7 +311,7 @@ Dateien im aktuellen Verzeichnis sein.
SIEHE AUCH
- http://dktools.sourceforge.net
+ http://sourceforge.net/p/dktools/wiki/Home/
AUTOR
diff --git a/support/dktools/dktools/de/itadmin.str b/support/dktools/dktools/de/itadmin.str
index 3c4ea48e3f..d063195c87 100644
--- a/support/dktools/dktools/de/itadmin.str
+++ b/support/dktools/dktools/de/itadmin.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Title for network documentation
#
@@ -93,27 +95,27 @@ Privatgeräte, für DHCP zugelassen
#
# 23:
#
-Dies ist ein Privatgerät ("`bring your own device"'), nicht Eigentum der
+Nicht von der Lizenzverwaltung betroffen.
#
# 24:
#
-Organisation bzw. Organisationseinheit.
+Dies ist ein privates Gerät (BYOD: bring your own device),
#
# 25:
#
-Dieser Computer gehört nicht zum Verantwortungsbereich der Organisationseinheit.
+Dieses Gerät gehört nicht zum
#
# 26:
#
-Er ist in Konfigurationsdateien und in der Netzwerkdokumentation aufgeführt,
+Verantwortungsbereich der Organisationseinheit. Es ist hier aufgeführt,
#
# 27:
#
-weil Computer der Organisationseinheit mit diesem Computer kommunizieren.
+weil Computer unserer Organisationseinheit mit dem Gerät kommunizieren.
#
# 28:
#
-IP-Adresse, die dynamisch verschiedenen Computern zugewiesen wird.
+Verantwortung für Software-Lizensierung liegt nicht bei Organisationseinheit.
#
# 29: Parent groups
#
@@ -125,7 +127,7 @@ Untergruppen
#
# 31: Additional network interface
#
-Zusätzliches Netzwerk-Interface an einem Computer.
+Nicht von der Lizenzverwaltung betroffen.
#
# 32: Member hosts for netgroups
#
@@ -959,3 +961,36 @@ Unzulässiger Kurnzname für Lizenztyp: "
# 309
#
Sensitiver Speicherbereich nicht zurückgesetzt!
+#
+# 310
+#
+nicht Eigentum der Organisation bzw. Organisationseinheit.
+#
+# 311/312
+#
+Diese IP-Adresse wird per DHCP dynamisch verschiedenen Geräten zugewiesen.
+Lizenzen sind dem jeweils richtigen PC-Namen zugeordnet.
+#
+# 313
+#
+Es handelt sich hier lediglich um eine zusätzliche Netzwerkschnittstelle.
+#
+# 314-317
+#
+UNUSED
+Netzwerkschnittstelle eines Gerätes, das kein Computer ist (z.B. Drucker,
+Web-Cam, Messgerät, Oszilloskop, Steuerung...). Eine Softwareinstallation, die
+Lizenzverwaltung erfordern würde, ist hier nicht möglich.
+#
+# 318-320
+#
+Reservierte IP-Adresse mit Hostnamen.
+Hostname und IP-Adresse werden noch nicht benutzt sondern wurden nur vorab
+reserviert.
+#
+# 321 Retired, device no longer in use.
+#
+Ausgesondert, dieses Gerät wird nicht mehr benutzt.
+#
+#
+#
diff --git a/support/dktools/dktools/de/lprngcl.str b/support/dktools/dktools/de/lprngcl.str
index aaffda5d4c..ed4e0efda2 100644
--- a/support/dktools/dktools/de/lprngcl.str
+++ b/support/dktools/dktools/de/lprngcl.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 ERROR: Failed to set up signal handlers!
#
diff --git a/support/dktools/dktools/de/lprngcl.txt b/support/dktools/dktools/de/lprngcl.txt
index 1edd5e39cb..10f6f63faa 100644
--- a/support/dktools/dktools/de/lprngcl.txt
+++ b/support/dktools/dktools/de/lprngcl.txt
@@ -66,5 +66,5 @@ to see the license conditions.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/pjsnmp.str b/support/dktools/dktools/de/pjsnmp.str
index 7fa8812a69..5e1e701bcf 100644
--- a/support/dktools/dktools/de/pjsnmp.str
+++ b/support/dktools/dktools/de/pjsnmp.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# NOTE: Status messages from pjsnmp are shown by lpq as Filter_Status
# lines. The lpq program or equivalents are run not only on the print
diff --git a/support/dktools/dktools/de/plpdftex.str b/support/dktools/dktools/de/plpdftex.str
index bb4c915f76..8da6db7bb7 100644
--- a/support/dktools/dktools/de/plpdftex.str
+++ b/support/dktools/dktools/de/plpdftex.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Program name
#
diff --git a/support/dktools/dktools/de/plpdftex.txt b/support/dktools/dktools/de/plpdftex.txt
new file mode 100644
index 0000000000..76583d7b53
--- /dev/null
+++ b/support/dktools/dktools/de/plpdftex.txt
@@ -0,0 +1,214 @@
+NAME
+
+ plpdftex - Plotten in PDF/TeX- oder EPS/TeX-Dateipaar
+
+SYNOPSIS
+
+ plpdftex
+ plpdftex --check-presence
+ plpdftex --help
+ plpdftex --manual
+ plpdftex --license
+
+BESCHREIBUNG
+
+Das Programm verarbeitet die Standardeingabe und erzeugt ein Dateipaar,
+entweder PDF/TeX oder EPS/TeX. Graphikelemente werden in die PDF- bzw.
+EPS-Datei geschrieben. Die TeX-Datei schließt die Graphikdatei per
+include-Anweisung ein und setzt Text-Labels darüber.
+
+Dieses Programm ist nicht zur direkten Benutzung gedacht, es ist ein
+Ausgabtreiber für das octpgfpl-Package für GNU Octave.
+
+OPTIONEN
+
+--help Kurzen Hilfetext anzeigen.
+
+--version Versionsnummer anzeigen.
+
+--license Lizenzbedingungen anzeigen.
+
+--check-presence Vorhandensein des Programmes prüfen, das Programm
+ gibt eine 1 auf die Standardausgabe aus und beendet
+ sich mit Exit-Status 0.
+ Diese Option wird vom octpgfpl-Paket verwendet, um
+ zu prüfen, ob plpdftex verfügbar ist.
+
+EXIT-STATUS
+
+0 bei Erfolg, alle anderen Werte bedeuten Fehler.
+
+EINGABEDATEI
+
+Die Eingabe wird über die Standardeingabe bezogen.
+
+Die erste Zeile gibt die Kombination der beiden Dateinamen an.
+Wird als Dateiendung ``.pdftex'' angegeben, werden eine *.pdf-Datei
+und eine *.tex-Datei erzeugt für den Einschluss mit include
+in ein LaTeX-Dokument.
+Wird als Dateiendung ``.pdftexs'' verwendet, wird die *.tex so erstellt,
+dass sie direkt mit pdflatex verarbeitet werden kann.
+Mit der Dateiendung ``.epstex'' wird eine *.eps-Datei und eine *.tex-Datei
+erzeugt.
+
+Die zweite Zeile enthält zwei Ganzzahl-Werte, durch Leerzeichen
+getrennt: Bildbreite und -höhe in PS Points (Einheit bp in LaTeX).
+
+Die restlichen Zeilen beschreiben das Bild. Zeilen mit ``t''
+am Anfang beziehen sich auf Text, Zeilen mit ``p'' am Anfang
+auf die Graphikausgabe.
+Hier ein paar Beispielzeilen:
+
+t fs 12
+t font-setup \usepackage[T1]{fontenc}
+t package \usepackage[intlimit]{amsmath}
+t preamble \DeclareMathOperator{\intd}{\text{d}}
+t text 10 20 base left black This is a test.
+t text-box 10 20 base left red This is another test.
+p gsave
+p grestore
+p lw 3
+p buttcap
+p miterjoin
+p nodash
+p stroke-color blue!50!black
+p fill-color red!80!white
+p prepare-stroke
+p prepare-fill
+p rectangle 5 5 200 80
+p circle 20 30 5
+p moveto 30 80
+p lineto 50 90
+p curveto 50 100 100 100 100 90
+p closepath
+p stroke
+p fill
+p clip
+
+Zeilen mit den Kommandos ``t fs'', ``t font-setup'', ``t package''
+und ``t preamble'' werden nur benutzt, wenn eine PDF/TeX-Kombination
+zur direkten Verarbeitung mit pdflatex erzeugt wird.
+
+``t fs'' gibt die Schriftgröße für die documentclass-Zeile an. Diese
+Angabe ist optional, standardmäßig wird eine Schriftgröße in der
+Dokumentklasse angegeben.
+
+``t font-setup'' enthält usepackage-Anweisungen und andere Anweisungen
+für das Font-Setup. Diese Angaben sind optional. Fehlen sie, wird ein
+Standard-Font-Setup verwendet.
+
+``t package'' dient zur Auswahl weiterer Pakete. Auch diese Angaben sind
+optional. Fehlen sie, wird ein vorgegebener Satz Pakete verwendet.
+
+``t preamble'' legt weitere Instruktionen fest, die in die Preamble
+übernommen werden.
+
+``t text''-Zeilen erzeugen Text-Labels. Die Zeile enthält
+ - X-Position,
+ - Y-Position,
+ - vertikale Ausrichtung (bottom, base, centered, top),
+ - horizontale Ausrichtung (left, centered, right),
+ - Farbe und
+ - anzuzeigenden Text.
+Farbe wird dabei LaTeX-gerecht angegeben, z.B.: ``blue!50!black''.
+
+``t text-box''-Zeilen erzeugen analog dazu Text-Labels mit Rahmen.
+
+``p gsave'' sichert den aktuellen Zustand des Graphikinterpreters.
+
+``p grestore'' stellt den gesicherten Zustand des Graphikinterpreters
+wieder her.
+
+``p lw'' setzt die Linienbreite in bp.
+
+``p buttcap'' setzt den Stil für Linienenden auf butted.
+
+``p miterjoin'' setzt den Stil für Knickpunkte auf mitered.
+
+``p nodash'' setzt den Linienstil auf durchgehende Linien.
+
+``p stroke-color'' setzt die Zeichenfarbe.
+
+``p fill-color'' setzt die Füllfarbe (non-stroking color).
+
+``p prepare-stroke'' teilt plpdftex mit, dass der nächste Graphikpfad
+als Linie zu zeichnen ist.
+
+``p prepare-fill'' teilt plpdftex mit, dass der nächste Graphikpfad
+gefüllt werden soll.
+
+``p rectangle'' erstellt einen Rechteck-Pfad, angegeben werden folgende
+Koordinaten:
+ - linke x-Position,
+ - untere y-Position,
+ - rechte x-Position,
+ - obere y-Position.
+
+``p circle'' erstellt einen Kreis-Pfad, angegeben werden folgende Koordinaten:
+ - x-Position Mittelpunkt,
+ - y-Position Mittelpunkt,
+ - Radius.
+
+``p moveto'' beginnt einen neuen Pfad an der angegebenen Position
+(x- und y-Koordinate) und stellt diese Position als aktuellen Punkt ein.
+
+``p lineto'' fügt ein Liniensegment zum aktuellen Pfad vom aktuellen
+Punkt zur angegebenen Position hinzu und verschiebt den aktuellen Punkt.
+
+
+``p curveto'' fügt dem aktuellen Pfad ein Bezier-Segment vom aktuellen
+Punkt über zwei Kontrollpunkte zu einem Zielpunkt hinzu und setzt
+den Zielpunkt als aktuellen Punkt.
+
+adds a Bezier segment starting at the current position
+to the path. Specify x and y position of the first control point,
+x and y position of the second control point and x and y position
+of the final point.
+
+``p closepath'' schließt den aktuellen Pfad.
+
+``p stroke'' zeichnet den aktuellen Pfad als Linie.
+
+``p fill'' füllt den aktuellen Pfad.
+
+``p clip'' verwendet den aktuellen Pfad für Clipping.
+
+
+AUSGABEDATEI(EN)
+
+Der Name der Ausgabedatei(en) wird aus dem in der ersten Zeile angegebenen
+Dateinamen gebildet.
+
+HINWEISE
+
+Es werden bei weitem nicht alle Features von PDF/TeX oder EPS/TeX
+unterstützt, nur die für den Betrieb als Ausgabetreiber für das
+octpgfpl-Paket benötigten.
+
+EINSCHRÄNKUNGEN
+
+Farbangaben dürfen nur die Farbnamen ``white'', ``black'', ``red'', ``green'',
+``blue'', ``cyan'', ``magenta'', ``yellow'', ``gray'', ``lightgray'',
+``darkgray'', ``brown'', ``lime'', ``olive'', ``orange'', ``pink'', ``purple'',
+``teal'', ``violet'' und Kombinationen wie ``red!50!black'' enthalten.
+
+The color definitions mentioned above are used ``as is'' in the *.tex
+output files. For PDF and EPS output RGB values are used.
+
+Diese Farbangaben werden in *.tex-Dateien unverändert verwendet,
+in PDF-/EPS-Dateien werden RGB-Farben benutzt.
+
+AUTHOR
+
+Dirk Krause
+
+COPYRIGHT UND LIZENZ
+
+Mit
+ plpdftex --license
+können die Lizenzbedingungen angezeigt werden.
+
+SIEHE AUCH
+
+http://sourceforge.net/p/dktools/wiki/Home/
+http://sourceforge.net/p/octpgfpl/wiki/Home/
diff --git a/support/dktools/dktools/de/printqd.str b/support/dktools/dktools/de/printqd.str
index 3528623e61..277b938a45 100644
--- a/support/dktools/dktools/de/printqd.str
+++ b/support/dktools/dktools/de/printqd.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 The string table name.
#
diff --git a/support/dktools/dktools/de/printqda.str b/support/dktools/dktools/de/printqda.str
index f447633f6f..264b304615 100644
--- a/support/dktools/dktools/de/printqda.str
+++ b/support/dktools/dktools/de/printqda.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 Name of localized message texts file.
#
diff --git a/support/dktools/dktools/de/printqdc.str b/support/dktools/dktools/de/printqdc.str
index ec5a41c8a8..b3bd89044f 100644
--- a/support/dktools/dktools/de/printqdc.str
+++ b/support/dktools/dktools/de/printqdc.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 String table file name
#
diff --git a/support/dktools/dktools/de/printqdi.str b/support/dktools/dktools/de/printqdi.str
index 075c39e066..3c3424acc4 100644
--- a/support/dktools/dktools/de/printqdi.str
+++ b/support/dktools/dktools/de/printqdi.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0
#
diff --git a/support/dktools/dktools/de/winprint.str b/support/dktools/dktools/de/winprint.str
index f7c493864a..a95cd8e454 100644
--- a/support/dktools/dktools/de/winprint.str
+++ b/support/dktools/dktools/de/winprint.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Menu "File"
#
diff --git a/support/dktools/dktools/de/wprclean.str b/support/dktools/dktools/de/wprclean.str
index a2a553cd58..196ef0803c 100644
--- a/support/dktools/dktools/de/wprclean.str
+++ b/support/dktools/dktools/de/wprclean.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0 1
#
diff --git a/support/dktools/dktools/de/wprclean.txt b/support/dktools/dktools/de/wprclean.txt
index f2a6ce9b5a..adeddb7892 100644
--- a/support/dktools/dktools/de/wprclean.txt
+++ b/support/dktools/dktools/de/wprclean.txt
@@ -62,5 +62,5 @@ werden die Lizenzbedingungen angezeigt.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/de/wxbmpp.str b/support/dktools/dktools/de/wxbmpp.str
index 5fb653b329..80c26df12e 100644
--- a/support/dktools/dktools/de/wxbmpp.str
+++ b/support/dktools/dktools/de/wxbmpp.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Program name
#
diff --git a/support/dktools/dktools/de/wxbmpp4.str b/support/dktools/dktools/de/wxbmpp4.str
new file mode 100644
index 0000000000..c09c698d0f
--- /dev/null
+++ b/support/dktools/dktools/de/wxbmpp4.str
@@ -0,0 +1,341 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0: Menu "File"
+#
+Datei
+#
+# 1: Menu item "File/Quit"
+#
+Beenden
+#
+# 2: Tool tip text for menu item "File/Exit"
+#
+Anwendung beenden
+#
+# 3: Menu "Help"
+#
+Hilfe
+#
+# 4: Menu item "Help/About"
+#
+Ãœber...
+#
+# 5: Tooltip text for menu item "Help/About"
+#
+Versionsinformationen anzeigen
+#
+# 6: Menu item "Help/Contents"
+#
+Inhalt
+#
+# 7: Tooltip text for menu item "Help/Contents"
+#
+Inhaltsverzeichnis der Online-Hilfe öffnen
+#
+# 8: Initial status text
+#
+Bereit
+#
+# 9: Copyright notice.
+#
+Copyright (c)
+#
+# 10: Dialog box title "About ..."
+#
+Ãœber
+#
+# 11: This program uses the following libraries
+#
+Dieses Program benutzt die folgenden Bibliotheken:
+#
+# 12: See
+#
+Siehe:
+#
+# 13-14 Make mode
+#
+Make-Mode
+Unnötige Konvertierungen vermeiden
+#
+# 15-16 Label and tip for checkbox color
+#
+Farbe
+Farbige Ausgabe erzeugen
+#
+# 17 Label for output type
+#
+Ausgabe:
+#
+# 18-23 Output type choices
+#
+PDF-Objekt
+PDF-Bild
+PDF-Dokument
+EPS-Bild
+PS-Bild
+PS-Dokument
+#
+# 24 Tip for output type choice
+#
+Dateityp und Verwendungszweck für die Ausgabe festlegen
+#
+# 25-26 Label and tip for image interpolation checkbox
+#
+Interpolation
+Image-Interpolation-Flag setzen
+#
+# 27 Label for PS level
+#
+PS-Level:
+#
+# 28-30 PS level choices and tip
+#
+2
+3
+PS-Level festlegen
+#
+# 31-32 Label and tip for DSC checkbox
+#
+DSC
+DSC-Kommentare in die PS-Ausgabe schreiben
+#
+# 33-34 Label and tip for LZW compression
+#
+LZW
+LZW-Komprimierung in PS-Ausgabe (Level 2) erlauben
+#
+# 35-36 Label and tip for DCT data checkbox
+#
+JPEG DCT-Daten
+DCT-komprimierte Daten aus JPEG-Dateien direkt verwenden
+#
+# 37-38 Label and tip for paper size choice
+#
+Papierformat:
+Papierformat festlegen
+#
+# 39-40 Label and tip for rotation checkbox
+#
+Drehung
+Drehung des Bildes zulassen, um Seite besser zu füllen
+#
+# 41-42 Label and tip for DCT data interpolation checkbox
+#
+Interpolation für DCT-Daten
+Image-Interpolation-Flag auch bei direkter Verwendung von DCT-Daten setzen
+#
+# 43-47 Choices and tip for finishing choice
+#
+Fertigstellung:
+einseitig
+duplex
+duplex+tumble
+Einseitigen oder zweiseitigen Druck auswählen
+#
+# 48-49 Label and tip for analyze bit depth checkbox
+#
+Analysiere Bitbreite
+Verringerung der Bitbreite, falls ohne Qualitätsverlust möglich
+#
+# 50-54 Label, tip and choices for resolution handling checkbox
+#
+Auflösung:
+Verwendung der Auflösung festlegen
+aus Eingabedatei
+ignorieren
+festlegen
+#
+# 55 Initial resolution value
+#
+72.0
+#
+# 56 Empty line
+#
+
+#
+# 57-58 Label and tip for analyze colors checkbox
+#
+Analysiere Farben
+Grau-Ausgabe erzeugen, falls alle Pixel grau sind
+#
+# 59-62 Label and tip for bg color selector and bg enforce checkbox
+#
+Hintergrund:
+Standard-Hintergrundfarbe auswählen
+Hintergrund forcieren
+Ausgewählten Hintergrund auch verwenden, wenn Eingabedatei Hintergrund festlegt
+#
+# 63-64 Label and tip for analyze alpha checkbox
+#
+Analysiere Transparenz
+Alpha-Kanal ignorieren, wenn alle Pixel volle Deckungskraft haben
+#
+# 65-66 Label and tip for choose directory menu item and button
+#
+Verzeichnis auswählen
+Verzeichnis mit den Bildern für die Konvertierung auswählen
+#
+# 67-69 Label and tip for conversion menu and menu item
+#
+Konvertierung
+Starten
+Konvertierungsvorgang starten
+#
+# 70 Text for directory label
+#
+Noch kein Verzeichnis gewählt!
+#
+# 71 Title for directory selection box
+#
+Verzeichnis wählen
+#
+# 72 Text for menu extras
+#
+Extras
+#
+# 73 Label for menu item
+#
+Optionen zurücksetzen
+#
+# 74-75 Message box texts for "are you sure" dialog box
+#
+Optionen zurücksetzen - Sind Sie sicher?
+Wollen Sie wirklich alle Optionen auf Standardwerte zurücksetzen?
+#
+# 76-88 Color to grayscale method names
+#
+Luma BT.601
+Luma kurz
+Luma BT.709
+Schnell
+Schneller
+Mittelwert
+Entsättigung
+Dekomposition (min)
+Dekomposition (med)
+Dekomposition (max)
+Rot
+Grün
+Blau
+#
+# 89-90 Label and tip for rgb to gray conversion choice
+#
+RGB zu grau:
+Methode für die Konvertierung von RGB zu grau festlegen
+#
+# 91-92 Texts for summary label
+#
+Erfolg, Anwendung wird beendet.
+Fehler, Anwendung wird beendet.
+#
+# 93-95 Processing stages
+#
+Lese Eingabedatei.
+Erzeuge Ausgabe.
+Schreibe Ausgabe in Datei.
+#
+# 96-97 Label and tip for cancel button in progress dialog
+#
+Abbrechen
+Konvertierungsvorgang abbrechen
+#
+# 98 Title for progress dialog
+#
+Fortschritt
+#
+# 99 ERROR: Memory
+#
+Zu wenig speicher!\n
+#
+# 100 ERROR: No files found in directory
+#
+Keine Dateien im Verzeichnis!\n
+#
+# 101 File processing stage: Finished processing.
+#
+Fertig.
+#
+# 102 Title for error message boxes
+#
+Fehler
+#
+# 103 Error message
+#
+Interner Fehler (Bug): Kein Argument argv[0] gefunden!
+#
+# 104 Error message
+#
+Interner Fehler (Bug): Name der Anwendungsgruppe nicht gefunden!
+#
+# 105 Error message
+#
+Unzulässige Zeichen in Language/Options-Angabe!
+#
+# 106 Error message
+#
+Kommandozeilen-Argumente konnten nicht verarbeitet werden!
+#
+# 107 Error message
+#
+Zu viele Papierformate konfiguriert!
+#
+# 108 Error message
+#
+Unzulässige Zeichen in Namen für Papierformate!
+#
+# 109 Error message
+#
+Interner Fehler (Bug): Papierformat ohne Namen!
+#
+# 110 Error message
+#
+Informationen zu Papierformaten nicht gefunden!
+#
+# 111 Error message
+#
+Papierformat unsinnig konfiguriert!
+#
+# 112 Error message
+#
+Zu wenig Speicher (RAM)!\n
+#
+# 113 Error message
+#
+:\nFEHLER: Unzulässige Zeichen in Dateinamen!\n
+#
+# 114 Error message
+#
+:\nFEHLER: Dateiname zu lang!\n
+#
+# 115 Error message
+#
+:\nFEHLER: Leeres Verzeichnis!\n
+#
+# 116 Error message
+#
+:\nFEHLER: Nicht genug Speicher!\n
+#
+# 117 Error message
+#
+:\nFEHLER: Bild konnte nicht aus Eingabedatei gelesen werden!\n
+#
+# 118 Error message
+#
+:\nFEHLER: Graphikausgabe konnte nicht erzeugt werden!\n
+#
+# 119 Error message
+#
+:\nFEHLER: Frame konnte nicht eingestellt werden!\n
+#
+# 120 Error message
+#
+:\nFEHLER: Graphikausgabe konnte nicht in Datei geschrieben werden!\n
+#
+# 121 Error message
+#
+Abbruch durch den Benutzer.
+#
+# 122 Tip for menu item
+#
+Alle Einstellungen auf Standardwerte zurücksetzen
diff --git a/support/dktools/dktools/de/wxd2lat.str b/support/dktools/dktools/de/wxd2lat.str
new file mode 100644
index 0000000000..be033e3e2c
--- /dev/null
+++ b/support/dktools/dktools/de/wxd2lat.str
@@ -0,0 +1,487 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0 Newline
+#
+\n
+#
+# 1-2 Signal handling
+#
+Installation der Signal-Handler fehlgeschlagen!
+Wiederherstellung der Signal-Handler fehlgeschlagen!
+#
+# 3 Info: Destination files are up to date.
+#
+Ausgabedateien sind auf aktuellem Stand.
+#
+# 4 Error: Not a wxd file!
+#
+Keine WXD-Datei!
+#
+# 5 Progress: Start processing directory.
+#
+Verzeichnis wird bearbeitet.
+#
+# 6 Progress: Finished processing directory.
+#
+Verzeichnis wurde bearbeitet.
+#
+# 7 Error: Failed to chdir into directory!
+#
+Wechsel in das Verzeichnis nicht möglich!
+#
+# 8 Error: Failed to find current directory!
+#
+Aktuelles Verzeichnis konnte nicht ermittelt werden!
+#
+# 9 Progress: Destination files are up to date.
+#
+Ausgabedateien sind auf aktuellem Stand.
+#
+# 10 Progress: Skipping non-wxd file.
+#
+Nicht-WXD-Datei wird übersprungen.
+#
+# 11 Error: Failed to construct full path name!
+#
+Vollständiger Pfadname konnte nicht gebildet werden!
+#
+# 12 Error: Failed to change back to original directory!
+#
+Wechsel zurück in Original-Verzeichnis fehlgeschlagen!
+#
+# 13 Error: Failed to construct absolute path!
+#
+Absoluter Pfadname konnte nicht gebildet werden!
+#
+# 14 Error: Not a regular file!
+#
+Keine reguläre Datei!
+#
+# 15 Error: No such file!
+#
+Datei nicht vorhanden!
+#
+# 16 Progress: Start processing file name pattern.
+#
+Namensmuster wird bearbeitet.
+#
+# 17 Progress: Finished processing file name pattern.
+#
+Namensmuster wurde bearbeitet.
+#
+# 18 19 Error: Unknown unit name!
+#
+Unbekannte Einheit "
+"!
+#
+# 20 21 Error: Failed to read number!
+#
+Kein Zahlenwert: "
+"!
+#
+# 22 23 Error: Not a floating point number
+#
+Syntax, keine Gleitkommazahl: "
+"!
+#
+# 24 Error: Positive length required for arrowhead!
+#
+Länge einer Pfeilspitze muss größer als 0 sein!
+#
+# 25 Error: Positive width required for arrowhead!
+#
+Breite einer Pfeilspitze muss größer als 0 sein!
+#
+# 26 Error: Positive length and width required for arrowhead!
+#
+Länge und Breite einer Pfeilspitze müssen größer als 0 sein!
+#
+# 27 Error: Positive line width required for arrowhead!
+#
+Liniendicke muss größer als 0 sein!
+#
+# 28 Error: Failed to calculate arrowhead angle!
+#
+Winkelberechnung für Pfeilspitze fehlgeschlagen!
+#
+# 29 Error: Illegal arrow type!
+#
+Unzulässiger Typ für Pfeilspitze!
+#
+# 30 Error: Mathematical overflow in arrow calculation!
+#
+Zahlenbereichsüberlauf in Berechnung einer Pfeilspitze!
+#
+# 31 Error: Iteration failed in arrow calculation!
+#
+Iteration fehlgeschlagen in Berechnung einer Pfeilspitze!
+#
+# 32 Error: Memory allocation failed in arrow calculation!
+#
+Speicheranforderung fehlgeschlagen in Berechnung einer Pfeilspitze!
+#
+# 33 Error: Failed to calculate number of points for arrow!
+#
+Anzahl der Punkte für Pfeilspitze konnte nicht ermittelt werden!
+#
+# 34 Error: Mathematical error in arrow calculation!
+#
+Mathematisches Problem in Berechnung einer Pfeilspitze!
+#
+# 35 Error: Arrowhead calculation on spline failed!
+#
+Pfeilspitzenberechnung an Spline fehlgeschlagen!
+#
+# 36 Error: Mathematical overflow in width/height calculation
+#
+Zahlenbereichsüberlauf bei Bestimmung Höhe/Breite!
+#
+# 37 Error: File name too long!
+#
+Dateiname zu lang!
+#
+# 38 Error: Failed to clip region!
+#
+Fehler bei Einrichtung der Clip-Region!
+#
+# 39 Error: X-spline calculation failed!
+#
+X-Spline-Berechnung fehlgeschlagen!
+#
+# 40 Error: Failed to write text!
+#
+Textausgabe fehlgeschlagen!
+#
+# 41 Error: Failed to set fill colour!
+#
+Festlegung der Füllfarbe fehlgeschlagen!
+#
+# 42 Error: UTF-8 decoding failed!
+#
+UTF-8-Dekodierung fehlgeschlagen!
+#
+# 43 Error: Failed to create graphics object!
+#
+Graphikobjekt konnte nicht erstellt werden!
+#
+# 44 Error: Failed to create forward arrowhead!
+#
+Fehler beim Anlegen einer Pfeilspitze vorwärts!
+#
+# 45 Error: Failed to create backward arrowhead!
+#
+Fehler beim Anlegen einer Pfeilspitze rückwärts!
+#
+# 46 Info: Line width 0, skipping object.
+#
+Ignoriere Objekt mit Linienbreite 0.
+#
+# 47 Error: Failed to create filled circle!
+#
+Erzeugung eines gefüllten Kreises fehlgeschlagen!
+#
+# 48 Error: Failed to set up filling!
+#
+Füllfarbe konnte nicht festgelegt werden!
+#
+# 49 Error: Failed to set up filling and stroking!
+#
+Einstellungen für Füllen und Zeichnen fehlgeschlagen!
+#
+# 50 Error: Failed to stroke path!
+#
+Zeichnen des Pfades fehlgeschlagen!
+#
+# 51 Error: Failed to set up stroking!
+#
+Einstellungen zum Zeichnen fehlgeschlagen!
+#
+# 52 Error: Failed to add bitmap image!
+#
+Bitmap-Bild konnte nicht eingefügt werden!
+#
+# 53 Error: Not a supported bitmap image type!
+#
+Kein unterstützter Bitmap-Typ!
+#
+# 54 Error: Failed to UTF-8 decode file name!
+#
+UTF-8-Dekodierung des Dateinamens fehlgeschlagen!
+#
+# 55 Error: Font size 0!
+#
+Schriftgröße 0 ist unzulässig!
+#
+# 56 Error: No text available!
+#
+Kein Text angegeben!
+#
+# 57 Error: First segment too short for arrowhead!
+#
+Erstes Segment zu kurz für Pfeilspitze!
+#
+# 58 Error: Final segment too short for arrowhead!
+#
+Letztes Segment zu kurz für Pfeilspitze!
+#
+# 59 Error: Too few points!
+#
+Zu wenig Punkte!
+#
+# 60 Error: No points for object!
+#
+Keine Punkte für Objekt angegeben!
+#
+# 61 Error: Spline too short for arrowheads!
+#
+Spline zu kurz für Pfeilspitzen!
+#
+# 62 Error: Forward arrowhead too long!
+#
+Pfeilspitze vorwärts zu lang!
+#
+# 63 Error: Backward arrowhead too long!
+#
+Pfeilspitze rückwärts zu lang!
+#
+# 64 Error: Arc too short for arrowheads!
+#
+Kreisbogen zu kurz für Pfeilspitzen!
+#
+# 65 Error: Radius must not be 0!
+#
+Radius 0 ist unzulässig!
+#
+# 66 Error: Box radius too large!
+#
+Box-Radius zu groß!
+#
+# 67 Error: Diameter must not be 0!
+#
+Durchmesser 0 ist unzulässig!
+#
+# 68 Error: Positive width and height required!
+#
+Breite und Höhe müssen größer als 0 sein!
+#
+# 69 Error: File name for image required!
+#
+Dateiname für Bild fehlt!
+#
+# 70 Error: Illegal object type!
+#
+Unzulässiger Objekt-Typ!
+#
+# 71 Error: Object check failed!
+#
+Überprüfung des Objektes fehlgeschlagen!
+#
+# 72 Error: Failed to write graphics object!
+#
+Graphikobjekt konnte nicht erzeugt werden!
+#
+# 73 Error: Forward arrowhead calculation failed!
+#
+Berechnung der Pfeilspitze vorwärts fehlgeschlagen!
+#
+# 74 Error: Backward arrowhead calculation failed!
+#
+Berechnung der Pfeilspitze rückwärts fehlgeschlagen!
+#
+# 75 Error: Spline segment calculation failed!
+#
+Berechnung eines Spline-Segmentes fehlgeschlagen!
+#
+# 76 Error: Failed to open output file(s)!
+#
+Datei konnte nicht geöffnet werden!
+#
+# 77 Error: Failed to write output!
+#
+Ausgabe konnte nicht geschrieben werden!
+#
+# 78 Error: Skipping output due to previous errors!
+#
+Keine Ausgabe wegen vorangegangener Fehler!
+#
+# 79 Error: Segment length calculation failed!
+#
+Berechnung einer Segmentlänge fehlgeschlagen!
+#
+# 80 Error: Cut calculation for arrowhead failed!
+#
+Verkürzungsberechnung für Pfeilspitze fehlgeschlagen!
+#
+# 81 Error: Memory allocation failed!
+#
+Nicht ausreichend Hauptspeicher!
+#
+# 82 83 Error: Not an 8-bit unsigned number!
+#
+Keine vorzeichenlose 8-Bit-Zahl: "
+"!
+#
+# 84 85 Error: Not an 8-bit number!
+#
+Keine 8-Bit-Zahl: "
+"!
+#
+# 86 87 Error: Not a 16-bit unsigned number!
+#
+Keine vorzeichenlose 16-Bit-Zahl: "
+"!
+#
+# 88 89 Error: Not a 16-bit number!
+#
+Keine 16-Bit-Zahl: "
+"!
+#
+# 90 91 Error: Not a 32-bit unsigned number!
+#
+Keien vorzeichenlose 32-Bit-Zahl: "
+"!
+#
+# 92 93 Error: Not a 32-bit number!
+#
+Keine 32-Bit-Zahl: "
+"!
+#
+# 94 Warning: File format version newer than reader module!
+#
+Dateiformat-Version neuer als Einlesemodul!
+#
+# 95 Error: Illegal bounding box!
+#
+Syntax, Höhe/Breite 0 für Bounding-Box unzulässig!
+#
+# 96 Error: Invalid number of texts in line!
+#
+Syntax, falsche Anzahl Einträge in Zeile!
+#
+# 97 Error: Base line width must be positive!
+#
+Syntax, Basislinienbreite muss größer als 0 sein!
+#
+# 98 Error: Too few numbers in line!
+#
+Syntax, zu wenig Werte in Zeile!
+#
+# 99 Warning: Line style corrected.
+#
+Syntax, Linienstil wurde korrigiert.
+#
+# 100 Warning: Style length corrected.
+#
+Syntax, Stil-Wert wurde korrigiert.
+#
+# 101 Warning: Cap style corrected.
+#
+Syntax, Linienende wurde korrigiert.
+#
+# 102 Warning: Join style corrected.
+#
+Syntax, Eckpunktstil wurde korrigiert.
+#
+# 103 Warning: Miter limit corrected.
+#
+Syntax, Miterlimit wurde korrigiert.
+#
+# 104 105 Warning: Arrow type corrected.
+#
+Syntax, Pfeilspitzentyp vorwärts wurde korrigiert.
+Syntax, Pfeilspitzentyp rückwärts wurde korrigiert.
+#
+# 106 107 Warning: Arrow length corrected.
+#
+Syntax, Pfeilspitzenlänge vorwärts wurde korrigiert.
+Syntax, Pfeilspitzenlänge rückwärts wurde korrigiert.
+#
+# 108 109 Warning: Arrow width corrected.
+#
+Syntax, Pfeilspitzenbreite vorwärts wurde korrigiert.
+Syntax, Pfeilspitzenbreite rückwärts wurde korrigiert.
+#
+# 110 Warning: Fill style corrected.
+#
+Syntax, Füllstil wurde korrigiert.
+#
+# 111 Error: Closing too many groups!
+#
+Syntax, zu viele Gruppen wurden beendet!
+#
+# 112 Error: Opening too many groups!
+#
+Syntax, zu viele Gruppen wurden geöffnet!
+#
+# 113 Warning: Skipping object!
+#
+Objekt wird übersprungen!
+#
+# 114 Error: Illegal object type!
+#
+Syntax, unzulässiger Objekttyp!
+#
+# 115 Error: Missing object type!
+#
+Syntax, Objekttyp fehlt!
+#
+# 116 Warning: Font index corrected.
+#
+Syntax, Schriftart-Index wurde korrigiert.
+#
+# 117 Warning: Text align corrected.
+#
+Syntax, Textausrichtung wurde korrigiert.
+#
+# 118 Warning: s parameter corrected.
+#
+Syntax, Parameter s wurde korrigiert.
+#
+# 119 Warning: Radius corrected.
+#
+Syntax, Radius wurde korrigiert.
+#
+# 120 Warning: Very small radius.
+#
+Syntax, ungewöhnlich kleiner Radius.
+#
+# 121 Warning: RGB to gray conversion method corrected.
+#
+Syntax, Methode für RGB-zu-Grau-Wandlung wurde korrigiert.
+#
+# 122 Error: Invalid image dimensions!
+#
+Syntax, ungültige Bildabmessungen!
+#
+# 123 Warning: Dot diameter corrected.
+#
+Syntax, Punktdurchmesser wurde korrigiert.
+#
+# 124 Warning: Dot line width corrected.
+#
+Syntax, Punktlinienbreite wurde korrigiert.
+#
+# 125 Error: Empty export text!
+#
+Syntax, Export-Text fehlt!
+#
+# 126 Error: Empty file name!
+#
+Syntax, Dateiname fehlt!
+#
+# 127 Error: Object start line expected!
+#
+Syntax, Startzeile für neues Objekt erwartet!
+#
+# 128 Error: Details line expected!
+#
+Syntax, Folgezeile mit Details erwartet!
+#
+# 129 Warning: Screen text expected!
+#
+Syntax, Bildschirm-Text erwartet!
+#
+# 130 Error: Unexpected end of file!
+#
+Syntax, unerwartetes Dateiende!
diff --git a/support/dktools/dktools/de/wxd2lat.txt b/support/dktools/dktools/de/wxd2lat.txt
new file mode 100644
index 0000000000..39d1de7d15
--- /dev/null
+++ b/support/dktools/dktools/de/wxd2lat.txt
@@ -0,0 +1,194 @@
+
+BEZEICHNUNG
+
+wxd2lat - Konverter von *.wxd nach LaTeX
+
+ÃœBERSICHT
+
+wxd2lat [Optionen] [Pfad(e)]
+
+BESCHREIBUNG
+
+Das Programm wxd2lat wandelt *.wxd-Dateien, die mit wxdkdraw erzeugt bzw.
+bearbeitet wurden, in Dateiformate für LaTeX.
+
+Es werden die auf der Kommandozeile angegebenen Pfade verarbeitet, falls
+vorhanden. Für *.wxd-Dateien werden Ausgabedateien bzw. Ausgabedateipaare
+erzeugt. Der Stammname der verarbeiteten Eingabedatei wird beibehalten,
+die Ausgabedateien erhalten die Endungen *.tex, *.pdf oder *.eps.
+Wurden Verzeichnisse als Pfade angegeben, werden die Verzeichnisse durchsucht
+und alle gefundenen *.wxd-Dateien werden verarbeitet.
+Wurden keine Pfade angegeben, wird das aktuelle Verzeichnis durchsucht, alle
+hier gefundenen *.wxd-Dateien werden verarbeitet.
+
+Als Ausgabe können die folgenden Dateien bzw. Dateikombinationen erzeugt
+werden:
+
+- PDF+TeX
+ Es wird eine *.pdf- und eine *.tex-Datei erstellt.
+ Die PDF-Datei enthält die Nicht-Text-Elemente der Zeichnung.
+ Die TeX-Datei bindet zunächst die PDF-Datei ein und setzt dann die
+ Textlabels aus der Zeichnung darüber.
+
+- EPS+TeX
+ Es wird eine *.eps- und eine *.tex-Datei erstellt.
+ Die EPS-Datei enthält die Nicht-Text-Elemente der Zeichnung.
+ Die TeX-Datei bindet zunächst die EPS-Datei ein und setzt dann die
+ Textlabels aus der Zeichnung darüber.
+
+- TeX
+ Die *.tex-Datei enthält sowohl die Textlabels der Zeichnung als auch die
+ Nicht-Text-Elemente als LaTeX-Anweisungen entsprechend dem LaTeX-Package
+ pgfcore.
+
+Es können sowohl Objekte für die Einbindung in ein LaTeX-Dokument erzeugt
+werden als auch eigenständige LaTeX-Dokumente.
+
+OPTIONEN
+
+-b Weite, --baselinewidth=Weite
+
+ legt die Basislinienbreite fest. Standard ist 1/160 Zoll.
+
+
+-d, --document
+
+ erstellt ein vollständiges LaTeX-Dokument.
+ Standard ist die Erstellung von Objekten zur Einbindung in
+ LaTeX-Dokumente.
+ Diese Option kann nicht für eps-Ausgabe genutzt werden.
+
+
+-l Ausgabeformat, --language=Ausgabeformat
+
+ gibt das Ausgabeformat an, eines von:
+ - "pdf" (erstellt ein PDF+TeX-Dateipaar),
+ - "eps" (erstellt ein EPS+TeX-Dateipaar) oder
+ - "tex" (erstellt eine TeX-Datei mit pgfcore-Anweisungen).
+ Durch Komma abgetrennt, können zusätzliche Name=Wert-Paare
+ zur Konfiguration angegeben werden.
+
+
+-m, --make
+
+ prüft vor der Verarbeitung, ob die Ausgabedateien vorhanden und aktuell
+ sind. Unnötige Konvertierungen werden vermieden.
+
+
+-p Weite, --pattern-linewidth=Weite
+
+ legt die Linienbreite für Füllmuster fest.
+ Standard ist 1/160 Zoll.
+
+
+-R, --reset
+
+ unterdrückt die Benutzung von Konfigurationsdateien.
+
+
+-w, --white-background
+
+ füllt den Hintergrund weiß. Standardmäßig wird der Hintergrund
+ nicht gefüllt und ist durchsichtig.
+
+
+NAME=WERT-PAARE
+
+Mit Paaren Name=Wert können detaillierte Einstellungen festgelegt werden.
+
+Für die Paare vom Typ Boolean genügt die Nennung des Namens, um die Option
+zu aktivieren. Die Option "-leps,level=2,lzw" hat die gleiche Auswirkung wie
+die Option "-leps,level=2,lzw=on". Für Boolean-Werte können "on", "true"
+oder "yes" zum aktivieren benutzt werden, zum deaktivieren "off", "false"
+oder "no".
+
+Folgende Einstellungen sind möglich:
+
+level=Ganzzahl
+ PS language level, 2 oder 3.
+ Voreinstellung: 3.
+
+dsc=Boolean
+ DSC-Kommentare (document structuring comments) in die PS/EPS-Ausgabe
+ schreiben.
+ Voreinstellung: aus.
+
+lzw=Boolean
+ LZW-Komprimierung beim Einbetten von Bitmap-Bildern in
+ PS-Language-Level 2 erlauben.
+ Voreinstellung: aus.
+
+color=Boolean
+ Farbige Ausgabe erlauben. Voreinstellung: ein.
+ Wird diese Option deaktiviert, erfolgt die Ausgabe in Graustufen.
+
+rgb-to-gray=String
+ Standard-Methode für die Umwandlung von RGB-Farbangaben nach Grau
+ festlegen. Voreinstellung: bt601.
+
+rgb-to-cmyk=String
+ Standard-Methode für die Umwandlung von RGB-Farbangaben nach CMYK
+ festlegen. Voreinstellung: non-standard.
+ Das Programm wxd2lat nimmt keine Farbraum-Umwandlungen von RGB nach
+ CMYK vor, dies ist auch auf absehbare Zeit nicht vorgesehen.
+ Die Option wird hier nur vollständigkeitshalber erwähnt, weil die
+ benutzte Bibliothek libdk4gra diese Option unterstützt.
+
+xsss=Ganzzahl
+ Anzahl von Bezier-Segmenten, mit denen jedes X-Spline-Segment
+ gezeichnet wird.
+
+xslp=Gleitkommazahl
+ Toleranz für die Längenbestimmung von X-Spline-Segmenten.
+ Die Iteration ist erfolgreich beendet, wenn die Differenz der
+ Ergebnisse von aktuellem Pass und vorhergendem Pass unter der
+ Schwelle liegt.
+
+xspp=Gleitkommazahl
+ Toleranz für die Suche nach einem Parameter t für eine bestimmte
+ Länge.
+ Die Iteration ist erfolgreich beendet, wenn die Differenz der
+ Ergebnisse von aktuellem Pass und vorhergendem Pass unter der
+ Schwelle liegt.
+ Der xspp-Wert sollte mindestens das Vierfache des xslp-Wertes sein.
+
+
+EXIT-STATUS
+
+0 bei Erfolg, alle anderen Exit-Codes weisen auf Fehler hin.
+
+BEISPIELE
+
+wxd2lat -leps test1.wxd
+ verarbeitet die Datei test1.wxd und legt die Dateien test1.tex und
+ test1.eps an.
+ Die Datei test1.tex kann mit "\input{test1.tex}" in ein
+ LaTeX-Dokument eingebunden werden.
+
+wxd2lat -d -lpdf test1.wxd
+ verarbeitet die Datei test1.wxd und legt die Dateien test1.tex und
+ test1-i.pdf an.
+ Die Datei test1.tex kann direkt mit "pdflatex test1" verarbeitet
+ weden.
+
+DATEIEN
+
+Im Normalfall - d.h. wenn die Option -R nicht benutzt wurde - wird nach
+Konfigurationsdateien "dk4gra.conf" gesucht. Die zum gewählten Ausgabetreiber
+passenden Abschnitte der gefundenen Konfigurationsdateien werden verarbeitet,
+bevor die auf der Kommandozeile angegebenen Parameter verarbeitet werden.
+
+AUTOR
+
+Dirk Krause
+
+COPYRIGHT UND LIZENZBESTIMMUNGEN
+
+Führen Sie
+ wxd2lat --license
+aus, um Lizenz-Informationen anzuzeigen.
+
+SIEHE AUCH
+
+http://sourceforge.net/p/dktools/wiki/Home/
+
diff --git a/support/dktools/dktools/de/wxdkclock.str b/support/dktools/dktools/de/wxdkclock.str
index 829b045f6c..47fd2a0481 100644
--- a/support/dktools/dktools/de/wxdkclock.str
+++ b/support/dktools/dktools/de/wxdkclock.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Menu "File"
#
diff --git a/support/dktools/dktools/de/wxdkct.str b/support/dktools/dktools/de/wxdkct.str
deleted file mode 100644
index d6a5c07478..0000000000
--- a/support/dktools/dktools/de/wxdkct.str
+++ /dev/null
@@ -1,333 +0,0 @@
-#
-# 0: Program name
-#
-wxdkct
-#
-# 1: Application group name
-#
-dkt-3
-#
-# 2: Software vendor name
-#
-Dirk Krause
-#
-# 3: Menu: File
-#
-&Datei
-#
-# 4: Menu: Help
-#
-&Hilfe
-#
-# 5: Menu: File / Exit
-#
-&Beenden Alt-X
-#
-# 6: Menu: Help / About
-#
-&Ãœber... Alt-A
-#
-# 7: Tip text for menu entry File / Exit
-#
-Anwendung beenden
-#
-# 8: Tip text for menu entry Help / About
-#
-Versionsinformation anzeigen
-#
-# 9: Menu Help / Contents
-#
-&Inhalt F1
-#
-# 10: Menu tool tip Help / Contents
-#
-Inhaltsverzeichnis der Online-Hilfe
-#
-# 11: Label text: Directory
-#
-Verzeichnis:
-#
-# 12: Menu text: Choose Directory
-#
-&Verzeichnis Alt-V
-#
-# 13: Menu tool tip: Choose source directory
-#
-Quelltext-Verzeichnis wählen...
-#
-# 14: Menu text: Setup
-#
-&Einstellungen Alt-E
-#
-# 15: Menu tool tip: Set conversion options
-#
-Einstellungen vornehmen
-#
-# 16 Label text: yes, to stdout
-#
-ja, auf Standardausgabe
-#
-# 17: Toolbar button text: Directory
-#
-Verzeichnis
-#
-# 18: Toolbar button text: Options
-#
-Einstellungen
-#
-# 19: Toolbar button text: Run
-#
-Start
-#
-# 20: Toolbar button text: Exit
-#
-Beenden
-#
-# 21: Toolbar button tooltip: Choose directory
-#
-Quelltext-Verzeichnis auswählen
-#
-# 22: Toolbar button tooltip: Set options.
-#
-Einstellungen vornehmen
-#
-# 23: Toolbar button tooltip: Run conversion
-#
-Konvertierung starten
-#
-# 24: Toolbar button tooltip: Exit the application
-#
-Anwendung beenden
-#
-# 25: Current directory.
-#
-.
-#
-# 26: Button text: OK
-#
-OK
-#
-# 27: Button text: Cancel
-#
-Abbrechen
-#
-# 28: Button tool tip for OK button.
-#
-Dialog schließen, Einstellungen anwenden
-#
-# 29: Button tool tip for cancel button.
-#
-Dialog schließen, Einstellungen verwerfen
-#
-# 30: Dialog title: Options
-#
-Einstellungen
-#
-# 31: Checkbox label: Use make mode
-#
-"make"-Modus
-#
-# 32: Checkbox tool tip: Run conversions only if necessary.
-#
-Nur konvertieren, falls nötig
-#
-# 33: Static box title: General options
-#
-Allgemeine Einstellungen
-#
-# 34: Static box title: Output
-#
-Ausgabe
-#
-# 35: Checkbox label: Line numbers
-#
-Zeilennummern
-#
-# 36: Static box title: Debug
-#
-Debugging
-#
-# 37: Checkbox label: Create debug output
-#
-Debug-Ausgaben erzeugen
-#
-# 38: Checkbox label: Debug to standard output
-#
-Debug-Ausgaben in die Standardausgabe
-#
-# 39: Checkbox label: Include timestamp
-#
-Debug-Ausgaben mit Zeitstempel
-#
-# 40: Checkbox label: Use trace keyword
-#
-Debug-Ausgaben mit Text "trace" beginnen
-#
-# 41: Checkbox label: Wide character support
-#
-Debug-Ausgaben mit Support für Windows-16-Bit-Text
-#
-# 42: Checkbox tool tip: Create line number directives
-#
-Zeilennummern-Direktiven für C-Compiler
-#
-# 43: Checkbox tool tip: Generate code for debug messages
-#
-Code mit Trace/Debug-Ausgaben erzeugen
-#
-# 44: Checkbox tool tip: Write trace/debug messages to standard output
-#
-Trace/Debug-Ausgaben in die Standardausgabe schreiben
-#
-# 45: Checkbox tool tip: Include a timestamp into debug messages
-#
-Trace/Debug-Ausgaben mit Uhrzeit versehen
-#
-# 46: Checkbox tool tip: Include "trace" keyword into debug messages
-#
-Trace/Debug-Ausgaben mit Schlüsselwort "trace" versehen
-#
-# 47: Checkbox tool tip: Add support for TRACE_WIDE
-#
-Trace/Debug-Ausgaben mit Support für 16-Bit-Text für Windows
-#
-# 48: Dialog title: Conversion progress
-#
-Fortschritt
-#
-# 49: File name (empty string)
-#
-
-#
-# 50: Button text: Cancel
-#
-Abbrechen
-#
-# 51: Button tool tip: Abort conversion after finishing current file
-#
-Abbruch nach Verarbeitung der gerade bearbeiteten Datei
-#
-# 52: Notification text: Cancel command scheduled... Wait, please!
-#
-Abbruch eingeleitet... Bitte warten!
-#
-# 53: Directory dialog title: Choose directory
-#
-Verzeichnis wählen
-#
-# 54: Message text: Directory:
-#
-Verzeichnis:
-#
-# 55: Message text: Destination files up to date.
-#
-Alle Zieldateien sind aktuell.
-#
-# 56: Message text: Processing succeeded.
-#
-Verarbeitung erfolgreich.
-#
-# 57: Message text:Processing failed!
-#
-Verarbeitung fehlgeschlagen!
-#
-# 58: Error: Can not handle directory name!
-#
-FEHLER: Der Verzeichnisname kann nicht verwendet werden!
-#
-# 59/60: Error: Failed to open directory "..."!
-#
-FEHLER: Verzeichnis "
-" kann nicht geöffnet werden!
-#
-# 61/62: Error: File name is not plain ASCII text: "..."!
-#
-FEHLER: Nicht-ASCII-Zeichen in Dateinamen: "
-"!
-#
-# 63: Error: Not enough memory!
-#
-FEHLER: Zu wenig Speicher!
-#
-# 64: Menu item: Run
-#
-&Start Alt-S
-#
-# 65: Menut tool tip: Start conversion
-#
-Konvertierung starten
-#
-# 66: About dialog title.
-#
-Ãœber wxdkct
-#
-# 67: Empty text (initial status text).
-#
-
-#
-# 68: Run result: Processing succeeded
-#
-Verarbeitung erfolgreich
-#
-# 69: Run result: Warnings occured
-#
-Warnungen
-#
-# 70: Run result: Errors occured
-#
-Fehler
-#
-# 71: ERROR: Automatic run cancelled due to errors.
-#
-Automatischer Start wegen Fehlern nicht möglich!
-#
-# 72: Autorun result: Processing succeeded, application will exit.
-#
-Verarbeitung erfolgreich, Anwendung wird beendet.
-#
-# 73: Newline
-#
-\n
-#
-# 74: This program uses libraries from the following projects:
-#
-Dieses Programm verwendet Bibliotheken aus folgenden Projekten:\n
-#
-# 75: See:
-#
-Siehe:\n
-#
-# 76-93: Special character candidates for splint.
-#
-@
-^
-°
-!
-"
-§
-$
-%
-&
-?
-~
-\#
-|
-,
-;
-.
-:
-_
-#
-# 94-95: Comments for splint
-#
-Kommentare für splint
-Schreibe Kommentare für splint
-#
-# 96: Choose comment character for splint
-#
-Kommentar-Zeichen für splint auswählen
-#
-# 97 98 Check box: Portable debug code and tool tip
-#
-Portabler Trace-Code
-Code für Trace-Ausgabe portabel gestalten
diff --git a/support/dktools/dktools/de/wxdkdraw.str b/support/dktools/dktools/de/wxdkdraw.str
new file mode 100644
index 0000000000..7050a87186
--- /dev/null
+++ b/support/dktools/dktools/de/wxdkdraw.str
@@ -0,0 +1,1191 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# 0: Menu "File"
+#
+Datei
+#
+# 1: Menu item "File/Quit"
+#
+Beenden
+#
+# 2: Tool tip text for menu item "File/Exit"
+#
+Anwendung beenden
+#
+# 3: Menu "Help"
+#
+Hilfe
+#
+# 4: Menu item "Help/About"
+#
+Ãœber
+#
+# 5: Tooltip text for menu item "Help/About"
+#
+Versionshinweis anzeigen
+#
+# 6: Menu item "Help/Contents"
+#
+Inhalt
+#
+# 7: Tooltip text for menu item "Help/Contents"
+#
+Inhaltsverzeichnis der Hilfe öffnen
+#
+# 8: Initial status text
+#
+Initialisierung...
+#
+# 9: Copyright notice.
+#
+Copyright (c)
+#
+# 10: Dialog box title "About ..."
+#
+Ãœber wxdkdraw
+#
+# 11: This program uses the following libraries
+#
+Dieses Programm benutzt folgende Bibliotheken:
+#
+# 12: See
+#
+Siehe:
+#
+# 13-17 Texts for mouse key messages and cursor position
+#
+L:
+ M:
+ R:
+ X:
+ Y:
+#
+# 18 Title text
+#
+wxdkdraw - Zeichne für LaTeX
+#
+# 19 Used in about dialog box (trailing space)
+#
+Teil der DK tools and libraries, Version
+#
+# 20-21 Menu item text and tip for File / New
+#
+Neu
+Neue Zeichnung erstellen
+#
+# 22-23 Menu item text and tip for File / Open
+#
+Öffnen
+Datei mit Zeichnung öffnen
+#
+# 24-25 Menu item text and tip for File / Save
+#
+Speichern
+Zeichnung in Datei speichern
+#
+# 26-27 Menu item text and tip for File / Save as
+#
+Speichern unter...
+Zeichnung mit anderem Dateinamen speichern
+#
+# 28 Menu name Add
+#
+Hinzufügen
+#
+# 29-30 Menu item text and tip Add / Polyline
+#
+Linienzug
+Linienzug hinzufügen
+#
+# 31-32 Menu item text and tip Add / Polygon
+#
+Polygon
+Polygon hinzufügen
+#
+# 33-34 Menu item text and tip Add / Rectangle
+#
+Rechteck
+Rechteckige Box hinzufügen
+#
+# 35-36 Menu item text and tip Add / Box
+#
+Box
+Box mit abgerundeten Ecken hinzufügen
+#
+# 37-38 Menu item text and tip Add / Circle
+#
+Kreis
+Kreis hinzufügen
+#
+# 39-40 Menu item text and tip Add / Ellipse
+#
+Ellipse
+Ellipse hinzufügen
+#
+# 41-42 Menu item text and tip Add / Open approximated spline
+#
+Offener approximierter Spline
+Offenen approximierten Spline hinzufügen
+#
+# 43-44 Menu item text and tip Add / Closed approximated spline
+#
+Geschlossener approximierter Spline
+Geschlossenen approximierten Spline hinzufügen
+#
+# 45-46 Menu item text and tip Add / Open interpolated spline
+#
+Offener interpolierter Spline
+Offenen interpolierten Spline hinzufügen
+#
+# 47-48 Menu item text and tip Add / Closed interpolated spline
+#
+Geschlossener interpolierter Spline
+Geschlossenen interpolierten Spline hinzufügen
+#
+# 49-50 Menu item text and tip Add / Connector dot
+#
+Verbindungspunkt
+Verbindungspunkt hinzufügen
+#
+# 51-52 Menu item text and tip Add / Pin dot
+#
+Anschlusspunkt
+Anschlusspunkt hinzufügen
+#
+# 53-54 Menu item text and tip Add / Text label
+#
+Textlabel
+Textlabel hinzufügen
+#
+# 55-56 Menu item text and tip Add / Image
+#
+Bild
+Bild (PNG/JPEG/TIFF/NetPBM) einfügen
+#
+# 57-58 Menu item text and tip Add / Library element
+#
+Bibliothekselement
+Bibliothekselement hinzufügen
+#
+# 59 Menu name Edit
+#
+Bearbeiten
+#
+# 60-61 Menu item text and tip Edit / Copy object
+#
+Kopieren
+Objekt kopieren
+#
+# 62-63 Menu item text and tip Edit / Move object
+#
+Verschieben
+Objekt verschieben
+#
+# 64-65 Menu item text and tip Edit / Delete object
+#
+Löschen
+Objekt löschen
+#
+# 66-67 Menu item text and tip Edit / Move point
+#
+Punkt verschieben
+Einzelnen Punkt eines Objektes verschieben
+#
+# 68-69 Menu item text and tip Edit / Add point
+#
+Punkt hinzufügen
+Punkt zu Linienzug/Polygon/Spline hinzufügen
+#
+# 70-71 Menu item text and tip Edit / Remove point
+#
+Punkt entfernen
+Punkt aus Linienzug/Polygon/Spline entfernen
+#
+# 72-73 Menu item text and tip Edit / Details
+#
+Details
+Details eines Objektes bearbeiten
+#
+# 74-75 Menu item text and tip Edit / Group
+#
+Gruppieren
+Objekte zu Gruppe zusammenfassen
+#
+# 76-77 Menu item text and tip Edit / Ungroup
+#
+Gruppe auflösen
+Gruppe auflösen
+#
+# 78-79 Menu item text and tip Edit / Flip horizontally
+#
+Horizontal spiegeln
+Objekt horizontal spiegeln
+#
+# 80-81 Menu item text and tip Edit / Flip vertically
+#
+Vertikal spiegeln
+Objekt vertikal spiegeln
+#
+# 82-83 Menu item text and tip Edit / Drawing size
+#
+Zeichnungsgröße
+Zeichnungsgröße bearbeiten
+#
+# 84 Menu name View
+#
+Ansicht
+#
+# 85 Menu name Zoom
+#
+Zoom
+#
+# 86-87 Menu item text and tip View / Zoom / In
+#
+Hinein
+Hineinzoomen
+#
+# 88-89 Menu item text and tip View / Zoom / Out
+#
+Heraus
+Herauszoomen
+#
+# 90-91 Menu item text and tip View / Zoom / Reset
+#
+Reset
+Zoom zurücksetzen auf Faktor 1
+#
+# 92 Menu name Layer
+#
+Lagen
+#
+# 93-94 Menu item text and tip View / Layer / Activate all
+#
+Alle aktivieren
+Alle Lagen aktivieren
+#
+# 95-96 Menu item text and tip View / Layer / Layer manager
+#
+Manager
+Lagen-Manager öffnen
+#
+# 97-98 Menu item text and tip View / Center view
+#
+Ansicht zentrieren
+Bildmitte in Mitte des Fensters positionieren
+#
+# 99-119 Button tip texts
+#
+Datei öffnen
+Datei speichern
+Copy - Objekt kopieren
+Move - Objekt verschieben
+Delete - Objekt löschen
+Punkt bearbeiten
+Objekt-Details
+Gruppieren, Objekte einzeln auswählen
+Gruppe auflösen
+Horizontal spiegeln
+Vertikal spiegeln
+Punkt hinzufügen
+Punkt entfernen
+Zeichnungsgröße ändern
+Hineinzoomen
+Herauszoomen
+Zoom zurücksetzen
+Gitter:
+Gitter-Einheit: Zoll oder cm
+Unterteilung für Magnetgitter
+Platzierungshilfe
+#
+# 120-136
+#
+Linienzug
+Polygon
+Rechteckige Box
+Box mit abgerundeten Ecken
+Kreis
+Ellipse
+Offener Kreisbogen
+Geschlossener Kreisbogen
+Offener approximierter Spline
+Geschlossener approximierter Spline
+Offener interpolierter Spline
+Geschlossener interpolierter Spline
+Verbindungspunkt
+Anschlusspunkt
+Textlabel
+Bibliothekselement
+Bild
+#
+# 137-140 Markers above controls
+#
+Lage:
+Linie:
+Füllung:
+Text:
+#
+# 141-155 Tips for controls in bottom bar
+#
+Lagennummer
+Linien- und Textfarbe
+Linienbreite (Vielfache der Basislinienbreite)
+Linienstil
+Linienenden
+Knickpunkte
+Pfeilspitze vorwärts
+Pfeilspitze rückwärts
+Füllfarbe
+Füllstil
+LaTeX
+LaTeX-Text
+Textausrichtung
+Fontname
+Fontgröße
+#
+# 156-157 Units for grid
+#
+Zoll
+CM
+#
+# 158-159 Grid base
+#
+4
+5
+#
+# 160 Checkbox label Grid
+#
+Gitter
+#
+# 161 Checkbox label PH
+#
+PH
+#
+# 162 Tool tip for button Select object
+#
+Objekt auswählen
+#
+# 163-167 Tool tip for further buttons for grouping
+#
+zu offenem interpolierten Spline
+Gruppieren, Auswahl einer Region
+Auswahl nacheinander
+Objekt zu offenem interpolierten Spline wandeln
+Auswahl einer Region
+#
+# 168-169 Title and text to save drawing
+#
+Zeichnung speichern?
+Die Zeichnung enthält ungesicherte Änderungen.\nIn Datei speichern?
+#
+# 170 Marker for modified drawing
+#
+*
+#
+# 171 Dialog title
+#
+Zeichnung speichern
+#
+# 172 File types
+#
+WXD files (*.wxd)|*.wxd
+#
+# 173 Dialog title
+#
+Gruppe
+#
+# 174-186 Status texts for selection candidates
+#
+Text
+Linienzug
+Offener Spline
+Offener Kreisbogen
+Polygon
+Geschlossener Spline
+Geschlossener Kreisbogen
+Kreis
+Ellipse
+Box
+Bild
+Verbindungspunkt
+Anschlusspunkt
+#
+# 187-199 Status text while modifying objects
+#
+Text bearbeiten
+Linienzug bearbeiten
+Offenen Spline bearbeiten
+Offenen Kreisbogen bearbeiten
+Polygon bearbeiten
+Geschlossenen Spline bearbeiten
+Geschlossenen Kreisbogen bearbeiten
+Kreis bearbeiten
+Ellipse bearbeiten
+Box bearbeiten
+Bild bearbeiten
+Verbindungspunkt bearbeiten
+Anschlusspunkt bearbeiten
+#
+# 200-201 Mouse button hint
+#
+Auswahl aufheben
+Objekt auswählen
+#
+# 202-207 Error message parts
+#
+NICHT GESPEICHERT!
+Die Zeichnung wurde nicht gespeichert!\nFehler beim Öffnen der Datei.
+Die Zeichnung wurde nicht gespeichert!\nFehler beim Schreiben der Datei.
+Die Zeichnung wurde nicht gespeichert!\nText "
+" zu lang.
+Die Zeichnung wurde nicht gespeichert!\nEin Text war zu lang.
+#
+# 208-210 Error message parts
+#
+Die Zeichnung wurde nicht gespeichert!\nCodieren des Textes "
+" schlug fehl!
+Die Zeichnung wurde nicht gespeichert!\nEin Text konnte nicht passend codiert werden.
+#
+# 211-213 Error message parts
+#
+Die Zeichnung wurde nicht gespeichert!\nDer Dateiname "
+" konnte nicht codiert werden!
+Die Zeichnung wurde nicht gespeichert!\nDateiname konnte nicht codiert werden.
+#
+# 214
+#
+Die Zeichnung wurde nicht gespeichert!\nEin Objekt enthält leeren Text.
+#
+# 215
+#
+Die Zeichnung wurde nicht gespeichert!
+#
+# 216-224 Line style dialog
+#
+Linienstil
+Durchgängig
+Gestrichelt
+Gepunktet
+Strich-Punkt-Linie
+Strich-Punkt-Punkt-Linie
+Strich-Punkt-Punkt-Punkt-Linie
+Abbrechen
+Linienstil unverändert beibehalten
+#
+# 225-231 Style length dialog
+#
+Stil-Länge
+Stil-Länge:
+Strichlänge in Vielfachen der Linienbreite
+OK
+Änderungen übernehmen
+Abbrechen
+Strichlänge unverändert beibehalten
+#
+# 232-237 Line join dialog
+#
+Knickpunkte
+Spitz
+Abgerundet
+Abgeschnitten
+Abbrechen
+Knickpunktstil unverändert beibehalten
+#
+# 238-244 Miter limit dialog
+#
+Spitzen-Limit
+Limit:
+Wert für das Limit auswählen (Empfehlung: 8)
+OK
+Änderungen übernehmen
+Abbrechen
+Spitzen-Limit unverändert beibehalten
+#
+# 245-250 Line cap dialog
+#
+Linienenden
+Abgeschnitten
+Abgerundet
+Ãœberstehend
+Abbrechen
+Linienenden unverändert beibehalten
+#
+# 251-253 Arrow type dialog
+#
+Pfeilspitze
+Abbrechen
+Pfeilspitze unverändert beibehalten
+#
+# 254-262 Arrow size dialog
+#
+Größe der Pfeilspitze
+Länge:
+Breite:
+Länge der Pfeilspitze in Vielfachen der Linienbreite
+Breite der Pfeilspitze in Vielfachen der Linienbreite
+OK
+Abbrechen
+Änderungen übernehmen
+Pfeilspitzengröße unverändert beibehalten
+#
+# 263-289 Fill style dialog
+#
+Füllung
+Keine
+Füllung mit Füllfarbe
+Diagonale Linien nach links, 30°
+Diagonale Linien nach rechts, 30°
+Diagonales Sieb, 30°
+Diagonale Linien nach links, 45°
+Diagonale Linien nach rechts, 45°
+Diagonales Sieb, 45°
+Horizontale Ziegel
+Vertikale Ziegel
+Waagerechte Linien
+Senkrechte Linien
+Sieb (waagerechte und senkrechte Linien)
+Horizontale Schrägziegel, nach rechts geneigt
+Horizontale Schrägziegel, nach links geneigt
+Vertikale Schrägziegel, zu einer Seite geneigt
+Vertikale Schrägziegel, zur anderen Seite geneigt
+Große Fischschuppen
+Kleine Fischschuppen
+Kreise
+Sechsecke
+Achtecke
+Horizontale Reifenspur
+Vertikale Reifenspur
+Abbrechen
+Füllung unverändert beibehalten
+#
+# 290-295 Text align dialog
+#
+Textausrichtung
+Links
+Zentriert
+Rechts
+Abbrechen
+Textausrichtung unverändert beibehalten
+#
+# 296-333 Text font dialog
+#
+Schriftart
+Abbrechen
+Schriftart unverändert beibehalten
+Times Roman
+Times Italic
+Times Bold
+Times Bold Italic
+Avantgarde Book
+Avantgarde Book Oblique
+Avantgarde Book Demi
+Avantgarde Book Demi Oblique
+Bookman Light
+Bookman Light Italic
+Bookman Demi
+Bookman Demi Italic
+Courier
+Courier Oblique
+Courier Bold
+Courier Bold Oblique
+Helvetica
+Helvetica Oblique
+Helvetica Bold
+Helvetica Bold Oblique
+Helvetica Narrow
+Helvetica Narrow Oblique
+Helvetica Narrow Bold
+Helvetica Narrow Bold Oblique
+New Century Schoolbook Roman
+New Century Schoolbook Italic
+New Century Schoolbook Bold
+New Century Schoolbook Bold Italic
+Palatino Roman
+Palatino Italic
+Palatino Bold
+Palatino Bild Italic
+Symbol
+Zapf Chancery
+Zapf Dingbats
+#
+# 334-338 Layer manager dialog
+#
+Lagen
+OK
+Abbrechen
+Änderungen übernehmen
+Lagen-Einstellungen unverändert beibehalten
+#
+# 339 Dialog title to open drawing
+#
+Zeichnung öffnen
+#
+# 340-341 Status text to delete object
+#
+Objekt löschen
+Abbruch
+#
+# 342-344 Status texts to move object
+#
+Objekt verschieben
+Objekt platzieren
+Abbruch
+#
+# 345-346 Error message for failed memory allocation
+#
+Fehler: Speicher
+Dynamische Speicheranfordung schlug fehl!\nZu wenig Speicher (RAM/swap)!
+#
+# 347-348 Error message for invalid placement
+#
+Fehler: Ungültige Position
+Die gewählte Position hätte einen numerischen Überlauf zur Folge!
+#
+# 349-350 Error with no detailed information
+#
+Fehler
+Ein Fehler trat auf.\nLeider sind keine Details verfügbar!
+#
+# 351-364 Font selection dialog.
+#
+Schriftfamilie:
+Times
+AvantGarde
+Bookman
+Courier
+Helvetica
+HelveticaNarrow
+NewCenturySchlbk
+Palatino
+Symbol
+ZapfChancery
+ZapfDingbats
+bold / demi
+italic / oblique
+#
+# 365-367 Font selection OK button
+#
+OK
+Konfigurierten Font benutzen
+Schriftfamilie auswählen
+#
+# 368-369 Information, no layers used
+#
+Zur Zeit sind keine Lagen in Benutzung.
+Keine Lagen in Benutzung
+#
+# 370-372 Copy operation
+#
+Objekt kopieren
+Objekt platzieren
+Abbruch
+#
+# 373-376 Polyline and polygon creation.
+#
+Erster Punkt
+Punkt hinzufügen
+Abbruch
+Beenden
+#
+# 377-379 Rectangle and box creation.
+#
+1. Eckpunkt
+2. Eckpunkt
+Abbruch
+#
+# 380-384 Circle creation
+#
+Mittelpunkt
+Punkt auf Kreis
+Abbruch
+Beenden
+BB Eckpunkt
+#
+# 385-388 Arc creation
+#
+Offener Kreisbogen
+Offenen Kreisbogen hinzufügen
+Geschlossener Kreisbogen
+Geschlossenen Kreisbogen hinzufügen
+#
+# 389-393 Arc creation
+#
+Startpunkt
+Durchlaufener Punkt
+Endpunkt
+Abbruch
+Beenden
+#
+# 394-395 Dot creation
+#
+Platzieren
+Beenden
+#
+# 396-402 Label texts for text input dialog.
+#
+Export-Text:
+Screen-Text:
+Zu exportierenden Text eingeben
+Text für Bildschirmdarstellung eingeben
+Text-Eingabe
+Textlabel erzeugen / bearbeiten
+Abbruch der Bearbeitung
+#
+# 403-404 Text label creation
+#
+Platzieren
+Beenden
+#
+# 405-408 Adding image
+#
+1. Eckpunkt
+2. Eckpunkt
+Abbruch
+Beenden
+#
+# 409 Dialog box title "Choose image"
+#
+Bild auswählen
+#
+# 410
+#
+Bibliothekselement auswählen
+#
+# 411-412 Adding library element
+#
+Platzieren
+Abbruch
+#
+# 413-415 Point move mode, snap or relative
+#
+Punkt-Bearbeitungs-Mode
+Schnapp
+Relativ
+#
+# 416-417 Texts for rotation spin control
+#
+Drehung:
+Drehwinkel für Text oder Ellipse in Grad
+#
+# 418-421 Texts for point move operation
+#
+Punkt wählen
+Platzieren
+Abbruch
+Einzelnen Punkt bearbeiten / verschieben
+#
+# 422-427 Texts for spline s modification
+#
+Spline s-Wert
+s:
+OK
+Änderung übernehmen
+Abbruch
+Wert unverändert beibehalten
+#
+# 428 Slider tool tip
+#
+s-Wert auswählen
+#
+# 429-430 Texts in spline s value modification dialog
+#
+Spline s-Wert
+0
+#
+# 431-433 Mouse button texts for point deletion
+#
+Punkt löschen
+Abbruch
+Punkt aus Linienzug / Polygon / Spline entfernen
+#
+# 434-438 Status and mouse button texts for point adding
+#
+Punkt zu Linienzug / Polygon / Spline hinzufügen
+Punkt wählen
+Punkt platzieren
+Beenden
+Abbruch
+#
+# 439-441 Status and mouse button texts for drawing size change (s)
+#
+Ecke auswählen
+Beenden
+Größe ändern
+#
+# 442-443 Status and mouse button texts for drawing size change (p)
+#
+Eckpunkt platzieren
+Abbruch
+#
+# 444-446 Status and mouse button texts for object flipping
+#
+Objekt(e) spiegeln
+Objekt spiegeln
+Beenden
+#
+# 447-452 Status and mouse button texts for grouping objects
+#
+Objekt auswählen
+Objekt abwählen
+Gruppe fertigstellen
+Abbruch
+Beenden
+Objekte gruppieren, einzeln nacheinander auswählen
+#
+# 453-455 Status and mouse button texts for ungrouping objects
+#
+Gruppe auflösen
+Gruppe auflösen
+Beenden
+#
+# 456-457 Status and mouse button texts for grouping by box
+#
+Eckpunkt
+Objekte gruppieren, Region auswählen
+#
+# 458-460 Status and mouse button texts for detail modification
+#
+Objekt-Details bearbeiten
+Objekt bearbeiten
+Beenden
+#
+# 461 Dialog box title for image options
+#
+Bild-Optionen
+#
+# 462-475 texts for image options dialog
+#
+RGB zu Grau:
+Methode für Konvertierung RGB zu Grau auswählen
+Seitenverhältnis beibehalten
+Seitenverhältnis beibehalten, dabei verbleibt möglicherweise Platz ungenutzt
+Alpha-Kanal verwenden
+Information zur Deckungskraft aus Alpha-Kanal benutzen
+Bild-Interpolation
+Bild-Interpolation erlauben
+DCT-Daten
+Direkte Nutzung von DCT-codierten Daten aus JPEG-Dateien erlauben
+Bild-Interpolation für DCT-Daten
+Bild-Interpolation auch bei Nutzung von DCT-codierten Daten erlauben
+Hintergrund forcieren
+Nutzung der Hintergrundfarbe aus wxd-Datei forcieren
+#
+# 476-479 Texts for OK and Cancel button of image options dialog
+#
+OK
+Cancel
+Änderungen übernehmen
+Bild-Optionen unverändert beibehalten
+#
+# 480-493 RGB to gray conversion method names
+#
+Standard-Methode
+Luminanz (Standard-Koeffizienten)
+Luminanz (kürzere Koeffizienten)
+Schnell
+Schneller
+Luminanz (alternative Koeffizienten)
+Durchschnitt
+Entsättigung
+Minimum-Dekomposition
+Medium-Dekomposition
+Maximum-Dekomposition
+Rot
+Grün
+Blau
+#
+# 494-498 Texts for dot details
+#
+Verbindungspunkt-Optionen
+Durchmesser:
+Durchmesser in Vielfachen der Basislinienbreite
+Linienbreite:
+Linienbreite in Vielfachen der Basislinienbreite
+#
+# 499-502 Text for box options (radius)
+#
+Box-Options
+in
+cm
+Radius:
+#
+# 503-504 Error message about numeric overflow in radius calculation
+#
+Numerischer Ãœberlauf
+Numerischer Ãœberlauf in Radius-Berechnung
+#
+# 505-506 Error message, failed to read file
+#
+Lesen fehlgeschlagen
+Die Datei konnte nicht eingelesen werden!
+#
+# 507-508
+#
+Öffnen fehlgeschlagen
+Die Datei konnte nicht geöffnet werden!
+#
+# 509-510
+#
+Maus außerhalb
+Die Maus befindet sich außerhalb des nutzbaren Koordinatenbereiches!
+#
+# 511-512
+#
+Text fehlt
+Leerer Export-Text ist nicht erlaubt!
+#
+# 513-514
+#
+Dateiname fehlt
+Der Auswahldialog lieferte keinen Dateinamen!
+#
+# 515-516
+#
+Koordinaten fehlen
+Koordinaten konnten nicht ermittelt werden!
+#
+# 517-518
+#
+Änderung fehlgeschlagen
+Die Koordinaten konnten nicht geändert werden!
+#
+# 519-520
+#
+Numerischer Ãœberlauf
+Numerischer Ãœberlauf bei Koordinaten-Berechnung!
+#
+# 521-522
+#
+Gruppierung fehlgeschlagen
+Die Objekte konnten nicht in einer Gruppe zusammengefasst werden!
+#
+# 523-524
+#
+Gruppenauflösung fehlgeschlagen
+Die Gruppe konnte nicht aufgelöst werden!
+#
+# 525-526
+#
+Radius-Berechnung fehlgeschlagen
+Die Box ist zu klein, um einen Radius zu berechnen!
+#
+# 527-528
+#
+BUG
+Neuer Punkt außerhalb des verwendbaren Index-Bereiches!
+#
+# 529-530
+#
+Zu viele Punkte
+Linienzüge, Polygone und Splines können maximal 65535 Punkte haben!
+#
+# 531 Status text: Ready
+#
+Bereit
+#
+# 532-534 Delete region
+#
+Region löschen
+Abbruch
+Region auswählen
+#
+# 535-544 Conversions
+#
+Konvertieren
+zu Polygon
+zu Linienzug
+zu geschlossenem interpolierten Spline
+zu geschlossenem Kreisbogen
+zu offenem Kreisbogen
+zu geschlossenem approximierten Spline
+zu offenem approximierten Spline
+zu Anschlusspunkt
+zu Verbindungspunkt
+#
+# 545-553 Conversion tool tips
+#
+Konvertiere Objekt zu Polygon
+Konvertiere Objekt zu Linienzug
+Konvertiere Objekt zu geschlossenem interpolierten Spline
+Konvertiere Objekt zu geschlossenem Kreisbogen
+Konvertiere Objekt zu offenem Kreisbogen
+Konvertiere Objekt zu geschlossenem approximierten Spline
+Konvertiere Objekt zu offenem approximierten Spline
+Konvertiere Objekt zu Anschlusspunkt
+Konvertiere Objekt zu Verbindungspunkt
+#
+# 554-555 Conversion mouse button labels
+#
+Konvertiere Objekt
+Beenden
+#
+# 556-557 Message box text for failed conversion
+#
+Konvertierung fehlgeschlagen
+Dieses Objekt ist für die vorgesehene Konvertierung nicht geeignet.
+#
+# 558-559 Message box text if output directory too long
+#
+Directory too long
+Output file directory too long!
+#
+# 560-561 Message box text if failed to find current working directory
+#
+Current directory
+Failed to find current working directory!
+#
+# 562-563 Message box output file name is too long
+#
+File name too long
+Output file name is too long!
+#
+# 564-565 Messagae box, failed to find output directory.
+#
+Output directory
+Failed to find output directory name!
+#
+# 566-569 Menu item and tip texts for 90 degree rotations
+#
+Drehen nach links
+Objekt um 90° nach links drehen
+Drehen nach rechts
+Objekt um 90° nach rechts drehen
+#
+# 570-571 Status texts
+#
+Nach links drehen
+Nach rechts drehen
+#
+# 572-573 Mouse button texts
+#
+Objekt drehen
+Drehen beenden
+#
+# 574 Dialog box title for box details
+#
+Box-Details
+#
+\nKeine Detailinformationen verfügbar.
+\nNicht ausreichend Speicher verfügbar!
+\nErwartete Anzahl Teiltexte nicht vorgefunden!
+\nText enthält keine Zahl!
+\nRe-Codierung für Textlabel fehlgeschlagen!
+\nRe-Codierung für Dateinamen fehlgeschlagen!
+\nUnbrauchbare Argumente an Einlesefunktion übergeben (Bug)!
+\nDateiformat-Version nicht angegeben!
+\nBounding box nicht angegeben!
+\nKeine wxdkdraw-Datei!
+\nDateiformat-Version zu neu, kann nicht verarbeitet werden!
+\nStartzeile für Objekt erwartet!
+\nDetailinformationen für Objekt erwartet!
+\nEinlesefunktion in nicht vorgesehenem Zustand (Bug)!
+\nUnzulässiger Objekttyp oder Subtyp!
+\nNumerischer Ãœberlauf bei Koordinatenbestimmung!
+\nKeine Gruppe offen, die geschlossen werden könnte!
+\nZu wenig Punkte angegeben!
+\nDateiname ist leer!
+\nDateiname ist zu lang!
+\nBox spannt keine Fläche auf!
+#
+# 596-598 Information about line numbers...
+#
+\nZeile
+, Teiltext
+.
+#
+# 599-600 Information message box title and text.
+#
+Zeichnung geändert
+Beim Einlesen der Zeichnung wurden Korrekturen vorgenommen.
+#
+# 601 Options menu
+#
+Optionen
+#
+# 602-603 Reset options
+#
+Alle Optionen zurücksetzen
+Alle Optionen auf die Standardwerte zurücksetzen
+#
+# 604-605 Confirmation dialog box
+#
+Sind Sie sicher?
+Wollen Sie wirklich alle Optionen auf die Standardwerte zurücksetzen?
+#
+# 606-610 Menu items
+#
+Farben
+Zurücksetzen
+Farbe auf Standard zurücksetzen
+Bearbeiten
+Farbe bearbeiten
+#
+# 611-619 Colours to modify
+#
+Umgebung
+Hintergrund
+Gitter
+Platzierungshilfe
+Hervorhebung für Kopieren
+Hervorhebung für Verschieben
+Hervorhebung für Löschen
+Hervorhebung für Gruppieren
+Fehlende Bilddatei
+#
+# 620-624 Menu item, tool tip and mouse hints to modify spline point s
+#
+Ändere s
+s-Wert für Spline-Punkt ändern
+Ändere s
+Beenden
+s-Wert für Spline-Punkt ändern
+#
+# 625-626 Menu item and tool tip for new objects.
+#
+Neue Objekte
+Standardeinstellungen für neue Objekte festlegen
+#
+# 627-629 Dialog title and contents, defaults for new objects
+#
+Standard für neue Objekte
+Gefüllte Punkte
+Weiß gefüllte Punkte
+#
+# 630-631 Menu item and tool tip for screen representation options
+#
+Bildschirmdarstellung
+Optionen für die Bildschirmdarstellung ändern
+#
+# 632-634 X-spline options
+#
+Splines
+Bezier-Segmente pro X-Spline-Segment
+Anzahl der Bezier-Segmente pro X-Spline-Segment festlegen
+#
+# 635 Dialog title
+#
+Optionen für Bildschirmdarstellung
+#
+# 636-638 Option use exact text fonts
+#
+Text
+Exakte Schriftart
+Versuche, für Nicht-LaTeX-Text die exakte Schriftart zu verwenden
+#
+# 639-641 Option reduce point markup for point operations
+#
+Punkt-Operationen
+Größe des Markup-Punkts verringern
+Kleinere Markup-Punkte für Punkt hinzufügen, entfernen, verschieben... verwenden
+#
+# 642 Label with warning
+#
+Export-Text (erforderlich):
+#
+# 643-646
+#
+Offener Kreisbogen
+Offenen Kreisbogen hinzufügen
+Geschlossener Kreisbogen
+Geschlossenen Kreisbogen hinzufügen
+
diff --git a/support/dktools/dktools/de/wxdkfcs.str b/support/dktools/dktools/de/wxdkfcs.str
index 422c8176be..f3bd76f869 100644
--- a/support/dktools/dktools/de/wxdkfcs.str
+++ b/support/dktools/dktools/de/wxdkfcs.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Menu "File"
#
diff --git a/support/dktools/dktools/de/wxdkhtb.str b/support/dktools/dktools/de/wxdkhtb.str
index ea5114c2b7..e5d82868f8 100644
--- a/support/dktools/dktools/de/wxdkhtb.str
+++ b/support/dktools/dktools/de/wxdkhtb.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Menu "File"
#
diff --git a/support/dktools/dktools/de/wxdkscrsz.str b/support/dktools/dktools/de/wxdkscrsz.str
index bcb5c74d29..2f9fc1c577 100644
--- a/support/dktools/dktools/de/wxdkscrsz.str
+++ b/support/dktools/dktools/de/wxdkscrsz.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Menu "File"
#
diff --git a/support/dktools/dktools/de/wximgsz.str b/support/dktools/dktools/de/wximgsz.str
index 94bcaa16e2..be9eca5e6c 100644
--- a/support/dktools/dktools/de/wximgsz.str
+++ b/support/dktools/dktools/de/wximgsz.str
@@ -1,225 +1,146 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
-# 0 Program name.
-#
-wximgsz
-#
-# 1 Menu name: File
+# 0: Menu "File"
#
Datei
#
-# 2 Menu item: File => Exit
-#
-Beenden Alt-B
-#
-# 3 Data grid column head: Width
-#
-Breite
-#
-# 4 Data grid column head: Height
-#
-Höhe
-#
-# 5 Data grid column head: Factor
-#
-Faktor
-#
-# 6 Label text: Original image
-#
-Original-Bild
-#
-# 7 Label text: Results
-#
-Ergebnis
-#
-# 8 Label text: Width:
-#
-Breite:
-#
-# 9 Label text: Height:
-#
-Höhe:
-#
-# 10 Label text: Intended change
-#
-Gewünschte Änderung
-#
-# 11 Label text: Action:
-#
-Bearbeitung:
-#
-# 12 Choice: Decrease image
-#
-Bild verkleinern
-#
-# 13 Choice: Width range
-#
-Breitenbereich
-#
-# 14 Choice: Height range
-#
-Höhenbereich
-#
-# 15 Label: Minimum:
-#
-Minimum:
+# 1: Menu item "File/Quit"
#
-# 16 Label: Maximum:
+Beenden
#
-Maximum:
-#
-# 17 Button label: Run
-#
->>>
-#
-# 18 Empty text for initial status
-#
-
-#
-# 19 Tooltip: Exit the application
+# 2: Tool tip text for menu item "File/Exit"
#
Anwendung beenden
#
-# 20 Tooltip: Specify original image width
-#
-Original-Bildbreite eingeben (positiv ganzzahlig).
-#
-# 21 Tooltip: Specify original image height
-#
-Original-Bildhöhe eingeben (positiv ganzzahlig).
-#
-# 22 Tooltip: Choose type of modification
-#
-Gewünschte Bearbeitung auswählen.
-#
-# 23 Tooltip: Specify intended minimum for image width or height
-#
-Gewünschtes Minimum für Bildbreite bzw. -höhe eingeben.
-#
-# 24 Tooltip: Specify intended maximum for image width or height
-#
-Gewünschtes Maximum für Bildbreite bzw. -höhe eingeben.
-#
-# 25 Tooltip: Calculate new image sizes
-#
-Berechnung starten.
-#
-# 26 Spaces to initialize text fields
-#
-
-#
-# 27 Menu: Help
+# 3: Menu "Help"
#
Hilfe
#
-# 28 Menu item: Contents
-#
-Inhaltsverzeichnis
-#
-# 29 Menu item: About
+# 4: Menu item "Help/About"
#
Ãœber...
#
-# 30 Menu tip: Open table of contents
+# 5: Tooltip text for menu item "Help/About"
#
-Inhaltsverzeichnis der Online-Hilfe öffnen.
+Versionsinformation anzeigen
#
-# 31 Menu tip: Show version number dialog box
+# 6: Menu item "Help/Contents"
#
-Versionsnummer anzeigen.
+Inhalt
#
-# 32 Error message title: Incorrect input
+# 7: Tooltip text for menu item "Help/Contents"
#
-Fehlerhafte Eingabe
+Inhaltsverzeichnis der Hilfe öffnen
#
-# 33 Error message text: Please enter a postivie integer number.
+# 8: Initial status text
#
-Bitte geben Sie einen positiven ganzzahligen Wert ein!
+Bereit
#
-# 34 Status message: No results found!
+# 9: Copyright notice.
#
-Keine Ergebnisse erzielt!
+Copyright (c)
#
-# 35 About box title.
+# 10: Dialog box title "About ..."
#
Ãœber wximgsz
#
-# 36 Indicator for best quality
+# 11: This program uses the following libraries
#
-++
+Dieses Programm nutzt folgende Bibliotheken:
#
-# 37 Indicator for good quality
+# 12: See
#
-+
+Siehe:
#
-# 38 Menu: Extras
+# 13: __CHANGE__ 015: Text for dummy label, can be reused if lDummy removed.
#
-Extras
+Eingabe
#
-# 39 Menu item: Options
+# 14-15 Input label for width and height
#
-Optionen
+Breite:
+Höhe:
#
-# 40 Tip: Set options
+# 16-17 Tooltips for spin controls.
#
-Einstellungen für das Programm ändern
+Breite des Originalbildes eingeben
+Höhe des Originalbildes eingeben
#
-# 41 Dialog box title: Options
+# 18 Group label
#
-Einstellungen
+Änderung
#
-# 42 Checkbox text: Choose background color by scale factor quality
+# 19-20 Label and tooltip to select operation
#
-Hintergrundfarbe für Skalierungsfaktor
+Operation:
+Gewünschte Operation auswählen
#
-# 43 Tooltip text: Indicate scale factor quality by background colour.
+# 21-23 Operation choices
#
-Hintergrundfarbe entsprechend Qualität des Skalierungsfaktors verwenden.
+Verkleinern
+Breitenbereich
+Höhenbereich
#
-# 44 Button: OK
+# 24-27 Range input labels and tooltips
#
-OK
+Minimum:
+Maximum:
+Bereichs-Minimum angeben
+Bereichs-Maximum angeben
#
-# 45 Button: Cancel
+# 28 Group label results
#
-Abbrechen
+Ergebnisse
#
-# 46 Tool tip text: Apply settings and exit dialog.
+# 29 Tip for run button
#
-Einstellungen anwenden und Dialog verlassen.
+Berechnung ausführen
#
-# 47 Tool tip text: Skip settings and exit dialog.
+# 30-33 Table heads
#
-Einstellungen verwerfen und Dialog verlassen.
+Breite
+Höhe
+Faktor
+
#
-# 48
+# 34-36 Quality markers
#
-Bitmap-Datei auswählen
+
++
+++
#
-# 49
+# 37 Marker for fraction
#
-Öffnen Alt-O
+ /
#
-# 50
+# 38-39 Dialog box for restrictions
#
-Bildabmessungen aus Bilddatei verwenden.
+Zu viele Ergebnisse
+Zu viele Ausgabezeilen, Ausgabe wurde begrenzt.
#
-# 51
+# 40-41 Text and tool tip for file open
#
-Die Datei konnte nicht geladen werden!\nMöglicherweise ist die Datei beschädigt oder der Bildtyp wird von wximgsz nicht unterstützt.
+Öffnen...
+Bitmap-Datei öffnen und Bildabmessungen lesen.
#
-# 52
+# 42 Dialog title
#
-Bilddatei nicht geladen!
+Image-Datei öffnen
#
-# 53
+# 43-44 Error message box title and text.
#
-\n
+Fehler beim Öffnen
+Die Bilddatei konnte nicht geöffnet werden!
#
-# 54
+# 45-48 Error message box texts
#
-Dieses Programm benutzt Bibliotheken aus folgenden Projekten:\n
+Datei nicht gefunden:\n"
+"!
+Unzureichende Berechtigungen auf Datei:\n"
+"!
#
-# 55
+# 49-50 Error: Not a supported file type
#
-Siehe:\n
-
+Nicht unterstützter Dateityp:\n"
+"!
diff --git a/support/dktools/dktools/de/wxpqdc.str b/support/dktools/dktools/de/wxpqdc.str
index aefac35d3b..36b3d63b0a 100644
--- a/support/dktools/dktools/de/wxpqdc.str
+++ b/support/dktools/dktools/de/wxpqdc.str
@@ -1,3 +1,5 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# 0: Menu "File"
#
diff --git a/support/dktools/dktools/de/x.txt b/support/dktools/dktools/de/x.txt
index b9c96c6538..4b9597a6c3 100644
--- a/support/dktools/dktools/de/x.txt
+++ b/support/dktools/dktools/de/x.txt
@@ -43,4 +43,4 @@ aus, um Lizenz-Informationen anzuzeigen.
SIEHE AUCH
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/dkwxwiza.txt b/support/dktools/dktools/dkwxwiza.txt
index 76837b34d1..001fd891e8 100644
--- a/support/dktools/dktools/dkwxwiza.txt
+++ b/support/dktools/dktools/dkwxwiza.txt
@@ -193,7 +193,7 @@ aaaaa
# 9 10 11 12 13 14 15: List of libraries used.
#
DK tools, wxWidgets, libpng, libjpeg, libtiff, zlib.
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
http://www.wxwidgets.org
http://www.libpng.org/pub/png/libpng.html
http://www.ijg.org
@@ -330,7 +330,7 @@ $application$::OnInit()
/* Create and show frame.
*/
frame = new $frame$(
- $frame$_MainWindow,
+ $frame$::ID_FRAME,
pAh,
pHc,
argc,
@@ -346,8 +346,8 @@ $application$::OnInit()
/* Show frame, restore position and indicate success.
*/
- frame->Show();
frame->RestorePosition();
+ frame->Show();
back = true;
/* Release resources if initialization failed.
diff --git a/support/dktools/dktools/dkwxwizc.txt b/support/dktools/dktools/dkwxwizc.txt
index 847a11a55e..6eb8f4f393 100644
--- a/support/dktools/dktools/dkwxwizc.txt
+++ b/support/dktools/dktools/dkwxwizc.txt
@@ -3,6 +3,7 @@ AC_INIT($frame$.h)
dnl AC_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CPP
+AC_PROG_CXX
AC_C_BIGENDIAN
WXCPPFLAGS=''
@@ -13,6 +14,20 @@ WXCPPFLAGS=`wx-config --cppflags`
WXCXXFLAGS=`wx-config --cxxflags`
WXCFLAGS=`wx-config --cflags`
WXLDFLAGS=`wx-config --libs`
+WARNCC=
+WARNCXX=
+
+if [[ "X$CXX" = "Xg++" ]]
+then
+ WXCPPFLAGS=`echo $WXCPPFLAGS | sed -e 's/\-I/-isystem /g'`
+ WXCXXFLAGS=`echo $WXCXXFLAGS | sed -e 's/\-I/-isystem /g'`
+ WXCFLAGS=`echo $WXCFLAGS | sed -e 's/\-I/-isystem /g'`
+fi
+if [[ "X$CXX" = "Xg++" -o "X$CXX" = "Xclang++" ]]
+then
+ WARNCC="-Wall -Wextra"
+ WARNCXX="-Wall -Wextra"
+fi
if [[ -f dk4info.out ]]
then
@@ -34,6 +49,11 @@ then
BZLIB='-lbz2'
fi
+AC_SUBST(CC)
+AC_SUBST(CPP)
+AC_SUBST(CXX)
+AC_SUBST(WARNCC)
+AC_SUBST(WARNCXX)
AC_SUBST(WXCPPFLAGS)
AC_SUBST(WXCXXFLAGS)
AC_SUBST(WXLDFLAGS)
diff --git a/support/dktools/dktools/dkwxwizf.txt b/support/dktools/dktools/dkwxwizf.txt
index b91f94add4..45bd894073 100644
--- a/support/dktools/dktools/dkwxwizf.txt
+++ b/support/dktools/dktools/dkwxwizf.txt
@@ -29,7 +29,7 @@ text = sTexts[0]
contents = miFileExit
[wxMenuItem miFileExit]
-id = $frame$_Quit
+id = wxID_EXIT
text = sTexts[1]
tip = sTexts[2]
@@ -39,12 +39,12 @@ contents = miHelpAbout
contents = miHelpContents
[wxMenuItem miHelpAbout]
-id = $frame$_Help_About
+id = $frame$::ID_HELP_ABOUT
text = sTexts[4]
tip = sTexts[5]
[wxMenuItem miHelpContents]
-id = $frame$_Help_Contents
+id = $frame$::ID_HELP_TOC
text = sTexts[6]
tip = sTexts[7]
@@ -110,6 +110,14 @@ class $frame$ : public Dk4WxFrame
public:
+ /** Window IDs used in main window (frame).
+ */
+ enum {
+ ID_FRAME = (wxID_HIGHEST + 1), /**< Frame. */
+ ID_HELP_ABOUT , /**< Open information dialog box. */
+ ID_HELP_TOC , /**< Open help table of contents. */
+ };
+
/** Constructor.
@param wxid Window ID.
@param applicationHelper Application helper object.
@@ -194,13 +202,43 @@ $!trace-include
/* __CHANGE__ 017: Add further events. */
-/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
-BEGIN_EVENT_TABLE($frame$, wxFrame)
- EVT_MENU($frame$_Quit, $frame$::OnQuit)
- EVT_MENU($frame$_Help_About, $frame$::OnAbout)
- EVT_MENU($frame$_Help_Contents, $frame$::OnHelpContents)
- EVT_IDLE($frame$::OnIdle)
+
+/* Hint: Window IDs for main frame members are defined in an enum
+ in the frame class.
+ IDs defined in this enum should have $frame$:: prepended
+ for an optical distinction from predefined window IDs (i.e. from
+ wxWidgets).
+*/
+
+/* __CHANGE__ 008: Remove OnIdle if no idle processing required.
+ When removing the table entry here, remove the entire OnIdle() method.
+*/
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE($frame$,wxFrame)
+#else
+BEGIN_EVENT_TABLE($frame$,wxFrame)
+#endif
+ EVT_MENU(\
+ wxID_EXIT,\
+ $frame$::OnQuit\
+ )
+ EVT_MENU(\
+ $frame$::ID_HELP_ABOUT,\
+ $frame$::OnAbout\
+ )
+ EVT_MENU(\
+ $frame$::ID_HELP_TOC,\
+ $frame$::OnHelpContents\
+ )
+ EVT_IDLE(\
+ $frame$::OnIdle\
+ )
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -272,6 +310,7 @@ $frame$::CanClose(bool isLast)
$? "+ $frame$::CanClose isLast=%d", (isLast ? 1 : 0)
/* __CHANGE__ 013: Check for unsaved data.
+ And probably change parameter to "bool WXUNUSED(isLast)"
*/
$? "- $frame$::CanClose %d", (back ? 1 : 0)
@@ -279,10 +318,14 @@ $frame$::CanClose(bool isLast)
}
+
void
$frame$::OnQuit(wxCommandEvent & event)
{
$? "+ $frame$::OnQuit"
+ /* __CHANGE__ 013:
+ Probably change parameter to "wxCommandEvent & WXUNUSED(event)"
+ */
$? "- $frame$::OnQuit"
Close();
}
@@ -295,6 +338,9 @@ $frame$::OnAbout(wxCommandEvent & event)
wxString text(wxT(""));
wxString title(wxT(""));
$? "+ $frame$::OnAbout"
+ /* __CHANGE__ 013:
+ Probably change parameter to "wxCommandEvent & WXUNUSED(event)"
+ */
/* Construct message text. */
text.Append(sNlWx[0]);
text.Append(sNlWx[7]);
@@ -342,6 +388,9 @@ void
$frame$::OnHelpContents(wxCommandEvent & event)
{
$? "+ $frame$::OnHelpContents"
+ /* __CHANGE__ 013:
+ Probably change parameter to "wxCommandEvent & WXUNUSED(event)"
+ */
DisplayContents();
$? "- $frame$::OnHelpContents"
}
@@ -356,6 +405,24 @@ $frame$::OnHelpContents(wxCommandEvent & event)
/* __CHANGE__ 008: Remove OnIdle if no idle processing required.
*/
+/* __CHANGE__ 008: Remove the request for more events if not needed.
+*/
+
+/* __CHANGE__ 008: Decide about Skip() call.
+ The function name is irritating: Skip() or Skip(true) will continue to
+ process the event, calling default handlers.
+ Skip(false) or handlers without Skip() will skip further processing of the
+ event.
+
+ From the wxWidgets documenation: Skip() should be called for all
+ non-command events to allow the default handling to take place.
+ The command events are, however, normally not skipped as usually a single
+ command such as a button click or menu item selection must only be
+ processed by one handler.
+
+ So my recommendation is to have a Skip() call in the idle event handler.
+*/
+
void
$frame$::OnIdle(wxIdleEvent & event)
{
diff --git a/support/dktools/dktools/dkwxwizh.txt b/support/dktools/dktools/dkwxwizh.txt
index fe190c68a0..5935f35691 100644
--- a/support/dktools/dktools/dkwxwizh.txt
+++ b/support/dktools/dktools/dkwxwizh.txt
@@ -4,11 +4,19 @@
#define H_INCLUDED_$program$ 1
#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include <dk4conf.h>
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include <dk4types.h>
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
@@ -82,19 +90,35 @@
#ifndef DK4WXAPPLICTIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include <Dk4WxApplicationHelper.h>
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
#endif
#ifndef DK4WXFRAME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include <Dk4WxFrame.h>
+#else
+#include <dktools-4/Dk4WxFrame.h>
+#endif
#endif
#ifndef DK4WXPROGRESSDIALOG_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include <Dk4WxProgressDialog.h>
+#else
+#include <dktools-4/Dk4WxProgressDialog.h>
+#endif
#endif
#ifndef DK4WXHELPCONTROLLER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
#include <Dk4WxHelpController.h>
+#else
+#include <dktools-4/Dk4WxHelpController.h>
+#endif
#endif
#include "$application$.h"
@@ -104,26 +128,6 @@
/* __CHANGE__ 018: Add header files for further classes and modules.
*/
-/** IDs for menu items, buttons and other elements.
-*/
-enum {
-
- /** Exit the application.
- */
- $frame$_Quit = wxID_EXIT ,
-
- /** Main window ID.
- */
- $frame$_MainWindow = ((wxID_HIGHEST) + 1) ,
-
- /** Show version dialog box.
- */
- $frame$_Help_About ,
-
- /** Open table of conents for online help.
- */
- $frame$_Help_Contents
-};
#endif
diff --git a/support/dktools/dktools/dkwxwizm.txt b/support/dktools/dktools/dkwxwizm.txt
index 2a20b8d392..2b1afdd22d 100644
--- a/support/dktools/dktools/dkwxwizm.txt
+++ b/support/dktools/dktools/dkwxwizm.txt
@@ -1,12 +1,11 @@
# Package prefix
DESTDIR=
-SOVERS=3.0
-
# Compiler and linker
+CXX=@CXX@
CC=$(CXX)
-LD=$(CC)
+LD=$(CXX)
# Standard directory variables from autoconf
prefix=@prefix@
@@ -39,8 +38,8 @@ BZLIB=@BZLIB@
INCLUDES= -I. -I../.. -I../../gui
COPTS= $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-COMPILEC= $(CXX) $(COPTS) $(WXCXXFLAGS)
-COMPILEPP= $(CXX) $(COPTS) $(WXCXXFLAGS)
+COMPILEC= $(CXX) $(COPTS) $(WXCXXFLAGS) @WARNCC@
+COMPILEPP= $(CXX) $(COPTS) $(WXCXXFLAGS) @WARNCXX@
# Use DK libraries
diff --git a/support/dktools/dktools/dkwxwizv.txt b/support/dktools/dktools/dkwxwizv.txt
index 70aae5d111..8a0179e274 100644
--- a/support/dktools/dktools/dkwxwizv.txt
+++ b/support/dktools/dktools/dkwxwizv.txt
@@ -72,12 +72,12 @@ UNICODE= /D_UNICODE=1 /DUNICODE=1
# --- Visual Studio 2005/2008 on Windows 7
COPTIONS= /nologo /MT /W3 \
- /D "WIN32" /D "_WIN32" /D "NDEBUG" /D "_CONSOLE" \
+ /D "WIN32" /D "_WIN32=1" /D "NDEBUG" /D "_CONSOLE" \
-D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_SECURE_NO_DEPRECATE=1 \
$(UNICODE)
DLLCOPTIONS= /nologo /MD /W3 \
- /D "WIN32" /D "_WIN32" /D "NDEBUG" /D "_CONSOLE" \
+ /D "WIN32" /D "_WIN32=1" /D "NDEBUG" /D "_CONSOLE" \
-D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_SECURE_NO_DEPRECATE=1 \
$(UNICODE)
diff --git a/support/dktools/dktools/en/bmpp.txt b/support/dktools/dktools/en/bmpp.txt
new file mode 100644
index 0000000000..42ba5adf12
--- /dev/null
+++ b/support/dktools/dktools/en/bmpp.txt
@@ -0,0 +1,590 @@
+
+NAME
+
+ bmpp - Bitmap to PDF/PS converter
+
+SYNOPSIS
+
+ bmpp [-l<driver>[.<mode>][,<name>[=<value>]...]] [<option(s)>] <file(s)>
+
+DESCRIPTION
+
+The program converts bitmap image files from PNG, JPEG, TIFF and NetPBM
+to PDF and PS/EPS.
+In this text "bitmap image" refers to bitmap, graymap and pixmap images.
+
+For each input file specified on the command line the program creates a
+corresponding output file with file name suffix ".pdf", ".eps", ".ps"
+or ".bb".
+
+If a directory name is specified on the command line, bmpp traverses
+the directory and converts all files suitable as bmpp input.
+In the special make-mode bmpp converts only those files for which there
+is no up-to-date output file yet.
+
+The driver choice indicates the file type to produce:
+
+* pdf
+ Portable document format (PDF).
+
+* eps
+ Encapsulated PostScript (EPS), image for inclusion in documents.
+
+* ps
+ Print job file for printing on PostScript printers.
+
+* bb
+ Bounding box file, contains image dimensions only, no image contents.
+ LaTeX needs such files sometimes to know how much space to reserve
+ for an image.
+
+The output mode indicates the intended purpose of the output:
+
+* object
+ Object, a file embedded into a graphics or text document by a drawing
+ software or text typesetting software.
+
+* image
+ Image for stand-alone viewing and processing.
+
+* document
+ The image is fitted to a specified paper size or usable area on paper
+ for printing.
+
+
+OPTIONS
+
+-l <driver>[.<mode>][,<key>[=<value>]...]
+--language=<driver>[.<mode>][,<key>[=<value>]...]
+ specifies output driver and output mode. The optional key=value
+ pairs can be used for further configuration.
+ See section "key=value pairs" below.
+
+-m
+--make
+ turns on 'make operating' for directory processing.
+ When processing directories, bmpp in normal operating processes
+ each file it can process. In make operating it processes only
+ those files for which there is no up-to-date output file yet.
+
+-R
+--reset
+ resets the program to built-in default settings,
+ the dk4gra.conf configuration files are ignored.
+
+--help
+ shows a short help text.
+
+--manual
+ shows this detailed help text.
+
+--version
+ shows the version number.
+
+--license
+ shows the license conditions of both bmpp and the used libraries.
+
+
+KEY=VALUE PAIRS
+
+Key=value pairs are used to specify configuration details.
+
+For boolean settings it is sufficient to write the name to activate the
+option. As an example "-lps.document,duplex" has the same effect as
+"-lps.document,duplex=true". Use "on", "true", or "yes" to activate boolean
+settings. Use "off", "false", or "no" for deactivation.
+
+The following settings can be made:
+
+
+level=integer
+ PS language level when producing PS output, 2 or 3.
+ Default: 3.
+
+dsc=boolean
+ Write DSC comments (document structuring convention) to
+ PS/EPS output files.
+ Default: off
+
+lzw=boolean
+ Allow the use of LZW compression in PS level 2 output.
+ Default: off
+
+color=boolean
+ Allow colored output. Default: on.
+ Deactivating this option results in grayscaled output.
+
+rgb-to-gray=string
+ Method to convert RGB data to grayscale values.
+ Default: bt601.
+ See section "Color space conversion" below.
+
+rgb-to-cmyk=string
+ Method to convert RGB data to CMYK, one from "non-standard" or
+ "standard".
+ Default: non-standard.
+ The bmpp program does not convert from RGB to CMYK and there
+ are no plans to do so. The option is mentioned here for completeness
+ as the used libdk4gra library supports this configuration option.
+
+alpha=string
+ Method for alpha channel use, either "mix" or "foreground".
+ Default: mix.
+ See section "Alpha channel" below.
+
+bg=integer:integer:integer[:boolean]
+ Default background color. The numbers are RGB values in the
+ range 0...255. Default: 255:255:255.
+ Normally the color specified here is only used if the input image
+ does not contain background color information.
+ The optional boolean flag decides about enforcing the background color.
+ Enforcing means the background color is used even if there is
+ background color information in the input image file.
+ I recommend to use the "force-bg" option instead of specifying the
+ boolean flag here.
+
+force-bg=boolean
+ Enforcing the background color can be set up differently from
+ specifying the background color.
+ Default: off.
+
+interpolation=boolean
+ Set interpolation flag in output. If this flag is set, PDF/PS
+ rendering programs are allowed to attempt to improve image
+ representation.
+ Default: on.
+
+dct=boolean
+ Allow direct re-use of DCT encoded data from JPEG input files.
+ This avoids decoding and encoding and results in faster processing
+ and smaller output files.
+ Default: on.
+
+dct-interpolation=boolean
+ Set image interpolation flag when directly re-using DCT encoded data
+ from JPEG files too.
+ Default: off.
+
+a-bpc=boolean
+ Analyze bits per component. Reduce number of bits per component
+ if reduction if possible without quality loss.
+ Default: on.
+
+a-color=boolean
+ Analyze use of colors, switch output color space to grayscaled
+ if all pixels are gray.
+ Default: on.
+
+a-alpha=boolean
+ Analyze alpha channel use, avoid writing an SMask object to PDF
+ output if all pixels are fully opaque.
+ Default: on.
+
+paper=string
+ Paper size for documents.
+ The paper size must be defined in a dk3paper.conf or dk4paper.conf
+ file.
+ Default: a4.
+
+duplex=boolean
+ Prepare PS output for duplex printing (print on front side and
+ back side of paper sheet, binding on the left side like a book).
+ Default: on.
+
+tumble=boolean
+ Prepare PS output for duplex+tumble printing (print on front side and
+ back side of paper sheet, binding on top side like a calendar).
+ Default: off.
+
+resolution=choice
+ How to use resolution and calculate image size, one from:
+ - chunk
+ Obtain resolution information from input image file, if available.
+ This is the default.
+ If there is no resolution information in the input file, use 1px1pt.
+ - 1px1pt
+ Use 72 dpi for resolution in both x and y direction.
+ Ignore resolution data in input image file if present.
+ Each pixel from input file will use a 1 PS point square in output.
+ - <number>
+ The specified floating point number is used as resolution in dpi
+ for both x and y direction.
+ - <number>:<number>
+ The first number specifies the resolution in x direction,
+ the second one specifies the resolution in y direction.
+ I recommend to use <number> and <number>:<number> only.
+ The "chunk" and "1px1pt" variants are only available for backwards
+ compatibility. Chunk is the default, instead of 1px1pt you should
+ better use "i-res=on".
+
+i-res=boolean
+ Ignore resolution information in input image file.
+ Use 72 dpi, so the image width and height in PS point is equal
+ to the number of pixels in width and height of the input image.
+ The result is the same as "resolution=1px1pt".
+ Default: off.
+
+i-aspect=boolean
+ Ignore aspect ratio of input image.
+ When creating a document the entire available (printable) area
+ on paper sheet is used for the image. A distortion due to different
+ x and y scale factors is accepted.
+ Default : off.
+
+rotate=boolean
+ Allow image rotation by 90 degree if the rotated image fits
+ better into the usable area.
+ Default: off.
+
+
+ALPHA CHANNEL
+
+PNG/TIFF/NetPBM can contain an alpha channel. A pixels alpha value expresses
+opacity in the range 0=transparent to 1=fully opaque.
+An alpha channel found in the input image file is transferred into an
+SMask object in PDF output.
+For PS/EPS output we have to calculate the color of each pixel, there are
+two choices:
+(1) Mixing the foreground color as retrieved from input file against a
+ background color considering opaqueness from alpha channel.
+ This is the default.
+(2) Simply use the foreground information found in input image file.
+ Use "alpha=foreground" to configure this.
+A background color information (background color chunk) in the input image
+file is used by default, if present.
+
+For input images without background color information you can use the
+"bg=..." option to define a default background color.
+Using "force-bg=on" you can configure to use the bg=... color even if
+the input image file contains background color information.
+
+When creating a PDF document, each page is completely filled with white
+color before applying any image.
+
+When creating a PDF image for an image containing transparency,
+the image area is filled with background color before applying the image.
+
+
+COMPRESSION AND ENCODING
+
+Flate compression is used for PDF output and PS level 3 output.
+
+Run length compression with separated color channels is used for PS level 2
+output if the number of bytes per color channel per row does not exceed
+16384. For images with larger rows no compression is used.
+Alternatively you can enable LZW compression.
+
+For separated color channels the data stream contains all red values for a
+row first, all green values next, all blue values finally.
+Without separated color channels a horizontal red line would be represented
+by the byte values: 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 ...
+Run length compression would not be possible.
+With separated color channels the red channels contains: 255 255 255 255 255 ...
+The green and blue channels contain: 0 0 0 0 0 ...
+So run length compression can be applied to colored lines.
+
+The compression result is used directly without any further encoding
+for PDF output.
+For PS/EPS output ASCII-85 encoding is applied to produce clean 7 bit text.
+
+
+IMAGE ANALYSIS
+
+If the number of bits per component can be reduced for all components
+of all pixels without quality loss, the smaller bit depth is used in output.
+
+If the input images uses RGB, RGB+alpha or CMYK color space but all
+pixels are gray, bmpp produces grayscaled output.
+
+If the input image contains an alpha channel but alpha data indicates
+full opacity for all pixels, no SMask object is written to PDF output.
+
+
+COLOR SPACE CONVERSION
+
+The following variables containing integer values are used in the formulas
+below:
+
+MAX Maximum value for a given number of bits per component
+ (i.e. 15 for 4 bits, 255 for 8 bits)
+R Red component in range 0 ... MAX
+G Green component in range 0 ... MAX
+B Blue component in range 0 ... MAX
+E Grayscale value in range 0 ... MAX
+
+Several methods can be used to convert RGB data to gray:
+
+bt601
+ Keep luminance:
+
+ E = (299 * R + 587 * G + 114 * B) / 1000
+
+luminance
+ Keep luminance, use shorter coefficients:
+
+ E = (30 * R + 59 * G + 11 * B) / 100
+
+fast
+ Fast calculation without division operations:
+
+ E = (77 * R + 151 * G + 28 * B) >> 8
+
+fastest
+ Yet faster and more inaccurate calculation without multiplication
+ and division (<< and >> are bit shifting operations to left and right):
+
+ E = ((R << 1) + (G << 2) + G + B) >> 3
+
+bt709
+ Keep luminance, use other coefficients:
+
+ E = (2126 * R + 7152 * G + 722 * B) / 1000
+
+average
+ Average of red, green, blue:
+
+ E = (R + G + B) / 3
+
+desaturation
+ Desaturation results in an image with less contrast:
+
+ E = (maximum{R,G,B} + minimum{R,G,B}) / 2
+
+min
+ Minimum decomposition uses the minimum of R, G, B:
+
+ E = minimum{R,G,B}
+
+median
+ Median decomposition uses the median value of R, G, B:
+
+ E = median{R,G,B}
+
+max
+ Maximum decomposition uses the maximum of R, G, B:
+
+ E = maximum{R,G,B}
+
+red
+ Just use the red component:
+
+ E = R
+
+green
+ Just use the green component:
+
+ E = G
+
+blue
+ Just use the blue component:
+
+ E = B
+
+IMAGE SIZE, RESOLUTION AND ROTATION
+
+If image resolution information is available the real image dimensions
+in PS points are calculated by multiplication of width/height in pixels
+by factor 72, division by x/y resolution and rounding upwards to the next
+integer value.
+The source of the image resolution is either the input image file if
+it contains resolution data (resolution=chunk, this is the default) or
+a resolution specified by the user (resolution=<number> or
+resolution=<number>:<number>).
+
+If the input image file does not contain resolution data or the user
+decides to ignore resolution data (i-res=on), a resolution of 72 dpi
+is used. The output image width/height in PS points is equal to the
+input image width/height in number of pixels.
+
+Some input images - i.e. TIFF files generated by a fax gateway - contain
+different resolutions for x and y direction.
+For such images ignoring the resolution results in image distorsion.
+
+There are two choices to fit an image into a usable/printable area of a
+page or paper sheet:
+(1) Keep the aspect ratio (default), probably leaving parts of the available
+ area unused.
+(2) Ignore the aspect ratio (i-aspect=on) and fill the area completely
+ accepting image distorsion.
+
+For some image/paper combinations - i.e. the image is more wide than high
+but the paper is more high than wide - rotating the image by 90 degree
+allows better fitting to the available area.
+The rotate=on option allows such rotations.
+
+
+EXIT STATUS
+
+0 on success, all other values indicate errors.
+
+
+EXAMPLES
+
+bmpp -l pdf screenshot.png
+ creates PDF object screenshot.pdf for use with pdfLaTeX.
+
+bmpp -l eps screenshot.png
+ creates EPS object screenshot.eps for use with LaTeX/dvips.
+
+bmpp -l pdf.document,paper=A4,duplex fax.tif
+ creates a PDF file fax.pdf for printing.
+
+bmpp -l ps.document,level=2,paper=A4,duplex fax.tif
+ creates a PS file fax.ps for printing, PS language level 2 is used.
+
+bmpp -l pdf.image file.png
+ creates a standalone image file.pdf.
+
+bmpp -l ps.image file.png
+ creates a standalone image file.ps.
+
+
+FAQ
+
+* Do I need to create a dk4gra.conf file?
+
+ The dk4gra.conf configuration file can be used, but normally there is no
+ need to do so. I hope I selected useful defaults for the bmpp program.
+ One reason to create a dk4gra.conf file is to support PS printers handling
+ PS language level 2 only.
+
+* How do I switch PS language level to 2?
+
+ - On the command line:
+ Use "-lps,level=2" instead of "-lps".
+
+ - In a dk4gra.conf file:
+ Create a file dk4gra.conf containing the following lines
+
+ [ps]
+ level=2
+
+ in one of the following directories:
+ - ${datadir}/dk4app-site
+ to set defaults for all users.
+ - ${sysconfdir}/dk4app-site
+ to set defaults for all users.
+ - ${HOME}/.dk4app
+ to set defaults for the current user.
+ ${datadir} is typically /usr/share or /usr/local/share on
+ Unix/Linux, C:\Program Files\Krause\share on Windows.
+ ${sysconfdir} is typically /etc or /usr/local/etc on
+ Unix/Linux, C:\Program Files\Krause\etc on Windows.
+ ${HOME} is the users home directory on Unix/Linux, the user profile
+ directory on Windows.
+
+
+* How do I enable LZW compression for PS level 2 output?
+
+ Note: The LZW algorithm was patent protected for a long time. The patent
+ in the USA expired in 2003, the corresponding patent in Germany expired
+ in 2004.
+ I do not know the situation in all countries over the world, so you should
+ check the situation in your country yourself.
+ Activate LZW only if you are allowed to use it and if you really need it.
+
+ - On the command line:
+ Use "-lps,level=2,lzw" instead of "-lps,level=2".
+
+ - In a dk4gra.conf file:
+ Create a file dk4gra.conf containing the following lines
+
+ [ps]
+ level=2
+ lzw=on
+
+ in one of the directories mentioned above.
+
+
+FILES
+
+dk3paper.conf / dk4paper.conf
+ are the configuration files to define paper sizes.
+ If paper=... is used, the paper size must be defined in one of
+ these files.
+
+dk4gra.conf
+ is the configuration file for graphics output from the
+ DK tools and libraries project.
+ On start the bmpp program checks for the file in the following
+ locations in the specified order:
+ - ${datadir}/dk4app/dk4gra.conf
+ - ${sysconfdir}/dk4app/dk4gra.conf
+ - ${datadir}/dk4app-site/dk4gra.conf
+ - ${sysconfdir}/dk4app-site/dk4gra.conf
+ - ${datadir}/dktools/dk4gra.conf
+ - ${sysconfdir}/dktools/dk4gra.conf
+ - ${datadir}/dktools-site/dk4gra.conf
+ - ${sysconfdir}/dktools-site/dk4gra.conf
+ - ${datadir}/bmpp/dk4gra.conf
+ - ${sysconfdir}/bmpp/dk4gra.conf
+ - ${datadir}/bmpp-site/dk4gra.conf
+ - ${sysconfdir}/bmpp-site/dk4gra.conf
+ - ${HOME}/.dk4app/dk4gra.conf
+ - ${HOME}/.dk4app/dktools/dk4gra.conf
+ - ${HOME}/.dk4app/bmpp/dk4gra.conf
+ - ./dk4gra.conf
+ Cumulative processing is used. Settings made in a file processed
+ earlier may be overwritten in files processed later.
+ The ${datadir}/dk4app, ${sysconfdir}/dk4app, ${datadir}/dktools,
+ ${sysconfdir}/dktools, ${datadir}/bmpp directories are managed by
+ the package management, you should not create or modify files here.
+ Files in these directories may be updated or deleted during
+ package updates.
+ Use ${datadir}/dk4app-site, ${sysconfdir}/dk4app-site,
+ ${datadir}/dktools-site, ${sysconfdir}/dktools-site,
+ ${datadir}/bmpp-site, ${sysconfdir}/bmpp-site, ${HOME}/.dk4app,
+ ${HOME}/.dk4app/dktools, or ${HOME}/.dk4app/bmpp for customized
+ dk4gra.conf files.
+
+
+RESTRICTIONS
+
+File name size is restricted to MAXPATHLEN respectively _PATH_MAX on your
+system. The full path names of all files used must fit into this length.
+
+The program uses the TIFFReadRGBAImage() function from the libtiff library to
+read TIFF images. The input file must meet the following conditions:
+- The file must be compliant to the "TIFF baseline v6.0 standard".
+- The number of bits per component must be 8 or less.
+- The frames must not be too large, the system must be able to allocate the
+ 4*w*h bytes needed for image data in one piece.
+
+TIFF refers to a group of different compression and encoding mechanisms.
+A TIFF file is a sequence of data chunks, each data chunk contains a tag
+(chunk type identifier). A lot of tags is defined in standards, i.e. the
+"TIFF baseline v6.0 standard". Some software vendors add vendor-specific
+or non-standard tags when writing TIFF files.
+So when processing TIFF files in bmpp, you should not be surprised to see
+warnings or error messages about unknown TIFF tags.
+Neither bmpp nor the tifflib library are to blame for this, it's the
+responsibility of the people adding the non-standard tags.
+Sometimes bmpp can read the image despite of the warnings/errors.
+
+If you create bitmaps you want to process with bmpp, you should create PNG
+images instead of TIFF images if you have the choice.
+
+
+AUTHOR
+
+Dirk Krause
+
+
+HISTORY
+
+The bmpp program replaces the bmeps program found in earlier versions of the
+DK tools and libraries project.
+The program was rewritten completely for version 4.12.0, including the
+used libraries for reading bitmap images and producing graphics output.
+
+
+COPYRIGHT AND LICENSE
+
+Run
+ bmpp --license
+to see license information.
+
+SEE ALSO
+
+http://sourceforge.net/p/dktools/wiki/Home/
+
diff --git a/support/dktools/dktools/en/dk-bin2c.txt b/support/dktools/dktools/en/dk-bin2c.txt
new file mode 100644
index 0000000000..92c1044336
--- /dev/null
+++ b/support/dktools/dktools/en/dk-bin2c.txt
@@ -0,0 +1,71 @@
+
+NAME
+
+ dk-bin2c - Convert binary data to C source code
+
+SYNOPSIS
+
+ dk-bin2c [<options>] [<file(s)>]
+
+DESCRIPTION
+
+The program converts binary input from the named files or from standard
+input to C source code (array of literal unsigned char values in hexadecimal
+or octal notation).
+
+OPTIONS
+
+-o
+--octal
+ Octal output instead of hexadecimal output.
+
+-i <indent>
+--indent=<indent>
+ Line indent, number of spaces at start of each line. Default: 0.
+
+-s <spaces>
+--spaces=<spaces>
+ Number of spaces between elements in a line. Default: 0.
+
+-b <bytes>
+--bytes-per-line=<bytes>
+ Number of byte representations in each text line. Default: 15.
+
+--help
+ Show short help text.
+
+--manual
+ Show this help text.
+
+--version
+ Show version number.
+
+--license
+ Show license terms.
+
+
+EXIT STATUS
+
+0 on success, all other values indicate errors.
+
+ENVIRONMENT
+
+The presence of the VIM or VIMRUNTIME variable indicates the program is run
+from within vim.
+On Windows errors and diagnostics are avoided to prevent mixture of 16 bit text
+from diagnostics with 8 bit text from normal output.
+
+AUTHOR
+
+Dirk Krause
+
+COPYRIGHT AND LICENSE
+
+Run
+ dk-bin2c --license
+to see license information.
+
+SEE ALSO
+
+http://sourceforge.net/p/dktools/wiki/Home/
+
diff --git a/support/dktools/dktools/en/dk-blks.txt b/support/dktools/dktools/en/dk-blks.txt
index 983c5687e4..2e78df39d4 100644
--- a/support/dktools/dktools/en/dk-blks.txt
+++ b/support/dktools/dktools/en/dk-blks.txt
@@ -38,5 +38,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-bmm.txt b/support/dktools/dktools/en/dk-bmm.txt
index 6b21405977..596202144e 100644
--- a/support/dktools/dktools/en/dk-bmm.txt
+++ b/support/dktools/dktools/en/dk-bmm.txt
@@ -59,5 +59,5 @@ Run
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-cat.txt b/support/dktools/dktools/en/dk-cat.txt
index b187701033..466345b802 100644
--- a/support/dktools/dktools/en/dk-cat.txt
+++ b/support/dktools/dktools/en/dk-cat.txt
@@ -81,5 +81,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-db2t.txt b/support/dktools/dktools/en/dk-db2t.txt
index b5be8fa521..e0d68b7ee9 100644
--- a/support/dktools/dktools/en/dk-db2t.txt
+++ b/support/dktools/dktools/en/dk-db2t.txt
@@ -98,5 +98,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-dbco.txt b/support/dktools/dktools/en/dk-dbco.txt
index be22b76c9c..06c5434fb8 100644
--- a/support/dktools/dktools/en/dk-dbco.txt
+++ b/support/dktools/dktools/en/dk-dbco.txt
@@ -78,5 +78,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-fic.txt b/support/dktools/dktools/en/dk-fic.txt
index e70748cdaf..813ef9e109 100644
--- a/support/dktools/dktools/en/dk-fic.txt
+++ b/support/dktools/dktools/en/dk-fic.txt
@@ -92,5 +92,5 @@ This product includes software written by Tim Hudson (tjh@cryptsoft.com).
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-hex.txt b/support/dktools/dktools/en/dk-hex.txt
index 52c678f280..7b371eed66 100644
--- a/support/dktools/dktools/en/dk-hex.txt
+++ b/support/dktools/dktools/en/dk-hex.txt
@@ -47,5 +47,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-lines.txt b/support/dktools/dktools/en/dk-lines.txt
new file mode 100644
index 0000000000..80c86289d1
--- /dev/null
+++ b/support/dktools/dktools/en/dk-lines.txt
@@ -0,0 +1,121 @@
+
+NAME
+
+dk-lines - Extract lines from text
+
+SYNOPSIS
+
+dk-lines [<option(s)>] [<file(s)>]
+
+DESCRIPTION
+
+The program extracts specified lines from a text obtained from the specified
+files or standard input.
+
+There are 2 processing stages, both stages are optional.
+
+In the first stage the beginning of each text line is compared against a start
+text and/or an end text.
+Lines from within the range (including the borders) are transferred to stage 2.
+If only start or end text is specified, a simple comparison is used instead of
+the range check.
+
+The second stage selects lines from stage 1 output by line numbers.
+A start line number and/or an end line number can be specified.
+Positive line numbers are counted from the first line (line number 1)
+forwards. Negative line numbers are counted from the final line (line number -1)
+backwards.
+
+OPTIONS
+
+-f <starttext>
+--from=<starttext>
+ Specify the start text for stage 1.
+
+-t <endtext>
+--to=<endtext>
+ Specify the end text for stage 1.
+
+--today
+ Specify the current date in YYYY-MM-DD notation for start and end
+ text unless specified using -t or -f.
+ You can not use --today if both -t and -f are specified.
+
+-l <range>
+--lines=<range>
+ Specify the line number range for stage 2 in one of the following
+ notations:
+ s Specify just start line number.
+ s/e Specify start and end line number.
+ /e Specify just end line number.
+ The start line number is the first line to print.
+ The end line number is the final line to print.
+
+-o
+--one-stream
+ For multiple input files, group the stage 1 results from all files
+ before applying stage 2.
+ Without this option the line number range is applied to each
+ file individually.
+
+-i <encoding>
+--input-encoding=<encoding>
+ Expected input encoding. A byte order marker (BOM) at the beginning
+ of the file overwrites the encoding specified here.
+
+--line-size=<size>
+ Choose a line buffer size different from the default (4096 bytes).
+
+-v
+--verbose
+ Produce verbose diagnostics.
+
+EXIT STATUS
+
+0 on success, all other values indicate errors.
+
+EXAMPLES
+
+Find files modified in a specified range of dates:
+
+ dk-ls -pmn -tf -r | dk-lines --from=2017-11-18 --to=2017-11-19
+
+Find files modified today:
+
+ dk-ls -pmn -tf -r | dk-lines --today
+
+Find 10 newest files (last modified):
+
+ dk-ls -pmn -tf -r | dk-sort | dk-lines -l -10
+
+Find 10 oldest files (by modification date):
+
+ dk-ls -pmn -tf -r | dk-sort | dk-lines -l 1/10
+
+Show contents of file "x.txt", omit first 3 and final 2 lines:
+
+ dk-lines -l 4/-3 x.txt
+
+RESTRICTIONS
+
+On Windows the file name length is restricted to _MAX_PATH (260) characters
+if the file name contains a wildcard (* or ? character).
+
+AUTHOR
+
+Dirk Krause
+
+HISTORY
+
+The program was added in version 4.10.0.
+
+COPYRIGHT AND LICENSE
+
+Run
+ dk-lines --license
+to see license information.
+
+SEE ALSO
+
+http://sourceforge.net/p/dktools/wiki/Home/
+
diff --git a/support/dktools/dktools/en/dk-ls.txt b/support/dktools/dktools/en/dk-ls.txt
index d78190e0d6..cd938fa101 100644
--- a/support/dktools/dktools/en/dk-ls.txt
+++ b/support/dktools/dktools/en/dk-ls.txt
@@ -267,5 +267,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-pwd.txt b/support/dktools/dktools/en/dk-pwd.txt
index 619aa9f613..701d185048 100644
--- a/support/dktools/dktools/en/dk-pwd.txt
+++ b/support/dktools/dktools/en/dk-pwd.txt
@@ -35,5 +35,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-pwgen.txt b/support/dktools/dktools/en/dk-pwgen.txt
index 495a24cc97..9110a5b0e8 100644
--- a/support/dktools/dktools/en/dk-pwgen.txt
+++ b/support/dktools/dktools/en/dk-pwgen.txt
@@ -135,5 +135,5 @@ This product includes software written by Tim Hudson (tjh@cryptsoft.com).
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-recv.txt b/support/dktools/dktools/en/dk-recv.txt
index 843dd1335d..7fb7237a99 100644
--- a/support/dktools/dktools/en/dk-recv.txt
+++ b/support/dktools/dktools/en/dk-recv.txt
@@ -62,5 +62,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-send.txt b/support/dktools/dktools/en/dk-send.txt
index 2f2d132b5a..9648f83d10 100644
--- a/support/dktools/dktools/en/dk-send.txt
+++ b/support/dktools/dktools/en/dk-send.txt
@@ -73,5 +73,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-sort.txt b/support/dktools/dktools/en/dk-sort.txt
index b4769c9701..ed34e677ca 100644
--- a/support/dktools/dktools/en/dk-sort.txt
+++ b/support/dktools/dktools/en/dk-sort.txt
@@ -102,5 +102,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-sqlsplit.txt b/support/dktools/dktools/en/dk-sqlsplit.txt
index 8f0b822aa7..80b03f8b50 100644
--- a/support/dktools/dktools/en/dk-sqlsplit.txt
+++ b/support/dktools/dktools/en/dk-sqlsplit.txt
@@ -38,5 +38,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-t2db.txt b/support/dktools/dktools/en/dk-t2db.txt
index 185bfe476c..1c73b88613 100644
--- a/support/dktools/dktools/en/dk-t2db.txt
+++ b/support/dktools/dktools/en/dk-t2db.txt
@@ -112,5 +112,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-t2h.txt b/support/dktools/dktools/en/dk-t2h.txt
index db23c6e641..f03152e97f 100644
--- a/support/dktools/dktools/en/dk-t2h.txt
+++ b/support/dktools/dktools/en/dk-t2h.txt
@@ -57,5 +57,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-t2l.txt b/support/dktools/dktools/en/dk-t2l.txt
index b0868c1202..b78ed41e8d 100644
--- a/support/dktools/dktools/en/dk-t2l.txt
+++ b/support/dktools/dktools/en/dk-t2l.txt
@@ -41,6 +41,12 @@ OPTIONS
--verbose Show error message on interrupt by SIGPIPE.
+--check Load all translation tables and run syntax
+ check on them. This option can be used in
+ conjunction with preference --dir.charmap=...
+ to check all translation tables in a specified
+ directory.
+
EXIT STATUS
0 on success, all other values indicate errors.
@@ -110,5 +116,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk-uid.txt b/support/dktools/dktools/en/dk-uid.txt
index fdb0b2c950..5ad2715038 100644
--- a/support/dktools/dktools/en/dk-uid.txt
+++ b/support/dktools/dktools/en/dk-uid.txt
@@ -34,5 +34,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/dk4info.txt b/support/dktools/dktools/en/dk4info.txt
index d56e3458cb..0c08b00fe4 100644
--- a/support/dktools/dktools/en/dk4info.txt
+++ b/support/dktools/dktools/en/dk4info.txt
@@ -36,5 +36,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/lprngcl.txt b/support/dktools/dktools/en/lprngcl.txt
index 1b1bdd426f..5f7e995ad8 100644
--- a/support/dktools/dktools/en/lprngcl.txt
+++ b/support/dktools/dktools/en/lprngcl.txt
@@ -65,5 +65,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/en/plpdftex.txt b/support/dktools/dktools/en/plpdftex.txt
new file mode 100644
index 0000000000..8de746985e
--- /dev/null
+++ b/support/dktools/dktools/en/plpdftex.txt
@@ -0,0 +1,199 @@
+NAME
+
+ plpdftex - Plot into a combination of *.pdf/*.tex or *.eps/*.tex files.
+
+SYNOPSIS
+
+ plpdftex
+ plpdftex --check-presence
+ plpdftex --help
+ plpdftex --manual
+ plpdftex --license
+
+DESCRIPTION
+
+The program processes an incoming data stream containing both graphics
+instructions and text labels. Graphics instructions are written to a
+PDF or EPS file, text labels are written to a *.tex file.
+The *.tex file includes the PDF or EPS file containing the graphics and
+typesets the text labels on top of it.
+
+This program is not intended to be used directly, it is an output
+driver for the octpgfpl package for GNU Octave.
+
+
+OPTIONS
+
+--help Show this help text.
+
+--version Show version information.
+
+--license Show the license conditions.
+
+--check-presence Print the protocol version, may be used to
+ check for the presence of the program.
+
+EXIT STATUS
+
+0 on success, all other exit status codes indicate an error.
+
+INPUT FILE
+
+Input is read from standard input.
+
+The first line specifies a file name combination. It must end on
+either ``.pdftex'' to produce a *.pdf/*.tex combination for inclusion
+in a LaTeX document or on ``.pdftexs'' to produce a *.pdf/*.tex
+combination for standalone processing.
+Use ``.epstex'' to produce a *.eps/*.tex combination for inclusion
+in a LaTeX document.
+
+The second line contains two unsigned integer numbers, separated
+by spaces: Image width and height in PS/PDF points (known as bp in
+LaTeX).
+
+The remaining lines describe the image, there are ``t'' lines
+and ``p'' lines, i.e.
+
+t fs 12
+t font-setup \usepackage[T1]{fontenc}
+t package \usepackage[intlimit]{amsmath}
+t preamble \DeclareMathOperator{\intd}{\text{d}}
+t text 10 20 base left black This is a test.
+t text-box 10 20 base left red This is another test.
+p gsave
+p grestore
+p lw 3
+p buttcap
+p miterjoin
+p nodash
+p stroke-color blue!50!black
+p fill-color red!80!white
+p prepare-stroke
+p prepare-fill
+p rectangle 5 5 200 80
+p circle 20 30 5
+p moveto 30 80
+p lineto 50 90
+p curveto 50 100 100 100 100 90
+p closepath
+p stroke
+p fill
+p clip
+
+The ``t fs'' ``t font-setup'', ``t package'' and ``t preamble''
+lines are only used when producing a *.pdf/*.tex file combination for
+standalone processing, otherwise they are ignored.
+
+``t fs'' specifies the font size for the documentclass line.
+This line must be used before ``t font-setup'', ``t package'', ``t preamble'',
+``t text'' or ``p'' lines. The line is optional, by default the documentclass
+is written without the font size specification.
+
+``t font-setup'' specifies usepackage and other instructions for font
+setup. These lines are optional, a default font setup section is used
+if no ``t font-setup'' lines are used.
+
+``t preamble'' lines contain further setup instructions for the preamble,
+they are optional.
+
+``t text'' lines contain text labels to show. The line contains
+x position, y position, vertical alignment (bottom, base, centered,
+or top), horizontal alignment (left, centered, or right), color
+and the text to show.
+
+All color definitions must be LaTeX color strings like
+``blue!50!white'.
+
+``t text-box'' lines contain text labels to show. The line contains
+x position, y position, vertical alignment (bottom, base, centered,
+or top), horizontal alignment (left, centered, or right), color
+and the text to show.
+
+``p'' lines contain graphics instructions transferred to the PDF or EPS file.
+
+``p gsave'' saves the current graphics state.
+
+``p grestore'' restores the graphics state.
+
+``p lw'' sets the line width for stroking.
+
+``p buttcap'' sets line cap style to butted.
+
+``p miterjoin'' sets the line join style to miter.
+
+``p nodash'' sets up contiguous line style.
+
+``p stroke-color'' sets the stroke color.
+
+``p fill-color'' sets the fill color.
+
+``p prepare-stroke'' announces the purpose of the next graphics object(s):
+stroking. For EPS+TeX output plpdftex sets the current color to the
+stroking color.
+
+``p prepare-fill'' announces the purpose of the next graphics object(s):
+filling. For EPS+TeX output pldpdftex sets the current color to the
+non-stroking color.
+
+``p rectangle'' creates a rectangular path, specify start x position,
+start y position, end x position and end y position.
+
+``p circle'' creates a circular path, specify center x position,
+center y position and radius.
+
+``p moveto'' starts a new path and moves the current position
+to the specified x and y position.
+
+``p lineto'' adds a line segment from the current position to the specified
+x and y position to the path.
+
+``p curveto'' adds a Bezier segment starting at the current position
+to the path. Specify x and y position of the first control point,
+x and y position of the second control point and x and y position
+of the final point.
+
+``p closepath'' closes the current path.
+
+``p stroke'' strokes the current path.
+
+``p fill'' fills the current path.
+
+``p clip'' uses the current path as clip path.
+
+
+OUTPUT FILES
+
+The output file names are determined from the first input line.
+
+NOTES
+
+The plpdftex program does not support all features of PDF/TeX or EPS/TeX
+file pairs, it is only intended as an output driver for the pgfplot()
+instruction in the octpgfpl package for GNU Octave.
+
+RESTRICTIONS
+
+Color definitions for plpdftex must only contain color names ``white'',
+``black'', ``red'', ``green'', ``blue'', ``cyan'', ``magenta'', ``yellow'',
+``gray'', ``lightgray'', ``darkgray'', ``brown'', ``lime'', ``olive'',
+``orange'', ``pink'', ``purple'', ``teal'', ``violet'' and combinations
+like ``red!50!black''.
+
+The color definitions mentioned above are used ``as is'' in the *.tex
+output files. For PDF and EPS output RGB values are used.
+
+AUTHOR
+
+Dirk Krause
+
+COPYRIGHT AND LICENSE
+
+Run
+ plpdftex --license
+to see the license conditions.
+
+SEE ALSO
+
+http://sourceforge.net/p/dktools/wiki/Home/
+http://sourceforge.net/p/octpgfpl/wiki/Home/
diff --git a/support/dktools/dktools/en/wxd2lat.txt b/support/dktools/dktools/en/wxd2lat.txt
new file mode 100644
index 0000000000..28b0c53fcf
--- /dev/null
+++ b/support/dktools/dktools/en/wxd2lat.txt
@@ -0,0 +1,180 @@
+
+NAME
+
+wxd2lat - Converter from *.wxd to LaTeX
+
+SYNOPSIS
+
+wxd2lat [option(s)] [path(s)]
+
+DESCRIPTION
+
+The wxd2lat program converts *.wxd files produced by wxdkdraw to file formats
+for use with LaTeX/pdfLaTeX.
+
+The program processes the paths specified as
+command line arguments, if any. For each *.wxd file it creates an output file
+or output file pair keeping the base file name and using suffixes .pdf, .eps
+and/or .tex.
+For paths specifying a directory, the program traverses the directory and
+runs a conversion for each *.wxd file found.
+If not paths are specified on the command line, the program traverses the
+current directory and runs a conversion for each *.wxd file found.
+
+The following files or file pairs can be produced:
+
+- PDF+TeX
+ A *.pdf and a *.tex file. The PDF file contains the non-text graphics objects.
+ The TeX file includes the PDF file and typesets the text labels on top of it.
+
+- EPS+TeX
+ A *.eps and a *.tex file. The EPS file contains the non-text graphics objects.
+ The TeX file includes the EPS file and typesets the text labels on top of it.
+
+- TeX
+ A *.tex file containing graphics instructions for both non-text graphics
+ objects and text labels.
+ The pgfcore package must be used.
+
+
+OPTIONS
+
+-b width, --baselinewidth=width
+
+ sets the base line width. Default: 1/160 inch.
+ Use width specifications like "0.4pt", "0.45" (same as "0.45bp"),
+ "0.15mm" or "0.00625in".
+
+
+-d, --document
+
+ creates a complete standalone LaTeX document. By default wxd2lat
+ creates an object for use in a LaTeX document.
+ The -d option can not be used when producing eps output.
+
+
+-l outputformat, --language=outputformat
+
+ chooses the output format, one from:
+ - "pdf" (create PDF+TeX file pair),
+ - "eps" (create EPS+TeX file pair), or
+ - "tex" (create TeX file containing pgfcore graphics instructions).
+ For detailed configuration you can add key=value pairs separated
+ by comma.
+
+
+-m, --make
+
+ avoids unnecessary conversions. Before running a conversion the program
+ checks whether output file(s) are present and up to date.
+
+
+-p width, --pattern-linewidth=width
+
+ sets the line width for fill patterns. Default: 1/160 inch.
+
+
+-R, --reset
+
+ suppresses use of dk4gra.conf configuration files.
+
+
+-w, --white-background
+
+ fills background using white colour. By default there is no
+ background filling, so drawing regions not covered by graphics
+ elements are transparent.
+
+
+KEY=VALUE PAIRS
+
+The key=value pairs allow detaild settings.
+
+For boolean type keys the value is not required. Simply mentioning the key
+activates the option. For example "-leps,level=2,lzw" is equal to
+"-leps,level=2,lzw=on". For booleans you can use "on", "true" or "yes"
+to activate an option. Use "off", "false" or "no" to deactivate a boolean
+option.
+
+The following keys can be used:
+
+level=integer
+ PS language level, 2 or 3. Default: 3.
+
+dsc=boolean
+ Write DSC comments (document structuring convention) into PS/EPS
+ output. Default: off.
+
+lzw=boolean
+ Allow LZW compression when embedding bitmap image into PS level 2
+ output. Default: off.
+
+color=boolean
+ Allow coloured output. Default: on.
+ Deactivating this option results in gray output.
+
+rgb-to-gray=string
+ Choose default method for RGB to gray conversion. Default: bt601.
+
+rgb-to-cmyk=string
+ Choose default method for RGB to CMYK conversion. Default: non-standard.
+ The wxd2lat program does not produce CMYK output, there is no plan
+ to add such a feature. The option is mentioned here just for
+ completeness as the libdk4gra library supports this option.
+
+xsss=integer
+ Number of Bezier segments to draw for each X-spline segment.
+ Default: 8. The recommended range is 4 to 16.
+
+xslp=float
+ Tolerance for X-spline segment length calculation.
+ Iteration is finished successfully if the difference between the
+ results of current pass and previous pass are below the specified
+ level.
+
+xspp=float
+ Tolerance in search for the t parameter to produce a given length
+ X-spline sub segment.
+ Iteration is finished successfully if the difference between the
+ results of current pass and previous pass are below the specified
+ level.
+ The xspp value should be at least 4 times the xslp value.
+
+EXIT STATUS
+
+0 on success, all other values indicate errors.
+
+
+EXAMPLES
+
+wxd2lat -leps test1.wxd
+ processes input file test1.wxd and produces files test1.tex and
+ test1.eps.
+ In a LaTeX document use "\input{test1.tex}" to use the drawing.
+
+wxd2lat -d -lpdf test1.wxd
+ processes input file test1.wxd and produces the files test1.tex
+ and test1-i.pdf.
+ Run the "pdflatex test1" command to produce the final test1.pdf file.
+
+
+FILES
+
+Normally - without the -R option - the program searches for dk4gra.conf files
+after processing the output language. The sections matching the output format
+are processed.
+
+AUTHOR
+
+Dirk Krause
+
+COPYRIGHT AND LICENSE
+
+Run
+ wxd2lat --license
+to see license information.
+
+SEE ALSO
+
+http://sourceforge.net/p/dktools/wiki/Home/
+
diff --git a/support/dktools/dktools/en/x.txt b/support/dktools/dktools/en/x.txt
index ad8d98811b..e099fb3be0 100644
--- a/support/dktools/dktools/en/x.txt
+++ b/support/dktools/dktools/en/x.txt
@@ -43,5 +43,5 @@ to see license information.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/Home/
diff --git a/support/dktools/dktools/help/de/winprint.chm b/support/dktools/dktools/help/de/winprint.chm
new file mode 100644
index 0000000000..f33f95eb52
--- /dev/null
+++ b/support/dktools/dktools/help/de/winprint.chm
Binary files differ
diff --git a/support/dktools/help-htb/de/winprint.htb b/support/dktools/dktools/help/de/winprint.htb
index 9fb4017e3c..ce6070829b 100644
--- a/support/dktools/help-htb/de/winprint.htb
+++ b/support/dktools/dktools/help/de/winprint.htb
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxbmpp.chm b/support/dktools/dktools/help/de/wxbmpp.chm
new file mode 100644
index 0000000000..7529549c42
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxbmpp.chm
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxbmpp.htb b/support/dktools/dktools/help/de/wxbmpp.htb
new file mode 100644
index 0000000000..b9aff948c9
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxbmpp.htb
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxdkclock.chm b/support/dktools/dktools/help/de/wxdkclock.chm
new file mode 100644
index 0000000000..76f78e16c2
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxdkclock.chm
Binary files differ
diff --git a/support/dktools/help-htb/de/wxdkclock.htb b/support/dktools/dktools/help/de/wxdkclock.htb
index aba3995a2b..3cb24cc41f 100644
--- a/support/dktools/help-htb/de/wxdkclock.htb
+++ b/support/dktools/dktools/help/de/wxdkclock.htb
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxdkct.chm b/support/dktools/dktools/help/de/wxdkct.chm
new file mode 100644
index 0000000000..3347b6cfc3
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxdkct.chm
Binary files differ
diff --git a/support/dktools/help-htb/de/wxdkct.htb b/support/dktools/dktools/help/de/wxdkct.htb
index 3c22d5e6f1..a541f9231f 100644
--- a/support/dktools/help-htb/de/wxdkct.htb
+++ b/support/dktools/dktools/help/de/wxdkct.htb
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxdkdraw.chm b/support/dktools/dktools/help/de/wxdkdraw.chm
new file mode 100644
index 0000000000..db314788b9
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxdkdraw.chm
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxdkdraw.htb b/support/dktools/dktools/help/de/wxdkdraw.htb
new file mode 100644
index 0000000000..3a74ca7461
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxdkdraw.htb
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxdkfcs.chm b/support/dktools/dktools/help/de/wxdkfcs.chm
new file mode 100644
index 0000000000..136e431ce9
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxdkfcs.chm
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxdkfcs.htb b/support/dktools/dktools/help/de/wxdkfcs.htb
new file mode 100644
index 0000000000..e2459c5363
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxdkfcs.htb
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxdkscrsz.chm b/support/dktools/dktools/help/de/wxdkscrsz.chm
new file mode 100644
index 0000000000..ba3eb9fa88
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxdkscrsz.chm
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxdkscrsz.htb b/support/dktools/dktools/help/de/wxdkscrsz.htb
new file mode 100644
index 0000000000..3e9fcb93c6
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxdkscrsz.htb
Binary files differ
diff --git a/support/dktools/dktools/help/de/wximgsz.chm b/support/dktools/dktools/help/de/wximgsz.chm
new file mode 100644
index 0000000000..fa99f43a77
--- /dev/null
+++ b/support/dktools/dktools/help/de/wximgsz.chm
Binary files differ
diff --git a/support/dktools/dktools/help/de/wximgsz.htb b/support/dktools/dktools/help/de/wximgsz.htb
new file mode 100644
index 0000000000..bef8bd4a82
--- /dev/null
+++ b/support/dktools/dktools/help/de/wximgsz.htb
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxpqdic.chm b/support/dktools/dktools/help/de/wxpqdic.chm
new file mode 100644
index 0000000000..90f78488b9
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxpqdic.chm
Binary files differ
diff --git a/support/dktools/dktools/help/de/wxpqdic.htb b/support/dktools/dktools/help/de/wxpqdic.htb
new file mode 100644
index 0000000000..6fefffada6
--- /dev/null
+++ b/support/dktools/dktools/help/de/wxpqdic.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/winprint.chm b/support/dktools/dktools/help/en/winprint.chm
new file mode 100644
index 0000000000..ae0a2ac623
--- /dev/null
+++ b/support/dktools/dktools/help/en/winprint.chm
Binary files differ
diff --git a/support/dktools/help-htb/en/winprint.htb b/support/dktools/dktools/help/en/winprint.htb
index e60be08e16..0cf26f4592 100644
--- a/support/dktools/help-htb/en/winprint.htb
+++ b/support/dktools/dktools/help/en/winprint.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxbmpp.chm b/support/dktools/dktools/help/en/wxbmpp.chm
new file mode 100644
index 0000000000..a88f3ec31d
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxbmpp.chm
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxbmpp.htb b/support/dktools/dktools/help/en/wxbmpp.htb
new file mode 100644
index 0000000000..0e1dd93963
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxbmpp.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxdkclock.chm b/support/dktools/dktools/help/en/wxdkclock.chm
new file mode 100644
index 0000000000..d086d38085
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxdkclock.chm
Binary files differ
diff --git a/support/dktools/help-htb/en/wxdkclock.htb b/support/dktools/dktools/help/en/wxdkclock.htb
index 2c16df212b..9231e211bf 100644
--- a/support/dktools/help-htb/en/wxdkclock.htb
+++ b/support/dktools/dktools/help/en/wxdkclock.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxdkct.chm b/support/dktools/dktools/help/en/wxdkct.chm
new file mode 100644
index 0000000000..47910d994a
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxdkct.chm
Binary files differ
diff --git a/support/dktools/help-htb/en/wxdkct.htb b/support/dktools/dktools/help/en/wxdkct.htb
index 740652af70..af0d6ea208 100644
--- a/support/dktools/help-htb/en/wxdkct.htb
+++ b/support/dktools/dktools/help/en/wxdkct.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxdkdraw.chm b/support/dktools/dktools/help/en/wxdkdraw.chm
new file mode 100644
index 0000000000..5bdea5750a
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxdkdraw.chm
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxdkdraw.htb b/support/dktools/dktools/help/en/wxdkdraw.htb
new file mode 100644
index 0000000000..15956013df
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxdkdraw.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxdkfcs.chm b/support/dktools/dktools/help/en/wxdkfcs.chm
new file mode 100644
index 0000000000..38d2d69a04
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxdkfcs.chm
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxdkfcs.htb b/support/dktools/dktools/help/en/wxdkfcs.htb
new file mode 100644
index 0000000000..44ba60cbe1
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxdkfcs.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxdkscrsz.chm b/support/dktools/dktools/help/en/wxdkscrsz.chm
new file mode 100644
index 0000000000..e60d35dfef
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxdkscrsz.chm
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxdkscrsz.htb b/support/dktools/dktools/help/en/wxdkscrsz.htb
new file mode 100644
index 0000000000..150692579d
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxdkscrsz.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/wximgsz.chm b/support/dktools/dktools/help/en/wximgsz.chm
new file mode 100644
index 0000000000..ff2741d616
--- /dev/null
+++ b/support/dktools/dktools/help/en/wximgsz.chm
Binary files differ
diff --git a/support/dktools/dktools/help/en/wximgsz.htb b/support/dktools/dktools/help/en/wximgsz.htb
new file mode 100644
index 0000000000..4459fd7290
--- /dev/null
+++ b/support/dktools/dktools/help/en/wximgsz.htb
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxpqdic.chm b/support/dktools/dktools/help/en/wxpqdic.chm
new file mode 100644
index 0000000000..0a5aa7411c
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxpqdic.chm
Binary files differ
diff --git a/support/dktools/dktools/help/en/wxpqdic.htb b/support/dktools/dktools/help/en/wxpqdic.htb
new file mode 100644
index 0000000000..06669b8208
--- /dev/null
+++ b/support/dktools/dktools/help/en/wxpqdic.htb
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/GNUmakefile b/support/dktools/dktools/htmlbook/GNUmakefile
index 42e7d04a7a..f3bdb7e228 100644
--- a/support/dktools/dktools/htmlbook/GNUmakefile
+++ b/support/dktools/dktools/htmlbook/GNUmakefile
@@ -1,3 +1,6 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
#
# CONFIGURATION:
# Set language here.
@@ -45,6 +48,9 @@ IMAGES := \
$(patsubst %.fig,%.png,$(wildcard *.fig)) \
$(patsubst %.fig,%.pdf,$(wildcard *.fig)) \
$(patsubst %.fig,%.svg,$(wildcard *.fig)) \
+ $(patsubst %.wxd,%.png,$(wildcard *.wxd)) \
+ $(patsubst %.wxd,%.pdf,$(wildcard *.wxd)) \
+ $(patsubst %.wxd,%.svg,$(wildcard *.wxd)) \
$(patsubst %.gp,%.png,$(wildcard *.gp)) \
$(patsubst %.gp,%.pdf,$(wildcard *.gp)) \
$(patsubst %.gp,%.svg,$(wildcard *.gp)) \
@@ -55,7 +61,7 @@ IMAGES := \
#
# Suffixes for graphics files
#
-.SUFFIXES: .png .svg .pdf .tex .fig .gp
+.SUFFIXES: .png .svg .pdf .tex .fig .wxd .gp
#
# Graphics conversion rules
@@ -66,6 +72,9 @@ IMAGES := \
.fig.pdf:
gxhconvert -o=pdf $<
+.wxd.pdf:
+ gxhconvert -o=pdf $<
+
.gp.pdf:
gxhconvert -o=pdf $<
@@ -84,7 +93,7 @@ IMAGES := \
#
# Names of icon files
#
-ICONS= home.png toc.png prev.png next.png index.png
+ICONS= home.svg toc.svg prev.svg next.svg index.svg
#
# The first target is the default target.
@@ -114,30 +123,25 @@ chminstall: $(TEXTFILES) $(HBTFILES) $(PRJFILES) $(IMAGES)
# Icons
#
-home.png: # Icon to return to homepage
-home.png: home.fig
- gxhconvert -o=png -r=36 -a $<
- optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+home.svg: # Icon to return to homepage
+home.svg: home.wxd
+ gxhconvert -o=svg -a $<
-toc.png: # Icon for table of contents
-toc.png: toc.fig
- gxhconvert -o=png -r=36 -a $<
- optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+toc.svg: # Icon for table of contents
+toc.svg: toc.wxd
+ gxhconvert -o=svg -a $<
-prev.png: # Icon to go back to previous page
-prev.png: prev.fig
- gxhconvert -o=png -r=36 -a $<
- optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+prev.svg: # Icon to go back to previous page
+prev.svg: prev.wxd
+ gxhconvert -o=svg -a $<
-next.png: # Icon to go forward to next page
-next.png: next.fig
- gxhconvert -o=png -r=36 -a $<
- optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+next.svg: # Icon to go forward to next page
+next.svg: next.wxd
+ gxhconvert -o=svg -a $<
-index.png: # Icon to go to keyword index
-index.png: index.fig
- gxhconvert -o=png -r=36 -a $<
- optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+index.svg: # Icon to go to keyword index
+index.svg: index.wxd
+ gxhconvert -o=svg -a $<
help: # Show targets in GNUmakefile
@echo 'Here is a list of the targets in this GNUmakefile:'
diff --git a/support/dktools/dktools/htmlbook/chm.css b/support/dktools/dktools/htmlbook/chm.css
new file mode 100644
index 0000000000..74a384bc4b
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/chm.css
@@ -0,0 +1,20 @@
+/*
+Copyright (C) 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+}
+pre > i {
+ font-family: inherit;
+ font-style: italic;
+}
+span.pro {
+ font-weight: bold;
+ color: Green;
+}
+span.contra {
+ font-weight: bold;
+ color: DarkRed;
+}
diff --git a/support/dktools/dktools/htmlbook/chm.hbt b/support/dktools/dktools/htmlbook/chm.hbt
index cbdd3b2108..99ce7b8b25 100644
--- a/support/dktools/dktools/htmlbook/chm.hbt
+++ b/support/dktools/dktools/htmlbook/chm.hbt
@@ -1 +1 @@
-<div>%%contents%%</div>
+%%contents%%
diff --git a/support/dktools/dktools/htmlbook/home-i.pdf b/support/dktools/dktools/htmlbook/home-i.pdf
new file mode 100644
index 0000000000..944498055d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/home-i.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/home.fig b/support/dktools/dktools/htmlbook/home.fig
deleted file mode 100644
index 25372f1f55..0000000000
--- a/support/dktools/dktools/htmlbook/home.fig
+++ /dev/null
@@ -1,22 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-0 32 #364e6d
-2 2 0 0 7 7 999 1 -1 1.00 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-2 4 0 0 0 0 105 1 5 0 0 0 19 0 0 5
- 150 150 1125 150 1125 1125 150 1125 150 150
-2 4 0 0 0 0 104 1 10 0 0 0 19 0 0 5
- 112 112 1087 112 1087 1087 112 1087 112 112
-2 4 0 0 4 4 103 1 20 0 0 0 16 0 0 5
- 75 75 1050 75 1050 1050 75 1050 75 75
-2 4 0 0 6 6 102 1 20 0 0 0 16 0 0 5
- 150 150 975 150 975 975 150 975 150 150
-2 3 0 0 4 4 100 1 20 0 0 0 12 0 0 4
- 225 787 900 787 562 300 225 787
diff --git a/support/dktools/dktools/htmlbook/home.pdf b/support/dktools/dktools/htmlbook/home.pdf
new file mode 100644
index 0000000000..ce5430cf12
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/home.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/home.png b/support/dktools/dktools/htmlbook/home.png
index e368b62492..2ff523b99b 100644
--- a/support/dktools/dktools/htmlbook/home.png
+++ b/support/dktools/dktools/htmlbook/home.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/home.svg b/support/dktools/dktools/htmlbook/home.svg
new file mode 100644
index 0000000000..fdc4b5d73b
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/home.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 13.5 47.21875 L 54 47.21875 L 33.71875 18 Z M 13.5 47.21875 "/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/home.tex b/support/dktools/dktools/htmlbook/home.tex
new file mode 100644
index 0000000000..aec092133b
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/home.tex
@@ -0,0 +1,40 @@
+\documentclass[12pt]{article}
+% begin font setup
+\usepackage[T1]{fontenc}
+\usepackage{mathptmx}
+\usepackage[scaled=.92]{helvet}
+\usepackage{courier}
+% end font setup
+% begin other packages
+\usepackage{textcomp}
+\usepackage[intlimits]{amsmath}
+% end other packages
+\usepackage{graphicx}
+\usepackage{color}
+\setlength{\paperwidth}{72bp}
+\setlength{\paperheight}{72bp}
+\pagestyle{empty}
+\setlength{\voffset}{-1in}
+\setlength{\topmargin}{0bp}
+\setlength{\headheight}{0bp}
+\setlength{\headsep}{0bp}
+\setlength{\topskip}{0bp}
+\setlength{\hoffset}{-1in}
+\setlength{\oddsidemargin}{0bp}
+\setlength{\evensidemargin}{0bp}
+\setlength{\marginparwidth}{0bp}
+\setlength{\marginparsep}{0bp}
+\setlength{\textwidth}{\paperwidth}
+\setlength{\textheight}{\paperheight}
+\setlength{\parskip}{0bp}
+\setlength{\parindent}{0bp}
+\setlength{\pdfpagewidth}{\paperwidth}
+\setlength{\pdfpageheight}{\paperheight}
+\begin{document}%
+\begin{picture}(0,0)
+\includegraphics{home-i.pdf}
+\end{picture}%
+\setlength{\unitlength}{1bp}%
+\begin{picture}(72,72)
+\end{picture}%
+\end{document}
diff --git a/support/dktools/dktools/htmlbook/home.wxd b/support/dktools/dktools/htmlbook/home.wxd
new file mode 100644
index 0000000000..9e8a366ad8
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/home.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 6096000 0 6096000
+0 2 8
+11 -1 169 169 169 255 255 255 8 0 4 0
+ 1016000 5588000 508000 5080000 1143000
+11 0 255 228 196 255 255 255 8 0 4 0
+ 508000 5080000 1016000 5588000 1143000
+6 3 0 128 0 0 128 0 0 0 0 4 0 8 1
+ 3048000 4572000
+ 1778000 1651000
+ 4318000 1651000
diff --git a/support/dktools/dktools/htmlbook/htmlbook.sh b/support/dktools/dktools/htmlbook/htmlbook.sh
new file mode 100755
index 0000000000..7354bfae65
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/htmlbook.sh
@@ -0,0 +1,157 @@
+#! /bin/sh
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+EXITCODE=0
+rm -fr '/home/joe/work/test-html'
+mkdir -p '/home/joe/work/test-html'
+if [ -f 'example1.c' ]
+then
+ln 'example1.c' '/home/joe/work/test-html'
+else
+echo 'ERROR: File example1.c does not exist'
+EXITCODE=1
+fi
+if [ -f 'favicon.ico' ]
+then
+ln 'favicon.ico' '/home/joe/work/test-html'
+else
+echo 'ERROR: File favicon.ico does not exist'
+EXITCODE=1
+fi
+if [ -f 'home.png' ]
+then
+ln 'home.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File home.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'index.png' ]
+then
+ln 'index.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File index.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'mylogo.png' ]
+then
+ln 'mylogo.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File mylogo.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'next.png' ]
+then
+ln 'next.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File next.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'prev.png' ]
+then
+ln 'prev.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File prev.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'style.css' ]
+then
+ln 'style.css' '/home/joe/work/test-html'
+else
+echo 'ERROR: File style.css does not exist'
+EXITCODE=1
+fi
+if [ -f 'toc.png' ]
+then
+ln 'toc.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File toc.png does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/index.html' ]
+then
+rm -fr '/home/joe/work/test-html/index.html'
+fi
+if [ -f 'index.html' ]
+then
+echo TIDY index.html
+tidy -q -utf8 < 'index.html' > '/home/joe/work/test-html/index.html'
+else
+echo 'ERROR: File index.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/installu.html' ]
+then
+rm -fr '/home/joe/work/test-html/installu.html'
+fi
+if [ -f 'installu.html' ]
+then
+echo TIDY installu.html
+tidy -q -utf8 < 'installu.html' > '/home/joe/work/test-html/installu.html'
+else
+echo 'ERROR: File installu.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/instalus.html' ]
+then
+rm -fr '/home/joe/work/test-html/instalus.html'
+fi
+if [ -f 'instalus.html' ]
+then
+echo TIDY instalus.html
+tidy -q -utf8 < 'instalus.html' > '/home/joe/work/test-html/instalus.html'
+else
+echo 'ERROR: File instalus.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/instalux.html' ]
+then
+rm -fr '/home/joe/work/test-html/instalux.html'
+fi
+if [ -f 'instalux.html' ]
+then
+echo TIDY instalux.html
+tidy -q -utf8 < 'instalux.html' > '/home/joe/work/test-html/instalux.html'
+else
+echo 'ERROR: File instalux.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/installw.html' ]
+then
+rm -fr '/home/joe/work/test-html/installw.html'
+fi
+if [ -f 'installw.html' ]
+then
+echo TIDY installw.html
+tidy -q -utf8 < 'installw.html' > '/home/joe/work/test-html/installw.html'
+else
+echo 'ERROR: File installw.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/startu.html' ]
+then
+rm -fr '/home/joe/work/test-html/startu.html'
+fi
+if [ -f 'startu.html' ]
+then
+echo TIDY startu.html
+tidy -q -utf8 < 'startu.html' > '/home/joe/work/test-html/startu.html'
+else
+echo 'ERROR: File startu.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/startw.html' ]
+then
+rm -fr '/home/joe/work/test-html/startw.html'
+fi
+if [ -f 'startw.html' ]
+then
+echo TIDY startw.html
+tidy -q -utf8 < 'startw.html' > '/home/joe/work/test-html/startw.html'
+else
+echo 'ERROR: File startw.html does not exist'
+EXITCODE=1
+fi
+find '/home/joe/work/test-html' -type d -exec chmod ugo+rx {} \;
+find '/home/joe/work/test-html' -type f -exec chmod ugo+r {} \;
+exit $EXITCODE
diff --git a/support/dktools/dktools/htmlbook/index.fig b/support/dktools/dktools/htmlbook/index.fig
deleted file mode 100644
index 3d776a5db2..0000000000
--- a/support/dktools/dktools/htmlbook/index.fig
+++ /dev/null
@@ -1,24 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-0 32 #364e6d
-2 2 0 0 7 7 999 1 -1 1.00 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-2 4 0 0 0 0 105 1 5 0 0 0 19 0 0 5
- 150 150 1125 150 1125 1125 150 1125 150 150
-2 4 0 0 0 0 104 1 10 0 0 0 19 0 0 5
- 112 112 1087 112 1087 1087 112 1087 112 112
-2 4 0 0 4 4 103 1 20 0 0 0 16 0 0 5
- 75 75 1050 75 1050 1050 75 1050 75 75
-2 4 0 0 6 6 102 1 20 0 0 0 16 0 0 5
- 150 150 975 150 975 975 150 975 150 150
-1 1 0 0 0 0 100 1 20 0 1 0.0 524 524 318 319 206 205 842 843
-2 1 0 5 0 0 100 1 -1 0 0 0 12 0 0 2
- 881 881 731 731
-1 1 0 0 7 7 99 1 20 0 1 0.0 525 525 262 262 263 263 787 787
diff --git a/support/dktools/dktools/htmlbook/index.html b/support/dktools/dktools/htmlbook/index.html
new file mode 100644
index 0000000000..9c9c14228f
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/index.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Introduction to something</title>
+<!--
+Generated by htmlbook (see http://sourceforge.net/p/dktools/wiki/htmlbook%20manual/)
+-->
+<meta name="generator" content="htmlbook (http://sourceforge.net/p/dktools/wiki/htmlbook%20manual/)">
+<link rel="stylesheet" type="text/css" href="style.css">
+<link rel="shortcut icon" href="favicon.ico">
+<link rel="author" title="Impressum" href="http://www.my-server.org/impressum.html">
+<link rel="contents" title="Introduction to something" href="index.html#hb_toc">
+<link rel="index" title="Introduction to something" href="index.html">
+<link rel="top" title="Introduction to something" href="index.html">
+<link rel="first" title="Introduction to something" href="index.html">
+<link rel="next" title="Install something on Linux/Unix" href="installu.html">
+<link rel="last" title="Start something on Windows" href="startw.html">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="author" content="Me, myself and I">
+</head>
+<body>
+<div class="header">
+<div class="headerleft">
+<img src="mylogo.png" alt="My introduction to something" title="My introduction to something" border="0">
+
+</div><!-- class="headerleft" -->
+<div class="headerright">
+</div><!-- class="headerright" -->
+<div class="headercenter">
+<span class="title">Introduction to something</span>
+</div><!-- class="headercenter" -->
+</div><!-- class="header" -->
+<div class="navicon">
+<div class="hb_nm_div">
+<ul class="hb_nm_ul">
+<li class="hb_nm_li"><a href="http://www.my-server.org/impressum.html" class="hb_nm_a" title="Impressum">Impressum</a></li>
+<li class="hb_nm_sep">&nbsp;</li>
+<li class="hb_nm_li"><a href="installu.html" class="hb_nm_a" title="1 Something">Something</a></li>
+<li class="hb_nm_li"><a href="startu.html" class="hb_nm_a" title="2 Start something">Start something</a></li>
+</ul><!-- class=hb_nm_ul -->
+</div><!-- class=hb_nm_div -->
+
+<div class="naviheader">&nbsp;</div>
+<div class="contents">
+<div class="hb_navigation"><img src="home.png" alt="Zur Startseite: Introduction to something" title="Auf der Startseite." class="hb_navi_img" border="0" width="36" height="36">&nbsp;<img src="prev.png" alt="Zur vorherigen Seite: " title="Auf der ersten Seite." class="hb_navi_img" border="0" width="36" height="36">&nbsp;<a class="hb_navi_a" href="installu.html" title="Zur n&auml;chsten Seite: Install something on Linux/Unix"><img src="next.png" alt="Zur n&auml;chsten Seite: Install something on Linux/Unix" title="Zur n&auml;chsten Seite: Install something on Linux/Unix" class="hb_navi_img" border="0" width="36" height="36"></a>&nbsp;<a class="hb_navi_a" href="index.html#hb_toc" title="Zum Inhaltsverzeichnis: Introduction to something"><img src="toc.png" alt="Zum Inhaltsverzeichnis: Introduction to something" title="Zum Inhaltsverzeichnis: Introduction to something" class="hb_navi_img" border="0" width="36" height="36"></a></div>
+
+<div class="contents_from_text"></div><!-- class="contents_from_text" -->
+<div class="hb_navigation"><a class="hb_navi_a" href="index.html" title="Zur Startseite: Introduction to something"><img src="home.png" alt="Zur Startseite: Introduction to something" title="Zur Startseite: Introduction to something" class="hb_navi_img" border="0" width="36" height="36"></a>&nbsp;<img src="prev.png" alt="Zur vorherigen Seite: " title="Auf der ersten Seite." class="hb_navi_img" border="0" width="36" height="36">&nbsp;<a class="hb_navi_a" href="installu.html" title="Zur n&auml;chsten Seite: Install something on Linux/Unix"><img src="next.png" alt="Zur n&auml;chsten Seite: Install something on Linux/Unix" title="Zur n&auml;chsten Seite: Install something on Linux/Unix" class="hb_navi_img" border="0" width="36" height="36"></a>&nbsp;<a class="hb_navi_a" href="index.html#hb_toc" title="Zum Inhaltsverzeichnis: Introduction to something"><img src="toc.png" alt="Zum Inhaltsverzeichnis: Introduction to something" title="Zum Inhaltsverzeichnis: Introduction to something" class="hb_navi_img" border="0" width="36" height="36"></a></div>
+
+</div><!-- class="contents" -->
+</div><!-- class="navicon" -->
+<div class="footer">
+<div class="footerleft">Me, myself and I</div>
+<div class="footerright">Somewhere, 06.04.2018</div>
+<div class="footercenter">&nbsp;</div>
+</div><!-- class="footer" -->
+</body>
+</html>
diff --git a/support/dktools/dktools/htmlbook/index.pdf b/support/dktools/dktools/htmlbook/index.pdf
new file mode 100644
index 0000000000..3aa737607d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/index.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/index.png b/support/dktools/dktools/htmlbook/index.png
index 6eb43e21de..44a8023cc2 100644
--- a/support/dktools/dktools/htmlbook/index.png
+++ b/support/dktools/dktools/htmlbook/index.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/index.prj b/support/dktools/dktools/htmlbook/index.prj
index 7e5144e4da..c78358a016 100644
--- a/support/dktools/dktools/htmlbook/index.prj
+++ b/support/dktools/dktools/htmlbook/index.prj
@@ -27,6 +27,12 @@ url = http://www.my-server.org/something
impressum link = http://www.my-server.org/impressum.html
# impressum page = impressum.txt
+# Privacy declaration included in contents.
+# Alternatively sou could use "privacy page".
+# -------------------------------------------
+privacy link = http://www.my-server.org/privacy.html
+# privacy page = privacy.txt
+
# Authors name.
# May be changed per node.
# ------------------------
@@ -41,13 +47,24 @@ location = Somewhere
#
# ##### END OF REQUIRED SETTINGS
+# Explicity set input encoding
+# Default: System encoding
+# ----------------------------
+# input encoding = utf-8
+# HTML document type
+# ------------------
+html doctype = html-5
# Output character set, us-ascii or utf-8.
# May be changed per node.
# ----------------------------------------
html charset = utf-8
+# Language specification for HTML-5 tag
+# -------------------------------------
+html lang = en
+
# Template used for all output files.
# May be changed per node.
# -----------------------------------
@@ -66,19 +83,78 @@ style = style.css
# -----------------------------------------------
page toc = no
+# Create foldable page table of contents
+# --------------------------------------
+fold page toc = true
+
+# File containing JavaScript code to fold and unfold the page TOC.
+# This file is referenced by all nodes containing a page TOC
+# if foldable page TOCs are enabled.
+# ----------------------------------------------------------------
+page toc js file = ptoc.js
+
# File used to build the index.html start page.
# ---------------------------------------------
index file = index.txt
+# Enable/disable table of contents
+# --------------------------------
+create toc =yes
+
# Enable/disable clickable keywords index kw.html.
# ------------------------------------------------
create index = no
+# Write section numbers to index
+# ------------------------------
+section numbers in index = yes
+
+# Flag: Mark external links by special symbol in title text
+# ---------------------------------------------------------
+mark external links = yes
+
+# Marker symbol for external links in title text
+# ----------------------------------------------
+# Candidates:
+# 21F0 Rightwards white arrow from wall
+# 21A6 Rightwards arrow from bar
+# 21B1 Upwards arrow with tip rightwards
+# 21B6 Anticlockwise top semicircle arrow
+# 21B7 Clockwise top semicircle arrow
+# 21D7 North east double arrow
+# 21BA Anticlockwise open circle arrow
+# 21BB Clockwise open circle arrow
+# 21EA Upwards white arrow from bar
+# 21EB Upwards white arrow on pedestal
+# 279A Heavy north east arrow
+# 2B00 North east white arrow
+# 2B08 North east black arrow
+# 2B67 North east triangle headed arrow
+# 2BA3 Upwards triangle-headed arrow with long tip rightwards
+# 2BAB Black curved upwards and rightwards arrow
+# 2BB3 Ribbon arrow up right
+# 1F30D Earth globe Europe-Africa
+# 1F30E Earth globe Americas
+# 1F30F Earth globe Asia-Australia
+# 1F310 Globe with meridians (default)
+# 1F855 North east sans serif arrow
+# 1F865 Wide-headed north east light barb arrow
+# 1F875 Wide-headed north east medium barb arrow
+# 1F87D Wide-headed north east heavy barb arrow
+# 1F885 Wide-headed north east very heavy barb arrow
+external link marker symbol = 1F310
+
# Enable/disable conversion of ampersands.
# May be changed per node.
# ----------------------------------------
replace ampersand = no
+# Enable/disable summary attribute in table tags.
+# Today tidy complains about <table summary=...> attribute as obsoleted.
+# In HTML 5 set this to "no", for previous version to "yes"
+# ----------------------------------------------------------------------
+table summaries = no
+
# Enable/disable use of tidy for inspection/correction.
# May be changed per node.
# -----------------------------------------------------
@@ -95,20 +171,46 @@ ln = yes
# --------------------------------------------
write position = yes
+# Enable/disable section numbers in positions
+# -------------------------------------------
+section numbers in position = yes
+
+# Enable/disable section numbers in page headers
+# ----------------------------------------------
+section numbers in page headers = yes
+
# Switch navigation between "icons", "text", "both".
# This option was intended originally, but skipped.
# --------------------------------------------------
# navigation = icons
+# Navigation icons. Default is to use PNG files.
+# For responsive HTML we could switch to SVG
+# but how to find width and height attributes?
+# ----------------------------------------------
+icon home = home.png
+icon previous = prev.png
+icon next = next.png
+icon toc = toc.png
+icon index = index.png
+
# Shortcut icon.
# May be changed per node.
# -------------------------------------------
shortcut icon = favicon.ico
-# Enable/disable HTML for CHM (othewise HTML for web).
-# ----------------------------------------------------
+# Enable/disable HTML for CHM (otherwise HTML for web).
+# -----------------------------------------------------
chm = no
+# Language for CHM creation
+# -------------------------
+chm language = 0x407 Deutsch (Deutschland)
+
+# Enable/disable full text search in CHM files
+# --------------------------------------------
+chm full text search = yes
+
# Output script name.
# Run the script after running the htmlbook program.
# --------------------------------------------------
@@ -129,12 +231,14 @@ code line numbers = yes
chm = yes
template = chm.hbt
code line numbers = no
+html doctype = html-4.01-transitional
+style = chm.css
+#
# The language setting for the CHM project, default is
# 0x409 English (USA)
# Should correspond to the LANG setting in Makefile/GNUmakefile.
#
# chm language = 0x407 Deutsch (Deutschland)
-#
# Similar optional section for web publishing.
# --------------------------------------------
diff --git a/support/dktools/dktools/htmlbook/index.svg b/support/dktools/dktools/htmlbook/index.svg
new file mode 100644
index 0000000000..dc7516d5a2
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/index.svg
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 50.519531 31.4375 C 50.519531 42.007812 41.976562 50.578125 31.441406 50.578125 C 20.902344 50.578125 12.359375 42.007812 12.359375 31.4375 C 12.359375 20.867188 20.902344 12.300781 31.441406 12.300781 C 41.976562 12.300781 50.519531 20.867188 50.519531 31.4375 Z M 50.519531 31.4375 "/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 52.859375 19.139625 L 43.859375 28.139625 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 47.21875 31.5 C 47.21875 40.179688 40.183594 47.21875 31.5 47.21875 C 22.816406 47.21875 15.78125 40.179688 15.78125 31.5 C 15.78125 22.816406 22.816406 15.777344 31.5 15.777344 C 40.183594 15.777344 47.21875 22.816406 47.21875 31.5 Z M 47.21875 31.5 "/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/index.wxd b/support/dktools/dktools/htmlbook/index.wxd
new file mode 100644
index 0000000000..afb64b055c
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/index.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 6096000 0 6096000
+0 2 8
+11 -1 169 169 169 255 255 255 8 0 4 0
+ 1016000 5588000 508000 5080000 1143000
+11 0 255 228 196 255 255 255 8 0 4 0
+ 508000 5080000 1016000 5588000 1143000
+9 0 0 0 0 255 255 255 4 0 4 1
+ 2794000 3302000 1023907
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2032000
+ 3556000 2540000
diff --git a/support/dktools/dktools/htmlbook/installu.txt b/support/dktools/dktools/htmlbook/installu.txt
new file mode 100644
index 0000000000..4a43a7e18d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/installu.txt
@@ -0,0 +1,3 @@
+.1 Installation of Something on Linux
+<p>This text explains how to install &quot;Something&quot; on Linux systems.
+</p>
diff --git a/support/dktools/dktools/htmlbook/installw.txt b/support/dktools/dktools/htmlbook/installw.txt
new file mode 100644
index 0000000000..3e6736ccf4
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/installw.txt
@@ -0,0 +1,3 @@
+.1 Installation of Something on Windows
+<p>This text explains how to install &quot;Something&quot; on Windows.
+</p>
diff --git a/support/dktools/dktools/htmlbook/instalus.txt b/support/dktools/dktools/htmlbook/instalus.txt
new file mode 100644
index 0000000000..3b01e8e6ee
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/instalus.txt
@@ -0,0 +1,4 @@
+.1 Installation on Linux from source
+<p>This text explains how to install &quot;Something&quot; on Linux
+from source.
+</p>
diff --git a/support/dktools/dktools/htmlbook/instalux.txt b/support/dktools/dktools/htmlbook/instalux.txt
new file mode 100644
index 0000000000..dbc723014d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/instalux.txt
@@ -0,0 +1,4 @@
+.1 Use X
+<p>This text eplains how to use feature &quot;X&quot; during installation
+of &quot;Something&quot; on Linux from source.
+</p>
diff --git a/support/dktools/dktools/htmlbook/math-img.pdf b/support/dktools/dktools/htmlbook/math-img.pdf
new file mode 100644
index 0000000000..bd93393b32
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/math-img.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/math-img.png b/support/dktools/dktools/htmlbook/math-img.png
new file mode 100644
index 0000000000..2ed340ecd9
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/math-img.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/math-img.svg b/support/dktools/dktools/htmlbook/math-img.svg
new file mode 100644
index 0000000000..121c3cc8cf
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/math-img.svg
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="566.929pt" height="566.929pt" viewBox="0 0 566.929 566.929" version="1.1">
+<defs>
+<g>
+<symbol overflow="visible" id="glyph0-0">
+<path style="stroke:none;" d=""/>
+</symbol>
+<symbol overflow="visible" id="glyph0-1">
+<path style="stroke:none;" d="M 5.546875 -1.3125 C 5.359375 -1.140625 5.296875 -1.078125 5.21875 -0.984375 C 4.859375 -0.609375 4.703125 -0.484375 4.59375 -0.484375 C 4.5 -0.484375 4.421875 -0.5625 4.421875 -0.640625 C 4.421875 -0.890625 4.921875 -2.921875 5.484375 -4.984375 C 5.515625 -5.109375 5.53125 -5.125 5.5625 -5.234375 L 5.46875 -5.265625 L 4.75 -5.1875 L 4.703125 -5.15625 L 4.578125 -4.578125 C 4.484375 -5.015625 4.140625 -5.265625 3.625 -5.265625 C 2.046875 -5.265625 0.203125 -3.078125 0.203125 -1.1875 C 0.203125 -0.359375 0.65625 0.125 1.421875 0.125 C 2.265625 0.125 2.765625 -0.265625 3.828125 -1.75 C 3.578125 -0.8125 3.546875 -0.65625 3.546875 -0.375 C 3.546875 -0.03125 3.6875 0.125 4.03125 0.125 C 4.5 0.125 4.8125 -0.109375 5.6875 -1.1875 Z M 3.6875 -5.015625 C 4.09375 -4.984375 4.359375 -4.703125 4.359375 -4.28125 C 4.359375 -3.28125 3.765625 -1.859375 2.9375 -0.984375 C 2.65625 -0.65625 2.25 -0.453125 1.90625 -0.453125 C 1.484375 -0.453125 1.203125 -0.796875 1.203125 -1.34375 C 1.203125 -2 1.65625 -3.234375 2.171875 -3.96875 C 2.65625 -4.65625 3.21875 -5.046875 3.6875 -5.015625 Z M 3.6875 -5.015625 "/>
+</symbol>
+<symbol overflow="visible" id="glyph0-2">
+<path style="stroke:none;" d="M 1.3125 -7.6875 C 2.015625 -7.65625 2.09375 -7.625 2.09375 -7.359375 C 2.09375 -7.25 2.0625 -7.109375 1.984375 -6.84375 C 1.953125 -6.765625 1.9375 -6.6875 1.921875 -6.625 L 1.90625 -6.53125 L 0.28125 -0.546875 L 0.28125 -0.5 C 0.28125 -0.234375 1.1875 0.125 1.859375 0.125 C 3.671875 0.125 5.65625 -1.953125 5.65625 -3.84375 C 5.65625 -4.671875 5.0625 -5.265625 4.265625 -5.265625 C 3.4375 -5.265625 2.8125 -4.78125 1.953125 -3.46875 C 2.578125 -5.734375 2.671875 -6.0625 3.203125 -8.109375 L 3.140625 -8.15625 C 2.546875 -8.0625 2.109375 -7.984375 1.3125 -7.890625 Z M 3.796875 -4.6875 C 4.3125 -4.6875 4.640625 -4.296875 4.640625 -3.65625 C 4.640625 -2.875 4.03125 -1.59375 3.328125 -0.84375 C 2.875 -0.390625 2.359375 -0.140625 1.859375 -0.140625 C 1.484375 -0.140625 1.296875 -0.28125 1.296875 -0.546875 C 1.296875 -1.265625 1.65625 -2.421875 2.15625 -3.3125 C 2.6875 -4.234375 3.234375 -4.6875 3.796875 -4.6875 Z M 3.796875 -4.6875 "/>
+</symbol>
+<symbol overflow="visible" id="glyph0-3">
+<path style="stroke:none;" d="M 4.1875 -1.265625 C 3.53125 -0.5625 3.0625 -0.296875 2.46875 -0.296875 C 1.796875 -0.296875 1.390625 -0.8125 1.390625 -1.65625 C 1.390625 -2.671875 1.8125 -3.734375 2.46875 -4.453125 C 2.828125 -4.8125 3.296875 -5.015625 3.765625 -5.015625 C 4.046875 -5.015625 4.21875 -4.921875 4.21875 -4.78125 C 4.21875 -4.71875 4.203125 -4.65625 4.140625 -4.546875 C 4.0625 -4.40625 4.046875 -4.3125 4.046875 -4.203125 C 4.046875 -3.921875 4.21875 -3.75 4.5 -3.75 C 4.828125 -3.75 5.078125 -4 5.078125 -4.296875 C 5.078125 -4.859375 4.546875 -5.265625 3.828125 -5.265625 C 2.03125 -5.265625 0.359375 -3.53125 0.359375 -1.65625 C 0.359375 -0.53125 1 0.125 2.109375 0.125 C 3 0.125 3.65625 -0.234375 4.375 -1.140625 Z M 4.1875 -1.265625 "/>
+</symbol>
+<symbol overflow="visible" id="glyph1-0">
+<path style="stroke:none;" d=""/>
+</symbol>
+<symbol overflow="visible" id="glyph1-1">
+<path style="stroke:none;" d="M 4.265625 -1.234375 L 4.140625 -1.28125 C 3.8125 -0.765625 3.6875 -0.6875 3.296875 -0.6875 L 1.140625 -0.6875 L 2.65625 -2.265625 C 3.453125 -3.09375 3.796875 -3.78125 3.796875 -4.46875 C 3.796875 -5.375 3.078125 -6.0625 2.140625 -6.0625 C 1.65625 -6.0625 1.1875 -5.859375 0.859375 -5.5 C 0.5625 -5.203125 0.4375 -4.921875 0.28125 -4.28125 L 0.46875 -4.234375 C 0.828125 -5.109375 1.140625 -5.40625 1.765625 -5.40625 C 2.515625 -5.40625 3.03125 -4.890625 3.03125 -4.140625 C 3.03125 -3.4375 2.625 -2.59375 1.859375 -1.796875 L 0.265625 -0.109375 L 0.265625 0 L 3.765625 0 Z M 4.265625 -1.234375 "/>
+</symbol>
+<symbol overflow="visible" id="glyph2-0">
+<path style="stroke:none;" d=""/>
+</symbol>
+<symbol overflow="visible" id="glyph2-1">
+<path style="stroke:none;" d="M 4.890625 -2.75 L 8.21875 -2.75 C 8.390625 -2.75 8.625 -2.75 8.625 -2.984375 C 8.625 -3.234375 8.390625 -3.234375 8.21875 -3.234375 L 4.890625 -3.234375 L 4.890625 -6.578125 C 4.890625 -6.734375 4.890625 -6.96875 4.65625 -6.96875 C 4.40625 -6.96875 4.40625 -6.734375 4.40625 -6.578125 L 4.40625 -3.234375 L 1.0625 -3.234375 C 0.890625 -3.234375 0.671875 -3.234375 0.671875 -2.984375 C 0.671875 -2.75 0.890625 -2.75 1.0625 -2.75 L 4.40625 -2.75 L 4.40625 0.59375 C 4.40625 0.765625 4.40625 0.984375 4.65625 0.984375 C 4.890625 0.984375 4.890625 0.765625 4.890625 0.59375 Z M 4.890625 -2.75 "/>
+</symbol>
+<symbol overflow="visible" id="glyph2-2">
+<path style="stroke:none;" d="M 8.21875 -3.90625 C 8.390625 -3.90625 8.625 -3.90625 8.625 -4.140625 C 8.625 -4.390625 8.390625 -4.390625 8.21875 -4.390625 L 1.0625 -4.390625 C 0.890625 -4.390625 0.671875 -4.390625 0.671875 -4.140625 C 0.671875 -3.90625 0.890625 -3.90625 1.078125 -3.90625 Z M 8.21875 -1.59375 C 8.390625 -1.59375 8.625 -1.59375 8.625 -1.828125 C 8.625 -2.0625 8.390625 -2.0625 8.21875 -2.0625 L 1.078125 -2.0625 C 0.890625 -2.0625 0.671875 -2.0625 0.671875 -1.828125 C 0.671875 -1.59375 0.890625 -1.59375 1.0625 -1.59375 Z M 8.21875 -1.59375 "/>
+</symbol>
+</g>
+</defs>
+<g id="surface1">
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph0-1" x="7.2" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph1-1" x="13.178" y="13.199"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph2-1" x="19.82" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph0-2" x="30.769" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph1-1" x="36.747" y="13.199"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph2-2" x="44.385" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph0-3" x="56.33" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph1-1" x="61.638" y="13.199"/>
+</g>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/math-img.tex b/support/dktools/dktools/htmlbook/math-img.tex
index cb63f512fc..aaf0c5fcb5 100644
--- a/support/dktools/dktools/htmlbook/math-img.tex
+++ b/support/dktools/dktools/htmlbook/math-img.tex
@@ -1,3 +1,5 @@
+% Copyright (C) 2020, Dirk Krause. All rights reserved.
+% SPDX-License-Identifier: BSD-3-Clause
\documentclass[12pt]{article}
% begin font setup
\usepackage[T1]{fontenc}
diff --git a/support/dktools/dktools/htmlbook/next.fig b/support/dktools/dktools/htmlbook/next.fig
deleted file mode 100644
index b19114a8f9..0000000000
--- a/support/dktools/dktools/htmlbook/next.fig
+++ /dev/null
@@ -1,22 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-0 32 #364e6d
-2 2 0 0 7 7 999 1 -1 1.00 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-2 4 0 0 0 0 105 1 5 0 0 0 19 0 0 5
- 150 150 1125 150 1125 1125 150 1125 150 150
-2 4 0 0 0 0 104 1 10 0 0 0 19 0 0 5
- 112 112 1087 112 1087 1087 112 1087 112 112
-2 4 0 0 4 4 103 1 20 0 0 0 16 0 0 5
- 75 75 1050 75 1050 1050 75 1050 75 75
-2 4 0 0 6 6 102 1 20 0 0 0 16 0 0 5
- 150 150 975 150 975 975 150 975 150 150
-2 3 0 0 4 4 100 1 20 0 0 0 12 0 0 4
- 338 225 338 900 825 562 338 225
diff --git a/support/dktools/dktools/htmlbook/next.pdf b/support/dktools/dktools/htmlbook/next.pdf
new file mode 100644
index 0000000000..681b4dfc67
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/next.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/next.png b/support/dktools/dktools/htmlbook/next.png
index c02bdaead9..b98f7e2f87 100644
--- a/support/dktools/dktools/htmlbook/next.png
+++ b/support/dktools/dktools/htmlbook/next.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/next.svg b/support/dktools/dktools/htmlbook/next.svg
new file mode 100644
index 0000000000..b55a7a76ff
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/next.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 20.28125 13.5 L 20.28125 54 L 49.5 33.71875 Z M 20.28125 13.5 "/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/next.wxd b/support/dktools/dktools/htmlbook/next.wxd
new file mode 100644
index 0000000000..5846487500
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/next.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 6096000 0 6096000
+0 2 8
+11 -1 169 169 169 255 255 255 8 0 4 0
+ 1016000 5588000 508000 5080000 1143000
+11 0 255 228 196 255 255 255 8 0 4 0
+ 508000 5080000 1016000 5588000 1143000
+6 3 0 128 0 0 128 0 0 0 0 4 0 8 1
+ 4572000 3048000
+ 1651000 4318000
+ 1651000 1778000
diff --git a/support/dktools/dktools/htmlbook/old/GNUmakefile b/support/dktools/dktools/htmlbook/old/GNUmakefile
new file mode 100644
index 0000000000..5b6f2dfc30
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/GNUmakefile
@@ -0,0 +1,148 @@
+#
+# CONFIGURATION:
+# Set language here.
+# If your LANG environment variable ends on ``.UTF-8'' or ``.utf8''
+# you have to use the same suffix here.
+#
+ifndef LANG
+LANG=en_US.utf8
+endif
+
+#
+# CONFIGURATION:
+# How to run the htmlbook program?
+#
+ifndef HTMLBOOK
+HTMLBOOK=htmlbook
+endif
+
+ifndef GXHCONVERT
+GXHCONVERT=LANG=C gxhconvert
+endif
+
+#
+# CONFIGURATION:
+# Resolution when converting from vector to bitmaps.
+# Higher values create larger images.
+#
+ifndef FIGPNGRES
+FIGPNGRES=96
+endif
+
+#
+# If one of the *.prj, *.hbt or *.txt files was modified,
+# we have to rebuild all.
+#
+TEXTFILES := $(wildcard *.txt)
+HBTFILES := $(wildcard *.hbt)
+PRJFILES := $(wildcard *.prj)
+
+#
+# All *.fig images, *.gp plots and *.tex files (formulas) are
+# converted to *.png, *.pdf and *.svg.
+#
+IMAGES := \
+ $(patsubst %.fig,%.png,$(wildcard *.fig)) \
+ $(patsubst %.fig,%.pdf,$(wildcard *.fig)) \
+ $(patsubst %.fig,%.svg,$(wildcard *.fig)) \
+ $(patsubst %.gp,%.png,$(wildcard *.gp)) \
+ $(patsubst %.gp,%.pdf,$(wildcard *.gp)) \
+ $(patsubst %.gp,%.svg,$(wildcard *.gp)) \
+ $(patsubst %.tex,%.png,$(wildcard *.tex)) \
+ $(patsubst %.tex,%.pdf,$(wildcard *.tex)) \
+ $(patsubst %.tex,%.svg,$(wildcard *.tex))
+
+#
+# Suffixes for graphics files
+#
+.SUFFIXES: .png .svg .pdf .tex .fig .wxd .gp
+
+#
+# Graphics conversion rules
+#
+.tex.pdf:
+ gxhconvert -o=pdf $<
+
+.fig.pdf:
+ gxhconvert -o=pdf $<
+
+.wxd.pdf:
+ gxhconvert -o=pdf $<
+
+.gp.pdf:
+ gxhconvert -o=pdf $<
+
+.pdf.svg:
+ gxhconvert -o=svg $<
+
+#
+# CONFIGURATION:
+# If you do not need transparency, remove the -a option from the
+# gxhconvert command below.
+#
+.svg.png:
+ gxhconvert -o=png -r=$(FIGPNGRES) -a $<
+ optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+
+#
+# Names of icon files
+#
+ICONS= home.png toc.png prev.png next.png index.png
+
+#
+# The first target is the default target.
+#
+install: # Create HTML page set for local viewing and install
+install: $(TEXTFILES) $(HBTFILES) $(PRJFILES) $(IMAGES)
+ -[ ! -f htmlbook.sh ] || rm -f htmlbook.sh
+ LANG=$(LANG) $(HTMLBOOK) index.prj
+ chmod 755 htmlbook.sh
+ ./htmlbook.sh
+
+webinstall: # Create HTML page set for web server and install
+webinstall: $(TEXTFILES) $(HBTFILES) $(PRJFILES) $(IMAGES) $(ICONS)
+ -[ ! -f htmlbook.sh ] || rm -f htmlbook.sh
+ LANG=$(LANG) $(HTMLBOOK) -o web index.prj
+ chmod 755 htmlbook.sh
+ ./htmlbook.sh
+
+chminstall: # Create HTML page set for CHM file building
+chminstall: $(TEXTFILES) $(HBTFILES) $(PRJFILES) $(IMAGES)
+ -[ ! -f htmlbook.sh ] || rm -f htmlbook.sh
+ LANG=$(LANG) $(HTMLBOOK) -o chm index.prj
+ chmod 755 htmlbook.sh
+ ./htmlbook.sh
+
+#
+# Icons
+#
+
+home.png: # Icon to return to homepage
+home.png: home.wxd
+ gxhconvert -o=png -r=36 -a $<
+ optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+
+toc.png: # Icon for table of contents
+toc.png: toc.wxd
+ gxhconvert -o=png -r=36 -a $<
+ optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+
+prev.png: # Icon to go back to previous page
+prev.png: prev.wxd
+ gxhconvert -o=png -r=36 -a $<
+ optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+
+next.png: # Icon to go forward to next page
+next.png: next.wxd
+ gxhconvert -o=png -r=36 -a $<
+ optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+
+index.png: # Icon to go to keyword index
+index.png: index.wxd
+ gxhconvert -o=png -r=36 -a $<
+ optipng -q -i1 -zc1-9 -zm1-9 -zs0-3 -f0-5 $@
+
+help: # Show targets in GNUmakefile
+ @echo 'Here is a list of the targets in this GNUmakefile:'
+ -@egrep '^[^:;= ]*::?[ ]*' GNUmakefile|grep '#'|grep -v '^#'
+
diff --git a/support/dktools/dktools/htmlbook/old/chm.hbt b/support/dktools/dktools/htmlbook/old/chm.hbt
new file mode 100644
index 0000000000..cbdd3b2108
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/chm.hbt
@@ -0,0 +1 @@
+<div>%%contents%%</div>
diff --git a/support/dktools/dktools/htmlbook/old/home-i.pdf b/support/dktools/dktools/htmlbook/old/home-i.pdf
new file mode 100644
index 0000000000..944498055d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/home-i.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/home.pdf b/support/dktools/dktools/htmlbook/old/home.pdf
new file mode 100644
index 0000000000..ce5430cf12
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/home.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/home.png b/support/dktools/dktools/htmlbook/old/home.png
new file mode 100644
index 0000000000..afcaa864dc
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/home.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/home.svg b/support/dktools/dktools/htmlbook/old/home.svg
new file mode 100644
index 0000000000..fdc4b5d73b
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/home.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 13.5 47.21875 L 54 47.21875 L 33.71875 18 Z M 13.5 47.21875 "/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/old/home.tex b/support/dktools/dktools/htmlbook/old/home.tex
new file mode 100644
index 0000000000..aec092133b
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/home.tex
@@ -0,0 +1,40 @@
+\documentclass[12pt]{article}
+% begin font setup
+\usepackage[T1]{fontenc}
+\usepackage{mathptmx}
+\usepackage[scaled=.92]{helvet}
+\usepackage{courier}
+% end font setup
+% begin other packages
+\usepackage{textcomp}
+\usepackage[intlimits]{amsmath}
+% end other packages
+\usepackage{graphicx}
+\usepackage{color}
+\setlength{\paperwidth}{72bp}
+\setlength{\paperheight}{72bp}
+\pagestyle{empty}
+\setlength{\voffset}{-1in}
+\setlength{\topmargin}{0bp}
+\setlength{\headheight}{0bp}
+\setlength{\headsep}{0bp}
+\setlength{\topskip}{0bp}
+\setlength{\hoffset}{-1in}
+\setlength{\oddsidemargin}{0bp}
+\setlength{\evensidemargin}{0bp}
+\setlength{\marginparwidth}{0bp}
+\setlength{\marginparsep}{0bp}
+\setlength{\textwidth}{\paperwidth}
+\setlength{\textheight}{\paperheight}
+\setlength{\parskip}{0bp}
+\setlength{\parindent}{0bp}
+\setlength{\pdfpagewidth}{\paperwidth}
+\setlength{\pdfpageheight}{\paperheight}
+\begin{document}%
+\begin{picture}(0,0)
+\includegraphics{home-i.pdf}
+\end{picture}%
+\setlength{\unitlength}{1bp}%
+\begin{picture}(72,72)
+\end{picture}%
+\end{document}
diff --git a/support/dktools/dktools/htmlbook/old/home.wxd b/support/dktools/dktools/htmlbook/old/home.wxd
new file mode 100644
index 0000000000..52a12e002e
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/home.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 4
+11 0 127 127 127 127 127 127 4 0 4 1
+ 1016000 16256000 0 15240000 3556000
+11 1 143 0 0 255 214 0 6 0 4 1
+ 0 15240000 1016000 16256000 3556000
+6 3 3 143 0 0 143 0 0 8 0 4 1 8 1
+ 3556000 4572000
+ 11684000 4572000
+ 7620000 12700000
diff --git a/support/dktools/dktools/htmlbook/old/htmlbook.sh b/support/dktools/dktools/htmlbook/old/htmlbook.sh
new file mode 100755
index 0000000000..a88a336557
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/htmlbook.sh
@@ -0,0 +1,154 @@
+#! /bin/sh
+EXITCODE=0
+rm -fr '/home/joe/work/test-html'
+mkdir -p '/home/joe/work/test-html'
+if [ -f 'example1.c' ]
+then
+ln 'example1.c' '/home/joe/work/test-html'
+else
+echo 'ERROR: File example1.c does not exist'
+EXITCODE=1
+fi
+if [ -f 'favicon.ico' ]
+then
+ln 'favicon.ico' '/home/joe/work/test-html'
+else
+echo 'ERROR: File favicon.ico does not exist'
+EXITCODE=1
+fi
+if [ -f 'home.png' ]
+then
+ln 'home.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File home.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'index.png' ]
+then
+ln 'index.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File index.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'mylogo.png' ]
+then
+ln 'mylogo.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File mylogo.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'next.png' ]
+then
+ln 'next.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File next.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'prev.png' ]
+then
+ln 'prev.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File prev.png does not exist'
+EXITCODE=1
+fi
+if [ -f 'style.css' ]
+then
+ln 'style.css' '/home/joe/work/test-html'
+else
+echo 'ERROR: File style.css does not exist'
+EXITCODE=1
+fi
+if [ -f 'toc.png' ]
+then
+ln 'toc.png' '/home/joe/work/test-html'
+else
+echo 'ERROR: File toc.png does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/index.html' ]
+then
+rm -fr '/home/joe/work/test-html/index.html'
+fi
+if [ -f 'index.html' ]
+then
+echo TIDY index.html
+tidy -q -utf8 < 'index.html' > '/home/joe/work/test-html/index.html'
+else
+echo 'ERROR: File index.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/installu.html' ]
+then
+rm -fr '/home/joe/work/test-html/installu.html'
+fi
+if [ -f 'installu.html' ]
+then
+echo TIDY installu.html
+tidy -q -utf8 < 'installu.html' > '/home/joe/work/test-html/installu.html'
+else
+echo 'ERROR: File installu.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/instalus.html' ]
+then
+rm -fr '/home/joe/work/test-html/instalus.html'
+fi
+if [ -f 'instalus.html' ]
+then
+echo TIDY instalus.html
+tidy -q -utf8 < 'instalus.html' > '/home/joe/work/test-html/instalus.html'
+else
+echo 'ERROR: File instalus.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/instalux.html' ]
+then
+rm -fr '/home/joe/work/test-html/instalux.html'
+fi
+if [ -f 'instalux.html' ]
+then
+echo TIDY instalux.html
+tidy -q -utf8 < 'instalux.html' > '/home/joe/work/test-html/instalux.html'
+else
+echo 'ERROR: File instalux.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/installw.html' ]
+then
+rm -fr '/home/joe/work/test-html/installw.html'
+fi
+if [ -f 'installw.html' ]
+then
+echo TIDY installw.html
+tidy -q -utf8 < 'installw.html' > '/home/joe/work/test-html/installw.html'
+else
+echo 'ERROR: File installw.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/startu.html' ]
+then
+rm -fr '/home/joe/work/test-html/startu.html'
+fi
+if [ -f 'startu.html' ]
+then
+echo TIDY startu.html
+tidy -q -utf8 < 'startu.html' > '/home/joe/work/test-html/startu.html'
+else
+echo 'ERROR: File startu.html does not exist'
+EXITCODE=1
+fi
+if [ -f '/home/joe/work/test-html/startw.html' ]
+then
+rm -fr '/home/joe/work/test-html/startw.html'
+fi
+if [ -f 'startw.html' ]
+then
+echo TIDY startw.html
+tidy -q -utf8 < 'startw.html' > '/home/joe/work/test-html/startw.html'
+else
+echo 'ERROR: File startw.html does not exist'
+EXITCODE=1
+fi
+find '/home/joe/work/test-html' -type d -exec chmod ugo+rx {} \;
+find '/home/joe/work/test-html' -type f -exec chmod ugo+r {} \;
+exit $EXITCODE
diff --git a/support/dktools/dktools/htmlbook/old/index.html b/support/dktools/dktools/htmlbook/old/index.html
new file mode 100644
index 0000000000..9c9c14228f
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/index.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Introduction to something</title>
+<!--
+Generated by htmlbook (see http://sourceforge.net/p/dktools/wiki/htmlbook%20manual/)
+-->
+<meta name="generator" content="htmlbook (http://sourceforge.net/p/dktools/wiki/htmlbook%20manual/)">
+<link rel="stylesheet" type="text/css" href="style.css">
+<link rel="shortcut icon" href="favicon.ico">
+<link rel="author" title="Impressum" href="http://www.my-server.org/impressum.html">
+<link rel="contents" title="Introduction to something" href="index.html#hb_toc">
+<link rel="index" title="Introduction to something" href="index.html">
+<link rel="top" title="Introduction to something" href="index.html">
+<link rel="first" title="Introduction to something" href="index.html">
+<link rel="next" title="Install something on Linux/Unix" href="installu.html">
+<link rel="last" title="Start something on Windows" href="startw.html">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="author" content="Me, myself and I">
+</head>
+<body>
+<div class="header">
+<div class="headerleft">
+<img src="mylogo.png" alt="My introduction to something" title="My introduction to something" border="0">
+
+</div><!-- class="headerleft" -->
+<div class="headerright">
+</div><!-- class="headerright" -->
+<div class="headercenter">
+<span class="title">Introduction to something</span>
+</div><!-- class="headercenter" -->
+</div><!-- class="header" -->
+<div class="navicon">
+<div class="hb_nm_div">
+<ul class="hb_nm_ul">
+<li class="hb_nm_li"><a href="http://www.my-server.org/impressum.html" class="hb_nm_a" title="Impressum">Impressum</a></li>
+<li class="hb_nm_sep">&nbsp;</li>
+<li class="hb_nm_li"><a href="installu.html" class="hb_nm_a" title="1 Something">Something</a></li>
+<li class="hb_nm_li"><a href="startu.html" class="hb_nm_a" title="2 Start something">Start something</a></li>
+</ul><!-- class=hb_nm_ul -->
+</div><!-- class=hb_nm_div -->
+
+<div class="naviheader">&nbsp;</div>
+<div class="contents">
+<div class="hb_navigation"><img src="home.png" alt="Zur Startseite: Introduction to something" title="Auf der Startseite." class="hb_navi_img" border="0" width="36" height="36">&nbsp;<img src="prev.png" alt="Zur vorherigen Seite: " title="Auf der ersten Seite." class="hb_navi_img" border="0" width="36" height="36">&nbsp;<a class="hb_navi_a" href="installu.html" title="Zur n&auml;chsten Seite: Install something on Linux/Unix"><img src="next.png" alt="Zur n&auml;chsten Seite: Install something on Linux/Unix" title="Zur n&auml;chsten Seite: Install something on Linux/Unix" class="hb_navi_img" border="0" width="36" height="36"></a>&nbsp;<a class="hb_navi_a" href="index.html#hb_toc" title="Zum Inhaltsverzeichnis: Introduction to something"><img src="toc.png" alt="Zum Inhaltsverzeichnis: Introduction to something" title="Zum Inhaltsverzeichnis: Introduction to something" class="hb_navi_img" border="0" width="36" height="36"></a></div>
+
+<div class="contents_from_text"></div><!-- class="contents_from_text" -->
+<div class="hb_navigation"><a class="hb_navi_a" href="index.html" title="Zur Startseite: Introduction to something"><img src="home.png" alt="Zur Startseite: Introduction to something" title="Zur Startseite: Introduction to something" class="hb_navi_img" border="0" width="36" height="36"></a>&nbsp;<img src="prev.png" alt="Zur vorherigen Seite: " title="Auf der ersten Seite." class="hb_navi_img" border="0" width="36" height="36">&nbsp;<a class="hb_navi_a" href="installu.html" title="Zur n&auml;chsten Seite: Install something on Linux/Unix"><img src="next.png" alt="Zur n&auml;chsten Seite: Install something on Linux/Unix" title="Zur n&auml;chsten Seite: Install something on Linux/Unix" class="hb_navi_img" border="0" width="36" height="36"></a>&nbsp;<a class="hb_navi_a" href="index.html#hb_toc" title="Zum Inhaltsverzeichnis: Introduction to something"><img src="toc.png" alt="Zum Inhaltsverzeichnis: Introduction to something" title="Zum Inhaltsverzeichnis: Introduction to something" class="hb_navi_img" border="0" width="36" height="36"></a></div>
+
+</div><!-- class="contents" -->
+</div><!-- class="navicon" -->
+<div class="footer">
+<div class="footerleft">Me, myself and I</div>
+<div class="footerright">Somewhere, 06.04.2018</div>
+<div class="footercenter">&nbsp;</div>
+</div><!-- class="footer" -->
+</body>
+</html>
diff --git a/support/dktools/dktools/htmlbook/old/index.pdf b/support/dktools/dktools/htmlbook/old/index.pdf
new file mode 100644
index 0000000000..3aa737607d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/index.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/index.png b/support/dktools/dktools/htmlbook/old/index.png
new file mode 100644
index 0000000000..d7180dd1fc
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/index.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/index.prj b/support/dktools/dktools/htmlbook/old/index.prj
new file mode 100644
index 0000000000..441b56db5c
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/index.prj
@@ -0,0 +1,192 @@
+[options]
+
+# ##### START OF REQUIRED SETTINGS
+#
+#
+
+# Destination directory for our book release.
+# DO NOT USE THE CURRENT DIRECTORY OR
+# ANY DIRECTORY CONTAINING DATA!
+# The output script removes the directory completely,
+# creates the directory again and fills it with data.
+# Any existing data in this directory will be lost!
+# ---------------------------------------------------
+output directory = /home/joe/work/test-html
+
+# Book title.
+# -----------
+title = Introduction to something
+
+# URL where to publish the book.
+# ------------------------------
+url = http://www.my-server.org/something
+
+# Impressum included in contents.
+# Alternatively you could use "impressum page".
+# ---------------------------------------------
+impressum link = http://www.my-server.org/impressum.html
+# impressum page = impressum.txt
+
+# Authors name.
+# May be changed per node.
+# ------------------------
+author = Me, myself and I
+
+# Location where the book is produced.
+# May be changed per node.
+# ------------------------------------
+location = Somewhere
+
+#
+#
+# ##### END OF REQUIRED SETTINGS
+
+
+
+# Output character set, us-ascii or utf-8.
+# May be changed per node.
+# ----------------------------------------
+html charset = utf-8
+
+# Template used for all output files.
+# May be changed per node.
+# -----------------------------------
+template = web.hbt
+
+# Style used for all output files.
+# You may want to modify the stylesheet for a
+# color scheme corresponding to your corporate
+# identity colors.
+# May be changed per node.
+# --------------------------------------------
+style = style.css
+
+# Enable/disable page-internal table of contents.
+# May be changed per node.
+# -----------------------------------------------
+page toc = no
+
+# File used to build the index.html start page.
+# ---------------------------------------------
+index file = index.txt
+
+# Enable/disable clickable keywords index kw.html.
+# ------------------------------------------------
+create index = no
+
+# Enable/disable conversion of ampersands.
+# May be changed per node.
+# ----------------------------------------
+replace ampersand = no
+
+# Enable/disable summary attribute in table tags.
+# Today tidy complains about <table summary=...> attribute as obsoleted.
+# ----------------------------------------------------------------------
+table summaries = no
+
+# Enable/disable use of tidy for inspection/correction.
+# May be changed per node.
+# -----------------------------------------------------
+tidy = yes
+
+# Enable/disable use of ln instead of cp (reduces
+# disk space consumption).
+# May be changed per node.
+# -----------------------------------------------
+ln = yes
+
+# Enable/disable position text on top of page.
+# May be changed per node.
+# --------------------------------------------
+write position = yes
+
+# Switch navigation between "icons", "text", "both".
+# This option was intended originally, but skipped.
+# --------------------------------------------------
+# navigation = icons
+
+# Shortcut icon.
+# May be changed per node.
+# -------------------------------------------
+shortcut icon = favicon.ico
+
+# Enable/disable HTML for CHM (othewise HTML for web).
+# ----------------------------------------------------
+chm = no
+
+# Output script name.
+# Run the script after running the htmlbook program.
+# --------------------------------------------------
+output script = htmlbook.sh
+
+# Enable/disable line numbers for code from sourcefile
+# and code special commands.
+# ----------------------------------------------------
+code line numbers = yes
+
+# Option for CHM production, activated by
+# "htmlbook -o chm index.prj", overwrites some
+# existing settings.
+# You can have multiple such settings, activate them
+# by "htmlbook -o chm,this,that,another index.prj"
+# --------------------------------------------------
+[options:chm]
+chm = yes
+template = chm.hbt
+code line numbers = no
+html doctype = html-4.01-transitional
+#
+# The language setting for the CHM project, default is
+# 0x409 English (USA)
+# Should correspond to the LANG setting in Makefile/GNUmakefile.
+#
+# chm language = 0x407 Deutsch (Deutschland)
+
+# Similar optional section for web publishing.
+# --------------------------------------------
+[options:web]
+chm = no
+template = web.hbt
+
+# Optional section, activated automatically on
+# Windows systems (no need for "-o windows").
+# A similar section on non-Windows systems would be
+# [options:non-windows]
+# -------------------------------------------------
+[options:windows]
+output script = htmlbook.cmd
+
+
+
+# Additional files to copy
+# ------------------------
+[files]
+example1.c
+
+
+
+# Book contents, structed by indent level of
+# node title lines.
+# ------------------------------------------
+[contents]
+Something
+ Install something on Linux/Unix
+ @short = Installation Linux/Unix
+ @file = installu.txt
+ Installation from source
+ @short = Source installation
+ @file = instalus.txt
+ Installation using program X
+ @short = Installation using X
+ @file = instalux.txt
+ Install something on Windows
+ @short = Windows installation
+ @file = installw.txt
+Start something
+ Start something on Linux/Unix
+ @short = Linux start
+ @file = startu.txt
+ Start something on Windows
+ @short = Windows start
+ @file = startw.txt
+
diff --git a/support/dktools/dktools/htmlbook/old/index.svg b/support/dktools/dktools/htmlbook/old/index.svg
new file mode 100644
index 0000000000..dc7516d5a2
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/index.svg
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 50.519531 31.4375 C 50.519531 42.007812 41.976562 50.578125 31.441406 50.578125 C 20.902344 50.578125 12.359375 42.007812 12.359375 31.4375 C 12.359375 20.867188 20.902344 12.300781 31.441406 12.300781 C 41.976562 12.300781 50.519531 20.867188 50.519531 31.4375 Z M 50.519531 31.4375 "/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 52.859375 19.139625 L 43.859375 28.139625 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 47.21875 31.5 C 47.21875 40.179688 40.183594 47.21875 31.5 47.21875 C 22.816406 47.21875 15.78125 40.179688 15.78125 31.5 C 15.78125 22.816406 22.816406 15.777344 31.5 15.777344 C 40.183594 15.777344 47.21875 22.816406 47.21875 31.5 Z M 47.21875 31.5 "/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/old/index.wxd b/support/dktools/dktools/htmlbook/old/index.wxd
new file mode 100644
index 0000000000..59638e177c
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/index.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 4
+11 0 127 127 127 127 127 127 4 0 4 1
+ 1016000 16256000 0 15240000 3556000
+11 1 143 0 0 255 214 0 6 0 4 1
+ 0 15240000 1016000 16256000 3556000
+9 3 0 0 0 255 255 255 8 0 4 1
+ 6604000 9652000 5080000
+3 2 4 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 10160000 5588000
+ 12700000 3048000
diff --git a/support/dktools/dktools/htmlbook/old/installu.txt b/support/dktools/dktools/htmlbook/old/installu.txt
new file mode 100644
index 0000000000..4a43a7e18d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/installu.txt
@@ -0,0 +1,3 @@
+.1 Installation of Something on Linux
+<p>This text explains how to install &quot;Something&quot; on Linux systems.
+</p>
diff --git a/support/dktools/dktools/htmlbook/old/installw.txt b/support/dktools/dktools/htmlbook/old/installw.txt
new file mode 100644
index 0000000000..3e6736ccf4
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/installw.txt
@@ -0,0 +1,3 @@
+.1 Installation of Something on Windows
+<p>This text explains how to install &quot;Something&quot; on Windows.
+</p>
diff --git a/support/dktools/dktools/htmlbook/old/instalus.txt b/support/dktools/dktools/htmlbook/old/instalus.txt
new file mode 100644
index 0000000000..3b01e8e6ee
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/instalus.txt
@@ -0,0 +1,4 @@
+.1 Installation on Linux from source
+<p>This text explains how to install &quot;Something&quot; on Linux
+from source.
+</p>
diff --git a/support/dktools/dktools/htmlbook/old/instalux.txt b/support/dktools/dktools/htmlbook/old/instalux.txt
new file mode 100644
index 0000000000..dbc723014d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/instalux.txt
@@ -0,0 +1,4 @@
+.1 Use X
+<p>This text eplains how to use feature &quot;X&quot; during installation
+of &quot;Something&quot; on Linux from source.
+</p>
diff --git a/support/dktools/dktools/htmlbook/old/math-img.pdf b/support/dktools/dktools/htmlbook/old/math-img.pdf
new file mode 100644
index 0000000000..bd93393b32
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/math-img.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/math-img.png b/support/dktools/dktools/htmlbook/old/math-img.png
new file mode 100644
index 0000000000..2ed340ecd9
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/math-img.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/math-img.svg b/support/dktools/dktools/htmlbook/old/math-img.svg
new file mode 100644
index 0000000000..121c3cc8cf
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/math-img.svg
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="566.929pt" height="566.929pt" viewBox="0 0 566.929 566.929" version="1.1">
+<defs>
+<g>
+<symbol overflow="visible" id="glyph0-0">
+<path style="stroke:none;" d=""/>
+</symbol>
+<symbol overflow="visible" id="glyph0-1">
+<path style="stroke:none;" d="M 5.546875 -1.3125 C 5.359375 -1.140625 5.296875 -1.078125 5.21875 -0.984375 C 4.859375 -0.609375 4.703125 -0.484375 4.59375 -0.484375 C 4.5 -0.484375 4.421875 -0.5625 4.421875 -0.640625 C 4.421875 -0.890625 4.921875 -2.921875 5.484375 -4.984375 C 5.515625 -5.109375 5.53125 -5.125 5.5625 -5.234375 L 5.46875 -5.265625 L 4.75 -5.1875 L 4.703125 -5.15625 L 4.578125 -4.578125 C 4.484375 -5.015625 4.140625 -5.265625 3.625 -5.265625 C 2.046875 -5.265625 0.203125 -3.078125 0.203125 -1.1875 C 0.203125 -0.359375 0.65625 0.125 1.421875 0.125 C 2.265625 0.125 2.765625 -0.265625 3.828125 -1.75 C 3.578125 -0.8125 3.546875 -0.65625 3.546875 -0.375 C 3.546875 -0.03125 3.6875 0.125 4.03125 0.125 C 4.5 0.125 4.8125 -0.109375 5.6875 -1.1875 Z M 3.6875 -5.015625 C 4.09375 -4.984375 4.359375 -4.703125 4.359375 -4.28125 C 4.359375 -3.28125 3.765625 -1.859375 2.9375 -0.984375 C 2.65625 -0.65625 2.25 -0.453125 1.90625 -0.453125 C 1.484375 -0.453125 1.203125 -0.796875 1.203125 -1.34375 C 1.203125 -2 1.65625 -3.234375 2.171875 -3.96875 C 2.65625 -4.65625 3.21875 -5.046875 3.6875 -5.015625 Z M 3.6875 -5.015625 "/>
+</symbol>
+<symbol overflow="visible" id="glyph0-2">
+<path style="stroke:none;" d="M 1.3125 -7.6875 C 2.015625 -7.65625 2.09375 -7.625 2.09375 -7.359375 C 2.09375 -7.25 2.0625 -7.109375 1.984375 -6.84375 C 1.953125 -6.765625 1.9375 -6.6875 1.921875 -6.625 L 1.90625 -6.53125 L 0.28125 -0.546875 L 0.28125 -0.5 C 0.28125 -0.234375 1.1875 0.125 1.859375 0.125 C 3.671875 0.125 5.65625 -1.953125 5.65625 -3.84375 C 5.65625 -4.671875 5.0625 -5.265625 4.265625 -5.265625 C 3.4375 -5.265625 2.8125 -4.78125 1.953125 -3.46875 C 2.578125 -5.734375 2.671875 -6.0625 3.203125 -8.109375 L 3.140625 -8.15625 C 2.546875 -8.0625 2.109375 -7.984375 1.3125 -7.890625 Z M 3.796875 -4.6875 C 4.3125 -4.6875 4.640625 -4.296875 4.640625 -3.65625 C 4.640625 -2.875 4.03125 -1.59375 3.328125 -0.84375 C 2.875 -0.390625 2.359375 -0.140625 1.859375 -0.140625 C 1.484375 -0.140625 1.296875 -0.28125 1.296875 -0.546875 C 1.296875 -1.265625 1.65625 -2.421875 2.15625 -3.3125 C 2.6875 -4.234375 3.234375 -4.6875 3.796875 -4.6875 Z M 3.796875 -4.6875 "/>
+</symbol>
+<symbol overflow="visible" id="glyph0-3">
+<path style="stroke:none;" d="M 4.1875 -1.265625 C 3.53125 -0.5625 3.0625 -0.296875 2.46875 -0.296875 C 1.796875 -0.296875 1.390625 -0.8125 1.390625 -1.65625 C 1.390625 -2.671875 1.8125 -3.734375 2.46875 -4.453125 C 2.828125 -4.8125 3.296875 -5.015625 3.765625 -5.015625 C 4.046875 -5.015625 4.21875 -4.921875 4.21875 -4.78125 C 4.21875 -4.71875 4.203125 -4.65625 4.140625 -4.546875 C 4.0625 -4.40625 4.046875 -4.3125 4.046875 -4.203125 C 4.046875 -3.921875 4.21875 -3.75 4.5 -3.75 C 4.828125 -3.75 5.078125 -4 5.078125 -4.296875 C 5.078125 -4.859375 4.546875 -5.265625 3.828125 -5.265625 C 2.03125 -5.265625 0.359375 -3.53125 0.359375 -1.65625 C 0.359375 -0.53125 1 0.125 2.109375 0.125 C 3 0.125 3.65625 -0.234375 4.375 -1.140625 Z M 4.1875 -1.265625 "/>
+</symbol>
+<symbol overflow="visible" id="glyph1-0">
+<path style="stroke:none;" d=""/>
+</symbol>
+<symbol overflow="visible" id="glyph1-1">
+<path style="stroke:none;" d="M 4.265625 -1.234375 L 4.140625 -1.28125 C 3.8125 -0.765625 3.6875 -0.6875 3.296875 -0.6875 L 1.140625 -0.6875 L 2.65625 -2.265625 C 3.453125 -3.09375 3.796875 -3.78125 3.796875 -4.46875 C 3.796875 -5.375 3.078125 -6.0625 2.140625 -6.0625 C 1.65625 -6.0625 1.1875 -5.859375 0.859375 -5.5 C 0.5625 -5.203125 0.4375 -4.921875 0.28125 -4.28125 L 0.46875 -4.234375 C 0.828125 -5.109375 1.140625 -5.40625 1.765625 -5.40625 C 2.515625 -5.40625 3.03125 -4.890625 3.03125 -4.140625 C 3.03125 -3.4375 2.625 -2.59375 1.859375 -1.796875 L 0.265625 -0.109375 L 0.265625 0 L 3.765625 0 Z M 4.265625 -1.234375 "/>
+</symbol>
+<symbol overflow="visible" id="glyph2-0">
+<path style="stroke:none;" d=""/>
+</symbol>
+<symbol overflow="visible" id="glyph2-1">
+<path style="stroke:none;" d="M 4.890625 -2.75 L 8.21875 -2.75 C 8.390625 -2.75 8.625 -2.75 8.625 -2.984375 C 8.625 -3.234375 8.390625 -3.234375 8.21875 -3.234375 L 4.890625 -3.234375 L 4.890625 -6.578125 C 4.890625 -6.734375 4.890625 -6.96875 4.65625 -6.96875 C 4.40625 -6.96875 4.40625 -6.734375 4.40625 -6.578125 L 4.40625 -3.234375 L 1.0625 -3.234375 C 0.890625 -3.234375 0.671875 -3.234375 0.671875 -2.984375 C 0.671875 -2.75 0.890625 -2.75 1.0625 -2.75 L 4.40625 -2.75 L 4.40625 0.59375 C 4.40625 0.765625 4.40625 0.984375 4.65625 0.984375 C 4.890625 0.984375 4.890625 0.765625 4.890625 0.59375 Z M 4.890625 -2.75 "/>
+</symbol>
+<symbol overflow="visible" id="glyph2-2">
+<path style="stroke:none;" d="M 8.21875 -3.90625 C 8.390625 -3.90625 8.625 -3.90625 8.625 -4.140625 C 8.625 -4.390625 8.390625 -4.390625 8.21875 -4.390625 L 1.0625 -4.390625 C 0.890625 -4.390625 0.671875 -4.390625 0.671875 -4.140625 C 0.671875 -3.90625 0.890625 -3.90625 1.078125 -3.90625 Z M 8.21875 -1.59375 C 8.390625 -1.59375 8.625 -1.59375 8.625 -1.828125 C 8.625 -2.0625 8.390625 -2.0625 8.21875 -2.0625 L 1.078125 -2.0625 C 0.890625 -2.0625 0.671875 -2.0625 0.671875 -1.828125 C 0.671875 -1.59375 0.890625 -1.59375 1.0625 -1.59375 Z M 8.21875 -1.59375 "/>
+</symbol>
+</g>
+</defs>
+<g id="surface1">
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph0-1" x="7.2" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph1-1" x="13.178" y="13.199"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph2-1" x="19.82" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph0-2" x="30.769" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph1-1" x="36.747" y="13.199"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph2-2" x="44.385" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph0-3" x="56.33" y="17.538"/>
+</g>
+<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
+ <use xlink:href="#glyph1-1" x="61.638" y="13.199"/>
+</g>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/old/math-img.tex b/support/dktools/dktools/htmlbook/old/math-img.tex
new file mode 100644
index 0000000000..cb63f512fc
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/math-img.tex
@@ -0,0 +1,34 @@
+\documentclass[12pt]{article}
+% begin font setup
+\usepackage[T1]{fontenc}
+\usepackage{mathptmx}
+\usepackage[scaled=.92]{helvet}
+\usepackage{courier}
+% end font setup
+% begin other packages
+\usepackage{textcomp}
+\usepackage[intlimits]{amsmath}
+% end other packages
+\usepackage{color}
+\setlength{\paperwidth}{20cm}
+\setlength{\paperheight}{20cm}
+\pagestyle{empty}
+\setlength{\voffset}{-0.9in}
+\setlength{\topmargin}{0bp}
+\setlength{\headheight}{0bp}
+\setlength{\headsep}{0bp}
+\setlength{\topskip}{0bp}
+\setlength{\hoffset}{-0.9in}
+\setlength{\oddsidemargin}{0bp}
+\setlength{\evensidemargin}{0bp}
+\setlength{\marginparwidth}{0bp}
+\setlength{\marginparsep}{0bp}
+\setlength{\textwidth}{\paperwidth}
+\setlength{\textheight}{\paperheight}
+\setlength{\parskip}{0bp}
+\setlength{\parindent}{0bp}
+\setlength{\pdfpagewidth}{\paperwidth}
+\setlength{\pdfpageheight}{\paperheight}
+\begin{document}% FORMULA GOES INTO NEXT LINE, REPLACE EXISTING ONE
+\(a^2+b^2=c^2\)
+\end{document}
diff --git a/support/dktools/dktools/htmlbook/old/next.pdf b/support/dktools/dktools/htmlbook/old/next.pdf
new file mode 100644
index 0000000000..681b4dfc67
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/next.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/next.png b/support/dktools/dktools/htmlbook/old/next.png
new file mode 100644
index 0000000000..627d6bdec0
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/next.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/next.svg b/support/dktools/dktools/htmlbook/old/next.svg
new file mode 100644
index 0000000000..b55a7a76ff
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/next.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 20.28125 13.5 L 20.28125 54 L 49.5 33.71875 Z M 20.28125 13.5 "/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/old/next.wxd b/support/dktools/dktools/htmlbook/old/next.wxd
new file mode 100644
index 0000000000..c06a55df40
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/next.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 4
+11 0 127 127 127 127 127 127 4 0 4 1
+ 1016000 16256000 0 15240000 3556000
+11 1 143 0 0 255 214 0 6 0 4 1
+ 0 15240000 1016000 16256000 3556000
+6 3 3 143 0 0 143 0 0 8 0 4 1 8 1
+ 3556000 12700000
+ 3556000 4572000
+ 11684000 8636000
diff --git a/support/dktools/dktools/htmlbook/old/prev.pdf b/support/dktools/dktools/htmlbook/old/prev.pdf
new file mode 100644
index 0000000000..8d05d9a81a
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/prev.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/prev.png b/support/dktools/dktools/htmlbook/old/prev.png
new file mode 100644
index 0000000000..67366f5127
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/prev.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/prev.svg b/support/dktools/dktools/htmlbook/old/prev.svg
new file mode 100644
index 0000000000..96e8f2b3cb
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/prev.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 47.21875 13.5 L 47.21875 54 L 18 33.71875 Z M 47.21875 13.5 "/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/old/prev.wxd b/support/dktools/dktools/htmlbook/old/prev.wxd
new file mode 100644
index 0000000000..c1341ec5c0
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/prev.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 4
+11 0 127 127 127 127 127 127 4 0 4 1
+ 1016000 16256000 0 15240000 3556000
+11 1 143 0 0 255 214 0 6 0 4 1
+ 0 15240000 1016000 16256000 3556000
+6 3 3 143 0 0 143 0 0 8 0 4 1 8 1
+ 11176000 12700000
+ 11176000 4572000
+ 3048000 8636000
diff --git a/support/dktools/dktools/htmlbook/old/startu.txt b/support/dktools/dktools/htmlbook/old/startu.txt
new file mode 100644
index 0000000000..a9b1bf6494
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/startu.txt
@@ -0,0 +1,3 @@
+.1 Start on Unix
+<p>This text explains how to start &quot;Something&quot; on Linux systems.
+</p>
diff --git a/support/dktools/dktools/htmlbook/old/startw.txt b/support/dktools/dktools/htmlbook/old/startw.txt
new file mode 100644
index 0000000000..fb1778bb9a
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/startw.txt
@@ -0,0 +1,3 @@
+.1 Start on windows
+<p>This text explains how to start &quot;Something&quot; on Windows.
+</p>
diff --git a/support/dktools/dktools/htmlbook/old/style.css b/support/dktools/dktools/htmlbook/old/style.css
new file mode 100644
index 0000000000..901f304bd5
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/style.css
@@ -0,0 +1,1271 @@
+@media screen {
+ /* General formats.
+ */
+ body {
+ background-color: white;
+ }
+ h1 {
+ font-size: 200%;
+ font-weight: bold;
+ }
+ h2 {
+ font-size: 180%;
+ font-weight: bold;
+ }
+ h3 {
+ font-size: 160%;
+ font-weight: bold;
+ }
+ h4 {
+ font-size: 140%;
+ font-weight: bold;
+ }
+ h5 {
+ font-size: 120%;
+ font-weight: bold;
+ }
+ h6 {
+ font-size: 100%;
+ font-weight: bold;
+ }
+ span.hint {
+ cursor: help;
+ border-bottom: 1px dotted;
+ }
+ pre {
+ background-color: #FFFFE8;
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+ padding-bottom: 0.5em;
+ margin-top: 0.5em;
+ margin-left: 2em;
+ margin-right: 2em;
+ margin-bottom: 0.5em;
+ overflow: auto;
+ }
+ pre > i {
+ font-family: inherit;
+ font-style: italic;
+ }
+ pre code::before {
+ content: attr(title)':\20';
+ font-weight: bold;
+ color: #999999;
+ }
+ pre:hover code::before {
+ content: '\20\20\20\20\20';
+ }
+ /* Classes from the template
+ */
+ div.header {
+ margin: 5px;
+ }
+ div.headerleft {
+ float: left;
+ text-align: left;
+ }
+ div.headercenter {
+ text-align: center;
+ }
+ span.title {
+ font-size: 200%;
+ }
+ div.headerright {
+ float: right;
+ text-align: right;
+ }
+ div.navicon {
+ clear: both;
+ margin: 5px;
+ }
+ div.naviheader {
+ background-color: yellow;
+ text-align: center;
+ }
+ div.contents {
+ margin-top: 1em;
+ margin-bottom: 1em;
+ }
+ div.footer {
+ clear: both;
+ background-color: yellow;
+ border: 1px silver;
+ margin: 5px;
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ div.footerleft {
+ float: left;
+ text-align: left;
+ }
+ div.footercenter {
+ text-align: center;
+ }
+ div.footerright {
+ float: right;
+ text-align: right;
+ }
+ /* Classes produced by htmlbook
+ */
+ div.hb_nm_div {
+ float: right;
+ width: 23em;
+ background-color: yellow;
+ margin-left: 2em;
+ margin-bottom: 1em;
+ }
+ ul.hb_nm_ul {
+ margin-top: 1em;
+ margin-bottom: 1em;
+ }
+ li.hb_nm_li {
+ list-style: none;
+ }
+ a.hb_nm_a:link {
+ color: red;
+ text-decoration: none;
+ }
+ a.hb_nm_a:visited {
+ color: red;
+ text-decoration: none;
+ }
+ a.hb_nm_a:hover {
+ color: red;
+ text-decoration: underline;
+ }
+ a.hb_nm_a:focus {
+ color: red;
+ text-decoration: underline;
+ }
+ a.hb_nm_a_parent:link {
+ color: red;
+ font-weight: bold;
+ text-decoration: none;
+ }
+ a.hb_nm_a_parent:visited {
+ color: red;
+ font-weight: bold;
+ text-decoration: none;
+ }
+ a.hb_nm_a_parent:hover {
+ color: red;
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ a.hb_nm_a_parent:focus {
+ color: red;
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ li.hb_nm_c {
+ list-style: none;
+ color: red;
+ font-weight: bold;
+ }
+ li.hb_nm_sep {
+ list-style: none;
+ }
+ div.hb_navigation {
+ margin-top: 1em;
+ margin-bottom: 1em;
+ }
+ a.hb_navi_a {
+ }
+ img.hb_navi_img {
+ }
+ div.hb_pos_div {
+ }
+ table.hb_pos_ta {
+ }
+ tr.hb_pos_tr {
+ }
+ td.hb_pos_td_arrow {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-align: center;
+ vertical-align: top;
+ }
+ td.hb_pos_td_text {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-align: left;
+ vertical-align: top;
+ }
+ div.contents_from_text {
+ }
+ span.hb_link_number {
+ display: none;
+ }
+ table.hb_img_ta {
+ }
+ tr.hb_img_tr {
+ }
+ td.hb_img_td_img {
+ vertical-align: top;
+ text-align: center;
+ }
+ td.hb_img_td_empty {
+ width: 5ex;
+ }
+ td.hb_img_td_a {
+ vertical-align: top;
+ text-align: left;
+ }
+ a.hb_img_a_larger {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-decoration: none;
+ }
+ a.hb_img_a_larger:link {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-decoration: none;
+ }
+ a.hb_img_a_larger:visited {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-decoration: none;
+ }
+ a.hb_img_a_larger:hover {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-decoration: underline;
+ }
+ a.hb_img_a_larger:focus {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-decoration: underline;
+ }
+ a.hb_a_i:link {
+ text-decoration: underline;
+ }
+ a.hb_a_i:visited {
+ text-decoration: underline;
+ }
+ a.hb_a_i:focus {
+ text-decoration: underline;
+ }
+ a.hb_a_i:hover {
+ text-decoration: underline;
+ }
+ a.hb_a_e {
+ }
+ table.hb_me_ta {
+ background-color: silver;
+ }
+ tr.hb_me_tr {
+ }
+ td.hb_me_td_text {
+ font-family: sans-serif;
+ text-align: left;
+ vertical-align: top;
+ }
+ td.hb_me_td_arrow {
+ font-family: sans-serif;
+ text-align: center;
+ vertical-align: top;
+ }
+ table.hb_ptoc_ta {
+ }
+ tr.hb_ptoc_tr {
+ }
+ td.hb_ptoc_td_empty {
+ width: 3ex;
+ }
+ td.hb_ptoc_td_data {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-align: left;
+ vertical-align: top;
+ }
+ a.hb_ptoc_a:link {
+ text-decoration: none;
+ }
+ a.hb_ptoc_a:visited {
+ text-decoration: none;
+ }
+ a.hb_ptoc_a:focus {
+ text-decoration: underline;
+ }
+ a.hb_ptoc_a:hover {
+ text-decoration: underline;
+ }
+ div.hb_link_div {
+ display: none;
+ }
+ table.hb_link_ta {
+ }
+ td.hb_link_td_number {
+ text-align: center;
+ vertical-align: top;
+ }
+ td.hb_link_td_url {
+ text-align: left;
+ vertical-align: top;
+ }
+ div.hb_dtoc_div {
+ }
+ table.hb_dtoc_ta {
+ }
+ tr.hb_dtoc_tr {
+ }
+ td.hb_dtoc_td_space {
+ }
+ td.hb_dtoc_td_entry {
+ font-family: sans-serif;
+ font-size: 75%;
+ }
+ a.hb_dtoc_a:link {
+ text-decoration: none;
+ }
+ a.hb_dtoc_a:visited {
+ text-decoration: none;
+ }
+ a.hb_dtoc_a:focus {
+ text-decoration: underline;
+ }
+ a.hb_dtoc_a:hover {
+ text-decoration: underline;
+ }
+ div.hb_ki_div {
+ }
+ h2.hb_ki_h2 {
+ }
+ dl.hb_ki_dl {
+ }
+ dt.hb_ki_dt {
+ font-weight: bold;
+ }
+ dd.hb_ki_dd {
+ }
+ ul.hb_ki_ul {
+ }
+ li.hb_ki_li {
+ list-style: none;
+ font-family: sans-serif;
+ font-size: 75%;
+ }
+ a.hb_ki_a:link {
+ text-decoration: none;
+ }
+ a.hb_ki_a:visited {
+ text-decoration: none;
+ }
+ a.hb_ki_a:focus {
+ text-decoration: underline;
+ }
+ a.hb_ki_a:hover {
+ text-decoration: underline;
+ }
+ div.hb_file_div {
+ background-color: #FFFFE8;
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+ padding-bottom: 0.5em;
+ margin-top: 0.5em;
+ margin-left: 2em;
+ margin-right: 2em;
+ margin-bottom: 0.5em;
+ }
+ div.hb_file_div pre {
+ border-style: none;
+ padding-top: 0.5em;
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-bottom: 0px;
+ margin-top: 0px;
+ margin-left: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ overflow: auto;
+ }
+ div.hb_file_div pre > i {
+ font-family: inherit;
+ font-style: italic;
+ }
+ a.hb_file_a:link {
+ font-weight: bold;
+ text-decoration: none;
+ }
+ a.hb_file_a:visited {
+ font-weight: bold;
+ text-decoration: none;
+ }
+ a.hb_file_a:focus {
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ a.hb_file_a:hover {
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ div.hb_img_div_outer {
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
+ }
+ div.hb_img_div_no_vspace {
+ margin-top: 0.25em;
+ margin-bottom: 0.25em;
+ }
+ div.hb_img_div_inner_img {
+ float: left;
+ vertical-align: top;
+ text-align: left;
+ margin-right: 2em;
+ min-height: 3em;
+ }
+ div.hb_img_div_inner_img_centered {
+ float: left;
+ vertical-align: top;
+ text-align: center;
+ margin-right: 2em;
+ min-height: 3em;
+ }
+ p.hb_img_p_download {
+ }
+ span.hb_img_caption {
+ margin-top: 1em;
+ }
+ /* Classes for easier alignment.
+ */
+ .topleft {
+ vertical-align: top;
+ text-align: left;
+ }
+ .topcenter {
+ vertical-align: top;
+ text-align: center;
+ }
+ .topright {
+ vertical-align: top;
+ text-align: right;
+ }
+ .middleleft {
+ vertical-align: middle;
+ text-align: left;
+ }
+ .middlecenter {
+ vertical-align: middle;
+ text-align: center;
+ }
+ .middleright {
+ vertical-align: middle;
+ text-align: right;
+ }
+ .bottomleft {
+ vertical-align: bottom;
+ text-align: left;
+ }
+ .bottomcenter {
+ vertical-align: bottom;
+ text-align: center;
+ }
+ .bottomright {
+ vertical-align: bottom;
+ text-align: right;
+ }
+ .paddedtopleft {
+ vertical-align: top;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedtopcenter {
+ vertical-align: top;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedtopright {
+ vertical-align: top;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedmiddleleft {
+ vertical-align: middle;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedmiddlecenter {
+ vertical-align: middle;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedmiddleright {
+ vertical-align: middle;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedbottomleft {
+ vertical-align: bottom;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedbottomcenter {
+ vertical-align: bottom;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedbottomright {
+ vertical-align: bottom;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedtop {
+ vertical-align: top;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedmiddle {
+ vertical-align: middle;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedbottom {
+ vertical-align: bottom;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedleft {
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedcenter {
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedright {
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .padded {
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .floatleft {
+ float: left;
+ }
+ .marginfloatleft {
+ float: left;
+ margin-right: 2em;
+ margin-bottom: 1em;
+ }
+ .floatright {
+ float: right;
+ }
+ .clearboth {
+ clear: both;
+ }
+ table.overview {
+ background-color: yellow;
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+ padding-bottom: 0.5em;
+ margin-top: 1em;
+ margin-bottom: 1em;
+ }
+}
+
+
+@media print {
+ /* General classes
+ */
+ /* In FF the TD element does not inherit the font size from body for print */
+ * {
+ font-size: 12pt;
+ }
+ body {
+ font-size: 12pt;
+ }
+ h1 {
+ font-size: 180%;
+ font-weight: bold;
+ }
+ h2 {
+ font-size: 160%;
+ font-weight: bold;
+ }
+ h3 {
+ font-size: 160%;
+ }
+ h4 {
+ font-size: 140%;
+ font-weight: bold;
+ }
+ h5 {
+ font-size: 140%;
+ }
+ h6 {
+ font-size: 120%;
+ font-weight: bold;
+ }
+ pre {
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+ padding-bottom: 0.5em;
+ margin-top: 0.5em;
+ margin-left: 2em;
+ margin-right: 2em;
+ margin-bottom: 0.5em;
+ overflow: auto;
+ }
+ pre > i {
+ font-family: inherit;
+ font-style: italic;
+ }
+ pre code::before {
+ content: attr(title)':\20';
+ font-size: 50%;
+ }
+ /* Classes from the template
+ */
+ div.header {
+ margin: 5pt;
+ }
+ div.header div.headerleft {
+ float: left;
+ text-align: left;
+ }
+ div.header div.headercenter {
+ text-align: center;
+ }
+ div.header div.headercenter span.title {
+ font-size: 120%;
+ }
+ div.header div.headerright {
+ float: right;
+ text-align: right;
+ display: none;
+ }
+ div.navicon {
+ clear: both;
+ margin: 5pt;
+ }
+ div.navicon div.naviheader {
+ }
+ div.navicon div.contents: {
+ margin-top: 1em;
+ margin-bottom: 1em;
+ }
+ div.footer {
+ clear: both;
+ border-style: solid;
+ border-width: 0.12pt;
+ border-color: black;
+ margin: 5px;
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ div.footer div.footerleft {
+ float: left;
+ text-align: left;
+ }
+ div.footer div.footercenter {
+ text-align: center;
+ }
+ div.footer div.footerright {
+ float: right;
+ text-align: right;
+ }
+ /* Classes from htmlbook
+ */
+ div.hb_nm_div {
+ display: none;
+ float: right;
+ width: 23em;
+ }
+ ul.hb_nm_ul {
+ margin-top: 1em;
+ margin-bottom: 1em;
+ }
+ li.hb_nm_li {
+ list-style: none;
+ }
+ a.hb_nm_a:link {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_nm_a:visited {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_nm_a:hover {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_nm_a:focus {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_nm_a_parent:link {
+ color: black;
+ font-weight: bold;
+ text-decoration: none;
+ }
+ a.hb_nm_a_parent:visited {
+ color: black;
+ font-weight: bold;
+ text-decoration: none;
+ }
+ a.hb_nm_a_parent:hover {
+ color: black;
+ font-weight: bold;
+ text-decoration: none;
+ }
+ a.hb_nm_a_parent:focus {
+ color: black;
+ font-weight: bold;
+ text-decoration: none;
+ }
+ li.hb_nm_c {
+ list-style: none;
+ color: black;
+ font-weight: bold;
+ }
+ li.hb_nm_sep {
+ list-style: none;
+ }
+ div.hb_navigation {
+ display: none;
+ }
+ a.hb_navi_a {
+ }
+ img.hb_navi_img {
+ }
+ div.hb_pos_div {
+ }
+ table.hb_pos_ta {
+ }
+ tr.hb_pos_tr {
+ }
+ td.hb_pos_td_arrow {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-align: center;
+ vertical-align: top;
+ }
+ td.hb_pos_td_text {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-align: left;
+ vertical-align: top;
+ }
+ div.contents_from_text {
+ }
+ span.hb_link_number {
+ }
+ table.hb_img_ta {
+ }
+ tr.hb_img_tr {
+ }
+ td.hb_img_td_img {
+ vertical-align: top;
+ text-align: center;
+ }
+ td.hb_img_td_empty {
+ display: none;
+ }
+ td.hb_img_td_a {
+ display: none;
+ }
+ a.hb_img_a_larger:link {
+ font-family: sans-serif;
+ font-size: 75%;
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_img_a_larger:visited {
+ font-family: sans-serif;
+ font-size: 75%;
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_img_a_larger:hover {
+ font-family: sans-serif;
+ font-size: 75%;
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_img_a_larger:focus {
+ font-family: sans-serif;
+ font-size: 75%;
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_a_i:link {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_a_i:visited {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_a_i:focus {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_a_i:hover {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_a_e {
+ }
+ table.hb_me_ta {
+ border-width: thin;
+ border-style: solid;
+ border-color: black;
+ }
+ tr.hb_me_tr {
+ border-width: thin;
+ border-style: solid;
+ border-color: black;
+ }
+ td.hb_me_td_text {
+ font-family: sans-serif;
+ text-align: left;
+ vertical-align: top;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ }
+ td.hb_me_td_arrow {
+ font-family: sans-serif;
+ text-align: center;
+ vertical-align: top;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ }
+ table.hb_ptoc_ta {
+ display: none;
+ }
+ tr.hb_ptoc_tr {
+ }
+ td.hb_ptoc_td_empty {
+ width: 3ex;
+ }
+ td.hb_ptoc_td_data {
+ font-family: sans-serif;
+ font-size: 75%;
+ text-align: left;
+ vertical-align: top;
+ }
+ a.hb_ptoc_a:link {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_ptoc_a:visited {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_ptoc_a:focus {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_ptoc_a:hover {
+ color: black;
+ text-decoration: none;
+ }
+ div.hb_link_div {
+ }
+ table.hb_link_ta {
+ margin-bottom: 1em;
+ }
+ td.hb_link_td_number {
+ text-align: center;
+ vertical-align: top;
+ }
+ td.hb_link_td_url {
+ text-align: left;
+ vertical-align: top;
+ }
+ div.hb_dtoc_div {
+ }
+ table.hb_dtoc_ta {
+ }
+ tr.hb_dtoc_tr {
+ }
+ td.hb_dtoc_td_space {
+ }
+ td.hb_dtoc_td_entry {
+ font-family: sans-serif;
+ font-size: 75%;
+ }
+ a.hb_dtoc_a:link {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_dtoc_a:visited {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_dtoc_a:focus {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_dtoc_a:hover {
+ color: black;
+ text-decoration: none;
+ }
+ div.hb_ki_div {
+ display: none;
+ }
+ h2.hb_ki_h2 {
+ }
+ dl.hb_ki_dl {
+ }
+ dt.hb_ki_dt {
+ font-weight: bold;
+ }
+ dd.hb_ki_dd {
+ }
+ ul.hb_ki_ul {
+ }
+ li.hb_ki_li {
+ list-style: none;
+ font-family: sans-serif;
+ font-size: 75%;
+ }
+ a.hb_ki_a:link {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_ki_a:visited {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_ki_a:focus {
+ color: black;
+ text-decoration: none;
+ }
+ a.hb_ki_a:hover {
+ color: black;
+ text-decoration: none;
+ }
+ div.hb_file_div {
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+ padding-bottom: 0.5em;
+ margin-top: 0.5em;
+ margin-left: 2em;
+ margin-right: 2em;
+ margin-bottom: 0.5em;
+ }
+ div.hb_file_div pre {
+ border-style: none;
+ padding-top: 0.5em;
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-bottom: 0px;
+ margin-top: 0px;
+ margin-left: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ overflow: auto;
+ }
+ div.hb_file_div pre > i {
+ font-family: inherit;
+ font-style: italic;
+ }
+ a.hb_file_a:link {
+ color: black;
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ a.hb_file_a:visited {
+ color: black;
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ a.hb_file_a:focus {
+ color: black;
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ a.hb_file_a:hover {
+ color: black;
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ div.hb_img_div_outer {
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
+ }
+ div.hb_img_div_no_vspace {
+ }
+ div.hb_img_div_inner_img {
+ float: left;
+ vertical-align: top;
+ text-align: left;
+ margin-right: 2em;
+ }
+ div.hb_img_div_inner_img_centered {
+ float: left;
+ vertical-align: top;
+ text-align: center;
+ margin-right: 2em;
+ }
+ p.hb_img_p_download {
+ display: none;
+ }
+ span.hb_img_caption {
+ margin-top: 1em;
+ }
+ /* Classes for easier alignment.
+ */
+ .topleft {
+ vertical-align: top;
+ text-align: left;
+ }
+ .topcenter {
+ vertical-align: top;
+ text-align: center;
+ }
+ .topright {
+ vertical-align: top;
+ text-align: right;
+ }
+ .middleleft {
+ vertical-align: middle;
+ text-align: left;
+ }
+ .middlecenter {
+ vertical-align: middle;
+ text-align: center;
+ }
+ .middleright {
+ vertical-align: middle;
+ text-align: right;
+ }
+ .bottomleft {
+ vertical-align: bottom;
+ text-align: left;
+ }
+ .bottomcenter {
+ vertical-align: bottom;
+ text-align: center;
+ }
+ .bottomright {
+ vertical-align: bottom;
+ text-align: right;
+ }
+ .paddedtopleft {
+ vertical-align: top;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedtopcenter {
+ vertical-align: top;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedtopright {
+ vertical-align: top;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedmiddleleft {
+ vertical-align: middle;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedmiddlecenter {
+ vertical-align: middle;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedmiddleright {
+ vertical-align: middle;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedbottomleft {
+ vertical-align: bottom;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedbottomcenter {
+ vertical-align: bottom;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedbottomright {
+ vertical-align: bottom;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedtop {
+ vertical-align: top;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedmiddle {
+ vertical-align: middle;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedbottom {
+ vertical-align: bottom;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedleft {
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedcenter {
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .paddedright {
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .padded {
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+ }
+ .floatleft {
+ float: left;
+ }
+ .marginfloatleft {
+ float: left;
+ margin-right: 2em;
+ margin-bottom: 1em;
+ }
+ .floatright {
+ float: right;
+ }
+ .clearboth {
+ clear: both;
+ }
+ table.overview {
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+ padding-bottom: 0.5em;
+ margin-top: 1em;
+ margin-bottom: 1em;
+ }
+}
+
+@page {
+ margin-top: 1.5cm;
+ margin-bottom: 1.5cm;
+}
+
+@page :left {
+ margin-left: 1.5cm;
+ margin-right: 2.5cm;
+}
+
+@page :right {
+ margin-left: 2.5cm;
+ margin-right: 1.5cm;
+}
+
diff --git a/support/dktools/dktools/htmlbook/old/toc.pdf b/support/dktools/dktools/htmlbook/old/toc.pdf
new file mode 100644
index 0000000000..e6435526e6
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/toc.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/toc.png b/support/dktools/dktools/htmlbook/old/toc.png
new file mode 100644
index 0000000000..6248f9a4b6
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/toc.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/old/toc.svg b/support/dktools/dktools/htmlbook/old/toc.svg
new file mode 100644
index 0000000000..310b483546
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/toc.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 13.5 51.78025 L 42.71875 51.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54 51.78025 L 49.5 51.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 13.5 42.78025 L 42.71875 42.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54 42.78025 L 49.5 42.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 13.5 33.78025 L 42.71875 33.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54 33.78025 L 49.5 33.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 13.5 24.78025 L 42.71875 24.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54 24.78025 L 49.5 24.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/old/toc.wxd b/support/dktools/dktools/htmlbook/old/toc.wxd
new file mode 100644
index 0000000000..eadd4916e3
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/toc.wxd
@@ -0,0 +1,31 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 4
+11 0 127 127 127 127 127 127 4 0 4 1
+ 1016000 16256000 0 15240000 3556000
+11 1 143 0 0 255 214 0 6 0 4 1
+ 0 15240000 1016000 16256000 3556000
+3 2 1 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 11684000 13208000
+ 12700000 13208000
+3 2 1 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 2032000 13208000
+ 10160000 13208000
+3 2 1 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 2032000 10160000
+ 10160000 10160000
+3 2 1 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 2032000 7112000
+ 10160000 7112000
+3 2 1 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 2032000 4064000
+ 10160000 4064000
+3 2 1 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 11684000 10160000
+ 12700000 10160000
+3 2 1 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 11684000 7112000
+ 12700000 7112000
+3 2 1 0 0 0 8 0 4 1 1 8 0 2 2 0 2 2
+ 11684000 4064000
+ 12700000 4064000
diff --git a/support/dktools/dktools/htmlbook/old/web.hbt b/support/dktools/dktools/htmlbook/old/web.hbt
new file mode 100644
index 0000000000..9f59b60999
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/old/web.hbt
@@ -0,0 +1,24 @@
+<div class="header">
+<div class="headerleft">
+%%img src=mylogo.png alt="My introduction to something" title%%
+</div><!-- class="headerleft" -->
+<div class="headerright">
+</div><!-- class="headerright" -->
+<div class="headercenter">
+<span class="title">%%title%%</span>
+</div><!-- class="headercenter" -->
+</div><!-- class="header" -->
+<div class="navicon">
+%%menu%%
+<div class="naviheader">&nbsp;</div>
+<div class="contents">
+%%navigation%%
+<div class="contents_from_text">%%contents%%</div><!-- class="contents_from_text" -->
+%%navigation%%
+</div><!-- class="contents" -->
+</div><!-- class="navicon" -->
+<div class="footer">
+<div class="footerleft">%%author%%</div>
+<div class="footerright">%%location%%, %%date style=german%%</div>
+<div class="footercenter">&nbsp;</div>
+</div><!-- class="footer" -->
diff --git a/support/dktools/dktools/htmlbook/prev.fig b/support/dktools/dktools/htmlbook/prev.fig
deleted file mode 100644
index 6a1b4c467a..0000000000
--- a/support/dktools/dktools/htmlbook/prev.fig
+++ /dev/null
@@ -1,22 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-0 32 #364e6d
-2 2 0 0 7 7 999 1 -1 1.00 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-2 4 0 0 0 0 105 1 5 0 0 0 19 0 0 5
- 150 150 1125 150 1125 1125 150 1125 150 150
-2 4 0 0 0 0 104 1 10 0 0 0 19 0 0 5
- 112 112 1087 112 1087 1087 112 1087 112 112
-2 4 0 0 4 4 103 1 20 0 0 0 16 0 0 5
- 75 75 1050 75 1050 1050 75 1050 75 75
-2 4 0 0 6 6 102 1 20 0 0 0 16 0 0 5
- 150 150 975 150 975 975 150 975 150 150
-2 3 0 0 4 4 100 1 20 0 0 0 12 0 0 4
- 787 225 787 900 300 562 787 225
diff --git a/support/dktools/dktools/htmlbook/prev.pdf b/support/dktools/dktools/htmlbook/prev.pdf
new file mode 100644
index 0000000000..8d05d9a81a
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/prev.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/prev.png b/support/dktools/dktools/htmlbook/prev.png
index 2d41c5ec3f..6302e025af 100644
--- a/support/dktools/dktools/htmlbook/prev.png
+++ b/support/dktools/dktools/htmlbook/prev.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/prev.svg b/support/dktools/dktools/htmlbook/prev.svg
new file mode 100644
index 0000000000..96e8f2b3cb
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/prev.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 47.21875 13.5 L 47.21875 54 L 18 33.71875 Z M 47.21875 13.5 "/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/prev.wxd b/support/dktools/dktools/htmlbook/prev.wxd
new file mode 100644
index 0000000000..92f8027a87
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/prev.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 6096000 0 6096000
+0 2 8
+11 -1 169 169 169 255 255 255 8 0 4 0
+ 1016000 5588000 508000 5080000 1143000
+11 0 255 228 196 255 255 255 8 0 4 0
+ 508000 5080000 1016000 5588000 1143000
+6 3 0 128 0 0 128 0 0 0 0 4 0 8 1
+ 1524000 3048000
+ 4445000 1778000
+ 4445000 4318000
diff --git a/support/dktools/dktools/htmlbook/ptoc.js b/support/dktools/dktools/htmlbook/ptoc.js
new file mode 100644
index 0000000000..918e7acce6
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/ptoc.js
@@ -0,0 +1,46 @@
+/*
+Copyright (C) 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+'use strict';
+
+/** Toggle page TOC visibility.
+*/
+function togglePageTOC()
+{
+ if ( document.getElementById('hb_ptoc_cb').checked ) {
+ document.getElementById('hb_div_ptoc_inner').style.display = 'block';
+ }
+ else {
+ document.getElementById('hb_div_ptoc_inner').style.display = 'none';
+ }
+}
+
+function documentLoaded()
+{
+ var newCB = document.createElement('input');
+ newCB.type = "checkbox";
+ newCB.name = "hb_ptoc_cb";
+ newCB.value = "hb_ptoc_cb";
+ newCB.id = "hb_ptoc_cb";
+ newCB.checked = false;
+
+ var newLabel = document.createElement('label');
+ newLabel.htmlFor = "hb_ptoc_cb";
+ newLabel.appendChild(document.createTextNode(" Page content"));
+
+ var myForm = document.getElementById('hb_ptoc_form');
+ myForm.style.display = 'block';
+ myForm.appendChild(newCB);
+ myForm.appendChild(newLabel);
+ document.getElementById('hb_div_ptoc_inner').style.display = 'none';
+ document.getElementById('hb_ptoc_cb').addEventListener(
+ 'click', togglePageTOC
+ );
+}
+
+
+document.addEventListener('DOMContentLoaded', documentLoaded, true);
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/dktools/htmlbook/results.txt b/support/dktools/dktools/htmlbook/results.txt
new file mode 100644
index 0000000000..4aea75a5c4
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/results.txt
@@ -0,0 +1,47 @@
+# Automatically generated
+# duptype id depth size device inode priority name
+DUPTYPE_FIRST_OCCURRENCE 35 0 94 2051 13639150 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/startw.txt
+DUPTYPE_WITHIN_SAME_TREE -35 1 94 2051 13639183 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/startw.txt
+DUPTYPE_FIRST_OCCURRENCE 34 0 97 2051 13639161 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/startu.txt
+DUPTYPE_WITHIN_SAME_TREE -34 1 97 2051 13639194 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/startu.txt
+DUPTYPE_FIRST_OCCURRENCE 18 0 116 2051 13639219 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/installw.txt
+DUPTYPE_WITHIN_SAME_TREE -18 1 116 2051 13639211 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/installw.txt
+DUPTYPE_FIRST_OCCURRENCE 17 0 120 2051 13639169 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/installu.txt
+DUPTYPE_WITHIN_SAME_TREE -17 1 120 2051 13639201 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/installu.txt
+DUPTYPE_FIRST_OCCURRENCE 19 0 123 2051 13639160 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/instalus.txt
+DUPTYPE_WITHIN_SAME_TREE -19 1 123 2051 13639193 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/instalus.txt
+DUPTYPE_FIRST_OCCURRENCE 20 0 135 2051 13639214 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/instalux.txt
+DUPTYPE_WITHIN_SAME_TREE -20 1 135 2051 13639206 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/instalux.txt
+DUPTYPE_FIRST_OCCURRENCE 8 0 1050 2051 13639167 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/home.tex
+DUPTYPE_WITHIN_SAME_TREE -8 1 1050 2051 13639199 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/home.tex
+DUPTYPE_FIRST_OCCURRENCE 4 0 1118 2051 13639155 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/home-i.pdf
+DUPTYPE_WITHIN_SAME_TREE -4 1 1118 2051 13639188 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/home-i.pdf
+DUPTYPE_FIRST_OCCURRENCE 22 0 1168 2051 13639164 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/math-img.png
+DUPTYPE_WITHIN_SAME_TREE -22 1 1168 2051 13639196 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/math-img.png
+DUPTYPE_FIRST_OCCURRENCE 29 0 1696 2051 13639166 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/prev.pdf
+DUPTYPE_WITHIN_SAME_TREE -29 1 1696 2051 13639198 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/prev.pdf
+DUPTYPE_FIRST_OCCURRENCE 5 0 1698 2051 13639148 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/home.pdf
+DUPTYPE_WITHIN_SAME_TREE -5 1 1698 2051 13639181 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/home.pdf
+DUPTYPE_FIRST_OCCURRENCE 25 0 1699 2051 13639218 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/next.pdf
+DUPTYPE_WITHIN_SAME_TREE -25 1 1699 2051 13639210 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/next.pdf
+DUPTYPE_FIRST_OCCURRENCE 37 0 1753 2051 13639163 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/toc.pdf
+DUPTYPE_WITHIN_SAME_TREE -37 1 1753 2051 13639195 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/toc.pdf
+DUPTYPE_FIRST_OCCURRENCE 31 0 1853 2051 13639153 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/prev.svg
+DUPTYPE_WITHIN_SAME_TREE -31 1 1853 2051 13639186 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/prev.svg
+DUPTYPE_FIRST_OCCURRENCE 7 0 1853 2051 13639147 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/home.svg
+DUPTYPE_WITHIN_SAME_TREE -7 1 1853 2051 13639180 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/home.svg
+DUPTYPE_FIRST_OCCURRENCE 12 0 1854 2051 13639217 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/index.pdf
+DUPTYPE_WITHIN_SAME_TREE -12 1 1854 2051 13639209 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/index.pdf
+DUPTYPE_FIRST_OCCURRENCE 27 0 1855 2051 13639149 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/next.svg
+DUPTYPE_WITHIN_SAME_TREE -27 1 1855 2051 13639182 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/next.svg
+DUPTYPE_FIRST_OCCURRENCE 15 0 2653 2051 13639140 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/index.svg
+DUPTYPE_WITHIN_SAME_TREE -15 1 2653 2051 13639173 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/index.svg
+DUPTYPE_FIRST_OCCURRENCE 39 0 3470 2051 13639158 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/toc.svg
+DUPTYPE_WITHIN_SAME_TREE -39 1 3470 2051 13639191 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/toc.svg
+DUPTYPE_FIRST_OCCURRENCE 11 0 4326 2051 13639143 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/index.html
+DUPTYPE_WITHIN_SAME_TREE -11 1 4326 2051 13639176 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/index.html
+DUPTYPE_FIRST_OCCURRENCE 23 0 6354 2051 13639152 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/math-img.svg
+DUPTYPE_WITHIN_SAME_TREE -23 1 6354 2051 13639185 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/math-img.svg
+DUPTYPE_FIRST_OCCURRENCE 21 0 15197 2051 13639216 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/math-img.pdf
+DUPTYPE_WITHIN_SAME_TREE -21 1 15197 2051 13639208 3 /home/krause/Downloads/CTAN/dktools-4.30.2/dktools/htmlbook/old/math-img.pdf
+# end of file
diff --git a/support/dktools/dktools/htmlbook/startu.txt b/support/dktools/dktools/htmlbook/startu.txt
new file mode 100644
index 0000000000..a9b1bf6494
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/startu.txt
@@ -0,0 +1,3 @@
+.1 Start on Unix
+<p>This text explains how to start &quot;Something&quot; on Linux systems.
+</p>
diff --git a/support/dktools/dktools/htmlbook/startw.txt b/support/dktools/dktools/htmlbook/startw.txt
new file mode 100644
index 0000000000..fb1778bb9a
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/startw.txt
@@ -0,0 +1,3 @@
+.1 Start on windows
+<p>This text explains how to start &quot;Something&quot; on Windows.
+</p>
diff --git a/support/dktools/dktools/htmlbook/style.css b/support/dktools/dktools/htmlbook/style.css
index 4df8742182..0ed18a3802 100644
--- a/support/dktools/dktools/htmlbook/style.css
+++ b/support/dktools/dktools/htmlbook/style.css
@@ -1,1295 +1,1043 @@
-@media screen {
- /* General formats.
- */
+/*
+Copyright (C) 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ Screen representation
+ =====================
+
+*/
+
+
+/*
+ Use grid layout if screen is wide enough
+ ----------------------------------------
+*/
+@media screen AND (min-width: 50em) {
body {
- background-color: white;
- }
- h1 {
- font-size: 200%;
- font-weight: bold;
- }
- h2 {
- font-size: 180%;
- font-weight: bold;
- }
- h3 {
- font-size: 160%;
- font-weight: bold;
- }
- h4 {
- font-size: 140%;
- font-weight: bold;
- }
- h5 {
- font-size: 120%;
- font-weight: bold;
- }
- h6 {
- font-size: 100%;
- font-weight: bold;
- }
- span.hint {
- cursor: help;
- border-bottom: 1px dotted;
- }
- pre {
- background-color: #FFFFE8;
- border-width: 1px;
- border-style: solid;
- border-color: black;
- padding-top: 0.5em;
- padding-left: 2em;
- padding-right: 2em;
- padding-bottom: 0.5em;
- margin-top: 0.5em;
- margin-left: 2em;
- margin-right: 2em;
- margin-bottom: 0.5em;
- overflow: auto;
- }
- pre > i {
- font-family: inherit;
- font-style: italic;
- }
- pre code:before {
- content: attr(title)':\20';
- font-weight: bold;
- color: #999999;
- }
- pre:hover code:before {
- content: '\20\20\20\20\20';
- }
- /* Classes from the template
- */
- div.header {
- margin: 5px;
- }
- div.headerleft {
- float: left;
- text-align: left;
- }
- div.headercenter {
- text-align: center;
+ display: grid;
+ grid-template-columns: auto auto;
+ grid-template-rows: auto auto auto;
+ grid-gap: 1em;
}
- span.title {
- font-size: 200%;
+ header {
+ grid-column: 1 / span 2;
+ grid-row: 1;
}
- div.headerright {
- float: right;
- text-align: right;
+ main {
+ grid-column: 1;
+ grid-row: 2;
+ display: block;
+ clear: both;
}
- div.navicon {
- clear: both;
- margin: 5px;
+ nav {
+ grid-column: 2;
+ grid-row: 2;
}
- div.naviheader {
- background-color: yellow;
- text-align: center;
+ footer {
+ grid-column: 1 / span 2;
+ grid-row: 3;
}
- div.contents {
- margin-top: 1em;
- margin-bottom: 1em;
- }
- div.footer {
- clear: both;
- background-color: yellow;
- border: 1px silver;
- margin: 5px;
- padding-left: 0.5em;
- padding-right: 0.5em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- div.footerleft {
- float: left;
- text-align: left;
- }
- div.footercenter {
- text-align: center;
- }
- div.footerright {
- float: right;
- text-align: right;
+}
+
+@media screen AND (max-width: 50em) {
+ body {
+ display: grid;
+ grid-template-columns: auto;
+ grid-template-rows: auto auto auto auto;
+ grid-gap: 1em;
+ }
+ header {
+ grid-column: 1;
+ grid-row: 1;
+ margin-bottom: 0.5em;
+ }
+ main {
+ grid-column: 1;
+ grid-row: 2;
+ display: block;
+ clear: both;
+ }
+ nav {
+ grid-column: 1;
+ grid-row: 3;
+ }
+ footer {
+ grid-column: 1;
+ grid-row: 4;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
}
- /* Classes produced by htmlbook
- */
div.hb_nm_div {
- float: right;
- width: 23em;
- background-color: yellow;
- margin-left: 2em;
- margin-bottom: 1em;
- }
- ul.hb_nm_ul {
- margin-top: 1em;
- margin-bottom: 1em;
- }
- li.hb_nm_li {
- list-style: none;
- }
- a.hb_nm_a:link {
- color: red;
- text-decoration: none;
- }
- a.hb_nm_a:visited {
- color: red;
- text-decoration: none;
- }
- a.hb_nm_a:hover {
- color: red;
- text-decoration: underline;
- }
- a.hb_nm_a:focus {
- color: red;
- text-decoration: underline;
- }
- a.hb_nm_a_parent:link {
- color: red;
- font-weight: bold;
- text-decoration: none;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
}
- a.hb_nm_a_parent:visited {
- color: red;
- font-weight: bold;
- text-decoration: none;
+}
+
+@media screen AND (min-width: 40em) {
+ div.hb_div_header_left {
+ float: left;
}
- a.hb_nm_a_parent:hover {
- color: red;
- font-weight: bold;
- text-decoration: underline;
+ div.hb_div_header_center {
}
- a.hb_nm_a_parent:focus {
- color: red;
- font-weight: bold;
- text-decoration: underline;
+ div.hb_div_header_right {
+ float: right;
}
- li.hb_nm_c {
- list-style: none;
- color: red;
- font-weight: bold;
+}
+
+@media screen AND (min-width: 15em) {
+ div.hb_div_footer_left { /* Template: Left footer part */
+ float: left;
}
- li.hb_nm_sep {
- list-style: none;
+ div.hb_div_footer_center { /* Template: Center footer part */
}
- div.hb_navigation {
- margin-top: 1em;
- margin-bottom: 1em;
+ div.hb_div_footer_right { /* Template: Right footer part */
+ float: right;
}
- a.hb_navi_a {
+}
+
+
+/*
+ Block properties,
+ borders,
+ colors,
+ font properties,
+ text decoration
+ ----------------
+*/
+@media screen {
+ /*
+ General setings
+ */
+ body {
+ max-width: 65em;
+ margin: 0 auto;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+ background-color: FloralWhite;
+ color: Black;
+ }
+ header {
+ background-color: Bisque;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+ text-align: center;
+ }
+ main {
+ display: block;
+ }
+ nav {
+ font-family: sans-serif;
+ font-size: smaller;
+ }
+ footer {
+ background-color: Bisque;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+ padding-left: 0.5em;
+ padding-right: 0.5em;
}
- img.hb_navi_img {
+ pre {
+ background-color: #FFFFE8;
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+ padding-bottom: 0.5em;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ overflow: auto;
+ max-width: 45em;
+ }
+ ul > li > ul > li > pre {
+ max-width: 41em;
}
- div.hb_pos_div {
+ pre > i {
+ font-family: inherit;
+ font-style: italic;
}
- table.hb_pos_ta {
+ pre code::before {
+ content: attr(title)':\20';
+ font-weight: bold;
+ color: #999999;
}
- tr.hb_pos_tr {
+ pre:hover code::before {
+ content: '\20\20\20\20\20';
}
- td.hb_pos_td_arrow {
- font-family: sans-serif;
- font-size: 75%;
- text-align: center;
- vertical-align: top;
+
+ a:link { /* HB: Default links setup */
+ color: DodgerBlue;
+ text-decoration: none;
}
- td.hb_pos_td_text {
- font-family: sans-serif;
- font-size: 75%;
- text-align: left;
- vertical-align: top;
+ a:visited {
+ color: RebeccaPurple;
+ text-decoration: none;
}
- div.contents_from_text {
+ a:focus {
+ color: DodgerBlue;
+ text-decoration: underline;
}
- span.hb_link_number {
- display: none;
+ a:hover {
+ color: DodgerBlue;
+ text-decoration: underline;
}
- table.hb_img_ta {
+ a:active {
+ color: DodgerBlue;
+ text-decoration: underline;
}
- tr.hb_img_tr {
+ /*
+ Position table in top of contents
+ */
+ div.hb_pos_div { /* HB: Outer div position indicator */
+ margin-top: 0.5em;
}
- td.hb_img_td_img {
- vertical-align: top;
- text-align: center;
+ table.hb_pos_ta { /* HB: Table in position indicator */
+ font-family: sans-serif;
+ font-size: smaller;
}
- td.hb_img_td_empty {
- width: 5ex;
+ tr.hb_pos_tr { /* HB: Row in this table */
}
- td.hb_img_td_a {
- vertical-align: top;
- text-align: left;
+ td.hb_pos_td_arrow { /* HB: Non-text td in this table */
+ text-align: center;
+ vertical-align: top;
+ font-family: sans-serif;
+ font-size: smaller;
}
- a.hb_img_a_larger {
- font-family: sans-serif;
- font-size: 75%;
- color: green;
- text-decoration: none;
+ td.hb_pos_td_text { /* HB: Text td in this table */
+ text-align: left;
+ vertical-align: top;
+ font-family: sans-serif;
+ font-size: smaller;
}
- a.hb_img_a_larger:link {
- font-family: sans-serif;
- font-size: 75%;
- color: green;
- text-decoration: none;
+ /*
+ Navigation button bar
+ */
+ div.hb_navigation { /* HB: Navigation bar div */
}
- a.hb_img_a_larger:visited {
- font-family: sans-serif;
- font-size: 75%;
- color: green;
- text-decoration: none;
+ a.hb_navi_a:link { /* HB: Link in navigation bar */
+ } /* For these links we specify nothing */
+ a.hb_navi_a:visited { /* as there is not text in the links */
+ } /* just images with 0 border. */
+ a.hb_navi_a:focus { /* So any specification has no effect */
+ } /* at all. */
+ a.hb_navi_a:hover {
}
- a.hb_img_a_larger:hover {
- font-family: sans-serif;
- font-size: 75%;
- color: green;
- text-decoration: underline;
+ a.hb_navi_a:active {
}
- a.hb_img_a_larger:focus {
- font-family: sans-serif;
- font-size: 75%;
- color: green;
- text-decoration: underline;
+ img.hb_navi_img { /* HB: Image in navigation bar link */
}
- a.hb_a_i:link {
- color: green;
- text-decoration: none;
+ /*
+ Page table of contents
+ */
+ div.hb_div_ptoc { /* HB: Page TOC outer div */
+ margin-top: 1em;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+ padding-left: 1em;
+ font-family: sans-serif;
+ font-size: smaller;
+ border-left-color: Silver;
+ border-left-style: solid;
+ border-left-width: medium;
}
- a.hb_a_i:visited {
- color: green;
- text-decoration: none;
+ div.hb_div_ptoc_header { /* HB: Page TOC header div */
}
- a.hb_a_i:focus {
- color: green;
- text-decoration: underline;
+ span.hb_span_ptoc { /* HB: Page TOC header span */
}
- a.hb_a_i:hover {
- color: green;
- text-decoration: underline;
+ span.hb_span_ptoc_button { /* HB: Page TOC button span */
}
- a.hb_a_e {
+ span.hb_span_ptoc_button_left { /* HB: Left button border */
}
- table.hb_me_ta {
- background-color: silver;
+ span.hb_span_ptoc_button_text { /* HB: Button text */
}
- tr.hb_me_tr {
+ span.hb_span_ptoc_button_right { /* HB: Right button border */
}
- td.hb_me_td_text {
- font-family: sans-serif;
- text-align: left;
- vertical-align: top;
+ form.hb_ptoc_form { /* HB: Form containing the checkbox */
+ display: none;
}
- td.hb_me_td_arrow {
- font-family: sans-serif;
- text-align: center;
- vertical-align: top;
+ div.hb_div_ptoc_inner { /* HB: Page TOC body div */
+ margin-top: 1em;
}
- table.hb_ptoc_ta {
+ table.hb_ptoc_ta { /* HB: Page TOC table */
}
- tr.hb_ptoc_tr {
+ tr.hb_ptoc_tr { /* HB: Row in this table */
}
- td.hb_ptoc_td_empty {
- width: 3ex;
+ td.hb_ptoc_td_empty { /* HB: Empty cell in this table */
+ width: 3ex;
}
- td.hb_ptoc_td_data {
- font-family: sans-serif;
- font-size: 75%;
- text-align: left;
- vertical-align: top;
+ td.hb_ptoc_td_data { /* HB: Data cell in this table */
+ font-family: sans-serif;
+ font-size: smaller;
+ text-align: left;
+ vertical-align: top;
}
- a.hb_ptoc_a:link {
- color: green;
- text-decoration: none;
+ a.hb_ptoc_a:link { /* HB: Link in this table */
+ text-decoration: none;
}
a.hb_ptoc_a:visited {
- color: green;
- text-decoration: none;
+ text-decoration: none;
}
a.hb_ptoc_a:focus {
- color: green;
- text-decoration: underline;
+ text-decoration: underline;
}
a.hb_ptoc_a:hover {
- color: green;
- text-decoration: underline;
- }
- div.hb_link_div {
- display: none;
+ text-decoration: underline;
}
- table.hb_link_ta {
+ a.hb_ptoc_a:active {
+ text-decoration: underline;
}
- td.hb_link_td_number {
- text-align: center;
- vertical-align: top;
- }
- td.hb_link_td_url {
- text-align: left;
- vertical-align: top;
+ /*
+ Document table of contents at start page
+ */
+ div.hb_dtoc_div { /* HB: Document TOC div */
}
- div.hb_dtoc_div {
+ h2.hb_dtoc_h2 { /* HB: Document TOC header */
}
- table.hb_dtoc_ta {
+ table.hb_dtoc_ta { /* HB: Document TOC table */
}
- tr.hb_dtoc_tr {
+ tr.hb_dtoc_tr { /* HB: Row in this table */
}
- td.hb_dtoc_td_space {
+ td.hb_dtoc_td_space { /* HB: Empty cell in this table */
}
- td.hb_dtoc_td_entry {
- font-family: sans-serif;
- font-size: 75%;
+ td.hb_dtoc_td_entry { /* HB: Data cell in this table */
+ font-family: sans-serif;
+ font-size: smaller;
}
- a.hb_dtoc_a:link {
- color: green;
- text-decoration: none;
+ a.hb_dtoc_a:link { /* HB: Link in this table */
+ text-decoration: none;
}
a.hb_dtoc_a:visited {
- color: green;
- text-decoration: none;
+ text-decoration: none;
}
a.hb_dtoc_a:focus {
- color: green;
- text-decoration: underline;
+ text-decoration: underline;
}
a.hb_dtoc_a:hover {
- color: green;
- text-decoration: underline;
+ text-decoration: underline;
}
- div.hb_ki_div {
+ a.hb_dtoc_a:active {
+ text-decoration: underline;
+ }
+ /*
+ Keyword index at start page
+ */
+ div.hb_ki_div { /* HB: Keyword index div */
}
- h2.hb_ki_h2 {
+ h2.hb_ki_h2 { /* HB: Keyword index header */
}
- dl.hb_ki_dl {
+ dl.hb_ki_dl { /* HB: Keyword index keyword list */
}
- dt.hb_ki_dt {
- font-weight: bold;
+ dt.hb_ki_dt { /* HB: Keyword index keyword */
+ font-weight: bold;
}
- dd.hb_ki_dd {
+ dd.hb_ki_dd { /* HB: Keyword index keyword text */
}
- ul.hb_ki_ul {
+ ul.hb_ki_ul { /* HB: Keyword index page list */
}
- li.hb_ki_li {
- list-style: none;
- font-family: sans-serif;
- font-size: 75%;
+ li.hb_ki_li { /* HB: Keyword index page item */
+ list-style: none;
+ font-family: sans-serif;
+ font-size: smaller;
}
- a.hb_ki_a:link {
- color: green;
- text-decoration: none;
+ a.hb_ki_a:link { /* HB: Keyword index page link */
+ text-decoration: none;
}
a.hb_ki_a:visited {
- color: green;
- text-decoration: none;
+ text-decoration: none;
}
a.hb_ki_a:focus {
- color: green;
- text-decoration: underline;
+ text-decoration: underline;
}
a.hb_ki_a:hover {
- color: green;
- text-decoration: underline;
- }
- div.hb_file_div {
- background-color: #FFFFE8;
- border-width: 1px;
- border-style: solid;
- border-color: black;
- padding-top: 0.5em;
- padding-left: 2em;
- padding-right: 2em;
- padding-bottom: 0.5em;
- margin-top: 0.5em;
- margin-left: 2em;
- margin-right: 2em;
- margin-bottom: 0.5em;
- }
- div.hb_file_div pre {
- border-style: none;
- padding-top: 0.5em;
- padding-left: 0px;
- padding-right: 0px;
- padding-bottom: 0px;
- margin-top: 0px;
- margin-left: 0px;
- margin-right: 0px;
- margin-bottom: 0px;
- overflow: auto;
- }
- div.hb_file_div pre > i {
- font-family: inherit;
- font-style: italic;
- }
- a.hb_file_a:link {
- color: green;
- font-weight: bold;
- text-decoration: none;
+ text-decoration: underline;
}
- a.hb_file_a:visited {
- color: green;
- font-weight: bold;
- text-decoration: none;
- }
- a.hb_file_a:focus {
- color: green;
- font-weight: bold;
- text-decoration: underline;
+ a.hb_ki_a:active {
+ text-decoration: underline;
}
- a.hb_file_a:hover {
- color: green;
- font-weight: bold;
- text-decoration: underline;
- }
- div.hb_img_div_outer {
- margin-top: 1.5em;
- margin-bottom: 1.5em;
- }
- div.hb_img_div_no_vspace {
- margin-top: 0.25em;
- margin-bottom: 0.25em;
- }
- div.hb_img_div_inner_img {
- float: left;
- vertical-align: top;
- text-align: left;
- margin-right: 2em;
- min-height: 3em;
- }
- div.hb_img_div_inner_img_centered {
- float: left;
- vertical-align: top;
- text-align: center;
- margin-right: 2em;
- min-height: 3em;
- }
- p.hb_img_p_download {
- }
- span.hb_img_caption {
- margin-top: 1em;
- }
- /* Classes for easier alignment.
+ /*
+ External links collection at end of contents
*/
- .topleft {
- vertical-align: top;
- text-align: left;
- }
- .topcenter {
- vertical-align: top;
- text-align: center;
- }
- .topright {
- vertical-align: top;
- text-align: right;
- }
- .middleleft {
- vertical-align: middle;
- text-align: left;
- }
- .middlecenter {
- vertical-align: middle;
- text-align: center;
- }
- .middleright {
- vertical-align: middle;
- text-align: right;
- }
- .bottomleft {
- vertical-align: bottom;
- text-align: left;
- }
- .bottomcenter {
- vertical-align: bottom;
- text-align: center;
- }
- .bottomright {
- vertical-align: bottom;
- text-align: right;
- }
- .paddedtopleft {
- vertical-align: top;
- text-align: left;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedtopcenter {
- vertical-align: top;
- text-align: center;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedtopright {
- vertical-align: top;
- text-align: right;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedmiddleleft {
- vertical-align: middle;
- text-align: left;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedmiddlecenter {
- vertical-align: middle;
- text-align: center;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedmiddleright {
- vertical-align: middle;
- text-align: right;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedbottomleft {
- vertical-align: bottom;
- text-align: left;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedbottomcenter {
- vertical-align: bottom;
- text-align: center;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedbottomright {
- vertical-align: bottom;
- text-align: right;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedtop {
- vertical-align: top;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedmiddle {
- vertical-align: middle;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedbottom {
- vertical-align: bottom;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedleft {
- text-align: left;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedcenter {
- text-align: center;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedright {
- text-align: right;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .padded {
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .floatleft {
- float: left;
- }
- .marginfloatleft {
- float: left;
- margin-right: 2em;
- margin-bottom: 1em;
- }
- .floatright {
- float: right;
- }
- .clearboth {
- clear: both;
- }
- table.overview {
- background-color: yellow;
- padding-top: 0.5em;
- padding-left: 2em;
- padding-right: 2em;
- padding-bottom: 0.5em;
- margin-top: 1em;
- margin-bottom: 1em;
+ div.hb_link_div { /* HB: External link collection div */
+ display: none;
}
-}
-
-@media print {
- /* General classes
- */
- /* In FF the TD element does not inherit the font size from body for print */
- * {
- font-size: 12pt;
+ table.hb_link_ta { /* HB: External link collection table */
}
- body {
- font-size: 12pt;
+ td.hb_link_td_number { /* HB: Number cell in this table */
+ text-align: center;
+ vertical-align: top;
}
- h1 {
- font-size: 180%;
- font-weight: bold;
+ td.hb_link_td_url { /* HB: URL cell in this table */
+ text-align: left;
+ vertical-align: top;
}
- h2 {
- font-size: 160%;
- font-weight: bold;
+ span.hb_link_number { /* HB: Number in text, not in list */
+ display: none;
}
- h3 {
- font-size: 160%;
+ /*
+ Navigation menu
+ */
+ div.hb_nm_div { /* HB: Navigation menu div */
+ border: thick solid Bisque;
}
- h4 {
- font-size: 140%;
- font-weight: bold;
+ ul.hb_nm_ul { /* HB: Navigation menu list */
+ list-style: none;
+ margin-top: 1em;
+ margin-bottom: 1em;
+ padding-right: 2em;
}
- h5 {
- font-size: 140%;
+ li.hb_nm_sep { /* HB: Separator in this list */
}
- h6 {
- font-size: 120%;
- font-weight: bold;
+ li.hb_nm_c { /* HB: Current item in this list */
+ color: MidnightBlue;
+ font-weight: bold;
}
- pre {
- border-width: 1px;
- border-style: solid;
- border-color: black;
- padding-top: 0.5em;
- padding-left: 2em;
- padding-right: 2em;
- padding-bottom: 0.5em;
- margin-top: 0.5em;
- margin-left: 2em;
- margin-right: 2em;
- margin-bottom: 0.5em;
- overflow: auto;
+ li.hb_nm_li { /* HB: Normal item in this list */
}
- pre > i {
- font-family: inherit;
- font-style: italic;
+ a.hb_nm_a {
+ color: MidnightBlue;
+ text-decoration: none;
}
- pre code:before {
- content: attr(title)':\20';
- font-size: 50%;
+ a.hb_nm_a:link { /* HB: Link in this list */
+ color: MidnightBlue;
+ text-decoration: none;
}
- /* Classes from the template
- */
- div.header {
- margin: 5pt;
- }
- div.header div.headerleft {
- float: left;
- text-align: left;
- }
- div.header div.headercenter {
- text-align: center;
+ a.hb_nm_a:visited {
+ color: MidnightBlue;
+ text-decoration: none;
}
- div.header div.headercenter span.title {
- font-size: 120%;
+ a.hb_nm_a:focus {
+ color: MidnightBlue;
+ text-decoration: underline;
}
- div.header div.headerright {
- float: right;
- text-align: right;
- display: none;
+ a.hb_nm_a:hover {
+ color: MidnightBlue;
+ text-decoration: underline;
}
- div.navicon {
- clear: both;
- margin: 5pt;
+ a.hb_nm_a:active {
+ color: MidnightBlue;
+ text-decoration: underline;
}
- div.navicon div.naviheader {
+ a.hb_nm_a_parent {
+ color: MidnightBlue;
+ text-decoration: none;
+ font-weight: bold;
}
- div.navicon div.contents: {
- margin-top: 1em;
- margin-bottom: 1em;
+ a.hb_nm_a_parent:link { /* HB: Link in this list */
+ color: MidnightBlue;
+ text-decoration: none;
+ font-weight: bold;
}
- div.footer {
- clear: both;
- border-style: solid;
- border-width: 0.12pt;
- border-color: black;
- margin: 5px;
- padding-left: 0.5em;
- padding-right: 0.5em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
+ a.hb_nm_a_parent:visited {
+ color: MidnightBlue;
+ text-decoration: none;
+ font-weight: bold;
}
- div.footer div.footerleft {
- float: left;
- text-align: left;
+ a.hb_nm_a_parent:focus {
+ color: MidnightBlue;
+ text-decoration: underline;
+ font-weight: bold;
}
- div.footer div.footercenter {
- text-align: center;
+ a.hb_nm_a_parent:hover {
+ color: MidnightBlue;
+ text-decoration: underline;
+ font-weight: bold;
}
- div.footer div.footerright {
- float: right;
- text-align: right;
+ a.hb_nm_a_parent:active {
+ color: MidnightBlue;
+ text-decoration: underline;
+ font-weight: bold;
}
- /* Classes from htmlbook
+ /*
+ Image downloads
*/
- div.hb_nm_div {
- display: none;
- float: right;
- width: 23em;
+ div.hb_img_div_outer { /* HB: Image outer div */
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
}
- ul.hb_nm_ul {
- margin-top: 1em;
- margin-bottom: 1em;
- }
- li.hb_nm_li {
- list-style: none;
- }
- a.hb_nm_a:link {
- color: black;
- text-decoration: none;
+ div.hb_img_div_no_vspace {
+ margin-top: 0.25em;
+ margin-bottom: 0.25em;
}
- a.hb_nm_a:visited {
- color: black;
- text-decoration: none;
+ div.hb_img_div_inner_img { /* HB: Image inner div */
+ float: left;
+ vertical-align: top;
+ text-align: left;
+ margin-right: 2em;
+ min-height: 3em;
}
- a.hb_nm_a:hover {
- color: black;
- text-decoration: none;
+ div.hb_img_div_inner_img_centered { /* HB: Image centered div */
+ float: left;
+ vertical-align: top;
+ text-align: center;
+ margin-right: 2em;
+ min-height: 3em;
}
- a.hb_nm_a:focus {
- color: black;
- text-decoration: none;
+ span.hb_img_caption { /* HB: Image caption */
+ margin-top: 1em;
}
- a.hb_nm_a_parent:link {
- color: black;
- font-weight: bold;
- text-decoration: none;
+ table.hb_img_ta { /* HB: Image table */
}
- a.hb_nm_a_parent:visited {
- color: black;
- font-weight: bold;
- text-decoration: none;
+ tr.hb_img_tr { /* HB: Row in this table */
}
- a.hb_nm_a_parent:hover {
- color: black;
- font-weight: bold;
- text-decoration: none;
+ td.hb_img_td_img { /* HB: Image cell in this table */
+ vertical-align: top;
+ text-align: center;
}
- a.hb_nm_a_parent:focus {
- color: black;
- font-weight: bold;
- text-decoration: none;
+ td.hb_img_td_empty { /* HB: Empty cell in this table */
+ width: 5ex;
}
- li.hb_nm_c {
- list-style: none;
- color: black;
- font-weight: bold;
+ td.hb_img_td_a { /* HB: Link cell in this table */
+ vertical-align: top;
+ text-align: left;
}
- li.hb_nm_sep {
- list-style: none;
+ p.hb_img_p_download { /* HB: Downloads paragraph for image */
}
- div.hb_navigation {
- display: none;
+ a.hb_img_a_larger:link { /* HB: Link to view larger version */
+ font-family: sans-serif;
+ font-size: smaller;
+ text-decoration: none;
}
- a.hb_navi_a {
+ a.hb_img_a_larger:visited {
+ font-family: sans-serif;
+ font-size: smaller;
+ text-decoration: none;
}
- img.hb_navi_img {
+ a.hb_img_a_larger:focus {
+ font-family: sans-serif;
+ font-size: smaller;
+ text-decoration: underline;
}
- div.hb_pos_div {
+ a.hb_img_a_larger:hover {
+ font-family: sans-serif;
+ font-size: smaller;
+ text-decoration: underline;
}
- table.hb_pos_ta {
+ a.hb_img_a_larger:active {
+ font-family: sans-serif;
+ font-size: smaller;
+ text-decoration: underline;
}
- tr.hb_pos_tr {
+ /*
+ Menu entry
+ */
+ table.hb_me_ta { /* HB: Table to show a menu entry */
+ background-color: Silver;
}
- td.hb_pos_td_arrow {
- font-family: sans-serif;
- font-size: 75%;
- text-align: center;
- vertical-align: top;
+ tr.hb_me_tr { /* HB: Row in this table */
}
- td.hb_pos_td_text {
- font-family: sans-serif;
- font-size: 75%;
- text-align: left;
- vertical-align: top;
+ /*
+ Show a code file
+ */
+ div.hb_file_div { /* HB: Code file division */
+ background-color: #FFFFE8;
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding-top: 0.5em;
+ padding-left: 1em;
+ padding-right: 1em;
+ padding-bottom: 0.5em;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ max-width: 45em;
+ }
+ div.hb_file_div > pre {
+ border-style: none;
+ padding-top: 0.5em;
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-bottom: 0px;
+ margin-top: 0px;
+ margin-left: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ overflow: auto;
}
- div.contents_from_text {
+ div.hb_file_div pre > i {
+ font-family: inherit;
+ font-style: italic;
}
- span.hb_link_number {
+ a.hb_file_a:link { /* HB: Link to download the file */
+ font-weight: bold;
+ text-decoration: none;
}
- table.hb_img_ta {
+ a.hb_file_a:visited {
+ font-weight: bold;
+ text-decoration: none;
}
- tr.hb_img_tr {
+ a.hb_file_a:focus {
+ font-weight: bold;
+ text-decoration: underline;
}
- td.hb_img_td_img {
- vertical-align: top;
- text-align: center;
+ a.hb_file_a:hover {
+ font-weight: bold;
+ text-decoration: underline;
}
- td.hb_img_td_empty {
- display: none;
+ a.hb_file_a:active {
+ font-weight: bold;
+ text-decoration: underline;
}
- td.hb_img_td_a {
- display: none;
+ /*
+ External links
+ */
+ a.hb_a_e:link {
}
- a.hb_img_a_larger:link {
- font-family: sans-serif;
- font-size: 75%;
- color: black;
- text-decoration: none;
+ a.hb_a_e:visited {
}
- a.hb_img_a_larger:visited {
- font-family: sans-serif;
- font-size: 75%;
- color: black;
- text-decoration: none;
+ a.hb_a_e:focus {
}
- a.hb_img_a_larger:hover {
- font-family: sans-serif;
- font-size: 75%;
- color: black;
- text-decoration: none;
+ a.hb_a_e:hover {
}
- a.hb_img_a_larger:focus {
- font-family: sans-serif;
- font-size: 75%;
- color: black;
- text-decoration: none;
+ a.hb_a_e:active {
}
+ /*
+ Internal links
+ */
a.hb_a_i:link {
- color: black;
- text-decoration: none;
+ color: MidnightBlue;
+ text-decoration: none;
}
a.hb_a_i:visited {
- color: black;
- text-decoration: none;
+ color: MidnightBlue;
+ text-decoration: none;
}
a.hb_a_i:focus {
- color: black;
- text-decoration: none;
+ color: MidnightBlue;
+ text-decoration: underline;
}
a.hb_a_i:hover {
- color: black;
- text-decoration: none;
- }
- a.hb_a_e {
- }
- table.hb_me_ta {
- border-width: thin;
- border-style: solid;
- border-color: black;
- }
- tr.hb_me_tr {
- border-width: thin;
- border-style: solid;
- border-color: black;
- }
- td.hb_me_td_text {
- font-family: sans-serif;
- text-align: left;
- vertical-align: top;
- padding-left: 0.25em;
- padding-right: 0.25em;
+ color: MidnightBlue;
+ text-decoration: underline;
}
- td.hb_me_td_arrow {
- font-family: sans-serif;
- text-align: center;
- vertical-align: top;
- padding-left: 0.25em;
- padding-right: 0.25em;
+ a.hb_a_i:active {
+ color: MidnightBlue;
+ text-decoration: underline;
}
- table.hb_ptoc_ta {
- display: none;
- }
- tr.hb_ptoc_tr {
- }
- td.hb_ptoc_td_empty {
- width: 3ex;
- }
- td.hb_ptoc_td_data {
- font-family: sans-serif;
- font-size: 75%;
- text-align: left;
- vertical-align: top;
- }
- a.hb_ptoc_a:link {
- color: black;
- text-decoration: none;
+
+ /*
+ Template web.hbt
+ */
+ span.title { /* Title span in header */
}
- a.hb_ptoc_a:visited {
- color: black;
- text-decoration: none;
+ div.contents_from_text { /* Template: Contents div */
}
- a.hb_ptoc_a:focus {
- color: black;
- text-decoration: none;
+ div.hb_div_navigation_top { /* Template: Navigation bar on top */
+ margin-bottom: 0.5em;
}
- a.hb_ptoc_a:hover {
- color: black;
- text-decoration: none;
+ div.hb_div_navigation_bottom { /* Template: Navigation bar bottom */
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
}
- div.hb_link_div {
+ div.hb_div_footer_left { /* Template: Left footer part */
}
- table.hb_link_ta {
- margin-bottom: 1em;
+ div.hb_div_footer_center { /* Template: Center footer part */
}
- td.hb_link_td_number {
- text-align: center;
- vertical-align: top;
+ div.hb_div_footer_right { /* Template: Right footer part */
}
- td.hb_link_td_url {
- text-align: left;
- vertical-align: top;
+ dl.programlist {
}
- div.hb_dtoc_div {
+ dl.programlist > dt {
}
- table.hb_dtoc_ta {
+ dl.programlist > dt > a:link {
+ color: DodgerBlue;
+ text-decoration: none;
+ font-weight: bold;
}
- tr.hb_dtoc_tr {
+ dl.programlist > dt > a:visited {
+ color: DodgerBlue;
+ text-decoration: none;
+ font-weight: bold;
}
- td.hb_dtoc_td_space {
+ dl.programlist > dt > a:focus {
+ color: DodgerBlue;
+ text-decoration: underline;
+ font-weight: bold;
}
- td.hb_dtoc_td_entry {
- font-family: sans-serif;
- font-size: 75%;
+ dl.programlist > dt > a:hover {
+ color: DodgerBlue;
+ text-decoration: underline;
+ font-weight: bold;
}
- a.hb_dtoc_a:link {
- color: black;
- text-decoration: none;
+ dl.programlist > dt > a:active {
+ color: DodgerBlue;
+ text-decoration: underline;
+ font-weight: bold;
}
- a.hb_dtoc_a:visited {
- color: black;
- text-decoration: none;
+ dl.programlist > dd {
+ margin-bottom: 1em;
}
- a.hb_dtoc_a:focus {
- color: black;
- text-decoration: none;
+ /*
+ From old template
+ */
+ pre.codebox { /* OLD template: Source code box */
+ } /* Now just pre is used. */
+}
+
+
+
+/*
+ Printout
+ ========
+*/
+@media print {
+ * {
+ font-size: 12pt;
}
- a.hb_dtoc_a:hover {
- color: black;
- text-decoration: none;
+ body {
+ font-size: 12pt;
}
- div.hb_ki_div {
- display: none;
+ header {
+ text-align: center;
+ padding-bottom: 0.5em;
+ margin-bottom: 0.5em;
+ border-bottom: thin solid Black;
}
- h2.hb_ki_h2 {
+ main {
+ display: block;
}
- dl.hb_ki_dl {
+ nav {
+ display: none;
}
- dt.hb_ki_dt {
- font-weight: bold;
+ footer {
+ margin-top: 0.5em;
+ padding-top: 0.5em;
+ border-top: thin solid Black;
}
- dd.hb_ki_dd {
+ div.hb_pos_div {
+ display: none;
}
- ul.hb_ki_ul {
+ div.hb_navigation_top {
+ display: none;
}
- li.hb_ki_li {
- list-style: none;
- font-family: sans-serif;
- font-size: 75%;
+ div.hb_navigation_bottom {
+ display: none;
}
- a.hb_ki_a:link {
- color: black;
- text-decoration: none;
+ div.hb_navigation {
+ display: none;
}
- a.hb_ki_a:visited {
- color: black;
- text-decoration: none;
+ div.hb_div_ptoc {
+ display: none;
}
- a.hb_ki_a:focus {
- color: black;
- text-decoration: none;
+ td.hb_img_td_img {
+ vertical-align: top;
+ text-align: center;
}
- a.hb_ki_a:hover {
- color: black;
- text-decoration: none;
- }
- div.hb_file_div {
- border-width: 1px;
- border-style: solid;
- border-color: black;
- padding-top: 0.5em;
- padding-left: 2em;
- padding-right: 2em;
- padding-bottom: 0.5em;
- margin-top: 0.5em;
- margin-left: 2em;
- margin-right: 2em;
- margin-bottom: 0.5em;
- }
- div.hb_file_div pre {
- border-style: none;
- padding-top: 0.5em;
- padding-left: 0px;
- padding-right: 0px;
- padding-bottom: 0px;
- margin-top: 0px;
- margin-left: 0px;
- margin-right: 0px;
- margin-bottom: 0px;
- overflow: auto;
+ td.hb_img_td_a {
+ display: none;
}
- div.hb_file_div pre > i {
- font-family: inherit;
- font-style: italic;
+ td.hb_img_a_larger {
+ display: none;
}
- a.hb_file_a:link {
- color: black;
- font-weight: bold;
- text-decoration: underline;
+ pre {
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+ padding-bottom: 0.5em;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ overflow: auto;
}
- a.hb_file_a:visited {
- color: black;
- font-weight: bold;
- text-decoration: underline;
+ pre > i {
+ font-family: inherit;
+ font-style: italic;
}
- a.hb_file_a:focus {
- color: black;
- font-weight: bold;
- text-decoration: underline;
+ pre code::before {
+ content: attr(title)':\20';
+ font-size: 50%;
}
- a.hb_file_a:hover {
- color: black;
- font-weight: bold;
- text-decoration: underline;
+ a:link { /* Show links in print underlined. */
+ color: Black;
+ text-decoration: underline;
}
- div.hb_img_div_outer {
- margin-top: 1.5em;
- margin-bottom: 1.5em;
+ a:visited {
+ color: Black;
+ text-decoration: underline;
}
- div.hb_img_div_no_vspace {
+ a:focus {
+ color: Black;
+ text-decoration: underline;
}
- div.hb_img_div_inner_img {
- float: left;
- vertical-align: top;
- text-align: left;
- margin-right: 2em;
+ a:hover {
+ color: Black;
+ text-decoration: underline;
}
- div.hb_img_div_inner_img_centered {
- float: left;
- vertical-align: top;
- text-align: center;
- margin-right: 2em;
+ a:active {
+ color: Black;
+ text-decoration: underline;
}
- p.hb_img_p_download {
- display: none;
+ table.hb_link_ta { /* HB: External link collection table */
}
- span.hb_img_caption {
- margin-top: 1em;
+ td.hb_link_td_number { /* HB: Number cell in this table */
+ text-align: center;
+ vertical-align: top;
}
- /* Classes for easier alignment.
- */
- .topleft {
- vertical-align: top;
- text-align: left;
- }
- .topcenter {
- vertical-align: top;
- text-align: center;
- }
- .topright {
- vertical-align: top;
- text-align: right;
- }
- .middleleft {
- vertical-align: middle;
- text-align: left;
- }
- .middlecenter {
- vertical-align: middle;
- text-align: center;
- }
- .middleright {
- vertical-align: middle;
- text-align: right;
- }
- .bottomleft {
- vertical-align: bottom;
- text-align: left;
- }
- .bottomcenter {
- vertical-align: bottom;
- text-align: center;
- }
- .bottomright {
- vertical-align: bottom;
- text-align: right;
- }
- .paddedtopleft {
- vertical-align: top;
- text-align: left;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedtopcenter {
- vertical-align: top;
- text-align: center;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedtopright {
- vertical-align: top;
- text-align: right;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedmiddleleft {
- vertical-align: middle;
- text-align: left;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedmiddlecenter {
- vertical-align: middle;
- text-align: center;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedmiddleright {
- vertical-align: middle;
- text-align: right;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedbottomleft {
- vertical-align: bottom;
- text-align: left;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedbottomcenter {
- vertical-align: bottom;
- text-align: center;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedbottomright {
- vertical-align: bottom;
- text-align: right;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedtop {
- vertical-align: top;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedmiddle {
- vertical-align: middle;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedbottom {
- vertical-align: bottom;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedleft {
- text-align: left;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedcenter {
- text-align: center;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .paddedright {
- text-align: right;
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .padded {
- padding-left: 0.25em;
- padding-right: 0.25em;
- padding-top: 0.12em;
- padding-bottom: 0.12em;
- }
- .floatleft {
- float: left;
- }
- .marginfloatleft {
- float: left;
- margin-right: 2em;
- margin-bottom: 1em;
- }
- .floatright {
- float: right;
- }
- .clearboth {
- clear: both;
- }
- table.overview {
- padding-top: 0.5em;
- padding-left: 2em;
- padding-right: 2em;
- padding-bottom: 0.5em;
- margin-top: 1em;
- margin-bottom: 1em;
+ td.hb_link_td_url { /* HB: URL cell in this table */
+ text-align: left;
+ vertical-align: top;
}
}
+
@page {
- margin-top: 1.5cm;
- margin-bottom: 1.5cm;
+ margin-top: 1.5cm;
+ margin-bottom: 1.5cm;
}
@page :left {
- margin-left: 1.5cm;
- margin-right: 2.5cm;
+ margin-left: 1.5cm;
+ margin-right: 2.5cm;
}
@page :right {
- margin-left: 2.5cm;
- margin-right: 1.5cm;
+ margin-left: 2.5cm;
+ margin-right: 1.5cm;
+}
+
+
+/*
+ General tool classes for DK tools and libraries
+ -----------------------------------------------
+*/
+
+h1 { /* Headings */
+ font-size: 200%;
+ font-weight: bold;
+}
+h2 {
+ font-size: 180%;
+ font-weight: bold;
+}
+h3 {
+ font-size: 160%;
+ font-weight: bold;
+}
+h4 {
+ font-size: 140%;
+ font-weight: bold;
+}
+h5 {
+ font-size: 120%;
+ font-weight: bold;
+}
+h6 {
+ font-size: 100%;
+ font-weight: bold;
}
+td.hb_me_td_text { /* HB: Text cell in menu entry */
+ font-family: sans-serif;
+ text-align: left;
+ vertical-align: top;
+}
+td.hb_me_td_arrow { /* HB: Arrow cell in menu entry */
+ font-family: sans-serif;
+ text-align: center;
+ vertical-align: top;
+}
+.topleft { /* DK t+l: Table cell alignments */
+ vertical-align: top;
+ text-align: left;
+}
+.topcenter {
+ vertical-align: top;
+ text-align: center;
+}
+.topright {
+ vertical-align: top;
+ text-align: right;
+}
+.middleleft {
+ vertical-align: middle;
+ text-align: left;
+}
+.middlecenter {
+ vertical-align: middle;
+ text-align: center;
+}
+.middleright {
+ vertical-align: middle;
+ text-align: right;
+}
+.bottomleft {
+ vertical-align: bottom;
+ text-align: left;
+}
+.bottomcenter {
+ vertical-align: bottom;
+ text-align: center;
+}
+.bottomright {
+ vertical-align: bottom;
+ text-align: right;
+}
+.paddedtopleft {
+ vertical-align: top;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedtopcenter {
+ vertical-align: top;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedtopright {
+ vertical-align: top;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedmiddleleft {
+ vertical-align: middle;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedmiddlecenter {
+ vertical-align: middle;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedmiddleright {
+ vertical-align: middle;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedbottomleft {
+ vertical-align: bottom;
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedbottomcenter {
+ vertical-align: bottom;
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedbottomright {
+ vertical-align: bottom;
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedtop {
+ vertical-align: top;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedmiddle {
+ vertical-align: middle;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedbottom {
+ vertical-align: bottom;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedleft {
+ text-align: left;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedcenter {
+ text-align: center;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.paddedright {
+ text-align: right;
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.padded {
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ padding-top: 0.12em;
+ padding-bottom: 0.12em;
+}
+.hint { /* HB: Show hint (title attribute) */
+ cursor: help;
+ border-bottom: 1px dotted;
+}
+.clearboth { /* HB: Clear both float directions */
+ clear: both;
+}
+.floatleft { /* HB: Float settings */
+ float: left;
+}
+.marginfloatleft { /* HB: Float settings with margins */
+ float: left;
+ margin-right: 2em;
+ margin-bottom: 1em;
+}
+.floatright { /* HB: Float settings */
+ float: right;
+}
+.marginfloatright { /* HB: Float settings with margins */
+ float: right;
+ margin-left: 2em;
+ margin-bottom: 1em;
+}
+span.nowindows {
+ text-decoration: line-through;
+ cursor: help;
+ border-bottom: 1px dotted;
+}
+span.onlywindows {
+ cursor: help;
+ border-bottom: 1px dotted;
+}
+dl.variablestomodify {
+}
+dl.variablestomodify > dt {
+ font-weight: bold;
+}
+dl.variablestomodify > dd {
+ margin-bottom: 1em;
+}
diff --git a/support/dktools/dktools/htmlbook/toc.fig b/support/dktools/dktools/htmlbook/toc.fig
deleted file mode 100644
index 102f7243a4..0000000000
--- a/support/dktools/dktools/htmlbook/toc.fig
+++ /dev/null
@@ -1,36 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-0 32 #364e6d
-2 2 0 0 7 7 999 1 -1 0 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-2 4 0 0 0 0 105 1 5 0 0 0 19 0 0 5
- 150 150 1125 150 1125 1125 150 1125 150 150
-2 4 0 0 0 0 104 1 10 0 0 0 19 0 0 5
- 112 112 1087 112 1087 1087 112 1087 112 112
-2 4 0 0 4 4 103 1 20 0 0 0 16 0 0 5
- 75 75 1050 75 1050 1050 75 1050 75 75
-2 4 0 0 6 6 102 1 20 0 0 0 16 0 0 5
- 150 150 975 150 975 975 150 975 150 150
-2 1 0 5 0 0 99 1 -1 0 0 0 12 0 0 2
- 225 337 712 337
-2 1 0 5 0 0 99 1 -1 0 0 0 12 0 0 2
- 900 337 825 337
-2 1 0 5 0 0 99 1 -1 0 0 0 12 0 0 2
- 225 487 712 487
-2 1 0 5 0 0 99 1 -1 0 0 0 12 0 0 2
- 900 487 825 487
-2 1 0 5 0 0 99 1 -1 0 0 0 12 0 0 2
- 225 637 712 637
-2 1 0 5 0 0 99 1 -1 0 0 0 12 0 0 2
- 900 637 825 637
-2 1 0 5 0 0 99 1 -1 0 0 0 12 0 0 2
- 225 787 712 787
-2 1 0 5 0 0 99 1 -1 0 0 0 12 0 0 2
- 900 787 825 787
diff --git a/support/dktools/dktools/htmlbook/toc.pdf b/support/dktools/dktools/htmlbook/toc.pdf
new file mode 100644
index 0000000000..e6435526e6
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/toc.pdf
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/toc.png b/support/dktools/dktools/htmlbook/toc.png
index 6248f9a4b6..13ebb7e5c4 100644
--- a/support/dktools/dktools/htmlbook/toc.png
+++ b/support/dktools/dktools/htmlbook/toc.png
Binary files differ
diff --git a/support/dktools/dktools/htmlbook/toc.svg b/support/dktools/dktools/htmlbook/toc.svg
new file mode 100644
index 0000000000..310b483546
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/toc.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="72pt" height="72pt" viewBox="0 0 72 72" version="1.1">
+<g id="surface1">
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(75%,75%,75%);fill-opacity:1;" d="M 26.101562 67.5 L 50.398438 67.5 C 59.84375 67.5 67.5 59.84375 67.5 50.398438 L 67.5 26.097656 C 67.5 16.65625 59.84375 9 50.398438 9 L 26.101562 9 C 16.65625 9 9 16.65625 9 26.097656 L 9 50.398438 C 9 59.84375 16.65625 67.5 26.101562 67.5 Z M 26.101562 67.5 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(50%,50%,50%);fill-opacity:1;" d="M 23.820312 65.21875 L 48.121094 65.21875 C 57.5625 65.21875 65.21875 57.5625 65.21875 48.117188 L 65.21875 23.820312 C 65.21875 14.375 57.5625 6.71875 48.121094 6.71875 L 23.820312 6.71875 C 14.375 6.71875 6.71875 14.375 6.71875 23.820312 L 6.71875 48.117188 C 6.71875 57.5625 14.375 65.21875 23.820312 65.21875 Z M 23.820312 65.21875 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 18.898438 63 L 48.601562 63 C 56.554688 63 63 56.550781 63 48.597656 L 63 18.898438 C 63 10.945312 56.554688 4.5 48.601562 4.5 L 18.898438 4.5 C 10.945312 4.5 4.5 10.945312 4.5 18.898438 L 4.5 48.597656 C 4.5 56.550781 10.945312 63 18.898438 63 Z M 18.898438 63 "/>
+<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,100%,0%);fill-opacity:1;" d="M 23.398438 58.5 L 44.101562 58.5 C 52.054688 58.5 58.5 52.050781 58.5 44.097656 L 58.5 23.398438 C 58.5 15.445312 52.054688 9 44.101562 9 L 23.398438 9 C 15.445312 9 9 15.445312 9 23.398438 L 9 44.097656 C 9 52.050781 15.445312 58.5 23.398438 58.5 Z M 23.398438 58.5 "/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 13.5 51.78025 L 42.71875 51.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54 51.78025 L 49.5 51.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 13.5 42.78025 L 42.71875 42.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54 42.78025 L 49.5 42.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 13.5 33.78025 L 42.71875 33.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54 33.78025 L 49.5 33.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 13.5 24.78025 L 42.71875 24.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+<path style="fill:none;stroke-width:4.5;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54 24.78025 L 49.5 24.78025 " transform="matrix(1,0,0,-1,0,71.999)"/>
+</g>
+</svg>
diff --git a/support/dktools/dktools/htmlbook/toc.wxd b/support/dktools/dktools/htmlbook/toc.wxd
new file mode 100644
index 0000000000..76956b6b7d
--- /dev/null
+++ b/support/dktools/dktools/htmlbook/toc.wxd
@@ -0,0 +1,31 @@
+WXD 1 0
+0 0 0 6096000 0 6096000
+0 2 8
+11 -2 169 169 169 255 255 255 8 0 4 0
+ 1016000 5588000 508000 5080000 1143000
+11 -1 255 228 196 255 255 255 8 0 4 0
+ 508000 5080000 1016000 5588000 1143000
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 1778000 4191000
+ 3556000 4191000
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 4191000
+ 4445000 4191000
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 1778000 3429000
+ 3556000 3429000
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 1778000 2667000
+ 3556000 2667000
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 3429000
+ 4445000 3429000
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2667000
+ 4445000 2667000
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 1778000 1905000
+ 3556000 1905000
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 1905000
+ 4445000 1905000
diff --git a/support/dktools/dktools/htmlbook/web.hbt b/support/dktools/dktools/htmlbook/web.hbt
index 9f59b60999..cf60442241 100644
--- a/support/dktools/dktools/htmlbook/web.hbt
+++ b/support/dktools/dktools/htmlbook/web.hbt
@@ -1,24 +1,31 @@
-<div class="header">
-<div class="headerleft">
-%%img src=mylogo.png alt="My introduction to something" title%%
-</div><!-- class="headerleft" -->
-<div class="headerright">
-</div><!-- class="headerright" -->
-<div class="headercenter">
-<span class="title">%%title%%</span>
-</div><!-- class="headercenter" -->
-</div><!-- class="header" -->
-<div class="navicon">
-%%menu%%
-<div class="naviheader">&nbsp;</div>
-<div class="contents">
+<header>
+<div class="hb_div_header_left">
+<span class="title">%%title%% %%var versno%%</span>
+</div><!-- hb_div_header_left -->
+<div class="hb_div_header_right">
+<!-- Contact | Impressum | Privacy -->
+</div><!-- hb_div_header_right -->
+<div class="hb_div_header_center">
+</div><!-- hb_div_header_center -->
+</header>
+<main>
+<article>
+<div class="hb_div_navigation_top">
%%navigation%%
-<div class="contents_from_text">%%contents%%</div><!-- class="contents_from_text" -->
+</div><!-- hb_div_navigation_top -->
+<div class="contents_from_text">
+%%contents%%
+</div><!-- class=contents_from_text -->
+<div class="hb_div_navigation_bottom">
%%navigation%%
-</div><!-- class="contents" -->
-</div><!-- class="navicon" -->
-<div class="footer">
-<div class="footerleft">%%author%%</div>
-<div class="footerright">%%location%%, %%date style=german%%</div>
-<div class="footercenter">&nbsp;</div>
-</div><!-- class="footer" -->
+</div><!-- hb_div_navigation_bottom" -->
+</article>
+</main>
+<nav>
+%%menu%%
+</nav>
+<footer>
+<div class="hb_div_footer_left">%%author%%</div><!-- hb_div_footer_left -->
+<div class="hb_div_footer_center"></div><!-- hb_div_footer_center -->
+<div class="hb_div_footer_right">%%date%%<br class="clearboth"></div><!-- hb_div_footer_right -->
+</footer>
diff --git a/support/dktools/dktools/itadmin/it-de.sql b/support/dktools/dktools/itadmin/it-de.sql
index ab58d7e4da..c12c9c0865 100644
--- a/support/dktools/dktools/itadmin/it-de.sql
+++ b/support/dktools/dktools/itadmin/it-de.sql
@@ -42,6 +42,25 @@ INSERT INTO ddspeed (sp_s, sp_l ) VALUES
('10fd', '10 MBit/s vollduplex'),
('100fd', '100 MBit/s vollduplex');
+-- guest flags
+
+CREATE TABLE guestflag (
+ gu_f integer , -- Zahlenwert
+ gu_d char(64) default NULL, -- Beschreibung
+ gu_m timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY(gu_f)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO guestflag (gu_f, gu_d) VALUES
+(0, 'Normaler Computer'),
+(1, 'BYOD: Bring your own device, Privatbesitz'),
+(2, 'Nicht im Verantwortungsbereich der Organisationseinheit'),
+(3, 'DHCP: Dynamisch verteilte IP-Adresse'),
+(4, 'Zweiter oder weiterer Netzwerkanschluss'),
+(5, 'Ohne Software: Oszilloskop, Steuerung...'),
+(6, 'IP-Adresse / Hostname reserviert, noch nicht genutzt'),
+(7, 'Ausgesondert, nicht mehr in Betrieb');
+
-- Gebaeude
CREATE TABLE buildings (
@@ -195,6 +214,7 @@ CREATE TABLE computers (
CONSTRAINT ch FOREIGN KEY (dc_s) REFERENCES dhcpclasses(dc_s) ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT ck FOREIGN KEY (dg_s) REFERENCES dhcpgroups(dg_s) ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT cm FOREIGN KEY (dd_n) REFERENCES patches(dd_n) ON UPDATE CASCADE ON DELETE RESTRICT,
+ CONSTRAINT cp FOREIGN KEY (co_gu) REFERENCES guestflag(gu_f) ON UPDATE CASCADE ON DELETE RESTRICT,
PRIMARY KEY (co_s),
INDEX(us_s),
INDEX(co_ip),
diff --git a/support/dktools/dktools/itadmin/it-latin1.sql b/support/dktools/dktools/itadmin/it-latin1.sql
index 039e3eeac9..011b399df3 100644
--- a/support/dktools/dktools/itadmin/it-latin1.sql
+++ b/support/dktools/dktools/itadmin/it-latin1.sql
@@ -42,6 +42,25 @@ INSERT INTO ddspeed (sp_s, sp_l ) VALUES
('10fd', '10 MBit/s full-duplex'),
('100fd', '100 MBit/s full-duplex');
+-- guest flags
+
+CREATE TABLE guestflag (
+ gu_f integer , -- integer value in computers/co_gu
+ gu_d char(64) default NULL, -- description
+ gu_m timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY(gu_f)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO guestflag (gu_f, gu_d) VALUES
+(0, 'Normal computer'),
+(1, 'BYOD: Bring your own device, private computers'),
+(2, 'Outside our responsibility'),
+(3, 'DHCP: IP addresses and host named dynamically assigned'),
+(4, 'Secondary network interfaces of computers'),
+(5, 'No software: Measurement device, oscilloscope...'),
+(6, 'Reserved: IP address/host name reserved, but not yet used'),
+(7, 'Retired: Computer or device no longer in use');
+
-- buildings
CREATE TABLE buildings (
@@ -205,7 +224,8 @@ CREATE TABLE computers (
CONSTRAINT cg FOREIGN KEY (gb_s) REFERENCES buildings(gb_s) ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT ch FOREIGN KEY (dc_s) REFERENCES dhcpclasses(dc_s) ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT ck FOREIGN KEY (dg_s) REFERENCES dhcpgroups(dg_s) ON UPDATE CASCADE ON DELETE RESTRICT,
- CONSTRAINT cn FOREIGN KEY (dd_n) REFERENCES patches(dd_n) ON UPDATE CASCADE ON DELETE RESTRICT
+ CONSTRAINT cn FOREIGN KEY (dd_n) REFERENCES patches(dd_n) ON UPDATE CASCADE ON DELETE RESTRICT,
+ CONSTRAINT cp FOREIGN KEY (co_gu) REFERENCES guestflag(gu_f) ON UPDATE CASCADE ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE aliases (
diff --git a/support/dktools/dktools/itadmin/it-utf8.sql b/support/dktools/dktools/itadmin/it-utf8.sql
index fe6c9158ff..be84914e90 100644
--- a/support/dktools/dktools/itadmin/it-utf8.sql
+++ b/support/dktools/dktools/itadmin/it-utf8.sql
@@ -42,6 +42,25 @@ INSERT INTO ddspeed (sp_s, sp_l ) VALUES
('10fd', '10 MBit/s full-duplex'),
('100fd', '100 MBit/s full-duplex');
+-- guest flags
+
+CREATE TABLE guestflag (
+ gu_f integer , -- integer value in computers/co_gu
+ gu_d char(64) default NULL, -- description
+ gu_m timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY(gu_f)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO guestflag (gu_f, gu_d) VALUES
+(0, 'Normal computer'),
+(1, 'BYOD: Bring your own device, private computers'),
+(2, 'Outside our responsibility'),
+(3, 'DHCP: IP addresses and host named dynamically assigned'),
+(4, 'Secondary network interfaces of computers'),
+(5, 'No software: Measurement device, oscilloscope...'),
+(6, 'Reserved: IP address/host name reserved, but not yet used'),
+(7, 'Retired: Computer or device no longer in use');
+
-- buildings
CREATE TABLE buildings (
@@ -205,7 +224,8 @@ CREATE TABLE computers (
CONSTRAINT cg FOREIGN KEY (gb_s) REFERENCES buildings(gb_s) ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT ch FOREIGN KEY (dc_s) REFERENCES dhcpclasses(dc_s) ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT ck FOREIGN KEY (dg_s) REFERENCES dhcpgroups(dg_s) ON UPDATE CASCADE ON DELETE RESTRICT,
- CONSTRAINT cn FOREIGN KEY (dd_n) REFERENCES patches(dd_n) ON UPDATE CASCADE ON DELETE RESTRICT
+ CONSTRAINT cn FOREIGN KEY (dd_n) REFERENCES patches(dd_n) ON UPDATE CASCADE ON DELETE RESTRICT,
+ CONSTRAINT cp FOREIGN KEY (co_gu) REFERENCES guestflag(gu_f) ON UPDATE CASCADE ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE aliases (
diff --git a/support/dktools/dktools/mime/dkrause-wxdkdraw.xml b/support/dktools/dktools/mime/dkrause-wxdkdraw.xml
new file mode 100644
index 0000000000..6aa53e5d22
--- /dev/null
+++ b/support/dktools/dktools/mime/dkrause-wxdkdraw.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="image/x-wxdkdraw">
+ <comment>wxdkdraw drawing</comment>
+ <glob pattern="*.wxd"/>
+ </mime-type>
+</mime-info>
diff --git a/support/dktools/dktools/mime/wxdkdraw b/support/dktools/dktools/mime/wxdkdraw
new file mode 100644
index 0000000000..b111f342b2
--- /dev/null
+++ b/support/dktools/dktools/mime/wxdkdraw
@@ -0,0 +1 @@
+image/x-wxdkdraw; wxdkdraw '%s'; edit=wxdkdraw '%s'; test=test -n "$DISPLAY"; description=wxdkdraw drawing
diff --git a/support/dktools/dktools/mime/wxdkdraw_64.png b/support/dktools/dktools/mime/wxdkdraw_64.png
new file mode 100644
index 0000000000..ffbfda0244
--- /dev/null
+++ b/support/dktools/dktools/mime/wxdkdraw_64.png
Binary files differ
diff --git a/support/dktools/dktools/print-snmp.conf b/support/dktools/dktools/print-snmp.conf
index a32f8c45c5..26b6330a08 100644
--- a/support/dktools/dktools/print-snmp.conf
+++ b/support/dktools/dktools/print-snmp.conf
@@ -1,3 +1,6 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
#
# The first ``default'' entry shows the built-in default
# configuration.
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/c.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/c.wxd
new file mode 100644
index 0000000000..f66ab175d6
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/c.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 4064000
+0 2 2
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 3048000
+ 7112000 3048000
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 1016000
+ 7112000 1016000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 3048000
+ 4064000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 1016000
+ 4064000 0
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-el-old.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-el-old.wxd
new file mode 100644
index 0000000000..0d3a5c5604
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-el-old.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 5588000
+ 4064000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 2540000
+ 4064000 0
+11 0 0 0 0 255 255 255 2 0 4 0
+ 1016000 7112000 4572000 5588000 0
+11 0 0 0 0 0 0 0 2 0 4 1
+ 1016000 7112000 2540000 3556000 0
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-el.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-el.wxd
new file mode 100644
index 0000000000..d5a087831b
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-el.wxd
@@ -0,0 +1,21 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 5080000
+ 7112000 5080000
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 3048000
+ 7112000 3048000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 5080000
+ 4064000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 3048000
+ 4064000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4572000 6096000
+ 5588000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 5080000 5588000
+ 5080000 6604000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-horiz.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-horiz.wxd
new file mode 100644
index 0000000000..0c9924c37d
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-horiz.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 4064000 0 8128000
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 7112000
+ 1016000 1016000
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 3048000 7112000
+ 3048000 1016000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 1016000 4064000
+ 0 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 3048000 4064000
+ 4064000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-variable-trim.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-variable-trim.wxd
new file mode 100644
index 0000000000..f1b02930ca
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-variable-trim.wxd
@@ -0,0 +1,21 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 4
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 5080000
+ 7112000 5080000
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 3048000
+ 7112000 3048000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 5080000
+ 4064000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 3048000
+ 4064000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 6 0 16 8
+ 1016000 1016000
+ 7112000 7112000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 7620000 6604000
+ 6604000 7620000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-variable.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-variable.wxd
new file mode 100644
index 0000000000..50d0d63e88
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/C/special/c-variable.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 8128000 0 6096000
+0 2 4
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 4064000
+ 7112000 4064000
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 2032000
+ 7112000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 4064000
+ 4064000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 2032000
+ 4064000 0
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 1016000 0
+ 7112000 6096000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/ANSI/diode.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/ANSI/diode.wxd
new file mode 100644
index 0000000000..2544865952
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/ANSI/diode.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 4 0 4 0 1 8 0 16 8 0 16 8
+ 7112000 1016000
+ 7112000 7112000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 1016000 4064000
+ 0 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 7112000 4064000
+ 8128000 4064000
+6 3 1 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/diode.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/diode.wxd
new file mode 100644
index 0000000000..35b35dd71d
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/diode.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 8128000 4064000
+3 2 0 0 0 0 2 0 4 0 1 8 0 16 8 0 16 8
+ 7112000 0
+ 7112000 8128000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-backward.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-backward.wxd
new file mode 100644
index 0000000000..fe2c4f92f9
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-backward.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 10160000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 10160000 4064000
+3 2 0 0 0 0 2 0 4 0 1 8 0 16 8 0 16 8
+ 7112000 0
+ 7112000 8128000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 5080000 8128000
+ 9144000 8128000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 5080000 0
+ 9144000 0
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-breakdown.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-breakdown.wxd
new file mode 100644
index 0000000000..9136d0b42b
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-breakdown.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 14224000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 14224000 4064000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
+3 4 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 5080000 0
+ 7112000 0
+ 7112000 8128000
+ 9144000 8128000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 13208000 0
+ 13208000 8128000
+ 7112000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-capacitive.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-capacitive.wxd
new file mode 100644
index 0000000000..75c4bcfd7b
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-capacitive.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 0 1 8 0 16 8 0 16 8
+ 8128000 0
+ 8128000 8128000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 2032000 0
+ 2032000 8128000
+ 8128000 4064000
+3 2 0 0 0 0 2 0 4 0 1 8 0 16 8 0 16 8
+ 10160000 0
+ 10160000 8128000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 10160000 4064000
+ 12192000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-diac.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-diac.wxd
new file mode 100644
index 0000000000..8c22c205e9
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-diac.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 12192000 0 16256000
+3 5 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 0 8128000
+ 2032000 8128000
+ 10160000 4064000
+ 2032000 0
+ 2032000 16256000
+3 5 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 12192000 8128000
+ 10160000 8128000
+ 2032000 12192000
+ 10160000 16256000
+ 10160000 0
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-led.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-led.wxd
new file mode 100644
index 0000000000..4e04df7ce5
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-led.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 8128000 0 13208000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 8128000 4064000
+3 2 0 0 0 0 2 0 4 0 1 8 0 16 8 0 16 8
+ 7112000 0
+ 7112000 8128000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
+3 2 0 0 0 0 2 0 4 1 1 8 3 8 6 0 16 8
+ 3556000 9144000
+ 6604000 13208000
+3 2 0 0 0 0 2 0 4 1 1 8 3 8 6 0 16 8
+ 5080000 7620000
+ 8128000 11684000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-photo.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-photo.wxd
new file mode 100644
index 0000000000..55f706e93e
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-photo.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 8128000 0 13208000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 8128000 4064000
+3 2 0 0 0 0 2 0 4 0 1 8 0 16 8 0 16 8
+ 7112000 0
+ 7112000 8128000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
+3 2 0 0 0 0 2 0 4 1 1 8 0 8 6 3 8 6
+ 4572000 7112000
+ 1524000 11176000
+3 2 0 0 0 0 2 0 4 1 1 8 0 8 6 3 8 6
+ 6096000 8636000
+ 3048000 12700000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-schottky.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-schottky.wxd
new file mode 100644
index 0000000000..50ec8ef18a
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-schottky.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 12192000 4064000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 3048000 0
+ 3048000 8128000
+ 9144000 4064000
+3 4 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 7112000 0
+ 9144000 0
+ 9144000 8128000
+ 11176000 8128000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-shockley.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-shockley.wxd
new file mode 100644
index 0000000000..d00823382a
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-shockley.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 8128000 4064000
+3 2 0 0 0 0 2 0 4 0 1 8 0 16 8 0 16 8
+ 7112000 0
+ 7112000 8128000
+3 3 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-temparature-dependend.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-temparature-dependend.wxd
new file mode 100644
index 0000000000..cb3fde29de
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-temparature-dependend.wxd
@@ -0,0 +1,30 @@
+WXD 1 0
+0 0 0 8128000 0 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 8128000 6096000
+3 2 0 0 0 0 2 0 4 0 1 8 0 16 8 0 16 8
+ 7112000 2032000
+ 7112000 10160000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 2032000
+ 1016000 10160000
+ 7112000 6096000
+1
+7 12 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 3683000 508000 1
+ 3429000 1016000 1
+ 3429000 1524000 -1
+ 3429000 2032000 1
+ 3683000 2540000 1
+ 4064000 2540000 -1
+ 4445000 2540000 1
+ 4699000 2032000 1
+ 4699000 1524000 -1
+ 4699000 1016000 1
+ 4445000 508000 1
+ 4064000 508000 -1
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 3810000 1524000
+ 4318000 1524000
+-1
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-tunnel.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-tunnel.wxd
new file mode 100644
index 0000000000..0970f7bfed
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-tunnel.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 8128000 4064000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
+3 4 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 5080000 0
+ 7112000 0
+ 7112000 8128000
+ 5080000 8128000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-zener.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-zener.wxd
new file mode 100644
index 0000000000..fba12d10eb
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Diode/special/diode-zener.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 8128000 4064000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 1016000 0
+ 1016000 8128000
+ 7112000 4064000
+3 3 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 5080000 0
+ 7112000 0
+ 7112000 8128000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-depletion.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-depletion.wxd
new file mode 100644
index 0000000000..54441ac1e9
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-depletion.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 4
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 1016000
+ 4064000 7112000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 1016000 4064000
+ 4064000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 6096000
+ 0 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 5080000 2032000
+ 5080000 6096000
+ 8128000 6096000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement-source-on-substrate.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement-source-on-substrate.wxd
new file mode 100644
index 0000000000..eab7b411d6
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement-source-on-substrate.wxd
@@ -0,0 +1,25 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 6096000
+ 0 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 5080000 2032000
+ 5080000 6096000
+ 8128000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 4826000
+ 4064000 3302000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 1270000
+ 4064000 2794000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 5334000
+ 4064000 6858000
+3 3 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 1016000 6096000
+ 1016000 4064000
+ 4064000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement-substrate.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement-substrate.wxd
new file mode 100644
index 0000000000..f63ee62f68
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement-substrate.wxd
@@ -0,0 +1,24 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 0 4064000
+ 4064000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 6096000
+ 0 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 5080000 2032000
+ 5080000 6096000
+ 8128000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 4826000
+ 4064000 3302000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 5588000
+ 4064000 7112000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2540000
+ 4064000 1016000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement.wxd
new file mode 100644
index 0000000000..70fd1a0816
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-igfet-enhancement.wxd
@@ -0,0 +1,24 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 1016000 4064000
+ 4064000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 6096000
+ 0 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 5080000 2032000
+ 5080000 6096000
+ 8128000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 4826000
+ 4064000 3302000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 1270000
+ 4064000 2794000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 5334000
+ 4064000 6858000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-jfet.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-jfet.wxd
new file mode 100644
index 0000000000..e0fe12819b
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/n-jfet.wxd
@@ -0,0 +1,16 @@
+WXD 1 0
+0 0 0 4064000 0 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 1016000
+ 2032000 5080000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 4064000
+ 4064000 4064000
+ 4064000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 0
+ 4064000 2032000
+ 2032000 2032000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-depletion.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-depletion.wxd
new file mode 100644
index 0000000000..a4b1820f91
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-depletion.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 1016000
+ 4064000 7112000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 4064000 4064000
+ 1016000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 6096000
+ 0 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 5080000 2032000
+ 5080000 6096000
+ 8128000 6096000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-enhancement-substrate.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-enhancement-substrate.wxd
new file mode 100644
index 0000000000..e399f4bf18
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-enhancement-substrate.wxd
@@ -0,0 +1,27 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 4064000 4064000
+ 1016000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 6096000
+ 0 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 5080000 2032000
+ 5080000 6096000
+ 8128000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 4826000
+ 4064000 3302000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 5588000
+ 4064000 7112000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2540000
+ 4064000 1016000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 4064000
+ 0 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-enhancement.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-enhancement.wxd
new file mode 100644
index 0000000000..b7a8750b32
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-igfet-enhancement.wxd
@@ -0,0 +1,24 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 4064000 4064000
+ 1016000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 6096000
+ 0 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 5080000 2032000
+ 5080000 6096000
+ 8128000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 4826000
+ 4064000 3302000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 5588000
+ 4064000 7112000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 2540000
+ 4064000 1016000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-jfet.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-jfet.wxd
new file mode 100644
index 0000000000..342d3a755d
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/FET/p-jfet.wxd
@@ -0,0 +1,16 @@
+WXD 1 0
+0 0 0 4064000 0 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 1016000
+ 2032000 5080000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 4064000
+ 4064000 4064000
+ 4064000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 2540000 2032000
+ 508000 2032000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 4064000 0
+ 4064000 2032000
+ 2032000 2032000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/ANSI/l.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/ANSI/l.wxd
new file mode 100644
index 0000000000..5fc5c2c983
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/ANSI/l.wxd
@@ -0,0 +1,30 @@
+WXD 1 0
+0 0 0 16256000 0 4064000
+4 27 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 0 0
+ 2032000 0 0
+ 1270000 2032000 -1
+ 2032000 3556000 -1
+ 3556000 4064000 -1
+ 4826000 3556000 -1
+ 5588000 1778000 -1
+ 5080000 0 -1
+ 4572000 1778000 -1
+ 5334000 3556000 -1
+ 6604000 4064000 -1
+ 7874000 3556000 -1
+ 8636000 1778000 -1
+ 8128000 0 -1
+ 7620000 1778000 -1
+ 8382000 3556000 -1
+ 9652000 4064000 -1
+ 10922000 3556000 -1
+ 11684000 1778000 -1
+ 11176000 0 -1
+ 10668000 1778000 -1
+ 11430000 3556000 -1
+ 12700000 4064000 -1
+ 14224000 3556000 -1
+ 14986000 2032000 -1
+ 14224000 0 0
+ 16256000 0 0
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/l-coil.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/l-coil.wxd
new file mode 100644
index 0000000000..b06f89059c
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/l-coil.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 20320000 0 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 0
+ 2032000 0
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 0 4064000 2032000 6096000 0
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 6096000 0 8128000 2032000 10160000 0
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 10160000 0 12192000 2032000 14224000 0
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 14224000 0 16256000 2032000 18288000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 18288000 0
+ 20320000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 3048000
+ 18288000 3048000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/l.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/l.wxd
new file mode 100644
index 0000000000..7c348c932e
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/l.wxd
@@ -0,0 +1,16 @@
+WXD 1 0
+0 0 0 20320000 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 0
+ 2032000 0
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 0 4064000 2032000 6096000 0
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 6096000 0 8128000 2032000 10160000 0
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 10160000 0 12192000 2032000 14224000 0
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 14224000 0 16256000 2032000 18288000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 18288000 0
+ 20320000 0
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/old/l-coil.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/old/l-coil.wxd
new file mode 100644
index 0000000000..7abf0315a9
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/old/l-coil.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 12192000 0 5080000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 0 0 0 2 0 4 1
+ 2032000 10160000 0 4064000 0
+11 0 0 0 0 255 255 255 2 0 4 0
+ 10160000 12192000 2032000 2047875 0
+3 2 0 0 0 0 4 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 5080000
+ 10160000 5080000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/old/l.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/old/l.wxd
new file mode 100644
index 0000000000..5854258d6e
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/L/old/l.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 12192000 0 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 0 0 0 2 0 4 1
+ 2032000 10160000 0 4064000 0
+11 0 0 0 0 255 255 255 2 0 4 0
+ 10160000 12192000 2032000 2047875 0
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/OpAmp/old/opamp-old.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/OpAmp/old/opamp-old.wxd
new file mode 100644
index 0000000000..5e05dc1407
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/OpAmp/old/opamp-old.wxd
@@ -0,0 +1,27 @@
+WXD 1 0
+0 0 0 10160000 0 8128000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 2540000 6096000
+ 3556000 6096000
+1
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 2540000 2032000
+ 3556000 2032000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 3048000 2540000
+ 3048000 1524000
+-1
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 2032000 8128000
+ 2032000 0
+ 8128000 4064000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 8128000 4064000
+ 10160000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/OpAmp/opamp.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/OpAmp/opamp.wxd
new file mode 100644
index 0000000000..b3c56844f3
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/OpAmp/opamp.wxd
@@ -0,0 +1,29 @@
+WXD 1 0
+0 0 0 10160000 0 8128000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 1524000 8636000 0 8128000 0
+11 0 0 0 0 255 255 255 2 0 4 0
+ 0 1524000 2032000 2047875 0
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 0 4064000
+ 1524000 4064000
+6 3 0 0 0 0 255 255 255 2 0 4 1 8 0
+ 2540000 7112000
+ 2540000 5080000
+ 4572000 6096000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 2540000 4064000
+ 3556000 4064000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 2540000 2032000
+ 3556000 2032000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 3048000 2540000
+ 3048000 1524000
+9 0 0 0 0 255 255 255 2 0 4 0
+ 5715000 6096000 508000
+9 0 0 0 0 255 255 255 2 0 4 0
+ 6858000 6096000 635000
+3 2 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 8636000 2032000
+ 10160000 2032000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/ANSI/r-horiz.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/ANSI/r-horiz.wxd
new file mode 100644
index 0000000000..881aa8960d
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/ANSI/r-horiz.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 10160000 0 4064000
+3 10 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+ 2540000 4064000
+ 3556000 0
+ 4572000 4064000
+ 5588000 0
+ 6604000 4064000
+ 7620000 0
+ 8128000 2032000
+ 10160000 2032000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/ANSI/r.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/ANSI/r.wxd
new file mode 100644
index 0000000000..bb1e57ee8f
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/ANSI/r.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 4064000 0 10160000
+3 10 0 0 0 0 2 0 4 1 1 8 0 16 8 0 16 8
+ 2032000 0
+ 2032000 2032000
+ 0 2540000
+ 4064000 3556000
+ 0 4572000
+ 4064000 5588000
+ 0 6604000
+ 4064000 7620000
+ 2032000 8128000
+ 2032000 10160000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/r.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/r.wxd
new file mode 100644
index 0000000000..7a35a39b81
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/r.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 4064000 0 12192000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 0 4064000 2032000 10160000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 10160000
+ 2032000 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 2032000
+ 2032000 0
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-horiz.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-horiz.wxd
new file mode 100644
index 0000000000..009fb028ab
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-horiz.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 12192000 0 4064000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 10160000 0 4064000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 10160000 2032000
+ 12192000 2032000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-photo.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-photo.wxd
new file mode 100644
index 0000000000..999965e229
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-photo.wxd
@@ -0,0 +1,16 @@
+WXD 1 0
+0 0 0 12192000 0 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 10160000 0 4064000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 10160000 2032000
+ 12192000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 3 8 6
+ 6604000 4572000
+ 10668000 8636000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 3 8 6
+ 5080000 6096000
+ 9144000 10160000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-poti-horiz.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-poti-horiz.wxd
new file mode 100644
index 0000000000..05d5b7ca9f
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-poti-horiz.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 12192000 0 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 10160000 0 4064000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 10160000 2032000
+ 12192000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 3 6 4 0 16 8
+ 6096000 6096000
+ 6096000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-poti-trim-horiz.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-poti-trim-horiz.wxd
new file mode 100644
index 0000000000..6b80cd6110
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-poti-trim-horiz.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 2032000 4064000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 10160000 2032000 6096000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 10160000 4064000
+ 12192000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 3 6 4 0 16 8
+ 6096000 8128000
+ 6096000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 1016000
+ 10160000 7112000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 10541000 6604000
+ 9779000 7620000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-variable.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-variable.wxd
new file mode 100644
index 0000000000..9e708e2511
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/R/special/r-variable.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 2032000 4064000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 10160000 2032000 6096000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 10160000 4064000
+ 12192000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 3 8 6 0 16 8
+ 3048000 0
+ 9144000 8128000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/C/csrc-horiz.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/C/csrc-horiz.wxd
new file mode 100644
index 0000000000..8385d4e539
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/C/csrc-horiz.wxd
@@ -0,0 +1,17 @@
+WXD 1 0
+0 0 0 8128000 0 4064000
+9 0 0 0 0 255 255 255 2 0 4 0
+ 4064000 2032000 2032000
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 4064000 4064000
+ 4064000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 2032000
+ 0 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 2032000
+ 8128000 2032000
+6 3 0 0 0 0 0 0 0 2 0 4 0 8 1
+ 6096000 1524000
+ 6096000 2540000
+ 7112000 2032000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/C/csrc.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/C/csrc.wxd
new file mode 100644
index 0000000000..b234d4eff3
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/C/csrc.wxd
@@ -0,0 +1,17 @@
+WXD 1 0
+0 0 0 4064000 0 8128000
+9 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 4064000 2032000
+3 2 0 0 0 0 2 0 4 0 0 8 0 8 4 0 8 4
+ 0 4064000
+ 4064000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 6096000
+ 2032000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 2032000
+ 2032000 0
+6 3 0 0 0 0 0 0 0 2 0 4 0 8 1
+ 1524000 6096000
+ 2540000 6096000
+ 2032000 7112000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/GND/gnd.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/GND/gnd.wxd
new file mode 100644
index 0000000000..bec1f06d85
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/GND/gnd.wxd
@@ -0,0 +1,8 @@
+WXD 1 0
+0 0 0 4064000 0 2032000
+3 2 0 0 0 0 6 0 4 0 0 8 0 8 4 0 8 4
+ 0 0
+ 4064000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 0
+ 2032000 2032000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/ANSI/v.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/ANSI/v.wxd
new file mode 100644
index 0000000000..79eabfee55
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/ANSI/v.wxd
@@ -0,0 +1,20 @@
+WXD 1 0
+0 0 0 4064000 0 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 0
+ 2032000 2540000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 1016000 2540000
+ 3048000 2540000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 3556000
+ 4064000 3556000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 3556000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 1016000 4572000
+ 1016000 5588000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 508000 5080000
+ 1524000 5080000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/vsrc-horiz.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/vsrc-horiz.wxd
new file mode 100644
index 0000000000..6d5d18222b
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/vsrc-horiz.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 8128000 4064000
+9 0 0 0 0 255 255 255 2 0 4 0
+ 4064000 4064000 2032000
+3 2 0 0 0 0 2 0 4 0 0 8 3 8 4 0 8 4
+ 6096000 7112000
+ 2032000 7112000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/vsrc.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/vsrc.wxd
new file mode 100644
index 0000000000..17767e75e7
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Source/V/vsrc.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 4064000 0
+ 4064000 8128000
+9 0 0 0 0 255 255 255 2 0 4 0
+ 4064000 4064000 2032000
+3 2 0 0 0 0 2 0 4 0 0 8 3 8 4 0 8 4
+ 1016000 6096000
+ 1016000 2032000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/npn-discrete.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/npn-discrete.wxd
new file mode 100644
index 0000000000..0fafaa96ca
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/npn-discrete.wxd
@@ -0,0 +1,22 @@
+WXD 1 0
+0 0 0 6096000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 2032000
+ 3048000 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 3556000
+ 6096000 508000
+ 6096000 0
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 4572000
+ 6096000 7620000
+ 6096000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 4064000
+ 0 4064000
+9 0 0 0 0 255 255 255 2 0 4 0
+ 3556000 4064000 2590302
+6 3 0 0 0 0 0 0 0 2 0 4 1 8 1
+ 4445000 2159000
+ 4127500 3238500
+ 3365500 2476500
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/npn.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/npn.wxd
new file mode 100644
index 0000000000..4cb28def84
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/npn.wxd
@@ -0,0 +1,20 @@
+WXD 1 0
+0 0 0 6096000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 2032000
+ 3048000 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 3556000
+ 6096000 508000
+ 6096000 0
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 4572000
+ 6096000 7620000
+ 6096000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 4064000
+ 0 4064000
+6 3 0 0 0 0 0 0 0 2 0 4 1 8 1
+ 4445000 2159000
+ 4127500 3238500
+ 3365500 2476500
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/pnp-discrete.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/pnp-discrete.wxd
new file mode 100644
index 0000000000..1f0d404bb0
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/pnp-discrete.wxd
@@ -0,0 +1,22 @@
+WXD 1 0
+0 0 0 6096000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 2032000
+ 3048000 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 3556000
+ 6096000 508000
+ 6096000 0
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 4572000
+ 6096000 7620000
+ 6096000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 4064000
+ 0 4064000
+9 0 0 0 0 255 255 255 2 0 4 0
+ 3556000 4064000 2590302
+6 3 0 0 0 0 0 0 0 2 0 4 1 8 1
+ 3429000 3175000
+ 3746500 2095500
+ 4508500 2857500
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/pnp.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/pnp.wxd
new file mode 100644
index 0000000000..6795d99037
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Analog/Transistor/pnp.wxd
@@ -0,0 +1,20 @@
+WXD 1 0
+0 0 0 6096000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 2032000
+ 3048000 6096000
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 3556000
+ 6096000 508000
+ 6096000 0
+3 3 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 4572000
+ 6096000 7620000
+ 6096000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 3048000 4064000
+ 0 4064000
+6 3 0 0 0 0 0 0 0 2 0 4 1 8 1
+ 3429000 3175000
+ 3746500 2095500
+ 4508500 2857500
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and2.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and2.wxd
new file mode 100644
index 0000000000..f9e42ff8d4
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and2.wxd
@@ -0,0 +1,17 @@
+WXD 1 0
+0 0 0 10160000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+7 5 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 2032000 0 0
+ 2032000 8128000 0
+ 6096000 8128000 1
+ 8128000 4064000 -1
+ 6096000 0 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 8128000 4064000
+ 10160000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and3.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and3.wxd
new file mode 100644
index 0000000000..038d810bb8
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and3.wxd
@@ -0,0 +1,25 @@
+WXD 1 0
+0 0 0 12192000 0 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ -14224000 -10160000
+ -12192000 -10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 2032000 10160000
+7 7 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 2032000 0 0
+ 2032000 12192000 0
+ 4064000 12192000 1
+ 8128000 12192000 1
+ 10160000 6096000 -1
+ 8128000 0 1
+ 4064000 0 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 10160000 6096000
+ 12192000 6096000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and4.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and4.wxd
new file mode 100644
index 0000000000..4f79c9ca2b
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and4.wxd
@@ -0,0 +1,28 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ -14224000 -10160000
+ -12192000 -10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 2032000 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 14224000
+ 2032000 14224000
+7 7 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 2032000 0 0
+ 2032000 16256000 0
+ 4064000 16256000 1
+ 10160000 16256000 1
+ 12192000 8128000 -1
+ 10160000 0 1
+ 4064000 0 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 12192000 8128000
+ 16256000 8128000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and5.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and5.wxd
new file mode 100644
index 0000000000..fd4fade487
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/ANSI/and5.wxd
@@ -0,0 +1,31 @@
+WXD 1 0
+0 0 0 16256000 0 20320000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ -14224000 -10160000
+ -12192000 -10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 2032000 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 14224000
+ 2032000 14224000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 18288000
+ 2032000 18288000
+7 7 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 2032000 0 0
+ 2032000 20320000 0
+ 4064000 20320000 1
+ 12192000 20320000 1
+ 14224000 10160000 -1
+ 12192000 0 1
+ 4064000 0 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 14224000 10160000
+ 16256000 10160000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and2.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and2.wxd
new file mode 100644
index 0000000000..753f3bb5a2
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and2.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 4064000
+ 8128000 4064000
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \&
+ &
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and3.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and3.wxd
new file mode 100644
index 0000000000..4cee71293d
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and3.wxd
@@ -0,0 +1,21 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 4064000
+ 8128000 4064000
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \&
+ &
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and4.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and4.wxd
new file mode 100644
index 0000000000..fc8e5910b3
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and4.wxd
@@ -0,0 +1,24 @@
+WXD 1 0
+0 0 0 8128000 0 10160000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 10160000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 6096000
+ 8128000 6096000
+2 0 0 0 0
+ 0 12 1 1 4064000 6096000 0
+ \&
+ &
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 8128000
+ 2032000 8128000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and5.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and5.wxd
new file mode 100644
index 0000000000..a5d5d07870
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/AND/and5.wxd
@@ -0,0 +1,27 @@
+WXD 1 0
+0 0 0 8128000 0 12192000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 12192000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 6096000
+ 8128000 6096000
+2 0 0 0 0
+ 0 12 1 1 4064000 7112000 0
+ \&
+ &
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 8128000
+ 2032000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 10160000
+ 2032000 10160000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand2.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand2.wxd
new file mode 100644
index 0000000000..4e5f1a60f7
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand2.wxd
@@ -0,0 +1,20 @@
+WXD 1 0
+0 0 0 10160000 0 8128000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+7 5 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 2032000 0 0
+ 2032000 8128000 0
+ 6096000 8128000 1
+ 8128000 4064000 -1
+ 6096000 0 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 8128000 4064000
+ 10160000 4064000
+13 1 0 0 0
+ 8128000 4064000 16
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand3.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand3.wxd
new file mode 100644
index 0000000000..5aa1f9add6
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand3.wxd
@@ -0,0 +1,27 @@
+WXD 1 0
+0 0 0 12192000 0 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ -14224000 -10160000
+ -12192000 -10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 2032000 10160000
+7 7 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 2032000 0 0
+ 2032000 12192000 0
+ 4064000 12192000 1
+ 8128000 12192000 1
+ 10160000 6096000 -1
+ 8128000 0 1
+ 4064000 0 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 10160000 6096000
+ 12192000 6096000
+13 1 0 0 0
+ 10160000 6096000 16
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand4.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand4.wxd
new file mode 100644
index 0000000000..ca3d6e0161
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand4.wxd
@@ -0,0 +1,30 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ -14224000 -10160000
+ -12192000 -10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 2032000 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 14224000
+ 2032000 14224000
+7 7 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 2032000 0 0
+ 2032000 16256000 0
+ 4064000 16256000 1
+ 10160000 16256000 1
+ 12192000 8128000 -1
+ 10160000 0 1
+ 4064000 0 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 12192000 8128000
+ 16256000 8128000
+13 1 0 0 0
+ 12192000 8128000 16
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand5.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand5.wxd
new file mode 100644
index 0000000000..0dd51665b7
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/ANSI/nand5.wxd
@@ -0,0 +1,33 @@
+WXD 1 0
+0 0 0 16256000 0 20320000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ -14224000 -10160000
+ -12192000 -10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 2032000 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 14224000
+ 2032000 14224000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 18288000
+ 2032000 18288000
+7 7 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 2032000 0 0
+ 2032000 20320000 0
+ 4064000 20320000 1
+ 12192000 20320000 1
+ 14224000 10160000 -1
+ 12192000 0 1
+ 4064000 0 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 14224000 10160000
+ 16256000 10160000
+13 1 0 0 0
+ 14224000 10160000 16
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand2.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand2.wxd
new file mode 100644
index 0000000000..f42f93269b
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand2.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 4064000
+ 8128000 4064000
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \&
+ &
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 4064000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand3.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand3.wxd
new file mode 100644
index 0000000000..94a8c72365
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand3.wxd
@@ -0,0 +1,22 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 4064000
+ 8128000 4064000
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \&
+ &
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 4064000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand4.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand4.wxd
new file mode 100644
index 0000000000..5d24d0dd21
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand4.wxd
@@ -0,0 +1,26 @@
+WXD 1 0
+0 0 0 8128000 0 10160000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 10160000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 6096000
+ 8128000 6096000
+2 0 0 0 0
+ 0 12 1 1 4064000 6096000 0
+ \&
+ &
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 8128000
+ 2032000 8128000
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 6096000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand5.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand5.wxd
new file mode 100644
index 0000000000..2468f2f37f
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NAND/nand5.wxd
@@ -0,0 +1,28 @@
+WXD 1 0
+0 0 0 8128000 0 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 12192000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 6096000
+ 8128000 6096000
+2 0 0 0 0
+ 0 12 1 1 4064000 7112000 0
+ \&
+ &
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 8128000
+ 2032000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 10160000
+ 2032000 10160000
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 6096000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor2.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor2.wxd
new file mode 100644
index 0000000000..3b1f91e47c
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor2.wxd
@@ -0,0 +1,24 @@
+WXD 1 0
+0 0 0 10160000 0 8128000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 7112000 4064000
+ 10160000 4064000
+1
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 8128000 2032000 6096000 2286000 4064000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 8128000 5080000 6096000 7112000 4064000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 0 5080000 2032000 7112000 4064000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 0 2032000 2032000 2286000 4064000
+-1
+13 1 0 0 0
+ 7112000 4064000 16
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor3.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor3.wxd
new file mode 100644
index 0000000000..6e14b16cc4
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor3.wxd
@@ -0,0 +1,26 @@
+WXD 1 0
+0 0 0 16256000 0 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 3810000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 4826000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 3810000 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 12192000 6096000
+ 16256000 6096000
+1
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2540000 12192000 3556000 10668000 4826000 6096000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2540000 12192000 10160000 9144000 12192000 6096000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2540000 0 10160000 3048000 12192000 6096000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2540000 0 3556000 1524000 4826000 6096000
+-1
+13 1 0 0 0
+ 12192000 6096000 16
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor4.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor4.wxd
new file mode 100644
index 0000000000..9496aeeec4
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor4.wxd
@@ -0,0 +1,29 @@
+WXD 1 0
+0 0 0 20320000 0 16256000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 3048000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 4318000 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 14224000
+ 3048000 14224000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 4318000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 16256000 8128000
+ 20320000 8128000
+1
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 16256000 3048000 14224000 4572000 8128000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 0 3048000 2032000 4572000 8128000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 16256000 12192000 12192000 16256000 8128000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 0 12192000 4064000 16256000 8128000
+-1
+13 1 0 0 0
+ 16256000 8128000 16
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor5.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor5.wxd
new file mode 100644
index 0000000000..35783a6a38
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/ANSI/nor5.wxd
@@ -0,0 +1,30 @@
+WXD 1 0
+0 0 0 24384000 0 24384000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 4064000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 8128000
+ 5588000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 12192000
+ 6096000 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 16256000
+ 5588000 16256000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 20320000
+ 4064000 20320000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 24384000 4064000 20320000 6096000 12192000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 0 4064000 4064000 6096000 12192000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 24384000 14224000 18288000 18288000 12192000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 0 14224000 6096000 18288000 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 18288000 12192000
+ 24384000 12192000
+13 1 0 0 0
+ 18288000 12192000 16
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor2.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor2.wxd
new file mode 100644
index 0000000000..0298bf9093
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor2.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 4064000
+ 8128000 4064000
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \(\geq{}1\)
+ 1
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 4064000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor3.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor3.wxd
new file mode 100644
index 0000000000..bbc52360a1
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor3.wxd
@@ -0,0 +1,22 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 4064000
+ 8128000 4064000
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \(\geq{}1\)
+ 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 4064000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor4.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor4.wxd
new file mode 100644
index 0000000000..687d2773ae
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor4.wxd
@@ -0,0 +1,25 @@
+WXD 1 0
+0 0 0 8128000 0 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 10160000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 6096000
+ 8128000 6096000
+2 0 0 0 0
+ 0 12 1 1 4064000 6096000 0
+ \(\geq{}1\)
+ 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 8128000
+ 2032000 8128000
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 6096000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor5.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor5.wxd
new file mode 100644
index 0000000000..f966f243a4
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOR/nor5.wxd
@@ -0,0 +1,28 @@
+WXD 1 0
+0 0 0 8128000 0 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 12192000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 6096000
+ 8128000 6096000
+2 0 0 0 0
+ 0 12 1 1 4064000 7112000 0
+ \(\geq{}1\)
+ 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 8128000
+ 2032000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 10160000
+ 2032000 10160000
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 6096000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOT/ANSI/not.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOT/ANSI/not.wxd
new file mode 100644
index 0000000000..688e2ab61b
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOT/ANSI/not.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 8128000 0 4064000
+3 2 0 0 0 0 2 0 4 0 0 8 0 16 8 0 16 8
+ 0 2032000
+ 1524000 2032000
+6 3 0 0 0 0 255 255 255 2 0 4 0 8 0
+ 1524000 0
+ 1524000 4064000
+ 5588000 2032000
+3 2 0 0 0 0 2 0 4 0 0 8 0 16 8 0 16 8
+ 6604000 2032000
+ 8128000 2032000
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6096000 2032000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOT/not.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOT/not.wxd
new file mode 100644
index 0000000000..6e9443bca9
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/NOT/not.wxd
@@ -0,0 +1,16 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 0 0 8 0 16 8 0 16 8
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 0 0 8 0 16 8 0 16 8
+ 6096000 4064000
+ 8128000 4064000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \(1\)
+ 1
+9 1 0 0 0 255 255 255 2 0 4 1
+ 6604000 4064000 508000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or2.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or2.wxd
new file mode 100644
index 0000000000..82f56aea21
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or2.wxd
@@ -0,0 +1,21 @@
+WXD 1 0
+0 0 0 10160000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 2032000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 7112000 4064000
+ 10160000 4064000
+1
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 8128000 2032000 6096000 2286000 4064000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 8128000 5080000 6096000 7112000 4064000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 0 5080000 2032000 7112000 4064000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 0 2032000 2032000 2286000 4064000
+-1
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or3.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or3.wxd
new file mode 100644
index 0000000000..7348c2cc87
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or3.wxd
@@ -0,0 +1,24 @@
+WXD 1 0
+0 0 0 16256000 0 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 3810000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 4826000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 3810000 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 12192000 6096000
+ 16256000 6096000
+1
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2540000 12192000 3556000 10668000 4826000 6096000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2540000 12192000 10160000 9144000 12192000 6096000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2540000 0 10160000 3048000 12192000 6096000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2540000 0 3556000 1524000 4826000 6096000
+-1
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or4.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or4.wxd
new file mode 100644
index 0000000000..af46444b0a
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or4.wxd
@@ -0,0 +1,27 @@
+WXD 1 0
+0 0 0 20320000 0 16256000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 2032000
+ 3048000 2032000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 10160000
+ 4318000 10160000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 14224000
+ 3048000 14224000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 6096000
+ 4318000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 16256000 8128000
+ 20320000 8128000
+1
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 16256000 3048000 14224000 4572000 8128000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 0 3048000 2032000 4572000 8128000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 16256000 12192000 12192000 16256000 8128000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 2032000 0 12192000 4064000 16256000 8128000
+-1
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or5.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or5.wxd
new file mode 100644
index 0000000000..d9961bc1dd
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/ANSI/or5.wxd
@@ -0,0 +1,28 @@
+WXD 1 0
+0 0 0 24384000 0 24384000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 4064000
+ 4064000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 8128000
+ 5588000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 12192000
+ 6096000 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 16256000
+ 5588000 16256000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 0 20320000
+ 4064000 20320000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 24384000 4064000 20320000 6096000 12192000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 0 4064000 4064000 6096000 12192000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 24384000 14224000 18288000 18288000 12192000
+5 0 0 0 0 2 0 4 1 0 16 8 0 16 8
+ 1016000 0 14224000 6096000 18288000 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 16 8 0 16 8
+ 18288000 12192000
+ 24384000 12192000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or2.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or2.wxd
new file mode 100644
index 0000000000..9c1b434866
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or2.wxd
@@ -0,0 +1,17 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 4064000
+ 8128000 4064000
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \(\geq{}1\)
+ 1
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or3.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or3.wxd
new file mode 100644
index 0000000000..4f290ada94
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or3.wxd
@@ -0,0 +1,20 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 8128000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 4064000
+ 8128000 4064000
+2 0 0 0 0
+ 0 12 1 1 4064000 4064000 0
+ \(\geq{}1\)
+ 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or4.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or4.wxd
new file mode 100644
index 0000000000..5ecc715d0a
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or4.wxd
@@ -0,0 +1,24 @@
+WXD 1 0
+0 0 0 8128000 0 10160000
+0 2 2
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 10160000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 6096000
+ 8128000 6096000
+2 0 0 0 0
+ 0 12 1 1 4064000 6096000 0
+ \(\geq{}1\)
+ 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 8128000
+ 2032000 8128000
diff --git a/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or5.wxd b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or5.wxd
new file mode 100644
index 0000000000..28b5a30f6f
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/IN-4/Electronics/Digital/OR/or5.wxd
@@ -0,0 +1,26 @@
+WXD 1 0
+0 0 0 8128000 0 12192000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 6096000
+ 2032000 6096000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 2032000
+ 2032000 2032000
+11 0 0 0 0 255 255 255 2 0 4 0
+ 2032000 6096000 0 12192000 0
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 6096000 6096000
+ 8128000 6096000
+2 0 0 0 0
+ 0 12 1 1 4064000 7112000 0
+ \(\geq{}1\)
+ 1
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 2032000 4064000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 8128000
+ 2032000 8128000
+3 2 0 0 0 0 2 0 4 1 0 8 0 8 4 0 8 4
+ 0 10160000
+ 2032000 10160000
diff --git a/support/dktools/dktools/wxdkdraw/library/readme.txt b/support/dktools/dktools/wxdkdraw/library/readme.txt
new file mode 100644
index 0000000000..47c824dd11
--- /dev/null
+++ b/support/dktools/dktools/wxdkdraw/library/readme.txt
@@ -0,0 +1,9 @@
+This is the library directory for the wxdkdraw program.
+It may contain the following subdirectories for different
+unit and grid settings:
+
+IN-4 inches, 4 snap grid units per optical grid unit
+IN-5 inches, 5 snap grid units per optical grid unit
+CM-4 centimeters, 4 snap grid units per optical grid unit
+CM-5 centimeters, 5 snap grid units per optical grid unit
+
diff --git a/support/dktools/dkwt-ac.c b/support/dktools/dkwt-ac.c
index cf5c13f4b3..6d462f7236 100644
--- a/support/dktools/dkwt-ac.c
+++ b/support/dktools/dkwt-ac.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwt-ac.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwt-ac.ctr
*/
/** @file dkwt-ac.c The dkwt-ac module.
diff --git a/support/dktools/dkwt-ac.ctr b/support/dktools/dkwt-ac.ctr
index 710076e19e..6848dac082 100644
--- a/support/dktools/dkwt-ac.ctr
+++ b/support/dktools/dkwt-ac.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dkwt-cp.c b/support/dktools/dkwt-cp.c
index ea5e90fea5..9b2b77f588 100644
--- a/support/dktools/dkwt-cp.c
+++ b/support/dktools/dkwt-cp.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwt-cp.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwt-cp.ctr
*/
/** @file dkwt-cp.c The dkwt-cp module.
@@ -46,12 +24,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "dkt.h"
#include "dkwt.h"
+#include "dk3unused.h"
-#line 22 "dkwt-cp.ctr"
+#line 23 "dkwt-cp.ctr"
/** Buffer size to enumerate printers.
@@ -227,11 +206,12 @@ dkwt_cp_job_new(dk3_app_t *app, DWORD jobid, DWORD pos, dkChar const *dn)
*/
static
int
-dkwt_cp_job_comp(void const *l, void const *r, int cr)
+dkwt_cp_job_comp(void const *l, void const *r, int DK3_ARG_UNUSED(cr))
{
DKWT_CP_JOB const *jl;
DKWT_CP_JOB const *jr;
int back = 0;
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
jl = (DKWT_CP_JOB const *)l;
@@ -256,7 +236,6 @@ dkwt_cp_job_comp(void const *l, void const *r, int cr)
/** Remove all print jobs for one user from a single queue.
@param app Application structure for diagnostics.
@param msg Localized message texts.
- @param kwnl Keywords, not localized.
@param userName User name.
@param hostName Host name.
@param queue Queue to modify.
@@ -266,7 +245,6 @@ void
dkwt_cp_remove_all_jobs(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
dkChar const *userName,
dkChar const *hostName,
DKWT_CP_QUEUE *queue
@@ -276,7 +254,11 @@ dkwt_cp_remove_all_jobs(
dkChar idbuf[64];
dk3_sto_t *s_j; /* Jobs storage. */
dk3_sto_it_t *i_j; /* Iterator for jobs storage. */
- JOB_INFO_1 *ji1; /* Job information pointer. */
+#if DK3_CHAR_SIZE > 1
+ JOB_INFO_1W *ji1; /* Job information pointer. */
+#else
+ JOB_INFO_1A *ji1; /* Job information pointer. */
+#endif
DKWT_CP_JOB *job; /* Current job. */
HANDLE hPrinter; /* Handle for printer. */
DWORD szjeb; /* Size of jeb buffer. */
@@ -287,7 +269,7 @@ dkwt_cp_remove_all_jobs(
BOOL res; /* Operation result. */
-#line 256 "dkwt-cp.ctr"
+#line 260 "dkwt-cp.ctr"
s_j = NULL; i_j = NULL;
s_j = dk3sto_open_app(app);
if(s_j) {
@@ -319,30 +301,34 @@ dkwt_cp_remove_all_jobs(
#endif
if(res) {
-#line 286 "dkwt-cp.ctr"
+#line 290 "dkwt-cp.ctr"
if(nj > 0) {
-#line 287 "dkwt-cp.ctr"
- ji1 = (JOB_INFO_1 *)jeb;
+#line 291 "dkwt-cp.ctr"
+#if DK3_CHAR_SIZE > 1
+ ji1 = (JOB_INFO_1W *)jeb;
+#else
+ ji1 = (JOB_INFO_1A *)jeb;
+#endif
for(i = 0; i < nj; i++) {
rmj = 0;
if(ji1[i].pUserName) {
-#line 291 "dkwt-cp.ctr"
+#line 299 "dkwt-cp.ctr"
if(0 == dk3str_casecmp(ji1[i].pUserName, userName)) {
-#line 292 "dkwt-cp.ctr"
+#line 300 "dkwt-cp.ctr"
rmj = 1;
if(hostName) {
-#line 294 "dkwt-cp.ctr"
+#line 302 "dkwt-cp.ctr"
rmj = 0;
if(ji1[i].pMachineName) {
-#line 296 "dkwt-cp.ctr"
+#line 304 "dkwt-cp.ctr"
if(0 == dk3str_casecmp(ji1[i].pMachineName, hostName)) {
-#line 297 "dkwt-cp.ctr"
+#line 305 "dkwt-cp.ctr"
rmj = 1;
} else {
if(dkT('\\') == (ji1[i].pMachineName)[0]) {
@@ -355,42 +341,42 @@ dkwt_cp_remove_all_jobs(
}
} else {
-#line 308 "dkwt-cp.ctr"
+#line 316 "dkwt-cp.ctr"
rmj = 1;
}
} else {
-#line 311 "dkwt-cp.ctr"
+#line 319 "dkwt-cp.ctr"
}
} else {
-#line 313 "dkwt-cp.ctr"
+#line 321 "dkwt-cp.ctr"
}
}
if(rmj) {
-#line 316 "dkwt-cp.ctr"
+#line 324 "dkwt-cp.ctr"
job = dkwt_cp_job_new(app, ji1[i].JobId, ji1[i].Position, ji1[i].pDocument);
if(job) {
if(!dk3sto_add(s_j, (void *)job)) {
-#line 319 "dkwt-cp.ctr"
+#line 327 "dkwt-cp.ctr"
dkwt_cp_job_del(job);
} else {
}
} else {
-#line 323 "dkwt-cp.ctr"
+#line 331 "dkwt-cp.ctr"
}
}
}
} else {
-#line 327 "dkwt-cp.ctr"
+#line 335 "dkwt-cp.ctr"
}
} else {
-#line 329 "dkwt-cp.ctr"
+#line 337 "dkwt-cp.ctr"
}
/* Delete saved print jobs if any.
*/
@@ -398,7 +384,7 @@ dkwt_cp_remove_all_jobs(
while(NULL != (job = (DKWT_CP_JOB *)dk3sto_it_next(i_j))) {
-#line 335 "dkwt-cp.ctr"
+#line 343 "dkwt-cp.ctr"
#if VERSION_20140716
dk3sf_sprintf3(idbuf, dkT("%lu"), (unsigned long)(job->jobId));
#else
@@ -409,14 +395,14 @@ dkwt_cp_remove_all_jobs(
if(SetJob(hPrinter, job->jobId, 0, NULL, JOB_CONTROL_DELETE)) {
/* PROGRESS: Print job deleted. */
-#line 344 "dkwt-cp.ctr"
+#line 352 "dkwt-cp.ctr"
dk3app_log_5(
app, DK3_LL_PROGRESS, msg, 85, 86, 87, idbuf,
((job->docName) ? (job->docName) : msg[88])
);
} else {
-#line 349 "dkwt-cp.ctr"
+#line 357 "dkwt-cp.ctr"
/* ERROR: Failed to delete print job! */
dk3app_log_5(
app, DK3_LL_ERROR, msg, 89, 90, 91, idbuf,
@@ -427,13 +413,13 @@ dkwt_cp_remove_all_jobs(
ClosePrinter(hPrinter);
} else {
-#line 358 "dkwt-cp.ctr"
+#line 366 "dkwt-cp.ctr"
/* ERROR: Failed to open printer! */
dk3app_log_3(app, DK3_LL_ERROR, msg, 92, 93, queue->qn);
}
} else {
-#line 362 "dkwt-cp.ctr"
+#line 370 "dkwt-cp.ctr"
}
/* Release memory.
*/
@@ -448,7 +434,7 @@ dkwt_cp_remove_all_jobs(
dk3sto_close(s_j);
}
-#line 375 "dkwt-cp.ctr"
+#line 383 "dkwt-cp.ctr"
}
@@ -457,7 +443,7 @@ void
dkwt_clear_printers_local(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
+ dkChar const * const * DK3_ARG_UNUSED(kwnl),
dkChar const *userName
)
{
@@ -466,13 +452,18 @@ dkwt_clear_printers_local(
dk3_sto_t *s_q; /* Storage for print queues. */
dk3_sto_it_t *i_q; /* Iterator for print queues storage. */
DKWT_CP_QUEUE *q; /* Current queue to process. */
- PRINTER_INFO_4 *pi4; /* Printer information array. */
+#if DK3_CHAR_SIZE > 1
+ PRINTER_INFO_4W *pi4; /* Printer information array. */
+#else
+ PRINTER_INFO_4A *pi4; /* Printer information array. */
+#endif
DWORD szpeb; /* Size of peb buffer. */
DWORD bneed; /* Needed bytes. */
DWORD np; /* Number of printers found. */
DWORD i; /* Index of current printer. */
DWORD szhn; /* Size of host name. */
BOOL res; /* Result from printer enumeration. */
+ DK3_UNUSED_ARG(kwnl)
s_q = NULL; i_q = NULL;
if(userName) {
hn[0] = dkT('\0');
@@ -520,7 +511,11 @@ dkwt_clear_printers_local(
);
#endif
if(res) {
- pi4 = (PRINTER_INFO_4 *)peb;
+#if DK3_CHAR_SIZE > 1
+ pi4 = (PRINTER_INFO_4W *)peb;
+#else
+ pi4 = (PRINTER_INFO_4A *)peb;
+#endif
if(np > 0) {
for(i = 0; i < np; i++) {
if(pi4[i].pPrinterName) {
@@ -541,7 +536,7 @@ dkwt_clear_printers_local(
*/
dk3sto_it_reset(i_q);
while(NULL != (q = (DKWT_CP_QUEUE *)dk3sto_it_next(i_q))) {
- dkwt_cp_remove_all_jobs(app, msg, kwnl, userName, ((szhn > 0) ? hn : NULL), q);
+ dkwt_cp_remove_all_jobs(app,msg,userName,((szhn > 0) ? hn : NULL),q);
}
}
/* Release memory.
@@ -567,7 +562,6 @@ dkwt_clear_printers_local(
/** Send request to host.
@param app Application structure.
@param msg Localized message texts.
- @param kwnl Keywords, not localized.
@param rq Request to send.
@param hn Host name to send the request to.
*/
@@ -576,7 +570,6 @@ void
dkwt_cp_send_request(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
char const *rq,
dkChar const *hn
)
@@ -641,7 +634,7 @@ dkwt_cp_send_request(
if(0 == res) {
lgt = strlen(rq);
res = send(sock, rq, (int)lgt, 0);
- if(res == lgt) {
+ if(res == (int)lgt) {
shutdown(sock, SD_SEND);
cc = 1;
while(cc) {
@@ -693,7 +686,6 @@ dkwt_cp_send_request(
/** Clean up one remote print queue.
@param app Application structure.
@param msg Localized message texts.
- @param kwnl Keywords, not localized.
@param userName User name.
@param queueName Print queue name.
*/
@@ -702,7 +694,6 @@ void
dkwt_clear_one_remote_queue(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
dkChar const *userName,
dkChar const *queueName
)
@@ -728,10 +719,14 @@ dkwt_clear_one_remote_queue(
if(dk3str_to_c8u_app(unc, sizeof(unc), userName, ie, app)) {
sz = strlen(qnc) + strlen(unc) + 8;
if(sz < sizeof(rqc)) {
+#if DK3_HAVE_SNPRINTF
+ snprintf(rqc, sizeof(rqc), "%c%s %s all\n", 0x05, qnc, unc);
+#else
sprintf(rqc, "%c%s %s all\n", 0x05, qnc, unc);
+#endif
/* PROGRESS: Cleaning up remote print queue ... */
dk3app_log_3(app, DK3_LL_PROGRESS, msg, 101, 102, queueName);
- dkwt_cp_send_request(app, msg, kwnl, rqc, p1);
+ dkwt_cp_send_request(app, msg, rqc, p1);
} else {
/* ERROR: Reqeust becomes too long! */
dk3app_log_1(app, DK3_LL_ERROR, msg, 103);
@@ -766,7 +761,7 @@ void
dkwt_clear_printers_remote(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
+ dkChar const * const * DK3_ARG_UNUSED(kwnl),
dkChar const *userName,
dk3_sto_it_t *iterator
)
@@ -774,11 +769,12 @@ dkwt_clear_printers_remote(
WORD vrq;
WSADATA wsa;
dkChar const *qn;
+ DK3_UNUSED_ARG(kwnl)
vrq = MAKEWORD(2,0);
if(0 == WSAStartup(vrq, &wsa)) {
dk3sto_it_reset(iterator);
while(NULL != (qn = (dkChar const *)dk3sto_it_next(iterator))) {
- dkwt_clear_one_remote_queue(app, msg, kwnl, userName, qn);
+ dkwt_clear_one_remote_queue(app, msg, userName, qn);
}
(void)WSACleanup();
} else {
diff --git a/support/dktools/dkwt-cp.ctr b/support/dktools/dkwt-cp.ctr
index ed1c92f196..51d38380b5 100644
--- a/support/dktools/dkwt-cp.ctr
+++ b/support/dktools/dkwt-cp.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -15,6 +15,7 @@ license = bsd
#include "dk3all.h"
#include "dkt.h"
#include "dkwt.h"
+#include "dk3unused.h"
@@ -194,11 +195,12 @@ dkwt_cp_job_new(dk3_app_t *app, DWORD jobid, DWORD pos, dkChar const *dn)
*/
static
int
-dkwt_cp_job_comp(void const *l, void const *r, int cr)
+dkwt_cp_job_comp(void const *l, void const *r, int DK3_ARG_UNUSED(cr))
{
DKWT_CP_JOB const *jl;
DKWT_CP_JOB const *jr;
int back = 0;
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
jl = (DKWT_CP_JOB const *)l;
@@ -223,7 +225,6 @@ dkwt_cp_job_comp(void const *l, void const *r, int cr)
/** Remove all print jobs for one user from a single queue.
@param app Application structure for diagnostics.
@param msg Localized message texts.
- @param kwnl Keywords, not localized.
@param userName User name.
@param hostName Host name.
@param queue Queue to modify.
@@ -233,7 +234,6 @@ void
dkwt_cp_remove_all_jobs(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
dkChar const *userName,
dkChar const *hostName,
DKWT_CP_QUEUE *queue
@@ -243,7 +243,11 @@ dkwt_cp_remove_all_jobs(
dkChar idbuf[64];
dk3_sto_t *s_j; /* Jobs storage. */
dk3_sto_it_t *i_j; /* Iterator for jobs storage. */
- JOB_INFO_1 *ji1; /* Job information pointer. */
+#if DK3_CHAR_SIZE > 1
+ JOB_INFO_1W *ji1; /* Job information pointer. */
+#else
+ JOB_INFO_1A *ji1; /* Job information pointer. */
+#endif
DKWT_CP_JOB *job; /* Current job. */
HANDLE hPrinter; /* Handle for printer. */
DWORD szjeb; /* Size of jeb buffer. */
@@ -284,7 +288,11 @@ dkwt_cp_remove_all_jobs(
#endif
if(res) { $? ". EnumJobs"
if(nj > 0) { $? ". nj=%d", (int)nj
- ji1 = (JOB_INFO_1 *)jeb;
+#if DK3_CHAR_SIZE > 1
+ ji1 = (JOB_INFO_1W *)jeb;
+#else
+ ji1 = (JOB_INFO_1A *)jeb;
+#endif
for(i = 0; i < nj; i++) {
rmj = 0;
if(ji1[i].pUserName) { $? ". job user \"%!ds\" / user \"%!ds\"", ji1[i].pUserName, userName
@@ -380,7 +388,7 @@ void
dkwt_clear_printers_local(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
+ dkChar const * const * DK3_ARG_UNUSED(kwnl),
dkChar const *userName
)
{
@@ -389,13 +397,18 @@ dkwt_clear_printers_local(
dk3_sto_t *s_q; /* Storage for print queues. */
dk3_sto_it_t *i_q; /* Iterator for print queues storage. */
DKWT_CP_QUEUE *q; /* Current queue to process. */
- PRINTER_INFO_4 *pi4; /* Printer information array. */
+#if DK3_CHAR_SIZE > 1
+ PRINTER_INFO_4W *pi4; /* Printer information array. */
+#else
+ PRINTER_INFO_4A *pi4; /* Printer information array. */
+#endif
DWORD szpeb; /* Size of peb buffer. */
DWORD bneed; /* Needed bytes. */
DWORD np; /* Number of printers found. */
DWORD i; /* Index of current printer. */
DWORD szhn; /* Size of host name. */
BOOL res; /* Result from printer enumeration. */
+ DK3_UNUSED_ARG(kwnl)
s_q = NULL; i_q = NULL;
if(userName) {
hn[0] = dkT('\0');
@@ -443,7 +456,11 @@ dkwt_clear_printers_local(
);
#endif
if(res) {
- pi4 = (PRINTER_INFO_4 *)peb;
+#if DK3_CHAR_SIZE > 1
+ pi4 = (PRINTER_INFO_4W *)peb;
+#else
+ pi4 = (PRINTER_INFO_4A *)peb;
+#endif
if(np > 0) {
for(i = 0; i < np; i++) {
if(pi4[i].pPrinterName) {
@@ -464,7 +481,7 @@ dkwt_clear_printers_local(
*/
dk3sto_it_reset(i_q);
while(NULL != (q = (DKWT_CP_QUEUE *)dk3sto_it_next(i_q))) {
- dkwt_cp_remove_all_jobs(app, msg, kwnl, userName, ((szhn > 0) ? hn : NULL), q);
+ dkwt_cp_remove_all_jobs(app,msg,userName,((szhn > 0) ? hn : NULL),q);
}
}
/* Release memory.
@@ -490,7 +507,6 @@ dkwt_clear_printers_local(
/** Send request to host.
@param app Application structure.
@param msg Localized message texts.
- @param kwnl Keywords, not localized.
@param rq Request to send.
@param hn Host name to send the request to.
*/
@@ -499,7 +515,6 @@ void
dkwt_cp_send_request(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
char const *rq,
dkChar const *hn
)
@@ -564,7 +579,7 @@ dkwt_cp_send_request(
if(0 == res) {
lgt = strlen(rq);
res = send(sock, rq, (int)lgt, 0);
- if(res == lgt) {
+ if(res == (int)lgt) {
shutdown(sock, SD_SEND);
cc = 1;
while(cc) {
@@ -616,7 +631,6 @@ dkwt_cp_send_request(
/** Clean up one remote print queue.
@param app Application structure.
@param msg Localized message texts.
- @param kwnl Keywords, not localized.
@param userName User name.
@param queueName Print queue name.
*/
@@ -625,7 +639,6 @@ void
dkwt_clear_one_remote_queue(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
dkChar const *userName,
dkChar const *queueName
)
@@ -651,10 +664,14 @@ dkwt_clear_one_remote_queue(
if(dk3str_to_c8u_app(unc, sizeof(unc), userName, ie, app)) {
sz = strlen(qnc) + strlen(unc) + 8;
if(sz < sizeof(rqc)) {
+#if DK3_HAVE_SNPRINTF
+ snprintf(rqc, sizeof(rqc), "%c%s %s all\n", 0x05, qnc, unc);
+#else
sprintf(rqc, "%c%s %s all\n", 0x05, qnc, unc);
+#endif
/* PROGRESS: Cleaning up remote print queue ... */
dk3app_log_3(app, DK3_LL_PROGRESS, msg, 101, 102, queueName);
- dkwt_cp_send_request(app, msg, kwnl, rqc, p1);
+ dkwt_cp_send_request(app, msg, rqc, p1);
} else {
/* ERROR: Reqeust becomes too long! */
dk3app_log_1(app, DK3_LL_ERROR, msg, 103);
@@ -689,7 +706,7 @@ void
dkwt_clear_printers_remote(
dk3_app_t *app,
dkChar const * const *msg,
- dkChar const * const *kwnl,
+ dkChar const * const * DK3_ARG_UNUSED(kwnl),
dkChar const *userName,
dk3_sto_it_t *iterator
)
@@ -697,11 +714,12 @@ dkwt_clear_printers_remote(
WORD vrq;
WSADATA wsa;
dkChar const *qn;
+ DK3_UNUSED_ARG(kwnl)
vrq = MAKEWORD(2,0);
if(0 == WSAStartup(vrq, &wsa)) {
dk3sto_it_reset(iterator);
while(NULL != (qn = (dkChar const *)dk3sto_it_next(iterator))) {
- dkwt_clear_one_remote_queue(app, msg, kwnl, userName, qn);
+ dkwt_clear_one_remote_queue(app, msg, userName, qn);
}
(void)WSACleanup();
} else {
diff --git a/support/dktools/dkwt-env.c b/support/dktools/dkwt-env.c
index caf0425177..9e0f058f21 100644
--- a/support/dktools/dkwt-env.c
+++ b/support/dktools/dkwt-env.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwt-env.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwt-env.ctr
*/
/** @file dkwt-env.c The dkwt-env module.
@@ -115,10 +93,13 @@ dkT("Environment"),
/* 3 */
dkT(";"),
+/* 4 */
+dkT("Environment"),
+
NULL
-#line 91 "dkwt-env.ctr"
+#line 98 "dkwt-env.ctr"
};
@@ -255,7 +236,7 @@ dkwt_env_process_args(DKWT_ENV_J *j)
if (!(j->name)) {
j->cmd = DKWT_ENV_CMD_ERROR; back = 0;
-#line 226 "dkwt-env.ctr"
+#line 233 "dkwt-env.ctr"
}
}
}
@@ -524,10 +505,17 @@ dkwt_env_do_processing(DKWT_ENV_J *j)
}
dk3_delete(b1);
if (fmod) {
- SendMessageTimeout(
- HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment",
+#if 1 < DK3_CHAR_SIZE
+ SendMessageTimeoutW(
+ HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)(dkwt_env_kw[4]),
+ SMTO_ABORTIFHUNG, 5000, &dwrv
+ );
+#else
+ SendMessageTimeoutA(
+ HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)(dkwt_env_kw[4]),
SMTO_ABORTIFHUNG, 5000, &dwrv
);
+#endif
}
} else {
j->exv = DKT_RESULT_ERR_UNSPECIFIC;
@@ -613,7 +601,7 @@ dkwt_env(
int back = DKT_RESULT_ERR_UNSPECIFIC;
-#line 582 "dkwt-env.ctr"
+#line 596 "dkwt-env.ctr"
dkwt_env_job_init(&job);
job.app = app; job.msg = msg; job.kwnl = kwnl;
if (dkwt_env_process_args(&job)) {
@@ -627,7 +615,7 @@ dkwt_env(
dkwt_env_job_cleanup(&job);
-#line 594 "dkwt-env.ctr"
+#line 608 "dkwt-env.ctr"
return back;
}
diff --git a/support/dktools/dkwt-env.ctr b/support/dktools/dkwt-env.ctr
index bc08b2782b..42ea4daddf 100644
--- a/support/dktools/dkwt-env.ctr
+++ b/support/dktools/dkwt-env.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -87,6 +87,13 @@ Environment
# 3 Separator
#
;
+#
+# 4 Environment
+#
+Environment
+#
+#
+#
$!end
};
@@ -491,10 +498,17 @@ dkwt_env_do_processing(DKWT_ENV_J *j)
}
dk3_delete(b1);
if (fmod) {
- SendMessageTimeout(
- HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment",
+#if 1 < DK3_CHAR_SIZE
+ SendMessageTimeoutW(
+ HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)(dkwt_env_kw[4]),
+ SMTO_ABORTIFHUNG, 5000, &dwrv
+ );
+#else
+ SendMessageTimeoutA(
+ HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)(dkwt_env_kw[4]),
SMTO_ABORTIFHUNG, 5000, &dwrv
);
+#endif
}
} else {
j->exv = DKT_RESULT_ERR_UNSPECIFIC;
diff --git a/support/dktools/dkwt-ev.c b/support/dktools/dkwt-ev.c
index ec6e6c72d3..8746725847 100644
--- a/support/dktools/dkwt-ev.c
+++ b/support/dktools/dkwt-ev.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwt-ev.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwt-ev.ctr
*/
/** @file dkwt-ev.c The dkwt-ev module.
@@ -42,12 +20,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "dkt.h"
#include "dkwt.h"
+#include "dk3unused.h"
-#line 18 "dkwt-ev.ctr"
+#line 19 "dkwt-ev.ctr"
@@ -111,7 +90,7 @@ dkT("public"),
NULL
-#line 77 "dkwt-ev.ctr"
+#line 78 "dkwt-ev.ctr"
};
@@ -131,7 +110,7 @@ dkT("print-jobs"),
NULL
-#line 92 "dkwt-ev.ctr"
+#line 93 "dkwt-ev.ctr"
};
@@ -148,7 +127,7 @@ dkT("Administrator"),
NULL
-#line 107 "dkwt-ev.ctr"
+#line 108 "dkwt-ev.ctr"
};
@@ -172,8 +151,6 @@ static dkChar const dkwt_pq_name_local[] = { dkT("local") };
/** Retrieve value of keep flag.
- @param app Application structure.
- @param msg Localized message texts.
@param kwnl Keywords, not localized.
@param reset Reset the flag.
@return Flag value (before reset).
@@ -181,32 +158,42 @@ static dkChar const dkwt_pq_name_local[] = { dkT("local") };
static
int
dkwt_ev_get_keep_value(
- dk3_app_t *app,
- dkChar const * const *msg,
dkChar const * const *kwnl,
int reset
)
{
long result;
+#if VERSION_BEFORE_2019_10_20
DWORD dw0;
+#endif
DWORD dwType;
DWORD dwValue;
DWORD dwSz;
int back = 0;
HKEY hk;
+#if VERSION_BEFORE_2019_10_20
REGSAM regsam;
+#endif
-#line 155 "dkwt-ev.ctr"
+#line 156 "dkwt-ev.ctr"
+#if VERSION_BEFORE_2019_10_20
dw0 = (DWORD)0;
+#endif
dwType = REG_DWORD;
dwValue = 0;
dwSz = sizeof(DWORD);
+#if VERSION_BEFORE_2019_10_20
+ /*
+ KEY_QUERY_VALUE is always used in the
+ dkwt_tool_reg_open_key() function call below.
+ */
regsam = KEY_QUERY_VALUE;
if(reset) {
regsam = (KEY_READ | KEY_WRITE);
}
+#endif
result = dkwt_tool_reg_open_key(
HKEY_LOCAL_MACHINE, kwnl[15], KEY_QUERY_VALUE, &hk
);
@@ -230,7 +217,7 @@ dkwt_ev_get_keep_value(
}
-#line 185 "dkwt-ev.ctr"
+#line 194 "dkwt-ev.ctr"
return back;
}
@@ -244,11 +231,12 @@ dkwt_ev_get_keep_value(
*/
static
int
-dkwt_ev_compare_string(void const *l, void const *r, int cr)
+dkwt_ev_compare_string(void const *l, void const *r, int DK3_ARG_UNUSED(cr))
{
dkChar const *pl;
dkChar const *pr;
int back = 0;
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dkChar const *)l; pr = (dkChar const *)r;
@@ -275,7 +263,7 @@ static
void
dkwt_ev_job_init(DKWT_EV_J *j)
{
-#if (_MSC_VER < 1800) || DK4_WINDOWS_LEGACY
+#if (!(_WIN32)) || (!(defined(_WIN32_WINNT))) || (_WIN32_WINNT < 0x0603)
OSVERSIONINFO ovi;
#endif
@@ -295,7 +283,7 @@ dkwt_ev_job_init(DKWT_EV_J *j)
j->s_queues = NULL;
j->i_queues = NULL;
j->clrProfiles = 0;
-#if (_MSC_VER < 1800) || DK4_WINDOWS_LEGACY
+#if (!(_WIN32)) || (!(defined(_WIN32_WINNT))) || (_WIN32_WINNT < 0x0603)
ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
ovi.dwMajorVersion = 0L;
ovi.dwMinorVersion = 0L;
@@ -305,13 +293,13 @@ dkwt_ev_job_init(DKWT_EV_J *j)
if(ovi.dwMajorVersion > 5) {
j->useIcacls = 1;
-#line 258 "dkwt-ev.ctr"
+#line 268 "dkwt-ev.ctr"
} else {
if(ovi.dwMajorVersion == 5) {
if(ovi.dwMinorVersion > 1) {
j->useIcacls = 1;
-#line 262 "dkwt-ev.ctr"
+#line 272 "dkwt-ev.ctr"
}
}
}
@@ -402,7 +390,7 @@ dkwt_ev_line_handler(void *obj, dkChar *il)
int back = 1;
-#line 351 "dkwt-ev.ctr"
+#line 361 "dkwt-ev.ctr"
j = (DKWT_EV_J *)obj;
p1 = dk3str_start(il, NULL);
if(p1) {
@@ -568,50 +556,50 @@ dkwt_ev_line_handler(void *obj, dkChar *il)
} break;
case DKWT_EV_SECTION_PROFILES: {
-#line 515 "dkwt-ev.ctr"
+#line 525 "dkwt-ev.ctr"
dk3str_normalize(p1, NULL, dkT(' '));
p2 = dk3str_dup_app(p1, j->app);
if(p2) {
if(dk3sto_add(j->s_users, (void *)p2)) {
back = 1;
-#line 520 "dkwt-ev.ctr"
+#line 530 "dkwt-ev.ctr"
} else {
-#line 521 "dkwt-ev.ctr"
+#line 531 "dkwt-ev.ctr"
dk3_release(p2);
back = -1;
j->exval = DKT_RESULT_ERR_MEMORY;
}
} else {
-#line 526 "dkwt-ev.ctr"
+#line 536 "dkwt-ev.ctr"
back = -1;
j->exval = DKT_RESULT_ERR_MEMORY;
}
} break;
case DKWT_EV_SECTION_PUBLIC: {
-#line 531 "dkwt-ev.ctr"
+#line 541 "dkwt-ev.ctr"
dk3str_normalize(p1, NULL, dkT(' '));
p2 = dk3str_dup_app(p1, j->app);
if(p2) {
-#line 534 "dkwt-ev.ctr"
+#line 544 "dkwt-ev.ctr"
if(dk3sto_add(j->s_pubdir, (void *)p2)) {
back = 1;
-#line 536 "dkwt-ev.ctr"
+#line 546 "dkwt-ev.ctr"
} else {
-#line 537 "dkwt-ev.ctr"
+#line 547 "dkwt-ev.ctr"
dk3_release(p2);
back = -1;
j->exval = DKT_RESULT_ERR_MEMORY;
}
} else {
-#line 542 "dkwt-ev.ctr"
+#line 552 "dkwt-ev.ctr"
back = -1;
j->exval = DKT_RESULT_ERR_MEMORY;
}
@@ -629,7 +617,7 @@ dkwt_ev_line_handler(void *obj, dkChar *il)
/* Empty line ok. */
}
-#line 558 "dkwt-ev.ctr"
+#line 568 "dkwt-ev.ctr"
return back;
}
@@ -680,7 +668,7 @@ dkwt_ev_remove_directory(DKWT_EV_J *j, dkChar const *dn, int dolog)
size_t sz;
-#line 607 "dkwt-ev.ctr"
+#line 617 "dkwt-ev.ctr"
/* PROGRESS: Remove directory ... */
dk3app_log_3(j->app, DK3_LL_PROGRESS, j->msg, 120, 121, dn);
if(!(j->testOnly)) {
@@ -699,7 +687,7 @@ dkwt_ev_remove_directory(DKWT_EV_J *j, dkChar const *dn, int dolog)
dkwt_ev_execute_command(j, bu);
} else {
-#line 624 "dkwt-ev.ctr"
+#line 634 "dkwt-ev.ctr"
/* ERROR: File name too long! */
dk3app_log_i3(j->app, DK3_LL_ERROR, 59, 60, dn);
j->exval = DKT_RESULT_ERR_FILENAME;
@@ -708,7 +696,7 @@ dkwt_ev_remove_directory(DKWT_EV_J *j, dkChar const *dn, int dolog)
}
-#line 631 "dkwt-ev.ctr"
+#line 641 "dkwt-ev.ctr"
}
@@ -762,7 +750,7 @@ dkwt_ev_must_keep(DKWT_EV_J *j, dkChar const *un)
int back = 0;
-#line 683 "dkwt-ev.ctr"
+#line 693 "dkwt-ev.ctr"
if(j->userName) {
if(dk3str_casecmp(j->userName, un) == 0) {
back = 1;
@@ -779,7 +767,7 @@ dkwt_ev_must_keep(DKWT_EV_J *j, dkChar const *un)
}
}
-#line 698 "dkwt-ev.ctr"
+#line 708 "dkwt-ev.ctr"
return back;
}
@@ -801,27 +789,27 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
int must_delete = 1;
-#line 718 "dkwt-ev.ctr"
+#line 728 "dkwt-ev.ctr"
if(j->profBase) {
if(j->clrProfiles != 0) {
dir = dk3dir_open_app(j->profBase, j->app);
if(dir) {
-#line 722 "dkwt-ev.ctr"
+#line 732 "dkwt-ev.ctr"
while(dk3dir_get_next_directory(dir)) {
en = dk3dir_get_fullname(dir);
es = dk3dir_get_shortname(dir);
if((en) && (es)) {
-#line 726 "dkwt-ev.ctr"
+#line 736 "dkwt-ev.ctr"
must_delete = 1;
if(dkwt_ev_must_keep(j, es)) {
must_delete = 0;
-#line 729 "dkwt-ev.ctr"
+#line 739 "dkwt-ev.ctr"
} else {
-#line 730 "dkwt-ev.ctr"
+#line 740 "dkwt-ev.ctr"
if(dk3str_len(es) < DK3_SIZEOF(bu1,dkChar)) {
dk3str_cpy_not_overlapped(bu1, es);
ptr = dk3str_chr(bu1, dkT('.'));
@@ -830,26 +818,26 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
if(dkwt_ev_must_keep(j, bu1)) {
must_delete = 0;
-#line 737 "dkwt-ev.ctr"
+#line 747 "dkwt-ev.ctr"
} else {
-#line 738 "dkwt-ev.ctr"
+#line 748 "dkwt-ev.ctr"
}
} else {
-#line 740 "dkwt-ev.ctr"
+#line 750 "dkwt-ev.ctr"
}
} else {
-#line 742 "dkwt-ev.ctr"
+#line 752 "dkwt-ev.ctr"
must_delete = 0;
}
}
-#line 745 "dkwt-ev.ctr"
+#line 755 "dkwt-ev.ctr"
if(must_delete) {
-#line 746 "dkwt-ev.ctr"
+#line 756 "dkwt-ev.ctr"
dkwt_ev_remove_directory(j, en, 0);
}
}
@@ -861,7 +849,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
}
-#line 756 "dkwt-ev.ctr"
+#line 766 "dkwt-ev.ctr"
}
#else
@@ -976,7 +964,7 @@ dkwt_ev_del_rk_profile(DKWT_EV_J *j, dkChar const *kn)
long res;
-#line 869 "dkwt-ev.ctr"
+#line 879 "dkwt-ev.ctr"
/*
Log message
*/
@@ -994,16 +982,16 @@ dkwt_ev_del_rk_profile(DKWT_EV_J *j, dkChar const *kn)
);
if(ERROR_SUCCESS == res) {
-#line 885 "dkwt-ev.ctr"
+#line 895 "dkwt-ev.ctr"
res = dkwt_tool_reg_delete_tree(hk, kn);
if(ERROR_SUCCESS == res) {
-#line 887 "dkwt-ev.ctr"
+#line 897 "dkwt-ev.ctr"
/* DEBUG: Registry key ... deleted. */
dk3app_log_3(j->app, DK3_LL_DEBUG, j->msg, 127, 128, kn);
} else {
-#line 890 "dkwt-ev.ctr"
+#line 900 "dkwt-ev.ctr"
/* ERROR: Failed to remove registry hierarchy ... */
dk3app_log_5(
j->app, DK3_LL_ERROR, j->msg,
@@ -1013,14 +1001,14 @@ dkwt_ev_del_rk_profile(DKWT_EV_J *j, dkChar const *kn)
RegCloseKey(hk);
} else {
-#line 898 "dkwt-ev.ctr"
+#line 908 "dkwt-ev.ctr"
/* ERROR: Failed to open registry key ... */
dk3app_log_3(j->app, DK3_LL_ERROR, j->msg, 132, 133, (j->kwnl)[19]);
}
}
-#line 903 "dkwt-ev.ctr"
+#line 913 "dkwt-ev.ctr"
}
@@ -1036,6 +1024,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dkChar ppb[DK3_MAX_PATH]; /* Profile path buffer. */
dkChar esb[DK3_MAX_PATH]; /* Expanded string buffer. */
dkChar bu1[DK3_MAX_PATH]; /* Buffer for full file name. */
+ unsigned char *ptrppb;
void *vp; /* void pointer for cleanup. */
dk3_sto_t *s_fn; /* Storage of directories to delete. */
dk3_sto_it_t *i_fn; /* Iterator for directory storage. */
@@ -1050,10 +1039,14 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dkChar *ptr; /* Pointer to dot in file name. */
DKWT_EV_DIR *ddel; /* Directory to delete. */
HKEY hk; /* Handle for registry key. */
+#if VERSION_BEFORE_2019_10_20
REGSAM regs; /* Access type to registry key. */
+#endif
long res; /* Result from operation. */
size_t stlgt; /* String length. */
+#if VERSION_BEFORE_2019_10_20
DWORD dw0; /* Used to open registry keys. */
+#endif
DWORD dwInd; /* INdex of current key. */
DWORD dwSz; /* Size of knb buffer. */
DWORD dwEx; /* Result from string expansion. */
@@ -1062,8 +1055,9 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
int ec; /* Error code. */
-#line 943 "dkwt-ev.ctr"
+#line 958 "dkwt-ev.ctr"
ec = 0;
+ ptrppb = (unsigned char *)ppb;
if(j->profBase) {
/* PROGRESS: Cleanin up profiles (start) */
dk3app_log_1(j->app, DK3_LL_PROGRESS, j->msg, 134);
@@ -1090,7 +1084,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
es = dk3dir_get_shortname(dir);
if((en) && (es)) {
-#line 969 "dkwt-ev.ctr"
+#line 985 "dkwt-ev.ctr"
md = 1;
if(dkwt_ev_must_keep(j, es)) {
md = 0;
@@ -1106,7 +1100,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
}
} else {
-#line 983 "dkwt-ev.ctr"
+#line 999 "dkwt-ev.ctr"
/* ERROR: Name too long! */
dk3app_log_i3(j->app, DK3_LL_ERROR, 59, 60, es);
if(!(ec)) { ec = DK3_ERROR_TOO_LARGE; }
@@ -1114,25 +1108,25 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
}
}
-#line 989 "dkwt-ev.ctr"
+#line 1005 "dkwt-ev.ctr"
if(md) {
ddel = dkwt_ev_ddel_new(j, en);
if(ddel) {
if(!dk3sto_add(s_fn, (void *)ddel)) {
-#line 993 "dkwt-ev.ctr"
+#line 1009 "dkwt-ev.ctr"
dkwt_ev_ddel_del(ddel);
if(!(ec)) { ec = DK3_ERROR_MEMORY; }
}
} else {
-#line 997 "dkwt-ev.ctr"
+#line 1013 "dkwt-ev.ctr"
if(!(ec)) { ec = DK3_ERROR_MEMORY; }
}
}
} else {
-#line 1001 "dkwt-ev.ctr"
+#line 1017 "dkwt-ev.ctr"
/* ERROR: Failed to obtain name for directory entry! */
dk3app_log_1(j->app, DK3_LL_ERROR, j->msg, 135);
if(!(ec)) { ec = DK3_ERROR_SYSTEM; }
@@ -1142,8 +1136,12 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
/*
Now search the registry keys
*/
+#if VERSION_BEFORE_2019_10_20
dw0 = (DWORD)0;
+#endif
+#if VERSION_BEFORE_2019_10_20
regs = KEY_READ;
+#endif
res = dkwt_tool_reg_open_key(
HKEY_LOCAL_MACHINE, (j->kwnl)[19], KEY_READ, &hk
);
@@ -1160,19 +1158,19 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
if(kn) {
if(!dk3sto_add(s_rk, (void *)kn)) {
-#line 1027 "dkwt-ev.ctr"
+#line 1047 "dkwt-ev.ctr"
dk3_delete(kn);
if(!(ec)) { ec = DK3_ERROR_MEMORY; }
}
} else {
-#line 1031 "dkwt-ev.ctr"
+#line 1051 "dkwt-ev.ctr"
if(!(ec)) { ec = DK3_ERROR_MEMORY; }
}
}
} else {
-#line 1035 "dkwt-ev.ctr"
+#line 1055 "dkwt-ev.ctr"
if(res != ERROR_NO_MORE_ITEMS) {
if(!(ec)) { ec = DK3_ERROR_DURING_READ; }
}
@@ -1192,8 +1190,12 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dk3str_cpy_not_overlapped(knb, (j->kwnl)[19]);
dk3str_cat(knb, (j->kwnl)[20]);
dk3str_cat(knb, kn);
+#if VERSION_BEFORE_2019_10_20
dw0 = 0;
+#endif
+#if VERSION_BEFORE_2019_10_20
regs = KEY_QUERY_VALUE;
+#endif
res = dkwt_tool_reg_open_key(
HKEY_LOCAL_MACHINE, knb, KEY_QUERY_VALUE, &hk
);
@@ -1206,11 +1208,11 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
if(ERROR_SUCCESS == res) {
#if DK3_CHAR_SIZE > 1
if(dwSz < (sizeof(ppb) - 1)) {
- ppb[dwSz] = '\0';
- ppb[dwSz+1] = '\0';
+ ptrppb[dwSz] = '\0';
+ ptrppb[dwSz+1] = '\0';
} else {
- ppb[sizeof(ppb)-2] = '\0';
- ppb[sizeof(ppb)-1] = '\0';
+ ptrppb[DK3_SIZEOF(ppb,dkChar)-2] = '\0';
+ ptrppb[DK3_SIZEOF(ppb,dkChar)-1] = '\0';
}
#else
if(dwSz < sizeof(ppb)) {
@@ -1228,18 +1230,26 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
/* Save kn as registry key to delete */
if(!dk3sto_add(s_rd, (void *)kn)) {
-#line 1089 "dkwt-ev.ctr"
+#line 1113 "dkwt-ev.ctr"
ddel->f = 0x00;
if(!(ec)) { ec = DK3_ERROR_MEMORY; }
}
}
} break;
case REG_EXPAND_SZ: {
- dwEx = ExpandEnvironmentStrings(
+#if DK3_CHAR_SIZE > 1
+ dwEx = ExpandEnvironmentStringsW(
+ ppb,
+ esb,
+ DK3_SIZEOF(esb,dkChar)
+ );
+#else
+ dwEx = ExpandEnvironmentStringsA(
ppb,
esb,
DK3_SIZEOF(esb,dkChar)
);
+#endif
if(dwEx > 0) {
if(dwEx < DK3_SIZEOF(esb,dkChar)) {
ddel = (DKWT_EV_DIR *)dk3sto_it_find_like(
@@ -1249,14 +1259,14 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
/* Save kn as registry key to delete */
if(!dk3sto_add(s_rd,(void *)kn)) {
-#line 1108 "dkwt-ev.ctr"
+#line 1140 "dkwt-ev.ctr"
ddel->f = 0x00;
if(!(ec)) { ec = DK3_ERROR_MEMORY; }
}
}
} else {
-#line 1113 "dkwt-ev.ctr"
+#line 1145 "dkwt-ev.ctr"
/* ERROR: String too long! */
dk3app_log_3(
j->app, DK3_LL_ERROR, j->msg,
@@ -1272,7 +1282,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
/* Save kn as registry key to delete */
if(!dk3sto_add(s_rd, (void *)kn)) {
-#line 1127 "dkwt-ev.ctr"
+#line 1159 "dkwt-ev.ctr"
ddel->f = 0x00;
if(!(ec)) { ec = DK3_ERROR_MEMORY; }
}
@@ -1284,7 +1294,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
RegCloseKey(hk);
} else {
-#line 1137 "dkwt-ev.ctr"
+#line 1169 "dkwt-ev.ctr"
/* ERROR: Failed to open registry key ... */
dk3app_log_3(
j->app, DK3_LL_ERROR, j->msg, 132, 133, knb
@@ -1293,7 +1303,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
}
} else {
-#line 1144 "dkwt-ev.ctr"
+#line 1176 "dkwt-ev.ctr"
/* ERROR: Key name too long! */
dk3app_log_3(j->app, DK3_LL_ERROR, j->msg, 138, 139, kn);
if(!(ec)) { ec = DK3_ERROR_TOO_LARGE; }
@@ -1301,7 +1311,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
}
} else {
-#line 1150 "dkwt-ev.ctr"
+#line 1182 "dkwt-ev.ctr"
/* ERROR: Failed to open registry key! */
dk3app_log_3(
j->app, DK3_LL_ERROR, j->msg, 132, 133, (j->kwnl)[19]
@@ -1310,11 +1320,11 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
}
} else {
-#line 1157 "dkwt-ev.ctr"
+#line 1189 "dkwt-ev.ctr"
}
if(!(ec)) {
-#line 1159 "dkwt-ev.ctr"
+#line 1191 "dkwt-ev.ctr"
dk3sto_it_reset(i_rd);
while(NULL != (kn = (dkChar const *)dk3sto_it_next(i_rd))) {
/*
@@ -1332,12 +1342,12 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dk3sto_it_close(i_rd);
} else {
-#line 1175 "dkwt-ev.ctr"
+#line 1207 "dkwt-ev.ctr"
}
dk3sto_close(s_rd);
} else {
-#line 1178 "dkwt-ev.ctr"
+#line 1210 "dkwt-ev.ctr"
}
dk3sto_it_reset(i_rk);
while(NULL != (vp = dk3sto_it_next(i_rk))) {
@@ -1346,12 +1356,12 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dk3sto_it_close(i_rk);
} else {
-#line 1185 "dkwt-ev.ctr"
+#line 1217 "dkwt-ev.ctr"
}
dk3sto_close(s_rk);
} else {
-#line 1188 "dkwt-ev.ctr"
+#line 1220 "dkwt-ev.ctr"
}
dk3sto_it_reset(i_fn);
while(NULL != (ddel = (DKWT_EV_DIR *)dk3sto_it_next(i_fn))) {
@@ -1371,22 +1381,22 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dk3sto_it_close(i_fn); i_fn = NULL;
} else {
-#line 1206 "dkwt-ev.ctr"
+#line 1238 "dkwt-ev.ctr"
}
dk3sto_close(s_fn); s_fn = NULL;
} else {
-#line 1209 "dkwt-ev.ctr"
+#line 1241 "dkwt-ev.ctr"
}
/* PROGRESS: Cleaning up profiles (finished). */
dk3app_log_1(j->app, DK3_LL_PROGRESS, j->msg, 141);
} else {
-#line 1213 "dkwt-ev.ctr"
+#line 1245 "dkwt-ev.ctr"
}
-#line 1215 "dkwt-ev.ctr"
+#line 1247 "dkwt-ev.ctr"
}
@@ -1406,7 +1416,7 @@ dkwt_ev_cleanup_public(DKWT_EV_J *j)
dk3_dir_t *dir;
-#line 1233 "dkwt-ev.ctr"
+#line 1265 "dkwt-ev.ctr"
dk3sto_it_reset(j->i_pubdir);
while((fn = (dkChar const *)dk3sto_it_next(j->i_pubdir)) != NULL) {
dir = dk3dir_open_app(fn, j->app);
@@ -1428,7 +1438,7 @@ dkwt_ev_cleanup_public(DKWT_EV_J *j)
}
-#line 1253 "dkwt-ev.ctr"
+#line 1285 "dkwt-ev.ctr"
}
@@ -1449,7 +1459,7 @@ dkwt_ev_user_permissions(
size_t sz = 0;
-#line 1272 "dkwt-ev.ctr"
+#line 1304 "dkwt-ev.ctr"
if(j->useIcacls) {
if(isdir) {
sz = dk3str_len((j->kwnl)[10]);
@@ -1529,7 +1539,7 @@ dkwt_ev_user_permissions(
}
-#line 1350 "dkwt-ev.ctr"
+#line 1382 "dkwt-ev.ctr"
}
@@ -1545,7 +1555,7 @@ dkwt_ev_permissions(DKWT_EV_J *j, dkChar const *fn, int isdir)
{
-#line 1364 "dkwt-ev.ctr"
+#line 1396 "dkwt-ev.ctr"
if(j->systemUser) {
dkwt_ev_user_permissions(j, fn, j->systemUser, isdir);
} else {
@@ -1558,7 +1568,7 @@ dkwt_ev_permissions(DKWT_EV_J *j, dkChar const *fn, int isdir)
}
-#line 1375 "dkwt-ev.ctr"
+#line 1407 "dkwt-ev.ctr"
}
@@ -1575,7 +1585,7 @@ dkwt_ev_permissions_profile(DKWT_EV_J *j)
size_t sz;
-#line 1390 "dkwt-ev.ctr"
+#line 1422 "dkwt-ev.ctr"
if((j->profBase) && (j->userName)) {
sz = dk3str_len(j->profBase);
sz += dk3str_len(j->userName);
@@ -1589,7 +1599,7 @@ dkwt_ev_permissions_profile(DKWT_EV_J *j)
}
-#line 1402 "dkwt-ev.ctr"
+#line 1434 "dkwt-ev.ctr"
}
@@ -1607,7 +1617,7 @@ dkwt_ev_permissions_public(DKWT_EV_J *j)
dk3_dir_t *dir;
-#line 1418 "dkwt-ev.ctr"
+#line 1450 "dkwt-ev.ctr"
dk3sto_it_reset(j->i_pubdir);
while((fn = (dkChar const *)dk3sto_it_next(j->i_pubdir)) != NULL) {
dir = dk3dir_open_app(fn, j->app);
@@ -1629,7 +1639,7 @@ dkwt_ev_permissions_public(DKWT_EV_J *j)
}
-#line 1438 "dkwt-ev.ctr"
+#line 1470 "dkwt-ev.ctr"
}
@@ -1643,12 +1653,12 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
{
-#line 1450 "dkwt-ev.ctr"
+#line 1482 "dkwt-ev.ctr"
switch(j->event) {
case 0: {
-#line 1452 "dkwt-ev.ctr"
- if(!dkwt_ev_get_keep_value(j->app, j->msg, j->kwnl, 0)) {
+#line 1484 "dkwt-ev.ctr"
+ if(!dkwt_ev_get_keep_value(j->kwnl, 0)) {
if(j->clrProfiles != 0) {
dkwt_ev_cleanup_profiles(j);
}
@@ -1657,8 +1667,8 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
} break;
case 1: {
-#line 1460 "dkwt-ev.ctr"
- if(!dkwt_ev_get_keep_value(j->app, j->msg, j->kwnl, 0)) {
+#line 1492 "dkwt-ev.ctr"
+ if(!dkwt_ev_get_keep_value(j->kwnl, 0)) {
if(j->clrProfiles != 0) {
dkwt_ev_cleanup_profiles(j);
}
@@ -1667,8 +1677,8 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
} break;
case 2: {
-#line 1468 "dkwt-ev.ctr"
- if(!dkwt_ev_get_keep_value(j->app, j->msg, j->kwnl, 1)) {
+#line 1500 "dkwt-ev.ctr"
+ if(!dkwt_ev_get_keep_value(j->kwnl, 1)) {
if(j->clrProfiles != 0) {
dkwt_ev_cleanup_profiles(j);
}
@@ -1677,12 +1687,12 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
} break;
case 3: {
-#line 1476 "dkwt-ev.ctr"
+#line 1508 "dkwt-ev.ctr"
if(j->clrProfiles != 0) {
dkwt_ev_permissions_profile(j);
}
dkwt_ev_permissions_public(j);
- if(!dkwt_ev_get_keep_value(j->app, j->msg, j->kwnl, 0)) {
+ if(!dkwt_ev_get_keep_value(j->kwnl, 0)) {
if(j->clrProfiles != 0) {
dkwt_ev_cleanup_profiles(j);
}
@@ -1697,7 +1707,7 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
} break;
case 4: {
-#line 1494 "dkwt-ev.ctr"
+#line 1526 "dkwt-ev.ctr"
if (1 == dkwt_is_admin()) {
dkwt_ev_cleanup_profiles(j);
} else {
@@ -1707,7 +1717,7 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
}
-#line 1502 "dkwt-ev.ctr"
+#line 1534 "dkwt-ev.ctr"
}
@@ -1778,33 +1788,33 @@ dkwt_find_account_name_for_sid(
success = 1;
} else {
-#line 1571 "dkwt-ev.ctr"
+#line 1603 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_MEMORY;
}
} else {
-#line 1574 "dkwt-ev.ctr"
+#line 1606 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
} else {
-#line 1577 "dkwt-ev.ctr"
+#line 1609 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
} else {
-#line 1580 "dkwt-ev.ctr"
+#line 1612 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
LocalFree(psid);
} else {
-#line 1584 "dkwt-ev.ctr"
+#line 1616 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
} else {
-#line 1587 "dkwt-ev.ctr"
+#line 1619 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
if(!(success)) {
@@ -1850,7 +1860,7 @@ dkwt_ev_run_with_config_file_name(DKWT_EV_J *j, dkChar const *fn)
int ok = 0;
-#line 1631 "dkwt-ev.ctr"
+#line 1663 "dkwt-ev.ctr"
ok = dk3stream_process_filename_lines_app(
(void *)j,
dkwt_ev_line_handler,
@@ -1863,51 +1873,51 @@ dkwt_ev_run_with_config_file_name(DKWT_EV_J *j, dkChar const *fn)
);
if(ok) {
-#line 1642 "dkwt-ev.ctr"
+#line 1674 "dkwt-ev.ctr"
dkwt_complete_account_names(j);
al = dkwt_tool_open_account_list(j->app, 0);
if(al) {
-#line 1645 "dkwt-ev.ctr"
+#line 1677 "dkwt-ev.ctr"
dkwt_tool_reset_account_list(al);
while((ac = dkwt_tool_get_account_from_list(al)) != NULL) {
p1 = dk3str_dup_app(ac->logname, j->app);
if(p1) {
-#line 1649 "dkwt-ev.ctr"
+#line 1681 "dkwt-ev.ctr"
if(!(dk3sto_add(j->s_users, (void *)p1))) {
ok = 0;
-#line 1651 "dkwt-ev.ctr"
+#line 1683 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_MEMORY;
dk3_release(p1);
}
} else {
-#line 1655 "dkwt-ev.ctr"
+#line 1687 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_MEMORY;
}
}
dkwt_tool_close_account_list(al);
if(ok) {
-#line 1660 "dkwt-ev.ctr"
+#line 1692 "dkwt-ev.ctr"
dkwt_ev_do_processing(j);
} else {
-#line 1662 "dkwt-ev.ctr"
+#line 1694 "dkwt-ev.ctr"
}
} else {
-#line 1664 "dkwt-ev.ctr"
+#line 1696 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
} else {
-#line 1667 "dkwt-ev.ctr"
+#line 1699 "dkwt-ev.ctr"
}
-#line 1668 "dkwt-ev.ctr"
+#line 1700 "dkwt-ev.ctr"
}
@@ -1927,7 +1937,7 @@ dkwt_ev_run_with_storages(DKWT_EV_J *j)
int ok = 1; /* Flag: OK so far. */
-#line 1686 "dkwt-ev.ctr"
+#line 1718 "dkwt-ev.ctr"
switch(j->event) {
case 2: case 3: {
ok = 0;
@@ -1945,34 +1955,34 @@ dkwt_ev_run_with_storages(DKWT_EV_J *j)
}
if(ok) {
-#line 1702 "dkwt-ev.ctr"
+#line 1734 "dkwt-ev.ctr"
sr = dk3app_find_config_file_revers(j->app, (j->kwnl)[1], 1);
if(sr) {
-#line 1704 "dkwt-ev.ctr"
+#line 1736 "dkwt-ev.ctr"
dk3search_reset(sr);
fn = dk3search_next(sr);
if(fn) {
-#line 1707 "dkwt-ev.ctr"
+#line 1739 "dkwt-ev.ctr"
dkwt_ev_run_with_config_file_name(j, fn);
} else {
-#line 1709 "dkwt-ev.ctr"
+#line 1741 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
dk3search_close(sr);
} else {
-#line 1713 "dkwt-ev.ctr"
+#line 1745 "dkwt-ev.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
} else {
-#line 1716 "dkwt-ev.ctr"
+#line 1748 "dkwt-ev.ctr"
}
-#line 1717 "dkwt-ev.ctr"
+#line 1749 "dkwt-ev.ctr"
}
@@ -1989,7 +1999,7 @@ dkwt_ev_run(DKWT_EV_J *j)
int xargc;
-#line 1732 "dkwt-ev.ctr"
+#line 1764 "dkwt-ev.ctr"
xargc = dk3app_get_argc(j->app);
xargv = dk3app_get_argv(j->app);
xargv++; xargv++; xargc--; xargc--;
@@ -2038,7 +2048,7 @@ dkwt_ev_run(DKWT_EV_J *j)
}
-#line 1779 "dkwt-ev.ctr"
+#line 1811 "dkwt-ev.ctr"
}
@@ -2055,7 +2065,7 @@ dkwt_event(
int back = DKT_RESULT_ERR_UNSPECIFIC;
-#line 1794 "dkwt-ev.ctr"
+#line 1826 "dkwt-ev.ctr"
dkwt_ev_job_init(&j);
j.app = app; j.msg = msg; j.kwnl = kwnl; j.event = evt;
back = j.exval = DKT_RESULT_OK;
@@ -2073,7 +2083,7 @@ dkwt_event(
}
-#line 1810 "dkwt-ev.ctr"
+#line 1842 "dkwt-ev.ctr"
return back;
}
@@ -2132,12 +2142,14 @@ dkwt_event_keep(
int
dkwt_event_unkeep(
- dk3_app_t *app,
- dkChar const * const *msg,
+ dk3_app_t * DK3_ARG_UNUSED(app),
+ dkChar const * const * DK3_ARG_UNUSED(msg),
dkChar const * const *kwnl
)
{
- (void)dkwt_ev_get_keep_value(app, msg, kwnl, 1);
+ DK3_UNUSED_ARG(app)
+ DK3_UNUSED_ARG(msg)
+ (void)dkwt_ev_get_keep_value(kwnl, 1);
return 0;
}
diff --git a/support/dktools/dkwt-ev.ctr b/support/dktools/dkwt-ev.ctr
index efdcb5e666..a418467797 100644
--- a/support/dktools/dkwt-ev.ctr
+++ b/support/dktools/dkwt-ev.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,7 @@ license = bsd
#include "dk3all.h"
#include "dkt.h"
#include "dkwt.h"
+#include "dk3unused.h"
@@ -127,8 +128,6 @@ static dkChar const dkwt_pq_name_local[] = { dkT("local") };
/** Retrieve value of keep flag.
- @param app Application structure.
- @param msg Localized message texts.
@param kwnl Keywords, not localized.
@param reset Reset the flag.
@return Flag value (before reset).
@@ -136,30 +135,40 @@ static dkChar const dkwt_pq_name_local[] = { dkT("local") };
static
int
dkwt_ev_get_keep_value(
- dk3_app_t *app,
- dkChar const * const *msg,
dkChar const * const *kwnl,
int reset
)
{
long result;
+#if VERSION_BEFORE_2019_10_20
DWORD dw0;
+#endif
DWORD dwType;
DWORD dwValue;
DWORD dwSz;
int back = 0;
HKEY hk;
+#if VERSION_BEFORE_2019_10_20
REGSAM regsam;
+#endif
$? "+ dkwt_ev_get_keep_value"
+#if VERSION_BEFORE_2019_10_20
dw0 = (DWORD)0;
+#endif
dwType = REG_DWORD;
dwValue = 0;
dwSz = sizeof(DWORD);
+#if VERSION_BEFORE_2019_10_20
+ /*
+ KEY_QUERY_VALUE is always used in the
+ dkwt_tool_reg_open_key() function call below.
+ */
regsam = KEY_QUERY_VALUE;
if(reset) {
regsam = (KEY_READ | KEY_WRITE);
}
+#endif
result = dkwt_tool_reg_open_key(
HKEY_LOCAL_MACHINE, kwnl[15], KEY_QUERY_VALUE, &hk
);
@@ -195,11 +204,12 @@ dkwt_ev_get_keep_value(
*/
static
int
-dkwt_ev_compare_string(void const *l, void const *r, int cr)
+dkwt_ev_compare_string(void const *l, void const *r, int DK3_ARG_UNUSED(cr))
{
dkChar const *pl;
dkChar const *pr;
int back = 0;
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (dkChar const *)l; pr = (dkChar const *)r;
@@ -226,7 +236,7 @@ static
void
dkwt_ev_job_init(DKWT_EV_J *j)
{
-#if (_MSC_VER < 1800) || DK4_WINDOWS_LEGACY
+#if (!(_WIN32)) || (!(defined(_WIN32_WINNT))) || (_WIN32_WINNT < 0x0603)
OSVERSIONINFO ovi;
#endif
@@ -246,7 +256,7 @@ dkwt_ev_job_init(DKWT_EV_J *j)
j->s_queues = NULL;
j->i_queues = NULL;
j->clrProfiles = 0;
-#if (_MSC_VER < 1800) || DK4_WINDOWS_LEGACY
+#if (!(_WIN32)) || (!(defined(_WIN32_WINNT))) || (_WIN32_WINNT < 0x0603)
ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
ovi.dwMajorVersion = 0L;
ovi.dwMinorVersion = 0L;
@@ -915,6 +925,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dkChar ppb[DK3_MAX_PATH]; /* Profile path buffer. */
dkChar esb[DK3_MAX_PATH]; /* Expanded string buffer. */
dkChar bu1[DK3_MAX_PATH]; /* Buffer for full file name. */
+ unsigned char *ptrppb;
void *vp; /* void pointer for cleanup. */
dk3_sto_t *s_fn; /* Storage of directories to delete. */
dk3_sto_it_t *i_fn; /* Iterator for directory storage. */
@@ -929,10 +940,14 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dkChar *ptr; /* Pointer to dot in file name. */
DKWT_EV_DIR *ddel; /* Directory to delete. */
HKEY hk; /* Handle for registry key. */
+#if VERSION_BEFORE_2019_10_20
REGSAM regs; /* Access type to registry key. */
+#endif
long res; /* Result from operation. */
size_t stlgt; /* String length. */
+#if VERSION_BEFORE_2019_10_20
DWORD dw0; /* Used to open registry keys. */
+#endif
DWORD dwInd; /* INdex of current key. */
DWORD dwSz; /* Size of knb buffer. */
DWORD dwEx; /* Result from string expansion. */
@@ -941,6 +956,7 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
int ec; /* Error code. */
$? "+ dkwt_ev_cleanup_profiles"
ec = 0;
+ ptrppb = (unsigned char *)ppb;
if(j->profBase) {
/* PROGRESS: Cleanin up profiles (start) */
dk3app_log_1(j->app, DK3_LL_PROGRESS, j->msg, 134);
@@ -1007,8 +1023,12 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
/*
Now search the registry keys
*/
+#if VERSION_BEFORE_2019_10_20
dw0 = (DWORD)0;
+#endif
+#if VERSION_BEFORE_2019_10_20
regs = KEY_READ;
+#endif
res = dkwt_tool_reg_open_key(
HKEY_LOCAL_MACHINE, (j->kwnl)[19], KEY_READ, &hk
);
@@ -1051,8 +1071,12 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
dk3str_cpy_not_overlapped(knb, (j->kwnl)[19]);
dk3str_cat(knb, (j->kwnl)[20]);
dk3str_cat(knb, kn);
+#if VERSION_BEFORE_2019_10_20
dw0 = 0;
+#endif
+#if VERSION_BEFORE_2019_10_20
regs = KEY_QUERY_VALUE;
+#endif
res = dkwt_tool_reg_open_key(
HKEY_LOCAL_MACHINE, knb, KEY_QUERY_VALUE, &hk
);
@@ -1065,11 +1089,11 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
if(ERROR_SUCCESS == res) {
#if DK3_CHAR_SIZE > 1
if(dwSz < (sizeof(ppb) - 1)) {
- ppb[dwSz] = '\0';
- ppb[dwSz+1] = '\0';
+ ptrppb[dwSz] = '\0';
+ ptrppb[dwSz+1] = '\0';
} else {
- ppb[sizeof(ppb)-2] = '\0';
- ppb[sizeof(ppb)-1] = '\0';
+ ptrppb[DK3_SIZEOF(ppb,dkChar)-2] = '\0';
+ ptrppb[DK3_SIZEOF(ppb,dkChar)-1] = '\0';
}
#else
if(dwSz < sizeof(ppb)) {
@@ -1092,11 +1116,19 @@ dkwt_ev_cleanup_profiles(DKWT_EV_J *j)
}
} break;
case REG_EXPAND_SZ: {
- dwEx = ExpandEnvironmentStrings(
+#if DK3_CHAR_SIZE > 1
+ dwEx = ExpandEnvironmentStringsW(
+ ppb,
+ esb,
+ DK3_SIZEOF(esb,dkChar)
+ );
+#else
+ dwEx = ExpandEnvironmentStringsA(
ppb,
esb,
DK3_SIZEOF(esb,dkChar)
);
+#endif
if(dwEx > 0) {
if(dwEx < DK3_SIZEOF(esb,dkChar)) {
ddel = (DKWT_EV_DIR *)dk3sto_it_find_like(
@@ -1449,7 +1481,7 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
$? "+ dkwt_ev_do_processing"
switch(j->event) {
case 0: { $? ". boot"
- if(!dkwt_ev_get_keep_value(j->app, j->msg, j->kwnl, 0)) {
+ if(!dkwt_ev_get_keep_value(j->kwnl, 0)) {
if(j->clrProfiles != 0) {
dkwt_ev_cleanup_profiles(j);
}
@@ -1457,7 +1489,7 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
}
} break;
case 1: { $? ". shutdown"
- if(!dkwt_ev_get_keep_value(j->app, j->msg, j->kwnl, 0)) {
+ if(!dkwt_ev_get_keep_value(j->kwnl, 0)) {
if(j->clrProfiles != 0) {
dkwt_ev_cleanup_profiles(j);
}
@@ -1465,7 +1497,7 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
}
} break;
case 2: { $? ". login"
- if(!dkwt_ev_get_keep_value(j->app, j->msg, j->kwnl, 1)) {
+ if(!dkwt_ev_get_keep_value(j->kwnl, 1)) {
if(j->clrProfiles != 0) {
dkwt_ev_cleanup_profiles(j);
}
@@ -1477,7 +1509,7 @@ dkwt_ev_do_processing(DKWT_EV_J *j)
dkwt_ev_permissions_profile(j);
}
dkwt_ev_permissions_public(j);
- if(!dkwt_ev_get_keep_value(j->app, j->msg, j->kwnl, 0)) {
+ if(!dkwt_ev_get_keep_value(j->kwnl, 0)) {
if(j->clrProfiles != 0) {
dkwt_ev_cleanup_profiles(j);
}
@@ -1865,12 +1897,14 @@ dkwt_event_keep(
int
dkwt_event_unkeep(
- dk3_app_t *app,
- dkChar const * const *msg,
+ dk3_app_t * DK3_ARG_UNUSED(app),
+ dkChar const * const * DK3_ARG_UNUSED(msg),
dkChar const * const *kwnl
)
{
- (void)dkwt_ev_get_keep_value(app, msg, kwnl, 1);
+ DK3_UNUSED_ARG(app)
+ DK3_UNUSED_ARG(msg)
+ (void)dkwt_ev_get_keep_value(kwnl, 1);
return 0;
}
diff --git a/support/dktools/dkwt-gr.c b/support/dktools/dkwt-gr.c
index 8ee012ccc0..dfdd10ddfa 100644
--- a/support/dktools/dkwt-gr.c
+++ b/support/dktools/dkwt-gr.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwt-gr.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwt-gr.ctr
*/
/** @file dkwt-gr.c The dkwt-gr module.
diff --git a/support/dktools/dkwt-gr.ctr b/support/dktools/dkwt-gr.ctr
index 45e73fe951..5332295049 100644
--- a/support/dktools/dkwt-gr.ctr
+++ b/support/dktools/dkwt-gr.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/dkwt-pr.c b/support/dktools/dkwt-pr.c
index 95d4cef2c4..62781dcc6b 100644
--- a/support/dktools/dkwt-pr.c
+++ b/support/dktools/dkwt-pr.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwt-pr.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwt-pr.ctr
*/
/** @file dkwt-pr.c The dkwt-pr module.
@@ -42,12 +20,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "dkt.h"
#include "dkwt.h"
+#include "dk3unused.h"
-#line 18 "dkwt-pr.ctr"
+#line 19 "dkwt-pr.ctr"
@@ -123,7 +102,7 @@ dkwt_printers_process_argv(DKWT_PRINTERS_J *j)
xargv = dk3app_get_argv(j->app);
-#line 92 "dkwt-pr.ctr"
+#line 93 "dkwt-pr.ctr"
xargv++; xargv++; xargc--; xargc--;
j->opt = dk3opt_open_app(
dkwt_printers_options,
@@ -309,7 +288,7 @@ dkwt_print_process_argv(DKWT_PRINT_J *j)
dkChar const * const *xargv;
-#line 276 "dkwt-pr.ctr"
+#line 277 "dkwt-pr.ctr"
xargc = dk3app_get_argc(j->app);
xargv = dk3app_get_argv(j->app);
xargv++; xargv++; xargc--; xargc--;
@@ -324,18 +303,18 @@ dkwt_print_process_argv(DKWT_PRINT_J *j)
);
if(j->opt) {
-#line 289 "dkwt-pr.ctr"
+#line 290 "dkwt-pr.ctr"
if(0 == dk3opt_get_error_code(j->opt)) {
-#line 290 "dkwt-pr.ctr"
+#line 291 "dkwt-pr.ctr"
back = 1;
if(dk3opt_is_set(j->opt, dkT('d'))) {
-#line 292 "dkwt-pr.ctr"
+#line 293 "dkwt-pr.ctr"
j->deviceName = dk3opt_get_short_arg(j->opt, dkT('d'));
if(!(j->deviceName)) {
-#line 294 "dkwt-pr.ctr"
+#line 295 "dkwt-pr.ctr"
j->exval = DKT_RESULT_ERR_OPTION;
back = 0;
}
@@ -347,7 +326,7 @@ dkwt_print_process_argv(DKWT_PRINT_J *j)
j->exval = DKT_RESULT_ERR_OPTION;
}
-#line 304 "dkwt-pr.ctr"
+#line 305 "dkwt-pr.ctr"
return back;
}
@@ -368,7 +347,7 @@ dkwt_print_schedule_file(DKWT_PRINT_J *j, HANDLE hFile, dkChar const *fn)
DWORD written;
-#line 323 "dkwt-pr.ctr"
+#line 324 "dkwt-pr.ctr"
fipo = dk3sf_fopen_app(fn, dk3app_not_localized(36), j->app);
if(fipo) {
do {
@@ -390,7 +369,7 @@ dkwt_print_schedule_file(DKWT_PRINT_J *j, HANDLE hFile, dkChar const *fn)
j->exval = DKT_RESULT_ERR_FILENAME;
}
-#line 343 "dkwt-pr.ctr"
+#line 344 "dkwt-pr.ctr"
}
@@ -409,7 +388,11 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
DWORD dwLev = (DWORD)1;
DWORD dwSz;
DWORD dwNeeded;
- ADDJOB_INFO_1 *aji1;
+#if DK3_CHAR_SIZE > 1
+ ADDJOB_INFO_1W *aji1;
+#else
+ ADDJOB_INFO_1A *aji1;
+#endif
int ok;
DWORD dwAcc;
DWORD dwSh;
@@ -426,41 +409,57 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
dk3_dir_t *fne; /* File name expander. */
-#line 377 "dkwt-pr.ctr"
+#line 382 "dkwt-pr.ctr"
ok = 0;
- if(OpenPrinter(pn, &hPr, NULL)) {
-
-#line 379 "dkwt-pr.ctr"
+#if DK3_CHAR_SIZE > 1
+ if(OpenPrinterW(pn, &hPr, NULL))
+#else
+ if(OpenPrinterA(pn, &hPr, NULL))
+#endif
+ {
dwSz = sizeof(ajbu);
dwNeeded = (DWORD)0UL;
- if(AddJob(hPr, dwLev, (LPBYTE)ajbu, dwSz, &dwNeeded)) {
- aji1 = (ADDJOB_INFO_1 *)ajbu;
-
-#line 383 "dkwt-pr.ctr"
+#if DK3_CHAR_SIZE > 1
+ if(AddJobW(hPr, dwLev, (LPBYTE)ajbu, dwSz, &dwNeeded))
+#else
+ if(AddJobA(hPr, dwLev, (LPBYTE)ajbu, dwSz, &dwNeeded))
+#endif
+ {
+#if DK3_CHAR_SIZE > 1
+ aji1 = (ADDJOB_INFO_1W *)ajbu;
+
+#line 399 "dkwt-pr.ctr"
+#else
+ aji1 = (ADDJOB_INFO_1A *)ajbu;
+#endif
if(aji1->Path) {
-#line 384 "dkwt-pr.ctr"
+#line 403 "dkwt-pr.ctr"
hFile = INVALID_HANDLE_VALUE;
dwAcc = GENERIC_WRITE;
dwSh = FILE_SHARE_READ;
dwDisp = CREATE_ALWAYS;
dwAttr = FILE_ATTRIBUTE_NORMAL;
- hFile = CreateFile(aji1->Path,dwAcc,dwSh,NULL,dwDisp,dwAttr,NULL);
+#if DK3_CHAR_SIZE > 1
+ hFile = CreateFileW(aji1->Path,dwAcc,dwSh,NULL,dwDisp,dwAttr,NULL);
+#else
+ hFile = CreateFileA(aji1->Path,dwAcc,dwSh,NULL,dwDisp,dwAttr,NULL);
+#endif
if(hFile != INVALID_HANDLE_VALUE) {
-#line 391 "dkwt-pr.ctr"
+#line 414 "dkwt-pr.ctr"
if(dk3opt_get_num_args(j->opt) > 0) {
-#line 392 "dkwt-pr.ctr"
+#line 415 "dkwt-pr.ctr"
nfn = dk3opt_get_num_args(j->opt);
for(i = 0; i < nfn; i++) {
curarg = dk3opt_get_arg(j->opt, i);
if(curarg) {
-#line 396 "dkwt-pr.ctr"
+#line 419 "dkwt-pr.ctr"
if(dk3sf_must_expand(curarg)) {
-#line 397 "dkwt-pr.ctr"
+#line 420 "dkwt-pr.ctr"
fne = dk3dir_fne_open_app(curarg, j->app);
if(fne) {
if(dk3dir_get_number_of_files(fne) > 0) {
@@ -468,7 +467,7 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
curfn = dk3dir_get_fullname(fne);
if(curfn) {
-#line 403 "dkwt-pr.ctr"
+#line 426 "dkwt-pr.ctr"
dkwt_print_schedule_file(j, hFile, curfn);
} else {
/* BUG */
@@ -486,7 +485,7 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
}
} else {
-#line 419 "dkwt-pr.ctr"
+#line 442 "dkwt-pr.ctr"
dkwt_print_schedule_file(j, hFile, curarg);
}
} else {
@@ -495,13 +494,13 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
}
} else {
-#line 426 "dkwt-pr.ctr"
+#line 449 "dkwt-pr.ctr"
oldmode = _setmode(0, _O_BINARY);
do {
bytes = _read(0, db, sizeof(db));
if(bytes > 0) {
-#line 430 "dkwt-pr.ctr"
+#line 453 "dkwt-pr.ctr"
written = 0;
if(!WriteFile(
hFile, (void const *)db, (DWORD)bytes, &written, NULL
@@ -520,7 +519,7 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
CloseHandle(hFile);
} else {
-#line 447 "dkwt-pr.ctr"
+#line 470 "dkwt-pr.ctr"
/* ERROR: Failed to create print file! */
dk3app_log_3(j->app, DK3_LL_ERROR, j->msg, 56, 57, aji1->Path);
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
@@ -534,12 +533,12 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
}
} else {
-#line 459 "dkwt-pr.ctr"
+#line 482 "dkwt-pr.ctr"
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
}
} else {
-#line 462 "dkwt-pr.ctr"
+#line 485 "dkwt-pr.ctr"
/* ERROR: AddJob failed! */
dk3app_log_1(j->app, DK3_LL_ERROR, j->msg, 59);
j->exval = DKT_RESULT_ERR_UNSPECIFIC;
@@ -547,13 +546,13 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
ClosePrinter(hPr);
} else {
-#line 468 "dkwt-pr.ctr"
+#line 491 "dkwt-pr.ctr"
/* ERROR: Failed to open printer! */
dk3app_log_3(j->app, DK3_LL_ERROR, j->msg, 60, 61, pn);
j->exval = DKT_RESULT_ERR_OPTION;
}
-#line 472 "dkwt-pr.ctr"
+#line 495 "dkwt-pr.ctr"
}
@@ -572,14 +571,14 @@ dkwt_print_run(DKWT_PRINT_J *j)
int found = 0;
-#line 489 "dkwt-pr.ctr"
+#line 512 "dkwt-pr.ctr"
pl = dkwt_tool_open_printer_list(j->app, 1);
if(pl) {
-#line 491 "dkwt-pr.ctr"
+#line 514 "dkwt-pr.ctr"
if(j->deviceName) {
-#line 492 "dkwt-pr.ctr"
+#line 515 "dkwt-pr.ctr"
dkwt_tool_printer_list_reset(pl);
do {
pr = dkwt_tool_printer_list_next(pl);
@@ -609,18 +608,23 @@ dkwt_print_run(DKWT_PRINT_J *j)
}
} else {
-#line 520 "dkwt-pr.ctr"
+#line 543 "dkwt-pr.ctr"
dwSz = DK3_SIZEOF(bu,dkChar);
- if(GetDefaultPrinter(bu, &dwSz)) {
-
-#line 522 "dkwt-pr.ctr"
+#if DK3_CHAR_SIZE > 1
+ if(GetDefaultPrinterW(bu, &dwSz))
+#else
+ if(GetDefaultPrinterA(bu, &dwSz))
+#endif
+ {
+
+#line 550 "dkwt-pr.ctr"
if(dwSz < DK3_SIZEOF(bu,dkChar)) {
bu[dwSz] = dkT('\0');
} else {
bu[DK3_SIZEOF(bu,dkChar)-1] = dkT('\0');
}
-#line 527 "dkwt-pr.ctr"
+#line 555 "dkwt-pr.ctr"
dkwt_print_to_printer(j, bu);
} else {
/* ERROR: Failed to find default printer. */
@@ -633,7 +637,7 @@ dkwt_print_run(DKWT_PRINT_J *j)
j->exval = DKT_RESULT_ERR_MEMORY;
}
-#line 538 "dkwt-pr.ctr"
+#line 566 "dkwt-pr.ctr"
}
@@ -648,7 +652,7 @@ dkwt_print(
DKWT_PRINT_J j;
-#line 551 "dkwt-pr.ctr"
+#line 579 "dkwt-pr.ctr"
dkwt_print_job_init(&j);
j.app = app; j.msg = msg; j.kwnl = kwnl;
if(dkwt_print_process_argv(&j)) {
@@ -659,7 +663,7 @@ dkwt_print(
back = j.exval;
-#line 560 "dkwt-pr.ctr"
+#line 588 "dkwt-pr.ctr"
return back;
}
diff --git a/support/dktools/dkwt-pr.ctr b/support/dktools/dkwt-pr.ctr
index 9a1081ba1b..af6f3d5b3e 100644
--- a/support/dktools/dkwt-pr.ctr
+++ b/support/dktools/dkwt-pr.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,7 @@ license = bsd
#include "dk3all.h"
#include "dkt.h"
#include "dkwt.h"
+#include "dk3unused.h"
@@ -358,7 +359,11 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
DWORD dwLev = (DWORD)1;
DWORD dwSz;
DWORD dwNeeded;
- ADDJOB_INFO_1 *aji1;
+#if DK3_CHAR_SIZE > 1
+ ADDJOB_INFO_1W *aji1;
+#else
+ ADDJOB_INFO_1A *aji1;
+#endif
int ok;
DWORD dwAcc;
DWORD dwSh;
@@ -375,18 +380,36 @@ dkwt_print_to_printer(DKWT_PRINT_J *j, dkChar *pn)
dk3_dir_t *fne; /* File name expander. */
$? "+ dkwt_print_to_print \"%ls\"", pn
ok = 0;
- if(OpenPrinter(pn, &hPr, NULL)) { $? ". printer opened"
+#if DK3_CHAR_SIZE > 1
+ if(OpenPrinterW(pn, &hPr, NULL))
+#else
+ if(OpenPrinterA(pn, &hPr, NULL))
+#endif
+ {
dwSz = sizeof(ajbu);
dwNeeded = (DWORD)0UL;
- if(AddJob(hPr, dwLev, (LPBYTE)ajbu, dwSz, &dwNeeded)) {
- aji1 = (ADDJOB_INFO_1 *)ajbu; $? ". AddJob ok"
+#if DK3_CHAR_SIZE > 1
+ if(AddJobW(hPr, dwLev, (LPBYTE)ajbu, dwSz, &dwNeeded))
+#else
+ if(AddJobA(hPr, dwLev, (LPBYTE)ajbu, dwSz, &dwNeeded))
+#endif
+ {
+#if DK3_CHAR_SIZE > 1
+ aji1 = (ADDJOB_INFO_1W *)ajbu; $? ". AddJob ok"
+#else
+ aji1 = (ADDJOB_INFO_1A *)ajbu;
+#endif
if(aji1->Path) { $? ". path ok"
hFile = INVALID_HANDLE_VALUE;
dwAcc = GENERIC_WRITE;
dwSh = FILE_SHARE_READ;
dwDisp = CREATE_ALWAYS;
dwAttr = FILE_ATTRIBUTE_NORMAL;
- hFile = CreateFile(aji1->Path,dwAcc,dwSh,NULL,dwDisp,dwAttr,NULL);
+#if DK3_CHAR_SIZE > 1
+ hFile = CreateFileW(aji1->Path,dwAcc,dwSh,NULL,dwDisp,dwAttr,NULL);
+#else
+ hFile = CreateFileA(aji1->Path,dwAcc,dwSh,NULL,dwDisp,dwAttr,NULL);
+#endif
if(hFile != INVALID_HANDLE_VALUE) { $? ". create file ok"
if(dk3opt_get_num_args(j->opt) > 0) { $? ". have arguments"
nfn = dk3opt_get_num_args(j->opt);
@@ -518,7 +541,12 @@ dkwt_print_run(DKWT_PRINT_J *j)
}
} else { $? "! no device name, use default printer"
dwSz = DK3_SIZEOF(bu,dkChar);
- if(GetDefaultPrinter(bu, &dwSz)) { $? ". default printer found"
+#if DK3_CHAR_SIZE > 1
+ if(GetDefaultPrinterW(bu, &dwSz))
+#else
+ if(GetDefaultPrinterA(bu, &dwSz))
+#endif
+ { $? ". default printer found"
if(dwSz < DK3_SIZEOF(bu,dkChar)) {
bu[dwSz] = dkT('\0');
} else {
diff --git a/support/dktools/dkwt-to.c b/support/dktools/dkwt-to.c
index 1bec540ace..5cb2cb11cf 100644
--- a/support/dktools/dkwt-to.c
+++ b/support/dktools/dkwt-to.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwt-to.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwt-to.ctr
*/
/** @file dkwt-to.c The dkwt-to module.
@@ -281,24 +259,28 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
DWORD dwPreferredLength = MAX_PREFERRED_LENGTH;
DWORD dwFilter = 0; /* FILTER_NORMAL_ACCOUNT */
DWORD i = 0;
- LPTSTR pStringSid;
+#if DK3_CHAR_SIZE > 1
+ LPWSTR pStringSid;
+#else
+ LPASTR pStringSid;
+#endif
-#line 241 "dkwt-to.ctr"
+#line 245 "dkwt-to.ctr"
back = dk3_new_app(dkwt_account_list_t,1,app);
if(back) {
-#line 243 "dkwt-to.ctr"
+#line 247 "dkwt-to.ctr"
back->s_acc = NULL; back->i_acc = NULL;
back->s_acc = dk3sto_open_app(app);
if(back->s_acc) {
-#line 246 "dkwt-to.ctr"
+#line 250 "dkwt-to.ctr"
dk3sto_set_comp(back->s_acc, dkwt_tool_compare_accounts, 0);
back->i_acc = dk3sto_it_open(back->s_acc);
if(back->i_acc) {
-#line 249 "dkwt-to.ctr"
+#line 253 "dkwt-to.ctr"
ok = 1;
do {
pBuf = NULL;
@@ -312,50 +294,51 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
&dwEntriesRead,
&dwTotalEntries,
&dwResumeHandle
- );
+ );
+
-#line 263 "dkwt-to.ctr"
+#line 268 "dkwt-to.ctr"
if((NERR_Success == nStatus) || (ERROR_MORE_DATA == nStatus)) {
-#line 265 "dkwt-to.ctr"
+#line 270 "dkwt-to.ctr"
if(pBuf != NULL) {
-#line 266 "dkwt-to.ctr"
+#line 271 "dkwt-to.ctr"
pTmpBuf = pBuf;
for(i = 0; i < dwEntriesRead; i++) {
-#line 269 "dkwt-to.ctr"
+#line 274 "dkwt-to.ctr"
if(pTmpBuf->usri0_name) {
-#line 270 "dkwt-to.ctr"
+#line 275 "dkwt-to.ctr"
ap = dkwt_tool_open_account(pTmpBuf->usri0_name, app);
if(ap) {
-#line 272 "dkwt-to.ctr"
+#line 277 "dkwt-to.ctr"
if(!dk3sto_add(back->s_acc, (void *)ap)) {
ok = 0;
dkwt_tool_close_account(ap);
}
} else {
-#line 277 "dkwt-to.ctr"
+#line 282 "dkwt-to.ctr"
ok = 0;
}
} else {
-#line 280 "dkwt-to.ctr"
+#line 285 "dkwt-to.ctr"
}
pTmpBuf++;
}
} else {
-#line 284 "dkwt-to.ctr"
+#line 289 "dkwt-to.ctr"
}
} else {
-#line 286 "dkwt-to.ctr"
+#line 291 "dkwt-to.ctr"
}
if(pBuf != NULL) {
NetApiBufferFree(pBuf);
@@ -370,12 +353,14 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
dk3sto_it_reset(back->i_acc);
while((ap = (dkwt_account_t *)dk3sto_it_next(back->i_acc)) != NULL) {
pb4 = NULL;
- nStatus = NetUserGetInfo(NULL, ap->logname, (DWORD)4, (LPBYTE *)(&pb4));
+ nStatus = NetUserGetInfo(
+ NULL, ap->logname, (DWORD)4, (LPBYTE *)(&pb4)
+ );
if(NERR_Success == nStatus)
{
if(pb4) {
-#line 304 "dkwt-to.ctr"
+#line 311 "dkwt-to.ctr"
ap->f_long = 1;
ap->priv = pb4->usri4_priv;
ap->flags = pb4->usri4_flags;
@@ -384,7 +369,7 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
ap->codepage = pb4->usri4_code_page;
if(pb4->usri4_full_name) {
-#line 311 "dkwt-to.ctr"
+#line 318 "dkwt-to.ctr"
ap->fullname = dk3str_dup_app(pb4->usri4_full_name, app);
if(!(ap->fullname)) {
ok = 0;
@@ -392,7 +377,7 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
}
if(pb4->usri4_comment) {
-#line 317 "dkwt-to.ctr"
+#line 324 "dkwt-to.ctr"
ap->comment = dk3str_dup_app(pb4->usri4_comment, app);
if(!(ap->comment)) {
ok = 0;
@@ -418,9 +403,13 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
}
if(pb4->usri4_user_sid) {
-#line 341 "dkwt-to.ctr"
+#line 348 "dkwt-to.ctr"
pStringSid = NULL;
- if(ConvertSidToStringSid(pb4->usri4_user_sid, &pStringSid))
+#if DK3_CHAR_SIZE > 1
+ if(ConvertSidToStringSidW(pb4->usri4_user_sid, &pStringSid))
+#else
+ if(ConvertSidToStringSidA(pb4->usri4_user_sid, &pStringSid))
+#endif
{
if(pStringSid) {
ap->textsid = dk3str_dup_app(pStringSid, app);
@@ -434,11 +423,11 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
}
} else {
-#line 355 "dkwt-to.ctr"
+#line 366 "dkwt-to.ctr"
}
} else {
-#line 357 "dkwt-to.ctr"
+#line 368 "dkwt-to.ctr"
}
if(pb4) {
NetApiBufferFree(pb4);
@@ -448,21 +437,21 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
}
} else {
-#line 365 "dkwt-to.ctr"
+#line 376 "dkwt-to.ctr"
}
} else {
-#line 367 "dkwt-to.ctr"
+#line 378 "dkwt-to.ctr"
}
if(!ok) {
dkwt_tool_close_account_list(back); back = NULL;
}
} else {
-#line 372 "dkwt-to.ctr"
+#line 383 "dkwt-to.ctr"
}
-#line 373 "dkwt-to.ctr"
+#line 384 "dkwt-to.ctr"
return back;
}
@@ -494,6 +483,8 @@ dkwt_tool_get_account_from_list(dkwt_account_list_t *lp)
+#if VERSION_BEFORE_2019_10_20
+
/** Compare two group entries.
@param l Left entry.
@param r Right entry.
@@ -536,6 +527,8 @@ dkwt_group_compare(void *l, void *r, int cr)
return back;
}
+#endif
+
@@ -557,6 +550,8 @@ dkwt_tool_close_group(dkwt_group_t *gp)
+#if VERSION_BEFORE_2019_10_20
+
/** Open new group structure, allocate memory.
@param gn Group name.
@param app Application structure for diagnostics.
@@ -580,6 +575,9 @@ dkwt_tool_open_group(dkChar const *gn, dk3_app_t *app)
return back;
}
+#endif
+
+
void
dkwt_tool_reset_group_list(dkwt_group_list_t *glp)
@@ -701,10 +699,14 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
LOCALGROUP_INFO_0 *lgrptr;
LOCALGROUP_INFO_1 *lgr1ptr;
dkwt_group_t *newgroup;
- LPTSTR stringsid;
+#if DK3_CHAR_SIZE > 1
+ LPWSTR stringsid;
+#else
+ LPASTR stringsid;
+#endif
-#line 613 "dkwt-to.ctr"
+#line 637 "dkwt-to.ctr"
/*
Group information for network groups
*/
@@ -723,12 +725,12 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
if((ERROR_MORE_DATA == nStatus) || (NERR_Success == nStatus)) {
if(pBuf) {
-#line 630 "dkwt-to.ctr"
+#line 654 "dkwt-to.ctr"
grptr = (GROUP_INFO_0 *)pBuf;
for(i = 0; i < dwEntries; i++) {
if(grptr->grpi0_name) {
-#line 633 "dkwt-to.ctr"
+#line 657 "dkwt-to.ctr"
newgroup = dkwt_tool_group_open(grptr->grpi0_name, app);
if(newgroup) {
if(!dk3sto_add(gl->s_grp, newgroup)) {
@@ -794,10 +796,10 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
while((newgroup = (dkwt_group_t *)dk3sto_it_next(gl->i_grp)) != NULL) {
pBuf = NULL;
-#line 697 "dkwt-to.ctr"
+#line 721 "dkwt-to.ctr"
if(newgroup->gtype == DKWT_GROUP_LOCAL) {
-#line 698 "dkwt-to.ctr"
+#line 722 "dkwt-to.ctr"
dwLevel = 1;
pBuf = NULL;
nStatus = NetLocalGroupGetInfo(
@@ -808,11 +810,11 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
);
if(NERR_Success == nStatus) {
-#line 707 "dkwt-to.ctr"
+#line 731 "dkwt-to.ctr"
if(pBuf) {
lgr1ptr = (LOCALGROUP_INFO_1 *)pBuf;
if(lgr1ptr->lgrpi1_comment) {
- newgroup->comment = dk3str_dup_app(lgr1ptr->lgrpi1_comment, app);
+ newgroup->comment = dk3str_dup_app(lgr1ptr->lgrpi1_comment,app);
if(!(newgroup->comment)) {
back = 0;
}
@@ -826,7 +828,7 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
}
} else {
-#line 723 "dkwt-to.ctr"
+#line 747 "dkwt-to.ctr"
dwLevel = 3;
pBuf = NULL;
nStatus = NetGroupGetInfo(
@@ -837,7 +839,7 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
);
if(NERR_Success == nStatus) {
-#line 732 "dkwt-to.ctr"
+#line 756 "dkwt-to.ctr"
if(pBuf) {
gr3ptr = (GROUP_INFO_3 *)pBuf;
if(gr3ptr->grpi3_comment) {
@@ -846,7 +848,12 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
}
if(gr3ptr->grpi3_group_sid) {
stringsid = NULL;
- if(ConvertSidToStringSid(gr3ptr->grpi3_group_sid, &stringsid)) {
+#if DK3_CHAR_SIZE > 1
+ if(ConvertSidToStringSidW(gr3ptr->grpi3_group_sid, &stringsid))
+#else
+ if(ConvertSidToStringSidA(gr3ptr->grpi3_group_sid, &stringsid))
+#endif
+ {
if(stringsid) {
newgroup->textsid = dk3str_dup_app(stringsid, app);
if(!(newgroup->textsid)) { back = 0; }
@@ -867,7 +874,7 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
}
}
-#line 760 "dkwt-to.ctr"
+#line 789 "dkwt-to.ctr"
return back;
}
@@ -880,7 +887,7 @@ dkwt_tool_open_group_list(dk3_app_t *app, int f_long)
int ok = 0;
-#line 771 "dkwt-to.ctr"
+#line 800 "dkwt-to.ctr"
back = dk3_new_app(dkwt_group_list_t,1,app);
if(back) {
back->i_grp = NULL;
@@ -897,7 +904,7 @@ dkwt_tool_open_group_list(dk3_app_t *app, int f_long)
}
}
-#line 786 "dkwt-to.ctr"
+#line 815 "dkwt-to.ctr"
return back;
}
@@ -1053,44 +1060,65 @@ dkwt_tool_read_printer_list(
DWORD cbNeeded;
DWORD cbReturned;
DWORD i;
- PRINTER_INFO_2 *pi2;
+#if DK3_CHAR_SIZE > 1
+ PRINTER_INFO_2W *pi2;
+#else
+ PRINTER_INFO_2A *pi2;
+#endif
dkwt_printer_t *pr;
cbNeeded = (DWORD)0UL;
cbReturned = (DWORD)0UL;
-#line 946 "dkwt-to.ctr"
- EnumPrinters(
+#line 979 "dkwt-to.ctr"
+#if DK3_CHAR_SIZE > 1
+ EnumPrintersW(
+ PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &cbNeeded, &cbReturned
+ );
+#else
+ EnumPrintersA(
PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &cbNeeded, &cbReturned
);
+#endif
if(cbNeeded > 0) {
peb = dk3_new_app(char,(size_t)cbNeeded,app);
if(peb) {
szpeb = cbNeeded;
cbNeeded = (DWORD)0UL;
cbReturned = (DWORD)0UL;
- if(EnumPrinters(
+#if DK3_CHAR_SIZE > 1
+ if(EnumPrintersW(
+ PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)peb, szpeb, &cbNeeded, &cbReturned
+ )
+ )
+#else
+ if(EnumPrintersA(
PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)peb, szpeb, &cbNeeded, &cbReturned
)
)
+#endif
{
if(cbReturned > (DWORD)0UL) {
- pi2 = (PRINTER_INFO_2 *)peb;
+#if DK3_CHAR_SIZE > 1
+ pi2 = (PRINTER_INFO_2W *)peb;
+#else
+ pi2 = (PRINTER_INFO_2A *)peb;
+#endif
back = 1;
for(i = 0; i < cbReturned; i++) {
if(pi2->pPrinterName) {
-#line 965 "dkwt-to.ctr"
+#line 1015 "dkwt-to.ctr"
pr = dkwt_tool_printer_new(pi2->pPrinterName, app);
if(pr) {
-#line 967 "dkwt-to.ctr"
+#line 1017 "dkwt-to.ctr"
if(dk3sto_add(pl->s_prn, (void *)pr)) {
-#line 968 "dkwt-to.ctr"
+#line 1018 "dkwt-to.ctr"
if(f_long) {
-#line 969 "dkwt-to.ctr"
+#line 1019 "dkwt-to.ctr"
dkwt_tool_save_text(
&(pr->comment),
pi2->pComment,
@@ -1164,7 +1192,7 @@ dkwt_tool_read_printer_list(
pr->nJobs = pi2->cJobs;
} else {
-#line 1041 "dkwt-to.ctr"
+#line 1091 "dkwt-to.ctr"
}
} else {
dkwt_tool_printer_delete(pr);
@@ -1185,7 +1213,7 @@ dkwt_tool_read_printer_list(
dk3app_log_i1(app, DK3_LL_ERROR, 244);
}
-#line 1060 "dkwt-to.ctr"
+#line 1110 "dkwt-to.ctr"
return back;
}
@@ -1311,7 +1339,7 @@ dkwt_tool_reg_delete_tree(
)
{
long res = ERROR_NOT_SUPPORTED;
-#if _MSC_VER >= 1700 && (!(DK4_WINDOWS_LEGACY))
+#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0601)
#if DK3_CHAR_SIZE > 1
res = RegDeleteTreeW(hk, tn);
#else
@@ -1336,7 +1364,7 @@ dkwt_tool_reg_enum_key(
long res;
-#line 1209 "dkwt-to.ctr"
+#line 1259 "dkwt-to.ctr"
#if DK3_CHAR_SIZE > 1
res = RegEnumKeyExW(
hk, dwIndex, pResult, pDwSzResult,
@@ -1350,7 +1378,7 @@ dkwt_tool_reg_enum_key(
#endif
-#line 1221 "dkwt-to.ctr"
+#line 1271 "dkwt-to.ctr"
return res;
}
diff --git a/support/dktools/dkwt-to.ctr b/support/dktools/dkwt-to.ctr
index 7b79b5c271..3c06f51c42 100644
--- a/support/dktools/dkwt-to.ctr
+++ b/support/dktools/dkwt-to.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -236,7 +236,11 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
DWORD dwPreferredLength = MAX_PREFERRED_LENGTH;
DWORD dwFilter = 0; /* FILTER_NORMAL_ACCOUNT */
DWORD i = 0;
- LPTSTR pStringSid;
+#if DK3_CHAR_SIZE > 1
+ LPWSTR pStringSid;
+#else
+ LPASTR pStringSid;
+#endif
$? "+ dkwt_tool_open_account_list"
back = dk3_new_app(dkwt_account_list_t,1,app);
if(back) { $? ". back ok"
@@ -259,7 +263,8 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
&dwEntriesRead,
&dwTotalEntries,
&dwResumeHandle
- ); $? ". NetUserEnum returned %u", nStatus
+ );
+ $? ". NetUserEnum returned %u", nStatus
if((NERR_Success == nStatus) || (ERROR_MORE_DATA == nStatus)) {
$? ". status ok"
if(pBuf != NULL) { $? ". buffer ok"
@@ -297,7 +302,9 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
dk3sto_it_reset(back->i_acc);
while((ap = (dkwt_account_t *)dk3sto_it_next(back->i_acc)) != NULL) {
pb4 = NULL;
- nStatus = NetUserGetInfo(NULL, ap->logname, (DWORD)4, (LPBYTE *)(&pb4));
+ nStatus = NetUserGetInfo(
+ NULL, ap->logname, (DWORD)4, (LPBYTE *)(&pb4)
+ );
if(NERR_Success == nStatus)
{
if(pb4) { $? ". NetUserGetInfo() ok"
@@ -339,7 +346,11 @@ dkwt_tool_open_account_list(dk3_app_t *app, int f_long)
}
if(pb4->usri4_user_sid) { $? ". sid ok"
pStringSid = NULL;
- if(ConvertSidToStringSid(pb4->usri4_user_sid, &pStringSid))
+#if DK3_CHAR_SIZE > 1
+ if(ConvertSidToStringSidW(pb4->usri4_user_sid, &pStringSid))
+#else
+ if(ConvertSidToStringSidA(pb4->usri4_user_sid, &pStringSid))
+#endif
{
if(pStringSid) {
ap->textsid = dk3str_dup_app(pStringSid, app);
@@ -401,6 +412,8 @@ dkwt_tool_get_account_from_list(dkwt_account_list_t *lp)
+#if VERSION_BEFORE_2019_10_20
+
/** Compare two group entries.
@param l Left entry.
@param r Right entry.
@@ -443,6 +456,8 @@ dkwt_group_compare(void *l, void *r, int cr)
return back;
}
+#endif
+
@@ -464,6 +479,8 @@ dkwt_tool_close_group(dkwt_group_t *gp)
+#if VERSION_BEFORE_2019_10_20
+
/** Open new group structure, allocate memory.
@param gn Group name.
@param app Application structure for diagnostics.
@@ -487,6 +504,9 @@ dkwt_tool_open_group(dkChar const *gn, dk3_app_t *app)
return back;
}
+#endif
+
+
void
dkwt_tool_reset_group_list(dkwt_group_list_t *glp)
@@ -608,7 +628,11 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
LOCALGROUP_INFO_0 *lgrptr;
LOCALGROUP_INFO_1 *lgr1ptr;
dkwt_group_t *newgroup;
- LPTSTR stringsid;
+#if DK3_CHAR_SIZE > 1
+ LPWSTR stringsid;
+#else
+ LPASTR stringsid;
+#endif
$? "+ dkwt_tool_read_group_list"
/*
Group information for network groups
@@ -707,7 +731,7 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
if(pBuf) {
lgr1ptr = (LOCALGROUP_INFO_1 *)pBuf;
if(lgr1ptr->lgrpi1_comment) {
- newgroup->comment = dk3str_dup_app(lgr1ptr->lgrpi1_comment, app);
+ newgroup->comment = dk3str_dup_app(lgr1ptr->lgrpi1_comment,app);
if(!(newgroup->comment)) {
back = 0;
}
@@ -737,7 +761,12 @@ dkwt_tool_read_group_list(dkwt_group_list_t *gl, dk3_app_t *app, int f_long)
}
if(gr3ptr->grpi3_group_sid) {
stringsid = NULL;
- if(ConvertSidToStringSid(gr3ptr->grpi3_group_sid, &stringsid)) {
+#if DK3_CHAR_SIZE > 1
+ if(ConvertSidToStringSidW(gr3ptr->grpi3_group_sid, &stringsid))
+#else
+ if(ConvertSidToStringSidA(gr3ptr->grpi3_group_sid, &stringsid))
+#endif
+ {
if(stringsid) {
newgroup->textsid = dk3str_dup_app(stringsid, app);
if(!(newgroup->textsid)) { back = 0; }
@@ -938,27 +967,48 @@ dkwt_tool_read_printer_list(
DWORD cbNeeded;
DWORD cbReturned;
DWORD i;
- PRINTER_INFO_2 *pi2;
+#if DK3_CHAR_SIZE > 1
+ PRINTER_INFO_2W *pi2;
+#else
+ PRINTER_INFO_2A *pi2;
+#endif
dkwt_printer_t *pr;
cbNeeded = (DWORD)0UL;
cbReturned = (DWORD)0UL;
$? "+ dkwt_tool_read_printer_list %d", f_long
- EnumPrinters(
+#if DK3_CHAR_SIZE > 1
+ EnumPrintersW(
PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &cbNeeded, &cbReturned
);
+#else
+ EnumPrintersA(
+ PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &cbNeeded, &cbReturned
+ );
+#endif
if(cbNeeded > 0) {
peb = dk3_new_app(char,(size_t)cbNeeded,app);
if(peb) {
szpeb = cbNeeded;
cbNeeded = (DWORD)0UL;
cbReturned = (DWORD)0UL;
- if(EnumPrinters(
+#if DK3_CHAR_SIZE > 1
+ if(EnumPrintersW(
+ PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)peb, szpeb, &cbNeeded, &cbReturned
+ )
+ )
+#else
+ if(EnumPrintersA(
PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)peb, szpeb, &cbNeeded, &cbReturned
)
)
+#endif
{
if(cbReturned > (DWORD)0UL) {
- pi2 = (PRINTER_INFO_2 *)peb;
+#if DK3_CHAR_SIZE > 1
+ pi2 = (PRINTER_INFO_2W *)peb;
+#else
+ pi2 = (PRINTER_INFO_2A *)peb;
+#endif
back = 1;
for(i = 0; i < cbReturned; i++) {
if(pi2->pPrinterName) { $? ". \"%ls\"", pi2->pPrinterName
@@ -1182,7 +1232,7 @@ dkwt_tool_reg_delete_tree(
)
{
long res = ERROR_NOT_SUPPORTED;
-#if _MSC_VER >= 1700 && (!(DK4_WINDOWS_LEGACY))
+#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0601)
#if DK3_CHAR_SIZE > 1
res = RegDeleteTreeW(hk, tn);
#else
diff --git a/support/dktools/dkwt.c b/support/dktools/dkwt.c
index ba1e7e08bf..2c6e11febb 100644
--- a/support/dktools/dkwt.c
+++ b/support/dktools/dkwt.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwt.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwt.ctr
*/
/** @file dkwt.c The dkwt module.
@@ -755,7 +733,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -818,7 +796,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -881,7 +859,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -944,7 +922,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -997,7 +975,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1045,7 +1023,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1100,7 +1078,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1223,7 +1201,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1275,7 +1253,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1327,7 +1305,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1375,7 +1353,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1424,7 +1402,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1625,7 +1603,7 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwt/"),
dkT(""),
NULL
@@ -1643,8 +1621,6 @@ static dkChar const dkwt_group_name[] = { dkT("dktools") };
/** Print help text.
@param app Application structure.
- @param msg Array containing localized texts.
- @param noloc Array containing non-localized texts.
@param topic Help topic ID.
@return 1 on success, 0 on error.
*/
@@ -1652,8 +1628,6 @@ static
int
dkwt_help(
dk3_app_t *app,
- dkChar const * const *msg,
- dkChar const * const *noloc,
int topic
)
{
@@ -1718,10 +1692,10 @@ DK3_MAIN
dkChar const * const *xargv = NULL;
-#line 1737 "dkwt.ctr"
+#line 1733 "dkwt.ctr"
-#line 1738 "dkwt.ctr"
+#line 1734 "dkwt.ctr"
if((sizeof(dkChar) != 2) || (sizeof(TCHAR) != 2)) {
fprintf(stderr, "Wrong compiler options were used to build this program!\n");
fprintf(stderr, "Size of dkChar: %u\n", (unsigned)sizeof(dkChar));
@@ -1743,27 +1717,27 @@ DK3_MAIN
switch(dk3str_array_index(dkwt_commands, xargv[1], 0)) {
case 0: {
-#line 1758 "dkwt.ctr"
+#line 1754 "dkwt.ctr"
exval = dkwt_event(app, msg, dkwt_no_loc, 0);
} break;
case 1: {
-#line 1761 "dkwt.ctr"
+#line 1757 "dkwt.ctr"
exval = dkwt_event(app, msg, dkwt_no_loc, 1);
} break;
case 2: {
-#line 1764 "dkwt.ctr"
+#line 1760 "dkwt.ctr"
exval = dkwt_event(app, msg, dkwt_no_loc, 2);
} break;
case 3: {
-#line 1767 "dkwt.ctr"
+#line 1763 "dkwt.ctr"
exval = dkwt_event(app, msg, dkwt_no_loc, 3);
} break;
case 4: {
-#line 1770 "dkwt.ctr"
+#line 1766 "dkwt.ctr"
exval = dkwt_accounts(app, msg, dkwt_no_loc);
} break;
case 5: {
@@ -1781,7 +1755,7 @@ DK3_MAIN
topic = dk3str_array_index(dkwt_commands, xargv[2], 0);
if(topic < 0) topic = 8;
}
- exval = dkwt_help(app, msg, dkwt_no_loc, topic);
+ exval = dkwt_help(app, topic);
} break;
case 9: case 14: case 19: { /* version */
dk3sf_initialize_stdout();
@@ -1818,10 +1792,10 @@ DK3_MAIN
}
-#line 1823 "dkwt.ctr"
+#line 1819 "dkwt.ctr"
-#line 1824 "dkwt.ctr"
+#line 1820 "dkwt.ctr"
fflush(stdout);
exit(exval); return exval;
}
diff --git a/support/dktools/dkwt.ctr b/support/dktools/dkwt.ctr
index 1404208a77..37855f391a 100644
--- a/support/dktools/dkwt.ctr
+++ b/support/dktools/dkwt.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -799,7 +799,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -860,7 +860,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -921,7 +921,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -982,7 +982,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1033,7 +1033,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1079,7 +1079,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1132,7 +1132,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1253,7 +1253,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1303,7 +1303,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1353,7 +1353,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1399,7 +1399,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1446,7 +1446,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1645,7 +1645,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwt/
$!end
};
@@ -1660,8 +1660,6 @@ static dkChar const dkwt_group_name[] = { dkT("dktools") };
/** Print help text.
@param app Application structure.
- @param msg Array containing localized texts.
- @param noloc Array containing non-localized texts.
@param topic Help topic ID.
@return 1 on success, 0 on error.
*/
@@ -1669,8 +1667,6 @@ static
int
dkwt_help(
dk3_app_t *app,
- dkChar const * const *msg,
- dkChar const * const *noloc,
int topic
)
{
@@ -1784,7 +1780,7 @@ DK3_MAIN
topic = dk3str_array_index(dkwt_commands, xargv[2], 0);
if(topic < 0) topic = 8;
}
- exval = dkwt_help(app, msg, dkwt_no_loc, topic);
+ exval = dkwt_help(app, topic);
} break;
case 9: case 14: case 19: { /* version */
dk3sf_initialize_stdout();
diff --git a/support/dktools/dkwt.h b/support/dktools/dkwt.h
index e0d1a2123e..0d7a9f875e 100644
--- a/support/dktools/dkwt.h
+++ b/support/dktools/dkwt.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2011-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
/** @file dkwt.h Header file for the dkwt program.
*/
@@ -6,10 +11,14 @@
#define DKT3_H_INCLUDED 1
#include <lm.h>
-#include <Sddl.h>
+#include <sddl.h>
-#if (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
+#if (_WIN32) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
+#if defined(_MSC_VER)
#include <VersionHelpers.h>
+#else
+#include <versionhelpers.h>
+#endif
#endif
/** Description for one Windows account.
diff --git a/support/dktools/dkwt.rc b/support/dktools/dkwt.rc
index 70db260225..6a6eea29a7 100644
--- a/support/dktools/dkwt.rc
+++ b/support/dktools/dkwt.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Dirk Krause's Windows tool\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Dirk Krause's Windows tool\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dkwt\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dkwtadm.rc b/support/dktools/dkwtadm.rc
index c02ffb6b0d..47b6151818 100644
--- a/support/dktools/dkwtadm.rc
+++ b/support/dktools/dkwtadm.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Dirk Krause's Windows adm tool\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Dirk Krause's Windows adm tool\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dkwtadm\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dkwxpath.h b/support/dktools/dkwxpath.h
index 2185bcc73b..e24eafd5df 100644
--- a/support/dktools/dkwxpath.h
+++ b/support/dktools/dkwxpath.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DKWXPATH_H_INCLUDED
#define DKWXPATH_H_INCLUDED 1
@@ -9,7 +13,9 @@
*/
#define DK3_USE_WX 1
+#ifndef DK3_ALL_H_INCLUDED
#include <dk3all.h>
+#endif
#include <wx/wxprec.h>
#ifdef __BORLANDC__
diff --git a/support/dktools/dkwxpath.rc b/support/dktools/dkwxpath.rc
index 40a8e37a83..2d951c593c 100644
--- a/support/dktools/dkwxpath.rc
+++ b/support/dktools/dkwxpath.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkctinst.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Path setup during installation\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Path setup during installation\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dkwxpath\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/dkwxpqdc.h b/support/dktools/dkwxpqdc.h
index 12963cf0ef..926112b3f0 100644
--- a/support/dktools/dkwxpqdc.h
+++ b/support/dktools/dkwxpqdc.h
@@ -1,4 +1,7 @@
-
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef DKWXPQDC_H_INCLUDED
#define DKWXPQDC_H_INCLUDED 1
@@ -9,7 +12,10 @@
*/
#define DK3_USE_WX 1
+#ifndef DK3_ALL_H_INCLUDED
#include <dk3all.h>
+#endif
+
#include <dk3sock.h>
#include <printqds.h>
#if 0
diff --git a/support/dktools/dkwxtrace.h b/support/dktools/dkwxtrace.h
index 62b543728c..015f2e54f8 100644
--- a/support/dktools/dkwxtrace.h
+++ b/support/dktools/dkwxtrace.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
/** @file dkwxtrace.h Header file for dkwxtrace.
*/
@@ -13,8 +17,9 @@
*/
#define DK3_USE_WX 1
-
+#ifndef DK3_ALL_H_INCLUDED
#include <dk3all.h>
+#endif
#include <wx/wxprec.h>
#ifdef __BORLANDC__
diff --git a/support/dktools/dkwxwiz.c b/support/dktools/dkwxwiz.c
index 2c1ae67791..ba797783ee 100644
--- a/support/dktools/dkwxwiz.c
+++ b/support/dktools/dkwxwiz.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: dkwxwiz.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: dkwxwiz.ctr
*/
/** @file dkwxwiz.c The dkwxwiz module.
@@ -44,11 +22,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dkt-version.h"
#endif
#include "dk4vers.h"
+#include "dk3unused.h"
-#line 18 "dkwxwiz.ctr"
+#line 19 "dkwxwiz.ctr"
@@ -97,6 +76,7 @@ typedef struct {
/** Macros like $program$ are allowed in the templates.
+ Macro names consist only of characters, digits and underscores.
*/
static char const * const dkwxwiz_macros[] = {
/* 0 */
@@ -120,7 +100,7 @@ static char const * const dkwxwiz_macros[] = {
NULL
-#line 94 "dkwxwiz.ctr"
+#line 96 "dkwxwiz.ctr"
};
@@ -203,7 +183,7 @@ dkT("dkwxwizv.txt"),
NULL
-#line 199 "dkwxwiz.ctr"
+#line 201 "dkwxwiz.ctr"
};
@@ -292,7 +272,7 @@ dkT("\"!"),
NULL
-#line 279 "dkwxwiz.ctr"
+#line 281 "dkwxwiz.ctr"
};
@@ -332,7 +312,7 @@ dkT(""),
NULL
-#line 317 "dkwxwiz.ctr"
+#line 319 "dkwxwiz.ctr"
};
@@ -434,7 +414,7 @@ dkT("i.e. to set a default copyright owner and a default license type."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/dkwxwiz%20manual/"),
dkT(""),
dkT("AUTHOR"),
dkT(""),
@@ -448,7 +428,7 @@ dkT("to view the license conditions."),
NULL
-#line 431 "dkwxwiz.ctr"
+#line 433 "dkwxwiz.ctr"
};
@@ -473,7 +453,7 @@ dkwxwiz_job_init(DKWXWIZ_JOB *job, dk3_app_t *app, dkChar const * const *msg)
job->ffn = NULL;
job->ifn = NULL;
job->rfn = NULL;
- job->exv = 1;
+ job->exv = EXIT_FAILURE;
job->cmd = 0;
job->frc = 0;
job->obj = 0;
@@ -497,7 +477,7 @@ dkwxwiz_concatenate(DKWXWIZ_JOB *job, dkChar const *bn, dkChar const *sf)
dkChar const *back = NULL;
-#line 478 "dkwxwiz.ctr"
+#line 480 "dkwxwiz.ctr"
if(DK3_SIZEOF(buf,dkChar) > (dk3str_len(bn) + dk3str_len(sf))) {
dk3str_cpy_not_overlapped(buf, bn);
dk3str_cat(buf, sf);
@@ -507,7 +487,7 @@ dkwxwiz_concatenate(DKWXWIZ_JOB *job, dkChar const *bn, dkChar const *sf)
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 6, 7, bn);
}
-#line 486 "dkwxwiz.ctr"
+#line 488 "dkwxwiz.ctr"
return back;
}
@@ -524,7 +504,7 @@ dkwxwiz_build_file_names(DKWXWIZ_JOB *job)
int back = 0;
-#line 501 "dkwxwiz.ctr"
+#line 503 "dkwxwiz.ctr"
job->pfn = dkwxwiz_concatenate(job, job->pName, dkwxwiz_nl[0]);
job->afn = dkwxwiz_concatenate(job, job->aName, dkwxwiz_nl[1]);
job->ffn = dkwxwiz_concatenate(job, job->fName, dkwxwiz_nl[2]);
@@ -537,7 +517,7 @@ dkwxwiz_build_file_names(DKWXWIZ_JOB *job)
}
}
-#line 512 "dkwxwiz.ctr"
+#line 514 "dkwxwiz.ctr"
return back;
}
@@ -556,7 +536,7 @@ dkwxwiz_check_one_filename(DKWXWIZ_JOB *job, dkChar const *fn)
int back = 0;
-#line 529 "dkwxwiz.ctr"
+#line 531 "dkwxwiz.ctr"
if(0 == dk3sf_stat_app(&stb, fn, NULL)) {
back = 1;
} else {
@@ -564,7 +544,7 @@ dkwxwiz_check_one_filename(DKWXWIZ_JOB *job, dkChar const *fn)
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 8, 9, fn);
}
-#line 535 "dkwxwiz.ctr"
+#line 537 "dkwxwiz.ctr"
return back;
}
@@ -581,7 +561,7 @@ dkwxwiz_check_filenames(DKWXWIZ_JOB *job)
int back = 0;
-#line 550 "dkwxwiz.ctr"
+#line 552 "dkwxwiz.ctr"
if(job->frc) {
back = 1;
} else {
@@ -615,7 +595,7 @@ dkwxwiz_check_filenames(DKWXWIZ_JOB *job)
}
}
-#line 582 "dkwxwiz.ctr"
+#line 584 "dkwxwiz.ctr"
return back;
}
@@ -629,7 +609,11 @@ dkwxwiz_check_filenames(DKWXWIZ_JOB *job)
*/
static
int
-dkwxwiz_write_c8_string(DKWXWIZ_JOB *job, FILE *dfile, dkChar const *txt)
+dkwxwiz_write_c8_string(
+ DKWXWIZ_JOB * DK3_ARG_UNUSED(job),
+ FILE *dfile,
+ dkChar const *txt
+)
{
#if DK3_CHAR_SIZE > 1
char buf[1024]; /* Temporary buffer for output. */
@@ -639,7 +623,7 @@ dkwxwiz_write_c8_string(DKWXWIZ_JOB *job, FILE *dfile, dkChar const *txt)
int res = 0;
-#line 604 "dkwxwiz.ctr"
+#line 610 "dkwxwiz.ctr"
res = dk3str_to_c8p_app(
buf, sizeof(buf), txt, dk3app_get_encoding(job->app), job->app
);
@@ -648,16 +632,39 @@ dkwxwiz_write_c8_string(DKWXWIZ_JOB *job, FILE *dfile, dkChar const *txt)
back = 1;
}
-#line 611 "dkwxwiz.ctr"
+#line 617 "dkwxwiz.ctr"
#else
-#line 613 "dkwxwiz.ctr"
+#line 619 "dkwxwiz.ctr"
fputs(txt, dfile);
back = 1;
-#line 615 "dkwxwiz.ctr"
+#line 621 "dkwxwiz.ctr"
#endif
+ DK3_UNUSED_ARG(job)
+ return back;
+}
+
+
+
+static
+int
+not_a_macro(char const *str)
+{
+ int back = 0;
+ while (('\0' != *str) && (0 == back)) {
+ if (('a' > *str) || ('z' < *str)) {
+ if (('A' > *str) || ('Z' < *str)) {
+ if (('_' != *str) && ('0' != *str)) {
+ if (('1' > *str) || ('9' < *str)) {
+ back = 1;
+ }
+ }
+ }
+ }
+ str++;
+ }
return back;
}
@@ -666,7 +673,6 @@ dkwxwiz_write_c8_string(DKWXWIZ_JOB *job, FILE *dfile, dkChar const *txt)
/** Process one macro.
@param job Job structure.
@param dfile Output (destination) file.
- @param sfile Input (source) file.
@param cptr Start of text.
@param p1 First '$' character.
@param p2 Second '$' character.
@@ -677,7 +683,6 @@ int
dkwxwiz_one_macro(
DKWXWIZ_JOB *job,
FILE *dfile,
- FILE *sfile,
char *cptr,
char *p1,
char *p2
@@ -741,11 +746,13 @@ dkwxwiz_one_macro(
} break;
default: {
/* ERROR: Unknown macro */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ if (0 == not_a_macro(p1)) {
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ back = 0;
+ }
fputc('$', dfile);
fputs(p1, dfile);
fputc('$', dfile);
- back = 0;
} break;
}
return back;
@@ -802,7 +809,7 @@ dkwxwiz_transfer_file(DKWXWIZ_JOB *job, FILE *dfile, FILE *sfile, int iswin)
int back = 1;
-#line 759 "dkwxwiz.ctr"
+#line 788 "dkwxwiz.ctr"
oldsourceline = dk3app_get_source_line(job->app);
while(fgets(buf, sizeof(buf), sfile)) {
lineno++;
@@ -819,7 +826,7 @@ dkwxwiz_transfer_file(DKWXWIZ_JOB *job, FILE *dfile, FILE *sfile, int iswin)
if(p1) {
p2 = dk3str_c8_chr(&(p1[1]), '$');
if(p2) {
- if(!dkwxwiz_one_macro(job, dfile, sfile, cptr, p1, p2)) {
+ if(!dkwxwiz_one_macro(job, dfile, cptr, p1, p2)) {
back = 0;
}
cptr = ++p2;
@@ -835,7 +842,7 @@ dkwxwiz_transfer_file(DKWXWIZ_JOB *job, FILE *dfile, FILE *sfile, int iswin)
default: {
p2 = dk3str_c8_chr(&(p1[1]), '$');
if(p2) {
- if(!dkwxwiz_one_macro(job, dfile, sfile, cptr, p1, p2)) {
+ if(!dkwxwiz_one_macro(job, dfile, cptr, p1, p2)) {
back = 0;
}
cptr = ++p2;
@@ -856,7 +863,7 @@ dkwxwiz_transfer_file(DKWXWIZ_JOB *job, FILE *dfile, FILE *sfile, int iswin)
if(p1) {
p2 = dk3str_c8_chr(&(p1[1]), '$');
if(p2) {
- if(!dkwxwiz_one_macro(job, dfile, sfile, cptr, p1, p2)) {
+ if(!dkwxwiz_one_macro(job, dfile, cptr, p1, p2)) {
back = 0;
}
cptr = p2;
@@ -880,7 +887,7 @@ dkwxwiz_transfer_file(DKWXWIZ_JOB *job, FILE *dfile, FILE *sfile, int iswin)
dk3app_set_source_line(job->app, oldsourceline);
-#line 835 "dkwxwiz.ctr"
+#line 864 "dkwxwiz.ctr"
return back;
}
@@ -912,25 +919,31 @@ dkwxwiz_one_output_file(
int back = 0;
-#line 865 "dkwxwiz.ctr"
+#line 894 "dkwxwiz.ctr"
+
+
+#line 895 "dkwxwiz.ctr"
+
+
+#line 896 "dkwxwiz.ctr"
oldsourcename = dk3app_get_source_file(job->app);
sres = dk3app_find_config_file_revers(job->app, sn, 0);
if(sres) {
-#line 868 "dkwxwiz.ctr"
+#line 899 "dkwxwiz.ctr"
dk3search_reset(sres);
srcname = dk3search_next(sres);
if(srcname) {
-#line 871 "dkwxwiz.ctr"
+#line 902 "dkwxwiz.ctr"
sfile = dk3sf_fopen_app(srcname, dkwxwiz_nl[6], job->app);
if(sfile) {
-#line 873 "dkwxwiz.ctr"
+#line 904 "dkwxwiz.ctr"
dfile = dk3sf_fopen_app(dn, dkwxwiz_nl[(isbin) ? 12 : 7], job->app);
if(dfile) {
-#line 875 "dkwxwiz.ctr"
+#line 906 "dkwxwiz.ctr"
dk3app_set_source_file(job->app, sn);
back = dkwxwiz_transfer_file(job, dfile, sfile, iswin);
if(!dk3sf_fclose_fn_app(dfile, dn, job->app)) {
@@ -938,28 +951,28 @@ dkwxwiz_one_output_file(
}
} else {
-#line 881 "dkwxwiz.ctr"
+#line 912 "dkwxwiz.ctr"
}
fclose(sfile);
} else {
-#line 884 "dkwxwiz.ctr"
+#line 915 "dkwxwiz.ctr"
}
} else {
-#line 886 "dkwxwiz.ctr"
+#line 917 "dkwxwiz.ctr"
/* ERROR: File sn not found! */
dk3app_log_i3(job->app, DK3_LL_ERROR, 150, 151, sn);
}
dk3search_close(sres);
} else {
-#line 891 "dkwxwiz.ctr"
+#line 922 "dkwxwiz.ctr"
}
dk3app_set_source_file(job->app, oldsourcename);
-#line 894 "dkwxwiz.ctr"
+#line 925 "dkwxwiz.ctr"
return back;
}
@@ -1030,49 +1043,69 @@ dkwxwiz_produce_output(DKWXWIZ_JOB *job)
{
-#line 963 "dkwxwiz.ctr"
+#line 994 "dkwxwiz.ctr"
if(dkwxwiz_one_output_file(job, job->pfn, dkwxwiz_nl[3], 0, 0))
- {
+ {
+
+#line 996 "dkwxwiz.ctr"
if(dkwxwiz_one_output_file(job, job->afn, dkwxwiz_nl[4], 0, 0))
- {
+ {
+
+#line 998 "dkwxwiz.ctr"
if(dkwxwiz_one_output_file(job, job->ffn, dkwxwiz_nl[5], 0, 0))
- {
+ {
+
+#line 1000 "dkwxwiz.ctr"
if(dkwxwiz_one_output_file(job, dkwxwiz_nl[8], dkwxwiz_nl[10], 0, 0))
- {
+ {
+
+#line 1002 "dkwxwiz.ctr"
if(dkwxwiz_one_output_file(job, dkwxwiz_nl[9], dkwxwiz_nl[11],0,0))
- {
+ {
+
+#line 1004 "dkwxwiz.ctr"
if(dkwxwiz_one_output_file(job, job->xfn, dkwxwiz_nl[16], 1, 0))
- {
+ {
+
+#line 1006 "dkwxwiz.ctr"
if(dkwxwiz_copy_binary(job, job->ifn, dkwxwiz_nl[18])) {
+
+
+#line 1008 "dkwxwiz.ctr"
if(dkwxwiz_one_output_file(job,dkwxwiz_nl[22],dkwxwiz_nl[23],1,1))
- {
+ {
+
+#line 1010 "dkwxwiz.ctr"
if(dkwxwiz_one_output_file(job,job->rfn,dkwxwiz_nl[21],1,1)) {
- job->exv = 0;
+
+
+#line 1012 "dkwxwiz.ctr"
+ job->exv = EXIT_SUCCESS;
/* You should provide the following files: */
dk3sf_initialize_stdout();
dk3sf_fputs((job->msg)[12], stdout);
dk3sf_fputc(dkT('\n'), stdout);
/* Windows help file: */
dk3sf_fputs((job->msg)[13], stdout);
- dk3sf_fputs(job->aName, stdout);
+ dk3sf_fputs(job->pName, stdout);
dk3sf_fputs((job->msg)[18], stdout);
dk3sf_fputs((job->msg)[17], stdout);
dk3sf_fputc(dkT('\n'), stdout);
/* non-Windows help file: */
dk3sf_fputs((job->msg)[14], stdout);
- dk3sf_fputs(job->aName, stdout);
+ dk3sf_fputs(job->pName, stdout);
dk3sf_fputs((job->msg)[19], stdout);
dk3sf_fputs((job->msg)[17], stdout);
dk3sf_fputc(dkT('\n'), stdout);
/* Windows icon file (ico) */
dk3sf_fputs((job->msg)[15], stdout);
- dk3sf_fputs(job->aName, stdout);
+ dk3sf_fputs(job->pName, stdout);
dk3sf_fputs((job->msg)[20], stdout);
dk3sf_fputs((job->msg)[17], stdout);
dk3sf_fputc(dkT('\n'), stdout);
/* non-Windows icon file (xpm) */
dk3sf_fputs((job->msg)[16], stdout);
- dk3sf_fputs(job->aName, stdout);
+ dk3sf_fputs(job->pName, stdout);
dk3sf_fputs((job->msg)[21], stdout);
dk3sf_fputs((job->msg)[17], stdout);
dk3sf_fputc(dkT('\n'), stdout);
@@ -1086,7 +1119,7 @@ dkwxwiz_produce_output(DKWXWIZ_JOB *job)
}
}
-#line 1017 "dkwxwiz.ctr"
+#line 1050 "dkwxwiz.ctr"
}
@@ -1129,13 +1162,12 @@ dkwxwiz_valid_identifier_char(char c, int isfirst)
/** Check ASCII string whether it contains a C/C++ identifier
- @param job Job structure.
@param txt Text to check.
@return 1 on success, 0 on error.
*/
static
int
-dkwxwiz_check_ascii_c_identifier(DKWXWIZ_JOB *job, char const *txt)
+dkwxwiz_check_ascii_c_identifier(char const *txt)
{
char const *cptr; /* Current character to process. */
int isfirst = 1; /* Flag: Is first character. */
@@ -1171,7 +1203,7 @@ dkwxwiz_check_one_c_identifier(DKWXWIZ_JOB *job, dkChar const *txt)
buf, sizeof(buf), txt, dk3app_get_encoding(job->app), NULL
);
if(res) {
- if(dkwxwiz_check_ascii_c_identifier(job, buf)) {
+ if(dkwxwiz_check_ascii_c_identifier(buf)) {
back = 1;
} else {
/* ERROR: Not a C/C++ identifier! */
@@ -1219,7 +1251,7 @@ dkwxwiz_run_with_names(DKWXWIZ_JOB *job)
{
-#line 1148 "dkwxwiz.ctr"
+#line 1180 "dkwxwiz.ctr"
if(dkwxwiz_build_file_names(job)) {
if(dkwxwiz_check_filenames(job)) {
if(dkwxwiz_check_c_identifiers(job)) {
@@ -1235,7 +1267,7 @@ dkwxwiz_run_with_names(DKWXWIZ_JOB *job)
dk3_release(job->rfn);
-#line 1162 "dkwxwiz.ctr"
+#line 1194 "dkwxwiz.ctr"
}
@@ -1250,7 +1282,7 @@ dkwxwiz_run_normally(DKWXWIZ_JOB *job)
int nargs; /* Number of command line arguments. */
-#line 1175 "dkwxwiz.ctr"
+#line 1207 "dkwxwiz.ctr"
nargs = dk3opt_get_num_args(job->opt);
if(3 <= nargs) {
job->pName = dk3opt_get_arg(job->opt, 0);
@@ -1277,7 +1309,7 @@ dkwxwiz_run_normally(DKWXWIZ_JOB *job)
dk3app_help(job->app, dkwxwiz_msg[3], dkwxwiz_help_text);
}
-#line 1200 "dkwxwiz.ctr"
+#line 1232 "dkwxwiz.ctr"
}
@@ -1292,7 +1324,7 @@ dkwxwiz_run(DKWXWIZ_JOB *job)
dkChar const * const *sptr; /* Pointer to traverse text. */
-#line 1213 "dkwxwiz.ctr"
+#line 1245 "dkwxwiz.ctr"
job->opt = dk3opt_open_from_app(
dkwxwiz_options,
dkwxwiz_sz_options,
@@ -1341,7 +1373,7 @@ dkwxwiz_run(DKWXWIZ_JOB *job)
job->opt = NULL;
}
-#line 1260 "dkwxwiz.ctr"
+#line 1292 "dkwxwiz.ctr"
}
@@ -1360,14 +1392,14 @@ DK3_MAIN
-#line 1277 "dkwxwiz.ctr"
+#line 1309 "dkwxwiz.ctr"
-#line 1278 "dkwxwiz.ctr"
+#line 1310 "dkwxwiz.ctr"
#if DK3_HAVE_TZSET
tzset();
#endif
- job.exv = 1;
+ job.exv = EXIT_FAILURE;
app = dk3app_open_command(
argc, (dkChar const * const *)argv, dkwxwiz_msg[1]
);
@@ -1383,10 +1415,10 @@ DK3_MAIN
exval = job.exv;
-#line 1296 "dkwxwiz.ctr"
+#line 1328 "dkwxwiz.ctr"
-#line 1297 "dkwxwiz.ctr"
+#line 1329 "dkwxwiz.ctr"
fflush(stdout);
exit(exval); return exval;
}
diff --git a/support/dktools/dkwxwiz.ctr b/support/dktools/dkwxwiz.ctr
index 2c3b7f03cf..450b781336 100644
--- a/support/dktools/dkwxwiz.ctr
+++ b/support/dktools/dkwxwiz.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -12,6 +12,7 @@ license = bsd
#include "dkt-version.h"
#endif
#include "dk4vers.h"
+#include "dk3unused.h"
$!trace-include
@@ -63,6 +64,7 @@ typedef struct {
/** Macros like $program$ are allowed in the templates.
+ Macro names consist only of characters, digits and underscores.
*/
static char const * const dkwxwiz_macros[] = {
$!string-table
@@ -416,7 +418,7 @@ i.e. to set a default copyright owner and a default license type.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/dkwxwiz%20manual/
AUTHOR
@@ -452,7 +454,7 @@ dkwxwiz_job_init(DKWXWIZ_JOB *job, dk3_app_t *app, dkChar const * const *msg)
job->ffn = NULL;
job->ifn = NULL;
job->rfn = NULL;
- job->exv = 1;
+ job->exv = EXIT_FAILURE;
job->cmd = 0;
job->frc = 0;
job->obj = 0;
@@ -592,7 +594,11 @@ dkwxwiz_check_filenames(DKWXWIZ_JOB *job)
*/
static
int
-dkwxwiz_write_c8_string(DKWXWIZ_JOB *job, FILE *dfile, dkChar const *txt)
+dkwxwiz_write_c8_string(
+ DKWXWIZ_JOB * DK3_ARG_UNUSED(job),
+ FILE *dfile,
+ dkChar const *txt
+)
{
#if DK3_CHAR_SIZE > 1
char buf[1024]; /* Temporary buffer for output. */
@@ -613,6 +619,29 @@ dkwxwiz_write_c8_string(DKWXWIZ_JOB *job, FILE *dfile, dkChar const *txt)
fputs(txt, dfile);
back = 1; $? "- dkwxwiz_write_c8_string %d", back
#endif
+ DK3_UNUSED_ARG(job)
+ return back;
+}
+
+
+
+static
+int
+not_a_macro(char const *str)
+{
+ int back = 0;
+ while (('\0' != *str) && (0 == back)) {
+ if (('a' > *str) || ('z' < *str)) {
+ if (('A' > *str) || ('Z' < *str)) {
+ if (('_' != *str) && ('0' != *str)) {
+ if (('1' > *str) || ('9' < *str)) {
+ back = 1;
+ }
+ }
+ }
+ }
+ str++;
+ }
return back;
}
@@ -621,7 +650,6 @@ dkwxwiz_write_c8_string(DKWXWIZ_JOB *job, FILE *dfile, dkChar const *txt)
/** Process one macro.
@param job Job structure.
@param dfile Output (destination) file.
- @param sfile Input (source) file.
@param cptr Start of text.
@param p1 First '$' character.
@param p2 Second '$' character.
@@ -632,7 +660,6 @@ int
dkwxwiz_one_macro(
DKWXWIZ_JOB *job,
FILE *dfile,
- FILE *sfile,
char *cptr,
char *p1,
char *p2
@@ -696,11 +723,13 @@ dkwxwiz_one_macro(
} break;
default: {
/* ERROR: Unknown macro */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ if (0 == not_a_macro(p1)) {
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ back = 0;
+ }
fputc('$', dfile);
fputs(p1, dfile);
fputc('$', dfile);
- back = 0;
} break;
}
return back;
@@ -772,7 +801,7 @@ dkwxwiz_transfer_file(DKWXWIZ_JOB *job, FILE *dfile, FILE *sfile, int iswin)
if(p1) {
p2 = dk3str_c8_chr(&(p1[1]), '$');
if(p2) {
- if(!dkwxwiz_one_macro(job, dfile, sfile, cptr, p1, p2)) {
+ if(!dkwxwiz_one_macro(job, dfile, cptr, p1, p2)) {
back = 0;
}
cptr = ++p2;
@@ -788,7 +817,7 @@ dkwxwiz_transfer_file(DKWXWIZ_JOB *job, FILE *dfile, FILE *sfile, int iswin)
default: {
p2 = dk3str_c8_chr(&(p1[1]), '$');
if(p2) {
- if(!dkwxwiz_one_macro(job, dfile, sfile, cptr, p1, p2)) {
+ if(!dkwxwiz_one_macro(job, dfile, cptr, p1, p2)) {
back = 0;
}
cptr = ++p2;
@@ -809,7 +838,7 @@ dkwxwiz_transfer_file(DKWXWIZ_JOB *job, FILE *dfile, FILE *sfile, int iswin)
if(p1) {
p2 = dk3str_c8_chr(&(p1[1]), '$');
if(p2) {
- if(!dkwxwiz_one_macro(job, dfile, sfile, cptr, p1, p2)) {
+ if(!dkwxwiz_one_macro(job, dfile, cptr, p1, p2)) {
back = 0;
}
cptr = p2;
@@ -862,6 +891,8 @@ dkwxwiz_one_output_file(
dkChar const *oldsourcename; /* Old source file name. */
int back = 0;
$? "+ dkwxwiz_one_output_file"
+ $? ". destination %!ds", dn
+ $? ". source %!ds", sn
oldsourcename = dk3app_get_source_file(job->app);
sres = dk3app_find_config_file_revers(job->app, sn, 0);
if(sres) { $? ". source found"
@@ -961,47 +992,49 @@ dkwxwiz_produce_output(DKWXWIZ_JOB *job)
{
$? "+ dkwxwiz_produce_output"
if(dkwxwiz_one_output_file(job, job->pfn, dkwxwiz_nl[3], 0, 0))
- {
+ { $? ". 1"
if(dkwxwiz_one_output_file(job, job->afn, dkwxwiz_nl[4], 0, 0))
- {
+ { $? ". 2"
if(dkwxwiz_one_output_file(job, job->ffn, dkwxwiz_nl[5], 0, 0))
- {
+ { $? ". 3"
if(dkwxwiz_one_output_file(job, dkwxwiz_nl[8], dkwxwiz_nl[10], 0, 0))
- {
+ { $? ". 4"
if(dkwxwiz_one_output_file(job, dkwxwiz_nl[9], dkwxwiz_nl[11],0,0))
- {
+ { $? ". 5"
if(dkwxwiz_one_output_file(job, job->xfn, dkwxwiz_nl[16], 1, 0))
- {
+ { $? ". 6"
if(dkwxwiz_copy_binary(job, job->ifn, dkwxwiz_nl[18])) {
+ $? ". 7"
if(dkwxwiz_one_output_file(job,dkwxwiz_nl[22],dkwxwiz_nl[23],1,1))
- {
+ { $? ". 8"
if(dkwxwiz_one_output_file(job,job->rfn,dkwxwiz_nl[21],1,1)) {
- job->exv = 0;
+ $? ". 9"
+ job->exv = EXIT_SUCCESS;
/* You should provide the following files: */
dk3sf_initialize_stdout();
dk3sf_fputs((job->msg)[12], stdout);
dk3sf_fputc(dkT('\n'), stdout);
/* Windows help file: */
dk3sf_fputs((job->msg)[13], stdout);
- dk3sf_fputs(job->aName, stdout);
+ dk3sf_fputs(job->pName, stdout);
dk3sf_fputs((job->msg)[18], stdout);
dk3sf_fputs((job->msg)[17], stdout);
dk3sf_fputc(dkT('\n'), stdout);
/* non-Windows help file: */
dk3sf_fputs((job->msg)[14], stdout);
- dk3sf_fputs(job->aName, stdout);
+ dk3sf_fputs(job->pName, stdout);
dk3sf_fputs((job->msg)[19], stdout);
dk3sf_fputs((job->msg)[17], stdout);
dk3sf_fputc(dkT('\n'), stdout);
/* Windows icon file (ico) */
dk3sf_fputs((job->msg)[15], stdout);
- dk3sf_fputs(job->aName, stdout);
+ dk3sf_fputs(job->pName, stdout);
dk3sf_fputs((job->msg)[20], stdout);
dk3sf_fputs((job->msg)[17], stdout);
dk3sf_fputc(dkT('\n'), stdout);
/* non-Windows icon file (xpm) */
dk3sf_fputs((job->msg)[16], stdout);
- dk3sf_fputs(job->aName, stdout);
+ dk3sf_fputs(job->pName, stdout);
dk3sf_fputs((job->msg)[21], stdout);
dk3sf_fputs((job->msg)[17], stdout);
dk3sf_fputc(dkT('\n'), stdout);
@@ -1056,13 +1089,12 @@ dkwxwiz_valid_identifier_char(char c, int isfirst)
/** Check ASCII string whether it contains a C/C++ identifier
- @param job Job structure.
@param txt Text to check.
@return 1 on success, 0 on error.
*/
static
int
-dkwxwiz_check_ascii_c_identifier(DKWXWIZ_JOB *job, char const *txt)
+dkwxwiz_check_ascii_c_identifier(char const *txt)
{
char const *cptr; /* Current character to process. */
int isfirst = 1; /* Flag: Is first character. */
@@ -1098,7 +1130,7 @@ dkwxwiz_check_one_c_identifier(DKWXWIZ_JOB *job, dkChar const *txt)
buf, sizeof(buf), txt, dk3app_get_encoding(job->app), NULL
);
if(res) {
- if(dkwxwiz_check_ascii_c_identifier(job, buf)) {
+ if(dkwxwiz_check_ascii_c_identifier(buf)) {
back = 1;
} else {
/* ERROR: Not a C/C++ identifier! */
@@ -1278,7 +1310,7 @@ DK3_MAIN
#if DK3_HAVE_TZSET
tzset();
#endif
- job.exv = 1;
+ job.exv = EXIT_FAILURE;
app = dk3app_open_command(
argc, (dkChar const * const *)argv, dkwxwiz_msg[1]
);
diff --git a/support/dktools/dkwxwiz.ico b/support/dktools/dkwxwiz.ico
new file mode 100644
index 0000000000..e014c844b3
--- /dev/null
+++ b/support/dktools/dkwxwiz.ico
Binary files differ
diff --git a/support/dktools/dkwxwiz.rc b/support/dktools/dkwxwiz.rc
index 9ba1da2cd9..00726c6c6f 100644
--- a/support/dktools/dkwxwiz.rc
+++ b/support/dktools/dkwxwiz.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Project wizard\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Project wizard\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "dkwxwiz\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/etc-dk3app/dk3paper.conf b/support/dktools/etc-dk3app/dk3paper.conf
index 21eb0e5a1e..ad203d1a1e 100644
--- a/support/dktools/etc-dk3app/dk3paper.conf
+++ b/support/dktools/etc-dk3app/dk3paper.conf
@@ -1,3 +1,28 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# WARNING: DO NOT MODIFY THIS FILE!
+# ---------------------------------
+# Create a copy in the /usr/local/etc/dk3app-site directory or alike
+# and edit the copy.
+# This file is maintained by the package management, so your changes
+# may be lost during package updates.
+
+# Paper size names are case sensitive, we can have both A4 and a4.
+
+# Sizes are specified in PS points, in LaTeX called bp.
+# For each paper size we have to configure 2, 4 or 6 integer values.
+# 2 values: Width, height.
+# 4 values: Width, height, left and right border, top and bottom border.
+# 6 values: Width, height, left border, right border, top border, bottom
+# border.
+
+# Convention: If the first character in the name is an uppercase
+# character (i.e. in A4, Legal or 10X14) the full paper is used
+# without any border.
+# If the first character in the name is a lowercase character
+# (i.e. in a4, legal or 10x14) we have unused borders.
+
A3 = 842 1190
A5 = 420 595
A6 = 297 420
@@ -23,3 +48,8 @@ executive = 540 720 56 28 14 14
folio = 612 936 56 28 14 14
quarto = 610 780 56 28 14 14
10x14 = 720 1008 56 28 14 14
+a3landscape = 1190 842 56 28 14 14
+a4landscape = 842 595 42 28 14 14
+a5landscape = 595 420 42 28 14 14
+a6landscape = 420 297 42 28 14 14
+
diff --git a/support/dktools/etc-dk4app/dk4gra.conf b/support/dktools/etc-dk4app/dk4gra.conf
new file mode 100644
index 0000000000..b6fda78e59
--- /dev/null
+++ b/support/dktools/etc-dk4app/dk4gra.conf
@@ -0,0 +1,211 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# DO NOT MODIFY THIS FILE!
+#
+# To customize settings, create a copy of this file in the /etc/dk4app-site or
+# C:\Program Files\Krause\etc\dk4app-site directory or the in ${HOME}/.dk4app
+# directory and edit the copy. Create the directories if necessary.
+#
+# This file is under package managements control and may be replaced with
+# new versions during package updates.
+# Files in the directories mentioned above are untouched during package
+# updates.
+#
+# Your copy only needs to contain the sections and settings you want to
+# overwrite.
+#
+# Cumulative processing is used for processing dk4gra.conf files:
+# - Settings in files processed later overwrite settings in files
+# processed earlier.
+# - Settings later in a file overwrite settings made earlier in the file.
+
+
+
+# General setup
+# =============
+# This section applies to all drivers and purposes.
+
+[*]
+
+# Color usage
+# -----------
+# Boolean, "on"/"yes"/"true" or "off"/"no"/"false".
+# Allow colored output.
+#
+color = on
+
+# Alpha channel use
+# -----------------
+# What to do with alpha channel data if the output type does not support
+# an alpha channel:
+# - mix
+# Use alpha channel to mix foreground and background.
+# - foreground
+# Juse use the foreground data.
+#
+use alpha channel = mix
+
+# Default image background
+# ------------------------
+# Set of the integer numbers in the range 0...255 to indicate
+# the red, green, and blue components of the default image background.
+# The default image background is used for images containing
+# transparency/opacity information if the image file does not contain
+# information about the background color.
+#
+image background = 255 255 255
+
+# Force use of default image background
+# -------------------------------------
+# Boolean, controls whether or not the default image background is used
+# even if the image file contains background color information.
+#
+force image background = no
+
+# Image interpolation
+# -------------------
+# Boolean, allow or deny to set the interpolation flag for bitmap images.
+# The interpolation flag allows PDF/PS rendering software to create an
+# optimized representation of the image.
+#
+image interpolation = yes
+
+# Directly use DCT encoded data from JPEG files
+# ---------------------------------------------
+# Boolean, allow or deny the direct use of DCT encoded data from JPEG files.
+# Using the DCT encoded data directly avoids the process of image decoding
+# and encoding to flate/LZW/run-length, so it saves both processing time
+# and output size.
+#
+use dct encoded data = yes
+
+# Allow image interpolation for DCT encoded data
+# ----------------------------------------------
+# Boolean, allow or deny to set the image interpolation flag when directly
+# using DCT encoded data from a JPEG file.
+#
+dct image interpolation = no
+
+# Analyze bits per component
+# --------------------------
+# Boolean, allow or deny to analyze and reduce the number of bits per
+# component. The number of bits per component is only reduced if there
+# is no quality loss in the reduction.
+#
+analyze bits per component = yes
+
+# Analyze color usage
+# -------------------
+# Boolean, allow or deny to analyze color usage in an image.
+# If all pixels have R=G=B or C=M=Y we can reduce the image to a grayscaled
+# image.
+#
+analyze colors = yes
+
+# Analyze alpha channel usage
+# ---------------------------
+# Boolean, allow or deny to analyze alpha channel usage in an image.
+# If all pixels are set to full opacity, we can ignore the alpha channel
+# in further processing.
+#
+analyze alpha = yes
+
+# Ignore resolution chunk
+# -----------------------
+# Boolean, allow or deny to ignore resolution information in a
+# bitmap image file.
+#
+ignore resolution = no
+
+# X-spline quality
+# ----------------
+# Unsigned integer, number of Bezier segments to draw for each
+# X-spline segment.
+#
+x-spline sub segments = 8
+
+# Tolerance for iterative segment length calculation
+# --------------------------------------------------
+# Floating point (double) value. Iteration is stopped when the difference
+# between current pass result and previous pass result is below the specified
+# limit.
+x-spline length precision = 1.0e-3
+
+# Tolerance for parameter calculation
+# -----------------------------------
+# Floating point (double) value. Iteration is stopped when the difference
+# between the current pass result and the target value is below the specified
+# limit.
+x-spline parameter precision = 4.0e-3
+
+
+
+# Settings for PS
+# ===============
+# The settings in this section are only applied if the output language
+# is "ps" or "eps".
+
+[ps]
+
+# PS language level
+# -----------------
+# The PS language level is either 2 or 3.
+#
+level = 3
+
+# LZW compression
+# ---------------
+# Boolean, allow or deny the use of LZW compression when producing
+# PS level 2 output.
+#
+lzw = no
+
+
+
+# Settings for purpose document
+# =============================
+# The settings in this section are only applied if the output purpose
+# is "document".
+
+[document]
+
+# Paper size
+# ----------
+# String, one of the paper formats configured in the dk3paper.conf and/or
+# dk4paper.conf files.
+#
+paper size = a4
+
+# Duplex printing (use front side and back side of paper)
+# -------------------------------------------------------
+# Boolean, allow or deny duplex printing.
+# Duplex printing means using both front side and back side of paper.
+# Duplex printing without tumble means producing a book.
+#
+duplex = yes
+
+# Tumble when duplex printing
+# ---------------------------
+# Boolean, allow or deny tumble when duplex printing.
+# Duplex printing without tumble means producing a book.
+# Duplex printing with tumble means producing something like a calendar.
+#
+tumble = no
+
+
+
+# Settings for language ps and purpose document
+# =============================================
+# The settings in this section are only applied if the output language
+# is "ps" and the output purpose is "document".
+
+[ps.document]
+
+# Document structuring comments
+# -----------------------------
+# Boolean, controls whether or not to write document structuring comments
+# to output.
+#
+dsc = yes
+
diff --git a/support/dktools/ex-sto.c b/support/dktools/ex-sto.c
index 9686117dfc..aaf94a7fb5 100644
--- a/support/dktools/ex-sto.c
+++ b/support/dktools/ex-sto.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: ex-sto.ctr
+Copyright (C) 2011-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2011-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: ex-sto.ctr
*/
diff --git a/support/dktools/ex-sto.ctr b/support/dktools/ex-sto.ctr
index 5290392b4e..04d3f284ce 100644
--- a/support/dktools/ex-sto.ctr
+++ b/support/dktools/ex-sto.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2011-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/exit-program.xpm b/support/dktools/exit-program.xpm
deleted file mode 100644
index 8bb58d67fb..0000000000
--- a/support/dktools/exit-program.xpm
+++ /dev/null
@@ -1,39 +0,0 @@
-/* XPM */
-static const char *xpm_exit_program[] = {
-/* width height ncolors chars_per_pixel */
-"16 15 17 1",
-/* colors */
-" c #AFAFAF",
-". c #FEF9F9",
-"X c #E88787",
-"o c #D31919",
-"O c #8E0000",
-"+ c #642525",
-"@ c #CF0000",
-"# c #A39393",
-"$ c #A6A6A6",
-"% c #880505",
-"& c #5E0303",
-"* c #727272",
-"= c #FFFFFF",
-"- c #F2BABA",
-"; c #EBEBEB",
-": c #BFBFBF",
-"> c None",
-/* pixels */
-">>>>>>>>>>>>>>>>",
-">>>>>>>>>>>>>>>>",
-">>>>&%%%%$$*>>>>",
-">>>>O@@@@== >>>>",
-">>>>O@@@@== >>>>",
-">>>>O@@@@== >>>>",
-">>>>O@@@@== >>>>",
-">>>>O@@@@== >>>>",
-">>>>O@@@@== >>>>",
-">>>>O@@@@== >>>>",
-">>>>O@@o-== >>>>",
-">>>>O@X.=== >>>>",
-">>>>+#$$$$$*>>>>",
-">>>>>>>>>>>>>>>>",
-">>>>>>>>>>>>>>>>"
-};
diff --git a/support/dktools/f2leps.c b/support/dktools/f2leps.c
index aea321a2c2..1229140b13 100644
--- a/support/dktools/f2leps.c
+++ b/support/dktools/f2leps.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2leps.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2leps.ctr
*/
/** @file f2leps.c The f2leps module.
@@ -53,11 +31,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3font.h"
#include "dk3bm.h"
#include "dk3bmeps.h"
+#include "dk3unused.h"
+
-#line 704 "f2leps.ctr"
+#line 706 "f2leps.ctr"
@@ -98,7 +78,7 @@ static char const * const f2leps_font_reencode_2[] = {
NULL
-#line 743 "f2leps.ctr"
+#line 745 "f2leps.ctr"
};
#else
/** Font reencoding to write ISO-LATIN-1 encoded strings.
@@ -136,7 +116,7 @@ static char const * const f2leps_font_reencode_2[] = {
NULL
-#line 779 "f2leps.ctr"
+#line 781 "f2leps.ctr"
};
#endif
@@ -164,7 +144,7 @@ static char const * const f2leps_right_aligned_text[] = {
NULL
-#line 805 "f2leps.ctr"
+#line 807 "f2leps.ctr"
};
@@ -192,7 +172,7 @@ static char const * const f2leps_centered_aligned_text[] = {
NULL
-#line 831 "f2leps.ctr"
+#line 833 "f2leps.ctr"
};
#else
@@ -223,7 +203,7 @@ static char const * const f2leps_right_aligned_text[] = {
NULL
-#line 860 "f2leps.ctr"
+#line 862 "f2leps.ctr"
};
@@ -255,7 +235,7 @@ static char const * const f2leps_centered_aligned_text[] = {
NULL
-#line 890 "f2leps.ctr"
+#line 892 "f2leps.ctr"
};
#endif
@@ -291,7 +271,7 @@ char const * const f2leps_c8_kw[] = {
"0 0 %ld %ld\n",
/* 8 */
-"%%Creator: http://dktools.sourceforge.net\n",
+"%%Creator: http://sourceforge.net/p/dktools/wiki/fig2lat/\n",
/* 9 */
"%%Title: Converted Fig image\n",
@@ -428,7 +408,7 @@ char const * const f2leps_c8_kw[] = {
NULL
-#line 1114 "f2leps.ctr"
+#line 1116 "f2leps.ctr"
};
@@ -439,7 +419,7 @@ NULL
/* ************************************************************************ */
-#line 1120 "f2leps.ctr"
+#line 1122 "f2leps.ctr"
@@ -635,11 +615,12 @@ static
void
f2leps_file_footer(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
FILE *of,
int pure
)
{
+ DK3_UNUSED_ARG(drw)
if(pure) {
/* end */
fputs(f2leps_c8_kw[18], of);
@@ -739,7 +720,7 @@ void
f2leps_image_object(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_fig_obj_t *obj,
dk3_bb_t *outbb,
int drawdir,
@@ -747,13 +728,14 @@ f2leps_image_object(
)
{
int res = 0;
+ DK3_UNUSED_ARG(drw)
res = dk3bm_ps_place_object(
of,outbb,drawdir,(obj->dt).pol.fn,job->app,job->pslevel,ec
);
if(!(res)) {
job->exval = FIG2LAT_EXIT_ERROR_UNKNOWN;
-#line 1432 "f2leps.ctr"
+#line 1436 "f2leps.ctr"
}
}
@@ -773,14 +755,16 @@ void
f2leps_set_line_style(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int ls,
double sv,
double lw
)
{
double gw; /* Gap width. */
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
gw = f2lto_find_gap_length(job, lw, sv);
switch(ls) {
case DK3_FIG_LS_DASHED: {
@@ -835,7 +819,7 @@ f2leps_debug(
/* ************************************************************************ */
-#line 1509 "f2leps.ctr"
+#line 1515 "f2leps.ctr"
int
@@ -849,43 +833,43 @@ f2leps_eps_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
int ff;
-#line 1521 "f2leps.ctr"
+#line 1527 "f2leps.ctr"
drw->dsd = (void *)(pdi = f2leps_drawing_info_new(job, 1));
if(drw->dsd) {
-#line 1523 "f2leps.ctr"
+#line 1529 "f2leps.ctr"
oldsourcename = dk3app_get_source_file(job->app);
oldsourceline = dk3app_get_source_line(job->app);
pdi->shortOutFile = dk3fig_tool_short_output_file_name(job->on2, job->app);
if(pdi->shortOutFile) {
-#line 1527 "f2leps.ctr"
+#line 1533 "f2leps.ctr"
back = 1;
-#line 1528 "f2leps.ctr"
+#line 1534 "f2leps.ctr"
dk3sto_it_reset(drw->iobj);
while(NULL != (pobj = (dk3_fig_obj_t *)dk3sto_it_next(drw->iobj))) {
-#line 1531 "f2leps.ctr"
+#line 1537 "f2leps.ctr"
dk3app_set_source_line(job->app, pobj->li);
switch(pobj->ot) {
case DK3_FIG_OBJ_TEXT: {
-#line 1534 "f2leps.ctr"
+#line 1540 "f2leps.ctr"
ff = (pobj->dt).txt.ff;
if(!(ff & DK3_FIG_FONT_FLAG_HIDDEN)) {
-#line 1536 "f2leps.ctr"
+#line 1542 "f2leps.ctr"
if(!(ff & DK3_FIG_FONT_FLAG_SPECIAL)) {
-#line 1537 "f2leps.ctr"
+#line 1543 "f2leps.ctr"
if(ff & DK3_FIG_FONT_FLAG_PS) {
-#line 1538 "f2leps.ctr"
+#line 1544 "f2leps.ctr"
if(job->ntf) {
-#line 1539 "f2leps.ctr"
+#line 1545 "f2leps.ctr"
pobj->dsd = (void *)f2l_tool_register_font(
pdi->sFonts, pdi->iFonts, &(pdi->nFonts),
(pobj->dt).txt.fo, (pobj->dt).txt.fs, job->app
@@ -894,11 +878,11 @@ f2leps_eps_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
back = 0;
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1546 "f2leps.ctr"
+#line 1552 "f2leps.ctr"
}
} else {
-#line 1548 "f2leps.ctr"
+#line 1554 "f2leps.ctr"
}
}
}
@@ -908,39 +892,43 @@ f2leps_eps_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
}
} else {
-#line 1556 "f2leps.ctr"
+#line 1562 "f2leps.ctr"
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1557 "f2leps.ctr"
+#line 1563 "f2leps.ctr"
}
dk3app_set_source_file(job->app, oldsourcename);
dk3app_set_source_line(job->app, oldsourceline);
} else {
-#line 1561 "f2leps.ctr"
+#line 1567 "f2leps.ctr"
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1562 "f2leps.ctr"
+#line 1568 "f2leps.ctr"
}
-#line 1563 "f2leps.ctr"
+#line 1569 "f2leps.ctr"
return back;
}
void
-f2leps_eps_with_tex_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2leps_eps_with_tex_end(
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t *drw
+)
{
-#line 1572 "f2leps.ctr"
+#line 1581 "f2leps.ctr"
+ DK3_UNUSED_ARG(job)
if(drw->dsd) {
f2leps_drawing_info_delete((f2leps_drawing_info_t *)(drw->dsd));
}
-#line 1576 "f2leps.ctr"
+#line 1586 "f2leps.ctr"
}
@@ -951,7 +939,7 @@ f2leps_eps_with_tex_open_output_files(f2l_job_t *job)
int back = 0;
-#line 1585 "f2leps.ctr"
+#line 1595 "f2leps.ctr"
job->of1 = dk3sf_fopen_app(job->on1, dkT("w"), job->app);
if(job->of1) {
job->of2 = dk3sf_fopen_app(job->on2, dkT("wb"), job->app);
@@ -960,16 +948,16 @@ f2leps_eps_with_tex_open_output_files(f2l_job_t *job)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1592 "f2leps.ctr"
+#line 1602 "f2leps.ctr"
}
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1595 "f2leps.ctr"
+#line 1605 "f2leps.ctr"
}
-#line 1597 "f2leps.ctr"
+#line 1607 "f2leps.ctr"
return back;
}
@@ -980,7 +968,7 @@ f2leps_eps_with_tex_close_output_files(f2l_job_t *job)
{
-#line 1606 "f2leps.ctr"
+#line 1616 "f2leps.ctr"
if(job->of2) {
dk3sf_fclose_app(job->of2, job->app);
} job->of2 = NULL;
@@ -989,7 +977,7 @@ f2leps_eps_with_tex_close_output_files(f2l_job_t *job)
} job->of1 = NULL;
-#line 1613 "f2leps.ctr"
+#line 1623 "f2leps.ctr"
}
@@ -1001,15 +989,15 @@ f2leps_eps_with_tex_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
int back = 1;
-#line 1623 "f2leps.ctr"
+#line 1633 "f2leps.ctr"
pdi = (f2leps_drawing_info_t *)(drw->dsd);
f2leps_file_header(job, drw, job->of2, 0);
f2l_tool_start_tex_part(
- job->of1, job, drw, pdi->shortOutFile, pdi->iFonts, pdi->nFonts
+ job->of1, job, pdi->shortOutFile, pdi->iFonts, pdi->nFonts
);
-#line 1629 "f2leps.ctr"
+#line 1639 "f2leps.ctr"
return back;
}
@@ -1020,12 +1008,12 @@ f2leps_eps_with_tex_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
-#line 1638 "f2leps.ctr"
+#line 1648 "f2leps.ctr"
f2leps_file_footer(job, drw, job->of2, 0);
f2l_tool_end_tex_part(job->of1);
-#line 1641 "f2leps.ctr"
+#line 1651 "f2leps.ctr"
}
@@ -1063,10 +1051,12 @@ f2leps_eps_with_tex_image_object(
void
f2leps_eps_with_tex_newpath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[21], job->of2);
}
@@ -1075,12 +1065,14 @@ f2leps_eps_with_tex_newpath(
void
f2leps_eps_with_tex_moveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[25], x, y);
}
@@ -1089,12 +1081,14 @@ f2leps_eps_with_tex_moveto(
void
f2leps_eps_with_tex_lineto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[26], x, y);
}
@@ -1103,8 +1097,8 @@ f2leps_eps_with_tex_lineto(
void
f2leps_eps_with_tex_curveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double xcs,
double ycs,
double xce,
@@ -1113,6 +1107,8 @@ f2leps_eps_with_tex_curveto(
double ye
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[27], xcs, ycs, xce, yce, xe, ye);
}
@@ -1121,10 +1117,12 @@ f2leps_eps_with_tex_curveto(
void
f2leps_eps_with_tex_closepath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[28], job->of2);
}
@@ -1133,10 +1131,12 @@ f2leps_eps_with_tex_closepath(
void
f2leps_eps_with_tex_fill(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[29], job->of2);
}
@@ -1145,10 +1145,12 @@ f2leps_eps_with_tex_fill(
void
f2leps_eps_with_tex_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[30], job->of2);
}
@@ -1157,10 +1159,12 @@ f2leps_eps_with_tex_clip(
void
f2leps_eps_with_tex_stroke(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[31], job->of2);
}
@@ -1169,10 +1173,12 @@ f2leps_eps_with_tex_stroke(
void
f2leps_eps_with_tex_gsave(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[15], job->of2);
}
@@ -1181,10 +1187,12 @@ f2leps_eps_with_tex_gsave(
void
f2leps_eps_with_tex_grestore(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[16], job->of2);
}
@@ -1193,13 +1201,15 @@ f2leps_eps_with_tex_grestore(
void
f2leps_eps_with_tex_setcolor(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double r,
double g,
double b
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[32], r, g, b);
}
@@ -1208,11 +1218,13 @@ f2leps_eps_with_tex_setcolor(
void
f2leps_eps_with_tex_set_line_width(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double lw
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[33], lw);
}
@@ -1235,11 +1247,13 @@ f2leps_eps_with_tex_set_line_style(
void
f2leps_eps_with_tex_set_line_end(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int le
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[34], le);
}
@@ -1248,11 +1262,13 @@ f2leps_eps_with_tex_set_line_end(
void
f2leps_eps_with_tex_set_line_join(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int lj
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[35], lj);
}
@@ -1261,10 +1277,11 @@ f2leps_eps_with_tex_set_line_join(
void
f2leps_eps_with_tex_set_color_1(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
+ DK3_UNUSED_ARG(drw)
fprintf(job->of2, f2leps_c8_kw[32], rgb->r, rgb->g, rgb->b);
}
@@ -1273,10 +1290,11 @@ f2leps_eps_with_tex_set_color_1(
void
f2leps_eps_with_tex_set_color_2(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
+ DK3_UNUSED_ARG(drw)
fprintf(job->of2, f2leps_c8_kw[32], rgb->r, rgb->g, rgb->b);
}
@@ -1299,7 +1317,7 @@ f2leps_eps_with_tex_debug(
/* ************************************************************************ */
-#line 1910 "f2leps.ctr"
+#line 1950 "f2leps.ctr"
int
@@ -1368,7 +1386,7 @@ f2leps_eps_pure_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1977 "f2leps.ctr"
+#line 2017 "f2leps.ctr"
}
return back;
}
@@ -1376,8 +1394,12 @@ f2leps_eps_pure_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
void
-f2leps_eps_pure_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2leps_eps_pure_end(
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t *drw
+)
{
+ DK3_UNUSED_ARG(job)
if(drw->dsd) {
f2leps_drawing_info_delete((f2leps_drawing_info_t *)(drw->dsd));
}
@@ -1395,7 +1417,7 @@ f2leps_eps_pure_open_output_files(f2l_job_t *job)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 2002 "f2leps.ctr"
+#line 2046 "f2leps.ctr"
}
return back;
}
@@ -1576,7 +1598,7 @@ f2leps_eps_pure_text_object(
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYNTAX);
-#line 2181 "f2leps.ctr"
+#line 2225 "f2leps.ctr"
}
}
}
@@ -1600,10 +1622,12 @@ f2leps_eps_pure_image_object(
void
f2leps_eps_pure_newpath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[21], job->of1);
}
@@ -1612,12 +1636,14 @@ f2leps_eps_pure_newpath(
void
f2leps_eps_pure_moveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[25], x, y);
}
@@ -1626,12 +1652,14 @@ f2leps_eps_pure_moveto(
void
f2leps_eps_pure_lineto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[26], x, y);
}
@@ -1640,8 +1668,8 @@ f2leps_eps_pure_lineto(
void
f2leps_eps_pure_curveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double xcs,
double ycs,
double xce,
@@ -1650,6 +1678,8 @@ f2leps_eps_pure_curveto(
double ye
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[27], xcs, ycs, xce, yce, xe, ye);
}
@@ -1658,10 +1688,12 @@ f2leps_eps_pure_curveto(
void
f2leps_eps_pure_closepath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[28], job->of1);
}
@@ -1670,10 +1702,12 @@ f2leps_eps_pure_closepath(
void
f2leps_eps_pure_fill(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[29], job->of1);
}
@@ -1682,10 +1716,12 @@ f2leps_eps_pure_fill(
void
f2leps_eps_pure_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[30], job->of1);
}
@@ -1694,10 +1730,12 @@ f2leps_eps_pure_clip(
void
f2leps_eps_pure_stroke(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[31], job->of1);
}
@@ -1706,10 +1744,12 @@ f2leps_eps_pure_stroke(
void
f2leps_eps_pure_gsave(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[15], job->of1);
}
@@ -1718,10 +1758,12 @@ f2leps_eps_pure_gsave(
void
f2leps_eps_pure_grestore(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[16], job->of1);
}
@@ -1730,13 +1772,15 @@ f2leps_eps_pure_grestore(
void
f2leps_eps_pure_setcolor(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double r,
double g,
double b
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[32], r, g, b);
}
@@ -1745,11 +1789,13 @@ f2leps_eps_pure_setcolor(
void
f2leps_eps_pure_set_line_width(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double lw
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[33], lw);
}
@@ -1773,11 +1819,13 @@ f2leps_eps_pure_set_line_style(
void
f2leps_eps_pure_set_line_end(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int le
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[34], le);
}
@@ -1786,11 +1834,13 @@ f2leps_eps_pure_set_line_end(
void
f2leps_eps_pure_set_line_join(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int lj
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[35], lj);
}
@@ -1799,10 +1849,11 @@ f2leps_eps_pure_set_line_join(
void
f2leps_eps_pure_set_color_1(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
+ DK3_UNUSED_ARG(drw)
fprintf(job->of1, f2leps_c8_kw[32], rgb->r, rgb->g, rgb->b);
}
@@ -1811,10 +1862,11 @@ f2leps_eps_pure_set_color_1(
void
f2leps_eps_pure_set_color_2(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
+ DK3_UNUSED_ARG(drw)
fprintf(job->of1, f2leps_c8_kw[32], rgb->r, rgb->g, rgb->b);
}
diff --git a/support/dktools/f2leps.ctr b/support/dktools/f2leps.ctr
index 6f88bf8ceb..2cf68ecf58 100644
--- a/support/dktools/f2leps.ctr
+++ b/support/dktools/f2leps.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -698,6 +698,8 @@ f2leps_eps_pure_debug(
#include "dk3font.h"
#include "dk3bm.h"
#include "dk3bmeps.h"
+#include "dk3unused.h"
+
$!trace-include
@@ -933,7 +935,7 @@ $!string-table
#
# 8: Creator string
#
-\%%Creator: http://dktools.sourceforge.net\n
+\%%Creator: http://sourceforge.net/p/dktools/wiki/fig2lat/\n
#
# 9: Title string.
#
@@ -1312,11 +1314,12 @@ static
void
f2leps_file_footer(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
FILE *of,
int pure
)
{
+ DK3_UNUSED_ARG(drw)
if(pure) {
/* end */
fputs(f2leps_c8_kw[18], of);
@@ -1416,7 +1419,7 @@ void
f2leps_image_object(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_fig_obj_t *obj,
dk3_bb_t *outbb,
int drawdir,
@@ -1424,6 +1427,7 @@ f2leps_image_object(
)
{
int res = 0;
+ DK3_UNUSED_ARG(drw)
res = dk3bm_ps_place_object(
of,outbb,drawdir,(obj->dt).pol.fn,job->app,job->pslevel,ec
);
@@ -1448,14 +1452,16 @@ void
f2leps_set_line_style(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int ls,
double sv,
double lw
)
{
double gw; /* Gap width. */
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
gw = f2lto_find_gap_length(job, lw, sv);
switch(ls) {
case DK3_FIG_LS_DASHED: {
@@ -1566,9 +1572,13 @@ f2leps_eps_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
void
-f2leps_eps_with_tex_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2leps_eps_with_tex_end(
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t *drw
+)
{
$? "+ f2leps_eps_with_tex_end"
+ DK3_UNUSED_ARG(job)
if(drw->dsd) {
f2leps_drawing_info_delete((f2leps_drawing_info_t *)(drw->dsd));
}
@@ -1623,7 +1633,7 @@ f2leps_eps_with_tex_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
pdi = (f2leps_drawing_info_t *)(drw->dsd);
f2leps_file_header(job, drw, job->of2, 0);
f2l_tool_start_tex_part(
- job->of1, job, drw, pdi->shortOutFile, pdi->iFonts, pdi->nFonts
+ job->of1, job, pdi->shortOutFile, pdi->iFonts, pdi->nFonts
);
$? "- f2leps_eps_with_tex_start_processing %d", back
return back;
@@ -1675,10 +1685,12 @@ f2leps_eps_with_tex_image_object(
void
f2leps_eps_with_tex_newpath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[21], job->of2);
}
@@ -1687,12 +1699,14 @@ f2leps_eps_with_tex_newpath(
void
f2leps_eps_with_tex_moveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[25], x, y);
}
@@ -1701,12 +1715,14 @@ f2leps_eps_with_tex_moveto(
void
f2leps_eps_with_tex_lineto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[26], x, y);
}
@@ -1715,8 +1731,8 @@ f2leps_eps_with_tex_lineto(
void
f2leps_eps_with_tex_curveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double xcs,
double ycs,
double xce,
@@ -1725,6 +1741,8 @@ f2leps_eps_with_tex_curveto(
double ye
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[27], xcs, ycs, xce, yce, xe, ye);
}
@@ -1733,10 +1751,12 @@ f2leps_eps_with_tex_curveto(
void
f2leps_eps_with_tex_closepath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[28], job->of2);
}
@@ -1745,10 +1765,12 @@ f2leps_eps_with_tex_closepath(
void
f2leps_eps_with_tex_fill(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[29], job->of2);
}
@@ -1757,10 +1779,12 @@ f2leps_eps_with_tex_fill(
void
f2leps_eps_with_tex_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[30], job->of2);
}
@@ -1769,10 +1793,12 @@ f2leps_eps_with_tex_clip(
void
f2leps_eps_with_tex_stroke(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[31], job->of2);
}
@@ -1781,10 +1807,12 @@ f2leps_eps_with_tex_stroke(
void
f2leps_eps_with_tex_gsave(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[15], job->of2);
}
@@ -1793,10 +1821,12 @@ f2leps_eps_with_tex_gsave(
void
f2leps_eps_with_tex_grestore(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[16], job->of2);
}
@@ -1805,13 +1835,15 @@ f2leps_eps_with_tex_grestore(
void
f2leps_eps_with_tex_setcolor(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double r,
double g,
double b
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[32], r, g, b);
}
@@ -1820,11 +1852,13 @@ f2leps_eps_with_tex_setcolor(
void
f2leps_eps_with_tex_set_line_width(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double lw
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[33], lw);
}
@@ -1847,11 +1881,13 @@ f2leps_eps_with_tex_set_line_style(
void
f2leps_eps_with_tex_set_line_end(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int le
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[34], le);
}
@@ -1860,11 +1896,13 @@ f2leps_eps_with_tex_set_line_end(
void
f2leps_eps_with_tex_set_line_join(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int lj
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of2, f2leps_c8_kw[35], lj);
}
@@ -1873,10 +1911,11 @@ f2leps_eps_with_tex_set_line_join(
void
f2leps_eps_with_tex_set_color_1(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
+ DK3_UNUSED_ARG(drw)
fprintf(job->of2, f2leps_c8_kw[32], rgb->r, rgb->g, rgb->b);
}
@@ -1885,10 +1924,11 @@ f2leps_eps_with_tex_set_color_1(
void
f2leps_eps_with_tex_set_color_2(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
+ DK3_UNUSED_ARG(drw)
fprintf(job->of2, f2leps_c8_kw[32], rgb->r, rgb->g, rgb->b);
}
@@ -1981,8 +2021,12 @@ f2leps_eps_pure_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
void
-f2leps_eps_pure_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2leps_eps_pure_end(
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t *drw
+)
{
+ DK3_UNUSED_ARG(job)
if(drw->dsd) {
f2leps_drawing_info_delete((f2leps_drawing_info_t *)(drw->dsd));
}
@@ -2201,10 +2245,12 @@ f2leps_eps_pure_image_object(
void
f2leps_eps_pure_newpath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[21], job->of1);
}
@@ -2213,12 +2259,14 @@ f2leps_eps_pure_newpath(
void
f2leps_eps_pure_moveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[25], x, y);
}
@@ -2227,12 +2275,14 @@ f2leps_eps_pure_moveto(
void
f2leps_eps_pure_lineto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[26], x, y);
}
@@ -2241,8 +2291,8 @@ f2leps_eps_pure_lineto(
void
f2leps_eps_pure_curveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double xcs,
double ycs,
double xce,
@@ -2251,6 +2301,8 @@ f2leps_eps_pure_curveto(
double ye
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[27], xcs, ycs, xce, yce, xe, ye);
}
@@ -2259,10 +2311,12 @@ f2leps_eps_pure_curveto(
void
f2leps_eps_pure_closepath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[28], job->of1);
}
@@ -2271,10 +2325,12 @@ f2leps_eps_pure_closepath(
void
f2leps_eps_pure_fill(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[29], job->of1);
}
@@ -2283,10 +2339,12 @@ f2leps_eps_pure_fill(
void
f2leps_eps_pure_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[30], job->of1);
}
@@ -2295,10 +2353,12 @@ f2leps_eps_pure_clip(
void
f2leps_eps_pure_stroke(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[31], job->of1);
}
@@ -2307,10 +2367,12 @@ f2leps_eps_pure_stroke(
void
f2leps_eps_pure_gsave(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[15], job->of1);
}
@@ -2319,10 +2381,12 @@ f2leps_eps_pure_gsave(
void
f2leps_eps_pure_grestore(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2leps_c8_kw[16], job->of1);
}
@@ -2331,13 +2395,15 @@ f2leps_eps_pure_grestore(
void
f2leps_eps_pure_setcolor(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double r,
double g,
double b
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[32], r, g, b);
}
@@ -2346,11 +2412,13 @@ f2leps_eps_pure_setcolor(
void
f2leps_eps_pure_set_line_width(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double lw
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[33], lw);
}
@@ -2374,11 +2442,13 @@ f2leps_eps_pure_set_line_style(
void
f2leps_eps_pure_set_line_end(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int le
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[34], le);
}
@@ -2387,11 +2457,13 @@ f2leps_eps_pure_set_line_end(
void
f2leps_eps_pure_set_line_join(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int lj
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fprintf(job->of1, f2leps_c8_kw[35], lj);
}
@@ -2400,10 +2472,11 @@ f2leps_eps_pure_set_line_join(
void
f2leps_eps_pure_set_color_1(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
+ DK3_UNUSED_ARG(drw)
fprintf(job->of1, f2leps_c8_kw[32], rgb->r, rgb->g, rgb->b);
}
@@ -2412,10 +2485,11 @@ f2leps_eps_pure_set_color_1(
void
f2leps_eps_pure_set_color_2(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
+ DK3_UNUSED_ARG(drw)
fprintf(job->of1, f2leps_c8_kw[32], rgb->r, rgb->g, rgb->b);
}
diff --git a/support/dktools/f2leps.h b/support/dktools/f2leps.h
index 2832e7255a..9d66b0713d 100644
--- a/support/dktools/f2leps.h
+++ b/support/dktools/f2leps.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2leps.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2leps.ctr
*/
/** @file f2leps.h Header file for the f2leps module.
diff --git a/support/dktools/f2ll2l.c b/support/dktools/f2ll2l.c
index 832a49d707..12c39cf13f 100644
--- a/support/dktools/f2ll2l.c
+++ b/support/dktools/f2ll2l.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2ll2l.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2ll2l.ctr
*/
/** @file f2ll2l.c The f2ll2l module.
diff --git a/support/dktools/f2ll2l.ctr b/support/dktools/f2ll2l.ctr
index 890e04f262..d6d968169c 100644
--- a/support/dktools/f2ll2l.ctr
+++ b/support/dktools/f2ll2l.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/f2ll2l.h b/support/dktools/f2ll2l.h
index cef1a155d9..151ab26b97 100644
--- a/support/dktools/f2ll2l.h
+++ b/support/dktools/f2ll2l.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2ll2l.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2ll2l.ctr
*/
/** @file f2ll2l.h Header file for the f2ll2l module.
diff --git a/support/dktools/f2lopt.c b/support/dktools/f2lopt.c
index a1c75c82fc..373eeeb538 100644
--- a/support/dktools/f2lopt.c
+++ b/support/dktools/f2lopt.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lopt.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lopt.ctr
*/
/** @file f2lopt.c The f2lopt module.
@@ -171,10 +149,13 @@ dkT("cofop"),
/* 33 */
dkT("xsah"),
+/* 34 */
+dkT("ahbs"),
+
NULL
-#line 197 "f2lopt.ctr"
+#line 201 "f2lopt.ctr"
};
@@ -194,7 +175,7 @@ dkT("web"),
NULL
-#line 209 "f2lopt.ctr"
+#line 213 "f2lopt.ctr"
};
@@ -213,7 +194,7 @@ dkT("auto$matic"),
NULL
-#line 229 "f2lopt.ctr"
+#line 233 "f2lopt.ctr"
};
@@ -239,7 +220,7 @@ dkT("cm"),
NULL
-#line 243 "f2lopt.ctr"
+#line 247 "f2lopt.ctr"
};
@@ -272,7 +253,7 @@ dkT("svg"),
NULL
-#line 264 "f2lopt.ctr"
+#line 268 "f2lopt.ctr"
};
@@ -289,7 +270,7 @@ dkT("fig"),
NULL
-#line 281 "f2lopt.ctr"
+#line 285 "f2lopt.ctr"
};
@@ -303,7 +284,7 @@ f2lopt_set_default_options_for_language(f2l_job_t *job)
{
-#line 293 "f2lopt.ctr"
+#line 297 "f2lopt.ctr"
job->ntf = 0;
job->nts = -1.0;
job->showpage = 0;
@@ -323,7 +304,8 @@ f2lopt_set_default_options_for_language(f2l_job_t *job)
case FIG2LAT_DRIVER_SVG_STANDALONE:
{
job->smash = 0; job->mbox = 0; job->resfont = 0;
- }
+ job->ntf = 1;
+ } break;
case FIG2LAT_DRIVER_TEX_FULL_PGF:
case FIG2LAT_DRIVER_TEX_FULL_PDF:
{
@@ -332,7 +314,7 @@ f2lopt_set_default_options_for_language(f2l_job_t *job)
}
-#line 320 "f2lopt.ctr"
+#line 325 "f2lopt.ctr"
}
@@ -349,22 +331,22 @@ f2lopt_apply_language(f2l_job_t *job, dkChar const *lstr)
int back = 0;
-#line 335 "f2lopt.ctr"
+#line 340 "f2lopt.ctr"
job->dr = dk3str_array_index(f2lopt_language_names, lstr, 0);
if(job->dr > -1) {
back = 1;
f2lopt_set_default_options_for_language(job);
} else {
-#line 340 "f2lopt.ctr"
+#line 345 "f2lopt.ctr"
/* ERROR: Unknown language ... */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 7, 8, lstr);
job->exval = FIG2LAT_EXIT_ERROR_SYNTAX;
-#line 343 "f2lopt.ctr"
+#line 348 "f2lopt.ctr"
}
-#line 344 "f2lopt.ctr"
+#line 349 "f2lopt.ctr"
return back;
}
@@ -383,24 +365,24 @@ f2lopt_set_text_font(f2l_job_t *job, dkChar const *vptr)
int back = 0;
-#line 361 "f2lopt.ctr"
+#line 366 "f2lopt.ctr"
switch((i = dk3str_array_index(f2lopt_text_font_names, vptr, 0))) {
case 0: case 1: {
-#line 363 "f2lopt.ctr"
+#line 368 "f2lopt.ctr"
job->ntf = i;
back = 1;
} break;
default: {
-#line 367 "f2lopt.ctr"
+#line 372 "f2lopt.ctr"
/* ERROR: No such text font selection! */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 9, 10, vptr);
} break;
}
-#line 372 "f2lopt.ctr"
+#line 377 "f2lopt.ctr"
return back;
}
@@ -419,10 +401,10 @@ f2lopt_set_text_size(f2l_job_t *job, dkChar const *vptr)
int back = 0;
-#line 389 "f2lopt.ctr"
+#line 394 "f2lopt.ctr"
if(dk3str_cmp(vptr, f2lopt_kw[0]) == 0) {
-#line 390 "f2lopt.ctr"
+#line 395 "f2lopt.ctr"
job->nts = -1.0;
back = 1;
} else {
@@ -433,19 +415,19 @@ f2lopt_set_text_size(f2l_job_t *job, dkChar const *vptr)
#endif
{
-#line 399 "f2lopt.ctr"
+#line 404 "f2lopt.ctr"
job->nts = d;
back = 1;
} else {
-#line 402 "f2lopt.ctr"
+#line 407 "f2lopt.ctr"
/* ERROR: Invalid font size specification! */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 11, 12, vptr);
}
}
-#line 407 "f2lopt.ctr"
+#line 412 "f2lopt.ctr"
return back;
}
@@ -606,7 +588,7 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
int back = 0;
-#line 566 "f2lopt.ctr"
+#line 571 "f2lopt.ctr"
if(dk3str_len(str) < DK3_SIZEOF(bu,dkChar)) {
dk3str_cpy_not_overlapped(bu, str);
kptr = dk3str_start(bu, NULL);
@@ -619,7 +601,7 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
switch(dk3str_array_index(f2lopt_key_names, kptr, 0)) {
case 0: {
-#line 577 "f2lopt.ctr"
+#line 582 "f2lopt.ctr"
if(vptr) {
back = f2lopt_set_text_font(job, vptr);
} else {
@@ -629,7 +611,7 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
} break;
case 1: {
-#line 585 "f2lopt.ctr"
+#line 590 "f2lopt.ctr"
if(vptr) {
back = f2lopt_set_text_size(job, vptr);
} else {
@@ -639,7 +621,7 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
} break;
case 2: {
-#line 593 "f2lopt.ctr"
+#line 598 "f2lopt.ctr"
if(vptr) {
if(dk3str_is_bool(vptr)) {
job->cosp = (dk3str_is_on(vptr) ? 1 : 0);
@@ -654,7 +636,7 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
} break;
case 3: {
-#line 606 "f2lopt.ctr"
+#line 611 "f2lopt.ctr"
if(vptr) {
if(dk3str_is_bool(vptr)) {
job->coah = (dk3str_is_on(vptr) ? 1 : 0);
@@ -669,7 +651,7 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
} break;
case 4: {
-#line 619 "f2lopt.ctr"
+#line 624 "f2lopt.ctr"
if(vptr) {
back = f2lopt_read_size_t(&(job->xssbs), vptr, job);
} else {
@@ -679,7 +661,7 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
} break;
case 5: {
-#line 627 "f2lopt.ctr"
+#line 632 "f2lopt.ctr"
if(vptr) {
back = f2lopt_read_size_t(&(job->qbs), vptr, job);
} else {
@@ -835,7 +817,7 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
}
}
-#line 781 "f2lopt.ctr"
+#line 786 "f2lopt.ctr"
#endif
} break;
case 7: {
@@ -1197,6 +1179,20 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
back = 1;
}
} break;
+ case 34: {
+ if (vptr) {
+ if (dk3str_is_bool(vptr)) {
+ job->ahbs = ((dk3str_is_on(vptr)) ? 1 : 0);
+ back = 1;
+ } else {
+ /* ERROR: Not a boolean! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 147, kptr);
+ }
+ } else {
+ job->ahbs = 1;
+ back = 1;
+ }
+ } break;
default: {
/* ERROR: Unknown key name! */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 27, 28, kptr);
@@ -1204,23 +1200,23 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
}
} else {
-#line 1148 "f2lopt.ctr"
+#line 1167 "f2lopt.ctr"
back = 1;
}
if(!(back)) {
job->exval = FIG2LAT_EXIT_ERROR_SYNTAX;
-#line 1152 "f2lopt.ctr"
+#line 1171 "f2lopt.ctr"
}
} else {
/* ERROR: Option ... too long! */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 29, 30, str);
job->exval = FIG2LAT_EXIT_ERROR_SYNTAX;
-#line 1157 "f2lopt.ctr"
+#line 1176 "f2lopt.ctr"
}
-#line 1158 "f2lopt.ctr"
+#line 1177 "f2lopt.ctr"
return back;
}
@@ -1241,7 +1237,7 @@ f2lopt_set_language(f2l_job_t *job, dkChar const *optarg)
int back = 0;
-#line 1177 "f2lopt.ctr"
+#line 1196 "f2lopt.ctr"
if(dk3str_len(optarg) < DK3_SIZEOF(bu,dkChar)) {
dk3str_cpy_not_overlapped(bu, optarg);
pc = dk3str_chr(bu, dkT(','));
@@ -1253,13 +1249,13 @@ f2lopt_set_language(f2l_job_t *job, dkChar const *optarg)
back = 1;
while(pc) {
-#line 1187 "f2lopt.ctr"
+#line 1206 "f2lopt.ctr"
pn = dk3str_chr(pc, dkT(','));
if(pn) { *(pn++) = dkT('\0'); pn = dk3str_start(pn, NULL); }
if(!f2lopt_apply_option(job, pc)) {
back = 0;
-#line 1191 "f2lopt.ctr"
+#line 1210 "f2lopt.ctr"
pn = NULL;
}
pc = pn;
@@ -1270,7 +1266,7 @@ f2lopt_set_language(f2l_job_t *job, dkChar const *optarg)
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 31, 30, optarg);
}
-#line 1200 "f2lopt.ctr"
+#line 1219 "f2lopt.ctr"
return back;
}
@@ -1284,7 +1280,7 @@ f2lopt_process(f2l_job_t *job)
int i; /* Current file name. */
-#line 1212 "f2lopt.ctr"
+#line 1231 "f2lopt.ctr"
job->opt = dk3opt_open_from_app(
f2lopt_options, f2lopt_sz_options,
dkT('o'), dkT("option"),
@@ -1292,10 +1288,10 @@ f2lopt_process(f2l_job_t *job)
);
if(job->opt) {
-#line 1218 "f2lopt.ctr"
+#line 1237 "f2lopt.ctr"
if(0 == dk3opt_get_error_code(job->opt)) {
-#line 1219 "f2lopt.ctr"
+#line 1238 "f2lopt.ctr"
back = 1;
if(dk3opt_is_set(job->opt, dkT('h'))) {
job->cmd |= DK3_APP_CMD_HELP;
@@ -1314,7 +1310,7 @@ f2lopt_process(f2l_job_t *job)
optarg = dk3opt_get_short_arg(job->opt, dkT('l'));
if(optarg) {
-#line 1236 "f2lopt.ctr"
+#line 1255 "f2lopt.ctr"
if(f2lopt_set_language(job, optarg)) {
for(i = 0; i < dk3opt_get_num_fo(job->opt); i++) {
optarg = dk3opt_get_fo(job->opt, i);
@@ -1329,7 +1325,7 @@ f2lopt_process(f2l_job_t *job)
}
} else {
-#line 1249 "f2lopt.ctr"
+#line 1268 "f2lopt.ctr"
back = 0;
/* ERROR: Option requires an argument! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 32);
@@ -1344,21 +1340,21 @@ f2lopt_process(f2l_job_t *job)
job->lwbp = 0.4 * 72.0 * job->tts / (10 * 72.27);
-#line 1262 "f2lopt.ctr"
+#line 1281 "f2lopt.ctr"
}
} else {
-#line 1264 "f2lopt.ctr"
+#line 1283 "f2lopt.ctr"
}
} else {
-#line 1266 "f2lopt.ctr"
+#line 1285 "f2lopt.ctr"
job->exval = FIG2LAT_EXIT_ERROR_SYSTEM;
-#line 1267 "f2lopt.ctr"
+#line 1286 "f2lopt.ctr"
}
-#line 1268 "f2lopt.ctr"
+#line 1287 "f2lopt.ctr"
return back;
}
diff --git a/support/dktools/f2lopt.ctr b/support/dktools/f2lopt.ctr
index f3a1c376b0..2cab3fe58e 100644
--- a/support/dktools/f2lopt.ctr
+++ b/support/dktools/f2lopt.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -193,6 +193,10 @@ cofop
# 33: X-spline arrowheads.
#
xsah
+#
+# 34: Bisection iteration on X-spline arrowheads.
+#
+ahbs
$!end
};
@@ -309,7 +313,8 @@ f2lopt_set_default_options_for_language(f2l_job_t *job)
case FIG2LAT_DRIVER_SVG_STANDALONE:
{
job->smash = 0; job->mbox = 0; job->resfont = 0;
- }
+ job->ntf = 1;
+ } break;
case FIG2LAT_DRIVER_TEX_FULL_PGF:
case FIG2LAT_DRIVER_TEX_FULL_PDF:
{
@@ -1139,6 +1144,20 @@ f2lopt_apply_option(f2l_job_t *job, dkChar const *str)
back = 1;
}
} break;
+ case 34: {
+ if (vptr) {
+ if (dk3str_is_bool(vptr)) {
+ job->ahbs = ((dk3str_is_on(vptr)) ? 1 : 0);
+ back = 1;
+ } else {
+ /* ERROR: Not a boolean! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 147, kptr);
+ }
+ } else {
+ job->ahbs = 1;
+ back = 1;
+ }
+ } break;
default: {
/* ERROR: Unknown key name! */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 27, 28, kptr);
diff --git a/support/dktools/f2lopt.h b/support/dktools/f2lopt.h
index 3a1368615f..dcfc215b7e 100644
--- a/support/dktools/f2lopt.h
+++ b/support/dktools/f2lopt.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lopt.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lopt.ctr
*/
/** @file f2lopt.h Header file for the f2lopt module.
diff --git a/support/dktools/f2lpara.c b/support/dktools/f2lpara.c
index 4d69ad73ec..aa372f0df8 100644
--- a/support/dktools/f2lpara.c
+++ b/support/dktools/f2lpara.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lpara.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lpara.ctr
*/
/** @file f2lpara.c The f2lpara module.
@@ -42,6 +20,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3ma.h"
#include "f2lpara.h"
+#include "dk3unused.h"
+
+
+
+
+
+#line 63 "f2lpara.ctr"
double
@@ -65,11 +50,14 @@ f2lpara_derived_left(double yneg, double y0, double ypos, int *ec)
double
-f2lpara_derived_center(double yneg, double y0, double ypos, int *ec)
+f2lpara_derived_center(
+ double yneg, double DK3_SILENCE_ARG_UNUSED(y0), double ypos, int *ec
+)
{
double back = 0.0;
int myec = 0;
/* back = 0.5 * (ypos - yneg) */
+ DK3_UNUSED_ARG(y0)
back = 0.5 * dk3ma_d_sub_ok(ypos, yneg, &myec);
if (myec) { if (ec) { *ec = myec; } }
return back;
diff --git a/support/dktools/f2lpara.ctr b/support/dktools/f2lpara.ctr
index c38387ab30..9243dae8e6 100644
--- a/support/dktools/f2lpara.ctr
+++ b/support/dktools/f2lpara.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -55,6 +55,11 @@ f2lpara_derived_right(double yneg, double y0, double ypos, int *ec);
#include "dk3ma.h"
#include "f2lpara.h"
+#include "dk3unused.h"
+
+
+
+$!trace-include
double
@@ -78,11 +83,14 @@ f2lpara_derived_left(double yneg, double y0, double ypos, int *ec)
double
-f2lpara_derived_center(double yneg, double y0, double ypos, int *ec)
+f2lpara_derived_center(
+ double yneg, double DK3_SILENCE_ARG_UNUSED(y0), double ypos, int *ec
+)
{
double back = 0.0;
int myec = 0;
/* back = 0.5 * (ypos - yneg) */
+ DK3_UNUSED_ARG(y0)
back = 0.5 * dk3ma_d_sub_ok(ypos, yneg, &myec);
if (myec) { if (ec) { *ec = myec; } }
return back;
diff --git a/support/dktools/f2lpara.h b/support/dktools/f2lpara.h
index d91bbea4f8..3ec2949cce 100644
--- a/support/dktools/f2lpara.h
+++ b/support/dktools/f2lpara.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lpara.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lpara.ctr
*/
/** @file f2lpara.h Header file for the f2lpara module.
diff --git a/support/dktools/f2lpdf.c b/support/dktools/f2lpdf.c
index 45e44416e7..ea718f636a 100644
--- a/support/dktools/f2lpdf.c
+++ b/support/dktools/f2lpdf.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lpdf.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lpdf.ctr
*/
/** @file f2lpdf.c The f2lpdf module.
*/
-#line 699 "f2lpdf.ctr"
+#line 687 "f2lpdf.ctr"
#include "dk3all.h"
#include "dk3bezcu.h"
@@ -54,12 +32,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3bm.h"
#include "dk3pdf.h"
#include "dk3bif.h"
+#include "dk3unused.h"
-#line 719 "f2lpdf.ctr"
+#line 708 "f2lpdf.ctr"
@@ -88,7 +67,7 @@ typedef struct {
/* ************************************************************************ */
-#line 743 "f2lpdf.ctr"
+#line 732 "f2lpdf.ctr"
@@ -103,7 +82,7 @@ f2lpdf_drawing_info_delete(f2l_pdf_drawing_info_t *ptr)
f2l_image_t *im;
-#line 756 "f2lpdf.ctr"
+#line 745 "f2lpdf.ctr"
if(ptr) {
dk3_release(ptr->shortOutFile);
if(ptr->opdf) {
@@ -135,7 +114,7 @@ f2lpdf_drawing_info_delete(f2l_pdf_drawing_info_t *ptr)
dk3_delete(ptr);
}
-#line 786 "f2lpdf.ctr"
+#line 775 "f2lpdf.ctr"
}
@@ -156,7 +135,7 @@ f2lpdf_drawing_info_new(
int ok = 0; /* Flag: No error. */
-#line 805 "f2lpdf.ctr"
+#line 794 "f2lpdf.ctr"
if((job) && (drw)) {
back = dk3_new_app(f2l_pdf_drawing_info_t,1,job->app);
if(back) {
@@ -194,7 +173,7 @@ f2lpdf_drawing_info_new(
}
}
-#line 841 "f2lpdf.ctr"
+#line 830 "f2lpdf.ctr"
return back;
}
@@ -209,7 +188,7 @@ f2lpdf_drawing_info_new(
/* ************************************************************************ */
-#line 851 "f2lpdf.ctr"
+#line 840 "f2lpdf.ctr"
@@ -225,7 +204,7 @@ static
f2l_image_t *
f2lpdf_register_image(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
f2l_pdf_drawing_info_t *pdi,
char const *fn,
unsigned long li
@@ -234,6 +213,7 @@ f2lpdf_register_image(
dk3_ufi_t ufi; /* Unique file identifier. */
f2l_image_t *back = NULL; /* Image information structure. */
+ DK3_UNUSED_ARG(drw)
if(dk3ufi_c8_get_app(&ufi, fn, job->app)) {
back = (f2l_image_t *)dk3sto_it_find_like(pdi->iImages, (void *)(&ufi), 1);
if(!(back)) {
@@ -247,18 +227,18 @@ f2lpdf_register_image(
back = NULL;
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 887 "f2lpdf.ctr"
+#line 877 "f2lpdf.ctr"
}
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 890 "f2lpdf.ctr"
+#line 880 "f2lpdf.ctr"
}
}
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 894 "f2lpdf.ctr"
+#line 884 "f2lpdf.ctr"
}
return back;
}
@@ -276,7 +256,7 @@ static
int
f2lpdf_add_image_to_pdf(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
f2l_pdf_drawing_info_t *pdi,
f2l_image_t *im
)
@@ -286,7 +266,8 @@ f2lpdf_add_image_to_pdf(
int back = 0;
-#line 920 "f2lpdf.ctr"
+#line 910 "f2lpdf.ctr"
+ DK3_UNUSED_ARG(drw)
bif = dk3bif_open_c8_filename_app(
im->filename, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app
);
@@ -298,7 +279,7 @@ f2lpdf_add_image_to_pdf(
options.mode = DK3_BMEPS_MODE_PLACED_OBJECT;
options.szmode = DK3_BMEPS_SIZE_1_1;
-#line 930 "f2lpdf.ctr"
+#line 921 "f2lpdf.ctr"
options.dr = DK3_BMEPS_DRIVER_PDF;
options.rbpc = 1;
options.dct = 1;
@@ -314,22 +295,22 @@ f2lpdf_add_image_to_pdf(
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 944 "f2lpdf.ctr"
+#line 935 "f2lpdf.ctr"
}
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 947 "f2lpdf.ctr"
+#line 938 "f2lpdf.ctr"
}
dk3bif_close(bif);
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 951 "f2lpdf.ctr"
+#line 942 "f2lpdf.ctr"
}
-#line 953 "f2lpdf.ctr"
+#line 944 "f2lpdf.ctr"
return back;
}
@@ -347,7 +328,7 @@ f2lpdf_pdf_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
int ff; /* Font flags. */
-#line 969 "f2lpdf.ctr"
+#line 960 "f2lpdf.ctr"
pdi = f2lpdf_drawing_info_new(job, drw);
if(pdi) {
drw->dsd = (void *)pdi;
@@ -361,23 +342,23 @@ f2lpdf_pdf_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
while(NULL != (pobj = (dk3_fig_obj_t *)dk3sto_it_next(drw->iobj))) {
-#line 981 "f2lpdf.ctr"
+#line 972 "f2lpdf.ctr"
dk3app_set_source_line(job->app, pobj->li);
switch(pobj->ot) {
case DK3_FIG_OBJ_TEXT: {
ff = (pobj->dt).txt.ff;
if(!(ff & DK3_FIG_FONT_FLAG_HIDDEN)) {
-#line 986 "f2lpdf.ctr"
+#line 977 "f2lpdf.ctr"
if(!(ff & DK3_FIG_FONT_FLAG_SPECIAL)) {
-#line 987 "f2lpdf.ctr"
+#line 978 "f2lpdf.ctr"
if(ff & DK3_FIG_FONT_FLAG_PS) {
-#line 988 "f2lpdf.ctr"
+#line 979 "f2lpdf.ctr"
if(job->ntf) {
-#line 989 "f2lpdf.ctr"
+#line 980 "f2lpdf.ctr"
pobj->dsd = (void *)f2l_tool_register_font(
pdi->sFonts, pdi->iFonts, &(pdi->nFonts),
(pobj->dt).txt.fo, (pobj->dt).txt.fs, job->app
@@ -385,14 +366,14 @@ f2lpdf_pdf_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
if(!(pobj->dsd)) {
back = 0;
-#line 995 "f2lpdf.ctr"
+#line 986 "f2lpdf.ctr"
f2l_tool_set_exit_status(job,FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 996 "f2lpdf.ctr"
+#line 987 "f2lpdf.ctr"
}
} else {
-#line 998 "f2lpdf.ctr"
+#line 989 "f2lpdf.ctr"
}
}
}
@@ -401,7 +382,7 @@ f2lpdf_pdf_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
case DK3_FIG_OBJ_POLYLINE: {
if(5 == pobj->st) {
-#line 1005 "f2lpdf.ctr"
+#line 996 "f2lpdf.ctr"
pobj->dsd =
(void *)f2lpdf_register_image(
job, drw, pdi, (pobj->dt).pol.fn, pobj->li
@@ -410,7 +391,7 @@ f2lpdf_pdf_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
back = 0;
f2l_tool_set_exit_status(job,FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1012 "f2lpdf.ctr"
+#line 1003 "f2lpdf.ctr"
}
}
} break;
@@ -420,11 +401,11 @@ f2lpdf_pdf_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
while(NULL != (im = (f2l_image_t *)dk3sto_it_next(pdi->iImages))) {
if(!f2lpdf_add_image_to_pdf(job, drw, pdi, im)) {
-#line 1020 "f2lpdf.ctr"
+#line 1011 "f2lpdf.ctr"
back = 0;
f2l_tool_set_exit_status(job,FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1022 "f2lpdf.ctr"
+#line 1013 "f2lpdf.ctr"
}
}
dk3app_set_source_file(job->app, oldsourcefile);
@@ -432,23 +413,27 @@ f2lpdf_pdf_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1028 "f2lpdf.ctr"
+#line 1019 "f2lpdf.ctr"
}
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1031 "f2lpdf.ctr"
+#line 1022 "f2lpdf.ctr"
}
-#line 1032 "f2lpdf.ctr"
+#line 1023 "f2lpdf.ctr"
return back;
}
void
-f2lpdf_pdf_with_tex_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lpdf_pdf_with_tex_end(
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t *drw
+)
{
+ DK3_UNUSED_ARG(job)
if(drw->dsd) {
f2lpdf_drawing_info_delete((f2l_pdf_drawing_info_t *)(drw->dsd));
drw->dsd = NULL;
@@ -469,12 +454,12 @@ f2lpdf_pdf_with_tex_open_output_files(f2l_job_t *job)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1059 "f2lpdf.ctr"
+#line 1054 "f2lpdf.ctr"
}
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1062 "f2lpdf.ctr"
+#line 1057 "f2lpdf.ctr"
}
return back;
}
@@ -503,14 +488,14 @@ f2lpdf_pdf_with_tex_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
f2l_tool_start_tex_part(
- job->of1, job, drw, pdi->shortOutFile, pdi->iFonts, pdi->nFonts
+ job->of1, job, pdi->shortOutFile, pdi->iFonts, pdi->nFonts
);
if(dk3pdf_open_page_with_clip(pdi->opdf, 1)) {
back = 1;
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1096 "f2lpdf.ctr"
+#line 1091 "f2lpdf.ctr"
}
return back;
}
@@ -529,7 +514,7 @@ f2lpdf_pdf_with_tex_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
/* ERROR: Failed to write PDF output file! */
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1113 "f2lpdf.ctr"
+#line 1108 "f2lpdf.ctr"
}
}
@@ -570,115 +555,118 @@ f2lpdf_pdf_with_tex_image_object(
int res; /* Search result. */
-#line 1152 "f2lpdf.ctr"
+#line 1147 "f2lpdf.ctr"
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
im = (f2l_image_t *)(obj->dsd);
if((im) && (pdi)) {
-#line 1155 "f2lpdf.ctr"
+#line 1150 "f2lpdf.ctr"
if(im->xo) {
-#line 1156 "f2lpdf.ctr"
+#line 1151 "f2lpdf.ctr"
res = dk3bm_find_transformation(
&trans, outbb, drawdir, (double)(im->width), (double)(im->height),
im->xres, im->yres, ec
);
if(res) {
-#line 1161 "f2lpdf.ctr"
+#line 1156 "f2lpdf.ctr"
res = dk3pdf_gsave(pdi->opdf);
if(!(res)) {
-#line 1163 "f2lpdf.ctr"
+#line 1158 "f2lpdf.ctr"
/* ERROR */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1166 "f2lpdf.ctr"
+#line 1161 "f2lpdf.ctr"
}
res =
dk3pdf_translate_double(pdi->opdf,trans.x_translate,trans.y_translate);
if(!(res)) {
-#line 1170 "f2lpdf.ctr"
+#line 1165 "f2lpdf.ctr"
/* ERROR */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1173 "f2lpdf.ctr"
+#line 1168 "f2lpdf.ctr"
}
if(trans.rot) {
res = dk3pdf_rotate_int(pdi->opdf, (90 * trans.rot));
if(!(res)) {
-#line 1177 "f2lpdf.ctr"
+#line 1172 "f2lpdf.ctr"
/* ERROR */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1180 "f2lpdf.ctr"
+#line 1175 "f2lpdf.ctr"
}
}
res = dk3pdf_scale_double(pdi->opdf, trans.x_scale, trans.y_scale);
if(!(res)) {
-#line 1184 "f2lpdf.ctr"
+#line 1179 "f2lpdf.ctr"
/* ERROR */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1187 "f2lpdf.ctr"
+#line 1182 "f2lpdf.ctr"
}
res = dk3pdf_add_xobject_to_page(pdi->opdf, im->xo);
if(!(res)) {
-#line 1190 "f2lpdf.ctr"
+#line 1185 "f2lpdf.ctr"
/* ERROR */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1193 "f2lpdf.ctr"
+#line 1188 "f2lpdf.ctr"
}
res = dk3pdf_grestore(pdi->opdf);
if(!(res)) {
-#line 1196 "f2lpdf.ctr"
+#line 1191 "f2lpdf.ctr"
/* ERROR */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1199 "f2lpdf.ctr"
+#line 1194 "f2lpdf.ctr"
}
} else {
-#line 1201 "f2lpdf.ctr"
+#line 1196 "f2lpdf.ctr"
/* ERROR: Math error while searching transformation! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1204 "f2lpdf.ctr"
+#line 1199 "f2lpdf.ctr"
}
} else {
-#line 1206 "f2lpdf.ctr"
+#line 1201 "f2lpdf.ctr"
}
} else {
-#line 1208 "f2lpdf.ctr"
+#line 1203 "f2lpdf.ctr"
}
-#line 1209 "f2lpdf.ctr"
+#line 1204 "f2lpdf.ctr"
}
void
f2lpdf_pdf_with_tex_newpath(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(job)
/* Do nothing, in PDF the moveto operator includes newpath. */
}
@@ -688,7 +676,7 @@ void
f2lpdf_pdf_with_tex_moveto(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
@@ -696,6 +684,7 @@ f2lpdf_pdf_with_tex_moveto(
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_newpath_moveto(pdi->opdf, x, y);
@@ -703,7 +692,7 @@ f2lpdf_pdf_with_tex_moveto(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1243 "f2lpdf.ctr"
+#line 1242 "f2lpdf.ctr"
}
}
}
@@ -714,7 +703,7 @@ void
f2lpdf_pdf_with_tex_lineto(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
@@ -722,6 +711,7 @@ f2lpdf_pdf_with_tex_lineto(
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Ouutput operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_lineto(pdi->opdf, x, y);
@@ -740,7 +730,7 @@ void
f2lpdf_pdf_with_tex_curveto(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double xcs,
double ycs,
double xce,
@@ -751,6 +741,8 @@ f2lpdf_pdf_with_tex_curveto(
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_curveto(pdi->opdf, xcs, ycs, xce, yce, xe, ye);
@@ -758,7 +750,7 @@ f2lpdf_pdf_with_tex_curveto(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1294 "f2lpdf.ctr"
+#line 1296 "f2lpdf.ctr"
}
}
}
@@ -769,12 +761,13 @@ void
f2lpdf_pdf_with_tex_closepath(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_closepath(pdi->opdf);
@@ -782,7 +775,7 @@ f2lpdf_pdf_with_tex_closepath(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1316 "f2lpdf.ctr"
+#line 1319 "f2lpdf.ctr"
}
}
}
@@ -793,12 +786,13 @@ void
f2lpdf_pdf_with_tex_fill(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_fill_eo(pdi->opdf);
@@ -806,7 +800,7 @@ f2lpdf_pdf_with_tex_fill(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1338 "f2lpdf.ctr"
+#line 1342 "f2lpdf.ctr"
}
}
}
@@ -817,12 +811,13 @@ void
f2lpdf_pdf_with_tex_clip(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_clip_eo(pdi->opdf);
@@ -830,7 +825,7 @@ f2lpdf_pdf_with_tex_clip(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1360 "f2lpdf.ctr"
+#line 1365 "f2lpdf.ctr"
}
}
}
@@ -841,12 +836,13 @@ void
f2lpdf_pdf_with_tex_stroke(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_stroke(pdi->opdf);
@@ -854,7 +850,7 @@ f2lpdf_pdf_with_tex_stroke(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1382 "f2lpdf.ctr"
+#line 1388 "f2lpdf.ctr"
}
}
}
@@ -865,12 +861,13 @@ void
f2lpdf_pdf_with_tex_gsave(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_gsave(pdi->opdf);
@@ -878,7 +875,7 @@ f2lpdf_pdf_with_tex_gsave(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1404 "f2lpdf.ctr"
+#line 1411 "f2lpdf.ctr"
}
}
}
@@ -889,12 +886,13 @@ void
f2lpdf_pdf_with_tex_grestore(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_grestore(pdi->opdf);
@@ -902,7 +900,7 @@ f2lpdf_pdf_with_tex_grestore(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1426 "f2lpdf.ctr"
+#line 1434 "f2lpdf.ctr"
}
}
}
@@ -913,7 +911,7 @@ void
f2lpdf_pdf_with_tex_setcolor(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double r,
double g,
double b
@@ -922,6 +920,7 @@ f2lpdf_pdf_with_tex_setcolor(
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_nonstroking_rgb(pdi->opdf, r, g, b);
@@ -929,14 +928,14 @@ f2lpdf_pdf_with_tex_setcolor(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1451 "f2lpdf.ctr"
+#line 1460 "f2lpdf.ctr"
}
res = dk3pdf_stroking_rgb(pdi->opdf, r, g, b);
if(!(res)) {
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1456 "f2lpdf.ctr"
+#line 1465 "f2lpdf.ctr"
}
}
}
@@ -947,13 +946,14 @@ void
f2lpdf_pdf_with_tex_set_line_width(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double lw
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_set_linewidth(pdi->opdf, lw);
@@ -961,7 +961,7 @@ f2lpdf_pdf_with_tex_set_line_width(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1479 "f2lpdf.ctr"
+#line 1489 "f2lpdf.ctr"
}
}
}
@@ -972,7 +972,7 @@ void
f2lpdf_pdf_with_tex_set_line_style(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int ls,
double sv,
double lw
@@ -985,6 +985,7 @@ f2lpdf_pdf_with_tex_set_line_style(
size_t nsv; /* Number of elements xsv. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
ph = 0.0;
nsv = 0;
xsv[0] = 0.0;
@@ -1033,7 +1034,7 @@ f2lpdf_pdf_with_tex_set_line_style(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1549 "f2lpdf.ctr"
+#line 1560 "f2lpdf.ctr"
}
}
}
@@ -1044,13 +1045,14 @@ void
f2lpdf_pdf_with_tex_set_line_end(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int le
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_set_linecap(pdi->opdf, le);
@@ -1058,7 +1060,7 @@ f2lpdf_pdf_with_tex_set_line_end(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1572 "f2lpdf.ctr"
+#line 1584 "f2lpdf.ctr"
}
}
}
@@ -1069,13 +1071,14 @@ void
f2lpdf_pdf_with_tex_set_line_join(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int lj
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_set_linejoin(pdi->opdf, lj);
@@ -1083,7 +1086,7 @@ f2lpdf_pdf_with_tex_set_line_join(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1595 "f2lpdf.ctr"
+#line 1608 "f2lpdf.ctr"
}
}
}
@@ -1107,7 +1110,7 @@ f2lpdf_pdf_with_tex_set_color_1(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1617 "f2lpdf.ctr"
+#line 1630 "f2lpdf.ctr"
}
}
}
@@ -1131,7 +1134,7 @@ f2lpdf_pdf_with_tex_set_color_2(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1639 "f2lpdf.ctr"
+#line 1652 "f2lpdf.ctr"
}
}
}
@@ -1154,7 +1157,7 @@ f2lpdf_pdf_with_tex_debug(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 41);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1660 "f2lpdf.ctr"
+#line 1673 "f2lpdf.ctr"
}
}
}
@@ -1170,7 +1173,7 @@ f2lpdf_pdf_with_tex_debug(
/* ************************************************************************ */
-#line 1671 "f2lpdf.ctr"
+#line 1684 "f2lpdf.ctr"
@@ -1214,7 +1217,7 @@ int
f2lpdf_tex_with_pdf_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
int back = 0;
- f2l_tool_begin_latex_document(job->of1, job, drw);
+ f2l_tool_begin_latex_document(job->of1, job);
back = f2lpdf_pdf_with_tex_start_processing(job, drw);
return back;
}
@@ -1225,7 +1228,7 @@ void
f2lpdf_tex_with_pdf_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
f2lpdf_pdf_with_tex_end_processing(job, drw);
- f2l_tool_end_latex_document(job->of1, job, drw);
+ f2l_tool_end_latex_document(job->of1);
}
diff --git a/support/dktools/f2lpdf.ctr b/support/dktools/f2lpdf.ctr
index 8ac91c9c6f..33fade4552 100644
--- a/support/dktools/f2lpdf.ctr
+++ b/support/dktools/f2lpdf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -333,18 +333,6 @@ f2lpdf_pdf_with_tex_set_color_2(
dk3_rgb_color_t *rgb
);
-/** Set non-stroking color (PGF, PDF).
- @param job Job structure.
- @param drw Drawing structure.
- @param rgb New color value.
-*/
-void
-f2lpdf_pdf_with_tex_set_color_2(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_rgb_color_t *rgb
-);
-
/** Write debugging line to output file.
@param job Job structure.
@param msg Message to write to output file.
@@ -712,6 +700,7 @@ f2lpdf_tex_with_pdf_debug(
#include "dk3bm.h"
#include "dk3pdf.h"
#include "dk3bif.h"
+#include "dk3unused.h"
@@ -863,7 +852,7 @@ static
f2l_image_t *
f2lpdf_register_image(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
f2l_pdf_drawing_info_t *pdi,
char const *fn,
unsigned long li
@@ -872,6 +861,7 @@ f2lpdf_register_image(
dk3_ufi_t ufi; /* Unique file identifier. */
f2l_image_t *back = NULL; /* Image information structure. */
+ DK3_UNUSED_ARG(drw)
if(dk3ufi_c8_get_app(&ufi, fn, job->app)) {
back = (f2l_image_t *)dk3sto_it_find_like(pdi->iImages, (void *)(&ufi), 1);
if(!(back)) {
@@ -908,7 +898,7 @@ static
int
f2lpdf_add_image_to_pdf(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
f2l_pdf_drawing_info_t *pdi,
f2l_image_t *im
)
@@ -917,6 +907,7 @@ f2lpdf_add_image_to_pdf(
dk3_bif_t *bif; /* Bitmap image file. */
int back = 0;
$? "+ f2lpdf_add_image_to_pdf"
+ DK3_UNUSED_ARG(drw)
bif = dk3bif_open_c8_filename_app(
im->filename, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app
);
@@ -1035,8 +1026,12 @@ f2lpdf_pdf_with_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
void
-f2lpdf_pdf_with_tex_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lpdf_pdf_with_tex_end(
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t *drw
+)
{
+ DK3_UNUSED_ARG(job)
if(drw->dsd) {
f2lpdf_drawing_info_delete((f2l_pdf_drawing_info_t *)(drw->dsd));
drw->dsd = NULL;
@@ -1087,7 +1082,7 @@ f2lpdf_pdf_with_tex_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
f2l_tool_start_tex_part(
- job->of1, job, drw, pdi->shortOutFile, pdi->iFonts, pdi->nFonts
+ job->of1, job, pdi->shortOutFile, pdi->iFonts, pdi->nFonts
);
if(dk3pdf_open_page_with_clip(pdi->opdf, 1)) {
back = 1;
@@ -1212,11 +1207,14 @@ f2lpdf_pdf_with_tex_image_object(
void
f2lpdf_pdf_with_tex_newpath(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(job)
/* Do nothing, in PDF the moveto operator includes newpath. */
}
@@ -1226,7 +1224,7 @@ void
f2lpdf_pdf_with_tex_moveto(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
@@ -1234,6 +1232,7 @@ f2lpdf_pdf_with_tex_moveto(
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_newpath_moveto(pdi->opdf, x, y);
@@ -1250,7 +1249,7 @@ void
f2lpdf_pdf_with_tex_lineto(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
@@ -1258,6 +1257,7 @@ f2lpdf_pdf_with_tex_lineto(
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Ouutput operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_lineto(pdi->opdf, x, y);
@@ -1274,7 +1274,7 @@ void
f2lpdf_pdf_with_tex_curveto(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double xcs,
double ycs,
double xce,
@@ -1285,6 +1285,8 @@ f2lpdf_pdf_with_tex_curveto(
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_curveto(pdi->opdf, xcs, ycs, xce, yce, xe, ye);
@@ -1301,12 +1303,13 @@ void
f2lpdf_pdf_with_tex_closepath(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_closepath(pdi->opdf);
@@ -1323,12 +1326,13 @@ void
f2lpdf_pdf_with_tex_fill(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_fill_eo(pdi->opdf);
@@ -1345,12 +1349,13 @@ void
f2lpdf_pdf_with_tex_clip(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_clip_eo(pdi->opdf);
@@ -1367,12 +1372,13 @@ void
f2lpdf_pdf_with_tex_stroke(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_stroke(pdi->opdf);
@@ -1389,12 +1395,13 @@ void
f2lpdf_pdf_with_tex_gsave(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_gsave(pdi->opdf);
@@ -1411,12 +1418,13 @@ void
f2lpdf_pdf_with_tex_grestore(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_grestore(pdi->opdf);
@@ -1433,7 +1441,7 @@ void
f2lpdf_pdf_with_tex_setcolor(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double r,
double g,
double b
@@ -1442,6 +1450,7 @@ f2lpdf_pdf_with_tex_setcolor(
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_nonstroking_rgb(pdi->opdf, r, g, b);
@@ -1463,13 +1472,14 @@ void
f2lpdf_pdf_with_tex_set_line_width(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double lw
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_set_linewidth(pdi->opdf, lw);
@@ -1486,7 +1496,7 @@ void
f2lpdf_pdf_with_tex_set_line_style(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int ls,
double sv,
double lw
@@ -1499,6 +1509,7 @@ f2lpdf_pdf_with_tex_set_line_style(
size_t nsv; /* Number of elements xsv. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
ph = 0.0;
nsv = 0;
xsv[0] = 0.0;
@@ -1556,13 +1567,14 @@ void
f2lpdf_pdf_with_tex_set_line_end(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int le
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_set_linecap(pdi->opdf, le);
@@ -1579,13 +1591,14 @@ void
f2lpdf_pdf_with_tex_set_line_join(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int lj
)
{
f2l_pdf_drawing_info_t *pdi; /* Driver specific details. */
int res; /* Output operation result. */
+ DK3_UNUSED_ARG(obj)
pdi = (f2l_pdf_drawing_info_t *)(drw->dsd);
if(pdi) {
res = dk3pdf_set_linejoin(pdi->opdf, lj);
@@ -1711,7 +1724,7 @@ int
f2lpdf_tex_with_pdf_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
int back = 0;
- f2l_tool_begin_latex_document(job->of1, job, drw);
+ f2l_tool_begin_latex_document(job->of1, job);
back = f2lpdf_pdf_with_tex_start_processing(job, drw);
return back;
}
@@ -1722,7 +1735,7 @@ void
f2lpdf_tex_with_pdf_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
f2lpdf_pdf_with_tex_end_processing(job, drw);
- f2l_tool_end_latex_document(job->of1, job, drw);
+ f2l_tool_end_latex_document(job->of1);
}
diff --git a/support/dktools/f2lpdf.h b/support/dktools/f2lpdf.h
index 23ad01922d..d2d6e97298 100644
--- a/support/dktools/f2lpdf.h
+++ b/support/dktools/f2lpdf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lpdf.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lpdf.ctr
*/
/** @file f2lpdf.h Header file for the f2lpdf module.
@@ -368,18 +346,6 @@ f2lpdf_pdf_with_tex_set_color_2(
dk3_rgb_color_t *rgb
);
-/** Set non-stroking color (PGF, PDF).
- @param job Job structure.
- @param drw Drawing structure.
- @param rgb New color value.
-*/
-void
-f2lpdf_pdf_with_tex_set_color_2(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_rgb_color_t *rgb
-);
-
/** Write debugging line to output file.
@param job Job structure.
@param msg Message to write to output file.
diff --git a/support/dktools/f2lpgf.c b/support/dktools/f2lpgf.c
index 62b6c5a2ef..3537d1ea8f 100644
--- a/support/dktools/f2lpgf.c
+++ b/support/dktools/f2lpgf.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lpgf.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lpgf.ctr
*/
/** @file f2lpgf.c The f2lpgf module.
@@ -53,12 +31,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3bif.h"
#include "dk3bm.h"
#include "dk3figto.h"
+#include "dk3unused.h"
-#line 775 "f2lpgf.ctr"
+#line 776 "f2lpgf.ctr"
@@ -237,7 +216,7 @@ static char const * const f2lpgf_c8_kw[] = {
NULL
-#line 1005 "f2lpgf.ctr"
+#line 1006 "f2lpgf.ctr"
};
@@ -248,7 +227,7 @@ NULL
/* ************************************************************************ */
-#line 1011 "f2lpgf.ctr"
+#line 1012 "f2lpgf.ctr"
@@ -285,10 +264,15 @@ f2lpgf_pdi_delete(f2l_pgf_drawing_info_t *ptr)
*/
static
f2l_pgf_drawing_info_t *
-f2lpgf_pdi_new(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lpgf_pdi_new(
+ f2l_job_t *job,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw)
+)
{
f2l_pgf_drawing_info_t *back = NULL;
int ok = 0;
+
+ DK3_UNUSED_ARG(drw)
back = dk3_new_app(f2l_pgf_drawing_info_t,1,job->app);
if(back) {
back->sFonts = NULL; back->iFonts = NULL; back->nFonts = 0UL;
@@ -452,7 +436,7 @@ f2lpgf_write_text_rotation(FILE *of, double rot, f2l_job_t *job)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1213 "f2lpgf.ctr"
+#line 1219 "f2lpgf.ctr"
}
}
}
@@ -466,7 +450,7 @@ f2lpgf_write_text_rotation(FILE *of, double rot, f2l_job_t *job)
/* ************************************************************************ */
-#line 1222 "f2lpgf.ctr"
+#line 1228 "f2lpgf.ctr"
int
f2lpgf_pgf_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
@@ -480,7 +464,7 @@ f2lpgf_pgf_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
int back = 0;
-#line 1234 "f2lpgf.ctr"
+#line 1240 "f2lpgf.ctr"
if((job) && (drw)) {
pdi = f2lpgf_pdi_new(job, drw);
if(pdi) {
@@ -494,20 +478,20 @@ f2lpgf_pgf_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
switch(pobj->ot) {
case DK3_FIG_OBJ_TEXT: {
-#line 1246 "f2lpgf.ctr"
+#line 1252 "f2lpgf.ctr"
ff = (pobj->dt).txt.ff;
if(!(ff & DK3_FIG_FONT_FLAG_HIDDEN)) {
-#line 1248 "f2lpgf.ctr"
+#line 1254 "f2lpgf.ctr"
if(!(ff & DK3_FIG_FONT_FLAG_SPECIAL)) {
-#line 1249 "f2lpgf.ctr"
+#line 1255 "f2lpgf.ctr"
if(ff & DK3_FIG_FONT_FLAG_PS) {
-#line 1250 "f2lpgf.ctr"
+#line 1256 "f2lpgf.ctr"
if(job->ntf) {
-#line 1251 "f2lpgf.ctr"
+#line 1257 "f2lpgf.ctr"
pobj->dsd = (void *)f2l_tool_register_font(
pdi->sFonts, pdi->iFonts, &(pdi->nFonts),
(pobj->dt).txt.fo, (pobj->dt).txt.fs, job->app
@@ -516,11 +500,11 @@ f2lpgf_pgf_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
back = 0;
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1258 "f2lpgf.ctr"
+#line 1264 "f2lpgf.ctr"
}
} else {
-#line 1260 "f2lpgf.ctr"
+#line 1266 "f2lpgf.ctr"
}
}
}
@@ -533,11 +517,11 @@ f2lpgf_pgf_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1271 "f2lpgf.ctr"
+#line 1277 "f2lpgf.ctr"
}
}
-#line 1273 "f2lpgf.ctr"
+#line 1279 "f2lpgf.ctr"
return back;
}
@@ -548,14 +532,14 @@ f2lpgf_pgf_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
-#line 1282 "f2lpgf.ctr"
+#line 1288 "f2lpgf.ctr"
if((job) && (drw)) {
if(drw->dsd) {
f2lpgf_pdi_delete((f2l_pgf_drawing_info_t *)(drw->dsd));
}
}
-#line 1287 "f2lpgf.ctr"
+#line 1293 "f2lpgf.ctr"
}
@@ -566,18 +550,18 @@ f2lpgf_pgf_open_output_files(f2l_job_t *job)
int back = 0;
-#line 1296 "f2lpgf.ctr"
+#line 1302 "f2lpgf.ctr"
job->of1 = dk3sf_fopen_app(job->on1, dkT("w"), job->app);
if(job->of1) {
back = 1;
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1301 "f2lpgf.ctr"
+#line 1307 "f2lpgf.ctr"
}
-#line 1303 "f2lpgf.ctr"
+#line 1309 "f2lpgf.ctr"
return back;
}
@@ -588,13 +572,13 @@ f2lpgf_pgf_close_output_files(f2l_job_t *job)
{
-#line 1312 "f2lpgf.ctr"
+#line 1318 "f2lpgf.ctr"
if(job->of1) {
dk3sf_fclose_app(job->of1, job->app);
}
-#line 1316 "f2lpgf.ctr"
+#line 1322 "f2lpgf.ctr"
}
@@ -606,19 +590,19 @@ f2lpgf_pgf_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
int back = 0;
-#line 1326 "f2lpgf.ctr"
+#line 1332 "f2lpgf.ctr"
pdi = (f2l_pgf_drawing_info_t *)(drw->dsd);
if(pdi) {
-#line 1328 "f2lpgf.ctr"
+#line 1334 "f2lpgf.ctr"
back = 1;
/* Font definitions */
f2l_tool_start_tex_part_with_picture(
- job->of1, job, drw, NULL, pdi->iFonts, pdi->nFonts, 0
+ job->of1, job, NULL, pdi->iFonts, pdi->nFonts, 0
);
} else {
-#line 1334 "f2lpgf.ctr"
+#line 1340 "f2lpgf.ctr"
}
fputs(f2lpgf_c8_kw[2], job->of1);
/* Bounding box */
@@ -636,25 +620,29 @@ f2lpgf_pgf_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
fputs(f2lpgf_c8_kw[14], job->of1);
-#line 1350 "f2lpgf.ctr"
+#line 1356 "f2lpgf.ctr"
return back;
}
void
-f2lpgf_pgf_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lpgf_pgf_end_processing(
+ f2l_job_t *job,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw)
+)
{
-#line 1359 "f2lpgf.ctr"
+#line 1368 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
/* End PGF scope */
fputs(f2lpgf_c8_kw[5], job->of1);
/* End PGF picture */
fputs(f2lpgf_c8_kw[3], job->of1);
-#line 1364 "f2lpgf.ctr"
+#line 1374 "f2lpgf.ctr"
}
@@ -672,7 +660,7 @@ f2lpgf_pgf_text_object(
unsigned long nFonts = 0UL; /* Number of text handlings. */
-#line 1380 "f2lpgf.ctr"
+#line 1390 "f2lpgf.ctr"
pdi = (f2l_pgf_drawing_info_t *)(drw->dsd);
if(pdi) { nFonts = pdi->nFonts; }
fputs(f2lpgf_c8_kw[46], job->of1);
@@ -701,7 +689,7 @@ f2lpgf_pgf_text_object(
(job->gs).hc1 = 0; (job->gs).hc2 = 0;
-#line 1407 "f2lpgf.ctr"
+#line 1417 "f2lpgf.ctr"
}
@@ -709,7 +697,7 @@ f2lpgf_pgf_text_object(
void
f2lpgf_pgf_image_object(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_fig_obj_t *obj,
dk3_bb_t *outbb,
int drawdir,
@@ -725,7 +713,8 @@ f2lpgf_pgf_image_object(
int res = 0; /* Result from transformation search. */
-#line 1429 "f2lpgf.ctr"
+#line 1439 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
if((obj->dt).pol.fn) {
bif = dk3bif_open_c8_filename_app(
(obj->dt).pol.fn, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app
@@ -770,36 +759,39 @@ f2lpgf_pgf_image_object(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 40);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1472 "f2lpgf.ctr"
+#line 1483 "f2lpgf.ctr"
}
} else {
/* ERROR: Failed to open bitmap image! */
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1476 "f2lpgf.ctr"
+#line 1487 "f2lpgf.ctr"
}
}
-#line 1479 "f2lpgf.ctr"
+#line 1490 "f2lpgf.ctr"
}
void
f2lpgf_pgf_newpath(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1491 "f2lpgf.ctr"
+#line 1502 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(job)
/* Nothing to do here, new paths are automatically started by moveto. */
-#line 1493 "f2lpgf.ctr"
+#line 1507 "f2lpgf.ctr"
}
@@ -807,21 +799,23 @@ f2lpgf_pgf_newpath(
void
f2lpgf_pgf_moveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
-#line 1507 "f2lpgf.ctr"
+#line 1521 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[16], job->of1);
f2lpgf_write_point_double(job->of1, x, y);
fputs(f2lpgf_c8_kw[7], job->of1);
-#line 1511 "f2lpgf.ctr"
+#line 1527 "f2lpgf.ctr"
}
@@ -829,21 +823,23 @@ f2lpgf_pgf_moveto(
void
f2lpgf_pgf_lineto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
-#line 1525 "f2lpgf.ctr"
+#line 1541 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[17], job->of1);
f2lpgf_write_point_double(job->of1, x, y);
fputs(f2lpgf_c8_kw[7], job->of1);
-#line 1529 "f2lpgf.ctr"
+#line 1547 "f2lpgf.ctr"
}
@@ -851,8 +847,8 @@ f2lpgf_pgf_lineto(
void
f2lpgf_pgf_curveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double xcs,
double ycs,
double xce,
@@ -863,7 +859,9 @@ f2lpgf_pgf_curveto(
{
-#line 1547 "f2lpgf.ctr"
+#line 1565 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[18], job->of1);
f2lpgf_write_point_double(job->of1, xcs, ycs);
fputs(f2lpgf_c8_kw[19], job->of1);
@@ -873,7 +871,7 @@ f2lpgf_pgf_curveto(
fputs(f2lpgf_c8_kw[7], job->of1);
-#line 1555 "f2lpgf.ctr"
+#line 1575 "f2lpgf.ctr"
}
@@ -881,17 +879,19 @@ f2lpgf_pgf_curveto(
void
f2lpgf_pgf_closepath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1567 "f2lpgf.ctr"
+#line 1587 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[20], job->of1);
-#line 1569 "f2lpgf.ctr"
+#line 1591 "f2lpgf.ctr"
}
@@ -899,17 +899,19 @@ f2lpgf_pgf_closepath(
void
f2lpgf_pgf_fill(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1581 "f2lpgf.ctr"
+#line 1603 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[21], job->of1);
-#line 1583 "f2lpgf.ctr"
+#line 1607 "f2lpgf.ctr"
}
@@ -917,17 +919,19 @@ f2lpgf_pgf_fill(
void
f2lpgf_pgf_fill_stroke(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1595 "f2lpgf.ctr"
+#line 1619 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[22], job->of1);
-#line 1597 "f2lpgf.ctr"
+#line 1623 "f2lpgf.ctr"
}
@@ -935,17 +939,19 @@ f2lpgf_pgf_fill_stroke(
void
f2lpgf_pgf_fill_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1609 "f2lpgf.ctr"
+#line 1635 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[23], job->of1);
-#line 1611 "f2lpgf.ctr"
+#line 1639 "f2lpgf.ctr"
}
@@ -953,17 +959,19 @@ f2lpgf_pgf_fill_clip(
void
f2lpgf_pgf_fill_stroke_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1623 "f2lpgf.ctr"
+#line 1651 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[24], job->of1);
-#line 1625 "f2lpgf.ctr"
+#line 1655 "f2lpgf.ctr"
}
@@ -971,17 +979,19 @@ f2lpgf_pgf_fill_stroke_clip(
void
f2lpgf_pgf_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1637 "f2lpgf.ctr"
+#line 1667 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[14], job->of1);
-#line 1639 "f2lpgf.ctr"
+#line 1671 "f2lpgf.ctr"
}
@@ -989,17 +999,19 @@ f2lpgf_pgf_clip(
void
f2lpgf_pgf_stroke(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1651 "f2lpgf.ctr"
+#line 1683 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[25], job->of1);
-#line 1653 "f2lpgf.ctr"
+#line 1687 "f2lpgf.ctr"
}
@@ -1007,17 +1019,19 @@ f2lpgf_pgf_stroke(
void
f2lpgf_pgf_gsave(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1665 "f2lpgf.ctr"
+#line 1699 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[4], job->of1);
-#line 1667 "f2lpgf.ctr"
+#line 1703 "f2lpgf.ctr"
}
@@ -1025,17 +1039,19 @@ f2lpgf_pgf_gsave(
void
f2lpgf_pgf_grestore(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
-#line 1679 "f2lpgf.ctr"
+#line 1715 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[5], job->of1);
-#line 1681 "f2lpgf.ctr"
+#line 1719 "f2lpgf.ctr"
}
@@ -1043,22 +1059,23 @@ f2lpgf_pgf_grestore(
void
f2lpgf_pgf_set_line_width(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double lw
)
{
-#line 1694 "f2lpgf.ctr"
-
+#line 1732 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[26], job->of1);
dk3ma_print_double_c8_no_sci(job->of1, lw);
fputs(f2lpgf_c8_kw[12], job->of1);
fputs(f2lpgf_c8_kw[7], job->of1);
-#line 1700 "f2lpgf.ctr"
+#line 1739 "f2lpgf.ctr"
}
@@ -1066,8 +1083,8 @@ f2lpgf_pgf_set_line_width(
void
f2lpgf_pgf_set_line_style(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int ls,
double sv,
double lw
@@ -1079,7 +1096,9 @@ f2lpgf_pgf_set_line_style(
size_t nsv; /* Number of elements in xsv. */
-#line 1719 "f2lpgf.ctr"
+#line 1758 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
ph = 0.0; nsv = 0; xsv[0] = 0.0;
gw = f2lto_find_gap_length(job, lw, sv);
switch(ls) {
@@ -1122,7 +1141,7 @@ f2lpgf_pgf_set_line_style(
f2lpgf_set_line_dash(job->of1, xsv, nsv, ph);
-#line 1760 "f2lpgf.ctr"
+#line 1801 "f2lpgf.ctr"
}
@@ -1130,14 +1149,16 @@ f2lpgf_pgf_set_line_style(
void
f2lpgf_pgf_set_line_end(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int le
)
{
-#line 1773 "f2lpgf.ctr"
+#line 1814 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
switch(le) {
case DK3_FIG_LC_PROJECTING: {
fputs(f2lpgf_c8_kw[29], job->of1);
@@ -1151,7 +1172,7 @@ f2lpgf_pgf_set_line_end(
}
-#line 1785 "f2lpgf.ctr"
+#line 1828 "f2lpgf.ctr"
}
@@ -1159,14 +1180,16 @@ f2lpgf_pgf_set_line_end(
void
f2lpgf_pgf_set_line_join(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int lj
)
{
-#line 1798 "f2lpgf.ctr"
+#line 1841 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
switch(lj) {
case DK3_FIG_LJ_BEVEL: {
fputs(f2lpgf_c8_kw[32], job->of1);
@@ -1180,7 +1203,7 @@ f2lpgf_pgf_set_line_join(
}
-#line 1810 "f2lpgf.ctr"
+#line 1855 "f2lpgf.ctr"
}
@@ -1188,18 +1211,19 @@ f2lpgf_pgf_set_line_join(
void
f2lpgf_pgf_set_color_1(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
-#line 1822 "f2lpgf.ctr"
+#line 1867 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
f2lpgf_define_color(job->of1, 0, rgb);
fputs(f2lpgf_c8_kw[37], job->of1);
-#line 1825 "f2lpgf.ctr"
+#line 1871 "f2lpgf.ctr"
}
@@ -1207,18 +1231,19 @@ f2lpgf_pgf_set_color_1(
void
f2lpgf_pgf_set_color_2(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
-#line 1837 "f2lpgf.ctr"
+#line 1883 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(drw)
f2lpgf_define_color(job->of1, 1, rgb);
fputs(f2lpgf_c8_kw[38], job->of1);
-#line 1840 "f2lpgf.ctr"
+#line 1887 "f2lpgf.ctr"
}
@@ -1227,7 +1252,7 @@ void
f2lpgf_pgf_setcolor(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double r,
double g,
double b
@@ -1236,14 +1261,15 @@ f2lpgf_pgf_setcolor(
dk3_rgb_color_t rgb; /* Color cell. */
-#line 1856 "f2lpgf.ctr"
+#line 1903 "f2lpgf.ctr"
+ DK3_UNUSED_ARG(obj)
rgb.r = r; rgb.g = g; rgb.b = b;
f2lpgf_pgf_set_color_1(job, drw, &rgb);
rgb.r = r; rgb.g = g; rgb.b = b;
f2lpgf_pgf_set_color_2(job, drw, &rgb);
-#line 1861 "f2lpgf.ctr"
+#line 1909 "f2lpgf.ctr"
}
@@ -1255,13 +1281,13 @@ f2lpgf_pgf_debug(
{
-#line 1871 "f2lpgf.ctr"
+#line 1919 "f2lpgf.ctr"
fputs(f2lpgf_c8_kw[39], job->of1);
fputs(msg, job->of1);
fputc('\n', job->of1);
-#line 1875 "f2lpgf.ctr"
+#line 1923 "f2lpgf.ctr"
}
@@ -1273,7 +1299,7 @@ f2lpgf_pgf_debug(
/* ************************************************************************ */
-#line 1882 "f2lpgf.ctr"
+#line 1930 "f2lpgf.ctr"
int
f2lpgf_tex_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
@@ -1315,7 +1341,7 @@ int
f2lpgf_tex_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
int back = 0;
- f2l_tool_begin_latex_document(job->of1, job, drw);
+ f2l_tool_begin_latex_document(job->of1, job);
back = f2lpgf_pgf_start_processing(job, drw);
return back;
}
@@ -1326,7 +1352,7 @@ void
f2lpgf_tex_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
f2lpgf_pgf_end_processing(job, drw);
- f2l_tool_end_latex_document(job->of1, job, drw);
+ f2l_tool_end_latex_document(job->of1);
}
diff --git a/support/dktools/f2lpgf.ctr b/support/dktools/f2lpgf.ctr
index 6e3a5d955b..b85632857a 100644
--- a/support/dktools/f2lpgf.ctr
+++ b/support/dktools/f2lpgf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -768,6 +768,7 @@ f2lpgf_pgf_debug(
#include "dk3bif.h"
#include "dk3bm.h"
#include "dk3figto.h"
+#include "dk3unused.h"
@@ -1044,10 +1045,15 @@ f2lpgf_pdi_delete(f2l_pgf_drawing_info_t *ptr)
*/
static
f2l_pgf_drawing_info_t *
-f2lpgf_pdi_new(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lpgf_pdi_new(
+ f2l_job_t *job,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw)
+)
{
f2l_pgf_drawing_info_t *back = NULL;
int ok = 0;
+
+ DK3_UNUSED_ARG(drw)
back = dk3_new_app(f2l_pgf_drawing_info_t,1,job->app);
if(back) {
back->sFonts = NULL; back->iFonts = NULL; back->nFonts = 0UL;
@@ -1328,7 +1334,7 @@ f2lpgf_pgf_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
back = 1;
/* Font definitions */
f2l_tool_start_tex_part_with_picture(
- job->of1, job, drw, NULL, pdi->iFonts, pdi->nFonts, 0
+ job->of1, job, NULL, pdi->iFonts, pdi->nFonts, 0
);
} else { $? "! no pdi"
}
@@ -1353,9 +1359,13 @@ f2lpgf_pgf_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
void
-f2lpgf_pgf_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lpgf_pgf_end_processing(
+ f2l_job_t *job,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw)
+)
{
$? "+ f2lpgf_pgf_end_processing"
+ DK3_UNUSED_ARG(drw)
/* End PGF scope */
fputs(f2lpgf_c8_kw[5], job->of1);
/* End PGF picture */
@@ -1411,7 +1421,7 @@ f2lpgf_pgf_text_object(
void
f2lpgf_pgf_image_object(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_fig_obj_t *obj,
dk3_bb_t *outbb,
int drawdir,
@@ -1426,6 +1436,7 @@ f2lpgf_pgf_image_object(
double yres = -1.0; /* Y resolution, none by default. */
int res = 0; /* Result from transformation search. */
$? "+ f2lpgf_pgf_image_object"
+ DK3_UNUSED_ARG(drw)
if((obj->dt).pol.fn) {
bif = dk3bif_open_c8_filename_app(
(obj->dt).pol.fn, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app
@@ -1482,12 +1493,15 @@ f2lpgf_pgf_image_object(
void
f2lpgf_pgf_newpath(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_newpath"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(job)
/* Nothing to do here, new paths are automatically started by moveto. */
$? "- f2lpgf_pgf_newpath"
}
@@ -1497,13 +1511,15 @@ f2lpgf_pgf_newpath(
void
f2lpgf_pgf_moveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
$? "+ f2lpgf_pgf_moveto"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[16], job->of1);
f2lpgf_write_point_double(job->of1, x, y);
fputs(f2lpgf_c8_kw[7], job->of1);
@@ -1515,13 +1531,15 @@ f2lpgf_pgf_moveto(
void
f2lpgf_pgf_lineto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double x,
double y
)
{
$? "+ f2lpgf_pgf_lineto"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[17], job->of1);
f2lpgf_write_point_double(job->of1, x, y);
fputs(f2lpgf_c8_kw[7], job->of1);
@@ -1533,8 +1551,8 @@ f2lpgf_pgf_lineto(
void
f2lpgf_pgf_curveto(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double xcs,
double ycs,
double xce,
@@ -1544,6 +1562,8 @@ f2lpgf_pgf_curveto(
)
{
$? "+ f2lpgf_pgf_curveto"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[18], job->of1);
f2lpgf_write_point_double(job->of1, xcs, ycs);
fputs(f2lpgf_c8_kw[19], job->of1);
@@ -1559,11 +1579,13 @@ f2lpgf_pgf_curveto(
void
f2lpgf_pgf_closepath(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_closepath"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[20], job->of1);
$? "- f2lpgf_pgf_closepath"
}
@@ -1573,11 +1595,13 @@ f2lpgf_pgf_closepath(
void
f2lpgf_pgf_fill(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_fill"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[21], job->of1);
$? "- f2lpgf_pgf_fill"
}
@@ -1587,11 +1611,13 @@ f2lpgf_pgf_fill(
void
f2lpgf_pgf_fill_stroke(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_fill_stroke"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[22], job->of1);
$? "- f2lpgf_pgf_fill_stroke"
}
@@ -1601,11 +1627,13 @@ f2lpgf_pgf_fill_stroke(
void
f2lpgf_pgf_fill_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_fill_clip"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[23], job->of1);
$? "- f2lpgf_pgf_fill_clip"
}
@@ -1615,11 +1643,13 @@ f2lpgf_pgf_fill_clip(
void
f2lpgf_pgf_fill_stroke_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_fill_stroke_clip"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[24], job->of1);
$? "- f2lpgf_pgf_fill_stroke_clip"
}
@@ -1629,11 +1659,13 @@ f2lpgf_pgf_fill_stroke_clip(
void
f2lpgf_pgf_clip(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_clip"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[14], job->of1);
$? "- f2lpgf_pgf_clip"
}
@@ -1643,11 +1675,13 @@ f2lpgf_pgf_clip(
void
f2lpgf_pgf_stroke(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_stroke"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[25], job->of1);
$? "- f2lpgf_pgf_stroke"
}
@@ -1657,11 +1691,13 @@ f2lpgf_pgf_stroke(
void
f2lpgf_pgf_gsave(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_gsave"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[4], job->of1);
$? "- f2lpgf_pgf_gsave"
}
@@ -1671,11 +1707,13 @@ f2lpgf_pgf_gsave(
void
f2lpgf_pgf_grestore(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj)
)
{
$? "+ f2lpgf_pgf_grestore"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[5], job->of1);
$? "- f2lpgf_pgf_grestore"
}
@@ -1685,13 +1723,14 @@ f2lpgf_pgf_grestore(
void
f2lpgf_pgf_set_line_width(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double lw
)
{
$? "+ f2lpgf_pgf_set_line_width"
-
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
fputs(f2lpgf_c8_kw[26], job->of1);
dk3ma_print_double_c8_no_sci(job->of1, lw);
fputs(f2lpgf_c8_kw[12], job->of1);
@@ -1704,8 +1743,8 @@ f2lpgf_pgf_set_line_width(
void
f2lpgf_pgf_set_line_style(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int ls,
double sv,
double lw
@@ -1716,6 +1755,8 @@ f2lpgf_pgf_set_line_style(
double gw; /* Gap width. */
size_t nsv; /* Number of elements in xsv. */
$? "+ f2lpgf_pgf_set_line_style"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
ph = 0.0; nsv = 0; xsv[0] = 0.0;
gw = f2lto_find_gap_length(job, lw, sv);
switch(ls) {
@@ -1764,12 +1805,14 @@ f2lpgf_pgf_set_line_style(
void
f2lpgf_pgf_set_line_end(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int le
)
{
$? "+ f2lpgf_pgf_set_line_end"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
switch(le) {
case DK3_FIG_LC_PROJECTING: {
fputs(f2lpgf_c8_kw[29], job->of1);
@@ -1789,12 +1832,14 @@ f2lpgf_pgf_set_line_end(
void
f2lpgf_pgf_set_line_join(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
int lj
)
{
$? "+ f2lpgf_pgf_set_line_join"
+ DK3_UNUSED_ARG(drw)
+ DK3_UNUSED_ARG(obj)
switch(lj) {
case DK3_FIG_LJ_BEVEL: {
fputs(f2lpgf_c8_kw[32], job->of1);
@@ -1814,11 +1859,12 @@ f2lpgf_pgf_set_line_join(
void
f2lpgf_pgf_set_color_1(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
$? "+ f2lpgf_pgf_set_color_1"
+ DK3_UNUSED_ARG(drw)
f2lpgf_define_color(job->of1, 0, rgb);
fputs(f2lpgf_c8_kw[37], job->of1);
$? "- f2lpgf_pgf_set_color_1"
@@ -1829,11 +1875,12 @@ f2lpgf_pgf_set_color_1(
void
f2lpgf_pgf_set_color_2(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_rgb_color_t *rgb
)
{
$? "+ f2lpgf_pgf_set_color_2"
+ DK3_UNUSED_ARG(drw)
f2lpgf_define_color(job->of1, 1, rgb);
fputs(f2lpgf_c8_kw[38], job->of1);
$? "- f2lpgf_pgf_set_color_2"
@@ -1845,7 +1892,7 @@ void
f2lpgf_pgf_setcolor(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
double r,
double g,
double b
@@ -1853,6 +1900,7 @@ f2lpgf_pgf_setcolor(
{
dk3_rgb_color_t rgb; /* Color cell. */
$? "+ f2lpgf_pgf_setcolor"
+ DK3_UNUSED_ARG(obj)
rgb.r = r; rgb.g = g; rgb.b = b;
f2lpgf_pgf_set_color_1(job, drw, &rgb);
rgb.r = r; rgb.g = g; rgb.b = b;
@@ -1920,7 +1968,7 @@ int
f2lpgf_tex_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
int back = 0;
- f2l_tool_begin_latex_document(job->of1, job, drw);
+ f2l_tool_begin_latex_document(job->of1, job);
back = f2lpgf_pgf_start_processing(job, drw);
return back;
}
@@ -1931,7 +1979,7 @@ void
f2lpgf_tex_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
f2lpgf_pgf_end_processing(job, drw);
- f2l_tool_end_latex_document(job->of1, job, drw);
+ f2l_tool_end_latex_document(job->of1);
}
diff --git a/support/dktools/f2lpgf.h b/support/dktools/f2lpgf.h
index 460b790b12..e7041f3ef9 100644
--- a/support/dktools/f2lpgf.h
+++ b/support/dktools/f2lpgf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lpgf.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lpgf.ctr
*/
/** @file f2lpgf.h Header file for the f2lpgf module.
diff --git a/support/dktools/f2lsvg.c b/support/dktools/f2lsvg.c
index f8d8442269..d55b0666bb 100644
--- a/support/dktools/f2lsvg.c
+++ b/support/dktools/f2lsvg.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lsvg.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lsvg.ctr
*/
/** @file f2lsvg.c The f2lsvg module.
@@ -55,12 +33,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3xsp.h"
#include "dk3font.h"
#include "dk3bif.h"
+#include "dk3unused.h"
-#line 49 "f2lsvg.ctr"
+#line 50 "f2lsvg.ctr"
@@ -119,7 +98,7 @@ static char const * const f2lsvg_c8_kw[] = {
"Fig file converted by fig2lat",
/* 17 */
-"http://dktools.sourceforge.net/fig2lat.html",
+"http://sourceforge.net/p/dktools/wiki/fig2lat/",
/* 18 */
"defs",
@@ -274,7 +253,7 @@ static char const * const f2lsvg_c8_kw[] = {
NULL
-#line 239 "f2lsvg.ctr"
+#line 240 "f2lsvg.ctr"
};
@@ -548,7 +527,7 @@ static char const * const f2lsvg_html_translation_table[] = {
/* ************************************************************************ */
-#line 508 "f2lsvg.ctr"
+#line 509 "f2lsvg.ctr"
@@ -689,7 +668,7 @@ f2lsvg_coordinates_transformation(f2l_job_t *job, dk3_fig_drawing_t *drw)
int mec = 0;
-#line 647 "f2lsvg.ctr"
+#line 648 "f2lsvg.ctr"
(job->ct2d).mx = (job->ct2d).my = dk3ma_d_div_ok(72.0, drw->res, &mec);
xmin = dk3ma_d_mul_ok((job->ct2d).mx, (drw->bb).xmin, &mec);
xmax = dk3ma_d_mul_ok((job->ct2d).mx, (drw->bb).xmax, &mec);
@@ -713,20 +692,20 @@ f2lsvg_coordinates_transformation(f2l_job_t *job, dk3_fig_drawing_t *drw)
job->lheight = dk3ma_d_to_l_ok(job->height, &mec);
-#line 669 "f2lsvg.ctr"
+#line 670 "f2lsvg.ctr"
-#line 670 "f2lsvg.ctr"
+#line 671 "f2lsvg.ctr"
if(mec) {
back = 0;
/* ERROR: Math problem */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 675 "f2lsvg.ctr"
+#line 676 "f2lsvg.ctr"
}
-#line 676 "f2lsvg.ctr"
+#line 677 "f2lsvg.ctr"
return back;
}
@@ -754,7 +733,7 @@ f2lsvg_text_object_style(
int back = 1;
-#line 702 "f2lsvg.ctr"
+#line 703 "f2lsvg.ctr"
if(!(DK3_FIG_FONT_FLAG_HIDDEN & ((pobj->dt).txt.ff))) {
f2lsvgst_style_initialize(&sty);
/* Fill color.
@@ -777,12 +756,12 @@ f2lsvg_text_object_style(
back = 0;
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 723 "f2lsvg.ctr"
+#line 724 "f2lsvg.ctr"
}
}
-#line 726 "f2lsvg.ctr"
+#line 727 "f2lsvg.ctr"
return back;
}
@@ -818,7 +797,7 @@ f2lsvg_path_object_style(
int back = 1 ;
-#line 760 "f2lsvg.ctr"
+#line 761 "f2lsvg.ctr"
op = dk3fig_tool_get_operation(drw, pobj);
f2lsvgst_style_initialize(&sty);
if(op & DK3_FIG_OP_PATTERN) {
@@ -839,14 +818,14 @@ f2lsvg_path_object_style(
dk3app_log_i1(job->app, DK3_LL_ERROR, 9);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 779 "f2lsvg.ctr"
+#line 780 "f2lsvg.ctr"
} break;
default: {
/* ERROR: Mathematical error. */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 784 "f2lsvg.ctr"
+#line 785 "f2lsvg.ctr"
} break;
}
}
@@ -873,7 +852,7 @@ f2lsvg_path_object_style(
mec = 0;
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 809 "f2lsvg.ctr"
+#line 810 "f2lsvg.ctr"
}
/* Line style.
*/
@@ -906,12 +885,12 @@ f2lsvg_path_object_style(
back = 0;
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 840 "f2lsvg.ctr"
+#line 841 "f2lsvg.ctr"
}
}
-#line 843 "f2lsvg.ctr"
+#line 844 "f2lsvg.ctr"
return back;
}
@@ -959,7 +938,7 @@ f2lsvg_object_style_collection(
if(!(back)) {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 889 "f2lsvg.ctr"
+#line 890 "f2lsvg.ctr"
}
return back;
}
@@ -984,7 +963,7 @@ f2lsvg_collect_styles(f2l_job_t *job, dk3_fig_drawing_t *drw, f2l_svg_t *psvg)
int back = 1;
-#line 912 "f2lsvg.ctr"
+#line 913 "f2lsvg.ctr"
oldsourceline = dk3app_get_source_line(job->app);
dk3sto_it_reset(drw->iobj);
while(NULL != (pobj = (dk3_fig_obj_t *)dk3sto_it_next(drw->iobj))) {
@@ -1027,7 +1006,7 @@ f2lsvg_collect_styles(f2l_job_t *job, dk3_fig_drawing_t *drw, f2l_svg_t *psvg)
dk3app_set_source_line(job->app, oldsourceline);
-#line 953 "f2lsvg.ctr"
+#line 954 "f2lsvg.ctr"
return back;
}
@@ -1067,7 +1046,7 @@ static
void
f2lsvg_write_font_faces(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
f2l_svg_t *psvg
)
{
@@ -1078,10 +1057,11 @@ f2lsvg_write_font_faces(
int res = 0;
-#line 1002 "f2lsvg.ctr"
+#line 1003 "f2lsvg.ctr"
+ DK3_UNUSED_ARG(drw)
if(0 < job->svgfontbase) {
-#line 1003 "f2lsvg.ctr"
+#line 1005 "f2lsvg.ctr"
switch(job->svgfontbase) {
case 2: {
res = dk3font_gs_base_web(job->app, dkb, DK3_SIZEOF(dkb,dkChar));
@@ -1092,16 +1072,16 @@ f2lsvg_write_font_faces(
}
if(res) {
-#line 1012 "f2lsvg.ctr"
+#line 1014 "f2lsvg.ctr"
res = dk3str_to_c8p_app(
chb, sizeof(chb), dkb, dk3app_get_encoding(job->app), job->app
);
-#line 1015 "f2lsvg.ctr"
+#line 1017 "f2lsvg.ctr"
}
for(i = 0; i < 35; i++) {
-#line 1017 "f2lsvg.ctr"
+#line 1019 "f2lsvg.ctr"
if((psvg->psFontsUsed)[i]) {
fputs(f2lsvg_c8_kw[23], job->of1);
/* Font family.
@@ -1110,7 +1090,7 @@ f2lsvg_write_font_faces(
fputs(dk3font_get_svg_family((int)i), job->of1);
fputs(f2lsvg_c8_kw[26], job->of1);
-#line 1024 "f2lsvg.ctr"
+#line 1026 "f2lsvg.ctr"
/* Font style
*/
fs = dk3font_get_svg_features((int)i);
@@ -1124,13 +1104,13 @@ f2lsvg_write_font_faces(
}
}
-#line 1036 "f2lsvg.ctr"
+#line 1038 "f2lsvg.ctr"
/* Font weight
*/
fprintf(job->of1,f2lsvg_c8_kw[30],dk3font_get_svg_font_weight((int)i));
-#line 1040 "f2lsvg.ctr"
+#line 1042 "f2lsvg.ctr"
/* Source
*/
fputs(f2lsvg_c8_kw[31], job->of1);
@@ -1148,33 +1128,33 @@ f2lsvg_write_font_faces(
}
}
-#line 1056 "f2lsvg.ctr"
+#line 1058 "f2lsvg.ctr"
fputs(dk3font_get_gs_old_file((int)i), job->of1);
-#line 1057 "f2lsvg.ctr"
+#line 1059 "f2lsvg.ctr"
fputs(f2lsvg_c8_kw[32], job->of1);
#if 0
/* 2013-01-30 No font id for TTF fonts
*/
fputs(dk3font_get_svg_fontid((int)i), job->of1);
-#line 1062 "f2lsvg.ctr"
+#line 1064 "f2lsvg.ctr"
#endif
fputs(f2lsvg_c8_kw[33], job->of1);
-#line 1064 "f2lsvg.ctr"
+#line 1066 "f2lsvg.ctr"
fputs(f2lsvg_c8_kw[24], job->of1);
-#line 1065 "f2lsvg.ctr"
+#line 1067 "f2lsvg.ctr"
}
-#line 1066 "f2lsvg.ctr"
+#line 1068 "f2lsvg.ctr"
}
-#line 1067 "f2lsvg.ctr"
+#line 1069 "f2lsvg.ctr"
}
-#line 1068 "f2lsvg.ctr"
+#line 1070 "f2lsvg.ctr"
}
@@ -1186,7 +1166,7 @@ f2lsvg_write_font_faces(
/* ************************************************************************ */
-#line 1075 "f2lsvg.ctr"
+#line 1077 "f2lsvg.ctr"
/** Driver-specific initialization.
@@ -1202,7 +1182,7 @@ f2lsvg_driver_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
int back = 0;
-#line 1089 "f2lsvg.ctr"
+#line 1091 "f2lsvg.ctr"
if(f2lsvg_coordinates_transformation(job, drw)) {
psvg = f2lsvgst_new_app(job->app);
if(psvg) {
@@ -1211,7 +1191,7 @@ f2lsvg_driver_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
}
}
-#line 1096 "f2lsvg.ctr"
+#line 1098 "f2lsvg.ctr"
return back;
}
@@ -1223,17 +1203,21 @@ f2lsvg_driver_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
*/
static
void
-f2lsvg_driver_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lsvg_driver_end(
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t *drw
+)
{
-#line 1110 "f2lsvg.ctr"
+#line 1115 "f2lsvg.ctr"
+ DK3_UNUSED_ARG(job)
if(drw->dsd) {
f2lsvgst_delete((f2l_svg_t *)(drw->dsd));
} drw->dsd = NULL;
-#line 1114 "f2lsvg.ctr"
+#line 1120 "f2lsvg.ctr"
}
@@ -1253,7 +1237,7 @@ f2lsvg_open_output_files(f2l_job_t *job)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1132 "f2lsvg.ctr"
+#line 1138 "f2lsvg.ctr"
}
return back;
}
@@ -1335,7 +1319,7 @@ f2lsvg_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
int back = 1;
-#line 1212 "f2lsvg.ctr"
+#line 1218 "f2lsvg.ctr"
psvg = (f2l_svg_t *)(drw->dsd);
/* XML header and doctype.
*/
@@ -1376,7 +1360,7 @@ f2lsvg_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
fputs(f2lsvg_c8_kw[0], job->of1);
/* Pattern definitions.
*/
- f2lsvgst_write_patterns(job, drw, psvg);
+ f2lsvgst_write_patterns(job, psvg);
if(f2lsvg_must_write_style(job, psvg)) {
f2lsvg_tag_open_start(job, 19);
fputs(f2lsvg_c8_kw[20], job->of1);
@@ -1389,7 +1373,7 @@ f2lsvg_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
/* Style definitions.
*/
if(job->css) {
- f2lsvgst_write_styles(job, drw, psvg);
+ f2lsvgst_write_styles(job, psvg);
}
fputs(f2lsvg_c8_kw[22], job->of1);
f2lsvg_tag_close(job, 19);
@@ -1397,7 +1381,7 @@ f2lsvg_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
f2lsvg_tag_close(job, 18);
}
-#line 1272 "f2lsvg.ctr"
+#line 1278 "f2lsvg.ctr"
return back;
}
@@ -1409,8 +1393,12 @@ f2lsvg_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
*/
static
void
-f2lsvg_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lsvg_end_processing(
+ f2l_job_t *job,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw)
+)
{
+ DK3_UNUSED_ARG(drw)
f2lsvg_tag_close(job, 10);
}
@@ -1513,7 +1501,7 @@ f2lsvg_process_box(
int mec = 0;
-#line 1386 "f2lsvg.ctr"
+#line 1396 "f2lsvg.ctr"
po = (obj->dt).pol.po;
if(po) {
dk3bb_reset(&outbb);
@@ -1529,14 +1517,14 @@ f2lsvg_process_box(
r = -1.0;
if(arcbox) {
-#line 1400 "f2lsvg.ctr"
+#line 1410 "f2lsvg.ctr"
r = fabs(0.9 * (obj->dt).pol.ra);
-#line 1401 "f2lsvg.ctr"
+#line 1411 "f2lsvg.ctr"
if(r > (0.5 * w)) { r = 0.5 * w; }
if(r > (0.5 * h)) { r = 0.5 * h; }
-#line 1403 "f2lsvg.ctr"
+#line 1413 "f2lsvg.ctr"
}
if(0 == mec) {
fputs(f2lsvg_c8_kw[6], job->of1);
@@ -1555,7 +1543,7 @@ f2lsvg_process_box(
if(mec) { *ec = mec; }
-#line 1420 "f2lsvg.ctr"
+#line 1430 "f2lsvg.ctr"
}
@@ -1675,7 +1663,7 @@ void
f2lsvg_process_image(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
+ f2l_svg_t * DK3_SILENCE_ARG_UNUSED(psvg),
dk3_fig_obj_t *obj,
int *ec
)
@@ -1706,6 +1694,7 @@ f2lsvg_process_image(
int doScaleX = 0; /* Flag: Scale x=-1. */
int doScaleY = 0; /* Flag: Sclae y=-1. */
+ DK3_UNUSED_ARG(psvg)
if((obj->dt).pol.fn) {
bif = dk3bif_open_c8_filename_app(
(obj->dt).pol.fn, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app
@@ -1732,7 +1721,7 @@ f2lsvg_process_image(
y1 = outbb.ymin; y2 = outbb.ymax;
/* Find drawing direction.
*/
- drawdir = f2lto_find_draw_direction(job, drw, obj, ec);
+ drawdir = f2lto_find_draw_direction(drw, obj, ec);
/* Find real image width and height.
*/
if((xres > 0.0) && (yres > 0.0)) {
@@ -1859,7 +1848,7 @@ f2lsvg_process_image(
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1722 "f2lsvg.ctr"
+#line 1733 "f2lsvg.ctr"
}
}
}
@@ -1923,7 +1912,7 @@ void
f2lsvg_process_full_spline_segment(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
dk3_fig_spline_point_t *sp,
size_t np,
size_t cp,
@@ -1956,52 +1945,53 @@ f2lsvg_process_full_spline_segment(
int mec = 0;
-#line 1817 "f2lsvg.ctr"
+#line 1828 "f2lsvg.ctr"
+ DK3_UNUSED_ARG(obj)
if(cp < ((iscl) ? (np) : (np - 1))) {
pb = &(sp[cp]);
-#line 1819 "f2lsvg.ctr"
+#line 1831 "f2lsvg.ctr"
ic = cp + 1;
while(ic >= np) { ic = ic - np; }
-#line 1821 "f2lsvg.ctr"
+#line 1833 "f2lsvg.ctr"
pc = &(sp[ic]);
if(cp > 0) {
-#line 1823 "f2lsvg.ctr"
+#line 1835 "f2lsvg.ctr"
pa = &(sp[cp - 1]);
} else {
if(iscl) {
-#line 1826 "f2lsvg.ctr"
+#line 1838 "f2lsvg.ctr"
pa = &(sp[np - 1]);
}
}
if(cp < (np - 2)) {
-#line 1830 "f2lsvg.ctr"
+#line 1842 "f2lsvg.ctr"
pd = &(sp[cp + 2]);
} else {
if(iscl) {
id = cp + 2;
while(id >= np) { id = id - np; }
-#line 1835 "f2lsvg.ctr"
+#line 1847 "f2lsvg.ctr"
pd = &(sp[id]);
}
}
xsss = dk3fig_tool_xssbs(drw, primary);
-#line 1839 "f2lsvg.ctr"
+#line 1851 "f2lsvg.ctr"
factor = 1.0 / (double)xsss;
dk3xsp_reset(&seg);
if(job->cosp) { dk3xsp_set_cb(&seg, 1); }
dk3xsp_set(&seg, pa, pb, pc, pd);
-#line 1843 "f2lsvg.ctr"
+#line 1855 "f2lsvg.ctr"
if(dk3xsp_calculate(&seg, 0.0, 1)) {
-#line 1844 "f2lsvg.ctr"
+#line 1856 "f2lsvg.ctr"
lastx = dk3xsp_get_x(&seg);
lasty = dk3xsp_get_y(&seg);
lastdxdt = dk3xsp_get_dxdt(&seg);
@@ -2010,7 +2000,7 @@ f2lsvg_process_full_spline_segment(
lastdydt = (factor * lastdydt) / 3.0;
if(isfirst) {
-#line 1851 "f2lsvg.ctr"
+#line 1863 "f2lsvg.ctr"
/* MOVETO lastx lasty */
fprintf(
job->of1, f2lsvg_c8_kw[56],
@@ -2020,17 +2010,17 @@ f2lsvg_process_full_spline_segment(
}
for(iseg = 0; iseg < xsss; iseg++) {
-#line 1859 "f2lsvg.ctr"
+#line 1871 "f2lsvg.ctr"
if(iseg < (xsss - 1)) {
t = (double)(iseg + 1) / (double)xsss;
} else {
t = 1.0;
}
-#line 1864 "f2lsvg.ctr"
+#line 1876 "f2lsvg.ctr"
res = dk3xsp_calculate(&seg, t, 1);
-#line 1865 "f2lsvg.ctr"
+#line 1877 "f2lsvg.ctr"
if(!(res)) { mec = DK3_ERROR_MATH_OVERFLOW; }
x = dk3xsp_get_x(&seg);
y = dk3xsp_get_y(&seg);
@@ -2039,7 +2029,7 @@ f2lsvg_process_full_spline_segment(
dxdt = (factor * dxdt) / 3.0;
dydt = (factor * dydt) / 3.0;
-#line 1872 "f2lsvg.ctr"
+#line 1884 "f2lsvg.ctr"
fprintf(
job->of1, f2lsvg_c8_kw[57],
dk3ct_2d_x(&(job->ct2d), dk3ma_d_add_ok(lastx, lastdxdt, &mec), &mec),
@@ -2062,7 +2052,7 @@ f2lsvg_process_full_spline_segment(
}
}
-#line 1893 "f2lsvg.ctr"
+#line 1905 "f2lsvg.ctr"
}
} else {
mec = DK3_ERROR_MATH_OVERFLOW;
@@ -2071,7 +2061,7 @@ f2lsvg_process_full_spline_segment(
if(mec) { *ec = mec; }
-#line 1900 "f2lsvg.ctr"
+#line 1912 "f2lsvg.ctr"
}
@@ -2094,13 +2084,13 @@ void
f2lsvg_first_spline_segment(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
dk3_fig_spline_point_t *sp,
size_t np,
size_t i,
double ts,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -2127,17 +2117,19 @@ f2lsvg_first_spline_segment(
int res; /* Calculation result. */
-#line 1954 "f2lsvg.ctr"
+#line 1966 "f2lsvg.ctr"
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(iscl)
myts = dk3ma_d_sub_ok(ts, floor(ts), ec);
-#line 1955 "f2lsvg.ctr"
+#line 1969 "f2lsvg.ctr"
dnumsegs = (1.0 - myts) * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs);
-#line 1957 "f2lsvg.ctr"
+#line 1971 "f2lsvg.ctr"
nsegs = dk3ma_d_to_sz_ok(dnumsegs, ec);
-#line 1958 "f2lsvg.ctr"
+#line 1972 "f2lsvg.ctr"
pb = &(sp[i]);
pc = &(sp[i + 1]);
if(0 < i) {
@@ -2148,7 +2140,7 @@ f2lsvg_first_spline_segment(
}
factor = (1.0 - myts) / (double)nsegs;
-#line 1967 "f2lsvg.ctr"
+#line 1981 "f2lsvg.ctr"
dk3xsp_reset(&seg);
if(job->cosp) { dk3xsp_set_cb(&seg, 1); }
dk3xsp_set(&seg, pa, pb, pc, pd);
@@ -2205,7 +2197,7 @@ f2lsvg_first_spline_segment(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 2022 "f2lsvg.ctr"
+#line 2036 "f2lsvg.ctr"
}
x = dk3xsp_get_x(&seg);
y = dk3xsp_get_y(&seg);
@@ -2219,11 +2211,11 @@ f2lsvg_first_spline_segment(
if(ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 2034 "f2lsvg.ctr"
+#line 2048 "f2lsvg.ctr"
}
-#line 2036 "f2lsvg.ctr"
+#line 2050 "f2lsvg.ctr"
}
@@ -2246,13 +2238,13 @@ void
f2lsvg_final_spline_segment(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
dk3_fig_spline_point_t *sp,
size_t np,
size_t i,
double te,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -2279,17 +2271,19 @@ f2lsvg_final_spline_segment(
int res; /* Calculation result. */
-#line 2090 "f2lsvg.ctr"
+#line 2104 "f2lsvg.ctr"
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(iscl)
myte = dk3ma_d_sub_ok(te, floor(te), ec);
-#line 2091 "f2lsvg.ctr"
+#line 2107 "f2lsvg.ctr"
dnumsegs = myte * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs);
-#line 2093 "f2lsvg.ctr"
+#line 2109 "f2lsvg.ctr"
nsegs = dk3ma_d_to_sz_ok(dnumsegs, ec);
-#line 2094 "f2lsvg.ctr"
+#line 2110 "f2lsvg.ctr"
pb = &(sp[i]);
pc = &(sp[i + 1]);
if(0 < i) {
@@ -2300,7 +2294,7 @@ f2lsvg_final_spline_segment(
}
factor = myte / (double)nsegs;
-#line 2103 "f2lsvg.ctr"
+#line 2119 "f2lsvg.ctr"
dk3xsp_reset(&seg);
if(job->cosp) { dk3xsp_set_cb(&seg, 1); }
dk3xsp_set(&seg, pa, pb, pc, pd);
@@ -2325,20 +2319,20 @@ f2lsvg_final_spline_segment(
*/
if(1.0e-6 < myte) {
-#line 2126 "f2lsvg.ctr"
+#line 2142 "f2lsvg.ctr"
for(iseg = 0; iseg < nsegs; iseg++) {
if(iseg < (nsegs - 1)) {
-#line 2128 "f2lsvg.ctr"
+#line 2144 "f2lsvg.ctr"
t = (double)(iseg + 1) / (double)nsegs;
t = t * myte;
} else {
-#line 2131 "f2lsvg.ctr"
+#line 2147 "f2lsvg.ctr"
t = myte;
}
-#line 2133 "f2lsvg.ctr"
+#line 2149 "f2lsvg.ctr"
res = dk3xsp_calculate(&seg, t, 1);
if(!(res)) {
if(ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
@@ -2365,7 +2359,7 @@ f2lsvg_final_spline_segment(
}
} else {
-#line 2158 "f2lsvg.ctr"
+#line 2174 "f2lsvg.ctr"
res = dk3xsp_calculate(&seg, myte, 0);
if(!(res)) {
if(ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
@@ -2373,7 +2367,7 @@ f2lsvg_final_spline_segment(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 2164 "f2lsvg.ctr"
+#line 2180 "f2lsvg.ctr"
}
x = dk3xsp_get_x(&seg);
y = dk3xsp_get_y(&seg);
@@ -2387,11 +2381,11 @@ f2lsvg_final_spline_segment(
if(ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 2176 "f2lsvg.ctr"
+#line 2192 "f2lsvg.ctr"
}
-#line 2178 "f2lsvg.ctr"
+#line 2194 "f2lsvg.ctr"
}
@@ -2416,14 +2410,14 @@ void
f2lsvg_single_spline_segment(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
dk3_fig_spline_point_t *sp,
size_t np,
size_t i,
double ts,
double te,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -2451,7 +2445,9 @@ f2lsvg_single_spline_segment(
int res; /* Calculation result. */
-#line 2236 "f2lsvg.ctr"
+#line 2252 "f2lsvg.ctr"
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(iscl)
myte = dk3ma_d_sub_ok(te, floor(te), ec);
myts = dk3ma_d_sub_ok(ts, floor(ts), ec);
dnumsegs = (myte - myts) * dk3fig_tool_xssbs(drw, primary);
@@ -2522,7 +2518,7 @@ f2lsvg_single_spline_segment(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 2305 "f2lsvg.ctr"
+#line 2323 "f2lsvg.ctr"
}
x = dk3xsp_get_x(&seg);
y = dk3xsp_get_y(&seg);
@@ -2538,11 +2534,11 @@ f2lsvg_single_spline_segment(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 2319 "f2lsvg.ctr"
+#line 2337 "f2lsvg.ctr"
}
-#line 2321 "f2lsvg.ctr"
+#line 2339 "f2lsvg.ctr"
}
@@ -2586,7 +2582,7 @@ f2lsvg_process_open_spline(
} else {
if(obj->ab) {
-#line 2363 "f2lsvg.ctr"
+#line 2381 "f2lsvg.ctr"
/* 2013-11-23
ROUNDING DOWNWARDS INTENDED.
We want to find the start segment.
@@ -2594,7 +2590,7 @@ f2lsvg_process_open_spline(
min = dk3ma_d_to_sz_ok(floor((obj->dt).spl.ts), ec);
if(obj->af) {
-#line 2369 "f2lsvg.ctr"
+#line 2387 "f2lsvg.ctr"
if((obj->dt).spl.te >= (obj->dt).spl.ts) {
/* 2013-11-23
ROUNDING DOWNWARDS INTENDED.
@@ -2624,11 +2620,11 @@ f2lsvg_process_open_spline(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 37);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYNTAX);
-#line 2397 "f2lsvg.ctr"
+#line 2415 "f2lsvg.ctr"
}
} else {
-#line 2399 "f2lsvg.ctr"
+#line 2417 "f2lsvg.ctr"
f2lsvg_first_spline_segment(
job, drw, obj, sp, np, min, (obj->dt).spl.ts, 1, 0, primary, ec
);
@@ -2640,10 +2636,10 @@ f2lsvg_process_open_spline(
}
} else {
-#line 2409 "f2lsvg.ctr"
+#line 2427 "f2lsvg.ctr"
if(obj->af) {
-#line 2410 "f2lsvg.ctr"
+#line 2428 "f2lsvg.ctr"
/* 2013-11-23
ROUNDING DOWNWARDS INTENDED.
We want to find the last full segment to draw.
@@ -2669,11 +2665,11 @@ f2lsvg_process_open_spline(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 2434 "f2lsvg.ctr"
+#line 2452 "f2lsvg.ctr"
}
} else {
-#line 2436 "f2lsvg.ctr"
+#line 2454 "f2lsvg.ctr"
for(i = 0; i < (np - 1); i++) {
f2lsvg_process_full_spline_segment(
job, drw, obj, sp, np, i, ((0 == i) ? 1 : 0), 0, primary, ec
@@ -2716,7 +2712,7 @@ f2lsvg_process_fast_open_spline(
size_t ic;
-#line 2477 "f2lsvg.ctr"
+#line 2495 "f2lsvg.ctr"
po = (obj->dt).spl.po;
np = (obj->dt).spl.np;
fputs(f2lsvg_c8_kw[6], job->of1);
@@ -2797,7 +2793,7 @@ f2lsvg_process_fast_open_spline(
fputs(f2lsvg_c8_kw[36], job->of1);
-#line 2556 "f2lsvg.ctr"
+#line 2574 "f2lsvg.ctr"
}
@@ -2873,7 +2869,7 @@ f2lsvg_process_fast_closed_spline(
-#line 2630 "f2lsvg.ctr"
+#line 2648 "f2lsvg.ctr"
po = (obj->dt).spl.po;
np = (obj->dt).spl.np;
fputs(f2lsvg_c8_kw[6], job->of1);
@@ -2963,7 +2959,7 @@ f2lsvg_process_fast_closed_spline(
fputs(f2lsvg_c8_kw[36], job->of1);
-#line 2718 "f2lsvg.ctr"
+#line 2736 "f2lsvg.ctr"
}
@@ -3220,7 +3216,7 @@ f2lsvg_process_half_circle(
int mec = 0; /* Mathematical error code. */
-#line 2973 "f2lsvg.ctr"
+#line 2991 "f2lsvg.ctr"
po[0].x = 0.0;
po[0].y = (obj->dt).hci.ra;
po[1].x = -1.0 * FIG2LAT_CIRCLE_QUADRANT_BEZIER * (obj->dt).hci.ra;
@@ -3271,7 +3267,7 @@ f2lsvg_process_half_circle(
if(mec) { *ec = mec; }
-#line 3022 "f2lsvg.ctr"
+#line 3040 "f2lsvg.ctr"
}
@@ -3298,10 +3294,10 @@ f2lsvg_process_one(
int op;
-#line 3047 "f2lsvg.ctr"
+#line 3065 "f2lsvg.ctr"
op = dk3fig_tool_get_operation(drw, obj);
-#line 3048 "f2lsvg.ctr"
+#line 3066 "f2lsvg.ctr"
switch(obj->ot) {
case DK3_FIG_OBJ_ELLIPSE: {
if(op) { f2lsvg_process_ellipse(job, drw, psvg, obj, ec); }
@@ -3320,7 +3316,7 @@ f2lsvg_process_one(
} break;
case DK3_FIG_OBJ_PSEUDO_HALF_CIRCLE: {
-#line 3065 "f2lsvg.ctr"
+#line 3083 "f2lsvg.ctr"
if(op) {f2lsvg_process_half_circle(job, drw, psvg, obj, ec); }
} break;
case DK3_FIG_OBJ_PSEUDO_FAST_SPLINE: {
@@ -3339,7 +3335,7 @@ f2lsvg_process_one(
}
-#line 3082 "f2lsvg.ctr"
+#line 3100 "f2lsvg.ctr"
}
@@ -3357,41 +3353,41 @@ f2lsvg_check_must_group(f2l_job_t *job, dk3_fig_obj_t *obj)
int back = 0;
-#line 3098 "f2lsvg.ctr"
+#line 3116 "f2lsvg.ctr"
if(job->group) {
-#line 3099 "f2lsvg.ctr"
+#line 3117 "f2lsvg.ctr"
if(obj->af) {
-#line 3100 "f2lsvg.ctr"
+#line 3118 "f2lsvg.ctr"
if((obj->af)->o1) {
-#line 3101 "f2lsvg.ctr"
+#line 3119 "f2lsvg.ctr"
back = 1;
}
if((obj->af)->o2) {
-#line 3104 "f2lsvg.ctr"
+#line 3122 "f2lsvg.ctr"
back = 1;
}
}
if(obj->ab) {
-#line 3108 "f2lsvg.ctr"
+#line 3126 "f2lsvg.ctr"
if((obj->ab)->o1) {
-#line 3109 "f2lsvg.ctr"
+#line 3127 "f2lsvg.ctr"
back = 1;
}
if((obj->ab)->o2) {
-#line 3112 "f2lsvg.ctr"
+#line 3130 "f2lsvg.ctr"
back = 1;
}
}
}
-#line 3116 "f2lsvg.ctr"
+#line 3134 "f2lsvg.ctr"
return back;
}
@@ -3451,7 +3447,7 @@ f2lsvg_process_object(
-#line 3174 "f2lsvg.ctr"
+#line 3192 "f2lsvg.ctr"
psvg = (f2l_svg_t *)(drw->dsd);
mg = f2lsvg_check_must_group(job, obj);
/*
@@ -3464,17 +3460,17 @@ f2lsvg_process_object(
}
-#line 3185 "f2lsvg.ctr"
+#line 3203 "f2lsvg.ctr"
f2lsvg_process_one(job, drw, psvg, obj, 1, &mec);
/*
Process arrowheads.
*/
if(obj->af) {
-#line 3190 "f2lsvg.ctr"
+#line 3208 "f2lsvg.ctr"
if((obj->af)->o1) {
-#line 3191 "f2lsvg.ctr"
+#line 3209 "f2lsvg.ctr"
#if VERSION_BEFORE_20140329
f2lsvg_process_one(job,drw,psvg,(dk3_fig_obj_t *)((obj->af)->o1),0,&mec);
#else
@@ -3483,7 +3479,7 @@ f2lsvg_process_object(
}
if((obj->af)->o2) {
-#line 3198 "f2lsvg.ctr"
+#line 3216 "f2lsvg.ctr"
#if VERSION_BEFORE_20140329
f2lsvg_process_one(job,drw,psvg,(dk3_fig_obj_t *)((obj->af)->o2),0,&mec);
#else
@@ -3491,14 +3487,14 @@ f2lsvg_process_object(
#endif
}
-#line 3204 "f2lsvg.ctr"
+#line 3222 "f2lsvg.ctr"
}
if(obj->ab) {
-#line 3206 "f2lsvg.ctr"
+#line 3224 "f2lsvg.ctr"
if((obj->ab)->o1) {
-#line 3207 "f2lsvg.ctr"
+#line 3225 "f2lsvg.ctr"
#if VERSION_BEFORE_20140329
f2lsvg_process_one(job,drw,psvg,(dk3_fig_obj_t *)((obj->ab)->o1),0,&mec);
#else
@@ -3507,7 +3503,7 @@ f2lsvg_process_object(
}
if((obj->ab)->o2) {
-#line 3214 "f2lsvg.ctr"
+#line 3232 "f2lsvg.ctr"
#if VERSION_BEFORE_20140329
f2lsvg_process_one(job,drw,psvg,(dk3_fig_obj_t *)((obj->ab)->o2),0,&mec);
#else
@@ -3515,11 +3511,11 @@ f2lsvg_process_object(
#endif
}
-#line 3220 "f2lsvg.ctr"
+#line 3238 "f2lsvg.ctr"
}
-#line 3222 "f2lsvg.ctr"
+#line 3240 "f2lsvg.ctr"
if(mg) {
fputs(f2lsvg_c8_kw[6], job->of1);
fputs(f2lsvg_c8_kw[8], job->of1);
@@ -3531,11 +3527,11 @@ f2lsvg_process_object(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
job->exval = FIG2LAT_EXIT_ERROR_MATH;
-#line 3232 "f2lsvg.ctr"
+#line 3250 "f2lsvg.ctr"
}
-#line 3234 "f2lsvg.ctr"
+#line 3252 "f2lsvg.ctr"
}
@@ -3549,7 +3545,7 @@ f2lsvg_output(f2l_job_t *job)
unsigned long oldsrcline = 0UL;
-#line 3246 "f2lsvg.ctr"
+#line 3264 "f2lsvg.ctr"
oldsrcline = dk3app_get_source_line(job->app);
dk3app_set_source_line(job->app, 0UL);
drw = job->drw; objno = 0UL;
@@ -3567,24 +3563,24 @@ f2lsvg_output(f2l_job_t *job)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 3262 "f2lsvg.ctr"
+#line 3280 "f2lsvg.ctr"
}
f2lsvg_end_processing(job, drw);
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 3266 "f2lsvg.ctr"
+#line 3284 "f2lsvg.ctr"
}
f2lsvg_close_output_files(job);
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 3270 "f2lsvg.ctr"
+#line 3288 "f2lsvg.ctr"
}
dk3app_set_source_line(job->app, oldsrcline);
-#line 3273 "f2lsvg.ctr"
+#line 3291 "f2lsvg.ctr"
f2lsvg_driver_end(job, drw);
}
diff --git a/support/dktools/f2lsvg.ctr b/support/dktools/f2lsvg.ctr
index 7c4a116c3c..a2ec59c1f8 100644
--- a/support/dktools/f2lsvg.ctr
+++ b/support/dktools/f2lsvg.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -42,6 +42,7 @@ f2lsvg_output(f2l_job_t *job);
#include "dk3xsp.h"
#include "dk3font.h"
#include "dk3bif.h"
+#include "dk3unused.h"
@@ -112,7 +113,7 @@ Fig file converted by fig2lat
#
# 17: Additional comment after description
#
-http://dktools.sourceforge.net/fig2lat.html
+http://sourceforge.net/p/dktools/wiki/fig2lat/
#
# 18: defs
#
@@ -989,7 +990,7 @@ static
void
f2lsvg_write_font_faces(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
f2l_svg_t *psvg
)
{
@@ -999,6 +1000,7 @@ f2lsvg_write_font_faces(
int fs; /* Font style. */
int res = 0;
$? "+ f2lsvg_write_font_faces"
+ DK3_UNUSED_ARG(drw)
if(0 < job->svgfontbase) { $? ". fontbase"
switch(job->svgfontbase) {
case 2: {
@@ -1104,9 +1106,13 @@ f2lsvg_driver_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
*/
static
void
-f2lsvg_driver_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lsvg_driver_end(
+ f2l_job_t * DK3_SILENCE_ARG_UNUSED(job),
+ dk3_fig_drawing_t *drw
+)
{
$? "+ f2lsvg_driver_end"
+ DK3_UNUSED_ARG(job)
if(drw->dsd) {
f2lsvgst_delete((f2l_svg_t *)(drw->dsd));
} drw->dsd = NULL;
@@ -1249,7 +1255,7 @@ f2lsvg_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
fputs(f2lsvg_c8_kw[0], job->of1);
/* Pattern definitions.
*/
- f2lsvgst_write_patterns(job, drw, psvg);
+ f2lsvgst_write_patterns(job, psvg);
if(f2lsvg_must_write_style(job, psvg)) {
f2lsvg_tag_open_start(job, 19);
fputs(f2lsvg_c8_kw[20], job->of1);
@@ -1262,7 +1268,7 @@ f2lsvg_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
/* Style definitions.
*/
if(job->css) {
- f2lsvgst_write_styles(job, drw, psvg);
+ f2lsvgst_write_styles(job, psvg);
}
fputs(f2lsvg_c8_kw[22], job->of1);
f2lsvg_tag_close(job, 19);
@@ -1280,8 +1286,12 @@ f2lsvg_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
*/
static
void
-f2lsvg_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
+f2lsvg_end_processing(
+ f2l_job_t *job,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw)
+)
{
+ DK3_UNUSED_ARG(drw)
f2lsvg_tag_close(job, 10);
}
@@ -1536,7 +1546,7 @@ void
f2lsvg_process_image(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
+ f2l_svg_t * DK3_SILENCE_ARG_UNUSED(psvg),
dk3_fig_obj_t *obj,
int *ec
)
@@ -1567,6 +1577,7 @@ f2lsvg_process_image(
int doScaleX = 0; /* Flag: Scale x=-1. */
int doScaleY = 0; /* Flag: Sclae y=-1. */
+ DK3_UNUSED_ARG(psvg)
if((obj->dt).pol.fn) {
bif = dk3bif_open_c8_filename_app(
(obj->dt).pol.fn, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app
@@ -1593,7 +1604,7 @@ f2lsvg_process_image(
y1 = outbb.ymin; y2 = outbb.ymax;
/* Find drawing direction.
*/
- drawdir = f2lto_find_draw_direction(job, drw, obj, ec);
+ drawdir = f2lto_find_draw_direction(drw, obj, ec);
/* Find real image width and height.
*/
if((xres > 0.0) && (yres > 0.0)) {
@@ -1782,7 +1793,7 @@ void
f2lsvg_process_full_spline_segment(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
dk3_fig_spline_point_t *sp,
size_t np,
size_t cp,
@@ -1814,6 +1825,7 @@ f2lsvg_process_full_spline_segment(
int res;
int mec = 0;
$? "+ f2lsvg_process_full_spline_segment %u / %u", (unsigned)cp, (unsigned)np
+ DK3_UNUSED_ARG(obj)
if(cp < ((iscl) ? (np) : (np - 1))) {
pb = &(sp[cp]); $? ". b = %u", (unsigned)cp
ic = cp + 1;
@@ -1919,13 +1931,13 @@ void
f2lsvg_first_spline_segment(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
dk3_fig_spline_point_t *sp,
size_t np,
size_t i,
double ts,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -1951,6 +1963,8 @@ f2lsvg_first_spline_segment(
size_t iseg; /* Current segment. */
int res; /* Calculation result. */
$? "+ f2lud_first_spline_segment ts=%lg", ts
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(iscl)
myts = dk3ma_d_sub_ok(ts, floor(ts), ec); $? ". myts = %lg", myts
dnumsegs = (1.0 - myts) * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs); $? ". dnumsegs = %lg", dnumsegs
@@ -2055,13 +2069,13 @@ void
f2lsvg_final_spline_segment(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
dk3_fig_spline_point_t *sp,
size_t np,
size_t i,
double te,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -2087,6 +2101,8 @@ f2lsvg_final_spline_segment(
size_t iseg; /* Current segment. */
int res; /* Calculation result. */
$? "+ f2lud_final_spline_segment %lg", te
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(iscl)
myte = dk3ma_d_sub_ok(te, floor(te), ec); $? ". myte = %lg", myte
dnumsegs = myte * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs); $? ". dnumsegs = %lg", dnumsegs
@@ -2199,14 +2215,14 @@ void
f2lsvg_single_spline_segment(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
+ dk3_fig_obj_t * DK3_SILENCE_ARG_UNUSED(obj),
dk3_fig_spline_point_t *sp,
size_t np,
size_t i,
double ts,
double te,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -2233,6 +2249,8 @@ f2lsvg_single_spline_segment(
size_t iseg; /* Current segment. */
int res; /* Calculation result. */
$? "+ f2lud_single_spline_segment"
+ DK3_UNUSED_ARG(obj)
+ DK3_UNUSED_ARG(iscl)
myte = dk3ma_d_sub_ok(te, floor(te), ec);
myts = dk3ma_d_sub_ok(ts, floor(ts), ec);
dnumsegs = (myte - myts) * dk3fig_tool_xssbs(drw, primary);
diff --git a/support/dktools/f2lsvg.h b/support/dktools/f2lsvg.h
index 8b7b81478a..99fbf7b708 100644
--- a/support/dktools/f2lsvg.h
+++ b/support/dktools/f2lsvg.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lsvg.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lsvg.ctr
*/
/** @file f2lsvg.h Header file for the f2lsvg module.
diff --git a/support/dktools/f2lsvgst.c b/support/dktools/f2lsvgst.c
index df5f40d422..303712b45f 100644
--- a/support/dktools/f2lsvgst.c
+++ b/support/dktools/f2lsvgst.c
@@ -1,51 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lsvgst.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lsvgst.ctr
*/
/** @file f2lsvgst.c The f2lsvgst module.
*/
-#line 410 "f2lsvgst.ctr"
+#line 360 "f2lsvgst.ctr"
#include "f2lsvgst.h"
+#include "dk3unused.h"
-#line 416 "f2lsvgst.ctr"
+#line 367 "f2lsvgst.ctr"
@@ -622,7 +601,7 @@ static char const * const f2lsvgst_c8_kw[] = {
NULL
-#line 889 "f2lsvgst.ctr"
+#line 840 "f2lsvgst.ctr"
};
@@ -632,13 +611,14 @@ NULL
@param y Right value.
@return Comparison result.
*/
+static
int
f2lsvgst_compare_int(int x, int y)
{
int back = 0;
-#line 903 "f2lsvgst.ctr"
+#line 855 "f2lsvgst.ctr"
if(x > y) {
back = 1;
} else {
@@ -647,18 +627,23 @@ f2lsvgst_compare_int(int x, int y)
}
}
-#line 910 "f2lsvgst.ctr"
+#line 862 "f2lsvgst.ctr"
return back;
}
+static
int
-f2lsvgst_compare_pattern(void const *l, void const *r, int cr)
+f2lsvgst_compare_pattern(
+ void const *l, void const *r, int DK3_ARG_UNUSED(cr)
+)
{
int back = 0;
f2l_svg_fill_pattern_t const *pl;
f2l_svg_fill_pattern_t const *pr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (f2l_svg_fill_pattern_t const *)l;
@@ -691,15 +676,19 @@ f2lsvgst_compare_pattern(void const *l, void const *r, int cr)
+static
int
-f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
+f2lsvgst_compare_object_styles(
+ void const *l, void const *r, int DK3_ARG_UNUSED(cr)
+)
{
f2l_svg_style_t const *pl;
f2l_svg_style_t const *pr;
int back = 0;
-#line 960 "f2lsvgst.ctr"
+#line 920 "f2lsvgst.ctr"
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (f2l_svg_style_t const *)l;
@@ -707,65 +696,65 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
/* Stroke color.
*/
-#line 966 "f2lsvgst.ctr"
+#line 927 "f2lsvgst.ctr"
if((pl->flags) & DK3_SVG_FLAGS_COLOR_STROKE) {
if((pr->flags) & DK3_SVG_FLAGS_COLOR_STROKE) {
back = f2lsvgst_compare_int(pl->sr, pr->sr);
-#line 970 "f2lsvgst.ctr"
+#line 931 "f2lsvgst.ctr"
if(0 == back) {
back = f2lsvgst_compare_int(pl->sg, pr->sg);
-#line 973 "f2lsvgst.ctr"
+#line 934 "f2lsvgst.ctr"
if(0 == back) {
back = f2lsvgst_compare_int(pl->sb, pr->sb);
-#line 976 "f2lsvgst.ctr"
+#line 937 "f2lsvgst.ctr"
}
}
} else {
back = 1;
-#line 980 "f2lsvgst.ctr"
+#line 941 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_COLOR_STROKE) {
back = -1;
-#line 984 "f2lsvgst.ctr"
+#line 945 "f2lsvgst.ctr"
}
}
/* Line width.
*/
if(0 == back) {
-#line 989 "f2lsvgst.ctr"
+#line 950 "f2lsvgst.ctr"
if((pl->flags) & DK3_SVG_FLAGS_LINEWIDTH) {
if((pr->flags) & DK3_SVG_FLAGS_LINEWIDTH) {
if(pl->lw > (pr->lw + 1.0e-6)) {
back = 1;
-#line 993 "f2lsvgst.ctr"
+#line 954 "f2lsvgst.ctr"
} else {
if(pr->lw > (pl->lw + 1.0e-6)) {
back = -1;
-#line 996 "f2lsvgst.ctr"
+#line 957 "f2lsvgst.ctr"
}
}
} else {
back = 1;
-#line 1000 "f2lsvgst.ctr"
+#line 961 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_LINEWIDTH) {
back = -1;
-#line 1004 "f2lsvgst.ctr"
+#line 965 "f2lsvgst.ctr"
}
}
}
@@ -773,23 +762,23 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
*/
if(0 == back) {
-#line 1010 "f2lsvgst.ctr"
+#line 971 "f2lsvgst.ctr"
if((pl->flags) & DK3_SVG_FLAGS_LINE_CAP) {
if((pr->flags) & DK3_SVG_FLAGS_LINE_CAP) {
back = f2lsvgst_compare_int(pl->lc, pr->lc);
-#line 1014 "f2lsvgst.ctr"
+#line 975 "f2lsvgst.ctr"
} else {
back = 1;
-#line 1016 "f2lsvgst.ctr"
+#line 977 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_LINE_CAP) {
back = -1;
-#line 1020 "f2lsvgst.ctr"
+#line 981 "f2lsvgst.ctr"
}
}
}
@@ -797,23 +786,23 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
*/
if(0 == back) {
-#line 1026 "f2lsvgst.ctr"
+#line 987 "f2lsvgst.ctr"
if((pl->flags) & DK3_SVG_FLAGS_LINE_JOIN) {
if((pr->flags) & DK3_SVG_FLAGS_LINE_JOIN) {
back = f2lsvgst_compare_int(pl->lj, pr->lj);
-#line 1030 "f2lsvgst.ctr"
+#line 991 "f2lsvgst.ctr"
} else {
back = 1;
-#line 1032 "f2lsvgst.ctr"
+#line 993 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_LINE_JOIN) {
back = -1;
-#line 1036 "f2lsvgst.ctr"
+#line 997 "f2lsvgst.ctr"
}
}
}
@@ -821,29 +810,29 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
*/
if(0 == back) {
-#line 1042 "f2lsvgst.ctr"
+#line 1003 "f2lsvgst.ctr"
if((pl->flags) & DK3_SVG_FLAGS_LINESTYLE) {
if((pr->flags) & DK3_SVG_FLAGS_LINESTYLE) {
if(pl->ls > pr->ls) {
back = 1;
-#line 1046 "f2lsvgst.ctr"
+#line 1007 "f2lsvgst.ctr"
} else {
if(pr->ls > pl->ls) {
back = -1;
-#line 1049 "f2lsvgst.ctr"
+#line 1010 "f2lsvgst.ctr"
} else {
if((0 != pl->ls) && (0 != pr->ls)) {
if(pl->lsv > (pr->lsv + 1.0e-6)) {
back = 1;
-#line 1053 "f2lsvgst.ctr"
+#line 1014 "f2lsvgst.ctr"
} else {
if(pr->lsv > (pl->lsv + 1.0e-6)) {
back = -1;
-#line 1056 "f2lsvgst.ctr"
+#line 1017 "f2lsvgst.ctr"
}
}
}
@@ -852,13 +841,13 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
} else {
back = 1;
-#line 1063 "f2lsvgst.ctr"
+#line 1024 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_LINESTYLE) {
back = -1;
-#line 1067 "f2lsvgst.ctr"
+#line 1028 "f2lsvgst.ctr"
}
}
}
@@ -866,24 +855,24 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
*/
if(0 == back) {
-#line 1073 "f2lsvgst.ctr"
+#line 1034 "f2lsvgst.ctr"
if(pl->fp) {
if(pr->fp) {
back =
f2lsvgst_compare_pattern((void *)(pl->fp),(void *)(pr->fp),0);
-#line 1078 "f2lsvgst.ctr"
+#line 1039 "f2lsvgst.ctr"
} else {
back = 1;
-#line 1080 "f2lsvgst.ctr"
+#line 1041 "f2lsvgst.ctr"
}
} else {
if(pr->fp) {
back = -1;
-#line 1084 "f2lsvgst.ctr"
+#line 1045 "f2lsvgst.ctr"
}
else {
/* Fill color only if both objects do not have fill patterns.
@@ -894,29 +883,29 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
back = f2lsvgst_compare_int(pl->fr, pr->fr);
-#line 1093 "f2lsvgst.ctr"
+#line 1054 "f2lsvgst.ctr"
if(0 == back) {
back = f2lsvgst_compare_int(pl->fg, pr->fg);
-#line 1096 "f2lsvgst.ctr"
+#line 1057 "f2lsvgst.ctr"
if(0 == back) {
back = f2lsvgst_compare_int(pl->fb, pr->fb);
-#line 1099 "f2lsvgst.ctr"
+#line 1060 "f2lsvgst.ctr"
}
}
} else {
back = 1;
-#line 1103 "f2lsvgst.ctr"
+#line 1064 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_COLOR_FILL) {
back = -1;
-#line 1107 "f2lsvgst.ctr"
+#line 1068 "f2lsvgst.ctr"
}
}
}
@@ -927,7 +916,7 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
*/
if(0 == back) {
-#line 1116 "f2lsvgst.ctr"
+#line 1077 "f2lsvgst.ctr"
if((pl->flags) & DK3_SVG_FLAGS_FONT) {
if((pr->flags) & DK3_SVG_FLAGS_FONT) {
if((pl->flags) & DK3_SVG_FLAGS_PS_FONT) {
@@ -935,45 +924,45 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
back = f2lsvgst_compare_int(pl->tf, pr->tf);
-#line 1122 "f2lsvgst.ctr"
+#line 1083 "f2lsvgst.ctr"
if(0 == back) {
if(pl->ts > (pr->ts + 1.0e-6)) {
back = 1;
-#line 1125 "f2lsvgst.ctr"
+#line 1086 "f2lsvgst.ctr"
} else {
if(pl->ts < (pr->ts - 1.0e-6)) {
back = -1;
-#line 1128 "f2lsvgst.ctr"
+#line 1089 "f2lsvgst.ctr"
}
}
}
} else {
back = 1;
-#line 1133 "f2lsvgst.ctr"
+#line 1094 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_PS_FONT) {
back = -1;
-#line 1137 "f2lsvgst.ctr"
+#line 1098 "f2lsvgst.ctr"
} else {
back = f2lsvgst_compare_int(pl->tf, pr->tf);
-#line 1140 "f2lsvgst.ctr"
+#line 1101 "f2lsvgst.ctr"
if(0 == back) {
if(pl->ts > (pr->ts + 1.0e-6)) {
back = 1;
-#line 1143 "f2lsvgst.ctr"
+#line 1104 "f2lsvgst.ctr"
} else {
if(pl->ts < (pr->ts - 1.0e-6)) {
back = -1;
-#line 1146 "f2lsvgst.ctr"
+#line 1107 "f2lsvgst.ctr"
}
}
}
@@ -982,13 +971,13 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
} else {
back = 1;
-#line 1153 "f2lsvgst.ctr"
+#line 1114 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_FONT) {
back = -1;
-#line 1157 "f2lsvgst.ctr"
+#line 1118 "f2lsvgst.ctr"
}
}
}
@@ -996,40 +985,40 @@ f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
*/
if(0 == back) {
-#line 1163 "f2lsvgst.ctr"
+#line 1124 "f2lsvgst.ctr"
if((pl->flags) & DK3_SVG_FLAGS_TEXT_ALIGN) {
if((pr->flags) & DK3_SVG_FLAGS_TEXT_ALIGN) {
back = f2lsvgst_compare_int(pl->al, pr->al);
-#line 1167 "f2lsvgst.ctr"
+#line 1128 "f2lsvgst.ctr"
} else {
back = 1;
-#line 1169 "f2lsvgst.ctr"
+#line 1130 "f2lsvgst.ctr"
}
} else {
if((pr->flags) & DK3_SVG_FLAGS_TEXT_ALIGN) {
back = -1;
-#line 1173 "f2lsvgst.ctr"
+#line 1134 "f2lsvgst.ctr"
}
}
}
} else {
-#line 1177 "f2lsvgst.ctr"
+#line 1138 "f2lsvgst.ctr"
back = 1;
}
} else {
if(r) {
back = -1;
-#line 1182 "f2lsvgst.ctr"
+#line 1143 "f2lsvgst.ctr"
}
}
-#line 1184 "f2lsvgst.ctr"
+#line 1145 "f2lsvgst.ctr"
return back;
}
@@ -1040,16 +1029,16 @@ f2lsvgst_pattern_delete(f2l_svg_fill_pattern_t *pa)
{
-#line 1193 "f2lsvgst.ctr"
+#line 1154 "f2lsvgst.ctr"
if(pa) {
-#line 1195 "f2lsvgst.ctr"
+#line 1156 "f2lsvgst.ctr"
}
dk3_delete(pa);
-#line 1198 "f2lsvgst.ctr"
+#line 1159 "f2lsvgst.ctr"
}
@@ -1060,7 +1049,7 @@ f2lsvgst_pattern_new(f2l_svg_t *psvg)
f2l_svg_fill_pattern_t *back = NULL;
-#line 1207 "f2lsvgst.ctr"
+#line 1168 "f2lsvgst.ctr"
if(psvg) {
back = dk3_new(f2l_svg_fill_pattern_t,1);
if(back) {
@@ -1073,7 +1062,7 @@ f2lsvgst_pattern_new(f2l_svg_t *psvg)
}
}
-#line 1218 "f2lsvgst.ctr"
+#line 1179 "f2lsvgst.ctr"
return back;
}
@@ -1084,7 +1073,7 @@ f2lsvgst_style_initialize(f2l_svg_style_t *st)
{
-#line 1227 "f2lsvgst.ctr"
+#line 1188 "f2lsvgst.ctr"
if(st) {
/* 2013-01-25: Same order as in typedef makes completeness checking easier.
*/
@@ -1103,7 +1092,7 @@ f2lsvgst_style_initialize(f2l_svg_style_t *st)
st->lj = 0;
}
-#line 1244 "f2lsvgst.ctr"
+#line 1205 "f2lsvgst.ctr"
}
@@ -1156,13 +1145,13 @@ f2lsvgst_style_delete(f2l_svg_style_t *st)
{
-#line 1295 "f2lsvgst.ctr"
+#line 1256 "f2lsvgst.ctr"
if(st) {
f2lsvgst_style_initialize(st);
dk3_delete(st);
}
-#line 1299 "f2lsvgst.ctr"
+#line 1260 "f2lsvgst.ctr"
}
@@ -1173,7 +1162,7 @@ f2lsvgst_style_new(f2l_svg_t *psvg)
f2l_svg_style_t *back = NULL;
-#line 1308 "f2lsvgst.ctr"
+#line 1269 "f2lsvgst.ctr"
if(psvg) {
back = dk3_new(f2l_svg_style_t,1);
if(back) {
@@ -1183,7 +1172,7 @@ f2lsvgst_style_new(f2l_svg_t *psvg)
}
}
-#line 1316 "f2lsvgst.ctr"
+#line 1277 "f2lsvgst.ctr"
return back;
}
@@ -1196,7 +1185,7 @@ f2lsvgst_delete(f2l_svg_t *psvg)
f2l_svg_fill_pattern_t *pa;
-#line 1327 "f2lsvgst.ctr"
+#line 1288 "f2lsvgst.ctr"
if(psvg) {
dk3_release(psvg->psFontsUsed);
if(psvg->sStyles) {
@@ -1225,7 +1214,7 @@ f2lsvgst_delete(f2l_svg_t *psvg)
dk3_delete(psvg);
}
-#line 1354 "f2lsvgst.ctr"
+#line 1315 "f2lsvgst.ctr"
}
@@ -1238,7 +1227,7 @@ f2lsvgst_new_app(dk3_app_t *app)
int ok = 0;
-#line 1365 "f2lsvgst.ctr"
+#line 1326 "f2lsvgst.ctr"
back = dk3_new_app(f2l_svg_t,1,app);
if(back) {
back->sPatterns = NULL;
@@ -1274,7 +1263,7 @@ f2lsvgst_new_app(dk3_app_t *app)
}
}
-#line 1399 "f2lsvgst.ctr"
+#line 1360 "f2lsvgst.ctr"
return back;
}
@@ -1289,7 +1278,7 @@ f2lsvgst_get_error_code(f2l_svg_t *psvg)
psvg->ec = 0;
}
-#line 1412 "f2lsvgst.ctr"
+#line 1373 "f2lsvgst.ctr"
return back;
}
@@ -1300,7 +1289,7 @@ f2lsvgst_pattern_add(f2l_svg_t *psvg, f2l_svg_fill_pattern_t *src)
f2l_svg_fill_pattern_t *back = NULL;
-#line 1421 "f2lsvgst.ctr"
+#line 1382 "f2lsvgst.ctr"
if((psvg) && (src)) {
back = (f2l_svg_fill_pattern_t *)dk3sto_it_find_like(
psvg->iPatterns, (void *)src, 0
@@ -1324,7 +1313,7 @@ f2lsvgst_pattern_add(f2l_svg_t *psvg, f2l_svg_fill_pattern_t *src)
}
}
-#line 1443 "f2lsvgst.ctr"
+#line 1404 "f2lsvgst.ctr"
return back;
}
@@ -1336,21 +1325,21 @@ f2lsvgst_style_add(f2l_svg_t *psvg, f2l_svg_style_t *src)
f2l_svg_style_t *back = NULL;
-#line 1453 "f2lsvgst.ctr"
+#line 1414 "f2lsvgst.ctr"
if((psvg) && (src)) {
back = (f2l_svg_style_t *)dk3sto_it_find_like(
psvg->iStyles, (void *)src, 0
);
if(!(back)) {
-#line 1458 "f2lsvgst.ctr"
+#line 1419 "f2lsvgst.ctr"
if(0UL != (1UL + psvg->nStyles)) {
-#line 1459 "f2lsvgst.ctr"
+#line 1420 "f2lsvgst.ctr"
back = f2lsvgst_style_new(psvg);
if(back) {
-#line 1461 "f2lsvgst.ctr"
+#line 1422 "f2lsvgst.ctr"
dk3mem_cpy((void *)back, (void *)src, sizeof(f2l_svg_style_t));
if(dk3sto_add(psvg->sStyles, (void *)back)) {
back->sn = psvg->nStyles;
@@ -1361,18 +1350,18 @@ f2lsvgst_style_add(f2l_svg_t *psvg, f2l_svg_style_t *src)
}
} else {
-#line 1470 "f2lsvgst.ctr"
+#line 1431 "f2lsvgst.ctr"
}
} else {
psvg->ec = DK3_ERROR_MATH_OVERFLOW;
}
} else {
-#line 1475 "f2lsvgst.ctr"
+#line 1436 "f2lsvgst.ctr"
}
}
-#line 1477 "f2lsvgst.ctr"
+#line 1438 "f2lsvgst.ctr"
return back;
}
@@ -1388,7 +1377,7 @@ f2lsvgst_style_set_pattern(
int back = 0;
-#line 1491 "f2lsvgst.ctr"
+#line 1452 "f2lsvgst.ctr"
if((psvg) && (pst) && (ppat)) {
if(!(pst->fp)) {
pst->fp = f2lsvgst_pattern_add(psvg, ppat);
@@ -1398,7 +1387,7 @@ f2lsvgst_style_set_pattern(
}
}
-#line 1499 "f2lsvgst.ctr"
+#line 1460 "f2lsvgst.ctr"
return back;
}
@@ -1415,7 +1404,7 @@ f2lsvgst_style_set_text(
{
-#line 1514 "f2lsvgst.ctr"
+#line 1475 "f2lsvgst.ctr"
if(pst) {
pst->tf = tf;
pst->ts = ts;
@@ -1432,7 +1421,7 @@ f2lsvgst_style_set_text(
}
}
-#line 1529 "f2lsvgst.ctr"
+#line 1490 "f2lsvgst.ctr"
}
@@ -1445,13 +1434,13 @@ f2lsvgst_style_set_line_width(
{
-#line 1540 "f2lsvgst.ctr"
+#line 1501 "f2lsvgst.ctr"
if(pst) {
pst->lw = lw;
pst->flags |= (DK3_SVG_FLAGS_LINEWIDTH);
}
-#line 1544 "f2lsvgst.ctr"
+#line 1505 "f2lsvgst.ctr"
}
@@ -1465,13 +1454,13 @@ f2lsvgst_style_set_line_style(
{
-#line 1556 "f2lsvgst.ctr"
+#line 1517 "f2lsvgst.ctr"
if(pst) {
pst->ls = ls; pst->lsv = lsv;
pst->flags|= (DK3_SVG_FLAGS_LINESTYLE);
}
-#line 1560 "f2lsvgst.ctr"
+#line 1521 "f2lsvgst.ctr"
}
@@ -1486,13 +1475,13 @@ f2lsvgst_style_set_line_color(
{
-#line 1573 "f2lsvgst.ctr"
+#line 1534 "f2lsvgst.ctr"
if(pst) {
pst->sr = r; pst->sg = g; pst->sb = b;
pst->flags |= (DK3_SVG_FLAGS_COLOR_STROKE);
}
-#line 1577 "f2lsvgst.ctr"
+#line 1538 "f2lsvgst.ctr"
}
@@ -1507,13 +1496,13 @@ f2lsvgst_style_set_fill_color(
{
-#line 1590 "f2lsvgst.ctr"
+#line 1551 "f2lsvgst.ctr"
if(pst) {
pst->fr = r; pst->fg = g; pst->fb = b;
pst->flags |= (DK3_SVG_FLAGS_COLOR_FILL);
}
-#line 1594 "f2lsvgst.ctr"
+#line 1555 "f2lsvgst.ctr"
}
@@ -1632,48 +1621,57 @@ f2lsvgst_write_id(
+/** Write pattern ID.
+ @param job Job structure.
+ @param psvg SVG style collection.
+ @param pat Pattern used for current object.
+*/
+static
void
f2lsvgst_write_pattern_id(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
-#line 1721 "f2lsvgst.ctr"
+#line 1687 "f2lsvgst.ctr"
fputs(f2lsvgst_c8_kw[8], job->of1);
f2lsvgst_write_id(job, pat->pn, psvg->nPatterns);
-#line 1724 "f2lsvgst.ctr"
+#line 1690 "f2lsvgst.ctr"
}
+/** Write style ID.
+ @param job Job structure.
+ @param psvg SVG style collection.
+ @param pst Style used by current object.
+*/
+static
void
f2lsvgst_write_style_id(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_style_t *pst
)
{
-#line 1737 "f2lsvgst.ctr"
+#line 1708 "f2lsvgst.ctr"
fputs(f2lsvgst_c8_kw[111], job->of1);
f2lsvgst_write_id(job, pst->sn, psvg->nStyles);
-#line 1740 "f2lsvgst.ctr"
+#line 1711 "f2lsvgst.ctr"
}
/** Write opening pattern tag.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
@param w Pattern width.
@@ -1683,7 +1681,6 @@ static
void
f2lsvgst_write_opening_pattern_tag(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
double w,
@@ -1693,7 +1690,7 @@ f2lsvgst_write_opening_pattern_tag(
fputs(f2lsvgst_c8_kw[6], job->of1);
f2lsvgst_tag(job, 3);
fputs(f2lsvgst_c8_kw[7], job->of1);
- f2lsvgst_write_pattern_id(job, drw, psvg, pat);
+ f2lsvgst_write_pattern_id(job, psvg, pat);
fprintf(job->of1, f2lsvgst_c8_kw[9], w, h);
}
@@ -1701,8 +1698,6 @@ f2lsvgst_write_opening_pattern_tag(
/** Write opening pattern tag.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param w Pattern width.
@param h Pattern height.
@@ -1711,8 +1706,6 @@ static
void
f2lsvgst_pattern_background(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
double w,
double h
@@ -1729,8 +1722,6 @@ f2lsvgst_pattern_background(
/** Draw foreground line in pattern.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param ind Index of points line in f2lsvgst_c8_kw.
*/
@@ -1738,8 +1729,6 @@ static
void
f2lsvgst_pattern_foreground_line(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t ind
)
@@ -1756,8 +1745,6 @@ f2lsvgst_pattern_foreground_line(
/** Draw foreground line in pattern.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param ind Index of points line in f2lsvgst_c8_kw.
*/
@@ -1765,8 +1752,6 @@ static
void
f2lsvgst_pattern_foreground_line_lcr(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t ind
)
@@ -1785,8 +1770,6 @@ f2lsvgst_pattern_foreground_line_lcr(
/** Draw foreground polygon in pattern.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param ind Index of points line in f2lsvgst_c8_kw.
*/
@@ -1794,8 +1777,6 @@ static
void
f2lsvgst_pattern_foreground_polygon_lcr(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t ind
)
@@ -1814,8 +1795,6 @@ f2lsvgst_pattern_foreground_polygon_lcr(
/** Draw foreground polygon in pattern, 2 data lines.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param i1 Index of points line in f2lsvgst_c8_kw.
@param i2 Index of points line 2.
@@ -1824,8 +1803,6 @@ static
void
f2lsvgst_pattern_foreground_polygon_lcr_l2(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t i1,
size_t i2
@@ -1847,8 +1824,6 @@ f2lsvgst_pattern_foreground_polygon_lcr_l2(
/** Draw foreground path in pattern
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param ind Index of data line in f2lsvgst_c8_kw.
*/
@@ -1856,8 +1831,6 @@ static
void
f2lsvgst_pattern_foreground_path_lcr(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t ind
)
@@ -1876,16 +1849,12 @@ f2lsvgst_pattern_foreground_path_lcr(
/** Draw foreground circle in pattern
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
*/
static
void
f2lsvgst_pattern_foreground_circle_lcr(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
@@ -1902,7 +1871,6 @@ f2lsvgst_pattern_foreground_circle_lcr(
/** Write pattern 41 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -1910,22 +1878,21 @@ static
void
f2lsvgst_pattern_41(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 4.16);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_pattern_background(job, pat, 7.2, 4.16);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 15);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 16);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 17);
+ f2lsvgst_pattern_foreground_line(job, pat, 15);
+ f2lsvgst_pattern_foreground_line(job, pat, 16);
+ f2lsvgst_pattern_foreground_line(job, pat, 17);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -1939,7 +1906,6 @@ f2lsvgst_pattern_41(
/** Write pattern 42 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -1947,22 +1913,21 @@ static
void
f2lsvgst_pattern_42(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 4.16);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_pattern_background(job, pat, 7.2, 4.16);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 19);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 20);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 21);
+ f2lsvgst_pattern_foreground_line(job, pat, 19);
+ f2lsvgst_pattern_foreground_line(job, pat, 20);
+ f2lsvgst_pattern_foreground_line(job, pat, 21);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -1976,7 +1941,6 @@ f2lsvgst_pattern_42(
/** Write pattern 43 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -1984,29 +1948,28 @@ static
void
f2lsvgst_pattern_43(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 4.16);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_pattern_background(job, pat, 7.2, 4.16);
/* Pattern contents 2: lines.
*/
#if 1
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 23);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 24);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 23);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 24);
#else
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 15);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 16);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 17);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 19);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 20);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 21);
+ f2lsvgst_pattern_foreground_line(job, pat, 15);
+ f2lsvgst_pattern_foreground_line(job, pat, 16);
+ f2lsvgst_pattern_foreground_line(job, pat, 17);
+ f2lsvgst_pattern_foreground_line(job, pat, 19);
+ f2lsvgst_pattern_foreground_line(job, pat, 20);
+ f2lsvgst_pattern_foreground_line(job, pat, 21);
#endif
/* Close pattern tag.
*/
@@ -2021,7 +1984,6 @@ f2lsvgst_pattern_43(
/** Write pattern 44 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2029,22 +1991,21 @@ static
void
f2lsvgst_pattern_44(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 10.18, 10.18);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_pattern_background(job, pat, 10.18, 10.18);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 25);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 26);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 27);
+ f2lsvgst_pattern_foreground_line(job, pat, 25);
+ f2lsvgst_pattern_foreground_line(job, pat, 26);
+ f2lsvgst_pattern_foreground_line(job, pat, 27);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2058,7 +2019,6 @@ f2lsvgst_pattern_44(
/** Write pattern 45 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2066,22 +2026,21 @@ static
void
f2lsvgst_pattern_45(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 10.18, 10.18);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_pattern_background(job, pat, 10.18, 10.18);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 28);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 29);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 30);
+ f2lsvgst_pattern_foreground_line(job, pat, 28);
+ f2lsvgst_pattern_foreground_line(job, pat, 29);
+ f2lsvgst_pattern_foreground_line(job, pat, 30);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2095,7 +2054,6 @@ f2lsvgst_pattern_45(
/** Write pattern 46 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2103,29 +2061,28 @@ static
void
f2lsvgst_pattern_46(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 10.18, 10.18);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_pattern_background(job, pat, 10.18, 10.18);
/* Pattern contents 2: lines.
*/
#if 1
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 31);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 32);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 31);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 32);
#else
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 25);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 26);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 27);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 28);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 29);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 30);
+ f2lsvgst_pattern_foreground_line(job, pat, 25);
+ f2lsvgst_pattern_foreground_line(job, pat, 26);
+ f2lsvgst_pattern_foreground_line(job, pat, 27);
+ f2lsvgst_pattern_foreground_line(job, pat, 28);
+ f2lsvgst_pattern_foreground_line(job, pat, 29);
+ f2lsvgst_pattern_foreground_line(job, pat, 30);
#endif
/* Close pattern tag.
*/
@@ -2140,7 +2097,6 @@ f2lsvgst_pattern_46(
/** Write pattern 47 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2148,26 +2104,25 @@ static
void
f2lsvgst_pattern_47(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 28.8, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_pattern_background(job, pat, 28.8, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 33);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 34);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 35);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 36);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 37);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 38);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 39);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 33);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 34);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 35);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 36);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 37);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 38);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 39);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2181,7 +2136,6 @@ f2lsvgst_pattern_47(
/** Write pattern 48 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2189,26 +2143,25 @@ static
void
f2lsvgst_pattern_48(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 28.8);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_pattern_background(job, pat, 14.4, 28.8);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 40);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 41);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 42);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 43);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 44);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 45);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 46);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 40);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 41);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 42);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 43);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 44);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 45);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 46);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2222,7 +2175,6 @@ f2lsvgst_pattern_48(
/** Write pattern 49 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2230,21 +2182,20 @@ static
void
f2lsvgst_pattern_49(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 3.6, 3.6);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_pattern_background(job, pat, 3.6, 3.6);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 47);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 48);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 47);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 48);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2258,7 +2209,6 @@ f2lsvgst_pattern_49(
/** Write pattern 50 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2266,21 +2216,20 @@ static
void
f2lsvgst_pattern_50(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 3.6, 3.6);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_pattern_background(job, pat, 3.6, 3.6);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 49);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 50);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 49);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 50);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2294,7 +2243,6 @@ f2lsvgst_pattern_50(
/** Write pattern 51 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2302,20 +2250,19 @@ static
void
f2lsvgst_pattern_51(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 3.6, 3.6);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_pattern_background(job, pat, 3.6, 3.6);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_polygon_lcr(job, drw, psvg, pat, 52);
+ f2lsvgst_pattern_foreground_polygon_lcr(job, pat, 52);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2329,7 +2276,6 @@ f2lsvgst_pattern_51(
/** Write pattern 52 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2337,28 +2283,27 @@ static
void
f2lsvgst_pattern_52(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 28.8);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_pattern_background(job, pat, 14.4, 28.8);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 53);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 54);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 55);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 56);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 57);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 58);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 59);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 60);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 61);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 53);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 54);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 55);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 56);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 57);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 58);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 59);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 60);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 61);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2372,7 +2317,6 @@ f2lsvgst_pattern_52(
/** Write pattern 53 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2380,28 +2324,27 @@ static
void
f2lsvgst_pattern_53(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 28.8);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_pattern_background(job, pat, 14.4, 28.8);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 62);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 63);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 64);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 65);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 66);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 67);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 68);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 69);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 70);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 62);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 63);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 64);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 65);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 66);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 67);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 68);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 69);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 70);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2415,7 +2358,6 @@ f2lsvgst_pattern_53(
/** Write pattern 54 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2423,28 +2365,27 @@ static
void
f2lsvgst_pattern_54(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 28.8, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_pattern_background(job, pat, 28.8, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 71);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 72);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 73);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 74);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 75);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 76);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 77);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 78);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 79);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 71);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 72);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 73);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 74);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 75);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 76);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 77);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 78);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 79);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2458,7 +2399,6 @@ f2lsvgst_pattern_54(
/** Write pattern 55 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2466,28 +2406,27 @@ static
void
f2lsvgst_pattern_55(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 28.8, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_pattern_background(job, pat, 28.8, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 80);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 81);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 82);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 83);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 84);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 85);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 86);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 87);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 88);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 80);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 81);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 82);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 83);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 84);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 85);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 86);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 87);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 88);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2501,7 +2440,6 @@ f2lsvgst_pattern_55(
/** Write pattern 56 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2509,24 +2447,23 @@ static
void
f2lsvgst_pattern_56(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.54, 7.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.54, 7.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.54, 7.4);
+ f2lsvgst_pattern_background(job, pat, 14.54, 7.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 90);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 91);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 92);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 93);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 94);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 90);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 91);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 92);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 93);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 94);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2548,24 +2485,23 @@ static
void
f2lsvgst_pattern_57(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 7.2);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_pattern_background(job, pat, 7.2, 7.2);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 95);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 96);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 97);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 98);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 99);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 95);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 96);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 97);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 98);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 99);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2579,7 +2515,6 @@ f2lsvgst_pattern_57(
/** Write pattern 58 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2587,20 +2522,19 @@ static
void
f2lsvgst_pattern_58(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 14.4);
+ f2lsvgst_pattern_background(job, pat, 14.4, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_circle_lcr(job, drw, psvg, pat);
+ f2lsvgst_pattern_foreground_circle_lcr(job, pat);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2614,7 +2548,6 @@ f2lsvgst_pattern_58(
/** Write pattern 59 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2622,23 +2555,22 @@ static
void
f2lsvgst_pattern_59(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 21.6, 12.47);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 21.6, 12.47);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 21.6, 12.47);
+ f2lsvgst_pattern_background(job, pat, 21.6, 12.47);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_polygon_lcr(job, drw, psvg, pat, 103);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 104);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 105);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 106);
+ f2lsvgst_pattern_foreground_polygon_lcr(job, pat, 103);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 104);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 105);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 106);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2652,7 +2584,6 @@ f2lsvgst_pattern_59(
/** Write pattern 60 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2660,20 +2591,19 @@ static
void
f2lsvgst_pattern_60(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 14.4);
+ f2lsvgst_pattern_background(job, pat, 14.4, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_polygon_lcr_l2(job, drw, psvg, pat, 107, 108);
+ f2lsvgst_pattern_foreground_polygon_lcr_l2(job, pat, 107, 108);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2687,7 +2617,6 @@ f2lsvgst_pattern_60(
/** Write pattern 61 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2695,20 +2624,19 @@ static
void
f2lsvgst_pattern_61(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 7.2);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_pattern_background(job, pat, 7.2, 7.2);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 109);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 109);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2722,7 +2650,6 @@ f2lsvgst_pattern_61(
/** Write pattern 62 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2730,20 +2657,19 @@ static
void
f2lsvgst_pattern_62(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 7.2);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_pattern_background(job, pat, 7.2, 7.2);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 110);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 110);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2757,7 +2683,6 @@ f2lsvgst_pattern_62(
/** Write one pattern definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2765,77 +2690,76 @@ static
void
f2lsvgst_write_one_pattern(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
switch(pat->fn) {
case 41: {
- f2lsvgst_pattern_41(job, drw, psvg, pat);
+ f2lsvgst_pattern_41(job, psvg, pat);
} break;
case 42: {
- f2lsvgst_pattern_42(job, drw, psvg, pat);
+ f2lsvgst_pattern_42(job, psvg, pat);
} break;
case 43: {
- f2lsvgst_pattern_43(job, drw, psvg, pat);
+ f2lsvgst_pattern_43(job, psvg, pat);
} break;
case 44: {
- f2lsvgst_pattern_44(job, drw, psvg, pat);
+ f2lsvgst_pattern_44(job, psvg, pat);
} break;
case 45: {
- f2lsvgst_pattern_45(job, drw, psvg, pat);
+ f2lsvgst_pattern_45(job, psvg, pat);
} break;
case 46: {
- f2lsvgst_pattern_46(job, drw, psvg, pat);
+ f2lsvgst_pattern_46(job, psvg, pat);
} break;
case 47: {
- f2lsvgst_pattern_47(job, drw, psvg, pat);
+ f2lsvgst_pattern_47(job, psvg, pat);
} break;
case 48: {
- f2lsvgst_pattern_48(job, drw, psvg, pat);
+ f2lsvgst_pattern_48(job, psvg, pat);
} break;
case 49: {
- f2lsvgst_pattern_49(job, drw, psvg, pat);
+ f2lsvgst_pattern_49(job, psvg, pat);
} break;
case 50: {
- f2lsvgst_pattern_50(job, drw, psvg, pat);
+ f2lsvgst_pattern_50(job, psvg, pat);
} break;
case 51: {
- f2lsvgst_pattern_51(job, drw, psvg, pat);
+ f2lsvgst_pattern_51(job, psvg, pat);
} break;
case 52: {
- f2lsvgst_pattern_52(job, drw, psvg, pat);
+ f2lsvgst_pattern_52(job, psvg, pat);
} break;
case 53: {
- f2lsvgst_pattern_53(job, drw, psvg, pat);
+ f2lsvgst_pattern_53(job, psvg, pat);
} break;
case 54: {
- f2lsvgst_pattern_54(job, drw, psvg, pat);
+ f2lsvgst_pattern_54(job, psvg, pat);
} break;
case 55: {
- f2lsvgst_pattern_55(job, drw, psvg, pat);
+ f2lsvgst_pattern_55(job, psvg, pat);
} break;
case 56: {
- f2lsvgst_pattern_56(job, drw, psvg, pat);
+ f2lsvgst_pattern_56(job, psvg, pat);
} break;
case 57: {
- f2lsvgst_pattern_57(job, drw, psvg, pat);
+ f2lsvgst_pattern_57(job, psvg, pat);
} break;
case 58: {
- f2lsvgst_pattern_58(job, drw, psvg, pat);
+ f2lsvgst_pattern_58(job, psvg, pat);
} break;
case 59: {
- f2lsvgst_pattern_59(job, drw, psvg, pat);
+ f2lsvgst_pattern_59(job, psvg, pat);
} break;
case 60: {
- f2lsvgst_pattern_60(job, drw, psvg, pat);
+ f2lsvgst_pattern_60(job, psvg, pat);
} break;
case 61: {
- f2lsvgst_pattern_61(job, drw, psvg, pat);
+ f2lsvgst_pattern_61(job, psvg, pat);
} break;
case 62: {
- f2lsvgst_pattern_62(job, drw, psvg, pat);
+ f2lsvgst_pattern_62(job, psvg, pat);
} break;
}
}
@@ -2845,7 +2769,6 @@ f2lsvgst_write_one_pattern(
void
f2lsvgst_write_patterns(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg
)
{
@@ -2855,7 +2778,7 @@ f2lsvgst_write_patterns(
do {
pat = (f2l_svg_fill_pattern_t *)dk3sto_it_next(psvg->iPatterns);
if(pat) {
- f2lsvgst_write_one_pattern(job, drw, psvg, pat);
+ f2lsvgst_write_one_pattern(job, psvg, pat);
}
} while(pat);
}
@@ -2865,7 +2788,6 @@ f2lsvgst_write_patterns(
/** Write one style to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pst Style definition to write.
*/
@@ -2873,7 +2795,6 @@ static
void
f2lsvgst_write_one_style(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_style_t *pst
)
@@ -2886,7 +2807,7 @@ f2lsvgst_write_one_style(
if(pst->tf < 0) { pst->tf = 0; }
if(pst->tf > 34) { pst->tf = 34; }
fputs(f2lsvgst_c8_kw[112], job->of1);
- f2lsvgst_write_style_id(job, drw, psvg, pst);
+ f2lsvgst_write_style_id(job, psvg, pst);
fputs(f2lsvgst_c8_kw[113], job->of1);
if((pst->flags) & DK3_SVG_FLAGS_FONT) {
if((pst->flags) & DK3_SVG_FLAGS_PS_FONT) {
@@ -3021,7 +2942,7 @@ f2lsvgst_write_one_style(
*/
if(pst->fp) {
fputs(f2lsvgst_c8_kw[134], job->of1);
- f2lsvgst_write_pattern_id(job, drw, psvg, pst->fp);
+ f2lsvgst_write_pattern_id(job, psvg, pst->fp);
fputs(f2lsvgst_c8_kw[135], job->of1);
} else {
if((pst->flags) & DK3_SVG_FLAGS_COLOR_FILL) {
@@ -3148,7 +3069,6 @@ f2lsvgst_write_one_style(
/** Write attributes for one style to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pst Style definition to write.
*/
@@ -3156,7 +3076,6 @@ static
void
f2lsvgst_write_attributes_for_one_style(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_style_t *pst
)
@@ -3251,7 +3170,7 @@ f2lsvgst_write_attributes_for_one_style(
*/
if(pst->fp) {
fputs(f2lsvgst_c8_kw[167], job->of1);
- f2lsvgst_write_pattern_id(job, drw, psvg, pst->fp);
+ f2lsvgst_write_pattern_id(job, psvg, pst->fp);
fputs(f2lsvgst_c8_kw[168], job->of1);
} else {
if((pst->flags) & DK3_SVG_FLAGS_COLOR_FILL) {
@@ -3358,33 +3277,33 @@ f2lsvgst_write_style_for_object(
f2l_svg_style_t *pst;
-#line 3429 "f2lsvgst.ctr"
+#line 3320 "f2lsvgst.ctr"
if((job) && (drw) && (psvg) && (pobj)) {
pst = (f2l_svg_style_t *)(pobj->dsd);
if(pst) {
-#line 3432 "f2lsvgst.ctr"
+#line 3323 "f2lsvgst.ctr"
if(job->css) {
-#line 3433 "f2lsvgst.ctr"
+#line 3324 "f2lsvgst.ctr"
fputs(f2lsvgst_c8_kw[181], job->of1);
- f2lsvgst_write_style_id(job, drw, psvg, pst);
+ f2lsvgst_write_style_id(job, psvg, pst);
fputs(f2lsvgst_c8_kw[182], job->of1);
} else {
-#line 3437 "f2lsvgst.ctr"
- f2lsvgst_write_attributes_for_one_style(job, drw, psvg, pst);
+#line 3328 "f2lsvgst.ctr"
+ f2lsvgst_write_attributes_for_one_style(job, psvg, pst);
}
} else {
-#line 3440 "f2lsvgst.ctr"
+#line 3331 "f2lsvgst.ctr"
}
} else {
-#line 3442 "f2lsvgst.ctr"
+#line 3333 "f2lsvgst.ctr"
}
-#line 3443 "f2lsvgst.ctr"
+#line 3334 "f2lsvgst.ctr"
}
@@ -3392,7 +3311,6 @@ f2lsvgst_write_style_for_object(
void
f2lsvgst_write_styles(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg
)
{
@@ -3402,7 +3320,7 @@ f2lsvgst_write_styles(
do {
pst = (f2l_svg_style_t *)dk3sto_it_next(psvg->iStyles);
if(pst) {
- f2lsvgst_write_one_style(job, drw, psvg, pst);
+ f2lsvgst_write_one_style(job, psvg, pst);
}
} while(pst);
}
diff --git a/support/dktools/f2lsvgst.ctr b/support/dktools/f2lsvgst.ctr
index f7115ad452..6f6c2de642 100644
--- a/support/dktools/f2lsvgst.ctr
+++ b/support/dktools/f2lsvgst.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -116,24 +116,6 @@ typedef struct {
extern "C" {
#endif
-/** Compare two fill pattern structures.
- @param l Left fill pattern structure.
- @param r Right fill pattern structure.
- @param cr Comparison criteria (ignored).
- @return Comparison result.
-*/
-int
-f2lsvgst_compare_pattern(void const *l, void const *r, int cr);
-
-/** Compare two object styles.
- @param l Left object.
- @param r Right object.
- @param cr Comparison criteria (ignored).
- @return Comparison result.
-*/
-int
-f2lsvgst_compare_object_styles(void const *l, void const *r, int cr);
-
/** Create new SVG structure.
@param app Application structure for diagnostics.
@return Pointer to new structure on success, NULL on error.
@@ -310,13 +292,11 @@ f2lsvgst_any_ps_font_used(f2l_svg_t *psvg);
/** Write all patterns used to the SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
*/
void
f2lsvgst_write_patterns(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg
);
@@ -336,13 +316,11 @@ f2lsvgst_pattern_id(
/** Write styles to output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
*/
void
f2lsvgst_write_styles(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg
);
@@ -374,34 +352,6 @@ f2lsvgst_write_style_for_object(
dk3_fig_obj_t *pobj
);
-/** Write pattern ID.
- @param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
- @param pat Pattern used for current object.
-*/
-void
-f2lsvgst_write_pattern_id(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
- f2l_svg_fill_pattern_t *pat
-);
-
-/** Write style ID.
- @param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
- @param pst Style used by current object.
-*/
-void
-f2lsvgst_write_style_id(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
- f2l_svg_style_t *pst
-);
-
#ifdef __cplusplus
}
#endif
@@ -409,6 +359,7 @@ f2lsvgst_write_style_id(
%% module
#include "f2lsvgst.h"
+#include "dk3unused.h"
@@ -895,6 +846,7 @@ $!end
@param y Right value.
@return Comparison result.
*/
+static
int
f2lsvgst_compare_int(int x, int y)
{
@@ -912,12 +864,17 @@ f2lsvgst_compare_int(int x, int y)
+static
int
-f2lsvgst_compare_pattern(void const *l, void const *r, int cr)
+f2lsvgst_compare_pattern(
+ void const *l, void const *r, int DK3_ARG_UNUSED(cr)
+)
{
int back = 0;
f2l_svg_fill_pattern_t const *pl;
f2l_svg_fill_pattern_t const *pr;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (f2l_svg_fill_pattern_t const *)l;
@@ -950,13 +907,17 @@ f2lsvgst_compare_pattern(void const *l, void const *r, int cr)
+static
int
-f2lsvgst_compare_object_styles(void const *l, void const *r, int cr)
+f2lsvgst_compare_object_styles(
+ void const *l, void const *r, int DK3_ARG_UNUSED(cr)
+)
{
f2l_svg_style_t const *pl;
f2l_svg_style_t const *pr;
int back = 0;
$? "+ f2lsvgst_compare_object_styles"
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (f2l_svg_style_t const *)l;
@@ -1709,10 +1670,15 @@ f2lsvgst_write_id(
+/** Write pattern ID.
+ @param job Job structure.
+ @param psvg SVG style collection.
+ @param pat Pattern used for current object.
+*/
+static
void
f2lsvgst_write_pattern_id(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
@@ -1725,10 +1691,15 @@ f2lsvgst_write_pattern_id(
+/** Write style ID.
+ @param job Job structure.
+ @param psvg SVG style collection.
+ @param pst Style used by current object.
+*/
+static
void
f2lsvgst_write_style_id(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_style_t *pst
)
@@ -1742,7 +1713,6 @@ f2lsvgst_write_style_id(
/** Write opening pattern tag.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
@param w Pattern width.
@@ -1752,7 +1722,6 @@ static
void
f2lsvgst_write_opening_pattern_tag(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
double w,
@@ -1762,7 +1731,7 @@ f2lsvgst_write_opening_pattern_tag(
fputs(f2lsvgst_c8_kw[6], job->of1);
f2lsvgst_tag(job, 3);
fputs(f2lsvgst_c8_kw[7], job->of1);
- f2lsvgst_write_pattern_id(job, drw, psvg, pat);
+ f2lsvgst_write_pattern_id(job, psvg, pat);
fprintf(job->of1, f2lsvgst_c8_kw[9], w, h);
}
@@ -1770,8 +1739,6 @@ f2lsvgst_write_opening_pattern_tag(
/** Write opening pattern tag.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param w Pattern width.
@param h Pattern height.
@@ -1780,8 +1747,6 @@ static
void
f2lsvgst_pattern_background(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
double w,
double h
@@ -1798,8 +1763,6 @@ f2lsvgst_pattern_background(
/** Draw foreground line in pattern.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param ind Index of points line in f2lsvgst_c8_kw.
*/
@@ -1807,8 +1770,6 @@ static
void
f2lsvgst_pattern_foreground_line(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t ind
)
@@ -1825,8 +1786,6 @@ f2lsvgst_pattern_foreground_line(
/** Draw foreground line in pattern.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param ind Index of points line in f2lsvgst_c8_kw.
*/
@@ -1834,8 +1793,6 @@ static
void
f2lsvgst_pattern_foreground_line_lcr(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t ind
)
@@ -1854,8 +1811,6 @@ f2lsvgst_pattern_foreground_line_lcr(
/** Draw foreground polygon in pattern.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param ind Index of points line in f2lsvgst_c8_kw.
*/
@@ -1863,8 +1818,6 @@ static
void
f2lsvgst_pattern_foreground_polygon_lcr(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t ind
)
@@ -1883,8 +1836,6 @@ f2lsvgst_pattern_foreground_polygon_lcr(
/** Draw foreground polygon in pattern, 2 data lines.
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param i1 Index of points line in f2lsvgst_c8_kw.
@param i2 Index of points line 2.
@@ -1893,8 +1844,6 @@ static
void
f2lsvgst_pattern_foreground_polygon_lcr_l2(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t i1,
size_t i2
@@ -1916,8 +1865,6 @@ f2lsvgst_pattern_foreground_polygon_lcr_l2(
/** Draw foreground path in pattern
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
@param ind Index of data line in f2lsvgst_c8_kw.
*/
@@ -1925,8 +1872,6 @@ static
void
f2lsvgst_pattern_foreground_path_lcr(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat,
size_t ind
)
@@ -1945,16 +1890,12 @@ f2lsvgst_pattern_foreground_path_lcr(
/** Draw foreground circle in pattern
@param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
@param pat Pattern to write.
*/
static
void
f2lsvgst_pattern_foreground_circle_lcr(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
@@ -1971,7 +1912,6 @@ f2lsvgst_pattern_foreground_circle_lcr(
/** Write pattern 41 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -1979,22 +1919,21 @@ static
void
f2lsvgst_pattern_41(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 4.16);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_pattern_background(job, pat, 7.2, 4.16);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 15);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 16);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 17);
+ f2lsvgst_pattern_foreground_line(job, pat, 15);
+ f2lsvgst_pattern_foreground_line(job, pat, 16);
+ f2lsvgst_pattern_foreground_line(job, pat, 17);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2008,7 +1947,6 @@ f2lsvgst_pattern_41(
/** Write pattern 42 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2016,22 +1954,21 @@ static
void
f2lsvgst_pattern_42(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 4.16);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_pattern_background(job, pat, 7.2, 4.16);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 19);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 20);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 21);
+ f2lsvgst_pattern_foreground_line(job, pat, 19);
+ f2lsvgst_pattern_foreground_line(job, pat, 20);
+ f2lsvgst_pattern_foreground_line(job, pat, 21);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2045,7 +1982,6 @@ f2lsvgst_pattern_42(
/** Write pattern 43 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2053,29 +1989,28 @@ static
void
f2lsvgst_pattern_43(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 4.16);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 4.16);
+ f2lsvgst_pattern_background(job, pat, 7.2, 4.16);
/* Pattern contents 2: lines.
*/
#if 1
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 23);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 24);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 23);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 24);
#else
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 15);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 16);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 17);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 19);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 20);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 21);
+ f2lsvgst_pattern_foreground_line(job, pat, 15);
+ f2lsvgst_pattern_foreground_line(job, pat, 16);
+ f2lsvgst_pattern_foreground_line(job, pat, 17);
+ f2lsvgst_pattern_foreground_line(job, pat, 19);
+ f2lsvgst_pattern_foreground_line(job, pat, 20);
+ f2lsvgst_pattern_foreground_line(job, pat, 21);
#endif
/* Close pattern tag.
*/
@@ -2090,7 +2025,6 @@ f2lsvgst_pattern_43(
/** Write pattern 44 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2098,22 +2032,21 @@ static
void
f2lsvgst_pattern_44(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 10.18, 10.18);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_pattern_background(job, pat, 10.18, 10.18);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 25);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 26);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 27);
+ f2lsvgst_pattern_foreground_line(job, pat, 25);
+ f2lsvgst_pattern_foreground_line(job, pat, 26);
+ f2lsvgst_pattern_foreground_line(job, pat, 27);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2127,7 +2060,6 @@ f2lsvgst_pattern_44(
/** Write pattern 45 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2135,22 +2067,21 @@ static
void
f2lsvgst_pattern_45(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 10.18, 10.18);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_pattern_background(job, pat, 10.18, 10.18);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 28);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 29);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 30);
+ f2lsvgst_pattern_foreground_line(job, pat, 28);
+ f2lsvgst_pattern_foreground_line(job, pat, 29);
+ f2lsvgst_pattern_foreground_line(job, pat, 30);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2164,7 +2095,6 @@ f2lsvgst_pattern_45(
/** Write pattern 46 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2172,29 +2102,28 @@ static
void
f2lsvgst_pattern_46(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 10.18, 10.18);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 10.18, 10.18);
+ f2lsvgst_pattern_background(job, pat, 10.18, 10.18);
/* Pattern contents 2: lines.
*/
#if 1
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 31);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 32);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 31);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 32);
#else
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 25);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 26);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 27);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 28);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 29);
- f2lsvgst_pattern_foreground_line(job, drw, psvg, pat, 30);
+ f2lsvgst_pattern_foreground_line(job, pat, 25);
+ f2lsvgst_pattern_foreground_line(job, pat, 26);
+ f2lsvgst_pattern_foreground_line(job, pat, 27);
+ f2lsvgst_pattern_foreground_line(job, pat, 28);
+ f2lsvgst_pattern_foreground_line(job, pat, 29);
+ f2lsvgst_pattern_foreground_line(job, pat, 30);
#endif
/* Close pattern tag.
*/
@@ -2209,7 +2138,6 @@ f2lsvgst_pattern_46(
/** Write pattern 47 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2217,26 +2145,25 @@ static
void
f2lsvgst_pattern_47(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 28.8, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_pattern_background(job, pat, 28.8, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 33);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 34);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 35);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 36);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 37);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 38);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 39);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 33);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 34);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 35);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 36);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 37);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 38);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 39);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2250,7 +2177,6 @@ f2lsvgst_pattern_47(
/** Write pattern 48 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2258,26 +2184,25 @@ static
void
f2lsvgst_pattern_48(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 28.8);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_pattern_background(job, pat, 14.4, 28.8);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 40);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 41);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 42);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 43);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 44);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 45);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 46);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 40);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 41);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 42);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 43);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 44);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 45);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 46);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2291,7 +2216,6 @@ f2lsvgst_pattern_48(
/** Write pattern 49 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2299,21 +2223,20 @@ static
void
f2lsvgst_pattern_49(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 3.6, 3.6);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_pattern_background(job, pat, 3.6, 3.6);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 47);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 48);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 47);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 48);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2327,7 +2250,6 @@ f2lsvgst_pattern_49(
/** Write pattern 50 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2335,21 +2257,20 @@ static
void
f2lsvgst_pattern_50(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 3.6, 3.6);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_pattern_background(job, pat, 3.6, 3.6);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 49);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 50);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 49);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 50);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2363,7 +2284,6 @@ f2lsvgst_pattern_50(
/** Write pattern 51 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2371,20 +2291,19 @@ static
void
f2lsvgst_pattern_51(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 3.6, 3.6);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 3.6, 3.6);
+ f2lsvgst_pattern_background(job, pat, 3.6, 3.6);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_polygon_lcr(job, drw, psvg, pat, 52);
+ f2lsvgst_pattern_foreground_polygon_lcr(job, pat, 52);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2398,7 +2317,6 @@ f2lsvgst_pattern_51(
/** Write pattern 52 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2406,28 +2324,27 @@ static
void
f2lsvgst_pattern_52(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 28.8);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_pattern_background(job, pat, 14.4, 28.8);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 53);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 54);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 55);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 56);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 57);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 58);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 59);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 60);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 61);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 53);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 54);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 55);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 56);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 57);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 58);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 59);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 60);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 61);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2441,7 +2358,6 @@ f2lsvgst_pattern_52(
/** Write pattern 53 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2449,28 +2365,27 @@ static
void
f2lsvgst_pattern_53(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 28.8);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 28.8);
+ f2lsvgst_pattern_background(job, pat, 14.4, 28.8);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 62);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 63);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 64);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 65);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 66);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 67);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 68);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 69);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 70);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 62);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 63);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 64);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 65);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 66);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 67);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 68);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 69);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 70);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2484,7 +2399,6 @@ f2lsvgst_pattern_53(
/** Write pattern 54 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2492,28 +2406,27 @@ static
void
f2lsvgst_pattern_54(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 28.8, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_pattern_background(job, pat, 28.8, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 71);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 72);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 73);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 74);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 75);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 76);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 77);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 78);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 79);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 71);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 72);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 73);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 74);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 75);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 76);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 77);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 78);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 79);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2527,7 +2440,6 @@ f2lsvgst_pattern_54(
/** Write pattern 55 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2535,28 +2447,27 @@ static
void
f2lsvgst_pattern_55(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 28.8, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 28.8, 14.4);
+ f2lsvgst_pattern_background(job, pat, 28.8, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 80);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 81);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 82);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 83);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 84);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 85);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 86);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 87);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 88);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 80);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 81);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 82);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 83);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 84);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 85);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 86);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 87);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 88);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2570,7 +2481,6 @@ f2lsvgst_pattern_55(
/** Write pattern 56 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2578,24 +2488,23 @@ static
void
f2lsvgst_pattern_56(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.54, 7.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.54, 7.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.54, 7.4);
+ f2lsvgst_pattern_background(job, pat, 14.54, 7.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 90);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 91);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 92);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 93);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 94);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 90);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 91);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 92);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 93);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 94);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2617,24 +2526,23 @@ static
void
f2lsvgst_pattern_57(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 7.2);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_pattern_background(job, pat, 7.2, 7.2);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 95);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 96);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 97);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 98);
- f2lsvgst_pattern_foreground_path_lcr(job, drw, psvg, pat, 99);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 95);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 96);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 97);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 98);
+ f2lsvgst_pattern_foreground_path_lcr(job, pat, 99);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2648,7 +2556,6 @@ f2lsvgst_pattern_57(
/** Write pattern 58 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2656,20 +2563,19 @@ static
void
f2lsvgst_pattern_58(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 14.4);
+ f2lsvgst_pattern_background(job, pat, 14.4, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_circle_lcr(job, drw, psvg, pat);
+ f2lsvgst_pattern_foreground_circle_lcr(job, pat);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2683,7 +2589,6 @@ f2lsvgst_pattern_58(
/** Write pattern 59 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2691,23 +2596,22 @@ static
void
f2lsvgst_pattern_59(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 21.6, 12.47);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 21.6, 12.47);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 21.6, 12.47);
+ f2lsvgst_pattern_background(job, pat, 21.6, 12.47);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_polygon_lcr(job, drw, psvg, pat, 103);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 104);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 105);
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 106);
+ f2lsvgst_pattern_foreground_polygon_lcr(job, pat, 103);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 104);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 105);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 106);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2721,7 +2625,6 @@ f2lsvgst_pattern_59(
/** Write pattern 60 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2729,20 +2632,19 @@ static
void
f2lsvgst_pattern_60(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 14.4, 14.4);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 14.4, 14.4);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 14.4, 14.4);
+ f2lsvgst_pattern_background(job, pat, 14.4, 14.4);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_polygon_lcr_l2(job, drw, psvg, pat, 107, 108);
+ f2lsvgst_pattern_foreground_polygon_lcr_l2(job, pat, 107, 108);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2756,7 +2658,6 @@ f2lsvgst_pattern_60(
/** Write pattern 61 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2764,20 +2665,19 @@ static
void
f2lsvgst_pattern_61(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 7.2);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_pattern_background(job, pat, 7.2, 7.2);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 109);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 109);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2791,7 +2691,6 @@ f2lsvgst_pattern_61(
/** Write pattern 62 definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2799,20 +2698,19 @@ static
void
f2lsvgst_pattern_62(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
/* Opening pattern tag.
*/
- f2lsvgst_write_opening_pattern_tag(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_write_opening_pattern_tag(job, psvg, pat, 7.2, 7.2);
/* Pattern contents 1: background.
*/
- f2lsvgst_pattern_background(job, drw, psvg, pat, 7.2, 7.2);
+ f2lsvgst_pattern_background(job, pat, 7.2, 7.2);
/* Pattern contents 2: lines.
*/
- f2lsvgst_pattern_foreground_line_lcr(job, drw, psvg, pat, 110);
+ f2lsvgst_pattern_foreground_line_lcr(job, pat, 110);
/* Close pattern tag.
*/
fputs(f2lsvgst_c8_kw[6], job->of1);
@@ -2826,7 +2724,6 @@ f2lsvgst_pattern_62(
/** Write one pattern definition to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pat Pattern to write.
*/
@@ -2834,77 +2731,76 @@ static
void
f2lsvgst_write_one_pattern(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_fill_pattern_t *pat
)
{
switch(pat->fn) {
case 41: {
- f2lsvgst_pattern_41(job, drw, psvg, pat);
+ f2lsvgst_pattern_41(job, psvg, pat);
} break;
case 42: {
- f2lsvgst_pattern_42(job, drw, psvg, pat);
+ f2lsvgst_pattern_42(job, psvg, pat);
} break;
case 43: {
- f2lsvgst_pattern_43(job, drw, psvg, pat);
+ f2lsvgst_pattern_43(job, psvg, pat);
} break;
case 44: {
- f2lsvgst_pattern_44(job, drw, psvg, pat);
+ f2lsvgst_pattern_44(job, psvg, pat);
} break;
case 45: {
- f2lsvgst_pattern_45(job, drw, psvg, pat);
+ f2lsvgst_pattern_45(job, psvg, pat);
} break;
case 46: {
- f2lsvgst_pattern_46(job, drw, psvg, pat);
+ f2lsvgst_pattern_46(job, psvg, pat);
} break;
case 47: {
- f2lsvgst_pattern_47(job, drw, psvg, pat);
+ f2lsvgst_pattern_47(job, psvg, pat);
} break;
case 48: {
- f2lsvgst_pattern_48(job, drw, psvg, pat);
+ f2lsvgst_pattern_48(job, psvg, pat);
} break;
case 49: {
- f2lsvgst_pattern_49(job, drw, psvg, pat);
+ f2lsvgst_pattern_49(job, psvg, pat);
} break;
case 50: {
- f2lsvgst_pattern_50(job, drw, psvg, pat);
+ f2lsvgst_pattern_50(job, psvg, pat);
} break;
case 51: {
- f2lsvgst_pattern_51(job, drw, psvg, pat);
+ f2lsvgst_pattern_51(job, psvg, pat);
} break;
case 52: {
- f2lsvgst_pattern_52(job, drw, psvg, pat);
+ f2lsvgst_pattern_52(job, psvg, pat);
} break;
case 53: {
- f2lsvgst_pattern_53(job, drw, psvg, pat);
+ f2lsvgst_pattern_53(job, psvg, pat);
} break;
case 54: {
- f2lsvgst_pattern_54(job, drw, psvg, pat);
+ f2lsvgst_pattern_54(job, psvg, pat);
} break;
case 55: {
- f2lsvgst_pattern_55(job, drw, psvg, pat);
+ f2lsvgst_pattern_55(job, psvg, pat);
} break;
case 56: {
- f2lsvgst_pattern_56(job, drw, psvg, pat);
+ f2lsvgst_pattern_56(job, psvg, pat);
} break;
case 57: {
- f2lsvgst_pattern_57(job, drw, psvg, pat);
+ f2lsvgst_pattern_57(job, psvg, pat);
} break;
case 58: {
- f2lsvgst_pattern_58(job, drw, psvg, pat);
+ f2lsvgst_pattern_58(job, psvg, pat);
} break;
case 59: {
- f2lsvgst_pattern_59(job, drw, psvg, pat);
+ f2lsvgst_pattern_59(job, psvg, pat);
} break;
case 60: {
- f2lsvgst_pattern_60(job, drw, psvg, pat);
+ f2lsvgst_pattern_60(job, psvg, pat);
} break;
case 61: {
- f2lsvgst_pattern_61(job, drw, psvg, pat);
+ f2lsvgst_pattern_61(job, psvg, pat);
} break;
case 62: {
- f2lsvgst_pattern_62(job, drw, psvg, pat);
+ f2lsvgst_pattern_62(job, psvg, pat);
} break;
}
}
@@ -2914,7 +2810,6 @@ f2lsvgst_write_one_pattern(
void
f2lsvgst_write_patterns(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg
)
{
@@ -2924,7 +2819,7 @@ f2lsvgst_write_patterns(
do {
pat = (f2l_svg_fill_pattern_t *)dk3sto_it_next(psvg->iPatterns);
if(pat) {
- f2lsvgst_write_one_pattern(job, drw, psvg, pat);
+ f2lsvgst_write_one_pattern(job, psvg, pat);
}
} while(pat);
}
@@ -2934,7 +2829,6 @@ f2lsvgst_write_patterns(
/** Write one style to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pst Style definition to write.
*/
@@ -2942,7 +2836,6 @@ static
void
f2lsvgst_write_one_style(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_style_t *pst
)
@@ -2955,7 +2848,7 @@ f2lsvgst_write_one_style(
if(pst->tf < 0) { pst->tf = 0; }
if(pst->tf > 34) { pst->tf = 34; }
fputs(f2lsvgst_c8_kw[112], job->of1);
- f2lsvgst_write_style_id(job, drw, psvg, pst);
+ f2lsvgst_write_style_id(job, psvg, pst);
fputs(f2lsvgst_c8_kw[113], job->of1);
if((pst->flags) & DK3_SVG_FLAGS_FONT) {
if((pst->flags) & DK3_SVG_FLAGS_PS_FONT) {
@@ -3090,7 +2983,7 @@ f2lsvgst_write_one_style(
*/
if(pst->fp) {
fputs(f2lsvgst_c8_kw[134], job->of1);
- f2lsvgst_write_pattern_id(job, drw, psvg, pst->fp);
+ f2lsvgst_write_pattern_id(job, psvg, pst->fp);
fputs(f2lsvgst_c8_kw[135], job->of1);
} else {
if((pst->flags) & DK3_SVG_FLAGS_COLOR_FILL) {
@@ -3217,7 +3110,6 @@ f2lsvgst_write_one_style(
/** Write attributes for one style to SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
@param pst Style definition to write.
*/
@@ -3225,7 +3117,6 @@ static
void
f2lsvgst_write_attributes_for_one_style(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg,
f2l_svg_style_t *pst
)
@@ -3320,7 +3211,7 @@ f2lsvgst_write_attributes_for_one_style(
*/
if(pst->fp) {
fputs(f2lsvgst_c8_kw[167], job->of1);
- f2lsvgst_write_pattern_id(job, drw, psvg, pst->fp);
+ f2lsvgst_write_pattern_id(job, psvg, pst->fp);
fputs(f2lsvgst_c8_kw[168], job->of1);
} else {
if((pst->flags) & DK3_SVG_FLAGS_COLOR_FILL) {
@@ -3431,10 +3322,10 @@ f2lsvgst_write_style_for_object(
if(pst) { $? ". style"
if(job->css) { $? ". css"
fputs(f2lsvgst_c8_kw[181], job->of1);
- f2lsvgst_write_style_id(job, drw, psvg, pst);
+ f2lsvgst_write_style_id(job, psvg, pst);
fputs(f2lsvgst_c8_kw[182], job->of1);
} else { $? ". simple attributes"
- f2lsvgst_write_attributes_for_one_style(job, drw, psvg, pst);
+ f2lsvgst_write_attributes_for_one_style(job, psvg, pst);
}
} else { $? "! style"
}
@@ -3447,7 +3338,6 @@ f2lsvgst_write_style_for_object(
void
f2lsvgst_write_styles(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg
)
{
@@ -3457,7 +3347,7 @@ f2lsvgst_write_styles(
do {
pst = (f2l_svg_style_t *)dk3sto_it_next(psvg->iStyles);
if(pst) {
- f2lsvgst_write_one_style(job, drw, psvg, pst);
+ f2lsvgst_write_one_style(job, psvg, pst);
}
} while(pst);
}
diff --git a/support/dktools/f2lsvgst.h b/support/dktools/f2lsvgst.h
index 86b1c17fb6..bef1a91168 100644
--- a/support/dktools/f2lsvgst.h
+++ b/support/dktools/f2lsvgst.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lsvgst.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lsvgst.ctr
*/
/** @file f2lsvgst.h Header file for the f2lsvgst module.
@@ -151,24 +129,6 @@ typedef struct {
extern "C" {
#endif
-/** Compare two fill pattern structures.
- @param l Left fill pattern structure.
- @param r Right fill pattern structure.
- @param cr Comparison criteria (ignored).
- @return Comparison result.
-*/
-int
-f2lsvgst_compare_pattern(void const *l, void const *r, int cr);
-
-/** Compare two object styles.
- @param l Left object.
- @param r Right object.
- @param cr Comparison criteria (ignored).
- @return Comparison result.
-*/
-int
-f2lsvgst_compare_object_styles(void const *l, void const *r, int cr);
-
/** Create new SVG structure.
@param app Application structure for diagnostics.
@return Pointer to new structure on success, NULL on error.
@@ -345,13 +305,11 @@ f2lsvgst_any_ps_font_used(f2l_svg_t *psvg);
/** Write all patterns used to the SVG output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
*/
void
f2lsvgst_write_patterns(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg
);
@@ -371,13 +329,11 @@ f2lsvgst_pattern_id(
/** Write styles to output file.
@param job Job structure.
- @param drw Drawing structure.
@param psvg SVG style collection.
*/
void
f2lsvgst_write_styles(
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
f2l_svg_t *psvg
);
@@ -409,34 +365,6 @@ f2lsvgst_write_style_for_object(
dk3_fig_obj_t *pobj
);
-/** Write pattern ID.
- @param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
- @param pat Pattern used for current object.
-*/
-void
-f2lsvgst_write_pattern_id(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
- f2l_svg_fill_pattern_t *pat
-);
-
-/** Write style ID.
- @param job Job structure.
- @param drw Drawing structure.
- @param psvg SVG style collection.
- @param pst Style used by current object.
-*/
-void
-f2lsvgst_write_style_id(
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- f2l_svg_t *psvg,
- f2l_svg_style_t *pst
-);
-
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/f2lto.c b/support/dktools/f2lto.c
index dac9ee1518..0c4ab6a649 100644
--- a/support/dktools/f2lto.c
+++ b/support/dktools/f2lto.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lto.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lto.ctr
*/
/** @file f2lto.c The f2lto module.
*/
-#line 262 "f2lto.ctr"
+#line 214 "f2lto.ctr"
#include "dk3all.h"
#include "dk3bezcu.h"
@@ -56,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 279 "f2lto.ctr"
+#line 231 "f2lto.ctr"
@@ -469,7 +447,7 @@ static char const * const f2lto_c8_kw[] = {
NULL
-#line 737 "f2lto.ctr"
+#line 689 "f2lto.ctr"
};
@@ -486,7 +464,7 @@ static char const * const f2l_tool_preamble_1[] = {
NULL
-#line 752 "f2lto.ctr"
+#line 704 "f2lto.ctr"
};
@@ -501,7 +479,7 @@ static char const * const f2l_tool_preamble_2[] = {
NULL
-#line 765 "f2lto.ctr"
+#line 717 "f2lto.ctr"
};
@@ -514,7 +492,7 @@ static char const * const f2l_tool_preamble_3[] = {
NULL
-#line 776 "f2lto.ctr"
+#line 728 "f2lto.ctr"
};
@@ -543,7 +521,7 @@ static char const * const f2l_tool_preamble_4[] = {
NULL
-#line 803 "f2lto.ctr"
+#line 755 "f2lto.ctr"
};
@@ -562,23 +540,23 @@ f2l_tool_register_font(
f2l_text_handling_t *back = NULL;
-#line 820 "f2lto.ctr"
+#line 772 "f2lto.ctr"
if((sFonts) && (iFonts) && (nFonts)) {
myth.fontSize = fontsize;
-#line 822 "f2lto.ctr"
+#line 774 "f2lto.ctr"
myth.fontNumber = 0UL;
myth.psFontNo = fontno;
-#line 824 "f2lto.ctr"
+#line 776 "f2lto.ctr"
back = (f2l_text_handling_t *)dk3sto_it_find_like(iFonts,(void *)(&myth),0);
if(!(back)) {
-#line 826 "f2lto.ctr"
+#line 778 "f2lto.ctr"
back = dk3_new_app(f2l_text_handling_t,1,app);
if(back) {
-#line 828 "f2lto.ctr"
+#line 780 "f2lto.ctr"
back->fontSize = fontsize;
back->fontNumber = *(nFonts);
back->psFontNo = fontno;
@@ -586,28 +564,28 @@ f2l_tool_register_font(
if(fontno > 34) { back->psFontNo = 34; }
if(dk3sto_add(sFonts, (void *)back)) {
-#line 834 "f2lto.ctr"
+#line 786 "f2lto.ctr"
*nFonts += 1UL;
if(0UL == *nFonts) {
back = NULL; /* Overflow */
}
} else {
-#line 839 "f2lto.ctr"
+#line 791 "f2lto.ctr"
dk3_delete(back);
back = NULL;
}
} else {
-#line 843 "f2lto.ctr"
+#line 795 "f2lto.ctr"
}
} else {
-#line 845 "f2lto.ctr"
+#line 797 "f2lto.ctr"
}
}
-#line 847 "f2lto.ctr"
+#line 799 "f2lto.ctr"
return back;
}
@@ -658,7 +636,6 @@ void
f2l_tool_start_tex_part_with_picture(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *shortOutFile,
dk3_sto_it_t *iFonts,
unsigned long nFonts,
@@ -713,14 +690,13 @@ void
f2l_tool_start_tex_part(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *shortOutFile,
dk3_sto_it_t *iFonts,
unsigned long nFonts
)
{
f2l_tool_start_tex_part_with_picture(
- of, job, drw, shortOutFile, iFonts, nFonts, 1
+ of, job, shortOutFile, iFonts, nFonts, 1
);
}
@@ -761,12 +737,18 @@ f2l_tool_write_font_size(
+/** Write instruction to select a font by features to LaTeX output.
+ @param of Output file.
+ @param job Job structure.
+ @param fontSize Font size.
+ @param fontFeatures Font features.
+ @param useFamily Flag: Choose font family.
+*/
+static
void
f2l_tool_font_select_by_features(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
double fontSize,
int fontFeatures,
int useFamily
@@ -823,11 +805,18 @@ f2l_tool_font_select_by_features(
+/** Write commands to choose a font.
+ @param of Output file.
+ @param job Job structure.
+ @param drw Drawing structure.
+ @param obj Text object.
+ @param nFonts Total number of PS fonts.
+*/
+static
void
f2l_tool_font_selection(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
unsigned long nFonts
)
@@ -858,7 +847,7 @@ f2l_tool_font_selection(
*/
fontFeatures = dk3font_get_features((obj->dt).txt.fo);
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} else {
/*
@@ -867,41 +856,41 @@ f2l_tool_font_selection(
switch((obj->dt).txt.fo) {
case 0: {
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 0
+ of, job, (obj->dt).txt.fs, fontFeatures, 0
);
} break;
case 1: {
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
case 2: {
fontFeatures |= DK3_FONT_BOLD;
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
case 3: {
fontFeatures |= DK3_FONT_ITALIC;
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
case 4: {
fontFeatures = DK3_FONT_SANS_SERIF;
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
case 5: {
fontFeatures = DK3_FONT_TYPEWRITER;
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
default: {
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
}
@@ -961,7 +950,7 @@ f2lto_utf8_out(char const *txt, FILE *fipo)
c = *(cptr++);
c32 = (dk3_c32_t)c;
c32 &= 0x000000FFUL;
- if(c32 < 128UL) {
+ if(dk3enc_dk_to_ul(c32) < 128UL) {
fputc(c, fipo);
} else {
sz = dk3enc_uc2utf8(c32, buf, sizeof(buf));
@@ -999,7 +988,7 @@ f2l_tool_inner_text_object(
}
fputs(f2lto_c8_kw[38], of);
/* font selection */
- f2l_tool_font_selection(of, job, drw, obj, nFonts);
+ f2l_tool_font_selection(of, job, obj, nFonts);
fputs(f2lto_c8_kw[25], of);
/* red */
dk3ma_print_double_c8_no_sci(of, rgb.r);
@@ -1106,10 +1095,10 @@ f2l_tool_image_delete(f2l_image_t *im)
{
-#line 1344 "f2lto.ctr"
+#line 1307 "f2lto.ctr"
if(im) {
-#line 1345 "f2lto.ctr"
+#line 1308 "f2lto.ctr"
dk3_release(im->filename);
im->xo = NULL;
im->width = 0UL;
@@ -1121,7 +1110,7 @@ f2l_tool_image_delete(f2l_image_t *im)
dk3_delete(im);
}
-#line 1355 "f2lto.ctr"
+#line 1318 "f2lto.ctr"
}
@@ -1133,7 +1122,7 @@ f2l_tool_image_new(char const *filename, dk3_app_t *app, unsigned long li)
f2l_image_t *back = NULL;
-#line 1365 "f2lto.ctr"
+#line 1328 "f2lto.ctr"
if((filename) && (app)) {
if(dk3ufi_c8_get(&ufi, filename)) {
back = dk3_new_app(f2l_image_t,1,app);
@@ -1155,7 +1144,7 @@ f2l_tool_image_new(char const *filename, dk3_app_t *app, unsigned long li)
}
}
-#line 1385 "f2lto.ctr"
+#line 1348 "f2lto.ctr"
return back;
}
@@ -1224,8 +1213,6 @@ f2l_tool_add_text_section_to_file(FILE *of, char const * const *txt)
/** Write preamble part to output file, either the contents of a
file (if found) or a default text.
@param of Output file.
- @param job Job structure.
- @param drw Drawing structure.
@param fileName Name of file containing the preamble part.
@param preamble Default preamble text if fileName is not found.
*/
@@ -1233,8 +1220,6 @@ static
void
fl2_tool_write_preamble_part_or_file(
FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *fileName,
char const * const *preamble
)
@@ -1244,38 +1229,38 @@ fl2_tool_write_preamble_part_or_file(
int done = 0; /* Flag: Successfully handled file. */
-#line 1472 "f2lto.ctr"
+#line 1431 "f2lto.ctr"
fipo = fopen(fileName, f2lto_c8_kw[46]);
if(fipo) {
-#line 1474 "f2lto.ctr"
+#line 1433 "f2lto.ctr"
done = 1;
while(fgets(line, sizeof(line), fipo)) {
-#line 1476 "f2lto.ctr"
+#line 1435 "f2lto.ctr"
dk3str_c8_chomp(line, NULL);
-#line 1477 "f2lto.ctr"
+#line 1436 "f2lto.ctr"
fputs(line, of);
-#line 1478 "f2lto.ctr"
+#line 1437 "f2lto.ctr"
fputc('\n', of);
-#line 1479 "f2lto.ctr"
+#line 1438 "f2lto.ctr"
}
fclose(fipo);
} else {
-#line 1482 "f2lto.ctr"
+#line 1441 "f2lto.ctr"
}
if(!(done)) {
-#line 1484 "f2lto.ctr"
+#line 1443 "f2lto.ctr"
f2l_tool_add_text_section_to_file(of, preamble);
}
-#line 1487 "f2lto.ctr"
+#line 1446 "f2lto.ctr"
}
@@ -1283,8 +1268,7 @@ fl2_tool_write_preamble_part_or_file(
void
f2l_tool_begin_latex_document(
FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw
+ f2l_job_t *job
)
{
fprintf(of, f2lto_c8_kw[40], job->tts);
@@ -1292,14 +1276,14 @@ f2l_tool_begin_latex_document(
f2l_tool_add_text_section_to_file(of, f2l_tool_preamble_1);
#else
fl2_tool_write_preamble_part_or_file(
- of, job, drw, f2lto_c8_kw[44], f2l_tool_preamble_1
+ of, f2lto_c8_kw[44], f2l_tool_preamble_1
);
#endif
#if 0
f2l_tool_add_text_section_to_file(of, f2l_tool_preamble_2);
#else
fl2_tool_write_preamble_part_or_file(
- of, job, drw, f2lto_c8_kw[45], f2l_tool_preamble_2
+ of, f2lto_c8_kw[45], f2l_tool_preamble_2
);
#endif
f2l_tool_add_text_section_to_file(of, f2l_tool_preamble_3);
@@ -1318,9 +1302,7 @@ f2l_tool_begin_latex_document(
void
f2l_tool_end_latex_document(
- FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw
+ FILE *of
)
{
fputs(f2lto_c8_kw[39], of);
@@ -1330,7 +1312,6 @@ f2l_tool_end_latex_document(
int
f2lto_find_draw_direction(
- f2l_job_t *job,
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
int *ec
@@ -1341,15 +1322,15 @@ f2lto_find_draw_direction(
int back = 0;
-#line 1551 "f2lto.ctr"
+#line 1506 "f2lto.ctr"
if(DK3_FIG_SRCTYPE_JFIG != drw->srctype) {
-#line 1552 "f2lto.ctr"
+#line 1507 "f2lto.ctr"
po = (obj->dt).pol.po;
np = (obj->dt).pol.np;
if(4 <= np) {
-#line 1555 "f2lto.ctr"
+#line 1510 "f2lto.ctr"
if(po[1].x > (dk3ma_d_add_ok(po[0].x, 0.5, ec))) {
/* 0 on the left, 1 on the right */
if(po[3].y > (dk3ma_d_add_ok(po[0].y, 0.5, ec))) {
@@ -1386,22 +1367,22 @@ f2lto_find_draw_direction(
}
if((obj->dt).pol.flf) {
-#line 1590 "f2lto.ctr"
+#line 1545 "f2lto.ctr"
back += 4;
} else {
-#line 1592 "f2lto.ctr"
+#line 1547 "f2lto.ctr"
}
} else {
-#line 1594 "f2lto.ctr"
+#line 1549 "f2lto.ctr"
}
} else {
-#line 1596 "f2lto.ctr"
+#line 1551 "f2lto.ctr"
}
-#line 1597 "f2lto.ctr"
+#line 1552 "f2lto.ctr"
return back;
}
diff --git a/support/dktools/f2lto.ctr b/support/dktools/f2lto.ctr
index 7cfcf35eb9..212ef8dd21 100644
--- a/support/dktools/f2lto.ctr
+++ b/support/dktools/f2lto.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -34,7 +34,6 @@ f2l_tool_register_font(
/** Start LaTeX part of EPS+TEX or PDF+TEX.
@param of Output file.
@param job Job structure.
- @param drw Drawing structure.
@param shortOutFile Short output file name of EPS or PDF file.
@param iFonts Font storage iterator.
@param nFonts Total number of fonts.
@@ -43,7 +42,6 @@ void
f2l_tool_start_tex_part(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *shortOutFile,
dk3_sto_it_t *iFonts,
unsigned long nFonts
@@ -52,7 +50,6 @@ f2l_tool_start_tex_part(
/** Start LaTeX part of EPS+TEX, PDF+TEX or PGF.
@param of Output file.
@param job Job structure.
- @param drw Drawing structure.
@param shortOutFile Short output file name of EPS or PDF file.
@param iFonts Font storage iterator.
@param nFonts Total number of fonts.
@@ -62,7 +59,6 @@ void
f2l_tool_start_tex_part_with_picture(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *shortOutFile,
dk3_sto_it_t *iFonts,
unsigned long nFonts,
@@ -127,22 +123,6 @@ f2l_tool_text_object(
unsigned long nFonts
);
-/** Write commands to choose a font.
- @param of Output file.
- @param job Job structure.
- @param drw Drawing structure.
- @param obj Text object.
- @param nFonts Total number of PS fonts.
-*/
-void
-f2l_tool_font_selection(
- FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long nFonts
-);
-
/** Write string to LaTeX output.
@param of Output file.
@param txt String, ISO-LATIN-1 encoded.
@@ -153,26 +133,6 @@ f2l_tool_tex_string(
char const *txt
);
-/** Write instruction to select a font by features to LaTeX output.
- @param of Output file.
- @param job Job structure.
- @param drw Drawing structure.
- @param obj Text object.
- @param fontSize Font size.
- @param fontFeatures Font features.
- @param useFamily Flag: Choose font family.
-*/
-void
-f2l_tool_font_select_by_features(
- FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- double fontSize,
- int fontFeatures,
- int useFamily
-);
-
/** Create image file data.
@param filename File name.
@param app Application structure for diagnostics.
@@ -207,29 +167,22 @@ f2l_tool_set_exit_status(f2l_job_t *job, int exval);
/** Begin LaTeX document (write document preamble and begin document line).
@param of Output file.
@param job Job structure.
- @param drw Drawing structure.
*/
void
f2l_tool_begin_latex_document(
FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw
+ f2l_job_t *job
);
/** End LaTeX document (write end document line).
@param of Output file.
- @param job Job structure.
- @param drw Drawing structure.
*/
void
f2l_tool_end_latex_document(
- FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw
+ FILE *of
);
/** Find drawing direction for embedded image.
- @param job Job structure.
@param drw Drawing structure.
@param obj Current object to process.
@param ec Pointer to error code variable, may be NULL.
@@ -237,7 +190,6 @@ f2l_tool_end_latex_document(
*/
int
f2lto_find_draw_direction(
- f2l_job_t *job,
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
int *ec
@@ -894,7 +846,6 @@ void
f2l_tool_start_tex_part_with_picture(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *shortOutFile,
dk3_sto_it_t *iFonts,
unsigned long nFonts,
@@ -949,14 +900,13 @@ void
f2l_tool_start_tex_part(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *shortOutFile,
dk3_sto_it_t *iFonts,
unsigned long nFonts
)
{
f2l_tool_start_tex_part_with_picture(
- of, job, drw, shortOutFile, iFonts, nFonts, 1
+ of, job, shortOutFile, iFonts, nFonts, 1
);
}
@@ -997,12 +947,18 @@ f2l_tool_write_font_size(
+/** Write instruction to select a font by features to LaTeX output.
+ @param of Output file.
+ @param job Job structure.
+ @param fontSize Font size.
+ @param fontFeatures Font features.
+ @param useFamily Flag: Choose font family.
+*/
+static
void
f2l_tool_font_select_by_features(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
double fontSize,
int fontFeatures,
int useFamily
@@ -1059,11 +1015,18 @@ f2l_tool_font_select_by_features(
+/** Write commands to choose a font.
+ @param of Output file.
+ @param job Job structure.
+ @param drw Drawing structure.
+ @param obj Text object.
+ @param nFonts Total number of PS fonts.
+*/
+static
void
f2l_tool_font_selection(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
unsigned long nFonts
)
@@ -1094,7 +1057,7 @@ f2l_tool_font_selection(
*/
fontFeatures = dk3font_get_features((obj->dt).txt.fo);
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} else {
/*
@@ -1103,41 +1066,41 @@ f2l_tool_font_selection(
switch((obj->dt).txt.fo) {
case 0: {
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 0
+ of, job, (obj->dt).txt.fs, fontFeatures, 0
);
} break;
case 1: {
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
case 2: {
fontFeatures |= DK3_FONT_BOLD;
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
case 3: {
fontFeatures |= DK3_FONT_ITALIC;
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
case 4: {
fontFeatures = DK3_FONT_SANS_SERIF;
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
case 5: {
fontFeatures = DK3_FONT_TYPEWRITER;
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
default: {
f2l_tool_font_select_by_features(
- of, job, drw, obj, (obj->dt).txt.fs, fontFeatures, 1
+ of, job, (obj->dt).txt.fs, fontFeatures, 1
);
} break;
}
@@ -1197,7 +1160,7 @@ f2lto_utf8_out(char const *txt, FILE *fipo)
c = *(cptr++);
c32 = (dk3_c32_t)c;
c32 &= 0x000000FFUL;
- if(c32 < 128UL) {
+ if(dk3enc_dk_to_ul(c32) < 128UL) {
fputc(c, fipo);
} else {
sz = dk3enc_uc2utf8(c32, buf, sizeof(buf));
@@ -1235,7 +1198,7 @@ f2l_tool_inner_text_object(
}
fputs(f2lto_c8_kw[38], of);
/* font selection */
- f2l_tool_font_selection(of, job, drw, obj, nFonts);
+ f2l_tool_font_selection(of, job, obj, nFonts);
fputs(f2lto_c8_kw[25], of);
/* red */
dk3ma_print_double_c8_no_sci(of, rgb.r);
@@ -1450,8 +1413,6 @@ f2l_tool_add_text_section_to_file(FILE *of, char const * const *txt)
/** Write preamble part to output file, either the contents of a
file (if found) or a default text.
@param of Output file.
- @param job Job structure.
- @param drw Drawing structure.
@param fileName Name of file containing the preamble part.
@param preamble Default preamble text if fileName is not found.
*/
@@ -1459,8 +1420,6 @@ static
void
fl2_tool_write_preamble_part_or_file(
FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *fileName,
char const * const *preamble
)
@@ -1491,8 +1450,7 @@ fl2_tool_write_preamble_part_or_file(
void
f2l_tool_begin_latex_document(
FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw
+ f2l_job_t *job
)
{
fprintf(of, f2lto_c8_kw[40], job->tts);
@@ -1500,14 +1458,14 @@ f2l_tool_begin_latex_document(
f2l_tool_add_text_section_to_file(of, f2l_tool_preamble_1);
#else
fl2_tool_write_preamble_part_or_file(
- of, job, drw, f2lto_c8_kw[44], f2l_tool_preamble_1
+ of, f2lto_c8_kw[44], f2l_tool_preamble_1
);
#endif
#if 0
f2l_tool_add_text_section_to_file(of, f2l_tool_preamble_2);
#else
fl2_tool_write_preamble_part_or_file(
- of, job, drw, f2lto_c8_kw[45], f2l_tool_preamble_2
+ of, f2lto_c8_kw[45], f2l_tool_preamble_2
);
#endif
f2l_tool_add_text_section_to_file(of, f2l_tool_preamble_3);
@@ -1526,9 +1484,7 @@ f2l_tool_begin_latex_document(
void
f2l_tool_end_latex_document(
- FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw
+ FILE *of
)
{
fputs(f2lto_c8_kw[39], of);
@@ -1538,7 +1494,6 @@ f2l_tool_end_latex_document(
int
f2lto_find_draw_direction(
- f2l_job_t *job,
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
int *ec
diff --git a/support/dktools/f2lto.h b/support/dktools/f2lto.h
index b2d5b54a63..c219597a66 100644
--- a/support/dktools/f2lto.h
+++ b/support/dktools/f2lto.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lto.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lto.ctr
*/
/** @file f2lto.h Header file for the f2lto module.
@@ -70,7 +48,6 @@ f2l_tool_register_font(
/** Start LaTeX part of EPS+TEX or PDF+TEX.
@param of Output file.
@param job Job structure.
- @param drw Drawing structure.
@param shortOutFile Short output file name of EPS or PDF file.
@param iFonts Font storage iterator.
@param nFonts Total number of fonts.
@@ -79,7 +56,6 @@ void
f2l_tool_start_tex_part(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *shortOutFile,
dk3_sto_it_t *iFonts,
unsigned long nFonts
@@ -88,7 +64,6 @@ f2l_tool_start_tex_part(
/** Start LaTeX part of EPS+TEX, PDF+TEX or PGF.
@param of Output file.
@param job Job structure.
- @param drw Drawing structure.
@param shortOutFile Short output file name of EPS or PDF file.
@param iFonts Font storage iterator.
@param nFonts Total number of fonts.
@@ -98,7 +73,6 @@ void
f2l_tool_start_tex_part_with_picture(
FILE *of,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
char const *shortOutFile,
dk3_sto_it_t *iFonts,
unsigned long nFonts,
@@ -163,22 +137,6 @@ f2l_tool_text_object(
unsigned long nFonts
);
-/** Write commands to choose a font.
- @param of Output file.
- @param job Job structure.
- @param drw Drawing structure.
- @param obj Text object.
- @param nFonts Total number of PS fonts.
-*/
-void
-f2l_tool_font_selection(
- FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- unsigned long nFonts
-);
-
/** Write string to LaTeX output.
@param of Output file.
@param txt String, ISO-LATIN-1 encoded.
@@ -189,26 +147,6 @@ f2l_tool_tex_string(
char const *txt
);
-/** Write instruction to select a font by features to LaTeX output.
- @param of Output file.
- @param job Job structure.
- @param drw Drawing structure.
- @param obj Text object.
- @param fontSize Font size.
- @param fontFeatures Font features.
- @param useFamily Flag: Choose font family.
-*/
-void
-f2l_tool_font_select_by_features(
- FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw,
- dk3_fig_obj_t *obj,
- double fontSize,
- int fontFeatures,
- int useFamily
-);
-
/** Create image file data.
@param filename File name.
@param app Application structure for diagnostics.
@@ -243,29 +181,22 @@ f2l_tool_set_exit_status(f2l_job_t *job, int exval);
/** Begin LaTeX document (write document preamble and begin document line).
@param of Output file.
@param job Job structure.
- @param drw Drawing structure.
*/
void
f2l_tool_begin_latex_document(
FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw
+ f2l_job_t *job
);
/** End LaTeX document (write end document line).
@param of Output file.
- @param job Job structure.
- @param drw Drawing structure.
*/
void
f2l_tool_end_latex_document(
- FILE *of,
- f2l_job_t *job,
- dk3_fig_drawing_t *drw
+ FILE *of
);
/** Find drawing direction for embedded image.
- @param job Job structure.
@param drw Drawing structure.
@param obj Current object to process.
@param ec Pointer to error code variable, may be NULL.
@@ -273,7 +204,6 @@ f2l_tool_end_latex_document(
*/
int
f2lto_find_draw_direction(
- f2l_job_t *job,
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
int *ec
diff --git a/support/dktools/f2lud.c b/support/dktools/f2lud.c
index c01721f5fd..69b1ebf0a8 100644
--- a/support/dktools/f2lud.c
+++ b/support/dktools/f2lud.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lud.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lud.ctr
*/
/** @file f2lud.c The f2lud module.
@@ -55,12 +33,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4vers.h"
#include "f2ludpat.h"
#include "f2lpara.h"
+#include "dk3unused.h"
-#line 224 "f2lud.ctr"
+#line 225 "f2lud.ctr"
@@ -94,7 +73,7 @@ static char const * const f2lud_c8_kw[] = {
NULL
-#line 264 "f2lud.ctr"
+#line 265 "f2lud.ctr"
};
@@ -156,7 +135,7 @@ f2lud_coordinates_transformation(f2l_job_t *job, dk3_fig_drawing_t *drw)
int back = 1;
-#line 324 "f2lud.ctr"
+#line 325 "f2lud.ctr"
(job->ct2d).mx = dk3ma_d_div_ok( 72.0, drw->res, &mec);
(job->ct2d).my = dk3ma_d_div_ok(-72.0, drw->res, &mec);
xmin = dk3ma_d_mul_ok((job->ct2d).mx, (drw->bb).xmin, &mec);
@@ -175,20 +154,20 @@ f2lud_coordinates_transformation(f2l_job_t *job, dk3_fig_drawing_t *drw)
(job->ct2d).ny = dk3ma_d_sub_ok((job->ct2d).ny, ymin, &mec);
-#line 341 "f2lud.ctr"
+#line 342 "f2lud.ctr"
-#line 342 "f2lud.ctr"
+#line 343 "f2lud.ctr"
if(mec) {
back = 0;
/* ERROR: Math problem */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 347 "f2lud.ctr"
+#line 348 "f2lud.ctr"
}
-#line 348 "f2lud.ctr"
+#line 349 "f2lud.ctr"
return back;
}
@@ -206,7 +185,7 @@ f2lud_driver_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
int back;
-#line 364 "f2lud.ctr"
+#line 365 "f2lud.ctr"
back = f2lud_coordinates_transformation(job, drw);
if(back) {
switch(job->dr) {
@@ -232,7 +211,7 @@ f2lud_driver_initialize(f2l_job_t *job, dk3_fig_drawing_t *drw)
}
}
-#line 388 "f2lud.ctr"
+#line 389 "f2lud.ctr"
return back;
}
@@ -248,7 +227,7 @@ f2lud_driver_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
-#line 402 "f2lud.ctr"
+#line 403 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_end(job, drw);
@@ -272,7 +251,7 @@ f2lud_driver_end(f2l_job_t *job, dk3_fig_drawing_t *drw)
}
-#line 424 "f2lud.ctr"
+#line 425 "f2lud.ctr"
}
@@ -288,7 +267,7 @@ f2lud_open_output_files(f2l_job_t *job)
int back = 0;
-#line 438 "f2lud.ctr"
+#line 439 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
back = f2lpgf_tex_open_output_files(job);
@@ -311,7 +290,7 @@ f2lud_open_output_files(f2l_job_t *job)
} break;
}
-#line 459 "f2lud.ctr"
+#line 460 "f2lud.ctr"
return back;
}
@@ -326,7 +305,7 @@ f2lud_close_output_files(f2l_job_t *job)
{
-#line 472 "f2lud.ctr"
+#line 473 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_close_output_files(job);
@@ -349,7 +328,7 @@ f2lud_close_output_files(f2l_job_t *job)
} break;
}
-#line 493 "f2lud.ctr"
+#line 494 "f2lud.ctr"
}
@@ -366,7 +345,7 @@ f2lud_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
int back = 0;
-#line 508 "f2lud.ctr"
+#line 509 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
back = f2lpgf_tex_start_processing(job, drw);
@@ -389,7 +368,7 @@ f2lud_start_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
} break;
}
-#line 529 "f2lud.ctr"
+#line 530 "f2lud.ctr"
return back;
}
@@ -405,7 +384,7 @@ f2lud_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
{
-#line 543 "f2lud.ctr"
+#line 544 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_end_processing(job, drw);
@@ -428,7 +407,7 @@ f2lud_end_processing(f2l_job_t *job, dk3_fig_drawing_t *drw)
} break;
}
-#line 564 "f2lud.ctr"
+#line 565 "f2lud.ctr"
}
@@ -451,7 +430,7 @@ f2lud_text_object(
int ec = 0; /* Mathematical error code. */
-#line 585 "f2lud.ctr"
+#line 586 "f2lud.ctr"
if(!(DK3_FIG_FONT_FLAG_HIDDEN & ((obj->dt).txt.ff))) {
x = dk3ct_2d_x(&(job->ct2d), (obj->dt).txt.x, &ec);
y = dk3ct_2d_y(&(job->ct2d), (obj->dt).txt.y, &ec);
@@ -482,11 +461,11 @@ f2lud_text_object(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 614 "f2lud.ctr"
+#line 615 "f2lud.ctr"
}
-#line 616 "f2lud.ctr"
+#line 617 "f2lud.ctr"
}
@@ -503,7 +482,7 @@ void
f2lud_find_bounding_box(
dk3_bb_t *bb,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_fig_obj_t *obj,
int *ec
)
@@ -513,7 +492,8 @@ f2lud_find_bounding_box(
size_t i; /* Index of current point. */
-#line 641 "f2lud.ctr"
+#line 642 "f2lud.ctr"
+ DK3_UNUSED_ARG(drw)
po = (obj->dt).pol.po;
np = (obj->dt).pol.np;
dk3bb_reset(bb);
@@ -523,7 +503,7 @@ f2lud_find_bounding_box(
po++;
}
-#line 649 "f2lud.ctr"
+#line 651 "f2lud.ctr"
}
@@ -546,10 +526,10 @@ f2lud_image_object(
int drawdir = 0; /* Drawing direction for embedded image. */
-#line 670 "f2lud.ctr"
+#line 672 "f2lud.ctr"
dk3bb_reset(&outbb);
f2lud_find_bounding_box(&outbb, job, drw, obj, &ec);
- drawdir = f2lto_find_draw_direction(job, drw, obj, &ec);
+ drawdir = f2lto_find_draw_direction(drw, obj, &ec);
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_image_object(job, drw, obj, &outbb, drawdir, &ec);
@@ -576,10 +556,10 @@ f2lud_image_object(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 698 "f2lud.ctr"
+#line 700 "f2lud.ctr"
}
-#line 699 "f2lud.ctr"
+#line 701 "f2lud.ctr"
}
@@ -593,7 +573,7 @@ f2lud_newpath(
{
-#line 711 "f2lud.ctr"
+#line 713 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_newpath(job, drw, obj);
@@ -616,7 +596,7 @@ f2lud_newpath(
} break;
}
-#line 732 "f2lud.ctr"
+#line 734 "f2lud.ctr"
}
@@ -632,7 +612,7 @@ f2lud_moveto(
{
-#line 746 "f2lud.ctr"
+#line 748 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_moveto(job, drw, obj, x, y);
@@ -655,7 +635,7 @@ f2lud_moveto(
} break;
}
-#line 767 "f2lud.ctr"
+#line 769 "f2lud.ctr"
}
@@ -671,7 +651,7 @@ f2lud_lineto(
{
-#line 781 "f2lud.ctr"
+#line 783 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_lineto(job, drw, obj, x, y);
@@ -694,7 +674,7 @@ f2lud_lineto(
} break;
}
-#line 802 "f2lud.ctr"
+#line 804 "f2lud.ctr"
}
@@ -714,7 +694,7 @@ f2lud_curveto(
{
-#line 820 "f2lud.ctr"
+#line 822 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_curveto(job, drw, obj, xcs, ycs, xce, yce, xe, ye);
@@ -737,7 +717,7 @@ f2lud_curveto(
} break;
}
-#line 841 "f2lud.ctr"
+#line 843 "f2lud.ctr"
}
@@ -756,13 +736,13 @@ f2lud_fig_moveto(
double ny; /* Destination y in output space. */
-#line 858 "f2lud.ctr"
+#line 860 "f2lud.ctr"
nx = dk3ct_2d_x(&(job->ct2d), x, ec);
ny = dk3ct_2d_y(&(job->ct2d), y, ec);
f2lud_moveto(job, drw, obj, nx, ny);
-#line 862 "f2lud.ctr"
+#line 864 "f2lud.ctr"
}
@@ -781,13 +761,13 @@ f2lud_fig_lineto(
double ny; /* Destination y in output space. */
-#line 879 "f2lud.ctr"
+#line 881 "f2lud.ctr"
nx = dk3ct_2d_x(&(job->ct2d), x, ec);
ny = dk3ct_2d_y(&(job->ct2d), y, ec);
f2lud_lineto(job, drw, obj, nx, ny);
-#line 883 "f2lud.ctr"
+#line 885 "f2lud.ctr"
}
@@ -814,7 +794,7 @@ f2lud_fig_curveto(
double nye; /* End point y in output space. */
-#line 908 "f2lud.ctr"
+#line 910 "f2lud.ctr"
nxcs = dk3ct_2d_x(&(job->ct2d), xcs, ec);
nycs = dk3ct_2d_y(&(job->ct2d), ycs, ec);
nxce = dk3ct_2d_x(&(job->ct2d), xce, ec);
@@ -824,7 +804,7 @@ f2lud_fig_curveto(
f2lud_curveto(job, drw, obj, nxcs, nycs, nxce, nyce, nxe, nye);
-#line 916 "f2lud.ctr"
+#line 918 "f2lud.ctr"
}
@@ -838,7 +818,7 @@ f2lud_closepath(
{
-#line 928 "f2lud.ctr"
+#line 930 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_closepath(job, drw, obj);
@@ -861,7 +841,7 @@ f2lud_closepath(
} break;
}
-#line 949 "f2lud.ctr"
+#line 951 "f2lud.ctr"
}
@@ -880,7 +860,7 @@ f2lud_fill(
{
-#line 966 "f2lud.ctr"
+#line 968 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_fill(job, drw, obj);
@@ -903,7 +883,7 @@ f2lud_fill(
} break;
}
-#line 987 "f2lud.ctr"
+#line 989 "f2lud.ctr"
}
@@ -923,7 +903,7 @@ f2lud_fill_clip(
{
-#line 1005 "f2lud.ctr"
+#line 1007 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_fill_clip(job, drw, obj);
@@ -934,7 +914,7 @@ f2lud_fill_clip(
/* @DRIVER@ universal */
}
-#line 1014 "f2lud.ctr"
+#line 1016 "f2lud.ctr"
}
@@ -954,7 +934,7 @@ f2lud_fill_stroke_clip(
{
-#line 1032 "f2lud.ctr"
+#line 1034 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_fill_stroke_clip(job, drw, obj);
@@ -965,7 +945,7 @@ f2lud_fill_stroke_clip(
/* @DRIVER@ universal */
}
-#line 1041 "f2lud.ctr"
+#line 1043 "f2lud.ctr"
}
@@ -985,7 +965,7 @@ f2lud_fill_stroke(
{
-#line 1059 "f2lud.ctr"
+#line 1061 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_fill_stroke(job, drw, obj);
@@ -996,7 +976,7 @@ f2lud_fill_stroke(
/* @DRIVER@ universal */
}
-#line 1068 "f2lud.ctr"
+#line 1070 "f2lud.ctr"
}
@@ -1010,7 +990,7 @@ f2lud_stroke(
{
-#line 1080 "f2lud.ctr"
+#line 1082 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_stroke(job, drw, obj);
@@ -1033,7 +1013,7 @@ f2lud_stroke(
} break;
}
-#line 1101 "f2lud.ctr"
+#line 1103 "f2lud.ctr"
}
@@ -1053,7 +1033,7 @@ f2lud_clip(
{
-#line 1119 "f2lud.ctr"
+#line 1121 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_clip(job, drw, obj);
@@ -1076,7 +1056,7 @@ f2lud_clip(
} break;
}
-#line 1140 "f2lud.ctr"
+#line 1142 "f2lud.ctr"
}
@@ -1096,7 +1076,7 @@ f2lud_gsave(
{
-#line 1158 "f2lud.ctr"
+#line 1160 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_gsave(job, drw, obj);
@@ -1119,7 +1099,7 @@ f2lud_gsave(
} break;
}
-#line 1179 "f2lud.ctr"
+#line 1181 "f2lud.ctr"
}
@@ -1139,7 +1119,7 @@ f2lud_grestore(
{
-#line 1197 "f2lud.ctr"
+#line 1199 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_grestore(job, drw, obj);
@@ -1162,7 +1142,7 @@ f2lud_grestore(
} break;
}
-#line 1218 "f2lud.ctr"
+#line 1220 "f2lud.ctr"
}
@@ -1187,7 +1167,7 @@ f2lud_create_ellipse_path(
size_t i; /* Index of current point to modify. */
-#line 1241 "f2lud.ctr"
+#line 1243 "f2lud.ctr"
po[0].x = (obj->dt).ell.rx;
po[0].y = 0.0;
po[1].x = (obj->dt).ell.rx;
@@ -1251,7 +1231,7 @@ f2lud_create_ellipse_path(
);
-#line 1303 "f2lud.ctr"
+#line 1305 "f2lud.ctr"
}
@@ -1276,7 +1256,7 @@ f2lud_create_polygon_path(
size_t i; /* Index of current point. */
-#line 1326 "f2lud.ctr"
+#line 1328 "f2lud.ctr"
po = (obj->dt).pol.po;
np = (obj->dt).pol.np;
for(i = 0; i < np; i++) {
@@ -1292,7 +1272,7 @@ f2lud_create_polygon_path(
f2lud_fig_lineto(job, drw, obj, po->x, po->y, ec);
}
-#line 1340 "f2lud.ctr"
+#line 1342 "f2lud.ctr"
}
@@ -1315,7 +1295,7 @@ f2lud_create_box_path(
dk3_bb_t outbb; /* Box coordinates in output space. */
-#line 1361 "f2lud.ctr"
+#line 1363 "f2lud.ctr"
dk3bb_reset(&outbb);
f2lud_find_bounding_box(&outbb, job, drw, obj, ec);
f2lud_moveto(job, drw, obj, outbb.xmin, outbb.ymin);
@@ -1325,7 +1305,7 @@ f2lud_create_box_path(
f2lud_lineto(job, drw, obj, outbb.xmin, outbb.ymin);
-#line 1369 "f2lud.ctr"
+#line 1371 "f2lud.ctr"
}
@@ -1353,17 +1333,17 @@ f2lud_create_arc_box_path(
double rc; /* Dist of control to end in output space. */
-#line 1395 "f2lud.ctr"
+#line 1397 "f2lud.ctr"
dk3bb_reset(&outbb);
f2lud_find_bounding_box(&outbb, job, drw, obj, ec);
#if VERSION_BEFORE_20140808
r = dk3ct_2d_r(&(job->ct2d), (obj->dt).pol.ra, ec);
-#line 1399 "f2lud.ctr"
+#line 1401 "f2lud.ctr"
#else
r = 0.9 * (obj->dt).pol.ra;
-#line 1401 "f2lud.ctr"
+#line 1403 "f2lud.ctr"
#endif
maxr = 0.49 * fabs(dk3ma_d_sub_ok(outbb.xmax, outbb.xmin, ec));
if(r > maxr) r = maxr;
@@ -1434,7 +1414,7 @@ f2lud_create_arc_box_path(
);
-#line 1470 "f2lud.ctr"
+#line 1472 "f2lud.ctr"
}
@@ -1463,7 +1443,7 @@ f2lud_final_spline_segment(
size_t i,
double te,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -1490,17 +1470,18 @@ f2lud_final_spline_segment(
int res; /* Calculation result. */
-#line 1524 "f2lud.ctr"
+#line 1526 "f2lud.ctr"
+ DK3_UNUSED_ARG(iscl)
myte = dk3ma_d_sub_ok(te, floor(te), ec);
-#line 1525 "f2lud.ctr"
+#line 1528 "f2lud.ctr"
dnumsegs = myte * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs);
-#line 1527 "f2lud.ctr"
+#line 1530 "f2lud.ctr"
nsegs = dk3ma_d_to_sz_ok(dnumsegs, ec);
-#line 1528 "f2lud.ctr"
+#line 1531 "f2lud.ctr"
pb = &(sp[i]);
pc = &(sp[i + 1]);
if(0 < i) {
@@ -1511,7 +1492,7 @@ f2lud_final_spline_segment(
}
factor = myte / (double)nsegs;
-#line 1537 "f2lud.ctr"
+#line 1540 "f2lud.ctr"
dk3xsp_reset(&seg);
if(job->cosp) { dk3xsp_set_cb(&seg, 1); }
dk3xsp_set(&seg, pa, pb, pc, pd);
@@ -1532,20 +1513,20 @@ f2lud_final_spline_segment(
*/
if(1.0e-6 < myte) {
-#line 1556 "f2lud.ctr"
+#line 1559 "f2lud.ctr"
for(iseg = 0; iseg < nsegs; iseg++) {
if(iseg < (nsegs - 1)) {
-#line 1558 "f2lud.ctr"
+#line 1561 "f2lud.ctr"
t = (double)(iseg + 1) / (double)nsegs;
t = t * myte;
} else {
-#line 1561 "f2lud.ctr"
+#line 1564 "f2lud.ctr"
t = myte;
}
-#line 1563 "f2lud.ctr"
+#line 1566 "f2lud.ctr"
res = dk3xsp_calculate(&seg, t, 1);
if(!(res)) {
if(ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
@@ -1569,7 +1550,7 @@ f2lud_final_spline_segment(
}
} else {
-#line 1585 "f2lud.ctr"
+#line 1588 "f2lud.ctr"
res = dk3xsp_calculate(&seg, myte, 0);
if(!(res)) {
if(ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
@@ -1577,7 +1558,7 @@ f2lud_final_spline_segment(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1591 "f2lud.ctr"
+#line 1594 "f2lud.ctr"
}
x = dk3xsp_get_x(&seg);
y = dk3xsp_get_y(&seg);
@@ -1587,11 +1568,11 @@ f2lud_final_spline_segment(
if(ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1599 "f2lud.ctr"
+#line 1602 "f2lud.ctr"
}
-#line 1601 "f2lud.ctr"
+#line 1604 "f2lud.ctr"
}
@@ -1620,7 +1601,7 @@ f2lud_first_spline_segment(
size_t i,
double ts,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -1647,17 +1628,18 @@ f2lud_first_spline_segment(
int res; /* Calculation result. */
-#line 1655 "f2lud.ctr"
+#line 1658 "f2lud.ctr"
+ DK3_UNUSED_ARG(iscl)
myts = dk3ma_d_sub_ok(ts, floor(ts), ec);
-#line 1656 "f2lud.ctr"
+#line 1660 "f2lud.ctr"
dnumsegs = (1.0 - myts) * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs);
-#line 1658 "f2lud.ctr"
+#line 1662 "f2lud.ctr"
nsegs = dk3ma_d_to_sz_ok(dnumsegs, ec);
-#line 1659 "f2lud.ctr"
+#line 1663 "f2lud.ctr"
pb = &(sp[i]);
pc = &(sp[i + 1]);
if(0 < i) {
@@ -1668,7 +1650,7 @@ f2lud_first_spline_segment(
}
factor = (1.0 - myts) / (double)nsegs;
-#line 1668 "f2lud.ctr"
+#line 1672 "f2lud.ctr"
dk3xsp_reset(&seg);
if(job->cosp) { dk3xsp_set_cb(&seg, 1); }
dk3xsp_set(&seg, pa, pb, pc, pd);
@@ -1720,7 +1702,7 @@ f2lud_first_spline_segment(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1718 "f2lud.ctr"
+#line 1722 "f2lud.ctr"
}
x = dk3xsp_get_x(&seg);
y = dk3xsp_get_y(&seg);
@@ -1730,11 +1712,11 @@ f2lud_first_spline_segment(
if(ec) { *ec = DK3_ERROR_MATH_OVERFLOW; }
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1726 "f2lud.ctr"
+#line 1730 "f2lud.ctr"
}
-#line 1728 "f2lud.ctr"
+#line 1732 "f2lud.ctr"
}
@@ -1767,7 +1749,7 @@ f2lud_single_spline_segment(
double ts,
double te,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -1795,13 +1777,14 @@ f2lud_single_spline_segment(
int res; /* Calculation result. */
-#line 1787 "f2lud.ctr"
+#line 1791 "f2lud.ctr"
+ DK3_UNUSED_ARG(iscl)
myte = dk3ma_d_sub_ok(te, floor(te), ec);
myts = dk3ma_d_sub_ok(ts, floor(ts), ec);
dnumsegs = (myte - myts) * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs);
-#line 1791 "f2lud.ctr"
+#line 1796 "f2lud.ctr"
nsegs = dk3ma_d_to_sz_ok(dnumsegs, ec);
pb = &(sp[i]);
pc = &(sp[i + 1]);
@@ -1861,7 +1844,7 @@ f2lud_single_spline_segment(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1849 "f2lud.ctr"
+#line 1854 "f2lud.ctr"
}
x = dk3xsp_get_x(&seg);
y = dk3xsp_get_y(&seg);
@@ -1873,11 +1856,11 @@ f2lud_single_spline_segment(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 1859 "f2lud.ctr"
+#line 1864 "f2lud.ctr"
}
-#line 1861 "f2lud.ctr"
+#line 1866 "f2lud.ctr"
}
@@ -1932,7 +1915,7 @@ f2lud_full_spline_segment(
int res; /* Calculation result. */
-#line 1914 "f2lud.ctr"
+#line 1919 "f2lud.ctr"
if(i < ((iscl) ? np : (np - 1))) {
pb = &(sp[i]);
ic = i + 1; while(ic >= np) { ic = ic - np; }
@@ -2002,7 +1985,7 @@ f2lud_full_spline_segment(
/* ERROR: BUG: Wrong i */
}
-#line 1982 "f2lud.ctr"
+#line 1987 "f2lud.ctr"
}
@@ -2031,13 +2014,13 @@ f2lud_create_open_spline_path(
size_t max; /* Maximum t value. */
-#line 2009 "f2lud.ctr"
+#line 2014 "f2lud.ctr"
sp = (obj->dt).spl.po;
np = (obj->dt).spl.np;
if(job->coah) {
-#line 2013 "f2lud.ctr"
+#line 2018 "f2lud.ctr"
for(i = 0; i < (np - 1); i++) {
f2lud_full_spline_segment(
job, drw, obj, sp, np, i, ((0 == i) ? 1 : 0), 0, primary, ec
@@ -2045,10 +2028,10 @@ f2lud_create_open_spline_path(
}
} else {
-#line 2019 "f2lud.ctr"
+#line 2024 "f2lud.ctr"
if(obj->ab) {
-#line 2020 "f2lud.ctr"
+#line 2025 "f2lud.ctr"
/* 2013-11-23
ROUNDING DOWNWARDS INTENDED.
We want to find the start segment.
@@ -2056,10 +2039,10 @@ f2lud_create_open_spline_path(
min = dk3ma_d_to_sz_ok(floor((obj->dt).spl.ts), ec);
if(obj->af) {
-#line 2026 "f2lud.ctr"
+#line 2031 "f2lud.ctr"
if((obj->dt).spl.te >= (obj->dt).spl.ts) {
-#line 2027 "f2lud.ctr"
+#line 2032 "f2lud.ctr"
/* 2013-11-23
ROUNDING DOWNWARDS INTENDED.
We want to find the last full segment to draw.
@@ -2067,7 +2050,7 @@ f2lud_create_open_spline_path(
max = dk3ma_d_to_sz_ok(floor((obj->dt).spl.te), ec);
if(max > min) {
-#line 2033 "f2lud.ctr"
+#line 2038 "f2lud.ctr"
f2lud_first_spline_segment(
job, drw, obj, sp, np, min, (obj->dt).spl.ts, 1, 0, primary, ec
);
@@ -2091,7 +2074,7 @@ f2lud_create_open_spline_path(
);
} else {
-#line 2055 "f2lud.ctr"
+#line 2060 "f2lud.ctr"
f2lud_single_spline_segment(
job, drw, obj, sp, np, min, (obj->dt).spl.ts, (obj->dt).spl.te,
1, 0, primary, ec
@@ -2099,16 +2082,16 @@ f2lud_create_open_spline_path(
}
} else {
-#line 2061 "f2lud.ctr"
+#line 2066 "f2lud.ctr"
/* ERROR: Arrowheads too long for spline! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 37);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYNTAX);
-#line 2064 "f2lud.ctr"
+#line 2069 "f2lud.ctr"
}
} else {
-#line 2066 "f2lud.ctr"
+#line 2071 "f2lud.ctr"
f2lud_first_spline_segment(
job, drw, obj, sp, np, min, (obj->dt).spl.ts, 1, 0, primary, ec
);
@@ -2120,10 +2103,10 @@ f2lud_create_open_spline_path(
}
} else {
-#line 2076 "f2lud.ctr"
+#line 2081 "f2lud.ctr"
if(obj->af) {
-#line 2077 "f2lud.ctr"
+#line 2082 "f2lud.ctr"
/* 2013-11-23
ROUNDING DOWNWARDS INTENDED.
We want to find the last full segment.
@@ -2131,10 +2114,10 @@ f2lud_create_open_spline_path(
max = dk3ma_d_to_sz_ok(floor((obj->dt).spl.te), ec);
if(max < (np - 1)) {
-#line 2083 "f2lud.ctr"
+#line 2088 "f2lud.ctr"
if(max > 0) {
-#line 2084 "f2lud.ctr"
+#line 2089 "f2lud.ctr"
for(i = 0; i < max; i++) {
f2lud_full_spline_segment(
job, drw, obj, sp, np, i, ((0 == i) ? 1 : 0), 0, primary, ec
@@ -2145,23 +2128,23 @@ f2lud_create_open_spline_path(
);
} else {
-#line 2093 "f2lud.ctr"
+#line 2098 "f2lud.ctr"
f2lud_final_spline_segment(
job, drw, obj, sp, np, max, (obj->dt).spl.te, 1, 0, primary, ec
);
}
} else {
-#line 2098 "f2lud.ctr"
+#line 2103 "f2lud.ctr"
/* ERROR: Illegal max value! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 2101 "f2lud.ctr"
+#line 2106 "f2lud.ctr"
}
} else {
-#line 2103 "f2lud.ctr"
+#line 2108 "f2lud.ctr"
for(i = 0; i < (np - 1); i++) {
f2lud_full_spline_segment(
job, drw, obj, sp, np, i, ((0 == i) ? 1 : 0), 0, primary, ec
@@ -2172,7 +2155,7 @@ f2lud_create_open_spline_path(
}
-#line 2112 "f2lud.ctr"
+#line 2117 "f2lud.ctr"
}
@@ -2190,7 +2173,7 @@ f2lud_create_open_fast_spline_path(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- int primary,
+ int DK3_SILENCE_ARG_UNUSED(primary),
int *ec
)
{
@@ -2204,7 +2187,8 @@ f2lud_create_open_fast_spline_path(
double dydtc;
-#line 2142 "f2lud.ctr"
+#line 2147 "f2lud.ctr"
+ DK3_UNUSED_ARG(primary)
po = (obj->dt).spl.po;
np = (obj->dt).spl.np;
if (np > 1) {
@@ -2253,7 +2237,7 @@ f2lud_create_open_fast_spline_path(
}
}
-#line 2189 "f2lud.ctr"
+#line 2195 "f2lud.ctr"
}
@@ -2280,7 +2264,7 @@ f2lud_create_closed_spline_path(
size_t i; /* Current segment index. */
-#line 2214 "f2lud.ctr"
+#line 2220 "f2lud.ctr"
sp = (obj->dt).spl.po;
np = (obj->dt).spl.np;
for(i = 0; i < np; i++) {
@@ -2290,7 +2274,7 @@ f2lud_create_closed_spline_path(
}
-#line 2222 "f2lud.ctr"
+#line 2228 "f2lud.ctr"
}
/** Create path for closed spline object.
@@ -2306,7 +2290,7 @@ f2lud_create_closed_fast_spline_path(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- int primary,
+ int DK3_SILENCE_ARG_UNUSED(primary),
int *ec
)
{
@@ -2322,7 +2306,8 @@ f2lud_create_closed_fast_spline_path(
double dydtc;
-#line 2252 "f2lud.ctr"
+#line 2258 "f2lud.ctr"
+ DK3_UNUSED_ARG(primary)
po = (obj->dt).spl.po;
np = (obj->dt).spl.np;
if (2 < np) {
@@ -2380,7 +2365,7 @@ f2lud_create_closed_fast_spline_path(
}
-#line 2308 "f2lud.ctr"
+#line 2315 "f2lud.ctr"
}
@@ -2426,7 +2411,7 @@ f2lud_create_arc_path(
size_t i; /* Index of current segment. */
-#line 2352 "f2lud.ctr"
+#line 2359 "f2lud.ctr"
cx = (obj->dt).arc.xc;
cy = (obj->dt).arc.yc;
r = (obj->dt).arc.ra;
@@ -2441,7 +2426,7 @@ f2lud_create_arc_path(
dnumsegs = ceil(dk3ma_d_mul_ok(4.0, (alpha / M_PI), ec));
-#line 2365 "f2lud.ctr"
+#line 2372 "f2lud.ctr"
nsegs = dk3ma_d_to_sz_ok(dnumsegs, ec);
alphaseg = alpha / ((double)nsegs);
kappa = dk3fig_tool_arc_kappa(alphaseg, ec);
@@ -2499,7 +2484,7 @@ f2lud_create_arc_path(
}
-#line 2421 "f2lud.ctr"
+#line 2428 "f2lud.ctr"
}
@@ -2523,7 +2508,7 @@ f2lud_create_half_circle_path(
size_t i; /* Current point index */
-#line 2443 "f2lud.ctr"
+#line 2450 "f2lud.ctr"
po[0].x = 0.0;
po[0].y = (obj->dt).hci.ra;
po[1].x = -1.0 * FIG2LAT_CIRCLE_QUADRANT_BEZIER * (obj->dt).hci.ra;
@@ -2558,7 +2543,7 @@ f2lud_create_half_circle_path(
}
-#line 2476 "f2lud.ctr"
+#line 2483 "f2lud.ctr"
}
@@ -2582,7 +2567,7 @@ f2lud_create_path(
{
-#line 2498 "f2lud.ctr"
+#line 2505 "f2lud.ctr"
switch(obj->ot) {
case DK3_FIG_OBJ_ELLIPSE: {
f2lud_create_ellipse_path(job, drw, obj, ec);
@@ -2638,7 +2623,7 @@ f2lud_create_path(
} break;
}
-#line 2552 "f2lud.ctr"
+#line 2559 "f2lud.ctr"
}
@@ -2669,7 +2654,7 @@ f2lud_set_color_1(
#endif
-#line 2581 "f2lud.ctr"
+#line 2588 "f2lud.ctr"
dk3fig_tool_find_color(&rgb, drw, colno, fillstyle);
#if 0
if((job->gs).hc1) {
@@ -2718,7 +2703,7 @@ f2lud_set_color_1(
}
-#line 2628 "f2lud.ctr"
+#line 2635 "f2lud.ctr"
}
@@ -2749,7 +2734,7 @@ f2lud_set_color_2(
int muc = 1; /* Flag: Must configure. */
-#line 2657 "f2lud.ctr"
+#line 2664 "f2lud.ctr"
dk3fig_tool_find_color(&rgb, drw, colno, fillstyle);
#if 0
@@ -2799,7 +2784,7 @@ f2lud_set_color_2(
}
-#line 2705 "f2lud.ctr"
+#line 2712 "f2lud.ctr"
}
@@ -2825,7 +2810,7 @@ f2lud_internal_set_line_width(
int ec = 0; /* Error code variable. */
-#line 2729 "f2lud.ctr"
+#line 2736 "f2lud.ctr"
if((job->gs).hlw) {
if(1.0e-6 > fabs(dk3ma_d_sub_ok(lw, (job->gs).lw, &ec))) {
if(0 == ec) {
@@ -2860,7 +2845,7 @@ f2lud_internal_set_line_width(
}
-#line 2762 "f2lud.ctr"
+#line 2769 "f2lud.ctr"
}
@@ -2890,7 +2875,7 @@ f2lud_internal_set_line_dash(
int ec = 0; /* Error code variable. */
-#line 2790 "f2lud.ctr"
+#line 2797 "f2lud.ctr"
mysv = 0.9 * sv;
mylw = dk3fig_tool_get_lw(drw, obj, &ec);
/* Convert line width to output space.
@@ -2944,7 +2929,7 @@ f2lud_internal_set_line_dash(
}
-#line 2842 "f2lud.ctr"
+#line 2849 "f2lud.ctr"
}
@@ -2969,7 +2954,7 @@ f2lud_set_line_end(
int mc = 1; /* Flag: Must configure. */
-#line 2865 "f2lud.ctr"
+#line 2872 "f2lud.ctr"
if((job->gs).hlc) {
if((job->gs).lc == le) {
mc = 0;
@@ -3001,7 +2986,7 @@ f2lud_set_line_end(
}
-#line 2895 "f2lud.ctr"
+#line 2902 "f2lud.ctr"
}
@@ -3026,7 +3011,7 @@ f2lud_set_line_join(
int mc = 1; /* Flag: Must configure. */
-#line 2918 "f2lud.ctr"
+#line 2925 "f2lud.ctr"
if((job->gs).hlj) {
if((job->gs).lj == lj) {
mc = 0;
@@ -3058,7 +3043,7 @@ f2lud_set_line_join(
}
-#line 2948 "f2lud.ctr"
+#line 2955 "f2lud.ctr"
}
@@ -3078,7 +3063,7 @@ f2lud_set_pattern_line_style(
{
-#line 2966 "f2lud.ctr"
+#line 2973 "f2lud.ctr"
#if VERSION_BEFORE_20140330
f2lud_internal_set_line_width(job, drw, obj, ((job->lighten) ? 0.45 : 0.9));
#else
@@ -3104,7 +3089,7 @@ f2lud_set_pattern_line_style(
#endif
-#line 2990 "f2lud.ctr"
+#line 2997 "f2lud.ctr"
}
@@ -3126,14 +3111,14 @@ f2lud_set_line_width(
int ec = 0; /* Error code variable. */
-#line 3010 "f2lud.ctr"
+#line 3017 "f2lud.ctr"
lw = dk3fig_tool_get_lw(drw, obj, &ec);
lw = dk3ct_2d_r(&(job->ct2d), lw, &ec);
if(0 == ec) {
f2lud_internal_set_line_width(job, drw, obj, lw);
}
-#line 3015 "f2lud.ctr"
+#line 3022 "f2lud.ctr"
}
@@ -3153,11 +3138,11 @@ f2lud_set_line_dash(
{
-#line 3033 "f2lud.ctr"
+#line 3040 "f2lud.ctr"
f2lud_internal_set_line_dash(job, drw, obj, obj->ls, (0.9 * obj->sv));
-#line 3035 "f2lud.ctr"
+#line 3042 "f2lud.ctr"
}
@@ -3181,7 +3166,7 @@ f2lud_path_stroke(
{
-#line 3057 "f2lud.ctr"
+#line 3064 "f2lud.ctr"
f2lud_set_color_1(job, drw, obj->pc, 20);
f2lud_set_line_width(job, drw, obj);
f2lud_set_line_dash(job, drw, obj);
@@ -3195,7 +3180,7 @@ f2lud_path_stroke(
f2lud_stroke(job, drw, obj);
-#line 3069 "f2lud.ctr"
+#line 3076 "f2lud.ctr"
}
@@ -3219,7 +3204,7 @@ f2lud_path_fill(
{
-#line 3091 "f2lud.ctr"
+#line 3098 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_PGF:
case FIG2LAT_DRIVER_TEX_FULL_PGF:
@@ -3238,7 +3223,7 @@ f2lud_path_fill(
f2lud_fill(job, drw, obj);
-#line 3108 "f2lud.ctr"
+#line 3115 "f2lud.ctr"
}
@@ -3262,7 +3247,7 @@ f2lud_path_fill_stroke(
{
-#line 3130 "f2lud.ctr"
+#line 3137 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_PGF:
case FIG2LAT_DRIVER_TEX_FULL_PGF:
@@ -3314,7 +3299,7 @@ f2lud_path_fill_stroke(
} break;
}
-#line 3180 "f2lud.ctr"
+#line 3187 "f2lud.ctr"
}
@@ -3338,7 +3323,7 @@ f2lud_path_pattern(
{
-#line 3202 "f2lud.ctr"
+#line 3209 "f2lud.ctr"
f2lud_set_pattern_line_style(job, drw, obj);
f2lud_set_color_1(job, drw, obj->pc, 20);
f2lud_gsave(job, drw, obj);
@@ -3350,7 +3335,7 @@ f2lud_path_pattern(
f2lud_grestore(job, drw, obj);
-#line 3212 "f2lud.ctr"
+#line 3219 "f2lud.ctr"
}
@@ -3374,7 +3359,7 @@ f2lud_path_pattern_stroke(
{
-#line 3234 "f2lud.ctr"
+#line 3241 "f2lud.ctr"
f2lud_set_color_1(job, drw, obj->pc, 20);
f2lud_set_pattern_line_style(job, drw, obj);
f2lud_gsave(job, drw, obj);
@@ -3394,7 +3379,7 @@ f2lud_path_pattern_stroke(
f2lud_stroke(job, drw, obj);
-#line 3252 "f2lud.ctr"
+#line 3259 "f2lud.ctr"
}
@@ -3418,7 +3403,7 @@ f2lud_path_fill_pattern(
{
-#line 3274 "f2lud.ctr"
+#line 3281 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_PGF:
case FIG2LAT_DRIVER_TEX_FULL_PGF:
@@ -3474,7 +3459,7 @@ f2lud_path_fill_pattern(
} break;
}
-#line 3328 "f2lud.ctr"
+#line 3335 "f2lud.ctr"
}
@@ -3564,7 +3549,7 @@ f2lud_path_fill_pattern_stroke(
{
-#line 3416 "f2lud.ctr"
+#line 3423 "f2lud.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_PGF:
case FIG2LAT_DRIVER_TEX_FULL_PGF:
@@ -3650,7 +3635,7 @@ f2lud_path_fill_pattern_stroke(
} break;
}
-#line 3500 "f2lud.ctr"
+#line 3507 "f2lud.ctr"
}
@@ -3674,7 +3659,7 @@ f2lud_path_object(
int ec = 0; /* Error code variable. */
-#line 3522 "f2lud.ctr"
+#line 3529 "f2lud.ctr"
drawop = dk3fig_tool_get_operation(drw, obj);
if(obj->cl) {
switch(drawop) {
@@ -3710,10 +3695,10 @@ f2lud_path_object(
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_MATH);
-#line 3556 "f2lud.ctr"
+#line 3563 "f2lud.ctr"
}
-#line 3557 "f2lud.ctr"
+#line 3564 "f2lud.ctr"
}
@@ -3736,7 +3721,7 @@ f2lud_process_one(
char debbuf[256]; /* Buffer for debug messages. */
-#line 3578 "f2lud.ctr"
+#line 3585 "f2lud.ctr"
if(job->debug) {
sprintf(debbuf, f2lud_c8_kw[6], obj->ot, obj->st);
f2lud_debug(job, debbuf);
@@ -3768,7 +3753,7 @@ f2lud_process_one(
f2lud_debug(job, f2lud_c8_kw[7]);
}
-#line 3608 "f2lud.ctr"
+#line 3615 "f2lud.ctr"
}
@@ -3782,13 +3767,13 @@ f2lud_is_interpolated_spline(dk3_fig_obj_t *obj)
int back = 1;
-#line 3620 "f2lud.ctr"
+#line 3627 "f2lud.ctr"
po = (obj->dt).spl.po;
np = (obj->dt).spl.np;
for (i = 0; ((i < np) && (1 == back)); i++) {
-#line 3624 "f2lud.ctr"
+#line 3631 "f2lud.ctr"
if (fabs(po->s) > 1.0e-6) {
if (fabs(1.0 + po->s) > 1.0e-6) {
back = 0;
@@ -3797,7 +3782,7 @@ f2lud_is_interpolated_spline(dk3_fig_obj_t *obj)
po++;
}
-#line 3631 "f2lud.ctr"
+#line 3638 "f2lud.ctr"
return back;
}
@@ -3852,13 +3837,13 @@ f2lud_process_object(
char debbuf[256]; /* Buffer for debug messages. */
-#line 3684 "f2lud.ctr"
+#line 3691 "f2lud.ctr"
/*
Process object itself.
*/
-#line 3688 "f2lud.ctr"
+#line 3695 "f2lud.ctr"
if(job->debug) {
sprintf(debbuf, f2lud_c8_kw[0], objno, obj->li, obj->ot, obj->st, obj->la);
f2lud_debug(job, debbuf);
@@ -3866,17 +3851,17 @@ f2lud_process_object(
f2lud_process_one(job, drw, obj, 1);
-#line 3694 "f2lud.ctr"
+#line 3701 "f2lud.ctr"
/*
For primary objects process the arrowheads.
*/
if(obj->af) {
-#line 3699 "f2lud.ctr"
+#line 3706 "f2lud.ctr"
if(job->debug) {
-#line 3700 "f2lud.ctr"
+#line 3707 "f2lud.ctr"
sprintf(
debbuf, f2lud_c8_kw[2],
(obj->af)->as,
@@ -3888,7 +3873,7 @@ f2lud_process_object(
}
if((obj->af)->o1) {
-#line 3710 "f2lud.ctr"
+#line 3717 "f2lud.ctr"
#if VERSION_BEFORE_20140329
f2lud_process_one(job,drw,(dk3_fig_obj_t *)((obj->af)->o1),0);
#else
@@ -3897,7 +3882,7 @@ f2lud_process_object(
}
if((obj->af)->o2) {
-#line 3717 "f2lud.ctr"
+#line 3724 "f2lud.ctr"
#if VERSION_BEFORE_20140329
f2lud_process_one(job,drw,(dk3_fig_obj_t *)((obj->af)->o2),0);
#else
@@ -3906,20 +3891,20 @@ f2lud_process_object(
}
if(job->debug) {
-#line 3724 "f2lud.ctr"
+#line 3731 "f2lud.ctr"
f2lud_debug(job, f2lud_c8_kw[3]);
}
-#line 3727 "f2lud.ctr"
+#line 3734 "f2lud.ctr"
}
if(obj->ab) {
-#line 3730 "f2lud.ctr"
+#line 3737 "f2lud.ctr"
if(job->debug) {
-#line 3731 "f2lud.ctr"
+#line 3738 "f2lud.ctr"
sprintf(
debbuf, f2lud_c8_kw[4],
(obj->ab)->as,
@@ -3931,7 +3916,7 @@ f2lud_process_object(
}
if((obj->ab)->o1) {
-#line 3741 "f2lud.ctr"
+#line 3748 "f2lud.ctr"
#if VERSION_BEFORE_20140329
f2lud_process_one(job,drw,(dk3_fig_obj_t *)((obj->ab)->o1),0);
#else
@@ -3940,7 +3925,7 @@ f2lud_process_object(
}
if((obj->ab)->o2) {
-#line 3748 "f2lud.ctr"
+#line 3755 "f2lud.ctr"
#if VERSION_BEFORE_20140329
f2lud_process_one(job,drw,(dk3_fig_obj_t *)((obj->ab)->o2),0);
#else
@@ -3949,12 +3934,12 @@ f2lud_process_object(
}
if(job->debug) {
-#line 3755 "f2lud.ctr"
+#line 3762 "f2lud.ctr"
f2lud_debug(job, f2lud_c8_kw[5]);
}
-#line 3758 "f2lud.ctr"
+#line 3765 "f2lud.ctr"
}
if(job->debug) {
sprintf(debbuf, f2lud_c8_kw[1], objno);
@@ -3962,7 +3947,7 @@ f2lud_process_object(
}
-#line 3764 "f2lud.ctr"
+#line 3771 "f2lud.ctr"
}
@@ -3975,7 +3960,7 @@ f2lud_output(f2l_job_t *job)
unsigned long objno; /* Current object number. */
-#line 3775 "f2lud.ctr"
+#line 3782 "f2lud.ctr"
drw = job->drw;
objno = 0UL;
if(f2lud_driver_initialize(job, drw)) {
@@ -3991,22 +3976,22 @@ f2lud_output(f2l_job_t *job)
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 3789 "f2lud.ctr"
+#line 3796 "f2lud.ctr"
}
f2lud_end_processing(job, drw);
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 3793 "f2lud.ctr"
+#line 3800 "f2lud.ctr"
}
f2lud_close_output_files(job);
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 3797 "f2lud.ctr"
+#line 3804 "f2lud.ctr"
}
f2lud_driver_end(job, drw);
-#line 3799 "f2lud.ctr"
+#line 3806 "f2lud.ctr"
}
diff --git a/support/dktools/f2lud.ctr b/support/dktools/f2lud.ctr
index fb6bd3dcba..9ccb25172d 100644
--- a/support/dktools/f2lud.ctr
+++ b/support/dktools/f2lud.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -217,6 +217,7 @@ f2lud_is_interpolated_spline(dk3_fig_obj_t *obj);
#include "dk4vers.h"
#include "f2ludpat.h"
#include "f2lpara.h"
+#include "dk3unused.h"
@@ -629,7 +630,7 @@ void
f2lud_find_bounding_box(
dk3_bb_t *bb,
f2l_job_t *job,
- dk3_fig_drawing_t *drw,
+ dk3_fig_drawing_t * DK3_SILENCE_ARG_UNUSED(drw),
dk3_fig_obj_t *obj,
int *ec
)
@@ -638,6 +639,7 @@ f2lud_find_bounding_box(
size_t np; /* Number of points. */
size_t i; /* Index of current point. */
$? "+ f2lud_find_bounding_box"
+ DK3_UNUSED_ARG(drw)
po = (obj->dt).pol.po;
np = (obj->dt).pol.np;
dk3bb_reset(bb);
@@ -669,7 +671,7 @@ f2lud_image_object(
$? "+ f2lud_image_object"
dk3bb_reset(&outbb);
f2lud_find_bounding_box(&outbb, job, drw, obj, &ec);
- drawdir = f2lto_find_draw_direction(job, drw, obj, &ec);
+ drawdir = f2lto_find_draw_direction(drw, obj, &ec);
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
f2lpgf_tex_image_object(job, drw, obj, &outbb, drawdir, &ec);
@@ -1495,7 +1497,7 @@ f2lud_final_spline_segment(
size_t i,
double te,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -1521,6 +1523,7 @@ f2lud_final_spline_segment(
size_t iseg; /* Current segment. */
int res; /* Calculation result. */
$? "+ f2lud_final_spline_segment %lg", te
+ DK3_UNUSED_ARG(iscl)
myte = dk3ma_d_sub_ok(te, floor(te), ec); $? ". myte = %lg", myte
dnumsegs = myte * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs); $? ". dnumsegs = %lg", dnumsegs
@@ -1626,7 +1629,7 @@ f2lud_first_spline_segment(
size_t i,
double ts,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -1652,6 +1655,7 @@ f2lud_first_spline_segment(
size_t iseg; /* Current segment. */
int res; /* Calculation result. */
$? "+ f2lud_first_spline_segment ts=%lg", ts
+ DK3_UNUSED_ARG(iscl)
myts = dk3ma_d_sub_ok(ts, floor(ts), ec); $? ". myts = %lg", myts
dnumsegs = (1.0 - myts) * dk3fig_tool_xssbs(drw, primary);
dnumsegs = ceil(dnumsegs); $? ". dnumsegs = %lg", dnumsegs
@@ -1757,7 +1761,7 @@ f2lud_single_spline_segment(
double ts,
double te,
int isfirst,
- int iscl,
+ int DK3_SILENCE_ARG_UNUSED(iscl),
int primary,
int *ec
)
@@ -1784,6 +1788,7 @@ f2lud_single_spline_segment(
size_t iseg; /* Current segment. */
int res; /* Calculation result. */
$? "+ f2lud_single_spline_segment"
+ DK3_UNUSED_ARG(iscl)
myte = dk3ma_d_sub_ok(te, floor(te), ec);
myts = dk3ma_d_sub_ok(ts, floor(ts), ec);
dnumsegs = (myte - myts) * dk3fig_tool_xssbs(drw, primary);
@@ -2126,7 +2131,7 @@ f2lud_create_open_fast_spline_path(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- int primary,
+ int DK3_SILENCE_ARG_UNUSED(primary),
int *ec
)
{
@@ -2139,6 +2144,7 @@ f2lud_create_open_fast_spline_path(
double dxdtc;
double dydtc;
$? "+ f2lud_create_open_fast_spline_path"
+ DK3_UNUSED_ARG(primary)
po = (obj->dt).spl.po;
np = (obj->dt).spl.np;
if (np > 1) {
@@ -2234,7 +2240,7 @@ f2lud_create_closed_fast_spline_path(
f2l_job_t *job,
dk3_fig_drawing_t *drw,
dk3_fig_obj_t *obj,
- int primary,
+ int DK3_SILENCE_ARG_UNUSED(primary),
int *ec
)
{
@@ -2249,6 +2255,7 @@ f2lud_create_closed_fast_spline_path(
double dxdtc;
double dydtc;
$? "+ f2lud_create_closed_fast_spline_path"
+ DK3_UNUSED_ARG(primary)
po = (obj->dt).spl.po;
np = (obj->dt).spl.np;
if (2 < np) {
diff --git a/support/dktools/f2lud.h b/support/dktools/f2lud.h
index 831bb7eb18..c80e92b49d 100644
--- a/support/dktools/f2lud.h
+++ b/support/dktools/f2lud.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2lud.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2lud.ctr
*/
/** @file f2lud.h Header file for the f2lud module.
diff --git a/support/dktools/f2ludpat.c b/support/dktools/f2ludpat.c
index dd40cecb6f..8344e91881 100644
--- a/support/dktools/f2ludpat.c
+++ b/support/dktools/f2ludpat.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2ludpat.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2ludpat.ctr
*/
/** @file f2ludpat.c The f2ludpat module.
diff --git a/support/dktools/f2ludpat.ctr b/support/dktools/f2ludpat.ctr
index f5dec56e00..7e6c4bda55 100644
--- a/support/dktools/f2ludpat.ctr
+++ b/support/dktools/f2ludpat.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/f2ludpat.h b/support/dktools/f2ludpat.h
index 2522230723..99bcba1add 100644
--- a/support/dktools/f2ludpat.h
+++ b/support/dktools/f2ludpat.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: f2ludpat.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: f2ludpat.ctr
*/
/** @file f2ludpat.h Header file for the f2ludpat module.
diff --git a/support/dktools/fat-spline.wxd b/support/dktools/fat-spline.wxd
new file mode 100644
index 0000000000..8be3444166
--- /dev/null
+++ b/support/dktools/fat-spline.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 32512000 40640000 73152000
+4 6 0 0 143 0 16 0 4 0 0 8 0 16 8 0 16 8
+ 8128000 56896000 0
+ 8128000 65024000 1
+ 16256000 65024000 1
+ 16256000 56896000 1
+ 24384000 56896000 1
+ 24384000 65024000 0
diff --git a/support/dktools/favicon.ico b/support/dktools/favicon.ico
deleted file mode 100644
index c07cdafd81..0000000000
--- a/support/dktools/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/support/dktools/fc27-build-rpm.sh b/support/dktools/fc27-build-rpm.sh
new file mode 100755
index 0000000000..1823fc91af
--- /dev/null
+++ b/support/dktools/fc27-build-rpm.sh
@@ -0,0 +1,76 @@
+#! /bin/sh
+
+VERSION=`cat version.txt`
+
+# Check whether this script is run as unprivileged user
+if [ "X$LOGNAME" = "Xroot" ]
+then
+ echo 'ERROR: This script must not be run as root!'
+ exit 1
+fi
+
+# Check whether HOME environment variable is set
+if [ "X$HOME" = "X" ]
+then
+ echo 'ERROR: Environment variable HOME not set!'
+ exit 1
+fi
+
+# Check whether the version number was obtained
+if [ "X$VERSION" = "X" ]
+then
+ echo 'ERROR: Failed to find version number!'
+ echo 'Make sure to call this script in the correct directory!'
+ exit 1
+fi
+
+# Create HOME/rpmbuild directory if not yet present
+if [ ! -d ${HOME}/rpmbuild ]
+then
+ mkdir -p ${HOME}/rpmbuild
+ chmod 755 ${HOME}/rpmbuild
+fi
+
+# Create subdirectories of HOME/rpmbuild if not yet present
+for i in BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
+do
+ if [ ! -d ${HOME}/rpmbuild/${i} ]
+ then
+ mkdir -p ${HOME}/rpmbuild/${i}
+ chmod 755 ${HOME}/rpmbuild/${i}
+ fi
+done
+
+# Copy source tarball to HOME/rpmbuild/SOURCES
+if [ -f ../dktools-${VERSION}.tar.gz ]
+then
+ cp ../dktools-${VERSION}.tar.gz ${HOME}/rpmbuild/SOURCES
+else
+ echo 'ERROR: File' ../dktools-${VERSION}.ta.gz 'not found!'
+ exit 1
+fi
+
+# Copy *.spec file to HOME/rpmbuild/SPECS
+if [ -f dktools-fedora.spec ]
+then
+ cp dktools-fedora.spec ${HOME}/rpmbuild/SPECS/dktools-fedora.spec
+ chmod 644 ${HOME}/rpmbuild/SPECS/dktools-fedora.spec
+else
+ echo 'ERROR: File dktools-fedora.spec not found!'
+ exit 1
+fi
+
+# Build RPM file
+cd ${HOME}/rpmbuild/SPECS
+rpmbuild -ba dktools-fedora.spec 2>&1 | tee errors
+
+# Some final notes
+echo ''
+ls ${HOME}/rpmbuild/RPMS/*/dktools-*${VERSION}*.rpm
+echo ''
+echo 'If the previous command succeeded, you find your *.rpm files'
+echo "in a subdirectory of the the ${HOME}/rpmbuild/RPMS directory."
+echo 'If the rpmbuild command showed errors, make sure to run the'
+echo 'fc27-prepare.sh script as root before running this one.'
+echo ''
+
diff --git a/support/dktools/fc27-prepare.sh b/support/dktools/fc27-prepare.sh
new file mode 100755
index 0000000000..5dcc2ce3e4
--- /dev/null
+++ b/support/dktools/fc27-prepare.sh
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+# Check whether the script runs as root
+if [ "X$LOGNAME" != "Xroot" ]
+then
+ echo 'ERROR: This script must be run as root!'
+ exit 1
+fi
+
+# Install the yum-builddep tool
+# dnf -y install yum-utils
+
+
+# Installing everything necessary to build a kernel should install
+# all developer tools required for us.
+dnf -y builddep kernel
+
+# Explicit dependencies to build our project and to create RPM files
+P="zlib-devel bzip2-devel openssl-devel db4-devel db4-cxx mysql-devel"
+P="$P libpng-devel libjpeg-turbo-devel openjpeg-devel libtiff-devel"
+P="$P net-snmp-devel wxGTK3-devel wxGTK3-gl wxGTK3-media wxGTK3-webview"
+P="$P gcc gcc-c++ gcc-gfortran gcc-objc gcc-objc++ make"
+P="$P rpm rpm-build rpm-devel rpmdevtools rpmlint"
+dnf -y install $P
+
+echo ''
+echo 'Remember to switch back to an unprivileged user to build the RPM.'
+echo ''
+
diff --git a/support/dktools/fc28-prepare.sh b/support/dktools/fc28-prepare.sh
new file mode 100755
index 0000000000..44af6bbd2e
--- /dev/null
+++ b/support/dktools/fc28-prepare.sh
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+# Check whether the script runs as root
+if [ "X$LOGNAME" != "Xroot" ]
+then
+ echo 'ERROR: This script must be run as root!'
+ exit 1
+fi
+
+# Install the yum-builddep tool
+# dnf -y install yum-utils
+
+
+# Installing everything necessary to build a kernel should install
+# all developer tools required for us.
+dnf -y builddep kernel
+
+# Explicit dependencies to build our project and to create RPM files
+P="zlib-devel bzip2-devel openssl-devel db4-devel db4-cxx mysql-devel"
+P="$P libpng-devel libjpeg-turbo-devel openjpeg-devel libtiff-devel"
+P="$P net-snmp-devel wxGTK3-devel wxGTK3-gl wxGTK3-media wxGTK3-webview"
+P="$P gcc gcc-c++ gcc-gfortran gcc-objc gcc-objc++ make"
+P="$P rpm rpm-build rpm-devel rpmdevtools rpmlint libdb-devel"
+dnf -y install $P
+
+echo ''
+echo 'Remember to switch back to an unprivileged user to build the RPM.'
+echo ''
+
diff --git a/support/dktools/fig2lat.c b/support/dktools/fig2lat.c
index 78a5ec4674..ea256120cd 100644
--- a/support/dktools/fig2lat.c
+++ b/support/dktools/fig2lat.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: fig2lat.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: fig2lat.ctr
*/
/** @file fig2lat.c The fig2lat module.
*/
-#line 209 "fig2lat.ctr"
+#line 210 "fig2lat.ctr"
/** Test flag to show Beziervalues.
@@ -60,7 +38,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 230 "fig2lat.ctr"
+#line 231 "fig2lat.ctr"
@@ -100,7 +78,7 @@ dkT("-i.pdf"),
NULL
-#line 278 "fig2lat.ctr"
+#line 279 "fig2lat.ctr"
};
@@ -153,7 +131,7 @@ dkT(""),
NULL
-#line 329 "fig2lat.ctr"
+#line 330 "fig2lat.ctr"
};
@@ -268,6 +246,8 @@ dkT("\t\t\t\tarrowheads on splines. Default: 4."),
dkT(""),
dkT("\tahms=<integer>\t\tMinimum number of X-spline segments for"),
dkT("\t\t\t\teach arrowhead edge. Default: 4"),
+dkT("\t"),
+dkT("\tahbs[=<boolean>]\tUse bisection iteration on spline arrowheads."),
dkT(""),
dkT("\tahip=<float>\t\tArrowhead iteration precision. Default: 0.04."),
dkT(""),
@@ -277,7 +257,7 @@ dkT(""),
dkT("\tcodi=[<number>]\t\tNumber of digits used for colors. Default: 3."),
dkT(""),
dkT(""),
-dkT("\tCompatibilty options (compatibility to fig2dev):"),
+dkT("\tCompatibility options (compatibility to fig2dev):"),
dkT(""),
dkT("\tcosp[=<boolean>]\tCompatible splines."),
dkT(""),
@@ -400,12 +380,12 @@ dkT("[BS1995]\tCarole Blanc, Christophe Schlick:"),
dkT("\t\tX-Splines: A Spline Model Designed for the End-User"),
dkT("\t\tProceedings of the SIGGRAPH 1995"),
dkT(""),
-dkT("[fig2lat]\thttp://dktools.sourceforge.net"),
+dkT("[fig2lat]\thttp://sourceforge.net/p/dktools/wiki/fig2lat%20manual/"),
dkT(""),
NULL
-#line 579 "fig2lat.ctr"
+#line 582 "fig2lat.ctr"
};
@@ -557,7 +537,7 @@ dkT("\"!"),
NULL
-#line 734 "fig2lat.ctr"
+#line 737 "fig2lat.ctr"
};
@@ -570,6 +550,14 @@ static dkChar const fig2lat_pref_psl[] = {
+/** Preference name for compatible splines.
+*/
+static dkChar const fig2lat_pref_cosp[] = {
+ dkT("/fig/compatible-splines")
+};
+
+
+
#if 0
/** Initialize a configuration structure.
@param conf Structure to initialize.
@@ -580,13 +568,13 @@ fig2lat_config_init(fig2lat_config_t *conf)
{
-#line 755 "fig2lat.ctr"
+#line 766 "fig2lat.ctr"
dk3mem_res((void *)conf, sizeof(fig2lat_config_t));
conf->nts = 1.0;
conf->ntf = 0;
-#line 759 "fig2lat.ctr"
+#line 770 "fig2lat.ctr"
}
#endif
@@ -642,7 +630,7 @@ fig2lat_job_init(
int back = 0;
-#line 813 "fig2lat.ctr"
+#line 824 "fig2lat.ctr"
dk3mem_res((void*)job, sizeof(f2l_job_t));
dk3fig_gs_init(&(job->gs));
job->app = app;
@@ -665,8 +653,10 @@ fig2lat_job_init(
job->exval = FIG2LAT_EXIT_ERROR_UNKNOWN;
job->mm = 0;
job->cmd = 0;
- job->cosp = 0;
- job->coah = 0;
+ job->cosp = dk3app_get_pref_bool(app, fig2lat_pref_cosp, 1);
+ job->coah = 0;
+
+#line 848 "fig2lat.ctr"
job->xsah = 0;
job->xssbs = 8;
job->qbs = 4;
@@ -693,6 +683,7 @@ fig2lat_job_init(
job->bbts = 0;
job->stu8 = 0;
job->cofop = 1;
+ job->ahbs = 0;
job->lwbp = 0.9; /* 1/80 inch */
job->lwauto = 0;
if(dk3app_get_encoding(app) == DK3_ENCODING_UTF8) {
@@ -709,7 +700,7 @@ fig2lat_job_init(
back = 1;
-#line 878 "fig2lat.ctr"
+#line 890 "fig2lat.ctr"
return back;
}
@@ -724,7 +715,7 @@ fig2lat_job_end(f2l_job_t *job)
{
-#line 891 "fig2lat.ctr"
+#line 903 "fig2lat.ctr"
/* @DRIVER@
If you added components to the f2l_job_t structure
make sure to release resources here.
@@ -734,7 +725,7 @@ fig2lat_job_end(f2l_job_t *job)
}
-#line 899 "fig2lat.ctr"
+#line 911 "fig2lat.ctr"
}
@@ -744,7 +735,7 @@ fig2lat_job_end(f2l_job_t *job)
*/
static
void
-fig2lat_show_version(f2l_job_t *job)
+fig2lat_show_version(void)
{
dk3sf_initialize_stdout();
dk3sf_fputs(fig2lat_version[0], stdout);
@@ -759,7 +750,7 @@ fig2lat_show_version(f2l_job_t *job)
*/
static
void
-fig2lat_show_license(f2l_job_t *job)
+fig2lat_show_license(void)
{
dkChar const * const *ptr; /* Pointer to traverse all text lines. */
ptr = fig2lat_license;
@@ -823,7 +814,7 @@ fig2lat_set_one_output_name(
-#line 986 "fig2lat.ctr"
+#line 998 "fig2lat.ctr"
if(dk3str_len(ifn) < DK3_SIZEOF(buf,dkChar)) {
dk3str_cpy_not_overlapped(buf, ifn);
sp = dk3str_get_suffix(buf);
@@ -834,28 +825,28 @@ fig2lat_set_one_output_name(
if(!(back)) {
job->exval = FIG2LAT_EXIT_ERROR_SYSTEM;
-#line 995 "fig2lat.ctr"
+#line 1007 "fig2lat.ctr"
}
} else {
-#line 997 "fig2lat.ctr"
+#line 1009 "fig2lat.ctr"
/* ERROR: Input file name too long! */
job->exval = FIG2LAT_EXIT_FILENAME_TOO_LONG;
-#line 999 "fig2lat.ctr"
+#line 1011 "fig2lat.ctr"
dk3app_log_2(job->app, DK3_LL_ERROR, job->msg, 2, buf);
}
} else {
-#line 1002 "fig2lat.ctr"
+#line 1014 "fig2lat.ctr"
/* ERROR: Input file name too long! */
job->exval = FIG2LAT_EXIT_FILENAME_TOO_LONG;
-#line 1004 "fig2lat.ctr"
+#line 1016 "fig2lat.ctr"
dk3app_log_2(job->app, DK3_LL_ERROR, job->msg, 2, ifn);
}
-#line 1006 "fig2lat.ctr"
+#line 1018 "fig2lat.ctr"
return back;
}
@@ -873,7 +864,7 @@ fig2lat_set_output_names(f2l_job_t *job, dkChar const *ifn)
int back = 0;
-#line 1022 "fig2lat.ctr"
+#line 1034 "fig2lat.ctr"
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
job->on1 = fig2lat_set_one_output_name(job, ifn, f2l_kw[7]);
@@ -909,18 +900,18 @@ fig2lat_set_output_names(f2l_job_t *job, dkChar const *ifn)
}
-#line 1056 "fig2lat.ctr"
+#line 1068 "fig2lat.ctr"
-#line 1057 "fig2lat.ctr"
+#line 1069 "fig2lat.ctr"
if(!(back)) {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 1059 "fig2lat.ctr"
+#line 1071 "fig2lat.ctr"
}
-#line 1061 "fig2lat.ctr"
+#line 1073 "fig2lat.ctr"
return back;
}
@@ -941,7 +932,7 @@ fig2lat_run_for_file(f2l_job_t *job, dkChar const *fn)
unsigned long oldsrcline; /* Saved source file line number. */
-#line 1080 "fig2lat.ctr"
+#line 1092 "fig2lat.ctr"
oldsrcname = dk3app_get_source_file(job->app);
oldsrcline = dk3app_get_source_line(job->app);
dk3app_set_source_file(job->app, fn);
@@ -972,12 +963,13 @@ fig2lat_run_for_file(f2l_job_t *job, dkChar const *fn)
dk3fig_set_options_iteration_precision(job->drw, job->xsprec);
dk3fig_set_options_codi(job->drw, job->codi);
dk3fig_set_options_cofop(job->drw, job->cofop);
+ dk3fig_set_options_ah_bisection(job->drw, job->ahbs);
if(dk3fig_read_file_name(job->drw, fn)) {
-#line 1111 "fig2lat.ctr"
+#line 1124 "fig2lat.ctr"
if(dk3fig_prepare(job->drw)) {
-#line 1112 "fig2lat.ctr"
+#line 1125 "fig2lat.ctr"
#if DK3_HAVE_SETLOCALE && defined(LC_NUMERIC) && DK3_HAVE_LOCALE_H
oldlocale = setlocale(LC_NUMERIC, "C");
#endif
@@ -1000,27 +992,27 @@ fig2lat_run_for_file(f2l_job_t *job, dkChar const *fn)
#endif
} else {
-#line 1133 "fig2lat.ctr"
+#line 1146 "fig2lat.ctr"
/* ERROR while preparing drawing! */
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 1135 "fig2lat.ctr"
+#line 1148 "fig2lat.ctr"
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 4);
}
} else {
-#line 1138 "fig2lat.ctr"
+#line 1151 "fig2lat.ctr"
/* ERROR while reading input file! */
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_UNKNOWN);
-#line 1140 "fig2lat.ctr"
+#line 1153 "fig2lat.ctr"
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 3);
}
dk3fig_drawing_delete(job->drw); job->drw = NULL;
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1145 "fig2lat.ctr"
+#line 1158 "fig2lat.ctr"
}
}
dk3_release(job->on1);
@@ -1029,7 +1021,7 @@ fig2lat_run_for_file(f2l_job_t *job, dkChar const *fn)
dk3app_set_source_line(job->app, oldsrcline);
-#line 1152 "fig2lat.ctr"
+#line 1165 "fig2lat.ctr"
}
@@ -1052,7 +1044,7 @@ fig2lat_up_to_date_output(f2l_job_t *job, dkChar const *fn, dkChar const *sn)
int back = 0;
-#line 1173 "fig2lat.ctr"
+#line 1186 "fig2lat.ctr"
if(dk3str_len(fn) < DK3_SIZEOF(fnb,dkChar)) {
dk3str_cpy_not_overlapped(fnb, fn);
sp = dk3str_get_suffix(fnb);
@@ -1065,7 +1057,7 @@ fig2lat_up_to_date_output(f2l_job_t *job, dkChar const *fn, dkChar const *sn)
if(stbd.mod > stbs.mod) {
back = 1;
-#line 1184 "fig2lat.ctr"
+#line 1197 "fig2lat.ctr"
}
}
}
@@ -1073,7 +1065,7 @@ fig2lat_up_to_date_output(f2l_job_t *job, dkChar const *fn, dkChar const *sn)
}
}
-#line 1190 "fig2lat.ctr"
+#line 1203 "fig2lat.ctr"
return back;
}
@@ -1091,7 +1083,7 @@ fig2lat_must_process_file(f2l_job_t *job, dkChar const *fn)
int back = 1;
-#line 1206 "fig2lat.ctr"
+#line 1219 "fig2lat.ctr"
if(job->mm) {
switch(job->dr) {
case FIG2LAT_DRIVER_TEX_FULL_PGF: {
@@ -1138,7 +1130,7 @@ fig2lat_must_process_file(f2l_job_t *job, dkChar const *fn)
}
}
-#line 1251 "fig2lat.ctr"
+#line 1264 "fig2lat.ctr"
return back;
}
@@ -1156,7 +1148,7 @@ fig2lat_run_for_directory(f2l_job_t *job, dkChar const *fn)
dkChar const *filename; /* Found file name. */
-#line 1267 "fig2lat.ctr"
+#line 1280 "fig2lat.ctr"
dir = dk3dir_open_app(fn, job->app);
if(dir) {
while(dk3dir_get_next_file(dir)) {
@@ -1169,18 +1161,18 @@ fig2lat_run_for_directory(f2l_job_t *job, dkChar const *fn)
}
} else {
-#line 1278 "fig2lat.ctr"
+#line 1291 "fig2lat.ctr"
}
}
dk3dir_close(dir);
} else {
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1283 "fig2lat.ctr"
+#line 1296 "fig2lat.ctr"
}
-#line 1285 "fig2lat.ctr"
+#line 1298 "fig2lat.ctr"
}
@@ -1196,7 +1188,7 @@ fig2lat_run_for_file_directly(f2l_job_t *job, dkChar const *fn)
dk3_stat_t stb; /* File information. */
-#line 1299 "fig2lat.ctr"
+#line 1312 "fig2lat.ctr"
if(dk3sf_stat_app(&stb, fn, job->app)) {
switch((stb.ft) & (~(DK3_FT_SYMLINK))) {
case DK3_FT_REGULAR: {
@@ -1209,20 +1201,20 @@ fig2lat_run_for_file_directly(f2l_job_t *job, dkChar const *fn)
/* ERROR: Neither directory nor regular file! */
job->exval = FIG2LAT_EXIT_ERROR_NO_SUCH_FILE;
-#line 1310 "fig2lat.ctr"
+#line 1323 "fig2lat.ctr"
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 5);
} break;
}
} else {
-#line 1314 "fig2lat.ctr"
+#line 1327 "fig2lat.ctr"
job->exval = FIG2LAT_EXIT_ERROR_NO_SUCH_FILE;
-#line 1315 "fig2lat.ctr"
+#line 1328 "fig2lat.ctr"
}
-#line 1317 "fig2lat.ctr"
+#line 1330 "fig2lat.ctr"
}
@@ -1241,7 +1233,7 @@ fig2lat_run_for_name(f2l_job_t *job, dkChar const *fn)
int found; /* Flag: Source file found. */
-#line 1334 "fig2lat.ctr"
+#line 1347 "fig2lat.ctr"
if(dk3str_len(fn) < DK3_SIZEOF(fnb,dkChar)) {
dk3str_cpy_not_overlapped(fnb, fn);
dk3str_correct_filename(fnb);
@@ -1254,45 +1246,45 @@ fig2lat_run_for_name(f2l_job_t *job, dkChar const *fn)
if(filename) {
if(fig2lat_is_fig_file(filename)) {
-#line 1345 "fig2lat.ctr"
+#line 1358 "fig2lat.ctr"
found = 1;
fig2lat_run_for_file(job, filename);
} else {
-#line 1348 "fig2lat.ctr"
+#line 1361 "fig2lat.ctr"
}
} else {
-#line 1350 "fig2lat.ctr"
+#line 1363 "fig2lat.ctr"
}
}
if(0 == found) {
job->exval = FIG2LAT_EXIT_ERROR_NO_SUCH_FILE;
-#line 1354 "fig2lat.ctr"
+#line 1367 "fig2lat.ctr"
}
dk3dir_close(dir);
} else {
-#line 1357 "fig2lat.ctr"
+#line 1370 "fig2lat.ctr"
job->exval = FIG2LAT_EXIT_ERROR_SYSTEM;
-#line 1358 "fig2lat.ctr"
+#line 1371 "fig2lat.ctr"
}
} else {
fig2lat_run_for_file_directly(job, fnb);
}
} else {
-#line 1363 "fig2lat.ctr"
+#line 1376 "fig2lat.ctr"
/* ERROR: File name too long! */
job->exval = FIG2LAT_EXIT_FILENAME_TOO_LONG;
-#line 1365 "fig2lat.ctr"
+#line 1378 "fig2lat.ctr"
dk3app_log_2(job->app, DK3_LL_ERROR, job->msg, 2, fn);
}
-#line 1367 "fig2lat.ctr"
+#line 1380 "fig2lat.ctr"
}
@@ -1307,19 +1299,19 @@ fig2lat_run_for_current_directory(f2l_job_t *job)
dkChar cwdbu[DK3_MAX_PATH]; /* Buffer for current working directory. */
-#line 1380 "fig2lat.ctr"
+#line 1393 "fig2lat.ctr"
if(dk3sf_getcwd_app(cwdbu, DK3_SIZEOF(cwdbu,dkChar), job->app)) {
fig2lat_run_for_file_directly(job, cwdbu);
} else {
-#line 1383 "fig2lat.ctr"
+#line 1396 "fig2lat.ctr"
f2l_tool_set_exit_status(job, FIG2LAT_EXIT_ERROR_SYSTEM);
-#line 1384 "fig2lat.ctr"
+#line 1397 "fig2lat.ctr"
}
-#line 1386 "fig2lat.ctr"
+#line 1399 "fig2lat.ctr"
}
@@ -1336,13 +1328,13 @@ fig2lat_run(f2l_job_t *job)
int i; /* Current command line argument processed. */
-#line 1401 "fig2lat.ctr"
+#line 1414 "fig2lat.ctr"
if((argc = dk3opt_get_num_args(job->opt)) > 0) {
-#line 1402 "fig2lat.ctr"
+#line 1415 "fig2lat.ctr"
job->exval = FIG2LAT_EXIT_SUCCESS;
-#line 1403 "fig2lat.ctr"
+#line 1416 "fig2lat.ctr"
for(i = 0; i < argc; i++) {
fn = dk3opt_get_arg(job->opt, i);
if(fn) {
@@ -1350,17 +1342,17 @@ fig2lat_run(f2l_job_t *job)
} else {
job->exval = FIG2LAT_EXIT_ERROR_NO_SUCH_FILE;
-#line 1409 "fig2lat.ctr"
+#line 1422 "fig2lat.ctr"
}
}
} else {
-#line 1412 "fig2lat.ctr"
+#line 1425 "fig2lat.ctr"
fig2lat_run_for_current_directory(job);
}
-#line 1415 "fig2lat.ctr"
+#line 1428 "fig2lat.ctr"
}
@@ -1398,10 +1390,10 @@ DK3_MAIN
int testcmd; /* Mask for help/version/license. */
-#line 1451 "fig2lat.ctr"
+#line 1464 "fig2lat.ctr"
-#line 1452 "fig2lat.ctr"
+#line 1465 "fig2lat.ctr"
#if VERSION_BEFORE_20150821
exval = FIG2LAT_EXIT_ERROR_UNKNOWN;
#endif
@@ -1411,7 +1403,7 @@ DK3_MAIN
);
if(app) {
-#line 1460 "fig2lat.ctr"
+#line 1473 "fig2lat.ctr"
msg = dk3app_messages(
app, f2l_kw[1], (dkChar const **)f2l_default_messages
);
@@ -1423,49 +1415,49 @@ DK3_MAIN
#endif
if(fig2lat_job_init(&job,app,msg,figmsg)) {
-#line 1470 "fig2lat.ctr"
+#line 1483 "fig2lat.ctr"
if(f2lopt_process(&job)) {
-#line 1471 "fig2lat.ctr"
+#line 1484 "fig2lat.ctr"
testcmd = DK3_APP_CMD_HELP | DK3_APP_CMD_VERSION | DK3_APP_CMD_LICENSE;
if((job.cmd) & testcmd) {
-#line 1473 "fig2lat.ctr"
+#line 1486 "fig2lat.ctr"
if(job.cmd) {
-#line 1474 "fig2lat.ctr"
- fig2lat_show_version(&job);
+#line 1487 "fig2lat.ctr"
+ fig2lat_show_version();
}
if((job.cmd) & DK3_APP_CMD_LICENSE) {
-#line 1477 "fig2lat.ctr"
- fig2lat_show_license(&job);
+#line 1490 "fig2lat.ctr"
+ fig2lat_show_license();
}
if((job.cmd) & DK3_APP_CMD_HELP) {
-#line 1480 "fig2lat.ctr"
+#line 1493 "fig2lat.ctr"
fig2lat_show_help(&job);
}
job.exval = FIG2LAT_EXIT_SUCCESS;
} else {
-#line 1484 "fig2lat.ctr"
+#line 1497 "fig2lat.ctr"
fig2lat_run(&job);
}
} else {
-#line 1487 "fig2lat.ctr"
+#line 1500 "fig2lat.ctr"
dk3app_log_1(job.app, DK3_LL_ERROR, job.msg, 6);
}
} else {
-#line 1490 "fig2lat.ctr"
+#line 1503 "fig2lat.ctr"
}
exval = job.exval;
dk3app_close(app); app = NULL;
} else {
-#line 1494 "fig2lat.ctr"
+#line 1507 "fig2lat.ctr"
fputs("fig2lat: ERROR: Not enough memory (RAM/swap)!\n", stderr);
fflush(stderr);
exval = FIG2LAT_EXIT_ERROR_SYSTEM;
@@ -1473,10 +1465,10 @@ DK3_MAIN
fig2lat_job_end(&job);
-#line 1500 "fig2lat.ctr"
+#line 1513 "fig2lat.ctr"
-#line 1501 "fig2lat.ctr"
+#line 1514 "fig2lat.ctr"
fflush(stdout);
exit(exval); return exval;
}
diff --git a/support/dktools/fig2lat.ctr b/support/dktools/fig2lat.ctr
index 22658a4b6a..fd0e01ce31 100644
--- a/support/dktools/fig2lat.ctr
+++ b/support/dktools/fig2lat.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
# splint comment character = @
@@ -120,6 +120,7 @@ typedef struct {
int stu8; /**< Flag: Special text uses UTF-8. */
int cofop; /**< Flag: Compat fill open paths. */
int lwauto; /**< Flag: Automatic line width. */
+ int ahbs; /**< Flag: Bisection for arrowheads. */
} f2l_job_t;
@@ -441,6 +442,8 @@ OPTIONS
ahms=<integer> Minimum number of X-spline segments for
each arrowhead edge. Default: 4
+
+ ahbs[=<boolean>] Use bisection iteration on spline arrowheads.
ahip=<float> Arrowhead iteration precision. Default: 0.04.
@@ -450,7 +453,7 @@ OPTIONS
codi=[<number>] Number of digits used for colors. Default: 3.
- Compatibilty options (compatibility to fig2dev):
+ Compatibility options (compatibility to fig2dev):
cosp[=<boolean>] Compatible splines.
@@ -573,7 +576,7 @@ SEE ALSO
X-Splines: A Spline Model Designed for the End-User
Proceedings of the SIGGRAPH 1995
-[fig2lat] http://dktools.sourceforge.net
+[fig2lat] http://sourceforge.net/p/dktools/wiki/fig2lat%20manual/
$!end
};
@@ -743,6 +746,14 @@ static dkChar const fig2lat_pref_psl[] = {
+/** Preference name for compatible splines.
+*/
+static dkChar const fig2lat_pref_cosp[] = {
+ dkT("/fig/compatible-splines")
+};
+
+
+
#if 0
/** Initialize a configuration structure.
@param conf Structure to initialize.
@@ -832,8 +843,8 @@ fig2lat_job_init(
job->exval = FIG2LAT_EXIT_ERROR_UNKNOWN;
job->mm = 0;
job->cmd = 0;
- job->cosp = 0;
- job->coah = 0;
+ job->cosp = dk3app_get_pref_bool(app, fig2lat_pref_cosp, 1);
+ job->coah = 0; $? ". cosp = %d", job->cosp
job->xsah = 0;
job->xssbs = 8;
job->qbs = 4;
@@ -860,6 +871,7 @@ fig2lat_job_init(
job->bbts = 0;
job->stu8 = 0;
job->cofop = 1;
+ job->ahbs = 0;
job->lwbp = 0.9; /* 1/80 inch */
job->lwauto = 0;
if(dk3app_get_encoding(app) == DK3_ENCODING_UTF8) {
@@ -905,7 +917,7 @@ fig2lat_job_end(f2l_job_t *job)
*/
static
void
-fig2lat_show_version(f2l_job_t *job)
+fig2lat_show_version(void)
{
dk3sf_initialize_stdout();
dk3sf_fputs(fig2lat_version[0], stdout);
@@ -920,7 +932,7 @@ fig2lat_show_version(f2l_job_t *job)
*/
static
void
-fig2lat_show_license(f2l_job_t *job)
+fig2lat_show_license(void)
{
dkChar const * const *ptr; /* Pointer to traverse all text lines. */
ptr = fig2lat_license;
@@ -1107,6 +1119,7 @@ fig2lat_run_for_file(f2l_job_t *job, dkChar const *fn)
dk3fig_set_options_iteration_precision(job->drw, job->xsprec);
dk3fig_set_options_codi(job->drw, job->codi);
dk3fig_set_options_cofop(job->drw, job->cofop);
+ dk3fig_set_options_ah_bisection(job->drw, job->ahbs);
if(dk3fig_read_file_name(job->drw, fn)) { $? ". drawing read"
if(dk3fig_prepare(job->drw)) { $? ". drawing prepared"
#if DK3_HAVE_SETLOCALE && defined(LC_NUMERIC) && DK3_HAVE_LOCALE_H
@@ -1471,10 +1484,10 @@ DK3_MAIN
testcmd = DK3_APP_CMD_HELP | DK3_APP_CMD_VERSION | DK3_APP_CMD_LICENSE;
if((job.cmd) & testcmd) { $? ". help version license"
if(job.cmd) { $? ". show version information"
- fig2lat_show_version(&job);
+ fig2lat_show_version();
}
if((job.cmd) & DK3_APP_CMD_LICENSE) { $? ". show license"
- fig2lat_show_license(&job);
+ fig2lat_show_license();
}
if((job.cmd) & DK3_APP_CMD_HELP) { $? ". show help text"
fig2lat_show_help(&job);
diff --git a/support/dktools/fig2lat.h b/support/dktools/fig2lat.h
index 7a0ecd9113..6f221888cc 100644
--- a/support/dktools/fig2lat.h
+++ b/support/dktools/fig2lat.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: fig2lat.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: fig2lat.ctr
*/
/** @file fig2lat.h Header file for the fig2lat module.
@@ -155,6 +133,7 @@ typedef struct {
int stu8; /**< Flag: Special text uses UTF-8. */
int cofop; /**< Flag: Compat fill open paths. */
int lwauto; /**< Flag: Automatic line width. */
+ int ahbs; /**< Flag: Bisection for arrowheads. */
} f2l_job_t;
diff --git a/support/dktools/fig2lat.rc b/support/dktools/fig2lat.rc
index ea406270ca..2899847832 100644
--- a/support/dktools/fig2lat.rc
+++ b/support/dktools/fig2lat.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Fig to LaTeX converter\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Fig to LaTeX converter\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "fig2lat\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/filelist.txt b/support/dktools/filelist.txt
index dad3dd1fde..6d84eb1081 100644
--- a/support/dktools/filelist.txt
+++ b/support/dktools/filelist.txt
@@ -1,7 +1,9 @@
README
INSTALL
+preview.txt
version.txt
dk4pref.conf
+sddm.conf.example
etc-dk3app/dk3paper.conf
addctrld.ctr
bmeps3.ctr
@@ -11,8 +13,8 @@ libdk4pppt.dox
config.h.in
configure
configure.ac
-configure.out
conf.vc
+uc2l.h
dk3all.h
dk3app.ctr
dk3appr.ctr
@@ -107,6 +109,7 @@ dk3trace.ctr
dk3types.h
dk3uc2l.ctr
dk3ufi.ctr
+dk3unused.h
dk3usewx.c
dk3wreg.ctr
dk3wxcs.h
@@ -744,6 +747,9 @@ dk4maixdui.cpt
dk4maixdul.cpt
dk4maixdus.cpt
dk4maoxdbl.cpt
+dk4mao8dns.ctr
+dk4mao8dns.c
+dk4mao8dns.h
dk4maoxd.cpt
dk4mao8d.c
dk4mao8d.ctr
@@ -775,6 +781,9 @@ dk4maci32.ctr
dk4mao8dbl.ctr
dk4maoddbl.ctr
dk4maowdbl.ctr
+dk4math.ctr
+dk4uc2la.ctr
+dk-lines.ctr
dk4papea.ctr
dk4paper.ctr
dk4serf.ctr
@@ -924,6 +933,7 @@ dk4rec23.ctr
dk4rec23.h
dk4rec24.ctr
dk4rec25.ctr
+dk4rec26.ctr
dk4rec.h
dk4recwx.cpt
dk4rld.ctr
@@ -965,7 +975,6 @@ dk4sock34.ctr
dk4sock35.ctr
dk4sock36.ctr
dk4sock37.ctr
-
dk4sock3.ctr
dk4socka01.ctr
dk4socka02.ctr
@@ -1207,7 +1216,6 @@ DkWxTraceApp.cpt
DkWxTraceFrame.wxc
dkwxtrace.h
DkWxTraceOptionsDialog.wxc
-DkWxTraceOptionsDialog.wxc.1
DkWxTraceThread.cpt
dkwxwiz.ctr
Doxyfile
@@ -1330,7 +1338,6 @@ test-dk4time08.ctr
test-dk4time.ctr
test-dk4tsp08.ctr
test-dk4user.ctr
-test-dk4wxah
test-dk4wxah.cpt
test-eradisk.ctr
test-filei.ctr
@@ -1394,6 +1401,38 @@ livesys-data/pkg_lang_base.txt
livesys-data/pkg_local.txt
livesys-data/hook_autologin.txt
livesys-data/hook_bootbeep.txt
+livesys-data/hook_jessie_autologin.txt
+livesys-data/hook_stretch_hybrid_autologin.sed
+livesys-data/hook_stretch_net_autologin.sed
+livesys-data/pkg_jessie_base.txt
+livesys-data/pkg_jessie_firmware.txt
+livesys-data/pkg_jessie_lang_base.txt
+livesys-data/pkg_jessie_lang_desktop.txt
+livesys-data/pkg_jessie_local.txt
+livesys-data/pkg_jessie_xfce.txt
+livesys-data/pkg_stretch_base.txt
+livesys-data/pkg_stretch_firmware_gr.txt
+livesys-data/pkg_stretch_firmware.txt
+livesys-data/pkg_stretch_lang_base.txt
+livesys-data/pkg_stretch_lang_desktop.txt
+livesys-data/pkg_stretch_local.txt
+livesys-data/pkg_stretch_xfce.txt
+livesys-data/gnome_dconf_profile_user.txt
+livesys-data/gnome_defaults.txt
+livesys-data/hook_stretch_grub_grub_cfg.sed
+livesys-data/hook_stretch_tftpboot_isolinux_live_cfg.sed
+livesys-data/msg_wifi.txt
+livesys-data/pkg_stretch_cinnamon.txt
+livesys-data/pkg_stretch_gnome.txt
+livesys-data/pkg_stretch_kde.txt
+livesys-data/pkg_stretch_lxde.txt
+livesys-data/pkg_stretch_lxqt.txt
+livesys-data/pkg_stretch_mate.txt
+livesys-data/root/usr/share/dktoolian/etc/dktoolian_done.conf
+livesys-data/sed_stretch_isolinux_menu.txt
+livesys-data/sed_stretch_login_grub.txt
+livesys-data/sed_stretch_login_iso.txt
+livesys-data/stretch_etc_files.txt
win32/dk3conf.h
win32/dk3wxcs.h
win32/dk4conf.h
@@ -1412,7 +1451,6 @@ scripts/create-desktop-files.sh.in
scripts/create-distribution.sh
scripts/create-iss.sed
scripts/create-spec-iss.sh
-scripts/distrenew.sh
scripts/filechk.pl
scripts/find-headers-without-modules.sh
scripts/git-add.sh
@@ -1420,13 +1458,13 @@ scripts/install-libs-shared.sh
scripts/install-libs-static.sh
scripts/install-mkdir.sh
scripts/install-programs.sh
+scripts/make-version.sh
scripts/mkrc.pl
scripts/transform-config.pl
scripts/update-doxyfile.sh
scripts/wr-dk3inst.sh.in
scripts/wr-dk4inst.sh
scripts/wr-dk4inst.sh.in
-
contrib/gs-fonts-svg/COPYING
contrib/gs-fonts-svg/crpfb.cmd
contrib/gs-fonts-svg/crpfb.sh
@@ -1438,12 +1476,17 @@ contrib/gs-fonts-svg/metadata.sed
contrib/gs-fonts-svg/pfb2svg.pe
contrib/gs-fonts-svg/README
contrib/README
-
dktools/charmap/currency-europe.t2l
dktools/charmap/dingbats.t2l
dktools/charmap/iso-latin-1.t2l
dktools/charmap/latin-extended-a.t2l
dktools/charmap/textsym.t2l
+dktools/charmap/latin-extended-additional.t2l
+dktools/charmap/latin-extended-b-phonetic-historic.t2l
+dktools/charmap/latin-extended-b-pinyin-diacritic-vowel.t2l
+dktools/charmap/latin-extended-b-vietnamese.t2l
+dktools/charmap/ligatures.t2l
+dktools/charmap/nicefrac.t2l
dktools/charmap/x.pl
dktools/de/bmpp.txt
dktools/de/dk3app.str
@@ -1470,6 +1513,8 @@ dktools/de/dk-fic.str
dktools/de/dk-fic.txt
dktools/de/dk-hex.str
dktools/de/dk-hex.txt
+dktools/de/dk-lines.str
+dktools/de/dk-lines.txt
dktools/de/dk-ls.str
dktools/de/dk-ls.txt
dktools/de/dknet4.str
@@ -1554,6 +1599,7 @@ dktools/en/dk-bmm.txt
dktools/en/dk-cat.txt
dktools/en/dk-fic.txt
dktools/en/dk-hex.txt
+dktools/en/dk-lines.txt
dktools/en/dk-ls.txt
dktools/en/dk-pwd.txt
dktools/en/dk-pwgen.txt
@@ -1588,7 +1634,6 @@ dktools/htmlbook/web.hbt
dktools/itadmin/it-de.sql
dktools/itadmin/it-latin1.sql
dktools/itadmin/it-utf8.sql
-
resources/choose-dir.fig
resources/dkclock.fig
resources/dkctinst.fig
@@ -1602,7 +1647,6 @@ resources/run-conversion.fig
resources/set-options.fig
resources/toolbase.fig
resources/wxdkscrsz.fig
-
help-src/winprint/de/chm.hbt
help-src/winprint/de/config-file.txt
help-src/winprint/de/de-lic-libjpeg.txt
@@ -1958,7 +2002,6 @@ help-src/wxdkfcs/en/style.css
help-src/wxdkfcs/en/toc.png
help-src/wxdkfcs/en/use.txt
help-src/wxdkfcs/en/web.hbt
-
help-src/wxdkscrsz/en/config-file.txt
help-src/wxdkscrsz/en/sc03.png
help-src/wxdkscrsz/en/home.png
@@ -2038,7 +2081,6 @@ help-src/wxdkscrsz/de/prev.png
help-src/wxdkscrsz/de/de-lic-libpng.txt
help-src/wxdkscrsz/de/project.xml
help-src/wxdkscrsz/de/favicon.ico
-
help-src/wximgsz/de/chm.hbt
help-src/wximgsz/de/de-lic-libjpeg.txt
help-src/wximgsz/de/de-lic-libpng.txt
@@ -2173,6 +2215,11 @@ test-deldirwc.ctr
test-sqdbl.ctr
test-strmw.ctr
test-unser.ctr
+test-bezbb.ctr
+test-clang.c
+test-dk4mao8dns.ctr
+test-dk4path.ctr
+test-dkchar.ctr
man/man5/htmlbook-text.5
man/man5/dkct.5
man/man5/htmlbook-template.5
@@ -2196,6 +2243,7 @@ man/man1/wxdkclock.1
man/man1/dk-t2db.1
man/man1/dk-dbco.1
man/man1/dk-ls.1
+man/man1/dk-lines.1
man/man1/printqdc.1
man/man1/htmlbook.1
man/man1/dkdbt.1
@@ -2231,8 +2279,6 @@ man/man1/wximgsz.1
man/man1/dk-pwd.1
man/man1/dk-t2l.1
config.guess
-debian-jessie-build-deb.sh
-debian-jessie-build-live.sh
pkginfo
aclocal.m4
sl6-build-rpm.sh
@@ -2281,6 +2327,8 @@ man-src/dk-dbco.1
man-src/dk-ls.1
man-src/bmpp.1.adoc
man-src/dk-fic.1.adoc
+man-src/dk-lines.1.adoc
+man-src/dk-lines.1
man-src/dk-pwgen.1.adoc
man-src/printqdc.1
man-src/dkct.5
@@ -2371,8 +2419,8 @@ man-src/printqd.protocol.5.adoc
dk-t2db.ctr
sl6-prepare.sh
dk4dbit8.ctr
-debian-jessie-prepare.sh
dk4dbit.ctr
+dk4unused.h
dk4wxcs.cross
install-sh
pkginfo.in
@@ -2410,6 +2458,12 @@ debian/dktools.cron.d.ex
debian/compat
debian/prerm.ex
debian/control
+debian/control8
+debian/dktools-lib-4.11-dev.install
+debian/dktools-lib-4.11.install
+debian/dktools-lib-4.11.lintian-overrides
+debian/dktools-lib-4.11.postinst
+debian/dktools-lib-4.11.postrm
debian/preinst.ex
debian/manpage.xml.ex
debian/dktools-doc.docs
@@ -2431,42 +2485,89 @@ debian/control.in
debian/dktools-lib.postrm.in
debian/dktools-lib.install.in
debian/dktools-lib-data.install
-debian/dktools-lib-4.8-dev.install
-debian/dktools-lib-4.8.install
-debian/dktools-lib-4.8.lintian-overrides
-debian/dktools-lib-4.8.postinst
-debian/dktools-lib-4.8.postrm
debian/dktools-data.install
-bankian-data/pkg_local.txt
-bankian-data/root-install-packages.sh
-bankian-data/pkg_base.txt
-bankian-data/pkg_lang_desktop.txt
-bankian-data/pkg_firmware.txt
-bankian-data/livesys-build-kernel.sh
-bankian-data/livesys-repository.sh
-bankian-data/pkg_xfce.txt
-bankian-data/msg_nonfree.txt
-bankian-data/patch_ata_dev_enabled.txt
-bankian-data/hook_bootbeep.txt
-bankian-data/pkg_lang_base.txt
-bankian-data/hook_etcfiles.txt
-bankian-data/apt-pinning.txt
-bankian-data/root/usr/share/bankian/etc-files.sed
-bankian-data/root/usr/share/bankian/etc/ntp.conf
-bankian-data/root/usr/local/bin/bankian-ntp
-bankian-data/root/usr/local/bin/bankian-etc
-bankian-data/root-create-repodir.sh
-debian-jessie-build-bankian.sh
+debian/control8.in
resources/splash-surfian.fig
resources/splash-bankian.fig
splash-bankian.png
splash-surfian.png
sf-readme/readme.md
-bankian-data/apt-bankian.txt
-bankian-data/apt-pin-kernel.txt
-bankian-data/root/usr/local/bin/bankian-update
-bankian-data/sed_isolinux.txt
-bankian-data/sed_menu.txt
-bankian-data/sed_nobeep.txt
LICENSE
.gitignore
+debian-build-deb.sh
+debian-build-dktoolian.sh
+debian-prepare.sh
+fc27-build-rpm.sh
+fc27-prepare.sh
+livesys-data/apt-disklessian-jessie.txt
+livesys-data/apt-disklessian-stretch.txt
+livesys-data/apt-no-lo-recommended.txt
+livesys-data/apt-pin-kernel.txt
+livesys-data/conf-gnome-dconf-profile-user.txt
+livesys-data/conf-gnome-defaults.txt
+livesys-data/livesys-build-kernel.sh
+livesys-data/livesys-repository.sh
+livesys-data/msg-nonfree.txt
+livesys-data/msg-wifi.txt
+livesys-data/pkg-disklessian-jessie-base.txt
+livesys-data/pkg-disklessian-jessie-cinnamon.txt
+livesys-data/pkg-disklessian-jessie-firmware.txt
+livesys-data/pkg-disklessian-jessie-gnome.txt
+livesys-data/pkg-disklessian-jessie-host.txt
+livesys-data/pkg-disklessian-jessie-kde.txt
+livesys-data/pkg-disklessian-jessie-lang-base.txt
+livesys-data/pkg-disklessian-jessie-lang-desktop.txt
+livesys-data/pkg-disklessian-jessie-libreoffice.txt
+livesys-data/pkg-disklessian-jessie-lxde.txt
+livesys-data/pkg-disklessian-jessie-mate.txt
+livesys-data/pkg-disklessian-jessie-xfce.txt
+livesys-data/pkg-disklessian-stretch-base.txt
+livesys-data/pkg-disklessian-stretch-cinnamon.txt
+livesys-data/pkg-disklessian-stretch-firmware-gr.txt
+livesys-data/pkg-disklessian-stretch-firmware.txt
+livesys-data/pkg-disklessian-stretch-gnome.txt
+livesys-data/pkg-disklessian-stretch-kde.txt
+livesys-data/pkg-disklessian-stretch-lang-base.txt
+livesys-data/pkg_disklessian-stretch-lang-desktop.txt
+livesys-data/pkg-disklessian-stretch-libreoffice.txt
+livesys-data/pkg-disklessian-stretch-lxde.txt
+livesys-data/pkg-disklessian-stretch-lxqt.txt
+livesys-data/pkg-disklessian-stretch-mate.txt
+livesys-data/pkg-disklessian-stretch-xfce.txt
+livesys-data/pkg-dislessian-stretch-host.txt
+livesys-data/pkg-dktoolian-jessie-base.txt
+livesys-data/pkg-dktoolian-jessie-cinnamon.txt
+livesys-data/pkg-dktoolian-jessie-firmware.txt
+livesys-data/pkg-dktoolian-jessie-gnome.txt
+livesys-data/pkg-dktoolian-jessie-host.txt
+livesys-data/pkg-dktoolian-jessie-kde.txt
+livesys-data/pkg-dktoolian-jessie-lang-base.txt
+livesys-data/pkg-dktoolian-jessie-lang-desktop.txt
+livesys-data/pkg-dktoolian-jessie-lxde.txt
+livesys-data/pkg-dktoolian-jessie-mate.txt
+livesys-data/pkg-dktoolian-jessie-xfce.txt
+livesys-data/pkg-dktoolian-stretch-base.txt
+livesys-data/pkg-dktoolian-stretch-cinnamon.txt
+livesys-data/pkg-dktoolian-stretch-firmware-gr.txt
+livesys-data/pkg-dktoolian-stretch-firmware.txt
+livesys-data/pkg-dktoolian-stretch-gnome.txt
+livesys-data/pkg-dktoolian-stretch-host.txt
+livesys-data/pkg-dktoolian-stretch-kde.txt
+livesys-data/pkg-dktoolian-stretch-lang-base.txt
+livesys-data/pkg-dktoolian-stretch-lang-desktop.txt
+livesys-data/pkg-dktoolian-stretch-lxde.txt
+livesys-data/pkg-dktoolian-stretch-lxqt.txt
+livesys-data/pkg-dktoolian-stretch-mate.txt
+livesys-data/pkg-dktoolian-stretch-xfce.txt
+livesys-data/root-create-repodir.sh
+livesys-data/root-install-packages.sh
+livesys-data/root/usr/share/dklivesys/templates/ntp.conf
+livesys-data/sed-isolinux-menu.txt
+livesys-data/sed-isolinux.txt
+livesys-data/sed-menu.txt
+livesys-data/sed-stretch-login-grub.txt
+livesys-data/sed-stretch-login-iso.txt
+man-help-src.tar.gz
+mklivesys.sh
+PKGBUILD.in
+sl7-prepare.sh
diff --git a/support/dktools/gra.h b/support/dktools/gra.h
new file mode 100644
index 0000000000..11e8a364cb
--- /dev/null
+++ b/support/dktools/gra.h
@@ -0,0 +1,3228 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef GRA_H_INCLUDED
+/** Protection against multiple inclusions.
+*/
+#define GRA_H_INCLUDED 1
+
+/** @file gra.h Library-internal function prototypes.
+
+This header contains data types and functions used cross-module within
+the library but not part of the API and thus not intended for use by a
+library consumer.
+
+Consequently this file is not installed to /usr/include or some similar
+directory.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4MEMBUF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4membuf.h"
+#else
+#include <dktools-4/dk4membuf.h>
+#endif
+#endif
+
+#ifndef DK4MEMBS_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4membs.h"
+#else
+#include <dktools-4/dk4membs.h>
+#endif
+#endif
+
+#ifndef DK4UFIT_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4ufit.h"
+#else
+#include <dktools-4/dk4ufit.h>
+#endif
+#endif
+
+#ifndef DK4BITSH_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4bitsh.h"
+#else
+#include <dktools-4/dk4bitsh.h>
+#endif
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4gra.h"
+#else
+#include <dktools-4/dk4gra.h>
+#endif
+#endif
+
+
+/** Circle approximation by 4 Bezier spline segments.
+*/
+#define KAPPA_4 0.5522847498307943
+
+
+/** Circle approximation by 8 Bezier spline segments.
+*/
+#define KAPPA_8 0.2652164898395453
+
+
+/** Color specification in RGB color space.
+*/
+typedef struct {
+ double r; /**< Red. */
+ double g; /**< Green. */
+ double b; /**< Blue. */
+} dk4_gra_col_rgb_t;
+
+
+/** Color specification in CMYK color space.
+*/
+typedef struct {
+ double c; /**< Cyan. */
+ double m; /**< Magenta. */
+ double y; /**< Yellow. */
+ double k; /**< Black. */
+} dk4gra_col_cmyk_t;
+
+
+/** Union of colors in all supported color spaces.
+*/
+typedef union {
+ double gray; /**< Gray value. */
+ dk4_gra_col_rgb_t rgb; /**< Color specified in RGB. */
+ dk4gra_col_cmyk_t cmyk; /**< Color specified in CMYK. */
+} dk4gra_col_all_t;
+
+
+/** Colors specified by user or active.
+*/
+typedef struct {
+ dk4gra_col_all_t data; /**< Color data. */
+ int what; /**< Specified color type. */
+} dk4gra_col_t;
+
+
+/** Values for what component in dk4gra_col_t structure.
+*/
+enum {
+ DK4_GRA_COL_SPEC_NONE = 0, /**< No color specified yet. */
+ DK4_GRA_COL_SPEC_GRAY , /**< Gray specified. */
+ DK4_GRA_COL_SPEC_RGB , /**< RGB specified. */
+ DK4_GRA_COL_SPEC_CMYK /**< CMYK specified. */
+};
+
+
+/** Compression/encoding combinations for bitmap images.
+*/
+enum {
+ DK4_GRA_COE_DCT_ASCII85 = 0 ,
+ DK4_GRA_COE_FLATE_ASCII85 ,
+ DK4_GRA_COE_LZW_ASCII85 ,
+ DK4_GRA_COE_RUNLENGTH_ASCII85 ,
+ DK4_GRA_COE_ASCII85
+};
+
+
+/** Saved and current graphics attributes.
+ For each attribute there is the active value value currently set
+ in the data stream and a requested value to use for the next
+ graphics elements.
+ When preparing for an element (i.e. to stroke a line) and
+ the active value differs from the requested value (i.e. stroke color),
+ we have activate the requested value in the preparation function
+ before starting to construct the path.
+*/
+typedef struct {
+ dk4gra_col_t col_stroke_active; /**< Current (stroke) color. */
+ dk4gra_col_t col_fill_active; /**< Current fill color. */
+ dk4gra_col_t col_stroke_requested; /**< Requested stroke color. */
+ dk4gra_col_t col_fill_requested; /**< Requested fill color. */
+ double lw_active; /**< Active line width. */
+ double lw_requested; /**< Requested line width. */
+ double sv_active; /**< Active style value. */
+ double sv_requested; /**< Requested style value. */
+ double ml_active; /**< Active miter limit. */
+ double ml_requested; /**< Requested miter limit. */
+ int lc_active; /**< Active line cap. */
+ int lc_requested; /**< Requested line cap. */
+ int lj_active; /**< Active line join. */
+ int lj_requested; /**< Requested line join. */
+ int ls_active; /**< Active line style. */
+ int ls_requested; /**< Requested line style. */
+ int eor_active; /**< Active even-odd-rule flag. */
+ int eor_requested; /**< Requested even-odd-rule. */
+} dk4gra_attributes_t;
+
+
+/** PS/EPS page.
+ All graphics instructions go through the memory stream into the
+ memory buffer first.
+ When writing the output file, we might want to place other
+ contents - i.e. document structuring comments - before and after
+ the page contents.
+*/
+typedef struct {
+ dk4gra_attributes_t attr; /**< Graphics attributes. */
+ dk4gra_attributes_t catt; /**< Copy of graphics attributes. */
+ dk4_membuf_t *membuf; /**< Memory buffer. */
+ dk4_stream_t *memstrm; /**< Stream writing to mem buffer. */
+ unsigned char patu[DK4_GRA_PATTERN_MAX+1]; /**< Pat used. */
+ size_t pageno; /**< Page number. */
+ int spip; /**< Flag: Showpage in image proc */
+ int cont; /**< Flag: Already contents on page. */
+ int flags; /**< Page flags. */
+} dk4_gra_ps_page_t;
+
+
+
+/** Image XObject type.
+ When including a bitmap image multiple times, we reuse the
+ XObject to save memory.
+*/
+typedef struct {
+ dk4_ufi_t ufi; /**< Unique file identifier. */
+ const dkChar *fn; /**< File name. */
+ dk4_membuf_t *i_mb; /**< Image data. */
+ dk4_membuf_t *m_mb; /**< Mask data. */
+ size_t fno; /**< Frame number. */
+ size_t objno; /**< Object number for image itself. */
+ size_t mobjno; /**< Object number for mask (0=unused). */
+ size_t unxon; /**< Unnamed XObject number. */
+ dk4_bif_dim_t width; /**< Image width (number of pixels). */
+ dk4_bif_dim_t height; /**< Image height (number of pixels). */
+ int dct; /**< Flag: Stored in DCTDecode. */
+ int ipol; /**< Flag: Interpolation used. */
+ int cs; /**< Color space. */
+ int hufi; /**< Flag: Valid UFI. */
+ int deci; /**< Flag: Decoding inverted. */
+ dk4_px_bit_depth_t bpc; /**< Number of bits per component. */
+} dk4_gra_pdf_img_xo_t;
+
+
+
+/** PDF page.
+ Page contents is stored in a memory buffer named membuf.
+ The memstrm stream provides a stream API to write to the buffer.
+ Graphics instructions are written to the compressing stream costrm,
+ which flate-compresses the data and writes to memstrm which in turn
+ writes to membuf.
+*/
+typedef struct {
+ dk4gra_attributes_t attr; /**< Graphics attributes. */
+ dk4gra_attributes_t catt; /**< Copy of graphics attributes. */
+ dk4_membuf_t *membuf; /**< Memory buffer. */
+ dk4_stream_t *memstrm; /**< Stream writing to mem buffer. */
+ dk4_stream_t *costrm; /**< Compressed stream. */
+ dk4_stream_t *outstrm; /**< Output stream to use. */
+ dk4_sto_t *s_uxo; /**< Used XObjects container. */
+ dk4_sto_it_t *i_uxo; /**< Used XObjects iterator. */
+ size_t pageno; /**< Page number. */
+ size_t objno; /**< Object number. */
+ int flags; /**< Flags specified when opening. */
+} dk4_gra_pdf_page_t;
+
+
+
+/** PGF image file.
+*/
+typedef struct {
+ dk4_ufi_t ufi; /**< Unique file identifier. */
+ dkChar *fn; /**< File name. */
+ size_t imgno; /**< Image number, 0 for first image. */
+ int hufi; /**< Flag: Valid UFI. */
+ int intp; /**< Flag: Image interpolation. */
+} dk4_gra_pgf_img_no_t;
+
+
+
+/** PGF page.
+ Page contents is written through the memory stream into the
+ memory buffer.
+ When writing the output file we place additional contents before
+ and after the buffered contents (i.e. font definitions and
+ image declarations).
+*/
+typedef struct {
+ dk4gra_attributes_t attr; /**< Graphics attributes. */
+ dk4gra_attributes_t catt; /**< Copy of graphics attributes. */
+ dk4_membuf_t *membuf; /**< Memory buffer. */
+ dk4_stream_t *memstrm; /**< Stream writing to mem buffer. */
+ size_t pageno; /**< Page number. */
+ int flags; /**< Page flags. */
+} dk4_gra_pgf_page_t;
+
+
+
+/** Store one preamble line.
+*/
+typedef struct {
+ char *text; /**< Line text. */
+ size_t lineno; /**< Line number. */
+} dk4_gra_preamble_line_t;
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ Module dk4grat - Graphics tool functions for all output drivers
+ ---------------------------------------------------------------
+*/
+
+/** Open output structure and initialize base components.
+ Note: s_pages and i_pages are not initialized, the dr component
+ is set to PDF.
+ @param fn Output file name.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flag set.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new output structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating memory size to allocate,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation failed.
+*/
+
+dk4_gra_t *
+dk4gratool_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+);
+
+
+/** Close output structure, release memory.
+ @param gptr Output structure to close.
+*/
+
+void
+dk4gratool_close(
+ dk4_gra_t *gptr
+);
+
+
+/** Initialize attributes set.
+ @param pattr Attributes set to initialize.
+*/
+
+void
+dk4gratool_initialize_attributes(
+ dk4gra_attributes_t *pattr
+);
+
+
+/** Reset active attributes after grestore operation.
+ @param pattr Attributes set to reset.
+*/
+
+void
+dk4gratool_reset_active_attributes(
+ dk4gra_attributes_t *pattr
+);
+
+
+/** Set a color.
+ @param pcol Color to set up.
+ @param colsp Color space.
+ @param c1 First component (gray, red or cyan).
+ @param c2 Second component (green or magenta).
+ @param c3 Third component (blue or yellow).
+ @param c4 Fourth component (black).
+*/
+void
+dk4gratool_set_color_requested(
+ dk4gra_col_t *pcol,
+ int colsp,
+ double c1,
+ double c2,
+ double c3,
+ double c4
+);
+
+
+/** Compare two colors.
+ @param p1 First color.
+ @param p2 Second color.
+ @return 1 if the colors differ, 0 otherwise.
+*/
+
+int
+dk4gratool_colors_differ(
+ dk4gra_col_t *p1,
+ dk4gra_col_t *p2
+);
+
+
+/** Check whether two line styles differ.
+ @param ls_a Active line style.
+ @param ls_r Requested line style.
+ @param sv_a Active style value (dash length in bp).
+ @param sv_r Requested style value.
+ @param lwc Flag: Line width was changed.
+ @return 1 if the line style setup must be written, 0 otherwise.
+*/
+
+int
+dk4gratool_line_style_differs(
+ int ls_a,
+ int ls_r,
+ double sv_a,
+ double sv_r,
+ int lwc
+);
+
+
+/** Calculate coordinates systems transformations.
+ @param dst Destination array consisting of 5 elements:
+ - x translation,
+ - y translation,
+ - rotation counterclockwise in degree,
+ - x scale factor (resulting image width) and
+ - y scale factor (resulting image height).
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param kar Flag: Keep aspect ratio.
+ @param pos Positioning choice.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if coordinates are incorrect or image dimensions are not positive,
+ - DK4_E_MATH_OVERFLOW<br>
+ if a numeric problem occured in calculations.
+*/
+
+int
+dk4gratool_calculate_transformations(
+ double *dst,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double w,
+ double h,
+ int kar,
+ int pos,
+ dk4_er_t *erp
+);
+
+
+/** Write char string to output stream.
+ @param os Output stream.
+ @param str String to write.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+void
+dk4gratool_stream_string(
+ dk4_stream_t *os,
+ const char *str,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Write double value to stream without scientific notation.
+ @param os Output stream.
+ @param val Value to write.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if os is NULL.
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+
+void
+dk4gratool_stream_double(
+ dk4_stream_t *os,
+ double val,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Write unsigned integer value to stream.
+ @param os Output stream.
+ @param val Value to write.
+ @param padsz Required minimum string size, 0 for no minimum.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if os is NULL,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
+*/
+
+void
+dk4gratool_stream_uint(
+ dk4_stream_t *os,
+ dk4_um_t val,
+ size_t padsz,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Retrieve a bit value.
+ @param i Bit index (0 to 11, 0 is least significant bit).
+ @return Bit value.
+*/
+
+dk4_px_t
+dk4gratool_bit(
+ size_t i
+);
+
+
+/** Write a pixel component value to compressed/encoded stream.
+ @param strm Stream to write to.
+ @param bs Bit shifter to use.
+ @param pixval Value to write.
+ @param bpc Number of bits in value.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if strm is NULL or not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flusing data downwards failed.
+*/
+
+void
+dk4gratool_put_pixel_value(
+ dk4_stream_t *strm,
+ dk4_bit_shift_t *bs,
+ dk4_px_t pixval,
+ dk4_px_bit_depth_t bpc,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Write start of standalone document
+ @param ostrm Output stream.
+ @param gra Graphics output structure.
+ @param pgf Flag: Produce PGF, include pgfcore package.
+ @param dfs Document font size (negative to use default).
+ @param s_f Storage for font setup lines.
+ @param i_f Iterator for font setup lines.
+ @param s_p Storage for package lines.
+ @param i_p Iterator for package lines.
+ @param s_o Storage for other lines.
+ @param i_o Iterator for other lines.
+ @param bptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+void
+dk4gratool_start_standalone_document(
+ dk4_stream_t *ostrm,
+ dk4_gra_t *gra,
+ int pgf,
+ double dfs,
+ dk4_sto_t *s_f,
+ dk4_sto_it_t *i_f,
+ dk4_sto_t *s_p,
+ dk4_sto_it_t *i_p,
+ dk4_sto_t *s_o,
+ dk4_sto_it_t *i_o,
+ int *bptr,
+ dk4_er_t *erp
+);
+
+/** Write end of standalone document
+ @param ostrm Output stream.
+ @param bptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+void
+dk4gratool_end_standalone_document(
+ dk4_stream_t *ostrm,
+ int *bptr,
+ dk4_er_t *erp
+);
+
+/** Write font number as unique name.
+ @param os Stream to write to.
+ @param val Value to write.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+void
+dk4gratool_stream_num_alpha(
+ dk4_stream_t *os,
+ size_t val,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Write instruction to change color to stream.
+ @param os Output stream.
+ @param col Color to write.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if os is NULL.
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters.
+*/
+void
+dk4gratool_stream_color(
+ dk4_stream_t *os,
+ dk4gra_col_t const *col,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+/** Write font definitions from font collector to stream.
+ @param ostrm Output stream.
+ @param fontc Font collector to write.
+ @param bptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing
+ or if input contains invalid characters,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.<br>
+*/
+void
+dk4gratool_font_definitions(
+ dk4_stream_t *ostrm,
+ dk4_font_collector_t *fontc,
+ int *bptr,
+ dk4_er_t *erp
+);
+
+/** Create preamble line structure for given text line and line number.
+ @param textline Text line to store.
+ @param lineno Line number.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+dk4_gra_preamble_line_t *
+dk4gratool_preamble_new(
+ char const *textline,
+ size_t lineno,
+ dk4_er_t *erp
+);
+
+/** Destroy preamble line structure, release ressources.
+ @param ptr Structure to destroy.
+*/
+void
+dk4gratool_preamble_delete(
+ dk4_gra_preamble_line_t *ptr
+);
+
+/** Compare two preamble line structures.
+ @param l Left structure.
+ @param r Right structure.
+ @param cr Comparison criteria, ignored.
+ @return Comparison result: 1=l>l, 0=l==r, -1=l<r.
+*/
+int
+dk4gratool_compare_preamble_lines(
+ void const *l,
+ void const *r,
+ int cr
+);
+
+/*
+ Module dk4gra - General graphics module, library internal functions
+ -------------------------------------------------------------------
+*/
+
+/** Save current graphics state (especially clip path).
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Restore graphics state (especially clip path).
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ @param gra Output structure.
+ @param res Flag: Reset attributes.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_grestore(
+ dk4_gra_t *gra,
+ int res,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a fill operation.
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ Use this function before you start to construct a path you plan to fill.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_prepare_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a stroke operation.
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ Use this function before you start to construct a path you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_prepare_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a combined fill and stroke operation.
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Fill current path.
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ Note: Use dk4gra_prepare_fill() before you start to construct a path
+ you plan to fill.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_fill(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Stroke current path.
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ Note: Use dk4gra_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+
+/** Fill and stroke current path.
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ Note: Use dk4gra_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_fill_and_stroke(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Use current path for clipping.
+ This function does not check arguments, it is intended for
+ library-internal use from functions having done the checks!
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_clip(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Start a new path and move to first point.
+ No argument checking, for internal use (pattern filling) only.
+ @param gra Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add line from current point to new point to path.
+ No argument checking, for internal use (pattern filling) only.
+ @param gra Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add Bezier curve segment from current point to new point in path.
+ No argument checking, for internal use (pattern filling) only.
+ @param gra Output structure.
+ @param x1c X coordinate of first control point.
+ @param y1c Y coordinate of first control point.
+ @param x2c X coordinate of second control point.
+ @param y2c Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Close current path.
+ No argument checking, for internal use (pattern filling) only.
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_closepath(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for a circle.
+ No argument checking, for internal use (pattern filling) only.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ No argument checking, for internal use (pattern filling) only.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Add path for an arc.
+ No argument checking, for internal use (pattern filling) only.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Create path for an ellipse.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param rx Radius in x direction.
+ @param ry Radius in y direction.
+ @param rot Rotation counterclockwise in radians.
+ @param bbptr Bounding box, may be NULL.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this operation.
+*/
+
+void
+dk4gra_i_ellipse(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double rx,
+ double ry,
+ double rot,
+ dk4_bb_t *bbptr,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Pattern a region (clipping should be set to the path).
+ @param gra Output structure.
+ @param xl Left y coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param pn Pattern number.
+ @param val Pre-calculated coordinates.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+void
+dk4gra_i_pattern(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ int pn,
+ const double *val,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/*
+ Module dk4greps - EPS output module
+ -----------------------------------
+*/
+
+/** Open output structure to create a PS or EPS file.
+ @param fn File name for output file.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param docfl Document flag set.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating object sizes in memory,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+
+dk4_gra_t *
+dk4gra_eps_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+);
+
+
+/** Close output structure without writing an output file.
+ @param gra Output structure.
+*/
+void
+dk4gra_eps_close(
+ dk4_gra_t *gra
+);
+
+
+/** Write output file and close output structure.
+ @param fout Output file.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flusing data downwards failed.
+*/
+
+int
+dk4gra_eps_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Start new page.
+ @param gra Output structure.
+ @param flags Flags for new page.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL.
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating the product of elsize and nelem,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+
+int
+dk4gra_eps_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics state (especially clip path).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL o not in a state allowing this
+ operation,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+int
+dk4gra_eps_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Restore graphics state (especially clip path).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this
+ operation,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+int
+dk4gra_eps_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Set line width.
+ @param gra Output structure.
+ @param lw Line width in bp.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if gra is NULL or not in a state allowing this
+ operation,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+int
+dk4gra_eps_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+);
+
+
+/** Set line style.
+ @param gra Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+);
+
+
+/** Set line cap.
+ @param gra Output structure.
+ @param lc Line cap type.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+);
+
+
+/** Set line join.
+ @param gra Output structure.
+ @param lj Line join type.
+ @param ml Miter limit.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+);
+
+
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Fill current path.
+ Note: Use dk4gra_eps_prepare_fill() before you start to construct a path
+ you plan to fill.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Stroke current path.
+ Note: Use dk4gra_eps_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+
+/** Use current path for clipping.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Pattern a region (clipping should be set to the path).
+ @param gra Output structure.
+ @param pn Pattern number.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_pattern(
+ dk4_gra_t *gra,
+ int pn,
+ double *xval,
+ dk4_er_t *erp
+);
+
+
+/** Start a new path and move to first point.
+ @param gra Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Add line from current point to new point to path.
+ @param gra Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param gra Output structure.
+ @param x1c X coordinate of first control point.
+ @param y1c Y coordinate of first control point.
+ @param x2c X coordinate of second control point.
+ @param y2c Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Close current path.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+
+/** Create path for a circle.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_er_t *erp
+);
+
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_er_t *erp
+);
+
+
+/** Add path for an arc.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+
+int
+dk4gra_eps_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image.
+ @param gra Output structure.
+ @param cotra Coordinates transformation values.
+ @param bif Bitmap image.
+ @param fn Bitmap image file name.
+ @param fno Frame number.
+ @param ifl Image flags.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_eps_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ int ifl,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics states attributes to internal copy.
+ @param gra Output structure.
+*/
+
+void
+dk4gra_eps_save_attributes(
+ dk4_gra_t *gra
+);
+
+
+/** Restore current graphics states attributes from internal copy.
+ @param gra Output structure.
+*/
+
+void
+dk4gra_eps_restore_attributes(
+ dk4_gra_t *gra
+);
+
+
+/** Reset used attributes.
+ @param gra Output structure.
+*/
+void
+dk4gra_eps_reset_attributes(
+ dk4_gra_t *gra
+);
+
+
+/*
+ Module dk4grpgf - PDF output module
+ -----------------------------------
+*/
+
+/** Open output structure to create a PS or EPS file.
+ @param fn File name for output file.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param eps Flag: Produce EPS.
+ @return Valid pointer to new structure on success, NULL on error.
+*/
+
+dk4_gra_t *
+dk4gra_pdf_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ dk4_er_t *erp
+);
+
+
+/** Close output structure without writing an output file.
+ @param gra Output structure.
+*/
+void
+dk4gra_pdf_close(
+ dk4_gra_t *gra
+);
+
+
+/** Write output file and close output structure.
+ @param fout Output file.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Start new page.
+ @param gra Output structure.
+ @param flags Flags for new page.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics state (especially clip path).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics state (especially clip path).
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4gra_pdf_i_gsave(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Restore graphics state (especially clip path).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Restore graphics state (especially clip path).
+ @param gra Output structure.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4gra_pdf_i_grestore(
+ dk4_gra_t *gra,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Set line width.
+ @param gra Output structure.
+ @param lw Line width in bp.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+);
+
+
+/** Set line style.
+ @param gra Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+);
+
+
+/** Set line cap.
+ @param gra Output structure.
+ @param lc Line cap type.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+);
+
+
+/** Set line join.
+ @param gra Output structure.
+ @param lj Line join type.
+ @param ml Miter limit.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+);
+
+
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+
+/** Fill current path.
+ Note: Use dk4gra_pdf_prepare_fill() before you start to construct a path
+ you plan to fill.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Stroke current path.
+ Note: Use dk4gra_pdf_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_pdf_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Use current path for clipping.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Start a new path and move to first point.
+ @param gra Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Add line from current point to new point to path.
+ @param gra Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param gra Output structure.
+ @param x1c X coordinate of first control point.
+ @param y1c Y coordinate of first control point.
+ @param x2c X coordinate of second control point.
+ @param y2c Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Close current path.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_er_t *erp
+);
+
+
+/** Add path for an arc.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param ra Radius.
+ @param start Start angle in degree.
+ @param end End angle in degree.
+ @param cl Flag: Draw closed arc (piece of cake) instead of simple arc.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+
+int
+dk4gra_pdf_arc(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double ra,
+ double start,
+ double end,
+ int cl,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image.
+ @param gra Output structure.
+ @param cotra Coordinates transformation values.
+ @param bif Bitmap image.
+ @param fn Bitmap image file name.
+ @param fno Frame number.
+ @param ifl Image flags.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pdf_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ size_t fno,
+ int ifl,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics states attributes to internal copy.
+ @param gra Output structure.
+*/
+
+void
+dk4gra_pdf_save_attributes(
+ dk4_gra_t *gra
+);
+
+
+/** Restore current graphics states attributes from internal copy.
+ @param gra Output structure.
+*/
+
+void
+dk4gra_pdf_restore_attributes(
+ dk4_gra_t *gra
+);
+
+
+/** Reset used attributes.
+ @param gra Output structure.
+*/
+void
+dk4gra_pdf_reset_attributes(
+ dk4_gra_t *gra
+);
+
+
+/** Write one static keyword to stream.
+ @param os Output stream to write to.
+ @param kwi Index of keyword in dk4_gra_pdf_c8_kw array.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4gra_pdf_i_outstream_kw(
+ dk4_stream_t *os,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Write a number of values and one static keyword to stream.
+ @param os Output stream to write to.
+ @param da Values array.
+ @param szda Size of da (number of elements).
+ @param kwi Index of keyword in dk4_gra_pdf_c8_kw array.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+*/
+
+void
+dk4gra_pdf_i_values_and_kw(
+ dk4_stream_t *os,
+ double *da,
+ size_t szda,
+ size_t kwi,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+
+/** Compare two used XObject entries by object number.
+ This function is used to build the storage sorted by object
+ numbers.
+ @param l Left object.
+ @param r Right object.
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+*/
+int
+dk4gra_pdf_compare_used_xo(
+ const void *l,
+ const void *r,
+ int cr
+);
+
+
+/** Destroy XObject structure, release resources.
+ @param puxo XObject structure to destroy.
+*/
+
+void
+dk4gra_pdf_xo_delete(
+ dk4_gra_pdf_img_xo_t *puxo
+);
+
+
+/*
+ Module dk4grpgf - PGF output module
+ -----------------------------------
+*/
+
+/** Open output structure to create a PS or EPS file.
+ @param fn File name for output file.
+ @param w Image width in bp.
+ @param h Image height in bp.
+ @param sa Flag: Produce standalone TeX file.
+ @param erp Error report, may be NULL.
+ @return Valid pointer to new structure on success, NULL on error.
+
+ Error codes:
+ - DK4_E_MATH_OVERFLOW<br>
+ on numeric overflow when calculating memory size to allocate,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ if a memory allocation failed.
+*/
+
+dk4_gra_t *
+dk4gra_pgf_open(
+ const dkChar *fn,
+ size_t w,
+ size_t h,
+ int docfl,
+ int sa,
+ dk4_er_t *erp
+);
+
+
+/** Close output structure without writing an output file.
+ @param gra Output structure.
+*/
+void
+dk4gra_pgf_close(
+ dk4_gra_t *gra
+);
+
+
+/** Write output file and close output structure.
+ @param fout Output file.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is insufficient,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_CLOSE_FAILED<br>
+ if closing downward data failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values,<br>
+ - DK4_E_SYNTAX<br>
+ if input contains invalid characters,
+ - DK4_E_BUFFER_TOO_SMALL<br>
+ if the destination buffer size is too small for the result,
+ - DK4_E_BUG<br>
+ if an internal buffer is too small (should not happen).
+*/
+
+int
+dk4gra_pgf_write_file_and_close(
+ FILE *fout,
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Start new page.
+ @param gra Output structure.
+ @param flags Flags for new page.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_MATH_OVERFLOW<br>
+ if there are too many pages in the graphics or there is a numeric
+ overflow in allocation size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if there is not enough memory
+ available.
+*/
+
+int
+dk4gra_pgf_page(
+ dk4_gra_t *gra,
+ int flags,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics state (especially clip path).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+int
+dk4gra_pgf_gsave(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Restore graphics state (especially clip path).
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed.
+*/
+
+int
+dk4gra_pgf_grestore(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Set line width.
+ @param gra Output structure.
+ @param lw Line width in bp.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_line_width(
+ dk4_gra_t *gra,
+ double lw,
+ dk4_er_t *erp
+);
+
+
+/** Set line style.
+ @param gra Output structure.
+ @param ls Line style.
+ @param sv Style value (dash length in bp).
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_line_style(
+ dk4_gra_t *gra,
+ int ls,
+ double sv,
+ dk4_er_t *erp
+);
+
+
+/** Set line cap.
+ @param gra Output structure.
+ @param lc Line cap type.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_line_cap(
+ dk4_gra_t *gra,
+ int lc,
+ dk4_er_t *erp
+);
+
+
+/** Set line join.
+ @param gra Output structure.
+ @param lj Line join type.
+ @param ml Miter limit.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if any argument is invalid.
+*/
+
+int
+dk4gra_pgf_set_line_join(
+ dk4_gra_t *gra,
+ int lj,
+ double ml,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_fill_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_fill_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+);
+
+
+/** Set fill color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_fill_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to gray.
+ @param gra Output structure.
+ @param g Gray value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_stroke_gray(
+ dk4_gra_t *gra,
+ double g,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to RGB.
+ @param gra Output structure.
+ @param r Red value in interval 0 to 1.
+ @param g Green value in interval 0 to 1.
+ @param b Blue value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_stroke_rgb(
+ dk4_gra_t *gra,
+ double r,
+ double g,
+ double b,
+ dk4_er_t *erp
+);
+
+
+/** Set stroke color to CMYK.
+ @param gra Output structure.
+ @param c Cyan value in interval 0 to 1.
+ @param m Magenta value in interval 0 to 1.
+ @param y Yellow value in interval 0 to 1.
+ @param k Black value in interval 0 to 1.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ - DK4_E_SYNTAX<br>
+ on internal errors.
+*/
+
+int
+dk4gra_pgf_set_stroke_cmyk(
+ dk4_gra_t *gra,
+ double c,
+ double m,
+ double y,
+ double k,
+ dk4_er_t *erp
+);
+
+
+
+/** Prepare output structure for a fill operation.
+ Use this function before you start to construct a path you plan to fill.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_prepare_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a stroke operation.
+ Use this function before you start to construct a path you plan to stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_prepare_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Prepare output structure for a combined fill and stroke operation.
+ Use this function before you start to construct a path you plan to
+ fill and stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_prepare_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+
+/** Fill current path.
+ Note: Use dk4gra_pgf_prepare_fill() before you start to construct a path
+ you plan to fill.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_fill(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Stroke current path.
+ Note: Use dk4gra_pgf_prepare_stroke() before you start to construct a path
+ you plan to stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Fill and stroke current path.
+ Note: Use dk4gra_pgf_prepare_fill_and_stroke() before you start to construct
+ a path you plan to fill and stroke.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_fill_and_stroke(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Use current path for clipping.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_clip(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+/** Start a new path and move to first point.
+ @param gra Output structure.
+ @param x X coordinate of start point.
+ @param y Y coordinate of start point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_newpath_moveto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Add line from current point to new point to path.
+ @param gra Output structure.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_lineto(
+ dk4_gra_t *gra,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Add Bezier curve segment from current point to new point in path.
+ @param gra Output structure.
+ @param x1c X coordinate of first control point.
+ @param y1c Y coordinate of first control point.
+ @param x2c X coordinate of second control point.
+ @param y2c Y coordinate of second control point.
+ @param x X coordinate of new point.
+ @param y Y coordinate of new point.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_curveto(
+ dk4_gra_t *gra,
+ double xc1,
+ double yc1,
+ double xc2,
+ double yc2,
+ double x,
+ double y,
+ dk4_er_t *erp
+);
+
+
+/** Close current path.
+ @param gra Output structure.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_closepath(
+ dk4_gra_t *gra,
+ dk4_er_t *erp
+);
+
+
+
+/** Create path for a circle.
+ @param gra Output structure.
+ @param xc Center point x coordinate.
+ @param yc Center point y coordinate.
+ @param r Radius.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_SYNTAX<br>
+ on internal errors,
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if str is NULL or the stream is not opened for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_circle(
+ dk4_gra_t *gra,
+ double xc,
+ double yc,
+ double r,
+ dk4_er_t *erp
+);
+
+
+/** Create path for rectangle parallel to axes, optionally with
+ rounded corners.
+ @param gra Output structure.
+ @param xl Left x coordinate.
+ @param xr Right x coordinate.
+ @param yb Bottom y coordinate.
+ @param yt Top y coordinate.
+ @param r Corner radius, maximum is a half of the smaller side length.
+ Use negative values to avoid rounded corners.
+ @param bbptr Bounding box, may be NULL.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ on internal errors, if str is NULL or the stream is not opened
+ for writing,
+ - DK4_E_WRITE_FAILED<br>
+ if writing one ore multiple bytes to the stream failed,
+ - DK4_E_FLUSH_FAILED<br>
+ if flushing data downwards failed,
+ - DK4_E_MATH_OVERFLOW<br>
+ if the exponent is out of range for integer values.
+*/
+
+int
+dk4gra_pgf_rectangle(
+ dk4_gra_t *gra,
+ double xl,
+ double xr,
+ double yb,
+ double yt,
+ double r,
+ dk4_er_t *erp
+);
+
+
+/** Add bitmap image.
+ @param gra Output structure.
+ @param cotra Coordinates transformation values.
+ @param bif Bitmap image.
+ @param fn Bitmap image file name.
+ @param ifl Image flags.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+dk4gra_pgf_bif_fig_image(
+ dk4_gra_t *gra,
+ double *cotra,
+ dk4_bif_t *bif,
+ const dkChar *fn,
+ int ifl,
+ dk4_er_t *erp
+);
+
+
+/** Save current graphics states attributes to internal copy.
+ @param gra Output structure.
+*/
+
+void
+dk4gra_pgf_save_attributes(
+ dk4_gra_t *gra
+);
+
+
+/** Restore current graphics states attributes from internal copy.
+ @param gra Output structure.
+*/
+
+void
+dk4gra_pgf_restore_attributes(
+ dk4_gra_t *gra
+);
+
+
+/** Reset used attributes.
+ @param gra Output structure.
+*/
+void
+dk4gra_pgf_reset_attributes(
+ dk4_gra_t *gra
+);
+
+/** Close image record, release resources.
+ @param imgptr Image record to close.
+*/
+void
+dk4gra_pgf_img_close(dk4_gra_pgf_img_no_t *imgptr);
+
+/** Create image record, allocate resources.
+ @param fn File name for image file.
+ @param imgno Image number.
+ @param ii Flag: Use image interpolation.
+ @param erp Error report.
+ @return Valid pointer to new record on success, NULL on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if src is a NULL pointer,
+ - DK4_E_MATH_OVERFLOW<br>
+ on mathematical overflow in size calculation,
+ - DK4_E_MEMORY_ALLOCATION_FAILED<br>
+ with mem.elsize and mem.nelem set if no memory is available.
+*/
+dk4_gra_pgf_img_no_t *
+dk4gra_pgf_img_open(const dkChar *fn, size_t imgno, int ii, dk4_er_t *erp);
+
+/*
+ Module dk4grepp - EPS patterns
+ ------------------------------
+*/
+
+/** Obtain pattern procedure name.
+ @param i Index of pattern procedure.
+ @return Valid pointer to name on success, NULL on error.
+*/
+const char *
+dk4gra_eps_pattern_name(size_t i);
+
+/** Obtain pattern procedure definition.
+ @param i Index of pattern procedure.
+ @return Valid pointer to array of strings on success, NULL on error.
+*/
+const char * const *
+dk4gra_eps_pattern_procedure(size_t i);
+
+
+/*
+ Module dk4grpdt - Timestamp for PDF
+ -----------------------------------
+*/
+
+/** Obtain current timestamp, write as text to buffer.
+ @param buf Destination buffer.
+ @param szbuf Size of destination buffer.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+
+ Error codes:
+ - DK4_E_INVALID_ARGUMENTS<br>
+ if buf is NULL or szbuf is less than 15,
+ - DK4_E_NOT_SUPPORTED<br>
+ if localtime_r is not present on the system.
+*/
+int
+dk4gra_pdf_timestamp(char *buf, size_t szbuf, dk4_er_t *erp);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* vim: set ai sw=4 ts=4 : */
+#endif
diff --git a/support/dktools/gui-img/icons/GNUmakefile b/support/dktools/gui-img/icons/GNUmakefile
new file mode 100644
index 0000000000..1d1a8cf541
--- /dev/null
+++ b/support/dktools/gui-img/icons/GNUmakefile
@@ -0,0 +1,20 @@
+
+IMAGES := $(patsubst %.wxd,%.ico,$(wildcard *.wxd)) wxdkdraw_64.png
+
+%.ico: %.wxd
+ gxhconvert -o=ico -a $*.wxd
+ chmod 644 $@
+
+build: $(IMAGES)
+ echo 'Build finished.'
+
+clean:
+ rm -f *.ico *.xpm
+
+wxdkdraw_64.png: wxdkdraw.wxd
+ cp wxdkdraw.wxd wxdkdraw_64.wxd
+ -[ ! -f ../../dktools/mime/wxdkdraw_64.png ] || rm -f ../../dktools/mime/wxdkdraw_64.png
+ gxhconvert -o=png -a wxdkdraw_64.wxd
+ -rm wxdkdraw_64.wxd
+ -ln wxdkdraw_64.png ../../dktools/mime/wxdkdraw_64.png
+
diff --git a/support/dktools/gui-img/icons/dkclock.ico b/support/dktools/gui-img/icons/dkclock.ico
new file mode 100644
index 0000000000..390ebd3e02
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkclock.ico
Binary files differ
diff --git a/support/dktools/gui-img/icons/dkclock.pl b/support/dktools/gui-img/icons/dkclock.pl
new file mode 100755
index 0000000000..1353ec3e4f
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkclock.pl
@@ -0,0 +1,70 @@
+#! /usr/bin/perl
+
+#
+#
+#
+
+use WXD;
+use POSIX;
+use Math::Round;
+use Math::Trig;
+
+my $i; # Number of point currently processed
+my $cx; # Center x for circle
+my $cy; # Center y for circle
+my $rc = 0.4; # Radius of the clock
+my $rt = 0.07; # Radius of tick point
+my $lw = 2 * $rt; # Line width of clock pointers
+
+my $ll = $rc - $rt - ($lw / 2.0);
+$ll = 0.9 * $ll;
+
+my $ls = (3 * $ll) / 5;
+
+my $wxd = WXD->new(width => 1, height => 1, unit => WXD::UNIT_INCH);
+
+# Background square (golden)
+
+$wxd->SetLayer(0);
+$wxd->SetStrokeRGB(255, 214, 0);
+$wxd->SetFillRGB(255, 214, 0);
+$wxd->SetLineWidth(0);
+$wxd->AddBox(0, 1, 0, 1, 0);
+
+# Clock ticks
+
+$wxd->SetLayer(1);
+$wxd->SetStrokeRGB(0, 0, 0);
+$wxd->SetFillRGB(0, 0, 0);
+
+for (my $i = 0; $i < 12; $i++) {
+ $alpha = (pi() * $i) / 6.0;
+ $xc = 0.5 + $rc * cos($alpha);
+ $yc = 0.5 + $rc * sin($alpha);
+ $wxd->AddCircle($xc, $yc, $rt);
+}
+
+$wxd->SetLayer(2);
+$wxd->SetLineWidth(round(160 * $lw));
+$wxd->SetLineCap(WXD::Object::LC_ROUNDED());
+$wxd->AddPolyline(
+ [
+ [ 0.5, 0.5 ],
+ [ 0.5, (0.5 + $ll) ]
+ ]
+);
+$wxd->AddPolyline(
+ [
+ [ 0.5, 0.5 ],
+ [ (0.5 + $ls), 0.5 ]
+ ]
+);
+
+my $fh = undef;
+if (open($fh, ">dkclock.wxd")) {
+ print $fh $wxd->ToText();
+ close($fh);
+}
+
+# vim: set ai sw=4 ts=4 :
+
diff --git a/support/dktools/gui-img/icons/dkclock.wxd b/support/dktools/gui-img/icons/dkclock.wxd
new file mode 100644
index 0000000000..558d440b81
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkclock.wxd
@@ -0,0 +1,36 @@
+WXD 1 0
+0 2 0
+0 3 8128000 8128000
+0 0 0 16256000 0 16256000
+11 0 255 214 0 255 214 0 0 0 4 1
+ 0 16256000 0 16256000 0
+9 1 0 0 0 0 0 0 0 0 4 1
+ 14630400 8128000 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 13759244 11379200 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 11379200 13759244 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 8128000 14630400 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 4876800 13759244 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 2496756 11379200 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 1625600 8128000 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 2496756 4876800 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 4876800 2496756 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 8128000 1625600 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 11379200 2496756 1137920
+9 1 0 0 0 0 0 0 0 0 4 1
+ 13759244 4876800 1137920
+3 2 2 0 0 0 22 0 4 1 0 8 0 10 5 0 10 5
+ 8128000 8128000
+ 8128000 11931904
+3 2 2 0 0 0 22 0 4 1 0 8 0 10 5 0 10 5
+ 8128000 8128000
+ 10410342 8128000
diff --git a/support/dktools/gui-img/icons/dkclock.xpm b/support/dktools/gui-img/icons/dkclock.xpm
new file mode 100644
index 0000000000..bf612019ee
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkclock.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_dkclock[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #000000",
+". c #131000",
+"X c #FDD200",
+"o c #ECC400",
+"O c #272000",
+"+ c #FFD400",
+"@ c #060500",
+"# c #DFBA00",
+"$ c #3F3500",
+"% c #877000",
+"& c #F4CB00",
+"* c #544600",
+"= c #AE9100",
+"- c #E6BF00",
+"; c #D5B100",
+": c #C4A300",
+/* pixels */
+"+++++++++++++++X++++++++++++++++",
+"++++++++++++++=..=++++++++++++++",
+"++++++++o=#++-@ @-++#=o++++++++",
+"+++++++#. @=+; ;+=@ .#+++++++",
+"+++++++% $+X$ $X+$ %+++++++",
+"+++++++% *++X==X++$ %+++++++",
+"+++++++oO .;++#**#++;. Oo+++++++",
+"+++#%%o++-X++&O O&++X-++o%%#+++",
+"++o. OX+++++; ;+++++XO .o++",
+"++= -+++++: :+++++- :++",
+"++-@ .X+++++: :+++++X. @-++",
+"+++=$*;++++++: :++++++;*$=+++",
+"+++++++++++++: :+++++++++++++",
+"++-;X++++++++: =:;X+++++X;-++",
+"+=@ $X+++++++: .#+++X$ @=+",
+"X. =+++++++= *+++= .X",
+"X. =+++++++: *+++= .X",
+"+=@ $X++++++++$ .#+++X$ @=+",
+"++-;X++++++++++:=:::;X+++++X;-++",
+"++++++++++++++++++++++++++++++++",
+"+++=$*;++++++++++++++++++;$$=+++",
+"++-@ .X++++++++++++++++X. @-++",
+"++= -++++++++++++++++- :++",
+"++o. OX++++++++++++++++XO .o++",
+"+++#%%o+X-X++++++++++X-++o%%#+++",
+"+++++++oO .;++++++++;. Oo+++++++",
+"+++++++% *++X==X++$ %+++++++",
+"+++++++% $+X$ $X+$ %+++++++",
+"+++++++#. @=+; ;+=@ .#+++++++",
+"++++++++o=-++-@ @-++-=o++++++++",
+"++++++++++++++=..=++++++++++++++",
+"++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/icons/dkctinst.ico b/support/dktools/gui-img/icons/dkctinst.ico
new file mode 100644
index 0000000000..4b639aedc4
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkctinst.ico
Binary files differ
diff --git a/support/dktools/gui-img/icons/dkctinst.wxd b/support/dktools/gui-img/icons/dkctinst.wxd
new file mode 100644
index 0000000000..f10dd8e146
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkctinst.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+11 0 0 209 0 0 209 0 0 0 4 1
+ 0 16256000 0 16256000 0
+2 1 0 0 0
+ 30 42 2 0 8128000 8128000 0
+ D
+
+2 1 0 0 0
+ 30 42 0 0 8128000 2032000 0
+ K
+
diff --git a/support/dktools/gui-img/icons/dkctinst.xpm b/support/dktools/gui-img/icons/dkctinst.xpm
new file mode 100644
index 0000000000..1a69803388
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkctinst.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_dkctinst[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #000000",
+". c #000600",
+"X c #001300",
+"o c #002000",
+"O c #002C00",
+"+ c #003800",
+"@ c #004700",
+"# c #006200",
+"$ c #007F00",
+"% c #008A00",
+"& c #009300",
+"* c #00A800",
+"= c #00BD00",
+"- c #00C700",
+"; c #00CC00",
+": c #00CF00",
+/* pixels */
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+":#@@@@@@@@#%-:::::::::::::::::::",
+":-# #&%$@ X&::::::::::::::::::",
+"::& $::::*X .*:::::::::::::::::",
+"::& $:::::& @:::::::::::::::::",
+"::& $::::::X .;::::::::::::::::",
+"::& $::::::+ =::::::::::::::::",
+"::& $::::::@ =::::::::::::::::",
+"::& $::::::+ .;::::::::::::::::",
+"::& $::::::X +:::::::::::::::::",
+"::& $:::::& *:::::::::::::::::",
+"::& $::::-o #::::::::::::::::::",
+"::& $:;=$o.$:::::::::::::::::::",
+":=o .o#=::::*@@@@@%:::$@@#::",
+":;-:::--::::::::;*o *-::=Xo&=::",
+"::::::::::::::::::+ .:::=oO-::::",
+"::::::::::::::::::+ X::=O+-:::::",
+"::::::::::::::::::+ X:=o@;::::::",
+"::::::::::::::::::+ X=oO;:::::::",
+"::::::::::::::::::+ .o $:::::::",
+"::::::::::::::::::+ X& .&::::::",
+"::::::::::::::::::+ X:$ X*:::::",
+"::::::::::::::::::+ X::# o=::::",
+"::::::::::::::::::+ .::;+ +;:::",
+"::::::::::::::::::O ;::-o @;::",
+"::::::::::::::::*O o$::=X X=:",
+"::::::::::::::::;-:::--:::-;:-;:",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::"
+};
diff --git a/support/dktools/gui-img/icons/dkctunin.ico b/support/dktools/gui-img/icons/dkctunin.ico
new file mode 100644
index 0000000000..76fd38dab1
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkctunin.ico
Binary files differ
diff --git a/support/dktools/gui-img/icons/dkctunin.wxd b/support/dktools/gui-img/icons/dkctunin.wxd
new file mode 100644
index 0000000000..23cc631a45
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkctunin.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+11 0 209 0 0 209 0 0 0 0 4 1
+ 0 16256000 0 16256000 0
+2 1 0 0 0
+ 30 42 2 0 8128000 8128000 0
+ D
+
+2 1 0 0 0
+ 30 42 0 0 8128000 2032000 0
+ K
+
diff --git a/support/dktools/gui-img/icons/dkctunin.xpm b/support/dktools/gui-img/icons/dkctunin.xpm
new file mode 100644
index 0000000000..03f42f98ee
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkctunin.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_dkctunin[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #000000",
+". c #130000",
+"X c #380000",
+"o c #CC0000",
+"O c #A80000",
+"+ c #CF0000",
+"@ c #BD0000",
+"# c #060000",
+"$ c #620000",
+"% c #2C0000",
+"& c #8A0000",
+"* c #200000",
+"= c #C70000",
+"- c #470000",
+"; c #7F0000",
+": c #930000",
+/* pixels */
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"+$--------$&=+++++++++++++++++++",
+"+=$ $:&;- .:++++++++++++++++++",
+"++: ;++++O. #O+++++++++++++++++",
+"++: ;+++++: -+++++++++++++++++",
+"++: ;++++++. #o++++++++++++++++",
+"++: ;++++++X @++++++++++++++++",
+"++: ;++++++- @++++++++++++++++",
+"++: ;++++++X #o++++++++++++++++",
+"++: ;++++++. X+++++++++++++++++",
+"++: ;+++++: O+++++++++++++++++",
+"++: ;++++=* $++++++++++++++++++",
+"++: ;+o@;*#;+++++++++++++++++++",
+"+@* #*$@++++O-----&+++;--$++",
+"+o=+++==++++++++oO* O=++@.*:@++",
+"++++++++++++++++++X #+++@*%=++++",
+"++++++++++++++++++X .++@%X=+++++",
+"++++++++++++++++++X .+@*-o++++++",
+"++++++++++++++++++X .@*%o+++++++",
+"++++++++++++++++++X #* ;+++++++",
+"++++++++++++++++++X .: #:++++++",
+"++++++++++++++++++X .+; .O+++++",
+"++++++++++++++++++X .++$ *@++++",
+"++++++++++++++++++X #++oX Xo+++",
+"++++++++++++++++++% o++=* -o++",
+"++++++++++++++++O% *;++@. .@+",
+"++++++++++++++++o=+++==+++=o+=o+",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/icons/dkicon.ico b/support/dktools/gui-img/icons/dkicon.ico
new file mode 100644
index 0000000000..e348c5e02f
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkicon.ico
Binary files differ
diff --git a/support/dktools/gui-img/icons/dkicon.wxd b/support/dktools/gui-img/icons/dkicon.wxd
new file mode 100644
index 0000000000..70443e6de3
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkicon.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+11 0 255 214 0 255 214 0 0 0 4 1
+ 0 16256000 0 16256000 0
+2 1 0 0 0
+ 30 42 2 0 8128000 8128000 0
+ D
+
+2 1 0 0 0
+ 30 42 0 0 8128000 2032000 0
+ K
+
diff --git a/support/dktools/gui-img/icons/dkicon.xpm b/support/dktools/gui-img/icons/dkicon.xpm
new file mode 100644
index 0000000000..d0de2d8b42
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkicon.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_dkicon[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #000000",
+". c #362D00",
+"X c #B59600",
+"o c #FFD400",
+"O c #282100",
+"+ c #181300",
+"@ c #A88C00",
+"# c #070600",
+"$ c #D0AD00",
+"% c #F5CB00",
+"& c #786400",
+"* c #9C8200",
+"= c #574900",
+"- c #463A00",
+"; c #E9C200",
+": c #FBD100",
+/* pixels */
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"o&========&@%ooooooooooooooooooo",
+"o%& &X@*=# +Xoooooooooooooooooo",
+"ooX *oooo$+ #$ooooooooooooooooo",
+"ooX *oooooX =ooooooooooooooooo",
+"ooX *oooooo+ #:oooooooooooooooo",
+"ooX *oooooo- ;oooooooooooooooo",
+"ooX *oooooo= ;oooooooooooooooo",
+"ooX *oooooo- #:oooooooooooooooo",
+"ooX *oooooo+ -ooooooooooooooooo",
+"ooX *oooooX $ooooooooooooooooo",
+"ooX *oooo%O &oooooooooooooooooo",
+"ooX *o:$*O#*ooooooooooooooooooo",
+"o;O #O&;oooo$=====@ooo*==&oo",
+"o:%ooo%%oooooooo:$O $%oo;+OX;oo",
+"oooooooooooooooooo- #ooo;O-%oooo",
+"oooooooooooooooooo- +oo;.-%ooooo",
+"oooooooooooooooooo- +o;O=:oooooo",
+"oooooooooooooooooo- +;O.:ooooooo",
+"oooooooooooooooooo- #O *ooooooo",
+"oooooooooooooooooo- +X# #Xoooooo",
+"oooooooooooooooooo- +o* +$ooooo",
+"oooooooooooooooooo- +oo& O;oooo",
+"oooooooooooooooooo- #oo:- -:ooo",
+"oooooooooooooooooo. :oo%O =:oo",
+"oooooooooooooooo$. O@oo;+ +$o",
+"oooooooooooooooo:%ooo%%ooo%:o%:o",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo"
+};
diff --git a/support/dktools/gui-img/icons/dkwxwiz.ico b/support/dktools/gui-img/icons/dkwxwiz.ico
new file mode 100644
index 0000000000..e014c844b3
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkwxwiz.ico
Binary files differ
diff --git a/support/dktools/gui-img/icons/dkwxwiz.pdf b/support/dktools/gui-img/icons/dkwxwiz.pdf
new file mode 100644
index 0000000000..991d91af3d
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkwxwiz.pdf
Binary files differ
diff --git a/support/dktools/gui-img/icons/dkwxwiz.wxd b/support/dktools/gui-img/icons/dkwxwiz.wxd
new file mode 100644
index 0000000000..8ba082b14b
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkwxwiz.wxd
@@ -0,0 +1,6 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+11 0 255 214 0 255 214 0 0 0 4 1
+ 0 8128000 0 8128000 0
+11 0 255 214 0 255 214 0 0 0 4 1
+ 8128000 16256000 8128000 16256000 0
diff --git a/support/dktools/gui-img/icons/dkwxwiz.xpm b/support/dktools/gui-img/icons/dkwxwiz.xpm
new file mode 100644
index 0000000000..e44320a8cb
--- /dev/null
+++ b/support/dktools/gui-img/icons/dkwxwiz.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_dkwxwiz[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 2 1",
+/* colors */
+" c #FFD400",
+". c None",
+/* pixels */
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+"................ ",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................",
+" ................"
+};
diff --git a/support/dktools/gui-img/icons/wxdkdraw.ico b/support/dktools/gui-img/icons/wxdkdraw.ico
new file mode 100644
index 0000000000..3babd9eafe
--- /dev/null
+++ b/support/dktools/gui-img/icons/wxdkdraw.ico
Binary files differ
diff --git a/support/dktools/gui-img/icons/wxdkdraw.pdf b/support/dktools/gui-img/icons/wxdkdraw.pdf
new file mode 100644
index 0000000000..79d0c71d19
--- /dev/null
+++ b/support/dktools/gui-img/icons/wxdkdraw.pdf
Binary files differ
diff --git a/support/dktools/gui-img/icons/wxdkdraw.wxd b/support/dktools/gui-img/icons/wxdkdraw.wxd
new file mode 100644
index 0000000000..53fda95b64
--- /dev/null
+++ b/support/dktools/gui-img/icons/wxdkdraw.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 4
+11 -10 255 250 240 255 250 240 0 0 4 1
+ 0 16256000 0 16256000 0
+1
+3 3 0 0 0 0 8 0 4 1 0 8 0 16 8 0 16 8
+ 3556000 7112000
+ 2540000 4064000
+ 5588000 5080000
+6 4 1 0 0 0 0 0 0 8 0 4 1 8 1
+ 3556000 7112000
+ 11684000 15240000
+ 13716000 13208000
+ 5588000 5080000
+-1
+5 0 0 0 0 8 0 4 1 0 16 8 0 16 8
+ 2032000 3556000 7620000 1016000 14224000 2032000
diff --git a/support/dktools/gui-img/icons/wxdkdraw.xpm b/support/dktools/gui-img/icons/wxdkdraw.xpm
new file mode 100644
index 0000000000..4f610eb32a
--- /dev/null
+++ b/support/dktools/gui-img/icons/wxdkdraw.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxdkdraw[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #000000",
+". c #5A5854",
+"X c #FDF8EE",
+"o c #4B4A47",
+"O c #FEF9EF",
+"+ c #93908A",
+"@ c #706E69",
+"# c #171716",
+"$ c #FFFAF0",
+"% c #060605",
+"& c #EEE9E0",
+"* c #605E5A",
+"= c #615F5B",
+"- c #C2BEB6",
+"; c #343331",
+": c #F9F4EA",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$X@@X$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$X* *X$$$$$$",
+"$$$$$$$$$$$$$$$$$$$X* *X$$$$$",
+"$$$$$$$$$$$$$$$$$$X* .X$$$$",
+"$$$$$$$$$$$$$$$$$X* @$$$$",
+"$$$$$$$$$$$$$$$$X* @$$$$",
+"$$$$$$$$$$$$$$$X* *X$$$$",
+"$$$$$$$$$$$$$$X* *X$$$$$",
+"$$$$$$$$$$$$$X* *X$$$$$$",
+"$$$$$$$$$$$$X* *X$$$$$$$",
+"$$$$$$$$$$$X* *X$$$$$$$$",
+"$$$$$$$$$$X* *X$$$$$$$$$",
+"$$$$$$$$$X* *X$$$$$$$$$$",
+"$$$$$$$$X* *X$$$$$$$$$$$",
+"$$$$$$$X* *X$$$$$$$$$$$$",
+"$$$$$$X* *X$$$$$$$$$$$$$",
+"$$$$$$; *X$$$$$$$$$$$$$$",
+"$$$$$&% *X$$$$$$$$$$$$$$$",
+"$$$$$+ o *X$$$$$$$$$$$$$$$$",
+"$$$$$o%&* *X$$$$$$$$$$$$$$$$$",
+"$$$$&%.$&; *X$$$$$$$$$$$$$$$$$$",
+"$$$$+ ..% %;X$$$$$$$$$$$$$$$$$$$",
+"$$$$o %.+&$$$$$$$$$$$$$$$$$$$$$",
+"$$$@%o+&$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$@ ;-$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$+%%@&$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$&o #+&$$$$$$$$$$$$$$O-.+$$$",
+"$$$$$$$-; %o+&O$$$$$$$:-@# %@$$$",
+"$$$$$$$$O-=# #;.==*o;% #+&$$$$",
+"$$$$$$$$$$$:-+o;#% %#;*+&$$$$$$$",
+"$$$$$$$$$$$$$$$$$$X$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/icons/wxdkdraw_64.png b/support/dktools/gui-img/icons/wxdkdraw_64.png
new file mode 100644
index 0000000000..ffbfda0244
--- /dev/null
+++ b/support/dktools/gui-img/icons/wxdkdraw_64.png
Binary files differ
diff --git a/support/dktools/gui-img/icons/wxdkscrsz.ico b/support/dktools/gui-img/icons/wxdkscrsz.ico
new file mode 100644
index 0000000000..b074bea3aa
--- /dev/null
+++ b/support/dktools/gui-img/icons/wxdkscrsz.ico
Binary files differ
diff --git a/support/dktools/gui-img/icons/wxdkscrsz.wxd b/support/dktools/gui-img/icons/wxdkscrsz.wxd
new file mode 100644
index 0000000000..4d3d141761
--- /dev/null
+++ b/support/dktools/gui-img/icons/wxdkscrsz.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+11 0 255 214 0 255 214 0 0 0 4 1
+ 0 16256000 0 16256000 0
+11 1 255 255 255 255 255 255 6 0 4 0
+ 2032000 14224000 2032000 14224000 0
+11 1 255 255 255 255 255 255 6 0 4 0
+ 2032000 10160000 2032000 10160000 0
+11 3 63 63 63 255 255 255 6 1 4 0
+ 2032000 14224000 2032000 14224000 0
+11 3 63 63 63 255 255 255 6 1 4 0
+ 2032000 10160000 2032000 10160000 0
+3 2 4 0 0 0 6 0 4 0 0 8 3 2 2 3 2 2
+ 10160000 10160000
+ 14224000 14224000
+2 7 0 0 0
+ 30 24 1 0 6096000 4064000 0
+ DK
+
diff --git a/support/dktools/gui-img/icons/wxdkscrsz.xpm b/support/dktools/gui-img/icons/wxdkscrsz.xpm
new file mode 100644
index 0000000000..92a412f317
--- /dev/null
+++ b/support/dktools/gui-img/icons/wxdkscrsz.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxdkscrsz[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #A19A82",
+". c #5A522A",
+"X c #252320",
+"o c #5C5A55",
+"O c #030200",
+"+ c #FFD400",
+"@ c #FFE45C",
+"# c #FFEE9A",
+"$ c #837F70",
+"% c #CCB236",
+"& c #CDAA00",
+"* c #66645E",
+"= c #8A8362",
+"- c #AF9100",
+"; c #7D702F",
+": c #E8DEAD",
+/* pixels */
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"+++%==:#:==== ##==== ## ====%+++",
+"+++=o=:#:==== ##==== ## =*.X#+++",
+"+++==++++++++++++++++++&XOO=#+++",
+"+++::+++++++++++++++++++XOO= +++",
+"+++##++++++++++++++++&+-OXX==+++",
+"+++::++++++++++++++++XXO-+&==+++",
+"+++==+++++++++++++++&OOX+++==+++",
+"+++==+++++++++++++++;OOX&++==+++",
+"+++*$# ====:#:====:#.;&++++::+++",
+"+++oo# ====:#:====:::++++++##+++",
+"+++**++++++++++++++==++++++::+++",
+"+++$$++++++++++++++==++++++==+++",
+"+++$$++++++++++++++==++++++==+++",
+"+++oo&&&&++++&&&++&*=++++++==+++",
+"+++$.O;-.O.++.O-+&X= ++++++==+++",
+"+++$*O&++&O;+-O&&.&##++++++::+++",
+"+++*.O&+++O.+-O&X++##++++++##+++",
+"+++*.O&+++XX+-OXO-+==++++++::+++",
+"+++$*O&+++O;+-O&XO&==++++++==+++",
+"+++$*O&++;X++-O&&OX==++++++==+++",
+"+++*XO....++&.O;+&OX*++++++==+++",
+"+++$$++++++++++++++ ++++++==+++",
+"+++$$++++++++++++++##++++++ +++",
+"+++**++++++++++++++##++++++##+++",
+"+++o.o ::oooo$::oooo*## ===$#+++",
+"+++ oo ::oooo$::oooo$## ====@+++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/shared/dlg/GNUmakefile b/support/dktools/gui-img/shared/dlg/GNUmakefile
new file mode 100644
index 0000000000..ad9eb6630a
--- /dev/null
+++ b/support/dktools/gui-img/shared/dlg/GNUmakefile
@@ -0,0 +1,13 @@
+
+IMAGES := $(patsubst %.wxd,%.ico,$(wildcard *.wxd))
+
+%.ico: %.wxd
+ gxhconvert -o=ico -a $*.wxd
+ chmod 644 $@
+
+build: $(IMAGES)
+ echo 'Build finished.'
+
+clean:
+ rm -f *.ico *.xpm
+
diff --git a/support/dktools/gui-img/shared/dlg/question.ico b/support/dktools/gui-img/shared/dlg/question.ico
new file mode 100644
index 0000000000..5825457405
--- /dev/null
+++ b/support/dktools/gui-img/shared/dlg/question.ico
Binary files differ
diff --git a/support/dktools/gui-img/shared/dlg/question.wxd b/support/dktools/gui-img/shared/dlg/question.wxd
new file mode 100644
index 0000000000..d5ec54a443
--- /dev/null
+++ b/support/dktools/gui-img/shared/dlg/question.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 2
+9 0 0 0 0 25 25 112 0 0 4 1
+ 8128000 8128000 7112000
+2 1 255 250 240
+ 30 60 1 0 8128000 4064000 0
+ ?
+ ?
diff --git a/support/dktools/gui-img/shared/dlg/question.xpm b/support/dktools/gui-img/shared/dlg/question.xpm
new file mode 100644
index 0000000000..49bcabeac5
--- /dev/null
+++ b/support/dktools/gui-img/shared/dlg/question.xpm
@@ -0,0 +1,54 @@
+/* XPM */
+static const char *xpm_question[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 15 1",
+/* colors */
+" c #8F8CB1",
+". c #D7D6E0",
+"X c #49498C",
+"o c #262677",
+"O c #C9C5D6",
+"+ c #EDEAE8",
+"@ c #FFFAF0",
+"# c #17176E",
+"$ c #4E4E8F",
+"% c #3F3E85",
+"& c #1C1C71",
+"* c #646299",
+"= c #32327F",
+"- c #B2B0CA",
+"; c None",
+/* pixels */
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;; $%&&%$;;;;;;;;;;;;;",
+";;;;;;;;;;%##########%;;;;;;;;;;",
+";;;;;;;;X##############X;;;;;;;;",
+";;;;;;;o######oXX=######o;;;;;;;",
+";;;;;;&#####$O@@@@O$#####&;;;;;;",
+";;;;;o#####&@@@@@@@@$#####o;;;;;",
+";;;;X######%@ **O@@@O######X;;;;",
+";;;;####### O###&.@@@#######;;;;",
+";;;%####### $#### @@+#######%;;;",
+";;;##############O@@-########;;;",
+";; #############*@@+%########;;;",
+";;$############=+@+%#########$;;",
+";;=############-@.=##########%;;",
+";;o###########*@O&###########o;;",
+";;o###########O.o############o;;",
+";;%###########. #############%;;",
+";;$########### #############$;;",
+";; ##########################;;;",
+";;;##########o-O*############;;;",
+";;;%######### @@@=##########%;;;",
+";;;;#########O@@@$##########;;;;",
+";;;;X########*@@O&#########X;;;;",
+";;;;;o########=$&#########o;;;;;",
+";;;;;;&##################&;;;;;;",
+";;;;;;;o################o;;;;;;;",
+";;;;;;;;X##############X;;;;;;;;",
+";;;;;;;;;;%##########%;;;;;;;;;;",
+";;;;;;;;;;;;;$%&o%$;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
+};
diff --git a/support/dktools/gui-img/shared/toolbar/GNUmakefile b/support/dktools/gui-img/shared/toolbar/GNUmakefile
new file mode 100644
index 0000000000..39ebb1a402
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/GNUmakefile
@@ -0,0 +1,13 @@
+
+IMAGES := $(patsubst %.wxd,%.xpm,$(wildcard *.wxd))
+
+
+%.xpm: %.wxd
+ gxhconvert -o=xpm -a -r=16 $<
+ chmod 644 $@
+
+build: $(IMAGES)
+ echo 'Build finished.'
+
+clean:
+ -rm -f *.xpm
diff --git a/support/dktools/gui-img/shared/toolbar/choose-dir.wxd b/support/dktools/gui-img/shared/toolbar/choose-dir.wxd
new file mode 100644
index 0000000000..d7939ed2d9
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/choose-dir.wxd
@@ -0,0 +1,17 @@
+WXD 1 0
+0 0 0 16256000 0 15240000
+0 2 4
+6 6 4 0 0 0 255 214 0 6 0 4 1 8 1
+ 1524000 1524000
+ 14732000 1524000
+ 14732000 13716000
+ 5588000 13716000
+ 3556000 11684000
+ 1524000 11684000
+3 3 4 0 0 0 6 0 4 1 1 8 0 2 2 0 2 2
+ 3556000 11684000
+ 12700000 11684000
+ 12700000 13716000
+3 2 4 0 0 0 6 0 4 1 1 8 0 2 2 0 2 2
+ 6604000 11684000
+ 8636000 13716000
diff --git a/support/dktools/gui-img/shared/toolbar/choose-dir.xpm b/support/dktools/gui-img/shared/toolbar/choose-dir.xpm
new file mode 100644
index 0000000000..b3f07e0fb4
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/choose-dir.xpm
@@ -0,0 +1,36 @@
+/* XPM */
+static const char *xpm_choose_dir[] = {
+/* width height ncolors chars_per_pixel */
+"16 15 14 1",
+/* colors */
+" c #6E5B00",
+". c #6E6641",
+"X c #FFD400",
+"o c #4C3F00",
+"O c #3A351B",
+"+ c #EEC600",
+"@ c #757059",
+"# c #776300",
+"$ c #665D33",
+"% c #665E36",
+"& c #E4BE00",
+"* c #78745C",
+"= c #685700",
+"- c None",
+/* pixels */
+"----------------",
+"-----.%$O%%%O%@-",
+"----$&+o&XXX=X$-",
+"-*.O=#o=#### X$-",
+"-$XXXXXXXXXXXX$-",
+"-$XXXXXXXXXXXX$-",
+"-$XXXXXXXXXXXX$-",
+"-$XXXXXXXXXXXX$-",
+"-$XXXXXXXXXXXX$-",
+"-$XXXXXXXXXXXX$-",
+"-$XXXXXXXXXXXX$-",
+"-$XXXXXXXXXXXX$-",
+"-$XXXXXXXXXXXX$-",
+"-@%%%%%%%%%%%%@-",
+"----------------"
+};
diff --git a/support/dktools/gui-img/shared/toolbar/exit-program.wxd b/support/dktools/gui-img/shared/toolbar/exit-program.wxd
new file mode 100644
index 0000000000..dd844bcf1b
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/exit-program.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 16256000 0 15240000
+0 2 4
+6 4 0 63 63 63 143 0 0 6 0 4 1 8 1
+ 4064000 13716000
+ 4064000 1524000
+ 9144000 5080000
+ 9144000 13716000
+11 1 0 0 0 255 255 255 6 0 4 0
+ 4064000 12192000 1524000 13716000 0
diff --git a/support/dktools/gui-img/shared/toolbar/exit-program.xpm b/support/dktools/gui-img/shared/toolbar/exit-program.xpm
new file mode 100644
index 0000000000..878c104f0b
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/exit-program.xpm
@@ -0,0 +1,33 @@
+/* XPM */
+static const char *xpm_exit_program[] = {
+/* width height ncolors chars_per_pixel */
+"16 15 11 1",
+/* colors */
+" c #2B2222",
+". c #3E2727",
+"X c #761212",
+"o c #520D0D",
+"O c #663737",
+"+ c #776464",
+"@ c #898989",
+"# c #666666",
+"$ c #676767",
+"% c #8F0000",
+"& c None",
+/* pixels */
+"&&&&&&&&&&&&&&&&",
+"&&&& #$#&&&&",
+"&&&@o%%%X&&&&&&&",
+"&&&@o%%%X&&&&&&&",
+"&&&@o%%%X&&&&&&&",
+"&&&@o%%%X&&&&&&&",
+"&&&@o%%%X&&&&&&&",
+"&&&@o%%%X&&&&&&&",
+"&&&@o%%%X&&&&&&&",
+"&&&@o%%%X&&&&&&&",
+"&&&@o%%X+&&&&&&&",
+"&&&@o%O&&&&&&&&&",
+"&&&@.+&&&&&&&&&&",
+"&&&&.#$$$$$#&&&&",
+"&&&&&&&&&&&&&&&&"
+};
diff --git a/support/dktools/gui-img/shared/toolbar/run-conversion.wxd b/support/dktools/gui-img/shared/toolbar/run-conversion.wxd
new file mode 100644
index 0000000000..60018ef666
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/run-conversion.wxd
@@ -0,0 +1,7 @@
+WXD 1 0
+0 0 0 16256000 0 15240000
+0 2 4
+6 3 0 0 143 0 0 143 0 6 0 4 1 8 1
+ 1524000 13716000
+ 1524000 1524000
+ 14732000 8128000
diff --git a/support/dktools/gui-img/shared/toolbar/run-conversion.xpm b/support/dktools/gui-img/shared/toolbar/run-conversion.xpm
new file mode 100644
index 0000000000..a3689b90d6
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/run-conversion.xpm
@@ -0,0 +1,33 @@
+/* XPM */
+static const char *xpm_run_conversion[] = {
+/* width height ncolors chars_per_pixel */
+"16 15 11 1",
+/* colors */
+" c #0E950E",
+". c #33A633",
+"X c #008F00",
+"o c #029102",
+"O c #96D196",
+"+ c #2AA12A",
+"@ c #079207",
+"# c #1C9B1C",
+"$ c #2FA32F",
+"% c #56B556",
+"& c None",
+/* pixels */
+"&&&&&&&&&&&&&&&&",
+"&%&&&&&&&&&&&&&&",
+"&.@+%&&&&&&&&&&&",
+"&.XXX#.&&&&&&&&&",
+"&.XXXXX +O&&&&&&",
+"&.XXXXXXXo#%&&&&",
+"&.XXXXXXXXXX .&&",
+"&.XXXXXXXXXX@+&&",
+"&.XXXXXXXX@+&&&&",
+"&.XXXXXX@+&&&&&&",
+"&.XXXX +&&&&&&&&",
+"&.XX +&&&&&&&&&&",
+"&. $&&&&&&&&&&&&",
+"&%&&&&&&&&&&&&&&",
+"&&&&&&&&&&&&&&&&"
+};
diff --git a/support/dktools/gui-img/shared/toolbar/run2.wxd b/support/dktools/gui-img/shared/toolbar/run2.wxd
new file mode 100644
index 0000000000..60018ef666
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/run2.wxd
@@ -0,0 +1,7 @@
+WXD 1 0
+0 0 0 16256000 0 15240000
+0 2 4
+6 3 0 0 143 0 0 143 0 6 0 4 1 8 1
+ 1524000 13716000
+ 1524000 1524000
+ 14732000 8128000
diff --git a/support/dktools/gui-img/shared/toolbar/run2.xpm b/support/dktools/gui-img/shared/toolbar/run2.xpm
new file mode 100644
index 0000000000..4c40019f46
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/run2.xpm
@@ -0,0 +1,33 @@
+/* XPM */
+static const char *xpm_run2[] = {
+/* width height ncolors chars_per_pixel */
+"16 15 11 1",
+/* colors */
+" c #0E950E",
+". c #33A633",
+"X c #008F00",
+"o c #029102",
+"O c #96D196",
+"+ c #2AA12A",
+"@ c #079207",
+"# c #1C9B1C",
+"$ c #2FA32F",
+"% c #56B556",
+"& c None",
+/* pixels */
+"&&&&&&&&&&&&&&&&",
+"&%&&&&&&&&&&&&&&",
+"&.@+%&&&&&&&&&&&",
+"&.XXX#.&&&&&&&&&",
+"&.XXXXX +O&&&&&&",
+"&.XXXXXXXo#%&&&&",
+"&.XXXXXXXXXX .&&",
+"&.XXXXXXXXXX@+&&",
+"&.XXXXXXXX@+&&&&",
+"&.XXXXXX@+&&&&&&",
+"&.XXXX +&&&&&&&&",
+"&.XX +&&&&&&&&&&",
+"&. $&&&&&&&&&&&&",
+"&%&&&&&&&&&&&&&&",
+"&&&&&&&&&&&&&&&&"
+};
diff --git a/support/dktools/gui-img/shared/toolbar/set-options-i.pdf b/support/dktools/gui-img/shared/toolbar/set-options-i.pdf
new file mode 100644
index 0000000000..cc0b21f6fa
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/set-options-i.pdf
Binary files differ
diff --git a/support/dktools/gui-img/shared/toolbar/set-options.tex b/support/dktools/gui-img/shared/toolbar/set-options.tex
new file mode 100644
index 0000000000..dc4df4d5b7
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/set-options.tex
@@ -0,0 +1,50 @@
+\documentclass[12pt]{article}
+% PPPT_FONT_SETUP_BEGIN
+\usepackage[T1]{fontenc}
+\usepackage{mathptmx}
+\usepackage[scaled=.92]{helvet}
+\usepackage{courier}
+% PPPT_FONT_SETUP_END
+% PPPT_PACKAGES_BEGIN
+\usepackage{textcomp}
+\usepackage[intlimits]{amsmath}
+\usepackage{fancybox}
+\usepackage{graphicx}
+\usepackage{xcolor}
+% PPPT_PACKAGES_END
+% PPPT_PDF_INFO_BEGIN
+% \usepackage{hyperref}
+% \hypersetup{
+% pdfauthor={Anonymous author},
+% pdftitle={Document title},
+% pdfsubject={Document subject},
+% pdfkeywords={Key,word,another}
+% }
+% PPPT_PDF_INFO_END
+\setlength{\paperwidth}{72bp}
+\setlength{\paperheight}{68bp}
+\pagestyle{empty}
+\setlength{\voffset}{-1in}
+\setlength{\topmargin}{0bp}
+\setlength{\headheight}{0bp}
+\setlength{\headsep}{0bp}
+\setlength{\topskip}{0bp}
+\setlength{\hoffset}{-1in}
+\setlength{\oddsidemargin}{0bp}
+\setlength{\evensidemargin}{0bp}
+\setlength{\marginparwidth}{0bp}
+\setlength{\marginparsep}{0bp}
+\setlength{\textwidth}{\paperwidth}
+\setlength{\textheight}{\paperheight}
+\setlength{\parskip}{0bp}
+\setlength{\parindent}{0bp}
+\setlength{\pdfpagewidth}{\paperwidth}
+\setlength{\pdfpageheight}{\paperheight}
+\begin{document}%
+\begin{picture}(0,0)
+\includegraphics{set-options-i.pdf}
+\end{picture}%
+\setlength{\unitlength}{1bp}%
+\begin{picture}(72,68)
+\end{picture}%
+\end{document}
diff --git a/support/dktools/gui-img/shared/toolbar/set-options.wxd b/support/dktools/gui-img/shared/toolbar/set-options.wxd
new file mode 100644
index 0000000000..33f5ccd120
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/set-options.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 16256000 0 15240000
+0 2 4
+11 0 0 0 0 191 191 191 6 0 4 0
+ 1524000 14224000 1524000 13716000 0
+3 3 1 0 143 0 16 0 4 1 1 8 0 2 2 0 2 2
+ 1524000 7112000
+ 7620000 1524000
+ 14732000 13208000
diff --git a/support/dktools/gui-img/shared/toolbar/set-options.xpm b/support/dktools/gui-img/shared/toolbar/set-options.xpm
new file mode 100644
index 0000000000..f39d6dddde
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/set-options.xpm
@@ -0,0 +1,32 @@
+/* XPM */
+static const char *xpm_set_options[] = {
+/* width height ncolors chars_per_pixel */
+"16 15 10 1",
+/* colors */
+" c #589258",
+". c #5A605A",
+"X c #008F00",
+"o c #079007",
+"O c #3E943E",
+"+ c #656765",
+"@ c #1C901C",
+"# c #676767",
+"$ c #8B8F8B",
+"% c None",
+/* pixels */
+"%%%%%%%%%%%%%%%%",
+"%############.O%",
+"%+%%%%%%%%%%%OX%",
+"%+%%%%%%%%%%%X %",
+"%+%%%%%%%%%%@@%%",
+"%+%%%%%%%%% X$%%",
+"%+%%%%%%%%%oO%%%",
+"%@%%%%%%%%Oo%%%%",
+"%oo%%%%%%%X%%%%%",
+"%.@o%%%%%@@%%%%%",
+"%+%OX%%% X%%%%%%",
+"%+%%OX %X %%%%%%",
+"%+%%% Xoo%%%%%%%",
+"%####+@XO####.%%",
+"%%%%%%%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/shared/toolbar/toolbase.wxd b/support/dktools/gui-img/shared/toolbar/toolbase.wxd
new file mode 100644
index 0000000000..d001a1674e
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/toolbase.wxd
@@ -0,0 +1,3 @@
+WXD 1 0
+0 0 0 16256000 0 15240000
+0 2 2
diff --git a/support/dktools/gui-img/shared/toolbar/toolbase.xpm b/support/dktools/gui-img/shared/toolbar/toolbase.xpm
new file mode 100644
index 0000000000..7b518225f6
--- /dev/null
+++ b/support/dktools/gui-img/shared/toolbar/toolbase.xpm
@@ -0,0 +1,23 @@
+/* XPM */
+static const char *xpm_toolbase[] = {
+/* width height ncolors chars_per_pixel */
+"16 15 1 0",
+/* colors */
+" c None",
+/* pixels */
+"",
+"",
+"",
+"",
+"",
+"",
+"",
+"",
+"",
+"",
+"",
+"",
+"",
+"",
+""
+};
diff --git a/support/dktools/gui-img/splash/GNUmakefile b/support/dktools/gui-img/splash/GNUmakefile
new file mode 100644
index 0000000000..f7ff826859
--- /dev/null
+++ b/support/dktools/gui-img/splash/GNUmakefile
@@ -0,0 +1,15 @@
+
+IMAGES := $(patsubst %.wxd,%.png,$(wildcard *.wxd))
+DISKLESSIAN=/home/krause/work/disklessian
+
+%.png: %.wxd
+ gxhconvert -o=png --ultra-optimized -r=160 $<
+ chmod 644 $@
+
+images: $(IMAGES)
+ [ ! -d $(DISKLESSIAN) ] || cp splash-disklessian.png $(DISKLESSIAN)
+ [ ! -d $(DISKLESSIAN) ] || cp splash-surfian.png $(DISKLESSIAN)
+ [ ! -d $(DISKLESSIAN) ] || cp splash-dktoolian.png $(DISKLESSIAN)
+
+clean:
+ -rm -f *.png
diff --git a/support/dktools/gui-img/splash/splash-disklessian.png b/support/dktools/gui-img/splash/splash-disklessian.png
new file mode 100644
index 0000000000..099e8c14a8
--- /dev/null
+++ b/support/dktools/gui-img/splash/splash-disklessian.png
Binary files differ
diff --git a/support/dktools/gui-img/splash/splash-disklessian.wxd b/support/dktools/gui-img/splash/splash-disklessian.wxd
new file mode 100644
index 0000000000..81c324a626
--- /dev/null
+++ b/support/dktools/gui-img/splash/splash-disklessian.wxd
@@ -0,0 +1,33 @@
+WXD 1 0
+0 0 0 65024000 0 48768000
+0 2 4
+11 0 0 0 0 0 0 0 0 0 4 1
+ 0 65024000 0 48768000 0
+11 1 0 0 0 63 63 63 0 0 4 1
+ 508000 64516000 29464000 48260000 0
+11 2 0 0 0 127 127 127 0 0 4 1
+ 1016000 64008000 29972000 47752000 0
+11 3 0 0 0 191 191 191 0 0 4 1
+ 1524000 63500000 30480000 47244000 0
+11 4 0 0 0 0 209 0 0 0 4 1
+ 2032000 62992000 30988000 46736000 0
+11 5 0 0 0 191 191 191 0 0 4 1
+ 2540000 62484000 31496000 46228000 0
+11 6 0 0 0 127 127 127 0 0 4 1
+ 3048000 61976000 32004000 45720000 0
+11 7 0 0 0 63 63 63 0 0 4 1
+ 3556000 61468000 32512000 45212000 0
+11 8 0 0 0 0 0 0 0 0 4 1
+ 4064000 60960000 33020000 44704000 0
+2 20 0 209 0
+ 30 18 1 0 32512000 41148000 0
+ Disklessian
+
+2 20 0 209 0
+ 30 12 1 0 32512000 37084000 0
+ Debian GNU/Linux based live system
+
+2 20 0 209 0
+ 30 12 1 0 32512000 34036000 0
+ without access to internal disks
+
diff --git a/support/dktools/gui-img/splash/splash-dktoolian.png b/support/dktools/gui-img/splash/splash-dktoolian.png
new file mode 100644
index 0000000000..c21706105c
--- /dev/null
+++ b/support/dktools/gui-img/splash/splash-dktoolian.png
Binary files differ
diff --git a/support/dktools/gui-img/splash/splash-dktoolian.wxd b/support/dktools/gui-img/splash/splash-dktoolian.wxd
new file mode 100644
index 0000000000..7b92a41249
--- /dev/null
+++ b/support/dktools/gui-img/splash/splash-dktoolian.wxd
@@ -0,0 +1,33 @@
+WXD 1 0
+0 0 0 65024000 0 48768000
+0 2 4
+11 0 0 0 0 0 0 0 0 0 4 1
+ 0 65024000 0 48768000 0
+11 1 0 0 0 63 63 63 0 0 4 1
+ 508000 64516000 29464000 48260000 0
+11 2 0 0 0 127 127 127 0 0 4 1
+ 1016000 64008000 29972000 47752000 0
+11 3 0 0 0 191 191 191 0 0 4 1
+ 1524000 63500000 30480000 47244000 0
+11 4 0 0 0 255 214 0 0 0 4 1
+ 2032000 62992000 30988000 46736000 0
+11 5 0 0 0 191 191 191 0 0 4 1
+ 2540000 62484000 31496000 46228000 0
+11 6 0 0 0 127 127 127 0 0 4 1
+ 3048000 61976000 32004000 45720000 0
+11 7 0 0 0 63 63 63 0 0 4 1
+ 3556000 61468000 32512000 45212000 0
+11 8 0 0 0 0 0 0 0 0 4 1
+ 4064000 60960000 33020000 44704000 0
+2 20 255 214 0
+ 30 18 1 0 32512000 41148000 0
+ DKtoolian
+
+2 20 255 214 0
+ 30 12 1 0 32512000 37084000 0
+ Debian GNU/Linux based rescue live system
+
+2 20 255 214 0
+ 30 12 1 0 32512000 34036000 0
+ including DK tools
+
diff --git a/support/dktools/gui-img/splash/splash-surfian.png b/support/dktools/gui-img/splash/splash-surfian.png
new file mode 100644
index 0000000000..b5e453afd4
--- /dev/null
+++ b/support/dktools/gui-img/splash/splash-surfian.png
Binary files differ
diff --git a/support/dktools/gui-img/splash/splash-surfian.wxd b/support/dktools/gui-img/splash/splash-surfian.wxd
new file mode 100644
index 0000000000..66ad26f438
--- /dev/null
+++ b/support/dktools/gui-img/splash/splash-surfian.wxd
@@ -0,0 +1,36 @@
+WXD 1 0
+0 0 0 65024000 0 48768000
+11 0 0 0 0 0 0 0 0 0 4 1
+ 0 65024000 0 48768000 0
+11 1 0 0 0 63 63 63 0 0 4 1
+ 508000 64516000 29464000 48260000 0
+11 2 0 0 0 127 127 127 0 0 4 1
+ 1016000 64008000 29972000 47752000 0
+11 3 0 0 0 191 191 191 0 0 4 1
+ 1524000 63500000 30480000 47244000 0
+11 4 0 0 0 209 0 0 0 0 4 1
+ 2032000 62992000 30988000 46736000 0
+11 5 0 0 0 191 191 191 0 0 4 1
+ 2540000 62484000 31496000 46228000 0
+11 6 0 0 0 127 127 127 0 0 4 1
+ 3048000 61976000 32004000 45720000 0
+11 7 0 0 0 63 63 63 0 0 4 1
+ 3556000 61468000 32512000 45212000 0
+11 8 0 0 0 0 0 0 0 0 4 1
+ 4064000 60960000 33020000 44704000 0
+2 20 209 0 0
+ 30 18 1 0 32512000 41148000 0
+ Disklessian PXE
+
+2 20 209 0 0
+ 30 10 1 0 32512000 38100000 0
+ Debian GNU/Linux based live system
+
+2 20 209 0 0
+ 30 10 1 0 32512000 35814000 0
+ without access to internal disks
+
+2 20 209 0 0
+ 30 10 1 0 32512000 33528000 0
+ Not intended for banking or private communication!
+
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/GNUmakefile b/support/dktools/gui-img/wxdkdraw/buttons/GNUmakefile
new file mode 100644
index 0000000000..d228116839
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/GNUmakefile
@@ -0,0 +1,13 @@
+
+IMAGES := $(patsubst %.wxd,%.xpm,$(wildcard *.wxd)) \
+ $(patsubst %.pdf,%.xpm,$(wildcard *.pdf))
+
+RESOLUTION=24
+
+images: $(IMAGES)
+
+%.xpm: %.wxd
+ gxhconvert -o=xpm -r=$(RESOLUTION) -a $<
+
+%.xpm: %.pdf
+ gxhconvert -o=xpm -r=$(RESOLUTION) -a $<
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/errors b/support/dktools/gui-img/wxdkdraw/buttons/errors
new file mode 100644
index 0000000000..9c134630f6
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/errors
@@ -0,0 +1,43 @@
+gxhconvert -o=xpm -r=24 -a wxd-brotright.wxd
+wxd2lat -lpdf -d "wxd-brotright.wxd"
+pdflatex -interaction=batchmode "wxd-brotright"
+This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=pdflatex)
+ restricted \write18 enabled.
+entering extended mode
+pdf2svg "wxd-brotright.pdf" "wxd-brotright.svg"
+inkscape --without-gui --export-png="wxd-brotright-16.png" --export-dpi=24 --export-area-page --file="wxd-brotright.svg"
+DPI: 24
+Background RRGGBBAA: ffffff00
+Area 0:0:96:96 exported to 24 x 24 pixels (24 dpi)
+Bitmap saved as: wxd-brotright-16.png
+pngtopnm -alpha "wxd-brotright-16.png" > "wxd-brotright-16.pgm"
+pngtopnm -mix "wxd-brotright-16.png" | pnmquant 16 | ppmtoxpm -name "xpm_wxd-brotright" -alphamask="wxd-brotright-16.pgm" > "wxd-brotright.xpm"
+pnmcolormap: making histogram...
+pnmcolormap: 129 colors found
+pnmcolormap: choosing 16 colors...
+pnmremap: 16 colors found in colormap
+ppmtoxpm: (Computing colormap...
+ppmtoxpm: ...Done. 16 colors found.)
+
+gxhconvert -o=xpm -r=24 -a wxd-brotleft.wxd
+wxd2lat -lpdf -d "wxd-brotleft.wxd"
+pdflatex -interaction=batchmode "wxd-brotleft"
+This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=pdflatex)
+ restricted \write18 enabled.
+entering extended mode
+pdf2svg "wxd-brotleft.pdf" "wxd-brotleft.svg"
+inkscape --without-gui --export-png="wxd-brotleft-16.png" --export-dpi=24 --export-area-page --file="wxd-brotleft.svg"
+DPI: 24
+Background RRGGBBAA: ffffff00
+Area 0:0:96:96 exported to 24 x 24 pixels (24 dpi)
+Bitmap saved as: wxd-brotleft-16.png
+pngtopnm -alpha "wxd-brotleft-16.png" > "wxd-brotleft-16.pgm"
+pngtopnm -mix "wxd-brotleft-16.png" | pnmquant 16 | ppmtoxpm -name "xpm_wxd-brotleft" -alphamask="wxd-brotleft-16.pgm" > "wxd-brotleft.xpm"
+pnmcolormap: making histogram...
+pnmcolormap: 124 colors found
+pnmcolormap: choosing 16 colors...
+pnmremap: 16 colors found in colormap
+ppmtoxpm: (Computing colormap...
+ppmtoxpm: ...Done. 16 colors found.)
+
+ok
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-baddpoint.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-baddpoint.wxd
new file mode 100644
index 0000000000..5922381807
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-baddpoint.wxd
@@ -0,0 +1,16 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+3 2 0 0 143 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 13208000 11176000
+ 13208000 15240000
+3 2 0 0 143 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 15240000 13208000
+ 11176000 13208000
+3 3 0 0 0 143 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 14224000
+ 14224000 8128000
+ 2032000 2032000
+3 2 0 0 0 143 16 2 4 0 1 8 0 8 4 0 8 4
+ 2032000 14224000
+ 2032000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-baddpoint.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-baddpoint.xpm
new file mode 100644
index 0000000000..c155477258
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-baddpoint.xpm
@@ -0,0 +1,40 @@
+/* XPM */
+static const char *xpm_wxd_baddpoint[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 9 1",
+/* colors */
+" c #00008F",
+". c #3636A7",
+"X c #57B557",
+"o c #008F00",
+"O c #050591",
+"+ c #060692",
+"@ c #0A0A94",
+"# c #6767BC",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$X$$$$",
+"$$$$$$$$$$$$$$$$$$XoX$$$",
+"$$@+#$$$$$$$$$$$$$XoX$$$",
+"$$ +#$$$$$$$$$XXoooXX$",
+"$$$#+ +#$$$$$$XoooooooX",
+"$$$$$#@ O#$$$$$XXoooXX$",
+"$$$$$$$#@ O#$$$$$XoX$$$",
+"$$ $$$$$#@ O#$$$XoX$$$",
+"$$ $$$$$$$#@ O#$$X$$$$",
+"$$$$$$$$$$$$$#@ O#$$$$$",
+"$$$$$$$$$$$$$$$#+ +#$$$",
+"$$##$$$$$$$$$$$$$#+ @$$",
+"$$ $$$$$$$$$$$$$#+ @$$",
+"$$..$$$$$$$$$$$#+ +#$$$",
+"$$$$$$$$$$$$$#@ O#$$$$$",
+"$$$$$$$$$$$#@ O#$$$$$$$",
+"$$..$$$$$#@ O#$$$$$$$$$",
+"$$ $$$#@ O#$$$$$$$$$$$",
+"$$##$#@ O#$$$$$$$$$$$$$",
+"$$$#+ +#$$$$$$$$$$$$$$$",
+"$$@ +#$$$$$$$$$$$$$$$$$",
+"$$@+#$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbox.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbox.wxd
new file mode 100644
index 0000000000..4ba0bb2ac5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbox.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 0 0 143 0 255 255 255 16 0 4 0
+ 2032000 14224000 4064000 12192000 3048000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbox.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbox.xpm
new file mode 100644
index 0000000000..3ed4b0325e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbox.xpm
@@ -0,0 +1,36 @@
+/* XPM */
+static const char *xpm_wxd_bbox[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 5 1",
+/* colors */
+" c #7DC67D",
+". c #008F00",
+"X c #259F25",
+"o c #2BA22B",
+"O c None",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOo............oOOOOO",
+"OOO ................ OOO",
+"OOO..XOOOOOOOOOOOOX..OOO",
+"OOo.XOOOOOOOOOOOOOOX.oOO",
+"OO..OOOOOOOOOOOOOOOO..OO",
+"OO..OOOOOOOOOOOOOOOO..OO",
+"OO..OOOOOOOOOOOOOOOO..OO",
+"OO..OOOOOOOOOOOOOOOO..OO",
+"OO..OOOOOOOOOOOOOOOO..OO",
+"OO..OOOOOOOOOOOOOOOO..OO",
+"OOo.XOOOOOOOOOOOOOOX.oOO",
+"OOO..XOOOOOOOOOOOOX..OOO",
+"OOO ................ OOO",
+"OOOOOo............oOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbullet.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbullet.wxd
new file mode 100644
index 0000000000..5fec0c0b52
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbullet.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+3 2 0 0 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 8128000 14224000
+ 8128000 2032000
+3 2 0 0 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 8128000
+ 14224000 8128000
+13 1 0 143 0
+ 8128000 8128000 72
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbullet.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbullet.xpm
new file mode 100644
index 0000000000..69ff3b5c61
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbullet.xpm
@@ -0,0 +1,38 @@
+/* XPM */
+static const char *xpm_wxd_bbullet[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 7 1",
+/* colors */
+" c #000000",
+". c #003100",
+"X c #003300",
+"o c #008F00",
+"O c #3EAA3E",
+"+ c #0F0F0F",
+"@ c None",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@++@@@@@@@@@@@",
+"@@@@@@@@@@@ @@@@@@@@@@@",
+"@@@@@@@@@@@ @@@@@@@@@@@",
+"@@@@@@@@@@@ @@@@@@@@@@@",
+"@@@@@@@@@@@XX@@@@@@@@@@@",
+"@@@@@@@@@OooooO@@@@@@@@@",
+"@@@@@@@@oooooooo@@@@@@@@",
+"@@@@@@@OooooooooO@@@@@@@",
+"@@@@@@@oooooooooo@@@@@@@",
+"@@+ Xoooooooooo. +@@",
+"@@+ .oooooooooo. +@@",
+"@@@@@@@oooooooooo@@@@@@@",
+"@@@@@@@OooooooooO@@@@@@@",
+"@@@@@@@@oooooooo@@@@@@@@",
+"@@@@@@@@@OooooO@@@@@@@@@",
+"@@@@@@@@@@@..@@@@@@@@@@@",
+"@@@@@@@@@@@ @@@@@@@@@@@",
+"@@@@@@@@@@@ @@@@@@@@@@@",
+"@@@@@@@@@@@ @@@@@@@@@@@",
+"@@@@@@@@@@@++@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbulletf.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbulletf.wxd
new file mode 100644
index 0000000000..7fa86e4220
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbulletf.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+3 2 0 0 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 8128000 14224000
+ 8128000 2032000
+3 2 0 0 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 8128000
+ 14224000 8128000
+14 1 0 143 0
+ 8128000 8128000 72 16
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbulletf.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbulletf.xpm
new file mode 100644
index 0000000000..5bc240f86a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bbulletf.xpm
@@ -0,0 +1,43 @@
+/* XPM */
+static const char *xpm_wxd_bbulletf[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 12 1",
+/* colors */
+" c #000000",
+". c #004F00",
+"X c #008F00",
+"o c #FFFFFF",
+"O c #4BB04B",
+"+ c #039003",
+"@ c #65BB65",
+"# c #E4F3E4",
+"$ c #0F0F0F",
+"% c #7BB47B",
+"& c #32A532",
+"* c None",
+/* pixels */
+"************************",
+"************************",
+"***********$$***********",
+"*********** ***********",
+"*********** ***********",
+"**********%..%**********",
+"********@+XXXX+@********",
+"*******&XX+&&+XX&*******",
+"******@XX@#oo#@XX@******",
+"******+X@ooooooOX+******",
+"*****%X+#oooooo#+X%*****",
+"**$ .X&oooooooo&X. $**",
+"**$ .X&oooooooo&X. $**",
+"*****%X+#oooooo#XX%*****",
+"******+XOooooooOX+******",
+"******@XXO#oo#OXX%******",
+"*******OXX+&&XXXO*******",
+"********@+XXXX+%********",
+"**********%..%**********",
+"*********** ***********",
+"*********** ***********",
+"***********$$***********",
+"************************",
+"************************"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcarc.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcarc.wxd
new file mode 100644
index 0000000000..52e691021e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcarc.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+8 0 0 143 0 255 255 255 16 0 4 1 8 0
+ 14224000 2032000 11176000 11176000 2032000 14224000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcarc.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcarc.xpm
new file mode 100644
index 0000000000..be3a0055ce
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcarc.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_bcarc[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 10 1",
+/* colors */
+" c #0E950E",
+". c #249F24",
+"X c #008F00",
+"o c #018F01",
+"O c #83C883",
+"+ c #5FB95F",
+"@ c #059105",
+"# c #069206",
+"$ c #44AC44",
+"% c None",
+/* pixels */
+"%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%",
+"%% XXXXX@$O%%%%%%%%%%%%%",
+"%%XXXXXXXXXo$%%%%%%%%%%%",
+"%%@X%%%%%$#XXo+%%%%%%%%%",
+"%%.X+%%%%%%% XX.%%%%%%%%",
+"%%$X$%%%%%%%%+oX %%%%%%%",
+"%%+X.%%%%%%%%%%#X %%%%%%",
+"%%%X@%%%%%%%%%%%#X.%%%%%",
+"%%%XX%%%%%%%%%%%%oX+%%%%",
+"%%%XX%%%%%%%%%%%%+Xo%%%%",
+"%%%@X%%%%%%%%%%%%% X$%%%",
+"%%%.X+%%%%%%%%%%%%%Xo%%%",
+"%%%$X$%%%%%%%%%%%%%#XO%%",
+"%%%+X.%%%%%%%%%%%%%$X$%%",
+"%%%%X@%%%%%%%%%%%%%%X@%%",
+"%%%%XX%%%%%%%%%%%%%%XX%%",
+"%%%%XX%%%%%%%%%%%%%%XX%%",
+"%%%%#XXX@.$+%%%%%%%%XX%%",
+"%%%%+@XXXXXXXXX@.$+%XX%%",
+"%%%%%%%%%+$.@XXXXXXXXX%%",
+"%%%%%%%%%%%%%%%%+$.@ %%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcircle.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcircle.wxd
new file mode 100644
index 0000000000..01a7efa8f4
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcircle.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+9 0 0 143 0 255 255 255 16 0 4 0
+ 8128000 8128000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcircle.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcircle.xpm
new file mode 100644
index 0000000000..dab367f4aa
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcircle.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_bcircle[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 10 1",
+/* colors */
+" c #59B659",
+". c #008F00",
+"X c #27A027",
+"o c #3AA83A",
+"O c #069206",
+"+ c #099309",
+"@ c #8ACB8A",
+"# c #55B455",
+"$ c #68BC68",
+"% c None",
+/* pixels */
+"%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%$X....X$%%%%%%%%",
+"%%%%%%$O........O$%%%%%%",
+"%%%%%o..+ %%%% +..o%%%%%",
+"%%%%o.. %%%%%%%%#..o%%%%",
+"%%%$..@%%%%%%%%%%@..$%%%",
+"%%%O. %%%%%%%%%%%%#.O%%%",
+"%%$.+%%%%%%%%%%%%%%+.$%%",
+"%%X. %%%%%%%%%%%%%% .X%%",
+"%%..%%%%%%%%%%%%%%%%..%%",
+"%%..%%%%%%%%%%%%%%%%..%%",
+"%%..%%%%%%%%%%%%%%%%..%%",
+"%%..%%%%%%%%%%%%%%%%..%%",
+"%%X. %%%%%%%%%%%%%% .X%%",
+"%%$.+%%%%%%%%%%%%%%+.$%%",
+"%%%O.#%%%%%%%%%%%%#.O%%%",
+"%%%$..@%%%%%%%%%%@..$%%%",
+"%%%%o..#%%%%%%%%#..o%%%%",
+"%%%%%o..+ %%%% +..o%%%%%",
+"%%%%%%$O........O$%%%%%%",
+"%%%%%%%%$X....X$%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcopy.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcopy.wxd
new file mode 100644
index 0000000000..da640312c7
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcopy.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+5 0 0 143 0 24 0 4 1 0 8 4 0 8 4
+ 14224000 11684000 2032000 8128000 14224000 4572000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcopy.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcopy.xpm
new file mode 100644
index 0000000000..b7d0c955f9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bcopy.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_bcopy[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 10 1",
+/* colors */
+" c #6ABD6A",
+". c #46AD46",
+"X c #008F00",
+"o c #018F01",
+"O c #189918",
+"+ c #2FA32F",
+"@ c #0B940B",
+"# c #7AC47A",
+"$ c #56B556",
+"% c None",
+/* pixels */
+"%%%%%%%%%%%%##%%%%%%%%%%",
+"%%%%%%%%.oXXXXXXO#%%%%%%",
+"%%%%%%$XXXXXXXXXXXO%%%%%",
+"%%%%%OXXXXXXXXXXXXXX#%%%",
+"%%%%OXXXX.%%%%% OXXXX#%%",
+"%%%.XXXO%%%%%%%%%$XXXo%%",
+"%%%XXXO%%%%%%%%%%%#XXX.%",
+"%%+XXo%%%%%%%%%%%%%$XX %",
+"%%XXX$%%%%%%%%%%%%%%%%%%",
+"%%XXX%%%%%%%%%%%%%%%%%%%",
+"%$XX@%%%%%%%%%%%%%%%%%%%",
+"%.XX+%%%%%%%%%%%%%%%%%%%",
+"%.XX+%%%%%%%%%%%%%%%%%%%",
+"%$XX@%%%%%%%%%%%%%%%%%%%",
+"%%XXX%%%%%%%%%%%%%%%%%%%",
+"%%XXX$%%%%%%%%%%%%%%%%%%",
+"%%+XXo%%%%%%%%%%%%%$XX %",
+"%%%XXXO%%%%%%%%%%%#XXX.%",
+"%%%.XXXO%%%%%%%%%$XXXo%%",
+"%%%%OXXXX.%%%%% OXXXX#%%",
+"%%%%%OXXXXXXXXXXXXXX#%%%",
+"%%%%%%$XXXXXXXXXXXO%%%%%",
+"%%%%%%%%.oXXXXXXO#%%%%%%",
+"%%%%%%%%%%%%##%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdel.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdel.wxd
new file mode 100644
index 0000000000..e3aa2b528d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdel.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+7 5 0 143 0 0 255 0 0 24 0 4 1 8 0
+ 2032000 2032000 0
+ 2032000 14224000 0
+ 11176000 14224000 1
+ 14224000 8128000 -1
+ 11176000 2032000 1
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdel.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdel.xpm
new file mode 100644
index 0000000000..9e20cef673
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdel.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_bdel[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 10 1",
+/* colors */
+" c #A53333",
+". c #950F0F",
+"X c #B96161",
+"o c #AC4141",
+"O c #9B1B1B",
+"+ c #AF4A4A",
+"@ c #9F2424",
+"# c #8F0000",
+"$ c #910505",
+"% c None",
+/* pixels */
+"%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%+ o++XX%%%%%%%%%%%%%%%",
+"%+###########OX%%%%%%%%%",
+"% ##############+%%%%%%%",
+"% ##$O.##########.%%%%%%",
+"% ## %%%%%%%X@####$%%%%%",
+"% ## %%%%%%%%%%O###$%%%%",
+"% ## %%%%%%%%%%%o###.%%%",
+"% ## %%%%%%%%%%%%o###o%%",
+"% ## %%%%%%%%%%%%%@###%%",
+"% ## %%%%%%%%%%%%%%###X%",
+"% ## %%%%%%%%%%%%%%O##o%",
+"% ## %%%%%%%%%%%%%%O##o%",
+"% ## %%%%%%%%%%%%%%###X%",
+"% ## %%%%%%%%%%%%%@###%%",
+"% ## %%%%%%%%%%%%o###o%%",
+"% ## %%%%%%%%%%%o###.%%%",
+"% ## %%%%%%%%%%O###$%%%%",
+"% ## %%%%%%%X@####$%%%%%",
+"% ##$O.##########.%%%%%%",
+"% ##############+%%%%%%%",
+"%+###########OX%%%%%%%%%",
+"%%+ o++XX%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdelpoint.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdelpoint.wxd
new file mode 100644
index 0000000000..f08d6be5e3
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdelpoint.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+3 2 0 143 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 15240000 13208000
+ 11176000 13208000
+3 3 0 0 0 143 16 2 4 0 1 8 0 8 4 0 8 4
+ 2032000 14224000
+ 14224000 8128000
+ 2032000 2032000
+3 2 0 0 0 143 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 14224000
+ 2032000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdelpoint.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdelpoint.xpm
new file mode 100644
index 0000000000..8e4a7173de
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdelpoint.xpm
@@ -0,0 +1,40 @@
+/* XPM */
+static const char *xpm_wxd_bdelpoint[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 9 1",
+/* colors */
+" c #00008F",
+". c #B65858",
+"X c #040491",
+"o c #8181C7",
+"O c #5E5EB8",
+"+ c #2E2EA3",
+"@ c #0B0B94",
+"# c #A12A2A",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$@X$$$$$$$$$$$$$$$$$$$$",
+"$$ $$$$$$$$$$$$.......$",
+"$$ $$+Xo$$$$$$.#######.",
+"$$ $$X $$$$$$$$.......$",
+"$$ $$$o$$$XO$$$$$$$$$$$",
+"$$ $$$$$$+ +$$$$$$$$$$$",
+"$$ $$$$$$$O$$$@O$$$$$$$",
+"$$ $$$$$$$$$$$ $$$$$$$",
+"$$ $$$$$$$$$$$OO$$OO$$$",
+"$$ $$$$$$$$$$$$$$$X @$$",
+"$$ $$$$$$$$$$$$$O$O+@$$",
+"$$ $$$$$$$$$$$$+ +$$$$$",
+"$$ $$$$$$$$$o$$$XO$$$$$",
+"$$ $$$$$$$$X $$$$$$$$$$",
+"$$ $$$$$$$$+X$$$$$$$$$$",
+"$$ $$$$X@$$$$$$$$$$$$$$",
+"$$ $$$$ X$$$$$$$$$$$$$$",
+"$$ XO$$$$$$$$$$$$$$$$$$",
+"$$ @$$$$$$$$$$$$$$$$$$",
+"$$@@O$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdetails.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdetails.wxd
new file mode 100644
index 0000000000..5207c010fc
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdetails.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 -1 127 127 127 255 255 255 16 0 4 0
+ 3048000 13208000 3048000 13208000 0
+3 3 0 0 0 143 16 0 4 1 1 8 0 8 4 0 8 4
+ 14224000 14224000
+ 7112000 2032000
+ 2032000 8128000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdetails.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdetails.xpm
new file mode 100644
index 0000000000..8ec7669511
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bdetails.xpm
@@ -0,0 +1,43 @@
+/* XPM */
+static const char *xpm_wxd_bdetails[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 12 1",
+/* colors */
+" c #00008F",
+". c #7D7D7D",
+"X c #8F8F91",
+"o c #A4A4A4",
+"O c #04048F",
+"+ c #3C3C9A",
+"@ c #8787CA",
+"# c #1C1C93",
+"$ c #0B0B90",
+"% c #6868A1",
+"& c #111194",
+"* c None",
+/* pixels */
+"************************",
+"************************",
+"********************&&**",
+"****ooooooooooooooo+ $**",
+"***o..............% @**",
+"***o.Xoooooooooooo# &***",
+"***o.o************ %***",
+"***o.o***********& #o***",
+"***o.o**********% %o***",
+"***o.o**********O +.o***",
+"***o.o*********+ &o.o***",
+"**&$%o********* *o.o***",
+"**$ $X********# +*o.o***",
+"*** #*******@ **o.o***",
+"***% %******$ %**o.o***",
+"***o# *****% $***o.o***",
+"***o.# **** @***o.o***",
+"***o.X# $**+ #****o.o***",
+"***o.XXO &+ %ooooX.o***",
+"***o...% #.......o***",
+"****oooo% Xooooooo****",
+"*********% %************",
+"************************",
+"************************"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bellipse.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bellipse.wxd
new file mode 100644
index 0000000000..b36e10c1c8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bellipse.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+10 0 0 143 0 255 255 255 16 0 4 0
+ 8128000 8128000 6096000 3556000 0
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bellipse.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bellipse.xpm
new file mode 100644
index 0000000000..beffd7bc21
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bellipse.xpm
@@ -0,0 +1,38 @@
+/* XPM */
+static const char *xpm_wxd_bellipse[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 7 1",
+/* colors */
+" c #36A636",
+". c #008F00",
+"X c #039003",
+"o c #65BB65",
+"O c #2FA42F",
+"+ c #1F9C1F",
+"@ c None",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@ X......X @@@@@@@",
+"@@@@@+.....XX.....+@@@@@",
+"@@@o... @@@@@@@@ ...o@@@",
+"@@@..O@@@@@@@@@@@@O..@@@",
+"@@+.O@@@@@@@@@@@@@@O.+@@",
+"@@..@@@@@@@@@@@@@@@@..@@",
+"@@..@@@@@@@@@@@@@@@@..@@",
+"@@+.O@@@@@@@@@@@@@@O.+@@",
+"@@@..O@@@@@@@@@@@@O..@@@",
+"@@@o... @@@@@@@@ ...o@@@",
+"@@@@@+.....XX.....+@@@@@",
+"@@@@@@@ X......X @@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bfliph.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bfliph.wxd
new file mode 100644
index 0000000000..94fedae79d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bfliph.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+6 10 0 0 0 143 0 0 143 0 0 4 0 8 1
+ 1016000 8128000
+ 6096000 3048000
+ 6096000 6604000
+ 10160000 6604000
+ 10160000 3048000
+ 15240000 8128000
+ 10160000 13208000
+ 10160000 9652000
+ 6096000 9652000
+ 6096000 13208000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bfliph.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bfliph.xpm
new file mode 100644
index 0000000000..b527f1818b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bfliph.xpm
@@ -0,0 +1,36 @@
+/* XPM */
+static const char *xpm_wxd_bfliph[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 5 1",
+/* colors */
+" c #00008F",
+". c #1E1E9C",
+"X c #20209D",
+"o c #22229E",
+"O c None",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOoOOOOOO.OOOOOOOO",
+"OOOOOOOo OOOOOO .OOOOOOO",
+"OOOOOOo OOOOOO .OOOOOO",
+"OOOOOo OOOOOO .OOOOO",
+"OOOOX OOOOOO XOOOO",
+"OOOo .OOO",
+"OOo .OO",
+"OOo .OO",
+"OOOo .OOO",
+"OOOOX OOOOOO XOOOO",
+"OOOOOo OOOOOO .OOOOO",
+"OOOOOOo OOOOOO .OOOOOO",
+"OOOOOOOo OOOOOO .OOOOOOO",
+"OOOOOOOOoOOOOOO.OOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bflipv.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bflipv.wxd
new file mode 100644
index 0000000000..53464a466d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bflipv.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+6 10 0 0 0 143 0 0 143 0 0 4 0 8 1
+ 8128000 15240000
+ 3048000 10160000
+ 6604000 10160000
+ 6604000 6096000
+ 3048000 6096000
+ 8128000 1016000
+ 13208000 6096000
+ 9652000 6096000
+ 9652000 10160000
+ 13208000 10160000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bflipv.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bflipv.xpm
new file mode 100644
index 0000000000..82f57d197d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bflipv.xpm
@@ -0,0 +1,35 @@
+/* XPM */
+static const char *xpm_wxd_bflipv[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 4 1",
+/* colors */
+" c #00008F",
+". c #1E1E9C",
+"X c #22229E",
+"o c None",
+/* pixels */
+"oooooooooooooooooooooooo",
+"oooooooooooooooooooooooo",
+"oooooooooooX.ooooooooooo",
+"ooooooooooX .oooooooooo",
+"oooooooooX .ooooooooo",
+"ooooooooX .oooooooo",
+"oooooooX .ooooooo",
+"ooooooX .oooooo",
+"oooooX .ooooo",
+"oooooooooo oooooooooo",
+"oooooooooo oooooooooo",
+"oooooooooo oooooooooo",
+"oooooooooo oooooooooo",
+"oooooooooo oooooooooo",
+"oooooooooo oooooooooo",
+"oooooX .ooooo",
+"ooooooX .oooooo",
+"oooooooX .ooooooo",
+"ooooooooX .oooooooo",
+"oooooooooX .ooooooooo",
+"ooooooooooX .oooooooooo",
+"oooooooooooX.ooooooooooo",
+"oooooooooooooooooooooooo",
+"oooooooooooooooooooooooo"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup.wxd
new file mode 100644
index 0000000000..6c73332525
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 0 0 0 143 255 255 255 16 0 4 0
+ 1016000 15240000 1016000 15240000 0
+11 0 0 0 0 255 255 255 16 0 4 0
+ 3048000 7112000 9144000 13208000 0
+9 0 0 0 0 255 255 255 16 0 4 0
+ 11176000 5080000 2032000
+3 3 0 0 0 143 16 0 4 1 1 8 0 8 4 0 8 4
+ 13208000 8636000
+ 13208000 13208000
+ 11176000 11684000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup.xpm
new file mode 100644
index 0000000000..101469c010
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup.xpm
@@ -0,0 +1,42 @@
+/* XPM */
+static const char *xpm_wxd_bgroup[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 11 1",
+/* colors */
+" c #000000",
+". c #00008F",
+"X c #26269F",
+"o c #808080",
+"O c #4C4C4C",
+"+ c #4C4CB0",
+"@ c #4D4DB1",
+"# c #090909",
+"$ c #0D0D0D",
+"% c #6A6ABD",
+"& c None",
+/* pixels */
+"&++++++++++++++++++++++&",
+"+......................+",
+"+.X++++++++++++++++++X.+",
+"+.+&OOOOOOO&&&&&&&&@&+.+",
+"+.+O O&&&&&%..@+.+",
+"+.+O $OOO$ O&&&&+...@+.+",
+"+.+O O&&&O O&&&%....@+.+",
+"+.+O O&&&O O&&&&X&+.@+.+",
+"+.+O O&&&O O&&&&&&@.@+.+",
+"+.+O $OOO$ O&&&&&&@.@+.+",
+"+.+O O&&&&&&@.@+.+",
+"+.+&OOOOOOO&&&&&&&%.%+.+",
+"+.+&&&&&&&&&&&&oOo&&&+.+",
+"+.+&&&&&&&&&&&# #&&+.+",
+"+.+&&&&&&&&&&# $O$ #&+.+",
+"+.+&&&&&&&&&o $&&&$ o+.+",
+"+.+&&&&&&&&&O O&&&O O+.+",
+"+.+&&&&&&&&&o $&&&$ &+.+",
+"+.+&&&&&&&&&&# $O$ #&+.+",
+"+.+&&&&&&&&&&&# #&&+.+",
+"+.+&&&&&&&&&&&&&O&&&&+.+",
+"+.X++++++++++++++++++X.+",
+"+......................+",
+"&++++++++++++++++++++++&"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup2.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup2.wxd
new file mode 100644
index 0000000000..1e47fdede7
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup2.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 0 0 0 143 255 255 255 16 0 4 0
+ 1016000 15240000 1016000 15240000 0
+11 0 0 0 0 255 255 255 16 0 4 0
+ 3048000 7112000 9144000 13208000 0
+9 0 0 0 0 255 255 255 16 0 4 0
+ 11176000 5080000 2032000
+4 9 0 0 0 143 12 0 4 1 1 8 0 8 4 0 8 4
+ 10668000 9144000 0
+ 10668000 13208000 0
+ 11684000 13208000 1
+ 12192000 13208000 1
+ 12700000 12192000 -1
+ 12192000 11176000 1
+ 11684000 11176000 1
+ 10668000 11176000 0
+ 12700000 9144000 0
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup2.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup2.xpm
new file mode 100644
index 0000000000..777f438bb0
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup2.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_bgroup2[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 10 1",
+/* colors */
+" c #000000",
+". c #00008F",
+"X c #6C6CBF",
+"o c #818181",
+"O c #4C4C4C",
+"+ c #4C4CB0",
+"@ c #090909",
+"# c #1C1C9B",
+"$ c #0D0D0D",
+"% c None",
+/* pixels */
+"%++++++++++++++++++++++%",
+"+......................+",
+"+.#++++++++++++++++++#.+",
+"+.+%OOOOOOO%%%%%%%%%%+.+",
+"+.+O O%%%...#%%+.+",
+"+.+O $OOO$ O%%%.+X.X%+.+",
+"+.+O O%%%O O%%%.+X.X%+.+",
+"+.+O O%%%O O%%%...#%%+.+",
+"+.+O O%%%O O%%%...%%%+.+",
+"+.+O $OOO$ O%%%.#.#%%+.+",
+"+.+O O%%%.XX.X%+.+",
+"+.+%OOOOOOO%%%%%%%%%%+.+",
+"+.+%%%%%%%%%%%%oOo%%%+.+",
+"+.+%%%%%%%%%%%@ @%%+.+",
+"+.+%%%%%%%%%%@ $O$ @%+.+",
+"+.+%%%%%%%%%o $%%%$ o+.+",
+"+.+%%%%%%%%%O O%%%O O+.+",
+"+.+%%%%%%%%%o $%%%$ %+.+",
+"+.+%%%%%%%%%%@ $O$ @%+.+",
+"+.+%%%%%%%%%%%@ @%%+.+",
+"+.+%%%%%%%%%%%%%O%%%%+.+",
+"+.#++++++++++++++++++#.+",
+"+......................+",
+"%++++++++++++++++++++++%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup3.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup3.wxd
new file mode 100644
index 0000000000..fe474e300d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup3.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 0 0 0 143 255 255 255 16 0 4 0
+ 1016000 15240000 1016000 15240000 0
+11 0 0 0 0 255 255 255 16 0 4 0
+ 3048000 7112000 9144000 13208000 0
+9 0 0 0 0 255 255 255 16 0 4 0
+ 11176000 5080000 2032000
+4 9 0 0 0 143 12 0 4 1 1 8 0 8 4 0 8 4
+ 9652000 8636000 0
+ 9652000 13208000 0
+ 10668000 13208000 1
+ 12700000 13208000 1
+ 13208000 12192000 -1
+ 12700000 11176000 1
+ 10668000 11176000 1
+ 9652000 11176000 0
+ 13208000 8636000 0
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup3.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup3.xpm
new file mode 100644
index 0000000000..e327888fcb
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bgroup3.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_bgroup3[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 10 1",
+/* colors */
+" c #000000",
+". c #00008F",
+"X c #6C6C6C",
+"o c #4C4C4C",
+"O c #4C4CB0",
+"+ c #5E5EB8",
+"@ c #171799",
+"# c #0B0B0B",
+"$ c #7676C3",
+"% c None",
+/* pixels */
+"%OOOOOOOOOOOOOOOOOOOOOO%",
+"O......................O",
+"O.@OOOOOOOOOOOOOOOOOO@.O",
+"O.O%ooooooo%%%%%%%%%%O.O",
+"O.Oo o%+.....$%O.O",
+"O.Oo #ooo# o%+.%%%@.%O.O",
+"O.Oo o%%%o o%+.%%%@.%O.O",
+"O.Oo o%%%o o%+.....$%O.O",
+"O.Oo o%%%o o%+...+%%%O.O",
+"O.Oo #ooo# o%+.+..$%%O.O",
+"O.Oo o%+.%%@.@%O.O",
+"O.O%ooooooo%%$.%%%+.%O.O",
+"O.O%%%%%%%%%%%%XoX%%%O.O",
+"O.O%%%%%%%%%%%# #%%O.O",
+"O.O%%%%%%%%%%# #o# #%O.O",
+"O.O%%%%%%%%%X #%%%# XO.O",
+"O.O%%%%%%%%%o o%%%o oO.O",
+"O.O%%%%%%%%%X #%%%# %O.O",
+"O.O%%%%%%%%%%# #o# #%O.O",
+"O.O%%%%%%%%%%%# #%%O.O",
+"O.O%%%%%%%%%%%%%o%%%%O.O",
+"O.@OOOOOOOOOOOOOOOOOO@.O",
+"O......................O",
+"%OOOOOOOOOOOOOOOOOOOOOO%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bimg.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bimg.wxd
new file mode 100644
index 0000000000..d1784a07ee
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bimg.wxd
@@ -0,0 +1,27 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+3 2 0 0 143 0 16 0 4 1 0 8 0 16 8 0 16 8
+ 2032000 14224000
+ 2032000 2032000
+3 5 0 0 143 0 16 0 4 1 1 8 0 16 8 0 16 8
+ 4064000 2032000
+ 4064000 14224000
+ 6096000 8128000
+ 8128000 14224000
+ 8128000 2032000
+4 15 0 0 143 0 16 0 4 1 1 8 0 16 8 0 16 8
+ 14224000 9144000 0
+ 14224000 12192000 1
+ 14224000 14224000 1
+ 12192000 14224000 1
+ 10160000 14224000 1
+ 10160000 12192000 1
+ 10160000 4064000 1
+ 10160000 2032000 1
+ 12192000 2032000 1
+ 14224000 2032000 1
+ 14224000 4064000 1
+ 14224000 5080000 1
+ 14224000 7112000 1
+ 12700000 7112000 1
+ 12192000 7112000 0
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bimg.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bimg.xpm
new file mode 100644
index 0000000000..ca43f47657
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bimg.xpm
@@ -0,0 +1,39 @@
+/* XPM */
+static const char *xpm_wxd_bimg[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 8 1",
+/* colors */
+" c #0F960F",
+". c #008F00",
+"X c #018F01",
+"o c #3AA93A",
+"O c #199A19",
+"+ c #88CB88",
+"@ c #67BC67",
+"# c None",
+/* pixels */
+"########################",
+"########################",
+"## # #### ##O....O###",
+"##..#..####..#O......O##",
+"##..#..o##o..#..####..##",
+"##..#..X##X..#..####..##",
+"##..#...##...#..####..##",
+"##..#...oo...#..####..##",
+"##..#...XX...#..####..##",
+"##..#........#..####..##",
+"##..#.. .. ..#..####..##",
+"##..#..@..@..#..####++##",
+"##..#..# #..#..#+@@####",
+"##..#..####..#..#....o##",
+"##..#..####..#..#+@o.X##",
+"##..#..####..#..####..##",
+"##..#..####..#..####..##",
+"##..#..####..#..####..##",
+"##..#..####..#..####..##",
+"##..#..####..#..+###..##",
+"##..#..####..#O......O##",
+"## # #### ##O....O###",
+"########################",
+"########################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-blib.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-blib.wxd
new file mode 100644
index 0000000000..f344e65e6d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-blib.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+7 9 0 0 143 0 255 255 255 16 0 4 1 8 0
+ 10160000 2032000 0
+ 10160000 14224000 0
+ 13208000 14224000 1
+ 15240000 11176000 1
+ 13208000 8128000 1
+ 10160000 8128000 0
+ 13208000 8128000 1
+ 15240000 5080000 1
+ 13208000 2032000 1
+3 3 0 0 143 0 16 0 4 1 1 8 0 16 8 0 16 8
+ 2032000 14224000
+ 2032000 2032000
+ 6096000 2032000
+3 2 0 0 143 0 16 0 4 1 1 8 0 16 8 0 16 8
+ 8128000 14224000
+ 8128000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-blib.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-blib.xpm
new file mode 100644
index 0000000000..67bb92809a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-blib.xpm
@@ -0,0 +1,38 @@
+/* XPM */
+static const char *xpm_wxd_blib[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 7 1",
+/* colors */
+" c #0F960F",
+". c #229E22",
+"X c #008F00",
+"o c #039003",
+"O c #5FB95F",
+"+ c #3FAB3F",
+"@ c None",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@ @@@@@@@ @ XXo.@@@@@",
+"@@XX@@@@@@@XX@XXXXXX+@@@",
+"@@XX@@@@@@@XX@XX@@+XXO@@",
+"@@XX@@@@@@@XX@XX@@@OXX@@",
+"@@XX@@@@@@@XX@XX@@@@ XO@",
+"@@XX@@@@@@@XX@XX@@@@+XO@",
+"@@XX@@@@@@@XX@XX@@@@ XO@",
+"@@XX@@@@@@@XX@XX@@@OXX@@",
+"@@XX@@@@@@@XX@XX@@+XXO@@",
+"@@XX@@@@@@@XX@XXXXXX+@@@",
+"@@XX@@@@@@@XX@XXXXXX+@@@",
+"@@XX@@@@@@@XX@XX@@+XXO@@",
+"@@XX@@@@@@@XX@XX@@@OXX@@",
+"@@XX@@@@@@@XX@XX@@@@ XO@",
+"@@XX@@@@@@@XX@XX@@@@+XO@",
+"@@XX@@@@@@@XX@XX@@@@ XO@",
+"@@XX@@@@@@@XX@XX@@@OXX@@",
+"@@XX@@@@@@@XX@XX@@+XXO@@",
+"@@XXXXXXX @XX@XXXXXX+@@@",
+"@@ XXXXXX @ @ XXo.@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmodifys.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmodifys.wxd
new file mode 100644
index 0000000000..b2bf070f39
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmodifys.wxd
@@ -0,0 +1,30 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+3 14 0 0 0 143 16 0 4 1 1 8 0 16 8 0 16 8
+ 6604000 2032000
+ 6604000 1778000
+ 7366000 1016000
+ 8890000 1016000
+ 9652000 1778000
+ 9652000 3302000
+ 8890000 4064000
+ 7366000 4064000
+ 6604000 4826000
+ 6604000 6350000
+ 7366000 7112000
+ 8890000 7112000
+ 9652000 6350000
+ 9652000 6096000
+13 1 63 63 63
+ 2032000 2032000 36
+13 1 63 63 63
+ 14224000 2032000 36
+13 1 63 63 63
+ 2032000 14224000 36
+13 1 178 178 221
+ 14224000 14224000 36
+4 4 2 0 0 143 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 2032000 0
+ 2032000 14224000 1
+ 14224000 14224000 1
+ 14224000 2032000 0
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmodifys.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmodifys.xpm
new file mode 100644
index 0000000000..8649bd859c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmodifys.xpm
@@ -0,0 +1,42 @@
+/* XPM */
+static const char *xpm_wxd_bmodifys[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 11 1",
+/* colors */
+" c #00008F",
+". c #7E7EAB",
+"X c #25259F",
+"o c #4C4CB0",
+"O c #CBCBDE",
+"+ c #070792",
+"@ c #3F3F3F",
+"# c #ACACDA",
+"$ c #1E1E67",
+"% c #8A8A8A",
+"& c None",
+/* pixels */
+"&&%%&&&&&&&&&&&&&&&&OO&&",
+"&@@@@&&&&&&&&&&&&&&####&",
+"%@@@@%&&&&&&&&&&&&O####O",
+"%@@@@%&&X X&&O####O",
+"&@@@@&X X&####&",
+"&&%%&+ o&&&&&&o +&OO&&",
+"&&&&X +&&&&&&&&&&+ X&&&&",
+"&&&& &&&&&&&&&&&& &&&&",
+"&&&o X&&&&&&&&&&&&X o&&&",
+"&&&+ &&&&&&&&&&&&&& +&&&",
+"&&& &&&&&&&&&&&&&& &&&",
+"&&& &&&&&&&&&&&&&& &&&",
+"&&. X&&&&&.oo.&&&&&X .&&",
+"&&o o&&&&o o&&&&o o&&",
+"&&o o&&&& oo &&&&o o&&",
+"&&X .&&&& +&&X &&&&. X&&",
+"&&+ &&&&& +&&&&&&&&& +&&",
+"&& &&&&&+ +&&&&&& &&",
+"&& &&&&&&+ +&&&&& &&",
+"&@ $&&&&&&&&+ &&&&$ @&",
+"%@ @%&&& X&&+ &&&%@ @%",
+"%@ @%&&& oo &&&%@ @%",
+"&@@@@&&&&o o&&&&@@@@&",
+"&&%%&&&&&&.oo.&&&&&&%%&&"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmove.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmove.wxd
new file mode 100644
index 0000000000..fd1707be7f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmove.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+3 5 0 0 0 143 24 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 2032000
+ 2032000 14224000
+ 8128000 2032000
+ 14224000 14224000
+ 14224000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmove.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmove.xpm
new file mode 100644
index 0000000000..6533b38332
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmove.xpm
@@ -0,0 +1,40 @@
+/* XPM */
+static const char *xpm_wxd_bmove[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 9 1",
+/* colors */
+" c #00008F",
+". c #3A3AA8",
+"X c #3D3DAA",
+"o c #3E3EAA",
+"O c #5050B2",
+"+ c #090993",
+"@ c #3F3FAB",
+"# c #3333A5",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$OO$$$$$$$$$$$$$$$$OO$$",
+"$O X$$$$$$$$$$$$$$X O$",
+"$# $$$$$$$$$$$$$$ #$",
+"$# .$$$$$$$$$$$$o #$",
+"$# $$$$$$$$$$$$ #$",
+"$# .$$$$$$$$$$o #$",
+"$# $$$$$$$$$$ #$",
+"$# .$$$$$$$$o #$",
+"$# $$$$$$$$ #$",
+"$# + X$$$$$$X + #$",
+"$# #o $$$$$$ .# #$",
+"$# #$ .$$$$o $# #$",
+"$# #$o $$$$ .$# #$",
+"$# #$$ .$$o $$# #$",
+"$# #$$o $$ .$$# #$",
+"$# #$$$ XX $$$# #$",
+"$# #$$$o .$$$# #$",
+"$# #$$$$ $$$$# #$",
+"$# #$$$$o .$$$$# #$",
+"$# #$$$$$ $$$$$# #$",
+"$O O$$$$$@ @$$$$$O O$",
+"$$OO$$$$$$$OO$$$$$$$OO$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmvpoint.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmvpoint.wxd
new file mode 100644
index 0000000000..09239b3c11
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmvpoint.wxd
@@ -0,0 +1,17 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+3 3 0 0 0 143 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 14224000
+ 14224000 8128000
+ 2032000 2032000
+3 3 0 0 0 143 16 2 4 0 1 8 0 8 4 0 8 4
+ 2032000 14224000
+ 6096000 8128000
+ 2032000 2032000
+3 5 0 0 0 143 16 0 4 1 1 8 0 8 4 0 8 4
+ 9144000 12700000
+ 10668000 15240000
+ 12192000 12700000
+ 13716000 15240000
+ 15240000 12700000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmvpoint.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmvpoint.xpm
new file mode 100644
index 0000000000..c821309878
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bmvpoint.xpm
@@ -0,0 +1,40 @@
+/* XPM */
+static const char *xpm_wxd_bmvpoint[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 9 1",
+/* colors */
+" c #00008F",
+". c #01018F",
+"X c #25259F",
+"o c #040491",
+"O c #060692",
+"+ c #070792",
+"@ c #6464BB",
+"# c #5353B3",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$@$$$$@$$$",
+"$$$$$$$$$$$$$$# o$$o #$$",
+"$$+o#$$$$$$$$$. ## .$$",
+"$$O O@$$$$$$X o o X$",
+"$$$#O O@$$$$ $X X$ $",
+"$$$$$#+ o@$@ #$$..$$# @",
+"$$$$@ X@+ o#$$$$$$$$$$$",
+"$$$$$ X$$@+ o@$$$$$$$$$",
+"$$$$$$$$$$$@+ o@$$$$$$$",
+"$$$$$$$$$$$$$@+ o@$$$$$",
+"$$$$$$$X $$$$$$@O O@$$$",
+"$$$$$$$X @$$$$$$$@O +$$",
+"$$$$$$$$$$$$$$$$$@O +$$",
+"$$$$$$$$$$$$$$$@O O@$$$",
+"$$$$$$++$$$$$@+ o@$$$$$",
+"$$$$$$++$$$@+ o@$$$$$$$",
+"$$$$$$$$$@+ o@$$$$$$$$$",
+"$$$$$$$@+ o@$$$$$$$$$$$",
+"$$$X X+ o@$$$$$$$$$$$$$",
+"$$$+ O@$$$$$$$$$$$$$$$",
+"$$+ O@$$$$$$$$$$$$$$$$$",
+"$$+O@$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-boarc.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-boarc.wxd
new file mode 100644
index 0000000000..05043a819b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-boarc.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+5 0 0 143 0 16 0 4 1 0 8 4 0 8 4
+ 14224000 2032000 11176000 11176000 2032000 14224000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-boarc.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-boarc.xpm
new file mode 100644
index 0000000000..f4dd48c258
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-boarc.xpm
@@ -0,0 +1,39 @@
+/* XPM */
+static const char *xpm_wxd_boarc[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 8 1",
+/* colors */
+" c #59B659",
+". c #119611",
+"X c #008F00",
+"o c #018F01",
+"O c #27A027",
+"+ c #069206",
+"@ c #88CB88",
+"# c None",
+/* pixels */
+"########################",
+"########################",
+"##.XXXXX+O@#############",
+"##.XXXXXXXXo ###########",
+"######### +XXo #########",
+"############.XXO########",
+"############# oX.#######",
+"###############+X.######",
+"################+XO#####",
+"#################oX ####",
+"################# Xo####",
+"##################.X ###",
+"###################Xo###",
+"###################+X@##",
+"################### XO##",
+"####################X+##",
+"####################XX##",
+"####################XX##",
+"####################XX##",
+"####################XX##",
+"####################XX##",
+"####################..##",
+"########################",
+"########################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolygon.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolygon.wxd
new file mode 100644
index 0000000000..d2ac81aa74
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolygon.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+6 5 0 0 143 0 255 255 255 16 0 4 1 8 0
+ 2032000 2032000
+ 2032000 14224000
+ 14224000 14224000
+ 8128000 8128000
+ 14224000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolygon.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolygon.xpm
new file mode 100644
index 0000000000..054acfd335
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolygon.xpm
@@ -0,0 +1,38 @@
+/* XPM */
+static const char *xpm_wxd_bpolygon[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 7 1",
+/* colors */
+" c #0F960F",
+". c #008F00",
+"X c #018F01",
+"o c #0A930A",
+"O c #0C940C",
+"+ c #0D950D",
+"@ c None",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@ .................. @@",
+"@@...................+@@",
+"@@..@@@@@@@@@@@@@@X.O@@@",
+"@@..@@@@@@@@@@@@@+.o@@@@",
+"@@..@@@@@@@@@@@@+.o@@@@@",
+"@@..@@@@@@@@@@@+.o@@@@@@",
+"@@..@@@@@@@@@@+.o@@@@@@@",
+"@@..@@@@@@@@@+.o@@@@@@@@",
+"@@..@@@@@@@@+.o@@@@@@@@@",
+"@@..@@@@@@@+.O@@@@@@@@@@",
+"@@..@@@@@@@+.O@@@@@@@@@@",
+"@@..@@@@@@@@+.o@@@@@@@@@",
+"@@..@@@@@@@@@+.o@@@@@@@@",
+"@@..@@@@@@@@@@+.o@@@@@@@",
+"@@..@@@@@@@@@@@+.o@@@@@@",
+"@@..@@@@@@@@@@@@+.o@@@@@",
+"@@..@@@@@@@@@@@@@+.o@@@@",
+"@@..@@@@@@@@@@@@@@X.O@@@",
+"@@...................+@@",
+"@@ .................. @@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolyline.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolyline.wxd
new file mode 100644
index 0000000000..3a10f3d957
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolyline.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+3 5 0 0 143 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 2032000
+ 2032000 14224000
+ 14224000 14224000
+ 8128000 8128000
+ 14224000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolyline.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolyline.xpm
new file mode 100644
index 0000000000..45437eab00
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bpolyline.xpm
@@ -0,0 +1,38 @@
+/* XPM */
+static const char *xpm_wxd_bpolyline[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 7 1",
+/* colors */
+" c #0F960F",
+". c #008F00",
+"X c #018F01",
+"o c #0A930A",
+"O c #0C940C",
+"+ c #0D950D",
+"@ c None",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@ .................. @@",
+"@@...................+@@",
+"@@..@@@@@@@@@@@@@@X.O@@@",
+"@@..@@@@@@@@@@@@@+.o@@@@",
+"@@..@@@@@@@@@@@@+.o@@@@@",
+"@@..@@@@@@@@@@@+.o@@@@@@",
+"@@..@@@@@@@@@@+.o@@@@@@@",
+"@@..@@@@@@@@@+.o@@@@@@@@",
+"@@..@@@@@@@@+.o@@@@@@@@@",
+"@@..@@@@@@@+.O@@@@@@@@@@",
+"@@..@@@@@@@+.O@@@@@@@@@@",
+"@@..@@@@@@@@+.o@@@@@@@@@",
+"@@..@@@@@@@@@+.o@@@@@@@@",
+"@@..@@@@@@@@@@+.o@@@@@@@",
+"@@..@@@@@@@@@@@+.o@@@@@@",
+"@@..@@@@@@@@@@@@+.o@@@@@",
+"@@..@@@@@@@@@@@@@+.o@@@@",
+"@@..@@@@@@@@@@@@@@+.o@@@",
+"@@..@@@@@@@@@@@@@@@O.+@@",
+"@@ @@@@@@@@@@@@@@@@+ @@",
+"@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-brectangle.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brectangle.wxd
new file mode 100644
index 0000000000..ab23a8172c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brectangle.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 0 0 143 0 255 255 255 16 0 4 0
+ 2032000 14224000 4064000 12192000 0
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-brectangle.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brectangle.xpm
new file mode 100644
index 0000000000..6047a8cda9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brectangle.xpm
@@ -0,0 +1,33 @@
+/* XPM */
+static const char *xpm_wxd_brectangle[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 2 1",
+/* colors */
+" c #008F00",
+". c None",
+/* pixels */
+"........................",
+"........................",
+"........................",
+"........................",
+"........................",
+".. ..",
+".. ..",
+".. ................ ..",
+".. ................ ..",
+".. ................ ..",
+".. ................ ..",
+".. ................ ..",
+".. ................ ..",
+".. ................ ..",
+".. ................ ..",
+".. ................ ..",
+".. ................ ..",
+".. ..",
+".. ..",
+"........................",
+"........................",
+"........................",
+"........................",
+"........................"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotleft.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotleft.wxd
new file mode 100644
index 0000000000..856f362ad6
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotleft.wxd
@@ -0,0 +1,23 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 6
+5 0 0 0 143 16 0 4 1 3 4 2 0 16 8
+ 15240000 2032000 11684000 11684000 3048000 15240000
+4 13 0 0 0 143 16 0 4 0 0 8 0 16 8 0 16 8
+ 1016000 3048000 0
+ 1016000 2032000 1
+ 2540000 2032000 -1
+ 4064000 2032000 1
+ 4064000 4064000 -1
+ 4064000 6096000 -1
+ 4064000 8128000 1
+ 3048000 8128000 -1
+ 1016000 8128000 1
+ 1016000 6604000 -1
+ 1016000 5588000 1
+ 2540000 5080000 -1
+ 4064000 5588000 0
+10 0 0 0 143 255 255 255 16 0 4 0
+ 8128000 5080000 2032000 3048000 0
+9 0 0 0 143 255 255 255 8 0 4 0
+ 11938000 7620000 1016000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotleft.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotleft.xpm
new file mode 100644
index 0000000000..452a519997
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotleft.xpm
@@ -0,0 +1,40 @@
+/* XPM */
+static const char *xpm_wxd_brotleft[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 9 1",
+/* colors */
+" c #00008F",
+". c #030390",
+"X c #1C1C9B",
+"o c #2E2EA3",
+"O c #0C0C94",
+"+ c #8989CB",
+"@ c #6868BC",
+"# c #4545AD",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$X OXXo#$$$$$$$$$$$",
+"$$$$$$$@. o$$$$$$$$",
+"$$$$$$$$$# O$$$$$$",
+"$$$$$$$$$$$. o$$$$",
+"$$$$$$$$$$$$O o$$$",
+"$$$$$$$$$$$$$. #$$$$",
+"$$$$$$$$$$$$$$ +$$$$",
+"$$$$$$$$$$$$$$# O .$$$$",
+"$$$$$$$$$$$$$$$.#$X X$$$",
+"$$$$$$$$$$$$$$$$$$$ $$$",
+"$# .$$$$o o$$XX.o X$$",
+"$ O$$X X$o$@# $$",
+"# o$$ $+ .$$. @O$o@o #$",
+"# #$$ $X @$$@ X$o@$$ .$",
+"@ oX $ $$$$ $$$$$ $",
+"$o $ $$$$ $$$$$O $",
+"$$$@# $ $$$$ $$$$$o @",
+"$$$$$ $X @$$@ X$$$$$# #",
+"$$+$$ $$ .$$. $$$$$$# #",
+"@ X$$X X$$$$$$# #",
+"$X O$$$$o o$$$$$$$+ +",
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotright.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotright.wxd
new file mode 100644
index 0000000000..1939ad6467
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotright.wxd
@@ -0,0 +1,23 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 6
+5 0 0 0 143 16 0 4 1 0 4 2 3 4 2
+ 15240000 2032000 11684000 11684000 3048000 15240000
+4 13 0 0 0 143 16 0 4 0 0 8 0 16 8 0 16 8
+ 1016000 3048000 0
+ 1016000 2032000 1
+ 2540000 2032000 -1
+ 4064000 2032000 1
+ 4064000 4064000 -1
+ 4064000 6096000 -1
+ 4064000 8128000 1
+ 3048000 8128000 -1
+ 1016000 8128000 1
+ 1016000 6604000 -1
+ 1016000 5588000 1
+ 2540000 5080000 -1
+ 4064000 5588000 0
+10 0 0 0 143 255 255 255 16 0 4 0
+ 8128000 5080000 2032000 3048000 0
+9 0 0 0 143 255 255 255 8 0 4 0
+ 11938000 7620000 1016000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotright.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotright.xpm
new file mode 100644
index 0000000000..46b66ac995
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-brotright.xpm
@@ -0,0 +1,39 @@
+/* XPM */
+static const char *xpm_wxd_brotright[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 8 1",
+/* colors */
+" c #00008F",
+". c #141498",
+"X c #4B4BAF",
+"o c #070792",
+"O c #7474C2",
+"+ c #2E2EA3",
+"@ c #1F1F9C",
+"# c None",
+/* pixels */
+"####XXO#################",
+"###X oX#############",
+"####X++o .###########",
+"##########+ +#########",
+"############X ########",
+"##############. O# +###",
+"###############+ ###",
+"################. +##",
+"###############+ ##",
+"###############o O#",
+"################@ @#",
+"#X ####+ +##.o #",
+"# o##@ @#+#@ #",
+"X +## #O ## Xo#+@ #",
+"X X## #. X##X .#+O#o #",
+"O +. # #### ####O #",
+"#+ # #### #####o #",
+"###XX # #### #####O #",
+"##### #@ X##X @######o#",
+"##O## ## ## #######O#",
+"O .##@ @#########",
+"#@ .####+ +##########",
+"########################",
+"########################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineca.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineca.wxd
new file mode 100644
index 0000000000..e493c29c9e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineca.wxd
@@ -0,0 +1,26 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+13 1 63 63 63
+ 2032000 8128000 24
+13 1 63 63 63
+ 11176000 2032000 24
+13 1 63 63 63
+ 5080000 2032000 24
+13 1 63 63 63
+ 5080000 14224000 24
+13 1 63 63 63
+ 11176000 14224000 24
+13 1 63 63 63
+ 14224000 8128000 24
+13 1 63 63 63
+ 8128000 8128000 24
+7 8 2 0 143 0 255 255 255 16 0 4 1 8 0
+ 2032000 8128000 1
+ 5080000 14224000 1
+ 8128000 8128000 1
+ 11176000 2032000 1
+ 14224000 8128000 1
+ 11176000 14224000 1
+ 8128000 8128000 1
+ 5080000 2032000 1
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineca.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineca.xpm
new file mode 100644
index 0000000000..2cda5922d5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineca.xpm
@@ -0,0 +1,42 @@
+/* XPM */
+static const char *xpm_wxd_bsplineca[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 11 1",
+/* colors */
+" c #239E23",
+". c #257D25",
+"X c #008F00",
+"o c #949494",
+"O c #149814",
+"+ c #3D3D3D",
+"@ c #608C60",
+"# c #069106",
+"$ c #66BC66",
+"% c #0C940C",
+"& c None",
+/* pixels */
+"&&&&&&&&&&&&&&&&&&&&&&&&",
+"&&&&&&&@&&&&&&&&@&&&&&&&",
+"&&&&&&+++&&&&&&+++&&&&&&",
+"&&&&&&+++&&&&&&+++&&&&&&",
+"&&&&&&&@&&&&&&&&@&&&&&&&",
+"&&&&&&OXO&&&&&&OXO&&&&&&",
+"&&&&&%XXX#&&&&#XXX%&&&&&",
+"&&&&$X#&OX && XO&#X$&&&&",
+"&&&&#X$&&XX$$XX&&$X#&&&&",
+"&&&&XX&&&$X%%X$&&&XX&&&&",
+"&&@.X &&&&#XX#&&&& X.@&&",
+"&@+.X$&&&&.XX.&&&&$X.+@&",
+"&@+.X$&&&&.XX.&&&&$X.+o&",
+"&&@.X &&&&#XX#&&&& X.o&&",
+"&&&&XX&&&$X%%X$&&&XX&&&&",
+"&&&&#X$&&XX$$XX&&$X#&&&&",
+"&&&&$X#&OX && XO&#X$&&&&",
+"&&&&&%XXX#&&&&#XXX%&&&&&",
+"&&&&&&OXO&&&&&&OXO&&&&&&",
+"&&&&&&&@&&&&&&&&@&&&&&&&",
+"&&&&&&+++&&&&&&+++&&&&&&",
+"&&&&&&+++&&&&&&+++&&&&&&",
+"&&&&&&&@&&&&&&&&@&&&&&&&",
+"&&&&&&&&&&&&&&&&&&&&&&&&"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineci.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineci.wxd
new file mode 100644
index 0000000000..897865e5da
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineci.wxd
@@ -0,0 +1,26 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+13 1 63 63 63
+ 2032000 8128000 36
+13 1 63 63 63
+ 11176000 2032000 36
+13 1 63 63 63
+ 5080000 2032000 36
+13 1 63 63 63
+ 5080000 14224000 36
+13 1 63 63 63
+ 11176000 14224000 36
+13 1 63 63 63
+ 14224000 8128000 36
+13 1 63 63 63
+ 8128000 8128000 36
+7 8 2 0 143 0 255 255 255 16 0 4 1 8 0
+ 2032000 8128000 -1
+ 5080000 14224000 -1
+ 8128000 8128000 -1
+ 11176000 2032000 -1
+ 14224000 8128000 -1
+ 11176000 14224000 -1
+ 8128000 8128000 -1
+ 5080000 2032000 -1
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineci.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineci.xpm
new file mode 100644
index 0000000000..0d4075c975
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineci.xpm
@@ -0,0 +1,40 @@
+/* XPM */
+static const char *xpm_wxd_bsplineci[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 9 1",
+/* colors */
+" c #107910",
+". c #237023",
+"X c #384238",
+"o c #239A23",
+"O c #008F00",
+"+ c #878787",
+"@ c #089208",
+"# c #54B454",
+"$ c None",
+/* pixels */
+"$$$$$$$+$$$$$$$$+$$$$$$$",
+"$$$$$+XXX+$$$$+XXX+$$$$$",
+"$$$$$X O X$$$$X O X$$$$$",
+"$$$$$ OOO $$$$ OOO $$$$$",
+"$$$$$OO OO$$$$OO OO$$$$$",
+"$$$$oOo+@O#$$#O@+oOo$$$$",
+"$$$$OO$$#O@$$@O#$$OO$$$$",
+"$$$oO#$$$OO$$OO$$$#Oo$$$",
+"$$$OO$$$$oO##Oo$$$$OO$$$",
+"$$oOo$$$$$OOOO$$$$$oOo$$",
+"$XOO.$$$$$OOOO$$$$$.OOX$",
+"+XOOX+$$$+.OO.+$$$+XOOX+",
+"+XOOX+$$$+.OO.+$$$+XOOX+",
+"$XOO.$$$$$OOOO$$$$$.OOX$",
+"$$oOo$$$$$OOOO$$$$$oOo$$",
+"$$$OO$$$$oO##Oo$$$$OO$$$",
+"$$$oO#$$$OO$$OO$$$#Oo$$$",
+"$$$$OO$$#O@$$@O#$$OO$$$$",
+"$$$$oOo+@O#$$#O@+oOo$$$$",
+"$$$$$OO OO$$$$OO OO$$$$$",
+"$$$$$ OOO $$$$ OOO $$$$$",
+"$$$$$X O X$$$$X O X$$$$$",
+"$$$$$+XXX+$$$$+XXX+$$$$$",
+"$$$$$$$+$$$$$$$$+$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoa.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoa.wxd
new file mode 100644
index 0000000000..fc0532ab3a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoa.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+13 1 63 63 63
+ 2032000 2032000 36
+13 1 63 63 63
+ 14224000 2032000 36
+13 1 63 63 63
+ 8128000 2032000 36
+13 1 63 63 63
+ 5080000 14224000 36
+13 1 63 63 63
+ 11176000 14224000 36
+4 5 2 0 143 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 2032000 0
+ 5080000 14224000 1
+ 8128000 2032000 1
+ 11176000 14224000 1
+ 14224000 2032000 0
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoa.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoa.xpm
new file mode 100644
index 0000000000..dba9a1a65b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoa.xpm
@@ -0,0 +1,40 @@
+/* XPM */
+static const char *xpm_wxd_bsplineoa[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 9 1",
+/* colors */
+" c #008F00",
+". c #275C27",
+"X c #3D3D3D",
+"o c #078607",
+"O c #2CA22C",
+"+ c #64AC64",
+"@ c #8A8A8A",
+"# c #0D940D",
+"$ c None",
+/* pixels */
+"$$$$$$$@$$$$$$$$@$$$$$$$",
+"$$$$$@XXX@$$$$@XXX@$$$$$",
+"$$$$$XXXXX$$$$XXXXX$$$$$",
+"$$$$$XXXXX$$$$XXXXX$$$$$",
+"$$$$$@XXX@$$$$@XXX@$$$$$",
+"$$$$$$$@$$$$$$$$@$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$O O$$$$$$O O$$$$$$",
+"$$$$$+ O$$$$O +$$$$$",
+"$$$$$# # $$$$ O #$$$$$",
+"$$$$$ $O O$$O O$ $$$$$",
+"$$$$O O$$ $$ $$O O$$$$",
+"$$$$ $$$O ## O$$$ $$$$",
+"$$$$ $$$$ $$$$ $$$$",
+"$$$+ O$$$$$##$$$$$O +$$$",
+"$$$# +$$$$$$$$$$$$+ #$$$",
+"$$$ $$$$$$$$$$$$$$ $$$",
+"$$O #$$$$$$@@$$$$$$# O$$",
+"$Xo o$$$$$XXXX$$$$$o oX$",
+"@X .@$$$@XXXX@$$$@. X@",
+"@XooX@$$$@XXXX@$$$@XooX@",
+"$XXXX$$$$$XXXX$$$$$XXXX$",
+"$$@@$$$$$$$@@$$$$$$$@@$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoi.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoi.wxd
new file mode 100644
index 0000000000..afd03ffca2
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoi.wxd
@@ -0,0 +1,19 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+13 1 63 63 63
+ 2032000 2032000 36
+13 1 63 63 63
+ 14224000 2032000 36
+13 1 63 63 63
+ 8128000 2032000 36
+13 1 63 63 63
+ 5080000 14224000 36
+13 1 63 63 63
+ 11176000 14224000 36
+4 5 2 0 143 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 2032000 2032000 0
+ 5080000 14224000 -1
+ 8128000 2032000 -1
+ 11176000 14224000 -1
+ 14224000 2032000 0
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoi.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoi.xpm
new file mode 100644
index 0000000000..7e040652fb
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bsplineoi.xpm
@@ -0,0 +1,42 @@
+/* XPM */
+static const char *xpm_wxd_bsplineoi[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 11 1",
+/* colors */
+" c #368236",
+". c #127B12",
+"X c #008F00",
+"o c #828282",
+"O c #3C403C",
+"+ c #5FB85F",
+"@ c #079207",
+"# c #1C9B1C",
+"$ c #314D31",
+"% c #8B8B8B",
+"& c None",
+/* pixels */
+"&&&&&&&o&&&&&&&&o&&&&&&&",
+"&&&&&oO$Oo&&&&oO$Oo&&&&&",
+"&&&&&O.X.O&&&&O.X.O&&&&&",
+"&&&&&$XXX$&&&&$XXX$&&&&&",
+"&&&&& XXX &&&& XXX &&&&&",
+"&&&&&@XXX#&&&&#XXX@&&&&&",
+"&&&&&XX+XX&&&&XX+XX&&&&&",
+"&&&&&X@&XX&&&&XX&@X&&&&&",
+"&&&&+X &XX&&&&XX& X+&&&&",
+"&&&&#X+&#X+&&+X#&+X#&&&&",
+"&&&&XX&&+X+&&+X+&&XX&&&&",
+"&&&&XX&&+X#&&#X+&&XX&&&&",
+"&&&+X#&&&XX&&XX&&&#X+&&&",
+"&&& X+&&&XX&&XX&&&+X &&&",
+"&&&@X&&&&XX&&XX&&&&X@&&&",
+"&&&XX&&&&#X++X#&&&&XX&&&",
+"&&&XX&&&&+X++X+&&&&XX&&&",
+"&&+X#&&&&+X##X+&&&&#X+&&",
+"&&#X &&&&&XXXX&&&&& X#&&",
+"&OXX.&&&&&XXXX&&&&&.XXO&",
+"%$XX$%&&&%.XX.%&&&%$XX$%",
+"%OXXO%&&&%$XX$%&&&%OXXO%",
+"&OOOO&&&&&OOOO&&&&&OOOO&",
+"&&%%&&&&&&&%%&&&&&&&%%&&"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-btext.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-btext.wxd
new file mode 100644
index 0000000000..79cc57822f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-btext.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+3 2 0 0 143 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 8128000 3048000
+ 8128000 14224000
+3 2 0 0 143 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 4064000 14224000
+ 12192000 14224000
+3 2 0 0 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 5080000 3048000
+ 1016000 3048000
+3 2 0 0 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 3048000 5080000
+ 3048000 1016000
+3 2 0 0 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 14224000 14732000
+ 14224000 2540000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-btext.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-btext.xpm
new file mode 100644
index 0000000000..8cf8e4e373
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-btext.xpm
@@ -0,0 +1,39 @@
+/* XPM */
+static const char *xpm_wxd_btext[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 8 1",
+/* colors */
+" c #000000",
+". c #008F00",
+"X c #545454",
+"o c #0D0D0D",
+"O c #434343",
+"+ c #AFCDAF",
+"@ c #595959",
+"# c None",
+/* pixels */
+"########################",
+"####################OO##",
+"#####..............# ##",
+"#####..............# ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"###########..####### ##",
+"####@######..####### ##",
+"###X X#####..####### ##",
+"###X X#####..####### ##",
+"#@Xo oX@###..####### ##",
+"@ @##..####### ##",
+"#@Xo oX@###++####### ##",
+"###X X##################",
+"###X X##################",
+"####@###################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bungroup.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bungroup.wxd
new file mode 100644
index 0000000000..589bcf2dc8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bungroup.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 0 0 0 143 255 255 255 16 1 2 0
+ 1016000 15240000 1016000 15240000 0
+11 0 0 0 0 255 255 255 16 0 4 0
+ 3048000 7112000 9144000 13208000 0
+9 0 0 0 0 255 255 255 16 0 4 0
+ 11176000 5080000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-bungroup.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bungroup.xpm
new file mode 100644
index 0000000000..9f950ada25
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-bungroup.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_bungroup[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 10 1",
+/* colors */
+" c #000000",
+". c #00008F",
+"X c #6D6D6D",
+"o c #6F6FC0",
+"O c #4C4C4C",
+"+ c #4C4CB0",
+"@ c #8282C8",
+"# c #181899",
+"$ c #0B0B0B",
+"% c None",
+/* pixels */
+"%%%%++++%%%%++++%%%%o++%",
+"%%%+....%%%%....@%%%#..+",
+"%%%%++++%%%%++++%%%%o#.+",
+"%+%%OOOOOOO%%%%%%%%%%o#o",
+"+.+O O%%%%%%%%%%%%",
+"+.+O $OOO$ O%%%%%%%%%%%%",
+"+.+O O%%%O O%%%%%%%%%%%%",
+"+.+O O%%%O O%%%%%%%%%%@%",
+"%%%O O%%%O O%%%%%%%%%+.+",
+"%%%O $OOO$ O%%%%%%%%%+.+",
+"%%%O O%%%%%%%%%+.+",
+"%%%%OOOOOOO%%%%%%%%%%+.+",
+"+.+%%%%%%%%%%%%XOX%%%%%%",
+"+.+%%%%%%%%%%%$ $%%%%%",
+"+.+%%%%%%%%%%$ $O$ $%%%%",
+"+.+%%%%%%%%%X $%%%$ X%%%",
+"%@%%%%%%%%%%O O%%%O O+.+",
+"%%%%%%%%%%%%X $%%%$ %+.+",
+"%%%%%%%%%%%%%$ $O$ $%+.+",
+"%%%%%%%%%%%%%%$ $%%+.+",
+"o#o%%%%%%%%%%%%%O%%%%%+%",
+"+.#o%%%%++++%%%%++++%%%%",
+"+..#%%%@....%%%%....+%%%",
+"%++o%%%%++++%%%%++++%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-borders.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-borders.wxd
new file mode 100644
index 0000000000..030a5e559e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-borders.wxd
@@ -0,0 +1,25 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 6
+11 0 0 0 143 255 255 255 16 0 4 0
+ 3048000 13208000 4064000 12192000 0
+6 4 0 0 0 143 0 0 143 0 0 4 0 8 1
+ 15748000 14732000
+ 11176000 14224000
+ 10668000 9652000
+ 15240000 10160000
+6 4 0 0 0 143 0 0 143 0 0 4 0 8 1
+ 5588000 6604000
+ 1016000 6096000
+ 508000 1524000
+ 5080000 2032000
+6 4 0 0 0 143 0 0 143 0 0 4 0 8 1
+ 508000 14732000
+ 5080000 14224000
+ 5588000 9652000
+ 1016000 10160000
+6 4 0 0 0 143 0 0 143 0 0 4 0 8 1
+ 10668000 6604000
+ 15240000 6096000
+ 15748000 1524000
+ 11176000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-borders.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-borders.xpm
new file mode 100644
index 0000000000..9c266c32dc
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-borders.xpm
@@ -0,0 +1,39 @@
+/* XPM */
+static const char *xpm_wxd_tb_borders[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 8 1",
+/* colors */
+" c #00008F",
+". c #4C4CB0",
+"X c #7171C1",
+"o c #5454B4",
+"O c #4444AD",
+"+ c #0F0F96",
+"@ c #3333A5",
+"# c None",
+/* pixels */
+"########################",
+"########################",
+"#oX##################Xo#",
+"# X########X #",
+"# O########O #",
+"#+ +#",
+"#@ @#",
+"#o ######## o#",
+"#X ######## X#",
+"###@ @Xo########oX@ @###",
+"###. .############. .###",
+"###. .############. .###",
+"###. .############. .###",
+"###. .############. .###",
+"###@ @Xo########oX@ @###",
+"#X ######## X#",
+"#o ######## o#",
+"#@ @#",
+"#+ +#",
+"# O########O #",
+"# X########X #",
+"#oX##################Xo#",
+"########################",
+"########################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-open.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-open.wxd
new file mode 100644
index 0000000000..113abbe13e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-open.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 0 0 0 0 0 0 143 0 0 4 1
+ 2032000 14224000 1016000 4064000 0
+6 7 0 0 0 0 0 0 143 0 0 4 0 8 1
+ 6604000 5080000
+ 6604000 10160000
+ 3048000 10160000
+ 8128000 15240000
+ 13208000 10160000
+ 9652000 10160000
+ 9652000 5080000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-open.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-open.xpm
new file mode 100644
index 0000000000..bae6c95340
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-open.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static const char *xpm_wxd_tb_open[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 6 1",
+/* colors */
+" c #00008F",
+". c #7F7FC7",
+"X c #7777C3",
+"o c #1E1E9C",
+"O c #22229E",
+"+ c None",
+/* pixels */
+"++++++++++++++++++++++++",
+"++++++++++++++++++++++++",
+"+++++++++++Oo+++++++++++",
+"++++++++++O o++++++++++",
+"+++++++++O o+++++++++",
+"++++++++O o++++++++",
+"+++++++O o+++++++",
+"++++++O o++++++",
+"+++++O o+++++",
+"++++++++++ ++++++++++",
+"++++++++++ ++++++++++",
+"++++++++++ ++++++++++",
+"++++++++++ ++++++++++",
+"++++++++++ ++++++++++",
+"++++++++++ ++++++++++",
+"++++++++++ ++++++++++",
+"++++++++++XXXX++++++++++",
+"++++++++++++++++++++++++",
+"+++ +++",
+"+++ +++",
+"+++ +++",
+"+++ +++",
+"+++..................+++",
+"++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-save.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-save.wxd
new file mode 100644
index 0000000000..c84a42894f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-save.wxd
@@ -0,0 +1,13 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+11 0 0 0 0 0 143 0 0 0 4 1
+ 2032000 14224000 1016000 4064000 0
+6 7 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 6604000 15240000
+ 6604000 10160000
+ 3048000 10160000
+ 8128000 5080000
+ 13208000 10160000
+ 9652000 10160000
+ 9652000 15240000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-save.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-save.xpm
new file mode 100644
index 0000000000..578a182f07
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-save.xpm
@@ -0,0 +1,36 @@
+/* XPM */
+static const char *xpm_wxd_tb_save[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 5 1",
+/* colors */
+" c #229E22",
+". c #008F00",
+"X c #7FC77F",
+"o c #1E9C1E",
+"O c None",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOO....OOOOOOOOOO",
+"OOOOOOOOOO....OOOOOOOOOO",
+"OOOOOOOOOO....OOOOOOOOOO",
+"OOOOOOOOOO....OOOOOOOOOO",
+"OOOOOOOOOO....OOOOOOOOOO",
+"OOOOOOOOOO....OOOOOOOOOO",
+"OOOOOOOOOO....OOOOOOOOOO",
+"OOOOO ............oOOOOO",
+"OOOOOO ..........oOOOOOO",
+"OOOOOOO ........oOOOOOOO",
+"OOOOOOOO ......oOOOOOOOO",
+"OOOOOOOOO ....oOOOOOOOOO",
+"OOOOOOOOOO ..oOOOOOOOOOO",
+"OOOOOOOOOOO oOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO",
+"OOO..................OOO",
+"OOO..................OOO",
+"OOO..................OOO",
+"OOO..................OOO",
+"OOOXXXXXXXXXXXXXXXXXXOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.wxd
new file mode 100644
index 0000000000..7a0a2d0788
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+9 0 127 127 127 255 255 255 16 0 4 1
+ 7112000 9144000 6180086
+3 2 0 127 127 127 16 0 4 1 0 8 0 8 4 0 8 4
+ 11684000 4572000
+ 15240000 1016000
+3 3 1 0 0 0 16 0 4 1 1 8 0 8 4 0 8 4
+ 7620000 5588000
+ 7620000 12700000
+ 5080000 9652000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.xpm
new file mode 100644
index 0000000000..66a9ce9792
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-11.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_tb_zoom_11[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 16 1",
+/* colors */
+" c #000000",
+". c #7D7D7D",
+"X c #E9E9E9",
+"o c #FBFBFB",
+"O c #919191",
+"+ c #808080",
+"@ c #B7B7B7",
+"# c #DBDBDB",
+"$ c #FFFFFF",
+"% c #CACACA",
+"& c #848484",
+"* c #A8A8A8",
+"= c #3E3E3E",
+"- c #8A8A8A",
+"; c #9D9D9D",
+": c None",
+/* pixels */
+"::::::::*;O;*:::::::::::",
+"::::::&.......&:::::::::",
+"::::O...O*@*O...O:::::::",
+":::-..*X$$$$$X*..-::::::",
+"::O.+%$$$o.=#$$%+.O:::::",
+"::..%$$$$. O$$$%..:::::",
+":&.*$$$$* -$$$$*.&::::",
+":..X$$$% -$$$$X..::::",
+"*.O$$$X -$$$$$O.@:::",
+";.*$$$. @ -$$$$$*.;:::",
+"O.@$$$* ;$ -$$$$$@.O:::",
+";.*$$$$$$$ -$$$$$*.;:::",
+"@.O$$$$$$$ -$$$$$O.@:::",
+":..X$$$$$$ -$$$$X..::::",
+":&.*$$$$$$ -$$$$*.&::::",
+"::..%$$$$$ O$$$%..:::::",
+"::O.+%$$$$.=#$$%..O:::::",
+":::-..*X$$$$$X*...+:::::",
+"::::O...O*@*O...O+.&::::",
+"::::::&.......&:::&.+:::",
+"::::::::@;O;@::::::&.+::",
+"::::::::::::::::::::&.&:",
+":::::::::::::::::::::&.*",
+"::::::::::::::::::::::*:"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.wxd
new file mode 100644
index 0000000000..d63f52e818
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+9 0 127 127 127 255 255 255 16 0 4 1
+ 7112000 9144000 6180086
+3 2 0 127 127 127 16 0 4 1 0 8 0 8 4 0 8 4
+ 11684000 4572000
+ 15240000 1016000
+3 2 2 0 0 0 16 0 4 1 0 8 0 8 4 0 8 4
+ 3556000 9144000
+ 10668000 9144000
+3 2 2 0 0 0 16 0 4 1 0 8 0 8 4 0 8 4
+ 7112000 12700000
+ 7112000 5588000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.xpm
new file mode 100644
index 0000000000..f49d58b516
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-in.xpm
@@ -0,0 +1,46 @@
+/* XPM */
+static const char *xpm_wxd_tb_zoom_in[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 15 1",
+/* colors */
+" c #000000",
+". c #D6D6D6",
+"X c #7D7D7D",
+"o c #E8E8E8",
+"O c #A3A3A3",
+"+ c #808080",
+"@ c #FFFFFF",
+"# c #4E4E4E",
+"$ c #868686",
+"% c #ABABAB",
+"& c #9A9A9A",
+"* c #555555",
+"= c #333333",
+"- c #8E8E8E",
+"; c None",
+/* pixels */
+";;;;;;;;%O&O%;;;;;;;;;;;",
+";;;;;;$XXXXXXX$;;;;;;;;;",
+";;;;&XXX-%%O-XXX&;;;;;;;",
+";;;$XXOo@@@@@oOXX$;;;;;;",
+";;&X+.@@@O O@@@.+X&;;;;;",
+";;XX.@@@@# #@@@@.XX;;;;;",
+";$XO@@@@@# #@@@@@OX$;;;;",
+";XXo@@@@@# #@@@@@oXX;;;;",
+"%X-@@@@@@# #@@@@@@-X%;;;",
+"OX%@O****= =****O@OXO;;;",
+"&X%@ @%X&;;;",
+"OX%@O****= =****O@OXO;;;",
+"%X-@@@@@@# #@@@@@@-X%;;;",
+";XXo@@@@@# #@@@@@oXX;;;;",
+";$XO@@@@@# #@@@@@OX$;;;;",
+";;XX.@@@@# #@@@@.XX;;;;;",
+";;&X+.@@@O O@@@.XX-;;;;;",
+";;;$XXOo@@@@@oOXXX+;;;;;",
+";;;;&XXX-O%O-XXX-+X+;;;;",
+";;;;;;$XXXXXXX$;;;$X+;;;",
+";;;;;;;;%O&O%;;;;;;$X+;;",
+";;;;;;;;;;;;;;;;;;;;+X+;",
+";;;;;;;;;;;;;;;;;;;;;+X%",
+";;;;;;;;;;;;;;;;;;;;;;%;"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.wxd b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.wxd
new file mode 100644
index 0000000000..370929785e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 3
+9 0 127 127 127 255 255 255 16 0 4 1
+ 7112000 9144000 6180086
+3 2 0 127 127 127 16 0 4 1 0 8 0 8 4 0 8 4
+ 11684000 4572000
+ 15240000 1016000
+3 2 2 0 0 0 16 0 4 1 0 8 0 8 4 0 8 4
+ 3556000 9144000
+ 10668000 9144000
diff --git a/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.xpm b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.xpm
new file mode 100644
index 0000000000..df7e7a2ce2
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/buttons/wxd-tb-zoom-out.xpm
@@ -0,0 +1,45 @@
+/* XPM */
+static const char *xpm_wxd_tb_zoom_out[] = {
+/* width height ncolors chars_per_pixel */
+"24 24 14 1",
+/* colors */
+" c #7D7D7D",
+". c #E8E8E8",
+"X c #C6C6C6",
+"o c #A3A3A3",
+"O c #808080",
+"+ c #949494",
+"@ c #FFFFFF",
+"# c #A6A6A6",
+"$ c #848484",
+"% c #0C0C0C",
+"& c #ADADAD",
+"* c #555555",
+"= c #8B8B8B",
+"- c None",
+/* pixels */
+"--------&o+o&-----------",
+"------$ $---------",
+"----+ =#&#= +-------",
+"---= #.@@@@@.# =------",
+"--+ OX@@@@@@@@@XO +-----",
+"-- X@@@@@@@@@@@X -----",
+"-$ #@@@@@@@@@@@@@# $----",
+"- .@@@@@@@@@@@@@. ----",
+"& =@@@@@@@@@@@@@@@= &---",
+"o #@o***********o@# o---",
+"+ &@%%%%%%%%%%%%%@& +---",
+"o #@o***********o@# o---",
+"& =@@@@@@@@@@@@@@@= &---",
+"- .@@@@@@@@@@@@@. ----",
+"-$ #@@@@@@@@@@@@@o $----",
+"-- X@@@@@@@@@@@X -----",
+"--+ OX@@@@@@@@@X =-----",
+"---= #.@@@@@.o O-----",
+"----+ =#&#= =O $----",
+"------$ $---$ O---",
+"--------&o+o&------$ O--",
+"--------------------$ $-",
+"---------------------$ &",
+"----------------------&-"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/GNUmakefile b/support/dktools/gui-img/wxdkdraw/font-names/GNUmakefile
new file mode 100644
index 0000000000..dd83b9505c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/GNUmakefile
@@ -0,0 +1,12 @@
+
+IMAGES := $(patsubst %.wxd,%.xpm,$(wildcard *.wxd))
+
+RESOLUTION=96
+
+images: $(IMAGES)
+
+%.xpm: %.wxd
+ gxhconvert -o=xpm -r=$(RESOLUTION) $<
+
+%.pdf: %.fig
+ gxhconvert -o=pdf $<
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/texput.log b/support/dktools/gui-img/wxdkdraw/font-names/texput.log
new file mode 100644
index 0000000000..ac9e03d9d5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/texput.log
@@ -0,0 +1,20 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex 2018.6.9) 16 AUG 2018 19:06
+entering extended mode
+ restricted \write18 enabled.
+ file:line:error style messages enabled.
+ %&-line parsing enabled.
+**wxd-fn31
+
+! Emergency stop.
+<*> wxd-fn31
+
+Here is how much of TeX's memory you used:
+ 3 strings out of 493064
+ 103 string characters out of 6138160
+ 52807 words of memory out of 5000000
+ 3641 multiletter control sequences out of 15000+600000
+ 3640 words of font info for 14 fonts, out of 8000000 for 9000
+ 1137 hyphenation exceptions out of 8191
+ 0i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,80000s
+
+! ==> Fatal error occurred, no output PDF file produced!
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn00.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn00.wxd
new file mode 100644
index 0000000000..eb3850028d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn00.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 0 12 1 0 24384000 1270000 0
+ Times-Roman
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn00.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn00.xpm
new file mode 100644
index 0000000000..d81534484a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn00.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn00[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #121212",
+"X c #5A5A5A",
+"o c #7E7E7E",
+"O c #909090",
+"+ c #D8D8D8",
+"@ c #A3A3A3",
+"# c #B6B6B6",
+"$ c #C8C8C8",
+"% c #040404",
+"& c #282828",
+"* c #707070",
+"= c #FFFFFF",
+"- c #3F3F3F",
+"; c #F4F4F4",
+": c #E5E5E5",
+/* pixels */
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"==================================================================================================:********o=X@================================+o***O@;=========================================================================================================================================",
+"==================================================================================================+&#:o #+@&=*#=================================# X;+X.#========================================================================================================================================",
+"==================================================================================================$@==O +==*====================================+ o===.&========================================================================================================================================",
+"==================================================================================================;;==O +==;=;+===$=:$;=;#:====$#;===;#+;=======: o===&.====:#+====::=$+==+$====:#$====+=+$=====================================================================================================",
+"======================================================================================================O +===@.*=+-.O*&-#*X.:=;*#o.$=:-+#-=======: o==$ *===oo$o&+=O%*oX%#o*.o==@X+*X=+&&oX.*====================================================================================================",
+"======================================================================================================O +====-*==O%;=# @==%@=*#==&-=@-==O=======: -*--O===#&===X-==.o==-&==o.==-O=$ ;=o.:=o.====================================================================================================",
+"======================================================================================================O +====-*==@.==: $==&o=.*oo*o=+%X:==;:::;=: *@ *====XX===@ :=&O==X-==@%==;=:o :=O&==@ ====================================================================================================",
+"======================================================================================================O +====-*==@.==: $==&o; $======$..@=*...#=: o=o @===--===$ +=&O==X-==@ ==:*@$ :=O&==@ ====================================================================================================",
+"======================================================================================================O +====-*==@.==: $==&o=%O===+;+=;X :======: o==-%$==*.===#%;=&O==X-==@ ==&@=+ :=O&==@ ====================================================================================================",
+"======================================================================================================* #====-X==@.==: #==&o=X.#=$*=O$==.$======$ *==:..:=+%#==o*==.O==X-==@ =: O=@ +=o&==@ ====================================================================================================",
+"=====================================================================================================O& -#==@.&#+- O;* X:@%-+:- %X;=O-#O*======+- .O==$%&#=#&OO*;=@ -+$&.#:- O;-%-#.-#-%@:- O===================================================================================================",
+"===============================================================================================================================:;=====::=====================:==================:==;;===========================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================",
+"================================================================================================================================================================================================================================================================================================"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn01.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn01.wxd
new file mode 100644
index 0000000000..6e0d8da791
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn01.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 1 12 1 0 24384000 1270000 0
+ Times-Italic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn01.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn01.xpm
new file mode 100644
index 0000000000..819801ccae
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn01.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn01[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #6B6B6B",
+". c #A1A1A1",
+"X c #B3B3B3",
+"o c #252525",
+"O c #020202",
+"+ c #ECECEC",
+"@ c #939393",
+"# c #3A3A3A",
+"$ c #FFFFFF",
+"% c #858585",
+"& c #525252",
+"* c #E2E2E2",
+"= c #0F0F0F",
+"- c #F7F7F7",
+"; c #D5D5D5",
+": c #C4C4C4",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$X@@@@@@@X*:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$;@@@*$$$$$$$$$$$$-@#X$$:*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o@;@O.: %o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ O.$$$$$$$$$$$$$$;O*$$# $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$;.$$ =-$*X-*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&=$$$*:$$$$$$$$$$.o$$$*+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-$$$o&$$--$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o&$$;o*$$$$$$$$$$& $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$;O@$$+%o:$@o@;#o-:#&$$$+%X#*$+&@&%$$$$$$$;O.$;#=%+$+%.@#X$$oX$*&o-$$+%X X$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@O;$$$X=$$*O:.:=:X.o$$;o;$o;$@#$:.$$$$$$$%O+$$ $$*#;$:O-$;O+$$ &$$;o+$% $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&o$$$$ &$$.oX$@#X$ $-o%- $$:O:$-$+++-$$##$$$oX$$&%$$%#$$@#$$$#@$$#@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-= $$$$o@$$ o-$&#$$o.$.O@%:$$$$&o-$*===.$-O $$;O+$XO+$$# $$& $$+O;$:O*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$:OX$$$+O*$$o%$-=.$*O+$&#$$$$$*$*=@$$$$$$$XO:$$@#$$ #$$XOX$$=X$$.o$$@=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ O+$$$Xo+;;O*$:O-$.o;;&o$$*:$&$$&%$$$$$$$ O-$$& :$&&$+.O;;;O+X$ :+@O+$-X$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+@OO@*$$.=.$@#$$%#$$%o.$:=#%X$$o@X#*$$$$$$.=O.$$o#*$.O&@:O@$XO@$$&#:$-#&@@-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+$$$$$$$$$$$-$$$-*$$$$+-*$$$$$$$$$$$$$$+$$$$++$$+$$$+$$$--$$$$*-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn02.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn02.wxd
new file mode 100644
index 0000000000..8af6d8ccb8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn02.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 2 12 1 0 24384000 1270000 0
+ Times-Bold
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn02.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn02.xpm
new file mode 100644
index 0000000000..7603da3bc9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn02.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn02[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #121212",
+"X c #242424",
+"o c #FAFAFA",
+"O c #707070",
+"+ c #EDEDED",
+"@ c #FFFFFF",
+"# c #060606",
+"$ c #DCDCDC",
+"% c #3C3C3C",
+"& c #CFCFCF",
+"* c #535353",
+"= c #898989",
+"- c #9C9C9C",
+"; c #C1C1C1",
+": c #B0B0B0",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%**%%O*%=@*X$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;*%%*=*=$@@@@@@@@@@O%%o@@@@;*%*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#-@= $+**@. :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@& =@- .$@@@@@@@@@& o@@@@@= X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*@@= $@+*@&:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+ =@+ =@@@@@@@@@& o@@@@@- X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;@@= $@@;;::$+::;+-=$@;=;@@@o:=:@@@;=-:+@@@@@@+ =@$ -@@@$--$@@& o@@&=:- X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= $@@@$# :oO X** X=*. :@o%%o%O@-.$:.&@@@@@@+ =+O.=o@@-#&&#-@& o@:#%=% X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= $@@@@X :@- .oo -@O *@= =@O $%#&@-$@@@@@@+ %*.%:@@$#.@@.#$& oo. ;@= X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= $@@@@X :@- X@@. ;@O *@* *=% -* #Oo@&OOO:@+ =@$# O@= X@@X -& o& $@- X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= $@@@@X :@- X@@. ;@O *@% O+++o+* X$: O@+ =@@* #oO %@@% O& o: o@- X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= $@@@@X :@- X@@. ;@O *@* *@@@@;@:X =+:::$@+ =@@* #o- X@@X -& o& $@- X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O &@@@@. :@- X@@# ;@O *@: #;o-&%+@& -@@@@@@$ =@o. O@+..@@#X+& ooX :@O X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O. %:@@- %$% :- *$X .;@= .-@X*-*%o@@@@@;% XO%%:@@@&X==X&@* =@&..** X-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o&+@@+@+$@@@@@@@@@@@@@@@@@@@@@$$@@@@@@@@@o$o++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn03.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn03.wxd
new file mode 100644
index 0000000000..d8e7fcc083
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn03.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 3 12 1 0 24384000 1270000 0
+ Times-BoldItalic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn03.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn03.xpm
new file mode 100644
index 0000000000..32a386342e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn03.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn03[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #7D7D7D",
+"X c #363636",
+"o c #FCFCFC",
+"O c #4B4B4B",
+"+ c #040404",
+"@ c #C9C9C9",
+"# c #EDEDED",
+"$ c #FFFFFF",
+"% c #979797",
+"& c #DFDFDF",
+"* c #666666",
+"= c #F5F5F5",
+"- c #0E0E0E",
+"; c #212121",
+": c #B1B1B1",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o#$$$$$$$#$$$$$$$$$$$$$$$$$$$$$o#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$.OO*O**OO=.Oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$:*OO**%#$$$$$$$$$$:X+%$$$$:X+*$:*OO.$$$$$$$$$$$$$:X+%$&X:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-.#* Oo.;$X-#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$* -o@ ;&$$$$$$$$$$X &$$$$$O :$$O ;o$$&@$$$$$$$$$$X &$: .$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&*$$; .$=O$=#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$O *$$- %$$$$$$$$$=+;$$$$$$-+=$$; .$$#;@$$$$$$$$$=+;$$$&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$==$& @$$@#@&$$&@#=:#$&:=$$$$&:=$$=:@&#$$$$$$$=+ %$& @$$$#:&$$$@ *$$$=:@ O$$& @$:;-&$$$@@#@=$@ *$o&:$$$$&@o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$% ;$$$:- :$* -&X *@; *$$#O**;$=X*%+@$$$$$$$: #&O-%$$=O*@-%$$. :$$%-.X .$$% -oo* X.$#XO.X+=$. :#O X$$&X%XX$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$O *$$$$X+#$@ O.: *%: .$=;;o.-o@ %$O=$$$$$$$. ;*-;&$$oX;o$--$$X+#$: %$O @$$O O$$. %$=X;=@ O$$X+#$: .$&-*$X;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o- :$$$# X$$. X#. O$* :$. .&-%$#+-&=$:...&$$X .$#++:$% .$# -$# X$#-;o$--$$$- %$$X &$. %$% %$# X$$* @$O @$==$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@ #$$$: .$$O %$X @o--=$; **@$$$. Xo$X &$# :$$; *$X @$: X$% .$. .$: O$$@ &$# ;$o-+=$X &$% .$$;-=# -$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$. X$$$$* @#=++#& X$@ Oo# -o$#o$@oX :$:%%:$$: +=$# %o+ =$* :$* @#O @$O %$$. ;$$: *#@ X$& ;$$* @#& O=: X$$#o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o; *$$$$; @:: O$% .$. ..#++##*=#X$@ %$$$$$$$O X$$* ;#$--$#-O$$X @:X ::X ::$X O$$. %%: X#. O%#X @:: ..@ -##*=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@O ;%$$$X-.$* %$O @$% X=$%+-X&$@+.*O=$$$$$$. -*OX.#$$:-%O.o$$X .$% -%.+.$* ;:$. X==; X&+;@$X .$: X&$* -X&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o=$$$$$$$$$$$#$$$$#&o$$###&$$$$$$$$$$$$$$$$$$$$=&o$$$$o#$$$&=$$#$$$$$$$$$#$$$=&$$#=$$o#$$$#$$$$#&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn04.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn04.wxd
new file mode 100644
index 0000000000..ccb5a0ed2c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn04.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 4 12 1 0 24384000 1270000 0
+ AvantGarde-Book
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn04.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn04.xpm
new file mode 100644
index 0000000000..8896b9f7ec
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn04.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn04[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #242424",
+". c #6C6C6C",
+"X c #FBFBFB",
+"o c #020202",
+"O c #393939",
+"+ c #161616",
+"@ c #FFFFFF",
+"# c #4D4D4D",
+"$ c #F2F2F2",
+"% c #0B0B0B",
+"& c #D2D2D2",
+"* c #E4E4E4",
+"= c #8B8B8B",
+"- c #C1C1C1",
+"; c #9E9E9E",
+": c #B1B1B1",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.#X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#&@@@@@:# %O.*@@@@@@@@@@@@@@@@@@@@@@@@@@@;.@@@@@@@@@@@@@@@@@-OOO#=*@@@@@@@@@@@@@@@@@@@@@@@;.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*o+:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+-@@@*#+=-&-.%;@@@@@@@@@@@@@@@@@@@@@@@@@@=#@@@@@@@@@@@@@@@@@:+::;# $@@@@@@@@@@@@@@@@@@@@@@=#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=O=O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+-@@@O#$@@@@@-o-@@@@@@@@@@@@@@@@@@@@@@@@@=#@@@@@@@@@@@@@@@@@:+@@@X :@@@@@@@@@@@@@@@@@@@@@@=#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X+:$%&@@.:@@@@@=;@X=# #=$#*@.:;O #&@@.#oO#&;+$@@@@@@@--@@@X=# #=$#*@.:=#@@*.O .&=#@@@&. .&@@@@@@@@:+@@@@O=@@@:# O.$@@@@$.O #:@@@=#@@@;.X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; X@..@@; @@@@$%&XO ;&;O#o*@#+#:-.%&@::%=:$#=@@@@@@@@@@@@XO ;&;O#o*@# #:@:%.--.+O#@@:%.--.%-@@@@@@@:+@@@&%-@@.+=-:#+*@@*+#:-=%.@@=#@@-%-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O=@@&o*@X+-@@@=O@= $@@@XOo*@#OX@@@.#@@@+-@@+-@@@@@@@@@@@@= $@@@XOo*@#O@@$+;@@@@:o#@$+:@@@@;+X@@@@@@:%#O o.@@-%&@@@@##@@O.@@@@&o-@=#@$ =@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-%*$$$O=@@.#@@@ ;@ ;@@@@@-o*@#=@@@@: @@@+-@X%-@@-=======&@ ;@@@@@-o*@#=@@; @@@@@@##@; $$$$$$ :@@@@@@:+;;=.%;@..@@@@@&o$*o*@@@@@#.@=#X##@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#oooooo+X@*%*@:+XXo&@@@@@*o*@#=@@@@-%@@@+-@@O=@@:......o:Xo&@@@@@*o*@#=@@.#@@@@@@.#@.oooooooo=;###.@:+@@@@;%XO=@@@@@@%-:+@@@@@@=#@=#=%$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*o&XXXX$+;@@#=@#=@@+:@@@@@-o*@#=@@@@-%@@@+-@@=OX@@@@@@@:%$@+:@@@@@-o*@#=@@;O@@@@@@##@;OXXXXXXXX*:::-@:+@@@@*o*#.@@@@@$o*&o$@@@@@..@= + =@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=O@@@@@@=O@@-+&o*@@##@@@@@.o*@#=@@@@-%@@@+-@@X .@@@@@@*+;@@##@@@@@.o*@#=@@&%-@@@@*%#@&%&@@@@& $@@@@@@:+@@@@-%X; $@@@@= @X =@@@@$+;@=o-&%:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X+:@@@@@@*%-@@ #@@@*+#*@$. o*@#=@@@@-%@@@+-@@@& O-$@*;%.@@@*+#*@$. o*@#=@@@=+:X@- #@@= -X@:+=@@@@@@@:+$**: .@XOO&@X;%:@@:%;$@&OOX@=#@@:%&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; X@@@@@@@.#@@;o-@@@@*#o+o#*o*@#=@@@@-%@@@+-@@@@X. o+o ;@@@@@*#o+o#*o*@#=@@@@; o%+;=#@@@;+%%+;@@@@@@@@:ooo% =X@@$.%%o -@@@@- o+%.$@@=#@@@=+*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X&X@@@@@@@@@@@@@@@@@@@@@@@@@$&*@@@@@@@@@X&X@@@@@@@@@@@@@$*@@@@@@@@@**@@@@@@@@@@@@@@@@@@@@@@@*$@@@@@@@@$&X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn05.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn05.wxd
new file mode 100644
index 0000000000..efad4f5d11
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn05.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 5 12 1 0 24384000 1270000 0
+ AvantGarde-BookOblique
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn05.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn05.xpm
new file mode 100644
index 0000000000..4b9c677542
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn05.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn05[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #A1A1A1",
+". c #020202",
+"X c #B5B5B5",
+"o c #C8C8C8",
+"O c #ECECEC",
+"+ c #292929",
+"@ c #FFFFFF",
+"# c #3B3B3B",
+"$ c #4D4D4D",
+"% c #DCDCDC",
+"& c #181818",
+"* c #606060",
+"= c #747474",
+"- c #0B0B0B",
+"; c #898989",
+": c #F8F8F8",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;#O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$o@@@@@X$&-+*%@@@@@@@@@@@@@@@@@@@@@@@@@@@X*@@@@@@@@@@@@@@@@@%###$=%@@@@@@@@@@@@@@@@@@@@@@@X*@@@@@@@@@o=+-&*o@@@@;;@@@@@@@@@;;@;;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%--X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O.O@@@%#&;X%X$.X@@@@@@@@@@@@@@@@@@@@@@@@@@=*@@@@@@@@@@@@@@@@@ &X ;#&@@@@@@@@@@@@@@@@@@@@@@@=*@@@@@@@:=-=X%X$. @@@# @@@@@@@@@# @+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#;$=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X&@@@%&=:@@@@@;-O@@@@@@@@@@@@@@@@@@@@@@@@@#;@@@@@@@@@@@@@@@@@=*@@@%.%@@@@@@@@@@@@@@@@@@@@@@#;@@@@@@:##%@@@@@;.%@:-o@@@@@@@@:-o@oO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +:;#@@%$:@@@@O$O@%=#&$o ;@%$%*++;:@o$+-$=:+=@@@@@@@: %@@@%=#&$o ;@%$o$ @@ $+#;@-o@@@ $+# @@@@@@@@@$;@@@o&@@@O=$&#X@@@@@X*++=O@@@&X@@O* @=+:@@@@@@@#*@%.:;$&# @@@%.:%$@@@O;#+$Xo*@@$%@@@@X=@@@X*+#=:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O&X@o.:@@-o@@@@**@ -=Xo*&#=@ -+ o -=@% #$ o +:@@@@@@@@@@@@ -=Xo*&#=@ -+;OO## o +$.O@O#$Xo &=@@@@@@@@&X@@O$*@@o&*Xo=. @@:*&;oX#+:@O.O@:#*@%-%@@@@@@@@=#@ &#*Xo;-=@@ +@ +@@o&*Xo;-##@%.O@@@@*=@:*+ oX+#:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*$@@:-X@@$;@@@o&Oo-o@@@@*.X@=&O@@@;&@@@+ @@#=@@@@@@@@@@@@o-o@@@@*.X@=&O@@$*@@@@O-+@@#;@@@@o.O@@@@@@O.#$#-$O@O- @@@@;&@@=#O@@@O&;@X&@:$$@@=#@@@@@@@@@;+@=. @@@@X.O@=*@=*@O& @@@@X.=@X+@@@@@+ @=$:@@@O& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o-%:::#=@@;$@@:+ @+ @@@@@o.%@#=@@@@X&@@:.%@@-X@@o;;;;;;;o@+ @@@@@o.%@#=@@ +:@@@@@$$@ +::::::&X@@@@@@X& =*-X@**@@@@@%.O%-%@@@@@**@;$:$$:@@$=@@@@@@@@@$*@$*@@@@@@-X@$;@#;@**@@@@@@& @;$@@@@:-o%-%:::::*=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+......#@@X&@@;#@%.:@@@@@X-@@&X@@@@ #@@o-:@@-o@@ *****$.%%.:@@@@@X-@@&X@@*=@@@@@@$;@*........X;$$$=@;$@@@@=#@&X@@@@@o.: #@@@@@@$;@*=*+:@@@#=@@@@@@@@O&X@&X@@@@@:.o@&X@&X@&X@@@@@@-o@$;@@@@o.: ........=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;+:::::X-:@:.%%-o@X-@@@@@@=#@O.O@@@@*=@@ +@@@#;@@@@@@@@$*@X-@@@@@@=#@O.O@@#;@@@@@O-X@# :::::::@oXXXo@*=@@@@;#O.%@@@@@;#@=*@@@@@:&X@+&+.o@@@*#@@@@@@@@*#@O.%@@@@@X-@O.OO.OO.%@@@@@o.:@+ @@@@;+@==:::::::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O-o@@@@@:.o@@# $=@@%.o@@@@o.*@X&@@@@@# @@=*@@@;&O@@@@@@=+:@%.o@@@@o.*@X&@@@*$@@@@@*.%@*=@@@@@$ @@@@@@@+ @@@@#;@- @@@@O&X@;+:@@@@;#@:.$:$#@@@o.X@@@@@:=&%@X. @@@@:+;@X&@X&@@& @@@@O#+@@& @@@:+*@ #@@@@@;*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**@@@@@@@#;@@=+&O@@@#+o@: +& @;$@@@@@-o@@#;@@@@$& O@:X#$O@@@#+o@: +& @;$@@@o.;:@%$+-@@o. :@o#$:@@@@@@:.oO%X$+:@=&X@:X+=@@O&*O@O=&%@o-:@O&;@@@=-;O@OX++%@@;&-X@:o+$@@;$@;$@@;&X@:X+&*@@$+O@%$-;@O&*O@O*+%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X&O@@@@@@@=#@@X. @@@@O$.--#%-o@*=@@@@%.:@@&o@@@@@;&.&.+ @@@@@O$.--#%-o@*=@@@@X&.-&;;#@@@X&--&;@@@@@@@@o...&+=O@@:=---+X@@@@o#.&-*O@@ #@@@ -%@@@ +.&.+ :@@@*=;&--+ @@@*=@*=@@:=---+o#;@@%+.&&X&X@@%#.&-=O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:%:@@@@@@@@@@@@@@@@@@@@@@@@@O%O@@@@@@@@@:%:@@@@@@@@@@@@@O%@@@@@@@@@%%@@@@@@@@@@@@@@@@@@@@@@@%O@@@@@@@@O%@@@@@@@@@@@@@@@@@@%%O@@@@@@@@@@%O@@@@@@@@@@@@@@:%:@@&X@@@@%%@@@@@@@@O%:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O.O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn06.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn06.wxd
new file mode 100644
index 0000000000..401aeed1ba
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn06.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 6 12 1 0 24384000 1270000 0
+ AvantGarde-Demi
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn06.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn06.xpm
new file mode 100644
index 0000000000..e5ec404748
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn06.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn06[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #D6D6D6",
+"X c #E8E8E8",
+"o c #363636",
+"O c #7F7F7F",
+"+ c #272727",
+"@ c #040404",
+"# c #B7B7B7",
+"$ c #C9C9C9",
+"% c #FFFFFF",
+"& c #5F5F5F",
+"* c #1A1A1A",
+"= c #9C9C9C",
+"- c #0E0E0E",
+"; c #454545",
+": c #F9F9F9",
+/* pixels */
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Oo#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%:oo:%%%%#&+-oOX%%%%%%%%%%%%%%%%%%%%%%%%%%&o$%%%%%%%%%%%%%%%%%%;oo;&OX%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;o.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%:- o%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%X :%%X; -#%%%%%%%%%%%%%%%%%%%%%%%%%+ #%%%%%%%%%%%%%%%%%%* @O%%%%%%%%%%%%%%%%%%%%%%%%%%%%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%X :%%; @O$$=+ @$%%%%%%%%%%%%%%%%%%%%%X%%+ #%%%%%%%%%%%%%%%%%%* O=Oo =%%%%%%%%%%%%%%%%%%%%%%%%%%%.$:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+ + &%%O+&%%%=+;%%=o@*O=+O%;+=+@+=%X+ +#= @$%%%%X&&O%%%#;--;$+&%O+O*=%X&- -O+ #%%.;*-o#%%%%%%%%%%* #%%%& -:%%.;*-o#%%%;+=*@o.$o@*&:%%;+.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# -$ @X%$ X%%o O%& @@ - O%* @ =X #; O%%%%%%%%%%%= @ - o%& =:+ +- #%#@ - O%%%%%%%%%* #%%%:- #%#@ - O%%* @@ -- @ o%%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%& &%+ O%%o =%. .# =::O O%* oX:& o%. .:* #%%%%%%%%%%X- &:%#- o%& *$%O *.%:& #:* OX%#-@.%%%%%%%%* #%%%%; =:* OX%#-@.%* ;::; =%# $%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%X@ =.& +%%= o%O ;%& &%%%%; O%* #%%# *%X :%- #%. O# +%%%%O o%& O%%+ #%%%:* ## *====; O%#OOOO%%* #%%%%o O# *====; O%* =%%= @%%%+ #%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%O #%:- .o #%; =%%%%O O%* $%%$ -%X :%; O%. #O &%%%%# o%& O%%@ .%%%%; #O &%O +%%* #%%%:@ =O &%* $%%# +%%%o =%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%:* @---@ ;%%& & *:%& O%%%%& O%* $%%. -%X :%O -X%::::& -X= o%%%%= o%& O%%+ =%%%%* #= -OOOOOO=%$===#%%* #%%%= @X= -OOOOOO=%* $%%# o%%%o =%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= @X%%%# .%$ O%%= -$%%#@ O%* $%%. -%X :%:o *#:%X& =%.@ =%%X+ o%& O%%& +.%%O #X- =%%.&&.%%%%%%%%* #.#& &%X- =%%.&&.%* $%%# o%%%o =%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%o &%%%%%+ O%%o .%%%o ++ @ O%* $%%. -%X :%%.+ - &%%%O *o@@ o%& O%%X* @o* @ #%= +o@ o%%%%%%%%%* ;:%%= +o@ o%%* $%%# o%%%o =%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%. $%%%%%= -:%= ;%%%%:&@ ;O O%* $%%. -%X :%%%:O+ @o#%%%%%=- +# o%& O%%%X;@ @O& #%%#+ -&:%%%%%%%%%* -*;=%%%%%#+ -&:%%* $%%# o%%%o =%* $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%.:%%%%%%%%%%%%%%%%%%%%%%%%:.:%%%%%%%%%XX%%%%%%%%%%%%%:.:%%%%%%%%X.%%%%%%%%%%%%%%%%%%%%%%%%%%X.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn07.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn07.wxd
new file mode 100644
index 0000000000..fcd7542776
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn07.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 7 12 1 0 24384000 1270000 0
+ AvantGarde-DemiOblique
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn07.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn07.xpm
new file mode 100644
index 0000000000..a1584bf5b8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn07.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn07[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #FAFAFA",
+"X c #494949",
+"o c #C6C6C6",
+"O c #030303",
+"+ c #DADADA",
+"@ c #B7B7B7",
+"# c #FFFFFF",
+"$ c #EFEFEF",
+"% c #1D1D1D",
+"& c #888888",
+"* c #656565",
+"= c #303030",
+"- c #0D0D0D",
+"; c #797979",
+": c #9F9F9F",
+/* pixels */
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"#################################################o=*#################################;=@####o*%-=*+##########################*=@##################*==X*&+#############################*=@###$&X%%X:####:=&#######.==$.==$#######################################################################",
+"################################################.= -.################################% o##.* O&#########################% o##################- O:############################- +##@% X.##X &#######o -#o -########################################################################",
+"################################################: o##########################.####$ $#.X -&o+:% @####################.$#$ O.#################+ @:;- O+################.####.####.oo.#@O X:+o* ;##% o#$$####: X#$o+#####.##################################################################",
+"###############################################$-O= &##*=&###;=*#$*=O=@X=$@=**-O=+#o% O=+* =$####+XX&##.;=O%&&=@$=X*%##@=O =& =###@X--Xo#########: %###o- &###@X--Xo##$=X;%O=$@=O-*.#@=X#$- *.####* -#$ &% =+##* ;#&=&##$*%O=@X=.@=*###&=&##$;=O%;.###########################################",
+"###############################################* *; X##; X##+OOo@- - -O-#; O =#& -+O o##########+= - - oo =#; -% X##* -O O+########; X####X *##* -O O+#o - % O :#; *#* X######o +o -%O %$#X :#X :#o% - - %#; *###= :#o% - *###########################################",
+"##############################################o -$: %##: %##X *$% *$#@O X#X %o.; O#$X ;$; X##........#X X+#+% O.& O:.@ -@##: &#& =@.$* *########X &####* *#& =@.$* *#& -@#: X$$= *#X &#- o######$ +& &.#oO :#- +#- o$% *$#: X#X :###- o$%O&+#o- +##########################################",
+"#############################################.= *+: +#+ $o -$* X####X *#% :##@ %##= @#X ;##% X: %$###: =#* *##= :####% @$O &:::& =#@;;;&##% @####= &$O &:::& =#* *##+ o##; *#% o+ O.######@ -.* *####X ;+ O.+ O.* X####X ;#% o##+ O.* =::::= @##########################################",
+"#############################################& :##% oX :#= @####X :$ $##: =#.O +#X *#$ &* ;####: *#= @#$ O.####% +@ X#* =#$ $###+O +@ X#= :##o %###X &$ $o $######X X#= o####X :@ =#@ =#= @####X @$ $##@ =#= o##########################################",
+"############################################$- ----O *##X * =#.O o###.- oo %###; *#+ -##; %$#....X %$X &####X &.O +#o -####o -#& %;;;;;;@#@:::o#@ %###$= X#& %;;;;;;@.O +##& X###% oo %#$ :#####: O+.O +###$- +& *#& *#O o###$- +o -###* *#O *;;;;;;.##########################################",
+"############################################* =####; =##& o##% *.#$X O.& X###X :#: X##oO X+##oX O@#* =$#.; @+ -##+ &##o% X#: -+##@**.#######& X+o&- %$#: -+##@**.+ -###* ;##$ $& X##X -:$.o;O &#+ *.#$X X#X &#X &#= *.#+= -#@ O$#o- &#= *##$;*@###########################################",
+"###########################################o Oo####@ $#@ *###; %=OO %#* ;###% o#; *###& -O -@##@ -=- $: X###X %= O ;#.= O=% O:########* %+##.= O=% O:#: X###= @##o %#* ;##+- - O&##: O %=O %+#% o#% o#& %=O =#+ -=O o#: %=- =$###########################################",
+"##########################################.= *#####$ @#$O-+###.;O X: X#= @##$ $#X :####@=O %*$####:- %@ -#; ;###$X O;* :##+X =o#########= -=X:.####+X =o##; ;##.O +##& X#= @###$*- -*+###; &XO O*$#$ $$ $##;O XX *##&O O;- $##:- -;.############################################",
+"#################################################################.+$########################.++#########+$#############$+.########$+$#########################$+$############################++.#########.+$##############.+$#X :###$+.########++.##############################################",
+"##############################################################################################################################################################################################################################% o###############################################################",
+"#############################################################################################################################################################################################################################$--.###############################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn08.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn08.wxd
new file mode 100644
index 0000000000..b3ad077b44
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn08.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 8 12 1 0 24384000 1270000 0
+ Bookman-Light
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn08.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn08.xpm
new file mode 100644
index 0000000000..1844a386cc
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn08.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn08[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #FAFAFA",
+"X c #A1A1A1",
+"o c #020202",
+"O c #B5B5B5",
+"+ c #C8C8C8",
+"@ c #FFFFFF",
+"# c #191919",
+"$ c #F0F0F0",
+"% c #515151",
+"& c #636363",
+"* c #E0E0E0",
+"= c #767676",
+"- c #424242",
+"; c #8A8A8A",
+": c #353535",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$OO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$OO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X:::-&%-;$@@@@@@@@@@@@@@@@@@@$: -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&::-O@@@@@.O.@@@@@@@@@$: -@@@@@@@@@O*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; X@@@*::.@@@@@@@@@@@@@@@@@@@@#-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- +@@@@@@X X@@@@@@@@@@@#-@@@@@@@@@=+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O O@@@@X +@@@@@@@@@@@@@@@@@@@@:-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@& .@@@@@@$X$@@@@@@@&#+@:-@@@@@@@@*#+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O O@@@@=o*@@$&%%=$@@@$&%%=$@@@:-@*%--&+=%OX%:=@+%:&$@@@X=%-;@@$=&=$=-:;@@@@@@@@@@= .@@@@@O=%*@@.;&=%X+$@:-*&-:;@@X: &=+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O ;+OX&-O@@$#=@@&#$@$#=@@&#$@@:-@@&-*@$; :X.X -X$+ =@@=:.@*o;@.+##&+@; O@@@@@@@@@= .@@@@@$& +@@%-@@;:.@@:#&*.= +@@X +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O &;;=%:;@@=#.@@$o=@=#.@@$o=@@:-@==@@@@* ;@@. =@@@#%@@=;@@@:%@@@-:@@@* ;@@@@@@@@@= .@@@@@@O +@$ ;@@+ O@@:-@@@+ X@@X +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O O@@@@O =@::@@@@::@::@@@@::@@:-&o-@@@@$ ;@@@o=@@@#%@@@@*O;#%@@@--@@@$ ;@@=&&&O@@= .@@@@@@O +@$o;@@X O@@:-@@@* X@@X +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O O@@@@@##@#-@@@@::@#-@@@@::@@:#+; ;@@@$ ;@@@o=@@@#%@@+%%O*:%@@@--@@@$ ;@.OOOO$@@= .@@@@*+O +@@&:$@%:.@@:-@@@* X@@X +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O O@@@@$o-@%#@@@@#%@%#@@@@#%@@:-@@-o*@@$ ;@@@o=@@@#%@$#&@@@:%@@@--@@@$ ;@@@@@@@@@= .@@@$:+O +@.;===X.@@@:-@@@* X@@X +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; ;@@@$&oO@+oO@@Oo+@+oO@@Oo+@@#:@@+ :$@+ =@@$ &@@@#-@* &@@O#:@@@:#@@@* =@@@@@@@@@% *@@+::@X O@Xo+.@@@@@@#:@@@+ ;@@O X@*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;# o-%-:%+@@@O:&&:O@@@O:&&:O@$% o&$;o #;: #X*- o=$% o&.;o-%XXo%X& %$+: #;@@@@@@@&o #%: ;X# #O+# #-=+$% o&$O: #X@.%:==.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$$@@@@@@@$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.$@@@$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*=X;=%oo$@@@@@@@@@@@@@$.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:*@@@@$#+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-;$@@@O-.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.X%%&&X.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn09.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn09.wxd
new file mode 100644
index 0000000000..a850d10861
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn09.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 9 12 1 0 24384000 1270000 0
+ Bookman-LightItalic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn09.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn09.xpm
new file mode 100644
index 0000000000..ef9877c6bf
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn09.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn09[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #E8E8E8",
+"X c #5A5A5A",
+"o c #6C6C6C",
+"O c #D7D7D7",
+"+ c #373737",
+"@ c #7F7F7F",
+"# c #4A4A4A",
+"$ c #040404",
+"% c #FFFFFF",
+"& c #979797",
+"* c #AFAFAF",
+"= c #F7F7F7",
+"- c #C3C3C3",
+"; c #111111",
+": c #232323",
+/* pixels */
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%.*O%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%O&%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%o::+XX##*%%%%%%%%%%%%%%%%%%%*; -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&+:+*%%%%%.@.%%%%%%%%%O: @%%%%%%%%-O%%&::+-%%&%%%%%%%%%%%%X ;%%%**%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;:=%%%@ &%%%%%%%%%%%%%%%%%%%& .%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# O%%%%%%@ O%%%%%%%%%%O *%%%%%%%%X.%%%# O%%Oo%%%%%%%%%%%%%:#%%=$#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=$o%%%%= o%%%%%%%%%%%%%%%%%%%o;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+:%%%%%%%.O%%%%%%%%%%%* O%%%%%%%-:%%%%++%%=#&%%%%%%%%%%%%%;@%%%-=%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%O &%%%%* -%%.oX#o=%%%-XX#&%%%##%%.@#X-o#*o#+*.o##*%%%Oo+X*X&%-o#-&X+o=%%%%%%%%;X%%%%%.@X&%%%&##@*#%%@$=@#+&%=o;:@@%%$X%*+ X@-%%&#+o*+.%. *%*o#%%%=@o#o=%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%& *.O-@+&%%-;&%%#+%%&:O%.:@%%;o%-#@X@.# o.%#;@.%#:%%*;@=%& &%.# X-%- &%%%%%%%. @%%%%%=@ *%=+:O%-;+%%X;oO%@ .%%;@%%%O &%%& =%%=#:O%.:;%%* O%O::%%O:&%.$@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%o @@@o+XO%=:o%%%* -O$*%%%o;%. &*$=%%%%o;%%%X:%%%X:%.;o%%%- -%%o;%%%O *%%%%%%%* *%%%%%%* O%@$O%%%;o%%:X%%%&$%%. *%%%* -%%o:%%%@$O%%%+#%%@$%%%+X%=:X%%%X-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#:%%%%%#;=& O%%%* *X:%%%%o .* *+ O%%%%##%%%+#%%%+X%@ .%%%@ .%%##%%%* O%-ooo.%@ O%%%%%%@$%=$X%%%O &%= &%%%X:%%* O%%%@ .%%+X%%=$X%%%=$o%%X+%%%$@%& -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;#%%%%%o OX;%%%%@ O:#%%%%+;%@ XO &%%%%;o%%%;@%%=$@%#:%%%%+:%%%;@%%%@;%%-***%%X;%%%%%OOX+%O &%%%& -%- -%%%+X%%@$%%%%#:%%%$@%%- *%%%* &%%:X%%O *%o =%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%. @%%%%%:;%o:%%%%:+%:X%%%.$o%X O%:+%%%. *%%O *%%O *%+#%%%- #%%. *%%%#+%%%%%%%%:+%%%%O:.:X%- *%%=: =%& .%%%$@%%X+%%%%:#%%O *%%* -%%%+ -%=$@%%* .%X$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%& @%%%=X$*%*$O%%@;O%o:=%%#:=%++%%@ &%%* O%%* O%%- -=o;=%OX:#%-* O%%%+#%.%%%%%O X%%=&;o%;o%-$@%%X+:%%o:%%%. &%.+#%%.O o%%- -%..$@%%@X O.- &=O& ..* *%%.o%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@; ;#X#+X-%%%&:o##O%%=o+o+o=%=$@%%%X$+*@$=%%@$%%%=::X.#+XX=@ +*@$=%%%&$#-%%%%*: $##; O%o$X-*;X+-+X%%+#%%%%X;X-@;Xo&: ;*%.:+o@%&;X#*.;;o=#$#OO;:@=@;#Xo.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%.%%%%%%%=.%%%%%%%%%%%=%%%%%%%%%%%%%%=%%%.=%%%.%%%%%%%%%=%%%%%%%%%%%%%%%%%%.%%%%.%.$&%%%%%%%%%.%%%=.%%%%%%%%%.%%%%%.%%%==%%%.%%%%=%%%%.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@O%%%o:.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%.;;-Oo+O%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=-@&-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn10.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn10.wxd
new file mode 100644
index 0000000000..b8c81e1ecb
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn10.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 10 12 1 0 24384000 1270000 0
+ Bookman-Demi
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn10.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn10.xpm
new file mode 100644
index 0000000000..bfc6631c0b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn10.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn10[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #121212",
+"X c #C5C5C5",
+"o c #030303",
+"O c #4B4B4B",
+"+ c #FFFFFF",
+"@ c #2B2B2B",
+"# c #3D3D3D",
+"$ c #626262",
+"% c #090909",
+"& c #1C1C1C",
+"* c #777777",
+"= c #9C9C9C",
+"- c #565656",
+"; c #E5E5E5",
+": c #F8F8F8",
+/* pixels */
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X==+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;@@@@@@#O=:+++++++++++++++++++++@ @++++++++++++++++++++++++++++++++++++++++++++++++$@@@@@#-*;++++++++++++++++++++++++++++;o $++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;$ @O. $+++++++++++++++++++++*o @++++++++++++++++++++++++++++++++++++++++++++++++=@ .$#o .X+++++++++++++++++++++++++++;o *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@ :+:@ %+++++;:++++++++;:+++++# @++++++++++++;:+++:;++++++:;:+++++++++:;++++++++++= *++X% .;++++::+++++++++:;++++;+++++XX+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# +++# &++:*. @=+++;-% o#X+++O @= XXO& -. O*& #;++;O o#X+;-@o$@ @;++++++++X *+++* *++X#o @*++*#%@# .*Oo %=+;$@%$++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# *$@ %=++- $O =+:& .*@ oX++O @;% .*;X% o#- @O *++@ #=& @+;. .O *++++++++X *+++X O+Xo -* *+# .$& .-. o:;& $++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# .. &=+X O++& %:* =+; #++O @* O;+++X =+; *+:% -++@oX+$ o++; -:+. O++:;;;:+X *+++X &+O =X& &++# .++$ :+* ;+: $++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# ++;# oX= *++O X- X++. %++O o O++++X =+: *++. -++:=-@o +++o $++& O+:& =+X *+++X #+. %%%%%:+- &++* :+= ;++. $++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# +++= *= *++- X- X++. o:+O %- =+++X =+: *++. -++O %$O +++o $++& O+X----:+X *+++* $+& .+++++++- &++* :+= ;++. $++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@ :++$ =X O++& o:= =+; #++# &:@ oX++X =+; *++% -+X *+$ ++: $++& #++++++++= *++X% %;+- X++*$:+O .++$ :+* X++% -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++:*o -*- &;+- o*$ *+:@ &*# oX+=% o=$ &=;- @;$ &X* .=X &-o $;* &X= .=++++++X# @*$% =++;% %-# -+=. =X& *;@ -X* .=+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X o.-;++:*. &=+++;-% o#X++& @@ = = *. &+*o .*@ .= $@ &++++++O %&-X++++X#o .*:+& &* = = @+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;:++++++++;:++++++++++++++++++++++++++++++++:;+++;++++++++++++++++++++++++++++++++++:;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn11.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn11.wxd
new file mode 100644
index 0000000000..665640ece3
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn11.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 11 12 1 0 24384000 1270000 0
+ Bookman-DemiItalic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn11.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn11.xpm
new file mode 100644
index 0000000000..a691923d0f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn11.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn11[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #7E7E7E",
+"X c #E9E9E9",
+"o c #D8D8D8",
+"O c #4A4A4A",
+"+ c #040404",
+"@ c #FFFFFF",
+"# c #3C3C3C",
+"$ c #606060",
+"% c #F1F1F1",
+"& c #2D2D2D",
+"* c #1C1C1C",
+"= c #BDBDBD",
+"- c #0D0D0D",
+"; c #9E9E9E",
+": c #F9F9F9",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:o;$=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=-*%@@@@@@@@@@@@@@@@@@@@@@@@@Xo;$:@@=-*%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;&&&&&&&O;@@@@@@@@@@@@@@@@@@@@@. =@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o&&&&&&O$=@@@@@@@@@@@@@@@@@@@@@@@@@@@@# o@.&&&&#@@o.X@@@@@@@@@@@@@* *@@@# o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=& *.$* ;@@@@@@@@@@@@@@@@@@@@o# %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XO +$.# .@@@@@@@@@@@@@@@@@@@@@@@@@@@;&.@@;- *;@@O X@@@@@@@@@@@@@;+ O@@@;&.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; .@@= $@@@:o=X@@@@@@%=o%@@@@$ *@@@%=%@@@XX%=o@@o=X@@@@@@:oo@oo%@@@:o@X=X@@@@@@@@o O@@@O +o@@@@%=o@@@@@o:o=%@%==@@@@@@XX@@@$ =@@. -oo@@@@X=X%oo@@:+ .@@@@XX@@@@@%=o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. =@@; ;@%.+ O%@@oO -.@@@& O@%.+ #oO* *- ## +;@@@@.- &+ =@$&+-O +;@@@@@@@= .@@@= ;@@=& &X.&+ & -$- &%@oO* $@@@# +:@& *@@o& +& #@@o ;@oO* $@@@=# &o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O ..O+-.@@# -==- $@X- #=. ;@:+ .o**.#.=- &$* O$ #@@@$ +;=O XX* +$$ O@@@@@@@. =@@@= .@$ *=X- ;O +$O *$& =@=- ;@@@- &@@; $==@o+ #=;+ $@@; o@=- ;@@; +;%- $@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* +*- +O=@; ;@@# *@O o@:+ $@o ;* =@@@@; =@$ -@@* O@@= .@@$ *@@X .@@- $@@@@@@@$ o@@@; .; ;@; o@& O@X .@; o@@; =@@o $@@o ;@@@& -%@X ;@@. +:@@; =@o- .@@&+;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X O@@o- -X# +%@@& *:+ #@@X $@; & ;@@@@. %@O #@:+ .@@$ X@@& O@@= =@X ;@. o@& -@@@@$ =# O* *=@@- .@= =@. +:@@. %@@; .@@; o@@o $@@; =@@O &@@@. %@. X@@:X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= .@@@* =- &@@X+ O= $@@= .@$ O $@@@@$ *@@* $@o ;@@& *@@o .@@; X@= =@=;;;@:+ #@@@X+ *:+ &;;o@@@o ;@; X@O &@@@$ *@@@. =@@. +@@@; ;@@$ %@@* $@@@$ *@@# *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. ;@@= -:- #@@. =o .@@O -X@# +X- -X@@@& O@X ;@; o@@# *@@O ;@@$ -@@. X@@@@@@= $@@X& =@* #@@@=;@; o@$ -@@* O@@@& O@@@# X@@O &@o:= ;@o+ *@@X .@@@& O@@O -:@@o.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:;* O;.- =@$ +;.+ $@:& *;$ +;@@- O@. **.:+ .@= =@. O$@. $O+ &&o# #@@$ O.@@@@=& &;$* +;@@. $.O $@. +:@# #@@+ -Oo@- -O$. .%@& -O ;%* *.*+ O$= &Oo@- -O$= O;$-&X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o +*Oo@@:.- +&;@@@XO+ -#o@@X .@:$+-OXo =@. %@o& -.@:$+ &o$ -.:- .@@=* *=@@@@- -*&.o@@@:.- #=@@O &@@- .@@.- #o@. &$ X@.- *.@@=& -.=- &=%# +Oo@. &=@;* +#.%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X:@@@@@@@@X@@@@@@@@@@@@%:@@@@@@@@@@@@@@X@@@@@:%@@@%:@@@@@@@@@X@@@@@@@@@@@@@@@@@@@@@@X:@@@@@@@@@@@@@@@:%@@@@%%@@@@@@@@@@@%@@@@@@X@@@@X@@@@%:@@@@%%@@@@@X:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn12.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn12.wxd
new file mode 100644
index 0000000000..acfb1f3ee0
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn12.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 12 12 1 0 24384000 1270000 0
+ Courier
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn12.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn12.xpm
new file mode 100644
index 0000000000..cbd0e5a8b8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn12.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn12[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #5A5A5A",
+". c #FBFBFB",
+"X c #6D6D6D",
+"o c #808080",
+"O c #3A3A3A",
+"+ c #FFFFFF",
+"@ c #DDDDDD",
+"# c #A8A8A8",
+"$ c #F0F0F0",
+"% c #626262",
+"& c #777777",
+"* c #D2D2D2",
+"= c #C1C1C1",
+"- c #E5E5E5",
+"; c #585858",
+": c #8E8E8E",
+/* pixels */
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.@.+++++++++++++++++++++++++++++++++++@O++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++$% o :X+++++++++++++++++++++++++++++++++-%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *+++#O+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*o+++++#+++-X #+++: $+.% -++$ %+=%X@++.% &++++++$& ;o.+++= :+# o.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++:=++++++++-;@++#X+++o@+++o@++++;:o$@=+++++;+++++$;@++=;+++++;%#.=@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++o@++++++++X@++++X@++o@+++o@++++;#+++++++++;+++++o*++++#=++++O*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++:=++++++++;+++++##++o@+++o@++++;++++++++++;+++++;;;;;;;#++++;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*&++++++++ .++++:=++o@+++o@++++;++++++++++;+++++&@++++++++++;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X=+++@%++=&+++-;.++:=++@O@++++;++++++++++;+++++@ .+++-@++++;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.o :% -+++:;:&;@+++-Oo%XX;.+#;O;; $+++:;;O;;o+++=;o:%;-++o;O;;&+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.*-++++++.*-++++++$*$+++++++++++++++++++++++++++@*.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn13.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn13.wxd
new file mode 100644
index 0000000000..455a1483f2
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn13.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 13 12 1 0 24384000 1270000 0
+ Courier-Oblique
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn13.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn13.xpm
new file mode 100644
index 0000000000..9272b06658
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn13.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn13[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #D6D6D6",
+". c #B3B3B3",
+"X c #5B5B5B",
+"o c #6D6D6D",
+"O c #FCFCFC",
+"+ c #393939",
+"@ c #C8C8C8",
+"# c #FFFFFF",
+"$ c #EEEEEE",
+"% c #636363",
+"& c #888888",
+"* c #E2E2E2",
+"= c #9C9C9C",
+"- c #797979",
+"; c #F6F6F6",
+": c #565656",
+/* pixels */
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"##############################################################################$*####################################.o#####################################*O### %.########Oo%-########o.#######################################################################################################",
+"############################################################################@X-o+&.#################################=.##################################;-X-+=###.=#########O;X########o*#######################################################################################################",
+"###########################################################################.&O##$+*####################################################################$: ##O: ##- ##########@&#################################################################################################################",
+"##########################################################################*o#####=###$-%:&O##=X ##oX ##$%X;@oX ###oX%######$&o:-$###@X-#.%o$###########o*####.&##X$-%:.######=@#####$XX&######$-%X=@X.@X.##=X.###$&o:-$#########################################################################",
+"##########################################################################- ######## %*##&-###%$###o$####:&&;*@#####X##### %*##.:####;:o.O@*########## -##### -##+-$#;X.#####%;#######*-##### X*##&+ ##=.###..## %*##.:#########################################################################",
+"##########################################################################X########;XO####:###:####:####O+@########$o#####X;####X;###@+$#####-:::::: #=@#####..# +O###*%#####:########..#####X;####+O##o*###o*##X;####X;########################################################################",
+"##########################################################################X########@=#####X##;%###;X####@&#########.=#### +:::::+O###&@###############o$#####-*#==####*-####$%########o*#### &####O:###:####:## +:::::+O########################################################################",
+"##########################################################################:########=@#### -##@=###@&####=@#########-*####.=##########XO###############- #### -##o@####=@####.=########X#####@&####=-##OX###OX##.=###############################################################################",
+"##########################################################################-.###*%O#@o###*:;##=.##*+@####%;#########:#####$:O###**####:################@X### :$##:-###@o#####& #######OX#####;+ #O=:.## o##;o&##$:O###**#########################################################################",
+"##########################################################################;%%&%o$###-:&oo$###@+&%-:o##&:+::o####-::+::.###.+&&%o$#O%:+::&##############&:&%o;#*X%=X&%&O##=::+::-##$X::+:: ### X:%@-*##;+-oo-+$##.+&&%o$#########################################################################",
+"############################################################################$@;######$@;######; ;##########################;@ ;#########################$@O#######; O#############################X####O $#######;@ ;###########################################################################",
+"#################################################################################################################################################################################################OX#############################################################################################",
+"###############################################################################################################################################################################################$X:+=############################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn14.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn14.wxd
new file mode 100644
index 0000000000..0e95750975
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn14.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 14 12 1 0 24384000 1270000 0
+ Courier-Bold
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn14.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn14.xpm
new file mode 100644
index 0000000000..54dd4b94d0
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn14.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn14[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #D6D6D6",
+"X c #363636",
+"o c #C5C5C5",
+"O c #040404",
+"+ c #4C4C4C",
+"@ c #FFFFFF",
+"# c #959595",
+"$ c #606060",
+"% c #777777",
+"& c #0D0D0D",
+"* c #1F1F1F",
+"= c #676767",
+"- c #F6F6F6",
+"; c #B1B1B1",
+": c #E7E7E7",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:;%#-.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+&:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:;;;;o:@@@@@@@@@@@@@@X&&X@@@@@@@@@#&&o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#& O .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=X:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+ O%@@@@@@@@@@@@@#$&X@@@@@@@@@oX o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@oOX;.;* o@@@@:-@@@@@@@@@@@@@@@@@@@@:@@@@@@@@@@@@@@@:-@@@@@@@@@@:-@@@@@@@@@@@:$ #;#X o@@@@-:@@@@@@@@XX@@@@@@@:.@# o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+&:@@@oO.@-#& Xo@:*&=@;&&=@@;&&+#& X-@;&&&;@@@@@#& *;@@@X&&;X &#@@@@@@@@@@@% :@@; ;@@.X &%-@@@@@XX@@@@@oX &+ o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+@@@@@-@@= X%%&&.-% =@.=O$@@.=O X%*o@.=+ ;@@@@% X%=* o@@#X &=X$@:ooooooo@@% %#=**:@.&&=#+ $@@@@@XX@@@@:&&%#+ o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O=@@@@@@@: $@@@.&$@@O=@@@O$@@@@&O#@@@@@@@o ;@@@-OX...o&X@@@# X.@@@@+ o@% X:@=O.@@@= .@@@@XX@@@@% o@@@+ o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+@@@@@@@; ;@@@@X*@@O=@@@O$@@@@&+@@@@@@@@o ;@@@. O@@@# .@@@@@.;;;;;;;@@% o.o#&X@XX@@@@o ;@@@@XX@@@@+&@@@@# o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$O.@@@@#:: =@@@:&+@@&+@@:O$@@@@&+@@@@@@@@o ;@@@-OXoooooo@@@# .@@@@@@@@@@@@@@@% :@@@$ -$&:@@@% .@@@@XX@@@@% .@@@+ o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:&&=#%X #@$ +##*Oo@@X&%%* X.@;=O*==#@@-%=+ +=%-@= +##=X+@:%X +=%:@@@@@@@@@@@;X $==+OX@.&*%#$ +@@o==*&==;@.&&%#+ $.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.+O &#@@-%O *;@@@.* $OO#@+ X@@:& &.@-%O *%@o& O;@@@@@@@@@@@= &+:@@o* =-@@% =@@o* &X O;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-.:@@@@@@-.:@@@@@@@.:@@@@@@@@@@@@@@@@@@@@@@@@@@-.o:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:o-@@@@@@@@@@@@@@@@:.-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn15.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn15.wxd
new file mode 100644
index 0000000000..7dbe5a0469
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn15.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 15 12 1 0 24384000 1270000 0
+ Courier-BoldOblique
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn15.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn15.xpm
new file mode 100644
index 0000000000..2cb1dc5f1a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn15.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn15[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #7D7D7D",
+"X c #FAFAFA",
+"o c #020202",
+"O c #383838",
+"+ c #C9C9C9",
+"@ c #FFFFFF",
+"# c #EEEEEE",
+"$ c #070707",
+"% c #DEDEDE",
+"& c #989898",
+"* c #525252",
+"= c #686868",
+"- c #212121",
+"; c #101010",
+": c #B2B2B2",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+&&+%#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+;=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X+::::+@@@@@@@@@@@@@@:;;;:@@@@@@@@#O;*@@@X+.:X@@=;;X@@@@@@@%-;;=@@@@@@X;O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+O o.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:O:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@& OX@@@@@@@@@@@@:*O %@@@@@@@@#* .@@:; -%@.;-@@@@@@@@%=O &@@@@@@%O.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%;-:%:O :@@@@##@@@@@@@@@@@@@@@@@@@X#@@@@@@@@@@@@@@@##@@@@@@@@@@X#@@@@@@@@@@@#= &::O :@@@@X%X@@@@@@@*;@@@@@@@#%X: :@& *:%= *@X$=@%%@@@@@@@& +@@@@@@@@@@@@@@@@##@@@@@@@@@@@@@@@@@X%X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O-#@@@&;#@X.- O%@#O;*@:-;*@@&;;=.; *@@.;;;+@@@@X.- -+@@@=;;&*o$.@@@@@@@@@@@=;@@@& +@@+O$ $.@@@@@@-*@@@@@:- ;O #%$=@@@@O$X+ O; -+@@@@@=$X@@@@:-;;&@@@@X&; OO;-*;;X#-;;X@@+O$ $=X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+ &@@@@@X@#-$=.* -@#= .@+* .@@:* $=*OX@&=-$X@@@XO$*.*$;X@@.- -.O=@%++++++%@@--&.*$=@@&oO..- :@@@@# .@@@@& O.=- -@=;#@@@@=oX& *.* -@@@@@-O@@@@@+=O +@@@@*oO.*$ -&.$O@#=;O@@:o-=.- &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. #@@@@@@@*;%@@@= %@: :@@+ :@@@& O%@@@@@@@OO@@@@. &%%%= +@@@* =#@@@+ O@# &@%$=@@@% *@@@@: :@@@%$*X@@+ *@-*@@@@@O-@= :@@@* %@@@#o.@@@@@@@.o#@@@: &@@@. &@#o=@@X$=@#;O%%%+$O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*;@@@@@@@X$=@@@@.o#@. #@@. %@@@*;@@@@@@@@X$=@@@@- +@@@;*@@@@@#:&&&&&:#@+ &%%&-o#. #@@@X$=@@@@. #@@@& %@@@% .@o*@@@@%$=@OO@@@@=$X@@@+ :@@@@@@@O-@@@@=;@@@@. +@+ :@@+ &@& O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= +@@@X&## =@@@%-O@@*;@@XO;@@@@-*@@@@@@@@+ &@@@XoO::::::X@@% .@@@@@@@@@@@@@@@. %@@@= #= %@@@. +@@@@*-@@@@. +@@X* +@-;#@@#O-#Xo-@@@%;*@@@@. %@@@@@@X$=@@@@*o+@@+;$X@& %@@= %@. &:::::%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: ;.&=-$%@- =&.;;%@@* ..- -+@&= -==+@@%.=O *=.@@O *&&=O=@#.* *==%@@@@@@@@@@@&-o===Oo=@: -&&* .@@&==;-==+@: -..O =X& -&.-;++= *&.;;%@+==-o==:@X.=* O==X@& -; O@@. *&O :@: -.&.*O%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&; O+@@+- $*#@@@:; $= ;:%; $&@@&o *@@%O oO:@:o ;+@@@@@@@@@@X; $-&X@@.$ -:@@X; ;:@@.$ O; -#X.o $*#@= * o*#@@* $.@+$ -#@@:*O*:o=@@%- *;$.@@.$ ;=X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%X@@@@@@%+X@@@@@@X%X@@@@@@@@@@@@@@@@@@@@@@@@@@%+%X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+%@@@@@@@@@@@@@@@@#+%@@@@@@@X%X@@@@@@@#+X@@@@@@@@@@@@@@@@@@@@@@@@@@@@+ :@@@X%#@@@@@@@X++#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X:= &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. o%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#:::%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn16.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn16.wxd
new file mode 100644
index 0000000000..00a42deed7
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn16.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 16 12 1 0 24384000 1270000 0
+ Helvetica
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn16.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn16.xpm
new file mode 100644
index 0000000000..abd9fbd668
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn16.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn16[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #121212",
+"X c #FBFBFB",
+"o c #272727",
+"O c #5D5D5D",
+"+ c #040404",
+"@ c #FFFFFF",
+"# c #3F3F3F",
+"$ c #BCBCBC",
+"% c #767676",
+"& c #F3F3F3",
+"* c #ACACAC",
+"= c #D0D0D0",
+"- c #E2E2E2",
+"; c #898989",
+": c #9C9C9C",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$OX@@@@@O*@@@@@@@@@@-O-@@@@@@@@@@@@@@@@@@@@@@%$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@@@@@@@@@@= =@@@@@@@@@@@@@@@@@@%$@@.:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@@@@@@@@@@= =@@@@@@@@@@@@@@@@@@.:@@&X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@@@=;%*X@@= ==*@@@@=*@@=;%*X@X*.O$@*-@@X*%:-@@@X:%%*X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@@:+o#+#&@= =$ =@@@oO@:+o#+#&X#+o%@.:@X#.#o.$@&o+##+O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: OOOOOO+%@-.;@@=.;@= =X.%@@= $-.;@@=.;@@.:@@.:@;.-@@#o@*+-@@;+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: ###### %@:.X@@@O#@= =@Oo@@;.X:.X@@@O#@@.:@@.:@#O@@@=;@&-@@@; X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@%+oooo.o@= =@$ =@o%@%+oooo.o@@.:@@.:@.;@@@@@@@=%O.+ X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@%o$$$$$$@= =@@o%= -@%o$$$$$$@@.:@@.:@.;@@@@@@*+O:-* X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@:.&@@@:*@= =@@%o%#@@:.&@@@:*@@.:@@.:@#O@@@*oX#O@@@* X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@&.O&X: :@= =@@= .:@@&.O&X: :@@.;@@.:@:+*@&o#@#o&@=o &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: &@@@@@+%@@$.+. %@@= =@@@o.&@@@$.+. %@@@#.O@.:@X% .+o-@$.+o.:+oX@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&$*-@@@@@@@@@@@@@@@@&$*-@@@@&*$@@@@@@-*$X@@@-*$&@=*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn17.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn17.wxd
new file mode 100644
index 0000000000..111558c031
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn17.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 17 12 1 0 24384000 1270000 0
+ Helvetica-Oblique
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn17.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn17.xpm
new file mode 100644
index 0000000000..7f66c7189a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn17.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn17[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #010101",
+". c #6E6E6E",
+"X c #FFFFFF",
+"o c #060606",
+"O c #838383",
+"+ c #2F2F2F",
+"@ c #9A9A9A",
+"# c #414141",
+"$ c #BFBFBF",
+"% c #1F1F1F",
+"& c #AEAEAE",
+"* c #D2D2D2",
+"= c #F6F6F6",
+"- c #E5E5E5",
+"; c #575757",
+": c #101010",
+/* pixels */
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.&XXXXX&.XXXXXXXXXXXO&XXXXXXXXXXXXXXXXXXXXXX&OXXXXXXXXXXXXXXXXXXXXXXXXXX*O##;&XXXX&OXXXXXXXO&X*.=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX* &XXXXX##XXXXXXXXXXX:@XXXXXXXXXXXXXXXXXXO@XX#;XXXXXXXXXXXXXXXXXXXXXXXXXOo+..+ #XXX;;XXXXXXX:@XO%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX@ -XXXXX:.XXXXXXXXXX* *XXXXXXXXXXXXXXXXXX:@XXXXXXXXXXXXXXXXXXXXXXXXXXXX.o&XXXXO OXX%OXXXXXX* *XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;%XXXXX* &XXX$OO*XXX@oX$$XXXX$$XX$OO*XX-@ O*-@=XX=&OO-XXX=@..&XXXXXXXX& &XXXXXX+#X- $$O@=XX@oXX&-XX=@.&=&*X*&XXX=@=XX=&OO-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+;XXXXX@ -X=#:#+ &XX.#X;#XXX* $=#:#+ &X&+o#&@oXX*+:#::-X-%%;+ .XXXXXXX++XXXXXXX;:X& #%#:%=X.#X- $X*%:#%.:$X;#XXX& =X*%%;%:*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX= +.....+%XX#+-XX#%XX+.X.%XXX#;X#+-XX#%XX.#XX.#X=%#=X-oOX;+=XX+#XXXXXX* &XXXXXXX;+XO .XX* @X+.X&o==+;=X-: =X+OXXXO+X=:.=X=:.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$ ######o;X$ *XXXO:X=o&X@oXX&o-$ *XXXO:XX+.XX+.X@o=XXX@$X-=XX=%.XXXXXXO -XXXXXXX+#X#+XXXX+.=o&X.+XO%=XXX#+X= &XXX#.XO%XXXX;#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXO =XXXX=oOX. %%%%:+X* -X$ -=%OX. %%%%:+X=o&X=o&X#;XXXXXXX*O;+: &X+oo:=.oXXXXXXX* @X:OXXXX%@* -X#.X#.XXXX+.X$ -XXX:@X+o%%%%o.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;+XXXXX$ $X#;$$$$$*X@:XX- $O%=X#;$$$$$*X* -X* -X%OXXXXXX@o;@*$ -X****XO =XXXXXX;:=* $XXX- $@:XX:@Xo&XXX=o@XO%XXX* *= O$$$$$-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%.XXXXXO =X+.XXX*.-X;#XXXo@o&XX+.XXX*.-X@:XX@:XXo@XXX.;=o@XXXO:XXXXXXX& @XXXXX& @X@ $XXX.+X;#X* *= &XXXO *X;;XXX.oX- &XXX$OXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX- @XXXXX;+XX.%-X*%#XX+OXXX+:#XXX.%-X*%#XX;#XX;#XX#+=X& &* @XX&:#XXXXXXXX+o@=X-. OXX.o;X=O $X+OX@:XX+#==@ oXX++XX& #XX+#=X&oOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX& *XXXXX%;XX=+ : #=X= $XXX;o*XXX=+ : #=XX.o#X+OXX*:o:oOXX+ +:;;o@XXXXXXX-# o +&XXX+O%:o:@X= $X.#XX$:o:+##XX. :%##.XX*:o:o.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=$&*XXXXXXXXXXXXXXXX=$&*XXXX=&$XXXXXX-&$-XXX=&&-X=&-XXXXXXXXX-&&*XXXXXXX=&$=XXXXXXXXXXX-&*X+.XXX$&*XXXXXX=&&-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=o&XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$ -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*@XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn18.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn18.wxd
new file mode 100644
index 0000000000..a050b7e6ab
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn18.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 18 12 1 0 24384000 1270000 0
+ Helvetica-Bold
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn18.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn18.xpm
new file mode 100644
index 0000000000..dd311b9628
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn18.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn18[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #6C6C6C",
+"X c #C6C6C6",
+"o c #919191",
+"O c #5D5D5D",
+"+ c #040404",
+"@ c #818181",
+"# c #FFFFFF",
+"$ c #3C3C3C",
+"% c #4E4E4E",
+"& c #DEDEDE",
+"* c #F4F4F4",
+"= c #0E0E0E",
+"- c #9D9D9D",
+"; c #222222",
+": c #B1B1B1",
+/* pixels */
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"#########################################################################################XO.####:O.###########.OX########################oO:#########################.OOOO.o&#############.OX######*OO&#########################################################################################",
+"#########################################################################################- +####o +###########= :###################@$-##% .#########################= =X############= :######* X#########################################################################################",
+"#########################################################################################- +####o +###########= :###################% .##X-X#########################= O--@; $############= :######* X#########################################################################################",
+"#########################################################################################- +####o +###:.%.&###= :XO.###-Oo##&@%OX##:$ $-#oO:###:.%.&###&@%%.&########= o###: =###*oO%@*###= :##*@%.& X#########################################################################################",
+"#########################################################################################- +XXXX. +##@ =X##= :& &##; o#X= @#$ $#% .##. +X#*; +X#######= o##&O %##&; =X##= :#*$ ; X#########################################################################################",
+"#########################################################################################- +#&+ X*. ;##= :#$ o#& +*#; @#: +&*% .*#% .#X +:&% $#o ;X&$ @#######= $*##O ;X&$ $##= :#@ =:X; X#########################################################################################",
+"#########################################################################################- %%%%; +#o $&&& &#= :#o $#o %#X +&&&; -#% .##% .#@ $##&O.#&X&*:; .*oooo&#= ++ =X##+ :##& &#= :#; o##: X#########################################################################################",
+"#########################################################################################- +####o +#. :#= :#& +*% -#: .#% .##% .#O .#######@; .* X#= o##*o +*& *###+ :#= :#+ X##& X#########################################################################################",
+"#########################################################################################- +####o +#. $-----&#= :##$ -=+*#: =-----X#% .##% .#O .######@ =oX. .*%%%%&#= o####+ :* &### X#= :#= :##& X#########################################################################################",
+"#########################################################################################- +####o +#- $##*oo*#= :##- ; %##& *##-o&#% .##% .#o ;##:+;#$ @##$ .#######= o##*o &#= o##- +*#= :#$ O##o X#########################################################################################",
+"#########################################################################################- +####o +#*= Oo$ $##= :##*+ :###% $-O =&#O $:#% .#*= $@; .#% ;@% .#######= %##o +..= .##= :#: %O+ X#########################################################################################",
+"#########################################################################################- +####o +##X; $&##= :###% =*###&$ ;X##- $#% .##:= %*#X= $. ;*######= +;@*###. O*##= :##@ . X#########################################################################################",
+"######################################################################################################*X:X###################X:X#####X:X#######*X:&####*:X########################&::&##########&:&#############################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn19.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn19.wxd
new file mode 100644
index 0000000000..a476fed413
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn19.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 19 12 1 0 24384000 1270000 0
+ Helvetica-BoldOblique
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn19.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn19.xpm
new file mode 100644
index 0000000000..6199132f97
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn19.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn19[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #A2A2A2",
+"X c #151515",
+"o c #050505",
+"O c #707070",
+"+ c #EDEDED",
+"@ c #FFFFFF",
+"# c #B8B8B8",
+"$ c #2B2B2B",
+"% c #616161",
+"& c #D0D0D0",
+"* c #424242",
+"= c #E3E3E3",
+"- c #8A8A8A",
+"; c #555555",
+": c #F8F8F8",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#%O@@@@.%O@@@@@@@@@@&%O@@@@@@@@@@@@@@@@@@@@@@@@@-%#@@@@@@@@@@@@@@@@@@@@@@@@:%%%%%O.:@@@@@@@@@@@@:%%=@@@@@@+%%+@@@&O**%.@@@@.%.@@@@@@:%%=@.%-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; *@@@@* ;@@@@@@@@@@- $@@@@@@@@@@@@@@@@@@@@**&@@X #@@@@@@@@@@@@@@@@@@@@@@@@& $:@@@@@@@@@@@& +@@@@@@# X@@@-o *@@@$ .@@@@@@& +@* O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X -@@@@X -@@@@@@@@@@; O@@@@@@@@@@@@@@@@@@@& +@:..:@@@@@@@@@@@@@@@@@@@@@@@@- o...; #@@@@@@@@@@@- $@@@@@@@O *@@- %.#; -@+ &@@@@@@- $@@#.=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= #@@@= #@@#O;O&@@@X .+%%=@@#%O:@#O;O&@@&% o-:#%-@@@#O;%&@@@&O;*O&@@@@@@@@% *@@@+ &@@:.;*O&@@@% %@@:.%%&* -@&o .@@@@$ *@# o&O;-:@@% %@=%%:@@&O;-&%O@:%%=@@.%.@@+-%;-:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. .###- +@O o#@+ &: #@@* O@O o#@; X@% ;@@O o#@#o X+@@@@@@@$ O@@:O $@@=$ o&@@$ .@+$ Xo #@* ;@@@@@O X@- XX %@@$ .@. X@@.o $ *@& o:@@* -@&X *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O $@# X#=* *@# X@@X .@# X+# X#=* *@:$ -:@$ -@. X#=* ;@$ O=# &@@@@@@+ $+@@$ *&&X ;@+ &@; $#&X += &@@@@@- $@; -=% :+ &@O ;@# -=% O@- $@@:o #@$ O=. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* X****o %@X .++- X@O *@@* .@* .@X .++- X@:o #@:o &@$ .@@#%-@&&+#% o:&---.@# ooo X&@# X:@@O $@# o@& &@@; $@# o@@@@@@; %@X O@@& &# o@@* -@* O@@& .@% %@@& +. $=++X .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X -@@@@o -& *@* -@@% -# $@& *@& o:@& o:& X:@@@@@@.* *@% *@- X@@@&X O@; O@@@- ;@- *@- *@@@% %@- $@@@@@+X -= &@@& :- *@@o #+ =@@& =@$ .@@. $@; #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@& &@@@& &. X.....#@X #@@- O* #@. X.....#@- $@@- $@. $@@@@@@- $-&; O@O;;;.@; ;@@@@$ O@$ .@@@* -@; O@% O@@@$ -@- o:@@@@- X+# :@@. $@; O@& +# o@@@. X@+ &@@; %@$ %.....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. o:@@@. o:. X:@+--+= +@@. $ *@@. X:@+--+@% %@@; O@- X@@#oX+o &@=o .@@@@@@@X -@@:. &@X O@@# o+@X .@; *@@. &@# O@@@- .@O &@+$ .@X .@. $@# =@+$ ;@# =@=o .@X -@@#-#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O $@@@@% *@&o *-$ ;@. $@@@& &@@&o *-$ ;@@$ *&@$ .@& ;OX -= ;-$ &@@@@@@= O@@% oO%o -@= =@- oO%o o:@@* $*X -@@* *-$ *@= =@% %@=o *-$ -@# *-$ &@% XO%oo&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$ O@@@@$ O@@.o oO:@O ;@@@+ %@@@@.o oO:@@* .+ &@@- o-@@* XO #@@@@@@. X*#@@@+$ o-@@# X@@+$ X; $@@@+; X.@@@X % ;:@# X@@$ .@@- Oo #@:$ X- o:@+$ $&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=##=@@@@@@@@@@@@@@@@@@=##=@@@@:##+@@@@@@@=##+@@@@##+@@@@@@@@@@@@@@@@@@@@@@@@&.#:@@@@@@@@@:##+@@@@@@@@=#.&@@@@@@@@=#=@@@@@@@@@@@@@@&.=& +@@:##:@@@@@@@&.&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. $@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.-&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn20.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn20.wxd
new file mode 100644
index 0000000000..580db52baf
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn20.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 20 12 1 0 24384000 1270000 0
+ Helvetica-Narrow
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn20.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn20.xpm
new file mode 100644
index 0000000000..84385cda0b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn20.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn20[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #252525",
+". c #909090",
+"X c #020202",
+"o c #6E6E6E",
+"O c #151515",
+"+ c #FFFFFF",
+"@ c #EEEEEE",
+"# c #090909",
+"$ c #DFDFDF",
+"% c #CECECE",
+"& c #333333",
+"* c #C2C2C2",
+"= c #9F9F9F",
+"- c #464646",
+"; c #F9F9F9",
+": c #B2B2B2",
+/* pixels */
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.$++++=%++++++++%=++++++++++++++++++%=+++++++++++++++++++$.$++++.@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .++++++++=&+++++++++++++++o$+=&+++++++++++++++++++*X-+++;X%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .++++++++=&+++++++++++++++O*+@$+++++++++++++++++++*XX*++;X%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .++@=.%++=&$:+++$:++:o:++:O.$$*++;=o*+++*o.$++++++*#o-++;X%++*o.$++%%$.@:@.@+$..@+%*++**++*%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .+@& -#*+=&$X$++o-+oO-#.+-X :=&+;-O&X=+=#- O@+++++*#$X*+;X%+=#- O@+.-O&* -#@*#& $= ++ &++&:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X&----#.+.&;+.&+=&+ .++ =*#$+%X@+O*+=&+= @+o&+&=++ =+++++*#+o-+;X%+&=++ =+.X:+*Xo++&o+;-o$X@@O#;;X@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X-----#.+&=++$X@=&+o-+$X@oo+++ :+O*+=&+-o++$.+%;+@ .+$$$;*#+$#*;X%+%;+@ .+.-++*#;+$X@++: +O**- %* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .+O X%=&+*O+.-+-O #.+O*+=&+&.+++++%-O#O.+OXX:*#++o&;X%+%-O#O.+.o++*O++*#+++%X+-..oo=.o+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .+Oo::::@=&+;O%-.+--::::$+O*+=&+&.++++;O-*;-.+:::@*#++@#:X%;O-*;-.+.o++*O++%#+++%#+.oo:.o-=+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .+&o++@o;=&++-.#$+o-+++o%+O*+=&+-o++:&%X;++&.+++++*#+++o&X%%X;++&.+.o++*O++@X%++.&+% $%& $+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .+=O%$-&+=&++=O&++%#:@.#@+ .;=&+:#*@&o$X*;.X.+++++*#+++@OX%$X*;.X.+.o++*O+++o&$%O=++# +;# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++X*++++ .+;oXX $+=&++@X.+++.XX#:++oX==&++oXX @+oX#o.X%++++*#++++.X%+oX#o.X%.o++*O+++@-XXo+++--++&o++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@%;+++++++++++++;%@++++@++++++@%;+++$@++@++++++++++++++++$@++@++++++++++++$@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn21.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn21.wxd
new file mode 100644
index 0000000000..d1974973a0
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn21.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 21 12 1 0 24384000 1270000 0
+ Helvetica-Narrow-Oblique
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn21.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn21.xpm
new file mode 100644
index 0000000000..6dc9dd4fb8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn21.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn21[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #010101",
+". c #D7D7D7",
+"X c #FBFBFB",
+"o c #929292",
+"O c #393939",
+"+ c #C8C8C8",
+"@ c #FFFFFF",
+"# c #A8A8A8",
+"$ c #4F4F4F",
+"% c #BABABA",
+"& c #0A0A0A",
+"* c #F2F2F2",
+"= c #646464",
+"- c #202020",
+"; c #7A7A7A",
+": c #E6E6E6",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+#@@@@.o@@@@@@@@@o:@@@@@@@@@@@@@@@@@@o:@@@@@@@@@@@@@@@@@@@##@@@@%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+=$=+@@@+%@@@@@%+@%+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$=@@@@;O@@@@@@@@* :@@@@@@@@@@@@@@o#@* :@@@@@@@@@@@@@@@@@@@& *@@@$;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; -$- #@@$;@@@@@O#@O#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-o@@@@$=@@@@@@@@+&@@@@@@@@@@@@@@@Oo@X.@@@@@@@@@@@@@@@@@@@: o@@@-#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o #@@*O-X@-#@@@@X&.@:*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X %@@@@-o@@:o;.@@oO*#*@@*#XX#;%@@#&;:.+@@:o;:@@@%;o:@@@@@@%&=$@@* .@@%;o:@@+.+o:%:oX@.oo*@++@@%+@@%.@@@@X-o@@@@% :X .o;:@. X*#@@*#;.%:@#*@@++@@:o;.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. *@@@X %@.-O-&:@==: +@@;$*O-O %X- -.==@%&O--X@=-$-O@@@@@@oO% *@+ X@=-$-O@@$=&=o$--@o&$-O@;$@*&=@*&.@@@@o-X@@@@: +. OO--X#-@#O@*O&O--%* :@@$o@.-O-&:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# $$$$O :@-o@X-#@Oo@&%@*&+=$X@==@%-@@Oo*&#@: ..&*@+ X@@@@@==X&#@o-@.&*@+ X@-O:@=&+@.&+@. +;$@o&=@o$@@@@@O;@@@@@: .# #@: %;$@;=@;OX@= :+-@@@-%@-o@X-#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;-$$$$O-@#O@@@=;@&+@-o@oO:&:@@#O@o$@@&+oO@@@o:*:@Xo-@*..:@Oo@=$@=$@*:@Xo-@* +@@Oo@@=;@@@-#o$@O=$@O%*..:@-#@@@@@+ X;O@@@-#$;@$oX&+@@o-@oO@@* :#O@@@=;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$;@@@@;O@=&---&o: *@$oX-%#&----$@=;@: *Oo@@@@@*=-&-$@= ;X&+@% *O;@*=-&-$@+&@@@&+@@&+@@@-+#O.O#$.-X= ;* +@@@@@;O@$o@@@&+-#@-%+&@@@oO@=;@@+&@=&---&o@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-#@@@@$;@O;%%%%:%-@@=;#O@;$%%%%.@O#@%-@-%@@@@X-O%*=;@+%%.. *@X&#&#X-O%*=;@#O@@. X@* *@@: :#O;o%$;o@+%%.X %@@@@X-#@-%@@. * .X .#O@@@==@Oo@@oO@O;%%%%:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* +@@@@-o@-#@@.=Xo$@@o=O%@==@@X=:@&.@o$@ %@@=;%&X@X-#@@@@@#-@@@=O .%&X@X-#@;=@@%-@@: .@@;$@%O-*+O-:@@@@@@-=@@@@;-X* %@@;=+&@+&@#-@@X-o@&%@@O=@-#@@.=X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+ *@@@* +@$O*+O;@=;@@#&O@@o&::=O@: +@=;@O=*#&.o&*:= +@@@@@;$@@@% &@o&*:= +@$o@@o$@@@-;*#&.@. $@+ =@@@@@@@o o.+=&+@+ $*#&.#O@#O@. +:$ +@&;*;&o@$O*+O;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o-@@@@+ *@+& =X@O#@@+ #@@*O O:@X&&@O#@%& &#@.& &%-O@@@@@$;@@@X-O@.& &%-O@-+@@=;@@@#& -%@@: %@. +@@@@@@@X$ -+@@o$O &%@;=@;=@@= = *@= ;-+@+& =X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+:@@@@@@@@@@@@@X.:@@@@X*@@@@@*+*@@@*.X@**@@@@@@@@@@@@@@@*.X@**@@@@@@@@@@@*.@@@@@@@@@@@@@@@@@@@@:%.@@@@@@X.X@@@@@@@@@@.:%-@@@.*@@@@@*+:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn22.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn22.wxd
new file mode 100644
index 0000000000..0944e5c953
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn22.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 22 12 1 0 24384000 1270000 0
+ Helvetica-Narrow-Bold
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn22.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn22.xpm
new file mode 100644
index 0000000000..01d02331c2
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn22.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn22[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #8F8F8F",
+"X c #010101",
+"o c #A3A3A3",
+"O c #161616",
+"+ c #050505",
+"@ c #FFFFFF",
+"# c #BABABA",
+"$ c #2C2C2C",
+"% c #0A0A0A",
+"& c #646464",
+"* c #D1D1D1",
+"= c #F6F6F6",
+"- c #E6E6E6",
+"; c #464646",
+": c #7C7C7C",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=.o@@@*.*@@@@@@@@*.*@@@@@@@@@@@@@@@@@@@@.:@@@@@@@@@@@@@@@@@@@@*.o@@@#.-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-....o*@@@@@@@@@@@o.@@@@@@o.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O@@@. :@@@@@@@@o .@@@@@@@@@@@@@@@-;:@@$%@@@@@@@@@@@@@@@@@@@@o X*@@: #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# X.@@@@@@@@@@$%@@@@@@$%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O@@@. :@@@@@@@@o .@@@@@@@@@@@@@@@* &@@.:@@@@@@@@@@@@@@@@@@@@o &@@: #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# $::; +=@@@@@@@@@$%@@@@@@$%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O@@@. :@@*&&#@@o .#:#@@#:-@*&&#@=& $o@..@@=.&.=@@=:&&*@@@@@@o X+-@: #@@.&&o@@o:-:#o:-:#@-:&:-@#:*@#:*@#:-@@@@# &@@@$ *@@*:&.@@@$%@@-:&*$%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O---: :@#+ .@o .# ;@@$X=#+ .- $@$%@=$ $=@$ %*@@@@@o ; :@: #@& o@; & o; & o-O O-. :@; .@; -@@@@# &@@*%+=@#% ;@@$%@=O OO%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- :@$ .o%O=o .=%O@=X;@$ .o%O=# ;-@$%@o ;#; o* ;*& .@@@@@o .;%=: #@OO*. ;@; %&*; %&*& &#& &* ;@OX&@O$@@@@@# +%% .@@$X.#$ o@$%@. $o& %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- +$$$O := $--& *o .@; *# .= $--& ** &@@$%@& o@*:#-#-*& :=:::#o .# :: #=#*-. ;@; o@@; o@@O%=@=%O@O$= ;$- &*:::-# X%%X $=- ;@@# &@$%@& #@- %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O@@@. :* oo .@. o: ** o* &@@$%@; -@@@@@:% + :- :o .@$O& #@oO + ;@; *@@; *@@X$@@@$X@;X#X.%# oo ## &@@-$ ## &@@- ;@$%@; -@@O%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O@@@. :- $oooo*o .@- &;O@- $oooo** &@@$%@; *@=-=o $oo :-&&&#o .@# O #-+O.- ;@; -@@; -@@%O@@@O%@: &$* & -*&&&*# &@@@: .* &@@* ;@$%@; #@@$%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O@@@. :@%%=@o:-o .@@$$+&@@%%=@o:-* &@@$%@& .@: .& #@: :@@@@@o .@@$ #o :@# ;@; -@@; -@@$ *@* $@# O&=XOO@@@@@@# &@@*$ o=+O=@. :@$%@& :@*X%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O@@@. :@& $;XO=o .@@: #@@& $;XO=* O:@$%@# %;+%-: ;:% :@@@@@o .@@o ## $:O ;@; -@@; -@@o O;O o@=+ :@$ &@@@@@@# X%% O=@& O;X+-@$%@* +;OX%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- O@@@. :@=; O*@o .@@# %=@@=; O*@@$ $@$%@@:X %o@-O %. ;@@@@@o .@@@O #@; X.OO=; -@@; -@@@.+ +.@@@$ #@& .@@@@@@# XO;*@@=&X O#@@$%@@:X &$%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-*=@@@@@@@@@@@@@@@-*=@@@@==@@@@@@=*=@@@=*=@@@@@@@@@@@@@@@@@@@*=@@@@@@@@@@@@@@@@=*=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=*@@@@@@@@@=-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn23.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn23.wxd
new file mode 100644
index 0000000000..7ac1e91c62
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn23.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 23 12 1 0 24384000 1270000 0
+ Helvetica-Narrow-BoldOblique
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn23.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn23.xpm
new file mode 100644
index 0000000000..13e2d94ab7
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn23.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn23[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #010101",
+"X c #494949",
+"o c #7F7F7F",
+"O c #DADADA",
+"+ c #ECECEC",
+"@ c #050505",
+"# c #FFFFFF",
+"$ c #181818",
+"% c #959595",
+"& c #2E2E2E",
+"* c #0B0B0B",
+"= c #ACACAC",
+"- c #666666",
+"; c #F9F9F9",
+": c #C4C4C4",
+/* pixels */
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"####################################################O%:###=%+########=%+###################+o%####################=%:###=%#########################################:%%%%=+##########O%:#####+%=###:-X-:###=%;#####=%++o%########################################################################",
+"####################################################o o###$ +########& +###############=X=#: -####################& X###*$#########################################X *O#########o =#####= o##o. @=##$*######& +: -########################################################################",
+"####################################################X =##;.$#########*$################o =#:o:####################* @;#O X#########################################$.oo-$ %#########X O#####o =#% *o=X $#+ &######*$#:o:########################################################################",
+"####################################################& O##: X##O--%##O X;oo##+o=#+oXo+#=& -+=o+##=--:###=--%######O . =#= o##=--%##:oO%%:oO%%#O%-o+#=oO#=oO#=o+####;.&###o %##:o-%###$*##+%-:- O+*@:##+* O: -=-o;#O X#=o+##=-%OoO#o%##:oO#;%--O##################################################",
+"###################################################;.*O++% -#:* o#= o#@.##o =+$ &#& +&.;#o .:#o %#####= X -#o =#o %#- X %- X %:$ &#- =;$ :;$&#####: X##O&@+#%@ o#;.&#+& $$.;% -####& :% & o#= o#&.;#o X :+ X##- O#X *+#################################################",
+"###################################################: %;$*== $#o =#$ ;;$$;X o:$ OO &O#*&#: &=X o+*&Oo -#####o =&$#- O+*&Oo -#& $-O& $-:$@%=$ :o =:. := %#####% @** .=#:.$=% @;: -#o X=& &#X :####& +- $=- &#o =#*&#: $=X +: -##&@;% X:X %#################################################",
+"###################################################% *&&&@ := -++$@#- :#X += %+.&++- :: -#O X#X :#:o=+:OO- %:ooo+- Oo :&@;+:OO- %#**O##**O#% o##- =o =-X :-@+=oo%#- *** o#X :##$ O% %;**;#= X#& ;####**#X :#+ $#- :O X#X :#O $#% %#;@&#&@O+% o#################################################",
+"###################################################o %###$.+- $#&.;#- OX$;% O% %#= o#*$#####+-@ @ :- .;&.;: o@&#+-@ @ :O X##O X##X :##X :% =$% :*-#& &#X O##= &#**;##$@;- :: -##= o;@*####: &#$$##+ X#&.;= o#*$##+ X#- :#O XO %#################################################",
+"###################################################X :##+ $#X.%%%%=;@&##o % o#o o%%%%;- :#o =+ X##++#X.-OX +%--o;@&#;*$ -#X.-OX += o##= o##&.;##$.+= -$+ - :#---%#$@###: &+ &##O &#X += o##o =;..;###- =+ X##= -;@&#o =+ X##= -#& +#% o: X%%%%O#################################################",
+"###################################################$ +##: X#& O#=oOO X##% &*+#o %#Oo=#X +#X OO &#+*&O X#O*$#####O X##X oO X#O*$#o =##o =##& O#= X#= $-+ $&######+ &##+X o+ $##- %#$$#% X#+$ O#$ o##o $#: $##X :O X#X OO $#;X %#$.;#& == -#;o%##################################################",
+"##################################################+ $###% o#- $X@$;= o##: o##= *-$@:#$ -;&@;;* X$ =: $o& X#####= o##= =: $o& X#X O##X O##- *X@*O#: :+ %######: .@@ $;#& $& &;+ X#: .X$.*##o &$ @:#% .&& X#= o#&@;;* &&. :#$ &&@ OO@@X& %##################################################",
+"##################################################: X###- =#O& &O#o =##O @+###X $=##-.$;@&##%@ *%#;$ *% &#####o =##+. O;$ *% &#&@;##&@;##+& &O##: $#+ *+######% @$-+##:$ @X+#: -##X .o@&##;- &:##- o. X+#o =;@&##%. X&.;#o .-&*##o. *o###################################################",
+"##############################################################OO################+O;####++######+O;###;O;##################;O;################O+#############################;O;#########O+#######+:O#######+O############+O#*$###O+######+O;####################################################",
+"###########################################################################################################################################################################################################################O X##################################################################",
+"###########################################################################################################################################################################################################################= o##################################################################",
+"###########################################################################################################################################################################################################################O=O##################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn24.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn24.wxd
new file mode 100644
index 0000000000..c1631ab4f2
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn24.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 24 12 1 0 24384000 1270000 0
+ NewCenturySchlbk-Roman
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn24.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn24.xpm
new file mode 100644
index 0000000000..3b700d3f8c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn24.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn24[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #373737",
+"X c #030303",
+"o c #4C4C4C",
+"O c #FFFFFF",
+"+ c #EEEEEE",
+"@ c #616161",
+"# c #CCCCCC",
+"$ c #737373",
+"% c #DEDEDE",
+"& c #878787",
+"* c #999999",
+"= c #0F0F0F",
+"- c #222222",
+"; c #F9F9F9",
+": c #B2B2B2",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO:&&*OOOO&&&&:OOOOOOOOOOOOOOOOOOOOOOOO:$o$%#:OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+&o@*O&OOOOOOOO:@o:OOOOOO*@o#O$@@OOOOO;@@oOOOOOOOOOOO;&&&&&&*#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#*= :OOO:. @#OOOOOOOOOOOOOOOOOOOOOO+o.#+:-=&OOOOOOOOOOOOOOOOOOOO+:OOOOOOOOOOOOOOOOOOOOOOOOOOOOO+-*+#$- OOOOOOOO+: &OOOOOO+* #O%.-OOOOOO%o=OOOOOOOOOOO;:o o::&=o;OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-==%OOO#=OOOOOOOOOOOOOOOOOOOOOOOOo-;OOO%=$OOOOOOOOOOOOOOOOOOOO#@OOOOOOOOOOOOOOOOOOOOOOOOOOOOO&oOOOO$ ;OOOOOOOO; &OOOOOOO# #OO@-OOOOOOO$=OOOOOOOOOOOOO* *OOO& &OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-* .;OO+.OOOOOOOOOOOOOOOOOOOOOOO: &OOOOO@@OOOOOOOOOOOOOOOOOOOO@@OOOOOOOOOOOOOOOOOOOOOOOOOOOOO@oOOOO+=+OOOOOOOO; &OOOOOOO# #OO@-OOOOOOO$=OOOOOOOOOOOOO* *OOO* @OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-;$ @OO;.OOOO#$$:OO:**:#***+***+o #OOOOO#@OOO:@$#OO#:*;*@*OO+@ .**O#::O;:::O;:::+$$%***#+***O& o#OOO*+OO%&@*;O; &#$$%OOO# #OO@-%$$#OOO$=O:***#OOOOOOO* *OOO$ :OOO#$$#OO#:*+*@:O+&@#OOOO#$@$#OO%:*+:@&+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-;;. :O;.OOO:=#%.&O%--%+$ :;#=&;- %OOOOOOOOO$.%#=#O*-=@&&X&O+:=o:#O*--O+&-.O+&=@@$ *& @+;*X:O+- =@:;OO#=*+-$O; oo*.-+OO# #OO@=@#&X*OO$=O%.-*+OOOOOOO* @:*@-*OOO*-##-*O:o o&&X&o*oX#OO:=#%$X#O#o @$*=oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-;O%==%;.OO+=$OO*=+O*X%O: *O;.OOX +OOOOOOOO# :OO@.OO$ :OO.-OOO=@OOOO@-OOOo.OOO.=*%@+O..OO:$OOO;*.X .;O..O;XoO; .OO: *OO# #OO@X%OOo=;O$=O*o+OOOOOOOOO* o&o.%OOO+=&OO&=+O: &OO. #O+ $OO$ +O+ *OO: $OO$ %OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-;OO* .+.OO: &::$ :O+X&Oo..O**OO- %OOOOOOOO$ :::o ;O$ +OO@=OOO=@OOOO@-OOOo.OOO.X;OOOO* #Oo%OO:OOO+:o *+ $OO#+O; $OO+ *OO# #OO@-OOO& #O$=* #OOO;&&&*OO* *OO@-;OO: :OO: :O: #OO@=OOO=$OO;#;#$ &OO: :OO: #OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-;OOO@ @.OO* $****%OOo-+o: #o+OOo :OOOOO+oO@ *****+O$=OOO$=OOO=@OOOO@-OOO..OOO..OOOOO;=@%oOOO-+OOOOO.@# &OOOOO; &OO+ &OO# #OO@.OOO* #O$X@--+OO+---.OO* *OO: *OO* #OO: *O: #OO@-OOO=$OO+@.&# &OO: #OO: #OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-+OOO;- .OO: *OOO++OO: o:O-ooOOO#X@OOOOO*&O$ %OOO%OO$=OOO$=OOO-@O:*O@=OOO=.OOO.oOOOOOO&X@:OOO=&OOOOO@$; @OOO#O; &OO+ &OO# #OOo-OOO& +O$=O#X@OOOOOOOOO* *OO# oO*# :OO: #O: #OO@-OOO=$OO..OO+ &OO: #OO: #OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO# *OOOO#X.OO;-.;O;.%OOO-=;O$ :OOOO&X:OOO#.+O%X@OO%.;O$=OOO$=OOO.oO$:O& +O:X-OOO-oOOOOOO+X-OOOO-X:OOO%=#OoX#O#oO+ &OO+ &OO: :OO. #OO.@OO@=OO& &OOOOOOOO* &OO;X=%oO.@OO@.OO: #OO@=OOO=@OOXoOO$ $OO: #OO: #OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO$= XoOOOO*.OOO#.-o-:OOOO$$OO%-OOOOOO:-o$.o%OOO:=.o.%O&= o%$= o%O& .oOO%-=.$o .#@ =@+OOOOO@*OOOO-:oo$@-:OO+oX.-%#o -&#o -&:. .:O-:.$oo+O$= o#o o+OOOO+.= =.%O$ X:O%.@@.%O:- .:$= o#o =$O$X..*@X$:- .::- .:OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO%OOOOO%#;OOOOO++OOO%OOOOOOOO+#+OOOOOOO%%OOOOOOOOOOOOOOO+#OOOOO%+O++;OOOOOOOOOOO@;OOOO+OO;#%OOOOOO%#;OOOOOOOOOOOOOOOOO%OO%+OOOOOOOOOOOOOOOOOOOOOOOOOO#%OOOO%%OOOOOOOOOOOOOOOOOOO%#;OO;OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#-#*&OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO# o@;OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO%%OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn25.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn25.wxd
new file mode 100644
index 0000000000..b74538a1c0
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn25.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 25 12 1 0 24384000 1270000 0
+ NewCenturySchlbk-Italic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn25.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn25.xpm
new file mode 100644
index 0000000000..d87abf9c33
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn25.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn25[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #5A5A5A",
+"X c #6D6D6D",
+"o c #EAEAEA",
+"O c #FFFFFF",
+"+ c #838383",
+"@ c #070707",
+"# c #DDDDDD",
+"$ c #191919",
+"% c #989898",
+"& c #CECECE",
+"* c #BEBEBE",
+"= c #ADADAD",
+"- c #313131",
+"; c #F7F7F7",
+": c #474747",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO&+++oOOO*+++=OOOOOOOOOOOOOOOOOOOOOOO=.:X&O*OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO;%..%O&#OOOOOOOO=X.=OOOOOOX.:;O%X.&OOOOO+X:#OOOOOOOOOO&++++=OOOOOOOOOOOOOOO*X.%OOO*;OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo*- +OOO&. X&OOOOOOOOOOOOOOOOOOOOOo:$*;&-:.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO;-+;;%-@#OOOOOOOO;% *OOOOOOo--OOo.@;OOOOOo:$OOOOOOOOOOOo=$ +#OOOOOOOOOOOOOOO;= =OO# %OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-@$;OOO*$OOOOOOOOOOOOOOOOOOOOOOo-$#OOO& +OOOOOOOOOOOOOOOOOOO+-OOOOOOOOOOOOOOOOOOOOOOOOOOOOX:OOOOX$OOOOOOOOOO+$OOOOOOOO$+OOO::OOOOOOO-XOOOOOOOOOOOOO@-OOO;$=OOOOOOOOOOOO%@;OOO&;OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO;-+ %OOO%+OOOOOOOOOOOOOOOOOOOOOOX %OOOOO@*OOOOOOOOOOOOOOOOOOO-.OOOOOOOOOOOOOOOOOOOOOOOOOOOO--OOOO=:OOOOOOOOOO:.OOOOOOO& &OO;@%OOOOOOo =OOOOOOOOOOOO* XOOO* #OOOOOOOOOOOO.:OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO=Xo@$OOO.&OOO;*%#Oo=%*OO#&Oo=OO#@$;OOOOO-oOO;*%#Oo=%*O*=OOO&* +*O&=%oOO&#OO=%=;=*O#=OOO=oOO: .oOO#%OOO;*%#OOo@=o%&OOOO+$OOO* #=%oOOO%@;*%oOOOOOOOOO+ *O;*.$*#OO#%&O*oOOO@%O;=%%OOOO#%=OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX=OX =OO-OOO&-=+@o#X *OO.:O= &O+ XOOOOOO;OO&-=+@oo% +.X@%OO%:@+%O=-@;O;@%O;%@..-@o$ *OO@%OO*@ @.&OOOO&-%&-#O=@=:.@oOOO:.OOOX$.X$$oOO.:+.--OOOOOOOOO-@;O#+@:+&O%$+.+ &OO* #O;%@.OOO+:*+.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-oO# -O&.OOo@*O* oO%@;O;@%OO-#O. %OOOOOOOOo@*O* oO# :#O-XOOO.:OOOO:.OO* oOO;@$o*X+#-XOO$#OOO&: +OO;$+O= *O.$+O# &OOo@=OOO$$oO* %OO@:=O%-OOOOOOOO;@:OOO# *OO* =OO$$OOOX-OOO; =OO+$;O--OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo-OOO. *+%OO.-O#-XOO.:OO* oOO:OO- *OOOOOOOO.-O#-XOO% &O;@=OOO$%OOO;@%OOX-OOO* %OOO#O+$O&.OO=OOO&. #O+$;Oo=OO$:OO%@;OO=@oOO# =OOo +O* +O*:&OO=%%*OO= +OOO%$OOO:-OOO$.OOO-XOOO=@oOo@+OO*#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO%+OOO& ::#OO$:X.=OO;@%OO.-OOoXOO: &OOOOO#&O$:X.=OOO::OO%@oOO* #OOO* oO;@+OOOX$;OOOOO= oX&Oo-OOOOO+ *O::OOOOO& *OO::OOO.:OOO+$OOO* *OX$%-+OOOO-$$=OOX &OOO:.OO; +OO# =OO# *OOO.:OO* &OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO:=OOOO: -OO; X;OOOO* #O& .OO+&OO+ %OOOOO.&; X;OOOO;@=OO::O&OX-O&oOX-OOX &#oO$XOOOOOOo %XOO*@oOOOO* #O$XOOOOO+$OOo@%;&O$+O*O.:OOO.$;O-XO+.O#oOOOOOOO-$OOO;@=O*& =OO+@;*O%@O&oO$+O*% oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO& *OOOO* XOOO$.OO&%O%@Oo.:.O*.OOO;--oOOOXXOO$.OO&%O=@oOO@%*%O:Xo:OO:XO=:@;.;# &OOOOOOO$$;OO+ .OOOO..OO:-OO*XO-XOO= oX## &+&O.:OO*@*O# *O+-;.;OOOOOO# :OOO* o+=o %O#$-oXO..oXO# &+*& =O;.#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX@ @XOOOO-=OOO=$:..;O&@::o%@:.;OOOOo.$..-%OOO=$:..;O.:OOO$-XOO.-:oOO+@:%% :#O+$OOOOOOOO.%OOO.=+-X+-X;OO#$..XOo *OO*@:*O# :=OO#$XX-=OO%@OO*@:#OOOOOOX@ @-#O& :%OO+@..%@:oO.$:;O& :=OO+$X:*OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#;OOOO;&;OOOO;#OOO#oOOOOOOOO;&#OOOOOO;&;OOOOOOOO;#OOOO#OOOOO#oOO&;OOOOOOOOOOO;.OOOOOOOO##;OOOOO;&;OOOOOOOO#oOOO#oOOOO;&#OOOOOOOOO#;OOOOOOOOOOOOOOOo;OOOO##OO#OOOO&OOOOo;OOOOo#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.=OX&OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO--.&OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn26.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn26.wxd
new file mode 100644
index 0000000000..d3e7d02c48
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn26.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 26 12 1 0 24384000 1270000 0
+ NewCenturySchlbk-Bold
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn26.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn26.xpm
new file mode 100644
index 0000000000..3a72ff904a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn26.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn26[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #363636",
+"X c #5A5A5A",
+"o c #909090",
+"O c #494949",
+"+ c #272727",
+"@ c #171717",
+"# c #FFFFFF",
+"$ c #A8A8A8",
+"% c #080808",
+"& c #BEBEBE",
+"* c #797979",
+"= c #686868",
+"- c #D3D3D3",
+"; c #F8F8F8",
+": c #E7E7E7",
+/* pixels */
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"#########################################&***$####****&##########################:o=O=&-=###########################################################:*XX*:o&#########:*=Xo######&=XO&#*=X=######&=XO-###########&******o$:############&=XO&######*=XO;##########################################",
+"#########################################-O o###o@ X-#########################&@%$-&+ @########################=-################################&%o-&X% o#########:o =######-= $#$@ +######-X &###########-*% =$= *###########-= $######$. ;##########################################",
+"###########################################. &###o@##########################& $###;+%#######################; &################################+O####* o###########% =#######- $##O +#######& &#############+ ;##X &###########- $#######* ;##########################################",
+"###########################################.. %-##$.#########################;+ @#####$ #######################* &###############################: @:####.*###########@ =#######- $##X +#######& &#############. ;##o $###########- $#######o ;##########################################",
+"###########################################.$O +:#&.####oXO=-#:****&****-***&& O#####;@###;*OO*;#-oo*:$XO$##-O X*-$o**#-oo*-#$o*o;*Oo&****#o**o; %Oo-#-&###$=OX$###@ =&=Oo;##- $##X +-=O*;##& &&****:#######. ;##O @:###&=OX$###- $###&XOoo ;##########################################",
+"###########################################.&;. .;&.##;. o-.%&:X X-X *:o .-o =#########-@%&-%+;-X X+@ $#-= =o-$+ #-O $#$. +=X $+ o#&+@$#X +$##;O =:O o##@ .@+ *##- $##X %.*+ +;#& &-X O$;#######. $oO@X-###* O-* O;#- $##$ **% ;##########################################",
+"###########################################.&#:@ X$.##* @##* .#;@ O#: o#:%:#= =#########. X##O *#& O#: =##& &###= ##& $##* %X:%@;& *##Oo##:O o#* %;#@ X##@ @:#+ .##- $##X -#$ o#& &:+*##########. **O%O$##& -#; *#- $#;@ X##O ;##########################################",
+"###########################################.&##-% ..##+ @**. ;#* :& +#o=##o X######:#: .**+ .#- o##@ X##& &###* ##- $##o $#:;##O %:-+;#:&#-*O% @#+ .##oX-##@ O##X +##- $##X @##- X#& o@ &###$@@@=##. ;##* o#= ;##@ +#- $#& o##* ;##########################################",
+"###########################################.$###$ .##@ +$$$$$;#:% *X= $+-##& .#####;@:- O$$$$$#- $##+ X##& &###* ##& $##o -#####& *=o##-%:###;$ ;% .#######@ =##X +##- $##X +##; O#& @@ @:##$ X##. ;##- +#O ;##. @#- $#$ $##o ;##########################################",
+"###########################################+$####* .##O @####o###X @+;+ +O####O -####$O#;% X###:$#- $##+ X##& &&X#* :#o $##o :######O @@;##- X#####@@#. @;##:*##@ =##X +##- $##O @##: *#& $& .;#;---:##. ;##- +#* :##@ O#- $#& o##= ;##########################################",
+"##########################################-%X#####X .##& *#;=X###- *#o &####:@ .:##$@-##* %$#:.o#& $##@ O##- *=o#$ =$+ o;#* :######- *###: =;##- o#$ *#;O$#;% X##O @##& o##. -#o @:#& $#* X#######;@ :#;O o#:@ o#& %-#& o##. +;:@ &;#########################################",
+"#########################################o% %;###;..###$@ %%X;####.%:#:%.######:X% .@.-####*% @%o#$% %$+ .##O .;##X +&%@@*=% @*######X%:###:%oX@XO@o###$@ @%o#-@ =X @o@ %o#+oo+X%.-#o% %o@ O#####o% @+%@O$###-O%X@.&#$@ %o#-. %+o%@+$#########################################",
+"###################################################;:#####:-:######:-###-:#########:-;#######;--;################--#####:-##############;o&#o=#####:##;--#######:-;####################-##;-:###################################;-:############:-###############################################",
+"########################################################################################################################################o @:@:##################################################################################################################################################",
+"########################################################################################################################################$%%@&###################################################################################################################################################",
+"#########################################################################################################################################;&;####################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################",
+"################################################################################################################################################################################################################################################################################################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn27.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn27.wxd
new file mode 100644
index 0000000000..b3b29d4541
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn27.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 27 12 1 0 24384000 1270000 0
+ NewCenturySchlbk-BoldItalic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn27.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn27.xpm
new file mode 100644
index 0000000000..e621e9ce00
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn27.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn27[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #FAFAFA",
+"X c #B4B4B4",
+"o c #020202",
+"O c #393939",
+"+ c #FFFFFF",
+"@ c #CACACA",
+"# c #EEEEEE",
+"$ c #727272",
+"% c #DDDDDD",
+"& c #848484",
+"* c #505050",
+"= c #646464",
+"- c #0C0C0C",
+"; c #9B9B9B",
+": c #212121",
+/* pixels */
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++&&&&%+++@&&&&+++++++++++++++++++++++++@$**&.%@+++++++++++++++++++++++++++++++++++++++++++++++++++++++.;=*&#.X++++++++++;$=*X++++++&$=*@+&$=*%++++#$==*#++++++++++@&&&&&&;@++++++++++++#$==*.+++++@$=**+%&&&&&;+++++++++++++++++#$==*.++X=@+++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++.;* =+++@* :&+++++++++++++++++++++++#* OX@&O:;+++++++++++++++++++++%;;#+++++++++++++++++++++++++++++#:OX@&:O*++++++++++@O %++++++XO o#+XO -.++++#X- O+++++++++++%;o &$- *.++++++++++#X- O++++++#X *+%;: =X++X;X++++++++++++#X- O+++O *+++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++; o%+++% %+++++++++++++++++++++++#: :#+++* @+++++++++++++++++++++$ -.+++++++++++++++++++++++++++++* %+++X $+++++++++++* :++++++++O O+++: *++++++#o &++++++++++++# O++= X+++++++++++#o &+++++++% ;+++: -.++.o &+++++++++++++#o &+++;:X+++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++*O *+++XO++++++++++++++++++++++++= X++++Xo.+++++++++++++++++++++O *+++++++++++++++++++++++++++++.o @++++:;++++++++++.- $+++++++#o &++% ;++++++X @++++++++++++X &++$ ;+++++++++++X @+++++++; %++% *+++X @+++++++++++++X @+++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++.-%: @++$&+++.X$$X+@&&$X+#;;%@&#+X :+++++%O+++%;$&#+X&&$%%&$%++@; *;#;&$$++X;X+@&&$X%&;+X$@+.&X+# -$%++&@+++@&$;.++X @X$;.+++; %++; X$&%+++= :.;$;.++++++++$ @+#: -%+++X&$;.+++= :++++@&$@* O+++; ;+.;O o;@++#;$;%;;#++= :++;&&$%+++#X$&@+++++++++++++++++++++++",
+"+++++++++++++++++++++++@:+; *++O@++@O-X$ X@O @+; #* &+* &+++++.%++&o=@-O+X* oX:- *++;O =$.& *+.o &+@$ &Oo ;o :+X O++O o*@+++#= =@-*++= -$: ;+++* :+++* o*O -%++: *OOo ;++++++++: o;;O-*@++%Oo;X :.++: =++.$ O;O- &+++* %+%=o O$X+@:o&&: -.++: =++;: -.++X:-X$o@++++++++++++++++++++++",
+"+++++++++++++++++++++++&$++O X#-.+#: X+$ $+* :++* O+@-&+: X++++++++& :+#o #+= -*.* O+++* O+++% ;+X @++X O#*-O& @.-&++%O oX++* O.& -++: o&.o ;++.- $++.- *+# &+@ -@+O X+++++++% O$=-*X++#: $++: ;+@ X++& -%+& @+++- :+++@ X++#- $+. *++@ X+++: *++@o X.- ;++++++++++++++++++++++",
+"+++++++++++++++++++++++OX++X O;*++= -+;-:%+- $+#- &++*X+: @+++++++%o ;%O $++: -#.- &++.- $+++; #+* :+++= @++.=+: $+:%+;++@*o O+X ;+@O&+@ *+X @++@ X++X @+% $+& ;.;o&++=--:.+; ;++; ;+& %+.o $+& -.+#o =++= -+++@ =+++& o#++= o%+% ;++& -.++% ;++O :++=O%++++++++++++++++++++++",
+"++++++++++++++++++++++#-#+++O :&++: :OO&.+@ X+; @+.O.+* %+++++X#; O:*@++% &+; @++X @+++* O+%o =+++: O++++++= :%*+%o.+++%* -+$ #+++++& %+* :+++$ -.++$ :++X X+O O$-O%+++- *++* %++@ O+* :++@ ;+O *++X X++: =+++& ;+++O *+++: O++; %++O *+++; #+#o =+++++++++++++++++++++++++++",
+"++++++++++++++++++++++;O++++X @++o $+++++& o..: o.+;$++; X++++@:.& #+++++& o#+* O#$+= -.=.+- &+* X;@@ X++++++X O%+X X++++X O+* o+++%++O O+.o &@X+O *#&+O =++= :.# &+:o%%%+%%%#++: :+++; *+O *++$ -%# ;@X& %+X X;X+* #++# ;X;+- =++O O.=# ;@X+* O.&% &+++%+++++++++++++++++++++++",
+"+++++++++++++++++++++%OO.++++* :+++O O++;$+= -@** -#@O#+++O :%++X:@+X @+#*%+O O++- =*@+O O$;+# &=: &=+& -.++++++#o =++& :%+++=oX+; @+XO##o &+@ ;O#.o &*@+= $+@o-@+; %+: &*%++++++X *++@- X+& *+#- ;+X XO#@ X%: ;O.%o :+++X ;O.+O O.&o **XX XO#+- ==X.: *+.*;+++++++++++++++++++++++",
+"++++++++++++++++++++X -%+++@ =+++@: :O$.+Xo -X#O oO%++++.&-o::O%+++$ooOO@+#o &++* -;++$ -;+++O -;@o *.+O *++++++++O:#++*;X:O*:OX+++=oo:*#+; %+#- :%++O -X++#O-$:O%++* O++= o;++++++* :--:=X++.=-=:O@++#- :%++$ :@: O#$o :X+%- O#++@: -=& -;+#- :%++= o;++@: ::X++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++@%+++++%%+++++#%++++@%+++++++++#@.++++++#@#++++++++++%#++++%.++++.%.++#%++++++++++%@++*X+++++++#@#++++++#@#+++++++++.@.++++%.+++++%@#+++++++++.@#++++++++++++++++++++++#@.+++++.%.++++#%++.%+++++++++++.%+++++.%#++%.+++.%.++++%#+++++%%.+++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.-o#&&+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++O O&++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn28.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn28.wxd
new file mode 100644
index 0000000000..ed52ac2f7d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn28.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 28 12 1 0 24384000 1270000 0
+ Palatino-Roman
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn28.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn28.xpm
new file mode 100644
index 0000000000..e7ea8f2961
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn28.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn28[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #FBFBFB",
+"X c #5C5C5C",
+"o c #FFFFFF",
+"O c #181818",
+"+ c #070707",
+"@ c #2C2C2C",
+"# c #757575",
+"$ c #F2F2F2",
+"% c #9A9A9A",
+"& c #898989",
+"* c #E4E4E4",
+"= c #444444",
+"- c #AFAFAF",
+"; c #C2C2C2",
+": c #D4D4D4",
+/* pixels */
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo.oooo.oooooooooooo*%;ooooooooooooooooooooooooooooooooooooooooooo.ooo..ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo%@ =XXOX*oooooooo$&+&ooooooooooooooo:@:oooooooooooooooooooooooo*#+OXX@O%ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo% :oo*O=oooooooooo@&oooooooooo:=$oo*=*oooooooooooooooooooooooooo@Xooo# ;oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo- :oooX+oooooooooo@&oooooooooo&+oooooooooooooooooooooooooooooooo@Xooo; %oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo- :ooo==oo.-&;oooo@&ooo:%%*ooo%Oooo$-*oo:-.-%:oooo.;%-$ooooooooo@Xooo%+*ooo*-%;ooo.;:$%-.o*%;ooooo;&-.oo$-**&-$ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo- :oo;+:o:X%#+&ooo@&oo##&@O$o-@+=@:= ;o#O=XX= -oo*=-*&O;oooooooo@Xo.-@-ooo%X:;@X.*X X=#OX%=X+#oo$X&&O=o:= #=#O@.oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo- :&##*oo;:oo#@ooo@&oo%oo$+-oo&Oooo* ;ooXO$oo==oo=#oooXO$ooooooo@X& X.ooo:+$oo* &oo+Xoo% &ooXOoo$-oo- $o* &oo; ;oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo- :oooooooo:%XOooo@&ooo$;&O%oo&Oooo* ;ooX=ooo&Oo$ -ooo; -;####oo@Xo=+:ooo#@oooo=@ooO%oo: ;oo% .ooo*-# :o* ;ooo+%oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo- :oooooo:@&;-Oooo@&oo#=-*@&oo&Oooo* ;ooX=ooo&Oo: -ooo* %%###%oo@Xo$O@$oo=@ooooXOooO%oo* ;oo- .o$XX-* :o* ;ooo+%oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo- :oooooo@#oo-Oooo@&o-+$oo@&oo&Oooo* ;ooX=ooo&Oo$ &ooo* :ooooooo@Xoo; Xoo#+.oooX=ooO%oo* ;oo- .o#=oo$ :o* ;ooo+%oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo% ;ooooooOXo*=+ooo@#o&+*o%+&oo%+$.o* ;ooX=ooo&Ooo=@.oo%=oooooooo@=ooo& &o; %oo.O;oo+%oo: ;oo- .oX@..# :o* ;ooo+%oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo%@ =%ooooo# @&% &$#+@%*OOX:O=;o:+O#:X =;%OO&.o&+#$*@=-%#$oooooo:#++#*o.=+#o&+&;#-o*# @-:X =;o- #:-+OX; X;X =;oo+=-ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo..o..oooooo**o...o....o.:.o...oo$*o..o......oo...oo.:;*oooooooo......oo...oo$;:.oo.......o..o....o$*oo....o..oo...ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn29.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn29.wxd
new file mode 100644
index 0000000000..8f4d7efd69
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn29.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 29 12 1 0 24384000 1270000 0
+ Palatino-Italic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn29.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn29.xpm
new file mode 100644
index 0000000000..58a14b5caf
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn29.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn29[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #B5B5B5",
+". c #6E6E6E",
+"X c #FDFDFD",
+"o c #161616",
+"O c #A5A5A5",
+"+ c #050505",
+"@ c #FFFFFF",
+"# c #F0F0F0",
+"$ c #2E2E2E",
+"% c #898989",
+"& c #E3E3E3",
+"* c #454545",
+"= c #D4D4D4",
+"- c #F8F8F8",
+"; c #585858",
+": c #C4C4C4",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XX@@XX@@@@@@@@@@X&O @@@@@@@@@@@@@@@=#@@@@@@@@@@@@@@@@@@@@@@XX@XX@@@@@@@@@@@@@& O@@@=#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:.+*.*oO@@@@@@@@&O+ @@@@@@@@@@&@@@XoO@@@@@@@@@@@@@@@@@@@@@@=.+* @@&-@@@@@@@@XOo.@@XoO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:+#@@.+#@@@@@@@@&+#@@@@@@@@@%$@@@@:-@@@@@@@@@@@@@@@@@@@@@@@&+=@@:+#@@@@@@@@@@$ @@@:-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Oo@@@:+=@@@@@@@@ $@@@@@@@@@@*.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +-@@%$@@@@@@@@@@#+&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.*@@@ +-@@:..%@@%;@@@#%;%:@@$ @@@ %@@#.X@=.:@@@ ..&@@@@@@@@%$@@@..@@@@:..%@@:o@@@ %@@@&%. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*.@@@*.@@.O=;;@@*%@@=;= +=&.+*;#%$;@ .+XO.+O@X.:X;*@@@@@@@@.;@X%o$*#@.O=;;@@%;@#%$;@@O%=O.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@oOO:;;-@ ;@@*%@@o:@@*&@=o@@=o@@X@*O@XO* =X+=@%.@@ +X@@@@@@@*%@@@o=@@ ;@@*%@@;%@X@*O@&*@@- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-+:=O=@@@; @#o=@#+-@=$@@%;@@O*@@@Xo&@@.*:@=o@@o @@:o@O%%%:@@oO@@&+X@@; @#o=@@$ @@Xo&@;%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:+#@@@@@#o-@%oX@ $@@%%@#o%@@..@@@:$@@@$*@@%;@&+=@@O*@O%%%=@&+=@@ $@@#o-@%oX@-+#@@:$@@$:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Oo@@@@@@:$@=.;@@%.@@*OXO$=@@*O@@@%.@@-+:@@;%@:+-@@;O@@@@@@@:+-@@%;@@:$@=.;@@:$@@@%.@-+=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.*@@@@@@O$::.% @*% XoOO&+==@o O#@*% X:+-@@o &+:@&*@@@@@@@@%$@@@;% =O$::.% @%;:&@*% -+O@#%-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-%o$%&@@@@ +O@**&@o*&@$*&=oO@#+;#@@o*&@%*@@-+;#@;$%%#@@@@@@@Ooo%#@$$=@ +O@**&@;$:@@o*&@.o;.&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@X-XX-X@@@@@#@@-@@@#@@@#@@X-@@@#@@@@#@@@#X@@@#@@@@&-@@@@@@@@@-XX-X@#@@@@#@@-@@@-X@@@#@@@@&#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn30.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn30.wxd
new file mode 100644
index 0000000000..bebc1e2502
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn30.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 30 12 1 0 24384000 1270000 0
+ Palatino-Bold
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn30.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn30.xpm
new file mode 100644
index 0000000000..462527a2db
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn30.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn30[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #7D7D7D",
+"X c #383838",
+"o c #C7C7C7",
+"O c #151515",
+"+ c #272727",
+"@ c #FDFDFD",
+"# c #050505",
+"$ c #FFFFFF",
+"% c #DDDDDD",
+"& c #F0F0F0",
+"* c #979797",
+"= c #505050",
+"- c #676767",
+"; c #B1B1B1",
+": c #F9F9F9",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&;:$$$$$$$$$$$$$$$$%:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$:o%$$$$$$$:o%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*XXXX+X=o$$$$$$$$&= &$$$$$$$$$$$@@$$o +$$$$$$$$$$$$$$$$$$$$$$$$$&=XXXX+X.@$$$$$$$$$$-# ;$$$$$$-# ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$; #@&= O:$$$$$$$$$O &$$$$$$$$$$*+o$$%OX$$$$$$$$$$$$$$$$$$$$$$$$$$$+ .$o# *$$$$$$$$$$$= ;$$$$$$$- ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$; #$$% %$$$$$$$$$+ &$$$$$$$$$$+ %$$$:@$$$$$$$$$$$$$$$$$$$$$$$$$$$X .$$X -$$$$$$$$$$$- ;$$$$$$$- ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o #$$% #:$@;.*:$$$+ &$$$o**%$$$+ &$$$%;$$@o*$o*o$$$$@;**%$$$$$$$$$X .$:O#o$$$&;.;&$$$- ;$$$$%*;= ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o #$$. .$&XXO X@$$+ &$$-++ O%$*# +X%X +$&X #-O ;$$%+X;=#.$$$$$$$$X =*X=o$$$;O=;+O;$$- ;$$$.+-X ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o #;XX*$$&*$% %$$+ &$$*$@+ *$%O %&$% +$$: o$. =$$= o$:##%$$$$$$$X =.XO=%$:O#:$o +@$- ;$$. o$@= ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o #$$$$$$$$:oO o$$+ &$$$@%= *$$+ &$$& +$$$##$$o X$@# &$$X *;+++X@$X .$$X =$o +$$@ %$- ;$$O#$$$- ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o #$$$$$$%=O.+ %$$+ &$:.O-= *$$+ &$$& +$$$##$$o X$& &$$= *.OOO-$$X .$$* O$; +$$$O o$- ;$: #@$$- ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$; #$$$$$$= o$X %$$+ &$* .$. *$$+ &$$& +$$$##$$o X$$# %$$X ;$$$$$$$X .$$. X$o O$$& :$- ;$$O o$$= ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$; :$$$$$+ *;O o$$O %$- -oX .$$+ ;%$& O$$@ #$$o X$$- .$:#+:$$$$$$$X .$%O#;$:+ o$o -$$- ;$$= +;.O *$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*+ X;$$$$. .X X&-# =%;# =- +o$. .%= #-&= -&o #.$&=#-XX%$$$$$$$;# O+O=o$$$o+O-+=&$*O Xo$%X .= Xo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$::@@::$$$$$o%$:@:@:@@:@$%o@:@@@$$o%$@:@@:@:@@:@@:@:$$$%o%$$$$$$$$$::@::$$$$$$$@%o&$$$:@@::$$@%%$:@:@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.aux b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.aux
new file mode 100644
index 0000000000..f23e54680b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.aux
@@ -0,0 +1 @@
+\relax
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.wxd
new file mode 100644
index 0000000000..bc2ef85f39
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 31 12 1 0 24384000 1270000 0
+ Palatino-BoldItalic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.xpm
new file mode 100644
index 0000000000..56f2d18209
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn31.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn31[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #5A5A5A",
+"X c #FCFCFC",
+"o c #FFFFFF",
+"O c #060606",
+"+ c #717171",
+"@ c #181818",
+"# c #878787",
+"$ c #2E2E2E",
+"% c #F4F4F4",
+"& c #9C9C9C",
+"* c #444444",
+"= c #E6E6E6",
+"- c #B1B1B1",
+"; c #C3C3C3",
+": c #D5D5D5",
+/* pixels */
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo=-;oooooooooooooooooooXoooooooooooooooooooooooooooooooooooooooooooooo=-;oooooo=-&oooooooooooooooooooooooX;#XoooXooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo:+$$*.$*&ooooooooooo&@ -ooooooooooooo%oooo*$ooooooooooooooooooooooooo-.$$.$$+=ooooooooooo&@ -ooooo-$ +o&*$$.:ooo%ooooooooooo=. $ooo#O=oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo$ ;o%$ &ooooooooooo. =ooooooooooo;*.oooo*.oooooooooooooooooooooooooo; $oX# *oooooooooooo. =oooooo& &oo- $ooo=*$oooooooooooo: +ooo+$%oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooXO =oo# .ooooooooooo@@oooooooooooo# &oooooooooooooooooooooooooooooooo& .oo= Ooooooooooooo@@ooooooo# :oo# .ooo; .oooooooooooo& &oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo: @ooo# +ooo%-&:;oo= .oooo%-&:;oo=* -;%o%&%oo=-oo%&XoooX-&-oooooooooo+ #oo- .oooo%-&:ooo= .ooooX-&*OXoo. #oo%# +;=ooo:&;;=oo+ :ooX-:oooo=&-=ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo- *ooo$O;oo=.#* +oo- #ooo=.#* +o;.O@..=-@ :o&O$o&O :oo;$&+ +ooooooooo* -%-$+%ooo#*-* -oo- #ooo;*&#O*ooo$ -o=+$ ..;oo#+#@O%oo$@oo:$ &ooX#*.O+ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo+ +;;.O&oo:@;o# ;oo+ ;oo:@;o# ;oo% .oo;&@OX;-O+&-$OXo;O&oo@@ooooooooo@ .*@.;ooo# =o: .oo+ ;oo:O-o= +oooO =ooo$@oooo+*oXO*oo% *o=#. ;oo.$Xo--ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo. &;#&=ooo.$oo* %oo*OXoo.$oo* %oo; &ooo% *oo= +-XO*oo*@Xoo@@o%**.*#o% Ooo%$ ;o%O*oo: .oo*OXoo.OXo& -oo= @oooXO.ooo: &o; +oo; #ooo$@Xo; #oo%Xooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo@ :oooooo=O.o;@$ooXO*oo=O.o;@$ooo# ;ooo- &oo- .o: #oXO*ooX $o;$*$$&o; $ooo+ +o; #oo; +oXO*oo%O*o%* :oo- *ooo; #ooo+ :o. -oo# ;oo% .oo+ ;ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo% %oooooo- &%&$.oo: +oo- &%&$.ooo. Xooo+ :oo+ :o& :o: .oo- #oooooooo& .ooo. &o& &oo+ :o: +oo: +o#+@ooo# +ooo& ;ooo$@o-# =oo. %oo- &oo. =ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo; $ooooooo# &#= +#o- +#X# &#= +#oo@@:+%o*O;-o$@oo. ;;: *oo*$%oooooooo+ #oo:O$Xo& #o%@+oo- +#X- +&;$$-:o* &ooo. ;#;oO$--+O-;o$O;-o+ &#o. -o=+%ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo&$ O+:ooooo& $=; $:o& *=o& $=; $:oo@ .%oo@O&X= .oo$O#Xo. ..+%oooooooo#@ $**$+%oo%@@+*&ooo& *=o; @;o@$;=+O $#oo. *:oo@O&o*O#oo@@&oo. +%o-O $+%oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo%XoX%XoooooX:XoX:ooo%=oooX:XoX:oooo==oooo:%oo%=ooo:%oooo::Xoooooooooo%XoX%Xoooooo%;:ooooo%=oooo:%oo=ooX%XoX%oo%:oooo==oo=%ooo:Xooo==oooo=;Xoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn32.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn32.wxd
new file mode 100644
index 0000000000..9f471e596d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn32.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 32 12 1 0 24384000 1270000 0
+ Symbol
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn32.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn32.xpm
new file mode 100644
index 0000000000..eeafae55bc
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn32.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn32[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #FBFBFB",
+"X c #020202",
+"o c #929292",
+"O c #B6B6B6",
+"+ c #DBDBDB",
+"@ c #FFFFFF",
+"# c #5F5F5F",
+"$ c #CACACA",
+"% c #A7A7A7",
+"& c #515151",
+"* c #757575",
+"= c #1C1C1C",
+"- c #F3F3F3",
+"; c #414141",
+": c #E7E7E7",
+/* pixels */
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-*##O@@@@@@@@@@@@O;%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O;&###&;+@@@@@@@@@@@@@@@@@@@@@@;o@+X%@@@@@@@@@@@;#=-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.==:@@-#O@@@@@@@@@@@@@@@@@@@@@+ -@@&;@@@@@@@@@@-%@oo@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O #@@@+O@:.@@@@@@@:.@@@@@@@@@$ .@@;#@@@@@:.@@@@@@:&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# O@@@@+&=+@%&@@&=O;#@@+XO@@$ .O%;:@@@%#*=*.@@@@+=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:X=.@@@@:X*@%&@O o@;#@@+ O@@$ .*#&:@@%;@@+X*@@@@# +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o=-@@@@@=;@%&@o O@;#@@+ O@@$ .@@#=-@=o@@@#X.@@:X=%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#$@@@@@@==@%&@* $@;#@@: O@@$ .@@$ o: o@@@o +@@*X$*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%*@@@@@@@&X.%&@# :@;#@@: O@@$ .@@.X&+ *@@@% :@-X*@;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+&.@@@@$$@o $%&@=;@@;&@@: O@@$ .@@. *@X&@@@o=@@oX:@&:@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.;o%%%%*=.@-=*%&+XO@@;X:-# o$:$ O@@% O@*X+@@;%@.=#@@*&%*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* &@@@:#;=;O@@@;=X=+;X*@$ #;&Xo@@.*=o#o@@%X+@@+=X$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%&@@@@@=-+@@.+.@$ .-+.@@@@@.+.@@@@@@@@@-:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%&@@@@- $@@@@@@@O .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%&@@@@+ O@@@@@@@o=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+%@@@@@%.@@@@@@@Oo@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn33.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn33.wxd
new file mode 100644
index 0000000000..8028f5cb63
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn33.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 33 12 1 0 24384000 1270000 0
+ ZapfChancery-MediumItalic
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn33.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn33.xpm
new file mode 100644
index 0000000000..6c4bf7b382
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn33.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn33[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #FAFAFA",
+". c #494949",
+"X c #DBDBDB",
+"o c #FFFFFF",
+"O c #606060",
+"+ c #070707",
+"@ c #191919",
+"# c #BABABA",
+"$ c #CCCCCC",
+"% c #A9A9A9",
+"& c #F1F1F1",
+"* c #989898",
+"= c #757575",
+"- c #888888",
+"; c #303030",
+": c #E7E7E7",
+/* pixels */
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo#.-ooooooooo&=Ooooooooooooooooooooooooooooooooooooooooooooooooooooooo#=:oooooooooo*Ooooooooooooooooooooooooooooooooooooooooo:O-ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo$X ooX:ooooooooooooooooo-$ ooo$*$ooX=X:oooooooooooooooooooooooooooooooooooooooooooo:###oooooO*$ooooooooo OX&$*ooooooooooooooooooo XXX:oooooooooooooXO& %#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo%++++@Oooooooooooooooooo#;ooooX=*-+%o@$ooooooooooooooooooooooooooooooooooooooooooooo*@;+.oooo-@ooooooooooo=-oo-=ooooooooooooooooooo:-+*:ooooooooooooo.%oo.%ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooO:&X$-oooooooooooooooooo.-ooo#-ooo.#$@ooooooooooooooooooooooooooooooooooooooooooooo#%oo;;ooo$@Oooooooooooo@$oo ooooooooooooooooooooo*@ooo:. oooooooo&+&oo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo$#oo:= ooooX--%ooX$o##oo&+Xoo#Ooooo o=Oo&%ooo&*=* o:#o:%ooo&*Xooo#*oo:#X-oX$oo%ooooo;&oXO@oo&=@%ooo$-&ooo#=+ oo%oo %oo$:oo$Xo$$oX#oooOOooo*.oooo#--$o%;oo&#oooX*&oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo:= oooo**#;-:=+-O.@&*O+-# @Xoooooo.**;.oo#=$O.&-@*-;Ooo#=O=o&=#+X-+;.O-+#o*.ooooo+%o-%+ o=$+&oo*#@%o&=#..o$.;o%;OoX@ :=+#=+%-+%ooo@*oo%..*: =%#+$o==o%;=oo**;%oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo:= oo &$.oo@#&:+-o#; &=O&o-Ooooooo +OX=-o ;&oO- o@OXO*o:; & o=*#O o@#o&&+&o.-ooooo=Xo. +X#%*;oo#O:;&oO%oO=o:-Oo&O*o*Oo&X+-X+*&+:ooX+Xo :@#&o*-oX+ o;%o:.%o#.o:ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo:= ooo.*O*oX+ o#@oo-Ooo;%oo;-oooooo$@oo;$o*Ooo@#oX@oo@Xo*.ooo @*- o:+ oo#;oo@# .;$ooo&Oo@%=oO=oo.-=:o:;oo@#oo.%oo@XoO*oo*.o%.o$@ooo*@ooo&+ oo@Xo*;o&+:oo@:o.*ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooX= oooo=*@$o*;oo-Ooo.$o +:oo+#oooooo-Oo + oO-oX+&o*Oo:@oo.-oooX@#oo %.ooo-Oo$+ &$$oooo%%o;@:o@%oo@*oo %.o:+&oo@Xo:@oo@$ooO*oO-o*OoooOOooo#;oo:+ooO=o#;ooX@oo+$ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooX.%$X:&XO&+#=;.-X.*o#=oo#;oo&+#oooooo.*o$@%%;-*.@*#O*o#;%%;-o$*%@ *XO-ooo.=*..ooooo &X= o.-o$+Xo&+Xo%#==#.@$*X+$*#;$O+#*o@Xo;#oOO*:o@*ooo-.#-#@$=+==-.#%*.#%+$o%#oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo:;;@++++@X +.X.O&o++.-ooo=-ooo@Oooo$*o;:o%;$o.@#=.Xo;Xo*;XoO+O%o:+;O&o;$ooo;.X=-ooooo-@O&oo% o*+.* ;@OXo-;#*;$o%@- *@*#@%oX;o:@ o.=&X=+=Xoo-+*o#+O&@- =@#o=;%o@@O$ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo& ooo :Xooo&oo&oo$+: oooo;Xooo%+;==$oo oo&ooo& o&ooo oo&oooo:oooo&&ooo oooo&oo;$oooooooooooooo&Xooo :ooo o& oo &oo& o oo oo ooo ooooooooo &ooo:oo&oo&&oo&ooo &ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo*.oooooXOooooo Xoooooooooooooooooooooooooooooooooooooooooooo&@ ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooO-ooo:X=:ooooooooooooooooooooooooooooooooooooooooooooooooX&&=$oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo%;O%o:;.&oooooooooooooooooooooooooooooooooooooooooooooooo:@@.$ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn34.wxd b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn34.wxd
new file mode 100644
index 0000000000..4b6db5a0a8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn34.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 48768000 0 4064000
+0 2 6
+11 -1 255 255 255 255 255 255 0 0 4 1
+ 254000 48514000 254000 3810000 0
+2 0 0 0 0
+ 34 12 1 0 24384000 1270000 0
+ ZapfDingbats
+
diff --git a/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn34.xpm b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn34.xpm
new file mode 100644
index 0000000000..80d943dbd4
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/font-names/wxd-fn34.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_fn34[] = {
+/* width height ncolors chars_per_pixel */
+"288 24 16 1",
+/* colors */
+" c #000000",
+". c #7E7E7E",
+"X c #FCFCFC",
+"o c #C9C9C9",
+"O c #FFFFFF",
+"+ c #868686",
+"@ c #0A0A0A",
+"# c #646464",
+"$ c #F3F3F3",
+"% c #9B9B9B",
+"& c #787878",
+"* c #E3E3E3",
+"= c #434343",
+"- c #AFAFAF",
+"; c #232323",
+": c #8E8E8E",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOOOOOOOX*OOOOOOOOXXXXXXXXXOOOOOOOOOOOOOOOOO**OOOOOOOOOO**OOOOOXXXXXXXXXXXOOOOOO$$OOOOOOOOOOXo$OOOOOOOOOO$*OOOOOOXXXXXXXXXXXXXOOOOOOO$OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO*-o-ooOOOOOOX$&+:OXOOOOo $OOO*X:*OOOOOOOO+ &OOOOOOOOo @*OOOO@ $O*OOO==OOOoOOOOo=@. ;-OOOOOOXo++-XOOOO# ;XOOOOOO&-OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO%X#o-&$-XOOO::=.@.:+oOO%& $O$*:==;$*OOOOOO@ $OOOOOXO- oOXOO@ $O&:OO==OO.+OOO%; ;X; @%OOO$.:#==#:+*OO*@ -OOOOOOo ;XOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-+:-%.%:OOO*:@.#@:==%OO#*******o $**=O#@o-#oOOOOO; @XOOOO=@oO.%O-@#O@ $OO+%O##O%:OOOo@$%=:=%$;-OO%+;&==.;.%OOO+ =OOOOOOO= +OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX#--.#=.%o#*O$.=@=;=@::OO&OOOOOOO* $*& *X:O#=%XO-&oo@ -o&%O$ #O-oO= @O@ $OOO%-%%-%OOOO= %.$O$.% ;OO-:;;;;=;%-OOOX; *OOOOOO- @*OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX-&=@@=&-XO*#&.=+o=&&+:O&OOOOOOO* $%;=+*%-#;;$% %+&-@ :O%#%&:%#%#-O@ $*oo$oooo$*o*X@;=$OOO$=; $-&&+;--;+&+-OOO- &OOOOOOX; #OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo&&&= =&&&-%+ ;OO%@ @.O&OOOOOOO* $$OOO&;*OO$O# =; =OOOO*;;$OOOO@ $# @-;;-@ #*&X%OOOOO%O+o.# =OO# #.OOOO= ;$OOOOOO+ oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX-&=;@=&%$O*#..=+o=.&+&O&OOOOOOO* $+;#+o:%.=;$- %:#-@ :O:=+.%-&+=%O@ $*oo$oooo$o-*X@;=$OOO$=; $-.&+;-o;+&+%OOOO* %OOOOOO*@ ;XOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX#o-+##+:o#*O$.=@#;=@:+OO&OOOOOOO* $$# *O%O#;-OO-&oo@ %*+-O$ #O-oO= @O@ $OOO%%%%-%OOOO= %.$O$.% ;OO-%;=;;=;%-OOOOOO& =OOOOOOO# %OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO%:+-%&-+OOO*: .#@:==:OO&OOOOOOO* $oo;O.;*-#-XOOOO; @$OOOO#;oX#:O-;.O@ $OO%:O##O%+OOOo@$%=%=%$;-OO%:@.==.;.%OOOOOO$; oOOOOOOo @$OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO-X#o-&$-XOOO::=.@.:+oOO&OOOOOOO*#-XO$o%==;$oOOOOOO@ $OOOOOOO- oOOOO@ $O:&OO==OO:&OOO%; ;X; @%OOO$.:#==#:.*OOOOOOO% #OOOOOOX; &OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO*oo-ooOOOOOOX*.:%OXOOO=&&&&&&&#:OOOOO*$.oOOOOOOOO% &OOOOOOOOo@@$OOOO@ $OoOOO==OOO*OOOOo= & ;-OOOOOOX-:+-XOOOOOOOOOO=*OOOOOO% oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX*OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO**OOOOOOOOOO$$OOOOOOOOOOOOOOOOOOOOOO$$OOOOOOOOOOXo$OOOOOOOOOO$$OOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/GNUmakefile b/support/dktools/gui-img/wxdkdraw/styles/GNUmakefile
new file mode 100644
index 0000000000..fb0b1fa1eb
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/GNUmakefile
@@ -0,0 +1,10 @@
+
+IMAGES := $(patsubst %.wxd,%.xpm,$(wildcard *.wxd))
+
+RESOLUTION=64
+
+images: $(IMAGES)
+
+%.xpm: %.wxd
+ gxhconvert -o=xpm -r=$(RESOLUTION) -a $<
+
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as00.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as00.wxd
new file mode 100644
index 0000000000..dda7911171
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as00.wxd
@@ -0,0 +1,6 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 7620000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as00.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as00.xpm
new file mode 100644
index 0000000000..9b6ff94188
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as00.xpm
@@ -0,0 +1,42 @@
+/* XPM */
+static const char *xpm_wxd_as00[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 3 1",
+/* colors */
+" c #000000",
+". c #666666",
+"X c None",
+/* pixels */
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XX............................XX",
+"X X",
+"X X",
+"XX............................XX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as01.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as01.wxd
new file mode 100644
index 0000000000..4feb41911b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as01.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 7620000 4064000
+3 3 0 0 0 0 8 0 4 1 1 8 0 8 4 0 8 4
+ 1524000 6096000
+ 7620000 4064000
+ 1524000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as01.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as01.xpm
new file mode 100644
index 0000000000..41161edbfe
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as01.xpm
@@ -0,0 +1,49 @@
+/* XPM */
+static const char *xpm_wxd_as01[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 10 1",
+/* colors */
+" c #000000",
+". c #252525",
+"X c #7F7F7F",
+"o c #6E6E6E",
+"O c #282828",
+"+ c #171717",
+"@ c #424242",
+"# c #666666",
+"$ c #7C7C7C",
+"% c None",
+/* pixels */
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%X%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%% .$%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%% .$%%%%%%%%%%%%%%%%%%%",
+"%%%%%%. .$%%%%%%%%%%%%%%%%",
+"%%%%%%%%XO .o%%%%%%%%%%%%%",
+"%%%%%%%%%%%XO .o%%%%%%%%%%",
+"%%%%%%%%%%%%%%XO .o%%%%%%%",
+"%%%%%%%%%%%%%%%%%XO .o%%%%",
+"%%#################@O+ +@%",
+"% @",
+"% @",
+"%%#################@O+ +@%",
+"%%%%%%%%%%%%%%%%%XO .o%%%%",
+"%%%%%%%%%%%%%%XO .o%%%%%%%",
+"%%%%%%%%%%%XO .o%%%%%%%%%%",
+"%%%%%%%%XO .o%%%%%%%%%%%%%",
+"%%%%%%. .$%%%%%%%%%%%%%%%%",
+"%%%%% .$%%%%%%%%%%%%%%%%%%%",
+"%%%%% .$%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%X%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as02.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as02.wxd
new file mode 100644
index 0000000000..8f3ac20246
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as02.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 3 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 1524000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as02.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as02.xpm
new file mode 100644
index 0000000000..c758c44ef6
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as02.xpm
@@ -0,0 +1,52 @@
+/* XPM */
+static const char *xpm_wxd_as02[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 13 1",
+/* colors */
+" c #000000",
+". c #484848",
+"X c #252525",
+"o c #7F7F7F",
+"O c #6E6E6E",
+"+ c #282828",
+"@ c #FFFFFF",
+"# c #CFCFCF",
+"$ c #666666",
+"% c #202020",
+"& c #7A7A7A",
+"* c #D4D4D4",
+"= c None",
+/* pixels */
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"======o=========================",
+"===== X&======================",
+"====$ %O===================",
+"====$ X&================",
+"====$ .&X X&=============",
+"====$ $@@*o+ %O==========",
+"====$ $@@@@@*o+ %O=======",
+"====$ $@@@@@@@@*o+ %O====",
+"==$$+ $@@@@@@@@@@@#&X X==",
+"= $@@@@@@@@@@@@@@#&X =",
+"= $@@@@@@@@@@@@@@#&X =",
+"==$$+ $@@@@@@@@@@@#&X X==",
+"====$ $@@@@@@@@*o+ %O====",
+"====$ $@@@@@*o+ %O=======",
+"====$ $@@*o+ %O==========",
+"====$ .&X X&=============",
+"====$ X&================",
+"====$ %O===================",
+"===== X&======================",
+"======o=========================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as03.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as03.wxd
new file mode 100644
index 0000000000..3183f5357b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as03.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 3 1 0 0 0 0 0 0 8 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 1524000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as03.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as03.xpm
new file mode 100644
index 0000000000..126f768719
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as03.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_as03[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 9 1",
+/* colors */
+" c #000000",
+". c #7E7E7E",
+"X c #252525",
+"o c #6E6E6E",
+"O c #292929",
+"+ c #666666",
+"@ c #202020",
+"# c #7A7A7A",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$.$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$ X#$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$+ @o$$$$$$$$$$$$$$$$$$$",
+"$$$$+ X#$$$$$$$$$$$$$$$$",
+"$$$$+ X#$$$$$$$$$$$$$",
+"$$$$+ @o$$$$$$$$$$",
+"$$$$+ @o$$$$$$$",
+"$$$$+ @o$$$$",
+"$$++O X$$",
+"$ $",
+"$ $",
+"$$++O X$$",
+"$$$$+ @o$$$$",
+"$$$$+ @o$$$$$$$",
+"$$$$+ @o$$$$$$$$$$",
+"$$$$+ X#$$$$$$$$$$$$$",
+"$$$$+ X#$$$$$$$$$$$$$$$$",
+"$$$$+ @o$$$$$$$$$$$$$$$$$$$",
+"$$$$$ X#$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$.$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as04.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as04.wxd
new file mode 100644
index 0000000000..4f3f28bded
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as04.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 3 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 1524000 6096000
+6 3 2 0 0 0 0 0 0 0 0 4 1 8 1
+ 1524000 4064000
+ 7620000 4064000
+ 1524000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as04.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as04.xpm
new file mode 100644
index 0000000000..220b163974
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as04.xpm
@@ -0,0 +1,51 @@
+/* XPM */
+static const char *xpm_wxd_as04[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 12 1",
+/* colors */
+" c #000000",
+". c #484848",
+"X c #7E7E7E",
+"o c #252525",
+"O c #6E6E6E",
+"+ c #282828",
+"@ c #FFFFFF",
+"# c #CFCFCF",
+"$ c #666666",
+"% c #202020",
+"& c #7A7A7A",
+"* c None",
+/* pixels */
+"********************************",
+"********************************",
+"********************************",
+"********************************",
+"********************************",
+"********************************",
+"******X*************************",
+"***** o&**********************",
+"****$ %O*******************",
+"****$ o&****************",
+"****$ o&*************",
+"****$ %O**********",
+"****$ %O*******",
+"****$ %O****",
+"**$$+ o**",
+"* *",
+"* $@@@@@@@@@@@@@@#&o *",
+"**$$+ $@@@@@@@@@@@#&o o**",
+"****$ $@@@@@@@@#X+ %O****",
+"****$ $@@@@@#X+ %O*******",
+"****$ $@@#X+ %O**********",
+"****$ .&o o&*************",
+"****$ o&****************",
+"****$ %O*******************",
+"***** o&**********************",
+"******X*************************",
+"********************************",
+"********************************",
+"********************************",
+"********************************",
+"********************************",
+"********************************"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as05.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as05.wxd
new file mode 100644
index 0000000000..b5781f058d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as05.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 3 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 1524000 6096000
+6 3 2 0 0 0 0 0 0 0 0 4 1 8 1
+ 1524000 4318000
+ 7620000 4318000
+ 1524000 2286000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as05.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as05.xpm
new file mode 100644
index 0000000000..3d7c5877ef
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as05.xpm
@@ -0,0 +1,52 @@
+/* XPM */
+static const char *xpm_wxd_as05[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 13 1",
+/* colors */
+" c #000000",
+". c #484848",
+"X c #252525",
+"o c #6E6E6E",
+"O c #282828",
+"+ c #828282",
+"@ c #FFFFFF",
+"# c #060606",
+"$ c #CFCFCF",
+"% c #666666",
+"& c #202020",
+"* c #7C7C7C",
+"= c None",
+/* pixels */
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"======*=========================",
+"===== X*======================",
+"====% &o===================",
+"====% X*================",
+"====% .*X X*=============",
+"====% %@@$+O &o==========",
+"====% %@@@@@$+O &o=======",
+"====% %@@@@@@@@$+O &o====",
+"==%%O %@@@@@@@@@@@$*X X==",
+"= =",
+"= # =",
+"==%%O # X==",
+"====% # &o====",
+"====% # &o=======",
+"====% # &o==========",
+"====% # X*=============",
+"====% X*================",
+"====% &o===================",
+"===== X*======================",
+"======*=========================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as06.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as06.wxd
new file mode 100644
index 0000000000..0ba34fd779
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as06.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 2540000 4064000
+6 4 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 1524000 6096000
+ 3048000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as06.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as06.xpm
new file mode 100644
index 0000000000..954e0ed837
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as06.xpm
@@ -0,0 +1,54 @@
+/* XPM */
+static const char *xpm_wxd_as06[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 15 1",
+/* colors */
+" c #000000",
+". c #121212",
+"X c #252525",
+"o c #4A4A4A",
+"O c #6E6E6E",
+"+ c #939393",
+"@ c #828282",
+"# c #292929",
+"$ c #FFFFFF",
+"% c #CFCFCF",
+"& c #F4F4F4",
+"* c #666666",
+"= c #D2D2D2",
+"- c #7A7A7A",
+"; c None",
+/* pixels */
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;@;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;; X-;;;;;;;;;;;;;;;;;;;;;;",
+";;;;; X-;;;;;;;;;;;;;;;;;;;",
+";;;;;# X-;;;;;;;;;;;;;;;;",
+";;;;;;. XO;;;;;;;;;;;;;",
+";;;;;;; #-X X-;;;;;;;;;;",
+";;;;;;;* +$=@# XO;;;;;;;",
+";;;;;;;;# %$$$=@# XO;;;;",
+";;******o #&$$$$$%-X X;;",
+"; @$$$$$$$$%-X ;",
+"; @$$$$$$$$%-X ;",
+";;******o #&$$$$$%-X X;;",
+";;;;;;;;# %$$$=@# XO;;;;",
+";;;;;;;* +$=@# XO;;;;;;;",
+";;;;;;; #-X X-;;;;;;;;;;",
+";;;;;;. XO;;;;;;;;;;;;;",
+";;;;;# X-;;;;;;;;;;;;;;;;",
+";;;;; X-;;;;;;;;;;;;;;;;;;;",
+";;;;; X-;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;@;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as07.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as07.wxd
new file mode 100644
index 0000000000..2da1bc4053
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as07.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 2540000 4064000
+6 4 1 0 0 0 0 0 0 8 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 1524000 6096000
+ 3048000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as07.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as07.xpm
new file mode 100644
index 0000000000..c1cb54bc2b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as07.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_as07[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 8 1",
+/* colors */
+" c #000000",
+". c #121212",
+"X c #252525",
+"o c #6E6E6E",
+"O c #818181",
+"+ c #666666",
+"@ c #7A7A7A",
+"# c None",
+/* pixels */
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"######O#########################",
+"##### X@######################",
+"##### X@###################",
+"#####X X@################",
+"######. Xo#############",
+"####### X@##########",
+"#######+ Xo#######",
+"########X Xo####",
+"##+++++++ X##",
+"# #",
+"# #",
+"##+++++++ X##",
+"########X Xo####",
+"#######+ Xo#######",
+"####### X@##########",
+"######. Xo#############",
+"#####X X@################",
+"##### X@###################",
+"##### X@######################",
+"######O#########################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as08.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as08.wxd
new file mode 100644
index 0000000000..8419538716
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as08.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 2540000 4064000
+6 4 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 1524000 6096000
+ 3048000 4064000
+6 3 2 0 0 0 0 0 0 0 0 4 1 8 1
+ 1524000 6096000
+ 7620000 4064000
+ 2794000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as08.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as08.xpm
new file mode 100644
index 0000000000..232d84905b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as08.xpm
@@ -0,0 +1,53 @@
+/* XPM */
+static const char *xpm_wxd_as08[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 14 1",
+/* colors */
+" c #000000",
+". c #121212",
+"X c #5A5A5A",
+"o c #252525",
+"O c #6E6E6E",
+"+ c #939393",
+"@ c #828282",
+"# c #FFFFFF",
+"$ c #2E2E2E",
+"% c #CFCFCF",
+"& c #666666",
+"* c #7A7A7A",
+"= c #F8F8F8",
+"- c None",
+/* pixels */
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"------@-------------------------",
+"----- o*----------------------",
+"----- o*-------------------",
+"-----$ o*----------------",
+"------. oO-------------",
+"------- o*----------",
+"-------X oO-------",
+"--------$ oO----",
+"--&&&&&&X o--",
+"- -",
+"- @########%*o -",
+"--&&&&&&X $=#####%*o o--",
+"--------$ %###%@o oO----",
+"-------X +#%@o oO-------",
+"------- $*o o*----------",
+"------. oO-------------",
+"-----$ o*----------------",
+"----- o*-------------------",
+"----- o*----------------------",
+"------@-------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as09.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as09.wxd
new file mode 100644
index 0000000000..e022c9efa8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as09.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 2540000 4064000
+6 4 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 1524000 6096000
+ 3048000 4064000
+6 3 2 0 0 0 0 0 0 0 0 4 1 8 1
+ 1524000 2032000
+ 7620000 4064000
+ 2794000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as09.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as09.xpm
new file mode 100644
index 0000000000..1a6140de26
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as09.xpm
@@ -0,0 +1,53 @@
+/* XPM */
+static const char *xpm_wxd_as09[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 14 1",
+/* colors */
+" c #000000",
+". c #121212",
+"X c #5A5A5A",
+"o c #252525",
+"O c #6E6E6E",
+"+ c #939393",
+"@ c #828282",
+"# c #FFFFFF",
+"$ c #2E2E2E",
+"% c #CFCFCF",
+"& c #666666",
+"* c #7A7A7A",
+"= c #F8F8F8",
+"- c None",
+/* pixels */
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"------@-------------------------",
+"----- o*----------------------",
+"----- o*-------------------",
+"-----$ o*----------------",
+"------. oO-------------",
+"------- $*o o*----------",
+"-------X +#%@o oO-------",
+"--------$ %###%@o oO----",
+"--&&&&&&X $=#####%*o o--",
+"- @########%*o -",
+"- -",
+"--&&&&&&X o--",
+"--------$ oO----",
+"-------X oO-------",
+"------- o*----------",
+"------. oO-------------",
+"-----$ o*----------------",
+"----- o*-------------------",
+"----- o*----------------------",
+"------@-------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as10.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as10.wxd
new file mode 100644
index 0000000000..de317617e4
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as10.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 4 2 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 4064000
+ 3048000 2032000
+ 7620000 4064000
+ 3048000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as10.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as10.xpm
new file mode 100644
index 0000000000..d7bda6b90a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as10.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_as10[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #000000",
+". c #5A5A5A",
+"X c #EAEAEA",
+"o c #C7C7C7",
+"O c #272727",
+"+ c #040404",
+"@ c #FFFFFF",
+"# c #1A1A1A",
+"$ c #979797",
+"% c #A9A9A9",
+"& c #646464",
+"* c #0C0C0C",
+"= c #F4F4F4",
+"- c #434343",
+"; c #7A7A7A",
+": c None",
+/* pixels */
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::. +.:::::::::::::::::",
+":::::::::: -:::::::::::::::",
+":::::::::* O:::::::::::::",
+"::::::::O +o%O *&::::::::::",
+":::::::. $@@@o- +.::::::::",
+"::::::: .@@@@@@o&+ -::::::",
+"::::::* O=@@@@@@@@X;# O::::",
+"::&&&* *o@@@@@@@@@@@=$O *;:",
+": $@@@@@@@@@@@@@@@%- :",
+": $@@@@@@@@@@@@@@@%- :",
+"::&&&* *o@@@@@@@@@@@=$O *;:",
+"::::::* O=@@@@@@@@X;# O::::",
+"::::::: .@@@@@@o&+ -::::::",
+":::::::. $@@@o- +.::::::::",
+"::::::::O *o$O *;::::::::::",
+":::::::::* O:::::::::::::",
+":::::::::: -:::::::::::::::",
+"::::::::::. +.:::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::",
+"::::::::::::::::::::::::::::::::"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as11.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as11.wxd
new file mode 100644
index 0000000000..a6f33ba6e7
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as11.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 4 2 0 0 0 0 0 0 8 0 4 1 8 1
+ 1524000 4064000
+ 3048000 2032000
+ 7620000 4064000
+ 3048000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as11.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as11.xpm
new file mode 100644
index 0000000000..e3e5f7fdb4
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as11.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_as11[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 9 1",
+/* colors */
+" c #000000",
+". c #5A5A5A",
+"X c #262626",
+"o c #070707",
+"O c #3D3D3D",
+"+ c #646464",
+"@ c #797979",
+"# c #101010",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$. o.$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$ O$$$$$$$$$$$$$$$",
+"$$$$$$$$$o X$$$$$$$$$$$$$",
+"$$$$$$$$X #+$$$$$$$$$$",
+"$$$$$$$. o.$$$$$$$$",
+"$$$$$$$ O$$$$$$",
+"$$$$$$o X$$$$",
+"$$+++# #@$",
+"$ $",
+"$ $",
+"$$+++# #@$",
+"$$$$$$o X$$$$",
+"$$$$$$$ O$$$$$$",
+"$$$$$$$. o.$$$$$$$$",
+"$$$$$$$$X #@$$$$$$$$$$",
+"$$$$$$$$$o X$$$$$$$$$$$$$",
+"$$$$$$$$$$ O$$$$$$$$$$$$$$$",
+"$$$$$$$$$$. o.$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as12.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as12.wxd
new file mode 100644
index 0000000000..fba2af7b3b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as12.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 4 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 4064000
+ 3048000 2032000
+ 7620000 4064000
+ 3048000 6096000
+6 3 2 0 0 0 0 0 0 0 0 4 1 8 1
+ 1524000 4064000
+ 7620000 4064000
+ 3048000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as12.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as12.xpm
new file mode 100644
index 0000000000..43ab041765
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as12.xpm
@@ -0,0 +1,56 @@
+/* XPM */
+static const char *xpm_wxd_as12[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 17 1",
+/* colors */
+" c #000000",
+". c #FAFAFA",
+"X c #EBEBEB",
+"o c #4C4C4C",
+"O c #050505",
+"+ c #707070",
+"@ c #828282",
+"# c #FFFFFF",
+"$ c #B8B8B8",
+"% c #5F5F5F",
+"& c #1B1B1B",
+"* c #CECECE",
+"= c #303030",
+"- c #0F0F0F",
+"; c #9E9E9E",
+": c #8E8E8E",
+"> c None",
+/* pixels */
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>% O%>>>>>>>>>>>>>>>>>",
+">>>>>>>>>> o>>>>>>>>>>>>>>>",
+">>>>>>>>>O &>>>>>>>>>>>>>",
+">>>>>>>>= -+>>>>>>>>>>",
+">>>>>>>% Oo>>>>>>>>",
+">>>>>>> =>>>>>>",
+">>>>>>O &>>>>",
+">>%%%- -@>",
+"> >",
+"> ;###############$o >",
+">>%%%- O*###########.:& -@>",
+">>>>>>O =X########X@- &>>>>",
+">>>>>>> %######*%O =>>>>>>",
+">>>>>>>% ;###$o Oo>>>>>>>>",
+">>>>>>>>= O*:& -+>>>>>>>>>>",
+">>>>>>>>>O &>>>>>>>>>>>>>",
+">>>>>>>>>> o>>>>>>>>>>>>>>>",
+">>>>>>>>>>% O%>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as13.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as13.wxd
new file mode 100644
index 0000000000..3104899d36
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as13.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 4 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 1524000 4064000
+ 3048000 2032000
+ 7620000 4064000
+ 3048000 6096000
+6 3 2 0 0 0 0 0 0 0 0 4 1 8 1
+ 1524000 4064000
+ 7620000 4064000
+ 3048000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as13.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as13.xpm
new file mode 100644
index 0000000000..e57c933f4c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as13.xpm
@@ -0,0 +1,56 @@
+/* XPM */
+static const char *xpm_wxd_as13[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 17 1",
+/* colors */
+" c #000000",
+". c #FAFAFA",
+"X c #EBEBEB",
+"o c #040404",
+"O c #4C4C4C",
+"+ c #707070",
+"@ c #828282",
+"# c #FFFFFF",
+"$ c #B8B8B8",
+"% c #5F5F5F",
+"& c #1B1B1B",
+"* c #CECECE",
+"= c #303030",
+"- c #0D0D0D",
+"; c #9F9F9F",
+": c #8E8E8E",
+"> c None",
+/* pixels */
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>% o%>>>>>>>>>>>>>>>>>",
+">>>>>>>>>> O>>>>>>>>>>>>>>>",
+">>>>>>>>>- &>>>>>>>>>>>>>",
+">>>>>>>>= o*;= -+>>>>>>>>>>",
+">>>>>>>% ;###$O oO>>>>>>>>",
+">>>>>>> %######*%o =>>>>>>",
+">>>>>>- =X########X@- &>>>>",
+">>%%%- -*###########.:& -@>",
+"> ;###############$O >",
+"> >",
+">>%%%- -@>",
+">>>>>>- &>>>>",
+">>>>>>> =>>>>>>",
+">>>>>>>% oO>>>>>>>>",
+">>>>>>>>= -+>>>>>>>>>>",
+">>>>>>>>>- &>>>>>>>>>>>>>",
+">>>>>>>>>> O>>>>>>>>>>>>>>>",
+">>>>>>>>>>% o%>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as14.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as14.wxd
new file mode 100644
index 0000000000..297e2544d2
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as14.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+6 4 0 0 0 0 255 255 255 8 0 4 1 8 1
+ 7620000 4064000
+ 4572000 6096000
+ 1524000 4064000
+ 4572000 2032000
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1778000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as14.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as14.xpm
new file mode 100644
index 0000000000..c64885c756
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as14.xpm
@@ -0,0 +1,53 @@
+/* XPM */
+static const char *xpm_wxd_as14[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 14 1",
+/* colors */
+" c #000000",
+". c #242424",
+"X c #010101",
+"o c #020202",
+"O c #707070",
+"+ c #FFFFFF",
+"@ c #BCBCBC",
+"# c #F2F2F2",
+"$ c #666666",
+"% c #1F1F1F",
+"& c #C0C0C0",
+"* c #202020",
+"= c #F6F6F6",
+"- c None",
+/* pixels */
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"----------------. %------------",
+"--------------Oo X$----------",
+"-------------* XX *---------",
+"-----------Oo %@&. X$-------",
+"----------. X$#++=Oo %------",
+"--------Oo %@++++++&. X$----",
+"-------. X$#++++++++=Oo %---",
+"--$$$. *@++++++++++++@* X$-",
+"- X$#++++++++++++++#$X -",
+"- X$#++++++++++++++#$X -",
+"--$$$. *@++++++++++++@* X$-",
+"-------. X$#++++++++=Oo %---",
+"--------Oo %@++++++&. X$----",
+"----------. X$#++=Oo %------",
+"-----------Oo %@&. X$-------",
+"-------------* XX *---------",
+"--------------$X X$----------",
+"----------------. %------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as15.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as15.wxd
new file mode 100644
index 0000000000..deafcf0e94
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as15.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+6 4 0 0 0 0 0 0 0 8 0 4 1 8 1
+ 7620000 4064000
+ 4572000 6096000
+ 1524000 4064000
+ 4572000 2032000
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1778000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as15.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as15.xpm
new file mode 100644
index 0000000000..b3e1a096e7
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as15.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_as15[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 8 1",
+/* colors */
+" c #000000",
+". c #010101",
+"X c #020202",
+"o c #707070",
+"O c #666666",
+"+ c #1F1F1F",
+"@ c #222222",
+"# c None",
+/* pixels */
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################@ +############",
+"##############oX .O##########",
+"#############+ +#########",
+"###########oX .O#######",
+"##########@ +######",
+"########oX .O####",
+"#######@ +###",
+"##OOO@ .O#",
+"# #",
+"# #",
+"##OOO@ .O#",
+"#######@ +###",
+"########oX .O####",
+"##########@ +######",
+"###########oX .O#######",
+"#############+ +#########",
+"##############O. .O##########",
+"################@ +############",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as16.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as16.wxd
new file mode 100644
index 0000000000..3e4031f244
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as16.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+6 4 0 0 0 0 255 255 255 8 0 4 1 8 1
+ 7620000 4064000
+ 4572000 6096000
+ 1524000 4064000
+ 4572000 2032000
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1778000 4064000
+6 3 2 0 0 0 0 0 0 2 0 4 1 8 1
+ 1524000 4064000
+ 7620000 4064000
+ 4572000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as16.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as16.xpm
new file mode 100644
index 0000000000..af2ed6f9a9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as16.xpm
@@ -0,0 +1,56 @@
+/* XPM */
+static const char *xpm_wxd_as16[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 17 1",
+/* colors */
+" c #000000",
+". c #010101",
+"X c #020202",
+"o c #707070",
+"O c #FFFFFF",
+"+ c #BBBBBB",
+"@ c #636363",
+"# c #F2F2F2",
+"$ c #999999",
+"% c #666666",
+"& c #1F1F1F",
+"* c #8A8A8A",
+"= c #313131",
+"- c #C0C0C0",
+"; c #202020",
+": c #F6F6F6",
+"> c None",
+/* pixels */
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>; &>>>>>>>>>>>>",
+">>>>>>>>>>>>>>oX .%>>>>>>>>>>",
+">>>>>>>>>>>>>; ;>>>>>>>>>",
+">>>>>>>>>>>oX .%>>>>>>>",
+">>>>>>>>>>; &>>>>>>",
+">>>>>>>>oX .%>>>>",
+">>>>>>>; &>>>",
+">>%%@= .%>",
+"> >",
+"> .=*$$$$$$$$$$$$$$*=. >",
+">>%%@= ;+OOOOOOOOOOOO+; .%>",
+">>>>>>>; .%#OOOOOOOO:oX &>>>",
+">>>>>>>>oX &+OOOOOO-; .%>>>>",
+">>>>>>>>>>; .%#OO:oX &>>>>>>",
+">>>>>>>>>>>oX &+-; .%>>>>>>>",
+">>>>>>>>>>>>>; .. ;>>>>>>>>>",
+">>>>>>>>>>>>>>%. .%>>>>>>>>>>",
+">>>>>>>>>>>>>>>>; &>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as17.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as17.wxd
new file mode 100644
index 0000000000..e75a1b3c78
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as17.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1778000 4064000
+6 4 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 7620000 4064000
+ 4572000 6096000
+ 1524000 4064000
+ 4572000 2032000
+6 3 2 0 0 0 0 0 0 2 0 4 1 8 1
+ 1524000 4064000
+ 7620000 4064000
+ 4572000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as17.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as17.xpm
new file mode 100644
index 0000000000..6ac1fbf020
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as17.xpm
@@ -0,0 +1,56 @@
+/* XPM */
+static const char *xpm_wxd_as17[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 17 1",
+/* colors */
+" c #000000",
+". c #010101",
+"X c #020202",
+"o c #707070",
+"O c #FFFFFF",
+"+ c #BBBBBB",
+"@ c #636363",
+"# c #F2F2F2",
+"$ c #999999",
+"% c #666666",
+"& c #1F1F1F",
+"* c #8A8A8A",
+"= c #313131",
+"- c #C0C0C0",
+"; c #202020",
+": c #F6F6F6",
+"> c None",
+/* pixels */
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>; &>>>>>>>>>>>>",
+">>>>>>>>>>>>>>oX .%>>>>>>>>>>",
+">>>>>>>>>>>>>; .. ;>>>>>>>>>",
+">>>>>>>>>>>oX &+-; .%>>>>>>>",
+">>>>>>>>>>; .%#OO:oX &>>>>>>",
+">>>>>>>>oX &+OOOOOO-; .%>>>>",
+">>>>>>>; .%#OOOOOOOO:oX &>>>",
+">>%%@= ;+OOOOOOOOOOOO+; .%>",
+"> .=*$$$$$$$$$$$$$$*=. >",
+"> >",
+">>%%@= .%>",
+">>>>>>>; &>>>",
+">>>>>>>>oX .%>>>>",
+">>>>>>>>>>; &>>>>>>",
+">>>>>>>>>>>oX .%>>>>>>>",
+">>>>>>>>>>>>>; ;>>>>>>>>>",
+">>>>>>>>>>>>>>%. .%>>>>>>>>>>",
+">>>>>>>>>>>>>>>>; &>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as18.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as18.wxd
new file mode 100644
index 0000000000..c085fb0c1a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as18.wxd
@@ -0,0 +1,8 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+11 1 0 0 0 255 255 255 8 0 4 1
+ 1524000 7620000 2032000 6096000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as18.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as18.xpm
new file mode 100644
index 0000000000..513daed0ae
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as18.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static const char *xpm_wxd_as18[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 5 1",
+/* colors */
+" c #000000",
+". c #292929",
+"X c #FFFFFF",
+"o c #666666",
+"O c None",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOooooooooooooooooooooooooooO",
+"OOOOo o",
+"OOOOo o",
+"OOOOo .oooooooooooooooooooo. o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOoo. oXXXXXXXXXXXXXXXXXXXXo o",
+"O oXXXXXXXXXXXXXXXXXXXXo o",
+"O oXXXXXXXXXXXXXXXXXXXXo o",
+"OOoo. oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo .oooooooooooooooooooo. o",
+"OOOOo o",
+"OOOOo o",
+"OOOOOooooooooooooooooooooooooooO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as19.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as19.wxd
new file mode 100644
index 0000000000..163a8333ef
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as19.wxd
@@ -0,0 +1,8 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+11 1 0 0 0 0 0 0 8 0 4 1
+ 1524000 7620000 2032000 6096000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as19.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as19.xpm
new file mode 100644
index 0000000000..81f76eec5e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as19.xpm
@@ -0,0 +1,43 @@
+/* XPM */
+static const char *xpm_wxd_as19[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 4 1",
+/* colors */
+" c #000000",
+". c #292929",
+"X c #666666",
+"o c None",
+/* pixels */
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooXXXXXXXXXXXXXXXXXXXXXXXXXXo",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooXX. X",
+"o X",
+"o X",
+"ooXX. X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"ooooX X",
+"oooooXXXXXXXXXXXXXXXXXXXXXXXXXXo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as20.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as20.wxd
new file mode 100644
index 0000000000..07c10461b2
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as20.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+11 1 0 0 0 255 255 255 8 0 4 1
+ 1524000 7620000 2032000 6096000 0
+11 2 0 0 0 0 0 0 0 0 4 1
+ 1524000 7620000 4064000 6096000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as20.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as20.xpm
new file mode 100644
index 0000000000..36d0a8490f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as20.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static const char *xpm_wxd_as20[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 5 1",
+/* colors */
+" c #000000",
+". c #292929",
+"X c #FFFFFF",
+"o c #666666",
+"O c None",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOooooooooooooooooooooooooooO",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOoo. o",
+"O o",
+"O oXXXXXXXXXXXXXXXXXXXXo o",
+"OOoo. oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo .oooooooooooooooooooo. o",
+"OOOOo o",
+"OOOOo o",
+"OOOOOooooooooooooooooooooooooooO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as21.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as21.wxd
new file mode 100644
index 0000000000..556a0cc3d4
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as21.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+11 1 0 0 0 255 255 255 8 0 4 1
+ 1524000 7620000 2032000 6096000 0
+11 2 0 0 0 0 0 0 0 0 4 1
+ 1524000 7620000 2032000 4064000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as21.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as21.xpm
new file mode 100644
index 0000000000..e5d4bcebda
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as21.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static const char *xpm_wxd_as21[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 5 1",
+/* colors */
+" c #000000",
+". c #292929",
+"X c #FFFFFF",
+"o c #666666",
+"O c None",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOooooooooooooooooooooooooooO",
+"OOOOo o",
+"OOOOo o",
+"OOOOo .oooooooooooooooooooo. o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOOOo oXXXXXXXXXXXXXXXXXXXXo o",
+"OOoo. oXXXXXXXXXXXXXXXXXXXXo o",
+"O oXXXXXXXXXXXXXXXXXXXXo o",
+"O o",
+"OOoo. o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOo o",
+"OOOOOooooooooooooooooooooooooooO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as22.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as22.wxd
new file mode 100644
index 0000000000..02e84f641a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as22.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 7620000 4064000
+3 4 0 0 0 0 8 0 4 1 1 8 0 8 4 0 8 4
+ 1524000 2032000
+ 7620000 2032000
+ 7620000 6096000
+ 1524000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as22.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as22.xpm
new file mode 100644
index 0000000000..69f055c219
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as22.xpm
@@ -0,0 +1,45 @@
+/* XPM */
+static const char *xpm_wxd_as22[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 6 1",
+/* colors */
+" c #000000",
+". c #363636",
+"X c #292929",
+"o c #636363",
+"O c #666666",
+"+ c None",
+/* pixels */
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++OOOOOOOOOOOOOOOOOOOOOOOO++",
+"+++++ +",
+"+++++ O",
+"++++++OOOOOOOOOOOOOOOOOOOOOOX O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++OOOOOOOOOOOOOOOOOOOOOOOOOOX o",
+"+ .",
+"+ .",
+"++OOOOOOOOOOOOOOOOOOOOOOOOOOX o",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++OOOOOOOOOOOOOOOOOOOOOOX O",
+"+++++ O",
+"+++++ +",
+"++++++OOOOOOOOOOOOOOOOOOOOOOOO++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as23.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as23.wxd
new file mode 100644
index 0000000000..569e07152e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as23.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 3 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 7620000 2032000
+ 1524000 4064000
+ 7620000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as23.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as23.xpm
new file mode 100644
index 0000000000..e149869aa5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as23.xpm
@@ -0,0 +1,52 @@
+/* XPM */
+static const char *xpm_wxd_as23[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 13 1",
+/* colors */
+" c #000000",
+". c #252525",
+"X c #7F7F7F",
+"o c #6E6E6E",
+"O c #282828",
+"+ c #FFFFFF",
+"@ c #191919",
+"# c #3D3D3D",
+"$ c #636363",
+"% c #CFCFCF",
+"& c #666666",
+"* c #7A7A7A",
+"= c None",
+/* pixels */
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"==========================*. =",
+"=======================XO &",
+"====================*. &",
+"=================*. .*# &",
+"==============XO .o%++& &",
+"===========XO .o%+++++& &",
+"========XO .o%++++++++& &",
+"==&&$#@ .*%+++++++++++& &",
+"= .*%++++++++++++++& &",
+"= .*%++++++++++++++& &",
+"==&&$#@ .*%+++++++++++& &",
+"========XO .o%++++++++& &",
+"===========XO .o%+++++& &",
+"==============XO .o%++& &",
+"=================*. .*# &",
+"====================*. &",
+"=======================XO &",
+"==========================*. =",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as24.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as24.wxd
new file mode 100644
index 0000000000..181087be65
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as24.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 3 1 0 0 0 0 0 0 8 0 4 1 8 1
+ 7620000 2032000
+ 1524000 4064000
+ 7620000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as24.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as24.xpm
new file mode 100644
index 0000000000..2d6e8bf806
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as24.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static const char *xpm_wxd_as24[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 8 1",
+/* colors */
+" c #000000",
+". c #131313",
+"X c #252525",
+"o c #7F7F7F",
+"O c #282828",
+"+ c #666666",
+"@ c #7A7A7A",
+"# c None",
+/* pixels */
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"##########################@X #",
+"#######################oO +",
+"####################@X +",
+"#################@X +",
+"##############oO +",
+"###########oO +",
+"########oO +",
+"##+++O. +",
+"# +",
+"# +",
+"##+++O. +",
+"########oO +",
+"###########oO +",
+"##############oO +",
+"#################@X +",
+"####################@X +",
+"#######################oO +",
+"##########################@X #",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################",
+"################################"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as25.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as25.wxd
new file mode 100644
index 0000000000..6d77f1e8f9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as25.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 3 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 7620000 2032000
+ 1524000 4064000
+ 7620000 6096000
+6 3 2 0 0 0 0 0 0 0 0 4 0 8 1
+ 1524000 4064000
+ 7620000 4064000
+ 7620000 6096000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as25.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as25.xpm
new file mode 100644
index 0000000000..abedd75f59
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as25.xpm
@@ -0,0 +1,52 @@
+/* XPM */
+static const char *xpm_wxd_as25[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 13 1",
+/* colors */
+" c #000000",
+". c #252525",
+"X c #7F7F7F",
+"o c #6E6E6E",
+"O c #4B4B4B",
+"+ c #282828",
+"@ c #FFFFFF",
+"# c #191919",
+"$ c #CFCFCF",
+"% c #666666",
+"& c #7A7A7A",
+"* c #C3C3C3",
+"= c None",
+/* pixels */
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"==========================&. =",
+"=======================X+ %",
+"====================&. %",
+"=================&. %",
+"==============X+ %",
+"===========X+ %",
+"========X+ %",
+"==%%%+# %",
+"= %",
+"= .&$@@@@@@@@@@@@@@% %",
+"==%%%+# .&$@@@@@@@@@@@% %",
+"========X+ .o*@@@@@@@@% %",
+"===========X+ .o*@@@@@% %",
+"==============X+ .o*@@% %",
+"=================&. .&O %",
+"====================&. %",
+"=======================X+ %",
+"==========================&. =",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================",
+"================================"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as26.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as26.wxd
new file mode 100644
index 0000000000..0c8ba04c88
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as26.wxd
@@ -0,0 +1,14 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+6 3 1 0 0 0 255 255 255 8 0 4 1 8 1
+ 7620000 2032000
+ 1524000 4064000
+ 7620000 6096000
+6 3 2 0 0 0 0 0 0 0 0 4 0 8 1
+ 1524000 4318000
+ 7620000 4318000
+ 7620000 2286000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as26.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as26.xpm
new file mode 100644
index 0000000000..ecfdf0bfec
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as26.xpm
@@ -0,0 +1,53 @@
+/* XPM */
+static const char *xpm_wxd_as26[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 14 1",
+/* colors */
+" c #000000",
+". c #252525",
+"X c #7F7F7F",
+"o c #6E6E6E",
+"O c #FFFFFF",
+"+ c #191919",
+"@ c #080808",
+"# c #2D2D2D",
+"$ c #CFCFCF",
+"% c #666666",
+"& c #555555",
+"* c #7A7A7A",
+"= c #C3C3C3",
+"- c None",
+/* pixels */
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------*. -",
+"-----------------------X. %",
+"--------------------*. %",
+"-----------------*. .*& %",
+"--------------X. .o=OO% %",
+"-----------X. .o=OOOOO% %",
+"--------X. .o=OOOOOOOO% %",
+"--%%%#+ .*$OOOOOOOOOOO% %",
+"- %",
+"- @ %",
+"--%%%#+ @ %",
+"--------X. @ %",
+"-----------X. @ %",
+"--------------X. @ %",
+"-----------------*. @ %",
+"--------------------*. %",
+"-----------------------X. %",
+"--------------------------*. -",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------",
+"--------------------------------"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as27.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as27.wxd
new file mode 100644
index 0000000000..d0b8668fb1
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as27.wxd
@@ -0,0 +1,8 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+9 0 0 0 0 255 255 255 8 0 4 1
+ 4318000 4064000 3048000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as27.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as27.xpm
new file mode 100644
index 0000000000..0a9a8087f1
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as27.xpm
@@ -0,0 +1,52 @@
+/* XPM */
+static const char *xpm_wxd_as27[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 13 1",
+/* colors */
+" c #000000",
+". c #242424",
+"X c #C5C5C5",
+"o c #010101",
+"O c #E9E9E9",
+"+ c #7F7F7F",
+"@ c #FCFCFC",
+"# c #FFFFFF",
+"$ c #191919",
+"% c #646464",
+"& c #545454",
+"* c #333333",
+"= c None",
+/* pixels */
+"================================",
+"================================",
+"================%%==============",
+"============*o o*==========",
+"==========. .========",
+"========+ $*&&*$ o+======",
+"=======& o&X@####@X&o &=====",
+"======+ .X##########X. +====",
+"====== *O############O* o====",
+"=====. .O##############O. .===",
+"===== oX################Xo ===",
+"====* &##################& *==",
+"====o X##################X o==",
+"==== $@##################@$ ==",
+"==%* .@###################* ==",
+"= +###################& +=",
+"= +###################& +=",
+"==%* .@###################* ==",
+"==== $@##################@$ ==",
+"====o X##################X o==",
+"====* &##################& *==",
+"===== oX################Xo ===",
+"=====. .O##############O. .===",
+"======o *O############O* o====",
+"======+ .X##########X. +====",
+"=======& o&X@####@X&o &=====",
+"========+o $*&&*$ o+======",
+"==========. .========",
+"============*o o*==========",
+"================%%==============",
+"================================",
+"================================"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as28.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as28.wxd
new file mode 100644
index 0000000000..60e86c3425
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as28.wxd
@@ -0,0 +1,8 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 1524000 4064000
+9 0 0 0 0 0 0 0 8 0 4 1
+ 4318000 4064000 3048000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as28.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as28.xpm
new file mode 100644
index 0000000000..6978ee816f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as28.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_as28[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 9 1",
+/* colors */
+" c #000000",
+". c #6B6B6B",
+"X c #7D7D7D",
+"o c #010101",
+"O c #252525",
+"+ c #020202",
+"@ c #303030",
+"# c #464646",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$..$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$@+ +@$$$$$$$$$$",
+"$$$$$$$$$$O O$$$$$$$$",
+"$$$$$$$$X oX$$$$$$",
+"$$$$$$$# #$$$$$",
+"$$$$$$X X$$$$",
+"$$$$$$ o$$$$",
+"$$$$$O O$$$",
+"$$$$$ $$$",
+"$$$$@ @$$",
+"$$$$+ +$$",
+"$$$$ $$",
+"$$.@ $$",
+"$ .$",
+"$ .$",
+"$$.@ $$",
+"$$$$ $$",
+"$$$$+ +$$",
+"$$$$@ @$$",
+"$$$$$ $$$",
+"$$$$$O O$$$",
+"$$$$$$o o$$$$",
+"$$$$$$X X$$$$",
+"$$$$$$$# #$$$$$",
+"$$$$$$$$Xo oX$$$$$$",
+"$$$$$$$$$$O O$$$$$$$$",
+"$$$$$$$$$$$$@+ +@$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$..$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as29.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-as29.wxd
new file mode 100644
index 0000000000..1a6cafe02d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as29.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 508000 4064000
+ 7620000 4064000
+3 2 0 0 0 0 8 0 4 1 0 8 0 8 4 0 8 4
+ 7620000 6096000
+ 7620000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-as29.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-as29.xpm
new file mode 100644
index 0000000000..680c5d96a6
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-as29.xpm
@@ -0,0 +1,45 @@
+/* XPM */
+static const char *xpm_wxd_as29[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 6 1",
+/* colors */
+" c #000000",
+". c #363636",
+"X c #292929",
+"o c #636363",
+"O c #666666",
+"+ c None",
+/* pixels */
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"+++++++++++++++++++++++++++++ +",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++OOOOOOOOOOOOOOOOOOOOOOOOOOX o",
+"+ .",
+"+ .",
+"++OOOOOOOOOOOOOOOOOOOOOOOOOOX o",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"++++++++++++++++++++++++++++O O",
+"+++++++++++++++++++++++++++++ +",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs00.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs00.wxd
new file mode 100644
index 0000000000..a2db5512a9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs00.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 3 0 4 0
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs00.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs00.xpm
new file mode 100644
index 0000000000..c8eb3553f5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs00.xpm
@@ -0,0 +1,42 @@
+/* XPM */
+static const char *xpm_wxd_fs00[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 3 1",
+/* colors */
+" c #282828",
+". c #656565",
+"X c None",
+/* pixels */
+" .............................. ",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.",
+" .............................. "
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs01.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs01.wxd
new file mode 100644
index 0000000000..38393c0bcf
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs01.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 1
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs01.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs01.xpm
new file mode 100644
index 0000000000..6101d7dbb5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs01.xpm
@@ -0,0 +1,42 @@
+/* XPM */
+static const char *xpm_wxd_fs01[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 3 1",
+/* colors */
+" c #A48800",
+". c #FFD400",
+"X c #CCAA00",
+/* pixels */
+" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+"X..............................X",
+" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX "
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs02.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs02.wxd
new file mode 100644
index 0000000000..530d1db2ed
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs02.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 2
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs02.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs02.xpm
new file mode 100644
index 0000000000..35d78f67a1
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs02.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs02[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #FDD200",
+". c #C8A600",
+"X c #ECC400",
+"o c #937B00",
+"O c #FFD400",
+"+ c #CCAA00",
+"@ c #735F00",
+"# c #DFBA00",
+"$ c #9A8000",
+"% c #BE9E00",
+"& c #897200",
+"* c #AF9100",
+"= c #D3AF00",
+"- c #F8CE00",
+"; c #8E7600",
+": c #A18600",
+/* pixels */
+":+&@.+++:@*+++.@&++++$@%+++*@$+:",
+"+OOX$*OOOO%;XOOO#o.OOO-:$-OOO.&*",
+"@-OOO=;=OOO-$$ OOO%;XOOOXo%OOO &",
+".$* OOO%;XOOO#;%OOO *o-OOO+&=OO+",
+"+O#o.OOO-:$-OOO.&#OOOX$*OOOO%;X+",
+"+OOO%&XOOOXo%OOO *;-OOO=;=OOO-$&",
+"@.OOO *o-OOO+&=OOO-$* OOO%&XOOO*",
+"+.&#OOOX$*OOOO%;XOOO#&.OOO-:$-O+",
+"+O *;-OOO=&=OOO-$$ OOO%&XOOOXo%+",
+"*OOO-$* OOO%;XOOO#;%OOO :o-OOO+@",
+"&oXOOO#&.OOO-:: OOO.&#OOOXo*OOO+",
+"+-$$ OOO%&XOOOXo%OOO *;-OOO=&=O+",
+"+OO#;%OOO :o-OOO+&=OOO-$* OOO%&%",
+"& OOO.&#OOOXo*OOOO%;XOOO#&.OOO-@",
+"%;%OOO *;-OOO=;=OOO-$$ OOO%&XOO+",
+"+O+&#OOO-$* OOO%&XOOO#;%OOO :o-+",
+"+OOO%;XOOO#&.OOO-:: OOO.&#OOOXo&",
+"@=OOO-:: OOO%&XOOOXo%OOO *;-OOO*",
+"+%&XOOO#;.OOO :o-OOO+&#OOO-$* O+",
+"+O-:: OOO.;#OOOXo*OOOO%;XOOO#;.+",
+"%OOOX;%OOO *$-OOO=;=OOO-:: OOO%@",
+"&$-OOO+&#OOO-$* OOO%&XOOO#;.OOO.",
+"+Xo*OOO *;XOOO#o+OOO-:: OOO.;#O+",
+"+OO=;=OOO-:: OOO%&XOOOX;%OOO *$.",
+";OOOO%&XOOO#;.OOO :o-OOO+&#OOOX@",
+"*;.OOO-:: OOO.;#OOOXo*OOO *;XOO+",
+"+O%&XOOOX;%OOO *$-OOO=&=OOO-$: +",
+"+OO :o-OOO+&#OOO-$* OOO%&XOOO#o$",
+"@#OOOXo*OOO *;XOOO#o+OOO-:: OOO$",
+"+*o-OOO=&=OOO-$: OOO%&XOOO#;%OO+",
+"+O-$* OOO%&XOOO#o.OOO *$-OOO+&#+",
+"$+++*@:+++.&&.+++$@*+++%@&++++&@"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs03.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs03.wxd
new file mode 100644
index 0000000000..e7f9ca258b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs03.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 3
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs03.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs03.xpm
new file mode 100644
index 0000000000..5f44a98590
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs03.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs03[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #FCD200",
+". c #ECC400",
+"X c #937A00",
+"o c #FFD400",
+"O c #CAA900",
+"+ c #725F00",
+"@ c #CCAA00",
+"# c #DFBA00",
+"$ c #BC9C00",
+"% c #887100",
+"& c #AD9000",
+"* c #9C8200",
+"= c #D3AF00",
+"- c #F7CE00",
+"; c #8E7600",
+": c #C5A400",
+/* pixels */
+"*@*+&@@@$+;@@@@X+:@@@&+*@@@O%%O*",
+"$;:ooo *X-ooo@%#ooo-*&oooo$;.oo@",
+"% ooo$%.ooo.X$oooo&;-ooo=;=ooo-+",
+"@oo#;:ooo ** oooO%#ooo.*&oooo$;:",
+"@-*&oooo$;.ooo#;:ooo *X-ooo@%#o@",
+"%X-ooo=;=ooo-** ooo$;.ooo.X$oooO",
+"$ooo.X&oooo$;.ooo#%:ooo ** ooo:+",
+"@o *X-ooo@%=ooo-*&oooo$;.ooo#;:@",
+"@$;.ooo.X$oooo&;-ooo=;=ooo-** o@",
+"+@ooo *X-oooO%#ooo.*&oooo$;.ooo&",
+"Oooo$%.ooo#;:ooo &X-ooo@%=ooo-X%",
+"@o=;=ooo-** ooo$;.ooo.X$oooo&;-@",
+"$X&oooo$;.ooo#%:ooo *X-oooO%#oo@",
+"+-ooo@%=ooo-*&oooo$%.ooo#;:ooo %",
+"@oo.X$oooo&;-ooo=;=ooo-** ooo$%$",
+"@ *X-oooO%#ooo.X&oooo$;.ooo#X:o@",
+"X%.ooo#;:ooo &X-ooo@%=ooo-*&ooo@",
+"&ooo-** ooo$;.ooo.X$oooo&X-ooo=+",
+"@oo$;.ooo#X:ooo *X-oooO%#ooo.X&@",
+"@@%=ooo-*&oooo$%.ooo#X:ooo &X-o@",
+"+$oooo&X-ooo=;=ooo-** ooo$%#ooo$",
+"OoooO%#ooo.X&oooo$;.ooo#X:ooo-*%",
+"@o#X:ooo &X-ooo=;=ooo-** ooo$%.@",
+":** ooo$%#ooo.X$oooo&X-ooo=;=oo@",
+"+.ooo#X:ooo **-oooO%#ooo.X&oooo;",
+"@oo-** ooo$%.ooo#X:ooo &X-ooo@%&",
+"@o&;-ooo=;=ooo-** ooo$%#ooo.X$o@",
+"*%#ooo.X&oooo$;.ooo#X:ooo **-oo@",
+"*ooo &X-ooo=;=ooo-** ooo$%.ooo#+",
+"@oo:%#ooo.X$oooo&;-ooo=;=ooo-**O",
+"@#X:ooo &*-oooO%#ooo.X&oooo$;.o@",
+"+%O@@@X+$@@@$+X@@@O%+:@@@&+&@@@*"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs04.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs04.wxd
new file mode 100644
index 0000000000..72cc5cea69
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs04.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 4
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs04.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs04.xpm
new file mode 100644
index 0000000000..0f19ed599d
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs04.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs04[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #A28700",
+". c #FCD100",
+"X c #C8A600",
+"o c #FFD400",
+"O c #CCAA00",
+"+ c #856F00",
+"@ c #977D00",
+"# c #514400",
+"$ c #756100",
+"% c #BE9E00",
+"& c #F4CB00",
+"* c #8A7300",
+"= c #B09200",
+"- c #E6BF00",
+"; c #D5B100",
+": c #8F7700",
+/* pixels */
+" O$#=OOO@#$OOOX##%OOO+#:OOO=##X ",
+"=:%&@=. @&%:&O*;-:X&@ . @.%:-X+=",
+"#&ooo #%ooo-#$.ooo+#;oooX#@ooo&#",
+"X@ ;*Xo%:- .-:%X+-.=@-@=oO+;%:%",
+"O&*#Xooo%#*.oo-$$-oo.@#=oooO#$&O",
+"+@&o%*X*;o-@=@ .o=:=*-o;*%@%o&@+",
+"#Xoo&:$@&oo%$$;oo;+$ oo. $+-ooX#",
+"OX+:@&o&@:+;oo%*: oo;*@:-o. +*%O",
+"O%*@:&o-@@*;oo=*@ .o;*@*-o&@:@%O",
+"#Ooo&@$@.oo%$$-oo-+$=oo. $*&ooO#",
+"*:&o%*X*Xo-:% ..=@%+-oO+X:=o&:*",
+"O&+#Oooo%#:.oo-$$-ooo #=ooo;#$&O",
+"%@ -:%o=:- @&;*XO+;. @&@ oX+-=*%",
+"#&ooo #%ooo-#$oooo*#;oooX#@ooo&#",
+"%:%-@=o=:&=:&;*;;*;&@ &@ .%*-%+=",
+"O.+#;ooo%#@ooo&$#-ooo #%ooo-#$&O",
+"@*-o%:;:%o;*X=@&. O+;oX+;@ o-:*",
+"#;oo&@$ .oo%$$-oo-*$%ooo=$*&oo;#",
+"O=* :&o-:=:Xo. : @.oO*=+-o&@ @ O",
+"OO++ .o&@+*-oo%++=oo-@::&o.=+*XO",
+"$%oo-:+@&o.=++;oo;*+ .o& $+-oo%$",
+"+ .oX+=*;o&@ @ oo=:=*-o-:=:Xo. +",
+"O-+$%ooo=#:&oo;$$;oo.@# .ooX$$-O",
+"X ;*;o%+; .-@=%*-o=@;:%o;*O=@X",
+"#&ooo #=ooo-#$&oo.+#;ooo%#:ooo&#",
+"=*X&@ & .%*-X*--@%-@=.=@&=:&O+=",
+"Oo+#;oooX#@ooo&$#&ooo #%ooo-#$.O",
+" +-. @-: oO*;=:&&@ -:Xo=*- @.-: ",
+"#-oo. # ooo;#$&oo&+#Oooo%#:.oo-#",
+"O=@%+-o;*X@=o&@ =:&o%*X*Oo-:= X",
+"O-*$ oo. $+-ooO$+Xoo&:$@&oo=$+;O",
+"#+OO=$$$%OX+$$@OO@$$$XO%$$$=OO+#"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs05.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs05.wxd
new file mode 100644
index 0000000000..24c2572c3f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs05.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 5
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs05.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs05.xpm
new file mode 100644
index 0000000000..d96579d26e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs05.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs05[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #907800",
+". c #B59700",
+"X c #FED300",
+"o c #C9A700",
+"O c #FFD400",
+"+ c #DCB700",
+"@ c #967D00",
+"# c #CCAA00",
+"$ c #766200",
+"% c #D0AD00",
+"& c #F4CB00",
+"* c #8B7400",
+"= c #E5BE00",
+"- c #8D7500",
+"; c #A08500",
+": c #D7B300",
+/* pixels */
+"$###$.##.$###$.##.$###$;##.$o##$",
+".;OOX-+OO+ OOO@:OO= XOO;%OO=*XO#",
+"#:;OOX-+OO+ OOO@:OO= XOO;%OO=*X#",
+"#O%@OOX-+OO+ OOO@:OO= XOO;%OO=*o",
+".OO%@OOX-+OO+ OOO@:OO= XOO;%OO=$",
+"$=OO%@OOX-+OO+ OOO@:OO= XOO;%OO.",
+"#-=OO%@OOX-+OO+ OOO@:OO= XOO;%O#",
+"#X-=OO%@OOX-+OO+ OOO@:OO= XOO;%#",
+"#OX-=OO%@OOX-+OO: OOO@:OO= XOO;;",
+"*OOX-=OO%@OOX-+OO: OOO@:OO= XOO$",
+";;OOX-=OO%@OOX-+OO: OOO@:OO= XO#",
+"##;OOX-=OO%@OOX*+OO: OOO@:OO= X#",
+"#O#;OOX-=OO%@OOX*+OO: OOO@:OO= #",
+".OO#;OOX-=OO%@OOX*+OO: OOO@:OO+$",
+"$=OO#;OOX-=OO%@OOX*+OO: OOO@:OO.",
+"o*=OO#;OOX-=OO%@OOX*+OO: OOO@:O#",
+"#X*=OO#;OOX-=OO%@OOX*+OO: OOO@:#",
+"#OX*=OO#;OOX-=OO%@OOX*+OO: OOO@.",
+"*OOX*=OO#;OOX-=OO%@OOX*+OO: OOO$",
+";.OOX*=OO#;OOX-=OO%@OOX*+OO: OO#",
+"#o.OOX*=OO#;OOX-=OO%@OOX*+OO: O#",
+"#Oo.OOX*=OO#;OOX-=OO%@OOX*+OO: #",
+"oOOo.OOX*=OO#;OOX-=OO%@OOX*+OO:$",
+"$&OOo.OOX*=OO#;OOX-=OO%@OOX*+OO.",
+"o*&OOo.OOX*=OO#;OOX-=OO%@OOX*+O#",
+"#&*&OOo.OOX*=OO#;OOX-=OO%@OOX*+#",
+"#O&*&OOo.OOX*=OO#;OOX-=OO%@OOX*.",
+" OO&*&OOo.OOX*=OO#;OOX-=OO%@OOX$",
+"@.OO&*&OOo.OOX*=OO#;OOX-=OO%@OO#",
+"#..OO&*&OOo.OOX*=OO#;OOX-=OO%@O#",
+"#O..OO&*&OOo.OOX*=OO#;OOX-=OO%@#",
+";##@*##o$.##;*##o$.##;*###$.##;$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs06.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs06.wxd
new file mode 100644
index 0000000000..5cb17aca59
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs06.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 6
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs06.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs06.xpm
new file mode 100644
index 0000000000..3cb4ba6ad6
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs06.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs06[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #B49600",
+". c #FCD200",
+"X c #A48900",
+"o c #C8A700",
+"O c #FFD400",
+"+ c #836D00",
+"@ c #CCAA00",
+"# c #DFB900",
+"$ c #BC9C00",
+"% c #F3CA00",
+"& c #F6CC00",
+"* c #B09200",
+"= c #F8CE00",
+"- c #C3A200",
+"; c #6A5800",
+": c #8E7600",
+/* pixels */
+"+@@$;@@@+X@@$;o@@:X@@-;o@@::@@-;",
+"@O%:.OOXoOO%+.OO*-OO%+&OO* OO&+-",
+"@%:.OOXoOO%+.OO*-OO%+&OO* OO&+%@",
+"$:.OOXoOO%+.OO*-OO%+&OO* OO&+%O@",
+";.OOXoOO%+.OO*-OO%+&OO* OO&+%OO:",
+"@OOXoOO%+.OO*-OO%+&OO* OO&+%OO$:",
+"@OXoOO%+.OO*-OO%+&OO* OO&+%OO$*@",
+"@XoOO%+.OO*-OO%+&OO* OO&+%OO$*O@",
+"+oOO%+.OO*-OO%+&OO* OO&+%OO$*OOo",
+"XOO%+.OO*-OO%+&OO* OO&+%OO$*OO=;",
+"@O%+.OO*-OO%+&OO* OO&+%OO$*OO=+-",
+"@%+.OO*-OO%+&OO OO&+%OO$*OO=+%@",
+"$+.OO*-OO%+&OO OO&+%OO$*OO=+%O@",
+";.OO*-OO%+&OO OO&+%OO$*OO=+%OOX",
+"oOO*-OO%+&OO OO&+%OO$*OO=+%OO-:",
+"@O*-OO%+&OO OO&+%OO$*OO=+%OO-*@",
+"@*-OO%+&OO OO&+%OO$*OO=+%OO-*O@",
+":-OO%+&OO OO&+%OO$*OO=+%OO-*OOo",
+"XOO%+&OO OO&+%OO$*OO=+%OO-*OO.;",
+"@O%+&OO OO&+%OO$*OO=+%OO-*OO.:$",
+"@%+&OO OO&+%OO$*OO=+%OO-*OO.:%@",
+"-+&OO OO&+%OO$*OO=+%OO-*OO.:%O@",
+";=OO OO&+%OO$*OO=+%OO-*OO.:%OOX",
+"oOO OO&+%OO$*OO=+%OO-*OO.:%OO@+",
+"@O OO&+%OO$*OO=+%OO-*OO.:%OO@X@",
+"@ OO&+%OO$*OO=+%OO-*OO.:%OO@XO@",
+": OO&+%OO$*OO=+%OO-*OO.:%OO@XOO@",
+":OO&+%OO$*OO=+%OO-*OO.:%OO@XOO.;",
+"@O&+%OO$*OO=+%OO-*OO.:%OO@XOOO: ",
+"@&+%OO$*OO=+%OO-*OO.:%OO@XOOO:#@",
+"-+%OO$*OO=+%OO-*OO.:%OO@XOOO:#O@",
+";-@@::@@o;-@@X:@@o;$@@X+@@@; @@+"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs07.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs07.wxd
new file mode 100644
index 0000000000..a1473fe225
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs07.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 7
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs07.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs07.xpm
new file mode 100644
index 0000000000..4c84cbad2a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs07.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs07[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #FDD200",
+". c #C9A700",
+"X c #FFD400",
+"o c #A68A00",
+"O c #605000",
+"+ c #856F00",
+"@ c #746000",
+"# c #987E00",
+"$ c #F2C900",
+"% c #BF9E00",
+"& c #D3AF00",
+"* c #E5BE00",
+"= c #8D7500",
+"- c #F9CF00",
+"; c #463A00",
+": c #B29400",
+/* pixels */
+";..%;:..@O..%;o..+O..%;o..+;...;",
+"o#*= =*o.&=$+ #&:%*=$+-o&::*=$+%",
+".%O X O:XX.; XXOoXX&;-XX@#XX*;$.",
+"%=&#Xo.=*$+&=X:%#&$+&= ::o&$+*=.",
+"O X&O.X +@ X&O%XX=@-X*O:XX#O$X*;",
+"@*Xoo#X$+=*X:o=X$+=&X:o= $+#&X%+",
+".=#.X&=+ =#%X&++-X##:X*=+$Xo#:.",
+".o@*X$@#XX:O*X$@=XX:O&X$@= X%@&.",
+"+. =&+ &#:% =&+-&=::X#.+$*=%:Xoo",
+"OXX$;*XX=@XX$;&XX#OXX$;.XXoO X-;",
+"oo$+-=*:%&#$+-=*::&=$+$#&%:*=-+%",
+".%O X O:XX.;-X O#XX&;$XX@#XX*;$.",
+"%+.oX:%=*$+.#X::=*$+&=X%:#&-+&=.",
+"O X.@%X +@-X&@:X +@$X&O:XX=@$X*O",
+"O$X:#oX$+=*X:##X$++*X%#=X-+=&X.@",
+".=o%X.#+- =o:X&#+$ =o:X&=+$X#o:.",
+".:O*X$O#XX:O*X$O=XX%O*X-@+XX.O&.",
+"=% =*+-.o:: =*+$&#%: =&+$&=.:X#o",
+"OXX$;*XX=@XX$;&XX#OXX-;&XXoOXX ;",
+"#:$+$=*::.o$+$=*%:&#-+$=*.:&= =%",
+".%O-X OoXX.;$X O#XX.;$X @#XX&;$.",
+"%+%:X::=*$+.oX%:=*-+.#X.o=* =.=.",
+"O-X.@:X +@$X.@:X =@$X&@:X =@$X&O",
+"O$X:=:X$++*X%=oX-++*X.=#X =+*X.@",
+".+o:X.o+$ =o:X.o+$ =::X&#=$ =:o.",
+".:O$X$OoXX%O*X-@#XX.O*X @=XX.O*.",
+"=:-+*+$.:%: =*+$.o.: =*=$&#.o =:",
+"OXX$;*XX=@XX-;*XX#@XX ;&XXoOXX ;",
+"#:$+$+$%:.:-+$=*.:.o =*=*.o&# =:",
+".:O$X-OoXX%O$X @oXX.O$X @#XX&O*.",
+".+::X%o+$-+%:X.o=* =%oX.o=* =%#.",
+";..#O=..OO%.#@=..@O%.o@+..@O:.o;"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs08.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs08.wxd
new file mode 100644
index 0000000000..0f710af68f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs08.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 8
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs08.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs08.xpm
new file mode 100644
index 0000000000..4af63668e9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs08.xpm
@@ -0,0 +1,54 @@
+/* XPM */
+static const char *xpm_wxd_fs08[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 15 1",
+/* colors */
+" c #6D5B00",
+". c #7F6A00",
+"X c #A38800",
+"o c #FFD400",
+"O c #5F4F00",
+"+ c #715F00",
+"@ c #846E00",
+"# c #CCAA00",
+"$ c #625200",
+"% c #635300",
+"& c #997F00",
+"* c #9A8100",
+"= c #786400",
+"- c #695700",
+"; c #6B5900",
+/* pixels */
+".XXXXX$XXXXX*XXXXXX$XXXXX*XXXXX-",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"-&&&&&=&&&&&;&&&&&&=&&&&&;&&&&& ",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"%&&&&&@&&&&&O&&&&&&@&&&&&O&&&&&+",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"%&&&&&@&&&&&O&&&&&&@&&&&&O&&&&&+",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"Xooooooooooo&oooooooooooo&ooooo#",
+"-&&&&&=&&&&&;&&&&&&=&&&&&;&&&&& ",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+"#ooooo&oooooooooooo&oooooooooooX",
+".XXXXX$XXXXX*XXXXXX$XXXXX*XXXXX-"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs09.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs09.wxd
new file mode 100644
index 0000000000..eafb1be9c7
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs09.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 9
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs09.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs09.xpm
new file mode 100644
index 0000000000..3f0dc35e87
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs09.xpm
@@ -0,0 +1,54 @@
+/* XPM */
+static const char *xpm_wxd_fs09[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 15 1",
+/* colors */
+" c #6D5B00",
+". c #7F6A00",
+"X c #A38800",
+"o c #FFD400",
+"O c #5F4F00",
+"+ c #715F00",
+"@ c #846E00",
+"# c #CCAA00",
+"$ c #625200",
+"% c #635300",
+"& c #997F00",
+"* c #998000",
+"= c #786400",
+"- c #695700",
+"; c #6B5900",
+/* pixels */
+"-XXXXX #####+XXXXXX+##### XXXXX-",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"*ooooo;&&&&&OooooooO&&&&&;ooooo*",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"$&&&&&=ooooo@&&&&&&@ooooo=&&&&&$",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"*ooooo;&&&&&OooooooO&&&&&;ooooo*",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"$&&&&&=ooooo@&&&&&&@ooooo=&&&&&$",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+"Xooooo&ooooo&oooooo&ooooo&oooooX",
+".#####-XXXXX%######%XXXXX-#####."
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs10.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs10.wxd
new file mode 100644
index 0000000000..c980674825
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs10.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 10
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs10.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs10.xpm
new file mode 100644
index 0000000000..5d536a8ee8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs10.xpm
@@ -0,0 +1,45 @@
+/* XPM */
+static const char *xpm_wxd_fs10[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 6 1",
+/* colors */
+" c #A38800",
+". c #FFD400",
+"X c #836D00",
+"o c #CCAA00",
+"O c #997F00",
+"+ c #7A6600",
+/* pixels */
+"X X",
+"o..............................o",
+"o..............................o",
+"+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+",
+"o..............................o",
+"o..............................o",
+"+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+",
+"o..............................o",
+"o..............................o",
+"+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+",
+"o..............................o",
+"o..............................o",
+"+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+",
+"o..............................o",
+"o..............................o",
+" oooooooooooooooooooooooooooooo ",
+" oooooooooooooooooooooooooooooo ",
+"o..............................o",
+"o..............................o",
+"+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+",
+"o..............................o",
+"o..............................o",
+"+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+",
+"o..............................o",
+"o..............................o",
+"+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+",
+"o..............................o",
+"o..............................o",
+"+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+",
+"o..............................o",
+"o..............................o",
+"X X"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs11.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs11.wxd
new file mode 100644
index 0000000000..fb8c831705
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs11.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 11
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs11.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs11.xpm
new file mode 100644
index 0000000000..cddc8360d3
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs11.xpm
@@ -0,0 +1,45 @@
+/* XPM */
+static const char *xpm_wxd_fs11[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 6 1",
+/* colors */
+" c #A38800",
+". c #FFD400",
+"X c #836D00",
+"o c #CCAA00",
+"O c #997F00",
+"+ c #7A6600",
+/* pixels */
+"Xoo+oo+oo+oo+oo oo+oo+oo+oo+ooX",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+" ..O..O..O..O..oo..O..O..O..O.. ",
+"Xoo+oo+oo+oo+oo oo+oo+oo+oo+ooX"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs12.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs12.wxd
new file mode 100644
index 0000000000..0d241d651f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs12.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 12
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs12.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs12.xpm
new file mode 100644
index 0000000000..24f43043cc
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs12.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_fs12[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 9 1",
+/* colors */
+" c #A38800",
+". c #5C4C00",
+"X c #FFD400",
+"o c #826D00",
+"O c #CCAA00",
+"+ c #625200",
+"@ c #997F00",
+"# c #7A6600",
+"$ c #695700",
+/* pixels */
+"$ + + + + oo + + + + $",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"+@@.@@.@@.@@.@@##@@.@@.@@.@@.@@+",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"+@@.@@.@@.@@.@@##@@.@@.@@.@@.@@+",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"+@@.@@.@@.@@.@@##@@.@@.@@.@@.@@+",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"+@@.@@.@@.@@.@@##@@.@@.@@.@@.@@+",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"oOO#OO#OO#OO#OO OO#OO#OO#OO#OOo",
+"oOO#OO#OO#OO#OO OO#OO#OO#OO#OOo",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"+@@.@@.@@.@@.@@##@@.@@.@@.@@.@@+",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"+@@.@@.@@.@@.@@##@@.@@.@@.@@.@@+",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"+@@.@@.@@.@@.@@##@@.@@.@@.@@.@@+",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"+@@.@@.@@.@@.@@##@@.@@.@@.@@.@@+",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+" XX@XX@XX@XX@XXOOXX@XX@XX@XX@XX ",
+"$ + + + + oo + + + + $"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs13.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs13.wxd
new file mode 100644
index 0000000000..8705a8573f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs13.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 13
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs13.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs13.xpm
new file mode 100644
index 0000000000..95b6809caf
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs13.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs13[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #7F6A00",
+". c #A38800",
+"X c #DAB600",
+"o c #ECC400",
+"O c #FFD400",
+"+ c #947B00",
+"@ c #CCAA00",
+"# c #997F00",
+"$ c #D0AD00",
+"% c #897200",
+"& c #9C8200",
+"* c #AF9200",
+"= c #C1A100",
+"- c #F7CE00",
+"; c #685700",
+": c #8F7700",
+/* pixels */
+" ;.....&&....+;.....#..... %... ",
+"%XOOOOOOOOOOO:-OOOOOOOOOOO:OOOO@",
+";OOOOOOOOOOOo.OOOOOOOOOOO=$OOOO@",
+"*OOOOOOOOOOO:-OOOOOOOOOOO:OOOOO@",
+"@OOOOOOOOOOo.OOOOOOOOOOO=$OOOOO@",
+"@OOOOOOOOOO:-OOOOOOOOOOO:OOOOOO@",
+" ###;###### #####;#####: #####; ",
+"@OO-&OOOOOOOOOOO$=OOOOOOOOOOO.o@",
+"@OO#-OOOOOOOOOOO%OOOOOOOOOOOO+O@",
+"@O-&OOOOOOOOOOO$=OOOOOOOOOOO.oO@",
+"@O#-OOOOOOOOOOO%OOOOOOOOOOOO+OO@",
+"@-&OOOOOOOOOOO$=OOOOOOOOOOO.XOO@",
+" ;:####%:#####;##### ######;### ",
+"@OOOOOO:-OOOOOOOOOOO:OOOOOOOOOO@",
+"@OOOOOo.OOOOOOOOOOO=$OOOOOOOOOO@",
+"@OOOOO:-OOOOOOOOOOO:OOOOOOOOOOO=",
+"@OOOOo.OOOOOOOOOOO=$OOOOOOOOOOO ",
+"@OOOO:-OOOOOOOOOOO:OOOOOOOOOOO- ",
+"@OOOo.OOOOOOOOOOO=$OOOOOOOOOOO#=",
+" ###%##### ##### #####;:##### ",
+"@OOOOOOOOO%OOOOOOOOOOOO+OOOOOOO@",
+"@OOOOOOOO$=OOOOOOOOOOO.XOOOOOOO@",
+"@OOOOOOOO%OOOOOOOOOOOO+OOOOOOOO@",
+"@OOOOOOO$=OOOOOOOOOOO.oOOOOOOOO@",
+"@OOOOOOO%OOOOOOOOOOOO+OOOOOOOOO@",
+" #####:;##### ##### %####+ ### ",
+"*.OOOOOOOOOOO=$OOOOOOOOOOO#-OOO@",
+";-OOOOOOOOOOO:OOOOOOOOOOO-&OOOO@",
+"%OOOOOOOOOOO=$OOOOOOOOOOO#-OOOO@",
+"@OOOOOOOOOOO:OOOOOOOOOOO-&OOOOO@",
+"@OOOOOOOOOO=$OOOOOOOOOOO#-OOOOO@",
+" ...#......;.....#.....&;.....# "
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs14.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs14.wxd
new file mode 100644
index 0000000000..42ef858d6f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs14.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 14
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs14.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs14.xpm
new file mode 100644
index 0000000000..114bf47ce5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs14.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs14[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #7F6A00",
+". c #A38800",
+"X c #DAB600",
+"o c #ECC400",
+"O c #FFD400",
+"+ c #947B00",
+"@ c #CCAA00",
+"# c #997F00",
+"$ c #D0AD00",
+"% c #897200",
+"& c #9B8200",
+"* c #AF9200",
+"= c #C1A100",
+"- c #F7CE00",
+"; c #685700",
+": c #8F7700",
+/* pixels */
+" ...#......;.....#.....&;.....# ",
+"@OOOOOOOOOO=$OOOOOOOOOOO#-OOOOO@",
+"@OOOOOOOOOOO:OOOOOOOOOOO-&OOOOO@",
+"%OOOOOOOOOOO=$OOOOOOOOOOO#-OOOO@",
+";-OOOOOOOOOOO:OOOOOOOOOOO-&OOOO@",
+"*.OOOOOOOOOOO=$OOOOOOOOOOO#-OOO@",
+" #####:;##### ##### %####+ ### ",
+"@OOOOOOO%OOOOOOOOOOOO+OOOOOOOOO@",
+"@OOOOOOO$=OOOOOOOOOOO.oOOOOOOOO@",
+"@OOOOOOOO%OOOOOOOOOOOO+OOOOOOOO@",
+"@OOOOOOOO$=OOOOOOOOOOO.XOOOOOOO@",
+"@OOOOOOOOO%OOOOOOOOOOOO+OOOOOOO@",
+" ###%##### ##### #####;:##### ",
+"@OOOo.OOOOOOOOOOO=$OOOOOOOOOOO#=",
+"@OOOO:-OOOOOOOOOOO:OOOOOOOOOOO- ",
+"@OOOOo.OOOOOOOOOOO=$OOOOOOOOOOO ",
+"@OOOOO:-OOOOOOOOOOO:OOOOOOOOOOO=",
+"@OOOOOo.OOOOOOOOOOO=$OOOOOOOOOO@",
+"@OOOOOO:-OOOOOOOOOOO:OOOOOOOOOO@",
+" ;:####%:#####;##### ######;### ",
+"@-&OOOOOOOOOOO$=OOOOOOOOOOO.XOO@",
+"@O#-OOOOOOOOOOO%OOOOOOOOOOOO+OO@",
+"@O-&OOOOOOOOOOO$=OOOOOOOOOOO.oO@",
+"@OO#-OOOOOOOOOOO%OOOOOOOOOOOO+O@",
+"@OO-&OOOOOOOOOOO$=OOOOOOOOOOO.o@",
+" ###;###### #####;#####: #####; ",
+"@OOOOOOOOOO:-OOOOOOOOOOO:OOOOOO@",
+"@OOOOOOOOOOo.OOOOOOOOOOO=$OOOOO@",
+"*OOOOOOOOOOO:-OOOOOOOOOOO:OOOOO@",
+";OOOOOOOOOOOo.OOOOOOOOOOO=$OOOO@",
+"%XOOOOOOOOOOO:-OOOOOOOOOOO:OOOO@",
+" ;.....&&....+;.....#..... %... "
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs15.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs15.wxd
new file mode 100644
index 0000000000..0fa12cbf0b
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs15.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 15
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs15.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs15.xpm
new file mode 100644
index 0000000000..1fce6eda67
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs15.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs15[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #7E6900",
+". c #D8B400",
+"X c #A38800",
+"o c #927A00",
+"O c #ECC500",
+"+ c #FFD400",
+"@ c #CCAA00",
+"# c #977D00",
+"$ c #997F00",
+"% c #887100",
+"& c #AE9100",
+"* c #9D8300",
+"= c #C1A100",
+"- c #F7CD00",
+"; c #695700",
+": c #8D7500",
+/* pixels */
+" @@@@@ @@@@@ @@= = @@@@@ @@@@@ ",
+"X+++++;O++++$++++-$ +++++$+++++$",
+"X+++++#&:O++$++++++$+++++$+++++X",
+"X+++++$++&:O$++++++$+++++$+++++X",
+"%+++++$++++X;++++++$+++++ -++++X",
+" :@+++$+++++$++++++$+++++oX#O++X",
+"X+=:@+$+++++$++++++$+++++$+-X#OX",
+"X+++=: +++++$++++++:+++++$+++-$;",
+"X+++++:+++++$++++++;oO+++$+++++$",
+"X+++++$+++++$++++++$+&:O+$+++++X",
+"X+++++$+++++$++++++$+++&:%+++++X",
+"$+++++$+++++ :@++++$+++++ +++++X",
+"X+++++$+++++$+=:@++$+++++$+++++X",
+"X+++++$+++++$+++=:@$+++++$+++++X",
+"X+++++;=++++$+++++= +++++$+++++$",
+"X+++++$.#&++$++++++$+++++$+++++X",
+"X+++++$++.#&$++++++$+++++$+++++X",
+";+++++$++++@;++++++$+++++ @++++X",
+"##X+++$+++++$++++++$+++++$=:@++X",
+"X+O#X+$+++++$++++++$+++++$++=:@X",
+"X+++Oo +++++$++++++ +++++$++++=;",
+"X+++++$+++++$++++++ #&+++$+++++X",
+"X+++++$+++++$++++++$+.#&+$+++++X",
+"*+++++$+++++:++++++$+++@:;+++++X",
+"*+++++$+++++:oX++++$+++++:+++++X",
+"X+++++$+++++$+O#X++$+++++$+++++X",
+"X+++++$+++++$+++O#X#+++++$+++++X",
+"X+++++;$-+++$+++++O%+++++$+++++$",
+"X+++++$-X#O+$++++++$+++++$+++++X",
+"X+++++$++-X#o++++++$+++++$+++++X",
+";O++++$++++-;++++++$+++++ X++++X",
+" :;&@@ @@@@@ @@@@@@ @@@@@ = @@ "
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs16.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs16.wxd
new file mode 100644
index 0000000000..dc5b07bb17
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs16.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 16
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs16.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs16.xpm
new file mode 100644
index 0000000000..0562fd83ed
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs16.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs16[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #7E6900",
+". c #EAC300",
+"X c #A38800",
+"o c #DAB500",
+"O c #FFD400",
+"+ c #957B00",
+"@ c #CCAA00",
+"# c #CDAA00",
+"$ c #997F00",
+"% c #897100",
+"& c #AE9000",
+"* c #C0A000",
+"= c #9D8300",
+"- c #F7CD00",
+"; c #695700",
+": c #8F7700",
+/* pixels */
+" @@@@@ @@@@@ * *@@ @@@@@ @@@@@ ",
+"$OOOOO$OOOOO $-OOOO$OOOO.;OOOOOX",
+"XOOOOO$OOOOO$OOOOOO$OO.$X+OOOOOX",
+"XOOOOO$OOOOO$OOOOOO$.$XOO$OOOOOX",
+"XOOOO- OOOOO$OOOOOO;XOOOO$OOOOO%",
+"XOO-X$:OOOOO$OOOOOO$OOOOO$OOO#+ ",
+"X-X$.O$OOOOO$OOOOOO$OOOOO$Oo+&OX",
+";$-OOO$OOOOO:OOOOOO$OOOOO :*OOOX",
+"$OOOOO$OOO.:;OOOOOO$OOOOO:OOOOOX",
+"XOOOOO$O.$XO$OOOOOO$OOOOO$OOOOOX",
+"XOOOOO%$XOOO$OOOOOO$OOOOO$OOOOOX",
+"XOOOOO OOOOO$OOOO#: OOOOO$OOOOO$",
+"XOOOOO$OOOOO$OOo+&O$OOOOO$OOOOOX",
+"XOOOOO$OOOOO$#+&OOO$OOOOO$OOOOOX",
+"$OOOOO$OOOOO *OOOOO$OOOO*;OOOOOX",
+"XOOOOO$OOOOO$OOOOOO$OO*:#$OOOOOX",
+"XOOOOO$OOOOO$OOOOOO$*:#OO$OOOOOX",
+"XOOOO# OOOOO$OOOOOO;#OOOO$OOOOO;",
+"XOOo+&$OOOOO$OOOOOO$OOOOO$OOO&%:",
+"X#+&OO$OOOOO$OOOOOO$OOOOO$O&%.OX",
+";*OOOO$OOOOO OOOOOO$OOOOO :.OOOX",
+"XOOOOO$OOO*: OOOOOO$OOOOO$OOOOOX",
+"XOOOOO$O*:#O$OOOOOO$OOOOO$OOOOOX",
+"XOOOOO;%#OOO$OOOOOO:OOOOO$OOOOO=",
+"XOOOOO:OOOOO$OOOOX:%OOOOO$OOOOO=",
+"XOOOOO$OOOOO$OO&%.O$OOOOO$OOOOOX",
+"XOOOOO$OOOOO$&%.OOO$OOOOO$OOOOOX",
+"$OOOOO$OOOOO%.OOOOO$OOO-$;OOOOOX",
+"XOOOOO$OOOOO$OOOOOO$O-X$.$OOOOOX",
+"XOOOOO$OOOOO$OOOOOO+X$.OO$OOOOOX",
+"XOOOOX OOOOO$OOOOOO;-OOOO$OOOO.;",
+" @@:;& @@@@@ @@@@@@ @@@@@ @@* "
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs17.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs17.wxd
new file mode 100644
index 0000000000..730321b8a5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs17.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 17
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs17.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs17.xpm
new file mode 100644
index 0000000000..3db427e60e
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs17.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs17[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #7E6A00",
+". c #D8B400",
+"X c #917900",
+"o c #A38700",
+"O c #FDD200",
+"+ c #ECC400",
+"@ c #FFD400",
+"# c #5E4E00",
+"$ c #CBA900",
+"% c #967D00",
+"& c #CCAA00",
+"* c #997F00",
+"= c #8B7300",
+"- c #C2A100",
+"; c #F8CE00",
+": c #B29400",
+/* pixels */
+"o&&&X=& *&&&&&&&&==& o&&&&&&&$ ",
+"&O:=&@@@-=-O@@;:=.@@@:X$@@@;:=.&",
+"#*.@@@@@@@&*##*.@@@@@@@$*# o+@@&",
+"*:@@@@@@@@@o$:-@@@@@@@@O%.o-@@@&",
+"&&=.@@@@@&=.@@-=.@@@@@$=.@@-X+@&",
+"&@O:%*#*%-O@@@@;:%%#*%-@@@@@;:% ",
+"&@@@@X-*@@@@@@@@@O=-o@@@@@@@@@;#",
+"&@@.=.@.=+@@@@@@.=+@&=+@@@@@@&=-",
+"=*%:O@@@OoX*::*%:@@@@;o%o::*X-@&",
+"#;@@@@@@@@@+ ;@@@@@@@@@+ O@@@&",
+"-=.@@@@@@@.=;+=+@@@@@@@&=O.=+@@&",
+"&Oo%-;@+-X:@@@Oo%&;@+-X:@@@;*%&-",
+"&@@@&=#%.@@@@@@@O$=#o.@@@@@@@O-#",
+"&@@@.XO=.@@@@@@@@$*;=+@@@@@@@@- ",
+"&@.X:@@Oo%+@@@@.X:@@Oo*+@@@@.=-&",
+"#*:;@@@@@;:* *:O@@@@@+o*# %-O@&",
+"=$@@@@@@@@@-:*.@@@@@@@@@:-X.@@@&",
+"&:*;@@@@@+X-@@oo;@@@@@+=-@OooO@&",
+"&@+*%* *%o;@@@@+*%* *%o;@@@@.%% ",
+"&@@@@o*:@@@@@@@@@@**-@@@@@@@@@@ ",
+"&@@;X$@-%;@@@@@@+=.@:*O@@@@@@+=:",
+":-%*;@@@+%%-..-%*;@@@+X*-+.:%oO&",
+"#.O@@@@@@@O&##.@@@@@@@@;&# .@@@&",
+":=;@@@@@@@+ +.X;@@@@@@@+ +&%O@@&",
+"&;Xo+@@@+*%;@@+=o+@@@.**O@@+=o;&",
+"&@@+oX#X:;@@@@@@+o=#%:;@@@@@@+o#",
+"&@@@+=+ ;@@@@@@@@+=+=;@@@@@@@@. ",
+"&@;o*;@;X:O@@@@;ooO@+=:O@@@@+*o$",
+"#**.@@@@@.%* =%*+@@@@@.%* =%o+@&",
+" .@@@@@@@@@.o=+@@@@@@@@@$o=+@@@&",
+"$*:@@@@@@Ooo@O%-@@@@@@Oo:@;X-@@&",
+"o&: =%= :&&&&o X%= :&&&&* "
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs18.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs18.wxd
new file mode 100644
index 0000000000..e4bd949589
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs18.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 18
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs18.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs18.xpm
new file mode 100644
index 0000000000..e808c96562
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs18.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs18[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #C6A500",
+". c #6D5B00",
+"X c #FDD200",
+"o c #937A00",
+"O c #A58900",
+"+ c #FFD400",
+"@ c #B99900",
+"# c #EFC600",
+"$ c #CCAA00",
+"% c #977E00",
+"& c #E4BE00",
+"* c #F7CE00",
+"= c #8C7500",
+"- c #D6B200",
+"; c #594A00",
+": c #7D6800",
+/* pixels */
+"O$@;$$$$ ; $$$$==$$$$ ; $$$$;@$O",
+"$+O:X+++&.$++++==++++ .#+++*:O+$",
+"@O@#=-* =XO@#&o$$o&#@OX= *-=#@O@",
+".#++X ;-+++&;@*++*@.&+++$; X++#.",
+":++++&;*++++.@++++@.++++*;&++++:",
+"oO++-=#:#+*o-% ++ O-o*+#:#=-+XOo",
+"$-%.@++*O.%#++ :: ++#%.O*+X@.%-$",
+"$+$.++++X;#++++%O++++#;X++++.$+$",
+"$&=@@++Xo-=*++-OO-++*=-oX++@ =&$",
+".OX+$%:o&+#%:%@++@%:%#+&o:%$+XO.",
+"=++++X;+++++:-++++-:+++++;X++++=",
+".#+++%@@+++-O=X++X=O-+++@@%+++#.",
+" %%:o-+@o:%O+&o==o&+O%:o@+-o:%% ",
+"$+&:+++++.+++++@@+++++.+++++:&+$",
+"$+o=#+++-=@+++X==X+++@=-+++#=o+$",
+"==$*oO@%O+@o@O=&&=O@o@+O%@Oo*$==",
+"=++++*.*+++X:&++++&:X+++*.*++++=",
+".++++ .#+++*:O++++O:X+++&.$++++.",
+"Oo&#@OX= *-=#@O&&O@#=-* =XO@#&oO",
+"$*@.&+++$; X++#==#++X ;-+++&;@*$",
+"$+@.++++*;&++++oo++++&;*++++.@+$",
+"$ O-o*+#:#=-+XO@@O++-=#:#+*o-% $",
+". ++#%.O*+X@.%-++-%.@++*O.%#++ .",
+":++++#;X++++.$++++$.++++X;#++++:",
+":-++*=-oX++@ =&++&=@@++Xo-=*++-:",
+"$@%:%#+&o:%$+XO==OX+$%:o&+#%:%@$",
+"$+-:+++++;X++++OO++++X;+++++:-+$",
+"$X=O-+++@@%+++#o=#+++%@@+++-O=X$",
+".o&+O%:o@+-o:%%**%%:o-+@o:%O+&o.",
+"o+++++.+++++:&++++&:+++++.+++++o",
+".X+++@=-+++#=o++++o=#+++-=@+++X.",
+"o.==.o$::o:. O.==.O .:o::$o.==.o"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs19.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs19.wxd
new file mode 100644
index 0000000000..48d4e509f9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs19.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 19
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs19.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs19.xpm
new file mode 100644
index 0000000000..7f3b3a2f4c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs19.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs19[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #FCD200",
+". c #C7A500",
+"X c #EBC300",
+"o c #806B00",
+"O c #927900",
+"+ c #FFD400",
+"@ c #DCB700",
+"# c #715E00",
+"$ c #BA9B00",
+"% c #CCAA00",
+"& c #AC8F00",
+"* c #D0AC00",
+"= c #8A7300",
+"- c #F6CC00",
+"; c #9E8300",
+": c #584900",
+/* pixels */
+"#%%%%%%%%%%%:.%%%%%%%%%%%:%%%%%;",
+"o+++++++++++#%+++++++++++:-++++%",
+"#++++++++++-;O++++++++++@&&++++%",
+"&$+++++++++O-&@++++++++ =+O-+++%",
+"%&.+++++++&.++O@++++++ =X+-o-++%",
+"%+$O@+++%=*++++;;X++ $=X+++-O&-%",
+"%++@#:::oX++++++.::::=-++++++;::",
+"%+;& +++-;&+++-=.++++X=%+++X=@+%",
+"%O@+++++++.&+ o-+++++++&%+X=+++%",
+"O*+++++++++;@;X+++++++++= = +++%",
+"#++++++++++ OO++++++++++X=$++++%",
+"o+++++++++++#@+++++++++++: ++++%",
+"o+++++++++++:-+++++++++++:+++++%",
+"o+++++++++++#X+++++++++++:+++++%",
+"o+++++++++++o$+++++++++++:X++++%",
+"# +++++++++X&=++++++++++$.;++++%",
+"$;+++++++++= .$++++++++-=+;@+++%",
+"%.;++++++ =@++&$++++++Xo-++O@++%",
+"%+@=&X @;OX++++.=$X-*O; ++++&O..",
+"%++$=#:#=%+++++ &o#:#O@+++++X;o:",
+"%-=@+++++$O ++@=X++++ ;&+++.O-+%",
+"%o-+++++++XO+X=++++++++.&+*&+++%",
+"oX+++++++++$%O +++++++++;X=++++%",
+"#+++++++++++=;++++++++++-o%++++%",
+"o+++++++++++#@+++++++++++:+++++%",
+"o+++++++++++: +++++++++++:+++++%",
+"o+++++++++++#X+++++++++++:+++++%",
+"#+++++++++++=&++++++++++ #@++++%",
+"o-+++++++++*$=++++++++++&@O++++%",
+".=++++++++-=+@;++++++++@;+$.+++%",
+"%@=-+++++Xo-++.; +++++%O+++&&++%",
+";%.o#ooo#o%%%%%$#oooo#O%%%%%&#o#"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs20.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs20.wxd
new file mode 100644
index 0000000000..b188b5f2f5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs20.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 20
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs20.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs20.xpm
new file mode 100644
index 0000000000..a9b3ca0288
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs20.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs20[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #FCD200",
+". c #DAB500",
+"X c #816C00",
+"o c #937A00",
+"O c #EDC500",
+"+ c #FFD400",
+"@ c #5F4F00",
+"# c #BA9A00",
+"$ c #CCAA00",
+"% c #746100",
+"& c #997F00",
+"* c #AD9000",
+"= c #F7CD00",
+"- c #8C7500",
+"; c #A18600",
+": c #C5A400",
+/* pixels */
+";#X$$$$$$$%:$$$$$$$$$%$$$$$$$X#;",
+"$- +++++++O;++++++++;O+++++++ -$",
+";#+++++++++&O++++++O;+++++++++#;",
+"%++++++++++=o++++++o=++++++++++%",
+"%+++++++++++%&&&&&&%+++++++++++%",
+"%=+++++++++.*++++++*.+++++++++=%",
+":&+++++++++X++++++++-+++++++++o:",
+"$*.+++++++#$++++++++$#+++++++.*$",
+"$+-++++++ o++++++++++- ++++++- $",
+"$+:@@@@@@@O++++++++++O@@@@@@@:+$",
+"$+;O+++++::++++++++++::+++++O;+$",
+"$O&+++++++- ++++++++ -+++++++&O$",
+"$-=+++++++.*++++++++*.+++++++=o$",
+"*#+++++++++oO++++++=&+++++++++**",
+"%++++++++++=&++++++o=++++++++++%",
+"%+++++++++++%&&&&&&%+++++++++++%",
+"%=+++++++++.*++++++;.+++++++++=%",
+"#;+++++++++- ++++++ -+++++++++&#",
+"$;O+++++++::++++++++::+++++++O;$",
+"$ o++++++ -++++++++++- ++++++- $",
+"$+#%-----%.++++++++++.%-----%#+$",
+"$+**:::::&$++++++++++$&:::::**+$",
+"$=&+++++++-++++++++++-+++++++oO$",
+"$o=+++++++.*++++++++*.+++++++=&$",
+"**+++++++++o=++++++=o+++++++++**",
+"%++++++++++O&++++++&O++++++++++%",
+"%+++++++++++%&&&&&&%+++++++++++%",
+"% +++++++++O;++++++;O+++++++++ %",
+"#;+++++++++- ++++++ o+++++++++;#",
+"$&O+++++++$#++++++++#$+++++++O&$",
+"$=o+++++++-++++++++++-+++++++-=$",
+";$-%XXXXX@*$$$$$$$$$$*@XXXXX%-$;"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs21.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs21.wxd
new file mode 100644
index 0000000000..922a85ac6c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs21.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 21
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs21.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs21.xpm
new file mode 100644
index 0000000000..f6996a5ee6
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs21.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs21[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #EAC200",
+". c #B59700",
+"X c #5C4C00",
+"o c #FFD400",
+"O c #826C00",
+"+ c #957C00",
+"@ c #CCAA00",
+"# c #514300",
+"$ c #F4CB00",
+"% c #8A7200",
+"& c #675600",
+"* c #796500",
+"= c #A08500",
+"- c #D6B100",
+"; c #C5A400",
+": c #FBD100",
+/* pixels */
+"&@@@@@@@@@@@#@@@@@@@@@@@@#@@@@@=",
+"OoooooooooooXooooooooooooXooooo@",
+"*oooooooooooX ooooooooooo#:oooo@",
+"%@ooooooooo.;% ooooooooo+-O$ooo@",
+"@=@ooooooo.;oo% ooooooo+-o$O$oo@",
+"@o=@ooooo.;oooo% ooooo+-ooo$O$o@",
+"@o:&XXXXX*ooooo #XXXX#=ooooo@#X#",
+"@o% ooooo@=ooo$O$ooooo.;ooo-+oo@",
+"@% ooooooo@=o$O$ooooooo.;o-+ooo@",
+"& ooooooooo@+O$ooooooooo.=+oooo@",
+"OoooooooooooX:ooooooooooo#ooooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"*oooooooooooX@oooooooooo:# oooo@",
+"=.ooooooooo+-=@oooooooo:%$% ooo@",
+"@;.ooooooo+-oo=@oooooo:%$oo% oo@",
+"@o;.ooooo+-oooo=@oooo:%$oooo% o@",
+"@o$&XXXXX*:oooo-XXXXXX+ooooo;XX#",
+"@$O$ooooo %:oo-+oooooo@=ooo;.oo@",
+";O$ooooooo %:-+oooooooo@=o;.ooo@",
+"&:ooooooooo *+oooooooooo@*.oooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"OoooooooooooXooooooooooooXooooo@",
+"&oooooooooo:&.oooooooooo &@oooo@",
+".+oooooooo:%$;.oooooooo %:=@ooo@",
+"@-+oooooo:%$oo;.oooooo %:oo=@oo@",
+"=@.&OOOOO&;@@@@+*OOOOO&@@@@@O*O&"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs22.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs22.wxd
new file mode 100644
index 0000000000..081a4de1da
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs22.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 22
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs22.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs22.xpm
new file mode 100644
index 0000000000..5edfb21eaf
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs22.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs22[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #C6A500",
+". c #EBC400",
+"X c #B69700",
+"o c #FED300",
+"O c #FFD400",
+"+ c #CBA900",
+"@ c #CCAA00",
+"# c #A98C00",
+"$ c #866F00",
+"% c #E2BC00",
+"& c #F5CC00",
+"* c #9D8300",
+"= c #8D7500",
+"- c #C3A200",
+"; c #6A5800",
+": c #D7B200",
+/* pixels */
+"*@@@@@X@@@@@-+@@@@+-@@@@@X@@@@@*",
+"@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"@OOoOOOOOoOOOOOooOOOOOoOOOOOoOO@",
+"@O#$&OOO%; OOOo==oOOO ;%OOO&$#O@",
+"@#-&$&O%$o#-Oo=%%$oO #o=%O&$& #@",
+"$-OO&$:$oOO#-=%OO%$-#OOo=:$&OO $",
+"*OOOO&*oOOOO#%OOOO%#OOOOo*&OOOO*",
+"@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"@O%#OOOOo*&OOOO OOOO&*oOOOO#%O@",
+"@%$ #OOo=:$&OO ##-OO&$:$oOO#-=%@",
+"X$oO #o=%O&$& #OO#-&$&O%$o#-Oo=X",
+";oOOO ;%OOO&$#OOOO#$&OOO%; OOOo;",
+"+OOOOOoOOOOOoOOOOOOoOOOOOoOOOOO+",
+"@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"@Oo.OOOOO.OOOOO&&OOOOO.OOOOO.oO@",
+"@o=$%OOO $#OOO&$$&OOO#$ OOO%$=o@",
+"+=%o=%O #O #O&$&&$&O#-O#-O%$o%$+",
+";%OOo=##OOO *$&OO&$* OOO##=oOO%;",
+"XOOOOo-OOOOO@&OOOO&@OOOOO-oOOOOX",
+"@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"@O =oOOO&$%OOOO##OOOO%$&OOOo= O@",
+"@ #%$oO&$&=%OO#- #OO%$&$&Oo=%#-@",
+"*#OO%$&$&Oo=%#-OO #%$oO&$&=%OO#*",
+"$OOOO%$&OOOo= OOOO =oOOO&$%OOOO$",
+"@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"@O&@OOOOO-oOOOO%%OOOOo-OOOOO@&O@",
+"@&$* OOO##=oOO%==%OOo=##OOO *$&@",
+"-$&O#-O#-O%$o%$oo=%o=%O #O #O&$-",
+";-@@@$;*@@@X;;+@@+;;X@@@*;$@@@-;"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs23.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs23.wxd
new file mode 100644
index 0000000000..48423c1980
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs23.wxd
@@ -0,0 +1,5 @@
+WXD 1 0
+0 0 0 8128000 -56896000 -48768000
+0 2 5
+11 0 0 0 0 255 214 0 1 0 4 23
+ 0 8128000 -56896000 -48768000 0
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-fs23.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs23.xpm
new file mode 100644
index 0000000000..f01e63b73c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-fs23.xpm
@@ -0,0 +1,55 @@
+/* XPM */
+static const char *xpm_wxd_fs23[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 16 1",
+/* colors */
+" c #EBC400",
+". c #FDD200",
+"X c #FED300",
+"o c #FFD400",
+"O c #947B00",
+"+ c #CBA900",
+"@ c #BA9B00",
+"# c #CCAA00",
+"$ c #A98C00",
+"% c #866F00",
+"& c #E1BB00",
+"* c #F5CC00",
+"= c #6A5800",
+"- c #C4A300",
+"; c #D6B100",
+": c #A18600",
+/* pixels */
+"=-####%:####@=+###+=@####:%####:",
+"-%*oooo$-oooo&%XoooX%&oooo-:ooo#",
+"#*%*oooo$-oooo&%XoooX%&oooo-:oo#",
+"#o:#oooo&%ooooX% oooo-$oooo*%.o#",
+"#$-oooo&%XoooX%&oooo-:oooo*%*oo#",
+"%-oooo&%XoooX%&oooo-:oooo*%*ooo#",
+"=ooooo%*oooo-$oooo.=XooooO;oooo@",
+"::oooo*%*oooo$-oooo&%XoooX%&ooo#",
+"#-:oooo*%*oooo$-oooo&%XoooX%&oo#",
+"#o$-oooo*%ooooo% oooo;OooooX=.o#",
+"#&%XoooX%&oooo-:oooo*%*oooo$-oo#",
+"@%XoooX%&oooo-:oooo*%*oooo$-ooo#",
+"=Xoooo%&oooo#:oooo.%*oooo$-oooo@",
+"=&oooo-:oooo*%*oooo$-oooo&%Xooo+",
+"+%&oooo-:oooo*%*oooo$-oooo&%Xoo#",
+"#XO&oooo-$oooo*%*oooo$-oooo&OXo#",
+"#XO&oooo-$oooo*%*oooo$-oooo&OXo#",
+"+%&oooo-:oooo*%*oooo$-oooo&%Xoo#",
+"=&oooo-:oooo*%*oooo$-oooo&%Xooo+",
+"=Xoooo%&oooo#:oooo.%*oooo$-oooo@",
+"@%XoooX%&oooo-:oooo*%*oooo$-ooo#",
+"#&%XoooX%&oooo-:oooo*%*oooo$-oo#",
+"#o$-oooo*%ooooo% oooo;OooooX=.o#",
+"#-:oooo*%*oooo$-oooo&%XoooX%&oo#",
+"::oooo*%*oooo$-oooo&%XoooX%&ooo#",
+"=ooooo%*oooo-$oooo.=XooooO;oooo@",
+"%-oooo&%XoooX%&oooo-:oooo*%*ooo#",
+"#$-oooo&%XoooX%&oooo-:oooo*%*oo#",
+"#o:#oooo&%ooooX% oooo-$oooo*%.o#",
+"#*%*oooo$-oooo&%XoooX%&oooo-:oo#",
+"-%*oooo$-oooo&%XoooX%&oooo-:ooo#",
+"=-####%:####@=+###+=@####:%####:"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-js1.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-js1.wxd
new file mode 100644
index 0000000000..cfd0c9e896
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-js1.wxd
@@ -0,0 +1,7 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 3 0 0 0 0 30 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 6096000
+ 4826000 4064000
+ 1016000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-js1.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-js1.xpm
new file mode 100644
index 0000000000..517b48e3d1
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-js1.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_js1[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 9 1",
+/* colors */
+" c #000000",
+". c #020202",
+"X c #272727",
+"o c #161616",
+"O c #3C3C3C",
+"+ c #090909",
+"@ c #767676",
+"# c #545454",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$@o$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$. X$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$# O$$$$$$$$$$$$$$$$$$$$",
+"$$$$$ O$$$$$$$$$$$$$$$$$$",
+"$$$$O #$$$$$$$$$$$$$$$$",
+"$$$$ .@$$$$$$$$$$$$$$",
+"$$$O +@$$$$$$$$$$$$",
+"$$$ o$$$$$$$$$$$",
+"$$X o$$$$$$$$$",
+"$$ X$$$$$$$",
+"$$o O$$$$$",
+"$$$$+ O$$$",
+"$$$$$@. #$",
+"$$$$$@+ #$",
+"$$$$+ O$$$",
+"$$o O$$$$$",
+"$$ X$$$$$$$",
+"$$X o$$$$$$$$$",
+"$$$ o$$$$$$$$$$$",
+"$$$O +@$$$$$$$$$$$$",
+"$$$$ .@$$$$$$$$$$$$$$",
+"$$$$O #$$$$$$$$$$$$$$$$",
+"$$$$$ O$$$$$$$$$$$$$$$$$$",
+"$$$$$# O$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$. X$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$@o$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-js2.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-js2.wxd
new file mode 100644
index 0000000000..9ff797a648
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-js2.wxd
@@ -0,0 +1,7 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 3 0 0 0 0 30 0 4 0 1 8 0 8 4 0 8 4
+ 1016000 6096000
+ 4826000 4064000
+ 1016000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-js2.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-js2.xpm
new file mode 100644
index 0000000000..3f0d873439
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-js2.xpm
@@ -0,0 +1,49 @@
+/* XPM */
+static const char *xpm_wxd_js2[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 10 1",
+/* colors */
+" c #000000",
+". c #131313",
+"X c #020202",
+"o c #5D5D5D",
+"O c #4C4C4C",
+"+ c #2A2A2A",
+"@ c #070707",
+"# c #777777",
+"$ c #333333",
+"% c None",
+/* pixels */
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%o.%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%X +%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%O $%%%%%%%%%%%%%%%%%%%%",
+"%%%%% O%%%%%%%%%%%%%%%%%%",
+"%%%%O o%%%%%%%%%%%%%%%%",
+"%%%% Xo%%%%%%%%%%%%%%",
+"%%%$ @#%%%%%%%%%%%%",
+"%%% .%%%%%%%%%%%",
+"%%+ $%%%%%%%%%",
+"%% $%%%%%%%%",
+"%%. %%%%%%%%",
+"%%%#@ $%%%%%%%",
+"%%%%%oX @%%%%%%%",
+"%%%%%#@ @%%%%%%%",
+"%%%#@ $%%%%%%%",
+"%%. %%%%%%%%",
+"%% $%%%%%%%%",
+"%%+ $%%%%%%%%%",
+"%%% .%%%%%%%%%%%",
+"%%%$ @#%%%%%%%%%%%%",
+"%%%% Xo%%%%%%%%%%%%%%",
+"%%%%O o%%%%%%%%%%%%%%%%",
+"%%%%% O%%%%%%%%%%%%%%%%%%",
+"%%%%%o $%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%@ +%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%o.%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-js3.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-js3.wxd
new file mode 100644
index 0000000000..dc83b5f27f
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-js3.wxd
@@ -0,0 +1,7 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 3 0 0 0 0 30 0 4 0 2 8 0 8 4 0 8 4
+ 1016000 6096000
+ 4826000 4064000
+ 1016000 2032000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-js3.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-js3.xpm
new file mode 100644
index 0000000000..6ad0940ea0
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-js3.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_js3[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 9 1",
+/* colors */
+" c #000000",
+". c #030303",
+"X c #5D5D5D",
+"o c #3C3C3C",
+"O c #858585",
+"+ c #2D2D2D",
+"@ c #0B0B0B",
+"# c #222222",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$X#$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$. #$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$X +$$$$$$$$$$$$$$$$$$$$",
+"$$$$$ o$$$$$$$$$$$$$$$$$$",
+"$$$$o X$$$$$$$$$$$$$$$$",
+"$$$$ .X$$$$$$$$$$$$$$",
+"$$$o @O$$$$$$$$$$$$",
+"$$$ @$$$$$$$$$$$",
+"$$+ +$$$$$$$$$$",
+"$$ +$$$$$$$$$$",
+"$$@ +$$$$$$$$$$",
+"$$$$@ +$$$$$$$$$$",
+"$$$$$X. +$$$$$$$$$$",
+"$$$$$O. +$$$$$$$$$$",
+"$$$$@ +$$$$$$$$$$",
+"$$@ +$$$$$$$$$$",
+"$$ +$$$$$$$$$$",
+"$$+ +$$$$$$$$$$",
+"$$$ @$$$$$$$$$$$",
+"$$$o @O$$$$$$$$$$$$",
+"$$$$ .X$$$$$$$$$$$$$$",
+"$$$$o X$$$$$$$$$$$$$$$$",
+"$$$$$ o$$$$$$$$$$$$$$$$$$",
+"$$$$$X +$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$. #$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$X#$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-lc1.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc1.wxd
new file mode 100644
index 0000000000..cd5da3c0a6
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc1.wxd
@@ -0,0 +1,22 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 30 0 4 0 0 8 0 8 4 0 8 4
+ 2032000 4064000
+ 6096000 4064000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 2032000 5588000
+ 1016000 7620000
+ 3048000 7620000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 6096000 5588000
+ 5080000 7620000
+ 7112000 7620000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 2032000 2540000
+ 1016000 508000
+ 3048000 508000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 6096000 2540000
+ 5080000 508000
+ 7112000 508000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-lc1.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc1.xpm
new file mode 100644
index 0000000000..a82526f25c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc1.xpm
@@ -0,0 +1,43 @@
+/* XPM */
+static const char *xpm_wxd_lc1[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 4 1",
+/* colors */
+" c #000000",
+". c #008F00",
+"X c #40AB40",
+"o c None",
+/* pixels */
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"ooooX......XooooooooX......Xoooo",
+"ooooo......oooooooooo......ooooo",
+"oooooX....XooooooooooX....Xooooo",
+"oooooo....oooooooooooo....oooooo",
+"ooooooX..XooooooooooooX..Xoooooo",
+"ooooooo..oooooooooooooo..ooooooo",
+"oooooooXXooooooooooooooXXooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooo oooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooXXooooooooooooooXXooooooo",
+"ooooooo..oooooooooooooo..ooooooo",
+"ooooooX..XooooooooooooX..Xoooooo",
+"oooooo....oooooooooooo....oooooo",
+"oooooX....XooooooooooX....Xooooo",
+"ooooo......oooooooooo......ooooo",
+"ooooX......XooooooooX......Xoooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-lc2.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc2.wxd
new file mode 100644
index 0000000000..3c348759ce
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc2.wxd
@@ -0,0 +1,22 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 30 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 4064000
+ 6096000 4064000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 2032000 5588000
+ 1016000 7620000
+ 3048000 7620000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 6096000 5588000
+ 5080000 7620000
+ 7112000 7620000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 2032000 2540000
+ 1016000 508000
+ 3048000 508000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 6096000 2540000
+ 5080000 508000
+ 7112000 508000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-lc2.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc2.xpm
new file mode 100644
index 0000000000..2ebe463cb9
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc2.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_lc2[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 9 1",
+/* colors */
+" c #000000",
+". c #373737",
+"X c #008F00",
+"o c #0A0A0A",
+"O c #0B0B0B",
+"+ c #2F2F2F",
+"@ c #0C0C0C",
+"# c #40AB40",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$#XXXXXX#$$$$$$$$#XXXXXX#$$$$",
+"$$$$$XXXXXX$$$$$$$$$$XXXXXX$$$$$",
+"$$$$$#XXXX#$$$$$$$$$$#XXXX#$$$$$",
+"$$$$$$XXXX$$$$$$$$$$$$XXXX$$$$$$",
+"$$$$$$#XX#$$$$$$$$$$$$#XX#$$$$$$",
+"$$$$$$$XX$$$$$$$$$$$$$$XX$$$$$$$",
+"$$$$$$$##$$$$$$$$$$$$$$##$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$.o o.$$$$$$",
+"$$$$+ +$$$$",
+"$$$+ +$$$",
+"$$$ $$$",
+"$$. .$$",
+"$$o o$$",
+"$$O @$$",
+"$$. .$$",
+"$$$ $$$",
+"$$$+ +$$$",
+"$$$$+ +$$$$",
+"$$$$$$.o o.$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$##$$$$$$$$$$$$$$##$$$$$$$",
+"$$$$$$$XX$$$$$$$$$$$$$$XX$$$$$$$",
+"$$$$$$#XX#$$$$$$$$$$$$#XX#$$$$$$",
+"$$$$$$XXXX$$$$$$$$$$$$XXXX$$$$$$",
+"$$$$$#XXXX#$$$$$$$$$$#XXXX#$$$$$",
+"$$$$$XXXXXX$$$$$$$$$$XXXXXX$$$$$",
+"$$$$#XXXXXX#$$$$$$$$#XXXXXX#$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-lc3.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc3.wxd
new file mode 100644
index 0000000000..81e703c552
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc3.wxd
@@ -0,0 +1,22 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 30 0 4 2 0 8 0 8 4 0 8 4
+ 2032000 4064000
+ 6096000 4064000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 2032000 5588000
+ 1016000 7620000
+ 3048000 7620000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 6096000 5588000
+ 5080000 7620000
+ 7112000 7620000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 2032000 2540000
+ 1016000 508000
+ 3048000 508000
+6 3 0 0 0 0 0 143 0 0 0 4 0 8 1
+ 6096000 2540000
+ 5080000 508000
+ 7112000 508000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-lc3.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc3.xpm
new file mode 100644
index 0000000000..f367a75975
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-lc3.xpm
@@ -0,0 +1,43 @@
+/* XPM */
+static const char *xpm_wxd_lc3[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 4 1",
+/* colors */
+" c #000000",
+". c #008F00",
+"X c #40AB40",
+"o c None",
+/* pixels */
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo",
+"ooooX......XooooooooX......Xoooo",
+"ooooo......oooooooooo......ooooo",
+"oooooX....XooooooooooX....Xooooo",
+"oooooo....oooooooooooo....oooooo",
+"ooooooX..XooooooooooooX..Xoooooo",
+"ooooooo..oooooooooooooo..ooooooo",
+"oooooooXXooooooooooooooXXooooooo",
+"oooooooooooooooooooooooooooooooo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oo oo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooXXooooooooooooooXXooooooo",
+"ooooooo..oooooooooooooo..ooooooo",
+"ooooooX..XooooooooooooX..Xoooooo",
+"oooooo....oooooooooooo....oooooo",
+"oooooX....XooooooooooX....Xooooo",
+"ooooo......oooooooooo......ooooo",
+"ooooX......XooooooooX......Xoooo",
+"oooooooooooooooooooooooooooooooo",
+"oooooooooooooooooooooooooooooooo"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls1.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls1.wxd
new file mode 100644
index 0000000000..e690a7bf70
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls1.wxd
@@ -0,0 +1,6 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+0 2 5
+3 2 0 0 0 0 16 0 4 1 0 8 0 8 4 0 8 4
+ 0 4064000
+ 12192000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls1.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls1.xpm
new file mode 100644
index 0000000000..ec856cf5bd
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls1.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_ls1[] = {
+/* width height ncolors chars_per_pixel */
+"48 32 2 1",
+/* colors */
+" c #000000",
+". c None",
+/* pixels */
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................",
+"................................................"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls2.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls2.wxd
new file mode 100644
index 0000000000..675f40d4d1
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls2.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+0 2 5
+3 2 0 0 0 0 16 0 3 1 0 8 0 8 4 0 8 4
+ -254000 4064000
+ 4826000 4064000
+3 2 0 0 0 0 16 0 3 1 0 8 0 8 4 0 8 4
+ 7620000 4064000
+ 12700000 4064000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls2.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls2.xpm
new file mode 100644
index 0000000000..5d76ce3d76
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls2.xpm
@@ -0,0 +1,42 @@
+/* XPM */
+static const char *xpm_wxd_ls2[] = {
+/* width height ncolors chars_per_pixel */
+"48 32 3 1",
+/* colors */
+" c #000000",
+". c #363636",
+"X c None",
+/* pixels */
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+" .XXXXXXX. ",
+" .XXXXX. ",
+" XXXXX ",
+" XXXXX ",
+" .XXXXX. ",
+" .XXXXXXX. ",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls3.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls3.wxd
new file mode 100644
index 0000000000..fabac40b40
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls3.wxd
@@ -0,0 +1,9 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+0 2 5
+9 0 0 0 0 0 0 0 2 0 4 1
+ 2032000 4064000 1016000
+9 0 0 0 0 0 0 0 2 0 4 1
+ 6350000 4064000 1016000
+9 0 0 0 0 0 0 0 2 0 4 1
+ 10160000 4064000 1016000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls3.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls3.xpm
new file mode 100644
index 0000000000..d5ad48701a
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls3.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_ls3[] = {
+/* width height ncolors chars_per_pixel */
+"48 32 9 1",
+/* colors */
+" c #000000",
+". c #5A5A5A",
+"X c #5B5B5B",
+"o c #5C5C5C",
+"O c #151515",
+"+ c #070707",
+"@ c #080808",
+"# c #090909",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$.O++O.$$$$$$$$$$$.O++O.$$$$$$$$$.O++O.$$$$$",
+"$$$$.# #X$$$$$$$$$.# #X$$$$$$$.# #X$$$$",
+"$$$$O O$$$$$$$$$O O$$$$$$$O O$$$$",
+"$$$$+ @$$$$$$$$$+ @$$$$$$$+ @$$$$",
+"$$$$+ @$$$$$$$$$+ @$$$$$$$+ @$$$$",
+"$$$$O O$$$$$$$$$O O$$$$$$$O O$$$$",
+"$$$$.# #X$$$$$$$$$.# #X$$$$$$$.# #X$$$$",
+"$$$$$XO@@Oo$$$$$$$$$$$XO@@Oo$$$$$$$$$XO@@Oo$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls4.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls4.wxd
new file mode 100644
index 0000000000..940f8692c5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls4.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+0 2 5
+3 2 0 0 0 0 25 0 4 1 0 8 0 8 4 0 8 4
+ 2032000 4064000
+ -1016000 4064000
+3 2 0 0 0 0 25 0 4 1 0 8 0 8 4 0 8 4
+ 13208000 4064000
+ 10160000 4064000
+13 1 0 0 0
+ 6096000 4064000 24
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls4.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls4.xpm
new file mode 100644
index 0000000000..d99cde2d4c
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls4.xpm
@@ -0,0 +1,51 @@
+/* XPM */
+static const char *xpm_wxd_ls4[] = {
+/* width height ncolors chars_per_pixel */
+"48 32 12 1",
+/* colors */
+" c #000000",
+". c #3F3F3F",
+"X c #404040",
+"o c #767676",
+"O c #414141",
+"+ c #0C0C0C",
+"@ c #777777",
+"# c #0D0D0D",
+"$ c #787878",
+"% c #0E0E0E",
+"& c #7A7A7A",
+"* c None",
+/* pixels */
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+" +O************o..@************O+ ",
+" &*********+ +*********& ",
+" ********+ #******** ",
+" O******o @******O ",
+" +******X O******+ ",
+" %******X O******# ",
+" O******@ $******O ",
+" ********+ #******** ",
+" &*********+ #*********& ",
+" +O************@XX$************O+ ",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************",
+"************************************************"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls5.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls5.wxd
new file mode 100644
index 0000000000..530575a084
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls5.wxd
@@ -0,0 +1,10 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+0 2 5
+3 2 0 0 0 0 25 0 4 1 0 8 0 8 4 0 8 4
+ 3556000 4064000
+ 508000 4064000
+13 1 0 0 0
+ 10922000 4064000 24
+13 1 0 0 0
+ 7366000 4064000 24
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls5.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls5.xpm
new file mode 100644
index 0000000000..ba8fb16e38
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls5.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_ls5[] = {
+/* width height ncolors chars_per_pixel */
+"48 32 9 1",
+/* colors */
+" c #000000",
+". c #404040",
+"X c #767676",
+"o c #414141",
+"O c #0C0C0C",
+"+ c #777777",
+"@ c #0D0D0D",
+"# c #797979",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"oO Oo$$$$$$$$$$$X..+$$$$$$$$$$X..+$$$",
+" #$$$$$$$$O O$$$$$$$$O O$$",
+" $$$$$$$O @$$$$$$O @$",
+" o$$$$$X +$$$$X +",
+" O$$$$$. o$$$$. o",
+" @$$$$$. o$$$$. o",
+" o$$$$$+ +$$$$+ +",
+" $$$$$$$O @$$$$$$O @$",
+" #$$$$$$$$O @$$$$$$$$O @$$",
+"oO Oo$$$$$$$$$$$+..+$$$$$$$$$$+..+$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls6.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls6.wxd
new file mode 100644
index 0000000000..71767da4b0
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls6.wxd
@@ -0,0 +1,12 @@
+WXD 1 0
+0 0 0 12192000 0 8128000
+0 2 5
+3 2 0 0 0 0 25 0 4 1 0 8 0 8 4 0 8 4
+ 254000 4064000
+ -2794000 4064000
+13 1 0 0 0
+ 10922000 4064000 24
+13 1 0 0 0
+ 7366000 4064000 24
+13 1 0 0 0
+ 3810000 4064000 24
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ls6.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls6.xpm
new file mode 100644
index 0000000000..7084ba0ffd
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ls6.xpm
@@ -0,0 +1,48 @@
+/* XPM */
+static const char *xpm_wxd_ls6[] = {
+/* width height ncolors chars_per_pixel */
+"48 32 9 1",
+/* colors */
+" c #000000",
+". c #404040",
+"X c #767676",
+"o c #414141",
+"O c #0C0C0C",
+"+ c #777777",
+"@ c #0D0D0D",
+"# c #787878",
+"$ c None",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+" Oo$$$$$$$$$$X..+$$$$$$$$$$X..+$$$$$$$$$$X..+$$$",
+" #$$$$$$$O O$$$$$$$$O O$$$$$$$$O O$$",
+" $$$$$$O @$$$$$$O @$$$$$$O @$",
+" o$$$$X +$$$$X +$$$$X +",
+" O$$$$. o$$$$. o$$$$. o",
+" @$$$$. o$$$$. o$$$$. o",
+" o$$$$+ #$$$$+ #$$$$+ #",
+" $$$$$$O @$$$$$$O @$$$$$$O @$",
+" #$$$$$$$O @$$$$$$$$O @$$$$$$$$O @$$",
+" Oo$$$$$$$$$$+..#$$$$$$$$$$+..#$$$$$$$$$$+..#$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ts00.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts00.wxd
new file mode 100644
index 0000000000..52115468da
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts00.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 7112000
+ 7112000 7112000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 5080000
+ 5080000 5080000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 3048000
+ 7112000 3048000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 1016000
+ 4064000 1016000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ts00.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts00.xpm
new file mode 100644
index 0000000000..6ebf8adfdb
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts00.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_ts00[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 2 1",
+/* colors */
+" c #000000",
+". c None",
+/* pixels */
+"................................",
+"................................",
+".... ....",
+".... ....",
+".... ....",
+".... ....",
+"................................",
+"................................",
+"................................",
+"................................",
+".... ............",
+".... ............",
+".... ............",
+".... ............",
+"................................",
+"................................",
+"................................",
+"................................",
+".... ....",
+".... ....",
+".... ....",
+".... ....",
+"................................",
+"................................",
+"................................",
+"................................",
+".... ................",
+".... ................",
+".... ................",
+".... ................",
+"................................",
+"................................"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ts01.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts01.wxd
new file mode 100644
index 0000000000..8f1f31a2fe
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts01.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 7112000
+ 7112000 7112000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 2032000 5080000
+ 6096000 5080000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 3048000
+ 7112000 3048000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 2540000 1016000
+ 5588000 1016000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ts01.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts01.xpm
new file mode 100644
index 0000000000..ad7d7ea011
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts01.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_ts01[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 2 1",
+/* colors */
+" c #000000",
+". c None",
+/* pixels */
+"................................",
+"................................",
+".... ....",
+".... ....",
+".... ....",
+".... ....",
+"................................",
+"................................",
+"................................",
+"................................",
+"........ ........",
+"........ ........",
+"........ ........",
+"........ ........",
+"................................",
+"................................",
+"................................",
+"................................",
+".... ....",
+".... ....",
+".... ....",
+".... ....",
+"................................",
+"................................",
+"................................",
+"................................",
+".......... ..........",
+".......... ..........",
+".......... ..........",
+".......... ..........",
+"................................",
+"................................"
+};
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ts02.wxd b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts02.wxd
new file mode 100644
index 0000000000..8ad4ffb4b8
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts02.wxd
@@ -0,0 +1,15 @@
+WXD 1 0
+0 0 0 8128000 0 8128000
+0 2 6
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 7112000
+ 7112000 7112000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 3048000 5080000
+ 7112000 5080000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 1016000 3048000
+ 7112000 3048000
+3 2 0 0 0 0 12 0 4 0 0 8 0 8 4 0 8 4
+ 4064000 1016000
+ 7112000 1016000
diff --git a/support/dktools/gui-img/wxdkdraw/styles/wxd-ts02.xpm b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts02.xpm
new file mode 100644
index 0000000000..4789b74ff5
--- /dev/null
+++ b/support/dktools/gui-img/wxdkdraw/styles/wxd-ts02.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static const char *xpm_wxd_ts02[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 2 1",
+/* colors */
+" c #000000",
+". c None",
+/* pixels */
+"................................",
+"................................",
+".... ....",
+".... ....",
+".... ....",
+".... ....",
+"................................",
+"................................",
+"................................",
+"................................",
+"............ ....",
+"............ ....",
+"............ ....",
+"............ ....",
+"................................",
+"................................",
+"................................",
+"................................",
+".... ....",
+".... ....",
+".... ....",
+".... ....",
+"................................",
+"................................",
+"................................",
+"................................",
+"................ ....",
+"................ ....",
+"................ ....",
+"................ ....",
+"................................",
+"................................"
+};
diff --git a/support/dktools/hbchm.c b/support/dktools/hbchm.c
index 866abe93f4..a00c0894c3 100644
--- a/support/dktools/hbchm.c
+++ b/support/dktools/hbchm.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbchm.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbchm.ctr
*/
/** @file hbchm.c The hbchm module.
@@ -450,6 +428,13 @@ hbchm_write_hhp(hb_job_t *job, int haveindex)
if(!(res)) { back = 0; }
fputs(hbchm_c8_kw[0], job->of);
}
+ if ((NULL != job->ptocjsfile) && (0 != job->ptocjsused)) {
+ res = dk3se_ansi_fputs(
+ job->ptocjsfile, dk3app_get_encoding(job->app), job->of, job->app
+ );
+ if(!(res)) { back = 0; }
+ fputs(hbchm_c8_kw[0], job->of);
+ }
#if (!(VERSION_BEFORE_20140416))
/* 2014-04-16
Write files section - HTML files not mentioned explicitly.
@@ -481,7 +466,7 @@ hbchm_write_hhp(hb_job_t *job, int haveindex)
if(!hbtool_add_file(job, (job->kwnl)[29])) { back = 0; }
}
-#line 386 "hbchm.ctr"
+#line 393 "hbchm.ctr"
return back;
}
@@ -504,7 +489,7 @@ hbchm_write_hhc(hb_job_t *job)
int back = 0;
-#line 407 "hbchm.ctr"
+#line 414 "hbchm.ctr"
job->of = dk3sf_fopen_app((job->kwnl)[28], (job->kwnl)[30], job->app);
if(job->of) {
back = 1;
@@ -559,7 +544,7 @@ hbchm_write_hhc(hb_job_t *job)
fputs(hbchm_c8_kw[40],job->of); fputs(hbchm_c8_kw[0],job->of);
} else {
-#line 460 "hbchm.ctr"
+#line 467 "hbchm.ctr"
}
dk3sto_it_reset(cnptr->i_subnodes);
nnptr = (hb_node_t *)dk3sto_it_next(cnptr->i_subnodes);
@@ -641,7 +626,7 @@ hbchm_write_hhc(hb_job_t *job)
if(!dk3sf_fclose_fn_app(job->of, (job->kwnl)[28], job->app)) { back = 0; }
}
-#line 540 "hbchm.ctr"
+#line 547 "hbchm.ctr"
return back;
}
@@ -659,7 +644,7 @@ hbchm_write_hhk(hb_job_t *job)
int back = 0;
-#line 556 "hbchm.ctr"
+#line 563 "hbchm.ctr"
job->of = dk3sf_fopen_app((job->kwnl)[29], (job->kwnl)[30], job->app);
if(job->of) {
back = 1;
@@ -693,7 +678,7 @@ hbchm_write_hhk(hb_job_t *job)
if(!dk3sf_fclose_fn_app(job->of, (job->kwnl)[29], job->app)) { back = 0; }
}
-#line 588 "hbchm.ctr"
+#line 595 "hbchm.ctr"
return back;
}
@@ -849,7 +834,7 @@ hbchm_write_project(hb_job_t *job)
int back = 1;
-#line 742 "hbchm.ctr"
+#line 749 "hbchm.ctr"
haveindex = hbchm_have_index_entries(job);
if(!hbchm_write_xml(job)) { back = 0; }
if(!hbchm_write_hhp(job, haveindex)) { back = 0; }
@@ -858,7 +843,7 @@ hbchm_write_project(hb_job_t *job)
if(!hbchm_write_hhk(job)) { back = 0; }
}
-#line 749 "hbchm.ctr"
+#line 756 "hbchm.ctr"
return back;
}
diff --git a/support/dktools/hbchm.ctr b/support/dktools/hbchm.ctr
index 5b35769bc1..f134eaa109 100644
--- a/support/dktools/hbchm.ctr
+++ b/support/dktools/hbchm.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -353,6 +353,13 @@ hbchm_write_hhp(hb_job_t *job, int haveindex)
if(!(res)) { back = 0; }
fputs(hbchm_c8_kw[0], job->of);
}
+ if ((NULL != job->ptocjsfile) && (0 != job->ptocjsused)) {
+ res = dk3se_ansi_fputs(
+ job->ptocjsfile, dk3app_get_encoding(job->app), job->of, job->app
+ );
+ if(!(res)) { back = 0; }
+ fputs(hbchm_c8_kw[0], job->of);
+ }
#if (!(VERSION_BEFORE_20140416))
/* 2014-04-16
Write files section - HTML files not mentioned explicitly.
diff --git a/support/dktools/hbchm.h b/support/dktools/hbchm.h
index 8debc4b18f..045f4d16f4 100644
--- a/support/dktools/hbchm.h
+++ b/support/dktools/hbchm.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbchm.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbchm.ctr
*/
/** @file hbchm.h Header file for the hbchm module.
diff --git a/support/dktools/hbconf.c b/support/dktools/hbconf.c
index aacf80d2c3..d4c6bc8a76 100644
--- a/support/dktools/hbconf.c
+++ b/support/dktools/hbconf.c
@@ -1,52 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbconf.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbconf.ctr
*/
/** @file hbconf.c The hbconf module.
*/
-#line 100 "hbconf.ctr"
+#line 105 "hbconf.ctr"
#include "dk3all.h"
#include "htmlbook.h"
+#include "dk3maihd.h"
-
-#line 107 "hbconf.ctr"
+#line 112 "hbconf.ctr"
@@ -176,10 +154,83 @@ dkT("code line numbers"),
/* 40 */
dkT("icon home"),
+/* 41 */
+dkT("mark external links"),
+
+/* 42 */
+dkT("external link marker symbol"),
+
+/* 43 */
+dkT("table summaries"),
+
+/* 44 */
+dkT("svg wh"),
+
+/* 45 */
+dkT("html doctype"),
+
+/* 46 */
+dkT("privacy link"),
+
+/* 47 */
+dkT("privacy page"),
+
+/* 48 */
+dkT("html lang"),
+
+/* 49 */
+dkT("async js file"),
+
+/* 50 */
+dkT("fold page toc"),
+
+/* 51 */
+dkT("page toc js file"),
+
NULL
-#line 279 "hbconf.ctr"
+#line 328 "hbconf.ctr"
+};
+
+
+
+/** Names for HTML doctypes. Must correspond to the enumeration
+ in the htmlbook header and the hbhtml_doctypes array in the
+ hbhtml module.
+*/
+dkChar const * const hbconf_doctype_names[] = {
+/* 0 */
+dkT("none"),
+
+/* 1 */
+dkT("html-5"),
+
+/* 2 */
+dkT("html-4.01-strict"),
+
+/* 3 */
+dkT("html-4.01-transitional"),
+
+/* 4 */
+dkT("html-4.01-frameset"),
+
+/* 5 */
+dkT("xhtml-1.0-strict"),
+
+/* 6 */
+dkT("xhtml-1.0-transitional"),
+
+/* 7 */
+dkT("xhtml-1.0-frameset"),
+
+/* 8 */
+dkT("xhtml-1.1"),
+
+NULL
+
+
+#line 348 "hbconf.ctr"
};
@@ -199,11 +250,28 @@ dkT("us-ascii"),
NULL
-#line 291 "hbconf.ctr"
+#line 360 "hbconf.ctr"
};
+void
+hbconf_write_external_marker_character(hb_job_t *job)
+{
+ char buf[8*sizeof(dk3_um_t)];
+
+ if (NULL != job) {
+ job->elmbuf[0] = '\0';
+ if (0UL < job->elmchr) {
+ if (0 != dk3ma_um_to_c8_hex_string(buf,sizeof(buf),job->elmchr,6)) {
+ dk3str_c8_cpy(&(job->elmbuf[0]), buf);
+ }
+ }
+ }
+}
+
+
+
/** Set jump node for the nodes parents.
@param nodeptr Text node.
*/
@@ -215,7 +283,7 @@ hbconf_set_jump_node(hb_node_t *nodeptr)
int cc; /* Flag: Can continue */
-#line 305 "hbconf.ctr"
+#line 391 "hbconf.ctr"
parent = nodeptr->parent;
cc = 1;
while(cc) {
@@ -235,11 +303,50 @@ hbconf_set_jump_node(hb_node_t *nodeptr)
}
}
-#line 323 "hbconf.ctr"
+#line 409 "hbconf.ctr"
}
+static
+void
+hbconf_change_external_marker_character(
+ hb_job_t *job,
+ dkChar *vp,
+ int *backptr
+)
+{
+ dk3_um_t um = (dk3_um_t)0UL;
+ int ec = 0;
+
+ if (0 != dk3ma_um_from_hex_string(&um, vp, &ec)) {
+ if ((dk3_um_t)0x01000000UL > um) {
+ job->elmchr = (unsigned long)um;
+ hbconf_write_external_marker_character(job);
+ }
+ else {
+ /* ERROR: Math overflow */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 101);
+ }
+ }
+ else {
+ switch (ec) {
+ case DK3_ERROR_MATH_OVERFLOW : {
+ /* ERROR: Math overflow */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 101);
+ } break;
+ default : {
+ /* ERROR: Syntax, not a hexadecimal number */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 100);
+ } break;
+ }
+ *backptr = -1;
+ }
+}
+
+
+
+
/** Process one configuration line from configuration file.
@param job Job structure.
@param il Input line to process.
@@ -261,7 +368,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
int back = 1;
-#line 347 "hbconf.ctr"
+#line 472 "hbconf.ctr"
kp = dk3str_start(il, NULL);
if(kp) {
if(dkT('#') != *kp) {
@@ -403,14 +510,14 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
ptr = dk3str_dup_app(vp,job->app);
if(ptr) {
dk3str_correct_filename(ptr);
- if((job->currentnode)->template) {
+ if((job->currentnode)->templatefi) {
if(0UL != (job->currentnode)->objno) {
/* Overwriting template */
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 73);
}
}
- dk3_release((job->currentnode)->template);
- (job->currentnode)->template = ptr;
+ dk3_release((job->currentnode)->templatefi);
+ (job->currentnode)->templatefi = ptr;
} else {
back = -1; /* REPORTED */
}
@@ -740,24 +847,24 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 25: {
-#line 824 "hbconf.ctr"
+#line 949 "hbconf.ctr"
if(job->currentnode) {
-#line 825 "hbconf.ctr"
+#line 950 "hbconf.ctr"
ap = dk3str_next(vp, NULL);
if(ap) {
-#line 827 "hbconf.ctr"
- kvp = dk3sto_it_find_like(
+#line 952 "hbconf.ctr"
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(
(job->currentnode)->i_variables, vp, 1
);
if(kvp) {
-#line 831 "hbconf.ctr"
+#line 956 "hbconf.ctr"
nc = dk3str_dup_app(ap, job->app);
if(nc) {
-#line 833 "hbconf.ctr"
+#line 958 "hbconf.ctr"
if(kvp->val) {
if(0UL != (job->currentnode)->objno) {
/* Overwriting var */
@@ -768,49 +875,49 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
kvp->val = nc;
} else {
-#line 842 "hbconf.ctr"
+#line 967 "hbconf.ctr"
back = -1; /* REPORTED */
}
} else {
-#line 845 "hbconf.ctr"
+#line 970 "hbconf.ctr"
kvp = dk3kv_new_app(vp, ap, job->app);
if(kvp) {
-#line 847 "hbconf.ctr"
+#line 972 "hbconf.ctr"
if(!(dk3sto_add((job->currentnode)->s_variables, kvp))) {
dk3kv_delete(kvp);
-#line 849 "hbconf.ctr"
+#line 974 "hbconf.ctr"
back = -1; /* REPORTED */
}
} else {
-#line 852 "hbconf.ctr"
+#line 977 "hbconf.ctr"
back = -1; /* REPORTED */
}
}
} else {
-#line 856 "hbconf.ctr"
- kvp = dk3sto_it_find_like(
+#line 981 "hbconf.ctr"
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(
(job->currentnode)->i_variables, vp, 1
);
if(kvp) {
-#line 860 "hbconf.ctr"
+#line 985 "hbconf.ctr"
dk3sto_remove((job->currentnode)->s_variables, kvp);
dk3kv_delete(kvp);
}
}
} else {
-#line 865 "hbconf.ctr"
+#line 990 "hbconf.ctr"
}
} break;
case 26: {
-#line 868 "hbconf.ctr"
+#line 993 "hbconf.ctr"
if(HB_SECTION_OPTIONS == st) {
ptr = dk3str_dup_app(vp, job->app);
if(ptr) {
@@ -826,17 +933,20 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 27: {
-#line 882 "hbconf.ctr"
+#line 1007 "hbconf.ctr"
if(HB_SECTION_OPTIONS == st) {
-#line 883 "hbconf.ctr"
+#line 1008 "hbconf.ctr"
job->impressumnode = hb_node_new(
job, job->rootnode, job->lineno, job->nextobj, 0
);
+
+
+#line 1012 "hbconf.ctr"
job->nextobj += 1UL;
if(job->impressumnode) {
-#line 888 "hbconf.ctr"
+#line 1014 "hbconf.ctr"
if((job->impressumnode)->depth > job->maxdepth) {
job->maxdepth = (job->impressumnode)->depth;
}
@@ -844,12 +954,12 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
if(dk3sto_add(job->s_nodes, (void *)(job->impressumnode))) {
-#line 894 "hbconf.ctr"
+#line 1020 "hbconf.ctr"
(job->impressumnode)->title =
dk3str_dup_app((job->msg)[0], job->app);
if((job->impressumnode)->title) {
-#line 897 "hbconf.ctr"
+#line 1023 "hbconf.ctr"
dk3str_correct_filename(vp);
if(!hbtool_check_filename(job, vp)) { back = -1; }
/* CHECK FILENAME CHARACTERS */
@@ -860,41 +970,41 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
}
} else {
-#line 906 "hbconf.ctr"
+#line 1032 "hbconf.ctr"
back = -1; /* REPORTED */
}
if(1 == back) {
-#line 909 "hbconf.ctr"
+#line 1035 "hbconf.ctr"
if(!dk3sto_add(job->s_pnodes,(void*)(job->impressumnode)))
{
-#line 911 "hbconf.ctr"
+#line 1037 "hbconf.ctr"
back = -1; /* REPORTED */
}
}
} else {
-#line 915 "hbconf.ctr"
+#line 1041 "hbconf.ctr"
hb_node_delete(job->impressumnode);
job->impressumnode = NULL;
back = -1; /* REPORTED */
}
} else {
-#line 920 "hbconf.ctr"
+#line 1046 "hbconf.ctr"
back = -1; /* REPORTED */
}
} else {
-#line 923 "hbconf.ctr"
+#line 1049 "hbconf.ctr"
/* ERROR: Only allowed in options section */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
}
} break;
case 28: {
-#line 928 "hbconf.ctr"
+#line 1054 "hbconf.ctr"
if(HB_SECTION_OPTIONS == st) {
if(dk3str_is_bool(vp)) {
if(dk3str_is_on(vp)) {
@@ -913,7 +1023,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 29: {
-#line 945 "hbconf.ctr"
+#line 1071 "hbconf.ctr"
if(HB_SECTION_OPTIONS == st) {
if(dk3str_is_bool(vp)) {
if(dk3str_is_on(vp)) {
@@ -932,7 +1042,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 30: {
-#line 962 "hbconf.ctr"
+#line 1088 "hbconf.ctr"
newie = dk3enc_get_text_encoding_app(vp, NULL);
if(0 <= newie) {
if(HB_SECTION_OPTIONS == st) {
@@ -955,7 +1065,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 31: {
-#line 983 "hbconf.ctr"
+#line 1109 "hbconf.ctr"
if(HB_SECTION_OPTIONS == st) {
ptr = dk3str_dup_app(vp, job->app);
if(ptr) {
@@ -971,7 +1081,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 32: {
-#line 997 "hbconf.ctr"
+#line 1123 "hbconf.ctr"
if((job->currentnode) && (vp)) {
if(!((job->currentnode)->s_jsfiles)) {
(job->currentnode)->s_jsfiles =
@@ -1018,7 +1128,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 33: {
-#line 1042 "hbconf.ctr"
+#line 1168 "hbconf.ctr"
if(vp) {
if(dk3str_is_bool(vp)) {
if(dk3str_is_on(vp)) {
@@ -1041,7 +1151,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 34: {
-#line 1063 "hbconf.ctr"
+#line 1189 "hbconf.ctr"
if(HB_SECTION_OPTIONS == st) {
if (vp) {
if (dk3str_is_bool(vp)) {
@@ -1064,7 +1174,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
} break;
case 35: {
-#line 1084 "hbconf.ctr"
+#line 1210 "hbconf.ctr"
if(HB_SECTION_OPTIONS == st) {
if (vp) {
if (dk3str_is_bool(vp)) {
@@ -1187,6 +1297,292 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
}
}
} break;
+ case 41 : {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ if(dk3str_is_bool(vp)) {
+ job->markel = dk3str_is_bool(vp);
+ }
+ else {
+ /* WARNING: Not a boolean value! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 144, vp);
+ }
+ }
+ else {
+ job->markel = 1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 42 : {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ hbconf_change_external_marker_character(job, vp, &back);
+ }
+ else {
+ job->elmchr = 0x01F310UL;
+ hbconf_write_external_marker_character(job);
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 43: {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ if(dk3str_is_bool(vp)) {
+ job->tabsum = dk3str_is_on(vp);
+ }
+ else {
+ /* WARNING: Not a boolean value! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 144, vp);
+ }
+ }
+ else {
+ job->tabsum = 1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 44: {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ if (dk3str_is_bool(vp)) {
+ job->svgwhdef = dk3str_is_on(vp);
+ }
+ else {
+ /* WARNING: Not a boolean value! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 144, vp);
+ }
+ }
+ else {
+ job->svgwhdef = 1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 45: {
+ if (NULL != vp) {
+ newie = dk3str_array_index(hbconf_doctype_names, vp, 0);
+ if (HTML_DOCTYPE_NONE <= newie) {
+ if (HB_SECTION_OPTIONS == st) {
+ if (HTML_DOCTYPE_UNSPECIFIED != job->htdt) {
+ /* WARNING Overwriting doctype */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 103);
+ }
+ job->htdt = newie;
+ }
+ else {
+ if (HB_SECTION_CONTENTS == st) {
+ if (NULL != job->currentnode) {
+ if (HTML_DOCTYPE_UNSPECIFIED != job->htdt) {
+ /* WARNING Overwriting doctype */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 103);
+ }
+ job->currentnode->htdt = newie;
+ }
+ }
+ }
+ }
+ else {
+ /* ERROR: Invalid doctype */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 102);
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 133, 134, kp);
+ }
+ } break;
+ case 46 : { /* privacy link */
+ if(HB_SECTION_OPTIONS == st) {
+ ptr = dk3str_dup_app(vp, job->app);
+ if (NULL != ptr) {
+ dk3_release(job->privacylink);
+ job->privacylink = ptr;
+ } else {
+ back = -1; /* REPORTED */
+ }
+ } else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 47 : { /* privacy page */
+ if(HB_SECTION_OPTIONS == st) {
+ job->privacynode = hb_node_new(
+ job, job->rootnode, job->lineno, job->nextobj, 0
+ );
+
+
+#line 1460 "hbconf.ctr"
+ job->nextobj += 1UL;
+ if (job->privacynode) {
+ if ((job->privacynode)->depth > job->maxdepth) {
+ job->maxdepth = (job->privacynode)->depth;
+ }
+ (job->privacynode)->options |= HB_NODE_OPT_PRIVACY;
+ if(dk3sto_add(job->s_nodes, (void *)(job->privacynode))) {
+ (job->privacynode)->shorttitle =
+ dk3str_dup_app((job->msg)[104], job->app);
+ (job->privacynode)->title =
+ dk3str_dup_app((job->msg)[105], job->app);
+ if ((job->privacynode)->title) {
+ dk3str_correct_filename(vp);
+ if (!(hbtool_check_filename(job, vp))) { back = -1; }
+ (job->privacynode)->filename =
+ dk3str_dup_app(vp, job->app);
+ if (!((job->privacynode)->filename)) {
+ back = -1;
+
+#line 1478 "hbconf.ctr"
+ }
+ } else {
+
+#line 1480 "hbconf.ctr"
+ back = -1; /* REPORTED */
+ }
+ if (1 == back) {
+ if(!dk3sto_add(job->s_pnodes,(void*)(job->privacynode)))
+ {
+
+#line 1485 "hbconf.ctr"
+ back = -1; /* REPORTED */
+ }
+ }
+ } else {
+
+#line 1489 "hbconf.ctr"
+ hb_node_delete(job->privacynode);
+ job->privacynode = NULL;
+ back = -1; /* REPORTED */
+ }
+ } else {
+
+#line 1494 "hbconf.ctr"
+ back = -1; /* REPORTED */
+ }
+ } else {
+
+#line 1497 "hbconf.ctr"
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 48 : {
+ if (HB_SECTION_OPTIONS == st) {
+ ptr = dk3str_dup_app(vp, job->app);
+ if (NULL != ptr) {
+ dk3_release(job->htmllang);
+ job->htmllang = ptr;
+ }
+ else {
+ back = -1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 49: {
+ if((job->currentnode) && (vp)) {
+ if(!((job->currentnode)->s_jsfiles)) {
+ (job->currentnode)->s_jsfiles =
+ dk3sto_open_app(job->app);
+ if((job->currentnode)->s_jsfiles) {
+ dk3sto_set_comp(
+ (job->currentnode)->s_jsfiles,
+ hbnode_link_compare, 2
+ );
+ }
+ }
+ if(!((job->currentnode)->i_jsfiles)) {
+ if((job->currentnode)->s_jsfiles) {
+ (job->currentnode)->i_jsfiles = dk3sto_it_open(
+ (job->currentnode)->s_jsfiles
+ );
+ }
+ }
+ if((job->currentnode)->s_jsfiles) {
+ if((job->currentnode)->i_jsfiles) {
+ linkptr = hbnode_link_new(
+ vp, (job->currentnode)->nextjs, job->app
+ );
+ if(linkptr) {
+ if(dk3sto_add((job->currentnode)->s_jsfiles, linkptr)) {
+ (job->currentnode)->nextjs += 1UL;
+ linkptr->flags |= LINK_FLAG_SCRIPT_ASYNC;
+ } else {
+ hbnode_link_delete(linkptr);
+ back = -1;
+ }
+ } else {
+ back = -1;
+ }
+ } else {
+ back = -1;
+ }
+ } else {
+ back = -1;
+ }
+ }
+ if(vp) {
+ if(!hbtool_add_url(job, vp)) { back = -1; }
+ }
+ } break;
+ case 50 : {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ if (dk3str_is_bool(vp)) {
+ if (0 != dk3str_is_on(vp)) {
+ job->options |= HB_JOB_OPT_FOLD_PTOC;
+ }
+ else {
+ job->options &= (~(HB_JOB_OPT_FOLD_PTOC));
+ }
+ }
+ else {
+ /* WARNING: Not a boolean value! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 144, vp);
+ }
+ }
+ else {
+ job->options |= HB_JOB_OPT_FOLD_PTOC;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 51 : { /* page toc js file */
+ if (HB_SECTION_OPTIONS == st) {
+ ptr = dk3str_dup_app(vp, job->app);
+ if (NULL != ptr) {
+ dk3_release(job->ptocjsfile);
+ job->ptocjsfile = ptr;
+ }
+ else {
+ back = -1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
default: {
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 43, 44, kp);
} break;
@@ -1201,15 +1597,15 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
}
} else {
-#line 1219 "hbconf.ctr"
+#line 1617 "hbconf.ctr"
}
} else {
-#line 1221 "hbconf.ctr"
+#line 1619 "hbconf.ctr"
}
-#line 1223 "hbconf.ctr"
+#line 1621 "hbconf.ctr"
return back;
}
@@ -1227,11 +1623,11 @@ hbconf_line_reader_handler(void *obj, dkChar *il)
int back;
-#line 1239 "hbconf.ctr"
+#line 1637 "hbconf.ctr"
back = hbconf_process_line((hb_job_t *)obj, il, HB_SECTION_OPTIONS);
-#line 1241 "hbconf.ctr"
+#line 1639 "hbconf.ctr"
return back;
}
@@ -1248,7 +1644,7 @@ hbconf_read_one_file(hb_job_t *job, dkChar const *fn)
int back = 0;
-#line 1256 "hbconf.ctr"
+#line 1654 "hbconf.ctr"
back = dk3stream_process_filename_lines_app(
(void *)job, hbconf_line_reader_handler, fn,
job->ilfile, job->bs,
@@ -1259,7 +1655,7 @@ hbconf_read_one_file(hb_job_t *job, dkChar const *fn)
if(1 != back) { back = 0; /* REPORTED */ }
-#line 1265 "hbconf.ctr"
+#line 1663 "hbconf.ctr"
return back;
}
@@ -1273,7 +1669,7 @@ hbconf_read_files(hb_job_t *job)
int back = 1;
-#line 1277 "hbconf.ctr"
+#line 1675 "hbconf.ctr"
sr = dk3app_find_config_file(job->app, (job->kwnl)[3], 0);
if(sr) {
dk3search_reset(sr);
@@ -1287,30 +1683,30 @@ hbconf_read_files(hb_job_t *job)
dk3search_close(sr);
}
-#line 1289 "hbconf.ctr"
+#line 1687 "hbconf.ctr"
return back;
}
dkChar const *
-hbconf_node_template(hb_job_t *job, hb_node_t *node)
+hbconf_node_template(hb_node_t *node)
{
dkChar const *back = NULL;
hb_node_t *nptr; /* Traverse node and parent nodes */
-#line 1300 "hbconf.ctr"
+#line 1698 "hbconf.ctr"
nptr = node;
while((nptr) && (NULL == back)) {
- if(nptr->template) {
- back = nptr->template;
+ if(nptr->templatefi) {
+ back = nptr->templatefi;
} else {
nptr = nptr->parent;
}
}
-#line 1308 "hbconf.ctr"
+#line 1706 "hbconf.ctr"
return back;
}
@@ -1323,7 +1719,7 @@ hbconf_node_icon(hb_job_t *job, hb_node_t *node, int icno)
hb_node_t *nptr; /* Traverse node and parent nodes */
-#line 1319 "hbconf.ctr"
+#line 1717 "hbconf.ctr"
nptr = node;
while((nptr) && (NULL == back)) {
switch(icno) {
@@ -1368,7 +1764,7 @@ hbconf_node_icon(hb_job_t *job, hb_node_t *node, int icno)
back = (job->kwnl)[4 + icno];
}
-#line 1362 "hbconf.ctr"
+#line 1760 "hbconf.ctr"
return back;
}
@@ -1380,7 +1776,7 @@ hbconf_title(hb_node_t *node)
dkChar const *back = NULL;
-#line 1372 "hbconf.ctr"
+#line 1770 "hbconf.ctr"
if (NULL != node->fulltitle) {
back = node->fulltitle;
} else {
@@ -1394,7 +1790,7 @@ hbconf_title(hb_node_t *node)
}
-#line 1384 "hbconf.ctr"
+#line 1782 "hbconf.ctr"
return back;
}
@@ -1406,7 +1802,7 @@ hbconf_stylefile(hb_node_t *node)
dkChar const *back = NULL;
-#line 1394 "hbconf.ctr"
+#line 1792 "hbconf.ctr"
while((NULL == back) && (node)) {
if(node->stylefile) {
back = node->stylefile;
@@ -1415,7 +1811,7 @@ hbconf_stylefile(hb_node_t *node)
}
}
-#line 1401 "hbconf.ctr"
+#line 1799 "hbconf.ctr"
return back;
}
@@ -1427,7 +1823,7 @@ hbconf_author(hb_node_t *node)
dkChar const *back = NULL;
-#line 1411 "hbconf.ctr"
+#line 1809 "hbconf.ctr"
while((NULL == back) && (node)) {
if(node->author) {
back = node->author;
@@ -1436,7 +1832,7 @@ hbconf_author(hb_node_t *node)
}
}
-#line 1418 "hbconf.ctr"
+#line 1816 "hbconf.ctr"
return back;
}
@@ -1448,7 +1844,7 @@ hbconf_location(hb_node_t *node)
dkChar const *back = NULL;
-#line 1428 "hbconf.ctr"
+#line 1826 "hbconf.ctr"
while((NULL == back) && (node)) {
if(node->location) {
back = node->location;
@@ -1457,7 +1853,7 @@ hbconf_location(hb_node_t *node)
}
}
-#line 1435 "hbconf.ctr"
+#line 1833 "hbconf.ctr"
return back;
}
@@ -1469,7 +1865,7 @@ hbconf_favicon(hb_node_t *node)
dkChar const *back = NULL;
-#line 1445 "hbconf.ctr"
+#line 1843 "hbconf.ctr"
while((NULL == back) && (node)) {
if(node->favicon) {
back = node->favicon;
@@ -1478,7 +1874,7 @@ hbconf_favicon(hb_node_t *node)
}
}
-#line 1452 "hbconf.ctr"
+#line 1850 "hbconf.ctr"
return back;
}
diff --git a/support/dktools/hbconf.ctr b/support/dktools/hbconf.ctr
index 5cacff78f2..9eda380076 100644
--- a/support/dktools/hbconf.ctr
+++ b/support/dktools/hbconf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -36,12 +36,11 @@ int
hbconf_process_line(hb_job_t *job, dkChar *il, int st);
/** Find template name for a node.
- @param job Job structure.
@param node Node to find template for.
@return Template file name on success, NULL on error.
*/
dkChar const *
-hbconf_node_template(hb_job_t *job, hb_node_t *node);
+hbconf_node_template(hb_node_t *node);
/** Find icon file name.
@param job Job structure.
@@ -92,6 +91,12 @@ hbconf_favicon(hb_node_t *node);
dkChar const *
hbconf_location(hb_node_t *node);
+/** Write external link character to elmbuf.
+ @param job Job structure containing elmchr and elmbuf.
+*/
+void
+hbconf_write_external_marker_character(hb_job_t *job);
+
#ifdef __cplusplus
}
#endif
@@ -100,7 +105,7 @@ hbconf_location(hb_node_t *node);
#include "dk3all.h"
#include "htmlbook.h"
-
+#include "dk3maihd.h"
$!trace-include
@@ -275,6 +280,70 @@ code line numbers
# 40
#
icon home
+#
+# 41
+#
+mark external links
+#
+# 42
+#
+external link marker symbol
+#
+# 43
+#
+table summaries
+#
+# 44
+#
+svg wh
+#
+# 45
+#
+html doctype
+#
+# 46
+#
+privacy link
+#
+# 47
+#
+privacy page
+#
+# 48
+#
+html lang
+#
+# 49
+#
+async js file
+#
+# 50
+#
+fold page toc
+#
+# 51
+#
+page toc js file
+$!end
+};
+
+
+
+/** Names for HTML doctypes. Must correspond to the enumeration
+ in the htmlbook header and the hbhtml_doctypes array in the
+ hbhtml module.
+*/
+dkChar const * const hbconf_doctype_names[] = {
+$!string-table macro=dkT
+none
+html-5
+html-4.01-strict
+html-4.01-transitional
+html-4.01-frameset
+xhtml-1.0-strict
+xhtml-1.0-transitional
+xhtml-1.0-frameset
+xhtml-1.1
$!end
};
@@ -292,6 +361,23 @@ $!end
+void
+hbconf_write_external_marker_character(hb_job_t *job)
+{
+ char buf[8*sizeof(dk3_um_t)];
+
+ if (NULL != job) {
+ job->elmbuf[0] = '\0';
+ if (0UL < job->elmchr) {
+ if (0 != dk3ma_um_to_c8_hex_string(buf,sizeof(buf),job->elmchr,6)) {
+ dk3str_c8_cpy(&(job->elmbuf[0]), buf);
+ }
+ }
+ }
+}
+
+
+
/** Set jump node for the nodes parents.
@param nodeptr Text node.
*/
@@ -324,6 +410,45 @@ hbconf_set_jump_node(hb_node_t *nodeptr)
+static
+void
+hbconf_change_external_marker_character(
+ hb_job_t *job,
+ dkChar *vp,
+ int *backptr
+)
+{
+ dk3_um_t um = (dk3_um_t)0UL;
+ int ec = 0;
+
+ if (0 != dk3ma_um_from_hex_string(&um, vp, &ec)) {
+ if ((dk3_um_t)0x01000000UL > um) {
+ job->elmchr = (unsigned long)um;
+ hbconf_write_external_marker_character(job);
+ }
+ else {
+ /* ERROR: Math overflow */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 101);
+ }
+ }
+ else {
+ switch (ec) {
+ case DK3_ERROR_MATH_OVERFLOW : {
+ /* ERROR: Math overflow */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 101);
+ } break;
+ default : {
+ /* ERROR: Syntax, not a hexadecimal number */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 100);
+ } break;
+ }
+ *backptr = -1;
+ }
+}
+
+
+
+
/** Process one configuration line from configuration file.
@param job Job structure.
@param il Input line to process.
@@ -485,14 +610,14 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
ptr = dk3str_dup_app(vp,job->app);
if(ptr) {
dk3str_correct_filename(ptr);
- if((job->currentnode)->template) {
+ if((job->currentnode)->templatefi) {
if(0UL != (job->currentnode)->objno) {
/* Overwriting template */
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 73);
}
}
- dk3_release((job->currentnode)->template);
- (job->currentnode)->template = ptr;
+ dk3_release((job->currentnode)->templatefi);
+ (job->currentnode)->templatefi = ptr;
} else {
back = -1; /* REPORTED */
}
@@ -824,7 +949,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
if(job->currentnode) { $? ". have current node"
ap = dk3str_next(vp, NULL);
if(ap) { $? ". value specified (add,change)"
- kvp = dk3sto_it_find_like(
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(
(job->currentnode)->i_variables, vp, 1
);
if(kvp) { $? ". existing value found, change"
@@ -853,7 +978,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
}
}
} else { $? ". no value (delete)"
- kvp = dk3sto_it_find_like(
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(
(job->currentnode)->i_variables, vp, 1
);
if(kvp) { $? ". found, removing"
@@ -883,6 +1008,7 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
job->impressumnode = hb_node_new(
job, job->rootnode, job->lineno, job->nextobj, 0
);
+ $? ". impressum node is %lu", (unsigned long)(job->nextobj)
job->nextobj += 1UL;
if(job->impressumnode) { $? ". impressumnode"
if((job->impressumnode)->depth > job->maxdepth) {
@@ -1203,6 +1329,278 @@ hbconf_process_line(hb_job_t *job, dkChar *il, int st)
}
}
} break;
+ case 41 : {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ if(dk3str_is_bool(vp)) {
+ job->markel = dk3str_is_bool(vp);
+ }
+ else {
+ /* WARNING: Not a boolean value! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 144, vp);
+ }
+ }
+ else {
+ job->markel = 1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 42 : {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ hbconf_change_external_marker_character(job, vp, &back);
+ }
+ else {
+ job->elmchr = 0x01F310UL;
+ hbconf_write_external_marker_character(job);
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 43: {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ if(dk3str_is_bool(vp)) {
+ job->tabsum = dk3str_is_on(vp);
+ }
+ else {
+ /* WARNING: Not a boolean value! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 144, vp);
+ }
+ }
+ else {
+ job->tabsum = 1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 44: {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ if (dk3str_is_bool(vp)) {
+ job->svgwhdef = dk3str_is_on(vp);
+ }
+ else {
+ /* WARNING: Not a boolean value! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 144, vp);
+ }
+ }
+ else {
+ job->svgwhdef = 1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 45: {
+ if (NULL != vp) {
+ newie = dk3str_array_index(hbconf_doctype_names, vp, 0);
+ if (HTML_DOCTYPE_NONE <= newie) {
+ if (HB_SECTION_OPTIONS == st) {
+ if (HTML_DOCTYPE_UNSPECIFIED != job->htdt) {
+ /* WARNING Overwriting doctype */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 103);
+ }
+ job->htdt = newie;
+ }
+ else {
+ if (HB_SECTION_CONTENTS == st) {
+ if (NULL != job->currentnode) {
+ if (HTML_DOCTYPE_UNSPECIFIED != job->htdt) {
+ /* WARNING Overwriting doctype */
+ dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 103);
+ }
+ job->currentnode->htdt = newie;
+ }
+ }
+ }
+ }
+ else {
+ /* ERROR: Invalid doctype */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 102);
+ }
+ }
+ else {
+ /* ERROR: Value required */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 133, 134, kp);
+ }
+ } break;
+ case 46 : { /* privacy link */
+ if(HB_SECTION_OPTIONS == st) {
+ ptr = dk3str_dup_app(vp, job->app);
+ if (NULL != ptr) {
+ dk3_release(job->privacylink);
+ job->privacylink = ptr;
+ } else {
+ back = -1; /* REPORTED */
+ }
+ } else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 47 : { /* privacy page */
+ if(HB_SECTION_OPTIONS == st) {
+ job->privacynode = hb_node_new(
+ job, job->rootnode, job->lineno, job->nextobj, 0
+ );
+ $? ". privacy node is %lu", (unsigned long)(job->nextobj)
+ job->nextobj += 1UL;
+ if (job->privacynode) {
+ if ((job->privacynode)->depth > job->maxdepth) {
+ job->maxdepth = (job->privacynode)->depth;
+ }
+ (job->privacynode)->options |= HB_NODE_OPT_PRIVACY;
+ if(dk3sto_add(job->s_nodes, (void *)(job->privacynode))) {
+ (job->privacynode)->shorttitle =
+ dk3str_dup_app((job->msg)[104], job->app);
+ (job->privacynode)->title =
+ dk3str_dup_app((job->msg)[105], job->app);
+ if ((job->privacynode)->title) {
+ dk3str_correct_filename(vp);
+ if (!(hbtool_check_filename(job, vp))) { back = -1; }
+ (job->privacynode)->filename =
+ dk3str_dup_app(vp, job->app);
+ if (!((job->privacynode)->filename)) {
+ back = -1; $? "! filename"
+ }
+ } else { $? "! title"
+ back = -1; /* REPORTED */
+ }
+ if (1 == back) {
+ if(!dk3sto_add(job->s_pnodes,(void*)(job->privacynode)))
+ { $? "! add"
+ back = -1; /* REPORTED */
+ }
+ }
+ } else { $? "! add"
+ hb_node_delete(job->privacynode);
+ job->privacynode = NULL;
+ back = -1; /* REPORTED */
+ }
+ } else { $? "! node allocation"
+ back = -1; /* REPORTED */
+ }
+ } else { $? "! wrong section"
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 48 : {
+ if (HB_SECTION_OPTIONS == st) {
+ ptr = dk3str_dup_app(vp, job->app);
+ if (NULL != ptr) {
+ dk3_release(job->htmllang);
+ job->htmllang = ptr;
+ }
+ else {
+ back = -1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 49: {
+ if((job->currentnode) && (vp)) {
+ if(!((job->currentnode)->s_jsfiles)) {
+ (job->currentnode)->s_jsfiles =
+ dk3sto_open_app(job->app);
+ if((job->currentnode)->s_jsfiles) {
+ dk3sto_set_comp(
+ (job->currentnode)->s_jsfiles,
+ hbnode_link_compare, 2
+ );
+ }
+ }
+ if(!((job->currentnode)->i_jsfiles)) {
+ if((job->currentnode)->s_jsfiles) {
+ (job->currentnode)->i_jsfiles = dk3sto_it_open(
+ (job->currentnode)->s_jsfiles
+ );
+ }
+ }
+ if((job->currentnode)->s_jsfiles) {
+ if((job->currentnode)->i_jsfiles) {
+ linkptr = hbnode_link_new(
+ vp, (job->currentnode)->nextjs, job->app
+ );
+ if(linkptr) {
+ if(dk3sto_add((job->currentnode)->s_jsfiles, linkptr)) {
+ (job->currentnode)->nextjs += 1UL;
+ linkptr->flags |= LINK_FLAG_SCRIPT_ASYNC;
+ } else {
+ hbnode_link_delete(linkptr);
+ back = -1;
+ }
+ } else {
+ back = -1;
+ }
+ } else {
+ back = -1;
+ }
+ } else {
+ back = -1;
+ }
+ }
+ if(vp) {
+ if(!hbtool_add_url(job, vp)) { back = -1; }
+ }
+ } break;
+ case 50 : {
+ if(HB_SECTION_OPTIONS == st) {
+ if (NULL != vp) {
+ if (dk3str_is_bool(vp)) {
+ if (0 != dk3str_is_on(vp)) {
+ job->options |= HB_JOB_OPT_FOLD_PTOC;
+ }
+ else {
+ job->options &= (~(HB_JOB_OPT_FOLD_PTOC));
+ }
+ }
+ else {
+ /* WARNING: Not a boolean value! */
+ dk3app_log_i3(job->app, DK3_LL_ERROR, 146, 144, vp);
+ }
+ }
+ else {
+ job->options |= HB_JOB_OPT_FOLD_PTOC;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
+ case 51 : { /* page toc js file */
+ if (HB_SECTION_OPTIONS == st) {
+ ptr = dk3str_dup_app(vp, job->app);
+ if (NULL != ptr) {
+ dk3_release(job->ptocjsfile);
+ job->ptocjsfile = ptr;
+ }
+ else {
+ back = -1;
+ }
+ }
+ else {
+ /* ERROR: Only allowed in options section */
+ dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
+ }
+ } break;
default: {
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 43, 44, kp);
} break;
@@ -1292,15 +1690,15 @@ hbconf_read_files(hb_job_t *job)
dkChar const *
-hbconf_node_template(hb_job_t *job, hb_node_t *node)
+hbconf_node_template(hb_node_t *node)
{
dkChar const *back = NULL;
hb_node_t *nptr; /* Traverse node and parent nodes */
$? "+ hbconf_node_template"
nptr = node;
while((nptr) && (NULL == back)) {
- if(nptr->template) {
- back = nptr->template;
+ if(nptr->templatefi) {
+ back = nptr->templatefi;
} else {
nptr = nptr->parent;
}
diff --git a/support/dktools/hbconf.h b/support/dktools/hbconf.h
index f98601f98c..6889969a3f 100644
--- a/support/dktools/hbconf.h
+++ b/support/dktools/hbconf.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbconf.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbconf.ctr
*/
/** @file hbconf.h Header file for the hbconf module.
@@ -72,12 +50,11 @@ int
hbconf_process_line(hb_job_t *job, dkChar *il, int st);
/** Find template name for a node.
- @param job Job structure.
@param node Node to find template for.
@return Template file name on success, NULL on error.
*/
dkChar const *
-hbconf_node_template(hb_job_t *job, hb_node_t *node);
+hbconf_node_template(hb_node_t *node);
/** Find icon file name.
@param job Job structure.
@@ -128,6 +105,12 @@ hbconf_favicon(hb_node_t *node);
dkChar const *
hbconf_location(hb_node_t *node);
+/** Write external link character to elmbuf.
+ @param job Job structure containing elmchr and elmbuf.
+*/
+void
+hbconf_write_external_marker_character(hb_job_t *job);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/hbcont.c b/support/dktools/hbcont.c
index 5f8663761b..b6182996b0 100644
--- a/support/dktools/hbcont.c
+++ b/support/dktools/hbcont.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbcont.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbcont.ctr
*/
/** @file hbcont.c The hbcont module.
@@ -41,12 +19,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "htmlbook.h"
+#include "hbhtml.h"
+#include "dk3unused.h"
-#line 65 "hbcont.ctr"
+#line 67 "hbcont.ctr"
@@ -251,10 +231,115 @@ static char const * const hbcont_c8_kw[] = {
/* 61 */
"#",
+/* 62 */
+"<table class=\"hb_pos_ta\">\n",
+
+/* 63 */
+"<table class=\"hb_ptoc_ta\">\n",
+
+/* 64 */
+"<table class=\"hb_link_ta\">\n",
+
+/* 65 */
+"<div class=\"hb_dtoc_div\">\n<table class=\"hb_dtoc_ta\">\n",
+
+/* 66 */
+"\n<!-- POSITION_START -->\n",
+
+/* 67 */
+"\n<!-- POSITION_END -->",
+
+/* 68 */
+"\n<!-- NODE_CONTENTS_START -->\n",
+
+/* 69 */
+"\n<!-- NODE_CONTENTS_END -->\n",
+
+/* 70 */
+"\n<!-- FILE_CONTENTS_START -->\n",
+
+/* 71 */
+"\n<!-- FILE_CONTENTS_END -->\n",
+
+/* 72 */
+"\n<!-- LINK_LIST_START -->\n",
+
+/* 73 */
+"\n<!-- LINK_LIST_END -->\n",
+
+/* 74 */
+"\n<!-- SITE_TOC_START -->\n",
+
+/* 75 */
+"\n<!-- SITE_TOC_END -->\n",
+
+/* 76 */
+"\n<!-- KEYWORD_INDEX_START -->\n",
+
+/* 77 */
+"\n<!-- KEYWORD_INDEX_END -->\n",
+
+/* 78 */
+"\n<!-- PAGE_TOC_START -->\n",
+
+/* 79 */
+"\n<!-- PAGE_TOC_END -->\n",
+
+/* 80 */
+"<h%u id=\"",
+
+/* 81 */
+"\">",
+
+/* 82 */
+"<h2 id=\"hb_toc\" class=\"hb_dtoc_h2\">",
+
+/* 83 */
+"<h2 id=\"hb_index\" class=\"hb_ki_h2\">",
+
+/* 84 */
+"<div class=\"hb_div_ptoc\" id=\"hb_div_ptoc\">\n",
+
+/* 85 */
+"</div><!-- hb_div_ptoc -->\n",
+
+/* 86 */
+"<div class=\"hb_div_ptoc_inner\" id=\"hb_div_ptoc_inner\">\n",
+
+/* 87 */
+"</div><!-- hb_div_ptoc_inner -->\n",
+
+/* 88 */
+"<form id=\"hb_ptoc_form\" class=\"hb_ptoc_form\">\n</form>\n",
+
+/* 89 */
+"UNUSED\t</span>\n",
+
+/* 90 */
+"<div class=\"hb_div_ptoc_header\" id=\"hb_div_ptoc_header\">",
+
+/* 91 */
+"</div><!-- hb_div_ptoc_header -->\n",
+
+/* 92 */
+"UNUSED\t<span class=\"hb_span_ptoc_button\" id=\"hb_span_ptoc_button\">",
+
+/* 93 */
+"UNUSED\t<span class=\"hb_span_ptoc_button_left\" id=\"hb_span_ptoc_button_left\">",
+
+/* 94 */
+"UNUSED\t<span class=\"hb_span_ptoc_button_text\" id=\"hb_span_ptoc_button_text\">",
+
+/* 95 */
+"UNUSED\t<span class=\"hb_span_ptoc_button_right\" id=\"hb_span_ptoc_button_right\">",
+
+/* 96 */
+"UNUSED\t</span>",
+
NULL
-#line 246 "hbcont.ctr"
+#line 326 "hbcont.ctr"
};
@@ -306,7 +391,7 @@ hbcont_line_delete(hb_line_t *lp)
{
-#line 296 "hbcont.ctr"
+#line 376 "hbcont.ctr"
if(lp) {
lp->aname = NULL;
lp->realtext = NULL;
@@ -318,7 +403,7 @@ hbcont_line_delete(hb_line_t *lp)
dk3_delete(lp);
}
-#line 306 "hbcont.ctr"
+#line 386 "hbcont.ctr"
}
@@ -329,7 +414,7 @@ hbcont_line_new(dkChar const *il, unsigned long lineno, dk3_app_t *app)
hb_line_t *back = NULL;
-#line 315 "hbcont.ctr"
+#line 395 "hbcont.ctr"
if(il) {
back = dk3_new_app(hb_line_t,1,app);
if(back) {
@@ -347,7 +432,7 @@ hbcont_line_new(dkChar const *il, unsigned long lineno, dk3_app_t *app)
}
}
-#line 331 "hbcont.ctr"
+#line 411 "hbcont.ctr"
return back;
}
@@ -361,14 +446,15 @@ hbcont_line_new(dkChar const *il, unsigned long lineno, dk3_app_t *app)
*/
static
int
-hbcont_line_compare(void const *l, void const *r, int cr)
+hbcont_line_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
hb_line_t *pl;
hb_line_t *pr;
int back = 0;
-#line 350 "hbcont.ctr"
+#line 430 "hbcont.ctr"
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (hb_line_t *)l;
@@ -385,7 +471,7 @@ hbcont_line_compare(void const *l, void const *r, int cr)
if(r) back = -1;
}
-#line 365 "hbcont.ctr"
+#line 446 "hbcont.ctr"
return back;
}
@@ -403,7 +489,7 @@ hbcont_prepare(hb_job_t *job)
int back = 0;
-#line 381 "hbcont.ctr"
+#line 462 "hbcont.ctr"
(job->currentnode)->s_lines = dk3sto_open_app(job->app);
if((job->currentnode)->s_lines) {
dk3sto_set_comp((job->currentnode)->s_lines, hbcont_line_compare, 0);
@@ -413,7 +499,7 @@ hbcont_prepare(hb_job_t *job)
}
}
-#line 389 "hbcont.ctr"
+#line 470 "hbcont.ctr"
return back;
}
@@ -429,7 +515,7 @@ hbcont_cleanup(hb_job_t *job)
hb_line_t *lp;
-#line 403 "hbcont.ctr"
+#line 484 "hbcont.ctr"
if((job->currentnode)->s_lines) {
if((job->currentnode)->i_lines) {
dk3sto_it_reset((job->currentnode)->i_lines);
@@ -445,7 +531,7 @@ hbcont_cleanup(hb_job_t *job)
(job->currentnode)->i_lines = NULL;
-#line 417 "hbcont.ctr"
+#line 498 "hbcont.ctr"
}
@@ -461,7 +547,7 @@ hbcont_check_header(dkChar *il)
int back = 0;
-#line 431 "hbcont.ctr"
+#line 512 "hbcont.ctr"
if(dkT('.') == *il) {
il++;
il = dk3str_start(il, NULL);
@@ -475,7 +561,7 @@ hbcont_check_header(dkChar *il)
}
}
-#line 443 "hbcont.ctr"
+#line 524 "hbcont.ctr"
return back;
}
@@ -533,7 +619,7 @@ hbcont_compare_metadata(const dkChar *il, const char *mdname)
int back = 0;
-#line 499 "hbcont.ctr"
+#line 580 "hbcont.ctr"
do {
if (*il < (dkChar)(*mdname)) {
back = -1;
@@ -547,7 +633,7 @@ hbcont_compare_metadata(const dkChar *il, const char *mdname)
} while(('\0' != *mdname) && (0 == back));
-#line 511 "hbcont.ctr"
+#line 592 "hbcont.ctr"
return back;
}
@@ -566,7 +652,7 @@ hbcont_find_metadata_index(const dkChar *il)
int curi = 0;
-#line 528 "hbcont.ctr"
+#line 609 "hbcont.ctr"
nptr = hbcont_metadata_names;
do {
if (0 == hbcont_compare_metadata(il, *(nptr++))) {
@@ -577,7 +663,7 @@ hbcont_find_metadata_index(const dkChar *il)
} while ((NULL != *nptr) && (-1 == back));
-#line 537 "hbcont.ctr"
+#line 618 "hbcont.ctr"
return back;
}
@@ -589,7 +675,7 @@ hbcont_metadata_index(const dkChar *il)
int back = -1;
-#line 547 "hbcont.ctr"
+#line 628 "hbcont.ctr"
if (NULL != il) {
if (dkT('.') == il[0]) {
back = hbcont_find_metadata_index(&(il[1]));
@@ -597,7 +683,7 @@ hbcont_metadata_index(const dkChar *il)
}
-#line 553 "hbcont.ctr"
+#line 634 "hbcont.ctr"
return back;
}
@@ -624,7 +710,7 @@ hbcont_line_handler(void *obj, dkChar *il)
dk3str_delnl(il);
-#line 578 "hbcont.ctr"
+#line 659 "hbcont.ctr"
proc = (hb_contents_line_processor_t *)obj;
proc->lineno += 1UL;
job = proc->job;
@@ -671,38 +757,38 @@ hbcont_line_handler(void *obj, dkChar *il)
back = 1;
} else {
-#line 623 "hbcont.ctr"
+#line 704 "hbcont.ctr"
/* ERROR: Missing heading text */
dk3app_log_1(job->app,DK3_LL_ERROR,job->msg,32);
}
} else {
-#line 627 "hbcont.ctr"
+#line 708 "hbcont.ctr"
/* ERROR: Missing closing @ */
dk3app_log_1(job->app,DK3_LL_ERROR,job->msg,33);
}
} else {
-#line 631 "hbcont.ctr"
+#line 712 "hbcont.ctr"
/* ERROR: No a name text */
dk3app_log_1(job->app,DK3_LL_ERROR,job->msg,34);
}
}
} else {
-#line 636 "hbcont.ctr"
+#line 717 "hbcont.ctr"
/* ERROR: No header level */
dk3app_log_1(job->app,DK3_LL_ERROR,job->msg,35);
}
} else {
-#line 640 "hbcont.ctr"
+#line 721 "hbcont.ctr"
/* ERROR: No header text */
dk3app_log_1(job->app,DK3_LL_ERROR,job->msg,32);
}
} else {
-#line 644 "hbcont.ctr"
+#line 725 "hbcont.ctr"
/* ERROR: Syntax, no text after dot */
dk3app_log_1(job->app,DK3_LL_ERROR,job->msg,36);
}
@@ -710,23 +796,23 @@ hbcont_line_handler(void *obj, dkChar *il)
}
} else {
-#line 650 "hbcont.ctr"
+#line 731 "hbcont.ctr"
/* 2016-10-24: Destroy line structure when failed to save.
*/
hbcont_line_delete(lptr);
}
} else {
-#line 655 "hbcont.ctr"
+#line 736 "hbcont.ctr"
}
} else {
-#line 657 "hbcont.ctr"
+#line 738 "hbcont.ctr"
back = 1;
}
-#line 660 "hbcont.ctr"
+#line 741 "hbcont.ctr"
return back;
}
@@ -746,7 +832,7 @@ hbcont_read(hb_job_t *job, hb_contents_line_processor_t *proc)
int back = 0;
-#line 678 "hbcont.ctr"
+#line 759 "hbcont.ctr"
inenc = dk3app_get_input_file_encoding(job->app);
if(0 <= job->iecmd) { inenc = job->iecmd; }
if(0 <= (job->currentnode)->inenc) { inenc = (job->currentnode)->inenc; }
@@ -760,7 +846,7 @@ hbcont_read(hb_job_t *job, hb_contents_line_processor_t *proc)
);
if(1 == res) { back = 1; }
-#line 690 "hbcont.ctr"
+#line 771 "hbcont.ctr"
} else {
if(0UL == (job->currentnode)->objno) {
back = 1;
@@ -782,7 +868,7 @@ hbcont_write_title(hb_job_t *job)
int back = 0;
-#line 710 "hbcont.ctr"
+#line 791 "hbcont.ctr"
fputs(hbcont_c8_kw[2], job->of);
if((job->currentnode)->title) {
if (((job->options) & HB_JOB_OPT_NUM_IN_PAGE_HEADER)) {
@@ -799,7 +885,7 @@ hbcont_write_title(hb_job_t *job)
fputs(hbcont_c8_kw[3], job->of);
-#line 725 "hbcont.ctr"
+#line 806 "hbcont.ctr"
return back;
}
@@ -821,7 +907,7 @@ hbcont_write_position(hb_job_t *job)
int back = 1;
-#line 745 "hbcont.ctr"
+#line 826 "hbcont.ctr"
nptr = job->rootnode;
while(nptr) {
if((nptr->parent) && (nptr->curchild)) {
@@ -833,10 +919,15 @@ hbcont_write_position(hb_job_t *job)
/* DEBUG */ fprintf(job->of , "<!-- maxl=%d -->\n", maxl);
#endif
if(0 < maxl) {
+ fputs(hbcont_c8_kw[66], job->of);
fputs(hbcont_c8_kw[49], job->of);
- fputs(hbcont_c8_kw[4], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[54])) { back = 1; }
- fputs(hbcont_c8_kw[46], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbcont_c8_kw[4], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[54])) { back = 1; }
+ fputs(hbcont_c8_kw[46], job->of);
+ } else {
+ fputs(hbcont_c8_kw[62], job->of);
+ }
fputs(hbcont_c8_kw[0], job->of);
nptr = job->rootnode;
while(nptr) {
@@ -882,10 +973,11 @@ hbcont_write_position(hb_job_t *job)
}
fputs(hbcont_c8_kw[5], job->of);
fputs(hbcont_c8_kw[30], job->of);
+ fputs(hbcont_c8_kw[67], job->of);
fputs(hbcont_c8_kw[0], job->of);
}
-#line 807 "hbcont.ctr"
+#line 894 "hbcont.ctr"
return back;
}
@@ -904,7 +996,7 @@ hbcont_write_anchor_name_for_header(hb_job_t *job, hb_line_t *lptr)
int back = 1;
-#line 824 "hbcont.ctr"
+#line 911 "hbcont.ctr"
if(lptr->aname) {
if(!hbhtml_url_output_for_text(job, lptr->aname)) {
back = 0;
@@ -919,7 +1011,7 @@ hbcont_write_anchor_name_for_header(hb_job_t *job, hb_line_t *lptr)
fputs(buffer, job->of);
}
-#line 837 "hbcont.ctr"
+#line 924 "hbcont.ctr"
return back;
}
@@ -951,12 +1043,14 @@ hbcont_write_contents(
unsigned hl = 0; /* Header level */
unsigned i = 0; /* Create spaces */
int tocpr = 0; /* Flag: Page TOC already printed */
+ int htdt = 0; /* Document type */
int back = 0;
-#line 870 "hbcont.ctr"
+#line 958 "hbcont.ctr"
if((job->options) & HB_JOB_OPT_CHM) { tocpr = 1; }
nptr = job->currentnode;
+ htdt = hbhtml_get_doctype(job, nptr);
i_toc = dk3sto_it_open(nptr->s_lines);
if(i_toc) {
dk3sto_it_reset(nptr->i_lines);
@@ -971,10 +1065,63 @@ hbcont_write_contents(
if((0 == tocpr) && ((nptr->options) & HB_NODE_OPT_PAGE_TOC)) {
tocpr = 1;
-#line 885 "hbcont.ctr"
- fputs(hbcont_c8_kw[17], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[55])) { back = 0; }
- fputs(hbcont_c8_kw[46], job->of);
+#line 974 "hbcont.ctr"
+ fputs(hbcont_c8_kw[78], job->of);
+
+ fputs(hbcont_c8_kw[84], job->of);
+ fputs(hbcont_c8_kw[90], job->of);
+#if 0
+
+
+ /*
+ Page content
+ */
+ fputs(hbcont_c8_kw[88], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[106])) { back = 0; }
+ fputs(hbcont_c8_kw[89], job->of);
+ fputs(hbcont_c8_kw[92], job->of);
+
+#if 0
+ /*
+ [
+ */
+ fputs(hbcont_c8_kw[93], job->of);
+ fputc('[', job->of);
+ fputs(hbcont_c8_kw[96], job->of);
+#endif
+
+ /*
+ show/hide
+ */
+ fputs(hbcont_c8_kw[94], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[108])) { back = 0; }
+ fputs(hbcont_c8_kw[96], job->of);
+
+#if 0
+ /*
+ ]
+ */
+ fputs(hbcont_c8_kw[95], job->of);
+ fputc(']', job->of);
+ fputs(hbcont_c8_kw[96], job->of);
+#endif
+
+ fputs(hbcont_c8_kw[96], job->of);
+
+
+#endif
+ fputs(hbcont_c8_kw[88], job->of);
+ fputs(hbcont_c8_kw[91], job->of);
+
+ fputs(hbcont_c8_kw[86], job->of);
+
+ if (0 != job->tabsum) {
+ fputs(hbcont_c8_kw[17], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[55])) { back = 0; }
+ fputs(hbcont_c8_kw[46], job->of);
+ } else {
+ fputs(hbcont_c8_kw[63], job->of);
+ }
fputs(hbcont_c8_kw[0], job->of);
do {
tocptr = (hb_line_t *)dk3sto_it_next(i_toc);
@@ -1016,6 +1163,9 @@ hbcont_write_contents(
}
} while(tocptr);
fputs(hbcont_c8_kw[18], job->of);
+ fputs(hbcont_c8_kw[87], job->of);
+ fputs(hbcont_c8_kw[85], job->of);
+ fputs(hbcont_c8_kw[79], job->of);
}
hl = 1 + lptr->headlevel;
if(6 < hl) {
@@ -1023,20 +1173,37 @@ hbcont_write_contents(
/* Warning: Header level corrected to 6! */
dk3app_log_1(job->app,DK3_LL_ERROR,job->msg,37);
}
- fprintf(job->of, hbcont_c8_kw[14], hl);
- if(!hbcont_write_anchor_name_for_header(job, lptr)) {
- back = 0;
+ if (HTML_DOCTYPE_5 == htdt) {
+ fprintf(job->of, hbcont_c8_kw[80], hl);
+ if(!hbcont_write_anchor_name_for_header(job, lptr)) {
+ back = 0;
-#line 939 "hbcont.ctr"
+#line 1085 "hbcont.ctr"
+ }
+ fputs(hbcont_c8_kw[81], job->of);
+ if(!hbhtml_output_for_text(job, lptr->realtext)) {
+ back = 0;
+
+#line 1089 "hbcont.ctr"
+ }
+ fprintf(job->of, hbcont_c8_kw[13], hl);
}
- fprintf(job->of, hbcont_c8_kw[15], hl);
- fprintf(job->of, hbcont_c8_kw[12], hl);
- if(!hbhtml_output_for_text(job, lptr->realtext)) {
- back = 0;
+ else {
+ fputs(hbcont_c8_kw[14], job->of);
+ if(!hbcont_write_anchor_name_for_header(job, lptr)) {
+ back = 0;
-#line 944 "hbcont.ctr"
+#line 1096 "hbcont.ctr"
+ }
+ fputs(hbcont_c8_kw[15], job->of);
+ fprintf(job->of, hbcont_c8_kw[12], hl);
+ if(!hbhtml_output_for_text(job, lptr->realtext)) {
+ back = 0;
+
+#line 1101 "hbcont.ctr"
+ }
+ fprintf(job->of, hbcont_c8_kw[13], hl);
}
- fprintf(job->of, hbcont_c8_kw[13], hl);
} else {
myproc.job = job;
myproc.in_template = 0;
@@ -1044,11 +1211,11 @@ hbcont_write_contents(
myproc.p = p;
myproc.n = n;
-#line 952 "hbcont.ctr"
+#line 1110 "hbcont.ctr"
if(1 != hbhtml_line_handler((void *)(&myproc), lptr->text)) {
back = 0;
-#line 954 "hbcont.ctr"
+#line 1112 "hbcont.ctr"
}
}
}
@@ -1056,7 +1223,7 @@ hbcont_write_contents(
dk3sto_it_close(i_toc);
}
-#line 960 "hbcont.ctr"
+#line 1118 "hbcont.ctr"
return back;
}
@@ -1075,16 +1242,20 @@ hbcont_write_link_list(hb_job_t *job)
int back = 1;
-#line 977 "hbcont.ctr"
+#line 1135 "hbcont.ctr"
nptr = job->currentnode;
if(nptr->nextlink) {
dk3sto_it_reset(nptr->i_lbylno);
fputs(hbcont_c8_kw[28], job->of);
if(!hbhtml_output_for_text(job, (job->msg)[23])) { back = 0; }
fputs(hbcont_c8_kw[29], job->of);
- fputs(hbcont_c8_kw[31], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[56])) { back = 0; }
- fputs(hbcont_c8_kw[46], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbcont_c8_kw[31], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[56])) { back = 0; }
+ fputs(hbcont_c8_kw[46], job->of);
+ } else {
+ fputs(hbcont_c8_kw[64], job->of);
+ }
fputs(hbcont_c8_kw[0], job->of);
while(NULL != (linkptr = (hb_link_t *)dk3sto_it_next(nptr->i_lbylno))) {
fputs(hbcont_c8_kw[33], job->of);
@@ -1102,7 +1273,7 @@ hbcont_write_link_list(hb_job_t *job)
fputs(hbcont_c8_kw[30], job->of);
}
-#line 1002 "hbcont.ctr"
+#line 1164 "hbcont.ctr"
return back;
}
@@ -1126,28 +1297,32 @@ hbcont_create_toc(hb_job_t *job)
int back = 1;
-#line 1024 "hbcont.ctr"
+#line 1186 "hbcont.ctr"
oldsourcefile = dk3app_get_source_file(job->app);
oldsourceline = dk3app_get_source_line(job->app);
dk3app_set_source_file(job->app, job->infilename);
dk3app_set_source_line(job->app, 0UL);
- fputs(hbcont_c8_kw[47], job->of);
+ fputs(hbcont_c8_kw[(HTML_DOCTYPE_5 == job->htdt) ? (82) : (47)], job->of);
if(!hbhtml_output_for_text(job, (job->msg)[45])) { back = 0; }
fputs(hbcont_c8_kw[48], job->of);
- fputs(hbcont_c8_kw[39], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[57])) { back = 0; }
- fputs(hbcont_c8_kw[46], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbcont_c8_kw[39], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[57])) { back = 0; }
+ fputs(hbcont_c8_kw[46], job->of);
+ } else {
+ fputs(hbcont_c8_kw[65], job->of);
+ }
fputs(hbcont_c8_kw[0], job->of);
nptr = job->rootnode;
while(nptr) {
-#line 1038 "hbcont.ctr"
+#line 1204 "hbcont.ctr"
dk3app_set_source_line(job->app, nptr->lineno);
switch(nptr->tocstate) {
case HB_TOC_STATE_INIT: {
-#line 1041 "hbcont.ctr"
+#line 1207 "hbcont.ctr"
if(nptr->parent) {
/* Write TOC entry */
dest = NULL;
@@ -1160,7 +1335,7 @@ hbcont_create_toc(hb_job_t *job)
}
if(dest) {
-#line 1052 "hbcont.ctr"
+#line 1218 "hbcont.ctr"
res =
hbhtml_create_output_filename(ofn,DK3_SIZEOF(ofn,dkChar),job,dest);
if(res) {
@@ -1192,7 +1367,7 @@ hbcont_create_toc(hb_job_t *job)
}
} else {
-#line 1082 "hbcont.ctr"
+#line 1248 "hbcont.ctr"
/* ERROR: No destination found */
back = 0;
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 51);
@@ -1203,8 +1378,8 @@ hbcont_create_toc(hb_job_t *job)
} break;
case HB_TOC_STATE_IN_PROGRESS: {
-#line 1091 "hbcont.ctr"
- nptr->curchild = dk3sto_it_next(nptr->i_subnodes);
+#line 1257 "hbcont.ctr"
+ nptr->curchild = (hb_node_t *)dk3sto_it_next(nptr->i_subnodes);
if(nptr->curchild) {
nptr = nptr->curchild;
} else {
@@ -1213,7 +1388,7 @@ hbcont_create_toc(hb_job_t *job)
} break;
case HB_TOC_STATE_FINISHED: {
-#line 1099 "hbcont.ctr"
+#line 1265 "hbcont.ctr"
nptr = nptr->parent;
} break;
}
@@ -1223,7 +1398,7 @@ hbcont_create_toc(hb_job_t *job)
dk3app_set_source_line(job->app, oldsourceline);
-#line 1107 "hbcont.ctr"
+#line 1273 "hbcont.ctr"
return back;
}
@@ -1248,18 +1423,18 @@ hbcont_create_keyword_index(hb_job_t *job)
int back = 1;
-#line 1130 "hbcont.ctr"
+#line 1296 "hbcont.ctr"
dk3sto_it_reset(job->i_index);
while(NULL != (cp = (hb_index_entry_t *)dk3sto_it_next(job->i_index))) {
-#line 1133 "hbcont.ctr"
+#line 1299 "hbcont.ctr"
if(!(hh2)) {
-#line 1134 "hbcont.ctr"
+#line 1300 "hbcont.ctr"
hh2 = 1;
fputs(hbcont_c8_kw[50], job->of);
- fputs(hbcont_c8_kw[51], job->of);
+ fputs(hbcont_c8_kw[(HTML_DOCTYPE_5 == job->htdt) ? (83) : (51)], job->of);
if(!hbhtml_output_for_text(job, (job->msg)[46])) { back = 0; }
fputs(hbcont_c8_kw[29], job->of);
fputs(hbcont_c8_kw[52], job->of);
@@ -1269,10 +1444,10 @@ hbcont_create_keyword_index(hb_job_t *job)
nkw = 0;
if(pp) {
-#line 1145 "hbcont.ctr"
+#line 1311 "hbcont.ctr"
if(dk3str_cmp(pp->tx, cp->tx)) {
-#line 1146 "hbcont.ctr"
+#line 1312 "hbcont.ctr"
nkw = 1;
fputs(hbcont_c8_kw[57], job->of);
}
@@ -1321,7 +1496,7 @@ hbcont_create_keyword_index(hb_job_t *job)
fputs(hbcont_c8_kw[0], job->of);
}
-#line 1193 "hbcont.ctr"
+#line 1359 "hbcont.ctr"
return back;
}
@@ -1336,7 +1511,7 @@ hbcont_process(hb_job_t *job, hb_node_t *p, hb_node_t *n)
int back = 0;
-#line 1206 "hbcont.ctr"
+#line 1372 "hbcont.ctr"
oldsourcefile = dk3app_get_source_file(job->app);
oldsourceline = dk3app_get_source_line(job->app);
proc.job = job;
@@ -1352,7 +1527,7 @@ hbcont_process(hb_job_t *job, hb_node_t *p, hb_node_t *n)
dk3app_set_source_line(job->app, 0UL);
if(hbcont_read(job, &proc)) {
back = 1;
-
+ fputs(hbcont_c8_kw[68], job->of);
/* For the root node we do not write a position.
*/
if((0UL != (job->currentnode)->objno) && ((job->currentnode)->filename)) {
@@ -1373,32 +1548,40 @@ hbcont_process(hb_job_t *job, hb_node_t *p, hb_node_t *n)
if((job->currentnode)->filename) {
dk3app_set_source_file(job->app, (job->currentnode)->filename);
dk3app_set_source_line(job->app, 0UL);
+ fputs(hbcont_c8_kw[70], job->of);
if(!hbcont_write_contents(job, &proc, p, n)) { back = 0; }
-
+ fputs(hbcont_c8_kw[71], job->of);
dk3app_set_source_file(job->app, (job->currentnode)->filename);
dk3app_set_source_line(job->app, 0UL);
if((job->currentnode)->nextlink) {
+ fputs(hbcont_c8_kw[72], job->of);
if(!hbcont_write_link_list(job)) { back = 0; }
+ fputs(hbcont_c8_kw[73], job->of);
}
}
if(0UL == (job->currentnode)->objno) {
-#line 1252 "hbcont.ctr"
+#line 1421 "hbcont.ctr"
if(!((job->options) & HB_JOB_OPT_CHM)) {
if((job->options) & HB_JOB_OPT_CREATE_TOC) {
-#line 1254 "hbcont.ctr"
+#line 1423 "hbcont.ctr"
+ fputs(hbcont_c8_kw[74], job->of);
if(!hbcont_create_toc(job)) { back = 0; }
+ fputs(hbcont_c8_kw[75], job->of);
}
if((job->options) & HB_JOB_OPT_CREATE_INDEX) {
-#line 1257 "hbcont.ctr"
+#line 1428 "hbcont.ctr"
/* Eventually create index */
+ fputs(hbcont_c8_kw[76], job->of);
if(!hbcont_create_keyword_index(job)) { back = 0; }
+ fputs(hbcont_c8_kw[77], job->of);
}
}
}
+ fputs(hbcont_c8_kw[69], job->of);
}
dk3app_set_source_file(job->app, job->infilename);
dk3app_set_source_line(job->app, (job->currentnode)->lineno);
@@ -1408,7 +1591,7 @@ hbcont_process(hb_job_t *job, hb_node_t *p, hb_node_t *n)
dk3app_set_source_line(job->app, oldsourceline);
-#line 1270 "hbcont.ctr"
+#line 1444 "hbcont.ctr"
return back;
}
diff --git a/support/dktools/hbcont.ctr b/support/dktools/hbcont.ctr
index a30e6f6c4a..7f581f5550 100644
--- a/support/dktools/hbcont.ctr
+++ b/support/dktools/hbcont.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -58,6 +58,8 @@ hbcont_metadata_length(size_t idx);
#include "dk3all.h"
#include "htmlbook.h"
+#include "hbhtml.h"
+#include "dk3unused.h"
@@ -242,6 +244,84 @@ hb_h
#
<a class="hb_ki_a" href="
\#
+#
+# 62 63 64 65
+#
+<table class="hb_pos_ta">\n
+<table class="hb_ptoc_ta">\n
+<table class="hb_link_ta">\n
+<div class="hb_dtoc_div">\n<table class="hb_dtoc_ta">\n
+#
+# 66 67
+#
+\n<!-- POSITION_START -->\n
+\n<!-- POSITION_END -->
+#
+# 68 69
+#
+\n<!-- NODE_CONTENTS_START -->\n
+\n<!-- NODE_CONTENTS_END -->\n
+#
+# 70 71
+#
+\n<!-- FILE_CONTENTS_START -->\n
+\n<!-- FILE_CONTENTS_END -->\n
+#
+# 72 73
+#
+\n<!-- LINK_LIST_START -->\n
+\n<!-- LINK_LIST_END -->\n
+#
+# 74 75
+#
+\n<!-- SITE_TOC_START -->\n
+\n<!-- SITE_TOC_END -->\n
+#
+# 76 77
+#
+\n<!-- KEYWORD_INDEX_START -->\n
+\n<!-- KEYWORD_INDEX_END -->\n
+#
+# 78 79
+#
+\n<!-- PAGE_TOC_START -->\n
+\n<!-- PAGE_TOC_END -->\n
+#
+# 80, 81
+#
+<h%u id="
+">
+#
+# 82
+#
+<h2 id="hb_toc" class="hb_dtoc_h2">
+#
+# 83
+#
+<h2 id="hb_index" class="hb_ki_h2">
+#
+# 84-87
+#
+<div class="hb_div_ptoc" id="hb_div_ptoc">\n
+</div><!-- hb_div_ptoc -->\n
+<div class="hb_div_ptoc_inner" id="hb_div_ptoc_inner">\n
+</div><!-- hb_div_ptoc_inner -->\n
+#
+# 88-91
+#
+# UNUSED <span class="hb_span_ptoc">
+<form id="hb_ptoc_form" class="hb_ptoc_form">\n</form>\n
+UNUSED </span>\n
+<div class="hb_div_ptoc_header" id="hb_div_ptoc_header">
+</div><!-- hb_div_ptoc_header -->\n
+#
+# 92-96
+#
+UNUSED <span class="hb_span_ptoc_button" id="hb_span_ptoc_button">
+UNUSED <span class="hb_span_ptoc_button_left" id="hb_span_ptoc_button_left">
+UNUSED <span class="hb_span_ptoc_button_text" id="hb_span_ptoc_button_text">
+UNUSED <span class="hb_span_ptoc_button_right" id="hb_span_ptoc_button_right">
+UNUSED </span>
$!end
};
@@ -341,12 +421,13 @@ hbcont_line_new(dkChar const *il, unsigned long lineno, dk3_app_t *app)
*/
static
int
-hbcont_line_compare(void const *l, void const *r, int cr)
+hbcont_line_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
hb_line_t *pl;
hb_line_t *pr;
int back = 0;
$? "+ hbcont_line_compare PTR=%d PTR=%d", TR_IPTR(l), TR_IPTR(r)
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (hb_line_t *)l;
@@ -753,10 +834,15 @@ hbcont_write_position(hb_job_t *job)
/* DEBUG */ fprintf(job->of , "<!-- maxl=%d -->\n", maxl);
#endif
if(0 < maxl) {
+ fputs(hbcont_c8_kw[66], job->of);
fputs(hbcont_c8_kw[49], job->of);
- fputs(hbcont_c8_kw[4], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[54])) { back = 1; }
- fputs(hbcont_c8_kw[46], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbcont_c8_kw[4], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[54])) { back = 1; }
+ fputs(hbcont_c8_kw[46], job->of);
+ } else {
+ fputs(hbcont_c8_kw[62], job->of);
+ }
fputs(hbcont_c8_kw[0], job->of);
nptr = job->rootnode;
while(nptr) {
@@ -802,6 +888,7 @@ hbcont_write_position(hb_job_t *job)
}
fputs(hbcont_c8_kw[5], job->of);
fputs(hbcont_c8_kw[30], job->of);
+ fputs(hbcont_c8_kw[67], job->of);
fputs(hbcont_c8_kw[0], job->of);
} $? "- hbcont_write_position %d", back
return back;
@@ -865,10 +952,12 @@ hbcont_write_contents(
unsigned hl = 0; /* Header level */
unsigned i = 0; /* Create spaces */
int tocpr = 0; /* Flag: Page TOC already printed */
+ int htdt = 0; /* Document type */
int back = 0;
$? "+ hbcont_write_contents \"%!ds\"", TR_STR((job->currentnode)->title)
if((job->options) & HB_JOB_OPT_CHM) { tocpr = 1; }
nptr = job->currentnode;
+ htdt = hbhtml_get_doctype(job, nptr);
i_toc = dk3sto_it_open(nptr->s_lines);
if(i_toc) {
dk3sto_it_reset(nptr->i_lines);
@@ -882,9 +971,62 @@ hbcont_write_contents(
/* Header line */
if((0 == tocpr) && ((nptr->options) & HB_NODE_OPT_PAGE_TOC)) {
tocpr = 1; $? ". print page TOC"
- fputs(hbcont_c8_kw[17], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[55])) { back = 0; }
- fputs(hbcont_c8_kw[46], job->of);
+ fputs(hbcont_c8_kw[78], job->of);
+
+ fputs(hbcont_c8_kw[84], job->of);
+ fputs(hbcont_c8_kw[90], job->of);
+#if 0
+
+
+ /*
+ Page content
+ */
+ fputs(hbcont_c8_kw[88], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[106])) { back = 0; }
+ fputs(hbcont_c8_kw[89], job->of);
+ fputs(hbcont_c8_kw[92], job->of);
+
+#if 0
+ /*
+ [
+ */
+ fputs(hbcont_c8_kw[93], job->of);
+ fputc('[', job->of);
+ fputs(hbcont_c8_kw[96], job->of);
+#endif
+
+ /*
+ show/hide
+ */
+ fputs(hbcont_c8_kw[94], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[108])) { back = 0; }
+ fputs(hbcont_c8_kw[96], job->of);
+
+#if 0
+ /*
+ ]
+ */
+ fputs(hbcont_c8_kw[95], job->of);
+ fputc(']', job->of);
+ fputs(hbcont_c8_kw[96], job->of);
+#endif
+
+ fputs(hbcont_c8_kw[96], job->of);
+
+
+#endif
+ fputs(hbcont_c8_kw[88], job->of);
+ fputs(hbcont_c8_kw[91], job->of);
+
+ fputs(hbcont_c8_kw[86], job->of);
+
+ if (0 != job->tabsum) {
+ fputs(hbcont_c8_kw[17], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[55])) { back = 0; }
+ fputs(hbcont_c8_kw[46], job->of);
+ } else {
+ fputs(hbcont_c8_kw[63], job->of);
+ }
fputs(hbcont_c8_kw[0], job->of);
do {
tocptr = (hb_line_t *)dk3sto_it_next(i_toc);
@@ -926,6 +1068,9 @@ hbcont_write_contents(
}
} while(tocptr);
fputs(hbcont_c8_kw[18], job->of);
+ fputs(hbcont_c8_kw[87], job->of);
+ fputs(hbcont_c8_kw[85], job->of);
+ fputs(hbcont_c8_kw[79], job->of);
}
hl = 1 + lptr->headlevel;
if(6 < hl) {
@@ -933,16 +1078,29 @@ hbcont_write_contents(
/* Warning: Header level corrected to 6! */
dk3app_log_1(job->app,DK3_LL_ERROR,job->msg,37);
}
- fprintf(job->of, hbcont_c8_kw[14], hl);
- if(!hbcont_write_anchor_name_for_header(job, lptr)) {
- back = 0; $? "! ERROR"
+ if (HTML_DOCTYPE_5 == htdt) {
+ fprintf(job->of, hbcont_c8_kw[80], hl);
+ if(!hbcont_write_anchor_name_for_header(job, lptr)) {
+ back = 0; $? "! ERROR"
+ }
+ fputs(hbcont_c8_kw[81], job->of);
+ if(!hbhtml_output_for_text(job, lptr->realtext)) {
+ back = 0; $? "! ERROR"
+ }
+ fprintf(job->of, hbcont_c8_kw[13], hl);
}
- fprintf(job->of, hbcont_c8_kw[15], hl);
- fprintf(job->of, hbcont_c8_kw[12], hl);
- if(!hbhtml_output_for_text(job, lptr->realtext)) {
- back = 0; $? "! ERROR"
+ else {
+ fputs(hbcont_c8_kw[14], job->of);
+ if(!hbcont_write_anchor_name_for_header(job, lptr)) {
+ back = 0; $? "! ERROR"
+ }
+ fputs(hbcont_c8_kw[15], job->of);
+ fprintf(job->of, hbcont_c8_kw[12], hl);
+ if(!hbhtml_output_for_text(job, lptr->realtext)) {
+ back = 0; $? "! ERROR"
+ }
+ fprintf(job->of, hbcont_c8_kw[13], hl);
}
- fprintf(job->of, hbcont_c8_kw[13], hl);
} else {
myproc.job = job;
myproc.in_template = 0;
@@ -980,9 +1138,13 @@ hbcont_write_link_list(hb_job_t *job)
fputs(hbcont_c8_kw[28], job->of);
if(!hbhtml_output_for_text(job, (job->msg)[23])) { back = 0; }
fputs(hbcont_c8_kw[29], job->of);
- fputs(hbcont_c8_kw[31], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[56])) { back = 0; }
- fputs(hbcont_c8_kw[46], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbcont_c8_kw[31], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[56])) { back = 0; }
+ fputs(hbcont_c8_kw[46], job->of);
+ } else {
+ fputs(hbcont_c8_kw[64], job->of);
+ }
fputs(hbcont_c8_kw[0], job->of);
while(NULL != (linkptr = (hb_link_t *)dk3sto_it_next(nptr->i_lbylno))) {
fputs(hbcont_c8_kw[33], job->of);
@@ -1025,12 +1187,16 @@ hbcont_create_toc(hb_job_t *job)
oldsourceline = dk3app_get_source_line(job->app);
dk3app_set_source_file(job->app, job->infilename);
dk3app_set_source_line(job->app, 0UL);
- fputs(hbcont_c8_kw[47], job->of);
+ fputs(hbcont_c8_kw[(HTML_DOCTYPE_5 == job->htdt) ? (82) : (47)], job->of);
if(!hbhtml_output_for_text(job, (job->msg)[45])) { back = 0; }
fputs(hbcont_c8_kw[48], job->of);
- fputs(hbcont_c8_kw[39], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[57])) { back = 0; }
- fputs(hbcont_c8_kw[46], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbcont_c8_kw[39], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[57])) { back = 0; }
+ fputs(hbcont_c8_kw[46], job->of);
+ } else {
+ fputs(hbcont_c8_kw[65], job->of);
+ }
fputs(hbcont_c8_kw[0], job->of);
nptr = job->rootnode;
while(nptr) {
@@ -1088,7 +1254,7 @@ hbcont_create_toc(hb_job_t *job)
nptr->tocstate = HB_TOC_STATE_IN_PROGRESS;
} break;
case HB_TOC_STATE_IN_PROGRESS: { $? ". continue node %lu", nptr->objno
- nptr->curchild = dk3sto_it_next(nptr->i_subnodes);
+ nptr->curchild = (hb_node_t *)dk3sto_it_next(nptr->i_subnodes);
if(nptr->curchild) {
nptr = nptr->curchild;
} else {
@@ -1133,7 +1299,7 @@ hbcont_create_keyword_index(hb_job_t *job)
if(!(hh2)) { $? ". no header yet, write header"
hh2 = 1;
fputs(hbcont_c8_kw[50], job->of);
- fputs(hbcont_c8_kw[51], job->of);
+ fputs(hbcont_c8_kw[(HTML_DOCTYPE_5 == job->htdt) ? (83) : (51)], job->of);
if(!hbhtml_output_for_text(job, (job->msg)[46])) { back = 0; }
fputs(hbcont_c8_kw[29], job->of);
fputs(hbcont_c8_kw[52], job->of);
@@ -1218,7 +1384,7 @@ hbcont_process(hb_job_t *job, hb_node_t *p, hb_node_t *n)
dk3app_set_source_line(job->app, 0UL);
if(hbcont_read(job, &proc)) {
back = 1;
-
+ fputs(hbcont_c8_kw[68], job->of);
/* For the root node we do not write a position.
*/
if((0UL != (job->currentnode)->objno) && ((job->currentnode)->filename)) {
@@ -1239,26 +1405,34 @@ hbcont_process(hb_job_t *job, hb_node_t *p, hb_node_t *n)
if((job->currentnode)->filename) {
dk3app_set_source_file(job->app, (job->currentnode)->filename);
dk3app_set_source_line(job->app, 0UL);
+ fputs(hbcont_c8_kw[70], job->of);
if(!hbcont_write_contents(job, &proc, p, n)) { back = 0; }
-
+ fputs(hbcont_c8_kw[71], job->of);
dk3app_set_source_file(job->app, (job->currentnode)->filename);
dk3app_set_source_line(job->app, 0UL);
if((job->currentnode)->nextlink) {
+ fputs(hbcont_c8_kw[72], job->of);
if(!hbcont_write_link_list(job)) { back = 0; }
+ fputs(hbcont_c8_kw[73], job->of);
}
}
if(0UL == (job->currentnode)->objno) { $? ". TOC node"
if(!((job->options) & HB_JOB_OPT_CHM)) {
if((job->options) & HB_JOB_OPT_CREATE_TOC) { $? ". create TOC"
+ fputs(hbcont_c8_kw[74], job->of);
if(!hbcont_create_toc(job)) { back = 0; }
+ fputs(hbcont_c8_kw[75], job->of);
}
if((job->options) & HB_JOB_OPT_CREATE_INDEX) { $? ". create index"
/* Eventually create index */
+ fputs(hbcont_c8_kw[76], job->of);
if(!hbcont_create_keyword_index(job)) { back = 0; }
+ fputs(hbcont_c8_kw[77], job->of);
}
}
}
+ fputs(hbcont_c8_kw[69], job->of);
}
dk3app_set_source_file(job->app, job->infilename);
dk3app_set_source_line(job->app, (job->currentnode)->lineno);
diff --git a/support/dktools/hbcont.h b/support/dktools/hbcont.h
index 9687703616..12ce1da5b7 100644
--- a/support/dktools/hbcont.h
+++ b/support/dktools/hbcont.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbcont.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbcont.ctr
*/
/** @file hbcont.h Header file for the hbcont module.
diff --git a/support/dktools/hbhtml.c b/support/dktools/hbhtml.c
index ab10885cda..f27fd0a3e2 100644
--- a/support/dktools/hbhtml.c
+++ b/support/dktools/hbhtml.c
@@ -1,243 +1,140 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbhtml.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbhtml.ctr
*/
/** @file hbhtml.c The hbhtml module.
*/
-/** @defgroup dkct_state_machine_hbhtml_stm1 The hbhtml_stm1 state machine. */
-/**@{*/
-
-#ifndef STM1_ST_BS
-/** State: Backslash found */
-#line 92 "hbhtml.ctr"
-#define STM1_ST_BS 0
-#else
-#line 92 "hbhtml.ctr"
-#error "Redefinition of STM1_ST_BS"
-#endif
-
-#ifndef STM1_ST_ERROR
-/** State: Error occured */
-#line 91 "hbhtml.ctr"
-#define STM1_ST_ERROR 1
-#else
-#line 91 "hbhtml.ctr"
-#error "Redefinition of STM1_ST_ERROR"
-#endif
-
-#ifndef STM1_ST_PERCENT
-/** State: One percent sign found */
-#line 93 "hbhtml.ctr"
-#define STM1_ST_PERCENT 2
-#else
-#line 93 "hbhtml.ctr"
-#error "Redefinition of STM1_ST_PERCENT"
-#endif
-
-#ifndef STM1_ST_SPECIAL
-/** State: Recording a special */
-#line 94 "hbhtml.ctr"
-#define STM1_ST_SPECIAL 3
-#else
-#line 94 "hbhtml.ctr"
-#error "Redefinition of STM1_ST_SPECIAL"
-#endif
-
-#ifndef STM1_ST_SPEC_BS
-/** State: Backslash found in special */
-#line 95 "hbhtml.ctr"
-#define STM1_ST_SPEC_BS 4
-#else
-#line 95 "hbhtml.ctr"
-#error "Redefinition of STM1_ST_SPEC_BS"
-#endif
-
-#ifndef STM1_ST_SPEC_PC
-/** State: Percent found in special */
-#line 96 "hbhtml.ctr"
-#define STM1_ST_SPEC_PC 5
-#else
-#line 96 "hbhtml.ctr"
-#error "Redefinition of STM1_ST_SPEC_PC"
-#endif
-
-#ifndef STM1_ST_START
-/** State: Start state */
-#line 90 "hbhtml.ctr"
-#define STM1_ST_START 6
-#else
-#line 90 "hbhtml.ctr"
-#error "Redefinition of STM1_ST_START"
-#endif
-
-#ifndef STM1_I_ANY
-/** State machine input: Any character */
-#line 99 "hbhtml.ctr"
-#define STM1_I_ANY 0
-#else
-#line 99 "hbhtml.ctr"
-#error "Redefinition of STM1_I_ANY"
-#endif
-
-#ifndef STM1_I_BS
-/** State machine input: Backslash */
-#line 100 "hbhtml.ctr"
-#define STM1_I_BS 1
-#else
-#line 100 "hbhtml.ctr"
-#error "Redefinition of STM1_I_BS"
-#endif
-
-#ifndef STM1_I_PERCENT
-/** State machine input: Percent sign */
-#line 101 "hbhtml.ctr"
-#define STM1_I_PERCENT 2
-#else
-#line 101 "hbhtml.ctr"
-#error "Redefinition of STM1_I_PERCENT"
-#endif
-
-#ifndef STM1_O_BS_SHIPOUT
-/** State machine output: Shipout character after backslash */
-#line 107 "hbhtml.ctr"
-#define STM1_O_BS_SHIPOUT 0
-#else
-#line 107 "hbhtml.ctr"
-#error "Redefinition of STM1_O_BS_SHIPOUT"
-#endif
-
-#ifndef STM1_O_ERROR
-/** State machine output: Error, do nothing */
-#line 104 "hbhtml.ctr"
-#define STM1_O_ERROR 1
-#else
+/** States for state machine hbhtml_stm1.
+*/
+enum {
+ /** State: Backslash found
+ */
+#line 103 "hbhtml.ctr"
+ STM1_ST_BS = 0,
+
+ /** State: Error occured
+ */
+#line 102 "hbhtml.ctr"
+ STM1_ST_ERROR = 1,
+
+ /** State: One percent sign found
+ */
#line 104 "hbhtml.ctr"
-#error "Redefinition of STM1_O_ERROR"
-#endif
-
-#ifndef STM1_O_EXECUTE
-/** State machine output: Execute special */
-#line 115 "hbhtml.ctr"
-#define STM1_O_EXECUTE 2
-#else
-#line 115 "hbhtml.ctr"
-#error "Redefinition of STM1_O_EXECUTE"
-#endif
+ STM1_ST_PERCENT = 2,
-#ifndef STM1_O_NOTHING
-/** State machine output: Do nothing */
-#line 105 "hbhtml.ctr"
-#define STM1_O_NOTHING 3
-#else
+ /** State: Recording a special
+ */
#line 105 "hbhtml.ctr"
-#error "Redefinition of STM1_O_NOTHING"
-#endif
+ STM1_ST_SPECIAL = 3,
-#ifndef STM1_O_PERCENT
-/** State machine output: Shipout just percent sign */
-#line 109 "hbhtml.ctr"
-#define STM1_O_PERCENT 4
-#else
-#line 109 "hbhtml.ctr"
-#error "Redefinition of STM1_O_PERCENT"
-#endif
-
-#ifndef STM1_O_PERCENT_SHIPOUT
-/** State machine output: Shipout percent sign and current character */
-#line 108 "hbhtml.ctr"
-#define STM1_O_PERCENT_SHIPOUT 5
-#else
-#line 108 "hbhtml.ctr"
-#error "Redefinition of STM1_O_PERCENT_SHIPOUT"
-#endif
-
-#ifndef STM1_O_SHIPOUT
-/** State machine output: Add character to shipout buffer */
-#line 106 "hbhtml.ctr"
-#define STM1_O_SHIPOUT 6
-#else
+ /** State: Backslash found in special
+ */
#line 106 "hbhtml.ctr"
-#error "Redefinition of STM1_O_SHIPOUT"
-#endif
+ STM1_ST_SPEC_BS = 4,
-#ifndef STM1_O_SPECIAL
-/** State machine output: Add current character to special */
-#line 111 "hbhtml.ctr"
-#define STM1_O_SPECIAL 7
-#else
-#line 111 "hbhtml.ctr"
-#error "Redefinition of STM1_O_SPECIAL"
-#endif
+ /** State: Percent found in special
+ */
+#line 107 "hbhtml.ctr"
+ STM1_ST_SPEC_PC = 5,
-#ifndef STM1_O_SPEC_BS
-/** State machine output: Add char after backslash to special */
-#line 112 "hbhtml.ctr"
-#define STM1_O_SPEC_BS 8
-#else
-#line 112 "hbhtml.ctr"
-#error "Redefinition of STM1_O_SPEC_BS"
-#endif
+ /** State: Start state
+ */
+#line 101 "hbhtml.ctr"
+ STM1_ST_START = 6
+};
-#ifndef STM1_O_SPEC_PC
-/** State machine output: Add percent sign to special */
-#line 114 "hbhtml.ctr"
-#define STM1_O_SPEC_PC 9
-#else
-#line 114 "hbhtml.ctr"
-#error "Redefinition of STM1_O_SPEC_PC"
-#endif
+/** Inputs for state machine hbhtml_stm1.
+*/
+enum {
+ /** State machine input: Any character
+ */
+#line 110 "hbhtml.ctr"
+ STM1_I_ANY = 0,
-#ifndef STM1_O_SPEC_PC_ADD
-/** State machine output: Add percent and current char to special */
-#line 113 "hbhtml.ctr"
-#define STM1_O_SPEC_PC_ADD 10
-#else
-#line 113 "hbhtml.ctr"
-#error "Redefinition of STM1_O_SPEC_PC_ADD"
-#endif
+ /** State machine input: Backslash
+ */
+#line 111 "hbhtml.ctr"
+ STM1_I_BS = 1,
-#ifndef STM1_O_SWITCH
-/** State machine output: Flush shipout and switch to saving special */
-#line 110 "hbhtml.ctr"
-#define STM1_O_SWITCH 11
-#else
-#line 110 "hbhtml.ctr"
-#error "Redefinition of STM1_O_SWITCH"
-#endif
+ /** State machine input: Percent sign
+ */
+#line 112 "hbhtml.ctr"
+ STM1_I_PERCENT = 2
+};
-/**@}*/
+/** Outputs for state machine hbhtml_stm1.
+*/
+enum {
+ /** State machine output: Shipout character after backslash
+ */
+#line 118 "hbhtml.ctr"
+ STM1_O_BS_SHIPOUT = 0,
+
+ /** State machine output: Error, do nothing
+ */
+#line 115 "hbhtml.ctr"
+ STM1_O_ERROR = 1,
+
+ /** State machine output: Execute special
+ */
+#line 126 "hbhtml.ctr"
+ STM1_O_EXECUTE = 2,
+
+ /** State machine output: Do nothing
+ */
+#line 116 "hbhtml.ctr"
+ STM1_O_NOTHING = 3,
+
+ /** State machine output: Shipout just percent sign
+ */
+#line 120 "hbhtml.ctr"
+ STM1_O_PERCENT = 4,
+
+ /** State machine output: Shipout percent sign and current character
+ */
+#line 119 "hbhtml.ctr"
+ STM1_O_PERCENT_SHIPOUT = 5,
+
+ /** State machine output: Add character to shipout buffer
+ */
+#line 117 "hbhtml.ctr"
+ STM1_O_SHIPOUT = 6,
+
+ /** State machine output: Add current character to special
+ */
+#line 122 "hbhtml.ctr"
+ STM1_O_SPECIAL = 7,
+
+ /** State machine output: Add char after backslash to special
+ */
+#line 123 "hbhtml.ctr"
+ STM1_O_SPEC_BS = 8,
+
+ /** State machine output: Add percent sign to special
+ */
+#line 125 "hbhtml.ctr"
+ STM1_O_SPEC_PC = 9,
+
+ /** State machine output: Add percent and current char to special
+ */
+#line 124 "hbhtml.ctr"
+ STM1_O_SPEC_PC_ADD = 10,
+
+ /** State machine output: Flush shipout and switch to saving special
+ */
+#line 121 "hbhtml.ctr"
+ STM1_O_SWITCH = 11
+};
/** Reset hbhtml_stm1 state machine.
@param st Pointer to state variable.
@@ -338,118 +235,77 @@ hbhtml_stm1_step(int *st, int in)
return back;
}
-/** @defgroup dkct_state_machine_hbhtml_stm3 The hbhtml_stm3 state machine. */
-/**@{*/
-
-#ifndef STM3_ST_COLON
-/** State: Colon found */
-#line 147 "hbhtml.ctr"
-#define STM3_ST_COLON 0
-#else
-#line 147 "hbhtml.ctr"
-#error "Redefinition of STM3_ST_COLON"
-#endif
-
-#ifndef STM3_ST_COLSL
-/** State: Colon and slash */
-#line 148 "hbhtml.ctr"
-#define STM3_ST_COLSL 1
-#else
-#line 148 "hbhtml.ctr"
-#error "Redefinition of STM3_ST_COLSL"
-#endif
-
-#ifndef STM3_ST_ERROR
-/** State: Not a protocol at start of text */
-#line 150 "hbhtml.ctr"
-#define STM3_ST_ERROR 2
-#else
-#line 150 "hbhtml.ctr"
-#error "Redefinition of STM3_ST_ERROR"
-#endif
-
-#ifndef STM3_ST_NAME
-/** State: ASCII characters (for protocol name) found */
-#line 146 "hbhtml.ctr"
-#define STM3_ST_NAME 3
-#else
-#line 146 "hbhtml.ctr"
-#error "Redefinition of STM3_ST_NAME"
-#endif
+/** States for state machine hbhtml_stm3.
+*/
+enum {
+ /** State: Colon found
+ */
+#line 158 "hbhtml.ctr"
+ STM3_ST_COLON = 0,
-#ifndef STM3_ST_START
-/** State: No character processed yet */
-#line 145 "hbhtml.ctr"
-#define STM3_ST_START 4
-#else
-#line 145 "hbhtml.ctr"
-#error "Redefinition of STM3_ST_START"
-#endif
+ /** State: Colon and slash
+ */
+#line 159 "hbhtml.ctr"
+ STM3_ST_COLSL = 1,
-#ifndef STM3_ST_SUCCESS
-/** State: Colon and two slashes found */
-#line 149 "hbhtml.ctr"
-#define STM3_ST_SUCCESS 5
-#else
-#line 149 "hbhtml.ctr"
-#error "Redefinition of STM3_ST_SUCCESS"
-#endif
+ /** State: Not a protocol at start of text
+ */
+#line 161 "hbhtml.ctr"
+ STM3_ST_ERROR = 2,
-#ifndef STM3_I_ANY
-/** State machine input: Anything not listed below */
-#line 152 "hbhtml.ctr"
-#define STM3_I_ANY 0
-#else
-#line 152 "hbhtml.ctr"
-#error "Redefinition of STM3_I_ANY"
-#endif
-
-#ifndef STM3_I_ASCII
-/** State machine input: a-zA-Z01-9_ */
-#line 153 "hbhtml.ctr"
-#define STM3_I_ASCII 1
-#else
-#line 153 "hbhtml.ctr"
-#error "Redefinition of STM3_I_ASCII"
-#endif
+ /** State: ASCII characters (for protocol name) found
+ */
+#line 157 "hbhtml.ctr"
+ STM3_ST_NAME = 3,
-#ifndef STM3_I_COLON
-/** State machine input: Colon */
-#line 154 "hbhtml.ctr"
-#define STM3_I_COLON 2
-#else
-#line 154 "hbhtml.ctr"
-#error "Redefinition of STM3_I_COLON"
-#endif
+ /** State: No character processed yet
+ */
+#line 156 "hbhtml.ctr"
+ STM3_ST_START = 4,
-#ifndef STM3_I_SLASH
-/** State machine input: Slash */
-#line 155 "hbhtml.ctr"
-#define STM3_I_SLASH 3
-#else
-#line 155 "hbhtml.ctr"
-#error "Redefinition of STM3_I_SLASH"
-#endif
-
-#ifndef STM3_O_ERROR
-/** State machine output: ERROR found */
-#line 158 "hbhtml.ctr"
-#define STM3_O_ERROR 0
-#else
-#line 158 "hbhtml.ctr"
-#error "Redefinition of STM3_O_ERROR"
-#endif
+ /** State: Colon and two slashes found
+ */
+#line 160 "hbhtml.ctr"
+ STM3_ST_SUCCESS = 5
+};
-#ifndef STM3_O_OK
-/** State machine output: OK so far */
-#line 157 "hbhtml.ctr"
-#define STM3_O_OK 1
-#else
-#line 157 "hbhtml.ctr"
-#error "Redefinition of STM3_O_OK"
-#endif
+/** Inputs for state machine hbhtml_stm3.
+*/
+enum {
+ /** State machine input: Anything not listed below
+ */
+#line 163 "hbhtml.ctr"
+ STM3_I_ANY = 0,
+
+ /** State machine input: a-zA-Z01-9_
+ */
+#line 164 "hbhtml.ctr"
+ STM3_I_ASCII = 1,
+
+ /** State machine input: Colon
+ */
+#line 165 "hbhtml.ctr"
+ STM3_I_COLON = 2,
+
+ /** State machine input: Slash
+ */
+#line 166 "hbhtml.ctr"
+ STM3_I_SLASH = 3
+};
-/**@}*/
+/** Outputs for state machine hbhtml_stm3.
+*/
+enum {
+ /** State machine output: ERROR found
+ */
+#line 169 "hbhtml.ctr"
+ STM3_O_ERROR = 0,
+
+ /** State machine output: OK so far
+ */
+#line 168 "hbhtml.ctr"
+ STM3_O_OK = 1
+};
/** Reset hbhtml_stm3 state machine.
@param st Pointer to state variable.
@@ -522,18 +378,19 @@ hbhtml_stm3_step(int *st, int in)
}
-#line 170 "hbhtml.ctr"
+#line 181 "hbhtml.ctr"
#include "dk3all.h"
#include "dk3strkv.h"
#include "htmlbook.h"
+#include "dk3enc.h"
-#line 179 "hbhtml.ctr"
+#line 191 "hbhtml.ctr"
@@ -865,10 +722,10 @@ static char const * const hbhtml_c8_kw[] = {
"</head>\n",
/* 17 */
-"<!-- Generated by htmlbook (see http://dktools.sourceforge.net) -->\n",
+"<!--\nGenerated by htmlbook (see http://sourceforge.net/p/dktools/wiki/htmlbook%20manual/)\n-->\n",
/* 18 */
-"<meta name=\"generator\" content=\"htmlbook\">\n",
+"<meta name=\"generator\" content=\"htmlbook (http://sourceforge.net/p/dktools/wiki/htmlbook/)\">\n",
/* 19 */
"<title>",
@@ -1156,7 +1013,7 @@ static char const * const hbhtml_c8_kw[] = {
"<br class=\"clearboth\">\n</p>\n",
/* 114 */
-"\n<object type=\"image/svg+xml\" data=\"",
+"<object type=\"image/svg+xml\" data=\"",
/* 115 */
"<param name=\"src\" value=\"",
@@ -1180,7 +1037,7 @@ static char const * const hbhtml_c8_kw[] = {
"<script src=\"",
/* 122 */
-"\" type=\"text/javascript\">\n</script>\n",
+"\" type=\"text/javascript\"></script>\n",
/* 123 */
"<link rel=\"",
@@ -1281,10 +1138,88 @@ static char const * const hbhtml_c8_kw[] = {
/* 155 */
"<meta name=\"keywords\" content=\"",
+/* 156 */
+"&#x",
+
+/* 157 */
+";&nbsp;",
+
+/* 158 */
+"<table class=\"hb_me_ta\">\n",
+
+/* 159 */
+"<table class=\"hb_img_ta\">\n",
+
+/* 160 */
+"<body bgcolor=\"#FFFFFF\">\n",
+
+/* 161 */
+"<html lang=\"",
+
+/* 162 */
+"\">\n",
+
+/* 163 */
+"<meta charset=\"utf-8\">\n",
+
+/* 164 */
+"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n",
+
+/* 165 */
+"<link rel=\"stylesheet\" href=\"",
+
+/* 166 */
+"\"></script>\n",
+
+/* 167 */
+"\" async></script>\n",
+
+/* 168 */
+"\" type=\"text/javascript\" async></script>\n",
+
+/* 169 */
+"<script type=\"text/javascript\" src=\"",
+
+/* 170 */
+"<script src=\"",
+
NULL
-#line 832 "hbhtml.ctr"
+#line 887 "hbhtml.ctr"
+};
+
+
+
+static const char * const hbhtml_doctypes[] = {
+/* 0 */
+"<!DOCTYPE html>\n",
+
+/* 1 */
+"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n",
+
+/* 2 */
+"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n",
+
+/* 3 */
+"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">\n",
+
+/* 4 */
+"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n",
+
+/* 5 */
+"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n",
+
+/* 6 */
+"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n",
+
+/* 7 */
+"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n",
+
+NULL
+
+
+#line 902 "hbhtml.ctr"
};
@@ -1346,7 +1281,7 @@ dkT("hint"),
NULL
-#line 909 "hbhtml.ctr"
+#line 979 "hbhtml.ctr"
};
@@ -1442,7 +1377,7 @@ dkT("f$ile"),
NULL
-#line 947 "hbhtml.ctr"
+#line 1017 "hbhtml.ctr"
};
@@ -1459,7 +1394,7 @@ dkT("ti$tle"),
NULL
-#line 958 "hbhtml.ctr"
+#line 1028 "hbhtml.ctr"
};
@@ -1476,7 +1411,7 @@ dkT("su$b"),
NULL
-#line 969 "hbhtml.ctr"
+#line 1039 "hbhtml.ctr"
};
@@ -1490,7 +1425,7 @@ dkT("i$tem"),
NULL
-#line 979 "hbhtml.ctr"
+#line 1049 "hbhtml.ctr"
};
@@ -1510,7 +1445,7 @@ dkT("ref$erence"),
NULL
-#line 991 "hbhtml.ctr"
+#line 1061 "hbhtml.ctr"
};
@@ -1533,7 +1468,7 @@ dkT("l$ineno"),
NULL
-#line 1004 "hbhtml.ctr"
+#line 1074 "hbhtml.ctr"
};
@@ -1558,7 +1493,7 @@ dkT("h$ome"),
NULL
-#line 1017 "hbhtml.ctr"
+#line 1087 "hbhtml.ctr"
};
@@ -1587,7 +1522,7 @@ dkT("l$ineno"),
NULL
-#line 1032 "hbhtml.ctr"
+#line 1102 "hbhtml.ctr"
};
@@ -1658,7 +1593,7 @@ dkT("ext$ernal"),
NULL
-#line 1061 "hbhtml.ctr"
+#line 1131 "hbhtml.ctr"
};
@@ -1681,7 +1616,7 @@ dkT("t$op"),
NULL
-#line 1074 "hbhtml.ctr"
+#line 1144 "hbhtml.ctr"
};
@@ -1695,7 +1630,7 @@ dkT("st$yle"),
NULL
-#line 1084 "hbhtml.ctr"
+#line 1154 "hbhtml.ctr"
};
@@ -1709,7 +1644,7 @@ dkT("tex"),
NULL
-#line 1094 "hbhtml.ctr"
+#line 1164 "hbhtml.ctr"
};
@@ -1729,7 +1664,7 @@ dkT(".svg"),
NULL
-#line 1106 "hbhtml.ctr"
+#line 1176 "hbhtml.ctr"
};
@@ -1747,12 +1682,12 @@ hbhtml_url_useable(dk3_c32_t c32)
int back = 1;
-#line 1122 "hbhtml.ctr"
+#line 1192 "hbhtml.ctr"
if((dk3_c32_t)255 < c32) {
back = 0; /* NOT REPORTED */
}
-#line 1125 "hbhtml.ctr"
+#line 1195 "hbhtml.ctr"
return back;
}
@@ -1770,7 +1705,7 @@ hbhtml_url_must_encode_normally(dk3_c32_t c32)
{
int back = 1;
char c;
- if((dk3_c32_t)128 > c32) {
+ if(128UL > dk3enc_uc_to_ul(c32)) {
c = (char)c32;
c &= 0x7F;
if(('a' <= c) && ('z' >= c)) {
@@ -1809,16 +1744,28 @@ hbhtml_url_must_encode(dk3_c32_t c32)
int back = 0;
-#line 1180 "hbhtml.ctr"
+#line 1250 "hbhtml.ctr"
if((dk3_c32_t)126 < c32) {
back = 1;
} else {
if((dk3_c32_t)33 > c32) {
back = 1;
+ } else {
+#if 0
+ /*
+ 2017-10-10 Removed. Must use &amp; instead of hex notation.
+ */
+ /*
+ 2017-10-03 Recode ampersand.
+ */
+ if (0x00000026UL == c32) {
+ back = 1;
+ }
+#endif
}
}
-#line 1187 "hbhtml.ctr"
+#line 1269 "hbhtml.ctr"
return back;
}
@@ -1845,14 +1792,19 @@ hbhtml_url_c32(hb_job_t *job, dk3_c32_t c32)
size_t i; /* Traverse ub */
-#line 1212 "hbhtml.ctr"
+#line 1294 "hbhtml.ctr"
if(hbhtml_url_useable(c32)) {
if(hbhtml_url_must_encode(c32)) {
buf[0] = '%';
sprintf(&(buf[1]), "%02X", (unsigned)c32);
fputs(buf, job->of);
} else {
- fputc((((char)c32) & ((char)0x7F)), job->of);
+ if ((dk3_c32_t)'&' == c32) {
+ fputc((((char)c32) & ((char)0x7F)), job->of);
+ }
+ else {
+ fputc((((char)c32) & ((char)0x7F)), job->of);
+ }
}
} else {
job->non_url = 1;
@@ -1864,7 +1816,7 @@ hbhtml_url_c32(hb_job_t *job, dk3_c32_t c32)
}
}
-#line 1229 "hbhtml.ctr"
+#line 1316 "hbhtml.ctr"
}
@@ -1895,7 +1847,7 @@ hbhtml_url_flush_shipout(hb_job_t *job)
#endif
-#line 1258 "hbhtml.ctr"
+#line 1345 "hbhtml.ctr"
if(job->shipused) {
job->non_url = 0;
if(job->shipused < job->bs) {
@@ -1936,11 +1888,11 @@ hbhtml_url_flush_shipout(hb_job_t *job)
#else
-#line 1297 "hbhtml.ctr"
+#line 1384 "hbhtml.ctr"
if(dk3app_get_encoding(job->app) == DK3_ENCODING_UTF8) {
-#line 1299 "hbhtml.ctr"
+#line 1386 "hbhtml.ctr"
sp = (unsigned char const *)(job->shipbuffer);
sl = job->shipused;
while(sl > 0) {
@@ -1978,7 +1930,7 @@ hbhtml_url_flush_shipout(hb_job_t *job)
}
-#line 1335 "hbhtml.ctr"
+#line 1422 "hbhtml.ctr"
#endif
if(job->non_url) {
/* WARNING: Non-URL characters in string! */
@@ -1990,7 +1942,7 @@ hbhtml_url_flush_shipout(hb_job_t *job)
job->shipused = 0;
-#line 1345 "hbhtml.ctr"
+#line 1432 "hbhtml.ctr"
}
@@ -2004,8 +1956,8 @@ hbhtml_c32(hb_job_t *job, dk3_c32_t c32)
char c; /* Current char from ub */
-#line 1357 "hbhtml.ctr"
- if(((dk3_c32_t)128) > c32) {
+#line 1444 "hbhtml.ctr"
+ if(128UL > dk3enc_uc_to_ul(c32)) {
c = (((char)c32) & ((char)0x7F));
switch(c) {
case '\n': {
@@ -2052,7 +2004,7 @@ hbhtml_c32(hb_job_t *job, dk3_c32_t c32)
if(hbhtml_translation_table[sz]) {
fputs(hbhtml_translation_table[sz], job->of);
} else {
- fprintf(job->of, "&#x%02lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%02lx;", dk3enc_uc_to_ul(c32));
}
} break;
}
@@ -2063,7 +2015,7 @@ hbhtml_c32(hb_job_t *job, dk3_c32_t c32)
if(hbhtml_translation_table[sz]) {
fputs(hbhtml_translation_table[sz], job->of);
} else {
- fprintf(job->of, "&#x%02lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%02lx;", dk3enc_uc_to_ul(c32));
}
} else {
if(HB_CS_UTF_8 == job->cs) {
@@ -2071,19 +2023,19 @@ hbhtml_c32(hb_job_t *job, dk3_c32_t c32)
for(i = 0; i < sz; i++) { fputc(ub[i], job->of); }
} else {
if(((dk3_c32_t)0x010000UL) > c32) {
- fprintf(job->of, "&#x%04lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%04lx;", dk3enc_uc_to_ul(c32));
} else {
if(((dk3_c32_t)0x01000000UL) > c32) {
- fprintf(job->of, "&#x%06lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%06lx;", dk3enc_uc_to_ul(c32));
} else {
- fprintf(job->of, "&#x%08lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%08lx;", dk3enc_uc_to_ul(c32));
}
}
}
}
}
-#line 1434 "hbhtml.ctr"
+#line 1521 "hbhtml.ctr"
}
@@ -2114,7 +2066,7 @@ hbhtml_flush_shipout(hb_job_t *job)
#endif
-#line 1463 "hbhtml.ctr"
+#line 1550 "hbhtml.ctr"
if(job->shipused) {
if(job->shipused < job->bs) {
(job->shipbuffer)[job->shipused] = dkT('\0');
@@ -2154,11 +2106,11 @@ hbhtml_flush_shipout(hb_job_t *job)
#else
-#line 1501 "hbhtml.ctr"
+#line 1588 "hbhtml.ctr"
if(dk3app_get_encoding(job->app) == DK3_ENCODING_UTF8) {
-#line 1503 "hbhtml.ctr"
+#line 1590 "hbhtml.ctr"
sp = (unsigned char const *)(job->shipbuffer);
sl = job->shipused;
while(sl > 0) {
@@ -2196,14 +2148,14 @@ hbhtml_flush_shipout(hb_job_t *job)
}
-#line 1539 "hbhtml.ctr"
+#line 1626 "hbhtml.ctr"
#endif
}
}
job->shipused = 0;
-#line 1544 "hbhtml.ctr"
+#line 1631 "hbhtml.ctr"
}
@@ -2220,7 +2172,7 @@ hbhtml_shipout(hb_job_t *job, dkChar c)
int back = 1;
-#line 1559 "hbhtml.ctr"
+#line 1646 "hbhtml.ctr"
if((job->shipused) < (job->bs - 1)) {
(job->shipbuffer)[job->shipused] = c;
job->shipused += 1;
@@ -2231,7 +2183,7 @@ hbhtml_shipout(hb_job_t *job, dkChar c)
back = 0;
}
-#line 1568 "hbhtml.ctr"
+#line 1655 "hbhtml.ctr"
return back;
}
@@ -2249,7 +2201,7 @@ hbhtml_add_to_special(hb_job_t *job, dkChar c)
int back = 1;
-#line 1584 "hbhtml.ctr"
+#line 1671 "hbhtml.ctr"
if((job->spused) < (job->bs - 1)) {
(job->special)[job->spused] = c;
job->spused += 1;
@@ -2260,7 +2212,7 @@ hbhtml_add_to_special(hb_job_t *job, dkChar c)
back = 0;
}
-#line 1593 "hbhtml.ctr"
+#line 1680 "hbhtml.ctr"
return back;
}
@@ -2303,12 +2255,12 @@ hbhtml_output_for_text(hb_job_t *job, dkChar const *text)
int back = 0;
-#line 1634 "hbhtml.ctr"
+#line 1721 "hbhtml.ctr"
if((job) && (text)) {
sz = dk3str_len(text);
if(sz < job->bs) {
-#line 1637 "hbhtml.ctr"
+#line 1724 "hbhtml.ctr"
#if VERSION_BEFORE_20131219
oldcode = (((job->options) & HB_JOB_OPT_CODE) ? 1 : 0);
job->options &= (~(HB_JOB_OPT_CODE));
@@ -2316,10 +2268,10 @@ hbhtml_output_for_text(hb_job_t *job, dkChar const *text)
dk3str_cpy(job->shipbuffer, text);
job->shipused = sz;
-#line 1643 "hbhtml.ctr"
+#line 1730 "hbhtml.ctr"
hbhtml_flush_shipout(job);
-#line 1644 "hbhtml.ctr"
+#line 1731 "hbhtml.ctr"
back = 1;
job->spused = 0;
job->shipused = 0;
@@ -2331,7 +2283,7 @@ hbhtml_output_for_text(hb_job_t *job, dkChar const *text)
}
}
-#line 1654 "hbhtml.ctr"
+#line 1741 "hbhtml.ctr"
return back;
}
@@ -2349,7 +2301,7 @@ hbhtml_url_output_for_text(hb_job_t *job, dkChar const *text)
int back = 0;
-#line 1670 "hbhtml.ctr"
+#line 1757 "hbhtml.ctr"
if((job) && (text)) {
sz = dk3str_len(text);
if(sz < job->bs) {
@@ -2362,7 +2314,7 @@ hbhtml_url_output_for_text(hb_job_t *job, dkChar const *text)
}
}
-#line 1681 "hbhtml.ctr"
+#line 1768 "hbhtml.ctr"
return back;
}
@@ -2379,20 +2331,20 @@ hbhtml_process_sp_title(hb_job_t *job)
int back = 0;
-#line 1696 "hbhtml.ctr"
+#line 1783 "hbhtml.ctr"
if(job->rootnode) {
-#line 1697 "hbhtml.ctr"
+#line 1784 "hbhtml.ctr"
if((job->rootnode)->title) {
-#line 1698 "hbhtml.ctr"
+#line 1785 "hbhtml.ctr"
if(hbhtml_output_for_text(job, (job->rootnode)->title)) {
back = 1;
}
}
}
-#line 1703 "hbhtml.ctr"
+#line 1790 "hbhtml.ctr"
return back;
}
@@ -2424,13 +2376,13 @@ hbhtml_sc_fn(
dkChar *sp;
-#line 1733 "hbhtml.ctr"
+#line 1820 "hbhtml.ctr"
-#line 1734 "hbhtml.ctr"
+#line 1821 "hbhtml.ctr"
-#line 1735 "hbhtml.ctr"
+#line 1822 "hbhtml.ctr"
back = oldname;
if(!(back)) {
/* Remove suffix if it matches subcommand.
@@ -2467,7 +2419,7 @@ hbhtml_sc_fn(
}
}
-#line 1770 "hbhtml.ctr"
+#line 1857 "hbhtml.ctr"
return back;
}
@@ -2477,12 +2429,11 @@ hbhtml_sc_fn(
@param job Job structure.
@param pa Pointer to arguments.
@param sc Subcommand, may be NULL.
- @param in_template Flag: Processing the template.
@return 1 on success, 0 on error.
*/
static
int
-hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
+hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc)
{
dkChar svgnbuf[DK3_MAX_PATH]; /* SVG file name */
dkChar pdfnbuf[DK3_MAX_PATH]; /* PDF file name */
@@ -2528,16 +2479,17 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
int fnerr = 0; /* Flag: Error related file */
-#line 1829 "hbhtml.ctr"
+#line 1915 "hbhtml.ctr"
sz = DK3_SIZEOF(kv,dk3_key_value_t);
svgnbuf[0] = pdfnbuf[0] = pngnbuf[0] = dkT('\0');
+ svgwh = job->svgwhdef;
if(dk3str_to_key_value(kv, &sz, pa, job->app)) {
-#line 1833 "hbhtml.ctr"
+#line 1920 "hbhtml.ctr"
if(sc) {
-#line 1834 "hbhtml.ctr"
+#line 1921 "hbhtml.ctr"
tispec = 1;
downlo = 1;
dodiv = 2;
@@ -2548,36 +2500,36 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
for(i = 0; i < sz; i++) {
if(kv[i].key) {
-#line 1843 "hbhtml.ctr"
+#line 1930 "hbhtml.ctr"
switch(dk3str_array_abbr(hbhtml_img_keys, kv[i].key, dkT('$'), 0)) {
case 0: {
-#line 1845 "hbhtml.ctr"
+#line 1932 "hbhtml.ctr"
align = kv[i].val;
} break;
case 1: {
-#line 1848 "hbhtml.ctr"
+#line 1935 "hbhtml.ctr"
alt = kv[i].val;
} break;
case 2: {
-#line 1851 "hbhtml.ctr"
+#line 1938 "hbhtml.ctr"
border = kv[i].val;
} break;
case 3: {
-#line 1854 "hbhtml.ctr"
+#line 1941 "hbhtml.ctr"
height = kv[i].val;
} break;
case 4: {
-#line 1857 "hbhtml.ctr"
+#line 1944 "hbhtml.ctr"
hspace = kv[i].val;
} break;
case 5: { /* ismap */
-#line 1860 "hbhtml.ctr"
+#line 1947 "hbhtml.ctr"
if(kv[i].val) {
if(dk3str_is_bool(kv[i].val)) {
if(dk3str_is_on(kv[i].val)) {
@@ -2592,47 +2544,47 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
} break;
case 6: {
-#line 1873 "hbhtml.ctr"
+#line 1960 "hbhtml.ctr"
longdesc = kv[i].val;
} break;
case 7: {
-#line 1876 "hbhtml.ctr"
+#line 1963 "hbhtml.ctr"
name = kv[i].val;
} break;
case 8: {
-#line 1879 "hbhtml.ctr"
+#line 1966 "hbhtml.ctr"
src = kv[i].val;
} break;
case 9: {
-#line 1882 "hbhtml.ctr"
+#line 1969 "hbhtml.ctr"
usemap = kv[i].val;
} break;
case 10: {
-#line 1885 "hbhtml.ctr"
+#line 1972 "hbhtml.ctr"
vspace = kv[i].val;
} break;
case 11: {
-#line 1888 "hbhtml.ctr"
+#line 1975 "hbhtml.ctr"
width = kv[i].val;
} break;
case 12: {
-#line 1891 "hbhtml.ctr"
+#line 1978 "hbhtml.ctr"
larger = kv[i].val;
} break;
case 13: {
-#line 1894 "hbhtml.ctr"
+#line 1981 "hbhtml.ctr"
pdf = kv[i].val;
} break;
case 14: { /* caching */
-#line 1897 "hbhtml.ctr"
+#line 1984 "hbhtml.ctr"
if(kv[i].val) {
if(dk3str_is_bool(kv[i].val)) {
if(dk3str_is_on(kv[i].val)) {
@@ -2647,18 +2599,18 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
} break;
case 15: {
-#line 1910 "hbhtml.ctr"
+#line 1997 "hbhtml.ctr"
title = kv[i].val;
tispec = 1;
} break;
case 16: {
-#line 1914 "hbhtml.ctr"
+#line 2001 "hbhtml.ctr"
clptr = kv[i].val;
} break;
case 17: {
-#line 1917 "hbhtml.ctr"
+#line 2004 "hbhtml.ctr"
idptr = kv[i].val;
} break;
case 18: { /* div */
@@ -2767,18 +2719,18 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
} break;
case 27: {
-#line 2024 "hbhtml.ctr"
+#line 2111 "hbhtml.ctr"
if(kv[i].val) {
if(fnptr) {
-#line 2026 "hbhtml.ctr"
+#line 2113 "hbhtml.ctr"
/* WARNING: Overwriting file setting! */
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 86);
}
fnptr = kv[i].val;
} else {
-#line 2031 "hbhtml.ctr"
+#line 2118 "hbhtml.ctr"
/* ERROR: No file name specified */
}
} break;
@@ -2787,7 +2739,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
}
if(fnptr) {
-#line 2038 "hbhtml.ctr"
+#line 2125 "hbhtml.ctr"
if(dk3str_len(fnptr) < DK3_SIZEOF(svgnbuf,dkChar)) {
dk3str_cpy(svgnbuf, fnptr);
dk3str_cpy(pdfnbuf, fnptr);
@@ -2817,17 +2769,17 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
if(0 == fnerr) { back = 1; }
if(larger) {
-#line 2066 "hbhtml.ctr"
+#line 2153 "hbhtml.ctr"
if(!hbtool_check_filename(job, larger)) { larger = NULL; }
}
if(pdf) {
-#line 2069 "hbhtml.ctr"
+#line 2156 "hbhtml.ctr"
if(!hbtool_check_filename(job, pdf)) { pdf = NULL; }
}
if(svg) {
-#line 2072 "hbhtml.ctr"
+#line 2159 "hbhtml.ctr"
if(!hbtool_check_filename(job, svg)) { svg = NULL; }
}
if(tispec) {
@@ -2873,9 +2825,13 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
/* div Open outer div */
fputs(hbhtml_c8_kw[((novsp) ? (145) : (109))], job->of);
/* table */
- fputs(hbhtml_c8_kw[138], job->of);
- hbhtml_output_for_text(job, (job->msg)[65]);
- fputs(hbhtml_c8_kw[143], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbhtml_c8_kw[138], job->of);
+ hbhtml_output_for_text(job, (job->msg)[65]);
+ fputs(hbhtml_c8_kw[143], job->of);
+ } else {
+ fputs(hbhtml_c8_kw[159], job->of);
+ }
/* tr */
fputs(hbhtml_c8_kw[139], job->of);
/* td */
@@ -3055,7 +3011,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
haveli = 0;
if(svg) {
-#line 2298 "hbhtml.ctr"
+#line 2389 "hbhtml.ctr"
haveli = 1;
fputs(hbhtml_c8_kw[68], job->of);
if(!hbhtml_url_output_for_text(job, svg)) { back = 0; }
@@ -3067,7 +3023,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
}
if(pdf) {
-#line 2308 "hbhtml.ctr"
+#line 2399 "hbhtml.ctr"
if(haveli) {
fputs(hbhtml_c8_kw[105], job->of);
}
@@ -3082,7 +3038,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
}
if(larger) {
-#line 2321 "hbhtml.ctr"
+#line 2412 "hbhtml.ctr"
if(haveli) {
fputs(hbhtml_c8_kw[105], job->of);
}
@@ -3142,7 +3098,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
haveli = 0;
if(svg) {
-#line 2379 "hbhtml.ctr"
+#line 2470 "hbhtml.ctr"
haveli = 1;
fputs(hbhtml_c8_kw[68], job->of);
if(!hbhtml_url_output_for_text(job, svg)) { back = 0; }
@@ -3154,7 +3110,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
}
if(pdf) {
-#line 2389 "hbhtml.ctr"
+#line 2480 "hbhtml.ctr"
if(haveli) {
fputs(hbhtml_c8_kw[105], job->of);
}
@@ -3169,7 +3125,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
}
if(larger) {
-#line 2402 "hbhtml.ctr"
+#line 2493 "hbhtml.ctr"
if(haveli) {
fputs(hbhtml_c8_kw[105], job->of);
}
@@ -3215,7 +3171,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 40);
}
-#line 2446 "hbhtml.ctr"
+#line 2537 "hbhtml.ctr"
return back;
}
@@ -3234,7 +3190,7 @@ hbhtml_link_to_current_node(hb_job_t *job, hb_node_t *nptr)
int back = 1;
-#line 2463 "hbhtml.ctr"
+#line 2554 "hbhtml.ctr"
p = nptr->shorttitle;
if(!(p)) { p = nptr->title; }
if(p) {
@@ -3253,10 +3209,10 @@ hbhtml_link_to_current_node(hb_job_t *job, hb_node_t *nptr)
} else {
back = 0;
-#line 2480 "hbhtml.ctr"
+#line 2571 "hbhtml.ctr"
}
-#line 2481 "hbhtml.ctr"
+#line 2572 "hbhtml.ctr"
return back;
}
@@ -3285,14 +3241,14 @@ hbhtml_write_link_start(
int back = 0;
-#line 2508 "hbhtml.ctr"
+#line 2599 "hbhtml.ctr"
if(dp) {
back = 1;
fputs(hbhtml_c8_kw[39], job->of);
if(!(hbhtml_url_output_for_text(job, dp))) {
back = 0;
-#line 2513 "hbhtml.ctr"
+#line 2604 "hbhtml.ctr"
}
fputs(hbhtml_c8_kw[42], job->of);
if(cl) {
@@ -3308,7 +3264,7 @@ hbhtml_write_link_start(
if(!(hbhtml_output_for_text(job, ti))) {
back = 0;
-#line 2527 "hbhtml.ctr"
+#line 2618 "hbhtml.ctr"
}
fputs(hbhtml_c8_kw[42], job->of);
}
@@ -3317,14 +3273,14 @@ hbhtml_write_link_start(
if(!(hbhtml_output_for_text(job, tp))) {
back = 0;
-#line 2534 "hbhtml.ctr"
+#line 2625 "hbhtml.ctr"
}
fputs(hbhtml_c8_kw[42], job->of);
}
fputs(hbhtml_c8_kw[40], job->of);
}
-#line 2539 "hbhtml.ctr"
+#line 2630 "hbhtml.ctr"
return back;
}
@@ -3340,7 +3296,7 @@ hbhtml_write_link_end(hb_job_t *job)
fputs(hbhtml_c8_kw[41], job->of);
-#line 2553 "hbhtml.ctr"
+#line 2644 "hbhtml.ctr"
}
@@ -3371,23 +3327,23 @@ hbhtml_write_link(
int back = 0;
-#line 2582 "hbhtml.ctr"
+#line 2673 "hbhtml.ctr"
if((tx) && (dp)) {
back = 1;
if(!(hbhtml_write_link_start(job, cl, ti, dp, tp, nptr))) {
back = 0;
-#line 2586 "hbhtml.ctr"
+#line 2677 "hbhtml.ctr"
}
if(!(hbhtml_output_for_text(job, tx))) {
back = 0;
-#line 2589 "hbhtml.ctr"
+#line 2680 "hbhtml.ctr"
}
hbhtml_write_link_end(job);
}
-#line 2592 "hbhtml.ctr"
+#line 2683 "hbhtml.ctr"
return back;
}
@@ -3407,12 +3363,12 @@ hbhtml_create_output_filename(
int back = 0;
-#line 2610 "hbhtml.ctr"
+#line 2701 "hbhtml.ctr"
if (nptr) {
dptr[0] = dkT('\0');
if(0UL == nptr->objno) {
-#line 2613 "hbhtml.ctr"
+#line 2704 "hbhtml.ctr"
if(dk3str_len((job->kwnl)[8]) < sz) {
dk3str_cpy(dptr, (job->kwnl)[8]);
back = 1;
@@ -3422,13 +3378,13 @@ hbhtml_create_output_filename(
}
} else {
-#line 2621 "hbhtml.ctr"
+#line 2712 "hbhtml.ctr"
if(nptr->filename) {
-#line 2622 "hbhtml.ctr"
+#line 2713 "hbhtml.ctr"
if(dk3str_len(nptr->filename) < sz) {
-#line 2623 "hbhtml.ctr"
+#line 2714 "hbhtml.ctr"
dk3str_cpy(dptr, nptr->filename);
p1 = dk3str_get_suffix(dptr);
if(p1) {
@@ -3445,7 +3401,7 @@ hbhtml_create_output_filename(
back = 1;
} else {
-#line 2638 "hbhtml.ctr"
+#line 2729 "hbhtml.ctr"
/* ERROR: File name too long! */
dk3app_log_i3(job->app, DK3_LL_ERROR, 65, 66, nptr->filename);
}
@@ -3462,31 +3418,31 @@ hbhtml_create_output_filename(
back = 1;
} else {
-#line 2653 "hbhtml.ctr"
+#line 2744 "hbhtml.ctr"
/* File name too long! */
dk3app_log_i3(job->app, DK3_LL_ERROR, 65, 66, nptr->filename);
}
}
} else {
-#line 2658 "hbhtml.ctr"
+#line 2749 "hbhtml.ctr"
/* ERROR: Input file name too long! */
dk3app_log_i3(job->app, DK3_LL_ERROR, 65, 66, nptr->filename);
}
} else {
-#line 2662 "hbhtml.ctr"
+#line 2753 "hbhtml.ctr"
/* ERROR: No source file name! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
}
}
} else {
-#line 2667 "hbhtml.ctr"
+#line 2758 "hbhtml.ctr"
}
-#line 2669 "hbhtml.ctr"
+#line 2760 "hbhtml.ctr"
return back;
}
@@ -3509,7 +3465,7 @@ hbhtml_link_to_node(hb_job_t *job, hb_node_t *nptr, int bold)
int back = 0;
-#line 2690 "hbhtml.ctr"
+#line 2781 "hbhtml.ctr"
jnode = nptr;
if(!(nptr->filename)) {
jnode = nptr->jumpnode;
@@ -3531,12 +3487,26 @@ hbhtml_link_to_node(hb_job_t *job, hb_node_t *nptr, int bold)
}
}
-#line 2710 "hbhtml.ctr"
+#line 2801 "hbhtml.ctr"
return back;
}
+/** Instead of writing a navigation menu list separator item,
+ finish current list and start a new one.
+ @param job Job structure.
+*/
+static
+void
+hbhtml_navi_menu_next_list(hb_job_t *job)
+{
+ fputs(hbhtml_c8_kw[32], job->of);
+ fputs(hbhtml_c8_kw[31], job->of);
+}
+
+
+
/** Write the menu entries for a node.
@param job Job structure.
@param nptr Node to write menu entries for.
@@ -3555,10 +3525,10 @@ hbhtml_menu_entries_for_node(hb_job_t *job, hb_node_t *nptr, int sepreq)
int back = 1;
-#line 2732 "hbhtml.ctr"
+#line 2837 "hbhtml.ctr"
if(nptr) {
-#line 2733 "hbhtml.ctr"
+#line 2838 "hbhtml.ctr"
dk3sto_it_reset(nptr->i_subnodes);
while(NULL != (subnode = (hb_node_t *)dk3sto_it_next(nptr->i_subnodes))) {
jnptr = subnode;
@@ -3566,11 +3536,15 @@ hbhtml_menu_entries_for_node(hb_job_t *job, hb_node_t *nptr, int sepreq)
if(sepreq) {
if(!(sepdone)) {
sepdone = 1;
+#if VERSION_BEFORE_2020_07_16
fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
}
}
-#line 2743 "hbhtml.ctr"
+#line 2852 "hbhtml.ctr"
active = 1;
bold = 0;
#if VERSION_BEFORE_20140109
@@ -3601,7 +3575,7 @@ hbhtml_menu_entries_for_node(hb_job_t *job, hb_node_t *nptr, int sepreq)
}
}
-#line 2772 "hbhtml.ctr"
+#line 2881 "hbhtml.ctr"
return back;
}
@@ -3618,13 +3592,13 @@ hbhtml_have_sub_menu_items(hb_node_t *ptr)
int back = 0;
-#line 2787 "hbhtml.ctr"
+#line 2896 "hbhtml.ctr"
dk3sto_it_reset(ptr->i_subnodes);
while(NULL != dk3sto_it_next(ptr->i_subnodes)) {
back = 1;
}
-#line 2791 "hbhtml.ctr"
+#line 2900 "hbhtml.ctr"
return back;
}
@@ -3651,7 +3625,7 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
int back = 1;
-#line 2816 "hbhtml.ctr"
+#line 2925 "hbhtml.ctr"
sz = DK3_SIZEOF(kv,dk3_key_value_t);
if(dk3str_to_key_value(kv, &sz, pa, job->app)) {
for(i = 0; i < sz; i++) {
@@ -3686,7 +3660,7 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 40);
}
-#line 2849 "hbhtml.ctr"
+#line 2958 "hbhtml.ctr"
if(((job->currentnode)->options) & HB_NODE_OPT_IMPRESSUM) {
/* When we are writing the menu for the impressum page,
we print the top menu only.
@@ -3695,33 +3669,50 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
sub = 0;
}
-#line 2856 "hbhtml.ctr"
+#line 2965 "hbhtml.ctr"
+ if(((job->currentnode)->options) & HB_NODE_OPT_PRIVACY) {
+ /* When we are writing the menu for the privacy statement page,
+ we print the top menu only.
+ */
+ mnst = 3;
+ sub = 0;
+ }
+
+#line 2972 "hbhtml.ctr"
fputs(hbhtml_c8_kw[29], job->of);
fputs(hbhtml_c8_kw[31], job->of);
/* Impressum node first, separator.
*/
if(job->impressumnode) {
-#line 2861 "hbhtml.ctr"
+#line 2977 "hbhtml.ctr"
if(((job->currentnode)->options) & HB_NODE_OPT_IMPRESSUM) {
if(!hbhtml_link_to_current_node(job, job->impressumnode)) {
back = 0;
-#line 2864 "hbhtml.ctr"
+#line 2980 "hbhtml.ctr"
}
} else {
if(!hbhtml_link_to_node(job, job->impressumnode, 0)) {
back = 0;
-#line 2868 "hbhtml.ctr"
+#line 2984 "hbhtml.ctr"
}
}
/* Separator */
- fputs(hbhtml_c8_kw[33], job->of);
+ if (NULL == job->privacynode) {
+ if (NULL == job->privacylink) {
+#if VERSION_BEFORE_2020_07_16
+ fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
+ }
+ }
} else {
if(job->impressumlink) {
-#line 2874 "hbhtml.ctr"
+#line 2998 "hbhtml.ctr"
fputs(hbhtml_c8_kw[36], job->of);
res = hbhtml_write_link(
job, hbhtml_c8_kw[38], (job->msg)[0], job->impressumlink,
@@ -3731,13 +3722,71 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
if(!(res)) {
back = 0;
-#line 2882 "hbhtml.ctr"
+#line 3006 "hbhtml.ctr"
}
/* Separator */
+ if (NULL == job->privacynode) {
+ if (NULL == job->privacylink) {
+#if VERSION_BEFORE_2020_07_16
+ fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
+ }
+ }
+ } else {
+
+#line 3018 "hbhtml.ctr"
+ }
+ }
+ /* Privacy node first, separator.
+ */
+ if(job->privacynode) {
+
+#line 3023 "hbhtml.ctr"
+ if(((job->currentnode)->options) & HB_NODE_OPT_PRIVACY) {
+ if(!hbhtml_link_to_current_node(job, job->privacynode)) {
+ back = 0;
+
+#line 3026 "hbhtml.ctr"
+ }
+ } else {
+ if(!hbhtml_link_to_node(job, job->privacynode, 0)) {
+ back = 0;
+
+#line 3030 "hbhtml.ctr"
+ }
+ }
+ /* Separator */
+#if VERSION_BEFORE_2020_07_16
+ fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
+ } else {
+ if(job->privacylink) {
+
+#line 3040 "hbhtml.ctr"
+ fputs(hbhtml_c8_kw[36], job->of);
+ res = hbhtml_write_link(
+ job, hbhtml_c8_kw[38], (job->msg)[105], job->privacylink,
+ NULL, (job->msg)[104], NULL
+ );
+ fputs(hbhtml_c8_kw[37], job->of);
+ if(!(res)) {
+ back = 0;
+
+#line 3048 "hbhtml.ctr"
+ }
+ /* Separator */
+#if VERSION_BEFORE_2020_07_16
fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
} else {
-#line 2886 "hbhtml.ctr"
+#line 3056 "hbhtml.ctr"
}
}
/* Now real menu(s)
@@ -3746,19 +3795,19 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
mnptr = job->currentnode;
if(mnptr) {
-#line 2893 "hbhtml.ctr"
+#line 3063 "hbhtml.ctr"
switch(mnst) {
case -1: case 0: case 2: {
-#line 2895 "hbhtml.ctr"
+#line 3065 "hbhtml.ctr"
if(sub) {
if(hbhtml_have_sub_menu_items(mnptr)) {
-#line 2897 "hbhtml.ctr"
+#line 3067 "hbhtml.ctr"
/* Menu for mnptr without leading space */
-#line 2899 "hbhtml.ctr"
+#line 3069 "hbhtml.ctr"
hbhtml_menu_entries_for_node(job, mnptr, 0);
sep = 1;
}
@@ -3768,18 +3817,18 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
/* Menu for mnptr with leading space */
-#line 2907 "hbhtml.ctr"
+#line 3077 "hbhtml.ctr"
hbhtml_menu_entries_for_node(job, mnptr, sep);
if(2 != mnst) {
-#line 2909 "hbhtml.ctr"
+#line 3079 "hbhtml.ctr"
do {
mnptr = mnptr->parent;
if(mnptr) {
/* Menu for mnptr with leading space */
-#line 2914 "hbhtml.ctr"
+#line 3084 "hbhtml.ctr"
hbhtml_menu_entries_for_node(job, mnptr, 1);
}
} while(mnptr);
@@ -3788,7 +3837,7 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
} break;
case 1: case 3: {
-#line 2921 "hbhtml.ctr"
+#line 3091 "hbhtml.ctr"
if(((job->currentnode)->options) & HB_NODE_OPT_IMPRESSUM) {
mnptr = job->rootnode;
sub = 0;
@@ -3798,11 +3847,11 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
/* Menu for mnptr without leading space */
-#line 2929 "hbhtml.ctr"
+#line 3099 "hbhtml.ctr"
hbhtml_menu_entries_for_node(job, mnptr, 0);
if(1 == mnst) {
-#line 2931 "hbhtml.ctr"
+#line 3101 "hbhtml.ctr"
do {
mnptr = mnptr->curchild;
if(mnptr) {
@@ -3810,14 +3859,14 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
/* Menu for mnptr with leading space */
-#line 2937 "hbhtml.ctr"
+#line 3107 "hbhtml.ctr"
hbhtml_menu_entries_for_node(job, mnptr, 1);
} else {
if(sub) {
/* Menu entry from current node */
-#line 2942 "hbhtml.ctr"
+#line 3112 "hbhtml.ctr"
hbhtml_menu_entries_for_node(job, mnptr, 1);
}
}
@@ -3830,7 +3879,7 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
fputs(hbhtml_c8_kw[32], job->of);
fputs(hbhtml_c8_kw[30], job->of);
-#line 2953 "hbhtml.ctr"
+#line 3123 "hbhtml.ctr"
return back;
}
@@ -3863,60 +3912,60 @@ hbhtml_one_navi_icon(
unsigned long h = 0UL; /* Icon height */
-#line 2984 "hbhtml.ctr"
+#line 3154 "hbhtml.ctr"
-#line 2985 "hbhtml.ctr"
+#line 3155 "hbhtml.ctr"
-#line 2986 "hbhtml.ctr"
+#line 3156 "hbhtml.ctr"
-#line 2987 "hbhtml.ctr"
+#line 3157 "hbhtml.ctr"
-#line 2988 "hbhtml.ctr"
+#line 3158 "hbhtml.ctr"
-#line 2989 "hbhtml.ctr"
+#line 3159 "hbhtml.ctr"
-#line 2990 "hbhtml.ctr"
+#line 3160 "hbhtml.ctr"
if(act) {
-#line 2991 "hbhtml.ctr"
+#line 3161 "hbhtml.ctr"
fputs(hbhtml_c8_kw[49], job->of);
if(!(hbhtml_url_output_for_text(job, dest))) {
back = 0;
}
-#line 2995 "hbhtml.ctr"
+#line 3165 "hbhtml.ctr"
fputs(hbhtml_c8_kw[50], job->of);
if(!(hbhtml_output_for_text(job, titlea1))) {
back = 0;
}
-#line 2999 "hbhtml.ctr"
+#line 3169 "hbhtml.ctr"
if(titlea2) {
if(!(hbhtml_output_for_text(job, titlea2))) {
back = 0;
}
}
-#line 3004 "hbhtml.ctr"
+#line 3174 "hbhtml.ctr"
fputs(hbhtml_c8_kw[51], job->of);
fputs(hbhtml_c8_kw[53], job->of);
if(!(hbhtml_url_output_for_text(job, iconfile))) {
back = 0;
}
-#line 3009 "hbhtml.ctr"
+#line 3179 "hbhtml.ctr"
fputs(hbhtml_c8_kw[54], job->of);
if(!(hbhtml_output_for_text(job, titlea1))) {
back = 0;
}
-#line 3013 "hbhtml.ctr"
+#line 3183 "hbhtml.ctr"
if(titlea2) {
if(!(hbhtml_output_for_text(job, titlea2))) {
back = 0;
@@ -3927,7 +3976,7 @@ hbhtml_one_navi_icon(
back = 0;
}
-#line 3022 "hbhtml.ctr"
+#line 3192 "hbhtml.ctr"
if(titlea2) {
if(!(hbhtml_output_for_text(job, titlea2))) {
back = 0;
@@ -3942,22 +3991,22 @@ hbhtml_one_navi_icon(
fputs(hbhtml_c8_kw[3], job->of);
fputs(hbhtml_c8_kw[52], job->of);
-#line 3035 "hbhtml.ctr"
+#line 3205 "hbhtml.ctr"
} else {
-#line 3036 "hbhtml.ctr"
+#line 3206 "hbhtml.ctr"
fputs(hbhtml_c8_kw[53], job->of);
if(!(hbhtml_url_output_for_text(job, iconfile))) {
back = 0;
}
-#line 3040 "hbhtml.ctr"
+#line 3210 "hbhtml.ctr"
fputs(hbhtml_c8_kw[54], job->of);
if(!(hbhtml_output_for_text(job, titlea1))) {
back = 0;
}
-#line 3044 "hbhtml.ctr"
+#line 3214 "hbhtml.ctr"
if(titlea2) {
if(!(hbhtml_output_for_text(job, titlea2))) {
back = 0;
@@ -3968,7 +4017,7 @@ hbhtml_one_navi_icon(
back = 0;
}
-#line 3053 "hbhtml.ctr"
+#line 3223 "hbhtml.ctr"
fputs(hbhtml_c8_kw[56], job->of);
if(hbimgdim_find(job, iconfile, &w, &h, 1)) {
if((w) && (h)) {
@@ -3978,7 +4027,7 @@ hbhtml_one_navi_icon(
fputs(hbhtml_c8_kw[3], job->of);
}
-#line 3061 "hbhtml.ctr"
+#line 3231 "hbhtml.ctr"
return back;
}
@@ -4020,7 +4069,7 @@ hbhtml_process_sp_navigation(
int back = 1;
-#line 3101 "hbhtml.ctr"
+#line 3271 "hbhtml.ctr"
sz = DK3_SIZEOF(kv,dk3_key_value_t);
if(dk3str_to_key_value(kv, &sz, pa, job->app)) {
for(i = 0; i < sz; i++) {
@@ -4071,7 +4120,7 @@ hbhtml_process_sp_navigation(
}
-#line 3150 "hbhtml.ctr"
+#line 3320 "hbhtml.ctr"
if(!(itop)) itop = (job->kwnl)[14];
if(!(iprev)) iprev = (job->kwnl)[15];
if(!(inext)) inext = (job->kwnl)[16];
@@ -4079,7 +4128,7 @@ hbhtml_process_sp_navigation(
if(!(ihome)) ihome = (job->kwnl)[37];
-#line 3156 "hbhtml.ctr"
+#line 3326 "hbhtml.ctr"
if(
((itop) || (!(ptoc)))
&& (iprev) && (inext) && (ihome)
@@ -4096,7 +4145,7 @@ hbhtml_process_sp_navigation(
/* HOME */
-#line 3171 "hbhtml.ctr"
+#line 3341 "hbhtml.ctr"
ta1 = (job->msg)[1];
ta2 = (job->rootnode)->title;
tna = (job->msg)[2];
@@ -4105,10 +4154,10 @@ hbhtml_process_sp_navigation(
);
if(res) {
-#line 3178 "hbhtml.ctr"
+#line 3348 "hbhtml.ctr"
-#line 3179 "hbhtml.ctr"
+#line 3349 "hbhtml.ctr"
res = hbhtml_one_navi_icon(
job, ihome, bu, ta1, ta2, tna,
(
@@ -4120,15 +4169,15 @@ hbhtml_process_sp_navigation(
if(!(res)) { back = 0; }
-#line 3189 "hbhtml.ctr"
+#line 3359 "hbhtml.ctr"
} else {
-#line 3190 "hbhtml.ctr"
+#line 3360 "hbhtml.ctr"
back = 0;
}
/* Previous */
-#line 3193 "hbhtml.ctr"
+#line 3363 "hbhtml.ctr"
ta1 = (job->msg)[3];
ta2 = NULL;
if(p) ta2 = p->title;
@@ -4151,7 +4200,7 @@ hbhtml_process_sp_navigation(
}
/* Next */
-#line 3214 "hbhtml.ctr"
+#line 3384 "hbhtml.ctr"
ta1 = (job->msg)[5];
ta2 = NULL;
if(n) ta2 = n->title;
@@ -4174,7 +4223,7 @@ hbhtml_process_sp_navigation(
}
/* TOC */
-#line 3235 "hbhtml.ctr"
+#line 3405 "hbhtml.ctr"
if(ptoc) {
ta1 = (job->msg)[93];
ta2 = (job->rootnode)->title;
@@ -4184,7 +4233,7 @@ hbhtml_process_sp_navigation(
);
if(res) {
-#line 3243 "hbhtml.ctr"
+#line 3413 "hbhtml.ctr"
szurl = dk3str_len(bu);
szurl += dk3str_len((job->kwnl)[31]);
if(szurl < DK3_SIZEOF(bu,dkChar)) {
@@ -4194,23 +4243,23 @@ hbhtml_process_sp_navigation(
}
-#line 3251 "hbhtml.ctr"
+#line 3421 "hbhtml.ctr"
fputs(hbhtml_c8_kw[48], job->of);
res = hbhtml_one_navi_icon(job, itop, bu, ta1, ta2, tna, 1);
if(!(res)) { back = 0; }
-#line 3255 "hbhtml.ctr"
+#line 3425 "hbhtml.ctr"
} else {
-#line 3256 "hbhtml.ctr"
+#line 3426 "hbhtml.ctr"
back = 0;
}
}
/* Key index */
if(kind) {
-#line 3261 "hbhtml.ctr"
+#line 3431 "hbhtml.ctr"
ta1 = (job->msg)[7];
ta2 = NULL;
tna = NULL;
@@ -4234,29 +4283,29 @@ hbhtml_process_sp_navigation(
job->currentnode->havenavimenu = 1;
-#line 3283 "hbhtml.ctr"
+#line 3453 "hbhtml.ctr"
} else {
-#line 3284 "hbhtml.ctr"
+#line 3454 "hbhtml.ctr"
-#line 3285 "hbhtml.ctr"
+#line 3455 "hbhtml.ctr"
-#line 3286 "hbhtml.ctr"
+#line 3456 "hbhtml.ctr"
-#line 3287 "hbhtml.ctr"
+#line 3457 "hbhtml.ctr"
-#line 3288 "hbhtml.ctr"
+#line 3458 "hbhtml.ctr"
-#line 3289 "hbhtml.ctr"
+#line 3459 "hbhtml.ctr"
}
-#line 3291 "hbhtml.ctr"
+#line 3461 "hbhtml.ctr"
return back;
}
@@ -4264,18 +4313,17 @@ hbhtml_process_sp_navigation(
/** Process author special command.
@param job Job structure.
- @param pa Program arguments.
@return 1 on success, 0 on error (continue), -1 on error (exit).
*/
static
int
-hbhtml_process_sp_author(hb_job_t *job, dkChar *pa)
+hbhtml_process_sp_author(hb_job_t *job)
{
dkChar const *ptr; /* Author name */
int back = 0;
-#line 3308 "hbhtml.ctr"
+#line 3477 "hbhtml.ctr"
ptr = hbconf_author(job->currentnode);
if(ptr) {
if(hbhtml_output_for_text(job, ptr)) {
@@ -4283,7 +4331,7 @@ hbhtml_process_sp_author(hb_job_t *job, dkChar *pa)
}
}
-#line 3314 "hbhtml.ctr"
+#line 3483 "hbhtml.ctr"
return back;
}
@@ -4291,18 +4339,17 @@ hbhtml_process_sp_author(hb_job_t *job, dkChar *pa)
/** Process location special command.
@param job Job structure.
- @param pa Program arguments.
@return 1 on success, 0 on error (continue), -1 on error (exit).
*/
static
int
-hbhtml_process_sp_location(hb_job_t *job, dkChar *pa)
+hbhtml_process_sp_location(hb_job_t *job)
{
dkChar const *ptr; /* Location name */
int back = 0;
-#line 3331 "hbhtml.ctr"
+#line 3499 "hbhtml.ctr"
ptr = hbconf_location(job->currentnode);
if(ptr) {
if(hbhtml_output_for_text(job, ptr)) {
@@ -4310,7 +4357,7 @@ hbhtml_process_sp_location(hb_job_t *job, dkChar *pa)
}
}
-#line 3337 "hbhtml.ctr"
+#line 3505 "hbhtml.ctr"
return back;
}
@@ -4332,28 +4379,28 @@ hbhtml_process_sp_date(hb_job_t *job, dkChar *pa)
int back = 1;
-#line 3357 "hbhtml.ctr"
+#line 3525 "hbhtml.ctr"
sz = DK3_SIZEOF(kv,dk3_key_value_t);
if(dk3str_to_key_value(kv,&sz,pa,job->app)) {
-#line 3359 "hbhtml.ctr"
+#line 3527 "hbhtml.ctr"
for(i = 0; i < sz; i++) {
-#line 3360 "hbhtml.ctr"
+#line 3528 "hbhtml.ctr"
if(kv[i].key) {
-#line 3361 "hbhtml.ctr"
+#line 3529 "hbhtml.ctr"
switch(dk3str_array_abbr(hbhtml_date_keys, kv[i].key, dkT('$'), 0)) {
case 0: {
if(kv[i].val) {
if(0 == dk3str_casecmp((job->kwnl)[11], kv[i].val)) {
german = 1;
-#line 3366 "hbhtml.ctr"
+#line 3534 "hbhtml.ctr"
} else {
german = 0;
-#line 3368 "hbhtml.ctr"
+#line 3536 "hbhtml.ctr"
}
}
} break;
@@ -4362,14 +4409,14 @@ hbhtml_process_sp_date(hb_job_t *job, dkChar *pa)
dk3app_log_3(job->app,DK3_LL_ERROR,job->msg,27,26,kv[i].key);
back = 0;
-#line 3375 "hbhtml.ctr"
+#line 3543 "hbhtml.ctr"
} break;
}
}
}
} else {
-#line 3380 "hbhtml.ctr"
+#line 3548 "hbhtml.ctr"
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 40);
}
if(german) {
@@ -4384,7 +4431,7 @@ hbhtml_process_sp_date(hb_job_t *job, dkChar *pa)
);
}
-#line 3393 "hbhtml.ctr"
+#line 3561 "hbhtml.ctr"
return back;
}
@@ -4408,7 +4455,7 @@ hbhtml_process_sp_variable(hb_job_t *job, dkChar *pa)
int back = 1;
-#line 3415 "hbhtml.ctr"
+#line 3583 "hbhtml.ctr"
sz = DK3_SIZEOF(kv,dk3_key_value_t);
if(dk3str_to_key_value(kv,&sz,pa,job->app)) {
if(sz > 0) {
@@ -4424,7 +4471,7 @@ hbhtml_process_sp_variable(hb_job_t *job, dkChar *pa)
} else {
back = 0;
-#line 3429 "hbhtml.ctr"
+#line 3597 "hbhtml.ctr"
/* ERROR: Illegal argument */
dk3app_log_3(job->app,DK3_LL_ERROR,job->msg,27,26,kv[i].key);
}
@@ -4436,13 +4483,13 @@ hbhtml_process_sp_variable(hb_job_t *job, dkChar *pa)
if(!hbhtml_url_output_for_text(job, varval)) {
back = 0;
-#line 3439 "hbhtml.ctr"
+#line 3607 "hbhtml.ctr"
}
} else {
if(!hbhtml_output_for_text(job, varval)) {
back = 0;
-#line 3443 "hbhtml.ctr"
+#line 3611 "hbhtml.ctr"
}
}
}
@@ -4451,7 +4498,7 @@ hbhtml_process_sp_variable(hb_job_t *job, dkChar *pa)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 40);
}
-#line 3450 "hbhtml.ctr"
+#line 3618 "hbhtml.ctr"
return back;
}
@@ -4472,29 +4519,29 @@ hbhtml_process_sp_contents(hb_job_t *job, hb_node_t *p, hb_node_t *n)
job->shipused = 0;
-#line 3469 "hbhtml.ctr"
+#line 3637 "hbhtml.ctr"
if(job->currentnode) {
-#line 3470 "hbhtml.ctr"
+#line 3638 "hbhtml.ctr"
if((job->currentnode)->filename) {
-#line 3471 "hbhtml.ctr"
+#line 3639 "hbhtml.ctr"
back = hbcont_process(job, p, n);
} else {
-#line 3473 "hbhtml.ctr"
+#line 3641 "hbhtml.ctr"
if(0UL == (job->currentnode)->objno) {
-#line 3474 "hbhtml.ctr"
+#line 3642 "hbhtml.ctr"
back = hbcont_process(job, p, n);
} else {
-#line 3476 "hbhtml.ctr"
+#line 3644 "hbhtml.ctr"
}
}
}
-#line 3479 "hbhtml.ctr"
+#line 3647 "hbhtml.ctr"
return back;
}
@@ -4678,7 +4725,7 @@ hbhtml_process_sp_code(hb_job_t *job, dkChar *pa)
-#line 3661 "hbhtml.ctr"
+#line 3829 "hbhtml.ctr"
/* Get configuration defaults
*/
@@ -4775,7 +4822,7 @@ hbhtml_process_sp_code(hb_job_t *job, dkChar *pa)
} break;
}
-#line 3756 "hbhtml.ctr"
+#line 3924 "hbhtml.ctr"
}
@@ -4816,7 +4863,7 @@ hbhtml_check_link_for_external(dkChar const *link)
int back = 0;
-#line 3795 "hbhtml.ctr"
+#line 3963 "hbhtml.ctr"
hbhtml_stm3_reset(&stm3);
ptr = link;
while(*ptr) {
@@ -4852,7 +4899,7 @@ hbhtml_check_link_for_external(dkChar const *link)
back = 1;
}
-#line 3829 "hbhtml.ctr"
+#line 3997 "hbhtml.ctr"
return back;
}
@@ -4891,13 +4938,15 @@ hbhtml_process_sp_a(hb_job_t *job, dkChar *pa)
dkChar *style = NULL; /* style argument */
size_t sz; /* Number of parameters */
size_t i; /* Traverse parameters */
+ unsigned oldopt = 0; /* Save options */
int external = 0; /* Flag: External link */
int extspec = 0; /* Flag: External specified */
int titlespec = 0; /* Flag: Title specified */
+ int tifl = 0; /* Flag: Title from link */
int back = 0;
-#line 3872 "hbhtml.ctr"
+#line 4042 "hbhtml.ctr"
nptr = job->currentnode;
sz = DK3_SIZEOF(kv,dk3_key_value_t);
if(dk3str_to_key_value(kv,&sz,pa,job->app)) {
@@ -4907,97 +4956,97 @@ hbhtml_process_sp_a(hb_job_t *job, dkChar *pa)
switch(dk3str_array_abbr(hbhtml_a_keys, kv[i].key, dkT('$'), 0)) {
case 0: {
-#line 3880 "hbhtml.ctr"
+#line 4050 "hbhtml.ctr"
text = kv[i].val;
} break;
case 1: {
-#line 3883 "hbhtml.ctr"
+#line 4053 "hbhtml.ctr"
title = kv[i].val; titlespec = 1;
} break;
case 2: {
-#line 3886 "hbhtml.ctr"
+#line 4056 "hbhtml.ctr"
accessk = kv[i].val;
} break;
case 3: {
-#line 3889 "hbhtml.ctr"
+#line 4059 "hbhtml.ctr"
charset = kv[i].val;
} break;
case 4: {
-#line 3892 "hbhtml.ctr"
+#line 4062 "hbhtml.ctr"
coords = kv[i].val;
} break;
case 5: {
-#line 3895 "hbhtml.ctr"
+#line 4065 "hbhtml.ctr"
href= kv[i].val;
} break;
case 6: {
-#line 3898 "hbhtml.ctr"
+#line 4068 "hbhtml.ctr"
hrefl = kv[i].val;
} break;
case 7: {
-#line 3901 "hbhtml.ctr"
+#line 4071 "hbhtml.ctr"
name = kv[i].val;
} break;
case 8: {
-#line 3904 "hbhtml.ctr"
+#line 4074 "hbhtml.ctr"
onblur = kv[i].val;
} break;
case 9: {
-#line 3907 "hbhtml.ctr"
+#line 4077 "hbhtml.ctr"
onfocus = kv[i].val;
} break;
case 10: {
-#line 3910 "hbhtml.ctr"
+#line 4080 "hbhtml.ctr"
rel = kv[i].val;
} break;
case 11: {
-#line 3913 "hbhtml.ctr"
+#line 4083 "hbhtml.ctr"
rev = kv[i].val;
} break;
case 12: {
-#line 3916 "hbhtml.ctr"
+#line 4086 "hbhtml.ctr"
shape = kv[i].val;
} break;
case 13: {
-#line 3919 "hbhtml.ctr"
+#line 4089 "hbhtml.ctr"
tabind = kv[i].val;
} break;
case 14: {
-#line 3922 "hbhtml.ctr"
+#line 4092 "hbhtml.ctr"
target = kv[i].val;
} break;
case 15: {
-#line 3925 "hbhtml.ctr"
+#line 4095 "hbhtml.ctr"
type = kv[i].val;
} break;
case 16: {
-#line 3928 "hbhtml.ctr"
+#line 4098 "hbhtml.ctr"
clptr = kv[i].val;
} break;
case 17: {
-#line 3931 "hbhtml.ctr"
+#line 4101 "hbhtml.ctr"
idptr = kv[i].val;
} break;
case 18: {
-#line 3934 "hbhtml.ctr"
+#line 4104 "hbhtml.ctr"
style = kv[i].val;
} break;
case 19: {
@@ -5029,7 +5078,7 @@ hbhtml_process_sp_a(hb_job_t *job, dkChar *pa)
}
if(titlespec) {
if(!(title)) { title = text; }
- if(!(title)) { title = href; }
+ if(!(title)) { title = href; tifl = 1; }
}
back = 1;
} else {
@@ -5037,102 +5086,166 @@ hbhtml_process_sp_a(hb_job_t *job, dkChar *pa)
back = 1;
}
}
+ /* Checks ok, all required information available.
+ */
if(back) {
/* Write <a...> */
if(href) {
+ /* <a href=" */
fputs(hbhtml_c8_kw[39], job->of);
if(!hbhtml_url_output_for_text(job, href)) { back = 0; }
} else {
+ /* <a name=" */
fputs(hbhtml_c8_kw[74], job->of);
if(!hbhtml_url_output_for_text(job, name)) { back = 0; }
}
if(target) {
+ /* " target=" */
fputs(hbhtml_c8_kw[75], job->of);
if(!hbhtml_url_output_for_text(job, target)) { back = 0; }
} else {
if(external) {
+ /* " target="_blank */
fputs(hbhtml_c8_kw[108], job->of);
}
}
if(type) {
+ /* " type=" */
fputs(hbhtml_c8_kw[76], job->of);
if(!hbhtml_url_output_for_text(job, type)) { back = 0; }
}
+ /* " class=" */
fputs(hbhtml_c8_kw[77], job->of);
if(clptr) {
if(!hbhtml_url_output_for_text(job, clptr)) { back = 0; }
} else {
if(external) {
+ /* hb_a_e */
fputs(hbhtml_c8_kw[101], job->of);
} else {
+ /* hb_a_i */
fputs(hbhtml_c8_kw[100], job->of);
}
}
if(idptr) {
+ /* " id=" */
fputs(hbhtml_c8_kw[78], job->of);
if(!hbhtml_url_output_for_text(job, idptr)) { back = 0; }
}
if(style) {
+ /* " style=" */
fputs(hbhtml_c8_kw[79], job->of);
if(!hbhtml_url_output_for_text(job, style)) { back = 0; }
}
if(hrefl) {
+ /* " hreflang=" */
fputs(hbhtml_c8_kw[80], job->of);
if(!hbhtml_url_output_for_text(job, hrefl)) { back = 0; }
}
if(title) {
+ /* " title=" */
fputs(hbhtml_c8_kw[81], job->of);
+ if ((0 != external) && (0 != job->markel) && (0 < strlen(job->elmbuf))) {
+ /* &#x */
+ fputs(hbhtml_c8_kw[156], job->of);
+ fputs(job->elmbuf, job->of);
+ /* ;&nbsp; */
+ fputs(hbhtml_c8_kw[157], job->of);
+ }
+ /* ##### a title, Ausgabe des href als Title */
+ oldopt = (job->currentnode)->options;
+ if (0 != tifl) {
+ (job->currentnode)->options &= (~(HB_NODE_OPT_REPLACE_AMPERSAND));
+ }
if(!hbhtml_output_for_text(job, title)) { back = 0; }
+ (job->currentnode)->options = oldopt;
+ } else {
+ if ((0 != external) && (0 != job->markel) && (0 < strlen(job->elmbuf))) {
+ /* " title=" */
+ fputs(hbhtml_c8_kw[81], job->of);
+ /* &#x */
+ fputs(hbhtml_c8_kw[156], job->of);
+ fputs(job->elmbuf, job->of);
+ /* ;&nbsp; */
+ fputs(hbhtml_c8_kw[157], job->of);
+ }
}
if(onblur) {
+ /* " onblur=" */
fputs(hbhtml_c8_kw[82], job->of);
if(!hbhtml_url_output_for_text(job, onblur)) { back = 0; }
}
if(onfocus) {
+ /* " onfocus=" */
fputs(hbhtml_c8_kw[83], job->of);
if(!hbhtml_url_output_for_text(job, onfocus)) { back = 0; }
}
if(rel) {
+ /* " rel=" */
fputs(hbhtml_c8_kw[84], job->of);
if(!hbhtml_url_output_for_text(job, rel)) { back = 0; }
}
if(rev) {
+ /* " rev=" */
fputs(hbhtml_c8_kw[85], job->of);
if(!hbhtml_url_output_for_text(job, rev)) { back = 0; }
}
if(shape) {
+ /* " shape=" */
fputs(hbhtml_c8_kw[86], job->of);
if(!hbhtml_url_output_for_text(job, shape)) { back = 0; }
}
if(tabind) {
+ /* " tabindex=" */
fputs(hbhtml_c8_kw[87], job->of);
if(!hbhtml_url_output_for_text(job, tabind)) { back = 0; }
}
if(accessk) {
+ /* " accesskey=" */
fputs(hbhtml_c8_kw[88], job->of);
if(!hbhtml_url_output_for_text(job, accessk)) { back = 0; }
}
if(charset) {
+ /* " charset=" */
fputs(hbhtml_c8_kw[89], job->of);
if(!hbhtml_url_output_for_text(job, charset)) { back = 0; }
}
if(coords) {
+ /* " coords=" */
fputs(hbhtml_c8_kw[90], job->of);
if(!hbhtml_url_output_for_text(job, coords)) { back = 0; }
}
+ /* " */
fputs(hbhtml_c8_kw[5], job->of);
+ /* > */
fputs(hbhtml_c8_kw[3], job->of);
if(href) {
if(text) {
if(!hbhtml_output_for_text(job, text)) { back = 0; }
} else {
+ /* ##### Link-Text, Ausgabe des href-Attributes als Text */
+ /* Save options
+ */
+ oldopt = (job->currentnode)->options;
+ /*
+ Replace ampersands
+ */
+ (job->currentnode)->options &= (~(HB_NODE_OPT_REPLACE_AMPERSAND));
+ /*
+ Write href text as hyperlink text
+ */
if(!hbhtml_output_for_text(job, href)) { back = 0; }
+ /*
+ Restore options
+ */
+ (job->currentnode)->options = oldopt;
}
}
+ /* </a> */
fputs(hbhtml_c8_kw[41], job->of);
if((href) && (external) && (text)) {
/* Save link and write link number */
- linkptr = dk3sto_it_find_like(nptr->i_lbyurl, href, 1);
+ linkptr = (hb_link_t *)dk3sto_it_find_like(nptr->i_lbyurl, href, 1);
if(linkptr) {
fprintf(job->of, hbhtml_c8_kw[91], (1UL + linkptr->lno));
} else {
@@ -5165,7 +5278,7 @@ hbhtml_process_sp_a(hb_job_t *job, dkChar *pa)
}
}
-#line 4100 "hbhtml.ctr"
+#line 4334 "hbhtml.ctr"
return back;
}
@@ -5189,7 +5302,7 @@ hbhtml_process_sp_menuentry(hb_job_t *job, dkChar *pa)
int back = 0;
-#line 4122 "hbhtml.ctr"
+#line 4356 "hbhtml.ctr"
sz = DK3_SIZEOF(kv,dk3_key_value_t);
if(dk3str_to_key_value(kv,&sz,pa,job->app)) {
if(sz > 0) {
@@ -5219,9 +5332,13 @@ hbhtml_process_sp_menuentry(hb_job_t *job, dkChar *pa)
}
if(n_items) {
back = 1;
- fputs(hbhtml_c8_kw[92], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[60])) { back = 0; }
- fputs(hbhtml_c8_kw[22], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbhtml_c8_kw[92], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[60])) { back = 0; }
+ fputs(hbhtml_c8_kw[22], job->of);
+ } else {
+ fputs(hbhtml_c8_kw[158], job->of);
+ }
for(cr = 0; cr < n_items; cr++) {
fputs(hbhtml_c8_kw[94], job->of);
if(cr) {
@@ -5244,7 +5361,7 @@ hbhtml_process_sp_menuentry(hb_job_t *job, dkChar *pa)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 42);
}
-#line 4175 "hbhtml.ctr"
+#line 4413 "hbhtml.ctr"
return back;
}
@@ -5270,7 +5387,7 @@ hbhtml_process_sp_index(hb_job_t *job, dkChar *pa)
int back = 0;
-#line 4199 "hbhtml.ctr"
+#line 4437 "hbhtml.ctr"
nptr = job->currentnode;
sz = DK3_SIZEOF(kv,dk3_key_value_t);
if(dk3str_to_key_value(kv,&sz,pa,job->app)) {
@@ -5334,7 +5451,7 @@ hbhtml_process_sp_index(hb_job_t *job, dkChar *pa)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 40);
}
-#line 4261 "hbhtml.ctr"
+#line 4499 "hbhtml.ctr"
return back;
}
@@ -5356,7 +5473,7 @@ hbhtml_sourcefile_line_handler(void *obj, dkChar *il)
dk3str_delnl(il);
-#line 4281 "hbhtml.ctr"
+#line 4519 "hbhtml.ctr"
if (job->coli) {
if (0 < dk3str_len(il)) {
if (!hbhtml_coli_open(job)) { back = 0; }
@@ -5371,7 +5488,7 @@ hbhtml_sourcefile_line_handler(void *obj, dkChar *il)
fputc('\n', job->of);
-#line 4294 "hbhtml.ctr"
+#line 4532 "hbhtml.ctr"
return back;
}
@@ -5399,7 +5516,7 @@ html_process_sp_sourcefile(hb_job_t *job, dkChar *pa)
int oldcode; /* Old code flag value */
-#line 4320 "hbhtml.ctr"
+#line 4558 "hbhtml.ctr"
if ((job->options) & HB_JOB_OPT_CODE_LINE_NUMBERS) {
lineno = 1;
}
@@ -5487,7 +5604,7 @@ html_process_sp_sourcefile(hb_job_t *job, dkChar *pa)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 40);
}
-#line 4406 "hbhtml.ctr"
+#line 4644 "hbhtml.ctr"
return back;
}
@@ -5495,39 +5612,38 @@ html_process_sp_sourcefile(hb_job_t *job, dkChar *pa)
/** Process sourcefile special command.
@param job Job structure.
- @param pa Program arguemnts.
@return 1 on success, 0 on error (continue), -1 on error (exit).
*/
static
int
-html_process_sp_htmlname(hb_job_t *job, dkChar *pa)
+html_process_sp_htmlname(hb_job_t *job)
{
dkChar buf[DK3_MAX_PATH];
size_t szbuf = DK3_SIZEOF(buf,dkChar);
int back = 0;
-#line 4424 "hbhtml.ctr"
+#line 4661 "hbhtml.ctr"
if (NULL != job->currentnode) {
if (0 != hbhtml_create_output_filename(buf, szbuf, job, job->currentnode)) {
back = hbhtml_url_output_for_text(job, buf);
if (0 == back) {
-#line 4428 "hbhtml.ctr"
+#line 4665 "hbhtml.ctr"
job->exv = 1;
}
} else {
-#line 4431 "hbhtml.ctr"
+#line 4668 "hbhtml.ctr"
job->exv = 1;
}
} else {
-#line 4434 "hbhtml.ctr"
+#line 4671 "hbhtml.ctr"
}
-#line 4436 "hbhtml.ctr"
+#line 4673 "hbhtml.ctr"
return back;
}
@@ -5632,7 +5748,7 @@ hbhtml_process_special(
int back = 0;
-#line 4539 "hbhtml.ctr"
+#line 4776 "hbhtml.ctr"
pc = dk3str_start(job->special, NULL);
sc = NULL;
if(pc) {
@@ -5645,11 +5761,11 @@ hbhtml_process_special(
ct = dk3str_array_index(hbhtml_special_commands, pc, 0);
-#line 4550 "hbhtml.ctr"
+#line 4787 "hbhtml.ctr"
switch(ct) {
case 0: {
-#line 4552 "hbhtml.ctr"
+#line 4789 "hbhtml.ctr"
if(in_template) {
back = hbhtml_process_sp_contents(job, p, n);
} else {
@@ -5659,25 +5775,25 @@ hbhtml_process_special(
} break;
case 1: {
-#line 4560 "hbhtml.ctr"
+#line 4797 "hbhtml.ctr"
back = hbhtml_process_sp_title(job);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 2: {
-#line 4564 "hbhtml.ctr"
- back = hbhtml_process_sp_image(job, pa, sc, in_template);
+#line 4801 "hbhtml.ctr"
+ back = hbhtml_process_sp_image(job, pa, sc);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 3: {
-#line 4568 "hbhtml.ctr"
+#line 4805 "hbhtml.ctr"
back = hbhtml_process_sp_menu(job, pa);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 4: {
-#line 4572 "hbhtml.ctr"
+#line 4809 "hbhtml.ctr"
back = hbhtml_process_sp_navigation(job, pa, p, n);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
@@ -5687,25 +5803,25 @@ hbhtml_process_special(
} break;
case 6: {
-#line 4580 "hbhtml.ctr"
- back = hbhtml_process_sp_author(job, pa);
+#line 4817 "hbhtml.ctr"
+ back = hbhtml_process_sp_author(job);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 7: {
-#line 4584 "hbhtml.ctr"
- back = hbhtml_process_sp_location(job, pa);
+#line 4821 "hbhtml.ctr"
+ back = hbhtml_process_sp_location(job);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 8: {
-#line 4588 "hbhtml.ctr"
+#line 4825 "hbhtml.ctr"
back = hbhtml_process_sp_date(job, pa);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 9: {
-#line 4592 "hbhtml.ctr"
+#line 4829 "hbhtml.ctr"
back = hbhtml_process_sp_variable(job, pa);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
@@ -5735,14 +5851,14 @@ hbhtml_process_special(
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 15: {
- back = html_process_sp_htmlname(job, pa);
+ back = html_process_sp_htmlname(job);
} break;
case 16: {
back = html_process_sp_hint(job, pa);
} break;
default: {
-#line 4627 "hbhtml.ctr"
+#line 4864 "hbhtml.ctr"
back = 0;
/* ERROR: Unknown special command. */
dk3app_log_3(job->app,DK3_LL_ERROR,job->msg,29,26,pc);
@@ -5753,7 +5869,7 @@ hbhtml_process_special(
}
-#line 4636 "hbhtml.ctr"
+#line 4873 "hbhtml.ctr"
return back;
}
@@ -5774,7 +5890,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
dkChar c; /* Character to ship out */
-#line 4655 "hbhtml.ctr"
+#line 4892 "hbhtml.ctr"
pos = 0;
proc = (hb_file_processor_t *)obj;
job = proc->job;
@@ -5793,7 +5909,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
dk3app_log_3(job->app,DK3_LL_ERROR,job->msg,30,26,p1);
back = -1;
-#line 4672 "hbhtml.ctr"
+#line 4909 "hbhtml.ctr"
} break;
case STM1_O_NOTHING: {
} break;
@@ -5802,7 +5918,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, c))) {
back = 0;
-#line 4679 "hbhtml.ctr"
+#line 4916 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
/* ERROR: Line too long! */
@@ -5816,7 +5932,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, dkT('\n')))) {
back = 0;
-#line 4691 "hbhtml.ctr"
+#line 4928 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
/* ERROR: Line too long! */
@@ -5828,7 +5944,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, dkT('\r')))) {
back = 0;
-#line 4701 "hbhtml.ctr"
+#line 4938 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
/* ERROR: Line too long! */
@@ -5840,7 +5956,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, dkT('\t')))) {
back = 0;
-#line 4711 "hbhtml.ctr"
+#line 4948 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
/* ERROR: Line too long! */
@@ -5852,7 +5968,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, c))) {
back = 0;
-#line 4721 "hbhtml.ctr"
+#line 4958 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
/* ERROR: Line too long! */
@@ -5872,7 +5988,27 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, c))) {
back = 0;
-#line 4739 "hbhtml.ctr"
+#line 4976 "hbhtml.ctr"
+ if(0 == ltl) {
+ ltl = 1;
+ /* ERROR: Line too long! */
+ }
+ }
+ } break;
+ case dkT('#'): {
+ /* We can escape a leading raute.
+ */
+ if(1 < pos) {
+ xmsg[0] = dkT('\\');
+ xmsg[1] = c;
+ xmsg[2] = dkT('\0');
+ dk3app_log_3(job->app, DK3_LL_WARNING, job->msg, 63, 64, xmsg);
+ }
+ if (!hbhtml_code_line_start(job)) { back = 0; }
+ if(!(hbhtml_shipout(job, c))) {
+ back = 0;
+
+#line 4994 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
/* ERROR: Line too long! */
@@ -5888,7 +6024,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, c))) {
back = 0;
-#line 4753 "hbhtml.ctr"
+#line 5008 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
/* ERROR: Line too long! */
@@ -5902,7 +6038,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, dkT('%')))) {
back = 0;
-#line 4765 "hbhtml.ctr"
+#line 5020 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5910,7 +6046,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, c))) {
back = 0;
-#line 4771 "hbhtml.ctr"
+#line 5026 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5921,7 +6057,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!(hbhtml_shipout(job, dkT('%')))) {
back = 0;
-#line 4780 "hbhtml.ctr"
+#line 5035 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5935,7 +6071,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!hbhtml_add_to_special(job, c)) {
back = 0;
-#line 4792 "hbhtml.ctr"
+#line 5047 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5947,7 +6083,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!hbhtml_add_to_special(job, dkT('\n'))) {
back = 0;
-#line 4802 "hbhtml.ctr"
+#line 5057 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5957,7 +6093,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!hbhtml_add_to_special(job, dkT('\r'))) {
back = 0;
-#line 4810 "hbhtml.ctr"
+#line 5065 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5967,7 +6103,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!hbhtml_add_to_special(job, dkT('\t'))) {
back = 0;
-#line 4818 "hbhtml.ctr"
+#line 5073 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5977,7 +6113,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!hbhtml_add_to_special(job, c)) {
back = 0;
-#line 4826 "hbhtml.ctr"
+#line 5081 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5989,7 +6125,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!hbhtml_add_to_special(job, dkT('%'))) {
back = 0;
-#line 4836 "hbhtml.ctr"
+#line 5091 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -5997,7 +6133,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!hbhtml_add_to_special(job, c)) {
back = 0;
-#line 4842 "hbhtml.ctr"
+#line 5097 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -6007,7 +6143,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
if(!hbhtml_add_to_special(job, dkT('%'))) {
back = 0;
-#line 4850 "hbhtml.ctr"
+#line 5105 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -6020,7 +6156,7 @@ hbhtml_line_handler(void *obj, dkChar *il)
} else {
back = 0;
-#line 4861 "hbhtml.ctr"
+#line 5116 "hbhtml.ctr"
if(0 == ltl) {
ltl = 1;
}
@@ -6063,11 +6199,11 @@ hbhtml_line_handler(void *obj, dkChar *il)
if (EOF == fputc('\n', job->of)) {
back = 0;
-#line 4902 "hbhtml.ctr"
+#line 5157 "hbhtml.ctr"
}
-#line 4904 "hbhtml.ctr"
+#line 5159 "hbhtml.ctr"
return back;
}
@@ -6075,20 +6211,24 @@ hbhtml_line_handler(void *obj, dkChar *il)
/** Write JS files to HTML header.
@param job Job structure.
- @param nptr
+ @param nptr Node to write JS file list for.
+ @param htdt Document type.
@return 1 on success, 0 on error.
*/
static
int
-hbhtml_write_js_files(hb_job_t *job, hb_node_t *nptr)
+hbhtml_write_js_files(hb_job_t *job, hb_node_t *nptr, int htdt)
{
- hb_link_t *linkptr; /* File name data for JavaScript file */
- int back = 1;
+
+ const char * const *scrptr; /* Script pointer */
+ hb_link_t *linkptr; /* File name data for JavaScript file */
+ int back = 1;
+
/* Write parent JS files.
*/
if(nptr->parent) {
if(!((nptr->options) & HB_NODE_OPT_STOP_JS_INHERITANCE)) {
- hbhtml_write_js_files(job, nptr->parent);
+ hbhtml_write_js_files(job, nptr->parent, htdt);
}
}
@@ -6100,10 +6240,48 @@ hbhtml_write_js_files(hb_job_t *job, hb_node_t *nptr)
if(linkptr->url) {
fputs(hbhtml_c8_kw[121], job->of);
if(!hbhtml_url_output_for_text(job, linkptr->url)) { back = 0; }
- fputs(hbhtml_c8_kw[122], job->of);
+ fputs(
+ hbhtml_c8_kw[
+ (HTML_DOCTYPE_5 == htdt)
+ ? (
+ (0 != (LINK_FLAG_SCRIPT_ASYNC & (linkptr->flags)))
+ ? (167) : (166)
+ )
+ : (
+ (0 != (LINK_FLAG_SCRIPT_ASYNC & (linkptr->flags)))
+ ? (168) : (122)
+ )
+ ],
+ job->of
+ );
}
}
}
+
+ /* Write script code to fold and unfold page table of contents
+ */
+ if (0 != (HB_NODE_OPT_PAGE_TOC & (nptr->options))) {
+ if (0 != (HB_JOB_OPT_FOLD_PTOC & (job->options))) {
+ if (NULL != job->ptocjsfile) {
+ job->ptocjsused = 1;
+ /*
+ script-tag
+ */
+ fputs(
+ hbhtml_c8_kw[(HTML_DOCTYPE_5 == htdt) ? (170) : (169)],
+ job->of
+ );
+ /* Script text
+ */
+ if(!hbhtml_url_output_for_text(job, job->ptocjsfile)) { back = 0; }
+ /*
+ End script-tag
+ */
+ fputs(hbhtml_c8_kw[166], job->of);
+ }
+ }
+ }
+
return back;
}
@@ -6111,7 +6289,7 @@ hbhtml_write_js_files(hb_job_t *job, hb_node_t *nptr)
/** Write one head navigation entry.
@param job Job structure.
- @param nptr Node (may be NULL for impressum).
+ @param nptr Node (may be NULL for impressum or privacy).
@param url URL to use if nptr is NULL.
@param titleind Title index if nptr is NULL.
@param linkkwind Link keyword index.
@@ -6193,14 +6371,34 @@ hbhtml_write_head_navigation(
hbhtml_one_head_navigation(job, NULL, job->impressumlink, 61, 127, 0);
}
}
+ if(job->privacynode) {
+ nptr = job->privacynode;
+ hbhtml_one_head_navigation(job, nptr, NULL, 0, 127, 0);
+ } else {
+ if(job->privacylink) {
+ hbhtml_one_head_navigation(job, NULL, job->privacylink, 104, 127, 0);
+ }
+ }
if(job->rootnode) {
hbhtml_one_head_navigation(
job, job->rootnode, NULL, 0, 128,
- (((job->options) & HB_JOB_OPT_CREATE_TOC) ? 136 : 0)
+ (
+ (
+ (0 != ((job->options) & HB_JOB_OPT_CREATE_TOC))
+ && (0 == ((job->options) & HB_JOB_OPT_CHM))
+ )
+ ? 136 : 0
+ )
);
hbhtml_one_head_navigation(
job, job->rootnode, NULL, 0, 129,
- (((job->options) & HB_JOB_OPT_CREATE_INDEX) ? 137 : 0)
+ (
+ (
+ (0 != ((job->options) & HB_JOB_OPT_CREATE_INDEX))
+ && (0 == ((job->options) & HB_JOB_OPT_CHM))
+ )
+ ? 137 : 0
+ )
);
hbhtml_one_head_navigation(job, job->rootnode, NULL, 0, 130, 0);
}
@@ -6233,21 +6431,44 @@ hbhtml_write_head_navigation(
@param nodeptr Current node to write.
@param prev Previous node.
@param next Next node.
+ @param htdt HTML doc type to use.
*/
static
void
hbhtml_write_header(
- hb_job_t *job, hb_node_t *nodeptr, hb_node_t *prev, hb_node_t *next
+ hb_job_t *job, hb_node_t *nodeptr, hb_node_t *prev, hb_node_t *next, int htdt
)
{
dkChar const *ptr; /* Multiple text elements */
-#line 5078 "hbhtml.ctr"
+#line 5396 "hbhtml.ctr"
fputs(hbhtml_c8_kw[15], job->of);
+ /*
+ Meta charset, viewport
+ */
+ if (HTML_DOCTYPE_5 == htdt) {
+ if (HB_CS_UTF_8 == job->cs) {
+ fputs(hbhtml_c8_kw[163], job->of);
+ }
+ fputs(hbhtml_c8_kw[164], job->of);
+ }
/* Title
*/
fputs(hbhtml_c8_kw[19], job->of);
+#if 1
+ if (((job->options) & HB_JOB_OPT_NUM_IN_PAGE_HEADER)) {
+ if (!((job->options) & HB_JOB_OPT_CHM)) {
+ if (NULL != job->currentnode) {
+ if((job->currentnode)->depth < job->headlevels) {
+ if(hbtool_write_header_number(job, job->currentnode)) {
+ hbhtml_output_for_text(job, (job->kwnl[35]));
+ }
+ }
+ }
+ }
+ }
+#endif
hbhtml_output_for_text(job, hbconf_title(nodeptr));
fputs(hbhtml_c8_kw[20], job->of);
/* Generator (comment)
@@ -6263,7 +6484,7 @@ hbhtml_write_header(
ptr = hbconf_stylefile(nodeptr);
if(ptr) {
if(!hbtool_add_file(job, ptr)) { job->exv = 1; }
- fputs(hbhtml_c8_kw[21], job->of);
+ fputs(hbhtml_c8_kw[(HTML_DOCTYPE_5 == htdt) ? (165) : (21)], job->of);
hbhtml_url_output_for_text(job, ptr);
fputs(hbhtml_c8_kw[22], job->of);
}
@@ -6280,10 +6501,12 @@ hbhtml_write_header(
hbhtml_write_head_navigation(job, nodeptr, prev, next);
/* Character set (meta)
*/
- if(HB_CS_UTF_8 == job->cs) {
- fputs(hbhtml_c8_kw[24], job->of);
- } else {
- fputs(hbhtml_c8_kw[23], job->of);
+ if (HTML_DOCTYPE_5 != htdt) {
+ if(HB_CS_UTF_8 == job->cs) {
+ fputs(hbhtml_c8_kw[24], job->of);
+ } else {
+ fputs(hbhtml_c8_kw[23], job->of);
+ }
}
/* Author (meta)
*/
@@ -6309,10 +6532,13 @@ hbhtml_write_header(
}
/* JavaScript files.
*/
- (void)hbhtml_write_js_files(job, nodeptr);
+ (void)hbhtml_write_js_files(job, nodeptr, htdt);
+ /*
+ End header tag
+ */
fputs(hbhtml_c8_kw[16], job->of);
-#line 5145 "hbhtml.ctr"
+#line 5490 "hbhtml.ctr"
}
@@ -6337,7 +6563,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
int idx = 0;
-#line 5168 "hbhtml.ctr"
+#line 5513 "hbhtml.ctr"
pspcr = (hb_spc_reader_t *)obj;
if (NULL != pspcr) {
job = pspcr->job;
@@ -6348,7 +6574,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
if (0 <= idx) {
-#line 5177 "hbhtml.ctr"
+#line 5522 "hbhtml.ctr"
dk3str_delnl(il);
sl = hbcont_metadata_length(idx);
if (0 < sl) {
@@ -6356,21 +6582,21 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
vptr = dk3str_start(&(il[sl]), NULL);
-#line 5183 "hbhtml.ctr"
+#line 5528 "hbhtml.ctr"
}
switch (idx) {
case 0: {
-#line 5186 "hbhtml.ctr"
+#line 5531 "hbhtml.ctr"
if (NULL != vptr) {
-#line 5188 "hbhtml.ctr"
+#line 5533 "hbhtml.ctr"
cptr = dk3str_dup_app(vptr, job->app);
if (NULL != cptr) {
-#line 5191 "hbhtml.ctr"
+#line 5536 "hbhtml.ctr"
if (NULL != nptr->metadesc) {
/* Warning: Overwriting description text */
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 97);
@@ -6386,16 +6612,16 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 1: {
-#line 5205 "hbhtml.ctr"
+#line 5550 "hbhtml.ctr"
if (NULL != vptr) {
-#line 5207 "hbhtml.ctr"
+#line 5552 "hbhtml.ctr"
cptr = dk3str_dup_app(vptr, job->app);
if (NULL != cptr) {
-#line 5210 "hbhtml.ctr"
+#line 5555 "hbhtml.ctr"
if (NULL != nptr->metakeyw) {
/* Warning: Overwriting keywords */
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 98);
@@ -6411,7 +6637,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 2: {
-#line 5224 "hbhtml.ctr"
+#line 5569 "hbhtml.ctr"
if (NULL != vptr) {
cptr = dk3str_dup_app(vptr, job->app);
if (NULL != cptr) {
@@ -6433,7 +6659,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 3: {
-#line 5244 "hbhtml.ctr"
+#line 5589 "hbhtml.ctr"
if (NULL != vptr) {
cptr = dk3str_dup_app(vptr, job->app);
if (NULL != cptr) {
@@ -6454,7 +6680,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 4: {
-#line 5263 "hbhtml.ctr"
+#line 5608 "hbhtml.ctr"
if (NULL != vptr) {
cptr = dk3str_dup_app(vptr, job->app);
if (NULL != cptr) {
@@ -6475,7 +6701,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 5: {
-#line 5282 "hbhtml.ctr"
+#line 5627 "hbhtml.ctr"
if (NULL != vptr) {
cptr = dk3str_dup_app(vptr, job->app);
if (NULL != cptr) {
@@ -6496,7 +6722,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 6: {
-#line 5301 "hbhtml.ctr"
+#line 5646 "hbhtml.ctr"
if (NULL != vptr) {
if (0 != dk3str_is_bool(vptr)) {
if (0 != dk3str_is_on(vptr)) {
@@ -6514,7 +6740,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 7: {
-#line 5317 "hbhtml.ctr"
+#line 5662 "hbhtml.ctr"
if (NULL != vptr) {
if (0 != dk3str_is_bool(vptr)) {
if (0 != dk3str_is_on(vptr)) {
@@ -6533,7 +6759,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 8: {
-#line 5334 "hbhtml.ctr"
+#line 5679 "hbhtml.ctr"
if (NULL != vptr) {
if (0 != dk3str_is_bool(vptr)) {
if (0 != dk3str_is_on(vptr)) {
@@ -6551,7 +6777,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 9: {
-#line 5350 "hbhtml.ctr"
+#line 5695 "hbhtml.ctr"
if (NULL != vptr) {
cptr = dk3str_dup_app(vptr, job->app);
if (NULL != cptr) {
@@ -6572,7 +6798,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 10: {
-#line 5369 "hbhtml.ctr"
+#line 5714 "hbhtml.ctr"
if (NULL != vptr) {
cptr = dk3str_dup_app(vptr, job->app);
if (NULL != cptr) {
@@ -6599,7 +6825,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 11: {
-#line 5394 "hbhtml.ctr"
+#line 5739 "hbhtml.ctr"
if (NULL != vptr) {
if (NULL == nptr->s_jsfiles) {
nptr->s_jsfiles = dk3sto_open_app(job->app);
@@ -6636,7 +6862,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 12: {
-#line 5429 "hbhtml.ctr"
+#line 5774 "hbhtml.ctr"
if (NULL != vptr) {
if (0 != dk3str_is_bool(vptr)) {
if (0 != dk3str_is_on(vptr)) {
@@ -6655,7 +6881,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
} break;
case 13: {
-#line 5446 "hbhtml.ctr"
+#line 5791 "hbhtml.ctr"
long cn;
if (NULL != vptr) {
if (0 != dk3ma_l_from_string(&cn, vptr, NULL)) {
@@ -6675,7 +6901,7 @@ hbhtml_spcl_handler(void *obj, dkChar *il)
}
-#line 5464 "hbhtml.ctr"
+#line 5809 "hbhtml.ctr"
return back;
}
@@ -6695,10 +6921,10 @@ hbhtml_read_special_comments(hb_job_t *job, hb_node_t *nodeptr)
int inenc;
-#line 5482 "hbhtml.ctr"
+#line 5827 "hbhtml.ctr"
if (NULL != nodeptr->filename) {
-#line 5483 "hbhtml.ctr"
+#line 5828 "hbhtml.ctr"
spcr.job = job;
spcr.nodeptr = nodeptr;
spcr.lineno = 0UL;
@@ -6721,7 +6947,29 @@ hbhtml_read_special_comments(hb_job_t *job, hb_node_t *nodeptr)
}
-#line 5504 "hbhtml.ctr"
+#line 5849 "hbhtml.ctr"
+}
+
+
+
+int
+hbhtml_get_doctype(
+ hb_job_t *job,
+ hb_node_t *nodeptr
+)
+{
+ int back = HTML_DOCTYPE_UNSPECIFIED;
+ while ((HTML_DOCTYPE_UNSPECIFIED == back) && (NULL != nodeptr)) {
+ back = nodeptr->htdt;
+ nodeptr = nodeptr->parent;
+ }
+ if ((HTML_DOCTYPE_UNSPECIFIED == back) && (NULL != job)) {
+ back = job->htdt;
+ }
+ if (HTML_DOCTYPE_UNSPECIFIED == back) {
+ back = HTML_DOCTYPE_5;
+ }
+ return back;
}
@@ -6746,34 +6994,64 @@ hbhtml_write_named_file(
hb_file_processor_t proc; /* Template file processor */
dkChar const *templateName; /* Template file name */
dkChar const *oldsourcefile; /* Old source file name */
+ dkChar const *htlang; /* HTML language */
unsigned long oldsourceline; /* Old source file line */
int inenc; /* Input encoding */
int res; /* Result from file processing */
+ int htdt; /* HTML doctype */
-#line 5532 "hbhtml.ctr"
+#line 5901 "hbhtml.ctr"
-#line 5533 "hbhtml.ctr"
+#line 5902 "hbhtml.ctr"
-#line 5534 "hbhtml.ctr"
+#line 5903 "hbhtml.ctr"
oldsourcefile = dk3app_get_source_file(job->app);
oldsourceline = dk3app_get_source_line(job->app);
dk3app_set_source_line(job->app, nodeptr->lineno);
nodeptr->outFileName = fn;
job->currentnode = nodeptr;
job->of = NULL;
- templateName = hbconf_node_template(job, nodeptr);
+ templateName = hbconf_node_template(nodeptr);
if(templateName) {
dk3app_set_source_file(job->app, templateName);
job->options &= (~(HB_JOB_OPT_CODE));
job->of = dk3sf_fopen_app(fn, dkT("w"), job->app);
if(job->of) {
hbhtml_read_special_comments(job, nodeptr);
- fputs(hbhtml_c8_kw[11], job->of);
- hbhtml_write_header(job, nodeptr, p, n);
- fputs(hbhtml_c8_kw[13], job->of);
+ htdt = hbhtml_get_doctype(job, nodeptr);
+ if (HTML_DOCTYPE_NONE < htdt) {
+ fputs(hbhtml_doctypes[htdt-1], job->of);
+ }
+ if (HTML_DOCTYPE_5 == htdt) {
+ htlang = job->htmllang;
+ if (NULL == htlang) {
+ htlang = dk3app_get_language(job->app);
+ }
+ if (NULL != htlang) {
+ fputs(hbhtml_c8_kw[161], job->of);
+ /*
+ We assume the language is specified correctly
+ using characters from the ASCII set only.
+ */
+ while (dkT('\0') != *htlang) { fputc((char)(*(htlang++)), job->of); }
+ fputs(hbhtml_c8_kw[162], job->of);
+ }
+ else {
+ fputs(hbhtml_c8_kw[11], job->of);
+ }
+ }
+ else {
+ fputs(hbhtml_c8_kw[11], job->of);
+ }
+ hbhtml_write_header(job, nodeptr, p, n, htdt);
+ if (0 != (HB_JOB_OPT_CHM & (job->options))) {
+ fputs(hbhtml_c8_kw[160], job->of);
+ } else {
+ fputs(hbhtml_c8_kw[13], job->of);
+ }
proc.job = job;
proc.in_template = 1;
proc.stm = 0;
@@ -6793,31 +7071,31 @@ hbhtml_write_named_file(
if(1 != res) {
job->exv = 1;
-#line 5568 "hbhtml.ctr"
+#line 5965 "hbhtml.ctr"
}
if(!(dk3sf_fclose_fn_app(job->of, fn, job->app))) {
job->exv = 1;
-#line 5571 "hbhtml.ctr"
+#line 5968 "hbhtml.ctr"
}
} else {
job->exv = 1;
-#line 5574 "hbhtml.ctr"
+#line 5971 "hbhtml.ctr"
}
} else {
/* ERROR: No template! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 19);
job->exv = 1;
-#line 5579 "hbhtml.ctr"
+#line 5976 "hbhtml.ctr"
}
nodeptr->outFileName = NULL;
dk3app_set_source_file(job->app, oldsourcefile);
dk3app_set_source_line(job->app, oldsourceline);
-#line 5584 "hbhtml.ctr"
+#line 5981 "hbhtml.ctr"
}
@@ -6833,7 +7111,7 @@ hbhtml_mark_path(hb_node_t *nodeptr)
hb_node_t *cp; /* Current node */
-#line 5598 "hbhtml.ctr"
+#line 5995 "hbhtml.ctr"
cp = nodeptr;
cp->curchild = NULL;
while(cp) {
@@ -6841,7 +7119,7 @@ hbhtml_mark_path(hb_node_t *nodeptr)
cp = cp->parent;
}
-#line 5604 "hbhtml.ctr"
+#line 6001 "hbhtml.ctr"
}
@@ -6852,7 +7130,7 @@ hbhtml_write_file(hb_job_t *job, hb_node_t *nodeptr, hb_node_t *p, hb_node_t *n)
dkChar bu[DK3_MAX_PATH]; /* File name buffer. */
-#line 5613 "hbhtml.ctr"
+#line 6010 "hbhtml.ctr"
/* Set things up for new file.
*/
@@ -6866,17 +7144,17 @@ hbhtml_write_file(hb_job_t *job, hb_node_t *nodeptr, hb_node_t *p, hb_node_t *n)
if(hbhtml_create_output_filename(bu, DK3_SIZEOF(bu,dkChar), job, nodeptr)) {
-#line 5625 "hbhtml.ctr"
+#line 6022 "hbhtml.ctr"
hbhtml_write_named_file(job, nodeptr, bu, p, n);
} else {
job->exv = 1;
-#line 5628 "hbhtml.ctr"
+#line 6025 "hbhtml.ctr"
}
-#line 5631 "hbhtml.ctr"
+#line 6028 "hbhtml.ctr"
}
diff --git a/support/dktools/hbhtml.ctr b/support/dktools/hbhtml.ctr
index 21031c7787..5727d0ff7b 100644
--- a/support/dktools/hbhtml.ctr
+++ b/support/dktools/hbhtml.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
@@ -74,6 +74,17 @@ hbhtml_create_output_filename(
int
hbhtml_check_link_for_external(dkChar const *link);
+/** Find HTML doctype for a node.
+ @param job Htmlbook job.
+ @param nodeptr Node to start search.
+ @return Doctype for node or job.
+*/
+int
+hbhtml_get_doctype(
+ hb_job_t *job,
+ hb_node_t *nodeptr
+);
+
#ifdef __cplusplus
}
#endif
@@ -172,6 +183,7 @@ STM1_ST_SPEC_PC STM1_I_PERCENT STM1_ST_START STM1_O_EXECUTE
#include "dk3all.h"
#include "dk3strkv.h"
#include "htmlbook.h"
+#include "dk3enc.h"
@@ -518,8 +530,8 @@ src="
#
# 17 18 Generated by
#
-<!-- Generated by htmlbook (see http://dktools.sourceforge.net) -->\n
-<meta name="generator" content="htmlbook">\n
+<!--\nGenerated by htmlbook (see http://sourceforge.net/p/dktools/wiki/htmlbook%20manual/)\n-->\n
+<meta name="generator" content="htmlbook (http://sourceforge.net/p/dktools/wiki/htmlbook/)">\n
#
# 19 20 TITLE tag
#
@@ -744,7 +756,7 @@ text/plain
#
# 114 115
#
-\n<object type="image/svg+xml" data="
+<object type="image/svg+xml" data="
<param name="src" value="
#
# 116 117
@@ -764,7 +776,7 @@ text/plain
# 121 122
#
<script src="
-" type="text/javascript">\n</script>\n
+" type="text/javascript"></script>\n
#
# 123 124 125 126
#
@@ -828,6 +840,64 @@ hb_nm_a_parent
# 155
#
<meta name="keywords" content="
+#
+# 156 157
+#
+&#x
+;&nbsp;
+# &#x2197;&nbsp;
+#
+# 158
+#
+<table class="hb_me_ta">\n
+#
+# 159
+#
+<table class="hb_img_ta">\n
+#
+# 160
+#
+<body bgcolor="#FFFFFF">\n
+#
+# 161, 162
+#
+<html lang="
+">\n
+#
+# 163, 164
+#
+<meta charset="utf-8">\n
+<meta name="viewport" content="width=device-width, initial-scale=1.0">\n
+#
+# 165
+#
+<link rel="stylesheet" href="
+#
+# 166, 167, 168
+#
+"></script>\n
+" async></script>\n
+" type="text/javascript" async></script>\n
+#
+# 169, 170
+#
+<script type="text/javascript" src="
+<script src="
+$!end
+};
+
+
+
+static const char * const hbhtml_doctypes[] = {
+$!string-table
+<!DOCTYPE html>\n
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\n
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">\n
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n
$!end
};
@@ -1118,7 +1188,7 @@ int
hbhtml_url_useable(dk3_c32_t c32)
{
int back = 1;
- $? "+ hbhtml_url_useable %lx %lu", (unsigned long)c32, (unsigned long)c32
+ $? "+ hbhtml_url_useable %lx %lu", dk3enc_uc_to_ul(c32), dk3enc_uc_to_ul(c32)
if((dk3_c32_t)255 < c32) {
back = 0; /* NOT REPORTED */
} $? "- hbhtml_url_useable %d", back
@@ -1139,7 +1209,7 @@ hbhtml_url_must_encode_normally(dk3_c32_t c32)
{
int back = 1;
char c;
- if((dk3_c32_t)128 > c32) {
+ if(128UL > dk3enc_uc_to_ul(c32)) {
c = (char)c32;
c &= 0x7F;
if(('a' <= c) && ('z' >= c)) {
@@ -1176,12 +1246,24 @@ int
hbhtml_url_must_encode(dk3_c32_t c32)
{
int back = 0;
- $? "+ hbhtml_url_must_encode %lx %lu", (unsigned long)c32, (unsigned long)c32
+ $? "+ hbhtml_url_must_encode %lx %lu", dk3enc_uc_to_ul(c32), dk3enc_uc_to_ul(c32)
if((dk3_c32_t)126 < c32) {
back = 1;
} else {
if((dk3_c32_t)33 > c32) {
back = 1;
+ } else {
+#if 0
+ /*
+ 2017-10-10 Removed. Must use &amp; instead of hex notation.
+ */
+ /*
+ 2017-10-03 Recode ampersand.
+ */
+ if (0x00000026UL == c32) {
+ back = 1;
+ }
+#endif
}
} $? "- hbhtml_url_must_encode %d", back
return back;
@@ -1208,14 +1290,19 @@ hbhtml_url_c32(hb_job_t *job, dk3_c32_t c32)
unsigned char ub[16]; /* Buffer for UTF-8 notation */
size_t sz; /* Number of bytes used in ub */
size_t i; /* Traverse ub */
- $? "+ hbhtml_url_c32 0x%lx = %lu", (unsigned long)c32, (unsigned long)c32
+ $? "+ hbhtml_url_c32 0x%lx = %lu", dk3enc_uc_to_ul(c32), dk3enc_uc_to_ul(c32)
if(hbhtml_url_useable(c32)) {
if(hbhtml_url_must_encode(c32)) {
buf[0] = '%';
sprintf(&(buf[1]), "%02X", (unsigned)c32);
fputs(buf, job->of);
} else {
- fputc((((char)c32) & ((char)0x7F)), job->of);
+ if ((dk3_c32_t)'&' == c32) {
+ fputc((((char)c32) & ((char)0x7F)), job->of);
+ }
+ else {
+ fputc((((char)c32) & ((char)0x7F)), job->of);
+ }
}
} else {
job->non_url = 1;
@@ -1254,7 +1341,7 @@ hbhtml_url_flush_shipout(hb_job_t *job)
size_t i; /* Process all source chars */
unsigned char c; /* Current source char to process */
#endif
- $? "+ hbhtml_flush_shipout"
+ $? "+ hbhtml_url_flush_shipout"
if(job->shipused) {
job->non_url = 0;
if(job->shipused < job->bs) {
@@ -1341,7 +1428,7 @@ hbhtml_url_flush_shipout(hb_job_t *job)
job->non_url = 0;
}
job->shipused = 0;
- $? "- hbhtml_flush_shipout"
+ $? "- hbhtml_url_flush_shipout"
}
@@ -1353,8 +1440,8 @@ hbhtml_c32(hb_job_t *job, dk3_c32_t c32)
size_t sz; /* Number of chars used in ub */
size_t i; /* Process all chars in ub */
char c; /* Current char from ub */
- $? "+ hbhtml_c32 0x%lx %lu", (unsigned long)c32, (unsigned long)c32
- if(((dk3_c32_t)128) > c32) {
+ $? "+ hbhtml_c32 0x%lx %lu", dk3enc_uc_to_ul(c32), dk3enc_uc_to_ul(c32)
+ if(128UL > dk3enc_uc_to_ul(c32)) {
c = (((char)c32) & ((char)0x7F));
switch(c) {
case '\n': {
@@ -1401,7 +1488,7 @@ hbhtml_c32(hb_job_t *job, dk3_c32_t c32)
if(hbhtml_translation_table[sz]) {
fputs(hbhtml_translation_table[sz], job->of);
} else {
- fprintf(job->of, "&#x%02lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%02lx;", dk3enc_uc_to_ul(c32));
}
} break;
}
@@ -1412,7 +1499,7 @@ hbhtml_c32(hb_job_t *job, dk3_c32_t c32)
if(hbhtml_translation_table[sz]) {
fputs(hbhtml_translation_table[sz], job->of);
} else {
- fprintf(job->of, "&#x%02lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%02lx;", dk3enc_uc_to_ul(c32));
}
} else {
if(HB_CS_UTF_8 == job->cs) {
@@ -1420,12 +1507,12 @@ hbhtml_c32(hb_job_t *job, dk3_c32_t c32)
for(i = 0; i < sz; i++) { fputc(ub[i], job->of); }
} else {
if(((dk3_c32_t)0x010000UL) > c32) {
- fprintf(job->of, "&#x%04lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%04lx;", dk3enc_uc_to_ul(c32));
} else {
if(((dk3_c32_t)0x01000000UL) > c32) {
- fprintf(job->of, "&#x%06lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%06lx;", dk3enc_uc_to_ul(c32));
} else {
- fprintf(job->of, "&#x%08lx;", (unsigned long)c32);
+ fprintf(job->of, "&#x%08lx;", dk3enc_uc_to_ul(c32));
}
}
}
@@ -1776,12 +1863,11 @@ hbhtml_sc_fn(
@param job Job structure.
@param pa Pointer to arguments.
@param sc Subcommand, may be NULL.
- @param in_template Flag: Processing the template.
@return 1 on success, 0 on error.
*/
static
int
-hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
+hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc)
{
dkChar svgnbuf[DK3_MAX_PATH]; /* SVG file name */
dkChar pdfnbuf[DK3_MAX_PATH]; /* PDF file name */
@@ -1828,6 +1914,7 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
$? "+ hbhtml_process_sp_image pa=\"%!ds\" sc=\"%!ds\"", TR_STR(pa), TR_STR(sc)
sz = DK3_SIZEOF(kv,dk3_key_value_t);
svgnbuf[0] = pdfnbuf[0] = pngnbuf[0] = dkT('\0');
+ svgwh = job->svgwhdef;
if(dk3str_to_key_value(kv, &sz, pa, job->app)) {
$? ". sz = %u", (unsigned)sz
if(sc) { $? ". sub command specified"
@@ -2114,9 +2201,13 @@ hbhtml_process_sp_image(hb_job_t *job, dkChar *pa, dkChar *sc, int in_template)
/* div Open outer div */
fputs(hbhtml_c8_kw[((novsp) ? (145) : (109))], job->of);
/* table */
- fputs(hbhtml_c8_kw[138], job->of);
- hbhtml_output_for_text(job, (job->msg)[65]);
- fputs(hbhtml_c8_kw[143], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbhtml_c8_kw[138], job->of);
+ hbhtml_output_for_text(job, (job->msg)[65]);
+ fputs(hbhtml_c8_kw[143], job->of);
+ } else {
+ fputs(hbhtml_c8_kw[159], job->of);
+ }
/* tr */
fputs(hbhtml_c8_kw[139], job->of);
/* td */
@@ -2712,6 +2803,20 @@ hbhtml_link_to_node(hb_job_t *job, hb_node_t *nptr, int bold)
+/** Instead of writing a navigation menu list separator item,
+ finish current list and start a new one.
+ @param job Job structure.
+*/
+static
+void
+hbhtml_navi_menu_next_list(hb_job_t *job)
+{
+ fputs(hbhtml_c8_kw[32], job->of);
+ fputs(hbhtml_c8_kw[31], job->of);
+}
+
+
+
/** Write the menu entries for a node.
@param job Job structure.
@param nptr Node to write menu entries for.
@@ -2737,7 +2842,11 @@ hbhtml_menu_entries_for_node(hb_job_t *job, hb_node_t *nptr, int sepreq)
if(sepreq) {
if(!(sepdone)) {
sepdone = 1;
+#if VERSION_BEFORE_2020_07_16
fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
}
} $? ". current subnode \"%!ds\"", TR_STR(subnode->title)
active = 1;
@@ -2853,6 +2962,13 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
mnst = 3;
sub = 0;
} $? ". mnst=%d sub=%d", mnst, sub
+ if(((job->currentnode)->options) & HB_NODE_OPT_PRIVACY) {
+ /* When we are writing the menu for the privacy statement page,
+ we print the top menu only.
+ */
+ mnst = 3;
+ sub = 0;
+ } $? ". mnst=%d sub=%d", mnst, sub
fputs(hbhtml_c8_kw[29], job->of);
fputs(hbhtml_c8_kw[31], job->of);
/* Impressum node first, separator.
@@ -2868,7 +2984,15 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
}
}
/* Separator */
- fputs(hbhtml_c8_kw[33], job->of);
+ if (NULL == job->privacynode) {
+ if (NULL == job->privacylink) {
+#if VERSION_BEFORE_2020_07_16
+ fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
+ }
+ }
} else {
if(job->impressumlink) { $? ". have impressum link"
fputs(hbhtml_c8_kw[36], job->of);
@@ -2881,10 +3005,56 @@ hbhtml_process_sp_menu(hb_job_t *job, dkChar *pa)
back = 0; $? "! ERROR"
}
/* Separator */
- fputs(hbhtml_c8_kw[33], job->of);
+ if (NULL == job->privacynode) {
+ if (NULL == job->privacylink) {
+#if VERSION_BEFORE_2020_07_16
+ fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
+ }
+ }
} else { $? ". no impressum link"
}
}
+ /* Privacy node first, separator.
+ */
+ if(job->privacynode) { $? ". have privacy node"
+ if(((job->currentnode)->options) & HB_NODE_OPT_PRIVACY) {
+ if(!hbhtml_link_to_current_node(job, job->privacynode)) {
+ back = 0; $? "! ERROR"
+ }
+ } else {
+ if(!hbhtml_link_to_node(job, job->privacynode, 0)) {
+ back = 0; $? "! ERROR"
+ }
+ }
+ /* Separator */
+#if VERSION_BEFORE_2020_07_16
+ fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
+ } else {
+ if(job->privacylink) { $? ". have privacy link"
+ fputs(hbhtml_c8_kw[36], job->of);
+ res = hbhtml_write_link(
+ job, hbhtml_c8_kw[38], (job->msg)[105], job->privacylink,
+ NULL, (job->msg)[104], NULL
+ );
+ fputs(hbhtml_c8_kw[37], job->of);
+ if(!(res)) {
+ back = 0; $? "! ERROR"
+ }
+ /* Separator */
+#if VERSION_BEFORE_2020_07_16
+ fputs(hbhtml_c8_kw[33], job->of);
+#else
+ hbhtml_navi_menu_next_list(job);
+#endif
+ } else { $? ". no privacy link"
+ }
+ }
/* Now real menu(s)
0=reverse, 1=full, 2=current, 3=top
*/
@@ -3295,12 +3465,11 @@ hbhtml_process_sp_navigation(
/** Process author special command.
@param job Job structure.
- @param pa Program arguments.
@return 1 on success, 0 on error (continue), -1 on error (exit).
*/
static
int
-hbhtml_process_sp_author(hb_job_t *job, dkChar *pa)
+hbhtml_process_sp_author(hb_job_t *job)
{
dkChar const *ptr; /* Author name */
int back = 0;
@@ -3318,12 +3487,11 @@ hbhtml_process_sp_author(hb_job_t *job, dkChar *pa)
/** Process location special command.
@param job Job structure.
- @param pa Program arguments.
@return 1 on success, 0 on error (continue), -1 on error (exit).
*/
static
int
-hbhtml_process_sp_location(hb_job_t *job, dkChar *pa)
+hbhtml_process_sp_location(hb_job_t *job)
{
dkChar const *ptr; /* Location name */
int back = 0;
@@ -3864,9 +4032,11 @@ hbhtml_process_sp_a(hb_job_t *job, dkChar *pa)
dkChar *style = NULL; /* style argument */
size_t sz; /* Number of parameters */
size_t i; /* Traverse parameters */
+ unsigned oldopt = 0; /* Save options */
int external = 0; /* Flag: External link */
int extspec = 0; /* Flag: External specified */
int titlespec = 0; /* Flag: Title specified */
+ int tifl = 0; /* Flag: Title from link */
int back = 0;
$? "+ hbhtml_process_sp_a"
nptr = job->currentnode;
@@ -3962,7 +4132,7 @@ hbhtml_process_sp_a(hb_job_t *job, dkChar *pa)
}
if(titlespec) {
if(!(title)) { title = text; }
- if(!(title)) { title = href; }
+ if(!(title)) { title = href; tifl = 1; }
}
back = 1;
} else {
@@ -3970,102 +4140,166 @@ hbhtml_process_sp_a(hb_job_t *job, dkChar *pa)
back = 1;
}
}
+ /* Checks ok, all required information available.
+ */
if(back) {
/* Write <a...> */
if(href) {
+ /* <a href=" */
fputs(hbhtml_c8_kw[39], job->of);
if(!hbhtml_url_output_for_text(job, href)) { back = 0; }
} else {
+ /* <a name=" */
fputs(hbhtml_c8_kw[74], job->of);
if(!hbhtml_url_output_for_text(job, name)) { back = 0; }
}
if(target) {
+ /* " target=" */
fputs(hbhtml_c8_kw[75], job->of);
if(!hbhtml_url_output_for_text(job, target)) { back = 0; }
} else {
if(external) {
+ /* " target="_blank */
fputs(hbhtml_c8_kw[108], job->of);
}
}
if(type) {
+ /* " type=" */
fputs(hbhtml_c8_kw[76], job->of);
if(!hbhtml_url_output_for_text(job, type)) { back = 0; }
}
+ /* " class=" */
fputs(hbhtml_c8_kw[77], job->of);
if(clptr) {
if(!hbhtml_url_output_for_text(job, clptr)) { back = 0; }
} else {
if(external) {
+ /* hb_a_e */
fputs(hbhtml_c8_kw[101], job->of);
} else {
+ /* hb_a_i */
fputs(hbhtml_c8_kw[100], job->of);
}
}
if(idptr) {
+ /* " id=" */
fputs(hbhtml_c8_kw[78], job->of);
if(!hbhtml_url_output_for_text(job, idptr)) { back = 0; }
}
if(style) {
+ /* " style=" */
fputs(hbhtml_c8_kw[79], job->of);
if(!hbhtml_url_output_for_text(job, style)) { back = 0; }
}
if(hrefl) {
+ /* " hreflang=" */
fputs(hbhtml_c8_kw[80], job->of);
if(!hbhtml_url_output_for_text(job, hrefl)) { back = 0; }
}
if(title) {
+ /* " title=" */
fputs(hbhtml_c8_kw[81], job->of);
+ if ((0 != external) && (0 != job->markel) && (0 < strlen(job->elmbuf))) {
+ /* &#x */
+ fputs(hbhtml_c8_kw[156], job->of);
+ fputs(job->elmbuf, job->of);
+ /* ;&nbsp; */
+ fputs(hbhtml_c8_kw[157], job->of);
+ }
+ /* ##### a title, Ausgabe des href als Title */
+ oldopt = (job->currentnode)->options;
+ if (0 != tifl) {
+ (job->currentnode)->options &= (~(HB_NODE_OPT_REPLACE_AMPERSAND));
+ }
if(!hbhtml_output_for_text(job, title)) { back = 0; }
+ (job->currentnode)->options = oldopt;
+ } else {
+ if ((0 != external) && (0 != job->markel) && (0 < strlen(job->elmbuf))) {
+ /* " title=" */
+ fputs(hbhtml_c8_kw[81], job->of);
+ /* &#x */
+ fputs(hbhtml_c8_kw[156], job->of);
+ fputs(job->elmbuf, job->of);
+ /* ;&nbsp; */
+ fputs(hbhtml_c8_kw[157], job->of);
+ }
}
if(onblur) {
+ /* " onblur=" */
fputs(hbhtml_c8_kw[82], job->of);
if(!hbhtml_url_output_for_text(job, onblur)) { back = 0; }
}
if(onfocus) {
+ /* " onfocus=" */
fputs(hbhtml_c8_kw[83], job->of);
if(!hbhtml_url_output_for_text(job, onfocus)) { back = 0; }
}
if(rel) {
+ /* " rel=" */
fputs(hbhtml_c8_kw[84], job->of);
if(!hbhtml_url_output_for_text(job, rel)) { back = 0; }
}
if(rev) {
+ /* " rev=" */
fputs(hbhtml_c8_kw[85], job->of);
if(!hbhtml_url_output_for_text(job, rev)) { back = 0; }
}
if(shape) {
+ /* " shape=" */
fputs(hbhtml_c8_kw[86], job->of);
if(!hbhtml_url_output_for_text(job, shape)) { back = 0; }
}
if(tabind) {
+ /* " tabindex=" */
fputs(hbhtml_c8_kw[87], job->of);
if(!hbhtml_url_output_for_text(job, tabind)) { back = 0; }
}
if(accessk) {
+ /* " accesskey=" */
fputs(hbhtml_c8_kw[88], job->of);
if(!hbhtml_url_output_for_text(job, accessk)) { back = 0; }
}
if(charset) {
+ /* " charset=" */
fputs(hbhtml_c8_kw[89], job->of);
if(!hbhtml_url_output_for_text(job, charset)) { back = 0; }
}
if(coords) {
+ /* " coords=" */
fputs(hbhtml_c8_kw[90], job->of);
if(!hbhtml_url_output_for_text(job, coords)) { back = 0; }
}
+ /* " */
fputs(hbhtml_c8_kw[5], job->of);
+ /* > */
fputs(hbhtml_c8_kw[3], job->of);
if(href) {
if(text) {
if(!hbhtml_output_for_text(job, text)) { back = 0; }
} else {
+ /* ##### Link-Text, Ausgabe des href-Attributes als Text */
+ /* Save options
+ */
+ oldopt = (job->currentnode)->options;
+ /*
+ Replace ampersands
+ */
+ (job->currentnode)->options &= (~(HB_NODE_OPT_REPLACE_AMPERSAND));
+ /*
+ Write href text as hyperlink text
+ */
if(!hbhtml_output_for_text(job, href)) { back = 0; }
+ /*
+ Restore options
+ */
+ (job->currentnode)->options = oldopt;
}
}
+ /* </a> */
fputs(hbhtml_c8_kw[41], job->of);
if((href) && (external) && (text)) {
/* Save link and write link number */
- linkptr = dk3sto_it_find_like(nptr->i_lbyurl, href, 1);
+ linkptr = (hb_link_t *)dk3sto_it_find_like(nptr->i_lbyurl, href, 1);
if(linkptr) {
fprintf(job->of, hbhtml_c8_kw[91], (1UL + linkptr->lno));
} else {
@@ -4148,9 +4382,13 @@ hbhtml_process_sp_menuentry(hb_job_t *job, dkChar *pa)
}
if(n_items) {
back = 1;
- fputs(hbhtml_c8_kw[92], job->of);
- if(!hbhtml_output_for_text(job, (job->msg)[60])) { back = 0; }
- fputs(hbhtml_c8_kw[22], job->of);
+ if (0 != job->tabsum) {
+ fputs(hbhtml_c8_kw[92], job->of);
+ if(!hbhtml_output_for_text(job, (job->msg)[60])) { back = 0; }
+ fputs(hbhtml_c8_kw[22], job->of);
+ } else {
+ fputs(hbhtml_c8_kw[158], job->of);
+ }
for(cr = 0; cr < n_items; cr++) {
fputs(hbhtml_c8_kw[94], job->of);
if(cr) {
@@ -4410,12 +4648,11 @@ html_process_sp_sourcefile(hb_job_t *job, dkChar *pa)
/** Process sourcefile special command.
@param job Job structure.
- @param pa Program arguemnts.
@return 1 on success, 0 on error (continue), -1 on error (exit).
*/
static
int
-html_process_sp_htmlname(hb_job_t *job, dkChar *pa)
+html_process_sp_htmlname(hb_job_t *job)
{
dkChar buf[DK3_MAX_PATH];
size_t szbuf = DK3_SIZEOF(buf,dkChar);
@@ -4561,7 +4798,7 @@ hbhtml_process_special(
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 2: { $? ". image"
- back = hbhtml_process_sp_image(job, pa, sc, in_template);
+ back = hbhtml_process_sp_image(job, pa, sc);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 3: { $? ". menu"
@@ -4577,11 +4814,11 @@ hbhtml_process_special(
back = 1;
} break;
case 6: { $? ". author"
- back = hbhtml_process_sp_author(job, pa);
+ back = hbhtml_process_sp_author(job);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 7: { $? ". location"
- back = hbhtml_process_sp_location(job, pa);
+ back = hbhtml_process_sp_location(job);
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 8: { $? ". date"
@@ -4618,7 +4855,7 @@ hbhtml_process_special(
if(1 != back) { dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 39); }
} break;
case 15: {
- back = html_process_sp_htmlname(job, pa);
+ back = html_process_sp_htmlname(job);
} break;
case 16: {
back = html_process_sp_hint(job, pa);
@@ -4742,6 +4979,24 @@ hbhtml_line_handler(void *obj, dkChar *il)
}
}
} break;
+ case dkT('#'): {
+ /* We can escape a leading raute.
+ */
+ if(1 < pos) {
+ xmsg[0] = dkT('\\');
+ xmsg[1] = c;
+ xmsg[2] = dkT('\0');
+ dk3app_log_3(job->app, DK3_LL_WARNING, job->msg, 63, 64, xmsg);
+ }
+ if (!hbhtml_code_line_start(job)) { back = 0; }
+ if(!(hbhtml_shipout(job, c))) {
+ back = 0; $? "! ERROR"
+ if(0 == ltl) {
+ ltl = 1;
+ /* ERROR: Line too long! */
+ }
+ }
+ } break;
default: {
xmsg[0] = dkT('\\');
xmsg[1] = c;
@@ -4908,20 +5163,24 @@ hbhtml_line_handler(void *obj, dkChar *il)
/** Write JS files to HTML header.
@param job Job structure.
- @param nptr
+ @param nptr Node to write JS file list for.
+ @param htdt Document type.
@return 1 on success, 0 on error.
*/
static
int
-hbhtml_write_js_files(hb_job_t *job, hb_node_t *nptr)
+hbhtml_write_js_files(hb_job_t *job, hb_node_t *nptr, int htdt)
{
- hb_link_t *linkptr; /* File name data for JavaScript file */
- int back = 1;
+
+ const char * const *scrptr; /* Script pointer */
+ hb_link_t *linkptr; /* File name data for JavaScript file */
+ int back = 1;
+
/* Write parent JS files.
*/
if(nptr->parent) {
if(!((nptr->options) & HB_NODE_OPT_STOP_JS_INHERITANCE)) {
- hbhtml_write_js_files(job, nptr->parent);
+ hbhtml_write_js_files(job, nptr->parent, htdt);
}
}
@@ -4933,10 +5192,48 @@ hbhtml_write_js_files(hb_job_t *job, hb_node_t *nptr)
if(linkptr->url) {
fputs(hbhtml_c8_kw[121], job->of);
if(!hbhtml_url_output_for_text(job, linkptr->url)) { back = 0; }
- fputs(hbhtml_c8_kw[122], job->of);
+ fputs(
+ hbhtml_c8_kw[
+ (HTML_DOCTYPE_5 == htdt)
+ ? (
+ (0 != (LINK_FLAG_SCRIPT_ASYNC & (linkptr->flags)))
+ ? (167) : (166)
+ )
+ : (
+ (0 != (LINK_FLAG_SCRIPT_ASYNC & (linkptr->flags)))
+ ? (168) : (122)
+ )
+ ],
+ job->of
+ );
+ }
+ }
+ }
+
+ /* Write script code to fold and unfold page table of contents
+ */
+ if (0 != (HB_NODE_OPT_PAGE_TOC & (nptr->options))) {
+ if (0 != (HB_JOB_OPT_FOLD_PTOC & (job->options))) {
+ if (NULL != job->ptocjsfile) {
+ job->ptocjsused = 1;
+ /*
+ script-tag
+ */
+ fputs(
+ hbhtml_c8_kw[(HTML_DOCTYPE_5 == htdt) ? (170) : (169)],
+ job->of
+ );
+ /* Script text
+ */
+ if(!hbhtml_url_output_for_text(job, job->ptocjsfile)) { back = 0; }
+ /*
+ End script-tag
+ */
+ fputs(hbhtml_c8_kw[166], job->of);
}
}
}
+
return back;
}
@@ -4944,7 +5241,7 @@ hbhtml_write_js_files(hb_job_t *job, hb_node_t *nptr)
/** Write one head navigation entry.
@param job Job structure.
- @param nptr Node (may be NULL for impressum).
+ @param nptr Node (may be NULL for impressum or privacy).
@param url URL to use if nptr is NULL.
@param titleind Title index if nptr is NULL.
@param linkkwind Link keyword index.
@@ -5026,14 +5323,34 @@ hbhtml_write_head_navigation(
hbhtml_one_head_navigation(job, NULL, job->impressumlink, 61, 127, 0);
}
}
+ if(job->privacynode) {
+ nptr = job->privacynode;
+ hbhtml_one_head_navigation(job, nptr, NULL, 0, 127, 0);
+ } else {
+ if(job->privacylink) {
+ hbhtml_one_head_navigation(job, NULL, job->privacylink, 104, 127, 0);
+ }
+ }
if(job->rootnode) {
hbhtml_one_head_navigation(
job, job->rootnode, NULL, 0, 128,
- (((job->options) & HB_JOB_OPT_CREATE_TOC) ? 136 : 0)
+ (
+ (
+ (0 != ((job->options) & HB_JOB_OPT_CREATE_TOC))
+ && (0 == ((job->options) & HB_JOB_OPT_CHM))
+ )
+ ? 136 : 0
+ )
);
hbhtml_one_head_navigation(
job, job->rootnode, NULL, 0, 129,
- (((job->options) & HB_JOB_OPT_CREATE_INDEX) ? 137 : 0)
+ (
+ (
+ (0 != ((job->options) & HB_JOB_OPT_CREATE_INDEX))
+ && (0 == ((job->options) & HB_JOB_OPT_CHM))
+ )
+ ? 137 : 0
+ )
);
hbhtml_one_head_navigation(job, job->rootnode, NULL, 0, 130, 0);
}
@@ -5066,19 +5383,42 @@ hbhtml_write_head_navigation(
@param nodeptr Current node to write.
@param prev Previous node.
@param next Next node.
+ @param htdt HTML doc type to use.
*/
static
void
hbhtml_write_header(
- hb_job_t *job, hb_node_t *nodeptr, hb_node_t *prev, hb_node_t *next
+ hb_job_t *job, hb_node_t *nodeptr, hb_node_t *prev, hb_node_t *next, int htdt
)
{
dkChar const *ptr; /* Multiple text elements */
$? "+ hbhtml_write_header"
fputs(hbhtml_c8_kw[15], job->of);
+ /*
+ Meta charset, viewport
+ */
+ if (HTML_DOCTYPE_5 == htdt) {
+ if (HB_CS_UTF_8 == job->cs) {
+ fputs(hbhtml_c8_kw[163], job->of);
+ }
+ fputs(hbhtml_c8_kw[164], job->of);
+ }
/* Title
*/
fputs(hbhtml_c8_kw[19], job->of);
+#if 1
+ if (((job->options) & HB_JOB_OPT_NUM_IN_PAGE_HEADER)) {
+ if (!((job->options) & HB_JOB_OPT_CHM)) {
+ if (NULL != job->currentnode) {
+ if((job->currentnode)->depth < job->headlevels) {
+ if(hbtool_write_header_number(job, job->currentnode)) {
+ hbhtml_output_for_text(job, (job->kwnl[35]));
+ }
+ }
+ }
+ }
+ }
+#endif
hbhtml_output_for_text(job, hbconf_title(nodeptr));
fputs(hbhtml_c8_kw[20], job->of);
/* Generator (comment)
@@ -5094,7 +5434,7 @@ hbhtml_write_header(
ptr = hbconf_stylefile(nodeptr);
if(ptr) {
if(!hbtool_add_file(job, ptr)) { job->exv = 1; }
- fputs(hbhtml_c8_kw[21], job->of);
+ fputs(hbhtml_c8_kw[(HTML_DOCTYPE_5 == htdt) ? (165) : (21)], job->of);
hbhtml_url_output_for_text(job, ptr);
fputs(hbhtml_c8_kw[22], job->of);
}
@@ -5111,10 +5451,12 @@ hbhtml_write_header(
hbhtml_write_head_navigation(job, nodeptr, prev, next);
/* Character set (meta)
*/
- if(HB_CS_UTF_8 == job->cs) {
- fputs(hbhtml_c8_kw[24], job->of);
- } else {
- fputs(hbhtml_c8_kw[23], job->of);
+ if (HTML_DOCTYPE_5 != htdt) {
+ if(HB_CS_UTF_8 == job->cs) {
+ fputs(hbhtml_c8_kw[24], job->of);
+ } else {
+ fputs(hbhtml_c8_kw[23], job->of);
+ }
}
/* Author (meta)
*/
@@ -5140,7 +5482,10 @@ hbhtml_write_header(
}
/* JavaScript files.
*/
- (void)hbhtml_write_js_files(job, nodeptr);
+ (void)hbhtml_write_js_files(job, nodeptr, htdt);
+ /*
+ End header tag
+ */
fputs(hbhtml_c8_kw[16], job->of); $? "- hbhtml_write_header"
}
@@ -5505,6 +5850,28 @@ hbhtml_read_special_comments(hb_job_t *job, hb_node_t *nodeptr)
+int
+hbhtml_get_doctype(
+ hb_job_t *job,
+ hb_node_t *nodeptr
+)
+{
+ int back = HTML_DOCTYPE_UNSPECIFIED;
+ while ((HTML_DOCTYPE_UNSPECIFIED == back) && (NULL != nodeptr)) {
+ back = nodeptr->htdt;
+ nodeptr = nodeptr->parent;
+ }
+ if ((HTML_DOCTYPE_UNSPECIFIED == back) && (NULL != job)) {
+ back = job->htdt;
+ }
+ if (HTML_DOCTYPE_UNSPECIFIED == back) {
+ back = HTML_DOCTYPE_5;
+ }
+ return back;
+}
+
+
+
/** Write one output file.
@param job Job structure.
@param nodeptr Current node to write.
@@ -5525,9 +5892,11 @@ hbhtml_write_named_file(
hb_file_processor_t proc; /* Template file processor */
dkChar const *templateName; /* Template file name */
dkChar const *oldsourcefile; /* Old source file name */
+ dkChar const *htlang; /* HTML language */
unsigned long oldsourceline; /* Old source file line */
int inenc; /* Input encoding */
int res; /* Result from file processing */
+ int htdt; /* HTML doctype */
$? "+ hbhtml_write_named_file"
$? ". input file \"%!ds\"", TR_STR(nodeptr->filename)
$? ". output file \"%!ds\"", fn
@@ -5537,16 +5906,44 @@ hbhtml_write_named_file(
nodeptr->outFileName = fn;
job->currentnode = nodeptr;
job->of = NULL;
- templateName = hbconf_node_template(job, nodeptr);
+ templateName = hbconf_node_template(nodeptr);
if(templateName) {
dk3app_set_source_file(job->app, templateName);
job->options &= (~(HB_JOB_OPT_CODE));
job->of = dk3sf_fopen_app(fn, dkT("w"), job->app);
if(job->of) {
hbhtml_read_special_comments(job, nodeptr);
- fputs(hbhtml_c8_kw[11], job->of);
- hbhtml_write_header(job, nodeptr, p, n);
- fputs(hbhtml_c8_kw[13], job->of);
+ htdt = hbhtml_get_doctype(job, nodeptr);
+ if (HTML_DOCTYPE_NONE < htdt) {
+ fputs(hbhtml_doctypes[htdt-1], job->of);
+ }
+ if (HTML_DOCTYPE_5 == htdt) {
+ htlang = job->htmllang;
+ if (NULL == htlang) {
+ htlang = dk3app_get_language(job->app);
+ }
+ if (NULL != htlang) {
+ fputs(hbhtml_c8_kw[161], job->of);
+ /*
+ We assume the language is specified correctly
+ using characters from the ASCII set only.
+ */
+ while (dkT('\0') != *htlang) { fputc((char)(*(htlang++)), job->of); }
+ fputs(hbhtml_c8_kw[162], job->of);
+ }
+ else {
+ fputs(hbhtml_c8_kw[11], job->of);
+ }
+ }
+ else {
+ fputs(hbhtml_c8_kw[11], job->of);
+ }
+ hbhtml_write_header(job, nodeptr, p, n, htdt);
+ if (0 != (HB_JOB_OPT_CHM & (job->options))) {
+ fputs(hbhtml_c8_kw[160], job->of);
+ } else {
+ fputs(hbhtml_c8_kw[13], job->of);
+ }
proc.job = job;
proc.in_template = 1;
proc.stm = 0;
diff --git a/support/dktools/hbhtml.h b/support/dktools/hbhtml.h
index a0e8828d54..1f94bcfc0e 100644
--- a/support/dktools/hbhtml.h
+++ b/support/dktools/hbhtml.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbhtml.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbhtml.ctr
*/
/** @file hbhtml.h Header file for the hbhtml module.
@@ -110,6 +88,17 @@ hbhtml_create_output_filename(
int
hbhtml_check_link_for_external(dkChar const *link);
+/** Find HTML doctype for a node.
+ @param job Htmlbook job.
+ @param nodeptr Node to start search.
+ @return Doctype for node or job.
+*/
+int
+hbhtml_get_doctype(
+ hb_job_t *job,
+ hb_node_t *nodeptr
+);
+
#ifdef __cplusplus
}
#endif
diff --git a/support/dktools/hbimgdim.c b/support/dktools/hbimgdim.c
index 59b5b8e333..075f2f968f 100644
--- a/support/dktools/hbimgdim.c
+++ b/support/dktools/hbimgdim.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbimgdim.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbimgdim.ctr
*/
/** @file hbimgdim.c The hbimgdim module.
@@ -52,6 +30,41 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/** File name suffixes used by SVG files.
+*/
+static const dkChar * const svg_suffixes[] = {
+ dkT(".svg"), dkT(".svgz"), NULL
+};
+
+
+
+static
+int
+is_svg_file(dkChar const *fn)
+{
+ const dkChar *psuff = NULL;
+ int back = 0;
+ int ind;
+
+
+#line 97 "hbimgdim.ctr"
+ if (NULL != fn) {
+ psuff = dk3str_get_suffix(fn);
+ if (NULL != psuff) {
+ ind = dk3str_array_index(svg_suffixes, psuff, 0);
+ if (-1 < ind) {
+ back = 1;
+ }
+ }
+ }
+
+
+#line 107 "hbimgdim.ctr"
+ return back;
+}
+
+
+
int
hbimgdim_compare(void const *l, void const *r, int cr)
{
@@ -60,7 +73,7 @@ hbimgdim_compare(void const *l, void const *r, int cr)
hb_img_dim_t *pr;
-#line 88 "hbimgdim.ctr"
+#line 119 "hbimgdim.ctr"
if(l) {
if(r) {
pl = (hb_img_dim_t *)l;
@@ -80,7 +93,7 @@ hbimgdim_compare(void const *l, void const *r, int cr)
if(r) back = -1;
}
-#line 106 "hbimgdim.ctr"
+#line 137 "hbimgdim.ctr"
return back;
}
@@ -91,7 +104,7 @@ hbimgdim_delete(hb_img_dim_t *ptr)
{
-#line 115 "hbimgdim.ctr"
+#line 146 "hbimgdim.ctr"
if(ptr) {
dk3_release(ptr->fn);
ptr->w = 0UL;
@@ -99,7 +112,7 @@ hbimgdim_delete(hb_img_dim_t *ptr)
dk3_delete(ptr);
}
-#line 121 "hbimgdim.ctr"
+#line 152 "hbimgdim.ctr"
}
@@ -110,7 +123,7 @@ hbimgdim_new(dkChar const *fn, unsigned long w, unsigned long h, dk3_app_t *app)
hb_img_dim_t *back = NULL;
-#line 130 "hbimgdim.ctr"
+#line 161 "hbimgdim.ctr"
back = dk3_new_app(hb_img_dim_t,1,app);
if(back) {
back->w = w;
@@ -122,7 +135,7 @@ hbimgdim_new(dkChar const *fn, unsigned long w, unsigned long h, dk3_app_t *app)
}
}
-#line 140 "hbimgdim.ctr"
+#line 171 "hbimgdim.ctr"
return back;
}
@@ -144,37 +157,41 @@ hbimgdim_find(
int back = 0;
-#line 160 "hbimgdim.ctr"
+#line 191 "hbimgdim.ctr"
if((job) && (fn) && (w) && (h)) {
- idptr = dk3sto_it_find_like(job->i_imgdim, fn, 1);
+ idptr = (hb_img_dim_t *)dk3sto_it_find_like(job->i_imgdim, fn, 1);
if(idptr) {
*w = idptr->w;
*h = idptr->h;
back = 1;
} else {
- bp = dk3bif_open_filename_app(fn, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app);
- if(bp) {
- xw = dk3bif_get_width(bp);
- xh = dk3bif_get_height(bp);
- dk3bif_close(bp);
- if((xw) && (xh)) {
- *w = xw;
- *h = xh;
- back = 1;
- if(save) {
- idptr = hbimgdim_new(fn, xw, xh, job->app);
- if(idptr) {
- if(!(dk3sto_add(job->s_imgdim, idptr))) {
- hbimgdim_delete(idptr);
+ if (0 == is_svg_file(fn)) {
+ bp = dk3bif_open_filename_app(fn, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app);
+ if(bp) {
+ xw = dk3bif_get_width(bp);
+ xh = dk3bif_get_height(bp);
+ dk3bif_close(bp);
+ if((xw) && (xh)) {
+ *w = xw;
+ *h = xh;
+ back = 1;
+ if(save) {
+ idptr = hbimgdim_new(fn, xw, xh, job->app);
+ if(idptr) {
+ if(!(dk3sto_add(job->s_imgdim, idptr))) {
+ hbimgdim_delete(idptr);
+ }
}
}
}
- }
+ }
+ } else {
+ /* TODO: Find SVG width and height */
}
}
}
-#line 188 "hbimgdim.ctr"
+#line 223 "hbimgdim.ctr"
return back;
}
diff --git a/support/dktools/hbimgdim.ctr b/support/dktools/hbimgdim.ctr
index 920d9950e2..f8e3ca3e8b 100644
--- a/support/dktools/hbimgdim.ctr
+++ b/support/dktools/hbimgdim.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -78,6 +78,37 @@ $!trace-include
+/** File name suffixes used by SVG files.
+*/
+static const dkChar * const svg_suffixes[] = {
+ dkT(".svg"), dkT(".svgz"), NULL
+};
+
+
+
+static
+int
+is_svg_file(dkChar const *fn)
+{
+ const dkChar *psuff = NULL;
+ int back = 0;
+ int ind;
+ $? "+ is_svg_file \"%!ds\"", fn
+ if (NULL != fn) {
+ psuff = dk3str_get_suffix(fn);
+ if (NULL != psuff) {
+ ind = dk3str_array_index(svg_suffixes, psuff, 0);
+ if (-1 < ind) {
+ back = 1;
+ }
+ }
+ }
+ $? "- is_svg_file %d", back
+ return back;
+}
+
+
+
int
hbimgdim_compare(void const *l, void const *r, int cr)
{
@@ -158,30 +189,34 @@ hbimgdim_find(
int back = 0;
$? "+ hbimgdim_find"
if((job) && (fn) && (w) && (h)) {
- idptr = dk3sto_it_find_like(job->i_imgdim, fn, 1);
+ idptr = (hb_img_dim_t *)dk3sto_it_find_like(job->i_imgdim, fn, 1);
if(idptr) {
*w = idptr->w;
*h = idptr->h;
back = 1;
} else {
- bp = dk3bif_open_filename_app(fn, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app);
- if(bp) {
- xw = dk3bif_get_width(bp);
- xh = dk3bif_get_height(bp);
- dk3bif_close(bp);
- if((xw) && (xh)) {
- *w = xw;
- *h = xh;
- back = 1;
- if(save) {
- idptr = hbimgdim_new(fn, xw, xh, job->app);
- if(idptr) {
- if(!(dk3sto_add(job->s_imgdim, idptr))) {
- hbimgdim_delete(idptr);
+ if (0 == is_svg_file(fn)) {
+ bp = dk3bif_open_filename_app(fn, DK3_BIF_IMAGE_TYPE_UNKNOWN, job->app);
+ if(bp) {
+ xw = dk3bif_get_width(bp);
+ xh = dk3bif_get_height(bp);
+ dk3bif_close(bp);
+ if((xw) && (xh)) {
+ *w = xw;
+ *h = xh;
+ back = 1;
+ if(save) {
+ idptr = hbimgdim_new(fn, xw, xh, job->app);
+ if(idptr) {
+ if(!(dk3sto_add(job->s_imgdim, idptr))) {
+ hbimgdim_delete(idptr);
+ }
}
}
}
- }
+ }
+ } else {
+ /* TODO: Find SVG width and height */
}
}
} $? "- hbimgdim_find %d", back
diff --git a/support/dktools/hbimgdim.h b/support/dktools/hbimgdim.h
index 0c1597513e..b3341b11f0 100644
--- a/support/dktools/hbimgdim.h
+++ b/support/dktools/hbimgdim.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbimgdim.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbimgdim.ctr
*/
/** @file hbimgdim.h Header file for the hbimgdim module.
diff --git a/support/dktools/hbindex.c b/support/dktools/hbindex.c
index e8f64f7dc2..f258920785 100644
--- a/support/dktools/hbindex.c
+++ b/support/dktools/hbindex.c
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: hbindex.ctr
@@ -9,7 +15,7 @@
*/
-#line 56 "hbindex.ctr"
+#line 59 "hbindex.ctr"
#include "dk3all.h"
@@ -19,7 +25,7 @@
-#line 64 "hbindex.ctr"
+#line 67 "hbindex.ctr"
@@ -31,7 +37,7 @@ hbindex_compare(void const *l, void const *r, int cr)
int back = 0;
-#line 74 "hbindex.ctr"
+#line 77 "hbindex.ctr"
if(l) {
if(r) {
pl = (hb_index_entry_t const *)l;
@@ -98,7 +104,7 @@ hbindex_compare(void const *l, void const *r, int cr)
}
}
-#line 139 "hbindex.ctr"
+#line 142 "hbindex.ctr"
return back;
}
@@ -109,20 +115,20 @@ hbindex_delete(hb_index_entry_t *pi)
{
-#line 148 "hbindex.ctr"
+#line 151 "hbindex.ctr"
if(pi) {
-#line 150 "hbindex.ctr"
+#line 153 "hbindex.ctr"
-#line 151 "hbindex.ctr"
+#line 154 "hbindex.ctr"
-#line 152 "hbindex.ctr"
+#line 155 "hbindex.ctr"
-#line 153 "hbindex.ctr"
+#line 156 "hbindex.ctr"
pi->no = NULL;
dk3_release(pi->tx);
dk3_release(pi->fn);
@@ -131,7 +137,7 @@ hbindex_delete(hb_index_entry_t *pi)
dk3_delete(pi);
}
-#line 160 "hbindex.ctr"
+#line 163 "hbindex.ctr"
}
@@ -149,7 +155,7 @@ hbindex_new(
int ok = 0;
-#line 176 "hbindex.ctr"
+#line 179 "hbindex.ctr"
if((tx) && (fn)) {
back = dk3_new_app(hb_index_entry_t,1,app);
if(back) {
@@ -174,7 +180,7 @@ hbindex_new(
}
}
-#line 199 "hbindex.ctr"
+#line 202 "hbindex.ctr"
return back;
}
@@ -186,7 +192,7 @@ hb_index_write_anchor(hb_job_t *job, hb_index_entry_t *in)
int back = 0;
-#line 209 "hbindex.ctr"
+#line 212 "hbindex.ctr"
if((job) && (in)) {
back = 1;
if(in->an) {
@@ -202,7 +208,7 @@ hb_index_write_anchor(hb_job_t *job, hb_index_entry_t *in)
}
}
-#line 223 "hbindex.ctr"
+#line 226 "hbindex.ctr"
return back;
}
diff --git a/support/dktools/hbindex.ctr b/support/dktools/hbindex.ctr
index 35b4396e30..2e2f872dcf 100644
--- a/support/dktools/hbindex.ctr
+++ b/support/dktools/hbindex.ctr
@@ -1,4 +1,7 @@
%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/hbindex.h b/support/dktools/hbindex.h
index 311319eb12..977a911f94 100644
--- a/support/dktools/hbindex.h
+++ b/support/dktools/hbindex.h
@@ -1,5 +1,11 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: hbindex.ctr
@@ -13,7 +19,7 @@
#define HBINDEX_H_INCLUDED 1
-#line 4 "hbindex.ctr"
+#line 7 "hbindex.ctr"
#ifdef __cplusplus
extern "C" {
diff --git a/support/dktools/hbnode.c b/support/dktools/hbnode.c
index 0d246e06c9..87da973e0b 100644
--- a/support/dktools/hbnode.c
+++ b/support/dktools/hbnode.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbnode.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbnode.ctr
*/
/** @file hbnode.c The hbnode module.
@@ -41,12 +19,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "htmlbook.h"
#include "dk3all.h"
+#include "dk3unused.h"
-#line 92 "hbnode.ctr"
+#line 93 "hbnode.ctr"
@@ -55,14 +34,14 @@ hbnode_link_delete(hb_link_t *ptr)
{
-#line 99 "hbnode.ctr"
+#line 100 "hbnode.ctr"
if(ptr) {
ptr->lno = 0UL;
dk3_release(ptr->url);
dk3_delete(ptr);
}
-#line 104 "hbnode.ctr"
+#line 105 "hbnode.ctr"
}
@@ -73,12 +52,13 @@ hbnode_link_new(dkChar const *url, unsigned long lno, dk3_app_t *app)
hb_link_t *back = NULL;
-#line 113 "hbnode.ctr"
+#line 114 "hbnode.ctr"
if(url) {
back = dk3_new_app(hb_link_t,1,app);
if(back) {
- back->lno = lno;
- back->url = dk3str_dup_app(url,app);
+ back->lno = lno;
+ back->url = dk3str_dup_app(url,app);
+ back->flags = 0;
if(!(back->url)) {
hbnode_link_delete(back);
back = NULL;
@@ -86,7 +66,7 @@ hbnode_link_new(dkChar const *url, unsigned long lno, dk3_app_t *app)
}
}
-#line 124 "hbnode.ctr"
+#line 126 "hbnode.ctr"
return back;
}
@@ -100,7 +80,7 @@ hbnode_link_compare(const void *l, const void *r, int cr)
int back = 0;
-#line 136 "hbnode.ctr"
+#line 138 "hbnode.ctr"
if(l) {
if(r) {
pl = (hb_link_t *)l;
@@ -130,21 +110,22 @@ hbnode_link_compare(const void *l, const void *r, int cr)
if(r) back = -1;
}
-#line 164 "hbnode.ctr"
+#line 166 "hbnode.ctr"
return back;
}
int
-hb_node_compare(void const *l, void const *r, int cr)
+hb_node_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
hb_node_t const *pl;
hb_node_t const *pr;
int back = 0;
-#line 176 "hbnode.ctr"
+#line 178 "hbnode.ctr"
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (hb_node_t const *)l;
@@ -165,7 +146,7 @@ hb_node_compare(void const *l, void const *r, int cr)
}
}
-#line 195 "hbnode.ctr"
+#line 198 "hbnode.ctr"
return back;
}
@@ -180,7 +161,7 @@ hb_node_delete(hb_node_t *ptr)
if(ptr) {
-#line 208 "hbnode.ctr"
+#line 211 "hbnode.ctr"
if(ptr->s_lbylno) {
if(ptr->i_lbylno) {
dk3sto_it_close(ptr->i_lbylno);
@@ -227,7 +208,7 @@ hb_node_delete(hb_node_t *ptr)
while(NULL != (linkptr = (hb_link_t *)dk3sto_it_next(ptr->i_jsfiles))) {
-#line 253 "hbnode.ctr"
+#line 256 "hbnode.ctr"
hbnode_link_delete(linkptr);
}
dk3sto_it_close(ptr->i_jsfiles);
@@ -251,87 +232,87 @@ hb_node_delete(hb_node_t *ptr)
#if TRACE_DEBUG
-#line 275 "hbnode.ctr"
+#line 278 "hbnode.ctr"
-#line 276 "hbnode.ctr"
+#line 279 "hbnode.ctr"
-#line 277 "hbnode.ctr"
+#line 280 "hbnode.ctr"
-#line 278 "hbnode.ctr"
+#line 281 "hbnode.ctr"
if(ptr->parent) {
-#line 279 "hbnode.ctr"
+#line 282 "hbnode.ctr"
}
if(ptr->title) {
-#line 281 "hbnode.ctr"
+#line 284 "hbnode.ctr"
}
if(ptr->shorttitle) {
-#line 283 "hbnode.ctr"
+#line 286 "hbnode.ctr"
}
if(ptr->fulltitle) {
-#line 285 "hbnode.ctr"
+#line 288 "hbnode.ctr"
}
if(ptr->filename) {
-#line 287 "hbnode.ctr"
+#line 290 "hbnode.ctr"
}
if(ptr->suffix) {
-#line 289 "hbnode.ctr"
+#line 292 "hbnode.ctr"
}
- if(ptr->template) {
+ if(ptr->templatefi) {
-#line 291 "hbnode.ctr"
+#line 294 "hbnode.ctr"
}
if(ptr->stylefile) {
-#line 293 "hbnode.ctr"
+#line 296 "hbnode.ctr"
}
if(ptr->author) {
-#line 295 "hbnode.ctr"
+#line 298 "hbnode.ctr"
}
if(ptr->location) {
-#line 297 "hbnode.ctr"
+#line 300 "hbnode.ctr"
}
if(ptr->icontoc) {
-#line 299 "hbnode.ctr"
+#line 302 "hbnode.ctr"
}
if(ptr->iconprev) {
-#line 301 "hbnode.ctr"
+#line 304 "hbnode.ctr"
}
if(ptr->iconnext) {
-#line 303 "hbnode.ctr"
+#line 306 "hbnode.ctr"
}
if(ptr->iconhome) {
-#line 305 "hbnode.ctr"
+#line 308 "hbnode.ctr"
}
if(ptr->iconindex) {
-#line 307 "hbnode.ctr"
+#line 310 "hbnode.ctr"
}
if(ptr->favicon) {
-#line 309 "hbnode.ctr"
+#line 312 "hbnode.ctr"
}
if(ptr->metadesc) {
-#line 311 "hbnode.ctr"
+#line 314 "hbnode.ctr"
}
if(ptr->metakeyw) {
-#line 313 "hbnode.ctr"
+#line 316 "hbnode.ctr"
}
#endif
dk3_release(ptr->title);
@@ -339,7 +320,7 @@ hb_node_delete(hb_node_t *ptr)
dk3_release(ptr->fulltitle);
dk3_release(ptr->filename);
dk3_release(ptr->suffix);
- dk3_release(ptr->template);
+ dk3_release(ptr->templatefi);
dk3_release(ptr->stylefile);
dk3_release(ptr->author);
dk3_release(ptr->location);
@@ -360,7 +341,7 @@ hb_node_delete(hb_node_t *ptr)
dk3_delete(ptr);
-#line 340 "hbnode.ctr"
+#line 343 "hbnode.ctr"
}
}
@@ -377,14 +358,14 @@ hbnode_find_depth(hb_node_t *ptr)
int back = 0;
-#line 355 "hbnode.ctr"
+#line 358 "hbnode.ctr"
ptr = ptr->parent;
while(ptr) {
back++;
ptr = ptr->parent;
}
-#line 360 "hbnode.ctr"
+#line 363 "hbnode.ctr"
return back;
}
@@ -403,7 +384,7 @@ hb_node_new(
int ok = 0;
-#line 377 "hbnode.ctr"
+#line 380 "hbnode.ctr"
back = dk3_new_app(hb_node_t,1,job->app);
if(back) {
back->parent = parent;
@@ -426,7 +407,7 @@ hb_node_new(
back->fulltitle = NULL;
back->filename = NULL;
back->suffix = NULL;
- back->template = NULL;
+ back->templatefi = NULL;
back->stylefile = NULL;
back->author = NULL;
back->location = NULL;
@@ -449,6 +430,7 @@ hb_node_new(
back->nextjs = 0UL;
back->contnum = 0L;
back->havenavimenu = 0;
+ back->htdt = HTML_DOCTYPE_UNSPECIFIED;
/* back->inenc = -1; */
if(parent) {
back->inenc = parent->inenc;
@@ -500,7 +482,7 @@ hb_node_new(
}
}
-#line 472 "hbnode.ctr"
+#line 476 "hbnode.ctr"
return back;
}
@@ -514,11 +496,11 @@ hbnode_variable(hb_node_t *node, dkChar const *name)
int cc = 1;
-#line 484 "hbnode.ctr"
+#line 488 "hbnode.ctr"
if((node) && (name)) {
while(cc) {
if(node) {
- kvp = dk3sto_it_find_like(node->i_variables, name, 1);
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(node->i_variables,name,1);
if(kvp) {
cc = 0;
back = kvp->val;
@@ -531,7 +513,7 @@ hbnode_variable(hb_node_t *node, dkChar const *name)
}
}
-#line 499 "hbnode.ctr"
+#line 503 "hbnode.ctr"
return back;
}
diff --git a/support/dktools/hbnode.ctr b/support/dktools/hbnode.ctr
index 095b3abd6d..3de34f0b5d 100644
--- a/support/dktools/hbnode.ctr
+++ b/support/dktools/hbnode.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -85,6 +85,7 @@ hbnode_link_compare(const void *l, const void *r, int cr);
#include "htmlbook.h"
#include "dk3all.h"
+#include "dk3unused.h"
@@ -113,8 +114,9 @@ hbnode_link_new(dkChar const *url, unsigned long lno, dk3_app_t *app)
if(url) {
back = dk3_new_app(hb_link_t,1,app);
if(back) {
- back->lno = lno;
- back->url = dk3str_dup_app(url,app);
+ back->lno = lno;
+ back->url = dk3str_dup_app(url,app);
+ back->flags = 0;
if(!(back->url)) {
hbnode_link_delete(back);
back = NULL;
@@ -167,12 +169,13 @@ hbnode_link_compare(const void *l, const void *r, int cr)
int
-hb_node_compare(void const *l, void const *r, int cr)
+hb_node_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
hb_node_t const *pl;
hb_node_t const *pr;
int back = 0;
$? "+ hb_node_compare PTR=%d PTR=%d", TR_IPTR(l), TR_IPTR(r)
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (hb_node_t const *)l;
@@ -287,7 +290,7 @@ hb_node_delete(hb_node_t *ptr)
}
if(ptr->suffix) { $? ". suffix = \"%!ds\"", ptr->suffix
}
- if(ptr->template) { $? ". template = \"%!ds\"", ptr->template
+ if(ptr->templatefi) { $? ". templatefi = \"%!ds\"", ptr->templatefi
}
if(ptr->stylefile) { $? ". stylefile = \"%!ds\"", ptr->stylefile
}
@@ -317,7 +320,7 @@ hb_node_delete(hb_node_t *ptr)
dk3_release(ptr->fulltitle);
dk3_release(ptr->filename);
dk3_release(ptr->suffix);
- dk3_release(ptr->template);
+ dk3_release(ptr->templatefi);
dk3_release(ptr->stylefile);
dk3_release(ptr->author);
dk3_release(ptr->location);
@@ -396,7 +399,7 @@ hb_node_new(
back->fulltitle = NULL;
back->filename = NULL;
back->suffix = NULL;
- back->template = NULL;
+ back->templatefi = NULL;
back->stylefile = NULL;
back->author = NULL;
back->location = NULL;
@@ -419,6 +422,7 @@ hb_node_new(
back->nextjs = 0UL;
back->contnum = 0L;
back->havenavimenu = 0;
+ back->htdt = HTML_DOCTYPE_UNSPECIFIED;
/* back->inenc = -1; */
if(parent) {
back->inenc = parent->inenc;
@@ -484,7 +488,7 @@ hbnode_variable(hb_node_t *node, dkChar const *name)
if((node) && (name)) {
while(cc) {
if(node) {
- kvp = dk3sto_it_find_like(node->i_variables, name, 1);
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(node->i_variables,name,1);
if(kvp) {
cc = 0;
back = kvp->val;
diff --git a/support/dktools/hbnode.h b/support/dktools/hbnode.h
index dbd619af2b..7b3dfb247d 100644
--- a/support/dktools/hbnode.h
+++ b/support/dktools/hbnode.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbnode.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbnode.ctr
*/
/** @file hbnode.h Header file for the hbnode module.
diff --git a/support/dktools/hbtool.c b/support/dktools/hbtool.c
index bc77ec9830..bbc573a862 100644
--- a/support/dktools/hbtool.c
+++ b/support/dktools/hbtool.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbtool.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbtool.ctr
*/
/** @file hbtool.c The hbtool module.
@@ -43,12 +21,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "dk3se.h"
#include "htmlbook.h"
+#include "dk3unused.h"
-#line 122 "hbtool.ctr"
+#line 123 "hbtool.ctr"
@@ -60,7 +39,7 @@ hbtool_add_file(hb_job_t *job, dkChar const *fn)
int back = 0;
-#line 132 "hbtool.ctr"
+#line 133 "hbtool.ctr"
if(fn) {
if(dk3str_len(fn) < DK3_SIZEOF(bu,dkChar)) {
p1 = dk3str_start(fn, NULL);
@@ -85,7 +64,7 @@ hbtool_add_file(hb_job_t *job, dkChar const *fn)
}
}
-#line 155 "hbtool.ctr"
+#line 156 "hbtool.ctr"
return back;
}
@@ -98,7 +77,7 @@ hbtool_check_filename_encoding(hb_job_t *job, dkChar const *fn)
int se; /* Standard encoding to check */
-#line 166 "hbtool.ctr"
+#line 167 "hbtool.ctr"
#if DK3_ON_WINDOWS
se = (DK3SE_ANSI | DK3SE_URL);
#else
@@ -111,7 +90,7 @@ hbtool_check_filename_encoding(hb_job_t *job, dkChar const *fn)
back = dk3se_check(fn,dk3app_get_encoding(job->app),se,NULL,NULL,job->app);
-#line 177 "hbtool.ctr"
+#line 178 "hbtool.ctr"
return back;
}
@@ -123,14 +102,14 @@ hbtool_check_filename(hb_job_t *job, dkChar const *fn)
int back;
-#line 187 "hbtool.ctr"
+#line 188 "hbtool.ctr"
back = hbtool_check_filename_encoding(job, fn);
if(dk3str_chr(fn, DK3_CHAR_SEP)) {
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
back = 0;
}
-#line 192 "hbtool.ctr"
+#line 193 "hbtool.ctr"
return back;
}
@@ -138,7 +117,14 @@ hbtool_check_filename(hb_job_t *job, dkChar const *fn)
dk3_c32_t
-hbtool_get_start_char(dkChar const *text, int enc)
+hbtool_get_start_char(
+ dkChar const *text,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(enc)
+#else
+ int enc
+#endif
+)
{
dk3_c32_t back = 0UL;
dk3_c32_t c32 = 0UL; /* Start character */
@@ -147,9 +133,12 @@ hbtool_get_start_char(dkChar const *text, int enc)
#if DK3_CHAR_SIZE <= 1
char c; /* Result character */
#endif
+#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(enc)
+#endif
-#line 209 "hbtool.ctr"
+#line 220 "hbtool.ctr"
if(text) {
sl = dk3str_len(text);
#if DK3_CHAR_SIZE > 1
@@ -175,7 +164,7 @@ hbtool_get_start_char(dkChar const *text, int enc)
#endif
}
-#line 233 "hbtool.ctr"
+#line 244 "hbtool.ctr"
return back;
}
@@ -238,36 +227,43 @@ hbtool_write_header_number(hb_job_t *job, hb_node_t *nptr)
int back = 0;
-#line 294 "hbtool.ctr"
+#line 305 "hbtool.ctr"
if((job) && (nptr)) {
if(nptr->parent) {
-#line 296 "hbtool.ctr"
+#line 307 "hbtool.ctr"
if(nptr->depth <= job->headlevels) {
-#line 297 "hbtool.ctr"
+#line 308 "hbtool.ctr"
back = 1;
if(job->impressumnode) {
if((job->impressumnode)->objno == nptr->objno) {
back = 0;
-#line 301 "hbtool.ctr"
+#line 312 "hbtool.ctr"
+ }
+ }
+ if(job->privacynode) {
+ if((job->privacynode)->objno == nptr->objno) {
+ back = 0;
+
+#line 317 "hbtool.ctr"
}
}
if(back) {
-#line 304 "hbtool.ctr"
+#line 320 "hbtool.ctr"
hbtool_write_header_number(job, nptr->parent);
if(1 < nptr->depth) {
-#line 306 "hbtool.ctr"
+#line 322 "hbtool.ctr"
hbhtml_output_for_text(job, dkT("."));
}
#if VERSION_BEFORE_20140716
dk3sf_sprintf3(bu, dkT("%lu"), (1UL + nptr->headno));
hbhtml_output_for_text(job, bu);
-#line 311 "hbtool.ctr"
+#line 327 "hbtool.ctr"
#else
if (dk3ma_um_to_string(bu, DK3_SIZEOF(bu,dkChar), (dk3_um_t)(1UL + nptr->headno))) {
hbhtml_output_for_text(job, bu);
@@ -275,19 +271,19 @@ hbtool_write_header_number(hb_job_t *job, hb_node_t *nptr)
#endif
} else {
-#line 317 "hbtool.ctr"
+#line 333 "hbtool.ctr"
}
} else {
-#line 319 "hbtool.ctr"
+#line 335 "hbtool.ctr"
}
} else {
-#line 321 "hbtool.ctr"
+#line 337 "hbtool.ctr"
}
}
-#line 323 "hbtool.ctr"
+#line 339 "hbtool.ctr"
return back;
}
@@ -328,7 +324,7 @@ hbtool_add_url(hb_job_t *job, dkChar const *url)
void
-hbtool_correct_backslash_to_slash(dkChar *str)
+hbtool_correct_backslash_to_slash(dkChar * DK3_ARG_UNUSED(str) )
{
#if DK3_ON_WINDOWS
dkChar *ptr;
@@ -337,6 +333,8 @@ hbtool_correct_backslash_to_slash(dkChar *str)
if(dkT('\\') == *ptr) { *ptr = dkT('/'); }
ptr++;
}
+#else
+ DK3_UNUSED_ARG(str)
#endif
}
@@ -355,6 +353,11 @@ hbtool_write_all_titles(hb_job_t *job, hb_node_t *nptr, int isprim)
back = 0;
}
}
+ if (job->privacynode) {
+ if ((job->privacynode)->objno == nptr->objno) {
+ back = 0;
+ }
+ }
if (back) {
if (hbtool_write_all_titles(job, nptr->parent, 0)) {
hbhtml_output_for_text(job, dkT(" &#8594; "));
diff --git a/support/dktools/hbtool.ctr b/support/dktools/hbtool.ctr
index 31075a254e..3a51adcadc 100644
--- a/support/dktools/hbtool.ctr
+++ b/support/dktools/hbtool.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -115,6 +115,7 @@ hbtool_write_text_utf(hb_job_t *job, dkChar const *src);
#include "dk3all.h"
#include "dk3se.h"
#include "htmlbook.h"
+#include "dk3unused.h"
@@ -196,7 +197,14 @@ hbtool_check_filename(hb_job_t *job, dkChar const *fn)
dk3_c32_t
-hbtool_get_start_char(dkChar const *text, int enc)
+hbtool_get_start_char(
+ dkChar const *text,
+#if DK3_CHAR_SIZE > 1
+ int DK3_ARG_UNUSED(enc)
+#else
+ int enc
+#endif
+)
{
dk3_c32_t back = 0UL;
dk3_c32_t c32 = 0UL; /* Start character */
@@ -205,6 +213,9 @@ hbtool_get_start_char(dkChar const *text, int enc)
#if DK3_CHAR_SIZE <= 1
char c; /* Result character */
#endif
+#if DK3_CHAR_SIZE > 1
+ DK3_UNUSED_ARG(enc)
+#endif
$? "+ hbtool_get_start_char"
if(text) {
sl = dk3str_len(text);
@@ -229,7 +240,7 @@ hbtool_get_start_char(dkChar const *text, int enc)
back &= ((dk3_c32_t)0x000000FFUL);
}
#endif
- } $? "- hbtool_get_start_char 0x%lx %lu", (unsigned long)back, (unsigned long)back
+ } $? "- hbtool_get_start_char 0x%lx %lu", dk3enc_uc_to_ul(back), dk3enc_uc_to_ul(back)
return back;
}
@@ -300,6 +311,11 @@ hbtool_write_header_number(hb_job_t *job, hb_node_t *nptr)
back = 0; $? ". this is impressum"
}
}
+ if(job->privacynode) {
+ if((job->privacynode)->objno == nptr->objno) {
+ back = 0; $? ". this is privacy"
+ }
+ }
if(back) { $? ". ok to write number"
hbtool_write_header_number(job, nptr->parent);
if(1 < nptr->depth) { $? ". write dot"
@@ -360,7 +376,7 @@ hbtool_add_url(hb_job_t *job, dkChar const *url)
void
-hbtool_correct_backslash_to_slash(dkChar *str)
+hbtool_correct_backslash_to_slash(dkChar * DK3_ARG_UNUSED(str) )
{
#if DK3_ON_WINDOWS
dkChar *ptr;
@@ -369,6 +385,8 @@ hbtool_correct_backslash_to_slash(dkChar *str)
if(dkT('\\') == *ptr) { *ptr = dkT('/'); }
ptr++;
}
+#else
+ DK3_UNUSED_ARG(str)
#endif
}
@@ -387,6 +405,11 @@ hbtool_write_all_titles(hb_job_t *job, hb_node_t *nptr, int isprim)
back = 0;
}
}
+ if (job->privacynode) {
+ if ((job->privacynode)->objno == nptr->objno) {
+ back = 0;
+ }
+ }
if (back) {
if (hbtool_write_all_titles(job, nptr->parent, 0)) {
hbhtml_output_for_text(job, dkT(" &#8594; "));
diff --git a/support/dktools/hbtool.h b/support/dktools/hbtool.h
index 7af06cca45..23b7ce092e 100644
--- a/support/dktools/hbtool.h
+++ b/support/dktools/hbtool.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: hbtool.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: hbtool.ctr
*/
/** @file hbtool.h Header file for the hbtool module.
diff --git a/support/dktools/help-chm/de/winprint.chm b/support/dktools/help-chm/de/winprint.chm
deleted file mode 100644
index ffbbdb8423..0000000000
--- a/support/dktools/help-chm/de/winprint.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/de/wxbmpp.chm b/support/dktools/help-chm/de/wxbmpp.chm
deleted file mode 100644
index b0050bd25a..0000000000
--- a/support/dktools/help-chm/de/wxbmpp.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/de/wxdkclock.chm b/support/dktools/help-chm/de/wxdkclock.chm
deleted file mode 100644
index dce4e4f3be..0000000000
--- a/support/dktools/help-chm/de/wxdkclock.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/de/wxdkct.chm b/support/dktools/help-chm/de/wxdkct.chm
deleted file mode 100644
index bc853157b4..0000000000
--- a/support/dktools/help-chm/de/wxdkct.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/de/wxdkfcs.chm b/support/dktools/help-chm/de/wxdkfcs.chm
deleted file mode 100644
index 746db278b0..0000000000
--- a/support/dktools/help-chm/de/wxdkfcs.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/de/wxdkscrsz.chm b/support/dktools/help-chm/de/wxdkscrsz.chm
deleted file mode 100644
index 6a832134d2..0000000000
--- a/support/dktools/help-chm/de/wxdkscrsz.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/de/wximgsz.chm b/support/dktools/help-chm/de/wximgsz.chm
deleted file mode 100644
index fa98b4558e..0000000000
--- a/support/dktools/help-chm/de/wximgsz.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/de/wxpqdic.chm b/support/dktools/help-chm/de/wxpqdic.chm
deleted file mode 100644
index c90d3337c2..0000000000
--- a/support/dktools/help-chm/de/wxpqdic.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/en/winprint.chm b/support/dktools/help-chm/en/winprint.chm
deleted file mode 100644
index beaba050cd..0000000000
--- a/support/dktools/help-chm/en/winprint.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/en/wxbmpp.chm b/support/dktools/help-chm/en/wxbmpp.chm
deleted file mode 100644
index 441268c05e..0000000000
--- a/support/dktools/help-chm/en/wxbmpp.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/en/wxdkclock.chm b/support/dktools/help-chm/en/wxdkclock.chm
deleted file mode 100644
index be3faffd2a..0000000000
--- a/support/dktools/help-chm/en/wxdkclock.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/en/wxdkct.chm b/support/dktools/help-chm/en/wxdkct.chm
deleted file mode 100644
index b2211a8424..0000000000
--- a/support/dktools/help-chm/en/wxdkct.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/en/wxdkfcs.chm b/support/dktools/help-chm/en/wxdkfcs.chm
deleted file mode 100644
index f4036439f0..0000000000
--- a/support/dktools/help-chm/en/wxdkfcs.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/en/wxdkscrsz.chm b/support/dktools/help-chm/en/wxdkscrsz.chm
deleted file mode 100644
index 5e9e3ffa65..0000000000
--- a/support/dktools/help-chm/en/wxdkscrsz.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/en/wximgsz.chm b/support/dktools/help-chm/en/wximgsz.chm
deleted file mode 100644
index 22aa060463..0000000000
--- a/support/dktools/help-chm/en/wximgsz.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-chm/en/wxpqdic.chm b/support/dktools/help-chm/en/wxpqdic.chm
deleted file mode 100644
index 8ddca100c9..0000000000
--- a/support/dktools/help-chm/en/wxpqdic.chm
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/de/wxbmpp.htb b/support/dktools/help-htb/de/wxbmpp.htb
deleted file mode 100644
index 0af8775fb1..0000000000
--- a/support/dktools/help-htb/de/wxbmpp.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/de/wxdkfcs.htb b/support/dktools/help-htb/de/wxdkfcs.htb
deleted file mode 100644
index 80d3e3affc..0000000000
--- a/support/dktools/help-htb/de/wxdkfcs.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/de/wxdkscrsz.htb b/support/dktools/help-htb/de/wxdkscrsz.htb
deleted file mode 100644
index e9cf75cba6..0000000000
--- a/support/dktools/help-htb/de/wxdkscrsz.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/de/wximgsz.htb b/support/dktools/help-htb/de/wximgsz.htb
deleted file mode 100644
index 3921ac61cc..0000000000
--- a/support/dktools/help-htb/de/wximgsz.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/de/wxpqdic.htb b/support/dktools/help-htb/de/wxpqdic.htb
deleted file mode 100644
index 47a4af7781..0000000000
--- a/support/dktools/help-htb/de/wxpqdic.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/en/wxbmpp.htb b/support/dktools/help-htb/en/wxbmpp.htb
deleted file mode 100644
index f4918152a1..0000000000
--- a/support/dktools/help-htb/en/wxbmpp.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/en/wxdkfcs.htb b/support/dktools/help-htb/en/wxdkfcs.htb
deleted file mode 100644
index 169201bcd9..0000000000
--- a/support/dktools/help-htb/en/wxdkfcs.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/en/wxdkscrsz.htb b/support/dktools/help-htb/en/wxdkscrsz.htb
deleted file mode 100644
index c43e0addfc..0000000000
--- a/support/dktools/help-htb/en/wxdkscrsz.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/en/wximgsz.htb b/support/dktools/help-htb/en/wximgsz.htb
deleted file mode 100644
index 79cec3c0c2..0000000000
--- a/support/dktools/help-htb/en/wximgsz.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/help-htb/en/wxpqdic.htb b/support/dktools/help-htb/en/wxpqdic.htb
deleted file mode 100644
index 40c87c2350..0000000000
--- a/support/dktools/help-htb/en/wxpqdic.htb
+++ /dev/null
Binary files differ
diff --git a/support/dktools/home.wxd b/support/dktools/home.wxd
new file mode 100644
index 0000000000..52a12e002e
--- /dev/null
+++ b/support/dktools/home.wxd
@@ -0,0 +1,11 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+0 2 4
+11 0 127 127 127 127 127 127 4 0 4 1
+ 1016000 16256000 0 15240000 3556000
+11 1 143 0 0 255 214 0 6 0 4 1
+ 0 15240000 1016000 16256000 3556000
+6 3 3 143 0 0 143 0 0 8 0 4 1 8 1
+ 3556000 4572000
+ 11684000 4572000
+ 7620000 12700000
diff --git a/support/dktools/htmlbook.c b/support/dktools/htmlbook.c
index 4cd27ad7d3..e983c24b6b 100644
--- a/support/dktools/htmlbook.c
+++ b/support/dktools/htmlbook.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: htmlbook.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: htmlbook.ctr
*/
/** @file htmlbook.c The htmlbook module.
*/
-#line 372 "htmlbook.ctr"
+#line 418 "htmlbook.ctr"
#include "dk3all.h"
#if 0
@@ -56,10 +34,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Options:
*/
+#include "dk3unused.h"
+
-#line 392 "htmlbook.ctr"
+#line 440 "htmlbook.ctr"
@@ -126,7 +106,7 @@ dkT(""),
NULL
-#line 457 "htmlbook.ctr"
+#line 505 "htmlbook.ctr"
};
@@ -249,6 +229,11 @@ dkT(""),
dkT(" impressum page\t\tName of text file for impressum (you can use"),
dkT("\t\t\t\teither impressum link or impressum page)."),
dkT(""),
+dkT(" privacy link\t\t\tURL to privacy statement."),
+dkT(""),
+dkT(" privacy page\t\t\tName of text file for privacy statement (you"),
+dkT("\t\t\t\tcan use either privacy link or privacy page)."),
+dkT(""),
dkT(" chm\t\t\t\tFlag: Create HTML to produce a CHM file later."),
dkT(""),
dkT(" chm language\t\t\tLanguage setting for CHM project"),
@@ -453,7 +438,7 @@ dkT(""),
NULL
-#line 782 "htmlbook.ctr"
+#line 835 "htmlbook.ctr"
};
@@ -593,7 +578,7 @@ static char const * const hb_c8_kw[] = {
NULL
-#line 885 "htmlbook.ctr"
+#line 938 "htmlbook.ctr"
};
@@ -718,7 +703,7 @@ dkT("home.png"),
NULL
-#line 1025 "htmlbook.ctr"
+#line 1078 "htmlbook.ctr"
};
@@ -1026,10 +1011,37 @@ dkT("Overwriting previous setting for ``meta keywords''!"),
/* 99 */
dkT("Overwriting previous setting for ``location''!"),
+/* 100 */
+dkT("Syntax error, not a hexadecimal number!"),
+
+/* 101 */
+dkT("Mathematical overflow, maximum number is FFFFFF!"),
+
+/* 102 */
+dkT("Syntax error, illegal doctype!"),
+
+/* 103 */
+dkT("Overwriting doctype."),
+
+/* 104 */
+dkT("Privacy"),
+
+/* 105 */
+dkT("Privacy statement"),
+
+/* 106 */
+dkT("Page content: "),
+
+/* 107 */
+dkT("[show]"),
+
+/* 108 */
+dkT("[hide]"),
+
NULL
-#line 1347 "htmlbook.ctr"
+#line 1430 "htmlbook.ctr"
};
@@ -1049,7 +1061,7 @@ dkT("contents"),
NULL
-#line 1359 "htmlbook.ctr"
+#line 1442 "htmlbook.ctr"
};
@@ -1087,7 +1099,8 @@ hb_job_init(
{
-#line 1395 "htmlbook.ctr"
+#line 1478 "htmlbook.ctr"
+ job->elmbuf[0] = '\0';
job->app = app;
job->msg = msg;
job->kwnl = kwnl;
@@ -1107,6 +1120,7 @@ hb_job_init(
job->rootnode = NULL;
job->currentnode = NULL;
job->impressumnode = NULL;
+ job->privacynode = NULL;
job->firstnode = NULL;
job->lastnode = NULL;
job->infilename = NULL;
@@ -1115,7 +1129,10 @@ hb_job_init(
job->url = NULL;
job->indexfile = NULL;
job->impressumlink = NULL;
+ job->privacylink = NULL;
job->chmlang = NULL;
+ job->htmllang = NULL;
+ job->ptocjsfile = NULL;
job->shipbuffer = NULL;
job->iltemplate = NULL;
job->ilfile = NULL;
@@ -1125,6 +1142,7 @@ hb_job_init(
job->lineno = 0UL;
job->nextobj = 0UL;
job->npobjs = 0UL;
+ job->elmchr = 0x01F310UL;
job->spused = 0;
job->shipused = 0;
job->options = HB_JOB_OPT_CREATE_TOC;
@@ -1138,7 +1156,7 @@ hb_job_init(
job->cmd = 0;
job->exv = 1;
-#line 1444 "htmlbook.ctr"
+#line 1533 "htmlbook.ctr"
job->cs = HB_CS_ASCII;
job->secttype = HB_SECTION_UNKNOWN;
job->non_url = 0;
@@ -1154,9 +1172,15 @@ hb_job_init(
#else
job->headlevels = 32767;
#endif
+ job->markel = 1;
+ job->tabsum = 0;
+ job->svgwhdef = 1;
+ job->htdt = HTML_DOCTYPE_UNSPECIFIED;
+ job->ptocjsused = 0;
+ hbconf_write_external_marker_character(job);
-#line 1460 "htmlbook.ctr"
+#line 1555 "htmlbook.ctr"
}
@@ -1174,7 +1198,7 @@ hb_job_end(hb_job_t *job)
dkChar *cfn; /* Current file name */
-#line 1476 "htmlbook.ctr"
+#line 1571 "htmlbook.ctr"
/* Release options.
*/
if(job->opt) {
@@ -1212,7 +1236,7 @@ hb_job_end(hb_job_t *job)
while(NULL != (cfn = (dkChar *)dk3sto_it_next(job->i_optsect))) {
-#line 1512 "htmlbook.ctr"
+#line 1607 "htmlbook.ctr"
dk3_release(cfn);
}
dk3sto_it_close(job->i_optsect);
@@ -1241,7 +1265,7 @@ hb_job_end(hb_job_t *job)
while(NULL != (cfn = (dkChar *)dk3sto_it_next(job->i_files))) {
-#line 1539 "htmlbook.ctr"
+#line 1634 "htmlbook.ctr"
dk3_release(cfn);
}
dk3sto_it_close(job->i_files); job->i_files = NULL;
@@ -1267,7 +1291,10 @@ hb_job_end(hb_job_t *job)
dk3_release(job->outputscript);
dk3_release(job->url);
dk3_release(job->impressumlink);
+ dk3_release(job->privacylink);
dk3_release(job->chmlang);
+ dk3_release(job->htmllang);
+ dk3_release(job->ptocjsfile);
dk3_release(job->indexfile);
dk3_release(job->shipbuffer);
dk3_release(job->iltemplate);
@@ -1276,9 +1303,10 @@ hb_job_end(hb_job_t *job)
dk3_release(job->buffer32);
job->impressumnode = NULL;
+ job->privacynode = NULL;
-#line 1574 "htmlbook.ctr"
+#line 1673 "htmlbook.ctr"
}
@@ -1299,13 +1327,13 @@ hb_save_optional_sections(hb_job_t *job, dkChar const *sections)
int back = 0; /* Result */
-#line 1593 "htmlbook.ctr"
+#line 1692 "htmlbook.ctr"
if((job) && (sections)) {
if(dk3str_len(sections) < DK3_SIZEOF(bu,dkChar)) {
dk3str_cpy(bu, sections);
back = 1;
-#line 1597 "htmlbook.ctr"
+#line 1696 "htmlbook.ctr"
p1 = dk3str_start(bu, NULL);
while(p1) {
p2 = dk3str_chr(p1, dkT(','));
@@ -1316,19 +1344,19 @@ hb_save_optional_sections(hb_job_t *job, dkChar const *sections)
dk3str_chomp(p1, NULL);
-#line 1606 "htmlbook.ctr"
+#line 1705 "htmlbook.ctr"
p3 = dk3str_dup_app(p1, job->app);
if(p3) {
if(!dk3sto_add(job->s_optsect, p3)) {
dk3_release(p3);
back = 0; /* REPORTED */
-#line 1611 "htmlbook.ctr"
+#line 1710 "htmlbook.ctr"
}
} else {
back = 0; /* REPORTED */
-#line 1614 "htmlbook.ctr"
+#line 1713 "htmlbook.ctr"
}
p1 = p2;
}
@@ -1337,7 +1365,7 @@ hb_save_optional_sections(hb_job_t *job, dkChar const *sections)
}
}
-#line 1621 "htmlbook.ctr"
+#line 1720 "htmlbook.ctr"
return back;
}
@@ -1378,14 +1406,14 @@ hb_process_options(hb_job_t *job)
}
if(1 > dk3opt_get_num_args(job->opt)) {
-#line 1660 "htmlbook.ctr"
+#line 1759 "htmlbook.ctr"
/* ERROR: No project file specified! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 13);
back = 0;
} else {
if(1 < dk3opt_get_num_args(job->opt)) {
-#line 1665 "htmlbook.ctr"
+#line 1764 "htmlbook.ctr"
/* WARNING: Too many project files, using just one! */
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 14);
}
@@ -1408,7 +1436,7 @@ hb_help_version_license(hb_job_t *job)
dkChar const * const *ptr; /* Current line to print */
-#line 1686 "htmlbook.ctr"
+#line 1785 "htmlbook.ctr"
/* Show version
*/
dk3sf_initialize_stdout();
@@ -1431,10 +1459,10 @@ hb_help_version_license(hb_job_t *job)
}
job->exv = 0;
-#line 1707 "htmlbook.ctr"
+#line 1806 "htmlbook.ctr"
-#line 1708 "htmlbook.ctr"
+#line 1807 "htmlbook.ctr"
}
@@ -1447,12 +1475,13 @@ hb_help_version_license(hb_job_t *job)
*/
static
int
-hb_file_name_compare(void const *l, void const *r, int cr)
+hb_file_name_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
-#line 1724 "htmlbook.ctr"
+#line 1823 "htmlbook.ctr"
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
back = dk3str_fncmp((dkChar const *)l, (dkChar const *)r);
@@ -1467,7 +1496,7 @@ hb_file_name_compare(void const *l, void const *r, int cr)
}
}
-#line 1737 "htmlbook.ctr"
+#line 1837 "htmlbook.ctr"
return back;
}
@@ -1481,12 +1510,13 @@ hb_file_name_compare(void const *l, void const *r, int cr)
*/
static
int
-hb_compare_strings(void const *l, void const *r, int cr)
+hb_compare_strings(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
-#line 1754 "htmlbook.ctr"
+#line 1854 "htmlbook.ctr"
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
back = dk3str_cmp((dkChar const *)l, (dkChar const *)r);
@@ -1497,7 +1527,7 @@ hb_compare_strings(void const *l, void const *r, int cr)
if(r) back = -1;
}
-#line 1763 "htmlbook.ctr"
+#line 1864 "htmlbook.ctr"
return back;
}
@@ -1514,7 +1544,7 @@ hb_job_allocate(hb_job_t *job)
int back = 0;
-#line 1778 "htmlbook.ctr"
+#line 1879 "htmlbook.ctr"
job->s_nodes = dk3sto_open_app(job->app);
if(job->s_nodes) {
dk3sto_set_comp(job->s_nodes, hb_node_compare, 0);
@@ -1593,7 +1623,7 @@ hb_job_allocate(hb_job_t *job)
}
}
-#line 1855 "htmlbook.ctr"
+#line 1956 "htmlbook.ctr"
return back;
}
@@ -1649,7 +1679,7 @@ hb_find_indent(dkChar *il)
int back = 0;
-#line 1909 "htmlbook.ctr"
+#line 2010 "htmlbook.ctr"
p1 = il;
while((dkT(' ') == *p1) || (dkT('\t') == *p1)) {
back++;
@@ -1659,7 +1689,7 @@ hb_find_indent(dkChar *il)
p1++;
}
-#line 1917 "htmlbook.ctr"
+#line 2018 "htmlbook.ctr"
return back;
}
@@ -1679,7 +1709,7 @@ hb_parent_candidate(hb_node_t *current, int indent)
int cc; /* Flag: Can continue */
-#line 1935 "htmlbook.ctr"
+#line 2036 "htmlbook.ctr"
ca = current;
cc = 1;
while(cc) {
@@ -1695,7 +1725,7 @@ hb_parent_candidate(hb_node_t *current, int indent)
}
}
-#line 1949 "htmlbook.ctr"
+#line 2050 "htmlbook.ctr"
return back;
}
@@ -1717,7 +1747,7 @@ hb_add_contents(hb_job_t *job, dkChar *il)
int back = 1;
-#line 1969 "htmlbook.ctr"
+#line 2070 "htmlbook.ctr"
p1 = dk3str_start(il, NULL);
if(p1) {
if(dkT('@') == *p1) {
@@ -1757,7 +1787,7 @@ hb_add_contents(hb_job_t *job, dkChar *il)
}
}
-#line 2007 "htmlbook.ctr"
+#line 2108 "htmlbook.ctr"
return back;
}
@@ -1778,7 +1808,7 @@ hb_process_line(hb_job_t *job, dkChar *il)
int newst = HB_SECTION_UNKNOWN; /* New section type */
-#line 2026 "htmlbook.ctr"
+#line 2127 "htmlbook.ctr"
job->lineno += 1UL;
p1 = dk3str_start(il, NULL);
if(p1) {
@@ -1849,7 +1879,7 @@ hb_process_line(hb_job_t *job, dkChar *il)
}
}
-#line 2095 "htmlbook.ctr"
+#line 2196 "htmlbook.ctr"
return back;
}
@@ -1867,11 +1897,11 @@ hb_line_reader_handler(void *obj, dkChar *il)
int back;
-#line 2111 "htmlbook.ctr"
+#line 2212 "htmlbook.ctr"
back = hb_process_line((hb_job_t *)obj, il);
-#line 2113 "htmlbook.ctr"
+#line 2214 "htmlbook.ctr"
return back;
}
@@ -1912,7 +1942,7 @@ hb_read_variables(hb_job_t *job)
if(p2) {
dk3str_chomp(p1, NULL);
dk3str_chomp(p2, NULL);
- kvp = dk3sto_it_find_like(
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(
(job->rootnode)->i_variables, p1, 1
);
if(kvp) {
@@ -1935,7 +1965,7 @@ hb_read_variables(hb_job_t *job)
}
}
} else {
- kvp = dk3sto_it_find_like(
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(
(job->rootnode)->i_variables, p1, 1
);
if(kvp) {
@@ -1970,7 +2000,7 @@ hb_read_project(hb_job_t *job)
int inenc; /* Input encoding */
-#line 2210 "htmlbook.ctr"
+#line 2311 "htmlbook.ctr"
inenc = dk3app_get_input_file_encoding(job->app);
if(0 <= job->iecmd) { inenc = job->iecmd; }
back = dk3stream_process_filename_lines_app(
@@ -1989,7 +2019,7 @@ hb_read_project(hb_job_t *job)
if(1 != back) { back = 0; }
-#line 2227 "htmlbook.ctr"
+#line 2328 "htmlbook.ctr"
return back;
}
@@ -2006,32 +2036,32 @@ hb_write_html_files(hb_job_t *job)
hb_node_t *nptr;
-#line 2242 "htmlbook.ctr"
+#line 2343 "htmlbook.ctr"
dk3sto_it_reset(job->i_pnodes);
while(NULL != (nptr = (hb_node_t *)dk3sto_it_next(job->i_pnodes))) {
-#line 2245 "htmlbook.ctr"
+#line 2346 "htmlbook.ctr"
if(0UL != nptr->objno) {
-#line 2246 "htmlbook.ctr"
+#line 2347 "htmlbook.ctr"
hbhtml_write_file(job, nptr);
}
}
-#line 2249 "htmlbook.ctr"
+#line 2350 "htmlbook.ctr"
#else
hb_node_t *c;
hb_node_t *p;
hb_node_t *n;
-#line 2254 "htmlbook.ctr"
+#line 2355 "htmlbook.ctr"
p = c = n = NULL;
dk3sto_it_reset(job->i_pnodes);
- c = dk3sto_it_next(job->i_pnodes);
+ c = (hb_node_t *)dk3sto_it_next(job->i_pnodes);
while(c) {
- n = dk3sto_it_next(job->i_pnodes);
+ n = (hb_node_t *)dk3sto_it_next(job->i_pnodes);
if(0UL != c->objno) {
hbhtml_write_file(job, c, p, n);
}
@@ -2040,7 +2070,7 @@ hb_write_html_files(hb_job_t *job)
}
-#line 2266 "htmlbook.ctr"
+#line 2367 "htmlbook.ctr"
#endif
}
@@ -2056,7 +2086,7 @@ hb_write_index(hb_job_t *job)
hb_node_t *n; /* Current index item */
-#line 2280 "htmlbook.ctr"
+#line 2381 "htmlbook.ctr"
dk3sto_it_reset(job->i_pnodes);
if(dk3sto_it_next(job->i_pnodes)) {
n = (hb_node_t *)dk3sto_it_next(job->i_pnodes);
@@ -2069,7 +2099,7 @@ hb_write_index(hb_job_t *job)
#if VERSION_BEFORE_20140205
job->exv = 1;
-#line 2291 "htmlbook.ctr"
+#line 2392 "htmlbook.ctr"
#else
hbhtml_write_file(job, job->rootnode, NULL, n);
#endif
@@ -2077,10 +2107,10 @@ hb_write_index(hb_job_t *job)
} else {
job->exv = 1;
-#line 2297 "htmlbook.ctr"
+#line 2398 "htmlbook.ctr"
}
-#line 2298 "htmlbook.ctr"
+#line 2399 "htmlbook.ctr"
}
@@ -2142,12 +2172,12 @@ hb_write_ansi_filename(hb_job_t *job, dkChar const *fn)
{
-#line 2358 "htmlbook.ctr"
+#line 2459 "htmlbook.ctr"
if(!dk3se_ansi_fputs(fn, dk3app_get_encoding(job->app), job->of, job->app)) {
job->exv = 1;
}
-#line 2361 "htmlbook.ctr"
+#line 2462 "htmlbook.ctr"
}
#endif
@@ -2187,14 +2217,14 @@ hb_htfile(hb_node_t *nptr)
int back = 1;
-#line 2399 "htmlbook.ctr"
+#line 2500 "htmlbook.ctr"
if(nptr->suffix) {
back = 0;
if(dk3str_fncmp(nptr->suffix, hb_kwnl[23]) == 0) { back = 1; }
if(dk3str_fncmp(nptr->suffix, hb_kwnl[24]) == 0) { back = 1; }
}
-#line 2404 "htmlbook.ctr"
+#line 2505 "htmlbook.ctr"
return back;
}
@@ -2259,7 +2289,7 @@ hb_write_script(hb_job_t *job)
dkChar const *fn; /* Current resource file name */
-#line 2467 "htmlbook.ctr"
+#line 2568 "htmlbook.ctr"
if(job->outputscript) {
if(job->outputdir) {
job->of = dk3sf_fopen_app(job->outputscript, hb_kwnl[22], job->app);
@@ -2304,9 +2334,17 @@ hb_write_script(hb_job_t *job)
*/
hb_write_script_copy_file(job, fn);
}
+ /* JS file to fold and unfold page toc.
+ */
+ if ((NULL != job->ptocjsfile) && (0 != job->ptocjsused)) {
+ hb_write_script_copy_file(job, job->ptocjsfile);
+ }
/* For CHM projects copy index.hhp, index.hhc and index.hhk
*/
if ((job->options) & HB_JOB_OPT_CHM) {
+
+
+#line 2621 "htmlbook.ctr"
hb_write_script_copy_file(job, hb_kwnl[36]);
hb_write_script_copy_file(job, hb_kwnl[26]);
hb_write_script_copy_file(job, hb_kwnl[28]);
@@ -2461,7 +2499,7 @@ hb_write_script(hb_job_t *job)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 68);
}
-#line 2667 "htmlbook.ctr"
+#line 2774 "htmlbook.ctr"
}
@@ -2476,11 +2514,11 @@ hb_write_output(hb_job_t *job)
{
-#line 2680 "htmlbook.ctr"
+#line 2787 "htmlbook.ctr"
#if DK3_CHAR_SIZE == 1
-#line 2682 "htmlbook.ctr"
+#line 2789 "htmlbook.ctr"
#endif
hb_write_html_files(job);
hb_write_index(job);
@@ -2491,11 +2529,11 @@ hb_write_output(hb_job_t *job)
#if DK3_CHAR_SIZE == 1
-#line 2691 "htmlbook.ctr"
+#line 2798 "htmlbook.ctr"
#endif
-#line 2693 "htmlbook.ctr"
+#line 2800 "htmlbook.ctr"
}
@@ -2512,7 +2550,7 @@ hb_check_data(hb_job_t *job)
int back = 1;
-#line 2708 "htmlbook.ctr"
+#line 2815 "htmlbook.ctr"
/* All printable nodes must have a template.
*/
job->npobjs = 0UL;
@@ -2522,7 +2560,7 @@ hb_check_data(hb_job_t *job)
job->lastnode = nptr;
nptr->pobjno = job->npobjs;
job->npobjs += 1UL;
- if(!hbconf_node_template(job, nptr)) {
+ if(!hbconf_node_template(nptr)) {
back = 0;
/* ERROR: No template for node! */
dk3app_set_source_line(job->app, nptr->lineno);
@@ -2533,7 +2571,7 @@ hb_check_data(hb_job_t *job)
/* ##### Further tests. */
}
-#line 2727 "htmlbook.ctr"
+#line 2834 "htmlbook.ctr"
return back;
}
@@ -2549,12 +2587,12 @@ hb_run_with_input_filename(hb_job_t *job)
int res = 1;
-#line 2741 "htmlbook.ctr"
+#line 2848 "htmlbook.ctr"
dk3app_set_source_file(job->app, job->infilename);
dk3app_set_source_line(job->app, 0UL);
if(hb_job_allocate(job)) {
-#line 2744 "htmlbook.ctr"
+#line 2851 "htmlbook.ctr"
if(dk3opt_is_set(job->opt, dkT('o'))) {
res = hb_save_optional_sections(
job, dk3opt_get_short_arg(job->opt, dkT('o'))
@@ -2567,7 +2605,7 @@ hb_run_with_input_filename(hb_job_t *job)
hbtool_enumerate(job);
job->exv = 0;
-#line 2755 "htmlbook.ctr"
+#line 2862 "htmlbook.ctr"
hb_write_output(job);
}
}
@@ -2575,11 +2613,11 @@ hb_run_with_input_filename(hb_job_t *job)
}
} else {
-#line 2761 "htmlbook.ctr"
+#line 2868 "htmlbook.ctr"
}
-#line 2763 "htmlbook.ctr"
+#line 2870 "htmlbook.ctr"
}
@@ -2596,7 +2634,7 @@ hb_run(hb_job_t *job)
dk3_um_t numfiles; /* Number of files in expander */
-#line 2778 "htmlbook.ctr"
+#line 2885 "htmlbook.ctr"
infilename = dk3opt_get_arg(job->opt, 0);
if(infilename) {
if(dk3sf_must_expand(infilename)) {
@@ -2637,7 +2675,7 @@ hb_run(hb_job_t *job)
}
-#line 2817 "htmlbook.ctr"
+#line 2924 "htmlbook.ctr"
}
@@ -2657,10 +2695,10 @@ DK3_MAIN
-#line 2835 "htmlbook.ctr"
+#line 2942 "htmlbook.ctr"
-#line 2836 "htmlbook.ctr"
+#line 2943 "htmlbook.ctr"
#if DK3_HAVE_TZSET
tzset();
#endif
@@ -2688,10 +2726,10 @@ DK3_MAIN
}
-#line 2862 "htmlbook.ctr"
+#line 2969 "htmlbook.ctr"
-#line 2863 "htmlbook.ctr"
+#line 2970 "htmlbook.ctr"
fflush(stdout);
exit(exv); return exv;
}
diff --git a/support/dktools/htmlbook.ctr b/support/dktools/htmlbook.ctr
index fd679bcad8..3482de7cd7 100644
--- a/support/dktools/htmlbook.ctr
+++ b/support/dktools/htmlbook.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -14,6 +14,23 @@ license = bsd
+/** HTML standard to use.
+*/
+enum {
+ HTML_DOCTYPE_UNSPECIFIED = -1 , /**< No information about doctype. */
+ HTML_DOCTYPE_NONE , /**< No HTML doctype. */
+ HTML_DOCTYPE_5 , /**< HTML 5. */
+ HTML_DOCTYPE_401_STRICT , /**< HTML 4.01 strict. */
+ HTML_DOCTYPE_401_TRANSITIONAL , /**< HTML 4.01 transitional. */
+ HTML_DOCTYPE_401_FRAMESET , /**< HTML 4.01 with framesets. */
+ HTML_DOCTYPE_X10_STRICT , /**< XHTML 1.0 strict. */
+ HTML_DOCTYPE_X10_TRANSITIONAL , /**< XHTML 1.0 transitional. */
+ HTML_DOCTYPE_X10_FRAMESET , /**< XHTML 1.0 frameset. */
+ HTML_DOCTYPE_X11 /**< XHTML 1.1. */
+};
+
+
+
/** Image dimension cache entry.
*/
typedef struct {
@@ -29,10 +46,19 @@ typedef struct {
typedef struct {
dkChar *url; /**< Link URL. */
unsigned long lno; /**< Link number within current page. */
+ int flags; /**< Flags for link. */
} hb_link_t;
+/** Flags for link, used for the flags field in the hb_link_t type.
+*/
+enum {
+ /** Script fle needs async flag.
+ */
+ LINK_FLAG_SCRIPT_ASYNC = 0x0001
+};
+
/** One contents line.
*/
typedef struct {
@@ -70,7 +96,7 @@ struct hb__node_t {
dkChar *fulltitle; /**< Full title (browser title bar). */
dkChar *filename; /**< Text file name (optional). */
dkChar *suffix; /**< Output file name suffix (opt). */
- dkChar *template; /**< Template file name (optional). */
+ dkChar *templatefi; /**< Template file name (optional). */
dkChar *stylefile; /**< Style file. */
dkChar *author; /**< Name of author. */
dkChar *location; /**< Location (city) of author. */
@@ -98,6 +124,7 @@ struct hb__node_t {
int tocstate; /**< State when creating TOC. */
int inenc; /**< Text file input encoding. */
int havenavimenu; /**< Flag: Already have navi menu. */
+ int htdt; /**< HTML doctype. */
};
/** One node in the document tree.
@@ -126,6 +153,7 @@ typedef struct {
The tree structure is below the rootnode element.
*/
typedef struct {
+ char elmbuf[8*sizeof(dk3_um_t)]; /**< Buffer. */
dk3_tm_t starttime; /**< Start time. */
dk3_app_t *app; /**< Application structure. */
dkChar const * const *msg; /**< Localized messages. */
@@ -146,6 +174,7 @@ typedef struct {
hb_node_t *rootnode; /**< Root node. */
hb_node_t *currentnode; /**< Current node to modify. */
hb_node_t *impressumnode; /**< Impressum node. */
+ hb_node_t *privacynode; /**< Privacy statement node. */
hb_node_t *firstnode; /**< First pnode. */
hb_node_t *lastnode; /**< Last pnode. */
dkChar const *infilename; /**< Input file name (project). */
@@ -154,7 +183,10 @@ typedef struct {
dkChar const *url; /**< URL to publish the results. */
dkChar const *indexfile; /**< Typically index html. */
dkChar const *impressumlink; /**< Link to impressum. */
+ dkChar const *privacylink; /**< Link to privacy statement. */
dkChar const *chmlang; /**< Language setting for CHM. */
+ dkChar const *htmllang; /**< Language setting for HTML. */
+ dkChar const *ptocjsfile; /**< Page TOC JS file (allocated). */
dkChar *shipbuffer; /**< Shipout buffer. */
dkChar *iltemplate; /**< Input line from template. */
dkChar *ilfile; /**< Input line from file. */
@@ -164,6 +196,7 @@ typedef struct {
unsigned long lineno; /**< Line number. */
unsigned long nextobj; /**< Next object number. */
unsigned long npobjs; /**< Number of printable objects. */
+ unsigned long elmchr; /**< External link marker. */
size_t bs; /**< Buffer size. */
size_t spused; /**< Number elements used in special. */
size_t shipused; /**< Shipout buffer used. */
@@ -179,6 +212,11 @@ typedef struct {
int headlevels; /**< Maximum depth to print header. */
int coli; /**< Current code line number. */
int cols; /**< Code line state. */
+ int markel; /**< Flag: Mark external links. */
+ int tabsum; /**< Flag: Create table summaries. */
+ int svgwhdef; /**< Flag: Default svgwh value. */
+ int htdt; /**< HTML doctype. */
+ int ptocjsused; /**< Flag: ptoc js file used. */
} hb_job_t;
@@ -222,6 +260,10 @@ typedef struct {
*/
#define HB_NODE_OPT_STOP_JS_INHERITANCE 0x0020U
+/** Indicate the privacy node.
+*/
+#define HB_NODE_OPT_PRIVACY 0x0040U
+
/**@}*/
@@ -269,6 +311,10 @@ typedef struct {
*/
#define HB_JOB_OPT_CODE_LINE_NUMBERS 0x0200U
+/** Fold and unfold page table of contents.
+*/
+#define HB_JOB_OPT_FOLD_PTOC 0x0400U
+
/**@}*/
@@ -387,6 +433,8 @@ typedef struct {
Options:
*/
+#include "dk3unused.h"
+
$!trace-include
@@ -577,6 +625,11 @@ The options section contains ``key=value'' lines for the following keys:
impressum page Name of text file for impressum (you can use
either impressum link or impressum page).
+ privacy link URL to privacy statement.
+
+ privacy page Name of text file for privacy statement (you
+ can use either privacy link or privacy page).
+
chm Flag: Create HTML to produce a CHM file later.
chm language Language setting for CHM project
@@ -1343,6 +1396,36 @@ Syntax error, value required!
Overwriting previous setting for ``meta description''!
Overwriting previous setting for ``meta keywords''!
Overwriting previous setting for ``location''!
+#
+# 100 101
+#
+Syntax error, not a hexadecimal number!
+Mathematical overflow, maximum number is FFFFFF!
+#
+# 102
+#
+Syntax error, illegal doctype!
+#
+# 103
+#
+Overwriting doctype.
+#
+# 104 Node name for privacy statement
+#
+Privacy
+#
+# 105 Link title for privacy statement
+#
+Privacy statement
+#
+# 106 Text "Page content"
+#
+Page content:
+#
+# 107, 108
+#
+[show]
+[hide]
$!end
};
@@ -1392,6 +1475,7 @@ hb_job_init(
)
{
$? "+ hb_job_init"
+ job->elmbuf[0] = '\0';
job->app = app;
job->msg = msg;
job->kwnl = kwnl;
@@ -1411,6 +1495,7 @@ hb_job_init(
job->rootnode = NULL;
job->currentnode = NULL;
job->impressumnode = NULL;
+ job->privacynode = NULL;
job->firstnode = NULL;
job->lastnode = NULL;
job->infilename = NULL;
@@ -1419,7 +1504,10 @@ hb_job_init(
job->url = NULL;
job->indexfile = NULL;
job->impressumlink = NULL;
+ job->privacylink = NULL;
job->chmlang = NULL;
+ job->htmllang = NULL;
+ job->ptocjsfile = NULL;
job->shipbuffer = NULL;
job->iltemplate = NULL;
job->ilfile = NULL;
@@ -1429,6 +1517,7 @@ hb_job_init(
job->lineno = 0UL;
job->nextobj = 0UL;
job->npobjs = 0UL;
+ job->elmchr = 0x01F310UL;
job->spused = 0;
job->shipused = 0;
job->options = HB_JOB_OPT_CREATE_TOC;
@@ -1456,6 +1545,12 @@ hb_job_init(
#else
job->headlevels = 32767;
#endif
+ job->markel = 1;
+ job->tabsum = 0;
+ job->svgwhdef = 1;
+ job->htdt = HTML_DOCTYPE_UNSPECIFIED;
+ job->ptocjsused = 0;
+ hbconf_write_external_marker_character(job);
$? "- hb_job_init"
}
@@ -1561,7 +1656,10 @@ hb_job_end(hb_job_t *job)
dk3_release(job->outputscript);
dk3_release(job->url);
dk3_release(job->impressumlink);
+ dk3_release(job->privacylink);
dk3_release(job->chmlang);
+ dk3_release(job->htmllang);
+ dk3_release(job->ptocjsfile);
dk3_release(job->indexfile);
dk3_release(job->shipbuffer);
dk3_release(job->iltemplate);
@@ -1570,6 +1668,7 @@ hb_job_end(hb_job_t *job)
dk3_release(job->buffer32);
job->impressumnode = NULL;
+ job->privacynode = NULL;
$? "- hb_job_end"
}
@@ -1717,10 +1816,11 @@ hb_help_version_license(hb_job_t *job)
*/
static
int
-hb_file_name_compare(void const *l, void const *r, int cr)
+hb_file_name_compare(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
$? "+ hb_file_name_compare PTR=%d PTR=%d", TR_IPTR(l), TR_IPTR(r)
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
back = dk3str_fncmp((dkChar const *)l, (dkChar const *)r);
@@ -1747,10 +1847,11 @@ hb_file_name_compare(void const *l, void const *r, int cr)
*/
static
int
-hb_compare_strings(void const *l, void const *r, int cr)
+hb_compare_strings(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
int back = 0;
$? "+ hb_compare_strings PTR=%d PTR=%d", TR_IPTR(l), TR_IPTR(r)
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
back = dk3str_cmp((dkChar const *)l, (dkChar const *)r);
@@ -2150,7 +2251,7 @@ hb_read_variables(hb_job_t *job)
if(p2) {
dk3str_chomp(p1, NULL);
dk3str_chomp(p2, NULL);
- kvp = dk3sto_it_find_like(
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(
(job->rootnode)->i_variables, p1, 1
);
if(kvp) {
@@ -2173,7 +2274,7 @@ hb_read_variables(hb_job_t *job)
}
}
} else {
- kvp = dk3sto_it_find_like(
+ kvp = (dk3_key_value_t *)dk3sto_it_find_like(
(job->rootnode)->i_variables, p1, 1
);
if(kvp) {
@@ -2253,9 +2354,9 @@ hb_write_html_files(hb_job_t *job)
$? "+ hb_write_html_files"
p = c = n = NULL;
dk3sto_it_reset(job->i_pnodes);
- c = dk3sto_it_next(job->i_pnodes);
+ c = (hb_node_t *)dk3sto_it_next(job->i_pnodes);
while(c) {
- n = dk3sto_it_next(job->i_pnodes);
+ n = (hb_node_t *)dk3sto_it_next(job->i_pnodes);
if(0UL != c->objno) {
hbhtml_write_file(job, c, p, n);
}
@@ -2508,9 +2609,15 @@ hb_write_script(hb_job_t *job)
*/
hb_write_script_copy_file(job, fn);
}
+ /* JS file to fold and unfold page toc.
+ */
+ if ((NULL != job->ptocjsfile) && (0 != job->ptocjsused)) {
+ hb_write_script_copy_file(job, job->ptocjsfile);
+ }
/* For CHM projects copy index.hhp, index.hhc and index.hhk
*/
if ((job->options) & HB_JOB_OPT_CHM) {
+ $? ". in chm mode"
hb_write_script_copy_file(job, hb_kwnl[36]);
hb_write_script_copy_file(job, hb_kwnl[26]);
hb_write_script_copy_file(job, hb_kwnl[28]);
@@ -2714,7 +2821,7 @@ hb_check_data(hb_job_t *job)
job->lastnode = nptr;
nptr->pobjno = job->npobjs;
job->npobjs += 1UL;
- if(!hbconf_node_template(job, nptr)) {
+ if(!hbconf_node_template(nptr)) {
back = 0;
/* ERROR: No template for node! */
dk3app_set_source_line(job->app, nptr->lineno);
@@ -2831,7 +2938,7 @@ DK3_MAIN
dk3_time_t timer; /* Current time */
int exv = 1; /* Exit status code */
- $!trace-init htmlbook.deb
+ $!trace-init /tmp/htmlbook.deb
$? "+ main"
#if DK3_HAVE_TZSET
tzset();
diff --git a/support/dktools/htmlbook.h b/support/dktools/htmlbook.h
index 5a65abf455..2158086795 100644
--- a/support/dktools/htmlbook.h
+++ b/support/dktools/htmlbook.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: htmlbook.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: htmlbook.ctr
*/
/** @file htmlbook.h Header file for the htmlbook module.
@@ -49,6 +27,23 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/** HTML standard to use.
+*/
+enum {
+ HTML_DOCTYPE_UNSPECIFIED = -1 , /**< No information about doctype. */
+ HTML_DOCTYPE_NONE , /**< No HTML doctype. */
+ HTML_DOCTYPE_5 , /**< HTML 5. */
+ HTML_DOCTYPE_401_STRICT , /**< HTML 4.01 strict. */
+ HTML_DOCTYPE_401_TRANSITIONAL , /**< HTML 4.01 transitional. */
+ HTML_DOCTYPE_401_FRAMESET , /**< HTML 4.01 with framesets. */
+ HTML_DOCTYPE_X10_STRICT , /**< XHTML 1.0 strict. */
+ HTML_DOCTYPE_X10_TRANSITIONAL , /**< XHTML 1.0 transitional. */
+ HTML_DOCTYPE_X10_FRAMESET , /**< XHTML 1.0 frameset. */
+ HTML_DOCTYPE_X11 /**< XHTML 1.1. */
+};
+
+
+
/** Image dimension cache entry.
*/
typedef struct {
@@ -64,10 +59,19 @@ typedef struct {
typedef struct {
dkChar *url; /**< Link URL. */
unsigned long lno; /**< Link number within current page. */
+ int flags; /**< Flags for link. */
} hb_link_t;
+/** Flags for link, used for the flags field in the hb_link_t type.
+*/
+enum {
+ /** Script fle needs async flag.
+ */
+ LINK_FLAG_SCRIPT_ASYNC = 0x0001
+};
+
/** One contents line.
*/
typedef struct {
@@ -105,7 +109,7 @@ struct hb__node_t {
dkChar *fulltitle; /**< Full title (browser title bar). */
dkChar *filename; /**< Text file name (optional). */
dkChar *suffix; /**< Output file name suffix (opt). */
- dkChar *template; /**< Template file name (optional). */
+ dkChar *templatefi; /**< Template file name (optional). */
dkChar *stylefile; /**< Style file. */
dkChar *author; /**< Name of author. */
dkChar *location; /**< Location (city) of author. */
@@ -133,6 +137,7 @@ struct hb__node_t {
int tocstate; /**< State when creating TOC. */
int inenc; /**< Text file input encoding. */
int havenavimenu; /**< Flag: Already have navi menu. */
+ int htdt; /**< HTML doctype. */
};
/** One node in the document tree.
@@ -161,6 +166,7 @@ typedef struct {
The tree structure is below the rootnode element.
*/
typedef struct {
+ char elmbuf[8*sizeof(dk3_um_t)]; /**< Buffer. */
dk3_tm_t starttime; /**< Start time. */
dk3_app_t *app; /**< Application structure. */
dkChar const * const *msg; /**< Localized messages. */
@@ -181,6 +187,7 @@ typedef struct {
hb_node_t *rootnode; /**< Root node. */
hb_node_t *currentnode; /**< Current node to modify. */
hb_node_t *impressumnode; /**< Impressum node. */
+ hb_node_t *privacynode; /**< Privacy statement node. */
hb_node_t *firstnode; /**< First pnode. */
hb_node_t *lastnode; /**< Last pnode. */
dkChar const *infilename; /**< Input file name (project). */
@@ -189,7 +196,10 @@ typedef struct {
dkChar const *url; /**< URL to publish the results. */
dkChar const *indexfile; /**< Typically index html. */
dkChar const *impressumlink; /**< Link to impressum. */
+ dkChar const *privacylink; /**< Link to privacy statement. */
dkChar const *chmlang; /**< Language setting for CHM. */
+ dkChar const *htmllang; /**< Language setting for HTML. */
+ dkChar const *ptocjsfile; /**< Page TOC JS file (allocated). */
dkChar *shipbuffer; /**< Shipout buffer. */
dkChar *iltemplate; /**< Input line from template. */
dkChar *ilfile; /**< Input line from file. */
@@ -199,6 +209,7 @@ typedef struct {
unsigned long lineno; /**< Line number. */
unsigned long nextobj; /**< Next object number. */
unsigned long npobjs; /**< Number of printable objects. */
+ unsigned long elmchr; /**< External link marker. */
size_t bs; /**< Buffer size. */
size_t spused; /**< Number elements used in special. */
size_t shipused; /**< Shipout buffer used. */
@@ -214,6 +225,11 @@ typedef struct {
int headlevels; /**< Maximum depth to print header. */
int coli; /**< Current code line number. */
int cols; /**< Code line state. */
+ int markel; /**< Flag: Mark external links. */
+ int tabsum; /**< Flag: Create table summaries. */
+ int svgwhdef; /**< Flag: Default svgwh value. */
+ int htdt; /**< HTML doctype. */
+ int ptocjsused; /**< Flag: ptoc js file used. */
} hb_job_t;
@@ -257,6 +273,10 @@ typedef struct {
*/
#define HB_NODE_OPT_STOP_JS_INHERITANCE 0x0020U
+/** Indicate the privacy node.
+*/
+#define HB_NODE_OPT_PRIVACY 0x0040U
+
/**@}*/
@@ -304,6 +324,10 @@ typedef struct {
*/
#define HB_JOB_OPT_CODE_LINE_NUMBERS 0x0200U
+/** Fold and unfold page table of contents.
+*/
+#define HB_JOB_OPT_FOLD_PTOC 0x0400U
+
/**@}*/
diff --git a/support/dktools/htmlbook.rc b/support/dktools/htmlbook.rc
index 25808fa621..989b6dfb6b 100644
--- a/support/dktools/htmlbook.rc
+++ b/support/dktools/htmlbook.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Publish book-like HTML\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Publish book-like HTML\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "htmlbook\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/initd-printqd.in b/support/dktools/initd-printqd.in
index be38047e14..6482a415f3 100644
--- a/support/dktools/initd-printqd.in
+++ b/support/dktools/initd-printqd.in
@@ -1,60 +1,97 @@
-:
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: printqd
+# Required-Start: $local_fs $network
+# Required-Stop: $local_fs $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start the printqd daemon
+# Description: Start the printqd daemon.
+### END INIT INFO
+#
+# Author: Dirk Krause <krause.dirk@web.de>
+#
-# Standard directory variables from autoconf
-prefix=@prefix@
-datarootdir=@datarootdir@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-datadir=${datarootdir}
-sysconfdir=@sysconfdir@
-scd=$(sysconfdir)
-libdir=@libdir@
-sharedlibdir=$(libdir)/shared
-mandir=@mandir@
-includedir=@includedir@
-localstatedir=@localstatedir@
+. /lib/init/vars.sh
+. /lib/lsb/init-functions
-RUNDIR=${localstatedir}/run/printqd
-LOGDIR=${localstatedir}/log/printqd
-DBDIR=${localstatedir}/printqd
-LPUSER=@LPUSER@
-LPGROUP=@LPGROUP@
+prefix="@prefix@"
+datarootdir="@datarootdir@"
+exec_prefix="@exec_prefix@"
+sysconfdir="@sysconfdir@"
+bindir="@bindir@"
+sbindir="@sbindir@"
+libdir="@libdir@"
+localstatedir="@localstatedir@"
+RDIR="${localstatedir}/run"
+PDIR="${localstatedir}/lib"
+LDIR="${localstatedir}/log"
-. ${sysconfdir}/rc.d/init.d/functions
+DAEMON="${sbindir}/printqd"
+PIDFILE="${RDIR}/printqd/printqd.pid"
+SOCKFILE="${RDIR}/printqd/printqd.sock"
-start() {
- [ -d $RUNDIR ] || mkdir -p $RUNDIR
- [ -d $LOGDIR ] || mkdir -p $LOGDIR
- [ -d $DBDIR ] || mkdir -p $DBDIR
- chown -R ${LPUSER}:${LPGROUP} $RUNDIR
- chown -R ${LPUSER}:${LPGROUP} $LOGDIR
- chown -R ${LPUSER}:${LPGROUP} $DBDIR
- chmod -R 770 $RUNDIR
- chmod -R 770 $LOGDIR
- chmod -R 770 $DBDIR
- ${sbindir}/printqd
-}
-
-stop() {
- killproc printqd
-}
-
-case "$*" in
-"start")
- start
-;;
-"stop")
- stop
-;;
-"restart")
- stop
- sleep 1
- start
- sleep 1
-;;
+set -e
+case $1 in
+ start)
+ if [ ! -d "${RDIR}/printqd" ]
+ then
+ mkdir -p "${RDIR}/printqd"
+ chown -R daemon:lp "${RDIR}/printqd"
+ chmod 770 "${RDIR}/printqd"
+ fi
+ if [ ! -d "${PDIR}/printqd" ]
+ then
+ mkdir -p "${PDIR}/printqd"
+ chown -R daemon:lp "${PDIR}/printqd"
+ chmod 770 "${PDIR}/printqd"
+ fi
+ if [ ! -d "${LDIR}/printqd" ]
+ then
+ mkdir -p "${LDIR}/printqd"
+ chown -R daemon:lp "${LDIR}/printqd"
+ chmod 770 "${LDIR}/printqd"
+ fi
+ if [ ! -d "${PDIR}/printqd/db" ]
+ then
+ mkdir -p "${PDIR}/printqd/db"
+ chown -R daemon:lp "${PDIR}/printqd/db"
+ chmod 770 "${PDIR}/printqd/db"
+ fi
+ if [ -e "${SOCKFILE}" ]
+ then
+ rm -f "${SOCKFILE}"
+ fi
+ if [ -e "${PIDFILE}" ]
+ then
+ rm -f "${PIDFILE}"
+ fi
+ log_daemon_msg "Starting print quota daemon" "printqd"
+ start_daemon -p $PIDFILE $DAEMON
+ log_end_msg $?
+ ;;
+ stop)
+ log_daemon_msg "Stopping print quota daemon" "printqd"
+ killproc -p $PIDFILE $DAEMON
+ log_end_msg $?
+ ;;
+ reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ restart|force-reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ status_of_proc -p $PIDFILE $DAEMON printqd && exit 0 || exit $?
+ ;;
+ *)
+ echo "Usage: /etc/init.d/printqd {start|stop|reload|restart|force-reload|status}"
+ exit 1
+ ;;
esac
-
diff --git a/support/dktools/initd-rshdown.in b/support/dktools/initd-rshdown.in
new file mode 100644
index 0000000000..6e60767364
--- /dev/null
+++ b/support/dktools/initd-rshdown.in
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: rshdown
+# Required-Start: $local_fs $network
+# Required-Stop: $local_fs $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start the rshdown daemon
+# Description: Start the rshdown daemon.
+### END INIT INFO
+#
+# Author: Dirk Krause <krause.dirk@web.de>
+#
+
+. /lib/init/vars.sh
+. /lib/lsb/init-functions
+
+prefix="@prefix@"
+datarootdir="@datarootdir@"
+exec_prefix="@exec_prefix@"
+sysconfdir="@sysconfdir@"
+bindir="@bindir@"
+sbindir="@sbindir@"
+libdir="@libdir@"
+localstatedir="@localstatedir@"
+RDIR="${localstatedir}/run"
+PDIR="${localstatedir}/lib"
+LDIR="${localstatedir}/log"
+
+DAEMON="${sbindir}/rshdown"
+PIDFILE="${RDIR}/rshdown/rshdown.pid"
+
+set -e
+
+case $1 in
+ start)
+ if [ ! -d "${RDIR}/rshdown" ]
+ then
+ mkdir -p "${RDIR}/rshdown"
+ chmod 770 "${RDIR}/rshdown"
+ fi
+ if [ ! -d "${LDIR}/rshdown" ]
+ then
+ mkdir -p "${LDIR}/rshdown"
+ chmod 770 "${LDIR}/rshdown"
+ fi
+ if [ -e "${PIDFILE}" ]
+ then
+ rm -f "${PIDFILE}"
+ fi
+ log_daemon_msg "Starting rshdown daemon" "rshdown"
+ start_daemon -p $PIDFILE $DAEMON
+ log_end_msg $?
+ ;;
+ stop)
+ log_daemon_msg "Stopping rshdown daemon" "rshdown"
+ killproc -p $PIDFILE $DAEMON
+ log_end_msg $?
+ ;;
+ reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ restart|force-reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ status_of_proc -p $PIDFILE $DAEMON rshdown && exit 0 || exit $?
+ ;;
+ *)
+ echo "Usage: /etc/init.d/rshdown {start|stop|reload|restart|force-reload|status}"
+ exit 1
+ ;;
+esac
diff --git a/support/dktools/instdir.sh b/support/dktools/instdir.sh
new file mode 100755
index 0000000000..c993ee7e1d
--- /dev/null
+++ b/support/dktools/instdir.sh
@@ -0,0 +1,26 @@
+#! /bin/sh
+
+#
+# Use by installation from Makefile.
+# This script decides for each program to install, whether
+# it goes to $(DESTDIR)$(sbindir) or $(DESTDIR)$(bindir).
+#
+# Arguments
+# - Program to install
+# - $(DESTDIR)$(sbindir)
+# - $(DESTDIR)$(bindir)
+#
+
+case "$1" in
+ printqd)
+ echo $2
+ ;;
+ rshdown)
+ echo $2
+ ;;
+ *)
+ echo $3
+ ;;
+esac
+
+exit 0
diff --git a/support/dktools/itacomp.c b/support/dktools/itacomp.c
index 6a88cca630..5f8d79fed8 100644
--- a/support/dktools/itacomp.c
+++ b/support/dktools/itacomp.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itacomp.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itacomp.ctr
*/
@@ -38,12 +16,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "itadmin.h"
+#include "dk3unused.h"
-#line 17 "itacomp.ctr"
+#line 18 "itacomp.ctr"
@@ -828,11 +807,13 @@ itadmin_comp_date(itadmin_date const *l, itadmin_date const *r)
int
-itadmin_comp_dhcp_option(void const *l, void const *r, int cr)
+itadmin_comp_dhcp_option(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
itadmin_dhcp_option const *pl;
itadmin_dhcp_option const *pr;
int back = 0;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (itadmin_dhcp_option const *)l;
diff --git a/support/dktools/itacomp.ctr b/support/dktools/itacomp.ctr
index 1d04391c14..13e06a11e1 100644
--- a/support/dktools/itacomp.ctr
+++ b/support/dktools/itacomp.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -10,6 +10,7 @@ license = bsd
#include "dk3all.h"
#include "itadmin.h"
+#include "dk3unused.h"
@@ -798,11 +799,13 @@ itadmin_comp_date(itadmin_date const *l, itadmin_date const *r)
int
-itadmin_comp_dhcp_option(void const *l, void const *r, int cr)
+itadmin_comp_dhcp_option(void const *l, void const *r, int DK3_ARG_UNUSED(cr) )
{
itadmin_dhcp_option const *pl;
itadmin_dhcp_option const *pr;
int back = 0;
+
+ DK3_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (itadmin_dhcp_option const *)l;
diff --git a/support/dktools/itaconf.c b/support/dktools/itaconf.c
index b661fa8ab0..334b0a9d48 100644
--- a/support/dktools/itaconf.c
+++ b/support/dktools/itaconf.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itaconf.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itaconf.ctr
*/
/** @file itaconf.c The itaconf module.
@@ -89,10 +67,28 @@ dkT("use-koma-script"),
/* 11 */
dkT("msft-release-lease-on-shutdown"),
+/* 12 */
+dkT("marker-point"),
+
+/* 13 */
+dkT("marker-vlan"),
+
+/* 14 */
+dkT("marker-subnet"),
+
+/* 15 */
+dkT("marker-group"),
+
+/* 16 */
+dkT("marker-pool"),
+
+/* 17 */
+dkT("marker-host"),
+
NULL
-#line 73 "itaconf.ctr"
+#line 82 "itaconf.ctr"
};
@@ -113,7 +109,7 @@ dkT("MySQL"),
NULL
-#line 93 "itaconf.ctr"
+#line 102 "itaconf.ctr"
};
@@ -134,7 +130,7 @@ dkT("password"),
NULL
-#line 115 "itaconf.ctr"
+#line 124 "itaconf.ctr"
};
@@ -157,7 +153,7 @@ itadmin_config_set_string(
int back = 0;
-#line 136 "itaconf.ctr"
+#line 145 "itaconf.ctr"
np = dk3str_dup_app(srcptr,job->app);
if(np) {
dk3_release(*resptr);
@@ -167,7 +163,7 @@ itadmin_config_set_string(
/* ERROR: Memory allocation failed! */
}
-#line 144 "itaconf.ctr"
+#line 153 "itaconf.ctr"
return back;
}
@@ -189,7 +185,7 @@ itadmin_config_set_bool(itadmin_job *job, int *bp, int defv, dkChar const *txt)
int back = 1;
-#line 164 "itaconf.ctr"
+#line 173 "itaconf.ctr"
if(txt) {
p1 = dk3str_start(txt, NULL);
if(p1) {
@@ -200,7 +196,7 @@ itadmin_config_set_bool(itadmin_job *job, int *bp, int defv, dkChar const *txt)
*bp = ((dk3str_is_on(lb)) ? 1 : 0);
} else {
-#line 173 "itaconf.ctr"
+#line 182 "itaconf.ctr"
back = 0;
*bp = defv;
/* ERROR: Not a boolean! */
@@ -208,7 +204,7 @@ itadmin_config_set_bool(itadmin_job *job, int *bp, int defv, dkChar const *txt)
}
} else {
-#line 179 "itaconf.ctr"
+#line 188 "itaconf.ctr"
back = 0;
*bp = defv;
/* ERROR: Text too long! */
@@ -216,16 +212,16 @@ itadmin_config_set_bool(itadmin_job *job, int *bp, int defv, dkChar const *txt)
}
} else {
-#line 185 "itaconf.ctr"
+#line 194 "itaconf.ctr"
*bp = defv;
}
} else {
-#line 188 "itaconf.ctr"
+#line 197 "itaconf.ctr"
*bp = defv;
}
-#line 190 "itaconf.ctr"
+#line 199 "itaconf.ctr"
return back;
}
@@ -278,7 +274,7 @@ itadmin_config_const_line_handler(void *obj, dkChar const *il)
int back = 0;
-#line 241 "itaconf.ctr"
+#line 250 "itaconf.ctr"
if((obj) && (il)) {
job = (itadmin_job *)obj;
if(dk3str_len(il) < DK3_SIZEOF(line,dkChar)) {
@@ -331,13 +327,7 @@ itadmin_config_const_line_handler(void *obj, dkChar const *il)
back = itadmin_config_set_string(job, &(job->ldapb), p2);
} break;
case 10: {
- if(dk3str_is_bool(p2)) {
- back = 1;
- job->ukoma = ((dk3str_is_on(p2)) ? 1 : 0);
- } else {
- /* ERROR: Boolean expected! */
- dk3app_log_3(job->app,DK3_LL_ERROR,job->msg,106,107,p2);
- }
+ back = itadmin_config_set_bool(job, &(job->ukoma), 0, p2);
} break;
case 11: {
switch(dk3str_array_index(msft_release_keys, p2, 0)) {
@@ -355,6 +345,24 @@ itadmin_config_const_line_handler(void *obj, dkChar const *il)
} break;
}
} break;
+ case 12: {
+ back = itadmin_config_set_bool(job, &(job->m_p), 1, p2);
+ } break;
+ case 13: {
+ back = itadmin_config_set_bool(job, &(job->m_vl), 1, p2);
+ } break;
+ case 14: {
+ back = itadmin_config_set_bool(job, &(job->m_sn), 1, p2);
+ } break;
+ case 15: {
+ back = itadmin_config_set_bool(job, &(job->m_gr), 1, p2);
+ } break;
+ case 16: {
+ back = itadmin_config_set_bool(job, &(job->m_po), 1, p2);
+ } break;
+ case 17: {
+ back = itadmin_config_set_bool(job, &(job->m_ho), 0, p2);
+ } break;
default: {
/* ERROR: Unknown option ... */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 113, 114, p1);
@@ -378,7 +386,7 @@ itadmin_config_const_line_handler(void *obj, dkChar const *il)
}
}
-#line 339 "itaconf.ctr"
+#line 360 "itaconf.ctr"
return back;
}
@@ -400,36 +408,36 @@ itadmin_cred_file_const_line_handler(void *obj, dkChar const *il)
int back = 0;
-#line 359 "itaconf.ctr"
+#line 380 "itaconf.ctr"
if((obj) && (il)) {
-#line 360 "itaconf.ctr"
+#line 381 "itaconf.ctr"
reader = (itadmin_cred_reader *)obj;
if(dk3str_len(il) < DK3_SIZEOF(line,dkChar)) {
-#line 362 "itaconf.ctr"
+#line 383 "itaconf.ctr"
dk3str_cpy_not_overlapped(line, il);
dk3str_delnl(line);
p1 = dk3str_start(line, NULL);
if(p1) {
-#line 366 "itaconf.ctr"
+#line 387 "itaconf.ctr"
if(*p1 == dkT('#')) {
-#line 367 "itaconf.ctr"
+#line 388 "itaconf.ctr"
back = 1; /* Ignore comment. */
} else {
-#line 369 "itaconf.ctr"
+#line 390 "itaconf.ctr"
if(*p1 == dkT('[')) {
-#line 370 "itaconf.ctr"
+#line 391 "itaconf.ctr"
reader->f_clnt = 0;
p1++;
p2 = dk3str_chr(p1, dkT(']'));
if(p2) {
-#line 374 "itaconf.ctr"
+#line 395 "itaconf.ctr"
back = 1;
*p2 = dkT('\0');
if(dk3str_cmp(p1, itadmin_config_credential_keys[0]) == 0) {
@@ -437,7 +445,7 @@ itadmin_cred_file_const_line_handler(void *obj, dkChar const *il)
}
} else {
-#line 380 "itaconf.ctr"
+#line 401 "itaconf.ctr"
/* ERROR: Syntax! */
dk3app_log_1(
(reader->job)->app, DK3_LL_ERROR, (reader->job)->msg, 117
@@ -445,30 +453,30 @@ itadmin_cred_file_const_line_handler(void *obj, dkChar const *il)
}
} else {
-#line 386 "itaconf.ctr"
+#line 407 "itaconf.ctr"
back = 1;
p2 = dk3str_chr(p1, dkT('='));
if(p2) {
-#line 389 "itaconf.ctr"
+#line 410 "itaconf.ctr"
*(p2++) = dkT('\0');
p2 = dk3str_start(p2, NULL);
if(p2) {
-#line 392 "itaconf.ctr"
+#line 413 "itaconf.ctr"
dk3str_normalize(p1,NULL,dkT(' '));
switch(dk3str_array_index(itadmin_config_credential_keys,p1,0))
{
case 1: { /* user */
-#line 396 "itaconf.ctr"
+#line 417 "itaconf.ctr"
back = itadmin_config_set_string(
reader->job, &((reader->job)->dbus), p2
);
} break;
case 2: { /* password */
-#line 401 "itaconf.ctr"
+#line 422 "itaconf.ctr"
back = itadmin_config_set_string(
reader->job, &((reader->job)->dbpw), p2
);
@@ -476,24 +484,24 @@ itadmin_cred_file_const_line_handler(void *obj, dkChar const *il)
}
} else {
-#line 407 "itaconf.ctr"
+#line 428 "itaconf.ctr"
/* Empty key. */
}
} else {
-#line 410 "itaconf.ctr"
+#line 431 "itaconf.ctr"
/* Not a key=value line. */
}
}
}
} else {
-#line 415 "itaconf.ctr"
+#line 436 "itaconf.ctr"
back = 1; /* Ignore empty line. */
}
} else {
-#line 418 "itaconf.ctr"
+#line 439 "itaconf.ctr"
/* ERROR: Line too long! */
dk3app_log_1(
(reader->job)->app, DK3_LL_ERROR, (reader->job)->msg, 116
@@ -501,10 +509,10 @@ itadmin_cred_file_const_line_handler(void *obj, dkChar const *il)
}
} else {
-#line 424 "itaconf.ctr"
+#line 445 "itaconf.ctr"
}
-#line 425 "itaconf.ctr"
+#line 446 "itaconf.ctr"
return back;
}
@@ -555,7 +563,7 @@ itadmin_config_process_one_file(itadmin_job *job, dkChar const *fn)
int back = 0;
-#line 474 "itaconf.ctr"
+#line 495 "itaconf.ctr"
back = dk3stream_process_filename_lines_app(
(void *)job,
itadmin_config_line_handler,
@@ -570,7 +578,7 @@ itadmin_config_process_one_file(itadmin_job *job, dkChar const *fn)
back = 0;
}
-#line 487 "itaconf.ctr"
+#line 508 "itaconf.ctr"
return back;
}
@@ -590,7 +598,7 @@ itadmin_config_read_credentials(itadmin_job *job)
int back = 0;
-#line 505 "itaconf.ctr"
+#line 526 "itaconf.ctr"
if(dk3str_len(job->dbcf) < DK3_SIZEOF(fnb,dkChar)) {
dk3str_cpy_not_overlapped(fnb, job->dbcf);
dk3str_correct_filename(fnb);
@@ -605,7 +613,7 @@ itadmin_config_read_credentials(itadmin_job *job)
reader.job = job;
reader.f_clnt = 1;
-#line 518 "itaconf.ctr"
+#line 539 "itaconf.ctr"
back = dk3stream_process_filename_sanitized_lines_app(
(void *)(&reader),
itadmin_cred_file_line_handler,
@@ -623,11 +631,11 @@ itadmin_config_read_credentials(itadmin_job *job)
}
if(job->ec) {
-#line 534 "itaconf.ctr"
+#line 555 "itaconf.ctr"
back = 0;
}
-#line 536 "itaconf.ctr"
+#line 557 "itaconf.ctr"
return back;
}
@@ -650,7 +658,7 @@ itadmin_config_read(itadmin_job *job)
int i; /* Current file name index. */
-#line 557 "itaconf.ctr"
+#line 578 "itaconf.ctr"
/*
Process default configuration files.
*/
@@ -722,76 +730,76 @@ itadmin_config_read(itadmin_job *job)
*/
if(have_file) {
-#line 627 "itaconf.ctr"
+#line 648 "itaconf.ctr"
if(!(have_error)) {
-#line 628 "itaconf.ctr"
+#line 649 "itaconf.ctr"
back = 1;
if(!(job->dbhn)) {
-#line 630 "itaconf.ctr"
+#line 651 "itaconf.ctr"
/* ERROR: Missing database host name! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 122);
back = 0;
}
if(!(job->dbn)) {
-#line 635 "itaconf.ctr"
+#line 656 "itaconf.ctr"
/* ERROR: Missing database name! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 123);
back = 0;
}
if(!(job->vlan)) {
-#line 640 "itaconf.ctr"
+#line 661 "itaconf.ctr"
/* Warning: Missing VLAN name! */
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 124);
}
if(!(job->org)) {
-#line 644 "itaconf.ctr"
+#line 665 "itaconf.ctr"
/* ERROR: Missing organization name! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 125);
back = 0;
}
if(!(job->ou)) {
-#line 649 "itaconf.ctr"
+#line 670 "itaconf.ctr"
/* ERROR: Missing organizational unit name! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 126);
back = 0;
}
if(!(job->admn)) {
-#line 654 "itaconf.ctr"
+#line 675 "itaconf.ctr"
/* ERROR: Missing administrator name! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 127);
back = 0;
}
if(!(job->dbcf)) {
-#line 659 "itaconf.ctr"
+#line 680 "itaconf.ctr"
/* ERROR: Missing database credentials file name! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 128);
back = 0;
} else {
-#line 663 "itaconf.ctr"
+#line 684 "itaconf.ctr"
if(back) {
-#line 664 "itaconf.ctr"
+#line 685 "itaconf.ctr"
back = itadmin_config_read_credentials(job);
if(back) {
if(!(job->dbus)) {
-#line 667 "itaconf.ctr"
+#line 688 "itaconf.ctr"
/* ERROR: Missing database user name! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 129);
back = 0;
}
if(!(job->dbpw)) {
-#line 672 "itaconf.ctr"
+#line 693 "itaconf.ctr"
/* ERROR: Missing database user password! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 130);
back = 0;
@@ -811,16 +819,16 @@ itadmin_config_read(itadmin_job *job)
}
} else {
-#line 690 "itaconf.ctr"
+#line 711 "itaconf.ctr"
}
} else {
-#line 692 "itaconf.ctr"
+#line 713 "itaconf.ctr"
/* ERROR: No configuration file found for processing! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 131);
}
-#line 695 "itaconf.ctr"
+#line 716 "itaconf.ctr"
return back;
}
diff --git a/support/dktools/itaconf.ctr b/support/dktools/itaconf.ctr
index 122d84bb23..6ab3e10f77 100644
--- a/support/dktools/itaconf.ctr
+++ b/support/dktools/itaconf.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -69,6 +69,15 @@ use-koma-script
# 11: release lease on shutdown
#
msft-release-lease-on-shutdown
+#
+# 12-17 Marker flags
+#
+marker-point
+marker-vlan
+marker-subnet
+marker-group
+marker-pool
+marker-host
$!end
};
@@ -290,13 +299,7 @@ itadmin_config_const_line_handler(void *obj, dkChar const *il)
back = itadmin_config_set_string(job, &(job->ldapb), p2);
} break;
case 10: {
- if(dk3str_is_bool(p2)) {
- back = 1;
- job->ukoma = ((dk3str_is_on(p2)) ? 1 : 0);
- } else {
- /* ERROR: Boolean expected! */
- dk3app_log_3(job->app,DK3_LL_ERROR,job->msg,106,107,p2);
- }
+ back = itadmin_config_set_bool(job, &(job->ukoma), 0, p2);
} break;
case 11: {
switch(dk3str_array_index(msft_release_keys, p2, 0)) {
@@ -314,6 +317,24 @@ itadmin_config_const_line_handler(void *obj, dkChar const *il)
} break;
}
} break;
+ case 12: {
+ back = itadmin_config_set_bool(job, &(job->m_p), 1, p2);
+ } break;
+ case 13: {
+ back = itadmin_config_set_bool(job, &(job->m_vl), 1, p2);
+ } break;
+ case 14: {
+ back = itadmin_config_set_bool(job, &(job->m_sn), 1, p2);
+ } break;
+ case 15: {
+ back = itadmin_config_set_bool(job, &(job->m_gr), 1, p2);
+ } break;
+ case 16: {
+ back = itadmin_config_set_bool(job, &(job->m_po), 1, p2);
+ } break;
+ case 17: {
+ back = itadmin_config_set_bool(job, &(job->m_ho), 0, p2);
+ } break;
default: {
/* ERROR: Unknown option ... */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 113, 114, p1);
diff --git a/support/dktools/itadata.c b/support/dktools/itadata.c
index 5b92503dfa..03fc74a344 100644
--- a/support/dktools/itadata.c
+++ b/support/dktools/itadata.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itadata.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itadata.ctr
*/
/** @file itadata.c The itadata module.
diff --git a/support/dktools/itadata.ctr b/support/dktools/itadata.ctr
index c377b1899a..bce5fd8699 100644
--- a/support/dktools/itadata.ctr
+++ b/support/dktools/itadata.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/itadhcp.c b/support/dktools/itadhcp.c
index 45e6ca8ba5..43799520f5 100644
--- a/support/dktools/itadhcp.c
+++ b/support/dktools/itadhcp.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itadhcp.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itadhcp.ctr
*/
/** @file itadhcp.c The itadhcp module.
@@ -172,10 +150,37 @@ static char const * const itadmin_dhcp_c8_kw[] = {
/* 39 */
"}\n",
+/* 40 */
+"# ##### ITADMIN_RANGE_BEGIN ",
+
+/* 41 */
+"# ##### ITADMIN_RANGE_DATA ",
+
+/* 42 */
+"# ##### ITADMIN_RANGE_END ",
+
+/* 43 */
+"shared-network ",
+
+/* 44 */
+"dhcpnet",
+
+/* 45 */
+"subnet ",
+
+/* 46 */
+"pool ",
+
+/* 47 */
+"group ",
+
+/* 48 */
+"host ",
+
NULL
-#line 172 "itadhcp.ctr"
+#line 190 "itadhcp.ctr"
};
@@ -190,7 +195,7 @@ static char const * const itadmin_dhcp_option_names[] = {
NULL
-#line 183 "itadhcp.ctr"
+#line 201 "itadhcp.ctr"
};
@@ -214,20 +219,16 @@ itadmin_dhcp_indent(FILE *fipo, int ind)
/** Write DHCP options.
- @param job Job structure.
@param fipo Output file.
@param i_o Options storage iterator.
- @param objtype Object type (ignored).
@param indent Indent level.
*/
static
void
itadmin_dhcp_write_options(
- itadmin_job *job,
FILE *fipo,
dk3_sto_it_t *i_o,
- int objtype,
int indent
)
{
@@ -237,19 +238,19 @@ itadmin_dhcp_write_options(
int is_option;
-#line 228 "itadhcp.ctr"
+#line 242 "itadhcp.ctr"
dk3sto_it_reset(i_o);
while(NULL != (opt = (itadmin_dhcp_option *)dk3sto_it_next(i_o))) {
-#line 230 "itadhcp.ctr"
+#line 244 "itadhcp.ctr"
is_option = 0;
if(opt->k) {
-#line 232 "itadhcp.ctr"
+#line 246 "itadhcp.ctr"
p1 = dk3str_c8_start(opt->k, NULL);
if(p1) {
-#line 234 "itadhcp.ctr"
+#line 248 "itadhcp.ctr"
sl = strlen(itadmin_dhcp_c8_kw[2]);
if(dk3str_c8_len(p1) >= sl) {
if(dk3str_c8_ncmp(p1, itadmin_dhcp_c8_kw[2], sl) == 0) {
@@ -259,14 +260,14 @@ itadmin_dhcp_write_options(
}
} else {
-#line 242 "itadhcp.ctr"
+#line 256 "itadhcp.ctr"
}
if(p1) {
-#line 244 "itadhcp.ctr"
+#line 258 "itadhcp.ctr"
if(is_option) {
-#line 245 "itadhcp.ctr"
+#line 259 "itadhcp.ctr"
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[3], fipo);
fputs(p1, fipo);
@@ -278,11 +279,11 @@ itadmin_dhcp_write_options(
fputc('\n', fipo);
} else {
-#line 255 "itadhcp.ctr"
+#line 269 "itadhcp.ctr"
switch(dk3str_c8_array_index(itadmin_dhcp_option_names, p1, 0)) {
case 0: {
-#line 257 "itadhcp.ctr"
+#line 271 "itadhcp.ctr"
is_option = 1;
if(opt->v) {
if(dk3str_c8_is_bool(opt->v)) {
@@ -299,7 +300,7 @@ itadmin_dhcp_write_options(
} break;
default: {
-#line 272 "itadhcp.ctr"
+#line 286 "itadhcp.ctr"
itadmin_dhcp_indent(fipo, indent);
fputs(p1, fipo);
if(opt->v) {
@@ -313,15 +314,15 @@ itadmin_dhcp_write_options(
}
} else {
-#line 284 "itadhcp.ctr"
+#line 298 "itadhcp.ctr"
}
} else {
-#line 286 "itadhcp.ctr"
+#line 300 "itadhcp.ctr"
}
}
-#line 288 "itadhcp.ctr"
+#line 302 "itadhcp.ctr"
}
@@ -342,7 +343,7 @@ itadmin_dhcp_check_pool(
char buffer[128];
-#line 307 "itadhcp.ctr"
+#line 321 "itadhcp.ctr"
if(dp->auc) {
if(!(dp->duc)) {
back = 1;
@@ -367,7 +368,7 @@ itadmin_dhcp_check_pool(
itadmin_tool_log_utf8_3(job, DK3_LL_ERROR, 134, 135, buffer);
}
-#line 330 "itadhcp.ctr"
+#line 344 "itadhcp.ctr"
return back;
}
@@ -392,7 +393,7 @@ itadmin_dhcp_register_class_groups(
int back = 1;
-#line 353 "itadhcp.ctr"
+#line 367 "itadhcp.ctr"
if(dc->i_ho) {
dk3sto_it_reset(dc->i_ho);
while(NULL != (ho = (itadmin_host *)dk3sto_it_next(dc->i_ho))) {
@@ -432,7 +433,7 @@ itadmin_dhcp_register_class_groups(
}
}
-#line 391 "itadhcp.ctr"
+#line 405 "itadhcp.ctr"
return back;
}
@@ -442,6 +443,7 @@ itadmin_dhcp_register_class_groups(
@param job Job structure.
@param i_nw Storage iterator for the networks.
*/
+static
int
itadmin_dhcp_link_classes(
itadmin_job *job,
@@ -455,86 +457,86 @@ itadmin_dhcp_link_classes(
int back = 1;
-#line 412 "itadhcp.ctr"
+#line 427 "itadhcp.ctr"
dk3sto_it_reset(i_nw);
while(NULL != (nw = (itadmin_network *)dk3sto_it_next(i_nw))) {
-#line 414 "itadhcp.ctr"
+#line 429 "itadhcp.ctr"
if(nw->i_p) {
-#line 415 "itadhcp.ctr"
+#line 430 "itadhcp.ctr"
dk3sto_it_reset(nw->i_p);
while(NULL != (dp = (itadmin_dhcp_pool *)dk3sto_it_next(nw->i_p))) {
if(!itadmin_dhcp_check_pool(job, dp)) { back = 0; }
if(!(dp->auc)) {
-#line 419 "itadhcp.ctr"
+#line 434 "itadhcp.ctr"
if(dp->duc) {
-#line 420 "itadhcp.ctr"
+#line 435 "itadhcp.ctr"
if(dp->acl) {
-#line 421 "itadhcp.ctr"
+#line 436 "itadhcp.ctr"
dc = dp->acl;
-#line 422 "itadhcp.ctr"
+#line 437 "itadhcp.ctr"
if(!(dc->dhcpn)) {
-#line 423 "itadhcp.ctr"
+#line 438 "itadhcp.ctr"
dc->dhcpn = nw;
if(!(nw->s_dc)) {
-#line 425 "itadhcp.ctr"
+#line 440 "itadhcp.ctr"
nw->s_dc = dk3sto_open_app(job->app);
if(nw->s_dc) {
-#line 427 "itadhcp.ctr"
+#line 442 "itadhcp.ctr"
dk3sto_set_comp(nw->s_dc, itadmin_comp_dhcp_class, 0);
} else {
back = 0;
-#line 430 "itadhcp.ctr"
+#line 445 "itadhcp.ctr"
}
}
if(!(nw->i_dc)) {
-#line 433 "itadhcp.ctr"
+#line 448 "itadhcp.ctr"
if(nw->s_dc) {
-#line 434 "itadhcp.ctr"
+#line 449 "itadhcp.ctr"
nw->i_dc = dk3sto_it_open(nw->s_dc);
} else {
-#line 436 "itadhcp.ctr"
+#line 451 "itadhcp.ctr"
back = 0;
}
}
if((nw->s_dc) && (nw->i_dc)) {
-#line 440 "itadhcp.ctr"
+#line 455 "itadhcp.ctr"
if(!(dk3sto_it_find_like(nw->i_dc, (void *)dc, 0))) {
-#line 442 "itadhcp.ctr"
+#line 457 "itadhcp.ctr"
if(!(dk3sto_add(nw->s_dc, (void *)dc))) {
back = 0;
-#line 444 "itadhcp.ctr"
+#line 459 "itadhcp.ctr"
}
}
} else {
-#line 447 "itadhcp.ctr"
+#line 462 "itadhcp.ctr"
back = 0;
/* ERROR: Memory */
}
} else {
-#line 451 "itadhcp.ctr"
+#line 466 "itadhcp.ctr"
if(((dc->dhcpn)->ip4) != (nw->ip4)) {
back = 0;
-#line 453 "itadhcp.ctr"
+#line 468 "itadhcp.ctr"
/* ERROR: Class assigned to pools in different nets! */
itadmin_tool_log_utf8_3(job, DK3_LL_ERROR, 136, 137, dc->sn);
}
@@ -544,7 +546,7 @@ itadmin_dhcp_link_classes(
}
} else {
-#line 461 "itadhcp.ctr"
+#line 476 "itadhcp.ctr"
/* ERROR: No allowed class specified! */
sprintf(
buffer,
@@ -558,25 +560,116 @@ itadmin_dhcp_link_classes(
}
} else {
-#line 473 "itadhcp.ctr"
+#line 488 "itadhcp.ctr"
}
} else {
-#line 475 "itadhcp.ctr"
+#line 490 "itadhcp.ctr"
}
}
} else {
-#line 478 "itadhcp.ctr"
+#line 493 "itadhcp.ctr"
}
}
-#line 480 "itadhcp.ctr"
+#line 495 "itadhcp.ctr"
return back;
}
+/** Write marker for named object.
+ @param fipo Output file.
+ @param mi Marker index in itadmin_dhcp_c8_kw array.
+ @param ti Type index in itadmin_dhcp_c8_kw array.
+ @param name Host or group name.
+ @param indent Indent level (number of spaces at start of line).
+*/
+static
+void
+itadmin_dhcp_marker_name(
+ FILE *fipo,
+ size_t mi,
+ size_t ti,
+ const char *name,
+ int indent
+)
+{
+ while (0 < indent--) fputc(' ', fipo);
+ fputs(itadmin_dhcp_c8_kw[mi], fipo);
+ fputs(itadmin_dhcp_c8_kw[ti], fipo);
+ if (NULL != name) { fputs(name, fipo); }
+ fputc('\n', fipo);
+}
+
+
+
+/** Write marker for object identified by IPv4 address.
+ @param fipo Output file.
+ @param mi Marker index in itadmin_dhcp_c8_kw array.
+ @param ti Type index in itadmin_dhcp_c8_kw array.
+ @param ip4 IPv4 address.
+ @param indent Indent level (number of spaces at start of line).
+*/
+static
+void
+itadmin_dhcp_marker_ip(
+ FILE *fipo,
+ size_t mi,
+ size_t ti,
+ unsigned long ip4,
+ int indent
+)
+{
+ char buffer[32];
+
+#if DK3_HAVE__SNPRINTF_S
+ _snprintf_s(
+ buffer, sizeof(buffer), (sizeof(buffer) - 1),
+ "%lu.%lu.%lu.%lu",
+ ((ip4 >> 24) & 0x000000FFUL),
+ ((ip4 >> 16) & 0x000000FFUL),
+ ((ip4 >> 8) & 0x000000FFUL),
+ ((ip4 ) & 0x000000FFUL)
+ );
+#else
+#if DK3_HAVE_SNPRINTF
+ snprintf(
+ buffer, sizeof(buffer),
+ "%lu.%lu.%lu.%lu",
+ ((ip4 >> 24) & 0x000000FFUL),
+ ((ip4 >> 16) & 0x000000FFUL),
+ ((ip4 >> 8) & 0x000000FFUL),
+ ((ip4 ) & 0x000000FFUL)
+ );
+#else
+#if DK3_HAVE__SNPRINTF
+ _snprintf(
+ buffer, sizeof(buffer),
+ "%lu.%lu.%lu.%lu",
+ ((ip4 >> 24) & 0x000000FFUL),
+ ((ip4 >> 16) & 0x000000FFUL),
+ ((ip4 >> 8) & 0x000000FFUL),
+ ((ip4 ) & 0x000000FFUL)
+ );
+#else
+ sprintf(
+ buffer,
+ "%lu.%lu.%lu.%lu",
+ ((ip4 >> 24) & 0x000000FFUL),
+ ((ip4 >> 16) & 0x000000FFUL),
+ ((ip4 >> 8) & 0x000000FFUL),
+ ((ip4 ) & 0x000000FFUL)
+ );
+#endif
+#endif
+#endif
+ itadmin_dhcp_marker_name(fipo, mi, ti, buffer, indent);
+}
+
+
+
/** Write DHCP classes to output file.
@param job Job structure.
@param fipo output file.
@@ -590,19 +683,19 @@ itadmin_dhcp_write_classes(itadmin_job *job, FILE *fipo)
int is_first;
-#line 497 "itadhcp.ctr"
+#line 603 "itadhcp.ctr"
dk3sto_it_reset(job->i_dc);
while(NULL != (dc = (itadmin_dhcp_class *)dk3sto_it_next(job->i_dc))) {
-#line 500 "itadhcp.ctr"
+#line 606 "itadhcp.ctr"
if((dc->sn) && (dc->dhcpn)) {
-#line 501 "itadhcp.ctr"
+#line 607 "itadhcp.ctr"
is_first = 1;
if(dc->i_ho) {
-#line 503 "itadhcp.ctr"
+#line 609 "itadhcp.ctr"
dk3sto_it_reset(dc->i_ho);
while(NULL != (ho = (itadmin_host *)dk3sto_it_next(dc->i_ho))) {
if((ho->sn) && (ho->maca) && (!(ho->ipv4))) {
@@ -626,15 +719,15 @@ itadmin_dhcp_write_classes(itadmin_job *job, FILE *fipo)
}
}
-#line 525 "itadhcp.ctr"
+#line 631 "itadhcp.ctr"
} else {
-#line 526 "itadhcp.ctr"
+#line 632 "itadhcp.ctr"
}
}
}
-#line 529 "itadhcp.ctr"
+#line 635 "itadhcp.ctr"
}
@@ -657,7 +750,7 @@ itadmin_dhcp_write_pool(
itadmin_dhcp_class *dc;
-#line 550 "itadhcp.ctr"
+#line 656 "itadhcp.ctr"
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[20], fipo);
fputc('\n', fipo);
@@ -698,10 +791,22 @@ itadmin_dhcp_write_pool(
fputc('\n', fipo);
}
}
+
+ /* ITADMIN_RANGE_BEGIN pool _IP_ */
+ if (0 != job->m_po) {
+ itadmin_dhcp_marker_ip(fipo, 40, 46, dp->ip4s, (indent+1));
+ }
+
/* POOL OPTIONS */
if(dp->i_do) {
- itadmin_dhcp_write_options(job, fipo, dp->i_do, 4, (indent+1));
+ itadmin_dhcp_write_options(fipo, dp->i_do, (indent+1));
+ }
+
+ /* ITADMIN_RANGE_DATA pool _IP_ */
+ if (0 != job->m_po) {
+ itadmin_dhcp_marker_ip(fipo, 41, 46, dp->ip4s, (indent+1));
}
+
/* Release leases on shutdown for pool */
if (1 == job->rel) {
itadmin_dhcp_indent(fipo, (indent+1));
@@ -713,17 +818,22 @@ itadmin_dhcp_write_pool(
itadmin_dhcp_indent(fipo, (indent+1));
fputs(itadmin_dhcp_c8_kw[39], fipo);
}
+
+ /* ITADMIN_RANGE_END pool _IP_ */
+ if (0 != job->m_po) {
+ itadmin_dhcp_marker_ip(fipo, 42, 46, dp->ip4s, (indent+1));
+ }
+
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo);
-#line 608 "itadhcp.ctr"
+#line 732 "itadhcp.ctr"
}
/** Write one host in group.
- @param job Job structure.
@param fipo Output file.
@param ho Host to write.
@param ind Indent level at beginning of line.
@@ -739,7 +849,7 @@ itadmin_dhcp_write_one_host(
{
-#line 628 "itadhcp.ctr"
+#line 751 "itadhcp.ctr"
if((ho->sn) && (ho->maca)) {
itadmin_dhcp_indent(fipo, ind);
fputs(itadmin_dhcp_c8_kw[28], fipo);
@@ -749,18 +859,36 @@ itadmin_dhcp_write_one_host(
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
+ /* Host name */
itadmin_dhcp_indent(fipo, (ind + 1));
fputs(itadmin_dhcp_c8_kw[29], fipo);
fputs(ho->sn, fipo);
fputs(itadmin_dhcp_c8_kw[26], fipo);
fputc('\n', fipo);
-
+
+ /* ITADMIN_RANGE_BEGIN host _name_ */
+ if (0 != job->m_ho) {
+ itadmin_dhcp_marker_name(fipo, 40, 48, ho->sn, (ind+1));
+ }
+
+ /* Added 2013-09-14: Must write host options too. */
+ if((ho->s_do) && (ho->i_do)) {
+ itadmin_dhcp_write_options(fipo, ho->i_do, (ind+1));
+ }
+
+ /* ITADMIN_RANGE_DATA host _name_ */
+ if (0 != job->m_ho) {
+ itadmin_dhcp_marker_name(fipo, 41, 48, ho->sn, (ind+1));
+ }
+
+ /* hardware ethernet */
itadmin_dhcp_indent(fipo, (ind + 1));
fputs(itadmin_dhcp_c8_kw[30], fipo);
fputs(ho->maca, fipo);
fputs(itadmin_dhcp_c8_kw[10], fipo);
fputc('\n', fipo);
-
+
+ /* fixed-address */
if(ho->ipv4) {
itadmin_dhcp_indent(fipo, (ind + 1));
fputs(itadmin_dhcp_c8_kw[31], fipo);
@@ -769,17 +897,17 @@ itadmin_dhcp_write_one_host(
fputc('\n', fipo);
}
- /* Added 2013-09-14: Must write host options too. */
- if((ho->s_do) && (ho->i_do)) {
- itadmin_dhcp_write_options(job, fipo, ho->i_do, 3, (ind+1));
+ /* ITADMIN_RANGE_END host _name_ */
+ if (0 != job->m_ho) {
+ itadmin_dhcp_marker_name(fipo, 42, 48, ho->sn, (ind+1));
}
-
+
itadmin_dhcp_indent(fipo, ind);
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo);
}
-#line 666 "itadhcp.ctr"
+#line 807 "itadhcp.ctr"
}
@@ -805,13 +933,13 @@ itadmin_dhcp_write_group(
int is_in_group;
-#line 690 "itadhcp.ctr"
+#line 831 "itadhcp.ctr"
if(gr) {
-#line 691 "itadhcp.ctr"
+#line 832 "itadhcp.ctr"
} else {
-#line 692 "itadhcp.ctr"
+#line 833 "itadhcp.ctr"
}
is_first = 1;
if(i_ho) {
@@ -826,10 +954,18 @@ itadmin_dhcp_write_group(
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
if(gr) {
+ /* ITADMIN_RANGE_BEGIN group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 40, 47, gr->sn, (ind+1));
+ }
if(gr->i_do) {
- itadmin_dhcp_write_options(job, fipo, gr->i_do, 3, (ind+1));
+ itadmin_dhcp_write_options(fipo, gr->i_do, (ind+1));
fputc('\n', fipo);
}
+ /* ITADMIN_RANGE_DATA group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 41, 47, gr->sn, (ind+1));
+ }
}
} is_first = 0;
itadmin_dhcp_write_one_host(job, fipo, ho, (ind + 1));
@@ -865,10 +1001,18 @@ itadmin_dhcp_write_group(
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
if(gr) {
+ /* ITADMIN_RANGE_BEGIN group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 40, 47, gr->sn, (ind+1));
+ }
if(gr->i_do) {
- itadmin_dhcp_write_options(job,fipo,gr->i_do,3,(ind + 1));
+ itadmin_dhcp_write_options(fipo,gr->i_do,(ind + 1));
fputc('\n', fipo);
}
+ /* ITADMIN_RANGE_DATA group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 41, 47, gr->sn, (ind+1));
+ }
}
} is_first = 0;
itadmin_dhcp_write_one_host(job, fipo, ho, (ind + 1));
@@ -879,13 +1023,19 @@ itadmin_dhcp_write_group(
}
}
if(!(is_first)) {
+ if (NULL != gr) {
+ /* ITADMIN_RANGE_END group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 42, 47, gr->sn, (ind+1));
+ }
+ }
itadmin_dhcp_indent(fipo, ind);
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo);
}
-#line 764 "itadhcp.ctr"
+#line 927 "itadhcp.ctr"
}
@@ -909,7 +1059,7 @@ itadmin_dhcp_write_one_network(
itadmin_dhcp_ginw *ginw;
-#line 786 "itadhcp.ctr"
+#line 949 "itadhcp.ctr"
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[15], fipo);
itadmin_tool_write_ip(fipo, nw->ip4);
@@ -919,6 +1069,12 @@ itadmin_dhcp_write_one_network(
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
+
+ /* ITADMIN_RANGE_BEGIN subnet _IP_ */
+ if (0 != job->m_sn) {
+ itadmin_dhcp_marker_ip(fipo, 40, 45, nw->ip4, (indent+1));
+ }
+
itadmin_dhcp_indent(fipo, (indent + 1));
fputs(itadmin_dhcp_c8_kw[17], fipo);
itadmin_tool_write_ip(fipo, nw->gw4);
@@ -936,9 +1092,14 @@ itadmin_dhcp_write_one_network(
fputc('\n', fipo);
/* DHCP options */
if(nw->i_do) {
- itadmin_dhcp_write_options(job, fipo, nw->i_do, 2, (indent+1));
+ itadmin_dhcp_write_options(fipo, nw->i_do, (indent+1));
fputc('\n', fipo);
}
+ /* ITADMIN_RANGE_DATA subnet _IP_ */
+ if (0 != job->m_sn) {
+ itadmin_dhcp_marker_ip(fipo, 41, 45, nw->ip4, (indent+1));
+ }
+
/* Pools */
if(nw->i_p) {
dk3sto_it_reset(nw->i_p);
@@ -950,16 +1111,22 @@ itadmin_dhcp_write_one_network(
if(nw->i_dg) {
dk3sto_it_reset(nw->i_dg);
while(NULL != (ginw = (itadmin_dhcp_ginw *)dk3sto_it_next(nw->i_dg))) {
- itadmin_dhcp_write_group(job,fipo,nw,ginw->i_h,ginw->gr,(indent + 1));
+ itadmin_dhcp_write_group(job, fipo,nw,ginw->i_h,ginw->gr,(indent + 1));
}
}
/* Hosts without groups, direct for network and in DHCP classes */
itadmin_dhcp_write_group(job, fipo, nw, nw->i_hoi, NULL, (indent + 1));
+
+ /* ITADMIN_RANGE_END subnet _IP_ */
+ if (0 != job->m_sn) {
+ itadmin_dhcp_marker_ip(fipo, 42, 45, nw->ip4, (indent+1));
+ }
+
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo);
-#line 834 "itadhcp.ctr"
+#line 1014 "itadhcp.ctr"
}
@@ -980,13 +1147,13 @@ itadmin_dhcp_write_networks(
itadmin_network *nw;
-#line 853 "itadhcp.ctr"
+#line 1033 "itadhcp.ctr"
dk3sto_it_reset(i_nw);
while(NULL != (nw = (itadmin_network *)dk3sto_it_next(i_nw))) {
itadmin_dhcp_write_one_network(job, fipo, nw, 1);
}
-#line 857 "itadhcp.ctr"
+#line 1037 "itadhcp.ctr"
}
@@ -1010,11 +1177,13 @@ itadmin_dhcp_write_vlan(
int num_networks;
-#line 879 "itadhcp.ctr"
+#line 1059 "itadhcp.ctr"
num_networks = 0;
if(i_nw) {
dk3sto_it_reset(i_nw);
- while(NULL != dk3sto_it_next(i_nw)) { num_networks++; }
+ while(NULL != dk3sto_it_next(i_nw)) {
+ num_networks++;
+ }
if(num_networks > 0) {
dk3sto_it_reset(i_nw);
if((num_networks > 1) || (i_do)) {
@@ -1022,10 +1191,28 @@ itadmin_dhcp_write_vlan(
fputc('\n', fipo);
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
+
+ /* ITADMIN_RANGE_BEGIN shared-network dhcpnet */
+ if (0 != job->m_vl) {
+ itadmin_dhcp_marker_name(fipo,40,43,itadmin_dhcp_c8_kw[44],1);
+ }
+
if(i_do) {
- itadmin_dhcp_write_options(job, fipo, i_do, 1, 1);
+ itadmin_dhcp_write_options(fipo, i_do, 1);
+ }
+
+ /* ITADMIN_RANGE_DATA shared-network dhcpnet */
+ if (0 != job->m_vl) {
+ itadmin_dhcp_marker_name(fipo,41,43,itadmin_dhcp_c8_kw[44],1);
}
+
itadmin_dhcp_write_networks(job, fipo, i_nw);
+
+ /* ITADMIN_RANGE_END shared-network dhcpnet */
+ if (0 != job->m_vl) {
+ itadmin_dhcp_marker_name(fipo,42,43,itadmin_dhcp_c8_kw[44],1);
+ }
+
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo);
} else {
@@ -1037,7 +1224,7 @@ itadmin_dhcp_write_vlan(
}
}
-#line 904 "itadhcp.ctr"
+#line 1104 "itadhcp.ctr"
}
@@ -1063,7 +1250,6 @@ itadmin_dhcp_declare_msft_options(itadmin_job *job, FILE *fipo)
/** Write output file for a VLAN or all networks.
@param job Job structure.
- @param vlanname Name of VLAN (NULL if not specified).
@param i_nw Iterator for all networks.
@param i_do Iterator for VLAN DHCP options (may be NULL).
@return 1 on success, 0 on error.
@@ -1072,7 +1258,6 @@ static
int
itadmin_dhcpd_output(
itadmin_job *job,
- dkChar const *vlanname,
dk3_sto_it_t *i_nw,
dk3_sto_it_t *i_do
)
@@ -1081,23 +1266,27 @@ itadmin_dhcpd_output(
int back = 0;
-#line 946 "itadhcp.ctr"
+#line 1144 "itadhcp.ctr"
if(itadmin_dhcp_link_classes(job, i_nw)) {
-#line 947 "itadhcp.ctr"
+#line 1145 "itadhcp.ctr"
fipo = dk3sf_c8_fopen_app(
itadmin_dhcp_c8_kw[0], itadmin_dhcp_c8_kw[5], job->app
);
if(fipo) {
-#line 951 "itadhcp.ctr"
- itadmin_dhcp_write_options(job, fipo, job->i_do, 0, 0);
+#line 1149 "itadhcp.ctr"
+ itadmin_dhcp_write_options(fipo, job->i_do, 0);
fputc('\n', fipo);
itadmin_dhcp_declare_msft_options(job, fipo);
- fputs(itadmin_dhcp_c8_kw[32], fipo);
+ if (0 != job->m_p) {
+ fputs(itadmin_dhcp_c8_kw[32], fipo);
+ }
itadmin_dhcp_write_classes(job, fipo);
fputc('\n', fipo);
- fputs(itadmin_dhcp_c8_kw[33], fipo);
+ if (0 != job->m_p) {
+ fputs(itadmin_dhcp_c8_kw[33], fipo);
+ }
itadmin_dhcp_write_vlan(job, fipo, i_nw, i_do);
back = 1;
#if DK3_CHAR_SIZE == 1
@@ -1111,15 +1300,15 @@ itadmin_dhcpd_output(
#endif
} else {
-#line 970 "itadhcp.ctr"
+#line 1172 "itadhcp.ctr"
/* ERROR: Failed to open file. */
}
} else {
-#line 973 "itadhcp.ctr"
+#line 1175 "itadhcp.ctr"
}
-#line 974 "itadhcp.ctr"
+#line 1176 "itadhcp.ctr"
return back;
}
@@ -1134,7 +1323,7 @@ itadmin_dhcpd_conf_output(itadmin_job *job)
int res;
-#line 987 "itadhcp.ctr"
+#line 1189 "itadhcp.ctr"
if(job->vlan) {
res = dk3str_str_to_c8u_app(
vlname, sizeof(vlname), job->vlan,
@@ -1144,7 +1333,7 @@ itadmin_dhcpd_conf_output(itadmin_job *job)
dhcpvl =
(itadmin_vlan *)dk3sto_it_find_like(job->i_vl, (void *)vlname, 1);
if(dhcpvl) {
- back = itadmin_dhcpd_output(job, dhcpvl->s, dhcpvl->i_nw, dhcpvl->i_do);
+ back = itadmin_dhcpd_output(job, dhcpvl->i_nw, dhcpvl->i_do);
} else {
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 139, 140, job->vlan);
}
@@ -1152,10 +1341,10 @@ itadmin_dhcpd_conf_output(itadmin_job *job)
/* ERROR: Failed to convert VLAN name! */
}
} else {
- back = itadmin_dhcpd_output(job, NULL, job->i_nw, NULL);
+ back = itadmin_dhcpd_output(job, job->i_nw, NULL);
}
-#line 1006 "itadhcp.ctr"
+#line 1208 "itadhcp.ctr"
return back;
}
diff --git a/support/dktools/itadhcp.ctr b/support/dktools/itadhcp.ctr
index d9557012ba..b0843ced24 100644
--- a/support/dktools/itadhcp.ctr
+++ b/support/dktools/itadhcp.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -168,6 +168,24 @@ if substring (option vendor-class-identifier, 0, 4) = "MSFT" {\n
option MSFT.release-dhcp-lease-on-shutdown 1;\n
vendor-option-space MSFT;\n
}\n
+#
+# 40 41 42 ITADMIN_RANGE_... markers
+#
+\# ##### ITADMIN_RANGE_BEGIN
+\# ##### ITADMIN_RANGE_DATA
+\# ##### ITADMIN_RANGE_END
+#
+# 43 44 45 46 47 48 Type of marker
+#
+shared-network
+dhcpnet
+subnet
+pool
+group
+host
+#
+#
+#
$!end
};
@@ -203,20 +221,16 @@ itadmin_dhcp_indent(FILE *fipo, int ind)
/** Write DHCP options.
- @param job Job structure.
@param fipo Output file.
@param i_o Options storage iterator.
- @param objtype Object type (ignored).
@param indent Indent level.
*/
static
void
itadmin_dhcp_write_options(
- itadmin_job *job,
FILE *fipo,
dk3_sto_it_t *i_o,
- int objtype,
int indent
)
{
@@ -397,6 +411,7 @@ itadmin_dhcp_register_class_groups(
@param job Job structure.
@param i_nw Storage iterator for the networks.
*/
+static
int
itadmin_dhcp_link_classes(
itadmin_job *job,
@@ -482,6 +497,97 @@ itadmin_dhcp_link_classes(
+/** Write marker for named object.
+ @param fipo Output file.
+ @param mi Marker index in itadmin_dhcp_c8_kw array.
+ @param ti Type index in itadmin_dhcp_c8_kw array.
+ @param name Host or group name.
+ @param indent Indent level (number of spaces at start of line).
+*/
+static
+void
+itadmin_dhcp_marker_name(
+ FILE *fipo,
+ size_t mi,
+ size_t ti,
+ const char *name,
+ int indent
+)
+{
+ while (0 < indent--) fputc(' ', fipo);
+ fputs(itadmin_dhcp_c8_kw[mi], fipo);
+ fputs(itadmin_dhcp_c8_kw[ti], fipo);
+ if (NULL != name) { fputs(name, fipo); }
+ fputc('\n', fipo);
+}
+
+
+
+/** Write marker for object identified by IPv4 address.
+ @param fipo Output file.
+ @param mi Marker index in itadmin_dhcp_c8_kw array.
+ @param ti Type index in itadmin_dhcp_c8_kw array.
+ @param ip4 IPv4 address.
+ @param indent Indent level (number of spaces at start of line).
+*/
+static
+void
+itadmin_dhcp_marker_ip(
+ FILE *fipo,
+ size_t mi,
+ size_t ti,
+ unsigned long ip4,
+ int indent
+)
+{
+ char buffer[32];
+
+#if DK3_HAVE__SNPRINTF_S
+ _snprintf_s(
+ buffer, sizeof(buffer), (sizeof(buffer) - 1),
+ "%lu.%lu.%lu.%lu",
+ ((ip4 >> 24) & 0x000000FFUL),
+ ((ip4 >> 16) & 0x000000FFUL),
+ ((ip4 >> 8) & 0x000000FFUL),
+ ((ip4 ) & 0x000000FFUL)
+ );
+#else
+#if DK3_HAVE_SNPRINTF
+ snprintf(
+ buffer, sizeof(buffer),
+ "%lu.%lu.%lu.%lu",
+ ((ip4 >> 24) & 0x000000FFUL),
+ ((ip4 >> 16) & 0x000000FFUL),
+ ((ip4 >> 8) & 0x000000FFUL),
+ ((ip4 ) & 0x000000FFUL)
+ );
+#else
+#if DK3_HAVE__SNPRINTF
+ _snprintf(
+ buffer, sizeof(buffer),
+ "%lu.%lu.%lu.%lu",
+ ((ip4 >> 24) & 0x000000FFUL),
+ ((ip4 >> 16) & 0x000000FFUL),
+ ((ip4 >> 8) & 0x000000FFUL),
+ ((ip4 ) & 0x000000FFUL)
+ );
+#else
+ sprintf(
+ buffer,
+ "%lu.%lu.%lu.%lu",
+ ((ip4 >> 24) & 0x000000FFUL),
+ ((ip4 >> 16) & 0x000000FFUL),
+ ((ip4 >> 8) & 0x000000FFUL),
+ ((ip4 ) & 0x000000FFUL)
+ );
+#endif
+#endif
+#endif
+ itadmin_dhcp_marker_name(fipo, mi, ti, buffer, indent);
+}
+
+
+
/** Write DHCP classes to output file.
@param job Job structure.
@param fipo output file.
@@ -587,10 +693,22 @@ itadmin_dhcp_write_pool(
fputc('\n', fipo);
}
}
+
+ /* ITADMIN_RANGE_BEGIN pool _IP_ */
+ if (0 != job->m_po) {
+ itadmin_dhcp_marker_ip(fipo, 40, 46, dp->ip4s, (indent+1));
+ }
+
/* POOL OPTIONS */
if(dp->i_do) {
- itadmin_dhcp_write_options(job, fipo, dp->i_do, 4, (indent+1));
+ itadmin_dhcp_write_options(fipo, dp->i_do, (indent+1));
+ }
+
+ /* ITADMIN_RANGE_DATA pool _IP_ */
+ if (0 != job->m_po) {
+ itadmin_dhcp_marker_ip(fipo, 41, 46, dp->ip4s, (indent+1));
}
+
/* Release leases on shutdown for pool */
if (1 == job->rel) {
itadmin_dhcp_indent(fipo, (indent+1));
@@ -602,6 +720,12 @@ itadmin_dhcp_write_pool(
itadmin_dhcp_indent(fipo, (indent+1));
fputs(itadmin_dhcp_c8_kw[39], fipo);
}
+
+ /* ITADMIN_RANGE_END pool _IP_ */
+ if (0 != job->m_po) {
+ itadmin_dhcp_marker_ip(fipo, 42, 46, dp->ip4s, (indent+1));
+ }
+
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo); $? "- itadmin_dhcp_write_pool"
@@ -610,7 +734,6 @@ itadmin_dhcp_write_pool(
/** Write one host in group.
- @param job Job structure.
@param fipo Output file.
@param ho Host to write.
@param ind Indent level at beginning of line.
@@ -634,18 +757,36 @@ itadmin_dhcp_write_one_host(
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
+ /* Host name */
itadmin_dhcp_indent(fipo, (ind + 1));
fputs(itadmin_dhcp_c8_kw[29], fipo);
fputs(ho->sn, fipo);
fputs(itadmin_dhcp_c8_kw[26], fipo);
fputc('\n', fipo);
-
+
+ /* ITADMIN_RANGE_BEGIN host _name_ */
+ if (0 != job->m_ho) {
+ itadmin_dhcp_marker_name(fipo, 40, 48, ho->sn, (ind+1));
+ }
+
+ /* Added 2013-09-14: Must write host options too. */
+ if((ho->s_do) && (ho->i_do)) {
+ itadmin_dhcp_write_options(fipo, ho->i_do, (ind+1));
+ }
+
+ /* ITADMIN_RANGE_DATA host _name_ */
+ if (0 != job->m_ho) {
+ itadmin_dhcp_marker_name(fipo, 41, 48, ho->sn, (ind+1));
+ }
+
+ /* hardware ethernet */
itadmin_dhcp_indent(fipo, (ind + 1));
fputs(itadmin_dhcp_c8_kw[30], fipo);
fputs(ho->maca, fipo);
fputs(itadmin_dhcp_c8_kw[10], fipo);
fputc('\n', fipo);
-
+
+ /* fixed-address */
if(ho->ipv4) {
itadmin_dhcp_indent(fipo, (ind + 1));
fputs(itadmin_dhcp_c8_kw[31], fipo);
@@ -654,11 +795,11 @@ itadmin_dhcp_write_one_host(
fputc('\n', fipo);
}
- /* Added 2013-09-14: Must write host options too. */
- if((ho->s_do) && (ho->i_do)) {
- itadmin_dhcp_write_options(job, fipo, ho->i_do, 3, (ind+1));
+ /* ITADMIN_RANGE_END host _name_ */
+ if (0 != job->m_ho) {
+ itadmin_dhcp_marker_name(fipo, 42, 48, ho->sn, (ind+1));
}
-
+
itadmin_dhcp_indent(fipo, ind);
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo);
@@ -703,10 +844,18 @@ itadmin_dhcp_write_group(
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
if(gr) {
+ /* ITADMIN_RANGE_BEGIN group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 40, 47, gr->sn, (ind+1));
+ }
if(gr->i_do) {
- itadmin_dhcp_write_options(job, fipo, gr->i_do, 3, (ind+1));
+ itadmin_dhcp_write_options(fipo, gr->i_do, (ind+1));
fputc('\n', fipo);
}
+ /* ITADMIN_RANGE_DATA group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 41, 47, gr->sn, (ind+1));
+ }
}
} is_first = 0;
itadmin_dhcp_write_one_host(job, fipo, ho, (ind + 1));
@@ -742,10 +891,18 @@ itadmin_dhcp_write_group(
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
if(gr) {
+ /* ITADMIN_RANGE_BEGIN group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 40, 47, gr->sn, (ind+1));
+ }
if(gr->i_do) {
- itadmin_dhcp_write_options(job,fipo,gr->i_do,3,(ind + 1));
+ itadmin_dhcp_write_options(fipo,gr->i_do,(ind + 1));
fputc('\n', fipo);
}
+ /* ITADMIN_RANGE_DATA group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 41, 47, gr->sn, (ind+1));
+ }
}
} is_first = 0;
itadmin_dhcp_write_one_host(job, fipo, ho, (ind + 1));
@@ -756,6 +913,12 @@ itadmin_dhcp_write_group(
}
}
if(!(is_first)) {
+ if (NULL != gr) {
+ /* ITADMIN_RANGE_END group _name_ */
+ if (0 != job->m_gr) {
+ itadmin_dhcp_marker_name(fipo, 42, 47, gr->sn, (ind+1));
+ }
+ }
itadmin_dhcp_indent(fipo, ind);
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo);
@@ -792,6 +955,12 @@ itadmin_dhcp_write_one_network(
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
+
+ /* ITADMIN_RANGE_BEGIN subnet _IP_ */
+ if (0 != job->m_sn) {
+ itadmin_dhcp_marker_ip(fipo, 40, 45, nw->ip4, (indent+1));
+ }
+
itadmin_dhcp_indent(fipo, (indent + 1));
fputs(itadmin_dhcp_c8_kw[17], fipo);
itadmin_tool_write_ip(fipo, nw->gw4);
@@ -809,9 +978,14 @@ itadmin_dhcp_write_one_network(
fputc('\n', fipo);
/* DHCP options */
if(nw->i_do) {
- itadmin_dhcp_write_options(job, fipo, nw->i_do, 2, (indent+1));
+ itadmin_dhcp_write_options(fipo, nw->i_do, (indent+1));
fputc('\n', fipo);
}
+ /* ITADMIN_RANGE_DATA subnet _IP_ */
+ if (0 != job->m_sn) {
+ itadmin_dhcp_marker_ip(fipo, 41, 45, nw->ip4, (indent+1));
+ }
+
/* Pools */
if(nw->i_p) {
dk3sto_it_reset(nw->i_p);
@@ -823,11 +997,17 @@ itadmin_dhcp_write_one_network(
if(nw->i_dg) {
dk3sto_it_reset(nw->i_dg);
while(NULL != (ginw = (itadmin_dhcp_ginw *)dk3sto_it_next(nw->i_dg))) {
- itadmin_dhcp_write_group(job,fipo,nw,ginw->i_h,ginw->gr,(indent + 1));
+ itadmin_dhcp_write_group(job, fipo,nw,ginw->i_h,ginw->gr,(indent + 1));
}
}
/* Hosts without groups, direct for network and in DHCP classes */
itadmin_dhcp_write_group(job, fipo, nw, nw->i_hoi, NULL, (indent + 1));
+
+ /* ITADMIN_RANGE_END subnet _IP_ */
+ if (0 != job->m_sn) {
+ itadmin_dhcp_marker_ip(fipo, 42, 45, nw->ip4, (indent+1));
+ }
+
itadmin_dhcp_indent(fipo, indent);
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo); $? "- itadmin_dhcp_write_one_network"
@@ -879,7 +1059,9 @@ itadmin_dhcp_write_vlan(
num_networks = 0;
if(i_nw) {
dk3sto_it_reset(i_nw);
- while(NULL != dk3sto_it_next(i_nw)) { num_networks++; }
+ while(NULL != dk3sto_it_next(i_nw)) {
+ num_networks++;
+ }
if(num_networks > 0) {
dk3sto_it_reset(i_nw);
if((num_networks > 1) || (i_do)) {
@@ -887,10 +1069,28 @@ itadmin_dhcp_write_vlan(
fputc('\n', fipo);
fputs(itadmin_dhcp_c8_kw[13], fipo);
fputc('\n', fipo);
+
+ /* ITADMIN_RANGE_BEGIN shared-network dhcpnet */
+ if (0 != job->m_vl) {
+ itadmin_dhcp_marker_name(fipo,40,43,itadmin_dhcp_c8_kw[44],1);
+ }
+
if(i_do) {
- itadmin_dhcp_write_options(job, fipo, i_do, 1, 1);
+ itadmin_dhcp_write_options(fipo, i_do, 1);
}
+
+ /* ITADMIN_RANGE_DATA shared-network dhcpnet */
+ if (0 != job->m_vl) {
+ itadmin_dhcp_marker_name(fipo,41,43,itadmin_dhcp_c8_kw[44],1);
+ }
+
itadmin_dhcp_write_networks(job, fipo, i_nw);
+
+ /* ITADMIN_RANGE_END shared-network dhcpnet */
+ if (0 != job->m_vl) {
+ itadmin_dhcp_marker_name(fipo,42,43,itadmin_dhcp_c8_kw[44],1);
+ }
+
fputs(itadmin_dhcp_c8_kw[14], fipo);
fputc('\n', fipo);
} else {
@@ -926,7 +1126,6 @@ itadmin_dhcp_declare_msft_options(itadmin_job *job, FILE *fipo)
/** Write output file for a VLAN or all networks.
@param job Job structure.
- @param vlanname Name of VLAN (NULL if not specified).
@param i_nw Iterator for all networks.
@param i_do Iterator for VLAN DHCP options (may be NULL).
@return 1 on success, 0 on error.
@@ -935,7 +1134,6 @@ static
int
itadmin_dhcpd_output(
itadmin_job *job,
- dkChar const *vlanname,
dk3_sto_it_t *i_nw,
dk3_sto_it_t *i_do
)
@@ -948,13 +1146,17 @@ itadmin_dhcpd_output(
itadmin_dhcp_c8_kw[0], itadmin_dhcp_c8_kw[5], job->app
);
if(fipo) { $? ". fopen"
- itadmin_dhcp_write_options(job, fipo, job->i_do, 0, 0);
+ itadmin_dhcp_write_options(fipo, job->i_do, 0);
fputc('\n', fipo);
itadmin_dhcp_declare_msft_options(job, fipo);
- fputs(itadmin_dhcp_c8_kw[32], fipo);
+ if (0 != job->m_p) {
+ fputs(itadmin_dhcp_c8_kw[32], fipo);
+ }
itadmin_dhcp_write_classes(job, fipo);
fputc('\n', fipo);
- fputs(itadmin_dhcp_c8_kw[33], fipo);
+ if (0 != job->m_p) {
+ fputs(itadmin_dhcp_c8_kw[33], fipo);
+ }
itadmin_dhcp_write_vlan(job, fipo, i_nw, i_do);
back = 1;
#if DK3_CHAR_SIZE == 1
@@ -993,7 +1195,7 @@ itadmin_dhcpd_conf_output(itadmin_job *job)
dhcpvl =
(itadmin_vlan *)dk3sto_it_find_like(job->i_vl, (void *)vlname, 1);
if(dhcpvl) {
- back = itadmin_dhcpd_output(job, dhcpvl->s, dhcpvl->i_nw, dhcpvl->i_do);
+ back = itadmin_dhcpd_output(job, dhcpvl->i_nw, dhcpvl->i_do);
} else {
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 139, 140, job->vlan);
}
@@ -1001,7 +1203,7 @@ itadmin_dhcpd_conf_output(itadmin_job *job)
/* ERROR: Failed to convert VLAN name! */
}
} else {
- back = itadmin_dhcpd_output(job, NULL, job->i_nw, NULL);
+ back = itadmin_dhcpd_output(job, job->i_nw, NULL);
} $? "- itadmin_dhcpd_conf_output %d", back
return back;
}
diff --git a/support/dktools/itadmin.c b/support/dktools/itadmin.c
index 8386c305fb..60637e1901 100644
--- a/support/dktools/itadmin.c
+++ b/support/dktools/itadmin.c
@@ -1,43 +1,21 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itadmin.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itadmin.ctr
*/
/** @file itadmin.c The itadmin module.
*/
-#line 1755 "itadmin.ctr"
+#line 1737 "itadmin.ctr"
#include "dk3all.h"
@@ -50,7 +28,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#line 1766 "itadmin.ctr"
+#line 1748 "itadmin.ctr"
@@ -75,7 +53,7 @@ dkT("itadmin.conf"),
NULL
-#line 1794 "itadmin.ctr"
+#line 1776 "itadmin.ctr"
};
@@ -153,13 +131,13 @@ dkT("BYOD DHCP"),
dkT("Bring your own device, use DHCP"),
/* 23 */
-dkT("This is a ``bring your own device'' system, not owned by our organizational"),
+dkT("Not sucject to license management."),
/* 24 */
-dkT("unit."),
+dkT("This device is private property (BYOD), not owned by our organizational unit."),
/* 25 */
-dkT("This host is not owned by our organizational unit, it is a computer outside."),
+dkT("This host is outside our responsibility."),
/* 26 */
dkT("It is listed in configuration files and documentation because there is a"),
@@ -168,7 +146,7 @@ dkT("It is listed in configuration files and documentation because there is a"),
dkT("need for communication between our computers and this system."),
/* 28 */
-dkT("IP address dynamically assigned to computers."),
+dkT("Organizational unit not responsible for correct licensing."),
/* 29 */
dkT("Parent groups"),
@@ -177,7 +155,7 @@ dkT("Parent groups"),
dkT("Subgroups"),
/* 31 */
-dkT("Additional network interface."),
+dkT("UNUSED"),
/* 32 */
dkT("Member hosts"),
@@ -1013,10 +991,46 @@ dkT("\"!"),
/* 309 */
dkT("Failed to reset sensitive memory range!"),
+/* 310 */
+dkT("The device owner is responsible for correct licensing."),
+
+/* 311 */
+dkT("This IP address is assigned dynamically to different computers by DHCP."),
+
+/* 312 */
+dkT("Licenses are listed below real computer names."),
+
+/* 313 */
+dkT("This is an additional network interface for a computer."),
+
+/* 314 */
+dkT("UNUSED"),
+
+/* 315 */
+dkT("This is just a network interface of a non-computer device (i.e. printer,"),
+
+/* 316 */
+dkT("web cam, measurement device, oscilloscope, control unit...) without"),
+
+/* 317 */
+dkT("software requring license accounting."),
+
+/* 318 */
+dkT("Reserved IP address and host name."),
+
+/* 319 */
+dkT("This combination of IP address and host name ist not yet in use,"),
+
+/* 320 */
+dkT("they are reserved for later use."),
+
+/* 321 */
+dkT("Retired, this device is no longer in use."),
+
NULL
-#line 2764 "itadmin.ctr"
+#line 2779 "itadmin.ctr"
};
@@ -1031,7 +1045,7 @@ dkT("This software uses code from the following projects, either directly or"),
dkT("by linking a library:"),
dkT(""),
dkT("dktools\t\tDK tools and libraries"),
-dkT("\t\tSee http://dktools.sourceforge.net for information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/ for information."),
dkT(""),
dkT("MySQL\t\tMySQL client library."),
dkT("\t\tSee http://www.mysql.com for information."),
@@ -1039,7 +1053,7 @@ dkT(""),
NULL
-#line 2785 "itadmin.ctr"
+#line 2800 "itadmin.ctr"
};
@@ -1082,7 +1096,7 @@ dkT(""),
NULL
-#line 2826 "itadmin.ctr"
+#line 2841 "itadmin.ctr"
};
@@ -1562,7 +1576,7 @@ dkT(""),
NULL
-#line 3304 "itadmin.ctr"
+#line 3319 "itadmin.ctr"
};
@@ -1648,12 +1662,12 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/itadmin/"),
dkT(""),
NULL
-#line 3393 "itadmin.ctr"
+#line 3408 "itadmin.ctr"
};
@@ -1809,6 +1823,12 @@ itadmin_job_init(
job->hlh = 0;
job->ukoma = 0;
job->rel = 0;
+ job->m_p = 1;
+ job->m_vl = 1;
+ job->m_sn = 1;
+ job->m_gr = 1;
+ job->m_po = 1;
+ job->m_ho = 0;
if(*(msg[76]) == dkT('.')) { job->gdate = 1; }
}
@@ -1936,7 +1956,7 @@ itadmin_job_up(itadmin_job *job)
);
f_utf8 = 0;
if(DK3_ENCODING_UTF8 == dk3app_get_encoding(job->app)) { f_utf8 = 1; }
- job->uc2l = dk3uc2lat_open_app(NULL, 0, f_utf8, job->app);
+ job->uc2l = dk3uc2lat_open_app(NULL, f_utf8, job->app);
if(!(job->uc2l)) { back = 0; }
return back;
}
@@ -1966,67 +1986,67 @@ itadmin_job_cleanup(itadmin_job *job)
} job->uc2l = NULL;
-#line 3704 "itadmin.ctr"
+#line 3725 "itadmin.ctr"
-#line 3705 "itadmin.ctr"
+#line 3726 "itadmin.ctr"
-#line 3706 "itadmin.ctr"
+#line 3727 "itadmin.ctr"
-#line 3707 "itadmin.ctr"
+#line 3728 "itadmin.ctr"
-#line 3708 "itadmin.ctr"
+#line 3729 "itadmin.ctr"
dk3_release(job->dbhn);
-#line 3710 "itadmin.ctr"
+#line 3731 "itadmin.ctr"
-#line 3711 "itadmin.ctr"
+#line 3732 "itadmin.ctr"
-#line 3712 "itadmin.ctr"
+#line 3733 "itadmin.ctr"
-#line 3713 "itadmin.ctr"
+#line 3734 "itadmin.ctr"
-#line 3714 "itadmin.ctr"
+#line 3735 "itadmin.ctr"
dk3_release(job->dbn);
-#line 3716 "itadmin.ctr"
+#line 3737 "itadmin.ctr"
-#line 3717 "itadmin.ctr"
+#line 3738 "itadmin.ctr"
-#line 3718 "itadmin.ctr"
+#line 3739 "itadmin.ctr"
-#line 3719 "itadmin.ctr"
+#line 3740 "itadmin.ctr"
-#line 3720 "itadmin.ctr"
+#line 3741 "itadmin.ctr"
dk3_release(job->dbcf);
-#line 3722 "itadmin.ctr"
+#line 3743 "itadmin.ctr"
-#line 3723 "itadmin.ctr"
+#line 3744 "itadmin.ctr"
-#line 3724 "itadmin.ctr"
+#line 3745 "itadmin.ctr"
-#line 3725 "itadmin.ctr"
+#line 3746 "itadmin.ctr"
-#line 3726 "itadmin.ctr"
+#line 3747 "itadmin.ctr"
if(job->dbus) {
#if 0
/* 2016-12-09
@@ -2039,21 +2059,21 @@ itadmin_job_cleanup(itadmin_job *job)
dk3_release(job->dbus);
-#line 3737 "itadmin.ctr"
+#line 3758 "itadmin.ctr"
#if 0
-#line 3739 "itadmin.ctr"
+#line 3760 "itadmin.ctr"
-#line 3740 "itadmin.ctr"
+#line 3761 "itadmin.ctr"
-#line 3741 "itadmin.ctr"
+#line 3762 "itadmin.ctr"
#endif
-#line 3743 "itadmin.ctr"
+#line 3764 "itadmin.ctr"
if(job->dbpw) {
#if 0
/* 2016-12-09
@@ -2074,83 +2094,83 @@ itadmin_job_cleanup(itadmin_job *job)
dk3_release(job->dbpw);
-#line 3762 "itadmin.ctr"
+#line 3783 "itadmin.ctr"
-#line 3763 "itadmin.ctr"
+#line 3784 "itadmin.ctr"
-#line 3764 "itadmin.ctr"
+#line 3785 "itadmin.ctr"
-#line 3765 "itadmin.ctr"
+#line 3786 "itadmin.ctr"
-#line 3766 "itadmin.ctr"
+#line 3787 "itadmin.ctr"
dk3_release(job->vlan);
-#line 3768 "itadmin.ctr"
+#line 3789 "itadmin.ctr"
-#line 3769 "itadmin.ctr"
+#line 3790 "itadmin.ctr"
-#line 3770 "itadmin.ctr"
+#line 3791 "itadmin.ctr"
-#line 3771 "itadmin.ctr"
+#line 3792 "itadmin.ctr"
-#line 3772 "itadmin.ctr"
+#line 3793 "itadmin.ctr"
dk3_release(job->org);
-#line 3774 "itadmin.ctr"
+#line 3795 "itadmin.ctr"
-#line 3775 "itadmin.ctr"
+#line 3796 "itadmin.ctr"
-#line 3776 "itadmin.ctr"
+#line 3797 "itadmin.ctr"
-#line 3777 "itadmin.ctr"
+#line 3798 "itadmin.ctr"
-#line 3778 "itadmin.ctr"
+#line 3799 "itadmin.ctr"
dk3_release(job->ou);
-#line 3780 "itadmin.ctr"
+#line 3801 "itadmin.ctr"
-#line 3781 "itadmin.ctr"
+#line 3802 "itadmin.ctr"
-#line 3782 "itadmin.ctr"
+#line 3803 "itadmin.ctr"
-#line 3783 "itadmin.ctr"
+#line 3804 "itadmin.ctr"
-#line 3784 "itadmin.ctr"
+#line 3805 "itadmin.ctr"
dk3_release(job->admn);
-#line 3786 "itadmin.ctr"
+#line 3807 "itadmin.ctr"
-#line 3787 "itadmin.ctr"
+#line 3808 "itadmin.ctr"
-#line 3788 "itadmin.ctr"
+#line 3809 "itadmin.ctr"
-#line 3789 "itadmin.ctr"
+#line 3810 "itadmin.ctr"
-#line 3790 "itadmin.ctr"
+#line 3811 "itadmin.ctr"
dk3_release(job->ldapb);
itadmin_clean_storage(&(job->s_us), &(job->i_us), itadmin_mem_user_del);
itadmin_clean_storage(&(job->s_bu), &(job->i_bu), itadmin_mem_building_del);
@@ -2211,7 +2231,7 @@ itadmin_process_arguments(itadmin_job *job)
int back = 0;
-#line 3849 "itadmin.ctr"
+#line 3870 "itadmin.ctr"
xargc = dk3app_get_argc(job->app);
xargv = dk3app_get_argv(job->app);
xargv++; xargc--;
@@ -2241,31 +2261,30 @@ itadmin_process_arguments(itadmin_job *job)
}
} else {
-#line 3877 "itadmin.ctr"
+#line 3898 "itadmin.ctr"
}
} else {
-#line 3879 "itadmin.ctr"
+#line 3900 "itadmin.ctr"
}
-#line 3881 "itadmin.ctr"
+#line 3902 "itadmin.ctr"
return back;
}
/** Show version number.
- @param job Job structure.
*/
static
void
-itadmin_show_version(itadmin_job *job)
+itadmin_show_version(void)
{
dk3sf_fputs(itadmin_kw_noloc[2], stdout);
dk3sf_fputs(DKT_VERSION_DK, stdout);
dk3sf_fputc(dkT('\n'), stdout);
-#if !(DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H)
+#if !(DK3_HAVE_MARIADB_MYSQL_H || DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 167);
#endif
}
@@ -2285,12 +2304,11 @@ itadmin_show_help(itadmin_job *job)
/** Show one text section, used to show license terms.
- @param job Job structure.
@param ltxt License text to show.
*/
static
void
-itadmin_show_license_section(itadmin_job *job, dkChar const * const *ltxt)
+itadmin_show_license_section(dkChar const * const *ltxt)
{
dkChar const * const *sptr;
sptr = ltxt;
@@ -2307,11 +2325,11 @@ itadmin_show_license_section(itadmin_job *job, dkChar const * const *ltxt)
*/
static
void
-itadmin_show_license(itadmin_job *job)
+itadmin_show_license(void)
{
- itadmin_show_license_section(job, itadmin_license_overview);
- itadmin_show_license_section(job, itadmin_license_dktools);
- itadmin_show_license_section(job, itadmin_license_mysql);
+ itadmin_show_license_section(itadmin_license_overview);
+ itadmin_show_license_section(itadmin_license_dktools);
+ itadmin_show_license_section(itadmin_license_mysql);
}
@@ -2338,7 +2356,7 @@ itadmin_run(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 78);
if(!itadmin_hosts_output(job)) {
-#line 3968 "itadmin.ctr"
+#line 3987 "itadmin.ctr"
success = 0;
}
if(job->ldapb) {
@@ -2346,7 +2364,7 @@ itadmin_run(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 79);
if(!itadmin_hosts_ldif_output(job)) {
-#line 3974 "itadmin.ctr"
+#line 3993 "itadmin.ctr"
success = 0;
}
}
@@ -2357,7 +2375,7 @@ itadmin_run(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 80);
if(!itadmin_ethers_output(job)) {
-#line 3983 "itadmin.ctr"
+#line 4002 "itadmin.ctr"
success = 0;
}
if(job->ldapb) {
@@ -2365,7 +2383,7 @@ itadmin_run(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 81);
if(!itadmin_ethers_ldif_output(job)) {
-#line 3989 "itadmin.ctr"
+#line 4008 "itadmin.ctr"
success = 0;
}
}
@@ -2376,7 +2394,7 @@ itadmin_run(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 82);
if(!itadmin_netgroup_ldif_output(job)) {
-#line 3998 "itadmin.ctr"
+#line 4017 "itadmin.ctr"
success = 0;
}
/*
@@ -2387,7 +2405,7 @@ itadmin_run(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 83);
if(!itadmin_dhcpd_conf_output(job)) {
-#line 4007 "itadmin.ctr"
+#line 4026 "itadmin.ctr"
success = 0;
}
}
@@ -2398,7 +2416,7 @@ itadmin_run(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 84);
if(!itadmin_netdocu(job)) {
-#line 4016 "itadmin.ctr"
+#line 4035 "itadmin.ctr"
success = 0;
}
}
@@ -2410,7 +2428,7 @@ itadmin_run(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 85);
if(!itadmin_license_report(job)) {
-#line 4026 "itadmin.ctr"
+#line 4045 "itadmin.ctr"
success = 0;
}
}
@@ -2423,7 +2441,7 @@ itadmin_run(itadmin_job *job)
job->exval = 0;
} else {
-#line 4037 "itadmin.ctr"
+#line 4056 "itadmin.ctr"
}
}
@@ -2438,37 +2456,37 @@ itadmin_run_or_help(itadmin_job *job)
{
-#line 4050 "itadmin.ctr"
+#line 4069 "itadmin.ctr"
if((job->cmd) & (~(ITADMIN_CMD_CONFIG | ITADMIN_CMD_LICENSES))) {
-#line 4051 "itadmin.ctr"
+#line 4070 "itadmin.ctr"
job->exval = 0;
dk3sf_initialize_stdout();
if((job->cmd) & ITADMIN_CMD_VERSION) {
-#line 4054 "itadmin.ctr"
- itadmin_show_version(job);
+#line 4073 "itadmin.ctr"
+ itadmin_show_version();
}
if((job->cmd) & ITADMIN_CMD_LICENSE_TERMS) {
-#line 4057 "itadmin.ctr"
- itadmin_show_license(job);
+#line 4076 "itadmin.ctr"
+ itadmin_show_license();
}
if((job->cmd) & ITADMIN_CMD_HELP) {
-#line 4060 "itadmin.ctr"
+#line 4079 "itadmin.ctr"
itadmin_show_help(job);
}
} else {
-#line 4063 "itadmin.ctr"
+#line 4082 "itadmin.ctr"
if(!((job->cmd) & (ITADMIN_CMD_CONFIG | ITADMIN_CMD_LICENSES))) {
job->cmd = (ITADMIN_CMD_CONFIG | ITADMIN_CMD_LICENSES);
}
itadmin_run(job);
}
-#line 4068 "itadmin.ctr"
+#line 4087 "itadmin.ctr"
}
@@ -2486,10 +2504,10 @@ DK3_MAIN
int exval = 1; /* Exit status code. */
-#line 4084 "itadmin.ctr"
+#line 4103 "itadmin.ctr"
-#line 4085 "itadmin.ctr"
+#line 4104 "itadmin.ctr"
#if DK3_HAVE_TZSET
tzset();
#endif
@@ -2525,10 +2543,10 @@ DK3_MAIN
exval = job.exval;
-#line 4119 "itadmin.ctr"
+#line 4138 "itadmin.ctr"
-#line 4120 "itadmin.ctr"
+#line 4139 "itadmin.ctr"
fflush(stdout);
exit(exval); return exval;
}
diff --git a/support/dktools/itadmin.ctr b/support/dktools/itadmin.ctr
index f60d2c5835..fefe9c9107 100644
--- a/support/dktools/itadmin.ctr
+++ b/support/dktools/itadmin.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -343,6 +343,12 @@ typedef struct {
int hlh; /**< Flag: Have localhost entry. */
int ukoma; /**< Flag: Use koma-script. */
int rel; /**< Release lease on shutdown. */
+ int m_p; /**< Flag: Markers for points. */
+ int m_vl; /**< Flag: Markers for vlan. */
+ int m_sn; /**< Flag: Markers for subnets. */
+ int m_gr; /**< Flag: Markers for groups. */
+ int m_po; /**< Flag: Markers for pools. */
+ int m_ho; /**< Flag: Markers for hosts. */
} itadmin_job;
@@ -781,9 +787,7 @@ itadmin_mem_lictype_new(
@param pk Primary key from licenses table (unused).
@param order Order ID or tracking information (may be NULL).
@param notes Additional notes (may be NULL).
- @param d_del Delivery date (may be NULL).
@param i_del Delivery note ID (may be NULL).
- @param d_inv Invoice date (may be NULL).
@param i_inv Invoice ID (may be NULL).
@param prod Software product.
@param ltype License type.
@@ -797,9 +801,7 @@ itadmin_mem_license_new(
unsigned long pk,
char const *order,
char const *notes,
- itadmin_date *d_del,
char const *i_del,
- itadmin_date *d_inv,
char const *i_inv,
itadmin_swprod *prod,
itadmin_lictype *ltype,
@@ -1175,10 +1177,7 @@ itadmin_register_lictype(
@param co_s Computer on which the license is used.
@param lt_s License type.
@param li_no Optional note for the license.
- @param sr_s Software reseller.
- @param li_dd Delivery date.
@param li_nd Delivery note number.
- @param li_di Invoide date.
@param li_ni Invoice number.
@return 1 on success, 0 on error.
*/
@@ -1192,10 +1191,7 @@ itadmin_register_license(
char const *co_s,
char const *lt_s,
char const *li_no,
- char const *sr_s,
- itadmin_date *li_dd,
char const *li_nd,
- itadmin_date *li_di,
char const *li_ni
);
@@ -1334,16 +1330,6 @@ itadmin_comp_swprod(void const *l, void const *r, int cr);
@param l Left structure.
@param r Right structure, object, or name.
@param cr Comparison criteria
- (0=type/type by sn, 1=type/name).
- @return Comparison result.
-*/
-int
-itadmin_comp_user(void const *l, void const *r, int cr);
-
-/** Compare structures for license type.
- @param l Left structure.
- @param r Right structure, object, or name.
- @param cr Comparison criteria
(0=license/license by product).
@return Comparison result.
*/
@@ -1491,12 +1477,10 @@ itadmin_tool_table_line_start(
);
/** Separate two items in a table.
- @param job Job structure.
@param os Output stream.
*/
void
itadmin_tool_table_line_sep_rows(
- itadmin_job *job,
dk3_stream_t *os
);
@@ -1507,7 +1491,6 @@ itadmin_tool_table_line_sep_rows(
*/
void
itadmin_tool_table_line_finish(
- itadmin_job *job,
dk3_stream_t *os,
int pb
);
@@ -1575,7 +1558,6 @@ itadmin_tool_check_same_user(itadmin_user *us, itadmin_host *co);
*/
void
itadmin_tool_write_section(
- itadmin_job *job,
dk3_stream_t *os,
char const * const *sect
);
@@ -1894,15 +1876,15 @@ Bring your own device, use DHCP
#
# 23:
#
-This is a ``bring your own device'' system, not owned by our organizational
+Not sucject to license management.
#
# 24:
#
-unit.
+This device is private property (BYOD), not owned by our organizational unit.
#
# 25:
#
-This host is not owned by our organizational unit, it is a computer outside.
+This host is outside our responsibility.
#
# 26:
#
@@ -1914,7 +1896,7 @@ need for communication between our computers and this system.
#
# 28:
#
-IP address dynamically assigned to computers.
+Organizational unit not responsible for correct licensing.
#
# 29: Parent groups
#
@@ -1926,7 +1908,7 @@ Subgroups
#
# 31: Additional network interface
#
-Additional network interface.
+UNUSED
#
# 32: Member hosts for netgroups
#
@@ -2760,6 +2742,39 @@ Illegal license type (short name): "
# 309: ERROR: Failed to reset sensitive memory range!
#
Failed to reset sensitive memory range!
+#
+# 310: Info The device owner is responsible.
+#
+The device owner is responsible for correct licensing.
+#
+# 311/312
+#
+This IP address is assigned dynamically to different computers by DHCP.
+Licenses are listed below real computer names.
+#
+# 313
+#
+This is an additional network interface for a computer.
+#
+# 314-317
+#
+UNUSED
+This is just a network interface of a non-computer device (i.e. printer,
+web cam, measurement device, oscilloscope, control unit...) without
+software requring license accounting.
+#
+# 318-320
+#
+Reserved IP address and host name.
+This combination of IP address and host name ist not yet in use,
+they are reserved for later use.
+#
+# 321 Device no longer in use.
+#
+Retired, this device is no longer in use.
+#
+#
+#
$!end
};
@@ -2776,7 +2791,7 @@ This software uses code from the following projects, either directly or
by linking a library:
dktools DK tools and libraries
- See http://dktools.sourceforge.net for information.
+ See http://sourceforge.net/p/dktools/wiki/Home/ for information.
MySQL MySQL client library.
See http://www.mysql.com for information.
@@ -3387,7 +3402,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/itadmin/
$!end
};
@@ -3545,6 +3560,12 @@ itadmin_job_init(
job->hlh = 0;
job->ukoma = 0;
job->rel = 0;
+ job->m_p = 1;
+ job->m_vl = 1;
+ job->m_sn = 1;
+ job->m_gr = 1;
+ job->m_po = 1;
+ job->m_ho = 0;
if(*(msg[76]) == dkT('.')) { job->gdate = 1; }
}
@@ -3672,7 +3693,7 @@ itadmin_job_up(itadmin_job *job)
);
f_utf8 = 0;
if(DK3_ENCODING_UTF8 == dk3app_get_encoding(job->app)) { f_utf8 = 1; }
- job->uc2l = dk3uc2lat_open_app(NULL, 0, f_utf8, job->app);
+ job->uc2l = dk3uc2lat_open_app(NULL, f_utf8, job->app);
if(!(job->uc2l)) { back = 0; }
return back;
}
@@ -3884,16 +3905,15 @@ itadmin_process_arguments(itadmin_job *job)
/** Show version number.
- @param job Job structure.
*/
static
void
-itadmin_show_version(itadmin_job *job)
+itadmin_show_version(void)
{
dk3sf_fputs(itadmin_kw_noloc[2], stdout);
dk3sf_fputs(DKT_VERSION_DK, stdout);
dk3sf_fputc(dkT('\n'), stdout);
-#if !(DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H)
+#if !(DK3_HAVE_MARIADB_MYSQL_H || DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H)
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 167);
#endif
}
@@ -3913,12 +3933,11 @@ itadmin_show_help(itadmin_job *job)
/** Show one text section, used to show license terms.
- @param job Job structure.
@param ltxt License text to show.
*/
static
void
-itadmin_show_license_section(itadmin_job *job, dkChar const * const *ltxt)
+itadmin_show_license_section(dkChar const * const *ltxt)
{
dkChar const * const *sptr;
sptr = ltxt;
@@ -3935,11 +3954,11 @@ itadmin_show_license_section(itadmin_job *job, dkChar const * const *ltxt)
*/
static
void
-itadmin_show_license(itadmin_job *job)
+itadmin_show_license(void)
{
- itadmin_show_license_section(job, itadmin_license_overview);
- itadmin_show_license_section(job, itadmin_license_dktools);
- itadmin_show_license_section(job, itadmin_license_mysql);
+ itadmin_show_license_section(itadmin_license_overview);
+ itadmin_show_license_section(itadmin_license_dktools);
+ itadmin_show_license_section(itadmin_license_mysql);
}
@@ -4051,10 +4070,10 @@ itadmin_run_or_help(itadmin_job *job)
job->exval = 0;
dk3sf_initialize_stdout();
if((job->cmd) & ITADMIN_CMD_VERSION) { $? ". version"
- itadmin_show_version(job);
+ itadmin_show_version();
}
if((job->cmd) & ITADMIN_CMD_LICENSE_TERMS) { $? ". license"
- itadmin_show_license(job);
+ itadmin_show_license();
}
if((job->cmd) & ITADMIN_CMD_HELP) { $? ". help"
itadmin_show_help(job);
diff --git a/support/dktools/itadmin.h b/support/dktools/itadmin.h
index 6fb38ad42d..b7881fd088 100644
--- a/support/dktools/itadmin.h
+++ b/support/dktools/itadmin.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itadmin.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itadmin.ctr
*/
/** @file itadmin.h Header file for the itadmin module.
@@ -378,6 +356,12 @@ typedef struct {
int hlh; /**< Flag: Have localhost entry. */
int ukoma; /**< Flag: Use koma-script. */
int rel; /**< Release lease on shutdown. */
+ int m_p; /**< Flag: Markers for points. */
+ int m_vl; /**< Flag: Markers for vlan. */
+ int m_sn; /**< Flag: Markers for subnets. */
+ int m_gr; /**< Flag: Markers for groups. */
+ int m_po; /**< Flag: Markers for pools. */
+ int m_ho; /**< Flag: Markers for hosts. */
} itadmin_job;
@@ -816,9 +800,7 @@ itadmin_mem_lictype_new(
@param pk Primary key from licenses table (unused).
@param order Order ID or tracking information (may be NULL).
@param notes Additional notes (may be NULL).
- @param d_del Delivery date (may be NULL).
@param i_del Delivery note ID (may be NULL).
- @param d_inv Invoice date (may be NULL).
@param i_inv Invoice ID (may be NULL).
@param prod Software product.
@param ltype License type.
@@ -832,9 +814,7 @@ itadmin_mem_license_new(
unsigned long pk,
char const *order,
char const *notes,
- itadmin_date *d_del,
char const *i_del,
- itadmin_date *d_inv,
char const *i_inv,
itadmin_swprod *prod,
itadmin_lictype *ltype,
@@ -1210,10 +1190,7 @@ itadmin_register_lictype(
@param co_s Computer on which the license is used.
@param lt_s License type.
@param li_no Optional note for the license.
- @param sr_s Software reseller.
- @param li_dd Delivery date.
@param li_nd Delivery note number.
- @param li_di Invoide date.
@param li_ni Invoice number.
@return 1 on success, 0 on error.
*/
@@ -1227,10 +1204,7 @@ itadmin_register_license(
char const *co_s,
char const *lt_s,
char const *li_no,
- char const *sr_s,
- itadmin_date *li_dd,
char const *li_nd,
- itadmin_date *li_di,
char const *li_ni
);
@@ -1369,16 +1343,6 @@ itadmin_comp_swprod(void const *l, void const *r, int cr);
@param l Left structure.
@param r Right structure, object, or name.
@param cr Comparison criteria
- (0=type/type by sn, 1=type/name).
- @return Comparison result.
-*/
-int
-itadmin_comp_user(void const *l, void const *r, int cr);
-
-/** Compare structures for license type.
- @param l Left structure.
- @param r Right structure, object, or name.
- @param cr Comparison criteria
(0=license/license by product).
@return Comparison result.
*/
@@ -1526,12 +1490,10 @@ itadmin_tool_table_line_start(
);
/** Separate two items in a table.
- @param job Job structure.
@param os Output stream.
*/
void
itadmin_tool_table_line_sep_rows(
- itadmin_job *job,
dk3_stream_t *os
);
@@ -1542,7 +1504,6 @@ itadmin_tool_table_line_sep_rows(
*/
void
itadmin_tool_table_line_finish(
- itadmin_job *job,
dk3_stream_t *os,
int pb
);
@@ -1610,7 +1571,6 @@ itadmin_tool_check_same_user(itadmin_user *us, itadmin_host *co);
*/
void
itadmin_tool_write_section(
- itadmin_job *job,
dk3_stream_t *os,
char const * const *sect
);
diff --git a/support/dktools/itadmin.rc b/support/dktools/itadmin.rc
index 5071926b1f..00a2eef0e2 100644
--- a/support/dktools/itadmin.rc
+++ b/support/dktools/itadmin.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "IT management using a MySQL DB\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "IT management using a MySQL DB\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "itadmin\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/itaether.c b/support/dktools/itaether.c
index 3671cca3e2..5725b186d5 100644
--- a/support/dktools/itaether.c
+++ b/support/dktools/itaether.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itaether.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itaether.ctr
*/
/** @file itaether.c The itaether module.
diff --git a/support/dktools/itaether.ctr b/support/dktools/itaether.ctr
index 786b383fe5..a81bdf7fa6 100644
--- a/support/dktools/itaether.ctr
+++ b/support/dktools/itaether.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/itahosts.c b/support/dktools/itahosts.c
index 92d0ad4f65..67d96f8b85 100644
--- a/support/dktools/itahosts.c
+++ b/support/dktools/itahosts.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itahosts.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itahosts.ctr
*/
/** @file itahosts.c The itahosts module.
diff --git a/support/dktools/itahosts.ctr b/support/dktools/itahosts.ctr
index f25a2e53de..07596afa46 100644
--- a/support/dktools/itahosts.ctr
+++ b/support/dktools/itahosts.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/italic.c b/support/dktools/italic.c
index 5db6997f4a..27a460df2a 100644
--- a/support/dktools/italic.c
+++ b/support/dktools/italic.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: italic.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: italic.ctr
*/
/** @file italic.c The italic module.
@@ -96,7 +74,7 @@ static char const * const itadmin_license_c8_kw[] = {
"pdfauthor={",
/* 14 */
-"pdfcreator={itadmin - http://dktools.sourceforge.net/}",
+"pdfcreator={itadmin - http://sourceforge.net/p/dktools/wiki/itadmin/}",
/* 15 */
"\\author{",
@@ -669,13 +647,11 @@ itadmin_license_change_level(
/** Start a longtable for the licenses.
- @param job Job structure.
@param os Output stream.
*/
static
void
itadmin_license_start_longtable_for_licenses(
- itadmin_job *job,
dk3_stream_t *os
)
{
@@ -694,13 +670,11 @@ itadmin_license_start_longtable_for_licenses(
/** End a longtable for the licenses.
- @param job Job structure.
@param os Output stream.
*/
static
void
itadmin_license_end_longtable_for_licenses(
- itadmin_job *job,
dk3_stream_t *os
)
{
@@ -728,7 +702,7 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
int ie; /* Input encoding. */
-#line 709 "italic.ctr"
+#line 705 "italic.ctr"
ie = dk3app_get_encoding(job->app);
have_chap = have_tab = 0;
prev_man = NULL; prev_prod = NULL;
@@ -746,14 +720,14 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
} have_chap = 1;
pman = itadmin_license_get_manufacturer(li);
-#line 725 "italic.ctr"
+#line 721 "italic.ctr"
pprod = itadmin_license_get_product(li);
-#line 726 "italic.ctr"
+#line 722 "italic.ctr"
switch(itadmin_license_change_level(pman, prev_man, pprod, prev_prod)) {
case 2: { /* Manufacturer changed. */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
}
@@ -769,7 +743,7 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
} break;
case 1: { /* Product changed. */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
}
@@ -787,7 +761,7 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
} break;
}
if(!(have_tab)) {
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
have_tab = 1;
}
itadmin_license_write_license(job, os, li, pman, pprod, 0, 0, 0, 0, 0);
@@ -796,14 +770,14 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
if(have_chap) {
if(have_tab) {
/* end{longtable} */
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
/* clearpage */
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
}
-#line 778 "italic.ctr"
+#line 774 "italic.ctr"
}
@@ -832,7 +806,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
int ie;
-#line 805 "italic.ctr"
+#line 801 "italic.ctr"
ie = dk3app_get_encoding(job->app);
dk3sto_it_reset(job->i_us);
while(NULL != (us = (itadmin_user *)dk3sto_it_next(job->i_us))) {
@@ -868,7 +842,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
{
case 2: { /* Manufacturer changed. */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -897,14 +871,14 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
}
if(!(have_tab)) {
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
have_tab = 1;
}
itadmin_license_write_license(job, os, li, pman, pprod, 0, 1, 0, 0, 2);
prev_man = pman; prev_prod = pprod;
}
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
if(have_sec) {
/* clearpage */
@@ -929,7 +903,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
{
case 2: { /* Manufacturer changed */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -964,7 +938,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
case 1: { /* Product changed */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -1001,7 +975,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
}
if(!(have_tab)) {
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
have_tab = 1;
}
itadmin_license_write_license(job, os, li, pman, pprod, 0, 0, 0, 0, 0);
@@ -1009,7 +983,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
}
}
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
if(have_sec) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
@@ -1029,7 +1003,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
{
case 2: { /* Manufacturer changed */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -1078,7 +1052,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
case 1: { /* Product changed */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -1129,7 +1103,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
}
if(!(have_tab)) {
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
have_tab = 1;
}
itadmin_license_write_license(job, os, li, pman, pprod, 0, 0, 0, 1, 1);
@@ -1137,7 +1111,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
}
}
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
if(have_sec) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
@@ -1146,7 +1120,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
}
}
-#line 1117 "italic.ctr"
+#line 1113 "italic.ctr"
}
@@ -1172,7 +1146,7 @@ itadmin_license_write_complete_list(itadmin_job *job, dk3_stream_t *os)
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[59], ie);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[5]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
} else {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[23]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
@@ -1183,7 +1157,7 @@ itadmin_license_write_complete_list(itadmin_job *job, dk3_stream_t *os)
itadmin_license_write_license(job, os, li, pman, pprod, 1, 1, 1, 1, 1);
}
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
}
@@ -1200,14 +1174,14 @@ itadmin_license_write_file(itadmin_job *job, dk3_stream_t *os)
int ie;
ie = dk3app_get_encoding(job->app);
if(job->ukoma) {
- itadmin_tool_write_section(job, os, itadmin_license_file_start1a);
+ itadmin_tool_write_section(os, itadmin_license_file_start1a);
} else {
- itadmin_tool_write_section(job, os, itadmin_license_file_start1b);
+ itadmin_tool_write_section(os, itadmin_license_file_start1b);
}
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
dk3stream_strputs(os, (job->msg)[2], ie);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
- itadmin_tool_write_section(job, os, itadmin_license_file_start4);
+ itadmin_tool_write_section(os, itadmin_license_file_start4);
/* pdftitle */
dk3stream_c8_fputs(os, itadmin_license_c8_kw[11]);
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[51], ie);
@@ -1231,7 +1205,7 @@ itadmin_license_write_file(itadmin_job *job, dk3_stream_t *os)
/* pdfcreator */
dk3stream_c8_fputs(os, itadmin_license_c8_kw[14]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
- itadmin_tool_write_section(job, os, itadmin_license_file_start2);
+ itadmin_tool_write_section(os, itadmin_license_file_start2);
/* author */
if(job->admn) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[15]);
@@ -1245,14 +1219,14 @@ itadmin_license_write_file(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_license_c8_kw[5]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
if(job->ukoma) {
- itadmin_tool_write_section(job, os, itadmin_license_file_start3a);
+ itadmin_tool_write_section(os, itadmin_license_file_start3a);
}
- itadmin_tool_write_section(job, os, itadmin_license_file_start3);
+ itadmin_tool_write_section(os, itadmin_license_file_start3);
itadmin_license_write_available(job, os);
itadmin_license_write_user(job, os);
itadmin_license_write_complete_list(job, os);
dk3uc2lat_final_report(job->uc2l, os);
- itadmin_tool_write_section(job, os, itadmin_license_file_end);
+ itadmin_tool_write_section(os, itadmin_license_file_end);
}
@@ -1265,7 +1239,7 @@ itadmin_license_report(itadmin_job *job)
int back = 0;
-#line 1234 "italic.ctr"
+#line 1230 "italic.ctr"
fipo = dk3sf_c8_fopen_app(
itadmin_license_c8_kw[2],
itadmin_license_c8_kw[3],
@@ -1290,7 +1264,7 @@ itadmin_license_report(itadmin_job *job)
}
-#line 1257 "italic.ctr"
+#line 1253 "italic.ctr"
return back;
}
diff --git a/support/dktools/italic.ctr b/support/dktools/italic.ctr
index 97041e63bf..3f2be3fed0 100644
--- a/support/dktools/italic.ctr
+++ b/support/dktools/italic.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -79,7 +79,7 @@ pdfauthor={
#
# 14:
#
-pdfcreator={itadmin - http://dktools.sourceforge.net/}
+pdfcreator={itadmin - http://sourceforge.net/p/dktools/wiki/itadmin/}
#
# 15:
#
@@ -648,13 +648,11 @@ itadmin_license_change_level(
/** Start a longtable for the licenses.
- @param job Job structure.
@param os Output stream.
*/
static
void
itadmin_license_start_longtable_for_licenses(
- itadmin_job *job,
dk3_stream_t *os
)
{
@@ -673,13 +671,11 @@ itadmin_license_start_longtable_for_licenses(
/** End a longtable for the licenses.
- @param job Job structure.
@param os Output stream.
*/
static
void
itadmin_license_end_longtable_for_licenses(
- itadmin_job *job,
dk3_stream_t *os
)
{
@@ -726,7 +722,7 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
switch(itadmin_license_change_level(pman, prev_man, pprod, prev_prod)) {
case 2: { /* Manufacturer changed. */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
}
@@ -742,7 +738,7 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
} break;
case 1: { /* Product changed. */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
}
@@ -760,7 +756,7 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
} break;
}
if(!(have_tab)) {
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
have_tab = 1;
}
itadmin_license_write_license(job, os, li, pman, pprod, 0, 0, 0, 0, 0);
@@ -769,7 +765,7 @@ itadmin_license_write_available(itadmin_job *job, dk3_stream_t *os)
if(have_chap) {
if(have_tab) {
/* end{longtable} */
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
/* clearpage */
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
@@ -837,7 +833,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
{
case 2: { /* Manufacturer changed. */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -866,14 +862,14 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
}
if(!(have_tab)) {
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
have_tab = 1;
}
itadmin_license_write_license(job, os, li, pman, pprod, 0, 1, 0, 0, 2);
prev_man = pman; prev_prod = pprod;
}
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
if(have_sec) {
/* clearpage */
@@ -898,7 +894,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
{
case 2: { /* Manufacturer changed */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -933,7 +929,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
case 1: { /* Product changed */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -970,7 +966,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
}
if(!(have_tab)) {
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
have_tab = 1;
}
itadmin_license_write_license(job, os, li, pman, pprod, 0, 0, 0, 0, 0);
@@ -978,7 +974,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
}
}
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
if(have_sec) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
@@ -998,7 +994,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
{
case 2: { /* Manufacturer changed */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -1047,7 +1043,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
case 1: { /* Product changed */
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
} have_tab = 0;
if(!(have_chap)) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[28]);
@@ -1098,7 +1094,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
} break;
}
if(!(have_tab)) {
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
have_tab = 1;
}
itadmin_license_write_license(job, os, li, pman, pprod, 0, 0, 0, 1, 1);
@@ -1106,7 +1102,7 @@ itadmin_license_write_user(itadmin_job *job, dk3_stream_t *os)
}
}
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
if(have_sec) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[6]);
@@ -1139,7 +1135,7 @@ itadmin_license_write_complete_list(itadmin_job *job, dk3_stream_t *os)
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[59], ie);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[5]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
- itadmin_license_start_longtable_for_licenses(job, os);
+ itadmin_license_start_longtable_for_licenses(os);
} else {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[23]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
@@ -1150,7 +1146,7 @@ itadmin_license_write_complete_list(itadmin_job *job, dk3_stream_t *os)
itadmin_license_write_license(job, os, li, pman, pprod, 1, 1, 1, 1, 1);
}
if(have_tab) {
- itadmin_license_end_longtable_for_licenses(job, os);
+ itadmin_license_end_longtable_for_licenses(os);
}
}
@@ -1167,14 +1163,14 @@ itadmin_license_write_file(itadmin_job *job, dk3_stream_t *os)
int ie;
ie = dk3app_get_encoding(job->app);
if(job->ukoma) {
- itadmin_tool_write_section(job, os, itadmin_license_file_start1a);
+ itadmin_tool_write_section(os, itadmin_license_file_start1a);
} else {
- itadmin_tool_write_section(job, os, itadmin_license_file_start1b);
+ itadmin_tool_write_section(os, itadmin_license_file_start1b);
}
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
dk3stream_strputs(os, (job->msg)[2], ie);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
- itadmin_tool_write_section(job, os, itadmin_license_file_start4);
+ itadmin_tool_write_section(os, itadmin_license_file_start4);
/* pdftitle */
dk3stream_c8_fputs(os, itadmin_license_c8_kw[11]);
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[51], ie);
@@ -1198,7 +1194,7 @@ itadmin_license_write_file(itadmin_job *job, dk3_stream_t *os)
/* pdfcreator */
dk3stream_c8_fputs(os, itadmin_license_c8_kw[14]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
- itadmin_tool_write_section(job, os, itadmin_license_file_start2);
+ itadmin_tool_write_section(os, itadmin_license_file_start2);
/* author */
if(job->admn) {
dk3stream_c8_fputs(os, itadmin_license_c8_kw[15]);
@@ -1212,14 +1208,14 @@ itadmin_license_write_file(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_license_c8_kw[5]);
dk3stream_c8_fputs(os, itadmin_license_c8_kw[0]);
if(job->ukoma) {
- itadmin_tool_write_section(job, os, itadmin_license_file_start3a);
+ itadmin_tool_write_section(os, itadmin_license_file_start3a);
}
- itadmin_tool_write_section(job, os, itadmin_license_file_start3);
+ itadmin_tool_write_section(os, itadmin_license_file_start3);
itadmin_license_write_available(job, os);
itadmin_license_write_user(job, os);
itadmin_license_write_complete_list(job, os);
dk3uc2lat_final_report(job->uc2l, os);
- itadmin_tool_write_section(job, os, itadmin_license_file_end);
+ itadmin_tool_write_section(os, itadmin_license_file_end);
}
diff --git a/support/dktools/itamem.c b/support/dktools/itamem.c
index 13afbfeff8..3ac747aaf5 100644
--- a/support/dktools/itamem.c
+++ b/support/dktools/itamem.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itamem.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itamem.ctr
*/
/** @file itamem.c The itamem module.
@@ -1490,12 +1468,14 @@ itadmin_mem_host_new(
+#if 0
/** Create new software manufacturer.
@param job Job structure.
@param sn Short name.
@param ln Long name (description).
@return Pointer to new object on success, NULL on error.
*/
+static
itadmin_swman *
itadmin_mem_swman_new(
itadmin_job *job,
@@ -1520,6 +1500,7 @@ itadmin_mem_swman_new(
}
return back;
}
+#endif
@@ -1599,9 +1580,7 @@ itadmin_mem_license_new(
unsigned long pk,
char const *order,
char const *notes,
- itadmin_date *d_del,
char const *i_del,
- itadmin_date *d_inv,
char const *i_inv,
itadmin_swprod *prod,
itadmin_lictype *ltype,
@@ -1654,17 +1633,17 @@ itadmin_mem_dhcp_option_del(void *v)
itadmin_dhcp_option *o;
-#line 1447 "itamem.ctr"
+#line 1448 "itamem.ctr"
if(v) {
o = (itadmin_dhcp_option *)v;
-#line 1449 "itamem.ctr"
+#line 1450 "itamem.ctr"
dk3_release(o->k);
dk3_release(o->v);
dk3_release(o);
}
-#line 1453 "itamem.ctr"
+#line 1454 "itamem.ctr"
}
diff --git a/support/dktools/itamem.ctr b/support/dktools/itamem.ctr
index 5febe9f654..acf8effb9b 100644
--- a/support/dktools/itamem.ctr
+++ b/support/dktools/itamem.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -1281,12 +1281,14 @@ itadmin_mem_host_new(
+#if 0
/** Create new software manufacturer.
@param job Job structure.
@param sn Short name.
@param ln Long name (description).
@return Pointer to new object on success, NULL on error.
*/
+static
itadmin_swman *
itadmin_mem_swman_new(
itadmin_job *job,
@@ -1311,6 +1313,7 @@ itadmin_mem_swman_new(
}
return back;
}
+#endif
@@ -1390,9 +1393,7 @@ itadmin_mem_license_new(
unsigned long pk,
char const *order,
char const *notes,
- itadmin_date *d_del,
char const *i_del,
- itadmin_date *d_inv,
char const *i_inv,
itadmin_swprod *prod,
itadmin_lictype *ltype,
diff --git a/support/dktools/itamysql.c b/support/dktools/itamysql.c
index 130e87829e..4f38c00d1b 100644
--- a/support/dktools/itamysql.c
+++ b/support/dktools/itamysql.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itamysql.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itamysql.ctr
*/
/** @file itamysql.c The itamysql module.
@@ -42,6 +20,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk3all.h"
#include "itadmin.h"
+#if DK3_HAVE_MARIADB_MYSQL_H
+#include <mariadb/mysql.h>
+#else
#if DK3_HAVE_MYSQL_MYSQL_H
#include <mysql/mysql.h>
#else
@@ -49,16 +30,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <mysql.h>
#endif
#endif
+#endif
-
-#line 25 "itamysql.ctr"
+#line 28 "itamysql.ctr"
-#if DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H
+#if DK3_HAVE_MARIADB_MYSQL_H || DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H
/** Keywords used by this module.
@@ -121,7 +102,7 @@ static char const *itadmin_mysql_c8_kw[] = {
NULL
-#line 108 "itamysql.ctr"
+#line 111 "itamysql.ctr"
};
@@ -184,7 +165,7 @@ static char const * const itadmin_mysql_cn_users[] = {
NULL
-#line 155 "itamysql.ctr"
+#line 158 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_users.
@@ -223,7 +204,7 @@ static char const * const itadmin_mysql_cn_buildings[] = {
NULL
-#line 176 "itamysql.ctr"
+#line 179 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_buildings.
@@ -244,7 +225,7 @@ static char const * const itadmin_mysql_cn_speed[] = {
NULL
-#line 191 "itamysql.ctr"
+#line 194 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_speed.
@@ -265,7 +246,7 @@ static char const * const itadmin_mysql_cn_vlan[] = {
NULL
-#line 206 "itamysql.ctr"
+#line 209 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_vlan.
@@ -298,7 +279,7 @@ static char const * const itadmin_mysql_cn_patch[] = {
NULL
-#line 225 "itamysql.ctr"
+#line 228 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_patch.
@@ -319,7 +300,7 @@ static char const * const itadmin_mysql_cn_netgroup[] = {
NULL
-#line 240 "itamysql.ctr"
+#line 243 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_netgroup.
@@ -349,7 +330,7 @@ static char const * const itadmin_mysql_cn_dhcp_option[] = {
NULL
-#line 258 "itamysql.ctr"
+#line 261 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_dhcp_option.
@@ -370,7 +351,7 @@ static char const * const itadmin_mysql_cn_swman[] = {
NULL
-#line 273 "itamysql.ctr"
+#line 276 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_swman.
@@ -394,7 +375,7 @@ static char const * const itadmin_mysql_cn_swprod[] = {
NULL
-#line 289 "itamysql.ctr"
+#line 292 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_swprod.
@@ -418,7 +399,7 @@ static char const * const itadmin_mysql_cn_lictype[] = {
NULL
-#line 305 "itamysql.ctr"
+#line 308 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_lictype.
@@ -469,7 +450,7 @@ static char const * const itadmin_mysql_cn_license[] = {
NULL
-#line 343 "itamysql.ctr"
+#line 346 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_license.
@@ -490,7 +471,7 @@ static char const * const itadmin_mysql_cn_ngdep[] = {
NULL
-#line 358 "itamysql.ctr"
+#line 361 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_ngdep.
@@ -565,7 +546,7 @@ static char const * const itadmin_mysql_cn_hosts[] = {
NULL
-#line 391 "itamysql.ctr"
+#line 394 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_hosts.
@@ -595,7 +576,7 @@ static char const * const itadmin_mysql_cn_network[] = {
NULL
-#line 409 "itamysql.ctr"
+#line 412 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_network.
@@ -616,7 +597,7 @@ static char const * const itadmin_mysql_cn_dhcp_class[] = {
NULL
-#line 424 "itamysql.ctr"
+#line 427 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_dhcp_class.
@@ -637,7 +618,7 @@ static char const * const itadmin_mysql_cn_dhcp_group[] = {
NULL
-#line 439 "itamysql.ctr"
+#line 442 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_dhcp_group.
@@ -670,7 +651,7 @@ static char const * const itadmin_mysql_cn_dhcp_pool[] = {
NULL
-#line 458 "itamysql.ctr"
+#line 461 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_dhcp_pool.
@@ -691,7 +672,7 @@ static char const * const itadmin_mysql_cn_alias[] = {
NULL
-#line 473 "itamysql.ctr"
+#line 476 "itamysql.ctr"
};
/** Number of elements in itadmin_mysql_cn_alias.
@@ -716,24 +697,23 @@ itadmin_mysql_read_int(itadmin_job *job, char const *ptr, size_t lgt, int def)
int i;
-#line 496 "itamysql.ctr"
+#line 499 "itamysql.ctr"
back = def;
if(ptr) {
if(lgt) {
if(sscanf(ptr, "%d", &i) == 1) {
back = i;
-#line 501 "itamysql.ctr"
+#line 504 "itamysql.ctr"
}
}
}
-#line 504 "itamysql.ctr"
+#line 507 "itamysql.ctr"
return back;
}
#else
/** Obtain int value from string.
- @param job Job structure.
@param ptr String to convert.
@param lgts Lengths of strings.
@param cnind Column name indices.
@@ -744,7 +724,6 @@ itadmin_mysql_read_int(itadmin_job *job, char const *ptr, size_t lgt, int def)
static
int
itadmin_mysql_read_int(
- itadmin_job *job,
char const *ptr,
unsigned long *lgts,
size_t *cnind,
@@ -756,7 +735,7 @@ itadmin_mysql_read_int(
int i;
-#line 530 "itamysql.ctr"
+#line 531 "itamysql.ctr"
back = def;
if(ptr) {
if(cnind[ind] != 0xFFFFU) {
@@ -768,7 +747,7 @@ itadmin_mysql_read_int(
}
}
-#line 540 "itamysql.ctr"
+#line 541 "itamysql.ctr"
return back;
}
#endif
@@ -777,7 +756,6 @@ itadmin_mysql_read_int(
/** Find column name indices.
For column names not found the program sets the index
to 0xFFFFU.
- @param job Job structure.
@param cnind Destination array for indices.
@param sz_cnind Size of @a cnind.
@param nf Number of fields in query result.
@@ -787,7 +765,6 @@ itadmin_mysql_read_int(
static
void
itadmin_data_mysql_find_indices(
- itadmin_job *job,
size_t *cnind,
size_t sz_cnind,
size_t nf,
@@ -817,7 +794,6 @@ itadmin_data_mysql_find_indices(
/** Set value pointers.
- @param job Job structure.
@param val Value pointers array.
@param cnind Index array.
@param sz_cnind Size of @a val and @a cnind.
@@ -828,7 +804,6 @@ itadmin_data_mysql_find_indices(
static
void
itadmin_data_mysql_set_pointers(
- itadmin_job *job,
char const * *val,
size_t *cnind,
size_t sz_cnind,
@@ -874,14 +849,14 @@ itadmin_data_mysql_alias(itadmin_job *job)
int back = 0;
-#line 644 "itamysql.ctr"
+#line 641 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[12]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_alias, nf, mr,
+ cnind, itadmin_mysql_sz_cn_alias, nf, mr,
itadmin_mysql_cn_alias
);
back = 1;
@@ -891,7 +866,7 @@ itadmin_data_mysql_alias(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_alias,
+ val, cnind, itadmin_mysql_sz_cn_alias,
nf, mrow, lgts
);
res = itadmin_register_alias(
@@ -915,7 +890,7 @@ itadmin_data_mysql_alias(itadmin_job *job)
}
-#line 683 "itamysql.ctr"
+#line 680 "itamysql.ctr"
return back;
}
@@ -939,14 +914,14 @@ itadmin_data_mysql_dhcp_pool(itadmin_job *job)
int back = 0;
-#line 705 "itamysql.ctr"
+#line 702 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[10]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_dhcp_pool, nf, mr,
+ cnind, itadmin_mysql_sz_cn_dhcp_pool, nf, mr,
itadmin_mysql_cn_dhcp_pool
);
back = 1;
@@ -956,18 +931,18 @@ itadmin_data_mysql_dhcp_pool(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_dhcp_pool,
+ val, cnind, itadmin_mysql_sz_cn_dhcp_pool,
nf, mrow, lgts
);
res = itadmin_register_dhcp_pool(
job,
val[0], val[1], val[2],
#if VERSION_BEFORE_20120208
- itadmin_mysql_read_int(job, val[3], lgts[cnind[3]], 0),
- itadmin_mysql_read_int(job, val[4], lgts[cnind[4]], 0),
+ itadmin_mysql_read_int(val[3], lgts[cnind[3]], 0),
+ itadmin_mysql_read_int(val[4], lgts[cnind[4]], 0),
#else
- itadmin_mysql_read_int(job, val[3], lgts, cnind, 3, 0),
- itadmin_mysql_read_int(job, val[4], lgts, cnind, 4, 0),
+ itadmin_mysql_read_int(val[3], lgts, cnind, 3, 0),
+ itadmin_mysql_read_int(val[4], lgts, cnind, 4, 0),
#endif
val[5]
);
@@ -987,7 +962,7 @@ itadmin_data_mysql_dhcp_pool(itadmin_job *job)
}
-#line 751 "itamysql.ctr"
+#line 748 "itamysql.ctr"
return back;
}
@@ -1010,14 +985,14 @@ itadmin_data_mysql_dhcp_group(itadmin_job *job)
int back = 0;
-#line 772 "itamysql.ctr"
+#line 769 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[9]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_dhcp_group, nf, mr,
+ cnind, itadmin_mysql_sz_cn_dhcp_group, nf, mr,
itadmin_mysql_cn_dhcp_group
);
back = 1;
@@ -1027,7 +1002,7 @@ itadmin_data_mysql_dhcp_group(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_dhcp_group,
+ val, cnind, itadmin_mysql_sz_cn_dhcp_group,
nf, mrow, lgts
);
res = itadmin_register_dhcp_group(job, val[0], val[1]);
@@ -1046,7 +1021,7 @@ itadmin_data_mysql_dhcp_group(itadmin_job *job)
}
-#line 806 "itamysql.ctr"
+#line 803 "itamysql.ctr"
return back;
}
@@ -1070,14 +1045,14 @@ itadmin_data_mysql_dhcp_class(itadmin_job *job)
int back = 0;
-#line 828 "itamysql.ctr"
+#line 825 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[8]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_dhcp_class, nf, mr,
+ cnind, itadmin_mysql_sz_cn_dhcp_class, nf, mr,
itadmin_mysql_cn_dhcp_class
);
back = 1;
@@ -1087,7 +1062,7 @@ itadmin_data_mysql_dhcp_class(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_dhcp_class,
+ val, cnind, itadmin_mysql_sz_cn_dhcp_class,
nf, mrow, lgts
);
res = itadmin_register_dhcp_class(job, val[0], val[1]);
@@ -1106,7 +1081,7 @@ itadmin_data_mysql_dhcp_class(itadmin_job *job)
}
-#line 862 "itamysql.ctr"
+#line 859 "itamysql.ctr"
return back;
}
@@ -1130,14 +1105,14 @@ itadmin_data_mysql_network(itadmin_job *job)
int back = 0;
-#line 884 "itamysql.ctr"
+#line 881 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[5]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_network, nf, mr,
+ cnind, itadmin_mysql_sz_cn_network, nf, mr,
itadmin_mysql_cn_network
);
back = 1;
@@ -1147,7 +1122,7 @@ itadmin_data_mysql_network(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_network,
+ val, cnind, itadmin_mysql_sz_cn_network,
nf, mrow, lgts
);
res = itadmin_register_network(
@@ -1168,7 +1143,7 @@ itadmin_data_mysql_network(itadmin_job *job)
}
-#line 920 "itamysql.ctr"
+#line 917 "itamysql.ctr"
return back;
}
@@ -1198,14 +1173,14 @@ itadmin_data_mysql_hosts(itadmin_job *job)
int back = 0;
-#line 948 "itamysql.ctr"
+#line 945 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[11]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_hosts, nf, mr,
+ cnind, itadmin_mysql_sz_cn_hosts, nf, mr,
itadmin_mysql_cn_hosts
);
back = 1;
@@ -1213,56 +1188,56 @@ itadmin_data_mysql_hosts(itadmin_job *job)
mrow = mysql_fetch_row(mr);
if(mrow) {
-#line 961 "itamysql.ctr"
+#line 958 "itamysql.ctr"
lgts = mysql_fetch_lengths(mr);
if(lgts) {
-#line 963 "itamysql.ctr"
+#line 960 "itamysql.ctr"
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_hosts,
+ val, cnind, itadmin_mysql_sz_cn_hosts,
nf, mrow, lgts
);
flag_first =
- itadmin_mysql_read_int(job, val[14], lgts, cnind, 14, 0);
+ itadmin_mysql_read_int(val[14], lgts, cnind, 14, 0);
flag_guest =
- itadmin_mysql_read_int(job, val[15], lgts, cnind, 15, 0);
+ itadmin_mysql_read_int(val[15], lgts, cnind, 15, 0);
flag_no_net_docu =
- itadmin_mysql_read_int(job, val[18], lgts, cnind, 18, 0);
+ itadmin_mysql_read_int(val[18], lgts, cnind, 18, 0);
flag_no_arpwatch =
- itadmin_mysql_read_int(job, val[19], lgts, cnind, 19, 0);
+ itadmin_mysql_read_int(val[19], lgts, cnind, 19, 0);
itadmin_mem_date_init(&expi);
hexpi = 0;
if(val[17]) {
-#line 978 "itamysql.ctr"
+#line 975 "itamysql.ctr"
if(cnind[17] != 0xFFFFU) {
-#line 979 "itamysql.ctr"
+#line 976 "itamysql.ctr"
if(lgts[cnind[17]]) {
-#line 980 "itamysql.ctr"
+#line 977 "itamysql.ctr"
if(itadmin_tool_convert_date(job, &expi, val[17])) {
hexpi = 1;
-#line 982 "itamysql.ctr"
+#line 979 "itamysql.ctr"
} else {
-#line 983 "itamysql.ctr"
+#line 980 "itamysql.ctr"
}
} else {
-#line 985 "itamysql.ctr"
+#line 982 "itamysql.ctr"
}
} else {
-#line 987 "itamysql.ctr"
+#line 984 "itamysql.ctr"
}
} else {
-#line 989 "itamysql.ctr"
+#line 986 "itamysql.ctr"
}
-#line 990 "itamysql.ctr"
+#line 987 "itamysql.ctr"
res = itadmin_register_host(
job, val[0], val[1], val[2], val[3], val[4], val[5], val[6],
val[7], val[8], val[9], val[10], val[11], val[12], val[13],
@@ -1270,15 +1245,15 @@ itadmin_data_mysql_hosts(itadmin_job *job)
flag_no_net_docu, flag_no_arpwatch
);
-#line 996 "itamysql.ctr"
+#line 993 "itamysql.ctr"
if(!(res)) { back = 0; }
} else {
-#line 998 "itamysql.ctr"
+#line 995 "itamysql.ctr"
back = 0;
}
-#line 1000 "itamysql.ctr"
+#line 997 "itamysql.ctr"
}
} while(mrow);
mysql_free_result(mr);
@@ -1290,7 +1265,7 @@ itadmin_data_mysql_hosts(itadmin_job *job)
}
-#line 1010 "itamysql.ctr"
+#line 1007 "itamysql.ctr"
return back;
}
@@ -1314,14 +1289,14 @@ itadmin_data_mysql_ngdep(itadmin_job *job)
int back = 0;
-#line 1032 "itamysql.ctr"
+#line 1029 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[7]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_ngdep, nf, mr,
+ cnind, itadmin_mysql_sz_cn_ngdep, nf, mr,
itadmin_mysql_cn_ngdep
);
back = 1;
@@ -1331,7 +1306,7 @@ itadmin_data_mysql_ngdep(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_ngdep,
+ val, cnind, itadmin_mysql_sz_cn_ngdep,
nf, mrow, lgts
);
res = itadmin_register_ngdep(job, val[0], val[1]);
@@ -1350,7 +1325,7 @@ itadmin_data_mysql_ngdep(itadmin_job *job)
}
-#line 1066 "itamysql.ctr"
+#line 1063 "itamysql.ctr"
return back;
}
@@ -1376,19 +1351,17 @@ itadmin_data_mysql_license(itadmin_job *job)
unsigned long lineno; /* Record number. */
unsigned int nf; /* Number of fields in result. */
int res; /* Query result. */
- int hdd; /* Flag: Have delivery date. */
- int hdi; /* Flag: Have invoice date. */
int back = 0;
-#line 1095 "itamysql.ctr"
+#line 1090 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[17]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_license, nf, mr,
+ cnind, itadmin_mysql_sz_cn_license, nf, mr,
itadmin_mysql_cn_license
);
back = 1;
@@ -1399,7 +1372,7 @@ itadmin_data_mysql_license(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_license,
+ val, cnind, itadmin_mysql_sz_cn_license,
nf, mrow, lgts
);
/*
@@ -1410,22 +1383,17 @@ itadmin_data_mysql_license(itadmin_job *job)
*/
if(val[0]) {
if(sscanf(val[0], "%lu", &pk) == 1) {
- hdd = hdi = 0;
if(val[8]) {
if(cnind[8] != 0xFFFFU) {
if(lgts[cnind[8]]) {
- if(itadmin_tool_convert_date(job, &dd, val[8])) {
- hdd = 1;
- }
+ itadmin_tool_convert_date(job, &dd, val[8]);
}
}
}
if(val[10]) {
if(cnind[10] != 0xFFFFU) {
if(lgts[cnind[10]]) {
- if(itadmin_tool_convert_date(job, &di, val[10])) {
- hdi = 1;
- }
+ itadmin_tool_convert_date(job, &di, val[10]);
}
}
}
@@ -1438,10 +1406,7 @@ itadmin_data_mysql_license(itadmin_job *job)
val[4], /* co_s */
val[5], /* lt_s */
val[6], /* li_no */
- val[7], /* sr_s */
- ((hdd) ? &dd : NULL),
val[9], /* li_nd */
- ((hdi) ? &di : NULL),
val[11] /* li_ni */
);
if(!(res)) { back = 0; }
@@ -1470,7 +1435,7 @@ itadmin_data_mysql_license(itadmin_job *job)
}
-#line 1182 "itamysql.ctr"
+#line 1169 "itamysql.ctr"
return back;
}
@@ -1495,14 +1460,14 @@ itadmin_data_mysql_lictype(itadmin_job *job)
int back = 0;
-#line 1205 "itamysql.ctr"
+#line 1192 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[16]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_lictype, nf, mr,
+ cnind, itadmin_mysql_sz_cn_lictype, nf, mr,
itadmin_mysql_cn_lictype
);
back = 1;
@@ -1512,7 +1477,7 @@ itadmin_data_mysql_lictype(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_lictype,
+ val, cnind, itadmin_mysql_sz_cn_lictype,
nf, mrow, lgts
);
licno = 1;
@@ -1549,7 +1514,7 @@ itadmin_data_mysql_lictype(itadmin_job *job)
}
-#line 1257 "itamysql.ctr"
+#line 1244 "itamysql.ctr"
return back;
}
@@ -1573,14 +1538,14 @@ itadmin_data_mysql_swprod(itadmin_job *job)
int back = 0;
-#line 1279 "itamysql.ctr"
+#line 1266 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[15]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_swprod, nf, mr,
+ cnind, itadmin_mysql_sz_cn_swprod, nf, mr,
itadmin_mysql_cn_swprod
);
back = 1;
@@ -1590,7 +1555,7 @@ itadmin_data_mysql_swprod(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_swprod,
+ val, cnind, itadmin_mysql_sz_cn_swprod,
nf, mrow, lgts
);
res = itadmin_register_swprod(
@@ -1611,7 +1576,7 @@ itadmin_data_mysql_swprod(itadmin_job *job)
}
-#line 1315 "itamysql.ctr"
+#line 1302 "itamysql.ctr"
return back;
}
@@ -1640,14 +1605,14 @@ itadmin_data_mysql_swman(itadmin_job *job)
int back = 0;
-#line 1342 "itamysql.ctr"
+#line 1329 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[14]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_swman, nf, mr,
+ cnind, itadmin_mysql_sz_cn_swman, nf, mr,
itadmin_mysql_cn_swman
);
back = 1;
@@ -1658,7 +1623,7 @@ itadmin_data_mysql_swman(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_swman,
+ val, cnind, itadmin_mysql_sz_cn_swman,
nf, mrow, lgts
);
res = 0;
@@ -1687,7 +1652,7 @@ itadmin_data_mysql_swman(itadmin_job *job)
}
-#line 1387 "itamysql.ctr"
+#line 1374 "itamysql.ctr"
return back;
}
@@ -1714,14 +1679,14 @@ itadmin_data_mysql_dhcp_option(itadmin_job *job)
int back = 0;
-#line 1412 "itamysql.ctr"
+#line 1399 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[13]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_dhcp_option, nf, mr,
+ cnind, itadmin_mysql_sz_cn_dhcp_option, nf, mr,
itadmin_mysql_cn_dhcp_option
);
back = 1;
@@ -1732,7 +1697,7 @@ itadmin_data_mysql_dhcp_option(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_dhcp_option,
+ val, cnind, itadmin_mysql_sz_cn_dhcp_option,
nf, mrow, lgts
);
res = 0;
@@ -1767,7 +1732,7 @@ itadmin_data_mysql_dhcp_option(itadmin_job *job)
}
-#line 1463 "itamysql.ctr"
+#line 1450 "itamysql.ctr"
return back;
}
@@ -1791,14 +1756,14 @@ itadmin_data_mysql_netgroup(itadmin_job *job)
int back = 0;
-#line 1485 "itamysql.ctr"
+#line 1472 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[6]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_netgroup, nf, mr,
+ cnind, itadmin_mysql_sz_cn_netgroup, nf, mr,
itadmin_mysql_cn_netgroup
);
back = 1;
@@ -1808,7 +1773,7 @@ itadmin_data_mysql_netgroup(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_netgroup,
+ val, cnind, itadmin_mysql_sz_cn_netgroup,
nf, mrow, lgts
);
res = itadmin_register_netgroup(job, val[0], val[1]);
@@ -1827,7 +1792,7 @@ itadmin_data_mysql_netgroup(itadmin_job *job)
}
-#line 1519 "itamysql.ctr"
+#line 1506 "itamysql.ctr"
return back;
}
@@ -1851,14 +1816,14 @@ itadmin_data_mysql_patch(itadmin_job *job)
int back = 0;
-#line 1541 "itamysql.ctr"
+#line 1528 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[3]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_patch, nf, mr,
+ cnind, itadmin_mysql_sz_cn_patch, nf, mr,
itadmin_mysql_cn_patch
);
back = 1;
@@ -1868,7 +1833,7 @@ itadmin_data_mysql_patch(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_patch,
+ val, cnind, itadmin_mysql_sz_cn_patch,
nf, mrow, lgts
);
res = itadmin_register_patch(
@@ -1889,7 +1854,7 @@ itadmin_data_mysql_patch(itadmin_job *job)
}
-#line 1577 "itamysql.ctr"
+#line 1564 "itamysql.ctr"
return back;
}
@@ -1913,14 +1878,14 @@ itadmin_data_mysql_vlan(itadmin_job *job)
int back = 0;
-#line 1599 "itamysql.ctr"
+#line 1586 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[2]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_vlan, nf, mr,
+ cnind, itadmin_mysql_sz_cn_vlan, nf, mr,
itadmin_mysql_cn_vlan
);
back = 1;
@@ -1930,7 +1895,7 @@ itadmin_data_mysql_vlan(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_vlan,
+ val, cnind, itadmin_mysql_sz_cn_vlan,
nf, mrow, lgts
);
res = itadmin_register_vlan(job, val[0], val[1]);
@@ -1949,7 +1914,7 @@ itadmin_data_mysql_vlan(itadmin_job *job)
}
-#line 1633 "itamysql.ctr"
+#line 1620 "itamysql.ctr"
return back;
}
@@ -1973,14 +1938,14 @@ itadmin_data_mysql_speed(itadmin_job *job)
int back = 0;
-#line 1655 "itamysql.ctr"
+#line 1642 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[4]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_speed, nf, mr,
+ cnind, itadmin_mysql_sz_cn_speed, nf, mr,
itadmin_mysql_cn_speed
);
back = 1;
@@ -1990,7 +1955,7 @@ itadmin_data_mysql_speed(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_speed,
+ val, cnind, itadmin_mysql_sz_cn_speed,
nf, mrow, lgts
);
res = itadmin_register_speed(job, val[0], val[1]);
@@ -2009,7 +1974,7 @@ itadmin_data_mysql_speed(itadmin_job *job)
}
-#line 1689 "itamysql.ctr"
+#line 1676 "itamysql.ctr"
return back;
}
@@ -2033,14 +1998,14 @@ itadmin_data_mysql_buildings(itadmin_job *job)
int back = 0;
-#line 1711 "itamysql.ctr"
+#line 1698 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[1]);
if(0 == res) {
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_buildings, nf, mr,
+ cnind, itadmin_mysql_sz_cn_buildings, nf, mr,
itadmin_mysql_cn_buildings
);
back = 1;
@@ -2050,11 +2015,11 @@ itadmin_data_mysql_buildings(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_buildings,
+ val, cnind, itadmin_mysql_sz_cn_buildings,
nf, mrow, lgts
);
-#line 1730 "itamysql.ctr"
+#line 1717 "itamysql.ctr"
res = itadmin_register_building(
job,
val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]
@@ -2063,7 +2028,7 @@ itadmin_data_mysql_buildings(itadmin_job *job)
} else {
back = 0;
-#line 1737 "itamysql.ctr"
+#line 1724 "itamysql.ctr"
}
}
} while(mrow);
@@ -2076,7 +2041,7 @@ itadmin_data_mysql_buildings(itadmin_job *job)
}
-#line 1748 "itamysql.ctr"
+#line 1735 "itamysql.ctr"
return back;
}
@@ -2100,37 +2065,37 @@ itadmin_data_mysql_users(itadmin_job *job)
int back = 0;
-#line 1770 "itamysql.ctr"
+#line 1757 "itamysql.ctr"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[0]);
-#line 1771 "itamysql.ctr"
+#line 1758 "itamysql.ctr"
if(0 == res) {
-#line 1772 "itamysql.ctr"
+#line 1759 "itamysql.ctr"
mr = mysql_use_result((MYSQL *)(job->dbptr));
if(mr) {
-#line 1774 "itamysql.ctr"
+#line 1761 "itamysql.ctr"
nf = mysql_num_fields(mr);
-#line 1775 "itamysql.ctr"
+#line 1762 "itamysql.ctr"
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_users, nf, mr, itadmin_mysql_cn_users
+ cnind, itadmin_mysql_sz_cn_users, nf, mr, itadmin_mysql_cn_users
);
back = 1;
do {
-#line 1780 "itamysql.ctr"
+#line 1767 "itamysql.ctr"
mrow = mysql_fetch_row(mr);
if(mrow) {
-#line 1782 "itamysql.ctr"
+#line 1769 "itamysql.ctr"
lgts = mysql_fetch_lengths(mr);
if(lgts) {
-#line 1784 "itamysql.ctr"
+#line 1771 "itamysql.ctr"
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_users,
+ val, cnind, itadmin_mysql_sz_cn_users,
nf, mrow, lgts
);
res = itadmin_register_user(
@@ -2141,28 +2106,28 @@ itadmin_data_mysql_users(itadmin_job *job)
}
} else {
-#line 1795 "itamysql.ctr"
+#line 1782 "itamysql.ctr"
back = 0;
}
}
-#line 1798 "itamysql.ctr"
+#line 1785 "itamysql.ctr"
} while(mrow);
-#line 1799 "itamysql.ctr"
+#line 1786 "itamysql.ctr"
mysql_free_result(mr);
} else {
-#line 1801 "itamysql.ctr"
+#line 1788 "itamysql.ctr"
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 141);
}
} else {
-#line 1804 "itamysql.ctr"
+#line 1791 "itamysql.ctr"
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 142);
}
-#line 1806 "itamysql.ctr"
+#line 1793 "itamysql.ctr"
return back;
}
@@ -2180,7 +2145,7 @@ itadmin_data_mysql_retrieve(itadmin_job *job)
int back = 1;
-#line 1822 "itamysql.ctr"
+#line 1809 "itamysql.ctr"
/* PROGRESS: Reading users table. */
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 87);
if(!itadmin_data_mysql_users(job)) { back = 0; }
@@ -2253,7 +2218,7 @@ itadmin_data_mysql_retrieve(itadmin_job *job)
itadmin_tool_log_1(job, DK3_LL_PROGRESS, 105);
-#line 1893 "itamysql.ctr"
+#line 1880 "itamysql.ctr"
return back;
}
@@ -2263,7 +2228,7 @@ itadmin_data_mysql_retrieve(itadmin_job *job)
int
itadmin_data_mysql_read(itadmin_job *job)
{
-#if DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H
+#if DK3_HAVE_MARIADB_MYSQL_H || DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H
char dbh[ITADMIN_CONFIG_LINE_SIZE]; /* Host name. */
char dbu[ITADMIN_CONFIG_LINE_SIZE]; /* User name. */
char dbp[ITADMIN_CONFIG_LINE_SIZE]; /* Password. */
@@ -2274,7 +2239,7 @@ itadmin_data_mysql_read(itadmin_job *job)
int back = 0;
-#line 1912 "itamysql.ctr"
+#line 1899 "itamysql.ctr"
ie = dk3app_get_encoding(job->app);
if(0 == mysql_library_init(-1, itadmin_mysql_argv, itadmin_mysql_groups)) {
re1 = mysql_init(NULL);
@@ -2285,46 +2250,46 @@ itadmin_data_mysql_read(itadmin_job *job)
if(dk3str_to_c8u_app(dbn,sizeof(dbn),job->dbn,ie,job->app)) {
-#line 1921 "itamysql.ctr"
+#line 1908 "itamysql.ctr"
res = mysql_real_connect(re1, dbh, dbu, dbp, dbn, 0, NULL, 0);
if(res) {
-#line 1923 "itamysql.ctr"
+#line 1910 "itamysql.ctr"
job->dbptr = (void *)res;
if(mysql_set_character_set(res, "utf8")) {
-#line 1925 "itamysql.ctr"
+#line 1912 "itamysql.ctr"
/* WARNING: Failed to set encoding! */
dk3app_log_1(job->app, DK3_LL_WARNING, job->msg, 154);
}
back = itadmin_data_mysql_retrieve(job);
} else {
-#line 1930 "itamysql.ctr"
+#line 1917 "itamysql.ctr"
/* ERROR: Failed to connect to database! */
itadmin_tool_log_utf8_5(job,DK3_LL_ERROR,155,156,157,dbn,dbh);
}
} else {
-#line 1934 "itamysql.ctr"
+#line 1921 "itamysql.ctr"
/* ERROR: Failed to convert database name! */
dk3app_log_3(job->app,DK3_LL_ERROR,job->msg,158,159,job->dbn);
}
} else {
-#line 1938 "itamysql.ctr"
+#line 1925 "itamysql.ctr"
/* ERROR: Failed to convert database user password! */
dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 160);
}
} else {
-#line 1942 "itamysql.ctr"
+#line 1929 "itamysql.ctr"
/* ERROR: Failed to convert database user name! */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 161, 162, job->dbus);
}
} else {
-#line 1946 "itamysql.ctr"
+#line 1933 "itamysql.ctr"
/* ERROR: Failed to convert database host name! */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 163, 164, job->dbhn);
}
@@ -2340,7 +2305,7 @@ itadmin_data_mysql_read(itadmin_job *job)
}
-#line 1960 "itamysql.ctr"
+#line 1947 "itamysql.ctr"
#else
int back = 0;
/* ERROR: No MySQL support available! */
diff --git a/support/dktools/itamysql.ctr b/support/dktools/itamysql.ctr
index 1085e90258..8c90bfa403 100644
--- a/support/dktools/itamysql.ctr
+++ b/support/dktools/itamysql.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,9 @@ license = bsd
#include "dk3all.h"
#include "itadmin.h"
+#if DK3_HAVE_MARIADB_MYSQL_H
+#include <mariadb/mysql.h>
+#else
#if DK3_HAVE_MYSQL_MYSQL_H
#include <mysql/mysql.h>
#else
@@ -18,14 +21,14 @@ license = bsd
#include <mysql.h>
#endif
#endif
-
+#endif
$!trace-include
-#if DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H
+#if DK3_HAVE_MARIADB_MYSQL_H || DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H
/** Keywords used by this module.
@@ -505,7 +508,6 @@ itadmin_mysql_read_int(itadmin_job *job, char const *ptr, size_t lgt, int def)
}
#else
/** Obtain int value from string.
- @param job Job structure.
@param ptr String to convert.
@param lgts Lengths of strings.
@param cnind Column name indices.
@@ -516,7 +518,6 @@ itadmin_mysql_read_int(itadmin_job *job, char const *ptr, size_t lgt, int def)
static
int
itadmin_mysql_read_int(
- itadmin_job *job,
char const *ptr,
unsigned long *lgts,
size_t *cnind,
@@ -545,7 +546,6 @@ itadmin_mysql_read_int(
/** Find column name indices.
For column names not found the program sets the index
to 0xFFFFU.
- @param job Job structure.
@param cnind Destination array for indices.
@param sz_cnind Size of @a cnind.
@param nf Number of fields in query result.
@@ -555,7 +555,6 @@ itadmin_mysql_read_int(
static
void
itadmin_data_mysql_find_indices(
- itadmin_job *job,
size_t *cnind,
size_t sz_cnind,
size_t nf,
@@ -585,7 +584,6 @@ itadmin_data_mysql_find_indices(
/** Set value pointers.
- @param job Job structure.
@param val Value pointers array.
@param cnind Index array.
@param sz_cnind Size of @a val and @a cnind.
@@ -596,7 +594,6 @@ itadmin_data_mysql_find_indices(
static
void
itadmin_data_mysql_set_pointers(
- itadmin_job *job,
char const * *val,
size_t *cnind,
size_t sz_cnind,
@@ -647,7 +644,7 @@ itadmin_data_mysql_alias(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_alias, nf, mr,
+ cnind, itadmin_mysql_sz_cn_alias, nf, mr,
itadmin_mysql_cn_alias
);
back = 1;
@@ -657,7 +654,7 @@ itadmin_data_mysql_alias(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_alias,
+ val, cnind, itadmin_mysql_sz_cn_alias,
nf, mrow, lgts
);
res = itadmin_register_alias(
@@ -708,7 +705,7 @@ itadmin_data_mysql_dhcp_pool(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_dhcp_pool, nf, mr,
+ cnind, itadmin_mysql_sz_cn_dhcp_pool, nf, mr,
itadmin_mysql_cn_dhcp_pool
);
back = 1;
@@ -718,18 +715,18 @@ itadmin_data_mysql_dhcp_pool(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_dhcp_pool,
+ val, cnind, itadmin_mysql_sz_cn_dhcp_pool,
nf, mrow, lgts
);
res = itadmin_register_dhcp_pool(
job,
val[0], val[1], val[2],
#if VERSION_BEFORE_20120208
- itadmin_mysql_read_int(job, val[3], lgts[cnind[3]], 0),
- itadmin_mysql_read_int(job, val[4], lgts[cnind[4]], 0),
+ itadmin_mysql_read_int(val[3], lgts[cnind[3]], 0),
+ itadmin_mysql_read_int(val[4], lgts[cnind[4]], 0),
#else
- itadmin_mysql_read_int(job, val[3], lgts, cnind, 3, 0),
- itadmin_mysql_read_int(job, val[4], lgts, cnind, 4, 0),
+ itadmin_mysql_read_int(val[3], lgts, cnind, 3, 0),
+ itadmin_mysql_read_int(val[4], lgts, cnind, 4, 0),
#endif
val[5]
);
@@ -775,7 +772,7 @@ itadmin_data_mysql_dhcp_group(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_dhcp_group, nf, mr,
+ cnind, itadmin_mysql_sz_cn_dhcp_group, nf, mr,
itadmin_mysql_cn_dhcp_group
);
back = 1;
@@ -785,7 +782,7 @@ itadmin_data_mysql_dhcp_group(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_dhcp_group,
+ val, cnind, itadmin_mysql_sz_cn_dhcp_group,
nf, mrow, lgts
);
res = itadmin_register_dhcp_group(job, val[0], val[1]);
@@ -831,7 +828,7 @@ itadmin_data_mysql_dhcp_class(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_dhcp_class, nf, mr,
+ cnind, itadmin_mysql_sz_cn_dhcp_class, nf, mr,
itadmin_mysql_cn_dhcp_class
);
back = 1;
@@ -841,7 +838,7 @@ itadmin_data_mysql_dhcp_class(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_dhcp_class,
+ val, cnind, itadmin_mysql_sz_cn_dhcp_class,
nf, mrow, lgts
);
res = itadmin_register_dhcp_class(job, val[0], val[1]);
@@ -887,7 +884,7 @@ itadmin_data_mysql_network(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_network, nf, mr,
+ cnind, itadmin_mysql_sz_cn_network, nf, mr,
itadmin_mysql_cn_network
);
back = 1;
@@ -897,7 +894,7 @@ itadmin_data_mysql_network(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_network,
+ val, cnind, itadmin_mysql_sz_cn_network,
nf, mrow, lgts
);
res = itadmin_register_network(
@@ -951,7 +948,7 @@ itadmin_data_mysql_hosts(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_hosts, nf, mr,
+ cnind, itadmin_mysql_sz_cn_hosts, nf, mr,
itadmin_mysql_cn_hosts
);
back = 1;
@@ -961,17 +958,17 @@ itadmin_data_mysql_hosts(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) { $? ". lgts"
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_hosts,
+ val, cnind, itadmin_mysql_sz_cn_hosts,
nf, mrow, lgts
);
flag_first =
- itadmin_mysql_read_int(job, val[14], lgts, cnind, 14, 0);
+ itadmin_mysql_read_int(val[14], lgts, cnind, 14, 0);
flag_guest =
- itadmin_mysql_read_int(job, val[15], lgts, cnind, 15, 0);
+ itadmin_mysql_read_int(val[15], lgts, cnind, 15, 0);
flag_no_net_docu =
- itadmin_mysql_read_int(job, val[18], lgts, cnind, 18, 0);
+ itadmin_mysql_read_int(val[18], lgts, cnind, 18, 0);
flag_no_arpwatch =
- itadmin_mysql_read_int(job, val[19], lgts, cnind, 19, 0);
+ itadmin_mysql_read_int(val[19], lgts, cnind, 19, 0);
itadmin_mem_date_init(&expi);
hexpi = 0;
if(val[17]) { $? ". date string set"
@@ -1035,7 +1032,7 @@ itadmin_data_mysql_ngdep(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_ngdep, nf, mr,
+ cnind, itadmin_mysql_sz_cn_ngdep, nf, mr,
itadmin_mysql_cn_ngdep
);
back = 1;
@@ -1045,7 +1042,7 @@ itadmin_data_mysql_ngdep(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_ngdep,
+ val, cnind, itadmin_mysql_sz_cn_ngdep,
nf, mrow, lgts
);
res = itadmin_register_ngdep(job, val[0], val[1]);
@@ -1088,8 +1085,6 @@ itadmin_data_mysql_license(itadmin_job *job)
unsigned long lineno; /* Record number. */
unsigned int nf; /* Number of fields in result. */
int res; /* Query result. */
- int hdd; /* Flag: Have delivery date. */
- int hdi; /* Flag: Have invoice date. */
int back = 0;
$? "+ itadmin_data_mysql_license"
res = mysql_query((MYSQL *)(job->dbptr), itadmin_mysql_c8_kw[17]);
@@ -1098,7 +1093,7 @@ itadmin_data_mysql_license(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_license, nf, mr,
+ cnind, itadmin_mysql_sz_cn_license, nf, mr,
itadmin_mysql_cn_license
);
back = 1;
@@ -1109,7 +1104,7 @@ itadmin_data_mysql_license(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_license,
+ val, cnind, itadmin_mysql_sz_cn_license,
nf, mrow, lgts
);
/*
@@ -1120,22 +1115,17 @@ itadmin_data_mysql_license(itadmin_job *job)
*/
if(val[0]) {
if(sscanf(val[0], "%lu", &pk) == 1) {
- hdd = hdi = 0;
if(val[8]) {
if(cnind[8] != 0xFFFFU) {
if(lgts[cnind[8]]) {
- if(itadmin_tool_convert_date(job, &dd, val[8])) {
- hdd = 1;
- }
+ itadmin_tool_convert_date(job, &dd, val[8]);
}
}
}
if(val[10]) {
if(cnind[10] != 0xFFFFU) {
if(lgts[cnind[10]]) {
- if(itadmin_tool_convert_date(job, &di, val[10])) {
- hdi = 1;
- }
+ itadmin_tool_convert_date(job, &di, val[10]);
}
}
}
@@ -1148,10 +1138,7 @@ itadmin_data_mysql_license(itadmin_job *job)
val[4], /* co_s */
val[5], /* lt_s */
val[6], /* li_no */
- val[7], /* sr_s */
- ((hdd) ? &dd : NULL),
val[9], /* li_nd */
- ((hdi) ? &di : NULL),
val[11] /* li_ni */
);
if(!(res)) { back = 0; }
@@ -1208,7 +1195,7 @@ itadmin_data_mysql_lictype(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_lictype, nf, mr,
+ cnind, itadmin_mysql_sz_cn_lictype, nf, mr,
itadmin_mysql_cn_lictype
);
back = 1;
@@ -1218,7 +1205,7 @@ itadmin_data_mysql_lictype(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_lictype,
+ val, cnind, itadmin_mysql_sz_cn_lictype,
nf, mrow, lgts
);
licno = 1;
@@ -1282,7 +1269,7 @@ itadmin_data_mysql_swprod(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_swprod, nf, mr,
+ cnind, itadmin_mysql_sz_cn_swprod, nf, mr,
itadmin_mysql_cn_swprod
);
back = 1;
@@ -1292,7 +1279,7 @@ itadmin_data_mysql_swprod(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_swprod,
+ val, cnind, itadmin_mysql_sz_cn_swprod,
nf, mrow, lgts
);
res = itadmin_register_swprod(
@@ -1345,7 +1332,7 @@ itadmin_data_mysql_swman(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_swman, nf, mr,
+ cnind, itadmin_mysql_sz_cn_swman, nf, mr,
itadmin_mysql_cn_swman
);
back = 1;
@@ -1356,7 +1343,7 @@ itadmin_data_mysql_swman(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_swman,
+ val, cnind, itadmin_mysql_sz_cn_swman,
nf, mrow, lgts
);
res = 0;
@@ -1415,7 +1402,7 @@ itadmin_data_mysql_dhcp_option(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_dhcp_option, nf, mr,
+ cnind, itadmin_mysql_sz_cn_dhcp_option, nf, mr,
itadmin_mysql_cn_dhcp_option
);
back = 1;
@@ -1426,7 +1413,7 @@ itadmin_data_mysql_dhcp_option(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_dhcp_option,
+ val, cnind, itadmin_mysql_sz_cn_dhcp_option,
nf, mrow, lgts
);
res = 0;
@@ -1488,7 +1475,7 @@ itadmin_data_mysql_netgroup(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_netgroup, nf, mr,
+ cnind, itadmin_mysql_sz_cn_netgroup, nf, mr,
itadmin_mysql_cn_netgroup
);
back = 1;
@@ -1498,7 +1485,7 @@ itadmin_data_mysql_netgroup(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_netgroup,
+ val, cnind, itadmin_mysql_sz_cn_netgroup,
nf, mrow, lgts
);
res = itadmin_register_netgroup(job, val[0], val[1]);
@@ -1544,7 +1531,7 @@ itadmin_data_mysql_patch(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_patch, nf, mr,
+ cnind, itadmin_mysql_sz_cn_patch, nf, mr,
itadmin_mysql_cn_patch
);
back = 1;
@@ -1554,7 +1541,7 @@ itadmin_data_mysql_patch(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_patch,
+ val, cnind, itadmin_mysql_sz_cn_patch,
nf, mrow, lgts
);
res = itadmin_register_patch(
@@ -1602,7 +1589,7 @@ itadmin_data_mysql_vlan(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_vlan, nf, mr,
+ cnind, itadmin_mysql_sz_cn_vlan, nf, mr,
itadmin_mysql_cn_vlan
);
back = 1;
@@ -1612,7 +1599,7 @@ itadmin_data_mysql_vlan(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_vlan,
+ val, cnind, itadmin_mysql_sz_cn_vlan,
nf, mrow, lgts
);
res = itadmin_register_vlan(job, val[0], val[1]);
@@ -1658,7 +1645,7 @@ itadmin_data_mysql_speed(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_speed, nf, mr,
+ cnind, itadmin_mysql_sz_cn_speed, nf, mr,
itadmin_mysql_cn_speed
);
back = 1;
@@ -1668,7 +1655,7 @@ itadmin_data_mysql_speed(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_speed,
+ val, cnind, itadmin_mysql_sz_cn_speed,
nf, mrow, lgts
);
res = itadmin_register_speed(job, val[0], val[1]);
@@ -1714,7 +1701,7 @@ itadmin_data_mysql_buildings(itadmin_job *job)
if(mr) {
nf = mysql_num_fields(mr);
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_buildings, nf, mr,
+ cnind, itadmin_mysql_sz_cn_buildings, nf, mr,
itadmin_mysql_cn_buildings
);
back = 1;
@@ -1724,7 +1711,7 @@ itadmin_data_mysql_buildings(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) {
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_buildings,
+ val, cnind, itadmin_mysql_sz_cn_buildings,
nf, mrow, lgts
); $? ". building \"%!8s\"", TR_8STR(val[0])
res = itadmin_register_building(
@@ -1773,7 +1760,7 @@ itadmin_data_mysql_users(itadmin_job *job)
if(mr) { $? ". have result"
nf = mysql_num_fields(mr); $? ". nf = %lu", (unsigned long)nf
itadmin_data_mysql_find_indices(
- job, cnind, itadmin_mysql_sz_cn_users, nf, mr, itadmin_mysql_cn_users
+ cnind, itadmin_mysql_sz_cn_users, nf, mr, itadmin_mysql_cn_users
);
back = 1;
do { $? ". start of loop"
@@ -1782,7 +1769,7 @@ itadmin_data_mysql_users(itadmin_job *job)
lgts = mysql_fetch_lengths(mr);
if(lgts) { $? ". lengths ok"
itadmin_data_mysql_set_pointers(
- job, val, cnind, itadmin_mysql_sz_cn_users,
+ val, cnind, itadmin_mysql_sz_cn_users,
nf, mrow, lgts
);
res = itadmin_register_user(
@@ -1899,7 +1886,7 @@ itadmin_data_mysql_retrieve(itadmin_job *job)
int
itadmin_data_mysql_read(itadmin_job *job)
{
-#if DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H
+#if DK3_HAVE_MARIADB_MYSQL_H || DK3_HAVE_MYSQL_MYSQL_H || DK3_HAVE_MYSQL_H
char dbh[ITADMIN_CONFIG_LINE_SIZE]; /* Host name. */
char dbu[ITADMIN_CONFIG_LINE_SIZE]; /* User name. */
char dbp[ITADMIN_CONFIG_LINE_SIZE]; /* Password. */
diff --git a/support/dktools/itanetd.c b/support/dktools/itanetd.c
index 8da28fe049..48c9f51a40 100644
--- a/support/dktools/itanetd.c
+++ b/support/dktools/itanetd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itanetd.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itanetd.ctr
*/
/** @file itanetd.c The itanetd module.
@@ -78,7 +56,7 @@ static char const * const itadmin_netdocu_c8_kw[] = {
"pdfauthor={",
/* 8 */
-"pdfcreator={itadmin - http://dktools.sourceforge.net/}",
+"pdfcreator={itadmin - http://sourceforge.net/p/dktools/wiki/itadmin/}",
/* 9 */
"\\author{",
@@ -398,9 +376,24 @@ itadmin_netdocu_write_one_host(
} else {
if(host->fgu) {
switch(host->fgu) {
- case 2: {
+ case 1: {
#line 390 "itanetd.ctr"
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[28], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[24], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[310], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ } break;
+ case 2: {
+
+#line 400 "itanetd.ctr"
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[28], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[25], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[26], ie);
@@ -411,27 +404,64 @@ itadmin_netdocu_write_one_host(
} break;
case 3: {
-#line 399 "itanetd.ctr"
- dk3uc2lat_stputs(job->uc2l, os, (job->msg)[28], ie);
+#line 412 "itanetd.ctr"
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[23], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[311], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[312], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
} break;
case 4: {
-#line 404 "itanetd.ctr"
- dk3uc2lat_stputs(job->uc2l, os, (job->msg)[31], ie);
+#line 422 "itanetd.ctr"
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[23], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[313], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[312], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
} break;
- default: {
+ case 5: {
-#line 409 "itanetd.ctr"
+#line 432 "itanetd.ctr"
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[23], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
- dk3uc2lat_stputs(job->uc2l, os, (job->msg)[24], ie);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[315], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[316], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[317], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ } break;
+ case 6: {
+
+#line 444 "itanetd.ctr"
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[23], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[318], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[319], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[320], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ } break;
+ case 7: {
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[320], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
} break;
+ default : {
+
+#line 460 "itanetd.ctr"
+ } break;
}
}
}
@@ -442,12 +472,12 @@ itadmin_netdocu_write_one_host(
itadmin_tool_table_section_header(job, os, 5);
-#line 424 "itanetd.ctr"
+#line 470 "itanetd.ctr"
if(host->un) {
itadmin_tool_table_line_start(job, os, 10);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
itadmin_tool_write_user_latex_long(job, os, host->un);
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
} else {
if(!(host->fgu)) {
itadmin_tool_table_line(job, os, 10, NULL, 1, 0);
@@ -455,13 +485,13 @@ itadmin_netdocu_write_one_host(
}
-#line 435 "itanetd.ctr"
+#line 481 "itanetd.ctr"
itadmin_tool_table_line(job, os, 6, host->co, 1, 0);
/* Ort (Gebaeude und Raum) */
-#line 437 "itanetd.ctr"
+#line 483 "itanetd.ctr"
itadmin_tool_table_line_start(job, os, 11);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
if(host->bu) {
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, (host->bu)->s);
if(host->room) {
@@ -476,17 +506,17 @@ itadmin_netdocu_write_one_host(
}
}
-#line 452 "itanetd.ctr"
- itadmin_tool_table_line_finish(job, os, 0);
+#line 498 "itanetd.ctr"
+ itadmin_tool_table_line_finish(os, 0);
itadmin_tool_table_line(job, os, 7, host->inv, 1, 0);
itadmin_tool_table_line(job, os, 8, host->serno, 1, 1);
itadmin_tool_table_section_header(job, os, 12);
if(host->ipv4) {
itadmin_tool_table_line_start(job, os, 13);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
itadmin_tool_stream_ip(os, host->ipv4);
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
if(host->dnsd) {
itadmin_tool_table_line(job, os, 14, host->dnsd, 0, 0);
}
@@ -529,7 +559,7 @@ itadmin_netdocu_write_one_host(
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
-#line 503 "itanetd.ctr"
+#line 549 "itanetd.ctr"
}
@@ -554,7 +584,7 @@ itadmin_netdocu_write_byod_host(
#endif
-#line 526 "itanetd.ctr"
+#line 572 "itanetd.ctr"
#if VERSION_BEFORE_20150821
ie = dk3app_get_encoding(job->app);
#endif
@@ -567,17 +597,17 @@ itadmin_netdocu_write_byod_host(
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
if(host->un) {
itadmin_tool_table_line_start(job, os, 10);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
itadmin_tool_write_user_latex_long(job, os, host->un);
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
} else {
}
itadmin_tool_table_line(job, os, 6, host->co, 1, 0);
if(host->ipv4) {
itadmin_tool_table_line_start(job, os, 13);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
itadmin_tool_stream_ip(os, host->ipv4);
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
} else {
if(!(host->dc)) {
itadmin_tool_table_line(job, os, 13, NULL, 1, 0);
@@ -602,7 +632,7 @@ itadmin_netdocu_write_byod_host(
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
-#line 572 "itanetd.ctr"
+#line 618 "itanetd.ctr"
}
@@ -740,7 +770,6 @@ itadmin_netdocu_write_netgroup_member_longtable(
/** Write one member host to longtable.
@param job Job structure.
@param os Output stream.
- @param ng Netgroup.
@param ho Host.
@param f_d Flag: Direct member (write bold).
*/
@@ -749,7 +778,6 @@ void
itadmin_netdocu_write_netgroup_member_host(
itadmin_job *job,
dk3_stream_t *os,
- itadmin_netgroup *ng,
itadmin_host *ho,
int f_d
)
@@ -873,7 +901,7 @@ itadmin_netdocu_write_netgroups(itadmin_job *job, dk3_stream_t *os)
if(!(sh_found)) {
itadmin_netdocu_write_netgroup_member_longtable(job, os);
} sh_found = 1;
- itadmin_netdocu_write_netgroup_member_host(job, os, ng, ho, 1);
+ itadmin_netdocu_write_netgroup_member_host(job, os, ho, 1);
}
}
dk3sto_it_reset(job->i_ho);
@@ -882,7 +910,7 @@ itadmin_netdocu_write_netgroups(itadmin_job *job, dk3_stream_t *os)
if(!(sh_found)) {
itadmin_netdocu_write_netgroup_member_longtable(job, os);
} sh_found = 1;
- itadmin_netdocu_write_netgroup_member_host(job, os, ng, ho, 0);
+ itadmin_netdocu_write_netgroup_member_host(job, os, ho, 0);
}
}
if(sh_found) {
@@ -1048,13 +1076,13 @@ itadmin_netdocu_write_patches(itadmin_job *job, dk3_stream_t *os)
int ie;
-#line 1016 "itanetd.ctr"
+#line 1060 "itanetd.ctr"
ie = dk3app_get_encoding(job->app);
dk3sto_it_reset(job->i_pa);
while(NULL != (co = (itadmin_connect *)dk3sto_it_next(job->i_pa))) {
if(is_first) {
-#line 1020 "itanetd.ctr"
+#line 1064 "itanetd.ctr"
/* Section patches */
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[12]);
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[42], ie);
@@ -1129,19 +1157,19 @@ itadmin_netdocu_write_patches(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
} is_first = 0;
-#line 1093 "itanetd.ctr"
+#line 1137 "itanetd.ctr"
/* Horitontal line */
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[35]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
/* Dose */
-#line 1098 "itanetd.ctr"
+#line 1142 "itanetd.ctr"
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, co->s);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[24]);
/* Gebaeude + Raum */
-#line 1101 "itanetd.ctr"
+#line 1145 "itanetd.ctr"
if(co->bu) {
if((co->bu)->s) {
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, (co->bu)->s);
@@ -1162,7 +1190,7 @@ itadmin_netdocu_write_patches(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[24]);
/* VLAN */
-#line 1120 "itanetd.ctr"
+#line 1164 "itanetd.ctr"
if(co->vl) {
if((co->vl)->s) {
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, (co->vl)->s);
@@ -1171,7 +1199,7 @@ itadmin_netdocu_write_patches(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[24]);
/* Speed */
-#line 1127 "itanetd.ctr"
+#line 1171 "itanetd.ctr"
if(co->sp) {
if((co->sp)->s) {
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, (co->sp)->s);
@@ -1180,7 +1208,7 @@ itadmin_netdocu_write_patches(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[24]);
/* Hub port */
-#line 1134 "itanetd.ctr"
+#line 1178 "itanetd.ctr"
if(co->hp) {
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, co->hp);
}
@@ -1188,13 +1216,13 @@ itadmin_netdocu_write_patches(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
}
-#line 1140 "itanetd.ctr"
+#line 1184 "itanetd.ctr"
if(!(is_first)) {
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[32]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
}
-#line 1144 "itanetd.ctr"
+#line 1188 "itanetd.ctr"
}
@@ -1227,14 +1255,14 @@ itadmin_netdocu_write_file(itadmin_job *job, dk3_stream_t *os)
int ie;
ie = dk3app_get_encoding(job->app);
if(job->ukoma) {
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start1a);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start1a);
} else {
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start1b);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start1b);
}
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
dk3stream_strputs(os, (job->msg)[2], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start4);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start4);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[4]);
dk3stream_strputs(os, (job->msg)[0], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[5]);
@@ -1251,7 +1279,7 @@ itadmin_netdocu_write_file(itadmin_job *job, dk3_stream_t *os)
}
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[8]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start2);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start2);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[10]);
dk3stream_strputs(os, (job->msg)[0], ie);
@@ -1264,12 +1292,12 @@ itadmin_netdocu_write_file(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
}
if(job->ukoma) {
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start3a);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start3a);
}
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start3);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start3);
itadmin_netdocu_write_contents(job, os);
dk3uc2lat_final_report(job->uc2l, os);
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_end);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_end);
}
@@ -1282,23 +1310,23 @@ itadmin_netdocu(itadmin_job *job)
int back = 0;
-#line 1230 "itanetd.ctr"
+#line 1274 "itanetd.ctr"
fipo = dk3sf_c8_fopen_app(
itadmin_netdocu_c8_kw[3], itadmin_netdocu_c8_kw[2], job->app
);
if(fipo) {
-#line 1234 "itanetd.ctr"
+#line 1278 "itanetd.ctr"
os = dk3stream_open_file_app(fipo, DK3_STREAM_FLAG_WRITE, job->app);
if(os) {
-#line 1236 "itanetd.ctr"
+#line 1280 "itanetd.ctr"
itadmin_netdocu_write_file(job, os);
dk3stream_close(os);
back = 1;
} else {
-#line 1240 "itanetd.ctr"
+#line 1284 "itanetd.ctr"
}
#if DK3_CHAR_SIZE == 1
if(!dk3sf_fclose_fn_app(fipo, itadmin_netdocu_c8_kw[3], job->app)) {
@@ -1311,11 +1339,11 @@ itadmin_netdocu(itadmin_job *job)
#endif
} else {
-#line 1251 "itanetd.ctr"
+#line 1295 "itanetd.ctr"
}
-#line 1253 "itanetd.ctr"
+#line 1297 "itanetd.ctr"
return back;
}
diff --git a/support/dktools/itanetd.ctr b/support/dktools/itanetd.ctr
index ac4dd40165..4b01dc82d8 100644
--- a/support/dktools/itanetd.ctr
+++ b/support/dktools/itanetd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -56,7 +56,7 @@ pdfauthor={
#
# 8: pdfcreator
#
-pdfcreator={itadmin - http://dktools.sourceforge.net/}
+pdfcreator={itadmin - http://sourceforge.net/p/dktools/wiki/itadmin/}
#
# 9: Author
#
@@ -386,7 +386,20 @@ itadmin_netdocu_write_one_host(
} else {
if(host->fgu) {
switch(host->fgu) {
+ case 1: { $? ". bring your own device"
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[28], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[24], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[310], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ } break;
case 2: { $? ". host outside organization unit"
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[28], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[25], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[26], ie);
@@ -396,22 +409,55 @@ itadmin_netdocu_write_one_host(
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
} break;
case 3: { $? ". dynamic IP address"
- dk3uc2lat_stputs(job->uc2l, os, (job->msg)[28], ie);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[23], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[311], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[312], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
} break;
case 4: { $? ". additional network interface"
- dk3uc2lat_stputs(job->uc2l, os, (job->msg)[31], ie);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[23], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[313], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[312], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
} break;
- default: { $? ". bring your own device"
+ case 5: { $? ". network interface of non-computer device"
dk3uc2lat_stputs(job->uc2l, os, (job->msg)[23], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
- dk3uc2lat_stputs(job->uc2l, os, (job->msg)[24], ie);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[315], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[316], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[317], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
} break;
+ case 6: { $? ". Reserved IP address and host name"
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[23], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[318], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[319], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[320], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ } break;
+ case 7: {
+ dk3uc2lat_stputs(job->uc2l, os, (job->msg)[320], ie);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[20]);
+ dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
+ } break;
+ default : { $? "! unexpected value"
+ } break;
}
}
}
@@ -423,9 +469,9 @@ itadmin_netdocu_write_one_host(
$? ". before user"
if(host->un) {
itadmin_tool_table_line_start(job, os, 10);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
itadmin_tool_write_user_latex_long(job, os, host->un);
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
} else {
if(!(host->fgu)) {
itadmin_tool_table_line(job, os, 10, NULL, 1, 0);
@@ -435,7 +481,7 @@ itadmin_netdocu_write_one_host(
itadmin_tool_table_line(job, os, 6, host->co, 1, 0);
/* Ort (Gebaeude und Raum) */ $? ". before building"
itadmin_tool_table_line_start(job, os, 11);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
if(host->bu) {
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, (host->bu)->s);
if(host->room) {
@@ -449,16 +495,16 @@ itadmin_netdocu_write_one_host(
itadmin_tool_table_line_no_data(job, os, 1);
}
} $? ". after building"
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
itadmin_tool_table_line(job, os, 7, host->inv, 1, 0);
itadmin_tool_table_line(job, os, 8, host->serno, 1, 1);
itadmin_tool_table_section_header(job, os, 12);
if(host->ipv4) {
itadmin_tool_table_line_start(job, os, 13);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
itadmin_tool_stream_ip(os, host->ipv4);
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
if(host->dnsd) {
itadmin_tool_table_line(job, os, 14, host->dnsd, 0, 0);
}
@@ -535,17 +581,17 @@ itadmin_netdocu_write_byod_host(
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
if(host->un) {
itadmin_tool_table_line_start(job, os, 10);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
itadmin_tool_write_user_latex_long(job, os, host->un);
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
} else {
}
itadmin_tool_table_line(job, os, 6, host->co, 1, 0);
if(host->ipv4) {
itadmin_tool_table_line_start(job, os, 13);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
itadmin_tool_stream_ip(os, host->ipv4);
- itadmin_tool_table_line_finish(job, os, 0);
+ itadmin_tool_table_line_finish(os, 0);
} else {
if(!(host->dc)) {
itadmin_tool_table_line(job, os, 13, NULL, 1, 0);
@@ -706,7 +752,6 @@ itadmin_netdocu_write_netgroup_member_longtable(
/** Write one member host to longtable.
@param job Job structure.
@param os Output stream.
- @param ng Netgroup.
@param ho Host.
@param f_d Flag: Direct member (write bold).
*/
@@ -715,7 +760,6 @@ void
itadmin_netdocu_write_netgroup_member_host(
itadmin_job *job,
dk3_stream_t *os,
- itadmin_netgroup *ng,
itadmin_host *ho,
int f_d
)
@@ -839,7 +883,7 @@ itadmin_netdocu_write_netgroups(itadmin_job *job, dk3_stream_t *os)
if(!(sh_found)) {
itadmin_netdocu_write_netgroup_member_longtable(job, os);
} sh_found = 1;
- itadmin_netdocu_write_netgroup_member_host(job, os, ng, ho, 1);
+ itadmin_netdocu_write_netgroup_member_host(job, os, ho, 1);
}
}
dk3sto_it_reset(job->i_ho);
@@ -848,7 +892,7 @@ itadmin_netdocu_write_netgroups(itadmin_job *job, dk3_stream_t *os)
if(!(sh_found)) {
itadmin_netdocu_write_netgroup_member_longtable(job, os);
} sh_found = 1;
- itadmin_netdocu_write_netgroup_member_host(job, os, ng, ho, 0);
+ itadmin_netdocu_write_netgroup_member_host(job, os, ho, 0);
}
}
if(sh_found) {
@@ -1173,14 +1217,14 @@ itadmin_netdocu_write_file(itadmin_job *job, dk3_stream_t *os)
int ie;
ie = dk3app_get_encoding(job->app);
if(job->ukoma) {
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start1a);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start1a);
} else {
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start1b);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start1b);
}
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
dk3stream_strputs(os, (job->msg)[2], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start4);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start4);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[4]);
dk3stream_strputs(os, (job->msg)[0], ie);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[5]);
@@ -1197,7 +1241,7 @@ itadmin_netdocu_write_file(itadmin_job *job, dk3_stream_t *os)
}
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[8]);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start2);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start2);
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[10]);
dk3stream_strputs(os, (job->msg)[0], ie);
@@ -1210,12 +1254,12 @@ itadmin_netdocu_write_file(itadmin_job *job, dk3_stream_t *os)
dk3stream_c8_fputs(os, itadmin_netdocu_c8_kw[0]);
}
if(job->ukoma) {
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start3a);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start3a);
}
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_start3);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_start3);
itadmin_netdocu_write_contents(job, os);
dk3uc2lat_final_report(job->uc2l, os);
- itadmin_tool_write_section(job, os, itadmin_netdocu_file_end);
+ itadmin_tool_write_section(os, itadmin_netdocu_file_end);
}
diff --git a/support/dktools/itange.c b/support/dktools/itange.c
index 0d79c75901..b5299c0013 100644
--- a/support/dktools/itange.c
+++ b/support/dktools/itange.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itange.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itange.ctr
*/
/** @file itange.c The itange module.
diff --git a/support/dktools/itange.ctr b/support/dktools/itange.ctr
index 30ae02b546..f686d28fa2 100644
--- a/support/dktools/itange.ctr
+++ b/support/dktools/itange.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/itareg.c b/support/dktools/itareg.c
index 76c534b978..59a053fa2e 100644
--- a/support/dktools/itareg.c
+++ b/support/dktools/itareg.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itareg.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itareg.ctr
*/
/** @file itareg.c The itareg module.
@@ -141,12 +119,12 @@ itadmin_register_check_ip(char const *ip)
/** Correct a MAC address (Windows notation to normal notation).
- @param job Job structure.
@param mac Text buffer to modify.
@return 1 for valid MAC address found, 0 for invalid source text.
*/
+static
int
-itadmin_register_correct_mac(itadmin_job *job, char *mac)
+itadmin_register_correct_mac(char *mac)
{
char *p1;
char *p2;
@@ -1349,7 +1327,7 @@ itadmin_register_host(
#line 1080 "itareg.ctr"
dk3str_c8_cpy_not_overlapped(maca, co_mc);
- if(!itadmin_register_correct_mac(job, maca)) {
+ if(!itadmin_register_correct_mac(maca)) {
back = 0;
#line 1083 "itareg.ctr"
@@ -2121,10 +2099,7 @@ itadmin_register_license(
char const *co_s,
char const *lt_s,
char const *li_no,
- char const *sr_s,
- itadmin_date *li_dd,
char const *li_nd,
- itadmin_date *li_di,
char const *li_ni
)
{
@@ -2179,7 +2154,7 @@ itadmin_register_license(
if(back) {
back = 0;
li = itadmin_mem_license_new(
- job, pk, li_on, li_no, li_dd, li_nd, li_di, li_ni, sp, lt, us, co
+ job, pk, li_on, li_no, li_nd, li_ni, sp, lt, us, co
);
if(li) {
if(dk3sto_add(job->s_lc, (void *)li)) {
diff --git a/support/dktools/itareg.ctr b/support/dktools/itareg.ctr
index 6dd72164e7..e10e85f88a 100644
--- a/support/dktools/itareg.ctr
+++ b/support/dktools/itareg.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -94,12 +94,12 @@ itadmin_register_check_ip(char const *ip)
/** Correct a MAC address (Windows notation to normal notation).
- @param job Job structure.
@param mac Text buffer to modify.
@return 1 for valid MAC address found, 0 for invalid source text.
*/
+static
int
-itadmin_register_correct_mac(itadmin_job *job, char *mac)
+itadmin_register_correct_mac(char *mac)
{
char *p1;
char *p2;
@@ -1078,7 +1078,7 @@ itadmin_register_host(
if(co_mc) { $? ". inspect mac"
if(dk3str_c8_len(co_mc) < sizeof(maca)) { $? ". length ok"
dk3str_c8_cpy_not_overlapped(maca, co_mc);
- if(!itadmin_register_correct_mac(job, maca)) {
+ if(!itadmin_register_correct_mac(maca)) {
back = 0; $? "! correction"
/* ERROR: Illegal MAC address! */
itadmin_tool_log_utf8_3(job, DK3_LL_ERROR, 221, 222, co_mc);
@@ -1748,10 +1748,7 @@ itadmin_register_license(
char const *co_s,
char const *lt_s,
char const *li_no,
- char const *sr_s,
- itadmin_date *li_dd,
char const *li_nd,
- itadmin_date *li_di,
char const *li_ni
)
{
@@ -1806,7 +1803,7 @@ itadmin_register_license(
if(back) {
back = 0;
li = itadmin_mem_license_new(
- job, pk, li_on, li_no, li_dd, li_nd, li_di, li_ni, sp, lt, us, co
+ job, pk, li_on, li_no, li_nd, li_ni, sp, lt, us, co
);
if(li) {
if(dk3sto_add(job->s_lc, (void *)li)) {
diff --git a/support/dktools/itatool.c b/support/dktools/itatool.c
index 3a9ec21f65..dda5cd3377 100644
--- a/support/dktools/itatool.c
+++ b/support/dktools/itatool.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: itatool.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: itatool.ctr
*/
/** @file itatool.c The itatool module.
@@ -296,7 +274,6 @@ itadmin_tool_table_line_start(
void
itadmin_tool_table_line_sep_rows(
- itadmin_job *job,
dk3_stream_t *os
)
{
@@ -307,7 +284,6 @@ itadmin_tool_table_line_sep_rows(
void
itadmin_tool_table_line_finish(
- itadmin_job *job,
dk3_stream_t *os,
int pb
)
@@ -347,13 +323,13 @@ itadmin_tool_table_line(
)
{
itadmin_tool_table_line_start(job, os, kwi);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
if(det) {
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, det);
} else {
itadmin_tool_table_line_no_data(job, os, nu);
}
- itadmin_tool_table_line_finish(job, os, pb);
+ itadmin_tool_table_line_finish(os, pb);
}
@@ -406,7 +382,6 @@ itadmin_tool_check_same_user(itadmin_user *us, itadmin_host *co)
void
itadmin_tool_write_section(
- itadmin_job *job,
dk3_stream_t *os,
char const * const *sect
)
diff --git a/support/dktools/itatool.ctr b/support/dktools/itatool.ctr
index 4f74db09a8..a01565565f 100644
--- a/support/dktools/itatool.ctr
+++ b/support/dktools/itatool.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -270,7 +270,6 @@ itadmin_tool_table_line_start(
void
itadmin_tool_table_line_sep_rows(
- itadmin_job *job,
dk3_stream_t *os
)
{
@@ -281,7 +280,6 @@ itadmin_tool_table_line_sep_rows(
void
itadmin_tool_table_line_finish(
- itadmin_job *job,
dk3_stream_t *os,
int pb
)
@@ -321,13 +319,13 @@ itadmin_tool_table_line(
)
{
itadmin_tool_table_line_start(job, os, kwi);
- itadmin_tool_table_line_sep_rows(job, os);
+ itadmin_tool_table_line_sep_rows(os);
if(det) {
dk3uc2lat_c8_utf8_stputs(job->uc2l, os, det);
} else {
itadmin_tool_table_line_no_data(job, os, nu);
}
- itadmin_tool_table_line_finish(job, os, pb);
+ itadmin_tool_table_line_finish(os, pb);
}
@@ -380,7 +378,6 @@ itadmin_tool_check_same_user(itadmin_user *us, itadmin_host *co)
void
itadmin_tool_write_section(
- itadmin_job *job,
dk3_stream_t *os,
char const * const *sect
)
diff --git a/support/dktools/libdk4base.dox b/support/dktools/libdk4base.dox
index 9c66dc5eef..6256cc6f6b 100644
--- a/support/dktools/libdk4base.dox
+++ b/support/dktools/libdk4base.dox
@@ -16,6 +16,5 @@ dk4memcpl.h | Copy in overlapping memory ranges.
dk4str8.h | String functions for char strings.
dk4strw.h | String functions for wchar_t strings.
dk4strd.h | String functions for dkChar strings.
-dk4numl.h | Get string length required to show a number.
*/
diff --git a/support/dktools/libdk4bif.dox b/support/dktools/libdk4bif.dox
new file mode 100644
index 0000000000..97af207055
--- /dev/null
+++ b/support/dktools/libdk4bif.dox
@@ -0,0 +1,17 @@
+/** @page libdk4bif libdk4bif
+
+The libdk4bif library provides a unique API to read PNG, JPEG, NetPBM
+and TIFF files. It uses the specialized libraries libpng, libjpeg and libtiff
+but users do not need to care about the details of these libraries.
+
+The following header files provide the API functions:
+
+Header | Purpose
+:----: | :-----:
+dk4bif.h | Read image from file, return pointer to new dk4_bif_t structure, access image information.
+dk4bifa.h | Image analysis.
+dk4cs.h | Pixel conversion between different color spaces.
+dk4pxres.h | Resample pixel components to different bit depth.
+dk4pxbit.h | Bit constants.
+
+*/
diff --git a/support/dktools/libdk4bifap.dox b/support/dktools/libdk4bifap.dox
new file mode 100644
index 0000000000..4b5bc9fc9a
--- /dev/null
+++ b/support/dktools/libdk4bifap.dox
@@ -0,0 +1,7 @@
+/** @page libdk4bifap libdk4bifap
+
+The libdk4bifap library provides some replacement functions for
+libdk4bif functions containing dk4_app_t support, so the functions
+can write diagnostic messages when an error occurs.
+All functions are listed in the dk4bifap.h header file.
+*/
diff --git a/support/dktools/libdk4c.dox b/support/dktools/libdk4c.dox
index aa1d9321f7..968e32ab20 100644
--- a/support/dktools/libdk4c.dox
+++ b/support/dktools/libdk4c.dox
@@ -57,6 +57,7 @@ dk4getcwdd.h | Get current working directory as dkChar string.
dk4path8.h | Path names in char texts.
dk4pathw.h | Path names in wchar_t texts.
dk4pathd.h | Path names in dkChar texts.
+dk4mm.h | Check whether a rebuild is necessary to produce a destination file from source file.
dk4fopc8.h | Open file specified as char path name, additional security checks.
dk4fopwc.h | Open file specified as wchar_t path name, additional security checks.
dk4fopd.h | Open file specified as dkChar path name, additional security checks.
@@ -205,8 +206,12 @@ dk4strmo32.h | Write 32-bit char strings to stream, recode if necessary.
dk4strmodk.h | Write dkChar strings to stream, recode if necessary.
dk4strms.h | Serialize (write) data to stream.
dk4strmu.h | Unserialize (read) data from stream.
+dk4serf.h | Serialize (write) data to file.
+dk4userf.h | Unserialize (read) data from file.
dk4c8dbl.h | Write double value to dk4_stream_t or FILE without scientific notation.
+dk4mao8dns.h | Write double value to dk4_stream_t without scientific notation. Write 0 for very small absolute values.
dk4strmco.h | Build a compressing and encoding stream on top of an existring stream.
+dk4lzwe.h | LZW compression support for the dk4strmco module
@section secdk4membs Memory buffers
@@ -223,12 +228,19 @@ Header | Purpose
dk4bf.h | Bit field and bit arrays.
dk4bitsh.h | Bit shifter (generates bytes from a sequence of bits).
-@section secdk4math Mathematics
+@section secdk4math Mathematical operations
Header | Purpose
:----: | :------
dk4fpe.h | Access the FPU status.
+@section secdk4iter Numerical iterations
+
+Header | Purpose
+:----: | :------
+dk4iter.h | Root finding
+dk4itmin.h | Minimum search for unimodal function on interval
+
@section secdk4mdch Message digests and checksums
Header | Purpose
diff --git a/support/dktools/libdk4gra.dox b/support/dktools/libdk4gra.dox
new file mode 100644
index 0000000000..d4dc3bd077
--- /dev/null
+++ b/support/dktools/libdk4gra.dox
@@ -0,0 +1,19 @@
+/** @page libdk4gra libdk4gra
+
+The libdk4gra library creates PDF, (E)PS and PGF graphics.
+For PDF, PS and EPS it provides only non-text operations, for PGF output
+text operations are available.
+
+The library API is available in the following header files:
+
+Header | Purpose
+:----: | :-----:
+dk4gra.h | Opening, writing and closing dk4_gra_t structures, drawing operations.
+dk4grco.h | Configure graphics output details.
+dk4paper.h | Paper sizes.
+dk4bb.h | Bounding boxes for drawing operations.
+dk4bb32.h | Bounding boxes containing int32_t coordinates.
+dk4font.h | Information about fonts.
+dk4xsp.h | X-splines.
+
+*/
diff --git a/support/dktools/libdk4graa.dox b/support/dktools/libdk4graa.dox
new file mode 100644
index 0000000000..61df528f1f
--- /dev/null
+++ b/support/dktools/libdk4graa.dox
@@ -0,0 +1,15 @@
+/** @page libdk4graa libdk4graa
+
+The libdk4graa library provides some replacement functions for
+libdk4gra functions containing dk4_app_t support, so the functions
+can write diagnostic messages when an error occurs.
+
+The API is defined in the following header files:
+
+Header | Purpose
+:----: | :-----:
+dk4graa.h | Opening, writing and closing graphics, drawing operations.
+dk4papea.h | Retrieving paper size information.
+dk4grcoa.h | Processing configuration files to set up graphics output details.
+
+*/
diff --git a/support/dktools/libdk4ma.dox b/support/dktools/libdk4ma.dox
index 3aa7bdc989..af5899564d 100644
--- a/support/dktools/libdk4ma.dox
+++ b/support/dktools/libdk4ma.dox
@@ -24,6 +24,10 @@ intmax_t | dk4maami.h | dk4ma_intmax_t_add()
uintmax_t | dk4maamu.h | dk4ma_uintmax_t_add()
dk4_im_t | dk4maadi.h | dk4ma_im_add()
dk4_um_t | dk4maadu.h | dk4ma_um_add()
+int16_t | dk4maai16.h | dk4ma_int16_t_add()
+uint16_t | dk4maau16.h | dk4ma_uint16_t_add()
+int32_t | dk4maai32.h | dk4ma_int32_t_add()
+uint32_t | dk4maau32.h | dk4ma_uint32_t_add()
@section mathcomp Comparisons
@@ -38,5 +42,13 @@ long / unsigned long | dk4macl.h | dk4ma_long_compare()
long long / unsigned long long | dk4macll.h | dk4ma_long_long_compare()
intmax_t / uintmax_t | dk4macm.h | dk4ma_intmax_t_compare()
dk4_im_t / dk4_um_t | dk4macd.h | dk4ma_im_compare()
+int16_t / uint16_t | dk4maci16.h | dk4ma_int16_t_compare()
+int32_t / uint32_t | dk4maci32.h | dk4ma_int32_t_compare()
+
+@section numlength String length for number representation
+
+Header | Function | Purpose
+:----: | :------: | :------
+dk4numl.h | dk4numlength() | Get string length required to show a number.
*/
diff --git a/support/dktools/libdk4maioxd.dox b/support/dktools/libdk4maioxd.dox
new file mode 100644
index 0000000000..92f6dfeb0f
--- /dev/null
+++ b/support/dktools/libdk4maioxd.dox
@@ -0,0 +1,39 @@
+/** @page libdk4maioxd libdk4maioxd
+
+@section secinputxd Convert text to number
+
+Retrieve integer or double number from wxChar text in decimal notation.
+
+Data type | Header | Function
+:-------: | :----: | :-------
+char | dk4maixdic.h | dk4ma_input_wx_dec_char()
+unsigned char | dk4maixduc.h | dk4ma_input_wx_dec_uchar()
+short | dk4maixdis.h | dk4ma_input_wx_dec_short()
+unsigned short | dk4maixdus.h | dk4ma_input_wx_dec_ushort()
+int | dk4maixdii.h | dk4ma_input_wx_dec_int()
+unsigned | dk4maixdui.h | dk4ma_input_wx_dec_uint()
+long | dk4maixdil.h | dk4ma_input_wx_dec_long()
+unsigned long | dk4maixdul.h | dk4ma_input_wx_dec_ulong()
+size_t | dk4maixdsz.h | dk4ma_input_wx_dec_size_t()
+long long | dk4maixdli.h | dk4ma_input_wx_dec_ll()
+unsigned long long | dk4maixdlu.h | dk4ma_input_wx_dec_ull()
+intmax_t | dk4maixdmi.h | dk4ma_input_wx_dec_intmax_t()
+uintmax_t | dk4maixdmu.h | dk4ma_input_wx_dec_uintmax_t()
+dk4_im_t | dk4maixddi.h | dk4ma_input_wx_dec_dk4_im_t()
+dk4_um_t | dk4maixddu.h | dk4ma_input_wx_dec_dk4_um_t()
+double | dk4maixdbl.h | dk4ma_input_wx_double()
+
+@section secioutputxd Convert number to text
+
+Convert integer or double number to wxChar text in decimal notation.
+
+Data type | Header | Function
+:-------: | :----: | :-------
+dk4_im_t | dk4maoxd.h | dk4ma_write_wx_decimal_unsigned()
+dk4_um_t | dk4maoxd.h | dk4ma_write_wx_decimal_signed()
+double | dk4maoxdbl.h | dk4ma_write_wx_double()
+
+You can cast all other signed integer values to dk4_im_t and all other
+unsigned integer values to dk4_um_t without loss.
+
+*/
diff --git a/support/dktools/libdk4pppt.dox b/support/dktools/libdk4pppt.dox
deleted file mode 100644
index 401997d489..0000000000
--- a/support/dktools/libdk4pppt.dox
+++ /dev/null
@@ -1,7 +0,0 @@
-/** @page libdk4pppt libdk4pppt
-
-Header/module | Purpose
-:-----------: | :-----:
-dk4paper.h | Paper configuration (retrieve size for a given paper name).
-
-*/
diff --git a/support/dktools/libdk4wx.dox b/support/dktools/libdk4wx.dox
index f5c24b10e4..0307ef176d 100644
--- a/support/dktools/libdk4wx.dox
+++ b/support/dktools/libdk4wx.dox
@@ -16,8 +16,13 @@ Dk4WxApplicationHelper.h | Dk4WxApplicationHelper | General tool functions.
Dk4WxHelpController.h | Dk4WxHelpController | Load help file, either *.htb (non-Windows platforms) or *.chm (Windows platforms).
Dk4WxFrame.h | Dk4WxFrame | Base class for top level windows.
Dk4WxControl.h | Dk4WxControl | Base class for control elements.
+Dk4WxColourView.h | Dk4WxColourView | Show a configured colour.
+Dk4WxColourPalette.h | Dk4WxColourPalette | Choose a colour from a palette.
+Dk4WxYesNoDialog.h | Dk4WxYesNoDialog | Message box for yes/no decisions.
Dk4WxProgressDialog.h | Dk4WxProgressDialog | Progress dialog.
Dk4WxAutostartController.h | Dk4WxAutostartController | Controller to autostart some functionality on first idle event.
+Dk4WxProcessingController.h | Dk4WxProcessingController | Avoid parallel processing of code using the same variables.
Dk4WxProgressControllerBase.h | Dk4WxProgressControllerWorkerBase | Base class for progress controllers interface to worker thread.
Dk4WxProgressControllerBase.h | Dk4WxProgressControllerOwnerBase | Progress controllers interface to event processing (main) thread.
+
*/
diff --git a/support/dktools/livesys-data/apt-disklessian-buster.txt b/support/dktools/livesys-data/apt-disklessian-buster.txt
new file mode 100644
index 0000000000..5bd803ba1e
--- /dev/null
+++ b/support/dktools/livesys-data/apt-disklessian-buster.txt
@@ -0,0 +1,2 @@
+deb http://127.0.0.1/debian/repo/ buster main
+
diff --git a/support/dktools/livesys-data/apt-disklessian-jessie.txt b/support/dktools/livesys-data/apt-disklessian-jessie.txt
new file mode 100644
index 0000000000..3ea6597eb1
--- /dev/null
+++ b/support/dktools/livesys-data/apt-disklessian-jessie.txt
@@ -0,0 +1,2 @@
+deb http://127.0.0.1/debian/repo/ jessie main
+
diff --git a/support/dktools/livesys-data/apt-disklessian-stretch.txt b/support/dktools/livesys-data/apt-disklessian-stretch.txt
new file mode 100644
index 0000000000..994a66d6b8
--- /dev/null
+++ b/support/dktools/livesys-data/apt-disklessian-stretch.txt
@@ -0,0 +1,2 @@
+deb http://127.0.0.1/debian/repo/ stretch main
+
diff --git a/support/dktools/livesys-data/apt-pinning.txt b/support/dktools/livesys-data/apt-no-lo-recommended.txt
index 83792c4572..4ef998f55c 100644
--- a/support/dktools/livesys-data/apt-pinning.txt
+++ b/support/dktools/livesys-data/apt-no-lo-recommended.txt
@@ -18,3 +18,6 @@ Package: aspell-*
Pin: version *
Pin-Priority: -1
+Package: gnome-contacts
+Pin: version *
+Pin-Priority: -1
diff --git a/support/dktools/livesys-data/apt-pin-kernel.txt b/support/dktools/livesys-data/apt-pin-kernel.txt
new file mode 100644
index 0000000000..1d2d9725fb
--- /dev/null
+++ b/support/dktools/livesys-data/apt-pin-kernel.txt
@@ -0,0 +1,8 @@
+Package: linux-image-*
+Pin: version *-no-hd*
+Pin-Priority: 1001
+
+Package: linux-modules-*
+Pin: version *-no-hd*
+Pin-Priority: 1001
+
diff --git a/support/dktools/livesys-data/apt_pinning.txt b/support/dktools/livesys-data/apt_pinning.txt
deleted file mode 100644
index 139597f9cb..0000000000
--- a/support/dktools/livesys-data/apt_pinning.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/support/dktools/livesys-data/conf-gnome-dconf-profile-user.txt b/support/dktools/livesys-data/conf-gnome-dconf-profile-user.txt
new file mode 100644
index 0000000000..84923a04f7
--- /dev/null
+++ b/support/dktools/livesys-data/conf-gnome-dconf-profile-user.txt
@@ -0,0 +1,3 @@
+user-db:user
+system-db:local
+system-db:site
diff --git a/support/dktools/livesys-data/conf-gnome-defaults.txt b/support/dktools/livesys-data/conf-gnome-defaults.txt
new file mode 100644
index 0000000000..ff0403e37d
--- /dev/null
+++ b/support/dktools/livesys-data/conf-gnome-defaults.txt
@@ -0,0 +1,18 @@
+[org/gnome/desktop/background]
+show-desktop-icons=true
+
+[org/gnome/desktop/interface]
+clock-show-date=true
+
+[org/gnome/desktop/notifications]
+application-children=['org-gnome-software']
+
+[org/gnome/desktop/wm/preferences]
+button-layout='appmenu:minimize,maximize,close'
+
+[org/gnome/shell]
+enabled-extensions=['apps-menu@gnome-shell-extensions.gcampax.github.com', 'native-window-placement@gnome-shell-extensions.gcampax.github.com', 'drive-menu@gnome-shell-extensions.gcampax.github.com', 'window-list@gnome-shell-extensions.gcampax.github.com']
+
+[org/gnome/shell/overrides]
+dynamic-workspaces=false
+
diff --git a/support/dktools/livesys-data/hook_autologin.txt b/support/dktools/livesys-data/hook_autologin.txt
deleted file mode 100755
index 986086d133..0000000000
--- a/support/dktools/livesys-data/hook_autologin.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh
-echo HOOK chroot hook_autologin.txt
-# mkdir -pv /etc/systemd/system/getty@tty1.service.d
-# cp /usr/share/dktoolian/autologin.conf /etc/systemd/system/getty@tty1.service.d
-# chmod 644 /etc/systemd/system/getty@tty1.service.d/autologin.conf
-# if [ -f /etc/inittab -a -f /usr/share/dktoolian/inittab.sed ]
-# then
-# sed -i -f /usr/share/dktoolian/inittab.sed /etc/inittab
-# fi
-
-# SVCS="console-getty container-getty@ getty@ serial-getty@"
-SVCS="getty@"
-for s in ${SVCS}
-do
- sed -i -f /usr/share/dktoolian/getty.sed "/lib/systemd/system/${s}.service"
-done
-rm -fr /usr/share/dktoolian/getty.sed
-
diff --git a/support/dktools/livesys-data/hook_bootbeep.txt b/support/dktools/livesys-data/hook_bootbeep.txt
deleted file mode 100644
index a8a550e4c4..0000000000
--- a/support/dktools/livesys-data/hook_bootbeep.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-if [ -f "${DIR}/livesys/binary/isolinux/menu.cfg" -a -f "${DIR}/livesys/config/includes.chroot/usr/share/dktoolian/nobeep.sed" ]
-then
- sed -i -f "${DIR}/livesys/config/includes.chroot/usr/share/dktoolian/nobeep.sed" "${DIR}/livesys/binary/isolinux/menu.cfg"
-fi
-
diff --git a/support/dktools/livesys-data/hook_etcfiles.txt b/support/dktools/livesys-data/hook_etcfiles.txt
deleted file mode 100755
index b02ed3ae19..0000000000
--- a/support/dktools/livesys-data/hook_etcfiles.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh
-#
-# Copy files from /usr/share/dktoolian/etc to /etc
-#
-echo HOOK chroot hook_etcfiles.txt
-if [ -d /usr/share/dktoolian/etc ]
-then
- cd /usr/share/dktoolian/etc
- for i in `find . -type d`
- do
- [ -d "/etc/$i" ] || ( mkdir "/etc/$i" ; chmod 755 "/etc/$i" )
- done
- for i in `find . -type f`
- do
- cp "$i" "/etc/$i"
- done
-fi
-
diff --git a/support/dktools/livesys-data/livesys-build-kernel.sh b/support/dktools/livesys-data/livesys-build-kernel.sh
new file mode 100755
index 0000000000..569e2f643b
--- /dev/null
+++ b/support/dktools/livesys-data/livesys-build-kernel.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+# 486 or amd64
+ARCHITECTURE="amd64"
+
+(
+ echo Start
+ date
+ make -j 2 deb-pkg LOCALVERSION="-no-hd-${ARCHITECTURE}" KDEB_PKGVERSION=$(make kernelversion)-1
+ echo Finished
+ date
+) 2>&1 | tee ../errors
+
diff --git a/support/dktools/livesys-data/livesys-repository.sh b/support/dktools/livesys-data/livesys-repository.sh
new file mode 100755
index 0000000000..c5326b96a6
--- /dev/null
+++ b/support/dktools/livesys-data/livesys-repository.sh
@@ -0,0 +1,75 @@
+#! /bin/sh
+
+# i386 or amd64
+ARCHITECTURE="amd64"
+
+REPOSITORY_BASE="/var/www/html/debian"
+
+DEBVERSMAJ=`cat /etc/debian_version | cut -f 1 -d .`
+
+CODENAME=buster
+if [ "X$DEBVERSMAJ" = "X9" ]
+then
+ echo 'On Debian Stretch.'
+ CODENAME=stretch
+fi
+if [ "X$DEBVERSMAJ" = "X8" ]
+then
+ echo 'On Debian Jessie.'
+ CODENAME=jessie
+fi
+
+if [ "X$DEB_SIGN_KEYID" = "X" ]
+then
+ echo 'W: Environment variable DEB_SIGN_KEYID not set!'
+ # exit 1
+fi
+
+echo Remove old repository directory
+[ ! -d "${REPOSITORY_BASE}/repo" ] || rm -fr "${REPOSITORY_BASE}/repo"
+
+echo Create new repository directory
+[ -d "${REPOSITORY_BASE}" ] || mkdir -p "${REPOSITORY_BASE}"
+mkdir -p "${REPOSITORY_BASE}/repo"
+
+echo Create conf subdirectory
+mkdir -p "${REPOSITORY_BASE}/repo/conf"
+
+cat - > "${REPOSITORY_BASE}/repo/conf/distributions" <<EOF
+Origin: DKdisklessian
+Label: DKdisklessian
+Codename: $CODENAME
+Suite: stable
+Architectures: $ARCHITECTURE
+Components: main
+EOF
+
+if [ "X$DEB_SIGN_KEYID" != "X" ]
+then
+ echo "SignWith: $DEB_SIGN_KEYID" >> "${REPOSITORY_BASE}/repo/conf/distributions"
+fi
+
+# Create directory structure
+echo Create directory structure in "${REPOSITORY_BASE}"
+reprepro -b "${REPOSITORY_BASE}/repo" createsymlinks
+
+# Create options file
+# cat - > "${REPOSITORY_BASE}/repo/conf/options" <<EOF
+# verbose
+# basedir $REPOSITORY_BASE
+# ask-passphrase
+# EOF
+
+# Add kernel ##### CONTINUE HERE
+cd /home/livesys/packages/kernel
+echo Add kernel package
+reprepro -b "${REPOSITORY_BASE}/repo" -V include $CODENAME kernel.changes
+
+# Set permissions
+echo Set directory permissions
+find "${REPOSITORY_BASE}" -type d -exec chmod ugo+rx {} \;
+echo Set file permissions
+find "${REPOSITORY_BASE}" -type f -exec chmod ugo+r {} \;
+echo Set owner
+# chown -R www-data:www-data "${REPOSITORY_BASE}"
+
diff --git a/support/dktools/livesys-data/msg_nonfree.txt b/support/dktools/livesys-data/msg-nonfree.txt
index 58dafafe5e..fad1ff8d5c 100644
--- a/support/dktools/livesys-data/msg_nonfree.txt
+++ b/support/dktools/livesys-data/msg-nonfree.txt
@@ -1,3 +1,4 @@
+
NOTE: The live system contains non-free firmware files.
So the live system is probably not distributable.
diff --git a/support/dktools/livesys-data/msg-wifi.txt b/support/dktools/livesys-data/msg-wifi.txt
new file mode 100644
index 0000000000..14ca0624e5
--- /dev/null
+++ b/support/dktools/livesys-data/msg-wifi.txt
@@ -0,0 +1,4 @@
+
+SECURITY WARNING: WiFi setup file(s) found.
+This is only recommended when producing an image for use by yourself.
+If you publish this image, you disclose your WiFi key!
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-base.txt b/support/dktools/livesys-data/pkg-disklessian-buster-base.txt
new file mode 100644
index 0000000000..29555a24f4
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-base.txt
@@ -0,0 +1,73 @@
+live-boot # Boot configuration for live systems
+live-config-systemd # Configuration for systemd-based live systems
+live-config # Configuration for live systems
+live-tools # Additional scripts for use in live systems
+user-setup # Set up initial user and password
+sudo # Grant root privileges to normal users
+firmware-linux-free # Binary firmware for various drivers
+kbd # utilities for console/keyboard layout
+console-keymaps # Keyboard mapping files
+console-data # Keyboard mapping files
+hwinfo # Information about used hardware
+pciutils # Utilities to check PCI devices
+usbutils # Utilities to check USB devices
+udisks2 # Unmount USB devices
+genisoimage # Create ISO image
+wodim # Burn ISO image to CD/DVD
+squashfs-tools # Tools for squashfs file systems
+ntfs-3g # NTFS file system
+nfs-client # NFS client
+smbclient # Samba client programs
+util-linux # Several system administration commands
+util-linux-locales # Localized texts for administration commands
+sed # Text stream manipulation
+dos2unix # Convert dos to unix
+recode # Text recoding
+binutils # Assembler and related tools for object files
+coreutils # Text processing on command line
+diffutils # Diff and patch files
+patchutils # Diff and patch files
+patch # Apply a patch to a file
+lsof # List all open files
+file # Guess file types
+tcsh # Shell
+bash # Shell
+bash-completion # File name completion
+perl # Scripting language
+m4 # Text macro processor
+bc # Calculator
+cpio # Archivation
+arj # Archivation
+tar # Archivation
+zip # Compression
+unzip # Decompression
+bzip2 # Compression/decompression
+xz-utils # Compression/decompression
+ncompress # Archivation
+lzma # Archivation
+lzop # Archivation
+hdparm # Hard disk management
+openssh-client # ssh client
+openssl # Encryption tool
+md5deep # Calculate checksums
+gnupg # Encryption
+isc-dhcp-client # DHCP client
+iputils-ping # Ping program
+iproute2 # Routing
+net-tools # Network utilities
+snmp # Network management
+rsync # Remote file/directory synchronization
+rdist # Distribute equal files to multiple computers
+cadaver # DAV client
+lynx # Text mode web browser
+ncftp # Comfortable FTP client
+wget # Retrieve files from HTTP/FTP servers
+wput # Upload files to FTP server
+netcat # The netcat program for IPv4
+vim # Editor vi
+nano # Editor nano
+man # Online-help
+makedev # The MAKEDEV program
+ntp # Automatic time correction
+systemd-sysv # The /sbin/init script
+gnupg2 # New version of GnuPG
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-cinnamon.txt b/support/dktools/livesys-data/pkg-disklessian-buster-cinnamon.txt
new file mode 100644
index 0000000000..cddd4d0a5c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-cinnamon.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+cinnamon-core # Core components of Cinnamon desktop
+eog # Image viewer
+evince # PDF/PS viewer
+fonts-liberation # Font set
+fonts-noto # Yet another font set
+gedit # Text editor
+gnome-calculator # Calculator
+gnome-screenshot # Screenshot tool
+gnome-terminal # Terminal
+xdg-user-dirs-gtk # User directories
+blueman # Bluetooth manager
+gedit-plugins # Plugins for gedit
+gnote # Notes application
+mate-themes # Desktop themes
+yelp # Help viewer
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-firmware-gr.txt b/support/dktools/livesys-data/pkg-disklessian-buster-firmware-gr.txt
new file mode 100644
index 0000000000..44a5917d36
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-firmware-gr.txt
@@ -0,0 +1 @@
+firmware-amd-graphics # AMD/ATI graphics chips
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-firmware.txt b/support/dktools/livesys-data/pkg-disklessian-buster-firmware.txt
new file mode 100644
index 0000000000..17ec47329e
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-firmware.txt
@@ -0,0 +1,25 @@
+atmel-firmware # Atmel at76c50x wireless networking chips
+bluez-firmware # Broadcom BCM203x chipset bluetooth dongles
+dahdi-firmware-nonfree # DAHDI (Zaptel) telephony devices
+firmware-adi # Analog Devices Inc. DSL modem chips
+firmware-atheros # Atheros wireless cards
+firmware-b43-installer # Broadcom 43xx wireless network cards
+firmware-b43legacy-installer # Broadcom 43xx wireless network cards
+firmware-bnx2 # Broadcom NetXtremeII
+firmware-bnx2x # Broadcom NetXtreme II 10Gb
+firmware-brcm80211 # Broadcom 802.11 wireless cards
+firmware-cavium # Cavium Ethernet devices
+firmware-intelwimax # Intel WiMAX Connection devices
+firmware-ipw2x00 # Intel Pro Wireless 2100, 2200 and 2915
+firmware-iwlwifi # Intel Wireless cards
+firmware-libertas # Marvell Libertas 8xxx wireless cards
+firmware-linux # Binary firmware for various drivers
+firmware-linux-nonfree # Binary firmware for various drivers
+firmware-misc-nonfree # Various devices
+firmware-myricom # Myri-10G Ethernet adapters
+firmware-netxen # QLogic Intelligent Ethernet (3000 and 3100)
+firmware-qlogic # QLogic firmware
+firmware-ralink # Ralink wireless cards
+firmware-realtek # Realtek wired and wireless network adapters
+firmware-ti-connectivity # TI Connectivity wireless network adapters
+firmware-zd1211 # the zd1211rw wireless driver
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-gnome.txt b/support/dktools/livesys-data/pkg-disklessian-buster-gnome.txt
new file mode 100644
index 0000000000..4f969409cf
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-gnome.txt
@@ -0,0 +1,67 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+network-manager-gnome
+live-task-base
+libatk-adaptor
+at-spi2-core
+adwaita-icon-theme
+fonts-cantarell
+dconf-cli
+dconf-gsettings-backend
+eog
+evince
+sound-theme-freedesktop
+gedit
+gdm3
+glib-networking
+gnome-backgrounds
+gnome-bluetooth
+gnome-calculator
+gnome-characters
+gnome-control-center
+gnome-keyring
+libpam-gnome-keyring
+gnome-logs
+gnome-menus
+gnome-session
+gnome-settings-daemon
+gnome-shell
+gnome-shell-extensions
+gnome-system-monitor
+gnome-terminal
+gnome-themes-standard
+gnome-user-guide
+gnome-user-share
+gsettings-desktop-schemas
+gvfs-backends
+gvfs-bin
+gvfs-fuse
+libproxy1-plugin-gsettings
+gkbd-capplet
+nautilus
+pulseaudio
+system-config-printer-common
+system-config-printer-udev
+yelp
+zenity
+file-roller
+gnome-screenshot
+gnome-tweak-tool
+seahorse
+avahi-daemon
+xdg-user-dirs-gtk
+gedit-plugins
+
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-kde.txt b/support/dktools/livesys-data/pkg-disklessian-buster-kde.txt
new file mode 100644
index 0000000000..9ee1226b4c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-kde.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+ark # Archiver
+gwenview # Image viewer
+kate # Text editor
+kcalc # Calculator
+kde-plasma-desktop # Graphical desktop
+khelpcenter # KDE help center
+knotes # Notes application
+kde-spectacle # Screenshot tool
+okular # PDF/PS viewer
+plasma-dataengines-addons # Addons for graphical desktop
+polkit-kde-agent-1 # Communication via D-BUS
+sweeper # Disk cleaner
+konqueror # Web browser
+plasma-nm # Network manager
+
diff --git a/support/dktools/livesys-data/pkg_lang_base.txt b/support/dktools/livesys-data/pkg-disklessian-buster-lang-base.txt
index 49e5a44027..49e5a44027 100644
--- a/support/dktools/livesys-data/pkg_lang_base.txt
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-lang-base.txt
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-libreoffice.txt b/support/dktools/livesys-data/pkg-disklessian-buster-libreoffice.txt
new file mode 100644
index 0000000000..ee405f9edb
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-libreoffice.txt
@@ -0,0 +1,31 @@
+liblibreofficekitgtk
+libreoffice
+libreoffice-avmedia-backend-gstreamer
+libreoffice-base
+libreoffice-base-core
+libreoffice-base-drivers
+libreoffice-calc
+libreoffice-common
+libreoffice-core
+libreoffice-draw
+libreoffice-evolution
+libreoffice-gnome
+libreoffice-gtk3
+libreoffice-impress
+libreoffice-java-common
+libreoffice-librelogo
+libreoffice-math
+libreoffice-nlpsolver
+libreoffice-ogltrans
+libreoffice-pdfimport
+libreoffice-report-builder
+libreoffice-report-builder-bin
+libreoffice-script-provider-bsh
+libreoffice-script-provider-js
+libreoffice-script-provider-python
+libreoffice-sdbc-hsqldb
+libreoffice-sdbc-postgresql
+libreoffice-style-tango
+libreoffice-wiki-publisher
+libreoffice-writer
+libreofficekit-data
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-lxde.txt b/support/dktools/livesys-data/pkg-disklessian-buster-lxde.txt
new file mode 100644
index 0000000000..d3ec3d71ca
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-lxde.txt
@@ -0,0 +1,21 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxde # Graphical desktop
+lightdm # Display manager for graphical login
+lxtask # Task manager
+evince # PDF/PS viewer
+network-manager # Network manager
+network-manager-gnome # GUI for network manager
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-lxqt.txt b/support/dktools/livesys-data/pkg-disklessian-buster-lxqt.txt
new file mode 100644
index 0000000000..be5aa6779a
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-lxqt.txt
@@ -0,0 +1,40 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxqt-core # LXQT core components
+lxqt-about # About box
+lxqt-admin # LXQT administration
+lxqt-config # LXQT configuration
+lxqt-globalkeys # Keyboard shortcuts
+lxqt-notificationd # Notification daemon
+lxqt-openssh-askpass # GUI to ask for passphrase
+lxqt-policykit # PolicyKit for SELinux
+lxqt-powermanagement # Power management
+lxqt-qtplugin # Equal look for all components
+lxqt-runner # Runners for tasks
+network-manager-gnome # Network manager
+lximage-qt # Image viewer
+lxqt-sudo # Sudo
+qpdfview # PDF/PS viewer
+qps # Process manager
+qterminal # Terminal application
+gucharmap # Character map
+ark # Archive tool
+juffed # Text editor
+nomacs # Graphics viewer
+shutter # Screenshot tool
+sddm-theme-maui # Window manager theme
+sddm # Window manager
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-mate.txt b/support/dktools/livesys-data/pkg-disklessian-buster-mate.txt
new file mode 100644
index 0000000000..6f5aed7278
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-mate.txt
@@ -0,0 +1,32 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lightdm # Display manager
+mate-desktop-environment-core # Core Mate desktop components
+atril # Document viewer
+engrampa # Archive manager
+eom # Image viewer
+galculator # Calculator
+mate-applets # Applets
+mate-icon-theme-faenza # Icon theme
+mate-notification-daemon # Daemon for notifications
+mate-power-manager # Power manager
+mate-screensaver # Screen saver
+mate-system-monitor # System monitor
+mate-user-guide # User guide
+mate-utils # Various utilities
+pluma # Text editor
+network-manager-gnome # Network manager
diff --git a/support/dktools/livesys-data/pkg-disklessian-buster-xfce.txt b/support/dktools/livesys-data/pkg-disklessian-buster-xfce.txt
new file mode 100644
index 0000000000..b23b57d0be
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-buster-xfce.txt
@@ -0,0 +1,37 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+xfwm4 # XFCE window manager
+xfconf # XFCE configuration helper program
+xfce4-settings # XFCE configuration program
+xfce4-panel # The panel in the XFCE window manager
+xfdesktop4 # XFCE desktop configuration program
+thunar # File manager
+gtk2-engines-xfce # Themes engine to use GNOME themes on XFCE
+gtk3-engines-xfce # Themes engine to use GNOME themes on XFCE
+xfce4-session # Session manager for XFCE
+xfce4-appfinder # Search for installed programs
+libxfce4ui-utils # Help files, additional configuration programs
+thunar-volman # Volume manager for remove media in thunar
+tango-icon-theme # Icon theme
+xfce4-notifyd # Desktop notifications daemon
+xfce4-power-manager # Power manager
+lightdm # Display manager (login program)
+xfce4-goodies # Extension programs for XFCE desktop
+xfce4-terminal # Terminal emulation program
+mousepad # Graphical text editor for XFCE
+dbus-x11 # Interprocess message bus
+evince # PDF/PS viewer
+network-manager-gnome # Network manager
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-base.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-base.txt
new file mode 100644
index 0000000000..dc802a24b9
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-base.txt
@@ -0,0 +1,74 @@
+live-boot # Boot configuration for live systems
+live-config-systemd # Configuration for systemd-based live systems
+live-config # Configuration for live systems
+live-tools # Additional scripts for use in live systems
+user-setup # Set up initial user and password
+sudo # Grant root privileges to normal users
+firmware-linux-free # Binary firmware for various drivers
+kbd # utilities for console/keyboard layout
+keyboard-configuration # Keyboard configuration utilities
+console-keymaps # Keyboard mapping files
+console-data # Keyboard mapping files
+hwinfo # Information about used hardware
+pciutils # Utilities to check PCI devices
+usbutils # Utilities to check USB devices
+udisks # Unmount USB devices
+genisoimage # Create ISO image
+wodim # Burn ISO image to CD/DVD
+squashfs-tools # Tools for squashfs file systems
+ntfs-3g # NTFS file system
+ntfs-config # Configure NTFS devices
+nfs-client # NFS client
+smbclient # Samba client programs
+util-linux # Several system administration commands
+util-linux-locales # Localized texts for administration commands
+sed # Text stream manipulation
+dos2unix # Convert dos to unix
+recode # Text recoding
+binutils # Assembler and related tools for object files
+coreutils # Text processing on command line
+diffutils # Diff and patch files
+patchutils # Diff and patch files
+patch # Apply a patch to a file
+lsof # List all open files
+file # Guess file types
+tcsh # Shell
+bash # Shell
+bash-completion # File name completion
+perl # Scripting language
+m4 # Text macro processor
+bc # Calculator
+cpio # Archivation
+arj # Archivation
+tar # Archivation
+zip # Compression
+unzip # Decompression
+bzip2 # Compression/decompression
+xz-utils # Compression/decompression
+ncompress # Archivation
+lzma # Archivation
+lzop # Archivation
+hdparm # Hard disk management
+openssh-client # ssh client
+openssl # Encryption tool
+md5deep # Calculate checksums
+gnupg # Encryption
+isc-dhcp-client # DHCP client
+iproute # Check IP routes
+iputils-ping # Ping program
+net-tools # Network utilities
+snmp # Network management
+rsync # Remote file/directory synchronization
+rdist # Distribute equal files to multiple computers
+cadaver # DAV client
+lynx # Text mode web browser
+ncftp # Comfortable FTP client
+wget # Retrieve files from HTTP/FTP servers
+wput # Upload files to FTP server
+netcat # The netcat program for IPv4
+netcat6 # The netcat program for IPv6
+vim # Editor vi
+nano # Editor nano
+man # Online-help
+makedev # The MAKEDEV program
+ntp # Automatic time correction
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-cinnamon.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-cinnamon.txt
new file mode 100644
index 0000000000..cddd4d0a5c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-cinnamon.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+cinnamon-core # Core components of Cinnamon desktop
+eog # Image viewer
+evince # PDF/PS viewer
+fonts-liberation # Font set
+fonts-noto # Yet another font set
+gedit # Text editor
+gnome-calculator # Calculator
+gnome-screenshot # Screenshot tool
+gnome-terminal # Terminal
+xdg-user-dirs-gtk # User directories
+blueman # Bluetooth manager
+gedit-plugins # Plugins for gedit
+gnote # Notes application
+mate-themes # Desktop themes
+yelp # Help viewer
diff --git a/support/dktools/livesys-data/pkg_firmware.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-firmware.txt
index 2accee0c75..2accee0c75 100644
--- a/support/dktools/livesys-data/pkg_firmware.txt
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-firmware.txt
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-gnome.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-gnome.txt
new file mode 100644
index 0000000000..2027650d10
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-gnome.txt
@@ -0,0 +1,65 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+network-manager-gnome
+libatk-adaptor
+at-spi2-core
+adwaita-icon-theme
+fonts-cantarell
+dconf-cli
+dconf-gsettings-backend
+eog
+evince
+sound-theme-freedesktop
+gedit
+gdm3
+glib-networking
+gnome-backgrounds
+gnome-bluetooth
+gnome-calculator
+gnome-control-center
+gnome-keyring
+libpam-gnome-keyring
+gnome-logs
+gnome-menus
+gnome-session
+gnome-settings-daemon
+gnome-shell
+gnome-shell-extensions
+gnome-system-monitor
+gnome-terminal
+gnome-themes-standard
+gnome-user-guide
+gnome-user-share
+gsettings-desktop-schemas
+gvfs-backends
+gvfs-bin
+gvfs-fuse
+libproxy1-plugin-gsettings
+gkbd-capplet
+nautilus
+pulseaudio
+system-config-printer-udev
+tracker-gui
+yelp
+zenity
+file-roller
+gnome-screenshot
+gnome-tweak-tool
+seahorse
+avahi-daemon
+xdg-user-dirs-gtk
+gedit-plugins
+
diff --git a/support/dktools/livesys-data/pkg_local.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-host.txt
index 3d50f78c61..3d50f78c61 100644
--- a/support/dktools/livesys-data/pkg_local.txt
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-host.txt
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-kde.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-kde.txt
new file mode 100644
index 0000000000..4f43546886
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-kde.txt
@@ -0,0 +1,29 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+ark # Archiver
+gwenview # Image viewer
+kate # Text editor
+kcalc # Calculator
+kde-plasma-desktop # Graphical desktop
+khelpcenter4 # KDE help center
+knotes # Notes application
+okular # PDF/PS viewer
+plasma-dataengines-addons # Addons for graphical desktop
+sweeper # Disk cleaner
+konqueror # Web browser
+plasma-nm # Network manager
+
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-lang-base.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-lang-base.txt
new file mode 100644
index 0000000000..49e5a44027
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-lang-base.txt
@@ -0,0 +1,62 @@
+task-amharic
+task-arabic
+task-asturian
+task-basque
+task-belarusian
+task-bengali
+task-bosnian
+task-brazilian-portuguese
+task-bulgarian
+task-catalan
+task-chinese-s
+task-chinese-t
+task-croatian
+task-cyrillic
+task-czech
+task-danish
+task-dutch
+task-english
+task-esperanto
+task-estonian
+task-finnish
+task-french
+task-galician
+task-german
+task-greek
+task-gujarati
+task-hebrew
+task-hindi
+task-hungarian
+task-icelandic
+task-irish
+task-italian
+task-japanese
+task-kazakh
+task-khmer
+task-korean
+task-kurdish
+task-latvian
+task-lithuanian
+task-macedonian
+task-malayalam
+task-marathi
+task-northern-sami
+task-norwegian
+task-persian
+task-polish
+task-portuguese
+task-punjabi
+task-romanian
+task-russian
+task-serbian
+task-slovak
+task-slovenian
+task-spanish
+task-swedish
+task-tagalog
+task-tamil
+task-telugu
+task-thai
+task-turkish
+task-ukrainian
+task-welsh
diff --git a/support/dktools/livesys-data/pkg_lang_desktop.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-lang-desktop.txt
index 5efecae5cc..5efecae5cc 100644
--- a/support/dktools/livesys-data/pkg_lang_desktop.txt
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-lang-desktop.txt
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-libreoffice.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-libreoffice.txt
new file mode 100644
index 0000000000..310a3e9681
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-libreoffice.txt
@@ -0,0 +1,30 @@
+libreoffice
+libreoffice-avmedia-backend-gstreamer
+libreoffice-base
+libreoffice-base-core
+libreoffice-base-drivers
+libreoffice-calc
+libreoffice-common
+libreoffice-core
+libreoffice-draw
+libreoffice-evolution
+libreoffice-gnome
+libreoffice-gtk3
+libreoffice-impress
+libreoffice-java-common
+libreoffice-librelogo
+libreoffice-math
+libreoffice-nlpsolver
+libreoffice-ogltrans
+libreoffice-pdfimport
+libreoffice-report-builder
+libreoffice-report-builder-bin
+libreoffice-script-provider-bsh
+libreoffice-script-provider-js
+libreoffice-script-provider-python
+libreoffice-sdbc-hsqldb
+libreoffice-sdbc-postgresql
+libreoffice-style-galaxy
+libreoffice-style-tango
+libreoffice-wiki-publisher
+libreoffice-writer
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-lxde.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-lxde.txt
new file mode 100644
index 0000000000..d3ec3d71ca
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-lxde.txt
@@ -0,0 +1,21 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxde # Graphical desktop
+lightdm # Display manager for graphical login
+lxtask # Task manager
+evince # PDF/PS viewer
+network-manager # Network manager
+network-manager-gnome # GUI for network manager
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-mate.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-mate.txt
new file mode 100644
index 0000000000..cde881a996
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-mate.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lightdm # Display manager
+mate-desktop-environment-core # Core Mate desktop components
+atril # Document viewer
+engrampa # Archive manager
+eom # Image viewer
+galculator # Calculator
+mate-applets # Applets
+mate-icon-theme-faenza # Icon theme
+mate-notification-daemon # Daemon for notifications
+mate-power-manager # Power manager
+mate-screensaver # Screen saver
+mate-system-monitor # System monitor
+mate-utils # Various utilities
+pluma # Text editor
+network-manager-gnome # Network manager
diff --git a/support/dktools/livesys-data/pkg-disklessian-jessie-xfce.txt b/support/dktools/livesys-data/pkg-disklessian-jessie-xfce.txt
new file mode 100644
index 0000000000..388116df7c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-jessie-xfce.txt
@@ -0,0 +1,39 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+alsa-base # Removes kmod files
+xfwm4 # XFCE window manager
+xfconf # XFCE configuration helper program
+xfce4-settings # XFCE configuration program
+xfce4-panel # The panel in the XFCE window manager
+xfdesktop4 # XFCE desktop configuration program
+thunar # File manager
+gtk2-engines-xfce # Themes engine to use GNOME themes on XFCE
+gtk3-engines-xfce # Themes engine to use GNOME themes on XFCE
+xfce4-session # Session manager for XFCE
+xfce4-appfinder # Search for installed programs
+xfce4-mixer # Mixer program (sound?)
+libxfce4ui-utils # Help files, additional configuration programs
+thunar-volman # Volume manager for remove media in thunar
+tango-icon-theme # Icon theme
+xfce4-notifyd # Desktop notifications daemon
+xfce4-power-manager # Power manager
+lightdm # Display manager (login program)
+xfce4-goodies # Extension programs for XFCE desktop
+xfce4-terminal # Terminal emulation program
+mousepad # Graphical text editor for XFCE
+dbus-x11 # Interprocess message bus
+evince # PDF/PS viewer
+network-manager-gnome # Network manager
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-base.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-base.txt
new file mode 100644
index 0000000000..3e16b97dda
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-base.txt
@@ -0,0 +1,74 @@
+live-boot # Boot configuration for live systems
+live-config-systemd # Configuration for systemd-based live systems
+live-config # Configuration for live systems
+live-tools # Additional scripts for use in live systems
+user-setup # Set up initial user and password
+sudo # Grant root privileges to normal users
+firmware-linux-free # Binary firmware for various drivers
+kbd # utilities for console/keyboard layout
+console-keymaps # Keyboard mapping files
+console-data # Keyboard mapping files
+hwinfo # Information about used hardware
+pciutils # Utilities to check PCI devices
+usbutils # Utilities to check USB devices
+udisks2 # Unmount USB devices
+genisoimage # Create ISO image
+wodim # Burn ISO image to CD/DVD
+squashfs-tools # Tools for squashfs file systems
+ntfs-3g # NTFS file system
+ntfs-config # Configure NTFS devices
+nfs-client # NFS client
+smbclient # Samba client programs
+util-linux # Several system administration commands
+util-linux-locales # Localized texts for administration commands
+sed # Text stream manipulation
+dos2unix # Convert dos to unix
+recode # Text recoding
+binutils # Assembler and related tools for object files
+coreutils # Text processing on command line
+diffutils # Diff and patch files
+patchutils # Diff and patch files
+patch # Apply a patch to a file
+lsof # List all open files
+file # Guess file types
+tcsh # Shell
+bash # Shell
+bash-completion # File name completion
+perl # Scripting language
+m4 # Text macro processor
+bc # Calculator
+cpio # Archivation
+arj # Archivation
+tar # Archivation
+zip # Compression
+unzip # Decompression
+bzip2 # Compression/decompression
+xz-utils # Compression/decompression
+ncompress # Archivation
+lzma # Archivation
+lzop # Archivation
+hdparm # Hard disk management
+openssh-client # ssh client
+openssl # Encryption tool
+md5deep # Calculate checksums
+gnupg # Encryption
+isc-dhcp-client # DHCP client
+iproute # Check IP routes
+iputils-ping # Ping program
+net-tools # Network utilities
+snmp # Network management
+rsync # Remote file/directory synchronization
+rdist # Distribute equal files to multiple computers
+cadaver # DAV client
+lynx # Text mode web browser
+ncftp # Comfortable FTP client
+wget # Retrieve files from HTTP/FTP servers
+wput # Upload files to FTP server
+netcat # The netcat program for IPv4
+vim # Editor vi
+nano # Editor nano
+man # Online-help
+makedev # The MAKEDEV program
+ntp # Automatic time correction
+systemd-sysv # The /sbin/init script
+gnupg2 # New version of GnuPG
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-cinnamon.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-cinnamon.txt
new file mode 100644
index 0000000000..cddd4d0a5c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-cinnamon.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+cinnamon-core # Core components of Cinnamon desktop
+eog # Image viewer
+evince # PDF/PS viewer
+fonts-liberation # Font set
+fonts-noto # Yet another font set
+gedit # Text editor
+gnome-calculator # Calculator
+gnome-screenshot # Screenshot tool
+gnome-terminal # Terminal
+xdg-user-dirs-gtk # User directories
+blueman # Bluetooth manager
+gedit-plugins # Plugins for gedit
+gnote # Notes application
+mate-themes # Desktop themes
+yelp # Help viewer
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-firmware-gr.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-firmware-gr.txt
new file mode 100644
index 0000000000..43955cb3fc
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-firmware-gr.txt
@@ -0,0 +1,2 @@
+firmware-amd-graphics # AMD/ATI graphics chips
+firmware-crystalhd # Crystal HD Video Decoder
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-firmware.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-firmware.txt
new file mode 100644
index 0000000000..17ec47329e
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-firmware.txt
@@ -0,0 +1,25 @@
+atmel-firmware # Atmel at76c50x wireless networking chips
+bluez-firmware # Broadcom BCM203x chipset bluetooth dongles
+dahdi-firmware-nonfree # DAHDI (Zaptel) telephony devices
+firmware-adi # Analog Devices Inc. DSL modem chips
+firmware-atheros # Atheros wireless cards
+firmware-b43-installer # Broadcom 43xx wireless network cards
+firmware-b43legacy-installer # Broadcom 43xx wireless network cards
+firmware-bnx2 # Broadcom NetXtremeII
+firmware-bnx2x # Broadcom NetXtreme II 10Gb
+firmware-brcm80211 # Broadcom 802.11 wireless cards
+firmware-cavium # Cavium Ethernet devices
+firmware-intelwimax # Intel WiMAX Connection devices
+firmware-ipw2x00 # Intel Pro Wireless 2100, 2200 and 2915
+firmware-iwlwifi # Intel Wireless cards
+firmware-libertas # Marvell Libertas 8xxx wireless cards
+firmware-linux # Binary firmware for various drivers
+firmware-linux-nonfree # Binary firmware for various drivers
+firmware-misc-nonfree # Various devices
+firmware-myricom # Myri-10G Ethernet adapters
+firmware-netxen # QLogic Intelligent Ethernet (3000 and 3100)
+firmware-qlogic # QLogic firmware
+firmware-ralink # Ralink wireless cards
+firmware-realtek # Realtek wired and wireless network adapters
+firmware-ti-connectivity # TI Connectivity wireless network adapters
+firmware-zd1211 # the zd1211rw wireless driver
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-gnome.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-gnome.txt
new file mode 100644
index 0000000000..2aa537bb03
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-gnome.txt
@@ -0,0 +1,68 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+network-manager-gnome
+live-task-base
+libatk-adaptor
+at-spi2-core
+adwaita-icon-theme
+fonts-cantarell
+dconf-cli
+dconf-gsettings-backend
+eog
+evince
+sound-theme-freedesktop
+gedit
+gdm3
+glib-networking
+gnome-backgrounds
+gnome-bluetooth
+gnome-calculator
+gnome-characters
+gnome-control-center
+gnome-keyring
+libpam-gnome-keyring
+gnome-logs
+gnome-menus
+gnome-session
+gnome-settings-daemon
+gnome-shell
+gnome-shell-extensions
+gnome-system-monitor
+gnome-terminal
+gnome-themes-standard
+gnome-user-guide
+gnome-user-share
+gsettings-desktop-schemas
+gvfs-backends
+gvfs-bin
+gvfs-fuse
+libproxy1-plugin-gsettings
+gkbd-capplet
+nautilus
+pulseaudio
+system-config-printer-common
+system-config-printer-udev
+tracker-gui
+yelp
+zenity
+file-roller
+gnome-screenshot
+gnome-tweak-tool
+seahorse
+avahi-daemon
+xdg-user-dirs-gtk
+gedit-plugins
+
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-kde.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-kde.txt
new file mode 100644
index 0000000000..9ee1226b4c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-kde.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+ark # Archiver
+gwenview # Image viewer
+kate # Text editor
+kcalc # Calculator
+kde-plasma-desktop # Graphical desktop
+khelpcenter # KDE help center
+knotes # Notes application
+kde-spectacle # Screenshot tool
+okular # PDF/PS viewer
+plasma-dataengines-addons # Addons for graphical desktop
+polkit-kde-agent-1 # Communication via D-BUS
+sweeper # Disk cleaner
+konqueror # Web browser
+plasma-nm # Network manager
+
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-lang-base.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-lang-base.txt
new file mode 100644
index 0000000000..49e5a44027
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-lang-base.txt
@@ -0,0 +1,62 @@
+task-amharic
+task-arabic
+task-asturian
+task-basque
+task-belarusian
+task-bengali
+task-bosnian
+task-brazilian-portuguese
+task-bulgarian
+task-catalan
+task-chinese-s
+task-chinese-t
+task-croatian
+task-cyrillic
+task-czech
+task-danish
+task-dutch
+task-english
+task-esperanto
+task-estonian
+task-finnish
+task-french
+task-galician
+task-german
+task-greek
+task-gujarati
+task-hebrew
+task-hindi
+task-hungarian
+task-icelandic
+task-irish
+task-italian
+task-japanese
+task-kazakh
+task-khmer
+task-korean
+task-kurdish
+task-latvian
+task-lithuanian
+task-macedonian
+task-malayalam
+task-marathi
+task-northern-sami
+task-norwegian
+task-persian
+task-polish
+task-portuguese
+task-punjabi
+task-romanian
+task-russian
+task-serbian
+task-slovak
+task-slovenian
+task-spanish
+task-swedish
+task-tagalog
+task-tamil
+task-telugu
+task-thai
+task-turkish
+task-ukrainian
+task-welsh
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-libreoffice.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-libreoffice.txt
new file mode 100644
index 0000000000..445a405f6a
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-libreoffice.txt
@@ -0,0 +1,32 @@
+liblibreofficekitgtk
+libreoffice
+libreoffice-avmedia-backend-gstreamer
+libreoffice-base
+libreoffice-base-core
+libreoffice-base-drivers
+libreoffice-calc
+libreoffice-common
+libreoffice-core
+libreoffice-draw
+libreoffice-evolution
+libreoffice-gnome
+libreoffice-gtk3
+libreoffice-impress
+libreoffice-java-common
+libreoffice-librelogo
+libreoffice-math
+libreoffice-nlpsolver
+libreoffice-ogltrans
+libreoffice-pdfimport
+libreoffice-report-builder
+libreoffice-report-builder-bin
+libreoffice-script-provider-bsh
+libreoffice-script-provider-js
+libreoffice-script-provider-python
+libreoffice-sdbc-hsqldb
+libreoffice-sdbc-postgresql
+libreoffice-style-galaxy
+libreoffice-style-tango
+libreoffice-wiki-publisher
+libreoffice-writer
+libreofficekit-data
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-lxde.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-lxde.txt
new file mode 100644
index 0000000000..d3ec3d71ca
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-lxde.txt
@@ -0,0 +1,21 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxde # Graphical desktop
+lightdm # Display manager for graphical login
+lxtask # Task manager
+evince # PDF/PS viewer
+network-manager # Network manager
+network-manager-gnome # GUI for network manager
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-lxqt.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-lxqt.txt
new file mode 100644
index 0000000000..be5aa6779a
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-lxqt.txt
@@ -0,0 +1,40 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxqt-core # LXQT core components
+lxqt-about # About box
+lxqt-admin # LXQT administration
+lxqt-config # LXQT configuration
+lxqt-globalkeys # Keyboard shortcuts
+lxqt-notificationd # Notification daemon
+lxqt-openssh-askpass # GUI to ask for passphrase
+lxqt-policykit # PolicyKit for SELinux
+lxqt-powermanagement # Power management
+lxqt-qtplugin # Equal look for all components
+lxqt-runner # Runners for tasks
+network-manager-gnome # Network manager
+lximage-qt # Image viewer
+lxqt-sudo # Sudo
+qpdfview # PDF/PS viewer
+qps # Process manager
+qterminal # Terminal application
+gucharmap # Character map
+ark # Archive tool
+juffed # Text editor
+nomacs # Graphics viewer
+shutter # Screenshot tool
+sddm-theme-maui # Window manager theme
+sddm # Window manager
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-mate.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-mate.txt
new file mode 100644
index 0000000000..6f5aed7278
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-mate.txt
@@ -0,0 +1,32 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lightdm # Display manager
+mate-desktop-environment-core # Core Mate desktop components
+atril # Document viewer
+engrampa # Archive manager
+eom # Image viewer
+galculator # Calculator
+mate-applets # Applets
+mate-icon-theme-faenza # Icon theme
+mate-notification-daemon # Daemon for notifications
+mate-power-manager # Power manager
+mate-screensaver # Screen saver
+mate-system-monitor # System monitor
+mate-user-guide # User guide
+mate-utils # Various utilities
+pluma # Text editor
+network-manager-gnome # Network manager
diff --git a/support/dktools/livesys-data/pkg-disklessian-stretch-xfce.txt b/support/dktools/livesys-data/pkg-disklessian-stretch-xfce.txt
new file mode 100644
index 0000000000..b23b57d0be
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-disklessian-stretch-xfce.txt
@@ -0,0 +1,37 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+xfwm4 # XFCE window manager
+xfconf # XFCE configuration helper program
+xfce4-settings # XFCE configuration program
+xfce4-panel # The panel in the XFCE window manager
+xfdesktop4 # XFCE desktop configuration program
+thunar # File manager
+gtk2-engines-xfce # Themes engine to use GNOME themes on XFCE
+gtk3-engines-xfce # Themes engine to use GNOME themes on XFCE
+xfce4-session # Session manager for XFCE
+xfce4-appfinder # Search for installed programs
+libxfce4ui-utils # Help files, additional configuration programs
+thunar-volman # Volume manager for remove media in thunar
+tango-icon-theme # Icon theme
+xfce4-notifyd # Desktop notifications daemon
+xfce4-power-manager # Power manager
+lightdm # Display manager (login program)
+xfce4-goodies # Extension programs for XFCE desktop
+xfce4-terminal # Terminal emulation program
+mousepad # Graphical text editor for XFCE
+dbus-x11 # Interprocess message bus
+evince # PDF/PS viewer
+network-manager-gnome # Network manager
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
diff --git a/support/dktools/livesys-data/pkg-dislessian-buster-host.txt b/support/dktools/livesys-data/pkg-dislessian-buster-host.txt
new file mode 100644
index 0000000000..de2d76b703
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dislessian-buster-host.txt
@@ -0,0 +1,24 @@
+build-essential # Package containing tools to build Debian packages
+autoconf # Create configure scripts automatically
+automake # Create Makefile.in automatically from Makefile.am
+autotools-dev # Files config.guess and config.sub
+dh-make # Create Debian package files for pure source archives
+debhelper # Tool programs for Debian package creation
+devscripts # Scripts for Debian package maintenance
+fakeroot # Wrapper to simulate access to root directory
+lintian # Debian package checker
+patch # Patch a file
+patchutils # Additional tools to work with patches
+pbuilder # Package builder
+make # Compiler control program
+gcc # GNU C compiler
+g++ # GNU C++ compiler
+zlib1g-dev # Development support for zlib
+libbz2-dev # Development support for libbz2
+libssl-dev # Development support for OpenSSL
+libdb-dev # Development support for Berkeley DB
+live-build # Components to build a live system
+debootstrap # Debian bootstrapper (create initial system)
+makedev # Create device files
+reprepro # Create apt repositories
+gnupg2 # Recent GnuPG version
diff --git a/support/dktools/livesys-data/pkg-dislessian-stretch-host.txt b/support/dktools/livesys-data/pkg-dislessian-stretch-host.txt
new file mode 100644
index 0000000000..de2d76b703
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dislessian-stretch-host.txt
@@ -0,0 +1,24 @@
+build-essential # Package containing tools to build Debian packages
+autoconf # Create configure scripts automatically
+automake # Create Makefile.in automatically from Makefile.am
+autotools-dev # Files config.guess and config.sub
+dh-make # Create Debian package files for pure source archives
+debhelper # Tool programs for Debian package creation
+devscripts # Scripts for Debian package maintenance
+fakeroot # Wrapper to simulate access to root directory
+lintian # Debian package checker
+patch # Patch a file
+patchutils # Additional tools to work with patches
+pbuilder # Package builder
+make # Compiler control program
+gcc # GNU C compiler
+g++ # GNU C++ compiler
+zlib1g-dev # Development support for zlib
+libbz2-dev # Development support for libbz2
+libssl-dev # Development support for OpenSSL
+libdb-dev # Development support for Berkeley DB
+live-build # Components to build a live system
+debootstrap # Debian bootstrapper (create initial system)
+makedev # Create device files
+reprepro # Create apt repositories
+gnupg2 # Recent GnuPG version
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-base.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-base.txt
new file mode 100644
index 0000000000..a6b7c12a73
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-base.txt
@@ -0,0 +1,96 @@
+live-boot # Boot configuration for live systems
+live-config-systemd # Configuration for systemd-based live systems
+live-config # Configuration for live systems
+live-tools # Extra components for live system
+user-setup # Set up initial user and password
+sudo # Grant root privileges to normal users
+firmware-linux-free # Binary firmware for various drivers
+kbd # utilities for console/keyboard layout
+console-keymaps # Keyboard mapping files
+console-data # Keyboard mapping files
+hwinfo # Information about used hardware
+lshw # List hardware
+pciutils # Utilities to check PCI devices, i.e. lspci
+usbutils # Utilities to check USB devices, i.e. lsusb
+hdparm # Hard disk management
+smartmontools # Hard disk management
+genisoimage # Create ISO image
+wodim # Burn ISO image to CD/DVD
+util-linux # Several system administration commands
+util-linux-locales # Localized texts for administration commands
+gdisk # Disk partitioning program (GPT)
+parted # Disk partitions management
+gddrescue # attempt data recovery
+squashfs-tools # Tools for squashfs file systems
+e2fsprogs # Tools for ext2, ext3, ext4 file systems
+dosfstools # Access DOS/Windows FAT file systems
+mtools # Floppy disks utilities
+ntfs-3g # NTFS file system
+nfs-client # NFS client
+smbclient # Samba client programs
+binutils # Assembler and related tools for object files
+coreutils # Text processing on command line
+diffutils # Diff and patch files
+patchutils # Diff and patch files
+patch # Apply a patch to a file
+lsof # List all open files
+file # Guess file types
+tcsh # Shell
+bash # Shell
+bash-completion # File name completion
+perl # Scripting language
+m4 # Text macro processor
+bc # Calculator
+cpio # Archivation
+arj # Archivation
+tar # Archivation
+zip # Compression
+unzip # Decompression
+bzip2 # Compression/decompression
+xz-utils # Compression/decompression
+ncompress # Archivation
+lzma # Archivation
+lzop # Archivation
+sed # Text stream manipulation
+dos2unix # Convert dos to unix
+recode # Text recoding
+openssh-client # ssh client
+openssh-server # OpenSSH server
+openssh-sftp-server # OpenSSH sftp server
+openssl # Encryption tool
+md5deep # Calculate checksums
+gnupg # Encryption
+isc-dhcp-client # DHCP client
+iputils-ping # Ping program
+iproute2 # IP routing
+net-tools # Network utilities
+wireless-tools # Wireless networking utilities
+snmp # Network management
+rsync # Remote file/directory synchronization
+rdist # Distribute equal files to multiple computers
+cadaver # DAV client
+lynx # Text mode web browser
+ncftp # Comfortable FTP client
+wget # Retrieve files from HTTP/FTP servers
+wput # Upload files to FTP server
+netcat # The netcat program for IPv4
+udpcast # Broadcast/multicast data transmission
+clonezilla # Backup and recovery of disk drives
+screen # Screen program is used by clonezilla
+partclone # Partition cloning, used blocks only
+cifs-utils # Mount SMB file systems
+dialog # Required by clonezilla
+sshfs # Mount remote directory via SSH protocol
+vim # Editor vi
+nano # Editor nano
+joe # Joes own editor
+man # Online-help
+makedev # The MAKEDEV program
+lsscsi # List SCSI devices
+open-iscsi # iSCSI implementation
+scsitools # Tools for SCSI devices
+grub-firmware-qemu # Grub firmware for qemu
+udisks2 # Unmount USB devices
+console-setup # Customize console
+console-setup-linux # Fonts for console
+systemd-sysv # Script /sbin/init for boot process
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-cinnamon.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-cinnamon.txt
new file mode 100644
index 0000000000..cddd4d0a5c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-cinnamon.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+cinnamon-core # Core components of Cinnamon desktop
+eog # Image viewer
+evince # PDF/PS viewer
+fonts-liberation # Font set
+fonts-noto # Yet another font set
+gedit # Text editor
+gnome-calculator # Calculator
+gnome-screenshot # Screenshot tool
+gnome-terminal # Terminal
+xdg-user-dirs-gtk # User directories
+blueman # Bluetooth manager
+gedit-plugins # Plugins for gedit
+gnote # Notes application
+mate-themes # Desktop themes
+yelp # Help viewer
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-firmware-gr.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-firmware-gr.txt
new file mode 100644
index 0000000000..44a5917d36
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-firmware-gr.txt
@@ -0,0 +1 @@
+firmware-amd-graphics # AMD/ATI graphics chips
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-firmware.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-firmware.txt
new file mode 100644
index 0000000000..84a0264da3
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-firmware.txt
@@ -0,0 +1,25 @@
+atmel-firmware # Atmel at76c50x wireless networking chips
+bluez-firmware # Broadcom BCM203x chipset bluetooth dongles
+dahdi-firmware-nonfree # DAHDI (Zaptel) telephony devices
+firmware-adi # Analog Devices Inc. DSL modem chips
+firmware-atheros # Atheros wireless cards
+firmware-b43-installer # Broadcom 43xx wireless network cards
+firmware-b43legacy-installer # Broadcom 43xx wireless network cards
+firmware-bnx2 # Broadcom NetXtremeII
+firmware-bnx2x # Broadcom NetXtreme II 10Gb
+firmware-brcm80211 # Broadcom 802.11 wireless cards
+firmware-intelwimax # Intel WiMAX Connection devices
+firmware-ipw2x00 # Intel Pro Wireless 2100, 2200 and 2915
+firmware-iwlwifi # Intel Wireless cards
+firmware-libertas # Marvell Libertas 8xxx wireless cards
+firmware-linux # Binary firmware for various drivers
+firmware-linux-nonfree # Binary firmware for various drivers
+firmware-myricom # Myri-10G Ethernet adapters
+firmware-netxen # QLogic Intelligent Ethernet (3000 and 3100)
+firmware-qlogic # Other QLogic devices
+firmware-ralink # Ralink wireless cards
+firmware-realtek # Realtek wired and wireless network adapters
+firmware-ti-connectivity # TI Connectivity wireless network adapters
+firmware-zd1211 # the zd1211rw wireless driver
+firmware-misc-nonfree # Non-free firmware for various devices
+firmware-cavium # Cavium Ethernet devices
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-gnome.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-gnome.txt
new file mode 100644
index 0000000000..4f969409cf
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-gnome.txt
@@ -0,0 +1,67 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+network-manager-gnome
+live-task-base
+libatk-adaptor
+at-spi2-core
+adwaita-icon-theme
+fonts-cantarell
+dconf-cli
+dconf-gsettings-backend
+eog
+evince
+sound-theme-freedesktop
+gedit
+gdm3
+glib-networking
+gnome-backgrounds
+gnome-bluetooth
+gnome-calculator
+gnome-characters
+gnome-control-center
+gnome-keyring
+libpam-gnome-keyring
+gnome-logs
+gnome-menus
+gnome-session
+gnome-settings-daemon
+gnome-shell
+gnome-shell-extensions
+gnome-system-monitor
+gnome-terminal
+gnome-themes-standard
+gnome-user-guide
+gnome-user-share
+gsettings-desktop-schemas
+gvfs-backends
+gvfs-bin
+gvfs-fuse
+libproxy1-plugin-gsettings
+gkbd-capplet
+nautilus
+pulseaudio
+system-config-printer-common
+system-config-printer-udev
+yelp
+zenity
+file-roller
+gnome-screenshot
+gnome-tweak-tool
+seahorse
+avahi-daemon
+xdg-user-dirs-gtk
+gedit-plugins
+
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-host.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-host.txt
new file mode 100644
index 0000000000..de2d76b703
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-host.txt
@@ -0,0 +1,24 @@
+build-essential # Package containing tools to build Debian packages
+autoconf # Create configure scripts automatically
+automake # Create Makefile.in automatically from Makefile.am
+autotools-dev # Files config.guess and config.sub
+dh-make # Create Debian package files for pure source archives
+debhelper # Tool programs for Debian package creation
+devscripts # Scripts for Debian package maintenance
+fakeroot # Wrapper to simulate access to root directory
+lintian # Debian package checker
+patch # Patch a file
+patchutils # Additional tools to work with patches
+pbuilder # Package builder
+make # Compiler control program
+gcc # GNU C compiler
+g++ # GNU C++ compiler
+zlib1g-dev # Development support for zlib
+libbz2-dev # Development support for libbz2
+libssl-dev # Development support for OpenSSL
+libdb-dev # Development support for Berkeley DB
+live-build # Components to build a live system
+debootstrap # Debian bootstrapper (create initial system)
+makedev # Create device files
+reprepro # Create apt repositories
+gnupg2 # Recent GnuPG version
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-kde.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-kde.txt
new file mode 100644
index 0000000000..2ce9445a9f
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-kde.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+ark # Archiver
+gwenview # Image viewer
+kate # Text editor
+kcalc # Calculator
+kde-plasma-desktop # Graphical desktop
+khelpcenter # KDE help center
+knotes # Notes application
+kde-spectacle # Screenshot tool
+okular # PDF/PS viewer
+plasma-dataengines-addons # Addons for graphical desktop
+polkit-kde-agent-1 # Communication via D-BUS
+sweeper # Disk cleaner
+konqueror # Web browser
+plasma-nm # Network manager
+xserver-xephyr # Nested X server
+sddm # Display manager
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-lang-base.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-lang-base.txt
new file mode 100644
index 0000000000..49e5a44027
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-lang-base.txt
@@ -0,0 +1,62 @@
+task-amharic
+task-arabic
+task-asturian
+task-basque
+task-belarusian
+task-bengali
+task-bosnian
+task-brazilian-portuguese
+task-bulgarian
+task-catalan
+task-chinese-s
+task-chinese-t
+task-croatian
+task-cyrillic
+task-czech
+task-danish
+task-dutch
+task-english
+task-esperanto
+task-estonian
+task-finnish
+task-french
+task-galician
+task-german
+task-greek
+task-gujarati
+task-hebrew
+task-hindi
+task-hungarian
+task-icelandic
+task-irish
+task-italian
+task-japanese
+task-kazakh
+task-khmer
+task-korean
+task-kurdish
+task-latvian
+task-lithuanian
+task-macedonian
+task-malayalam
+task-marathi
+task-northern-sami
+task-norwegian
+task-persian
+task-polish
+task-portuguese
+task-punjabi
+task-romanian
+task-russian
+task-serbian
+task-slovak
+task-slovenian
+task-spanish
+task-swedish
+task-tagalog
+task-tamil
+task-telugu
+task-thai
+task-turkish
+task-ukrainian
+task-welsh
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-lang-desktop.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-lang-desktop.txt
new file mode 100644
index 0000000000..5efecae5cc
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-lang-desktop.txt
@@ -0,0 +1,72 @@
+task-albanian-desktop
+task-amharic-desktop
+task-arabic-desktop
+task-asturian-desktop
+task-basque-desktop
+task-belarusian-desktop
+task-bengali-desktop
+task-bosnian-desktop
+task-brazilian-portuguese-desktop
+task-british-desktop
+task-bulgarian-desktop
+task-catalan-desktop
+task-chinese-s-desktop
+task-chinese-t-desktop
+task-croatian-desktop
+task-cyrillic-desktop
+task-czech-desktop
+task-danish-desktop
+task-dutch-desktop
+task-dzongkha-desktop
+task-esperanto-desktop
+task-estonian-desktop
+task-finnish-desktop
+task-french-desktop
+task-galician-desktop
+task-georgian-desktop
+task-german-desktop
+task-greek-desktop
+task-gujarati-desktop
+task-hebrew-desktop
+task-hindi-desktop
+task-hungarian-desktop
+task-icelandic-desktop
+task-indonesian-desktop
+task-irish-desktop
+task-italian-desktop
+task-japanese-desktop
+task-kannada-desktop
+task-kazakh-desktop
+task-khmer-desktop
+task-korean-desktop
+task-kurdish-desktop
+task-latvian-desktop
+task-lithuanian-desktop
+task-macedonian-desktop
+task-malayalam-desktop
+task-marathi-desktop
+task-nepali-desktop
+task-northern-sami-desktop
+task-norwegian-desktop
+task-persian-desktop
+task-polish-desktop
+task-portuguese-desktop
+task-punjabi-desktop
+task-romanian-desktop
+task-russian-desktop
+task-serbian-desktop
+task-sinhala-desktop
+task-slovak-desktop
+task-slovenian-desktop
+task-south-african-english-desktop
+task-spanish-desktop
+task-swedish-desktop
+task-tamil-desktop
+task-telugu-desktop
+task-thai-desktop
+task-turkish-desktop
+task-ukrainian-desktop
+task-uyghur-desktop
+task-vietnamese-desktop
+task-welsh-desktop
+task-xhosa-desktop
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-lxde.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-lxde.txt
new file mode 100644
index 0000000000..aac054e1a6
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-lxde.txt
@@ -0,0 +1,20 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxde # Graphical desktop
+lightdm # Display manager for graphical login
+lxtask # Task manager
+evince # PDF/PS viewer
+network-manager-gnome # GUI for network manager
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-lxqt.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-lxqt.txt
new file mode 100644
index 0000000000..ea3a14cc17
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-lxqt.txt
@@ -0,0 +1,40 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxqt-core # LXQT core components
+lxqt-about # About box
+lxqt-admin # LXQT administration
+lxqt-config # LXQT configuration
+lxqt-globalkeys # Keyboard shortcuts
+lxqt-notificationd # Notification daemon
+lxqt-openssh-askpass # GUI to ask for passphrase
+lxqt-policykit # PolicyKit for SELinux
+lxqt-powermanagement # Power management
+lxqt-qtplugin # Equal look for all components
+lxqt-runner # Runners for tasks
+network-manager-gnome # Network manager
+lximage-qt # Image viewer
+lxqt-sudo # Sudo
+qpdfview # PDF/PS viewer
+qps # Process manager
+qterminal # Terminal application
+gucharmap # Character map
+ark # Archive tool
+juffed # Text editor
+nomacs # Graphics viewer
+shutter # Screenshot tool
+sddm-theme-maui # Window manager theme
+sddm # Window manager
+xserver-xephyr # Nested X server
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-mate.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-mate.txt
new file mode 100644
index 0000000000..6f5aed7278
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-mate.txt
@@ -0,0 +1,32 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lightdm # Display manager
+mate-desktop-environment-core # Core Mate desktop components
+atril # Document viewer
+engrampa # Archive manager
+eom # Image viewer
+galculator # Calculator
+mate-applets # Applets
+mate-icon-theme-faenza # Icon theme
+mate-notification-daemon # Daemon for notifications
+mate-power-manager # Power manager
+mate-screensaver # Screen saver
+mate-system-monitor # System monitor
+mate-user-guide # User guide
+mate-utils # Various utilities
+pluma # Text editor
+network-manager-gnome # Network manager
diff --git a/support/dktools/livesys-data/pkg-dktoolian-buster-xfce.txt b/support/dktools/livesys-data/pkg-dktoolian-buster-xfce.txt
new file mode 100644
index 0000000000..c46d581d94
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-buster-xfce.txt
@@ -0,0 +1,38 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+xfwm4 # XFCE window manager
+xfconf # XFCE configuration helper program
+xfce4-settings # XFCE configuration program
+xfce4-panel # The panel in the XFCE window manager
+xfdesktop4 # XFCE desktop configuration program
+thunar # File manager
+gtk2-engines-xfce # Themes engine to use GNOME themes on XFCE
+gtk3-engines-xfce # Themes engine to use GNOME themes on XFCE
+xfce4-session # Session manager for XFCE
+xfce4-appfinder # Search for installed programs
+libxfce4ui-utils # Help files, additional configuration programs
+thunar-volman # Volume manager for remove media in thunar
+tango-icon-theme # Icon theme
+xfce4-notifyd # Desktop notifications daemon
+xfce4-power-manager # Power manager
+lightdm # Display manager (login program)
+xfce4-goodies # Extension programs for XFCE desktop
+xfce4-terminal # Terminal emulation program
+mousepad # Graphical text editor for XFCE
+dbus-x11 # Interprocess message bus
+evince # PDF/PS viewer
+network-manager-gnome # Network manager
+synaptic # Package installation program
+firefox-esr # Web browser
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
diff --git a/support/dktools/livesys-data/pkg_base.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-base.txt
index ecb3025f1d..1b6444dc47 100644
--- a/support/dktools/livesys-data/pkg_base.txt
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-base.txt
@@ -1,10 +1,12 @@
live-boot # Boot configuration for live systems
+live-config-systemd # Configuration for systemd-based live systems
live-config # Configuration for live systems
live-tools # Extra components for live system
user-setup # Set up initial user and password
sudo # Grant root privileges to normal users
firmware-linux-free # Binary firmware for various drivers
kbd # utilities for console/keyboard layout
+keyboard-configuration # Keyboard configuration utilities
console-keymaps # Keyboard mapping files
console-data # Keyboard mapping files
hwinfo # Information about used hardware
@@ -13,7 +15,6 @@ pciutils # Utilities to check PCI devices, i.e. lspci
usbutils # Utilities to check USB devices, i.e. lsusb
hdparm # Hard disk management
smartmontools # Hard disk management
-udisks # Unmount USB devices
genisoimage # Create ISO image
wodim # Burn ISO image to CD/DVD
util-linux # Several system administration commands
@@ -73,9 +74,9 @@ ncftp # Comfortable FTP client
wget # Retrieve files from HTTP/FTP servers
wput # Upload files to FTP server
netcat # The netcat program for IPv4
-netcat6 # The netcat program for IPv6
udpcast # Broadcast/multicast data transmission
clonezilla # Backup and recovery of disk drives
+screen # Screen program is used by clonezilla
partclone # Partition cloning, used blocks only
partimage # Partition imaging, used blocks only
cifs-utils # Mount SMB file systems
@@ -86,3 +87,9 @@ nano # Editor nano
joe # Joes own editor
man # Online-help
makedev # The MAKEDEV program
+lsscsi # List SCSI devices
+open-iscsi # iSCSI implementation
+scsitools # Tools for SCSI devices
+grub-firmware-qemu # Grub firmware for qemu
+udisks # Unmount USB devices
+netcat6 # Netcat with IPv6 support
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-cinnamon.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-cinnamon.txt
new file mode 100644
index 0000000000..cddd4d0a5c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-cinnamon.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+cinnamon-core # Core components of Cinnamon desktop
+eog # Image viewer
+evince # PDF/PS viewer
+fonts-liberation # Font set
+fonts-noto # Yet another font set
+gedit # Text editor
+gnome-calculator # Calculator
+gnome-screenshot # Screenshot tool
+gnome-terminal # Terminal
+xdg-user-dirs-gtk # User directories
+blueman # Bluetooth manager
+gedit-plugins # Plugins for gedit
+gnote # Notes application
+mate-themes # Desktop themes
+yelp # Help viewer
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-firmware.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-firmware.txt
new file mode 100644
index 0000000000..4be58de609
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-firmware.txt
@@ -0,0 +1,24 @@
+atmel-firmware # Atmel at76c50x wireless networking chips
+bluez-firmware # Broadcom BCM203x chipset bluetooth dongles
+dahdi-firmware-nonfree # DAHDI (Zaptel) telephony devices
+firmware-adi # Analog Devices Inc. DSL modem chips
+firmware-atheros # Atheros wireless cards
+firmware-b43-installer # Broadcom 43xx wireless network cards
+firmware-b43legacy-installer # Broadcom 43xx wireless network cards
+firmware-bnx2 # Broadcom NetXtremeII
+firmware-bnx2x # Broadcom NetXtreme II 10Gb
+firmware-brcm80211 # Broadcom 802.11 wireless cards
+firmware-intelwimax # Intel WiMAX Connection devices
+firmware-ipw2x00 # Intel Pro Wireless 2100, 2200 and 2915
+firmware-iwlwifi # Intel Wireless cards
+firmware-libertas # Marvell Libertas 8xxx wireless cards
+firmware-linux # Binary firmware for various drivers
+firmware-linux-nonfree # Binary firmware for various drivers
+firmware-myricom # Myri-10G Ethernet adapters
+firmware-netxen # QLogic Intelligent Ethernet (3000 and 3100)
+firmware-qlogic # Other QLogic devices
+firmware-ralink # Ralink wireless cards
+firmware-realtek # Realtek wired and wireless network adapters
+firmware-ti-connectivity # TI Connectivity wireless network adapters
+firmware-zd1211 # the zd1211rw wireless driver
+prism2-usb-firmware-installer # prism2_usb kernel driver
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-gnome.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-gnome.txt
new file mode 100644
index 0000000000..2027650d10
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-gnome.txt
@@ -0,0 +1,65 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+network-manager-gnome
+libatk-adaptor
+at-spi2-core
+adwaita-icon-theme
+fonts-cantarell
+dconf-cli
+dconf-gsettings-backend
+eog
+evince
+sound-theme-freedesktop
+gedit
+gdm3
+glib-networking
+gnome-backgrounds
+gnome-bluetooth
+gnome-calculator
+gnome-control-center
+gnome-keyring
+libpam-gnome-keyring
+gnome-logs
+gnome-menus
+gnome-session
+gnome-settings-daemon
+gnome-shell
+gnome-shell-extensions
+gnome-system-monitor
+gnome-terminal
+gnome-themes-standard
+gnome-user-guide
+gnome-user-share
+gsettings-desktop-schemas
+gvfs-backends
+gvfs-bin
+gvfs-fuse
+libproxy1-plugin-gsettings
+gkbd-capplet
+nautilus
+pulseaudio
+system-config-printer-udev
+tracker-gui
+yelp
+zenity
+file-roller
+gnome-screenshot
+gnome-tweak-tool
+seahorse
+avahi-daemon
+xdg-user-dirs-gtk
+gedit-plugins
+
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-host.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-host.txt
new file mode 100644
index 0000000000..3d50f78c61
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-host.txt
@@ -0,0 +1,23 @@
+build-essential # Package containing tools to build Debian packages
+autoconf # Create configure scripts automatically
+automake # Create Makefile.in automatically from Makefile.am
+autotools-dev # Files config.guess and config.sub
+dh-make # Create Debian package files for pure source archives
+debhelper # Tool programs for Debian package creation
+devscripts # Scripts for Debian package maintenance
+fakeroot # Wrapper to simulate access to root directory
+lintian # Debian package checker
+patch # Patch a file
+patchutils # Additional tools to work with patches
+pbuilder # Package builder
+make # Compiler control program
+gcc # GNU C compiler
+g++ # GNU C++ compiler
+zlib1g-dev # Development support for zlib
+libbz2-dev # Development support for libbz2
+libssl-dev # Development support for OpenSSL
+libdb-dev # Development support for Berkeley DB
+live-build # Components to build a live system
+debootstrap # Debian bootstrapper (create initial system)
+makedev # Create device files
+reprepro # Create apt repositories
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-kde.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-kde.txt
new file mode 100644
index 0000000000..ea18b42ced
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-kde.txt
@@ -0,0 +1,28 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+ark # Archiver
+gwenview # Image viewer
+kate # Text editor
+kcalc # Calculator
+kde-plasma-desktop # Graphical desktop
+khelpcenter4 # KDE help center
+knotes # Notes application
+okular # PDF/PS viewer
+plasma-dataengines-addons # Addons for graphical desktop
+sweeper # Disk cleaner
+konqueror # Web browser
+plasma-nm # Network manager
+xserver-xephyr # Nested X server
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-lang-base.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-lang-base.txt
new file mode 100644
index 0000000000..49e5a44027
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-lang-base.txt
@@ -0,0 +1,62 @@
+task-amharic
+task-arabic
+task-asturian
+task-basque
+task-belarusian
+task-bengali
+task-bosnian
+task-brazilian-portuguese
+task-bulgarian
+task-catalan
+task-chinese-s
+task-chinese-t
+task-croatian
+task-cyrillic
+task-czech
+task-danish
+task-dutch
+task-english
+task-esperanto
+task-estonian
+task-finnish
+task-french
+task-galician
+task-german
+task-greek
+task-gujarati
+task-hebrew
+task-hindi
+task-hungarian
+task-icelandic
+task-irish
+task-italian
+task-japanese
+task-kazakh
+task-khmer
+task-korean
+task-kurdish
+task-latvian
+task-lithuanian
+task-macedonian
+task-malayalam
+task-marathi
+task-northern-sami
+task-norwegian
+task-persian
+task-polish
+task-portuguese
+task-punjabi
+task-romanian
+task-russian
+task-serbian
+task-slovak
+task-slovenian
+task-spanish
+task-swedish
+task-tagalog
+task-tamil
+task-telugu
+task-thai
+task-turkish
+task-ukrainian
+task-welsh
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-lang-desktop.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-lang-desktop.txt
new file mode 100644
index 0000000000..5efecae5cc
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-lang-desktop.txt
@@ -0,0 +1,72 @@
+task-albanian-desktop
+task-amharic-desktop
+task-arabic-desktop
+task-asturian-desktop
+task-basque-desktop
+task-belarusian-desktop
+task-bengali-desktop
+task-bosnian-desktop
+task-brazilian-portuguese-desktop
+task-british-desktop
+task-bulgarian-desktop
+task-catalan-desktop
+task-chinese-s-desktop
+task-chinese-t-desktop
+task-croatian-desktop
+task-cyrillic-desktop
+task-czech-desktop
+task-danish-desktop
+task-dutch-desktop
+task-dzongkha-desktop
+task-esperanto-desktop
+task-estonian-desktop
+task-finnish-desktop
+task-french-desktop
+task-galician-desktop
+task-georgian-desktop
+task-german-desktop
+task-greek-desktop
+task-gujarati-desktop
+task-hebrew-desktop
+task-hindi-desktop
+task-hungarian-desktop
+task-icelandic-desktop
+task-indonesian-desktop
+task-irish-desktop
+task-italian-desktop
+task-japanese-desktop
+task-kannada-desktop
+task-kazakh-desktop
+task-khmer-desktop
+task-korean-desktop
+task-kurdish-desktop
+task-latvian-desktop
+task-lithuanian-desktop
+task-macedonian-desktop
+task-malayalam-desktop
+task-marathi-desktop
+task-nepali-desktop
+task-northern-sami-desktop
+task-norwegian-desktop
+task-persian-desktop
+task-polish-desktop
+task-portuguese-desktop
+task-punjabi-desktop
+task-romanian-desktop
+task-russian-desktop
+task-serbian-desktop
+task-sinhala-desktop
+task-slovak-desktop
+task-slovenian-desktop
+task-south-african-english-desktop
+task-spanish-desktop
+task-swedish-desktop
+task-tamil-desktop
+task-telugu-desktop
+task-thai-desktop
+task-turkish-desktop
+task-ukrainian-desktop
+task-uyghur-desktop
+task-vietnamese-desktop
+task-welsh-desktop
+task-xhosa-desktop
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-lxde.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-lxde.txt
new file mode 100644
index 0000000000..aac054e1a6
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-lxde.txt
@@ -0,0 +1,20 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxde # Graphical desktop
+lightdm # Display manager for graphical login
+lxtask # Task manager
+evince # PDF/PS viewer
+network-manager-gnome # GUI for network manager
diff --git a/support/dktools/livesys-data/pkg-dktoolian-jessie-mate.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-mate.txt
new file mode 100644
index 0000000000..cde881a996
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-mate.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lightdm # Display manager
+mate-desktop-environment-core # Core Mate desktop components
+atril # Document viewer
+engrampa # Archive manager
+eom # Image viewer
+galculator # Calculator
+mate-applets # Applets
+mate-icon-theme-faenza # Icon theme
+mate-notification-daemon # Daemon for notifications
+mate-power-manager # Power manager
+mate-screensaver # Screen saver
+mate-system-monitor # System monitor
+mate-utils # Various utilities
+pluma # Text editor
+network-manager-gnome # Network manager
diff --git a/support/dktools/livesys-data/pkg_xfce.txt b/support/dktools/livesys-data/pkg-dktoolian-jessie-xfce.txt
index 629b4f2d3c..629b4f2d3c 100644
--- a/support/dktools/livesys-data/pkg_xfce.txt
+++ b/support/dktools/livesys-data/pkg-dktoolian-jessie-xfce.txt
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-base.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-base.txt
new file mode 100644
index 0000000000..4f8ad68f6f
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-base.txt
@@ -0,0 +1,98 @@
+live-boot # Boot configuration for live systems
+live-config-systemd # Configuration for systemd-based live systems
+live-config # Configuration for live systems
+live-tools # Extra components for live system
+user-setup # Set up initial user and password
+sudo # Grant root privileges to normal users
+firmware-linux-free # Binary firmware for various drivers
+kbd # utilities for console/keyboard layout
+console-keymaps # Keyboard mapping files
+console-data # Keyboard mapping files
+hwinfo # Information about used hardware
+lshw # List hardware
+pciutils # Utilities to check PCI devices, i.e. lspci
+usbutils # Utilities to check USB devices, i.e. lsusb
+hdparm # Hard disk management
+smartmontools # Hard disk management
+genisoimage # Create ISO image
+wodim # Burn ISO image to CD/DVD
+util-linux # Several system administration commands
+util-linux-locales # Localized texts for administration commands
+gdisk # Disk partitioning program (GPT)
+parted # Disk partitions management
+gddrescue # attempt data recovery
+squashfs-tools # Tools for squashfs file systems
+e2fsprogs # Tools for ext2, ext3, ext4 file systems
+dosfstools # Access DOS/Windows FAT file systems
+mtools # Floppy disks utilities
+ntfs-3g # NTFS file system
+ntfs-config # Configure NTFS devices
+nfs-client # NFS client
+smbclient # Samba client programs
+binutils # Assembler and related tools for object files
+coreutils # Text processing on command line
+diffutils # Diff and patch files
+patchutils # Diff and patch files
+patch # Apply a patch to a file
+lsof # List all open files
+file # Guess file types
+tcsh # Shell
+bash # Shell
+bash-completion # File name completion
+perl # Scripting language
+m4 # Text macro processor
+bc # Calculator
+cpio # Archivation
+arj # Archivation
+tar # Archivation
+zip # Compression
+unzip # Decompression
+bzip2 # Compression/decompression
+xz-utils # Compression/decompression
+ncompress # Archivation
+lzma # Archivation
+lzop # Archivation
+sed # Text stream manipulation
+dos2unix # Convert dos to unix
+recode # Text recoding
+openssh-client # ssh client
+openssh-server # OpenSSH server
+openssh-sftp-server # OpenSSH sftp server
+openssl # Encryption tool
+md5deep # Calculate checksums
+gnupg # Encryption
+isc-dhcp-client # DHCP client
+iproute # Check IP routes
+iputils-ping # Ping program
+net-tools # Network utilities
+wireless-tools # Wireless networking utilities
+snmp # Network management
+rsync # Remote file/directory synchronization
+rdist # Distribute equal files to multiple computers
+cadaver # DAV client
+lynx # Text mode web browser
+ncftp # Comfortable FTP client
+wget # Retrieve files from HTTP/FTP servers
+wput # Upload files to FTP server
+netcat # The netcat program for IPv4
+udpcast # Broadcast/multicast data transmission
+clonezilla # Backup and recovery of disk drives
+screen # Screen program is used by clonezilla
+partclone # Partition cloning, used blocks only
+partimage # Partition imaging, used blocks only
+cifs-utils # Mount SMB file systems
+dialog # Required by clonezilla
+sshfs # Mount remote directory via SSH protocol
+vim # Editor vi
+nano # Editor nano
+joe # Joes own editor
+man # Online-help
+makedev # The MAKEDEV program
+lsscsi # List SCSI devices
+open-iscsi # iSCSI implementation
+scsitools # Tools for SCSI devices
+grub-firmware-qemu # Grub firmware for qemu
+udisks2 # Unmount USB devices
+console-setup # Customize console
+console-setup-linux # Fonts for console
+systemd-sysv # Script /sbin/init for boot process
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-cinnamon.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-cinnamon.txt
new file mode 100644
index 0000000000..cddd4d0a5c
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-cinnamon.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+cinnamon-core # Core components of Cinnamon desktop
+eog # Image viewer
+evince # PDF/PS viewer
+fonts-liberation # Font set
+fonts-noto # Yet another font set
+gedit # Text editor
+gnome-calculator # Calculator
+gnome-screenshot # Screenshot tool
+gnome-terminal # Terminal
+xdg-user-dirs-gtk # User directories
+blueman # Bluetooth manager
+gedit-plugins # Plugins for gedit
+gnote # Notes application
+mate-themes # Desktop themes
+yelp # Help viewer
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-firmware-gr.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-firmware-gr.txt
new file mode 100644
index 0000000000..43955cb3fc
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-firmware-gr.txt
@@ -0,0 +1,2 @@
+firmware-amd-graphics # AMD/ATI graphics chips
+firmware-crystalhd # Crystal HD Video Decoder
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-firmware.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-firmware.txt
new file mode 100644
index 0000000000..84a0264da3
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-firmware.txt
@@ -0,0 +1,25 @@
+atmel-firmware # Atmel at76c50x wireless networking chips
+bluez-firmware # Broadcom BCM203x chipset bluetooth dongles
+dahdi-firmware-nonfree # DAHDI (Zaptel) telephony devices
+firmware-adi # Analog Devices Inc. DSL modem chips
+firmware-atheros # Atheros wireless cards
+firmware-b43-installer # Broadcom 43xx wireless network cards
+firmware-b43legacy-installer # Broadcom 43xx wireless network cards
+firmware-bnx2 # Broadcom NetXtremeII
+firmware-bnx2x # Broadcom NetXtreme II 10Gb
+firmware-brcm80211 # Broadcom 802.11 wireless cards
+firmware-intelwimax # Intel WiMAX Connection devices
+firmware-ipw2x00 # Intel Pro Wireless 2100, 2200 and 2915
+firmware-iwlwifi # Intel Wireless cards
+firmware-libertas # Marvell Libertas 8xxx wireless cards
+firmware-linux # Binary firmware for various drivers
+firmware-linux-nonfree # Binary firmware for various drivers
+firmware-myricom # Myri-10G Ethernet adapters
+firmware-netxen # QLogic Intelligent Ethernet (3000 and 3100)
+firmware-qlogic # Other QLogic devices
+firmware-ralink # Ralink wireless cards
+firmware-realtek # Realtek wired and wireless network adapters
+firmware-ti-connectivity # TI Connectivity wireless network adapters
+firmware-zd1211 # the zd1211rw wireless driver
+firmware-misc-nonfree # Non-free firmware for various devices
+firmware-cavium # Cavium Ethernet devices
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-gnome.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-gnome.txt
new file mode 100644
index 0000000000..2aa537bb03
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-gnome.txt
@@ -0,0 +1,68 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+network-manager-gnome
+live-task-base
+libatk-adaptor
+at-spi2-core
+adwaita-icon-theme
+fonts-cantarell
+dconf-cli
+dconf-gsettings-backend
+eog
+evince
+sound-theme-freedesktop
+gedit
+gdm3
+glib-networking
+gnome-backgrounds
+gnome-bluetooth
+gnome-calculator
+gnome-characters
+gnome-control-center
+gnome-keyring
+libpam-gnome-keyring
+gnome-logs
+gnome-menus
+gnome-session
+gnome-settings-daemon
+gnome-shell
+gnome-shell-extensions
+gnome-system-monitor
+gnome-terminal
+gnome-themes-standard
+gnome-user-guide
+gnome-user-share
+gsettings-desktop-schemas
+gvfs-backends
+gvfs-bin
+gvfs-fuse
+libproxy1-plugin-gsettings
+gkbd-capplet
+nautilus
+pulseaudio
+system-config-printer-common
+system-config-printer-udev
+tracker-gui
+yelp
+zenity
+file-roller
+gnome-screenshot
+gnome-tweak-tool
+seahorse
+avahi-daemon
+xdg-user-dirs-gtk
+gedit-plugins
+
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-host.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-host.txt
new file mode 100644
index 0000000000..de2d76b703
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-host.txt
@@ -0,0 +1,24 @@
+build-essential # Package containing tools to build Debian packages
+autoconf # Create configure scripts automatically
+automake # Create Makefile.in automatically from Makefile.am
+autotools-dev # Files config.guess and config.sub
+dh-make # Create Debian package files for pure source archives
+debhelper # Tool programs for Debian package creation
+devscripts # Scripts for Debian package maintenance
+fakeroot # Wrapper to simulate access to root directory
+lintian # Debian package checker
+patch # Patch a file
+patchutils # Additional tools to work with patches
+pbuilder # Package builder
+make # Compiler control program
+gcc # GNU C compiler
+g++ # GNU C++ compiler
+zlib1g-dev # Development support for zlib
+libbz2-dev # Development support for libbz2
+libssl-dev # Development support for OpenSSL
+libdb-dev # Development support for Berkeley DB
+live-build # Components to build a live system
+debootstrap # Debian bootstrapper (create initial system)
+makedev # Create device files
+reprepro # Create apt repositories
+gnupg2 # Recent GnuPG version
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-kde.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-kde.txt
new file mode 100644
index 0000000000..2ce9445a9f
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-kde.txt
@@ -0,0 +1,31 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+ark # Archiver
+gwenview # Image viewer
+kate # Text editor
+kcalc # Calculator
+kde-plasma-desktop # Graphical desktop
+khelpcenter # KDE help center
+knotes # Notes application
+kde-spectacle # Screenshot tool
+okular # PDF/PS viewer
+plasma-dataengines-addons # Addons for graphical desktop
+polkit-kde-agent-1 # Communication via D-BUS
+sweeper # Disk cleaner
+konqueror # Web browser
+plasma-nm # Network manager
+xserver-xephyr # Nested X server
+sddm # Display manager
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-lang-base.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-lang-base.txt
new file mode 100644
index 0000000000..49e5a44027
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-lang-base.txt
@@ -0,0 +1,62 @@
+task-amharic
+task-arabic
+task-asturian
+task-basque
+task-belarusian
+task-bengali
+task-bosnian
+task-brazilian-portuguese
+task-bulgarian
+task-catalan
+task-chinese-s
+task-chinese-t
+task-croatian
+task-cyrillic
+task-czech
+task-danish
+task-dutch
+task-english
+task-esperanto
+task-estonian
+task-finnish
+task-french
+task-galician
+task-german
+task-greek
+task-gujarati
+task-hebrew
+task-hindi
+task-hungarian
+task-icelandic
+task-irish
+task-italian
+task-japanese
+task-kazakh
+task-khmer
+task-korean
+task-kurdish
+task-latvian
+task-lithuanian
+task-macedonian
+task-malayalam
+task-marathi
+task-northern-sami
+task-norwegian
+task-persian
+task-polish
+task-portuguese
+task-punjabi
+task-romanian
+task-russian
+task-serbian
+task-slovak
+task-slovenian
+task-spanish
+task-swedish
+task-tagalog
+task-tamil
+task-telugu
+task-thai
+task-turkish
+task-ukrainian
+task-welsh
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-lang-desktop.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-lang-desktop.txt
new file mode 100644
index 0000000000..5efecae5cc
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-lang-desktop.txt
@@ -0,0 +1,72 @@
+task-albanian-desktop
+task-amharic-desktop
+task-arabic-desktop
+task-asturian-desktop
+task-basque-desktop
+task-belarusian-desktop
+task-bengali-desktop
+task-bosnian-desktop
+task-brazilian-portuguese-desktop
+task-british-desktop
+task-bulgarian-desktop
+task-catalan-desktop
+task-chinese-s-desktop
+task-chinese-t-desktop
+task-croatian-desktop
+task-cyrillic-desktop
+task-czech-desktop
+task-danish-desktop
+task-dutch-desktop
+task-dzongkha-desktop
+task-esperanto-desktop
+task-estonian-desktop
+task-finnish-desktop
+task-french-desktop
+task-galician-desktop
+task-georgian-desktop
+task-german-desktop
+task-greek-desktop
+task-gujarati-desktop
+task-hebrew-desktop
+task-hindi-desktop
+task-hungarian-desktop
+task-icelandic-desktop
+task-indonesian-desktop
+task-irish-desktop
+task-italian-desktop
+task-japanese-desktop
+task-kannada-desktop
+task-kazakh-desktop
+task-khmer-desktop
+task-korean-desktop
+task-kurdish-desktop
+task-latvian-desktop
+task-lithuanian-desktop
+task-macedonian-desktop
+task-malayalam-desktop
+task-marathi-desktop
+task-nepali-desktop
+task-northern-sami-desktop
+task-norwegian-desktop
+task-persian-desktop
+task-polish-desktop
+task-portuguese-desktop
+task-punjabi-desktop
+task-romanian-desktop
+task-russian-desktop
+task-serbian-desktop
+task-sinhala-desktop
+task-slovak-desktop
+task-slovenian-desktop
+task-south-african-english-desktop
+task-spanish-desktop
+task-swedish-desktop
+task-tamil-desktop
+task-telugu-desktop
+task-thai-desktop
+task-turkish-desktop
+task-ukrainian-desktop
+task-uyghur-desktop
+task-vietnamese-desktop
+task-welsh-desktop
+task-xhosa-desktop
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-lxde.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-lxde.txt
new file mode 100644
index 0000000000..aac054e1a6
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-lxde.txt
@@ -0,0 +1,20 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxde # Graphical desktop
+lightdm # Display manager for graphical login
+lxtask # Task manager
+evince # PDF/PS viewer
+network-manager-gnome # GUI for network manager
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-lxqt.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-lxqt.txt
new file mode 100644
index 0000000000..ea3a14cc17
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-lxqt.txt
@@ -0,0 +1,40 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lxqt-core # LXQT core components
+lxqt-about # About box
+lxqt-admin # LXQT administration
+lxqt-config # LXQT configuration
+lxqt-globalkeys # Keyboard shortcuts
+lxqt-notificationd # Notification daemon
+lxqt-openssh-askpass # GUI to ask for passphrase
+lxqt-policykit # PolicyKit for SELinux
+lxqt-powermanagement # Power management
+lxqt-qtplugin # Equal look for all components
+lxqt-runner # Runners for tasks
+network-manager-gnome # Network manager
+lximage-qt # Image viewer
+lxqt-sudo # Sudo
+qpdfview # PDF/PS viewer
+qps # Process manager
+qterminal # Terminal application
+gucharmap # Character map
+ark # Archive tool
+juffed # Text editor
+nomacs # Graphics viewer
+shutter # Screenshot tool
+sddm-theme-maui # Window manager theme
+sddm # Window manager
+xserver-xephyr # Nested X server
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-mate.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-mate.txt
new file mode 100644
index 0000000000..6f5aed7278
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-mate.txt
@@ -0,0 +1,32 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+lightdm # Display manager (login program)
+synaptic # Package installation program
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
+lightdm # Display manager
+mate-desktop-environment-core # Core Mate desktop components
+atril # Document viewer
+engrampa # Archive manager
+eom # Image viewer
+galculator # Calculator
+mate-applets # Applets
+mate-icon-theme-faenza # Icon theme
+mate-notification-daemon # Daemon for notifications
+mate-power-manager # Power manager
+mate-screensaver # Screen saver
+mate-system-monitor # System monitor
+mate-user-guide # User guide
+mate-utils # Various utilities
+pluma # Text editor
+network-manager-gnome # Network manager
diff --git a/support/dktools/livesys-data/pkg-dktoolian-stretch-xfce.txt b/support/dktools/livesys-data/pkg-dktoolian-stretch-xfce.txt
new file mode 100644
index 0000000000..c46d581d94
--- /dev/null
+++ b/support/dktools/livesys-data/pkg-dktoolian-stretch-xfce.txt
@@ -0,0 +1,38 @@
+tasksel # Install packages for specified tasks
+xorg # X11 windows system on a desktop
+xserver-xorg-video-all # All video output drivers
+xserver-xorg-input-all # All input device drivers
+desktop-base # Common files for desktop environments
+xdg-utils # Desktop integration programs
+avahi-daemon # Multicast service discovery
+libnss-mdns # NSS module for Multicast DNS name resolution
+anacron # Periodic maintenance jobs
+eject # Eject CD/DVD from drive
+iw # Command line program to configure WiFi
+alsa-utils # Programs to use ALSA sound system
+xfwm4 # XFCE window manager
+xfconf # XFCE configuration helper program
+xfce4-settings # XFCE configuration program
+xfce4-panel # The panel in the XFCE window manager
+xfdesktop4 # XFCE desktop configuration program
+thunar # File manager
+gtk2-engines-xfce # Themes engine to use GNOME themes on XFCE
+gtk3-engines-xfce # Themes engine to use GNOME themes on XFCE
+xfce4-session # Session manager for XFCE
+xfce4-appfinder # Search for installed programs
+libxfce4ui-utils # Help files, additional configuration programs
+thunar-volman # Volume manager for remove media in thunar
+tango-icon-theme # Icon theme
+xfce4-notifyd # Desktop notifications daemon
+xfce4-power-manager # Power manager
+lightdm # Display manager (login program)
+xfce4-goodies # Extension programs for XFCE desktop
+xfce4-terminal # Terminal emulation program
+mousepad # Graphical text editor for XFCE
+dbus-x11 # Interprocess message bus
+evince # PDF/PS viewer
+network-manager-gnome # Network manager
+synaptic # Package installation program
+firefox-esr # Web browser
+system-config-printer # Printer configuration for CUPS
+gnome-orca # Screen reader
diff --git a/support/dktools/livesys-data/pkg_disklessian-buster-lang-desktop.txt b/support/dktools/livesys-data/pkg_disklessian-buster-lang-desktop.txt
new file mode 100644
index 0000000000..5efecae5cc
--- /dev/null
+++ b/support/dktools/livesys-data/pkg_disklessian-buster-lang-desktop.txt
@@ -0,0 +1,72 @@
+task-albanian-desktop
+task-amharic-desktop
+task-arabic-desktop
+task-asturian-desktop
+task-basque-desktop
+task-belarusian-desktop
+task-bengali-desktop
+task-bosnian-desktop
+task-brazilian-portuguese-desktop
+task-british-desktop
+task-bulgarian-desktop
+task-catalan-desktop
+task-chinese-s-desktop
+task-chinese-t-desktop
+task-croatian-desktop
+task-cyrillic-desktop
+task-czech-desktop
+task-danish-desktop
+task-dutch-desktop
+task-dzongkha-desktop
+task-esperanto-desktop
+task-estonian-desktop
+task-finnish-desktop
+task-french-desktop
+task-galician-desktop
+task-georgian-desktop
+task-german-desktop
+task-greek-desktop
+task-gujarati-desktop
+task-hebrew-desktop
+task-hindi-desktop
+task-hungarian-desktop
+task-icelandic-desktop
+task-indonesian-desktop
+task-irish-desktop
+task-italian-desktop
+task-japanese-desktop
+task-kannada-desktop
+task-kazakh-desktop
+task-khmer-desktop
+task-korean-desktop
+task-kurdish-desktop
+task-latvian-desktop
+task-lithuanian-desktop
+task-macedonian-desktop
+task-malayalam-desktop
+task-marathi-desktop
+task-nepali-desktop
+task-northern-sami-desktop
+task-norwegian-desktop
+task-persian-desktop
+task-polish-desktop
+task-portuguese-desktop
+task-punjabi-desktop
+task-romanian-desktop
+task-russian-desktop
+task-serbian-desktop
+task-sinhala-desktop
+task-slovak-desktop
+task-slovenian-desktop
+task-south-african-english-desktop
+task-spanish-desktop
+task-swedish-desktop
+task-tamil-desktop
+task-telugu-desktop
+task-thai-desktop
+task-turkish-desktop
+task-ukrainian-desktop
+task-uyghur-desktop
+task-vietnamese-desktop
+task-welsh-desktop
+task-xhosa-desktop
diff --git a/support/dktools/livesys-data/pkg_disklessian-stretch-lang-desktop.txt b/support/dktools/livesys-data/pkg_disklessian-stretch-lang-desktop.txt
new file mode 100644
index 0000000000..5efecae5cc
--- /dev/null
+++ b/support/dktools/livesys-data/pkg_disklessian-stretch-lang-desktop.txt
@@ -0,0 +1,72 @@
+task-albanian-desktop
+task-amharic-desktop
+task-arabic-desktop
+task-asturian-desktop
+task-basque-desktop
+task-belarusian-desktop
+task-bengali-desktop
+task-bosnian-desktop
+task-brazilian-portuguese-desktop
+task-british-desktop
+task-bulgarian-desktop
+task-catalan-desktop
+task-chinese-s-desktop
+task-chinese-t-desktop
+task-croatian-desktop
+task-cyrillic-desktop
+task-czech-desktop
+task-danish-desktop
+task-dutch-desktop
+task-dzongkha-desktop
+task-esperanto-desktop
+task-estonian-desktop
+task-finnish-desktop
+task-french-desktop
+task-galician-desktop
+task-georgian-desktop
+task-german-desktop
+task-greek-desktop
+task-gujarati-desktop
+task-hebrew-desktop
+task-hindi-desktop
+task-hungarian-desktop
+task-icelandic-desktop
+task-indonesian-desktop
+task-irish-desktop
+task-italian-desktop
+task-japanese-desktop
+task-kannada-desktop
+task-kazakh-desktop
+task-khmer-desktop
+task-korean-desktop
+task-kurdish-desktop
+task-latvian-desktop
+task-lithuanian-desktop
+task-macedonian-desktop
+task-malayalam-desktop
+task-marathi-desktop
+task-nepali-desktop
+task-northern-sami-desktop
+task-norwegian-desktop
+task-persian-desktop
+task-polish-desktop
+task-portuguese-desktop
+task-punjabi-desktop
+task-romanian-desktop
+task-russian-desktop
+task-serbian-desktop
+task-sinhala-desktop
+task-slovak-desktop
+task-slovenian-desktop
+task-south-african-english-desktop
+task-spanish-desktop
+task-swedish-desktop
+task-tamil-desktop
+task-telugu-desktop
+task-thai-desktop
+task-turkish-desktop
+task-ukrainian-desktop
+task-uyghur-desktop
+task-vietnamese-desktop
+task-welsh-desktop
+task-xhosa-desktop
diff --git a/support/dktools/livesys-data/root-cli/usr/share/dktoolian/getty.sed b/support/dktools/livesys-data/root-cli/usr/share/dktoolian/getty.sed
deleted file mode 100644
index d1a8c9d3fd..0000000000
--- a/support/dktools/livesys-data/root-cli/usr/share/dktoolian/getty.sed
+++ /dev/null
@@ -1 +0,0 @@
-/^ExecStart=/s/\-\-noclear/--autologin root --noclear/
diff --git a/support/dktools/livesys-data/root-create-repodir.sh b/support/dktools/livesys-data/root-create-repodir.sh
new file mode 100755
index 0000000000..887099dbb4
--- /dev/null
+++ b/support/dktools/livesys-data/root-create-repodir.sh
@@ -0,0 +1,3 @@
+#! /bin/sh
+mkdir -p /var/www/html/debian/repo
+chown -R livesys:livesys /var/www/html/debian
diff --git a/support/dktools/livesys-data/root-install-packages.sh b/support/dktools/livesys-data/root-install-packages.sh
new file mode 100755
index 0000000000..f8f7828fa3
--- /dev/null
+++ b/support/dktools/livesys-data/root-install-packages.sh
@@ -0,0 +1,77 @@
+#! /bin/sh
+
+# Ensure to run the script as root
+
+if [ "X$LOGNAME" != "Xroot" ]
+then
+ echo 'ERROR: This script must be run as root!'
+ exit 1
+fi
+
+
+DEBVMAJ=`cat /etc/debian_version | cut -f 1 -d .`
+case "X$DEBVMAJ" in
+"X8")
+ DEBVMAJ="jessie"
+;;
+"X9")
+ DEBVMAJ="stretch"
+;;
+"X10")
+ DEBVMAJ="buster"
+;;
+"X")
+ echo 'E: Not on a Debian system'
+ exit 1
+;;
+*)
+ echo 'E: Can not handle Debian major version' $DEBVMAJ
+ exit 1
+;;
+esac
+
+# Make sure system is up to date
+
+apt-get -y update
+apt-get -y upgrade
+
+
+# Developer tools for both kernel and DK tools building
+
+P="aptitude build-essential autoconf automake autotools-dev"
+P="$P dh-make debhelper unifdef libncurses5-dev libqt4-dev"
+P="$P devscripts fakeroot file gfortran git gnupg gnupg2 fp-compiler"
+P="$P lintian patch patchutils pbuilder dpkg-sig perl python"
+P="$P quilt xutils-dev make gcc g++"
+
+if [ "X$DEBVMAJ" = "Xjessie" ]
+then
+ P="$P kernel-package"
+fi
+
+P="$P libglade2-dev libgtk2.0-dev pinentry-curses reprepro"
+
+# DK tools dependencies
+
+P="$P zlib1g-dev libbz2-dev libssl-dev"
+
+
+# Packages to build a live system
+
+P="$P live-build live-manual-html live-manual-pdf"
+P="$P live-boot-doc live-config-doc"
+
+
+# Apache web server for repository
+
+P="$P apache2"
+
+
+# Install all the packages
+
+apt-get -y install $P
+
+
+# Check if something is missing to build a kernel
+
+apt-get -y build-dep linux
diff --git a/support/dktools/livesys-data/root/usr/local/bin/dktoolian-etc b/support/dktools/livesys-data/root/usr/local/bin/dktoolian-etc
deleted file mode 100755
index 04ee8bcbef..0000000000
--- a/support/dktools/livesys-data/root/usr/local/bin/dktoolian-etc
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/sh
-
-[ -d /usr/share/dktoolian/etc ] || exit 0
-
-umask 022
-cd /usr/share/dktoolian/etc
-for i in `find . -type d`
-do
- if [ ! -d /etc/$i ]
- then
- mkdir -p /etc/$i
- chmod 755 /etc/$i
- fi
-done
-for i in `find . -type f`
-do
- cp $i /etc/$i
-done
-
diff --git a/support/dktools/livesys-data/root/usr/local/bin/dktoolian-ntp b/support/dktools/livesys-data/root/usr/local/bin/dktoolian-ntp
deleted file mode 100755
index 60d395941f..0000000000
--- a/support/dktools/livesys-data/root/usr/local/bin/dktoolian-ntp
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /bin/sh
-cp /usr/share/dktoolian/ntp.conf.template /etc/ntp.conf
diff --git a/support/dktools/livesys-data/root/usr/share/dktoolian/ntp.conf.template b/support/dktools/livesys-data/root/usr/share/dklivesys/templates/ntp.conf
index ed6a32931f..ed6a32931f 100644
--- a/support/dktools/livesys-data/root/usr/share/dktoolian/ntp.conf.template
+++ b/support/dktools/livesys-data/root/usr/share/dklivesys/templates/ntp.conf
diff --git a/support/dktools/livesys-data/root/usr/share/dktoolian/etc-files.sed b/support/dktools/livesys-data/root/usr/share/dktoolian/etc-files.sed
deleted file mode 100644
index e518dce937..0000000000
--- a/support/dktools/livesys-data/root/usr/share/dktoolian/etc-files.sed
+++ /dev/null
@@ -1,2 +0,0 @@
-/^[ \t]*exit[ \t][ \t]*0[ \t]*$/c/usr/local/bin/dktoolian-etc\nexit 0
-
diff --git a/support/dktools/livesys-data/sed-buster-login-grub.txt b/support/dktools/livesys-data/sed-buster-login-grub.txt
new file mode 100644
index 0000000000..54d67d2b57
--- /dev/null
+++ b/support/dktools/livesys-data/sed-buster-login-grub.txt
@@ -0,0 +1,2 @@
+/^\tlinux[ \t]/s/[ \t][ \t]*components[ \t][ \t]*/ components live-config.username=root /g
+
diff --git a/support/dktools/livesys-data/sed-buster-login-iso.txt b/support/dktools/livesys-data/sed-buster-login-iso.txt
new file mode 100644
index 0000000000..18e537b2ea
--- /dev/null
+++ b/support/dktools/livesys-data/sed-buster-login-iso.txt
@@ -0,0 +1,2 @@
+/^\tappend[ \t]/s/[ \t][ \t]*components[ \t][ \t]*/ components live-config.username=root /g
+
diff --git a/support/dktools/livesys-data/sed-isolinux-menu.txt b/support/dktools/livesys-data/sed-isolinux-menu.txt
new file mode 100644
index 0000000000..460e78ce24
--- /dev/null
+++ b/support/dktools/livesys-data/sed-isolinux-menu.txt
@@ -0,0 +1 @@
+/menu[ \t][ \t]*begin[ \t][ \t]*advanced/,/menu[ \t][ \t]*end/d
diff --git a/support/dktools/livesys-data/sed_isolinux.txt b/support/dktools/livesys-data/sed-isolinux.txt
index d8edfcf46a..d8edfcf46a 100644
--- a/support/dktools/livesys-data/sed_isolinux.txt
+++ b/support/dktools/livesys-data/sed-isolinux.txt
diff --git a/support/dktools/livesys-data/sed_menu.txt b/support/dktools/livesys-data/sed-menu.txt
index 7f4f8a6814..7f4f8a6814 100644
--- a/support/dktools/livesys-data/sed_menu.txt
+++ b/support/dktools/livesys-data/sed-menu.txt
diff --git a/support/dktools/livesys-data/sed-stretch-login-grub.txt b/support/dktools/livesys-data/sed-stretch-login-grub.txt
new file mode 100644
index 0000000000..54d67d2b57
--- /dev/null
+++ b/support/dktools/livesys-data/sed-stretch-login-grub.txt
@@ -0,0 +1,2 @@
+/^\tlinux[ \t]/s/[ \t][ \t]*components[ \t][ \t]*/ components live-config.username=root /g
+
diff --git a/support/dktools/livesys-data/sed-stretch-login-iso.txt b/support/dktools/livesys-data/sed-stretch-login-iso.txt
new file mode 100644
index 0000000000..18e537b2ea
--- /dev/null
+++ b/support/dktools/livesys-data/sed-stretch-login-iso.txt
@@ -0,0 +1,2 @@
+/^\tappend[ \t]/s/[ \t][ \t]*components[ \t][ \t]*/ components live-config.username=root /g
+
diff --git a/support/dktools/livesys-data/sed_nobeep.txt b/support/dktools/livesys-data/sed_nobeep.txt
deleted file mode 100644
index 1e5b3d3cd8..0000000000
--- a/support/dktools/livesys-data/sed_nobeep.txt
+++ /dev/null
@@ -1 +0,0 @@
-/^[ \t]*[Mm][Ee][Nn][Uu][ \t][ \t]*[Tt][Ii][Tt][Ll][Ee][ \t]/s/\o007//
diff --git a/support/dktools/lprngcl.c b/support/dktools/lprngcl.c
index a6fe3f57f0..d84ec9c6bc 100644
--- a/support/dktools/lprngcl.c
+++ b/support/dktools/lprngcl.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: lprngcl.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: lprngcl.ctr
*/
@@ -83,8 +61,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
-#if DK4_HAVE_MATH_H
+#if DK4_HAVE_MATH_H
#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -107,12 +90,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4socka.h"
#include "dk4user.h"
#include "dk4rec.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 86 "lprngcl.ctr"
+#line 95 "lprngcl.ctr"
/** Buffer for request and response data.
@@ -162,7 +149,7 @@ dkT(""),
NULL
-#line 134 "lprngcl.ctr"
+#line 143 "lprngcl.ctr"
};
@@ -174,7 +161,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -201,27 +189,27 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -295,7 +283,7 @@ dkT(""),
NULL
-#line 265 "lprngcl.ctr"
+#line 275 "lprngcl.ctr"
};
@@ -335,7 +323,7 @@ dkT("lprngcl.str"),
NULL
-#line 300 "lprngcl.ctr"
+#line 310 "lprngcl.ctr"
};
@@ -388,7 +376,7 @@ dkT("\"."),
NULL
-#line 362 "lprngcl.ctr"
+#line 372 "lprngcl.ctr"
};
@@ -406,7 +394,7 @@ static const char * const lprngcl_c8_kw[] = {
NULL
-#line 381 "lprngcl.ctr"
+#line 391 "lprngcl.ctr"
};
@@ -510,8 +498,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -521,8 +510,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -531,8 +521,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -556,10 +547,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -580,7 +579,7 @@ use_timeout(double to)
{
-#line 553 "lprngcl.ctr"
+#line 574 "lprngcl.ctr"
if (0.0 > to) { to = -1.0 * to; }
to_secs = (long)floor(to);
to = to - floor(to);
@@ -588,7 +587,7 @@ use_timeout(double to)
to_usecs = (long)floor(to);
-#line 559 "lprngcl.ctr"
+#line 580 "lprngcl.ctr"
}
@@ -604,12 +603,12 @@ process_options(void)
int back = 1;
-#line 573 "lprngcl.ctr"
+#line 594 "lprngcl.ctr"
if (0 != dk4app_opt_is_set_short(app, dkT('t'), NULL)) {
if (0 != dk4app_opt_get_double_short(&to, app, dkT('t'), NULL)) {
-#line 576 "lprngcl.ctr"
+#line 597 "lprngcl.ctr"
use_timeout(to);
}
} else {
@@ -617,18 +616,18 @@ process_options(void)
if (0 != dk4app_opt_is_set_short(app, dkT('a'), NULL)) {
-#line 582 "lprngcl.ctr"
+#line 603 "lprngcl.ctr"
isUtf8 = 0;
}
if (0 != dk4app_opt_is_set_short(app, dkT('v'), NULL)) {
-#line 586 "lprngcl.ctr"
+#line 607 "lprngcl.ctr"
isVerbose = 1;
}
-#line 589 "lprngcl.ctr"
+#line 610 "lprngcl.ctr"
return back;
}
@@ -639,13 +638,16 @@ process_options(void)
static
int
lprngcl_char_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
if (0 == dk4fputc(c, stdout, NULL)) {
exval = EXIT_FAILURE;
wrerror = 1;
@@ -672,65 +674,71 @@ process_one_delete_request(const dkChar *hptr, const dkChar *fullqueue)
dk4_socket_t sock;
-#line 631 "lprngcl.ctr"
+#line 655 "lprngcl.ctr"
rql = dk4str8_len(buf);
sock = dk4socket_tcp_client_for_host_port_app(
hptr, 515, 0, to_secs, to_usecs, app
);
if (INVALID_SOCKET != sock) {
-#line 636 "lprngcl.ctr"
+#line 660 "lprngcl.ctr"
wrb = rql;
if (0 != isVerbose) {
-#line 638 "lprngcl.ctr"
+#line 662 "lprngcl.ctr"
if (0 == dk4fputs(fullqueue, stdout, NULL)) {
wrerror = 1;
-#line 640 "lprngcl.ctr"
+#line 664 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
if (0 == dk4fputc(dkT('\n'), stdout, NULL)) {
wrerror = 1;
-#line 644 "lprngcl.ctr"
+#line 668 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
}
-#line 647 "lprngcl.ctr"
+#line 671 "lprngcl.ctr"
res = dk4socket_send_attempt_app(
sock, buf, &wrb, 0, to_secs, to_usecs, app, 1
);
-#line 650 "lprngcl.ctr"
+#line 674 "lprngcl.ctr"
switch (res) {
case DK4_SOCKET_RESULT_SUCCESS :
case DK4_SOCKET_RESULT_IN_PROGRESS :
{
-#line 654 "lprngcl.ctr"
+#line 678 "lprngcl.ctr"
if ((0 != isVerbose) && (DK4_SOCKET_RESULT_SUCCESS == res)) {
-#line 656 "lprngcl.ctr"
+#line 680 "lprngcl.ctr"
res = dk4socket_shutdown_app(sock, DK4_SOCKET_SHUT_WRITE, app);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 658 "lprngcl.ctr"
+#line 682 "lprngcl.ctr"
tspok = dk4tspdk_setup_char(
&tspdk, NULL, lprngcl_char_handler,
dk4app_get_stdout_encoding(app),
(
(0 != isUtf8)
? (DK4_FILE_ENCODING_UTF8)
- : (DK4_FILE_ENCODING_ASCII)
+ : (
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+ )
),
NULL
);
if (0 == tspok) {
-#line 669 "lprngcl.ctr"
+#line 699 "lprngcl.ctr"
/* ERROR: Failed to set up text stream processor */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 2);
exval = EXIT_FAILURE;
@@ -739,28 +747,28 @@ process_one_delete_request(const dkChar *hptr, const dkChar *fullqueue)
do {
if (0 != sig_can_continue(0)) {
-#line 676 "lprngcl.ctr"
+#line 706 "lprngcl.ctr"
wrb = sizeof(buf);
res = dk4socket_recv_app(
sock, buf, &wrb, 0, to_secs, to_usecs, app
);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 681 "lprngcl.ctr"
+#line 711 "lprngcl.ctr"
if (0 == wrb) {
-#line 682 "lprngcl.ctr"
+#line 712 "lprngcl.ctr"
cc = 0;
} else {
-#line 684 "lprngcl.ctr"
+#line 714 "lprngcl.ctr"
if (0 != tspok) {
-#line 685 "lprngcl.ctr"
+#line 715 "lprngcl.ctr"
res = dk4tspdk_add_bytes(&tspdk,(unsigned char *)buf,wrb);
if (DK4_TSP_RES_OK != res) {
-#line 687 "lprngcl.ctr"
+#line 717 "lprngcl.ctr"
exval = EXIT_FAILURE;
tspok = 0;
}
@@ -768,68 +776,68 @@ process_one_delete_request(const dkChar *hptr, const dkChar *fullqueue)
}
} else {
-#line 693 "lprngcl.ctr"
+#line 723 "lprngcl.ctr"
cc = 0;
}
} else {
-#line 696 "lprngcl.ctr"
+#line 726 "lprngcl.ctr"
cc = -1;
}
} while(1 == cc);
if ((0 == cc) && (0 != tspok)) {
-#line 700 "lprngcl.ctr"
+#line 730 "lprngcl.ctr"
res = dk4tspdk_finish(&tspdk);
if (DK4_TSP_RES_OK != res) {
-#line 702 "lprngcl.ctr"
+#line 732 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
}
} else {
-#line 706 "lprngcl.ctr"
+#line 736 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
} else {
-#line 709 "lprngcl.ctr"
+#line 739 "lprngcl.ctr"
res = dk4socket_shutdown_app(sock, DK4_SOCKET_SHUT_WRITE, app);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 711 "lprngcl.ctr"
+#line 741 "lprngcl.ctr"
cc = 1;
do {
if (0 != sig_can_continue(0)) {
-#line 714 "lprngcl.ctr"
+#line 744 "lprngcl.ctr"
wrb = sizeof(buf);
res = dk4socket_recv_app(
sock, buf, &wrb, 0, to_secs, to_usecs, app
);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 719 "lprngcl.ctr"
+#line 749 "lprngcl.ctr"
if (0 == wrb) {
-#line 720 "lprngcl.ctr"
+#line 750 "lprngcl.ctr"
cc = 0;
}
} else {
-#line 723 "lprngcl.ctr"
+#line 753 "lprngcl.ctr"
cc = 0;
}
} else {
-#line 726 "lprngcl.ctr"
+#line 756 "lprngcl.ctr"
cc = -1;
}
} while(1 == cc);
} else {
-#line 730 "lprngcl.ctr"
+#line 760 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
}
@@ -837,24 +845,24 @@ process_one_delete_request(const dkChar *hptr, const dkChar *fullqueue)
#if TRACE_DEBUG
default : {
-#line 736 "lprngcl.ctr"
+#line 766 "lprngcl.ctr"
} break;
#endif
}
res = dk4socket_close_app(sock, app);
if (DK4_SOCKET_RESULT_SUCCESS != res) {
-#line 741 "lprngcl.ctr"
+#line 771 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
} else {
-#line 744 "lprngcl.ctr"
+#line 774 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
-#line 747 "lprngcl.ctr"
+#line 777 "lprngcl.ctr"
}
@@ -872,102 +880,102 @@ send_delete_requests(int xargc)
int i = 0; /* Current cmd line arg index */
-#line 763 "lprngcl.ctr"
+#line 793 "lprngcl.ctr"
if (0 != dk4user_get_logname(username, DK4_SIZEOF(username,dkChar),0, NULL)) {
-#line 765 "lprngcl.ctr"
+#line 795 "lprngcl.ctr"
if (0 != isUtf8) {
-#line 766 "lprngcl.ctr"
+#line 796 "lprngcl.ctr"
res = dk4recode_dk_to_any(
user8, sizeof(user8), DK4_ENCODING_UTF8, username,
dk4app_get_encoding(app), NULL
);
} else {
-#line 771 "lprngcl.ctr"
+#line 801 "lprngcl.ctr"
res = dk4recode_dk_to_any(
- user8, sizeof(user8), DK4_ENCODING_ASCII, username,
+ user8, sizeof(user8), DK4_ENCODING_PLAIN, username,
dk4app_get_encoding(app), NULL
);
}
if (0 != res) {
-#line 777 "lprngcl.ctr"
+#line 807 "lprngcl.ctr"
exval = EXIT_SUCCESS;
for (i = 0; ((i < xargc) && (sig_can_continue(0))); i++) {
-#line 780 "lprngcl.ctr"
+#line 810 "lprngcl.ctr"
xargv = dk4app_get_argv(app, i);
if (NULL != xargv) {
-#line 782 "lprngcl.ctr"
+#line 812 "lprngcl.ctr"
if (0 != dk4str_cpy_s(curqueue, szcurqueue, xargv, NULL)) {
-#line 784 "lprngcl.ctr"
+#line 814 "lprngcl.ctr"
hptr = dk4str_chr(curqueue, dkT('@'));
if (NULL != hptr) {
*(hptr++) = dkT('\0');
hptr = dk4str_start(hptr, NULL);
if (NULL != hptr) {
-#line 789 "lprngcl.ctr"
+#line 819 "lprngcl.ctr"
if (0 != isUtf8) {
-#line 790 "lprngcl.ctr"
+#line 820 "lprngcl.ctr"
res = dk4recode_dk_to_any(
queue8, sizeof(queue8), DK4_ENCODING_UTF8, curqueue,
dk4app_get_encoding(app), NULL
);
} else {
-#line 795 "lprngcl.ctr"
+#line 825 "lprngcl.ctr"
res = dk4recode_dk_to_any(
- queue8, sizeof(queue8), DK4_ENCODING_ASCII, curqueue,
+ queue8, sizeof(queue8), DK4_ENCODING_PLAIN, curqueue,
dk4app_get_encoding(app), NULL
);
}
if (0 != res) {
-#line 801 "lprngcl.ctr"
+#line 831 "lprngcl.ctr"
res = 1;
if (0 == dk4str8_cpy_s(buf, szbuf, lprngcl_c8_kw[0], NULL)) {
res = 0;
-#line 804 "lprngcl.ctr"
+#line 834 "lprngcl.ctr"
buf[0] = '\0';
}
if (0 == dk4str8_cat_s(buf, szbuf, queue8, NULL)) {
res = 0;
-#line 808 "lprngcl.ctr"
+#line 838 "lprngcl.ctr"
}
if (0 == dk4str8_cat_s(buf, szbuf, lprngcl_c8_kw[0], NULL)) {
res = 0;
-#line 811 "lprngcl.ctr"
+#line 841 "lprngcl.ctr"
}
if (0 == dk4str8_cat_s(buf, szbuf, user8, NULL)) {
res = 0;
-#line 814 "lprngcl.ctr"
+#line 844 "lprngcl.ctr"
}
if (0 == dk4str8_cat_s(buf, szbuf, lprngcl_c8_kw[0], NULL)) {
res = 0;
-#line 817 "lprngcl.ctr"
+#line 847 "lprngcl.ctr"
}
if (0 == dk4str8_cat_s(buf, szbuf, user8, NULL)) {
res = 0;
-#line 820 "lprngcl.ctr"
+#line 850 "lprngcl.ctr"
}
if (0 != res) {
-#line 822 "lprngcl.ctr"
+#line 852 "lprngcl.ctr"
/* LOG Print removal request */
#if DK4_CHAR_SIZE == 1
dk4app_log_3(app, msg, sz_msg, DK4_LL_INFO, 12, 13, buf);
@@ -976,50 +984,50 @@ send_delete_requests(int xargc)
if (0 == dk4str8_cat_s(buf, szbuf, lprngcl_c8_kw[1], NULL)) {
res = 0;
-#line 829 "lprngcl.ctr"
+#line 859 "lprngcl.ctr"
}
buf[0] = 0x05;
if (0 != res) {
-#line 832 "lprngcl.ctr"
+#line 862 "lprngcl.ctr"
process_one_delete_request(hptr, xargv);
} else {
-#line 834 "lprngcl.ctr"
+#line 864 "lprngcl.ctr"
/* ERROR: Failed to construct request */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 3);
}
} else {
-#line 838 "lprngcl.ctr"
+#line 868 "lprngcl.ctr"
exval = EXIT_FAILURE;
/* ERROR: Failed to convert queue name to 8 bit text */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 4);
}
} else {
-#line 843 "lprngcl.ctr"
+#line 873 "lprngcl.ctr"
exval = EXIT_FAILURE;
/* ERROR: No host name in queue */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 5);
}
} else {
-#line 848 "lprngcl.ctr"
+#line 878 "lprngcl.ctr"
exval = EXIT_FAILURE;
/* ERROR: No host name in queue */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 5);
}
} else {
-#line 853 "lprngcl.ctr"
+#line 883 "lprngcl.ctr"
exval = EXIT_FAILURE;
/* ERROR: Queue name too long */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 6);
}
} else {
-#line 858 "lprngcl.ctr"
+#line 888 "lprngcl.ctr"
exval = EXIT_FAILURE;
/* ERROR: Failed to obtain command line argument */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 7);
@@ -1027,19 +1035,19 @@ send_delete_requests(int xargc)
}
} else {
-#line 864 "lprngcl.ctr"
+#line 894 "lprngcl.ctr"
/* ERROR: Failed to recode user name to 8 bit characters */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 8);
}
} else {
-#line 868 "lprngcl.ctr"
+#line 898 "lprngcl.ctr"
/* ERROR: Failed to find current user name */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 9);
}
-#line 872 "lprngcl.ctr"
+#line 902 "lprngcl.ctr"
}
@@ -1053,27 +1061,27 @@ run_the_functions(void)
int xargc = 0;
-#line 884 "lprngcl.ctr"
+#line 914 "lprngcl.ctr"
if (0 != process_options()) {
-#line 885 "lprngcl.ctr"
+#line 915 "lprngcl.ctr"
xargc = dk4app_get_argc(app);
if (0 < xargc) {
-#line 887 "lprngcl.ctr"
+#line 917 "lprngcl.ctr"
if (0 != dk4socket_up_app(app)) {
-#line 888 "lprngcl.ctr"
+#line 918 "lprngcl.ctr"
send_delete_requests(xargc);
dk4socket_down_app(app);
} else {
-#line 891 "lprngcl.ctr"
+#line 921 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
} else {
-#line 894 "lprngcl.ctr"
+#line 924 "lprngcl.ctr"
/* ERROR: No queues specified */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 10);
}
@@ -1081,12 +1089,12 @@ run_the_functions(void)
#if TRACE_DEBUG
else {
-#line 900 "lprngcl.ctr"
+#line 930 "lprngcl.ctr"
}
#endif
-#line 903 "lprngcl.ctr"
+#line 933 "lprngcl.ctr"
}
@@ -1111,7 +1119,7 @@ run_with_signals(void)
int success = 0;
-#line 926 "lprngcl.ctr"
+#line 956 "lprngcl.ctr"
#ifdef SIGPIPE
/* Set up signal handling for SIGPIPE.
*/
@@ -1120,21 +1128,21 @@ run_with_signals(void)
npipe.sa_flags = 0;
if (0 != sigemptyset(&npipe.sa_mask)) {
-#line 933 "lprngcl.ctr"
+#line 963 "lprngcl.ctr"
/* ERROR: Failed to set up masked signal set for SIGPIPE */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto finished;
}
if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
-#line 938 "lprngcl.ctr"
+#line 968 "lprngcl.ctr"
/* ERROR: Failed to set up masked signal set for SIGPIPE */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto finished;
}
if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
-#line 943 "lprngcl.ctr"
+#line 973 "lprngcl.ctr"
/* ERROR: Failed to set up signal handler for SIGPIPE */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto finished;
@@ -1148,21 +1156,21 @@ run_with_signals(void)
nint.sa_flags = 0;
if (0 != sigemptyset(&nint.sa_mask)) {
-#line 955 "lprngcl.ctr"
+#line 985 "lprngcl.ctr"
/* ERROR: Failed to set up masked signal set for SIGINT */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto restore_old_pipe;
}
if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
-#line 960 "lprngcl.ctr"
+#line 990 "lprngcl.ctr"
/* ERROR: Failed to set up masked signal set for SIGINT */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto restore_old_pipe;
}
if (0 != sigaction(SIGINT, &nint, &oint)) {
-#line 965 "lprngcl.ctr"
+#line 995 "lprngcl.ctr"
/* ERROR: Failed to set up signal handler for SIGINT */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto restore_old_pipe;
@@ -1175,21 +1183,21 @@ run_with_signals(void)
nterm.sa_flags = 0;
if (0 != sigemptyset(&nterm.sa_mask)) {
-#line 976 "lprngcl.ctr"
+#line 1006 "lprngcl.ctr"
/* ERROR: Failed to set up masked signal set for SIGTERM */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto restore_old_int;
}
if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
-#line 981 "lprngcl.ctr"
+#line 1011 "lprngcl.ctr"
/* ERROR: Failed to set up masked signal set for SIGTERM */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto restore_old_int;
}
if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
-#line 986 "lprngcl.ctr"
+#line 1016 "lprngcl.ctr"
/* ERROR: Failed to set up signal handler for SIGTERM */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 0);
goto restore_old_int;
@@ -1197,14 +1205,14 @@ run_with_signals(void)
success = 1;
-#line 992 "lprngcl.ctr"
+#line 1022 "lprngcl.ctr"
run_the_functions();
/* Restore signal handling for SIGTERM.
*/
if (0 != sigaction(SIGTERM, &oterm, NULL)) {
-#line 997 "lprngcl.ctr"
+#line 1027 "lprngcl.ctr"
/* ERROR: Failed to restore old SIGTERM settings */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 1);
success = 0;
@@ -1215,7 +1223,7 @@ run_with_signals(void)
restore_old_int:
if (0 != sigaction(SIGINT, &oint, NULL)) {
-#line 1006 "lprngcl.ctr"
+#line 1036 "lprngcl.ctr"
/* ERROR: Failed to restore old SIGPIPE settings */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 1);
success = 0;
@@ -1227,7 +1235,7 @@ run_with_signals(void)
restore_old_pipe:
if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
-#line 1016 "lprngcl.ctr"
+#line 1046 "lprngcl.ctr"
/* ERROR: Failed to restore old SIGPIPE settings */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 1);
success = 0;
@@ -1239,12 +1247,12 @@ run_with_signals(void)
finished:
if (0 == success) {
-#line 1026 "lprngcl.ctr"
+#line 1056 "lprngcl.ctr"
exval = EXIT_FAILURE;
}
-#line 1029 "lprngcl.ctr"
+#line 1059 "lprngcl.ctr"
}
#else
#if DK4_HAVE_SIGSET
@@ -1261,7 +1269,7 @@ run_with_signals(void)
dk4_sig_handler_t *oldterm = NULL;
-#line 1044 "lprngcl.ctr"
+#line 1074 "lprngcl.ctr"
#ifdef SIGPIPE
oldpipe = sigset(SIGPIPE, sig_handler_pipe);
#endif
@@ -1275,7 +1283,7 @@ run_with_signals(void)
#endif
-#line 1056 "lprngcl.ctr"
+#line 1086 "lprngcl.ctr"
}
#else
#if DK4_HAVE_SIGNAL
@@ -1292,7 +1300,7 @@ run_with_signals(void)
dk4_sig_handler_t *oldterm = NULL;
-#line 1071 "lprngcl.ctr"
+#line 1101 "lprngcl.ctr"
#ifdef SIGPIPE
oldpipe = signal(SIGPIPE, sig_handler_pipe);
#endif
@@ -1306,7 +1314,7 @@ run_with_signals(void)
#endif
-#line 1083 "lprngcl.ctr"
+#line 1113 "lprngcl.ctr"
}
#else
/** Set signal handlers and run.
@@ -1317,11 +1325,11 @@ run_with_signals(void)
{
-#line 1092 "lprngcl.ctr"
+#line 1122 "lprngcl.ctr"
run_the_functions();
-#line 1094 "lprngcl.ctr"
+#line 1124 "lprngcl.ctr"
}
#endif
#endif
@@ -1342,10 +1350,10 @@ int main(int argc, char *argv[])
{
-#line 1113 "lprngcl.ctr"
+#line 1143 "lprngcl.ctr"
-#line 1114 "lprngcl.ctr"
+#line 1144 "lprngcl.ctr"
dk4fput_initialize_stdout();
dk4fput_initialize_stderr();
app = dk4app_open_cmd(
@@ -1355,23 +1363,23 @@ int main(int argc, char *argv[])
);
if (NULL != app) {
-#line 1122 "lprngcl.ctr"
+#line 1152 "lprngcl.ctr"
sz_msg = dk4app_string_table_size(lprngcl_kw_def);
msg = dk4app_string_table(app, lprngcl_kwnl[2], lprngcl_kw_def);
if (0 != dk4app_can_run_normally(app)) {
-#line 1125 "lprngcl.ctr"
+#line 1155 "lprngcl.ctr"
run_with_signals();
} else {
-#line 1127 "lprngcl.ctr"
+#line 1157 "lprngcl.ctr"
if (0 != dk4app_help_version_license(app)) {
exval = EXIT_SUCCESS;
}
}
if (0 != wrerror) {
-#line 1132 "lprngcl.ctr"
+#line 1162 "lprngcl.ctr"
/* ERROR: Failed to write to standard output */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 11);
}
@@ -1380,7 +1388,7 @@ int main(int argc, char *argv[])
#if TRACE_DEBUG
else {
-#line 1139 "lprngcl.ctr"
+#line 1169 "lprngcl.ctr"
}
#endif
fflush(stdout);
@@ -1389,10 +1397,10 @@ int main(int argc, char *argv[])
dk4fput_cleanup_stdout();
-#line 1146 "lprngcl.ctr"
+#line 1176 "lprngcl.ctr"
-#line 1147 "lprngcl.ctr"
+#line 1177 "lprngcl.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/lprngcl.ctr b/support/dktools/lprngcl.ctr
index 5d73928ccc..d3506d3c65 100644
--- a/support/dktools/lprngcl.ctr
+++ b/support/dktools/lprngcl.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -55,8 +55,13 @@ license = bsd
#endif
#endif
-#if DK4_HAVE_MATH_H
+#if DK4_HAVE_MATH_H
#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -79,7 +84,11 @@ license = bsd
#include "dk4socka.h"
#include "dk4user.h"
#include "dk4rec.h"
+#include "dk4unused.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -143,7 +152,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -170,27 +180,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_ZLIB_H
@@ -481,8 +491,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -492,8 +503,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -502,8 +514,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -527,10 +540,18 @@ sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
*/
static
int
-sig_can_continue(int check_pipe)
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
int back = 1;
-#ifdef SIGPIPE
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
if (0 != check_pipe) {
if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
@@ -596,13 +617,16 @@ process_options(void)
static
int
lprngcl_char_handler(
- void *obj,
+ void * DK4_ARG_UNUSED(obj),
dkChar c,
- dk4_text_stream_position_t *pos,
- dk4_er_t *erp
+ dk4_text_stream_position_t * DK4_ARG_UNUSED(pos),
+ dk4_er_t * DK4_ARG_UNUSED(erp)
)
{
int back = DK4_TSP_RES_OK;
+ DK4_UNUSED_ARG(obj)
+ DK4_UNUSED_ARG(pos)
+ DK4_UNUSED_ARG(erp)
if (0 == dk4fputc(c, stdout, NULL)) {
exval = EXIT_FAILURE;
wrerror = 1;
@@ -661,7 +685,13 @@ process_one_delete_request(const dkChar *hptr, const dkChar *fullqueue)
(
(0 != isUtf8)
? (DK4_FILE_ENCODING_UTF8)
- : (DK4_FILE_ENCODING_ASCII)
+ : (
+#if DK4_ON_WINDOWS
+ DK4_FILE_ENCODING_WIN1252
+#else
+ DK4_FILE_ENCODING_PLAIN
+#endif
+ )
),
NULL
);
@@ -769,7 +799,7 @@ send_delete_requests(int xargc)
);
} else { $? ". ASCII"
res = dk4recode_dk_to_any(
- user8, sizeof(user8), DK4_ENCODING_ASCII, username,
+ user8, sizeof(user8), DK4_ENCODING_PLAIN, username,
dk4app_get_encoding(app), NULL
);
}
@@ -793,7 +823,7 @@ send_delete_requests(int xargc)
);
} else { $? ". ASCII"
res = dk4recode_dk_to_any(
- queue8, sizeof(queue8), DK4_ENCODING_ASCII, curqueue,
+ queue8, sizeof(queue8), DK4_ENCODING_PLAIN, curqueue,
dk4app_get_encoding(app), NULL
);
}
diff --git a/support/dktools/lprngcl.rc b/support/dktools/lprngcl.rc
index dfaf4e8272..f74253eef5 100644
--- a/support/dktools/lprngcl.rc
+++ b/support/dktools/lprngcl.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "LPRng print queue cleaner\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "LPRng print queue cleaner\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "lprngcl\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/makefile.vc b/support/dktools/makefile.vc
index 91d6a1fdbc..3438650ca7 100644
--- a/support/dktools/makefile.vc
+++ b/support/dktools/makefile.vc
@@ -6,11 +6,15 @@
LIBDK4WXOBJ= \
Dk4WxControl.obj \
+ Dk4WxColourView.obj \
+ Dk4WxColourPalette.obj \
Dk4WxProgressDialog.obj \
+ Dk4WxYesNoDialog.obj \
Dk4WxFrame.obj \
Dk4WxHelpController.obj \
Dk4WxAutostartController.obj \
Dk4WxApplicationHelper.obj \
+ Dk4WxProcessingController.obj \
dk4wxpref.obj \
dk4wxstt.obj \
dk4recwx.obj \
@@ -41,6 +45,15 @@ LIBDK4WXOBJ=
!ENDIF
+LIBDK4GRAAOBJ= \
+ dk4graa.obj \
+ dk4gralo.obj \
+ dk4papea.obj \
+ dk4grcoa.obj
+
+LIBDK4BIFAOBJ= \
+ dk4bifap.obj
+
LIBDK4SOCKAOBJ= \
dk4socka09.obj \
dk4socka08.obj \
@@ -52,50 +65,10 @@ LIBDK4SOCKAOBJ= \
dk4socka02.obj \
dk4socka01.obj
-LIBDK4SOCKOBJ= \
- dk4sock37.obj \
- dk4sock36.obj \
- dk4sock35.obj \
- dk4sock34.obj \
- dk4sock33.obj \
- dk4sock32.obj \
- dk4sock31.obj \
- dk4sock30.obj \
- dk4sock29.obj \
- dk4sock28.obj \
- dk4sock27.obj \
- dk4sock26.obj \
- dk4sock25.obj \
- dk4sock24.obj \
- dk4sock23.obj \
- dk4sock22.obj \
- dk4sock21.obj \
- dk4sock20.obj \
- dk4sock19.obj \
- dk4sock18.obj \
- dk4sock17.obj \
- dk4sock16.obj \
- dk4sock15.obj \
- dk4sock14.obj \
- dk4sock13.obj \
- dk4sock12.obj \
- dk4sock11.obj \
- dk4sock10.obj \
- dk4sock09.obj \
- dk4sock08.obj \
- dk4sock07.obj \
- dk4sock06.obj \
- dk4sock05.obj \
- dk4sock04.obj \
- dk4sock03.obj \
- dk4sock02.obj \
- dk4sock01.obj
-
-LIBDK4LATOBJ= \
- dk4uc2l.obj
+LIBDK4LATAOBJ= \
+ dk4uc2la.obj
LIBDK4APPOBJ= \
- dk4papea.obj \
dk4fdrda.obj \
dk4fdrde.obj \
dk4fdwre.obj \
@@ -138,6 +111,84 @@ LIBDK4APPOBJ= \
dk4apphlv.obj \
dk4strda.obj
+LIBDK4PPPTOBJ= \
+ dk4pppt.obj
+
+LIBDK4GRAOBJ= \
+ dk4grco.obj \
+ dk4gra.obj \
+ dk4grpat.obj \
+ dk4greps.obj \
+ dk4grepp.obj \
+ dk4grpdf.obj \
+ dk4grpgf.obj \
+ dk4grepi.obj \
+ dk4grpdi.obj \
+ dk4grpgi.obj \
+ dk4grpdt.obj \
+ dk4grat.obj \
+ dk4fontc.obj \
+ dk4font.obj \
+ dk4paper.obj \
+ dk4xsp.obj \
+ dk4bb.obj \
+ dk4bb32.obj
+
+LIBDK4BIFOBJ= \
+ dk4bifa.obj \
+ dk4bif.obj \
+ dk4pxres.obj \
+ dk4pxbit.obj \
+ dk4cs.obj \
+ dk4bifp.obj \
+ dk4bifj.obj \
+ dk4bift.obj \
+ dk4bifn.obj \
+ dk4bifto.obj \
+ dk4bifpb.obj
+
+LIBDK4SOCKOBJ= \
+ dk4sock37.obj \
+ dk4sock36.obj \
+ dk4sock35.obj \
+ dk4sock34.obj \
+ dk4sock33.obj \
+ dk4sock32.obj \
+ dk4sock31.obj \
+ dk4sock30.obj \
+ dk4sock29.obj \
+ dk4sock28.obj \
+ dk4sock27.obj \
+ dk4sock26.obj \
+ dk4sock25.obj \
+ dk4sock24.obj \
+ dk4sock23.obj \
+ dk4sock22.obj \
+ dk4sock21.obj \
+ dk4sock20.obj \
+ dk4sock19.obj \
+ dk4sock18.obj \
+ dk4sock17.obj \
+ dk4sock16.obj \
+ dk4sock15.obj \
+ dk4sock14.obj \
+ dk4sock13.obj \
+ dk4sock12.obj \
+ dk4sock11.obj \
+ dk4sock10.obj \
+ dk4sock09.obj \
+ dk4sock08.obj \
+ dk4sock07.obj \
+ dk4sock06.obj \
+ dk4sock05.obj \
+ dk4sock04.obj \
+ dk4sock03.obj \
+ dk4sock02.obj \
+ dk4sock01.obj
+
+LIBDK4LATOBJ= \
+ dk4uc2l.obj
+
LIBDK4MDRNDOBJ= \
dk4md.obj
@@ -151,8 +202,6 @@ LIBDK4DBIOBJ= \
dk4dbi.obj
LIBDK4COBJ= \
- dk4font.obj \
- dk4paper.obj \
dk4mdch.obj \
dk4binenc.obj \
dk4stt.obj \
@@ -188,6 +237,7 @@ LIBDK4COBJ= \
dk4strmo08.obj \
dk4strmo16.obj \
dk4strmo32.obj \
+ dk4mao8dns.obj \
dk4c8dbl.obj \
dk4strm.obj \
dk4fput.obj \
@@ -202,6 +252,8 @@ LIBDK4COBJ= \
dk4pathd.obj \
dk4pathw.obj \
dk4path8.obj \
+ dk4serf.obj \
+ dk4userf.obj \
dk4symlink.obj \
dk4fileiu.obj \
dk4fileigd.obj \
@@ -224,6 +276,8 @@ LIBDK4COBJ= \
dk4dblwc.obj \
dk4dblc8.obj \
dk4bom.obj \
+ dk4rec27.obj \
+ dk4rec26.obj \
dk4rec25.obj \
dk4rec24.obj \
dk4rec23.obj \
@@ -268,9 +322,13 @@ LIBDK4COBJ= \
dk4ufi.obj \
dk4ufiwc.obj \
dk4ufi08.obj \
+ dk4ufic.obj \
dk4fne.obj \
dk4fnewc.obj \
dk4fne08.obj \
+ dk4chdird.obj \
+ dk4chdirw.obj \
+ dk4chdir8.obj \
dk4getcwdd.obj \
dk4getcwdw.obj \
dk4getcwd8.obj \
@@ -298,12 +356,17 @@ LIBDK4COBJ= \
dk4ahd.obj \
dk4rle.obj \
dk4rld.obj \
+ dk4bml.obj \
+ dk4bm.obj \
dk4bf.obj \
dk4bitsh.obj \
dk4getpid.obj \
dk4inst.obj \
dk4isadm.obj \
dk4fpe.obj \
+ dk4itmin.obj \
+ dk4iter.obj \
+ dk4math.obj \
dk3trace.obj
LIBDK4MAIODDOBJ= \
@@ -385,18 +448,24 @@ LIBDK4MAIO8DOBJ= \
dk4mao8dbl.obj \
dk4mai8dbl.obj \
dk4mai8dic.obj \
+ dk4mai8di8.obj \
dk4mai8dis.obj \
+ dk4mai8di16.obj \
dk4mai8dii.obj \
dk4mai8dmi.obj \
dk4mai8dli.obj \
dk4mai8dil.obj \
+ dk4mai8di32.obj \
dk4mai8ddi.obj \
dk4mai8duc.obj \
+ dk4mai8du8.obj \
dk4mai8dus.obj \
+ dk4mai8du16.obj \
dk4mai8dui.obj \
dk4mai8dmu.obj \
dk4mai8dlu.obj \
dk4mai8dul.obj \
+ dk4mai8du32.obj \
dk4mai8dsz.obj \
dk4mai8ddu.obj \
dk4mao8d.obj
@@ -440,7 +509,13 @@ LIBDK4MAOBJ= \
dk4maas.obj \
dk4maaus.obj \
dk4maac.obj \
- dk4maauc.obj
+ dk4maauc.obj \
+ dk4maau16.obj \
+ dk4maai16.obj \
+ dk4maau32.obj \
+ dk4maai32.obj \
+ dk4maci16.obj \
+ dk4maci32.obj
LIBDK4BASEOBJ= \
dk4numl.obj \
@@ -453,10 +528,16 @@ LIBDK4BASEOBJ= \
dk4error.obj
OBJLIBDK4= \
+ $(LIBDK4GRAAOBJ) \
+ $(LIBDK4BIFAOBJ) \
+ $(LIBDK4LATAOBJ) \
$(LIBDK4LATOBJ) \
$(LIBDK4SOCKAOBJ) \
$(LIBDK4DBIAOBJ) \
$(LIBDK4APPOBJ) \
+ $(LIBDK4PPPTOBJ) \
+ $(LIBDK4GRAOBJ) \
+ $(LIBDK4BIFOBJ) \
$(LIBDK4MDRNDOBJ) \
$(LIBDK4SOCKOBJ) \
$(LIBDK4DBIOBJ) \
@@ -478,6 +559,9 @@ install: all
-MKDIR "$(BINDIR)"
-MKDIR "$(ETCDIR)"
-MKDIR "$(ETCDIR)\dk3app"
+ -MKDIR "$(ETCDIR)\dk4app"
+ -MKDIR "$(ETCDIR)\dk3app-site"
+ -MKDIR "$(ETCDIR)\dk4app-site"
-MKDIR "$(SHAREDIR)"
-MKDIR "$(MANDIR)"
-MKDIR "$(MAN1DIR)"
@@ -485,19 +569,20 @@ install: all
-MKDIR "$(DATADIR)"
-MKDIR "$(DK4APPDIR)"
-MKDIR "$(INCLUDEDIR)"
+ -MKDIR "$(INCLUDEDIR)\dktools-4"
-MKDIR "$(LIBDIR)"
-MKDIR "$(CONTRIBDIR)"
xcopy *.exe "$(BINDIR)\" /Y
- xcopy dk3trace.h "$(INCLUDEDIR)\" /Y
- xcopy dk4*.h "$(INCLUDEDIR)\" /Y
+ xcopy dk3trace.h "$(INCLUDEDIR)\dktools-4\" /Y
+ xcopy dk4*.h "$(INCLUDEDIR)\dktools-4\" /Y
xcopy dk4*.lib "$(LIBDIR)\" /Y
xcopy dktools\* "$(DATADIR)\" /S /Y
xcopy dk4app\* "$(DK4APPDIR)\" /S /Y
xcopy win32\*.iss "$(CONF_OUTPUTDIR)\" /Y
- xcopy dkctinst.ico "$(CONF_OUTPUTDIR)\" /Y
- xcopy dkctunin.ico "$(CONF_OUTPUTDIR)\" /Y
+ xcopy gui-img\icons\dkctinst.ico "$(CONF_OUTPUTDIR)\" /Y
+ xcopy gui-img\icons\dkctunin.ico "$(CONF_OUTPUTDIR)\" /Y
xcopy etc-dk3app\* "$(ETCDIR)\dk3app\" /S /Y
- xcopy help-chm\* "$(DATADIR)\" /S /Y
+ xcopy etc-dk4app\* "$(ETCDIR)\dk4app\" /S /Y
xcopy contrib\* "$(CONTRIBDIR)\" /S /Y
xcopy man\man1\* "$(MAN1DIR)\" /S /Y
xcopy man\man5\* "$(MAN5DIR)\" /S /Y
@@ -541,7 +626,7 @@ LIBDK3WXOBJ= \
DK3GUIPROGRAMS= \
wxdkfcs.exe \
- wxdkct.exe \
+ wxdkdraw.exe \
wxbmpp.exe \
wxdkclock.exe \
winprint.exe \
@@ -564,6 +649,7 @@ DK3PROGRAMS= $(DK3GUIPROGRAMS) \
wprclean.exe \
lprngcl.exe \
bmpp.exe \
+ wxd2lat.exe \
fig2lat.exe \
htmlbook.exe \
dkct.exe \
@@ -677,12 +763,31 @@ wprclean.exe: $(WPRCLEANOBJ) dk3.lib
$(EXE) /out:$@ $(WPRCLEANOBJ) winspool.lib dk3.lib
$(VC_MANIFEST_EMBED_EXE)
-BMPPOBJ= bmeps3.obj bmpp.res
+# BMPPOBJ= bmeps3.obj bmpp.res
+BMPPOBJ= bmpp.obj bmpp.res
-bmpp.exe: $(BMPPOBJ) dk3.lib
+bmpp.exe: $(BMPPOBJ) dk4.lib
@echo Link $@
-IF EXIST $@ DEL $@
- $(EXE) /out:$@ $(BMPPOBJ) dk3.lib
+ $(EXE) /out:$@ $(BMPPOBJ) dk4.lib
+ $(VC_MANIFEST_EMBED_EXE)
+
+WXD2LATOBJ= wxd2lat.obj \
+ wxd2lout.obj \
+ wxd2lah.obj \
+ wxd2lxs.obj \
+ wxdrd.obj \
+ w2llic.obj \
+ wxdstr.obj \
+ wxdobj.obj \
+ wxdcomp.obj \
+ wxdarc.obj \
+ wxd2lat.res
+
+wxd2lat.exe: $(WXD2LATOBJ) dk4.lib
+ @echo Link $@
+ -IF EXIST $@ DEL $@
+ $(EXE) /out:$@ $(WXD2LATOBJ) dk4.lib
$(VC_MANIFEST_EMBED_EXE)
FIG2LATOBJ= \
@@ -738,12 +843,12 @@ dkct.exe: $(DKCTOBJ) dk3.lib
$(EXE) /out:$@ $(DKCTOBJ) dk3.lib
$(VC_MANIFEST_EMBED_EXE)
-PLPDFTEXOBJ= plpdftex.obj plptcol.obj plpdftex.res
+PLPDFTEXOBJ= plpdftex.obj plpdftex.res
-plpdftex.exe: $(PLPDFTEXOBJ) dk3.lib
+plpdftex.exe: $(PLPDFTEXOBJ) dk4.lib
@echo Link $@
-IF EXIST $@ DEL $@
- $(EXE) /out:$@ $(PLPDFTEXOBJ) dk3.lib
+ $(EXE) /out:$@ $(PLPDFTEXOBJ) dk4.lib
$(VC_MANIFEST_EMBED_EXE)
# DKDBTOBJ= dkdbt.obj dkdbt.res
@@ -796,59 +901,6 @@ wxdkct.exe: $(WXDKCTOBJ) dk3.lib
$(GUIEXE) /out:$@ $(WXDKCTOBJ) dk3.lib
$(VC_MANIFEST_EMBED_EXE)
-WXBMPPOBJ= \
- DkWxBmepsApp.obj \
- DkWxBmepsFrame.obj \
- DkWxBmepsOptionsDialog.obj \
- DkWxBmepsThread.obj \
- DkWxProgressDialog.obj \
- DkWxFrame.obj \
- DkWxAppHelper.obj \
- DkWxHelpController.obj \
- DkWxCommunicator.obj \
- DkWxColorView.obj \
- dk3wxs.obj \
- dk3bm-gui.obj \
- dk3bmj-gui.obj \
- dk3bmeo.obj \
- dk3bmeps.obj \
- dk3pdf-gui.obj \
- dk3paper.obj \
- dk3bifa-gui.obj \
- dk3bif-gui.obj \
- dk3pixre.obj \
- dk3opt.obj \
- dk3app.obj \
- dk3wreg.obj \
- dk3of.obj \
- dk3strm.obj \
- dk3sto.obj \
- dk3dir.obj \
- dk3enc.obj \
- dk3str.obj \
- dk3sf.obj \
- dk3maui.obj \
- dk3mal.obj \
- dk3maul.obj \
- dk3mad.obj \
- dk3madlc.obj \
- dk3maidd.obj dk3maodd.obj dk3maid8.obj dk3maod8.obj \
- dk3madfo.obj \
- dk3madso.obj \
- dk3madsi.obj \
- dk3inst.obj \
- dk3srch.obj \
- dk3bits.obj \
- dk3mem.obj \
- dk3trace.obj \
- wxbmpp.res
-
-wxbmpp.exe: $(WXBMPPOBJ)
- @echo Link $@
- -IF EXIST $@ DEL $@
- $(GUIEXE) /out:$@ $(WXBMPPOBJ)
- $(VC_MANIFEST_EMBED_EXE)
-
WXDKCLOCKOBJ= \
DkClockApp.obj \
DkClockFrame.obj \
@@ -892,15 +944,70 @@ wxdkhtb.exe: $(WXDKHTBOBJ) dk3.lib
$(VC_MANIFEST_EMBED_EXE)
WXIMGSZOBJ= \
- DkWxImgszApp.obj \
- DkWxImgszFrame.obj \
- DkWxImgszOptionsDialog.obj \
+ WximgszApp.obj \
+ WximgszFrame.obj \
wximgsz.res
-wximgsz.exe: $(WXIMGSZOBJ) dk3.lib
+wximgsz.exe: $(WXIMGSZOBJ) dk4.lib
@echo Link $@
-IF EXIST $@ DEL $@
- $(GUIEXE) /out:$@ $(WXIMGSZOBJ) dk3.lib
+ $(GUIEXE) /out:$@ $(WXIMGSZOBJ) dk4.lib
+ $(VC_MANIFEST_EMBED_EXE)
+
+WXDKDRAWOBJ= \
+ WxdkdrawApp.obj \
+ WxdkdrawFrame.obj \
+ WxdkdrawFrameEvents.obj \
+ WxdkdrawFrameStipples.obj \
+ WxdkdrawFrameTools.obj \
+ WxdkdrawDlgLineStyle.obj \
+ WxdkdrawDlgStyleLength.obj \
+ WxdkdrawDlgLineJoin.obj \
+ WxdkdrawDlgMiterLimit.obj \
+ WxdkdrawDlgLineCap.obj \
+ WxdkdrawDlgArrowType.obj \
+ WxdkdrawDlgArrowSize.obj \
+ WxdkdrawDlgFillStyle.obj \
+ WxdkdrawDlgTextAlign.obj \
+ WxdkdrawDlgFontName.obj \
+ WxdkdrawDlgLayerManager.obj \
+ WxdkdrawDlgTextInput.obj \
+ WxdkdrawDlgSplineValue.obj \
+ WxdkdrawDlgImageOptions.obj \
+ WxdkdrawDlgDotFilled.obj \
+ WxdkdrawDlgBoxRadius.obj \
+ WxdkdrawDlgOptionsNewObjects.obj \
+ WxdkdrawDlgOptionsScreen.obj \
+ WxdkdrawMouse.obj \
+ WxdkdrawControlEvents.obj \
+ WxdkdrawControlDraw.obj \
+ WxdkdrawControlArrows.obj \
+ WxdkdrawControlTools.obj \
+ WxdkdrawControl.obj \
+ WxdkdrawWrite.obj \
+ WxdkdrawRead.obj \
+ WxdkdrawComp.obj \
+ WxdkdrawObj.obj \
+ WxdkdrawFont.obj \
+ wxdarc.obj \
+ wxdkdraw.res
+
+wxdkdraw.exe: $(WXDKDRAWOBJ) dk4.lib
+ @echo Link $@
+ -IF EXIST $@ DEL $@
+ $(GUIEXE) /out:$@ $(WXDKDRAWOBJ) dk4.lib
+ $(VC_MANIFEST_EMBED_EXE)
+
+WXBMPPOBJ= \
+ Bmpp4App.obj \
+ Bmpp4Frame.obj \
+ Bmpp4Progress.obj \
+ wxbmpp.res
+
+wxbmpp.exe: $(WXBMPPOBJ) dk4.lib
+ @echo Link $@
+ -IF EXIST $@ DEL $@
+ $(GUIEXE) /out:$@ $(WXBMPPOBJ) dk4.lib
$(VC_MANIFEST_EMBED_EXE)
WXPQDICOBJ= \
@@ -1072,13 +1179,16 @@ PROGRAMS= \
dk-eradisk.exe \
dk-ls.exe \
dk-sort.exe \
+ dk-lines.exe \
dk-fic.exe \
dk-pwgen.exe \
dk-rand.exe \
dk-t2h.exe \
dk-t2l.exe \
+ dk-bin2c.exe \
dk-hex.exe \
dk-bmm.exe \
+ dk-pwd.exe \
dk-recv.exe \
dk-send.exe \
dk-t2db.exe \
@@ -1128,6 +1238,14 @@ dk-sort.exe: $(DKSORTOBJ) dk4.lib
$(EXE) /out:$@ $(DKSORTOBJ) dk4.lib
$(VC_MANIFEST_EMBED_EXE)
+DKLINESOBJ= dk-lines.obj dk-lines.res
+
+dk-lines.exe: $(DKLINESOBJ) dk4.lib
+ @echo Link $@
+ -IF EXIST $@ DEL $@
+ $(EXE) /out:$@ $(DKLINESOBJ) dk4.lib
+ $(VC_MANIFEST_EMBED_EXE)
+
DKFICOBJ= dk-fic.obj dk-fic.res
dk-fic.exe: $(DKFICOBJ) dk4.lib
@@ -1162,6 +1280,12 @@ dk-t2l.exe: dk-t2l.obj dk-t2l.res dk4.lib
$(EXE) /out:$@ dk-t2l.obj dk-t2l.res dk4.lib
$(VC_MANIFEST_EMBED_EXE)
+dk-bin2c.exe: dk-bin2c.obj dk-bin2c.res dk4.lib
+ @echo Link $@
+ -IF EXIST $@ DEL $@
+ $(EXE) /out:$@ dk-bin2c.obj dk-bin2c.res dk4.lib
+ $(VC_MANIFEST_EMBED_EXE)
+
dk-hex.exe: dk-hex.obj dk-hex.res dk4.lib
@echo Link $@
-IF EXIST $@ DEL $@
@@ -1174,6 +1298,12 @@ dk-bmm.exe: dk-bmm.obj dk-bmm.res dk4.lib
$(EXE) /out:$@ dk-bmm.obj dk-bmm.res dk4.lib
$(VC_MANIFEST_EMBED_EXE)
+dk-pwd.exe: dk-pwd.obj dk4.lib dk-pwd.res
+ @echo Link $@
+ -IF EXIST $@ DEL $@
+ $(EXE) /out:$@ dk-pwd.obj dk-pwd.res dk4.lib
+ $(VC_MANIFEST_EMBED_EXE)
+
dk-recv.exe: dk-recv.obj dk-recv.res dk4.lib
@echo Link $@
-IF EXIST $@ DEL $@
@@ -1224,6 +1354,18 @@ dk4info.exe: dk4info.obj dk4info.res dk4.lib
$(EXE) $(WINSOCKLIB) /out:$@ dk4info.obj dk4info.res dk4.lib
$(VC_MANIFEST_EMBED_EXE)
+dk3config.exe: dk3config.obj dk4.lib
+ @echo Link $@
+ -IF EXIST $@ DEL $@
+ $(EXE) /out:$@ dk3config.obj
+ $(VC_MANIFEST_EMBED_EXE)
+
+dk4config.exe: dk4config.obj dk4.lib
+ @echo Link $@
+ -IF EXIST $@ DEL $@
+ $(EXE) /out:$@ dk4config.obj
+ $(VC_MANIFEST_EMBED_EXE)
+
wxcs.exe: wxcs.obj
@echo Link $@
-IF EXIST $@ DEL $@
@@ -1340,3 +1482,7 @@ test-deldirwc.exe: test-deldirwc.obj dk4.lib
$(EXE) /out:$@ test-deldirwc.obj dk4.lib
$(VC_MANIFEST_EMBED_EXE)
+test-dk4xsp2d.exe: test-dk4xsp2d.obj dk4.lib
+ $(EXE) /out:$@ test-dk4xsp2d.obj dk4.lib
+ $(VC_MANIFEST_EMBED_EXE)
+
diff --git a/support/dktools/man/man1/addctrld.1 b/support/dktools/man/man1/addctrld.1
index 2c50f3fa99..70e8785fe4 100644
--- a/support/dktools/man/man1/addctrld.1
+++ b/support/dktools/man/man1/addctrld.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: addctrld
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "ADDCTRLD" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "ADDCTRLD" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -90,7 +90,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/bmpp.1 b/support/dktools/man/man1/bmpp.1
index 9501a97af2..12a901fb7a 100644
--- a/support/dktools/man/man1/bmpp.1
+++ b/support/dktools/man/man1/bmpp.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: bmpp
-.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "BMPP" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "BMPP" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -28,232 +28,933 @@
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
-bmpp \- Bitmap to PS/PDF converter
+bmpp \- Bitmap to PDF/PS converter
.SH "SYNOPSIS"
.sp
-\fBbmpp\fR [\fB\-l\fR\fIdriver\fR[\&.\fImode\fR][,\fIkey\fR[=\fIvalue\fR]\&...]] [\fIoptions\fR] \fIfile(s)\fR
+\fBbmpp\fR [\fB\-l\fR\fIdriver\fR[\fB\&.\fR\fImode\fR][,\fIname\fR[\fB=\fR\fIvalue\fR]\&...]] [\fIoption\fR\&...] \fIfile\fR\&...
.SH "DESCRIPTION"
.sp
-The program converts bitmap images from PNG, JPEG, or TIFF to PS/EPS and PDF\&.
+The program converts bitmap image files from PNG, JPEG, TIFF and NetPBM to PDF and PS/EPS\&. In this text "bitmap image" refers to bitmap, graymap and pixmap images\&.
.sp
+For each input file specified on the command line the program creates a corresponding output file with file name suffix "\&.pdf", "\&.eps", "\&.ps" or "\&.bb"\&.
+.sp
+If a directory name is specified on the command line, bmpp traverses the directory and converts all files suitable as bmpp input\&. In the special make\-mode bmpp converts only those files for which there is no up\-to\-date output file yet\&.
+.sp
+The driver choice indicates the file type to produce:
+.PP
+pdf
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fBDrivers:\fR
+Portable document format (PDF)\&.
+.RE
.PP
-\fBps\fR
+eps
.RS 4
-PostScript, can be used to print\&.
+Encapsulated PostScript (EPS), image for inclusion in documents\&.
.RE
.PP
-\fBeps\fR
+ps
.RS 4
-Encapsulated PostScript, image for inclusion into a document\&.
+Print job file for printing on PostScript printers\&.
.RE
.PP
-\fBpdf\fR
+bb
.RS 4
-Portable document format (PDF)\&.
+Bounding box file, contains image dimensions only, no image contents\&. LaTeX needs such files sometimes to know how much space to reserve for an image\&.
+.RE
+.sp
+The output mode indicates the intended purpose of the output:
+.PP
+object
+.RS 4
+Object, a file embedded into a graphics or text document by a drawing software or text typesetting software\&.
+.RE
+.PP
+image
+.RS 4
+Image for stand\-alone viewing and processing\&.
+.RE
+.PP
+document
+.RS 4
+The image is fitted to a specified paper size or usable area on paper for printing\&.
+.RE
+.SH "OPTIONS"
+.PP
+\fB\-l\fR \fIdriver\fR[\fB\&.\fR\fImode\fR][\fB,\fR\fIkey\fR[\fB=\fR\fIvalue\fR]\&...] \fB\-\-language=\fR\fIdriver\fR[\fB\&.\fR\fImode\fR][\fB,\fR\fIkey\fR[\fB=\fR\fIvalue\fR]\&...]
+.RS 4
+specifies output driver and output mode\&. The optional key=value pairs can be used for further configuration\&. See section "key=value pairs" below\&.
+.RE
+.PP
+\fB\-m\fR, \fB\-\-make\fR
+.RS 4
+turns on "make operating" for directory processing\&. When processing directories, bmpp in normal operating processes each file it can process\&. In make operating it processes only those files for which there is no up\-to\-date output file yet\&.
+.RE
+.PP
+\fB\-R\fR, \fB\-\-reset\fR
+.RS 4
+resets the program to built\-in default settings, the dk4gra\&.conf configuration files are ignored\&.
+.RE
+.PP
+\fB\-\-help\fR
+.RS 4
+shows a short help text\&.
.RE
.PP
-\fBbb\fR
+\fB\-\-manual\fR
.RS 4
-Bounding box information only, no image contents\&.
+shows a detailed help text\&.
.RE
+.PP
+\fB\-\-version\fR
+.RS 4
+shows the version number\&.
.RE
+.PP
+\fB\-\-license\fR
+.RS 4
+shows the license conditions of both bmpp and the used libraries\&.
+.RE
+.SH "KEY=VALUE PAIRS"
+.sp
+Key=value pairs are used to specify configuration details\&.
+.sp
+For boolean settings it is sufficient to write the name to activate the option\&. As an example "\-lps\&.document,duplex" has the same effect as "\-lps\&.document,duplex=true"\&. Use "on", "true", or "yes" to activate boolean settings\&. Use "off", "false", or "no" for deactivation\&.
.sp
+The following settings can be made:
+.PP
+\fBlevel=\fR\fIinteger\fR
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fBOutput modes:\fR
+PS language level when producing PS output, 2 or 3\&. Default: 3\&.
+.RE
.PP
-\fBobject\fR
+\fBdsc=\fR\fIboolean\fR
.RS 4
-Object which can be embedded into a text or drawing by a text processing or drawing software\&.
+Write DSC comments (document structuring convention) to PS/EPS output files\&. Default: off
.RE
.PP
-\fBimage\fR
+\fBlzw=\fR\fIboolean\fR
.RS 4
-Image for stand\-alone viewing\&.
+Allow the use of LZW compression in PS level 2 output\&. Default: off
.RE
.PP
-\fBdocument\fR
+\fBcolor=\fR\fIboolean\fR
.RS 4
-Fit the output to a given paper size for printing\&.
+Allow colored output\&. Default: on\&. Deactivating this option results in grayscaled output\&.
.RE
+.PP
+\fBrgb\-to\-gray=\fR\fIstring\fR
+.RS 4
+Method to convert RGB data to grayscale values\&. Default: bt601\&. See section "Color space conversion" below\&.
.RE
-.SH "OPTIONS"
.PP
-\fB\-h\fR, \fB\-\-help\fR
+\fBrgb\-to\-cmyk=\fR\fIstring\fR
.RS 4
-Show help text\&.
+Method to convert RGB data to CMYK, one from "non\-standard" or "standard"\&. Default: non\-standard\&. The bmpp program does not convert from RGB to CMYK and there are no plans to do so\&. The option is mentioned here for completeness as the used libdk4gra library supports this configuration option\&.
.RE
.PP
-\fB\-v\fR, \fB\-\-version\fR
+\fBalpha=\fR\fIstring\fR
.RS 4
-Shows version number\&.
+Method for alpha channel use, either "mix" or "foreground"\&. Default: mix\&. See section "Alpha channel" below\&.
.RE
.PP
-\fB\-L\fR, \fB\-\-license\-terms\fR
+\fBbg=\fR\fIinteger\fR\fB:\fR\fIinteger\fR\fB:\fR\fIinteger\fR[\fB:\fR\fIboolean]\fR
.RS 4
-Show license terms\&.
+Default background color\&. The numbers are RGB values in the range 0\&...255\&. Default: 255:255:255\&. Normally the color specified here is only used if the input image does not contain background color information\&. The optional boolean flag decides about enforcing the background color\&. Enforcing means the background color is used even if there is background color information in the input image file\&. I recommend to use the "force\-bg" option instead of specifying the boolean flag here\&.
.RE
.PP
-\fB\-t\fR \fItype\fR
+\fBforce\-bg=\fR\fIboolean\fR
.RS 4
-Input image type, "png", "jpeg", or "tiff", must be specified when processing standard input or if the input file name suffix does not indicate the type\&.
+Enforcing the background color can be set up differently from specifying the background color\&. Default: off\&.
.RE
.PP
-\fB\-m\fR
+\fBinterpolation=\fR\fIboolean\fR
.RS 4
-Make mode: Avoid unnecessary conversions if output file is up to date\&. Only active when processing a directory\&.
+Set interpolation flag in output\&. If this flag is set, PDF/PS rendering programs are allowed to attempt to improve image representation\&. Default: on\&.
.RE
.PP
-\fB\-s\fR
+\fBdct=\fR\fIboolean\fR
.RS 4
-Write to standard output, not to file\&.
+Allow direct re\-use of DCT encoded data from JPEG input files\&. This avoids decoding and encoding and results in faster processing and smaller output files\&. Default: on\&.
.RE
.PP
-\fB\-o\fR \fIkey\fR[=\fIvalue\fR]
+\fBdct\-interpolation=\fR\fIboolean\fR
.RS 4
-Detailed conversion options\&.
+Set image interpolation flag when directly re\-using DCT encoded data from JPEG files too\&. Default: off\&.
.RE
-.SH "NAME=VALUE PAIRS"
-.sp
-The key=value pairs set detailed conversion options\&. For boolean settings the value can be omitted, the presence of the name sets the option to active\&. The following keys (and values) can be used:
.PP
-\fBlevel\fR=\fIpslevel\fR
+\fBa\-bpc=\fR\fIboolean\fR
.RS 4
-PS level, "2" or "3"\&. Default: 3\&.
+Analyze bits per component\&. Reduce number of bits per component if reduction if possible without quality loss\&. Default: on\&.
.RE
.PP
-\fBcolor\fR[=\fIboolean\fR]
+\fBa\-color=\fR\fIboolean\fR
.RS 4
-Color output for PS output\&. For PDF output color is always enabled\&. This setting is ignored when passing DCT data from JPEG files to output directly\&. Default: On\&.
+Analyze use of colors, switch output color space to grayscaled if all pixels are gray\&. Default: on\&.
.RE
.PP
-\fBdsc\fR[=\fIboolean\fR]
+\fBa\-alpha=\fR\fIboolean\fR
.RS 4
-DSC comments when producing PS/EPS output\&. Default: Off, except for ps\&.document\&.
+Analyze alpha channel use, avoid writing an SMask object to PDF output if all pixels are fully opaque\&. Default: on\&.
.RE
.PP
-\fBdraft\fR[=\fIboolean\fR]
+\fBpaper=\fR\fIstring\fR
.RS 4
-Draft mode (small placeholder image only)\&. Default: Off\&.
+Paper size for documents\&. The paper size must be defined in a dk3paper\&.conf or dk4paper\&.conf file\&. Default: a4\&.
.RE
.PP
-\fBpredictor\fR=\fIpredictor\fR
+\fBduplex=\fR\fIboolean\fR
.RS 4
-Predictor for flate compressions, "tiff", "sub", "up", "average", or "paeth"\&. Default: none\&.
+Prepare PS output for duplex printing (print on front side and back side of paper sheet, binding on the left side like a book)\&. Default: on\&.
.RE
.PP
-\fBduplex\fR[=\fIboolean\fR]
+\fBtumble=\fR\fIboolean\fR
.RS 4
-Duplex mode when producing documents\&. Default: Off\&.
+Prepare PS output for duplex+tumble printing (print on front side and back side of paper sheet, binding on top side like a calendar)\&. Default: off\&.
.RE
.PP
-\fBtumble\fR[=\fIboolean\fR]
+\fBresolution=\fR\fIchoice\fR
.RS 4
-Tumble in addition to duplex mode\&. Default: Off\&.
+How to use resolution and calculate image size, one from:
+.PP
+chunk
+.RS 4
+Obtain resolution information from input image file, if available\&. This is the default\&. If there is no resolution information in the input file, use 1px1pt\&.
+.RE
+.PP
+1px1pt
+.RS 4
+Use 72 dpi for resolution in both x and y direction\&. Ignore resolution data in input image file if present\&. Each pixel from input file will use a 1 PS point square in output\&.
+.RE
+.PP
+\fInumber\fR
+.RS 4
+The specified floating point number is used as resolution in dpi for both x and y direction\&.
+.RE
+.PP
+\fInumber\fR\fB:\fR\fInumber\fR
+.RS 4
+The first number specifies the resolution in x direction, the second one specifies the resolution in y direction\&. I recommend to use
+\fInumber\fR
+and
+\fInumber\fR\fB:\fR\fInumber\fR
+only\&. The "chunk" and "1px1pt" variants are only available for backwards compatibility\&. Chunk is the default, instead of 1px1pt you should better use "i\-res=on"\&.
+.RE
.RE
.PP
-\fBdct\fR[=\fIboolean\fR]
+\fBi\-res=\fR\fIboolean\fR
.RS 4
-Direct pass\-through of DCT encoded data found in JPEG files\&. Default: On\&.
+Ignore resolution information in input image file\&. Use 72 dpi, so the image width and height in PS point is equal to the number of pixels in width and height of the input image\&. The result is the same as "resolution=1px1pt"\&. Default: off\&.
.RE
.PP
-\fBbg\fR=\fIint\fR:\fIint\fR:\fIint\fR[:\fIboolean\fR]
+\fBi\-aspect=\fR\fIboolean\fR
.RS 4
-Default background RGB color to be used if the input file does not contain a background color chunk\&. The optional boolean value at the end can be used to enforce this background over the background chunk\&. RGB values are in the range 0\&...255\&. Default: White, off\&.
+Ignore aspect ratio of input image\&. When creating a document the entire available (printable) area on paper sheet is used for the image\&. A distortion due to different x and y scale factors is accepted\&. Default : off\&.
.RE
.PP
-\fBinterpolation\fR[=\fIboolean\fR]
+\fBrotate=\fR\fIboolean\fR
.RS 4
-Image interpolation\&. Default: On\&.
+Allow image rotation by 90 degree if the rotated image fits better into the usable area\&. Default: off\&.
.RE
+.SH "ALPHA CHANNEL"
+.sp
+PNG/TIFF/NetPBM can contain an alpha channel\&. A pixels alpha value expresses opacity in the range 0=transparent to 1=fully opaque\&. An alpha channel found in the input image file is transferred into an SMask object in PDF output\&. For PS/EPS output we have to calculate the color of each pixel, there are two choices:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Mixing the foreground color as retrieved from input file against a background color considering opaqueness from alpha channel\&. This is the default\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Simply use the foreground information found in input image file\&. Use "alpha=foreground" to configure this\&.
+.RE
+.sp
+A background color information (background color chunk) in the input image file is used by default, if present\&.
+.sp
+For input images without background color information you can use the "bg=\&..." option to define a default background color\&. Using "force\-bg=on" you can configure to use the bg=\&... color even if the input image file contains background color information\&.
+.sp
+When creating a PDF document, each page is completely filled with white color before applying any image\&.
+.sp
+When creating a PDF image for an image containing transparency, the image area is filled with background color before applying the image\&.
+.SH "COMPRESSION AND ENCODING"
+.sp
+Flate compression is used for PDF output and PS level 3 output\&.
+.sp
+Run length compression with separated color channels is used for PS level 2 output if the number of bytes per color channel per row does not exceed 16384\&. For images with larger rows no compression is used\&. Alternatively you can enable LZW compression\&.
+.sp
+For separated color channels the data stream contains all red values for a row first, all green values next, all blue values finally\&. Without separated color channels a horizontal red line would be represented by the byte values: 255 0 0 255 0 0 255 0 0 255 0 0 255 0 0 \&... Run length compression would not be possible\&. With separated color channels the red channels contains: 255 255 255 255 255 \&... The green and blue channels contain: 0 0 0 0 0 \&... So run length compression can be applied to colored lines\&.
+.sp
+The compression result is used directly without any further encoding for PDF output\&. For PS/EPS output ASCII\-85 encoding is applied to produce clean 7 bit text\&.
+.SH "IMAGE ANALYSIS"
+.sp
+If the number of bits per component can be reduced for all components of all pixels without quality loss, the smaller bit depth is used in output\&.
+.sp
+If the input images uses RGB, RGB+alpha or CMYK color space but all pixels are gray, bmpp produces grayscaled output\&.
+.sp
+If the input image contains an alpha channel but alpha data indicates full opacity for all pixels, no SMask object is written to PDF output\&.
+.SH "COLOR SPACE CONVERSION"
+.sp
+The following variables containing integer values are used in the formulas below:
.PP
-\fBjpeg\-interpolation\fR[=\fIboolean\fR]
+\fIMAX\fR
.RS 4
-Image interpolation if DCT data is passed through directly\&. Default: Off\&.
+Maximum value for a given number of bits per component (i\&.e\&. 15 for 4 bits, 255 for 8 bits)
.RE
.PP
-\fBresolution\fR=\fIresolution\fR
+\fIR\fR
.RS 4
-Resolution, either "1:1" (use a 1 point x 1 point square for each source pixel), "chunk" (use resolution data from image) or an integer value for dpi\&. Default: 1:1 for objects, chunk for images, fit to paper size for documents\&.
+Red component in range 0 \&... MAX
.RE
.PP
-\fBpaper\fR=\fIpaper\fR
+\fIG\fR
.RS 4
-Paper size for documents\&. The paper size must be configured in a dk3paper\&.conf file\&. Only one from "resolution" or "paper" can be used\&.
+Green component in range 0 \&... MAX
.RE
.PP
-\fBmake\fR[=\fIboolean\fR]
+\fIB\fR
.RS 4
-Make mode when processing directories\&. Default: Off\&.
+Blue component in range 0 \&... MAX
.RE
.PP
-\fBbpc\fR[=\fIboolean\fR]
+\fIE\fR
.RS 4
-Reduce the number of bits per component\&. Default: On\&.
+Grayscale value in range 0 \&... MAX
.RE
-.SH "EXIT STATUS"
.sp
-0 on success, all other exit status codes indicate an error\&.
-.SH "PREFERENCES"
+Several methods can be used to convert RGB data to gray:
.PP
-/print/ps/level
+\fBbt601\fR
.RS 4
-Default PS level, 2 or 3\&.
+Keep luminance:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (299 * R + 587 * G + 114 * B) / 1000
+.fi
+.if n \{\
+.RE
+.\}
.RE
-.SH "EXAMPLES"
.PP
-bmpp \-lps\&.document,level=2,paper=A4,duplex,bpc myfax\&.tif
+\fBluminance\fR
+.RS 4
+Keep luminance, use shorter coefficients:
+.sp
+.if n \{\
.RS 4
-converts a fax TIFF file "myfax\&.tif" to "myfax\&.ps" for a PS 2 printer\&.
+.\}
+.nf
+E = (30 * R + 59 * G + 11 * B) / 100
+.fi
+.if n \{\
+.RE
+.\}
.RE
.PP
-bmpp \-l pdf\&.document,paper=A4,duplex fax\&.tif
+\fBfast\fR
+.RS 4
+Fast calculation without division operations:
+.sp
+.if n \{\
.RS 4
-creates a PDF file fax\&.pdf\&.
+.\}
+.nf
+E = (77 * R + 151 * G + 28 * B) >> 8
+.fi
+.if n \{\
+.RE
+.\}
.RE
.PP
-bmpp \-l ps\&.object screenshot\&.png
+\fBfastest\fR
.RS 4
-creates a PS object file screenshot\&.ps for use with latex/dvips\&.
+Yet faster and more inaccurate calculation without multiplication and division (<< and >> are bit shifting operations to left and right):
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = ((R << 1) + (G << 2) + G + B) >> 3
+.fi
+.if n \{\
+.RE
+.\}
.RE
.PP
-bmpp \-l pdf\&.object screenshot\&.png
+\fBbt709\fR
.RS 4
-creates a PDF object file screenshot\&.pdf for use with pdflatex\&.
+Keep luminance, use other coefficients:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (2126 * R + 7152 * G + 722 * B) / 1000
+.fi
+.if n \{\
+.RE
+.\}
.RE
.PP
-bmpp \-l ps\&.image file\&.png
+\fBaverage\fR
+.RS 4
+Average of red, green, blue:
+.sp
+.if n \{\
.RS 4
-creates a PS image file\&.ps\&.
+.\}
+.nf
+E = (R + G + B) / 3
+.fi
+.if n \{\
+.RE
+.\}
.RE
.PP
+\fBdesaturation\fR
+.RS 4
+Desaturation results in an image with less contrast:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (maximum{R,G,B} + minimum{R,G,B}) / 2
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBmin\fR
+.RS 4
+Minimum decomposition uses the minimum of R, G, B:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = minimum{R,G,B}
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBmedian\fR
+.RS 4
+Median decomposition uses the median value of R, G, B:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = median{R,G,B}
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBmax\fR
+.RS 4
+Maximum decomposition uses the maximum of R, G, B:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = maximum{R,G,B}
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBred\fR
+.RS 4
+Just use the red component:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = R
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBgreen\fR
+.RS 4
+Just use the green component:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = G
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBblue\fR
+.RS 4
+Just use the blue component:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = B
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.SH "IMAGE SIZE, RESOLUTION AND ROTATION"
+.sp
+If image resolution information is available the real image dimensions in PS points are calculated by multiplication of width/height in pixels by factor 72, division by x/y resolution and rounding upwards to the next integer value\&. The source of the image resolution is either the input image file if it contains resolution data (resolution=chunk, this is the default) or a resolution specified by the user (resolution=\fInumber\fR or resolution=\fInumber\fR:\fInumber\fR)\&.
+.sp
+If the input image file does not contain resolution data or the user decides to ignore resolution data (i\-res=on), a resolution of 72 dpi is used\&. The output image width/height in PS points is equal to the input image width/height in number of pixels\&.
+.sp
+Some input images \- i\&.e\&. TIFF files generated by a fax gateway \- contain different resolutions for x and y direction\&. For such images ignoring the resolution results in image distorsion\&.
+.sp
+There are two choices to fit an image into a usable/printable area of a page or paper sheet:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Keep the aspect ratio (default), probably leaving parts of the available area unused\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Ignore the aspect ratio (i\-aspect=on) and fill the area completely accepting image distorsion\&.
+.RE
+.sp
+For some image/paper combinations \- i\&.e\&. the image is more wide than high but the paper is more high than wide \- rotating the image by 90 degree allows better fitting to the available area\&. The rotate=on option allows such rotations\&.
+.SH "EXIT STATUS"
+.sp
+0 on success, all other values indicate errors\&.
+.SH "EXAMPLES"
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Create PDF object for use with pdfLaTeX from screenshot\&.png file:
+.sp
+bmpp \-l pdf screenshot\&.png
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Create EPS object screenshot\&.eps for use with LaTeX/dvips:
+.sp
+bmpp \-l eps screenshot\&.png
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Create PDF file fax\&.pdf for printing from fax\&.tif file:
+.sp
+bmpp \-l pdf\&.document,paper=A4,duplex fax\&.tif
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Create PS file fax\&.ps for printing, use language level 2:
+.sp
+bmpp \-l ps\&.document,level=2,paper=A4,duplex fax\&.tif
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Create standalone image file file\&.pdf from file\&.png file:
+.sp
bmpp \-l pdf\&.image file\&.png
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Create standalone file file\&.ps from file\&.png file:
+.sp
+bmpp \-l ps\&.image file\&.png
+.RE
+.SH "FAQ"
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Do I need to create a dk4gra\&.conf file?
+.sp
+The dk4gra\&.conf configuration file can be used, but normally there is no need to do so\&. I hope I selected useful defaults for the bmpp program\&. One reason to create a dk4gra\&.conf file is to support PS printers handling PS language level 2 only\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+How do I switch PS language level to 2?
+.PP
+On the command line
+.RS 4
+Use "\-lps,level=2" instead of "\-lps"\&.
+.RE
+.PP
+In a dk4gra\&.conf file
+.RS 4
+Create a file dk4gra\&.conf in one of the following directories
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk4app\-site to set defaults for all users\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk4app\-site to set defaults for all users\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app to set defaults for the current user\&.
+.sp
+containing the following lines:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+[ps]
+level=2
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.RE
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+How do I enable LZW compression for PS level 2 output?
+.sp
+Note: The LZW algorithm was patent protected for a long time\&. The patent in the USA expired in 2003, the corresponding patent in Germany expired in 2004\&. I do not know the situation in all countries over the world, so you should check the situation in your country yourself\&. Activate LZW only if you are allowed to use it and if you really need it\&.
+.PP
+On the command line
.RS 4
-creates a PDF image file\&.pdf\&.
+Use "\-lps,level=2,lzw" instead of "\-lps,level=2"\&.
+.RE
+.PP
+In a dk4gra\&.conf file
+.RS 4
+Create a file dk4gra\&.conf containing the following lines:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+[ps]
+level=2
+lzw=on
+.fi
+.if n \{\
+.RE
+.\}
+.RE
.RE
.SH "FILES"
.PP
-\fBdk3paper\&.conf\fR
+\fBdk3paper\&.conf\fR / \fBdk4paper\&.conf\fR
+.RS 4
+are the configuration files to define paper sizes\&. If paper=\&... is used, the paper size must be defined in one of these files\&.
+.RE
+.PP
+\fBdk4gra\&.conf\fR
+.RS 4
+is the configuration file for graphics output from the DK tools and libraries project\&.
+.sp
+Cumulative processing is used\&. Settings made in a file processed earlier may be overwritten in files processed later\&. The ${datadir}/dk4app, ${sysconfdir}/dk4app, ${datadir}/dktools, ${sysconfdir}/dktools, ${datadir}/bmpp directories are managed by the package management, you should not create or modify files here\&. Files in these directories may be updated or deleted during package updates\&. Use ${datadir}/dk4app\-site, ${sysconfdir}/dk4app\-site, ${datadir}/dktools\-site, ${sysconfdir}/dktools\-site, ${datadir}/bmpp\-site, ${sysconfdir}/bmpp\-site, ${HOME}/\&.dk4app, ${HOME}/\&.dk4app/dktools, or ${HOME}/\&.dk4app/bmpp for customized dk4gra\&.conf files\&.
+.sp
+On start the bmpp program checks for the file in the following locations in the specified order:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk4app/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk4app/dk4gra\&.conf
+.RE
+.sp
.RS 4
-If paper=\&... the named paper size must be configured in a dk3paper\&.conf file\&.
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk4app\-site/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk4app\-site/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dktools/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dktools/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dktools\-site/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dktools\-site/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/bmpp/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/bmpp/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/bmpp\-site/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/bmpp\-site/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/dktools/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/bmpp/dk4gra\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\&./dk4gra\&.conf
+.RE
.RE
.SH "RESTRICTIONS"
.sp
+File name size is restricted to MAXPATHLEN respectively _PATH_MAX on your system\&. The full path names of all files used must fit into this length\&.
+.sp
The program uses the TIFFReadRGBAImage() function from the libtiff library to read TIFF images\&. The input file must meet the following conditions:
.sp
.RS 4
@@ -275,7 +976,7 @@ The file must be compliant to the "TIFF baseline v6\&.0 standard"\&.
.sp -1
.IP \(bu 2.3
.\}
-The number of bits of component must be 8 or less\&.
+The number of bits per component must be 8 or less\&.
.RE
.sp
.RS 4
@@ -286,24 +987,21 @@ The number of bits of component must be 8 or less\&.
.sp -1
.IP \(bu 2.3
.\}
-The frames must not be too large, the system must be able to allocate the 4 * w * h bytes needed for image date in one piece\&.
+The frames must not be too large, the system must be able to allocate the 4*w*h bytes needed for imaga date in one piece\&.
.RE
.sp
-TIFF refers to a group of different compression and encoding mechanisms\&. A TIFF file is a sequence of data chunks, each data chunk contains a tag (chunk type identifier)\&. A lot of tags is defined in standards, i\&.e\&. the "TIFF baseline v6\&.0 standard"\&. Some software vendors add vendor\-specific or non\-standard tags when writing TIFF files\&. So when processing TIFF files in bmpp, you should not be surprised to see warnings or error messages about unknown TIFF tags\&. Neither bmpp nor the tifflib library are to blame for this, it is the responsibility of the people adding the non\-standard tags\&. Sometimes bmpp can read the image despite of the warnings/errors\&.
+TIFF refers to a group of different compression and encoding mechanisms\&. A TIFF file is a sequence of data chunks, each data chunk contains a tag (chunk type identifier)\&. A lot of tags is defined in standards, i\&.e\&. the "TIFF baseline v6\&.0 standard"\&. Some software vendors add vendor\-specific or non\-standard tags when writing TIFF files\&. So when processing TIFF files in bmpp, you should not be surprised to see warnings or error messages about unknown TIFF tags\&. Neither bmpp nor the tifflib library are to blame for this, it\(cqs the responsibility of the people adding the non\-standard tags\&. Sometimes bmpp can read the image despite of the warnings/errors\&.
.sp
If you create bitmaps you want to process with bmpp, you should create PNG images instead of TIFF images if you have the choice\&.
-.SH "NOTES"
-.sp
-This program uses DK libraries version 3\&.
-.SH "AUTHOR"
+.SH "AUTHORS"
.sp
Dirk Krause
.SH "HISTORY"
.sp
-The bmpp program replaces the bmeps program found in previous versions of dktools\&.
+The bmpp program replaces the bmeps program found in earlier versions of the DK tools and libraries project\&. The program was rewritten completely for version 4\&.12\&.0, including the used libraries for reading bitmap images and producing graphics output\&.
.SH "COPYRIGHT AND LICENSE"
.sp
-Copyright (c) 2011\-2016, Dirk Krause
+Copyright (c) 2018, Dirk Krause
.sp
All rights reserved\&.
.sp
@@ -345,17 +1043,29 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net/bmpp\&.html
+pnmtops(1)
+.RS 4
+The pnmtops program from the NetPBM project \- see
+http://netpbm\&.sourceforge\&.net
+\- converts NetPBM input files to PS and EPS\&. It can create PS level 1 output, but PS level 1 does not support colored bitmap images\&.
+.RE
+.PP
+convert(1)
+.RS 4
+The convert program from the ImageMagick project can also convert to EPS and PDF\&.
+.RE
+.PP
+dk3paper\&.conf(5)
.RS 4
-The DK tools and libraries homepage contains more information about bmpp and other programs\&.
+How to define paper sizes\&.
.RE
.PP
-http://gxhints\&.sourceforge\&.net
+dk4gra\&.conf(5)
.RS 4
-The Graphics Conversion Hints page recommends programs and shows procedures for conversions between recent vector graphics formats\&.
+Syntax of dk4gra\&.conf files\&.
.RE
.PP
-http://netpbm\&.sourceforge\&.net (especially pnmtops)
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
-NetPBM is a toolkit for graphics images, including conversion of images between a variety of different formats\&.
+Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/wxdkct.1 b/support/dktools/man/man1/dk-bin2c.1
index 6d30e1e54e..4568ce62ae 100644
--- a/support/dktools/man/man1/wxdkct.1
+++ b/support/dktools/man/man1/dk-bin2c.1
@@ -1,13 +1,13 @@
'\" t
-.\" Title: wxdkct
+.\" Title: dk-bin2c
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "WXDKCT" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-BIN2C" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -28,95 +28,69 @@
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
-wxdkct \- wxWidgets GUI version of dkct
+dk-bin2c \- Convert binary data to C source
.SH "SYNOPSIS"
.sp
-wxdkct
+\fBdk\-bin2c\fR [\fIoptions\fR] [\fIfile(s)\fR]
.SH "DESCRIPTION"
.sp
-The program provides:
-.sp
+The program converts binary input from the named files or from standard input to C source code (array of literal unsigned char values in hexadecimal or octal notation)\&.
+.SH "OPTIONS"
+.PP
+\fB\-o\fR, \fB\-\-octal\fR
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-A preprocessor for debug/trace instructions,
+Octal output instead of hexadecimal output\&.
.RE
-.sp
+.PP
+\fB\-i\fR \fIindent\fR, \fB\-\-indent=\fR\fIindent\fR
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-a code generator for state machines,
+Line indent, number of spaces at start of each line\&. Default: 0\&.
.RE
-.sp
+.PP
+\fB\-s\fR \fIspaces\fR, \fB\-\-spaces=\fR\fIspaces\fR
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-a code generator for GUIs using the wxWidgets library\&.
+Number of spaces between elements in a line\&. Default: 0\&.
.RE
-.sp
-The program converts *\&.ctr, *\&.cpt, *\&.mtr and *\&.jtr files to *\&.c, *\&.cpp, *\&.m and *\&.java\&. The source files can contain debug instructions in a special notation\&. When producing release versions the debug instructions are ignored\&. When producing debug versions the debug instructions are converted to output instructions\&.
-.sp
-In the GUI you can:
-.sp
+.PP
+\fB\-b\fR \fIbytes\fR, \fB\-\-bytes\-per\-line=\fR\fIbytes\fR
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Choose a directory containing the source files,
+Number of byte representations in each text line\&. Default: 15\&.
.RE
-.sp
+.PP
+\fB\-\-help\fR
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-set conversion options and
+Show short help text\&.
.RE
-.sp
+.PP
+\fB\-\-manual\fR
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-start conversions\&.
+Show manual\&.
+.RE
+.PP
+\fB\-\-version\fR
+.RS 4
+Show version number\&.
+.RE
+.PP
+\fB\-\-license\fR
+.RS 4
+Show license terms\&.
.RE
.SH "EXIT STATUS"
.sp
The program returns exit status code 0 on success, all other status codes indicate an error\&.
-.SH "NOTES"
-.sp
-This program uses DK libraries version 3\&.
+.SH "ENVIRONMENT"
+.PP
+\fBVIM\fR, \fBVIMRUNTIME\fR
+.RS 4
+On Windows the program checks for the presence of these variables to detect whether or not it is run from inside vim\&. When run from within vim diagnostic messages are suppressed to avoid mixing 8 bit text from normal output with 16 bit text from diagnostics\&.
+.RE
.SH "AUTHORS"
.sp
Dirk Krause
.SH "COPYRIGHT AND LICENSE"
.sp
-Copyright (c) 2011\-2016, Dirk Krause
+Copyright (c) 2019, Dirk Krause
.sp
All rights reserved\&.
.sp
@@ -158,12 +132,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-\fBdkct(1)\fR
-.RS 4
-Command line version of wxdkct\&.
-.RE
-.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-blks.1 b/support/dktools/man/man1/dk-blks.1
index 8a5fdd81f8..c8009b8d5e 100644
--- a/support/dktools/man/man1/dk-blks.1
+++ b/support/dktools/man/man1/dk-blks.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-blks
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-BLKS" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "DK\-BLKS" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -96,7 +96,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-bmm.1 b/support/dktools/man/man1/dk-bmm.1
index f62bd1bbc8..6e768631e6 100644
--- a/support/dktools/man/man1/dk-bmm.1
+++ b/support/dktools/man/man1/dk-bmm.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-bmm
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-BMM" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-BMM" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -109,7 +109,7 @@ This program uses DK libraries version 4\&.
Dirk Krause
.SH "HISTORY"
.sp
-This program was named \*(Aqtape\*(Aq in version 2\&.x\&.x, in version 3\&.x\&.x the functionality was availalbe in \*(Aqdkt tape\*(Aq\&.
+This program was named \*(Aqtape\*(Aq in version 2\&.x\&.x, in version 3\&.x\&.x the functionality was available in \*(Aqdkt tape\*(Aq\&.
.SH "COPYRIGHT AND LICENSE"
.sp
Copyright (c) 2015\-2016, Dirk Krause
@@ -154,7 +154,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-cat.1 b/support/dktools/man/man1/dk-cat.1
index 0f8ecbf4d5..9a7906ec58 100644
--- a/support/dktools/man/man1/dk-cat.1
+++ b/support/dktools/man/man1/dk-cat.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-cat
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-CAT" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "DK\-CAT" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -197,7 +197,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-db2t.1 b/support/dktools/man/man1/dk-db2t.1
index ee00af83a6..c3b80d089d 100644
--- a/support/dktools/man/man1/dk-db2t.1
+++ b/support/dktools/man/man1/dk-db2t.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-db2t
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-DB2T" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "DK\-DB2T" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -217,7 +217,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-dbco.1 b/support/dktools/man/man1/dk-dbco.1
index 907d445f0c..72cd72d857 100644
--- a/support/dktools/man/man1/dk-dbco.1
+++ b/support/dktools/man/man1/dk-dbco.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-dbco
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-DBCO" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "DK\-DBCO" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -179,7 +179,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-eradisk.1 b/support/dktools/man/man1/dk-eradisk.1
index a4443a1fdc..62302fe0ad 100644
--- a/support/dktools/man/man1/dk-eradisk.1
+++ b/support/dktools/man/man1/dk-eradisk.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-eradisk
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-ERADISK" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-ERADISK" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -34,7 +34,7 @@ dk-eradisk \- Generate patterns to erase disk before retiring it
\fBdk\-eradisk\fR [\fIoptions\fR]
.SH "DESCRIPTION"
.sp
-The program generates a data stream to erase a disk\&. Before retiring a disk or handing a disk over to another user one should remove all contents\&. The output from dk\-eradisk can be used as input for the "dd" program to savely clean a disk\&.
+The program generates a data stream to erase a disk\&. Before retiring a disk or handing a disk over to another user one should remove all contents\&. The output from dk\-eradisk can be used as input for the "dd" program to safely clean a disk\&.
.SH "OPTIONS"
.PP
\fB\-p\fR \fInumber\fR, \fB\-\-pass=\fR\fInumber\fR
@@ -104,7 +104,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-fic.1 b/support/dktools/man/man1/dk-fic.1
index 53a395435c..079571f32c 100644
--- a/support/dktools/man/man1/dk-fic.1
+++ b/support/dktools/man/man1/dk-fic.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-fic
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-FIC" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-FIC" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -138,7 +138,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(r
This product includes cryptographic software written by Eric Young (eay@cryptsoft\&.com)\&. This product includes software written by Tim Hudson (tjh@cryptsoft\&.com)\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-hex.1 b/support/dktools/man/man1/dk-hex.1
index ea7d202173..4d118f605b 100644
--- a/support/dktools/man/man1/dk-hex.1
+++ b/support/dktools/man/man1/dk-hex.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-hex
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-HEX" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "DK\-HEX" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -112,7 +112,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-lines.1 b/support/dktools/man/man1/dk-lines.1
new file mode 100644
index 0000000000..9eed270e78
--- /dev/null
+++ b/support/dktools/man/man1/dk-lines.1
@@ -0,0 +1,292 @@
+'\" t
+.\" Title: dk-lines
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
+.\" Manual: \ \&
+.\" Source: \ \&
+.\" Language: English
+.\"
+.TH "DK\-LINES" "1" "11/11/2019" "\ \&" "\ \&"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+dk-lines \- Extract lines from text
+.SH "SYNOPSIS"
+.sp
+\fBdk\-lines\fR [\fIoption(s)\fR] [\fIfiles(s)\fR]
+.SH "DESCRIPTION"
+.sp
+The program extracts specified lines from a text obtained from the specified files or standard input\&.
+.sp
+There are 2 processing stages, both stages are optional\&.
+.sp
+In the first stage each text lines beginning is compared against a start text and/or an end text\&. Lines from within the range (including the borders) are transferred to stage 2\&. If only start or end text is specified, a simple comparison is used instead of the range check\&.
+.sp
+The second stage selects lines from stage 1 output by line numbers\&. A start line number and/or an end line number can be specified\&. Positive line numbers are counted from the first line (line number 1) forwards\&. Negative line numbers are counted from the final line (line number \-1) backwards\&.
+.SH "OPTIONS"
+.PP
+\fB\-f\fR \fIstarttext\fR, \fB\-\-from=\fR\fIstarttext\fR
+.RS 4
+Specify the start text for stage 1\&.
+.RE
+.PP
+\fB\-t\fR \fIendtext\fR \fB\-\-to=\fR\fIendtext\fR
+.RS 4
+Specify the end text for stage 1\&.
+.RE
+.PP
+\fB\-\-today\fR
+.RS 4
+Specify the current date in YYYY\-MM\-DD notation for start and end text unless specified using \-t or \-f\&. You can not use \-\-today if both \-t and \-f are specified\&.
+.RE
+.PP
+\fB\-l\fR \fIrange\fR, \fB\-\-lines=\fR\fIrange\fR
+.RS 4
+Specify the line number range for stage 2 in one of the following notations:
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt.
+T{
+\fIs\fR
+T}:T{
+Specify just start line number\&.
+T}
+T{
+\fIs\fR\fB/\fR\fIe\fR
+T}:T{
+Specify start and end line number\&.
+T}
+T{
+\fB/\fR\fIe\fR
+T}:T{
+Specify just end line number\&.
+T}
+.TE
+.sp 1
+.RE
+.sp
+The start line number is the first line to print\&. The end line number is the final line to print\&.
+.PP
+\fB\-o\fR, \fB\-\-one\-stream\fR
+.RS 4
+For multiple input files, group the stage 1 results from all files before applying stage 2\&. Without this option the line number range is applied to each file individually\&.
+.RE
+.PP
+\fB\-i\fR \fIstring\fR, \fB\-\-input\-encoding=\fR\fIstring\fR
+.RS 4
+Expected input encoding\&. A byte order marker (BOM) at the beginning of the file overwrites the encoding specified here\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+ascii
+T}:T{
+ASCII or ISO\-8859\-1
+T}
+T{
+ansi
+T}:T{
+ANSI
+T}
+T{
+utf\-8
+T}:T{
+UTF\-8
+T}
+T{
+utf\-16
+T}:T{
+UTF\-16 in the systems default endianness
+T}
+T{
+utf\-16\-lsb
+T}:T{
+UTF\-16, least significant byte first
+T}
+T{
+utf\-16\-msb
+T}:T{
+UTF\-16, most significant byte first
+T}
+T{
+c32
+T}:T{
+32 bit character in the systems default endianness
+T}
+T{
+c32\-lsb
+T}:T{
+32 bit character, least significant byte first
+T}
+T{
+c32\-msb
+T}:T{
+32 bit character, most significant byte first
+T}
+.TE
+.sp 1
+.RE
+.PP
+\fB\-\-line\-size=\fR\fIsize\fR
+.RS 4
+Choose a line buffer size different from the default (4096 bytes)\&.
+.RE
+.PP
+\fB\-v\fR, \fB\-\-verbose\fR
+.RS 4
+Produce verbose diagnostics\&.
+.RE
+.SH "EXIT STATUS"
+.sp
+The program returns exit status code 0 on success, all other status codes indicate an error\&.
+.SH "RESTRICTIONS"
+.sp
+On Windows the file name length is restricted to _MAX_PATH (260) characters if the file name contains a wildcard (* or ? character)\&.
+.SH "EXAMPLES"
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Find files modified in a specified range of dates:
+.sp
+dk\-ls \-pmn \-tf \-r | dk\-lines \-\-from=2017\-11\-18 \-\-to=2017\-11\-19
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Find files modified today:
+.sp
+dk\-ls \-pmn \-tf \-r | dk\-lines \-\-today
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Find 10 newest files (last modified):
+.sp
+dk\-ls \-pmn \-tf \-r | dk\-sort | dk\-lines \-l \-10
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Find 10 oldest files (by modification date):
+.sp
+dk\-ls \-pmn \-tf \-r | dk\-sort | dk\-lines \-l 1/10
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Show contents of file "x\&.txt", omit first 3 and final 2 lines:
+.sp
+dk\-lines \-l 4/\-3 x\&.txt
+.RE
+.SH "AUTHORS"
+.sp
+Dirk Krause
+.SH "HISTORY"
+.sp
+The program was added in version 4\&.10\&.0\&.
+.SH "COPYRIGHT AND LICENSE"
+.sp
+Copyright (c) 2017, Dirk Krause
+.sp
+All rights reserved\&.
+.sp
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Neither the name of the copyright holder(s) nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
+.RE
+.sp
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
+.SH "SEE ALSO"
+.PP
+http://sourceforge\&.net/p/dktools/wiki/Home/
+.RS 4
+Project homepage\&.
+.RE
diff --git a/support/dktools/man/man1/dk-ls.1 b/support/dktools/man/man1/dk-ls.1
index 21b5668346..ca2a099b90 100644
--- a/support/dktools/man/man1/dk-ls.1
+++ b/support/dktools/man/man1/dk-ls.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-ls
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-LS" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "DK\-LS" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -264,7 +264,7 @@ A sequence of question marks is printed if the program fails to obtain device nu
A single question mark is printed if the program fails to obtain number of links, file owner UID, or file owner GID\&.
.sp
A sequence of \*(Aqx\*(Aq characters is printed if a message digest is requested for anything else than a regular file or if the program failed to read the file\&.
-.SH "TYPE OUTPUT ON NON-WINDOWS SYSTEMS"
+.SH "TYPE OUTPUT ON NON\-WINDOWS SYSTEMS"
.sp
.RS 4
.ie n \{\
@@ -421,7 +421,7 @@ T}
.TE
.sp 1
.RE
-.SH "PERMISSIONS OUTPUT ON NON-WINDOWS SYSTEMS"
+.SH "PERMISSIONS OUTPUT ON NON\-WINDOWS SYSTEMS"
.sp
The output consists of 3 groups: Permissions for file owner user, file owner group and other persons\&. Each group consists of 3 characters indicating read (\*(Aqr\*(Aq), write (\*(Aqw\*(Aq), and execute (\*(Aqx\*(Aq) permission\&.
.sp
@@ -756,7 +756,7 @@ T{
DK tools home page
T}:T{
.sp
-http://dktools\&.sourceforge\&.net/dk\-ls\&.html
+http://sourceforge\&.net/p/dktools/wiki/dk\-ls/
T}
.TE
.sp 1
diff --git a/support/dktools/man/man1/dk-pwd.1 b/support/dktools/man/man1/dk-pwd.1
index 0223d39fbb..745b78493d 100644
--- a/support/dktools/man/man1/dk-pwd.1
+++ b/support/dktools/man/man1/dk-pwd.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-pwd
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-PWD" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-PWD" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -99,7 +99,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-pwgen.1 b/support/dktools/man/man1/dk-pwgen.1
index d135e0022e..18d81eab69 100644
--- a/support/dktools/man/man1/dk-pwgen.1
+++ b/support/dktools/man/man1/dk-pwgen.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-pwgen
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-PWGEN" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "DK\-PWGEN" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -225,7 +225,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(r
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www\&.openssl\&.org/)\&. This product includes cryptographic software written by Eric Young (eay@cryptsoft\&.com)\&. This product includes software written by Tim Hudson (tjh@cryptsoft\&.com)\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-rand.1 b/support/dktools/man/man1/dk-rand.1
index 968cdddb23..cf91d27b74 100644
--- a/support/dktools/man/man1/dk-rand.1
+++ b/support/dktools/man/man1/dk-rand.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-rand
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-RAND" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "DK\-RAND" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -126,7 +126,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-recv.1 b/support/dktools/man/man1/dk-recv.1
index 0a0323c68f..af2667adde 100644
--- a/support/dktools/man/man1/dk-recv.1
+++ b/support/dktools/man/man1/dk-recv.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-recv
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-RECV" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-RECV" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -144,7 +144,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-send.1 b/support/dktools/man/man1/dk-send.1
index 4740b5bc29..4a7ca0cb21 100644
--- a/support/dktools/man/man1/dk-send.1
+++ b/support/dktools/man/man1/dk-send.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-send
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/22/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-SEND" "1" "03/22/2017" "\ \&" "\ \&"
+.TH "DK\-SEND" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -169,7 +169,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-sort.1 b/support/dktools/man/man1/dk-sort.1
index 3a501c8c5a..acae225a5b 100644
--- a/support/dktools/man/man1/dk-sort.1
+++ b/support/dktools/man/man1/dk-sort.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-sort
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-SORT" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "DK\-SORT" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -226,7 +226,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-sqlsplit.1 b/support/dktools/man/man1/dk-sqlsplit.1
index 8800ecd604..c33f799002 100644
--- a/support/dktools/man/man1/dk-sqlsplit.1
+++ b/support/dktools/man/man1/dk-sqlsplit.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-sqlsplit
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-SQLSPLIT" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-SQLSPLIT" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -93,7 +93,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-t2db.1 b/support/dktools/man/man1/dk-t2db.1
index 624ac379ce..0f0ac0025c 100644
--- a/support/dktools/man/man1/dk-t2db.1
+++ b/support/dktools/man/man1/dk-t2db.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-t2db
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-T2DB" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-T2DB" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -73,7 +73,7 @@ T}
.PP
\fB\-a\fR, \fB\-\-add\fR
.RS 4
-adds data to an existing database (modifies or adds records)\&. Without this option the program deletes an exisiting database and creates a new one\&.
+adds data to an existing database (modifies or adds records)\&. Without this option the program deletes an existing database and creates a new one\&.
.RE
.PP
\fB\-R\fR, \fB\-\-reset\fR
@@ -226,7 +226,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-t2h.1 b/support/dktools/man/man1/dk-t2h.1
index 3ebb68711a..4f6cfde5eb 100644
--- a/support/dktools/man/man1/dk-t2h.1
+++ b/support/dktools/man/man1/dk-t2h.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-t2h
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-T2H" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-T2H" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -180,7 +180,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-t2l.1 b/support/dktools/man/man1/dk-t2l.1
index e692252e23..c52588a81f 100644
--- a/support/dktools/man/man1/dk-t2l.1
+++ b/support/dktools/man/man1/dk-t2l.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-t2l
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-T2L" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DK\-T2L" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -134,6 +134,13 @@ Write \eHT{} for tabulators (default is to write a space)\&.
.RS 4
Show error message upon interrupt by SIGPIPE\&.
.RE
+.PP
+\fB\-\-check\fR
+.RS 4
+Load all data files and run syntax check\&. No processing of data from standard input\&. This option can be used in conjunction with preference
+\fB\-\-dir\&.charmap=\fR\fIdirectory\fR
+to check all translation tables in the specified directory\&.
+.RE
.SH "EXIT STATUS"
.sp
The program returns exit status code 0 on success, all other values indicate errors\&.
@@ -172,6 +179,85 @@ Information about font encodings\&. You can either specify the font encodings us
.RS 4
Information about LaTeX packages required\&.
.RE
+.SH "EXAMPLES"
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Process standard input:
+.sp
+dk\-t2l
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Process input from file x\&.txt:
+.sp
+dk\-t2l x\&.txt
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Process command line arguments to get LaTeX encoding for \(lqX_Y_Z\(rq:
+.sp
+dk\-t2l \-e X_Y_Z
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Find LaTeX encoding for character U+2122 (trademark):
+.sp
+dk\-t2l \-h 2122
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Find LaTeX encoding for character U+2122 (trademark) and get recommendations for usable font encodings and/or recommended packages:
+.sp
+dk\-t2l \-r \-h 2122
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Check new translation table files in /tmp/newtables:
+.sp
+dk\-t2l \-\-check \-\-dir\&.charmap=/tmp/newtables
+.RE
.SH "RESTRICTIONS"
.sp
On Windows the file name length is restricted to _MAX_PATH (260) characters if the file name contains a wildcard (* or ? character)\&.
@@ -230,7 +316,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk-uid.1 b/support/dktools/man/man1/dk-uid.1
index 6e16b4a66d..944ed00d9f 100644
--- a/support/dktools/man/man1/dk-uid.1
+++ b/support/dktools/man/man1/dk-uid.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk-uid
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK\-UID" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "DK\-UID" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -111,7 +111,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk3info.1 b/support/dktools/man/man1/dk3info.1
index 8a76b0d38e..68da049f05 100644
--- a/support/dktools/man/man1/dk3info.1
+++ b/support/dktools/man/man1/dk3info.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk3info
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 05/25/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK3INFO" "1" "05/25/2016" "\ \&" "\ \&"
+.TH "DK3INFO" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -91,7 +91,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dk4info.1 b/support/dktools/man/man1/dk4info.1
index 77cd6e669e..8e470e66a8 100644
--- a/support/dktools/man/man1/dk4info.1
+++ b/support/dktools/man/man1/dk4info.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dk4info
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 01/03/2016
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DK4INFO" "1" "01/03/2016" "\ \&" "\ \&"
+.TH "DK4INFO" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -91,7 +91,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dkct.1 b/support/dktools/man/man1/dkct.1
index 21bfd73931..9da5f08104 100644
--- a/support/dktools/man/man1/dkct.1
+++ b/support/dktools/man/man1/dkct.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dkct
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DKCT" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DKCT" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -123,6 +123,21 @@ Make mode: rebuild destination files only if necessary\&.
Set box with for comment boxes\&.
.RE
.PP
+\fB\-S\fR, \fB\-\-splint\fR
+.RS 4
+Splint annotation comment output\&.
+.RE
+.PP
+\fB\-\-splint\-comment\-char=\fR\fIcharacter\fR
+.RS 4
+Use the specified character as comment character for splint annotations\&.
+.RE
+.PP
+\fB\-\-no\-modification\-warning\fR
+.RS 4
+Suppress warning at start of output files\&.
+.RE
+.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Show help text\&.
@@ -195,7 +210,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(r
Input file syntax for dkct (*\&.ctr, *\&.cpt, *\&.mtr files)\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dkdbt.1 b/support/dktools/man/man1/dkdbt.1
index 5dd3013353..113743ec36 100644
--- a/support/dktools/man/man1/dkdbt.1
+++ b/support/dktools/man/man1/dkdbt.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dkdbt
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DKDBT" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DKDBT" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -272,7 +272,7 @@ The first line in the example is a comment\&. The record with the \*(AqPoland\*(
.sp
\fBInput files for dkdbt split\-sql\-lines\fR
.sp
-The line splitting algorithm is very simple, lines are splitted after the comman in \*(Aq),(\fI\&. So you can use it only on mysqldump output of databases not containing the text \e\fR),(\*(Aq in any of the values\&.
+The line splitting algorithm is very simple, lines are split after the comman in \*(Aq),(\fI\&. So you can use it only on mysqldump output of databases not containing the text \e\fR),(\*(Aq in any of the values\&.
.SH "AUTHOR"
.sp
Dirk Krause
@@ -320,7 +320,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dktools.1 b/support/dktools/man/man1/dktools.1
index 1d9e866eae..b874603734 100644
--- a/support/dktools/man/man1/dktools.1
+++ b/support/dktools/man/man1/dktools.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dktools
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DKTOOLS" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "DKTOOLS" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -400,7 +400,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/dkwxwiz.1 b/support/dktools/man/man1/dkwxwiz.1
index 66eea5ba73..24902aff81 100644
--- a/support/dktools/man/man1/dkwxwiz.1
+++ b/support/dktools/man/man1/dkwxwiz.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: dkwxwiz
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DKWXWIZ" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "DKWXWIZ" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -160,7 +160,7 @@ Template for the *\&.xpm icon file\&.
You can create copies of these files in dkt\-3\-site and modify them i\&.e\&. to set a default copyright owner and a default license type\&.
.SH "SEE ALSO"
.sp
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.SH "AUTHOR"
.sp
Dirk Krause
@@ -208,7 +208,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/fig2lat.1 b/support/dktools/man/man1/fig2lat.1
index 89639111c0..71428f61f9 100644
--- a/support/dktools/man/man1/fig2lat.1
+++ b/support/dktools/man/man1/fig2lat.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: fig2lat
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "FIG2LAT" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "FIG2LAT" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -261,6 +261,11 @@ Minimum number of X\-spline segments for each arrowhead edge\&. Default: 4
.RS 4
Arrowhead iteration precision\&. Default: 0\&.04\&.
.RE
+.PP
+\fBahbs\fR[=\fIboolean\fR]
+.RS 4
+Use simple bisection algorithm to calculate arrowheads on X\-splines\&. In version 4\&.17\&.0 and above the Anderson\-Bjoerck variant of regula falsi is used by default\&.
+.RE
.RE
.sp
.RS 4
@@ -485,7 +490,7 @@ Dirk Krause
This program replaces the fig2vect program seen in previous versions of dktools\&.
.SH "COPYRIGHT AND LICENSE"
.sp
-Copyright (c) 2012\-2016, Dirk Krause
+Copyright (c) 2012\-2018, Dirk Krause
.sp
All rights reserved\&.
.sp
@@ -536,5 +541,5 @@ Proceedings of the SIGGRAPH 1995
.PP
\fBfig2lat\fR
.RS 4
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RE
diff --git a/support/dktools/man/man1/htmlbook.1 b/support/dktools/man/man1/htmlbook.1
index ecd34162a7..51fd3c5329 100644
--- a/support/dktools/man/man1/htmlbook.1
+++ b/support/dktools/man/man1/htmlbook.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: htmlbook
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "HTMLBOOK" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "HTMLBOOK" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -196,7 +196,7 @@ tidy(1)
Validate, correct and pretty\-print HTML files\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/itaclean.1 b/support/dktools/man/man1/itaclean.1
index 62265793a6..136007a547 100644
--- a/support/dktools/man/man1/itaclean.1
+++ b/support/dktools/man/man1/itaclean.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: itaclean
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 05/25/2016
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "ITACLEAN" "1" "05/25/2016" "\ \&" "\ \&"
+.TH "ITACLEAN" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
diff --git a/support/dktools/man/man1/itadmin.1 b/support/dktools/man/man1/itadmin.1
index 5cb2aed17d..d7ed11211d 100644
--- a/support/dktools/man/man1/itadmin.1
+++ b/support/dktools/man/man1/itadmin.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: itadmin
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 06/27/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "ITADMIN" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "ITADMIN" "1" "06/27/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -134,6 +134,36 @@ Organizational unit name, used in document title\&.
.RS 4
If this flag is set, the \(lqsrcbook\(rq and \(lqsrcartcl\(rq document classes are used in licenses\&.tex and netdocu\&.tex instead of \(lqbook\(rq and \(lqarticle\(rq\&. If A4 is your preferred paper size for printouts, I recommend to set this flag\&.
.RE
+.PP
+\fBmarker point = \fR\fIboolean\fR
+.RS 4
+Write point markers in the dhcpd\&.conf file\&. Default: on\&.
+.RE
+.PP
+\fBmarker vlan = \fR\fIboolean\fR
+.RS 4
+Write range markers in vlan definitions in the dhcpd\&.conf file\&. Default: on\&.
+.RE
+.PP
+\fBmarker subnet = \fR\fIboolean\fR
+.RS 4
+Write range markers in subnet definitions in the dhcpd\&.conf file\&. Default: on\&.
+.RE
+.PP
+\fBmarker group = \fR\fIboolean\fR
+.RS 4
+Write range markers in group definitions in the dhcpd\&.conf file\&. Default: on\&.
+.RE
+.PP
+\fBmarker pool = \fR\fIboolean\fR
+.RS 4
+Write range markers in pool definitions in the dhcpd\&.conf file\&. Default: on\&.
+.RE
+.PP
+\fBmarker host = \fR\fIboolean\fR
+.RS 4
+Write range markers in host definitions in the dhcpd\&.conf file\&. Default: on\&.
+.RE
.RE
.SH "AUTHOR"
.sp
@@ -185,7 +215,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/lprngcl.1 b/support/dktools/man/man1/lprngcl.1
index 65ad26d534..9e80bb1859 100644
--- a/support/dktools/man/man1/lprngcl.1
+++ b/support/dktools/man/man1/lprngcl.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: lprngcl
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "LPRNGCL" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "LPRNGCL" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -128,7 +128,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/pjsnmp.1 b/support/dktools/man/man1/pjsnmp.1
index 770d3c5a2c..92b54ebbfb 100644
--- a/support/dktools/man/man1/pjsnmp.1
+++ b/support/dktools/man/man1/pjsnmp.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: pjsnmp
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PJSNMP" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "PJSNMP" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -238,7 +238,7 @@ The status text shown in the first line of the printers console\&.
.sp
\fBStage 1: Device and printer status\fR
.sp
-In the first processing stage a summary state is choosen for the combination of device status and printer status\&.
+In the first processing stage a summary state is chosen for the combination of device status and printer status\&.
.TS
allbox tab(:);
ltB ltB ltB.
@@ -556,7 +556,7 @@ All options for pjsnmp are set by the LPRng print system\&.
.SH "ENVIRONMENT"
.sp
LPRng places a copy of the printcap entry for the printer in the PRINTCAP_ENTRY environment variable\&.
-.SH "FILES - THE PRINTCAP FILE"
+.SH "FILES \- THE PRINTCAP FILE"
.sp
The ${sysconfdir}/lpd/printcap file configures the LPRng print queues\&.
.sp
@@ -801,7 +801,7 @@ Timeout (number of seconds) to abort data transfer if the network socket is not
.RS 4
Flag: Verbose output (show command line arguments)\&.
.RE
-.SH "FILES - SNMP MODEL FILE"
+.SH "FILES \- SNMP MODEL FILE"
.sp
The ${datarootdir}/dktools/print\-snmp\&.conf file (or any other file you specify in the :pjsnmp\-model\-file entry in the printcap file) configures SNMP models\&.
.sp
@@ -968,7 +968,7 @@ This program uses DK libraries version 4\&.
It is not available on the Windows platform\&.
.sp
Written as a simple program (not an application) it is not relocatable, all diagnostic messages and output texts are in English\&.
-.SH "NOTES - REASONABLE SNMP IMPLEMENTATION"
+.SH "NOTES \- REASONABLE SNMP IMPLEMENTATION"
.sp
The first printers I used with pjsnmp followed the table found in [Edl2003] and a similar table found in RFC 3805\&.
.TS
@@ -1129,12 +1129,12 @@ indicates only conditions not preventing the printer from printing\&.
.\}
If the printer has print data but any conditions prevents printing, one of the \(lqError\(rq condition bits in hrPrinterDetectedErrorState is set\&.
.RE
-.SH "NOTES - THE SPECIAL SNMP IMPLEMENTATION"
+.SH "NOTES \- THE SPECIAL SNMP IMPLEMENTATION"
.sp
Unfortunately some printer manufacturers use the \fIwarning\fR/\fIother\fR combination both for \(lqprinter is idle but there is a warning condition\(rq and for \(lqprinting interrupted due to error like out of paper, out of toner\&...\(rq\&.
.sp
Very special implementations show only warning conditions in hrPrinterDetectedErrorState in these situations\&.
-.SH "NOTES - CONCLUSION"
+.SH "NOTES \- CONCLUSION"
.sp
In the default configuration pjsnmp handles printers with a reasonable SNMP implementation\&. SNMP models are required to handle the special SNMP implementations\&.
.SH "AUTHOR"
@@ -1199,7 +1199,7 @@ T{
DK tools home page
T}:T{
.sp
-http://dktools\&.sourceforge\&.net/dk\-ls\&.html
+http://sourceforge\&.net/p/dktools/wiki/dk\-ls/
T}
.TE
.sp 1
diff --git a/support/dktools/man/man1/plpdftex.1 b/support/dktools/man/man1/plpdftex.1
index 3e01448abe..3c5eaa721e 100644
--- a/support/dktools/man/man1/plpdftex.1
+++ b/support/dktools/man/man1/plpdftex.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: plpdftex
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PLPDFTEX" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "PLPDFTEX" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -34,19 +34,24 @@ plpdftex \- Output driver for octpgfpl
\fBplpdftex\fR [\fIoption\fR]
.SH "DESCRIPTION"
.sp
-The program creates a PDF/TeX file pair based on graphics instructions found in input\&.
+The program creates a PDF/TeX or EPS/TeX file pair based on graphics instructions found in input\&.
.sp
It is not a general purpose program, it is only an output driver for the octpgfpl package for GNU Octave\&.
.SH "OPTIONS"
.PP
-\fB\-l\fR
+\fB\-\-license\fR
.RS 4
Show license terms\&.
.RE
.PP
\fB\-\-help\fR
.RS 4
-Show help text\&.
+Show short help text\&.
+.RE
+.PP
+\fB\-\-manual\fR
+.RS 4
+Show detailed help text\&.
.RE
.PP
\fB\-\-check\-presence\fR
@@ -56,6 +61,184 @@ Write \*(Aq1\*(Aq to standard output and return exit code 0\&. The pgfplot() fun
.SH "EXIT STATUS"
.sp
The program sets exit status code 0 on success, any other value indicates an error\&.
+.SH "INPUT"
+.sp
+Input is read from standard input\&.
+.sp
+The first line specifies a file name combination\&. It must end on either \fB\&.pdftex\fR to produce a PDF+TeX combination for inclusion in a LaTeX document or on \fB\&.pdftexs\fR to produce a PDF+TeX combination for standalone processing\&. Use \fB\&.epstex\fR to produce an EPS+TeX combination for inclusion in a LaTeX document\&.
+.sp
+The second line contains two unsigned integer numbers, separated by spaces: Image width and height in PS/PDF points (known as bp in LaTeX)\&.
+.sp
+The remaining lines describe the image, there are \(lqt\(rq lines and \(lqp\(rq lines, i\&.e\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+t fs 12
+t font\-setup \eusepackage[T1]{fontenc}
+t package \eusepackage[intlimit]{amsmath}
+t preamble \eDeclareMathOperator{\eintd}{\etext{d}}
+t text 10 20 base left black This is a test\&.
+t text\-box 10 20 base left red This is another test\&.
+p gsave
+p grestore
+p lw 3
+p buttcap
+p miterjoin
+p nodash
+p stroke\-color blue!50!black
+p fill\-color red!80!white
+p prepare\-stroke
+p prepare\-fill
+p rectangle 5 5 200 80
+p circle 20 30 5
+p moveto 30 80
+p lineto 50 90
+p curveto 50 100 100 100 100 90
+p closepath
+p stroke
+p fill
+p clip
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+The \(lqt fs\(rq \(lqt font\-setup\(rq, \(lqt package\(rq and \(lqt preamble\(rq lines are only used when producing a \fB\&.pdf/\fR\&.tex file combination for standalone processing, otherwise they are ignored\&.
+.PP
+\fBt fs\fR
+.RS 4
+specifies the font size for the documentclass line\&. This line must be used before \(lqt font\-setup\(rq, \(lqt package\(rq, \(lqt preamble\(rq, \(lqt text\(rq or \(lqp\(rq lines\&. The line is optional, by default the documentclass is written without the font size specification\&.
+.RE
+.PP
+\fBt font\-setup\fR \fItext\fR
+.RS 4
+specifies usepackage and other instructions for font setup\&. These lines are optional, a default font setup section is used if no \(lqt font\-setup\(rq lines are found\&.
+.RE
+.PP
+\fBt package\fR \fItext\fR
+.RS 4
+specifies usepackage to load further packages\&. These lines are optional, a default configuration is used if no \(lqt font\-setup\(rq lines are found\&.
+.RE
+.PP
+\fBt preamble\fR \fItext\fR
+.RS 4
+lines contain further setup instructions for the preamble, they are optional\&.
+.RE
+.PP
+\fBt text\fR \fIx\fR \fIy\fR \fIva\fR \fIha\fR \fIcolor\fR \fItext\fR
+.RS 4
+lines contain text labels to show\&. The line contains x position, y position, vertical alignment (bottom, base, centered, or top), horizontal alignment (left, centered, or right), color and the text to show\&.
+.sp
+All color definitions must be LaTeX color strings like \(lqblue!50!white\(rq\&.
+.RE
+.PP
+\fBt text\-box\fR \fIx\fR \fIy\fR \fIva\fR \fIha\fR \fIcolor\fR \fItext\fR
+.RS 4
+lines contain text labels to show in a box\&. The line contains x position, y position, vertical alignment (bottom, base, centered, or top), horizontal alignment (left, centered, or right), color and the text to show\&.
+.RE
+.PP
+\fBp gsave\fR
+.RS 4
+saves the current graphics state\&.
+.RE
+.PP
+\fBp grestore\fR
+.RS 4
+restores the graphics state\&.
+.RE
+.PP
+\fBp lw\fR \fIwidth\fR
+.RS 4
+sets the line width for stroking, floating point number, unit is bp (PDF/PS point)\&.
+.RE
+.PP
+\fBp buttcap\fR
+.RS 4
+sets line cap style to butted\&.
+.RE
+.PP
+\fBp miterjoin\fR
+.RS 4
+sets the line join style to miter\&.
+.RE
+.PP
+\fBp nodash\fR
+.RS 4
+sets up contiguous line style\&.
+.RE
+.PP
+\fBp stroke\-color\fR \fIcolor\fR
+.RS 4
+sets the stroke color\&.
+.RE
+.PP
+\fBp fill\-color\fR \fIcolor\fR
+.RS 4
+sets the fill color\&.
+.RE
+.PP
+\fBp prepare\-stroke\fR
+.RS 4
+announces the purpose of the next graphics object(s): stroking\&. For EPS+TeX output plpdftex sets the current color to the stroking color\&.
+.RE
+.PP
+\fBp prepare\-fill\fR
+.RS 4
+announces the purpose of the next graphics object(s): filling\&. For EPS+TeX output pldpdftex sets the current color to the non\-stroking color\&.
+.RE
+.PP
+\fBp rectangle\fR \fIx\-left\fR \fIy\-bottom\fR \fIx\-right\fR \fIy\-top\fR
+.RS 4
+creates a rectangular path, specify start x position, start y position, end x position and end y position\&.
+.RE
+.PP
+\fBp circle\fR \fIx\-center\fR \fIy\-center\fR \fIradius\fR
+.RS 4
+creates a circular path, specify center x position, center y position and radius\&.
+.RE
+.PP
+\fBp moveto\fR \fIx\fR \fIy\fR
+.RS 4
+starts a new path and moves the current position to the specified x and y position\&.
+.RE
+.PP
+\fBp lineto\fR \fIx\fR \fIy\fR
+.RS 4
+adds a line segment from the current position to the specified x and y position to the path\&.
+.RE
+.PP
+\fBp curveto\fR \fIx\-c1\fR \fIy\-c1\fR \fIx\-c2\fR \fIy\-c2\fR \fIx\fR \fIy\fR
+.RS 4
+adds a Bezier segment starting at the current position to the path\&. Specify x and y position of the first control point, x and y position of the second control point and x and y position of the final point\&.
+.RE
+.PP
+\fBp closepath\fR
+.RS 4
+closes the current path\&.
+.RE
+.PP
+\fBp stroke\fR
+.RS 4
+strokes the current path\&.
+.RE
+.PP
+\fBp fill\fR
+.RS 4
+fills the current path\&.
+.RE
+.PP
+\fBp clip\fR
+.RS 4
+uses the current path as clip path\&.
+.RE
+.SH "OUTPUT"
+.sp
+The output file names are determined from the first input line\&.
+.SH "NOTES"
+.sp
+The plpdftex program from DK tools and libraries 4\&.14\&.0 and above can be used with octpgfpl version 1\&.2\&.0 and above only\&.
.SH "RESTRICTIONS"
.PP
\fBNo full graphics instruction set\fR
@@ -117,7 +300,12 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
+.PP
+http://sourceforge\&.net/p/octpgfpl/wiki/Home/
+.RS 4
+Octpgfpl project homepage\&.
+.RE
diff --git a/support/dktools/man/man1/printqd.1 b/support/dktools/man/man1/printqd.1
index c6691f69af..78de2185a8 100644
--- a/support/dktools/man/man1/printqd.1
+++ b/support/dktools/man/man1/printqd.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: printqd
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PRINTQD" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "PRINTQD" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -70,7 +70,7 @@ Make sure the directories
.sp -1
.IP \(bu 2.3
.\}
-${localstatedir}/printqd
+${localstatedir}/lib/printqd
.RE
.sp
.RS 4
@@ -234,7 +234,7 @@ printqd\&.protocol(5)
Communication protocol for printqd\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/printqda.1 b/support/dktools/man/man1/printqda.1
index 24439de712..82478c2c4d 100644
--- a/support/dktools/man/man1/printqda.1
+++ b/support/dktools/man/man1/printqda.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: printqda
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 01/03/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PRINTQDA" "1" "01/03/2016" "\ \&" "\ \&"
+.TH "PRINTQDA" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -257,7 +257,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/printqdc.1 b/support/dktools/man/man1/printqdc.1
index f5e5f22569..8503e88f20 100644
--- a/support/dktools/man/man1/printqdc.1
+++ b/support/dktools/man/man1/printqdc.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: printqdc
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PRINTQDC" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "PRINTQDC" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -264,7 +264,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/printqdi.1 b/support/dktools/man/man1/printqdi.1
index 5533e77426..c652b43ae5 100644
--- a/support/dktools/man/man1/printqdi.1
+++ b/support/dktools/man/man1/printqdi.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: printqdi
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PRINTQDI" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "PRINTQDI" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -156,7 +156,7 @@ Configuration file syntax\&.
Print quota enforcement daemon for LPRng\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/prmonsnmp.1 b/support/dktools/man/man1/prmonsnmp.1
index cb3b40a3f5..01e407799f 100644
--- a/support/dktools/man/man1/prmonsnmp.1
+++ b/support/dktools/man/man1/prmonsnmp.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: prmonsnmp
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PRMONSNMP" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "PRMONSNMP" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -196,7 +196,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/rshdown-init.1 b/support/dktools/man/man1/rshdown-init.1
new file mode 100644
index 0000000000..059d0a7753
--- /dev/null
+++ b/support/dktools/man/man1/rshdown-init.1
@@ -0,0 +1,107 @@
+'\" t
+.\" Title: rshdown-init
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
+.\" Manual: \ \&
+.\" Source: \ \&
+.\" Language: English
+.\"
+.TH "RSHDOWN\-INIT" "1" "03/24/2020" "\ \&" "\ \&"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+rshdown-init \- Prepare secrets file for rshdown
+.SH "SYNOPSIS"
+.sp
+.nf
+rshdown\-init
+.fi
+.SH "DESCRIPTION"
+.sp
+The rshdown\-init script creates a "secret" file in the /etc/rshdown directory if the file is not yet present\&.
+.SH "OPTIONS"
+.sp
+No options are available\&.
+.SH "EXIT STATUS"
+.sp
+The script returns exit status code 0 on success, all other status codes indicate an error\&.
+.SH "FILES"
+.PP
+/etc/rshdown/rshdown\&.conf
+.RS 4
+Configuration file for rshdown
+.RE
+.PP
+/etc/rshdown/secret
+.RS 4
+File to contain shutdown packet data\&.
+.RE
+.SH "AUTHORS"
+.sp
+Dirk Krause
+.SH "COPYRIGHT AND LICENSE"
+.sp
+Copyright (c) 2019, Dirk Krause
+.sp
+All rights reserved\&.
+.sp
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Neither the name of the copyright holder(s) nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
+.RE
+.sp
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
+.SH "SEE ALSO"
+.PP
+http://sourceforge\&.net/p/dktools/wiki/Home/
+.RS 4
+Project homepage\&.
+.RE
diff --git a/support/dktools/man/man1/rshdown.1 b/support/dktools/man/man1/rshdown.1
index 161b8d68f4..c3d06de5ee 100644
--- a/support/dktools/man/man1/rshdown.1
+++ b/support/dktools/man/man1/rshdown.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: rshdown
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "RSHDOWN" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "RSHDOWN" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -396,7 +396,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/wxbmpp.1 b/support/dktools/man/man1/wxbmpp.1
index e0564f1a70..f5e8ac1811 100644
--- a/support/dktools/man/man1/wxbmpp.1
+++ b/support/dktools/man/man1/wxbmpp.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: wxbmpp
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "WXBMPP" "1" "03/28/2017" "\ \&" "\ \&"
+.TH "WXBMPP" "1" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -28,13 +28,15 @@
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
-wxbmpp \- GUI program to convert PNG/JPEG/TIFF to PDF/PS
+wxbmpp \- GUI program to convert PNG/JPEG/NetPBM/TIFF to PDF/PS
.SH "SYNOPSIS"
.sp
\fBwxbmpp\fR
+.sp
+\fBwxbmpp\fR \fB\-l\fR\fIdriver\fR[\fB\&.\fR\fIpurpose\fR] \fIfile\fR
.SH "DESCRIPTION"
.sp
-The program provides a GUI to convert PNG/JPEG/TIFF files to PDF or PS\&. In the program you can:
+The program provides a GUI to convert PNG/JPEG/NetPBM/TIFF files to PDF or PS\&. In the program you can:
.sp
.RS 4
.ie n \{\
@@ -68,18 +70,30 @@ Set conversion options\&.
.\}
Run the conversion\&.
.RE
+.sp
+The program has two modes:
+.PP
+\fBNormal GUI application\fR
+.RS 4
+If the program is invoked without the \-l option and a file name, the user can choose the directory, set the conversion options and start the conversion process using the GUI\&.
+.RE
+.PP
+\fBAutomatically start conversion\fR
+.RS 4
+If the program is invoked with the \-l option and a file name, the conversion is started automatically using the options specified on the command line and in the dk4gra\&.conf file(s)\&. The program automatically exits when the conversion is done\&. This mode is intended for integration into file managers, so a user can mark a file and convert it using a context menu item without further interaction required\&.
+.RE
.SH "EXIT STATUS"
.sp
The program returns exit status code 0 on success, all other status codes indicate an error\&.
.SH "NOTES"
.sp
-This program uses DK libraries version 3\&.
+This program uses DK libraries version 4\&.
.SH "AUTHORS"
.sp
Dirk Krause
.SH "COPYRIGHT AND LICENSE"
.sp
-Copyright (c) 2011\-2016, Dirk Krause
+Copyright (c) 2011\-2018, Dirk Krause
.sp
All rights reserved\&.
.sp
@@ -123,10 +137,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(r
.PP
\fBbmpp(1)\fR
.RS 4
-Command line tool to convert PNG/JPEG/TIFF to PDF/PS\&.
+Command line tool to convert PNG/JPEG/NetPBM/TIFF to PDF/PS\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/wxd2lat.1 b/support/dktools/man/man1/wxd2lat.1
new file mode 100644
index 0000000000..a541646d7f
--- /dev/null
+++ b/support/dktools/man/man1/wxd2lat.1
@@ -0,0 +1,232 @@
+'\" t
+.\" Title: wxd2lat
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
+.\" Manual: \ \&
+.\" Source: \ \&
+.\" Language: English
+.\"
+.TH "WXD2LAT" "1" "03/24/2020" "\ \&" "\ \&"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+wxd2lat \- WXD to LaTeX converter
+.SH "SYNOPSIS"
+.sp
+\fBwxd2lat\fR [\fIoptions\fR] [\fIpath(s)\fR]
+.SH "DESCRIPTION"
+.sp
+The wxd2lat program converts *\&.wxd files produced by wxdkdraw to file formats for use with LaTeX/pdfLaTeX\&.
+.sp
+The program processes the paths specified as command line arguments, if any\&. For each *\&.wxd file it creates an output file or output file pair keeping the base file name and using suffixes \&.pdf, \&.eps and/or \&.tex\&. For paths specifying a directory, the program traverses the directory and runs a conversion for each *\&.wxd file found\&. If no paths are specified on the command line, the program traverses the current directory and runs a conversion for each *\&.wxd file found\&.
+.sp
+The following files or file pairs can be produced:
+.PP
+PDF+TeX
+.RS 4
+A *\&.pdf and a *\&.tex file\&. The PDF file contains the non\-text graphics objects\&. The TeX file includes the PDF file and typesets the text labels on top of it\&.
+.RE
+.PP
+EPS+TeX
+.RS 4
+A *\&.eps and a *\&.tex file\&. The EPS file contains the non\-text graphics objects\&. The TeX file includes the EPS file and typesets the text labels on top of it\&.
+.RE
+.PP
+TeX
+.RS 4
+A *\&.tex file containing graphics instructions for both non\-text graphics objects and text labels\&. The pgfcore package must be used\&.
+.RE
+.SH "OPTIONS"
+.PP
+\fB\-b\fR \fIwidth\fR, \fB\-\-baselinewidth=\fR\fIwidth\fR
+.RS 4
+sets the base line width\&. Default: 1/160 inch\&. Use width specifications like "0\&.4pt", "0\&.45" (same as "0\&.45bp"), "0\&.15mm" or "0\&.00625in"\&.
+.RE
+.PP
+\fB\-d\fR, \fB\-\-document\fR
+.RS 4
+creates a complete standalone LaTeX document\&. By default wxd2lat creates an object for use in a LaTeX document\&. The \-d option can not be used when producing eps output\&.
+.RE
+.PP
+\fB\-l\fR \fIoutputformat\fR, \fB\-\-language=\fR\fIoutputformat\fR
+.RS 4
+chooses the output format, one from:
+.PP
+pdf
+.RS 4
+(create PDF+TeX file pair),
+.RE
+.PP
+eps
+.RS 4
+(create EPS+TeX file pair), or
+.RE
+.PP
+tex
+.RS 4
+(create TeX file containing pgfcore graphics instructions)\&.
+.sp
+For detailed configuration you can add key=value pairs separated by comma\&.
+.RE
+.RE
+.PP
+\fB\-m\fR, \fB\-\-make\fR
+.RS 4
+avoids unnecessary conversions\&. Before running a conversion the program checks whether output file(s) are present and up to date\&.
+.RE
+.PP
+\fB\-p\fR \fIwidth\fR, \fB\-\-pattern\-linewidth=\fR\fIwidth\fR
+.RS 4
+sets the line width for fill patterns\&. Default: 1/160 inch\&.
+.RE
+.PP
+\fB\-R\fR, \fB\-\-reset\fR
+.RS 4
+suppresses use of dk4gra\&.conf configuration files\&.
+.RE
+.PP
+\fB\-w\fR, \fB\-\-white\-background\fR
+.RS 4
+fills background using white colour\&. By default there is no background filling, so drawing regions not covered by graphics elements are transparent\&.
+.RE
+.SH "KEY=VALUE PAIRS"
+.sp
+The key=value pairs allow detailed settings\&. For boolean type keys the value is not required\&. Simply mentioning the key activates the option\&. For example "\-leps,level=2,lzw" is equal to "\-leps,level=2,lzw=on"\&. For booleans you can use "on", "true" or "yes" to activate an option\&. Use "off", "false" or "no" to deactivate a boolean option\&.
+.sp
+The following keys can be used:
+.PP
+\fBlevel=\fR\fIinteger\fR
+.RS 4
+PS language level, 2 or 3\&. Default: 3\&.
+.RE
+.PP
+\fBdsc=\fR\fIboolean\fR
+.RS 4
+Write DSC comments (document structuring convention) into PS/EPS output\&. Default: off\&.
+.RE
+.PP
+\fBlzw=\fR\fIboolean\fR
+.RS 4
+Allow LZW compression when embedding bitmap image into PS level 2 output\&. Default: off\&.
+.RE
+.PP
+\fBcolor=\fR\fIboolean\fR
+.RS 4
+Allow coloured output\&. Default: on\&. Deactivating this option results in gray output\&.
+.RE
+.PP
+\fBrgb\-to\-gray=\fR\fIstring\fR
+.RS 4
+Choose default method for RGB to gray conversion\&. Default: bt601\&.
+.RE
+.PP
+\fBrgb\-to\-cmyk=\fR\fIstring\fR
+.RS 4
+Choose default method for RGB to CMYK conversion\&. Default: non\-standard\&. The wxd2lat program does not produce CMYK output, there is no plan to add such a feature\&. The option is mentioned here just for completeness as the libdk4gra library supports this option\&.
+.RE
+.PP
+\fBxsss=\fR\fIinteger\fR
+.RS 4
+Number of Bezier segments to draw for each X\-spline segment\&. Default: 8\&. The recommended range is 4 to 16\&.
+.RE
+.PP
+\fBxslp=\fR\fIfloat\fR
+.RS 4
+Tolerance for X\-spline segment length calculation\&. Iteration is finished successfully if the difference between the results of current pass and previous pass are below the specified level\&.
+.RE
+.PP
+\fBxspp=\fR\fIfloat\fR
+.RS 4
+Tolerance in search for the t parameter to produce a given length X\-spline sub segment\&. Iteration is finished successfully if the difference between the results of current pass and previous pass are below the specifiedlevel\&. The xspp value should be at least 4 times the xslp value\&.
+.RE
+.SH "EXIT STATUS"
+.sp
+The program returns exit status code 0 on success, all other status codes indicate an error\&.
+.SH "FILES"
+.sp
+Normally \- without the \-R option \- the program searches for dk4gra\&.conf files after processing the output language\&. The sections matching the output format are processed\&.
+.SH "EXAMPLES"
+.PP
+wxd2lat \-leps test1\&.wxd
+.RS 4
+processes input file test1\&.wxd and produces files test1\&.tex and test1\&.eps\&. In a LaTeX document use "\einput{test1\&.tex}" to use the drawing\&.
+.RE
+.PP
+wxd2lat \-d \-lpdf test1\&.wxd
+.RS 4
+processes input file test1\&.wxd and produces the files test1\&.tex and test1\-i\&.pdf\&. Run the "pdflatex test1" command to produce the final test1\&.pdf file\&.
+.RE
+.SH "AUTHORS"
+.sp
+Dirk Krause
+.SH "COPYRIGHT AND LICENSE"
+.sp
+Copyright (c) 2019, Dirk Krause
+.sp
+All rights reserved\&.
+.sp
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Neither the name of the copyright holder(s) nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
+.RE
+.sp
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
+.SH "SEE ALSO"
+.PP
+dk4gra\&.conf(5)
+.RS 4
+Format of the dk4gra\&.conf configuration file\&.
+.RE
+.PP
+http://sourceforge\&.net/p/dktools/wiki/Home/
+.RS 4
+Project homepage\&.
+.RE
diff --git a/support/dktools/man/man1/wxdkclock.1 b/support/dktools/man/man1/wxdkclock.1
index 271811cb88..68a7babbcf 100644
--- a/support/dktools/man/man1/wxdkclock.1
+++ b/support/dktools/man/man1/wxdkclock.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: wxdkclock
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "WXDKCLOCK" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "WXDKCLOCK" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -88,7 +88,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/wxdkdraw.1 b/support/dktools/man/man1/wxdkdraw.1
new file mode 100644
index 0000000000..6766e5fa63
--- /dev/null
+++ b/support/dktools/man/man1/wxdkdraw.1
@@ -0,0 +1,107 @@
+'\" t
+.\" Title: wxdkdraw
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/14/2020
+.\" Manual: \ \&
+.\" Source: \ \&
+.\" Language: English
+.\"
+.TH "WXDKDRAW" "1" "03/14/2020" "\ \&" "\ \&"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+wxdkdraw \- Draw for LaTeX
+.SH "SYNOPSIS"
+.sp
+\fBwxdkdraw\fR [\fIfile\fR]
+.SH "DESCRIPTION"
+.sp
+Wxdkdraw is a minimalistic drawing program for use with LaTeX\&. Use wxd2lat to convert *\&.wxd drawing files to formats usable with (pdf)LaTeX\&.
+.sp
+Drawings can contain polylines, polygons, rectangular boxes, circles, ellipses, arcs, splines, dots, pins, text labels, and embedded bitmap images\&. Existing wxdkdraw drawings can be used as library elements in new drawings\&.
+.sp
+Two types of text labels are available:
+.PP
+Normal text
+.RS 4
+When producing LaTeX output special characters (i\&.e\&. german umlauts) are replaced by appropriate LaTeX commands\&. When producing a LaTeX document the font is used as configured on the text label\&. When producing a LaTeX object for use in a LaTeX document a font with similar features (roman/sans\-serif/typewriter, normal/bold, upright/italic) is used\&.
+.RE
+.PP
+LaTeX text
+.RS 4
+No information about font or text size is written to output\&. The label text is written "\(oqas is"\(cq, no modification is applied\&.
+.RE
+.sp
+Wxdkdraw can be used for all drawing types placing graphic objects on a grid\&.
+.SH "EXIT STATUS"
+.sp
+The program returns exit status code 0 on success, all other status codes indicate an error\&.
+.SH "AUTHORS"
+.sp
+Dirk Krause
+.SH "COPYRIGHT AND LICENSE"
+.sp
+Copyright (c) 2020, Dirk Krause
+.sp
+All rights reserved\&.
+.sp
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Neither the name of the copyright holder(s) nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
+.RE
+.sp
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
+.SH "SEE ALSO"
+.PP
+http://sourceforge\&.net/p/dktools/wiki/Home/
+.RS 4
+Project homepage\&.
+.RE
diff --git a/support/dktools/man/man1/wxdkfcs.1 b/support/dktools/man/man1/wxdkfcs.1
index baaafb203d..ec55599ca6 100644
--- a/support/dktools/man/man1/wxdkfcs.1
+++ b/support/dktools/man/man1/wxdkfcs.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: wxdkfcs
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 01/03/2016
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "WXDKFCS" "1" "01/03/2016" "\ \&" "\ \&"
+.TH "WXDKFCS" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -85,7 +85,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/wxdkhtb.1 b/support/dktools/man/man1/wxdkhtb.1
index c2050c147b..6243570bf1 100644
--- a/support/dktools/man/man1/wxdkhtb.1
+++ b/support/dktools/man/man1/wxdkhtb.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: wxdkhtb
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "WXDKHTB" "1" "02/08/2017" "\ \&" "\ \&"
+.TH "WXDKHTB" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -88,7 +88,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/wximgsz.1 b/support/dktools/man/man1/wximgsz.1
index 2008247bb3..b72956894e 100644
--- a/support/dktools/man/man1/wximgsz.1
+++ b/support/dktools/man/man1/wximgsz.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: wximgsz
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "WXIMGSZ" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "WXIMGSZ" "1" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -148,7 +148,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man1/wxpqdic.1 b/support/dktools/man/man1/wxpqdic.1
index b2e8d0cd76..1a7c7d24fe 100644
--- a/support/dktools/man/man1/wxpqdic.1
+++ b/support/dktools/man/man1/wxpqdic.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: wxpqdic
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "WXPQDIC" "1" "09/03/2016" "\ \&" "\ \&"
+.TH "WXPQDIC" "1" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -148,7 +148,7 @@ Neither the name of the copyright holder(s) nor the names of contributors may be
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
.SH "SEE ALSO"
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man5/dk3paper.conf.5 b/support/dktools/man/man5/dk3paper.conf.5
new file mode 100644
index 0000000000..b8c9b57c53
--- /dev/null
+++ b/support/dktools/man/man5/dk3paper.conf.5
@@ -0,0 +1,754 @@
+'\" t
+.\" Title: dk3paper.conf
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
+.\" Manual: \ \&
+.\" Source: \ \&
+.\" Language: English
+.\"
+.TH "DK3PAPER\&.CONF" "5" "11/06/2019" "\ \&" "\ \&"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+dk3paper.conf \- Paper size configuration for DK tools and libraries
+.SH "DESCRIPTION"
+.sp
+The dk3paper\&.conf file configures paper sizes for use with programs from the DK tools and libraries project\&.
+.SH "SYNTAX"
+.sp
+The file is processed line by line\&. Line size must not exceed 1023 characters\&.
+.sp
+A raute symbol (#) as first non\-whitespace in a line indicates a comment line\&. Comment lines are ignored\&.
+.sp
+Empty lines are ignored\&.
+.sp
+A paper size definition consists of:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+The paper size name,
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+an equal sign (=),
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+2 or 6 floating point numbers indicating the dimensions of the paper\&.
+.RE
+.sp
+The paper size name is a text string without whitespaces\&. The following characters must not be used in the paper size name: \fI=\fR, \fI,\fR, \fI\&.\fR, \fI:\fR, \fI;\fR, \fI#\fR\&.
+.sp
+It is recommended to use characters \fIa\fR\&...\fIz\fR, \fIA\fR\&...\fIZ\fR and digits \fI0\fR\&...\fI9\fR in paper size names only\&.
+.sp
+If the line contains 2 values, the values are paper width in PS points and paper height\&.
+.sp
+If the line contains 6 values, the values are:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+paper width,
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+paper height,
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+left border,
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+right border,
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+top border,
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+bottom border\&.
+.RE
+.sp
+When preparing print jobs for duplex printing without tumble (use both front side and back side of the paper sheet, binding on the left side like a book) the left and right border should be swapped for even pages\&.
+.sp
+When preparing print jobs for duplex printing with tumble (use both front side and back side of the paper sheet, binding on the top side like a calendar) the top and bottom border should be swapped for even pages\&.
+.SH "FILE LOCATION"
+.sp
+Programs using the libraries from the "DK tools and libraries" project have an application name and an application group name assigned\&. The application name is typically the program name (without the \&.exe file name suffix on Windows)\&. For programs from the "DK tools and libraries" project the application group name is "dktools"\&. In the examples below you see that the program name and the group name are used in the directory names\&.
+.sp
+For programs using version 3 libraries (i\&.e\&. fig2lat) the search order is as follows:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk3app/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk3app/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk3app\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk3app\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dktools/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dktools/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dktools\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dktools\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/fig2lat/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/fig2lat/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/fig2lat\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/fig2lat\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk3app/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk3app/dktools/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk3app/fig2lat/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\&./dk3paper\&.conf (in the current directory)
+.RE
+.sp
+For prgrams using version 4 libraries (i\&.e\&. bmpp) the search order is as follows:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk4app/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk4app/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk4app/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk4app/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk4app\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dk4app\-site/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk4app\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dk4app\-site/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dktools/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dktools/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dktools/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dktools/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dktools\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/dktools\-site/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dktools\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/dktools\-site/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/bmpp/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/bmpp/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/bmpp/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/bmpp/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/bmpp\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${datadir}/bmpp\-site/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/bmpp\-site/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${sysconfdir}/bmpp\-site/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/dktools/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/dktools/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/bmpp/dk3paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+${HOME}/\&.dk4app/bmpp/dk4paper\&.conf
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\&./dk3paper\&.conf (in the current directory)
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\&./dk4paper\&.conf (in the current directory)
+.RE
+.sp
+${datadir} is typically /usr/share or /usr/local/share on Unix/Linux, C:\eProgram Files\eKrause\eshare on Windows\&.
+.sp
+${sysconfdir} is the system configuration directory, typically /etc or /usr/local/etc on Unix/Linux, C:\eProgram Files\eKrause\eetc on Windows\&.
+.sp
+When install DK tools and libraries into a shared directory on a file server, placing configuration files in the subdirectories of ${datadir} makes the configuration available to all the file servers clients without visiting each client individually\&.
+.sp
+Placing configuration files in subdirectories of ${sysconfdir} makes the configuration available to all users of the current system\&.
+.sp
+Configuration files in subdirectories of ${HOME} are for the current user only\&.
+.sp
+The subdirectory choice decides, whether the configuration file is used by all applications, applications from a specified group only or only by a specific application\&.
+.sp
+In ${sysconfdir} and ${datadir} place your customized configuration files only in directories with names ending in "\-site"\&. Create the directories if necessary\&. Subdirectories without "\-site" in the name are under the package managements control\&. Files in these subdirectories may be modified or deleted without notice during package deinstallations or package upgrades\&.
+.SH "AUTHORS"
+.sp
+Dirk Krause
+.SH "COPYRIGHT AND LICENSE"
+.sp
+Copyright (c) 2018, Dirk Krause
+.sp
+All rights reserved\&.
+.sp
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Neither the name of the copyright holder(s) nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
+.RE
+.sp
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
+.SH "SEE ALSO"
+.PP
+http://sourceforge\&.net/p/dktools/wiki/Home/
+.RS 4
+Project homepage\&.
+.RE
diff --git a/support/dktools/man/man5/dk4gra.conf.5 b/support/dktools/man/man5/dk4gra.conf.5
new file mode 100644
index 0000000000..5e7000b26d
--- /dev/null
+++ b/support/dktools/man/man5/dk4gra.conf.5
@@ -0,0 +1,647 @@
+'\" t
+.\" Title: dk4gra.conf
+.\" Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
+.\" Manual: \ \&
+.\" Source: \ \&
+.\" Language: English
+.\"
+.TH "DK4GRA\&.CONF" "5" "03/24/2020" "\ \&" "\ \&"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+dk4gra.conf \- Graphics output configuration
+.SH "DESCRIPTION"
+.sp
+The dk4gra\&.conf file configures graphics output created by some of the DK libraries (libdk4gra and others)\&.
+.sp
+When talking about bitmap images in the text below, this also includes graymap and colored images too\&.
+.SH "SYNTAX"
+.sp
+The file consists of sections\&. Each section consists of a scope and a list of key=value lines\&.
+.sp
+Scopes have a driver name ("pdf", "ps", "eps", "bb"), or a mode name ("object", "image", "document"), or a driver\&.mode name (i\&.e\&. "ps\&.document") in square brackets\&. Key=value lines in a "[ps]" scope apply to EPS output as well\&. The special scope "[*]" is active for all drivers and modes\&.
+.sp
+The key=value lines following a scope are only processed if the driver and/or mode matches\&.
+.sp
+The following keys can be used:
+.PP
+\fBlevel\fR=\fIinteger\fR
+.RS 4
+PS language level when producing PS output, either 2 or 3\&. Default: 3\&.
+.RE
+.PP
+\fBlzw\fR=\fIboolean\fR
+.RS 4
+Enable LZW compression for embedded bitmap images when producing PS level 2 output\&. Default: off\&.
+.RE
+.PP
+\fBdsc\fR=\fIboolean\fR
+.RS 4
+Write document structuring comments when producing PS output\&. Default: off\&.
+.RE
+.PP
+\fBpaper size\fR=\fIstring\fR
+.RS 4
+Paper size used when producing documents\&. Default: a4\&.
+.RE
+.PP
+\fBduplex\fR=\fIboolean\fR
+.RS 4
+Use duplex printing (create a book) when producing documents\&. Default: on\&.
+.RE
+.PP
+\fBtumble\fR=\fIboolean\fR
+.RS 4
+Use duplex and tumble printing (create a calendar) when producing documents\&. Default: off\&.
+.RE
+.PP
+\fBcolor\fR=\fIboolean\fR
+.RS 4
+Allow to create colored output\&. Default: on\&. If this options is off, output is forced to be grayscaled\&.
+.RE
+.PP
+\fBrgb to gray\fR=\fIstring\fR
+.RS 4
+Method for RGB to gray conversion, one from: "bt601" (default), "luminance", "fast", "fastest", "bt709", "average", "desaturation", "min", "medium", "max", "red", "green", "blue"\&. See the section about RGB to gray and CMYK conversions below\&.
+.RE
+.PP
+\fBrgb to cmyk\fR=\fIstring\fR
+.RS 4
+Method for RGB to CMYK conversion, one from "non\-standard" (default) or "standard"\&. Currently no program is using this setting\&. See the section about RGB to gray and CMYK conversions below\&.
+.RE
+.PP
+\fBuse alpha channel\fR=\fImethod\fR
+.RS 4
+Method to handle an alpha channel in input data, one from "mix" (mix foreground color against background color using the opacity data from alpha channel) or "foreground" (simply use the foreground color, ignore background and alpha data)\&. Default: mix\&.
+.RE
+.PP
+\fBimage background\fR=\fIinteger\fR:\fIinteger\fR:\fIinteger\fR[:\fIboolean\fR]
+.RS 4
+Default background for embedded bitmap image, RGB in range 0\&...255\&. Default: 255,255,255\&. An optional force flag can be specified to use the background color even if the input file specifies a background color\&.
+.RE
+.PP
+\fBforce image background\fR=\fIboolean\fR
+.RS 4
+The force flag for the background of embedded bitmap images can be specified separately\&. Default: off\&.
+.RE
+.PP
+\fBimage interpolation\fR=\fIboolean\fR
+.RS 4
+Set interpolation flag for embedded bitmap images in output\&. Default: on\&. The interpolation flag allows PDF/PS renderers to optimize the representation of images\&.
+.RE
+.PP
+\fBuse dct encoded data\fR=\fIboolean\fR
+.RS 4
+Allow the direct re\-use of DCT encoded data from JPEG files when embedding bitmap images\&. Default: on\&. Direct re\-use of DCT encoded data both saves processing time and creates smaller output files\&.
+.RE
+.PP
+\fBdct image interpolation\fR=\fIboolean\fR
+.RS 4
+Set interpolation flag also when directly re\-using DCT encoded data from JPEG files\&. Default: off\&.
+.RE
+.PP
+\fBanalyze bits per component\fR=\fIboolean\fR
+.RS 4
+Analyze bits per component for embedded bitmap images\&. Default: on\&. If the number of bits per component can be reduced without quality loss, do so\&.
+.RE
+.PP
+\fBanalyze colors\fR=\fIboolean\fR
+.RS 4
+Analyze use of colors for embedded bitmap images\&. Default: on\&. Produce grayscaled output if R=G=B or C=M=Y for all pixels\&.
+.RE
+.PP
+\fBanalyze alpha\fR=\fIboolean\fR
+.RS 4
+Analyze use of alpha channel data for embedded bitmap images\&. Default: on\&. Do not produce an SMask for PDF object output if all pixels have full opacity\&.
+.RE
+.PP
+\fBresolution\fR=\fIresolution\fR
+.RS 4
+Resolution information\&. Default: Use resolution information from file if present, 1px1pt otherwise\&. The following resolution values can be used:
+.PP
+1px1pt
+.RS 4
+A 1 PS point square is used for each pixel (72 dpi)\&.
+.RE
+.PP
+chunk
+.RS 4
+Use resolution information found in input image file\&.
+.RE
+.PP
+\fInumber\fR
+.RS 4
+Number of DPI for both coordinates\&.
+.RE
+.PP
+\fInumber\fR:\fInumber\fR
+.RS 4
+Separated resolution for x and y direction\&.
+.RE
+.RE
+.PP
+\fBignore resolution\fR=\fIboolean\fR
+.RS 4
+Ignore resolution data found in input image file\&. Default: off\&.
+.RE
+.PP
+\fBignore aspect ratio\fR=\fIboolean\fR
+.RS 4
+When embedding a bitmap image while producing a document, ignore the images aspect ratio and fill the available space on paper completely\&. Default: off\&.
+.RE
+.PP
+\fBallow rotate\fR=\fIboolean\fR
+.RS 4
+Allow rotation of embedded bitmap images to fill the available space on paper optimally when producing a document\&. Default: off\&.
+.RE
+.PP
+\fBx\-spline sub segments\fR=\fIunsigned\-integer\fR
+.RS 4
+Number of Bezier segments to draw for each X\-spline segment\&. Default: 8\&. Recommended range: 4 to 16\&.
+.RE
+.PP
+\fBx\-spline length precision\fR=\fIfloat\fR
+.RS 4
+Tolerance for X\-spline segment length calculation\&. Iteration is finished successfully if the result difference of current pass and previous pass is below the given value\&.
+.RE
+.PP
+\fBx\-spline parameter precision\fR=\fIfloat\fR
+.RS 4
+Tolerance for X\-spline parameter calculation\&. When calculating a
+\fIt\fR
+parameter for a given spline length the iteration is finished successfully if the result difference of current pass and previous pass is below the given value\&. The "x\-spline parameter precision" value should be at least 4 times the "x\-spline length precision" value\&.
+.RE
+.SH "RESOLUTION AND IMAGE SIZE OF EMBEDDED BITMAP IMAGES"
+.sp
+If the bitmap image file contains a resolution chunk the image width and height (number of pixels) and the resolution data is used to calculate the images real size\&. A user defined resolution can be specified instead (2 values to specify different resolutions for x and y direction)\&. A user also might decide to ignore image resolution from input file\&.
+.sp
+If the bitmap image file does not contain resolution information, 72 dpi is used, each pixel is represented by a 1 PS point square\&.
+.sp
+When placing a bitmap image on a specified range on a page, you can either keep the aspect ratio or ignore the aspect ratio\&. Ignoring the aspect ratio means to fill the specified range completely accepting distorsions by different scale factors for x and y direction\&.
+.sp
+When keeping the aspect ratio, image rotation may be useful sometimes\&. I\&.e\&. if the image width is larger than image height, put range height is larger than range width\&. The \fBrotate\fR option allows such rotations\&.
+.SH "ALPHA CHANNEL"
+.sp
+For embedded images an alpha channel found in the image is transferred to an SMask when producing PDF output\&. For all other drivers we have to decide what to do with alpha channel data\&.
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+We can use it to mix the foreground data found as pixel data against a background color (either found in the input file or specified explicitly)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+We can ignore the alpha data and simply use the foreground data\&.
+.RE
+.SH "RGB TO GRAY AND RGB TO CMYK CONVERSIONS"
+.sp
+In the formulas below we use the following variables:
+.PP
+MAX
+.RS 4
+Maximum integer value for a specified bit depth (i\&.e\&. 15 for a bit depth of 4, 255 for a bit depth of 8)\&.
+.RE
+.PP
+R
+.RS 4
+Red color component as integer 0\&...\fIMAX\fR\&.
+.RE
+.PP
+G
+.RS 4
+Green color component as integer 0\&...\fIMAX\fR\&.
+.RE
+.PP
+B
+.RS 4
+Blue color component as integer 0\&...\fIMAX\fR\&.
+.RE
+.PP
+MAXRGB
+.RS 4
+The maximum value of R, G, B\&.
+.RE
+.PP
+E
+.RS 4
+Gray value as integer 0\&...\fIMAX\fR\&.
+.RE
+.PP
+C
+.RS 4
+Cyan color component as integer 0\&...\fIMAX\fR\&.
+.RE
+.PP
+M
+.RS 4
+Magenta color component as integer 0\&...\fIMAX\fR\&.
+.RE
+.PP
+Y
+.RS 4
+Yellow color component as integer 0\&...\fIMAX\fR\&.
+.RE
+.PP
+K
+.RS 4
+Key (black) color component as integer 0\&...\fIMAX\fR\&.
+.RE
+.PP
+r
+.RS 4
+Normalized red color component as floating point value in range 0\&...1\&.
+.RE
+.PP
+g
+.RS 4
+Normalized green color component as floating point value in range 0\&...1\&.
+.RE
+.PP
+b
+.RS 4
+Normalized blue color component as floating point value in range 0\&...1\&.
+.RE
+.PP
+maxrgb
+.RS 4
+The maximum value of r, g, b\&.
+.RE
+.PP
+e
+.RS 4
+Normalized gray value as floating point value in range 0\&...1\&.
+.RE
+.PP
+c
+.RS 4
+Normalized cyan color component as floating point value in range 0\&...1\&.
+.RE
+.PP
+m
+.RS 4
+Normalized magenta color component as floating point value in range 0\&...1\&.
+.RE
+.PP
+y
+.RS 4
+Normalized yellow color component as floating point value in range 0\&...1\&.
+.RE
+.PP
+k
+.RS 4
+Normalized key (black) color component as floating point value in range 0\&...1\&.
+.RE
+.sp
+The following methods are available to convert from RGB to gray:
+.PP
+\fBbt601\fR
+.RS 4
+Reproduce luminance:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (299 * R + 587 * G + 114 * B) / 1000
+e = 0\&.299 * r + 0\&.587 * g + 0\&.114 * b
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBluminance\fR
+.RS 4
+Same as above, reduced number of digits:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (30 * R + 59 * G + 11 * B) / 100
+e = 0\&.3 * r + 0\&.59 * g + 0\&.11 * b
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBfast\fR
+.RS 4
+Faster approximation for integer values (bt601 used for floating point values):
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (77 * R + 151 * G + 28 * B) >> 8
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBfastest\fR
+.RS 4
+Still faster and less accurate for integer values (bt601 used for floating point values):
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = ((R << 1) + ((G << 2) + G) + B) >> 3
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBbt709\fR
+.RS 4
+Reproduce luminance, other coefficients:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (2126 * R + 7152 * G + 722 * B) / 1000
+e = 0\&.2126 * r + 0\&.7152 * g + 0\&.0722 * b
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBaverage\fR
+.RS 4
+Average of red, green and blue component:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (R + G + B) / 3
+e = (r + g + b) / 3\&.0
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBdesaturation\fR
+.RS 4
+Flatter than luminance, less contrast\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = (max{R,G,B} + min{R,G,B}) / 2
+e = (max{R,G,B} + min{r,g,b}) / 2\&.0
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBmin\fR
+.RS 4
+Minimum decomposition:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = min{R,G,B}
+e = min{r,g,b}
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBmedian\fR
+.RS 4
+Medium decomposition:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = median{R,G,B}
+e = median{r,g,b}
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBmax\fR
+.RS 4
+Maximum decomposition:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = max{R,G,B}
+e = max{r,g,b}
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBred\fR
+.RS 4
+Just use the red channel:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = R
+e = r
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBgreen\fR
+.RS 4
+Just use the green channel:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = G
+e = g
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBblue\fR
+.RS 4
+Just use the blue channel:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+E = B
+e = b
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.sp
+The following methods are available to convert from RGB to CMYK:
+.PP
+\fBnon\-standard\fR
+.RS 4
+An algorithm found in several places in the internet differing from the algorithm specified in the PDF/PS standards:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+MAXRGB = max{R,G,B}
+if 0 = MAXRGB
+then
+ K = MAX
+ C = M = Y = 0
+else
+ C = (MAX * (MAXRGB \- R)) / MAXRGB
+ M = (MAX * (MAXRGB \- G)) / MAXRGB
+ Y = (MAX * (MAXRGB \- B)) / MAXRGB
+ K = MAX \- MAXRGB
+endif
+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+maxrgb = max{r,g,b}
+if 0 = maxrgb
+then
+ k = 1
+ c = m = y = 0
+else
+ c = (maxrgb \- r) / maxrgb
+ m = (maxrgb \- g) / maxrgb
+ y = (maxrgb \- b) / maxrgb
+ k = 1 \- maxrgb
+endif
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\fBstandard\fR
+.RS 4
+Algorithm as specified in the PDF/PS standard, simplyfied by removing black generation and undercolor removal:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+MAXRGB = MAX{R,G,B}
+C = MAXRGB \- R
+M = MAXRGB \- G
+Y = MAXRGB \- B
+K = MAX \- MAXRGB
+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+maxrgb = max{r,g,b}
+c = maxrgb \- r
+m = maxrgb \- g
+y = maxrgb \- b
+k = 1 \- maxrgb
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.SH "AUTHORS"
+.sp
+Dirk Krause
+.SH "COPYRIGHT AND LICENSE"
+.sp
+Copyright (c) 2018, Dirk Krause
+.sp
+All rights reserved\&.
+.sp
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Neither the name of the copyright holder(s) nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
+.RE
+.sp
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(rq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
+.SH "SEE ALSO"
+.PP
+http://sourceforge\&.net/p/dktools/wiki/Home/
+.RS 4
+Project homepage\&.
+.RE
diff --git a/support/dktools/man/man5/dkct-wxgui.5 b/support/dktools/man/man5/dkct-wxgui.5
index 0012410cd3..bad2e30918 100644
--- a/support/dktools/man/man5/dkct-wxgui.5
+++ b/support/dktools/man/man5/dkct-wxgui.5
@@ -1,13 +1,13 @@
'\" t
.\" Title: dkct-wxgui
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DKCT\-WXGUI" "5" "03/28/2017" "\ \&" "\ \&"
+.TH "DKCT\-WXGUI" "5" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -89,7 +89,7 @@ Source file code to be placed after the class constructor\&.
The options section is used for general setup as described in dkct(5)\&.
.sp
Code from header start, class start, class end and header end sections is copied into the *\&.h output file, code from module start, constructor start, constructor end and module end sections is copied to the *\&.cpp output file\&. These sections may contain special instructions as described for the %%module section of *\&.ctr, *\&.cpt and *\&.mtr files in dkct(5)\&.
-.SH "THE WX-GUI SECTION"
+.SH "THE WX\-GUI SECTION"
.SS "General syntax"
.sp
The section is a list of paragraphs\&. Each paragraph describes either the top window or one of the GUI components\&.
@@ -1428,7 +1428,7 @@ bitmap disabled, bitmap button style, toolbar button style, border
.PP
Optional
.RS 4
-id, text, size, minumum size, tip
+id, text, size, minimum size, tip
.RE
.RE
.SS "Pseudo objects"
@@ -1504,7 +1504,7 @@ The dkct program (Dirk Krause\(cqs C tool)\&.
Input file syntax for dkct (*\&.ctr, *\&.cpt and *\&.mtr files)\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man5/dkct.5 b/support/dktools/man/man5/dkct.5
index 2b9b363b39..c2fe00ddfe 100644
--- a/support/dktools/man/man5/dkct.5
+++ b/support/dktools/man/man5/dkct.5
@@ -1,13 +1,13 @@
'\" t
.\" Title: dkct
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DKCT" "5" "02/08/2017" "\ \&" "\ \&"
+.TH "DKCT" "5" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -165,12 +165,14 @@ is used to build a box comment (one marker at the start, one at the end)\&.
.PP
\fB$!trace\-command\fR \fIcode\fR
.RS 4
-places the code in the output only when producing debug code\&. You can abbreviate this to "\fB$!!\fR\fIcode\fR"\&. NOTE: To protect larger code sections \- i\&.e\&. entire functions \- use the TRACE_DEBUG preprocessor constant\&. It is defined to 1 when producing debug code, undefined otherwise\&.
+places the code in the output only when producing debug code\&. You can abbreviate this to "\fB$!!\fR
+\fIcode\fR"\&. NOTE: To protect larger code sections \- i\&.e\&. entire functions \- use the TRACE_DEBUG preprocessor constant\&. It is defined to 1 when producing debug code, undefined otherwise\&.
.RE
.PP
\fB$!pipe\fR \fIcommand\fR
.RS 4
-The specified command is executed by dkct, output from the command is written into the source code\&. You can abbreviate this to "\fB$!|\fR\fIcommand\fR"\&.
+The specified command is executed by dkct, output from the command is written into the source code\&. You can abbreviate this to "\fB$!|\fR
+\fIcommand\fR"\&.
.RE
.PP
\fB$!string\-table\fR \fIarguments\fR
@@ -195,6 +197,26 @@ Macro to use for each string, i\&.e\&. "dkT" to have dkChar strings like dkT("my
.RE
.RE
.PP
+\fB$!string\-table\-file\fR \fIarguments\fR
+.RS 4
+reads a string table file and procudes a string array\&. The following arguments can be used, separated by comma:
+.PP
+\fBfile=\fR\fIfilename\fR
+.RS 4
+Input string table file name, required\&. An alternative form is to specify just the filename without file= as first argument\&.
+.RE
+.PP
+\fBprefix=\fR\fIprefix\fR
+.RS 4
+Prefix to write before each string, i\&.e\&. \*(AqL\*(Aq to have wide character string L"my text"\&. Optional\&.
+.RE
+.PP
+\fBmacro=\fR\fIname\fR
+.RS 4
+Macro to use for each string, i\&.e\&. "dkT" to have dkChar strings like dkT("my text")\&. Optional\&. Prefix and macro are mutually exclusive\&.
+.RE
+.RE
+.PP
\fB$!text\fR \fIarguments\fR
.RS 4
produces a string array and optionally an output text file\&. For text lines started by a raute character you can choose whether to convert them to strings or to use them as preprocessor instructions\&. The following arguments can be used, separated by comma:
@@ -219,6 +241,38 @@ Macro to use for each string, i\&.e\&. "dkT" to have dkChar strings like dkT("my
.RS 4
Lines started by raute are preprocessor instructions\&. The default (without this argument) is to convert them to strings too\&.
.RE
+.PP
+\fB$!string\fR \fIarguments\fR
+.RS 4
+produces one large string\&. For text lines started by a raute character you can choose whether to convert them to strings or to use them as preprocessor instructions\&. The following arguments can be used, separated by comma:
+.PP
+\fBnewlines\fR
+.RS 4
+Add newline at each line end\&.
+.RE
+.PP
+\fBprefix=\fR\fIprefix\fR
+.RS 4
+Prefix to write before each string, i\&.e\&. \*(AqL\*(Aq to have wide character string L"my text"\&. Optional\&.
+.RE
+.PP
+\fBmacro=\fR\fIname\fR
+.RS 4
+Macro to use for each string, i\&.e\&. "dkT" to have dkChar strings like dkT("my text")\&. Optional\&. Prefix and macro are mutually exclusive\&.
+.RE
+.PP
+\fBpreprocessor\fR
+.RS 4
+Lines started by raute are preprocessor instructions\&. The default (without this argument) is to convert them to strings too\&.
+.RE
+.RE
+.PP
+\fB$!binary\-file\fR \fIfilename\fR
+.RS 4
+inserts the file contents converted from binary data to hexadecimal unsigned char literals\&.
+.sp
+Relative file names are used relative to the dkct processes working directory\&.
+.RE
.SS "State machine section"
.sp
A state machine consists of
@@ -331,6 +385,11 @@ Start text in generated function names, a setting "xyz" here results in function
.RS 4
Enable/disable writing of a header file "xyz\&.h"\&.
.RE
+.PP
+\fBuse defines =\fR \fIboolean\fR
+.RS 4
+Use #define instructions instead of enums to assign numbers to state names, input names and output names\&.
+.RE
.SH "EXAMPLE"
.sp
The examle program reads input line by line and inspects each line whether or not it is a valid identifier in the C programming language\&. Each input character is classified whether it is a character, digit, underscore or anything else\&. This information is passed to a state machine\&. Finally an end marker is passed to the state machine\&. If this step returns output code O_OK, the string was a valid C identifier\&.
@@ -629,7 +688,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \(lqAS IS\(r
The dkct program (Dirk Krause\(cqs C tool)\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man5/htmlbook-project.5 b/support/dktools/man/man5/htmlbook-project.5
index 0e1a379fbc..93fe68767e 100644
--- a/support/dktools/man/man5/htmlbook-project.5
+++ b/support/dktools/man/man5/htmlbook-project.5
@@ -1,13 +1,13 @@
'\" t
.\" Title: htmlbook-project
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 01/03/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 07/15/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "HTMLBOOK\-PROJECT" "5" "01/03/2016" "\ \&" "\ \&"
+.TH "HTMLBOOK\-PROJECT" "5" "07/15/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -83,11 +83,31 @@ URL to access the document collection via web\&.
Name of file containing text for start page\&.
.RE
.PP
+\fBmark external links\fR
+.RS 4
+Boolean, mark external hyperlinks (linkt to targets outside the book) by prepending a special symbol to the hyperlink title (tool tip text shown when moving the mouse over the link text)\&. Default: on\&.
+.RE
+.PP
+\fBexternal link marker symbol\fR
+.RS 4
+Hexadecimal number 0\&...FFFFFF, Unicode position of the symbol to prepend to external hyperlink titles\&. Default: 1F310 (globe with meridians)\&.
+.RE
+.PP
+\fBhtml doctype\fR
+.RS 4
+HTML version to choose the DOCTYPE line\&. One from: \(lqnone\(rq (do not write a DOCTYPE line), \(lqhtml\-5\(rq, \(lqhtml\-4\&.01\-strict\(rq, \(lqhtml\-4\&.01\-transitional\(rq, \(lqhtml\-4\&.01\-frameset\(rq, \(lqxhtml\-1\&.0\-strict\(rq, \(lqxhtml\-1\&.0\-transitional\(rq, \(lqxhtml\-1\&.0\-frameset\(rq or \(lqxhtml\-1\&.1\(rq\&. If the html doctype is not set, the most recent HTML version is assumed\&.
+.RE
+.PP
\fBhtml charset\fR
.RS 4
Character set for output HTML files ("us\-ascii", "ascii", or "utf\-8")\&.
.RE
.PP
+\fBhtml lang\fR
+.RS 4
+Language code consisting of two lowercase characters, used for HTML 5 in the lang attribute of the html tag\&.
+.RE
+.PP
\fBtemplate\fR
.RS 4
Name of default template file ("web\&.hbt")\&.
@@ -103,6 +123,16 @@ Name of default style file ("style\&.css")\&.
Flag: Create an intra\-page table of contents\&.
.RE
.PP
+\fBfold page toc\fR
+.RS 4
+Flag: Make the intra\-page table of contents foldable\&. Requires "page toc js file", see below\&.
+.RE
+.PP
+\fBpage toc js file\fR
+.RS 4
+File name of JavaScript file containing code to fold and unfold the intra\-page TOC\&. The file is included using the "async" flag, so it must an event handler for the DOMContentLoaded event\&. In the event handler it adds a checkbox and a label to the "hb_ptoc_form" form and an event handler for checkbox changes\&.
+.RE
+.PP
\fBcreate toc\fR
.RS 4
Flag: Create table of contents\&.
@@ -118,6 +148,11 @@ Flag: Create keyword index\&.
Flag: Write section numbers in index\&.
.RE
.PP
+\fBtable summaries\fR
+.RS 4
+Flag: Create summary=\&... attributes in table tags\&.
+.RE
+.PP
\fBreplace ampersand\fR
.RS 4
Flag: Replace ampersand in texts (no)\&.
@@ -188,6 +223,16 @@ URL to impressum\&.
Name of text file for impressum (you can use either impressum link or impressum page)\&.
.RE
.PP
+\fBprivacy link\fR
+.RS 4
+URL to privacy statement\&.
+.RE
+.PP
+\fBprivacy page\fR
+.RS 4
+Name of text file for privacy statement (you can use either privacy link or privacy page)\&.
+.RE
+.PP
\fBchm\fR
.RS 4
Flag: Create HTML to produce a CHM file later\&.
@@ -198,11 +243,21 @@ Flag: Create HTML to produce a CHM file later\&.
Language setting for CHM project ("0x409 English (USA)")\&.
.RE
.PP
+\fBsvg wh\fR
+.RS 4
+Flag: Default value for the svgwh option to %%img\&...%% special commands\&.
+.RE
+.PP
\fBjs file\fR
.RS 4
File name of JavaScript file\&.
.RE
.PP
+\fBasync js file\fR
+.RS 4
+File name of JavaScript file, added with "async" option\&.
+.RE
+.PP
\fBinherit js\fR
.RS 4
Flag: Inherit JavaScript files from parents\&.
@@ -313,7 +368,7 @@ Syntax of template files\&.
Syntax of text files\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man5/htmlbook-template.5 b/support/dktools/man/man5/htmlbook-template.5
index 4bdb9da97f..6687375e14 100644
--- a/support/dktools/man/man5/htmlbook-template.5
+++ b/support/dktools/man/man5/htmlbook-template.5
@@ -1,13 +1,13 @@
'\" t
.\" Title: htmlbook-template
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/06/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 11/06/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "HTMLBOOK\-TEMPLATE" "5" "02/06/2017" "\ \&" "\ \&"
+.TH "HTMLBOOK\-TEMPLATE" "5" "11/06/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -499,7 +499,7 @@ Syntax of the project file\&.
Syntax of text files\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man5/htmlbook-text.5 b/support/dktools/man/man5/htmlbook-text.5
index 64767dd17e..177a5618d6 100644
--- a/support/dktools/man/man5/htmlbook-text.5
+++ b/support/dktools/man/man5/htmlbook-text.5
@@ -1,13 +1,13 @@
'\" t
.\" Title: htmlbook-text
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 10/26/2016
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 11/11/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "HTMLBOOK\-TEXT" "5" "10/26/2016" "\ \&" "\ \&"
+.TH "HTMLBOOK\-TEXT" "5" "11/11/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -532,7 +532,7 @@ Syntax of the project file\&.
Syntax of template files\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man5/printqd.conf.5 b/support/dktools/man/man5/printqd.conf.5
index fef95353c9..0fb7a3dd3a 100644
--- a/support/dktools/man/man5/printqd.conf.5
+++ b/support/dktools/man/man5/printqd.conf.5
@@ -1,13 +1,13 @@
'\" t
.\" Title: printqd.conf
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PRINTQD\&.CONF" "5" "03/28/2017" "\ \&" "\ \&"
+.TH "PRINTQD\&.CONF" "5" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -253,7 +253,7 @@ printqd\&.protocol(5)
Communication protocol for printqd\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net/
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man5/printqd.db.5 b/support/dktools/man/man5/printqd.db.5
index 1cb6671667..78529c8586 100644
--- a/support/dktools/man/man5/printqd.db.5
+++ b/support/dktools/man/man5/printqd.db.5
@@ -1,13 +1,13 @@
'\" t
.\" Title: printqd.db
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PRINTQD\&.DB" "5" "03/28/2017" "\ \&" "\ \&"
+.TH "PRINTQD\&.DB" "5" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -118,7 +118,7 @@ printqd\&.protocol(5)
Communication protocol for printqd\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/man/man5/printqd.protocol.5 b/support/dktools/man/man5/printqd.protocol.5
index 6a3abac3e5..7c29864f65 100644
--- a/support/dktools/man/man5/printqd.protocol.5
+++ b/support/dktools/man/man5/printqd.protocol.5
@@ -1,13 +1,13 @@
'\" t
.\" Title: printqd.protocol
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/28/2017
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 03/24/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "PRINTQD\&.PROTOCOL" "5" "03/28/2017" "\ \&" "\ \&"
+.TH "PRINTQD\&.PROTOCOL" "5" "03/24/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -198,7 +198,7 @@ printqd\&.db(5)
Print quota daemon database structure\&.
.RE
.PP
-http://dktools\&.sourceforge\&.net
+http://sourceforge\&.net/p/dktools/wiki/Home/
.RS 4
Project homepage\&.
.RE
diff --git a/support/dktools/md-ls.txt b/support/dktools/md-ls.txt
new file mode 100644
index 0000000000..71cbc811b4
--- /dev/null
+++ b/support/dktools/md-ls.txt
@@ -0,0 +1,143 @@
+2019-11-11 19:00:51 addctrld-manual.md
+2019-11-11 19:00:51 addctrld.md
+2019-11-11 19:00:51 admin-config-paper.md
+2019-11-11 19:00:51 admin-directories.md
+2019-11-11 19:00:51 admin-filesearch.md
+2019-11-11 19:00:51 admin-preferences.md
+2019-11-11 19:00:51 bmpp-manual.md
+2019-11-11 19:00:51 bmpp.md
+2019-11-11 19:00:51 changescreensize-manual.md
+2019-11-11 19:00:51 changescreensize.md
+2019-11-11 19:00:51 customize-dktoolian-disklessian.md
+2019-11-11 19:00:51 disklessian-building-examples.md
+2019-11-11 19:00:51 disklessian.md
+2019-11-11 19:00:51 dk-bin2c-manual.md
+2019-11-11 19:00:51 dk-bin2c.md
+2019-11-11 19:00:51 dk-bmm-manual.md
+2019-11-11 19:00:51 dk-bmm.md
+2019-11-11 19:00:51 dk-cat-manual.md
+2019-11-11 19:00:51 dk-cat.md
+2019-11-11 19:00:51 dkct-manual.html
+2019-11-11 19:00:51 dkct-manual.md
+2019-11-11 19:00:51 dkct.md
+2019-11-11 19:00:51 dk-db2t-manual.md
+2019-11-11 19:00:51 dk-db2t.md
+2019-11-11 19:00:51 dk-dbco-manual.md
+2019-11-11 19:00:51 dk-dbco.md
+2019-11-11 19:00:51 dk-fic-manual.md
+2019-11-11 19:00:51 dk-fic.md
+2019-11-11 19:00:51 dk-hex-manual.md
+2019-11-11 19:00:51 dk-hex.md
+2019-11-11 19:00:51 dk-lines-manual.md
+2019-11-11 19:00:51 dk-lines.md
+2019-11-11 19:00:51 dk-ls-manual.md
+2019-11-11 19:00:51 dk-ls.md
+2019-11-11 19:00:51 dk-pwd-manual.md
+2019-11-11 19:00:51 dk-pwd.md
+2019-11-11 19:00:51 dk-pwgen-manual.md
+2019-11-11 19:00:51 dk-pwgen.md
+2019-11-11 19:00:51 dk-rand-manual.md
+2019-11-11 19:00:51 dk-rand.md
+2019-11-11 19:00:51 dk-recv-manual.md
+2019-11-11 19:00:51 dk-recv.md
+2019-11-11 19:00:51 dk-send-manual.md
+2019-11-11 19:00:51 dk-send.md
+2019-11-11 19:00:51 dk-sort-manual.md
+2019-11-11 19:00:51 dk-sort.md
+2019-11-11 19:00:51 dk-sqlsplit-manual.md
+2019-11-11 19:00:51 dk-sqlsplit.md
+2019-11-11 19:00:51 dk-t2db-manual.md
+2019-11-11 19:00:51 dk-t2db.md
+2019-11-11 19:00:51 dk-t2h-manual.md
+2019-11-11 19:00:51 dk-t2h.md
+2019-11-11 19:00:51 dk-t2l-manual.md
+2019-11-11 19:00:51 dk-t2l.md
+2019-11-11 19:00:51 dktoolian-building-examples.md
+2019-11-11 19:00:51 dktoolian.md
+2019-11-11 19:00:51 dktoolian-using-examples.md
+2019-11-11 19:00:51 dk-uid-manual.md
+2019-11-11 19:00:51 dk-uid.md
+2019-11-11 19:00:51 dkwt-manual.md
+2019-11-11 19:00:51 dkwt.md
+2019-11-11 19:00:51 dkwxwiz-manual.md
+2019-11-11 19:00:51 dkwxwiz.md
+2019-11-11 19:00:51 fig2lat-manual.md
+2019-11-11 19:00:51 fig2lat.md
+2019-11-11 19:00:51 GNUmakefile
+2019-11-11 19:00:51 home.html
+2019-11-11 19:00:51 home.md
+2019-11-11 19:00:51 htmlbook-manual.md
+2019-11-11 19:00:51 htmlbook.md
+2019-11-11 19:00:51 instusrc.md
+2019-11-11 19:00:51 inst-w-exe.md
+2019-11-11 19:00:51 inst-w-src.md
+2019-11-11 19:00:51 inst-x-src.md
+2019-11-11 19:00:51 itadmin-manual.md
+2019-11-11 19:00:51 itadmin.md
+2019-11-11 19:00:51 lprngcl-manual.md
+2019-11-11 19:00:51 lprngcl.md
+2019-11-11 19:00:51 ls-overview.md
+2019-11-11 19:00:51 pjsnmp-manual.md
+2019-11-11 19:00:51 pjsnmp.md
+2019-11-11 19:00:51 plpdftex-manual.md
+2019-11-11 19:00:51 plpdftex.md
+2019-11-11 19:00:51 printqdc-manual.md
+2019-11-11 19:00:51 printqdc.md
+2019-11-11 19:00:51 printqd-manual.md
+2019-11-11 19:00:51 printqd.md
+2019-11-11 19:00:51 prmonsnmp-manual.md
+2019-11-11 19:00:51 prmonsnmp.md
+2019-11-11 19:00:51 rshdown-manual.md
+2019-11-11 19:00:51 rshdown.md
+2019-11-11 19:00:51 tdkct.ctr
+2019-11-11 19:00:51 usage-examples.md
+2019-11-11 19:00:51 winprint-manual.md
+2019-11-11 19:00:51 winprint.md
+2019-11-11 19:00:51 wprclean-manual.md
+2019-11-11 19:00:51 wprclean.md
+2019-11-11 19:00:51 wxbmpp-manual.md
+2019-11-11 19:00:51 wxbmpp.md
+2019-11-11 19:00:51 wxdkclock-manual.md
+2019-11-11 19:00:51 wxdkclock.md
+2019-11-11 19:00:51 wxdkct.md
+2019-11-11 19:00:51 wxdkfcs-manual.md
+2019-11-11 19:00:51 wxdkfcs.md
+2019-11-11 19:00:51 wxdkhtb-manual.md
+2019-11-11 19:00:51 wxdkhtb.md
+2019-11-11 19:00:51 wximgsz.md
+2019-11-11 19:00:51 wxpqdic-manual.md
+2019-11-11 19:00:51 wxpqdic.md
+2019-11-11 19:00:51 x.md
+2019-11-11 19:00:58 arrowtest1.svg
+2019-11-11 19:00:58 badcurve1.svg
+2019-11-11 19:00:58 badcurve2.svg
+2019-11-11 19:00:58 dkct-ex1-stm.svg
+2019-11-11 19:00:58 dkct-gui-sections.svg
+2019-11-11 19:00:58 lstest1.svg
+2019-11-11 19:00:58 lstest2.svg
+2019-11-11 19:00:58 pattest.svg
+2019-11-11 19:01:00 sc01-wxdkclock.png
+2019-11-11 19:01:00 sc02-wxdkclock.png
+2019-11-11 19:01:00 sc03-wxdkclock.png
+2019-11-11 19:01:00 sc04-wxdkclock.png
+2019-11-11 19:01:00 sc05-wxdkclock.png
+2019-11-11 19:01:00 sc06-wxdkclock.png
+2019-11-11 19:01:00 sc07-wxdkclock.png
+2019-11-11 19:01:00 sc08-wxdkclock.png
+2019-11-11 19:01:00 sc-wxbmpp.png
+2019-11-11 19:01:00 sc-wxdkct-options.png
+2019-11-11 19:01:00 sc-wxdkfcs.png
+2019-11-11 19:01:00 wximgsz1.png
+2019-11-13 19:57:25 inst-x-pkg.md
+2019-11-27 20:42:02 dk-blks.md
+2019-11-27 20:43:33 dk-blks-manual.md
+2019-11-27 20:49:25 dk-eradisk-manual.md
+2019-11-27 20:49:43 dk-eradisk.md
+2019-11-27 21:26:28 changelog.md
+changelog.md
+dkct-manual.md
+dkwxwiz.md
+home.md
+inst-w-exe.md
+wxdkct.md
+
diff --git a/support/dktools/mklivesys.sh b/support/dktools/mklivesys.sh
new file mode 100755
index 0000000000..9561e15008
--- /dev/null
+++ b/support/dktools/mklivesys.sh
@@ -0,0 +1,4876 @@
+#! /bin/sh
+
+# Copyright (c) 2016-2020, Dirk Krause
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the copyright holder nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+
+# ##### START OF CONFIGURATION SECTION #####
+#
+#
+
+# Basic decisions
+# ===============
+# It is very likely you want to apply changes here.
+
+# String: Name of preferred desktop
+# ---------------------------------
+# Disklessian + DkToolian
+# ---------------------------------
+# One from: none xfce gnome lxde mate lxqt cinnamon kde
+# Supported/recommended: none (DKtoolian only) xfce gnome
+# Experimental: lxde mate lxqt (Debian Stretch only) cinnamon kde
+DESKTOP="gnome"
+
+# Live system type.
+# -----------------
+# DkToolian only
+# -----------------
+# One from:
+# hybrid for USB drives, CDROM or DVD
+# hdd for USB drives only
+# nfs for network boot DHCP/TFTP/NFS (requires NFSSERVER and NFSPATH).
+LIVETYPE="hybrid"
+
+# NFS server name for LIVETYPE=nfs.
+# ---------------------------------
+# DkToolian only
+# ---------------------------------
+# Must be specified for LIVETYPE=nfs. Ignored for other LIVETYPE values.
+# Recommendation: Use IP address.
+# NFSSERVER="nfs.my-domain.com"
+NFSSERVER=""
+
+# NFS root file system path for LIVETYPE=nfs.
+# -------------------------------------------
+# DkToolian only
+# -------------------------------------------
+# Must be specified for LIVETYPE=nfs.
+# NFSPATH="/opt/nfs/netboot"
+NFSPATH=""
+
+# Kernel flavour
+# ----------------
+# Disklessian only
+# ----------------
+# One from "586", "686-pae", or "amd64".
+# Your choice must match the configuration file used for kernel compilation.
+KERNELFLAVOUR="amd64"
+
+# Public key for repository signatures
+# ------------------------------------
+# Disklessian only
+# ------------------------------------
+# Set this to the public key text file.
+PUBKEYFILE="/home/livesys/80618284-public.txt"
+
+# Flag: Configuration done.
+# -------------------------
+# Disklessian + DkToolian
+# -------------------------
+# After adjusting the settings in this section, change this to "yes".
+CONFIGURED="no"
+
+
+# Optional decisions
+# ==================
+# Reasonable defaults are available, so you are not required
+# to edit this section.
+
+
+# Kernel options
+# ==============
+
+# Kernel version
+# ----------------
+# Disklessian only
+# ----------------
+# Run
+# uname -a
+# For example output
+# Linux l-kr 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt25-2+deb8u2 (2016-...
+# set KERNELVERSION="3.16.7-ckt25"
+#
+# For example output
+# Linux dk 3.16.0-4-686-pae #1 SMP Debian 3.16.36-1+deb8u1 (2016-...
+# set KERNELVERSION="3.16.36"
+#
+# Leave the kernel version empty for automatic detection.
+KERNELVERSION=""
+
+
+# Package selection options
+# =========================
+
+# The packages to install are configured in the following files in
+# the livesys-data subdirectory:
+#
+# - pkg-${LIVESYSTYPE}-${DEBVMAJ}-host.txt
+# Packages to install on the build host before building the live system.
+#
+# - pkg-${LIVESYSTYPE}-${DEBVMAJ}-base.txt
+# Packages to install into both command line and desktop live systems.
+#
+# - pkg-${LIVESYSTYPE}-${DEBVMAJ}-firmware.txt
+# Firmware packages.
+#
+# - pkg-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}.txt
+# Packages for the specified desktop.
+#
+# - pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-base.txt
+# List of all language support packages for command line systems, used
+# only if failed to find a language specific package list.
+#
+# - pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-desktop.txt
+# List of all language support packages for desktop systems, used only
+# if failed to find a language specific package list.
+#
+# The settings below contain options for detailed package selection.
+
+# Allow or deny system update on the build host
+# ---------------------------------------------
+# Disklessian + DkToolian
+# ---------------------------------------------
+# Boolean flag, "yes" or "no".
+UPDATESYSTEM="yes"
+
+# Allow or deny installation of recommended packages
+# --------------------------------------------------
+# DkToolian only
+# --------------------------------------------------
+# Boolean flag, "yes" or "no".
+# Only used if DESKTOP=none. Recommended value: yes.
+APTRECOMMENDS="yes"
+
+# Flag: Allow to use firmware from "non-free" and "contrib".
+# ----------------------------------------------------------
+# Disklessian + DkToolian
+# ----------------------------------------------------------
+# Set to "yes" to place non-free firmware files in the live system,
+# "no" to build a live system without non-free firmware files.
+# Some components in computers (mostly WiFi chips, but some ethernet and other
+# chips too) require firmware files to work.
+# ----- Start of opinion section, no legal advice. -----
+# Unfortunately some firmware files are not available under a free license
+# allowing to distribute them together with GPL-licensed software.
+# If you configure the use of such non-free firmware files here, the resulting
+# live system may be undistributable (you can use it for your own purposes
+# but are not allowed to distribute it to other users).
+# ----- End of opinion section, no legal advice. -----
+# ----- Start of disclaimer -----
+# The section above is an opinion piece and does not contain legal advice.
+# You should consult a lawyer to obtain legal advice about the legal status
+# of distributing live systems containing non-free firmware files.
+# ----- End of disclaimer -----
+ALLOWNONFREE="no"
+
+# Boolean, allow or deny installation of unsigned packages
+# ------------------------------------------------
+# Disklessian + DkToolian
+# ------------------------------------------------
+# Enabling unsigned packages is a security risk, so it is _not_ recommended.
+# All packages in Debian repositories are signed, the self-made kernels
+# for Disklessian are signed too, so I can see no situation requiring to
+# allow the use of unsigned packages.
+ALLOWUNSIGNEDPKG="no"
+
+# Flag: Allow apt indices in live system
+# --------------------------------------
+# DkToolian only
+# --------------------------------------
+# By default we create the live system as small as possible.
+# Switching to "yes" may speed up updates in the live system later
+# but increases live system size.
+ALLOWAPTINDICES="no"
+
+# Flag: Allow installation of libreoffice packages
+# ------------------------------------------------
+# Disklessian only
+# ------------------------------------------------
+# By default we create the live system as small as possible.
+# Switching to "yes" creates a more comfortable but significantly
+# larger live system that will not fit on CD.
+# For live systems on DVD or USB the size change should not be a problem.
+ALLOWLIBREOFF="no"
+
+# Customization (additional files)
+# ================================
+
+# Directory for additional data
+# -----------------------------
+# Disklessian + DkToolian
+# -----------------------------
+# Leave empty to use the default /usr/local/disklessian or
+# /usr/local/dktoolian directory.
+# Use
+# DATADIR="-"
+# to skip copying additional data into the live system.
+DATADIR=""
+
+
+# Network options
+# ===============
+
+# Use traditional short interface names like eth0 or wlan0
+# --------------------------------------------------------
+# Disklessian + DkToolian
+# --------------------------------------------------------
+# Some drivers can not handle the long interface names used by recent
+# kernels, this results in WiFi deauthentication.
+# Ignored on Debian Jessie which always uses short interface names.
+SHORTIFNAMES="yes"
+
+# IP settings to append to kernel parameters.
+# -------------------------------------------
+# Disklessian + DkToolian
+# -------------------------------------------
+# Arguments for ip=... kernel parameter.
+# Leave empty to omit the kernel parameter.
+# Normally DHCP is enabled by default (without the kernel parameter).
+# For nfsroot images DHCP is disabled by default, so you should enable
+# it here.
+#
+# Either device:address:netmask:gateway:nameserver:
+# LIVEAPPENDIP="eth0:192.0.2.42:255.255.255.0:192.0.2.1:192.0.2.50"
+# Or one from the methods below:
+# Use DHCP protocol
+# LIVEAPPENDIP="dhcp"
+# Use older BOOTP protocol
+# LIVEAPPENDIP="bootp"
+# Use older RARP protocol
+# LIVEAPPENDIP="rarp"
+# Use all three: DHCP, BOOTP, RARP
+# LIVEAPPENDIP="on"
+# LIVEAPPENDIP="any"
+# Not documented
+# LIVEAPPENDIP="both"
+# Inspect the live systems /etc/network/interfaces file
+# LIVEAPPENDIP="frommedia"
+# Disable networking (use neither DHCP, BOOTP or RARP)
+# LIVEAPPENDIP="none"
+# LIVEAPPENDIP="off"
+LIVEAPPENDIP="dhcp"
+
+# Time synchronisation
+# ====================
+
+# NTP server to query during boot process.
+# ----------------------------------------
+# Disklessian + DkToolian
+# ----------------------------------------
+# Host name or IP address of NTP server to query during boot.
+# Leave empty to omit the query.
+# If USENTPDAEMON="yes", the server is queried periodically by ntpd instead
+# of running ntpdate once at boot.
+NTPSERVER=""
+
+# Use NTP daemon.
+# -----------------------
+# Disklessian + DkToolian
+# -----------------------
+# Boolean flag, "yes" or "no".
+USENTPDAEMON="yes"
+
+# CLI console options
+# ===================
+
+# VGA mode to append to kernel parameters.
+# ----------------------------------------
+# DkToolian only
+# ----------------------------------------
+# Only used for CLI live systems (DESKTOP=none).
+# Set to empty string to append no VGA setting and let the system choose one.
+# Use LIVEAPPENDVGA="0x0F00" to stay at 25 lines x 80 columns in CLI systems.
+# LIVEAPPENDVGA=""
+LIVEAPPENDVGA="0x0F00"
+
+# Font to use in text console
+# ---------------------------
+# DkToolian only
+# ---------------------------
+# One from: VGA Terminus TerminusBold TerminusBoldVGA Fixed
+# Only used for CLI live systems (DESTKOP=none).
+# Leave the text empty to let the system choose a font automatically.
+# For me VGA works best, see the FONTFACE section of console-setup(5).
+CONSOLEFONT=""
+
+# Accessability
+# =============
+
+# Beep when boot menu is shown.
+# -----------------------------
+# Disklessian + DkToolian
+# -----------------------------
+# Boolean flag, use "yes" to make the boot menu beep.
+# The beep might inform visually impaired or blind people about the presence
+# of the boot menu, so they can append kernel options for screen readers...
+BOOTMENUBEEP="yes"
+
+
+# Author name
+# ===========
+
+# Live system publisher name.
+# ---------------------------
+# Disklessian + DkToolian
+# ---------------------------
+# Use your full name here.
+# Leave empty for automatically use information from gecos
+# (the comment in the /etc/passwd file for the current user account).
+# PUBLISHER="John Smith"
+PUBLISHER=""
+
+
+# Debug and progress output
+# =========================
+
+# Flag: Verbose operations
+# ------------------------
+# Disklessian + DkToolian
+# ------------------------
+# As building the live system takes some time, you might want to
+# see progress messages...
+VERBOSE="yes"
+
+# Boolean, use serial console to debug boot process
+# -------------------------------------------------
+# DkToolian only
+# -------------------------------------------------
+# A user can also append
+# console=ttyS1 console=tty0
+# to kernel arguments when the boot menu is shown.
+SERIALCONSOLE="no"
+
+# Localization (language and language-dependant settings)
+# =======================================================
+
+# Short language setting.
+# -----------------------
+# Disklessian + DkToolian
+# -----------------------
+# Short language definition, i.e. "en", "de", ...
+# Leave empty for automatic selection (language currently used).
+LANGSHORT=""
+
+# Full locale setting.
+# -----------------------
+# Disklessian + DkToolian
+# -----------------------
+# Full language definition including region and encoding, i.e.
+# "en_US.utf8", "de_DE.utf8" ...
+# Leave empty for automatic selection (language currently used).
+LANGFULL=""
+
+# List of locales to append to kernel parameters.
+# -----------------------------------------------
+# Disklessian + DkToolian
+# -----------------------------------------------
+# Full language definition including region and encoding, i.e.
+# "en_US.utf8", "de_DE.utf8" ...
+# Leave empty for automatic selection (language currently used).
+# Set
+# LIVEAPPENDLOCALES="-"
+# to avoid appending locales.
+LIVEAPPENDLOCALES=""
+
+# Timezone to append to kernel parameters.
+# ----------------------------------------
+# Disklessian + DkToolian
+# ----------------------------------------
+# Specify a continent/city combination, i.e. "Europe/Berlin"...
+# Leave empty for automatic selection (currently used timezone).
+# Set
+# LIVEAPPENDTIMEZONE="-"
+# to avoid appending a timezone
+LIVEAPPENDTIMEZONE=""
+
+
+# Keyboard settings
+# =================
+
+# Console keyboard mapping file
+# -----------------------------
+# DkToolian CLI only
+# -----------------------------
+# Keyboard mapping file in subdirectories of the /usr/share/keymaps directory.
+# The keymaps are in the console-data package.
+# Run commands like:
+# for i in `find /usr/share/keymaps -name '*.kmap.gz'`
+# do
+# echo '#####' $i
+# gzip -dc $i | grep '^#'
+# echo ''
+# done
+# to see comments from the available map files.
+# Leave empty for automatic selection (depending on language).
+# NOTE: Automatic selection means guessing here.
+# Set
+# CONSKEYMAP="-"
+# to avoid loading a keyboard mapping.
+CONSKEYMAP=""
+
+# Keyboard Model
+# -----------------------
+# Disklessian + DkToolian
+# -----------------------
+# Keyboard model for /etc/default/keyboard file, see keyboard(5).
+# Leave empty for automatic selection (pc105).
+XKBMODEL=""
+
+# Keyboard settings: Layout
+# -------------------------
+# Disklessian + DkToolian
+# -------------------------
+# Keyboard layout for /etc/default/keyboard file, see keyboard(5).
+# Leave empty for automatic selection (short language setting).
+XKBLAYOUT=""
+
+# Keyboard settings: Variant
+# --------------------------
+# Disklessian + DkToolian
+# --------------------------
+# Keyboard variant for /etc/default/keyboard file, see keyboard(5).
+# Normally left empty.
+XKBVARIANT=""
+
+# Keyboard settings: Option
+# -------------------------
+# Disklessian + DkToolian
+# -------------------------
+# Keyboard options for /etc/default/keyboard file, see keyboard(5).
+# Normally left empty.
+XKBOPTIONS=""
+
+# Keyboard settings: Backspace key
+# --------------------------------
+# Disklessian + DkToolian
+# --------------------------------
+# Back space key for /etc/default/keyboard file, see keyboard(5).
+# One from "bs", "del", or "guess".
+# Leave empty for "guess".
+XKBBACKSPACE=""
+
+# List of keyboard layouts to append to kernel parameters.
+# --------------------------------------------------------
+# DkToolian only
+# --------------------------------------------------------
+# Leave empty for automatic selection (short language name).
+# Set
+# LIVEAPPENDKBDLAYOUTS="-"
+# to avoid appending keyboard layouts
+LIVEAPPENDKBDLAYOUTS=""
+
+# Other options
+# -----------------------
+# Disklessian + DkToolian
+# -----------------------
+# Further kernel arguments
+# You might want to add (as examples):
+# - live-config.noautologin to avoid automatic login
+# - live-config.noroot to keep the live user away from sudo
+LIVEAPPENDCUSTOM=""
+
+# MIRRORS TO USE WHEN BUILDING AND RUNNING THE LIVE SYSTEM
+# ========================================================
+# Disklessian + DkToolian
+# ========================================================
+# Leave empty/unchanged for automatic selection and/or defaults.
+
+# Mirror for bootstrapping
+# ------------------------
+# Default: http://ftp.de.debian.org/debian/
+# This is probably not a good choice for users from outside Europe.
+PARENTMIRRORBOOTSTRAP=""
+
+# Mirror used in the chroot stage
+# -------------------------------
+# Default: $PARENTMIRRORBOOTSTRAP
+PARENTMIRRORCHROOT=""
+
+# Mirror for security updates used in the chroot stage
+# ----------------------------------------------------
+# Default: http://security.debian.org/debian/
+PARENTMIRRORCHROOTSECURITY=""
+
+# Mirror for package updates used in the chroot stage
+# ---------------------------------------------------
+# Default: PARENTMIRRORCHROOT
+PARENTMIRRORCHROOTUPDATES=""
+
+# Mirror for backports used in the chroot stage.
+# ----------------------------------------------
+# Default: http://backports.debian.org/debian-backports/
+PARENTMIRRORCHROOTBACKPORTS=""
+
+# Mirror used by the live system
+# ------------------------------
+# Default: http://http.debian.net/debian/
+PARENTMIRRORBINARY="http://ftp.de.debian.org/debian/"
+
+# Mirror for security updates used by the live system
+# ---------------------------------------------------
+# Default: http://security.debian.org/
+PARENTMIRRORBINARYSECURITY=""
+
+# Mirror for packages updates used by the live system
+# ---------------------------------------------------
+# Default: PARENTMIRRORBINARY
+PARENTMIRRORBINARYUPDATES=""
+
+# Mirror for backports used by the live system
+# --------------------------------------------
+# Default: http://backports.debian.org/debian-backports/
+PARENTMIRRORBINARYBACKPORTS=""
+
+# Mirror to fetch Debian installer images from
+# --------------------------------------------
+# Default: PARENTMIRRORBOOTSTRAP
+PARENTMIRRORDEBIANINSTALLER=""
+
+# Mirror used to bootstrap the derivative from
+# --------------------------------------------
+# Default: http://ftp.de.debian.org/debian/
+MIRRORBOOTSTRAP=""
+
+# Mirror used in the chroot stage to build the derivative
+# -------------------------------------------------------
+# Default: MIRRORBOOTSTRAP
+MIRRORCHROOT=""
+
+# Mirror for security updates used in the chroot stage to build the derivative
+# ----------------------------------------------------------------------------
+# Default: http://security.debian.org/debian/
+MIRRORCHROOTSECURITY=""
+
+# Mirror for package updates used in the chroot stage to build the derivative
+# ---------------------------------------------------------------------------
+# Default: MIRRORCHROOT
+MIRRORCHROOTUPDATES=""
+
+# Mirror for backports used in the chroot stage to build the derivative
+# ---------------------------------------------------------------------
+# Default: http://backports.debian.org/debian-backports/
+MIRRORCHROOTBACKPORTS=""
+
+# Derivative package mirror used by the live system
+# -------------------------------------------------
+MIRRORBINARY="http://ftp.de.debian.org/debian/"
+
+# Derivatives security package mirror used by the live system
+# -----------------------------------------------------------
+MIRRORBINARYSECURITY=""
+
+# Derivatives update package mirror used by the live system
+# ---------------------------------------------------------
+MIRRORBINARYUPDATES=""
+
+# Derivatives backports package mirror used by the live system
+# ------------------------------------------------------------
+MIRRORBINARYBACKPORTS=""
+
+# Derivatives mirror used to fetch Debian installer images
+# --------------------------------------------------------
+# Default: $MIRRORBOOTSTRAP
+MIRRORDEBIANINSTALLER=""
+
+#
+#
+# ##### END OF CONFIGURATION SECTION #####
+# ##### No need for changes after this point. #####
+
+
+# Functions
+# =========
+
+# Write log output if VERBOSE is set
+# ----------------------------------
+#
+PLTST=""
+logverb()
+{
+ if [ "X$VERBOSE" = "Xyes" ]
+ then
+ CLTST=`date '+%Y-%m-%d %H:%M:%S'`
+ fi
+ if [ "X$VERBOSE" = "Xyes" -a "X$PLTST" != "X$CLTST" ]
+ then
+ echo "# $CLTST"
+ fi
+ if [ "X$VERBOSE" = "Xyes" ]
+ then
+ PLTST="$CLTST"
+ echo $*
+ fi
+}
+
+
+# Create directory if it does not yet exist.
+# ------------------------------------------
+#
+crdir() {
+ if [ -d "$*" ]
+ then
+ logverb 'I: Directory' $* already exists
+ else
+ logverb 'P: Create directory' $*
+ mkdir -p "$*"
+ chmod 755 "$*"
+ logverb 'P: Create directory' $* done
+ fi
+}
+
+
+
+
+# Obtain setup information
+# ========================
+
+# The live system type (disklessian or dktoolian) must
+# be specified as first command line argument.
+# Default is dktoolian
+# ----------------------------------------------------
+LIVESYSTYPE="$1"
+logverb 'P: Checking live system type'
+case "X$LIVESYSTYPE" in
+"Xdisklessian")
+ LIVESYSTYPE="disklessian"
+ logverb 'P: Live system type is Disklessian'
+;;
+"Xdl")
+ LIVESYSTYPE="disklessian"
+ logverb 'P: Live system type is Disklessian'
+;;
+"Xdt")
+ LIVESYSTYPE="dktoolian"
+ logverb 'P: Live system type is DkToolian'
+;;
+"Xdktoolian")
+ LIVESYSTYPE="dktoolian"
+ logverb 'P: Live system type is DkToolian'
+;;
+*)
+ LIVESYSTYPE="dktoolian"
+ logverb 'W: Unknown live system type, using DkToolian'
+;;
+esac
+export LIVESYSTYPE
+
+MDL="no"
+if [ "X$LIVESYSTYPE" = "Xdisklessian" ]
+then
+ MDL="yes"
+fi
+
+# Checks
+# ======
+
+# Find Debian major version
+# -------------------------
+logverb 'P: Checking for Debian major version'
+DEBVMAJ=`cat /etc/debian_version | cut -f 1 -d .`
+logverb 'P: Debian major version number' $DEBVMAJ
+case "X$DEBVMAJ" in
+"X8")
+ DEBVMAJ="jessie"
+ logverb 'P: Debian Jessie'
+;;
+"X9")
+ DEBVMAJ="stretch"
+ logverb 'P: Debian Stretch'
+;;
+"X10")
+ DEBVMAJ="buster"
+ logverb 'P: Debian Buster'
+;;
+*)
+ echo 'E: Can not handle Debian major version' $DEBVMAJ
+ exit 1
+;;
+esac
+
+# Check whether running as root
+# -----------------------------
+logverb 'P: Checking for root privileges'
+if [ "X$LOGNAME" != "Xroot" ]
+then
+ echo 'E: Root privileges required!'
+ echo 'H: This script can be used by root only.'
+ # ##### DEBUG ##### exit 1
+fi
+
+
+# Retrieve custom setup
+# =====================
+
+# The custom setup script can overwrite the settings
+# from the configuration section
+# --------------------------------------------------
+if [ -d "custom" -a -x "custom/setup.sh" ]
+then
+ logverb 'P: Running custom setup script'
+ . ./custom/setup.sh
+ logverb 'P: Running custom setup script done'
+elif [ -d "custom" -a -f "custom/setup.sh" ]
+then
+ echo 'E: Custom setup script custom/setup.sh not executable!'
+fi
+
+
+# Check whether setup is completed
+# --------------------------------
+logverb 'P: Checking whether script is configured'
+if [ "X$CONFIGURED" != "Xyes" ]
+then
+ echo 'E: Script not configured!'
+ echo 'H: Please edit the configuration section of this script.'
+ echo 'H: The section is located at start of file.'
+ echo 'H: Set CONFIGURED="yes" to indicate the configuration step.'
+ exit 1
+fi
+
+
+# Need public key file for disklessian
+# ------------------------------------
+logverb 'P: Checking for public key file if required'
+if [ "X$LIVESYSTYPE" = "Xdisklessian" -a ! -f "${PUBKEYFILE}" ]
+then
+ echo 'E: Public key file' "${PUBKEYFILE}" 'not found!'
+ exit 1
+fi
+
+
+# Initialize variables
+# ====================
+
+# List of package names for localization
+# --------------------------------------
+PKGLOC=""
+
+# List of further package names to add
+# ------------------------------------
+PKGNAMES=""
+
+
+# Log startup time
+# ================
+logverb 'P: Start processing'
+
+# Variables used as abbreviation
+# ==============================
+
+# Base directory for build process
+# --------------------------------
+DIR=`pwd`
+logverb 'I: Base directory is' $DIR
+
+# Directory for additional files
+# ------------------------------
+ICHR="${DIR}/livesys/config/includes.chroot"
+logverb 'I: Include chroot directory is' $ICHR
+
+# Directory for files to copy into initramfs
+# ------------------------------------------
+INITRD="${ICHR}/usr/share/dklivesys/initramfs"
+logverb 'I: Initramfs directory is' $INITRD
+
+# Chroot directory after building the live system
+# -----------------------------------------------
+CHROOT="${DIR}/livesys/chroot"
+
+# Source directory
+# ----------------
+DSRC="${DIR}/livesys-data"
+logverb 'I: Data source directory is' $DSRC
+
+# Directory for hooks, here as absolute directory
+# -----------------------------------------------
+logverb 'I: live-build version' `lb --version`
+HOOKDIR="config/hooks/normal"
+LBVMAJ=`lb --version | cut -f 1 -d .`
+if [ "X$LBVMAJ" = "X" ]
+then
+ LBVMAJ="4"
+fi
+if [ "X$LBVMAJ" = "X4" ]
+then
+ HOOKDIR=config/hooks
+fi
+HOOKDIR="${DIR}/livesys/${HOOKDIR}"
+logverb 'I: Hook directory is' $HOOKDIR
+
+# Boot menu location for ISOLINUX images
+# --------------------------------------
+BOOTMENUCFG="binary/isolinux/menu.cfg"
+
+# Main configuration file for ISOLINUX images
+# -------------------------------------------
+ISOLINUXCFG="binary/isolinux/isolinux.cfg"
+
+# Splash image to show as boot menu background
+# --------------------------------------------
+SPLASHPNG="binary/isolinux/splash.png"
+
+# Exit code
+# ---------
+EXVAL=0
+
+# Packages to include at lb config stage
+# --------------------------------------
+if [ "X$DEBVMAJ" = "Xjessie" ]
+then
+ LBCINC="gnupg2"
+else
+ LBCINC="gnupg2,live-tools,live-config,live-boot"
+fi
+
+# Arguments to lb config command
+# ------------------------------
+OPTCONF=""
+
+# Kernel parameters to append for live system
+# -------------------------------------------
+OPTLIVEAPPEND=""
+
+# List of package list file names
+# -------------------------------
+PKGF=""
+
+# Boolean flag, WiFi files found
+# ------------------------------
+WIFIFILE="no"
+
+
+# Desktop used by sddm display manager
+# ------------------------------------
+SDDMDT=""
+
+# Automatically complete setup
+# ============================
+
+# LANGSHORT
+# ---------
+if [ "X$LANGSHORT" = "X" ]
+then
+ LANGSHORT=`echo $LANG | cut -f 1 -d '.' | cut -f 1 -d _`
+fi
+
+# LANGFULL
+# --------
+if [ "X$LANGFULL" = "X" ]
+then
+ LANGFULL=`grep "^LANG=" /etc/default/locale | cut -f 2 -d '"'`
+fi
+if [ "X$LANGFULL" = "X" ]
+then
+ LANGFULL="$LANG"
+fi
+
+# LIVEAPPENDLOCALES
+# -----------------
+if [ "X$LIVEAPPENDLOCALES" = "X" -a "X$LANGFULL" != "X" ]
+then
+ LIVEAPPENDLOCALES=`echo $LANGFULL | sed -e 's/UTF\-8/utf8/g'`
+fi
+
+# LIVEAPPENDKBDLAYOUTS
+# --------------------
+if [ "X$LIVEAPPENDKBDLAYOUTS" = "X" -a "X$LANGSHORT" != "X" ]
+then
+ LIVEAPPENDKBDLAYOUTS="$LANGSHORT"
+fi
+
+# LIVEAPPENDTIMEZONE
+# ------------------
+if [ "X$LIVEAPPENDTIMEZONE" = "X" -a -f /etc/timezone ]
+then
+ LIVEAPPENDTIMEZONE=`cat /etc/timezone`
+fi
+
+# LANGREG
+# -------
+LANGREG=`echo $LANGFULL | cut -f 1 -d .`
+
+# PUBLISHER
+# ---------
+if [ "X$PUBLISHER" = "X" ]
+then
+ PUBLISHER=`getent passwd | grep "^${LOGNAME}:" | cut -f 5 -d :`
+fi
+if [ "X$PUBLISHER" = "X" ]
+then
+ PUBLISHER="An Unknown Live System Creator"
+fi
+
+# DATADIR
+# -------
+if [ "X$DATADIR" = "X" ]
+then
+ DATADIR="/usr/local/$LIVESYSTYPE"
+ logverb 'P: Setting DATADIR' $DATADIR
+fi
+
+# KERNELVERSION
+# -------------
+if [ "X$LIVESYSTYPE" = "Xdisklessian" -a "X$KERNELVERSION" = "X" ]
+then
+ KERNELVERSION=`uname -a | cut -f 7 -d ' ' | cut -f 1 -d '+'`
+ KERNELVERSION=`echo $KERNELVERSION | sed -e 's/\-[01-9][01-9]*$//g'`
+ logverb 'P: Setting KERNELVERSION' $KERNELVERSION
+fi
+
+# KERNELFLAVOUR
+# -------------
+if [ "X$LIVESYSTYPE" = "Xdisklessian" -a "X$KERNELFLAVOUR" = "X" ]
+then
+ KERNELFLAVOUR=`uname -r | sed -e 's/^.*\-//'`
+ logverb 'P: Setting KERNELFLAVOUR' $KERNELFLAVOUR
+fi
+if [ "X$LIVESYSTYPE" = "Xdisklessian" -a "X$KERNELFLAVOUR" = "X" ]
+then
+ KERNELFLAVOUR="586"
+ logverb 'P: Setting KERNELFLAVOUR' $KERNELFLAVOUR
+fi
+
+# LIVETYPE
+# --------
+if [ "X$LIVETYPE" != "Xnfs" -a "X$LIVETYPE" != "Xhdd" ]
+then
+ LIVETYPE="hybrid"
+fi
+
+# BROWSER
+# -------
+BROWSER="firefox-esr"
+EMAIL="thunderbird"
+
+# APTRECOMMENDS
+# -------------
+if [ "X$APTRECOMMENDS" != "Xyes" -a "X$APTRECOMMENDS" != "Xno" ]
+then
+ APTRECOMMENDS="yes"
+fi
+
+# Console keymapping
+# ------------------
+if [ "X$XKBMODEL" = "X" ]
+then
+ XKBMODEL=pc105
+fi
+if [ "X$XKBMODEL" = "X-" ]
+then
+ XKBMODEL=""
+fi
+if [ "X$XKBLAYOUT" = "X" ]
+then
+ XKBLAYOUT=$LANGSHORT
+fi
+if [ "X$XKBLAYOUT" = "X-" ]
+then
+ XKBLAYOUT=""
+fi
+if [ "X$XKBBACKSPACE" = "X" ]
+then
+ XKBBACKSPACE=guess
+fi
+if [ "X$XKBBACKSPACE" = "X-" ]
+then
+ XKBBACKSPACE=""
+fi
+
+# Correct umask
+# -------------
+umask 022
+
+
+
+# Update host and install required packages
+# =========================================
+
+# Update package list
+# -------------------
+logverb 'P: Updating package list on build host'
+[ "X$UPDATESYSTEM" != "Xyes" ] || apt-get -y update
+if [ "X$?" != "X0" ]
+then
+ echo 'E: Failed to update package lists!'
+ echo 'H: Please check network connection.'
+ exit 1
+fi
+
+# Upgrade system
+# --------------
+logverb 'P: Upgrading build host'
+[ "X$UPDATESYSTEM" != "Xyes" ] || apt-get -y upgrade
+if [ "X$?" != "X0" ]
+then
+ echo 'E: Failed to upgrade system!'
+ echo 'H: Please check network connection.'
+ exit 1
+fi
+
+fn="${DSRC}/pkg-${LIVESYSTYPE}-${DEBVMAJ}-host.txt"
+logverb 'P: Installing packages on build host from file' $fn
+apt-get -y install `sed -e 's/[ \t]*#.*$//g' "$fn" `
+if [ "X$?" != "X0" ]
+then
+ echo 'E: Failed to install required packages!'
+ echo 'H: Please check network connection.'
+ exit 1
+fi
+
+# Build DK tools
+# ==============
+if [ "X$LIVESYSTYPE" = "Xdktoolian" ]
+then
+ logverb 'P: Configuring DK tools'
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-packaging --with-suite=rescue --with-man
+ logverb 'P: Configuring DK tools done'
+ logverb 'P: Building DK tools'
+ make || exit 1
+ logverb 'P: Building DK tools done'
+fi
+
+# Create live system directory
+# ============================
+crdir "${DIR}/livesys"
+
+# Gather package files and package names
+# ======================================
+
+# Normal packages to install
+# --------------------------
+
+logverb 'P: Building package list (base and desktop)'
+PKGF="pkg-${LIVESYSTYPE}-${DEBVMAJ}-base.txt"
+if [ "X$DESKTOP" = "Xxfce" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-xfce.txt"
+elif [ "X$DESKTOP" = "Xgnome" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-gnome.txt"
+elif [ "X$DESKTOP" = "Xmate" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-mate.txt"
+elif [ "X$DESKTOP" = "Xlxde" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lxde.txt"
+elif [ "X$DESKTOP" = "Xcinnamon" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-cinnamon.txt"
+elif [ "X$DESKTOP" = "Xkde" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-kde.txt"
+elif [ "X$DEBVMAJ" != "Xjessie" -a "X$DESKTOP" = "Xlxqt" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lxqt.txt"
+elif [ "X$DESKTOP" = "Xlxqt" ]
+then
+ echo 'E: LXQT is only supported on Debian Stretch'
+ echo 'W: Switching to XFCE'
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-xfce.txt"
+ DESKTOP="xfce"
+ export DESKTOP
+elif [ "X$LIVESYSTYPE" = "Xdktoolian" -a "X$DESKTOP" = "Xnone" ]
+then
+ PKGF="$PKGF"
+else
+ echo 'W: Invalid desktop name' $DESKTOP
+ echo 'W: Using default xfce'
+ echo 'H: Must be one from: xfce gnome mate lxde lxqt cinnamon kde'
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-xfce.txt"
+ DESKTOP="xfce"
+ export DESKTOP
+fi
+
+# Find console font when building a CLI live system
+# -------------------------------------------------
+if [ "X$DESKTOP" = "Xnone" -a "X$CONSOLEFONT" = "XVGA" ]
+then
+ CONSOLEFONT="VGA"
+elif [ "X$DESKTOP" = "Xnone" -a "X$CONSOLEFONT" = "XTerminus" ]
+then
+ CONSOLEFONT="Terminus"
+elif [ "X$DESKTOP" = "Xnone" -a "X$CONSOLEFONT" = "XTerminusBold" ]
+then
+ CONSOLEFONT="TerminusBold"
+elif [ "X$DESKTOP" = "Xnone" -a "X$CONSOLEFONT" = "XTerminusBoldVGA" ]
+then
+ CONSOLEFONT="TerminusBoldVGA"
+elif [ "X$DESKTOP" = "Xnone" -a "X$CONSOLEFONT" = "XFixed" ]
+then
+ CONSOLEFONT="Fixed"
+elif [ "X$DESKTOP" = "Xnone" -a "X$CONSOLEFONT" != "X" ]
+then
+ logverb 'W: Correcting illegal console font' $CONSOLEFONT
+ CONSOLEFONT=""
+fi
+
+if [ "X$ALLOWNONFREE" = "Xyes" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-firmware.txt"
+fi
+
+if [ "X$DESKTOP" != "Xnone" -a "X$ALLOWNONFREE" = "Xyes" -a "X$DEBVMAJ" != "Xjessie" ]
+then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-firmware-gr.txt"
+fi
+logverb 'P: Building package list (base and desktop) done'
+
+
+# Packages for localization
+# -------------------------
+logverb 'P: Building package list (localization)'
+case "X$LANGSHORT" in
+ "Xach")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ $PKGLOC="$PKGLOC $BROWSER-l10n-ach"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xaf")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ $PKGLOC="$PKGLOC $BROWSER-l10n-af"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-af"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xam")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-amharic"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-amharic-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-amharic-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-am"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xan")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-an"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-spanish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xar")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-arabic"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-arabic-desktop $BROWSER-l10n-ar"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-arabic-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ar"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ar.kmap.gz"
+ fi
+ ;;
+ "Xas")
+ PKGLOC="$PKGLOC locales-all"
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-base.txt"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-desktop.txt"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-as"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xast")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-asturian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-asturian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ast"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ast"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xaz")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-az"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-cyrillic-kde-desktop"
+ PKGLOC="$PKGLOC task-russian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xbe")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-belarusian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-belarusian task-belarusian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-be"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-belarusian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-be"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/by.kmap.gz"
+ fi
+ ;;
+ "Xbg")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-bulgarian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-bulgarian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-bg"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-bulgarian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-bg"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/bg-cp1251.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/bg.kmap.gz"
+ fi
+ ;;
+ "Xbn")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-bengali"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-bengali-desktop"
+ fi
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xbn_BD" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-bn-bd"
+ fi
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" != "Xbn_BD" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-bn-in"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-bn"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xbr")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-br"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-french-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-br"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/br-abnt2.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/br-latin1.kmap.gz"
+ fi
+ ;;
+ "Xbs")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-bosnian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-bosnian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-bs"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-bosnian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-bs"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xca")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-catalan"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-catalan-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ca"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-catalan-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ca"
+ $PKGLOC="$PKGLOC libreoffice-help-ca"
+ fi
+ ;;
+ "Xcs")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-czech"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-czech-desktop $BROWSER-l10n-cs"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-czech-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-cs"
+ $PKGLOC="$PKGLOC libreoffice-help-cs"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sunt5-cz-us.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-us-cz.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/cz-us-qwertz.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/cz-us-qwerty.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/cz-lat2-prog.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/cz-lat2.kmap.gz"
+ fi
+ ;;
+ "Xcy")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-welsh"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-welsh-desktop $BROWSER-l10n-cy"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-cy"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xda")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-danish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-danish-desktop $BROWSER-l10n-da"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-danish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-da"
+ $PKGLOC="$PKGLOC libreoffice-help-da"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-dk-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/dk-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/dk.kmap.gz"
+ fi
+ ;;
+ "Xde")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-german"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-german-desktop $BROWSER-l10n-de"
+ fi
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xde_DE" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-dsb"
+ PKGLOC="$PKGLOC $BROWSER-l10n-hsb"
+ fi
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xde_CH" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-rm"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-german-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-de"
+ $PKGLOC="$PKGLOC libreoffice-help-de"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/atari/atari-de-deadkeys.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/atari/atari-de.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/amiga/amiga-de.kmap.gz"
+ [ "X$LANGREG" != "Xde_CH" ] || CONSKEYMAP="/usr/share/keymaps/amiga/amiga-sg.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-de-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-de.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-de-latin1-nodeadkeys.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-de-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-ibook-de.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-ibook-de-deadkeys.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-macbook-de.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-de2-ext.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-de-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-de-latin1-nodeadkeys.kmap.gz"
+ [ "X$LANGREG" != "Xde_CH" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-de_CH.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/de.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/de-latin1-nodeadkeys.kmap.gz"
+ fi
+ ;;
+ "Xdsb")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-german"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-german-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-de"
+ PKGLOC="$PKGLOC $BROWSER-l10n-dsb"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-german-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-de"
+ $PKGLOC="$PKGLOC libreoffice-help-de"
+ fi
+ ;;
+ "Xdz")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-dzongkha"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-dzongkha-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-dzongkha-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-dz"
+ $PKGLOC="$PKGLOC libreoffice-help-dz"
+ fi
+ ;;
+ "Xel")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-greek"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-greek-desktop $BROWSER-l10n-el"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-greek-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-el"
+ $PKGLOC="$PKGLOC libreoffice-help-el"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/gr-pc.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/gr-utf8.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/gr.kmap.gz"
+ fi
+ ;;
+ "Xen")
+ PKGLOC="$PKGLOC locales"
+ PKGLOC="$PKGLOC task-english"
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xen_GB" ]
+ then
+ PKGLOC="$PKGLOC task-british-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-en-gb"
+ PKGLOC="$PKGLOC $BROWSER-l10n-gd"
+ elif [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xen_ZA" ]
+ then
+ PKGLOC="$PKGLOC task-south-african-english-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-en-za"
+ PKGLOC="$PKGLOC $BROWSER-l10n-af"
+ fi
+ if [ "X$DESKTOP" = "Xkde" -a "X$LANGREG" = "Xen_GB" ]
+ then
+ PKGLOC="$PKGLOC task-british-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" -a "X$LANGREG" = "Xen_GB" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-gb"
+ $PKGLOC="$PKGLOC libreoffice-help-en-gb"
+ elif [ "X$ALLOWLIBREOFF" = "Xyes" -a "X$LANGREG" = "Xen_US" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ elif [ "X$ALLOWLIBREOFF" = "Xyes" -a "X$LANGREG" = "Xen_ZA" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-za"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/atari/atari-us-deadkeys.kmap.gz"
+ [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/atari/atari-us.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/atari/atari-uk-deadkeys.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/atari/atari-uk.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/amiga/amiga-us.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/sun/sunt5-uk.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/sun/sunt6-uk.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-uk.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/mac/mac-uk.kmap.gz"
+ [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/mac/mac-us-ext.kmap.gz"
+ [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/mac/mac-us-std.kmap.gz"
+ [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/mac/mac-us.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-uk.kmap.gz"
+ [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-us.kmap.gz"
+ [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/us-intl.iso01.kmap.gz"
+ [ "X$LANGREG" != "Xen_US" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/us-intl.iso15.kmap.gz"
+ [ "X$LANGREG" != "Xen_CA" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/us-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/us.kmap.gz"
+ [ "X$LANGREG" != "Xen_UK" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/uk.kmap.gz"
+ [ "X$LANGREG" != "Xen_CA" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ca-multi.kmap.gz"
+ fi
+ ;;
+ "Xeo")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-esperanto"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-esperanto-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-eo"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-esperanto-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-eo"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xes")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="task-spanish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-spanish-desktop"
+ fi
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xes_AR" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-es-ar"
+ elif [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xes_CL" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-es-cl"
+ elif [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xes_MX" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-es-mx"
+ elif [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-es-es"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-spanish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-es"
+ $PKGLOC="$PKGLOC libreoffice-help-es"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/amiga/amiga-es.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt4-es.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-es.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-es.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-es.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/es.kmap.gz"
+ fi
+ ;;
+ "Xet")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-estonian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-estonian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-et"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-estonian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-et"
+ $PKGLOC="$PKGLOC libreoffice-help-et"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/et.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/et-nodeadkeys.kmap.gz"
+ fi
+ ;;
+ "Xeu")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-basque"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-basque-desktop $BROWSER-l10n-eu"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-basque-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-eu"
+ $PKGLOC="$PKGLOC libreoffice-help-eu"
+ fi
+ ;;
+ "Xfa")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-persian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-persian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-fa"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-persian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-fa"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ar.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/fa.kmap.gz"
+ fi
+ ;;
+ "Xff")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-ff"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xfi")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-finnish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-finnish-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-fi"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-finnish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-fi"
+ $PKGLOC="$PKGLOC libreoffice-help-fi"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt4-fi-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-fi-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-fi-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-fi-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/fi-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-fi-lat6.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-fi-ir209.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/fi.kmap.gz"
+ fi
+ ;;
+ "Xfr")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-french"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-french-desktop $BROWSER-l10n-fr"
+ fi
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xfr_CH" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-rm"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-french-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-fr"
+ $PKGLOC="$PKGLOC libreoffice-help-fr"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/atari/atari-fr.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/amiga/amiga-fr.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-fr-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-fr-bepo-utf8.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-fr-bepo.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-fr.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-macbook-fr.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/mac-usb-fr.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-fr-ext.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-fr.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-fr2-ext.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-fr3.kmap.gz"
+ [ "X$LANGREG" != "Xfr_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/mac-usb-be.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-pc.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-latin0.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-latin9.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr-x11.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/fr.kmap.gz"
+ [ "X$LANGREG" != "Xfr_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/wangbe.kmap.gz"
+ [ "X$LANGREG" != "Xfr_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/be-latin1.kmap.gz"
+ [ "X$LANGREG" != "Xfr_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/be2-latin1.kmap.gz"
+ [ "X$LANGREG" != "Xfr_CH" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-fr_CH-latin1.kmap.gz"
+ [ "X$LANGREG" != "Xfr_CH" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwertz/fr_CH-latin1.kmap.gz"
+ [ "X$LANGREG" != "Xfr_CH" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwertz/fr_CH.kmap.gz"
+ [ "X$LANGREG" != "Xfr_CA" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/cf.kmap.gz"
+ [ "X$LANGREG" != "Xfr_CA" ] || CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ca-multi.kmap.gz"
+ fi
+ ;;
+ "Xfub")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-ff"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xfue")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-ff"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xfuh")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-ff"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xfui")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-ff"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xfuq")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-ff"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xfuv")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-ff"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xfy")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-fy-nl"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-dutch-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xga")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-irish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-irish-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ga-ie"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-irish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ga"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xgd")
+ PKGLOC="$PKGLOC locales task-english"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-british-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-en-gb"
+ PKGLOC="$PKGLOC $BROWSER-l10n-gd"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-gd"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xgl")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-galician"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-galician-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-gl"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-galician-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-gl"
+ $PKGLOC="$PKGLOC libreoffice-help-gl"
+ fi
+ ;;
+ "Xgn")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-portuguese task-spanish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-gn"
+ PKGLOC="$PKGLOC task-spanish-desktop"
+ PKGLOC="$PKGLOC task-portuguese-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-spanish-kde-desktop"
+ PKGLOC="$PKGLOC task-portuguese-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xgu")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-gujarati"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-gujarati task-gujarati-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-gu-in"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-gujarati-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-gu"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xhe")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-hebrew"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-hebrew-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-he"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-hebrew-kde-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xgnome" ]
+ then
+ PKGLOC="$PKGLOC task-hebrew-gnome-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-he"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/hebrew.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/il-heb.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/il.kmap.gz"
+ fi
+ ;;
+ "Xhi")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-hindi"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-hindi-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-hi-in"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-hindi-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-hi"
+ $PKGLOC="$PKGLOC libreoffice-help-hi"
+ fi
+ ;;
+ "Xhr")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-croatian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-croatian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-hr"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-croatian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-hr"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/croat.kmap.gz"
+ fi
+ ;;
+ "Xhsb")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-german"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-german-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-de"
+ PKGLOC="$PKGLOC $BROWSER-l10n-hsb"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-german-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-de"
+ $PKGLOC="$PKGLOC libreoffice-help-de"
+ fi
+ ;;
+ "Xhu")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-hungarian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-hungarian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-hu"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-hungarian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-hu"
+ $PKGLOC="$PKGLOC libreoffice-help-hu"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/hu101.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/hu.kmap.gz"
+ fi
+ ;;
+ "Xhy")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-hy-am"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xid")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-indonesian-desktop"
+ PKGLOC="$BROWSER-l10n-id"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-indonesian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-id"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xis")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-icelandic"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-icelandic-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-is"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-icelandic-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-is"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/is-latin1-us.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/is-latin1.kmap.gz"
+ fi
+ ;;
+ "Xit")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-italian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-italian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-it"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-italian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-it"
+ $PKGLOC="$PKGLOC libreoffice-help-it"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/amiga/amiga-it.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/ibook-it.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-it.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/mac-usb-it.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/it-ibm.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/it.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/it2.kmap.gz"
+ fi
+ ;;
+ "Xja")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-japanese"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-japanese-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ja"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-japanese-kde-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xgnome" ]
+ then
+ PKGLOC="$PKGLOC task-japanese-gnome-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ja"
+ $PKGLOC="$PKGLOC libreoffice-help-ja"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt4-ja.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-ja.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pc110.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/jp106.kmap.gz"
+ fi
+ ;;
+ "Xka")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-cyrillic"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-cyrillic-desktop"
+ PKGLOC="$PKGLOC task-georgian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ar"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-cyrillic-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ka"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xkk")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-kazakh"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-kazakh-desktop $BROWSER-l10n-kk"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-kazakh-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-kk"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/kk.kmap.gz"
+ fi
+ ;;
+ "Xkm")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-khmer"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-khmer-desktop $BROWSER-l10n-km"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-khmer-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-km"
+ $PKGLOC="$PKGLOC libreoffice-help-km"
+ fi
+ ;;
+ "Xkn")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-kannada-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-kn"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-kannada-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xko")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-korean"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-korean-desktop $BROWSER-l10n-ko"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-korean-kde-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xgnome" ]
+ then
+ PKGLOC="$PKGLOC task-korean-gnome-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ko"
+ $PKGLOC="$PKGLOC libreoffice-help-ko"
+ fi
+ ;;
+ "Xku")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-kurdish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-kurdish-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-kurdish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xky")
+ PKGLOC="$PKGLOC locales-all"
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-base.txt"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-desktop.txt"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/kg.kmap.gz"
+ fi
+ ;;
+ "Xla")
+ PKGLOC="$PKGLOC locales-all"
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-base.txt"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-desktop.txt"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/la-latin1.kmap.gz"
+ fi
+ ;;
+ "Xlij")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-lij"
+ fi
+ ;;
+ "Xlt")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-lithuanian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-lithuanian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-lt"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-lithuanian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-lt"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/lt.l4.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/lt.kmap.gz"
+ fi
+ ;;
+ "Xlv")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-latvian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-latvian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-lv"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-latvian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-lv"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/lv-latin4.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/lv-latin7.kmap.gz"
+ fi
+ ;;
+ "Xmai")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-mai"
+ fi
+ ;;
+ "Xmk")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-macedonian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-macedonian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-mk"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-macedonian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-mk"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mk.kmap.gz"
+ fi
+ ;;
+ "Xml")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-malayalam"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-malayalam-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ml"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ms"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-malayalam-kde-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xgnome" ]
+ then
+ PKGLOC="$PKGLOC task-malayalam-gnome-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ml"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xmr")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-marathi"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-marathi-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-mr"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-mr"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xms")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-ms"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xne")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-nepali-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-nepali-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ne"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xnl")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-dutch"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-dutch-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-nlxi"
+ PKGLOC="$PKGLOC $BROWSER-l10n-fy-nl"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-dutch-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-nl"
+ $PKGLOC="$PKGLOC libreoffice-help-nl"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/nl.kmap.gz"
+ [ "X$LANGREG" != "Xnl_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/mac-usb-be.kmap.gz"
+ [ "X$LANGREG" != "Xnl_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/wangbe.kmap.gz"
+ [ "X$LANGREG" != "Xnl_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/be-latin1.kmap.gz"
+ [ "X$LANGREG" != "Xnl_BE" ] || CONSKEYMAP="/usr/share/keymaps/i386/azerty/be2-latin1.kmap.gz"
+ fi
+ ;;
+ "Xnb")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-norwegian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-norwegian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-nb-no"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-nb"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xnn")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-norwegian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-norwegian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-nn-no"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-norwegian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-nn"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xno")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-norwegian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-norwegian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-nb-no"
+ PKGLOC="$PKGLOC $BROWSER-l10n-nn-no"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-norwegian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-nn"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt4-no-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-no.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/no.kmap.gz"
+ fi
+ ;;
+ "Xor")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-or"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-or"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xpa")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-punjabi"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-punjabi-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-pa-in"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-punjabi-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-pa-in"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xpl")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-polish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-polish-desktop $BROWSER-l10n-pl"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-polish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-pl"
+ $PKGLOC="$PKGLOC libreoffice-help-pl"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/sun/sun-pl.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/sun/sun-pl-altgraph.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-pl_m-ext1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/pl-qwertz.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pl.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pl1.kmap.gz"
+ fi
+ ;;
+ "Xpt")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$LANGREG" = "Xpt_BR" ]
+ then
+ PKGLOC="$PKGLOC task-brazilian-portuguese"
+ else
+ PKGLOC="$PKGLOC task-portuguese"
+ fi
+ if [ "X$LANGREG" = "Xpt_BR" -a "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-brazilian-portuguese-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-pt-br"
+ elif [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-portuguese-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-pt-pt"
+ fi
+ if [ "X$LANGREG" = "Xpt_BR" -a "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-brazilian-portuguese-kde-desktop"
+ elif [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-portuguese-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-pt"
+ $PKGLOC="$PKGLOC libreoffice-help-pt"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-pt-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/mac-usb-pt-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pt-old.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/pt-latin1.kmap.gz"
+ fi
+ ;;
+ "Xrm")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-rm"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xro")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-romanian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-romanian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ro"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-romanian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ro"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ro-comma.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ro-academic.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ro.kmap.gz"
+ fi
+ ;;
+ "Xru")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-cyrillic task-russian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-cyrillic-desktop"
+ PKGLOC="$PKGLOC task-russian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-ru"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-cyrillic-kde-desktop"
+ PKGLOC="$PKGLOC task-russian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ru"
+ $PKGLOC="$PKGLOC libreoffice-help-ru"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-ru.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/dvorak/dvorak-ru.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru_win.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru-yawerty.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru-ms.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru-cp1251.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru2.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru3.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ru4.kmap.gz"
+ fi
+ ;;
+ "Xse")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-northern-sami"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-northern-sami-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/atari/atari-se.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/atari/atari-se-deadkeys.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/amiga/amiga-se.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/mac/mac-se.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/mac-usb-se.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-ir209.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-fi-lat6.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-fi-ir209.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/se-lat6.kmap.gz"
+ fi
+ ;;
+ "Xses")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-son"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xsg")
+ PKGLOC="$PKGLOC locales-all"
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-base.txt"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-desktop.txt"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sg-latin1.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sg.kmap.gz"
+ fi
+ ;;
+ "Xsi")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-sinhala-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-si"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-sinhala-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-si"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xsk")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-slovak"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-slovak-desktop $BROWSER-l10n-sk"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-slovak-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-sk"
+ $PKGLOC="$PKGLOC libreoffice-help-sk"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sk-prog.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sk-prog-qwerty.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sk-prog-qwertz.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sk-qwerty.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sk-qwertz.kmap.gz"
+ fi
+ ;;
+ "Xsl")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-slovenian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-slovenian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-sl"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-sl"
+ $PKGLOC="$PKGLOC libreoffice-help-sl"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/slovene.kmap.gz"
+ fi
+ ;;
+ "Xson")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-son"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xsq")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-albanian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-sq"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xsr")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-serbian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-serbian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-sr"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-serbian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/sr-cy.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwertz/sr.kmap.gz"
+ fi
+ ;;
+ "Xsv")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-swedish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-swedish-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-sv-se"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-swedish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-sv"
+ $PKGLOC="$PKGLOC libreoffice-help-sv"
+ fi
+ ;;
+ "Xta")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-tamil"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-tamil-desktop $BROWSER-l10n-ta"
+ fi
+ if [ "X$DESKTOP" = "Xgnome" ]
+ then
+ PKGLOC="$PKGLOC task-tamil-gnome-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ta"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xte")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-telugu"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-telugu-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-telugu-kde-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xgnome" ]
+ then
+ PKGLOC="$PKGLOC task-telugu-gnome-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-te"
+ $PKGLOC="$PKGLOC libreoffice-help-te"
+ fi
+ ;;
+ "Xth")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-thai"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-thai-desktop $BROWSER-l10n-th"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-thai-kde-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xgnome" ]
+ then
+ PKGLOC="$PKGLOC task-thai-gnome-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-th"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/th-tis.kmap.gz"
+ fi
+ ;;
+ "Xtl")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-tagalog task-english"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-all"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xtr")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-turkish"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-turkish-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-tr"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-turkish-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-tr"
+ $PKGLOC="$PKGLOC libreoffice-help-tr"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/sun/sunt5-trqalt.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/tr_q-latin5.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/tralt.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/trq.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/fgGIod/trfu.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/fgGIod/tr_f-latin5.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/fgGIod/trf.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/trqu.kmap.gz"
+ fi
+ ;;
+ "Xug")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-uyghur"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-uyghur-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-uyghur-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-ug"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xuk")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-ukrainian"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-ukrainian-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-uk"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-ukrainian-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-uk"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/ua.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/uaw_uni.kmap.gz"
+ CONSKEYMAP="/usr/share/keymaps/i386/qwerty/uaw.kmap.gz"
+ fi
+ ;;
+ "Xuz")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-uz"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-uz"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xvi")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-vietnamese-desktop"
+ PKGLOC="$PKGLOC $BROWSER-l10n-vi"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-vietnamese-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-vi"
+ $PKGLOC="$PKGLOC libreoffice-help-vi"
+ fi
+ ;;
+ "Xwo")
+ PKGLOC="$PKGLOC locales-all"
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-base.txt"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-desktop.txt"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ if [ "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" = "X" -a "X$DEBVMAJ" = "Xjessie" ]
+ then
+ CONSKEYMAP="/usr/share/keymaps/i386/azerty/wo.kmap.gz"
+ fi
+ ;;
+ "Xxh")
+ PKGLOC="$PKGLOC locales-all"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-xhosa-desktop $BROWSER-l10n-xh"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-xhosa-kde-desktop"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-xh"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+ "Xza")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-chinese-s task-chinese-t"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-chinese-s-desktop"
+ PKGLOC="$PKGLOC task-chinese-t-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-chinese-s-kde-desktop"
+ PKGLOC="$PKGLOC task-chinese-t-kde-desktop"
+ fi
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xzh_TW" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-zh-tw"
+ elif [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-zh-cn"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" -a "X$LANGREG" = "Xzh_TW" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-zh-tw"
+ $PKGLOC="$PKGLOC libreoffice-help-zh-tw"
+ elif [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-zh-cn"
+ $PKGLOC="$PKGLOC libreoffice-help-zh-cn"
+ fi
+ ;;
+ "Xzh")
+ PKGLOC="$PKGLOC locales-all"
+ PKGLOC="$PKGLOC task-chinese-s task-chinese-t"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC task-chinese-s-desktop"
+ PKGLOC="$PKGLOC task-chinese-t-desktop"
+ fi
+ if [ "X$DESKTOP" = "Xkde" ]
+ then
+ PKGLOC="$PKGLOC task-chinese-s-kde-desktop"
+ PKGLOC="$PKGLOC task-chinese-t-kde-desktop"
+ fi
+ if [ "X$DESKTOP" != "Xnone" -a "X$LANGREG" = "Xzh_TW" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-zh-tw"
+ elif [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGLOC="$PKGLOC $BROWSER-l10n-zh-cn"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" -a "X$LANGREG" = "Xzh_TW" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-zh-tw"
+ $PKGLOC="$PKGLOC libreoffice-help-zh-tw"
+ elif [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-zh-cn"
+ $PKGLOC="$PKGLOC libreoffice-help-zh-cn"
+ fi
+ ;;
+ "*")
+ PKGLOC="$PKGLOC locales-all"
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-base.txt"
+ if [ "X$DESKTOP" != "Xnone" ]
+ then
+ PKGF="$PKGF pkg-${LIVESYSTYPE}-${DEBVMAJ}-lang-desktop.txt"
+ fi
+ if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+ then
+ $PKGLOC="$PKGLOC libreoffice-l10n-en-us"
+ $PKGLOC="$PKGLOC libreoffice-help-en-us"
+ fi
+ ;;
+esac
+logverb 'P: Building package list (localization) done'
+
+# Packages for LibreOffice
+# ------------------------
+if [ "X$ALLOWLIBREOFF" = "Xyes" ]
+then
+ logverb 'P: Adding libreoffice packages'
+ PKGF="$PKGF pkg-disklessian-${DEBVMAJ}-libreoffice.txt"
+ logverb 'P: Adding libreoffice packages done'
+fi
+
+# NTP related packages
+# --------------------
+logverb 'P: Building package list (NTP)'
+if [ "X$NTPSERVER" != "X" -a "X$USENTPDAEMON" != "Xyes" ]
+then
+ PKGNAMES="$PKGNAMES ntpdate"
+else
+ PKGNAMES="$PKGNAMES ntp"
+fi
+logverb 'P: Building package list (NTP) done'
+
+
+# Configure live system
+# =====================
+
+# Change into live system directory
+# ---------------------------------
+cd livesys
+
+# Set to verbose
+# --------------
+if [ "X$VERBOSE" = "Xyes" ]
+then
+ OPTCONF="$OPTCONF --verbose"
+fi
+
+# Options for live system type
+# ----------------------------
+logverb 'P: Setting OPTCONF (live system type)'
+if [ "X$LIVETYPE" = "Xnfs" -a "X$NFSSERVER" != "X" -a "X$NFSPATH" != "X" ]
+then
+ OPTCONF="$OPTCONF -b netboot"
+ OPTCONF="$OPTCONF --net-root-server $NFSSERVER"
+ OPTCONF="$OPTCONF --net-root-path $NFSPATH"
+elif [ "X$LIVETYPE" = "Xhdd" ]
+then
+ OPTCONF="$OPTCONF -b hdd"
+elif [ "X$LIVETYPE" = "Xnfs" ]
+then
+ echo 'E: Missing NFSSERVER and/or NFSPATH configuration!'
+ echo 'H: Options LIVETYPE=nfs requires to set NFSSERVER and NFSPATH.'
+ exit 1
+fi
+logverb 'P: Setting OPTCONF (live system type) done'
+
+# Save disk space by avoiding apt indices
+# ---------------------------------------
+if [ "X$ALLOWAPTINDICES" != "Xyes" ]
+then
+ logverb 'P: Setting OPTCONF (apt indices)'
+ OPTCONF="$OPTCONF --apt-indices false"
+ logverb 'P: Setting OPTCONF (apt indices) done'
+fi
+
+# Save disk space by avoiding recommended packages for CLI live systems
+# ---------------------------------------------------------------------
+logverb 'P: Setting OPTCONF (apt recommends)'
+if [ "X$DESKTOP" = "Xnone" -a "X$APTRECOMMENDS" != "Xyes" ]
+then
+ OPTCONF="$OPTCONF --apt-recommends false"
+fi
+logverb 'P: Setting OPTCONF (apt recommends) done'
+
+# Include firmware into live system
+# ---------------------------------
+logverb 'P: Setting OPTCONF (firmware chroot)'
+OPTCONF="$OPTCONF --firmware-chroot true"
+logverb 'P: Setting OPTCONF (firmware chroot) done'
+
+# No firmware in the binary stage, the live system does not contain installers.
+# -----------------------------------------------------------------------------
+logverb 'P: Setting OPTCONF (firmware binary)'
+OPTCONF="$OPTCONF --firmware-binary false"
+logverb 'P: Setting OPTCONF (firmware binary) done'
+
+# No memory test program in live system
+# -------------------------------------
+# logverb 'P: Setting OPTCONF (exclude memory test)'
+# OPTCONF="$OPTCONF --memtest none"
+# logverb 'P: Setting OPTCONF (exclude memory test) done'
+
+# Do not require valid signatures
+# -------------------------------
+logverb 'P: Setting OPTCONF (unsigned packages)'
+if [ "X$ALLOWUNSIGNEDPKG" = "Xyes" ]
+then
+ OPTCONF="$OPTCONF --apt-secure false"
+fi
+logverb 'P: Setting OPTCONF (unsigned packages) done'
+
+# Use mirrors as configured
+# -------------------------
+logverb 'P: Setting OPTCONF (mirrors)'
+if [ "X$PARENTMIRRORBOOTSTRAP" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-bootstrap $PARENTMIRRORBOOTSTRAP"
+fi
+if [ "X$PARENTMIRRORCHROOT" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-chroot $PARENTMIRRORCHROOT"
+fi
+if [ "X$PARENTMIRRORCHROOTSECURITY" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-chroot-security $PARENTMIRRORCHROOTSECURITY"
+fi
+if [ "X$PARENTMIRRORCHROOTUPDATES" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-chroot-updates $PARENTMIRRORCHROOTUPDATES"
+fi
+if [ "X$PARENTMIRRORCHROOTBACKPORTS" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-chroot-backports $PARENTMIRRORCHROOTBACKPORTS"
+fi
+if [ "X$PARENTMIRRORBINARY" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-binary $PARENTMIRRORBINARY"
+fi
+if [ "X$PARENTMIRRORBINARYSECURITY" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-binary-security $PARENTMIRRORBINARYSECURITY"
+fi
+if [ "X$PARENTMIRRORBINARYUPDATES" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-binary-updates $PARENTMIRRORBINARYUPDATES"
+fi
+if [ "X$PARENTMIRRORBINARYBACKPORTS" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-binary-backports $PARENTMIRRORBINARYBACKPORTS"
+fi
+if [ "X$PARENTMIRRORDEBIANINSTALLER" != "X" ]
+then
+OPTCONF="$OPTCONF --parent-mirror-debian-installer $PARENTMIRRORDEBIANINSTALLER"
+fi
+if [ "X$MIRRORBOOTSTRAP" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-bootstrap $MIRRORBOOTSTRAP"
+fi
+if [ "X$MIRRORCHROOT" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-chroot $MIRRORCHROOT"
+fi
+if [ "X$MIRRORCHROOTSECURITY" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-chroot-security $MIRRORCHROOTSECURITY"
+fi
+if [ "X$MIRRORCHROOTUPDATES" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-chroot-updates $MIRRORCHROOTUPDATES"
+fi
+if [ "X$MIRRORCHROOTBACKPORTS" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-chroot-backports $MIRRORCHROOTBACKPORTS"
+fi
+if [ "X$MIRRORBINARY" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-binary $MIRRORBINARY"
+fi
+if [ "X$MIRRORBINARYSECURITY" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-binary-security $MIRRORBINARYSECURITY"
+fi
+if [ "X$MIRRORBINARYUPDATES" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-binary-updates $MIRRORBINARYUPDATES"
+fi
+if [ "X$MIRRORBINARYBACKPORTS" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-binary-backports $MIRRORBINARYBACKPORTS"
+fi
+if [ "X$MIRRORDEBIANINSTALLER" != "X" ]
+then
+OPTCONF="$OPTCONF --mirror-debian-installer $MIRRORDEBIANINSTALLER"
+fi
+logverb 'P: Setting OPTCONF (mirrors) done'
+
+# Live system kernel parameters
+# -----------------------------
+logverb 'P: Setting OPTLIVEAPPEND (live components)'
+OPTLIVEAPPEND="boot=live components live-config.utc=no"
+logverb 'P: Setting OPTLIVEAPPEND (live components) done'
+
+# Locale settings in kernel parameters
+# ------------------------------------
+logverb 'P: Setting OPTLIVEAPPEND (localization)'
+if [ "X$LIVEAPPENDLOCALES" != "X" -a "X$LIVEAPPENDLOCALES" != "X-" ]
+then
+ OPTLIVEAPPEND="$OPTLIVEAPPEND live-config.locales=$LIVEAPPENDLOCALES"
+ OPTLIVEAPPEND="$OPTLIVEAPPEND locales=$LIVEAPPENDLOCALES"
+fi
+logverb 'P: Setting OPTLIVEAPPEND (localization) done'
+
+# Keyboard layout in kernel parameters
+# ------------------------------------
+logverb 'P: Setting OPTLIVEAPPEND (keyboard layouts)'
+if [ "X$LIVEAPPENDKBDLAYOUTS" != "X" -a "X$LIVEAPPENDKBDLAYOUTS" != "X-" ]
+then
+ fn=live-config.keyboard-layouts
+ OPTLIVEAPPEND="$OPTLIVEAPPEND $fn=$LIVEAPPENDKBDLAYOUTS"
+fi
+logverb 'P: Setting OPTLIVEAPPEND (keyboard layouts) done'
+
+# Time zone in kernel parameters
+# ------------------------------
+logverb 'P: Setting OPTLIVEAPPEND (timezone)'
+if [ "X$LIVEAPPENDTIMEZONE" != "X" -a "X$LIVEAPPENDTIMEZONE" != "X-" ]
+then
+ OPTLIVEAPPEND="$OPTLIVEAPPEND live-config.timezone=$LIVEAPPENDTIMEZONE"
+fi
+logverb 'P: Setting OPTLIVEAPPEND (timezone) done'
+
+# Custom kernel arguments
+# -----------------------
+logverb 'P: Setting OPTLIVEAPPEND (custom arguments)'
+OPTLIVEAPPEND="$OPTLIVEAPPEND $LIVEAPPENDCUSTOM"
+logverb 'P: Setting OPTLIVEAPPEND (custom arguments) done'
+
+# VGA settings
+# ------------
+if [ "X$LIVEAPPENDVGA" != "X" -a "X$DESKTOP" = "Xnone" ]
+then
+ OPTLIVEAPPEND="$OPTLIVEAPPEND nomodeset vga=$LIVEAPPENDVGA"
+fi
+
+# Network settings in kernel parameters
+# -------------------------------------
+logverb 'P: Setting OPTLIVEAPPEND (network)'
+if [ "X$LIVEAPPENDIP" != "X" ]
+then
+ OPTLIVEAPPEND="$OPTLIVEAPPEND ip=$LIVEAPPENDIP"
+fi
+logverb 'P: Setting OPTLIVEAPPEND (network) done'
+
+# NFS server and path in kernel parameters
+# ----------------------------------------
+logverb 'P: Setting OPTLIVEAPPEND (nfs)'
+if [ "X$LIVETYPE" = "Xnfs" ]
+then
+ OPTLIVEAPPEND="$OPTLIVEAPPEND netboot=nfs"
+ OPTLIVEAPPEND="$OPTLIVEAPPEND nfsroot=${NFSSERVER}:${NFSPATH}"
+fi
+logverb 'P: Setting OPTLIVEAPPEND (nfs) done'
+
+# For debugging we might write output to second serial console (ttyS1)
+# and first real console (tty0). First real console (tty0) is used for input.
+# ---------------------------------------------------------------------------
+if [ "X$SERIALCONSOLE" = "Xyes" ]
+then
+ OPTLIVEAPPEND="$OPTLIVEAPPEND console=ttyS1 console=tty0"
+fi
+
+# Run lb config
+# -------------
+# Disklessian/DkToolian - nonfree - unsigned
+# For Disklessian we have to specify kernel packages and kernel flavour.
+# DkToolian uses a standard kernel.
+
+logverb 'P: Run "lb config ..."'
+if [ "X$MDL" = "Xyes" -a "X$ALLOWNONFREE" = "Xyes" -a "X$ALLOWUNSIGNEDPKG" = "Xyes" ]
+then
+ echo lb config \
+ $OPTCONF \
+ --archive-areas "main contrib non-free" \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes --allow-unauthenticated" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DISKLESSIAN \
+ --linux-packages "linux-image-${KERNELVERSION}-no-hd" \
+ --linux-flavours "${KERNELFLAVOUR}" \
+ --bootappend-live "$OPTLIVEAPPEND"
+ lb config \
+ $OPTCONF \
+ --archive-areas "main contrib non-free" \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes --allow-unauthenticated" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DISKLESSIAN \
+ --linux-packages "linux-image-${KERNELVERSION}-no-hd" \
+ --linux-flavours "${KERNELFLAVOUR}" \
+ --bootappend-live "$OPTLIVEAPPEND" 2>&1 | tee errors.lb_config
+ [ "X$?" = "X0" ] || EXVAL=1
+elif [ "X$MDL" = "Xyes" -a "X$ALLOWNONFREE" = "Xyes" ]
+then
+ echo lb config \
+ $OPTCONF \
+ --archive-areas "main contrib non-free" \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DISKLESSIAN \
+ --linux-packages "linux-image-${KERNELVERSION}-no-hd" \
+ --linux-flavours "${KERNELFLAVOUR}" \
+ --bootappend-live "$OPTLIVEAPPEND"
+ lb config \
+ $OPTCONF \
+ --archive-areas "main contrib non-free" \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DISKLESSIAN \
+ --linux-packages "linux-image-${KERNELVERSION}-no-hd" \
+ --linux-flavours "${KERNELFLAVOUR}" \
+ --bootappend-live "$OPTLIVEAPPEND" 2>&1 | tee errors.lb_config
+ [ "X$?" = "X0" ] || EXVAL=1
+elif [ "X$MDL" = "Xyes" -a "X$ALLOWUNSIGNEDPKG" = "Xyes" ]
+then
+ echo lb config \
+ $OPTCONF \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes --allow-unauthenticated" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DISKLESSIAN \
+ --linux-packages "linux-image-${KERNELVERSION}-no-hd" \
+ --linux-flavours "${KERNELFLAVOUR}" \
+ --bootappend-live "$OPTLIVEAPPEND"
+ lb config \
+ $OPTCONF \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes --allow-unauthenticated" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DISKLESSIAN \
+ --linux-packages "linux-image-${KERNELVERSION}-no-hd" \
+ --linux-flavours "${KERNELFLAVOUR}" \
+ --bootappend-live "$OPTLIVEAPPEND" 2>&1 | tee errors.lb_config
+ [ "X$?" = "X0" ] || EXVAL=1
+elif [ "X$MDL" = "Xyes" ]
+then
+ echo lb config \
+ $OPTCONF \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DISKLESSIAN \
+ --linux-packages "linux-image-${KERNELVERSION}-no-hd" \
+ --linux-flavours "${KERNELFLAVOUR}" \
+ --bootappend-live "$OPTLIVEAPPEND"
+ lb config \
+ $OPTCONF \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DISKLESSIAN \
+ --linux-packages "linux-image-${KERNELVERSION}-no-hd" \
+ --linux-flavours "${KERNELFLAVOUR}" \
+ --bootappend-live "$OPTLIVEAPPEND" 2>&1 | tee errors.lb_config
+ [ "X$?" = "X0" ] || EXVAL=1
+elif [ "X$ALLOWNONFREE" = "Xyes" -a "X$ALLOWUNSIGNEDPKG" = "Xyes" ]
+then
+ echo lb config \
+ $OPTCONF \
+ --archive-areas "main contrib non-free" \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes --allow-unauthenticated" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DKTOOLIAN \
+ --bootappend-live "$OPTLIVEAPPEND"
+ lb config \
+ $OPTCONF \
+ --archive-areas "main contrib non-free" \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes --allow-unauthenticated" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DKTOOLIAN \
+ --bootappend-live "$OPTLIVEAPPEND" 2>&1 | tee errors.lb_config
+ [ "X$?" = "X0" ] || EXVAL=1
+elif [ "X$ALLOWNONFREE" = "Xyes" ]
+then
+ echo lb config \
+ $OPTCONF \
+ --archive-areas "main contrib non-free" \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DKTOOLIAN \
+ --bootappend-live "$OPTLIVEAPPEND"
+ lb config \
+ $OPTCONF \
+ --archive-areas "main contrib non-free" \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DKTOOLIAN \
+ --bootappend-live "$OPTLIVEAPPEND" 2>&1 | tee errors.lb_config
+ [ "X$?" = "X0" ] || EXVAL=1
+elif [ "X$ALLOWUNSIGNEDPKG" = "Xyes" ]
+then
+ echo lb config \
+ $OPTCONF \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes --allow-unauthenticated" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DKTOOLIAN \
+ --bootappend-live "$OPTLIVEAPPEND"
+ lb config \
+ $OPTCONF \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes --allow-unauthenticated" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DKTOOLIAN \
+ --bootappend-live "$OPTLIVEAPPEND" 2>&1 | tee errors.lb_config
+ [ "X$?" = "X0" ] || EXVAL=1
+else
+ echo lb config \
+ $OPTCONF \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DKTOOLIAN \
+ --bootappend-live "$OPTLIVEAPPEND"
+ lb config \
+ $OPTCONF \
+ --debootstrap-options "--variant=minbase --include=${LBCINC}" \
+ --apt-options "--yes" \
+ --iso-publisher "$PUBLISHER" \
+ --iso-volume DKTOOLIAN \
+ --bootappend-live "$OPTLIVEAPPEND" 2>&1 | tee errors.lb_config
+ [ "X$?" = "X0" ] || EXVAL=1
+fi
+
+if [ "X$EXVAL" = "X0" ]
+then
+ [ "X$VERBOSE" != "Xyes" ] || echo 'P: Finished configuring live system'
+else
+ echo 'E: Failed to configure live system!'
+ echo 'H: See file errors.lb_config for details.'
+ exit 1
+fi
+logverb 'P: Run "lb config ..." done'
+
+# Create directories
+# ------------------
+logverb 'P: Create directories'
+crdir config
+crdir config/includes.chroot
+crdir config/includes.chroot/usr
+crdir config/includes.chroot/usr/share
+crdir config/includes.chroot/usr/share/${LIVESYSTYPE}
+crdir config/includes.chroot/usr/share/dklivesys
+crdir config/includes.chroot/usr/share/dklivesys/etc
+crdir config/includes.chroot/usr/share/dklivesys/sed
+crdir config/includes.chroot/usr/share/dklivesys/initramfs
+crdir config/includes.chroot/usr/share/doc
+crdir config/includes.chroot/usr/share/doc/dktools
+crdir config/includes.chroot/usr/share/doc/${LIVESYSTYPE}
+crdir config/includes.chroot/usr/local
+crdir config/includes.chroot/usr/local/bin
+crdir config/includes.chroot/etc
+crdir config/includes.chroot/etc/apt
+crdir config/includes.chroot/etc/default
+crdir config/includes.chroot/etc/init.d
+crdir config/includes.chroot/etc/modprobe.d
+crdir config/includes.chroot/etc/systemd
+crdir config/includes.chroot/etc/systemd/network
+crdir config/includes.chroot/etc/systemd/system
+crdir config/includes.chroot/etc/initramfs-tools
+crdir config/includes.chroot/etc/initramfs-tools/hooks
+crdir config/package-lists
+if [ "X$DESKTOP" = "Xgnome" ]
+then
+ crdir config/includes.chroot/etc/dconf
+ crdir config/includes.chroot/etc/dconf/profile
+ crdir config/includes.chroot/etc/dconf/db
+ crdir config/includes.chroot/etc/dconf/db/local.d
+ crdir config/includes.chroot/etc/dconf/db/site.d
+fi
+logverb 'P: Create directories done'
+
+# Copyright and license files
+# ---------------------------
+logverb 'P: Add copyright and license files'
+for i in README LICENSE bsdlic.txt
+do
+ logverb 'P:' "cp ../$i ${ICHR}/usr/share/doc/${LIVESYSTYPE}/$i"
+ cp ../$i "${ICHR}/usr/share/doc/${LIVESYSTYPE}/$i"
+ logverb 'P:' "chmod 644 ${ICHR}/usr/share/doc/${LIVESYSTYPE}/$i"
+ chmod 644 "${ICHR}/usr/share/doc/${LIVESYSTYPE}/$i"
+done
+logverb 'P: Add copyright and license files done'
+
+# Configuration file to use repository containing modified kernel
+# and public key used for kernel signing
+# ---------------------------------------------------------------
+if [ "X$LIVESYSTYPE" = "Xdisklessian" ]
+then
+
+logverb 'P:' cp ${DIR}/livesys-data/apt-disklessian-${DEBVMAJ}.txt config/archives/disklessian.list.chroot
+cp ${DIR}/livesys-data/apt-disklessian-${DEBVMAJ}.txt config/archives/disklessian.list.chroot
+logverb 'P:' cp "${PUBKEYFILE}" config/archives/disklessian.key.chroot
+cp "${PUBKEYFILE}" config/archives/disklessian.key.chroot
+fi
+
+# Files for apt pinning (avoid some recommended packages)
+# -------------------------------------------------------
+if [ "X$ALLOWLIBREOFF" != "Xyes" ]
+then
+logverb 'P: Write apt pinning file to avoid some recommended packages'
+logverb 'P:' cp ../livesys-data/apt-no-lo-recommended.txt config/archives/apt-pinning.pref.chroot
+cp ../livesys-data/apt-no-lo-recommended.txt config/archives/apt-pinning.pref.chroot
+logverb 'P:' cp ../livesys-data/apt-no-lo-recommended.txt "${ICHR}/etc/apt/preferences"
+cp ../livesys-data/apt-no-lo-recommended.txt "${ICHR}/etc/apt/preferences"
+logverb 'P: Write apt pinning file to avoid some recommended packages done'
+fi
+
+# Files to avoid kernel updates
+if [ "X$LIVESYSTYPE" = "Xdisklessian" ]
+then
+logverb 'P: Write apt pinning file to avoid kernel updates'
+cat ../livesys-data/apt-pin-kernel.txt >> "${ICHR}/etc/apt/preferences"
+logverb 'P: Write apt pinning file to avoid kernel updates done'
+fi
+
+# Avoid use of NVMe attached SSD drives
+# -------------------------------------
+if [ "X$LIVESYSTYPE" = "Xdisklessian" ]
+then
+logverb 'P: Write blacklist for nvme modules'
+cat - > "${ICHR}/etc/modprobe.d/nvme-blacklist.conf" <<EOF
+blacklist nvme
+blacklist nvme_core
+EOF
+chmod 644 "${ICHR}/etc/modprobe.d/nvme-blacklist.conf"
+logverb 'P: Write blacklist for nvme modules done'
+fi
+
+
+# Add files to include
+# ====================
+
+# /etc/default/locale and /etc/timezone
+# -------------------------------------
+logverb 'P: Create /etc/default/locale'
+if [ "X$LANGFULL" != "X" ]
+then
+ echo "# File generated by update-locale" > "${ICHR}/etc/default/locale"
+ echo "LANG=$LANGFULL" >> "${ICHR}/etc/default/locale"
+ chmod 755 "${ICHR}/etc/default/locale"
+fi
+logverb 'P: Create /etc/default/locale done'
+logverb 'P: Create /etc/timezone'
+if [ "X$LIVEAPPENDTIMEZONE" != "X" ]
+then
+ echo $LIVEAPPENDTIMEZONE > "${ICHR}/etc/timezone"
+ chmod 644 "${ICHR}/etc/timezone"
+fi
+logverb 'P: Create /etc/timezone done'
+
+dircopy() {
+ local SRC
+ local DST
+ SRC="$1"
+ DST="$2"
+ if [ ! -d "$DST" ]
+ then
+ mkdir -p "$DST"
+ chmod 755 "$DST"
+ fi
+ if [ -d "$SRC" ]
+ then
+ logverb 'P: Copy' $SRC to $DST
+ (cd "$SRC" ; tar cf - *) | (cd "$DST" ; umask 0 ; tar xf -)
+ fi
+}
+
+# Files to inject to live systems file system
+# -------------------------------------------
+dircopy "${DSRC}/root" "${ICHR}"
+dircopy "${DSRC}/root-${LIVETYPE}" "${ICHR}"
+dircopy "${DSRC}/root-${DESKTOP}" "${ICHR}"
+dircopy "${DSRC}/root-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DSRC}/root-${DEBVMAJ}" "${ICHR}"
+dircopy "${DSRC}/root-${DEBVMAJ}-${LIVETYPE}" "${ICHR}"
+dircopy "${DSRC}/root-${DEBVMAJ}-${DESKTOP}" "${ICHR}"
+dircopy "${DSRC}/root-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DSRC}/root-${LIVESYSTYPE}" "${ICHR}"
+dircopy "${DSRC}/root-${LIVESYSTYPE}-${LIVETYPE}" "${ICHR}"
+dircopy "${DSRC}/root-${LIVESYSTYPE}-${DESKTOP}" "${ICHR}"
+dircopy "${DSRC}/root-${LIVESYSTYPE}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DSRC}/root-${LIVESYSTYPE}-${DEBVMAJ}" "${ICHR}"
+dircopy "${DSRC}/root-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE}" "${ICHR}"
+dircopy "${DSRC}/root-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}" "${ICHR}"
+dircopy "${DSRC}/root-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+
+dircopy "${DIR}/custom/root" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVETYPE}" "${ICHR}"
+dircopy "${DIR}/custom/root-${DESKTOP}" "${ICHR}"
+dircopy "${DIR}/custom/root-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DIR}/custom/root-${DEBVMAJ}" "${ICHR}"
+dircopy "${DIR}/custom/root-${DEBVMAJ}-${LIVETYPE}" "${ICHR}"
+dircopy "${DIR}/custom/root-${DEBVMAJ}-${DESKTOP}" "${ICHR}"
+dircopy "${DIR}/custom/root-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVESYSTYPE}" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVESYSTYPE}-${LIVETYPE}" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVESYSTYPE}-${DESKTOP}" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVESYSTYPE}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVESYSTYPE}-${DEBVMAJ}" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE}" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}" "${ICHR}"
+dircopy "${DIR}/custom/root-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+
+if [ "X${DATADIR}" != "X-" ]
+then
+dircopy "${DATADIR}" "${ICHR}"
+dircopy "${DATADIR}-${LIVETYPE}" "${ICHR}"
+dircopy "${DATADIR}-${DESKTOP}" "${ICHR}"
+dircopy "${DATADIR}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DATADIR}-${DEBVMAJ}" "${ICHR}"
+dircopy "${DATADIR}-${DEBVMAJ}-${LIVETYPE}" "${ICHR}"
+dircopy "${DATADIR}-${DEBVMAJ}-${DESKTOP}" "${ICHR}"
+dircopy "${DATADIR}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DATADIR}-${LIVESYSTYPE}" "${ICHR}"
+dircopy "${DATADIR}-${LIVESYSTYPE}-${LIVETYPE}" "${ICHR}"
+dircopy "${DATADIR}-${LIVESYSTYPE}-${DESKTOP}" "${ICHR}"
+dircopy "${DATADIR}-${LIVESYSTYPE}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+dircopy "${DATADIR}-${LIVESYSTYPE}-${DEBVMAJ}" "${ICHR}"
+dircopy "${DATADIR}-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE}" "${ICHR}"
+dircopy "${DATADIR}-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}" "${ICHR}"
+dircopy "${DATADIR}-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${ICHR}"
+fi
+
+
+# Files to inject to initramfs file system
+# -------------------------------------------
+
+dircopy "${DSRC}/initramfs" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVETYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${DESKTOP}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${DESKTOP}-${LIVETYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${DEBVMAJ}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${DEBVMAJ}-${LIVETYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${DEBVMAJ}-${DESKTOP}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVESYSTYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVESYSTYPE}-${LIVETYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVESYSTYPE}-${DESKTOP}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVESYSTYPE}-${DESKTOP}-${LIVETYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}" "${INITRD}"
+dircopy "${DSRC}/initramfs-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${INITRD}"
+
+dircopy "${DIR}/custom/initramfs" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVETYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${DESKTOP}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${DESKTOP}-${LIVETYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${DEBVMAJ}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${DEBVMAJ}-${LIVETYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${DEBVMAJ}-${DESKTOP}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVESYSTYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVESYSTYPE}-${LIVETYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVESYSTYPE}-${DESKTOP}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVESYSTYPE}-${DESKTOP}-${LIVETYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}" "${INITRD}"
+dircopy "${DIR}/custom/initramfs-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}" "${INITRD}"
+
+# Only if there is any file to copy into the initramfs file system
+# produce an initramfs hook
+
+USEINITRDHOOK="no"
+for i in `find "${INITRD}" -type f`
+do
+ USEINITRDHOOK="yes"
+done
+if [ "X${USEINITRDHOOK}" = "Xyes" ]
+then
+INITRDHOOKFILE="${ICHR}/etc/initramfs-tools/hooks/9990_inject_files"
+cat - > "${INITRDHOOKFILE}" <<EOF
+#! /bin/sh -e
+PREREQS=""
+case \$1 in
+ prereqs) echo "\${PREREQS}"; exit 0;;
+esac
+. /usr/share/initramfs-tools/hook-functions
+echo 'P: /etc/initramfs-tools/hooks/9990_inject_files (start)'
+umask 0
+for i in \`find /usr/share/dklivesys/initramfs -type f\`
+do
+j=\`echo \$i | sed -e 's/\\/usr\\/share\\/dklivesys\\/initramfs//g'\`
+k=\`basename \$i\`
+echo 'P: copy_file' "\$k" "\$i" "\$j"
+if [ -x "\$i" ]
+then
+ echo 'P: copy_exec' \$i \$j
+ copy_exec "\$i" "\$j"
+else
+ echo 'P: copy_file config' \$i \$j
+ copy_file config "\$i" "\$j"
+fi
+done
+echo 'P: /etc/initramfs-tools/hooks/9990_inject_files (finished)'
+EOF
+chmod 755 "${INITRDHOOKFILE}"
+fi
+
+
+# Files for Gnome 3 defaults
+# --------------------------
+if [ "X$DESKTOP" = "Xgnome" ]
+then
+logverb 'P: Copy Gnome default files'
+cp "${DSRC}/conf-gnome-dconf-profile-user.txt" "${ICHR}/etc/dconf/profile/user"
+chmod 644 "${ICHR}/etc/dconf/profile/user"
+cp "${DSRC}/conf-gnome-defaults.txt" "${ICHR}/etc/dconf/db/local.d/01-setup"
+chmod 644 "${ICHR}/etc/dconf/db/local.d/01-setup"
+logverb 'P: Copy Gnome default files done'
+fi
+
+
+# For sddm (used by kde and lxqt) we have to correct the sddm.conf file
+# ---------------------------------------------------------------------
+if [ "X$DESKTOP" = "Xlxqt" ]
+then
+ echo 'P: Using lxqt desktop for sddm'
+ SDDMDT="lxqt.desktop"
+elif [ "X$DESKTOP" = "Xkde" ]
+then
+ echo 'P: Using plasma desktop for sddm'
+ SDDMDT="plasma.desktop"
+else
+ echo 'P: No desktop using sddm'
+fi
+logverb 'I: SDDMDT =' $SDDMDT
+if [ "X$SDDMDT" != "X" ]
+then
+logverb 'P: Install hook for sddm'
+cat - > "${ICHR}/etc/sddm.conf" <<EOF
+[Autologin]
+# Whether sddm should automatically log back into sessions when they exit
+Relogin=false
+
+# Name of session file for autologin session
+Session=$SDDMDT
+
+# Username for autologin session
+User=user
+
+
+[General]
+# Enable Qt's automatic high-DPI scaling
+EnableHiDPI=false
+
+# Halt command
+HaltCommand=/bin/systemctl poweroff
+
+# Input method module
+InputMethod=
+
+# Initial NumLock state. Can be on, off or none.
+# If property is set to none, numlock won't be changed
+# NOTE: Currently ignored if autologin is enabled.
+Numlock=none
+
+# Reboot command
+RebootCommand=/bin/systemctl reboot
+
+
+[Theme]
+# Current theme name
+Current=debian-theme
+
+# Cursor theme used in the greeter
+CursorTheme=
+
+# Number of users to use as threshold
+# above which avatars are disabled
+# unless explicitly enabled with EnableAvatars
+DisableAvatarsThreshold=7
+
+# Enable display of custom user avatars
+EnableAvatars=true
+
+# Global directory for user avatars
+# The files should be named <username>.face.icon
+FacesDir=/usr/share/sddm/faces
+
+# Theme directory path
+ThemeDir=/usr/share/sddm/themes
+
+
+[Users]
+# Default $PATH for logged in users
+DefaultPath=/bin:/usr/bin
+
+# Comma-separated list of shells.
+# Users with these shells as their default won't be listed
+HideShells=
+
+# Comma-separated list of users that should not be listed
+HideUsers=
+
+# Maximum user id for displayed users
+MaximumUid=60000
+
+# Minimum user id for displayed users
+MinimumUid=1000
+
+# Remember the session of the last successfully logged in user
+RememberLastSession=true
+
+# Remember the last successfully logged in user
+RememberLastUser=true
+
+
+[Wayland]
+# Path to a script to execute when starting the desktop session
+SessionCommand=/usr/share/sddm/scripts/wayland-session
+
+# Directory containing available Wayland sessions
+SessionDir=/usr/share/wayland-sessions
+
+# Path to the user session log file
+SessionLogFile=.local/share/sddm/wayland-session.log
+
+
+[X11]
+# Path to a script to execute when starting the display server
+DisplayCommand=/usr/share/sddm/scripts/Xsetup
+
+# Path to a script to execute when stopping the display server
+DisplayStopCommand=/usr/share/sddm/scripts/Xstop
+
+# The lowest virtual terminal number that will be used.
+MinimumVT=7
+
+# Arguments passed to the X server invocation
+ServerArguments=-nolisten tcp
+
+# Path to X server binary
+ServerPath=/usr/bin/X
+
+# Path to a script to execute when starting the desktop session
+SessionCommand=/etc/sddm/Xsession
+
+# Directory containing available X sessions
+SessionDir=/usr/share/xsessions
+
+# Path to the user session log file
+SessionLogFile=.local/share/sddm/xorg-session.log
+
+# Path to the Xauthority file
+UserAuthFile=.Xauthority
+
+# Path to xauth binary
+XauthPath=/usr/bin/xauth
+
+# Path to Xephyr binary
+XephyrPath=/usr/bin/Xephyr
+
+EOF
+logverb 'P: Install hook for sddm done'
+fi
+
+
+
+
+# Correct ownership and permission to the files just installed
+# ------------------------------------------------------------
+logverb 'P: Correct ownership and permissions of copied files'
+chown -R root:root "${ICHR}"
+find "${ICHR}" -type d -exec chmod ugo+rx {} \;
+find "${ICHR}" -type f -exec chmod ugo+r {} \;
+for i in `find "${ICHR}/etc/NetworkManager/system-connections" -type f`
+do
+ chmod 600 "$i"
+ WIFIFILE="yes"
+done
+logverb 'P: Correct ownership and permissions of copied files done'
+
+
+
+# Write package list
+# ------------------
+logverb 'P: Generate package list'
+(
+ for i in $PKGF
+ do
+ sed -e 's/[ \t]*#.*$//g' < "${DSRC}/$i"
+ done
+ for i in $PKGNAMES $PKGLOC
+ do
+ echo $i
+ done
+ [ "X$DESKTOP" = "Xnone" ] || echo $BROWSER
+ [ "X$DESKTOP" != "Xnone" -o "X$WIFIFILE" != "Xyes" ] || echo network-manager
+ for i in \
+ ${DIR}/custom/pkg.txt \
+ ${DIR}/custom/pkg-${LIVETYPE}.txt \
+ ${DIR}/custom/pkg-${DESKTOP}.txt \
+ ${DIR}/custom/pkg-${DESKTOP}-${LIVETYPE}.txt \
+ ${DIR}/custom/pkg-${DEBVMAJ}.txt \
+ ${DIR}/custom/pkg-${DEBVMAJ}-${LIVETYPE}.txt \
+ ${DIR}/custom/pkg-${DEBVMAJ}-${DESKTOP}.txt \
+ ${DIR}/custom/pkg-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}.txt \
+ ${DIR}/custom/pkg-${LIVESYSTYPE}.txt \
+ ${DIR}/custom/pkg-${LIVESYSTYPE}-${LIVETYPE}.txt \
+ ${DIR}/custom/pkg-${LIVESYSTYPE}-${DESKTOP}.txt \
+ ${DIR}/custom/pkg-${LIVESYSTYPE}-${DESKTOP}-${LIVETYPE}.txt \
+ ${DIR}/custom/pkg-${LIVESYSTYPE}-${DEBVMAJ}.txt \
+ ${DIR}/custom/pkg-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE}.txt \
+ ${DIR}/custom/pkg-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}.txt \
+ ${DIR}/custom/pkg-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}.txt
+ do
+ if [ -f "$i" ]
+ then
+ sed -e 's/[ \t]*#.*$//g' < "$i"
+ fi
+ done
+) | sort -u > config/package-lists/disklessian.list.chroot
+chmod 644 config/package-lists/disklessian.list.chroot
+logverb 'P: Generate package list done'
+if [ "X$VERBOSE" = "Xyes" ]
+then
+ echo 'I: Package list follows'
+ cat config/package-lists/disklessian.list.chroot
+fi
+
+
+
+# Add hooks chroot
+# ================
+
+# 0501 Disklessian/DkToolian specific startup tasks
+# -------------------------------------------------
+# The /usr/local/bin/dklivesys-boot script
+# - runs ntpdate to synchronize time unless the NTP daemon is used,
+# - updates Gnome 3 preferences if the Gnome desktop is used,
+# - copies the contents of /usr/share/dklivesys/etc into the /etc directory,
+# - runs the scripts in the /usr/share/dklivesys/hooks directory,
+# - and loads the CONSKEYMAP file when running without a graphical
+# desktop on Debian Jessie.
+# The hook modifies /etc/rc.local for Debian Jessie live systems without
+# graphical desktop or installs a systemd driven service on other systems.
+#
+logverb 'P: Install Disklessian/DkToolian boot task'
+rm -f "${ICHR}/usr/local/bin/dklivesys-boot"
+cat - > "${ICHR}/usr/local/bin/dklivesys-boot" <<EOF
+#! /bin/sh
+(
+
+# Copy /etc files
+echo Copy files from /usr/share/dklivesys/etc to /etc
+if [ -d /usr/share/dklivesys/etc ]
+then
+ umask 022
+ cd /usr/share/dklivesys/etc
+ for i in \`find . -type d\`
+ do
+ [ -d "/etc/\$i" ] || (mkdir -p "/etc/\$i";chmod 755 "/etc/\$i")
+ done
+ for i in \`find . -type f\`
+ do
+ cp "\$i" "/etc/\$i"
+ done
+fi
+EOF
+if [ "X$DEBVMAJ" = "Xjessie" -a "X$DESKTOP" = "Xnone" -a "X$CONSKEYMAP" != "X-" -a "X$CONSKEYMAP" != "X" ]
+then
+cat - >> "${ICHR}/usr/local/bin/dklivesys-boot" <<EOF
+# Load console key mapping file
+echo loadkeys $CONSKEYMAP
+loadkeys $CONSKEYMAP
+EOF
+fi
+if [ "X$NTPSERVER" != "X" -a "X$USENTPDAEMON" != "Xyes" ]
+then
+cat - >> "${ICHR}/usr/local/bin/dklivesys-boot" <<EOF
+# Network time synchronisation
+echo "ntpdate $NTPSERVER"
+ntpdate "$NTPSERVER"
+EOF
+fi
+if [ "X$DESKTOP" = "Xgnome" ]
+then
+cat - >> "${ICHR}/usr/local/bin/dklivesys-boot" <<EOF
+# Gnome defaults
+echo "dconf update"
+dconf update
+EOF
+fi
+cat - >> "${ICHR}/usr/local/bin/dklivesys-boot" <<EOF
+# Hook scripts
+echo Hook scripts
+if [ -d /usr/share/dklivesys/hooks ]
+then
+ for i in /usr/share/dklivesys/hooks/*
+ do
+ echo Execute hook \$i
+ \$i
+ echo Execute hook \$i '(done)'
+ done
+fi
+EOF
+cat - >> "${ICHR}/usr/local/bin/dklivesys-boot" <<EOF
+) > /var/log/dklivesys-boot.log 2>&1
+exit 0
+EOF
+chmod 755 "${ICHR}/usr/local/bin/dklivesys-boot"
+
+if [ "X$DEBVMAJ" = "Xjessie" -a "X$DESKTOP" = "Xnone" ]
+then
+cat - > "${HOOKDIR}/0501-dklivesys-boot.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0501-dklivesys-boot'
+sed -i -e '/^[ \t]*exit.*0/c/usr/local/bin/dklivesys-boot\nexit 0\n' /etc/rc.local
+echo 'P: Hook chroot 0501-dklivesys-boot done'
+EOF
+chmod 755 "${HOOKDIR}/0501-dklivesys-boot.hook.chroot"
+else
+cat - > "${ICHR}/etc/systemd/system/dklivesys.service" <<EOF
+[Unit]
+Description=Disklessian/DkToolian startup tasks
+After=local-fs.target network.target network-online.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/dklivesys-boot
+
+[Install]
+WantedBy=multi-user.target
+EOF
+chmod 644 "${ICHR}/etc/systemd/system/dklivesys.service"
+cat - > "${HOOKDIR}/0501-dklivesys-boot.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0501-dklivesys-boot'
+if [ ! -d /etc/systemd/system/multi-user.target.wants ]
+then
+ mkdir -p /etc/systemd/system/multi-user.target.wants
+ chmod 755 /etc/systemd/system/multi-user.target.wants
+fi
+ln -s /etc/systemd/system/dklivesys.service /etc/systemd/system/multi-user.target.wants/dklivesys.service
+echo 'P: Hook chroot 0501-dklivesys-boot done'
+EOF
+chmod 755 "${HOOKDIR}/0501-dklivesys-boot.hook.chroot"
+fi
+
+logverb 'P: Install Disklessian/DkToolian boot task done'
+
+
+# 0502 Correct NTP configuration file
+# -----------------------------------
+#
+if [ "X$NTPSERVER" != "X" ]
+then
+cat - > "${ICHR}/usr/share/dklivesys/sed/ntp.conf" <<EOF
+/^#[ \t]*MYSERVER/s/^#[ \t]*MYSERVER/server $NTPSERVER iburst/g
+EOF
+chmod 644 "${ICHR}/usr/share/dklivesys/sed/ntp.conf"
+cat - > "${HOOKDIR}/0502-ntp-conf.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0502-ntp-conf'
+sed -f /usr/share/dklivesys/sed/ntp.conf < /usr/share/dklivesys/templates/ntp.conf > /etc/ntp.conf
+chmod 644 /etc/ntp.conf
+rm -f /usr/share/dklivesys/sed/ntp.conf
+rm -f /usr/share/dklivesys/templates/ntp.conf
+echo 'P: Hook chroot 0502-ntp-conf done'
+EOF
+chmod 755 "${HOOKDIR}/0502-ntp-conf.hook.chroot"
+fi
+
+
+# 0503 Keyboard model
+# -------------------
+#
+if [ "X$XKBMODEL" != "X" -a "X$XKBLAYOUT" != "X" ]
+then
+cat - > "${HOOKDIR}/0503-keyboard.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0503-keyboard'
+[ ! -f /etc/default/keyboard ] || rm -f /etc/default/keyboard
+echo "XKBMODEL=\"$XKBMODEL\"" > /etc/default/keyboard
+echo "XKBLAYOUT=\"$XKBLAYOUT\"" >> /etc/default/keyboard
+echo "XKBVARIANT=\"$XKBVARIANT\"" >> /etc/default/keyboard
+echo "XKBOPTIONS=\"$XKBOPTIONS\"" >> /etc/default/keyboard
+echo "BACKSPACE=\"$XKBBACKSPACE\"" >> /etc/default/keyboard
+chmod 644 /etc/default/keyboard
+echo 'P: Hook chroot 0503-keyboard done'
+EOF
+chmod 755 "${HOOKDIR}/0503-keyboard.hook.chroot"
+fi
+
+
+# 0504 Avoid WiFi deauthentication
+# --------------------------------
+# On Debian Stretch long network interface names are used, typically
+# derived from module name, unique ID added.
+# Some modules and/or firmware can not handle these long names, the
+# result is WiFi deauthentication.
+# The SHORTIFNAMES setting can be used to configure traditional short
+# interface names.
+#
+if [ "X$DEBVMAJ" != "Xjessie" -a "X$SHORTIFNAMES" = "Xyes" ]
+then
+cat - > "${HOOKDIR}/0504-wifi.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0504-wifi'
+ln -s /dev/null /etc/systemd/network/99-default.link
+echo 'P: Hook chroot 0504-wifi done'
+EOF
+fi
+
+# 0505 Gnome specific tasks
+# -------------------------
+#
+if [ "X$DESKTOP" = "Xgnome" ]
+then
+cat - > "${HOOKDIR}/0505-gnome.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0505-gnome'
+for i in /etc/xdg/autostart/tracker*.desktop
+do
+ echo 'P: Modfify' $i
+ echo "Hidden=true" >> "\$i"
+done
+echo 'P: dconf update'
+dconf update
+echo 'P: Hook chroot 0505-gnome done'
+EOF
+chmod 755 "${HOOKDIR}/0505-gnome.hook.chroot"
+fi
+
+
+# 0506 LXDE tasks
+# ---------------
+#
+if [ "X$DESKTOP" = "Xlxde" ]
+then
+cat - > "${HOOKDIR}/0506-lxde.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0506-lxde'
+if [ -f /etc/xdg/autostart/clipit-startup.desktop ]
+then
+ echo "Hidden=true" >> /etc/xdg/autostart/clipit-startup.desktop
+fi
+echo 'P: Hook chroot 0506-lxde done'
+EOF
+chmod 755 "${HOOKDIR}/0506-lxde.hook.chroot"
+fi
+
+# Set console font for CLI in /etc/default/console-setup
+# ------------------------------------------------------
+#
+if [ "X$DESKTOP" = "Xnone" -a "X$CONSOLEFONT" != "X" -a "X$DEBVMAJ" != "Xjessie" ]
+then
+cat - > "${ICHR}/usr/share/dklivesys/sed/consolefont" <<EOF
+/^FONTFACE=/cFONTFACE="$CONSOLEFONT"
+
+EOF
+chmod 644 "${ICHR}/usr/share/dklivesys/sed/consolefont"
+cat - > "${HOOKDIR}/0507-console-font.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0507-console-font'
+sed -f /usr/share/dklivesys/sed/consolefont -i /etc/default/console-setup
+rm -f /usr/share/dklivesys/sed/consolefont
+echo 'P: Hook chroot 0507-console-font done'
+EOF
+chmod 755 "${HOOKDIR}/0507-console-font.hook.chroot"
+fi
+
+# 0508 /etc/default/locale
+# ------------------------
+#
+if [ "X$DESKTOP" != "Xlxqt" ]
+then
+cat - > "${HOOKDIR}/0508-etc-default-locale.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0508-etc-default-locale'
+echo '# File generated by update-locale' > /etc/default/locale
+echo 'LANG="'$LANGFULL'"' >> /etc/default/locale
+chmod 644 /etc/default/locale
+echo 'P: Hook chroot 0508-etc-default-locale done'
+EOF
+chmod 755 "${HOOKDIR}/0508-etc-default-locale.hook.chroot"
+fi
+
+
+# 0509 Remove NVME modules
+# ------------------------
+#
+if [ "X$LIVESYSTYPE" = "Xdisklessian" ]
+then
+cat - > "${HOOKDIR}/0509-remove-nvme.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0509-remove-nvme'
+find /lib/modules -name 'nvme.ko' -exec rm -f {} \\;
+find /lib/modules -name 'nvme-*.ko' -exec rm -f {} \\;
+find /lib/modules -name 'nvme_*.ko' -exec rm -f {} \\;
+echo 'P: Hook chroot 0509-remove-nvme done'
+EOF
+chmod 755 "${HOOKDIR}/0509-remove-nvme.hook.chroot"
+fi
+
+# 0510 Additional packages
+# ------------------------
+#
+crdir "${ICHR}/usr/share/dklivesys/pkgs"
+for i in \
+pkgs \
+pkgs-${LIVETYPE} \
+pkgs-${DESKTOP} \
+pkgs-${DESKTOP}-${LIVETYPE} \
+pkgs-${DEBVMAJ} \
+pkgs-${DEBVMAJ}-${LIVETYPE} \
+pkgs-${DEBVMAJ}-${DESKTOP} \
+pkgs-${DEBVMAJ}-${DESKTOP}-${LIVETYPE} \
+pkgs-${LIVESYSTYPE} \
+pkgs-${LIVESYSTYPE}-${LIVETYPE} \
+pkgs-${LIVESYSTYPE}-${DESKTOP} \
+pkgs-${LIVESYSTYPE}-${DESKTOP}-${LIVETYPE} \
+pkgs-${LIVESYSTYPE}-${DEBVMAJ} \
+pkgs-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE} \
+pkgs-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP} \
+pkgs-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}
+do
+ if [ -d "${DIR}/custom/$i" ]
+ then
+ echo 'I: Directory exists' "${DIR}/custom/$i"
+ cp ${DIR}/custom/$i/* "${ICHR}/usr/share/dklivesys/pkgs"
+ fi
+done
+fn="no"
+for i in ${ICHR}/usr/share/dklivesys/pkgs/*.deb
+do
+ logverb 'P: Package file' $i
+ fn="yes"
+done
+if [ "X$fn" = "Xyes" ]
+then
+cat - > "${HOOKDIR}/0510-custom-pkgs.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0510-custom-pkgs'
+dpkg -i --force-downgrade /usr/share/dklivesys/pkgs/*.deb
+rm -fr /usr/share/dklivesys/pkgs
+echo 'P: Hook chroot 0510-custom-pkgs done'
+EOF
+chmod 755 "${HOOKDIR}/0510-custom-pkgs.hook.chroot"
+else
+cat - > "${HOOKDIR}/0510-custom-pkgs.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0510-custom-pkgs'
+rm -fr /usr/share/dklivesys/pkgs
+echo 'P: Hook chroot 0510-custom-pkgs done'
+EOF
+chmod 755 "${HOOKDIR}/0510-custom-pkgs.hook.chroot"
+fi
+
+
+
+# Add hooks binary
+# ================
+
+# Change variables for network boot systems
+# -----------------------------------------
+#
+if [ "X$LIVETYPE" = "Xnfs" ]
+then
+ BOOTMENUCFG="tftpboot/menu.cfg"
+ ISOLINUXCFG="tftpboot/pxelinux.cfg/default"
+ SPLASHPNG="tftpboot/splash.png"
+fi
+
+
+# 0990 Boot menu beep
+# -------------------
+#
+if [ "X$BOOTMENUBEEP" != "Xyes" ]
+then
+cat - > "${HOOKDIR}/0990-bootbeep.hook.binary" <<EOF
+#! /bin/sh
+echo 'P: Hook binary 0990-bootbeep'
+sed -i -f "${DSRC}/sed_nobeep.txt" "${DIR}/livesys/${BOOTMENUCFG}"
+echo 'P: Hook binary 0990-bootbeep done'
+EOF
+chmod 755 "${HOOKDIR}/0990-bootbeep.hook.binary"
+fi
+
+
+# 0991 Boot menu timeout and installation items
+# ---------------------------------------------
+#
+if [ "X$LIVETYPE" != "Xnfs" ]
+then
+cat - > "${HOOKDIR}/0991-bootmenu.hook.binary" <<EOF
+#! /bin/sh
+echo 'P: Hook binary 0991-bootmenu'
+sed -i -f "${DSRC}/sed-isolinux.txt" "${DIR}/livesys/${ISOLINUXCFG}"
+sed -i -f "${DSRC}/sed-menu.txt" "${DIR}/livesys/${BOOTMENUCFG}"
+sed -i -f "${DSRC}/sed-isolinux-menu.txt" "${DIR}/livesys/${BOOTMENUCFG}"
+if [ "X$LIVESYSTYPE" = "Xdisklessian" ]
+then
+ cp "${DIR}/gui-img/splash/splash-disklessian.png" "${DIR}/livesys/${SPLASHPNG}"
+else
+ cp "${DIR}/gui-img/splash/splash-dktoolian.png" "${DIR}/livesys/${SPLASHPNG}"
+fi
+if [ -f "${DIR}/custom/splash.png" ]
+then
+ cp "${DIR}/custom/splash.png" "${DIR}/livesys/${SPLASHPNG}"
+fi
+chmod 644 "${DIR}/livesys/${SPLASHPNG}"
+echo 'P: Hook binary 0991-bootmenu done'
+EOF
+chmod 755 "${HOOKDIR}/0991-bootmenu.hook.binary"
+else
+cat - > "${HOOKDIR}/0991-bootmenu.hook.binary" <<EOF
+#! /bin/sh
+echo 'P: Hook binary 0991-bootmenu'
+sed -i -f "${DSRC}/sed-isolinux.txt" "${DIR}/livesys/${ISOLINUXCFG}"
+sed -i -f "${DSRC}/sed-menu.txt" "${DIR}/livesys/${BOOTMENUCFG}"
+sed -i -f "${DSRC}/sed-isolinux-menu.txt" "${DIR}/livesys/${BOOTMENUCFG}"
+if [ "X$LIVESYSTYPE" = "Xdisklessian" ]
+then
+ cp "${DIR}/gui-img/splash/splash-surfian.png" "${DIR}/livesys/${SPLASHPNG}"
+else
+ cp "${DIR}/gui-img/splash/splash-dktoolian.png" "${DIR}/livesys/${SPLASHPNG}"
+fi
+if [ -f "${DIR}/custom/splash.png" ]
+then
+ cp "${DIR}/custom/splash.png" "${DIR}/livesys/${SPLASHPNG}"
+fi
+chmod 644 "${DIR}/livesys/${SPLASHPNG}"
+echo 'P: Hook binary 0991-bootmenu done'
+EOF
+chmod 755 "${HOOKDIR}/0991-bootmenu.hook.binary"
+fi
+
+# Automatic root login on CLI systems
+# -----------------------------------
+#
+
+if [ "X$DESKTOP" = "Xnone" -a "X$DEBVMAJ" = "Xjessie" ]
+then
+cat - > "${ICHR}/usr/share/dklivesys/sed/getty" <<EOF
+/^ExecStart=/s/\-\-noclear/--autologin root --noclear/
+EOF
+cat - > "${HOOKDIR}/0511-rootlogin.hook.chroot" <<EOF
+#! /bin/sh
+echo 'P: Hook chroot 0511-rootlogin'
+SVCS="getty@"
+for s in \${SVCS}
+do
+ echo 'P: Modify' "/lib/systemd/system/\${s}.service"
+ sed -i -f /usr/share/dklivesys/sed/getty "/lib/systemd/system/\${s}.service"
+done
+rm -fr /usr/share/dklivesys/sed/getty
+echo 'P: Hook chroot 0511-rootlogin done'
+EOF
+chmod 755 "${HOOKDIR}/0511-rootlogin.hook.chroot"
+# DESKTOP none LIVETYPE hybrid DEBIAN !jessie
+elif [ "X$DESKTOP" = "Xnone" -a "X$LIVETYPE" = "Xhybrid" -a "X$DEBVMAJ" != "Xjessie" ]
+then
+cat - > "${HOOKDIR}/0992-autologin.hook.binary" <<EOF
+#! /bin/sh
+echo 'P: Hook binary 0992-autologin'
+sed -f "${DSRC}/sed-stretch-login-grub.txt" -i "${DIR}/livesys/binary/boot/grub/grub.cfg"
+sed -f "${DSRC}/sed-stretch-login-iso.txt" -i "${DIR}/livesys/binary/isolinux/live.cfg"
+echo 'P: Hook binary 0992-autologin done'
+EOF
+chmod 755 "${HOOKDIR}/0992-autologin.hook.binary"
+# DESKTOP none LIVETYPE nfs DEBIAN !jessie
+elif [ "X$DESKTOP" = "Xnone" -a "X$LIVETYPE" = "Xnfs" -a "X$DEBVMAJ" != "Xjessie" ]
+then
+cat - > "${HOOKDIR}/0992-autologin.hook.binary" <<EOF
+#! /bin/sh
+echo 'P: Hook binary 0992-autologin'
+sed -f "${DSRC}/sed-stretch-login-iso.txt" -i "${DIR}/livesys/tftpboot/live.cfg"
+echo 'P: Hook binary 0992-autologin done'
+EOF
+chmod 755 "${HOOKDIR}/0992-autologin.hook.binary"
+# DESKTOP none LIVETYPE hybrid
+elif [ "X$DESKTOP" = "Xnone" -a "X$LIVETYPE" = "Xhybrid" ]
+then
+cat - > "${HOOKDIR}/0992-autologin.hook.binary" <<EOF
+#! /bin/sh
+echo 'P: Hook binary 0992-autologin'
+sed -f "${DSRC}/sed-stretch-login-grub.txt" -i "${DIR}/livesys/binary/boot/grub/grub.cfg"
+sed -f "${DSRC}/sed-stretch-login-iso.txt" -i "${DIR}/livesys/binary/isolinux/live.cfg"
+echo 'P: Hook binary 0992-autologin done'
+EOF
+chmod 755 "${HOOKDIR}/0992-autologin.hook.binary"
+# DESKTOP none LIVETYPE nfs
+elif [ "X$DESKTOP" = "Xnone" -a "X$LIVETYPE" = "Xnfs" ]
+then
+cat - > "${HOOKDIR}/0992-autologin.hook.binary" <<EOF
+#! /bin/sh
+echo 'P: Hook binary 0992-autologin'
+sed -f "${DSRC}/sed-stretch-login-iso.txt" -i "${DIR}/livesys/tftpboot/live.cfg"
+echo 'P: Hook binary 0992-autologin done'
+EOF
+chmod 755 "${HOOKDIR}/0992-autologin.hook.binary"
+fi
+
+# Files for hardware detection tool
+# ---------------------------------
+#
+if [ "X$LIVETYPE" != "Xnfs" -a "X$LIVESYSTYPE" = "Xdktoolian" ]
+then
+cat - > "${HOOKDIR}/0993-hdt.hook.binary" <<EOF
+#! /bin/sh
+echo 'P: Hook binary 0993-hdt'
+if [ -f "${DIR}/livesys/chroot/usr/share/misc/pci.ids" ]
+then
+echo "P: Copy file ${DIR}/livesys/chroot/usr/share/misc/pci.ids"
+cp "${DIR}/livesys/chroot/usr/share/misc/pci.ids" "${DIR}/livesys/binary/isolinux"
+chmod 644 "${DIR}/livesys/binary/isolinux/pci.ids"
+echo "P: Copy file ${DIR}/livesys/chroot/usr/share/misc/pci.ids done"
+fi
+if [ -f "${DIR}/livesys/chroot/var/lib/usbutils/usb.ids" ]
+then
+echo "P: Copy file ${DIR}/livesys/chroot/var/lib/usbutils/usb.ids"
+cp "${DIR}/livesys/chroot/var/lib/usbutils/usb.ids" "${DIR}/livesys/binary/isolinux"
+chmod 644 "${DIR}/livesys/binary/isolinux/usb.ids"
+echo "P: Copy file ${DIR}/livesys/chroot/var/lib/usbutils/usb.ids done"
+fi
+echo 'P: Hook binary 0993-hdt done'
+EOF
+chmod 755 "${HOOKDIR}/0993-hdt.hook.binary"
+fi
+
+
+# Export variables to make them available to hooks
+# ------------------------------------------------
+#
+logverb 'P: Export variables for hooks'
+export DESKTOP
+export KERNELVERSION
+export KERNELFLAVOUR
+export ALLOWNONFREE
+export ALLOWUNSIGNEDPKG
+export ALLOWAPTINDICES
+export ALLOWLIBREOFF
+export SHORTIFNAMES
+export LIVEAPPENDIP
+export NTPSERVER
+export USENTPDAEMON
+export BOOTMENUBEEP
+export PUBLISHER
+export VERBOSE
+export LANGSHORT
+export LANGFULL
+export LANGREG
+export LIVEAPPENDLOCALES
+export LIVEAPPENDTIMEZONE
+export XKBMODEL
+export XKBLAYOUT
+export XKBVARIANT
+export XKBOPTIONS
+export XKBBACKSPACE
+export LIVEAPPENDKBDLAYOUTS
+export LIVEAPPENDCUSTOM
+export WIFISSID
+export WIFIPSK
+export WIFIMAC
+export WIFIUUID
+export PARENTMIRRORBOOTSTRAP
+export PARENTMIRRORCHROOT
+export PARENTMIRRORCHROOTSECURITY
+export PARENTMIRRORCHROOTUPDATES
+export PARENTMIRRORCHROOTBACKPORTS
+export PARENTMIRRORBINARY
+export PARENTMIRRORBINARYSECURITY
+export PARENTMIRRORBINARYUPDATES
+export PARENTMIRRORBINARYBACKPORTS
+export PARENTMIRRORDEBIANINSTALLER
+export MIRRORBOOTSTRAP
+export MIRRORCHROOT
+export MIRRORCHROOTSECURITY
+export MIRRORCHROOTUPDATES
+export MIRRORCHROOTBACKPORTS
+export MIRRORBINARY
+export MIRRORBINARYSECURITY
+export MIRRORBINARYUPDATES
+export MIRRORBINARYBACKPORTS
+export MIRRORDEBIANINSTALLER
+export LIVETYPE
+export NFSSERVER
+export NFSPATH
+export APTRECOMMENDS
+export DATADIR
+export PUBKEYFILE
+export SERIALCONSOLE
+export PKGLOC
+export PKGNAMES
+export PKGF
+export DIR
+export ICHR
+export CHROOT
+export DSRC
+export HOOKDIR
+export DEBVMAJ
+export LBVMAJ
+export BOOTMENUCFG
+export ISOLINUXCFG
+export SPLASHPNG
+export LIBINC
+export OPTCONF
+export OPTLIVEAPPEND
+export WIFIFILE
+export SDDMDT
+export BROWSER
+logverb 'P: PWD' `pwd`
+
+# Copy custom hooks
+# -----------------
+#
+for i in \
+hooks \
+hooks-${LIVETYPE} \
+hooks-${DESKTOP} \
+hooks-${DESKTOP}-${LIVETYPE} \
+hooks-${DEBVMAJ} \
+hooks-${DEBVMAJ}-${LIVETYPE} \
+hooks-${DEBVMAJ}-${DESKTOP} \
+hooks-${DEBVMAJ}-${DESKTOP}-${LIVETYPE} \
+hooks-${LIVESYSTYPE} \
+hooks-${LIVESYSTYPE}-${LIVETYPE} \
+hooks-${LIVESYSTYPE}-${DESKTOP} \
+hooks-${LIVESYSTYPE}-${DESKTOP}-${LIVETYPE} \
+hooks-${LIVESYSTYPE}-${DEBVMAJ} \
+hooks-${LIVESYSTYPE}-${DEBVMAJ}-${LIVETYPE} \
+hooks-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP} \
+hooks-${LIVESYSTYPE}-${DEBVMAJ}-${DESKTOP}-${LIVETYPE}
+do
+ if [ -d "${DIR}/custom/$i" ]
+ then
+ cp ${DIR}/custom/$i/* "${HOOKDIR}"
+ fi
+done
+logverb 'P: Install custom hook files done'
+
+
+# Install DK tools into DkToolian live system
+# -------------------------------------------
+#
+if [ "X$LIVESYSTYPE" = "Xdktoolian" ]
+then
+ cd ..
+ logverb 'P: Install DK tools (rescue)'
+ make DESTDIR="$ICHR" install || exit 1
+ logverb 'P: Install DK tools (rescue) done'
+ cd livesys
+fi
+
+# Build live system
+# =================
+
+# Run lb build
+# ------------
+logverb 'P: Building live system'
+if [ "X$VERBOSE" = "Xyes" ]
+then
+ lb build --verbose || EXVAL=1
+else
+ lb build || EXVAL=1
+fi
+logverb 'P: Building live system done'
+
+# Change back to original directory
+# ---------------------------------
+cd ..
+
+# Show summary
+# ============
+if [ "X$VERBOSE" = "Xyes" ]
+then
+ echo 'I: DESKTOP ' $DESKTOP
+ echo 'I: KERNELFLAVOUR ' $KERNELFLAVOUR
+ echo 'I: KERNELVERSION ' $KERNELVERSION
+ echo 'I: PUBKEYFILE ' $PUBKEYFILE
+ echo 'I: SDDMDT ' $SDDMDT
+ echo 'I: LIVETYPE ' $LIVETYPE
+ echo 'I: NFSSERVER ' $NFSSERVER
+ echo 'I: NFSPATH ' $NFSPATH
+ echo 'I: CONFIGURED ' $CONFIGURED
+ echo 'I: APTRECOMMENDS ' $APTRECOMMENDS
+ echo 'I: ALLOWUNSIGNEDPKG ' $ALLOWUNSIGNEDPKG
+ echo 'I: ALLOWNONFREE ' $ALLOWNONFREE
+ echo 'I: DATADIR ' $DATADIR
+ echo 'I: LIVEAPPENDIP ' $LIVEAPPENDIP
+ echo 'I: NTPSERVER ' $NTPSERVER
+ echo 'I: USENTPDAEMON ' $USENTPDAEMON
+ echo 'I: BOOTMENUBEEP ' $BOOTMENUBEEP
+ echo 'I: PUBLISHER ' $PUBLISHER
+ echo 'I: VERBOSE ' $VERBOSE
+ echo 'I: SERIALCONSOLE ' $SERIALCONSOLE
+ echo 'I: LANGSHORT ' $LANGSHORT
+ echo 'I: LANGFULL ' $LANGFULL
+ echo 'I: LANGREG ' $LANGREG
+ echo 'I: LIVEAPPENDLOCALES ' $LIVEAPPENDLOCALES
+ echo 'I: LIVEAPPENDTIMEZONE ' $LIVEAPPENDTIMEZONE
+ echo 'I: XKBMODEL ' $XKBMODEL
+ echo 'I: XKBLAYOUT ' $XKBLAYOUT
+ echo 'I: XKBVARIANT ' $XKBVARIANT
+ echo 'I: XKBOPTIONS ' $XKBOPTIONS
+ echo 'I: XKBBACKSPACE ' $XKBBACKSPACE
+ echo 'I: LIVEAPPENDKBDLAYOUTS ' $LIVEAPPENDKBDLAYOUTS
+ echo 'I: OPTLIVEAPPEND ' $OPTLIVEAPPEND
+ echo 'I: PARENTMIRRORBOOTSTRAP ' $PARENTMIRRORBOOTSTRAP
+ echo 'I: PARENTMIRRORCHROOT ' $PARENTMIRRORCHROOT
+ echo 'I: PARENTMIRRORCHROOTSECURITY ' $PARENTMIRRORCHROOTSECURITY
+ echo 'I: PARENTMIRRORCHROOTUPDATES ' $PARENTMIRRORCHROOTUPDATES
+ echo 'I: PARENTMIRRORCHROOTBACKPORTS' $PARENTMIRRORCHROOTBACKPORTS
+ echo 'I: PARENTMIRRORBINARY ' $PARENTMIRRORBINARY
+ echo 'I: PARENTMIRRORBINARYSECURITY ' $PARENTMIRRORBINARYSECURITY
+ echo 'I: PARENTMIRRORBINARYUPDATES ' $PARENTMIRRORBINARYUPDATES
+ echo 'I: PARENTMIRRORBINARYBACKPORTS' $PARENTMIRRORBINARYBACKPORTS
+ echo 'I: PARENTMIRRORDEBIANINSTALLER' $PARENTMIRRORDEBIANINSTALLER
+ echo 'I: MIRRORBOOTSTRAP ' $MIRRORBOOTSTRAP
+ echo 'I: MIRRORCHROOT ' $MIRRORCHROOT
+ echo 'I: MIRRORCHROOTSECURITY ' $MIRRORCHROOTSECURITY
+ echo 'I: MIRRORCHROOTUPDATES ' $MIRRORCHROOTUPDATES
+ echo 'I: MIRRORCHROOTBACKPORTS ' $MIRRORCHROOTBACKPORTS
+ echo 'I: MIRRORBINARY ' $MIRRORBINARY
+ echo 'I: MIRRORBINARYSECURITY ' $MIRRORBINARYSECURITY
+ echo 'I: MIRRORBINARYUPDATES ' $MIRRORBINARYUPDATES
+ echo 'I: MIRRORBINARYBACKPORTS ' $MIRRORBINARYBACKPORTS
+ echo 'I: MIRRORDEBIANINSTALLER ' $MIRRORDEBIANINSTALLER
+ echo 'I: ICHR ' $ICHR
+ echo 'I: CHROOT ' $CHROOT
+ echo 'I: DSRC ' $DSRC
+ echo 'I: HOOKDIR ' $HOOKDIR
+ echo 'I: BOOTMENUCFG ' $BOOTMENUCFG
+ echo 'I: ISOLINUXCFG ' $ISOLINUXCFG
+ echo 'I: SPLASHPNG ' $SPLASHPNG
+ echo 'I: EXVAL ' $EXVAL
+fi
+
+# Show text about nonfree firmware
+# ================================
+[ "X$ALLOWNONFREE" != "Xyes" ] || cat "${DSRC}/msg-nonfree.txt"
+
+# Show text about WiFi files
+# ==========================
+[ "X$WIFIFILE" != "Xyes" ] || cat "${DSRC}/msg-wifi.txt"
+
+# Log end time
+# ============
+logverb 'P: Finished processing'
+
+exit $EXVAL
+
diff --git a/support/dktools/modsnmp.sed b/support/dktools/modsnmp.sed
index 2faa65f851..36f0365162 100644
--- a/support/dktools/modsnmp.sed
+++ b/support/dktools/modsnmp.sed
@@ -1,3 +1,4 @@
s/\-lsocket//g
s/\-lnsl//g
s/\-lm//g
+s/\-lelf//g
diff --git a/support/dktools/pjsnmp.c b/support/dktools/pjsnmp.c
index 4dab12c63f..81f35837e3 100644
--- a/support/dktools/pjsnmp.c
+++ b/support/dktools/pjsnmp.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: pjsnmp.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: pjsnmp.ctr
*/
/** @file pjsnmp.c The pjsnmp module.
@@ -72,12 +50,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4sock.h"
#include "dk4isadm.h"
#include "dk4lprng.h"
+#include "dk4unused.h"
-#line 48 "pjsnmp.ctr"
+#line 49 "pjsnmp.ctr"
#endif
/* if DK4_HAVE_LIBNETSNMP && ((DK4_HAVE_SIGACTION) || (DK4_HAVE_SIGSET)) */
@@ -846,7 +825,7 @@ static const char * const pjsnmp_kw[] = {
NULL
-#line 744 "pjsnmp.ctr"
+#line 745 "pjsnmp.ctr"
};
@@ -866,7 +845,7 @@ static const char * const accounting_responses[] = {
NULL
-#line 756 "pjsnmp.ctr"
+#line 757 "pjsnmp.ctr"
};
@@ -970,7 +949,7 @@ static const char * const printcap_entry_names[] = {
NULL
-#line 891 "pjsnmp.ctr"
+#line 892 "pjsnmp.ctr"
};
@@ -992,7 +971,7 @@ static const char * const snmp_version_names[] = {
NULL
-#line 903 "pjsnmp.ctr"
+#line 904 "pjsnmp.ctr"
};
@@ -1053,7 +1032,7 @@ static const char * const model_keys[] = {
NULL
-#line 939 "pjsnmp.ctr"
+#line 940 "pjsnmp.ctr"
};
@@ -1081,7 +1060,7 @@ static const char * const summary_state_names[] = {
NULL
-#line 953 "pjsnmp.ctr"
+#line 954 "pjsnmp.ctr"
};
@@ -1106,7 +1085,7 @@ static const char * const device_status_names[] = {
NULL
-#line 966 "pjsnmp.ctr"
+#line 967 "pjsnmp.ctr"
};
@@ -1131,7 +1110,7 @@ static const char * const printer_status_names[] = {
NULL
-#line 979 "pjsnmp.ctr"
+#line 980 "pjsnmp.ctr"
};
@@ -1186,7 +1165,7 @@ static const char * const condition_names[] = {
NULL
-#line 1002 "pjsnmp.ctr"
+#line 1003 "pjsnmp.ctr"
};
@@ -1401,41 +1380,21 @@ static dk4_time_t start_error = (dk4_time_t)0UL;
static const size_t sz_oid_ds = sizeof(oid_ds)/sizeof(oid);
-/** Size of device status OID (number of bytes).
-*/
-static const size_t by_oid_ds = sizeof(oid_ds);
-
-
/** Size of printer status OID (number of elements).
*/
static const size_t sz_oid_ps = sizeof(oid_ps)/sizeof(oid);
-/** Size of printer status OID (number of bytes).
-*/
-static const size_t by_oid_ps = sizeof(oid_ps);
-
-
/** Size of page counter OID (number of elements).
*/
static const size_t sz_oid_pc = sizeof(oid_pc)/sizeof(oid);
-/** Size of page counter OID (number of bytes).
-*/
-static const size_t by_oid_pc = sizeof(oid_pc);
-
-
/** Size of printer error OID (number of elements).
*/
static const size_t sz_oid_pe = sizeof(oid_pe)/sizeof(oid);
-/** Size of printer error OID (number of bytes).
-*/
-static const size_t by_oid_pe = sizeof(oid_pe);
-
-
/** Size of printer error OID (number of elements).
*/
static const size_t sz_oid_dst = sizeof(oid_dst)/sizeof(oid);
@@ -1756,8 +1715,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -1768,8 +1728,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -1779,8 +1740,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -1833,15 +1795,15 @@ log_timestamp(void)
int back = 0;
-#line 1647 "pjsnmp.ctr"
+#line 1631 "pjsnmp.ctr"
dk4time_get(&current);
if (current != previous_log) {
-#line 1649 "pjsnmp.ctr"
+#line 1633 "pjsnmp.ctr"
if (dk4time_as_text_c8(buf, sizeof(buf), &current, NULL)) {
back = 1;
-#line 1651 "pjsnmp.ctr"
+#line 1635 "pjsnmp.ctr"
fputs(pjsnmp_kw[62], out_file);
fputs(buf, out_file);
fputs(pjsnmp_kw[0], out_file);
@@ -1849,7 +1811,7 @@ log_timestamp(void)
}
}
-#line 1657 "pjsnmp.ctr"
+#line 1641 "pjsnmp.ctr"
return back;
}
@@ -1940,13 +1902,13 @@ log_1_no_header(size_t i)
{
-#line 1746 "pjsnmp.ctr"
+#line 1730 "pjsnmp.ctr"
log_timestamp();
fputs(pjsnmp_kw[i], out_file);
fflush(out_file);
-#line 1750 "pjsnmp.ctr"
+#line 1734 "pjsnmp.ctr"
}
@@ -1962,7 +1924,7 @@ log_3_no_header(size_t i1, size_t i2, const char *s)
{
-#line 1764 "pjsnmp.ctr"
+#line 1748 "pjsnmp.ctr"
log_timestamp();
fputs(pjsnmp_kw[i1], out_file);
if (NULL != s) { fputs(s, out_file); }
@@ -1970,7 +1932,7 @@ log_3_no_header(size_t i1, size_t i2, const char *s)
fflush(out_file);
-#line 1770 "pjsnmp.ctr"
+#line 1754 "pjsnmp.ctr"
}
@@ -2113,7 +2075,7 @@ stt_new(
status_text_t *back = NULL;
-#line 1911 "pjsnmp.ctr"
+#line 1895 "pjsnmp.ctr"
if ((NULL != t) && (0 < tsz)) {
back = dk4mem_new(status_text_t,1,NULL);
if (NULL != back) {
@@ -2126,7 +2088,7 @@ stt_new(
DK4_MEMCPY(back->text, t, tsz);
} else {
-#line 1922 "pjsnmp.ctr"
+#line 1906 "pjsnmp.ctr"
dk4mem_free(back);
back = NULL;
}
@@ -2134,19 +2096,19 @@ stt_new(
#if TRACE_DEBUG
else {
-#line 1928 "pjsnmp.ctr"
+#line 1912 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 1933 "pjsnmp.ctr"
+#line 1917 "pjsnmp.ctr"
}
#endif
-#line 1936 "pjsnmp.ctr"
+#line 1920 "pjsnmp.ctr"
return back;
}
@@ -2161,16 +2123,16 @@ stt_delete(status_text_t *ptr)
{
-#line 1949 "pjsnmp.ctr"
+#line 1933 "pjsnmp.ctr"
if (NULL != ptr) {
-#line 1950 "pjsnmp.ctr"
+#line 1934 "pjsnmp.ctr"
dk4mem_release(ptr->text);
dk4mem_free(ptr);
}
-#line 1954 "pjsnmp.ctr"
+#line 1938 "pjsnmp.ctr"
}
@@ -2194,7 +2156,7 @@ stt_compare(const void *l, const void *r, int cr)
int back = 0;
-#line 1976 "pjsnmp.ctr"
+#line 1960 "pjsnmp.ctr"
if (NULL != l) {
if (NULL != r) {
pl = (const status_text_t *)l;
@@ -2225,7 +2187,7 @@ stt_compare(const void *l, const void *r, int cr)
}
-#line 2005 "pjsnmp.ctr"
+#line 1989 "pjsnmp.ctr"
return back;
}
@@ -2242,14 +2204,14 @@ set_option(char c, char *val)
size_t sz = 0; /* Index of option in arguments array */
-#line 2020 "pjsnmp.ctr"
+#line 2004 "pjsnmp.ctr"
if (NULL != val) {
if (('a' <= c) && ('z' >= c)) {
sz = (size_t)(c - 'a');
if (DK4_SIZEOF(lower,DK4_PCHAR) > sz) {
lower[sz] = val;
-#line 2025 "pjsnmp.ctr"
+#line 2009 "pjsnmp.ctr"
}
} else {
if (('A' <= c) && ('Z' >= c)) {
@@ -2257,13 +2219,13 @@ set_option(char c, char *val)
if (DK4_SIZEOF(upper,DK4_PCHAR) > sz) {
upper[sz] = val;
-#line 2031 "pjsnmp.ctr"
+#line 2015 "pjsnmp.ctr"
}
}
}
}
-#line 2035 "pjsnmp.ctr"
+#line 2019 "pjsnmp.ctr"
}
@@ -2280,7 +2242,7 @@ get_option(char c)
size_t sz = 0; /* Index of option in arguments array */
-#line 2050 "pjsnmp.ctr"
+#line 2034 "pjsnmp.ctr"
if (('a' <= c) && ('z' >= c)) {
sz = (size_t)(c - 'a');
if (DK4_SIZEOF(lower,DK4_PCHAR) > sz) {
@@ -2295,7 +2257,7 @@ get_option(char c)
}
}
-#line 2063 "pjsnmp.ctr"
+#line 2047 "pjsnmp.ctr"
return back;
}
@@ -2319,26 +2281,26 @@ process_command_line_arguments(int argc, char *argv[])
char c; /* Option name */
-#line 2085 "pjsnmp.ctr"
+#line 2069 "pjsnmp.ctr"
for (i = 1; i < argc; i++) {
curarg = argv[i];
-#line 2087 "pjsnmp.ctr"
+#line 2071 "pjsnmp.ctr"
if ('-' == *curarg) {
-#line 2088 "pjsnmp.ctr"
+#line 2072 "pjsnmp.ctr"
curarg++;
if ('\0' != *curarg) {
-#line 2090 "pjsnmp.ctr"
+#line 2074 "pjsnmp.ctr"
c = *(curarg++);
if ('\0' != *curarg) {
-#line 2092 "pjsnmp.ctr"
+#line 2076 "pjsnmp.ctr"
set_option(c, curarg);
} else {
-#line 2094 "pjsnmp.ctr"
+#line 2078 "pjsnmp.ctr"
#if VERSION_BEFORE_20160208
/* -c may appear without an argument.
*/
@@ -2351,14 +2313,14 @@ process_command_line_arguments(int argc, char *argv[])
}
} else {
-#line 2105 "pjsnmp.ctr"
+#line 2089 "pjsnmp.ctr"
back = 0;
/* ERROR: Only minus */
log_1_with_header(1, 66);
}
} else {
-#line 2110 "pjsnmp.ctr"
+#line 2094 "pjsnmp.ctr"
#if 0
/* 2016-02-15 Seeing non-option arguments is not an error,
the accounting file name is passed once
@@ -2372,28 +2334,28 @@ process_command_line_arguments(int argc, char *argv[])
}
if (0 != back) {
-#line 2122 "pjsnmp.ctr"
+#line 2106 "pjsnmp.ctr"
s_name = get_option('s');
if (NULL != s_name) {
-#line 2124 "pjsnmp.ctr"
+#line 2108 "pjsnmp.ctr"
stt_file = fopen(s_name, "w");
if (NULL != stt_file) {
-#line 2126 "pjsnmp.ctr"
+#line 2110 "pjsnmp.ctr"
out_file = stt_file;
}
#if TRACE_DEBUG
else {
-#line 2130 "pjsnmp.ctr"
+#line 2114 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2135 "pjsnmp.ctr"
+#line 2119 "pjsnmp.ctr"
}
#endif
user_name = get_option('n');
@@ -2407,7 +2369,7 @@ process_command_line_arguments(int argc, char *argv[])
}
if (NULL == user_name) {
-#line 2147 "pjsnmp.ctr"
+#line 2131 "pjsnmp.ctr"
/* ERROR: No user name */
log_1_with_header(1, 69);
back = 0;
@@ -2415,12 +2377,12 @@ process_command_line_arguments(int argc, char *argv[])
#if TRACE_DEBUG
else {
-#line 2153 "pjsnmp.ctr"
+#line 2137 "pjsnmp.ctr"
}
#endif
if (0 != back) {
-#line 2156 "pjsnmp.ctr"
+#line 2140 "pjsnmp.ctr"
queue_name = get_option('P');
if (NULL == queue_name) queue_name = get_option('Q');
if (NULL != queue_name) {
@@ -2432,7 +2394,7 @@ process_command_line_arguments(int argc, char *argv[])
}
if (NULL == queue_name) {
-#line 2166 "pjsnmp.ctr"
+#line 2150 "pjsnmp.ctr"
/* ERROR: No queue name */
log_1_with_header(1, 70);
back = 0;
@@ -2440,14 +2402,14 @@ process_command_line_arguments(int argc, char *argv[])
#if TRACE_DEBUG
else {
-#line 2172 "pjsnmp.ctr"
+#line 2156 "pjsnmp.ctr"
}
#endif
}
if (0 != back) {
job_name = get_option('A');
-#line 2177 "pjsnmp.ctr"
+#line 2161 "pjsnmp.ctr"
if (NULL == job_name) job_name = get_option('j');
if (NULL == job_name) job_name = get_option('t');
if (NULL == job_name) job_name = get_option('D');
@@ -2472,7 +2434,7 @@ process_command_line_arguments(int argc, char *argv[])
}
if (NULL == job_name) {
-#line 2200 "pjsnmp.ctr"
+#line 2184 "pjsnmp.ctr"
/* ERROR: No job name */
log_1_with_header(1, 71);
back = 0;
@@ -2480,13 +2442,13 @@ process_command_line_arguments(int argc, char *argv[])
#if TRACE_DEBUG
else {
-#line 2206 "pjsnmp.ctr"
+#line 2190 "pjsnmp.ctr"
}
#endif
}
if (0 != back) {
-#line 2210 "pjsnmp.ctr"
+#line 2194 "pjsnmp.ctr"
job_title = get_option('J');
if (NULL == job_title) job_title = get_option('f');
if (NULL == job_title) job_title = get_option('N');
@@ -2502,21 +2464,21 @@ process_command_line_arguments(int argc, char *argv[])
*/
if (NULL == job_title) {
-#line 2224 "pjsnmp.ctr"
+#line 2208 "pjsnmp.ctr"
back = 0;
}
#endif
#if TRACE_DEBUG
else {
-#line 2229 "pjsnmp.ctr"
+#line 2213 "pjsnmp.ctr"
}
#endif
}
}
-#line 2234 "pjsnmp.ctr"
+#line 2218 "pjsnmp.ctr"
return back;
}
@@ -2535,15 +2497,15 @@ set_string(char **dptr, char *src, const char *name)
int back = 0;
-#line 2251 "pjsnmp.ctr"
+#line 2235 "pjsnmp.ctr"
if (NULL != src) {
src = dk4str8_start(src, NULL);
if (NULL != src) {
-#line 2254 "pjsnmp.ctr"
+#line 2238 "pjsnmp.ctr"
if (NULL != *dptr) {
-#line 2255 "pjsnmp.ctr"
+#line 2239 "pjsnmp.ctr"
/* WARNING: Redefinition */
log_5_with_header(2, 72, 73, 74, name, src);
}
@@ -2551,18 +2513,18 @@ set_string(char **dptr, char *src, const char *name)
back = 1;
} else {
-#line 2261 "pjsnmp.ctr"
+#line 2245 "pjsnmp.ctr"
/* ERROR: Empty text */
log_3_with_header(2, 75, 76, name);
}
} else {
-#line 2265 "pjsnmp.ctr"
+#line 2249 "pjsnmp.ctr"
/* ERROR: Text string required */
log_3_with_header(2, 77, 78, name);
}
-#line 2268 "pjsnmp.ctr"
+#line 2252 "pjsnmp.ctr"
return back;
}
@@ -2583,7 +2545,7 @@ set_unsigned_short(unsigned short *dptr, char *src, const char *name)
unsigned short us;
-#line 2287 "pjsnmp.ctr"
+#line 2271 "pjsnmp.ctr"
if (NULL != src) {
src = dk4str8_start(src, NULL);
if (NULL != src) {
@@ -2592,27 +2554,27 @@ set_unsigned_short(unsigned short *dptr, char *src, const char *name)
*dptr = us;
back = 1;
-#line 2294 "pjsnmp.ctr"
+#line 2278 "pjsnmp.ctr"
} else {
-#line 2295 "pjsnmp.ctr"
+#line 2279 "pjsnmp.ctr"
/* ERROR: Not a number! */
log_5_with_header(2, 79, 80, 81, name, src);
}
} else {
-#line 2299 "pjsnmp.ctr"
+#line 2283 "pjsnmp.ctr"
/* ERROR: Empty text */
log_3_with_header(2, 75, 76, name);
}
} else {
-#line 2303 "pjsnmp.ctr"
+#line 2287 "pjsnmp.ctr"
/* ERROR: Numeric value required */
log_3_with_header(2, 77, 78, name);
}
-#line 2306 "pjsnmp.ctr"
+#line 2290 "pjsnmp.ctr"
return back;
}
@@ -2630,51 +2592,51 @@ set_snmp_version(long *dptr, char *src)
int back = 0;
-#line 2322 "pjsnmp.ctr"
+#line 2306 "pjsnmp.ctr"
if (NULL != src) {
src = dk4str8_start(src, NULL);
if (NULL != src) {
switch (dk4str8_array_index(snmp_version_names, src, 0)) {
case 0: {
-#line 2327 "pjsnmp.ctr"
+#line 2311 "pjsnmp.ctr"
*dptr = SNMP_VERSION_1;
back = 1;
} break;
case 1: case 2: {
-#line 2331 "pjsnmp.ctr"
+#line 2315 "pjsnmp.ctr"
*dptr = SNMP_VERSION_2c;
back = 1;
} break;
case 3: {
-#line 2335 "pjsnmp.ctr"
+#line 2319 "pjsnmp.ctr"
*dptr = SNMP_VERSION_3;
back = 1;
} break;
default: {
-#line 2339 "pjsnmp.ctr"
+#line 2323 "pjsnmp.ctr"
/* ERROR: Illegal SNMP version */
log_3_with_header(2, 82, 83, src);
} break;
}
} else {
-#line 2344 "pjsnmp.ctr"
+#line 2328 "pjsnmp.ctr"
/* ERROR: Empty text */
log_3_with_header(2, 75, 76, printcap_entry_names[9]);
}
} else {
-#line 2348 "pjsnmp.ctr"
+#line 2332 "pjsnmp.ctr"
/* ERROR: Value required */
log_3_with_header(2, 77, 78, printcap_entry_names[9]);
}
-#line 2352 "pjsnmp.ctr"
+#line 2336 "pjsnmp.ctr"
return back;
}
@@ -2696,28 +2658,28 @@ set_umax(dk4_um_t *dptr, char *src, const char *name)
int res; /* Operation result */
-#line 2372 "pjsnmp.ctr"
+#line 2356 "pjsnmp.ctr"
if (NULL != src) {
res = dk4ma_input_c8_dec_dk4_um_t(&i, src, &ep, 1, NULL);
if (0 != res) {
*dptr = i;
-#line 2376 "pjsnmp.ctr"
+#line 2360 "pjsnmp.ctr"
back = 1;
} else {
-#line 2378 "pjsnmp.ctr"
+#line 2362 "pjsnmp.ctr"
/* ERROR: Not a numeric value */
log_5_with_header(2, 84, 161, 86, name, src);
}
} else {
-#line 2382 "pjsnmp.ctr"
+#line 2366 "pjsnmp.ctr"
/* ERROR: Value required */
log_3_with_header(2, 77, 78, name);
}
-#line 2385 "pjsnmp.ctr"
+#line 2369 "pjsnmp.ctr"
return back;
}
@@ -2741,28 +2703,28 @@ set_integer(int *dptr, char *src, const char *name)
int res; /* Operation result */
-#line 2407 "pjsnmp.ctr"
+#line 2391 "pjsnmp.ctr"
if (NULL != src) {
res = dk4ma_input_c8_dec_int(&i, src, &ep, 1, NULL);
if (0 != res) {
*dptr = i;
-#line 2411 "pjsnmp.ctr"
+#line 2395 "pjsnmp.ctr"
back = 1;
} else {
-#line 2413 "pjsnmp.ctr"
+#line 2397 "pjsnmp.ctr"
/* ERROR: Not a numeric value */
log_5_with_header(2, 84, 85, 86, name, src);
}
} else {
-#line 2417 "pjsnmp.ctr"
+#line 2401 "pjsnmp.ctr"
/* ERROR: Value required */
log_3_with_header(2, 77, 78, name);
}
-#line 2420 "pjsnmp.ctr"
+#line 2404 "pjsnmp.ctr"
return back;
}
@@ -2783,82 +2745,82 @@ process_one_config_item(char *ci)
int back = 1;
-#line 2439 "pjsnmp.ctr"
+#line 2423 "pjsnmp.ctr"
value = dk4str8_chr(ci, '=');
if (NULL != value) {
*(value++) = '\0';
value = dk4str8_start(value, NULL);
-#line 2443 "pjsnmp.ctr"
+#line 2427 "pjsnmp.ctr"
} else {
value = dk4str8_chr(ci, '@');
if (NULL != value) {
-#line 2446 "pjsnmp.ctr"
+#line 2430 "pjsnmp.ctr"
*value = '\0';
btrue = 0;
}
#if TRACE_DEBUG
else {
-#line 2451 "pjsnmp.ctr"
+#line 2435 "pjsnmp.ctr"
}
#endif
}
switch (dk4str8_array_index(printcap_entry_names, ci, 0)) {
case 0: {
-#line 2456 "pjsnmp.ctr"
+#line 2440 "pjsnmp.ctr"
if (0 == set_string(&host_name, value, printcap_entry_names[0])) {
back = 0;
}
} break;
case 1: {
-#line 2461 "pjsnmp.ctr"
+#line 2445 "pjsnmp.ctr"
if (0 == set_unsigned_short(&host_port, value, printcap_entry_names[1])) {
back = 0;
}
} break;
case 2: {
-#line 2466 "pjsnmp.ctr"
+#line 2450 "pjsnmp.ctr"
host_ordr = btrue;
} break;
case 3: {
-#line 2469 "pjsnmp.ctr"
+#line 2453 "pjsnmp.ctr"
acct_enab = btrue;
} break;
case 4: {
-#line 2472 "pjsnmp.ctr"
+#line 2456 "pjsnmp.ctr"
acct_achk = btrue;
} break;
case 5: {
-#line 2475 "pjsnmp.ctr"
+#line 2459 "pjsnmp.ctr"
if (0 == set_string(&acct_name, value, printcap_entry_names[5])) {
back = 0;
}
} break;
case 6: {
-#line 2480 "pjsnmp.ctr"
+#line 2464 "pjsnmp.ctr"
if (0 == set_string(&acct_host, value, printcap_entry_names[6])) {
back = 0;
}
} break;
case 7: {
-#line 2485 "pjsnmp.ctr"
+#line 2469 "pjsnmp.ctr"
if (0 == set_unsigned_short(&acct_port, value, printcap_entry_names[7])) {
back = 0;
}
} break;
case 8: {
-#line 2490 "pjsnmp.ctr"
+#line 2474 "pjsnmp.ctr"
if (NULL != value) {
if (0 == set_umax(&print_timeout, value, printcap_entry_names[8])) {
back = 0;
@@ -2870,60 +2832,60 @@ process_one_config_item(char *ci)
} break;
case 9: {
-#line 2500 "pjsnmp.ctr"
+#line 2484 "pjsnmp.ctr"
if (0 == set_snmp_version(&snmp_version, value)) {
back = 0;
}
} break;
case 10: {
-#line 2505 "pjsnmp.ctr"
+#line 2489 "pjsnmp.ctr"
if (0 == set_string(&snmp_comm, value, printcap_entry_names[10])) {
back = 0;
}
} break;
case 11: {
-#line 2510 "pjsnmp.ctr"
+#line 2494 "pjsnmp.ctr"
check_trans = btrue;
} break;
case 12: {
-#line 2513 "pjsnmp.ctr"
+#line 2497 "pjsnmp.ctr"
if (0 == set_string(&model_file, value, printcap_entry_names[12])) {
back = 0;
}
} break;
case 13: {
-#line 2518 "pjsnmp.ctr"
+#line 2502 "pjsnmp.ctr"
if (0 == set_string(&model_name, value, printcap_entry_names[13])) {
back = 0;
}
} break;
case 14: {
-#line 2523 "pjsnmp.ctr"
+#line 2507 "pjsnmp.ctr"
snmp_igfs = btrue;
} break;
case 15: {
-#line 2526 "pjsnmp.ctr"
+#line 2510 "pjsnmp.ctr"
acct_apcf = btrue;
} break;
case 16: {
-#line 2529 "pjsnmp.ctr"
+#line 2513 "pjsnmp.ctr"
pdes_always = btrue;
} break;
case 17: {
-#line 2532 "pjsnmp.ctr"
+#line 2516 "pjsnmp.ctr"
unkn_busy = btrue;
} break;
case 18: {
-#line 2535 "pjsnmp.ctr"
+#line 2519 "pjsnmp.ctr"
if (NULL != value) {
if (0 == set_umax(&unto_start, value, printcap_entry_names[18])) {
back = 0;
@@ -2935,7 +2897,7 @@ process_one_config_item(char *ci)
} break;
case 19: {
-#line 2545 "pjsnmp.ctr"
+#line 2529 "pjsnmp.ctr"
if (NULL != value) {
if (0 == set_umax(&unto_end, value, printcap_entry_names[19])) {
back = 0;
@@ -2947,7 +2909,7 @@ process_one_config_item(char *ci)
} break;
case 20: {
-#line 2555 "pjsnmp.ctr"
+#line 2539 "pjsnmp.ctr"
if (NULL != value) {
if (0 == set_umax(&unto_print, value, printcap_entry_names[20])) {
back = 0;
@@ -2959,17 +2921,17 @@ process_one_config_item(char *ci)
} break;
case 21: {
-#line 2565 "pjsnmp.ctr"
+#line 2549 "pjsnmp.ctr"
if (0 == set_unsigned_short(&local_port, value, printcap_entry_names[21]))
{
back = 0;
-#line 2568 "pjsnmp.ctr"
+#line 2552 "pjsnmp.ctr"
}
} break;
case 22: {
-#line 2571 "pjsnmp.ctr"
+#line 2555 "pjsnmp.ctr"
if (NULL != value) {
if (0 == set_umax(&unwt_print, value, printcap_entry_names[22])) {
back = 0;
@@ -2978,19 +2940,19 @@ process_one_config_item(char *ci)
if (0 == btrue) { unwt_print = (dk4_um_t)0UL; }
else {
-#line 2578 "pjsnmp.ctr"
+#line 2562 "pjsnmp.ctr"
back = 0;
}
}
} break;
case 23: {
-#line 2583 "pjsnmp.ctr"
+#line 2567 "pjsnmp.ctr"
read_responses = btrue;
} break;
case 24: {
-#line 2586 "pjsnmp.ctr"
+#line 2570 "pjsnmp.ctr"
force_printable_status_text = btrue;
} break;
case 25: {
@@ -3002,7 +2964,7 @@ process_one_config_item(char *ci)
if (0 == btrue) { erto_start = (dk4_um_t)0UL; }
else {
-#line 2596 "pjsnmp.ctr"
+#line 2580 "pjsnmp.ctr"
back = 0;
}
}
@@ -3016,7 +2978,7 @@ process_one_config_item(char *ci)
if (0 == btrue) { erto_end = (dk4_um_t)0UL; }
else {
-#line 2608 "pjsnmp.ctr"
+#line 2592 "pjsnmp.ctr"
back = 0;
}
}
@@ -3030,7 +2992,7 @@ process_one_config_item(char *ci)
if (0 == btrue) { erto_print = (dk4_um_t)0UL; }
else {
-#line 2620 "pjsnmp.ctr"
+#line 2604 "pjsnmp.ctr"
back = 0;
}
}
@@ -3046,7 +3008,7 @@ process_one_config_item(char *ci)
} break;
}
-#line 2634 "pjsnmp.ctr"
+#line 2618 "pjsnmp.ctr"
return back;
}
@@ -3054,18 +3016,17 @@ process_one_config_item(char *ci)
/** Check whether the line opens the model we are searching for.
@param str Text to check.
- @param bptr Address of success indicator.
@return 1 on success, 0 on error.
*/
static
int
-check_in_model(char *str, int *bptr, dk4_um_t lineno)
+check_in_model(char *str, dk4_um_t lineno)
{
char *ptr; /* Closing square bracket */
int back = 0;
-#line 2651 "pjsnmp.ctr"
+#line 2634 "pjsnmp.ctr"
str = dk4str8_start(str, NULL);
if (NULL != str) {
ptr = dk4str8_chr(str, ']');
@@ -3073,32 +3034,32 @@ check_in_model(char *str, int *bptr, dk4_um_t lineno)
*ptr = '\0';
dk4str8_normalize(str, NULL);
-#line 2657 "pjsnmp.ctr"
+#line 2640 "pjsnmp.ctr"
if (0 == strcmp(str, model_name)) {
back = 1;
-#line 2659 "pjsnmp.ctr"
+#line 2642 "pjsnmp.ctr"
}
#if TRACE_DEBUG
else {
-#line 2662 "pjsnmp.ctr"
+#line 2645 "pjsnmp.ctr"
}
#endif
} else {
-#line 2665 "pjsnmp.ctr"
+#line 2648 "pjsnmp.ctr"
/* ERROR: Syntax */
log_model_1(lineno, 87);
}
} else {
-#line 2669 "pjsnmp.ctr"
+#line 2652 "pjsnmp.ctr"
/* ERROR: Syntax */
log_model_1(lineno, 88);
}
-#line 2672 "pjsnmp.ctr"
+#line 2655 "pjsnmp.ctr"
return back;
}
@@ -3115,29 +3076,29 @@ set_state_mapping(int devst, int prst, int sumst)
{
-#line 2687 "pjsnmp.ctr"
+#line 2670 "pjsnmp.ctr"
if ((0 < devst) && (6 > devst)) {
if ((0 < prst) && (6 > prst)) {
-#line 2689 "pjsnmp.ctr"
+#line 2672 "pjsnmp.ctr"
summary_states[5 * devst + prst - 6] = sumst;
}
#if TRACE_DEBUG
else {
-#line 2693 "pjsnmp.ctr"
+#line 2676 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2698 "pjsnmp.ctr"
+#line 2681 "pjsnmp.ctr"
}
#endif
-#line 2701 "pjsnmp.ctr"
+#line 2684 "pjsnmp.ctr"
}
@@ -3154,32 +3115,32 @@ get_state_mapping(int devst, int prst)
int back = PJSNMP_ST_UNKNOWN;
-#line 2716 "pjsnmp.ctr"
+#line 2699 "pjsnmp.ctr"
if ((0 < devst) && (6 > devst)) {
if ((0 < prst) && (6 > prst)) {
-#line 2718 "pjsnmp.ctr"
+#line 2701 "pjsnmp.ctr"
back = summary_states[5 * devst + prst - 6];
-#line 2720 "pjsnmp.ctr"
+#line 2703 "pjsnmp.ctr"
}
#if TRACE_DEBUG
else {
-#line 2723 "pjsnmp.ctr"
+#line 2706 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2728 "pjsnmp.ctr"
+#line 2711 "pjsnmp.ctr"
}
#endif
-#line 2731 "pjsnmp.ctr"
+#line 2714 "pjsnmp.ctr"
return back;
}
@@ -3202,55 +3163,55 @@ model_conf_map(char *str, dk4_um_t lineno)
int back = 0;
-#line 2752 "pjsnmp.ctr"
+#line 2735 "pjsnmp.ctr"
psummary = dk4str8_next(str, NULL);
if (NULL != psummary) {
-#line 2754 "pjsnmp.ctr"
+#line 2737 "pjsnmp.ctr"
ppr = dk4str8_chr(str, '/');
if (NULL != ppr) {
-#line 2756 "pjsnmp.ctr"
+#line 2739 "pjsnmp.ctr"
*(ppr++) = '\0';
ppr = dk4str8_start(ppr, NULL);
if (NULL != ppr) {
-#line 2759 "pjsnmp.ctr"
+#line 2742 "pjsnmp.ctr"
back = 1;
switch (dk4str8_abbr_index(summary_state_names, '$', psummary, 0)) {
case 0: {
-#line 2762 "pjsnmp.ctr"
+#line 2745 "pjsnmp.ctr"
stsum = PJSNMP_ST_UNKNOWN;
} break;
case 1: {
-#line 2765 "pjsnmp.ctr"
+#line 2748 "pjsnmp.ctr"
stsum = PJSNMP_ST_ERROR;
} break;
case 2: {
-#line 2768 "pjsnmp.ctr"
+#line 2751 "pjsnmp.ctr"
stsum = PJSNMP_ST_BUSY;
} break;
case 3: {
-#line 2771 "pjsnmp.ctr"
+#line 2754 "pjsnmp.ctr"
stsum = PJSNMP_ST_IDLE;
} break;
case 4: {
-#line 2774 "pjsnmp.ctr"
+#line 2757 "pjsnmp.ctr"
stsum = PJSNMP_ST_WARMUP;
} break;
case 5: {
-#line 2777 "pjsnmp.ctr"
+#line 2760 "pjsnmp.ctr"
stsum = PJSNMP_ST_STANDBY;
} break;
default: {
-#line 2780 "pjsnmp.ctr"
+#line 2763 "pjsnmp.ctr"
back = 0;
/* ERROR: Illegal summary state */
log_model_3(lineno, 89, 90, psummary);
@@ -3258,11 +3219,11 @@ model_conf_map(char *str, dk4_um_t lineno)
}
if (0 != back) {
-#line 2786 "pjsnmp.ctr"
+#line 2769 "pjsnmp.ctr"
if (0 == strcmp(str, pjsnmp_kw[3])) {
if (0 == strcmp(ppr, pjsnmp_kw[3])) {
-#line 2788 "pjsnmp.ctr"
+#line 2771 "pjsnmp.ctr"
for (stdev = 1; stdev < 6; stdev++) {
for (stpri = 1; stpri < 6; stpri++) {
set_state_mapping(stdev, stpri, stsum);
@@ -3270,18 +3231,18 @@ model_conf_map(char *str, dk4_um_t lineno)
}
} else {
-#line 2794 "pjsnmp.ctr"
+#line 2777 "pjsnmp.ctr"
stpri = dk4str8_abbr_index(printer_status_names, '$', ppr, 0);
if (-1 < stpri) {
stpri++;
-#line 2797 "pjsnmp.ctr"
+#line 2780 "pjsnmp.ctr"
for (stdev = 1; stdev < 6; stdev++) {
set_state_mapping(stdev, stpri, stsum);
}
} else {
-#line 2801 "pjsnmp.ctr"
+#line 2784 "pjsnmp.ctr"
back = 0;
/* ERROR: Syntax, illegal printer status name */
log_model_3(lineno, 91, 92, ppr);
@@ -3292,25 +3253,25 @@ model_conf_map(char *str, dk4_um_t lineno)
if (-1 < stdev) {
stdev++;
-#line 2810 "pjsnmp.ctr"
+#line 2793 "pjsnmp.ctr"
if (0 == strcmp(ppr, pjsnmp_kw[3])) {
-#line 2811 "pjsnmp.ctr"
+#line 2794 "pjsnmp.ctr"
for (stpri = 1; stpri < 6; stpri++) {
set_state_mapping(stdev, stpri, stsum);
}
} else {
-#line 2815 "pjsnmp.ctr"
+#line 2798 "pjsnmp.ctr"
stpri = dk4str8_abbr_index(printer_status_names, '$', ppr, 0);
if (-1 < stpri) {
stpri++;
-#line 2818 "pjsnmp.ctr"
+#line 2801 "pjsnmp.ctr"
set_state_mapping(stdev, stpri, stsum);
} else {
-#line 2820 "pjsnmp.ctr"
+#line 2803 "pjsnmp.ctr"
back = 0;
/* ERROR: Syntax, illegal printer status name */
log_model_3(lineno, 91, 92, ppr);
@@ -3318,7 +3279,7 @@ model_conf_map(char *str, dk4_um_t lineno)
}
} else {
-#line 2826 "pjsnmp.ctr"
+#line 2809 "pjsnmp.ctr"
back = 0;
/* ERROR: Syntax, illegal device status name */
log_model_3(lineno, 93, 94, ppr);
@@ -3326,28 +3287,28 @@ model_conf_map(char *str, dk4_um_t lineno)
}
} else {
-#line 2832 "pjsnmp.ctr"
+#line 2815 "pjsnmp.ctr"
}
} else {
-#line 2834 "pjsnmp.ctr"
+#line 2817 "pjsnmp.ctr"
/* ERROR: Syntax, printer status missing */
log_model_1(lineno, 95);
}
} else {
-#line 2838 "pjsnmp.ctr"
+#line 2821 "pjsnmp.ctr"
/* ERROR: Syntax, printer status missing */
log_model_1(lineno, 95);
}
} else {
-#line 2842 "pjsnmp.ctr"
+#line 2825 "pjsnmp.ctr"
/* ERROR: Syntax, summary state missing */
log_model_1(lineno, 96);
}
-#line 2845 "pjsnmp.ctr"
+#line 2828 "pjsnmp.ctr"
return back;
}
@@ -3368,32 +3329,32 @@ model_conf_error_condition(char *str, int addcond, dk4_um_t lineno)
int back = 0;
-#line 2864 "pjsnmp.ctr"
+#line 2847 "pjsnmp.ctr"
if ((0 == addcond) && (0 == pdes_reset)) {
pdes_error = 0UL;
-#line 2866 "pjsnmp.ctr"
+#line 2849 "pjsnmp.ctr"
}
pdes_reset = 1;
dk4str8_normalize(str, NULL);
i = dk4str8_array_index(condition_names, str, 0);
-#line 2870 "pjsnmp.ctr"
+#line 2853 "pjsnmp.ctr"
if (-1 < i) {
back = 1;
cond = 0x80000000UL;
while (0 < i--) { cond = cond / 2UL; }
pdes_error |= cond;
-#line 2875 "pjsnmp.ctr"
+#line 2858 "pjsnmp.ctr"
} else {
-#line 2876 "pjsnmp.ctr"
+#line 2859 "pjsnmp.ctr"
/* ERROR: Syntax, illegal condition name */
log_model_3(lineno, 97, 98, str);
}
-#line 2879 "pjsnmp.ctr"
+#line 2862 "pjsnmp.ctr"
return back;
}
@@ -3416,11 +3377,11 @@ model_conf_status_oid(char *str, dk4_um_t lineno)
int res; /* Operation result */
-#line 2900 "pjsnmp.ctr"
+#line 2883 "pjsnmp.ctr"
dk4str8_normalize(str, NULL);
if ('.' == *str) {
-#line 2902 "pjsnmp.ctr"
+#line 2885 "pjsnmp.ctr"
str++;
}
while ((NULL != str) && (1 == back)) {
@@ -3429,35 +3390,35 @@ model_conf_status_oid(char *str, dk4_um_t lineno)
*(np++) = '\0';
}
-#line 2909 "pjsnmp.ctr"
+#line 2892 "pjsnmp.ctr"
ep = NULL;
res = dk4ma_input_c8_dec_dk4_um_t(&num, str, &ep, 1, NULL);
if (0 != res) {
-#line 2912 "pjsnmp.ctr"
+#line 2895 "pjsnmp.ctr"
if ((dk4_um_t)(MAX_SUBID) >= num) {
-#line 2913 "pjsnmp.ctr"
+#line 2896 "pjsnmp.ctr"
if (used < DK4_SIZEOF(oid_st,oid)) {
-#line 2914 "pjsnmp.ctr"
+#line 2897 "pjsnmp.ctr"
oid_st[used++] = (oid)num;
} else {
-#line 2916 "pjsnmp.ctr"
+#line 2899 "pjsnmp.ctr"
/* ERROR: Syntax, OID too long */
log_model_1(lineno, 99);
}
} else {
-#line 2920 "pjsnmp.ctr"
+#line 2903 "pjsnmp.ctr"
back = 0;
/* ERROR: Syntax, overflow */
log_model_3(lineno, 100, 101, str);
}
} else {
-#line 2925 "pjsnmp.ctr"
+#line 2908 "pjsnmp.ctr"
back = 0;
/* ERROR: Syntax, not a number */
log_model_3(lineno, 102, 103, str);
@@ -3466,7 +3427,7 @@ model_conf_status_oid(char *str, dk4_um_t lineno)
}
if (0 == used) {
-#line 2932 "pjsnmp.ctr"
+#line 2915 "pjsnmp.ctr"
back = 0;
/* ERROR: Syntax, empty OID */
log_model_1(lineno, 104);
@@ -3479,7 +3440,7 @@ model_conf_status_oid(char *str, dk4_um_t lineno)
by_oid_st = sz_oid_st * sizeof(oid);
-#line 2943 "pjsnmp.ctr"
+#line 2926 "pjsnmp.ctr"
return back;
}
@@ -3497,11 +3458,11 @@ remove_final_double_quote(char *str)
int back = 0;
-#line 2959 "pjsnmp.ctr"
+#line 2942 "pjsnmp.ctr"
ptr = dk4str8_rchr(str, '"');
if (NULL != ptr) {
-#line 2961 "pjsnmp.ctr"
+#line 2944 "pjsnmp.ctr"
*(ptr++) = '\0';
back = 1;
while ('\0' != *ptr) {
@@ -3511,7 +3472,7 @@ remove_final_double_quote(char *str)
if ('\n' != *ptr) {
back = 0;
-#line 2969 "pjsnmp.ctr"
+#line 2952 "pjsnmp.ctr"
}
}
}
@@ -3522,12 +3483,12 @@ remove_final_double_quote(char *str)
#if TRACE_DEBUG
else {
-#line 2978 "pjsnmp.ctr"
+#line 2961 "pjsnmp.ctr"
}
#endif
-#line 2981 "pjsnmp.ctr"
+#line 2964 "pjsnmp.ctr"
return back;
}
@@ -3554,7 +3515,7 @@ model_conf_state_text(char *str, int state, int start, dk4_um_t lineno)
unsigned char uc; /* Current byte found */
-#line 3006 "pjsnmp.ctr"
+#line 2989 "pjsnmp.ctr"
if (NULL == s_stn) {
s_stn = dk4sto_open(NULL);
if (NULL != s_stn) {
@@ -3566,55 +3527,55 @@ model_conf_state_text(char *str, int state, int start, dk4_um_t lineno)
}
if ((NULL != s_stn) && (NULL != i_stn)) {
-#line 3016 "pjsnmp.ctr"
+#line 2999 "pjsnmp.ctr"
if (NULL != str) {
-#line 3017 "pjsnmp.ctr"
+#line 3000 "pjsnmp.ctr"
if ('"' == *str) {
-#line 3018 "pjsnmp.ctr"
+#line 3001 "pjsnmp.ctr"
str++;
if (0 != remove_final_double_quote(str)) {
sl = strlen(str);
if (0 < sl) {
-#line 3022 "pjsnmp.ctr"
+#line 3005 "pjsnmp.ctr"
stptr = stt_new((unsigned char *)str, sl, state, start);
if (NULL != stptr) {
-#line 3024 "pjsnmp.ctr"
+#line 3007 "pjsnmp.ctr"
if (0 != dk4sto_add(s_stn, stptr, NULL)) {
back = 1;
-#line 3026 "pjsnmp.ctr"
+#line 3009 "pjsnmp.ctr"
} else {
-#line 3027 "pjsnmp.ctr"
+#line 3010 "pjsnmp.ctr"
/* ERROR: Allocation failed */
log_model_1(lineno, 105);
stt_delete(stptr);
}
} else {
-#line 3032 "pjsnmp.ctr"
+#line 3015 "pjsnmp.ctr"
/* ERROR: Allocation failed */
log_model_1(lineno, 105);
}
} else {
-#line 3036 "pjsnmp.ctr"
+#line 3019 "pjsnmp.ctr"
/* ERROR: Syntax, string empty */
log_model_1(lineno, 106);
}
} else {
-#line 3040 "pjsnmp.ctr"
+#line 3023 "pjsnmp.ctr"
/* ERROR: Syntax, closing double quote missing or text after */
log_model_1(lineno, 107);
}
} else {
-#line 3044 "pjsnmp.ctr"
+#line 3027 "pjsnmp.ctr"
sl = 0;
cptr = str;
back = 1;
@@ -3622,16 +3583,16 @@ model_conf_state_text(char *str, int state, int start, dk4_um_t lineno)
nptr = dk4str8_next(cptr, NULL);
ep = NULL;
-#line 3050 "pjsnmp.ctr"
+#line 3033 "pjsnmp.ctr"
res = dk4ma_input_c8_hex_uchar(&uc, cptr, &ep, 1, NULL);
if (0 != res) {
str[sl++] = (char)uc;
-#line 3053 "pjsnmp.ctr"
+#line 3036 "pjsnmp.ctr"
} else {
back = 0;
-#line 3055 "pjsnmp.ctr"
+#line 3038 "pjsnmp.ctr"
/* ERROR: Syntax, not a hexadecimal byte */
log_model_3(lineno, 108, 109, cptr);
}
@@ -3640,15 +3601,15 @@ model_conf_state_text(char *str, int state, int start, dk4_um_t lineno)
if (0 != back) {
if (0 < sl) {
-#line 3062 "pjsnmp.ctr"
+#line 3045 "pjsnmp.ctr"
stptr = stt_new((unsigned char *)str, sl, state, start);
if (NULL != stptr) {
-#line 3064 "pjsnmp.ctr"
+#line 3047 "pjsnmp.ctr"
if (0 == dk4sto_add(s_stn, stptr, NULL)) {
back = 0;
-#line 3066 "pjsnmp.ctr"
+#line 3049 "pjsnmp.ctr"
stt_delete(stptr);
/* ERROR: Allocation failed */
log_model_1(lineno, 105);
@@ -3656,19 +3617,19 @@ model_conf_state_text(char *str, int state, int start, dk4_um_t lineno)
#if TRACE_DEBUG
else {
-#line 3072 "pjsnmp.ctr"
+#line 3055 "pjsnmp.ctr"
}
#endif
} else {
-#line 3075 "pjsnmp.ctr"
+#line 3058 "pjsnmp.ctr"
back = 0;
/* ERROR: Memory allocation failed */
log_model_1(lineno, 105);
}
} else {
-#line 3080 "pjsnmp.ctr"
+#line 3063 "pjsnmp.ctr"
/* ERROR: Syntax, empty string */
log_model_1(lineno, 106);
}
@@ -3676,18 +3637,18 @@ model_conf_state_text(char *str, int state, int start, dk4_um_t lineno)
}
} else {
-#line 3086 "pjsnmp.ctr"
+#line 3069 "pjsnmp.ctr"
/* ERROR: Value required */
log_model_1(lineno, 110);
}
} else {
-#line 3090 "pjsnmp.ctr"
+#line 3073 "pjsnmp.ctr"
/* ERROR: Memory allocation failed */
log_model_1(lineno, 105);
}
-#line 3093 "pjsnmp.ctr"
+#line 3076 "pjsnmp.ctr"
return back;
}
@@ -3706,17 +3667,17 @@ process_model_line(char *str, dk4_um_t lineno)
int back = 0;
-#line 3110 "pjsnmp.ctr"
+#line 3093 "pjsnmp.ctr"
valptr = dk4str8_chr(str, '=');
if (NULL != valptr) {
-#line 3112 "pjsnmp.ctr"
+#line 3095 "pjsnmp.ctr"
*(valptr++) = '\0';
dk4str8_normalize(str, NULL);
valptr = dk4str8_start(valptr, NULL);
if (NULL != valptr) {
-#line 3116 "pjsnmp.ctr"
+#line 3099 "pjsnmp.ctr"
switch (dk4str8_array_index(model_keys, str, 0)) {
case 0: {
back = model_conf_map(valptr, lineno);
@@ -3788,25 +3749,25 @@ process_model_line(char *str, dk4_um_t lineno)
} break;
default: {
-#line 3186 "pjsnmp.ctr"
+#line 3169 "pjsnmp.ctr"
/* ERROR: Syntax, unknown key */
log_model_3(lineno, 113, 114, str);
} break;
}
} else {
-#line 3191 "pjsnmp.ctr"
+#line 3174 "pjsnmp.ctr"
/* ERROR: Syntax, missing value */
log_model_1(lineno, 110);
}
} else {
-#line 3195 "pjsnmp.ctr"
+#line 3178 "pjsnmp.ctr"
/* ERROR: Syntax, missing value */
log_model_1(lineno, 110);
}
-#line 3198 "pjsnmp.ctr"
+#line 3181 "pjsnmp.ctr"
return back;
}
@@ -3826,23 +3787,23 @@ process_model_setup(void)
int back = 0;
-#line 3216 "pjsnmp.ctr"
+#line 3199 "pjsnmp.ctr"
infile = fopen(((NULL != model_file) ? model_file : def_model_file), "r");
if (NULL != infile) {
-#line 3218 "pjsnmp.ctr"
+#line 3201 "pjsnmp.ctr"
back = 1;
while (NULL != fgets(pjsnmp_buf, sizeof(pjsnmp_buf), infile)) {
lineno++;
#if TRACE_DEBUG
dk4str8_delnl(pjsnmp_buf);
-#line 3223 "pjsnmp.ctr"
+#line 3206 "pjsnmp.ctr"
#endif
p1 = dk4str8_start(pjsnmp_buf, NULL);
if (NULL != p1) {
if ('[' == *p1) {
- in_model = check_in_model(++p1, &back, lineno);
+ in_model = check_in_model(++p1, lineno);
if (0 != in_model) {
found = 1;
}
@@ -3863,14 +3824,14 @@ process_model_setup(void)
fclose(infile);
if (0 == found) {
-#line 3247 "pjsnmp.ctr"
+#line 3230 "pjsnmp.ctr"
back = 0;
/* ERROR: Model not found */
log_model_3((dk4_um_t)0UL, 115, 116, model_name);
}
} else {
-#line 3252 "pjsnmp.ctr"
+#line 3235 "pjsnmp.ctr"
/* ERROR: Failed to open model file */
log_model_3(
(dk4_um_t)0UL, 115, 116,
@@ -3878,7 +3839,7 @@ process_model_setup(void)
);
}
-#line 3258 "pjsnmp.ctr"
+#line 3241 "pjsnmp.ctr"
return back;
}
@@ -3903,19 +3864,19 @@ process_setup(void)
int back = 0;
-#line 3281 "pjsnmp.ctr"
+#line 3264 "pjsnmp.ctr"
ptr = getenv(pjsnmp_kw[2]);
if (NULL != ptr) {
-#line 3284 "pjsnmp.ctr"
+#line 3267 "pjsnmp.ctr"
printcap_entry = dk4str8_dup(ptr, NULL);
if (NULL != printcap_entry) {
-#line 3286 "pjsnmp.ctr"
+#line 3269 "pjsnmp.ctr"
back = 1;
-#line 3287 "pjsnmp.ctr"
+#line 3270 "pjsnmp.ctr"
cl = printcap_entry;
while (NULL != cl) {
nl = dk4str8_chr(cl, '\n');
@@ -3924,7 +3885,7 @@ process_setup(void)
nl = dk4str8_start(nl, NULL);
}
-#line 3294 "pjsnmp.ctr"
+#line 3277 "pjsnmp.ctr"
ptr = cl;
while ('\0' != *ptr) {
if ('\r' == *ptr) { *ptr = '\0'; } else { ptr++; }
@@ -3938,14 +3899,14 @@ process_setup(void)
*(ni++) = '\0'; ni = dk4str8_start(ni, NULL);
}
-#line 3306 "pjsnmp.ctr"
+#line 3289 "pjsnmp.ctr"
ci = dk4str8_start(ci, NULL);
if (NULL != ci) {
if (0 != found) {
if (0 == process_one_config_item(ci)) {
back = 0;
-#line 3311 "pjsnmp.ctr"
+#line 3294 "pjsnmp.ctr"
}
}
found = 1;
@@ -3959,7 +3920,7 @@ process_setup(void)
if (NULL == host_name) {
back = 0;
-#line 3323 "pjsnmp.ctr"
+#line 3306 "pjsnmp.ctr"
/* ERROR: Host name of printer required */
log_1_with_header(2, 119);
}
@@ -3967,13 +3928,13 @@ process_setup(void)
if (NULL != model_name) {
back = process_model_setup();
-#line 3329 "pjsnmp.ctr"
+#line 3312 "pjsnmp.ctr"
}
}
if (0 != back) {
if (0 != acct_achk) {
-#line 3333 "pjsnmp.ctr"
+#line 3316 "pjsnmp.ctr"
acct_enab = 1;
}
if (0 != acct_enab) {
@@ -3987,19 +3948,19 @@ process_setup(void)
}
} else {
-#line 3345 "pjsnmp.ctr"
+#line 3328 "pjsnmp.ctr"
/* ERROR: Memory allocation failed */
log_1_with_header(2, 105);
}
} else {
-#line 3349 "pjsnmp.ctr"
+#line 3332 "pjsnmp.ctr"
/* ERROR: Missing printcap entry environment variable */
log_1_with_header(2, 120);
}
-#line 3353 "pjsnmp.ctr"
+#line 3336 "pjsnmp.ctr"
return back;
}
@@ -4015,39 +3976,39 @@ eatup_input(void)
int cc = 1;
-#line 3367 "pjsnmp.ctr"
+#line 3350 "pjsnmp.ctr"
do {
if (0 != can_continue(0)) {
if (0 == have_eof) {
-#line 3370 "pjsnmp.ctr"
+#line 3353 "pjsnmp.ctr"
rdb = fread(pjsnmp_buf, 1, sizeof(pjsnmp_buf), stdin);
if (0 == rdb) {
-#line 3372 "pjsnmp.ctr"
+#line 3355 "pjsnmp.ctr"
cc = 0;
have_eof = 1;
}
#if TRACE_DEBUG
else {
-#line 3377 "pjsnmp.ctr"
+#line 3360 "pjsnmp.ctr"
}
#endif
} else {
-#line 3380 "pjsnmp.ctr"
+#line 3363 "pjsnmp.ctr"
cc = 0;
}
} else {
-#line 3383 "pjsnmp.ctr"
+#line 3366 "pjsnmp.ctr"
cc = -1;
}
} while (1 == cc);
-#line 3387 "pjsnmp.ctr"
+#line 3370 "pjsnmp.ctr"
}
@@ -4061,7 +4022,7 @@ relase_status_text_nodes(void)
status_text_t *ptr; /* Current node to release */
-#line 3399 "pjsnmp.ctr"
+#line 3382 "pjsnmp.ctr"
if (NULL != s_stn) {
if (NULL != i_stn) {
dk4sto_it_reset(i_stn);
@@ -4069,7 +4030,7 @@ relase_status_text_nodes(void)
ptr = (status_text_t *)dk4sto_it_next(i_stn);
if (NULL != ptr) {
-#line 3405 "pjsnmp.ctr"
+#line 3388 "pjsnmp.ctr"
stt_delete(ptr);
}
} while(NULL != ptr);
@@ -4079,7 +4040,7 @@ relase_status_text_nodes(void)
}
-#line 3413 "pjsnmp.ctr"
+#line 3396 "pjsnmp.ctr"
}
@@ -4091,39 +4052,39 @@ static
int
attempt_snmp_session(void)
{
- struct snmp_session template; /* Template for the session */
+ struct snmp_session sesstemp; /* Template for the session */
int back = 0;
-#line 3427 "pjsnmp.ctr"
+#line 3410 "pjsnmp.ctr"
init_snmp(pjsnmp_kw[4]);
- DK4_MEMRES(&template, sizeof(template));
- snmp_sess_init(&template);
- template.version = snmp_version;
- template.peername = host_name;
- template.community = (unsigned char *)snmp_comm;
+ DK4_MEMRES(&sesstemp, sizeof(sesstemp));
+ snmp_sess_init(&sesstemp);
+ sesstemp.version = snmp_version;
+ sesstemp.peername = host_name;
+ sesstemp.community = (unsigned char *)snmp_comm;
if (NULL == snmp_comm) {
- template.community = (unsigned char *)(pjsnmp_kw[5]);
+ sesstemp.community = (unsigned char *)(pjsnmp_kw[5]);
}
- template.community_len = strlen((char *)(template.community));
- snmp_sess = snmp_open(&template);
+ sesstemp.community_len = strlen((char *)(sesstemp.community));
+ snmp_sess = snmp_open(&sesstemp);
if (NULL != snmp_sess) {
-#line 3439 "pjsnmp.ctr"
+#line 3422 "pjsnmp.ctr"
back = 1;
} else {
-#line 3441 "pjsnmp.ctr"
+#line 3424 "pjsnmp.ctr"
/* ERROR: Failed to open SNMP session */
log_1_no_header(121);
if (0 != snmp_igfs) {
-#line 3444 "pjsnmp.ctr"
+#line 3427 "pjsnmp.ctr"
back = 1;
}
}
-#line 3447 "pjsnmp.ctr"
+#line 3430 "pjsnmp.ctr"
return back;
}
@@ -4147,109 +4108,108 @@ accounting_ex_socket(dk4_socket_t sock, int expect_response)
int back = 0;
-#line 3469 "pjsnmp.ctr"
+#line 3452 "pjsnmp.ctr"
cutted = 0;
if (0 != can_continue(0)) {
-#line 3471 "pjsnmp.ctr"
+#line 3454 "pjsnmp.ctr"
sl = strlen(pjsnmp_buf);
by = sl;
res = dk4socket_send(sock, pjsnmp_buf, &by, 0, 0L, 0L, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 3475 "pjsnmp.ctr"
+#line 3458 "pjsnmp.ctr"
if (by == sl) {
-#line 3476 "pjsnmp.ctr"
+#line 3459 "pjsnmp.ctr"
back = 1;
-#line 3477 "pjsnmp.ctr"
+#line 3460 "pjsnmp.ctr"
} else {
-#line 3478 "pjsnmp.ctr"
+#line 3461 "pjsnmp.ctr"
/* ERROR: Partial send */
log_1_no_header(123);
}
} else {
-#line 3482 "pjsnmp.ctr"
+#line 3465 "pjsnmp.ctr"
/* ERROR: Failed to send data */
log_1_no_header(122);
}
- sl = 0;
pjsnmp_buf[0] = '\0';
res = dk4socket_shutdown(sock, DK4_SOCKET_SHUT_WRITE, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 3489 "pjsnmp.ctr"
+#line 3471 "pjsnmp.ctr"
cc = 1;
do {
if (0 != can_continue(0)) {
-#line 3492 "pjsnmp.ctr"
+#line 3474 "pjsnmp.ctr"
by = sizeof(stat_text) - 1;
res = dk4socket_recv(sock, stat_text, &by, 0, 0L, 0L, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 3495 "pjsnmp.ctr"
+#line 3477 "pjsnmp.ctr"
if (0 < by) {
-#line 3496 "pjsnmp.ctr"
+#line 3478 "pjsnmp.ctr"
stat_text[by] = '\0';
res = dk4str8_cat_s(pjsnmp_buf,sizeof(pjsnmp_buf),stat_text,NULL);
if (0 == res) {
cutted = 1;
-#line 3500 "pjsnmp.ctr"
+#line 3482 "pjsnmp.ctr"
back = 0;
}
} else {
-#line 3503 "pjsnmp.ctr"
+#line 3485 "pjsnmp.ctr"
cc = 0;
}
} else {
-#line 3506 "pjsnmp.ctr"
+#line 3488 "pjsnmp.ctr"
cc = -1;
}
} else {
-#line 3509 "pjsnmp.ctr"
+#line 3491 "pjsnmp.ctr"
cc = -1;
back = 0;
}
} while(1 == cc);
} else {
-#line 3514 "pjsnmp.ctr"
+#line 3496 "pjsnmp.ctr"
back = 0;
/* ERROR: Socket shutdown failed */
log_1_no_header(124);
}
if (0 != expect_response) {
-#line 3519 "pjsnmp.ctr"
+#line 3501 "pjsnmp.ctr"
if (0 == strlen(pjsnmp_buf)) {
-#line 3520 "pjsnmp.ctr"
+#line 3502 "pjsnmp.ctr"
back = 0;
}
if (0 != cutted) {
-#line 3523 "pjsnmp.ctr"
+#line 3505 "pjsnmp.ctr"
back = 0;
}
}
} else {
-#line 3527 "pjsnmp.ctr"
+#line 3509 "pjsnmp.ctr"
pjsnmp_buf[0] = '\0';
}
dk4socket_close(sock, NULL);
-#line 3531 "pjsnmp.ctr"
+#line 3513 "pjsnmp.ctr"
return back;
}
@@ -4267,7 +4227,7 @@ accounting_ex_local_socket(int expect_response)
int back = 0;
-#line 3547 "pjsnmp.ctr"
+#line 3529 "pjsnmp.ctr"
sock = dk4socket_c8_unix_client(acct_name, NULL);
if (INVALID_SOCKET != sock) {
back = accounting_ex_socket(sock, expect_response);
@@ -4279,7 +4239,7 @@ accounting_ex_local_socket(int expect_response)
}
-#line 3557 "pjsnmp.ctr"
+#line 3539 "pjsnmp.ctr"
return back;
}
@@ -4297,7 +4257,7 @@ accounting_ex_network(int expect_response)
int back = 0;
-#line 3573 "pjsnmp.ctr"
+#line 3555 "pjsnmp.ctr"
sock = dk4socket_c8_tcp_client_host_port(acct_host,acct_port,0,0L,0L,NULL);
if (INVALID_SOCKET != sock) {
back = accounting_ex_socket(sock, expect_response);
@@ -4309,7 +4269,7 @@ accounting_ex_network(int expect_response)
}
-#line 3583 "pjsnmp.ctr"
+#line 3565 "pjsnmp.ctr"
return back;
}
@@ -4327,36 +4287,36 @@ accounting_ex_file(FILE *fipo, int expect_response)
int back = 0;
-#line 3599 "pjsnmp.ctr"
+#line 3581 "pjsnmp.ctr"
if (EOF != fputs(pjsnmp_buf, fipo)) {
-#line 3600 "pjsnmp.ctr"
+#line 3582 "pjsnmp.ctr"
if (EOF != fflush(fipo)) {
-#line 3601 "pjsnmp.ctr"
+#line 3583 "pjsnmp.ctr"
back = 1;
}
#if TRACE_DEBUG
else {
-#line 3605 "pjsnmp.ctr"
+#line 3587 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 3610 "pjsnmp.ctr"
+#line 3592 "pjsnmp.ctr"
}
#endif
pjsnmp_buf[0] = '\0';
if (0 != expect_response) {
-#line 3614 "pjsnmp.ctr"
+#line 3596 "pjsnmp.ctr"
back = 0;
}
-#line 3616 "pjsnmp.ctr"
+#line 3598 "pjsnmp.ctr"
return back;
}
@@ -4376,15 +4336,15 @@ accounting_ex_pipe(int expect_response)
int pcres = 0; /* Result from pclose */
-#line 3634 "pjsnmp.ctr"
+#line 3616 "pjsnmp.ctr"
prgn = dk4str8_start(&(acct_name[1]), NULL);
if (NULL != prgn) {
-#line 3636 "pjsnmp.ctr"
+#line 3618 "pjsnmp.ctr"
fipo = popen(prgn, "w");
if (NULL != fipo) {
-#line 3638 "pjsnmp.ctr"
+#line 3620 "pjsnmp.ctr"
back = accounting_ex_file(fipo, 0);
pcres = pclose(fipo);
pjsnmp_buf[0] = '\0';
@@ -4395,7 +4355,7 @@ accounting_ex_pipe(int expect_response)
} break;
case LPRNG_EXIT_HOLD : {
decision = 2;
- }
+ } break;
default : {
decision = 1;
} break;
@@ -4404,20 +4364,20 @@ accounting_ex_pipe(int expect_response)
}
} else {
-#line 3656 "pjsnmp.ctr"
+#line 3638 "pjsnmp.ctr"
/* ERROR: Failed to start program for pipe */
log_1_no_header(126);
pjsnmp_buf[0] = '\0';
}
} else {
-#line 3661 "pjsnmp.ctr"
+#line 3643 "pjsnmp.ctr"
/* ERROR: Not command name found */
log_1_with_header(2, 127);
pjsnmp_buf[0] = '\0';
}
-#line 3665 "pjsnmp.ctr"
+#line 3647 "pjsnmp.ctr"
return back;
}
@@ -4438,32 +4398,32 @@ accounting_ex_filename(int expect_response, int crf)
int tests = DK4_FOPEN_SC_USER; /* Security tests for fopen */
-#line 3684 "pjsnmp.ctr"
+#line 3666 "pjsnmp.ctr"
if (0 != dk4isadmin()) {
-#line 3685 "pjsnmp.ctr"
+#line 3667 "pjsnmp.ctr"
tests = DK4_FOPEN_SC_PRIVILEGED;
}
dk4error_init(&er);
fipo = dk4fopen_c8(acct_name, ((0 != crf) ? "w" : "a"), tests, &er);
if (NULL != fipo) {
-#line 3690 "pjsnmp.ctr"
+#line 3672 "pjsnmp.ctr"
back = accounting_ex_file(fipo, expect_response);
if(EOF == fclose(fipo)) {
-#line 3692 "pjsnmp.ctr"
+#line 3674 "pjsnmp.ctr"
back = 0;
}
} else {
-#line 3695 "pjsnmp.ctr"
+#line 3677 "pjsnmp.ctr"
/* ERROR: Failed to open accounting file name */
log_1_no_header(128);
pjsnmp_buf[0] = '\0';
}
-#line 3699 "pjsnmp.ctr"
+#line 3681 "pjsnmp.ctr"
return back;
}
@@ -4490,46 +4450,46 @@ accounting_ex_fd3(int expect_response)
int back = 0;
-#line 3724 "pjsnmp.ctr"
+#line 3706 "pjsnmp.ctr"
sl = strlen(pjsnmp_buf);
bwr = write(3, pjsnmp_buf, sl);
pjsnmp_buf[0] = '\0';
if (0 < bwr) {
-#line 3728 "pjsnmp.ctr"
+#line 3710 "pjsnmp.ctr"
if (sl == (size_t)bwr) {
-#line 3729 "pjsnmp.ctr"
+#line 3711 "pjsnmp.ctr"
back = 1;
} else {
-#line 3731 "pjsnmp.ctr"
+#line 3713 "pjsnmp.ctr"
/* ERROR: Incomplete write operation */
log_1_no_header(122);
}
if (0 != expect_response) {
-#line 3735 "pjsnmp.ctr"
+#line 3717 "pjsnmp.ctr"
bwr = read(3, pjsnmp_buf, sizeof(pjsnmp_buf));
if (0 < bwr) {
-#line 3737 "pjsnmp.ctr"
+#line 3719 "pjsnmp.ctr"
pjsnmp_buf[bwr] = '\0';
} else {
-#line 3739 "pjsnmp.ctr"
+#line 3721 "pjsnmp.ctr"
pjsnmp_buf[0] = '\0';
back = 0;
}
}
} else {
-#line 3744 "pjsnmp.ctr"
+#line 3726 "pjsnmp.ctr"
/* ERROR: Write failed */
log_1_no_header(122);
}
-#line 3747 "pjsnmp.ctr"
+#line 3729 "pjsnmp.ctr"
return back;
}
@@ -4555,22 +4515,22 @@ accounting_exchange(int expect_response)
int crf = 0; /* Flag: Create log file */
-#line 3771 "pjsnmp.ctr"
+#line 3753 "pjsnmp.ctr"
if ((NULL != acct_host) && (0 < acct_port)) {
-#line 3772 "pjsnmp.ctr"
+#line 3754 "pjsnmp.ctr"
log_1_no_header(154);
back = accounting_ex_network(expect_response);
log_1_no_header((0 != back) ? 159 : 160);
} else {
-#line 3776 "pjsnmp.ctr"
+#line 3758 "pjsnmp.ctr"
if (NULL != acct_name) {
-#line 3777 "pjsnmp.ctr"
+#line 3759 "pjsnmp.ctr"
if ('|' == *acct_name) {
-#line 3778 "pjsnmp.ctr"
+#line 3760 "pjsnmp.ctr"
#if 0
if (0 != expect_response) {
/* ERROR: Can not receive response from pipe */
@@ -4582,17 +4542,17 @@ accounting_exchange(int expect_response)
log_1_no_header((0 != back) ? 159 : 160);
} else {
-#line 3788 "pjsnmp.ctr"
+#line 3770 "pjsnmp.ctr"
if (0 != dk4stat_c8(&stb, acct_name, NULL)) {
if (0 != dk4stat_is_unix_domain_socket(&stb, NULL)) {
issock = 1;
-#line 3791 "pjsnmp.ctr"
+#line 3773 "pjsnmp.ctr"
}
} else {
crf = 1;
-#line 3794 "pjsnmp.ctr"
+#line 3776 "pjsnmp.ctr"
}
if (0 != issock) {
log_1_no_header(156);
@@ -4610,7 +4570,7 @@ accounting_exchange(int expect_response)
}
} else {
-#line 3810 "pjsnmp.ctr"
+#line 3792 "pjsnmp.ctr"
#if 0
log_1_no_header(158);
back = accounting_ex_fd3(expect_response);
@@ -4621,7 +4581,7 @@ accounting_exchange(int expect_response)
}
}
-#line 3819 "pjsnmp.ctr"
+#line 3801 "pjsnmp.ctr"
return back;
}
@@ -4639,10 +4599,10 @@ check_permission(void)
const size_t bsz = sizeof(pjsnmp_buf); /* Buffer size */
-#line 3835 "pjsnmp.ctr"
+#line 3817 "pjsnmp.ctr"
if ((0 != acct_enab) && (0 != acct_achk)) {
-#line 3836 "pjsnmp.ctr"
+#line 3818 "pjsnmp.ctr"
/* LOG: Checking print permission */
log_5_no_header(131, 132, 133, user_name, queue_name);
if(0 != dk4str8_cpy_s(pjsnmp_buf, bsz, pjsnmp_kw[6], NULL)) {
@@ -4653,16 +4613,16 @@ check_permission(void)
if(0 != dk4str8_cat_s(pjsnmp_buf, bsz, pjsnmp_kw[0], NULL)) {
back = 0;
-#line 3845 "pjsnmp.ctr"
+#line 3827 "pjsnmp.ctr"
if (0 != accounting_exchange(1)) {
-#line 3846 "pjsnmp.ctr"
+#line 3828 "pjsnmp.ctr"
dk4str8_normalize(pjsnmp_buf, NULL);
-#line 3847 "pjsnmp.ctr"
+#line 3829 "pjsnmp.ctr"
if (0 < strlen(pjsnmp_buf)) {
-#line 3848 "pjsnmp.ctr"
+#line 3830 "pjsnmp.ctr"
if (0 != decision) {
res = decision - 1;
} else {
@@ -4673,18 +4633,18 @@ check_permission(void)
case 0: {
back = 1;
-#line 3857 "pjsnmp.ctr"
+#line 3839 "pjsnmp.ctr"
} break;
case 1: {
-#line 3859 "pjsnmp.ctr"
+#line 3841 "pjsnmp.ctr"
exval = LPRNG_EXIT_HOLD;
} break;
}
log_3_no_header(166, 167, pjsnmp_buf);
} else {
-#line 3864 "pjsnmp.ctr"
+#line 3846 "pjsnmp.ctr"
#if 0
/* 2016-02-15 An empty response indicates permission
to print.
@@ -4695,7 +4655,7 @@ check_permission(void)
}
} else {
-#line 3873 "pjsnmp.ctr"
+#line 3855 "pjsnmp.ctr"
if (0 != acct_apcf) { back = 1; }
else { decision = 3; }
}
@@ -4709,7 +4669,7 @@ check_permission(void)
log_1_no_header((0 != back) ? 134 : 135);
}
-#line 3885 "pjsnmp.ctr"
+#line 3867 "pjsnmp.ctr"
return back;
}
@@ -4731,11 +4691,11 @@ get_int(int *iptr, struct variable_list *var)
int back = 0;
-#line 3905 "pjsnmp.ctr"
+#line 3887 "pjsnmp.ctr"
switch (var->type) {
case ASN_OCTET_STR : {
-#line 3907 "pjsnmp.ctr"
+#line 3889 "pjsnmp.ctr"
if ((var->val_len > 0) && (var->val_len < sizeof(bu))) {
dk4mem_cpy(bu, (void *)((var->val).string), var->val_len, NULL);
bu[var->val_len] = '\0';
@@ -4750,7 +4710,7 @@ get_int(int *iptr, struct variable_list *var)
case ASN_COUNTER :
case ASN_INTEGER : {
-#line 3920 "pjsnmp.ctr"
+#line 3902 "pjsnmp.ctr"
l = *((var->val).integer);
*iptr = (int)l;
back = 1;
@@ -4758,7 +4718,7 @@ get_int(int *iptr, struct variable_list *var)
}
-#line 3926 "pjsnmp.ctr"
+#line 3908 "pjsnmp.ctr"
return back;
}
@@ -4778,11 +4738,11 @@ get_ul(unsigned long *ulptr, struct variable_list *var)
int back = 0;
-#line 3944 "pjsnmp.ctr"
+#line 3926 "pjsnmp.ctr"
switch (var->type) {
case ASN_OCTET_STR : {
-#line 3946 "pjsnmp.ctr"
+#line 3928 "pjsnmp.ctr"
if (0 < var->val_len) {
ul |=
((((unsigned long)(((var->val).string)[0])) << 24) & 0xFF000000UL);
@@ -4809,7 +4769,7 @@ get_ul(unsigned long *ulptr, struct variable_list *var)
case ASN_COUNTER :
case ASN_INTEGER : {
-#line 3971 "pjsnmp.ctr"
+#line 3953 "pjsnmp.ctr"
l = *((var->val).integer);
if (0L <= l) {
*ulptr = (unsigned long)l;
@@ -4819,7 +4779,7 @@ get_ul(unsigned long *ulptr, struct variable_list *var)
}
-#line 3979 "pjsnmp.ctr"
+#line 3961 "pjsnmp.ctr"
return back;
}
@@ -4837,7 +4797,7 @@ contains_non_ascii(const char *ptr, size_t i)
int back = 0;
-#line 3995 "pjsnmp.ctr"
+#line 3977 "pjsnmp.ctr"
while ((0 == back) && (0 < i)) {
if (0x7F < (unsigned char)(*(ptr++))) {
back = 1;
@@ -4845,7 +4805,7 @@ contains_non_ascii(const char *ptr, size_t i)
i--;
}
-#line 4001 "pjsnmp.ctr"
+#line 3983 "pjsnmp.ctr"
return back;
}
@@ -4919,7 +4879,7 @@ oid_index(oid *p, size_t sz)
int back = -1;
-#line 4073 "pjsnmp.ctr"
+#line 4055 "pjsnmp.ctr"
if (0 != oids_equal(p, sz, oid_ds, sz_oid_ds)) {
back = 0;
} else {
@@ -4934,7 +4894,7 @@ oid_index(oid *p, size_t sz)
} else {
if (0 < sz_oid_st) {
-#line 4086 "pjsnmp.ctr"
+#line 4068 "pjsnmp.ctr"
if (0 != oids_equal(p, sz, oid_st, sz_oid_st)) {
back = 4;
}
@@ -4942,7 +4902,7 @@ oid_index(oid *p, size_t sz)
#if TRACE_DEBUG
else {
-#line 4092 "pjsnmp.ctr"
+#line 4074 "pjsnmp.ctr"
}
#endif
}
@@ -4950,7 +4910,7 @@ oid_index(oid *p, size_t sz)
}
}
-#line 4098 "pjsnmp.ctr"
+#line 4080 "pjsnmp.ctr"
return back;
}
@@ -4993,34 +4953,34 @@ show_text_containing_non_ascii(const unsigned char *ptr, size_t num)
*/
static
void
-report_status_if_changed(int found)
+report_status_if_changed(void)
{
unsigned long tcond = 0x80000000UL; /* Bit for one condition */
int must_report = 0; /* Flag: Must report change */
int i;
-#line 4146 "pjsnmp.ctr"
+#line 4128 "pjsnmp.ctr"
/* Check whether or not to report.
*/
if (stsum != ostsum) {
-#line 4149 "pjsnmp.ctr"
+#line 4131 "pjsnmp.ctr"
must_report = 1;
} else {
if (devst != odevst) {
-#line 4152 "pjsnmp.ctr"
+#line 4134 "pjsnmp.ctr"
must_report = 1;
} else {
if (prist != oprist) {
-#line 4155 "pjsnmp.ctr"
+#line 4137 "pjsnmp.ctr"
must_report = 1;
} else {
if (pdes_cond != opdes_cond) {
-#line 4158 "pjsnmp.ctr"
+#line 4140 "pjsnmp.ctr"
must_report = 1;
} else {
if (0 < sz_stat_text) {
@@ -5037,12 +4997,12 @@ report_status_if_changed(int found)
if (sz_stat_text != sz_ostat_text) {
must_report = 1;
-#line 4173 "pjsnmp.ctr"
+#line 4155 "pjsnmp.ctr"
} else {
if (0 != dk4mem_cmp(stat_text,ostat_text,sz_stat_text,NULL)) {
must_report = 1;
-#line 4176 "pjsnmp.ctr"
+#line 4158 "pjsnmp.ctr"
}
}
}
@@ -5057,7 +5017,7 @@ report_status_if_changed(int found)
*/
if (0 != must_report) {
-#line 4189 "pjsnmp.ctr"
+#line 4171 "pjsnmp.ctr"
fputs(pjsnmp_kw[150], out_file);
(void)log_timestamp();
if ((-1 < devst) && (6 > devst)) {
@@ -5099,7 +5059,7 @@ report_status_if_changed(int found)
} else {
if (0 == contains_non_ascii(stat_text, sz_stat_text)) {
fputs(pjsnmp_kw[30], out_file);
- fwrite(stat_text, 1, sz_stat_text, out_file);
+ (void)fwrite(stat_text, 1, sz_stat_text, out_file);
fputs(pjsnmp_kw[31], out_file);
}
}
@@ -5122,7 +5082,7 @@ report_status_if_changed(int found)
}
-#line 4252 "pjsnmp.ctr"
+#line 4234 "pjsnmp.ctr"
}
@@ -5145,13 +5105,13 @@ one_snmp_request(int passno)
int back = 0;
-#line 4273 "pjsnmp.ctr"
+#line 4255 "pjsnmp.ctr"
if (0 != can_continue(0)) {
-#line 4274 "pjsnmp.ctr"
+#line 4256 "pjsnmp.ctr"
if (NULL != snmp_sess) {
-#line 4275 "pjsnmp.ctr"
+#line 4257 "pjsnmp.ctr"
pdes_cond = 0UL;
pcnt = 0UL;
devst = 0;
@@ -5162,7 +5122,7 @@ one_snmp_request(int passno)
rq = snmp_pdu_create(SNMP_MSG_GET);
if (NULL != rq) {
-#line 4284 "pjsnmp.ctr"
+#line 4266 "pjsnmp.ctr"
back = 1;
snmp_add_null_var(rq, oid_ds, sz_oid_ds);
snmp_add_null_var(rq, oid_ps, sz_oid_ps);
@@ -5170,19 +5130,19 @@ one_snmp_request(int passno)
snmp_add_null_var(rq, oid_pe, sz_oid_pe);
if (0 < sz_oid_st) {
-#line 4290 "pjsnmp.ctr"
+#line 4272 "pjsnmp.ctr"
snmp_add_null_var(rq, oid_st, sz_oid_st);
}
status = snmp_synch_response(snmp_sess, rq, &rs);
if (STAT_SUCCESS == status) {
-#line 4294 "pjsnmp.ctr"
+#line 4276 "pjsnmp.ctr"
if (NULL != rs) {
-#line 4295 "pjsnmp.ctr"
+#line 4277 "pjsnmp.ctr"
if (SNMP_ERR_NOERROR == rs->errstat) {
-#line 4296 "pjsnmp.ctr"
+#line 4278 "pjsnmp.ctr"
/* Obtain response elements.
*/
@@ -5192,31 +5152,31 @@ one_snmp_request(int passno)
switch (oid_index(vars->name, vars->name_length)) {
case 0: {
-#line 4304 "pjsnmp.ctr"
+#line 4286 "pjsnmp.ctr"
if (0 != get_int(&devst, vars)) {
-#line 4305 "pjsnmp.ctr"
+#line 4287 "pjsnmp.ctr"
found |= 1;
}
} break;
case 1: {
-#line 4309 "pjsnmp.ctr"
+#line 4291 "pjsnmp.ctr"
if (0 != get_int(&prist, vars)) {
-#line 4310 "pjsnmp.ctr"
+#line 4292 "pjsnmp.ctr"
found |= 2;
}
} break;
case 2: {
-#line 4314 "pjsnmp.ctr"
+#line 4296 "pjsnmp.ctr"
if (0 != get_ul(&pcnt, vars)) {
-#line 4315 "pjsnmp.ctr"
+#line 4297 "pjsnmp.ctr"
found |= 4;
-#line 4316 "pjsnmp.ctr"
+#line 4298 "pjsnmp.ctr"
switch (passno) {
case 0: {
pc_start = pcnt;
@@ -5239,16 +5199,16 @@ one_snmp_request(int passno)
} break;
case 3: {
-#line 4337 "pjsnmp.ctr"
+#line 4319 "pjsnmp.ctr"
if (0 != get_ul(&pdes_cond, vars)) { found |= 8; }
} break;
case 4: {
-#line 4340 "pjsnmp.ctr"
+#line 4322 "pjsnmp.ctr"
if (0 < vars->val_len) {
if (sizeof(stat_text) > vars->val_len) {
-#line 4342 "pjsnmp.ctr"
+#line 4324 "pjsnmp.ctr"
dk4mem_cpy(
stat_text, (vars->val).string,
vars->val_len, NULL
@@ -5256,7 +5216,7 @@ one_snmp_request(int passno)
sz_stat_text = vars->val_len;
} else {
-#line 4348 "pjsnmp.ctr"
+#line 4330 "pjsnmp.ctr"
dk4mem_cpy(
stat_text, (vars->val).string,
sizeof(stat_text), NULL
@@ -5276,7 +5236,7 @@ one_snmp_request(int passno)
stsum = get_state_mapping(devst, prist);
-#line 4366 "pjsnmp.ctr"
+#line 4348 "pjsnmp.ctr"
}
/* Build summary (2): printer detected error state
@@ -5286,7 +5246,7 @@ one_snmp_request(int passno)
if (0L != (pdes_error & pdes_cond)) {
stsum = PJSNMP_ST_ERROR;
-#line 4374 "pjsnmp.ctr"
+#line 4356 "pjsnmp.ctr"
}
}
}
@@ -5306,7 +5266,7 @@ one_snmp_request(int passno)
stsum = ptx->state;
-#line 4392 "pjsnmp.ctr"
+#line 4374 "pjsnmp.ctr"
}
}
}
@@ -5317,7 +5277,7 @@ one_snmp_request(int passno)
if ((0 != unkn_busy) && (PJSNMP_ST_UNKNOWN == stsum)) {
stsum = PJSNMP_ST_BUSY;
-#line 4401 "pjsnmp.ctr"
+#line 4383 "pjsnmp.ctr"
}
/* For error state mark this page counter as print
@@ -5327,11 +5287,11 @@ one_snmp_request(int passno)
case PJSNMP_ST_ERROR: {
seen_printing = 0;
-#line 4409 "pjsnmp.ctr"
+#line 4391 "pjsnmp.ctr"
if ((0 < passno) && (0UL < pcnt)) {
pc_error = pcnt;
-#line 4411 "pjsnmp.ctr"
+#line 4393 "pjsnmp.ctr"
}
start_unreach = (dk4_time_t)0UL;
if ((dk4_time_t)0UL == start_error) {
@@ -5341,7 +5301,7 @@ one_snmp_request(int passno)
case PJSNMP_ST_BUSY: {
seen_printing = 1;
-#line 4419 "pjsnmp.ctr"
+#line 4401 "pjsnmp.ctr"
start_unreach = (dk4_time_t)0UL;
start_error = (dk4_time_t)0UL;
} break;
@@ -5359,7 +5319,7 @@ one_snmp_request(int passno)
/* On change, print new state.
*/
- report_status_if_changed(found);
+ report_status_if_changed();
/* Save data for next comparison.
*/
@@ -5375,21 +5335,21 @@ one_snmp_request(int passno)
#if TRACE_DEBUG
else {
-#line 4451 "pjsnmp.ctr"
+#line 4433 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 4456 "pjsnmp.ctr"
+#line 4438 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 4461 "pjsnmp.ctr"
+#line 4443 "pjsnmp.ctr"
}
#endif
if (NULL != rs) {
@@ -5399,26 +5359,26 @@ one_snmp_request(int passno)
#if TRACE_DEBUG
else {
-#line 4469 "pjsnmp.ctr"
+#line 4451 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 4474 "pjsnmp.ctr"
+#line 4456 "pjsnmp.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 4479 "pjsnmp.ctr"
+#line 4461 "pjsnmp.ctr"
}
#endif
-#line 4482 "pjsnmp.ctr"
+#line 4464 "pjsnmp.ctr"
return back;
}
@@ -5440,7 +5400,7 @@ accounting_index_and_value(size_t kwind, unsigned long pc)
int res; /* Conversion result */
-#line 4502 "pjsnmp.ctr"
+#line 4484 "pjsnmp.ctr"
res = dk4ma_write_c8_decimal_unsigned(
buf, sizeof(buf), (dk4_um_t)pc, 0, NULL
);
@@ -5463,7 +5423,7 @@ accounting_index_and_value(size_t kwind, unsigned long pc)
if (0 != dk4str8_cat_s(pjsnmp_buf, szbuf, pjsnmp_kw[0], NULL)) {
-#line 4523 "pjsnmp.ctr"
+#line 4505 "pjsnmp.ctr"
(void)accounting_exchange(0);
}
}
@@ -5479,7 +5439,7 @@ accounting_index_and_value(size_t kwind, unsigned long pc)
}
}
-#line 4537 "pjsnmp.ctr"
+#line 4519 "pjsnmp.ctr"
}
@@ -5491,7 +5451,7 @@ report_used_pages(void)
{
-#line 4547 "pjsnmp.ctr"
+#line 4529 "pjsnmp.ctr"
if (0 != acct_start_end) {
accounting_index_and_value(51, pc_start);
accounting_index_and_value(52, pc_end);
@@ -5500,7 +5460,7 @@ report_used_pages(void)
}
-#line 4554 "pjsnmp.ctr"
+#line 4536 "pjsnmp.ctr"
}
@@ -5526,10 +5486,10 @@ do_accounting(int passno)
int cto = 0; /* Flag: Must check timeout */
-#line 4578 "pjsnmp.ctr"
+#line 4560 "pjsnmp.ctr"
if (NULL != snmp_sess) {
-#line 4579 "pjsnmp.ctr"
+#line 4561 "pjsnmp.ctr"
/* In the loop retrieve printer status via SNMP,
finish if printer is idle or in standby state.
*/
@@ -5537,11 +5497,11 @@ do_accounting(int passno)
do {
if (0 != can_continue(0)) {
-#line 4585 "pjsnmp.ctr"
+#line 4567 "pjsnmp.ctr"
if (0 != one_snmp_request((0 == passno) ? 0 : 2)) {
-#line 4587 "pjsnmp.ctr"
+#line 4569 "pjsnmp.ctr"
/* In idle or standby we can retrieve the page counter
if the page counter was changed or the printer was seen
@@ -5551,19 +5511,19 @@ do_accounting(int passno)
case PJSNMP_ST_IDLE : case PJSNMP_ST_STANDBY : {
back = 1; cc = 0;
-#line 4595 "pjsnmp.ctr"
+#line 4577 "pjsnmp.ctr"
cto = 0;
if (1 == passno) {
if ((0 == seen_printing) && (0 < print_timeout)) {
cto = 1;
-#line 4599 "pjsnmp.ctr"
+#line 4581 "pjsnmp.ctr"
} else {
if ((0UL != pc_error) && (1 == have_pce)) {
if ((pc_end == pc_error)&&((dk4_um_t)0UL < print_timeout)) {
cto = 1;
-#line 4603 "pjsnmp.ctr"
+#line 4585 "pjsnmp.ctr"
}
}
}
@@ -5573,7 +5533,7 @@ do_accounting(int passno)
if ((start_idle+(dk4_time_t)print_timeout) > current_time) {
back = 0; cc = 1;
-#line 4611 "pjsnmp.ctr"
+#line 4593 "pjsnmp.ctr"
}
} else {
start_idle = current_time;
@@ -5612,7 +5572,7 @@ do_accounting(int passno)
+ (dk4_time_t)((0 == passno) ? unto_start : unto_end);
if (current_time > timeout_time) {
-#line 4648 "pjsnmp.ctr"
+#line 4630 "pjsnmp.ctr"
cc = 0;
/* ERROR: Timeout while printer unreachable */
log_1_no_header(136);
@@ -5630,7 +5590,7 @@ do_accounting(int passno)
|| ((1 == passno) && ((dk4_um_t)0UL < erto_end))
)
{
- if ((dk4_um_t)0UL < start_error) {
+ if ((dk4_time_t)0UL < start_error) {
dk4time_get(&current_time);
timeout_time =
start_error
@@ -5672,12 +5632,12 @@ do_accounting(int passno)
} else {
-#line 4706 "pjsnmp.ctr"
+#line 4688 "pjsnmp.ctr"
cc = -1;
}
} else {
-#line 4709 "pjsnmp.ctr"
+#line 4691 "pjsnmp.ctr"
cc = -1;
}
} while(1 == cc);
@@ -5685,28 +5645,28 @@ do_accounting(int passno)
if (((0 == passno)&&(0 != have_pcs))||((1 == passno)&&(0 != have_pce))) {
-#line 4715 "pjsnmp.ctr"
+#line 4697 "pjsnmp.ctr"
res = dk4ma_write_c8_decimal_unsigned(buf, sizeof(buf), pcnt, 0, NULL);
if (0 != res) {
-#line 4718 "pjsnmp.ctr"
+#line 4700 "pjsnmp.ctr"
log_3_no_header((147+passno), 0, buf);
-#line 4720 "pjsnmp.ctr"
+#line 4702 "pjsnmp.ctr"
}
-#line 4722 "pjsnmp.ctr"
+#line 4704 "pjsnmp.ctr"
} else {
-#line 4724 "pjsnmp.ctr"
+#line 4706 "pjsnmp.ctr"
log_1_no_header(149);
-#line 4726 "pjsnmp.ctr"
+#line 4708 "pjsnmp.ctr"
}
/* Save page counter at start to page counter unusable for
@@ -5722,13 +5682,13 @@ do_accounting(int passno)
*/
if (1 == passno) {
-#line 4740 "pjsnmp.ctr"
+#line 4722 "pjsnmp.ctr"
if ((0 != have_pcs) && (0 != have_pce)) {
-#line 4741 "pjsnmp.ctr"
+#line 4723 "pjsnmp.ctr"
if (pc_end > pc_start) {
-#line 4742 "pjsnmp.ctr"
+#line 4724 "pjsnmp.ctr"
/* Report number of used pages to accounting system */
report_used_pages();
}
@@ -5736,15 +5696,15 @@ do_accounting(int passno)
}
} else {
-#line 4748 "pjsnmp.ctr"
+#line 4730 "pjsnmp.ctr"
if (0 != snmp_igfs) {
-#line 4749 "pjsnmp.ctr"
+#line 4731 "pjsnmp.ctr"
back = 1;
}
}
-#line 4752 "pjsnmp.ctr"
+#line 4734 "pjsnmp.ctr"
return back;
}
@@ -5775,7 +5735,7 @@ data_transfer(void)
int writable; /* Flag: Socket is writeable */
-#line 4781 "pjsnmp.ctr"
+#line 4763 "pjsnmp.ctr"
unwriteable = (dk4_time_t)0UL;
if ((NULL != host_name) && (0 < host_port)) {
sock = dk4socket_c8_tcp_client_host_port(
@@ -5831,7 +5791,7 @@ data_transfer(void)
if (0 != read_responses) {
if (FD_ISSET(sock,&rfds)) {
wrb = sizeof(dummy_text);
- res = dk4socket_recv(sock,dummy_text,&wrb,0,0L,0L,NULL);
+ (void)dk4socket_recv(sock,dummy_text,&wrb,0,0L,0L,NULL);
}
}
}
@@ -5951,17 +5911,17 @@ data_transfer(void)
dk4time_get(&t3);
} else {
-#line 4955 "pjsnmp.ctr"
+#line 4937 "pjsnmp.ctr"
/* ERROR: Failed to connect */
log_1_no_header(140);
}
} else {
-#line 4959 "pjsnmp.ctr"
+#line 4941 "pjsnmp.ctr"
}
-#line 4961 "pjsnmp.ctr"
+#line 4943 "pjsnmp.ctr"
return back;
}
@@ -6190,10 +6150,10 @@ main(int argc, char *argv[])
-#line 5188 "pjsnmp.ctr"
+#line 5170 "pjsnmp.ctr"
-#line 5189 "pjsnmp.ctr"
+#line 5171 "pjsnmp.ctr"
/* Initialize output file.
*/
@@ -6348,10 +6308,10 @@ main(int argc, char *argv[])
-#line 5342 "pjsnmp.ctr"
+#line 5324 "pjsnmp.ctr"
-#line 5343 "pjsnmp.ctr"
+#line 5325 "pjsnmp.ctr"
/* ----- All libraries available */
diff --git a/support/dktools/pjsnmp.ctr b/support/dktools/pjsnmp.ctr
index fdfadbae7e..a9b9c6fa30 100644
--- a/support/dktools/pjsnmp.ctr
+++ b/support/dktools/pjsnmp.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -41,6 +41,7 @@ license = bsd
#include "dk4sock.h"
#include "dk4isadm.h"
#include "dk4lprng.h"
+#include "dk4unused.h"
@@ -1213,41 +1214,21 @@ static dk4_time_t start_error = (dk4_time_t)0UL;
static const size_t sz_oid_ds = sizeof(oid_ds)/sizeof(oid);
-/** Size of device status OID (number of bytes).
-*/
-static const size_t by_oid_ds = sizeof(oid_ds);
-
-
/** Size of printer status OID (number of elements).
*/
static const size_t sz_oid_ps = sizeof(oid_ps)/sizeof(oid);
-/** Size of printer status OID (number of bytes).
-*/
-static const size_t by_oid_ps = sizeof(oid_ps);
-
-
/** Size of page counter OID (number of elements).
*/
static const size_t sz_oid_pc = sizeof(oid_pc)/sizeof(oid);
-/** Size of page counter OID (number of bytes).
-*/
-static const size_t by_oid_pc = sizeof(oid_pc);
-
-
/** Size of printer error OID (number of elements).
*/
static const size_t sz_oid_pe = sizeof(oid_pe)/sizeof(oid);
-/** Size of printer error OID (number of bytes).
-*/
-static const size_t by_oid_pe = sizeof(oid_pe);
-
-
/** Size of printer error OID (number of elements).
*/
static const size_t sz_oid_dst = sizeof(oid_dst)/sizeof(oid);
@@ -1568,8 +1549,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -1580,8 +1562,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -1591,8 +1574,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -2638,12 +2622,11 @@ process_one_config_item(char *ci)
/** Check whether the line opens the model we are searching for.
@param str Text to check.
- @param bptr Address of success indicator.
@return 1 on success, 0 on error.
*/
static
int
-check_in_model(char *str, int *bptr, dk4_um_t lineno)
+check_in_model(char *str, dk4_um_t lineno)
{
char *ptr; /* Closing square bracket */
int back = 0;
@@ -3224,7 +3207,7 @@ process_model_setup(void)
p1 = dk4str8_start(pjsnmp_buf, NULL);
if (NULL != p1) {
if ('[' == *p1) {
- in_model = check_in_model(++p1, &back, lineno);
+ in_model = check_in_model(++p1, lineno);
if (0 != in_model) {
found = 1;
}
@@ -3421,20 +3404,20 @@ static
int
attempt_snmp_session(void)
{
- struct snmp_session template; /* Template for the session */
+ struct snmp_session sesstemp; /* Template for the session */
int back = 0;
$? "+ attempt_snmp_session"
init_snmp(pjsnmp_kw[4]);
- DK4_MEMRES(&template, sizeof(template));
- snmp_sess_init(&template);
- template.version = snmp_version;
- template.peername = host_name;
- template.community = (unsigned char *)snmp_comm;
+ DK4_MEMRES(&sesstemp, sizeof(sesstemp));
+ snmp_sess_init(&sesstemp);
+ sesstemp.version = snmp_version;
+ sesstemp.peername = host_name;
+ sesstemp.community = (unsigned char *)snmp_comm;
if (NULL == snmp_comm) {
- template.community = (unsigned char *)(pjsnmp_kw[5]);
+ sesstemp.community = (unsigned char *)(pjsnmp_kw[5]);
}
- template.community_len = strlen((char *)(template.community));
- snmp_sess = snmp_open(&template);
+ sesstemp.community_len = strlen((char *)(sesstemp.community));
+ snmp_sess = snmp_open(&sesstemp);
if (NULL != snmp_sess) { $? ". session"
back = 1;
} else { $? "! no session"
@@ -3482,7 +3465,6 @@ accounting_ex_socket(dk4_socket_t sock, int expect_response)
/* ERROR: Failed to send data */
log_1_no_header(122);
}
- sl = 0;
pjsnmp_buf[0] = '\0';
res = dk4socket_shutdown(sock, DK4_SOCKET_SHUT_WRITE, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) { $? ". shutdown ok"
@@ -3645,7 +3627,7 @@ accounting_ex_pipe(int expect_response)
} break;
case LPRNG_EXIT_HOLD : {
decision = 2;
- }
+ } break;
default : {
decision = 1;
} break;
@@ -4137,12 +4119,12 @@ show_text_containing_non_ascii(const unsigned char *ptr, size_t num)
*/
static
void
-report_status_if_changed(int found)
+report_status_if_changed(void)
{
unsigned long tcond = 0x80000000UL; /* Bit for one condition */
int must_report = 0; /* Flag: Must report change */
int i;
- $? "+ report_status_if_changed found=%d", found
+ $? "+ report_status_if_changed"
/* Check whether or not to report.
*/
if (stsum != ostsum) { $? ". summary changed"
@@ -4227,7 +4209,7 @@ report_status_if_changed(int found)
} else {
if (0 == contains_non_ascii(stat_text, sz_stat_text)) {
fputs(pjsnmp_kw[30], out_file);
- fwrite(stat_text, 1, sz_stat_text, out_file);
+ (void)fwrite(stat_text, 1, sz_stat_text, out_file);
fputs(pjsnmp_kw[31], out_file);
}
}
@@ -4433,7 +4415,7 @@ one_snmp_request(int passno)
/* On change, print new state.
*/
- report_status_if_changed(found);
+ report_status_if_changed();
/* Save data for next comparison.
*/
@@ -4662,7 +4644,7 @@ do_accounting(int passno)
|| ((1 == passno) && ((dk4_um_t)0UL < erto_end))
)
{
- if ((dk4_um_t)0UL < start_error) {
+ if ((dk4_time_t)0UL < start_error) {
dk4time_get(&current_time);
timeout_time =
start_error
@@ -4833,7 +4815,7 @@ data_transfer(void)
if (0 != read_responses) {
if (FD_ISSET(sock,&rfds)) {
wrb = sizeof(dummy_text);
- res = dk4socket_recv(sock,dummy_text,&wrb,0,0L,0L,NULL);
+ (void)dk4socket_recv(sock,dummy_text,&wrb,0,0L,0L,NULL);
}
}
}
diff --git a/support/dktools/pjsnmp.h b/support/dktools/pjsnmp.h
index 79300545ee..c8a8158302 100644
--- a/support/dktools/pjsnmp.h
+++ b/support/dktools/pjsnmp.h
@@ -1,4 +1,9 @@
/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
diff --git a/support/dktools/pkginfo b/support/dktools/pkginfo
index 715b79086b..9d7aeea90e 100644
--- a/support/dktools/pkginfo
+++ b/support/dktools/pkginfo
@@ -1,7 +1,7 @@
PKG="DKRAdktools"
NAME="dktools"
ARCH="sparc"
-VERSION="4.8.3"
+VERSION="4.30.2"
CATEGORY="application"
VENDOR="Dirk Krause"
EMAIL="dirk.krause@no.e-mail.address.provided.com"
diff --git a/support/dktools/plpdftex.c b/support/dktools/plpdftex.c
index 8bfd05f837..5976401008 100644
--- a/support/dktools/plpdftex.c
+++ b/support/dktools/plpdftex.c
@@ -1,704 +1,515 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: plpdftex.ctr
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: plpdftex.ctr
*/
/** @file plpdftex.c The plpdftex module.
*/
-#line 95 "plpdftex.ctr"
+#line 9 "plpdftex.ctr"
-#include "dk3all.h"
-#if 0
-#include "dkt-version.h"
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
#endif
-#include "dk4vers.h"
-#include "dkt.h"
-#include "dk3pdf.h"
-#include "plpdftex.h"
-
-#include <stdio.h>
-
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
-
-
-#line 110 "plpdftex.ctr"
-
-
-
-/** Option to check for the presence of the program.
-*/
-static dkChar const plpdftex_check_presence[] = { dkT("--check-presence") };
-
-/** Protocol version to issue as response to a presence check.
-*/
-#if VERSION_BEFORE_20140924
-static dkChar const plpdftex_protocol[] = { dkT("1\n") };
-#else
-static char const plpdftex_protocol[] = { "1\n" };
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
#endif
-/** Application group name.
-*/
-static dkChar const plpdftex_group_name[] = { dkT("dktools") };
+#ifndef DK4ENC_H_INCLUDED
+#include "dk4enc.h"
+#endif
-/** DK tools version number.
-*/
-static dkChar const plpdftex_version[] = { DKT_VERSION_DK };
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
-/** Default help text shown if help file is not found.
-*/
-static dkChar const * const plpdftex_text_help[] = {
-dkT(""),
-dkT("NAME"),
-dkT(""),
-dkT(" plpdftex - Plot into a combination of *.pdf/*.tex files."),
-dkT(""),
-dkT("SYNOPSIS"),
-dkT(""),
-dkT(" plpdftex"),
-dkT(" plpdftex --check-presence"),
-dkT(" plpdftex --help"),
-dkT(" plpdftex --license-terms"),
-dkT(""),
-dkT("DESCRIPTION"),
-dkT(""),
-dkT("The program processes an incoming data stream containing both graphics"),
-dkT("instructions and text labels. Graphics instructions are written to a"),
-dkT("PDF file, text labels are written to a *.tex file."),
-dkT("The *.tex file includes the PDF file containing the graphics and"),
-dkT("typesets the text labels on top of it."),
-dkT(""),
-dkT("This program is not intended to be used directly, it is an output"),
-dkT("driver for the octpgfpl package for GNU Octave."),
-dkT(""),
-dkT(""),
-dkT("OPTIONS"),
-dkT(""),
-dkT("-h\t\t\tShow this help text."),
-dkT("--help"),
-dkT(""),
-dkT("-v\t\t\tShow version information."),
-dkT("--version"),
-dkT(""),
-dkT("-l\t\t\tShow the license conditions."),
-dkT("--license-terms"),
-dkT(""),
-dkT("--check-presence\tPrint the protocol version, may be used to"),
-dkT("\t\t\tcheck for the presence of the program."),
-dkT(""),
-dkT("EXIT STATUS"),
-dkT(""),
-dkT("0 on success, all other exit status codes indicate an error."),
-dkT(""),
-dkT("INPUT FILE"),
-dkT(""),
-dkT("Input is read from standard input."),
-dkT(""),
-dkT("The first line specifies a file name combination. It must end on"),
-dkT("either ``.pdftex'' to produce a *.pdf/*.tex combination for inclusion"),
-dkT("in a LaTeX document or on ``.pdftexs'' to produce a *.pdf/*.tex"),
-dkT("combination for standalone processing."),
-dkT(""),
-dkT("The second line contains two unsigned integer numbers, separated"),
-dkT("by spaces: Image width and height in PS/PDF points (known as bp in"),
-dkT("LaTeX)."),
-dkT(""),
-dkT("The remaining lines describe the image, there are ``t'' lines"),
-dkT("and ``p'' lines, i.e."),
-dkT(""),
-dkT("t\tfs\t\t12"),
-dkT("t\tfont-setup\t\\usepackage[T1]{fontenc}"),
-dkT("t\tpackage\t\t\\usepackage[intlimit]{amsmath}"),
-dkT("t\tpreamble\t\\DeclareMathOperator{\\intd}{\\text{d}}"),
-dkT("t\ttext\t\t10 20 base left\tblack This is a test."),
-dkT("t\ttext-box\t10 20 base left red This is another test."),
-dkT("p\tgsave"),
-dkT("p\tgrestore"),
-dkT("p\tlw\t\t3"),
-dkT("p\tbuttcap"),
-dkT("p\tmiterjoin"),
-dkT("p\tnodash"),
-dkT("p\tstroke-color\tblue!50!black"),
-dkT("p\tfill-color\tred!80!white"),
-dkT("p\trectangle\t5 5 200 80"),
-dkT("p\tcircle\t\t20 30 5"),
-dkT("p\tmoveto\t\t30 80"),
-dkT("p\tlineto\t\t50 90"),
-dkT("p\tcurveto\t\t50 100 100 100 100 90"),
-dkT("p\tclosepath"),
-dkT("p\tstroke"),
-dkT("p\tfill"),
-dkT("p\tclip"),
-dkT(""),
-dkT("The ``t fs'' ``t font-setup'', ``t package'' and ``t preamble''"),
-dkT("lines are only used when producing a *.pdf/*.tex file combination for"),
-dkT("standalone processing, otherwise they are ignored."),
-dkT(""),
-dkT("``t fs'' specifies the font size for the documentclass line."),
-dkT("This line must be used before ``t font-setup'', ``t package'', ``t preamble'',"),
-dkT("``t text'' or ``p'' lines. The line is optional, by default the documentclass"),
-dkT("is written without the font size specification."),
-dkT(""),
-dkT("``t font-setup'' specifies usepackage and other instructions for font"),
-dkT("setup. These lines are optional, a default font setup section is used"),
-dkT("if no ``t font-setup'' lines are used. Any ``t font-setup'' lines"),
-dkT("must be used before ``t package'', ``t preamble'', ``t text'' or ``p''"),
-dkT("lines."),
-dkT(""),
-dkT("``t preamble'' lines contain further setup instructions for the preamble,"),
-dkT("they are optional."),
-dkT(""),
-dkT("``t text'' lines contain text labels to show. The line contains"),
-dkT("x position, y position, vertical alignment (bottom, base, centered,"),
-dkT("or top), horizontal alignment (left, centered, or right), color"),
-dkT("and the text to show."),
-dkT(""),
-dkT("All color definitions must be LaTeX color strings like"),
-dkT("``blue!50!white''..."),
-dkT(""),
-dkT("``t text-box'' lines contain text labels to show. The line contains"),
-dkT("x position, y position, vertical alignment (bottom, base, centered,"),
-dkT("or top), horizontal alignment (left, centered, or right), color"),
-dkT("and the text to show."),
-dkT(""),
-dkT("``p'' lines contain graphics instructions transferred to the PDF file."),
-dkT(""),
-dkT("``p gsave'' saves the current graphics state."),
-dkT(""),
-dkT("``p grestore'' restores the graphics state."),
-dkT(""),
-dkT("``p lw'' sets the line width for stroking."),
-dkT(""),
-dkT("``p buttcap'' sets line cap style to butted."),
-dkT(""),
-dkT("``p miterjoin'' sets the line join style to miter."),
-dkT(""),
-dkT("``p nodash'' sets up contiguous line style."),
-dkT(""),
-dkT("``p stroke-color'' sets the stroke color."),
-dkT(""),
-dkT("``p fill-color'' sets the fill color."),
-dkT(""),
-dkT("``p rectangle'' creates a rectangular path, specify start x position,"),
-dkT("start y position, end x position and end y position."),
-dkT(""),
-dkT("``p circle'' creates a circular path, specify center x position,"),
-dkT("center y position and radius."),
-dkT(""),
-dkT("``p moveto'' starts a new path and moves the current position"),
-dkT("to the specified x and y position."),
-dkT(""),
-dkT("``p lineto'' adds a line segment from the current position to the specified"),
-dkT("x and y position to the path."),
-dkT(""),
-dkT("``p curveto'' adds a Bezier segment starting at the current position"),
-dkT("to the path. Specify x and y position of the first control point,"),
-dkT("x and y position of the second control point and x and y position"),
-dkT("of the final point."),
-dkT(""),
-dkT("``p closepath'' closes the current path."),
-dkT(""),
-dkT("``p stroke'' strokes the current path."),
-dkT(""),
-dkT("``p fill'' fills the current path."),
-dkT(""),
-dkT("``p clip'' uses the current path as clip path."),
-dkT(""),
-dkT(""),
-dkT("OUTPUT FILES"),
-dkT(""),
-dkT("The output file names are determined from the first input line."),
-dkT(""),
-dkT("NOTES"),
-dkT(""),
-dkT("The plpdftex program does not support all features of PDF/TeX file pairs,"),
-dkT("it is only intended as an output driver for the pgfplot() instruction"),
-dkT("in the octpgfpl package for GNU Octave."),
-dkT(""),
-dkT("RESTRICTIONS"),
-dkT(""),
-dkT("Color definitions for plpdftex must only contain color names ``white'',"),
-dkT("``black'', ``red'', ``green'', ``blue'', ``cyan'', ``magenta'', ``yellow'',"),
-dkT("``gray'', ``lightgray'', ``darkgray'', ``brown'', ``lime'', ``olive'',"),
-dkT("``orange'', ``pink'', ``purple'', ``teal'', ``violet'' and combinations"),
-dkT("like ``red!50!black''."),
-dkT(""),
-dkT("AUTHOR"),
-dkT(""),
-dkT("Dirk Krause"),
-dkT(""),
-dkT("COPYRIGHT AND LICENSE"),
-dkT(""),
-dkT("Run"),
-dkT(" plpdftex -l"),
-dkT("to see the license conditions."),
-dkT(""),
-dkT("SEE ALSO"),
-dkT(""),
-dkT("http://dktools.sourceforge.net"),
-dkT("http://octpgfpl.sourceforge.net"),
-dkT(""),
-NULL
+#ifndef DK4PPPT_H_INCLUDED
+#include "dk4pppt.h"
+#endif
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
-#line 330 "plpdftex.ctr"
-};
+#ifndef DK4UC2L_H_INCLUDED
+#include "dk4uc2l.h"
+#endif
+#ifndef DK4UC2LA_H_INCLUDED
+#include "dk4uc2la.h"
+#endif
+#ifndef DK4GRCO_H_INCLUDED
+#include "dk4grco.h"
+#endif
-/** License conditions.
-*/
-static dkChar const * const plpdftex_license_text[] = {
-dkT(""),
-dkT("Copyright (c) 2014-2016, Dirk Krause"),
-dkT("All rights reserved."),
-dkT(""),
-dkT("Redistribution and use in source and binary forms, with or without"),
-dkT("modification, are permitted provided that the following conditions are met:"),
-dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the copyright holder(s) nor the names of"),
-dkT(" contributors may be used to endorse or promote products derived from "),
-dkT(" this software without specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
-dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
-dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING"),
-dkT("IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
-dkT("POSSIBILITY OF SUCH DAMAGE."),
-dkT(""),
-NULL
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
-#line 369 "plpdftex.ctr"
-};
+#ifndef DK4REC27_H_INCLUDED
+#include "dk4rec27.h"
+#endif
+#ifndef DK4MAI8DSZ_H_INCLUDED
+#include "dk4mai8dsz.h"
+#endif
-static dkChar const * const plpdftex_kw[] = {
-/* 0 */
-dkT("plpdftex"),
+#ifndef DK4MAI8DBL_H_INCLUDED
+#include "dk4mai8dbl.h"
+#endif
-/* 1 */
-dkT("Too many command line arguments, just one input file name allowed!"),
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
-/* 2 */
-dkT("Failed to retrieve first command line argument (probably a bug)!"),
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
-/* 3 */
-dkT("Output file names missing in first line!"),
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-/* 4 */
-dkT("File name too long in first line!"),
-/* 5 */
-dkT("Wrong file name suffix, must be *.pdftex or *.pdftexs!"),
-/* 6 */
-dkT("Missing second line, containing width and height!"),
-/* 7 */
-dkT("Failed to retrieve width and height!"),
+#line 92 "plpdftex.ctr"
-/* 8 */
-dkT("Numeric overflow, width and/or height too large!"),
-/* 9 */
-dkT("Failed to write PDF data to file!"),
-/* 10 */
-dkT("Failed to open PDF page!"),
+/** Named color.
+*/
+typedef struct {
+ char const *name; /**< Color name. */
+ double r; /**< Red. */
+ double g; /**< Green. */
+ double b; /**< Blue. */
+} named_color_t;
-/* 11 */
-dkT("Failed to close PDF page!"),
-/* 12 */
-dkT("Syntax error, document already closed!"),
-/* 13 */
-dkT("Syntax error, line not started by ``t'', ``p'', or ``#''!"),
+/** Choices for current state stored in st.
+*/
+enum {
+ STATE_ERROR = -1, /**< Error state, do nothing. */
+ STATE_START , /**< Expecting first input line. */
+ STATE_DIM , /**< Expecting dimension line. */
+ STATE_CONTENTS , /**< Retrieving contents */
+};
-/* 14 */
-dkT("Syntax error, missing command!"),
-/* 15 */
-dkT("PDF clip operation failed!"),
-/* 16 */
-dkT("PDF fill operation failed!"),
+/** Input line buffer for processing stdin.
+ 2019-10-24 NOTE:
+ The size argument in fgets() is int type.
+ So do not make the array size larger than INT_MAX.
+*/
+static char in_buf[4096];
-/* 17 */
-dkT("PDF stroke operation failed!"),
-/* 18 */
-dkT("PDF closepath operation failed!"),
-/* 19 */
-dkT("PDF curveto operation failed!"),
+/** Buffer to construct color specification.
+*/
+static char cs_buf[sizeof(in_buf)];
-/* 20 */
-dkT("Syntax error, numeric value expected!"),
-/* 21 */
-dkT("Syntax error, too few arguments for command!"),
-/* 22 */
-dkT("PDF moveto operation failed!"),
+/** Buffer for graphics output file name.
+*/
+static dkChar fn_buf[DK4_MAX_PATH];
-/* 23 */
-dkT("Syntax error, radius is negative!"),
-/* 24 */
-dkT("PDF lineto operation failed!"),
-/* 25 */
-dkT("PDF set nonstroking color operation failed!"),
+/** Graphics configuration.
+*/
+static dk4_gra_conf_t graconf;
-/* 26 */
-dkT("No such color!"),
-/* 27 */
-dkT("PDF set stroking color operation failed!"),
-/* 28 */
-dkT("PDF set dash operation failed!"),
+/** Predefined colors.
+ Must be alphabetically sorted, bsearch() is used to find colors.
+*/
+static named_color_t const named_colors[] = {
+ { "black", 0.0, 0.0, 0.0 },
+ { "blue", 0.0, 0.0, 1.0 },
+ { "brown", 0.75, 0.5, 0.25 },
+ { "cyan", 0.0, 1.0, 1.0 },
+ { "darkgray", 0.25, 0.25, 0.25 },
+ { "gray", 0.5, 0.5, 0.5 },
+ { "green", 0.0, 1.0, 0.0 },
+ { "lightgray", 0.75, 0.75, 0.75 },
+ { "lime", 0.75, 1.0, 0.0 },
+ { "magenta", 1.0, 0.0, 1.0 },
+ { "olive", 0.5 , 0.5, 0.0 },
+ { "orange", 1.0 , 0.5, 0.0 },
+ { "pink", 1.0 , 0.75, 0.75 },
+ { "purple", 0.75, 0.0, 0.25 },
+ { "red", 1.0, 0.0, 0.0 },
+ { "teal", 0.00, 0.5, 0.5 },
+ { "violet", 0.5 , 0.0, 0.5 },
+ { "white", 1.0, 1.0, 1.0 },
+ { "yellow", 1.0, 1.0, 0.0 }
+};
-/* 29 */
-dkT("PDF set linejoin operation failed!"),
-/* 30 */
-dkT("PDF set linecap operation failed!"),
-/* 31 */
-dkT("Syntax error, linewidth negative!"),
+/** Option to check for the presence of the program.
+*/
+static dkChar const plpdftex_check_presence[] = { dkT("--check-presence") };
-/* 32 */
-dkT("PDF set linewidth operation failed!"),
-/* 33 */
-dkT("PDF grestore operation failed!"),
-/* 34 */
-dkT("PDF gsave operation failed!"),
+/** Protocol version to issue as reponse to --check-presence.
+*/
+static char const plpdftex_protocol[] = { "1\n" };
-/* 35 */
-dkT("Write operation failed to TeX output file!"),
-/* 36 */
-dkT("Syntax error, invalid horizontal alignment specification!"),
-/* 37 */
-dkT("Syntax error, invalid horizontal alignment specification!"),
+/** Keywords in dkChar to create silent application.
+*/
+static dkChar const * const kw_dk[] = {
+/* 0 */
+dkT("dktools"),
-/* 38 */
-dkT("Syntax error, order must be fs, font-setup, package, preamble, text!"),
+/* 1 */
+dkT("plpdftex.txt"),
NULL
-#line 531 "plpdftex.ctr"
+#line 196 "plpdftex.ctr"
};
-/** 8 bit strings
+/** Char keywords
*/
-static char const * const plpdftex_c8_kw[] = {
+static char const * const kw_c8[] = {
/* 0 */
-"-i.pdf",
+"ERROR: Not enough memory!\n",
/* 1 */
-".tex",
+"ERROR: Failed to setup signal handlers!\n",
/* 2 */
-"\\documentclass{article}",
+"ERROR: Failed to restore previous signal handler!\n",
/* 3 */
-"% font setup (begin)",
+"\\color{",
/* 4 */
-"% font setup (end)",
+"}",
/* 5 */
-"% other packages (begin)",
+"ERROR: Failed to open LaTeX encoding data!\n",
/* 6 */
-"% other packages (end)",
+"ERROR: Failed to write graphics output to file!\n",
/* 7 */
-"\\setlength{\\paperwidth}{%ldbp}\n",
+"ERROR: Illegal file name suffix for output file!\n",
/* 8 */
-"\\setlength{\\paperheight}{%ldbp}\n",
+"ERROR: No file name suffix found in output file name!\n",
/* 9 */
-"% user-specific setup instructions (begin)",
+"ERROR: Output file name too long!\n",
/* 10 */
-"% user-specific setup instructions (end)",
+"ERROR: Illegal characters in output file name!\n",
/* 11 */
-"\\begin{document}%",
+"ERROR: Failed to recode output file name to system encoding!\n",
/* 12 */
-"\\begin{picture}(0,0)%",
+"ERROR: Failed to open graphics output!\n",
/* 13 */
-"\\includegraphics{",
+"ERROR: Syntax in line %lu - font size is not a positive number!\n",
/* 14 */
-"}%",
+"ERROR: Syntax in line %lu - font size is not a number!\n",
/* 15 */
-"\\end{picture}%",
+"ERROR: Syntax in line %lu - missing value!\n",
/* 16 */
-"\\setlength{\\unitlength}{1bp}%",
+"ERROR: Syntax in line %lu - too few values!\n",
/* 17 */
-"\\begin{picture}(%ld,%ld)%\n",
+"ERROR: Syntax in line %lu - not a horizontal alignment!\n",
/* 18 */
-"\\end{document}",
+"ERROR: Syntax in line %lu - not a vertical alignment!\n",
/* 19 */
-"\\put(%g,%g){\\makebox(0,0)",
+"ERROR: Syntax in line %lu - not a number!\n",
/* 20 */
-"[",
+"ERROR: Syntax in line %lu - not a positive number!\n",
/* 21 */
-"]",
+"ERROR: Syntax in line %lu - color \"%s\" not found!\n",
/* 22 */
-"{\\smash{{\\color{%s}%s}}}}\n",
+"ERROR: Syntax in line %lu - opacity value \"%s\" out of range 0...100!\n",
/* 23 */
-"{\\colorbox{white}{\\color{%s}\\ovalbox{%s}}}}\n",
+"ERROR: Syntax in line %lu - illegal subcommand!\n",
/* 24 */
-"{{\\color{%s}%s}}}\n",
+"ERROR: Syntax in line %lu - illegal command!\n",
+
+/* 25 */
+"ERROR: Syntax in line %lu - missing subcommand!\n",
NULL
-#line 601 "plpdftex.ctr"
+#line 303 "plpdftex.ctr"
};
-/** Default font setup.
+/** License text.
*/
-static char const * const plpdftex_default_font_setup[] = {
+static dkChar const * const lic_txt[] = {
/* 0 */
-"% begin font setup",
+dkT(""),
/* 1 */
-"\\usepackage[T1]{fontenc}",
+dkT("Copyright (c) 2018, Dirk Krause"),
/* 2 */
-"\\usepackage{textcomp}",
+dkT("All rights reserved."),
/* 3 */
-"\\usepackage{mathptmx}",
+dkT(""),
/* 4 */
-"\\usepackage[scaled=.92]{helvet}",
+dkT("Redistribution and use in source and binary forms, with or without"),
/* 5 */
-"\\usepackage{courier}",
+dkT("modification, are permitted provided that the following conditions are met:"),
/* 6 */
-"% end font setup",
+dkT(""),
-NULL
+/* 7 */
+dkT("* Redistributions of source code must retain the above copyright notice,"),
+/* 8 */
+dkT(" this list of conditions and the following disclaimer."),
-#line 617 "plpdftex.ctr"
-};
+/* 9 */
+dkT("* Redistributions in binary form must reproduce the above copyright"),
+/* 10 */
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+/* 11 */
+dkT(" documentation and/or other materials provided with the distribution."),
-/** Default additional packages.
-*/
-static char const * const plpdftex_default_packages[] = {
-/* 0 */
-"% other packages (begin)",
+/* 12 */
+dkT("* Neither the name of the copyright holder(s) nor the names of"),
-/* 1 */
-"\\usepackage{textcomp}",
+/* 13 */
+dkT(" contributors may be used to endorse or promote products derived from "),
-/* 2 */
-"\\usepackage[intlimits]{amsmath}",
+/* 14 */
+dkT(" this software without specific prior written permission."),
-/* 3 */
-"% other packages (end)",
+/* 15 */
+dkT(""),
-NULL
+/* 16 */
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+/* 17 */
+dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-#line 630 "plpdftex.ctr"
-};
+/* 18 */
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+/* 19 */
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+/* 20 */
+dkT(""),
-static char const * const plpdftex_required_packages[] = {
-/* 0 */
-"% required packages (begin)",
+/* 21 */
+dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-/* 1 */
-"\\usepackage{fancybox}",
+/* 22 */
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-/* 2 */
-"\\usepackage{graphicx}",
+/* 23 */
+dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-/* 3 */
-"\\usepackage{xcolor}",
+/* 24 */
+dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-/* 4 */
-"% required packages (end)",
+/* 25 */
+dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-/* 5 */
-"% required instructions (begin)",
+/* 26 */
+dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING"),
+
+/* 27 */
+dkT("IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
+
+/* 28 */
+dkT("POSSIBILITY OF SUCH DAMAGE."),
+
+/* 29 */
+dkT(""),
NULL
-#line 643 "plpdftex.ctr"
+#line 342 "plpdftex.ctr"
};
-
-static char const * const plpdftex_required_instructions[] = {
+/** Help text.
+*/
+static dkChar const * const help_txt[] = {
/* 0 */
-"\\pagestyle{empty}",
+dkT(""),
/* 1 */
-"\\setlength{\\voffset}{-1in}",
+dkT("plpdftex - Plot to PDF+TeX file pair"),
/* 2 */
-"\\setlength{\\topmargin}{0bp}",
+dkT("------------------------------------"),
/* 3 */
-"\\setlength{\\headheight}{0bp}",
+dkT(""),
/* 4 */
-"\\setlength{\\headsep}{0bp}",
+dkT("plpdftex --check-presence"),
/* 5 */
-"\\setlength{\\topskip}{0bp}",
+dkT("plpdftex"),
/* 6 */
-"\\setlength{\\hoffset}{-1in}",
+dkT(""),
/* 7 */
-"\\setlength{\\oddsidemargin}{0bp}",
+dkT("The first form is used by other programs to check the presence of the"),
/* 8 */
-"\\setlength{\\evensidemargin}{0bp}",
+dkT("program. Plpdftex prints the protocol version number."),
/* 9 */
-"\\setlength{\\marginparwidth}{0bp}",
+dkT(""),
/* 10 */
-"\\setlength{\\marginparsep}{0bp}",
+dkT("The second form is used to create a file pair."),
/* 11 */
-"\\setlength{\\textwidth}{\\paperwidth}",
+dkT(""),
/* 12 */
-"\\setlength{\\textheight}{\\paperheight}",
+dkT("Other options are:"),
/* 13 */
-"\\setlength{\\parskip}{0bp}",
+dkT(""),
/* 14 */
-"\\setlength{\\parindent}{0bp}",
+dkT("--help\t\tto show this help text."),
/* 15 */
-"\\setlength{\\pdfpagewidth}{\\paperwidth}",
+dkT("--manual\tto show the full manual."),
/* 16 */
-"\\setlength{\\pdfpageheight}{\\paperheight}",
+dkT("--version\tto show the version number."),
/* 17 */
-"% required instructions (end)",
+dkT(""),
+
+NULL
+
+
+#line 369 "plpdftex.ctr"
+};
+
+
+
+/** Allowed file name suffixes.
+*/
+static dkChar const * const fn_suffixes[] = {
+/* 0 */
+dkT(".tex"),
+
+/* 1 */
+dkT(".pgf"),
+
+/* 2 */
+dkT(".pdftex"),
+
+/* 3 */
+dkT(".pdftexs"),
+
+/* 4 */
+dkT(".epstex"),
NULL
-#line 669 "plpdftex.ctr"
+#line 383 "plpdftex.ctr"
};
-/** Output file suffixes.
+/** First commands in line.
*/
-static char const * const pldftex_output_file_suffixes[] = {
+static const char * const cmd1[] = {
/* 0 */
-"pdftex",
+"t",
/* 1 */
-"pdftexs",
+"p",
NULL
-#line 680 "plpdftex.ctr"
+#line 394 "plpdftex.ctr"
};
-/** Instruction names in TeX lines.
+/** Text related commands.
*/
-static char const * const plpdftex_tex_instructions[] = {
+static const char * const cmd2t[] = {
/* 0 */
"fs",
@@ -720,14 +531,14 @@ static char const * const plpdftex_tex_instructions[] = {
NULL
-#line 713 "plpdftex.ctr"
+#line 409 "plpdftex.ctr"
};
-/** Instruction names in PDF instructions.
+/** Graphics related commands.
*/
-static char const * const plpdftex_pdf_instructions[] = {
+static const char * const cmd2g[] = {
/* 0 */
"gsave",
@@ -779,2397 +590,1905 @@ static char const * const plpdftex_pdf_instructions[] = {
/* 16 */
"clip",
+/* 17 */
+"prepare-stroke",
+
+/* 18 */
+"prepare-fill",
+
NULL
-#line 790 "plpdftex.ctr"
+#line 437 "plpdftex.ctr"
};
-/** Vertical alignments.
+/** Names for horizontal alignments
*/
-char const * const plpdftex_vertical_alignments[] = {
-"top", "centered", "base", "bottom", NULL
-};
+static char const * const h_align_names[] = {
+/* 0 */
+"left",
+/* 1 */
+"centered",
+/* 2 */
+"right",
-/** Horizontal alignments.
-*/
-char const * const plpdftex_horizontal_alignments[] = {
-"left", "centered", "right", NULL
+NULL
+
+
+#line 449 "plpdftex.ctr"
};
-/** Options expected by the program.
+/** Names for vertical alignments.
*/
-static dk3_option_t const plpdftex_options[] = {
- { dkT('h'), dkT("help"), 0 },
- { dkT('v'), dkT("version"), 0 },
- { dkT('l'), dkT("license-terms"), 0 }
-};
+static char const * const v_align_names[] = {
+/* 0 */
+"top",
+/* 1 */
+"centered",
+/* 2 */
+"bottom",
-/** Number of options in plpdftex_options array.
-*/
-static size_t const sz_plpdftex_options =
-sizeof(plpdftex_options)/sizeof(dk3_option_t);
+/* 3 */
+"base",
+NULL
-/** Initialize job structure.
- @param jptr Job to initialize.
+#line 462 "plpdftex.ctr"
+};
+
+
+/** Version number string.
*/
-static
-void
-plpdftex_job_init(plpdftex_job_t *jptr)
-{
-
-
-#line 835 "plpdftex.ctr"
- jptr->app = NULL;
- jptr->msg = NULL;
- jptr->kwnl = NULL;
- jptr->exc = 1;
-
-#line 839 "plpdftex.ctr"
- jptr->argc = 0;
- jptr->argv = NULL;
- jptr->infn = NULL;
- jptr->opt = NULL;
- jptr->infi = NULL;
- jptr->fnb1 = NULL;
- jptr->fnpdf = NULL;
- jptr->fntex = NULL;
- jptr->opdf = NULL;
- jptr->fopdf = NULL;
- jptr->fotex = NULL;
- jptr->szfn = 0;
- jptr->ilbuf = NULL;
- jptr->szilb = 0;
- jptr->stagr = 0;
- jptr->state = PLPT_STATE_NO_OUTPUT_YET;
- jptr->sco = NULL;
- jptr->sico = NULL;
- jptr->imgw = 0UL;
- jptr->imgh = 0UL;
-
-
-#line 860 "plpdftex.ctr"
-}
+static dkChar const versno[] = { DKT_VERSION_DK };
-/** Clean up job structure before exiting the program.
- @param jptr Job structure to clean up.
+/** Application structure for file search, especially for LaTeX encoding tables.
*/
-static
-void
-plpdftex_job_cleanup(plpdftex_job_t *jptr)
-{
- plpt_named_color_t *colptr;
-
-
-#line 873 "plpdftex.ctr"
- if (jptr->sico) {
- dk3sto_it_reset(jptr->sico);
- do {
- colptr = (plpt_named_color_t *)dk3sto_it_next(jptr->sico);
- if (colptr) {
- plptcolor_delete(colptr);
- }
- } while (colptr);
- dk3sto_it_close(jptr->sico);
- } jptr->sico = NULL;
- if (jptr->sco) {
- dk3sto_close(jptr->sco);
- } jptr->sco = NULL;
- jptr->msg = NULL;
- jptr->kwnl = NULL;
- if (jptr->opt) {
- dk3opt_close(jptr->opt);
- }
- jptr->opt = NULL;
- if (jptr->app) {
- dk3app_close(jptr->app);
- }
- jptr->app = NULL;
-
-
-#line 897 "plpdftex.ctr"
-}
+static dk4_app_t *app = NULL;
-/** Process font size line.
- @param job Job structure.
- @param txt Text line to process.
+/** LaTeX encoding structure.
*/
-static
-void
-plpdftex_process_tex_fontsize(plpdftex_job_t *job, char *txt)
-{
- double fs = 10.0;
- int ok = 0;
-
-
-#line 912 "plpdftex.ctr"
- if (NULL == txt) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&fs, txt, NULL)) {
- /* ERROR: Not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == job->stagr) {
- ok = 1;
- goto finished;
- }
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- job->state = PLPT_STATE_DOCUMENT_CLASS;
- fprintf(job->fotex, "\\documentclass[%gpt]{article}\n", fs);
- } break;
- default: {
- /* ERROR: Too late */
- ok = 1;
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
- goto finished;
- } break;
- }
- finished:
- if (0 == ok) {
- job->exc = 1;
-
-#line 942 "plpdftex.ctr"
- }
-
-#line 943 "plpdftex.ctr"
-}
+static dk4_uc2l_t *uc2l = NULL;
-static
-void
-plpdftex_write_textline(plpdftex_job_t *job, char const *txt)
-{
-
-
-#line 952 "plpdftex.ctr"
- if (EOF == fputs(txt, job->fotex)) {
- /* Write error */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- job->exc = 1;
+/** Graphics output structure.
+*/
+static dk4_pppt_t *pppt = NULL;
-#line 956 "plpdftex.ctr"
- }
- if (EOF == fputc('\n', job->fotex)) {
- job->exc = 1;
-#line 959 "plpdftex.ctr"
- }
-#line 960 "plpdftex.ctr"
-}
+/** Current line number.
+*/
+static unsigned long lineno = 0UL;
-/** Process font setup line.
- @param job Job structure.
- @param txt Text line to process.
+/** Size of input buffer.
*/
-static
-void
-plpdftex_process_tex_font_setup(plpdftex_job_t *job, char *txt)
-{
- int ok = 0;
-
+static const size_t sz_in_buf = sizeof(in_buf);
-#line 974 "plpdftex.ctr"
- if (0 == job->stagr) {
- ok = 1;
- goto finished;
- }
- if (NULL == txt) {
- /* ERROR: Not text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- /* font setup (begin) */
- plpdftex_write_textline(job, plpdftex_c8_kw[3]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_FONT_SETUP;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- /* font setup (begin) */
- plpdftex_write_textline(job, plpdftex_c8_kw[3]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_FONT_SETUP;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, txt);
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
- }
- }
-
- finished:
- if (0 == ok) {
- job->exc = 1;
-
-#line 1013 "plpdftex.ctr"
- }
-
-#line 1014 "plpdftex.ctr"
-}
+/** Current processing state.
+*/
+static int st = STATE_START;
-static
-void
-plpdftex_write_default_font_setup(plpdftex_job_t *job)
-{
- char const * const *ptr;
-
-#line 1024 "plpdftex.ctr"
- ptr = plpdftex_default_font_setup;
- while (NULL != *ptr) {
- plpdftex_write_textline(job, *(ptr++));
- }
-#line 1028 "plpdftex.ctr"
-}
+/** Flag: Can continue.
+*/
+static int cc = 1;
-static
-void
-plpdftex_write_default_packages(plpdftex_job_t *job)
-{
- char const * const *ptr;
-
+/** Flag: All pppt output ok.
+*/
+static int ppptok = 0;
-#line 1038 "plpdftex.ctr"
- ptr = plpdftex_default_packages;
- while (NULL != *ptr) {
- plpdftex_write_textline(job, *(ptr++));
- }
-
-#line 1042 "plpdftex.ctr"
-}
+/** Input encoding used on standard input.
+*/
+static int inenc =
+#if DK4_ON_WINDOWS
+DK4_ENCODING_WIN1252
+#else
+DK4_ENCODING_PLAIN
+#endif
+;
-static
-void
-plpdftex_write_required_packages(plpdftex_job_t *job)
-{
- char const * const *ptr;
-
-#line 1052 "plpdftex.ctr"
- ptr = plpdftex_required_packages;
- while (NULL != *ptr) {
- plpdftex_write_textline(job, *(ptr++));
- }
- fprintf(job->fotex, plpdftex_c8_kw[7], job->imgw);
- fprintf(job->fotex, plpdftex_c8_kw[8], job->imgh);
+/** Exit status code.
+*/
+static int exval = EXIT_FAILURE;
- ptr = plpdftex_required_instructions;
- while (NULL != *ptr) {
- plpdftex_write_textline(job, *(ptr++));
- }
-
-#line 1065 "plpdftex.ctr"
-}
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
-/** Process package selection line.
- @param job Job structure.
- @param txt Text line to process.
+/** Indicator: SIGTERM signal received.
*/
static
-void
-plpdftex_process_tex_package(plpdftex_job_t *job, char *txt)
-{
- int ok = 0;
-
-
-#line 1079 "plpdftex.ctr"
- if (0 == job->stagr) {
- ok = 1;
- goto finished;
- }
- if (NULL == txt) {
- /* ERROR: Missing text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- plpdftex_write_default_font_setup(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[5]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_PACKAGES;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- plpdftex_write_default_font_setup(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[5]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_PACKAGES;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[4]);
- plpdftex_write_textline(job, plpdftex_c8_kw[5]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_PACKAGES;
- } break;
- case PLPT_STATE_USER_PACKAGES: {
- ok = 1;
- plpdftex_write_textline(job, txt);
- } break;
- }
- finished:
- if (0 == ok) {
- job->exc = 1;
-
-#line 1120 "plpdftex.ctr"
- }
-
-#line 1121 "plpdftex.ctr"
-}
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
-/** Process preamble line.
- @param job Job structure.
- @param txt Text line to process.
+/** Pass a volatile pointer to an atomic integer.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ptr Address of atomic integer variable.
+ @return The unmodified pointer.
*/
static
-void
-plpdftex_process_tex_preamble(plpdftex_job_t *job, char *txt)
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
{
- int ok = 0;
-
-
-#line 1135 "plpdftex.ctr"
- if (0 == job->stagr) {
- ok = 1;
- goto finished;
- }
- if (NULL == txt) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_SETUP;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_SETUP;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[4]);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_SETUP;
- } break;
- case PLPT_STATE_USER_PACKAGES: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[6]);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_SETUP;
- } break;
- case PLPT_STATE_USER_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, txt);
- } break;
- }
-
- finished:
- if (0 == ok) {
- job->exc = 1;
-
-#line 1191 "plpdftex.ctr"
- }
-
-#line 1192 "plpdftex.ctr"
+ return ptr;
}
-/** Write start of TeX file.
- @param job Job structure.
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
*/
static
void
-plpdftex_open_picture_set(plpdftex_job_t *job)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
-
-
-#line 1204 "plpdftex.ctr"
- if (0 != job->stagr) {
- plpdftex_write_textline(job, plpdftex_c8_kw[11]);
- }
- plpdftex_write_textline(job, plpdftex_c8_kw[12]);
- if (EOF == fputs(plpdftex_c8_kw[13], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- job->exc = 1;
-
-#line 1212 "plpdftex.ctr"
- }
- if (EOF == fputs(job->fnpdf, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- job->exc = 1;
-
-#line 1217 "plpdftex.ctr"
- }
- plpdftex_write_textline(job, plpdftex_c8_kw[14]);
- plpdftex_write_textline(job, plpdftex_c8_kw[15]);
- plpdftex_write_textline(job, plpdftex_c8_kw[16]);
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[17], job->imgw, job->imgh)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- job->exc = 1;
-
-#line 1225 "plpdftex.ctr"
- }
-
-#line 1226 "plpdftex.ctr"
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
}
+#endif
-
-
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
static
void
-plpdftex_close_picture_set(plpdftex_job_t *job)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
-
-
-#line 1235 "plpdftex.ctr"
- plpdftex_write_textline(job, plpdftex_c8_kw[15]);
- if (0 != job->stagr) {
- plpdftex_write_textline(job, plpdftex_c8_kw[18]);
- }
-
-#line 1239 "plpdftex.ctr"
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
}
-
-
-
-/** Process text label line.
- @param job Job structure.
- @param txt Text line to process.
- @param withbox Flag: With box (1) or without box (0).
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
*/
static
void
-plpdftex_process_tex_text(plpdftex_job_t *job, char *txt, int withbox)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
- char *p1 = NULL; /* Y position */
- char *p2 = NULL; /* Vertical alignment */
- char *p3 = NULL; /* Horizontal alignment */
- char *p4 = NULL; /* Color */
- char *p5 = NULL; /* Label text */
- double x = 0.0; /* X position */
- double y = 0.0; /* Y position */
- int av = 0; /* Vertical alignment */
- int ah = 0; /* Horizontal alignment */
- int ok = 0;
- char c;
-
-
-#line 1265 "plpdftex.ctr"
- /* Split strings.
- */
- if (NULL == txt) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL == p1) {
- /* ERROR: No y position */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p2 = dk3str_c8_next(p1, NULL);
- if (NULL == p2) {
- /* ERROR: No vertical alignment */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p3 = dk3str_c8_next(p2, NULL);
- if (NULL == p3) {
- /* ERROR: No horizontal alignment */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p4 = dk3str_c8_next(p3, NULL);
- if (NULL == p4) {
- /* ERROR: No color */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p5 = dk3str_c8_next(p4, NULL);
- if (NULL == p5) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
-
- /* Retrieve values from strings.
- */
- if (0 == dk3ma_d_from_c8_string(&x, txt, NULL)) {
- /* ERROR: x value not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y, p1, NULL)) {
- /* ERROR: y value not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- av = dk3str_c8_array_index(plpdftex_vertical_alignments, p2, 0);
- if (0 > av) {
- /* ERROR: Not a valid vertical alignment */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 37);
- goto finished;
- }
- ah = dk3str_c8_array_index(plpdftex_horizontal_alignments, p3, 0);
- if (0 > ah) {
- /* ERROR: Not a valid horizontal alignment */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
- goto finished;
- }
-
- /* Write file header parts not yet written.
- */
- if (0 != job->stagr) {
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[4]);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_USER_PACKAGES: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[6]);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_USER_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_IN_DOCUMENT: {
- ok = 1;
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
- goto finished;
- } break;
- }
- } else {
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET:
- case PLPT_STATE_DOCUMENT_CLASS:
- case PLPT_STATE_USER_FONT_SETUP:
- case PLPT_STATE_USER_PACKAGES:
- case PLPT_STATE_USER_SETUP:
- {
- ok = 1;
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_IN_DOCUMENT: {
- ok = 1;
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
- goto finished;
- } break;
- }
- }
-
- /* Write text label.
- */
- if (1 == ok) {
- if (1 == withbox) {
-
-#line 1415 "plpdftex.ctr"
- /* put(%g,%g)makebox(0,0) */
-
-#line 1416 "plpdftex.ctr"
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[19], x, y)) {
- /* ERROR: fprintf failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- /* Alignment */
- if ((ah != 1) || (av != 1)) {
-
-#line 1423 "plpdftex.ctr"
- if (EOF == fputs(plpdftex_c8_kw[20], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- c = '\0';
- switch (ah) {
- case 0: { c = 'l'; } break;
- case 2: { c = 'r'; } break;
- }
- if ('\0' != c) {
- if (EOF == fputc(c, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- c = '\0';
- switch (av) {
- case 0: { c = 't'; } break;
- case 2: case 3: { c = 'b'; } break;
- }
- if ('\0' != c) {
- if (EOF == fputc(c, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- if (EOF == fputs(plpdftex_c8_kw[21], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[23], p4, p5)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- } else {
-
-#line 1464 "plpdftex.ctr"
- /* put(%g,%g)makebox(0,0) */
-
-#line 1465 "plpdftex.ctr"
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[19], x, y)) {
- /* ERROR: fprintf failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- /* Alignment */
- if ((ah != 1) || (av != 1)) {
-
-#line 1472 "plpdftex.ctr"
- if (EOF == fputs(plpdftex_c8_kw[20], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- c = '\0';
- switch (ah) {
- case 0: { c = 'l'; } break;
- case 2: { c = 'r'; } break;
- }
- if ('\0' != c) {
- if (EOF == fputc(c, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- c = '\0';
- switch (av) {
- case 0: { c = 't'; } break;
- case 2: case 3: { c = 'b'; } break;
- }
- if ('\0' != c) {
- if (EOF == fputc(c, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- if (EOF == fputs(plpdftex_c8_kw[21], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- if (2 == av) {
- /* Use smash only for baseline vertical alignment */
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[22], p4, p5)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- } else {
- /* No smash for top, center, bottom vertical alignment */
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[24], p4, p5)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- }
- }
- /* Return.
- */
- finished:
- if (0 == ok) {
- job->exc = 1;
-
-#line 1529 "plpdftex.ctr"
- }
-
-#line 1530 "plpdftex.ctr"
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
}
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
-
-/** Process a TeX line.
- @param job Job structure.
- @param txt Text to process.
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
*/
static
-void
-plpdftex_process_tex_line(plpdftex_job_t *job, char *txt)
+int
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
- char *firstarg;
-
-
-#line 1544 "plpdftex.ctr"
- firstarg = dk3str_c8_next(txt, NULL);
- switch(dk3str_c8_array_index(plpdftex_tex_instructions, txt, 0)) {
- case 0: {
- plpdftex_process_tex_fontsize(job, firstarg);
- } break;
- case 1: {
- plpdftex_process_tex_font_setup(job, firstarg);
- } break;
- case 2: {
- plpdftex_process_tex_package(job, firstarg);
- } break;
- case 3: {
- plpdftex_process_tex_preamble(job, firstarg);
- } break;
- case 4: {
- plpdftex_process_tex_text(job, firstarg, 0);
- } break;
- case 5: {
- plpdftex_process_tex_text(job, firstarg, 1);
- } break;
- }
-
-#line 1565 "plpdftex.ctr"
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
}
-/** Process PDF gsave line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+#if DK4_HAVE_BSEARCH
+
+/** Compare two color definition structures by name.
+ @param l Left structure.
+ @param r Right structure.
+ @return Comparison result.
*/
static
-void
-pldpdftex_process_pdf_gsave(plpdftex_job_t *job, char *txt)
+int
+compare_named_colors(const void *l, const void *r)
{
- int ok = 0;
-
-
-#line 1579 "plpdftex.ctr"
- if (0 != dk3pdf_gsave(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: gsave failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 34);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 1587 "plpdftex.ctr"
- }
+ const named_color_t *pl;
+ const named_color_t *pr;
-#line 1588 "plpdftex.ctr"
+ pl = (const named_color_t *)l;
+ pr = (const named_color_t *)r;
+ return strcmp(pl->name, pr->name);
}
+#endif
+
-/** Process PDF grestore line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Find color definition for a given name.
+ @param name Color name to search for.
+ @return Pointer to color definition on success, NULL on error (not found).
*/
static
-void
-pldpdftex_process_pdf_grestore(plpdftex_job_t *job, char *txt)
+const
+named_color_t *
+find_named_color(const char *name)
{
- int ok = 0;
-
-
-#line 1602 "plpdftex.ctr"
- if (0 != dk3pdf_grestore(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR grestore failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 33);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 1610 "plpdftex.ctr"
- }
-
-#line 1611 "plpdftex.ctr"
+#if DK4_HAVE_BSEARCH
+ /*
+ Use bsearch() function.
+ */
+ named_color_t testc;
+ const named_color_t *back = NULL;
+
+
+#line 693 "plpdftex.ctr"
+ testc.name = name;
+ back = bsearch(
+ &testc,
+ named_colors,
+ DK4_SIZEOF(named_colors,named_color_t),
+ sizeof(named_color_t),
+ compare_named_colors
+ );
+
+#line 701 "plpdftex.ctr"
+ return back;
+#else
+ /*
+ No bsearch() available, walk through all the colors.
+ */
+ const named_color_t *back = NULL;
+ const named_color_t *ptr = named_colors;
+ size_t i;
+
+
+#line 710 "plpdftex.ctr"
+ for (i = 0; i < DK4_SIZEOF(named_colors,named_color_t); i++) {
+ if (0 == strcmp(ptr->name, name)) {
+ back = ptr;
+ i = DK4_SIZEOF(named_colors,named_color_t);
+ }
+ else {
+ ptr++;
+ i++;
+ }
+ }
+
+#line 720 "plpdftex.ctr"
+ return back;
+#endif
}
-/** Process PDF linewidth line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Process first input line containing the file name.
*/
static
void
-pldpdftex_process_pdf_lw(plpdftex_job_t *job, char *txt)
+process_file_name(void)
{
- double lw = 1.0;
- int ok = 0;
- int mec = 0;
-
-
-#line 1627 "plpdftex.ctr"
- if (NULL != txt) {
- if (0 != dk3ma_d_from_c8_string(&lw, txt, &mec)) {
- if (0.0 <= lw) {
- if (0 != dk3pdf_set_linewidth(job->opdf, lw)) {
- ok = 1;
- } else {
- /* ERROR: Failed to set line width */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 32);
+ dk4_er_t er; /* Error report for recoding */
+ dkChar *psuff; /* File name suffix */
+ int res; /* Recoding result */
+
+
+#line 736 "plpdftex.ctr"
+ dk4error_init(&er);
+ res = dk4recode_c8_to_dk(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), dk4app_get_encoding(app),
+ in_buf, inenc, &er
+ );
+ if (0 != res) {
+ psuff = dk4path_get_suffix(fn_buf, NULL);
+ if (NULL != psuff) {
+ res = dk4str_array_index(fn_suffixes, psuff, 0);
+ switch (res) {
+ case 0 : {
+
+#line 747 "plpdftex.ctr"
+ st = STATE_DIM;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+ case 1 : {
+
+#line 754 "plpdftex.ctr"
+ st = STATE_DIM;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+ case 2 : {
+
+#line 760 "plpdftex.ctr"
+ st = STATE_DIM;
+ *psuff = dkT('\0');
+ dk4str_cat_s(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), fn_suffixes[0], NULL
+ );
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+ case 3 : {
+
+#line 771 "plpdftex.ctr"
+ st = STATE_DIM;
+ *psuff = dkT('\0');
+ dk4str_cat_s(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), fn_suffixes[0], NULL
+ );
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+ case 4 : {
+
+#line 783 "plpdftex.ctr"
+ st = STATE_DIM;
+ *psuff = dkT('\0');
+ dk4str_cat_s(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), fn_suffixes[0], NULL
+ );
+ graconf.driver = DK4_GRA_DRIVER_EPS;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+#if 0
+ /* 2018-04-17
+ Document not possible for EPS+TeX.
+ */
+ case 5 : { /* epstexs */
+ st = STATE_DIM;
+ dk4str_cpy_s(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), fn_suffixes[0], NULL
+ );
+ graconf.driver = DK4_GRA_DRIVER_EPS;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+#endif
+ default : {
+
+#line 810 "plpdftex.ctr"
+ st = STATE_ERROR;
+ /* ERROR: Illegal suffix */
+ fputs(kw_c8[7], stderr);
+ } break;
+ }
+ }
+ else {
+
+#line 817 "plpdftex.ctr"
+ st = STATE_ERROR;
+ /* ERROR: No suffix found */
+ fputs(kw_c8[8], stderr);
+ }
+ }
+ else {
+
+#line 823 "plpdftex.ctr"
+ st = STATE_ERROR;
+ switch (er.ec) {
+ case DK4_E_BUFFER_TOO_SMALL : {
+
+#line 826 "plpdftex.ctr"
+ /* ERROR: File name too long */
+ fputs(kw_c8[9], stderr);
+ } break;
+ case DK4_E_SYNTAX : {
+
+#line 830 "plpdftex.ctr"
+ /* ERROR: Unconvertable characters */
+ fputs(kw_c8[10], stderr);
+ } break;
+ default : {
+
+#line 834 "plpdftex.ctr"
+ /* ERROR: Failed to recode file name */
+ fputs(kw_c8[11], stderr);
+ } break;
+ }
}
- } else {
- /* Syntax error, negative number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 31);
- }
- } else {
- /* Syntax error, not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- }
- } else {
- /* Syntax error, missing line width */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 1650 "plpdftex.ctr"
- }
-
-#line 1651 "plpdftex.ctr"
+
+
+#line 840 "plpdftex.ctr"
}
-/** Process PDF buttcap line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Process second input line containing the image dimensions.
*/
static
void
-pldpdftex_process_pdf_buttcap(plpdftex_job_t *job, char *txt)
+process_file_dimensions(void)
{
- int ok = 0;
-
-
-#line 1665 "plpdftex.ctr"
- if (0 != dk3pdf_set_linecap(job->opdf, DK3_LINECAP_BUTT)) {
- ok = 1;
- } else {
- /* ERROR: Failed to set line cap */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 30);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 1673 "plpdftex.ctr"
- }
-
-#line 1674 "plpdftex.ctr"
-}
+ dk4_er_t er;
+ char const *ep = NULL;
+ char *p1 = NULL;
+ char *p2 = NULL;
+ size_t width = 0;
+ size_t height = 0;
+ int ok = 0;
+ int dr;
+ int isdoc;
+ int flags;
+ int res;
+
+
+#line 862 "plpdftex.ctr"
+ p1 = dk4str8_start(in_buf, NULL);
+ if (NULL != p1) {
+ p2 = dk4str8_next(p1, NULL);
+ if (NULL != p2) {
+ res = dk4ma_input_c8_dec_size_t(&width, p1, &ep, 1, NULL);
+ if (0 != res) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t(&height, p2, &ep, 1, NULL);
+ if (0 != res) {
+ ok = 1;
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 875 "plpdftex.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+#line 880 "plpdftex.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
-/** Process PDF miterjoin line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
-*/
-static
-void
-pldpdftex_process_pdf_miterjoin(plpdftex_job_t *job, char *txt)
-{
- int ok = 0;
-
-
-#line 1687 "plpdftex.ctr"
- if (0 != dk3pdf_set_linejoin(job->opdf, DK3_LINEJOIN_MITER)) {
- ok = 1;
- } else {
- /* Failed to set linejoin */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 29);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 1695 "plpdftex.ctr"
- }
-
-#line 1696 "plpdftex.ctr"
-}
+#line 885 "plpdftex.ctr"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else {
+#line 890 "plpdftex.ctr"
+ }
+#endif
+ if (0 != ok) {
+ ok = 0;
+ flags = dk4gra_conf_flags_document(&graconf);
+ flags |= DK4_GRA_PAGE_FLAG_NO_BG;
+ dr = DK4_PPPT_DR_PGF;
+ switch (graconf.driver) {
+ case DK4_GRA_DRIVER_EPS : {
+ dr = DK4_PPPT_DR_EPS_TEX;
+ flags |= DK4_GRA_DOC_FLAG_EPS;
+ } break;
+ case DK4_GRA_DRIVER_PDF : {
+ dr = DK4_PPPT_DR_PDF_TEX;
+ } break;
+ }
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ isdoc = 1;
+ }
+ else {
+ isdoc = 0;
+ }
+ dk4error_init(&er);
+ pppt = dk4pppt_open(
+ fn_buf, dr, isdoc, flags, width, height, &er
+ );
+ if (NULL != pppt) {
+ ok = 1;
+ exval = EXIT_SUCCESS;
+
+#line 919 "plpdftex.ctr"
+ ppptok = 1;
+ st = STATE_CONTENTS;
+ }
+ else {
+#line 923 "plpdftex.ctr"
+ st = STATE_ERROR;
+ /* ERROR: Failed to open graphics output structure */
+ fputs(kw_c8[12], stderr);
+ }
+ }
+ if (0 == ok) {
-/** Process PDF nodash line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
-*/
-static
-void
-pldpdftex_process_pdf_nodash(plpdftex_job_t *job, char *txt)
-{
- double d = 0.0;
- int ok = 0;
-
-
-#line 1711 "plpdftex.ctr"
- if (0 != dk3pdf_set_line_dash(job->opdf, &d, 0, 0.0)) {
- ok = 1;
- } else {
- /* Failed to set dash */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 28);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 1719 "plpdftex.ctr"
- }
-
-#line 1720 "plpdftex.ctr"
+#line 929 "plpdftex.ctr"
+ st = STATE_ERROR;
+ }
+
+
+#line 932 "plpdftex.ctr"
}
-/** Process PDF stroke color line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+#if 0
+
+/** Push fill and/or stroke color downwards.
*/
static
void
-pldpdftex_process_pdf_stroke_color(plpdftex_job_t *job, char *txt)
+push_colors(void)
{
- double r = 0.0;
- double g = 0.0;
- double b = 0.0;
- int ok = 0;
-
-
-#line 1737 "plpdftex.ctr"
- if (NULL != txt) {
- if (0 != plptcol_get_color(job, txt, &r, &g, &b)) {
- if (0 != dk3pdf_stroking_rgb(job->opdf, r, g, b)) {
- ok = 1;
- } else {
- /* Failed to set stroke color */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 27);
- }
- } else {
- /* Color not found! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 26);
- }
- } else {
- /* Syntax error, missing text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 1755 "plpdftex.ctr"
- }
-
-#line 1756 "plpdftex.ctr"
+ if (0 != ncf) {
+ dk4pppt_prepare_fill(pppt, &ppptok, NULL);
+ }
+ if (0 != ncs) {
+ dk4pppt_prepare_stroke(pppt, &ppptok, NULL);
+ }
+ ncf = ncs = 0;
}
+#endif
-/** Process PDF fill color line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+
+/** Set document font size.
+ @param vptr Text containing the font size value.
*/
static
void
-pldpdftex_process_pdf_fill_color(plpdftex_job_t *job, char *txt)
+set_document_font_size(char *vptr)
{
- double r = 0.0;
- double g = 0.0;
- double b = 0.0;
- int ok = 0;
-
+ const char *ep = NULL;
+ double fs = -1.0;
+
+
+#line 967 "plpdftex.ctr"
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ if (NULL != vptr) {
+ if (0 != dk4ma_input_c8_double(&fs, vptr, &ep, 1, NULL)) {
+ if (0.0 < fs) {
+ dk4pppt_doc_font_size(pppt, fs, &ppptok, NULL);
+ }
+ else {
-#line 1773 "plpdftex.ctr"
- if (NULL != txt) {
- if (0 != plptcol_get_color(job, txt, &r, &g, &b)) {
- if (0 != dk3pdf_nonstroking_rgb(job->opdf, r, g, b)) {
- ok = 1;
- } else {
- /* Failed to set stroke color */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 25);
- }
- } else {
- /* Color not found! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- } else {
- /* Syntax error, missing text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 1791 "plpdftex.ctr"
- }
-
-#line 1792 "plpdftex.ctr"
+#line 974 "plpdftex.ctr"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[13], lineno);
+ }
+ }
+ else {
+
+#line 980 "plpdftex.ctr"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[14], lineno);
+ }
+ }
+ else {
+
+#line 986 "plpdftex.ctr"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ }
+
+
+#line 992 "plpdftex.ctr"
}
-/** Process PDF rectangle line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Add one font setup, package setup or general preamble line.
+ @param vptr Setup text.
+ @param lt Line type.
*/
static
void
-pldpdftex_process_pdf_rectangle(plpdftex_job_t *job, char *txt)
+set_preamble_line(char *vptr, int lt)
{
- char *p1 = NULL;
- char *p2 = NULL;
- char *p3 = NULL;
- double x1 = 0.0;
- double x2 = 0.0;
- double y1 = 0.0;
- double y2 = 0.0;
- int ok = 0;
-
+
-#line 1813 "plpdftex.ctr"
- /* Set txt, p1, p2, p3 to x1, y1, x2, y2.
- */
- if (NULL == txt) {
- /* Syntax error, missing text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto cleanup;
- }
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL == p1) {
- /* Syntax error, missing y1 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto cleanup;
- }
- p2 = dk3str_c8_next(p1, NULL);
- if (NULL == p2) {
- /* Syntax error, missing x2 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto cleanup;
- }
- p3 = dk3str_c8_next(p2, NULL);
- if (NULL == p3) {
- /* Syntax error, missing y2 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto cleanup;
- }
-
- /* Read values from strings.
- */
- if (0 == dk3ma_d_from_c8_string(&x1, txt, NULL)) {
- /* Syntax error, x1 not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto cleanup;
- }
- if (0 == dk3ma_d_from_c8_string(&y1, p1, NULL)) {
- /* Syntax error, y1 not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto cleanup;
- }
- if (0 == dk3ma_d_from_c8_string(&x2, p2, NULL)) {
- /* Syntax error, x2 not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto cleanup;
- }
- if (0 == dk3ma_d_from_c8_string(&y2, p3, NULL)) {
- /* Syntax error, y2 not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto cleanup;
- }
-
- /* PDF drawing operations.
- */
- if (0 == dk3pdf_newpath_moveto(job->opdf, x1, y1)) {
- /* ERROR: moveto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 22);
- goto cleanup;
- }
- if (0 == dk3pdf_lineto(job->opdf, x2, y1)) {
- /* ERROR: lineto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
- goto cleanup;
- }
- if (0 == dk3pdf_lineto(job->opdf, x2, y2)) {
- /* ERROR: lineto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
- goto cleanup;
- }
- if (0 == dk3pdf_lineto(job->opdf, x1, y2)) {
- /* ERROR: lineto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
- goto cleanup;
- }
- if (0 == dk3pdf_lineto(job->opdf, x1, y1)) {
- /* ERROR: lineto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
- goto cleanup;
- }
- if (0 == dk3pdf_closepath(job->opdf)) {
- /* ERROR: closepath failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 18);
- goto cleanup;
- }
-
- /* Success.
- */
- ok = 1;
-
- cleanup:
- if(0 == ok) {
- job->exc = 1;
-
-#line 1902 "plpdftex.ctr"
- }
-
-#line 1903 "plpdftex.ctr"
-}
+#line 1005 "plpdftex.ctr"
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ if (NULL != vptr) {
+ dk4pppt_doc_preamble_line(pppt, vptr, lt, &ppptok, NULL);
+ }
+ else {
+#line 1010 "plpdftex.ctr"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ }
+ else {
+#line 1016 "plpdftex.ctr"
+ /* Ignore for non-document output */
+ }
+
-/** Segments per quarter circle.
-*/
-static size_t const plpt_segments = 2;
+#line 1019 "plpdftex.ctr"
+}
-/** Calculate kappa value to draw a circle.
- @param segments Number of segments for one _quarter_
- of the circle.
- @return Kappa value (factor to apply to first derivative
- when calculating control points).
+/** Split one string into several pieces.
+ @param parts Destination pointer array, points to the pieces found.
+ @param nparts Array size (number of pointers).
+ @param str String to split.
+ @return Number of pieces found.
*/
static
-double
-plpdftex_kappa(size_t segments)
+size_t
+split_text(char **parts, size_t nparts, char *str)
{
- double back = 0.0;
- double alpha;
-
-
-#line 1926 "plpdftex.ctr"
- alpha = M_PI / (2.0 * (double)segments);
-
- /* kappa = (2*sqrt(8*(1-cos(a)))-4*sin(a)) / (3*a*(1-cos(a))) */
-
- back = (2.0 * sqrt(8.0 * (1.0 - cos(alpha))) - 4.0 * sin(alpha))
- / (3.0 * alpha * (1.0 - cos(alpha)));
-
+ size_t back = 0;
+ size_t i;
+
+
+#line 1036 "plpdftex.ctr"
+ if ((NULL != parts) && (NULL != str) && (0 < nparts)) {
+ for (i = 0; i < nparts; i++) { parts[i] = NULL; }
+ parts[0] = dk4str8_start(str, NULL);
+ if (NULL != parts[0]) {
+ back = 1;
+ for (i = 1; i < nparts; i++) {
+ parts[i] = dk4str8_next(parts[i-1], NULL);
+ if (NULL != parts[i]) {
+ back++;
+ }
+ else {
+ i = nparts;
+ }
+ }
+ }
+ }
+
-#line 1933 "plpdftex.ctr"
- return back;
+#line 1053 "plpdftex.ctr"
+ return back;
}
-/** Process PDF circle line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Split a text string in pieces and retrieve double numbers.
+ @param pval Address of results array.
+ @param parts Address of text piece pointers array.
+ @param nparts Array size (number of elements in pval and nparts).
+ @param str String to split and extract.
+ @return Number of piece values found.
*/
static
-void
-pldpdftex_process_pdf_circle(plpdftex_job_t *job, char *txt)
+size_t
+split_numbers(double *pval, char **parts, size_t nparts, char *str)
{
- char *p1; /* Text containing y */
- char *p2; /* Text containing radius */
- double x; /* Center x */
- double y; /* Center y */
- double r; /* Radius */
- double x0; /* Current point x */
- double y0; /* Current point y */
- double x1; /* First control point x */
- double y1; /* First control point y */
- double x2; /* Second control point x */
- double y2; /* Second control point y */
- double x3; /* Final point x */
- double y3; /* Final point y */
- double alpha; /* Arc angle. */
- double a1; /* Start angle. */
- double a2; /* End angle. */
- double kappa; /* Kappa value. */
- size_t i; /* Current sub-segment */
- int ok = 0; /* Flag: Success */
-
-
-#line 1966 "plpdftex.ctr"
- /* Find strings
- */
- if (NULL == txt) {
- /* Syntax error, no data */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL == p1) {
- /* Syntax error, missing y */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p2 = dk3str_c8_next(p1, NULL);
- if (NULL == p2) {
- /* Syntax error, missing r */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
-
- /* Retrieve values from strings.
- */
- if (0 == dk3ma_d_from_c8_string(&x, txt, NULL)) {
- /* Syntax error, not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y, txt, NULL)) {
- /* Syntax error, not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&r, txt, NULL)) {
- /* Syntax error, not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0.0 > r) {
- /* ERROR: Negative radius */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 23);
- goto finished;
- }
- if (0 == dk3pdf_newpath_moveto(job->opdf, x+r, y)) {
- goto finished;
- }
- kappa = plpdftex_kappa(plpt_segments);
- alpha = 2.0 * M_PI / ((double)(4 * plpt_segments));
- ok = 1;
- for (i = 0; i < (4 * plpt_segments); i++) {
- a1 = (double)i * alpha;
- a2 = a1 + alpha;
- if (0 == i) a1 = 0.0;
- if ((4 * plpt_segments - 1) == i) a2 = 2.0 * M_PI;
- x0 = r * cos(a1); y0 = r * sin(a1);
- if (0 == i) { x0 = r; y0 = 0.0; }
- x3 = r * cos(a2); y3 = r * sin(a2);
- if ((4 * plpt_segments - 1) == i) { x3 = r; y3 = 0.0; }
- x1 = -1.0 * r * alpha * sin(a1);
- y1 = r * alpha * cos(a1);
- x2 = -1.0 * r * alpha * sin(a2);
- y2 = r * alpha * cos(a2);
- x1 = x1 * kappa;
- y1 = y1 * kappa;
- x2 = -1.0 * kappa * x2;
- y2 = -1.0 * kappa * y2;
- x1 += x0;
- y1 += y0;
- x2 += x3;
- y2 += y3;
-#if VERSION_BEFORE_20150821
- x0 += x;
+ char const *ep = NULL;
+ size_t back = 0;
+ size_t i;
+ int res;
+
+
+#line 1074 "plpdftex.ctr"
+ if ((NULL != pval) && (NULL != parts) && (NULL != str) && (0 < nparts)) {
+ for (i = 0; i < nparts; i++) { pval[i] = 0.0; parts[i] = NULL; }
+#if TRACE_DEBUG
+ back = split_text(parts, nparts, str);
+ if (back != nparts) {
+
+
+#line 1080 "plpdftex.ctr"
+ }
+ nparts = back;
+ back = 0;
+#else
+ nparts = split_text(parts, nparts, str);
#endif
- x1 += x; x2 += x; x3 += x;
-#if VERSION_BEFORE_20150821
- y0 += y;
+ for (i = 0; i < nparts; i++) {
+ ep = NULL;
+ res = dk4ma_input_c8_double(&(pval[i]), parts[i], &ep, 1, NULL);
+ if (0 != res) {
+ back++;
+ }
+ else {
+
+
+#line 1094 "plpdftex.ctr"
+ i = nparts;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ for (i = 0; i < back; i++) {
+
+
+#line 1101 "plpdftex.ctr"
+ }
#endif
- y1 += y; y2 += y; y3 += y;
- if (0 == dk3pdf_curveto(job->opdf, x1, y1, x2, y2, x3, y3)) {
- ok = 0;
- goto finished;
- }
- }
- if (0 == dk3pdf_closepath(job->opdf)) {
- ok = 0;
- }
-
- /* Return
- */
- finished:
- if(0 == ok) {
- job->exc = 1;
-
-#line 2057 "plpdftex.ctr"
- }
-
-#line 2058 "plpdftex.ctr"
+
+
+#line 1104 "plpdftex.ctr"
+ return back;
}
-/** Process PDF moveto line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Construct color specification LaTeX instruction in cs_buf.
+ @param cspec Contents of the color specification.
+ @return 1 on success, 0 on error (buffer too small).
*/
static
-void
-pldpdftex_process_pdf_moveto(plpdftex_job_t *job, char *txt)
+int
+construct_color_spec(char const *cspec)
{
- char *p1;
- double x;
- double y;
- int ok = 0;
-
-
-#line 2075 "plpdftex.ctr"
- if (NULL != txt) {
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL != p1) {
- if (0 != dk3ma_d_from_c8_string(&x, txt, NULL)) {
- if (0 != dk3ma_d_from_c8_string(&y, p1, NULL)) {
- if (0 != dk3pdf_newpath_moveto(job->opdf, x, y)) {
- ok = 1;
- } else {
- /* ERROR, moveto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 22);
- }
- } else {
- /* ERROR, y not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
+ size_t szcsb = sizeof(cs_buf);
+ int back = 0;
+ if (0 != dk4str8_cpy_s(cs_buf, szcsb, kw_c8[3], NULL)) {
+ if (0 != dk4str8_cat_s(cs_buf, szcsb, cspec, NULL)) {
+ if (0 != dk4str8_cat_s(cs_buf, szcsb, kw_c8[4], NULL)) {
+ back = 1;
+ }
+ }
}
- } else {
- /* ERROR, x not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- }
- } else {
- /* Syntax error, missing y value */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- } else {
- /* Syntax error, no coordinates */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 2104 "plpdftex.ctr"
- }
-
-#line 2105 "plpdftex.ctr"
+ return back;
}
-/** Process PDF lineto line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Typeset text.
+ @param vptr Line containing text label description.
+ @param box Flag: Use white box and oval box.
*/
static
void
-pldpdftex_process_pdf_lineto(plpdftex_job_t *job, char *txt)
+typeset_text(char *vptr, int box)
{
- char *p1;
- double x;
- double y;
- int ok = 0;
-
-
-#line 2122 "plpdftex.ctr"
- if (NULL != txt) {
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL != p1) {
- if (0 != dk3ma_d_from_c8_string(&x, txt, NULL)) {
- if (0 != dk3ma_d_from_c8_string(&y, p1, NULL)) {
- if (0 != dk3pdf_lineto(job->opdf, x, y)) {
- ok = 1;
- } else {
- /* ERROR, moveto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 22);
- }
- } else {
- /* ERROR, y not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
+ char *parts[6];
+ char const *ep;
+ size_t nparts;
+ double xpos;
+ double ypos;
+ dk4_text_align_h_t ah = DK4_TEXT_ALIGN_H_CENTERED;
+ dk4_text_align_v_t av = DK4_TEXT_ALIGN_V_CENTERED;
+ int ok = 0;
+ int res = 0;
+ int textfl = 0;
+ int hcs = 0;
+
+
+#line 1151 "plpdftex.ctr"
+ if (0 != box) {
+ textfl = (DK4_GRA_TEXT_FLAG_WHITE_BOX | DK4_GRA_TEXT_FLAG_OVAL_BOX);
+ }
+ if (NULL != vptr) {
+ nparts = split_text(parts, 6, vptr);
+ if (6 == nparts) {
+ ep = NULL;
+ hcs = construct_color_spec(parts[4]);
+ res = dk4ma_input_c8_double(&xpos, parts[0], &ep, 1, NULL);
+ if (0 != res) {
+ ep = NULL;
+ res = dk4ma_input_c8_double(&ypos, parts[1], &ep, 1, NULL);
+ if (0 != res) {
+
+
+#line 1165 "plpdftex.ctr"
+ res = dk4str8_array_index(v_align_names, parts[2], 0);
+ if (-1 < res) {
+ switch (res) {
+ case 3 : {
+ av = DK4_TEXT_ALIGN_V_BASELINE;
+ } break;
+ case 2 : {
+ av = DK4_TEXT_ALIGN_V_BOTTOM;
+ } break;
+ case 1 : {
+ av = DK4_TEXT_ALIGN_V_CENTERED;
+ } break;
+ default : {
+ av = DK4_TEXT_ALIGN_V_TOP;
+ } break;
+ }
+
+
+#line 1182 "plpdftex.ctr"
+ res = dk4str8_array_index(h_align_names, parts[3], 0);
+ if (-1 < res) {
+ switch (res) {
+ case 2 : {
+ ah = DK4_TEXT_ALIGN_H_RIGHT;
+ } break;
+ case 1 : {
+ ah = DK4_TEXT_ALIGN_H_CENTERED;
+ } break;
+ default : {
+ ah = DK4_TEXT_ALIGN_H_LEFT;
+ } break;
+ }
+ ok = 1;
+ dk4pppt_special_text(
+ pppt, xpos, ypos, 0.0, parts[5],
+ ((0 != hcs) ? (cs_buf) : (NULL)),
+ ah, av, 0, 12.0, 0, textfl, &ppptok, NULL
+ );
+ }
+ else {
+
+#line 1203 "plpdftex.ctr"
+ /* ERROR: Syntax (h alignment) */
+ fprintf(stderr, kw_c8[17], lineno);
+ }
+ }
+ else {
+
+#line 1208 "plpdftex.ctr"
+ /* ERROR: Syntax (v alignment) */
+ fprintf(stderr, kw_c8[18], lineno);
+ }
+ }
+ else {
+
+#line 1213 "plpdftex.ctr"
+ /* ERROR: Syntax (not a number) */
+ fprintf(stderr, kw_c8[19], lineno);
+ }
+ }
+ else {
+
+#line 1218 "plpdftex.ctr"
+ /* ERROR: Syntax (not a number) */
+ fprintf(stderr, kw_c8[19], lineno);
+ }
+ }
+ else {
+
+#line 1223 "plpdftex.ctr"
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+
+#line 1228 "plpdftex.ctr"
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
}
- } else {
- /* ERROR, x not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- }
- } else {
- /* Syntax error, missing y value */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- } else {
- /* Syntax error, no coordinates */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 2151 "plpdftex.ctr"
- }
-
-#line 2152 "plpdftex.ctr"
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1233 "plpdftex.ctr"
}
-/** Process PDF curveto line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Set line width.
+ @param vptr Line containing text size in pt.
*/
static
void
-pldpdftex_process_pdf_curveto(plpdftex_job_t *job, char *txt)
+set_line_width(char *vptr)
{
- char *p1; /* y1 */
- char *p2; /* x2 */
- char *p3; /* y2 */
- char *p4; /* x3 */
- char *p5; /* y3 */
- double x1;
- double y1;
- double x2;
- double y2;
- double x3;
- double y3;
- int ok = 0;
-
-
-#line 2177 "plpdftex.ctr"
- /* Split string.
- */
- if (NULL == txt) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL == p1) {
- /* ERROR: No y1 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p2 = dk3str_c8_next(p1, NULL);
- if (NULL == p2) {
- /* ERROR: No x2 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p3 = dk3str_c8_next(p2, NULL);
- if (NULL == p3) {
- /* ERROR: No y2 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p4 = dk3str_c8_next(p3, NULL);
- if (NULL == p4) {
- /* ERROR: No x3 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p5 = dk3str_c8_next(p4, NULL);
- if (NULL == p5) {
- /* ERROR: No y3 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
-
- /* Retrieve values.
- */
- if (0 == dk3ma_d_from_c8_string(&x1, txt, NULL)) {
- /* ERROR: x1 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y1, p1, NULL)) {
- /* ERROR: y1 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&x2, p2, NULL)) {
- /* ERROR: x2 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y2, p3, NULL)) {
- /* ERROR: y2 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&x3, p4, NULL)) {
- /* ERROR: x3 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y3, p5, NULL)) {
- /* ERROR: y3 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
-
- /* Write curve segment.
- */
- if (0 != dk3pdf_curveto(job->opdf, x1, y1, x2, y2, x3, y3)) {
- ok = 1;
- } else {
- /* ERROR: curveto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 19);
- }
-
- /* Return.
- */
- finished:
- if(0 == ok) {
- job->exc = 1;
-
-#line 2262 "plpdftex.ctr"
- }
-
-#line 2263 "plpdftex.ctr"
+ char const *ep = NULL;
+ char *p1;
+ double lw = 0.9;
+ int ok = 0;
+ int res;
+
+
+
+#line 1251 "plpdftex.ctr"
+ if (NULL != vptr) {
+ p1 = dk4str8_start(vptr, NULL);
+ if (NULL != p1) {
+ res = dk4ma_input_c8_double(&lw, p1, &ep, 1, NULL);
+ if (0 != res) {
+ if (0.0 < lw) {
+ ok = 1;
+ dk4pppt_set_line_width(pppt, lw, &ppptok, NULL);
+#if 0
+ dk4pppt_prepare_stroke(pppt, &ppptok, NULL);
+#endif
+ }
+ else {
+
+#line 1264 "plpdftex.ctr"
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[20], lineno);
+ }
+ }
+ else {
+
+#line 1269 "plpdftex.ctr"
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[19], lineno);
+ }
+ }
+ else {
+
+#line 1274 "plpdftex.ctr"
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ }
+ else {
+
+#line 1279 "plpdftex.ctr"
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1284 "plpdftex.ctr"
}
-/** Process PDF closepath line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Find RGB values for color string.
+ @param pnc Destination color value.
+ @param str String containing color information.
+ @return 1 on success, 0 on error.
*/
static
-void
-pldpdftex_process_pdf_closepath(plpdftex_job_t *job, char *txt)
+int
+find_color_value(named_color_t *pnc, char *str)
{
- int ok = 0;
-
-
-#line 2277 "plpdftex.ctr"
- if (0 != dk3pdf_closepath(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: closepath failed */
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 2284 "plpdftex.ctr"
- }
-
-#line 2285 "plpdftex.ctr"
+ named_color_t value;
+ named_color_t bg;
+ named_color_t const *pcol;
+ char const *pe = NULL;
+ char *pc = NULL;
+ char *pn = NULL;
+ char *p1 = NULL;
+ double alpha = 0.0;
+ int back = 0;
+ int res = 0;
+
+
+#line 1308 "plpdftex.ctr"
+ pc = dk4str8_start(str, NULL);
+ if (NULL != pc) {
+ pn = dk4str8_chr(pc, '!');
+ if (NULL != pn) { *(pn++) = '\0'; pn = dk4str8_start(pn, NULL); }
+ pcol = find_named_color(pc);
+ if (NULL != pcol) {
+ DK4_MEMCPY(&value,pcol,sizeof(named_color_t));
+ back = 1;
+ pc = pn;
+ while (NULL != pc) {
+ pn = NULL;
+ bg.r = bg.g = bg.b = 1.0;
+ p1 = dk4str8_chr(pc, '!');
+ if (NULL != p1) {
+ *(p1++) = '\0'; p1 = dk4str8_start(p1, NULL);
+ if (NULL != p1) {
+ pn = dk4str8_chr(p1, '!');
+ if (NULL != pn) {
+ *(pn++) = '\0'; pn = dk4str8_start(pn, NULL);
+ }
+ pcol = find_named_color(p1);
+ if (NULL != pcol) {
+ bg.r = pcol->r;
+ bg.g = pcol->g;
+ bg.b = pcol->b;
+ }
+ else {
+ /* ERROR: Syntax (color not found) */
+ fprintf(stderr, kw_c8[21], lineno, p1);
+ back = 0;
+ pn = NULL;
+ }
+ }
+ }
+ if (0 != back) {
+ pe = NULL;
+ res = dk4ma_input_c8_double(&alpha, pc, &pe, 1, NULL);
+ if (0 != res) {
+ if ((0.0 <= alpha) && (100.0 >= alpha)) {
+ alpha = alpha / 100.0;
+ value.r = value.r * alpha + bg.r * (1.0 - alpha);
+ value.g = value.g * alpha + bg.g * (1.0 - alpha);
+ value.b = value.b * alpha + bg.b * (1.0 - alpha);
+ }
+ else {
+ /* ERROR: Syntax (out of range) */
+ fprintf(stderr, kw_c8[22], lineno, pc);
+ back = 0;
+ pn = NULL;
+ }
+ }
+ else {
+ /* ERROR: Syntax (not a number) */
+ fprintf(stderr, kw_c8[19], lineno);
+ back = 0;
+ pn = NULL;
+ }
+ }
+ pc = pn;
+ }
+ if (0 != back) {
+ pnc->r = value.r;
+ pnc->g = value.g;
+ pnc->b = value.b;
+ }
+ }
+ else {
+
+#line 1375 "plpdftex.ctr"
+ /* ERROR: Syntax (color name not found) */
+ fprintf(stderr, kw_c8[21], lineno, pc);
+ }
+ }
+ else {
+
+#line 1380 "plpdftex.ctr"
+ /* ERROR: Syntax (empty color string) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+
+
+#line 1384 "plpdftex.ctr"
+ return back;
}
-/** Process PDF stroke line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Set stroke color.
+ @param vptr Line containing color description.
*/
static
void
-pldpdftex_process_pdf_stroke(plpdftex_job_t *job, char *txt)
+set_stroke_color(char *vptr)
{
- int ok = 0;
-
-
-#line 2299 "plpdftex.ctr"
- if (0 != dk3pdf_stroke(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: stroke failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 17);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 2307 "plpdftex.ctr"
- }
-
-#line 2308 "plpdftex.ctr"
+ named_color_t value;
+ int ok = 0;
+
+
+#line 1399 "plpdftex.ctr"
+ if (NULL != vptr) {
+ if (0 != find_color_value(&value, vptr)) {
+ ok = 1;
+ dk4pppt_set_stroke_rgb(
+ pppt, value.r, value.g, value.b, &ppptok, NULL
+ );
+#if 0
+ dk4pppt_prepare_stroke(pppt, &ppptok, NULL);
+#endif
+ }
+ }
+ else {
+
+#line 1411 "plpdftex.ctr"
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1416 "plpdftex.ctr"
}
-/** Process PDF fill line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Set fill color (non-stroking color).
+ @param vptr Line containing color information.
*/
static
void
-pldpdftex_process_pdf_fill(plpdftex_job_t *job, char *txt)
+set_fill_color(char *vptr)
{
- int ok = 0;
-
-
-#line 2322 "plpdftex.ctr"
- if (0 != dk3pdf_fill_eo(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: Fill failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 16);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 2330 "plpdftex.ctr"
- }
-
-#line 2331 "plpdftex.ctr"
+ named_color_t value;
+ int ok = 0;
+
+
+#line 1430 "plpdftex.ctr"
+ if (NULL != vptr) {
+ if (0 != find_color_value(&value, vptr)) {
+ ok = 1;
+ dk4pppt_set_fill_rgb(
+ pppt, value.r, value.g, value.b, &ppptok, NULL
+ );
+#if 0
+ dk4pppt_prepare_fill(pppt, &ppptok, NULL);
+#endif
+ }
+ }
+ else {
+
+#line 1442 "plpdftex.ctr"
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1447 "plpdftex.ctr"
}
-/** Process PDF clip line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Create rectangle path.
+ @param vptr Line containing rectangle data.
*/
static
void
-pldpdftex_process_pdf_clip(plpdftex_job_t *job, char *txt)
+draw_rectangle(char *vptr)
{
- int ok = 0;
-
-
-#line 2345 "plpdftex.ctr"
- if (0 != dk3pdf_clip_eo(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: clip failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 15);
- }
- if(0 == ok) {
- job->exc = 1;
-
-#line 2353 "plpdftex.ctr"
- }
-
-#line 2354 "plpdftex.ctr"
+ double coord[4];
+ char *parts[4];
+ size_t nparts;
+ int ok = 0;
+
+
+#line 1463 "plpdftex.ctr"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 4, vptr);
+ if (4 == nparts) {
+ ok = 1;
+ dk4pppt_rectangle(
+ pppt, coord[0], coord[2], coord[1], coord[3],
+ -1.0, NULL, &ppptok, NULL
+ );
+ }
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1483 "plpdftex.ctr"
}
-/** Process a PDF line.
- @param job Job structure.
- @param txt Text to process.
+/** Create circle path.
+ @param vptr Line containing circle data.
*/
static
void
-plpdftex_process_pdf_line(plpdftex_job_t *job, char *txt)
+draw_circle(char *vptr)
{
- char *firstarg;
-
-
-#line 2368 "plpdftex.ctr"
- firstarg = dk3str_c8_next(txt, NULL);
- switch(dk3str_c8_array_index(plpdftex_pdf_instructions, txt, 0)) {
- case 0: {
- pldpdftex_process_pdf_gsave(job, firstarg);
- } break;
- case 1: {
- pldpdftex_process_pdf_grestore(job, firstarg);
- } break;
- case 2: {
- pldpdftex_process_pdf_lw(job, firstarg);
- } break;
- case 3: {
- pldpdftex_process_pdf_buttcap(job, firstarg);
- } break;
- case 4: {
- pldpdftex_process_pdf_miterjoin(job, firstarg);
- } break;
- case 5: {
- pldpdftex_process_pdf_nodash(job, firstarg);
- } break;
- case 6: {
- pldpdftex_process_pdf_stroke_color(job, firstarg);
- } break;
- case 7: {
- pldpdftex_process_pdf_fill_color(job, firstarg);
- } break;
- case 8: {
- pldpdftex_process_pdf_rectangle(job, firstarg);
- } break;
- case 9: {
- pldpdftex_process_pdf_circle(job, firstarg);
- } break;
- case 10: {
- pldpdftex_process_pdf_moveto(job, firstarg);
- } break;
- case 11: {
- pldpdftex_process_pdf_lineto(job, firstarg);
- } break;
- case 12: {
- pldpdftex_process_pdf_curveto(job, firstarg);
- } break;
- case 13: {
- pldpdftex_process_pdf_closepath(job, firstarg);
- } break;
- case 14: {
- pldpdftex_process_pdf_stroke(job, firstarg);
- } break;
- case 15: {
- pldpdftex_process_pdf_fill(job, firstarg);
- } break;
- case 16: {
- pldpdftex_process_pdf_clip(job, firstarg);
- } break;
- }
-
-#line 2422 "plpdftex.ctr"
+ double coord[3];
+ char *parts[3];
+ size_t nparts;
+ int ok = 0;
+
+
+#line 1499 "plpdftex.ctr"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 3, vptr);
+ if (3 == nparts) {
+ ok = 1;
+ dk4pppt_circle(
+ pppt, coord[0], coord[1], coord[2], NULL, &ppptok, NULL
+ );
+ }
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1518 "plpdftex.ctr"
}
-/** Process one input line stored into ilbuf by plpdftex_run_for_input().
- @param job Job structure.
+/** Perform moveto operation.
+ @param vptr Line containing coordinates.
*/
static
void
-plpdftex_process_line(plpdftex_job_t *job)
+operation_moveto(char *vptr)
{
- char *p1;
-
-
-#line 2435 "plpdftex.ctr"
- p1 = dk3str_c8_start(job->ilbuf, NULL);
- if (NULL != p1) {
- dk3str_c8_chomp(p1, NULL);
-
-#line 2438 "plpdftex.ctr"
- switch(*p1) {
- case 't': {
- p1 = dk3str_c8_start(++p1, NULL);
- if (NULL != p1) {
- plpdftex_process_tex_line(job, p1);
- } else {
- /* Syntax error */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 14);
- job->exc = 1;
-
-#line 2447 "plpdftex.ctr"
+ double coord[2];
+ char *parts[2];
+ size_t nparts;
+ int ok = 0;
+
+
+#line 1534 "plpdftex.ctr"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 2, vptr);
+ if (2 == nparts) {
+ ok = 1;
+ dk4pppt_newpath_moveto(
+ pppt, coord[0], coord[1], NULL, &ppptok, NULL
+ );
+ }
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
}
- } break;
- case 'p': {
- p1 = dk3str_c8_start(++p1, NULL);
- if (NULL != p1) {
- plpdftex_process_pdf_line(job, p1);
- } else {
- /* Syntax error */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 14);
- job->exc = 1;
-
-#line 2457 "plpdftex.ctr"
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
}
- } break;
- case '#': {
-
-#line 2460 "plpdftex.ctr"
- } break;
- default: {
- /* Syntax error */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 13);
- job->exc = 1;
-
-#line 2465 "plpdftex.ctr"
- } break;
- }
- }
-
-#line 2468 "plpdftex.ctr"
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1553 "plpdftex.ctr"
}
-/** Process the normal input lines.
- @param job Job structure.
+/** Perform lineto operation.
+ @param vptr Line containing coordinates.
*/
static
void
-plpdftex_run_for_input(plpdftex_job_t *job)
+operation_lineto(char *vptr)
{
- int ok = 0;
-
-
-#line 2481 "plpdftex.ctr"
- while (NULL != fgets(job->ilbuf, (int)(job->szilb), job->infi)) {
- plpdftex_process_line(job);
- }
- if (0 != job->stagr) {
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[4]);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_USER_PACKAGES: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[6]);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_USER_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_IN_DOCUMENT: {
- ok = 1;
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_AFTER_DOCUMENT: {
- ok = 1;
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
- goto finished;
- } break;
- }
- } else {
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET:
- case PLPT_STATE_DOCUMENT_CLASS:
- case PLPT_STATE_USER_FONT_SETUP:
- case PLPT_STATE_USER_PACKAGES:
- case PLPT_STATE_USER_SETUP: {
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_IN_DOCUMENT: {
- ok = 1;
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_AFTER_DOCUMENT: {
- ok = 1;
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
- goto finished;
- } break;
- }
- }
-
- finished:
- if (0 == ok) {
- job->exc = 1;
-
-#line 2582 "plpdftex.ctr"
- }
-
-#line 2583 "plpdftex.ctr"
+ double coord[2];
+ char *parts[2];
+ size_t nparts;
+ int ok = 0;
+
+
+#line 1569 "plpdftex.ctr"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 2, vptr);
+ if (2 == nparts) {
+ ok = 1;
+ dk4pppt_lineto(
+ pppt, coord[0], coord[1], NULL, &ppptok, NULL
+ );
+ }
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1588 "plpdftex.ctr"
}
-/** Open PDF and TeX output file, create output structures
- and process all input.
- @param job Job structure.
+/** Perform curveto operation.
+ @param vptr Line containing coordinates.
*/
static
void
-plpdftex_run_with_output_filenames(plpdftex_job_t *job)
+operation_curveto(char *vptr)
{
- unsigned long w;
- unsigned long h;
-
-
-#line 2598 "plpdftex.ctr"
- if (fgets(job->ilbuf, (int)(job->szilb), job->infi)) {
- if (sscanf(job->ilbuf, "%lu %lu", &w, &h) == 2) {
- job->imgw = w; job->imgh = h;
- if (((unsigned long)DK3_L_MAX >= w) && ((unsigned long)DK3_L_MAX >= h)) {
- job->fotex = dk3sf_c8_fopen_app(job->fntex, "w", job->app);
- if (NULL != job->fotex) {
- job->fopdf = dk3sf_c8_fopen_app(job->fnpdf, "wb", job->app);
- if (NULL != job->fopdf) {
- job->opdf = dk3pdf_open_app(job->app);
- if (NULL != job->opdf) {
- dk3pdf_set_next_mediabox(job->opdf, 0L, (long)w, 0L, (long)h);
- if (0 != dk3pdf_open_page_with_clip(job->opdf, 1)) {
- job->exc = 0;
-
-#line 2611 "plpdftex.ctr"
- plpdftex_run_for_input(job);
- if (0 == dk3pdf_close_page(job->opdf)) {
- job->exc = 1;
-
-#line 2614 "plpdftex.ctr"
- /* ERROR: Failed to close PDF page */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 11);
+ double coord[6];
+ char *parts[6];
+ size_t nparts;
+ int ok = 0;
+
+
+#line 1604 "plpdftex.ctr"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 6, vptr);
+ if (6 == nparts) {
+ ok = 1;
+ dk4pppt_curveto(
+ pppt,
+ coord[0], coord[1], coord[2], coord[3], coord[4], coord[5],
+ NULL, &ppptok, NULL
+ );
}
- } else {
- /* ERROR: Failed to open a PDF page */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
- }
- if (0 == dk3pdf_write_file(job->opdf, job->fopdf)) {
- job->exc = 1;
-
-#line 2623 "plpdftex.ctr"
- /* ERROR: Failed to write PDF to file! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 9);
- }
- dk3pdf_close(job->opdf); job->opdf = NULL;
- } else {
- /* Failed to open PDF output structure */
- }
- if (0 == dk3sf_fclose_app(job->fopdf, job->app)) {
- job->exc = 1;
-
-#line 2632 "plpdftex.ctr"
- }
- job->fopdf = NULL;
- } else {
- /* Failed to open PDF output file */
- }
- if (0 == dk3sf_fclose_app(job->fotex, job->app)) {
- job->exc = 1;
-
-#line 2639 "plpdftex.ctr"
- }
- job->fotex = NULL;
- } else {
- /* Failed to open TeX output file */
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
}
- } else {
- /* Overflow, w or h too large! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 8);
- }
- } else {
- /* ERROR: No w h */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 7);
- }
- } else {
- /* ERROR: Missing w h line */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 6);
- }
-
-#line 2656 "plpdftex.ctr"
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+
+
+#line 1625 "plpdftex.ctr"
}
-/** Process input from file or stdin.
- @param job Job structure.
+/** Process one contents line.
*/
static
void
-plpdftex_process_input(plpdftex_job_t *job)
+process_contents_line(void)
{
- char *p1;
-
-
-#line 2669 "plpdftex.ctr"
- if (fgets(job->ilbuf, (int)(job->szilb), job->infi)) {
- p1 = dk3str_c8_start(job->ilbuf, NULL);
- if (p1) {
- dk3str_c8_chomp(job->ilbuf, NULL);
- if (dk3str_c8_len(job->ilbuf) < job->szfn) {
- dk3str_c8_cpy(job->fnb1, job->ilbuf);
- dk3str_c8_cpy(job->fnpdf, job->ilbuf);
- p1 = dk3str_c8_get_suffix(job->fnpdf);
- if (p1) { *p1 = '\0'; }
- dk3str_c8_cpy(job->fntex, job->fnpdf);
- if (
- (dk3str_c8_len(job->fnpdf)+dk3str_c8_len(plpdftex_c8_kw[0]))
- < job->szfn
- )
- {
- dk3str_c8_cat(job->fnpdf, plpdftex_c8_kw[0]);
- dk3str_c8_cat(job->fntex, plpdftex_c8_kw[1]);
- p1 = dk3str_c8_get_suffix(job->fnb1);
- if (p1) {
- p1++;
- switch (dk3str_c8_array_index(pldftex_output_file_suffixes,p1,0)) {
- case 0: {
- /* pdf + tex for inclusion */
- plpdftex_run_with_output_filenames(job);
- } break;
- case 1: {
- /* standalone pdf + tex */
- job->stagr = 1;
- plpdftex_run_with_output_filenames(job);
- } break;
- default: {
- /* ERROR: Invalid file name */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 5);
- } break;
- }
- }
- } else {
- /* ERROR: File name too long! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 4);
+ char *p1 = NULL;
+ char *p2 = NULL;
+ char *p3 = NULL;
+
+
+#line 1639 "plpdftex.ctr"
+ p1 = dk4str8_start(in_buf, NULL);
+ if (NULL != p1) {
+ p2 = dk4str8_next(p1, NULL);
+ if (NULL != p2) {
+
+#line 1643 "plpdftex.ctr"
+ p3 = dk4str8_next(p2, NULL);
+ switch ( dk4str8_array_index(cmd1, p1, 0) ) {
+ case 0 : {
+ switch ( dk4str8_array_index(cmd2t, p2, 0) ) {
+ case 0 : { /* fs */
+ set_document_font_size(p3);
+ } break;
+ case 1 : { /* font-setup */
+ set_preamble_line(p3, DK4_GRA_PREAMBLE_FONT);
+ } break;
+ case 2 : { /* package */
+ set_preamble_line(p3, DK4_GRA_PREAMBLE_PACKAGE);
+ } break;
+ case 3 : { /* preamble */
+ set_preamble_line(p3, DK4_GRA_PREAMBLE_OTHER);
+ } break;
+ case 4 : { /* text */
+ typeset_text(p3, 0);
+ } break;
+ case 5 : { /* text-box */
+ typeset_text(p3, 1);
+ } break;
+ default : {
+
+#line 1666 "plpdftex.ctr"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[23], lineno);
+ } break;
+ }
+ } break;
+ case 1 : {
+ switch ( dk4str8_array_index(cmd2g, p2, 0) ) {
+ case 0 : { /* gsave */
+ dk4pppt_gsave(pppt, &ppptok, NULL);
+ } break;
+ case 1 : { /* grestore */
+ dk4pppt_grestore(pppt, &ppptok, NULL);
+ } break;
+ case 2 : { /* lw */
+ set_line_width(p3);
+ } break;
+ case 3 : { /* buttcap */
+ dk4pppt_set_line_cap(
+ pppt, DK4_GRA_LC_BUTTED, &ppptok, NULL
+ );
+ } break;
+ case 4 : { /* miterjoin */
+ dk4pppt_set_line_join(
+ pppt, DK4_GRA_LJ_MITERED, 20.0, &ppptok, NULL
+ );
+ } break;
+ case 5 : { /* nodash */
+ dk4pppt_set_line_style(
+ pppt, DK4_GRA_LS_SOLID, 0.0, &ppptok, NULL
+ );
+ } break;
+ case 6 : { /* stroke-color */
+ set_stroke_color(p3);
+ } break;
+ case 7 : { /* fill-color */
+ set_fill_color(p3);
+ } break;
+ case 8 : { /* rectangle */
+ draw_rectangle(p3);
+ } break;
+ case 9 : { /* circle */
+ draw_circle(p3);
+ } break;
+ case 10 : { /* moveto */
+ operation_moveto(p3);
+ } break;
+ case 11 : { /* lineto */
+ operation_lineto(p3);
+ } break;
+ case 12 : { /* curveto */
+ operation_curveto(p3);
+ } break;
+ case 13 : { /* closepath */
+ dk4pppt_closepath(pppt, &ppptok, NULL);
+ } break;
+ case 14 : { /* stroke */
+ dk4pppt_stroke(pppt, &ppptok, NULL);
+ } break;
+ case 15 : { /* fill */
+ dk4pppt_fill(pppt, &ppptok, NULL);
+ } break;
+ case 16 : { /* clip */
+ dk4pppt_clip(pppt, &ppptok, NULL);
+ } break;
+ case 17 : { /* prepare-stroke */
+ dk4pppt_prepare_stroke(pppt, &ppptok, NULL);
+ } break;
+ case 18 : { /* prepare-fill */
+ dk4pppt_prepare_fill(pppt, &ppptok, NULL);
+ } break;
+ default : {
+
+#line 1738 "plpdftex.ctr"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[23], lineno);
+ } break;
+ }
+ } break;
+ default : {
+
+#line 1745 "plpdftex.ctr"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[24], lineno);
+ } break;
+ }
+ }
+ else {
+
+#line 1752 "plpdftex.ctr"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[25], lineno);
+ }
}
- } else {
- /* ERROR: File name too long in first input line */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 4);
- }
- } else {
- /* ERROR: Syntax error, first line must not be empty */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 3);
- }
- }
-
-#line 2718 "plpdftex.ctr"
+ else {
+
+#line 1758 "plpdftex.ctr"
+ /* Empty line is ok */
+ }
+
+
+#line 1761 "plpdftex.ctr"
}
-/** Process input.
- @param job Job structure.
+/** Process all input lines from standard input.
*/
static
void
-plpdftex_run_processing(plpdftex_job_t *job)
+process_input_from_stdin(void)
{
- dk3_dir_t *fne;
- dkChar const *fnpattern;
- dkChar const *fn;
- dk3_um_t nfiles;
- int numargs;
-
-
-#line 2735 "plpdftex.ctr"
- numargs = dk3opt_get_num_args(job->opt);
- switch (numargs) {
- case 0: {
- job->infi = stdin;
- plpdftex_process_input(job);
- } break;
- case 1: {
- fnpattern = dk3opt_get_arg(job->opt, 0);
- if (fnpattern) {
- if (dk3sf_must_expand(fnpattern)) {
- fne = dk3dir_fne_open_app(fnpattern, job->app);
- if (fne) {
- nfiles = dk3dir_get_number_of_files(fne);
- if (nfiles) {
- if (DK3_UM_1 == nfiles) {
- if (dk3dir_get_next_file(fne)) {
- fn = dk3dir_get_fullname(fne);
- if (fn) {
- job->infi = dk3sf_fopen_app(fn, dkT("r"), job->app);
- if (job->infi) {
- plpdftex_process_input(job);
- fclose(job->infi); job->infi = NULL;
- }
- } else {
- /* ERROR: Must not happen */
- dk3app_log_i1(job->app, DK3_LL_ERROR, 166);
- }
- } else {
- /* ERROR: Must not happen */
- dk3app_log_i1(job->app, DK3_LL_ERROR, 166);
+ dk4_er_t er;
+
+
+#line 1773 "plpdftex.ctr"
+ while (1 == cc) {
+ cc = 0;
+ if (0 != sig_can_continue(1)) {
+ /* 2019-10-24 NOTE:
+ MSVC complains about the conversion from size_t to int
+ in the fgets() call below.
+ Ths sz_in_buf value is constant (4096 at this time)
+ and fits into an int.
+ */
+ if (NULL != fgets(in_buf, sz_in_buf, stdin)) {
+ cc = 1;
+ lineno++;
+ dk4str8_delnl(in_buf);
+
+
+#line 1787 "plpdftex.ctr"
+ switch (st) {
+ case STATE_ERROR : {
+ /* Do nothing */
+ } break;
+ case STATE_START : {
+ process_file_name();
+ } break;
+ case STATE_DIM : {
+ process_file_dimensions();
+ } break;
+ default : {
+ process_contents_line();
+ } break;
+ }
+ }
+ }
+ else {
+ cc = -1;
+ }
+ }
+
+
+#line 1808 "plpdftex.ctr"
+ /*
+ Write output and clean up.
+ */
+ if (NULL != pppt) {
+
+#line 1812 "plpdftex.ctr"
+ if ((0 != ppptok) && (STATE_ERROR != st)) {
+
+#line 1813 "plpdftex.ctr"
+ dk4error_init(&er);
+ if (0 == dk4pppt_write_and_close(pppt, &er)) {
+ exval = EXIT_FAILURE;
+
+#line 1816 "plpdftex.ctr"
+ /* ERROR: Failed to write graphics output */
+ fputs(kw_c8[6], stderr);
+ }
+ }
+ else {
+
+#line 1821 "plpdftex.ctr"
+ dk4pppt_close(pppt);
+ exval = EXIT_FAILURE;
+
+#line 1823 "plpdftex.ctr"
}
- } else {
- /* ERROR: Too many file names match pattern! */
- dk3app_log_i3(job->app, DK3_LL_ERROR, 168, 169, fnpattern);
- }
- } else {
- /* ERROR: No files match pattern */
- dk3app_log_i3(job->app, DK3_LL_ERROR, 215, 216, fnpattern);
- }
- dk3dir_close(fne);
- }
- } else {
- job->infi = dk3sf_fopen_app(fnpattern, dkT("r"), job->app);
- if (job->infi) {
- plpdftex_process_input(job);
- fclose(job->infi); job->infi = NULL;
- }
}
- } else {
- /* ERROR: Something wrong with options */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 2);
- }
- } break;
- default: {
- /* ERROR: One argument is maximum */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 1);
- } break;
- }
-
-#line 2793 "plpdftex.ctr"
+ else {
+
+#line 1826 "plpdftex.ctr"
+ exval = EXIT_FAILURE;
+
+#line 1827 "plpdftex.ctr"
+ }
+
+
+#line 1829 "plpdftex.ctr"
}
-/** Run.
- @param job Job structure.
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
*/
static
void
-plpdftex_run(plpdftex_job_t *job)
+plpdftex_run_with_signal_handlers(void)
{
- int cmd; /* Command to execute */
-
-
-#line 2806 "plpdftex.ctr"
- job->opt = dk3opt_open_from_app(
- plpdftex_options, sz_plpdftex_options, dkT('\0'), NULL, job->app
- );
- if (job->opt) {
- if (0 == dk3opt_get_error_code(job->opt)) {
- cmd = 0;
- if(dk3opt_is_set(job->opt, dkT('h'))) {
- cmd |= DK3_APP_CMD_HELP;
- }
- if(dk3opt_is_set(job->opt, dkT('v'))) {
- cmd |= DK3_APP_CMD_VERSION;
- }
- if(dk3opt_is_set(job->opt, dkT('l'))) {
- cmd |= DK3_APP_CMD_LICENSE;
- }
- if (cmd) {
- dk3sf_initialize_stdout();
- /* Show version */
- if (cmd & DK3_APP_CMD_VERSION) {
- dk3sf_fputs(plpdftex_version, stdout);
- dk3sf_fputc(dkT('\n'), stdout);
+#ifdef SIGPIPE
+ struct sigaction opipe;
+#endif
+ struct sigaction oint;
+#ifdef SIGPIPE
+ struct sigaction npipe;
+#endif
+ struct sigaction nint;
+ struct sigaction oterm;
+ struct sigaction nterm;
+ int success = 0;
+
+
+#line 1852 "plpdftex.ctr"
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ fputs(kw_c8[1], stderr);
+ goto finished;
}
- if (cmd & DK3_APP_CMD_LICENSE) {
- /* Show license */
- dk3sf_fputt(plpdftex_license_text, stdout);
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ fputs(kw_c8[1], stderr);
+ goto finished;
}
- if (cmd & DK3_APP_CMD_HELP) {
- /* Show help */
- dk3app_help(job->app, dkT("plpdftex.txt"), plpdftex_text_help);
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ fputs(kw_c8[1], stderr);
+ goto finished;
}
- job->exc = 0;
+#endif
-#line 2837 "plpdftex.ctr"
- } else {
- /* Run normally */
- plpdftex_run_processing(job);
- }
- }
- }
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_pipe;
+ }
-#line 2843 "plpdftex.ctr"
-}
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_int;
+ }
+ success = 1;
+ process_input_from_stdin();
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+ /* ERROR: Failed to restore old SIGTERM settings */
+ fputs(kw_c8[2], stderr);
+ success = 0;
+ }
-/** File name as read from input.
-*/
-static char plpdftex_input_filename[DK3_MAX_PATH];
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ fputs(kw_c8[2], stderr);
+ success = 0;
+ }
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ fputs(kw_c8[2], stderr);
+ success = 0;
+ }
+#endif
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) {
+ exval = EXIT_FAILURE;
-/** PDF output file name.
-*/
-static char plpdftex_pdf_filename[DK3_MAX_PATH];
+#line 1953 "plpdftex.ctr"
+ }
+
+#line 1955 "plpdftex.ctr"
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+*/
+static
+void
+plpdftex_run_with_signal_handlers(plpdftex_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#line 1970 "plpdftex.ctr"
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ process_input_from_stdin();
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+
-/** TeX output file name.
+#line 1982 "plpdftex.ctr"
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
*/
-static char plpdftex_tex_filename[DK3_MAX_PATH];
-
+static
+void
+plpdftex_run_with_signal_handlers(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#line 1997 "plpdftex.ctr"
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ process_input_from_stdin();
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+
-/** Input line buffer (one line from input file).
+#line 2009 "plpdftex.ctr"
+}
+#else
+/** Set signal handlers and run.
*/
-static char plpdftex_input_buffer[1024];
+static
+void
+plpdftex_run_with_signal_handlers(void)
+{
+ process_input_from_stdin();
+}
+#endif
+#endif
+#endif
-/** Main function, entry point of the program.
+/** Main function.
@param argc Number of command line arguments.
@param argv Command line arguments array.
- @return 0 on success, any other value indicates an error.
+ @return 0 on success, all other values indicate errors.
*/
-DK3_MAIN
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
{
- plpdftex_job_t job; /* Job structure. */
- int check_presence = 0; /* Flag: Just presence check. */
- int exit_code = 1; /* Exit code returned to OS. */
-
-
-
-#line 2883 "plpdftex.ctr"
-
-
-#line 2884 "plpdftex.ctr"
- if (2 == argc) {
- if (dk3str_cmp(argv[1], plpdftex_check_presence) == 0) {
- check_presence = 1;
- }
- }
- if (check_presence) {
- fputs(plpdftex_protocol, stdout);
- exit_code = 0;
- } else {
- plpdftex_job_init(&job);
- job.fnb1 = plpdftex_input_filename;
- job.fnpdf = plpdftex_pdf_filename;
- job.fntex = plpdftex_tex_filename;
- job.szfn = DK3_MAX_PATH;
- job.ilbuf = plpdftex_input_buffer;
- job.szilb = sizeof(plpdftex_input_buffer);
- job.app = dk3app_open_command(
- argc, (dkChar const * const *)argv, plpdftex_group_name
- );
- if (job.app) {
- job.msg = dk3app_messages(
- job.app, dkT("plpdftex.str"), (dkChar const **)plpdftex_kw
- );
- job.sco = dk3sto_open_app(job.app);
- if (job.sco) {
- job.sico = dk3sto_it_open(job.sco);
- if (job.sico) {
- plpdftex_run(&job);
+
+
+#line 2037 "plpdftex.ctr"
+
+
+#line 2038 "plpdftex.ctr"
+ if ((1 < argc) && (0 == dk4str_cmp(argv[1], plpdftex_check_presence))) {
+ exval = EXIT_SUCCESS;
+
+#line 2040 "plpdftex.ctr"
+ fputs(plpdftex_protocol, stdout);
+ }
+ else {
+ app = dk4app_open_silent(
+ argc, argv, NULL, 0, kw_dk[0], versno, kw_dk[1], help_txt, lic_txt
+ );
+ if (NULL != app) {
+ if (0 != dk4app_can_run_normally(app)) {
+
+#line 2048 "plpdftex.ctr"
+ dk4gra_conf_init(&graconf);
+ graconf.driver = DK4_GRA_DRIVER_PGF;
+ if (DK4_ENCODING_UTF8 == dk4app_get_stdin_encoding(app)) {
+ inenc = DK4_ENCODING_UTF8;
+ }
+ uc2l = dk4uc2l_open_from_app(app);
+ if (NULL != uc2l) {
+
+#line 2055 "plpdftex.ctr"
+ plpdftex_run_with_signal_handlers();
+ dk4uc2l_close(uc2l);
+ }
+ else {
+
+#line 2059 "plpdftex.ctr"
+ /* ERROR: Failed to create LaTeX encoding structure */
+ fputs(kw_c8[5], stderr);
+ }
+ }
+ else {
+
+#line 2064 "plpdftex.ctr"
+ dk4app_help_version_license(app);
+ exval = EXIT_SUCCESS;
+
+#line 2066 "plpdftex.ctr"
+ }
+ dk4app_close(app);
+ app = NULL;
+ }
+ else {
+
+#line 2071 "plpdftex.ctr"
+ fputs(kw_c8[0], stderr);
+ }
}
- }
- }
- exit_code = job.exc;
- plpdftex_job_cleanup(&job);
- }
-
-
-#line 2919 "plpdftex.ctr"
-
-
-#line 2920 "plpdftex.ctr"
- fflush(stdout);
- exit(exit_code); return exit_code;
+
+
+#line 2075 "plpdftex.ctr"
+
+
+#line 2076 "plpdftex.ctr"
+ exit(exval); return exval;
}
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/plpdftex.ctr b/support/dktools/plpdftex.ctr
index d3a8fbd31f..0cacb7f318 100644
--- a/support/dktools/plpdftex.ctr
+++ b/support/dktools/plpdftex.ctr
@@ -1,2923 +1,2080 @@
%% options
copyright owner = Dirk Krause
-copyright year = 2014-xxxx
-license = bsd
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
-%% header
-#include "dk3all.h"
-
-
-
-/** Current state of the program.
-*/
-enum {
-
- /** No output produced yet.
- */
- PLPT_STATE_NO_OUTPUT_YET = 0,
-
- /** Document class line written.
- */
- PLPT_STATE_DOCUMENT_CLASS,
-
- /** Lines of user-specified font setup written.
- */
- PLPT_STATE_USER_FONT_SETUP,
+%% module
- /** Lines of user-specified usepackage instructions written.
- */
- PLPT_STATE_USER_PACKAGES,
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
- /** User-specified setup lines were written.
- */
- PLPT_STATE_USER_SETUP,
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
- /** The begin document line was written, contents may be added.
- */
- PLPT_STATE_IN_DOCUMENT,
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
- /** Finished, the end document line was written.
- */
- PLPT_STATE_AFTER_DOCUMENT
+#ifndef DK4ENC_H_INCLUDED
+#include "dk4enc.h"
+#endif
-};
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
-/** Job structure for the plpdftex program.
-*/
-typedef struct {
- dk3_app_t *app; /**< Application structure. */
- dkChar const * const *msg; /**< Localized messages texts. */
- dkChar const * const *kwnl; /**< Keywords not localized. */
- dkChar const * const *argv; /**< Command line arguments array. */
- dkChar const *infn; /**< Input file name. */
- dk3_sto_t *sco; /**< Storage for colors. */
- dk3_sto_it_t *sico; /**< Storage iterator for colors. */
- char *fnb1; /**< File name as read from input. */
- char *fnpdf; /**< File name, PDF output file. */
- char *fntex; /**< File name, TeX output file. */
- char *ilbuf; /**< Input line buffer. */
- dk3_option_set_t *opt; /**< Options. */
- dk3_pdf_t *opdf; /**< PDF output structure. */
- FILE *infi; /**< Input file. */
- FILE *fopdf; /**< PDF output file. */
- FILE *fotex; /**< TeX output file. */
- long imgw; /**< Image width. */
- long imgh; /**< Image height. */
- size_t szfn; /**< File name buffer size. */
- size_t szilb; /**< Size of input line buffer. */
- int state; /**< Current program state. */
- int exc; /**< Exit code. */
- int argc; /**< Number of command line arguments. */
- int stagr; /**< Flag: Produce standalone graphics. */
-} plpdftex_job_t;
+#ifndef DK4PPPT_H_INCLUDED
+#include "dk4pppt.h"
+#endif
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+#ifndef DK4UC2L_H_INCLUDED
+#include "dk4uc2l.h"
+#endif
-/** Named color.
-*/
-typedef struct {
- char const *name; /**< Color name. */
- double r; /**< Red. */
- double g; /**< Green. */
- double b; /**< Blue. */
-} plpt_named_color_t;
+#ifndef DK4UC2LA_H_INCLUDED
+#include "dk4uc2la.h"
+#endif
+#ifndef DK4GRCO_H_INCLUDED
+#include "dk4grco.h"
+#endif
-#include "plptcol.h"
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+#ifndef DK4REC27_H_INCLUDED
+#include "dk4rec27.h"
+#endif
-%% module
+#ifndef DK4MAI8DSZ_H_INCLUDED
+#include "dk4mai8dsz.h"
+#endif
-#include "dk3all.h"
-#if 0
-#include "dkt-version.h"
+#ifndef DK4MAI8DBL_H_INCLUDED
+#include "dk4mai8dbl.h"
#endif
+
+#ifndef DK4VERS_H_INCLUDED
#include "dk4vers.h"
-#include "dkt.h"
-#include "dk3pdf.h"
-#include "plpdftex.h"
+#endif
-#include <stdio.h>
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
-/** Option to check for the presence of the program.
+/** Named color.
*/
-static dkChar const plpdftex_check_presence[] = { dkT("--check-presence") };
+typedef struct {
+ char const *name; /**< Color name. */
+ double r; /**< Red. */
+ double g; /**< Green. */
+ double b; /**< Blue. */
+} named_color_t;
-/** Protocol version to issue as response to a presence check.
-*/
-#if VERSION_BEFORE_20140924
-static dkChar const plpdftex_protocol[] = { dkT("1\n") };
-#else
-static char const plpdftex_protocol[] = { "1\n" };
-#endif
-/** Application group name.
-*/
-static dkChar const plpdftex_group_name[] = { dkT("dktools") };
-/** DK tools version number.
+/** Choices for current state stored in st.
*/
-static dkChar const plpdftex_version[] = { DKT_VERSION_DK };
+enum {
+ STATE_ERROR = -1, /**< Error state, do nothing. */
+ STATE_START , /**< Expecting first input line. */
+ STATE_DIM , /**< Expecting dimension line. */
+ STATE_CONTENTS , /**< Retrieving contents */
+};
-/** Default help text shown if help file is not found.
+/** Input line buffer for processing stdin.
+ 2019-10-24 NOTE:
+ The size argument in fgets() is int type.
+ So do not make the array size larger than INT_MAX.
*/
-static dkChar const * const plpdftex_text_help[] = {
-$!text macro=dkT
-
-NAME
-
- plpdftex - Plot into a combination of *.pdf/*.tex files.
-
-SYNOPSIS
-
- plpdftex
- plpdftex --check-presence
- plpdftex --help
- plpdftex --license-terms
-
-DESCRIPTION
-
-The program processes an incoming data stream containing both graphics
-instructions and text labels. Graphics instructions are written to a
-PDF file, text labels are written to a *.tex file.
-The *.tex file includes the PDF file containing the graphics and
-typesets the text labels on top of it.
-
-This program is not intended to be used directly, it is an output
-driver for the octpgfpl package for GNU Octave.
-
-
-OPTIONS
-
--h Show this help text.
---help
-
--v Show version information.
---version
-
--l Show the license conditions.
---license-terms
-
---check-presence Print the protocol version, may be used to
- check for the presence of the program.
-
-EXIT STATUS
-
-0 on success, all other exit status codes indicate an error.
-
-INPUT FILE
-
-Input is read from standard input.
-
-The first line specifies a file name combination. It must end on
-either ``.pdftex'' to produce a *.pdf/*.tex combination for inclusion
-in a LaTeX document or on ``.pdftexs'' to produce a *.pdf/*.tex
-combination for standalone processing.
-
-The second line contains two unsigned integer numbers, separated
-by spaces: Image width and height in PS/PDF points (known as bp in
-LaTeX).
-
-The remaining lines describe the image, there are ``t'' lines
-and ``p'' lines, i.e.
-
-t fs 12
-t font-setup \usepackage[T1]{fontenc}
-t package \usepackage[intlimit]{amsmath}
-t preamble \DeclareMathOperator{\intd}{\text{d}}
-t text 10 20 base left black This is a test.
-t text-box 10 20 base left red This is another test.
-p gsave
-p grestore
-p lw 3
-p buttcap
-p miterjoin
-p nodash
-p stroke-color blue!50!black
-p fill-color red!80!white
-p rectangle 5 5 200 80
-p circle 20 30 5
-p moveto 30 80
-p lineto 50 90
-p curveto 50 100 100 100 100 90
-p closepath
-p stroke
-p fill
-p clip
-
-The ``t fs'' ``t font-setup'', ``t package'' and ``t preamble''
-lines are only used when producing a *.pdf/*.tex file combination for
-standalone processing, otherwise they are ignored.
-
-``t fs'' specifies the font size for the documentclass line.
-This line must be used before ``t font-setup'', ``t package'', ``t preamble'',
-``t text'' or ``p'' lines. The line is optional, by default the documentclass
-is written without the font size specification.
+static char in_buf[4096];
-``t font-setup'' specifies usepackage and other instructions for font
-setup. These lines are optional, a default font setup section is used
-if no ``t font-setup'' lines are used. Any ``t font-setup'' lines
-must be used before ``t package'', ``t preamble'', ``t text'' or ``p''
-lines.
-``t preamble'' lines contain further setup instructions for the preamble,
-they are optional.
-``t text'' lines contain text labels to show. The line contains
-x position, y position, vertical alignment (bottom, base, centered,
-or top), horizontal alignment (left, centered, or right), color
-and the text to show.
-
-All color definitions must be LaTeX color strings like
-``blue!50!white''...
-
-``t text-box'' lines contain text labels to show. The line contains
-x position, y position, vertical alignment (bottom, base, centered,
-or top), horizontal alignment (left, centered, or right), color
-and the text to show.
-
-``p'' lines contain graphics instructions transferred to the PDF file.
-
-``p gsave'' saves the current graphics state.
-
-``p grestore'' restores the graphics state.
-
-``p lw'' sets the line width for stroking.
-
-``p buttcap'' sets line cap style to butted.
-
-``p miterjoin'' sets the line join style to miter.
-
-``p nodash'' sets up contiguous line style.
-
-``p stroke-color'' sets the stroke color.
-
-``p fill-color'' sets the fill color.
-
-``p rectangle'' creates a rectangular path, specify start x position,
-start y position, end x position and end y position.
-
-``p circle'' creates a circular path, specify center x position,
-center y position and radius.
-
-``p moveto'' starts a new path and moves the current position
-to the specified x and y position.
-
-``p lineto'' adds a line segment from the current position to the specified
-x and y position to the path.
-
-``p curveto'' adds a Bezier segment starting at the current position
-to the path. Specify x and y position of the first control point,
-x and y position of the second control point and x and y position
-of the final point.
-
-``p closepath'' closes the current path.
-
-``p stroke'' strokes the current path.
-
-``p fill'' fills the current path.
-
-``p clip'' uses the current path as clip path.
-
-
-OUTPUT FILES
-
-The output file names are determined from the first input line.
-
-NOTES
-
-The plpdftex program does not support all features of PDF/TeX file pairs,
-it is only intended as an output driver for the pgfplot() instruction
-in the octpgfpl package for GNU Octave.
+/** Buffer to construct color specification.
+*/
+static char cs_buf[sizeof(in_buf)];
-RESTRICTIONS
-Color definitions for plpdftex must only contain color names ``white'',
-``black'', ``red'', ``green'', ``blue'', ``cyan'', ``magenta'', ``yellow'',
-``gray'', ``lightgray'', ``darkgray'', ``brown'', ``lime'', ``olive'',
-``orange'', ``pink'', ``purple'', ``teal'', ``violet'' and combinations
-like ``red!50!black''.
-AUTHOR
+/** Buffer for graphics output file name.
+*/
+static dkChar fn_buf[DK4_MAX_PATH];
-Dirk Krause
-COPYRIGHT AND LICENSE
-Run
- plpdftex -l
-to see the license conditions.
+/** Graphics configuration.
+*/
+static dk4_gra_conf_t graconf;
-SEE ALSO
-http://dktools.sourceforge.net
-http://octpgfpl.sourceforge.net
-$!end
+/** Predefined colors.
+ Must be alphabetically sorted, bsearch() is used to find colors.
+*/
+static named_color_t const named_colors[] = {
+ { "black", 0.0, 0.0, 0.0 },
+ { "blue", 0.0, 0.0, 1.0 },
+ { "brown", 0.75, 0.5, 0.25 },
+ { "cyan", 0.0, 1.0, 1.0 },
+ { "darkgray", 0.25, 0.25, 0.25 },
+ { "gray", 0.5, 0.5, 0.5 },
+ { "green", 0.0, 1.0, 0.0 },
+ { "lightgray", 0.75, 0.75, 0.75 },
+ { "lime", 0.75, 1.0, 0.0 },
+ { "magenta", 1.0, 0.0, 1.0 },
+ { "olive", 0.5 , 0.5, 0.0 },
+ { "orange", 1.0 , 0.5, 0.0 },
+ { "pink", 1.0 , 0.75, 0.75 },
+ { "purple", 0.75, 0.0, 0.25 },
+ { "red", 1.0, 0.0, 0.0 },
+ { "teal", 0.00, 0.5, 0.5 },
+ { "violet", 0.5 , 0.0, 0.5 },
+ { "white", 1.0, 1.0, 1.0 },
+ { "yellow", 1.0, 1.0, 0.0 }
};
-/** License conditions.
+/** Option to check for the presence of the program.
*/
-static dkChar const * const plpdftex_license_text[] = {
-$!text macro=dkT
-
-Copyright (c) 2014-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+static dkChar const plpdftex_check_presence[] = { dkT("--check-presence") };
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the copyright holder(s) nor the names of
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
+/** Protocol version to issue as reponse to --check-presence.
+*/
+static char const plpdftex_protocol[] = { "1\n" };
-$!end
-};
-static dkChar const * const plpdftex_kw[] = {
+/** Keywords in dkChar to create silent application.
+*/
+static dkChar const * const kw_dk[] = {
$!string-table macro=dkT
#
-# 0 Program name
-#
-plpdftex
-#
-# 1
-#
-Too many command line arguments, just one input file name allowed!
-#
-# 2
-#
-Failed to retrieve first command line argument (probably a bug)!
-#
-# 3
-#
-Output file names missing in first line!
-#
-# 4
+# 0 Application group name
#
-File name too long in first line!
+dktools
#
-# 5
+# 1 Help file name
#
-Wrong file name suffix, must be *.pdftex or *.pdftexs!
-#
-# 6
-#
-Missing second line, containing width and height!
-#
-# 7
-#
-Failed to retrieve width and height!
-#
-# 8
-#
-Numeric overflow, width and/or height too large!
-#
-# 9
-#
-Failed to write PDF data to file!
-#
-# 10
-#
-Failed to open PDF page!
-#
-# 11
-#
-Failed to close PDF page!
-#
-# 12
-#
-Syntax error, document already closed!
-#
-# 13
-#
-Syntax error, line not started by ``t'', ``p'', or ``#''!
-#
-# 14
-#
-Syntax error, missing command!
+plpdftex.txt
+$!end
+};
+
+
+
+/** Char keywords
+*/
+static char const * const kw_c8[] = {
+$!string-table
#
-# 15
+# 0
#
-PDF clip operation failed!
+ERROR: Not enough memory!\n
#
-# 16
+# 1 2
#
-PDF fill operation failed!
+ERROR: Failed to setup signal handlers!\n
+ERROR: Failed to restore previous signal handler!\n
#
-# 17
+# 3 4
#
-PDF stroke operation failed!
+\\color{
+}
#
-# 18
+# 5
#
-PDF closepath operation failed!
+ERROR: Failed to open LaTeX encoding data!\n
#
-# 19
+# 6
#
-PDF curveto operation failed!
+ERROR: Failed to write graphics output to file!\n
#
-# 20
+# 7
#
-Syntax error, numeric value expected!
+ERROR: Illegal file name suffix for output file!\n
#
-# 21
+# 8
#
-Syntax error, too few arguments for command!
+ERROR: No file name suffix found in output file name!\n
#
-# 22
+# 9
#
-PDF moveto operation failed!
+ERROR: Output file name too long!\n
#
-# 23
+# 10
#
-Syntax error, radius is negative!
+ERROR: Illegal characters in output file name!\n
#
-# 24
+# 11
#
-PDF lineto operation failed!
+ERROR: Failed to recode output file name to system encoding!\n
#
-# 25
+# 12
#
-PDF set nonstroking color operation failed!
+ERROR: Failed to open graphics output!\n
#
-# 26
+# 13
#
-No such color!
+ERROR: Syntax in line %lu - font size is not a positive number!\n
#
-# 27
+# 14
#
-PDF set stroking color operation failed!
+ERROR: Syntax in line %lu - font size is not a number!\n
#
-# 28
+# 15
#
-PDF set dash operation failed!
+ERROR: Syntax in line %lu - missing value!\n
#
-# 29
+# 16
#
-PDF set linejoin operation failed!
+ERROR: Syntax in line %lu - too few values!\n
#
-# 30
+# 17
#
-PDF set linecap operation failed!
+ERROR: Syntax in line %lu - not a horizontal alignment!\n
#
-# 31
+# 18
#
-Syntax error, linewidth negative!
+ERROR: Syntax in line %lu - not a vertical alignment!\n
#
-# 32
+# 19
#
-PDF set linewidth operation failed!
+ERROR: Syntax in line %lu - not a number!\n
#
-# 33
+# 20
#
-PDF grestore operation failed!
+ERROR: Syntax in line %lu - not a positive number!\n
#
-# 34
+# 21
#
-PDF gsave operation failed!
+ERROR: Syntax in line %lu - color "%s" not found!\n
#
-# 35
+# 22
#
-Write operation failed to TeX output file!
+ERROR: Syntax in line %lu - opacity value "%s" out of range 0...100!\n
#
-# 36
+# 23
#
-Syntax error, invalid horizontal alignment specification!
+ERROR: Syntax in line %lu - illegal subcommand!\n
#
-# 37
+# 24
#
-Syntax error, invalid horizontal alignment specification!
+ERROR: Syntax in line %lu - illegal command!\n
#
-# 38
+# 25
#
-Syntax error, order must be fs, font-setup, package, preamble, text!
+ERROR: Syntax in line %lu - missing subcommand!\n
$!end
};
-/** 8 bit strings
+/** License text.
*/
-static char const * const plpdftex_c8_kw[] = {
-$!string-table
-#
-# 0 1 Output file name suffixes
-#
--i.pdf
-.tex
-#
-# 2
-#
-\\documentclass{article}
-#
-# 3 4
-#
-% font setup (begin)
-% font setup (end)
-#
-# 5 6
-#
-% other packages (begin)
-% other packages (end)
-#
-# 7 8
-#
-\\setlength{\\paperwidth}{%ldbp}\n
-\\setlength{\\paperheight}{%ldbp}\n
-#
-# 9 10
-#
-% user-specific setup instructions (begin)
-% user-specific setup instructions (end)
-#
-# 11
-#
-\\begin{document}%
-#
-# 12 13 14 15 16
-#
-\\begin{picture}(0,0)%
-\\includegraphics{
-}%
-\\end{picture}%
-\\setlength{\\unitlength}{1bp}%
-#
-# 17 18
-#
-\\begin{picture}(%ld,%ld)%\n
-\\end{document}
-#
-# 19 20 21 22
-#
-\\put(%g,%g){\\makebox(0,0)
-[
-]
-{\\smash{{\\color{%s}%s}}}}\n
-#
-# 23
-#
-{\\colorbox{white}{\\color{%s}\\ovalbox{%s}}}}\n
-#
-# 24
-#
-{{\\color{%s}%s}}}\n
-$!end
-};
+static dkChar const * const lic_txt[] = {
+$!string-table macro=dkT
+Copyright (c) 2018, Dirk Krause
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of the copyright holder(s) nor the names of
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
-/** Default font setup.
-*/
-static char const * const plpdftex_default_font_setup[] = {
-$!string-table
-% begin font setup
-\\usepackage[T1]{fontenc}
-\\usepackage{textcomp}
-\\usepackage{mathptmx}
-\\usepackage[scaled=.92]{helvet}
-\\usepackage{courier}
-% end font setup
$!end
};
-/** Default additional packages.
+/** Help text.
*/
-static char const * const plpdftex_default_packages[] = {
-$!string-table
-% other packages (begin)
-\\usepackage{textcomp}
-\\usepackage[intlimits]{amsmath}
-% other packages (end)
-$!end
-};
+static dkChar const * const help_txt[] = {
+$!string-table macro=dkT
+
+plpdftex - Plot to PDF+TeX file pair
+------------------------------------
+plpdftex --check-presence
+plpdftex
+The first form is used by other programs to check the presence of the
+program. Plpdftex prints the protocol version number.
+
+The second form is used to create a file pair.
+
+Other options are:
+
+--help to show this help text.
+--manual to show the full manual.
+--version to show the version number.
-static char const * const plpdftex_required_packages[] = {
-$!string-table
-% required packages (begin)
-\\usepackage{fancybox}
-\\usepackage{graphicx}
-\\usepackage{xcolor}
-% required packages (end)
-% required instructions (begin)
$!end
};
-
-static char const * const plpdftex_required_instructions[] = {
-$!string-table
-\\pagestyle{empty}
-\\setlength{\\voffset}{-1in}
-\\setlength{\\topmargin}{0bp}
-\\setlength{\\headheight}{0bp}
-\\setlength{\\headsep}{0bp}
-\\setlength{\\topskip}{0bp}
-\\setlength{\\hoffset}{-1in}
-\\setlength{\\oddsidemargin}{0bp}
-\\setlength{\\evensidemargin}{0bp}
-\\setlength{\\marginparwidth}{0bp}
-\\setlength{\\marginparsep}{0bp}
-\\setlength{\\textwidth}{\\paperwidth}
-\\setlength{\\textheight}{\\paperheight}
-\\setlength{\\parskip}{0bp}
-\\setlength{\\parindent}{0bp}
-\\setlength{\\pdfpagewidth}{\\paperwidth}
-\\setlength{\\pdfpageheight}{\\paperheight}
-% required instructions (end)
+/** Allowed file name suffixes.
+*/
+static dkChar const * const fn_suffixes[] = {
+$!string-table macro=dkT
+.tex
+.pgf
+.pdftex
+.pdftexs
+.epstex
$!end
};
-/** Output file suffixes.
+/** First commands in line.
*/
-static char const * const pldftex_output_file_suffixes[] = {
+static const char * const cmd1[] = {
$!string-table
-pdftex
-pdftexs
+t
+p
$!end
};
-/** Instruction names in TeX lines.
+/** Text related commands.
*/
-static char const * const plpdftex_tex_instructions[] = {
+static const char * const cmd2t[] = {
$!string-table
-#
-# 0
-#
fs
-#
-# 1
-#
font-setup
-#
-# 2
-#
package
-#
-# 3
-#
preamble
-#
-# 4
-#
text
-#
-# 5
-#
text-box
$!end
};
-/** Instruction names in PDF instructions.
+/** Graphics related commands.
*/
-static char const * const plpdftex_pdf_instructions[] = {
+static const char * const cmd2g[] = {
$!string-table
-#
-# 0
-#
gsave
-#
-# 1
-#
grestore
-#
-# 2
-#
lw
-#
-# 3
-#
buttcap
-#
-# 4
-#
miterjoin
-#
-# 5
-#
nodash
-#
-# 6
-#
stroke-color
-#
-# 7
-#
fill-color
-#
-# 8
-#
rectangle
-#
-# 9
-#
circle
-#
-# 10
-#
moveto
-#
-# 11
-#
lineto
-#
-# 12
-#
curveto
-#
-# 13
-#
closepath
-#
-# 14
-#
stroke
-#
-# 15
-#
fill
-#
-# 16
-#
clip
+prepare-stroke
+prepare-fill
$!end
};
-/** Vertical alignments.
+/** Names for horizontal alignments
*/
-char const * const plpdftex_vertical_alignments[] = {
-"top", "centered", "base", "bottom", NULL
+static char const * const h_align_names[] = {
+$!string-table
+left
+centered
+right
+$!end
};
-/** Horizontal alignments.
+/** Names for vertical alignments.
*/
-char const * const plpdftex_horizontal_alignments[] = {
-"left", "centered", "right", NULL
+static char const * const v_align_names[] = {
+$!string-table
+top
+centered
+bottom
+base
+$!end
};
-
-/** Options expected by the program.
+/** Version number string.
*/
-static dk3_option_t const plpdftex_options[] = {
- { dkT('h'), dkT("help"), 0 },
- { dkT('v'), dkT("version"), 0 },
- { dkT('l'), dkT("license-terms"), 0 }
-};
+static dkChar const versno[] = { DKT_VERSION_DK };
-/** Number of options in plpdftex_options array.
+/** Application structure for file search, especially for LaTeX encoding tables.
*/
-static size_t const sz_plpdftex_options =
-sizeof(plpdftex_options)/sizeof(dk3_option_t);
+static dk4_app_t *app = NULL;
-/** Initialize job structure.
- @param jptr Job to initialize.
+/** LaTeX encoding structure.
*/
-static
-void
-plpdftex_job_init(plpdftex_job_t *jptr)
-{
- $? "+ plpdftex_job_init"
- jptr->app = NULL;
- jptr->msg = NULL;
- jptr->kwnl = NULL;
- jptr->exc = 1; $? ". exc 1"
- jptr->argc = 0;
- jptr->argv = NULL;
- jptr->infn = NULL;
- jptr->opt = NULL;
- jptr->infi = NULL;
- jptr->fnb1 = NULL;
- jptr->fnpdf = NULL;
- jptr->fntex = NULL;
- jptr->opdf = NULL;
- jptr->fopdf = NULL;
- jptr->fotex = NULL;
- jptr->szfn = 0;
- jptr->ilbuf = NULL;
- jptr->szilb = 0;
- jptr->stagr = 0;
- jptr->state = PLPT_STATE_NO_OUTPUT_YET;
- jptr->sco = NULL;
- jptr->sico = NULL;
- jptr->imgw = 0UL;
- jptr->imgh = 0UL;
- $? "- plpdftex_job_init"
-}
+static dk4_uc2l_t *uc2l = NULL;
-/** Clean up job structure before exiting the program.
- @param jptr Job structure to clean up.
+/** Graphics output structure.
*/
-static
-void
-plpdftex_job_cleanup(plpdftex_job_t *jptr)
-{
- plpt_named_color_t *colptr;
- $? "+ plpdftex_job_cleanup"
- if (jptr->sico) {
- dk3sto_it_reset(jptr->sico);
- do {
- colptr = (plpt_named_color_t *)dk3sto_it_next(jptr->sico);
- if (colptr) {
- plptcolor_delete(colptr);
- }
- } while (colptr);
- dk3sto_it_close(jptr->sico);
- } jptr->sico = NULL;
- if (jptr->sco) {
- dk3sto_close(jptr->sco);
- } jptr->sco = NULL;
- jptr->msg = NULL;
- jptr->kwnl = NULL;
- if (jptr->opt) {
- dk3opt_close(jptr->opt);
- }
- jptr->opt = NULL;
- if (jptr->app) {
- dk3app_close(jptr->app);
- }
- jptr->app = NULL;
- $? "- plpdftex_job_cleanup"
-}
+static dk4_pppt_t *pppt = NULL;
-/** Process font size line.
- @param job Job structure.
- @param txt Text line to process.
+/** Current line number.
*/
-static
-void
-plpdftex_process_tex_fontsize(plpdftex_job_t *job, char *txt)
-{
- double fs = 10.0;
- int ok = 0;
- $? "+ plpdftex_process_tex_fontsize"
- if (NULL == txt) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&fs, txt, NULL)) {
- /* ERROR: Not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == job->stagr) {
- ok = 1;
- goto finished;
- }
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- job->state = PLPT_STATE_DOCUMENT_CLASS;
- fprintf(job->fotex, "\\documentclass[%gpt]{article}\n", fs);
- } break;
- default: {
- /* ERROR: Too late */
- ok = 1;
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
- goto finished;
- } break;
- }
- finished:
- if (0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- plpdftex_process_tex_fontsize"
-}
+static unsigned long lineno = 0UL;
-static
-void
-plpdftex_write_textline(plpdftex_job_t *job, char const *txt)
-{
- $? "+ plpdftex_write_textline"
- if (EOF == fputs(txt, job->fotex)) {
- /* Write error */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- job->exc = 1; $? ". exc 1"
- }
- if (EOF == fputc('\n', job->fotex)) {
- job->exc = 1; $? ". exc 1"
- } $? "- plpdftex_write_textline"
-}
+/** Size of input buffer.
+*/
+static const size_t sz_in_buf = sizeof(in_buf);
-/** Process font setup line.
- @param job Job structure.
- @param txt Text line to process.
+/** Current processing state.
*/
-static
-void
-plpdftex_process_tex_font_setup(plpdftex_job_t *job, char *txt)
-{
- int ok = 0;
- $? "+ plpdftex_process_tex_font_setup"
- if (0 == job->stagr) {
- ok = 1;
- goto finished;
- }
- if (NULL == txt) {
- /* ERROR: Not text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- /* font setup (begin) */
- plpdftex_write_textline(job, plpdftex_c8_kw[3]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_FONT_SETUP;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- /* font setup (begin) */
- plpdftex_write_textline(job, plpdftex_c8_kw[3]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_FONT_SETUP;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, txt);
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 38);
- }
- }
-
- finished:
- if (0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- plpdftex_process_tex_font_setup"
-}
+static int st = STATE_START;
-static
-void
-plpdftex_write_default_font_setup(plpdftex_job_t *job)
-{
- char const * const *ptr;
- $? "+ plpdftex_write_default_font_setup"
- ptr = plpdftex_default_font_setup;
- while (NULL != *ptr) {
- plpdftex_write_textline(job, *(ptr++));
- } $? "- plpdftex_write_default_font_setup"
-}
+/** Flag: Can continue.
+*/
+static int cc = 1;
-static
-void
-plpdftex_write_default_packages(plpdftex_job_t *job)
-{
- char const * const *ptr;
- $? "+ plpdftex_write_default_packages"
- ptr = plpdftex_default_packages;
- while (NULL != *ptr) {
- plpdftex_write_textline(job, *(ptr++));
- } $? "- plpdftex_write_default_packages"
-}
+/** Flag: All pppt output ok.
+*/
+static int ppptok = 0;
-static
-void
-plpdftex_write_required_packages(plpdftex_job_t *job)
-{
- char const * const *ptr;
- $? "+ plpdftex_write_required_packages"
- ptr = plpdftex_required_packages;
- while (NULL != *ptr) {
- plpdftex_write_textline(job, *(ptr++));
- }
-
- fprintf(job->fotex, plpdftex_c8_kw[7], job->imgw);
- fprintf(job->fotex, plpdftex_c8_kw[8], job->imgh);
-
- ptr = plpdftex_required_instructions;
- while (NULL != *ptr) {
- plpdftex_write_textline(job, *(ptr++));
- }
- $? "- plpdftex_write_required_packages"
-}
+/** Input encoding used on standard input.
+*/
+static int inenc =
+#if DK4_ON_WINDOWS
+DK4_ENCODING_WIN1252
+#else
+DK4_ENCODING_PLAIN
+#endif
+;
-/** Process package selection line.
- @param job Job structure.
- @param txt Text line to process.
+/** Exit status code.
*/
-static
-void
-plpdftex_process_tex_package(plpdftex_job_t *job, char *txt)
-{
- int ok = 0;
- $? "+ plpdftex_process_tex_package"
- if (0 == job->stagr) {
- ok = 1;
- goto finished;
- }
- if (NULL == txt) {
- /* ERROR: Missing text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- plpdftex_write_default_font_setup(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[5]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_PACKAGES;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- plpdftex_write_default_font_setup(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[5]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_PACKAGES;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[4]);
- plpdftex_write_textline(job, plpdftex_c8_kw[5]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_PACKAGES;
- } break;
- case PLPT_STATE_USER_PACKAGES: {
- ok = 1;
- plpdftex_write_textline(job, txt);
- } break;
- }
- finished:
- if (0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- plpdftex_process_tex_package"
-}
+static int exval = EXIT_FAILURE;
-/** Process preamble line.
- @param job Job structure.
- @param txt Text line to process.
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
*/
static
-void
-plpdftex_process_tex_preamble(plpdftex_job_t *job, char *txt)
-{
- int ok = 0;
- $? "+ plpdftex_process_tex_preamble"
- if (0 == job->stagr) {
- ok = 1;
- goto finished;
- }
- if (NULL == txt) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_SETUP;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_SETUP;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[4]);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_SETUP;
- } break;
- case PLPT_STATE_USER_PACKAGES: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[6]);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, txt);
- job->state = PLPT_STATE_USER_SETUP;
- } break;
- case PLPT_STATE_USER_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, txt);
- } break;
- }
-
- finished:
- if (0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- plpdftex_process_tex_preamble"
-}
-
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
-/** Write start of TeX file.
- @param job Job structure.
+/** Indicator: SIGTERM signal received.
*/
static
-void
-plpdftex_open_picture_set(plpdftex_job_t *job)
-{
- $? "+ plpdftex_open_picture_set"
- if (0 != job->stagr) {
- plpdftex_write_textline(job, plpdftex_c8_kw[11]);
- }
- plpdftex_write_textline(job, plpdftex_c8_kw[12]);
- if (EOF == fputs(plpdftex_c8_kw[13], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- job->exc = 1; $? ". exc 1"
- }
- if (EOF == fputs(job->fnpdf, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- job->exc = 1; $? ". exc 1"
- }
- plpdftex_write_textline(job, plpdftex_c8_kw[14]);
- plpdftex_write_textline(job, plpdftex_c8_kw[15]);
- plpdftex_write_textline(job, plpdftex_c8_kw[16]);
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[17], job->imgw, job->imgh)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- job->exc = 1; $? ". exc 1"
- } $? "- plpdftex_open_picture_set"
-}
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+/** Pass a volatile pointer to an atomic integer.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ptr Address of atomic integer variable.
+ @return The unmodified pointer.
+*/
static
-void
-plpdftex_close_picture_set(plpdftex_job_t *job)
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
{
- $? "+ plpdftex_close_picture_set"
- plpdftex_write_textline(job, plpdftex_c8_kw[15]);
- if (0 != job->stagr) {
- plpdftex_write_textline(job, plpdftex_c8_kw[18]);
- } $? "- plpdftex_close_picture_set"
+ return ptr;
}
-
-/** Process text label line.
- @param job Job structure.
- @param txt Text line to process.
- @param withbox Flag: With box (1) or without box (0).
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
*/
static
void
-plpdftex_process_tex_text(plpdftex_job_t *job, char *txt, int withbox)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
- char *p1 = NULL; /* Y position */
- char *p2 = NULL; /* Vertical alignment */
- char *p3 = NULL; /* Horizontal alignment */
- char *p4 = NULL; /* Color */
- char *p5 = NULL; /* Label text */
- double x = 0.0; /* X position */
- double y = 0.0; /* Y position */
- int av = 0; /* Vertical alignment */
- int ah = 0; /* Horizontal alignment */
- int ok = 0;
- char c;
- $? "+ plpdftex_process_tex_text"
- /* Split strings.
- */
- if (NULL == txt) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL == p1) {
- /* ERROR: No y position */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p2 = dk3str_c8_next(p1, NULL);
- if (NULL == p2) {
- /* ERROR: No vertical alignment */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p3 = dk3str_c8_next(p2, NULL);
- if (NULL == p3) {
- /* ERROR: No horizontal alignment */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p4 = dk3str_c8_next(p3, NULL);
- if (NULL == p4) {
- /* ERROR: No color */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p5 = dk3str_c8_next(p4, NULL);
- if (NULL == p5) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
-
- /* Retrieve values from strings.
- */
- if (0 == dk3ma_d_from_c8_string(&x, txt, NULL)) {
- /* ERROR: x value not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y, p1, NULL)) {
- /* ERROR: y value not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- av = dk3str_c8_array_index(plpdftex_vertical_alignments, p2, 0);
- if (0 > av) {
- /* ERROR: Not a valid vertical alignment */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 37);
- goto finished;
- }
- ah = dk3str_c8_array_index(plpdftex_horizontal_alignments, p3, 0);
- if (0 > ah) {
- /* ERROR: Not a valid horizontal alignment */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 36);
- goto finished;
- }
-
- /* Write file header parts not yet written.
- */
- if (0 != job->stagr) {
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[4]);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_USER_PACKAGES: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[6]);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_USER_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_IN_DOCUMENT: {
- ok = 1;
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
- goto finished;
- } break;
- }
- } else {
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET:
- case PLPT_STATE_DOCUMENT_CLASS:
- case PLPT_STATE_USER_FONT_SETUP:
- case PLPT_STATE_USER_PACKAGES:
- case PLPT_STATE_USER_SETUP:
- {
- ok = 1;
- plpdftex_open_picture_set(job);
- job->state = PLPT_STATE_IN_DOCUMENT;
- } break;
- case PLPT_STATE_IN_DOCUMENT: {
- ok = 1;
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
- goto finished;
- } break;
- }
- }
-
- /* Write text label.
- */
- if (1 == ok) {
- if (1 == withbox) { $? ". text box"
- /* put(%g,%g)makebox(0,0) */ $? ". 19"
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[19], x, y)) {
- /* ERROR: fprintf failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- /* Alignment */
- if ((ah != 1) || (av != 1)) { $? ". alignment"
- if (EOF == fputs(plpdftex_c8_kw[20], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- c = '\0';
- switch (ah) {
- case 0: { c = 'l'; } break;
- case 2: { c = 'r'; } break;
- }
- if ('\0' != c) {
- if (EOF == fputc(c, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- c = '\0';
- switch (av) {
- case 0: { c = 't'; } break;
- case 2: case 3: { c = 'b'; } break;
- }
- if ('\0' != c) {
- if (EOF == fputc(c, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- if (EOF == fputs(plpdftex_c8_kw[21], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[23], p4, p5)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- } else { $? ". text"
- /* put(%g,%g)makebox(0,0) */ $? ". 19"
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[19], x, y)) {
- /* ERROR: fprintf failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- /* Alignment */
- if ((ah != 1) || (av != 1)) { $? ". alignment"
- if (EOF == fputs(plpdftex_c8_kw[20], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- c = '\0';
- switch (ah) {
- case 0: { c = 'l'; } break;
- case 2: { c = 'r'; } break;
- }
- if ('\0' != c) {
- if (EOF == fputc(c, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- c = '\0';
- switch (av) {
- case 0: { c = 't'; } break;
- case 2: case 3: { c = 'b'; } break;
- }
- if ('\0' != c) {
- if (EOF == fputc(c, job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- if (EOF == fputs(plpdftex_c8_kw[21], job->fotex)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- if (2 == av) {
- /* Use smash only for baseline vertical alignment */
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[22], p4, p5)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- } else {
- /* No smash for top, center, bottom vertical alignment */
- if (0 >= fprintf(job->fotex, plpdftex_c8_kw[24], p4, p5)) {
- /* ERROR: Write failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 35);
- ok = 0; goto finished;
- }
- }
- }
- }
- /* Return.
- */
- finished:
- if (0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- plpdftex_process_tex_text"
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
}
+#endif
-
-
-/** Process a TeX line.
- @param job Job structure.
- @param txt Text to process.
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
*/
static
void
-plpdftex_process_tex_line(plpdftex_job_t *job, char *txt)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
- char *firstarg;
- $? "+ plpdftex_process_tex_line"
- firstarg = dk3str_c8_next(txt, NULL);
- switch(dk3str_c8_array_index(plpdftex_tex_instructions, txt, 0)) {
- case 0: {
- plpdftex_process_tex_fontsize(job, firstarg);
- } break;
- case 1: {
- plpdftex_process_tex_font_setup(job, firstarg);
- } break;
- case 2: {
- plpdftex_process_tex_package(job, firstarg);
- } break;
- case 3: {
- plpdftex_process_tex_preamble(job, firstarg);
- } break;
- case 4: {
- plpdftex_process_tex_text(job, firstarg, 0);
- } break;
- case 5: {
- plpdftex_process_tex_text(job, firstarg, 1);
- } break;
- } $? "- plpdftex_process_tex_line"
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
}
-
-
-/** Process PDF gsave line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
*/
static
void
-pldpdftex_process_pdf_gsave(plpdftex_job_t *job, char *txt)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
- int ok = 0;
- $? "+ pldpdftex_process_pdf_gsave"
- if (0 != dk3pdf_gsave(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: gsave failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 34);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_gsave"
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
}
-
-
-/** Process PDF grestore line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
*/
static
-void
-pldpdftex_process_pdf_grestore(plpdftex_job_t *job, char *txt)
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
{
- int ok = 0;
- $? "+ pldpdftex_process_pdf_grestore"
- if (0 != dk3pdf_grestore(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR grestore failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 33);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_grestore"
+ return (*ap);
}
-
-
-/** Process PDF linewidth line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
*/
static
-void
-pldpdftex_process_pdf_lw(plpdftex_job_t *job, char *txt)
+int
+sig_can_continue(
+#ifdef SIGPIPE
+ int check_pipe
+#else
+ int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
{
- double lw = 1.0;
- int ok = 0;
- int mec = 0;
- $? "+ pldpdftex_process_pdf_lw"
- if (NULL != txt) {
- if (0 != dk3ma_d_from_c8_string(&lw, txt, &mec)) {
- if (0.0 <= lw) {
- if (0 != dk3pdf_set_linewidth(job->opdf, lw)) {
- ok = 1;
- } else {
- /* ERROR: Failed to set line width */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 32);
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
}
- } else {
- /* Syntax error, negative number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 31);
- }
- } else {
- /* Syntax error, not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- }
- } else {
- /* Syntax error, missing line width */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_lw"
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
}
-/** Process PDF buttcap line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+#if DK4_HAVE_BSEARCH
+
+/** Compare two color definition structures by name.
+ @param l Left structure.
+ @param r Right structure.
+ @return Comparison result.
*/
static
-void
-pldpdftex_process_pdf_buttcap(plpdftex_job_t *job, char *txt)
+int
+compare_named_colors(const void *l, const void *r)
{
- int ok = 0;
- $? "+ pldpdftex_process_pdf_buttcap"
- if (0 != dk3pdf_set_linecap(job->opdf, DK3_LINECAP_BUTT)) {
- ok = 1;
- } else {
- /* ERROR: Failed to set line cap */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 30);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_buttcap"
+ const named_color_t *pl;
+ const named_color_t *pr;
+
+ pl = (const named_color_t *)l;
+ pr = (const named_color_t *)r;
+ return strcmp(pl->name, pr->name);
}
+#endif
-/** Process PDF miterjoin line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+
+
+/** Find color definition for a given name.
+ @param name Color name to search for.
+ @return Pointer to color definition on success, NULL on error (not found).
*/
static
-void
-pldpdftex_process_pdf_miterjoin(plpdftex_job_t *job, char *txt)
+const
+named_color_t *
+find_named_color(const char *name)
{
- int ok = 0;
- $? "+ pldpdftex_process_pdf_miterjoin"
- if (0 != dk3pdf_set_linejoin(job->opdf, DK3_LINEJOIN_MITER)) {
- ok = 1;
- } else {
- /* Failed to set linejoin */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 29);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_miterjoin"
+#if DK4_HAVE_BSEARCH
+ /*
+ Use bsearch() function.
+ */
+ named_color_t testc;
+ const named_color_t *back = NULL;
+ $? "+ find_named_color (bsearch)"
+ testc.name = name;
+ back = bsearch(
+ &testc,
+ named_colors,
+ DK4_SIZEOF(named_colors,named_color_t),
+ sizeof(named_color_t),
+ compare_named_colors
+ ); $? "- find_named_color %d", TR_IPTR(back)
+ return back;
+#else
+ /*
+ No bsearch() available, walk through all the colors.
+ */
+ const named_color_t *back = NULL;
+ const named_color_t *ptr = named_colors;
+ size_t i;
+ $? "+ find_named_color (full search)"
+ for (i = 0; i < DK4_SIZEOF(named_colors,named_color_t); i++) {
+ if (0 == strcmp(ptr->name, name)) {
+ back = ptr;
+ i = DK4_SIZEOF(named_colors,named_color_t);
+ }
+ else {
+ ptr++;
+ i++;
+ }
+ } $? "- find_named_color %d", TR_IPTR(back)
+ return back;
+#endif
}
-/** Process PDF nodash line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Process first input line containing the file name.
*/
static
void
-pldpdftex_process_pdf_nodash(plpdftex_job_t *job, char *txt)
+process_file_name(void)
{
- double d = 0.0;
- int ok = 0;
- $? "+ pldpdftex_process_pdf_nodash"
- if (0 != dk3pdf_set_line_dash(job->opdf, &d, 0, 0.0)) {
- ok = 1;
- } else {
- /* Failed to set dash */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 28);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_nodash"
+ dk4_er_t er; /* Error report for recoding */
+ dkChar *psuff; /* File name suffix */
+ int res; /* Recoding result */
+ $? "+ process_file_name \"%!8s\"", in_buf
+ dk4error_init(&er);
+ res = dk4recode_c8_to_dk(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), dk4app_get_encoding(app),
+ in_buf, inenc, &er
+ );
+ if (0 != res) {
+ psuff = dk4path_get_suffix(fn_buf, NULL);
+ if (NULL != psuff) {
+ res = dk4str_array_index(fn_suffixes, psuff, 0);
+ switch (res) {
+ case 0 : { $? ". tex"
+ st = STATE_DIM;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+ case 1 : { $? ". pgf"
+ st = STATE_DIM;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+ case 2 : { $? ". pdftex"
+ st = STATE_DIM;
+ *psuff = dkT('\0');
+ dk4str_cat_s(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), fn_suffixes[0], NULL
+ );
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+ case 3 : { $? ". pdftexs"
+ st = STATE_DIM;
+ *psuff = dkT('\0');
+ dk4str_cat_s(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), fn_suffixes[0], NULL
+ );
+ graconf.driver = DK4_GRA_DRIVER_PDF;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+ case 4 : { $? ". epstex"
+ st = STATE_DIM;
+ *psuff = dkT('\0');
+ dk4str_cat_s(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), fn_suffixes[0], NULL
+ );
+ graconf.driver = DK4_GRA_DRIVER_EPS;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+#if 0
+ /* 2018-04-17
+ Document not possible for EPS+TeX.
+ */
+ case 5 : { /* epstexs */
+ st = STATE_DIM;
+ dk4str_cpy_s(
+ fn_buf, DK4_SIZEOF(fn_buf,dkChar), fn_suffixes[0], NULL
+ );
+ graconf.driver = DK4_GRA_DRIVER_EPS;
+ graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ dk4gra_conf_setup(
+ &graconf, NULL, 1, DK4_GRA_CONF_SCOPE_FIG2LAT, app
+ );
+ } break;
+#endif
+ default : { $? "! unknown suffix"
+ st = STATE_ERROR;
+ /* ERROR: Illegal suffix */
+ fputs(kw_c8[7], stderr);
+ } break;
+ }
+ }
+ else { $? "! no suffix"
+ st = STATE_ERROR;
+ /* ERROR: No suffix found */
+ fputs(kw_c8[8], stderr);
+ }
+ }
+ else { $? "! recode"
+ st = STATE_ERROR;
+ switch (er.ec) {
+ case DK4_E_BUFFER_TOO_SMALL : { $? "! too long"
+ /* ERROR: File name too long */
+ fputs(kw_c8[9], stderr);
+ } break;
+ case DK4_E_SYNTAX : { $? "! unconvertable chars"
+ /* ERROR: Unconvertable characters */
+ fputs(kw_c8[10], stderr);
+ } break;
+ default : { $? "! other"
+ /* ERROR: Failed to recode file name */
+ fputs(kw_c8[11], stderr);
+ } break;
+ }
+ }
+ $? "- process_file_name, st=%d", st
}
-/** Process PDF stroke color line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Process second input line containing the image dimensions.
*/
static
void
-pldpdftex_process_pdf_stroke_color(plpdftex_job_t *job, char *txt)
+process_file_dimensions(void)
{
- double r = 0.0;
- double g = 0.0;
- double b = 0.0;
- int ok = 0;
- $? "+ pldpdftex_process_pdf_stroke_color"
- if (NULL != txt) {
- if (0 != plptcol_get_color(job, txt, &r, &g, &b)) {
- if (0 != dk3pdf_stroking_rgb(job->opdf, r, g, b)) {
- ok = 1;
- } else {
- /* Failed to set stroke color */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 27);
- }
- } else {
- /* Color not found! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 26);
- }
- } else {
- /* Syntax error, missing text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_stroke_color"
+ dk4_er_t er;
+ char const *ep = NULL;
+ char *p1 = NULL;
+ char *p2 = NULL;
+ size_t width = 0;
+ size_t height = 0;
+ int ok = 0;
+ int dr;
+ int isdoc;
+ int flags;
+ int res;
+ $? "+ process_file_dimensions"
+ p1 = dk4str8_start(in_buf, NULL);
+ if (NULL != p1) {
+ p2 = dk4str8_next(p1, NULL);
+ if (NULL != p2) {
+ res = dk4ma_input_c8_dec_size_t(&width, p1, &ep, 1, NULL);
+ if (0 != res) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_size_t(&height, p2, &ep, 1, NULL);
+ if (0 != res) {
+ ok = 1;
+ }
+#if TRACE_DEBUG
+ else { $? "! not a number (2)"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! not a number (1)"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! no second text"
+ }
+#endif
+ }
+#if TRACE_DEBUG
+ else { $? "! empty text"
+ }
+#endif
+ if (0 != ok) {
+ ok = 0;
+ flags = dk4gra_conf_flags_document(&graconf);
+ flags |= DK4_GRA_PAGE_FLAG_NO_BG;
+ dr = DK4_PPPT_DR_PGF;
+ switch (graconf.driver) {
+ case DK4_GRA_DRIVER_EPS : {
+ dr = DK4_PPPT_DR_EPS_TEX;
+ flags |= DK4_GRA_DOC_FLAG_EPS;
+ } break;
+ case DK4_GRA_DRIVER_PDF : {
+ dr = DK4_PPPT_DR_PDF_TEX;
+ } break;
+ }
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ isdoc = 1;
+ }
+ else {
+ isdoc = 0;
+ }
+ dk4error_init(&er);
+ pppt = dk4pppt_open(
+ fn_buf, dr, isdoc, flags, width, height, &er
+ );
+ if (NULL != pppt) {
+ ok = 1;
+ exval = EXIT_SUCCESS; $? ". exval success"
+ ppptok = 1;
+ st = STATE_CONTENTS;
+ }
+ else { $? "! pppt"
+ st = STATE_ERROR;
+ /* ERROR: Failed to open graphics output structure */
+ fputs(kw_c8[12], stderr);
+ }
+ }
+ if (0 == ok) { $? "! errors"
+ st = STATE_ERROR;
+ }
+ $? "- process_file_dimensions, st=%d ppptok=%d", st, ppptok
}
-/** Process PDF fill color line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+#if 0
+
+/** Push fill and/or stroke color downwards.
*/
static
void
-pldpdftex_process_pdf_fill_color(plpdftex_job_t *job, char *txt)
+push_colors(void)
{
- double r = 0.0;
- double g = 0.0;
- double b = 0.0;
- int ok = 0;
- $? "+ pldpdftex_process_pdf_fill_color"
- if (NULL != txt) {
- if (0 != plptcol_get_color(job, txt, &r, &g, &b)) {
- if (0 != dk3pdf_nonstroking_rgb(job->opdf, r, g, b)) {
- ok = 1;
- } else {
- /* Failed to set stroke color */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 25);
- }
- } else {
- /* Color not found! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- } else {
- /* Syntax error, missing text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_fill_color"
+ if (0 != ncf) {
+ dk4pppt_prepare_fill(pppt, &ppptok, NULL);
+ }
+ if (0 != ncs) {
+ dk4pppt_prepare_stroke(pppt, &ppptok, NULL);
+ }
+ ncf = ncs = 0;
}
+#endif
+
-/** Process PDF rectangle line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Set document font size.
+ @param vptr Text containing the font size value.
*/
static
void
-pldpdftex_process_pdf_rectangle(plpdftex_job_t *job, char *txt)
+set_document_font_size(char *vptr)
{
- char *p1 = NULL;
- char *p2 = NULL;
- char *p3 = NULL;
- double x1 = 0.0;
- double x2 = 0.0;
- double y1 = 0.0;
- double y2 = 0.0;
- int ok = 0;
- $? "+ pldpdftex_process_pdf_rectangle"
- /* Set txt, p1, p2, p3 to x1, y1, x2, y2.
- */
- if (NULL == txt) {
- /* Syntax error, missing text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto cleanup;
- }
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL == p1) {
- /* Syntax error, missing y1 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto cleanup;
- }
- p2 = dk3str_c8_next(p1, NULL);
- if (NULL == p2) {
- /* Syntax error, missing x2 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto cleanup;
- }
- p3 = dk3str_c8_next(p2, NULL);
- if (NULL == p3) {
- /* Syntax error, missing y2 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto cleanup;
- }
-
- /* Read values from strings.
- */
- if (0 == dk3ma_d_from_c8_string(&x1, txt, NULL)) {
- /* Syntax error, x1 not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto cleanup;
- }
- if (0 == dk3ma_d_from_c8_string(&y1, p1, NULL)) {
- /* Syntax error, y1 not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto cleanup;
- }
- if (0 == dk3ma_d_from_c8_string(&x2, p2, NULL)) {
- /* Syntax error, x2 not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto cleanup;
- }
- if (0 == dk3ma_d_from_c8_string(&y2, p3, NULL)) {
- /* Syntax error, y2 not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto cleanup;
- }
-
- /* PDF drawing operations.
- */
- if (0 == dk3pdf_newpath_moveto(job->opdf, x1, y1)) {
- /* ERROR: moveto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 22);
- goto cleanup;
- }
- if (0 == dk3pdf_lineto(job->opdf, x2, y1)) {
- /* ERROR: lineto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
- goto cleanup;
- }
- if (0 == dk3pdf_lineto(job->opdf, x2, y2)) {
- /* ERROR: lineto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
- goto cleanup;
- }
- if (0 == dk3pdf_lineto(job->opdf, x1, y2)) {
- /* ERROR: lineto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
- goto cleanup;
- }
- if (0 == dk3pdf_lineto(job->opdf, x1, y1)) {
- /* ERROR: lineto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 24);
- goto cleanup;
- }
- if (0 == dk3pdf_closepath(job->opdf)) {
- /* ERROR: closepath failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 18);
- goto cleanup;
- }
-
- /* Success.
- */
- ok = 1;
-
- cleanup:
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_rectangle"
+ const char *ep = NULL;
+ double fs = -1.0;
+ $? "+ set_document_font_size"
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ if (NULL != vptr) {
+ if (0 != dk4ma_input_c8_double(&fs, vptr, &ep, 1, NULL)) {
+ if (0.0 < fs) {
+ dk4pppt_doc_font_size(pppt, fs, &ppptok, NULL);
+ }
+ else { $? "! not positive"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[13], lineno);
+ }
+ }
+ else { $? "! not a number"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[14], lineno);
+ }
+ }
+ else { $? "! mising value"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ }
+ $? "- set_document_font_size st=%d ppptok=%d", st, ppptok
}
-/** Segments per quarter circle.
+/** Add one font setup, package setup or general preamble line.
+ @param vptr Setup text.
+ @param lt Line type.
*/
-static size_t const plpt_segments = 2;
+static
+void
+set_preamble_line(char *vptr, int lt)
+{
+ $? "+ set_preamble_line"
+ if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) {
+ if (NULL != vptr) {
+ dk4pppt_doc_preamble_line(pppt, vptr, lt, &ppptok, NULL);
+ }
+ else { $? "! missing value"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ }
+ else { $? ". not in document output mode"
+ /* Ignore for non-document output */
+ }
+ $? "- set_preamble_line st=%d ppptok=%d", st, ppptok
+}
-/** Calculate kappa value to draw a circle.
- @param segments Number of segments for one _quarter_
- of the circle.
- @return Kappa value (factor to apply to first derivative
- when calculating control points).
+/** Split one string into several pieces.
+ @param parts Destination pointer array, points to the pieces found.
+ @param nparts Array size (number of pointers).
+ @param str String to split.
+ @return Number of pieces found.
*/
static
-double
-plpdftex_kappa(size_t segments)
+size_t
+split_text(char **parts, size_t nparts, char *str)
{
- double back = 0.0;
- double alpha;
- $? "+ plpdftex_kappa %u", (unsigned)segments
- alpha = M_PI / (2.0 * (double)segments);
-
- /* kappa = (2*sqrt(8*(1-cos(a)))-4*sin(a)) / (3*a*(1-cos(a))) */
-
- back = (2.0 * sqrt(8.0 * (1.0 - cos(alpha))) - 4.0 * sin(alpha))
- / (3.0 * alpha * (1.0 - cos(alpha)));
- $? "- plpdftex_kappa %lg", back
- return back;
+ size_t back = 0;
+ size_t i;
+ $? "+ split_text %u \"%!8s\"", (unsigned)nparts, TR_8STR(str)
+ if ((NULL != parts) && (NULL != str) && (0 < nparts)) {
+ for (i = 0; i < nparts; i++) { parts[i] = NULL; }
+ parts[0] = dk4str8_start(str, NULL);
+ if (NULL != parts[0]) {
+ back = 1;
+ for (i = 1; i < nparts; i++) {
+ parts[i] = dk4str8_next(parts[i-1], NULL);
+ if (NULL != parts[i]) {
+ back++;
+ }
+ else {
+ i = nparts;
+ }
+ }
+ }
+ }
+ $? "- split_text %u", (unsigned)back
+ return back;
}
-/** Process PDF circle line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Split a text string in pieces and retrieve double numbers.
+ @param pval Address of results array.
+ @param parts Address of text piece pointers array.
+ @param nparts Array size (number of elements in pval and nparts).
+ @param str String to split and extract.
+ @return Number of piece values found.
*/
static
-void
-pldpdftex_process_pdf_circle(plpdftex_job_t *job, char *txt)
+size_t
+split_numbers(double *pval, char **parts, size_t nparts, char *str)
{
- char *p1; /* Text containing y */
- char *p2; /* Text containing radius */
- double x; /* Center x */
- double y; /* Center y */
- double r; /* Radius */
- double x0; /* Current point x */
- double y0; /* Current point y */
- double x1; /* First control point x */
- double y1; /* First control point y */
- double x2; /* Second control point x */
- double y2; /* Second control point y */
- double x3; /* Final point x */
- double y3; /* Final point y */
- double alpha; /* Arc angle. */
- double a1; /* Start angle. */
- double a2; /* End angle. */
- double kappa; /* Kappa value. */
- size_t i; /* Current sub-segment */
- int ok = 0; /* Flag: Success */
- $? "+ pldpdftex_process_pdf_circle"
- /* Find strings
- */
- if (NULL == txt) {
- /* Syntax error, no data */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL == p1) {
- /* Syntax error, missing y */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p2 = dk3str_c8_next(p1, NULL);
- if (NULL == p2) {
- /* Syntax error, missing r */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
-
- /* Retrieve values from strings.
- */
- if (0 == dk3ma_d_from_c8_string(&x, txt, NULL)) {
- /* Syntax error, not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y, txt, NULL)) {
- /* Syntax error, not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&r, txt, NULL)) {
- /* Syntax error, not a number */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0.0 > r) {
- /* ERROR: Negative radius */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 23);
- goto finished;
- }
- if (0 == dk3pdf_newpath_moveto(job->opdf, x+r, y)) {
- goto finished;
- }
- kappa = plpdftex_kappa(plpt_segments);
- alpha = 2.0 * M_PI / ((double)(4 * plpt_segments));
- ok = 1;
- for (i = 0; i < (4 * plpt_segments); i++) {
- a1 = (double)i * alpha;
- a2 = a1 + alpha;
- if (0 == i) a1 = 0.0;
- if ((4 * plpt_segments - 1) == i) a2 = 2.0 * M_PI;
- x0 = r * cos(a1); y0 = r * sin(a1);
- if (0 == i) { x0 = r; y0 = 0.0; }
- x3 = r * cos(a2); y3 = r * sin(a2);
- if ((4 * plpt_segments - 1) == i) { x3 = r; y3 = 0.0; }
- x1 = -1.0 * r * alpha * sin(a1);
- y1 = r * alpha * cos(a1);
- x2 = -1.0 * r * alpha * sin(a2);
- y2 = r * alpha * cos(a2);
- x1 = x1 * kappa;
- y1 = y1 * kappa;
- x2 = -1.0 * kappa * x2;
- y2 = -1.0 * kappa * y2;
- x1 += x0;
- y1 += y0;
- x2 += x3;
- y2 += y3;
-#if VERSION_BEFORE_20150821
- x0 += x;
+ char const *ep = NULL;
+ size_t back = 0;
+ size_t i;
+ int res;
+ $? "+ split_numbers %u \"%!8s\"", (unsigned)nparts, TR_8STR(str)
+ if ((NULL != pval) && (NULL != parts) && (NULL != str) && (0 < nparts)) {
+ for (i = 0; i < nparts; i++) { pval[i] = 0.0; parts[i] = NULL; }
+#if TRACE_DEBUG
+ back = split_text(parts, nparts, str);
+ if (back != nparts) {
+ $? "! too few pieces %u < %u", (unsigned)back, (unsigned)nparts
+ }
+ nparts = back;
+ back = 0;
+#else
+ nparts = split_text(parts, nparts, str);
#endif
- x1 += x; x2 += x; x3 += x;
-#if VERSION_BEFORE_20150821
- y0 += y;
+ for (i = 0; i < nparts; i++) {
+ ep = NULL;
+ res = dk4ma_input_c8_double(&(pval[i]), parts[i], &ep, 1, NULL);
+ if (0 != res) {
+ back++;
+ }
+ else {
+ $? "! not a number \"%!8s\"", parts[i]
+ i = nparts;
+ }
+ }
+ }
+#if TRACE_DEBUG
+ for (i = 0; i < back; i++) {
+ $? ". value[%u] = %lg", (unsigned)i, pval[i]
+ }
#endif
- y1 += y; y2 += y; y3 += y;
- if (0 == dk3pdf_curveto(job->opdf, x1, y1, x2, y2, x3, y3)) {
- ok = 0;
- goto finished;
- }
- }
- if (0 == dk3pdf_closepath(job->opdf)) {
- ok = 0;
- }
-
- /* Return
- */
- finished:
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_circle"
+ $? "- split_numbers %u", (unsigned)back
+ return back;
}
-/** Process PDF moveto line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Construct color specification LaTeX instruction in cs_buf.
+ @param cspec Contents of the color specification.
+ @return 1 on success, 0 on error (buffer too small).
*/
static
-void
-pldpdftex_process_pdf_moveto(plpdftex_job_t *job, char *txt)
+int
+construct_color_spec(char const *cspec)
{
- char *p1;
- double x;
- double y;
- int ok = 0;
- $? "+ pldpdftex_process_pdf_moveto"
- if (NULL != txt) {
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL != p1) {
- if (0 != dk3ma_d_from_c8_string(&x, txt, NULL)) {
- if (0 != dk3ma_d_from_c8_string(&y, p1, NULL)) {
- if (0 != dk3pdf_newpath_moveto(job->opdf, x, y)) {
- ok = 1;
- } else {
- /* ERROR, moveto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 22);
- }
- } else {
- /* ERROR, y not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
+ size_t szcsb = sizeof(cs_buf);
+ int back = 0;
+ if (0 != dk4str8_cpy_s(cs_buf, szcsb, kw_c8[3], NULL)) {
+ if (0 != dk4str8_cat_s(cs_buf, szcsb, cspec, NULL)) {
+ if (0 != dk4str8_cat_s(cs_buf, szcsb, kw_c8[4], NULL)) {
+ back = 1;
+ }
+ }
}
- } else {
- /* ERROR, x not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- }
- } else {
- /* Syntax error, missing y value */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- } else {
- /* Syntax error, no coordinates */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_moveto"
+ return back;
}
-/** Process PDF lineto line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Typeset text.
+ @param vptr Line containing text label description.
+ @param box Flag: Use white box and oval box.
*/
static
void
-pldpdftex_process_pdf_lineto(plpdftex_job_t *job, char *txt)
+typeset_text(char *vptr, int box)
{
- char *p1;
- double x;
- double y;
- int ok = 0;
- $? "+ pldpdftex_process_pdf_lineto"
- if (NULL != txt) {
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL != p1) {
- if (0 != dk3ma_d_from_c8_string(&x, txt, NULL)) {
- if (0 != dk3ma_d_from_c8_string(&y, p1, NULL)) {
- if (0 != dk3pdf_lineto(job->opdf, x, y)) {
- ok = 1;
- } else {
- /* ERROR, moveto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 22);
- }
- } else {
- /* ERROR, y not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
+ char *parts[6];
+ char const *ep;
+ size_t nparts;
+ double xpos;
+ double ypos;
+ dk4_text_align_h_t ah = DK4_TEXT_ALIGN_H_CENTERED;
+ dk4_text_align_v_t av = DK4_TEXT_ALIGN_V_CENTERED;
+ int ok = 0;
+ int res = 0;
+ int textfl = 0;
+ int hcs = 0;
+ $? "+ typeset_text"
+ if (0 != box) {
+ textfl = (DK4_GRA_TEXT_FLAG_WHITE_BOX | DK4_GRA_TEXT_FLAG_OVAL_BOX);
+ }
+ if (NULL != vptr) {
+ nparts = split_text(parts, 6, vptr);
+ if (6 == nparts) {
+ ep = NULL;
+ hcs = construct_color_spec(parts[4]);
+ res = dk4ma_input_c8_double(&xpos, parts[0], &ep, 1, NULL);
+ if (0 != res) {
+ ep = NULL;
+ res = dk4ma_input_c8_double(&ypos, parts[1], &ep, 1, NULL);
+ if (0 != res) {
+ $? ". v align %s", parts[2]
+ res = dk4str8_array_index(v_align_names, parts[2], 0);
+ if (-1 < res) {
+ switch (res) {
+ case 3 : {
+ av = DK4_TEXT_ALIGN_V_BASELINE;
+ } break;
+ case 2 : {
+ av = DK4_TEXT_ALIGN_V_BOTTOM;
+ } break;
+ case 1 : {
+ av = DK4_TEXT_ALIGN_V_CENTERED;
+ } break;
+ default : {
+ av = DK4_TEXT_ALIGN_V_TOP;
+ } break;
+ }
+ $? ". h alignment %s", parts[3]
+ res = dk4str8_array_index(h_align_names, parts[3], 0);
+ if (-1 < res) {
+ switch (res) {
+ case 2 : {
+ ah = DK4_TEXT_ALIGN_H_RIGHT;
+ } break;
+ case 1 : {
+ ah = DK4_TEXT_ALIGN_H_CENTERED;
+ } break;
+ default : {
+ ah = DK4_TEXT_ALIGN_H_LEFT;
+ } break;
+ }
+ ok = 1;
+ dk4pppt_special_text(
+ pppt, xpos, ypos, 0.0, parts[5],
+ ((0 != hcs) ? (cs_buf) : (NULL)),
+ ah, av, 0, 12.0, 0, textfl, &ppptok, NULL
+ );
+ }
+ else { $? "! h alignment"
+ /* ERROR: Syntax (h alignment) */
+ fprintf(stderr, kw_c8[17], lineno);
+ }
+ }
+ else { $? "! v alignment"
+ /* ERROR: Syntax (v alignment) */
+ fprintf(stderr, kw_c8[18], lineno);
+ }
+ }
+ else { $? "! ypos"
+ /* ERROR: Syntax (not a number) */
+ fprintf(stderr, kw_c8[19], lineno);
+ }
+ }
+ else { $? "! xpos"
+ /* ERROR: Syntax (not a number) */
+ fprintf(stderr, kw_c8[19], lineno);
+ }
+ }
+ else { $? "! too few values"
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else { $? "! missing value"
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
}
- } else {
- /* ERROR, x not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- }
- } else {
- /* Syntax error, missing y value */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- } else {
- /* Syntax error, no coordinates */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_lineto"
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- typeset_text st=%d ppptok=%d", st, ppptok
}
-/** Process PDF curveto line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Set line width.
+ @param vptr Line containing text size in pt.
*/
static
void
-pldpdftex_process_pdf_curveto(plpdftex_job_t *job, char *txt)
+set_line_width(char *vptr)
{
- char *p1; /* y1 */
- char *p2; /* x2 */
- char *p3; /* y2 */
- char *p4; /* x3 */
- char *p5; /* y3 */
- double x1;
- double y1;
- double x2;
- double y2;
- double x3;
- double y3;
- int ok = 0;
- $? "+ pldpdftex_process_pdf_curveto"
- /* Split string.
- */
- if (NULL == txt) {
- /* ERROR: No text */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p1 = dk3str_c8_next(txt, NULL);
- if (NULL == p1) {
- /* ERROR: No y1 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p2 = dk3str_c8_next(p1, NULL);
- if (NULL == p2) {
- /* ERROR: No x2 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p3 = dk3str_c8_next(p2, NULL);
- if (NULL == p3) {
- /* ERROR: No y2 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p4 = dk3str_c8_next(p3, NULL);
- if (NULL == p4) {
- /* ERROR: No x3 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
- p5 = dk3str_c8_next(p4, NULL);
- if (NULL == p5) {
- /* ERROR: No y3 */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 21);
- goto finished;
- }
-
- /* Retrieve values.
- */
- if (0 == dk3ma_d_from_c8_string(&x1, txt, NULL)) {
- /* ERROR: x1 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y1, p1, NULL)) {
- /* ERROR: y1 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&x2, p2, NULL)) {
- /* ERROR: x2 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y2, p3, NULL)) {
- /* ERROR: y2 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&x3, p4, NULL)) {
- /* ERROR: x3 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
- if (0 == dk3ma_d_from_c8_string(&y3, p5, NULL)) {
- /* ERROR: y3 not numeric */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 20);
- goto finished;
- }
-
- /* Write curve segment.
- */
- if (0 != dk3pdf_curveto(job->opdf, x1, y1, x2, y2, x3, y3)) {
- ok = 1;
- } else {
- /* ERROR: curveto failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 19);
- }
-
- /* Return.
- */
- finished:
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_curveto"
+ char const *ep = NULL;
+ char *p1;
+ double lw = 0.9;
+ int ok = 0;
+ int res;
+
+ $? "+ set_line_width"
+ if (NULL != vptr) {
+ p1 = dk4str8_start(vptr, NULL);
+ if (NULL != p1) {
+ res = dk4ma_input_c8_double(&lw, p1, &ep, 1, NULL);
+ if (0 != res) {
+ if (0.0 < lw) {
+ ok = 1;
+ dk4pppt_set_line_width(pppt, lw, &ppptok, NULL);
+#if 0
+ dk4pppt_prepare_stroke(pppt, &ppptok, NULL);
+#endif
+ }
+ else { $? "! not positive"
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[20], lineno);
+ }
+ }
+ else { $? "! not a number"
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[19], lineno);
+ }
+ }
+ else { $? "! empty text"
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ }
+ else { $? "! missing value"
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- set_line_width st=%d ppptok=%d", st, ppptok
}
-/** Process PDF closepath line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Find RGB values for color string.
+ @param pnc Destination color value.
+ @param str String containing color information.
+ @return 1 on success, 0 on error.
*/
static
-void
-pldpdftex_process_pdf_closepath(plpdftex_job_t *job, char *txt)
+int
+find_color_value(named_color_t *pnc, char *str)
{
- int ok = 0;
- $? "+ pldpdftex_process_pdf_closepath"
- if (0 != dk3pdf_closepath(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: closepath failed */
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_closepath"
+ named_color_t value;
+ named_color_t bg;
+ named_color_t const *pcol;
+ char const *pe = NULL;
+ char *pc = NULL;
+ char *pn = NULL;
+ char *p1 = NULL;
+ double alpha = 0.0;
+ int back = 0;
+ int res = 0;
+ $? "+ find_color_value \"%!8s\"", TR_8STR(str)
+ pc = dk4str8_start(str, NULL);
+ if (NULL != pc) {
+ pn = dk4str8_chr(pc, '!');
+ if (NULL != pn) { *(pn++) = '\0'; pn = dk4str8_start(pn, NULL); }
+ pcol = find_named_color(pc);
+ if (NULL != pcol) {
+ DK4_MEMCPY(&value,pcol,sizeof(named_color_t));
+ back = 1;
+ pc = pn;
+ while (NULL != pc) {
+ pn = NULL;
+ bg.r = bg.g = bg.b = 1.0;
+ p1 = dk4str8_chr(pc, '!');
+ if (NULL != p1) {
+ *(p1++) = '\0'; p1 = dk4str8_start(p1, NULL);
+ if (NULL != p1) {
+ pn = dk4str8_chr(p1, '!');
+ if (NULL != pn) {
+ *(pn++) = '\0'; pn = dk4str8_start(pn, NULL);
+ }
+ pcol = find_named_color(p1);
+ if (NULL != pcol) {
+ bg.r = pcol->r;
+ bg.g = pcol->g;
+ bg.b = pcol->b;
+ }
+ else {
+ /* ERROR: Syntax (color not found) */
+ fprintf(stderr, kw_c8[21], lineno, p1);
+ back = 0;
+ pn = NULL;
+ }
+ }
+ }
+ if (0 != back) {
+ pe = NULL;
+ res = dk4ma_input_c8_double(&alpha, pc, &pe, 1, NULL);
+ if (0 != res) {
+ if ((0.0 <= alpha) && (100.0 >= alpha)) {
+ alpha = alpha / 100.0;
+ value.r = value.r * alpha + bg.r * (1.0 - alpha);
+ value.g = value.g * alpha + bg.g * (1.0 - alpha);
+ value.b = value.b * alpha + bg.b * (1.0 - alpha);
+ }
+ else {
+ /* ERROR: Syntax (out of range) */
+ fprintf(stderr, kw_c8[22], lineno, pc);
+ back = 0;
+ pn = NULL;
+ }
+ }
+ else {
+ /* ERROR: Syntax (not a number) */
+ fprintf(stderr, kw_c8[19], lineno);
+ back = 0;
+ pn = NULL;
+ }
+ }
+ pc = pn;
+ }
+ if (0 != back) {
+ pnc->r = value.r;
+ pnc->g = value.g;
+ pnc->b = value.b;
+ }
+ }
+ else { $? "! color not found"
+ /* ERROR: Syntax (color name not found) */
+ fprintf(stderr, kw_c8[21], lineno, pc);
+ }
+ }
+ else { $? "! empty string"
+ /* ERROR: Syntax (empty color string) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ $? "- find_color_value %d", back
+ return back;
}
-/** Process PDF stroke line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Set stroke color.
+ @param vptr Line containing color description.
*/
static
void
-pldpdftex_process_pdf_stroke(plpdftex_job_t *job, char *txt)
+set_stroke_color(char *vptr)
{
- int ok = 0;
- $? "+ pldpdftex_process_pdf_stroke"
- if (0 != dk3pdf_stroke(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: stroke failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 17);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_stroke"
+ named_color_t value;
+ int ok = 0;
+ $? "+ set_stroke_color"
+ if (NULL != vptr) {
+ if (0 != find_color_value(&value, vptr)) {
+ ok = 1;
+ dk4pppt_set_stroke_rgb(
+ pppt, value.r, value.g, value.b, &ppptok, NULL
+ );
+#if 0
+ dk4pppt_prepare_stroke(pppt, &ppptok, NULL);
+#endif
+ }
+ }
+ else { $? "! missing value"
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- set_stroke_color st=%d ppptok=%d", st, ppptok
}
-/** Process PDF fill line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Set fill color (non-stroking color).
+ @param vptr Line containing color information.
*/
static
void
-pldpdftex_process_pdf_fill(plpdftex_job_t *job, char *txt)
+set_fill_color(char *vptr)
{
- int ok = 0;
- $? "+ pldpdftex_process_pdf_fill"
- if (0 != dk3pdf_fill_eo(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: Fill failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 16);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_fill"
+ named_color_t value;
+ int ok = 0;
+ $? "+ set_fill_color"
+ if (NULL != vptr) {
+ if (0 != find_color_value(&value, vptr)) {
+ ok = 1;
+ dk4pppt_set_fill_rgb(
+ pppt, value.r, value.g, value.b, &ppptok, NULL
+ );
+#if 0
+ dk4pppt_prepare_fill(pppt, &ppptok, NULL);
+#endif
+ }
+ }
+ else { $? "! value"
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- set_fill_color st=%d ppptok=%d", st, ppptok
}
-/** Process PDF clip line.
- @param job Job structure.
- @param txt Text to process, may be NULL.
+/** Create rectangle path.
+ @param vptr Line containing rectangle data.
*/
static
void
-pldpdftex_process_pdf_clip(plpdftex_job_t *job, char *txt)
+draw_rectangle(char *vptr)
{
- int ok = 0;
- $? "+ pldpdftex_process_pdf_clip"
- if (0 != dk3pdf_clip_eo(job->opdf)) {
- ok = 1;
- } else {
- /* ERROR: clip failed */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 15);
- }
- if(0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- pldpdftex_process_pdf_clip"
+ double coord[4];
+ char *parts[4];
+ size_t nparts;
+ int ok = 0;
+ $? "+ draw_rectangle"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 4, vptr);
+ if (4 == nparts) {
+ ok = 1;
+ dk4pppt_rectangle(
+ pppt, coord[0], coord[2], coord[1], coord[3],
+ -1.0, NULL, &ppptok, NULL
+ );
+ }
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- draw_rectangle st=%d ppptok=%d", st, ppptok
}
-/** Process a PDF line.
- @param job Job structure.
- @param txt Text to process.
+/** Create circle path.
+ @param vptr Line containing circle data.
*/
static
void
-plpdftex_process_pdf_line(plpdftex_job_t *job, char *txt)
+draw_circle(char *vptr)
{
- char *firstarg;
- $? "+ plpdftex_process_pdf_line"
- firstarg = dk3str_c8_next(txt, NULL);
- switch(dk3str_c8_array_index(plpdftex_pdf_instructions, txt, 0)) {
- case 0: {
- pldpdftex_process_pdf_gsave(job, firstarg);
- } break;
- case 1: {
- pldpdftex_process_pdf_grestore(job, firstarg);
- } break;
- case 2: {
- pldpdftex_process_pdf_lw(job, firstarg);
- } break;
- case 3: {
- pldpdftex_process_pdf_buttcap(job, firstarg);
- } break;
- case 4: {
- pldpdftex_process_pdf_miterjoin(job, firstarg);
- } break;
- case 5: {
- pldpdftex_process_pdf_nodash(job, firstarg);
- } break;
- case 6: {
- pldpdftex_process_pdf_stroke_color(job, firstarg);
- } break;
- case 7: {
- pldpdftex_process_pdf_fill_color(job, firstarg);
- } break;
- case 8: {
- pldpdftex_process_pdf_rectangle(job, firstarg);
- } break;
- case 9: {
- pldpdftex_process_pdf_circle(job, firstarg);
- } break;
- case 10: {
- pldpdftex_process_pdf_moveto(job, firstarg);
- } break;
- case 11: {
- pldpdftex_process_pdf_lineto(job, firstarg);
- } break;
- case 12: {
- pldpdftex_process_pdf_curveto(job, firstarg);
- } break;
- case 13: {
- pldpdftex_process_pdf_closepath(job, firstarg);
- } break;
- case 14: {
- pldpdftex_process_pdf_stroke(job, firstarg);
- } break;
- case 15: {
- pldpdftex_process_pdf_fill(job, firstarg);
- } break;
- case 16: {
- pldpdftex_process_pdf_clip(job, firstarg);
- } break;
- } $? "- plpdftex_process_pdf_line"
+ double coord[3];
+ char *parts[3];
+ size_t nparts;
+ int ok = 0;
+ $? "+ draw_circle"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 3, vptr);
+ if (3 == nparts) {
+ ok = 1;
+ dk4pppt_circle(
+ pppt, coord[0], coord[1], coord[2], NULL, &ppptok, NULL
+ );
+ }
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- draw_circle st=%d ppptok=%d", st, ppptok
}
-/** Process one input line stored into ilbuf by plpdftex_run_for_input().
- @param job Job structure.
+/** Perform moveto operation.
+ @param vptr Line containing coordinates.
*/
static
void
-plpdftex_process_line(plpdftex_job_t *job)
+operation_moveto(char *vptr)
{
- char *p1;
- $? "+ plpdftex_process_line"
- p1 = dk3str_c8_start(job->ilbuf, NULL);
- if (NULL != p1) {
- dk3str_c8_chomp(p1, NULL); $? ". input line \"%!8s\"", p1
- switch(*p1) {
- case 't': {
- p1 = dk3str_c8_start(++p1, NULL);
- if (NULL != p1) {
- plpdftex_process_tex_line(job, p1);
- } else {
- /* Syntax error */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 14);
- job->exc = 1; $? ". exc 1"
+ double coord[2];
+ char *parts[2];
+ size_t nparts;
+ int ok = 0;
+ $? "+ operation_moveto"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 2, vptr);
+ if (2 == nparts) {
+ ok = 1;
+ dk4pppt_newpath_moveto(
+ pppt, coord[0], coord[1], NULL, &ppptok, NULL
+ );
+ }
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
}
- } break;
- case 'p': {
- p1 = dk3str_c8_start(++p1, NULL);
- if (NULL != p1) {
- plpdftex_process_pdf_line(job, p1);
- } else {
- /* Syntax error */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 14);
- job->exc = 1; $? ". exc 1"
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
}
- } break;
- case '#': { $? ". comment, ignore"
- } break;
- default: {
- /* Syntax error */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 13);
- job->exc = 1; $? ". exc 1"
- } break;
- }
- } $? "- plpdftex_process_line"
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- operation_moveto st=%d ppptok=%d", st, ppptok
}
-/** Process the normal input lines.
- @param job Job structure.
+/** Perform lineto operation.
+ @param vptr Line containing coordinates.
*/
static
void
-plpdftex_run_for_input(plpdftex_job_t *job)
+operation_lineto(char *vptr)
{
- int ok = 0;
- $? "+ plpdftex_run_for_input"
- while (NULL != fgets(job->ilbuf, (int)(job->szilb), job->infi)) {
- plpdftex_process_line(job);
- }
- if (0 != job->stagr) {
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET: {
- ok = 1;
- /* documentclass{article} */
- plpdftex_write_textline(job, plpdftex_c8_kw[2]);
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_DOCUMENT_CLASS: {
- ok = 1;
- plpdftex_write_default_font_setup(job);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_USER_FONT_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[4]);
- plpdftex_write_default_packages(job);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_USER_PACKAGES: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[6]);
- plpdftex_write_required_packages(job);
- plpdftex_write_textline(job, plpdftex_c8_kw[9]);
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_USER_SETUP: {
- ok = 1;
- plpdftex_write_textline(job, plpdftex_c8_kw[10]);
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_IN_DOCUMENT: {
- ok = 1;
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_AFTER_DOCUMENT: {
- ok = 1;
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
- goto finished;
- } break;
- }
- } else {
- switch (job->state) {
- case PLPT_STATE_NO_OUTPUT_YET:
- case PLPT_STATE_DOCUMENT_CLASS:
- case PLPT_STATE_USER_FONT_SETUP:
- case PLPT_STATE_USER_PACKAGES:
- case PLPT_STATE_USER_SETUP: {
- plpdftex_open_picture_set(job);
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_IN_DOCUMENT: {
- ok = 1;
- plpdftex_close_picture_set(job);
- job->state = PLPT_STATE_AFTER_DOCUMENT;
- } break;
- case PLPT_STATE_AFTER_DOCUMENT: {
- ok = 1;
- } break;
- default: {
- /* ERROR: Too late */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 12);
- goto finished;
- } break;
- }
- }
-
- finished:
- if (0 == ok) {
- job->exc = 1; $? ". exc 1"
- } $? "- plpdftex_run_for_input"
+ double coord[2];
+ char *parts[2];
+ size_t nparts;
+ int ok = 0;
+ $? "+ operation_lineto"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 2, vptr);
+ if (2 == nparts) {
+ ok = 1;
+ dk4pppt_lineto(
+ pppt, coord[0], coord[1], NULL, &ppptok, NULL
+ );
+ }
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
+ }
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- operation_lineto st=%d ppptok=%d", st, ppptok
}
-/** Open PDF and TeX output file, create output structures
- and process all input.
- @param job Job structure.
+/** Perform curveto operation.
+ @param vptr Line containing coordinates.
*/
static
void
-plpdftex_run_with_output_filenames(plpdftex_job_t *job)
+operation_curveto(char *vptr)
{
- unsigned long w;
- unsigned long h;
- $? "+ plpdftex_run_with_output_filenames"
- if (fgets(job->ilbuf, (int)(job->szilb), job->infi)) {
- if (sscanf(job->ilbuf, "%lu %lu", &w, &h) == 2) {
- job->imgw = w; job->imgh = h;
- if (((unsigned long)DK3_L_MAX >= w) && ((unsigned long)DK3_L_MAX >= h)) {
- job->fotex = dk3sf_c8_fopen_app(job->fntex, "w", job->app);
- if (NULL != job->fotex) {
- job->fopdf = dk3sf_c8_fopen_app(job->fnpdf, "wb", job->app);
- if (NULL != job->fopdf) {
- job->opdf = dk3pdf_open_app(job->app);
- if (NULL != job->opdf) {
- dk3pdf_set_next_mediabox(job->opdf, 0L, (long)w, 0L, (long)h);
- if (0 != dk3pdf_open_page_with_clip(job->opdf, 1)) {
- job->exc = 0; $? ". exc 0"
- plpdftex_run_for_input(job);
- if (0 == dk3pdf_close_page(job->opdf)) {
- job->exc = 1; $? ". exc 1"
- /* ERROR: Failed to close PDF page */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 11);
+ double coord[6];
+ char *parts[6];
+ size_t nparts;
+ int ok = 0;
+ $? "+ operation_curveto"
+ if (NULL != vptr) {
+ nparts = split_numbers(coord, parts, 6, vptr);
+ if (6 == nparts) {
+ ok = 1;
+ dk4pppt_curveto(
+ pppt,
+ coord[0], coord[1], coord[2], coord[3], coord[4], coord[5],
+ NULL, &ppptok, NULL
+ );
}
- } else {
- /* ERROR: Failed to open a PDF page */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 10);
- }
- if (0 == dk3pdf_write_file(job->opdf, job->fopdf)) {
- job->exc = 1; $? ". exc 1"
- /* ERROR: Failed to write PDF to file! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 9);
- }
- dk3pdf_close(job->opdf); job->opdf = NULL;
- } else {
- /* Failed to open PDF output structure */
- }
- if (0 == dk3sf_fclose_app(job->fopdf, job->app)) {
- job->exc = 1; $? ". exc 1"
- }
- job->fopdf = NULL;
- } else {
- /* Failed to open PDF output file */
- }
- if (0 == dk3sf_fclose_app(job->fotex, job->app)) {
- job->exc = 1; $? ". exc 1"
- }
- job->fotex = NULL;
- } else {
- /* Failed to open TeX output file */
+ else {
+ /* ERROR: Syntax (too few values) */
+ fprintf(stderr, kw_c8[16], lineno);
+ }
+ }
+ else {
+ /* ERROR: Syntax (missing value) */
+ fprintf(stderr, kw_c8[15], lineno);
}
- } else {
- /* Overflow, w or h too large! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 8);
- }
- } else {
- /* ERROR: No w h */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 7);
- }
- } else {
- /* ERROR: Missing w h line */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 6);
- } $? "- plpdftex_run_with_output_filenames"
+ if (0 == ok) { ppptok = 0; st = STATE_ERROR; }
+ $? "- operation_curveto st=%d ppptok=%d", st, ppptok
}
-/** Process input from file or stdin.
- @param job Job structure.
+/** Process one contents line.
*/
static
void
-plpdftex_process_input(plpdftex_job_t *job)
+process_contents_line(void)
{
- char *p1;
- $? "+ plpdftex_process_input"
- if (fgets(job->ilbuf, (int)(job->szilb), job->infi)) {
- p1 = dk3str_c8_start(job->ilbuf, NULL);
- if (p1) {
- dk3str_c8_chomp(job->ilbuf, NULL);
- if (dk3str_c8_len(job->ilbuf) < job->szfn) {
- dk3str_c8_cpy(job->fnb1, job->ilbuf);
- dk3str_c8_cpy(job->fnpdf, job->ilbuf);
- p1 = dk3str_c8_get_suffix(job->fnpdf);
- if (p1) { *p1 = '\0'; }
- dk3str_c8_cpy(job->fntex, job->fnpdf);
- if (
- (dk3str_c8_len(job->fnpdf)+dk3str_c8_len(plpdftex_c8_kw[0]))
- < job->szfn
- )
- {
- dk3str_c8_cat(job->fnpdf, plpdftex_c8_kw[0]);
- dk3str_c8_cat(job->fntex, plpdftex_c8_kw[1]);
- p1 = dk3str_c8_get_suffix(job->fnb1);
- if (p1) {
- p1++;
- switch (dk3str_c8_array_index(pldftex_output_file_suffixes,p1,0)) {
- case 0: {
- /* pdf + tex for inclusion */
- plpdftex_run_with_output_filenames(job);
- } break;
- case 1: {
- /* standalone pdf + tex */
- job->stagr = 1;
- plpdftex_run_with_output_filenames(job);
- } break;
- default: {
- /* ERROR: Invalid file name */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 5);
- } break;
- }
- }
- } else {
- /* ERROR: File name too long! */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 4);
+ char *p1 = NULL;
+ char *p2 = NULL;
+ char *p3 = NULL;
+ $? "+ process_contents_line"
+ p1 = dk4str8_start(in_buf, NULL);
+ if (NULL != p1) {
+ p2 = dk4str8_next(p1, NULL);
+ if (NULL != p2) { $? ". cmd = %s %s", p1, p2
+ p3 = dk4str8_next(p2, NULL);
+ switch ( dk4str8_array_index(cmd1, p1, 0) ) {
+ case 0 : {
+ switch ( dk4str8_array_index(cmd2t, p2, 0) ) {
+ case 0 : { /* fs */
+ set_document_font_size(p3);
+ } break;
+ case 1 : { /* font-setup */
+ set_preamble_line(p3, DK4_GRA_PREAMBLE_FONT);
+ } break;
+ case 2 : { /* package */
+ set_preamble_line(p3, DK4_GRA_PREAMBLE_PACKAGE);
+ } break;
+ case 3 : { /* preamble */
+ set_preamble_line(p3, DK4_GRA_PREAMBLE_OTHER);
+ } break;
+ case 4 : { /* text */
+ typeset_text(p3, 0);
+ } break;
+ case 5 : { /* text-box */
+ typeset_text(p3, 1);
+ } break;
+ default : { $? "! illegal subcommand"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[23], lineno);
+ } break;
+ }
+ } break;
+ case 1 : {
+ switch ( dk4str8_array_index(cmd2g, p2, 0) ) {
+ case 0 : { /* gsave */
+ dk4pppt_gsave(pppt, &ppptok, NULL);
+ } break;
+ case 1 : { /* grestore */
+ dk4pppt_grestore(pppt, &ppptok, NULL);
+ } break;
+ case 2 : { /* lw */
+ set_line_width(p3);
+ } break;
+ case 3 : { /* buttcap */
+ dk4pppt_set_line_cap(
+ pppt, DK4_GRA_LC_BUTTED, &ppptok, NULL
+ );
+ } break;
+ case 4 : { /* miterjoin */
+ dk4pppt_set_line_join(
+ pppt, DK4_GRA_LJ_MITERED, 20.0, &ppptok, NULL
+ );
+ } break;
+ case 5 : { /* nodash */
+ dk4pppt_set_line_style(
+ pppt, DK4_GRA_LS_SOLID, 0.0, &ppptok, NULL
+ );
+ } break;
+ case 6 : { /* stroke-color */
+ set_stroke_color(p3);
+ } break;
+ case 7 : { /* fill-color */
+ set_fill_color(p3);
+ } break;
+ case 8 : { /* rectangle */
+ draw_rectangle(p3);
+ } break;
+ case 9 : { /* circle */
+ draw_circle(p3);
+ } break;
+ case 10 : { /* moveto */
+ operation_moveto(p3);
+ } break;
+ case 11 : { /* lineto */
+ operation_lineto(p3);
+ } break;
+ case 12 : { /* curveto */
+ operation_curveto(p3);
+ } break;
+ case 13 : { /* closepath */
+ dk4pppt_closepath(pppt, &ppptok, NULL);
+ } break;
+ case 14 : { /* stroke */
+ dk4pppt_stroke(pppt, &ppptok, NULL);
+ } break;
+ case 15 : { /* fill */
+ dk4pppt_fill(pppt, &ppptok, NULL);
+ } break;
+ case 16 : { /* clip */
+ dk4pppt_clip(pppt, &ppptok, NULL);
+ } break;
+ case 17 : { /* prepare-stroke */
+ dk4pppt_prepare_stroke(pppt, &ppptok, NULL);
+ } break;
+ case 18 : { /* prepare-fill */
+ dk4pppt_prepare_fill(pppt, &ppptok, NULL);
+ } break;
+ default : { $? "! illegal subcommand"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[23], lineno);
+ } break;
+ }
+ } break;
+ default : { $? "! illegal command!"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[24], lineno);
+ } break;
+ }
+ }
+ else { $? "! missing subcommand"
+ ppptok = 0;
+ /* ERROR: Syntax */
+ fprintf(stderr, kw_c8[25], lineno);
+ }
+ }
+ else { $? ". empty line ok"
+ /* Empty line is ok */
}
- } else {
- /* ERROR: File name too long in first input line */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 4);
- }
- } else {
- /* ERROR: Syntax error, first line must not be empty */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 3);
- }
- } $? "- plpdftex_process_input"
+ $? "- process_contents_line st=%d ppptok=%d", st, ppptok
}
-/** Process input.
- @param job Job structure.
+/** Process all input lines from standard input.
*/
static
void
-plpdftex_run_processing(plpdftex_job_t *job)
+process_input_from_stdin(void)
{
- dk3_dir_t *fne;
- dkChar const *fnpattern;
- dkChar const *fn;
- dk3_um_t nfiles;
- int numargs;
- $? "+ plpdftex_run_processing"
- numargs = dk3opt_get_num_args(job->opt);
- switch (numargs) {
- case 0: {
- job->infi = stdin;
- plpdftex_process_input(job);
- } break;
- case 1: {
- fnpattern = dk3opt_get_arg(job->opt, 0);
- if (fnpattern) {
- if (dk3sf_must_expand(fnpattern)) {
- fne = dk3dir_fne_open_app(fnpattern, job->app);
- if (fne) {
- nfiles = dk3dir_get_number_of_files(fne);
- if (nfiles) {
- if (DK3_UM_1 == nfiles) {
- if (dk3dir_get_next_file(fne)) {
- fn = dk3dir_get_fullname(fne);
- if (fn) {
- job->infi = dk3sf_fopen_app(fn, dkT("r"), job->app);
- if (job->infi) {
- plpdftex_process_input(job);
- fclose(job->infi); job->infi = NULL;
- }
- } else {
- /* ERROR: Must not happen */
- dk3app_log_i1(job->app, DK3_LL_ERROR, 166);
- }
- } else {
- /* ERROR: Must not happen */
- dk3app_log_i1(job->app, DK3_LL_ERROR, 166);
+ dk4_er_t er;
+ $? "+ process_input_from_stdin"
+ while (1 == cc) {
+ cc = 0;
+ if (0 != sig_can_continue(1)) {
+ /* 2019-10-24 NOTE:
+ MSVC complains about the conversion from size_t to int
+ in the fgets() call below.
+ Ths sz_in_buf value is constant (4096 at this time)
+ and fits into an int.
+ */
+ if (NULL != fgets(in_buf, sz_in_buf, stdin)) {
+ cc = 1;
+ lineno++;
+ dk4str8_delnl(in_buf);
+ $? ". INPUT LINE %s", in_buf
+ switch (st) {
+ case STATE_ERROR : {
+ /* Do nothing */
+ } break;
+ case STATE_START : {
+ process_file_name();
+ } break;
+ case STATE_DIM : {
+ process_file_dimensions();
+ } break;
+ default : {
+ process_contents_line();
+ } break;
+ }
+ }
+ }
+ else {
+ cc = -1;
}
- } else {
- /* ERROR: Too many file names match pattern! */
- dk3app_log_i3(job->app, DK3_LL_ERROR, 168, 169, fnpattern);
- }
- } else {
- /* ERROR: No files match pattern */
- dk3app_log_i3(job->app, DK3_LL_ERROR, 215, 216, fnpattern);
- }
- dk3dir_close(fne);
- }
- } else {
- job->infi = dk3sf_fopen_app(fnpattern, dkT("r"), job->app);
- if (job->infi) {
- plpdftex_process_input(job);
- fclose(job->infi); job->infi = NULL;
- }
}
- } else {
- /* ERROR: Something wrong with options */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 2);
- }
- } break;
- default: {
- /* ERROR: One argument is maximum */
- dk3app_log_1(job->app, DK3_LL_ERROR, job->msg, 1);
- } break;
- } $? "- plpdftex_run_processing"
+ $? ". finished processsing input lines"
+ /*
+ Write output and clean up.
+ */
+ if (NULL != pppt) { $? ". pppt"
+ if ((0 != ppptok) && (STATE_ERROR != st)) { $? ". pppt, st ok"
+ dk4error_init(&er);
+ if (0 == dk4pppt_write_and_close(pppt, &er)) {
+ exval = EXIT_FAILURE; $? "! failed, exval failure"
+ /* ERROR: Failed to write graphics output */
+ fputs(kw_c8[6], stderr);
+ }
+ }
+ else { $? "! pppt or state"
+ dk4pppt_close(pppt);
+ exval = EXIT_FAILURE; $? ". exval failure"
+ }
+ }
+ else { $? "! pppt"
+ exval = EXIT_FAILURE; $? ". exval failure"
+ }
+ $? "- process_input_from_stdin st=%d ppptok=%d exval=%d", st, ppptok, exval
}
-/** Run.
- @param job Job structure.
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
*/
static
void
-plpdftex_run(plpdftex_job_t *job)
+plpdftex_run_with_signal_handlers(void)
{
- int cmd; /* Command to execute */
- $? "+ plpdftex_run"
- job->opt = dk3opt_open_from_app(
- plpdftex_options, sz_plpdftex_options, dkT('\0'), NULL, job->app
- );
- if (job->opt) {
- if (0 == dk3opt_get_error_code(job->opt)) {
- cmd = 0;
- if(dk3opt_is_set(job->opt, dkT('h'))) {
- cmd |= DK3_APP_CMD_HELP;
- }
- if(dk3opt_is_set(job->opt, dkT('v'))) {
- cmd |= DK3_APP_CMD_VERSION;
- }
- if(dk3opt_is_set(job->opt, dkT('l'))) {
- cmd |= DK3_APP_CMD_LICENSE;
- }
- if (cmd) {
- dk3sf_initialize_stdout();
- /* Show version */
- if (cmd & DK3_APP_CMD_VERSION) {
- dk3sf_fputs(plpdftex_version, stdout);
- dk3sf_fputc(dkT('\n'), stdout);
+#ifdef SIGPIPE
+ struct sigaction opipe;
+#endif
+ struct sigaction oint;
+#ifdef SIGPIPE
+ struct sigaction npipe;
+#endif
+ struct sigaction nint;
+ struct sigaction oterm;
+ struct sigaction nterm;
+ int success = 0;
+ $? "+ plpdftex_run_with_signal_handlers (sigaction)"
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ fputs(kw_c8[1], stderr);
+ goto finished;
}
- if (cmd & DK3_APP_CMD_LICENSE) {
- /* Show license */
- dk3sf_fputt(plpdftex_license_text, stdout);
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ fputs(kw_c8[1], stderr);
+ goto finished;
}
- if (cmd & DK3_APP_CMD_HELP) {
- /* Show help */
- dk3app_help(job->app, dkT("plpdftex.txt"), plpdftex_text_help);
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ fputs(kw_c8[1], stderr);
+ goto finished;
}
- job->exc = 0; $? ". exc 0"
- } else {
- /* Run normally */
- plpdftex_run_processing(job);
- }
- }
- } $? "- plpdftex_run"
-}
-
-
+#endif
-/** File name as read from input.
-*/
-static char plpdftex_input_filename[DK3_MAX_PATH];
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_pipe;
+ }
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ fputs(kw_c8[1], stderr);
+ goto restore_old_int;
+ }
+ success = 1;
+ process_input_from_stdin();
-/** PDF output file name.
-*/
-static char plpdftex_pdf_filename[DK3_MAX_PATH];
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+ /* ERROR: Failed to restore old SIGTERM settings */
+ fputs(kw_c8[2], stderr);
+ success = 0;
+ }
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ fputs(kw_c8[2], stderr);
+ success = 0;
+ }
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ fputs(kw_c8[2], stderr);
+ success = 0;
+ }
+#endif
-/** TeX output file name.
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) {
+ exval = EXIT_FAILURE; $? ". exval failure"
+ }
+ $? "- plpdftex_run_with_signal_handlers"
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
*/
-static char plpdftex_tex_filename[DK3_MAX_PATH];
-
-
-
-/** Input line buffer (one line from input file).
+static
+void
+plpdftex_run_with_signal_handlers(plpdftex_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+ $? "+ plpdftex_run_with_signal_handlers (sigset)"
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ process_input_from_stdin();
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+ $? "- plpdftex_run_with_signal_handlers"
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
*/
-static char plpdftex_input_buffer[1024];
+static
+void
+plpdftex_run_with_signal_handlers(void)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+ $? "+ plpdftex_run_with_signal_handlers (signal)"
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ process_input_from_stdin();
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+ $? "- plpdftex_run_with_signal_handlers"
+}
+#else
+/** Set signal handlers and run.
+*/
+static
+void
+plpdftex_run_with_signal_handlers(void)
+{
+ process_input_from_stdin();
+}
+#endif
+#endif
+#endif
-/** Main function, entry point of the program.
+/** Main function.
@param argc Number of command line arguments.
@param argv Command line arguments array.
- @return 0 on success, any other value indicates an error.
+ @return 0 on success, all other values indicate errors.
*/
-DK3_MAIN
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
{
- plpdftex_job_t job; /* Job structure. */
- int check_presence = 0; /* Flag: Just presence check. */
- int exit_code = 1; /* Exit code returned to OS. */
-
- $!trace-init /tmp/plpdftex.deb
- $? "- main"
- if (2 == argc) {
- if (dk3str_cmp(argv[1], plpdftex_check_presence) == 0) {
- check_presence = 1;
- }
- }
- if (check_presence) {
- fputs(plpdftex_protocol, stdout);
- exit_code = 0;
- } else {
- plpdftex_job_init(&job);
- job.fnb1 = plpdftex_input_filename;
- job.fnpdf = plpdftex_pdf_filename;
- job.fntex = plpdftex_tex_filename;
- job.szfn = DK3_MAX_PATH;
- job.ilbuf = plpdftex_input_buffer;
- job.szilb = sizeof(plpdftex_input_buffer);
- job.app = dk3app_open_command(
- argc, (dkChar const * const *)argv, plpdftex_group_name
- );
- if (job.app) {
- job.msg = dk3app_messages(
- job.app, dkT("plpdftex.str"), (dkChar const **)plpdftex_kw
- );
- job.sco = dk3sto_open_app(job.app);
- if (job.sco) {
- job.sico = dk3sto_it_open(job.sco);
- if (job.sico) {
- plpdftex_run(&job);
+ $!trace-init plpdftex.deb
+ $? "+ main"
+ if ((1 < argc) && (0 == dk4str_cmp(argv[1], plpdftex_check_presence))) {
+ exval = EXIT_SUCCESS; $? ". exval successs"
+ fputs(plpdftex_protocol, stdout);
}
- }
- }
- exit_code = job.exc;
- plpdftex_job_cleanup(&job);
- }
- $? "- main %d", exit_code
- $!trace-end
- fflush(stdout);
- exit(exit_code); return exit_code;
+ else {
+ app = dk4app_open_silent(
+ argc, argv, NULL, 0, kw_dk[0], versno, kw_dk[1], help_txt, lic_txt
+ );
+ if (NULL != app) {
+ if (0 != dk4app_can_run_normally(app)) { $? ". normal"
+ dk4gra_conf_init(&graconf);
+ graconf.driver = DK4_GRA_DRIVER_PGF;
+ if (DK4_ENCODING_UTF8 == dk4app_get_stdin_encoding(app)) {
+ inenc = DK4_ENCODING_UTF8;
+ }
+ uc2l = dk4uc2l_open_from_app(app);
+ if (NULL != uc2l) { $? ". with uc2l"
+ plpdftex_run_with_signal_handlers();
+ dk4uc2l_close(uc2l);
+ }
+ else { $? "! no uc2l"
+ /* ERROR: Failed to create LaTeX encoding structure */
+ fputs(kw_c8[5], stderr);
+ }
+ }
+ else { $? ". help version license"
+ dk4app_help_version_license(app);
+ exval = EXIT_SUCCESS; $? ". exval success"
+ }
+ dk4app_close(app);
+ app = NULL;
+ }
+ else { $? "! no app"
+ fputs(kw_c8[0], stderr);
+ }
+ }
+ $? "- main %d", exval
+ $!trace-end
+ exit(exval); return exval;
}
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/plpdftex.h b/support/dktools/plpdftex.h
index f40864297d..e994ede728 100644
--- a/support/dktools/plpdftex.h
+++ b/support/dktools/plpdftex.h
@@ -1,4 +1,9 @@
/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
@@ -6,7 +11,7 @@
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
+Copyright (C) 2014-2018, Dirk Krause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
diff --git a/support/dktools/plpdftex.rc b/support/dktools/plpdftex.rc
index 7566733326..ed3760a1e5 100644
--- a/support/dktools/plpdftex.rc
+++ b/support/dktools/plpdftex.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Output driver for octpgfpl\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Output driver for octpgfpl\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "plpdftex\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/plptcol.c b/support/dktools/plptcol.c
index 8de2e7f3b4..8e19d8161a 100644
--- a/support/dktools/plptcol.c
+++ b/support/dktools/plptcol.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: plptcol.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: plptcol.ctr
*/
/** @file plptcol.c The plptcol module.
diff --git a/support/dktools/plptcol.ctr b/support/dktools/plptcol.ctr
index c923979636..e9d553dac4 100644
--- a/support/dktools/plptcol.ctr
+++ b/support/dktools/plptcol.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2014-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% header
diff --git a/support/dktools/plptcol.h b/support/dktools/plptcol.h
index 871ed37f76..57443ca3ef 100644
--- a/support/dktools/plptcol.h
+++ b/support/dktools/plptcol.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: plptcol.ctr
+Copyright (C) 2014-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2014-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: plptcol.ctr
*/
/** @file plptcol.h Header file for the plptcol module.
diff --git a/support/dktools/printqd.c b/support/dktools/printqd.c
index a2d9562898..cc385eed7e 100644
--- a/support/dktools/printqd.c
+++ b/support/dktools/printqd.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: printqd.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: printqd.ctr
*/
@@ -120,6 +98,13 @@ A print accounting and quota daemon for use with the LPRng print system.
#endif
#endif
+#if DK4_HAVE_SYSEXITS_H
+#ifndef SYSEXITS_H_INCLUDED
+#include <sysexits.h>
+#define SYSEXITS_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4opt.h"
#include "dk4dmt.h"
#include "dk4inst.h"
@@ -140,12 +125,13 @@ A print accounting and quota daemon for use with the LPRng print system.
#include "dk4time08.h"
#include "dk4mkdh8.h"
#include "dk4delfile08.h"
+#include "dk4unused.h"
-#line 319 "printqd.ctr"
+#line 327 "printqd.ctr"
@@ -218,7 +204,7 @@ static const char def_conf_file_name[] = {
/** Default socket file name.
*/
static const char def_sock_file_name[] = {
- DK4_INST_DIR_VAR "/run/printqd/printqd.sock"
+ DK4_INST_DIR_RUNSTATE "/printqd/printqd.sock"
};
@@ -251,7 +237,7 @@ static const char def_log_file_name[] = {
/** PID file name.
*/
static const char pid_file_name[] = {
- DK4_INST_DIR_VAR "/run/printqd/printqd.pid"
+ DK4_INST_DIR_SYSTEMD_RUN "/printqd/printqd.pid"
};
@@ -919,7 +905,7 @@ static const char * const printqd_kw[] = {
NULL
-#line 1013 "printqd.ctr"
+#line 1021 "printqd.ctr"
};
@@ -936,7 +922,7 @@ static const char * const deny_action_names[] = {
NULL
-#line 1024 "printqd.ctr"
+#line 1032 "printqd.ctr"
};
@@ -956,7 +942,7 @@ static const char * const config_section_names[] = {
NULL
-#line 1036 "printqd.ctr"
+#line 1044 "printqd.ctr"
};
@@ -1036,7 +1022,7 @@ static const char * const config_option_names[] = {
NULL
-#line 1101 "printqd.ctr"
+#line 1109 "printqd.ctr"
};
@@ -1083,7 +1069,7 @@ static const char * const pqd_command_names[] = {
NULL
-#line 1122 "printqd.ctr"
+#line 1130 "printqd.ctr"
};
@@ -1103,7 +1089,7 @@ static const char * const control_sub_cmds[] = {
NULL
-#line 1134 "printqd.ctr"
+#line 1142 "printqd.ctr"
};
@@ -1123,7 +1109,7 @@ static const char * const control_arg_names[] = {
NULL
-#line 1146 "printqd.ctr"
+#line 1154 "printqd.ctr"
};
@@ -1152,7 +1138,7 @@ static const char * const log_feature_names[] = {
NULL
-#line 1161 "printqd.ctr"
+#line 1169 "printqd.ctr"
};
@@ -1170,7 +1156,7 @@ static const char * const db_type_names[] = {
NULL
-#line 1171 "printqd.ctr"
+#line 1179 "printqd.ctr"
};
@@ -1179,6 +1165,10 @@ NULL
static pqd_conf_t conf;
+/** Daemon tool function structure.
+*/
+static dk4dmt_t dmt;
+
/** Connections over local socket, stores pqd_l_conn_t.
Not NULL in service (service is not run if allocation fails).
@@ -1380,8 +1370,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -1394,8 +1385,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_hup(int signo)
+sig_handler_hup(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_hup) = 1;
}
#endif
@@ -1407,8 +1399,9 @@ sig_handler_hup(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -1419,8 +1412,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -1452,7 +1446,7 @@ can_continue(int dohup, int dopipe)
int back = 1;
-#line 1451 "printqd.ctr"
+#line 1467 "printqd.ctr"
if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
if (0 != sig_read_atomic(&sig_had_int)) { back = 0; }
#ifdef SIGHUP
@@ -1469,7 +1463,7 @@ can_continue(int dohup, int dopipe)
if (1 > ccouter) { back = 0; }
-#line 1466 "printqd.ctr"
+#line 1482 "printqd.ctr"
return back;
}
@@ -1504,7 +1498,7 @@ log_file_multipart_message(
size_t i;
-#line 1499 "printqd.ctr"
+#line 1515 "printqd.ctr"
if (0 != shtime) {
fputs(printqd_kw[6], fipo);
fputs(timebuf, fipo);
@@ -1530,7 +1524,7 @@ log_file_multipart_message(
fflush(fipo);
-#line 1523 "printqd.ctr"
+#line 1539 "printqd.ctr"
}
@@ -1563,7 +1557,7 @@ log_multipart_message(
int shline = 0;
-#line 1554 "printqd.ctr"
+#line 1570 "printqd.ctr"
/* Check whether to prepend a timestamp line.
*/
dk4time_get(&current);
@@ -1718,7 +1712,7 @@ log_multipart_message(
}
-#line 1707 "printqd.ctr"
+#line 1723 "printqd.ctr"
}
@@ -1736,13 +1730,13 @@ log_1(
const char *msgs[2];
-#line 1723 "printqd.ctr"
+#line 1739 "printqd.ctr"
msgs[0] = printqd_kw[i1];
msgs[1] = NULL;
log_multipart_message(sourcefile, sourceline, sll, error, msgs, 1);
-#line 1727 "printqd.ctr"
+#line 1743 "printqd.ctr"
}
@@ -1762,7 +1756,7 @@ log_3(
const char *msgs[4];
-#line 1745 "printqd.ctr"
+#line 1761 "printqd.ctr"
msgs[0] = printqd_kw[i1];
msgs[1] = s1;
msgs[2] = printqd_kw[i2];
@@ -1770,7 +1764,7 @@ log_3(
log_multipart_message(sourcefile, sourceline, sll, error, msgs, 3);
-#line 1751 "printqd.ctr"
+#line 1767 "printqd.ctr"
}
@@ -1792,7 +1786,7 @@ log_5(
const char *msgs[6];
-#line 1771 "printqd.ctr"
+#line 1787 "printqd.ctr"
msgs[0] = printqd_kw[i1];
msgs[1] = s1;
msgs[2] = printqd_kw[i2];
@@ -1802,7 +1796,7 @@ log_5(
log_multipart_message(sourcefile, sourceline, sll, error, msgs, 5);
-#line 1779 "printqd.ctr"
+#line 1795 "printqd.ctr"
}
@@ -2074,14 +2068,15 @@ dbi_sync(dk4_dbi_t *db, dk4_er_t *erp)
*/
static
int
-compare_pqd_l_conn_t(const void *l, const void *r, int cr)
+compare_pqd_l_conn_t(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
const pqd_l_conn_t *pl;
const pqd_l_conn_t *pr;
int back = 0;
-#line 2056 "printqd.ctr"
+#line 2072 "printqd.ctr"
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (const pqd_l_conn_t *)l;
@@ -2101,7 +2096,7 @@ compare_pqd_l_conn_t(const void *l, const void *r, int cr)
}
-#line 2074 "printqd.ctr"
+#line 2091 "printqd.ctr"
return back;
}
@@ -2115,14 +2110,15 @@ compare_pqd_l_conn_t(const void *l, const void *r, int cr)
*/
static
int
-compare_pqd_n_conn_t(const void *l, const void *r, int cr)
+compare_pqd_n_conn_t(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
const pqd_n_conn_t *pl;
const pqd_n_conn_t *pr;
int back = 0;
-#line 2093 "printqd.ctr"
+#line 2110 "printqd.ctr"
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (const pqd_n_conn_t *)l;
@@ -2142,7 +2138,7 @@ compare_pqd_n_conn_t(const void *l, const void *r, int cr)
}
-#line 2111 "printqd.ctr"
+#line 2129 "printqd.ctr"
return back;
}
@@ -2157,17 +2153,17 @@ limit_delete(pqd_limit_t *ptr)
{
-#line 2124 "printqd.ctr"
+#line 2142 "printqd.ctr"
if (NULL != ptr) {
-#line 2125 "printqd.ctr"
+#line 2143 "printqd.ctr"
dk4mem_release(ptr->name);
ptr->limit = (dk4_um_t)0UL;
dk4mem_free(ptr);
}
-#line 2130 "printqd.ctr"
+#line 2148 "printqd.ctr"
}
@@ -2184,19 +2180,19 @@ limit_new(const char *name, dk4_um_t max)
pqd_limit_t *back = NULL;
-#line 2145 "printqd.ctr"
+#line 2163 "printqd.ctr"
if (NULL != name) {
-#line 2146 "printqd.ctr"
+#line 2164 "printqd.ctr"
back = dk4mem_new(pqd_limit_t,1,NULL);
if (NULL != back) {
-#line 2148 "printqd.ctr"
+#line 2166 "printqd.ctr"
back->limit = max;
back->name = dk4str8_dup(name, NULL);
if (NULL == back->name) {
-#line 2151 "printqd.ctr"
+#line 2169 "printqd.ctr"
limit_delete(back);
back = NULL;
}
@@ -2204,12 +2200,12 @@ limit_new(const char *name, dk4_um_t max)
#if TRACE_DEBUG
else {
-#line 2157 "printqd.ctr"
+#line 2175 "printqd.ctr"
}
#endif
}
-#line 2160 "printqd.ctr"
+#line 2178 "printqd.ctr"
return back;
}
@@ -2229,7 +2225,7 @@ limit_compare(const void *l, const void *r, int cr)
const pqd_limit_t *pr;
-#line 2178 "printqd.ctr"
+#line 2196 "printqd.ctr"
int back = 0;
if (NULL != l) {
if (NULL != r) {
@@ -2260,7 +2256,7 @@ limit_compare(const void *l, const void *r, int cr)
if (NULL != r) { back = -1; }
}
-#line 2207 "printqd.ctr"
+#line 2225 "printqd.ctr"
return back;
}
@@ -2277,7 +2273,7 @@ limit_all_delete(dk4_sto_it_t *it)
-#line 2222 "printqd.ctr"
+#line 2240 "printqd.ctr"
dk4sto_it_reset(it);
do {
ptr = (pqd_limit_t *)dk4sto_it_next(it);
@@ -2288,7 +2284,7 @@ limit_all_delete(dk4_sto_it_t *it)
dk4sto_it_close(it);
-#line 2231 "printqd.ctr"
+#line 2249 "printqd.ctr"
}
@@ -2302,10 +2298,10 @@ class_delete(pqd_class_t *ptr)
{
-#line 2243 "printqd.ctr"
+#line 2261 "printqd.ctr"
if (NULL != ptr) {
-#line 2244 "printqd.ctr"
+#line 2262 "printqd.ctr"
dk4mem_release(ptr->name);
if (NULL != ptr->i_u) {
limit_all_delete(ptr->i_u);
@@ -2326,12 +2322,12 @@ class_delete(pqd_class_t *ptr)
#if TRACE_DEBUG
else {
-#line 2263 "printqd.ctr"
+#line 2281 "printqd.ctr"
}
#endif
-#line 2266 "printqd.ctr"
+#line 2284 "printqd.ctr"
}
@@ -2346,7 +2342,7 @@ class_all_delete(dk4_sto_it_t *it)
pqd_class_t *ptr;
-#line 2279 "printqd.ctr"
+#line 2297 "printqd.ctr"
dk4sto_it_reset(it);
do {
ptr = (pqd_class_t *)dk4sto_it_next(it);
@@ -2357,7 +2353,7 @@ class_all_delete(dk4_sto_it_t *it)
dk4sto_it_close(it);
-#line 2288 "printqd.ctr"
+#line 2306 "printqd.ctr"
}
@@ -2374,10 +2370,10 @@ class_new(const char *n)
int ok = 0;
-#line 2303 "printqd.ctr"
+#line 2321 "printqd.ctr"
if (NULL != n) {
-#line 2304 "printqd.ctr"
+#line 2322 "printqd.ctr"
back = dk4mem_new(pqd_class_t,1,NULL);
if (NULL != back) {
back->s_u = NULL;
@@ -2401,45 +2397,45 @@ class_new(const char *n)
if (NULL != back->i_g) {
ok = 1;
-#line 2326 "printqd.ctr"
+#line 2344 "printqd.ctr"
}
#if TRACE_DEBUG
else {
-#line 2329 "printqd.ctr"
+#line 2347 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2334 "printqd.ctr"
+#line 2352 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2339 "printqd.ctr"
+#line 2357 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2344 "printqd.ctr"
+#line 2362 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2349 "printqd.ctr"
+#line 2367 "printqd.ctr"
}
#endif
if (0 == ok) {
-#line 2352 "printqd.ctr"
+#line 2370 "printqd.ctr"
class_delete(back);
back = NULL;
}
@@ -2447,19 +2443,19 @@ class_new(const char *n)
#if TRACE_DEBUG
else {
-#line 2358 "printqd.ctr"
+#line 2376 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2363 "printqd.ctr"
+#line 2381 "printqd.ctr"
}
#endif
-#line 2366 "printqd.ctr"
+#line 2384 "printqd.ctr"
return back;
}
@@ -2480,7 +2476,7 @@ class_compare(const void *l, const void *r, int cr)
int back = 0;
-#line 2385 "printqd.ctr"
+#line 2403 "printqd.ctr"
if (NULL != l) {
if (NULL != r) {
pl = (const pqd_class_t *)l;
@@ -2510,7 +2506,7 @@ class_compare(const void *l, const void *r, int cr)
if (NULL != r) { back = -1; }
}
-#line 2413 "printqd.ctr"
+#line 2431 "printqd.ctr"
return back;
}
@@ -2525,17 +2521,17 @@ printer_delete(pqd_printer_t *ptr)
{
-#line 2426 "printqd.ctr"
+#line 2444 "printqd.ctr"
if (NULL != ptr) {
-#line 2427 "printqd.ctr"
+#line 2445 "printqd.ctr"
dk4mem_release(ptr->name);
ptr->cl = NULL;
dk4mem_free(ptr);
}
-#line 2432 "printqd.ctr"
+#line 2450 "printqd.ctr"
}
@@ -2551,7 +2547,7 @@ printer_new(const char *n)
pqd_printer_t *back = NULL;
-#line 2446 "printqd.ctr"
+#line 2464 "printqd.ctr"
if (NULL != n) {
back = dk4mem_new(pqd_printer_t,1,NULL);
if (NULL != back) {
@@ -2559,7 +2555,7 @@ printer_new(const char *n)
back->name = dk4str8_dup(n,NULL);
if (NULL == back->name) {
-#line 2452 "printqd.ctr"
+#line 2470 "printqd.ctr"
printer_delete(back);
back = NULL;
}
@@ -2567,19 +2563,19 @@ printer_new(const char *n)
#if TRACE_DEBUG
else {
-#line 2458 "printqd.ctr"
+#line 2476 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2463 "printqd.ctr"
+#line 2481 "printqd.ctr"
}
#endif
-#line 2466 "printqd.ctr"
+#line 2484 "printqd.ctr"
return back;
}
@@ -2600,7 +2596,7 @@ printer_compare(const void *l, const void *r, int cr)
int back = 0;
-#line 2485 "printqd.ctr"
+#line 2503 "printqd.ctr"
if (NULL != l) {
if (NULL != r) {
pl = (const pqd_printer_t *)l;
@@ -2630,7 +2626,7 @@ printer_compare(const void *l, const void *r, int cr)
if (NULL != r) { back = -1; }
}
-#line 2513 "printqd.ctr"
+#line 2531 "printqd.ctr"
return back;
}
@@ -2646,7 +2642,7 @@ printer_all_delete(dk4_sto_it_t *it)
pqd_printer_t *ptr;
-#line 2527 "printqd.ctr"
+#line 2545 "printqd.ctr"
dk4sto_it_reset(it);
do {
ptr = (pqd_printer_t *)dk4sto_it_next(it);
@@ -2657,7 +2653,7 @@ printer_all_delete(dk4_sto_it_t *it)
dk4sto_it_close(it);
-#line 2536 "printqd.ctr"
+#line 2554 "printqd.ctr"
}
@@ -2671,17 +2667,17 @@ printer_alias_delete(pqd_printer_alias_t *ptr)
{
-#line 2548 "printqd.ctr"
+#line 2566 "printqd.ctr"
if (NULL != ptr) {
-#line 2549 "printqd.ctr"
+#line 2567 "printqd.ctr"
dk4mem_release(ptr->name);
ptr->pr = NULL;
dk4mem_free(ptr);
}
-#line 2554 "printqd.ctr"
+#line 2572 "printqd.ctr"
}
@@ -2698,7 +2694,7 @@ printer_alias_new(const char *n, pqd_printer_t *pr)
pqd_printer_alias_t *back = NULL;
-#line 2569 "printqd.ctr"
+#line 2587 "printqd.ctr"
if ((NULL != n) && (NULL != pr)) {
back = dk4mem_new(pqd_printer_alias_t,1,NULL);
if (NULL != back) {
@@ -2711,26 +2707,26 @@ printer_alias_new(const char *n, pqd_printer_t *pr)
#if TRACE_DEBUG
else {
-#line 2580 "printqd.ctr"
+#line 2598 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2585 "printqd.ctr"
+#line 2603 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2590 "printqd.ctr"
+#line 2608 "printqd.ctr"
}
#endif
-#line 2593 "printqd.ctr"
+#line 2611 "printqd.ctr"
return back;
}
@@ -2751,7 +2747,7 @@ printer_alias_compare(const void *l, const void *r, int cr)
int back = 0;
-#line 2612 "printqd.ctr"
+#line 2630 "printqd.ctr"
if (NULL != l) {
if (NULL != r) {
pl = (const pqd_printer_alias_t *)l;
@@ -2781,7 +2777,7 @@ printer_alias_compare(const void *l, const void *r, int cr)
if (NULL != r) { back = -1; }
}
-#line 2640 "printqd.ctr"
+#line 2658 "printqd.ctr"
return back;
}
@@ -2797,7 +2793,7 @@ printer_alias_all_delete(dk4_sto_it_t *it)
pqd_printer_alias_t *ptr;
-#line 2654 "printqd.ctr"
+#line 2672 "printqd.ctr"
dk4sto_it_reset(it);
do {
ptr = (pqd_printer_alias_t *)dk4sto_it_next(it);
@@ -2808,7 +2804,7 @@ printer_alias_all_delete(dk4_sto_it_t *it)
dk4sto_it_close(it);
-#line 2663 "printqd.ctr"
+#line 2681 "printqd.ctr"
}
@@ -2821,7 +2817,7 @@ config_init(void)
{
-#line 2674 "printqd.ctr"
+#line 2692 "printqd.ctr"
DK4_MEMRES(&conf, sizeof(conf));
conf.sname = NULL;
conf.dname = NULL;
@@ -2855,7 +2851,7 @@ config_init(void)
conf.ldb = 0;
-#line 2706 "printqd.ctr"
+#line 2724 "printqd.ctr"
}
@@ -2870,7 +2866,7 @@ config_allocate(void)
int back = 0;
-#line 2719 "printqd.ctr"
+#line 2737 "printqd.ctr"
conf.s_c = dk4sto_open(NULL);
conf.s_p = dk4sto_open(NULL);
conf.s_a = dk4sto_open(NULL);
@@ -2898,33 +2894,33 @@ config_allocate(void)
#if TRACE_DEBUG
else {
-#line 2745 "printqd.ctr"
+#line 2763 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2750 "printqd.ctr"
+#line 2768 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2755 "printqd.ctr"
+#line 2773 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 2760 "printqd.ctr"
+#line 2778 "printqd.ctr"
}
#endif
-#line 2763 "printqd.ctr"
+#line 2781 "printqd.ctr"
return back;
}
@@ -2947,7 +2943,7 @@ set_backlog(int *iptr, char *pv, const char *fn, unsigned long lineno)
int res = 0;
-#line 2784 "printqd.ctr"
+#line 2802 "printqd.ctr"
res = dk4ma_input_c8_dec_int(&i, pv, &ep, 1, NULL);
if (0 != res) {
if (0 < i) {
@@ -2955,18 +2951,18 @@ set_backlog(int *iptr, char *pv, const char *fn, unsigned long lineno)
back = 1;
} else {
-#line 2790 "printqd.ctr"
+#line 2808 "printqd.ctr"
/* ERROR: Must be positive */
log_1(fn, lineno, LOG_EMERG, 1, 15);
}
} else {
-#line 2794 "printqd.ctr"
+#line 2812 "printqd.ctr"
/* ERROR: Not an integer number */
log_5(fn, lineno, LOG_EMERG, 1, 12, 13, 14, pv, ep);
}
-#line 2797 "printqd.ctr"
+#line 2815 "printqd.ctr"
return back;
}
@@ -2994,20 +2990,20 @@ set_max_connections(
int res = 0;
-#line 2823 "printqd.ctr"
+#line 2841 "printqd.ctr"
res = dk4ma_input_c8_dec_size_t(&sz, pv, &ep, 1, NULL);
if (0 != res) {
*pmaxconn = sz;
back = 1;
} else {
-#line 2828 "printqd.ctr"
+#line 2846 "printqd.ctr"
/* ERROR: Not a size specification */
log_5(fn, lineno, LOG_EMERG, 1, 16, 17, 18, pv, ep);
}
-#line 2832 "printqd.ctr"
+#line 2850 "printqd.ctr"
return back;
}
@@ -3033,7 +3029,7 @@ set_port_number(
int res = 0;
-#line 2856 "printqd.ctr"
+#line 2874 "printqd.ctr"
res = dk4ma_input_c8_dec_ushort(&pn, pv, &ep, 1, NULL);
if (0 != res) {
if (0 < pn) {
@@ -3041,19 +3037,19 @@ set_port_number(
back = 1;
} else {
-#line 2862 "printqd.ctr"
+#line 2880 "printqd.ctr"
/* ERROR: Port number must not be 0 */
log_1(fn, lineno, LOG_EMERG, 1, 22);
}
} else {
-#line 2866 "printqd.ctr"
+#line 2884 "printqd.ctr"
/* ERROR: Not a 16 bit unsigned number */
log_5(fn, lineno, LOG_EMERG, 1, 19, 20, 21, pv, ep);
}
-#line 2870 "printqd.ctr"
+#line 2888 "printqd.ctr"
return back;
}
@@ -3061,7 +3057,6 @@ set_port_number(
/** Add address to list of allowed hosts.
@param s Containter of allowed peers.
- @param i Iterator through container.
@param iptr Address of global flag variable.
@param str Text containing the address.
@return 1 on success, 0 on error.
@@ -3070,7 +3065,6 @@ static
int
allow_hosts(
dk4_sto_t *s,
- dk4_sto_it_t *i,
int *iptr,
char *str,
const char *filename,
@@ -3084,7 +3078,7 @@ allow_hosts(
int back = 0;
-#line 2899 "printqd.ctr"
+#line 2915 "printqd.ctr"
px = dk4str8_next(str, NULL);
if (NULL == px) {
if (0 == strcmp(str, printqd_kw[2])) {
@@ -3101,33 +3095,33 @@ allow_hosts(
back = 1;
} else {
-#line 2914 "printqd.ctr"
+#line 2930 "printqd.ctr"
dk4mem_free(pap);
/* ERROR: Memory */
log_1(filename, lineno, LOG_EMERG, 1, 27);
}
} else {
-#line 2919 "printqd.ctr"
+#line 2935 "printqd.ctr"
/* ERROR: Memory */
log_1(filename, lineno, LOG_EMERG, 1, 27);
}
} else {
-#line 2923 "printqd.ctr"
+#line 2939 "printqd.ctr"
/* ERROR: Syntax, not a peer definition */
log_3(filename, lineno, LOG_EMERG, 1, 25, 26, str);
}
}
} else {
-#line 2928 "printqd.ctr"
+#line 2944 "printqd.ctr"
/* ERROR: Unexpected text */
log_3(filename, lineno, LOG_EMERG, 1, 23, 24, px);
}
-#line 2932 "printqd.ctr"
+#line 2948 "printqd.ctr"
return back;
}
@@ -3148,7 +3142,7 @@ get_limit_value(dk4_um_t *plim, char *src, const char *fn, unsigned long lineno)
int res = 0;
-#line 2951 "printqd.ctr"
+#line 2967 "printqd.ctr"
if (0 == strcmp(src, printqd_kw[3])) {
*plim = DK4_UM_MAX;
back = 1;
@@ -3163,7 +3157,7 @@ get_limit_value(dk4_um_t *plim, char *src, const char *fn, unsigned long lineno)
back = 1;
} else {
-#line 2964 "printqd.ctr"
+#line 2980 "printqd.ctr"
/* ERROR: Syntax, not an unsigned number */
log_5(fn, lineno, LOG_EMERG, 1, 28, 29, 30, src, ep);
}
@@ -3171,14 +3165,13 @@ get_limit_value(dk4_um_t *plim, char *src, const char *fn, unsigned long lineno)
}
-#line 2970 "printqd.ctr"
+#line 2986 "printqd.ctr"
return back;
}
/** Add a user or group limit to a class.
- @param pcl Class to modify.
@param s Container for limits.
@param i Container iterator.
@param str Text containing name and limit.
@@ -3189,7 +3182,6 @@ get_limit_value(dk4_um_t *plim, char *src, const char *fn, unsigned long lineno)
static
int
add_limit(
- pqd_class_t *pcl,
dk4_sto_t *s,
dk4_sto_it_t *i,
char *str,
@@ -3204,7 +3196,7 @@ add_limit(
int back = 0;
-#line 3001 "printqd.ctr"
+#line 3015 "printqd.ctr"
pnum = dk4str8_next(str, NULL);
if (NULL != pnum) {
px = dk4str8_next(pnum, NULL);
@@ -3218,39 +3210,39 @@ add_limit(
back = 1;
} else {
-#line 3013 "printqd.ctr"
+#line 3027 "printqd.ctr"
/* ERROR: Memory */
log_1(fn, lineno, LOG_EMERG, 1, 27);
limit_delete(plim);
}
} else {
-#line 3018 "printqd.ctr"
+#line 3032 "printqd.ctr"
/* ERROR: Memory */
log_1(fn, lineno, LOG_EMERG, 1, 27);
}
} else {
-#line 3022 "printqd.ctr"
+#line 3036 "printqd.ctr"
/* ERROR: Limit redefinition */
log_3(fn, lineno, LOG_EMERG, 1, 32, 33, str);
}
}
} else {
-#line 3027 "printqd.ctr"
+#line 3041 "printqd.ctr"
/* ERROR: Syntax, no further text expected */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
}
} else {
-#line 3031 "printqd.ctr"
+#line 3045 "printqd.ctr"
/* ERROR: Missing limit. */
log_1(fn, lineno, LOG_EMERG, 1, 31);
}
-#line 3035 "printqd.ctr"
+#line 3049 "printqd.ctr"
return back;
}
@@ -3275,7 +3267,7 @@ set_default_limit(
int back = 0;
-#line 3058 "printqd.ctr"
+#line 3072 "printqd.ctr"
px = dk4str8_next(pv, NULL);
if (NULL == px) {
if (0 != get_limit_value(&value, pv, fn, lineno)) {
@@ -3285,20 +3277,20 @@ set_default_limit(
back = 1;
} else {
-#line 3066 "printqd.ctr"
+#line 3080 "printqd.ctr"
/* ERROR: Syntax, default limit redefined */
log_1(fn, lineno, LOG_EMERG, 1, 34);
}
}
} else {
-#line 3071 "printqd.ctr"
+#line 3085 "printqd.ctr"
/* ERROR: No further text expected */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
}
-#line 3075 "printqd.ctr"
+#line 3089 "printqd.ctr"
return back;
}
@@ -3323,7 +3315,7 @@ set_deny_action(
int res = 0;
-#line 3098 "printqd.ctr"
+#line 3112 "printqd.ctr"
px = dk4str8_next(pv, NULL);
if (NULL == px) {
switch ( (res = dk4str8_array_index(deny_action_names, pv, 0)) ) {
@@ -3334,7 +3326,7 @@ set_deny_action(
back = 1;
} else {
-#line 3107 "printqd.ctr"
+#line 3121 "printqd.ctr"
/* ERROR: Redefinition of deny action */
log_1(fn, lineno, LOG_EMERG, 1, 35);
}
@@ -3344,13 +3336,13 @@ set_deny_action(
}
} else {
-#line 3115 "printqd.ctr"
+#line 3129 "printqd.ctr"
/* ERROR: Syntax, no further text expected */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
}
-#line 3119 "printqd.ctr"
+#line 3133 "printqd.ctr"
return back;
}
@@ -3371,7 +3363,7 @@ add_alias(pqd_printer_t *ppr, char *pv, const char *fn, unsigned long lineno)
int back = 0;
-#line 3138 "printqd.ctr"
+#line 3152 "printqd.ctr"
px = dk4str8_next(pv, NULL);
if (NULL == px) {
ppa = (pqd_printer_alias_t *)dk4sto_it_find_like(conf.i_a, pv, 1);
@@ -3384,38 +3376,38 @@ add_alias(pqd_printer_t *ppr, char *pv, const char *fn, unsigned long lineno)
back = 1;
} else {
-#line 3149 "printqd.ctr"
+#line 3163 "printqd.ctr"
/* ERROR: Memory */
log_1(fn, lineno, LOG_EMERG, 1, 27);
printer_alias_delete(ppa);
}
} else {
-#line 3154 "printqd.ctr"
+#line 3168 "printqd.ctr"
/* ERROR: Memory */
log_1(fn, lineno, LOG_EMERG, 1, 27);
}
} else {
-#line 3158 "printqd.ctr"
+#line 3172 "printqd.ctr"
/* ERROR: Printer exists */
log_3(fn, lineno, LOG_EMERG, 1, 36, 37, pv);
}
} else {
-#line 3162 "printqd.ctr"
+#line 3176 "printqd.ctr"
/* ERROR: Alias already exists */
log_3(fn, lineno, LOG_EMERG, 1, 38, 39, pv);
}
} else {
-#line 3166 "printqd.ctr"
+#line 3180 "printqd.ctr"
/* ERROR: Syntax, unexpected text */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
}
-#line 3170 "printqd.ctr"
+#line 3184 "printqd.ctr"
return back;
}
@@ -3435,7 +3427,7 @@ assign_class(pqd_printer_t *ppr, char *pv, const char *fn, unsigned long lineno)
int back = 0;
-#line 3188 "printqd.ctr"
+#line 3202 "printqd.ctr"
px = dk4str8_next(pv, NULL);
if (NULL == px) {
if (NULL == ppr->cl) {
@@ -3445,25 +3437,25 @@ assign_class(pqd_printer_t *ppr, char *pv, const char *fn, unsigned long lineno)
back = 1;
} else {
-#line 3196 "printqd.ctr"
+#line 3210 "printqd.ctr"
/* ERROR: Syntax, class not found */
log_3(fn, lineno, LOG_EMERG, 1, 40, 41, pv);
}
} else {
-#line 3200 "printqd.ctr"
+#line 3214 "printqd.ctr"
/* ERROR: Syntax, redefinition of printer class */
log_1(fn, lineno, LOG_EMERG, 1, 42);
}
} else {
-#line 3204 "printqd.ctr"
+#line 3218 "printqd.ctr"
/* ERROR: Syntax, unexpected text */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
}
-#line 3208 "printqd.ctr"
+#line 3222 "printqd.ctr"
return back;
}
@@ -3482,7 +3474,7 @@ config_check(const char *filename, unsigned long lineno)
-#line 3225 "printqd.ctr"
+#line 3239 "printqd.ctr"
/* Each printer must have a class assigned.
*/
dk4sto_it_reset(conf.i_p);
@@ -3492,7 +3484,7 @@ config_check(const char *filename, unsigned long lineno)
if (NULL == pr->cl) {
back = 0;
-#line 3233 "printqd.ctr"
+#line 3247 "printqd.ctr"
/* ERROR: No class for printer */
log_3(filename, lineno, LOG_EMERG, 1, 91, 92, pr->name);
}
@@ -3508,7 +3500,7 @@ config_check(const char *filename, unsigned long lineno)
if (0 == cl->hdl) {
-#line 3247 "printqd.ctr"
+#line 3261 "printqd.ctr"
/* WARNING: Default limit missing for class */
log_3(filename, lineno, LOG_EMERG, 0, 93, 94, cl->name);
}
@@ -3517,7 +3509,7 @@ config_check(const char *filename, unsigned long lineno)
-#line 3254 "printqd.ctr"
+#line 3268 "printqd.ctr"
return back;
}
@@ -3525,13 +3517,11 @@ config_check(const char *filename, unsigned long lineno)
/** Set additional features to log.
@param pv Text containing the feature names.
- @param fn File name for diagnostics.
- @param lineno Line numbers for diagnostics.
@return 1 on success, 0 on errors.
*/
static
int
-set_log_features(char *pv, const char *fn, unsigned long lineno)
+set_log_features(char *pv)
{
char *pc;
@@ -3601,7 +3591,7 @@ config_read(void)
int myres = 0; /* Internal operation result */
-#line 3336 "printqd.ctr"
+#line 3348 "printqd.ctr"
if (0 != config_allocate()) {
if (0 != options[1].found) { fn = options[1].val.t; }
if (NULL == fn) { fn = def_conf_file_name; }
@@ -3613,41 +3603,41 @@ config_read(void)
lineno++;
dk4str8_delnl(inbuf);
-#line 3346 "printqd.ctr"
+#line 3358 "printqd.ctr"
pk = dk4str8_start(inbuf, NULL);
if (NULL != pk) {
if ('#' != *pk) {
if ('[' == *pk) {
-#line 3350 "printqd.ctr"
+#line 3362 "printqd.ctr"
/*
Opening a new section.
*/
pk = dk4str8_start(++pk, NULL);
if (NULL != pk) {
-#line 3355 "printqd.ctr"
+#line 3367 "printqd.ctr"
sectt = -1;
pcl = NULL;
ppr = NULL;
pv = dk4str8_chr(pk, ']');
if (NULL != pv) { *pv = '\0'; }
-#line 3360 "printqd.ctr"
+#line 3372 "printqd.ctr"
pv = dk4str8_next(pk, NULL);
switch ( dk4str8_array_index(config_section_names, pk, 0) ) {
/* Opening options section.
*/
case 0 : {
-#line 3365 "printqd.ctr"
+#line 3377 "printqd.ctr"
sectt = 0;
} break;
/* Opening class section.
*/
case 1 : {
-#line 3370 "printqd.ctr"
+#line 3382 "printqd.ctr"
sectt = 1;
if (NULL != pv) {
if (NULL == (px = dk4str8_next(pv, NULL))) {
@@ -3663,33 +3653,33 @@ config_read(void)
class_delete(pcl);
pcl = NULL;
-#line 3384 "printqd.ctr"
+#line 3396 "printqd.ctr"
back = 0;
}
} else {
-#line 3387 "printqd.ctr"
+#line 3399 "printqd.ctr"
/* ERROR: MEMORY */
log_1(fn, lineno, LOG_EMERG, 1, 27);
back = 0;
}
} else {
-#line 3392 "printqd.ctr"
+#line 3404 "printqd.ctr"
/* ERROR: Syntax, class already exists */
log_3(fn, lineno, LOG_EMERG, 1, 43, 44, pv);
back = 0;
}
} else {
-#line 3397 "printqd.ctr"
+#line 3409 "printqd.ctr"
/* ERROR: Syntax, only one component allowed */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
back = 0;
}
} else {
-#line 3402 "printqd.ctr"
+#line 3414 "printqd.ctr"
/* ERROR: Syntax, missing class name */
log_1(fn, lineno, LOG_EMERG, 1, 45);
back = 0;
@@ -3699,7 +3689,7 @@ config_read(void)
*/
case 2 : {
-#line 3410 "printqd.ctr"
+#line 3422 "printqd.ctr"
sectt = 2;
if (NULL != pv) {
if (NULL == (px = dk4str8_next(pv, NULL))) {
@@ -3719,32 +3709,32 @@ config_read(void)
ppr = NULL;
back = 0;
-#line 3428 "printqd.ctr"
+#line 3440 "printqd.ctr"
}
} else {
-#line 3430 "printqd.ctr"
+#line 3442 "printqd.ctr"
/* ERROR: Memory */
log_1(fn, lineno, LOG_EMERG, 1, 27);
back = 0;
}
} else {
-#line 3435 "printqd.ctr"
+#line 3447 "printqd.ctr"
/* ERROR: Syntax, pr/al already exists */
log_3(fn, lineno, LOG_EMERG, 1, 46, 47, pv);
back = 0;
}
} else {
-#line 3440 "printqd.ctr"
+#line 3452 "printqd.ctr"
/* ERROR: Syntax, just one component allowed */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
back = 0;
}
} else {
-#line 3445 "printqd.ctr"
+#line 3457 "printqd.ctr"
/* ERROR: Syntax, name required */
log_1(fn, lineno, LOG_EMERG, 1, 48);
back = 0;
@@ -3752,7 +3742,7 @@ config_read(void)
} break;
default : {
-#line 3451 "printqd.ctr"
+#line 3463 "printqd.ctr"
/* ERROR: Syntax, illegal section name */
log_3(fn, lineno, LOG_EMERG, 1, 49, 50, pk);
back = 0;
@@ -3760,14 +3750,14 @@ config_read(void)
}
} else {
-#line 3457 "printqd.ctr"
+#line 3469 "printqd.ctr"
/* ERROR: Syntax, empty section */
log_1(fn, lineno, LOG_EMERG, 1, 51);
back = 0;
}
} else {
-#line 3462 "printqd.ctr"
+#line 3474 "printqd.ctr"
/*
Data line for existing section.
*/
@@ -3778,12 +3768,12 @@ config_read(void)
if (NULL != pv) {
dk4str8_normalize(pk, NULL);
-#line 3471 "printqd.ctr"
+#line 3483 "printqd.ctr"
switch ( dk4str8_array_index(config_option_names, pk, 0) ) {
case 0 : {
-#line 3474 "printqd.ctr"
+#line 3486 "printqd.ctr"
if (0 == sectt) {
struct passwd *pw;
if (NULL == (px = dk4str8_next(pv, NULL))) {
@@ -3796,25 +3786,25 @@ config_read(void)
log_1(fn, lineno, LOG_EMERG, 1, 52);
back = 0;
-#line 3485 "printqd.ctr"
+#line 3497 "printqd.ctr"
}
} else {
-#line 3487 "printqd.ctr"
+#line 3499 "printqd.ctr"
/* ERROR: User not found */
log_3(fn, lineno, LOG_EMERG, 1, 53, 54, pv);
back = 0;
}
} else {
-#line 3492 "printqd.ctr"
+#line 3504 "printqd.ctr"
/* ERROR: Syntax, just one component allowed */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
back = 0;
}
} else {
-#line 3497 "printqd.ctr"
+#line 3509 "printqd.ctr"
/* ERROR: Only allwowed in options section */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -3822,7 +3812,7 @@ config_read(void)
} break;
case 1 : {
-#line 3503 "printqd.ctr"
+#line 3515 "printqd.ctr"
if (0 == sectt) {
struct group *pgr;
if (NULL == (px = dk4str8_next(pv, NULL))) {
@@ -3835,25 +3825,25 @@ config_read(void)
log_1(fn, lineno, LOG_EMERG, 1, 56);
back = 0;
-#line 3514 "printqd.ctr"
+#line 3526 "printqd.ctr"
}
} else {
-#line 3516 "printqd.ctr"
+#line 3528 "printqd.ctr"
/* ERROR: Syntax, group not found */
log_3(fn, lineno, LOG_EMERG, 1, 57, 58, pv);
back = 0;
}
} else {
-#line 3521 "printqd.ctr"
+#line 3533 "printqd.ctr"
/* ERROR: Syntax, just one component allowed */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
back = 0;
}
} else {
-#line 3526 "printqd.ctr"
+#line 3538 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -3861,7 +3851,7 @@ config_read(void)
} break;
case 2 : {
-#line 3532 "printqd.ctr"
+#line 3544 "printqd.ctr"
if (0 == sectt) {
if (NULL == conf.dname) {
conf.dname = dk4str8_dup(pv, NULL);
@@ -3870,18 +3860,18 @@ config_read(void)
log_1(fn, lineno, LOG_EMERG, 1, 27);
back = 0;
-#line 3539 "printqd.ctr"
+#line 3551 "printqd.ctr"
}
} else {
/* ERROR: Redefinition */
log_1(fn, lineno, LOG_EMERG, 1, 59);
back = 0;
-#line 3544 "printqd.ctr"
+#line 3556 "printqd.ctr"
}
} else {
-#line 3546 "printqd.ctr"
+#line 3558 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -3889,7 +3879,7 @@ config_read(void)
} break;
case 3 : {
-#line 3552 "printqd.ctr"
+#line 3564 "printqd.ctr"
if (0 == sectt) {
if (NULL == conf.sname) {
conf.sname = dk4str8_dup(pv, NULL);
@@ -3898,18 +3888,18 @@ config_read(void)
log_1(fn, lineno, LOG_EMERG, 1, 27);
back = 0;
-#line 3559 "printqd.ctr"
+#line 3571 "printqd.ctr"
}
} else {
-#line 3561 "printqd.ctr"
+#line 3573 "printqd.ctr"
/* ERROR: Redefinition */
log_1(fn, lineno, LOG_EMERG, 1, 60);
back = 0;
}
} else {
-#line 3566 "printqd.ctr"
+#line 3578 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -3917,16 +3907,16 @@ config_read(void)
} break;
case 4 : {
-#line 3572 "printqd.ctr"
+#line 3584 "printqd.ctr"
if (0 == sectt) {
if (0 == set_backlog(&(conf.slbl), pv, fn, lineno)) {
back = 0;
-#line 3575 "printqd.ctr"
+#line 3587 "printqd.ctr"
}
} else {
-#line 3577 "printqd.ctr"
+#line 3589 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -3934,17 +3924,17 @@ config_read(void)
} break;
case 5 : {
-#line 3583 "printqd.ctr"
+#line 3595 "printqd.ctr"
if (0 == sectt) {
if(0 == set_max_connections(&(conf.m_loc),pv,fn,lineno))
{
back = 0;
-#line 3587 "printqd.ctr"
+#line 3599 "printqd.ctr"
}
} else {
-#line 3589 "printqd.ctr"
+#line 3601 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -3952,16 +3942,16 @@ config_read(void)
} break;
case 6 : {
-#line 3595 "printqd.ctr"
+#line 3607 "printqd.ctr"
if (0 == sectt) {
if (0 == set_port_number(&(conf.pudp),pv,fn,lineno)) {
back = 0;
-#line 3598 "printqd.ctr"
+#line 3610 "printqd.ctr"
}
} else {
-#line 3600 "printqd.ctr"
+#line 3612 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -3969,16 +3959,16 @@ config_read(void)
} break;
case 7 : {
-#line 3606 "printqd.ctr"
+#line 3618 "printqd.ctr"
if (0 == sectt) {
if (0 == set_port_number(&(conf.ptcp),pv,fn,lineno)) {
back = 0;
-#line 3609 "printqd.ctr"
+#line 3621 "printqd.ctr"
}
} else {
-#line 3611 "printqd.ctr"
+#line 3623 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -3986,16 +3976,16 @@ config_read(void)
} break;
case 8 : {
-#line 3617 "printqd.ctr"
+#line 3629 "printqd.ctr"
if (0 == sectt) {
if (0 == set_backlog(&(conf.snbl), pv, fn, lineno)) {
back = 0;
-#line 3620 "printqd.ctr"
+#line 3632 "printqd.ctr"
}
} else {
-#line 3622 "printqd.ctr"
+#line 3634 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -4003,17 +3993,17 @@ config_read(void)
} break;
case 9 : {
-#line 3628 "printqd.ctr"
+#line 3640 "printqd.ctr"
if (0 == sectt) {
if(0 == set_max_connections(&(conf.m_tcp),pv,fn,lineno))
{
back = 0;
-#line 3632 "printqd.ctr"
+#line 3644 "printqd.ctr"
}
} else {
-#line 3634 "printqd.ctr"
+#line 3646 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -4021,20 +4011,20 @@ config_read(void)
} break;
case 10 : {
-#line 3640 "printqd.ctr"
+#line 3652 "printqd.ctr"
if (0 == sectt) {
myres = allow_hosts(
- conf.s_ai, conf.i_ai, &(conf.iglo), pv,
+ conf.s_ai, &(conf.iglo), pv,
fn, lineno
);
if (0 == myres) {
-#line 3646 "printqd.ctr"
+#line 3658 "printqd.ctr"
back = 0;
}
} else {
-#line 3649 "printqd.ctr"
+#line 3661 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -4042,20 +4032,20 @@ config_read(void)
} break;
case 11 : {
-#line 3655 "printqd.ctr"
+#line 3667 "printqd.ctr"
if (0 == sectt) {
myres = allow_hosts(
- conf.s_ad, conf.i_ad, &(conf.dglo), pv,
+ conf.s_ad, &(conf.dglo), pv,
fn, lineno
);
if (0 == myres) {
-#line 3661 "printqd.ctr"
+#line 3673 "printqd.ctr"
back = 0;
}
} else {
-#line 3664 "printqd.ctr"
+#line 3676 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -4063,20 +4053,20 @@ config_read(void)
} break;
case 12 : {
-#line 3670 "printqd.ctr"
+#line 3682 "printqd.ctr"
if (0 == sectt) {
myres = allow_hosts(
- conf.s_aa, conf.i_aa, &(conf.aglo), pv,
+ conf.s_aa, &(conf.aglo), pv,
fn, lineno
);
if (0 == myres) {
-#line 3676 "printqd.ctr"
+#line 3688 "printqd.ctr"
back = 0;
}
} else {
-#line 3679 "printqd.ctr"
+#line 3691 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -4084,19 +4074,19 @@ config_read(void)
} break;
case 13 : {
-#line 3685 "printqd.ctr"
+#line 3697 "printqd.ctr"
if ((1 == sectt) && (NULL != pcl)) {
myres = add_limit(
- pcl, pcl->s_u, pcl->i_u, pv, fn, lineno
+ pcl->s_u, pcl->i_u, pv, fn, lineno
);
if (0 == myres) {
-#line 3690 "printqd.ctr"
+#line 3702 "printqd.ctr"
back = 0;
}
} else {
-#line 3693 "printqd.ctr"
+#line 3705 "printqd.ctr"
/* ERROR: Syntax, only allowed in class */
log_1(fn, lineno, LOG_EMERG, 1, 61);
back = 0;
@@ -4104,19 +4094,19 @@ config_read(void)
} break;
case 14 : {
-#line 3699 "printqd.ctr"
+#line 3711 "printqd.ctr"
if ((1 == sectt) && (NULL != pcl)) {
myres = add_limit(
- pcl, pcl->s_g, pcl->i_g, pv, fn, lineno
+ pcl->s_g, pcl->i_g, pv, fn, lineno
);
if (0 == myres) {
-#line 3704 "printqd.ctr"
+#line 3716 "printqd.ctr"
back = 0;
}
} else {
-#line 3707 "printqd.ctr"
+#line 3719 "printqd.ctr"
/* ERROR: Syntax, only allowed in class */
log_1(fn, lineno, LOG_EMERG, 1, 61);
back = 0;
@@ -4124,17 +4114,17 @@ config_read(void)
} break;
case 15 : {
-#line 3713 "printqd.ctr"
+#line 3725 "printqd.ctr"
if ((1 == sectt) && (NULL != pcl)) {
myres = set_default_limit(pcl, pv, fn, lineno);
if (0 == myres) {
-#line 3716 "printqd.ctr"
+#line 3728 "printqd.ctr"
back = 0;
}
} else {
-#line 3719 "printqd.ctr"
+#line 3731 "printqd.ctr"
/* ERROR: Syntax, only allowed in class */
log_1(fn, lineno, LOG_EMERG, 1, 61);
back = 0;
@@ -4142,17 +4132,17 @@ config_read(void)
} break;
case 16 : {
-#line 3725 "printqd.ctr"
+#line 3737 "printqd.ctr"
if ((1 == sectt) && (NULL != pcl)) {
myres = set_deny_action(pcl, pv, fn, lineno);
if (0 == myres) {
-#line 3728 "printqd.ctr"
+#line 3740 "printqd.ctr"
back = 0;
}
} else {
-#line 3731 "printqd.ctr"
+#line 3743 "printqd.ctr"
/* ERROR: Syntax, only allowed in class */
log_1(fn, lineno, LOG_EMERG, 1, 61);
back = 0;
@@ -4160,17 +4150,17 @@ config_read(void)
} break;
case 17 : {
-#line 3737 "printqd.ctr"
+#line 3749 "printqd.ctr"
if ((2 == sectt) && (NULL != ppr)) {
myres = add_alias(ppr, pv, fn, lineno);
if (0 == myres) {
-#line 3740 "printqd.ctr"
+#line 3752 "printqd.ctr"
back = 0;
}
} else {
-#line 3743 "printqd.ctr"
+#line 3755 "printqd.ctr"
/* ERROR: Syntax, only allowed in printer */
log_1(fn, lineno, LOG_EMERG, 1, 62);
back = 0;
@@ -4178,17 +4168,17 @@ config_read(void)
} break;
case 18 : {
-#line 3749 "printqd.ctr"
+#line 3761 "printqd.ctr"
if ((2 == sectt) && (NULL != ppr)) {
myres = assign_class(ppr, pv, fn, lineno);
if (0 == myres) {
-#line 3752 "printqd.ctr"
+#line 3764 "printqd.ctr"
back = 0;
}
} else {
-#line 3755 "printqd.ctr"
+#line 3767 "printqd.ctr"
/* ERROR: Syntax, only allowed in printer */
log_1(fn, lineno, LOG_EMERG, 1, 62);
back = 0;
@@ -4196,7 +4186,7 @@ config_read(void)
} break;
case 19 : {
-#line 3761 "printqd.ctr"
+#line 3773 "printqd.ctr"
if (0 == sectt) {
if (NULL == conf.lname) {
conf.lname = dk4str8_dup(pv, NULL);
@@ -4205,18 +4195,18 @@ config_read(void)
log_1(fn, lineno, LOG_EMERG, 1, 27);
back = 0;
-#line 3768 "printqd.ctr"
+#line 3780 "printqd.ctr"
}
} else {
-#line 3770 "printqd.ctr"
+#line 3782 "printqd.ctr"
/* ERROR: Redefinition */
log_1(fn, lineno, LOG_EMERG, 1, 63);
back = 0;
}
} else {
-#line 3775 "printqd.ctr"
+#line 3787 "printqd.ctr"
/* ERROR: Only in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -4224,12 +4214,12 @@ config_read(void)
} break;
case 20 : {
-#line 3781 "printqd.ctr"
- back = set_log_features(pv, fn, lineno);
+#line 3793 "printqd.ctr"
+ back = set_log_features(pv);
} break;
case 21 : {
-#line 3784 "printqd.ctr"
+#line 3796 "printqd.ctr"
if (0 == sectt) {
struct passwd *pw;
if (NULL == (px = dk4str8_next(pv, NULL))) {
@@ -4242,25 +4232,25 @@ config_read(void)
log_1(fn, lineno, LOG_EMERG, 1, 52);
back = 0;
-#line 3795 "printqd.ctr"
+#line 3807 "printqd.ctr"
}
} else {
-#line 3797 "printqd.ctr"
+#line 3809 "printqd.ctr"
/* ERROR: User not found */
log_3(fn, lineno, LOG_EMERG, 1, 53, 54, pv);
back = 0;
}
} else {
-#line 3802 "printqd.ctr"
+#line 3814 "printqd.ctr"
/* ERROR: Syntax, just one component allowed */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
back = 0;
}
} else {
-#line 3807 "printqd.ctr"
+#line 3819 "printqd.ctr"
/* ERROR: Only allwowed in options section */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -4268,7 +4258,7 @@ config_read(void)
} break;
case 22 : {
-#line 3813 "printqd.ctr"
+#line 3825 "printqd.ctr"
if (0 == sectt) {
struct group *pgr;
if (NULL == (px = dk4str8_next(pv, NULL))) {
@@ -4281,25 +4271,25 @@ config_read(void)
log_1(fn, lineno, LOG_EMERG, 1, 56);
back = 0;
-#line 3824 "printqd.ctr"
+#line 3836 "printqd.ctr"
}
} else {
-#line 3826 "printqd.ctr"
+#line 3838 "printqd.ctr"
/* ERROR: Syntax, group not found */
log_3(fn, lineno, LOG_EMERG, 1, 57, 58, pv);
back = 0;
}
} else {
-#line 3831 "printqd.ctr"
+#line 3843 "printqd.ctr"
/* ERROR: Syntax, just one component allowed */
log_3(fn, lineno, LOG_EMERG, 1, 23, 24, px);
back = 0;
}
} else {
-#line 3836 "printqd.ctr"
+#line 3848 "printqd.ctr"
/* ERROR: Syntax, only allowed in options */
log_1(fn, lineno, LOG_EMERG, 1, 55);
back = 0;
@@ -4308,14 +4298,14 @@ config_read(void)
}
} else {
-#line 3843 "printqd.ctr"
+#line 3855 "printqd.ctr"
/* ERROR: Syntax, missing value */
log_1(fn, lineno, LOG_EMERG, 1, 64);
back = 0;
}
} else {
-#line 3848 "printqd.ctr"
+#line 3860 "printqd.ctr"
/* ERROR: Syntax, missing value */
log_1(fn, lineno, LOG_EMERG, 1, 64);
back = 0;
@@ -4325,14 +4315,14 @@ config_read(void)
#if TRACE_DEBUG
else {
-#line 3856 "printqd.ctr"
+#line 3868 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 3861 "printqd.ctr"
+#line 3873 "printqd.ctr"
}
#endif
}
@@ -4342,7 +4332,7 @@ config_read(void)
}
} else {
-#line 3869 "printqd.ctr"
+#line 3881 "printqd.ctr"
/* ERROR: Failed to open file */
log_1(fn, 0UL, LOG_EMERG, 1, 65);
}
@@ -4352,7 +4342,7 @@ config_read(void)
}
-#line 3877 "printqd.ctr"
+#line 3889 "printqd.ctr"
return back;
}
@@ -4365,7 +4355,7 @@ release_allowed_peers(dk4_sto_it_t *it)
dk4_allowed_peer_t *peer;
-#line 3888 "printqd.ctr"
+#line 3900 "printqd.ctr"
dk4sto_it_reset(it);
do {
peer = (dk4_allowed_peer_t *)dk4sto_it_next(it);
@@ -4376,7 +4366,7 @@ release_allowed_peers(dk4_sto_it_t *it)
dk4sto_it_close(it);
-#line 3897 "printqd.ctr"
+#line 3909 "printqd.ctr"
}
@@ -4389,7 +4379,7 @@ config_release(void)
{
-#line 3908 "printqd.ctr"
+#line 3920 "printqd.ctr"
prev_uid = conf.uid;
prev_gid = conf.gid;
@@ -4442,7 +4432,7 @@ config_release(void)
conf.pudp = 9100;
-#line 3959 "printqd.ctr"
+#line 3971 "printqd.ctr"
}
@@ -4457,7 +4447,7 @@ outer_allocate_resources(void)
int back = 0;
-#line 3972 "printqd.ctr"
+#line 3984 "printqd.ctr"
/* Initialize variables to NULL.
*/
@@ -4471,7 +4461,7 @@ outer_allocate_resources(void)
s_c_unix = dk4sto_open(NULL);
if (NULL == s_c_unix) {
-#line 3984 "printqd.ctr"
+#line 3996 "printqd.ctr"
/* ERROR: Memory */
log_1(NULL, 0UL, LOG_EMERG, 1, 27);
goto finished;
@@ -4480,7 +4470,7 @@ outer_allocate_resources(void)
i_c_unix = dk4sto_it_open(s_c_unix, NULL);
if (NULL == i_c_unix) {
-#line 3991 "printqd.ctr"
+#line 4003 "printqd.ctr"
/* ERROR: Memory */
log_1(NULL, 0UL, LOG_EMERG, 1, 27);
goto finished;
@@ -4488,7 +4478,7 @@ outer_allocate_resources(void)
s_c_tcp = dk4sto_open(NULL);
if (NULL == s_c_tcp) {
-#line 3997 "printqd.ctr"
+#line 4009 "printqd.ctr"
/* ERROR: Memory */
log_1(NULL, 0UL, LOG_EMERG, 1, 27);
goto finished;
@@ -4497,7 +4487,7 @@ outer_allocate_resources(void)
i_c_tcp = dk4sto_it_open(s_c_tcp, NULL);
if (NULL == i_c_tcp) {
-#line 4004 "printqd.ctr"
+#line 4016 "printqd.ctr"
/* ERROR: Memory */
log_1(NULL, 0UL, LOG_EMERG, 1, 27);
goto finished;
@@ -4510,7 +4500,7 @@ outer_allocate_resources(void)
finished:
-#line 4015 "printqd.ctr"
+#line 4027 "printqd.ctr"
return back;
}
@@ -4526,7 +4516,7 @@ outer_release_resources(void)
pqd_l_conn_t *plc;
-#line 4029 "printqd.ctr"
+#line 4041 "printqd.ctr"
if (NULL != i_c_tcp) {
dk4sto_it_reset(i_c_tcp);
@@ -4568,7 +4558,7 @@ outer_release_resources(void)
s_c_unix = NULL;
-#line 4069 "printqd.ctr"
+#line 4081 "printqd.ctr"
}
@@ -4628,7 +4618,7 @@ inner_allocate_resources(void)
int back = 0;
-#line 4127 "printqd.ctr"
+#line 4139 "printqd.ctr"
/* Log file directory hierarchy.
*/
@@ -4641,7 +4631,7 @@ inner_allocate_resources(void)
}
if (0 == res) {
-#line 4138 "printqd.ctr"
+#line 4150 "printqd.ctr"
/* ERROR: Failed to create directory hierachy for log file */
log_3(NULL, 0UL, LOG_EMERG, 1, 95, 96, fn);
goto finished;
@@ -4659,7 +4649,7 @@ inner_allocate_resources(void)
}
if (0 == res) {
-#line 4154 "printqd.ctr"
+#line 4166 "printqd.ctr"
/* ERROR: Failed to create directory hierarchy for db file */
log_3(NULL, 0UL, LOG_EMERG, 1, 97, 98, fn);
goto finished;
@@ -4685,7 +4675,7 @@ inner_allocate_resources(void)
}
if (0 == res) {
-#line 4178 "printqd.ctr"
+#line 4190 "printqd.ctr"
/* ERROR: Failed to create directory hierarchy for socket */
log_3(NULL, 0UL, LOG_EMERG, 1, 99, 100, fn);
goto finished;
@@ -4697,7 +4687,7 @@ inner_allocate_resources(void)
if (NULL == fn) { fn = def_sock_file_name; }
-#line 4188 "printqd.ctr"
+#line 4200 "printqd.ctr"
dk4error_init(&er);
if (
((0 != sockuid) || (0 != sockgid))
@@ -4714,7 +4704,7 @@ inner_allocate_resources(void)
}
if (INVALID_SOCKET == so_unix) {
-#line 4203 "printqd.ctr"
+#line 4215 "printqd.ctr"
/* ERROR: Failed to create listener socket */
res = dk4ma_write_c8_decimal_signed(
necbuf, sizeof(necbuf), (dk4_im_t)(er.dt.iDetails1), 0, NULL
@@ -4755,7 +4745,7 @@ inner_allocate_resources(void)
goto finished;
}
-#line 4242 "printqd.ctr"
+#line 4254 "printqd.ctr"
/* TCP listener socket set.
*/
@@ -4766,7 +4756,7 @@ inner_allocate_resources(void)
);
if (NULL == ss_tcp) {
-#line 4251 "printqd.ctr"
+#line 4263 "printqd.ctr"
/* ERROR: Failed to create TCP listener socket */
res = dk4ma_write_c8_decimal_signed(
necbuf, sizeof(necbuf), (dk4_im_t)(er.dt.iDetails1), 0, NULL
@@ -4809,7 +4799,7 @@ inner_allocate_resources(void)
ss_udp = dk4socket_c8_set_udp(conf.pudp, 0, 0, &er);
if (NULL == ss_udp) {
-#line 4292 "printqd.ctr"
+#line 4304 "printqd.ctr"
/* ERROR: Failed to create UDP socket set */
res = dk4ma_write_c8_decimal_signed(
necbuf, sizeof(necbuf), (dk4_im_t)(er.dt.iDetails1), 0, NULL
@@ -4846,12 +4836,12 @@ inner_allocate_resources(void)
if (NULL == fn) { fn = def_db_file_name; }
-#line 4327 "printqd.ctr"
+#line 4339 "printqd.ctr"
dk4error_init(&er);
db = dk4dbi_open(fn, 1, 0, 1024, 1024, &er);
if (NULL != db) {
-#line 4330 "printqd.ctr"
+#line 4342 "printqd.ctr"
db_modified = 0;
res = 1;
dk4error_init(&er);
@@ -4862,23 +4852,23 @@ inner_allocate_resources(void)
if (0 != res) {
-#line 4339 "printqd.ctr"
+#line 4351 "printqd.ctr"
dk4error_init(&er);
db = dk4dbi_open(fn, 1, 0, 1024, 1024, &er);
if (NULL != db) {
-#line 4342 "printqd.ctr"
+#line 4354 "printqd.ctr"
db_modified = 0;
} else {
-#line 4344 "printqd.ctr"
+#line 4356 "printqd.ctr"
/* ERROR: Failed to open database */
pqd_dbi_open_error(fn, &er);
goto finished;
}
} else {
-#line 4349 "printqd.ctr"
+#line 4361 "printqd.ctr"
/* ERROR: Failed to write initial entry to database */
log_1(NULL, 0UL, LOG_EMERG, 1, 107);
switch (er.ec) {
@@ -4911,7 +4901,7 @@ inner_allocate_resources(void)
}
} else {
-#line 4380 "printqd.ctr"
+#line 4392 "printqd.ctr"
/* ERROR: Failed to open database */
pqd_dbi_open_error(fn, &er);
goto finished;
@@ -4924,7 +4914,7 @@ inner_allocate_resources(void)
finished:
-#line 4391 "printqd.ctr"
+#line 4403 "printqd.ctr"
return back;
}
@@ -4943,14 +4933,14 @@ inner_release_resources(void)
int back = 1;
-#line 4408 "printqd.ctr"
+#line 4420 "printqd.ctr"
/* Database
*/
if (NULL != db) {
if (0 == dk4dbi_close(db, NULL)) {
-#line 4413 "printqd.ctr"
+#line 4425 "printqd.ctr"
/* ERROR: Failed to synchronize database to disk */
log_1(NULL, 0UL, LOG_EMERG, 1, 108);
back = 0;
@@ -4963,7 +4953,7 @@ inner_release_resources(void)
*/
if (NULL != ss_udp) {
-#line 4424 "printqd.ctr"
+#line 4436 "printqd.ctr"
dk4socket_set_close(ss_udp, NULL);
}
ss_udp = NULL;
@@ -4972,7 +4962,7 @@ inner_release_resources(void)
*/
if (NULL != ss_tcp) {
-#line 4431 "printqd.ctr"
+#line 4443 "printqd.ctr"
dk4socket_set_close(ss_tcp, NULL);
}
ss_tcp = NULL;
@@ -4987,7 +4977,7 @@ inner_release_resources(void)
-#line 4444 "printqd.ctr"
+#line 4456 "printqd.ctr"
return back;
}
@@ -5001,26 +4991,29 @@ int
change_group_and_user(void)
{
const char *fn = NULL;
+#if (!(DK4_HAVE_SETGROUPS)) && DK4_HAVE_INITGROUPS && DK4_HAVE_GETPWUID
+ struct pwent *pw;
+#endif
uid_t myuid;
gid_t mygid;
int dbt = DK4_DB_BE_UNKNOWN;
int back = 1;
-#line 4462 "printqd.ctr"
+#line 4477 "printqd.ctr"
if (0 != user_switched) {
-#line 4463 "printqd.ctr"
+#line 4478 "printqd.ctr"
if (conf.uid != prev_uid) {
back = 0;
-#line 4465 "printqd.ctr"
+#line 4480 "printqd.ctr"
/* ERROR: User to run as was changed */
log_1(NULL, 0UL, LOG_EMERG, 1, 66);
} else {
if (conf.gid != prev_gid) {
-#line 4469 "printqd.ctr"
+#line 4484 "printqd.ctr"
back = 0;
/* ERROR: Group to run as was changed */
log_1(NULL, 0UL, LOG_EMERG, 1, 67);
@@ -5028,13 +5021,13 @@ change_group_and_user(void)
}
} else {
-#line 4475 "printqd.ctr"
+#line 4490 "printqd.ctr"
user_switched = 1;
myuid = geteuid();
mygid = getegid();
if ((myuid != conf.uid) || (mygid != conf.gid)) {
-#line 4479 "printqd.ctr"
+#line 4494 "printqd.ctr"
/*
PID file ownership and permissions
*/
@@ -5056,14 +5049,14 @@ change_group_and_user(void)
if (0 != chown(fn, conf.uid, conf.gid)) {
back = 0;
-#line 4499 "printqd.ctr"
+#line 4514 "printqd.ctr"
/* ERROR: Failed to change log file ownership */
log_1(NULL, 0UL, LOG_EMERG, 1, 109);
}
if (0 != chmod(fn, 0660)) {
back = 0;
-#line 4504 "printqd.ctr"
+#line 4519 "printqd.ctr"
/* ERROR: Failed to change log file permissions */
log_1(NULL, 0UL, LOG_EMERG, 1, 110);
}
@@ -5073,7 +5066,7 @@ change_group_and_user(void)
if (0 == dk4dbi_change_owner_and_mode(db,conf.uid,conf.gid,0660,NULL)) {
back = 0;
-#line 4512 "printqd.ctr"
+#line 4527 "printqd.ctr"
/* ERROR: failed to change db ownership and permissions */
log_1(NULL, 0UL, LOG_EMERG, 1, 111);
}
@@ -5081,10 +5074,10 @@ change_group_and_user(void)
case DK4_DB_BE_BDB : case DK4_DB_BE_NDBM : {
-#line 4518 "printqd.ctr"
+#line 4533 "printqd.ctr"
if (0 == dk4dbi_close(db, NULL)) {
-#line 4519 "printqd.ctr"
+#line 4534 "printqd.ctr"
/* ERROR: Failed to synchronize database to disk */
log_1(NULL, 0UL, LOG_EMERG, 1, 121);
}
@@ -5109,57 +5102,83 @@ change_group_and_user(void)
*/
if (INVALID_SOCKET != so_unix) {
-#line 4542 "printqd.ctr"
+#line 4557 "printqd.ctr"
-#line 4543 "printqd.ctr"
+#line 4558 "printqd.ctr"
if (0 != fchown(so_unix, conf.uid, conf.gid)) {
back = 0;
-#line 4545 "printqd.ctr"
+#line 4560 "printqd.ctr"
/* ERROR: Failed to change socket ownership */
log_1(NULL, 0UL, LOG_EMERG, 1, 112);
}
-#line 4549 "printqd.ctr"
+#line 4564 "printqd.ctr"
if (0 != fchmod(so_unix, 0660)) {
back = 0;
-#line 4551 "printqd.ctr"
+#line 4566 "printqd.ctr"
/* ERROR: Failed to change socket permissions */
log_1(NULL, 0UL, LOG_EMERG, 1, 113);
}
} else {
-#line 4555 "printqd.ctr"
+#line 4570 "printqd.ctr"
}
+#if DK4_HAVE_SETGROUPS
+ if (0 != setgroups(1, &(conf.gid))) {
+ back = 0;
+
+#line 4574 "printqd.ctr"
+ log_1(NULL, 0UL, LOG_EMERG, 1, 114);
+ }
+#else
+#if DK4_HAVE_INITGROUPS && DK4_HAVE_GETPWUID
+ pw = getpwuid(myuid);
+ if (NULL != pw) {
+ if (NULL != pw->pw_name) {
+ if (0 != initgroups(pw->pw_name, conf.gid)) {
+ back = 0;
+
+#line 4583 "printqd.ctr"
+ log_1(NULL, 0UL, LOG_EMERG, 1, 114);
+ }
+ }
+ }
+#endif
+#endif
/*
Switch group
*/
- if (0 != setgid(conf.gid)) {
- back = 0;
+ if (mygid != conf.gid) {
+ if (0 != setgid(conf.gid)) {
+ back = 0;
-#line 4561 "printqd.ctr"
- /* ERROR: Failed to switch group */
- log_1(NULL, 0UL, LOG_EMERG, 1, 114);
+#line 4595 "printqd.ctr"
+ /* ERROR: Failed to switch group */
+ log_1(NULL, 0UL, LOG_EMERG, 1, 114);
+ }
}
/*
Switch user
*/
- if (0 != setuid(conf.uid)) {
- back = 0;
+ if (myuid != conf.uid) {
+ if (0 != setuid(conf.uid)) {
+ back = 0;
-#line 4569 "printqd.ctr"
- /* ERROR: Failed to switch user */
- log_1(NULL, 0UL, LOG_EMERG, 1, 115);
+#line 4605 "printqd.ctr"
+ /* ERROR: Failed to switch user */
+ log_1(NULL, 0UL, LOG_EMERG, 1, 115);
+ }
}
/*
Re-open database if closed.
*/
if (NULL == db) {
-#line 4576 "printqd.ctr"
+#line 4613 "printqd.ctr"
fn = conf.dname;
if (NULL == fn) { fn = def_db_file_name; }
db = dk4dbi_open(fn, 1, 0, 1024, 1024, NULL);
@@ -5167,7 +5186,7 @@ change_group_and_user(void)
db_modified = 0;
} else {
-#line 4582 "printqd.ctr"
+#line 4619 "printqd.ctr"
back = 0;
/* ERROR: Failed to open database */
log_3(NULL, 0UL, LOG_EMERG, 1, 105, 106, fn);
@@ -5175,12 +5194,12 @@ change_group_and_user(void)
}
} else {
-#line 4588 "printqd.ctr"
+#line 4625 "printqd.ctr"
}
}
-#line 4591 "printqd.ctr"
+#line 4628 "printqd.ctr"
return back;
}
@@ -5193,7 +5212,7 @@ protocol_level_for_address(struct sockaddr *so)
int back = PQD_PROTO_NONE;
-#line 4602 "printqd.ctr"
+#line 4639 "printqd.ctr"
if (0 != conf.aglo) {
back = PQD_PROTO_ADMIN;
} else {
@@ -5219,7 +5238,7 @@ protocol_level_for_address(struct sockaddr *so)
}
-#line 4626 "printqd.ctr"
+#line 4663 "printqd.ctr"
return back;
}
@@ -5237,7 +5256,7 @@ protocol_level_check(int act, int protlev)
int back = 0;
-#line 4642 "printqd.ctr"
+#line 4679 "printqd.ctr"
switch (act) {
case PQD_CMD_INFO : {
if (PQD_PROTO_INFO <= protlev) { back = 1; }
@@ -5251,7 +5270,7 @@ protocol_level_check(int act, int protlev)
}
-#line 4654 "printqd.ctr"
+#line 4691 "printqd.ctr"
return back;
}
@@ -5263,7 +5282,7 @@ job_init(pqd_rq_t *ptr)
{
-#line 4664 "printqd.ctr"
+#line 4701 "printqd.ctr"
DK4_MEMRES(ptr, sizeof(pqd_rq_t));
ptr->connptr = NULL;
ptr->sto = NULL;
@@ -5278,7 +5297,7 @@ job_init(pqd_rq_t *ptr)
ptr->logthis = 1;
-#line 4677 "printqd.ctr"
+#line 4714 "printqd.ctr"
}
@@ -5289,7 +5308,7 @@ account_init(pqd_account_t *ptr)
{
-#line 4686 "printqd.ctr"
+#line 4723 "printqd.ctr"
DK4_MEMRES(ptr, sizeof(pqd_account_t));
ptr->limit = (dk4_um_t)0UL;
ptr->used = (dk4_um_t)0UL;
@@ -5297,7 +5316,7 @@ account_init(pqd_account_t *ptr)
ptr->da = 0;
-#line 4692 "printqd.ctr"
+#line 4729 "printqd.ctr"
}
@@ -5319,7 +5338,7 @@ close_stream_conn(
{
-#line 4712 "printqd.ctr"
+#line 4749 "printqd.ctr"
if ((NULL != sto) && (NULL != ptr)) {
dk4sto_remove(sto, ptr, NULL);
}
@@ -5336,7 +5355,7 @@ close_stream_conn(
}
-#line 4727 "printqd.ctr"
+#line 4764 "printqd.ctr"
}
@@ -5355,7 +5374,7 @@ send_text(pqd_rq_t *job, const char *str)
int res; /* Operation result */
-#line 4744 "printqd.ctr"
+#line 4781 "printqd.ctr"
if (0 != dk4str8_cpy_s(inbuf, sizeof(inbuf), str, NULL)) {
if (0 != job->logthis) {
msgs[0] = printqd_kw[86];
@@ -5368,45 +5387,45 @@ send_text(pqd_rq_t *job, const char *str)
wr = sz;
if ((NULL != job->soa) && (0 < job->szsoa)) {
-#line 4755 "printqd.ctr"
+#line 4792 "printqd.ctr"
(void)dk4socket_sendto(
job->sock, inbuf, &wr, 0, job->soa, job->szsoa, 0L, 0L, NULL
);
} else {
-#line 4759 "printqd.ctr"
+#line 4796 "printqd.ctr"
res = dk4socket_send(job->sock, inbuf, &wr, 0, 0L, 0L, NULL);
switch (res) {
case DK4_SOCKET_RESULT_SUCCESS :
case DK4_SOCKET_RESULT_IN_PROGRESS : {
if (wr != sz) {
-#line 4764 "printqd.ctr"
+#line 4801 "printqd.ctr"
res = DK4_SOCKET_RESULT_FAILED;
}
} break;
}
if (DK4_SOCKET_RESULT_FAILED == res) {
-#line 4769 "printqd.ctr"
+#line 4806 "printqd.ctr"
close_stream_conn(job->sock, job->sto, job->connptr, job->pnconn);
}
}
} else {
-#line 4773 "printqd.ctr"
+#line 4810 "printqd.ctr"
/* ERROR: Response text too long (BUG)! */
log_1(NULL, 0UL, LOG_EMERG, 1, 116);
}
} else {
-#line 4777 "printqd.ctr"
+#line 4814 "printqd.ctr"
/* ERROR: Response text too long (BUG)! */
log_1(NULL, 0UL, LOG_EMERG, 1, 116);
}
-#line 4781 "printqd.ctr"
+#line 4818 "printqd.ctr"
}
@@ -5431,7 +5450,7 @@ send_response(
int ok = 0;
-#line 4804 "printqd.ctr"
+#line 4841 "printqd.ctr"
switch (how) {
case 0: {
/* Limit Used Account Summary */
@@ -5501,7 +5520,7 @@ send_response(
}
-#line 4872 "printqd.ctr"
+#line 4909 "printqd.ctr"
}
@@ -5518,7 +5537,7 @@ get_printer_for_name(const char *name)
pqd_printer_alias_t *al = NULL;
-#line 4887 "printqd.ctr"
+#line 4924 "printqd.ctr"
back = (pqd_printer_t *)dk4sto_it_find_like(conf.i_p, name, 1);
if (NULL == back) {
al = (pqd_printer_alias_t *)dk4sto_it_find_like(conf.i_a, name, 1);
@@ -5528,7 +5547,7 @@ get_printer_for_name(const char *name)
}
-#line 4895 "printqd.ctr"
+#line 4932 "printqd.ctr"
return back;
}
@@ -5554,7 +5573,7 @@ save_one_number(
int strok = 0;
-#line 4919 "printqd.ctr"
+#line 4956 "printqd.ctr"
if (0 != dk4str8_cpy_s(kb, sizeof(kb), printqd_kw[kwi], NULL)) {
if (0 != dk4str8_cat_s(kb, sizeof(kb), cn, NULL)) {
if (0 != dk4str8_cat_s(kb, sizeof(kb), printqd_kw[8], NULL)) {
@@ -5564,15 +5583,15 @@ save_one_number(
strok = 1;
-#line 4927 "printqd.ctr"
+#line 4964 "printqd.ctr"
if (0 != dbi_set(db, kb, vb, NULL)) {
-#line 4928 "printqd.ctr"
+#line 4965 "printqd.ctr"
back = 1;
}
else {
-#line 4931 "printqd.ctr"
+#line 4968 "printqd.ctr"
/* ERROR: Failed to set DB entry */
log_1(NULL, 0UL, LOG_EMERG, 1, 117);
}
@@ -5580,21 +5599,21 @@ save_one_number(
#if TRACE_DEBUG
else {
-#line 4937 "printqd.ctr"
+#line 4974 "printqd.ctr"
}
#endif
} else {
strok = 1;
-#line 4942 "printqd.ctr"
+#line 4979 "printqd.ctr"
if (0 != dbi_del(db, kb, NULL)) {
-#line 4943 "printqd.ctr"
+#line 4980 "printqd.ctr"
back = 1;
} else {
-#line 4945 "printqd.ctr"
+#line 4982 "printqd.ctr"
/* ERROR: Failed to delete DB entry */
log_1(NULL, 0UL, LOG_EMERG, 1, 118);
}
@@ -5608,7 +5627,7 @@ save_one_number(
}
-#line 4957 "printqd.ctr"
+#line 4994 "printqd.ctr"
return back;
}
@@ -5634,7 +5653,7 @@ save_account_for_user_and_class(
int back = 1;
-#line 4981 "printqd.ctr"
+#line 5018 "printqd.ctr"
mustsave = 1;
if (NULL != oldacc) {
if (oldacc->used == newacc->used) {
@@ -5643,7 +5662,7 @@ save_account_for_user_and_class(
}
if (0 != mustsave) {
-#line 4988 "printqd.ctr"
+#line 5025 "printqd.ctr"
if (0 == save_one_number(88, un, cl->name, newacc->used)) {
back = 0;
}
@@ -5656,14 +5675,14 @@ save_account_for_user_and_class(
}
if (0 != mustsave) {
-#line 4999 "printqd.ctr"
+#line 5036 "printqd.ctr"
if (0 == save_one_number(89, un, cl->name, newacc->account)) {
back = 0;
}
}
-#line 5004 "printqd.ctr"
+#line 5041 "printqd.ctr"
return back;
}
@@ -5696,7 +5715,7 @@ retrieve_account_for_user_and_class(
int back = 0;
-#line 5035 "printqd.ctr"
+#line 5072 "printqd.ctr"
/*
Check arguments
*/
@@ -5725,7 +5744,7 @@ retrieve_account_for_user_and_class(
if (0 != dk4str8_cat_s(kb, sizeof(kb), un, NULL)) {
-#line 5062 "printqd.ctr"
+#line 5099 "printqd.ctr"
if (0 != dbi_get(db, kb, vb, sizeof(vb), NULL)) {
if (0 != dk4ma_input_c8_dec_dk4_um_t(&um, vb, &ep, 1, NULL)) {
account->used = um;
@@ -5733,14 +5752,14 @@ retrieve_account_for_user_and_class(
#if TRACE_DEBUG
else {
-#line 5068 "printqd.ctr"
+#line 5105 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 5073 "printqd.ctr"
+#line 5110 "printqd.ctr"
}
#endif
}
@@ -5756,7 +5775,7 @@ retrieve_account_for_user_and_class(
if (0 != dk4str8_cat_s(kb, sizeof(kb), un, NULL)) {
-#line 5087 "printqd.ctr"
+#line 5124 "printqd.ctr"
if (0 != dbi_get(db, kb, vb, sizeof(vb), NULL)) {
um = (dk4_um_t)0UL; ep = NULL;
if (0 != dk4ma_input_c8_dec_dk4_um_t(&um, vb, &ep, 1, NULL)) {
@@ -5765,14 +5784,14 @@ retrieve_account_for_user_and_class(
#if TRACE_DEBUG
else {
-#line 5094 "printqd.ctr"
+#line 5131 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 5099 "printqd.ctr"
+#line 5136 "printqd.ctr"
}
#endif
}
@@ -5784,11 +5803,11 @@ retrieve_account_for_user_and_class(
*/
-#line 5109 "printqd.ctr"
+#line 5146 "printqd.ctr"
lim = (pqd_limit_t *)dk4sto_it_find_like(cl->i_u, un, 1);
if (NULL != lim) {
-#line 5111 "printqd.ctr"
+#line 5148 "printqd.ctr"
account->limit = lim->limit;
back = 1;
goto finished;
@@ -5798,46 +5817,46 @@ retrieve_account_for_user_and_class(
*/
-#line 5119 "printqd.ctr"
+#line 5156 "printqd.ctr"
pw = getpwnam(un);
if (NULL != pw) {
-#line 5121 "printqd.ctr"
+#line 5158 "printqd.ctr"
pg = pw->pw_gid;
dk4sto_it_reset(cl->i_g);
do {
-#line 5125 "printqd.ctr"
- lim = dk4sto_it_next(cl->i_g);
+#line 5162 "printqd.ctr"
+ lim = (pqd_limit_t *)dk4sto_it_next(cl->i_g);
if (NULL != lim) {
-#line 5127 "printqd.ctr"
+#line 5164 "printqd.ctr"
if (lim->limit > account->limit) {
-#line 5128 "printqd.ctr"
+#line 5165 "printqd.ctr"
-#line 5129 "printqd.ctr"
+#line 5166 "printqd.ctr"
gr = getgrnam(lim->name);
if (NULL != gr) {
-#line 5131 "printqd.ctr"
+#line 5168 "printqd.ctr"
if (pg == gr->gr_gid) {
-#line 5132 "printqd.ctr"
+#line 5169 "printqd.ctr"
account->limit = lim->limit;
back = 1;
} else {
-#line 5135 "printqd.ctr"
+#line 5172 "printqd.ctr"
if (NULL != gr->gr_mem) {
grmem = gr->gr_mem;
ingr = 0;
while ((0 == ingr) && (NULL != *grmem)) {
-#line 5140 "printqd.ctr"
+#line 5177 "printqd.ctr"
if (0 == strcmp(un, *grmem)) {
ingr = 1;
}
@@ -5845,21 +5864,21 @@ retrieve_account_for_user_and_class(
}
if (0 != ingr) {
-#line 5146 "printqd.ctr"
+#line 5183 "printqd.ctr"
account->limit = lim->limit;
back = 1;
}
#if TRACE_DEBUG
else {
-#line 5151 "printqd.ctr"
+#line 5188 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 5156 "printqd.ctr"
+#line 5193 "printqd.ctr"
}
#endif
}
@@ -5867,7 +5886,7 @@ retrieve_account_for_user_and_class(
#if TRACE_DEBUG
else {
-#line 5162 "printqd.ctr"
+#line 5199 "printqd.ctr"
}
#endif
}
@@ -5875,12 +5894,12 @@ retrieve_account_for_user_and_class(
#if TRACE_DEBUG
else {
-#line 5168 "printqd.ctr"
+#line 5205 "printqd.ctr"
}
#endif
-#line 5171 "printqd.ctr"
+#line 5208 "printqd.ctr"
} while(NULL != lim);
if (0 != back) {
goto finished;
@@ -5889,7 +5908,7 @@ retrieve_account_for_user_and_class(
#if TRACE_DEBUG
else {
-#line 5178 "printqd.ctr"
+#line 5215 "printqd.ctr"
}
#endif
/*
@@ -5897,14 +5916,14 @@ retrieve_account_for_user_and_class(
*/
-#line 5184 "printqd.ctr"
+#line 5221 "printqd.ctr"
account->limit = cl->dl;
back = 1;
finished:
-#line 5189 "printqd.ctr"
+#line 5226 "printqd.ctr"
return back;
}
@@ -5930,7 +5949,7 @@ retrieve_account_data(
int back = 0;
-#line 5213 "printqd.ctr"
+#line 5250 "printqd.ctr"
/*
Initialize account data
*/
@@ -5941,7 +5960,7 @@ retrieve_account_data(
pr = get_printer_for_name(printer_name);
if (NULL == pr) {
-#line 5222 "printqd.ctr"
+#line 5259 "printqd.ctr"
goto finished;
}
/*
@@ -5950,12 +5969,12 @@ retrieve_account_data(
cl = pr->cl;
if (NULL == cl) {
-#line 5229 "printqd.ctr"
+#line 5266 "printqd.ctr"
goto finished;
}
if (NULL == cl->name) {
-#line 5232 "printqd.ctr"
+#line 5269 "printqd.ctr"
goto finished;
}
/*
@@ -5968,7 +5987,7 @@ retrieve_account_data(
finished:
-#line 5243 "printqd.ctr"
+#line 5280 "printqd.ctr"
return back;
}
@@ -6001,6 +6020,7 @@ account_add_pages_from_job(pqd_account_t *account, dk4_um_t pages)
if ((dk4_um_t)0UL < pages) {
if (account->account >= pages) {
account->account -= pages;
+ pages = (dk4_um_t)0UL;
} else {
pages -= account->account;
account->account = (dk4_um_t)0UL;
@@ -6032,27 +6052,27 @@ account_summary(dk4_um_t limit, dk4_um_t used, dk4_um_t account)
int back = 0;
-#line 5305 "printqd.ctr"
+#line 5343 "printqd.ctr"
if (DK4_UM_MAX == limit) {
-#line 5306 "printqd.ctr"
+#line 5344 "printqd.ctr"
back = 1;
} else {
if (used < limit) {
-#line 5309 "printqd.ctr"
+#line 5347 "printqd.ctr"
back = 1;
} else {
if ((dk4_um_t)0UL < account) {
-#line 5312 "printqd.ctr"
+#line 5350 "printqd.ctr"
back = 1;
}
}
}
-#line 5317 "printqd.ctr"
+#line 5355 "printqd.ctr"
return back;
}
@@ -6072,7 +6092,7 @@ rq_retrieve_data(pqd_rq_t *job, int how)
int summary = 0;
-#line 5335 "printqd.ctr"
+#line 5373 "printqd.ctr"
printer_name = job->argptr;
if (NULL != printer_name) {
user_name = dk4str8_next(printer_name, NULL);
@@ -6100,7 +6120,7 @@ rq_retrieve_data(pqd_rq_t *job, int how)
}
-#line 5361 "printqd.ctr"
+#line 5399 "printqd.ctr"
}
@@ -6114,11 +6134,11 @@ rq_info(pqd_rq_t *job)
{
-#line 5373 "printqd.ctr"
+#line 5411 "printqd.ctr"
rq_retrieve_data(job, 0);
-#line 5375 "printqd.ctr"
+#line 5413 "printqd.ctr"
}
@@ -6135,7 +6155,7 @@ lprng_final_quote(char *str, char quote)
char *back = NULL;
-#line 5390 "printqd.ctr"
+#line 5428 "printqd.ctr"
while (('\0' != *str) && (NULL == back)) {
if (quote == *str) {
*str = '\0';
@@ -6157,7 +6177,7 @@ lprng_final_quote(char *str, char quote)
}
-#line 5410 "printqd.ctr"
+#line 5448 "printqd.ctr"
return back;
}
@@ -6174,7 +6194,7 @@ lprng_next_word(char *str)
char *back = NULL;
-#line 5425 "printqd.ctr"
+#line 5463 "printqd.ctr"
switch (*str) {
case '\'' : {
back = lprng_final_quote(&(str[1]), '\'');
@@ -6187,7 +6207,7 @@ lprng_next_word(char *str)
} break;
}
-#line 5436 "printqd.ctr"
+#line 5474 "printqd.ctr"
return back;
}
@@ -6206,7 +6226,7 @@ lprng_info_from_line(lprng_info_t *liptr, char *textline)
int back = 1;
-#line 5453 "printqd.ctr"
+#line 5491 "printqd.ctr"
DK4_MEMRES(liptr, sizeof(lprng_info_t));
liptr->username = NULL; liptr->queuename = NULL;
liptr->jobtitle = NULL; liptr->pagecount = NULL;
@@ -6233,7 +6253,7 @@ lprng_info_from_line(lprng_info_t *liptr, char *textline)
}
} else {
-#line 5478 "printqd.ctr"
+#line 5516 "printqd.ctr"
#if 0
/* 2016-02-15 Simply ignore non-option text.
*/
@@ -6245,7 +6265,7 @@ lprng_info_from_line(lprng_info_t *liptr, char *textline)
}
-#line 5488 "printqd.ctr"
+#line 5526 "printqd.ctr"
return back;
}
@@ -6265,7 +6285,7 @@ rq_jobstart(pqd_rq_t *job)
int summ = 0;
-#line 5506 "printqd.ctr"
+#line 5544 "printqd.ctr"
if (0 != lprng_info_from_line(&lpi, job->argptr)) {
un = lpi.username; qn = lpi.queuename;
}
@@ -6283,7 +6303,7 @@ rq_jobstart(pqd_rq_t *job)
}
-#line 5522 "printqd.ctr"
+#line 5560 "printqd.ctr"
}
@@ -6382,7 +6402,6 @@ log_old_and_new_account(
/** Charge user for a print job.
- @param job Job structure.
@param un User name.
@param cl Printer class of printer the job was printed on.
@param pcval Number of pages in print job.
@@ -6390,7 +6409,6 @@ log_old_and_new_account(
static
void
do_charge(
- pqd_rq_t *job,
const char *un,
pqd_class_t *cl,
dk4_um_t pcval
@@ -6400,7 +6418,7 @@ do_charge(
pqd_account_t newacc;
-#line 5637 "printqd.ctr"
+#line 5673 "printqd.ctr"
if (0 != retrieve_account_for_user_and_class(&oldacc, un, cl, 1)) {
DK4_MEMCPY(&newacc, &oldacc, sizeof(pqd_account_t));
account_add_pages_from_job(&newacc, pcval);
@@ -6408,7 +6426,7 @@ do_charge(
if (0 == save_account_for_user_and_class(&oldacc, &newacc, un, cl)) {
-#line 5643 "printqd.ctr"
+#line 5679 "printqd.ctr"
/* ERROR: Failed to update account data */
log_5(NULL, 0UL, LOG_EMERG, 1, 156, 157, 158, un, cl->name);
}
@@ -6416,12 +6434,12 @@ do_charge(
#if TRACE_DEBUG
else {
-#line 5649 "printqd.ctr"
+#line 5685 "printqd.ctr"
}
#endif
-#line 5652 "printqd.ctr"
+#line 5688 "printqd.ctr"
}
@@ -6451,7 +6469,7 @@ do_filestart(
int res = 0;
-#line 5680 "printqd.ctr"
+#line 5716 "printqd.ctr"
pr = get_printer_for_name(pn);
if (NULL != pr) {
cl = pr->cl;
@@ -6462,7 +6480,7 @@ do_filestart(
if ((NULL != pr) && (NULL != cl) && (0 != res)) {
-#line 5689 "printqd.ctr"
+#line 5725 "printqd.ctr"
if (0 == dk4str8_cpy_s(kb, sizeof(kb), printqd_kw[90], NULL)) { res = 0; }
if (0 == dk4str8_cat_s(kb, sizeof(kb), pr->name, NULL)) { res = 0; }
if (0 == dk4str8_cpy_s(vb, sizeof(vb), pc, NULL)) { res = 0; }
@@ -6472,10 +6490,10 @@ do_filestart(
if (0 == dk4str8_cat_s(vb, sizeof(vb), jn, NULL)) { res = 0; }
if (0 != res) {
-#line 5697 "printqd.ctr"
+#line 5733 "printqd.ctr"
if (0 == dbi_set(db, kb, vb, NULL)) {
-#line 5698 "printqd.ctr"
+#line 5734 "printqd.ctr"
/* ERROR: Failed to set database entry */
log_1(NULL, 0UL, LOG_EMERG, 1, 117);
}
@@ -6483,12 +6501,12 @@ do_filestart(
#if TRACE_DEBUG
else {
-#line 5704 "printqd.ctr"
+#line 5740 "printqd.ctr"
}
#endif
} else {
-#line 5707 "printqd.ctr"
+#line 5743 "printqd.ctr"
/* Close connection on malformed request
*/
if ((NULL == job->soa) && (0 == job->szsoa)) {
@@ -6497,7 +6515,7 @@ do_filestart(
}
-#line 5714 "printqd.ctr"
+#line 5750 "printqd.ctr"
}
@@ -6532,7 +6550,7 @@ do_fileend(
-#line 5747 "printqd.ctr"
+#line 5783 "printqd.ctr"
pr = get_printer_for_name(pn);
if (NULL != pr) {
cl = pr->cl;
@@ -6545,18 +6563,18 @@ do_fileend(
if (0 == dk4str8_cat_s(kb, sizeof(kb), pr->name, NULL)) { res = 0; }
if (0 != res) {
-#line 5758 "printqd.ctr"
+#line 5794 "printqd.ctr"
if (0 != dbi_get(db, kb, vb, sizeof(vb), NULL)) {
-#line 5760 "printqd.ctr"
+#line 5796 "printqd.ctr"
if (0 == dbi_del(db, kb, NULL)) {
/* ERROR: Failed to delete db entry */
log_1(NULL, 0UL, LOG_EMERG, 1, 118);
}
-#line 5765 "printqd.ctr"
+#line 5801 "printqd.ctr"
opc = dk4str8_start(vb, NULL);
if (NULL != opc) {
oun = dk4str8_chr(opc, ':');
@@ -6575,13 +6593,13 @@ do_fileend(
if ((NULL != opc) && (NULL != oun) && (NULL != ojn)) {
-#line 5782 "printqd.ctr"
+#line 5818 "printqd.ctr"
-#line 5783 "printqd.ctr"
+#line 5819 "printqd.ctr"
-#line 5784 "printqd.ctr"
+#line 5820 "printqd.ctr"
if (0 == strcmp(ojn, jn)) {
if (0 == strcmp(oun, un)) {
ep = NULL;
@@ -6589,50 +6607,50 @@ do_fileend(
if (0 != res) {
if (pcend > pcstt) {
-#line 5790 "printqd.ctr"
- do_charge(job, un, cl, (pcend - pcstt));
+#line 5826 "printqd.ctr"
+ do_charge(un, cl, (pcend - pcstt));
}
#if TRACE_DEBUG
else {
-#line 5794 "printqd.ctr"
+#line 5830 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 5799 "printqd.ctr"
+#line 5835 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 5804 "printqd.ctr"
+#line 5840 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 5809 "printqd.ctr"
+#line 5845 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 5814 "printqd.ctr"
+#line 5850 "printqd.ctr"
}
#endif
}
else {
-#line 5818 "printqd.ctr"
+#line 5854 "printqd.ctr"
-#line 5819 "printqd.ctr"
+#line 5855 "printqd.ctr"
if (0 == dbi_del(db, kb, NULL)) {
/* ERROR: Failed to delete db entry */
log_1(NULL, 0UL, LOG_EMERG, 1, 118);
@@ -6642,12 +6660,12 @@ do_fileend(
#if TRACE_DEBUG
else {
-#line 5827 "printqd.ctr"
+#line 5863 "printqd.ctr"
}
#endif
} else {
-#line 5830 "printqd.ctr"
+#line 5866 "printqd.ctr"
/* Close connection on malformed request
*/
if ((NULL == job->soa) && (0 == job->szsoa)) {
@@ -6656,7 +6674,7 @@ do_fileend(
}
-#line 5837 "printqd.ctr"
+#line 5873 "printqd.ctr"
}
@@ -6675,7 +6693,7 @@ rq_filestart(pqd_rq_t *job)
char *pc = NULL;
-#line 5854 "printqd.ctr"
+#line 5890 "printqd.ctr"
if (0 != lprng_info_from_line(&lpi, job->argptr)) {
un = lpi.username; pn = lpi.queuename;
jn = lpi.jobtitle; pc = lpi.pagecount;
@@ -6691,7 +6709,7 @@ rq_filestart(pqd_rq_t *job)
}
-#line 5868 "printqd.ctr"
+#line 5904 "printqd.ctr"
}
@@ -6710,7 +6728,7 @@ rq_fileend(pqd_rq_t *job)
char *pc = NULL;
-#line 5885 "printqd.ctr"
+#line 5921 "printqd.ctr"
if (0 != lprng_info_from_line(&lpi, job->argptr)) {
un = lpi.username; pn = lpi.queuename;
jn = lpi.jobtitle; pc = lpi.pagecount;
@@ -6726,7 +6744,7 @@ rq_fileend(pqd_rq_t *job)
}
-#line 5899 "printqd.ctr"
+#line 5935 "printqd.ctr"
}
@@ -6740,11 +6758,11 @@ rq_acct_check(pqd_rq_t *job)
{
-#line 5911 "printqd.ctr"
+#line 5947 "printqd.ctr"
rq_retrieve_data(job, 1);
-#line 5913 "printqd.ctr"
+#line 5949 "printqd.ctr"
}
@@ -6762,7 +6780,7 @@ rq_acct_start(pqd_rq_t *job)
char *pc = NULL;
-#line 5929 "printqd.ctr"
+#line 5965 "printqd.ctr"
pn = job->argptr;
if (NULL != pn) {
un = dk4str8_next(pn, NULL);
@@ -6787,7 +6805,7 @@ rq_acct_start(pqd_rq_t *job)
}
-#line 5952 "printqd.ctr"
+#line 5988 "printqd.ctr"
}
@@ -6805,7 +6823,7 @@ rq_acct_end(pqd_rq_t *job)
char *pc = NULL;
-#line 5968 "printqd.ctr"
+#line 6004 "printqd.ctr"
pn = job->argptr;
if (NULL != pn) {
un = dk4str8_next(pn, NULL);
@@ -6830,7 +6848,7 @@ rq_acct_end(pqd_rq_t *job)
}
-#line 5991 "printqd.ctr"
+#line 6027 "printqd.ctr"
}
@@ -6851,7 +6869,7 @@ rq_acct_charge(pqd_rq_t *job)
dk4_um_t pcval = (dk4_um_t)0UL;
-#line 6010 "printqd.ctr"
+#line 6046 "printqd.ctr"
pn = job->argptr;
if (NULL != pn) {
un = dk4str8_next(pn, NULL);
@@ -6873,7 +6891,7 @@ rq_acct_charge(pqd_rq_t *job)
)
{
if (0 != dk4ma_input_c8_dec_dk4_um_t(&pcval, pc, &ep, 1, NULL)) {
- do_charge(job, un, cl, pcval);
+ do_charge(un, cl, pcval);
} else {
/* Close connection on malformed request
*/
@@ -6890,7 +6908,7 @@ rq_acct_charge(pqd_rq_t *job)
}
-#line 6047 "printqd.ctr"
+#line 6083 "printqd.ctr"
}
@@ -6914,9 +6932,10 @@ typedef struct {
*/
static
int
-db_entry_compare(const void *l, const void *r, int cr)
+db_entry_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
int back = 0;
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
back = strcmp((const char *)l, (const char *)r);
@@ -6944,7 +6963,7 @@ db_entry_compare(const void *l, const void *r, int cr)
*/
static
int
-rq_c_reset_traverse(void *obj, const char *k, const char *v)
+rq_c_reset_traverse(void *obj, const char *k, const char * DK4_ARG_UNUSED(v) )
{
pqd_control_t *ctoptr = NULL; /* Traversal object pointer */
char *p1 = NULL; /* DB entry type */
@@ -6955,7 +6974,8 @@ rq_c_reset_traverse(void *obj, const char *k, const char *v)
int back = 1;
-#line 6110 "printqd.ctr"
+#line 6147 "printqd.ctr"
+ DK4_UNUSED_ARG(v)
ctoptr = (pqd_control_t *)obj;
if (0 != dk4str8_cpy_s(kb, sizeof(kb), k, NULL)) {
p1 = dk4str8_start(kb, NULL);
@@ -6994,62 +7014,62 @@ rq_c_reset_traverse(void *obj, const char *k, const char *v)
if (0 == dk4sto_add(ctoptr->s, p1, NULL)) {
dk4mem_free(p1);
-#line 6147 "printqd.ctr"
+#line 6185 "printqd.ctr"
}
}
#if TRACE_DEBUG
else {
-#line 6151 "printqd.ctr"
+#line 6189 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 6156 "printqd.ctr"
+#line 6194 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 6161 "printqd.ctr"
+#line 6199 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 6166 "printqd.ctr"
+#line 6204 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 6171 "printqd.ctr"
+#line 6209 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 6176 "printqd.ctr"
+#line 6214 "printqd.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 6181 "printqd.ctr"
+#line 6219 "printqd.ctr"
}
#endif
}
if (0 == can_continue(0, 0)) { back = -1; }
-#line 6186 "printqd.ctr"
+#line 6224 "printqd.ctr"
return back;
}
@@ -7064,7 +7084,7 @@ rq_c_reset_traverse(void *obj, const char *k, const char *v)
*/
static
int
-rc_c_dbcl_traverse(void *obj, const char *k, const char *v)
+rc_c_dbcl_traverse(void *obj, const char *k, const char * DK4_ARG_UNUSED(v) )
{
pqd_control_t *pctobj;
pqd_class_t *cl;
@@ -7073,6 +7093,7 @@ rc_c_dbcl_traverse(void *obj, const char *k, const char *v)
int cdel = 0; /* Flag: Can delete item */
int back = 1;
+ DK4_UNUSED_ARG(v)
if (0 != dk4str8_cpy_s(kb, sizeof(kb), k, NULL)) {
if (0 != dk4str8_cpy_s(vb, sizeof(vb), k, NULL)) {
p1 = strchr(kb, ':');
@@ -7093,7 +7114,7 @@ rc_c_dbcl_traverse(void *obj, const char *k, const char *v)
if (NULL != p2) {
dk4str8_normalize(p1, NULL);
dk4str8_normalize(p2, NULL);
- cl = dk4sto_it_find_like(conf.i_c, p1, 1);
+ cl = (pqd_class_t *)dk4sto_it_find_like(conf.i_c, p1, 1);
if (NULL != cl) {
if (NULL == dk4sto_it_find_like(cl->i_u, p2, 1)) {
if (NULL == getpwnam(p2)) {
@@ -7155,7 +7176,7 @@ rq_c_reset(pqd_rq_t *job)
char *pv;
-#line 6290 "printqd.ctr"
+#line 6329 "printqd.ctr"
/* Initialize variable
*/
ctobj.s = NULL;
@@ -7169,7 +7190,7 @@ rq_c_reset(pqd_rq_t *job)
pn = dk4str8_next(pc, NULL);
-#line 6302 "printqd.ctr"
+#line 6341 "printqd.ctr"
pv = dk4str8_chr(pc, '=');
if (NULL != pv) {
*(pv++) = '\0';
@@ -7177,7 +7198,7 @@ rq_c_reset(pqd_rq_t *job)
}
-#line 6308 "printqd.ctr"
+#line 6347 "printqd.ctr"
if (NULL != pv) {
switch ( dk4str8_abbr_index(control_arg_names, '$', pc, 0) ) {
case 0 : {
@@ -7189,7 +7210,7 @@ rq_c_reset(pqd_rq_t *job)
default : {
-#line 6318 "printqd.ctr"
+#line 6357 "printqd.ctr"
} break;
}
}
@@ -7197,7 +7218,7 @@ rq_c_reset(pqd_rq_t *job)
}
-#line 6324 "printqd.ctr"
+#line 6363 "printqd.ctr"
if (NULL != ctobj.cn) {
if (0 == dk4str8_cmp(printqd_kw[2], ctobj.cn)) { ctobj.cn = NULL; }
}
@@ -7207,22 +7228,22 @@ rq_c_reset(pqd_rq_t *job)
ctobj.s = dk4sto_open(NULL);
if (NULL != ctobj.s) {
-#line 6332 "printqd.ctr"
+#line 6371 "printqd.ctr"
dk4sto_set_comp(ctobj.s, db_entry_compare, 0);
ctobj.i = dk4sto_it_open(ctobj.s, NULL);
if (NULL != ctobj.i) {
-#line 6335 "printqd.ctr"
+#line 6374 "printqd.ctr"
(void)dk4dbi_c8_traverse(db, (void *)(&ctobj), rq_c_reset_traverse);
-#line 6337 "printqd.ctr"
+#line 6376 "printqd.ctr"
dk4sto_it_reset(ctobj.i);
do {
pc = (char *)dk4sto_it_next(ctobj.i);
if (NULL != pc) {
-#line 6341 "printqd.ctr"
+#line 6380 "printqd.ctr"
if (0 != can_continue(0, 0)) {
(void)dbi_del(db, pc, NULL);
}
@@ -7234,7 +7255,7 @@ rq_c_reset(pqd_rq_t *job)
#if TRACE_DEBUG
else {
-#line 6351 "printqd.ctr"
+#line 6390 "printqd.ctr"
}
#endif
dk4sto_close(ctobj.s);
@@ -7242,12 +7263,12 @@ rq_c_reset(pqd_rq_t *job)
#if TRACE_DEBUG
else {
-#line 6357 "printqd.ctr"
+#line 6396 "printqd.ctr"
}
#endif
-#line 6360 "printqd.ctr"
+#line 6399 "printqd.ctr"
}
@@ -7298,7 +7319,7 @@ rq_c_add(pqd_rq_t *job)
}
if ((NULL != clname) && (NULL != uname) && (NULL != ptext)) {
if (0 != dk4ma_input_c8_dec_dk4_um_t(&pages, ptext, &ep, 1, NULL)) {
- cl = dk4sto_it_find_like(conf.i_c, clname, 1);
+ cl = (pqd_class_t *)dk4sto_it_find_like(conf.i_c, clname, 1);
if (NULL != cl) {
if (0 != retrieve_account_for_user_and_class(&oldacc, uname, cl, 1)) {
DK4_MEMCPY(&newacc, &oldacc, sizeof(pqd_account_t));
@@ -7334,7 +7355,7 @@ rq_c_add(pqd_rq_t *job)
*/
static
void
-rq_c_dbcl(pqd_rq_t *job)
+rq_c_dbcl(void)
{
pqd_control_t ctobj;
char *ptr;
@@ -7380,27 +7401,27 @@ rq_control(pqd_rq_t *job)
int sc;
-#line 6491 "printqd.ctr"
+#line 6530 "printqd.ctr"
subcmd = job->argptr;
job->argptr = dk4str8_next(subcmd, NULL);
-#line 6494 "printqd.ctr"
+#line 6533 "printqd.ctr"
switch ( (sc = dk4str8_abbr_index(control_sub_cmds, '$', subcmd, 0)) ) {
case 0 : {
-#line 6496 "printqd.ctr"
+#line 6535 "printqd.ctr"
rq_c_reset(job);
} break;
case 1 : {
-#line 6499 "printqd.ctr"
+#line 6538 "printqd.ctr"
rq_c_add(job);
} break;
case 2 : {
-#line 6502 "printqd.ctr"
- rq_c_dbcl(job);
+#line 6541 "printqd.ctr"
+ rq_c_dbcl();
} break;
default : {
/* ERROR: Illegal sub-command */
@@ -7409,7 +7430,7 @@ rq_control(pqd_rq_t *job)
}
-#line 6510 "printqd.ctr"
+#line 6549 "printqd.ctr"
}
@@ -7424,7 +7445,7 @@ process_data(pqd_rq_t *job)
const char * msgs[3];
-#line 6523 "printqd.ctr"
+#line 6562 "printqd.ctr"
job->cmdptr = dk4str8_start(inbuf, NULL);
if (NULL != job->cmdptr) {
dk4str8_delnl(job->cmdptr);
@@ -7489,7 +7510,7 @@ process_data(pqd_rq_t *job)
}
-#line 6586 "printqd.ctr"
+#line 6625 "printqd.ctr"
}
@@ -7525,7 +7546,7 @@ one_pass(void)
-#line 6620 "printqd.ctr"
+#line 6659 "printqd.ctr"
/* Create file descriptor set for select.
*/
FD_ZERO(&rfds);
@@ -7580,7 +7601,7 @@ one_pass(void)
*/
if (0 == can_continue(1, 0)) {
-#line 6673 "printqd.ctr"
+#line 6712 "printqd.ctr"
goto finished;
}
@@ -7592,12 +7613,12 @@ one_pass(void)
switch (errno) {
case EINTR: {
-#line 6683 "printqd.ctr"
+#line 6722 "printqd.ctr"
goto finished;
} break;
default: {
-#line 6686 "printqd.ctr"
+#line 6725 "printqd.ctr"
/* ERROR: Serious error from select() function */
log_1(NULL, 0UL, LOG_EMERG, 1, 119);
ccouter = -1;
@@ -7608,7 +7629,7 @@ one_pass(void)
}
if (0 == res) {
-#line 6695 "printqd.ctr"
+#line 6734 "printqd.ctr"
goto finished;
}
@@ -7617,7 +7638,7 @@ one_pass(void)
if ((0 == conf.m_loc) || (con_loc < conf.m_loc)) {
if (0 != (FD_ISSET(so_unix,&rfds))) {
-#line 6702 "printqd.ctr"
+#line 6741 "printqd.ctr"
sock = dk4socket_accept(so_unix, NULL, NULL, NULL);
if (INVALID_SOCKET != sock) {
pconnloc = dk4mem_new(pqd_l_conn_t,1,NULL);
@@ -7651,7 +7672,7 @@ one_pass(void)
if (0 != (FD_ISSET(pconnloc->sock,&rfds))) {
l_proc = 1;
-#line 6734 "printqd.ctr"
+#line 6773 "printqd.ctr"
rdbytes = sizeof(inbuf);
res = dk4socket_recv(
pconnloc->sock, inbuf, &rdbytes, 0, 0L, 0L, NULL
@@ -7690,7 +7711,7 @@ one_pass(void)
if ((0 != l_conn) || (0 != l_proc) || (0 == can_continue(1, 0))) {
-#line 6771 "printqd.ctr"
+#line 6810 "printqd.ctr"
goto finished;
}
@@ -7701,7 +7722,7 @@ one_pass(void)
if (0 != (FD_ISSET((ss_tcp->pSockets)[i],&rfds))) {
-#line 6780 "printqd.ctr"
+#line 6819 "printqd.ctr"
DK4_MEMRES(&soa_sto, sizeof(soa_sto));
sz_soa_sto = sizeof(soa_sto);
sock = dk4socket_accept(
@@ -7733,7 +7754,7 @@ one_pass(void)
protlev = protocol_level_for_address(soa);
if (PQD_PROTO_NONE < protlev) {
-#line 6810 "printqd.ctr"
+#line 6849 "printqd.ctr"
pconntcp = dk4mem_new(pqd_n_conn_t,1,NULL);
if (NULL != pconntcp) {
pconntcp->sock = sock;
@@ -7761,12 +7782,12 @@ one_pass(void)
}
} else {
-#line 6836 "printqd.ctr"
+#line 6875 "printqd.ctr"
(void)dk4socket_close(sock, NULL);
}
} else {
-#line 6839 "printqd.ctr"
+#line 6878 "printqd.ctr"
(void)dk4socket_close(sock, NULL);
}
}
@@ -7776,7 +7797,7 @@ one_pass(void)
if (0 == can_continue(1, 0)) {
-#line 6847 "printqd.ctr"
+#line 6886 "printqd.ctr"
goto finished;
}
@@ -7790,7 +7811,7 @@ one_pass(void)
if (0 != (FD_ISSET(pconntcp->sock,&rfds))) {
-#line 6859 "printqd.ctr"
+#line 6898 "printqd.ctr"
rdbytes = sizeof(inbuf);
res = dk4socket_recv(
pconntcp->sock, inbuf, &rdbytes, 0, 0L, 0L, NULL
@@ -7825,7 +7846,7 @@ one_pass(void)
if (0 == can_continue(1, 0)) {
-#line 6892 "printqd.ctr"
+#line 6931 "printqd.ctr"
goto finished;
}
@@ -7836,7 +7857,7 @@ one_pass(void)
if (0 != (FD_ISSET((ss_udp->pSockets)[i],&rfds))) {
-#line 6901 "printqd.ctr"
+#line 6940 "printqd.ctr"
rdbytes = sizeof(inbuf);
sz_soa_sto = sizeof(soa_sto);
res = dk4socket_recvfrom(
@@ -7886,7 +7907,7 @@ one_pass(void)
finished:
-#line 6949 "printqd.ctr"
+#line 6988 "printqd.ctr"
if (0 == dbi_sync(db, NULL)) {
/* ERROR: Failed to synchronize database */
log_1(NULL, 0UL, LOG_EMERG, 1, 121);
@@ -7899,7 +7920,7 @@ one_pass(void)
}
-#line 6960 "printqd.ctr"
+#line 6999 "printqd.ctr"
}
@@ -7915,10 +7936,10 @@ service_loops(void)
{
-#line 6974 "printqd.ctr"
+#line 7013 "printqd.ctr"
-#line 6975 "printqd.ctr"
+#line 7014 "printqd.ctr"
/* LOG: Daemon running */
log_1(NULL, 0UL, LOG_INFO, 0, 73);
if (outer_allocate_resources()) {
@@ -7940,11 +7961,11 @@ service_loops(void)
while(1 == ccinner) {
if (1 == can_continue(1, 0)) {
-#line 6995 "printqd.ctr"
+#line 7034 "printqd.ctr"
one_pass();
} else {
-#line 6997 "printqd.ctr"
+#line 7036 "printqd.ctr"
ccinner = 0;
if (0 == can_continue(0, 0)) {
ccouter = 0;
@@ -7960,28 +7981,28 @@ service_loops(void)
log_1(NULL, 0UL, LOG_INFO, 0, 78);
} else {
-#line 7011 "printqd.ctr"
+#line 7050 "printqd.ctr"
ccouter = -1;
}
} else {
-#line 7014 "printqd.ctr"
+#line 7053 "printqd.ctr"
ccouter = -1;
}
if (0 == inner_release_resources()) {
-#line 7017 "printqd.ctr"
+#line 7056 "printqd.ctr"
ccouter = -1;
}
} else {
-#line 7020 "printqd.ctr"
+#line 7059 "printqd.ctr"
ccouter = -1;
}
config_release();
} else {
-#line 7024 "printqd.ctr"
+#line 7063 "printqd.ctr"
ccouter = 0;
}
}
@@ -7989,7 +8010,7 @@ service_loops(void)
#if TRACE_DEBUG
else {
-#line 7030 "printqd.ctr"
+#line 7069 "printqd.ctr"
}
#endif
outer_release_resources();
@@ -8002,10 +8023,10 @@ service_loops(void)
);
-#line 7041 "printqd.ctr"
+#line 7080 "printqd.ctr"
-#line 7042 "printqd.ctr"
+#line 7081 "printqd.ctr"
}
@@ -8153,7 +8174,7 @@ set_signal_handlers_and_run_service(void)
if (0 != s_f_i) {
/* ERROR: Failed to install signal handlers */
log_1(NULL, 0UL, LOG_EMERG, 1, 68);
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 != sint) {
if (0 != sigaction(SIGINT, &oint, NULL)) {
@@ -8182,7 +8203,7 @@ set_signal_handlers_and_run_service(void)
if (0 != s_f_r) {
/* ERROR: Failed to restore signal handlers */
log_1(NULL, 0UL, LOG_EMERG, 1, 69);
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
#else
if (NULL != oterm) { sigset(SIGTERM, oterm); }
@@ -8210,19 +8231,29 @@ main(int argc, char *argv[])
pid_t cpid; /* Child process PID */
int res; /* Operation result */
- /* Process command line arguments.
+ /* Initialize daemon tool structure
+ */
+ dk4dmt_init(&dmt);
+ dk4dmt_set_program(&dmt, printqd_kw[0]);
+ dk4dmt_set_pidfile(&dmt, pid_file_name);
+ dk4dmt_set_syslog_feature(&dmt, syslogf);
+ /*
+ Process command line arguments.
*/
res = dk4opt_process_argv(
options, szoptions, argc, argv, NULL, NULL, 1, 1, NULL
);
if (0 == res) {
- exval = 2; /* Invalid or excess arguments */
+ dk4dmt_error_usage(&dmt); /* Invalid or excess arguments */
+ fputs("printqd: ERROR: Invalid command line arguments!\n", stderr);
+ fflush(stderr);
goto finished;
}
/* Must be started as root.
*/
if (0 != geteuid()) {
+ dk4dmt_error_usage(&dmt);
fputs("printqd: ERROR: Must be run as root!\n", stderr);
fflush(stderr);
goto finished;
@@ -8235,13 +8266,18 @@ main(int argc, char *argv[])
/* Run in debug mode.
*/
if (0 != debug) {
+ dk4dmt_set_log_stderr(&dmt, 1);
+ dk4dmt_success(&dmt);
set_signal_handlers_and_run_service();
goto finished;
}
/* PREPARE TO RUN AS DAEMON
*/
- if (0 == dk4dmt_parent_before_fork(printqd_kw[0],pid_file_name,1,syslogf)) {
+ dk4dmt_set_program(&dmt, printqd_kw[0]);
+ dk4dmt_set_pidfile(&dmt, pid_file_name);
+ dk4dmt_set_syslog_feature(&dmt, syslogf);
+ if (0 == dk4dmt_parent_before_fork(&dmt)) {
goto finished;
}
@@ -8250,6 +8286,7 @@ main(int argc, char *argv[])
cpid = fork();
if ((pid_t)0 < cpid) {
/* In the parent process */
+ dk4dmt_parent_after_fork(&dmt);
goto finished;
} else {
if ((pid_t)0 == cpid) {
@@ -8260,17 +8297,18 @@ main(int argc, char *argv[])
fputs(printqd_kw[0], stderr);
fputs(printqd_kw[70], stderr);
fflush(stderr);
+ dk4dmt_parent_fork_failed(&dmt);
goto finished;
}
}
/* Intermediate process and daemon process should indicate success.
*/
- exval = EXIT_SUCCESS;
+ dk4dmt_success(&dmt); /* Intermediate process */
/* Decouple from terminals.
*/
- if (0 == dk4dmt_intermediate_before_fork(printqd_kw[0], syslogf)) {
+ if (0 == dk4dmt_intermediate_before_fork(&dmt)) {
goto finished;
}
@@ -8279,6 +8317,7 @@ main(int argc, char *argv[])
cpid = fork();
if ((pid_t)0 < cpid) {
/* In the intermediate process */
+ dk4dmt_intermediate_after_fork(&dmt);
goto finished;
} else {
if ((pid_t)0 == cpid) {
@@ -8287,20 +8326,22 @@ main(int argc, char *argv[])
/* Failed to create process */
/* ERROR: fork() failed */
log_1(NULL, 0UL, LOG_ERR, 1, 71);
+ dk4dmt_intermediate_fork_failed(&dmt);
goto finished;
}
}
/* In the daemon process
*/
- if (0 != dk4dmt_daemon_after_fork(printqd_kw[0], pid_file_name, syslogf)) {
+ if (0 != dk4dmt_daemon_start(&dmt)) {
set_signal_handlers_and_run_service();
}
- dk4dmt_daemon_end(printqd_kw[0], pid_file_name, syslogf);
+ dk4dmt_daemon_end(&dmt);
/* Exit the program.
*/
finished:
+ exval = dk4dmt_get_exit_status(&dmt);
exit(exval); return exval;
}
diff --git a/support/dktools/printqd.conf b/support/dktools/printqd.conf
new file mode 100644
index 0000000000..40170ff301
--- /dev/null
+++ b/support/dktools/printqd.conf
@@ -0,0 +1,59 @@
+[options]
+# run as user = daemon
+# run as group = lp
+# database = mem::/usr/local/var/lib/printqd/db/printqd.db
+# local socket = /usr/local/var/run/printqd/printqd.sock
+# local socket owner = daemon
+# local socket group = lp
+# local socket backlog = 5
+# max local connections = 7
+# udp port = 9100
+# tcp port = 9100
+# tcp port backlog = 5
+# max tcp connections = 50
+# info allow = 192.0.2.0/24
+# info allow = *
+# data allow = 127.0.0.1/32
+# admin allow = 127.0.0.1/32
+# log file = /usr/local/var/log/printqd/printqd.log
+# log features = -
+
+[class cl-mfd]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 0
+deny action = remove
+
+[class cl-color]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 0
+deny action = remove
+
+[class cl-lab]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 200
+deny action = remove
+
+[printer lp1]
+alias = lp
+class = cl-lab
+
+[printer lp2]
+class = cl-lab
+
+[printer lpcolor]
+class = cl-color
+
+[printer mfd]
+class = cl-mfd
diff --git a/support/dktools/printqd.conf.sample b/support/dktools/printqd.conf.sample
index 136ba3f345..7719616533 100644
--- a/support/dktools/printqd.conf.sample
+++ b/support/dktools/printqd.conf.sample
@@ -1,3 +1,6 @@
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
# The options section contains general options.
# =============================================
@@ -5,7 +8,7 @@
# After startup the printqd process gives up privileges and runs
# under an unprivileged user account.
-# Use the same UID ase the LPRng lpd daemon does.
+# Use the same UID as the LPRng lpd daemon does.
# For some name services you can not use this option as only the
# root user has access to user and group information.
# --------------------------------------------------------------
@@ -32,7 +35,7 @@
# directory as file(s) printqd.* , the best available database type
# is choosen with a corresponding file name suffix.
# -----------------------------------------------------------------
-# database = mem::/var/printqd/printqd.db
+# database = mem::/var/lib/printqd/db/printqd.db
# Local UNIX domain socket, optional.
# Default is ${localstatedir}/run/printqd/printqd.sock .
@@ -43,7 +46,7 @@
# Only needed if ``run as user'' is not specified.
# Use the account of the LPRng print system.
# ------------------------------------------------
-# local socket owner = lp
+# local socket owner = daemon
# Owner group of local socket.
# Only needed if ``run as group'' is not specified.
diff --git a/support/dktools/printqd.ctr b/support/dktools/printqd.ctr
index 6a58484b23..7f1f9d5f43 100644
--- a/support/dktools/printqd.ctr
+++ b/support/dktools/printqd.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -292,6 +292,13 @@ A print accounting and quota daemon for use with the LPRng print system.
#endif
#endif
+#if DK4_HAVE_SYSEXITS_H
+#ifndef SYSEXITS_H_INCLUDED
+#include <sysexits.h>
+#define SYSEXITS_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4opt.h"
#include "dk4dmt.h"
#include "dk4inst.h"
@@ -312,6 +319,7 @@ A print accounting and quota daemon for use with the LPRng print system.
#include "dk4time08.h"
#include "dk4mkdh8.h"
#include "dk4delfile08.h"
+#include "dk4unused.h"
@@ -388,7 +396,7 @@ static const char def_conf_file_name[] = {
/** Default socket file name.
*/
static const char def_sock_file_name[] = {
- DK4_INST_DIR_VAR "/run/printqd/printqd.sock"
+ DK4_INST_DIR_RUNSTATE "/printqd/printqd.sock"
};
@@ -421,7 +429,7 @@ static const char def_log_file_name[] = {
/** PID file name.
*/
static const char pid_file_name[] = {
- DK4_INST_DIR_VAR "/run/printqd/printqd.pid"
+ DK4_INST_DIR_SYSTEMD_RUN "/printqd/printqd.pid"
};
@@ -1176,6 +1184,10 @@ $!end
static pqd_conf_t conf;
+/** Daemon tool function structure.
+*/
+static dk4dmt_t dmt;
+
/** Connections over local socket, stores pqd_l_conn_t.
Not NULL in service (service is not run if allocation fails).
@@ -1377,8 +1389,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -1391,8 +1404,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_hup(int signo)
+sig_handler_hup(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_hup) = 1;
}
#endif
@@ -1404,8 +1418,9 @@ sig_handler_hup(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -1416,8 +1431,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -2047,12 +2063,13 @@ dbi_sync(dk4_dbi_t *db, dk4_er_t *erp)
*/
static
int
-compare_pqd_l_conn_t(const void *l, const void *r, int cr)
+compare_pqd_l_conn_t(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
const pqd_l_conn_t *pl;
const pqd_l_conn_t *pr;
int back = 0;
$? "+ compare_pqd_l_conn_t"
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (const pqd_l_conn_t *)l;
@@ -2084,12 +2101,13 @@ compare_pqd_l_conn_t(const void *l, const void *r, int cr)
*/
static
int
-compare_pqd_n_conn_t(const void *l, const void *r, int cr)
+compare_pqd_n_conn_t(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
const pqd_n_conn_t *pl;
const pqd_n_conn_t *pr;
int back = 0;
$? "+ compare_pqd_n_conn_t"
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
pl = (const pqd_n_conn_t *)l;
@@ -2874,7 +2892,6 @@ set_port_number(
/** Add address to list of allowed hosts.
@param s Containter of allowed peers.
- @param i Iterator through container.
@param iptr Address of global flag variable.
@param str Text containing the address.
@return 1 on success, 0 on error.
@@ -2883,7 +2900,6 @@ static
int
allow_hosts(
dk4_sto_t *s,
- dk4_sto_it_t *i,
int *iptr,
char *str,
const char *filename,
@@ -2895,7 +2911,7 @@ allow_hosts(
char *px = NULL;
int res = 0;
int back = 0;
- $? "+ allow_hosts %s %s %s \"%s\"", TR_8PTR(s), TR_8PTR(i), TR_8PTR(iptr), TR_8STR(str)
+ $? "+ allow_hosts %s %s \"%s\"", TR_8PTR(s), TR_8PTR(iptr), TR_8STR(str)
px = dk4str8_next(str, NULL);
if (NULL == px) {
if (0 == strcmp(str, printqd_kw[2])) {
@@ -2973,7 +2989,6 @@ get_limit_value(dk4_um_t *plim, char *src, const char *fn, unsigned long lineno)
/** Add a user or group limit to a class.
- @param pcl Class to modify.
@param s Container for limits.
@param i Container iterator.
@param str Text containing name and limit.
@@ -2984,7 +2999,6 @@ get_limit_value(dk4_um_t *plim, char *src, const char *fn, unsigned long lineno)
static
int
add_limit(
- pqd_class_t *pcl,
dk4_sto_t *s,
dk4_sto_it_t *i,
char *str,
@@ -2997,7 +3011,7 @@ add_limit(
char *px;
dk4_um_t limval = (dk4_um_t)0UL;
int back = 0;
- $? "+ add_limit %s %s %s \"%s\"", TR_8PTR(pcl), TR_8PTR(s), TR_8PTR(i), TR_8STR(str)
+ $? "+ add_limit %s %s \"%s\"", TR_8PTR(s), TR_8PTR(i), TR_8STR(str)
pnum = dk4str8_next(str, NULL);
if (NULL != pnum) {
px = dk4str8_next(pnum, NULL);
@@ -3258,13 +3272,11 @@ config_check(const char *filename, unsigned long lineno)
/** Set additional features to log.
@param pv Text containing the feature names.
- @param fn File name for diagnostics.
- @param lineno Line numbers for diagnostics.
@return 1 on success, 0 on errors.
*/
static
int
-set_log_features(char *pv, const char *fn, unsigned long lineno)
+set_log_features(char *pv)
{
char *pc;
@@ -3639,7 +3651,7 @@ config_read(void)
case 10 : { $? ". info allow"
if (0 == sectt) {
myres = allow_hosts(
- conf.s_ai, conf.i_ai, &(conf.iglo), pv,
+ conf.s_ai, &(conf.iglo), pv,
fn, lineno
);
if (0 == myres) { $? "! failed"
@@ -3654,7 +3666,7 @@ config_read(void)
case 11 : { $? ". data allow"
if (0 == sectt) {
myres = allow_hosts(
- conf.s_ad, conf.i_ad, &(conf.dglo), pv,
+ conf.s_ad, &(conf.dglo), pv,
fn, lineno
);
if (0 == myres) { $? "! failed"
@@ -3669,7 +3681,7 @@ config_read(void)
case 12 : { $? ". admin allow"
if (0 == sectt) {
myres = allow_hosts(
- conf.s_aa, conf.i_aa, &(conf.aglo), pv,
+ conf.s_aa, &(conf.aglo), pv,
fn, lineno
);
if (0 == myres) { $? "! failed"
@@ -3684,7 +3696,7 @@ config_read(void)
case 13 : { $? ". user limit"
if ((1 == sectt) && (NULL != pcl)) {
myres = add_limit(
- pcl, pcl->s_u, pcl->i_u, pv, fn, lineno
+ pcl->s_u, pcl->i_u, pv, fn, lineno
);
if (0 == myres) { $? "! failed"
back = 0;
@@ -3698,7 +3710,7 @@ config_read(void)
case 14 : { $? ". group limit"
if ((1 == sectt) && (NULL != pcl)) {
myres = add_limit(
- pcl, pcl->s_g, pcl->i_g, pv, fn, lineno
+ pcl->s_g, pcl->i_g, pv, fn, lineno
);
if (0 == myres) { $? "! failed"
back = 0;
@@ -3778,7 +3790,7 @@ config_read(void)
}
} break;
case 20 : { $? ". log features"
- back = set_log_features(pv, fn, lineno);
+ back = set_log_features(pv);
} break;
case 21 : { $? ". local socket owner"
if (0 == sectt) {
@@ -4454,6 +4466,9 @@ int
change_group_and_user(void)
{
const char *fn = NULL;
+#if (!(DK4_HAVE_SETGROUPS)) && DK4_HAVE_INITGROUPS && DK4_HAVE_GETPWUID
+ struct pwent *pw;
+#endif
uid_t myuid;
gid_t mygid;
int dbt = DK4_DB_BE_UNKNOWN;
@@ -4553,21 +4568,43 @@ change_group_and_user(void)
}
} else { $? "! socket not yet open"
}
+#if DK4_HAVE_SETGROUPS
+ if (0 != setgroups(1, &(conf.gid))) {
+ back = 0; $? "! setgroups"
+ log_1(NULL, 0UL, LOG_EMERG, 1, 114);
+ }
+#else
+#if DK4_HAVE_INITGROUPS && DK4_HAVE_GETPWUID
+ pw = getpwuid(myuid);
+ if (NULL != pw) {
+ if (NULL != pw->pw_name) {
+ if (0 != initgroups(pw->pw_name, conf.gid)) {
+ back = 0; $? "! initgroups"
+ log_1(NULL, 0UL, LOG_EMERG, 1, 114);
+ }
+ }
+ }
+#endif
+#endif
/*
Switch group
*/
- if (0 != setgid(conf.gid)) {
- back = 0; $? "! switch group"
- /* ERROR: Failed to switch group */
- log_1(NULL, 0UL, LOG_EMERG, 1, 114);
+ if (mygid != conf.gid) {
+ if (0 != setgid(conf.gid)) {
+ back = 0; $? "! switch group"
+ /* ERROR: Failed to switch group */
+ log_1(NULL, 0UL, LOG_EMERG, 1, 114);
+ }
}
/*
Switch user
*/
- if (0 != setuid(conf.uid)) {
- back = 0; $? "! switch user"
- /* ERROR: Failed to switch user */
- log_1(NULL, 0UL, LOG_EMERG, 1, 115);
+ if (myuid != conf.uid) {
+ if (0 != setuid(conf.uid)) {
+ back = 0; $? "! switch user"
+ /* ERROR: Failed to switch user */
+ log_1(NULL, 0UL, LOG_EMERG, 1, 115);
+ }
}
/*
Re-open database if closed.
@@ -5122,7 +5159,7 @@ retrieve_account_for_user_and_class(
dk4sto_it_reset(cl->i_g);
do {
$? ". loop start"
- lim = dk4sto_it_next(cl->i_g);
+ lim = (pqd_limit_t *)dk4sto_it_next(cl->i_g);
if (NULL != lim) { $? ". yet another group limit"
if (lim->limit > account->limit) { $? ". group limit is higher"
$? ". group=\"%s\" limit=%lu", TR_8STR(lim->name), (unsigned long)(lim->limit)
@@ -5272,6 +5309,7 @@ account_add_pages_from_job(pqd_account_t *account, dk4_um_t pages)
if ((dk4_um_t)0UL < pages) {
if (account->account >= pages) {
account->account -= pages;
+ pages = (dk4_um_t)0UL;
} else {
pages -= account->account;
account->account = (dk4_um_t)0UL;
@@ -5617,7 +5655,6 @@ log_old_and_new_account(
/** Charge user for a print job.
- @param job Job structure.
@param un User name.
@param cl Printer class of printer the job was printed on.
@param pcval Number of pages in print job.
@@ -5625,7 +5662,6 @@ log_old_and_new_account(
static
void
do_charge(
- pqd_rq_t *job,
const char *un,
pqd_class_t *cl,
dk4_um_t pcval
@@ -5633,7 +5669,7 @@ do_charge(
{
pqd_account_t oldacc;
pqd_account_t newacc;
- $? "+ do_charge %s \"%s\" \"%s\" %lu", TR_8PTR(job), un, TR_8STR(cl->name), (unsigned long)pcval
+ $? "+ do_charge \"%s\" \"%s\" %lu", un, TR_8STR(cl->name), (unsigned long)pcval
if (0 != retrieve_account_for_user_and_class(&oldacc, un, cl, 1)) {
DK4_MEMCPY(&newacc, &oldacc, sizeof(pqd_account_t));
account_add_pages_from_job(&newacc, pcval);
@@ -5787,7 +5823,7 @@ do_fileend(
res = dk4ma_input_c8_dec_dk4_um_t(&pcstt, opc, &ep, 1, NULL);
if (0 != res) {
if (pcend > pcstt) { $? ". charge user"
- do_charge(job, un, cl, (pcend - pcstt));
+ do_charge(un, cl, (pcend - pcstt));
}
#if TRACE_DEBUG
else { $? "! pagecount unchanged"
@@ -6028,7 +6064,7 @@ rq_acct_charge(pqd_rq_t *job)
)
{
if (0 != dk4ma_input_c8_dec_dk4_um_t(&pcval, pc, &ep, 1, NULL)) {
- do_charge(job, un, cl, pcval);
+ do_charge(un, cl, pcval);
} else {
/* Close connection on malformed request
*/
@@ -6067,9 +6103,10 @@ typedef struct {
*/
static
int
-db_entry_compare(const void *l, const void *r, int cr)
+db_entry_compare(const void *l, const void *r, int DK4_ARG_UNUSED(cr) )
{
int back = 0;
+ DK4_UNUSED_ARG(cr)
if (NULL != l) {
if (NULL != r) {
back = strcmp((const char *)l, (const char *)r);
@@ -6097,7 +6134,7 @@ db_entry_compare(const void *l, const void *r, int cr)
*/
static
int
-rq_c_reset_traverse(void *obj, const char *k, const char *v)
+rq_c_reset_traverse(void *obj, const char *k, const char * DK4_ARG_UNUSED(v) )
{
pqd_control_t *ctoptr = NULL; /* Traversal object pointer */
char *p1 = NULL; /* DB entry type */
@@ -6107,6 +6144,7 @@ rq_c_reset_traverse(void *obj, const char *k, const char *v)
int unm = 0; /* Flag: User name matches */
int back = 1;
$? "+ rq_c_reset_traverse \"%s\"=\"%s\"", TR_8STR(k), TR_8STR(v)
+ DK4_UNUSED_ARG(v)
ctoptr = (pqd_control_t *)obj;
if (0 != dk4str8_cpy_s(kb, sizeof(kb), k, NULL)) {
p1 = dk4str8_start(kb, NULL);
@@ -6197,7 +6235,7 @@ rq_c_reset_traverse(void *obj, const char *k, const char *v)
*/
static
int
-rc_c_dbcl_traverse(void *obj, const char *k, const char *v)
+rc_c_dbcl_traverse(void *obj, const char *k, const char * DK4_ARG_UNUSED(v) )
{
pqd_control_t *pctobj;
pqd_class_t *cl;
@@ -6206,6 +6244,7 @@ rc_c_dbcl_traverse(void *obj, const char *k, const char *v)
int cdel = 0; /* Flag: Can delete item */
int back = 1;
+ DK4_UNUSED_ARG(v)
if (0 != dk4str8_cpy_s(kb, sizeof(kb), k, NULL)) {
if (0 != dk4str8_cpy_s(vb, sizeof(vb), k, NULL)) {
p1 = strchr(kb, ':');
@@ -6226,7 +6265,7 @@ rc_c_dbcl_traverse(void *obj, const char *k, const char *v)
if (NULL != p2) {
dk4str8_normalize(p1, NULL);
dk4str8_normalize(p2, NULL);
- cl = dk4sto_it_find_like(conf.i_c, p1, 1);
+ cl = (pqd_class_t *)dk4sto_it_find_like(conf.i_c, p1, 1);
if (NULL != cl) {
if (NULL == dk4sto_it_find_like(cl->i_u, p2, 1)) {
if (NULL == getpwnam(p2)) {
@@ -6407,7 +6446,7 @@ rq_c_add(pqd_rq_t *job)
}
if ((NULL != clname) && (NULL != uname) && (NULL != ptext)) {
if (0 != dk4ma_input_c8_dec_dk4_um_t(&pages, ptext, &ep, 1, NULL)) {
- cl = dk4sto_it_find_like(conf.i_c, clname, 1);
+ cl = (pqd_class_t *)dk4sto_it_find_like(conf.i_c, clname, 1);
if (NULL != cl) {
if (0 != retrieve_account_for_user_and_class(&oldacc, uname, cl, 1)) {
DK4_MEMCPY(&newacc, &oldacc, sizeof(pqd_account_t));
@@ -6443,7 +6482,7 @@ rq_c_add(pqd_rq_t *job)
*/
static
void
-rq_c_dbcl(pqd_rq_t *job)
+rq_c_dbcl(void)
{
pqd_control_t ctobj;
char *ptr;
@@ -6499,7 +6538,7 @@ rq_control(pqd_rq_t *job)
rq_c_add(job);
} break;
case 2 : { $? ". database-cleanup"
- rq_c_dbcl(job);
+ rq_c_dbcl();
} break;
default : {
/* ERROR: Illegal sub-command */
@@ -7186,7 +7225,7 @@ set_signal_handlers_and_run_service(void)
if (0 != s_f_i) {
/* ERROR: Failed to install signal handlers */
log_1(NULL, 0UL, LOG_EMERG, 1, 68);
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 != sint) {
if (0 != sigaction(SIGINT, &oint, NULL)) {
@@ -7215,7 +7254,7 @@ set_signal_handlers_and_run_service(void)
if (0 != s_f_r) {
/* ERROR: Failed to restore signal handlers */
log_1(NULL, 0UL, LOG_EMERG, 1, 69);
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
#else
if (NULL != oterm) { sigset(SIGTERM, oterm); }
@@ -7243,19 +7282,29 @@ main(int argc, char *argv[])
pid_t cpid; /* Child process PID */
int res; /* Operation result */
- /* Process command line arguments.
+ /* Initialize daemon tool structure
+ */
+ dk4dmt_init(&dmt);
+ dk4dmt_set_program(&dmt, printqd_kw[0]);
+ dk4dmt_set_pidfile(&dmt, pid_file_name);
+ dk4dmt_set_syslog_feature(&dmt, syslogf);
+ /*
+ Process command line arguments.
*/
res = dk4opt_process_argv(
options, szoptions, argc, argv, NULL, NULL, 1, 1, NULL
);
if (0 == res) {
- exval = 2; /* Invalid or excess arguments */
+ dk4dmt_error_usage(&dmt); /* Invalid or excess arguments */
+ fputs("printqd: ERROR: Invalid command line arguments!\n", stderr);
+ fflush(stderr);
goto finished;
}
/* Must be started as root.
*/
if (0 != geteuid()) {
+ dk4dmt_error_usage(&dmt);
fputs("printqd: ERROR: Must be run as root!\n", stderr);
fflush(stderr);
goto finished;
@@ -7268,13 +7317,18 @@ main(int argc, char *argv[])
/* Run in debug mode.
*/
if (0 != debug) {
+ dk4dmt_set_log_stderr(&dmt, 1);
+ dk4dmt_success(&dmt);
set_signal_handlers_and_run_service();
goto finished;
}
/* PREPARE TO RUN AS DAEMON
*/
- if (0 == dk4dmt_parent_before_fork(printqd_kw[0],pid_file_name,1,syslogf)) {
+ dk4dmt_set_program(&dmt, printqd_kw[0]);
+ dk4dmt_set_pidfile(&dmt, pid_file_name);
+ dk4dmt_set_syslog_feature(&dmt, syslogf);
+ if (0 == dk4dmt_parent_before_fork(&dmt)) {
goto finished;
}
@@ -7283,6 +7337,7 @@ main(int argc, char *argv[])
cpid = fork();
if ((pid_t)0 < cpid) {
/* In the parent process */
+ dk4dmt_parent_after_fork(&dmt);
goto finished;
} else {
if ((pid_t)0 == cpid) {
@@ -7293,17 +7348,18 @@ main(int argc, char *argv[])
fputs(printqd_kw[0], stderr);
fputs(printqd_kw[70], stderr);
fflush(stderr);
+ dk4dmt_parent_fork_failed(&dmt);
goto finished;
}
}
/* Intermediate process and daemon process should indicate success.
*/
- exval = EXIT_SUCCESS;
+ dk4dmt_success(&dmt); /* Intermediate process */
/* Decouple from terminals.
*/
- if (0 == dk4dmt_intermediate_before_fork(printqd_kw[0], syslogf)) {
+ if (0 == dk4dmt_intermediate_before_fork(&dmt)) {
goto finished;
}
@@ -7312,6 +7368,7 @@ main(int argc, char *argv[])
cpid = fork();
if ((pid_t)0 < cpid) {
/* In the intermediate process */
+ dk4dmt_intermediate_after_fork(&dmt);
goto finished;
} else {
if ((pid_t)0 == cpid) {
@@ -7320,20 +7377,22 @@ main(int argc, char *argv[])
/* Failed to create process */
/* ERROR: fork() failed */
log_1(NULL, 0UL, LOG_ERR, 1, 71);
+ dk4dmt_intermediate_fork_failed(&dmt);
goto finished;
}
}
/* In the daemon process
*/
- if (0 != dk4dmt_daemon_after_fork(printqd_kw[0], pid_file_name, syslogf)) {
+ if (0 != dk4dmt_daemon_start(&dmt)) {
set_signal_handlers_and_run_service();
}
- dk4dmt_daemon_end(printqd_kw[0], pid_file_name, syslogf);
+ dk4dmt_daemon_end(&dmt);
/* Exit the program.
*/
finished:
+ exval = dk4dmt_get_exit_status(&dmt);
exit(exval); return exval;
}
diff --git a/support/dktools/printqd.h b/support/dktools/printqd.h
index 85014ecf48..f0816bbe53 100644
--- a/support/dktools/printqd.h
+++ b/support/dktools/printqd.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: printqd.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: printqd.ctr
*/
#ifndef PRINTQD_H_INCLUDED
diff --git a/support/dktools/printqd.service b/support/dktools/printqd.service
new file mode 100644
index 0000000000..473be26ea4
--- /dev/null
+++ b/support/dktools/printqd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Print quota daemon
+After=network.target
+StartLimitIntervalSec=10
+Documentation=man:printqd(1) man:printqd.protocol(5)
+
+[Service]
+Type=forking
+ExecStart=/usr/local/sbin/printqd
+Restart=always
+RestartSec=2
+PIDFile=/run/printqd/printqd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/support/dktools/printqda.c b/support/dktools/printqda.c
index 64faa3c00c..68170c685f 100644
--- a/support/dktools/printqda.c
+++ b/support/dktools/printqda.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: printqda.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: printqda.ctr
*/
/** @file printqda.c The printqda module.
diff --git a/support/dktools/printqda.ctr b/support/dktools/printqda.ctr
index 0e33a91351..ebae93ecda 100644
--- a/support/dktools/printqda.ctr
+++ b/support/dktools/printqda.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2012-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
diff --git a/support/dktools/printqda.h b/support/dktools/printqda.h
index f6d91cf74d..760e590550 100644
--- a/support/dktools/printqda.h
+++ b/support/dktools/printqda.h
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: printqda.ctr
+Copyright (C) 2012-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2012-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: printqda.ctr
*/
/** @file printqda.h Header file for the printqda module.
diff --git a/support/dktools/printqdc.c b/support/dktools/printqdc.c
index 3be104d3a3..7a25baab9f 100644
--- a/support/dktools/printqdc.c
+++ b/support/dktools/printqdc.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: printqdc.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: printqdc.ctr
*/
/** @file printqdc.c The printqdc module.
@@ -75,8 +53,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -127,12 +110,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4opt.h"
#include "dk4sock.h"
#include "dk4vers.h"
+#include "dk4unused.h"
-#line 103 "printqdc.ctr"
+#line 109 "printqdc.ctr"
@@ -189,7 +173,7 @@ static const char * const help_text[] = {
NULL
-#line 158 "printqdc.ctr"
+#line 164 "printqdc.ctr"
};
@@ -202,7 +186,8 @@ static const char * const license_text[] = {
"a library:",
"",
"dktools\t\tDirk Krause's tools and libraries.",
-"\t\tSee http://dktools.sourceforge.net/ for more information.",
+"\t\tSee http://sourceforge.net/p/dktools/wiki/Home/",
+"\t\tfor more information.",
"",
"DK tools and libraries license",
"==============================",
@@ -212,32 +197,32 @@ static const char * const license_text[] = {
"Redistribution and use in source and binary forms, with or without",
"modification, are permitted provided that the following conditions are met:",
"",
-"* Redistributions of source code must retain the above copyright notice,",
-" this list of conditions and the following disclaimer.",
-"* Redistributions in binary form must reproduce the above copyright",
-" notice, this list of conditions and the following disclaimer in the",
-" documentation and/or other materials provided with the distribution.",
-"* Neither the name of the Dirk Krause nor the names of contributors may be",
-" used to endorse or promote products derived from this software without",
-" specific prior written permission.",
-"",
-"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"",
-"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
-"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE",
-"ARE DISCLAIMED.",
+"1. Redistributions of source code must retain the above copyright notice,",
+" this list of conditions and the following disclaimer.",
+"2. Redistributions in binary form must reproduce the above copyright",
+" notice, this list of conditions and the following disclaimer in the",
+" documentation and/or other materials provided with the distribution.",
+"3. Neither the name of the copyright holder nor the names of its",
+" contributors may be used to endorse or promote products derived from",
+" this software without specific prior written permission.",
"",
-"IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,",
-"INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,",
-"BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,",
-"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY",
-"OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING",
-"NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,",
-"EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS",
+"``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT",
+"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR",
+"A PARTICULAR PURPOSE ARE DISCLAIMED.",
+"IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY",
+"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
+"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR",
+"SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER",
+"CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT",
+"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY",
+"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF",
+"SUCH DAMAGE.",
"",
NULL
-#line 204 "printqdc.ctr"
+#line 211 "printqdc.ctr"
};
@@ -326,7 +311,7 @@ static const char * const pqdc_kw[] = {
NULL
-#line 276 "printqdc.ctr"
+#line 283 "printqdc.ctr"
};
@@ -334,7 +319,7 @@ NULL
/** Default socket name.
*/
static const char def_sock_name[] = {
- DK4_INST_DIR_VAR "/run/printqd/printqd.sock"
+ DK4_INST_DIR_RUNSTATE "/printqd/printqd.sock"
};
@@ -381,7 +366,7 @@ static const char * const command_names[] = {
NULL
-#line 311 "printqdc.ctr"
+#line 318 "printqdc.ctr"
};
@@ -400,7 +385,7 @@ static const char * const responses[] = {
NULL
-#line 322 "printqdc.ctr"
+#line 329 "printqdc.ctr"
};
/** Data exchange buffer.
@@ -510,8 +495,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -522,8 +508,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -533,8 +520,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -691,12 +679,12 @@ process_data(int pres)
int cc; /* Flag: Can continue */
-#line 611 "printqdc.ctr"
+#line 621 "printqdc.ctr"
wrb = sl = strlen(inbuf);
/* LOG/SHOW: Request */
if (0 != intera) {
-#line 614 "printqdc.ctr"
+#line 624 "printqdc.ctr"
fputs(pqdc_kw[4], stdout);
if (0 < sl) {
fputs(inbuf, stdout);
@@ -712,51 +700,51 @@ process_data(int pres)
}
if ((0 < sl) && (0 != can_continue())) {
-#line 628 "printqdc.ctr"
+#line 638 "printqdc.ctr"
if ((NULL != host_name) && (0 < portno)) {
-#line 629 "printqdc.ctr"
+#line 639 "printqdc.ctr"
sock = dk4socket_c8_tcp_client_host_port(
host_name, portno, 0, 0L, 0L, NULL
);
} else {
-#line 633 "printqdc.ctr"
+#line 643 "printqdc.ctr"
sock = dk4socket_c8_unix_client(
((NULL != sock_name) ? sock_name : def_sock_name), NULL
);
}
if (INVALID_SOCKET != sock) {
-#line 638 "printqdc.ctr"
+#line 648 "printqdc.ctr"
if (0 != can_continue()) {
-#line 639 "printqdc.ctr"
+#line 649 "printqdc.ctr"
res = dk4socket_send(sock, inbuf, &wrb, 0, 0L, 0L, NULL);
if ((DK4_SOCKET_RESULT_SUCCESS == res) && (wrb == sl)) {
-#line 641 "printqdc.ctr"
+#line 651 "printqdc.ctr"
if (0 != can_continue()) {
-#line 642 "printqdc.ctr"
+#line 652 "printqdc.ctr"
res = dk4socket_shutdown(sock, DK4_SOCKET_SHUT_WRITE, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 644 "printqdc.ctr"
+#line 654 "printqdc.ctr"
cc = 1;
do {
if (0 != can_continue()) {
-#line 647 "printqdc.ctr"
+#line 657 "printqdc.ctr"
wrb = sizeof(inbuf);
res = dk4socket_recv(sock, inbuf, &wrb, 0, 0L, 0L, NULL);
if ((DK4_SOCKET_RESULT_SUCCESS==res)&&(0 != can_continue())) {
if (0 < wrb) {
-#line 651 "printqdc.ctr"
+#line 661 "printqdc.ctr"
if (0 != pres) {
-#line 652 "printqdc.ctr"
+#line 662 "printqdc.ctr"
if (sizeof(inbuf) > wrb) {
inbuf[wrb] = '\0';
} else {
@@ -816,62 +804,62 @@ process_data(int pres)
}
} else {
-#line 710 "printqdc.ctr"
+#line 720 "printqdc.ctr"
}
} else {
-#line 712 "printqdc.ctr"
+#line 722 "printqdc.ctr"
cc = 0;
}
} else {
-#line 715 "printqdc.ctr"
+#line 725 "printqdc.ctr"
iexval = EXIT_FAILURE;
cc = -1;
}
} else {
-#line 719 "printqdc.ctr"
+#line 729 "printqdc.ctr"
cc = -1;
}
} while (1 == cc);
} else {
-#line 723 "printqdc.ctr"
+#line 733 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Failed to shut down socket */
log_1(11);
}
} else {
-#line 728 "printqdc.ctr"
+#line 738 "printqdc.ctr"
}
} else {
-#line 730 "printqdc.ctr"
+#line 740 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Sending data failed */
log_1(12);
}
} else {
-#line 735 "printqdc.ctr"
+#line 745 "printqdc.ctr"
}
dk4socket_close(sock, NULL);
} else {
-#line 738 "printqdc.ctr"
+#line 748 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Failed to open socket */
log_1(13);
}
} else {
-#line 743 "printqdc.ctr"
+#line 753 "printqdc.ctr"
}
-#line 745 "printqdc.ctr"
+#line 755 "printqdc.ctr"
}
@@ -888,7 +876,7 @@ lprng_final_quote(char *str, char quote)
char *back = NULL;
-#line 760 "printqdc.ctr"
+#line 770 "printqdc.ctr"
while (('\0' != *str) && (NULL == back)) {
if (quote == *str) {
*str = '\0';
@@ -910,7 +898,7 @@ lprng_final_quote(char *str, char quote)
}
-#line 780 "printqdc.ctr"
+#line 790 "printqdc.ctr"
return back;
}
@@ -926,7 +914,7 @@ lprng_next_word(char *str)
char *back = NULL;
-#line 794 "printqdc.ctr"
+#line 804 "printqdc.ctr"
switch (*str) {
case '\'' : {
back = lprng_final_quote(&(str[1]), '\'');
@@ -939,7 +927,7 @@ lprng_next_word(char *str)
} break;
}
-#line 805 "printqdc.ctr"
+#line 815 "printqdc.ctr"
return back;
}
@@ -958,7 +946,7 @@ lprng_info_from_line(lprng_info_t *liptr, char *textline)
int back = 1;
-#line 822 "printqdc.ctr"
+#line 832 "printqdc.ctr"
DK4_MEMRES(liptr, sizeof(lprng_info_t));
liptr->username = NULL; liptr->queuename = NULL;
liptr->jobtitle = NULL; liptr->pagecount = NULL;
@@ -985,7 +973,7 @@ lprng_info_from_line(lprng_info_t *liptr, char *textline)
}
} else {
-#line 847 "printqdc.ctr"
+#line 857 "printqdc.ctr"
#if 0
/* 2016-02-15 Simply ignore non-option text.
*/
@@ -997,7 +985,7 @@ lprng_info_from_line(lprng_info_t *liptr, char *textline)
}
-#line 857 "printqdc.ctr"
+#line 867 "printqdc.ctr"
return back;
}
@@ -1019,7 +1007,7 @@ lprng_line(int cmd, char *args)
int ok = 0; /* Flag: Can process line */
-#line 877 "printqdc.ctr"
+#line 887 "printqdc.ctr"
if (0 != lprng_info_from_line(&li, args)) {
switch (cmd) {
case 0: {
@@ -1032,7 +1020,7 @@ lprng_line(int cmd, char *args)
if (0 != dk4str8_cat_s(inbuf,sizeof(inbuf),pqdc_kw[0], NULL)) {
ok = 1;
-#line 888 "printqdc.ctr"
+#line 898 "printqdc.ctr"
}
}
}
@@ -1043,14 +1031,14 @@ lprng_line(int cmd, char *args)
process_data(1);
} else {
-#line 897 "printqdc.ctr"
+#line 907 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Failed to construct request */
log_1(14);
}
} else {
-#line 902 "printqdc.ctr"
+#line 912 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Incomplete information */
log_1(15);
@@ -1092,32 +1080,32 @@ lprng_line(int cmd, char *args)
}
if (0 != ok) {
-#line 942 "printqdc.ctr"
+#line 952 "printqdc.ctr"
process_data(0);
} else {
-#line 944 "printqdc.ctr"
+#line 954 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Failed to construct request */
log_1(14);
}
} else {
-#line 949 "printqdc.ctr"
+#line 959 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Pagecounter not numeric */
log_1(16);
}
} else {
-#line 954 "printqdc.ctr"
+#line 964 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Incomplete information */
log_1(15);
}
} else {
-#line 959 "printqdc.ctr"
+#line 969 "printqdc.ctr"
iexval = EXIT_FAILURE;
/* ERROR: Incomplete information */
log_1(15);
@@ -1129,7 +1117,7 @@ lprng_line(int cmd, char *args)
}
-#line 969 "printqdc.ctr"
+#line 979 "printqdc.ctr"
}
@@ -1152,24 +1140,24 @@ printqd_line(char *args, size_t minargs, int num3, int pres)
int errnum = 0; /* Flag: Numeric error */
-#line 990 "printqdc.ctr"
+#line 1000 "printqdc.ctr"
dk4str8_normalize(args, NULL);
i = 0;
-#line 992 "printqdc.ctr"
+#line 1002 "printqdc.ctr"
while(args) {
i++;
next = dk4str8_next(args, NULL);
if ((3 == i) && (0 != num3)) {
-#line 996 "printqdc.ctr"
+#line 1006 "printqdc.ctr"
res = dk4ma_input_c8_dec_dk4_um_t(&um, args, &ep, 1, NULL);
if (0 == res) { errnum = 1; }
}
args = next;
}
-#line 1001 "printqdc.ctr"
+#line 1011 "printqdc.ctr"
if ((i >= minargs) && (0 == errnum)) {
process_data(pres);
} else {
@@ -1185,7 +1173,7 @@ printqd_line(char *args, size_t minargs, int num3, int pres)
}
-#line 1015 "printqdc.ctr"
+#line 1025 "printqdc.ctr"
}
@@ -1201,21 +1189,21 @@ process_input(void)
int res; /* Operation result for numeric conversions */
-#line 1029 "printqdc.ctr"
+#line 1039 "printqdc.ctr"
cc = 1;
do {
if (0 != can_continue()) {
-#line 1032 "printqdc.ctr"
+#line 1042 "printqdc.ctr"
if (fgets(inbuf, sizeof(inbuf), stdin)) {
-#line 1033 "printqdc.ctr"
+#line 1043 "printqdc.ctr"
dk4str8_cpy_s(cpbuf, sizeof(cpbuf), inbuf, NULL);
dk4str8_delnl(cpbuf);
if (NULL != dk4str8_start(cpbuf, NULL)) {
if (0 != intera) {
-#line 1037 "printqdc.ctr"
+#line 1047 "printqdc.ctr"
fputs(cpbuf, stdout);
fputc('\n', stdout);
fflush(stdout);
@@ -1223,7 +1211,7 @@ process_input(void)
args = dk4str8_next(cpbuf, NULL);
if (NULL != args) {
-#line 1043 "printqdc.ctr"
+#line 1053 "printqdc.ctr"
res = dk4str8_array_index(command_names, cpbuf, 0);
if (0 != can_continue()) {
switch (res) {
@@ -1271,30 +1259,30 @@ process_input(void)
}
} else {
-#line 1089 "printqdc.ctr"
+#line 1099 "printqdc.ctr"
/* ERROR: No arguments */
log_1(19);
iexval = EXIT_FAILURE;
}
} else {
-#line 1094 "printqdc.ctr"
+#line 1104 "printqdc.ctr"
}
} else {
-#line 1096 "printqdc.ctr"
+#line 1106 "printqdc.ctr"
eof_found = 1;
cc = 0;
}
} else {
-#line 1100 "printqdc.ctr"
+#line 1110 "printqdc.ctr"
cc = -1;
}
} while (1 == cc);
-#line 1104 "printqdc.ctr"
+#line 1114 "printqdc.ctr"
}
@@ -1438,10 +1426,10 @@ main(int argc, char *argv[])
*/
-#line 1246 "printqdc.ctr"
+#line 1256 "printqdc.ctr"
-#line 1247 "printqdc.ctr"
+#line 1257 "printqdc.ctr"
/* Process command line arguments
*/
@@ -1466,7 +1454,7 @@ main(int argc, char *argv[])
iexval = EXIT_SUCCESS;
-#line 1270 "printqdc.ctr"
+#line 1280 "printqdc.ctr"
process_input();
finished:
@@ -1533,10 +1521,10 @@ main(int argc, char *argv[])
*/
-#line 1335 "printqdc.ctr"
+#line 1345 "printqdc.ctr"
-#line 1336 "printqdc.ctr"
+#line 1346 "printqdc.ctr"
/* Exit
*/
diff --git a/support/dktools/printqdc.ctr b/support/dktools/printqdc.ctr
index 35be526772..3f94bec715 100644
--- a/support/dktools/printqdc.ctr
+++ b/support/dktools/printqdc.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -44,8 +44,13 @@ license = bsd
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -96,6 +101,7 @@ license = bsd
#include "dk4opt.h"
#include "dk4sock.h"
#include "dk4vers.h"
+#include "dk4unused.h"
@@ -168,7 +174,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
DK tools and libraries license
==============================
@@ -178,27 +185,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
$!end
};
@@ -280,7 +287,7 @@ $!end
/** Default socket name.
*/
static const char def_sock_name[] = {
- DK4_INST_DIR_VAR "/run/printqd/printqd.sock"
+ DK4_INST_DIR_RUNSTATE "/printqd/printqd.sock"
};
@@ -428,8 +435,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -440,8 +448,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -451,8 +460,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
diff --git a/support/dktools/printqds.h b/support/dktools/printqds.h
index f2de51c751..48bc32c008 100644
--- a/support/dktools/printqds.h
+++ b/support/dktools/printqds.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef PRINTQDS_H_INCLUDED
/** Protection against multiple inclusion. */
diff --git a/support/dktools/prmonsnmp.c b/support/dktools/prmonsnmp.c
index 5842a9ca1a..0864bcaadd 100644
--- a/support/dktools/prmonsnmp.c
+++ b/support/dktools/prmonsnmp.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: prmonsnmp.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: prmonsnmp.ctr
*/
/** @file prmonsnmp.c The prmonsnmp module.
@@ -236,12 +214,13 @@ NULL
#include "dk4enc.h"
#include "dk4loc.h"
#include "dk4vers.h"
+#include "dk4unused.h"
-#line 181 "prmonsnmp.ctr"
+#line 182 "prmonsnmp.ctr"
@@ -272,7 +251,7 @@ static const char * const long_options[] = {
NULL
-#line 204 "prmonsnmp.ctr"
+#line 205 "prmonsnmp.ctr"
};
@@ -288,10 +267,6 @@ static const oid prmonsnmp_oid_ds[] = {
*/
static size_t const pjsnmp_sz_oid_ds = sizeof(prmonsnmp_oid_ds)/sizeof(oid);
-/** Size of device status OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_ds = sizeof(prmonsnmp_oid_ds);
-
/** OID for printer status.
*/
@@ -304,10 +279,6 @@ static const oid prmonsnmp_oid_ps[] = {
*/
static size_t const pjsnmp_sz_oid_ps = sizeof(prmonsnmp_oid_ps)/sizeof(oid);
-/** Size of printer status OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_ps = sizeof(prmonsnmp_oid_ps);
-
/** OID for pagecount value.
*/
@@ -320,10 +291,6 @@ static const oid prmonsnmp_oid_pc[] = {
*/
static size_t const pjsnmp_sz_oid_pc = sizeof(prmonsnmp_oid_pc)/sizeof(oid);
-/** Size of page counter OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_pc = sizeof(prmonsnmp_oid_pc);
-
/** Printer error OID.
*/
@@ -336,10 +303,6 @@ static const oid prmonsnmp_oid_pe[] = {
*/
static size_t const pjsnmp_sz_oid_pe = sizeof(prmonsnmp_oid_pe)/sizeof(oid);
-/** Size of printer error OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_pe = sizeof(prmonsnmp_oid_pe);
-
/** Status text OID.
*/
static const oid prmonsnmp_oid_st[] = {
@@ -351,11 +314,6 @@ static const oid prmonsnmp_oid_st[] = {
*/
static size_t const pjsnmp_sz_oid_st = sizeof(prmonsnmp_oid_st)/sizeof(oid);
-/** Size of printer error OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_st = sizeof(prmonsnmp_oid_st);
-
-
/** Help text.
*/
@@ -378,7 +336,7 @@ static const char * const help_text[] = {
NULL
-#line 308 "prmonsnmp.ctr"
+#line 288 "prmonsnmp.ctr"
};
@@ -391,7 +349,8 @@ static const char * const license_text[] = {
"a library:",
"",
"dktools\t\tDirk Krause's tools and libraries.",
-"\t\tSee http://dktools.sourceforge.net/ for more information.",
+"\t\tSee http://sourceforge.net/p/dktools/wiki/Home/",
+"\t\tfor more information.",
#if DK4_HAVE_LIBNETSNMP
"Net-SNMP\tSNMP access library.",
"\t\tSee http://net-snmp.sourceforge.net/ for more information.",
@@ -428,27 +387,27 @@ static const char * const license_text[] = {
"Redistribution and use in source and binary forms, with or without",
"modification, are permitted provided that the following conditions are met:",
"",
-"* Redistributions of source code must retain the above copyright notice,",
-" this list of conditions and the following disclaimer.",
-"* Redistributions in binary form must reproduce the above copyright",
-" notice, this list of conditions and the following disclaimer in the",
-" documentation and/or other materials provided with the distribution.",
-"* Neither the name of the Dirk Krause nor the names of contributors may be",
-" used to endorse or promote products derived from this software without",
-" specific prior written permission.",
-"",
-"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"",
-"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
-"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE",
-"ARE DISCLAIMED.",
-"",
-"IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,",
-"INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,",
-"BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,",
-"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY",
-"OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING",
-"NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,",
-"EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+"1. Redistributions of source code must retain the above copyright notice,",
+" this list of conditions and the following disclaimer.",
+"2. Redistributions in binary form must reproduce the above copyright",
+" notice, this list of conditions and the following disclaimer in the",
+" documentation and/or other materials provided with the distribution.",
+"3. Neither the name of the copyright holder nor the names of its",
+" contributors may be used to endorse or promote products derived from",
+" this software without specific prior written permission.",
+"",
+"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS",
+"``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT",
+"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR",
+"A PARTICULAR PURPOSE ARE DISCLAIMED.",
+"IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY",
+"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
+"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR",
+"SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER",
+"CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT",
+"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY",
+"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF",
+"SUCH DAMAGE.",
#if DK4_HAVE_LIBNETSNMP
"",
"",
@@ -902,7 +861,7 @@ static const char * const license_text[] = {
NULL
-#line 830 "prmonsnmp.ctr"
+#line 811 "prmonsnmp.ctr"
};
@@ -931,7 +890,7 @@ static const char * const snmp_version_names[] = {
NULL
-#line 849 "prmonsnmp.ctr"
+#line 830 "prmonsnmp.ctr"
};
@@ -995,7 +954,7 @@ static
DK4_VOLATILE
dk4_sig_atomic_t sig_had_term = 0;
-static int encoding = DK4_ENCODING_ASCII;
+static int encoding = DK4_ENCODING_PLAIN;
#endif
/** Exit status code.
@@ -1033,8 +992,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -1045,8 +1005,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -1056,8 +1017,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -1183,11 +1145,11 @@ get_int(int *iptr, struct variable_list *var)
int back = 0;
-#line 1099 "prmonsnmp.ctr"
+#line 1083 "prmonsnmp.ctr"
switch (var->type) {
case ASN_OCTET_STR : {
-#line 1101 "prmonsnmp.ctr"
+#line 1085 "prmonsnmp.ctr"
if ((var->val_len > 0) && (var->val_len < sizeof(bu))) {
dk4mem_cpy(bu, (void *)((var->val).string), var->val_len, NULL);
bu[var->val_len] = '\0';
@@ -1202,7 +1164,7 @@ get_int(int *iptr, struct variable_list *var)
case ASN_COUNTER :
case ASN_INTEGER : {
-#line 1114 "prmonsnmp.ctr"
+#line 1098 "prmonsnmp.ctr"
l = *((var->val).integer);
*iptr = (int)l;
back = 1;
@@ -1210,7 +1172,7 @@ get_int(int *iptr, struct variable_list *var)
}
-#line 1120 "prmonsnmp.ctr"
+#line 1104 "prmonsnmp.ctr"
return back;
}
@@ -1229,11 +1191,11 @@ get_ul(unsigned long *ulptr, struct variable_list *var)
int back = 0;
-#line 1137 "prmonsnmp.ctr"
+#line 1121 "prmonsnmp.ctr"
switch (var->type) {
case ASN_OCTET_STR : {
-#line 1139 "prmonsnmp.ctr"
+#line 1123 "prmonsnmp.ctr"
if (0 < var->val_len) {
ul |=
((((unsigned long)(((var->val).string)[0])) << 24) & 0xFF000000UL);
@@ -1260,7 +1222,7 @@ get_ul(unsigned long *ulptr, struct variable_list *var)
case ASN_COUNTER :
case ASN_INTEGER : {
-#line 1164 "prmonsnmp.ctr"
+#line 1148 "prmonsnmp.ctr"
l = *((var->val).integer);
if (0L <= l) {
*ulptr = (unsigned long)l;
@@ -1270,7 +1232,7 @@ get_ul(unsigned long *ulptr, struct variable_list *var)
}
-#line 1172 "prmonsnmp.ctr"
+#line 1156 "prmonsnmp.ctr"
return back;
}
@@ -1408,7 +1370,7 @@ run_main_loop(void)
lst = 0;
must_show = 0;
-#line 1308 "prmonsnmp.ctr"
+#line 1292 "prmonsnmp.ctr"
must_flush = 0;
if (0 != can_continue(0)) {
rq = snmp_pdu_create(SNMP_MSG_GET);
@@ -1469,34 +1431,34 @@ run_main_loop(void)
if (0 != (1 & found)) {
if (devst != odevst) {
-#line 1367 "prmonsnmp.ctr"
+#line 1351 "prmonsnmp.ctr"
must_show = 1;
}
}
if (0 != (2 & found)) {
if (prist != oprist) {
-#line 1372 "prmonsnmp.ctr"
+#line 1356 "prmonsnmp.ctr"
must_show = 1;
}
}
if (0 != (4 & found)) {
if (cond != ocond) {
-#line 1377 "prmonsnmp.ctr"
+#line 1361 "prmonsnmp.ctr"
must_show = 1;
}
}
if (0 != (8 & found)) {
if (lst != olst) {
-#line 1382 "prmonsnmp.ctr"
+#line 1366 "prmonsnmp.ctr"
must_show = 1;
}
if (0 != dk4mem_cmp(statext, ostatext, lst, NULL)) {
-#line 1386 "prmonsnmp.ctr"
+#line 1370 "prmonsnmp.ctr"
must_show = 1;
}
}
@@ -1548,7 +1510,7 @@ run_main_loop(void)
if (0 != (8 & found)) {
if (0 < lst) {
uptr = (unsigned char *)statext;
- for (i = 0; i < lst; i++) {
+ for (i = 0; (size_t)i < lst; i++) {
if (0 < i) {
if (0 == (i % 24)) {
fputc('\n', stdout);
@@ -1809,7 +1771,7 @@ run_hvl(void)
{
-#line 1697 "prmonsnmp.ctr"
+#line 1681 "prmonsnmp.ctr"
if (0 != (1 & hvl)) {
show_text(help_text);
}
@@ -1824,7 +1786,7 @@ run_hvl(void)
exval = EXIT_SUCCESS;
-#line 1710 "prmonsnmp.ctr"
+#line 1694 "prmonsnmp.ctr"
}
@@ -1843,7 +1805,7 @@ int main(int argc, char *argv[])
/* +++++ Required libraries available */
dkChar blang[32];
dkChar breg[32];
- struct snmp_session template;
+ struct snmp_session sesstemp;
#if DK4_HAVE_SIGACTION
#ifdef SIGPIPE
struct sigaction opipe;
@@ -1871,10 +1833,10 @@ int main(int argc, char *argv[])
#endif
-#line 1755 "prmonsnmp.ctr"
+#line 1739 "prmonsnmp.ctr"
-#line 1756 "prmonsnmp.ctr"
+#line 1740 "prmonsnmp.ctr"
/* Set signal handlers.
--------------------
@@ -1952,7 +1914,7 @@ int main(int argc, char *argv[])
------------------
*/
if (0 == dk4loc_get_settings(blang, szblang, breg, szbreg, &encoding, NULL)) {
- encoding = DK4_ENCODING_ASCII;
+ encoding = DK4_ENCODING_PLAIN;
}
/* Process command line arguments.
-------------------------------
@@ -1972,32 +1934,32 @@ int main(int argc, char *argv[])
#if DK4_HAVE_SNMP_DISABLE_SYSLOG
-#line 1852 "prmonsnmp.ctr"
+#line 1836 "prmonsnmp.ctr"
snmp_disable_syslog();
#endif
#if DK4_HAVE_SNMP_DISABLE_FILELOG
-#line 1856 "prmonsnmp.ctr"
+#line 1840 "prmonsnmp.ctr"
snmp_disable_filelog();
#endif
#if DK4_HAVE_SNMP_DISABLE_STDERRLOG
-#line 1860 "prmonsnmp.ctr"
+#line 1844 "prmonsnmp.ctr"
snmp_disable_stderrlog();
#endif
init_snmp(prmonsnmp_kw[2]);
- DK4_MEMRES(&template, sizeof(template));
- snmp_sess_init(&template);
- template.version = snmp_vers;
- template.peername = host_name;
- template.community = (unsigned char *)snmp_comm;
+ DK4_MEMRES(&sesstemp, sizeof(sesstemp));
+ snmp_sess_init(&sesstemp);
+ sesstemp.version = snmp_vers;
+ sesstemp.peername = host_name;
+ sesstemp.community = (unsigned char *)snmp_comm;
if (NULL == snmp_comm) {
- template.community = (unsigned char *)(prmonsnmp_kw[3]);
+ sesstemp.community = (unsigned char *)(prmonsnmp_kw[3]);
}
- template.community_len = strlen((char *)(template.community));
- snmp_sess = snmp_open(&template);
+ sesstemp.community_len = strlen((char *)(sesstemp.community));
+ snmp_sess = snmp_open(&sesstemp);
if (NULL == snmp_sess) {
/* ERROR: Failed to open session */
fputs(prmonsnmp_kw[2], stderr);
@@ -2064,10 +2026,10 @@ int main(int argc, char *argv[])
-#line 1938 "prmonsnmp.ctr"
+#line 1922 "prmonsnmp.ctr"
-#line 1939 "prmonsnmp.ctr"
+#line 1923 "prmonsnmp.ctr"
/* ----- Required libraries available */
#else
diff --git a/support/dktools/prmonsnmp.ctr b/support/dktools/prmonsnmp.ctr
index 3d92551b06..bdf92f2b9a 100644
--- a/support/dktools/prmonsnmp.ctr
+++ b/support/dktools/prmonsnmp.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -174,6 +174,7 @@ $!end
#include "dk4enc.h"
#include "dk4loc.h"
#include "dk4vers.h"
+#include "dk4unused.h"
@@ -216,10 +217,6 @@ static const oid prmonsnmp_oid_ds[] = {
*/
static size_t const pjsnmp_sz_oid_ds = sizeof(prmonsnmp_oid_ds)/sizeof(oid);
-/** Size of device status OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_ds = sizeof(prmonsnmp_oid_ds);
-
/** OID for printer status.
*/
@@ -232,10 +229,6 @@ static const oid prmonsnmp_oid_ps[] = {
*/
static size_t const pjsnmp_sz_oid_ps = sizeof(prmonsnmp_oid_ps)/sizeof(oid);
-/** Size of printer status OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_ps = sizeof(prmonsnmp_oid_ps);
-
/** OID for pagecount value.
*/
@@ -248,10 +241,6 @@ static const oid prmonsnmp_oid_pc[] = {
*/
static size_t const pjsnmp_sz_oid_pc = sizeof(prmonsnmp_oid_pc)/sizeof(oid);
-/** Size of page counter OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_pc = sizeof(prmonsnmp_oid_pc);
-
/** Printer error OID.
*/
@@ -264,10 +253,6 @@ static const oid prmonsnmp_oid_pe[] = {
*/
static size_t const pjsnmp_sz_oid_pe = sizeof(prmonsnmp_oid_pe)/sizeof(oid);
-/** Size of printer error OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_pe = sizeof(prmonsnmp_oid_pe);
-
/** Status text OID.
*/
static const oid prmonsnmp_oid_st[] = {
@@ -279,11 +264,6 @@ static const oid prmonsnmp_oid_st[] = {
*/
static size_t const pjsnmp_sz_oid_st = sizeof(prmonsnmp_oid_st)/sizeof(oid);
-/** Size of printer error OID (number of bytes).
-*/
-static size_t const pjsnmp_bytes_oid_st = sizeof(prmonsnmp_oid_st);
-
-
/** Help text.
*/
@@ -318,7 +298,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_LIBNETSNMP
Net-SNMP SNMP access library.
See http://net-snmp.sourceforge.net/ for more information.
@@ -355,27 +336,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
#if DK4_HAVE_LIBNETSNMP
@@ -909,7 +890,7 @@ static
DK4_VOLATILE
dk4_sig_atomic_t sig_had_term = 0;
-static int encoding = DK4_ENCODING_ASCII;
+static int encoding = DK4_ENCODING_PLAIN;
#endif
/** Exit status code.
@@ -947,8 +928,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -959,8 +941,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -970,8 +953,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -1434,7 +1418,7 @@ run_main_loop(void)
if (0 != (8 & found)) {
if (0 < lst) {
uptr = (unsigned char *)statext;
- for (i = 0; i < lst; i++) {
+ for (i = 0; (size_t)i < lst; i++) {
if (0 < i) {
if (0 == (i % 24)) {
fputc('\n', stdout);
@@ -1725,7 +1709,7 @@ int main(int argc, char *argv[])
/* +++++ Required libraries available */
dkChar blang[32];
dkChar breg[32];
- struct snmp_session template;
+ struct snmp_session sesstemp;
#if DK4_HAVE_SIGACTION
#ifdef SIGPIPE
struct sigaction opipe;
@@ -1830,7 +1814,7 @@ int main(int argc, char *argv[])
------------------
*/
if (0 == dk4loc_get_settings(blang, szblang, breg, szbreg, &encoding, NULL)) {
- encoding = DK4_ENCODING_ASCII;
+ encoding = DK4_ENCODING_PLAIN;
}
/* Process command line arguments.
-------------------------------
@@ -1860,16 +1844,16 @@ int main(int argc, char *argv[])
snmp_disable_stderrlog();
#endif
init_snmp(prmonsnmp_kw[2]);
- DK4_MEMRES(&template, sizeof(template));
- snmp_sess_init(&template);
- template.version = snmp_vers;
- template.peername = host_name;
- template.community = (unsigned char *)snmp_comm;
+ DK4_MEMRES(&sesstemp, sizeof(sesstemp));
+ snmp_sess_init(&sesstemp);
+ sesstemp.version = snmp_vers;
+ sesstemp.peername = host_name;
+ sesstemp.community = (unsigned char *)snmp_comm;
if (NULL == snmp_comm) {
- template.community = (unsigned char *)(prmonsnmp_kw[3]);
+ sesstemp.community = (unsigned char *)(prmonsnmp_kw[3]);
}
- template.community_len = strlen((char *)(template.community));
- snmp_sess = snmp_open(&template);
+ sesstemp.community_len = strlen((char *)(sesstemp.community));
+ snmp_sess = snmp_open(&sesstemp);
if (NULL == snmp_sess) {
/* ERROR: Failed to open session */
fputs(prmonsnmp_kw[2], stderr);
diff --git a/support/dktools/resources/GNUmakefile b/support/dktools/resources/GNUmakefile
deleted file mode 100644
index 0295552cde..0000000000
--- a/support/dktools/resources/GNUmakefile
+++ /dev/null
@@ -1,60 +0,0 @@
-
-XPMS= \
- ../choose-dir.xpm \
- ../dkclock.xpm \
- ../dkicon.xpm \
- ../exit-program.xpm \
- ../run2.xpm \
- ../run-conversion.xpm \
- ../set-options.xpm \
- ../wxdkscrsz.xpm
-
-ICONS= \
- ../dkclock.ico \
- ../dkctinst.ico \
- ../dkctunin.ico \
- ../dkicon.ico \
- ../wxdkscrsz.ico
-
-SPLASH= \
- ../splash-dktoolian.png
-
-../%.xpm: %.fig
- gxhconvert -o=xpm -a $*.fig
- mv $*.xpm ..
-
-../%.ico: %.fig
- gxhconvert -o=ico -a $*.fig
- mv $*.ico ..
-
-build: # Create *.xpm and *.ico files
-build: $(XPMS) $(ICONS) $(SPLASH)
- touch test.dat
- [ ! -f ../favicon.ico ] || rm -f ../favicon.ico
- ln ../dkicon.ico ../favicon.ico
- rm -f test.dat *.ico *.xpm
-
-../splash-dktoolian.png: splash-dktoolian.fig
- fig2lat -ltex.pdf splash-dktoolian.fig
- pdflatex -interaction=batchmode splash-dktoolian || pdflatex -interaction=nonstopmode -halt-on-error -file-line-error splash-dktoolian
- pdftoppm -r 160 splash-dktoolian.pdf | pnmtopng > splash-dktoolian.png
- ls -l splash-dktoolian.png
- pngnq -n 64 splash-dktoolian.png
- mv splash-dktoolian-nq8.png splash-dktoolian.png
- ls -l splash-dktoolian.png
- optipng -q -zc1-9 -zm1-9 -zs0-3 -f0-5 splash-dktoolian.png
- ls -l splash-dktoolian.png
- mv splash-dktoolian.png ..
- [ ! -f splash-dktoolian.aux ] || rm -fr splash-dktoolian.aux
- [ ! -f splash-dktoolian.log ] || rm -fr splash-dktoolian.log
- [ ! -f splash-dktoolian.pdf ] || rm -fr splash-dktoolian.pdf
- [ ! -f splash-dktoolian-i.pdf ] || rm -fr splash-dktoolian-i.pdf
- [ ! -f splash-dktoolian.tex ] || rm -fr splash-dktoolian.tex
-
-clean: # Clean up (remove *.xpm and *.ico files)
-clean:
- -rm -f *.xpm *.ico *.aux *.png *.pgm *.pnm *.ppm *.pdf *.svg *.log *.tex
-
-help: # Show targets in GNUmakefile
- @echo 'Here is a list of the targets in this GNUmakefile:'
- -@egrep '^[^:;= ]*::?[ ]*' GNUmakefile|grep '#'|grep -v '^#'
diff --git a/support/dktools/resources/choose-dir.fig b/support/dktools/resources/choose-dir.fig
deleted file mode 100644
index e8b2326ed3..0000000000
--- a/support/dktools/resources/choose-dir.fig
+++ /dev/null
@@ -1,20 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 7 7 999 1 -1 1.00 0 0 0 0 0 5
- 0 0 1200 0 1200 1125 0 1125 0 0
-2 3 0 3 0 31 101 1 20 1.00 0 0 12 0 0 5
- 975 150 975 300 525 300 675 150
- 975 150
-2 3 0 3 0 31 101 1 20 0 0 0 12 0 0 7
- 975 150 825 300 150 300 150 975
- 1050 975 1050 150 975 150
-2 3 0 3 0 31 100 1 20 0 0 0 12 0 0 5
- 675 150 525 300 225 300 375 150
- 675 150
diff --git a/support/dktools/resources/dkclock.fig b/support/dktools/resources/dkclock.fig
deleted file mode 100644
index b31b98ea3e..0000000000
--- a/support/dktools/resources/dkclock.fig
+++ /dev/null
@@ -1,27 +0,0 @@
-#FIG 3.2 Produced by xfig version 3.2.5a
-Portrait
-Center
-Inches
-A4
-100.00
-Single
--2
-1200 2
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 210 375 75 75 135 300 285 450
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 150 600 75 75 75 525 225 675
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 210 825 75 75 135 750 285 900
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 375 989 75 75 300 914 450 1064
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 600 1050 75 75 525 975 675 1125
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 825 989 75 75 750 914 900 1064
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 989 825 75 75 914 750 1064 900
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 1050 600 75 75 975 525 1125 675
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 989 375 75 75 914 300 1064 450
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 825 210 75 75 750 135 900 285
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 600 150 75 75 525 75 675 225
-1 1 0 1 0 0 97 1 20 6.400 1 0.0000 375 210 75 75 300 135 450 285
-2 2 0 0 31 31 999 1 20 1.000 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-2 1 0 8 0 0 100 1 -1 0.000 0 1 12 0 0 2
- 600 300 600 600
-2 1 0 8 0 0 100 1 -1 0.000 0 1 12 0 0 2
- 750 600 600 600
diff --git a/support/dktools/resources/dkctinst.fig b/support/dktools/resources/dkctinst.fig
deleted file mode 100644
index 9f0d368117..0000000000
--- a/support/dktools/resources/dkctinst.fig
+++ /dev/null
@@ -1,13 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 14 14 101 1 20 1.00 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-4 2 0 100 1 30 42.0 0.0 4 833.0 616.0 562 525 D\001
-4 0 0 100 1 30 42.0 0.0 4 833.0 616.0 637 1087 K\001
diff --git a/support/dktools/resources/dkctunin.fig b/support/dktools/resources/dkctunin.fig
deleted file mode 100644
index 77a98659fb..0000000000
--- a/support/dktools/resources/dkctunin.fig
+++ /dev/null
@@ -1,13 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 4 4 101 1 20 1.00 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-4 2 0 100 1 30 42.0 0.0 4 833.0 616.0 562 525 D\001
-4 0 0 100 1 30 42.0 0.0 4 833.0 616.0 637 1087 K\001
diff --git a/support/dktools/resources/dkicon.fig b/support/dktools/resources/dkicon.fig
deleted file mode 100644
index 5e6a6ed94a..0000000000
--- a/support/dktools/resources/dkicon.fig
+++ /dev/null
@@ -1,13 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 31 31 101 1 20 0 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-4 2 0 100 1 30 42.0 0.0 4 833.0 617.0 637 600 D\001
-4 0 0 100 1 30 42.0 0.0 4 833.0 616.0 637 1087 K\001
diff --git a/support/dktools/resources/exit-program.fig b/support/dktools/resources/exit-program.fig
deleted file mode 100644
index d74c8bab7f..0000000000
--- a/support/dktools/resources/exit-program.fig
+++ /dev/null
@@ -1,18 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 7 7 999 1 -1 6.40 0 0 0 0 0 5
- 0 0 1200 0 1200 1125 0 1125 0 0
-2 2 0 0 7 7 103 1 20 6.40 0 0 0 0 0 5
- 300 150 900 150 900 975 300 975 300 150
-2 3 0 0 20 20 100 1 20 6.40 0 0 12 0 0 5
- 300 150 675 150 675 750 300 975
- 300 150
-2 2 0 3 0 0 100 1 -1 6.40 0 0 0 0 0 5
- 300 150 900 150 900 975 300 975 300 150
diff --git a/support/dktools/resources/favicon.fig b/support/dktools/resources/favicon.fig
deleted file mode 100644
index 5e6a6ed94a..0000000000
--- a/support/dktools/resources/favicon.fig
+++ /dev/null
@@ -1,13 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 31 31 101 1 20 0 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-4 2 0 100 1 30 42.0 0.0 4 833.0 617.0 637 600 D\001
-4 0 0 100 1 30 42.0 0.0 4 833.0 616.0 637 1087 K\001
diff --git a/support/dktools/resources/run-conversion.fig b/support/dktools/resources/run-conversion.fig
deleted file mode 100644
index 8561402a37..0000000000
--- a/support/dktools/resources/run-conversion.fig
+++ /dev/null
@@ -1,13 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 7 7 999 1 -1 0 0 0 0 0 0 5
- 0 0 1200 0 1200 1125 0 1125 0 0
-2 3 0 1 12 12 100 1 20 1.00 0 0 12 0 0 4
- 150 150 1050 600 150 975 150 150
diff --git a/support/dktools/resources/run2.fig b/support/dktools/resources/run2.fig
deleted file mode 100644
index 962549007a..0000000000
--- a/support/dktools/resources/run2.fig
+++ /dev/null
@@ -1,13 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 7 7 999 1 -1 0 0 0 0 0 0 5
- 0 0 1200 0 1200 1200 0 1200 0 0
-2 3 0 1 12 12 100 1 20 0 0 0 12 0 0 4
- 75 75 1125 600 75 1125 75 75
diff --git a/support/dktools/resources/set-options.fig b/support/dktools/resources/set-options.fig
deleted file mode 100644
index 3be4a5be9a..0000000000
--- a/support/dktools/resources/set-options.fig
+++ /dev/null
@@ -1,15 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 7 7 999 1 -1 1.00 0 0 0 0 0 5
- 0 0 1200 0 1200 1125 0 1125 0 0
-2 2 0 3 0 0 100 1 5 0 0 0 0 0 0 5
- 300 300 900 300 900 900 300 900 300 300
-2 1 0 5 12 0 99 1 -1 0 0 0 12 0 0 3
- 225 525 600 975 1050 150
diff --git a/support/dktools/resources/splash-dktoolian.fig b/support/dktools/resources/splash-dktoolian.fig
deleted file mode 100644
index a778832a8b..0000000000
--- a/support/dktools/resources/splash-dktoolian.fig
+++ /dev/null
@@ -1,20 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 0 0 104 1 8 0 0 0 0 0 0 5
- 0 0 4800 0 4800 3600 0 3600 0 0
-2 2 0 0 0 0 103 1 12 0 0 0 0 0 0 5
- 75 75 4725 75 4725 3525 75 3525 75 75
-2 2 0 0 0 0 102 1 16 0 0 0 0 0 0 5
- 150 150 4650 150 4650 3450 150 3450 150 150
-2 2 0 0 0 0 101 1 20 0 0 0 0 0 0 5
- 225 225 4575 225 4575 3375 225 3375 225 225
-4 1 31 100 1 28 12.0 0.0 4 250.0 4533.0 2400 750 Debian GNU/Linux based rescue live system\001
-4 1 31 100 1 28 12.0 0.0 4 250.0 1900.0 2400 975 including DK tools\001
-4 1 31 100 1 30 18.0 0.0 4 366.0 1716.0 2400 525 DKtoolian\001
diff --git a/support/dktools/resources/toolbase.fig b/support/dktools/resources/toolbase.fig
deleted file mode 100644
index 27dd122d66..0000000000
--- a/support/dktools/resources/toolbase.fig
+++ /dev/null
@@ -1,14 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-2 2 0 0 4 4 999 1 20 1.00 0 0 0 0 0 5
- 0 37 600 37 600 600 0 600 0 37
-5 1 0 5 0 0 100 1 -1 0 0 1 0 0 300.0 330.0 225 150 300 525 375 150
-2 1 0 5 0 0 100 1 -1 0 0 0 12 0 0 2
- 300 75 300 290
diff --git a/support/dktools/resources/wxdkscrsz.fig b/support/dktools/resources/wxdkscrsz.fig
deleted file mode 100644
index 951aaec89e..0000000000
--- a/support/dktools/resources/wxdkscrsz.fig
+++ /dev/null
@@ -1,25 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.0
-Single
--2
-1200 2
-0 32 #c0c0c0
-2 2 0 0 31 31 999 1 20 0 0 0 0 0 0 5
- 1200 1200 2400 1200 2400 2400 1200 2400 1200 1200
-2 2 0 3 7 0 100 1 -1 0 0 0 0 0 0 5
- 1275 1537 2325 1537 2325 2100 1275 2100 1275 1537
-2 2 0 3 7 0 100 1 -1 0 0 0 0 0 0 5
- 1275 1687 2025 1687 2025 2100 1275 2100 1275 1687
-4 1 0 100 1 30 18.0 0.0 4 336.0 496.0 1650 2006 DK\001
-2 2 1 3 32 0 99 1 -1 6.40 0 0 0 0 0 5
- 1275 1687 2025 1687 2025 2100 1275 2100 1275 1687
-2 2 1 3 32 0 99 1 -1 6.40 0 0 0 0 0 5
- 1275 1537 2325 1537 2325 2100 1275 2100 1275 1537
-2 1 0 2 0 0 95 1 -1 1.00 0 0 12 1 1 2
- 1 1 1.0 24.00 48.00
- 1 1 1.0 24.00 48.00
- 2025 1687 2325 1537
diff --git a/support/dktools/results.txt b/support/dktools/results.txt
new file mode 100644
index 0000000000..1ee88de83d
--- /dev/null
+++ b/support/dktools/results.txt
@@ -0,0 +1,79 @@
+# Automatically generated
+# duptype id depth size device inode priority name
+DUPTYPE_FIRST_OCCURRENCE 362 2 13 2051 14309066 3 help-src/wxdkdraw/de/chm.hbt
+DUPTYPE_WITHIN_SAME_TREE -362 2 13 2051 14308910 3 help-src/wxdkdraw/en/chm.hbt
+DUPTYPE_FIRST_OCCURRENCE 2 2 24 2051 14308628 3 help-src/winprint/de/chm.hbt
+DUPTYPE_WITHIN_SAME_TREE -2 2 24 2051 14309112 3 help-src/wxdkscrsz/de/chm.hbt
+DUPTYPE_FIRST_OCCURRENCE 361 2 233 2051 14308406 3 help-src/wxdkdraw/de/chm.css
+DUPTYPE_WITHIN_SAME_TREE -361 2 233 2051 14308324 3 help-src/wxdkdraw/en/chm.css
+DUPTYPE_FIRST_OCCURRENCE 541 2 1052 2051 14309014 3 help-src/wxdkdraw/de/toc.png
+DUPTYPE_WITHIN_SAME_TREE -541 2 1052 2051 14308859 3 help-src/wxdkdraw/en/toc.png
+DUPTYPE_FIRST_OCCURRENCE 422 2 1061 2051 14309000 3 help-src/wxdkdraw/de/prelsel.txt
+DUPTYPE_WITHIN_SAME_TREE -422 2 1061 2051 14309010 3 help-src/wxdkdraw/de/prsfilesel.txt
+DUPTYPE_FIRST_OCCURRENCE 393 2 1072 2051 14308990 3 help-src/wxdkdraw/de/next.png
+DUPTYPE_WITHIN_SAME_TREE -393 2 1072 2051 14308837 3 help-src/wxdkdraw/en/next.png
+DUPTYPE_FIRST_OCCURRENCE 444 2 1079 2051 14309072 3 help-src/wxdkdraw/de/prev.png
+DUPTYPE_WITHIN_SAME_TREE -444 2 1079 2051 14308916 3 help-src/wxdkdraw/en/prev.png
+DUPTYPE_FIRST_OCCURRENCE 376 2 1179 2051 14308947 3 help-src/wxdkdraw/de/home.png
+DUPTYPE_WITHIN_SAME_TREE -376 2 1179 2051 14308795 3 help-src/wxdkdraw/en/home.png
+DUPTYPE_FIRST_OCCURRENCE 11 2 1182 2051 14308622 3 help-src/winprint/de/de-lic-libtiff.txt
+DUPTYPE_WITHIN_SAME_TREE -11 2 1182 2051 14308707 3 help-src/wxbmpp/de/de-lic-libtiff.txt
+DUPTYPE_FIRST_OCCURRENCE 383 2 1204 2051 14308948 3 help-src/wxdkdraw/de/index.png
+DUPTYPE_WITHIN_SAME_TREE -383 2 1204 2051 14308796 3 help-src/wxdkdraw/en/index.png
+DUPTYPE_FIRST_OCCURRENCE 394 2 1296 2051 14308981 3 help-src/wxdkdraw/de/next.svg
+DUPTYPE_WITHIN_SAME_TREE -394 2 1296 2051 14308828 3 help-src/wxdkdraw/en/next.svg
+DUPTYPE_FIRST_OCCURRENCE 377 2 1296 2051 14308975 3 help-src/wxdkdraw/de/home.svg
+DUPTYPE_WITHIN_SAME_TREE -377 2 1296 2051 14308822 3 help-src/wxdkdraw/en/home.svg
+DUPTYPE_FIRST_OCCURRENCE 445 2 1296 2051 14309003 3 help-src/wxdkdraw/de/prev.svg
+DUPTYPE_WITHIN_SAME_TREE -445 2 1296 2051 14308849 3 help-src/wxdkdraw/en/prev.svg
+DUPTYPE_FIRST_OCCURRENCE 17 2 1546 2051 14308627 3 help-src/winprint/de/de-lic-zlib.txt
+DUPTYPE_WITHIN_SAME_TREE -17 2 1546 2051 14308691 3 help-src/wxbmpp/de/de-lic-zlib.txt
+DUPTYPE_FIRST_OCCURRENCE 385 2 2095 2051 14308942 3 help-src/wxdkdraw/de/index.svg
+DUPTYPE_WITHIN_SAME_TREE -385 2 2095 2051 14308790 3 help-src/wxdkdraw/en/index.svg
+DUPTYPE_FIRST_OCCURRENCE 61 2 2177 2051 14308754 3 help-src/winprint/en/en-lic-winprint.txt
+DUPTYPE_WITHIN_SAME_TREE -61 2 2177 2051 14309103 3 help-src/wxdkscrsz/en/en-lic-winprint.txt
+DUPTYPE_FIRST_OCCURRENCE 49 2 2517 2051 14308767 3 help-src/winprint/en/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -49 2 2517 2051 14308676 3 help-src/wxbmpp/en/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -49 2 2517 2051 14309190 3 help-src/wxdkct/en/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -49 2 2517 2051 14309111 3 help-src/wxdkscrsz/en/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -49 2 2517 2051 14309148 3 help-src/wxdkclock/en/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -49 2 2517 2051 14308727 3 help-src/wximgsz/en/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -49 2 2517 2051 14309228 3 help-src/wxdkfcs/en/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -49 2 2517 2051 14308625 3 help-src/wxpqdic/en/GNUmakefile
+DUPTYPE_FIRST_OCCURRENCE 1 2 2540 2051 14308785 3 help-src/winprint/de/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -1 2 2540 2051 14309249 3 help-src/wxdkfcs/de/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -1 2 2540 2051 14308705 3 help-src/wxbmpp/de/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -1 2 2540 2051 14308744 3 help-src/wximgsz/de/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -1 2 2540 2051 14308650 3 help-src/wxpqdic/de/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -1 2 2540 2051 14309129 3 help-src/wxdkscrsz/de/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -1 2 2540 2051 14309169 3 help-src/wxdkclock/de/GNUmakefile
+DUPTYPE_WITHIN_SAME_TREE -1 2 2540 2051 14309207 3 help-src/wxdkct/de/GNUmakefile
+DUPTYPE_FIRST_OCCURRENCE 542 2 2862 2051 14309029 3 help-src/wxdkdraw/de/toc.svg
+DUPTYPE_WITHIN_SAME_TREE -542 2 2862 2051 14308874 3 help-src/wxdkdraw/en/toc.svg
+DUPTYPE_FIRST_OCCURRENCE 9 2 4228 2051 14308629 3 help-src/winprint/de/de-lic-libpng.txt
+DUPTYPE_WITHIN_SAME_TREE -9 2 4228 2051 14308711 3 help-src/wxbmpp/de/de-lic-libpng.txt
+DUPTYPE_FIRST_OCCURRENCE 7 2 4252 2051 14308624 3 help-src/winprint/de/de-lic-libjpeg.txt
+DUPTYPE_WITHIN_SAME_TREE -7 2 4252 2051 14308710 3 help-src/wxbmpp/de/de-lic-libjpeg.txt
+DUPTYPE_FIRST_OCCURRENCE 46 2 23791 2051 14308270 3 help-src/winprint/de/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308119 3 help-src/wxpqdic/en/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308206 3 help-src/wximgsz/en/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308469 3 help-src/wxdkscrsz/de/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308546 3 help-src/wxdkct/en/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308491 3 help-src/wxdkclock/en/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308525 3 help-src/wxdkclock/de/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308186 3 help-src/wxbmpp/de/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308600 3 help-src/wxdkfcs/de/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308583 3 help-src/wxdkfcs/en/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308161 3 help-src/wxbmpp/en/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308135 3 help-src/wxpqdic/de/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308222 3 help-src/wximgsz/de/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308564 3 help-src/wxdkct/de/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308246 3 help-src/winprint/en/style.css
+DUPTYPE_WITHIN_SAME_TREE -46 2 23791 2051 14308454 3 help-src/wxdkscrsz/en/style.css
+DUPTYPE_FIRST_OCCURRENCE 15 2 27852 2051 14308610 3 help-src/winprint/de/de-lic-wxwidgets.txt
+DUPTYPE_WITHIN_SAME_TREE -15 2 27852 2051 14308706 3 help-src/wxbmpp/de/de-lic-wxwidgets.txt
+DUPTYPE_FIRST_OCCURRENCE 367 2 44547 2051 14308402 3 help-src/wxdkdraw/de/elements.png
+DUPTYPE_WITHIN_SAME_TREE -367 2 44547 2051 14308321 3 help-src/wxdkdraw/en/elements.png
+DUPTYPE_FIRST_OCCURRENCE 368 2 267754 2051 14309064 3 help-src/wxdkdraw/de/elements.svg
+DUPTYPE_WITHIN_SAME_TREE -368 2 267754 2051 14308908 3 help-src/wxdkdraw/en/elements.svg
+# end of file
diff --git a/support/dktools/rshdown-init b/support/dktools/rshdown-init
new file mode 100755
index 0000000000..50d2e4c8b2
--- /dev/null
+++ b/support/dktools/rshdown-init
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+# This script generates a secret (pre-shared key) file.
+# Use a secure mechanism to transfer the secret file between
+# sender and recipient.
+# Only root should have permissions on the file, no other users.
+
+if [ ! -f "/usr/local/etc/rshdown/secret" ]
+then
+ LENGTH=`/usr/local/bin/dk-pwgen -p -l 2`
+ LENGTH=`expr 1460 - $LENGTH`
+ touch "/usr/local/etc/rshdown/secret"
+ chmod 600 "/usr/local/etc/rshdown/secret"
+ /usr/local/bin/dk-rand -b $LENGTH > "/usr/local/etc/rshdown/secret"
+ chmod 600 "/usr/local/etc/rshdown/secret"
+fi
diff --git a/support/dktools/rshdown-rand b/support/dktools/rshdown-rand
new file mode 100755
index 0000000000..85e5e87f7e
--- /dev/null
+++ b/support/dktools/rshdown-rand
@@ -0,0 +1,7 @@
+#! /bin/sh
+if [ ! -f "/usr/local/etc/rshdown/secret" ]
+then
+ /usr/local/bin/dk-pwgen -h -l 1400-1460 > "/usr/local/etc/rshdown/secret"
+else
+ echo 'INFO: File' "\"/usr/local/etc/rshdown/secret\"" 'already exists.'
+fi
diff --git a/support/dktools/rshdown.c b/support/dktools/rshdown.c
index 9b9ef33dd5..d771175e89 100644
--- a/support/dktools/rshdown.c
+++ b/support/dktools/rshdown.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: rshdown.ctr
+Copyright (C) 2016-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2016-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: rshdown.ctr
*/
/** @file rshdown.c The rshdown module.
@@ -93,8 +71,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
&& (DK4_HAVE_SIGACTION || DK4_HAVE_SIGSET) \
&& (DK4_HAVE_SETSID || DK4_HAVE_SETPGRP)
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -142,6 +125,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif
+#if DK4_HAVE_SYSEXITS_H
+#ifndef SYSEXITS_H_INCLUDED
+#include <sysexits.h>
+#define SYSEXITS_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mem.h"
#include "dk4memrs.h"
#include "dk4opt.h"
@@ -156,12 +146,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dk4mpl.h"
#include "dk4dmt.h"
#include "dk4vers.h"
+#include "dk4unused.h"
-#line 131 "rshdown.ctr"
+#line 144 "rshdown.ctr"
@@ -266,7 +257,7 @@ static const char * const help_text[] = {
NULL
-#line 234 "rshdown.ctr"
+#line 247 "rshdown.ctr"
};
@@ -279,7 +270,8 @@ static const char * const license_text[] = {
"a library:",
"",
"dktools\t\tDirk Krause's tools and libraries.",
-"\t\tSee http://dktools.sourceforge.net/ for more information.",
+"\t\tSee http://sourceforge.net/p/dktools/wiki/Home/",
+"\t\tfor more information.",
"",
"DK tools and libraries license",
"==============================",
@@ -289,32 +281,32 @@ static const char * const license_text[] = {
"Redistribution and use in source and binary forms, with or without",
"modification, are permitted provided that the following conditions are met:",
"",
-"* Redistributions of source code must retain the above copyright notice,",
-" this list of conditions and the following disclaimer.",
-"* Redistributions in binary form must reproduce the above copyright",
-" notice, this list of conditions and the following disclaimer in the",
-" documentation and/or other materials provided with the distribution.",
-"* Neither the name of the Dirk Krause nor the names of contributors may be",
-" used to endorse or promote products derived from this software without",
-" specific prior written permission.",
+"1. Redistributions of source code must retain the above copyright notice,",
+" this list of conditions and the following disclaimer.",
+"2. Redistributions in binary form must reproduce the above copyright",
+" notice, this list of conditions and the following disclaimer in the",
+" documentation and/or other materials provided with the distribution.",
+"3. Neither the name of the copyright holder nor the names of its",
+" contributors may be used to endorse or promote products derived from",
+" this software without specific prior written permission.",
"",
-"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"",
-"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
-"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE",
-"ARE DISCLAIMED.",
-"",
-"IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,",
-"INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,",
-"BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,",
-"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY",
-"OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING",
-"NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,",
-"EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS",
+"``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT",
+"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR",
+"A PARTICULAR PURPOSE ARE DISCLAIMED.",
+"IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY",
+"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
+"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR",
+"SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER",
+"CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT",
+"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY",
+"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF",
+"SUCH DAMAGE.",
"",
NULL
-#line 280 "rshdown.ctr"
+#line 294 "rshdown.ctr"
};
@@ -336,7 +328,7 @@ static const char def_conf_name[] = {
/** PID file name.
*/
static const char pid_file_name[] = {
- DK4_INST_DIR_VAR "/run/rshdown.pid"
+ DK4_INST_DIR_SYSTEMD_RUN "/rshdown/rshdown.pid"
};
@@ -371,7 +363,7 @@ static const char * const key_names[] = {
NULL
-#line 343 "rshdown.ctr"
+#line 357 "rshdown.ctr"
};
@@ -586,7 +578,7 @@ static const char * const signal_names[] = {
NULL
-#line 453 "rshdown.ctr"
+#line 467 "rshdown.ctr"
};
@@ -660,7 +652,7 @@ static const char * const syslog_facility_names[] = {
NULL
-#line 483 "rshdown.ctr"
+#line 497 "rshdown.ctr"
};
@@ -859,10 +851,14 @@ static const char * const rshdown_kw[] = {
NULL
-#line 689 "rshdown.ctr"
+#line 703 "rshdown.ctr"
};
+/** Information for daemon tool functions.
+*/
+static dk4dmt_t dmt;
+
/** Number of options in the options array.
*/
@@ -984,8 +980,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -996,8 +993,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -1007,8 +1005,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -1167,15 +1166,15 @@ send_network(const char *hn, size_t sz)
int pf = PF_UNSPEC;
-#line 995 "rshdown.ctr"
+#line 1016 "rshdown.ctr"
if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up(NULL)) {
if (options[2].found) { ip4 = 1; }
-#line 997 "rshdown.ctr"
+#line 1018 "rshdown.ctr"
res = dk4socket_c8_udp_addresses_numeric(array, hn, rp, lp, ip4, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 999 "rshdown.ctr"
+#line 1020 "rshdown.ctr"
szr = dk4socket_address_size(array);
szl = dk4socket_address_size(&(array[1]));
af = dk4socket_address_family(&(array[1]));
@@ -1184,19 +1183,19 @@ send_network(const char *hn, size_t sz)
sock = dk4socket_open(pf, SOCK_DGRAM, 0, NULL);
if (INVALID_SOCKET != sock) {
-#line 1006 "rshdown.ctr"
+#line 1027 "rshdown.ctr"
exval = EXIT_SUCCESS;
(void)dk4socket_option_set_reuse(sock, 1, NULL);
if (options[2].found) {
-#line 1009 "rshdown.ctr"
+#line 1030 "rshdown.ctr"
res = dk4socket_option_set_broadcast(sock,1,NULL);
if (DK4_SOCKET_RESULT_SUCCESS != res) {
/* ERROR: Failed to set broadcast mode */
log_1(2);
exval = EXIT_FAILURE;
-#line 1014 "rshdown.ctr"
+#line 1035 "rshdown.ctr"
}
}
res = dk4socket_bind(
@@ -1204,13 +1203,13 @@ send_network(const char *hn, size_t sz)
);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 1020 "rshdown.ctr"
+#line 1041 "rshdown.ctr"
if (0 != options[3].found) { num = options[3].val.u; }
if ((dk4_um_t)0UL == num) { num = (dk4_um_t)1UL; }
while ((0 != can_continue()) && ((dk4_um_t)0UL < num--)) {
lgt = sz;
-#line 1024 "rshdown.ctr"
+#line 1045 "rshdown.ctr"
res = dk4socket_sendto(
sock, b1, &lgt, 0,
(struct sockaddr *)(&(array[0])), szr,
@@ -1218,17 +1217,17 @@ send_network(const char *hn, size_t sz)
);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 1030 "rshdown.ctr"
+#line 1051 "rshdown.ctr"
if (lgt != sz) { exval = EXIT_FAILURE; }
} else {
-#line 1032 "rshdown.ctr"
+#line 1053 "rshdown.ctr"
exval = EXIT_FAILURE;
}
}
} else {
-#line 1036 "rshdown.ctr"
+#line 1057 "rshdown.ctr"
/* ERROR: Failed to bind local address */
res = dk4socket_c8_addr_port_to_text(
adbuf, sizeof(adbuf),
@@ -1243,50 +1242,50 @@ send_network(const char *hn, size_t sz)
(void)dk4socket_close(sock, NULL);
} else {
-#line 1049 "rshdown.ctr"
+#line 1070 "rshdown.ctr"
/* ERROR: Failed to open socket */
log_1(6);
}
} else {
-#line 1053 "rshdown.ctr"
+#line 1074 "rshdown.ctr"
if (0 == szr) {
-#line 1054 "rshdown.ctr"
+#line 1075 "rshdown.ctr"
log_3(7, 8, hn);
}
if (0 == szl) {
-#line 1057 "rshdown.ctr"
+#line 1078 "rshdown.ctr"
log_3(7, 8, hn);
}
if (AF_UNSPEC == af) {
-#line 1060 "rshdown.ctr"
+#line 1081 "rshdown.ctr"
log_3(7, 8, hn);
}
if (PF_UNSPEC == pf) {
-#line 1063 "rshdown.ctr"
+#line 1084 "rshdown.ctr"
log_3(7, 8, hn);
}
}
} else {
-#line 1067 "rshdown.ctr"
+#line 1088 "rshdown.ctr"
/* ERROR: Failed to obtain addresses */
log_3(7, 8, hn);
}
(void)dk4socket_down(NULL);
} else {
-#line 1072 "rshdown.ctr"
+#line 1093 "rshdown.ctr"
/* ERROR: Failed to bring socket subsystem up */
log_1(9);
}
-#line 1076 "rshdown.ctr"
+#line 1097 "rshdown.ctr"
}
@@ -1306,38 +1305,38 @@ sender_with_signals(const char * const *filenames, size_t szfilenames)
int res = 0; /* Conversion or operation result */
-#line 1094 "rshdown.ctr"
+#line 1115 "rshdown.ctr"
if (3 == szfilenames) {
-#line 1095 "rshdown.ctr"
+#line 1116 "rshdown.ctr"
res = dk4ma_input_c8_dec_ushort(&rp, filenames[1], &ep, 1, NULL);
if (0 != res) {
-#line 1097 "rshdown.ctr"
+#line 1118 "rshdown.ctr"
if (0 != rp) {
-#line 1098 "rshdown.ctr"
+#line 1119 "rshdown.ctr"
lp = rp;
if (0 != options[4].found) {
-#line 1100 "rshdown.ctr"
+#line 1121 "rshdown.ctr"
if ((dk4_um_t)0UL < options[4].val.u) {
-#line 1101 "rshdown.ctr"
+#line 1122 "rshdown.ctr"
if ((dk4_um_t)(USHRT_MAX) >= options[4].val.u) {
lp = (unsigned short)(options[4].val.u);
-#line 1103 "rshdown.ctr"
+#line 1124 "rshdown.ctr"
} else {
-#line 1104 "rshdown.ctr"
+#line 1125 "rshdown.ctr"
lp = 0;
/* ERROR: Local port number exceeds 16 bit unsigned range */
log_1(27);
}
} else {
-#line 1109 "rshdown.ctr"
+#line 1130 "rshdown.ctr"
lp = 0;
/* ERROR: Local port number 0 is not allowed */
log_1(28);
@@ -1345,61 +1344,61 @@ sender_with_signals(const char * const *filenames, size_t szfilenames)
}
if (0 != lp) {
-#line 1115 "rshdown.ctr"
+#line 1136 "rshdown.ctr"
fipo = dk4fopen_c8(filenames[2], "rb", DK4_FOPEN_SC_IS_REGULAR, NULL);
if (NULL != fipo) {
-#line 1117 "rshdown.ctr"
+#line 1138 "rshdown.ctr"
lgt = fread(b1, 1, sizeof(b1), fipo);
fclose(fipo);
if (0 < lgt) {
-#line 1120 "rshdown.ctr"
+#line 1141 "rshdown.ctr"
/* Send bytes over network */
send_network(filenames[0], lgt);
/* Overwrite memory containing data packet */
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
exval = EXIT_FAILURE;
-#line 1125 "rshdown.ctr"
+#line 1146 "rshdown.ctr"
}
} else {
-#line 1127 "rshdown.ctr"
+#line 1148 "rshdown.ctr"
/* ERROR: No data read from file */
log_3(16, 17, filenames[2]);
}
} else {
-#line 1131 "rshdown.ctr"
+#line 1152 "rshdown.ctr"
/* ERROR: Failed to open data file */
log_3(14, 15, filenames[2]);
}
} else {
-#line 1135 "rshdown.ctr"
+#line 1156 "rshdown.ctr"
}
} else {
-#line 1137 "rshdown.ctr"
+#line 1158 "rshdown.ctr"
/* ERROR: Remote port number 0 is not allowed */
log_1(13);
}
} else {
-#line 1141 "rshdown.ctr"
+#line 1162 "rshdown.ctr"
/* ERROR: Not a 16 bit unsigned number */
log_3(11, 12, filenames[1]);
}
} else {
-#line 1145 "rshdown.ctr"
+#line 1166 "rshdown.ctr"
/* ERROR: Three arguments required - host, port and file */
log_1(10);
}
-#line 1149 "rshdown.ctr"
+#line 1170 "rshdown.ctr"
}
@@ -1415,10 +1414,10 @@ sender(const char * const *filenames, size_t szfilenames)
{
-#line 1163 "rshdown.ctr"
+#line 1184 "rshdown.ctr"
-#line 1164 "rshdown.ctr"
+#line 1185 "rshdown.ctr"
#ifdef DK4_HAVE_SIGACTION
#ifdef SIGPIPE
struct sigaction opipe;
@@ -1551,10 +1550,10 @@ sender(const char * const *filenames, size_t szfilenames)
#endif
-#line 1295 "rshdown.ctr"
+#line 1316 "rshdown.ctr"
-#line 1296 "rshdown.ctr"
+#line 1317 "rshdown.ctr"
}
@@ -1584,7 +1583,7 @@ run_daemon_loop(void)
unsigned short frp = 0; /* Found remote port */
-#line 1324 "rshdown.ctr"
+#line 1345 "rshdown.ctr"
soa = (struct sockaddr *)(&sa);
so4 = (struct sockaddr_in *)(&sa);
#if DK4_HAVE_STRUCT_SOCKADDR_IN6
@@ -1593,18 +1592,18 @@ run_daemon_loop(void)
if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up(NULL)) {
-#line 1331 "rshdown.ctr"
+#line 1352 "rshdown.ctr"
if (0 < strlen(asender)) {
-#line 1332 "rshdown.ctr"
+#line 1353 "rshdown.ctr"
res = dk4socket_c8_get_allowed_peer(&peer, asender, NULL);
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 1334 "rshdown.ctr"
+#line 1355 "rshdown.ctr"
pused = 1;
} else {
-#line 1336 "rshdown.ctr"
+#line 1357 "rshdown.ctr"
cc = 0;
/* SYSLOG ERROR: Invalid peer name */
syslog_3(29, 30, asender);
@@ -1612,11 +1611,11 @@ run_daemon_loop(void)
}
if (1 == cc) {
-#line 1342 "rshdown.ctr"
+#line 1363 "rshdown.ctr"
sset = dk4socket_set_udp_directly(lp, 0, 0, NULL);
if (NULL != sset) {
-#line 1344 "rshdown.ctr"
+#line 1365 "rshdown.ctr"
/* SYSLOG: Started */
#if DK4_HAVE_SYSLOG
openlog(rshdown_kw[0], LOG_PID, syslogf);
@@ -1630,7 +1629,7 @@ run_daemon_loop(void)
for (i = 0; i < sset->szUsed; i++) {
-#line 1356 "rshdown.ctr"
+#line 1377 "rshdown.ctr"
FD_SET((sset->pSockets)[i],&rfds);
if (smax < (sset->pSockets)[i]) { smax = (sset->pSockets)[i]; }
}
@@ -1638,15 +1637,15 @@ run_daemon_loop(void)
if (0 != can_continue()) {
if (0 < res) {
-#line 1362 "rshdown.ctr"
+#line 1383 "rshdown.ctr"
for (i = 0; ((1 == cc) && (i < sset->szUsed)); i++) {
-#line 1364 "rshdown.ctr"
+#line 1385 "rshdown.ctr"
if (FD_ISSET((sset->pSockets)[i],&rfds)) {
-#line 1366 "rshdown.ctr"
+#line 1387 "rshdown.ctr"
DK4_MEMRES(&sa, sizeof(sa));
szb2 = sizeof(b2);
szsa = sizeof(sa);
@@ -1656,21 +1655,21 @@ run_daemon_loop(void)
);
if (0 != can_continue()) {
-#line 1374 "rshdown.ctr"
+#line 1395 "rshdown.ctr"
if (DK4_SOCKET_RESULT_SUCCESS == res) {
-#line 1375 "rshdown.ctr"
+#line 1396 "rshdown.ctr"
if (0 < szb2) {
-#line 1376 "rshdown.ctr"
+#line 1397 "rshdown.ctr"
ok = 1;
if (0 != pused) {
-#line 1378 "rshdown.ctr"
+#line 1399 "rshdown.ctr"
res = dk4socket_allowed_peer_compare(&peer, &sa, 1);
if (0 != res) {
-#line 1380 "rshdown.ctr"
+#line 1401 "rshdown.ctr"
ok = 0;
/* SYSLOG DEBUG: Address mismatch */
syslog_debug(53, 54, &sa);
@@ -1678,7 +1677,7 @@ run_daemon_loop(void)
}
if (0U != rp) {
-#line 1386 "rshdown.ctr"
+#line 1407 "rshdown.ctr"
frp = 0;
switch (soa->sa_family) {
case AF_INET : {
@@ -1692,7 +1691,7 @@ run_daemon_loop(void)
}
if (frp != rp) {
-#line 1398 "rshdown.ctr"
+#line 1419 "rshdown.ctr"
ok = 0;
/* SYSLOG DEBUG: Port mismatch */
syslog_debug(55, 56, &sa);
@@ -1700,31 +1699,31 @@ run_daemon_loop(void)
}
if (0 != ok) {
-#line 1404 "rshdown.ctr"
+#line 1425 "rshdown.ctr"
ok = 0;
if (szb1 == szb2) {
-#line 1406 "rshdown.ctr"
+#line 1427 "rshdown.ctr"
if (0 == DK4_MEMCMP(b1,b2,szb1)) {
ok = 1;
-#line 1408 "rshdown.ctr"
+#line 1429 "rshdown.ctr"
} else {
-#line 1409 "rshdown.ctr"
+#line 1430 "rshdown.ctr"
/* SYSLOG DEBUG: Data mismatch */
syslog_debug(59, 60, &sa);
}
} else {
-#line 1413 "rshdown.ctr"
+#line 1434 "rshdown.ctr"
/* SYSLOG DEBUG: Size mismatch */
syslog_debug(57, 58, &sa);
}
}
if (0 != ok) {
-#line 1418 "rshdown.ctr"
+#line 1439 "rshdown.ctr"
/* Shutdown */
/* SYSLOG: Initiating shutdown */
#if DK4_HAVE_SYSLOG
@@ -1734,7 +1733,7 @@ run_daemon_loop(void)
#endif
if (0 < strlen(cmd)) {
-#line 1426 "rshdown.ctr"
+#line 1447 "rshdown.ctr"
if (0 != system(cmd)) {
#if DK4_HAVE_SYSLOG
@@ -1748,7 +1747,7 @@ run_daemon_loop(void)
}
} else {
-#line 1438 "rshdown.ctr"
+#line 1459 "rshdown.ctr"
if (0 < signo) {
kill((pid_t)1, signo);
} else {
@@ -1767,39 +1766,39 @@ run_daemon_loop(void)
}
} else {
-#line 1455 "rshdown.ctr"
+#line 1476 "rshdown.ctr"
}
} else {
-#line 1457 "rshdown.ctr"
+#line 1478 "rshdown.ctr"
}
} else {
-#line 1459 "rshdown.ctr"
+#line 1480 "rshdown.ctr"
cc = -1;
}
} else {
-#line 1462 "rshdown.ctr"
+#line 1483 "rshdown.ctr"
}
}
} else {
-#line 1465 "rshdown.ctr"
+#line 1486 "rshdown.ctr"
}
} else {
-#line 1467 "rshdown.ctr"
+#line 1488 "rshdown.ctr"
cc = -1;
}
} else {
-#line 1470 "rshdown.ctr"
+#line 1491 "rshdown.ctr"
cc = -1;
}
} while (1 == cc);
-#line 1473 "rshdown.ctr"
+#line 1494 "rshdown.ctr"
dk4socket_set_close(sset, NULL);
/* SYSLOG: Finished */
#if DK4_HAVE_SYSLOG
@@ -1809,24 +1808,24 @@ run_daemon_loop(void)
#endif
} else {
-#line 1481 "rshdown.ctr"
+#line 1502 "rshdown.ctr"
/* SYSLOG ERROR: Failed to create socket set */
syslog_1(26);
}
} else {
-#line 1485 "rshdown.ctr"
+#line 1506 "rshdown.ctr"
}
(void)dk4socket_down(NULL);
} else {
-#line 1488 "rshdown.ctr"
+#line 1509 "rshdown.ctr"
/* SYSLOG ERROR: Failed to bring socket subsystem up */
syslog_1(25);
}
-#line 1492 "rshdown.ctr"
+#line 1513 "rshdown.ctr"
}
@@ -1864,7 +1863,7 @@ run_daemon_with_signals(void)
#endif
-#line 1528 "rshdown.ctr"
+#line 1549 "rshdown.ctr"
/* Set signal handlers
*/
#if DK4_HAVE_SIGACTION
@@ -1936,7 +1935,7 @@ run_daemon_with_signals(void)
if (0 != s_f_i) {
/* ERROR: Failed to install signal handlers */
syslog_1(23);
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 != sint) {
if (0 != sigaction(SIGINT, &oint, NULL)) {
@@ -1958,7 +1957,7 @@ run_daemon_with_signals(void)
if (0 != s_f_r) {
/* ERROR: Failed to restore signal handlers */
syslog_1(24);
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
#else
if (NULL != oterm) { sigset(SIGTERM, oterm); }
@@ -1969,7 +1968,7 @@ run_daemon_with_signals(void)
#endif
-#line 1631 "rshdown.ctr"
+#line 1652 "rshdown.ctr"
}
@@ -1977,15 +1976,15 @@ run_daemon_with_signals(void)
/** Retrieve port number from a configuration file line.
@param dest Address of destination variable.
@param pv String containing the port number.
- @param fn File name for diagnostics.
- @param lineno Line number for diagnostics.
@param a0 Flag: Remote port, 0 allowed for arbitrary ports.
@return 1 on success, 0 on error.
*/
static
int
set_port_number(
- unsigned short *dest, const char *pv, const char *fn, dk4_um_t lineno, int a0
+ unsigned short *dest,
+ const char *pv,
+ int a0
)
{
const char *ep = NULL;
@@ -2016,18 +2015,16 @@ set_port_number(
/** Set the signal number.
@param pv Text containing the number.
- @param fn File name for diagnostics.
- @param lineno Line number for diagnostics.
@return 1 on success, 0 on error.
*/
static
int
-set_signal_number(const char *pv, const char *fn, dk4_um_t lineno)
+set_signal_number(const char *pv)
{
int back = 1;
-#line 1687 "rshdown.ctr"
+#line 1706 "rshdown.ctr"
switch ( dk4str8_array_index(signal_names, pv, 0) ) {
case 0 : case 1 : {
#ifdef SIGHUP
@@ -2260,14 +2257,14 @@ set_signal_number(const char *pv, const char *fn, dk4_um_t lineno)
} break;
default : {
-#line 1918 "rshdown.ctr"
+#line 1937 "rshdown.ctr"
back = 0;
/* ERROR: Illegal signal name */
log_3(31, 32, pv);
} break;
}
-#line 1923 "rshdown.ctr"
+#line 1942 "rshdown.ctr"
return back;
}
@@ -2374,7 +2371,7 @@ read_config_file(void)
int back = 0;
-#line 2028 "rshdown.ctr"
+#line 2047 "rshdown.ctr"
if (0 != options[0].found) { fn = options[0].val.t; }
if (NULL == fn) { fn = def_conf_name; }
fipo = dk4fopen_c8(fn, "r", DK4_FOPEN_SC_IS_REGULAR, NULL);
@@ -2399,30 +2396,30 @@ read_config_file(void)
if (0 == dk4str8_cpy_s(asender,sizeof(asender),pv,NULL)) {
back = 0;
-#line 2051 "rshdown.ctr"
+#line 2070 "rshdown.ctr"
/* ERROR: Sender name too long */
log_3(33, 34, pv);
}
} else {
-#line 2055 "rshdown.ctr"
+#line 2074 "rshdown.ctr"
back = 0;
/* ERROR: Redefinition of sender */
log_1(35);
}
} break;
case 1: { /* sender port */
- if (0 == set_port_number(&rp, pv, fn, lineno, 1)) {
+ if (0 == set_port_number(&rp, pv, 1)) {
back = 0;
-#line 2063 "rshdown.ctr"
+#line 2082 "rshdown.ctr"
}
} break;
case 2: { /* local port */
- if (0 == set_port_number(&lp, pv, fn, lineno, 0)) {
+ if (0 == set_port_number(&lp, pv, 0)) {
back = 0;
-#line 2068 "rshdown.ctr"
+#line 2087 "rshdown.ctr"
}
} break;
case 3: { /* signal */
@@ -2431,16 +2428,16 @@ read_config_file(void)
if (1 > signo) {
back = 0;
-#line 2075 "rshdown.ctr"
+#line 2094 "rshdown.ctr"
/* ERROR: Signal number must be positive */
log_1(36);
}
} else {
dk4str8_normalize(pv, NULL);
- if (0 == set_signal_number(pv, fn, lineno)) {
+ if (0 == set_signal_number(pv)) {
back = 0;
-#line 2082 "rshdown.ctr"
+#line 2101 "rshdown.ctr"
}
}
} break;
@@ -2453,7 +2450,7 @@ read_config_file(void)
}
} else {
-#line 2093 "rshdown.ctr"
+#line 2112 "rshdown.ctr"
back = 0;
/* ERROR: Redefinition of command */
log_1(39);
@@ -2469,7 +2466,7 @@ read_config_file(void)
}
} else {
-#line 2107 "rshdown.ctr"
+#line 2126 "rshdown.ctr"
back = 0;
/* ERROR: Redefinition of file name */
log_1(42);
@@ -2486,20 +2483,20 @@ read_config_file(void)
} break;
default : {
-#line 2122 "rshdown.ctr"
+#line 2141 "rshdown.ctr"
log_1(43);
} break;
}
} else {
-#line 2126 "rshdown.ctr"
+#line 2145 "rshdown.ctr"
back = 0;
/* ERROR: Missing value */
log_1(44);
}
} else {
-#line 2131 "rshdown.ctr"
+#line 2150 "rshdown.ctr"
back = 0;
/* ERROR: Missing value */
log_1(44);
@@ -2511,7 +2508,7 @@ read_config_file(void)
if ((0 != back) && (0U == lp)) {
back = 0;
-#line 2141 "rshdown.ctr"
+#line 2160 "rshdown.ctr"
/* ERROR: Local port not specified */
log_1(45);
}
@@ -2519,7 +2516,7 @@ read_config_file(void)
if ((0 == signo) && (0 == strlen(cmd))) {
back = 0;
-#line 2147 "rshdown.ctr"
+#line 2166 "rshdown.ctr"
/* ERROR: Signal or command required */
log_1(46);
}
@@ -2533,20 +2530,20 @@ read_config_file(void)
if (0 == szb1) {
back = 0;
-#line 2159 "rshdown.ctr"
+#line 2178 "rshdown.ctr"
/* ERROR: Failed to read data from file */
log_3(16, 17, file_name);
}
} else {
-#line 2163 "rshdown.ctr"
+#line 2182 "rshdown.ctr"
back = 0;
/* ERROR: Failed to open data file */
log_3(14, 15, file_name);
}
} else {
-#line 2168 "rshdown.ctr"
+#line 2187 "rshdown.ctr"
back = 0;
/* ERROR: No data file specified */
log_1(47);
@@ -2554,15 +2551,14 @@ read_config_file(void)
}
} else {
-#line 2174 "rshdown.ctr"
+#line 2193 "rshdown.ctr"
}
-#line 2175 "rshdown.ctr"
+#line 2194 "rshdown.ctr"
return back;
}
-
/** Daemon waiting for shutdown data packet.
*/
static
@@ -2570,9 +2566,11 @@ void
run_as_daemon(void)
{
pid_t cpid;
+
+ dk4dmt_init(&dmt);
-#line 2188 "rshdown.ctr"
+#line 2208 "rshdown.ctr"
/* Preparations before we start.
*/
DK4_MEMRES(cmd, sizeof(cmd));
@@ -2580,85 +2578,95 @@ run_as_daemon(void)
DK4_MEMRES(file_name, sizeof(file_name));
if (read_config_file()) {
-#line 2194 "rshdown.ctr"
- if (0 != dk4dmt_parent_before_fork(rshdown_kw[0],pid_file_name,1,syslogf)) {
+#line 2214 "rshdown.ctr"
+ dk4dmt_set_program(&dmt, rshdown_kw[0]);
+ dk4dmt_set_pidfile(&dmt, pid_file_name);
+ dk4dmt_set_syslog_feature(&dmt, syslogf);
+ if (0 != dk4dmt_parent_before_fork(&dmt)) {
cpid = fork();
if ((pid_t)0 == cpid) { /* in the child */
- if (0 != dk4dmt_intermediate_before_fork(rshdown_kw[0], syslogf)) {
+ if (0 != dk4dmt_intermediate_before_fork(&dmt)) {
cpid = fork();
if ((pid_t)0 == cpid) { /* in the child */
-#line 2201 "rshdown.ctr"
+#line 2224 "rshdown.ctr"
-#line 2202 "rshdown.ctr"
- exval = EXIT_SUCCESS;
- if (dk4dmt_daemon_after_fork(rshdown_kw[0],pid_file_name,syslogf)) {
+#line 2225 "rshdown.ctr"
+ dk4dmt_success(&dmt);
+ if (0 != dk4dmt_daemon_start(&dmt)) {
run_daemon_with_signals();
}
- dk4dmt_daemon_end(rshdown_kw[0], pid_file_name, syslogf);
+ dk4dmt_daemon_end(&dmt);
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
-#line 2214 "rshdown.ctr"
+#line 2237 "rshdown.ctr"
-#line 2215 "rshdown.ctr"
+#line 2238 "rshdown.ctr"
} else {
if ((pid_t)(-1) != cpid) { /* intermediate process */
- exval = EXIT_SUCCESS;
+ dk4dmt_success(&dmt);
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
+ dk4dmt_intermediate_after_fork(&dmt);
} else { /* error */
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
/* SYSLOG ERROR: Failed to create child process */
syslog_1(22);
+ dk4dmt_intermediate_fork_failed(&dmt);
}
}
} else {
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
/* SYSLOG ERROR: Failed to detach */
syslog_1(21);
}
} else {
if ((pid_t)(-1) != cpid) { /* parent */
- exval = EXIT_SUCCESS;
+ dk4dmt_parent_after_fork(&dmt);
} else { /* error */
/* ERROR: Failed to create child process */
+ dk4dmt_parent_fork_failed(&dmt);
log_1(20);
}
}
}
}
+ else {
+ dk4dmt_error_config(&dmt);
+ }
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
+ exval = dk4dmt_get_exit_status(&dmt);
-#line 2262 "rshdown.ctr"
+#line 2292 "rshdown.ctr"
}
@@ -2716,8 +2724,7 @@ main(int argc, char *argv[])
-#line 2318 "rshdown.ctr"
-
+#line 2348 "rshdown.ctr"
/* Process command line arguments.
*/
res = dk4opt_process_argv(
@@ -2725,7 +2732,7 @@ main(int argc, char *argv[])
);
if (0 == res) {
-#line 2325 "rshdown.ctr"
+#line 2354 "rshdown.ctr"
goto finished;
}
@@ -2743,18 +2750,18 @@ main(int argc, char *argv[])
*/
if (0 != options[1].found) {
-#line 2341 "rshdown.ctr"
+#line 2370 "rshdown.ctr"
sender((const char * const *)filenames, szfilenames);
} else {
-#line 2343 "rshdown.ctr"
+#line 2372 "rshdown.ctr"
run_as_daemon();
}
finished:
-#line 2348 "rshdown.ctr"
+#line 2377 "rshdown.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/rshdown.conf b/support/dktools/rshdown.conf
new file mode 100644
index 0000000000..61790e5b5a
--- /dev/null
+++ b/support/dktools/rshdown.conf
@@ -0,0 +1,48 @@
+# Allowed sender address, optional:
+# ---------------------------------
+# - One machine specified by IPv6 address: ::1
+# - One machine specified by IPv4 address: 192.0.2.100
+# - One network specified by IPv4 address/mask: 192.0.2.0/24
+# - Alternatively mask in dotted notation: 192.0.2.0/255.255.255.0
+sender = 192.0.2.100
+
+# Allowed sender port (any if not specified here).
+# ------------------------------------------------
+sender port = 1234
+
+# Local UDP port we are using.
+# ----------------------------
+receiver port = 1234
+
+# File containing data to compare against packet contents.
+# --------------------------------------------------------
+file = /usr/local/etc/rshdown/secret
+
+# Signal number or case-insensitive name to send to init process
+# --------------------------------------------------------------
+# Only used if no command specified below.
+# Signal names: hup int quit ill trap abrt iot bus fpe kill usr1
+# segv usr2 pipe alrm term stkflt cld cont stop ttin
+# ttou urg xcpu xfsz vtalrm prof winch poll io pwr sys
+# Alternatively: sighup sigint sigquit ...
+# Signal names are system dependant, not every signal is supported on every
+# system.
+signal = sigpwr
+
+# Command to execute on arrival of shutdown packet
+# ------------------------------------------------
+# The command is passed to /bin/sh by the system() function.
+# The shutdown command syntax is OS dependant, i.e. on Solaris
+# we would use "shutdown -i0 -g0 -y" instead.
+command = shutdown -h now > /dev/null 2>&1 &
+
+# Syslog facility to use
+# ----------------------
+# One from:
+# auth authpriv cron daemon ftp kern lpr mail news security syslog user
+# uucp local0 local1 local2 local3 local4 local5 local6 local7
+syslog facility = auth
+
+# Flag: Syslog messages for discarded packets
+# -------------------------------------------
+debug = off
diff --git a/support/dktools/rshdown.conf.sample b/support/dktools/rshdown.conf.sample
index ba2e4195dc..2ef17dfb83 100644
--- a/support/dktools/rshdown.conf.sample
+++ b/support/dktools/rshdown.conf.sample
@@ -1,4 +1,8 @@
-# Allowed sender address:
+# Copyright (C) 2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Allowed sender address, optional:
+# ---------------------------------
# - One machine specified by IPv6 address: ::1
# - One machine specified by IPv4 address: 192.0.2.100
# - One network specified by IPv4 address/mask: 192.0.2.0/24
@@ -6,15 +10,19 @@
sender = 192.0.2.100
# Allowed sender port (any if not specified here).
+# ------------------------------------------------
sender port = 1234
# Local UDP port we are using.
+# ----------------------------
receiver port = 1234
# File containing data to compare against packet contents.
+# --------------------------------------------------------
file = /etc/rshdown/secret
-# Signal number or case-insensitive name to send to init process.
+# Signal number or case-insensitive name to send to init process
+# --------------------------------------------------------------
# Only used if no command specified below.
# Signal names: hup int quit ill trap abrt iot bus fpe kill usr1
# segv usr2 pipe alrm term stkflt cld cont stop ttin
@@ -25,16 +33,20 @@ file = /etc/rshdown/secret
signal = sigpwr
# Command to execute on arrival of shutdown packet
+# ------------------------------------------------
# The command is passed to /bin/sh by the system() function.
# The shutdown command syntax is OS dependant, i.e. on Solaris
# we would use "shutdown -i0 -g0 -y" instead.
command = shutdown -h now > /dev/null 2>&1 &
-# Syslog facility to use, one from:
+# Syslog facility to use
+# ----------------------
+# One from:
# auth authpriv cron daemon ftp kern lpr mail news security syslog user
# uucp local0 local1 local2 local3 local4 local5 local6 local7
syslog facility = auth
-# Flag: Syslog messages for discarded packets.
+# Flag: Syslog messages for discarded packets
+# -------------------------------------------
debug = off
diff --git a/support/dktools/rshdown.ctr b/support/dktools/rshdown.ctr
index 7e7edc2b51..b6c4c0f4a8 100644
--- a/support/dktools/rshdown.ctr
+++ b/support/dktools/rshdown.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -61,8 +61,13 @@ license = bsd
&& (DK4_HAVE_SIGACTION || DK4_HAVE_SIGSET) \
&& (DK4_HAVE_SETSID || DK4_HAVE_SETPGRP)
-#if DK4_HAVE_MATH_H
-#ifndef MATH_H_INCLUDED
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
#include <math.h>
#define MATH_H_INCLUDED 1
#endif
@@ -110,6 +115,13 @@ license = bsd
#endif
#endif
+#if DK4_HAVE_SYSEXITS_H
+#ifndef SYSEXITS_H_INCLUDED
+#include <sysexits.h>
+#define SYSEXITS_H_INCLUDED 1
+#endif
+#endif
+
#include "dk4mem.h"
#include "dk4memrs.h"
#include "dk4opt.h"
@@ -124,6 +136,7 @@ license = bsd
#include "dk4mpl.h"
#include "dk4dmt.h"
#include "dk4vers.h"
+#include "dk4unused.h"
@@ -244,7 +257,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
DK tools and libraries license
==============================
@@ -254,27 +268,27 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
$!end
};
@@ -298,7 +312,7 @@ static const char def_conf_name[] = {
/** PID file name.
*/
static const char pid_file_name[] = {
- DK4_INST_DIR_VAR "/run/rshdown.pid"
+ DK4_INST_DIR_SYSTEMD_RUN "/rshdown/rshdown.pid"
};
@@ -689,6 +703,10 @@ $!end
};
+/** Information for daemon tool functions.
+*/
+static dk4dmt_t dmt;
+
/** Number of options in the options array.
*/
@@ -810,8 +828,9 @@ sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
*/
static
void
-sig_handler_pipe(int signo)
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_pipe) = 1;
}
#endif
@@ -822,8 +841,9 @@ sig_handler_pipe(int signo)
*/
static
void
-sig_handler_int(int signo)
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_int) = 1;
}
@@ -833,8 +853,9 @@ sig_handler_int(int signo)
*/
static
void
-sig_handler_term(int signo)
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
{
+ DK4_UNUSED_ARG(signo)
*sig_pass_pointer(&sig_had_term) = 1;
}
@@ -1596,7 +1617,7 @@ run_daemon_with_signals(void)
if (0 != s_f_i) {
/* ERROR: Failed to install signal handlers */
syslog_1(23);
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 != sint) {
if (0 != sigaction(SIGINT, &oint, NULL)) {
@@ -1618,7 +1639,7 @@ run_daemon_with_signals(void)
if (0 != s_f_r) {
/* ERROR: Failed to restore signal handlers */
syslog_1(24);
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
#else
if (NULL != oterm) { sigset(SIGTERM, oterm); }
@@ -1635,15 +1656,15 @@ run_daemon_with_signals(void)
/** Retrieve port number from a configuration file line.
@param dest Address of destination variable.
@param pv String containing the port number.
- @param fn File name for diagnostics.
- @param lineno Line number for diagnostics.
@param a0 Flag: Remote port, 0 allowed for arbitrary ports.
@return 1 on success, 0 on error.
*/
static
int
set_port_number(
- unsigned short *dest, const char *pv, const char *fn, dk4_um_t lineno, int a0
+ unsigned short *dest,
+ const char *pv,
+ int a0
)
{
const char *ep = NULL;
@@ -1674,13 +1695,11 @@ set_port_number(
/** Set the signal number.
@param pv Text containing the number.
- @param fn File name for diagnostics.
- @param lineno Line number for diagnostics.
@return 1 on success, 0 on error.
*/
static
int
-set_signal_number(const char *pv, const char *fn, dk4_um_t lineno)
+set_signal_number(const char *pv)
{
int back = 1;
$? "+ set_signal_number \"%s\"", TR_8STR(pv)
@@ -2058,12 +2077,12 @@ read_config_file(void)
}
} break;
case 1: { /* sender port */
- if (0 == set_port_number(&rp, pv, fn, lineno, 1)) {
+ if (0 == set_port_number(&rp, pv, 1)) {
back = 0; $? "! remote port not numeric"
}
} break;
case 2: { /* local port */
- if (0 == set_port_number(&lp, pv, fn, lineno, 0)) {
+ if (0 == set_port_number(&lp, pv, 0)) {
back = 0; $? "! local port not numeric"
}
} break;
@@ -2077,7 +2096,7 @@ read_config_file(void)
}
} else {
dk4str8_normalize(pv, NULL);
- if (0 == set_signal_number(pv, fn, lineno)) {
+ if (0 == set_signal_number(pv)) {
back = 0; $? "! failed to set signo"
}
}
@@ -2176,7 +2195,6 @@ read_config_file(void)
}
-
/** Daemon waiting for shutdown data packet.
*/
static
@@ -2184,6 +2202,8 @@ void
run_as_daemon(void)
{
pid_t cpid;
+
+ dk4dmt_init(&dmt);
$? "+ run_as_daemon"
/* Preparations before we start.
*/
@@ -2191,73 +2211,83 @@ run_as_daemon(void)
DK4_MEMRES(asender, sizeof(asender));
DK4_MEMRES(file_name, sizeof(file_name));
if (read_config_file()) { $? ". conf ok"
- if (0 != dk4dmt_parent_before_fork(rshdown_kw[0],pid_file_name,1,syslogf)) {
+ dk4dmt_set_program(&dmt, rshdown_kw[0]);
+ dk4dmt_set_pidfile(&dmt, pid_file_name);
+ dk4dmt_set_syslog_feature(&dmt, syslogf);
+ if (0 != dk4dmt_parent_before_fork(&dmt)) {
cpid = fork();
if ((pid_t)0 == cpid) { /* in the child */
- if (0 != dk4dmt_intermediate_before_fork(rshdown_kw[0], syslogf)) {
+ if (0 != dk4dmt_intermediate_before_fork(&dmt)) {
cpid = fork();
if ((pid_t)0 == cpid) { /* in the child */
$!trace-init /tmp/rshdown.deb
$? "+ daemon process"
- exval = EXIT_SUCCESS;
- if (dk4dmt_daemon_after_fork(rshdown_kw[0],pid_file_name,syslogf)) {
+ dk4dmt_success(&dmt);
+ if (0 != dk4dmt_daemon_start(&dmt)) {
run_daemon_with_signals();
}
- dk4dmt_daemon_end(rshdown_kw[0], pid_file_name, syslogf);
+ dk4dmt_daemon_end(&dmt);
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
$? "- daemon process %d", exval
$!trace-end
} else {
if ((pid_t)(-1) != cpid) { /* intermediate process */
- exval = EXIT_SUCCESS;
+ dk4dmt_success(&dmt);
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
+ dk4dmt_intermediate_after_fork(&dmt);
} else { /* error */
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
/* SYSLOG ERROR: Failed to create child process */
syslog_1(22);
+ dk4dmt_intermediate_fork_failed(&dmt);
}
}
} else {
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
/* SYSLOG ERROR: Failed to detach */
syslog_1(21);
}
} else {
if ((pid_t)(-1) != cpid) { /* parent */
- exval = EXIT_SUCCESS;
+ dk4dmt_parent_after_fork(&dmt);
} else { /* error */
/* ERROR: Failed to create child process */
+ dk4dmt_parent_fork_failed(&dmt);
log_1(20);
}
}
}
}
+ else {
+ dk4dmt_error_config(&dmt);
+ }
if (0 == dk4mem_reset_secure(b1, sizeof(b1), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
if (0 == dk4mem_reset_secure(b2, sizeof(b2), NULL)) {
- exval = EXIT_FAILURE;
+ dk4dmt_error_sysfct(&dmt);
}
+ exval = dk4dmt_get_exit_status(&dmt);
$? "- run_as_daemon"
}
@@ -2315,7 +2345,6 @@ main(int argc, char *argv[])
int res = 0; /* Operation result */
$? "+ main"
-
/* Process command line arguments.
*/
res = dk4opt_process_argv(
diff --git a/support/dktools/rshdown.service b/support/dktools/rshdown.service
new file mode 100644
index 0000000000..798152cbf5
--- /dev/null
+++ b/support/dktools/rshdown.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Remote shutdown daemon
+After=network.target
+StartLimitIntervalSec=10
+Documentation=man:rshdown(1)
+
+[Service]
+Type=forking
+ExecStartPre=/usr/local/sbin/rshdown-init
+ExecStart=/usr/local/sbin/rshdown
+Restart=always
+RestartSec=2
+PIDFile=/run/rshdown/rshdown.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/support/dktools/run-conversion.xpm b/support/dktools/run-conversion.xpm
deleted file mode 100644
index c927c98161..0000000000
--- a/support/dktools/run-conversion.xpm
+++ /dev/null
@@ -1,39 +0,0 @@
-/* XPM */
-static const char *xpm_run_conversion[] = {
-/* width height ncolors chars_per_pixel */
-"16 15 17 1",
-/* colors */
-" c #3AA73A",
-". c #34A534",
-"X c #FDFEFD",
-"o c #F8FCF8",
-"O c #0B930B",
-"+ c #008F00",
-"@ c #ADDAAD",
-"# c #99D299",
-"$ c #8CCC8C",
-"% c #5DB65D",
-"& c #31A431",
-"* c #239E23",
-"= c #FFFFFF",
-"- c #FEFFFE",
-"; c #E7F3E7",
-": c #D0E9D0",
-"> c None",
-/* pixels */
-">>>>>>>>>>>>>>>>",
-">>>>>>>>>>>>>>>>",
-">>&>>>>>>>>>>>>>",
-">>++ >>>>>>>>>>>",
-">>++++.>>>>>>>>>",
-">>++++++.>>>>>>>",
-">>++++++++.>>>>>",
-">>++++++++++&>>>",
-">>+++++++++O%>>>",
-">>+++++++*%>>>>>",
-">>+++++ >>>>>>>>",
-">>++O%>>>>>>>>>>",
-">>*>>>>>>>>>>>>>",
-">>>>>>>>>>>>>>>>",
-">>>>>>>>>>>>>>>>"
-};
diff --git a/support/dktools/run2.xpm b/support/dktools/run2.xpm
deleted file mode 100644
index e02561230d..0000000000
--- a/support/dktools/run2.xpm
+++ /dev/null
@@ -1,31 +0,0 @@
-/* XPM */
-static const char *xpm_run2[] = {
-/* width height ncolors chars_per_pixel */
-"16 16 8 1",
-/* colors */
-" c #FCFEFC",
-". c #008F00",
-"X c #98D298",
-"o c #31A431",
-"O c #2DA22D",
-"+ c #FFFFFF",
-"@ c #E7F3E7",
-"# c None",
-/* pixels */
-"################",
-"#O##############",
-"#..o############",
-"#....o##########",
-"#......o########",
-"#........o######",
-"#..........o####",
-"#............o##",
-"#............o##",
-"#..........o####",
-"#........o######",
-"#......o########",
-"#....o##########",
-"#..o############",
-"#O##############",
-"################"
-};
diff --git a/support/dktools/scripts/create-debian-changelog.pl b/support/dktools/scripts/build-debian-changelog.pl
index 55b5a7adcd..43880647a7 100755
--- a/support/dktools/scripts/create-debian-changelog.pl
+++ b/support/dktools/scripts/build-debian-changelog.pl
@@ -1,39 +1,7 @@
#! /usr/bin/perl
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2018, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
my @lines;
my $numlines = 0;
diff --git a/support/dktools/scripts/create-distribution.sh b/support/dktools/scripts/build-distribution.sh
index f47b8e9735..5e0bdbe287 100755
--- a/support/dktools/scripts/create-distribution.sh
+++ b/support/dktools/scripts/build-distribution.sh
@@ -1,48 +1,20 @@
-#! /bin/sh
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/create-distribution.sh
+#! /bin/sh -v
+
+# Copyright (c) 2002-2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Stage: Make distribution
+# Purpose: Create distribution tarballs
+
+
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-distribution.sh
umask 0
D1=`date`
echo $D1
-VERSION=`cat version.txt`
+VERSION=`cat version.txt | sed -e 's/\-pre//g'`
SRCDIR=/home/krause/work/dklib-4
@@ -84,37 +56,47 @@ do
# fi
done
-# Update version number in debian/changelog
-# sed -e "s/@VERSION@/$VERSION/" < debian/changelog.in > debian/changelog
-echo 'Changing @VERSION@ to' "$VERSION" in doc/debian/changelog and devdoc/debian/changelog
-
-sed -e "s/@VERSION@/$VERSION/" < doc/debian/changelog.in > doc/debian/changelog
-sed -e "s/@VERSION@/$VERSION/" < devdoc/debian/changelog.in > devdoc/debian/changelog
-
# dktools-${VERSION}
mkdir -p ${DOWNLOADS}/dktools-${VERSION}
cd ${DOWNLOADS}/dktools-${VERSION}
echo Copying files to ${DOWNLOADS}/dktools-${VERSION}
-(cd ${SRCDIR} ; tar cf - * --exclude .git --exclude doc/doxygen --exclude dk4wx-v1) | tar xf -
+(cd ${SRCDIR} ; tar cf - --exclude .git --exclude doc/doxygen --exclude dk4wx-v1 --exclude 'win32/2019*' *) | tar xf -
rm -fr ${DOWNLOADS}/dktools-${VERSION}/doc
rm -fr ${DOWNLOADS}/dktools-${VERSION}/devdoc
rm -fr ${DOWNLOADS}/dktools-${VERSION}/debian/*.ex
rm -fr ${DOWNLOADS}/dktools-${VERSION}/debian/*.EX
[ ! -f configure.out ] || rm -f configure.out
-tar cf help-src.tar help-src
-gzip -9 help-src.tar
+
+[ ! -f man-help-src.tar.gz ] || rm -fr man-help-src.tar.gz
+[ ! -f man-help-src.tar ] || rm -fr man-help-src.tar
+RDFIND=`which rdfind`
+if [ "X$RDFIND" != "X" ]
+then
+ $RDFIND -makehardlinks true help-src help-html
+fi
+tar cf man-help-src.tar man-src help-src help-html
+gzip -9 man-help-src.tar
+
+[ ! -f test-src.tar.gz ] || rm -fr test-src.tar.gz
+[ ! -f test-src.tar ] || rm -fr test-src.tar
+tar cf test-src.tar test-*.ctr test-*.c
+gzip -9 test-src.tar
+
rm -fr "${DOWNLOADS}/dktools-${VERSION}/help-src"
-tar cf help-html.tar help-html
-gzip -9 help-html.tar
rm -fr "${DOWNLOADS}/dktools-${VERSION}/help-html"
-tar cf man-src.tar man-src
-gzip -9 man-src.tar
rm -fr "${DOWNLOADS}/dktools-${VERSION}/man-src"
+rm -fr ${DOWNLOADS}/dktools-${VERSION}/test-*.ctr
+rm -fr ${DOWNLOADS}/dktools-${VERSION}/test-*.c
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod ugo+r {} \;
+find . -type f -a -perm /g=x -exec chmod o+x {} \;
find . -name '*.sh' -exec chmod ugo+x {} \;
find . -name '*.pl' -exec chmod ugo+x {} \;
+find . -name 'install-sh' -exec chmod ugo+x {} \;
+find . -name 'configure' -exec chmod ugo+x {} \;
+
+ln gui-img/icons/*.ico .
# dktools-doc-${VERSION}
mkdir -p ${DOWNLOADS}/dktools-doc-${VERSION}
@@ -146,7 +128,7 @@ find . -name '*.pl' -exec chmod ugo+x {} \;
mkdir -p ${DOWNLOADS}/dktools-full-${VERSION}
cd ${DOWNLOADS}/dktools-full-${VERSION}
echo Copying files to ${DOWNLOADS}/dktools-full-${VERSION}
-(cd ${SRCDIR} ; tar cf - * --exclude .git) | tar xf -
+(cd ${SRCDIR} ; tar cf - --exclude .git *) | tar xf -
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod ugo+r {} \;
find . -name '*.sh' -exec chmod ugo+x {} \;
@@ -156,7 +138,7 @@ find . -name '*.pl' -exec chmod ugo+x {} \;
mkdir -p ${DOWNLOADS}/dktools-sf-doc-${VERSION}
cd ${SRCDIR}/doc/src
touch index.prj
-make webinstall
+make $DKMAKEOPTIONS webinstall
cd ${DOWNLOADS}/dktools-sf-doc-${VERSION}
echo Copying files to ${DOWNLOADS}/dktools-sf-doc-${VERSION}
(cd ${SRCDIR}/doc ; tar cf - *) | tar xf -
@@ -175,35 +157,56 @@ rm -fr ${DOWNLOADS}/dktools-doc-${VERSION}/doxygen
# rm -fr ${DOWNLOADS}/dktools-doc-${VERSION}/src
cd ${SRCDIR}/doc/src
touch index.prj
-make install
+make $DKMAKEOPTIONS install
cd ..
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod ugo+r {} \;
find . -name '*.sh' -exec chmod ugo+x {} \;
find . -name '*.pl' -exec chmod ugo+x {} \;
+
+
# Copy files
echo "cd ${DOWNLOADS}"
cd ${DOWNLOADS}
for i in $A
do
+ echo touch files in ${i}
+ find ${i} -type f -exec touch {} \;
echo "tar cf ${i}.tar ${i}"
tar cf ${i}.tar ${i}
echo "gzip -9 ${i}.tar"
gzip -9 ${i}.tar
echo "cp ${i}.tar.gz ~/SW-DEV/archives"
cp ${i}.tar.gz ~/SW-DEV/archives
- # echo "cp ${i}.tar.gz ~/rpmbuild/SOURCES"
- # cp ${i}.tar.gz ~/rpmbuild/SOURCES
+ if [ -d ~/rpmbuild/SOURCES ]
+ then
+ echo "I: cp ${i}.tar.gz ~/rpmbuild/SOURCES"
+ cp ${i}.tar.gz ~/rpmbuild/SOURCES
+ fi
done
-# echo "cp dktools-${VERSION}/*.spec ~/rpmbuild/SPECS"
-# cp dktools-${VERSION}/*.spec ~/rpmbuild/SPECS
-# echo "cp dktools-doc-${VERSION}/*.spec ~/rpmbuild/SPECS"
-# cp dktools-doc-${VERSION}/*.spec ~/rpmbuild/SPECS
-# echo "cp dktools-devdoc-${VERSION}/*.spec ~/rpmbuild/SPECS"
-# cp dktools-devdoc-${VERSION}/*.spec ~/rpmbuild/SPECS
+# For Arch Linux
+echo 'I: Entering section for Arch Linux'
+MDSUM=`md5sum dktools-${VERSION}.tar.gz | awk '{print $1}'`
+echo 'I: MD5 is' $MDSUM
+sed -e "s/VERSNO/$VERSION/g" < dktools-${VERSION}/PKGBUILD.in > ~/SW-DEV/archives/PKGBUILD-dktools-${VERSION}
+echo 'I: Correcting sum in file' ~/SW-DEV/archives/PKGBUILD-dktools-${VERSION}
+sed -e "/^md5sums=/cmd5sums=(\"$MDSUM\")" -i ~/SW-DEV/archives/PKGBUILD-dktools-${VERSION}
+echo 'I: Changing permissions to' ~/SW-DEV/archives/PKGBUILD-dktools-${VERSION}
+chmod 644 ~/SW-DEV/archives/PKGBUILD-dktools-${VERSION}
+echo 'I: Leaving section for Arch Linux'
+
+if [ -d ~/rpmbuild/SPECS ]
+then
+ echo "I: cp dktools-${VERSION}/*.spec ~/rpmbuild/SPECS"
+ cp dktools-${VERSION}/*.spec ~/rpmbuild/SPECS
+ echo "I: cp dktools-doc-${VERSION}/*.spec ~/rpmbuild/SPECS"
+ cp dktools-doc-${VERSION}/*.spec ~/rpmbuild/SPECS
+ echo "I: cp dktools-devdoc-${VERSION}/*.spec ~/rpmbuild/SPECS"
+ cp dktools-devdoc-${VERSION}/*.spec ~/rpmbuild/SPECS
+fi
# Clean up
for i in $A
@@ -225,5 +228,10 @@ do
fi
done
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/create-distribution.sh
+if [ -f "${SRCDIR}/preview.txt" ]
+then
+ echo "BUILDING A PREVIEW."
+fi
+
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-distribution.sh
diff --git a/support/dktools/scripts/build-doc.sh b/support/dktools/scripts/build-doc.sh
new file mode 100755
index 0000000000..c73ce3358f
--- /dev/null
+++ b/support/dktools/scripts/build-doc.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+
+# Copyright (c) 2002-2020, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-doc.sh
+
+MAKEOPTIONS=''
+NPROC=''
+NPROC=`nproc`
+make --version | grep GNU > /dev/null
+if [ "X$?" = "X0" -a "X$NPROC" != "X" ]
+then
+ MAKEOPTIONS="-j$NPROC -Otarget"
+fi
+
+CURRENTDIR=`pwd`
+
+cd doc
+cd tex
+for i in fig2lat wxdkdraw
+do
+ cd $i
+ echo "Run 'make clean' in" doc/tex/$i
+ make clean
+ echo "Run 'make' in" doc/tex/$i
+ make $MAKEOPTIONS
+ cd ..
+done
+cd ..
+cd ..
+
+
+cd $CURRENTDIR
+cd doc/src
+make $MAKEOPTIONS install && make clean && cd ../..
+
+cd $CURRENTDIR
+cd doc/wxdkdraw-html-src/de
+make $MAKEOPTIONS install && make clean && cd ../..
+
+cd $CURRENTDIR
+cd doc/wxdkdraw-html-src/en
+make $MAKEOPTIONS install && make clean && cd ../..
+
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-doc.sh
+
diff --git a/support/dktools/scripts/build-help.sh b/support/dktools/scripts/build-help.sh
index 00a677fa90..34c2cac1dc 100755
--- a/support/dktools/scripts/build-help.sh
+++ b/support/dktools/scripts/build-help.sh
@@ -1,41 +1,24 @@
-#! /bin/sh
+#! /bin/sh -v
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/build-help.sh
+# Stage: Make distribution
+# Purpose: Build *.chm and *.htb help files
+
+
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-help.sh
+
+MAKE=make
+IS_GMAKE='no'
+NPROC=''
+
+NPROC=`nproc`
+${MAKE} --version | grep GNU > /dev/null
+if [ "X$?" = "X0" -a "X$NPROC" != "X" ]
+then
+ MAKE="${MAKE} -j$NPROC -Otarget"
+fi
if [ ! -d help-html ]
then
@@ -61,46 +44,56 @@ do
do
cd $j
echo Making icons in help-src/$i/$j
- make icons
+ ${MAKE} icons
echo Retrieve favicon.ico in help-src/$i/$j
- [ -f favicon.ico ] || ln ../../../dkicon.ico favicon.ico
+ [ -f favicon.ico ] || ln ../../../gui-img/icons/dkicon.ico favicon.ico
echo Making chm in help-src/$i/$j
- make chminstall
+ ${MAKE} chminstall
cd ..
done
cd ..
done
+
cd ..
+for j in en de
+do
+ if [ ! -d dktools/help/"$j" ]
+ then
+ mkdir -p dktools/help/"$j"
+ chmod 755 dktools/help/"$j"
+ fi
+done
+rm -fr ../../../dktools/help/de/*
+rm -fr ../../../dktools/help/en/*
+
cd help-html
for i in *
do
cd "$i"
for j in en de
do
- cd $j
- echo BUILDING CHM AND HTB IN help-html/$i/$j
- zip -r -9 ../$i.zip * -x $i.chm
- chmod 644 ../$i.zip
- if [ ! -d ../../../help-htb/$j ]
+ cd "$j"
+ if [ ! -d ../../../dktools/help/"$j" ]
then
- mkdir -p ../../../help-htb/$j
- chmod 755 ../../../help-htb/$j
+ mkdir -p ../../../dktools/help/"$j"
+ chmod 755 ../../../dktools/help/"$j"
fi
- mv ../$i.zip ../../../help-htb/$j/$i.htb
+ echo 'I:' Build $i.htb
+ zip -r -9 ../$i.zip * -x $i.chm
+ chmod 644 ../$i.zip
+ mv ../$i.zip ../../../dktools/help/"$j"/"$i.htb"
+ chmod 644 ../../../dktools/help/"$j"/"$i.htb"
+ echo 'I:' Build $i.chm
chmcmd --verbosity 5 --html-scan project.hhp
chmod 644 index.chm
- if [ ! -d ../../../help-chm/$j ]
- then
- mkdir -p ../../../help-chm/$j
- chmod 755 ../../../help-chm/$j
- fi
- mv index.chm ../../../help-chm/$j/$i.chm
+ mv index.chm ../../../dktools/help/"$j"/"$i.chm"
+ chmod 644 ../../../dktools/help/"$j"/"$i.chm"
cd ..
done
cd ..
done
cd ..
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/build-help.sh
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-help.sh
diff --git a/support/dktools/scripts/build-help.sh.in b/support/dktools/scripts/build-help.sh.in
index 143b58ee68..7fc87f896a 100644..100755
--- a/support/dktools/scripts/build-help.sh.in
+++ b/support/dktools/scripts/build-help.sh.in
@@ -1,41 +1,24 @@
-#! /bin/sh
+#! /bin/sh -v
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/build-help.sh
+# Stage: Make distribution
+# Purpose: Build *.chm and *.htb help files
+
+
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-help.sh
+
+MAKE=@MAKE@
+IS_GMAKE='no'
+NPROC=''
+
+NPROC=`nproc`
+${MAKE} --version | grep GNU > /dev/null
+if [ "X$?" = "X0" -a "X$NPROC" != "X" ]
+then
+ MAKE="${MAKE} -j$NPROC -Otarget"
+fi
if [ ! -d help-html ]
then
@@ -61,46 +44,56 @@ do
do
cd $j
echo Making icons in help-src/$i/$j
- @MAKE@ icons
+ ${MAKE} icons
echo Retrieve favicon.ico in help-src/$i/$j
- [ -f favicon.ico ] || ln ../../../dkicon.ico favicon.ico
+ [ -f favicon.ico ] || ln ../../../gui-img/icons/dkicon.ico favicon.ico
echo Making chm in help-src/$i/$j
- @MAKE@ chminstall
+ ${MAKE} chminstall
cd ..
done
cd ..
done
+
cd ..
+for j in en de
+do
+ if [ ! -d dktools/help/"$j" ]
+ then
+ mkdir -p dktools/help/"$j"
+ chmod 755 dktools/help/"$j"
+ fi
+done
+rm -fr ../../../dktools/help/de/*
+rm -fr ../../../dktools/help/en/*
+
cd help-html
for i in *
do
cd "$i"
for j in en de
do
- cd $j
- echo BUILDING CHM AND HTB IN help-html/$i/$j
- zip -r -9 ../$i.zip * -x $i.chm
- chmod 644 ../$i.zip
- if [ ! -d ../../../help-htb/$j ]
+ cd "$j"
+ if [ ! -d ../../../dktools/help/"$j" ]
then
- mkdir -p ../../../help-htb/$j
- chmod 755 ../../../help-htb/$j
+ mkdir -p ../../../dktools/help/"$j"
+ chmod 755 ../../../dktools/help/"$j"
fi
- mv ../$i.zip ../../../help-htb/$j/$i.htb
+ echo 'I:' Build $i.htb
+ zip -r -9 ../$i.zip * -x $i.chm
+ chmod 644 ../$i.zip
+ mv ../$i.zip ../../../dktools/help/"$j"/"$i.htb"
+ chmod 644 ../../../dktools/help/"$j"/"$i.htb"
+ echo 'I:' Build $i.chm
chmcmd --verbosity 5 --html-scan project.hhp
chmod 644 index.chm
- if [ ! -d ../../../help-chm/$j ]
- then
- mkdir -p ../../../help-chm/$j
- chmod 755 ../../../help-chm/$j
- fi
- mv index.chm ../../../help-chm/$j/$i.chm
+ mv index.chm ../../../dktools/help/"$j"/"$i.chm"
+ chmod 644 ../../../dktools/help/"$j"/"$i.chm"
cd ..
done
cd ..
done
cd ..
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/build-help.sh
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-help.sh
diff --git a/support/dktools/scripts/create-iss.sed b/support/dktools/scripts/build-iss.sed
index 7536783756..7536783756 100644..100755
--- a/support/dktools/scripts/create-iss.sed
+++ b/support/dktools/scripts/build-iss.sed
diff --git a/support/dktools/scripts/build-man.sh b/support/dktools/scripts/build-man.sh
new file mode 100755
index 0000000000..c08c62018e
--- /dev/null
+++ b/support/dktools/scripts/build-man.sh
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-man.sh
+
+MAKEOPTIONS=''
+NPROC=''
+NPROC=`nproc`
+make --version | grep GNU > /dev/null
+if [ "X$?" = "X0" -a "X$NPROC" != "X" ]
+then
+ MAKEOPTIONS="-j$NPROC -Otarget"
+fi
+
+cd man-src
+make ${MAKEOPTIONS} install && cd ..
+
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-man.sh
+
diff --git a/support/dktools/scripts/mkrc.pl b/support/dktools/scripts/build-rc.pl
index 6eec882fb6..840171afc6 100755
--- a/support/dktools/scripts/mkrc.pl
+++ b/support/dktools/scripts/build-rc.pl
@@ -1,39 +1,7 @@
#! /usr/bin/perl
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
my $version = "4.8.0";
my $copyrightyears = "2017";
@@ -190,6 +158,18 @@ create_rc_file(
);
create_rc_file(
+ "dk-lines.rc",
+ "Dirk Krause",
+ "dkicon.ico",
+ "Extract specific lines from text",
+ $version,
+ "Dirk Krause's tools",
+ "dk-lines",
+ "0,0,0,1",
+ "0,0,0,1"
+);
+
+create_rc_file(
"dk-fic.rc",
"Dirk Krause",
"dkicon.ico",
@@ -346,6 +326,18 @@ create_rc_file(
);
create_rc_file(
+ "dk-pwd.rc",
+ "Dirk Krause",
+ "dkicon.ico",
+ "Show current working directory",
+ $version,
+ "Dirk Krause's tools",
+ "dk-pwd",
+ "0,0,0,1",
+ "0,0,0,1"
+);
+
+create_rc_file(
"dk4info.rc",
"Dirk Krause",
"dkicon.ico",
@@ -394,10 +386,22 @@ create_rc_file(
);
create_rc_file(
+ "wxd2lat.rc",
+ "Dirk Krause",
+ "wxdkdraw.ico",
+ "Wxdkdraw to LaTeX converter",
+ $version,
+ "Dirk Krause's tools",
+ "wxd2lat",
+ "0,0,0,1",
+ "0,0,0,1"
+);
+
+create_rc_file(
"bmpp.rc",
"Dirk Krause",
"dkicon.ico",
- "Bitmap to PS/PDF converter",
+ "Bitmap to PDF/(E)PS converter",
$version,
"Dirk Krause's tools",
"bmpp",
@@ -466,10 +470,22 @@ create_rc_file(
);
create_rc_file(
+ "wxdkdraw.rc",
+ "Dirk Krause",
+ "wxdkdraw.ico",
+ "Drawing application for use with LaTeX",
+ $version,
+ "Dirk Krause's tools",
+ "wxdkdraw",
+ "0,0,0,1",
+ "0,0,0,1"
+);
+
+create_rc_file(
"wxbmpp.rc",
"Dirk Krause",
"dkicon.ico",
- "Bitmap to PS/PDF converter (GUI)",
+ "Bitmap to PDF/(E)PS converter (GUI)",
$version,
"Dirk Krause's tools",
"wxbmpp",
@@ -526,6 +542,18 @@ create_rc_file(
);
create_rc_file(
+ "dk-bin2c.rc",
+ "Dirk Krause",
+ "dkicon.ico",
+ "Binary data to C source converter",
+ $version,
+ "Dirk Krause's tools",
+ "dk-bin2c",
+ "0,0,0,1",
+ "0,0,0,1"
+);
+
+create_rc_file(
"lprngcl.rc",
"Dirk Krause",
"dkicon.ico",
diff --git a/support/dktools/scripts/build-resources.sh b/support/dktools/scripts/build-resources.sh
new file mode 100755
index 0000000000..1dc4a2bb4d
--- /dev/null
+++ b/support/dktools/scripts/build-resources.sh
@@ -0,0 +1,61 @@
+#! /bin/sh
+
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-resources.sh
+
+# cd resources
+# make $DKMAKEOPTIONS && cd ..
+
+MAKEOPTIONS=''
+NPROC=''
+NPROC=`nproc`
+make --version | grep GNU > /dev/null
+if [ "X$?" = "X0" -a "X$NPROC" != "X" ]
+then
+ MAKEOPTIONS="-j$NPROC -Otarget"
+fi
+
+cd gui-img
+
+cd splash
+echo 'Running make in' `pwd`
+make ${MAKEOPTIONS}
+cd ..
+
+cd icons
+echo 'Running make in' `pwd`
+make ${MAKEOPTIONS}
+cd ..
+
+cd shared
+
+cd dlg
+echo 'Running make in' `pwd`
+make ${MAKEOPTIONS}
+cd ..
+
+cd toolbar
+echo 'Running make in' `pwd`
+make ${MAKEOPTIONS}
+cd ..
+
+cd ..
+
+cd wxdkdraw
+
+for i in buttons font-names styles
+do
+cd $i
+echo 'Running make in' `pwd`
+make ${MAKEOPTIONS}
+cd ..
+done
+
+cd ..
+
+cd ..
+
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/build-resources.sh
+
diff --git a/support/dktools/scripts/build-spec-iss.sh b/support/dktools/scripts/build-spec-iss.sh
new file mode 100755
index 0000000000..31ea04764d
--- /dev/null
+++ b/support/dktools/scripts/build-spec-iss.sh
@@ -0,0 +1,82 @@
+#! /bin/sh
+
+# Copyright (c) 2002-2019, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Stage: Make distribution
+# Purpose: Create *.spec files from dktools-el6.spec.in, *.iss
+
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/create-spec-iss.sh
+
+# Correct version numbers
+# -----------------------
+VERSION=`cat version.txt`
+SOVERS=`echo $VERSION | cut -f 1,2 -d .`
+
+IN=dktools-el6.spec.in
+OUT=dktools-el6.spec
+sed -e "s/VERSNO/$VERSION/g" < $IN | sed -e "s/SOVERS/$SOVERS/g" > $OUT
+
+IN=doc/dktools-doc.spec.in
+OUT=doc/dktools-doc.spec
+sed -e "s/VERSNO/$VERSION/g" < $IN > $OUT
+
+IN=devdoc/dktools-devdoc.spec.in
+OUT=devdoc/dktools-devdoc.spec
+sed -e "s/VERSNO/$VERSION/g" < $IN > $OUT
+
+
+# EL 7
+# ----
+IN=dktools-el6.spec
+OUT=dktools-el7.spec
+sed -e '/___PROVIDES___/,$d' < $IN > $OUT
+for i in `grep '^libdk[a-zA-Z01-9]*\.so' Makefile | cut -f 1 -d : | sort -u`
+do
+echo "Provides: ${i}.${SOVERS}()(64bit)" >> $OUT
+done
+sed -e "1,/___PROVIDES___/d" < $IN >> $OUT
+sed -e '/^BuildRequires/s/db4\-devel/libdb-devel/g' -i $OUT
+sed -e '/^Requires/s/db4/libdb/g' -i $OUT
+
+# Fedora 27 and above
+# -------------------
+IN=dktools-el6.spec
+OUT=dktools-fedora.spec
+cp "$IN" "$OUT"
+sed -e '/^BuildRequires/s/db4\-devel/libdb-devel/g' -i $OUT
+sed -e '/^BuildRequires/s/libjpeg\-devel/libjpeg-turbo-devel/g' -i $OUT
+sed -e '/^BuildRequires/s/mysql\-devel/mariadb-devel mariadb-connector-c-devel/g' -i $OUT
+sed -e '/^Requires/s/db4/libdb/g' -i $OUT
+sed -e '/4\.10\.0\-0\.0\.1/,$d' -i $OUT
+# sed -e '/^Requires/s/zlib / /g' -i $OUT
+sed -e '/^Requires/s/mysql\-libs /mariadb-connector-c /g' -i $OUT
+# sed -e '/^Requires/s/libpng / /g' -i $OUT
+sed -e '/^Requires/s/libjpeg /libjpeg-turbo /g' -i $OUT
+# sed -e '/^Requires/s/libtiff / /g' -i $OUT
+# sed -e '/^Requires/s/libdb / /g' -i $OUT
+
+# No systemd iln EL6
+# ------------------
+sed -e '/^BuildRequires/s/[ \t][ \t]*systemd//g' -i $IN
+sed -e '/systemd_requires/d' -i $IN
+sed -e '/RSHDOWN_SCRIPTLETS_START/,/RSHDOWN_SCRIPTLETS_END/d' -i $IN
+sed -e '/PRINTQD_SCRIPTLETS_START/,/PRINTQD_SCRIPTLETS_END/d' -i $IN
+sed -e 's/%{_unitdir}\/printqd\.service/%{_sysconfdir}\/init.d\/printqd/' -i $IN
+sed -e 's/%{_unitdir}\/rshdown\.service/%{_sysconfdir}\/init.d\/rshdown/' -i $IN
+sed -e '/^%configure/s/\-\-with\-systemd=%{_unitdir}/--with-systemd=no/g' -i $IN
+
+# Executable setup for 64 bit Windows
+# -----------------------------------
+IN=win32/user64.iss.in
+OUT=win32/user64.iss
+sed -e "s/VERSNO/$VERSION/g" < $IN > $OUT
+
+# Executable setup for 32 bit Windows
+# -----------------------------------
+IN=win32/user64.iss
+OUT=win32/user32.iss
+sed -f scripts/build-iss.sed < $IN > $OUT
+
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/create-spec-iss.sh
+
diff --git a/support/dktools/scripts/build-version.sh b/support/dktools/scripts/build-version.sh
new file mode 100755
index 0000000000..f4165742b7
--- /dev/null
+++ b/support/dktools/scripts/build-version.sh
@@ -0,0 +1,71 @@
+#! /bin/sh
+
+VERSNO=`cat version.txt`
+if [ -f "preview.txt" ]
+then
+ VERSDATE=`date '+%Y-%m-%d/%H:%M:%S'`
+ VERSNO="${VERSNO}_preview_${VERSDATE}"
+ echo ${VERSDATE} > preview.txt
+fi
+
+YEAR=`date '+%Y'`
+
+cat > dk4vers.h <<EOF
+/*
+Copyright (C) 2001-${YEAR}, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef DK4VERS_H_INCLUDED
+#define DK4VERS_H_INCLUDED 1
+
+/** @file dk4vers.h Version number as text string.
+*/
+
+/** Version number in 8 bit characters.
+*/
+#define DKT_VERSION_C8 "$VERSNO"
+
+/** Version number in dkChar.
+*/
+#define DKT_VERSION_DK dkT("$VERSNO")
+
+#endif
+EOF
+
+cat > dk4verswx.h <<EOF
+/*
+Copyright (C) 2001-${YEAR}, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef DK4VERSWX_H_INCLUDED
+/** Protection against multiple inclusions. */
+#define DK4VERSWX_H_INCLUDED 1
+/** @file dk4verswx.h Version number as wxChar string.
+*/
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include "wx/wxprec.h"
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
+#include "wx/wx.h"
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+
+/** Version number as wxChar string.
+*/
+#define DKT_VERSION_WX wxT("$VERSNO")
+
+#endif
+EOF
+chmod 644 dk4vers.h
+
diff --git a/support/dktools/scripts/check-config-have.pl b/support/dktools/scripts/check-config-have.pl
new file mode 100755
index 0000000000..8a9124a3b5
--- /dev/null
+++ b/support/dktools/scripts/check-config-have.pl
@@ -0,0 +1,66 @@
+#! /usr/bin/perl
+
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+
+my %used;
+my %found;
+
+sub
+read_one_source_file($)
+{
+ my $fn = shift;
+ my $fh = undef;
+ my $line;
+ my $n1;
+ my $n2;
+ if (open($fh, "<$fn")) {
+ while(<$fh>) {
+ $line = $_; chomp $line;
+ $cc = 1;
+ while($cc) {
+ $cc = 0;
+ if ($line =~ /.*(DK4_HAVE_[a-zA-Z_01-9]+)(.*)/o) {
+ $n1 = $1;
+ $n2 = $2;
+ $used{"$n1"} = 1;
+ $line = $n2;
+ }
+ }
+ }
+ close($fh);
+ }
+}
+
+my $fn;
+
+foreach $fn (<dk4*.ctr>) {
+ read_one_source_file($fn);
+}
+foreach $fn (<Dk4*.cpt>) {
+ read_one_source_file($fn);
+}
+foreach $fn (<Dk4*.wxc>) {
+ read_one_source_file($fn);
+}
+
+my $fh = undef;
+my $line;
+my $n;
+if (open($fh, "<dk4conf.h")) {
+ while(<$fh>) {
+ $line = $_; chomp $line;
+ if ($line =~ /(DK4_HAVE_[a-zA-Z_01-9]+)/o) {
+ $n = $1;
+ $found{"$n"} = 1;
+ }
+ }
+ close($fh);
+ foreach $n (sort keys %used) {
+ if (!exists($found{"$n"})) {
+ print "Missing $n\n";
+ }
+ }
+}
+
diff --git a/support/dktools/scripts/check-filelist.pl b/support/dktools/scripts/check-filelist.pl
new file mode 100755
index 0000000000..051332479d
--- /dev/null
+++ b/support/dktools/scripts/check-filelist.pl
@@ -0,0 +1,56 @@
+#! /usr/bin/perl
+
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+my %filenames;
+my $fh = undef;
+my $line;
+my $fn;
+
+if(open($fh, "<filelist.txt")) {
+ while(<$fh>) {
+ $line = $_;
+ chomp($line);
+ $line = "./$line";
+ $filenames{"$line"} = 1;
+ }
+ close($fh); $fh = undef;
+}
+if(open($fh, "find . -type f | sort |")) {
+ while(<$fh>) {
+ $line = $_; chomp($line);
+ $runtest = 1;
+ if($line =~ /\.git\//o) {
+ $runtest = 0;
+ }
+ if($line =~ /\.\/doc\//o) {
+ $runtest = 0;
+ }
+ if($line =~ /\.\/devdoc\//o) {
+ $runtest = 0;
+ }
+ if(0 != $runtest) {
+ if(!(exists($filenames{"$line"}))) {
+ print "Extra file: $line\n";
+ } else {
+ $filenames{"$line"} = 0;
+ }
+ }
+ }
+ close($fh);
+ if (1) {
+ foreach $fn (sort (keys %filenames)) {
+ if (1 == $filenames{"$fn"}) {
+ print "Missing file: $fn\n";
+ }
+ }
+ }
+}
+
+my $fn;
+foreach $fn (sort (keys %filenames)) {
+ if (1 == $filenames{"$line"}) {
+ print "Not found: $fn\n";
+ }
+}
diff --git a/support/dktools/scripts/check-headers-without-modules.sh b/support/dktools/scripts/check-headers-without-modules.sh
new file mode 100755
index 0000000000..438661971e
--- /dev/null
+++ b/support/dktools/scripts/check-headers-without-modules.sh
@@ -0,0 +1,29 @@
+:
+
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+for i in *.h
+do
+ found=no
+ j=`echo $i | sed -e 's/\.h/.ctr/g'`
+ if [ -f $j ]
+ then
+ grep -q '%%[[:space:]]*header' $j && found=yes
+ fi
+ j=`echo $i | sed -e 's/\.h/.cpt/g'`
+ if [ -f $j ]
+ then
+ grep -q '%%[[:space:]]*header' $j && found=yes
+ fi
+ j=`echo $i | sed -e 's/\.h/.wxc/g'`
+ if [ -f $j ]
+ then
+ grep -q '%%[[:space:]]*header' $j && found=yes
+ fi
+ if [ "X$found" = "Xno" ]
+ then
+ echo $i
+ fi
+done
+
diff --git a/support/dktools/scripts/check_config_have.pl b/support/dktools/scripts/check_config_have.pl
deleted file mode 100755
index 53560b44a1..0000000000
--- a/support/dktools/scripts/check_config_have.pl
+++ /dev/null
@@ -1,98 +0,0 @@
-#! /usr/bin/perl
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-
-my %used;
-my %found;
-
-sub
-read_one_source_file($)
-{
- my $fn = shift;
- my $fh = undef;
- my $line;
- my $n1;
- my $n2;
- if (open($fh, "<$fn")) {
- while(<$fh>) {
- $line = $_; chomp $line;
- $cc = 1;
- while($cc) {
- $cc = 0;
- if ($line =~ /.*(DK4_HAVE_[a-zA-Z_01-9]+)(.*)/o) {
- $n1 = $1;
- $n2 = $2;
- $used{"$n1"} = 1;
- $line = $n2;
- }
- }
- }
- close($fh);
- }
-}
-
-my $fn;
-
-foreach $fn (<dk4*.ctr>) {
- read_one_source_file($fn);
-}
-foreach $fn (<Dk4*.cpt>) {
- read_one_source_file($fn);
-}
-foreach $fn (<Dk4*.wxc>) {
- read_one_source_file($fn);
-}
-
-my $fh = undef;
-my $line;
-my $n;
-if (open($fh, "<dk4conf.h")) {
- while(<$fh>) {
- $line = $_; chomp $line;
- if ($line =~ /(DK4_HAVE_[a-zA-Z_01-9]+)/o) {
- $n = $1;
- $found{"$n"} = 1;
- }
- }
- close($fh);
- foreach $n (sort keys %used) {
- if (!exists($found{"$n"})) {
- print "Missing $n\n";
- }
- }
-}
-
diff --git a/support/dktools/scripts/clean-for-fig.sh b/support/dktools/scripts/clean-for-fig.sh
index 0d634cd65e..987f984df7 100755
--- a/support/dktools/scripts/clean-for-fig.sh
+++ b/support/dktools/scripts/clean-for-fig.sh
@@ -1,44 +1,11 @@
#! /bin/sh
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean-for-fig.sh
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/clean-for-fig.sh
-
-DIRECTORIES="doc/src resources"
+DIRECTORIES="doc/src"
for l in $DIRECTORIES
do
@@ -53,5 +20,5 @@ do
done
done
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/clean-for-fig.sh
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean-for-fig.sh
diff --git a/support/dktools/scripts/clean-for-tex.sh b/support/dktools/scripts/clean-for-tex.sh
index be559804da..40774877ed 100755
--- a/support/dktools/scripts/clean-for-tex.sh
+++ b/support/dktools/scripts/clean-for-tex.sh
@@ -1,41 +1,9 @@
#! /bin/sh
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/clean-for-tex.sh
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean-for-tex.sh
for i in `find doc/src -name 'math-*.tex'`
do
@@ -46,5 +14,5 @@ do
done
done
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/clean-for-tex.sh
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean-for-tex.sh
diff --git a/support/dktools/scripts/clean-help-doc.sh b/support/dktools/scripts/clean-help-doc.sh
index bd25b7c875..a0586baf4e 100755
--- a/support/dktools/scripts/clean-help-doc.sh
+++ b/support/dktools/scripts/clean-help-doc.sh
@@ -1,41 +1,9 @@
#! /bin/sh
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/clean-help-doc.sh
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean-help-doc.sh
for i in doc/src help-src
do
@@ -49,5 +17,5 @@ do
done
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/clean-help-doc.sh
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean-help-doc.sh
diff --git a/support/dktools/scripts/clean-resources.sh b/support/dktools/scripts/clean-resources.sh
index 66d5c60d66..1c84459d64 100755
--- a/support/dktools/scripts/clean-resources.sh
+++ b/support/dktools/scripts/clean-resources.sh
@@ -1,44 +1,12 @@
#! /bin/sh
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/clean-resources.sh
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean-resources.sh
cd resources
make clean
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/clean-resources.sh
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean-resources.sh
diff --git a/support/dktools/scripts/clean-src.sh b/support/dktools/scripts/clean-src.sh
new file mode 100755
index 0000000000..21830b49b9
--- /dev/null
+++ b/support/dktools/scripts/clean-src.sh
@@ -0,0 +1,56 @@
+#! /bin/sh
+
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#
+# DO NOT RUN THIS SCRIPT MANUALLY!
+# This script is run from the Makefile in the parent directory on
+# make clean
+# after removing other files.
+#
+
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean.sh
+
+DIR=`dirname $0`
+echo $DIR
+
+
+for i in *.ctr
+do
+ j=`echo $i | sed -e 's/\.ctr//g'`
+ [ ! -f $j.c ] || rm -f $j.c
+ egrep '%%.*header' $i > /dev/null
+ EC=$?
+ if [ "X$EC" = "X0" ]
+ then
+ rm $j.h
+ fi
+done
+
+for i in *.cpt
+do
+ j=`echo $i | sed -e 's/\.cpt//g'`
+ [ ! -f $j.cpp ] || rm -f $j.cpp
+ egrep '%%.*header' $i > /dev/null
+ EC=$?
+ if [ "X$EC" = "X0" ]
+ then
+ rm $j.h
+ fi
+done
+
+for i in *.wxc
+do
+ j=`echo $i | sed -e 's/\.wxc//g'`
+ [ ! -f $j.cpp ] || rm -f $j.cpp
+ egrep '%%.*header' $i > /dev/null
+ EC=$?
+ if [ "X$EC" = "X0" ]
+ then
+ rm $j.h
+ fi
+done
+
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/clean.sh
+
diff --git a/support/dktools/scripts/clean.sh b/support/dktools/scripts/clean.sh
deleted file mode 100755
index cf01bddc91..0000000000
--- a/support/dktools/scripts/clean.sh
+++ /dev/null
@@ -1,88 +0,0 @@
-#! /bin/sh
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-#
-# DO NOT RUN THIS SCRIPT MANUALLY!
-# This script is run from the Makefile in the parent directory on
-# make clean
-# after removing other files.
-#
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/clean.sh
-
-DIR=`dirname $0`
-echo $DIR
-
-
-for i in *.ctr
-do
- j=`echo $i | sed -e 's/\.ctr//g'`
- [ ! -f $j.c ] || rm -f $j.c
- egrep '%%.*header' $i > /dev/null
- EC=$?
- if [ "X$EC" = "X0" ]
- then
- rm $j.h
- fi
-done
-
-for i in *.cpt
-do
- j=`echo $i | sed -e 's/\.cpt//g'`
- [ ! -f $j.cpp ] || rm -f $j.cpp
- egrep '%%.*header' $i > /dev/null
- EC=$?
- if [ "X$EC" = "X0" ]
- then
- rm $j.h
- fi
-done
-
-for i in *.wxc
-do
- j=`echo $i | sed -e 's/\.wxc//g'`
- [ ! -f $j.cpp ] || rm -f $j.cpp
- egrep '%%.*header' $i > /dev/null
- EC=$?
- if [ "X$EC" = "X0" ]
- then
- rm $j.h
- fi
-done
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/clean.sh
-
diff --git a/support/dktools/scripts/create-desktop-files.sh.in b/support/dktools/scripts/create-desktop-files.sh.in
deleted file mode 100644
index 1b7bbe4ed9..0000000000
--- a/support/dktools/scripts/create-desktop-files.sh.in
+++ /dev/null
@@ -1,133 +0,0 @@
-#! /bin/sh
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/create-desktop-files.sh
-
-# Standard directory variables from autoconf
-prefix=@prefix@
-datarootdir=@datarootdir@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-datadir=${datarootdir}
-sysconfdir=@sysconfdir@
-scd=${sysconfdir}
-libdir=@libdir@
-sharedlibdir=${libdir}/shared
-mandir=@mandir@
-includedir=@includedir@
-localstatedir=@localstatedir@
-srcdir=@srcdir@
-top_srcdir=@top_srcdir@
-VPATH=@srcdir@
-
-cat > wxbmpp.desktop <<EOF
-
-[Desktop Entry]
-Encoding=UTF-8
-Categories=Application;Graphics;
-Name=wxbmpp
-Comment=Converter from PNG/JPEG/TIFF to PDF/EPS
-Comment[de]=Konvertierung von PNG/JPEG/TIFF zu PDF/EPS
-Exec=@bindir@/wxbmpp %f
-Terminal=0
-Type=Application
-Icon=@datarootdir@/dktools/dkicon.ico
-
-EOF
-
-cat > wxdkclock.desktop <<EOF
-
-[Desktop Entry]
-Encoding=UTF-8
-Categories=Application;Clock;
-Name=DK clock
-Name[de]=Uhr
-Comment=Simple clock with one alert
-Comment[de]=Einfache Uhr mit einem Alarm
-Exec=@bindir@/wxdkclock
-Terminal=0
-Type=Application
-Icon=@datarootdir@/dktools/dkclock.ico
-EOF
-
-cat > wxdkct.desktop <<EOF
-
-[Desktop Entry]
-Encoding=UTF-8
-Categories=Application;Development;
-Name=wxdkct
-Comment=C, C++, Objective-C and Java Tool
-Comment[de]=Tool für C, C++, Objective-C und Java
-Exec=@bindir@/wxdkct
-Terminal=0
-Type=Application
-Icon=@datarootdir@/dktools/dkicon.ico
-EOF
-
-cat > wximgsz.desktop <<EOF
-
-[Desktop Entry]
-Encoding=UTF-8
-Categories=Application;Graphics;
-Name=wximgsz
-Comment=Suggest size pairs to rescale bitmap images
-Comment[de]=Größenvorschläge für Skalierung von Bitmap-Bildern
-Exec=@bindir@/wximgsz
-Terminal=0
-Type=Application
-Icon=@datarootdir@/dktools/dkicon.ico
-EOF
-
-cat > wxdkfcs.desktop <<EOF
-
-[Desktop Entry]
-Encoding=UTF-8
-Categories=System;Utility;FileTools;
-Name=wxdkfcs
-Comment=Create file checksums
-Comment[de]=Prüfsummen für Dateien
-Exec=@bindir@/wxdkfcs
-Terminal=0
-Type=Application
-Icon=@datarootdir@/dktools/dkicon.ico
-EOF
-
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/create-desktop-files.sh
-
diff --git a/support/dktools/scripts/create-spec-iss.sh b/support/dktools/scripts/create-spec-iss.sh
deleted file mode 100755
index 367c581796..0000000000
--- a/support/dktools/scripts/create-spec-iss.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-#! /bin/sh
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/create-spec-iss.sh
-
-VERSION=`cat version.txt`
-SOVERS=`echo $VERSION | cut -f 1,2 -d .`
-
-IN=dktools-el6.spec.in
-OUT=dktools-el6.spec
-sed -e "s/VERSNO/$VERSION/g" < $IN | sed -e "s/SOVERS/$SOVERS/g" > $OUT
-
-IN=doc/dktools-doc.spec.in
-OUT=doc/dktools-doc.spec
-sed -e "s/VERSNO/$VERSION/g" < $IN > $OUT
-
-IN=devdoc/dktools-devdoc.spec.in
-OUT=devdoc/dktools-devdoc.spec
-sed -e "s/VERSNO/$VERSION/g" < $IN > $OUT
-
-IN=dktools-el6.spec
-OUT=dktools-fedora.spec
-sed -e "s/mysql-devel/community-mysql-devel/g" < $IN > $OUT
-
-IN=dktools-el6.spec
-OUT=dktools-el7.spec
-
-sed -e '/___PROVIDES___/,$d' < $IN > $OUT
-for i in `grep '^libdk[a-zA-Z01-9]*\.so' Makefile | cut -f 1 -d : | sort -u`
-do
-echo "Provides: ${i}.${SOVERS}()(64bit)" >> $OUT
-done
-sed -e "1,/___PROVIDES___/d" < $IN >> $OUT
-
-IN=win32/user64.iss.in
-OUT=win32/user64.iss
-sed -e "s/VERSNO/$VERSION/g" < $IN > $OUT
-
-IN=win32/user64.iss
-OUT=win32/user32.iss
-sed -f scripts/create-iss.sed < $IN > $OUT
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/create-spec-iss.sh
-
diff --git a/support/dktools/scripts/distrenew.sh b/support/dktools/scripts/distrenew.sh
deleted file mode 100755
index 45383f3e5e..0000000000
--- a/support/dktools/scripts/distrenew.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/distrenew.sh
-
-[ ! -x scripts/filechk.pl ] || perl scripts/filechk.pl
-(cd icons ; make install)
-[ ! -f doc/version.txt ] || rm -f doc/version.txt
-[ -f doc/version.txt ] || ln version.txt doc/version.txt
-[ -f devdoc/version.txt ] || ln version.txt devdoc/version.txt
-scripts/update-tex-version.sh
-scripts/update-doxyfile.sh
-scripts/build-help.sh
-scripts/create-spec-iss.sh
-perl scripts/mkrc.pl
-[ -d devdoc ] || (mkdir devdoc ; chmod 755 devdoc)
-[ -d devdoc/html ] || (mkdir devdoc/html ; chmod 755 devdoc/html)
-(cd doc/tex ; make)
-(cd doc/src ; make install)
-(cd doc/src ; make webinstall)
-scripts/clean-help-doc.sh
-perl ./scripts/transform-config.pl
-perl ./scripts/create-wschksz.pl
-autoconf
-(cd doc ; autoconf)
-(cd devdoc ; autoconf)
-dkct -l
-cat dk3sockx.txt dk3sock.c > dk3sockx.c
-rm -fr DELSTR DELTXT
-./configure
-cp dk3conf.h win32
-doxygen
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/distrenew.sh
-
diff --git a/support/dktools/scripts/dkmkproto.pl b/support/dktools/scripts/dkmkproto.pl
index e71050999c..9a578cd325 100755
--- a/support/dktools/scripts/dkmkproto.pl
+++ b/support/dktools/scripts/dkmkproto.pl
@@ -1,39 +1,7 @@
#! /usr/bin/perl
-# Copyright (C) 2010-2016 by Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (C) 2010-2016 by Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
#
# Hash table containing dirname=1 for directory
diff --git a/support/dktools/scripts/doc-install.sh b/support/dktools/scripts/doc-install.sh
deleted file mode 100755
index 6f59fb28fd..0000000000
--- a/support/dktools/scripts/doc-install.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /bin/sh
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/doc-install.sh
-
-cd doc/src
-make install && cd ../..
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/doc-install.sh
-
diff --git a/support/dktools/scripts/filechk.pl b/support/dktools/scripts/filechk.pl
deleted file mode 100755
index 5d4f9ec878..0000000000
--- a/support/dktools/scripts/filechk.pl
+++ /dev/null
@@ -1,80 +0,0 @@
-#! /usr/bin/perl
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-my %filenames;
-my $fh = undef;
-my $line;
-
-if(open($fh, "<filelist.txt")) {
- while(<$fh>) {
- $line = $_;
- chomp($line);
- $line = "./$line";
- $filenames{"$line"} = 1;
- }
- close($fh); $fh = undef;
-}
-if(open($fh, "find . -type f | sort |")) {
- while(<$fh>) {
- $line = $_; chomp($line);
- $runtest = 1;
- if($line =~ /\.git\//o) {
- $runtest = 0;
- }
- if($line =~ /\.\/doc\//o) {
- $runtest = 0;
- }
- if($line =~ /\.\/devdoc\//o) {
- $runtest = 0;
- }
- if(0 != $runtest) {
- if(!(exists($filenames{"$line"}))) {
- print "Extra file: $line\n";
- } else {
- $filenames{"$line"} = 0;
- }
- }
- }
- close($fh);
-}
-
-my $fn;
-foreach $fn (sort (keys %filenames)) {
- if (1 == $filenames{"$line"}) {
- print "Not found: $fn\n";
- }
-}
diff --git a/support/dktools/scripts/find-headers-without-modules.sh b/support/dktools/scripts/find-headers-without-modules.sh
deleted file mode 100755
index a47f59cecb..0000000000
--- a/support/dktools/scripts/find-headers-without-modules.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-:
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-for i in *.h
-do
- found=no
- j=`echo $i | sed -e 's/\.h/.ctr/g'`
- if [ -f $j ]
- then
- found=yes
- fi
- j=`echo $i | sed -e 's/\.h/.cpt/g'`
- if [ -f $j ]
- then
- found=yes
- fi
- j=`echo $i | sed -e 's/\.h/.wxc/g'`
- if [ -f $j ]
- then
- found=yes
- fi
- if [ "X$found" = "Xno" ]
- then
- echo $i
- fi
-done
-
diff --git a/support/dktools/scripts/git-add.sh b/support/dktools/scripts/git-add.sh
index ffa5eb118e..5a6cfc35af 100755
--- a/support/dktools/scripts/git-add.sh
+++ b/support/dktools/scripts/git-add.sh
@@ -1,44 +1,15 @@
:
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/git-add.sh
+echo '>>>' `date '+%Y-%m-%d %H:%M:%S'` scripts/git-add.sh
git add TODO
-git add dk4*.ctr
+git add wxdkdraw.h Wxdkdraw*.wxc Wxdkdraw*.cpt wxd*.ctr
+git add dk4*.ctr dk4*.cpt
+git add `ls *.ctr | grep -v '^test' | grep -v '^dk4' | grep -v '^dk3'`
+git add `ls *.cpt | grep -v '^test' | grep -v '^dk4' | grep -v '^dk3'`
git add dk3trace.ctr
git add *.dox
git add *.vc
@@ -48,7 +19,8 @@ git add version.txt
git add scripts/*
git add `find dktools -type f`
git add `find dk4app -type f`
-git add `scripts/find-headers-without-modules.sh`
+git add `scripts/check-headers-without-modules.sh`
+git add doc/md/*.md
git add doc/src/*.txt
git add doc/src/*.tex
git add doc/src/*.fig
@@ -62,15 +34,31 @@ git add doc/src/GNUmakefile
git add doc/src/*.css
git add win32/*
git add *.rc
+git add etc-dk3app/*
+git add etc-dk4app/*
git add filelist.txt
git add help-src/*/*/*.prj
git add help-src/*/*/*.hbt
git add help-src/*/*/GNUmakefile
-git add help-src/*/*/*.fig
+# git add help-src/*/*/*.fig
git add help-src/*/*/*.css
git add help-src/*/*/*.txt
git add man-src/GNUmakefile
git add man-src/*.adoc
+git add `find gui-img -name '*.wxd'`
+git add `find dktools -name '*.wxd'`
+MANGIT=""
+for i in man-src/*.[135]
+do
+ [ -f "${i}.adoc" ] || MANGIT="$MANGIT $i"
+done
+[ "X$MANGIT" = "X" ] || git add $MANGIT
+# git add `find gui-img -name '*.fig'`
+# git add `find gui-img -name '*.wxd'`
+git add `find gui-img -name 'GNUmakefile'`
+git add dk4conf.h.start
+git add dk4conf.h.end
+git add config.h.in
for i in svg png pdf
do
@@ -91,5 +79,5 @@ then
fi
git add `find livesys-data -type f`
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/git-add.sh
+echo '<<<' `date '+%Y-%m-%d %H:%M:%S'` scripts/git-add.sh
diff --git a/support/dktools/scripts/make-resources.sh b/support/dktools/scripts/make-resources.sh
deleted file mode 100755
index de324738cd..0000000000
--- a/support/dktools/scripts/make-resources.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /bin/sh
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/make-resources.sh
-
-cd resources
-make && cd ..
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/make-resources.sh
-
diff --git a/support/dktools/scripts/man-install.sh b/support/dktools/scripts/man-install.sh
deleted file mode 100755
index eb1db35bc4..0000000000
--- a/support/dktools/scripts/man-install.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /bin/sh
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/man-install.sh
-
-cd man-src
-make install && cd ..
-
-echo `date '+%Y-%m-%d %H:%M:%S'` Finished scripts/man-install.sh
-
diff --git a/support/dktools/scripts/show-dependencies.pl b/support/dktools/scripts/show-dependencies.pl
index 1e3a1a05ff..f3b522f64e 100755
--- a/support/dktools/scripts/show-dependencies.pl
+++ b/support/dktools/scripts/show-dependencies.pl
@@ -1,39 +1,7 @@
#! /usr/bin/perl
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
my $ifh = undef;
my $args = undef;
diff --git a/support/dktools/scripts/touch-files.sh b/support/dktools/scripts/touch-files.sh
new file mode 100755
index 0000000000..a1b1515dd8
--- /dev/null
+++ b/support/dktools/scripts/touch-files.sh
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+for i in `find . -type f | fgrep -v '/doc/md/' | fgrep -v './.git/'`
+do
+ touch $i
+done
+sleep 2
+find . -name '*.pdf' -exec touch {} \;
+sleep 2
+find . -name '*.svg' -exec touch {} \;
+sleep 2
+find . -name '*.png' -exec touch {} \;
+find . -name '*.ico' -exec touch {} \;
+find . -name '*.xpm' -exec touch {} \;
+
diff --git a/support/dktools/scripts/transform-config.pl b/support/dktools/scripts/transform-config.pl
index b8a3b34705..9e64f7f881 100755
--- a/support/dktools/scripts/transform-config.pl
+++ b/support/dktools/scripts/transform-config.pl
@@ -1,39 +1,7 @@
#! /usr/bin/perl
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
my @constnames;
my $nconstnames = 0;
@@ -134,52 +102,77 @@ sub write_dkconfig_c_file()
{
my $fh = undef;
- if ( open($fh, ">dk4config.cpp") ) {
+ if ( open($fh, ">dk4config.c") ) {
+ print $fh "/*\n";
+ print $fh "Copyright 2020, Dirk Krause. All rights reserved.\n";
+ print $fh "SPDX-License-Identifier:\tBSD-3-Clause\n";
+ print $fh "*/\n\n";
print $fh "/**\t\@file dk4config.cpp Fix configure results.\n";
print $fh "\tRedirect output from this program to the dk4conf.h file.\n";
print $fh "*/\n\n";
- print $fh "#include <stdio.h>\n";
print $fh "#include \"config.h\"\n\n";
- print $fh "/* wxWidgets_header_start */\n";
- print $fh "#if HAVE_WXWIDGETS\n";
- print $fh "#include <wx/wxprec.h>\n";
- print $fh "#ifdef __BORLANDC__\n";
- print $fh "#pragma hdrstop\n";
- print $fh "#endif \n";
- print $fh "#ifndef WX_PRECOMP\n";
- print $fh "#if DK4_HAVE_WX_CHARTYPE_H\n";
- print $fh "#ifndef WX_CHARTYPE_H_INCLUDED\n";
- print $fh "#include <wx/chartype.h>\n";
- print $fh "#define WX_CHARTYPE_H_INCLUDED 1\n";
+ print $fh "#if HAVE_LARGEFILE64_SOURCE\n";
+ print $fh "#ifndef _LARGEFILE64_SOURCE\n";
+ print $fh "#define _LARGEFILE64_SOURCE 1\n";
print $fh "#endif\n";
- print $fh "#else\n";
- print $fh "#if\tDK4_HAVE_WX_WXCHAR_H\n";
- print $fh "#ifndef WX_WXCHAR_H_INCLUDED\n";
- print $fh "#include <wx/wxchar.h>\n";
- print $fh "#define WX_WXCHAR_H_INCLUDED 1\n";
+ print $fh "#endif\n\n";
+ print $fh "#include <stdio.h>\n\n";
+ print $fh "#if HAVE_SYS_TYPES_H\n";
+ print $fh "#include <sys/types.h>\n";
print $fh "#endif\n";
- print $fh "#else\n";
- print $fh "#ifndef WX_WX_H_INCLUDED\n";
- print $fh "#include <wx/wx.h>\n";
- print $fh "#define WX_WX_H_INCLUDED 1\n";
+ print $fh "#if HAVE_SYS_STAT_H\n";
+ print $fh "#include <sys/stat.h>\n";
+ print $fh "#endif\n\n";
+
+ print $fh "#include <dk3trace.h>\n";
+ print $fh "#ifndef TRACE_DEBUG\n";
+ print $fh "#define TRACE_DEBUG 1\n";
+ print $fh "#endif\n\n";
+
+ print $fh "#if HAVE_LARGEFILE64_SOURCE\n\n";
+ print $fh "#ifdef\t__cplusplus\n";
+ print $fh "extern \"C\" {\n";
+ print $fh "#endif\n\n";
+ print $fh "int\n";
+ print $fh "check_largefile64(void);\n\n";
+ print $fh "#ifdef\t__cplusplus\n";
+ print $fh "}\n";
+ print $fh "#endif\n\n";
+ print $fh "int\n";
+ print $fh "check_largefile64(void)\n";
+ print $fh "{\n";
+ print $fh " int back = 0;\n";
+ print $fh "#if (HAVE_INO64_T) && (HAVE_INO_T)\n";
+ print $fh " if (sizeof(ino64_t) > sizeof(ino_t)) {\n";
+ print $fh " back = 1;\n";
+ print $fh " }\n";
print $fh "#endif\n";
+ print $fh "#if (HAVE__INO64_T) && (HAVE__INO_T)\n";
+ print $fh " if (sizeof(_ino64_t) > sizeof(_ino_t)) {\n";
+ print $fh " back = 1;\n";
+ print $fh " }\n";
print $fh "#endif\n";
+ print $fh "#if (HAVE_OFF64_T) && (HAVE_OFF_T)\n";
+ print $fh " if (sizeof(off64_t) > sizeof(off_t)) {\n";
+ print $fh " back = 1;\n";
+ print $fh " }\n";
print $fh "#endif\n";
+ print $fh "#if (HAVE__OFF64_T) && (HAVE__OFF_T)\n";
+ print $fh " if (sizeof(_off64_t) > sizeof(_off_t)) {\n";
+ print $fh " back = 1;\n";
+ print $fh " }\n";
print $fh "#endif\n";
+ print $fh "#if (HAVE_STAT64) && (HAVE_STAT)\n";
+ print $fh " if (sizeof(struct stat64) > sizeof(struct stat)) {\n";
+ print $fh " back = 1;\n";
+ print $fh " }\n";
print $fh "#endif\n";
- print $fh "/* wxWidgets_header_end*/\n\n";
-
- print $fh "#include <dk3trace.h>\n";
- print $fh "#ifndef TRACE_DEBUG\n";
- print $fh "#define TRACE_DEBUG 1\n";
+ print $fh " return back;\n";
+ print $fh "}\n";
print $fh "#endif\n";
- print $fh "int main(void)\n{\n";
+ print $fh "\n\nint\nmain(void)\n{\n";
print $fh "\n";
- print $fh " fputs(\"/**\\t\@file dk4conf.h\tFixed configure results.\\n*/\\n\\n\", stdout);\n";
- print $fh " fputs(\"#ifndef DK4CONF_H_INCLUDED\\n\", stdout);\n";
- print $fh " fputs(\"/**\\tProtection against multiple inclusion.\\n*/\\n\", stdout);\n";
- print $fh " fputs(\"#define DK4CONF_H_INCLUDED 1\\n\\n\", stdout);\n";
foreach $name (sort @constnames) {
if ($name =~ /SIZEOF/o) {
print $fh "#if $name\n";
@@ -190,6 +183,21 @@ sub write_dkconfig_c_file()
print $fh " fputs(\"#define DK4_$name 0\\n\", stdout);\n";
print $fh "#endif\n";
}
+ elsif ("$name" eq "HAVE_LARGEFILE64_SOURCE") {
+ print $fh "#if $name\n";
+ print $fh " if (0 != check_largefile64()) {\n";
+ print $fh " fputs(\"/**\tDK4 version of $name.\\n*/\\n\", stdout);\n";
+ print $fh " fputs(\"#define DK4_$name 1\\n\", stdout);\n";
+ print $fh " } else {\n";
+ print $fh " fputs(\"/**\tDK4 version of $name.\\n*/\\n\", stdout);\n";
+ print $fh " fputs(\"#define DK4_$name 0\\n\", stdout);\n";
+ print $fh " }\n";
+ print $fh "#else\n";
+ print $fh " fputs(\"/**\tDK4 version of $name.\\n*/\\n\", stdout);\n";
+ print $fh " fputs(\"#define DK4_$name 0\\n\", stdout);\n";
+ print $fh "#endif\n";
+
+ }
elsif ($name =~ /HAVE/o) {
print $fh "#if $name\n";
print $fh " fputs(\"/**\tDK4 version of $name.\\n*/\\n\", stdout);\n";
@@ -211,22 +219,115 @@ sub write_dkconfig_c_file()
print $fh " fputc('\\n', stdout);\n";
}
+ print $fh "/* Large file support start */\n";
+ print $fh "#if HAVE_LARGEFILE64_SOURCE\n";
+ print $fh " fputs(\"#if DK4_HAVE_LARGEFILE64_SOURCE\\n\", stdout);\n";
+ print $fh " fputs(\"#ifndef _LARGEFILE64_SOURCE\\n\", stdout);\n";
+ print $fh " fputs(\"/**\\tUse 64 bit file support.\\n*/\\n\", stdout);\n";
+ print $fh " fputs(\"#define _LARGEFILE64_SOURCE 1\\n\", stdout);\n";
+ print $fh " fputs(\"#endif\\n\", stdout);\n";
+ print $fh " fputs(\"#endif\\n\\n\\n\", stdout);\n";
+ print $fh "#endif\n";
+ print $fh "/* Large file support end */\n\n";
+ print $fh " return 0;\n}\n";
+ close($fh);
+ } else {
+ print "ERROR: Failed to write dk4config.c file!\n";
+ }
+ $fh = undef;
+ if ( open($fh, ">dk4wxcs.cpp") ) {
+ print $fh "/**\t\@file dk4wxcs.cpp Fix configure results.\n";
+ print $fh "\tRedirect output from this program to the dk4conf.h file.\n";
+ print $fh "*/\n\n";
+ print $fh "#include \"config.h\"\n\n";
+ print $fh "#if HAVE_LARGEFILE64_SOURCE\n";
+ print $fh "#ifndef _LARGEFILE64_SOURCE\n";
+ print $fh "#define _LARGEFILE64_SOURCE 1\n";
+ print $fh "#endif\n";
+ print $fh "#endif\n\n";
+ print $fh "#include <stdio.h>\n\n";
+ print $fh "#if HAVE_SYS_TYPES_H\n";
+ print $fh "#include <sys/types.h>\n";
+ print $fh "#endif\n";
+ print $fh "#if HAVE_SYS_STAT_H\n";
+ print $fh "#include <sys/stat.h>\n";
+ print $fh "#endif\n\n";
+ print $fh "/* wxWidgets_header_start */\n";
+ print $fh "#if HAVE_WXWIDGETS\n";
+ print $fh "#include <wx/wxprec.h>\n";
+ print $fh "#ifdef __BORLANDC__\n";
+ print $fh "#pragma hdrstop\n";
+ print $fh "#endif \n";
+ print $fh "#ifndef WX_PRECOMP\n";
+ print $fh "#if HAVE_WX_CHARTYPE_H\n";
+ print $fh "#if HAVE_WX_DEFS_H\n";
+ print $fh "#ifndef WX_DEFS_H_INCLUDED\n";
+ print $fh "#include <wx/defs.h>\n";
+ print $fh "#define WX_DEFS_H_INCLUDED 1\n";
+ print $fh "#endif\n";
+ print $fh "#endif\n";
+ print $fh "#ifndef WX_CHARTYPE_H_INCLUDED\n";
+ print $fh "#include <wx/chartype.h>\n";
+ print $fh "#define WX_CHARTYPE_H_INCLUDED 1\n";
+ print $fh "#endif\n";
+ print $fh "#else\n";
+ print $fh "#if\tHAVE_WX_WXCHAR_H\n";
+ print $fh "#if HAVE_WX_DEFS_H\n";
+ print $fh "#ifndef WX_DEFS_H_INCLUDED\n";
+ print $fh "#include <wx/defs.h>\n";
+ print $fh "#define WX_DEFS_H_INCLUDED 1\n";
+ print $fh "#endif\n";
+ print $fh "#endif\n";
+ print $fh "#ifndef WX_WXCHAR_H_INCLUDED\n";
+ print $fh "#include <wx/wxchar.h>\n";
+ print $fh "#define WX_WXCHAR_H_INCLUDED 1\n";
+ print $fh "#endif\n";
+ print $fh "#else\n";
+ print $fh "#ifndef WX_WX_H_INCLUDED\n";
+ print $fh "#include <wx/wx.h>\n";
+ print $fh "#define WX_WX_H_INCLUDED 1\n";
+ print $fh "#endif\n";
+ print $fh "#endif\n";
+ print $fh "#endif\n";
+ print $fh "#endif\n";
+ print $fh "#endif\n";
+ print $fh "/* wxWidgets_header_end*/\n\n";
+
+ print $fh "#include <dk3trace.h>\n";
+ print $fh "#ifndef TRACE_DEBUG\n";
+ print $fh "#define TRACE_DEBUG 1\n";
+ print $fh "#endif\n\n";
+ print $fh "\n\nint\nmain(void)\n{\n";
+ print $fh " fputs(\"/*\\nCopyright (C) 2020, Dirk Krause.\", stdout);\n";
+ print $fh " fputs(\" All rights reserved.\\n\", stdout);\n";
+ print $fh " fputs(\"SPDX-License-Identifier: BSD-3-Clause\\n\", stdout);\n";
+ print $fh " fputs(\"*/\\n\\n\", stdout);\n";
+ print $fh " fputs(\"#ifndef DK4WXCS_H_INCLUDED\\n\", stdout);\n";
+ print $fh " fputs(\"/**\tMultiple inclusion protection.*/\\n\",stdout);\n";
+ print $fh " fputs(\"#define DK4WXCS_H_INCLUDED 1\\n\\n\", stdout);\n";
print $fh "/* wxWidgets_body_start */\n";
print $fh "#if HAVE_WXWIDGETS\n";
- print $fh " fputs(\"/**\tSize of wchar_t.\\n*/\\n\", stdout);\n";
+ print $fh " fputs(\"/**\tSize of wxChar.\\n*/\\n\", stdout);\n";
print $fh " printf(\"#define DK4_SIZEOF_WXCHAR %u\\n\\n\", (unsigned)sizeof(wxChar));\n";
+ print $fh "#if HAVE_WX_CHARTYPE_H\n";
+ print $fh " fputs(\"/**\tSize of wxStringCharType.\\n*/\\n\", stdout);\n";
+ print $fh " printf(\"#define DK4_SIZEOF_WXSTRINGCHARTYPE %u\\n\\n\", (unsigned)sizeof(wxStringCharType));\n";
+ print $fh "#else\n";
+ print $fh " fputs(\"/**\tSize of wxStringCharType.\\n*/\\n\", stdout);\n";
+ print $fh " fputs(\"#define DK4_SIZEOF_WXSTRINGCHARTYPE 0\\n\\n\", stdout);\n";
+ print $fh "#endif\n";
print $fh "#else\n";
- print $fh " fputs(\"/**\tSize of wchar_t.\\n*/\\n\", stdout);\n";
+ print $fh " fputs(\"/**\tSize of wxChar.\\n*/\\n\", stdout);\n";
print $fh " fputs(\"#define DK4_SIZEOF_WXCHAR 0\\n\\n\", stdout);\n";
+ print $fh " fputs(\"/**\tSize of wxStringCharType.\\n*/\\n\", stdout);\n";
+ print $fh " fputs(\"#define DK4_SIZEOF_WXSTRINGCHARTYPE 0\\n\\n\", stdout);\n";
print $fh "#endif\n";
print $fh "/* wxWidgets_body_end */\n\n";
-
-
- print $fh " fputs(\"#endif\\n/* ifndef DK4CONF_H_INCLUDED */\\n\", stdout);\n";
+ print $fh " fputs(\"\\n\\n#endif\\n\\n\", stdout);\n";
print $fh " return 0;\n}\n";
close($fh);
} else {
- print "ERROR: Failed to write dk4config.c file!\n";
+ print "ERROR: Failed to write dk4wxcs.cpp file!\n";
}
}
@@ -241,7 +342,7 @@ sub write_dkconfig_cross()
print $fh "#include \"config.h\"\n\n";
print $fh "#ifndef DK4_ON_WINDOWS\n";
- print $fh "#ifdef _WIN32\n";
+ print $fh "#if _WIN32\n";
print $fh "#define DK4_ON_WINDOWS 1\n";
print $fh "#ifndef\tHAVE_BACKSLASH_AS_SEP\n";
print $fh "#define\tHAVE_BACKSLASH_AS_SEP\ŧ1\n";
diff --git a/support/dktools/scripts/update-doxyfile.sh b/support/dktools/scripts/update-doxyfile.sh
index 557cf9f162..31c0cc3af4 100755
--- a/support/dktools/scripts/update-doxyfile.sh
+++ b/support/dktools/scripts/update-doxyfile.sh
@@ -1,39 +1,7 @@
#! /bin/sh
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
+# Copyright (c) 2002-2016, Dirk Krause. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
echo `date '+%Y-%m-%d %H:%M:%S'` Start scripts/update-doxyfile.sh
diff --git a/support/dktools/scripts/wr-dk3inst.sh.in b/support/dktools/scripts/wr-dk3inst.sh.in
deleted file mode 100644
index 1c6e098b20..0000000000
--- a/support/dktools/scripts/wr-dk3inst.sh.in
+++ /dev/null
@@ -1,106 +0,0 @@
-:
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-# Standard directory variables from autoconf
-prefix=@prefix@
-datarootdir=@datarootdir@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-datadir=${datarootdir}
-sysconfdir=@sysconfdir@
-scd=${sysconfdir}
-libdir=@libdir@
-sharedlibdir=${libdir}/shared
-mandir=@mandir@
-includedir=@includedir@
-localstatedir=@localstatedir@
-
-cat <<EOF
-
-#include "dk3conf.h"
-#include "dk3types.h"
-#include "dk3inst.h"
-
-
-dkChar const * const dk3inst_directories[] = {
-#if DK3_ON_WINDOWS || DK3_HAVE_BACKSLASH
- /* 0 */ dkT("C:\\\\Program Files\\\\Krause"),
- /* 1 */ dkT("C:\\\\Program Files\\\\Krause\\\\etc"),
- /* 2 */ dkT("C:\\\\Program Files\\\\Krause\\\\share"),
- /* 3 */ dkT("C:\\\\Program Files\\\\Krause\\\\var"),
- /* 4 */ dkT("C:\\\\Program Files\\\\Krause\\\\bin"),
- /* 5 */ dkT("C:\\\\Program Files\\\\Krause\\\\sbin"),
- /* 6 */ dkT("C:\\\\Program Files\\\\Krause\\\\lib"),
- /* 7 */ dkT("C:\\\\Program Files\\\\Krause\\\\include"),
- /* 8 */ dkT("C:\\\\Program Files\\\\Krause\\\\man"),
- /* 9 */ dkT("C:\\\\Program Files\\\\Krause"),
- /* 10 */ dkT("C:\\\\Program Files\\\\Krause\\\\libexec"),
-#else
- /* 0 */ dkT("$prefix"),
- /* 1 */ dkT("$sysconfdir"),
- /* 2 */ dkT("$datarootdir"),
- /* 3 */ dkT("$localstatedir"),
- /* 4 */ dkT("$bindir"),
- /* 5 */ dkT("$sbindir"),
- /* 6 */ dkT("$libdir"),
- /* 7 */ dkT("$includedir"),
- /* 8 */ dkT("$mandir"),
- /* 9 */ dkT("$exec_prefix"),
- /* 10 */ dkT("$libexecdir"),
-#endif
-};
-
-
-
-dkChar const *
-dk3inst_get_directory(size_t i)
-/* {{{ */
-{
- dkChar const *back = NULL;
- if(i <= 10) { back = dk3inst_directories[i]; }
- return back;
-}
-/* }}} */
-
-
-
-/* vim: set ai sw=2 filetype=c foldmethod=marker foldopen=all : */
-
-EOF
-
diff --git a/support/dktools/scripts/wr-dk4inst.sh.in b/support/dktools/scripts/wr-dk4inst.sh.in
deleted file mode 100644
index b8c6f60a2b..0000000000
--- a/support/dktools/scripts/wr-dk4inst.sh.in
+++ /dev/null
@@ -1,274 +0,0 @@
-:
-
-# Copyright (c) 2002-2016, Dirk Krause
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# opyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials
-# provided with the distribution.
-# * Neither the name of the Dirk Krause nor the names of
-# contributors may be used to endorse or promote
-# products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-
-# Standard directory variables from autoconf
-prefix=@prefix@
-datarootdir=@datarootdir@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-datadir=${datarootdir}
-sysconfdir=@sysconfdir@
-scd=${sysconfdir}
-libdir=@libdir@
-sharedlibdir=${libdir}/shared
-mandir=@mandir@
-includedir=@includedir@
-localstatedir=@localstatedir@
-
-CURRENT_TIMESTAMP=`date '+%Y-%m-%d %H:%M:%S'`
-
-cat >dk4inst.c <<EOF
-/** @file dk4inst.c Installation directories.
- Produced by configure, $CURRENT_TIMESTAMP.
-*/
-
-#ifndef DK4CONF_H_INCLUDED
-#include "dk4conf.h"
-#endif
-
-#ifndef DK4TYPES_H_INCLUDED
-#include "dk4types.h"
-#endif
-
-#ifndef DK4INST_H_INCLUDED
-#include "dk4inst.h"
-#endif
-
-
-
-/** Directory names.
-*/
-const dkChar * const dk4inst_directories[] = {
-#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
- /* 0 */ dkT("C:\\\\Program Files\\\\Krause"),
- /* 1 */ dkT("C:\\\\Program Files\\\\Krause\\\\etc"),
- /* 2 */ dkT("C:\\\\Program Files\\\\Krause\\\\share"),
- /* 3 */ dkT("C:\\\\Program Files\\\\Krause\\\\var"),
- /* 4 */ dkT("C:\\\\Program Files\\\\Krause\\\\bin"),
- /* 5 */ dkT("C:\\\\Program Files\\\\Krause\\\\sbin"),
- /* 6 */ dkT("C:\\\\Program Files\\\\Krause\\\\lib"),
- /* 7 */ dkT("C:\\\\Program Files\\\\Krause\\\\include"),
- /* 8 */ dkT("C:\\\\Program Files\\\\Krause\\\\man"),
- /* 9 */ dkT("C:\\\\Program Files\\\\Krause"),
- /* 10 */ dkT("C:\\\\Program Files\\\\Krause\\\\libexec"),
-#else
- /* 0 */ dkT("$prefix"),
- /* 1 */ dkT("$sysconfdir"),
- /* 2 */ dkT("$datarootdir"),
- /* 3 */ dkT("$localstatedir"),
- /* 4 */ dkT("$bindir"),
- /* 5 */ dkT("$sbindir"),
- /* 6 */ dkT("$libdir"),
- /* 7 */ dkT("$includedir"),
- /* 8 */ dkT("$mandir"),
- /* 9 */ dkT("$exec_prefix"),
- /* 10 */ dkT("$libexecdir"),
-#endif
-};
-
-
-
-const dkChar *
-dk4inst_get_directory(size_t i)
-{
- const dkChar *back = NULL;
- if(i <= 10) { back = dk4inst_directories[i]; }
- return back;
-}
-
-
-
-/* vim: set ai sw=2 filetype=c : */
-
-EOF
-
-cat >dk4inst.h <<EOF
-#ifndef DK4INST_H_INCLUDED
-#define DK4INST_H_INCLUDED 1
-
-/** @file dk4inst.h Installation directories.
-
- Obtain installation prefix, system configuration directory,
- data directory, local state directory, binary directory,
- root binary directory, library directory, include directory,
- man page directory, executable files prefix and libexec
- directory is configured during build process.
-
- CRT on Windows: Not used.
-
- Produced by configure, $CURRENT_TIMESTAMP.
-*/
-
-#ifndef DK4CONF_H_INCLUDED
-#include "dk4conf.h"
-#endif
-
-#ifndef DK4TYPES_H_INCLUDED
-#include "dk4types.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Retrieve one installation directory.
- @param i Directory index:
- 0 = prefix,
- 1 = system configuration directory,
- 2 = data directory,
- 3 = local state directory,
- 4 = binary directory,
- 5 = root binary directory,
- 6 = library directory,
- 7 = include directory,
- 8 = man page directory,
- 9 = executable files prefix,
- 10 = libexec directory.
- @return Pointer to directory name on success, NULL on error.
-*/
-const dkChar *
-dk4inst_get_directory(size_t i);
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @defgroup instdirs Installation directories. */
-/**@{*/
-#ifdef _WIN32
-
-/** Installation prefix, typlically /usr or /usr/local.
-*/
-#define DK4_INST_DIR_PREFIX "C:\\\\Program Files\\\\Krause"
-
-/** System configuration directory, typically /etc or /usr/local/etc.
-*/
-#define DK4_INST_DIR_ETC "C:\\\\Program Files\\\\Krause\\\\etc"
-
-/** Data directory, typically /usr/share or /usr/local/share.
-*/
-#define DK4_INST_DIR_SHARE "C:\\\\Program Files\\\\Krause\\\\share"
-
-/** Local state directory, typically /var or /usr/local/var.
-*/
-#define DK4_INST_DIR_VAR "C:\\\\Program Files\\\\Krause\\\\var"
-
-/** Binaries directory, typically /usr/bin or /usr/local/bin.
-*/
-#define DK4_INST_DIR_BIN "C:\\\\Program Files\\\\Krause\\\\bin"
-
-/** System binaries directory, typically /usr/sbin or /usr/local/sbin.
-*/
-#define DK4_INST_DIR_SBIN "C:\\\\Program Files\\\\Krause\\\\sbin"
-
-/** Libraries directory, typically /usr/lib or /usr/local/lib.
-*/
-#define DK4_INST_DIR_LIB "C:\\\\Program Files\\\\Krause\\\\lib"
-
-/** Include files directory, typically /usr/include or /usr/local/include.
-*/
-#define DK4_INST_DIR_INCLUDE "C:\\\\Program Files\\\\Krause\\\\include"
-
-/** Man pages directory, typically /usr/share/man or /usr/local/share/man.
-*/
-#define DK4_INST_DIR_MAN "C:\\\\Program Files\\\\Krause\\\\man"
-
-/** Prefix directory for executables.
-*/
-#define DK4_INST_DIR_EXECPRE "C:\\\\Program Files\\\\Krause"
-
-/** Libexec directory, typically /usr/libexec or /usr/local/libexec.
-*/
-#define DK4_INST_DIR_LIBEXEC "C:\\\\Program Files\\\\Krause\\\\libexec"
-
-#else
-
-/** Installation prefix, typlically /usr or /usr/local.
-*/
-#define DK4_INST_DIR_PREFIX "$prefix"
-
-/** System configuration directory, typically /etc or /usr/local/etc.
-*/
-#define DK4_INST_DIR_ETC "$sysconfdir"
-
-/** Data directory, typically /usr/share or /usr/local/share.
-*/
-#define DK4_INST_DIR_SHARE "$datarootdir"
-
-/** Local state directory, typically /var or /usr/local/var.
-*/
-#define DK4_INST_DIR_VAR "$localstatedir"
-
-/** Binaries directory, typically /usr/bin or /usr/local/bin.
-*/
-#define DK4_INST_DIR_BIN "$bindir"
-
-/** System binaries directory, typically /usr/sbin or /usr/local/sbin.
-*/
-#define DK4_INST_DIR_SBIN "$sbindir"
-
-/** Libraries directory, typically /usr/lib or /usr/local/lib.
-*/
-#define DK4_INST_DIR_LIB "$libdir"
-
-/** Include files directory, typically /usr/include or /usr/local/include.
-*/
-#define DK4_INST_DIR_INCLUDE "$includedir"
-
-/** Man pages directory, typically /usr/share/man or /usr/local/share/man.
-*/
-#define DK4_INST_DIR_MAN "$mandir"
-
-/** Prefix directory for executables.
-*/
-#define DK4_INST_DIR_EXECPRE "$exec_prefix"
-
-/** Libexec directory, typically /usr/libexec or /usr/local/libexec.
-*/
-#define DK4_INST_DIR_LIBEXEC "$libexecdir"
-
-#endif
-/**@}*/
-
-#endif
-
-/* vim: set ai sw=2 filetype=c : */
-
-EOF
-
diff --git a/support/dktools/scripts/write-files.sh b/support/dktools/scripts/write-files.sh
new file mode 100755
index 0000000000..aff118b21e
--- /dev/null
+++ b/support/dktools/scripts/write-files.sh
@@ -0,0 +1,735 @@
+#! /bin/sh
+
+# Stage: Configuration during build (./configure script)
+# Purpose: Write various files needing installation path:
+#
+# - printqd.service
+# - rshdown.service
+# - rshdown-init
+# - rshdown.conf
+# - printqd.conf
+# - dk4inst.c
+# - dk4inst.h
+# - dk3inst.c
+# - debian/dktools.install
+# - debian/dktools-data.install
+# - debian/rshdown.install
+# - debian/printqd.install
+# - wxdkdraw.desktop
+# - wxbmpp.desktop
+# - wxdkclock.desktop
+# - wxdkct.desktop
+# - wximgsz.desktop
+# - wxdkfcs.desktop
+
+prefix=/usr/local
+datarootdir=${prefix}/share
+exec_prefix=${prefix}
+bindir=${exec_prefix}/bin
+sbindir=${exec_prefix}/sbin
+datadir=${datarootdir}
+sysconfdir=${prefix}/etc
+scd=${sysconfdir}
+libdir=${exec_prefix}/lib
+libexecdir=${exec_prefix}/libexec
+sharedlibdir=${libdir}/shared
+mandir=${datarootdir}/man
+includedir=${prefix}/include
+localstatedir=${prefix}/var
+srcdir=.
+runstatedir=${localstatedir}/run
+rundir=/run
+systemddir=/lib/systemd/system
+top_srcdir=..
+
+LPRNGUSER=daemon
+LPRNGGROUP=lp
+SUITE=gui
+
+# ----- printqd.service -----
+
+[ ! -f printqd.service ] || rm -f printqd.service
+
+if [ -f debian/printqd.printqd.service ]
+then
+ rm -f debian/printqd.printqd.service
+fi
+cat - >printqd.service <<EOF
+[Unit]
+Description=Print quota daemon
+After=network.target
+StartLimitIntervalSec=10
+Documentation=man:printqd(1) man:printqd.protocol(5)
+
+[Service]
+Type=forking
+ExecStart=${sbindir}/printqd
+Restart=always
+RestartSec=2
+PIDFile=${rundir}/printqd/printqd.pid
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+ln printqd.service debian/printqd.printqd.service
+
+# ----- rshdown.service -----
+
+[ ! -f rshdown.service ] || rm -f rshdown.service
+
+if [ -f debian/rshdown.rshdown.service ]
+then
+ rm -f debian/rshdown.rshdown.service
+fi
+
+cat - >rshdown.service <<EOF
+[Unit]
+Description=Remote shutdown daemon
+After=network.target
+StartLimitIntervalSec=10
+Documentation=man:rshdown(1)
+
+[Service]
+Type=forking
+ExecStartPre=${sbindir}/rshdown-init
+ExecStart=${sbindir}/rshdown
+Restart=always
+RestartSec=2
+PIDFile=${rundir}/rshdown/rshdown.pid
+
+[Install]
+WantedBy=multi-user.target
+EOF
+ln rshdown.service debian/rshdown.rshdown.service
+
+chmod 644 printqd.service rshdown.service
+chmod 644 debian/rshdown.rshdown.service debian/printqd.printqd.service
+
+
+# ----- rshdown-init -----
+
+cat - >rshdown-init <<EOF
+#! /bin/sh
+
+# This script generates a secret (pre-shared key) file.
+# Use a secure mechanism to transfer the secret file between
+# sender and recipient.
+# Only root should have permissions on the file, no other users.
+
+if [ ! -f "${sysconfdir}/rshdown/secret" ]
+then
+ LENGTH=\`${bindir}/dk-pwgen -p -l 2\`
+ LENGTH=\`expr 1460 - \$LENGTH\`
+ touch "${sysconfdir}/rshdown/secret"
+ chmod 600 "${sysconfdir}/rshdown/secret"
+ ${bindir}/dk-rand -b \$LENGTH > "${sysconfdir}/rshdown/secret"
+ chmod 600 "${sysconfdir}/rshdown/secret"
+fi
+EOF
+
+chmod 755 rshdown-init
+
+# ----- rshdown.conf -----
+cat - >rshdown.conf <<EOF
+# Allowed sender address, optional:
+# ---------------------------------
+# - One machine specified by IPv6 address: ::1
+# - One machine specified by IPv4 address: 192.0.2.100
+# - One network specified by IPv4 address/mask: 192.0.2.0/24
+# - Alternatively mask in dotted notation: 192.0.2.0/255.255.255.0
+sender = 192.0.2.100
+
+# Allowed sender port (any if not specified here).
+# ------------------------------------------------
+sender port = 1234
+
+# Local UDP port we are using.
+# ----------------------------
+receiver port = 1234
+
+# File containing data to compare against packet contents.
+# --------------------------------------------------------
+file = ${sysconfdir}/rshdown/secret
+
+# Signal number or case-insensitive name to send to init process
+# --------------------------------------------------------------
+# Only used if no command specified below.
+# Signal names: hup int quit ill trap abrt iot bus fpe kill usr1
+# segv usr2 pipe alrm term stkflt cld cont stop ttin
+# ttou urg xcpu xfsz vtalrm prof winch poll io pwr sys
+# Alternatively: sighup sigint sigquit ...
+# Signal names are system dependant, not every signal is supported on every
+# system.
+signal = sigpwr
+
+# Command to execute on arrival of shutdown packet
+# ------------------------------------------------
+# The command is passed to /bin/sh by the system() function.
+# The shutdown command syntax is OS dependant, i.e. on Solaris
+# we would use "shutdown -i0 -g0 -y" instead.
+command = shutdown -h now > /dev/null 2>&1 &
+
+# Syslog facility to use
+# ----------------------
+# One from:
+# auth authpriv cron daemon ftp kern lpr mail news security syslog user
+# uucp local0 local1 local2 local3 local4 local5 local6 local7
+syslog facility = auth
+
+# Flag: Syslog messages for discarded packets
+# -------------------------------------------
+debug = off
+EOF
+
+chmod 644 rshdown.conf
+
+
+# ----- printqd.conf -----
+
+cat - >printqd.conf <<EOF
+[options]
+# run as user = ${LPRNGUSER}
+# run as group = ${LPRNGGROUP}
+# database = mem::${localstatedir}/lib/printqd/db/printqd.db
+# local socket = ${localstatedir}/run/printqd/printqd.sock
+# local socket owner = ${LPRNGUSER}
+# local socket group = ${LPRNGGROUP}
+# local socket backlog = 5
+# max local connections = 7
+# udp port = 9100
+# tcp port = 9100
+# tcp port backlog = 5
+# max tcp connections = 50
+# info allow = 192.0.2.0/24
+# info allow = *
+# data allow = 127.0.0.1/32
+# admin allow = 127.0.0.1/32
+# log file = ${localstatedir}/log/printqd/printqd.log
+# log features = -
+
+[class cl-mfd]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 0
+deny action = remove
+
+[class cl-color]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 0
+deny action = remove
+
+[class cl-lab]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 200
+deny action = remove
+
+[printer lp1]
+alias = lp
+class = cl-lab
+
+[printer lp2]
+class = cl-lab
+
+[printer lpcolor]
+class = cl-color
+
+[printer mfd]
+class = cl-mfd
+EOF
+
+chmod 644 printqd.conf
+
+CURRENT_TIMESTAMP=`date '+%Y-%m-%d %H:%M:%S'`
+
+# ----- dk4inst.c -----
+
+cat - >dk4inst.c <<EOF
+/*
+Copyright 2020-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/** @file dk4inst.c Installation directories.
+ Produced by configure, $CURRENT_TIMESTAMP.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4INST_H_INCLUDED
+#include "dk4inst.h"
+#endif
+
+
+
+/** Directory names.
+*/
+const dkChar * const dk4inst_directories[] = {
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
+ /* 0 */ dkT("C:\\\\Program Files\\\\Krause"),
+ /* 1 */ dkT("C:\\\\Program Files\\\\Krause\\\\etc"),
+ /* 2 */ dkT("C:\\\\Program Files\\\\Krause\\\\share"),
+ /* 3 */ dkT("C:\\\\Program Files\\\\Krause\\\\var"),
+ /* 4 */ dkT("C:\\\\Program Files\\\\Krause\\\\bin"),
+ /* 5 */ dkT("C:\\\\Program Files\\\\Krause\\\\sbin"),
+ /* 6 */ dkT("C:\\\\Program Files\\\\Krause\\\\lib"),
+ /* 7 */ dkT("C:\\\\Program Files\\\\Krause\\\\include"),
+ /* 8 */ dkT("C:\\\\Program Files\\\\Krause\\\\man"),
+ /* 9 */ dkT("C:\\\\Program Files\\\\Krause"),
+ /* 10 */ dkT("C:\\\\Program Files\\\\Krause\\\\libexec"),
+ /* 11 */ dkT("C:\\\\Program Files\\\\Krause\\\\run"),
+ /* 12 */ dkT("C:\\\\Program Files\\\\Krause\\\\run"),
+#else
+ /* 0 */ dkT("$prefix"),
+ /* 1 */ dkT("$sysconfdir"),
+ /* 2 */ dkT("$datarootdir"),
+ /* 3 */ dkT("$localstatedir"),
+ /* 4 */ dkT("$bindir"),
+ /* 5 */ dkT("$sbindir"),
+ /* 6 */ dkT("$libdir"),
+ /* 7 */ dkT("$includedir"),
+ /* 8 */ dkT("$mandir"),
+ /* 9 */ dkT("$exec_prefix"),
+ /* 10 */ dkT("$libexecdir"),
+ /* 11 */ dkT("$runstatedir"),
+ /* 12 */ dkT("$rundir"),
+#endif
+};
+
+
+
+const dkChar *
+dk4inst_get_directory(size_t i)
+{
+ const dkChar *back = NULL;
+#if DK4_USE_ASSERT
+ assert(i <= 12);
+#endif
+ if(i <= 12) { back = dk4inst_directories[i]; }
+ return back;
+}
+
+
+
+/* vim: set ai sw=2 filetype=c : */
+
+EOF
+
+# ----- dk4inst.h ----
+
+cat - >dk4inst.h <<EOF
+/*
+Copyright 2020-2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+#ifndef DK4INST_H_INCLUDED
+#define DK4INST_H_INCLUDED 1
+
+/** @file dk4inst.h Installation directories.
+
+ Obtain installation prefix, system configuration directory,
+ data directory, local state directory, binary directory,
+ root binary directory, library directory, include directory,
+ man page directory, executable files prefix and libexec
+ directory is configured during build process.
+
+ CRT on Windows: Not used.
+
+ Produced by configure, $CURRENT_TIMESTAMP.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve one installation directory.
+ @param i Directory index:
+ 0 = prefix,
+ 1 = system configuration directory,
+ 2 = data directory,
+ 3 = local state directory,
+ 4 = binary directory,
+ 5 = root binary directory,
+ 6 = library directory,
+ 7 = include directory,
+ 8 = man page directory,
+ 9 = executable files prefix,
+ 10 = libexec directory.
+ @return Pointer to directory name on success, NULL on error.
+*/
+const dkChar *
+dk4inst_get_directory(size_t i);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @defgroup instdirs Installation directories. */
+/**@{*/
+#if _WIN32
+
+/** Installation prefix, typlically /usr or /usr/local.
+*/
+#define DK4_INST_DIR_PREFIX "C:\\\\Program Files\\\\Krause"
+
+/** System configuration directory, typically /etc or /usr/local/etc.
+*/
+#define DK4_INST_DIR_ETC "C:\\\\Program Files\\\\Krause\\\\etc"
+
+/** Data directory, typically /usr/share or /usr/local/share.
+*/
+#define DK4_INST_DIR_SHARE "C:\\\\Program Files\\\\Krause\\\\share"
+
+/** Local state directory, typically /var or /usr/local/var.
+*/
+#define DK4_INST_DIR_VAR "C:\\\\Program Files\\\\Krause\\\\var"
+
+/** Binaries directory, typically /usr/bin or /usr/local/bin.
+*/
+#define DK4_INST_DIR_BIN "C:\\\\Program Files\\\\Krause\\\\bin"
+
+/** System binaries directory, typically /usr/sbin or /usr/local/sbin.
+*/
+#define DK4_INST_DIR_SBIN "C:\\\\Program Files\\\\Krause\\\\sbin"
+
+/** Libraries directory, typically /usr/lib or /usr/local/lib.
+*/
+#define DK4_INST_DIR_LIB "C:\\\\Program Files\\\\Krause\\\\lib"
+
+/** Include files directory, typically /usr/include or /usr/local/include.
+*/
+#define DK4_INST_DIR_INCLUDE "C:\\\\Program Files\\\\Krause\\\\include"
+
+/** Man pages directory, typically /usr/share/man or /usr/local/share/man.
+*/
+#define DK4_INST_DIR_MAN "C:\\\\Program Files\\\\Krause\\\\man"
+
+/** Prefix directory for executables.
+*/
+#define DK4_INST_DIR_EXECPRE "C:\\\\Program Files\\\\Krause"
+
+/** Libexec directory, typically /usr/libexec or /usr/local/libexec.
+*/
+#define DK4_INST_DIR_LIBEXEC "C:\\\\Program Files\\\\Krause\\\\libexec"
+
+/** Run state directory, typically /var/run or /run.
+*/
+#define DK4_INST_DIR_RUNSTATE "C:\\\\Program Files\\\\Krause\\\\run"
+
+/** Run state directory for systemd, typically /run.
+*/
+#define DK4_INST_DIR_SYSTEMD_RUN "C:\\\\Program Files\\\\Krause\\\\run"
+
+#else
+
+/** Installation prefix, typlically /usr or /usr/local.
+*/
+#define DK4_INST_DIR_PREFIX "$prefix"
+
+/** System configuration directory, typically /etc or /usr/local/etc.
+*/
+#define DK4_INST_DIR_ETC "$sysconfdir"
+
+/** Data directory, typically /usr/share or /usr/local/share.
+*/
+#define DK4_INST_DIR_SHARE "$datarootdir"
+
+/** Local state directory, typically /var or /usr/local/var.
+*/
+#define DK4_INST_DIR_VAR "$localstatedir"
+
+/** Binaries directory, typically /usr/bin or /usr/local/bin.
+*/
+#define DK4_INST_DIR_BIN "$bindir"
+
+/** System binaries directory, typically /usr/sbin or /usr/local/sbin.
+*/
+#define DK4_INST_DIR_SBIN "$sbindir"
+
+/** Libraries directory, typically /usr/lib or /usr/local/lib.
+*/
+#define DK4_INST_DIR_LIB "$libdir"
+
+/** Include files directory, typically /usr/include or /usr/local/include.
+*/
+#define DK4_INST_DIR_INCLUDE "$includedir"
+
+/** Man pages directory, typically /usr/share/man or /usr/local/share/man.
+*/
+#define DK4_INST_DIR_MAN "$mandir"
+
+/** Prefix directory for executables.
+*/
+#define DK4_INST_DIR_EXECPRE "$exec_prefix"
+
+/** Libexec directory, typically /usr/libexec or /usr/local/libexec.
+*/
+#define DK4_INST_DIR_LIBEXEC "$libexecdir"
+
+/** Run state directory, typically /var/run or /run.
+*/
+#define DK4_INST_DIR_RUNSTATE "$runstatedir"
+
+/** Run state directory for systemd, typically /run.
+*/
+#define DK4_INST_DIR_SYSTEMD_RUN "$rundir"
+
+#endif
+/**@}*/
+
+#endif
+
+/* vim: set ai sw=2 filetype=c : */
+
+EOF
+
+chmod 644 dk4inst.c dk4inst.h
+
+
+# ----- dk3inst.c -----
+
+cat - >dk3inst.c <<EOF
+
+#include "dk3conf.h"
+#include "dk3types.h"
+#include "dk3inst.h"
+
+
+dkChar const * const dk3inst_directories[] = {
+#if DK3_ON_WINDOWS || DK3_HAVE_BACKSLASH
+ /* 0 */ dkT("C:\\\\Program Files\\\\Krause"),
+ /* 1 */ dkT("C:\\\\Program Files\\\\Krause\\\\etc"),
+ /* 2 */ dkT("C:\\\\Program Files\\\\Krause\\\\share"),
+ /* 3 */ dkT("C:\\\\Program Files\\\\Krause\\\\var"),
+ /* 4 */ dkT("C:\\\\Program Files\\\\Krause\\\\bin"),
+ /* 5 */ dkT("C:\\\\Program Files\\\\Krause\\\\sbin"),
+ /* 6 */ dkT("C:\\\\Program Files\\\\Krause\\\\lib"),
+ /* 7 */ dkT("C:\\\\Program Files\\\\Krause\\\\include"),
+ /* 8 */ dkT("C:\\\\Program Files\\\\Krause\\\\man"),
+ /* 9 */ dkT("C:\\\\Program Files\\\\Krause"),
+ /* 10 */ dkT("C:\\\\Program Files\\\\Krause\\\\libexec"),
+#else
+ /* 0 */ dkT("$prefix"),
+ /* 1 */ dkT("$sysconfdir"),
+ /* 2 */ dkT("$datarootdir"),
+ /* 3 */ dkT("$localstatedir"),
+ /* 4 */ dkT("$bindir"),
+ /* 5 */ dkT("$sbindir"),
+ /* 6 */ dkT("$libdir"),
+ /* 7 */ dkT("$includedir"),
+ /* 8 */ dkT("$mandir"),
+ /* 9 */ dkT("$exec_prefix"),
+ /* 10 */ dkT("$libexecdir"),
+#endif
+};
+
+
+
+dkChar const *
+dk3inst_get_directory(size_t i)
+{
+ dkChar const *back = NULL;
+ if(i <= 10) { back = dk3inst_directories[i]; }
+ return back;
+}
+
+
+
+/* vim: set ai sw=2 filetype=c foldmethod=marker foldopen=all : */
+
+EOF
+
+
+
+# ----- debian/dktools.install -----
+
+debprefix=`echo ${prefix} | sed -e 's/^\///g'`
+deblibexecdir=`echo ${libexecdir} | sed -e 's/^\///g'`
+deblibdir=`echo ${libdir} | sed -e 's/^\///g'`
+debbindir=`echo ${bindir} | sed -e 's/^\///g'`
+debsbindir=`echo ${sbindir} | sed -e 's/^\///g'`
+debdatadir=`echo ${datadir} | sed -e 's/^\///g'`
+debsysconfdir=`echo ${sysconfdir} | sed -e 's/^\///g'`
+debsystemddir=`echo ${systemddir} | sed -e 's/^\///g'`
+
+cat - >debian/dktools.install <<EOF
+${debbindir}
+${deblibexecdir}/dktools
+${debdatadir}/applications/*.desktop
+EOF
+
+
+chmod 644 debian/dktools.install
+
+# ----- debian/dktools-data.install -----
+
+cat - >debian/dktools-data.install <<EOF
+${debdatadir}/dktools
+EOF
+
+
+# ----- debian/rshdown.install -----
+if [ "X$FOUND_SYSTEMD" = "Xyes" ]
+then
+cat - >debian/rshdown.install <<EOF
+${debsbindir}/rshdown
+${debsbindir}/rshdown-init
+${debsysconfdir}/rshdown/rshdown.conf
+${debsysconfdir}/rshdown/rshdown.conf.sample
+${debsystemddir}/rshdown.service
+EOF
+else
+cat - >debian/rshdown.install <<EOF
+${debsbindir}/rshdown
+${debsbindir}/rshdown-init
+${debsysconfdir}/rshdown/rshdown.conf
+${debsysconfdir}/rshdown/rshdown.conf.sample
+${debsysconfdir}/init.d/rshdown
+EOF
+fi
+
+# ----- debian/printqd.install -----
+if [ "X$FOUND_SYSTEMD" = "Xyes" ]
+then
+cat - >debian/printqd.install <<EOF
+${debsbindir}/printqd
+${debsysconfdir}/printqd/printqd.conf
+${debsysconfdir}/printqd/printqd.conf.sample
+${debsystemddir}/printqd.service
+EOF
+else
+cat - >debian/printqd.install <<EOF
+${debsbindir}/printqd
+${debsysconfdir}/printqd/printqd.conf
+${debsysconfdir}/printqd/printqd.conf.sample
+${debsysconfdir}/init.d/printqd
+EOF
+fi
+
+
+# ----- wxdkdraw.desktop -----
+
+cat - >wxdkdraw.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Graphics;
+Name=wxdkdraw
+Comment=Drawing program for use with (pdf)LaTeX
+Comment[de]=Zeichenprogramm für Nutzung mit (pdf)LaTeX
+Exec=${bindir}/wxdkdraw %f
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/wxdkdraw.ico
+MimeType=image/x-wxdkdraw
+EOF
+
+
+# ----- wxbmpp.desktop -----
+
+cat - >wxbmpp.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Graphics;
+Name=wxbmpp
+Comment=Converter from PNG/JPEG/TIFF to PDF/EPS
+Comment[de]=Konvertierung von PNG/JPEG/TIFF zu PDF/EPS
+Exec=${bindir}/wxbmpp %f
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkicon.ico
+
+EOF
+
+
+# ----- wxdkclock.desktop -----
+
+cat - >wxdkclock.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Clock;
+Name=DK clock
+Name[de]=Uhr
+Comment=Simple clock with one alert
+Comment[de]=Einfache Uhr mit einem Alarm
+Exec=${bindir}/wxdkclock
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkclock.ico
+EOF
+
+
+# ----- wxdkct.desktop -----
+
+cat - >wxdkct.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Development;
+Name=wxdkct
+Comment=C, C++, Objective-C and Java Tool
+Comment[de]=Tool für C, C++, Objective-C und Java
+Exec=${bindir}/wxdkct
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkicon.ico
+EOF
+
+
+
+# ----- wximgsz.desktop -----
+
+cat - >wximgsz.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Graphics;
+Name=wximgsz
+Comment=Suggest size pairs to rescale bitmap images
+Comment[de]=Größenvorschläge für Skalierung von Bitmap-Bildern
+Exec=${bindir}/wximgsz
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkicon.ico
+EOF
+
+
+# ----- wxdkfcs.desktop -----
+
+cat - >wxdkfcs.desktop <<EOF
+[Desktop Entry]
+Categories=System;Utility;FileTools;
+Name=wxdkfcs
+Comment=Create file checksums
+Comment[de]=Prüfsummen für Dateien
+Exec=${bindir}/wxdkfcs
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkicon.ico
+EOF
+
+
diff --git a/support/dktools/scripts/write-files.sh.in b/support/dktools/scripts/write-files.sh.in
new file mode 100755
index 0000000000..df6423822e
--- /dev/null
+++ b/support/dktools/scripts/write-files.sh.in
@@ -0,0 +1,735 @@
+#! /bin/sh
+
+# Stage: Configuration during build (./configure script)
+# Purpose: Write various files needing installation path:
+#
+# - printqd.service
+# - rshdown.service
+# - rshdown-init
+# - rshdown.conf
+# - printqd.conf
+# - dk4inst.c
+# - dk4inst.h
+# - dk3inst.c
+# - debian/dktools.install
+# - debian/dktools-data.install
+# - debian/rshdown.install
+# - debian/printqd.install
+# - wxdkdraw.desktop
+# - wxbmpp.desktop
+# - wxdkclock.desktop
+# - wxdkct.desktop
+# - wximgsz.desktop
+# - wxdkfcs.desktop
+
+prefix=@prefix@
+datarootdir=@datarootdir@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+datadir=${datarootdir}
+sysconfdir=@sysconfdir@
+scd=${sysconfdir}
+libdir=@libdir@
+libexecdir=@libexecdir@
+sharedlibdir=${libdir}/shared
+mandir=@mandir@
+includedir=@includedir@
+localstatedir=@localstatedir@
+srcdir=@srcdir@
+runstatedir=@runstatedir@
+rundir=@rundir@
+systemddir=@systemddir@
+top_srcdir=@top_srcdir@
+VPATH=@srcdir@
+LPRNGUSER=@LPRNGUSER@
+LPRNGGROUP=@LPRNGGROUP@
+SUITE=@SUITE@
+
+# ----- printqd.service -----
+
+[ ! -f printqd.service ] || rm -f printqd.service
+
+if [ -f debian/printqd.printqd.service ]
+then
+ rm -f debian/printqd.printqd.service
+fi
+cat - >printqd.service <<EOF
+[Unit]
+Description=Print quota daemon
+After=network.target
+StartLimitIntervalSec=10
+Documentation=man:printqd(1) man:printqd.protocol(5)
+
+[Service]
+Type=forking
+ExecStart=${sbindir}/printqd
+Restart=always
+RestartSec=2
+PIDFile=${rundir}/printqd/printqd.pid
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+ln printqd.service debian/printqd.printqd.service
+
+# ----- rshdown.service -----
+
+[ ! -f rshdown.service ] || rm -f rshdown.service
+
+if [ -f debian/rshdown.rshdown.service ]
+then
+ rm -f debian/rshdown.rshdown.service
+fi
+
+cat - >rshdown.service <<EOF
+[Unit]
+Description=Remote shutdown daemon
+After=network.target
+StartLimitIntervalSec=10
+Documentation=man:rshdown(1)
+
+[Service]
+Type=forking
+ExecStartPre=${sbindir}/rshdown-init
+ExecStart=${sbindir}/rshdown
+Restart=always
+RestartSec=2
+PIDFile=${rundir}/rshdown/rshdown.pid
+
+[Install]
+WantedBy=multi-user.target
+EOF
+ln rshdown.service debian/rshdown.rshdown.service
+
+chmod 644 printqd.service rshdown.service
+chmod 644 debian/rshdown.rshdown.service debian/printqd.printqd.service
+
+
+# ----- rshdown-init -----
+
+cat - >rshdown-init <<EOF
+#! /bin/sh
+
+# This script generates a secret (pre-shared key) file.
+# Use a secure mechanism to transfer the secret file between
+# sender and recipient.
+# Only root should have permissions on the file, no other users.
+
+if [ ! -f "${sysconfdir}/rshdown/secret" ]
+then
+ LENGTH=\`${bindir}/dk-pwgen -p -l 2\`
+ LENGTH=\`expr 1460 - \$LENGTH\`
+ touch "${sysconfdir}/rshdown/secret"
+ chmod 600 "${sysconfdir}/rshdown/secret"
+ ${bindir}/dk-rand -b \$LENGTH > "${sysconfdir}/rshdown/secret"
+ chmod 600 "${sysconfdir}/rshdown/secret"
+fi
+EOF
+
+chmod 755 rshdown-init
+
+# ----- rshdown.conf -----
+cat - >rshdown.conf <<EOF
+# Allowed sender address, optional:
+# ---------------------------------
+# - One machine specified by IPv6 address: ::1
+# - One machine specified by IPv4 address: 192.0.2.100
+# - One network specified by IPv4 address/mask: 192.0.2.0/24
+# - Alternatively mask in dotted notation: 192.0.2.0/255.255.255.0
+sender = 192.0.2.100
+
+# Allowed sender port (any if not specified here).
+# ------------------------------------------------
+sender port = 1234
+
+# Local UDP port we are using.
+# ----------------------------
+receiver port = 1234
+
+# File containing data to compare against packet contents.
+# --------------------------------------------------------
+file = ${sysconfdir}/rshdown/secret
+
+# Signal number or case-insensitive name to send to init process
+# --------------------------------------------------------------
+# Only used if no command specified below.
+# Signal names: hup int quit ill trap abrt iot bus fpe kill usr1
+# segv usr2 pipe alrm term stkflt cld cont stop ttin
+# ttou urg xcpu xfsz vtalrm prof winch poll io pwr sys
+# Alternatively: sighup sigint sigquit ...
+# Signal names are system dependant, not every signal is supported on every
+# system.
+signal = sigpwr
+
+# Command to execute on arrival of shutdown packet
+# ------------------------------------------------
+# The command is passed to /bin/sh by the system() function.
+# The shutdown command syntax is OS dependant, i.e. on Solaris
+# we would use "shutdown -i0 -g0 -y" instead.
+command = shutdown -h now > /dev/null 2>&1 &
+
+# Syslog facility to use
+# ----------------------
+# One from:
+# auth authpriv cron daemon ftp kern lpr mail news security syslog user
+# uucp local0 local1 local2 local3 local4 local5 local6 local7
+syslog facility = auth
+
+# Flag: Syslog messages for discarded packets
+# -------------------------------------------
+debug = off
+EOF
+
+chmod 644 rshdown.conf
+
+
+# ----- printqd.conf -----
+
+cat - >printqd.conf <<EOF
+[options]
+# run as user = ${LPRNGUSER}
+# run as group = ${LPRNGGROUP}
+# database = mem::${localstatedir}/lib/printqd/db/printqd.db
+# local socket = ${localstatedir}/run/printqd/printqd.sock
+# local socket owner = ${LPRNGUSER}
+# local socket group = ${LPRNGGROUP}
+# local socket backlog = 5
+# max local connections = 7
+# udp port = 9100
+# tcp port = 9100
+# tcp port backlog = 5
+# max tcp connections = 50
+# info allow = 192.0.2.0/24
+# info allow = *
+# data allow = 127.0.0.1/32
+# admin allow = 127.0.0.1/32
+# log file = ${localstatedir}/log/printqd/printqd.log
+# log features = -
+
+[class cl-mfd]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 0
+deny action = remove
+
+[class cl-color]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 0
+deny action = remove
+
+[class cl-lab]
+user limit = Administrator unlimited
+user limit = Administ unlimited
+user limit = admin unlimited
+user limit = root unlimited
+group limit = fac_m unlimited
+default limit = 200
+deny action = remove
+
+[printer lp1]
+alias = lp
+class = cl-lab
+
+[printer lp2]
+class = cl-lab
+
+[printer lpcolor]
+class = cl-color
+
+[printer mfd]
+class = cl-mfd
+EOF
+
+chmod 644 printqd.conf
+
+CURRENT_TIMESTAMP=`date '+%Y-%m-%d %H:%M:%S'`
+
+# ----- dk4inst.c -----
+
+cat - >dk4inst.c <<EOF
+/*
+Copyright 2020-@THISYEAR@, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/** @file dk4inst.c Installation directories.
+ Produced by configure, $CURRENT_TIMESTAMP.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#if DK4_HAVE_ASSERT_H
+#ifndef ASSERT_H_INCLUDED
+#include <assert.h>
+#define ASSERT_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4INST_H_INCLUDED
+#include "dk4inst.h"
+#endif
+
+
+
+/** Directory names.
+*/
+const dkChar * const dk4inst_directories[] = {
+#if DK4_ON_WINDOWS || DK4_HAVE_BACKSLASH_AS_SEP
+ /* 0 */ dkT("C:\\\\Program Files\\\\Krause"),
+ /* 1 */ dkT("C:\\\\Program Files\\\\Krause\\\\etc"),
+ /* 2 */ dkT("C:\\\\Program Files\\\\Krause\\\\share"),
+ /* 3 */ dkT("C:\\\\Program Files\\\\Krause\\\\var"),
+ /* 4 */ dkT("C:\\\\Program Files\\\\Krause\\\\bin"),
+ /* 5 */ dkT("C:\\\\Program Files\\\\Krause\\\\sbin"),
+ /* 6 */ dkT("C:\\\\Program Files\\\\Krause\\\\lib"),
+ /* 7 */ dkT("C:\\\\Program Files\\\\Krause\\\\include"),
+ /* 8 */ dkT("C:\\\\Program Files\\\\Krause\\\\man"),
+ /* 9 */ dkT("C:\\\\Program Files\\\\Krause"),
+ /* 10 */ dkT("C:\\\\Program Files\\\\Krause\\\\libexec"),
+ /* 11 */ dkT("C:\\\\Program Files\\\\Krause\\\\run"),
+ /* 12 */ dkT("C:\\\\Program Files\\\\Krause\\\\run"),
+#else
+ /* 0 */ dkT("$prefix"),
+ /* 1 */ dkT("$sysconfdir"),
+ /* 2 */ dkT("$datarootdir"),
+ /* 3 */ dkT("$localstatedir"),
+ /* 4 */ dkT("$bindir"),
+ /* 5 */ dkT("$sbindir"),
+ /* 6 */ dkT("$libdir"),
+ /* 7 */ dkT("$includedir"),
+ /* 8 */ dkT("$mandir"),
+ /* 9 */ dkT("$exec_prefix"),
+ /* 10 */ dkT("$libexecdir"),
+ /* 11 */ dkT("$runstatedir"),
+ /* 12 */ dkT("$rundir"),
+#endif
+};
+
+
+
+const dkChar *
+dk4inst_get_directory(size_t i)
+{
+ const dkChar *back = NULL;
+#if DK4_USE_ASSERT
+ assert(i <= 12);
+#endif
+ if(i <= 12) { back = dk4inst_directories[i]; }
+ return back;
+}
+
+
+
+/* vim: set ai sw=2 filetype=c : */
+
+EOF
+
+# ----- dk4inst.h ----
+
+cat - >dk4inst.h <<EOF
+/*
+Copyright 2020-@THISYEAR@, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+#ifndef DK4INST_H_INCLUDED
+#define DK4INST_H_INCLUDED 1
+
+/** @file dk4inst.h Installation directories.
+
+ Obtain installation prefix, system configuration directory,
+ data directory, local state directory, binary directory,
+ root binary directory, library directory, include directory,
+ man page directory, executable files prefix and libexec
+ directory is configured during build process.
+
+ CRT on Windows: Not used.
+
+ Produced by configure, $CURRENT_TIMESTAMP.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve one installation directory.
+ @param i Directory index:
+ 0 = prefix,
+ 1 = system configuration directory,
+ 2 = data directory,
+ 3 = local state directory,
+ 4 = binary directory,
+ 5 = root binary directory,
+ 6 = library directory,
+ 7 = include directory,
+ 8 = man page directory,
+ 9 = executable files prefix,
+ 10 = libexec directory.
+ @return Pointer to directory name on success, NULL on error.
+*/
+const dkChar *
+dk4inst_get_directory(size_t i);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @defgroup instdirs Installation directories. */
+/**@{*/
+#if _WIN32
+
+/** Installation prefix, typlically /usr or /usr/local.
+*/
+#define DK4_INST_DIR_PREFIX "C:\\\\Program Files\\\\Krause"
+
+/** System configuration directory, typically /etc or /usr/local/etc.
+*/
+#define DK4_INST_DIR_ETC "C:\\\\Program Files\\\\Krause\\\\etc"
+
+/** Data directory, typically /usr/share or /usr/local/share.
+*/
+#define DK4_INST_DIR_SHARE "C:\\\\Program Files\\\\Krause\\\\share"
+
+/** Local state directory, typically /var or /usr/local/var.
+*/
+#define DK4_INST_DIR_VAR "C:\\\\Program Files\\\\Krause\\\\var"
+
+/** Binaries directory, typically /usr/bin or /usr/local/bin.
+*/
+#define DK4_INST_DIR_BIN "C:\\\\Program Files\\\\Krause\\\\bin"
+
+/** System binaries directory, typically /usr/sbin or /usr/local/sbin.
+*/
+#define DK4_INST_DIR_SBIN "C:\\\\Program Files\\\\Krause\\\\sbin"
+
+/** Libraries directory, typically /usr/lib or /usr/local/lib.
+*/
+#define DK4_INST_DIR_LIB "C:\\\\Program Files\\\\Krause\\\\lib"
+
+/** Include files directory, typically /usr/include or /usr/local/include.
+*/
+#define DK4_INST_DIR_INCLUDE "C:\\\\Program Files\\\\Krause\\\\include"
+
+/** Man pages directory, typically /usr/share/man or /usr/local/share/man.
+*/
+#define DK4_INST_DIR_MAN "C:\\\\Program Files\\\\Krause\\\\man"
+
+/** Prefix directory for executables.
+*/
+#define DK4_INST_DIR_EXECPRE "C:\\\\Program Files\\\\Krause"
+
+/** Libexec directory, typically /usr/libexec or /usr/local/libexec.
+*/
+#define DK4_INST_DIR_LIBEXEC "C:\\\\Program Files\\\\Krause\\\\libexec"
+
+/** Run state directory, typically /var/run or /run.
+*/
+#define DK4_INST_DIR_RUNSTATE "C:\\\\Program Files\\\\Krause\\\\run"
+
+/** Run state directory for systemd, typically /run.
+*/
+#define DK4_INST_DIR_SYSTEMD_RUN "C:\\\\Program Files\\\\Krause\\\\run"
+
+#else
+
+/** Installation prefix, typlically /usr or /usr/local.
+*/
+#define DK4_INST_DIR_PREFIX "$prefix"
+
+/** System configuration directory, typically /etc or /usr/local/etc.
+*/
+#define DK4_INST_DIR_ETC "$sysconfdir"
+
+/** Data directory, typically /usr/share or /usr/local/share.
+*/
+#define DK4_INST_DIR_SHARE "$datarootdir"
+
+/** Local state directory, typically /var or /usr/local/var.
+*/
+#define DK4_INST_DIR_VAR "$localstatedir"
+
+/** Binaries directory, typically /usr/bin or /usr/local/bin.
+*/
+#define DK4_INST_DIR_BIN "$bindir"
+
+/** System binaries directory, typically /usr/sbin or /usr/local/sbin.
+*/
+#define DK4_INST_DIR_SBIN "$sbindir"
+
+/** Libraries directory, typically /usr/lib or /usr/local/lib.
+*/
+#define DK4_INST_DIR_LIB "$libdir"
+
+/** Include files directory, typically /usr/include or /usr/local/include.
+*/
+#define DK4_INST_DIR_INCLUDE "$includedir"
+
+/** Man pages directory, typically /usr/share/man or /usr/local/share/man.
+*/
+#define DK4_INST_DIR_MAN "$mandir"
+
+/** Prefix directory for executables.
+*/
+#define DK4_INST_DIR_EXECPRE "$exec_prefix"
+
+/** Libexec directory, typically /usr/libexec or /usr/local/libexec.
+*/
+#define DK4_INST_DIR_LIBEXEC "$libexecdir"
+
+/** Run state directory, typically /var/run or /run.
+*/
+#define DK4_INST_DIR_RUNSTATE "$runstatedir"
+
+/** Run state directory for systemd, typically /run.
+*/
+#define DK4_INST_DIR_SYSTEMD_RUN "$rundir"
+
+#endif
+/**@}*/
+
+#endif
+
+/* vim: set ai sw=2 filetype=c : */
+
+EOF
+
+chmod 644 dk4inst.c dk4inst.h
+
+
+# ----- dk3inst.c -----
+
+cat - >dk3inst.c <<EOF
+
+#include "dk3conf.h"
+#include "dk3types.h"
+#include "dk3inst.h"
+
+
+dkChar const * const dk3inst_directories[] = {
+#if DK3_ON_WINDOWS || DK3_HAVE_BACKSLASH
+ /* 0 */ dkT("C:\\\\Program Files\\\\Krause"),
+ /* 1 */ dkT("C:\\\\Program Files\\\\Krause\\\\etc"),
+ /* 2 */ dkT("C:\\\\Program Files\\\\Krause\\\\share"),
+ /* 3 */ dkT("C:\\\\Program Files\\\\Krause\\\\var"),
+ /* 4 */ dkT("C:\\\\Program Files\\\\Krause\\\\bin"),
+ /* 5 */ dkT("C:\\\\Program Files\\\\Krause\\\\sbin"),
+ /* 6 */ dkT("C:\\\\Program Files\\\\Krause\\\\lib"),
+ /* 7 */ dkT("C:\\\\Program Files\\\\Krause\\\\include"),
+ /* 8 */ dkT("C:\\\\Program Files\\\\Krause\\\\man"),
+ /* 9 */ dkT("C:\\\\Program Files\\\\Krause"),
+ /* 10 */ dkT("C:\\\\Program Files\\\\Krause\\\\libexec"),
+#else
+ /* 0 */ dkT("$prefix"),
+ /* 1 */ dkT("$sysconfdir"),
+ /* 2 */ dkT("$datarootdir"),
+ /* 3 */ dkT("$localstatedir"),
+ /* 4 */ dkT("$bindir"),
+ /* 5 */ dkT("$sbindir"),
+ /* 6 */ dkT("$libdir"),
+ /* 7 */ dkT("$includedir"),
+ /* 8 */ dkT("$mandir"),
+ /* 9 */ dkT("$exec_prefix"),
+ /* 10 */ dkT("$libexecdir"),
+#endif
+};
+
+
+
+dkChar const *
+dk3inst_get_directory(size_t i)
+{
+ dkChar const *back = NULL;
+ if(i <= 10) { back = dk3inst_directories[i]; }
+ return back;
+}
+
+
+
+/* vim: set ai sw=2 filetype=c foldmethod=marker foldopen=all : */
+
+EOF
+
+
+
+# ----- debian/dktools.install -----
+
+debprefix=`echo ${prefix} | sed -e 's/^\///g'`
+deblibexecdir=`echo ${libexecdir} | sed -e 's/^\///g'`
+deblibdir=`echo ${libdir} | sed -e 's/^\///g'`
+debbindir=`echo ${bindir} | sed -e 's/^\///g'`
+debsbindir=`echo ${sbindir} | sed -e 's/^\///g'`
+debdatadir=`echo ${datadir} | sed -e 's/^\///g'`
+debsysconfdir=`echo ${sysconfdir} | sed -e 's/^\///g'`
+debsystemddir=`echo ${systemddir} | sed -e 's/^\///g'`
+
+cat - >debian/dktools.install <<EOF
+${debbindir}
+${deblibexecdir}/dktools
+${debdatadir}/applications/*.desktop
+EOF
+
+
+chmod 644 debian/dktools.install
+
+# ----- debian/dktools-data.install -----
+
+cat - >debian/dktools-data.install <<EOF
+${debdatadir}/dktools
+EOF
+
+
+# ----- debian/rshdown.install -----
+if [ "X$FOUND_SYSTEMD" = "Xyes" ]
+then
+cat - >debian/rshdown.install <<EOF
+${debsbindir}/rshdown
+${debsbindir}/rshdown-init
+${debsysconfdir}/rshdown/rshdown.conf
+${debsysconfdir}/rshdown/rshdown.conf.sample
+${debsystemddir}/rshdown.service
+EOF
+else
+cat - >debian/rshdown.install <<EOF
+${debsbindir}/rshdown
+${debsbindir}/rshdown-init
+${debsysconfdir}/rshdown/rshdown.conf
+${debsysconfdir}/rshdown/rshdown.conf.sample
+${debsysconfdir}/init.d/rshdown
+EOF
+fi
+
+# ----- debian/printqd.install -----
+if [ "X$FOUND_SYSTEMD" = "Xyes" ]
+then
+cat - >debian/printqd.install <<EOF
+${debsbindir}/printqd
+${debsysconfdir}/printqd/printqd.conf
+${debsysconfdir}/printqd/printqd.conf.sample
+${debsystemddir}/printqd.service
+EOF
+else
+cat - >debian/printqd.install <<EOF
+${debsbindir}/printqd
+${debsysconfdir}/printqd/printqd.conf
+${debsysconfdir}/printqd/printqd.conf.sample
+${debsysconfdir}/init.d/printqd
+EOF
+fi
+
+
+# ----- wxdkdraw.desktop -----
+
+cat - >wxdkdraw.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Graphics;
+Name=wxdkdraw
+Comment=Drawing program for use with (pdf)LaTeX
+Comment[de]=Zeichenprogramm für Nutzung mit (pdf)LaTeX
+Exec=${bindir}/wxdkdraw %f
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/wxdkdraw.ico
+MimeType=image/x-wxdkdraw
+EOF
+
+
+# ----- wxbmpp.desktop -----
+
+cat - >wxbmpp.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Graphics;
+Name=wxbmpp
+Comment=Converter from PNG/JPEG/TIFF to PDF/EPS
+Comment[de]=Konvertierung von PNG/JPEG/TIFF zu PDF/EPS
+Exec=${bindir}/wxbmpp %f
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkicon.ico
+
+EOF
+
+
+# ----- wxdkclock.desktop -----
+
+cat - >wxdkclock.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Clock;
+Name=DK clock
+Name[de]=Uhr
+Comment=Simple clock with one alert
+Comment[de]=Einfache Uhr mit einem Alarm
+Exec=${bindir}/wxdkclock
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkclock.ico
+EOF
+
+
+# ----- wxdkct.desktop -----
+
+cat - >wxdkct.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Development;
+Name=wxdkct
+Comment=C, C++, Objective-C and Java Tool
+Comment[de]=Tool für C, C++, Objective-C und Java
+Exec=${bindir}/wxdkct
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkicon.ico
+EOF
+
+
+
+# ----- wximgsz.desktop -----
+
+cat - >wximgsz.desktop <<EOF
+[Desktop Entry]
+Categories=Application;Graphics;
+Name=wximgsz
+Comment=Suggest size pairs to rescale bitmap images
+Comment[de]=Größenvorschläge für Skalierung von Bitmap-Bildern
+Exec=${bindir}/wximgsz
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkicon.ico
+EOF
+
+
+# ----- wxdkfcs.desktop -----
+
+cat - >wxdkfcs.desktop <<EOF
+[Desktop Entry]
+Categories=System;Utility;FileTools;
+Name=wxdkfcs
+Comment=Create file checksums
+Comment[de]=Prüfsummen für Dateien
+Exec=${bindir}/wxdkfcs
+Terminal=0
+Type=Application
+Icon=${datarootdir}/dktools/dkicon.ico
+EOF
+
+
diff --git a/support/dktools/sddm.conf.example b/support/dktools/sddm.conf.example
new file mode 100644
index 0000000000..504af77ebf
--- /dev/null
+++ b/support/dktools/sddm.conf.example
@@ -0,0 +1,123 @@
+[Autologin]
+# Whether sddm should automatically log back into sessions when they exit
+Relogin=false
+
+# Name of session file for autologin session
+Session=
+
+# Username for autologin session
+User=
+
+
+[General]
+# Enable Qt's automatic high-DPI scaling
+EnableHiDPI=false
+
+# Halt command
+HaltCommand=/bin/systemctl poweroff
+
+# Input method module
+InputMethod=
+
+# Initial NumLock state. Can be on, off or none.
+# If property is set to none, numlock won't be changed
+# NOTE: Currently ignored if autologin is enabled.
+Numlock=none
+
+# Reboot command
+RebootCommand=/bin/systemctl reboot
+
+
+[Theme]
+# Current theme name
+Current=debian-theme
+
+# Cursor theme used in the greeter
+CursorTheme=
+
+# Number of users to use as threshold
+# above which avatars are disabled
+# unless explicitly enabled with EnableAvatars
+DisableAvatarsThreshold=7
+
+# Enable display of custom user avatars
+EnableAvatars=true
+
+# Global directory for user avatars
+# The files should be named <username>.face.icon
+FacesDir=/usr/share/sddm/faces
+
+# Theme directory path
+ThemeDir=/usr/share/sddm/themes
+
+
+[Users]
+# Default $PATH for logged in users
+DefaultPath=/bin:/usr/bin
+
+# Comma-separated list of shells.
+# Users with these shells as their default won't be listed
+HideShells=
+
+# Comma-separated list of users that should not be listed
+HideUsers=
+
+# Maximum user id for displayed users
+MaximumUid=60000
+
+# Minimum user id for displayed users
+MinimumUid=1000
+
+# Remember the session of the last successfully logged in user
+RememberLastSession=true
+
+# Remember the last successfully logged in user
+RememberLastUser=true
+
+
+[Wayland]
+# Path to a script to execute when starting the desktop session
+SessionCommand=/usr/share/sddm/scripts/wayland-session
+
+# Directory containing available Wayland sessions
+SessionDir=/usr/share/wayland-sessions
+
+# Path to the user session log file
+SessionLogFile=.local/share/sddm/wayland-session.log
+
+
+[X11]
+# Path to a script to execute when starting the display server
+DisplayCommand=/usr/share/sddm/scripts/Xsetup
+
+# Path to a script to execute when stopping the display server
+DisplayStopCommand=/usr/share/sddm/scripts/Xstop
+
+# The lowest virtual terminal number that will be used.
+MinimumVT=7
+
+# Arguments passed to the X server invocation
+ServerArguments=-nolisten tcp
+
+# Path to X server binary
+ServerPath=/usr/bin/X
+
+# Path to a script to execute when starting the desktop session
+SessionCommand=/etc/sddm/Xsession
+
+# Directory containing available X sessions
+SessionDir=/usr/share/xsessions
+
+# Path to the user session log file
+SessionLogFile=.local/share/sddm/xorg-session.log
+
+# Path to the Xauthority file
+UserAuthFile=.Xauthority
+
+# Path to xauth binary
+XauthPath=/usr/bin/xauth
+
+# Path to Xephyr binary
+XephyrPath=/usr/bin/Xephyr
+
+
diff --git a/support/dktools/set-options.xpm b/support/dktools/set-options.xpm
deleted file mode 100644
index 14999016f1..0000000000
--- a/support/dktools/set-options.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static const char *xpm_set_options[] = {
-/* width height ncolors chars_per_pixel */
-"16 15 16 1",
-/* colors */
-" c #AFAFAF",
-". c #549954",
-"X c #289728",
-"o c #F3F4F3",
-"O c #109110",
-"+ c #D0EAD0",
-"@ c #BDE2BD",
-"# c #9CBA9C",
-"$ c #7D807D",
-"% c #5E6E5E",
-"& c #FFFFFF",
-"* c #BFBFBF",
-"= c #BBBDBB",
-"- c #B7B7B7",
-"; c #B3B9B3",
-": c None",
-/* pixels */
-"::::::::::::::::",
-"::::::::::::::::",
-":::::::::::::X::",
-":::::::::::::X::",
-"::::%$$$$$$%O:::",
-"::::$******.X:::",
-"::::$*****;O::::",
-":::O$*****.X::::",
-":::.O;***#O$::::",
-"::::XX***..$::::",
-"::::$X.*#O=$::::",
-"::::%$O.O.$%::::",
-":::::::OX:::::::",
-"::::::::::::::::",
-"::::::::::::::::"
-};
diff --git a/support/dktools/sf-readme/readme.md b/support/dktools/sf-readme/readme.md
index ea87677976..b634fbc9f2 100644
--- a/support/dktools/sf-readme/readme.md
+++ b/support/dktools/sf-readme/readme.md
@@ -1,5 +1,5 @@
-src
-===
+src - Source code
+=================
Source code:
@@ -10,22 +10,18 @@ Source code:
* **dktools-devdoc-x.y.z.tar.gz**
Developer documentation (API reference generated by doxygen).
-windows
-=======
+
+windows - Windows executable setup
+==================================
Executable setup files for Windows:
* **dktools-win64-x.y.z.exe**
Default, recommended for recent computers.
-* **dktools-win32-x.y.z.exe**
- 32 bit installation for Windows 7 and above.
-* **dktools-win32-legacy-x.y.z.exe**
- 32 bit installation for Windows XP and below.
-debian
-======
-Binary packages for Debian Jessie 64 bit systems.
+debian-8.x - Packages for Debian Jessie (32, 64)
+================================================
User installation
-----------------
@@ -49,8 +45,11 @@ Developer installation (requires user installation)
* **dktools-devdoc_x.y.z-1_all.deb**
Dk libraries API reference generated by doxygen (optional).
-sl6x
-====
+
+sl-6.x - Packages for Scientific Linux 6.x (64)
+===============================================
+
+Probably the packages also work on other Enterprise Linux clones.
User installation
-----------------
@@ -77,3 +76,93 @@ Rescue systems
Package for DK tools installation on rescue live systems, stripped
down to those programs useful on a rescue system.
+
+sl-7.x - Packages for Scientific Linux 7.x (64)
+===============================================
+
+Probably the packages also work on other Enterprise Linux clones.
+
+User installation
+-----------------
+
+* **dktools-x.y.z-1.el7.x86_64.rpm**
+ DK tools and libraries (required).
+* **dktools-doc-x.y.z-1.el7.x86_64.rpm**
+ User documentation for DK tools and libraries (optional).
+* **dktools-debuginfo-x.y.z-1.el7.x86_64.rpm**
+ Debug information (optional).
+
+Developer installation (requires user installation)
+---------------------------------------------------
+
+* **dktools-devel-x.y.z-1.el7.x86_64.rpm**
+ DK libraries developer support (required).
+* **dktools-devdoc-x.y.z-1.el7.x86_64.rpm**
+ API reference generated by doxygen (optional).
+
+Rescue systems
+--------------
+
+* **dktools-rescue-x.y.z-1.el7.x86_64.rpm**
+ Package for DK tools installation on rescue live systems, stripped
+ down to those programs useful on a rescue system.
+
+===============================================
+
+Probably the packages also work on other Enterprise Linux clones.
+
+User installation
+-----------------
+
+* **dktools-x.y.z-1.el7.x86_64.rpm**
+ DK tools and libraries (required).
+* **dktools-doc-x.y.z-1.el7.x86_64.rpm**
+ User documentation for DK tools and libraries (optional).
+* **dktools-debuginfo-x.y.z-1.el7.x86_64.rpm**
+ Debug information (optional).
+
+Developer installation (requires user installation)
+---------------------------------------------------
+
+* **dktools-devel-x.y.z-1.el7.x86_64.rpm**
+ DK libraries developer support (required).
+* **dktools-devdoc-x.y.z-1.el7.x86_64.rpm**
+ API reference generated by doxygen (optional).
+
+Rescue systems
+--------------
+
+* **dktools-rescue-x.y.z-1.el7.x86_64.rpm**
+ Package for DK tools installation on rescue live systems, stripped
+ down to those programs useful on a rescue system.
+
+sl-7.x - Packages for Scientific Linux 7.x (64)
+===============================================
+
+Probably the packages also work on other Enterprise Linux clones.
+
+User installation
+-----------------
+
+* **dktools-x.y.z-1.el7.x86_64.rpm**
+ DK tools and libraries (required).
+* **dktools-doc-x.y.z-1.el7.x86_64.rpm**
+ User documentation for DK tools and libraries (optional).
+* **dktools-debuginfo-x.y.z-1.el7.x86_64.rpm**
+ Debug information (optional).
+
+Developer installation (requires user installation)
+---------------------------------------------------
+
+* **dktools-devel-x.y.z-1.el7.x86_64.rpm**
+ DK libraries developer support (required).
+* **dktools-devdoc-x.y.z-1.el7.x86_64.rpm**
+ API reference generated by doxygen (optional).
+
+Rescue systems
+--------------
+
+* **dktools-rescue-x.y.z-1.el7.x86_64.rpm**
+ Package for DK tools installation on rescue live systems, stripped
+ down to those programs useful on a rescue system.
+
diff --git a/support/dktools/sl7-prepare.sh b/support/dktools/sl7-prepare.sh
new file mode 100755
index 0000000000..f74f79fbaf
--- /dev/null
+++ b/support/dktools/sl7-prepare.sh
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+# Check whether the script runs as root
+if [ "X$LOGNAME" != "Xroot" ]
+then
+ echo 'ERROR: This script must be run as root!'
+ exit 1
+fi
+
+# Install the yum-builddep tool
+yum -y install yum-utils
+
+
+# Installing everything necessary to build a kernel should install
+# all developer tools required for us.
+yum-builddep kernel
+
+# Explicit dependencies to build our project and to create RPM files
+P="zlib-devel bzip2-devel openssl-devel db4-devel db4-cxx mysql-devel"
+P="$P libpng-devel libjpeg-turbo-devel openjpeg-devel libtiff-devel"
+P="$P net-snmp-devel wxGTK-devel"
+P="$P gcc g++ make rpm rpm-build rpm-devel rpmdevtools rpmlint"
+yum -y install $P
+
+echo ''
+echo 'Remember to switch back to an unprivileged user to build the RPM.'
+echo ''
+
diff --git a/support/dktools/splash-dktoolian.eps b/support/dktools/splash-dktoolian.eps
deleted file mode 100644
index c4939e793e..0000000000
--- a/support/dktools/splash-dktoolian.eps
+++ /dev/null
@@ -1,945 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%BoundingBox: 0 0 640 480
-%%LanguageLevel: 2
-{
-gsave
-640 480 scale
-13 dict begin
-/DeviceRGB setcolorspace
-/fa currentfile /ASCII85Decode filter def
-/fb fa /RunLengthDecode filter def
-/sr 640 string def
-/sg 640 string def
-/sb 640 string def
-<<
-/ImageType 1
-/Width 640
-/Height 480
-/ImageMatrix [640 0 0 -480 0 480]
-/BitsPerComponent 8
-/MultipleDataSources true
-/DataSource [
-{ fb sr readstring pop }
-{ fb sg readstring pop }
-{ fb sb readstring pop }
-]
-/Decode [0 1 0 1 0 1]
-/Interpolate true
->>
-image
-fb closefile
-fa flushfile fa closefile
-end
-grestore
-} exec
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJskPbJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUH
-O_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUH
-JnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!K
-JnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUH
-O_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUH
-JnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!K
-JnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KpL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&^&S3E<L!7Y!W`o7JcL`0pG2JTm@!]\pG.=#JcNLb!XhJEpAb1'
-JcL]/pG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG.=#^&SNR*Z,M&%LEFL%MBER(]tg#
-%Kl;&$k=<q&eYQY$P!dd(`rJQ#8e9j$P!dd%`JDQ%Ob>/_#"*-q#CP*kPs^:JcLc1pG2JT
-m@!]\pG.=#^&SNN)&!Ji$O6nC$P![G'*B*i$Nfo"$k!pd%LrdM#n%4V',gTG#87a\#n%4V
-$cN)N$R%uVU!_H=q#COo_:HFcJcLc1pG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG.=#
-^&S.tn,EOebGB(tp](;3pAY-hq#CEXqu6Y6`W,uHqYpQlq>^LDrVlop*eFBP!;A8CB'l#\
-B(n'4!58F5HgfMgdAi(/)>F13>kZ_KdJ3bB_>Dd`>fHaD$2W3QdJ<hC+oTsmd2@N9NWAf/
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcNLb"$(7`qYU9pqWI&<p\t8j3Vi^X3JjTq
-qu6`5P]$<t!>>8.rr_GlM(&0"!<it[!!<IQM89)i!;cNl!,h`7!+:BYNWAf/pL`f\pLa.T
-JcNLb"#!o+dJMJsdD<ZHpXTA&0DYYN062rdqpkhBHX-CI!=mNVecWaTEZt5Y!<`eW!!<C;
-EhWH_!7CWC!*oHQ!)S7INWAf/pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcNC_!,h`7
-!,h`8"9fiHK'3%2!r?d8q#CCdr;Qf5!Vl]r"1A..!J1XQ!!='bkI&P7!"Su-!;cNl!+>a)
-!*+UNNWAf/pL`f\pLa.TJcNC_!*oHQ!*oI&"9]T3D8H,#!RY0I!!#1[ec;E=!!*.frmh*e
-#P\9$'5,.Jbl@_OrRLtrq>^Llr71j;JcLf2pG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\
-pG.=#])Vgtr;Qb7q#CHt6Hf9+!.t"H!#YY6!0m9Z"Takfs8#=^!!PBZqZ$S[bl@bFqYpKp
-qYC0m''K8o!Tsc@!0.'R1A>DJRJ1=f14fM<!!"tUec8tN!!30[Wr(?ID>=/3'E$D]Hh[RD
-He-cq4no!\08e0.epGU@!7Ces!7CWC!=lsFecESlJcLf2pG2JTm@!]\pG.=#JcLB&JcN=]
-pG2JTm@!]\pG.=#])Vgtr;Qb7pAb4!Pl(I\8brDe')_b0Pkb:^M?!VP6MCH[V>^DoDTi(\
-kPkJ]qY:*o+f3AH(kMaI!;A8CB'l#\B(n'4!4r422uM5,>k\4!"ag-t!'U/Y!"SqX!.4MA
-"EN)Ed5Ue"!/ga+!*m_J!5\Zc!7CTB"<35uHP:u2N<&].pL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcNC_!'0uW!,hK1!<KV+rrM9dqZ$U/r;QbRq>^Y9s8V7Bp&G)WrVlk*bQ%Y+
-rr2upJcLB&!<<,o1A>DJRJ1=f14fM<!!"\Mec8tJ!!&A`ecESiqZ$U+r71jgq>^Y'f%.Yj
-p&G)>rRLsFbQ%XZrmh(sJcLB&!<<,o1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fM<
-!!#%Wrr?s0!!*`/r;QasqZ$U/r;QbRqZ$b:s8V71o`+uKrVljtbQ%Y+rr2upJcLB&!<<,o
-1A>DJRJ1=f14fM<!!"\Mec8tJ!!*SWr71j;qZ$U+r71jgqZ$b(f%.Y\o`+u4rRLs<bQ%XZ
-rmh(sJcLB&!<<,o1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fM<!!#%Wrr?s/!!&8]
-rrAnm!!!Z0rr@oR!!IZKs5tHq!!%WLrr>X7!!)3]rrDnI!.k1O!!)aKpL`f\pLa.TJcNC_
-!&+9$!*o-r!.4Xp!/gXR!"SqX!-7u;"D?<:_&;kF!,_\c!'SO+!5\Zc!7?AuJcGfO!;A8C
-B'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!4r423W/mWDY*o/3W/mXk5kJ\!##50!/^[T
-"Ta5Ts2u8N!!%WLrr>Xa!!rZSDPabV[?P&9o`,:!-uPlh^pTD7)#""1kPkJ]qY'sl(gs0F
-pAbF!6@u&LP\qoD!"8ohJo1Pg"')25V/A;F!4Mt&1A>DJRJ1=f14fM<!!"\Mec8tI!!"\M
-ec<P`!!!N,ec9ah!!I/ieuBDT!!$m7ec7l+!!j`QMO1$'HVbCJ!!j`QMO1$'HVbCM!!'k7
-ec=+l!!<m2M?W\R"ugCVTmL#fpAbU&05Xqo!!5WITo*).JcN7[pG2JTm@!]\pG.=#JcLB&
-JcN=]pG2JTm@!]\pG.=#])Vgkr;Qb7oDemuqY^?n*rH!<')_b8M#[MVM?!Uk%e9T"K)P]P
-<?WbN3VrdW6GWEs!rA,op](=]_"n!3qNMWg!!)3]rrDon!!Ep$DPbPUrr<H&!!340bPM5>
-PRdZm$NVD;@&<&ds.o]4_#+-4V%/(W\H)@ZpL`f\pLa.TJcNC_!&+9$!*o-r!=.$Mec6Tc
-!!!N,ec9ai!!I>netEKB!!$m7ec\G]+YPMG!!,$Pq:5VpHOffN!B6_JecO6G%f$))_>`!c
-dJNtI%Q@XMWrCQL$2FQ&!DofmecC+*r;[0D2c,CJf%,]Y';><S!K%8:!4`+(1A>DJRJ1=f
-14fLX!.k3&!4`+(1A>DJRJ1=f14fM<!!#%Wrr?s.!!(4?rr>(W!!!Z0rs+A\!L3Wa[0cF)
-!X3rIq>UH1r;Zj!K)YcQqKkOhM>dGTk:$3-!<IfOrri1F690o$rrM:2q>^NYrr2upqu?_n
-qYpO'q>^OE_"[j3^]=E8$i9l)V)d`7rrAmI!4`+(1A>DJRJ1=f14fM<!!"\Mec8tH!!'%s
-ec7B$!!!N,ed$3q!.3;JQO!*^!X*/`q:5P>qu?_6rmh5"B/_JarRM"c+o20=D>r)hd:YBk
-ErFPi_'/XT!5\Zc!7C]E!/gX(!"&K%!?n02ec;EC!!!?%ecL^^_>2X^MLki=!;A8CB'l#\
-B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!4r423W/mWDY!i._#4348c/Pg')_b2M#rq@rrJ>b
-oDen%bP2#:V>UAoDZ0S83W/pX@/^*+b7=FM!,hc8!'0uX!+>d*!QtuM!!)3]rrDon!!5K)
-V>U>n$i0i-M>uaq?uDh<rru$p!!R7ebPhGEkPG%j^utUp!%<F!\cDI[pL`f\pLa.TJcNC_
-!&+9$!*o*q!29>A!'U5[!"SqX!ce<grmh'ro)Je!WqY'EMZ!MT>lE4R0DtkN;#SrGWXJ_)
-!*oKR!&+9N!)WXF!NHP)!!'k7ec=+q!!5)aMYu$*$2OW+En8'I:gAnTecn8;!!HP>Wr:KP
-_9pZ(Tu$WW!$Qpo\cDI[pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcNC_!'0uW!,hB.
-!4Db)!(m(g!##50!L/iHrr?s/!!<^K@(#t5!.t2A!%@gH!?q==rrBk4!!*,DrVlkLr;ZjA
-qYpKp_#+05!R(HA!.t(J!9a@]!;cNl!<N&qrr<H'!!8#W8c8Vh6N$i`V>L;n@/U$.[28lD
-"+0tG!+:BY\cDI[pL`f\pLa.TJcNC_!&+9$!*o*q!13W7!'U5[!"SqX!IK1kec8tI!!<U6
-:m_.3!,_]u!$V=A!?9Gcec;E@!!'%tec9Rc!!+%drmh(CqZ$VrrRLscqZ$W4rmh(sq#CEB
-rRLrTq>^S;eiis3!&si,!/g[S!)WUE"d]l&!!6g2ec8Nu!4i1)1A>DJRJ1=f14fLX!.k3&
-!4`+(1A>DJRJ1=f14fM<!!#%Wrr?s.!!'G)rr=JF!!!Z0rrD6Yrr>X]!!&8^rr>Xe!!&8^
-rr?s6!!%lSrrM9frVuq_rVlk8qZ$VQrVlo]#Q+Q%kPkJ]qY:*kkPbD\$i0i)@))jA!!&ko
-rrBk4!!#UhrrM9hqu?`4rVlk8JcN@^pG2JTm@!]\pG.=#])Vgar71jQo)JcWr71ikqu?^,
-r71kaqUPX0nc/Z:rRLs3q>^MBrRLsRqZ$V:rRM"c"o\K%Hi;Lq>l+L$ErFPi_$0`:!5\Zc
-!7CTB!5\Wb!"&K%!`5Qkqu?_SrRLtBqu?^[rRM"c#Q+Q%U&EOB>_2se!;A8CB'l#\B(n'4
-!.k3&!.k3]!;A8CB'l#\B(n'4!4r423W/mWDY!i._#434)#O@6')_b1P^E<-!W"59!!&8^
-rr>Xf!!*,`rVljXqZ$UVr;Qm[!!!&_rVljXqZ$UVr;QaWqu?`[rr2upq#CE<rVlj*nc/Yi
-rVll5qu?^WrVll*qZ$V6rVlkSJcN@^pG2JTm@!]\pG.=#])Vgar71jQo)Jcar71i]qu?^,
-r71mqBD^6\d38)]!.4[q!'U/Y!5\Wb!&+3L!&+9$!&+<O!5\Wb!&+3L!&+9$!&+6M!5\Zc
-!7CTB!36"K!"&2r!(Qq<!29;j!&+<%!13Q_!*oKR!-3Yk\cDI[pL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcNC_!'0uW!,hB.!6b?@!TsR_!!!Z0rrS#WDYsG7k8<gk!0mH^!(m%f
-!%@dF!$V4>!"Sr,")\)=./a)F+o;6>%fH>,DYsJ7kPkJ]qY:*kbPhG@$h=8t./j/G_#+04
-3W8sXV>C5m8cAYhV1J]Y!;A8CB'l#\B(n'4!4r420DsB$>k7pqWr:KL_#jN7!"SqX!ce9G
-qpkea'D)8)Hi;Lq4o53Z+oKmk)uBU8$iJQX>Q=aIr71ieqZ$U(r71jQqu?`5rmh(sq#CDp
-rRLrTnc/Y5rRLtBqu?^MrRLt+qZ$UZrRLt+JcN@^pG2JTm@!]\pG.=#JcLB&JcN=]pG2JT
-m@!]\pG.=#])Vgkr;Qb7oDemqqYgEoV>C5m')_b3M#[R@qu6]?$2"8uPl:U^8c&Jf8c8Sg
-%f65+!W;s"M#[NIr;Qa,qZ$Tsr;QbRqu?`[rr2upq#CE<rVlj*p&G4%6>iX_rVll*qu?^W
-rVlkoqZ$UVrVlkoJcN@^pG2JTm@!]\pG.=#])Vgar71jQoDempdJ_VrMYdAR%fFl[EW?)d
-qpkeJ#PA&sHi;Lq4o53Z4oEk2$i0l$ecTpm!'U82!"8W'r71jgqu?`5rmh(sq#CDprRLrT
-p&G4#2dD6VrRLt8qu?^MrRLt+qZ$ULrRLt+JcN@^pG2JTm@!]\pG.=#JcLB&JcN=]pG2JT
-m@!]\pG.=#])Vgkr;Qb7oDekOr;Qb)qZ$U/r;QnV!!!,/qu6])!qlToPl:U^8c&Jf@/U$)
-$i0i'kPbD_PQ1\kr;Qa)q>^NYrVlk^qu?`[rr2upq#CE<rVlj*q#CL)DRK??rrD6\rrBJ)
-!!#%XrrAnm!!#%XrrAmI!4i1)1A>DJRJ1=f14fM<!!"\Mec8tI!!"\Mec8PD!!!N,ec^!n
-!!8MaecD*<p&G)>rRLs3qZ$Umr71iSq>^N3rRM't!!#jnec6$Q!!'k6ec:'p!!'k7ec=+n
-!!'%tec6$P!!<O4QdPf`!5\Wb!13T`!&+<%!/gXR!&+<%!/c@.\cDI[pL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcNC_!'0uW!,hE/!,hc8!Tsdd!!!Z0rr@oT!!*SQqu6YQp&G)W
-rVljhqZ$V(r;Qa<q>^NYrVltV!!$F)rr=,:!!)3\rr@oR!!)3]rrDok!!(4@rr<H(!!31/
-kPkJ`^gIurrVlkoqu?^WrVlkoqZ$UVrVlkoJcN@^pG2JTm@!]\pG.=#])Vgar71jQoDekr
-rRM"c#Q"K$%fFlXErH%>$`a*T!-7c5!.4[q!'U2Z!)WUE!#bV5!5\Wb"*+AA;#JlE)>X=5
-_>VpbEr5n;_>`!cdJ3bBWr:KK$2OW&:r3.^"//O)'E-J^MYmGS0E'H%MYdAR0E'H%MLki>
-!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!4r423W/mWDY3u1"m>ja!,hW5!##50
-!/^XS!?pY'rr?I$!!&8^rr>Xf!!$$srr>(U!!)3\rr[-=!*/ss!'0lU!9a=\!,h]7!9a@]
-!;cKk!6b?@!"8Z(!,hc8"B>I&!#Y\7!2]Sn!'1#X!2]Pm!'1#X!2Y8I\cDI[pL`f\pLa.T
-JcNC_!&+9$!*o0s!<g7;ec8tO!!!N,ec9ah!!+%TqpkaDpAb2?rRLs3qZ$Ucr71j$q>^N3
-rRM'U!!#Ldec7B"!!'k6ec8tQ!!'k7ec=+n!!'%tec6$R!!$:&ec82=!!!]2ec:U*!!"\N
-ec:U)!!"\Nec:SZ!4i1)1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fM<!!#%Wrr?s0
-!!$F*rrL:Jq>^L.r;QbRqu?aXqY^?oqEjrW!0mH^!(m%f!'0uW!(-M^!;cZo"%`Im3W/mW
-6M^Z^qYgEo8c/PgkPkJ]qY:*kbPhG@$iBu*$i9l&!2]Vo!#Y\7!4D_)!'1#X!2]Pm!'1#X
-!2Y8I\cDI[pL`f\pLa.TJcNC_!&+9$!*o0s!)WXF!NH>"!!!N,ec9ag!!+b#r71nr2u!@Q
-Hi;Lq4o53Z0DsB$2u3LSdJ_Vu4TGI8r71j,q>^NCrRLs3qu?`5rmh(sq#CDprRLrTqu?a(
-dJh\sMZ!MT'E-J^Qi$g`0E'H%MYdAR0E'H%MLki>!;A8CB'l#\B(n'4!.k3&!.k3]!;A8C
-B'l#\B(n'4!4r423W/mWDY=&2./NrC!TtO"!!!Z0rr@oQ!!$F(rrM:2q#CDZrVljhqZ$X#
-qYgEoDYjD6"oSB'%KHJ4qYgEoDYjD6"oSB#%f?;,kPkJ]qY:*kbPhG@$iBu)3W8sXHi3pE
-)#aI7[JU")3W8sXV>C5m3W8sXV1J]Y!;A8CB'l#\B(n'4!4r420DsB$>kS-u+jp;?!PoZL
-!!!N,ec9af!!#jmecET1q#CDArRLs3qZ$X"dJ_Vr>l+L$"T6gR$NL/0dJ_Vr>l+L$"T6gN
-$iBu)_>`!cdJ3bBWr:KK$2ac'0E'H%BDhf1'E-J^Qi$g`0E'H%MYdAR0E'H%MLki>!;A8C
-B'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!4r423W/mWDYF,33TpDA!TuK<!!!l6rrA;[
-!!%lQrrM9qq>^M[rVljtq>^MlrVll@qZ$UVrVlkor;ZhorVll@qZ$UVrVlkoqZ$WZrr2up
-q#CE<rVlj*qu?_)rVlk^r;ZgarVll5qu?^WrVlkoqZ$UVrVlkoJcN@^pG2JTm@!]\pG.=#
-])Vgar71jQpAb4I_>`!d_(YQ`!#,:]!.4PB!-7tf!Po9B!!%BEec829!!%oTec;`I!!"\N
-ec:U+!!%oTec;`I!!"\Nec:U)!!'k7ec=+n!!'%tec6$S!!#joec:'q!!"tVec;EA!!"\N
-ec:U)!!"\Nec:SZ!4i1)1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fM<!!#@`rr?s4
-!!43uqYpKqb9$BX!$;(<!0m<[!<]b,rrKnFqZ$V6rVm"s!WW3*rVupYr;Qa<qu?_RrVljX
-r;ZgXr;Qa<qu?_RrVljXqZ$WZrVlj(q>^N=rVlj=qu?^grVm&a+TN-mqYgEobPV>?6N-oa
-[JKq(3W8sX[=SCi!;A8CB'l#\B(n'4!4r422uM5,>kn@$)04.(ecDcgpAb12r71jpq>^Nt
-Qi#>7TaU_t!*oKR"H!3[!!W?%!&+9$!#b\7!-8%h!&+9N!&+9$!#b\7!-8%h!&+3L!5\Wb
-!!i?#!36"K!#b\7!'U;3"i2,X%U@E[ec;`J!!"tVec;'6!!"\Nec;%g!4i1)1A>DJRJ1=f
-14fLX!.k3&!4`+(1A>DJRJ1=f14fM<!!$F)rs4iL*Z-:c8V4bVrrW%R#PJ,t8c8Shb5qG>
-!=m<MrrL:aqu?^sr;QlBV80nF!!&8^rrKM4rVus9kPkJ]DYjD6Pl:U_[0Q[2!>t#!rr?s6
-!!*E&rVljGqZ$WukPbD\3W&jW./a)JqWInY_#=96k5kM]!*0!t!5SI3!'1#X!6]ro\cDI[
-pL`f\pLa.TJcNC_!)WUE#^\3B'-T"lD5$pZ!mu#lp&G(Ur71kJq#CF'Wr(?JWYt^7!(Qn;
-"0.6PU&=rkHi;LrQNd?g!>E<Kec8tP!!%BEecD*@rVus4_>`!c>l+L%#LWM$!$V4>!<L%8
-ec7B$!!"2?ecaC:f%-Pnec<Pa!!#Leec;E@!!"\Nec;_%!4i1)1A>DJRJ1=f14fLX!.k3&
-!4`+(1A>DJRJ1=f14fM=!!,FLnc&[ePSj,p"$)UBqYU9obERVU!!+/(qu6`oV)eMT!=n;i
-rrMsVr;Zj'V>^Dsb@!nnkPkJ^HNF!D!=,J"rrgMQ8V6.)rrIHIr;ZmjDRKEB#Jb4K!!#?'
-V>U>p^i!0O!!*,9qu6`oDE7Xp"f6)C?uG0*rrSF&./j2H3W/mYP\qn$!5/C,1A>DJRJ1=f
-14fM=!!,$pn^[chHP?,R"##"YdJMJrWdAU[!!*tRqpkhrMD+r/!=Qa@ecF/Or;Zj%MZ)*/
-W_biq_>`!cBDMT/"cE90"KG9]D8H5&!,)30!^0eTr72+H>Wi&e2dD7<ecMOM7f<;eU&3CB
-d9J@&ecgq9#>e[Ar71pr>Ts(H!&+9$!de/qJcNIapG2JTm@!]\pG.=#JcLB&JcN=]pG2JT
-m@!]\pG.=#]`8%!oD\sVbEPR)o`+u0pAY-hq>^OVqYL3lDZ'P9<VlXn!*/mr!Wc]lq>UK2
-3VWRU!FY*drrKnqqZ$W3q#:H>!!&kjrrD6\!!+M2rVlu_3<2DBrr<o1rr?s9!!#%Urr?GY
-!5/C,1A>DJRJ1=f14fM>!!"tLec`ghHT_W,!!$9tec=+o!!+b#qUPXOr;ZjfdJVPq7f!)c
-:r2tY!MM1@!!,p4q:5S?0Db_LU%m1@WW3$VpsoG]r;ZjA_>Vpe_(PdIqUPW[pXT=LrVupO
-qUPXCJcNIapG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG.=#]`8NK*Z,M"#6P,9%MBU"
-(^'7-$k=<q&dnpG"UPYO(`rJQ#T+Bg#6P8F(_6HD"W2-AV3F"8!!ifrH^(A'P[GR)!!ifr
-H^(A'P[GR.!#HIh&e5-J#7_@`(]XOK(_R;`!XB)G(`</N)[To:V1K<[!!ODV#m1JH*WmH#
-&dnjF#n@dh%fQG6#8e'[!soSW$\AAl!;A8CB'l#\B(n'4!5/@B#8n0b$O$S7#7D"T)&!)@
-!"95Q'+P<P!<`W8%MK`U!!j5O$O$S:%MK6J!!O$@H]!/'p](R'2eRJpML//;oDf.#2eRJp
-ML//;q#D3E'+PBR!<ii@',(?G%MK<["T\c5%MKNR!#l/>H\uYM!!!->%L3%?%N,<c'+P<O
-!XB)H'+=d>#R(kO#6G,?'+'6j]`@d^pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T`W-#f$\A?[!(&]N!!*<Q`W-#A.&-bC
-![rX#l2^Q6pL`f\pLa.T`W-#_$%`-Y!&lR9!!*6H`W-#@+eo#<!?m$pl2^Q6pL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.Tl2UlP?srk3"CPV;3=#!Q"V,F7bPsTq!!30L!Rq)Z-uPls
-bKI;iDE.k#!$5PI<<,&S!!+KUr`'&.<@D8Q<<6JUqu?at@/a.,?mt^K"t9Lh!!"ETr)Ec*
-./*]B&e`@f"@@^JqS:2Q"=SVnkNA]B"<hZZkPtG[!Wa\MJcP?ApG2JTm@!]\pG2"6!]NqP
-qaL]b:e!)Amf3M!>^NL%0D#5E+k$E$+^BnuWiDDC>V?3[!#\W47K>+:!!+6>r^Hud7NkV+
-7KH=/qu?ae;#Wob:a,N4"sMQ&!!"0=r'g]`+nks;%M$Y^"?11ad@nY^"<hE8_82uK"<1U'
-_:JJ`!$QponGr;=pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.Tl2V>dK'316kKCZKbNJa%
-qR&Z[!!O!QPlLbDo`,&Xs/"<I('.FYqPA(08QBZ9qZ$CY!$Q6Vs8V7*q#C^LDRKN-M-q`L
-V>gJrV/@^Z!!ZhfkPqr-./!WGPkkji!%;`]rr3%rDCG8[""=$B.*MYo8T*_k^rZQZ3GuY4
-kGA4^-uQHms82iuPlIS3!:g-a1A>DJRJ1=f1?niM4`/$df"nA[Q`@mLf$TgCnGi_&>^P&Q
-0D,;HHe+)*!#7u'd>D0u4[r\CdFQ](!#o1#f%.YVq#C^E>aO$XE_moaMZ20.MHh>&!!Z8?
-_:FrX+nbm@HdN3$!$PU)rmh..>TrkB"!Q(>+j9oh4^>hSTud9;03k4%_5728+^CAbf),LL
-He+(+!:g-a1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f1?\]?DZB`'qu?p/8YuIeV%3"q
-!sel+3V<@RbQ$bX!!F.Hs-+As!!=CPruq=@"R#gbb7"(F!Y56Wr;Zp#qZ#aQ!!7NI$hXK$
-)#BKo!!<#skOefW<WE)!aoDL"s1lYT!`f9`U]:H_s8Vus!mCW,ZiC.4<=-PCpG2JTm@!]\
-pG1q4"'jF.2uEX[#sF0seqsk*!!<DUeh?[r!ijhffDl$fQe$Ksq>^U:Qe!,S!!L-heuB&O
-!!3PZBD_`2dFQ/.!!6fa$2"9"'@D1(!!:R!_=[d17b6-[aoDK`etL+a!_1bWU]:HTf%0a!
-!ijhfZiC.27L-g2pG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG1q4"%iOm6MUTa8c&J&
-#Oqcqs8P+P!!50F3S=B7(sDqspAb7-q>pNp"j?*/s.obl!!32t@/L!+kPr?l!!-L(oDer>
-ruq7>!mCVeo`,'tH[?"?!!7cP^rHEV8cRtL!!51\s82iu3KuP3!!>RNrtrWRpG2JTm@!]\
-pG1q4"$P5d2u*FV4jhiS"n;Qof%)MI!!4g#0A-=-'<9VgpAb4(dJNtIWkm9;MY@)Od89`@
-!l<H]pAb4jdI[D?B@\%!!!91OWq?>o"D;?NaoDK[etL+a!^5,NU]:HLf%0a!!\\mR[/^:f
-_:B:;!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n(E!!>Rfs$HJ\"(;0/K(/gBs8P+&
-!!E><s.obi!!)3[!!U/U_#OFPp](?X<VugubQ#BP!!-*_o`,$ukI(-d!mCVZ\c;e`s1lYT
-!_NFTU]:HVs8T2$")e/="2b-51A>DJRJ1=f1?\]?2qHP=p](Cmf%+^.!!:a&0?O7rU"5+o
-!!'k5!!T'$U"7e"p](?27f35fWn*m<!!,R*o`,$s_3auu!ijhF\c;eKetL+a!^5,NU]:HL
-f%-r'"'jF.!lG$41A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f1?\]?6N@'Pp](EubQ%DO
-nc/aks#J7&"(;0/..mQ?3W&j]^hseJs8P[d!!27_qu?fAs1n@/!EJ=U!!6R.6M^Z`bQ#Ah
-!!7cP^rHEV8cRtL!!51\s/c8&@/oE,!;A8CB'l#\B(n(E!!>12ei3@("9GORd15^I!nPpU
-b5_W@f%)#;!!"\M!!]-%%`-`I4o#'Y_++>&!ijhFpAb4`_=[d0:t@T%!!91OTt14*D:YE$
-!!5=7_5%&40@n^V!!6!J_863H1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f1?\]?6N@'P
-pAb;Is8QL)!!Ep+DF,!6!!rW)3<0(??r\BH!!+67qZ$d$3FH5]#Q"K,"[X@4#?>Y5)"dk1
-bQ#cR!!g;W!'0oUqC)1?!U!J\!!:@D_"Rg0<Tj&U!s-Tg!VuctbQ#BM!!3Bs)#XF?!@Tr.
-!CC[(./EoF"%"F5!!*p:rW!$*-rh\n!!<<`3=5K]$%i2m!!!X'DE/%"!!NEa?sl;+q>^[?
-8T%p&#Q"K)!BFOq-j'2E#7!h<<>%n'kO\`Y+\;Y63FF96!!ENnDH.kV!!OcNDH/(cq>^X.
-6>fd?r;Zm$67D^2!>ni5!!Ep+DF,!/!!51\s8)d/+\;Y6*[i0Q+XeB3!"p\'+Xe3*!!FHF
-?o\Pc!#?VIDI>d9!!"&g+W_dT(]XOW-m9`^)#aL=*_C6W63mGh!`f9`q#CO&6>fdHqZ$m(
-67;gA<GkeArW!'/<Gk,,joG-2pL`f\pLa.TkPt]Df%)eS!!@)hekl8E":dS"2\,`c#hIQ[
-!!"ZK7N;1(!?43!!!NBV:f'(SqZ$m)2]D`#7U/(io`,&neuJ-<#GGB&0@A@u+o20>_++>&
-!ijhFpAb4`_=[d/WiGjp!ijhFoDepr4VR_n#9b`#!&n.P+o20?!]M;"!!*a&rW!$(+\!XQ
-!!<9U0*h:Q$#S7e!!!Kl>V??Y!!NBV:f'(Sq>^[:4^:fB"o83%02PIg!Vl^#"[-*[%R&CZ
-oDf(74TGI8:a,c;"9g_h7N;1("<g6>7NqR-":I.n7MG_#!Wk;(qZ$X17f!)f%R"&U%eTf'
-0@n_O!"p56!!!l[)]9S<)#sXH+WD@D'Dqh5)b*XW#P8!3)*M5$2['0])'Kq:)^,jp!#Zq!
-)^,mo!!O6'>Ym?_r;Zmgf"q.^"9g_h7N;4)#Qcq.!!u,"7Krbk":7P&2[&7CpG2JTm@!]\
-pG.=#JcLB&JcN=]pG2JTm@!]\pG1q4"%*%f6MCH^8cSgTrW!36Pfno8bPH)XrW!*$s#DLC
-rVm.f$NL/uPfs*Br;Zm"@-@Lg$d0[n!!dkIkPnO1kPkJ^qJQ$-"!7LBPjSMW^hs,P<WE*B
-%f65,k>hE[!mCVZpAb4okOnlW6N:Hh!!:@D_"Rg=%XYVHs$?\c@&<&dPRb,"rs>M.!!!(<
-V<@kdrW!']Ped=^rW!):s8V7!r;ZqHqP>8/!!RuS^]JEMrr3#^6N$lc!FY*hrrL:dr;[*5
-V9=I;V>pB5r;['obGB*Qs1g&\!!*=BroXFaqTJp%pAbn!Pfs*B!gN`bV#UJsDTe8k_#KW/
-rW!0O^qb;K_#MUU!"Bd%qYL6lqLScdV<@kdrW!']Ped=^qu@!4Pfno8bPH)XpAb7Ts8W&u
-'hOY5s1eU7<P\Y7kG;/Y!(*OYs3"FA!!ap[^jD=/k=PCJ5RsX6JpX?oqAoWSkPtSYV+CXe
-<P\Y7^d8#2V9=I;V>pB5!!!Xrs6"9HM*_1B!cH2GHbfZG%KHQJV<@kd3TpDA"Qq053TpDA
-!QuYL!;A8CB'l#\B(n(E!!>12ei3='"$P5dHi=!N$[\moD5tug!WE'%f%)JtU&EOJHO0ZP
-4aX3[U&4lk:r3+]$`Y-G!!R"m_:D(!_>`!dd9QDG!u]\@HgUk>Tj.Qt7b6.j$i9o)_++>&
-!ijhFpAb4`_=dj12qCh$!!91OU%\Ns$YPgBei*R/:l<*?HOH2=ed73=!!!%)MS[k?rW!'S
-H_K$,rW!(pf%.YNr;Zq4d>Ah;!!R5jT`JEGrmh+d2uEXV:r3+]!NI+;!!isiWblC+f$PB6
-!!bZeMHl%iTcs=6!<la-_$&?:Wn,#\!#.SCWn*jEHe-c*!!!%)WdABPep@f(!!a[@TkA59
-euJWJ%23d0dFQmrD#mn!_:DH^!!Fs%U"7'X!!isZWcDsVd9H_H!!4h)f)>Xa4aX3[T`>'^
-U"7f2MFIRG2i?#6W^csf#9fG-B7%J24neqA$]:s$B8Y9f)$!pXf%/6+4TGIOU"7eg2ZO5C
-WblC+f$P?8!"OA,_-CVn2ZNgY>cN-`U"4Pu!!->^_:DF9_>`!g_'&e3_>`!dWZ1+$pG2JT
-m@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG1q4"%*%f6MCHj3WK,U!!"G1^^0u@%a4lirW!Q1
-s)."V<GoVPs0Vh,6=B!V_#46MM<?8g&n'o&V#UK#@"SFYM9Bcs<QkFB6MLN_8cSg;mJm:'
-DZ0V=M?!U`!rN$!k>hE[!mCVZpAb4okOnlW[H@ej!!:@D_"RgK%UbP$s$?\c8T+D)V8.pS
-6Da_^HN4$I@"SFY@/^-/3FL&1kPYAe.-LWR!rr<]qI'$t$\JDoPe_0:M>I8P3W9!aM<?8g
-&n'o&V>UAq[H@kq!!51W)#aL:M>BgC!!?X/k6q7h$9@:G&c_n[V>pSYpAc't@-@R*K)4[1
-PQ2$*k90g*!i>pn!!!YpV>UApDWgru%TW@^*W[F2qNM%hK)bjYrW!']@*AT5r;[-PkJ.B(
-!"R3PDYF,43WK-Y!!GVrkPr?s!!<Dfs1nL3!mA@[rW!7)qLS_J!%@^D./3cD[H@kq!!kU]
-(]XOWqZ!Dh!!h\p!<<,-k6_+f#W__u!(,l3s8)`X,!l89^ulj@!!9"sV#UR)K)bkIbAK=J
-qZ"`=kAE:fqZ">3kQ(?4pL`f\pLa.TkPt]Df%)eS!"Ua6eqsG-+i0iW!!!D,em/1S&_>N<
-_/`"MU"7e]!!"rS_:G=Y!#Tam+TW'L_:FJD!!Q29f%+lA>VARHf%)eT!!>C8en=CN!MNct
-!!I>nes?F8!!0o*qu?euetMg<!Cjp!!!8M'"o/-"Wn*m<!#uACHe-b,!!#/edFO2KE]5q7
-f%+I6!!,o5f%*[s!!FrOWn,#b!!sgbeuAcO!&)_rpAbS<etIGa>Xib]f%)MR!!mV]+TW'L
-_:FMB!!8M'#Q=])0@:I4!!72g4oPE`:tEGhrW!9Y_28^&!$R6Nf"q(\))kC.etHs._:Er5
-#GJsQ!!!%WeqsG-%`+&$!!-?@r;[<sd;g*))e[QF!DmXaekl>G"><TOf"q:b#pI-Y#64`3
-Wn(GL!!4h)f)>XP2c.?AU&G#o"MrZ_qZ$YsU&=rm7aZ)P!!=Clefjeg!gg_.rW!3Wd1ZK[
-):@#mqZ$Z5Qi6sdQb`q+!!k7*'*'u-_:I$5_'(`;#GJsQ!!!%WeqsG.:i4e7MQ0o7:smjo
-7_r=_:smjfk5b63pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TkPt]Os8PF[!!k"Qs.o]%
-bPrX^!"!'5q?m9's8V7*rW!')V>pQ^rW!"as1nR5!L.L#!!?7$q?R!""9ni*b7adS!t4;l
-V>(#m@/p7EmJm:'DZ0V="2Os:K)>TLk>hE[!mCVZpAb4okP"rX+ocoa!!:@D_"@[0)#sV&
-r;Zr8s8"bT!!<80s6'=\!s/8u@/L!+DZAnt!!cO(s)%fEkCWC-"G6[RHNO0H"$-5X_#=<7
-P]$F"#Z^p$#64`@s/#Vn#/CTH!+>hkr;[-+kPol/!%@]Z!W2p!DZAnm!"5%kqP=DuM0f6!
-s'Yd*#9j-I63($c@/U'+$-W;J!_NEKqu?tYHN4$HqYst$!!7'<kPbG`$-W>ir;Zq-s8!,u
-!!51\s82iuPlJPt!!@-=q@``,!XnibrW!$KqW@tZ!!9"s_"ds3)#pH1!!0kCrW!%bs5sL_
-!!aqP-ia5as/#Vn!Pf*B!!7'<bPV>AV>js%!"'nLs$?\c!W)iZ)#aL<@/p8i)#aL;@/p6M
-kQ(?4pL`f\pLa.TkPt]Df%)eS!!jb!eqsG4Wn&'d!!uKQd0TdQf%.YVrW!'(MUp?;rW!"H
-etN$B!IJ)M!!>^Ad09LL"9d<,WXf".!sufpMYI/R:tF3&mJm9]>lF^+!hn2rD>XA7_++>&
-!ijhFpAb4`_=mp2)qJZs!!91OU%JBf'@t_nr;Zqnf$Q/L!!8M<_>F97dFM.l!!6EV_>F9<
-7b6-q!"$JYp&G54f%+I7rW!$RdFP#j!!.FOr;[*mf$OX$!#*q@qu?qp#ljs%epI>q#Qhin
-B)hoTd@pF;!aO<mo`,AHf$T?Y!HMfQMUkW&!!aIoei*Ruekl;F!=,Y(!!5=7Er5n<EbG@O
-!n#Rqqu?e'f"q=c!sbjW)>sO;:tF##p](@Kf%0a!!diLlr;Zq)f$P!+!!3JS0E(qR+jn+-
-r;ZnVetMm>!Ya.Bqu?bk$2so,He-"7r;['Gefb"n'@r'=!!/c"rW!")euJWJ!fGQ*r;Zp=
-f%)eZ!!CX"_%ZeJ"Am\#_%ZeJ"&RS")s@:r1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f
-1?\]?6N@'PpAbFYs8RoU@/nFJ!!jbJs#C&Zs8Q*s!!=)7s,$^T!djs_r;Zj.#Q4W)$31#H
-r;Zo^s'Ya)!f?s#p](D(s8R]=!!0lQr;Zs5kPtQ^r;Zl]<VugubQ#BP!!-*_pAb8Zq@`Q'
-!mCVZo`,'ps8PFa!!9"sV>L;q8cSesr;Zo^s'Ya)!au&kqZ$hss8"..V#g8i"+pQr!W2p&
-PlLai!!!K6r;[-1s8O,?!'1)B')_e7-isALkPnQ[!!fA#^]4AMs%3(f!_NFTo`,AHs8!?.
-!!*-Bs8N`0!!h]eD?,%`[0-@-"t0HO"m>muqu?at8cA\kkPnrf!!6R.kPbG_@/nFJ!!=DE
-s#KiS!]g;\qu?eFs1nR5!tP2-DZ'P9<P\P5!gN_Lqu?h,s7uio!!>7]k7[^n!@S$K!!=YL
-s%3.h!L0G[!!>7]k7[^n!@S$K!!7'<bP_DC*rl6Qqu?f]s).f9!pBT$r;Zp)s8R!8!!<K+
-s%2DSpG2JTm@!]\pG1q4"#nf^2tm:W0@n]p!)V7Hqu@!Af%)JS!7o^jqu?g4dFN@;!!6fa
-U&=rl$O-J/!sdE.)>sO:_:DH\!!72lWqZPr:tF37mJm9]>l=X*%`-`I7f<;f_++>&!ijhF
-pAb4`_=mp2HdN>u!!91OU%A<df%)eY!!8&/MYmGV4kA0hr;Zo8ekl8E!`7IaqZ$eWf$PXf
-MY-rND:Y`a!!dl%ecu0T$O-J/#m]&4)#sXif"hjp!!XSI!!'jd7f35kMUnI$!27t,qZ$[\
-f"q"Z")$34%fQG2!?'J>%f?;3_:DikB@`CNr;[$F!!!/<edhTX!Cf6O!!:!f;#C:p:tEJ^
-!!6!JWr)i!)qNRnp](@Kf%0a!!b^)Xr;Zp-dFMS$!!,Q_r;ZnGepI;p"&RRr!r;m!0@mrL
-r;ZjA!WE'$+kG4-r;ZkFMZ*SX0@mrLr;ZjA!WE'#>h5qR!!=+iedhTX!l<GmrW!#9em/.R
-!sR9,>l=X)"kM6fkQ(?4pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TkPt]Os8PF[!#8N6
-s&B&qs2uf-$O7.Ys8QI,!<<'ZqZ$]5s0_h+!djs_q>^^$-t%o.s#L#X!pBS`qu?e+s6'.W
-"%iOmV>1)k%f7XS$iU,,^i'&M"=X-HqC)=C!U!J\!!:@D_"Rg0<Tj,W!Y5'kpAb9<s1n7,
-!rr9er;Znqs-3E]"!R^E+oMBBkPnrf!!6R.kPG5_''K;X^^'N4!eUHfqZ$^bs8P+W!"T,Z
-@#=a[3<0$rqZ#`C<>bZ7&1ISY?lfpc#niL&k5ZA!ruV%;!_NFTo`,&?s3(<?'4Ck?-lrj'
-$PLY_V#X*es6"u#$iL&,8cRuI!!;?`@/L!+@/oEh!"5Y'b:"28#7_UNs'YU%!]g;\qu?eF
-s1nO4"-iiK!r`0#[7U;s$g7PS+W(Ll%TWQ/+o20C)#F9qPZ8Rs!!9t9V>^Gr%f.UQ!!X;:
-s6#VH)#F:7DZ@oY!"337s!Sou#7D0fs/#\p!pBSkqu?f]s'Ya)!pBS`kQ(?4pL`f\pLa.T
-kPt]Df%)eS!#7uSej]XseuBl,#mC\Mf%*Xt!7o^SqZ$\kesH@9!b^)Xq>^^#+]*4,eh?t%
-!l<GWqu?dpf"q+]"$P5dMYR5P$i;(I$2so*Tj7Kq"<l1Dd38Jh!Pq8'!!91OU%\Nf7`"j"
-!XmD&pAb8petM^9!nPp]r;ZnVepI;p!uohB)uTa<_:DH\!!6!J_>=39%`-`4T`t)h!c?M^
-qZ$^Wf%)MP!"T)R:iat70)ttcdFQ-\7MG_#&0]WU:`0`H#7c+3_#P/"ef">b!^5,No`,&+
-euJWJ'2[92+W1Xk#nEudM?#fjf"l2^$2ji*4k@IC!!:!f;#C:p:tEJ^!"4\8WZ`#^"Uc!p
-ekl,A!\`-Uqu?e2etN!A"+/V8!WE'"QTb9I$c1D@)\WG]$V&^u)u9O='@GCIHU\\F!!8kF
-MZ*SW$dg-s!!X+af"l]&'Dhb2>h5qR!"2WSefbn="UP[=er'G,!l<Gaqu?f7ekl8E!l<GW
-kQ(?4pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TkPt]Os8PF[!!ebgq?m;=s8)]W$-U,\
-PW8^Ds8P+V!!9"sV>^GrHiLnZ!!kT]kJ2[LkPmR@!!;?`<Vugu@/oEb!!=)<s6'1X#:QFa
-qZ$T=./j2I^i'#L#Z^p)k7Rapk>hE[!mCVZpAb5%bP2&=DZ;-Z!!:@D_"7U.s8PFa!!9"s
-Pl(L`*rl6`r;Zo^s'Ya)!au&kq>^Uas8QL!!!7cP_#"*6+ohQjrW!3aV<>XG<TjBBrVut,
-qYgEubAII`6N@)`k6T8=V0`2/s8NE&!!5alkOefVHiLnZ!!7cPs8D*cbJ:NM<<*)brVm-!
-^e"M+DZ@oR!!;?`@/L!+@/oEh!!9t9qYfR[bJ9s=3VWRU3WK-W!!7NI_#+0<.0'<=!!"(`
-!r`0%"onW!rT==,^nm8.q#CG'qYgEqbAIL^!!cO(q@Wc.@)2[?!FYd&rrUA]"o\K'DZ@oY
-!!7cPs8D*`bJ:NM<W2t"kPnrf!!;?`@/L!+kPnQG!;A8CB'l#\B(n(E!!>12ei3='#CG%L
-#lp[MdJ^lfWhG;s0)u"'eh?n#!fGQdrW!"4etN!A#VV(OTl!98eh?t%!l<GWqu?dpf"q+]
-!u'8:_>+'9+c;u@f%-iErVutm>l+L,7b6/,%KHLF7f35fWn*m<!!,orp](A#efjbf!ijhF
-oDesDei3O-!fGQUqu?g:f%(f=!!:!f;#C:p:tEJZ!!>12ekku=!c?M^qZ$^;f%)#D!!k68
-_4b^8_:C:=!!,pDrRM1Q>Qb$cf%0c8#ca5KB)jmAed)'P!^5,No`,&+etN!A!c?N>rP8`=
-TpL*q!!.HFed'Tr4TGIeeuJED!l<Gaqu?dpf"q=c!hn2mrP8W:To+1Mp](@Kf%0a!!b^)X
-qu@!Gf%)ta!#_d;rW!$'f%/7I_$$d3ML,j/!!,pDrRM%M>Qk!*#=d:l%KHK*U&4lk:so6m
-!ifK.rW!")euJZK!c?N>rP8W:TpL*qrW!#9ekl8E!l<Gaqu?f7ejej'pG2JTm@!]\pG.=#
-JcLB&JcN=]pG2JTm@!]\pG1q4"%*%f6MLNd"m>oM!!(4B_"Ia0s8P+V!!9"sK)P`OHiLn[
-!!A)X[2AlC!pBSDr;Zo^s&Jss!au&kpAb<=s8P+R!!>Rfs%3.h!PiUL!!e,Us1ed<k>hE[
-!l4iZpAb5@bP;,>"6[Jn!!:@D_"7U.s8PFa!!9"sPl(L`*rl6`r;Zo^s'Ya)!au&kq>^X>
-kPtB%o`,&Fs1nL3#q5iM$NL0`s0W^C!!;?`3W/p[(iHbXrr3.u!(m4j3VWRV8cSf=qZ$[t
-s6'%T!djs_qu?hUs7ufj!!4Qq_#=9:?iZ&`q>p<j!pBSkqu?e+s6'@]!mCVZmf3DLs8Vus
-!djs_qZ$i9s0Vh,M.$8^!sel+Hg^q:(iHbXrr2tpr;['+kPoE"!R"L?!!='U[JKn&!2]Yp
-!cJ%]r;ZqVs7ufj!!;?`@/L!+kPnrf!!;?`<TjGW1A>DJRJ1=f1?\]?2qHP=p](R&_:Er5
-!34VDp&G0Feh?n#!fGQGrW!"4etN$B"*2tZ'E.t5_:C:<!!:!f7f35f:tEJW!!B7Peh?at
-"#nf^4oG?]Tj7Eo#Ar&CT`bA37f35fU"67<!!-`4q#CHt_4gQ&!ijhFoDesDei3O-!fGQU
-qu?g:f%(f=!!:!f;#C:p:tEJZ!!F1Uf$PH0!!7#gU&+fr+kG$I!!%&jQP9>u!l<G@r;Zp5
->aNk;ecgp24kA1;p](CZf%)#A!!5X@_=[d0B@`dS!!@8md/iq@![23MrRM*J!-6Z<p&G01
-ekl8E!`7IarW!#"etMO4!\`-Uqu?e2etMs@#,0V7!!%%9r;Zp'f%+L&!!<m>QdPf`!/g^T
-#6_lo>Q=c(7f*/f'3pmOrmh(,rW!")euJZK"*2u?!VQKp_:DH\!!:!f;#C:p_:D*>!;A8C
-B'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n(E!!>Rfs$HJ\#]B\=(]XQ4s6'+V!s/H%3VrdX
-bPsU%!!7NI_#=<98cRr[r;Zo^s#L#X!pBS`qu?e+s6'+V"BGL%[/p%&""=3L8c8Vi^i&uK
-#6M=5s-*NH<VuguV>o`Q!!/p\q#CIrs%2na!mCVZq#CFU8cA\ks8PFa!!9"sPl(L`*rl6`
-r;Zo^s'Ya)!au&kqZ$g1bAP,qb6R_@!eUHfqZ$mns0Vh,8cRr[r;Zo^s#KoU#mXJRs8NQW
-s8Q*o!!>7]s&Jpr!au&ko`,&?s1nO4"(;0/)"R_6&oQn4b5cG[rttJ1!pBSkqu?e+s6'@]
-!i>q[mf3DLs8Vus!djs_qZ$gls8O,Jb6RqF!pBTJli71o<QkFB%fHA3HiN723TgM>!"&s2
-bQ%SP!!$p:bP_DC@/p6Dp&G0Ws'Ya)!pBSkqu?f]s&J7_pG2JTm@!]\pG1q4"#nf^2u!@Y
->h7:9!!%o-_=dj1f%)MO!!91O0E(qQB@`dU!!>C8_$Bo=!l<G@r;Zo8ejfQ;!`7IapAb:b
-f%-2^!!=Cqeiis3!MNcp!!`Okf%,0J_++>&!fGRFpAb5OHhdXC7b0`r!!91OU%nZh00T:7
-!nPp]r;ZnVepI;p!u]\@)uTa<_:DH\!!6!J_>=3:$`[I*euAoI!!7#gU&+fq4k>r"!'SoL
-#Q4W(_:C:9!!rfuWn,`/+kG46p](CLf%*=f!!6!J_=[d0B@`dS!!?'Kee@WT#nC4VeuA^T
-f%(N/!!:!f;#C:p:tEJ^!!8&/_=%@*0@n_P!!6faU&+fo4kA1%$*"1,!!:!fHgC_9"\,NC
-edMEV#%uN'!\_@kp](X)7]P%j$NL03euJZK"&RS"'D;D-_:DH\!!:!f;#C:p_:D*>!;A8C
-B'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n(E!!>Rfs$HM]"$-5X<W2t#HiO*op](C$s8P+W
-!!4SK[J^(,HiLn\!!8Db[J^(-#Nu+Ir;Zo^s&Jss!au&kpAb<u_#OFBp](CEs8P[h!!0lQ
-q#CU/kPtQik>hE["+pRQ3V`XV%f03$!!9sZ!qlTqbQ#BR!!.porW!$"s$HYa!i>p]qu?g?
-s8O8@!!:@DDYsJ9V>o`V!!`V6V#_Y6s-33W!f?rmqZ$kts#C&ZPlJ/i!!`bls#C&Z."_?s
-#7'Gl%L;k1[J0_($2X\;qZ$\os6'%T!djs_qu?gZs8R!3!!-)"qu?s^s2tC&s8RrM!!:@D
-DYsJ9V>o`X!!@TJs![@:!]g;\qu?eFs1nL3"U!rfJo5r4!!C%:k6LPX!@WQt!!<Jhrsnu-
-"W7+9<MaU2!!+L"qu@!-kPl"l!,hh[r;Zp[s8R!1!!;?`@/L!+kPnrf!!;?`<TjGW1A>DJ
-RJ1=f1?\]?2qHP=q#CLMdFLed!!?lbefjeg!sR9,0DkeO+kE"Y!!6faU&G#nHe+P^!!<D@
-eh?t%!l<GWqu?dpf"q(\"9P:Jekl,A"!Q7H4oG?]Tj7Bn"q/8uekj1Pqu?h9f%)MM!!3PU
-7em#cTrJ.e!!91OU%nZhEa8SD!nPp]r;ZnVepI;p!u]\@)uTa<Wn(GQ!!8&/_>F9<!gecE
-):@#^p&G/7etMs@#E%(c!!%AsQi-mh"i8bC!!"0Zqu?s*_:AttdFOZZ!!<JRetMs@!fGRF
-o`,&+etN!A"#&6V>ke:"7Rm:U#;=Z.!&)pSEq]P8Wn(GQ!!8&/_>XE:B@bWWn,NMCf%0a!
-!b^)XqZ$d$_:EI.BDVZ2U"7$`nc/\6D>XA9"i8atr;[!7dFLdE>l4R&+`7,W#R/&q$NL03
-euJZK"#&6V>kS.!_:DH\!!:!f;#C:p_:D*>!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\
-B(n(E!!>gms$HS_"9Dp,s).c8";q"8^]jW9"pY,.)#sV9r;Zp'[HAD*!!7cPbPhJKPlKnM
-!!!MEs8PFa!!;?`<Vugu@/oE`!!EqXs8QL&!!>7]s%3.h!U#=7!!OeIs8)Rlqu?j[s8U7T
-qZ$^8[H@ek!!51\@.aL$bQ#BS!!iVK<<*"&s8P[h!!9S.Pl(L`*rl6gr;Zr8s1e[7!!?Wl
-s6':[#aFK^!!$p:s%2qb"-ii/!W<!"3VmXm!"P7nk61hc%`&,E63%!P[JU"1!p@`,!0mN`
-6Mg`e#64ags8QL*!!?6as8)Bg!eUHqqu?j#bQ$`Bqu?j'"TX-lqu@!Ns+p^V_#O6Zp](E3
-s1e[7!!?Wls6'@]";q"8^]jW9!!i5u"%*%f#Q4W(K)a$j!!I3>kK=M8!!>gms+:+J!!i<"
-!CF3l!!35bbPM8BV>na%')V_16FH^k!WqQ.rW!%.s8!!"!!E>Gs5t6s!!*6,rW!#_s'Ya)
-!pBSkqu?f]s'Y$jpG2JTm@!]\pG1q4"$P5d2u3LV:smj!r;Zs6dFOuoqu?p)!!!\`ejfT<
-!sFt,'E%n4D:Y`d!"+)(_#s`<$_c/&2uN^X_:D*R!!6!J_=dj3%]\+2;#((n0@n];r;Zl7
-EqfV<+jnlgd74$6">A?WWXen+!u%$;"o83#0@itm!!91OU%nZnW^Zsg"P2-er;ZncepI;p
-!u]\@+oMBBU"5q9!!?'6f"q7a#^aAq!!$9Teiia-!diLuqu?dOd9QYN%XZdC"98E0U"7dR
-!!"sEqu@!'_5[J8He-b,qZ$g(!!%Asekl;F"%L,XdIdJ@D:Y`a!!B7P_%Z_H"9\i-D-Zu=
-#U.c>!!&_Dd388b!hn2=r;Zpr_:HI%!!Et_etE6E!!!2s!!>12ecl!P!c?Mgq>^Y'f"n?r
-qZ$^]f%+^8!!!2u!!,$Fqu?d!_5dA4"H(d1_%-AC!B6AC!!32;Wr;u#:tF"tr;Zr"f"i$t
-!!*3*rW!#9ekl8E!l<Gaqu?f7ekkQ1pG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG1q4
-%>k,bDE/j]-phgps3!b+!#BJPs1gVq!"s1m"TT_Gs8%RD(dbX,%f?;<V>o]Z!!$%!s.r&"
-^d@5a<W2t#$31$Cqu?h,s8N8r!!Wq@s8TJe!rW*%"ag:L8cA\k$2ULm!!#Uirr?'r!">+l
-s8%==-ok:ZqYEPS!!9"[$2+?4)#F9U-kZn#*[j@%s#C&Z*rl7Jr;ZoBs0_b)"!7LB6N$ll
-HiO,]?uDg;DZBP:rW!";s$H\b"9QC=k99U#$)R\%^gJQ6DWaUi!"W*0s.r&"^d@5a<<*#!
-qDnKS*cCg7!!!l!s8$UG!!PBu?iU0DkPtRY<Cs$p8cSf#p&G2ks5sF\!"M?ls6!Ae!!uZK
--ifLp)#aLG"f9BT!!")'s8$UM!!,)[rW!=Qs8TlBDPa1Is7uou!"*WDs1gVq!"s1m"o&'"
-@/p6Mr;Zqrs5sF[!!<l1s/#Pl$3IX8s-+o3!@X2/q#CIrqDnKS!cIipqZ$^is8S>\!!60s
-3W/pZDYcBm!#S'&s.sV@%KJils6!Ae!!uZK-ia5Ns8RHE!!<E)s*OYD!pBT1kQ(?4pL`f\
-pLa.TkPu'4f%+(Z)]9eX>cQAT2u<Rj>h7K"0)tt^>cIo,)qNTfE]k'pQ\l1K!!8&/_>XEA
-7b6.J2dE%8_:D*T!!<JWem/+Q"&RS""SMg"$^]GqQS/C<!!EF;f%*"`!!3DQMY@)N4oX"4
-7f*/oHe-cqD*9$q7W$Q#2u*FTMSTPk!#$$neuBl'#n@gr2eU\p!!!nfekl;F!ijh<qu?g:
-f%)eY!"3GjetGoFMMbZid00FK!aO;8rW!'%U"7%!p](VXf%-Nk+WF\&4oG?k7b6.J2dE%8
-_:D'U!(P?hr;[mDd4YJ"'>`8I>Rg`:0;22B!#*3"equp[MO-KWedM0O!fGRFqZ%*bdFQ-'
-"TScsWZ_@h_%ZeJ%g7ci%KHJH_:I"='*&"c7fEAqB@bY-:gAm8>h7:*rW!:1f%-NJ!!!L6
-WW`(s"&RS")uTa<MUoW?!!<_Yer';($3?LEepAP?!$Q]Hq#CIcd4bFu!aO,+qZ$^]f%,3F
-!!5X;0DtkP>gY5(!#RZGer!_!$NN-5f"jfZ!!bun+TMKFf%+L4!!<ATen=m\!l<H#kQ(?4
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.Tkl:^?q>UTobEPR"q>_$,@-@RiqWImT+TML&
-kDAC$rrV@k!W<!!M9Gnu"R!/m!L3T`%]'X:s8Vr2'#<]1s8'oHrW!(/s8V8io`,^n[JKpd
-[AB_8kNA[L%KJN4kPtSF_"[m3HiO+GqZ$["Hft8*!R!M!!!4#6M=poM.-L:'$5+c&kPtSY
-b>kC^rr3#BPl:Xh*rl9'^``[X%]01)$i52PDZBb"[/e#BV>L;r+m8n%K)#BJ[AC;0rrKME
-qu?`uPlC[oV%*S,s8'M5@/p87Jr.:Y3W/pY*ju"I"R#XE?ip<-!>q[3rs+bl8cShR^_lnJ
-!K##!rrVB!8c8Vi6Ke@J%d3l863%"^s8&R=Pinkar;Zj>[Jp1.kPF@.rVus/V>gK.qKi<^
-s8V8i!!!%-kPtSYkPqA%q#C_$bPM8=kJ/6tbPqMBkI(0e!gN^Oq#CF%PlC^^q>lE_q#C\.
-s8TKYM86neq>^U"kPlt-!!m!4s0[H8^q_u/!!*2;rr2t+rVusckPkJqkPr^l!"6U*s8Vr=
-<=Zh-s8Vr=DZ0V=kPtD%DX%5r1A>DJRJ1=f1?ec=Er"8hdAhOV!Vl^*:r1`6dD=Ck)ZTjk
-_/dBkecET`qu?b<WrCQP_3Y-%HiDS+M@0I9f$U0$Tu#=2dAg%B!!H-Lf"m^G!#7GZdFQ.#
-MMe+D_2;%s!&(@gf%.[2p](D/f%*=f!!347_>;^`W\=/J!Y`t%p&G+:_=c@d%O%O^f%/6K
-7Z+5FecDdtrW!6Bf%.[2)ZTjGMZ207d:WMcf%.[(!27u$qu?j=_:I"Nq#CJ_MO4:m!LFJs
-!!%BFee!]H!S5iLT`S'AesC5oTqO.<!!*t(rmh4gdD8W[rVus4MZ)*2HNZL_f"n$nq>^P:
-WrCQN_4a$j!!,$prmhRqeuCY/!/f@TMJ%:PMAc?m!?%7'ecWb9_)M>n!=Oeaed'T8!aO=-
-_3b-$#Z/@gf$V=bMAu?k#tCrBf%.[2)fhtXecEURqZ$\Eei3C)!=*uNf)F%tEXV[C#Z0+'
-QYgc:TeH6B!s6<i+o;6F:tF3aD/u>D0DtkO!hoVE!)WXp!B7joeeGsOW]'naTu#=2dAfYD
-Tu#=2dAgIN!!L-hdAgI:!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n(F!!j&E#m1>;
-%MB*>!!N[/DL5b.r;['1+TMa-8O<g^!!WoC#6G,<')hkC+\='^!!*];"V(SH$O$V;%LN+7
-":#D?#7g>*#7F+@JpUls*rH!B#8.=F"Ubt<!!<6^?oe#_#7!S5H\--C./*]CK)->X!!WZ<
-#6P2=%fI"Q$O6b6"VM+F!soGD%LWLC#7_7C!!NH7"U>M@rW!<,*^Vk"!!!<5!s]>1!!<T6
-#7L>-"t0KP(d^eBp](mL8LOQ=!>5V@%KQSY@!d6.3V`XY-uOWS63I&a$PGHk-ia5P$NgVD
-"8W!&%Lr^F#7D.Lqu?m%6>hBm./a,M"$(7NDH.bS!!WHaDLu7_"oJ?.!?OQf&c_n<$NgVD
-r;[!-<Gm.k)#""?#n@7D"UPeF%Lr^F#7D1A!!3cn"8;d!(gq].<=AO$"p$,[H[B-\pAb5N
-[JBk-!@V?&HXJl1!!<6^8Jq@*"Th#.Jo3"9!"T,D$O$V;%LE1L$O$V;%L`79":bY?$Oc5"
-pG2JTm@!]\pG1t5#R_"F!X&`9%L;S*"U@M%B2B9?!!`fL!!P#=2[T?]"q(eB!<ic>rW!!=
-4X'e)$P!=C$NU_D"9J`7#Q=]+"UbG:$hF?'#sDO1B2C`/qu?p)%L3%<#nH\0!\[A'q#CX'
-2dC!4>YlU<!!7#b'D;D1"UbJ8"UPS8%MB'O!WW?5#6Y)5$O7%G"T\c7$iU,0!Xf,7$O$D.
-$5kcU%KHJ6#m(8<pAb:%"U,5.!!XSH!#%:S+nu$=)a,AD!"08?":G20+])fa:bVVE"X.,f
->W2`\!"08i4Wse*"UP56$Ng/)#7CnC!<ic>"oJ?(!B48#>Ts%G"p-G_D-TOJq#CRO>]!:r
-"T&0+))j2Y!!!61!X/u1!!NTs>\?kHpAb[.$O6_9#7^kE$O$P7#nHh4!Y-jbpAb@1:hO$&
-$2+?&+])fa:bVPC!HOP&!!ONBB4k$oq#CIL4VR_n"T^PeD-S7`!"T)?#m:;5$O6\B#m:;5
-$OQe4":GA9#mokspG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG.=#bl@eOkG<b1JcNmm
-!Ph:-!;A8CB'l#\B(n'4!6kKF#Jl:L!.k3m!!/cVWrVlLpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcO$q!au$gJcLB&aoDK'k5q[apG2JTm@!]\pG.=#bl@fAeh;UTJcNpn!\_@j
-WrVlLpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcO$q!?NY@!.k3m!!0KFWW;cKpL`f\
-pLa.TJcO$q!?!&4!.k3m!!/EkWW;cKpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcM#8!^c&XWW;cKpL`f\pLa.TJcLB&JcM#8!]Rq%WW;cKpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcM,;"Jp!RqJN84pG2JTm@!]\pG.=#JcLB&QN./G>[5Z]W;uZJpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcM/<!#Y_8!L*Va!;A8CB'l#\B(n'4!.k3&
-!13`d'E6P_H`-r=1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fLX!.k3<!!<U/DE4Tp
-pG2JTm@!]\pG.=#JcLB&QiI3p7U.UE!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4
-!.k3&!.k3]!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\
-B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!.k3&!.k3]!;A8C
-B'l#\B(n'4!2fet&g$'5!>lZ*!;QTq-jtV,^]=*apL`f\pLa.TJcM\K!=g"-!!*`HJcPTH
-!?hc$!5JU/1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fML!!*<GiW'*]Ped<Njo>Nl
-Pfs)Equ?a&*n^Mp-t$H[<<Q];<C.2l!!,DorD`o,?jlo5"X.8R<F?<e!!NaJPfs(nJcNRd
-pG2JTm@!]\pG.=#b5_PH)<(W!7XLi[D<:g$:j]4n>l4R&"W>tn![1B:qaL]b:e!AOq>^OT
-;#Nib:f%Js!!O<<7Rg2^eGoaZ>^NL%2hD%F!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\
-B(n'4!6bEF"m>nnirB3iHi!bojo>O%Hi!b[r;Zp'kPnrD!"^Q*_#OH2bJ:O$kPG5Yb?tMP
-!!l/C_#OH2M/E_"!!S5ZqNPk-eGoacDNt2$6@o3Q!;A8CB'l#\B(n'4!6bEF"MrYcirB3Y
-B@5:Ijo>NhB@5:8r;Zp&_:DH:!"^;dU"7fBWhGcQ_9pibW_`is!!k`#U"7fBEa/qL!!RDo
-d<f++eGoa_>^P&Q2hD%F!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!6bEF)#sW#
-i;`qps+9;3!mCU]r;Zp:s8S>9!!=YLs+:.K"pI#=qZ"_equ?gZs8Sqm!!>gmb9?KX!@U:l
-!!<E)s$D;;^]=*apL`f\pLa.TJcO!p!u'8:Hf4r+U"4)A!!91O>l=X)'@t`]fDl!sf%+^9
-!!WQZD:-q7+oD<B0@n^3qZ$^]euB\]!!+6%hZ*`]f%)d3!5JU/1A>DJRJ1=f14fLX!.k3&
-!4`+(1A>DJRJ1=f14fML!!6/b(uYGr_#K#I!!:@DDYsJ9<Kn?Q!!<W/s+:%H"=WI5k8sR%
-!ttY6M>R>U<VjK@oDerhs-2@?!rr9eJcNRdpG2JTm@!]\pG.=#b5_T5HP>?<!hn1^j8]7]
-em/+Q!_.MMfDl![f%+^6!!FI]f"i7&!!<_^eoLZg"%L\3$hOE#MUm.2!!:a&2hD%F!;A8C
-B'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!2ol!_#K#I!!:@DDU/:as8R]G!!F_Hs1e[7
-!!<K+s*O\E"',At#P.oskPp.j!!<3#6@o3Q!;A8CB'l#\B(n'4!2ol!U"4)A!!91O>gEBO
-f%+^5!!=CletN$B!sR9,BDhf47b3G#o)Jj.ens7D!nPp]JcNRdpG2JTm@!]\pG.=#JcLB&
-JcN=]pG2JTm@!]\pG.=#VuQn7s+9;3!mCU]cN"%Hs+9tF"-iic8cA\l#QOgNrW!%.s-*WV
-!!;?`DVb?ps8PE;!5JU/1A>DJRJ1=f14fM)!!8kFD<(ZuWn(G$!!:a&D>+#4He-b2rW!$(
-f%+L5!!?'KHNNa<!l<Gmh>dW.ei/0\^]=*apL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcNso!Wb;Aqu@!>8H8`=?sktrp](F,6>fd?r;Zo7s+:.K!XVj7qZ$XF6MUTd-t$FC!R(L\
-qu?d!3B@!;#T-,5!%;5_3<K!V"Tpbm?pXte!!<3#K(f6I6N@(^rW!60s8REG!+>hR!V$-k
-kPnQX!!OEDDI=jnq#CR'6==\&%f-/,s8PF`!!O!%?slP=JcNsopG2JTm@!]\pG.=#aoDGq
-0DkeU'0Q<q+](ug!VcWt$TD<['E%n4U"4)Y!!3Bp$2X]'+ZK2s#9co?0*&$'>l+L%0/*5'
-#ST?$!$P080*1kK"Tg>R:cAII!!:a&D>+#42qHQ;rW!3-f%+I6!)V6Zn,NO+ejfH8";s[6
-:a,T6"U-h]>WiJk!!:a&2uEXZ%Q@3\4V!&Db5h8lpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcO$q%;r$*s+14N6Bo[nb5m4nrrL:dqZ$j<M>I)Ks8%?H!"-OAJcGclK!kIT*rZ-B
-<Kt],PktFe.(/p7qZ#aAs).f9%;r$*s+14N6Bo[nb5m4nrrL:dqu@--DTe9$bQ#an?uBip
-p](Bqs+9tF!tPA2bPhJH#QOgN!+>h7nGidp3TpF=DM!K>!!jaUkEL>/s2uhg!!r[DkI#Z$
-kPB'"qu?fus$H\b#Q];8P\u`^s&FXNbQ.AmpL`f\pLa.TJcO$q%:"e,enkBe2g_RUWW6o7
-ecDciqZ$j7Em`:cf$S@6!",FND#aPRD3rZ$)?'U=7XM/dHi!dL+d^TmdFQ.Mem/1S%:"e,
-enkBe2g_RUWW6o7ecDciqu@-,>cN-kWn+1H:g@68p](BHent-]!t3]2Wr;u'"kM7;!)V6C
-n,NYG_:FKKD/K7P#TK,HHY9&'WZh6>#[G34B7%JB>Qjs)!nPp]r;[(8_0]F6dFLd=!6bH;
-1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fMN!#/FNqYu-I!'+H1s3%788NDD&s1e[6
-!!lU$M&l[@Hhs!+!"-OAJcGcf@&<o'*rZ-B8T*_kPl1Ri#F+CC!WWC3kPtR"rW!X4DYjBb
-!!##ebQ#b^V+E\!s8Tk8rW!B/V>;55!!g=>s8)T8"o&'!s8R]E!!<#skPbGc#QOgNDZ<`+
-!!BXls8W)]%CH093Tn0c!!!%Os8#ap!!<7uqFUYd"<lt.^^9r>!rr9erW!";s![jH!Z:*#
-JcO!ppG2JTm@!]\pG.=#blADH>g_,>!!"ZKWn+2-MENV0f%-Pm!!l'AEZ"irB@2)*!",FN
-D#aPL:l<iT)?'U=4^>hSHi3pP"ae'K!<<7!_:I1BrW!U$>g_,>!!"ZKWn+2-MENV0f%-Pn
-!"Asdd2;oa"ejMudF"rsp](BHent*\!n#T8rW!-+f%+J=ejf-/".-jTf)EJiQN."=_4_27
-!!@)hd74'7!fGAgrW!'?_:G:br;ZoMei3R.!aO;"rW!!5_+'"VbQ.AmpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcNso!mCUqr;ZqOs8QL*!!@-=s![jH!_NEKqu?bSHi=!H_#K#b
-!!>7]ruV(<!l4i#rW!$$V>im[!!<kss).`7!mCUqr;ZqOs8QL*!!@-=s![jH!au%mr;ZpJ
-s8P+P!!<3#K(]0GkPs`E!!`c/s3(HBPQL:R!pBS`r;Zp)kPlt.!!oG$qA924@/m)$!!=YL
-s,$[S!rr9erVuuBkPP;\M+N:!bQ.AmpL`f\pLa.TJcNso!ijggr;Zq:f%*[r!!?KWefk"m
-!^5+Tqu?b<BDql4U"4)Z!!=n*ef"Ac!hn1lr;ZnVei3L,!tN/u>l4R'Wn)%c!!@)hekl;F
-"'jF.+oVHC:tC!l!!=Cqeh?[r!nPq>p&G01f"q=c#6i]0Wn,aJ!Ug!i_:D*S!!<D@efjqk
-#`@3\'*&#/er'A*"!Q7HEr>t>f%)eZ!!0+9qu?b<4b<[X!;A8CB'l#\B(n'4!.k3&!.k3]
-!;A8CB'l#\B(n'4!6Y?D_#K#b!!@-=k5kM]#mpY38H8_okPl1m!!-(krW!#8s+:1L"!R^E
-*rH!>V>leZ!!5LebPD2?bPuJX!!9t9K)GZODZAl#r;Zp+s8P[i!!9S.Hi3pH!W)h(o`,'n
-s+9tF!s/8ubPhJI#QOh#bQ%U="7Q9lkPnQ\!!6R.bPM8F3WK,2!!;?`8c&Ji[K$(2rW!6(
-s$?\c!W)gVr;Zj8%Y=])!;A8CB'l#\B(n'4!6Y?DU"4)Z!!6EV_>F9>#M.Hh!!!/<edhTX
-!Cf6O!!8kFD>aG:)qNRXqu?eUepIAr!]S]1q>^Ssem/+Q!hn1^r;Zn(f"q7a!sdE.4oPE_
-Qe#gI!!:R!;"Xeif%+^3!!:R!Wr;u("kM7^Wn,aY!q60k_:D*S!!6!JWquc%0@n]k!!0pe
-4o53]Qe'OjrW!#Nei3R.!n#RPr;Zj3$\AB&!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\
-B(n'4!6Y?D_#K#b!!7'<bPM8EkPnoi!(m4Rp&G00s+:1L"!R^E*rH!>V>leZ!!8DbV>:/n
-bPuJX!!9t9K)GZNDZ@oW!!;?`@/^--_#KYs!!;?`3V<@Rs8R]F!!<l6s-3K_#m^M1HP4O%
-s.otj!!;?`<W)n![K!*"!!h]eb5aR&s![aE"(;0/8cA\ks8PFb!!^XHqP@RJ!J1<o!;A8C
-B'l#\B(n'4!6Y?DU"4)Z!!6EVWquc$_:DE_!'SoLp&G/fent?c!uohB)>jI9MUm.R!!7Mu
-MY[;SWn(GQ!!8kFD>aG9>h5qP!!:!f;#UFrU"4Sg!!:!f0D,;Hf%+^4!!<_^epIAr#mJo2
-B+CrmeqsY$!!:!f7f<;gQe%&j!!g?kWW4^'efjnj"&RS"4oPE_f%)eZ!!TCRd>CaDJcNmm
-pG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG.=#b5_UZs+:1L!cJ%]qZ$las'Pg,DZ@oR
-!!9t9K)GZO+ohQ`qu?eps-3K_!l4hmq>^T?s).`7!l4hfr;Zn:s3(9>!pBSkrW!%bs5sXd
-!!=YL[/oq#!rr:PpAb:qs8PFb!"&u2s*F_U_#OGB$1\&tkPnQ\!!;?`V>:/s_#NQt<WE(?
-qZ$^Ys8QL+!!<3#6N-rc3TpA@!p>d\JcO!ppG2JTm@!]\pG.=#b5_U;ent?c!aO<VqZ$l;
-ekc>H>h5qK!!8kFD>aG:)qNRXqu?eUepIAr!hn1cq>^Ssem/+Q!hn1^r;Zn(euJTI!l<Ga
-rW!%If"hOh!!4=pQh17Zf%+^4!!>^Aei3R.$3f#3B)i=5f%-/mnc/a-ejfT<!l<HFq>^bo
-f"h>Uf%(`9!!=n*ekl>G!nPp]rVusP_>Vpd_0ZZD!6bH;1A>DJRJ1=f14fLX!.k3&!4`+(
-1A>DJRJ1=f14fML!!9t9K)GZNDZ@oW!!qcf?iU1`s7ucj!!9t9K)GZO+ohQ`qu?eps-3K_
-!mCV?q>^T?s).`7!l4hfr;Zn:s3(9>!pBSkrW!6JqZ!B/!%?%+$hOE#s8R]F!!B(tb6%YC
-$O?_3HN4$R_#OGM%eBZ%kPnQ\!!;?`_"n$9V>n^=@/p6eqZ$^>s8Q*u!!<3#6N$ld%TT@g
-rr3#^$%`0%!;A8CB'l#\B(n'4!6Y?DU"4)Z!!6EVWquc$_:DE_!-6Z<p&G/fent?c!uohB
-)>jI9MUm.R!!91OMY[;SWn(GQ!!8kFD>aG9>h5qP!!:!f;#UG$)q!5o'*'2UTaC>k!nPq>
-pAb;QeuAcM!"/t]en4s_$),r$TaUGl!l<GWr;Zo8etMp?#E%*4!)V7t0Db_O):mA.rW!#N
-ei3O-!t.SU_>`!d_$>PlblIJnpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcNso!l4hf
-r;Zn:s3(9>#j;4q!!$p:rttJ1!l4hfr;ZpCs8O8?!!9"sPl:Xa_#MUS!!;?`DYsJ9_#K#b
-!!7'<bPM8@kPnrg!!a[3qZ#`o<<;[k!rr:Pp](CEs8P[h!!<K+s*O_F"UVU:s2u&I!!;?`
-<W)n![K#Fd!!fq3V#WOUs&Jpr""=3L./j2Js8PF^!!NEaV>pQeJcO$qpG2JTm@!]\pG.=#
-b5_U;ent?c!aO<VqZ$o<ekc>H>h7I>pAb8gent?c!uohB)uK[;MUm.R!!8kFWql\s_:Dlh
-!!8kFD>aG9>h5qP!!:!f;#L@u)gfu`_4a?h!!:a&D>4)5+kG4-r;Zp'f%+L5!!NUof%-i2
-oDes/ejfT<!ghKSq>^beeqsG\f%*=f!!=Cqefk"m!nPp]q>^["08e?34b<[Y!;A8CB'l#\
-B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!6Y?D_#K#b!!7'<bPM8FkPnoi!'1)ZM>$uO_#K#b
-!!=)<s#L#X!se#hPl:XbHiO+4qu?gIs8R!7!!9t9K)GZNDZ@oW!!;?`@/U'.!H,:O!Up'j
-s8R]H!!=)$s-3E]!t##-Hi3pJ#IXU3b8BmP!pBS`r;ZqVs8OME!!g^I<<*F,s/#Sm"',BE
-!WE'#s8PFb!!&km!!9S.8V-re!;A8CB'l#\B(n'4!6Y?DU"4)Z!!6EVWquc%_:DE_!&)pS
-Eq]P8U"4)Z!!<nceh?t%!sQNlHi=!IB@bWmqu?gBf%++(!!8kFD>aG9>h5qP!!:!f;#C:p
->aG]a!!:a&D>=/6'>`7Hqu?g(f%+L4!!NOmf%-i7o`,'0ejfT<"*2uD+o;6EWn'W>$.d[b
-qZ$[eeuJZK!nPp]rVuqUqZ$\aeieTbblIJnpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcNso!l4hmr;Zn:s3(9>$0V=r!!!&8s8"/=!!9t9M>[DV"onUSrW!')Pir(CrW!'EqZ"_U
-rW!'2bNJnCqu?f6s,$[S!cJ%]qZ$]\s'Yd*!gN^5mf3Fps8R]I!!G=Fs.ons!!=;Bs-3E]
-"U1b&s5tHs!!;?`K)GZO*r>o$qu@$Os2tHD!0mN`*rH!>V>jQp!!ic.s%*1j"o8?!!!9S)
-%Y=]*!;A8CB'l#\B(n'4!6Y?DU"48_!!6EVWqubt_:DH^!!AqGd388b!hn1cr;Zp&f%+^;
-!!EFO_:FMC!!F7geuBD_!!E\0_:Dlh!!8kFEr>t>>h5qP!!:!f;#L@qHe'A/!!<DUent6`
-">@UBM?NhW!u]\@Hi*jI"H(d]_&;qH!l<H)r;Zp;dFN[B!!sh"WW<)"He-acqu?eUejfW=
-#R&`04TGHbd/s4G!gh:BJcO$qpG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\pG.=#bQ%_G
-kPqCW!!A)Xk5tP]!pBT8rW!HMkPtBr(]XRs<<*""kPqCV!"-OAs--o/bAO0V_#46@DZBb"
-DF/6a<P\Wkr;Zp#kPqCW!!A)Xk5tP]!pBT8rW!'+qZ"a'rHeT`636f\%S?^#V)]qF-ol1\
-s6"8#qZ$^bs8TM(!!NP&s8V7BpAbT:s6"9aD?'ZSs8R!9!!<PCk8sU&";9ntb8C3Y!_NED
-r;[-Fs8QI,!#Y`R!WE'#3Vm-8!6bH;1A>DJRJ1=f14fML!!:!fMZ!MWEn8&-qu?f7entBd
-#oUS1d9I=b!&$h@!!:!fMYmG]U"7eA:gC#*MUnL"!"3&_f"kTM>cL8eeoLZg!l<HFr;Zq?
-f"hCb!!:!fD>jM<"jto$Hi7RX>W;?V%6`:nMD$+j+YR)of"kVf!!>12esH76"U'_6f"j$6
-!"5LO_-D=l!!$9Tem/1S!sbO9)?'U=%`-_r'E.t54k=KK!!jInekc>H'@pFe!!4h$:kA\k
-!;A8CB'l#\B(n'4!.k3&!.k3]!;A8CB'l#\B(n'4!6kKE[HIPh#g7g;bPM8=kJ7#r#j;6a
-b>eNB*ju"I#3YjG63+FVrr3#BK)P`N.*MVi#No(e[K$9MK)P`N<TjA]$KjDLbQ%F^HN:J:
-rr38IJo8d.s8V8tr;[,ds8'o=!!%lPq>UJl!Vl]r<VlRl"T%;X?jli3!eSVlrr3&_^_m"M
-!<SMbrrAnj!"hg!s8U7T!!!%;qZ!s@Hcr6&qu@!GbQ$aiDNs<arW!KX^utatqTDkes8U9!
-Ju.X<JcNsopG2JTm@!]\pG.=#bl@d2_>`!kWbl"@dFQmbU&=rs_:I#67K<E+Qi>P?_9p(X
-!11P$ecDdfrVusBWrCQS_+"Ekf%-j<rVusg_>`!m_(Pegf$UL1!11P$ed/9m>cQ3&f"n'Y
-!!pEldAfY9!-6K_ec:U&!!,R:qUPes_2;%qqZ$\7WmUgs!l:QDr;Zj!HiDRrMYI/T4jhj3
-WXf".#[Gd.QX"1'MA,mf#TKep_0]F6_++D(&0[a`f%/6K7Np@6WcDs6_,,^`b5h8lpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcO$q%2'$R!XB2F$P!CD"UbtA!!Ec:"UbY9!"T)j
-DLu7_"TSN8$O6_<%M&F;$O%qM3<oNa%LE4D$iL&D"Xl](%KHJ=#6P8?!"oYE!XB2F$P!CD
-"UbtA!"obH"UbV:!'/6!M/H^=Pir)H6MUTf#n@7F!s];K%KZ;(#S%=N"Tnu>&d/%3"9B,?
-"V18,!uO?b#Q+Q*&n$<<?l8\>"p$`%Jo3RPr;[?3&d\^D#n@7A(fbI*?pY$K!6P<91A>DJ
-RJ1=f14fMN!"BDE"T\c7$OI1E!X&f>r;Zs."U#,:r;[<\>]!:r"98E3#mC>5$Ocn5$NqV9
-0*M=U$O6_<$2jiB"<f]_$NL/7"Teo8!"K;=!<ii=#n$n<":5S:!"oYC":5;5!&(@0Ea2FG
-Hbn:a2u*FZ#7Cb>!X/rA$haQ+$O[1B!X/rA!rDs"%KutCpAb:/2_P@4!!Nj/D.cZYp](IN
->]!_!"T8<2":bY>!XB)<!#%h,D,<.oJcNpnpG2JTm@!]\pG.=#JcLB&JcN=]pG2JTm@!]\
-pG.=#JcP'9!s,7u<Vlau''K:4JcLB&h>m:*pL`f\pLa.TJcLB&kl:dBejfN:!tN/u>_2s-
-!8[_M1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fLX!9sOc3WI:u!!9"sDLqk?!8[_M
-1A>DJRJ1=f14fLX!9sOc0@m0!!!8&/>_2s-!8[_M1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJ
-RJ1=f14fLX!9sOc<WBK&!!9t9."VGN!8[_M1A>DJRJ1=f14fLX!9sOc7b3q%!!8kF+bB]G
-!8[_M1A>DJRJ1=f14fLX!.k3&!4`+(1A>DJRJ1=f14fLX!9sOd+og^-qZ$[GqPAcDJcOU,
-pG2JTm@!]\pG.=#JcP'9!uoh-!rDs!+jl1!!.k4,!;A8CB'l#\B(n'4!.k3&!.k3]!;A8C
-B'l#\B(n'4!.k49!!E=es+pgU!!=Y4^^G_oJcOU,pG2JTm@!]\pG.=#JcP$8"+/U>!W<!#
-+i0iYJcLB&h#R1)pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&kl;%oK'1<p<GnYr
-<<@aPJcOR+pG2JTm@!]\pG.=#JcP$8$3Y4^Wa&"uMSVa_JcLB&g]7((pL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&k5Y\r8T&lT-j>2&JcOL)pG2JTm@!]\pG.=#JcOs6"q*S!
-B1=$IJcLB&g&Uk&pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@Z
-pL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&
-\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&
-JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.T
-JcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\pLa.TJcLB&JcLB&\H)@ZpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5
-Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\
-pL]"4Jhhp5Jhj/XpL`f\pL]"4Jhhp5Jhj/XpL`f\JnBUHJnBUHO_4!KJnBUHJnBUHO_4!K
-JnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUH
-O_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUH
-JnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!K
-JnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUH
-O_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUH
-JnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_4!KJnBUHJnBUHO_035
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4YJsh4Y
-Jsh4YJsh4YJsh4YJsh4YJsh4Yi0a~>
diff --git a/support/dktools/splash-dktoolian.png b/support/dktools/splash-dktoolian.png
index d72915cea7..c0bb482b58 100644
--- a/support/dktools/splash-dktoolian.png
+++ b/support/dktools/splash-dktoolian.png
Binary files differ
diff --git a/support/dktools/test-a85d.c b/support/dktools/test-a85d.c
deleted file mode 100644
index 2c8d8410f2..0000000000
--- a/support/dktools/test-a85d.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-a85d.ctr
-*/
-
-
-#line 1 "test-a85d.ctr"
-/** @file test-dk4a85d.c Decoding ASCII-85 encoded data.
- The program converts ASCII-85 encoded text read from stdin
- and writes binary data to stdout.
-
- This file is an example how to use the dk4_a85_dec_t type.
-*/
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-#if DK4_ON_WINDOWS
-#include <io.h>
-#endif
-
-#include "dk4a85d.h"
-#include "dk4edstm.h"
-
-
-
-
-
-#line 21 "test-a85d.ctr"
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_a85_dec_t a85d; /* Decoder */
- const unsigned char *uptr; /* Pointer to decoders output buffer */
- size_t sz; /* Decoder output buffer size */
- size_t i; /* Current output buffer index */
- int c; /* Input character from stdin */
- int cc = 1; /* Flag: Can continue */
- int exval = 0; /* Exit status code */
-#if DK4_ON_WINDOWS
- int oldmode; /* Previous file mode for stdout */
-#endif
-
-
-
-#line 38 "test-a85d.ctr"
-
-
-#line 39 "test-a85d.ctr"
-
- /* Initialize decoder.
- */
- dk4a85_dec_init(&a85d, NULL);
-
- /* Change file mode for stdout to binary on Windows.
- */
-#if DK4_ON_WINDOWS
- oldmode = _setmode(_fileno(stdout), _O_BINARY);
-#endif
-
- /* Process standard input contents.
- */
- while (1 == cc) {
- c = fgetc(stdin);
- if (EOF != c) {
- switch (dk4a85_dec_add(&a85d, c, NULL)) {
- case DK4_EDSTM_FINISHED : {
- /* Decoder indicates that output is available.
- */
- uptr = NULL; sz = 0;
- if (1 == dk4a85_dec_output(&uptr, &sz, &a85d, NULL)) {
- if ((NULL != uptr) && (0 < sz)) {
- /* Output really found, write to stdout.
- */
- for (i = 0; i < sz; i++) {
- if (EOF == fputc(uptr[i], stdout)) {
- exval = 1;
- /* ERROR: Failed to write output */
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_STOP : {
- /* EOD marker found, stop processing.
- */
- cc = 0;
- } break;
- case DK4_EDSTM_ERROR : {
- /* ERROR: Decoding error occured. */
- exval = 1;
- cc = -1;
- } break;
- }
- } else {
- cc = 0;
- }
- }
-
- /* Check for incomplete final sequence in decoder.
- */
- if (0 == cc) {
- switch (dk4a85_dec_finish(&a85d, NULL)) {
- case DK4_EDSTM_FINISHED : {
- /* Decoder indicates that output is available.
- */
- uptr = NULL; sz = 0;
- if (1 == dk4a85_dec_output(&uptr, &sz, &a85d, NULL)) {
- if ((NULL != uptr) && (0 < sz)) {
- /* Output really found, write to stdout.
- */
- for (i = 0; i < sz; i++) {
- if (EOF == fputc(uptr[i], stdout)) {
- exval = 1;
- /* ERROR: Failed to write output */
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_ERROR : {
- exval = 1;
- /* ERROR: Decoding error occured */
- } break;
- }
- }
-
- /* Restore previous file mode on Windows.
- */
- fflush(stdout);
-#if DK4_ON_WINDOWS
- _setmode(_fileno(stdout), oldmode);
-#endif
-
-
-
-#line 125 "test-a85d.ctr"
-
-
-#line 126 "test-a85d.ctr"
-
- exit(exval); return exval;
-}
-
diff --git a/support/dktools/test-a85d.ctr b/support/dktools/test-a85d.ctr
deleted file mode 100644
index febb9e2df6..0000000000
--- a/support/dktools/test-a85d.ctr
+++ /dev/null
@@ -1,129 +0,0 @@
-/** @file test-dk4a85d.c Decoding ASCII-85 encoded data.
- The program converts ASCII-85 encoded text read from stdin
- and writes binary data to stdout.
-
- This file is an example how to use the dk4_a85_dec_t type.
-*/
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-#if DK4_ON_WINDOWS
-#include <io.h>
-#endif
-
-#include "dk4a85d.h"
-#include "dk4edstm.h"
-
-
-
-$!trace-include
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_a85_dec_t a85d; /* Decoder */
- const unsigned char *uptr; /* Pointer to decoders output buffer */
- size_t sz; /* Decoder output buffer size */
- size_t i; /* Current output buffer index */
- int c; /* Input character from stdin */
- int cc = 1; /* Flag: Can continue */
- int exval = 0; /* Exit status code */
-#if DK4_ON_WINDOWS
- int oldmode; /* Previous file mode for stdout */
-#endif
-
- $!trace-init test-a85d.deb
- $? "+ main"
-
- /* Initialize decoder.
- */
- dk4a85_dec_init(&a85d, NULL);
-
- /* Change file mode for stdout to binary on Windows.
- */
-#if DK4_ON_WINDOWS
- oldmode = _setmode(_fileno(stdout), _O_BINARY);
-#endif
-
- /* Process standard input contents.
- */
- while (1 == cc) {
- c = fgetc(stdin);
- if (EOF != c) {
- switch (dk4a85_dec_add(&a85d, c, NULL)) {
- case DK4_EDSTM_FINISHED : {
- /* Decoder indicates that output is available.
- */
- uptr = NULL; sz = 0;
- if (1 == dk4a85_dec_output(&uptr, &sz, &a85d, NULL)) {
- if ((NULL != uptr) && (0 < sz)) {
- /* Output really found, write to stdout.
- */
- for (i = 0; i < sz; i++) {
- if (EOF == fputc(uptr[i], stdout)) {
- exval = 1;
- /* ERROR: Failed to write output */
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_STOP : {
- /* EOD marker found, stop processing.
- */
- cc = 0;
- } break;
- case DK4_EDSTM_ERROR : {
- /* ERROR: Decoding error occured. */
- exval = 1;
- cc = -1;
- } break;
- }
- } else {
- cc = 0;
- }
- }
-
- /* Check for incomplete final sequence in decoder.
- */
- if (0 == cc) {
- switch (dk4a85_dec_finish(&a85d, NULL)) {
- case DK4_EDSTM_FINISHED : {
- /* Decoder indicates that output is available.
- */
- uptr = NULL; sz = 0;
- if (1 == dk4a85_dec_output(&uptr, &sz, &a85d, NULL)) {
- if ((NULL != uptr) && (0 < sz)) {
- /* Output really found, write to stdout.
- */
- for (i = 0; i < sz; i++) {
- if (EOF == fputc(uptr[i], stdout)) {
- exval = 1;
- /* ERROR: Failed to write output */
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_ERROR : {
- exval = 1;
- /* ERROR: Decoding error occured */
- } break;
- }
- }
-
- /* Restore previous file mode on Windows.
- */
- fflush(stdout);
-#if DK4_ON_WINDOWS
- _setmode(_fileno(stdout), oldmode);
-#endif
-
- $? "- main 0"
- $!trace-end
-
- exit(exval); return exval;
-}
-
diff --git a/support/dktools/test-a85e.c b/support/dktools/test-a85e.c
deleted file mode 100644
index 98ac10a8a2..0000000000
--- a/support/dktools/test-a85e.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-a85e.ctr
-*/
-
-
-#line 1 "test-a85e.ctr"
-/** @file test-a85e.c
- Convert binary input from stdin to ASCII-85 encoded text on stdout.
-
- This is an example how to used the dk4_a85_enc_t type.
-*/
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-#if DK4_ON_WINDOWS
-#include <io.h>
-#endif
-
-#include "dk4a85e.h"
-#include "dk4edstm.h"
-
-
-
-
-
-#line 20 "test-a85e.ctr"
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_a85_enc_t a85e; /* Encoder */
- const char *dptr; /* Pointer to encoder output buffer */
- size_t sz; /* Size of encoder output buffer */
- size_t i; /* Current output buffer index to process */
- int c; /* Input character */
- int linepos = 0; /* Position within output text line */
-#if DK4_ON_WINDOWS
- int oldmode; /* Previous file mode for stdin */
-#endif
-
-
-
-#line 36 "test-a85e.ctr"
-
-
-#line 37 "test-a85e.ctr"
-
- /* Set file mode for standard input to binary on Windows.
- */
-#if DK4_ON_WINDOWS
- oldmode = _setmode(0, _O_BINARY);
-#endif
-
- /* Initialize encoder.
- */
- dk4a85_enc_init(&a85e, 1, NULL);
-
- /* Process contents from stdin.
- */
- while (EOF != (c = fgetc(stdin))) {
- switch (dk4a85_enc_add(&a85e, (unsigned char)c, NULL)) {
- case DK4_EDSTM_FINISHED: {
- /* Encoder indicates that output is available.
- */
- dptr = NULL; sz = 0;
- if (0 != dk4a85_enc_output(&dptr, &sz, &a85e, NULL)) {
- if ((NULL != dptr) && (0 < sz)) {
- /* Output really found, write to stdout.
- */
- for (i = 0; i < sz; i++) {
- fputc(dptr[i], stdout);
- if (++linepos >= 75) {
- fputc('\n', stdout);
- linepos = 0;
- }
- }
- }
- }
- } break;
- }
- }
-
- /* Restore previous file mode for stdin on Windows
- */
-#if DK4_ON_WINDOWS
- _setmode(0, oldmode);
-#endif
-
- /* Check for final unprocessed sequence in encoder.
- */
- switch (dk4a85_enc_finish(&a85e, NULL)) {
- case DK4_EDSTM_FINISHED: {
- /* Encoder indicates that output is available.
- */
- dptr = NULL; sz = 0;
- if (0 != dk4a85_enc_output(&dptr, &sz, &a85e, NULL)) {
- if ((NULL != dptr) && (0 < sz)) {
- /* Output really found, write to stdout.
- */
- for (i = 0; i < sz; i++) {
- fputc(dptr[i], stdout);
- if (++linepos >= 75) {
- fputc('\n', stdout);
- linepos = 0;
- }
- }
- }
- }
- } break;
- }
-
- /* Write EOD marker to output.
- */
- if (74 <= linepos) {
- fputc('\n', stdout);
- }
- fputs("~>\n", stdout);
-
-
-
-#line 110 "test-a85e.ctr"
-
-
-#line 111 "test-a85e.ctr"
-
- exit(0); return 0;
-}
-
-
diff --git a/support/dktools/test-a85e.ctr b/support/dktools/test-a85e.ctr
deleted file mode 100644
index 2c3db881f8..0000000000
--- a/support/dktools/test-a85e.ctr
+++ /dev/null
@@ -1,115 +0,0 @@
-/** @file test-a85e.c
- Convert binary input from stdin to ASCII-85 encoded text on stdout.
-
- This is an example how to used the dk4_a85_enc_t type.
-*/
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-#if DK4_ON_WINDOWS
-#include <io.h>
-#endif
-
-#include "dk4a85e.h"
-#include "dk4edstm.h"
-
-
-
-$!trace-include
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_a85_enc_t a85e; /* Encoder */
- const char *dptr; /* Pointer to encoder output buffer */
- size_t sz; /* Size of encoder output buffer */
- size_t i; /* Current output buffer index to process */
- int c; /* Input character */
- int linepos = 0; /* Position within output text line */
-#if DK4_ON_WINDOWS
- int oldmode; /* Previous file mode for stdin */
-#endif
-
- $!trace-init test-a85e.deb
- $? "+ main"
-
- /* Set file mode for standard input to binary on Windows.
- */
-#if DK4_ON_WINDOWS
- oldmode = _setmode(0, _O_BINARY);
-#endif
-
- /* Initialize encoder.
- */
- dk4a85_enc_init(&a85e, 1, NULL);
-
- /* Process contents from stdin.
- */
- while (EOF != (c = fgetc(stdin))) {
- switch (dk4a85_enc_add(&a85e, (unsigned char)c, NULL)) {
- case DK4_EDSTM_FINISHED: {
- /* Encoder indicates that output is available.
- */
- dptr = NULL; sz = 0;
- if (0 != dk4a85_enc_output(&dptr, &sz, &a85e, NULL)) {
- if ((NULL != dptr) && (0 < sz)) {
- /* Output really found, write to stdout.
- */
- for (i = 0; i < sz; i++) {
- fputc(dptr[i], stdout);
- if (++linepos >= 75) {
- fputc('\n', stdout);
- linepos = 0;
- }
- }
- }
- }
- } break;
- }
- }
-
- /* Restore previous file mode for stdin on Windows
- */
-#if DK4_ON_WINDOWS
- _setmode(0, oldmode);
-#endif
-
- /* Check for final unprocessed sequence in encoder.
- */
- switch (dk4a85_enc_finish(&a85e, NULL)) {
- case DK4_EDSTM_FINISHED: {
- /* Encoder indicates that output is available.
- */
- dptr = NULL; sz = 0;
- if (0 != dk4a85_enc_output(&dptr, &sz, &a85e, NULL)) {
- if ((NULL != dptr) && (0 < sz)) {
- /* Output really found, write to stdout.
- */
- for (i = 0; i < sz; i++) {
- fputc(dptr[i], stdout);
- if (++linepos >= 75) {
- fputc('\n', stdout);
- linepos = 0;
- }
- }
- }
- }
- } break;
- }
-
- /* Write EOD marker to output.
- */
- if (74 <= linepos) {
- fputc('\n', stdout);
- }
- fputs("~>\n", stdout);
-
- $? "- main 0"
- $!trace-end
-
- exit(0); return 0;
-}
-
-
diff --git a/support/dktools/test-binenc.c b/support/dktools/test-binenc.c
deleted file mode 100644
index e5c3dfe101..0000000000
--- a/support/dktools/test-binenc.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-binenc.ctr
-*/
-
-/** @file test-binenc.c The test-binenc module.
-*/
-
-
-#line 1 "test-binenc.ctr"
-
-
-#include "dk4conf.h"
-#include <stdio.h>
-
-
-#include "dk4binenc.h"
-
-
-static char tbuf[9];
-
-
-static const unsigned char srcbuf[] = {
- 0x01, 0x02, 0x0A, 0x0F, 0x20, 0x24, 0xFF
-};
-
-int main(void)
-{
- int res;
-
- res = dk4binenc(
- tbuf, sizeof(tbuf), srcbuf, sizeof(srcbuf),
- DK4_BINARY_TO_TEXT_ENCODING_A85,
- NULL
- );
- if (0 < res) {
- fputs(tbuf, stdout);
- fputc('\n', stdout);
- } else {
- fputs("buffer to small\n", stdout);
- }
- return 0;
-}
diff --git a/support/dktools/test-binenc.ctr b/support/dktools/test-binenc.ctr
deleted file mode 100644
index 0a995eb792..0000000000
--- a/support/dktools/test-binenc.ctr
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-#include "dk4conf.h"
-#include <stdio.h>
-
-
-#include "dk4binenc.h"
-
-
-static char tbuf[9];
-
-
-static const unsigned char srcbuf[] = {
- 0x01, 0x02, 0x0A, 0x0F, 0x20, 0x24, 0xFF
-};
-
-int main(void)
-{
- int res;
-
- res = dk4binenc(
- tbuf, sizeof(tbuf), srcbuf, sizeof(srcbuf),
- DK4_BINARY_TO_TEXT_ENCODING_A85,
- NULL
- );
- if (0 < res) {
- fputs(tbuf, stdout);
- fputc('\n', stdout);
- } else {
- fputs("buffer to small\n", stdout);
- }
- return 0;
-}
diff --git a/support/dktools/test-bool.c b/support/dktools/test-bool.c
deleted file mode 100644
index 229e150db5..0000000000
--- a/support/dktools/test-bool.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-bool.ctr
-*/
-
-/** @file test-bool.c The test-bool module.
-*/
-
-
-#line 1 "test-bool.ctr"
-
-#include "dk4conf.h"
-#include "dk4str8.h"
-
-#include <stdio.h>
-
-
-
-
-
-#line 10 "test-bool.ctr"
-
-
-
-static const char * const teststr[] = {
-/* 0 */
-"ja",
-
-/* 1 */
-"nein",
-
-/* 2 */
-"yes",
-
-/* 3 */
-"no",
-
-/* 4 */
-"y",
-
-/* 5 */
-"n",
-
-/* 6 */
-"on",
-
-/* 7 */
-"off",
-
-/* 8 */
-"o",
-
-/* 9 */
-"of",
-
-/* 10 */
-"true",
-
-/* 11 */
-"tru",
-
-/* 12 */
-"tr",
-
-/* 13 */
-"t",
-
-/* 14 */
-"false",
-
-/* 15 */
-"fals",
-
-/* 16 */
-"fal",
-
-/* 17 */
-"fa",
-
-/* 18 */
-"f",
-
-/* 19 */
-"0",
-
-/* 20 */
-"1",
-
-/* 21 */
-"2",
-
-/* 22 */
-"+",
-
-/* 23 */
-"-",
-
-/* 24 */
-"*",
-
-/* 25 */
-"/",
-
-/* 26 */
-"JA",
-
-/* 27 */
-"J",
-
-/* 28 */
-"NEIN",
-
-/* 29 */
-"N",
-
-/* 30 */
-"YES",
-
-/* 31 */
-"NO",
-
-/* 32 */
-"YE",
-
-/* 33 */
-"N",
-
-/* 34 */
-"Y",
-
-/* 35 */
-"OFF",
-
-/* 36 */
-"OF",
-
-/* 37 */
-"O",
-
-/* 38 */
-"OfF",
-
-/* 39 */
-"TRUE",
-
-/* 40 */
-"TRU",
-
-/* 41 */
-"TR",
-
-/* 42 */
-"T",
-
-/* 43 */
-"B",
-
-/* 44 */
-"FALSE",
-
-/* 45 */
-"FALSCH",
-
-/* 46 */
-"FAL",
-
-/* 47 */
-"FA",
-
-/* 48 */
-"F",
-
-/* 49 */
-"0815",
-
-NULL
-
-
-#line 66 "test-bool.ctr"
-};
-
-int main(void)
-{
- const char * const *ptr;
-
-
-#line 72 "test-bool.ctr"
-
-
-#line 73 "test-bool.ctr"
- ptr = teststr;
- while (NULL != *ptr) {
- printf("%d %d \"%s\"\n",
- dk4str8_is_bool(*ptr),
- dk4str8_is_on(*ptr),
- *ptr
- );
- ptr++;
- }
-
-
-#line 83 "test-bool.ctr"
-
-
-#line 84 "test-bool.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-bool.ctr b/support/dktools/test-bool.ctr
deleted file mode 100644
index c717e2f2f5..0000000000
--- a/support/dktools/test-bool.ctr
+++ /dev/null
@@ -1,86 +0,0 @@
-
-#include "dk4conf.h"
-#include "dk4str8.h"
-
-#include <stdio.h>
-
-
-
-$!trace-include
-
-
-
-static const char * const teststr[] = {
-$!string-table
-ja
-nein
-yes
-no
-y
-n
-on
-off
-o
-of
-true
-tru
-tr
-t
-false
-fals
-fal
-fa
-f
-0
-1
-2
-+
--
-*
-/
-JA
-J
-NEIN
-N
-YES
-NO
-YE
-N
-Y
-OFF
-OF
-O
-OfF
-TRUE
-TRU
-TR
-T
-B
-FALSE
-FALSCH
-FAL
-FA
-F
-0815
-$!end
-};
-
-int main(void)
-{
- const char * const *ptr;
- $!trace-init test-bool.deb
- $? "+ main"
- ptr = teststr;
- while (NULL != *ptr) {
- printf("%d %d \"%s\"\n",
- dk4str8_is_bool(*ptr),
- dk4str8_is_on(*ptr),
- *ptr
- );
- ptr++;
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-container.cpp b/support/dktools/test-container.cpp
index 15b541c8f8..0bb8e573bd 100644
--- a/support/dktools/test-container.cpp
+++ b/support/dktools/test-container.cpp
@@ -1,18 +1,23 @@
/*
- WARNING: This file was generated by dkct.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: test-container.cpt
*/
-/** @file test-container.cpp The test-container module.
-*/
-
#line 1 "test-container.cpt"
+/** @file test-container.c Sorted storage demo.
+
+This program demonstrates how to use the Dk4Comparable and Dk4Container
+classes for sorted storage.
+
+*/
+
#include "dk4conf.h"
@@ -38,35 +43,60 @@
#include "Dk4Comparable.h"
#include "Dk4Container.h"
+/** Random numbers to store.
+*/
class RandomNumber: public DkTools4::Comparable
{
- private:
+ private:
+
+ /** Random number.
+ */
+
+ int i;
+
+ public:
+
+ /** Constructor.
+ */
- int i;
+ RandomNumber(void);
- public:
- RandomNumber(void);
+ /** Destructor.
+ */
- ~RandomNumber();
+ ~RandomNumber();
- int getNumber() const;
- int compareAgainst(void const *data, int cr) const;
+ /** Retrieve stored number.
+ @return The stored number.
+ */
+
+ int getNumber() const;
+
+
+ /** Compare against some data.
+ @param data Data to compare against (address of a RandomNumber).
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+ */
+
+ int compareAgainst(void const *data, int cr) const;
+
};
RandomNumber::RandomNumber(void)
{
- i = rand();
+ i = rand();
}
RandomNumber::~RandomNumber()
{
- fputs("Destructor for RandomNumber\n", stdout);
+ fputs("Destructor for RandomNumber\n", stdout);
}
@@ -74,7 +104,7 @@ RandomNumber::~RandomNumber()
int
RandomNumber::getNumber() const
{
- return i;
+ return i;
}
@@ -82,51 +112,63 @@ RandomNumber::getNumber() const
int
RandomNumber::compareAgainst(void const *data, int cr) const
{
- int back = 0;
- int j;
- RandomNumber *pr = (RandomNumber *)data;
- j = pr->getNumber();
- if(i > j) {
- back = 1;
- } else {
- if(i < j) {
- back = -1;
+ int back = 0;
+ int j;
+ RandomNumber const *pr = (RandomNumber const *)data;
+
+ j = pr->getNumber();
+ if(i > j) {
+ back = 1;
}
- }
- return back;
+ else {
+ if(i < j) {
+ back = -1;
+ }
+ }
+ return back;
}
int main(int argc, char *argv[])
{
- int i;
- time_t timer;
- RandomNumber *rndn;
-
- time(&timer);
- srand(timer);
- try {
- DkTools4::Container<RandomNumber> container(0, true);
- for(i = 0; i < 100; i++) {
- RandomNumber *rndn = new RandomNumber();
- if(!container.add(rndn)) {
- delete rndn ;
- }
- }
- container.reset();
- i = 0;
- while(NULL != (rndn = container.next())) {
- printf("%04d: %d\n", ++i, rndn->getNumber());
+ int i;
+ time_t timer;
+ RandomNumber *rndn;
+
+ time(&timer);
+ srand(timer);
+ try {
+ DkTools4::Container<RandomNumber> container(0, true);
+ DkTools4::Iterator<RandomNumber> iterator(container);
+ for(i = 0; i < 100; i++) {
+ printf("Generate random number %03d\n", i);
+ RandomNumber *rndn = new RandomNumber();
+ if(!container.add(rndn)) {
+ delete rndn ;
+ }
+ }
+ container.reset();
+ i = 0;
+ while(NULL != (rndn = container.next())) {
+ printf("%04d: %d\n", ++i, rndn->getNumber());
#if 0
- if (50 == i) { throw(std::bad_alloc()); }
+ if (50 == i) { throw(std::bad_alloc()); }
#endif
- }
- }
- catch(...) {
- printf("Poese Exception beim Container\n");
- }
- return 0;
+ }
+ printf("Pass 2\n");
+ iterator.reset();
+ while (NULL != (rndn = iterator.next())) {
+ printf("%04d: %d\n", ++i, rndn->getNumber());
+ }
+ }
+ catch(...) {
+ printf("Poese Exception beim Container\n");
+ }
+ return 0;
}
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/test-container.cpt b/support/dktools/test-container.cpt
index 22b416314d..f340f8cb9f 100644
--- a/support/dktools/test-container.cpt
+++ b/support/dktools/test-container.cpt
@@ -2,6 +2,13 @@
%% module
+/** @file test-container.c Sorted storage demo.
+
+This program demonstrates how to use the Dk4Comparable and Dk4Container
+classes for sorted storage.
+
+*/
+
#include "dk4conf.h"
@@ -27,35 +34,60 @@
#include "Dk4Comparable.h"
#include "Dk4Container.h"
+/** Random numbers to store.
+*/
class RandomNumber: public DkTools4::Comparable
{
- private:
+ private:
+
+ /** Random number.
+ */
+
+ int i;
+
+ public:
+
+ /** Constructor.
+ */
+
+ RandomNumber(void);
+
- int i;
+ /** Destructor.
+ */
- public:
+ ~RandomNumber();
- RandomNumber(void);
- ~RandomNumber();
+ /** Retrieve stored number.
+ @return The stored number.
+ */
- int getNumber() const;
+ int getNumber() const;
+
+
+ /** Compare against some data.
+ @param data Data to compare against (address of a RandomNumber).
+ @param cr Comparison criteria (ignored).
+ @return Comparison result.
+ */
+
+ int compareAgainst(void const *data, int cr) const;
- int compareAgainst(void const *data, int cr) const;
};
RandomNumber::RandomNumber(void)
{
- i = rand();
+ i = rand();
}
RandomNumber::~RandomNumber()
{
- fputs("Destructor for RandomNumber\n", stdout);
+ fputs("Destructor for RandomNumber\n", stdout);
}
@@ -63,7 +95,7 @@ RandomNumber::~RandomNumber()
int
RandomNumber::getNumber() const
{
- return i;
+ return i;
}
@@ -71,51 +103,63 @@ RandomNumber::getNumber() const
int
RandomNumber::compareAgainst(void const *data, int cr) const
{
- int back = 0;
- int j;
- RandomNumber *pr = (RandomNumber *)data;
- j = pr->getNumber();
- if(i > j) {
- back = 1;
- } else {
- if(i < j) {
- back = -1;
+ int back = 0;
+ int j;
+ RandomNumber const *pr = (RandomNumber const *)data;
+
+ j = pr->getNumber();
+ if(i > j) {
+ back = 1;
+ }
+ else {
+ if(i < j) {
+ back = -1;
+ }
}
- }
- return back;
+ return back;
}
int main(int argc, char *argv[])
{
- int i;
- time_t timer;
- RandomNumber *rndn;
-
- time(&timer);
- srand(timer);
- try {
- DkTools4::Container<RandomNumber> container(0, true);
- for(i = 0; i < 100; i++) {
- RandomNumber *rndn = new RandomNumber();
- if(!container.add(rndn)) {
- delete rndn ;
- }
- }
- container.reset();
- i = 0;
- while(NULL != (rndn = container.next())) {
- printf("%04d: %d\n", ++i, rndn->getNumber());
+ int i;
+ time_t timer;
+ RandomNumber *rndn;
+
+ time(&timer);
+ srand(timer);
+ try {
+ DkTools4::Container<RandomNumber> container(0, true);
+ DkTools4::Iterator<RandomNumber> iterator(container);
+ for(i = 0; i < 100; i++) {
+ printf("Generate random number %03d\n", i);
+ RandomNumber *rndn = new RandomNumber();
+ if(!container.add(rndn)) {
+ delete rndn ;
+ }
+ }
+ container.reset();
+ i = 0;
+ while(NULL != (rndn = container.next())) {
+ printf("%04d: %d\n", ++i, rndn->getNumber());
#if 0
- if (50 == i) { throw(std::bad_alloc()); }
+ if (50 == i) { throw(std::bad_alloc()); }
#endif
- }
- }
- catch(...) {
- printf("Poese Exception beim Container\n");
- }
- return 0;
+ }
+ printf("Pass 2\n");
+ iterator.reset();
+ while (NULL != (rndn = iterator.next())) {
+ printf("%04d: %d\n", ++i, rndn->getNumber());
+ }
+ }
+ catch(...) {
+ printf("Poese Exception beim Container\n");
+ }
+ return 0;
}
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/test-deldir.c b/support/dktools/test-deldir.c
deleted file mode 100644
index 3055308a58..0000000000
--- a/support/dktools/test-deldir.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-deldir.ctr
-*/
-
-/** @file test-deldir.c The test-deldir module.
-*/
-
-
-#line 1 "test-deldir.ctr"
-
-
-#include <stdio.h>
-
-
-
-#include "dk4app.h"
-#include "dk4fput.h"
-#include "dk4appmkdh.h"
-
-
-
-
-
-#line 14 "test-deldir.ctr"
-
-
-
-static const dkChar * const test_mkdir_help_text[] = {
-dkT("This is a test program to create directories."),
-NULL
-
-
-#line 21 "test-deldir.ctr"
-};
-
-static const dkChar * const test_mkdir_license_text[] = {
-dkT("Copyright (c) 2014-2016, Dirk Krause"),
-dkT("All rights reserved."),
-dkT(""),
-dkT("Redistribution and use in source and binary forms, with or without"),
-dkT("modification, are permitted provided that the following conditions"),
-dkT("are met:"),
-dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
-dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
-dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN"),
-dkT("ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
-dkT("POSSIBILITY OF SUCH DAMAGE."),
-NULL
-
-
-#line 55 "test-deldir.ctr"
-};
-
-static dk4_app_t *app = NULL;
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int res;
- int nargs;
- int i;
- const dkChar *arg;
-
-
-#line 75 "test-deldir.ctr"
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-mkdir.txt"), test_mkdir_help_text,
- test_mkdir_license_text
- );
- if (NULL != app) {
-
-#line 82 "test-deldir.ctr"
- nargs = dk4app_get_argc(app);
- if (0 < nargs) {
- dk4fput_initialize_stdout();
- for (i = 0; i < nargs; i++) {
- arg = dk4app_get_argv(app, i);
- if (NULL != arg) {
- res = dk4app_del_dir(arg, app);
- dk4fputs(arg, stdout, NULL);
- dk4fputc(dkT(' '), stdout, NULL);
- if (0 < res) {
- dk4fputs(dkT("SUCCESS"), stdout, NULL);
- } else {
- dk4fputs(dkT("FAILED"), stdout, NULL);
- }
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- }
- dk4app_close(app);
- } else {
-
-#line 102 "test-deldir.ctr"
- }
-
-
-#line 104 "test-deldir.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-deldir.ctr b/support/dktools/test-deldir.ctr
deleted file mode 100644
index 15d6008155..0000000000
--- a/support/dktools/test-deldir.ctr
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-#include <stdio.h>
-
-
-
-#include "dk4app.h"
-#include "dk4fput.h"
-#include "dk4appmkdh.h"
-
-
-
-$!trace-include
-
-
-
-static const dkChar * const test_mkdir_help_text[] = {
-$!text macro=dkT
-This is a test program to create directories.
-$!end
-};
-
-static const dkChar * const test_mkdir_license_text[] = {
-$!text macro=dkT
-Copyright (c) 2014-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-$!end
-};
-
-static dk4_app_t *app = NULL;
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int res;
- int nargs;
- int i;
- const dkChar *arg;
- $!trace-init test-deldir.deb
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-mkdir.txt"), test_mkdir_help_text,
- test_mkdir_license_text
- );
- if (NULL != app) { $? ". app"
- nargs = dk4app_get_argc(app);
- if (0 < nargs) {
- dk4fput_initialize_stdout();
- for (i = 0; i < nargs; i++) {
- arg = dk4app_get_argv(app, i);
- if (NULL != arg) {
- res = dk4app_del_dir(arg, app);
- dk4fputs(arg, stdout, NULL);
- dk4fputc(dkT(' '), stdout, NULL);
- if (0 < res) {
- dk4fputs(dkT("SUCCESS"), stdout, NULL);
- } else {
- dk4fputs(dkT("FAILED"), stdout, NULL);
- }
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- }
- dk4app_close(app);
- } else { $? "! app"
- }
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-deldirwc.c b/support/dktools/test-deldirwc.c
deleted file mode 100644
index 81b04baa0d..0000000000
--- a/support/dktools/test-deldirwc.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-deldirwc.ctr
-*/
-
-/** @file test-deldirwc.c The test-deldirwc module.
-*/
-
-
-#line 1 "test-deldirwc.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4deldirwc.h"
-
-
-int main(void)
-{
- int exval = 1;
- if (0 != dk4delete_directory_wc(L".\\%SystemDrive%", NULL)) {
- exval = 0;
- }
- return exval;
-}
-
diff --git a/support/dktools/test-deldirwc.ctr b/support/dktools/test-deldirwc.ctr
deleted file mode 100644
index 4bf55490e8..0000000000
--- a/support/dktools/test-deldirwc.ctr
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4deldirwc.h"
-
-
-int main(void)
-{
- int exval = 1;
- if (0 != dk4delete_directory_wc(L".\\%SystemDrive%", NULL)) {
- exval = 0;
- }
- return exval;
-}
-
diff --git a/support/dktools/test-deltree.c b/support/dktools/test-deltree.c
deleted file mode 100644
index a6feaa152c..0000000000
--- a/support/dktools/test-deltree.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-deltree.ctr
-*/
-
-/** @file test-deltree.c The test-deltree module.
-*/
-
-
-#line 1 "test-deltree.ctr"
-
-
-#include <stdio.h>
-
-
-
-#include "dk4app.h"
-#include "dk4fput.h"
-#include "dk4appmkdh.h"
-
-
-
-
-
-#line 14 "test-deltree.ctr"
-
-
-
-static const dkChar * const test_mkdir_help_text[] = {
-dkT("This is a test program to create directories."),
-NULL
-
-
-#line 21 "test-deltree.ctr"
-};
-
-static const dkChar * const test_mkdir_license_text[] = {
-dkT("Copyright (c) 2014-2016, Dirk Krause"),
-dkT("All rights reserved."),
-dkT(""),
-dkT("Redistribution and use in source and binary forms, with or without"),
-dkT("modification, are permitted provided that the following conditions"),
-dkT("are met:"),
-dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
-dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
-dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN"),
-dkT("ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
-dkT("POSSIBILITY OF SUCH DAMAGE."),
-NULL
-
-
-#line 55 "test-deltree.ctr"
-};
-
-static dk4_app_t *app = NULL;
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int res;
- int nargs;
- int i;
- const dkChar *arg;
-
-
-#line 75 "test-deltree.ctr"
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-mkdir.txt"), test_mkdir_help_text,
- test_mkdir_license_text
- );
- if (NULL != app) {
-
-#line 82 "test-deltree.ctr"
- nargs = dk4app_get_argc(app);
- if (0 < nargs) {
- dk4fput_initialize_stdout();
- for (i = 0; i < nargs; i++) {
- arg = dk4app_get_argv(app, i);
- if (NULL != arg) {
- res = dk4app_del_tree(arg, app);
- dk4fputs(arg, stdout, NULL);
- dk4fputc(dkT(' '), stdout, NULL);
- if (0 < res) {
- dk4fputs(dkT("SUCCESS"), stdout, NULL);
- } else {
- dk4fputs(dkT("FAILED"), stdout, NULL);
- }
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- }
- dk4app_close(app);
- } else {
-
-#line 102 "test-deltree.ctr"
- }
-
-
-#line 104 "test-deltree.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-deltree.ctr b/support/dktools/test-deltree.ctr
deleted file mode 100644
index 83953eb9c1..0000000000
--- a/support/dktools/test-deltree.ctr
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-#include <stdio.h>
-
-
-
-#include "dk4app.h"
-#include "dk4fput.h"
-#include "dk4appmkdh.h"
-
-
-
-$!trace-include
-
-
-
-static const dkChar * const test_mkdir_help_text[] = {
-$!text macro=dkT
-This is a test program to create directories.
-$!end
-};
-
-static const dkChar * const test_mkdir_license_text[] = {
-$!text macro=dkT
-Copyright (c) 2014-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-$!end
-};
-
-static dk4_app_t *app = NULL;
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int res;
- int nargs;
- int i;
- const dkChar *arg;
- $!trace-init test-deltree.deb
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-mkdir.txt"), test_mkdir_help_text,
- test_mkdir_license_text
- );
- if (NULL != app) { $? ". app"
- nargs = dk4app_get_argc(app);
- if (0 < nargs) {
- dk4fput_initialize_stdout();
- for (i = 0; i < nargs; i++) {
- arg = dk4app_get_argv(app, i);
- if (NULL != arg) {
- res = dk4app_del_tree(arg, app);
- dk4fputs(arg, stdout, NULL);
- dk4fputc(dkT(' '), stdout, NULL);
- if (0 < res) {
- dk4fputs(dkT("SUCCESS"), stdout, NULL);
- } else {
- dk4fputs(dkT("FAILED"), stdout, NULL);
- }
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- }
- dk4app_close(app);
- } else { $? "! app"
- }
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-dk4c8dbl.c b/support/dktools/test-dk4c8dbl.c
deleted file mode 100644
index a07d5b0662..0000000000
--- a/support/dktools/test-dk4c8dbl.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4c8dbl.ctr
-*/
-
-/** @file test-dk4c8dbl.c The test-dk4c8dbl module.
-*/
-
-
-#line 1 "test-dk4c8dbl.ctr"
-
-#include <stdio.h>
-
-#include "dk4c8dbl.h"
-
-
-
-
-#line 8 "test-dk4c8dbl.ctr"
-
-
-
-static const char * const test_strings[] = {
-/* 0 */
-"1.0",
-
-/* 1 */
-"0.1",
-
-/* 2 */
-"0.01",
-
-/* 3 */
-"10.0",
-
-/* 4 */
-"100.0",
-
-/* 5 */
-"1.00500",
-
-/* 6 */
-"0.10500",
-
-/* 7 */
-"0.010500",
-
-/* 8 */
-"10.00500",
-
-/* 9 */
-"100.00500",
-
-/* 10 */
-"100.00500e-5",
-
-/* 11 */
-"100.00500e-4",
-
-/* 12 */
-"100.00500e-3",
-
-/* 13 */
-"100.00500e-2",
-
-/* 14 */
-"100.00500e-1",
-
-/* 15 */
-"100.00500",
-
-/* 16 */
-"100.00500e1",
-
-/* 17 */
-"100.00500e2",
-
-/* 18 */
-"100.00500e3",
-
-/* 19 */
-"100.00500e4",
-
-/* 20 */
-"100.00500e5",
-
-/* 21 */
-"100.00500e6",
-
-/* 22 */
-"100.00500e7",
-
-/* 23 */
-"100.00500e8",
-
-/* 24 */
-"100.00500e9",
-
-/* 25 */
-"1.25e3",
-
-/* 26 */
-"1.25e2",
-
-/* 27 */
-"1.25e1",
-
-/* 28 */
-"1.25e0",
-
-/* 29 */
-"1.25e-1",
-
-/* 30 */
-"1.25e-2",
-
-/* 31 */
-"1.25e-3",
-
-/* 32 */
-"-1.0",
-
-/* 33 */
-"-0.1",
-
-/* 34 */
-"-0.01",
-
-/* 35 */
-"-10.0",
-
-/* 36 */
-"-100.0",
-
-/* 37 */
-"-1.00500",
-
-/* 38 */
-"-0.10500",
-
-/* 39 */
-"-0.010500",
-
-/* 40 */
-"-10.00500",
-
-/* 41 */
-"-100.00500",
-
-/* 42 */
-"-100.00500e-5",
-
-/* 43 */
-"-100.00500e-4",
-
-/* 44 */
-"-100.00500e-3",
-
-/* 45 */
-"-100.00500e-2",
-
-/* 46 */
-"-100.00500e-1",
-
-/* 47 */
-"-100.00500",
-
-/* 48 */
-"-100.00500e1",
-
-/* 49 */
-"-100.00500e2",
-
-/* 50 */
-"-100.00500e3",
-
-/* 51 */
-"-100.00500e4",
-
-/* 52 */
-"-100.00500e5",
-
-/* 53 */
-"-100.00500e6",
-
-/* 54 */
-"-100.00500e7",
-
-/* 55 */
-"-100.00500e8",
-
-/* 56 */
-"-100.00500e9",
-
-/* 57 */
-"-1.25e3",
-
-/* 58 */
-"-1.25e2",
-
-/* 59 */
-"-1.25e1",
-
-/* 60 */
-"-1.25e0",
-
-/* 61 */
-"-1.25e-1",
-
-/* 62 */
-"-1.25e-2",
-
-/* 63 */
-"-1.25e-3",
-
-/* 64 */
-"000500e3",
-
-/* 65 */
-"5.50500000",
-
-/* 66 */
-"000500",
-
-NULL
-
-
-#line 81 "test-dk4c8dbl.ctr"
-};
-
-int main(int argc, char *argv[])
-{
- const char * const *ptr;
-
-
-
-#line 88 "test-dk4c8dbl.ctr"
-
-
-#line 89 "test-dk4c8dbl.ctr"
- ptr = test_strings;
- while (NULL != *ptr) {
- fputs(*ptr, stdout);
- fputc('\n', stdout);
- dk4c8dbl_str_double_to_file(stdout, *ptr, NULL);
- fputc('\n', stdout);
- fputc('\n', stdout);
- ptr++;
- }
-
-
-#line 99 "test-dk4c8dbl.ctr"
-
-
-#line 100 "test-dk4c8dbl.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-dk4c8dbl.ctr b/support/dktools/test-dk4c8dbl.ctr
deleted file mode 100644
index 75d281e15b..0000000000
--- a/support/dktools/test-dk4c8dbl.ctr
+++ /dev/null
@@ -1,102 +0,0 @@
-
-#include <stdio.h>
-
-#include "dk4c8dbl.h"
-
-
-$!trace-include
-
-
-
-static const char * const test_strings[] = {
-$!string-table
-1.0
-0.1
-0.01
-10.0
-100.0
-1.00500
-0.10500
-0.010500
-10.00500
-100.00500
-100.00500e-5
-100.00500e-4
-100.00500e-3
-100.00500e-2
-100.00500e-1
-100.00500
-100.00500e1
-100.00500e2
-100.00500e3
-100.00500e4
-100.00500e5
-100.00500e6
-100.00500e7
-100.00500e8
-100.00500e9
-1.25e3
-1.25e2
-1.25e1
-1.25e0
-1.25e-1
-1.25e-2
-1.25e-3
--1.0
--0.1
--0.01
--10.0
--100.0
--1.00500
--0.10500
--0.010500
--10.00500
--100.00500
--100.00500e-5
--100.00500e-4
--100.00500e-3
--100.00500e-2
--100.00500e-1
--100.00500
--100.00500e1
--100.00500e2
--100.00500e3
--100.00500e4
--100.00500e5
--100.00500e6
--100.00500e7
--100.00500e8
--100.00500e9
--1.25e3
--1.25e2
--1.25e1
--1.25e0
--1.25e-1
--1.25e-2
--1.25e-3
-000500e3
-5.50500000
-000500
-$!end
-};
-
-int main(int argc, char *argv[])
-{
- const char * const *ptr;
-
- $!trace-init test-ppptf.deb
- $? "+ main"
- ptr = test_strings;
- while (NULL != *ptr) {
- fputs(*ptr, stdout);
- fputc('\n', stdout);
- dk4c8dbl_str_double_to_file(stdout, *ptr, NULL);
- fputc('\n', stdout);
- fputc('\n', stdout);
- ptr++;
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-dk4dir.c b/support/dktools/test-dk4dir.c
deleted file mode 100644
index 003386e299..0000000000
--- a/support/dktools/test-dk4dir.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4dir.ctr
-*/
-
-/** @file test-dk4dir.c The test-dk4dir module.
-*/
-
-
-#line 1 "test-dk4dir.ctr"
-
-
-#include <stdio.h>
-
-
-
-#include "dk4app.h"
-#include "dk4fput.h"
-#include "dk4appmkdh.h"
-#include "dk4dir.h"
-
-
-
-
-
-#line 15 "test-dk4dir.ctr"
-
-
-
-static const dkChar * const test_mkdir_help_text[] = {
-dkT("This is a test program to create directories."),
-NULL
-
-
-#line 22 "test-dk4dir.ctr"
-};
-
-static const dkChar * const test_mkdir_license_text[] = {
-dkT("Copyright (c) 2014-2016, Dirk Krause"),
-dkT("All rights reserved."),
-dkT(""),
-dkT("Redistribution and use in source and binary forms, with or without"),
-dkT("modification, are permitted provided that the following conditions"),
-dkT("are met:"),
-dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
-dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
-dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN"),
-dkT("ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
-dkT("POSSIBILITY OF SUCH DAMAGE."),
-NULL
-
-
-#line 56 "test-dk4dir.ctr"
-};
-
-static dk4_app_t *app = NULL;
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int nargs;
- int i;
- const dkChar *arg;
- const dkChar *fn;
- dk4_dir_t *dir;
-
-
-#line 77 "test-dk4dir.ctr"
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-mkdir.txt"), test_mkdir_help_text,
- test_mkdir_license_text
- );
- if (NULL != app) {
-
-#line 84 "test-dk4dir.ctr"
- nargs = dk4app_get_argc(app);
- if (0 < nargs) {
- dk4fput_initialize_stdout();
- for (i = 0; i < nargs; i++) {
- arg = dk4app_get_argv(app, i);
- if (NULL != arg) {
- dk4fputs(arg, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- dir = dk4dir_open(arg, DK4_DIR_OPEN_SORTED, NULL);
- if (NULL != dir) {
- while (NULL != (fn = dk4dir_next_dir(dir))) {
- dk4fputs(dkT("D "), stdout, NULL);
- dk4fputs(fn, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- while (NULL != (fn = dk4dir_next_file(dir))) {
- dk4fputs(dkT("F "), stdout, NULL);
- dk4fputs(fn, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- dk4dir_close(dir);
- }
- }
- }
- }
- dk4app_close(app);
- } else {
-
-#line 111 "test-dk4dir.ctr"
- }
-
-
-#line 113 "test-dk4dir.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-dk4dir.ctr b/support/dktools/test-dk4dir.ctr
deleted file mode 100644
index d83d56e1f5..0000000000
--- a/support/dktools/test-dk4dir.ctr
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-#include <stdio.h>
-
-
-
-#include "dk4app.h"
-#include "dk4fput.h"
-#include "dk4appmkdh.h"
-#include "dk4dir.h"
-
-
-
-$!trace-include
-
-
-
-static const dkChar * const test_mkdir_help_text[] = {
-$!text macro=dkT
-This is a test program to create directories.
-$!end
-};
-
-static const dkChar * const test_mkdir_license_text[] = {
-$!text macro=dkT
-Copyright (c) 2014-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-$!end
-};
-
-static dk4_app_t *app = NULL;
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int nargs;
- int i;
- const dkChar *arg;
- const dkChar *fn;
- dk4_dir_t *dir;
- $!trace-init test-mkdir.deb
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-mkdir.txt"), test_mkdir_help_text,
- test_mkdir_license_text
- );
- if (NULL != app) { $? ". app"
- nargs = dk4app_get_argc(app);
- if (0 < nargs) {
- dk4fput_initialize_stdout();
- for (i = 0; i < nargs; i++) {
- arg = dk4app_get_argv(app, i);
- if (NULL != arg) {
- dk4fputs(arg, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- dir = dk4dir_open(arg, DK4_DIR_OPEN_SORTED, NULL);
- if (NULL != dir) {
- while (NULL != (fn = dk4dir_next_dir(dir))) {
- dk4fputs(dkT("D "), stdout, NULL);
- dk4fputs(fn, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- while (NULL != (fn = dk4dir_next_file(dir))) {
- dk4fputs(dkT("F "), stdout, NULL);
- dk4fputs(fn, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- dk4dir_close(dir);
- }
- }
- }
- }
- dk4app_close(app);
- } else { $? "! app"
- }
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-dk4dir08.c b/support/dktools/test-dk4dir08.c
deleted file mode 100644
index 8f901786ef..0000000000
--- a/support/dktools/test-dk4dir08.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4dir08.ctr
-*/
-
-/** @file test-dk4dir08.c The test-dk4dir08 module.
-*/
-
-
-#line 1 "test-dk4dir08.ctr"
-
-
-#include <stdio.h>
-
-#include "dk4dir.h"
-#include "dk4dir08.h"
-
-
-int main(int argc, char *argv[])
-{
- dk4_dir_c8_t *dir;
- const char *fn;
- int i;
-
-
-#line 15 "test-dk4dir08.ctr"
-
-
-#line 16 "test-dk4dir08.ctr"
- for (i = 1; i < argc; i++) {
- printf("argv[%02d] = \"%s\"\n", i, argv[i]);
- dir = dk4dir_c8_open(argv[i], DK4_DIR_OPEN_SORTED, NULL);
- if (NULL != dir) {
- while (NULL != (fn = dk4dir_c8_next_dir(dir))) {
- printf("D %s\n", fn);
- }
- while (NULL != (fn = dk4dir_c8_next_file(dir))) {
- printf("F %s\n", fn);
- }
- dk4dir_c8_close(dir);
- }
- }
-
-
-#line 30 "test-dk4dir08.ctr"
-
-
-#line 31 "test-dk4dir08.ctr"
- return 0;
-}
-
-
diff --git a/support/dktools/test-dk4dir08.ctr b/support/dktools/test-dk4dir08.ctr
deleted file mode 100644
index b534f89aad..0000000000
--- a/support/dktools/test-dk4dir08.ctr
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-#include <stdio.h>
-
-#include "dk4dir.h"
-#include "dk4dir08.h"
-
-
-int main(int argc, char *argv[])
-{
- dk4_dir_c8_t *dir;
- const char *fn;
- int i;
- $!trace-init dk4dir08.deb
- $? "+ main"
- for (i = 1; i < argc; i++) {
- printf("argv[%02d] = \"%s\"\n", i, argv[i]);
- dir = dk4dir_c8_open(argv[i], DK4_DIR_OPEN_SORTED, NULL);
- if (NULL != dir) {
- while (NULL != (fn = dk4dir_c8_next_dir(dir))) {
- printf("D %s\n", fn);
- }
- while (NULL != (fn = dk4dir_c8_next_file(dir))) {
- printf("F %s\n", fn);
- }
- dk4dir_c8_close(dir);
- }
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
-
diff --git a/support/dktools/test-dk4enc.c b/support/dktools/test-dk4enc.c
deleted file mode 100644
index 160a8a6c5a..0000000000
--- a/support/dktools/test-dk4enc.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4enc.ctr
-*/
-
-/** @file test-dk4enc.c The test-dk4enc module.
-*/
-
-
-#line 1 "test-dk4enc.ctr"
-
-
-#include "dk4conf.h"
-#include "dk4types.h"
-#include "dk4error.h"
-#include "dk4enc.h"
-
-
-
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_er_t er;
- int enc = 0;
- int bom = 0;
- if (argc > 1) {
- dk4error_init(&er);
- if (0 != dk4enc_find(&enc, &bom, argv[1], &er)) {
- printf("Encoding: %d\nBOM: %d\n", enc, bom);
- } else {
- printf("Fehlgeschlagen, Grund: %d\n", er.ec);
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4enc.ctr b/support/dktools/test-dk4enc.ctr
deleted file mode 100644
index dda4e78470..0000000000
--- a/support/dktools/test-dk4enc.ctr
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-#include "dk4conf.h"
-#include "dk4types.h"
-#include "dk4error.h"
-#include "dk4enc.h"
-
-
-
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_er_t er;
- int enc = 0;
- int bom = 0;
- if (argc > 1) {
- dk4error_init(&er);
- if (0 != dk4enc_find(&enc, &bom, argv[1], &er)) {
- printf("Encoding: %d\nBOM: %d\n", enc, bom);
- } else {
- printf("Fehlgeschlagen, Grund: %d\n", er.ec);
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4exep8.c b/support/dktools/test-dk4exep8.c
deleted file mode 100644
index d5d6c58cb4..0000000000
--- a/support/dktools/test-dk4exep8.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4exep8.ctr
-*/
-
-/** @file test-dk4exep8.c The test-dk4exep8 module.
-*/
-
-
-#line 1 "test-dk4exep8.ctr"
-
-#include <stdio.h>
-
-#include "dk4exep8.h"
-
-
-
-
-#line 8 "test-dk4exep8.ctr"
-
-
-int main(int argc, char *argv[])
-{
- char buf[256];
- dk4_er_t er;
-
-
-#line 15 "test-dk4exep8.ctr"
-
-
-#line 16 "test-dk4exep8.ctr"
- dk4error_init(&er);
- if (0 != dk4execpath_c8(buf, sizeof(buf), argv[0], &er)) {
- printf("%s\n", buf);
- } else {
- printf("ERROR: Not found!n");
- }
-
-
-#line 23 "test-dk4exep8.ctr"
-
-
-#line 24 "test-dk4exep8.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-dk4exep8.ctr b/support/dktools/test-dk4exep8.ctr
deleted file mode 100644
index 00285a6b00..0000000000
--- a/support/dktools/test-dk4exep8.ctr
+++ /dev/null
@@ -1,26 +0,0 @@
-
-#include <stdio.h>
-
-#include "dk4exep8.h"
-
-
-$!trace-include
-
-
-int main(int argc, char *argv[])
-{
- char buf[256];
- dk4_er_t er;
- $!trace-init test-dk4exep8.deb"
- $? "+ main"
- dk4error_init(&er);
- if (0 != dk4execpath_c8(buf, sizeof(buf), argv[0], &er)) {
- printf("%s\n", buf);
- } else {
- printf("ERROR: Not found!n");
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-dk4loc.c b/support/dktools/test-dk4loc.c
deleted file mode 100644
index 094b5b2769..0000000000
--- a/support/dktools/test-dk4loc.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4loc.ctr
-*/
-
-/** @file test-dk4loc.c The test-dk4loc module.
-*/
-
-
-#line 1 "test-dk4loc.ctr"
-
-#include <stdio.h>
-
-
-#include "dk4loc.h"
-
-#ifndef DK4MEM_H_INCLUDED
-#include "dk4mem.h"
-#endif
-
-
-
-
-
-#line 14 "test-dk4loc.ctr"
-
-
-
-dkChar langbuf[16];
-dkChar regbuf[16];
-
-
-
-int main(void)
-{
- dk4_er_t er;
- int encoding;
- int res;
-
-
-
-#line 29 "test-dk4loc.ctr"
-
-
-#line 30 "test-dk4loc.ctr"
- dk4error_init(&er);
-
-
-#line 32 "test-dk4loc.ctr"
- res = dk4loc_get_settings(
- langbuf, DK4_SIZEOF(langbuf,dkChar),
- regbuf, DK4_SIZEOF(regbuf,dkChar),
- &encoding, &er
- );
-
-
-#line 38 "test-dk4loc.ctr"
- if (0 != res) {
-
-#line 39 "test-dk4loc.ctr"
- printf("Einstellungen gefunden.\n");
-#if DK4_ON_WINDOWS
- printf("Language: \"%ls\"\n", langbuf);
- printf("Region: \"%ls\"\n", regbuf);
- printf("Encoding: %d\n", encoding);
-#else
- printf("Language: \"%s\"\n", langbuf);
- printf("Region: \"%s\"\n", regbuf);
- printf("Encoding: %d\n", encoding);
-#endif
- } else {
-
-#line 50 "test-dk4loc.ctr"
- printf("Einstellungen nicht gefunden.\n");
- printf("Fehlercode: %d\n", er.ec);
- }
-
-
-#line 54 "test-dk4loc.ctr"
-
-
-#line 55 "test-dk4loc.ctr"
- return 0;
-}
diff --git a/support/dktools/test-dk4loc.ctr b/support/dktools/test-dk4loc.ctr
deleted file mode 100644
index e4c2aa0970..0000000000
--- a/support/dktools/test-dk4loc.ctr
+++ /dev/null
@@ -1,56 +0,0 @@
-
-#include <stdio.h>
-
-
-#include "dk4loc.h"
-
-#ifndef DK4MEM_H_INCLUDED
-#include "dk4mem.h"
-#endif
-
-
-
-$!trace-include
-
-
-
-dkChar langbuf[16];
-dkChar regbuf[16];
-
-
-
-int main(void)
-{
- dk4_er_t er;
- int encoding;
- int res;
-
- $!trace-init test-dk4loc.deb
- $? "+ main"
- dk4error_init(&er);
- $? ". ready to retrieve settings"
- res = dk4loc_get_settings(
- langbuf, DK4_SIZEOF(langbuf,dkChar),
- regbuf, DK4_SIZEOF(regbuf,dkChar),
- &encoding, &er
- );
- $? ". settings retrieved"
- if (0 != res) { $? ". success"
- printf("Einstellungen gefunden.\n");
-#if DK4_ON_WINDOWS
- printf("Language: \"%ls\"\n", langbuf);
- printf("Region: \"%ls\"\n", regbuf);
- printf("Encoding: %d\n", encoding);
-#else
- printf("Language: \"%s\"\n", langbuf);
- printf("Region: \"%s\"\n", regbuf);
- printf("Encoding: %d\n", encoding);
-#endif
- } else { $? "! error"
- printf("Einstellungen nicht gefunden.\n");
- printf("Fehlercode: %d\n", er.ec);
- }
- $? "- main"
- $!trace-end
- return 0;
-}
diff --git a/support/dktools/test-dk4maac.c b/support/dktools/test-dk4maac.c
deleted file mode 100644
index 9b78ffe401..0000000000
--- a/support/dktools/test-dk4maac.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maac.ctr
-*/
-
-/** @file test-dk4maac.c The test-dk4maac module.
-*/
-
-
-#line 1 "test-dk4maac.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maac.h"
-
-
-
-#line 10 "test-dk4maac.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- int i1; /* First operand */
- int i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- char c1; /* First operand as char */
- char c2; /* Second operand as char */
- char c3; /* Result as char */
-
-
-
-#line 46 "test-dk4maac.ctr"
-
-
-#line 47 "test-dk4maac.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%d %d", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%d %d\n", (int)c1, (int)c2);
- dk4error_init(&er);
- c3 = dk4ma_char_add(c1, c2, &er);
- printf("\t+ %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_char_sub(c1, c2, &er);
- printf("\t- %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_char_mul(c1, c2, &er);
- printf("\t* %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_char_div(c1, c2, &er);
- printf("\t/ %d", (int)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 85 "test-dk4maac.ctr"
-
-
-#line 86 "test-dk4maac.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maac.ctr b/support/dktools/test-dk4maac.ctr
deleted file mode 100644
index e93ae20697..0000000000
--- a/support/dktools/test-dk4maac.ctr
+++ /dev/null
@@ -1,88 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maac.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- int i1; /* First operand */
- int i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- char c1; /* First operand as char */
- char c2; /* Second operand as char */
- char c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%d %d", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%d %d\n", (int)c1, (int)c2);
- dk4error_init(&er);
- c3 = dk4ma_char_add(c1, c2, &er);
- printf("\t+ %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_char_sub(c1, c2, &er);
- printf("\t- %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_char_mul(c1, c2, &er);
- printf("\t* %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_char_div(c1, c2, &er);
- printf("\t/ %d", (int)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maai.c b/support/dktools/test-dk4maai.c
deleted file mode 100644
index 9c62d0fa33..0000000000
--- a/support/dktools/test-dk4maai.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maai.ctr
-*/
-
-/** @file test-dk4maai.c The test-dk4maai module.
-*/
-
-
-#line 1 "test-dk4maai.ctr"
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maai.h"
-
-
-
-#line 9 "test-dk4maai.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- int i1; /* First operand */
- int i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- int c1; /* First operand as char */
- int c2; /* Second operand as char */
- int c3; /* Result as char */
-
-
-
-#line 45 "test-dk4maai.ctr"
-
-
-#line 46 "test-dk4maai.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%d %d", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%d %d\n", (int)c1, (int)c2);
- dk4error_init(&er);
- c3 = dk4ma_int_add(c1, c2, &er);
- printf("\t+ %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_int_sub(c1, c2, &er);
- printf("\t- %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_int_mul(c1, c2, &er);
- printf("\t* %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_int_div(c1, c2, &er);
- printf("\t/ %d", (int)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 84 "test-dk4maai.ctr"
-
-
-#line 85 "test-dk4maai.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maai.ctr b/support/dktools/test-dk4maai.ctr
deleted file mode 100644
index c828dbfb77..0000000000
--- a/support/dktools/test-dk4maai.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maai.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- int i1; /* First operand */
- int i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- int c1; /* First operand as char */
- int c2; /* Second operand as char */
- int c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%d %d", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%d %d\n", (int)c1, (int)c2);
- dk4error_init(&er);
- c3 = dk4ma_int_add(c1, c2, &er);
- printf("\t+ %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_int_sub(c1, c2, &er);
- printf("\t- %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_int_mul(c1, c2, &er);
- printf("\t* %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_int_div(c1, c2, &er);
- printf("\t/ %d", (int)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maal.c b/support/dktools/test-dk4maal.c
deleted file mode 100644
index fd76818dc1..0000000000
--- a/support/dktools/test-dk4maal.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maal.ctr
-*/
-
-/** @file test-dk4maal.c The test-dk4maal module.
-*/
-
-
-#line 1 "test-dk4maal.ctr"
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maal.h"
-
-
-
-#line 9 "test-dk4maal.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- long i1; /* First operand */
- long i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- long c1; /* First operand as char */
- long c2; /* Second operand as char */
- long c3; /* Result as char */
-
-
-
-#line 45 "test-dk4maal.ctr"
-
-
-#line 46 "test-dk4maal.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%ld %ld", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%ld %ld\n", (long)c1, (long)c2);
- dk4error_init(&er);
- c3 = dk4ma_long_add(c1, c2, &er);
- printf("\t+ %ld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_long_sub(c1, c2, &er);
- printf("\t- %ld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_long_mul(c1, c2, &er);
- printf("\t* %ld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_long_div(c1, c2, &er);
- printf("\t/ %ld", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 84 "test-dk4maal.ctr"
-
-
-#line 85 "test-dk4maal.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maal.ctr b/support/dktools/test-dk4maal.ctr
deleted file mode 100644
index 285a3258ca..0000000000
--- a/support/dktools/test-dk4maal.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maal.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- long i1; /* First operand */
- long i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- long c1; /* First operand as char */
- long c2; /* Second operand as char */
- long c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%ld %ld", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%ld %ld\n", (long)c1, (long)c2);
- dk4error_init(&er);
- c3 = dk4ma_long_add(c1, c2, &er);
- printf("\t+ %ld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_long_sub(c1, c2, &er);
- printf("\t- %ld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_long_mul(c1, c2, &er);
- printf("\t* %ld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_long_div(c1, c2, &er);
- printf("\t/ %ld", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maall.c b/support/dktools/test-dk4maall.c
deleted file mode 100644
index a6edc80697..0000000000
--- a/support/dktools/test-dk4maall.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maall.ctr
-*/
-
-/** @file test-dk4maall.c The test-dk4maall module.
-*/
-
-
-#line 1 "test-dk4maall.ctr"
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maall.h"
-
-
-
-#line 9 "test-dk4maall.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- long long i1; /* First operand */
- long long i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- long long c1; /* First operand as char */
- long long c2; /* Second operand as char */
- long long c3; /* Result as char */
-
-
-
-#line 45 "test-dk4maall.ctr"
-
-
-#line 46 "test-dk4maall.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%lld %lld", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%lld %lld\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_ll_add(c1, c2, &er);
- printf("\t+ %lld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ll_sub(c1, c2, &er);
- printf("\t- %lld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ll_mul(c1, c2, &er);
- printf("\t* %lld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ll_div(c1, c2, &er);
- printf("\t/ %lld", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 84 "test-dk4maall.ctr"
-
-
-#line 85 "test-dk4maall.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maall.ctr b/support/dktools/test-dk4maall.ctr
deleted file mode 100644
index a5e657572c..0000000000
--- a/support/dktools/test-dk4maall.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maall.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- long long i1; /* First operand */
- long long i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- long long c1; /* First operand as char */
- long long c2; /* Second operand as char */
- long long c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%lld %lld", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%lld %lld\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_ll_add(c1, c2, &er);
- printf("\t+ %lld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ll_sub(c1, c2, &er);
- printf("\t- %lld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ll_mul(c1, c2, &er);
- printf("\t* %lld", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ll_div(c1, c2, &er);
- printf("\t/ %lld", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maami.c b/support/dktools/test-dk4maami.c
deleted file mode 100644
index dc7bed5797..0000000000
--- a/support/dktools/test-dk4maami.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maami.ctr
-*/
-
-/** @file test-dk4maami.c The test-dk4maami module.
-*/
-
-
-#line 1 "test-dk4maami.ctr"
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maami.h"
-
-
-
-#line 9 "test-dk4maami.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- intmax_t i1; /* First operand */
- intmax_t i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- intmax_t c1; /* First operand as char */
- intmax_t c2; /* Second operand as char */
- intmax_t c3; /* Result as char */
-
-
-
-#line 45 "test-dk4maami.ctr"
-
-
-#line 46 "test-dk4maami.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%jd %jd", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%jd %jd\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_intmax_t_add(c1, c2, &er);
- printf("\t+ %jd", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_intmax_t_sub(c1, c2, &er);
- printf("\t- %jd", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_intmax_t_mul(c1, c2, &er);
- printf("\t* %jd", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_intmax_t_div(c1, c2, &er);
- printf("\t/ %jd", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 84 "test-dk4maami.ctr"
-
-
-#line 85 "test-dk4maami.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maami.ctr b/support/dktools/test-dk4maami.ctr
deleted file mode 100644
index 22431066c6..0000000000
--- a/support/dktools/test-dk4maami.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maami.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- intmax_t i1; /* First operand */
- intmax_t i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- intmax_t c1; /* First operand as char */
- intmax_t c2; /* Second operand as char */
- intmax_t c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%jd %jd", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%jd %jd\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_intmax_t_add(c1, c2, &er);
- printf("\t+ %jd", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_intmax_t_sub(c1, c2, &er);
- printf("\t- %jd", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_intmax_t_mul(c1, c2, &er);
- printf("\t* %jd", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_intmax_t_div(c1, c2, &er);
- printf("\t/ %jd", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maamu.c b/support/dktools/test-dk4maamu.c
deleted file mode 100644
index e5dbca4b57..0000000000
--- a/support/dktools/test-dk4maamu.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maamu.ctr
-*/
-
-/** @file test-dk4maamu.c The test-dk4maamu module.
-*/
-
-
-#line 1 "test-dk4maamu.ctr"
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maamu.h"
-
-
-
-#line 9 "test-dk4maamu.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- uintmax_t i1; /* First operand */
- uintmax_t i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- uintmax_t c1; /* First operand as char */
- uintmax_t c2; /* Second operand as char */
- uintmax_t c3; /* Result as char */
-
-
-
-#line 45 "test-dk4maamu.ctr"
-
-
-#line 46 "test-dk4maamu.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%ju %ju", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%ju %ju\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_uintmax_t_add(c1, c2, &er);
- printf("\t+ %ju", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uintmax_t_sub(c1, c2, &er);
- printf("\t- %ju", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uintmax_t_mul(c1, c2, &er);
- printf("\t* %ju", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uintmax_t_div(c1, c2, &er);
- printf("\t/ %ju", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 84 "test-dk4maamu.ctr"
-
-
-#line 85 "test-dk4maamu.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maamu.ctr b/support/dktools/test-dk4maamu.ctr
deleted file mode 100644
index 1cf58eaaee..0000000000
--- a/support/dktools/test-dk4maamu.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maamu.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- uintmax_t i1; /* First operand */
- uintmax_t i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- uintmax_t c1; /* First operand as char */
- uintmax_t c2; /* Second operand as char */
- uintmax_t c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%ju %ju", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%ju %ju\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_uintmax_t_add(c1, c2, &er);
- printf("\t+ %ju", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uintmax_t_sub(c1, c2, &er);
- printf("\t- %ju", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uintmax_t_mul(c1, c2, &er);
- printf("\t* %ju", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uintmax_t_div(c1, c2, &er);
- printf("\t/ %ju", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maas.c b/support/dktools/test-dk4maas.c
deleted file mode 100644
index 75dbe0c7cc..0000000000
--- a/support/dktools/test-dk4maas.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maas.ctr
-*/
-
-/** @file test-dk4maas.c The test-dk4maas module.
-*/
-
-
-#line 1 "test-dk4maas.ctr"
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maas.h"
-
-
-
-#line 9 "test-dk4maas.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- int i1; /* First operand */
- int i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- short c1; /* First operand as char */
- short c2; /* Second operand as char */
- short c3; /* Result as char */
-
-
-
-#line 45 "test-dk4maas.ctr"
-
-
-#line 46 "test-dk4maas.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%d %d", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%d %d\n", (int)c1, (int)c2);
- dk4error_init(&er);
- c3 = dk4ma_short_add(c1, c2, &er);
- printf("\t+ %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_short_sub(c1, c2, &er);
- printf("\t- %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_short_mul(c1, c2, &er);
- printf("\t* %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_short_div(c1, c2, &er);
- printf("\t/ %d", (int)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 84 "test-dk4maas.ctr"
-
-
-#line 85 "test-dk4maas.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maas.ctr b/support/dktools/test-dk4maas.ctr
deleted file mode 100644
index d402ee251f..0000000000
--- a/support/dktools/test-dk4maas.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maas.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- int i1; /* First operand */
- int i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- short c1; /* First operand as char */
- short c2; /* Second operand as char */
- short c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%d %d", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%d %d\n", (int)c1, (int)c2);
- dk4error_init(&er);
- c3 = dk4ma_short_add(c1, c2, &er);
- printf("\t+ %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_short_sub(c1, c2, &er);
- printf("\t- %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_short_mul(c1, c2, &er);
- printf("\t* %d", (int)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_short_div(c1, c2, &er);
- printf("\t/ %d", (int)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maauc.c b/support/dktools/test-dk4maauc.c
deleted file mode 100644
index 10a22ee782..0000000000
--- a/support/dktools/test-dk4maauc.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maauc.ctr
-*/
-
-/** @file test-dk4maauc.c The test-dk4maauc module.
-*/
-
-
-#line 1 "test-dk4maauc.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maauc.h"
-
-
-
-#line 10 "test-dk4maauc.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %u", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned i1; /* First operand */
- unsigned i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned char c1; /* First operand as char */
- unsigned char c2; /* Second operand as char */
- unsigned char c3; /* Result as char */
-
-
-
-#line 46 "test-dk4maauc.ctr"
-
-
-#line 47 "test-dk4maauc.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%u %u", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%u %u\n", (unsigned)c1, (unsigned)c2);
- dk4error_init(&er);
- c3 = dk4ma_uchar_add(c1, c2, &er);
- printf("\t+ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uchar_sub(c1, c2, &er);
- printf("\t- %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uchar_mul(c1, c2, &er);
- printf("\t* %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uchar_div(c1, c2, &er);
- printf("\t/ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 85 "test-dk4maauc.ctr"
-
-
-#line 86 "test-dk4maauc.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maauc.ctr b/support/dktools/test-dk4maauc.ctr
deleted file mode 100644
index 21ab0f490f..0000000000
--- a/support/dktools/test-dk4maauc.ctr
+++ /dev/null
@@ -1,88 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maauc.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %u", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned i1; /* First operand */
- unsigned i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned char c1; /* First operand as char */
- unsigned char c2; /* Second operand as char */
- unsigned char c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%u %u", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%u %u\n", (unsigned)c1, (unsigned)c2);
- dk4error_init(&er);
- c3 = dk4ma_uchar_add(c1, c2, &er);
- printf("\t+ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uchar_sub(c1, c2, &er);
- printf("\t- %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uchar_mul(c1, c2, &er);
- printf("\t* %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uchar_div(c1, c2, &er);
- printf("\t/ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maaui.c b/support/dktools/test-dk4maaui.c
deleted file mode 100644
index 4f0bb90af5..0000000000
--- a/support/dktools/test-dk4maaui.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maaui.ctr
-*/
-
-/** @file test-dk4maaui.c The test-dk4maaui module.
-*/
-
-
-#line 1 "test-dk4maaui.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maaui.h"
-
-
-
-#line 10 "test-dk4maaui.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %u", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned i1; /* First operand */
- unsigned i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned c1; /* First operand as char */
- unsigned c2; /* Second operand as char */
- unsigned c3; /* Result as char */
-
-
-
-#line 46 "test-dk4maaui.ctr"
-
-
-#line 47 "test-dk4maaui.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%u %u", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%u %u\n", (unsigned)c1, (unsigned)c2);
- dk4error_init(&er);
- c3 = dk4ma_uint_add(c1, c2, &er);
- printf("\t+ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uint_sub(c1, c2, &er);
- printf("\t- %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uint_mul(c1, c2, &er);
- printf("\t* %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uint_div(c1, c2, &er);
- printf("\t/ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 85 "test-dk4maaui.ctr"
-
-
-#line 86 "test-dk4maaui.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maaui.ctr b/support/dktools/test-dk4maaui.ctr
deleted file mode 100644
index bfeb038243..0000000000
--- a/support/dktools/test-dk4maaui.ctr
+++ /dev/null
@@ -1,88 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maaui.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %u", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned i1; /* First operand */
- unsigned i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned c1; /* First operand as char */
- unsigned c2; /* Second operand as char */
- unsigned c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%u %u", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%u %u\n", (unsigned)c1, (unsigned)c2);
- dk4error_init(&er);
- c3 = dk4ma_uint_add(c1, c2, &er);
- printf("\t+ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uint_sub(c1, c2, &er);
- printf("\t- %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uint_mul(c1, c2, &er);
- printf("\t* %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_uint_div(c1, c2, &er);
- printf("\t/ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maaul.c b/support/dktools/test-dk4maaul.c
deleted file mode 100644
index 1b439c5c7c..0000000000
--- a/support/dktools/test-dk4maaul.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maaul.ctr
-*/
-
-/** @file test-dk4maaul.c The test-dk4maaul module.
-*/
-
-
-#line 1 "test-dk4maaul.ctr"
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maaul.h"
-
-
-
-#line 9 "test-dk4maaul.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned long i1; /* First operand */
- unsigned long i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned long c1; /* First operand as char */
- unsigned long c2; /* Second operand as char */
- unsigned long c3; /* Result as char */
-
-
-
-#line 45 "test-dk4maaul.ctr"
-
-
-#line 46 "test-dk4maaul.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%lu %lu", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%lu %lu\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_ulong_add(c1, c2, &er);
- printf("\t+ %lu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ulong_sub(c1, c2, &er);
- printf("\t- %lu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ulong_mul(c1, c2, &er);
- printf("\t* %lu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ulong_div(c1, c2, &er);
- printf("\t/ %lu", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 84 "test-dk4maaul.ctr"
-
-
-#line 85 "test-dk4maaul.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maaul.ctr b/support/dktools/test-dk4maaul.ctr
deleted file mode 100644
index 9f10ab4b3f..0000000000
--- a/support/dktools/test-dk4maaul.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maaul.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned long i1; /* First operand */
- unsigned long i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned long c1; /* First operand as char */
- unsigned long c2; /* Second operand as char */
- unsigned long c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%lu %lu", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%lu %lu\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_ulong_add(c1, c2, &er);
- printf("\t+ %lu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ulong_sub(c1, c2, &er);
- printf("\t- %lu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ulong_mul(c1, c2, &er);
- printf("\t* %lu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ulong_div(c1, c2, &er);
- printf("\t/ %lu", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maaull.c b/support/dktools/test-dk4maaull.c
deleted file mode 100644
index f39c0c3164..0000000000
--- a/support/dktools/test-dk4maaull.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maaull.ctr
-*/
-
-/** @file test-dk4maaull.c The test-dk4maaull module.
-*/
-
-
-#line 1 "test-dk4maaull.ctr"
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maalu.h"
-
-
-
-#line 9 "test-dk4maaull.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned long long i1; /* First operand */
- unsigned long long i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned long long c1; /* First operand as char */
- unsigned long long c2; /* Second operand as char */
- unsigned long long c3; /* Result as char */
-
-
-
-#line 45 "test-dk4maaull.ctr"
-
-
-#line 46 "test-dk4maaull.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%llu %llu", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%llu %llu\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_ull_add(c1, c2, &er);
- printf("\t+ %llu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ull_sub(c1, c2, &er);
- printf("\t- %llu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ull_mul(c1, c2, &er);
- printf("\t* %llu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ull_div(c1, c2, &er);
- printf("\t/ %llu", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 84 "test-dk4maaull.ctr"
-
-
-#line 85 "test-dk4maaull.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maaull.ctr b/support/dktools/test-dk4maaull.ctr
deleted file mode 100644
index 8462992b6e..0000000000
--- a/support/dktools/test-dk4maaull.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maalu.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %d", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned long long i1; /* First operand */
- unsigned long long i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned long long c1; /* First operand as char */
- unsigned long long c2; /* Second operand as char */
- unsigned long long c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%llu %llu", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%llu %llu\n", c1, c2);
- dk4error_init(&er);
- c3 = dk4ma_ull_add(c1, c2, &er);
- printf("\t+ %llu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ull_sub(c1, c2, &er);
- printf("\t- %llu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ull_mul(c1, c2, &er);
- printf("\t* %llu", c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ull_div(c1, c2, &er);
- printf("\t/ %llu", c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maaus.c b/support/dktools/test-dk4maaus.c
deleted file mode 100644
index 91003dd3f8..0000000000
--- a/support/dktools/test-dk4maaus.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maaus.ctr
-*/
-
-/** @file test-dk4maaus.c The test-dk4maaus module.
-*/
-
-
-#line 1 "test-dk4maaus.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maaus.h"
-
-
-
-#line 10 "test-dk4maaus.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %u", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned i1; /* First operand */
- unsigned i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned short c1; /* First operand as char */
- unsigned short c2; /* Second operand as char */
- unsigned short c3; /* Result as char */
-
-
-
-#line 46 "test-dk4maaus.ctr"
-
-
-#line 47 "test-dk4maaus.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%u %u", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%u %u\n", (unsigned)c1, (unsigned)c2);
- dk4error_init(&er);
- c3 = dk4ma_ushort_add(c1, c2, &er);
- printf("\t+ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_sub(c1, c2, &er);
- printf("\t- %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_mul(c1, c2, &er);
- printf("\t* %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_div(c1, c2, &er);
- printf("\t/ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 85 "test-dk4maaus.ctr"
-
-
-#line 86 "test-dk4maaus.ctr"
- return exc;
-}
-
diff --git a/support/dktools/test-dk4maaus.ctr b/support/dktools/test-dk4maaus.ctr
deleted file mode 100644
index d328766b50..0000000000
--- a/support/dktools/test-dk4maaus.ctr
+++ /dev/null
@@ -1,88 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maaus.h"
-
-$!trace-include
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %u", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned i1; /* First operand */
- unsigned i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned short c1; /* First operand as char */
- unsigned short c2; /* Second operand as char */
- unsigned short c3; /* Result as char */
-
- $!trace-init test-dk4maac.deb
- $? "+ main"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%u %u", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%u %u\n", (unsigned)c1, (unsigned)c2);
- dk4error_init(&er);
- c3 = dk4ma_ushort_add(c1, c2, &er);
- printf("\t+ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_sub(c1, c2, &er);
- printf("\t- %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_mul(c1, c2, &er);
- printf("\t* %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_div(c1, c2, &er);
- printf("\t/ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
- $? "- main"
- $!trace-end
- return exc;
-}
-
diff --git a/support/dktools/test-dk4mai8dbl.c b/support/dktools/test-dk4mai8dbl.c
deleted file mode 100644
index 54fd96181e..0000000000
--- a/support/dktools/test-dk4mai8dbl.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4mai8dbl.ctr
-*/
-
-/** @file test-dk4mai8dbl.c The test-dk4mai8dbl module.
-*/
-
-
-#line 1 "test-dk4mai8dbl.ctr"
-
-#include "dk4conf.h"
-#include <stdio.h>
-#include "dk4mai8dbl.h"
-
-
-
-int main(void)
-{
- char buf[256];
- dk4_er_t er;
- double value;
- const char *endp;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4error_init(&er);
- if (0 != dk4ma_input_c8_double(&value, buf, &endp, 1, &er)) {
- printf("Value: %g\n", value);
- } else {
- printf("ERROR: %d\n", er.ec);
- }
- }
- return 0;
-}
diff --git a/support/dktools/test-dk4mai8dbl.ctr b/support/dktools/test-dk4mai8dbl.ctr
deleted file mode 100644
index f8b7e96761..0000000000
--- a/support/dktools/test-dk4mai8dbl.ctr
+++ /dev/null
@@ -1,23 +0,0 @@
-
-#include "dk4conf.h"
-#include <stdio.h>
-#include "dk4mai8dbl.h"
-
-
-
-int main(void)
-{
- char buf[256];
- dk4_er_t er;
- double value;
- const char *endp;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4error_init(&er);
- if (0 != dk4ma_input_c8_double(&value, buf, &endp, 1, &er)) {
- printf("Value: %g\n", value);
- } else {
- printf("ERROR: %d\n", er.ec);
- }
- }
- return 0;
-}
diff --git a/support/dktools/test-dk4mai8ddi.c b/support/dktools/test-dk4mai8ddi.c
deleted file mode 100644
index c3c20a99ac..0000000000
--- a/support/dktools/test-dk4mai8ddi.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4mai8ddi.ctr
-*/
-
-/** @file test-dk4mai8ddi.c The test-dk4mai8ddi module.
-*/
-
-
-#line 1 "test-dk4mai8ddi.ctr"
-
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4str8.h"
-#include "dk4mao8d.h"
-#include "dk4mai8ddi.h"
-
-
-
-int main(void)
-{
- char buf[128];
- char oub[128];
- dk4_er_t er;
- const char *endptr = NULL;
- dk4_im_t um;
- int res;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4str8_normalize(buf, NULL);
- dk4error_init(&er);
- res = dk4ma_input_c8_dec_dk4_im_t(&um, buf, &endptr, 1, &er);
- if (0 != res) {
- if (dk4ma_write_c8_decimal_signed(oub, sizeof(oub), um, 0, &er)) {
- printf("Zahl gelesen: ");
- fputs(oub, stdout);
- printf("\n");
- } else {
- printf("Fehler beim String-Erzeugen!\n");
- }
- } else {
- printf("Fehler beim Einlesen: %d\n", er.ec);
- printf("Fehlerstelle: \"%s\"\n", (endptr ? endptr : "(NULL)"));
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4mai8ddi.ctr b/support/dktools/test-dk4mai8ddi.ctr
deleted file mode 100644
index 027765c2de..0000000000
--- a/support/dktools/test-dk4mai8ddi.ctr
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4str8.h"
-#include "dk4mao8d.h"
-#include "dk4mai8ddi.h"
-
-
-
-int main(void)
-{
- char buf[128];
- char oub[128];
- dk4_er_t er;
- const char *endptr = NULL;
- dk4_im_t um;
- int res;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4str8_normalize(buf, NULL);
- dk4error_init(&er);
- res = dk4ma_input_c8_dec_dk4_im_t(&um, buf, &endptr, 1, &er);
- if (0 != res) {
- if (dk4ma_write_c8_decimal_signed(oub, sizeof(oub), um, 0, &er)) {
- printf("Zahl gelesen: ");
- fputs(oub, stdout);
- printf("\n");
- } else {
- printf("Fehler beim String-Erzeugen!\n");
- }
- } else {
- printf("Fehler beim Einlesen: %d\n", er.ec);
- printf("Fehlerstelle: \"%s\"\n", (endptr ? endptr : "(NULL)"));
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4mai8ddu.c b/support/dktools/test-dk4mai8ddu.c
deleted file mode 100644
index 11c56c7025..0000000000
--- a/support/dktools/test-dk4mai8ddu.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4mai8ddu.ctr
-*/
-
-/** @file test-dk4mai8ddu.c The test-dk4mai8ddu module.
-*/
-
-
-#line 1 "test-dk4mai8ddu.ctr"
-
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4str8.h"
-#include "dk4mao8d.h"
-#include "dk4mai8ddu.h"
-
-
-
-int main(void)
-{
- char buf[128];
- char oub[128];
- dk4_er_t er;
- const char *endptr = NULL;
- dk4_um_t um;
- int res;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4str8_normalize(buf, NULL);
- dk4error_init(&er);
- res = dk4ma_input_c8_dec_dk4_um_t(&um, buf, &endptr, 1, &er);
- if (0 != res) {
- if (dk4ma_write_c8_decimal_unsigned(oub, sizeof(oub), um, 0, &er)) {
- printf("Zahl gelesen: ");
- fputs(oub, stdout);
- printf("\n");
- } else {
- printf("Fehler beim String-Erzeugen!\n");
- }
- } else {
- printf("Fehler beim Einlesen: %d\n", er.ec);
- printf("Fehlerstelle: \"%s\"\n", (endptr ? endptr : "(NULL)"));
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4mai8ddu.ctr b/support/dktools/test-dk4mai8ddu.ctr
deleted file mode 100644
index 8f66f785a2..0000000000
--- a/support/dktools/test-dk4mai8ddu.ctr
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4str8.h"
-#include "dk4mao8d.h"
-#include "dk4mai8ddu.h"
-
-
-
-int main(void)
-{
- char buf[128];
- char oub[128];
- dk4_er_t er;
- const char *endptr = NULL;
- dk4_um_t um;
- int res;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4str8_normalize(buf, NULL);
- dk4error_init(&er);
- res = dk4ma_input_c8_dec_dk4_um_t(&um, buf, &endptr, 1, &er);
- if (0 != res) {
- if (dk4ma_write_c8_decimal_unsigned(oub, sizeof(oub), um, 0, &er)) {
- printf("Zahl gelesen: ");
- fputs(oub, stdout);
- printf("\n");
- } else {
- printf("Fehler beim String-Erzeugen!\n");
- }
- } else {
- printf("Fehler beim Einlesen: %d\n", er.ec);
- printf("Fehlerstelle: \"%s\"\n", (endptr ? endptr : "(NULL)"));
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4mai8dsz.c b/support/dktools/test-dk4mai8dsz.c
deleted file mode 100644
index b0a492683f..0000000000
--- a/support/dktools/test-dk4mai8dsz.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4mai8dsz.ctr
-*/
-
-/** @file test-dk4mai8dsz.c The test-dk4mai8dsz module.
-*/
-
-
-#line 1 "test-dk4mai8dsz.ctr"
-
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4str8.h"
-#include "dk4mao8d.h"
-#include "dk4mai8dsz.h"
-
-
-
-int main(void)
-{
- char buf[128];
- char oub[128];
- dk4_er_t er;
- const char *endptr = NULL;
- size_t um;
- int res;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4str8_normalize(buf, NULL);
- dk4error_init(&er);
- res = dk4ma_input_c8_dec_size_t(&um, buf, &endptr, 1, &er);
- if (0 != res) {
- if (dk4ma_write_c8_decimal_unsigned(oub,sizeof(oub),(dk4_um_t)um,0,&er)) {
- printf("Zahl gelesen: ");
- fputs(oub, stdout);
- printf("\n");
- } else {
- printf("Fehler beim String-Erzeugen!\n");
- }
- } else {
- printf("Fehler beim Einlesen: %d\n", er.ec);
- printf("Fehlerstelle: \"%s\"\n", (endptr ? endptr : "(NULL)"));
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4mai8dsz.ctr b/support/dktools/test-dk4mai8dsz.ctr
deleted file mode 100644
index 4cee4ab620..0000000000
--- a/support/dktools/test-dk4mai8dsz.ctr
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4str8.h"
-#include "dk4mao8d.h"
-#include "dk4mai8dsz.h"
-
-
-
-int main(void)
-{
- char buf[128];
- char oub[128];
- dk4_er_t er;
- const char *endptr = NULL;
- size_t um;
- int res;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4str8_normalize(buf, NULL);
- dk4error_init(&er);
- res = dk4ma_input_c8_dec_size_t(&um, buf, &endptr, 1, &er);
- if (0 != res) {
- if (dk4ma_write_c8_decimal_unsigned(oub,sizeof(oub),(dk4_um_t)um,0,&er)) {
- printf("Zahl gelesen: ");
- fputs(oub, stdout);
- printf("\n");
- } else {
- printf("Fehler beim String-Erzeugen!\n");
- }
- } else {
- printf("Fehler beim Einlesen: %d\n", er.ec);
- printf("Fehlerstelle: \"%s\"\n", (endptr ? endptr : "(NULL)"));
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4mai8sz.c b/support/dktools/test-dk4mai8sz.c
deleted file mode 100644
index 326aa9a12e..0000000000
--- a/support/dktools/test-dk4mai8sz.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4mai8sz.ctr
-*/
-
-/** @file test-dk4mai8sz.c The test-dk4mai8sz module.
-*/
-
-
-#line 1 "test-dk4mai8sz.ctr"
-
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4str8.h"
-#include "dk4mao8d.h"
-#include "dk4mai8dsz.h"
-
-
-
-int main(void)
-{
- char buf[128];
- char oub[128];
- dk4_er_t er;
- char *endptr = NULL;
- size_t um;
- int res;
- while(fgets(buf, sizeof(buf), stdin)) {
- dk4str8_normalize(buf, NULL);
- dk4error_init(&er);
- res = dk4ma_input_c8_dec_size_t(&um, buf, &endptr, 1, &er);
- if (0 != res) {
- if (dk4ma_write_c8_decimal_unsigned(oub, sizeof(oub), (dk4_um_t)um, &er)) {
- printf("Zahl gelesen: ");
- fputs(oub, stdout);
- printf("\n");
- } else {
- printf("Fehler beim String-Erzeugen!\n");
- }
- } else {
- printf("Fehler beim Einlesen: %d\n", er.ec);
- printf("Fehlerstelle: \"%s\"\n", (endptr ? endptr : "(NULL)"));
- }
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4numl.c b/support/dktools/test-dk4numl.c
deleted file mode 100644
index fdd0165477..0000000000
--- a/support/dktools/test-dk4numl.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4numl.ctr
-*/
-
-/** @file test-dk4numl.c The test-dk4numl module.
-*/
-
-
-#line 1 "test-dk4numl.ctr"
-
-#include <stdio.h>
-
-#include "dk4numl.h"
-
-static const size_t sizes[] = {
- 1, 2, 4, 8, 16, 32, 64, 65, 128, 256
-};
-static const size_t sz_sizes = sizeof(sizes)/sizeof(size_t);
-
-int main(void)
-{
- size_t i;
-
- for (i = 0; i < sz_sizes; i++) {
- printf("Bytes: %u Unsigned: %u Signed: %u\n",
- (unsigned)sizes[i],
- (unsigned)dk4numlength(sizes[i], 0),
- (unsigned)dk4numlength(sizes[i], 1)
- );
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4numl.ctr b/support/dktools/test-dk4numl.ctr
deleted file mode 100644
index 8d66df1ffc..0000000000
--- a/support/dktools/test-dk4numl.ctr
+++ /dev/null
@@ -1,24 +0,0 @@
-
-#include <stdio.h>
-
-#include "dk4numl.h"
-
-static const size_t sizes[] = {
- 1, 2, 4, 8, 16, 32, 64, 65, 128, 256
-};
-static const size_t sz_sizes = sizeof(sizes)/sizeof(size_t);
-
-int main(void)
-{
- size_t i;
-
- for (i = 0; i < sz_sizes; i++) {
- printf("Bytes: %u Unsigned: %u Signed: %u\n",
- (unsigned)sizes[i],
- (unsigned)dk4numlength(sizes[i], 0),
- (unsigned)dk4numlength(sizes[i], 1)
- );
- }
- return 0;
-}
-
diff --git a/support/dktools/test-dk4path8.c b/support/dktools/test-dk4path8.c
deleted file mode 100644
index 2770be8f70..0000000000
--- a/support/dktools/test-dk4path8.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4path8.ctr
-*/
-
-/** @file test-dk4path8.c The test-dk4path8 module.
-*/
-
-
-#line 1 "test-dk4path8.ctr"
-
-#include <stdio.h>
-
-#include "dk4path8.h"
-#include "string.h"
-
-static const char * const p1[] = {
-"/usr/local",
-"my/file"
-};
-
-static const char * const p2[] = {
-"../erwin.txt",
-"../../bla.blubb",
-"../../../test.was.passiert",
-"ganz-langer-test-was-nun-wohl-passiert"
-};
-
-int main(void)
-{
- char buf[256];
- dk4_er_t er;
- const size_t szp1 = sizeof(p1)/sizeof(DK4_PCHAR);
- const size_t szp2 = sizeof(p2)/sizeof(DK4_PCHAR);
- size_t i;
- size_t j;
-
- for (i = 0; i < szp1; i++) {
- for (j = 0; j < szp2; j++) {
- strcpy(buf, p1[i]);
- dk4error_init(&er);
- if (dk4path8_append(buf, sizeof(buf), p2[j], &er)) {
- printf("%u %u = \"%s\"\n", (unsigned)i, (unsigned)j, buf);
- } else {
- printf("%u %u ERROR %d\n", (unsigned)i, (unsigned)j, er.ec);
- }
- }
- }
- return 0;
-}
-
-
diff --git a/support/dktools/test-dk4path8.ctr b/support/dktools/test-dk4path8.ctr
deleted file mode 100644
index 788aa705dd..0000000000
--- a/support/dktools/test-dk4path8.ctr
+++ /dev/null
@@ -1,42 +0,0 @@
-
-#include <stdio.h>
-
-#include "dk4path8.h"
-#include "string.h"
-
-static const char * const p1[] = {
-"/usr/local",
-"my/file"
-};
-
-static const char * const p2[] = {
-"../erwin.txt",
-"../../bla.blubb",
-"../../../test.was.passiert",
-"ganz-langer-test-was-nun-wohl-passiert"
-};
-
-int main(void)
-{
- char buf[256];
- dk4_er_t er;
- const size_t szp1 = sizeof(p1)/sizeof(DK4_PCHAR);
- const size_t szp2 = sizeof(p2)/sizeof(DK4_PCHAR);
- size_t i;
- size_t j;
-
- for (i = 0; i < szp1; i++) {
- for (j = 0; j < szp2; j++) {
- strcpy(buf, p1[i]);
- dk4error_init(&er);
- if (dk4path8_append(buf, sizeof(buf), p2[j], &er)) {
- printf("%u %u = \"%s\"\n", (unsigned)i, (unsigned)j, buf);
- } else {
- printf("%u %u ERROR %d\n", (unsigned)i, (unsigned)j, er.ec);
- }
- }
- }
- return 0;
-}
-
-
diff --git a/support/dktools/test-dk4str8.c b/support/dktools/test-dk4str8.c
deleted file mode 100644
index 05e48be6e3..0000000000
--- a/support/dktools/test-dk4str8.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4str8.ctr
-*/
-
-/** @file test-dk4str8.c The test-dk4str8 module.
-*/
-
-
-#line 1 "test-dk4str8.ctr"
-
-
-#include "dk4conf.h"
-#include "dk4types.h"
-
-#include <stdio.h>
-
-#include "dk4mem.h"
-#include "dk4error.h"
-#include "dk4str8.h"
-
-
-int main(void)
-{
- char buffer[256];
- char *p1;
- char *p2;
-
-
-#line 19 "test-dk4str8.ctr"
-
-
-#line 20 "test-dk4str8.ctr"
- while(NULL != fgets(buffer, sizeof(buffer), stdin)) {
- dk4str8_normalize(buffer, NULL);
- p1 = dk4str8_start(buffer, NULL);
- if (NULL != p1) {
- p2 = dk4str8_next(p1, NULL);
- if (NULL != p2) {
- printf("p1 = \"%s\"\n", p1);
- printf("p2 = \"%s\"\n", p2);
- if (dk4str8_is_abbr(p1, p2, '$', 1)) {
- printf("yes\n");
- } else {
- printf("no\n");
- }
- }
- }
- }
-
-
-#line 37 "test-dk4str8.ctr"
-
-
-#line 38 "test-dk4str8.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-dk4str8.ctr b/support/dktools/test-dk4str8.ctr
deleted file mode 100644
index 9d22ae90f7..0000000000
--- a/support/dktools/test-dk4str8.ctr
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-#include "dk4conf.h"
-#include "dk4types.h"
-
-#include <stdio.h>
-
-#include "dk4mem.h"
-#include "dk4error.h"
-#include "dk4str8.h"
-
-
-int main(void)
-{
- char buffer[256];
- char *p1;
- char *p2;
- $!trace-init test-dk4str8.deb
- $? "+ main"
- while(NULL != fgets(buffer, sizeof(buffer), stdin)) {
- dk4str8_normalize(buffer, NULL);
- p1 = dk4str8_start(buffer, NULL);
- if (NULL != p1) {
- p2 = dk4str8_next(p1, NULL);
- if (NULL != p2) {
- printf("p1 = \"%s\"\n", p1);
- printf("p2 = \"%s\"\n", p2);
- if (dk4str8_is_abbr(p1, p2, '$', 1)) {
- printf("yes\n");
- } else {
- printf("no\n");
- }
- }
- }
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-dk4strm.c b/support/dktools/test-dk4strm.c
deleted file mode 100644
index f817411606..0000000000
--- a/support/dktools/test-dk4strm.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4strm.ctr
-*/
-
-/** @file test-dk4strm.c The test-dk4strm module.
-*/
-
-
-#line 1 "test-dk4strm.ctr"
-
-#include "dk4strm.h"
-#include "dk4strmf.h"
-#include "dk4fopc8.h"
-#include <stdio.h>
-
-
-
-
-
-#line 10 "test-dk4strm.ctr"
-
-
-
-
-int main(int argc, char *argv[])
-{
- FILE *fipo;
- dk4_stream_t *outstrm;
- dk4_stream_t *instrm;
- dk4_er_t er;
- char c;
-
-
-#line 22 "test-dk4strm.ctr"
-
-
-#line 23 "test-dk4strm.ctr"
- if (1 < argc) {
- dk4error_init(&er);
- fipo = dk4fopen_c8(argv[1], "w", 0, &er);
- if (NULL != fipo) {
- dk4error_init(&er);
- instrm = dk4stream_open_for_file(stdin, DK4_STREAM_READ, 4096, 0, &er);
- if (NULL != instrm) {
- outstrm = dk4stream_open_for_file(fipo, DK4_STREAM_WRITE, 0, 4096, &er);
- if (NULL != outstrm) {
- while (dk4stream_c8_read_byte(&c, instrm, &er)) {
- dk4stream_write_byte(outstrm, (char)c, &er);
- }
- (void)dk4stream_close(outstrm, &er);
- }
- (void)dk4stream_close(instrm, &er);
- }
- fclose(fipo);
- } else {
- fprintf(stderr, "Failed to open file %d %d\n", er.ec, er.dt.iDetails1);
- }
- } else {
- dk4error_init(&er);
- instrm = dk4stream_open_for_file(stdin, DK4_STREAM_READ, 4096, 0, &er);
- if (NULL != instrm) {
-
-#line 47 "test-dk4strm.ctr"
- outstrm = dk4stream_open_for_file(stdout, DK4_STREAM_WRITE, 0, 4096, &er);
- if (NULL != outstrm) {
-
-#line 49 "test-dk4strm.ctr"
- while (dk4stream_c8_read_byte(&c, instrm, &er)) {
- dk4stream_write_byte(outstrm, (char)c, &er);
- }
- dk4stream_close(outstrm, &er);
- }
- dk4stream_close(instrm, &er);
- }
- }
-
-
-#line 58 "test-dk4strm.ctr"
-
-
-#line 59 "test-dk4strm.ctr"
- fprintf(stderr, "Error code: %d\n", er.ec);
- return 0;
-}
-
-
diff --git a/support/dktools/test-dk4strm.ctr b/support/dktools/test-dk4strm.ctr
deleted file mode 100644
index e269597891..0000000000
--- a/support/dktools/test-dk4strm.ctr
+++ /dev/null
@@ -1,63 +0,0 @@
-
-#include "dk4strm.h"
-#include "dk4strmf.h"
-#include "dk4fopc8.h"
-#include <stdio.h>
-
-
-
-$!trace-include
-
-
-
-
-int main(int argc, char *argv[])
-{
- FILE *fipo;
- dk4_stream_t *outstrm;
- dk4_stream_t *instrm;
- dk4_er_t er;
- char c;
- $!trace-init "test-dk4strm.deb"
- $? "+ main"
- if (1 < argc) {
- dk4error_init(&er);
- fipo = dk4fopen_c8(argv[1], "w", 0, &er);
- if (NULL != fipo) {
- dk4error_init(&er);
- instrm = dk4stream_open_for_file(stdin, DK4_STREAM_READ, 4096, 0, &er);
- if (NULL != instrm) {
- outstrm = dk4stream_open_for_file(fipo, DK4_STREAM_WRITE, 0, 4096, &er);
- if (NULL != outstrm) {
- while (dk4stream_c8_read_byte(&c, instrm, &er)) {
- dk4stream_write_byte(outstrm, (char)c, &er);
- }
- (void)dk4stream_close(outstrm, &er);
- }
- (void)dk4stream_close(instrm, &er);
- }
- fclose(fipo);
- } else {
- fprintf(stderr, "Failed to open file %d %d\n", er.ec, er.dt.iDetails1);
- }
- } else {
- dk4error_init(&er);
- instrm = dk4stream_open_for_file(stdin, DK4_STREAM_READ, 4096, 0, &er);
- if (NULL != instrm) { $? ". instream ok"
- outstrm = dk4stream_open_for_file(stdout, DK4_STREAM_WRITE, 0, 4096, &er);
- if (NULL != outstrm) { $? ". outstream ok"
- while (dk4stream_c8_read_byte(&c, instrm, &er)) {
- dk4stream_write_byte(outstrm, (char)c, &er);
- }
- dk4stream_close(outstrm, &er);
- }
- dk4stream_close(instrm, &er);
- }
- }
- $? "- main"
- $!trace-end
- fprintf(stderr, "Error code: %d\n", er.ec);
- return 0;
-}
-
-
diff --git a/support/dktools/test-dk4strmco.c b/support/dktools/test-dk4strmco.c
deleted file mode 100644
index fb89b49fd4..0000000000
--- a/support/dktools/test-dk4strmco.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4strmco.ctr
-*/
-
-/** @file test-dk4strmco.c The test-dk4strmco module.
-*/
-
-
-#line 1 "test-dk4strmco.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4strmf.h"
-#include "dk4strmco.h"
-
-
-
-
-
-#line 12 "test-dk4strmco.ctr"
-
-
-
-int main(void)
-{
- char buf[4096];
- dk4_stream_t *fstrm = NULL;
- dk4_stream_t *cstrm = NULL;
- size_t szbuf = sizeof(buf);
- size_t br;
- int res;
-
-
-#line 24 "test-dk4strmco.ctr"
-
-
-#line 25 "test-dk4strmco.ctr"
- fstrm = dk4stream_open_for_file(
- stdout, DK4_STREAM_WRITE, 0, 4096, NULL
- );
- if (NULL == fstrm) {
- fputs("ERROR: Failed to open stream for stdout!\n", stderr);
- fflush(stderr);
- goto finished;
- }
-
- cstrm = dk4strmco_open(
- fstrm,
- DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_FLATE, DK4_STRMCO_OE_ASCII85,
- (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
- NULL
- );
- if (NULL == cstrm) {
- fputs("ERROR: Failed to open compressing stream!\n", stderr);
- fflush(stderr);
- goto finished;
- }
-
- do {
- br = fread(buf, 1, szbuf, stdin);
- if (0 < br) {
- res = dk4stream_write(cstrm, buf, br, NULL);
- if (0 == res) {
- fputs("ERROR: Write operation failed!\n", stderr);
- fflush(stderr);
- }
- }
- } while ((!feof(stdin)) && (0 < br));
-
- finished:
- if (NULL != cstrm) {
- res = dk4stream_close(cstrm, NULL);
- if (0 == res) {
- fputs("ERROR: Failed to close compressed stream!\n", stderr);
- fflush(stderr);
- }
- }
- if (NULL != fstrm) {
- res = dk4stream_close(fstrm, NULL);
- if (0 == res) {
- fputs("ERROR: Failed to close file stream!\n", stderr);
- fflush(stderr);
- }
- }
-
-
-#line 73 "test-dk4strmco.ctr"
-
-
-#line 74 "test-dk4strmco.ctr"
- return 0;
-}
-
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/test-dk4strmco.ctr b/support/dktools/test-dk4strmco.ctr
deleted file mode 100644
index 4f2e20855e..0000000000
--- a/support/dktools/test-dk4strmco.ctr
+++ /dev/null
@@ -1,79 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4strmf.h"
-#include "dk4strmco.h"
-
-
-
-$!trace-include
-
-
-
-int main(void)
-{
- char buf[4096];
- dk4_stream_t *fstrm = NULL;
- dk4_stream_t *cstrm = NULL;
- size_t szbuf = sizeof(buf);
- size_t br;
- int res;
- $!trace-init test-dk4strmco.deb
- $? "+ main"
- fstrm = dk4stream_open_for_file(
- stdout, DK4_STREAM_WRITE, 0, 4096, NULL
- );
- if (NULL == fstrm) {
- fputs("ERROR: Failed to open stream for stdout!\n", stderr);
- fflush(stderr);
- goto finished;
- }
-
- cstrm = dk4strmco_open(
- fstrm,
- DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_FLATE, DK4_STRMCO_OE_ASCII85,
- (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE),
- NULL
- );
- if (NULL == cstrm) {
- fputs("ERROR: Failed to open compressing stream!\n", stderr);
- fflush(stderr);
- goto finished;
- }
-
- do {
- br = fread(buf, 1, szbuf, stdin);
- if (0 < br) {
- res = dk4stream_write(cstrm, buf, br, NULL);
- if (0 == res) {
- fputs("ERROR: Write operation failed!\n", stderr);
- fflush(stderr);
- }
- }
- } while ((!feof(stdin)) && (0 < br));
-
- finished:
- if (NULL != cstrm) {
- res = dk4stream_close(cstrm, NULL);
- if (0 == res) {
- fputs("ERROR: Failed to close compressed stream!\n", stderr);
- fflush(stderr);
- }
- }
- if (NULL != fstrm) {
- res = dk4stream_close(fstrm, NULL);
- if (0 == res) {
- fputs("ERROR: Failed to close file stream!\n", stderr);
- fflush(stderr);
- }
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/test-dk4time.c b/support/dktools/test-dk4time.c
deleted file mode 100644
index 209a96c4a1..0000000000
--- a/support/dktools/test-dk4time.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4time.ctr
-*/
-
-/** @file test-dk4time.c The test-dk4time module.
-*/
-
-
-#line 1 "test-dk4time.ctr"
-
-#include <stdio.h>
-
-#include "dk4conf.h"
-#include "dk4time.h"
-
-
-
-int main(void)
-{
- char buffer[64];
- dk4_time_t timer;
-
- dk4time_get(&timer);
- if (dk4time_as_text(buffer, sizeof(buffer), &timer, NULL)) {
- fputs(buffer, stdout);
- fputc('\n', stdout);
- }
- return 0;
-}
diff --git a/support/dktools/test-dk4time.ctr b/support/dktools/test-dk4time.ctr
deleted file mode 100644
index cf184ac23b..0000000000
--- a/support/dktools/test-dk4time.ctr
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#include <stdio.h>
-
-#include "dk4conf.h"
-#include "dk4time.h"
-
-
-
-int main(void)
-{
- char buffer[64];
- dk4_time_t timer;
-
- dk4time_get(&timer);
- if (dk4time_as_text(buffer, sizeof(buffer), &timer, NULL)) {
- fputs(buffer, stdout);
- fputc('\n', stdout);
- }
- return 0;
-}
diff --git a/support/dktools/test-dk4time08.c b/support/dktools/test-dk4time08.c
deleted file mode 100644
index d9ef9a1510..0000000000
--- a/support/dktools/test-dk4time08.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4time08.ctr
-*/
-
-/** @file test-dk4time08.c The test-dk4time08 module.
-*/
-
-
-#line 1 "test-dk4time08.ctr"
-
-#include <stdio.h>
-#include "dk4time08.h"
-
-int main(int argc, char *argv[])
-{
- char buffer[64];
- int res;
- res = dk4time_to_text_c8(
- buffer, sizeof(buffer), DK4_TIMEFORMAT_DATE_GERMAN,
- 2015, 1, 25, 14, 10, 35, NULL
- );
- if (0 != res) {
- fputs(buffer, stdout);
- fputc('\n', stdout);
- }
- return 0;
-}
-
-
diff --git a/support/dktools/test-dk4time08.ctr b/support/dktools/test-dk4time08.ctr
deleted file mode 100644
index 7dbe20ee6a..0000000000
--- a/support/dktools/test-dk4time08.ctr
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#include <stdio.h>
-#include "dk4time08.h"
-
-int main(int argc, char *argv[])
-{
- char buffer[64];
- int res;
- res = dk4time_to_text_c8(
- buffer, sizeof(buffer), DK4_TIMEFORMAT_DATE_GERMAN,
- 2015, 1, 25, 14, 10, 35, NULL
- );
- if (0 != res) {
- fputs(buffer, stdout);
- fputc('\n', stdout);
- }
- return 0;
-}
-
-
diff --git a/support/dktools/test-dk4tsp08.c b/support/dktools/test-dk4tsp08.c
deleted file mode 100644
index 3dec48053f..0000000000
--- a/support/dktools/test-dk4tsp08.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4tsp08.ctr
-*/
-
-/** @file test-dk4tsp08.c The test-dk4tsp08 module.
-*/
-
-
-#line 1 "test-dk4tsp08.ctr"
-
-#include "dk4conf.h"
-#include "dk4enc.h"
-#include "dk4tsp08.h"
-#include "dk4strm.h"
-#include "dk4strmf.h"
-#include "dk4strmo32.h"
-#include "dk4ansi.h"
-#include <string.h>
-
-
-
-
-#line 13 "test-dk4tsp08.ctr"
-
-
-
-#define LINE_VERSION 1
-
-
-/** Buffer for input from file.
-*/
-static char fbuf[4096];
-
-
-#if LINE_VERSION
-static char lbuf[4096];
-#endif
-
-
-#if LINE_VERSION
-int
-line_handler(void *obj, char *line, dk4_um_t lineno, dk4_er_t *erp)
-{
- size_t sz;
- int back = DK4_TSP_RES_ERROR;
- sz = strlen(line);
- if (0 < sz) {
- if (0 != dk4stream_write( (dk4_stream_t *)obj, line, sz, erp)) {
- back = DK4_TSP_RES_OK;
- }
- } else {
- back = DK4_TSP_RES_OK;
- }
- return back;
-}
-#else
-int
-char_handler(void *obj, char c, dk4_text_stream_position_t *pos, dk4_er_t *erp)
-{
- dk4_c32_t c32;
- int back = DK4_TSP_RES_ERROR;
- if (dk4ansi_decode(&c32, (unsigned char)c)) {
- if (dk4stream_c32_putc((dk4_stream_t *)obj, c32, erp)) {
- back = DK4_TSP_RES_OK;
- }
- }
- return back;
-}
-#endif
-
-
-
-int main(void)
-{
- dk4_tsp08_t tsp; /* Text stream processor. */
- dk4_er_t er; /* Error report */
- dk4_stream_t *outstream; /* Output stream */
- size_t nread; /* Number of bytes read */
-#if DK4_ON_WINDOWS
- int oldmode; /* Output text or binary mode */
- int oldinmode; /* Input text or binary mode */
-#endif
- int res; /* Result for text stream processing */
- int oldres; /* Previous result */
- int cc; /* Flag: Can continue */
-
-
-#line 76 "test-dk4tsp08.ctr"
-
-
-#line 77 "test-dk4tsp08.ctr"
-#if DK4_ON_WINDOWS
- oldmode = _setmode(_fileno(stdout), _O_BINARY);
- oldinmode = _setmode(_fileno(stdin), _O_BINARY);
-#endif
- dk4error_init(&er);
- outstream = dk4stream_open_for_file( stdout, DK4_STREAM_WRITE, 0, 0, &er);
- if (NULL != outstream) {
- dk4stream_set_output_encoding(outstream, DK4_FILE_ENCODING_ASCII);
-#if 1
- (void)dk4stream_write_bom_if_necessary(outstream, NULL);
-#endif
-#if LINE_VERSION
- res = dk4tsp08_setup_line(
- &tsp, (void *)outstream, line_handler, lbuf, sizeof(lbuf),
- DK4_ENCODING_ASCII, DK4_ENCODING_UTF8, &er
- );
-#else
- res = dk4tsp08_setup_char(
- &tsp, (void *)outstream, char_handler,
- DK4_ENCODING_UTF8, DK4_ENCODING_UTF8, &er
- );
-#endif
- if (DK4_TSP_RES_OK == res) {
- oldres = DK4_TSP_RES_OK;
- cc = 1;
- while (1 == cc) {
- nread = fread(fbuf, 1, sizeof(fbuf), stdin);
- if (0 < nread) {
- res = dk4tsp08_add_bytes(&tsp, (unsigned char *)fbuf, nread);
- switch (res) {
- case DK4_TSP_RES_OK: {
- } break;
- case DK4_TSP_RES_ERROR: {
- if (DK4_TSP_RES_OK == oldres) {
- oldres = DK4_TSP_RES_ERROR;
-
-
-#line 113 "test-dk4tsp08.ctr"
- }
- } break;
- case DK4_TSP_RES_FATAL: {
- if (DK4_TSP_RES_FATAL != oldres) {
- oldres = DK4_TSP_RES_FATAL;
-
-
-#line 119 "test-dk4tsp08.ctr"
- }
- } break;
- }
- } else {
- cc = 0;
- }
- }
- res = dk4tsp08_finish(&tsp);
- switch (res) {
- case DK4_TSP_RES_OK: {
- } break;
- case DK4_TSP_RES_ERROR: {
- if (DK4_TSP_RES_OK == oldres) {
- oldres = DK4_TSP_RES_ERROR;
-
-
-#line 134 "test-dk4tsp08.ctr"
- }
- } break;
- case DK4_TSP_RES_FATAL: {
- if (DK4_TSP_RES_FATAL != oldres) {
- oldres = DK4_TSP_RES_FATAL;
-
-
-#line 140 "test-dk4tsp08.ctr"
- }
- } break;
- }
- } else {
-
-#line 144 "test-dk4tsp08.ctr"
- }
- dk4stream_close(outstream, NULL);
- } else {
-
-#line 147 "test-dk4tsp08.ctr"
- }
- fflush(stdout);
-#if DK4_ON_WINDOWS
- _setmode(_fileno(stdin), oldinmode);
- _setmode(_fileno(stdout), oldmode);
-#endif
-
-
-#line 154 "test-dk4tsp08.ctr"
-
-
-#line 155 "test-dk4tsp08.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-dk4tsp08.ctr b/support/dktools/test-dk4tsp08.ctr
deleted file mode 100644
index 91a7233c36..0000000000
--- a/support/dktools/test-dk4tsp08.ctr
+++ /dev/null
@@ -1,157 +0,0 @@
-
-#include "dk4conf.h"
-#include "dk4enc.h"
-#include "dk4tsp08.h"
-#include "dk4strm.h"
-#include "dk4strmf.h"
-#include "dk4strmo32.h"
-#include "dk4ansi.h"
-#include <string.h>
-
-
-$!trace-include
-
-
-
-#define LINE_VERSION 1
-
-
-/** Buffer for input from file.
-*/
-static char fbuf[4096];
-
-
-#if LINE_VERSION
-static char lbuf[4096];
-#endif
-
-
-#if LINE_VERSION
-int
-line_handler(void *obj, char *line, dk4_um_t lineno, dk4_er_t *erp)
-{
- size_t sz;
- int back = DK4_TSP_RES_ERROR;
- sz = strlen(line);
- if (0 < sz) {
- if (0 != dk4stream_write( (dk4_stream_t *)obj, line, sz, erp)) {
- back = DK4_TSP_RES_OK;
- }
- } else {
- back = DK4_TSP_RES_OK;
- }
- return back;
-}
-#else
-int
-char_handler(void *obj, char c, dk4_text_stream_position_t *pos, dk4_er_t *erp)
-{
- dk4_c32_t c32;
- int back = DK4_TSP_RES_ERROR;
- if (dk4ansi_decode(&c32, (unsigned char)c)) {
- if (dk4stream_c32_putc((dk4_stream_t *)obj, c32, erp)) {
- back = DK4_TSP_RES_OK;
- }
- }
- return back;
-}
-#endif
-
-
-
-int main(void)
-{
- dk4_tsp08_t tsp; /* Text stream processor. */
- dk4_er_t er; /* Error report */
- dk4_stream_t *outstream; /* Output stream */
- size_t nread; /* Number of bytes read */
-#if DK4_ON_WINDOWS
- int oldmode; /* Output text or binary mode */
- int oldinmode; /* Input text or binary mode */
-#endif
- int res; /* Result for text stream processing */
- int oldres; /* Previous result */
- int cc; /* Flag: Can continue */
- $!trace-init test-dk4tsp08.deb
- $? "+ main"
-#if DK4_ON_WINDOWS
- oldmode = _setmode(_fileno(stdout), _O_BINARY);
- oldinmode = _setmode(_fileno(stdin), _O_BINARY);
-#endif
- dk4error_init(&er);
- outstream = dk4stream_open_for_file( stdout, DK4_STREAM_WRITE, 0, 0, &er);
- if (NULL != outstream) {
- dk4stream_set_output_encoding(outstream, DK4_FILE_ENCODING_ASCII);
-#if 1
- (void)dk4stream_write_bom_if_necessary(outstream, NULL);
-#endif
-#if LINE_VERSION
- res = dk4tsp08_setup_line(
- &tsp, (void *)outstream, line_handler, lbuf, sizeof(lbuf),
- DK4_ENCODING_ASCII, DK4_ENCODING_UTF8, &er
- );
-#else
- res = dk4tsp08_setup_char(
- &tsp, (void *)outstream, char_handler,
- DK4_ENCODING_UTF8, DK4_ENCODING_UTF8, &er
- );
-#endif
- if (DK4_TSP_RES_OK == res) {
- oldres = DK4_TSP_RES_OK;
- cc = 1;
- while (1 == cc) {
- nread = fread(fbuf, 1, sizeof(fbuf), stdin);
- if (0 < nread) {
- res = dk4tsp08_add_bytes(&tsp, (unsigned char *)fbuf, nread);
- switch (res) {
- case DK4_TSP_RES_OK: {
- } break;
- case DK4_TSP_RES_ERROR: {
- if (DK4_TSP_RES_OK == oldres) {
- oldres = DK4_TSP_RES_ERROR;
- $? "! STATE CHANGE: ERROR"
- }
- } break;
- case DK4_TSP_RES_FATAL: {
- if (DK4_TSP_RES_FATAL != oldres) {
- oldres = DK4_TSP_RES_FATAL;
- $? "! STATE CHANGE: FATAL"
- }
- } break;
- }
- } else {
- cc = 0;
- }
- }
- res = dk4tsp08_finish(&tsp);
- switch (res) {
- case DK4_TSP_RES_OK: {
- } break;
- case DK4_TSP_RES_ERROR: {
- if (DK4_TSP_RES_OK == oldres) {
- oldres = DK4_TSP_RES_ERROR;
- $? "! STATE CHANGE: ERROR"
- }
- } break;
- case DK4_TSP_RES_FATAL: {
- if (DK4_TSP_RES_FATAL != oldres) {
- oldres = DK4_TSP_RES_FATAL;
- $? "! STATE CHANGE: FATAL"
- }
- } break;
- }
- } else { $? "! failed to initialize text processing"
- }
- dk4stream_close(outstream, NULL);
- } else { $? "! failed to create output stream"
- }
- fflush(stdout);
-#if DK4_ON_WINDOWS
- _setmode(_fileno(stdin), oldinmode);
- _setmode(_fileno(stdout), oldmode);
-#endif
- $? "- main"
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-dk4user.c b/support/dktools/test-dk4user.c
deleted file mode 100644
index 8798f67835..0000000000
--- a/support/dktools/test-dk4user.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4user.ctr
-*/
-
-/** @file test-dk4user.c The test-dk4user module.
-*/
-
-
-#line 1 "test-dk4user.ctr"
-
-
-#include "dk4conf.h"
-#include "dk4types.h"
-#include "dk4mem.h"
-#include <stdio.h>
-#include "dk4user.h"
-#include "dk4mpl.h"
-#include "dk4fput.h"
-
-#if DK4_HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#if DK4_HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#if DK4_HAVE_PROCESS_H
-#include <process.h>
-#endif
-
-
-
-
-
-#line 26 "test-dk4user.ctr"
-
-
-
-int main(void)
-{
- dkChar logname[128];
- dkChar homedir[DK4_MAX_PATH];
- dk4_er_t er;
-
-
-
-#line 36 "test-dk4user.ctr"
-
-
-#line 37 "test-dk4user.ctr"
- dk4error_init(&er);
- dk4fput_initialize_stdout();
- if (dk4user_get_logname(logname, DK4_SIZEOF(logname,dkChar), 0, &er)) {
- dk4fputs(dkT("LOGNAME: "), stdout, &er);
- dk4fputs(logname, stdout, &er);
- dk4fputc(dkT('\n'), stdout, &er);
- }
- if (dk4user_get_homedir(homedir, DK4_SIZEOF(homedir,dkChar), 0, &er)) {
- dk4fputs(dkT("HOMEDIR: "), stdout, &er);
- dk4fputs(homedir, stdout, &er);
- dk4fputc(dkT('\n'), stdout, &er);
- }
-
-
-#line 50 "test-dk4user.ctr"
-
-
-#line 51 "test-dk4user.ctr"
- exit(0); return 0;
-}
-
diff --git a/support/dktools/test-dk4user.ctr b/support/dktools/test-dk4user.ctr
deleted file mode 100644
index 291285bbfc..0000000000
--- a/support/dktools/test-dk4user.ctr
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-#include "dk4conf.h"
-#include "dk4types.h"
-#include "dk4mem.h"
-#include <stdio.h>
-#include "dk4user.h"
-#include "dk4mpl.h"
-#include "dk4fput.h"
-
-#if DK4_HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#if DK4_HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#if DK4_HAVE_PROCESS_H
-#include <process.h>
-#endif
-
-
-
-$!trace-include
-
-
-
-int main(void)
-{
- dkChar logname[128];
- dkChar homedir[DK4_MAX_PATH];
- dk4_er_t er;
-
- $!trace-init test-dk4user.deb
- $? "+ main"
- dk4error_init(&er);
- dk4fput_initialize_stdout();
- if (dk4user_get_logname(logname, DK4_SIZEOF(logname,dkChar), 0, &er)) {
- dk4fputs(dkT("LOGNAME: "), stdout, &er);
- dk4fputs(logname, stdout, &er);
- dk4fputc(dkT('\n'), stdout, &er);
- }
- if (dk4user_get_homedir(homedir, DK4_SIZEOF(homedir,dkChar), 0, &er)) {
- dk4fputs(dkT("HOMEDIR: "), stdout, &er);
- dk4fputs(homedir, stdout, &er);
- dk4fputc(dkT('\n'), stdout, &er);
- }
- $? "- main"
- $!trace-end
- exit(0); return 0;
-}
-
diff --git a/support/dktools/test-dk4wxah.cpp b/support/dktools/test-dk4wxah.cpp
index a8f835fea8..e7a41e4980 100644
--- a/support/dktools/test-dk4wxah.cpp
+++ b/support/dktools/test-dk4wxah.cpp
@@ -1,5 +1,6 @@
/*
- WARNING: This file was generated by dkct.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: test-dk4wxah.cpt
diff --git a/support/dktools/test-eradisk.c b/support/dktools/test-eradisk.c
deleted file mode 100644
index 3abc64fdd2..0000000000
--- a/support/dktools/test-eradisk.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-eradisk.ctr
-*/
-
-/** @file test-eradisk.c The test-eradisk module.
-*/
-
-
-#line 1 "test-eradisk.ctr"
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dk4mai8dsz.h"
-
-int main(int argc, char *argv[])
-{
- size_t ts = 512;
- size_t as = 512;
- size_t is = 0;
- int cc = 1;
- int ic;
- const char *ep = NULL;
- if (1 < argc) {
- if (0 != dk4ma_input_c8_dec_size_t(&as, argv[1], &ep, 1, NULL)) {
- ts = as;
- printf("ts = %u\n", (unsigned)ts);
- }
- }
- while (1 == cc) {
- ic = fgetc(stdin);
- if (EOF == ic) {
- cc = 0;
- } else {
- if (++is >= ts) {
- cc = 0;
- } else {
- printf("%u / %u\n", (unsigned)is, (unsigned)ts);
- }
- }
- }
- exit(0); return 0;
-}
-
diff --git a/support/dktools/test-eradisk.ctr b/support/dktools/test-eradisk.ctr
deleted file mode 100644
index 540359db99..0000000000
--- a/support/dktools/test-eradisk.ctr
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dk4mai8dsz.h"
-
-int main(int argc, char *argv[])
-{
- size_t ts = 512;
- size_t as = 512;
- size_t is = 0;
- int cc = 1;
- int ic;
- const char *ep = NULL;
- if (1 < argc) {
- if (0 != dk4ma_input_c8_dec_size_t(&as, argv[1], &ep, 1, NULL)) {
- ts = as;
- printf("ts = %u\n", (unsigned)ts);
- }
- }
- while (1 == cc) {
- ic = fgetc(stdin);
- if (EOF == ic) {
- cc = 0;
- } else {
- if (++is >= ts) {
- cc = 0;
- } else {
- printf("%u / %u\n", (unsigned)is, (unsigned)ts);
- }
- }
- }
- exit(0); return 0;
-}
-
diff --git a/support/dktools/test-filei.c b/support/dktools/test-filei.c
deleted file mode 100644
index f4779798b5..0000000000
--- a/support/dktools/test-filei.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-filei.ctr
-*/
-
-/** @file test-filei.c The test-filei module.
-*/
-
-
-#line 1 "test-filei.ctr"
-
-#include <stdio.h>
-
-#include "dk4filei.h"
-#include "dk4filei8.h"
-#include "dk4fileig8.h"
-#include "dk4fput.h"
-#include "dk4mem.h"
-
-
-
-
-
-#line 13 "test-filei.ctr"
-
-
-
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dkChar buf[256];
- dk4_file_info_t fi;
- int i;
-
-
-
-#line 27 "test-filei.ctr"
-
-
-#line 28 "test-filei.ctr"
- dk4fput_initialize_stdout();
- for (i = 1; i < argc; i++) {
- dk4fputs(argv[i], stdout, NULL);
- dk4fputc('\n', stdout, NULL);
- dk4fileinfo_init(&fi);
- if (dk4fileinfo(&fi, argv[i], NULL)) {
-
-#line 34 "test-filei.ctr"
- if (dk4fileinfo_timestamp(buf, DK4_SIZEOF(buf,dkChar), &fi, 0, 0, NULL)) {
- dk4fputs(buf, stdout, NULL);
- dk4fputc('\n', stdout, NULL);
-
-#line 37 "test-filei.ctr"
- } else {
-
-#line 38 "test-filei.ctr"
- }
- if (dk4fileinfo_type_attributes(buf, sizeof(buf), &fi, NULL)) {
- dk4fputs(buf, stdout, NULL);
- dk4fputc('\n', stdout, NULL);
-
-#line 42 "test-filei.ctr"
- } else {
-
-#line 43 "test-filei.ctr"
- }
- } else {
-
-#line 45 "test-filei.ctr"
- }
- dk4fputc('\n', stdout, NULL);
- }
-
-
-#line 49 "test-filei.ctr"
-
-
-#line 50 "test-filei.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-filei.ctr b/support/dktools/test-filei.ctr
deleted file mode 100644
index b07c00a3df..0000000000
--- a/support/dktools/test-filei.ctr
+++ /dev/null
@@ -1,52 +0,0 @@
-
-#include <stdio.h>
-
-#include "dk4filei.h"
-#include "dk4filei8.h"
-#include "dk4fileig8.h"
-#include "dk4fput.h"
-#include "dk4mem.h"
-
-
-
-$!trace-include
-
-
-
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dkChar buf[256];
- dk4_file_info_t fi;
- int i;
-
- $!trace-init test-filei.deb
- $? "+ main"
- dk4fput_initialize_stdout();
- for (i = 1; i < argc; i++) {
- dk4fputs(argv[i], stdout, NULL);
- dk4fputc('\n', stdout, NULL);
- dk4fileinfo_init(&fi);
- if (dk4fileinfo(&fi, argv[i], NULL)) { $? ". ok"
- if (dk4fileinfo_timestamp(buf, DK4_SIZEOF(buf,dkChar), &fi, 0, 0, NULL)) {
- dk4fputs(buf, stdout, NULL);
- dk4fputc('\n', stdout, NULL); $? ". ok"
- } else { $? "! failed"
- }
- if (dk4fileinfo_type_attributes(buf, sizeof(buf), &fi, NULL)) {
- dk4fputs(buf, stdout, NULL);
- dk4fputc('\n', stdout, NULL); $? ". ok"
- } else { $? "! failed"
- }
- } else { $? "! failed"
- }
- dk4fputc('\n', stdout, NULL);
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-fne.c b/support/dktools/test-fne.c
deleted file mode 100644
index fd25a12273..0000000000
--- a/support/dktools/test-fne.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-fne.ctr
-*/
-
-/** @file test-fne.c The test-fne module.
-*/
-
-
-#line 1 "test-fne.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4fput.h"
-
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int i;
-
- dk4fput_initialize_stdout();
- for (i = 0; i < argc; i++) {
- dk4fputs(argv[i], stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- return 0;
-}
-
diff --git a/support/dktools/test-fne.ctr b/support/dktools/test-fne.ctr
deleted file mode 100644
index c426d32c26..0000000000
--- a/support/dktools/test-fne.ctr
+++ /dev/null
@@ -1,30 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4fput.h"
-
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int i;
-
- dk4fput_initialize_stdout();
- for (i = 0; i < argc; i++) {
- dk4fputs(argv[i], stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- return 0;
-}
-
diff --git a/support/dktools/test-home.c b/support/dktools/test-home.c
deleted file mode 100644
index c65e3acb6a..0000000000
--- a/support/dktools/test-home.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-home.ctr
-*/
-
-/** @file test-home.c The test-home module.
-*/
-
-
-#line 1 "test-home.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4mem.h"
-#include "dk4user.h"
-#include "dk4fput.h"
-#include "dk4mpl.h"
-
-static const dkChar *test_home_kw[] = {
-/* 0 */
-dkT("LOGNAME: "),
-
-/* 1 */
-dkT("HOME: "),
-
-NULL
-
-
-#line 16 "test-home.ctr"
-};
-
-
-int main(void)
-{
- dkChar buf[DK4_MAX_PATH];
- size_t szbuf = DK4_SIZEOF(buf,dkChar);
- int exval = 1;
-
- if (0 != dk4user_get_logname(buf, szbuf, 1, NULL)) {
- dk4fput_initialize_stdout();
- dk4fputs(test_home_kw[0], stdout, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- if (0 != dk4user_get_homedir(buf, szbuf, 1, NULL)) {
- dk4fputs(test_home_kw[1], stdout, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- exval = 0;
- }
- dk4fput_cleanup_stdout();
- }
- return exval;
-}
-
diff --git a/support/dktools/test-home.ctr b/support/dktools/test-home.ctr
deleted file mode 100644
index af7c2e6630..0000000000
--- a/support/dktools/test-home.ctr
+++ /dev/null
@@ -1,40 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4mem.h"
-#include "dk4user.h"
-#include "dk4fput.h"
-#include "dk4mpl.h"
-
-static const dkChar *test_home_kw[] = {
-$!string-table macro=dkT
-LOGNAME:
-HOME:
-$!end
-};
-
-
-int main(void)
-{
- dkChar buf[DK4_MAX_PATH];
- size_t szbuf = DK4_SIZEOF(buf,dkChar);
- int exval = 1;
-
- if (0 != dk4user_get_logname(buf, szbuf, 1, NULL)) {
- dk4fput_initialize_stdout();
- dk4fputs(test_home_kw[0], stdout, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- if (0 != dk4user_get_homedir(buf, szbuf, 1, NULL)) {
- dk4fputs(test_home_kw[1], stdout, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- exval = 0;
- }
- dk4fput_cleanup_stdout();
- }
- return exval;
-}
-
diff --git a/support/dktools/test-inet-pton.c b/support/dktools/test-inet-pton.c
deleted file mode 100644
index e065bfa1ca..0000000000
--- a/support/dktools/test-inet-pton.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-inet-pton.ctr
-*/
-
-/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file test-inet-pton.c The test-inet-pton module.
-*/
-
-
-#line 9 "test-inet-pton.ctr"
-
-#include "dk4conf.h"
-#include "dk4sock.h"
-
-
-
-
-
-#line 16 "test-inet-pton.ctr"
-
-
-
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
-
-struct in6_addr sin6;
-
-#endif
-
-struct in_addr sin4;
-
-static
-void
-run_test(const char *addrtext)
-{
- char buf[1040];
- dk4_er_t er;
- int res;
- printf("Text: \"%s\"\n", addrtext);
- dk4error_init(&er);
- res = dk4socket_c8_inet_pton(&sin4, sizeof(sin4), AF_INET, addrtext, &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- res = dk4socket_c8_inet_ntop(buf, sizeof(buf), AF_INET, &sin4, &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- printf("Address: \"%s\"\n", buf);
- } else {
- printf("Conversion succeeded.\n");
- }
- } else {
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
- res = dk4socket_c8_inet_pton(&sin6, sizeof(sin6), AF_INET6, addrtext, &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- res = dk4socket_c8_inet_ntop(buf, sizeof(buf), AF_INET6, &sin6, &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- printf("Address: \"%s\"\n", buf);
- } else {
- printf("Conversion succeeded.\n");
- }
- } else {
-#endif
- printf("!!!!! Conversion failed!\n");
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
- }
-#endif
- }
-}
-
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_er_t er;
- int i;
-
-
-#line 79 "test-inet-pton.ctr"
-
-
-#line 80 "test-inet-pton.ctr"
- dk4error_init(&er);
- if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up(&er)) {
- for (i = 1; i < argc; i++) {
- run_test(argv[i]);
- }
- dk4socket_down(&er);
- }
-
-
-#line 88 "test-inet-pton.ctr"
-
-
-#line 89 "test-inet-pton.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-inet-pton.ctr b/support/dktools/test-inet-pton.ctr
deleted file mode 100644
index 74401debac..0000000000
--- a/support/dktools/test-inet-pton.ctr
+++ /dev/null
@@ -1,91 +0,0 @@
-%% options
-
-copyright owner = Dirk Krause
-copyright year = 2015-xxxx
-license = bsd
-
-
-%% module
-
-#include "dk4conf.h"
-#include "dk4sock.h"
-
-
-
-$!trace-include
-
-
-
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
-
-struct in6_addr sin6;
-
-#endif
-
-struct in_addr sin4;
-
-static
-void
-run_test(const char *addrtext)
-{
- char buf[1040];
- dk4_er_t er;
- int res;
- printf("Text: \"%s\"\n", addrtext);
- dk4error_init(&er);
- res = dk4socket_c8_inet_pton(&sin4, sizeof(sin4), AF_INET, addrtext, &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- res = dk4socket_c8_inet_ntop(buf, sizeof(buf), AF_INET, &sin4, &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- printf("Address: \"%s\"\n", buf);
- } else {
- printf("Conversion succeeded.\n");
- }
- } else {
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
- res = dk4socket_c8_inet_pton(&sin6, sizeof(sin6), AF_INET6, addrtext, &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- res = dk4socket_c8_inet_ntop(buf, sizeof(buf), AF_INET6, &sin6, &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- printf("Address: \"%s\"\n", buf);
- } else {
- printf("Conversion succeeded.\n");
- }
- } else {
-#endif
- printf("!!!!! Conversion failed!\n");
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
- }
-#endif
- }
-}
-
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_er_t er;
- int i;
- $!trace-init test-inet-pton.deb
- $? "+ main"
- dk4error_init(&er);
- if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up(&er)) {
- for (i = 1; i < argc; i++) {
- run_test(argv[i]);
- }
- dk4socket_down(&er);
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-mbstr.c b/support/dktools/test-mbstr.c
deleted file mode 100644
index dd47c626ad..0000000000
--- a/support/dktools/test-mbstr.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-mbstr.ctr
-*/
-
-/** @file test-mbstr.c The test-mbstr module.
-*/
-
-
-#line 1 "test-mbstr.ctr"
-
-#include "dk4conf.h"
-#include "dk4strm.h"
-#include "dk4membuf.h"
-#include "dk4mbstrm.h"
-
-
-static const char test[] = { "0123456789ABCDEF" };
-
-int main(int argc, char *argv[])
-{
- dk4_membuf_t *mb = NULL;
- dk4_stream_t *strm = NULL;
- size_t i;
-
- mb = dk4membuf_open(NULL);
- if (NULL != mb) {
- strm = dk4stream_open_membuf_writer(mb, NULL);
- if (NULL != strm) {
- for (i = 0; i < 1024; i++) {
- dk4stream_write(strm, test, 16, NULL);
- }
- if (dk4membuf_size(&i, mb, NULL)) {
- printf("Bytes: %lu\n", (unsigned long)i);
- }
- dk4stream_close(strm, NULL);
- }
- else {
- }
- dk4membuf_close(mb);
- }
- else {
- }
-
- return 0;
-}
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/test-mbstr.ctr b/support/dktools/test-mbstr.ctr
deleted file mode 100644
index 36bd737fb7..0000000000
--- a/support/dktools/test-mbstr.ctr
+++ /dev/null
@@ -1,39 +0,0 @@
-
-#include "dk4conf.h"
-#include "dk4strm.h"
-#include "dk4membuf.h"
-#include "dk4mbstrm.h"
-
-
-static const char test[] = { "0123456789ABCDEF" };
-
-int main(int argc, char *argv[])
-{
- dk4_membuf_t *mb = NULL;
- dk4_stream_t *strm = NULL;
- size_t i;
-
- mb = dk4membuf_open(NULL);
- if (NULL != mb) {
- strm = dk4stream_open_membuf_writer(mb, NULL);
- if (NULL != strm) {
- for (i = 0; i < 1024; i++) {
- dk4stream_write(strm, test, 16, NULL);
- }
- if (dk4membuf_size(&i, mb, NULL)) {
- printf("Bytes: %lu\n", (unsigned long)i);
- }
- dk4stream_close(strm, NULL);
- }
- else {
- }
- dk4membuf_close(mb);
- }
- else {
- }
-
- return 0;
-}
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/test-membuf.c b/support/dktools/test-membuf.c
deleted file mode 100644
index 1785e53de2..0000000000
--- a/support/dktools/test-membuf.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-membuf.ctr
-*/
-
-/** @file test-membuf.c The test-membuf module.
-*/
-
-
-#line 1 "test-membuf.ctr"
-
-#include <stdio.h>
-
-#include "dk4membuf.h"
-#include "dk4membf.h"
-
-
-
-int main(void)
-{
- char buf[32];
- dk4_er_t er;
- dk4_membuf_t *mbptr;
- size_t rdb;
- int cc;
- int res;
-
- dk4error_init(&er);
- mbptr = dk4membuf_open(&er);
- if (NULL != mbptr) {
- cc = 1;
- while (1 == cc) {
- rdb = fread(buf, 1, sizeof(buf), stdin);
- if (0 < rdb) {
- if (0 != feof(stdin)) { cc = 0; }
- res = dk4membuf_store(mbptr, buf, rdb, &er);
- if (0 == res) {
- fprintf(stderr, "Failed to save data!\n"); fflush(stderr);
- }
- } else {
- cc = 0;
- }
- }
- res = dk4membuf_size(&rdb, mbptr, &er);
- if (0 != res) {
- fprintf(stderr, "Size: %lu\n", (unsigned long)rdb); fflush(stderr);
- } else {
- fprintf(stderr, "Size calculation failed!\n"); fflush(stderr);
- }
- res = dk4membuf_to_file(stdout, mbptr, &er);
- if (0 == res) {
- fprintf(stderr, "Failed to write output!\n"); fflush(stderr);
- }
- dk4membuf_close(mbptr);
- }
- return 0;
-}
-
diff --git a/support/dktools/test-membuf.ctr b/support/dktools/test-membuf.ctr
deleted file mode 100644
index d172834e49..0000000000
--- a/support/dktools/test-membuf.ctr
+++ /dev/null
@@ -1,48 +0,0 @@
-
-#include <stdio.h>
-
-#include "dk4membuf.h"
-#include "dk4membf.h"
-
-
-
-int main(void)
-{
- char buf[32];
- dk4_er_t er;
- dk4_membuf_t *mbptr;
- size_t rdb;
- int cc;
- int res;
-
- dk4error_init(&er);
- mbptr = dk4membuf_open(&er);
- if (NULL != mbptr) {
- cc = 1;
- while (1 == cc) {
- rdb = fread(buf, 1, sizeof(buf), stdin);
- if (0 < rdb) {
- if (0 != feof(stdin)) { cc = 0; }
- res = dk4membuf_store(mbptr, buf, rdb, &er);
- if (0 == res) {
- fprintf(stderr, "Failed to save data!\n"); fflush(stderr);
- }
- } else {
- cc = 0;
- }
- }
- res = dk4membuf_size(&rdb, mbptr, &er);
- if (0 != res) {
- fprintf(stderr, "Size: %lu\n", (unsigned long)rdb); fflush(stderr);
- } else {
- fprintf(stderr, "Size calculation failed!\n"); fflush(stderr);
- }
- res = dk4membuf_to_file(stdout, mbptr, &er);
- if (0 == res) {
- fprintf(stderr, "Failed to write output!\n"); fflush(stderr);
- }
- dk4membuf_close(mbptr);
- }
- return 0;
-}
-
diff --git a/support/dktools/test-mkdir.c b/support/dktools/test-mkdir.c
deleted file mode 100644
index d39f55d083..0000000000
--- a/support/dktools/test-mkdir.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-mkdir.ctr
-*/
-
-/** @file test-mkdir.c The test-mkdir module.
-*/
-
-
-#line 1 "test-mkdir.ctr"
-
-
-#include <stdio.h>
-
-
-
-#include "dk4app.h"
-#include "dk4fput.h"
-#include "dk4appmkdh.h"
-
-
-
-
-
-#line 14 "test-mkdir.ctr"
-
-
-
-static const dkChar * const test_mkdir_help_text[] = {
-dkT("This is a test program to create directories."),
-NULL
-
-
-#line 21 "test-mkdir.ctr"
-};
-
-static const dkChar * const test_mkdir_license_text[] = {
-dkT("Copyright (c) 2014-2016, Dirk Krause"),
-dkT("All rights reserved."),
-dkT(""),
-dkT("Redistribution and use in source and binary forms, with or without"),
-dkT("modification, are permitted provided that the following conditions"),
-dkT("are met:"),
-dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
-dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
-dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN"),
-dkT("ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
-dkT("POSSIBILITY OF SUCH DAMAGE."),
-NULL
-
-
-#line 55 "test-mkdir.ctr"
-};
-
-static dk4_app_t *app = NULL;
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int res;
- int nargs;
- int i;
- const dkChar *arg;
-
-
-#line 75 "test-mkdir.ctr"
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-mkdir.txt"), test_mkdir_help_text,
- test_mkdir_license_text
- );
- if (NULL != app) {
-
-#line 82 "test-mkdir.ctr"
- nargs = dk4app_get_argc(app);
- if (0 < nargs) {
- dk4fput_initialize_stdout();
- for (i = 0; i < nargs; i++) {
- arg = dk4app_get_argv(app, i);
- if (NULL != arg) {
- res = dk4app_mkdir_hierarchy(arg, 1, app);
- dk4fputs(arg, stdout, NULL);
- dk4fputc(dkT(' '), stdout, NULL);
- if (0 < res) {
- dk4fputs(dkT("SUCCESS"), stdout, NULL);
- } else {
- dk4fputs(dkT("FAILED"), stdout, NULL);
- }
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- }
- dk4app_close(app);
- } else {
-
-#line 102 "test-mkdir.ctr"
- }
-
-
-#line 104 "test-mkdir.ctr"
- return 0;
-}
-
diff --git a/support/dktools/test-mkdir.ctr b/support/dktools/test-mkdir.ctr
deleted file mode 100644
index 51be7cabd6..0000000000
--- a/support/dktools/test-mkdir.ctr
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-#include <stdio.h>
-
-
-
-#include "dk4app.h"
-#include "dk4fput.h"
-#include "dk4appmkdh.h"
-
-
-
-$!trace-include
-
-
-
-static const dkChar * const test_mkdir_help_text[] = {
-$!text macro=dkT
-This is a test program to create directories.
-$!end
-};
-
-static const dkChar * const test_mkdir_license_text[] = {
-$!text macro=dkT
-Copyright (c) 2014-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-$!end
-};
-
-static dk4_app_t *app = NULL;
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- int res;
- int nargs;
- int i;
- const dkChar *arg;
- $!trace-init test-mkdir.deb
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-mkdir.txt"), test_mkdir_help_text,
- test_mkdir_license_text
- );
- if (NULL != app) { $? ". app"
- nargs = dk4app_get_argc(app);
- if (0 < nargs) {
- dk4fput_initialize_stdout();
- for (i = 0; i < nargs; i++) {
- arg = dk4app_get_argv(app, i);
- if (NULL != arg) {
- res = dk4app_mkdir_hierarchy(arg, 1, app);
- dk4fputs(arg, stdout, NULL);
- dk4fputc(dkT(' '), stdout, NULL);
- if (0 < res) {
- dk4fputs(dkT("SUCCESS"), stdout, NULL);
- } else {
- dk4fputs(dkT("FAILED"), stdout, NULL);
- }
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- }
- dk4app_close(app);
- } else { $? "! app"
- }
- $!trace-end
- return 0;
-}
-
diff --git a/support/dktools/test-opt.c b/support/dktools/test-opt.c
deleted file mode 100644
index 339fec4782..0000000000
--- a/support/dktools/test-opt.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-opt.ctr
-*/
-
-/** @file test-opt.c The test-opt module.
-*/
-
-
-#line 1 "test-opt.ctr"
-
-#include "dk4conf.h"
-#include "dk4types.h"
-#include "dk4mem.h"
-#include "dk4opt.h"
-
-
-
-
-
-#line 10 "test-opt.ctr"
-
-
-
-/** Command line options for program.
-*/
-static dk4_option_t options[] = {
- { { dkT('i'), dkT("interactive"), DK4_OPT_ARG_NONE }, { NULL }, 0},
- { { dkT('s'), dkT("socket"), DK4_OPT_ARG_STRING }, { NULL }, 0},
- { { dkT('h'), dkT("host"), DK4_OPT_ARG_STRING }, { NULL }, 0},
- { { dkT('p'), dkT("port"), DK4_OPT_ARG_UNSIGNED }, { NULL }, 0}
-};
-
-
-
-static const size_t szoptions = sizeof(options)/sizeof(dk4_option_t);
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int
-wmain(int argc, wchar_t *argv[])
-#else
-int
-main(int argc, char *argv[])
-#endif
-{
- dkChar *filenames[32];
- size_t szfn = DK4_SIZEOF(filenames,DK4_PDKCHAR);
- int res;
-
-
-
-#line 45 "test-opt.ctr"
-
-
-#line 46 "test-opt.ctr"
- res = dk4opt_process_argv(
- options, szoptions, argc, argv,
- filenames, &szfn, 1, 1, NULL
- );
- if (0 != res) {
- if (0 != options[0].found) {
- fputs("Option -i found.\n", stdout);
- }
- if (0 != options[1].found) {
- fputs("Option -s found.\nArgument: ", stdout);
- if (NULL != options[1].val.t) {
- fputs(options[1].val.t, stdout);
- }
- fputc('\n', stdout);
- fflush(stdout);
- }
- if (0 != options[2].found) {
- fputs("Option -h found.\n", stdout);
- if (NULL != options[2].val.t) {
- fputs(options[2].val.t, stdout);
- }
- fputc('\n', stdout);
- fflush(stdout);
- }
- if (0 != options[3].found) {
- fputs("Option -p found.\n", stdout);
- fprintf(stdout, "Argument: %ju\n", options[3].val.u);
- fflush(stdout);
- }
- }
-
-
-#line 77 "test-opt.ctr"
-
-
-#line 78 "test-opt.ctr"
- exit(0); return 0;
-}
-
diff --git a/support/dktools/test-opt.ctr b/support/dktools/test-opt.ctr
deleted file mode 100644
index 2b9e7f6dc4..0000000000
--- a/support/dktools/test-opt.ctr
+++ /dev/null
@@ -1,80 +0,0 @@
-
-#include "dk4conf.h"
-#include "dk4types.h"
-#include "dk4mem.h"
-#include "dk4opt.h"
-
-
-
-$!trace-include
-
-
-
-/** Command line options for program.
-*/
-static dk4_option_t options[] = {
- { { dkT('i'), dkT("interactive"), DK4_OPT_ARG_NONE }, { NULL }, 0},
- { { dkT('s'), dkT("socket"), DK4_OPT_ARG_STRING }, { NULL }, 0},
- { { dkT('h'), dkT("host"), DK4_OPT_ARG_STRING }, { NULL }, 0},
- { { dkT('p'), dkT("port"), DK4_OPT_ARG_UNSIGNED }, { NULL }, 0}
-};
-
-
-
-static const size_t szoptions = sizeof(options)/sizeof(dk4_option_t);
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int
-wmain(int argc, wchar_t *argv[])
-#else
-int
-main(int argc, char *argv[])
-#endif
-{
- dkChar *filenames[32];
- size_t szfn = DK4_SIZEOF(filenames,DK4_PDKCHAR);
- int res;
-
- $!trace-init test-opt.deb
- $? "+ main"
- res = dk4opt_process_argv(
- options, szoptions, argc, argv,
- filenames, &szfn, 1, 1, NULL
- );
- if (0 != res) {
- if (0 != options[0].found) {
- fputs("Option -i found.\n", stdout);
- }
- if (0 != options[1].found) {
- fputs("Option -s found.\nArgument: ", stdout);
- if (NULL != options[1].val.t) {
- fputs(options[1].val.t, stdout);
- }
- fputc('\n', stdout);
- fflush(stdout);
- }
- if (0 != options[2].found) {
- fputs("Option -h found.\n", stdout);
- if (NULL != options[2].val.t) {
- fputs(options[2].val.t, stdout);
- }
- fputc('\n', stdout);
- fflush(stdout);
- }
- if (0 != options[3].found) {
- fputs("Option -p found.\n", stdout);
- fprintf(stdout, "Argument: %ju\n", options[3].val.u);
- fflush(stdout);
- }
- }
- $? "- main"
- $!trace-end
- exit(0); return 0;
-}
-
diff --git a/support/dktools/test-paper.c b/support/dktools/test-paper.c
deleted file mode 100644
index 23919e27fc..0000000000
--- a/support/dktools/test-paper.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-paper.ctr
-*/
-
-/** @file test-paper.c The test-paper module.
-*/
-
-
-#line 1 "test-paper.ctr"
-#include <stdio.h>
-#include <stdint.h>
-#define _USE_MATH_DEFINES 1
-#include <math.h>
-
-
-#include "dk4mem.h"
-#include "dk4serf.h"
-#include "dk4userf.h"
-#include "dk4app.h"
-#include "dk4str8.h"
-#include "dk4maodd.h"
-#include "dk4fput.h"
-#include "dk4paper.h"
-#include "dk4papea.h"
-
-
-
-
-#line 19 "test-paper.ctr"
-
-
-
-static const dkChar * const test_paper_help_text[] = {
-dkT("This is a test program to create directories."),
-NULL
-
-
-#line 26 "test-paper.ctr"
-};
-
-static const dkChar * const test_paper_license_text[] = {
-dkT("Copyright (c) 2014-2016, Dirk Krause"),
-dkT("All rights reserved."),
-dkT(""),
-dkT("Redistribution and use in source and binary forms, with or without"),
-dkT("modification, are permitted provided that the following conditions"),
-dkT("are met:"),
-dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
-dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
-dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN"),
-dkT("ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
-dkT("POSSIBILITY OF SUCH DAMAGE."),
-NULL
-
-
-#line 60 "test-paper.ctr"
-};
-
-
-static int exv = EXIT_FAILURE;
-
-
-static dk4_app_t *app = NULL;
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_paper_size_collection_t *psc;
-
-
-
-#line 83 "test-paper.ctr"
-
-
-#line 84 "test-paper.ctr"
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-paper.txt"), test_paper_help_text,
- test_paper_license_text
- );
- if (NULL != app) {
- psc = dk4app_get_paper_sizes(app);
- if (NULL != psc) {
- dk4papersize_coll_close(psc);
- }
- dk4app_close(app);
- }
- psc = dk4papersize_coll_for_application(
- dkT("test-paper"), dkT("dktools"), NULL
- );
- if (NULL != psc) {
- dk4papersize_coll_close(psc);
- }
-
-
-#line 104 "test-paper.ctr"
-
-
-#line 105 "test-paper.ctr"
- return exv;
-}
diff --git a/support/dktools/test-paper.ctr b/support/dktools/test-paper.ctr
deleted file mode 100644
index e14c1c0019..0000000000
--- a/support/dktools/test-paper.ctr
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-#define _USE_MATH_DEFINES 1
-#include <math.h>
-
-
-#include "dk4mem.h"
-#include "dk4serf.h"
-#include "dk4userf.h"
-#include "dk4app.h"
-#include "dk4str8.h"
-#include "dk4maodd.h"
-#include "dk4fput.h"
-#include "dk4paper.h"
-#include "dk4papea.h"
-
-
-$!trace-include
-
-
-
-static const dkChar * const test_paper_help_text[] = {
-$!text macro=dkT
-This is a test program to create directories.
-$!end
-};
-
-static const dkChar * const test_paper_license_text[] = {
-$!text macro=dkT
-Copyright (c) 2014-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-$!end
-};
-
-
-static int exv = EXIT_FAILURE;
-
-
-static dk4_app_t *app = NULL;
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_paper_size_collection_t *psc;
-
- $!trace-init test-paper.deb
- $? "+ main"
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-paper.txt"), test_paper_help_text,
- test_paper_license_text
- );
- if (NULL != app) {
- psc = dk4app_get_paper_sizes(app);
- if (NULL != psc) {
- dk4papersize_coll_close(psc);
- }
- dk4app_close(app);
- }
- psc = dk4papersize_coll_for_application(
- dkT("test-paper"), dkT("dktools"), NULL
- );
- if (NULL != psc) {
- dk4papersize_coll_close(psc);
- }
- $? "- main %d", exv
- $!trace-end
- return exv;
-}
diff --git a/support/dktools/test-peer.c b/support/dktools/test-peer.c
deleted file mode 100644
index fbf9317fee..0000000000
--- a/support/dktools/test-peer.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-peer.ctr
-*/
-
-/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file test-peer.c The test-peer module.
-*/
-
-
-#line 10 "test-peer.ctr"
-
-#include "dk4conf.h"
-#include "dk4app.h"
-#include "dk4sock.h"
-#include "dk4socka.h"
-#include "dk4vers.h"
-#include "dk4fput.h"
-
-
-
-
-
-#line 21 "test-peer.ctr"
-
-
-static
-void
-dk4socket_c8_debug_allowed_peer(dk4_allowed_peer_t *peerptr)
-{
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
- unsigned char *ucptr;
- size_t i;
- size_t pass;
-#endif
- unsigned long ul1, ul2;
-
- if (NULL != stdout) {
- switch (peerptr->af) {
- case AF_INET : {
- ul1 = (peerptr->data).ipv4.ad.s_addr;
- ul2 = (peerptr->data).ipv4.ma.s_addr;
- ul1 = dk4socket_ntohl(ul1);
- ul2 = dk4socket_ntohl(ul2);
- fprintf(
- stdout,
- "Address/Mask: %lu.%lu.%lu.%lu/%lu.%lu.%lu.%lu\n",
- ((ul1 >> 24) & 0x000000FFUL),
- ((ul1 >> 16) & 0x000000FFUL),
- ((ul1 >> 8) & 0x000000FFUL),
- ((ul1 ) & 0x000000FFUL),
- ((ul2 >> 24) & 0x000000FFUL),
- ((ul2 >> 16) & 0x000000FFUL),
- ((ul2 >> 8) & 0x000000FFUL),
- ((ul2 ) & 0x000000FFUL)
- );
- } break;
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
- case AF_INET6 : {
- fputs("Address/Mask: ", stdout);
- for (pass = 0; pass < 2; pass++) {
- if (0 != pass) {
- fputc('/', stdout);
- ucptr = &((peerptr->data).ipv6.ma.s6_addr[0]);
- } else {
- ucptr = &((peerptr->data).ipv6.ad.s6_addr[0]);
- }
- for (i = 0; i < 16; i++) {
- if ((0 != i) && (0 == (i % 2))) {
- fputc(':', stdout);
- }
- fprintf(stdout, "%02x", *(ucptr++));
- }
- }
- fputc('\n', stdout);
- } break;
-#endif
- }
- }
-}
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_allowed_peer_t apeer;
- dk4_er_t er;
- size_t i;
- int res;
-
-
-#line 95 "test-peer.ctr"
-
-
-#line 96 "test-peer.ctr"
- if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up(NULL)) {
-
-#line 97 "test-peer.ctr"
- for (i = 1; i < argc; i++) {
- dk4error_init(&er);
- res = dk4socket_get_allowed_peer(&apeer, argv[i], &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- printf("SUCCESS: %s\n", argv[i]);
- dk4socket_c8_debug_allowed_peer(&apeer);
- } else {
- printf("FAILED: %s\n", argv[i]);
- }
- }
- dk4socket_down(NULL);
- } else {
-
-#line 109 "test-peer.ctr"
- }
-
-
-#line 111 "test-peer.ctr"
-
-
-#line 112 "test-peer.ctr"
- exit(0); return 0;
-}
-
-
diff --git a/support/dktools/test-peer.ctr b/support/dktools/test-peer.ctr
deleted file mode 100644
index d66bb4cb20..0000000000
--- a/support/dktools/test-peer.ctr
+++ /dev/null
@@ -1,115 +0,0 @@
-%% options
-
-copyright owner = Dirk Krause
-copyright year = 2015-xxxx
-license = bsd
-
-
-
-%% module
-
-#include "dk4conf.h"
-#include "dk4app.h"
-#include "dk4sock.h"
-#include "dk4socka.h"
-#include "dk4vers.h"
-#include "dk4fput.h"
-
-
-
-$!trace-include
-
-
-static
-void
-dk4socket_c8_debug_allowed_peer(dk4_allowed_peer_t *peerptr)
-{
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
- unsigned char *ucptr;
- size_t i;
- size_t pass;
-#endif
- unsigned long ul1, ul2;
-
- if (NULL != stdout) {
- switch (peerptr->af) {
- case AF_INET : {
- ul1 = (peerptr->data).ipv4.ad.s_addr;
- ul2 = (peerptr->data).ipv4.ma.s_addr;
- ul1 = dk4socket_ntohl(ul1);
- ul2 = dk4socket_ntohl(ul2);
- fprintf(
- stdout,
- "Address/Mask: %lu.%lu.%lu.%lu/%lu.%lu.%lu.%lu\n",
- ((ul1 >> 24) & 0x000000FFUL),
- ((ul1 >> 16) & 0x000000FFUL),
- ((ul1 >> 8) & 0x000000FFUL),
- ((ul1 ) & 0x000000FFUL),
- ((ul2 >> 24) & 0x000000FFUL),
- ((ul2 >> 16) & 0x000000FFUL),
- ((ul2 >> 8) & 0x000000FFUL),
- ((ul2 ) & 0x000000FFUL)
- );
- } break;
-#if DK4_HAVE_STRUCT_SOCKADDR_IN6 && defined(AF_INET6)
- case AF_INET6 : {
- fputs("Address/Mask: ", stdout);
- for (pass = 0; pass < 2; pass++) {
- if (0 != pass) {
- fputc('/', stdout);
- ucptr = &((peerptr->data).ipv6.ma.s6_addr[0]);
- } else {
- ucptr = &((peerptr->data).ipv6.ad.s6_addr[0]);
- }
- for (i = 0; i < 16; i++) {
- if ((0 != i) && (0 == (i % 2))) {
- fputc(':', stdout);
- }
- fprintf(stdout, "%02x", *(ucptr++));
- }
- }
- fputc('\n', stdout);
- } break;
-#endif
- }
- }
-}
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_allowed_peer_t apeer;
- dk4_er_t er;
- size_t i;
- int res;
- $!trace-init test-sock.deb
- $? "+ main"
- if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up(NULL)) { $? ". up"
- for (i = 1; i < argc; i++) {
- dk4error_init(&er);
- res = dk4socket_get_allowed_peer(&apeer, argv[i], &er);
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- printf("SUCCESS: %s\n", argv[i]);
- dk4socket_c8_debug_allowed_peer(&apeer);
- } else {
- printf("FAILED: %s\n", argv[i]);
- }
- }
- dk4socket_down(NULL);
- } else { $? "! failed to bring Winsock up"
- }
- $? "- main"
- $!trace-end
- exit(0); return 0;
-}
-
-
diff --git a/support/dktools/test-rld.c b/support/dktools/test-rld.c
deleted file mode 100644
index d818b3622e..0000000000
--- a/support/dktools/test-rld.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-rld.ctr
-*/
-
-/** @file test-rld.c The test-rld module.
-*/
-
-
-#line 1 "test-rld.ctr"
-
-#include <stdio.h>
-#include "dk4rld.h"
-#include "dk4edstm.h"
-
-/*
- Example file for run-length decoding.
- The program reads data from standard input, applies
- run-length decoding and writes result data to standard
- output.
-
- For better understanding we only do minimal diagnostics
- here (set exit status code).
- In real world programs one would issue more diagnostics
- on problems.
-*/
-
-
-int main(int argc, char *argv[])
-{
- dk4_rl_dec_t dec; /* Decoder */
- const unsigned char *ucptr; /* Address of output buffer */
- size_t sz; /* Number of output characters */
- size_t i; /* Current output char index */
-#if DK4_ON_WINDOWS
- int oldimode; /* Old file mode for stdin */
- int oldomode; /* Old file mode for stdout */
-#endif
- int ic; /* Current input char from stdin */
- int stopped = 0; /* Flag: EOD found */
- int exval = 0; /* Exit status code */
-
- /* On Windows we must set stdin and stdout to binary mode explicitly.
- */
-#if DK4_ON_WINDOWS
- oldimode = _setmode(_fileno(stdin), _O_BINARY);
- oldomode = _setmode(_fileno(stdout), _O_BINARY);
-#endif
-
- /* Initialize decoder
- */
- dk4rld_init(&dec, NULL);
-
- /* Process standard input.
- */
- while (EOF != (ic = fgetc(stdin))) {
- if (1 == stopped) {
- stopped = 2;
- /* Error: Addtional bytes after EOD marker */
- }
- switch (dk4rld_add(&dec, (unsigned char)ic, NULL)) {
- case DK4_EDSTM_FINISHED : {
- ucptr = NULL; sz = 0;
- if (0 != dk4rld_output(&ucptr, &sz, &dec, NULL)) {
- if ((NULL != ucptr) && (0 < sz)) {
- for (i = 0; i < sz; i++) {
- if (EOF == fputc((int)(ucptr[i]), stdout)) {
- exval = 1;
- /* Error: Failed to write to standard output */
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_STOP : {
- if (0 == stopped) { stopped = 1; }
- } break;
- case DK4_EDSTM_ERROR : {
- exval = 1;
- /* Error: Not properly run-length encoded data */
- } break;
- }
- }
-
- /* If successful so far, process final data from decoder
- and check for syntax error.
- */
- if (0 == exval) {
- switch (dk4rld_finish(&dec, NULL)) {
- case DK4_EDSTM_FINISHED : {
- ucptr = NULL; sz = 0;
- if (0 != dk4rld_output(&ucptr, &sz, &dec, NULL)) {
- if ((NULL != ucptr) && (0 < sz)) {
- for (i = 0; i < sz; i++) {
- if (EOF == fputc((int)(ucptr[i]), stdout)) {
- exval = 1;
- /* Error: Failed to write to standard output */
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_ERROR : {
- exval = 1;
- /* Error: Not properly run-length encoded data */
- } break;
- }
- }
-
- /* Restore previous file mode for stdin and stdout on Windows.
- */
-#if DK4_ON_WINDOWS
- fflush(stdout);
- _setmode(_fileno(stdout), oldomode);
- _setmode(_fileno(stdin), oldimode);
-#endif
-
- /* Exit, indicate success or error.
- */
- exit(exval); return exval;
-}
-
diff --git a/support/dktools/test-rld.ctr b/support/dktools/test-rld.ctr
deleted file mode 100644
index 2bd2984ceb..0000000000
--- a/support/dktools/test-rld.ctr
+++ /dev/null
@@ -1,112 +0,0 @@
-
-#include <stdio.h>
-#include "dk4rld.h"
-#include "dk4edstm.h"
-
-/*
- Example file for run-length decoding.
- The program reads data from standard input, applies
- run-length decoding and writes result data to standard
- output.
-
- For better understanding we only do minimal diagnostics
- here (set exit status code).
- In real world programs one would issue more diagnostics
- on problems.
-*/
-
-
-int main(int argc, char *argv[])
-{
- dk4_rl_dec_t dec; /* Decoder */
- const unsigned char *ucptr; /* Address of output buffer */
- size_t sz; /* Number of output characters */
- size_t i; /* Current output char index */
-#if DK4_ON_WINDOWS
- int oldimode; /* Old file mode for stdin */
- int oldomode; /* Old file mode for stdout */
-#endif
- int ic; /* Current input char from stdin */
- int stopped = 0; /* Flag: EOD found */
- int exval = 0; /* Exit status code */
-
- /* On Windows we must set stdin and stdout to binary mode explicitly.
- */
-#if DK4_ON_WINDOWS
- oldimode = _setmode(_fileno(stdin), _O_BINARY);
- oldomode = _setmode(_fileno(stdout), _O_BINARY);
-#endif
-
- /* Initialize decoder
- */
- dk4rld_init(&dec, NULL);
-
- /* Process standard input.
- */
- while (EOF != (ic = fgetc(stdin))) {
- if (1 == stopped) {
- stopped = 2;
- /* Error: Addtional bytes after EOD marker */
- }
- switch (dk4rld_add(&dec, (unsigned char)ic, NULL)) {
- case DK4_EDSTM_FINISHED : {
- ucptr = NULL; sz = 0;
- if (0 != dk4rld_output(&ucptr, &sz, &dec, NULL)) {
- if ((NULL != ucptr) && (0 < sz)) {
- for (i = 0; i < sz; i++) {
- if (EOF == fputc((int)(ucptr[i]), stdout)) {
- exval = 1;
- /* Error: Failed to write to standard output */
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_STOP : {
- if (0 == stopped) { stopped = 1; }
- } break;
- case DK4_EDSTM_ERROR : {
- exval = 1;
- /* Error: Not properly run-length encoded data */
- } break;
- }
- }
-
- /* If successful so far, process final data from decoder
- and check for syntax error.
- */
- if (0 == exval) {
- switch (dk4rld_finish(&dec, NULL)) {
- case DK4_EDSTM_FINISHED : {
- ucptr = NULL; sz = 0;
- if (0 != dk4rld_output(&ucptr, &sz, &dec, NULL)) {
- if ((NULL != ucptr) && (0 < sz)) {
- for (i = 0; i < sz; i++) {
- if (EOF == fputc((int)(ucptr[i]), stdout)) {
- exval = 1;
- /* Error: Failed to write to standard output */
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_ERROR : {
- exval = 1;
- /* Error: Not properly run-length encoded data */
- } break;
- }
- }
-
- /* Restore previous file mode for stdin and stdout on Windows.
- */
-#if DK4_ON_WINDOWS
- fflush(stdout);
- _setmode(_fileno(stdout), oldomode);
- _setmode(_fileno(stdin), oldimode);
-#endif
-
- /* Exit, indicate success or error.
- */
- exit(exval); return exval;
-}
-
diff --git a/support/dktools/test-rle.c b/support/dktools/test-rle.c
deleted file mode 100644
index 5aa2f27288..0000000000
--- a/support/dktools/test-rle.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-rle.ctr
-*/
-
-/** @file test-rle.c The test-rle module.
-*/
-
-
-#line 1 "test-rle.ctr"
-
-#include <stdio.h>
-#include "dk4rle.h"
-#include "dk4edstm.h"
-
-
-
-
-
-#line 9 "test-rle.ctr"
-
-
-
-/*
- Example file for run-length encoding.
- The program reads data from standard input, applies
- run-length encoding and writes result data to standard
- output.
-
- For better understanding we only do minimal diagnostics
- here (set exit status code).
- In real world programs one would issue more diagnostics
- on problems.
-*/
-
-
-int main(int argc, char *argv[])
-{
- dk4_rl_enc_t enc; /* Encoder */
- const unsigned char *ucptr; /* Address of output buffer */
- unsigned long offset; /* Current offset in file */
- size_t sz; /* Number of output characters */
- size_t i; /* Current output char index */
-#if DK4_ON_WINDOWS
- int oldimode; /* Old file mode for stdin */
- int oldomode; /* Old file mode for stdout */
-#endif
- int ic; /* Current input char from stdin */
- int exval = 0; /* Exit status code */
-
-
-
-#line 40 "test-rle.ctr"
-
-
-#line 41 "test-rle.ctr"
- /* On Windows we must set stdin and stdout to binary mode explicitly.
- */
-#if DK4_ON_WINDOWS
- oldimode = _setmode(_fileno(stdin), _O_BINARY);
- oldomode = _setmode(_fileno(stdout), _O_BINARY);
-#endif
-
- /* Initialize encoder.
- */
- dk4rle_init(&enc, 0, NULL);
-
-#line 51 "test-rle.ctr"
-
-
-#line 52 "test-rle.ctr"
-
- /* Process standard input.
- */
- offset = 0UL;
- while (EOF != (ic = fgetc(stdin))) {
-
-
-#line 58 "test-rle.ctr"
- switch (dk4rle_add(&enc, (unsigned char)ic, NULL)) {
- case DK4_EDSTM_FINISHED : {
-
-#line 60 "test-rle.ctr"
- ucptr = NULL; sz = 0;
- if (0 != dk4rle_output(&ucptr, &sz, &enc, NULL)) {
-
-#line 62 "test-rle.ctr"
- if ((NULL != ucptr) && (0 < sz)) {
-
-#line 63 "test-rle.ctr"
-
-
-#line 64 "test-rle.ctr"
- for (i = 0; i < sz; i++) {
-
-
-#line 66 "test-rle.ctr"
- if (EOF == fputc((int)(ucptr[i]), stdout)) {
-
-#line 67 "test-rle.ctr"
- exval = 1;
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_ERROR : {
-
-#line 74 "test-rle.ctr"
- exval = 1;
- } break;
- default : {
-
-#line 77 "test-rle.ctr"
- } break;
- }
- offset++;
- }
-
-
-#line 82 "test-rle.ctr"
-
- /* If successful so far, process final data from encoder.
- */
- if (0 == exval) {
-
-#line 86 "test-rle.ctr"
- switch (dk4rle_finish(&enc, NULL)) {
- case DK4_EDSTM_FINISHED : {
-
-#line 88 "test-rle.ctr"
- ucptr = NULL; sz = 0;
- if (0 != dk4rle_output(&ucptr, &sz, &enc, NULL)) {
- if ((NULL != ucptr) && (0 < sz)) {
-
-
-#line 92 "test-rle.ctr"
- for (i = 0; i < sz; i++) {
-
-
-#line 94 "test-rle.ctr"
- if (EOF == fputc((int)(ucptr[i]), stdout)) {
- exval = 1;
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_ERROR : {
-
-#line 102 "test-rle.ctr"
- exval = 1;
- } break;
- default : {
-
-#line 105 "test-rle.ctr"
- } break;
- }
- }
-
- /* Restore previous file mode for stdin and stdout on Windows.
- */
-#if DK4_ON_WINDOWS
- fflush(stdout);
- _setmode(_fileno(stdout), oldomode);
- _setmode(_fileno(stdin), oldimode);
-#endif
-
- /* Exit, indicate success or error.
- */
-
-
-#line 120 "test-rle.ctr"
-
-
-#line 121 "test-rle.ctr"
- exit(exval); return exval;
-}
-
diff --git a/support/dktools/test-rle.ctr b/support/dktools/test-rle.ctr
deleted file mode 100644
index bb20304f78..0000000000
--- a/support/dktools/test-rle.ctr
+++ /dev/null
@@ -1,123 +0,0 @@
-
-#include <stdio.h>
-#include "dk4rle.h"
-#include "dk4edstm.h"
-
-
-
-$!trace-include
-
-
-
-/*
- Example file for run-length encoding.
- The program reads data from standard input, applies
- run-length encoding and writes result data to standard
- output.
-
- For better understanding we only do minimal diagnostics
- here (set exit status code).
- In real world programs one would issue more diagnostics
- on problems.
-*/
-
-
-int main(int argc, char *argv[])
-{
- dk4_rl_enc_t enc; /* Encoder */
- const unsigned char *ucptr; /* Address of output buffer */
- unsigned long offset; /* Current offset in file */
- size_t sz; /* Number of output characters */
- size_t i; /* Current output char index */
-#if DK4_ON_WINDOWS
- int oldimode; /* Old file mode for stdin */
- int oldomode; /* Old file mode for stdout */
-#endif
- int ic; /* Current input char from stdin */
- int exval = 0; /* Exit status code */
-
- $!trace-init test-rle.deb
- $? "+ main"
- /* On Windows we must set stdin and stdout to binary mode explicitly.
- */
-#if DK4_ON_WINDOWS
- oldimode = _setmode(_fileno(stdin), _O_BINARY);
- oldomode = _setmode(_fileno(stdout), _O_BINARY);
-#endif
-
- /* Initialize encoder.
- */
- dk4rle_init(&enc, 0, NULL); $? ". initialized"
- $? ". enc->iused = %u", (unsigned)(enc.iused)
-
- /* Process standard input.
- */
- offset = 0UL;
- while (EOF != (ic = fgetc(stdin))) {
- $? ". new char, offset = %lu %lx", offset, offset
- switch (dk4rle_add(&enc, (unsigned char)ic, NULL)) {
- case DK4_EDSTM_FINISHED : { $? ". must retrieve output"
- ucptr = NULL; sz = 0;
- if (0 != dk4rle_output(&ucptr, &sz, &enc, NULL)) { $? ". output"
- if ((NULL != ucptr) && (0 < sz)) { $? ". pointers"
- $? ". write %u bytes", (unsigned)sz
- for (i = 0; i < sz; i++) {
- $? ". fputc %u = %02x", (unsigned)i, (unsigned)(ucptr[i])
- if (EOF == fputc((int)(ucptr[i]), stdout)) { $? "! EOF"
- exval = 1;
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_ERROR : { $? ". error"
- exval = 1;
- } break;
- default : { $? ". no action required"
- } break;
- }
- offset++;
- }
- $? ". all input processed"
-
- /* If successful so far, process final data from encoder.
- */
- if (0 == exval) { $? ". finish"
- switch (dk4rle_finish(&enc, NULL)) {
- case DK4_EDSTM_FINISHED : { $? ". output"
- ucptr = NULL; sz = 0;
- if (0 != dk4rle_output(&ucptr, &sz, &enc, NULL)) {
- if ((NULL != ucptr) && (0 < sz)) {
- $? ". write %u bytes", (unsigned)sz
- for (i = 0; i < sz; i++) {
- $? ". fputc %u %02x", (unsigned)i, (unsigned)(ucptr[i])
- if (EOF == fputc((int)(ucptr[i]), stdout)) {
- exval = 1;
- }
- }
- }
- }
- } break;
- case DK4_EDSTM_ERROR : { $? "! error"
- exval = 1;
- } break;
- default : { $? ". no action required"
- } break;
- }
- }
-
- /* Restore previous file mode for stdin and stdout on Windows.
- */
-#if DK4_ON_WINDOWS
- fflush(stdout);
- _setmode(_fileno(stdout), oldomode);
- _setmode(_fileno(stdin), oldimode);
-#endif
-
- /* Exit, indicate success or error.
- */
- $? "- main %d", exval
- $!trace-end
- exit(exval); return exval;
-}
-
diff --git a/support/dktools/test-ser.c b/support/dktools/test-ser.c
deleted file mode 100644
index f8c9af214f..0000000000
--- a/support/dktools/test-ser.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-ser.ctr
-*/
-
-/** @file test-ser.c The test-ser module.
-*/
-
-
-#line 1 "test-ser.ctr"
-
-#include <stdio.h>
-#include <stdint.h>
-#define _USE_MATH_DEFINES 1
-#include <math.h>
-
-
-#include "dk4mem.h"
-#include "dk4serf.h"
-#include "dk4userf.h"
-#include "dk4app.h"
-#include "dk4str8.h"
-
-
-
-static const dkChar * const test_ser_help_text[] = {
-dkT("This is a test program to create directories."),
-NULL
-
-
-#line 20 "test-ser.ctr"
-};
-
-static const dkChar * const test_ser_license_text[] = {
-dkT("Copyright (c) 2014-2016, Dirk Krause"),
-dkT("All rights reserved."),
-dkT(""),
-dkT("Redistribution and use in source and binary forms, with or without"),
-dkT("modification, are permitted provided that the following conditions"),
-dkT("are met:"),
-dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
-dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
-dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN"),
-dkT("ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
-dkT("POSSIBILITY OF SUCH DAMAGE."),
-NULL
-
-
-#line 54 "test-ser.ctr"
-};
-
-static uint16_t td1[] = { 2U, 4U, 6U, 8U, 1U , 3U, 5U, 7U };
-
-static const size_t sztd1 = DK4_SIZEOF(td1,uint16_t);
-
-static uint32_t td2[] = { 64UL, 66UL, 68UL, 70UL, 65UL, 67UL, 69UL, 71UL};
-
-static const size_t sztd2 = DK4_SIZEOF(td2,uint32_t);
-
-static int16_t td3[] = { 128, 130, 132, 129, 131, 133 };
-
-static const size_t sztd3 = DK4_SIZEOF(td3,int16_t);
-
-static int32_t td4[] = { 256L, 258L, 260L, 257L, 259L, 261L };
-
-static double td5[] = { M_PI, (M_PI_2 / 10.0) , (M_PI_4 * 100.0) };
-
-static const size_t sztd5 = DK4_SIZEOF(td5,double);
-
-static const size_t sztd4 = DK4_SIZEOF(td4,int32_t);
-
-static const dkChar ts[] = { dkT("Dies ist ein Test mit äöüßÄÖÜ blubb.") };
-
-
-/** Application structure.
-*/
-static dk4_app_t *app = NULL;
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- char buf[64];
- FILE *fipo;
- size_t i;
- int exv = EXIT_FAILURE;
- int de = 0;
-
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-ser.txt"), test_ser_help_text,
- test_ser_license_text
- );
- if (NULL != app) {
- de = dk4app_get_encoding(app);
- fipo = fopen("test-ser.out", "wb");
- if (NULL != fipo) {
- exv = EXIT_SUCCESS;
- for (i = 0; i < sztd1; i++) {
- if (0 == dk4serialize_file_uint16_t(fipo, td1[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- for (i = 0; i < sztd3; i++) {
- if (0 == dk4serialize_file_int16_t(fipo, td3[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- if (0 == dk4serialize_file_dk_string(fipo, ts, de, NULL)) {
- exv = EXIT_FAILURE;
- }
- for (i = 0; i < sztd2; i++) {
- if (0 == dk4serialize_file_uint32_t(fipo, td2[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- for (i = 0; i < sztd4; i++) {
- if (0 == dk4serialize_file_int32_t(fipo, td4[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- for (i = 0; i < sztd5; i++) {
- if (0 == dk4serialize_file_double(fipo, td5[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- fclose(fipo);
- }
- dk4app_close(app);
- }
- return exv;
-}
-
diff --git a/support/dktools/test-ser.ctr b/support/dktools/test-ser.ctr
deleted file mode 100644
index 1fc37470f6..0000000000
--- a/support/dktools/test-ser.ctr
+++ /dev/null
@@ -1,146 +0,0 @@
-
-#include <stdio.h>
-#include <stdint.h>
-#define _USE_MATH_DEFINES 1
-#include <math.h>
-
-
-#include "dk4mem.h"
-#include "dk4serf.h"
-#include "dk4userf.h"
-#include "dk4app.h"
-#include "dk4str8.h"
-
-
-
-static const dkChar * const test_ser_help_text[] = {
-$!text macro=dkT
-This is a test program to create directories.
-$!end
-};
-
-static const dkChar * const test_ser_license_text[] = {
-$!text macro=dkT
-Copyright (c) 2014-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-$!end
-};
-
-static uint16_t td1[] = { 2U, 4U, 6U, 8U, 1U , 3U, 5U, 7U };
-
-static const size_t sztd1 = DK4_SIZEOF(td1,uint16_t);
-
-static uint32_t td2[] = { 64UL, 66UL, 68UL, 70UL, 65UL, 67UL, 69UL, 71UL};
-
-static const size_t sztd2 = DK4_SIZEOF(td2,uint32_t);
-
-static int16_t td3[] = { 128, 130, 132, 129, 131, 133 };
-
-static const size_t sztd3 = DK4_SIZEOF(td3,int16_t);
-
-static int32_t td4[] = { 256L, 258L, 260L, 257L, 259L, 261L };
-
-static double td5[] = { M_PI, (M_PI_2 / 10.0) , (M_PI_4 * 100.0) };
-
-static const size_t sztd5 = DK4_SIZEOF(td5,double);
-
-static const size_t sztd4 = DK4_SIZEOF(td4,int32_t);
-
-static const dkChar ts[] = { dkT("Dies ist ein Test mit äöüßÄÖÜ blubb.") };
-
-
-/** Application structure.
-*/
-static dk4_app_t *app = NULL;
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- char buf[64];
- FILE *fipo;
- size_t i;
- int exv = EXIT_FAILURE;
- int de = 0;
-
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-ser.txt"), test_ser_help_text,
- test_ser_license_text
- );
- if (NULL != app) {
- de = dk4app_get_encoding(app);
- fipo = fopen("test-ser.out", "wb");
- if (NULL != fipo) {
- exv = EXIT_SUCCESS;
- for (i = 0; i < sztd1; i++) {
- if (0 == dk4serialize_file_uint16_t(fipo, td1[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- for (i = 0; i < sztd3; i++) {
- if (0 == dk4serialize_file_int16_t(fipo, td3[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- if (0 == dk4serialize_file_dk_string(fipo, ts, de, NULL)) {
- exv = EXIT_FAILURE;
- }
- for (i = 0; i < sztd2; i++) {
- if (0 == dk4serialize_file_uint32_t(fipo, td2[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- for (i = 0; i < sztd4; i++) {
- if (0 == dk4serialize_file_int32_t(fipo, td4[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- for (i = 0; i < sztd5; i++) {
- if (0 == dk4serialize_file_double(fipo, td5[i], NULL)) {
- exv = EXIT_FAILURE;
- }
- }
- fclose(fipo);
- }
- dk4app_close(app);
- }
- return exv;
-}
-
diff --git a/support/dktools/test-skip.c b/support/dktools/test-skip.c
deleted file mode 100644
index 7a1c2a4f67..0000000000
--- a/support/dktools/test-skip.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-skip.ctr
-*/
-
-/** @file test-skip.c The test-skip module.
-*/
-
-
-#line 1 "test-skip.ctr"
-
-#include <stdio.h>
-
-#include <dk4str8.h>
-
-const char testline[] = { " Dies ist ein Test." };
-
-
-int main(void)
-{
- const char *text;
- size_t i;
-
- for (i = 0; i < 6; i++) {
- text = dk4str8_skip(testline, i);
- printf("%u \"%s\"\n", (unsigned)i, ((NULL != text) ? text : "(NULL)"));
- }
- return 0;
-}
diff --git a/support/dktools/test-skip.ctr b/support/dktools/test-skip.ctr
deleted file mode 100644
index 651375b86d..0000000000
--- a/support/dktools/test-skip.ctr
+++ /dev/null
@@ -1,19 +0,0 @@
-
-#include <stdio.h>
-
-#include <dk4str8.h>
-
-const char testline[] = { " Dies ist ein Test." };
-
-
-int main(void)
-{
- const char *text;
- size_t i;
-
- for (i = 0; i < 6; i++) {
- text = dk4str8_skip(testline, i);
- printf("%u \"%s\"\n", (unsigned)i, ((NULL != text) ? text : "(NULL)"));
- }
- return 0;
-}
diff --git a/support/dktools/test-sock.c b/support/dktools/test-sock.c
deleted file mode 100644
index 3b506ddf21..0000000000
--- a/support/dktools/test-sock.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-sock.ctr
-*/
-
-/*
-Copyright (C) 2015-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** @file test-sock.c The test-sock module.
-*/
-
-
-#line 10 "test-sock.ctr"
-
-#define TEST_SOCK_USE_APP 1
-#define TEST_SOCK_REMOTE_SERVER "s-ka.e-technik.fh-schmalkalden.de"
-#define TEST_SOCK_REMOTE_PORT 80
-#define TEST_SOCK_LOCAL_PORT 55555
-#define TEST_SOCK_TIMEOUT_SEC 0L
-#define TEST_SOCK_TIMEOUT_USEC 0L
-
-#include "dk4conf.h"
-#include "dk4app.h"
-#include "dk4sock.h"
-#include "dk4socka.h"
-#include "dk4vers.h"
-#include "dk4fput.h"
-
-
-
-
-
-#line 28 "test-sock.ctr"
-
-
-
-static const dkChar server[] = { dkT("s-ka.e-technik.fh-schmalkalden.de") };
-
-static const char request[] = {
- "GET /index.html HTTP/1.0\r\n\r\n"
-};
-
-
-static const dkChar * const help_text[] = {
-/* 0 */
-dkT("Nix Hilfe!"),
-
-NULL
-
-
-#line 42 "test-sock.ctr"
-};
-
-static const dkChar * const license_text[] = {
-/* 0 */
-dkT("BSD"),
-
-NULL
-
-
-#line 48 "test-sock.ctr"
-};
-
-static const dkChar * const kw_def[] = {
-/* 0 */
-dkT("Failed to create socket!"),
-
-/* 1 */
-dkT("Failed to bring Winsock up!"),
-
-/* 2 */
-dkT("Failed to send data!"),
-
-NULL
-
-
-#line 65 "test-sock.ctr"
-};
-
-static size_t sz_kw_def = sizeof(kw_def)/sizeof(DK4_PCDKCHAR);
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
-#if TEST_SOCK_USE_APP
- char buf[512];
- dk4_app_t *app = NULL;
- size_t rql;
- dk4_socket_t sock;
-#if DK4_ON_WINDOWS
- int bytes;
-#else
- ssize_t bytes;
-#endif
-
-
-#line 91 "test-sock.ctr"
-
-
-#line 92 "test-sock.ctr"
- dk4fput_initialize_stderr();
- app = dk4app_open_cmd(
- argc, argv, NULL, 0, dkT("dktools"), DKT_VERSION_DK,
- dkT("test-sock.txt"), help_text, license_text
- );
- if (NULL != app) {
- if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up_app(app)) {
-
-#line 99 "test-sock.ctr"
- rql = strlen(request);
- sock = dk4socket_tcp_client_for_host_port_app(
- server, TEST_SOCK_REMOTE_PORT, TEST_SOCK_LOCAL_PORT,
- TEST_SOCK_TIMEOUT_SEC, TEST_SOCK_TIMEOUT_USEC, app
- );
- if (INVALID_SOCKET != sock) {
-
-#line 105 "test-sock.ctr"
- bytes = send(sock, request, rql, 0);
- if (bytes == rql) {
-
-#line 107 "test-sock.ctr"
- do {
- bytes = recv(sock, buf, sizeof(buf), 0);
- if (0 < bytes) {
- fwrite(buf, 1, bytes, stdout);
- }
- } while(0 < bytes);
- fputc('\n', stdout);
- } else {
-
-#line 115 "test-sock.ctr"
- dk4app_log_1(app, kw_def, sz_kw_def, DK4_LL_ERROR, 2);
- }
- dk4socket_close(sock, NULL);
- } else {
-
-#line 119 "test-sock.ctr"
- dk4app_log_1(app, kw_def, sz_kw_def, DK4_LL_ERROR, 0);
- }
- dk4socket_down_app(app);
- } else {
-
-#line 123 "test-sock.ctr"
- dk4app_log_1(app, kw_def, sz_kw_def, DK4_LL_ERROR, 1);
- }
- dk4app_close(app);
- }
- fflush(stderr);
- dk4fput_cleanup_stderr();
-
-
-#line 130 "test-sock.ctr"
-
-
-#line 131 "test-sock.ctr"
- exit(0); return 0;
-#else
- char buf[512];
- size_t rql;
- dk4_socket_t sock;
-#if DK4_ON_WINDOWS
- int bytes;
-#else
- ssize_t bytes;
-#endif
-
-
-#line 142 "test-sock.ctr"
-
-
-#line 143 "test-sock.ctr"
- rql = strlen(request);
- if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up(NULL)) {
-
-#line 145 "test-sock.ctr"
- sock = dk4socket_tcp_client_host_port(
- server, TEST_SOCK_REMOTE_PORT, TEST_SOCK_LOCAL_PORT,
- TEST_SOCK_TIMEOUT_SEC, TEST_SOCK_TIMEOUT_USEC, NULL
- );
- if (INVALID_SOCKET != sock) {
-
-#line 150 "test-sock.ctr"
- bytes = send(sock, request, rql, 0);
- if (bytes == rql) {
-
-#line 152 "test-sock.ctr"
- do {
- bytes = recv(sock, buf, sizeof(buf), 0);
- if (0 < bytes) {
- fwrite(buf, 1, bytes, stdout);
- }
- } while(0 < bytes);
- fputc('\n', stdout);
- } else {
-
-#line 160 "test-sock.ctr"
- }
- dk4socket_close(sock, NULL);
- } else {
-
-#line 163 "test-sock.ctr"
- }
- dk4socket_down(NULL);
- } else {
-
-#line 166 "test-sock.ctr"
- }
-
-
-#line 168 "test-sock.ctr"
-
-
-#line 169 "test-sock.ctr"
- exit(0); return 0;
-#endif
-}
-
-
diff --git a/support/dktools/test-sock.ctr b/support/dktools/test-sock.ctr
deleted file mode 100644
index 57f4570b7e..0000000000
--- a/support/dktools/test-sock.ctr
+++ /dev/null
@@ -1,173 +0,0 @@
-%% options
-
-copyright owner = Dirk Krause
-copyright year = 2015-xxxx
-license = bsd
-
-
-
-%% module
-
-#define TEST_SOCK_USE_APP 1
-#define TEST_SOCK_REMOTE_SERVER "s-ka.e-technik.fh-schmalkalden.de"
-#define TEST_SOCK_REMOTE_PORT 80
-#define TEST_SOCK_LOCAL_PORT 55555
-#define TEST_SOCK_TIMEOUT_SEC 0L
-#define TEST_SOCK_TIMEOUT_USEC 0L
-
-#include "dk4conf.h"
-#include "dk4app.h"
-#include "dk4sock.h"
-#include "dk4socka.h"
-#include "dk4vers.h"
-#include "dk4fput.h"
-
-
-
-$!trace-include
-
-
-
-static const dkChar server[] = { dkT("s-ka.e-technik.fh-schmalkalden.de") };
-
-static const char request[] = {
- "GET /index.html HTTP/1.0\r\n\r\n"
-};
-
-
-static const dkChar * const help_text[] = {
-$!string-table macro=dkT
-Nix Hilfe!
-$!end
-};
-
-static const dkChar * const license_text[] = {
-$!string-table macro=dkT
-BSD
-$!end
-};
-
-static const dkChar * const kw_def[] = {
-$!string-table macro=dkT
-#
-# 0
-#
-Failed to create socket!
-#
-# 1
-#
-Failed to bring Winsock up!
-#
-# 2
-#
-Failed to send data!
-$!end
-};
-
-static size_t sz_kw_def = sizeof(kw_def)/sizeof(DK4_PCDKCHAR);
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
-#if TEST_SOCK_USE_APP
- char buf[512];
- dk4_app_t *app = NULL;
- size_t rql;
- dk4_socket_t sock;
-#if DK4_ON_WINDOWS
- int bytes;
-#else
- ssize_t bytes;
-#endif
- $!trace-init test-sock.deb
- $? "+ main"
- dk4fput_initialize_stderr();
- app = dk4app_open_cmd(
- argc, argv, NULL, 0, dkT("dktools"), DKT_VERSION_DK,
- dkT("test-sock.txt"), help_text, license_text
- );
- if (NULL != app) {
- if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up_app(app)) { $? ". up"
- rql = strlen(request);
- sock = dk4socket_tcp_client_for_host_port_app(
- server, TEST_SOCK_REMOTE_PORT, TEST_SOCK_LOCAL_PORT,
- TEST_SOCK_TIMEOUT_SEC, TEST_SOCK_TIMEOUT_USEC, app
- );
- if (INVALID_SOCKET != sock) { $? ". socket ok"
- bytes = send(sock, request, rql, 0);
- if (bytes == rql) { $? ". send ok"
- do {
- bytes = recv(sock, buf, sizeof(buf), 0);
- if (0 < bytes) {
- fwrite(buf, 1, bytes, stdout);
- }
- } while(0 < bytes);
- fputc('\n', stdout);
- } else { $? "! send failed"
- dk4app_log_1(app, kw_def, sz_kw_def, DK4_LL_ERROR, 2);
- }
- dk4socket_close(sock, NULL);
- } else { $? "! invalid socket"
- dk4app_log_1(app, kw_def, sz_kw_def, DK4_LL_ERROR, 0);
- }
- dk4socket_down_app(app);
- } else { $? "! Winsock up"
- dk4app_log_1(app, kw_def, sz_kw_def, DK4_LL_ERROR, 1);
- }
- dk4app_close(app);
- }
- fflush(stderr);
- dk4fput_cleanup_stderr();
- $? "- main"
- $!trace-end
- exit(0); return 0;
-#else
- char buf[512];
- size_t rql;
- dk4_socket_t sock;
-#if DK4_ON_WINDOWS
- int bytes;
-#else
- ssize_t bytes;
-#endif
- $!trace-init test-sock.deb
- $? "+ main"
- rql = strlen(request);
- if (DK4_SOCKET_RESULT_SUCCESS == dk4socket_up(NULL)) { $? ". up"
- sock = dk4socket_tcp_client_host_port(
- server, TEST_SOCK_REMOTE_PORT, TEST_SOCK_LOCAL_PORT,
- TEST_SOCK_TIMEOUT_SEC, TEST_SOCK_TIMEOUT_USEC, NULL
- );
- if (INVALID_SOCKET != sock) { $? ". socket"
- bytes = send(sock, request, rql, 0);
- if (bytes == rql) { $? ". send"
- do {
- bytes = recv(sock, buf, sizeof(buf), 0);
- if (0 < bytes) {
- fwrite(buf, 1, bytes, stdout);
- }
- } while(0 < bytes);
- fputc('\n', stdout);
- } else { $? "! send"
- }
- dk4socket_close(sock, NULL);
- } else { $? "! socket"
- }
- dk4socket_down(NULL);
- } else { $? "! failed to bring Winsock up"
- }
- $? "- main"
- $!trace-end
- exit(0); return 0;
-#endif
-}
-
-
diff --git a/support/dktools/test-sqdbl.c b/support/dktools/test-sqdbl.c
deleted file mode 100644
index 2f307a1aad..0000000000
--- a/support/dktools/test-sqdbl.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-sqdbl.ctr
-*/
-
-/** @file test-sqdbl.c The test-sqdbl module.
-*/
-
-
-#line 1 "test-sqdbl.ctr"
-
-#include "dk4conf.h"
-#include "dk4types.h"
-
-#include <stdio.h>
-#include <math.h>
-
-#include "dk4str8.h"
-
-
-
-
-
-#line 13 "test-sqdbl.ctr"
-
-
-
-int main(void)
-{
- char buf[64];
- double v;
- int i;
-
- v = 5.555 / 1000000.0;
- for (i = 0; i < 12; i++) {
- if (0 != dk4str8_double_to_string(buf, sizeof(buf), v, 0, NULL)) {
- fputs(buf, stdout);
- fputc('\n', stdout);
- }
- if (0 != dk4str8_double_to_string(buf, sizeof(buf), v, 1, NULL)) {
- fputs(buf, stdout);
- fputc('\n', stdout);
- }
- v = 10.0 * v;
- fputc('\n', stdout);
- }
- return 0;
-}
-
diff --git a/support/dktools/test-sqdbl.ctr b/support/dktools/test-sqdbl.ctr
deleted file mode 100644
index 6ec065e36f..0000000000
--- a/support/dktools/test-sqdbl.ctr
+++ /dev/null
@@ -1,37 +0,0 @@
-
-#include "dk4conf.h"
-#include "dk4types.h"
-
-#include <stdio.h>
-#include <math.h>
-
-#include "dk4str8.h"
-
-
-
-$!trace-include
-
-
-
-int main(void)
-{
- char buf[64];
- double v;
- int i;
-
- v = 5.555 / 1000000.0;
- for (i = 0; i < 12; i++) {
- if (0 != dk4str8_double_to_string(buf, sizeof(buf), v, 0, NULL)) {
- fputs(buf, stdout);
- fputc('\n', stdout);
- }
- if (0 != dk4str8_double_to_string(buf, sizeof(buf), v, 1, NULL)) {
- fputs(buf, stdout);
- fputc('\n', stdout);
- }
- v = 10.0 * v;
- fputc('\n', stdout);
- }
- return 0;
-}
-
diff --git a/support/dktools/test-strms.c b/support/dktools/test-strms.c
deleted file mode 100644
index 17b860fe3d..0000000000
--- a/support/dktools/test-strms.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-strms.ctr
-*/
-
-/** @file test-strms.c The test-strms module.
-*/
-
-
-#line 1 "test-strms.ctr"
-
-#include "dk4conf.h"
-
-#include <math.h>
-
-#include "dk4strm.h"
-#include "dk4strmw.h"
-#include "dk4strms.h"
-
-static const char t1[] = { "Dies ist ein Test-String." };
-
-int main(void)
-{
- dk4_stream_t *wrstr;
-
- wrstr = dk4stream_open_file_writer("/tmp/test.dat.gz", NULL);
- if (NULL != wrstr) {
- dk4stream_serialize_u32(wrstr, 25UL, NULL);
- dk4stream_serialize_i32(wrstr, -16L, NULL);
- dk4stream_serialize_string(wrstr, t1, NULL);
- dk4stream_serialize_u16(wrstr, 50U, NULL);
- dk4stream_serialize_double(wrstr, M_PI, 1.0e-6, NULL);
- dk4stream_serialize_i16(wrstr, -32, NULL);
- dk4stream_serialize_double_0(wrstr, NULL);
- dk4stream_serialize_u8(wrstr, 100, NULL);
- dk4stream_serialize_i8(wrstr, -64, NULL);
- dk4stream_close(wrstr, NULL);
- }
- else {
- }
- return 0;
-}
-
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/test-strms.ctr b/support/dktools/test-strms.ctr
deleted file mode 100644
index dd4910804c..0000000000
--- a/support/dktools/test-strms.ctr
+++ /dev/null
@@ -1,36 +0,0 @@
-
-#include "dk4conf.h"
-
-#include <math.h>
-
-#include "dk4strm.h"
-#include "dk4strmw.h"
-#include "dk4strms.h"
-
-static const char t1[] = { "Dies ist ein Test-String." };
-
-int main(void)
-{
- dk4_stream_t *wrstr;
-
- wrstr = dk4stream_open_file_writer("/tmp/test.dat.gz", NULL);
- if (NULL != wrstr) {
- dk4stream_serialize_u32(wrstr, 25UL, NULL);
- dk4stream_serialize_i32(wrstr, -16L, NULL);
- dk4stream_serialize_string(wrstr, t1, NULL);
- dk4stream_serialize_u16(wrstr, 50U, NULL);
- dk4stream_serialize_double(wrstr, M_PI, 1.0e-6, NULL);
- dk4stream_serialize_i16(wrstr, -32, NULL);
- dk4stream_serialize_double_0(wrstr, NULL);
- dk4stream_serialize_u8(wrstr, 100, NULL);
- dk4stream_serialize_i8(wrstr, -64, NULL);
- dk4stream_close(wrstr, NULL);
- }
- else {
- }
- return 0;
-}
-
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/test-strmu.c b/support/dktools/test-strmu.c
deleted file mode 100644
index a16915a5c4..0000000000
--- a/support/dktools/test-strmu.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-strmu.ctr
-*/
-
-/** @file test-strmu.c The test-strmu module.
-*/
-
-
-#line 1 "test-strmu.ctr"
-
-
-#include "dk4conf.h"
-
-#include "dk4mem.h"
-#include "dk4strmr.h"
-#include "dk4strmu.h"
-
-
-
-int main(void)
-{
- dk4_er_t er;
- dk4_stream_t *rdstrm = NULL;
- char *cptr = NULL;
- double d = 0.0;
- uint32_t u32 = 0UL;
- int32_t i32 = 0L;
- uint16_t u16 = 0U;
- int16_t i16 = 0;
- uint8_t u8 = (uint8_t)0;
- int8_t i8 = (int8_t)0;
-
-
- rdstrm = dk4stream_open_file_reader("/tmp/test.dat.gz", NULL);
- if (NULL == rdstrm) {
- goto finished;
- }
-
- if (0 == dk4stream_unser_u32(&u32, rdstrm, NULL)) {
- fputs("u32 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("u32 = %lu\n", (unsigned long)u32);
-
- if (0 == dk4stream_unser_i32(&i32, rdstrm, NULL)) {
- fputs("i32 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("i32 = %ld\n", (long)i32);
-
- if (0 == dk4stream_unser_string(&cptr, rdstrm, NULL)) {
- fputs("str failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("str = \"%s\"\n", ((NULL != cptr) ? cptr : "NULL"));
-
- if (0 == dk4stream_unser_u16(&u16, rdstrm, NULL)) {
- fputs("u16 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("u16 = %u\n", (unsigned)u16);
-
- if (0 == dk4stream_unser_double(&d, rdstrm, NULL)) {
- fputs("dbl failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("d = %g\n", d);
-
- if (0 == dk4stream_unser_i16(&i16, rdstrm, NULL)) {
- fputs("i16 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("i16 = %d\n", (int)i16);
-
- d = 5.0;
- if (0 == dk4stream_unser_double(&d, rdstrm, NULL)) {
- fputs("dbl failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("d = %g\n", d);
-
- if (0 == dk4stream_unser_u8(&u8, rdstrm, NULL)) {
- fputs("u8 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("u8 = %u\n", (unsigned)u8);
-
- if (0 == dk4stream_unser_i8(&i8, rdstrm, NULL)) {
- fputs("i8 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("i8 = %d\n", (int)i8);
-
- dk4error_init(&er);
- if (0 == dk4stream_unser_i8(&i8, rdstrm, &er)) {
- fputs("i8 failed!\n", stderr); fflush(stderr);
- fprintf(stderr, "Error code: %d\n", er.ec);
- goto finished;
- }
- printf("i8 = %d\n", (int)i8);
-
- finished:
- if (NULL != cptr) {
- dk4mem_free(cptr);
- }
- if (NULL != rdstrm) {
- dk4stream_close(rdstrm, NULL);
- }
- return 0;
-}
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/test-strmu.ctr b/support/dktools/test-strmu.ctr
deleted file mode 100644
index 3653cf6f6b..0000000000
--- a/support/dktools/test-strmu.ctr
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-#include "dk4conf.h"
-
-#include "dk4mem.h"
-#include "dk4strmr.h"
-#include "dk4strmu.h"
-
-
-
-int main(void)
-{
- dk4_er_t er;
- dk4_stream_t *rdstrm = NULL;
- char *cptr = NULL;
- double d = 0.0;
- uint32_t u32 = 0UL;
- int32_t i32 = 0L;
- uint16_t u16 = 0U;
- int16_t i16 = 0;
- uint8_t u8 = (uint8_t)0;
- int8_t i8 = (int8_t)0;
-
-
- rdstrm = dk4stream_open_file_reader("/tmp/test.dat.gz", NULL);
- if (NULL == rdstrm) {
- goto finished;
- }
-
- if (0 == dk4stream_unser_u32(&u32, rdstrm, NULL)) {
- fputs("u32 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("u32 = %lu\n", (unsigned long)u32);
-
- if (0 == dk4stream_unser_i32(&i32, rdstrm, NULL)) {
- fputs("i32 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("i32 = %ld\n", (long)i32);
-
- if (0 == dk4stream_unser_string(&cptr, rdstrm, NULL)) {
- fputs("str failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("str = \"%s\"\n", ((NULL != cptr) ? cptr : "NULL"));
-
- if (0 == dk4stream_unser_u16(&u16, rdstrm, NULL)) {
- fputs("u16 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("u16 = %u\n", (unsigned)u16);
-
- if (0 == dk4stream_unser_double(&d, rdstrm, NULL)) {
- fputs("dbl failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("d = %g\n", d);
-
- if (0 == dk4stream_unser_i16(&i16, rdstrm, NULL)) {
- fputs("i16 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("i16 = %d\n", (int)i16);
-
- d = 5.0;
- if (0 == dk4stream_unser_double(&d, rdstrm, NULL)) {
- fputs("dbl failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("d = %g\n", d);
-
- if (0 == dk4stream_unser_u8(&u8, rdstrm, NULL)) {
- fputs("u8 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("u8 = %u\n", (unsigned)u8);
-
- if (0 == dk4stream_unser_i8(&i8, rdstrm, NULL)) {
- fputs("i8 failed!\n", stderr); fflush(stderr);
- goto finished;
- }
- printf("i8 = %d\n", (int)i8);
-
- dk4error_init(&er);
- if (0 == dk4stream_unser_i8(&i8, rdstrm, &er)) {
- fputs("i8 failed!\n", stderr); fflush(stderr);
- fprintf(stderr, "Error code: %d\n", er.ec);
- goto finished;
- }
- printf("i8 = %d\n", (int)i8);
-
- finished:
- if (NULL != cptr) {
- dk4mem_free(cptr);
- }
- if (NULL != rdstrm) {
- dk4stream_close(rdstrm, NULL);
- }
- return 0;
-}
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/test-strmw.c b/support/dktools/test-strmw.c
deleted file mode 100644
index 955cfebac8..0000000000
--- a/support/dktools/test-strmw.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-strmw.ctr
-*/
-
-/** @file test-strmw.c The test-strmw module.
-*/
-
-
-#line 1 "test-strmw.ctr"
-
-
-
-#include "dk4conf.h"
-#include "dk4types.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include "dk4strm.h"
-#include "dk4strmf.h"
-#include "dk4fopc8.h"
-#include "dk4strmw.h"
-
-
-
-
-
-#line 18 "test-strmw.ctr"
-
-
-
-/** License conditions.
-*/
-static const char * const test_text[] = {
-"This software uses code from the following projects, either directly or as",
-"a library:",
-"",
-"dktools\t\tDirk Krause's tools and libraries.",
-"\t\tSee http://dktools.sourceforge.net/ for more information.",
-#if DK4_HAVE_ZLIB_H
-"",
-"zlib\t\tData compression library.",
-"\t\tSee http://www.zlib.net/ for more information.",
-#endif
-#if DK4_HAVE_BZLIB_H
-"",
-"bzip2\t\tData compression program and library.",
-"\t\tSee http://www.bzip.org/ for more information.",
-#endif
-#if DK4_HAVE_OPENSSL_MD5_H && DK4_HAVE_OPENSSL_SHA_H && DK4_HAVE_OPENSSL_RIPEMD_H
-"",
-"OpenSSL\t\tCryptographic toolkit, used to build file checksums here.",
-"\t\tSee http://www.openssl.org/ for more information.",
-"",
-"This product includes software developed by the OpenSSL Project for use in",
-"the OpenSSL Toolkit (http://www.openssl.org/).",
-"This product includes cryptographic software written by",
-"Eric Young (eay@cryptsoft.com).",
-"This product includes software written by Tim Hudson (tjh@cryptsoft.com).",
-#endif
-"",
-"All the licenses below apply to the program.",
-"Licenses for used libraries are shown as found on my Scientific Linux 6.x",
-"computer in the /usr/share/doc directory on 2015-04-01. Check the project",
-"homepages of the used libraries for additional information and/or updated",
-"license terms.",
-"",
-"",
-"DK tools and libraries license",
-"==============================",
-"Copyright (c) 2015-2016, Dirk Krause",
-"All rights reserved.",
-"",
-"Redistribution and use in source and binary forms, with or without",
-"modification, are permitted provided that the following conditions are met:",
-"",
-"* Redistributions of source code must retain the above copyright notice,",
-" this list of conditions and the following disclaimer.",
-"* Redistributions in binary form must reproduce the above copyright",
-" notice, this list of conditions and the following disclaimer in the",
-" documentation and/or other materials provided with the distribution.",
-"* Neither the name of the Dirk Krause nor the names of contributors may be",
-" used to endorse or promote products derived from this software without",
-" specific prior written permission.",
-"",
-"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"",
-"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
-"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE",
-"ARE DISCLAIMED.",
-"",
-"IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,",
-"INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,",
-"BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,",
-"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY",
-"OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING",
-"NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,",
-"EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
-#if DK4_HAVE_ZLIB_H
-"",
-"",
-"Zlib license",
-"============",
-"(C) 1995-2004 Jean-loup Gailly and Mark Adler",
-"",
-"This software is provided 'as-is', without any express or implied",
-"warranty. In no event will the authors be held liable for any damages",
-"arising from the use of this software.",
-"",
-"Permission is granted to anyone to use this software for any purpose,",
-"including commercial applications, and to alter it and redistribute it",
-"freely, subject to the following restrictions:",
-"",
-"1. The origin of this software must not be misrepresented; you must not",
-" claim that you wrote the original software. If you use this software",
-" in a product, an acknowledgment in the product documentation would be",
-" appreciated but is not required.",
-"2. Altered source versions must be plainly marked as such, and must not be",
-" misrepresented as being the original software.",
-"3. This notice may not be removed or altered from any source distribution.",
-"",
-"Jean-loup Gailly Mark Adler",
-"jloup@gzip.org madler@alumni.caltech.edu",
-#endif
-#if DK4_HAVE_BZLIB_H
-"",
-"",
-"Bzip2 and libbzip2 library license",
-"==================================",
-"This program, \"bzip2\", the associated library \"libbzip2\", and all",
-"documentation, are copyright (C) 1996-2007 Julian R Seward. All",
-"rights reserved.",
-"",
-"Redistribution and use in source and binary forms, with or without",
-"modification, are permitted provided that the following conditions",
-"are met:",
-"",
-"1. Redistributions of source code must retain the above copyright",
-" notice, this list of conditions and the following disclaimer.",
-"",
-"2. The origin of this software must not be misrepresented; you must ",
-" not claim that you wrote the original software. If you use this ",
-" software in a product, an acknowledgment in the product ",
-" documentation would be appreciated but is not required.",
-"",
-"3. Altered source versions must be plainly marked as such, and must",
-" not be misrepresented as being the original software.",
-"",
-"4. The name of the author may not be used to endorse or promote ",
-" products derived from this software without specific prior written ",
-" permission.",
-"",
-"THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS",
-"OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED",
-"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE",
-"ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY",
-"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL",
-"DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE",
-"GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS",
-"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,",
-"WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING",
-"NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS",
-"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
-"",
-"Julian Seward, jseward@bzip.org",
-"bzip2/libbzip2 version 1.0.5 of 10 December 2007",
-#endif
-#if DK4_HAVE_OPENSSL_MD5_H && DK4_HAVE_OPENSSL_SHA_H && DK4_HAVE_OPENSSL_RIPEMD_H
-"",
-"",
-"OpenSSL license",
-"===============",
-"",
-"LICENSE ISSUES",
-"--------------",
-"",
-"The OpenSSL toolkit stays under a dual license, i.e. both the conditions of",
-"the OpenSSL License and the original SSLeay license apply to the toolkit.",
-"See below for the actual license texts. Actually both licenses are BSD-style",
-"Open Source licenses. In case of any license issues related to OpenSSL",
-"please contact openssl-core@openssl.org.",
-"",
-"OpenSSL License",
-"---------------",
-"",
-"Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.",
-"",
-"Redistribution and use in source and binary forms, with or without",
-"modification, are permitted provided that the following conditions",
-"are met:",
-"",
-"1. Redistributions of source code must retain the above copyright",
-" notice, this list of conditions and the following disclaimer. ",
-"",
-"2. Redistributions in binary form must reproduce the above copyright",
-" notice, this list of conditions and the following disclaimer in",
-" the documentation and/or other materials provided with the",
-" distribution.",
-"",
-"3. All advertising materials mentioning features or use of this",
-" software must display the following acknowledgment:",
-" \"This product includes software developed by the OpenSSL Project",
-" for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"",
-"",
-"4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to",
-" endorse or promote products derived from this software without",
-" prior written permission. For written permission, please contact",
-" openssl-core@openssl.org.",
-"",
-"5. Products derived from this software may not be called \"OpenSSL\"",
-" nor may \"OpenSSL\" appear in their names without prior written",
-" permission of the OpenSSL Project.",
-"",
-"6. Redistributions of any form whatsoever must retain the following",
-" acknowledgment:",
-" \"This product includes software developed by the OpenSSL Project",
-" for use in the OpenSSL Toolkit (http://www.openssl.org/)\"",
-"",
-"THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY",
-"EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
-"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR",
-"PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR",
-"ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,",
-"SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT",
-"NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;",
-"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)",
-"HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,",
-"STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)",
-"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED",
-"OF THE POSSIBILITY OF SUCH DAMAGE.",
-"",
-"This product includes cryptographic software written by Eric Young",
-"(eay@cryptsoft.com). This product includes software written by Tim",
-"Hudson (tjh@cryptsoft.com).",
-"",
-"",
-"Original SSLeay License",
-"-----------------------",
-"",
-"Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)",
-"All rights reserved.",
-"",
-"This package is an SSL implementation written",
-"by Eric Young (eay@cryptsoft.com).",
-"The implementation was written so as to conform with Netscapes SSL.",
-"",
-"This library is free for commercial and non-commercial use as long as",
-"the following conditions are aheared to. The following conditions",
-"apply to all code found in this distribution, be it the RC4, RSA,",
-"lhash, DES, etc., code; not just the SSL code. The SSL documentation",
-"included with this distribution is covered by the same copyright terms",
-"except that the holder is Tim Hudson (tjh@cryptsoft.com).",
-"",
-"Copyright remains Eric Young's, and as such any Copyright notices in",
-"the code are not to be removed.",
-"If this package is used in a product, Eric Young should be given attribution",
-"as the author of the parts of the library used.",
-"This can be in the form of a textual message at program startup or",
-"in documentation (online or textual) provided with the package.",
-"",
-"Redistribution and use in source and binary forms, with or without",
-"modification, are permitted provided that the following conditions",
-"are met:",
-"1. Redistributions of source code must retain the copyright",
-" notice, this list of conditions and the following disclaimer.",
-"2. Redistributions in binary form must reproduce the above copyright",
-" notice, this list of conditions and the following disclaimer in the",
-" documentation and/or other materials provided with the distribution.",
-"3. All advertising materials mentioning features or use of this software",
-" must display the following acknowledgement:",
-" \"This product includes cryptographic software written by",
-" Eric Young (eay@cryptsoft.com)\"",
-" The word 'cryptographic' can be left out if the rouines from the library",
-" being used are not cryptographic related :-).",
-"4. If you include any Windows specific code (or a derivative thereof) from ",
-" the apps directory (application code) you must include an acknowledgement:",
-" \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"",
-"",
-"THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND",
-"ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
-"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE",
-"ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE",
-"FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL",
-"DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS",
-"OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)",
-"HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT",
-"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY",
-"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF",
-"SUCH DAMAGE.",
-"",
-"The licence and distribution terms for any publically available version or",
-"derivative of this code cannot be changed. i.e. this code cannot simply be",
-"copied and put under another distribution licence",
-"[including the GNU Public Licence.]",
-"",
-#endif
-"",
-NULL
-
-
-#line 288 "test-strmw.ctr"
-};
-
-
-
-static const dkChar filename[] = { dkT("output.txt.gz") };
-
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_er_t er;
- dk4_stream_t *ostrm;
- const char * const *cptr;
- size_t sl;
- int exv = EXIT_FAILURE;
-
-
-
-#line 314 "test-strmw.ctr"
-
-
-#line 315 "test-strmw.ctr"
- dk4error_init(&er);
- ostrm = dk4stream_open_file_writer(filename, &er);
- if (NULL != ostrm) {
- exv = EXIT_SUCCESS;
- cptr = test_text;
- while (NULL != *cptr) {
- sl = strlen(*cptr);
- if (0 < sl) {
- if (0 == dk4stream_write(ostrm, *cptr, sl, &er)) { exv = EXIT_FAILURE; }
- if (0 == dk4stream_write_byte(ostrm, '\n', &er)) { exv = EXIT_FAILURE; }
- }
- cptr++;
- }
- if (0 == dk4stream_close(ostrm, &er)) { exv = EXIT_FAILURE; }
- }
-
-
-#line 331 "test-strmw.ctr"
-
-
-#line 332 "test-strmw.ctr"
- return exv;
-}
-
-
-
diff --git a/support/dktools/test-strmw.ctr b/support/dktools/test-strmw.ctr
deleted file mode 100644
index aa0dec6da9..0000000000
--- a/support/dktools/test-strmw.ctr
+++ /dev/null
@@ -1,336 +0,0 @@
-
-
-
-#include "dk4conf.h"
-#include "dk4types.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include "dk4strm.h"
-#include "dk4strmf.h"
-#include "dk4fopc8.h"
-#include "dk4strmw.h"
-
-
-
-$!trace-include
-
-
-
-/** License conditions.
-*/
-static const char * const test_text[] = {
-$!text preprocessor
-This software uses code from the following projects, either directly or as
-a library:
-
-dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
-#if DK4_HAVE_ZLIB_H
-
-zlib Data compression library.
- See http://www.zlib.net/ for more information.
-#endif
-#if DK4_HAVE_BZLIB_H
-
-bzip2 Data compression program and library.
- See http://www.bzip.org/ for more information.
-#endif
-#if DK4_HAVE_OPENSSL_MD5_H && DK4_HAVE_OPENSSL_SHA_H && DK4_HAVE_OPENSSL_RIPEMD_H
-
-OpenSSL Cryptographic toolkit, used to build file checksums here.
- See http://www.openssl.org/ for more information.
-
-This product includes software developed by the OpenSSL Project for use in
-the OpenSSL Toolkit (http://www.openssl.org/).
-This product includes cryptographic software written by
-Eric Young (eay@cryptsoft.com).
-This product includes software written by Tim Hudson (tjh@cryptsoft.com).
-#endif
-
-All the licenses below apply to the program.
-Licenses for used libraries are shown as found on my Scientific Linux 6.x
-computer in the /usr/share/doc directory on 2015-04-01. Check the project
-homepages of the used libraries for additional information and/or updated
-license terms.
-
-
-DK tools and libraries license
-==============================
-Copyright (c) 2015-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#if DK4_HAVE_ZLIB_H
-
-
-Zlib license
-============
-(C) 1995-2004 Jean-loup Gailly and Mark Adler
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-Jean-loup Gailly Mark Adler
-jloup@gzip.org madler@alumni.caltech.edu
-#endif
-#if DK4_HAVE_BZLIB_H
-
-
-Bzip2 and libbzip2 library license
-==================================
-This program, "bzip2", the associated library "libbzip2", and all
-documentation, are copyright (C) 1996-2007 Julian R Seward. All
-rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
-3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
-4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Julian Seward, jseward@bzip.org
-bzip2/libbzip2 version 1.0.5 of 10 December 2007
-#endif
-#if DK4_HAVE_OPENSSL_MD5_H && DK4_HAVE_OPENSSL_SHA_H && DK4_HAVE_OPENSSL_RIPEMD_H
-
-
-OpenSSL license
-===============
-
-LICENSE ISSUES
---------------
-
-The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
-the OpenSSL License and the original SSLeay license apply to the toolkit.
-See below for the actual license texts. Actually both licenses are BSD-style
-Open Source licenses. In case of any license issues related to OpenSSL
-please contact openssl-core@openssl.org.
-
-OpenSSL License
----------------
-
-Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
-3. All advertising materials mentioning features or use of this
- software must display the following acknowledgment:
- "This product includes software developed by the OpenSSL Project
- for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
-
-4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
- endorse or promote products derived from this software without
- prior written permission. For written permission, please contact
- openssl-core@openssl.org.
-
-5. Products derived from this software may not be called "OpenSSL"
- nor may "OpenSSL" appear in their names without prior written
- permission of the OpenSSL Project.
-
-6. Redistributions of any form whatsoever must retain the following
- acknowledgment:
- "This product includes software developed by the OpenSSL Project
- for use in the OpenSSL Toolkit (http://www.openssl.org/)"
-
-THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
-EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
-ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-This product includes cryptographic software written by Eric Young
-(eay@cryptsoft.com). This product includes software written by Tim
-Hudson (tjh@cryptsoft.com).
-
-
-Original SSLeay License
------------------------
-
-Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-All rights reserved.
-
-This package is an SSL implementation written
-by Eric Young (eay@cryptsoft.com).
-The implementation was written so as to conform with Netscapes SSL.
-
-This library is free for commercial and non-commercial use as long as
-the following conditions are aheared to. The following conditions
-apply to all code found in this distribution, be it the RC4, RSA,
-lhash, DES, etc., code; not just the SSL code. The SSL documentation
-included with this distribution is covered by the same copyright terms
-except that the holder is Tim Hudson (tjh@cryptsoft.com).
-
-Copyright remains Eric Young's, and as such any Copyright notices in
-the code are not to be removed.
-If this package is used in a product, Eric Young should be given attribution
-as the author of the parts of the library used.
-This can be in the form of a textual message at program startup or
-in documentation (online or textual) provided with the package.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement:
- "This product includes cryptographic software written by
- Eric Young (eay@cryptsoft.com)"
- The word 'cryptographic' can be left out if the rouines from the library
- being used are not cryptographic related :-).
-4. If you include any Windows specific code (or a derivative thereof) from
- the apps directory (application code) you must include an acknowledgement:
- "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
-
-THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-The licence and distribution terms for any publically available version or
-derivative of this code cannot be changed. i.e. this code cannot simply be
-copied and put under another distribution licence
-[including the GNU Public Licence.]
-
-#endif
-
-$!end
-};
-
-
-
-static const dkChar filename[] = { dkT("output.txt.gz") };
-
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dk4_er_t er;
- dk4_stream_t *ostrm;
- const char * const *cptr;
- size_t sl;
- int exv = EXIT_FAILURE;
-
- $!trace-init test-strmw.deb
- $? "+ main"
- dk4error_init(&er);
- ostrm = dk4stream_open_file_writer(filename, &er);
- if (NULL != ostrm) {
- exv = EXIT_SUCCESS;
- cptr = test_text;
- while (NULL != *cptr) {
- sl = strlen(*cptr);
- if (0 < sl) {
- if (0 == dk4stream_write(ostrm, *cptr, sl, &er)) { exv = EXIT_FAILURE; }
- if (0 == dk4stream_write_byte(ostrm, '\n', &er)) { exv = EXIT_FAILURE; }
- }
- cptr++;
- }
- if (0 == dk4stream_close(ostrm, &er)) { exv = EXIT_FAILURE; }
- }
- $? "- main %d", exv
- $!trace-end
- return exv;
-}
-
-
-
diff --git a/support/dktools/test-strt.str b/support/dktools/test-strt.str
new file mode 100644
index 0000000000..4e8c0d6b1c
--- /dev/null
+++ b/support/dktools/test-strt.str
@@ -0,0 +1,8 @@
+#
+#
+#
+Heute ist\nSonntag
+
+\#Test
+#
+#
diff --git a/support/dktools/test-udpa.c b/support/dktools/test-udpa.c
deleted file mode 100644
index 4292cde202..0000000000
--- a/support/dktools/test-udpa.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-udpa.ctr
-*/
-
-/** @file test-udpa.c The test-udpa module.
-*/
-
-
-#line 1 "test-udpa.ctr"
-
-/*
- test-udap hostname...
-
- Test the dk4socket_c8_udp_addresses_numeric() function from the
- dk4sock32 module.
-*/
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4sock.h"
-
-
-
-static
-void
-show_address(dk4_sockaddr_storage_t *addr)
-{
- struct sockaddr *sa;
- struct sockaddr_in *sa4;
- struct sockaddr_in6 *sa6;
- unsigned long ul;
- unsigned short us;
- size_t i;
- unsigned char uc;
-
- sa = (struct sockaddr *)addr;
- sa4 = (struct sockaddr_in *)addr;
- sa6 = (struct sockaddr_in6 *)addr;
-
- switch (sa->sa_family) {
- case AF_INET : {
- ul = ntohl(sa4->sin_addr.s_addr);
- us = ntohs(sa4->sin_port);
- printf(
- "IPv4 %lu.%lu.%lu.%lu %u\n",
- ((ul >> 24) & 0x000000FFUL),
- ((ul >> 16) & 0x000000FFUL),
- ((ul >> 8) & 0x000000FFUL),
- ((ul ) & 0x000000FFUL),
- (unsigned)us
- );
- } break;
- case AF_INET6 : {
- us = ntohs(sa6->sin6_port);
- printf("IPv6 ");
- for (i = 0; i < 16; i++) {
- uc = sa6->sin6_addr.s6_addr[i];
- if ((0 < i) && (0 == (i % 2))) {
- printf(":");
- }
- printf("%02X", uc);
- }
- printf(" %u\n", (unsigned short)us);
- } break;
- default: {
- printf("ERROR: Unknown address family!\n");
- } break;
- }
-}
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_sockaddr_storage_t array[2];
- int i;
- int res;
-
- for (i = 1; i < argc; i++) {
- printf("Test \"%s\"\n", argv[i]);
- res = dk4socket_c8_udp_addresses_numeric(
- array, argv[i], 9876, 9876, 0, NULL
- );
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- show_address(array);
- show_address(&(array[1]));
- } else {
- printf("ERROR: Not found!\n");
- }
- printf("\n");
- }
- return 0;
-}
-
diff --git a/support/dktools/test-udpa.ctr b/support/dktools/test-udpa.ctr
deleted file mode 100644
index 5127744015..0000000000
--- a/support/dktools/test-udpa.ctr
+++ /dev/null
@@ -1,87 +0,0 @@
-
-/*
- test-udap hostname...
-
- Test the dk4socket_c8_udp_addresses_numeric() function from the
- dk4sock32 module.
-*/
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4sock.h"
-
-
-
-static
-void
-show_address(dk4_sockaddr_storage_t *addr)
-{
- struct sockaddr *sa;
- struct sockaddr_in *sa4;
- struct sockaddr_in6 *sa6;
- unsigned long ul;
- unsigned short us;
- size_t i;
- unsigned char uc;
-
- sa = (struct sockaddr *)addr;
- sa4 = (struct sockaddr_in *)addr;
- sa6 = (struct sockaddr_in6 *)addr;
-
- switch (sa->sa_family) {
- case AF_INET : {
- ul = ntohl(sa4->sin_addr.s_addr);
- us = ntohs(sa4->sin_port);
- printf(
- "IPv4 %lu.%lu.%lu.%lu %u\n",
- ((ul >> 24) & 0x000000FFUL),
- ((ul >> 16) & 0x000000FFUL),
- ((ul >> 8) & 0x000000FFUL),
- ((ul ) & 0x000000FFUL),
- (unsigned)us
- );
- } break;
- case AF_INET6 : {
- us = ntohs(sa6->sin6_port);
- printf("IPv6 ");
- for (i = 0; i < 16; i++) {
- uc = sa6->sin6_addr.s6_addr[i];
- if ((0 < i) && (0 == (i % 2))) {
- printf(":");
- }
- printf("%02X", uc);
- }
- printf(" %u\n", (unsigned short)us);
- } break;
- default: {
- printf("ERROR: Unknown address family!\n");
- } break;
- }
-}
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_sockaddr_storage_t array[2];
- int i;
- int res;
-
- for (i = 1; i < argc; i++) {
- printf("Test \"%s\"\n", argv[i]);
- res = dk4socket_c8_udp_addresses_numeric(
- array, argv[i], 9876, 9876, 0, NULL
- );
- if (DK4_SOCKET_RESULT_SUCCESS == res) {
- show_address(array);
- show_address(&(array[1]));
- } else {
- printf("ERROR: Not found!\n");
- }
- printf("\n");
- }
- return 0;
-}
-
diff --git a/support/dktools/test-unser.c b/support/dktools/test-unser.c
deleted file mode 100644
index 2e2a2950a6..0000000000
--- a/support/dktools/test-unser.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-unser.ctr
-*/
-
-/** @file test-unser.c The test-unser module.
-*/
-
-
-#line 1 "test-unser.ctr"
-
-#include <stdio.h>
-#include <stdint.h>
-#define _USE_MATH_DEFINES 1
-#include <math.h>
-
-
-#include "dk4mem.h"
-#include "dk4serf.h"
-#include "dk4userf.h"
-#include "dk4app.h"
-#include "dk4str8.h"
-#include "dk4maodd.h"
-#include "dk4fput.h"
-
-
-
-static const dkChar * const test_ser_help_text[] = {
-dkT("This is a test program to create directories."),
-NULL
-
-
-#line 22 "test-unser.ctr"
-};
-
-static const dkChar * const test_ser_license_text[] = {
-dkT("Copyright (c) 2014-2016, Dirk Krause"),
-dkT("All rights reserved."),
-dkT(""),
-dkT("Redistribution and use in source and binary forms, with or without"),
-dkT("modification, are permitted provided that the following conditions"),
-dkT("are met:"),
-dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
-dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
-dkT("\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
-dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
-dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
-dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
-dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"),
-dkT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS"),
-dkT("OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)"),
-dkT("HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,"),
-dkT("STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN"),
-dkT("ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE"),
-dkT("POSSIBILITY OF SUCH DAMAGE."),
-NULL
-
-
-#line 56 "test-unser.ctr"
-};
-
-
-
-/** Application structure.
-*/
-static dk4_app_t *app = NULL;
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dkChar buf[64];
- dkChar *dkptr = NULL;
- FILE *fipo;
- size_t i;
- double dbl;
- uint32_t ui32;
- int32_t i32;
- int exv = EXIT_FAILURE;
- int de = 0;
- uint16_t ui16;
- int16_t i16;
-
- dk4fput_initialize_stdout();
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-ser.txt"), test_ser_help_text,
- test_ser_license_text
- );
- if (NULL != app) {
- de = dk4app_get_encoding(app);
- fipo = fopen("test-ser.out", "rb");
- if (NULL != fipo) {
- exv = EXIT_SUCCESS;
- for (i = 0; i < 8; i++) {
- if (0 != dk4unserialize_file_uint16_t(&ui16, fipo, NULL)) {
- dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf,dkChar), (dk4_um_t)ui16, 0, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- for (i = 0; i < 6; i++) {
- if (0 != dk4unserialize_file_int16_t(&i16, fipo, NULL)) {
- dk4ma_write_decimal_signed(buf, DK4_SIZEOF(buf,dkChar), (dk4_im_t)i16, 0, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- if (0 != dk4unserialize_file_dk_string(&dkptr, de, fipo, NULL)) {
- dk4fputs(dkptr, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- if (NULL != dkptr) { dk4mem_free(dkptr); dkptr = NULL; }
- }
- for (i = 0; i < 8; i++) {
-
-#line 120 "test-unser.ctr"
- if (0 != dk4unserialize_file_uint32_t(&ui32, fipo, NULL)) {
- dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf,dkChar), (dk4_um_t)ui32, 0, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- for (i = 0; i < 6; i++) {
- if (0 != dk4unserialize_file_int32_t(&i32, fipo, NULL)) {
- dk4ma_write_decimal_signed(buf, DK4_SIZEOF(buf,dkChar), (dk4_im_t)i32, 0, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- for (i = 0; i < 3; i++) {
- if (0 != dk4unserialize_file_double(&dbl, fipo, NULL)) {
- printf("%g\n", dbl);
- }
- }
- fclose(fipo);
- }
- dk4app_close(app);
- }
- fflush(stdout);
- dk4fput_cleanup_stdout();
- return exv;
-}
-
diff --git a/support/dktools/test-unser.ctr b/support/dktools/test-unser.ctr
deleted file mode 100644
index 8a68d1a49e..0000000000
--- a/support/dktools/test-unser.ctr
+++ /dev/null
@@ -1,146 +0,0 @@
-
-#include <stdio.h>
-#include <stdint.h>
-#define _USE_MATH_DEFINES 1
-#include <math.h>
-
-
-#include "dk4mem.h"
-#include "dk4serf.h"
-#include "dk4userf.h"
-#include "dk4app.h"
-#include "dk4str8.h"
-#include "dk4maodd.h"
-#include "dk4fput.h"
-
-
-
-static const dkChar * const test_ser_help_text[] = {
-$!text macro=dkT
-This is a test program to create directories.
-$!end
-};
-
-static const dkChar * const test_ser_license_text[] = {
-$!text macro=dkT
-Copyright (c) 2014-2016, Dirk Krause
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-$!end
-};
-
-
-
-/** Application structure.
-*/
-static dk4_app_t *app = NULL;
-
-
-/** Main function.
- @param argc Number of command line arguments.
- @param argv Command line arguments array.
- @return 0 on success, all other values indicate errors.
-*/
-#if DK4_CHAR_SIZE > 1
-int wmain(int argc, wchar_t *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-{
- dkChar buf[64];
- dkChar *dkptr = NULL;
- FILE *fipo;
- size_t i;
- double dbl;
- uint32_t ui32;
- int32_t i32;
- int exv = EXIT_FAILURE;
- int de = 0;
- uint16_t ui16;
- int16_t i16;
-
- dk4fput_initialize_stdout();
- app = dk4app_open_cmd(
- argc, argv, NULL, 0,
- dkT("dktools-4-test"), dkT("1.0.0"),
- dkT("test-ser.txt"), test_ser_help_text,
- test_ser_license_text
- );
- if (NULL != app) {
- de = dk4app_get_encoding(app);
- fipo = fopen("test-ser.out", "rb");
- if (NULL != fipo) {
- exv = EXIT_SUCCESS;
- for (i = 0; i < 8; i++) {
- if (0 != dk4unserialize_file_uint16_t(&ui16, fipo, NULL)) {
- dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf,dkChar), (dk4_um_t)ui16, 0, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- for (i = 0; i < 6; i++) {
- if (0 != dk4unserialize_file_int16_t(&i16, fipo, NULL)) {
- dk4ma_write_decimal_signed(buf, DK4_SIZEOF(buf,dkChar), (dk4_im_t)i16, 0, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- if (0 != dk4unserialize_file_dk_string(&dkptr, de, fipo, NULL)) {
- dk4fputs(dkptr, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- if (NULL != dkptr) { dk4mem_free(dkptr); dkptr = NULL; }
- }
- for (i = 0; i < 8; i++) { $? ". loop pass %u", (unsigned)i
- if (0 != dk4unserialize_file_uint32_t(&ui32, fipo, NULL)) {
- dk4ma_write_decimal_unsigned(buf, DK4_SIZEOF(buf,dkChar), (dk4_um_t)ui32, 0, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- for (i = 0; i < 6; i++) {
- if (0 != dk4unserialize_file_int32_t(&i32, fipo, NULL)) {
- dk4ma_write_decimal_signed(buf, DK4_SIZEOF(buf,dkChar), (dk4_im_t)i32, 0, NULL);
- dk4fputs(buf, stdout, NULL);
- dk4fputc(dkT('\n'), stdout, NULL);
- }
- }
- for (i = 0; i < 3; i++) {
- if (0 != dk4unserialize_file_double(&dbl, fipo, NULL)) {
- printf("%g\n", dbl);
- }
- }
- fclose(fipo);
- }
- dk4app_close(app);
- }
- fflush(stdout);
- dk4fput_cleanup_stdout();
- return exv;
-}
-
diff --git a/support/dktools/testlzw.c b/support/dktools/testlzw.c
deleted file mode 100644
index 7d28b3b913..0000000000
--- a/support/dktools/testlzw.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: testlzw.ctr
-*/
-
-/** @file testlzw.c The testlzw module.
-*/
-
-
-#line 1 "testlzw.ctr"
-
-#include <stdio.h>
-
-#include <dk4conf.h>
-#include "dk4lzwe.h"
-#include <dk4edstm.h>
-
-
-
-#line 9 "testlzw.ctr"
-
-
-static const unsigned char teststr[] = {
- 45, 45, 45, 45, 45, 65, 45, 45, 45, 66
-};
-
-
-
-static
-void
-show_bytes(dk4_lzwe_t *lzwe)
-{
- const unsigned char *cptr = NULL;
- size_t nbt = 0;
- size_t i;
-
-
-
-#line 26 "testlzw.ctr"
- if (0 != dk4lzwe_output(&cptr, &nbt, lzwe, NULL)) {
- if ((NULL != cptr) && (0 < nbt)) {
- for (i = 0; i < nbt; i++) {
- printf("%2x\n", (unsigned)(cptr[i]));
- }
- }
- else {
-
-#line 33 "testlzw.ctr"
- }
- }
- else {
-
-#line 36 "testlzw.ctr"
- }
-
-
-#line 38 "testlzw.ctr"
-}
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_lzwe_t lzwe;
- size_t i;
-
-
-
-#line 48 "testlzw.ctr"
-
-
-#line 49 "testlzw.ctr"
- if (0 != dk4lzwe_init(&lzwe, NULL)) {
- for (i = 0; i < sizeof(teststr); i++) {
- switch (dk4lzwe_add(&lzwe, teststr[i], NULL)) {
- case DK4_EDSTM_FINISHED : {
- show_bytes(&lzwe);
- } break;
- case DK4_EDSTM_ERROR : {
-
-#line 56 "testlzw.ctr"
- } break;
- }
- }
- switch (dk4lzwe_finish(&lzwe, NULL)) {
- case DK4_EDSTM_FINISHED : {
- show_bytes(&lzwe);
- } break;
- case DK4_EDSTM_ERROR : {
-
-#line 64 "testlzw.ctr"
- } break;
- }
- }
- else {
- }
-
-
-#line 70 "testlzw.ctr"
-
-
-#line 71 "testlzw.ctr"
- return 0;
-}
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/testlzw.ctr b/support/dktools/testlzw.ctr
deleted file mode 100644
index 037e0234b5..0000000000
--- a/support/dktools/testlzw.ctr
+++ /dev/null
@@ -1,75 +0,0 @@
-
-#include <stdio.h>
-
-#include <dk4conf.h>
-#include "dk4lzwe.h"
-#include <dk4edstm.h>
-
-$!trace-include
-
-
-static const unsigned char teststr[] = {
- 45, 45, 45, 45, 45, 65, 45, 45, 45, 66
-};
-
-
-
-static
-void
-show_bytes(dk4_lzwe_t *lzwe)
-{
- const unsigned char *cptr = NULL;
- size_t nbt = 0;
- size_t i;
-
- $? "+ show_bytes"
- if (0 != dk4lzwe_output(&cptr, &nbt, lzwe, NULL)) {
- if ((NULL != cptr) && (0 < nbt)) {
- for (i = 0; i < nbt; i++) {
- printf("%2x\n", (unsigned)(cptr[i]));
- }
- }
- else { $? "! bug"
- }
- }
- else { $? "! error"
- }
- $? "- show_bytes"
-}
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_lzwe_t lzwe;
- size_t i;
-
- $!trace-init testlzwe.deb
- $? "+ main"
- if (0 != dk4lzwe_init(&lzwe, NULL)) {
- for (i = 0; i < sizeof(teststr); i++) {
- switch (dk4lzwe_add(&lzwe, teststr[i], NULL)) {
- case DK4_EDSTM_FINISHED : {
- show_bytes(&lzwe);
- } break;
- case DK4_EDSTM_ERROR : { $? "! error indicated"
- } break;
- }
- }
- switch (dk4lzwe_finish(&lzwe, NULL)) {
- case DK4_EDSTM_FINISHED : {
- show_bytes(&lzwe);
- } break;
- case DK4_EDSTM_ERROR : { $? "! error indicated"
- } break;
- }
- }
- else {
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/testlzws.c b/support/dktools/testlzws.c
deleted file mode 100644
index 39a05948f6..0000000000
--- a/support/dktools/testlzws.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: testlzws.ctr
-*/
-
-/** @file testlzws.c The testlzws module.
-*/
-
-
-#line 1 "testlzws.ctr"
-
-#include <stdio.h>
-
-#include "dk4conf.h"
-#include "dk4lzwe.h"
-#include "dk4edstm.h"
-#include "dk4strmf.h"
-#include "dk4strmco.h"
-
-
-
-#line 11 "testlzws.ctr"
-
-
-static const unsigned char teststr[] = {
- 45, 45, 45, 45, 45, 65, 45, 45, 45, 66
-};
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_stream_t *strm_stdout;
- dk4_stream_t *strm_lzw;
-
-
-
-#line 25 "testlzws.ctr"
-
-
-#line 26 "testlzws.ctr"
- strm_stdout = dk4stream_open_for_file(
- stdout, DK4_STREAM_WRITE, 0, 4096, NULL
- );
- if (NULL != strm_stdout) {
- strm_lzw = dk4strmco_open(
- strm_stdout,
- DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_LZW, DK4_STRMCO_OE_HEX,
- (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE), NULL
- );
- if (NULL != strm_lzw) {
- dk4stream_write(
- strm_lzw, teststr, sizeof(teststr), NULL
- );
- dk4stream_close(strm_lzw, NULL);
- }
- dk4stream_close(strm_stdout, NULL);
- }
-
-
-#line 44 "testlzws.ctr"
-
-
-#line 45 "testlzws.ctr"
- return 0;
-}
-
-
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/testlzws.ctr b/support/dktools/testlzws.ctr
deleted file mode 100644
index d4849a7626..0000000000
--- a/support/dktools/testlzws.ctr
+++ /dev/null
@@ -1,51 +0,0 @@
-
-#include <stdio.h>
-
-#include "dk4conf.h"
-#include "dk4lzwe.h"
-#include "dk4edstm.h"
-#include "dk4strmf.h"
-#include "dk4strmco.h"
-
-$!trace-include
-
-
-static const unsigned char teststr[] = {
- 45, 45, 45, 45, 45, 65, 45, 45, 45, 66
-};
-
-
-
-int main(int argc, char *argv[])
-{
- dk4_stream_t *strm_stdout;
- dk4_stream_t *strm_lzw;
-
- $!trace-init testlzws.deb
- $? "+ main"
- strm_stdout = dk4stream_open_for_file(
- stdout, DK4_STREAM_WRITE, 0, 4096, NULL
- );
- if (NULL != strm_stdout) {
- strm_lzw = dk4strmco_open(
- strm_stdout,
- DK4_STRMCO_PP_NONE, DK4_STRMCO_CO_LZW, DK4_STRMCO_OE_HEX,
- (DK4_STRMCO_FL_EOD_OE | DK4_STRMCO_FL_NL_OE), NULL
- );
- if (NULL != strm_lzw) {
- dk4stream_write(
- strm_lzw, teststr, sizeof(teststr), NULL
- );
- dk4stream_close(strm_lzw, NULL);
- }
- dk4stream_close(strm_stdout, NULL);
- }
- $? "- main"
- $!trace-end
- return 0;
-}
-
-
-
-/* vim: set ai sw=4 ts=4 : */
-
diff --git a/support/dktools/testread.cpp b/support/dktools/testread.cpp
new file mode 100644
index 0000000000..1a7b211fe6
--- /dev/null
+++ b/support/dktools/testread.cpp
@@ -0,0 +1,72 @@
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: testread.cpt
+*/
+
+/** @file testread.cpp The testread module.
+*/
+
+
+#line 1 "testread.cpt"
+
+#include <stdio.h>
+
+#include "WxdkdrawObj.h"
+#include "WxdkdrawRead.h"
+
+
+static int exval = EXIT_FAILURE;
+
+
+/* Test program to read a drawing.
+ Specify drawing file name as first argument.
+*/
+
+int main(int argc, char *argv[])
+{
+
+ wxdrd_status_t status;
+ Wxd_drawing_t *pdrw;
+ FILE *fipo;
+
+ if (1 < argc) {
+ fipo = fopen(argv[1], "r");
+ if (NULL != fipo) {
+ wxdrd_status_init(&status);
+ pdrw = wxdrd_read_file(fipo, &status);
+ if (NULL != pdrw) {
+ fputs("Successfully read file \"", stdout);
+ fputs(argv[1], stdout);
+ fputs("\".\n", stdout);
+ exval = EXIT_SUCCESS;
+ wxdobj_drw_delete(pdrw);
+ }
+ else {
+ fputs("ERROR: Failed to read drawing!\n", stderr);
+ fprintf(stderr, "Line number: %lu\n", status.ln);
+ fprintf(
+ stderr, "Text word: %lu\n", (unsigned long)(status.te)
+ );
+ fprintf(stderr, "Error code: %d\n", status.ec);
+ }
+ fclose(fipo);
+ }
+ else {
+ fputs("ERROR: Failed to open file \"", stderr);
+ fputs(argv[1], stderr);
+ fputs("\"!\n", stderr);
+ }
+ }
+ else {
+ fputs("ERROR: Missing file name\n", stderr);
+ }
+ return exval;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/testread.cpt b/support/dktools/testread.cpt
new file mode 100644
index 0000000000..f07b228f96
--- /dev/null
+++ b/support/dktools/testread.cpt
@@ -0,0 +1,59 @@
+
+#include <stdio.h>
+
+#include "WxdkdrawObj.h"
+#include "WxdkdrawRead.h"
+
+
+static int exval = EXIT_FAILURE;
+
+
+/* Test program to read a drawing.
+ Specify drawing file name as first argument.
+*/
+
+int main(int argc, char *argv[])
+{
+
+ wxdrd_status_t status;
+ Wxd_drawing_t *pdrw;
+ FILE *fipo;
+
+ if (1 < argc) {
+ fipo = fopen(argv[1], "r");
+ if (NULL != fipo) {
+ wxdrd_status_init(&status);
+ pdrw = wxdrd_read_file(fipo, &status);
+ if (NULL != pdrw) {
+ fputs("Successfully read file \"", stdout);
+ fputs(argv[1], stdout);
+ fputs("\".\n", stdout);
+ exval = EXIT_SUCCESS;
+ wxdobj_drw_delete(pdrw);
+ }
+ else {
+ fputs("ERROR: Failed to read drawing!\n", stderr);
+ fprintf(stderr, "Line number: %lu\n", status.ln);
+ fprintf(
+ stderr, "Text word: %lu\n", (unsigned long)(status.te)
+ );
+ fprintf(stderr, "Error code: %d\n", status.ec);
+ }
+ fclose(fipo);
+ }
+ else {
+ fputs("ERROR: Failed to open file \"", stderr);
+ fputs(argv[1], stderr);
+ fputs("\"!\n", stderr);
+ }
+ }
+ else {
+ fputs("ERROR: Missing file name\n", stderr);
+ }
+ return exval;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/translate.vc b/support/dktools/translate.vc
index 57e21f8847..c5ac0d7638 100644
--- a/support/dktools/translate.vc
+++ b/support/dktools/translate.vc
@@ -65,7 +65,7 @@ CFLCRT=-DNDEBUG=1 -D_CONSOLE=1
# Check for legacy versions
!IF "$(CONF_LEGACY)" == "yes"
-CFLAGSLEGACY=/DDK4_WINDOWS_LEGACY=1
+CFLAGSLEGACY=/DDK4_WINDOWS_LEGACY=1 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
!ELSE
CFLAGSLEGACY=
!ENDIF
@@ -641,10 +641,11 @@ VC_MANIFEST_EMBED_DLL= \
if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;2
COBJFL= $(CFLAGSLEGACY) $(CFLUC) $(CFLRT) $(CFLCRT) /W3 \
- /I. /I.. /I"$(PSDK)\Include" /I"$(VC)\Include" $(GUICFL)
+ /I. /I.. /I"$(PSDK)\Include" /I"$(VC)\Include" $(GUICFL) \
+ /DDK4_BUILDING_DKTOOLS4=1
RCOBJFL= $(CFLAGSLEGACY) $(CFLUC) \
- /I. /I.. /I"$(PSDK)\Include" /I"$(VC)\Include" $(GUICFL)
+ /I. /I.. /I.\gui-img\icons /I"$(PSDK)\Include" /I"$(VC)\Include" $(GUICFL)
.cpp.obj:
@echo Compile $*.cpp
diff --git a/support/dktools/uc2l.h b/support/dktools/uc2l.h
new file mode 100644
index 0000000000..7dd69a7a21
--- /dev/null
+++ b/support/dktools/uc2l.h
@@ -0,0 +1,162 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef UC2L_H_INCLUDED
+/** Protection against multiple inclusions. */
+#define UC2L_H_INCLUDED 1
+
+/** @file uc2l.h Prototypes for functions shared between
+ dk4uc2l and dk4uc2la modules.
+*/
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4UC2L_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4uc2l.h"
+#else
+#include <dktools-4/dk4uc2l.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Open range structure.
+ @param c32 Initial start and end of range.
+ @param fptr File the range is loaded from.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+dk4_uc2l_range_t *
+dk4uc2l_i_open_range(
+ dk4_c32_t c32,
+ dk4_uc2l_file_t *fptr,
+ dk4_er_t *erp
+);
+
+/** Close a range, releasse resources.
+ @param rptr Range to close.
+*/
+void
+dk4uc2l_i_close_range(dk4_uc2l_range_t *rptr);
+
+/** Allocate a file structure and resources.
+ @param fn File name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+dk4_uc2l_file_t *
+dk4uc2l_i_open_file(const dkChar *fn, dk4_er_t *erp);
+
+/** Close a file structure, release resources.
+ @param fptr File structure to close.
+*/
+void
+dk4uc2l_i_close_file(dk4_uc2l_file_t *fptr);
+
+/** Open a package structure, allocate resources.
+ @param pn Package name.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error.
+*/
+dk4_uc2l_pkg_t *
+dk4uc2l_i_open_pkg(const char *pn, dk4_er_t *erp);
+
+/** Create package structure and add to storage.
+ @param s_pkgs Storage containing all package structures.
+ @param pname Name of new package.
+ @return Valid pointer to new package structure on success, NULL on error.
+*/
+dk4_uc2l_pkg_t *
+dk4uc2l_i_create_pkg(
+ dk4_sto_t *s_pkgs,
+ const char *pname
+);
+
+/** Close a package, release resources.
+ @param pptr Package to close.
+*/
+void
+dk4uc2l_i_close_pkg(dk4_uc2l_pkg_t *pptr);
+
+/** Allocate memory for conversion struct and components.
+ @param dn Directory name for conversion struct.
+ @param erp Error report, may be NULL.
+ @return Valid pointer on success, NULL on error (memory
+ allocation failed).
+*/
+dk4_uc2l_t *
+dk4uc2l_i_new(const dkChar *dn, dk4_er_t *erp);
+
+/** Find suffix index for file name.
+ Supported suffixes at this time are ".t2l", ".t2l.gz" and ".tl2.bz2".
+ The corresponding indices are 0, 1 and 2.
+ @param fn File name to inspect.
+ @return Non-negative index on success, -1 on error
+ (not a valid suffix for data files).
+*/
+int
+dk4uc2l_i_find_suffix_index(const dkChar *fn);
+
+/** Check if a file name suffix indicating a compression type is
+ supported.
+ @param i File name suffix index to check.
+ @return Check result: 1=supported, 0=unsupported.
+*/
+int
+dk4uc2l_i_suffix_index_supported(int i);
+
+/** Compare two range informations or a range information against a
+ character.
+ @param l Left pointer, always a range information structure.
+ @param r Right pointer.
+ @param cr Comparison criteria:
+ 0 if the right pointer is a range information strucutre,
+ 1 if the right pointer is a pointer to a dk4_c32_t.
+ @return Comparison result: -1 if l<r, 0 if l=r, 1 if l>r.
+*/
+int
+dk4uc2l_i_range_compare(const void *l, const void *r, int cr);
+
+/** Initialize a range, allocate memory for components.
+ @param rptr Range to initialize.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+int
+dk4uc2l_i_init_range(
+ dk4_uc2l_range_t *rptr,
+ dk4_er_t *erp
+);
+
+/** Find index of pkey in keyword array.
+ @param pkey Key text.
+ @return Non-negative index on success, -1 on error.
+*/
+int
+dk4uc2l_i_keyword_index(const char *pkey);
+
+/** Retrieve font encoding by name.
+ @param pname Font encoding name.
+ @return Non-null font encoding on success, 0 on error.
+*/
+unsigned char
+dk4uc2l_font_encoding_from_name(const char *pname);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/version.txt b/support/dktools/version.txt
index f99c6583c3..64a53e638f 100644
--- a/support/dktools/version.txt
+++ b/support/dktools/version.txt
@@ -1 +1 @@
-4.8.3
+4.30.2
diff --git a/support/dktools/w2llic.c b/support/dktools/w2llic.c
new file mode 100644
index 0000000000..030b23978e
--- /dev/null
+++ b/support/dktools/w2llic.c
@@ -0,0 +1,379 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: w2llic.ctr
+*/
+
+/** @file w2llic.c The w2llic module.
+*/
+
+
+#line 36 "w2llic.ctr"
+
+
+#include "wxd2lat.h"
+
+
+
+
+#line 42 "w2llic.ctr"
+
+
+
+/** License text.
+*/
+static const dkChar * const wxd2lat_license_text[] = {
+dkT(""),
+dkT("Overview"),
+dkT("========"),
+dkT("This software uses code from the following projects either directly"),
+dkT("or as a library:"),
+dkT(""),
+dkT("dktools\tDirk Krause's tools and libraries."),
+dkT("\tSee http://sourceforge.net/p/wiki/Home/ for information."),
+#if DK4_HAVE_PNG_H
+dkT(""),
+dkT("libpng\tPNG reference library."),
+dkT("\tSee http://www.libpng.org/pub/png/libpng.html for information."),
+#endif
+#if DK4_HAVE_JPEGLIB_H
+dkT(""),
+dkT("jpeg\tIndependent JPEG groups free JPEG library."),
+dkT("\tSee http://www.ijg.org/ for information."),
+#endif
+#if DK4_HAVE_TIFF_H
+dkT(""),
+dkT("libtiff\tTIFF library."),
+dkT("\tSee http://www.remotesensing.org/libtiff/ for information."),
+#endif
+#if DK4_HAVE_ZLIB_H
+dkT(""),
+dkT("zlib\tCompression library."),
+dkT("\tSee http://www.zlib.net/ for information."),
+#endif
+dkT(""),
+dkT("Your use of the bmpp program must be in compliance with the license conditions"),
+dkT("for the dktools project and the license conditions for all the libraries used"),
+dkT("by bmpp."),
+dkT(""),
+dkT("License for the dktools project"),
+dkT("==============================="),
+dkT("Copyright (c) 2011-2018, Dirk Krause"),
+dkT("All rights reserved."),
+dkT(""),
+dkT("Redistribution and use in source and binary forms,"),
+dkT("with or without modification, are permitted provided"),
+dkT("that the following conditions are met:"),
+dkT(""),
+dkT("* Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("* Redistributions in binary form must reproduce the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer in the documentation"),
+dkT(" and/or other materials provided with the distribution."),
+dkT("* Neither the name of the copyright holder(s) nor the names of contributors"),
+dkT(" may be used to endorse or promote products derived from this software"),
+dkT(" without specific prior written permission."),
+dkT(""),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
+dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
+dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
+dkT("ARE DISCLAIMED."),
+dkT(""),
+dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;"),
+dkT("LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND"),
+dkT("ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT"),
+dkT("(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF"),
+dkT("THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
+#if DK4_HAVE_PNG_H
+dkT(""),
+dkT("libpng license"),
+dkT("=============="),
+dkT(""),
+dkT("This copy of the libpng notices is provided for your convenience. In case of"),
+dkT("any discrepancy between this copy and the notices in the file png.h that is"),
+dkT("included in the libpng distribution, the latter shall prevail."),
+dkT(""),
+dkT("COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:"),
+dkT(""),
+dkT("If you modify libpng you may insert additional notices immediately following"),
+dkT("this sentence."),
+dkT(""),
+dkT("This code is released under the libpng license."),
+dkT(""),
+dkT("libpng versions 1.2.6, August 15, 2004, through 1.2.46, July 9, 2011, are"),
+dkT("Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are"),
+dkT("distributed according to the same disclaimer and license as libpng-1.2.5"),
+dkT("with the following individual added to the list of Contributing Authors"),
+dkT(""),
+dkT(" Cosmin Truta"),
+dkT(""),
+dkT("libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are"),
+dkT("Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are"),
+dkT("distributed according to the same disclaimer and license as libpng-1.0.6"),
+dkT("with the following individuals added to the list of Contributing Authors"),
+dkT(""),
+dkT(" Simon-Pierre Cadieux"),
+dkT(" Eric S. Raymond"),
+dkT(" Gilles Vollant"),
+dkT(""),
+dkT("and with the following additions to the disclaimer:"),
+dkT(""),
+dkT(" There is no warranty against interference with your enjoyment of the"),
+dkT(" library or against infringement. There is no warranty that our"),
+dkT(" efforts or the library will fulfill any of your particular purposes"),
+dkT(" or needs. This library is provided with all faults, and the entire"),
+dkT(" risk of satisfactory quality, performance, accuracy, and effort is with"),
+dkT(" the user."),
+dkT(""),
+dkT("libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are"),
+dkT("Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are"),
+dkT("distributed according to the same disclaimer and license as libpng-0.96,"),
+dkT("with the following individuals added to the list of Contributing Authors:"),
+dkT(""),
+dkT(" Tom Lane"),
+dkT(" Glenn Randers-Pehrson"),
+dkT(" Willem van Schaik"),
+dkT(""),
+dkT("libpng versions 0.89, June 1996, through 0.96, May 1997, are"),
+dkT("Copyright (c) 1996, 1997 Andreas Dilger"),
+dkT("Distributed according to the same disclaimer and license as libpng-0.88,"),
+dkT("with the following individuals added to the list of Contributing Authors:"),
+dkT(""),
+dkT(" John Bowler"),
+dkT(" Kevin Bracey"),
+dkT(" Sam Bushell"),
+dkT(" Magnus Holmgren"),
+dkT(" Greg Roelofs"),
+dkT(" Tom Tanner"),
+dkT(""),
+dkT("libpng versions 0.5, May 1995, through 0.88, January 1996, are"),
+dkT("Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc."),
+dkT(""),
+dkT("For the purposes of this copyright and license, \"Contributing Authors\""),
+dkT("is defined as the following set of individuals:"),
+dkT(""),
+dkT(" Andreas Dilger"),
+dkT(" Dave Martindale"),
+dkT(" Guy Eric Schalnat"),
+dkT(" Paul Schmidt"),
+dkT(" Tim Wegner"),
+dkT(""),
+dkT("The PNG Reference Library is supplied \"AS IS\". The Contributing Authors"),
+dkT("and Group 42, Inc. disclaim all warranties, expressed or implied,"),
+dkT("including, without limitation, the warranties of merchantability and of"),
+dkT("fitness for any purpose. The Contributing Authors and Group 42, Inc."),
+dkT("assume no liability for direct, indirect, incidental, special, exemplary,"),
+dkT("or consequential damages, which may result from the use of the PNG"),
+dkT("Reference Library, even if advised of the possibility of such damage."),
+dkT(""),
+dkT("Permission is hereby granted to use, copy, modify, and distribute this"),
+dkT("source code, or portions hereof, for any purpose, without fee, subject"),
+dkT("to the following restrictions:"),
+dkT(""),
+dkT("1. The origin of this source code must not be misrepresented."),
+dkT(""),
+dkT("2. Altered versions must be plainly marked as such and must not"),
+dkT(" be misrepresented as being the original source."),
+dkT(""),
+dkT("3. This Copyright notice may not be removed or altered from any"),
+dkT(" source or altered source distribution."),
+dkT(""),
+dkT("The Contributing Authors and Group 42, Inc. specifically permit, without"),
+dkT("fee, and encourage the use of this source code as a component to"),
+dkT("supporting the PNG file format in commercial products. If you use this"),
+dkT("source code in a product, acknowledgment is not required but would be"),
+dkT("appreciated."),
+dkT(""),
+dkT(""),
+dkT("A \"png_get_copyright\" function is available, for convenient use in \"about\""),
+dkT("boxes and the like:"),
+dkT(""),
+dkT(" printf(\"%s\",png_get_copyright(NULL));"),
+dkT(""),
+dkT("Also, the PNG logo (in PNG format, of course) is supplied in the"),
+dkT("files \"pngbar.png\" and \"pngbar.jpg (88x31) and \"pngnow.png\" (98x31)."),
+dkT(""),
+dkT("Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a"),
+dkT("certification mark of the Open Source Initiative."),
+dkT(""),
+dkT("Glenn Randers-Pehrson"),
+dkT("glennrp at users.sourceforge.net"),
+dkT("July 9, 2011"),
+#endif
+#if DK4_HAVE_JPEGLIB_H
+dkT(""),
+dkT("jpeglib license"),
+dkT("==============="),
+dkT(""),
+dkT("In plain English:"),
+dkT(""),
+dkT("1. We don't promise that this software works. (But if you find any bugs,"),
+dkT(" please let us know!)"),
+dkT("2. You can use this software for whatever you want. You don't have to pay us."),
+dkT("3. You may not pretend that you wrote this software. If you use it in a"),
+dkT(" program, you must acknowledge somewhere in your documentation that"),
+dkT(" you've used the IJG code."),
+dkT(""),
+dkT("In legalese:"),
+dkT(""),
+dkT("The authors make NO WARRANTY or representation, either express or implied,"),
+dkT("with respect to this software, its quality, accuracy, merchantability, or"),
+dkT("fitness for a particular purpose. This software is provided \"AS IS\", and you,"),
+dkT("its user, assume the entire risk as to its quality and accuracy."),
+dkT(""),
+dkT("This software is copyright (C) 1991-1998, Thomas G. Lane."),
+dkT("All Rights Reserved except as specified below."),
+dkT(""),
+dkT("Permission is hereby granted to use, copy, modify, and distribute this"),
+dkT("software (or portions thereof) for any purpose, without fee, subject to these"),
+dkT("conditions:"),
+dkT("(1) If any part of the source code for this software is distributed, then this"),
+dkT("README file must be included, with this copyright and no-warranty notice"),
+dkT("unaltered; and any additions, deletions, or changes to the original files"),
+dkT("must be clearly indicated in accompanying documentation."),
+dkT("(2) If only executable code is distributed, then the accompanying"),
+dkT("documentation must state that \"this software is based in part on the work of"),
+dkT("the Independent JPEG Group\"."),
+dkT("(3) Permission for use of this software is granted only if the user accepts"),
+dkT("full responsibility for any undesirable consequences; the authors accept"),
+dkT("NO LIABILITY for damages of any kind."),
+dkT(""),
+dkT("These conditions apply to any software derived from or based on the IJG code,"),
+dkT("not just to the unmodified library. If you use our work, you ought to"),
+dkT("acknowledge us."),
+dkT(""),
+dkT("Permission is NOT granted for the use of any IJG author's name or company name"),
+dkT("in advertising or publicity relating to this software or products derived from"),
+dkT("it. This software may be referred to only as \"the Independent JPEG Group's"),
+dkT("software\"."),
+dkT(""),
+dkT("We specifically permit and encourage the use of this software as the basis of"),
+dkT("commercial products, provided that all warranty or liability claims are"),
+dkT("assumed by the product vendor."),
+dkT(""),
+dkT("ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,"),
+dkT("sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA."),
+dkT("ansi2knr.c is NOT covered by the above copyright and conditions, but instead"),
+dkT("by the usual distribution terms of the Free Software Foundation; principally,"),
+dkT("that you must include source code if you redistribute it. (See the file"),
+dkT("ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part"),
+dkT("of any program generated from the IJG code, this does not limit you more than"),
+dkT("the foregoing paragraphs do."),
+dkT(""),
+dkT("The Unix configuration script \"configure\" was produced with GNU Autoconf."),
+dkT("It is copyright by the Free Software Foundation but is freely distributable."),
+dkT("The same holds for its supporting scripts (config.guess, config.sub,"),
+dkT("ltconfig, ltmain.sh). Another support script, install-sh, is copyright"),
+dkT("by M.I.T. but is also freely distributable."),
+dkT(""),
+dkT("It appears that the arithmetic coding option of the JPEG spec is covered by"),
+dkT("patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot"),
+dkT("legally be used without obtaining one or more licenses. For this reason,"),
+dkT("support for arithmetic coding has been removed from the free JPEG software."),
+dkT("(Since arithmetic coding provides only a marginal gain over the unpatented"),
+dkT("Huffman mode, it is unlikely that very many implementations will support it.)"),
+dkT("So far as we are aware, there are no patent restrictions on the remaining"),
+dkT("code."),
+dkT(""),
+dkT("The IJG distribution formerly included code to read and write GIF files."),
+dkT("To avoid entanglement with the Unisys LZW patent, GIF reading support has"),
+dkT("been removed altogether, and the GIF writer has been simplified to produce"),
+dkT("\"uncompressed GIFs\". This technique does not use the LZW algorithm; the"),
+dkT("resulting GIF files are larger than usual, but are readable by all standard"),
+dkT("GIF decoders."),
+dkT(""),
+dkT("We are required to state that"),
+dkT(" \"The Graphics Interchange Format(c) is the Copyright property of"),
+dkT(" CompuServe Incorporated. GIF(sm) is a Service Mark property of"),
+dkT(" CompuServe Incorporated.\""),
+#endif
+#if DK4_HAVE_TIFF_H
+dkT(""),
+dkT("libtiff license"),
+dkT("==============="),
+dkT(""),
+dkT("Copyright (c) 1988-1997 Sam Leffler"),
+dkT("Copyright (c) 1991-1997 Silicon Graphics, Inc."),
+dkT(""),
+dkT("Permission to use, copy, modify, distribute, and sell this software and "),
+dkT("its documentation for any purpose is hereby granted without fee, provided"),
+dkT("that (i) the above copyright notices and this permission notice appear in"),
+dkT("all copies of the software and related documentation, and (ii) the names of"),
+dkT("Sam Leffler and Silicon Graphics may not be used in any advertising or"),
+dkT("publicity relating to the software without the specific, prior written"),
+dkT("permission of Sam Leffler and Silicon Graphics."),
+dkT(""),
+dkT("THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, "),
+dkT("EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY "),
+dkT("WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. "),
+dkT(""),
+dkT("IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR"),
+dkT("ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,"),
+dkT("OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,"),
+dkT("WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF "),
+dkT("LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE "),
+dkT("OF THIS SOFTWARE."),
+#endif
+#if DK4_HAVE_ZLIB_H
+dkT(""),
+dkT("zlib license"),
+dkT("============"),
+dkT(""),
+dkT(" (C) 1995-2004 Jean-loup Gailly and Mark Adler"),
+dkT(""),
+dkT(" This software is provided 'as-is', without any express or implied"),
+dkT(" warranty. In no event will the authors be held liable for any damages"),
+dkT(" arising from the use of this software."),
+dkT(""),
+dkT(" Permission is granted to anyone to use this software for any purpose,"),
+dkT(" including commercial applications, and to alter it and redistribute it"),
+dkT(" freely, subject to the following restrictions:"),
+dkT(""),
+dkT(" 1. The origin of this software must not be misrepresented; you must not"),
+dkT(" claim that you wrote the original software. If you use this software"),
+dkT(" in a product, an acknowledgment in the product documentation would be"),
+dkT(" appreciated but is not required."),
+dkT(" 2. Altered source versions must be plainly marked as such, and must not be"),
+dkT(" misrepresented as being the original software."),
+dkT(" 3. This notice may not be removed or altered from any source distribution."),
+dkT(""),
+dkT(" Jean-loup Gailly Mark Adler"),
+dkT(" jloup@gzip.org madler@alumni.caltech.edu"),
+dkT(""),
+dkT("If you use the zlib library in a product, we would appreciate *not*"),
+dkT("receiving lengthy legal documents to sign. The sources are provided"),
+dkT("for free but without warranty of any kind. The library has been"),
+dkT("entirely written by Jean-loup Gailly and Mark Adler; it does not"),
+dkT("include third-party code."),
+dkT(""),
+dkT("If you redistribute modified sources, we would appreciate that you include"),
+dkT("in the file ChangeLog history information documenting your changes. Please"),
+dkT("read the FAQ for more information on the distribution of modified source"),
+dkT("versions."),
+#endif
+dkT(""),
+NULL
+
+
+#line 381 "w2llic.ctr"
+};
+
+
+
+const dkChar * const *
+w2llic_get_text(void)
+{
+ return wxd2lat_license_text;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/w2llic.ctr b/support/dktools/w2llic.ctr
new file mode 100644
index 0000000000..4180de5c14
--- /dev/null
+++ b/support/dktools/w2llic.ctr
@@ -0,0 +1,392 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Get pointer to string array containing license terms.
+ @return Pointer to string array.
+*/
+const dkChar * const *
+w2llic_get_text(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#include "wxd2lat.h"
+
+
+$!trace-include
+
+
+
+/** License text.
+*/
+static const dkChar * const wxd2lat_license_text[] = {
+$!text macro=dkT,preprocessor
+
+Overview
+========
+This software uses code from the following projects either directly
+or as a library:
+
+dktools Dirk Krause's tools and libraries.
+ See http://sourceforge.net/p/wiki/Home/ for information.
+#if DK4_HAVE_PNG_H
+
+libpng PNG reference library.
+ See http://www.libpng.org/pub/png/libpng.html for information.
+#endif
+#if DK4_HAVE_JPEGLIB_H
+
+jpeg Independent JPEG groups free JPEG library.
+ See http://www.ijg.org/ for information.
+#endif
+#if DK4_HAVE_TIFF_H
+
+libtiff TIFF library.
+ See http://www.remotesensing.org/libtiff/ for information.
+#endif
+#if DK4_HAVE_ZLIB_H
+
+zlib Compression library.
+ See http://www.zlib.net/ for information.
+#endif
+
+Your use of the bmpp program must be in compliance with the license conditions
+for the dktools project and the license conditions for all the libraries used
+by bmpp.
+
+License for the dktools project
+===============================
+Copyright (c) 2011-2018, Dirk Krause
+All rights reserved.
+
+Redistribution and use in source and binary forms,
+with or without modification, are permitted provided
+that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the name of the copyright holder(s) nor the names of contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.
+
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#if DK4_HAVE_PNG_H
+
+libpng license
+==============
+
+This copy of the libpng notices is provided for your convenience. In case of
+any discrepancy between this copy and the notices in the file png.h that is
+included in the libpng distribution, the latter shall prevail.
+
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+
+If you modify libpng you may insert additional notices immediately following
+this sentence.
+
+This code is released under the libpng license.
+
+libpng versions 1.2.6, August 15, 2004, through 1.2.46, July 9, 2011, are
+Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.2.5
+with the following individual added to the list of Contributing Authors
+
+ Cosmin Truta
+
+libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
+Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.0.6
+with the following individuals added to the list of Contributing Authors
+
+ Simon-Pierre Cadieux
+ Eric S. Raymond
+ Gilles Vollant
+
+and with the following additions to the disclaimer:
+
+ There is no warranty against interference with your enjoyment of the
+ library or against infringement. There is no warranty that our
+ efforts or the library will fulfill any of your particular purposes
+ or needs. This library is provided with all faults, and the entire
+ risk of satisfactory quality, performance, accuracy, and effort is with
+ the user.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-0.96,
+with the following individuals added to the list of Contributing Authors:
+
+ Tom Lane
+ Glenn Randers-Pehrson
+ Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996, 1997 Andreas Dilger
+Distributed according to the same disclaimer and license as libpng-0.88,
+with the following individuals added to the list of Contributing Authors:
+
+ John Bowler
+ Kevin Bracey
+ Sam Bushell
+ Magnus Holmgren
+ Greg Roelofs
+ Tom Tanner
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+ Andreas Dilger
+ Dave Martindale
+ Guy Eric Schalnat
+ Paul Schmidt
+ Tim Wegner
+
+The PNG Reference Library is supplied "AS IS". The Contributing Authors
+and Group 42, Inc. disclaim all warranties, expressed or implied,
+including, without limitation, the warranties of merchantability and of
+fitness for any purpose. The Contributing Authors and Group 42, Inc.
+assume no liability for direct, indirect, incidental, special, exemplary,
+or consequential damages, which may result from the use of the PNG
+Reference Library, even if advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+1. The origin of this source code must not be misrepresented.
+
+2. Altered versions must be plainly marked as such and must not
+ be misrepresented as being the original source.
+
+3. This Copyright notice may not be removed or altered from any
+ source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit, without
+fee, and encourage the use of this source code as a component to
+supporting the PNG file format in commercial products. If you use this
+source code in a product, acknowledgment is not required but would be
+appreciated.
+
+
+A "png_get_copyright" function is available, for convenient use in "about"
+boxes and the like:
+
+ printf("%s",png_get_copyright(NULL));
+
+Also, the PNG logo (in PNG format, of course) is supplied in the
+files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+
+Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
+certification mark of the Open Source Initiative.
+
+Glenn Randers-Pehrson
+glennrp at users.sourceforge.net
+July 9, 2011
+#endif
+#if DK4_HAVE_JPEGLIB_H
+
+jpeglib license
+===============
+
+In plain English:
+
+1. We don't promise that this software works. (But if you find any bugs,
+ please let us know!)
+2. You can use this software for whatever you want. You don't have to pay us.
+3. You may not pretend that you wrote this software. If you use it in a
+ program, you must acknowledge somewhere in your documentation that
+ you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose. This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library. If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it. This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it. (See the file
+ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh). Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses. For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs". This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+ "The Graphics Interchange Format(c) is the Copyright property of
+ CompuServe Incorporated. GIF(sm) is a Service Mark property of
+ CompuServe Incorporated."
+#endif
+#if DK4_HAVE_TIFF_H
+
+libtiff license
+===============
+
+Copyright (c) 1988-1997 Sam Leffler
+Copyright (c) 1991-1997 Silicon Graphics, Inc.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee, provided
+that (i) the above copyright notices and this permission notice appear in
+all copies of the software and related documentation, and (ii) the names of
+Sam Leffler and Silicon Graphics may not be used in any advertising or
+publicity relating to the software without the specific, prior written
+permission of Sam Leffler and Silicon Graphics.
+
+THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+OF THIS SOFTWARE.
+#endif
+#if DK4_HAVE_ZLIB_H
+
+zlib license
+============
+
+ (C) 1995-2004 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not*
+receiving lengthy legal documents to sign. The sources are provided
+for free but without warranty of any kind. The library has been
+entirely written by Jean-loup Gailly and Mark Adler; it does not
+include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include
+in the file ChangeLog history information documenting your changes. Please
+read the FAQ for more information on the distribution of modified source
+versions.
+#endif
+
+$!end
+};
+
+
+
+const dkChar * const *
+w2llic_get_text(void)
+{
+ return wxd2lat_license_text;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/w2llic.h b/support/dktools/w2llic.h
new file mode 100644
index 0000000000..61e6b4a372
--- /dev/null
+++ b/support/dktools/w2llic.h
@@ -0,0 +1,50 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: w2llic.ctr
+*/
+
+/** @file w2llic.h Header file for the w2llic module.
+*/
+
+#ifndef W2LLIC_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define W2LLIC_H_INCLUDED 1
+
+
+#line 9 "w2llic.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Get pointer to string array containing license terms.
+ @return Pointer to string array.
+*/
+const dkChar * const *
+w2llic_get_text(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/win32/dk3conf.h b/support/dktools/win32/dk3conf.h
index 9801b8e614..23f123cc94 100644
--- a/support/dktools/win32/dk3conf.h
+++ b/support/dktools/win32/dk3conf.h
@@ -8,7 +8,7 @@
#define DK3_CONF_H_INCLUDED 1
#ifndef DK3_ON_WINDOWS
-#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#if _WIN32
/** On a Windows system. */
#define DK3_ON_WINDOWS 1
#else
@@ -98,6 +98,86 @@
#define DK3_HAVE_ATANL 1
#endif
+#ifndef DK3_HAVE_ISLESSEQUAL
+#if _WIN32
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+#define DK3_HAVE_ISLESSEQUAL 1
+#else
+#define DK3_HAVE_ISLESSEQUAL 0
+#endif
+#else
+#define DK3_HAVE_ISLESSEQUAL 1
+#endif
+#endif
+
+#ifndef DK3_HAVE_ISLESS
+#if _WIN32
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+#define DK3_HAVE_ISLESS 1
+#else
+#define DK3_HAVE_ISLESS 0
+#endif
+#else
+#define DK3_HAVE_ISLESS 1
+#endif
+#endif
+
+#ifndef DK3_HAVE_ISGREATEREQUAL
+#if _WIN32
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+#define DK3_HAVE_ISGREATEREQUAL 1
+#else
+#define DK3_HAVE_ISGREATEREQUAL 0
+#endif
+#else
+#define DK3_HAVE_ISGREATEREQUAL 1
+#endif
+#endif
+
+#ifndef DK3_HAVE_ISGREATER
+#if _WIN32
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+#define DK3_HAVE_ISGREATER 1
+#else
+#define DK3_HAVE_ISGREATER 0
+#endif
+#else
+#define DK3_HAVE_ISGREATER 1
+#endif
+#endif
+
+#ifndef DK3_HAVE_ISFINITE
+#if _WIN32
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+#define DK3_HAVE_ISFINITE 1
+#else
+#define DK3_HAVE_ISFINITE 0
+#endif
+#else
+#define DK3_HAVE_ISFINITE 1
+#endif
+#endif
+
+#ifndef DK3_HAVE_ISNORMAL
+#if _WIN32
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800)
+#define DK3_HAVE_ISNORMAL 1
+#else
+#define DK3_HAVE_ISNORMAL 0
+#endif
+#else
+#define DK3_HAVE_ISNORMAL 1
+#endif
+#endif
+
+#ifndef DK3_HAVE__FINITE
+#if _WIN32
+#define DK3_HAVE__FINITE 1
+#else
+#define DK3_HAVE__FINITE 0
+#endif
+#endif
+
#ifndef DK3_HAVE_BACKSLASH
/** DK3 version of HAVE_BACKSLASH.
*/
@@ -345,7 +425,7 @@
#endif
#ifndef DK3_HAVE_FOPEN_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_FOPEN_S.
*/
#define DK3_HAVE_FOPEN_S 1
@@ -395,7 +475,7 @@
#ifndef DK3_HAVE_GETADDRINFO
/** DK3 version of HAVE_GETADDRINFO.
*/
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
#define DK3_HAVE_GETADDRINFO 1
#else
#define DK3_HAVE_GETADDRINFO 0
@@ -537,7 +617,7 @@
#ifndef DK3_HAVE_INET_PTON
/** DK3 version of HAVE_INET_PTON.
*/
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
#define DK3_HAVE_INET_PTON 1
#else
#define DK3_HAVE_INET_PTON 0
@@ -557,7 +637,7 @@
#endif
#ifndef DK3_HAVE_INTMAX_T
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_INTMAX_T.
*/
#define DK3_HAVE_INTMAX_T 1
@@ -598,6 +678,12 @@
#define DK3_HAVE_ISFINITE 0
#endif
+#ifndef DK3_HAVE__FINITE
+/** DK3 version of HAVE__FINITE.
+*/
+#define DK3_HAVE__FINITE 1
+#endif
+
#ifndef DK3_HAVE_ISNORMAL
/** DK3 version of HAVE_ISNORMAL.
*/
@@ -647,7 +733,7 @@
#endif
#ifndef DK3_HAVE_LOCALTIME_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_LOCALTIME_S.
*/
#define DK3_HAVE_LOCALTIME_S 1
@@ -995,7 +1081,7 @@
#endif
#ifndef DK3_HAVE_SPRINTF_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_SPRINTF_S.
*/
#define DK3_HAVE_SPRINTF_S 1
@@ -1019,7 +1105,7 @@
#endif
#ifndef DK3_HAVE_SSCANF_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_SSCANF_S.
*/
#define DK3_HAVE_SSCANF_S 1
@@ -1067,7 +1153,7 @@
#endif
#ifndef DK3_HAVE_STDINT_H
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STDINT_H.
*/
#define DK3_HAVE_STDINT_H 1
@@ -1103,7 +1189,7 @@
#endif
#ifndef DK3_HAVE_STRCAT_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRCAT_S.
*/
#define DK3_HAVE_STRCAT_S 1
@@ -1133,7 +1219,7 @@
#endif
#ifndef DK3_HAVE_STRCPY_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRCPY_S.
*/
#define DK3_HAVE_STRCPY_S 1
@@ -1193,7 +1279,7 @@
#endif
#ifndef DK3_HAVE_STRNCPY_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRNCPY_S.
*/
#define DK3_HAVE_STRNCPY_S 1
@@ -1223,7 +1309,7 @@
#endif
#ifndef DK3_HAVE_STRTOIMAX
-#if (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRTOIMAX.
*/
#define DK3_HAVE_STRTOIMAX 1
@@ -1235,7 +1321,7 @@
#endif
#ifndef DK3_HAVE_STRTOL
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRTOL.
*/
#define DK3_HAVE_STRTOL 1
@@ -1247,7 +1333,7 @@
#endif
#ifndef DK3_HAVE_STRTOLL
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRTOLL.
*/
#define DK3_HAVE_STRTOLL 1
@@ -1259,7 +1345,7 @@
#endif
#ifndef DK3_HAVE_STRTOUL
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRTOUL.
*/
#define DK3_HAVE_STRTOUL 1
@@ -1271,7 +1357,7 @@
#endif
#ifndef DK3_HAVE_STRTOULL
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRTOULL.
*/
#define DK3_HAVE_STRTOULL 1
@@ -1283,7 +1369,7 @@
#endif
#ifndef DK3_HAVE_STRTOUMAX
-#if (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_STRTOUMAX.
*/
#define DK3_HAVE_STRTOUMAX 1
@@ -1309,7 +1395,7 @@
#ifndef DK3_HAVE_STRUCT_SOCKADDR_IN6
/** DK3 version of HAVE_STRUCT_SOCKADDR_IN6.
*/
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
#define DK3_HAVE_STRUCT_SOCKADDR_IN6 1
#else
#define DK3_HAVE_STRUCT_SOCKADDR_IN6 0
@@ -1329,7 +1415,7 @@
#endif
#ifndef DK3_HAVE_SWSCANF_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_SWSCANF_S.
*/
#define DK3_HAVE_SWSCANF_S 1
@@ -1581,7 +1667,7 @@
#endif
#ifndef DK3_HAVE_WCSCAT_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSCAT_S.
*/
#define DK3_HAVE_WCSCAT_S 1
@@ -1611,7 +1697,7 @@
#endif
#ifndef DK3_HAVE_WCSCPY_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSCPY_S.
*/
#define DK3_HAVE_WCSCPY_S 1
@@ -1653,7 +1739,7 @@
#endif
#ifndef DK3_HAVE_WCSNCPY_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSNCPY_S.
*/
#define DK3_HAVE_WCSNCPY_S 1
@@ -1677,7 +1763,7 @@
#endif
#ifndef DK3_HAVE_WCSTOIMAX
-#if (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSTOIMAX.
*/
#define DK3_HAVE_WCSTOIMAX 1
@@ -1689,7 +1775,7 @@
#endif
#ifndef DK3_HAVE_WCSTOL
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSTOL.
*/
#define DK3_HAVE_WCSTOL 1
@@ -1701,7 +1787,7 @@
#endif
#ifndef DK3_HAVE_WCSTOLL
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSTOLL.
*/
#define DK3_HAVE_WCSTOLL 1
@@ -1713,7 +1799,7 @@
#endif
#ifndef DK3_HAVE_WCSTOUL
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSTOUL.
*/
#define DK3_HAVE_WCSTOUL 1
@@ -1725,7 +1811,7 @@
#endif
#ifndef DK3_HAVE_WCSTOULL
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSTOULL.
*/
#define DK3_HAVE_WCSTOULL 1
@@ -1737,7 +1823,7 @@
#endif
#ifndef DK3_HAVE_WCSTOUMAX
-#if (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1800) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE_WCSTOUMAX.
*/
#define DK3_HAVE_WCSTOUMAX 1
@@ -1791,7 +1877,7 @@
#endif
#ifndef DK3_HAVE__CLEARFP
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE__CLEARFP.
*/
#define DK3_HAVE__CLEARFP 1
@@ -1851,7 +1937,7 @@
#endif
#ifndef DK3_HAVE__GETENV_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE__GETENV_S.
*/
#define DK3_HAVE__GETENV_S 1
@@ -1917,7 +2003,7 @@
#endif
#ifndef DK3_HAVE__SNPRINTF_S
-#if (_MSC_VER >= 1) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE__SNPRINTF_S.
*/
#define DK3_HAVE__SNPRINTF_S 1
@@ -2025,7 +2111,7 @@
#endif
#ifndef DK3_HAVE__WFOPEN_S
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of HAVE__WFOPEN_S.
*/
#define DK3_HAVE__WFOPEN_S 1
@@ -2067,7 +2153,7 @@
#endif
#ifndef DK3_SIZEOF_INTMAX_T
-#if (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700) && (!(DK4_WINDOWS_LEGACY))
/** DK3 version of SIZEOF_INTMAX_T.
*/
#define DK3_SIZEOF_INTMAX_T 8
@@ -2714,6 +2800,12 @@
#define DK3_HAVE_ISFINITE 1
#endif
+#ifndef DK3_HAVE__FINITE
+/** DK3 version of HAVE__FINITE.
+*/
+#define DK3_HAVE__FINITE 0
+#endif
+
#ifndef DK3_HAVE_ISNORMAL
/** DK3 version of HAVE_ISNORMAL.
*/
diff --git a/support/dktools/win32/dk4conf.h b/support/dktools/win32/dk4conf.h
index 85056d6617..ca2feb3695 100644
--- a/support/dktools/win32/dk4conf.h
+++ b/support/dktools/win32/dk4conf.h
@@ -6,21 +6,33 @@
#define DK4_CONF_H_INCLUDED 1
#ifndef DK4_ON_WINDOWS
-#ifdef _WIN32
+#if _WIN32
#define DK4_ON_WINDOWS 1
#endif
#endif
#ifndef DK4_HAVE_INLINE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_INLINE 0
#else
#define DK4_HAVE_INLINE 1
#endif
#endif
+#ifndef DK4_USE_INLINE
+#define DK4_USE_INLINE 0
+#endif
+
+#ifndef DK4_HAVE_ATTRIBUTE_UNUSED
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_ATTRIBUTE_UNUSED 1
+#else
+#define DK4_HAVE_ATTRIBUTE_UNUSED 0
+#endif
+#endif
+
#ifndef DK4_HAVE_LIBNETSNMP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_LIBNETSNMP 0
#else
#define DK4_HAVE_LIBNETSNMP 1
@@ -28,7 +40,7 @@
#endif
#ifndef DK4_HAVE_SNMP_ENABLE_FILELOG
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SNMP_ENABLE_FILELOG 0
#else
#define DK4_HAVE_SNMP_ENABLE_FILELOG 1
@@ -36,7 +48,7 @@
#endif
#ifndef DK4_HAVE_SNMP_DISABLE_FILELOG
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SNMP_DISABLE_FILELOG 0
#else
#define DK4_HAVE_SNMP_DISABLE_FILELOG 1
@@ -44,7 +56,7 @@
#endif
#ifndef DK4_HAVE_SNMP_DISABLE_SYSLOG
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SNMP_DISABLE_SYSLOG 0
#else
#define DK4_HAVE_SNMP_DISABLE_SYSLOG 1
@@ -52,7 +64,7 @@
#endif
#ifndef DK4_HAVE_SNMP_DISABLE_STDERRLOG
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SNMP_DISABLE_STDERRLOG 0
#else
#define DK4_HAVE_SNMP_DISABLE_STDERRLOG 1
@@ -66,7 +78,7 @@
#ifndef DK4_HAVE_UNISTD_H
/** DK4 version of HAVE_UNISTD_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_UNISTD_H 0
#else
#define DK4_HAVE_UNISTD_H 1
@@ -74,7 +86,7 @@
#endif
#ifndef DK4_HAVE_WINDOWS_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WINDOWS_H 1
#else
#define DK4_HAVE_WINDOWS_H 0
@@ -82,7 +94,7 @@
#endif
#ifndef DK4_HAVE_WINSOCK2_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WINSOCK2_H 1
#else
#define DK4_HAVE_WINSOCK2_H 0
@@ -90,7 +102,7 @@
#endif
#ifndef DK4_HAVE_WS2TCPIP_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WS2TCPIP_H 1
#else
#define DK4_HAVE_WS2TCPIP_H 0
@@ -98,7 +110,7 @@
#endif
#ifndef DK4_HAVE_SYS_SELECT_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SYS_SELECT_H 0
#else
#define DK4_HAVE_SYS_SELECT_H 1
@@ -107,7 +119,7 @@
#ifndef DK4_HAVE_PROCESS_H
/** DK4 version of HAVE_PROCESS_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_PROCESS_H 1
#else
#define DK4_HAVE_PROCESS_H 0
@@ -131,8 +143,8 @@
#ifndef DK4_HAVE_STDINT_H
/** DK4 version of HAVE_STDINT_H. */
-#ifdef _WIN32
-#if _MSC_VER >= 1700
+#if _WIN32
+#if (defined(_MSC_VER)) && (_MSC_VER >= 1700)
#define DK4_HAVE_STDINT_H 1
#else
#define DK4_HAVE_STDINT_H 0
@@ -143,7 +155,7 @@
#endif
#ifndef DK4_HAVE_STDLIB_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STDLIB_H 1
#else
#define DK4_HAVE_STDLIB_H 1
@@ -152,7 +164,7 @@
#ifndef DK4_HAVE_INTTYPES_H
/** DK4 version of HAVE_INTTYPES_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_INTTYPES_H 0
#else
#define DK4_HAVE_INTTYPES_H 1
@@ -186,12 +198,24 @@
#ifndef DK4_HAVE_FENV_H
/** DK4 version of HAVE_FENV_H. */
+#if _WIN32
+#if defined(_MSC_VER)
+#if _MSC_VER >= 1800
+#define DK4_HAVE_FENV_H 1
+#else
+#define DK4_HAVE_FENV_H 0
+#endif
+#else
+#define DK4_HAVE_FENV_H 0
+#endif
+#else
#define DK4_HAVE_FENV_H 1
#endif
+#endif
#ifndef DK4_HAVE_FLOAT_H
/** DK4 version of HAVE_FLOAT_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FLOAT_H 1
#else
#define DK4_HAVE_FLOAT_H 0
@@ -209,7 +233,7 @@
#endif
#ifndef DK4_HAVE_TYPE_STAT64
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_TYPE_STAT64 0
#else
#define DK4_HAVE_TYPE_STAT64 1
@@ -217,7 +241,7 @@
#endif
#ifndef DK4_HAVE_UCHAR_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_UCHAR_H 0
#else
#define DK4_HAVE_UCHAR_H 1
@@ -251,7 +275,7 @@
#ifndef DK4_HAVE_STDATOMIC_H
/** DK4 version of HAVE_STDATOMIC_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STDATOMIC_H 0
#else
#define DK4_HAVE_STDATOMIC_H 1
@@ -260,7 +284,7 @@
#ifndef DK4_HAVE_STDBOOL_H
/** DK4 version of HAVE_STDBOOL_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STDBOOL_H 0
#else
#define DK4_HAVE_STDBOOL_H 1
@@ -279,7 +303,7 @@
#ifndef DK4_HAVE_TGMATH_H
/** DK4 version of HAVE_TGMATH_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_TGMATH_H 0
#else
#define DK4_HAVE_TGMATH_H 1
@@ -297,7 +321,7 @@
#endif
#ifndef DK4_HAVE_SYS_SOCKET_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SYS_SOCKET_H 0
#else
#define DK4_HAVE_SYS_SOCKET_H 1
@@ -305,7 +329,7 @@
#endif
#ifndef DK4_HAVE_SYS_UN_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SYS_UN_H 0
#else
#define DK4_HAVE_SYS_UN_H 1
@@ -313,7 +337,7 @@
#endif
#ifndef DK4_HAVE_NETINET_IN_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_NETINET_IN_H 0
#else
#define DK4_HAVE_NETINET_IN_H 1
@@ -322,7 +346,7 @@
#ifndef DK4_HAVE_NETINET_IN6_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_NETINET_IN6_H 0
#else
#define DK4_HAVE_NETINET_IN6_H 1
@@ -330,7 +354,7 @@
#endif
#ifndef DK4_HAVE_NETDB_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_NETDB_H 0
#else
#define DK4_HAVE_NETDB_H 1
@@ -338,7 +362,7 @@
#endif
#ifndef DK4_HAVE_ARPA_INET_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_ARPA_INET_H 0
#else
#define DK4_HAVE_ARPA_INET_H 1
@@ -346,7 +370,7 @@
#endif
#ifndef DK4_HAVE_PWD_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_PWD_H 0
#else
#define DK4_HAVE_PWD_H 1
@@ -355,7 +379,7 @@
#ifndef DK4_HAVE_SYS_PARAM_H
/** DK4 version of HAVE_SYS_PARAM_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SYS_PARAM_H 0
#else
#define DK4_HAVE_SYS_PARAM_H 1
@@ -374,7 +398,7 @@
#ifndef DK4_HAVE_STRINGS_H
/** DK4 version of HAVE_STRINGS_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STRINGS_H 0
#else
#define DK4_HAVE_STRINGS_H 1
@@ -383,7 +407,7 @@
#ifndef DK4_HAVE_IO_H
/** DK4 version of HAVE_IO_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_IO_H 1
#else
#define DK4_HAVE_IO_H 0
@@ -395,7 +419,7 @@
#endif
#ifndef DK4_HAVE_SHARE_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SHARE_H 1
#else
#define DK4_HAVE_SHARE_H 0
@@ -404,7 +428,7 @@
#ifndef DK4_HAVE_BIOS_H
/** DK4 version of HAVE_BIOS_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_BIOS_H 1
#else
#define DK4_HAVE_BIOS_H 0
@@ -413,7 +437,7 @@
#ifndef DK4_HAVE_DOS_H
/** DK4 version of HAVE_DOS_H. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_DOS_H 1
#else
#define DK4_HAVE_DOS_H 0
@@ -431,7 +455,7 @@
#endif
#ifndef DK4_HAVE_DIRENT_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_DIRENT_H 0
#else
#define DK4_HAVE_DIRENT_H 1
@@ -439,7 +463,7 @@
#endif
#ifndef DK4_HAVE_DIRECT_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_DIRECT_H 1
#else
#define DK4_HAVE_DIRECT_H 0
@@ -447,103 +471,151 @@
#endif
#ifndef DK4_HAVE_LONG_LONG
-#ifdef _WIN32
-#if _MSC_VER >= 1700
+#if _WIN32
+#if defined(_MSC_VER)
+#if _MSC_VER >= 1500
#define DK4_HAVE_LONG_LONG 1
#else
#define DK4_HAVE_LONG_LONG 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_LONG_LONG 1
+#endif
+#endif
+#else
#define DK4_HAVE_LONG_LONG 1
#endif
#endif
#ifndef DK4_HAVE_LONG_DOUBLE
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_LONG_DOUBLE 1
#else
#define DK4_HAVE_LONG_DOUBLE 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_LONG_DOUBLE 1
+#endif
+#endif
+#else
#define DK4_HAVE_LONG_DOUBLE 1
#endif
#endif
#ifndef DK4_HAVE_INT8_T
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_INT8_T 1
#else
#define DK4_HAVE_INT8_T 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_INT8_T 1
+#endif
+#endif
+#else
#define DK4_HAVE_INT8_T 1
#endif
#endif
#ifndef DK4_HAVE_INT16_T
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_INT16_T 1
#else
#define DK4_HAVE_INT16_T 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_INT16_T 1
+#endif
+#endif
+#else
#define DK4_HAVE_INT16_T 1
#endif
#endif
#ifndef DK4_HAVE_INT32_T
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_INT32_T 1
#else
#define DK4_HAVE_INT32_T 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_INT32_T 1
+#endif
+#endif
+#else
#define DK4_HAVE_INT32_T 1
#endif
#endif
#ifndef DK4_HAVE_UINT8_T
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_UINT8_T 1
#else
#define DK4_HAVE_UINT8_T 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_UINT8_T 1
+#endif
+#endif
+#else
#define DK4_HAVE_UINT8_T 1
#endif
#endif
#ifndef DK4_HAVE_UINT16_T
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_UINT16_T 1
#else
#define DK4_HAVE_UINT16_T 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_UINT16_T 1
+#endif
+#endif
+#else
#define DK4_HAVE_UINT16_T 1
#endif
#endif
#ifndef DK4_HAVE_UINT32_T
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_UINT32_T 1
#else
#define DK4_HAVE_UINT32_T 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_UINT32_T 1
+#endif
+#endif
+#else
#define DK4_HAVE_UINT32_T 1
#endif
#endif
#ifndef DK4_HAVE_SSIZE_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SSIZE_T 0
#else
#define DK4_HAVE_SSIZE_T 1
@@ -551,19 +623,25 @@
#endif
#ifndef DK4_HAVE_INTMAX_T
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1800
#define DK4_HAVE_INTMAX_T 1
#else
#define DK4_HAVE_INTMAX_T 0
#endif
#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_INTMAX_T 1
+#endif
+#endif
+#else
#define DK4_HAVE_INTMAX_T 1
#endif
#endif
#ifndef DK4_HAVE_VOLATILE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_VOLATILE 1
#else
#define DK4_HAVE_VOLATILE 1
@@ -571,7 +649,7 @@
#endif
#ifndef DK4_HAVE_SIG_ATOMIC_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SIG_ATOMIC_T 1
#else
#define DK4_HAVE_SIG_ATOMIC_T 1
@@ -590,11 +668,11 @@
#ifndef DK4_SIZEOF_SIZE_T
/** DK4 version of SIZEOF_SIZE_T. */
-#ifdef _WIN32
-#ifdef _WIN64
-#define DK4_SIZEOF_SIZE_T 4
-#else
+#if _WIN32
+#if _WIN64
#define DK4_SIZEOF_SIZE_T 8
+#else
+#define DK4_SIZEOF_SIZE_T 4
#endif
#else
#define DK4_SIZEOF_SIZE_T 8
@@ -616,6 +694,11 @@
#define DK4_SIZEOF_INTMAX_T 8
#endif
+#ifndef DK4_SIZEOF_INT32_T
+/** DK4 version of SIZEOF_INT32_T. */
+#define DK4_SIZEOF_INT32_T 4
+#endif
+
#ifndef DK4_SIZEOF_DOUBLE
/** DK4 version of SIZEOF_DOUBLE. */
#define DK4_SIZEOF_DOUBLE 8
@@ -623,7 +706,7 @@
#ifndef DK4_SIZEOF_LONG_DOUBLE
/** DK4 version of SIZEOF_LONG_DOUBLE. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_SIZEOF_LONG_DOUBLE 8
#else
#define DK4_SIZEOF_LONG_DOUBLE 12
@@ -632,7 +715,7 @@
#ifndef DK4_SIZEOF_WCHAR_T
/** DK4 version of SIZEOF_WCHAR_T. */
-#ifdef _WIN32
+#if _WIN32
#define DK4_SIZEOF_WCHAR_T 2
#else
#define DK4_SIZEOF_WCHAR_T 4
@@ -640,7 +723,7 @@
#endif
#ifndef DK4_SIZEOF_WXCHAR
-#ifdef _WIN32
+#if _WIN32
#ifdef _UNICODE
#define DK4_SIZEOF_WXCHAR 2
#else
@@ -652,7 +735,7 @@
#endif
#ifndef DK4_TIME_WITH_SYS_TIME
-#ifdef _WIN32
+#if _WIN32
#define DK4_TIME_WITH_SYS_TIME 0
#else
#define DK4_TIME_WITH_SYS_TIME 1
@@ -668,7 +751,7 @@
#endif
#ifndef DK4_HAVE_BZERO
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_BZERO 0
#else
#define DK4_HAVE_BZERO 1
@@ -680,10 +763,10 @@
#endif
#ifndef DK4_HAVE_BCOPY
-#ifdef _WIN32
-#define DK4_HAVE_BCOPY 1
-#else
+#if _WIN32
#define DK4_HAVE_BCOPY 0
+#else
+#define DK4_HAVE_BCOPY 1
#endif
#endif
@@ -692,7 +775,7 @@
#endif
#ifndef DK4_HAVE_BCMP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_BCMP 0
#else
#define DK4_HAVE_BCMP 1
@@ -712,7 +795,8 @@
#endif
#ifndef DK4_HAVE_STRCPY_S
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_STRCPY_S 1
#else
@@ -721,10 +805,14 @@
#else
#define DK4_HAVE_STRCPY_S 0
#endif
+#else
+#define DK4_HAVE_STRCPY_S 0
+#endif
#endif
#ifndef DK4_HAVE_STRCAT_S
-#ifdef _WIN32
+#if _WIN32
+#if defined (_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_STRCAT_S 1
#else
@@ -733,10 +821,13 @@
#else
#define DK4_HAVE_STRCAT_S 0
#endif
+#else
+#define DK4_HAVE_STRCAT_S 0
+#endif
#endif
#ifndef DK4_HAVE_STRCASECMP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STRCASECMP 0
#else
#define DK4_HAVE_STRCASECMP 1
@@ -744,7 +835,7 @@
#endif
#ifndef DK4_HAVE_STRICMP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STRICMP 0
#else
#define DK4_HAVE_STRICMP 0
@@ -752,7 +843,7 @@
#endif
#ifndef DK4_HAVE__STRICMP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__STRICMP 1
#else
#define DK4_HAVE__STRICMP 0
@@ -764,7 +855,7 @@
#endif
#ifndef DK4_HAVE_WCSCPY_S
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WCSCPY_S 1
#else
#define DK4_HAVE_WCSCPY_S 0
@@ -776,7 +867,7 @@
#endif
#ifndef DK4_HAVE_WCSCAT_S
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WCSCAT_S 1
#else
#define DK4_HAVE_WCSCAT_S 0
@@ -812,7 +903,7 @@
#endif
#ifndef DK4_HAVE_WCSCASECMP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WCSCASECMP 0
#else
#define DK4_HAVE_WCSCASECMP 1
@@ -824,7 +915,7 @@
#endif
#ifndef DK4_HAVE_WCSICMP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WCSICMP 0
#else
#define DK4_HAVE_WCSICMP 0
@@ -832,7 +923,7 @@
#endif
#ifndef DK4_HAVE__WCSICMP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WCSICMP 1
#else
#define DK4_HAVE__WCSICMP 0
@@ -840,7 +931,7 @@
#endif
#ifndef DK4_HAVE_GETPID
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETPID 0
#else
#define DK4_HAVE_GETPID 1
@@ -848,7 +939,7 @@
#endif
#ifndef DK4_HAVE_READLINK
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_READLINK 0
#else
#define DK4_HAVE_READLINK 1
@@ -856,7 +947,7 @@
#endif
#ifndef DK4_HAVE_GETENV
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETENV 1
#else
#define DK4_HAVE_GETENV 1
@@ -864,7 +955,8 @@
#endif
#ifndef DK4_HAVE_GETENV_S
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
#if _MSC_VER >= 1700
#define DK4_HAVE_GETENV_S 1
#else
@@ -873,10 +965,13 @@
#else
#define DK4_HAVE_GETENV_S 0
#endif
+#else
+#define DK4_HAVE_GETENV_S 0
+#endif
#endif
#ifndef DK4_HAVE_SETLOCALE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETLOCALE 1
#else
#define DK4_HAVE_SETLOCALE 1
@@ -884,7 +979,7 @@
#endif
#ifndef DK4_HAVE_SETSOCKOPT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETSOCKOPT 1
#else
#define DK4_HAVE_SETSOCKOPT 1
@@ -892,7 +987,7 @@
#endif
#ifndef DK4_HAVE_SELECT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SELECT 1
#else
#define DK4_HAVE_SELECT 1
@@ -900,39 +995,31 @@
#endif
#ifndef DK4_HAVE_GETADDRINFO
-#ifdef _WIN32
-#if _MSC_VER >= 1700
-#if DK4_WINDOWS_LEGACY
-#define DK4_HAVE_GETADDRINFO 0
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0600)
+#define DK4_HAVE_GETADDRINFO 1
#else
-#define DK4_HAVE_GETADDRINFO 1
+#define DK4_HAVE_GETADDRINFO 0
#endif
#else
-#define DK4_HAVE_GETADDRINFO 0
-#endif
-#else
-#define DK4_HAVE_GETADDRINFO 1
+#define DK4_HAVE_GETADDRINFO
#endif
#endif
#ifndef DK4_HAVE_GETNAMEINFO
-#ifdef _WIN32
-#if _MSC_VER >= 1700
-#if DK4_WINDOWS_LEGACY
-#define DK4_HAVE_GETNAMEINFO 0
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0600)
+#define DK4_HAVE_GETNAMEINFO 1
#else
-#define DK4_HAVE_GETNAMEINFO 1
+#define DK4_HAVE_GETNAMEINFO 0
#endif
#else
-#define DK4_HAVE_GETNAMEINFO 0
-#endif
-#else
-#define DK4_HAVE_GETNAMEINFO 1
+#define DK4_HAVE_GETNAMEINFO 1
#endif
#endif
#ifndef DK4_HAVE_GETHOSTBYNAME
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETHOSTBYNAME 1
#else
#define DK4_HAVE_GETHOSTBYNAME 1
@@ -940,7 +1027,7 @@
#endif
#ifndef DK4_HAVE_HTONS
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_HTONS 1
#else
#define DK4_HAVE_HTONS 1
@@ -948,7 +1035,7 @@
#endif
#ifndef DK4_HAVE_NTOHS
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_NTOHS 1
#else
#define DK4_HAVE_NTOHS 1
@@ -956,7 +1043,7 @@
#endif
#ifndef DK4_HAVE_HTONL
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_HTONL 1
#else
#define DK4_HAVE_HTONL 1
@@ -964,7 +1051,7 @@
#endif
#ifndef DK4_HAVE_NTOHL
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_NTOHL 1
#else
#define DK4_HAVE_NTOHL 1
@@ -972,7 +1059,7 @@
#endif
#ifndef DK4_HAVE_GETCWD
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETCWD 0
#else
#define DK4_HAVE_GETCWD 1
@@ -980,7 +1067,7 @@
#endif
#ifndef DK4_HAVE__GETCWD
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__GETCWD 1
#else
#define DK4_HAVE__GETCWD 0
@@ -988,7 +1075,7 @@
#endif
#ifndef DK4_HAVE__WGETCWD
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WGETCWD 1
#else
#define DK4_HAVE__WGETCWD 0
@@ -996,7 +1083,7 @@
#endif
#ifndef DK4_HAVE_INET_ADDR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_INET_ADDR 1
#else
#define DK4_HAVE_INET_ADDR 1
@@ -1004,7 +1091,7 @@
#endif
#ifndef DK4_HAVE_INET_ATON
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_INET_ATON 0
#else
#define DK4_HAVE_INET_ATON 1
@@ -1012,34 +1099,26 @@
#endif
#ifndef DK4_HAVE_INET_PTON
-#ifdef _WIN32
-#if _MSC_VER >= 1700
-#if DK4_WINDOWS_LEGACY
-#define DK4_HAVE_INET_PTON 0
-#else
-#define DK4_HAVE_INET_PTON 1
-#endif
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0600)
+#define DK4_HAVE_INET_PTON 1
#else
-#define DK4_HAVE_INET_PTON 0
+#define DK4_HAVE_INET_PTON 0
#endif
#else
-#define DK4_HAVE_INET_PTON 1
+#define DK4_HAVE_INET_PTON 1
#endif
#endif
#ifndef DK4_HAVE_INET_NTOP
-#ifdef _WIN32
-#if _MSC_VER >= 1700
-#if DK4_WINDOWS_LEGACY
-#define DK4_HAVE_INET_NTOP 0
-#else
-#define DK4_HAVE_INET_NTOP 1
-#endif
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0600)
+#define DK4_HAVE_INET_NTOP 1
#else
-#define DK4_HAVE_INET_NTOP 0
+#define DK4_HAVE_INET_NTOP 0
#endif
#else
-#define DK4_HAVE_INET_NTOP 1
+#define DK4_HAVE_INET_NTOP 1
#endif
#endif
@@ -1052,7 +1131,7 @@
#endif
#ifndef DK4_HAVE_LSTAT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_LSTAT 0
#else
#define DK4_HAVE_LSTAT 1
@@ -1060,7 +1139,7 @@
#endif
#ifndef DK4_HAVE_STAT64
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STAT64 0
#else
#define DK4_HAVE_STAT64 1
@@ -1068,7 +1147,7 @@
#endif
#ifndef DK4_HAVE_LSTAT64
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_LSTAT64 0
#else
#define DK4_HAVE_LSTAT64 1
@@ -1076,7 +1155,7 @@
#endif
#ifndef DK4_HAVE_LOCALTIME_R
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_LOCALTIME_R 0
#else
#define DK4_HAVE_LOCALTIME_R 1
@@ -1084,7 +1163,7 @@
#endif
#ifndef DK4_HAVE_GETEUID
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETEUID 0
#else
#define DK4_HAVE_GETEUID 1
@@ -1092,7 +1171,7 @@
#endif
#ifndef DK4_HAVE_FOPEN64
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FOPEN64 0
#else
#define DK4_HAVE_FOPEN64 0
@@ -1100,7 +1179,7 @@
#endif
#ifndef DK4_HAVE_FOPEN_S
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FOPEN_S 1
#else
#define DK4_HAVE_FOPEN_S 0
@@ -1108,7 +1187,7 @@
#endif
#ifndef DK4_HAVE__WFOPEN
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WFOPEN 1
#else
#define DK4_HAVE__WFOPEN 0
@@ -1116,7 +1195,7 @@
#endif
#ifndef DK4_HAVE__WFOPEN64
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WFOPEN64 0
#else
#define DK4_HAVE__WFOPEN64 0
@@ -1124,7 +1203,7 @@
#endif
#ifndef DK4_HAVE__WFOPEN_S
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WFOPEN_S 1
#else
#define DK4_HAVE__WFOPEN_S 0
@@ -1132,7 +1211,7 @@
#endif
#ifndef DK4_HAVE_FPUTWS
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FPUTWS 1
#else
#define DK4_HAVE_FPUTWS 0
@@ -1140,7 +1219,7 @@
#endif
#ifndef DK4_HAVE_FPUTWC
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FPUTWC 1
#else
#define DK4_HAVE_FPUTWC 0
@@ -1148,7 +1227,7 @@
#endif
#ifndef DK4_HAVE_SETBUFFER
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETBUFFER 0
#else
#define DK4_HAVE_SETBUFFER 1
@@ -1156,7 +1235,7 @@
#endif
#ifndef DK4_HAVE_SETBUF
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETBUF 1
#else
#define DK4_HAVE_SETBUF 1
@@ -1164,31 +1243,123 @@
#endif
#ifndef DK4_HAVE_SETVBUF
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETVBUF 1
#else
#define DK4_HAVE_SETVBUF 1
#endif
#endif
+#ifndef DK4_HAVE_ISLESSEQUAL
+#if _WIN32
+#if defined(_MSC_VER)
+#if _MSC_VER >= 1800
+#define DK4_HAVE_ISLESSEQUAL 1
+#else
+#define DK4_HAVE_ISLESSEQUAL 0
+#endif
+#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_ISLESSEQUAL 1
+#endif
+#endif
+#else
+#define DK4_HAVE_ISLESSEQUAL 1
+#endif
+#endif
+
+#ifndef DK4_HAVE_ISLESS
+#if _WIN32
+#if defined(_MSC_VER)
+#if _MSC_VER >= 1800
+#define DK4_HAVE_ISLESS 1
+#else
+#define DK4_HAVE_ISLESS 0
+#endif
+#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_ISLESS 1
+#endif
+#endif
+#else
+#define DK4_HAVE_ISLESS 1
+#endif
+#endif
+
+#ifndef DK4_HAVE_ISGREATEREQUAL
+#if _WIN32
+#if defined(_MSC_VER)
+#if _MSC_VER >= 1800
+#define DK4_HAVE_ISGREATEREQUAL 1
+#else
+#define DK4_HAVE_ISGREATEREQUAL 0
+#endif
+#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_ISGREATEREQUAL 1
+#endif
+#endif
+#else
+#define DK4_HAVE_ISGREATEREQUAL 1
+#endif
+#endif
+
+#ifndef DK4_HAVE_ISGREATER
+#if _WIN32
+#if defined(_MSC_VER)
+#if _MSC_VER >= 1800
+#define DK4_HAVE_ISGREATER 1
+#else
+#define DK4_HAVE_ISGREATER 0
+#endif
+#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_ISGREATER 1
+#endif
+#endif
+#else
+#define DK4_HAVE_ISGREATER 1
+#endif
+#endif
+
#ifndef DK4_HAVE_ISFINITE
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
+#if _MSC_VER >= 1800
+#define DK4_HAVE_ISFINITE 1
+#else
#define DK4_HAVE_ISFINITE 0
+#endif
+#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_ISFINITE 1
+#endif
+#endif
#else
#define DK4_HAVE_ISFINITE 1
#endif
#endif
#ifndef DK4_HAVE_ISNORMAL
-#ifdef _WIN32
+#if _WIN32
+#if defined(_MSC_VER)
+#if _MSC_VER >= 1800
+#define DK4_HAVE_ISNORMAL 1
+#else
#define DK4_HAVE_ISNORMAL 0
+#endif
+#else
+#if (__GNUC__) || (__clang__)
+#define DK4_HAVE_ISNORMAL 1
+#endif
+#endif
#else
#define DK4_HAVE_ISNORMAL 1
#endif
#endif
#ifndef DK4_HAVE__FINITE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__FINITE 1
#else
#define DK4_HAVE__FINITE 0
@@ -1196,7 +1367,7 @@
#endif
#ifndef DK4_HAVE_FILENO
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FILENO 0
#else
#define DK4_HAVE_FILENO 1
@@ -1204,7 +1375,7 @@
#endif
#ifndef DK4_HAVE__FILENO
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__FILENO 1
#else
#define DK4_HAVE__FILENO 0
@@ -1212,7 +1383,7 @@
#endif
#ifndef DK4_HAVE_SETMODE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETMODE 0
#else
#define DK4_HAVE_SETMODE 1
@@ -1220,7 +1391,7 @@
#endif
#ifndef DK4_HAVE__SETMODE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__SETMODE 1
#else
#define DK4_HAVE__SETMODE 0
@@ -1228,7 +1399,7 @@
#endif
#ifndef DK4_HAVE_ISATTY
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_ISATTY 0
#else
#define DK4_HAVE_ISATTY 1
@@ -1236,7 +1407,7 @@
#endif
#ifndef DK4_HAVE__ISATTY
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__ISATTY 1
#else
#define DK4_HAVE__ISATTY 0
@@ -1260,7 +1431,7 @@
#endif
#ifndef DK4_HAVE__SNPRINTF_S
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__SNPRINTF_S 1
#else
#define DK4_HAVE__SNPRINTF_S 0
@@ -1268,7 +1439,7 @@
#endif
#ifndef DK4_HAVE__SNPRINTF
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__SNPRINTF 1
#else
#define DK4_HAVE__SNPRINTF 0
@@ -1276,7 +1447,7 @@
#endif
#ifndef DK4_HAVE_SNPRINTF
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SNPRINTF 0
#else
#define DK4_HAVE_SNPRINTF 1
@@ -1284,7 +1455,7 @@
#endif
#ifndef DK4_HAVE__SNWPRINTF_S
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__SNWPRINTF_S 1
#else
#define DK4_HAVE__SNWPRINTF_S 0
@@ -1292,7 +1463,7 @@
#endif
#ifndef DK4_HAVE__SNWPRINTF
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__SNWPRINTF 1
#else
#define DK4_HAVE__SNWPRINTF 0
@@ -1300,7 +1471,7 @@
#endif
#ifndef DK4_HAVE_SNWPRINTF
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SNWPRINTF 0
#else
#define DK4_HAVE_SNWPRINTF 1
@@ -1308,7 +1479,7 @@
#endif
#ifndef DK4_HAVE_SWPRINTF
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SWPRINTF 1
#else
#define DK4_HAVE_SWPRINTF 1
@@ -1316,7 +1487,7 @@
#endif
#ifndef DK4_HAVE_UNLINK
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_UNLINK 0
#else
#define DK4_HAVE_UNLINK 1
@@ -1324,7 +1495,7 @@
#endif
#ifndef DK4_HAVE__UNLINK
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__UNLINK 1
#else
#define DK4_HAVE__UNLINK 0
@@ -1332,7 +1503,7 @@
#endif
#ifndef DK4_HAVE_WUNLINK
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WUNLINK 0
#else
#define DK4_HAVE_WUNLINK 1
@@ -1340,7 +1511,7 @@
#endif
#ifndef DK4_HAVE__WUNLINK
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WUNLINK 1
#else
#define DK4_HAVE__WUNLINK 0
@@ -1348,7 +1519,7 @@
#endif
#ifndef DK4_HAVE_MKDIR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_MKDIR 0
#else
#define DK4_HAVE_MKDIR 1
@@ -1356,7 +1527,7 @@
#endif
#ifndef DK4_HAVE__MKDIR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__MKDIR 1
#else
#define DK4_HAVE__MKDIR 0
@@ -1364,7 +1535,7 @@
#endif
#ifndef DK4_HAVE_WMKDIR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WMKDIR 0
#else
#define DK4_HAVE_WMKDIR 1
@@ -1372,7 +1543,7 @@
#endif
#ifndef DK4_HAVE__WMKDIR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WMKDIR 1
#else
#define DK4_HAVE__WMKDIR 0
@@ -1380,7 +1551,7 @@
#endif
#ifndef DK4_HAVE_SIGACTION
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SIGACTION 0
#else
#define DK4_HAVE_SIGACTION 1
@@ -1388,7 +1559,7 @@
#endif
#ifndef DK4_HAVE_SIGSET
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SIGSET 0
#else
#define DK4_HAVE_SIGSET 1
@@ -1396,7 +1567,7 @@
#endif
#ifndef DK4_HAVE_SIGNAL
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SIGNAL 1
#else
#define DK4_HAVE_SIGNAL 1
@@ -1404,7 +1575,7 @@
#endif
#ifndef DK4_HAVE_SIGPROCMASK
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SIGPROCMASK 0
#else
#define DK4_HAVE_SIGPROCMASK 1
@@ -1412,7 +1583,7 @@
#endif
#ifndef DK4_HAVE_SIGEMPTYSET
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SIGEMPTYSET 0
#else
#define DK4_HAVE_SIGEMPTYSET 1
@@ -1420,7 +1591,7 @@
#endif
#ifndef DK4_HAVE_SETPWENT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETPWENT 0
#else
#define DK4_HAVE_SETPWENT 1
@@ -1428,7 +1599,7 @@
#endif
#ifndef DK4_HAVE_GETPWENT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETPWENT 0
#else
#define DK4_HAVE_GETPWENT 1
@@ -1436,7 +1607,7 @@
#endif
#ifndef DK4_HAVE_ENDPWENT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_ENDPWENT 0
#else
#define DK4_HAVE_ENDPWENT 1
@@ -1444,7 +1615,7 @@
#endif
#ifndef DK4_HAVE_GETPWNAM
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETPWNAM 0
#else
#define DK4_HAVE_GETPWNAM 1
@@ -1452,7 +1623,7 @@
#endif
#ifndef DK4_HAVE_GETPWUID
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETPWUID 0
#else
#define DK4_HAVE_GETPWUID 1
@@ -1460,7 +1631,7 @@
#endif
#ifndef DK4_HAVE_SETGRENT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETGRENT 0
#else
#define DK4_HAVE_SETGRENT 1
@@ -1468,7 +1639,7 @@
#endif
#ifndef DK4_HAVE_GETGRENT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETGRENT 0
#else
#define DK4_HAVE_GETGRENT 1
@@ -1476,7 +1647,7 @@
#endif
#ifndef DK4_HAVE_GETGRGID
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETGRGID 0
#else
#define DK4_HAVE_GETGRGID 1
@@ -1484,7 +1655,7 @@
#endif
#ifndef DK4_HAVE_GETGRNAM
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETGRNAM 0
#else
#define DK4_HAVE_GETGRNAM 1
@@ -1492,7 +1663,7 @@
#endif
#ifndef DK4_HAVE_ENDGRENT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_ENDGRENT 0
#else
#define DK4_HAVE_ENDGRENT 1
@@ -1500,7 +1671,7 @@
#endif
#ifndef DK4_HAVE_SETUID
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETUID 0
#else
#define DK4_HAVE_SETUID 1
@@ -1508,7 +1679,7 @@
#endif
#ifndef DK4_HAVE_SETGID
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETGID 0
#else
#define DK4_HAVE_SETGID 1
@@ -1516,7 +1687,7 @@
#endif
#ifndef DK4_HAVE_SETPGRP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETPGRP 0
#else
#define DK4_HAVE_SETPGRP 1
@@ -1524,7 +1695,7 @@
#endif
#ifndef DK4_HAVE_SETSID
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETSID 0
#else
#define DK4_HAVE_SETSID 1
@@ -1532,7 +1703,7 @@
#endif
#ifndef DK4_HAVE_SYS_RESOURCE_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SYS_RESOURCE_H 0
#else
#define DK4_HAVE_SYS_RESOURCE_H 1
@@ -1540,7 +1711,7 @@
#endif
#ifndef DK4_HAVE_GETRLIMIT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GETRLIMIT 0
#else
#define DK4_HAVE_GETRLIMIT 1
@@ -1548,7 +1719,7 @@
#endif
#ifndef DK4_HAVE_SYSLOG
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SYSLOG 0
#else
#define DK4_HAVE_SYSLOG 1
@@ -1556,7 +1727,7 @@
#endif
#ifndef DK4_HAVE_SYSLOG_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SYSLOG_H 0
#else
#define DK4_HAVE_SYSLOG_H 1
@@ -1564,7 +1735,7 @@
#endif
#ifndef DK4_HAVE__READ
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__READ 1
#else
#define DK4_HAVE__READ 0
@@ -1572,7 +1743,7 @@
#endif
#ifndef DK4_HAVE__WRITE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WRITE 1
#else
#define DK4_HAVE__WRITE 0
@@ -1580,7 +1751,7 @@
#endif
#ifndef DK4_HAVE_READ
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_READ 0
#else
#define DK4_HAVE_READ 1
@@ -1588,7 +1759,7 @@
#endif
#ifndef DK4_HAVE_WRITE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WRITE 0
#else
#define DK4_HAVE_WRITE 1
@@ -1596,7 +1767,7 @@
#endif
#ifndef DK4_HAVE_PNG_GET_PIXELS_PER_INCH
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_PNG_GET_PIXELS_PER_INCH 1
#else
#define DK4_HAVE_PNG_GET_PIXELS_PER_INCH 1
@@ -1604,7 +1775,7 @@
#endif
#ifndef DK4_HAVE_PNG_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_PNG_H 1
#else
#define DK4_HAVE_PNG_H 1
@@ -1612,7 +1783,7 @@
#endif
#ifndef DK4_HAVE_JPEGLIB_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_JPEGLIB_H 1
#else
#define DK4_HAVE_JPEGLIB_H 1
@@ -1620,7 +1791,7 @@
#endif
#ifndef DK4_HAVE_TIFF_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_TIFF_H 1
#else
#define DK4_HAVE_TIFF_H 1
@@ -1628,7 +1799,7 @@
#endif
#ifndef DK4_HAVE_SHA224
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SHA224 1
#else
#define DK4_HAVE_SHA224 1
@@ -1636,7 +1807,7 @@
#endif
#ifndef DK4_HAVE_SHA256
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SHA256 1
#else
#define DK4_HAVE_SHA256 1
@@ -1644,7 +1815,7 @@
#endif
#ifndef DK4_HAVE_SHA384
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SHA384 1
#else
#define DK4_HAVE_SHA384 1
@@ -1652,7 +1823,7 @@
#endif
#ifndef DK4_HAVE_SHA512
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SHA512 1
#else
#define DK4_HAVE_SHA512 1
@@ -1660,7 +1831,7 @@
#endif
#ifndef DK4_HAVE_RAND_EGD
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_RAND_EGD 0
#else
#define DK4_HAVE_RAND_EGD 1
@@ -1668,7 +1839,7 @@
#endif
#ifndef DK4_HAVE_RMDIR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_RMDIR 0
#else
#define DK4_HAVE_RMDIR 1
@@ -1676,7 +1847,7 @@
#endif
#ifndef DK4_HAVE__RMDIR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__RMDIR 1
#else
#define DK4_HAVE__RMDIR 0
@@ -1684,7 +1855,7 @@
#endif
#ifndef DK4_HAVE_WRMDIR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_WRMDIR 0
#else
#define DK4_HAVE_WRMDIR 1
@@ -1692,7 +1863,7 @@
#endif
#ifndef DK4_HAVE__WRMDIR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__WRMDIR 1
#else
#define DK4_HAVE__WRMDIR 0
@@ -1700,13 +1871,9 @@
#endif
#ifndef DK4_HAVE_GETFINALPATHNAMEBYHANDLE
-#ifdef _WIN32
-#if _MSC_VER >= 1700
-#if DK4_WINDOWS_LEGACY
-#define DK4_HAVE_GETFINALPATHNAMEBYHANDLE 0
-#else
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0600)
#define DK4_HAVE_GETFINALPATHNAMEBYHANDLE 1
-#endif
#else
#define DK4_HAVE_GETFINALPATHNAMEBYHANDLE 0
#endif
@@ -1716,7 +1883,7 @@
#endif
#ifndef DK4_HAVE_DB_CURSOR_C_GET
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_DB_CURSOR_C_GET 0
#else
#define DK4_HAVE_DB_CURSOR_C_GET 1
@@ -1724,7 +1891,7 @@
#endif
#ifndef DK4_HAVE_CHMOD
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_CHMOD 0
#else
#define DK4_HAVE_CHMOD 1
@@ -1732,39 +1899,63 @@
#endif
#ifndef DK4_HAVE_CHOWN
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_CHOWN 0
#else
#define DK4_HAVE_CHOWN 1
#endif
#endif
+#ifndef DK4_HAVE_SEARCH_H
+#if _WIN32
+#define DK4_HAVE_SEARCH_H 1
+#else
+#define DK4_HAVE_SEARCH_H 0
+#endif
+#endif
+
+#ifndef DK4_HAVE_QSORT
+#if _WIN32
+#define DK4_HAVE_QSORT 1
+#else
+#define DK4_HAVE_QSORT 1
+#endif
+#endif
+
+#ifndef DK4_HAVE_BSEARCH
+#if _WIN32
+#define DK4_HAVE_BSEARCH 1
+#else
+#define DK4_HAVE_BSEARCH 1
+#endif
+#endif
+
#ifndef DK4_HAVE_REPARSE_DATA_BUFFER
-#ifdef _WIN32
-#if _MSC_VER >= 1800
-#define DK4_HAVE_REPARSE_DATA_BUFFER 1
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0603)
+#define DK4_HAVE_REPARSE_DATA_BUFFER 1
#else
-#define DK4_HAVE_REPARSE_DATA_BUFFER 0
+#define DK4_HAVE_REPARSE_DATA_BUFFER 0
#endif
#else
-#define DK4_HAVE_REPARSE_DATA_BUFFER 0
+#define DK4_HAVE_REPARSE_DATA_BUFFER 0
#endif
#endif
#if DK4_HAVE_NTIFS_H
-#ifdef _WIN32
-#if _MSC_VER >= 1800
-#define DK4_HAVE_NTIFS_H 1
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0603)
+#define DK4_HAVE_NTIFS_H 1
#else
-#define DK4_HAVE_NTIFS_H 0
+#define DK4_HAVE_NTIFS_H 0
#endif
#else
-#define DK4_HAVE_NTIFS_H 0
+#define DK4_HAVE_NTIFS_H 1
#endif
#endif
#ifndef DK4_HAVE_DEV_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_DEV_T 0
#else
#define DK4_HAVE_DEV_T 1
@@ -1772,7 +1963,7 @@
#endif
#ifndef DK4_HAVE__DEV_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__DEV_T 1
#else
#define DK4_HAVE__DEV_T 0
@@ -1780,7 +1971,7 @@
#endif
#ifndef DK4_HAVE_INO_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_INO_T 0
#else
#define DK4_HAVE_INO_T 1
@@ -1788,7 +1979,7 @@
#endif
#ifndef DK4_HAVE__INO_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__INO_T 1
#else
#define DK4_HAVE__INO_T 0
@@ -1796,7 +1987,7 @@
#endif
#ifndef DK4_HAVE_INO64_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_INO64_T 0
#else
#define DK4_HAVE_INO64_T 1
@@ -1808,7 +1999,7 @@
#endif
#ifndef DK4_HAVE_MODE_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_MODE_T 0
#else
#define DK4_HAVE_MODE_T 1
@@ -1816,7 +2007,7 @@
#endif
#ifndef DK4_HAVE_NLINK_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_NLINK_T 0
#else
#define DK4_HAVE_NLINK_T 1
@@ -1824,7 +2015,7 @@
#endif
#ifndef DK4_HAVE_UID_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_UID_T 0
#else
#define DK4_HAVE_UID_T 1
@@ -1832,7 +2023,7 @@
#endif
#ifndef DK4_HAVE_GID_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GID_T 0
#else
#define DK4_HAVE_GID_T 1
@@ -1840,7 +2031,7 @@
#endif
#ifndef DK4_HAVE_GRP_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_GRP_H 0
#else
#define DK4_HAVE_GRP_H 1
@@ -1848,7 +2039,7 @@
#endif
#ifndef DK4_HAVE_OFF_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_OFF_T 0
#else
#define DK4_HAVE_OFF_T 1
@@ -1856,7 +2047,7 @@
#endif
#ifndef DK4_HAVE__OFF_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__OFF_T 1
#else
#define DK4_HAVE__OFF_T 0
@@ -1864,7 +2055,7 @@
#endif
#ifndef DK4_HAVE_OFF64_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_OFF64_T 0
#else
#define DK4_HAVE_OFF64_T 1
@@ -1876,7 +2067,7 @@
#endif
#ifndef DK4_HAVE_BLKSIZE_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_BLKSIZE_T 0
#else
#define DK4_HAVE_BLKSIZE_T 1
@@ -1884,7 +2075,7 @@
#endif
#ifndef DK4_HAVE_BLKCNT_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_BLKCNT_T 0
#else
#define DK4_HAVE_BLKCNT_T 1
@@ -1892,7 +2083,7 @@
#endif
#ifndef DK4_HAVE_FPOS_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FPOS_T 1
#else
#define DK4_HAVE_FPOS_T 1
@@ -1900,7 +2091,7 @@
#endif
#ifndef DK4_HAVE__FPOS_T
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE__FPOS_T 0
#else
#define DK4_HAVE__FPOS_T 0
@@ -1908,8 +2099,8 @@
#endif
#ifndef DK4_HAVE_SOCKLEN_T
-#ifdef _WIN32
-#if _MSC_VER >= 1700
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0600)
#define DK4_HAVE_SOCKLEN_T 1
#else
#define DK4_HAVE_SOCKLEN_T 0
@@ -1920,7 +2111,7 @@
#endif
#ifndef DK4_HAVE_STRUCT_SOCKADDR_IN
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STRUCT_SOCKADDR_IN 1
#else
#define DK4_HAVE_STRUCT_SOCKADDR_IN 1
@@ -1928,11 +2119,11 @@
#endif
#ifndef DK4_HAVE_STRUCT_SOCKADDR_IN6
-#ifdef _WIN32
-#if DK4_WINDOWS_LEGACY
-#define DK4_HAVE_STRUCT_SOCKADDR_IN6 0
-#else
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0602)
#define DK4_HAVE_STRUCT_SOCKADDR_IN6 1
+#else
+#define DK4_HAVE_STRUCT_SOCKADDR_IN6 0
#endif
#else
#define DK4_HAVE_STRUCT_SOCKADDR_IN6 1
@@ -1940,7 +2131,7 @@
#endif
#ifndef DK4_HAVE_STRUCT_SOCKADDR_UN
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STRUCT_SOCKADDR_UN 0
#else
#define DK4_HAVE_STRUCT_SOCKADDR_UN 1
@@ -1948,7 +2139,7 @@
#endif
#ifndef DK4_HAVE_STRUCT_ADDRINFO
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STRUCT_ADDRINFO 0
#else
#define DK4_HAVE_STRUCT_ADDRINFO 1
@@ -1956,15 +2147,19 @@
#endif
#ifndef DK4_HAVE_STRUCT_SOCKADDR_STORAGE
-#ifdef _WIN32
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0600)
+#define DK4_HAVE_STRUCT_SOCKADDR_STORAGE 1
+#else
#define DK4_HAVE_STRUCT_SOCKADDR_STORAGE 0
+#endif
#else
#define DK4_HAVE_STRUCT_SOCKADDR_STORAGE 1
#endif
#endif
#ifndef DK4_HAVE_IN_ADDR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_IN_ADDR 1
#else
#define DK4_HAVE_IN_ADDR 0
@@ -1972,15 +2167,19 @@
#endif
#ifndef DK4_HAVE_IN6_ADDR
-#ifdef _WIN32
+#if _WIN32
+#if (defined(_WIN32_WINNT)) && (_WIN32_WINNT >= 0x0602)
#define DK4_HAVE_IN6_ADDR 1
#else
#define DK4_HAVE_IN6_ADDR 0
#endif
+#else
+#define DK4_HAVE_IN6_ADDR 1
+#endif
#endif
#ifndef DK4_HAVE_LARGEFILE64_SOURCE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_LARGEFILE64_SOURCE 0
#else
#define DK4_HAVE_LARGEFILE64_SOURCE 1
@@ -1992,15 +2191,15 @@
#endif
#ifndef DK4_USE_WINDOWS_LOCAL_ALLOC
-#ifdef _WIN32
-#define DK4_USE_WINDOWS_LOCAL_ALLOC 1
+#if _WIN32
+#define DK4_USE_WINDOWS_LOCAL_ALLOC 0
#else
#define DK4_USE_WINDOWS_LOCAL_ALLOC 0
#endif
#endif
#ifndef DK4_HAVE_BACKSLASH_AS_SEP
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_BACKSLASH_AS_SEP 1
#else
#define DK4_HAVE_BACKSLASH_AS_SEP 0
@@ -2008,7 +2207,7 @@
#endif
#ifndef DK4_HAVE_LINE_END_CR_NL
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_LINE_END_CR_NL 1
#else
#define DK4_HAVE_LINE_END_CR_NL 0
@@ -2016,7 +2215,7 @@
#endif
#ifndef DK4_HAVE_CASE_INSENSITIVE_PATHNAMES
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_CASE_INSENSITIVE_PATHNAMES 1
#else
#define DK4_HAVE_CASE_INSENSITIVE_PATHNAMES 0
@@ -2024,7 +2223,7 @@
#endif
#ifndef DK4_HAVE_CASE_INSENSITIVE_USERNAMES
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_CASE_INSENSITIVE_USERNAMES 1
#else
#define DK4_HAVE_CASE_INSENSITIVE_USERNAMES 0
@@ -2032,7 +2231,7 @@
#endif
#ifndef DK4_HAVE_FILE_DEVINO
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FILE_DEVINO 0
#else
#define DK4_HAVE_FILE_DEVINO 1
@@ -2040,7 +2239,7 @@
#endif
#ifndef DK4_HAVE_FILE_UIDGID
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FILE_UIDGID 0
#else
#define DK4_HAVE_FILE_UIDGID 1
@@ -2048,7 +2247,7 @@
#endif
#ifndef DK4_HAVE_FILE_BLKSIZECNT
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FILE_BLKSIZECNT 0
#else
#define DK4_HAVE_FILE_BLKSIZECNT 1
@@ -2056,7 +2255,7 @@
#endif
#ifndef DK4_HAVE_FILE_ATIMECTIME
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FILE_ATIMECTIME 0
#else
#define DK4_HAVE_FILE_ATIMECTIME 1
@@ -2064,7 +2263,7 @@
#endif
#ifndef DK4_HAVE_STRERROR
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STRERROR 1
#else
#define DK4_HAVE_STRERROR 1
@@ -2072,7 +2271,7 @@
#endif
#ifndef DK4_HAVE_STRERROR_R
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_STRERROR_R 1
#else
#define DK4_HAVE_STRERROR_R 1
@@ -2080,7 +2279,7 @@
#endif
#ifndef DK4_HAVE_RAND
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_RAND 1
#else
#define DK4_HAVE_RAND 0
@@ -2088,7 +2287,7 @@
#endif
#ifndef DK4_HAVE_SRAND
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SRAND 0
#else
#define DK4_HAVE_SRAND 1
@@ -2096,7 +2295,7 @@
#endif
#ifndef DK4_HAVE_INITSTATE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_INITSTATE 0
#else
#define DK4_HAVE_INITSTATE 1
@@ -2104,7 +2303,7 @@
#endif
#ifndef DK4_HAVE_SETSTATE
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SETSTATE 0
#else
#define DK4_HAVE_SETSTATE 1
@@ -2112,7 +2311,7 @@
#endif
#ifndef DK4_HAVE_RANDOM
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_RANDOM 0
#else
#define DK4_HAVE_RANDOM 1
@@ -2120,7 +2319,7 @@
#endif
#ifndef DK4_HAVE_LRAND48
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_LRAND48 0
#else
#define DK4_HAVE_LRAND48 1
@@ -2128,7 +2327,7 @@
#endif
#ifndef DK4_HAVE_SOCKET
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_SOCKET 1
#else
#define DK4_HAVE_SOCKET 1
@@ -2136,7 +2335,7 @@
#endif
#ifndef DK4_HAVE_NRAND48
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_NRAND48 0
#else
#define DK4_HAVE_NRAND48 1
@@ -2160,7 +2359,7 @@
#endif
#ifndef DK4_HAVE_DB_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_DB_H 0
#else
#define DK4_HAVE_DB_H 1
@@ -2168,7 +2367,7 @@
#endif
#ifndef DK4_HAVE_NDBM_H
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_NDBM_H 0
#else
#define DK4_HAVE_NDBM_H 0
@@ -2176,7 +2375,7 @@
#endif
#ifndef DK4_HAVE_CRNL
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_CRNL 1
#else
#define DK4_HAVE_CRNL 0
@@ -2184,7 +2383,7 @@
#endif
#ifndef DK4_HAVE_FILEMODE_BINARY
-#ifdef _WIN32
+#if _WIN32
#define DK4_HAVE_FILEMODE_BINARY 1
#else
#define DK4_HAVE_FILEMODE_BINARY 0
diff --git a/support/dktools/win32/user32.iss b/support/dktools/win32/user32.iss
index c22cfe327e..eeb9cc2a12 100644
--- a/support/dktools/win32/user32.iss
+++ b/support/dktools/win32/user32.iss
@@ -7,26 +7,28 @@
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{9746B24E-DEA3-4597-9E07-F27A15070592}
AppName=DK tools and libraries (32 bits)
-AppVerName=DK tools and libraries (32 bits), version 4.8.3
-AppVersion=4.8.3
-VersionInfoProductVersion=4.8.3.0
-VersionInfoVersion=4.8.3.0
+AppVerName=DK tools and libraries (32 bits), version 4.30.2
+AppVersion=4.30.2
+VersionInfoProductVersion=4.30.2.0
+VersionInfoVersion=4.30.2.0
AppPublisher=Dirk Krause
-AppPublisherURL=http://dktools.sourceforge.net/
-AppSupportURL=http://dktools.sourceforge.net/
-AppUpdatesURL=http://dktools.sourceforge.net/
-AppCopyright=Copyright (C) 2013-2014 Dirk Krause
+AppPublisherURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppSupportURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppUpdatesURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppCopyright=Copyright (C) 2013-2020 Dirk Krause
DefaultDirName={pf}\Krause
DirExistsWarning=no
DefaultGroupName=DK tools and libraries
AllowNoIcons=yes
+AllowRootDirectory=no
OutputDir=c:\temp\distri
-OutputBaseFilename=dktools-win32-4.8.3
-Compression=lzma
+OutputBaseFilename=dktools-win32-4.30.2
+Compression=lzma2/max
SolidCompression=yes
SetupIconFile=dkctinst.ico
UninstallDisplayIcon={app}\bin\dk-ls.exe
ChangesEnvironment=yes
+ChangesAssociations=yes
[Languages]
@@ -44,7 +46,8 @@ Source: "C:\krause\bindist\krause32\lib\*"; DestDir: "{app}\lib"; Flags: recurse
; Source: "C:\Krause\bindist\readme.html"; DestDir: "{app}"; Flags: isreadme
[Icons]
-Name: "{group}\{cm:ProgramOnTheWeb,dktools-win32}"; Filename: "http://dktools.sourceforge.net/"
+Name: "{group}\{cm:ProgramOnTheWeb,dktools-win32}"; Filename: "http://sourceforge.net/p/dktools/wiki/Home/"
+Name: "{group}\WxDkDraw"; Filename: "{app}\bin\wxdkdraw.exe"; WorkingDir: "{userappdata}"; Comment: "Draw for LaTeX"
Name: "{group}\WxBmpp"; Filename: "{app}\bin\wxbmpp.exe"; WorkingDir: "{userappdata}"; Comment: "Bitmap to PS or PDF conversion"
Name: "{group}\WxDkClock"; Filename: "{app}\bin\wxdkclock.exe"; WorkingDir: "{userappdata}"; Parameters: "-t"; Comment: "Alert clock"
Name: "{group}\WxDkct"; Filename: "{app}\bin\wxdkct.exe"; WorkingDir: "{userappdata}"; Comment: "C tool (trace/debug, code generators for state machines and wxWidgets-based GUIs)"
@@ -57,3 +60,9 @@ Filename: "{app}\bin\dkwxpath.exe"; Description: "Register directory in PATH."
[UninstallRun]
Filename: "{app}\bin\dkwxpath.exe"; Parameters: "-u"
+[Registry]
+Root: HKCR; Subkey: ".wxd"; ValueData: "WxDkDrawObject"; ValueType: string; ValueName: ""; Flags: uninsdeletevalue
+Root: HKCR; Subkey: "WxDkDrawObject"; ValueData: "WxDkDraw"; ValueType: string; ValueName: ""; Flags: uninsdeletekey
+Root: HKCR; Subkey: "WxDkDrawObject\DefaultIcon"; ValueData: "{app}\bin\wxdkdraw.exe,0"; ValueType: string; ValueName: ""
+Root: HKCR; Subkey: "WxDkDrawObject\shell\open\command"; ValueData: """{app}\bin\wxdkdraw.exe"" ""%1"""; ValueType: string; ValueName: ""
+
diff --git a/support/dktools/win32/user64.iss b/support/dktools/win32/user64.iss
index 63b984c778..444d52ad66 100644
--- a/support/dktools/win32/user64.iss
+++ b/support/dktools/win32/user64.iss
@@ -7,27 +7,29 @@
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{E8178AB5-99E3-4C64-A242-289A0601F67B}
AppName=DK tools and libraries (64 bits)
-AppVerName=DK tools and libraries (64 bits), version 4.8.3
-AppVersion=4.8.3
-VersionInfoProductVersion=4.8.3.0
-VersionInfoVersion=4.8.3.0
+AppVerName=DK tools and libraries (64 bits), version 4.30.2
+AppVersion=4.30.2
+VersionInfoProductVersion=4.30.2.0
+VersionInfoVersion=4.30.2.0
AppPublisher=Dirk Krause
-AppPublisherURL=http://dktools.sourceforge.net/
-AppSupportURL=http://dktools.sourceforge.net/
-AppUpdatesURL=http://dktools.sourceforge.net/
-AppCopyright=Copyright (C) 2013-2014 Dirk Krause
+AppPublisherURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppSupportURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppUpdatesURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppCopyright=Copyright (C) 2013-2020 Dirk Krause
DefaultDirName={pf}\Krause
DirExistsWarning=no
DefaultGroupName=DK tools and libraries
AllowNoIcons=yes
+AllowRootDirectory=no
OutputDir=c:\temp\distri
-OutputBaseFilename=dktools-win64-4.8.3
-Compression=lzma
+OutputBaseFilename=dktools-win64-4.30.2
+Compression=lzma2/max
SolidCompression=yes
ArchitecturesInstallIn64BitMode=x64
SetupIconFile=dkctinst.ico
UninstallDisplayIcon={app}\bin\dk-ls.exe
ChangesEnvironment=yes
+ChangesAssociations=yes
[Languages]
@@ -45,7 +47,8 @@ Source: "C:\krause\bindist\krause64\lib\*"; DestDir: "{app}\lib"; Flags: recurse
; Source: "C:\Krause\bindist\readme.html"; DestDir: "{app}"; Flags: isreadme
[Icons]
-Name: "{group}\{cm:ProgramOnTheWeb,dktools-win32}"; Filename: "http://dktools.sourceforge.net/"
+Name: "{group}\{cm:ProgramOnTheWeb,dktools-win32}"; Filename: "http://sourceforge.net/p/dktools/wiki/Home/"
+Name: "{group}\WxDkDraw"; Filename: "{app}\bin\wxdkdraw.exe"; WorkingDir: "{userappdata}"; Comment: "Draw for LaTeX"
Name: "{group}\WxBmpp"; Filename: "{app}\bin\wxbmpp.exe"; WorkingDir: "{userappdata}"; Comment: "Bitmap to PS or PDF conversion"
Name: "{group}\WxDkClock"; Filename: "{app}\bin\wxdkclock.exe"; WorkingDir: "{userappdata}"; Parameters: "-t"; Comment: "Alert clock"
Name: "{group}\WxDkct"; Filename: "{app}\bin\wxdkct.exe"; WorkingDir: "{userappdata}"; Comment: "C tool (trace/debug, code generators for state machines and wxWidgets-based GUIs)"
@@ -58,3 +61,9 @@ Filename: "{app}\bin\dkwxpath.exe"; Description: "Register directory in PATH."
[UninstallRun]
Filename: "{app}\bin\dkwxpath.exe"; Parameters: "-u"
+[Registry]
+Root: HKCR; Subkey: ".wxd"; ValueData: "WxDkDrawObject"; ValueType: string; ValueName: ""; Flags: uninsdeletevalue
+Root: HKCR; Subkey: "WxDkDrawObject"; ValueData: "WxDkDraw"; ValueType: string; ValueName: ""; Flags: uninsdeletekey
+Root: HKCR; Subkey: "WxDkDrawObject\DefaultIcon"; ValueData: "{app}\bin\wxdkdraw.exe,0"; ValueType: string; ValueName: ""
+Root: HKCR; Subkey: "WxDkDrawObject\shell\open\command"; ValueData: """{app}\bin\wxdkdraw.exe"" ""%1"""; ValueType: string; ValueName: ""
+
diff --git a/support/dktools/win32/user64.iss.in b/support/dktools/win32/user64.iss.in
index 80feb69e9f..b7229372d8 100644
--- a/support/dktools/win32/user64.iss.in
+++ b/support/dktools/win32/user64.iss.in
@@ -12,22 +12,24 @@ AppVersion=VERSNO
VersionInfoProductVersion=VERSNO.0
VersionInfoVersion=VERSNO.0
AppPublisher=Dirk Krause
-AppPublisherURL=http://dktools.sourceforge.net/
-AppSupportURL=http://dktools.sourceforge.net/
-AppUpdatesURL=http://dktools.sourceforge.net/
-AppCopyright=Copyright (C) 2013-2014 Dirk Krause
+AppPublisherURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppSupportURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppUpdatesURL=http://sourceforge.net/p/dktools/wiki/Home/
+AppCopyright=Copyright (C) 2013-2020 Dirk Krause
DefaultDirName={pf}\Krause
DirExistsWarning=no
DefaultGroupName=DK tools and libraries
AllowNoIcons=yes
+AllowRootDirectory=no
OutputDir=c:\temp\distri
OutputBaseFilename=dktools-win64-VERSNO
-Compression=lzma
+Compression=lzma2/max
SolidCompression=yes
ArchitecturesInstallIn64BitMode=x64
SetupIconFile=dkctinst.ico
UninstallDisplayIcon={app}\bin\dk-ls.exe
ChangesEnvironment=yes
+ChangesAssociations=yes
[Languages]
@@ -45,7 +47,8 @@ Source: "C:\krause\bindist\krause64\lib\*"; DestDir: "{app}\lib"; Flags: recurse
; Source: "C:\Krause\bindist\readme.html"; DestDir: "{app}"; Flags: isreadme
[Icons]
-Name: "{group}\{cm:ProgramOnTheWeb,dktools-win32}"; Filename: "http://dktools.sourceforge.net/"
+Name: "{group}\{cm:ProgramOnTheWeb,dktools-win32}"; Filename: "http://sourceforge.net/p/dktools/wiki/Home/"
+Name: "{group}\WxDkDraw"; Filename: "{app}\bin\wxdkdraw.exe"; WorkingDir: "{userappdata}"; Comment: "Draw for LaTeX"
Name: "{group}\WxBmpp"; Filename: "{app}\bin\wxbmpp.exe"; WorkingDir: "{userappdata}"; Comment: "Bitmap to PS or PDF conversion"
Name: "{group}\WxDkClock"; Filename: "{app}\bin\wxdkclock.exe"; WorkingDir: "{userappdata}"; Parameters: "-t"; Comment: "Alert clock"
Name: "{group}\WxDkct"; Filename: "{app}\bin\wxdkct.exe"; WorkingDir: "{userappdata}"; Comment: "C tool (trace/debug, code generators for state machines and wxWidgets-based GUIs)"
@@ -58,3 +61,9 @@ Filename: "{app}\bin\dkwxpath.exe"; Description: "Register directory in PATH."
[UninstallRun]
Filename: "{app}\bin\dkwxpath.exe"; Parameters: "-u"
+[Registry]
+Root: HKCR; Subkey: ".wxd"; ValueData: "WxDkDrawObject"; ValueType: string; ValueName: ""; Flags: uninsdeletevalue
+Root: HKCR; Subkey: "WxDkDrawObject"; ValueData: "WxDkDraw"; ValueType: string; ValueName: ""; Flags: uninsdeletekey
+Root: HKCR; Subkey: "WxDkDrawObject\DefaultIcon"; ValueData: "{app}\bin\wxdkdraw.exe,0"; ValueType: string; ValueName: ""
+Root: HKCR; Subkey: "WxDkDrawObject\shell\open\command"; ValueData: """{app}\bin\wxdkdraw.exe"" ""%1"""; ValueType: string; ValueName: ""
+
diff --git a/support/dktools/winprint.h b/support/dktools/winprint.h
index 1acf24b031..163548ac1a 100644
--- a/support/dktools/winprint.h
+++ b/support/dktools/winprint.h
@@ -1,10 +1,17 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef H_INCLUDED_winprint
/** Include file only once.
*/
#define H_INCLUDED_winprint 1
+#ifndef DK3_ALL_H_INCLUDED
#include <dk3all.h>
+#endif
+
#include <dk3print.h>
#include <dk3prcfg.h>
#include <dk3prreq.h>
diff --git a/support/dktools/winprint.rc b/support/dktools/winprint.rc
index b2305d6c43..205acc2f4b 100644
--- a/support/dktools/winprint.rc
+++ b/support/dktools/winprint.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Schedule file to Windows print queue\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Schedule file to Windows print queue\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "winprint\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wprclean.c b/support/dktools/wprclean.c
index b2bb5a2f5c..538a18745e 100644
--- a/support/dktools/wprclean.c
+++ b/support/dktools/wprclean.c
@@ -1,36 +1,14 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: wprclean.ctr
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wprclean.ctr
*/
/** @file wprclean.c The wprclean module.
@@ -46,12 +24,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "dkt-version.h"
#endif
#include "dk4vers.h"
+#include "dk4unused.h"
-#line 20 "wprclean.ctr"
+#line 21 "wprclean.ctr"
@@ -114,7 +93,7 @@ dkT("wprclean.txt"),
NULL
-#line 84 "wprclean.ctr"
+#line 85 "wprclean.ctr"
};
@@ -152,7 +131,7 @@ dkT("\" not found!"),
NULL
-#line 114 "wprclean.ctr"
+#line 115 "wprclean.ctr"
};
@@ -232,12 +211,12 @@ dkT("to see the license conditions."),
dkT(""),
dkT("SEE ALSO"),
dkT(""),
-dkT("http://dktools.sourceforge.net"),
+dkT("http://sourceforge.net/p/dktools/wiki/wprclean/"),
dkT(""),
NULL
-#line 197 "wprclean.ctr"
+#line 198 "wprclean.ctr"
};
@@ -277,7 +256,7 @@ dkT(""),
NULL
-#line 235 "wprclean.ctr"
+#line 236 "wprclean.ctr"
};
@@ -325,11 +304,12 @@ wprclean_printjob_new(DWORD pos, DWORD jid, dk3_app_t *app)
*/
static
int
-wprclean_compare_printjobs(void const *l, void const *r, int cr)
+wprclean_compare_printjobs(void const *l, void const *r, int DK4_ARG_UNUSED(cr))
{
wprclean_printjob_t const *pl; /* Left print job. */
wprclean_printjob_t const *pr; /* Right print job. */
int back = 0;
+ DK4_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (wprclean_printjob_t const *)l;
@@ -406,23 +386,23 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
BOOL mustsave; /* Flag: Must mark job for deletion. */
-#line 362 "wprclean.ctr"
+#line 364 "wprclean.ctr"
logname = dk3app_get_logname(job->app);
if(logname) {
-#line 364 "wprclean.ctr"
+#line 366 "wprclean.ctr"
if(dk3sf_get_hostname_app(cn,DK3_MAX_PATH,job->app)) {
-#line 365 "wprclean.ctr"
+#line 367 "wprclean.ctr"
sJobs = dk3sto_open_app(job->app);
if(sJobs) {
-#line 367 "wprclean.ctr"
+#line 369 "wprclean.ctr"
dk3sto_set_comp(sJobs, wprclean_compare_printjobs, 0);
iJobs = dk3sto_it_open(sJobs);
if(iJobs) {
-#line 370 "wprclean.ctr"
+#line 372 "wprclean.ctr"
hPr = INVALID_HANDLE_VALUE;
#if DK3_CHAR_SIZE > 1
bres = OpenPrinterW((dkChar *)(pr->name), &hPr, NULL);
@@ -431,7 +411,7 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
#endif
if(bres) {
-#line 377 "wprclean.ctr"
+#line 379 "wprclean.ctr"
dk3sf_initialize_stdout();
dk3sf_fputs(pr->name, stdout);
dk3sf_fputc(dkT('\n'), stdout);
@@ -455,10 +435,10 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
#endif
if(bres) {
-#line 399 "wprclean.ctr"
+#line 401 "wprclean.ctr"
if(cbReturned > 0) {
-#line 400 "wprclean.ctr"
+#line 402 "wprclean.ctr"
#if DK3_CHAR_SIZE > 1
jobptr = (JOB_INFO_1W *)peb;
#else
@@ -468,20 +448,20 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
mustsave = FALSE;
if(jobptr->pUserName) {
-#line 408 "wprclean.ctr"
+#line 410 "wprclean.ctr"
if(dk3str_casecmp(logname, jobptr->pUserName) == 0) {
-#line 410 "wprclean.ctr"
+#line 412 "wprclean.ctr"
if(job->comp) {
if(jobptr->pMachineName) {
-#line 413 "wprclean.ctr"
+#line 415 "wprclean.ctr"
if(dk3str_casecmp(cn, jobptr->pMachineName) == 0) {
-#line 415 "wprclean.ctr"
+#line 417 "wprclean.ctr"
mustsave = TRUE;
} else {
if(dkT('\\') == (jobptr->pMachineName)[0]) {
@@ -494,7 +474,7 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
}
} else {
-#line 426 "wprclean.ctr"
+#line 428 "wprclean.ctr"
mustsave = TRUE;
}
} else {
@@ -504,22 +484,22 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
}
if(mustsave) {
-#line 434 "wprclean.ctr"
+#line 436 "wprclean.ctr"
pj = wprclean_printjob_new(
jobptr->Position, jobptr->JobId, job->app
);
if(pj) {
-#line 438 "wprclean.ctr"
+#line 440 "wprclean.ctr"
if(!dk3sto_add(sJobs, (void *)pj)) {
wprclean_printjob_delete(pj);
-#line 440 "wprclean.ctr"
+#line 442 "wprclean.ctr"
job->exval = 1;
}
} else {
-#line 443 "wprclean.ctr"
+#line 445 "wprclean.ctr"
job->exval = 1;
}
}
@@ -528,12 +508,12 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
startindex += cbReturned;
} else {
-#line 450 "wprclean.ctr"
+#line 452 "wprclean.ctr"
cc = FALSE;
}
} else {
-#line 453 "wprclean.ctr"
+#line 455 "wprclean.ctr"
cc = FALSE;
}
}
@@ -544,7 +524,7 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
while(NULL != (jptr = (wprclean_printjob_t *)dk3sto_it_next(iJobs))) {
-#line 462 "wprclean.ctr"
+#line 464 "wprclean.ctr"
#if VERSION_BEFORE_20140716
dk3sf_sprintf3(nb1,dkT("%lu"),(unsigned long)(jptr->jobid));
#else
@@ -591,7 +571,7 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
ClosePrinter(hPr);
} else {
-#line 507 "wprclean.ctr"
+#line 509 "wprclean.ctr"
/* ERROR: Failed to open printer! */
dk3app_log_3(job->app, DK3_LL_ERROR, job->msg, 5, 6, pr->name);
job->exval = 1;
@@ -620,7 +600,7 @@ wprclean_windows_printer(WPC_JOB *job, dk3_printer_t *pr)
job->exval = 1;
}
-#line 534 "wprclean.ctr"
+#line 536 "wprclean.ctr"
#endif
}
@@ -764,10 +744,10 @@ DK3_MAIN
int exval = 1; /* Exit status code. */
-#line 676 "wprclean.ctr"
+#line 678 "wprclean.ctr"
-#line 677 "wprclean.ctr"
+#line 679 "wprclean.ctr"
job.app = dk3app_open_command(
argc, (dkChar const * const *)argv, wprclean_nlmsg[0]
);
@@ -789,10 +769,10 @@ DK3_MAIN
}
-#line 697 "wprclean.ctr"
+#line 699 "wprclean.ctr"
-#line 698 "wprclean.ctr"
+#line 700 "wprclean.ctr"
fflush(stdout);
exit(exval); return exval;
}
diff --git a/support/dktools/wprclean.ctr b/support/dktools/wprclean.ctr
index 0468a02ced..2fa9578a8e 100644
--- a/support/dktools/wprclean.ctr
+++ b/support/dktools/wprclean.ctr
@@ -2,7 +2,7 @@
copyright owner = Dirk Krause
copyright year = 2013-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -13,6 +13,7 @@ license = bsd
#include "dkt-version.h"
#endif
#include "dk4vers.h"
+#include "dk4unused.h"
@@ -191,7 +192,7 @@ to see the license conditions.
SEE ALSO
-http://dktools.sourceforge.net
+http://sourceforge.net/p/dktools/wiki/wprclean/
$!end
};
@@ -279,11 +280,12 @@ wprclean_printjob_new(DWORD pos, DWORD jid, dk3_app_t *app)
*/
static
int
-wprclean_compare_printjobs(void const *l, void const *r, int cr)
+wprclean_compare_printjobs(void const *l, void const *r, int DK4_ARG_UNUSED(cr))
{
wprclean_printjob_t const *pl; /* Left print job. */
wprclean_printjob_t const *pr; /* Right print job. */
int back = 0;
+ DK4_UNUSED_ARG(cr)
if(l) {
if(r) {
pl = (wprclean_printjob_t const *)l;
diff --git a/support/dktools/wprclean.h b/support/dktools/wprclean.h
index cac78a770c..4b72a51ebd 100644
--- a/support/dktools/wprclean.h
+++ b/support/dktools/wprclean.h
@@ -1,4 +1,9 @@
/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
WARNING: This file was generated by dkct.
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
diff --git a/support/dktools/wprclean.rc b/support/dktools/wprclean.rc
index 9353944cd8..a2f05da5bd 100644
--- a/support/dktools/wprclean.rc
+++ b/support/dktools/wprclean.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Clean Windows print queue\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Clean Windows print queue\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "wprclean\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wprclean2.c b/support/dktools/wprclean2.c
index 477d24bff0..057f699566 100644
--- a/support/dktools/wprclean2.c
+++ b/support/dktools/wprclean2.c
@@ -1,12 +1,18 @@
/*
- WARNING: This file was generated by dkct.
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: wprclean2.ctr
*/
-#line 5 "wprclean2.ctr"
+#line 7 "wprclean2.ctr"
/** @file wprclean.c Cleanup Windows print queues.
*/
@@ -83,11 +89,14 @@
#include "dk4hnamed.h"
#include "dk4user.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
-#line 84 "wprclean2.ctr"
+#line 89 "wprclean2.ctr"
@@ -115,7 +124,7 @@ dkT("wprclean.str"),
NULL
-#line 113 "wprclean2.ctr"
+#line 118 "wprclean2.ctr"
};
@@ -165,7 +174,7 @@ dkT("\"!"),
NULL
-#line 159 "wprclean2.ctr"
+#line 164 "wprclean2.ctr"
};
@@ -210,7 +219,7 @@ dkT("\t--license\tShow license information."),
NULL
-#line 178 "wprclean2.ctr"
+#line 183 "wprclean2.ctr"
};
@@ -224,7 +233,8 @@ dkT("This software uses code from the following projects, either directly or as"
dkT("a library:"),
dkT(""),
dkT("dktools\t\tDirk Krause's tools and libraries."),
-dkT("\t\tSee http://dktools.sourceforge.net/ for more information."),
+dkT("\t\tSee http://sourceforge.net/p/dktools/wiki/Home/"),
+dkT("\t\tfor more information."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT("zlib\t\tData compression library."),
@@ -251,27 +261,28 @@ dkT(""),
dkT("Redistribution and use in source and binary forms, with or without"),
dkT("modification, are permitted provided that the following conditions are met:"),
dkT(""),
-dkT("* Redistributions of source code must retain the above copyright notice,"),
-dkT(" this list of conditions and the following disclaimer."),
-dkT("* Redistributions in binary form must reproduce the above copyright"),
-dkT(" notice, this list of conditions and the following disclaimer in the"),
-dkT(" documentation and/or other materials provided with the distribution."),
-dkT("* Neither the name of the Dirk Krause nor the names of contributors may be"),
-dkT(" used to endorse or promote products derived from this software without"),
-dkT(" specific prior written permission."),
+dkT("1. Redistributions of source code must retain the above copyright notice,"),
+dkT(" this list of conditions and the following disclaimer."),
+dkT("2. Redistributions in binary form must reproduce the above copyright"),
+dkT(" notice, this list of conditions and the following disclaimer in the"),
+dkT(" documentation and/or other materials provided with the distribution."),
+dkT("3. Neither the name of the copyright holder nor the names of its"),
+dkT(" contributors may be used to endorse or promote products derived from"),
+dkT(" this software without specific prior written permission."),
dkT(""),
-dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""),
-dkT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"),
-dkT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE"),
-dkT("ARE DISCLAIMED."),
+dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
+dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
+dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
+dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
+dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
+dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
+dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
+dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
+dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
+dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
+dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
+dkT("SUCH DAMAGE."),
dkT(""),
-dkT("IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,"),
-dkT("INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,"),
-dkT("BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,"),
-dkT("DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY"),
-dkT("OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING"),
-dkT("NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,"),
-dkT("EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."),
#if DK4_HAVE_ZLIB_H
dkT(""),
dkT(""),
@@ -345,7 +356,7 @@ dkT(""),
NULL
-#line 311 "wprclean2.ctr"
+#line 318 "wprclean2.ctr"
};
@@ -472,56 +483,56 @@ check_options(void)
dkChar *ptr;
-#line 436 "wprclean2.ctr"
+#line 443 "wprclean2.ctr"
host_long[0] = dkT('\0');
host_short[0] = dkT('\0');
user_name[0] = dkT('\0');
if (0 != dk4app_opt_is_set_short(app, dkT('v'), NULL)) {
verbose = 1;
-#line 441 "wprclean2.ctr"
+#line 448 "wprclean2.ctr"
}
if (0 != dk4app_opt_is_set_short(app, dkT('c'), NULL)) {
-#line 443 "wprclean2.ctr"
+#line 450 "wprclean2.ctr"
if (0 != dk4hostname(host_long, DK4_SIZEOF(host_long,dkChar), NULL)) {
only_this_host = 1;
-#line 445 "wprclean2.ctr"
+#line 452 "wprclean2.ctr"
if (0 != dk4str_cpy_s(host_short, sz_host_short, host_long, NULL)) {
ptr = dk4str_chr(host_short, dkT('.'));
-#line 447 "wprclean2.ctr"
+#line 454 "wprclean2.ctr"
if (NULL != ptr) {
-#line 448 "wprclean2.ctr"
+#line 455 "wprclean2.ctr"
*ptr = dkT('\0');
have_short_host = 1;
}
#if TRACE_DEBUG
else {
-#line 453 "wprclean2.ctr"
+#line 460 "wprclean2.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 458 "wprclean2.ctr"
+#line 465 "wprclean2.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 463 "wprclean2.ctr"
+#line 470 "wprclean2.ctr"
}
#endif
}
-#line 467 "wprclean2.ctr"
+#line 474 "wprclean2.ctr"
}
@@ -601,34 +612,34 @@ setup_for_queue_list(void)
int back = 0;
-#line 545 "wprclean2.ctr"
+#line 552 "wprclean2.ctr"
s_q = dk4sto_open(NULL);
if (NULL != s_q) {
-#line 547 "wprclean2.ctr"
+#line 554 "wprclean2.ctr"
dk4sto_set_comp(s_q, compare_queues, 0);
i_q = dk4sto_it_open(s_q, NULL);
if (NULL != i_q) {
-#line 550 "wprclean2.ctr"
+#line 557 "wprclean2.ctr"
back = 1;
}
#if TRACE_DEBUG
else {
-#line 554 "wprclean2.ctr"
+#line 561 "wprclean2.ctr"
}
#endif
}
#if TRACE_DEBUG
else {
-#line 559 "wprclean2.ctr"
+#line 566 "wprclean2.ctr"
}
#endif
-#line 562 "wprclean2.ctr"
+#line 569 "wprclean2.ctr"
return back;
}
@@ -643,12 +654,12 @@ cleanup_for_queue_list(void)
dkChar *p;
-#line 575 "wprclean2.ctr"
+#line 582 "wprclean2.ctr"
/* Release all queue names saved, close iterator.
*/
if (NULL != i_q) {
-#line 578 "wprclean2.ctr"
+#line 585 "wprclean2.ctr"
dk4sto_it_reset(i_q);
do {
p = (dkChar *)dk4sto_it_next(i_q);
@@ -657,19 +668,19 @@ cleanup_for_queue_list(void)
}
} while (NULL != p);
-#line 585 "wprclean2.ctr"
+#line 592 "wprclean2.ctr"
dk4sto_it_close(i_q); i_q = NULL;
}
/* Close storage.
*/
if (NULL != s_q) {
-#line 590 "wprclean2.ctr"
+#line 597 "wprclean2.ctr"
dk4sto_close(s_q); s_q = NULL;
}
-#line 593 "wprclean2.ctr"
+#line 600 "wprclean2.ctr"
}
@@ -697,7 +708,7 @@ retrieve_queue_list(void)
int back = 0;
-#line 619 "wprclean2.ctr"
+#line 626 "wprclean2.ctr"
cbNeeded = cbReturned = szPeb = (DWORD)0UL;
#if DK4_CHAR_SIZE > 1
EnumPrintersW(PRINTER_ENUM_LOCAL,NULL,2,NULL,szPeb,&cbNeeded,&cbReturned);
@@ -729,7 +740,7 @@ retrieve_queue_list(void)
if (0 == dk4sto_add(s_q, pn, NULL)) {
dk4mem_free(pn);
-#line 649 "wprclean2.ctr"
+#line 656 "wprclean2.ctr"
back = 0;
exval = EXIT_FAILURE;
/* ERROR: Memory */
@@ -737,7 +748,7 @@ retrieve_queue_list(void)
}
} else {
-#line 655 "wprclean2.ctr"
+#line 662 "wprclean2.ctr"
back = 0;
exval = EXIT_FAILURE;
/* ERROR: Memory */
@@ -745,7 +756,7 @@ retrieve_queue_list(void)
}
} else {
-#line 661 "wprclean2.ctr"
+#line 668 "wprclean2.ctr"
back = 0;
exval = EXIT_FAILURE;
/* ERROR: Invalid printer configuration */
@@ -755,11 +766,11 @@ retrieve_queue_list(void)
}
} else {
-#line 669 "wprclean2.ctr"
+#line 676 "wprclean2.ctr"
}
} else {
-#line 671 "wprclean2.ctr"
+#line 678 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Printer enumeration failed */
dk4app_log_1(app, msg, sz_msg, DK4_LL_ERROR, 2);
@@ -767,16 +778,16 @@ retrieve_queue_list(void)
dk4mem_release(peb);
} else {
-#line 677 "wprclean2.ctr"
+#line 684 "wprclean2.ctr"
exval = EXIT_FAILURE;
}
} else {
-#line 680 "wprclean2.ctr"
+#line 687 "wprclean2.ctr"
}
-#line 682 "wprclean2.ctr"
+#line 689 "wprclean2.ctr"
return back;
#else
return 1;
@@ -821,13 +832,13 @@ handle_one_queue(const dkChar *pn)
BOOL br5 = FALSE; /* SetJob res */
-#line 725 "wprclean2.ctr"
+#line 732 "wprclean2.ctr"
/* Prepare data structures.
*/
s_j = dk4sto_open(NULL);
if (NULL == s_j) {
-#line 729 "wprclean2.ctr"
+#line 736 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Memory */
dk4app_log_base1(app, DK4_LL_ERROR, 90);
@@ -837,7 +848,7 @@ handle_one_queue(const dkChar *pn)
i_j = dk4sto_it_open(s_j, NULL);
if (NULL == i_j) {
-#line 737 "wprclean2.ctr"
+#line 744 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Memory */
dk4app_log_base1(app, DK4_LL_ERROR, 90);
@@ -852,7 +863,7 @@ handle_one_queue(const dkChar *pn)
#endif
if (!(bres)) {
-#line 750 "wprclean2.ctr"
+#line 757 "wprclean2.ctr"
h_pr = INVALID_HANDLE_VALUE;
exval = EXIT_FAILURE;
/* ERROR: Failed to open printer */
@@ -868,13 +879,13 @@ handle_one_queue(const dkChar *pn)
#endif
if ((DWORD)0UL == sz1) {
-#line 764 "wprclean2.ctr"
+#line 771 "wprclean2.ctr"
-#line 765 "wprclean2.ctr"
+#line 772 "wprclean2.ctr"
-#line 766 "wprclean2.ctr"
+#line 773 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Failed to request print queue */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 5, 6, pn);
@@ -882,7 +893,7 @@ handle_one_queue(const dkChar *pn)
}
if ((DWORD)0UL == sz1) {
-#line 772 "wprclean2.ctr"
+#line 779 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Failed to request print queue */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 5, 6, pn);
@@ -891,7 +902,7 @@ handle_one_queue(const dkChar *pn)
pc1 = dk4mem_new_app(char,(size_t)sz1,app);
if (NULL == pc1) {
-#line 779 "wprclean2.ctr"
+#line 786 "wprclean2.ctr"
exval = EXIT_FAILURE;
goto finished;
}
@@ -902,7 +913,7 @@ handle_one_queue(const dkChar *pn)
#endif
if (!(br2)) {
-#line 788 "wprclean2.ctr"
+#line 795 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: GetPrinter failed */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 9, 10, pn);
@@ -910,7 +921,7 @@ handle_one_queue(const dkChar *pn)
}
if (sz2 > sz1) {
-#line 794 "wprclean2.ctr"
+#line 801 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Number of bytes increased. */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 9, 10, pn);
@@ -920,7 +931,7 @@ handle_one_queue(const dkChar *pn)
nJobs = pi2->cJobs;
if ((DWORD)0UL == nJobs) {
-#line 802 "wprclean2.ctr"
+#line 809 "wprclean2.ctr"
goto finished;
}
/* Retrieve job data and build sorted storage
@@ -936,7 +947,7 @@ handle_one_queue(const dkChar *pn)
#endif
if ((!(br3)) || ((DWORD)0UL == sz3)) {
-#line 816 "wprclean2.ctr"
+#line 823 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Failed to find required byte number */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 7, 8, pn);
@@ -945,7 +956,7 @@ handle_one_queue(const dkChar *pn)
pc2 = dk4mem_new_app(char,(size_t)sz3,app);
if (NULL == pc2) {
-#line 823 "wprclean2.ctr"
+#line 830 "wprclean2.ctr"
exval = EXIT_FAILURE;
goto finished;
}
@@ -961,7 +972,7 @@ handle_one_queue(const dkChar *pn)
#endif
if (!(br4)) {
-#line 837 "wprclean2.ctr"
+#line 844 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: EnumJobs */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 7, 8, pn);
@@ -969,7 +980,7 @@ handle_one_queue(const dkChar *pn)
}
if (sz4 > sz3) {
-#line 843 "wprclean2.ctr"
+#line 850 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Number of bytes changed */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 7, 8, pn);
@@ -985,19 +996,19 @@ handle_one_queue(const dkChar *pn)
um = 1;
if (0 != only_this_host) {
-#line 857 "wprclean2.ctr"
+#line 864 "wprclean2.ctr"
if (NULL != ji1->pMachineName) {
-#line 858 "wprclean2.ctr"
+#line 865 "wprclean2.ctr"
if (0 != dk4str_casecmp(host_long, ji1->pMachineName)) {
mm = 0;
if (0 != have_short_host) {
-#line 861 "wprclean2.ctr"
+#line 868 "wprclean2.ctr"
if (0 == dk4str_casecmp(host_short, ji1->pMachineName)) {
mm = 1;
-#line 863 "wprclean2.ctr"
+#line 870 "wprclean2.ctr"
}
}
}
@@ -1010,22 +1021,22 @@ handle_one_queue(const dkChar *pn)
}
else {
-#line 874 "wprclean2.ctr"
+#line 881 "wprclean2.ctr"
um = 0;
}
if ((0 != mm) && (0 != um)) {
-#line 877 "wprclean2.ctr"
+#line 884 "wprclean2.ctr"
pj = dk4mem_new_app(wprclean_printjob_t,1,app);
if (NULL != pj) {
pj->position = i;
pj->jobid = ji1->JobId;
-#line 882 "wprclean2.ctr"
+#line 889 "wprclean2.ctr"
if (0 == dk4sto_add(s_j, pj, NULL)) {
-#line 883 "wprclean2.ctr"
+#line 890 "wprclean2.ctr"
dk4mem_free(pj);
exval = EXIT_FAILURE;
/* ERROR: Memory */
@@ -1033,7 +1044,7 @@ handle_one_queue(const dkChar *pn)
}
} else {
-#line 889 "wprclean2.ctr"
+#line 896 "wprclean2.ctr"
exval = EXIT_FAILURE;
}
}
@@ -1046,7 +1057,7 @@ handle_one_queue(const dkChar *pn)
pj = (wprclean_printjob_t *)dk4sto_it_next(i_j);
if (NULL != pj) {
-#line 900 "wprclean2.ctr"
+#line 907 "wprclean2.ctr"
#if DK4_CHAR_SIZE > 1
br5 = SetJobW(h_pr, pj->jobid, 0, NULL, JOB_CONTROL_DELETE);
#else
@@ -1054,14 +1065,14 @@ handle_one_queue(const dkChar *pn)
#endif
if (!(br5)) {
-#line 906 "wprclean2.ctr"
+#line 913 "wprclean2.ctr"
exval = EXIT_FAILURE;
/* ERROR: Failed to remove job */
dk4app_log_3(app, msg, sz_msg, DK4_LL_ERROR, 11, 12, pn);
}
else {
-#line 911 "wprclean2.ctr"
+#line 918 "wprclean2.ctr"
}
}
} while(NULL != pj);
@@ -1093,7 +1104,7 @@ handle_one_queue(const dkChar *pn)
}
-#line 941 "wprclean2.ctr"
+#line 948 "wprclean2.ctr"
}
@@ -1142,10 +1153,10 @@ int main(int argc, char *argv[])
{
-#line 988 "wprclean2.ctr"
+#line 995 "wprclean2.ctr"
-#line 989 "wprclean2.ctr"
+#line 996 "wprclean2.ctr"
app = dk4app_open_cmd(
argc, argv, wprclean_options, wprclean_sz_options,
wprclean_kwnl[0], DKT_VERSION_DK,
@@ -1169,10 +1180,10 @@ int main(int argc, char *argv[])
}
-#line 1011 "wprclean2.ctr"
+#line 1018 "wprclean2.ctr"
-#line 1012 "wprclean2.ctr"
+#line 1019 "wprclean2.ctr"
exit(exval); return exval;
}
diff --git a/support/dktools/wprclean2.ctr b/support/dktools/wprclean2.ctr
index 7783544e42..23e73f54c1 100644
--- a/support/dktools/wprclean2.ctr
+++ b/support/dktools/wprclean2.ctr
@@ -1,5 +1,7 @@
%% options
-
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
%% module
@@ -78,6 +80,9 @@
#include "dk4hnamed.h"
#include "dk4user.h"
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
$!trace-include
@@ -189,7 +194,8 @@ This software uses code from the following projects, either directly or as
a library:
dktools Dirk Krause's tools and libraries.
- See http://dktools.sourceforge.net/ for more information.
+ See http://sourceforge.net/p/dktools/wiki/Home/
+ for more information.
#if DK4_HAVE_ZLIB_H
zlib Data compression library.
@@ -216,27 +222,28 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the Dirk Krause nor the names of contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
#if DK4_HAVE_ZLIB_H
diff --git a/support/dktools/wxbmeps.h b/support/dktools/wxbmeps.h
index 20bfed877b..d2312a5622 100644
--- a/support/dktools/wxbmeps.h
+++ b/support/dktools/wxbmeps.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef WXBMEPS_H_INCLUDED
#define WXBMEPS_H_INCLUDED 1
@@ -9,7 +13,10 @@
*/
#define DK3_USE_WX 1
+#ifndef DK3_ALL_H_INCLUDED
#include <dk3all.h>
+#endif
+
#if 0
#include "dkt-version.h"
#endif
diff --git a/support/dktools/wxbmpp.desktop b/support/dktools/wxbmpp.desktop
index 4ca335e122..e1875dbdb2 100644
--- a/support/dktools/wxbmpp.desktop
+++ b/support/dktools/wxbmpp.desktop
@@ -1,6 +1,4 @@
-
[Desktop Entry]
-Encoding=UTF-8
Categories=Application;Graphics;
Name=wxbmpp
Comment=Converter from PNG/JPEG/TIFF to PDF/EPS
diff --git a/support/dktools/wxbmpp.h b/support/dktools/wxbmpp.h
new file mode 100644
index 0000000000..d5de9a2073
--- /dev/null
+++ b/support/dktools/wxbmpp.h
@@ -0,0 +1,241 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef H_INCLUDED_wxbmpp
+/** Include file only once.
+*/
+#define H_INCLUDED_wxbmpp 1
+
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#if DK4_ON_WINDOWS
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+#endif
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#include <dk4strx.h>
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include <dk4mem.h>
+#endif
+
+#ifndef DK4GRCO_H_INCLUDED
+#include <dk4grco.h>
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include <dk4app.h>
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include <dk4bif.h>
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include <dk4gra.h>
+#endif
+
+#ifndef DK4VERS_H_INCLUDED
+#include <dk4verswx.h>
+#endif
+
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef WX_ARRSTR_H_INCLUDED
+#include <wx/arrstr.h>
+#define WX_ARRSTR_H_INCLUDED 1
+#endif
+
+#ifndef WX_CONFIG_H_INCLUDED
+#include <wx/config.h>
+#define WX_CONFIG_H_INCLUDED 1
+#endif
+
+#ifndef WX_FILENAME_H_INCLUDED
+#include <wx/filename.h>
+#define WX_FILENAME_H_INCLUDED 1
+#endif
+
+#ifndef WX_GBSIZER_H_INCLUDED
+#include <wx/gbsizer.h>
+#define WX_GBSIZER_H_INCLUDED 1
+#endif
+
+#ifndef WX_THREAD_H_INCLUDED
+#include <wx/thread.h>
+#define WX_THREAD_H_INCLUDED 1
+#endif
+
+#ifndef WX_GAUGE_H_INCLUDED
+#include <wx/gauge.h>
+#define WX_GAUGE_H_INCLUDED 1
+#endif
+
+#ifndef WX_HELP_H_INCLUDED
+#include <wx/help.h>
+#define WX_HELP_H_INCLUDED 1
+#endif
+
+#ifndef WX_FS_ZIP_H_INCLUDED
+#include <wx/fs_zip.h>
+#define WX_FS_ZIP_H_INCLUDED 1
+#endif
+
+#ifndef WX_CMDLINE_H_INCLUDED
+#include <wx/cmdline.h>
+#define WX_CMDLINE_H_INCLUDED 1
+#endif
+
+#ifndef WX_DIR_H_INCLUDED
+#include <wx/dir.h>
+#define WX_DIR_H_INCLUDED 1
+#endif
+
+#ifndef WX_STATLINE_H_INCLUDED
+#include <wx/statline.h>
+#endif
+
+
+/* __CHANGE__ 018: Add further wxWidgets header files.
+*/
+
+#ifndef DK4WXPROCESSINGCONTROLLER_H_INCLUDED
+#include <Dk4WxProcessingController.h>
+#endif
+
+#ifndef DK4WXAUTOSTARTCONTROLLER_H_INCLUDED
+#include <Dk4WxAutostartController.h>
+#endif
+
+#ifndef DK4WXAPPLICTIONHELPER_H_INCLUDED
+#include <Dk4WxApplicationHelper.h>
+#endif
+
+#ifndef DK4WXFRAME_H_INCLUDED
+#include <Dk4WxFrame.h>
+#endif
+
+#ifndef DK4WXPROGRESSDIALOG_H_INCLUDED
+#include <Dk4WxProgressDialog.h>
+#endif
+
+#ifndef DK4WXHELPCONTROLLER_H_INCLUDED
+#include <Dk4WxHelpController.h>
+#endif
+
+#ifndef DK4WXCOLOURVIEW_H_INCLUDED
+#include <Dk4WxColourView.h>
+#endif
+
+
+
+#include "Bmpp4App.h"
+
+#include "Bmpp4Progress.h"
+
+#include "Bmpp4Frame.h"
+
+
+
+/* __CHANGE__ 018: Add header files for further classes and modules.
+*/
+
+/** IDs for menu items, buttons and other elements.
+*/
+enum {
+
+ /** Exit the application.
+ */
+ Bmpp4Frame_Quit = wxID_EXIT ,
+
+ /** Main window ID.
+ */
+ Bmpp4Frame_MainWindow = ((wxID_HIGHEST) + 1) ,
+
+ /** Show version dialog box.
+ */
+ Bmpp4Frame_Help_About ,
+
+ /** Open table of conents for online help.
+ */
+ Bmpp4Frame_Help_Contents ,
+
+ /** Output type was modified.
+ */
+ Bmpp4Frame_Output_Type ,
+
+ /** PS level was modified.
+ */
+ Bmpp4Frame_PS_Level ,
+
+ /** Resolution setup was modified.
+ */
+ Bmpp4Frame_Resolution ,
+
+ /** Image interpolation checkbox was modified.
+ */
+ Bmpp4Frame_Change_Interpolation ,
+
+ /** Color output changed.
+ */
+ Bmpp4Frame_Color_Output ,
+
+ /** Choose directory containing images to convert.
+ */
+ Bmpp4Frame_Choose_Directory ,
+
+ /** Run a conversion.
+ */
+ Bmpp4Frame_Run_Conversion ,
+
+ /** Reset options to default values.
+ */
+ Bmpp4Frame_Reset_Options ,
+
+
+};
+
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxbmpp.rc b/support/dktools/wxbmpp.rc
index 5516883654..8f2d027f96 100644
--- a/support/dktools/wxbmpp.rc
+++ b/support/dktools/wxbmpp.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -19,14 +19,14 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "Comments", "Bitmap to PS/PDF converter (GUI)\0"
+ VALUE "Comments", "Bitmap to PDF/(E)PS converter (GUI)\0"
VALUE "CompanyName", "Dirk Krause\0"
- VALUE "FileDescription", "Bitmap to PS/PDF converter (GUI)\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileDescription", "Bitmap to PDF/(E)PS converter (GUI)\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "wxbmpp\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wxcs.cpp b/support/dktools/wxcs.cpp
index c78b058ca6..29bc42a887 100644
--- a/support/dktools/wxcs.cpp
+++ b/support/dktools/wxcs.cpp
@@ -11,19 +11,50 @@
#include <process.h>
#endif
-
-
#if DK4_HAVE_WXWIDGETS
-#include "wx/wxprec.h"
+/* wxWidgets_header_start */
+#if DK4_HAVE_WXWIDGETS
+#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
-#include "wx/wx.h"
+#if DK4_HAVE_WX_CHARTYPE_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED 1
+#endif
+#endif
+#ifndef WX_CHARTYPE_H_INCLUDED
+#include <wx/chartype.h>
+#define WX_CHARTYPE_H_INCLUDED 1
+#endif
+#else
+#if DK4_HAVE_WX_WXCHAR_H
+#if DK4_HAVE_WX_DEFS_H
+#ifndef WX_DEFS_H_INCLUDED
+#include <wx/defs.h>
+#define WX_DEFS_H_INCLUDED 1
+#endif
+#endif
+#ifndef WX_WXCHAR_H_INCLUDED
+#include <wx/wxchar.h>
+#define WX_WXCHAR_H_INCLUDED 1
+#endif
+#else
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+#endif
+#endif
#endif
+/* wxWidgets_header_end*/
-int main(int argc, char *argv[])
+int main(void)
{
printf("/**\t@file\tdk4wxcs.h\tConfigure size of wide characters.\n*/\n\n");
printf("#ifndef DK4WXCSZ_H_INCLUDED\n");
@@ -37,7 +68,7 @@ int main(int argc, char *argv[])
#else
-int main(int argc, char *argv[])
+int main(void)
{
printf("/**\t@file\tdk4wxcs.h\tConfigure size of wide characters.\n*/\n\n");
printf("#ifndef DK4WXCSZ_H_INCLUDED\n");
diff --git a/support/dktools/wxd-bgroup2.wxd b/support/dktools/wxd-bgroup2.wxd
new file mode 100644
index 0000000000..d4f7e97970
--- /dev/null
+++ b/support/dktools/wxd-bgroup2.wxd
@@ -0,0 +1,18 @@
+WXD 1 0
+0 0 0 16256000 0 16256000
+11 0 0 0 143 255 255 255 16 0 4 0
+ 1016000 15240000 1016000 15240000 0
+11 0 0 0 0 255 255 255 16 0 4 0
+ 3048000 7112000 9144000 13208000 0
+9 0 0 0 0 255 255 255 16 0 4 0
+ 11176000 5080000 2032000
+4 9 0 0 0 143 12 0 4 1 1 8 0 8 4 0 8 4
+ 10668000 9144000 0
+ 10668000 13208000 0
+ 11684000 13208000 1
+ 12192000 13208000 1
+ 12700000 12192000 -1
+ 12192000 11176000 1
+ 11684000 11176000 1
+ 10668000 11176000 0
+ 12700000 9144000 0
diff --git a/support/dktools/wxd2lah.c b/support/dktools/wxd2lah.c
new file mode 100644
index 0000000000..c6131fa086
--- /dev/null
+++ b/support/dktools/wxd2lah.c
@@ -0,0 +1,3779 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxd2lah.ctr
+*/
+
+/** @file wxd2lah.c The wxd2lah module.
+*/
+
+
+#line 73 "wxd2lah.ctr"
+
+#ifndef WXD2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+
+
+
+
+#line 81 "wxd2lah.ctr"
+
+
+
+/** Calculate arrowhead segment on arc.
+ @param seg Segment to fill.
+ @param rs Radius at start.
+ @param re Radius at end.
+ @param as Angle alpha at start.
+ @param ae Angle alpha at end.
+ @param xc Center point x.
+ @param yc Center point y.
+*/
+
+static
+void
+wxd2lah_arc_arrow_segment(
+ arc_ah_seg_t *seg,
+ double rs,
+ double re,
+ double as,
+ double ae,
+ double xc,
+ double yc
+)
+{
+ double kappa;
+ double v;
+
+ kappa = dk4gratool_kappa_for_angle(fabs(ae - as));
+ seg->p[0].x = xc + rs * cos(as);
+ seg->p[0].y = yc + rs * sin(as);
+ seg->p[3].x = xc + re * cos(ae);
+ seg->p[3].y = yc + re * sin(ae);
+ v = (re-rs)*cos(as)-(ae-as)*rs*sin(as);
+ seg->p[1].x = seg->p[0].x + kappa * v;
+ v = (re-rs)*sin(as)+(ae-as)*rs*cos(as);
+ seg->p[1].y = seg->p[0].y + kappa * v;
+ v = (re-rs)*cos(ae)-(ae-as)*re*sin(ae);
+ seg->p[2].x = seg->p[3].x - kappa * v;
+ v = (re-rs)*sin(ae)+(ae-as)*re*cos(ae);
+ seg->p[2].y = seg->p[3].y - kappa * v;
+}
+
+
+
+/** Calculate square of a value.
+ @param x Side length.
+ @return Square area.
+*/
+static
+double
+wxd2lah_square(double x)
+{
+ return (x * x);
+}
+
+
+
+/** Calculate B-spline through 3 x values for t values -1, 0 and 1.
+ @param p1 Address of variable for dx/dt at t=-1 (output).
+ @param p2 Address of variable for dx/dt at t=0 (output).
+ @param p3 Address of variable for dx/dt at t=1 (output).
+ @param xu X value at t=-1 (input).
+ @param xv X value at t=0 (input).
+ @param xw X value at t=1 (input).
+*/
+static
+void
+wxd2lah_b_spline_derivatives(
+ double *p1,
+ double *p2,
+ double *p3,
+ double xu,
+ double xv,
+ double xw
+)
+{
+ *p1 = 2.0 * xv + (xw - xu) / 2.0 - xw - xu;
+ *p2 = (xw - xu) / 2.0;
+ *p3 = xw + xu + (xw - xu) / 2.0 - 2.0 * xv;
+}
+
+
+
+/** Calculate derivatives values for set of 3 points.
+ @param pd Destination array, derivatives are stored here.
+ @param ps Source array containing the original points.
+*/
+static
+void
+wxd2lah_sp_ah_b_spline_derivatives(
+ dk4_gra_point_t *pd,
+ dk4_gra_point_t *ps
+)
+{
+ wxd2lah_b_spline_derivatives(
+ &(pd[0].x), &(pd[1].x), &(pd[2].x), ps[0].x, ps[1].x, ps[2].x
+ );
+ wxd2lah_b_spline_derivatives(
+ &(pd[0].y), &(pd[1].y), &(pd[2].y), ps[0].y, ps[1].y, ps[2].y
+ );
+}
+
+
+
+/** Calculate point index for B-spline drawing.
+ @param i_start Start point index in point array.
+ @param npoints Number of points in spline.
+ @param backward Flag: Draw backwards.
+ @param i Index within spline.
+ @return Calculated index in array.
+*/
+static
+size_t
+wxd2lah_calculate_point_index(
+ size_t i_start,
+ size_t npoints,
+ int backward,
+ size_t i
+)
+{
+ size_t back = 0;
+ if (0 != backward) {
+ back = i_start + npoints - 1 - i;
+ }
+ else {
+ back = i_start + i;
+ }
+ return back;
+}
+
+
+
+/** Create B-spline path segment.
+ @param arrow Arrowhead structure.
+ @param job Job structure.
+ @param pobj Object arrow belongs to.
+ @param s Spline structure to use.
+ @param i_start Index of first point.
+ @param npoints Number of points.
+ @param backward Flag: Draw backwards.
+ @param mvto Flag: Use moveto at start.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_sp_ah_bspline(
+ wxd2lat_job_t *job,
+ sp_ah_t *s,
+ size_t i_start,
+ size_t npoints,
+ int backward,
+ int mvto,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t pd[4];
+ dk4_gra_point_t ps[4];
+ double v0[4]; /* Previous point: x, y, dx/dt, dy/dt */
+ double v1[4]; /* Current segment end point: x, y, dx/dt, dy/dt */
+#if 0
+ size_t ind;
+#endif
+ size_t i;
+ size_t iu;
+ size_t iv;
+ size_t iw;
+
+
+#line 251 "wxd2lah.ctr"
+#if 0
+
+
+#line 253 "wxd2lah.ctr"
+ for (i = 0; i < npoints; i++) {
+ ind = wxd2lah_calculate_point_index(i_start, npoints, backward, i);
+ if ((0 == i) && (0 != mvto)) {
+ dk4pppt_newpath_moveto(
+ job->ppp, (s->ppoints)[ind].x, (s->ppoints)[ind].y,
+ NULL, backptr, erp
+ );
+ }
+ if (0 < i) {
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[ind].x, (s->ppoints)[ind].y,
+ NULL, backptr, erp
+ );
+ }
+ }
+#else
+
+
+#line 270 "wxd2lah.ctr"
+ iu = wxd2lah_calculate_point_index(i_start, npoints, backward, 0);
+ iv = wxd2lah_calculate_point_index(i_start, npoints, backward, 1);
+ iw = wxd2lah_calculate_point_index(i_start, npoints, backward, 2);
+ ps[0].x = (s->ppoints)[iu].x;
+ ps[0].y = (s->ppoints)[iu].y;
+ ps[1].x = (s->ppoints)[iv].x;
+ ps[1].y = (s->ppoints)[iv].y;
+ ps[2].x = (s->ppoints)[iw].x;
+ ps[2].y = (s->ppoints)[iw].y;
+ wxd2lah_sp_ah_b_spline_derivatives(pd, ps);
+ v0[0] = (s->ppoints)[iu].x;
+ v0[1] = (s->ppoints)[iu].y;
+ v0[2] = pd[0].x / 3.0;
+ v0[3] = pd[0].y / 3.0;
+ if (0 != mvto) {
+ dk4pppt_newpath_moveto(job->ppp, v0[0], v0[1], NULL, backptr, erp);
+ }
+ for (i = 1; i < npoints; i++) {
+ /*
+ i is the index of the point at segment end
+ */
+ if ((npoints - 1) == i) {
+ iw = npoints - 1;
+ iv = npoints - 2;
+ iu = npoints - 3;
+ }
+ else {
+ iu = i - 1;
+ iv = i;
+ iw = i + 1;
+ }
+ iu = wxd2lah_calculate_point_index(i_start, npoints, backward, iu);
+ iv = wxd2lah_calculate_point_index(i_start, npoints, backward, iv);
+ iw = wxd2lah_calculate_point_index(i_start, npoints, backward, iw);
+ ps[0].x = (s->ppoints)[iu].x;
+ ps[0].y = (s->ppoints)[iu].y;
+ ps[1].x = (s->ppoints)[iv].x;
+ ps[1].y = (s->ppoints)[iv].y;
+ ps[2].x = (s->ppoints)[iw].x;
+ ps[2].y = (s->ppoints)[iw].y;
+ wxd2lah_sp_ah_b_spline_derivatives(pd, ps);
+ if ((npoints - 1) == i) {
+ v1[0] = (s->ppoints)[iw].x;
+ v1[1] = (s->ppoints)[iw].y;
+ v1[2] = pd[2].x / 3.0;
+ v1[3] = pd[2].y / 3.0;
+ }
+ else {
+ v1[0] = (s->ppoints)[iv].x;
+ v1[1] = (s->ppoints)[iv].y;
+ v1[2] = pd[1].x / 3.0;
+ v1[3] = pd[1].y / 3.0;
+ }
+ dk4pppt_curveto(
+ job->ppp,
+ (v0[0] + v0[2]), (v0[1] + v0[3]),
+ (v1[0] - v1[2]), (v1[1] - v1[3]),
+ v1[0], v1[1],
+ NULL, backptr, erp
+ );
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+#endif
+
+
+#line 334 "wxd2lah.ctr"
+}
+
+
+
+/** Calculate length of a sub interval.
+ @param xstart Start position of interval.
+ @param xend End position of interval.
+ @param i Number of segments contained in subinterval.
+ @param segments Number of segments used for interval.
+ @return Length of the subinterval.
+*/
+static
+double
+wxd2lah_partial_length(
+ double xstart,
+ double xend,
+ size_t i,
+ size_t segments
+)
+{
+ double back;
+ back = xstart + ((xend - xstart) * (double)i)/((double)segments);
+ return back;
+}
+
+
+
+/** Check whether arrow length and width is large enough (not 0).
+ @param parrow Arrowhead to check.
+ @param pobj Object arrowhead is attached to.
+ @param pdrw Drawing containing the object.
+ @param pjob Job structure, application used for diagnostics.
+ @return 1 on success, 0 if error found.
+*/
+static
+int
+wxd2lah_check_arrow_length_width(
+ wxd_arrow_t *parrow,
+ wxd2lat_job_t *pjob
+)
+{
+ int back = 0;
+ switch (parrow->type) {
+ case 0: {
+ /* No arrowhead, so no width/height requirements */
+ back = 1;
+ } break;
+ case 27: case 28: {
+ /* Just length required */
+ if ((uint8_t)0U != parrow->length) {
+ back = 1;
+ }
+ else {
+ /* ERROR: Positive length required for arrowhead */
+ dk4app_log_1(
+ pjob->app, pjob->msg, pjob->sz_msg, DK4_LL_ERROR, 24
+ );
+ }
+ } break;
+ case 29: {
+ /* Just width required */
+ if ((uint8_t)0U != parrow->width) {
+ back = 1;
+ }
+ else {
+ /* ERROR: Positive width required for arrowhead */
+ dk4app_log_1(
+ pjob->app, pjob->msg, pjob->sz_msg, DK4_LL_ERROR, 25
+ );
+ }
+ } break;
+ default: {
+ /* Both length and width required */
+ if (
+ ((uint8_t)0U != parrow->length)
+ && ((uint8_t)0U != parrow->width)
+ ) {
+ back = 1;
+ }
+ else {
+ /* ERROR: Positive width and height required on arrow */
+ dk4app_log_1(
+ pjob->app, pjob->msg, pjob->sz_msg, DK4_LL_ERROR, 25
+ );
+ }
+ } break;
+ }
+ return back;
+}
+
+
+
+int
+wxd2lah_one_arrowhead(
+ wxd_arrow_t *parrow,
+ wxd_object_t *pobj,
+ wxd_drawing_t *pdrw,
+ wxd2lat_job_t *pjob
+)
+{
+ double l; /* Line width */
+ double h; /* Arrow length */
+ double w; /* Arrow width */
+ double cmin; /* Minimum cut */
+ double cmax; /* Maximum cut */
+ int back = 1;
+
+
+#line 441 "wxd2lah.ctr"
+ l = wxd2lat_object_linewidth(pobj, pdrw, pjob);
+ if (0.0 < l) {
+ h = l * parrow->length;
+ w = l * parrow->width;
+ if (0 != wxd2lah_check_arrow_length_width(parrow, pjob)) {
+ switch (parrow->type) {
+ case 1: case 2: case 3: case 4: case 5: case 6: case 7:
+ case 8: case 9: case 10: case 11: case 12: case 13: case 14:
+ case 15: case 16: case 17: {
+ switch (parrow->type) {
+ case 10: case 11: case 12: case 13: {
+ h = (3.0 * h) / 4.0;
+ } break;
+ case 14: case 15: case 16: case 17: {
+ h = h / 2.0;
+ } break;
+ }
+ parrow->offset = (l * sqrt(h * h + ((w * w) / 4.0))) / w;
+ cmax = 2.0 * parrow->offset;
+ switch (pobj->csfs) {
+ case WXD_LC_ROUNDED: {
+ cmin = parrow->offset;
+ parrow->cut = (cmax + cmin) / 2.0;
+ parrow->cuttol = (cmax - cmin) / 4.0;
+ } break;
+ default: {
+ cmin = (l * h) / w;
+ parrow->cut = (cmax + cmin) / 2.0;
+ parrow->cuttol = (cmax - cmin) / 4.0;
+ if (WXD_LC_PROJECTING == pobj->csfs) {
+ parrow->cut += (l / 2.0);
+ }
+ } break;
+ }
+ } break;
+ case 18: case 19: case 20: case 21: case 22: case 23: case 24:
+ case 25: case 26: case 29: {
+ parrow->offset = l / 2.0;
+ switch (pobj->csfs) {
+ case WXD_LC_ROUNDED: {
+ parrow->cut = (3.0 * l) / 4.0;
+ parrow->cuttol = l / 8.0;
+ } break;
+ default: {
+ parrow->cut = l / 2.0;
+ parrow->cuttol = l / 4.0;
+ if (WXD_LC_PROJECTING == pobj->csfs) {
+ parrow->cut += (l / 2.0);
+ }
+ } break;
+ }
+ } break;
+ case 27: case 28: {
+ parrow->offset = l / 2.0;
+ switch (pobj->csfs) {
+ case WXD_LC_ROUNDED: {
+ parrow->cut = (3.0 * l) / 4.0;
+ parrow->cuttol = l / 8.0;
+ } break;
+ default: {
+ cmin = (
+ (h + l)
+ * ( 1.0
+ + sqrt(
+ 1.0
+ - wxd2lah_square(w/(h+l))
+ )
+ )
+ ) / 2.0;
+ cmax = l;
+ parrow->cut = (cmax + cmin) / 2.0;
+ parrow->cuttol = (cmax - cmin) / 4.0;
+ if (WXD_LC_PROJECTING == pobj->csfs) {
+ parrow->cut += (l / 2.0);
+ }
+ } break;
+ }
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Width and height (already reported) */
+ back = 0;
+ }
+ }
+ else {
+ /* ERROR: Line width */
+ dk4app_log_1(
+ pjob->app, pjob->msg, pjob->sz_msg, DK4_LL_ERROR, 27
+ );
+ back = 0;
+ }
+
+
+#line 534 "wxd2lah.ctr"
+ return back;
+}
+
+
+
+/** Build path to stroke or fill arrowhead.
+ @param arrow Arrowhead to draw.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Graphics object arrowhead is attached to.
+ @param p Point set.
+ @param szp Number of points in point set.
+ @param stage Stage in arrowhead building.
+ @param lw Line width.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+static
+void
+wxd2lah_build_path(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ dk4_gra_point_t *p,
+ int stage,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ switch (arrow->type) {
+ case 1: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ } break;
+ case 2: case 3: case 23: case 24: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 4: case 5: case 25: case 26: {
+ switch (stage) {
+ case 1: {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[3].x, p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ default : {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[0].x, p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ }
+ } break;
+ case 6: case 7: case 10: case 11: case 14: case 15:
+ case 18: case 19: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ switch (stage) {
+ case 1: {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[3].x, p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ default : {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[0].x, p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ }
+ } break;
+ case 20: case 21: {
+ switch (stage) {
+ case 1: {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[0].x, p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[4].x,p[4].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[5].x,p[5].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ default : {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[0].x, p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ }
+ } break;
+ case 22: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ } break;
+ case 27: case 28: {
+ dk4pppt_circle(
+ job->ppp, p[0].x, p[0].y,
+ ((lw * (double)(arrow->length)) / 2.0), NULL, backptr, erp
+ );
+ } break;
+ case 29: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ } break;
+ }
+}
+
+
+
+/** Set stroke attributes for arrowhead.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_set_stroke_attributes(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4pppt_set_line_style(job->ppp, DK4_GRA_LS_SOLID, 4.0, backptr, erp);
+ switch (arrow->type) {
+ case 1: case 22: {
+ dk4pppt_set_line_cap(job->ppp,DK4_GRA_LC_ROUNDED,backptr,erp);
+ dk4pppt_set_line_join(
+ job->ppp, DK4_GRA_LJ_MITERED, 8, backptr, erp
+ );
+ } break;
+ case 29: {
+ dk4pppt_set_line_cap(job->ppp,DK4_GRA_LC_ROUNDED,backptr,erp);
+ } break;
+ case 27: case 28: {
+ /* empty by intent */
+ } break;
+ default: {
+ dk4pppt_set_line_join(
+ job->ppp, DK4_GRA_LJ_MITERED, 8, backptr, erp
+ );
+ } break;
+ }
+}
+
+
+
+/** Draw one arrowhead on polyline.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_head_angle_polyline(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ dk4_gra_point_t *p,
+ dk4_gra_point_t *phead,
+ double alpha,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t npoints = 0;
+ size_t i;
+ /*
+ Build path points
+ */
+ switch (arrow->type) {
+ case 1: case 2: case 3: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - p[0].y;
+ p[2].x = p[0].x;
+ npoints = 3;
+ } break;
+ case 4: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 5: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 6: case 7: case 8: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 9: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 10: case 11: case 12: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 13: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 14: case 15: case 16: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - 0.5 * lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - 0.5 * lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 17: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - 0.5 * lw * (double)(arrow->length);
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - 0.5 * lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 18: case 19: {
+ p[0].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0;
+ p[1].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = (lw * (double)(arrow->width)) / 2.0;
+ npoints = 4;
+ } break;
+ case 20: {
+ p[0].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0;
+ p[1].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = (lw * (double)(arrow->width)) / 2.0;
+ p[4].x = 0.0;
+ p[4].y = 0.0;
+ p[5].x = 0.0 - lw * (double)(arrow->length);
+ p[5].y = 0.0;
+ npoints = 6;
+ } break;
+ case 21: {
+ p[1].x = 0.0;
+ p[1].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0;
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[4].x = 0.0;
+ p[4].y = 0.0;
+ p[5].x = 0.0 - lw * (double)(arrow->length);
+ p[5].y = 0.0;
+ npoints = 6;
+ } break;
+ case 22: {
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0;
+ p[1].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0;
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ npoints = 4;
+ } break;
+ case 23: case 24: {
+ p[0].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0 - lw * (double)(arrow->length);
+ p[1].y = 0.0;
+ p[2].x = 0.0;
+ p[2].y = 0.0 - p[0].y;
+ npoints = 3;
+ } break;
+ case 25: {
+ p[1].y = 0.0;
+ p[1].x = 0.0 - lw * (double)(arrow->length);
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0;
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0;
+ p[3].y = 0.0;
+ p[3].x = 0.0;
+ npoints = 4;
+ } break;
+ case 26: {
+ p[1].y = 0.0;
+ p[1].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0;
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0;
+ p[3].y = 0.0;
+ p[3].x = 0.0;
+ npoints = 4;
+ } break;
+ case 27: case 28: {
+ p[0].x = 0.0 - (lw * (double)(arrow->length)) / 2.0;
+ p[0].y = 0.0;
+ npoints = 1;
+ } break;
+ case 29: {
+ p[0].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0;
+ p[1].y = 0.0 - p[0].y;
+ npoints = 2;
+ } break;
+ }
+ /* Rotate and shift the points
+ */
+ for (i = 0; i < npoints; i++) {
+ dk4gratool_rotate_point(&(p[i]), alpha);
+ p[i].x += phead->x;
+ p[i].y += phead->y;
+ }
+ /* Set up stroke attributes
+ */
+ wxd2lah_set_stroke_attributes(arrow, job, backptr, erp);
+#if 0
+ dk4pppt_set_line_style(job->ppp, DK4_GRA_LS_SOLID, 4.0, backptr, erp);
+ switch (arrow->type) {
+ case 1: case 22: {
+ dk4pppt_set_line_cap(job->ppp,DK4_GRA_LC_ROUNDED,backptr,erp);
+ dk4pppt_set_line_join(
+ job->ppp, DK4_GRA_LJ_MITERED, 8, backptr, erp
+ );
+ } break;
+ case 29: {
+ dk4pppt_set_line_cap(job->ppp,DK4_GRA_LC_ROUNDED,backptr,erp);
+ } break;
+ case 27: case 28: {
+ /* empty by intent */
+ } break;
+ default: {
+ dk4pppt_set_line_join(
+ job->ppp, DK4_GRA_LJ_MITERED, 8, backptr, erp
+ );
+ } break;
+ }
+#endif
+ /*
+ Use path
+ */
+ switch (arrow->type) {
+ case 1: case 22: case 29: {
+ /*
+ Arrowheads to stroke
+ */
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ } break;
+ case 2: case 6: case 10: case 14: case 18: case 23: case 27: {
+ /*
+ White filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 3: case 7: case 11: case 15: case 24: case 19: case 28: {
+ /*
+ Color filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 4: case 5: case 8: case 9: case 12: case 13:
+ case 16: case 17: case 20: case 21: case 25: case 26: {
+ /*
+ Half-side filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 1, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ } break;
+ }
+}
+
+
+
+/** Draw one arrowhead on polyline.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_polyline(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t p[8]; /* Points to construct arrowhead path */
+ dk4_gra_point_t head; /* Point where arrowhead ends */
+ dk4_gra_point_t *pptr; /* Destination for copy operation */
+ double alpha; /* Direction of arrowhead */
+ double lw; /* Line width */
+ double x0; /* Start point X to calculate angle */
+ double y0; /* Start point Y to calculate angle */
+ double x1; /* End point X to calculate angle */
+ double y1; /* End point Y to calculate angle */
+
+
+
+#line 1117 "wxd2lah.ctr"
+ /*
+ Find line width used by object
+ */
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ /*
+ Find head point and angle
+ */
+ if (0 != isbck) {
+ DK4_MEMCPY(&head,(pobj->det).p.p,sizeof(wxd_point_t));
+ x1 = ((pobj->det).p.p)[0].x;
+ y1 = ((pobj->det).p.p)[0].y;
+ x0 = ((pobj->det).p.p)[1].x;
+ y0 = ((pobj->det).p.p)[1].y;
+ }
+ else {
+ pptr = (pobj->det).p.p;
+ pptr = &(pptr[(pobj->det).p.n - (uint16_t)1U]);
+ DK4_MEMCPY(&head,pptr,sizeof(wxd_point_t));
+ x1 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)1U].x;
+ y1 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)1U].y;
+ x0 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)2U].x;
+ y0 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)2U].y;
+ }
+ y1 = y1 - y0;
+ x1 = x1 - x0;
+ /*
+ 2019-03-15: BUGFIX
+ Changed and condition to or condition.
+ It is sufficient to have one of the distances unequal 0.
+ */
+ if ((1.0e-8 < fabs(y1)) || (1.0e-8 < fabs(x1))) {
+ /*
+ Find angle
+ */
+ alpha = atan2(y1, x1);
+ /*
+ Move head point by arrow offset
+ */
+ p[0].x = 0.0 - arrow->offset;
+ p[0].y = 0.0;
+ dk4gratool_rotate_point(&(p[0]), alpha);
+ head.x += p[0].x;
+ head.y += p[0].y;
+ wxd2lah_ah_head_angle_polyline(
+ arrow, job, pobj, p, &head, alpha, lw, backptr, erp
+ );
+ }
+ else {
+
+#line 1165 "wxd2lah.ctr"
+ *backptr = 0;
+ /* ERROR: Failed to calculate angle for arrowhead */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 28
+ );
+ }
+
+
+#line 1172 "wxd2lah.ctr"
+}
+
+
+
+/** Calculate segments for real arc.
+ @param arrow Arrowhead structure.
+ @param job Job structure.
+ @param pobj Object arrow belongs to.
+ @param ah Angle at head of arrow.
+ @param csgn Coefficient for angles departing from head (1 or -1).
+ @param lw Line width.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_segs_real_arc(
+ arc_ah_seg_t *s,
+ wxd_arrow_t *arrow,
+ wxd_object_t *pobj,
+ double ah,
+ double csgn,
+ double lw
+)
+{
+
+
+#line 1198 "wxd2lah.ctr"
+ switch (arrow->type) {
+ case 1: case 2: case 3: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 4: case 5: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 6: case 7: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[3]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 8: case 9: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[3]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[4]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 10: case 11: case 12: case 13: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[3]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[4]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 14: case 15: case 16: case 17: {
+#if TRACE_DEBUG
+ size_t i;
+ size_t j;
+#endif
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.5*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.5*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.5*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[3]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.5*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[4]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+#if TRACE_DEBUG
+ for (i = 0; i < 5; i++) {
+
+
+#line 1409 "wxd2lah.ctr"
+ for (j = 0; j < 4; j++) {
+
+
+#line 1411 "wxd2lah.ctr"
+
+
+#line 1412 "wxd2lah.ctr"
+ }
+ }
+#endif
+ } break;
+ case 18: case 19: case 20: case 21: case 22: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 23: case 24: case 25: case 26: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ (pobj->det).a.r,
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ (pobj->det).a.r,
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ }
+
+
+#line 1470 "wxd2lah.ctr"
+}
+
+
+
+/** Create path for arrowhead on real arc.
+ @param arrow Arrowhead structure.
+ @param job Job structure.
+ @param pobj Object arrow belongs to.
+ @param ahead Angle at head of arrow.
+ @param csgn Coefficient for angles departing from head (1 or -1).
+ @param lw Line width.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_path_real_arc(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ arc_ah_seg_t *s,
+ int stage,
+ double ahead,
+ double csgn,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double xc; /* Circle center point x */
+ double yc; /* Circle center point y */
+ double r; /* Circle radius */
+ size_t ss; /* Front segment on active side */
+ size_t ts; /* Butt segment on active side */
+
+
+#line 1505 "wxd2lah.ctr"
+ switch (arrow->type) {
+ case 1: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ } break;
+ case 2: case 3: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 4: case 5: {
+ if (0 == stage) {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = (
+ (4 == arrow->type)
+ ? ((0.0 > csgn) ? (1) : (0))
+ : ((0.0 > csgn) ? (0) : (1))
+ );
+ dk4pppt_newpath_moveto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[ss].p[1].x, s[ss].p[1].y,
+ s[ss].p[2].x, s[ss].p[2].y,
+ s[ss].p[3].x, s[ss].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 6: case 7: case 10: case 11: case 14: case 15: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[3].p[1].x, s[3].p[1].y,
+ s[3].p[2].x, s[3].p[2].y,
+ s[3].p[3].x, s[3].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+
+
+#line 1637 "wxd2lah.ctr"
+ if (0 == stage) {
+
+
+#line 1639 "wxd2lah.ctr"
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+
+
+#line 1650 "wxd2lah.ctr"
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+
+
+#line 1658 "wxd2lah.ctr"
+ dk4pppt_curveto(
+ job->ppp,
+ s[3].p[1].x, s[3].p[1].y,
+ s[3].p[2].x, s[3].p[2].y,
+ s[3].p[3].x, s[3].p[3].y,
+ NULL, backptr, erp
+ );
+
+
+#line 1666 "wxd2lah.ctr"
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+
+
+#line 1674 "wxd2lah.ctr"
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = ((0.0 > csgn) ? (0) : (1));
+ ts = ((0.0 > csgn) ? (2) : (3));
+ switch (arrow->type) {
+ case 8: case 12: case 16: {
+ ss = ((0.0 > csgn) ? (1) : (0));
+ ts = ((0.0 > csgn) ? (3) : (2));
+ } break;
+ }
+
+
+#line 1686 "wxd2lah.ctr"
+ dk4pppt_newpath_moveto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[ss].p[1].x, s[ss].p[1].y,
+ s[ss].p[2].x, s[ss].p[2].y,
+ s[ss].p[3].x, s[ss].p[3].y,
+ NULL, backptr, erp
+ );
+
+
+#line 1697 "wxd2lah.ctr"
+ dk4pppt_curveto(
+ job->ppp,
+ s[4].p[2].x, s[4].p[2].y,
+ s[4].p[1].x, s[4].p[1].y,
+ s[4].p[0].x, s[4].p[0].y,
+ NULL, backptr, erp
+ );
+
+
+#line 1705 "wxd2lah.ctr"
+ dk4pppt_curveto(
+ job->ppp,
+ s[ts].p[2].x, s[ts].p[2].y,
+ s[ts].p[1].x, s[ts].p[1].y,
+ s[ts].p[0].x, s[ts].p[0].y,
+ NULL, backptr, erp
+ );
+
+
+#line 1713 "wxd2lah.ctr"
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 18: case 19: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 20: case 21: {
+ if (0 == stage) {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = (
+ (20 == arrow->type)
+ ? ((0.0 > csgn) ? (1) : (0))
+ : ((0.0 > csgn) ? (0) : (1))
+ );
+ dk4pppt_newpath_moveto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[ss].p[1].x, s[ss].p[1].y,
+ s[ss].p[2].x, s[ss].p[2].y,
+ s[ss].p[3].x, s[ss].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[2].p[3].x, s[2].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 22: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ } break;
+ case 23: case 24: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 25: case 26: {
+ if (0 == stage) {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = (
+ (25 == arrow->type)
+ ? ((0.0 > csgn) ? (1) : (0))
+ : ((0.0 > csgn) ? (0) : (1))
+ );
+ dk4pppt_newpath_moveto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[ss].p[1].x, s[ss].p[1].y,
+ s[ss].p[2].x, s[ss].p[2].y,
+ s[ss].p[3].x, s[ss].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[2].p[3].x, s[2].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 27: case 28: {
+ xc = (pobj->det).a.r * cos(ahead) + (pobj->det).a.x;
+ yc = (pobj->det).a.r * sin(ahead) + (pobj->det).a.y;
+ r = (lw * (double)(arrow->length)) / 2.0;
+ xc += (csgn * r * cos(ahead + M_PI_2));
+ yc += (csgn * r * sin(ahead + M_PI_2));
+ dk4pppt_circle(job->ppp, xc, yc, r, NULL, backptr, erp);
+ } break;
+ case 29: {
+ r = (pobj->det).a.r + (lw * (double)(arrow->width)) / 2.0;
+ xc = (pobj->det).a.x + r * cos(ahead);
+ yc = (pobj->det).a.y + r * sin(ahead);
+ dk4pppt_newpath_moveto(job->ppp, xc, yc, NULL, backptr, erp);
+ r = (pobj->det).a.r - (lw * (double)(arrow->width)) / 2.0;
+ xc = (pobj->det).a.x + r * cos(ahead);
+ yc = (pobj->det).a.y + r * sin(ahead);
+ dk4pppt_lineto(job->ppp, xc, yc, NULL, backptr, erp);
+ } break;
+ }
+
+
+#line 1919 "wxd2lah.ctr"
+}
+
+
+
+/** Draw one arrowhead on real arc.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_real_arc(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ arc_ah_seg_t s[8]; /* Arrowhead segments */
+ double lw; /* Line width */
+ double csgn; /* Coefficient for angle, departing from head */
+ double ah; /* Head alpha */
+
+
+#line 1949 "wxd2lah.ctr"
+ /*
+ Setup
+ */
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ csgn = (
+ (0 != isbck)
+ ? ((0 < (pobj->det).a.d) ? (1.0) : (-1.0))
+ : ((0 > (pobj->det).a.d) ? (1.0) : (-1.0))
+ );
+ ah = (
+ (0 != isbck)
+ ? ((pobj->det).a.a + (csgn * (arrow->offset) / (pobj->det).a.r))
+ : ((pobj->det).a.b + (csgn * (arrow->offset) / (pobj->det).a.r))
+ );
+ /* Create segment data.
+ */
+ wxd2lah_ah_segs_real_arc(s, arrow, pobj, ah, csgn, lw);
+ /*
+ Set up stroke and fill attributes
+ */
+ wxd2lah_set_stroke_attributes(arrow, job, backptr, erp);
+ /*
+ Use path
+ */
+ switch (arrow->type) {
+ case 1: case 22: case 29: {
+ /*
+ Arrowheads to stroke
+ */
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ } break;
+ case 2: case 6: case 10: case 14: case 18: case 23: case 27: {
+ /*
+ White filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 3: case 7: case 11: case 15: case 24: case 19: case 28: {
+ /*
+ Color filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 4: case 5: case 8: case 9: case 12: case 13:
+ case 16: case 17: case 20: case 21: case 25: case 26: {
+ /*
+ Half-side filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 1, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ } break;
+ }
+
+
+#line 2080 "wxd2lah.ctr"
+}
+
+
+
+/** Draw one arrowhead on malformed arc.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_malformed_arc(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+ dk4_gra_point_t p[8]; /* Points to construct arrowhead path */
+ dk4_gra_point_t orig; /* Original end point of line */
+ dk4_gra_point_t head; /* Shifted end point for arrowhead */
+ double lw; /* Line width */
+ double alpha; /* Rotation angle in end point */
+
+
+#line 2112 "wxd2lah.ctr"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ if (
+ ((1 != isbck) && (0 != (pobj->ab).type))
+ || ((0 != isbck) && (0 != (pobj->af).type))
+ ) {
+ if (
+ (0 != isbck)
+ && (
+ ((pobj->det).a.x1 != (pobj->det).a.x2)
+ || ((pobj->det).a.y1 != (pobj->det).a.y2)
+ )
+ ) {
+ alpha = atan2(
+ ((double)((pobj->det).a.y1 - (pobj->det).a.y2)),
+ ((double)((pobj->det).a.x1 - (pobj->det).a.x2))
+ );
+ orig.x = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x1));
+ orig.y = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.y1));
+ if (0 != dk4ma_is_finite(alpha)) {
+ head.x = 0.0 - arrow->offset;
+ head.y = 0.0;
+ dk4gratool_rotate_point(&head, alpha);
+ head.x += orig.x;
+ head.y += orig.y;
+ wxd2lah_ah_head_angle_polyline(
+ arrow, job, pobj, p, &head, alpha, lw, backptr, erp
+ );
+ }
+ }
+ if (
+ (0 == isbck)
+ && (
+ ((pobj->det).a.x3 != (pobj->det).a.x2)
+ || ((pobj->det).a.y3 != (pobj->det).a.y2)
+ )
+ ) {
+ alpha = atan2(
+ ((double)((pobj->det).a.y3 - (pobj->det).a.y2)),
+ ((double)((pobj->det).a.x3 - (pobj->det).a.x2))
+ );
+ orig.x = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x3));
+ orig.y = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.y3));
+ if (0 != dk4ma_is_finite(alpha)) {
+ head.x = 0.0 - arrow->offset;
+ head.y = 0.0;
+ dk4gratool_rotate_point(&head, alpha);
+ head.x += orig.x;
+ head.y += orig.y;
+ wxd2lah_ah_head_angle_polyline(
+ arrow, job, pobj, p, &head, alpha, lw, backptr, erp
+ );
+ }
+ }
+ }
+
+
+#line 2167 "wxd2lah.ctr"
+}
+
+
+
+/** Draw one arrowhead on arc.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_arc(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 2193 "wxd2lah.ctr"
+ if (0 != (pobj->det).a.d) {
+ wxd2lah_ah_real_arc(arrow, drw, job, pobj, isbck, backptr, erp);
+ }
+ else {
+ wxd2lah_ah_malformed_arc(arrow, drw, job, pobj, isbck, backptr, erp);
+ }
+
+
+#line 2200 "wxd2lah.ctr"
+}
+
+
+
+/** Calculate number points for spline arrowhead, allocate memory.
+ @param s Spline arrowhead structure to fill.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lah_sp_ah_npoints(
+ sp_ah_t *s,
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+#if 0
+ double l;
+#endif
+ double t;
+ size_t np;
+ int back = 0;
+ int res = 0;
+ int res2 = 0;
+ int e_o = 0; /* Overflow */
+ int e_i = 0; /* Iteration */
+ int e_m = 0; /* Memory allocation */
+
+
+#line 2239 "wxd2lah.ctr"
+ dk4error_init(&er);
+ if (0 != isbck) {
+
+#line 2241 "wxd2lah.ctr"
+ s->csgn = 1.0;
+ s->lo = arrow->offset;
+ }
+ else {
+
+#line 2245 "wxd2lah.ctr"
+ s->csgn = -1.0;
+ s->lo = (pobj->det).s.suml - arrow->offset;
+ }
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lo, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 != res) {
+
+#line 2253 "wxd2lah.ctr"
+ s->to = t;
+ switch (arrow->type) {
+ case 1: case 2: case 3: {
+
+#line 2256 "wxd2lah.ctr"
+ s->lb = s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 != res) {
+
+#line 2262 "wxd2lah.ctr"
+ s->tb = t;
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ );
+
+#line 2267 "wxd2lah.ctr"
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ }
+
+#line 2270 "wxd2lah.ctr"
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ np = dk4ma_size_t_mul(s->ifr, 2, &er);
+ s->ibl = np;
+
+#line 2273 "wxd2lah.ctr"
+ if (DK4_E_NONE == er.ec) {
+
+#line 2274 "wxd2lah.ctr"
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) {
+
+#line 2276 "wxd2lah.ctr"
+ back = 1;
+ }
+ else {
+
+#line 2279 "wxd2lah.ctr"
+ e_m = 1;
+ }
+ }
+ else {
+
+#line 2283 "wxd2lah.ctr"
+ e_o = 1;
+ }
+ }
+ else {
+
+#line 2287 "wxd2lah.ctr"
+ e_i = 1;
+ }
+ } break;
+ case 4: case 5: {
+ s->lb = s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 != res) {
+
+#line 2297 "wxd2lah.ctr"
+ s->tb = t;
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ );
+
+#line 2302 "wxd2lah.ctr"
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ }
+
+#line 2305 "wxd2lah.ctr"
+ s->nc = s->nf;
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ s->ic = dk4ma_size_t_mul(s->ifr, 2, &er);
+ np = dk4ma_size_t_mul(s->ifr, 3, &er);
+ s->ibl = np;
+
+#line 2310 "wxd2lah.ctr"
+ if (DK4_E_NONE == er.ec) {
+
+#line 2311 "wxd2lah.ctr"
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) {
+
+#line 2313 "wxd2lah.ctr"
+ back = 1;
+ }
+ else {
+
+#line 2316 "wxd2lah.ctr"
+ e_m = 1;
+ }
+ }
+ else {
+
+#line 2320 "wxd2lah.ctr"
+ e_o = 1;
+ }
+ }
+ else {
+
+#line 2324 "wxd2lah.ctr"
+ e_i = 1;
+ }
+ } break;
+ case 6: case 7: case 8: case 9:
+ case 10: case 11: case 12: case 13:
+ case 14: case 15: case 16: case 17: {
+
+#line 2330 "wxd2lah.ctr"
+ switch (arrow->type) {
+ case 6: case 7: case 8: case 9: {
+ s->lb =
+ s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ s->lc =
+ s->lo + 0.75 * s->csgn * (double)(arrow->length) * s->lw;
+ } break;
+ case 10: case 11: case 12: case 13: {
+ s->lb =
+ s->lo + 0.75 * s->csgn * (double)(arrow->length) * s->lw;
+ s->lc =
+ s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ } break;
+ case 14: case 15: case 16: case 17: {
+ s->lb =
+ s->lo + 0.5 * s->csgn * (double)(arrow->length) * s->lw;
+ s->lc =
+ s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ } break;
+ }
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ s->tb = t;
+ t = 0.0;
+ res2 = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lc, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ s->tc = t;
+ if ((0 != res) && (0 != res2)) {
+
+#line 2361 "wxd2lah.ctr"
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ );
+
+#line 2365 "wxd2lah.ctr"
+ s->nb = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->tc) * (double)((job->grco).xsss)),
+ &er
+ );
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ s->nc = dk4ma_size_t_from_double(
+ ceil(
+ fabs(
+ (s->tc - s->to) * (double)((job->grco).xsss)
+ )
+ ),
+ &er
+ );
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ if (2 > s->nb) { s->nb = 2; }
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ if (2 > s->nc) { s->nc = 2; }
+ } break;
+ }
+ }
+
+#line 2390 "wxd2lah.ctr"
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ s->ibl = dk4ma_size_t_mul(s->ifr, 2, &er);
+ s->ibr = dk4ma_size_t_add(s->ibl, s->nb, &er);
+ s->ibr = dk4ma_size_t_add(s->ibr, 1, &er);
+ np = dk4ma_size_t_add(s->nf, s->nb, &er);
+ np = dk4ma_size_t_add(np, 2, &er);
+ np = dk4ma_size_t_mul(np, 2, &er);
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ s->ic = np;
+ np = dk4ma_size_t_add(np, s->nc, &er);
+ np = dk4ma_size_t_add(np, 1, &er);
+ } break;
+ }
+
+
+#line 2405 "wxd2lah.ctr"
+
+
+#line 2406 "wxd2lah.ctr"
+#if TRACE_DEBUG
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+
+
+#line 2410 "wxd2lah.ctr"
+ } break;
+ }
+#endif
+
+
+#line 2414 "wxd2lah.ctr"
+
+
+#line 2415 "wxd2lah.ctr"
+
+
+#line 2416 "wxd2lah.ctr"
+
+
+#line 2417 "wxd2lah.ctr"
+#if TRACE_DEBUG
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+
+
+#line 2421 "wxd2lah.ctr"
+ } break;
+ }
+#endif
+
+
+#line 2425 "wxd2lah.ctr"
+ if (DK4_E_NONE == er.ec) {
+
+#line 2426 "wxd2lah.ctr"
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) {
+
+#line 2428 "wxd2lah.ctr"
+ back = 1;
+ }
+ else {
+
+#line 2431 "wxd2lah.ctr"
+ e_m = 1;
+ }
+ }
+ else {
+
+#line 2435 "wxd2lah.ctr"
+ e_o = 1;
+ }
+ }
+ else {
+
+#line 2439 "wxd2lah.ctr"
+ e_i = 1;
+ }
+ } break;
+ case 18: case 19: case 20: case 21: case 22: {
+ s->lb = s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ s->tb = t;
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ );
+ if (0 != res) {
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ np = dk4ma_size_t_mul(s->ifr, 2, &er);
+ switch (arrow->type) {
+ case 20: case 21: {
+ s->ic = np;
+ np = dk4ma_size_t_mul(s->ifr, 3, &er);
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) {
+
+#line 2467 "wxd2lah.ctr"
+ back = 1;
+ }
+ else {
+
+#line 2470 "wxd2lah.ctr"
+ e_m = 1;
+ }
+ }
+ else {
+
+#line 2474 "wxd2lah.ctr"
+ e_o = 1;
+ }
+ }
+ else {
+
+#line 2478 "wxd2lah.ctr"
+ e_o = 1;
+ }
+ }
+ else {
+ e_i = 1;
+ }
+ } break;
+ case 23: case 24: case 25: case 26: {
+ s->lb = s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 != res) {
+ s->tb = t;
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ np = dk4ma_size_t_mul(s->ifr, 2, &er);
+ switch (arrow->type) {
+ case 25: case 26: {
+ s->ic = np;
+ np = dk4ma_size_t_mul(s->ifr, 3, &er);
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) {
+
+#line 2510 "wxd2lah.ctr"
+ back = 1;
+ }
+ else {
+ e_m = 1;
+ }
+ }
+ else {
+
+#line 2517 "wxd2lah.ctr"
+ e_o = 1;
+ }
+ }
+ else {
+
+#line 2521 "wxd2lah.ctr"
+ e_o = 1;
+ }
+ }
+ else {
+
+#line 2525 "wxd2lah.ctr"
+ e_i = 1;
+ }
+ } break;
+ case 27: case 28: case 29: {
+ back = 1;
+ } break;
+ default: {
+
+#line 2532 "wxd2lah.ctr"
+ /* ERROR: Unknown arrow type */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 29
+ );
+ } break;
+ }
+ }
+ else {
+
+#line 2540 "wxd2lah.ctr"
+ e_i = 1;
+ }
+ if (DK4_E_NONE != er.ec) {
+ back = 0;
+ dk4error_copy(erp, &er);
+ }
+ if (0 == back) {
+ if (0 != e_o) {
+ /* ERROR: Math overflow */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 30
+ );
+ }
+ if (0 != e_i) {
+ /* ERROR: Iteration failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 31
+ );
+ }
+ if (0 != e_m) {
+ /* ERROR: Memory allocation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 32
+ );
+ }
+ if ((0 == e_o) && (0 == e_i) && (0 == e_m)) {
+ /* ERROR: Failed to calculate number of points */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 33
+ );
+ }
+ }
+
+
+#line 2573 "wxd2lah.ctr"
+ return back;
+}
+
+
+
+/** Calculate points for spline arrowhead.
+ @param s Spline arrowhead structure to fill.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+ */
+static
+int
+wxd2lah_sp_ah_calc(
+ sp_ah_t *s,
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+ )
+{
+ dk4_er_t er;
+ double v[4];
+ dk4_gra_point_t p;
+ size_t i;
+ double t;
+ double l;
+ int back = 0;
+ int res = 0;
+ int e_i = 0;
+ int e_o = 0;
+ int e_m = 0;
+
+
+#line 2612 "wxd2lah.ctr"
+ /* TODO: Implementation
+ */
+ dk4error_init(&er);
+ if (0 != wxd2lah_sp_ah_npoints(s,arrow,job,pobj,isbck,erp)) {
+ switch (arrow->type) {
+ case 1: case 2: case 3: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (1 == back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+
+
+#line 2643 "wxd2lah.ctr"
+
+
+#line 2644 "wxd2lah.ctr"
+ if (0.0 < s->csgn) {
+ v[2] += M_PI;
+ }
+ if ((s->ifr - 1) > i) {
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ else {
+ p.x = v[0]; p.y = v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ case 4: case 5: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (1 == back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+
+
+#line 2702 "wxd2lah.ctr"
+
+
+#line 2703 "wxd2lah.ctr"
+ (s->ppoints)[i + s->ic].x = v[0];
+ (s->ppoints)[i + s->ic].y = v[1];
+ if (0.0 < s->csgn) {
+ v[2] += M_PI;
+ }
+ if ((s->ifr - 1) > i) {
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ else {
+ p.x = v[0]; p.y = v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ case 6: case 7: case 8: case 9:
+ case 10: case 11: case 12: case 13:
+ case 14: case 15: case 16: case 17: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (1 == back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+
+
+#line 2765 "wxd2lah.ctr"
+
+
+#line 2766 "wxd2lah.ctr"
+
+
+#line 2767 "wxd2lah.ctr"
+ if (0.0 < s->csgn) {
+ v[2] += M_PI;
+ }
+ if ((s->ifr - 1) > i) {
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+
+
+#line 2778 "wxd2lah.ctr"
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+
+
+#line 2786 "wxd2lah.ctr"
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ else {
+ p.x = v[0]; p.y = v[1];
+
+
+#line 2791 "wxd2lah.ctr"
+
+
+#line 2792 "wxd2lah.ctr"
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ for (i = 0; i <= s->nb; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if (s->nb == i) {
+ t = s->tc;
+ }
+ else {
+ l = s->lb
+ + ((s->lc - s->lb)
+ * (double)i) / ((double)(s->nb));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+
+
+#line 2828 "wxd2lah.ctr"
+
+
+#line 2829 "wxd2lah.ctr"
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ if (s->nb != i) {
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->nb));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+
+
+#line 2838 "wxd2lah.ctr"
+ DK4_MEMCPY(&((s->ppoints)[i+s->ibl]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->nb));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+
+
+#line 2846 "wxd2lah.ctr"
+ DK4_MEMCPY(&((s->ppoints)[i+s->ibr]),&p,sizeof(p));
+ }
+ else {
+ p.x = v[0];
+ p.y = v[1];
+
+
+#line 2852 "wxd2lah.ctr"
+
+
+#line 2853 "wxd2lah.ctr"
+ DK4_MEMCPY(&((s->ppoints)[i+s->ibl]),&p,sizeof(p));
+ DK4_MEMCPY(&((s->ppoints)[i+s->ibr]),&p,sizeof(p));
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ for (i = 0; i <= s->nc; i++) {
+ if (0 == i) {
+ t = s->tc;
+ }
+ else {
+ if (s->nc == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(
+ s->lc, s->lo, i, (s->nc)
+ );
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l,
+ (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+
+
+#line 2892 "wxd2lah.ctr"
+
+
+#line 2893 "wxd2lah.ctr"
+
+
+#line 2894 "wxd2lah.ctr"
+ (s->ppoints)[i + s->ic].x = v[0];
+ (s->ppoints)[i + s->ic].y = v[1];
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ }
+ } break;
+ case 18: case 19: case 20: case 21: case 22: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0);
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0);
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i + s->ifr]),&p,sizeof(p));
+ switch (arrow->type) {
+ case 20: case 21: {
+ (s->ppoints)[i + s->ic].x = v[0];
+ (s->ppoints)[i + s->ic].y = v[1];
+ } break;
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ case 23: case 24: case 25: case 26: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ switch (arrow->type) {
+ case 25: case 26: {
+ (s->ppoints)[i + s->ic].x = v[0];
+ (s->ppoints)[i + s->ic].y = v[1];
+ } break;
+ }
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ p.x = 0.0;
+ p.y = (((double)(arrow->width) / 2.0) * (double)i)
+ / ((double)(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - (((double)(arrow->width) / 2.0) * (double)i)
+ / ((double)(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i + s->ifr]),&p,sizeof(p));
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ case 27: case 28: {
+ res = wxd2lxs_calculate(v, pobj, s->to, 1, &er);
+ if (0 != res) {
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ p.y = 0.0;
+ p.x = 0.0 - (((double)(arrow->length) * s->lw) / 2.0);
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ s->x0 = p.x;
+ s->y0 = p.y;
+ back = 1;
+ }
+ else {
+ e_m = 1;
+ }
+ } break;
+ case 29: {
+ res = wxd2lxs_calculate(v, pobj, s->to, 1, &er);
+ if (0 != res) {
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ p.x = 0.0;
+ p.y = (s->lw * (double)(arrow->width)) / 2.0;
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ s->x0 = p.x; s->y0 = p.y;
+ p.x = 0.0;
+ p.y = 0.0 - ((s->lw * (double)(arrow->width)) / 2.0);
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ s->x1 = p.x; s->y1 = p.y;
+ back = 1;
+ }
+ else {
+ e_m = 1;
+ }
+ } break;
+ }
+ }
+ if (0 == back) {
+ *backptr = 0;
+ if (0 != e_i) {
+ /* ERROR: Iteration failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 31
+ );
+ }
+ if (0 != e_o) {
+ /* ERROR: Numeric overflow */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 30
+ );
+ }
+ if (0 != e_m) {
+ /* ERROR: Mathematical problem */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 34
+ );
+ }
+ if ((0 == e_i) && (0 == e_o)) {
+ /* ERROR: Arrowhead calculation on spline failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 35
+ );
+ }
+ }
+
+
+#line 3081 "wxd2lah.ctr"
+ return back;
+}
+
+
+
+/** Draw one arrowhead on spline.
+ @param arrow Arrowhead structure.
+ @param job Job structure.
+ @param pobj Object arrow belongs to.
+ @param s Spline structure to use.
+ @param stage Processing stage.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_sp_ah_path(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ sp_ah_t *s,
+ int stage,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t ss;
+
+
+#line 3108 "wxd2lah.ctr"
+ switch (arrow->type) {
+ case 1: {
+
+#line 3110 "wxd2lah.ctr"
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ } break;
+ case 2: case 3: {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,(s->ppoints)[0].x,(s->ppoints)[0].y,NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 4: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 5: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[s->ic].x, (s->ppoints)[s->ic].y,
+ NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 6: case 7: case 10: case 11: case 14: case 15: {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, (s->nf + 1), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibr, (s->nb + 1), 0, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibl, (s->nb + 1), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 8: case 12: case 16: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, (s->nf + 1), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibr, (s->nb + 1), 0, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibl, (s->nb + 1), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, (1 + s->nc), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibl, (1 + s->nb), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 9: case 13: case 17: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, (s->nf + 1), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibr, (s->nb + 1), 0, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibl, (s->nb + 1), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, (1 + s->nc), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibr, (1 + s->nb), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 18: case 19: {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x, (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 20: case 21: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x,
+ (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = ((21 == arrow->type) ? (s->ifr) : (0));
+ wxd2lah_sp_ah_bspline(
+ job, s, ss, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ic].x,
+ (s->ppoints)[s->nf + s->ic].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[ss].x, (s->ppoints)[ss].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 22 : {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x, (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ } break;
+ case 23: case 24: {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x, (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 25: case 26: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x,
+ (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = ((26 == arrow->type) ? (s->ifr) : (0));
+ wxd2lah_sp_ah_bspline(
+ job, s, ss, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ic].x,
+ (s->ppoints)[s->nf + s->ic].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 27: case 28: {
+ dk4pppt_circle(
+ job->ppp, s->x0, s->y0,
+ ((s->lw * (double)(arrow->length)) / 2.0), NULL, backptr, erp
+ );
+ } break;
+ case 29: {
+ dk4pppt_newpath_moveto(job->ppp, s->x0, s->y0, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, s->x1, s->y1, NULL, backptr, erp);
+ } break;
+ default : {
+
+#line 3388 "wxd2lah.ctr"
+ } break;
+ }
+
+
+#line 3391 "wxd2lah.ctr"
+}
+
+
+
+/** Draw one arrowhead on spline.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_spline(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ sp_ah_t spah;
+
+
+#line 3418 "wxd2lah.ctr"
+ /*
+ Initialize struture.
+ */
+ spah.ppoints = NULL;
+ spah.nf = 0;
+ spah.nb = 0;
+ spah.nc = 0;
+ spah.ifl = 0;
+ spah.ifr = 0;
+ spah.ibl = 0;
+ spah.ibr = 0;
+ spah.ic = 0;
+ spah.to = 0.0;
+ spah.tb = 0.0;
+ spah.tc = 0.0;
+ spah.lo = 0.0;
+ spah.lb = 0.0;
+ spah.lc = 0.0;
+ spah.csgn = 0.0;
+ spah.lw = wxd2lat_object_linewidth(pobj, drw, job);
+
+ /*
+ Calculate points.
+ */
+ if (0 != wxd2lah_sp_ah_calc(&spah,arrow,job,pobj,isbck,backptr,erp)) {
+
+
+#line 3444 "wxd2lah.ctr"
+ /*
+ Set up stroke and fill attributes
+ */
+ wxd2lah_set_stroke_attributes(arrow, job, backptr, erp);
+ /*
+ Draw and/or fill the path following the points
+ */
+ switch (arrow->type) {
+ case 1: case 22: case 29: {
+
+#line 3453 "wxd2lah.ctr"
+ /*
+ Arrowheads to stroke
+ */
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ } break;
+ case 2: case 6: case 10: case 14: case 18: case 23: case 27: {
+ /*
+ White filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 3: case 7: case 11: case 15: case 24: case 19: case 28: {
+ /*
+ Color filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 4: case 5: case 8: case 9: case 12: case 13:
+ case 16: case 17: case 20: case 21: case 25: case 26: {
+ /*
+ Half-side filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 1, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ *backptr = 0;
+ }
+ if (NULL != spah.ppoints) {
+ dk4mem_free(spah.ppoints); spah.ppoints = NULL;
+ }
+
+
+#line 3565 "wxd2lah.ctr"
+}
+
+
+
+
+void
+wxd2lah_arrowhead(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 3582 "wxd2lah.ctr"
+ switch (pobj->ot) {
+ case WXD_OT_POLYLINE : {
+ wxd2lah_ah_polyline(arrow, drw, job, pobj, isbck, backptr, erp);
+ } break;
+ case WXD_OT_O_ARC : {
+ wxd2lah_ah_arc(arrow, drw, job, pobj, isbck, backptr, erp);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ wxd2lah_ah_spline(arrow, drw, job, pobj, isbck, backptr, erp);
+ } break;
+ }
+
+
+#line 3594 "wxd2lah.ctr"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxd2lah.ctr b/support/dktools/wxd2lah.ctr
new file mode 100644
index 0000000000..7268d43fa2
--- /dev/null
+++ b/support/dktools/wxd2lah.ctr
@@ -0,0 +1,3599 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Calculate offset and cut for one arrowhead.
+ @param parrow Arrow to calculate.
+ @param pobj Object the arrow belongs to.
+ @param pdrw Drawing structure.
+ @param pjob Job structure.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxd2lah_one_arrowhead(
+ wxd_arrow_t *parrow,
+ wxd_object_t *pobj,
+ wxd_drawing_t *pdrw,
+ wxd2lat_job_t *pjob
+);
+
+
+/** Calculate arrowhead data.
+ @param drw Drawing to produce output for.
+ @param job Job structure, probably modified.
+ @param fn Input file name
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxd2lah_calculate_arrowheads(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job
+);
+
+
+/** Draw one arrowhead for object.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+void
+wxd2lah_arrowhead(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+%% module
+
+#ifndef WXD2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+/** Calculate arrowhead segment on arc.
+ @param seg Segment to fill.
+ @param rs Radius at start.
+ @param re Radius at end.
+ @param as Angle alpha at start.
+ @param ae Angle alpha at end.
+ @param xc Center point x.
+ @param yc Center point y.
+*/
+
+static
+void
+wxd2lah_arc_arrow_segment(
+ arc_ah_seg_t *seg,
+ double rs,
+ double re,
+ double as,
+ double ae,
+ double xc,
+ double yc
+)
+{
+ double kappa;
+ double v;
+
+ kappa = dk4gratool_kappa_for_angle(fabs(ae - as));
+ seg->p[0].x = xc + rs * cos(as);
+ seg->p[0].y = yc + rs * sin(as);
+ seg->p[3].x = xc + re * cos(ae);
+ seg->p[3].y = yc + re * sin(ae);
+ v = (re-rs)*cos(as)-(ae-as)*rs*sin(as);
+ seg->p[1].x = seg->p[0].x + kappa * v;
+ v = (re-rs)*sin(as)+(ae-as)*rs*cos(as);
+ seg->p[1].y = seg->p[0].y + kappa * v;
+ v = (re-rs)*cos(ae)-(ae-as)*re*sin(ae);
+ seg->p[2].x = seg->p[3].x - kappa * v;
+ v = (re-rs)*sin(ae)+(ae-as)*re*cos(ae);
+ seg->p[2].y = seg->p[3].y - kappa * v;
+}
+
+
+
+/** Calculate square of a value.
+ @param x Side length.
+ @return Square area.
+*/
+static
+double
+wxd2lah_square(double x)
+{
+ return (x * x);
+}
+
+
+
+/** Calculate B-spline through 3 x values for t values -1, 0 and 1.
+ @param p1 Address of variable for dx/dt at t=-1 (output).
+ @param p2 Address of variable for dx/dt at t=0 (output).
+ @param p3 Address of variable for dx/dt at t=1 (output).
+ @param xu X value at t=-1 (input).
+ @param xv X value at t=0 (input).
+ @param xw X value at t=1 (input).
+*/
+static
+void
+wxd2lah_b_spline_derivatives(
+ double *p1,
+ double *p2,
+ double *p3,
+ double xu,
+ double xv,
+ double xw
+)
+{
+ *p1 = 2.0 * xv + (xw - xu) / 2.0 - xw - xu;
+ *p2 = (xw - xu) / 2.0;
+ *p3 = xw + xu + (xw - xu) / 2.0 - 2.0 * xv;
+}
+
+
+
+/** Calculate derivatives values for set of 3 points.
+ @param pd Destination array, derivatives are stored here.
+ @param ps Source array containing the original points.
+*/
+static
+void
+wxd2lah_sp_ah_b_spline_derivatives(
+ dk4_gra_point_t *pd,
+ dk4_gra_point_t *ps
+)
+{
+ wxd2lah_b_spline_derivatives(
+ &(pd[0].x), &(pd[1].x), &(pd[2].x), ps[0].x, ps[1].x, ps[2].x
+ );
+ wxd2lah_b_spline_derivatives(
+ &(pd[0].y), &(pd[1].y), &(pd[2].y), ps[0].y, ps[1].y, ps[2].y
+ );
+}
+
+
+
+/** Calculate point index for B-spline drawing.
+ @param i_start Start point index in point array.
+ @param npoints Number of points in spline.
+ @param backward Flag: Draw backwards.
+ @param i Index within spline.
+ @return Calculated index in array.
+*/
+static
+size_t
+wxd2lah_calculate_point_index(
+ size_t i_start,
+ size_t npoints,
+ int backward,
+ size_t i
+)
+{
+ size_t back = 0;
+ if (0 != backward) {
+ back = i_start + npoints - 1 - i;
+ }
+ else {
+ back = i_start + i;
+ }
+ return back;
+}
+
+
+
+/** Create B-spline path segment.
+ @param arrow Arrowhead structure.
+ @param job Job structure.
+ @param pobj Object arrow belongs to.
+ @param s Spline structure to use.
+ @param i_start Index of first point.
+ @param npoints Number of points.
+ @param backward Flag: Draw backwards.
+ @param mvto Flag: Use moveto at start.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_sp_ah_bspline(
+ wxd2lat_job_t *job,
+ sp_ah_t *s,
+ size_t i_start,
+ size_t npoints,
+ int backward,
+ int mvto,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t pd[4];
+ dk4_gra_point_t ps[4];
+ double v0[4]; /* Previous point: x, y, dx/dt, dy/dt */
+ double v1[4]; /* Current segment end point: x, y, dx/dt, dy/dt */
+#if 0
+ size_t ind;
+#endif
+ size_t i;
+ size_t iu;
+ size_t iv;
+ size_t iw;
+ $? "+ wxd2lah_sp_ah_bspline"
+#if 0
+ $? ". polyline test implementation"
+ for (i = 0; i < npoints; i++) {
+ ind = wxd2lah_calculate_point_index(i_start, npoints, backward, i);
+ if ((0 == i) && (0 != mvto)) {
+ dk4pppt_newpath_moveto(
+ job->ppp, (s->ppoints)[ind].x, (s->ppoints)[ind].y,
+ NULL, backptr, erp
+ );
+ }
+ if (0 < i) {
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[ind].x, (s->ppoints)[ind].y,
+ NULL, backptr, erp
+ );
+ }
+ }
+#else
+ $? ". real implementation (empty at this time)"
+ iu = wxd2lah_calculate_point_index(i_start, npoints, backward, 0);
+ iv = wxd2lah_calculate_point_index(i_start, npoints, backward, 1);
+ iw = wxd2lah_calculate_point_index(i_start, npoints, backward, 2);
+ ps[0].x = (s->ppoints)[iu].x;
+ ps[0].y = (s->ppoints)[iu].y;
+ ps[1].x = (s->ppoints)[iv].x;
+ ps[1].y = (s->ppoints)[iv].y;
+ ps[2].x = (s->ppoints)[iw].x;
+ ps[2].y = (s->ppoints)[iw].y;
+ wxd2lah_sp_ah_b_spline_derivatives(pd, ps);
+ v0[0] = (s->ppoints)[iu].x;
+ v0[1] = (s->ppoints)[iu].y;
+ v0[2] = pd[0].x / 3.0;
+ v0[3] = pd[0].y / 3.0;
+ if (0 != mvto) {
+ dk4pppt_newpath_moveto(job->ppp, v0[0], v0[1], NULL, backptr, erp);
+ }
+ for (i = 1; i < npoints; i++) {
+ /*
+ i is the index of the point at segment end
+ */
+ if ((npoints - 1) == i) {
+ iw = npoints - 1;
+ iv = npoints - 2;
+ iu = npoints - 3;
+ }
+ else {
+ iu = i - 1;
+ iv = i;
+ iw = i + 1;
+ }
+ iu = wxd2lah_calculate_point_index(i_start, npoints, backward, iu);
+ iv = wxd2lah_calculate_point_index(i_start, npoints, backward, iv);
+ iw = wxd2lah_calculate_point_index(i_start, npoints, backward, iw);
+ ps[0].x = (s->ppoints)[iu].x;
+ ps[0].y = (s->ppoints)[iu].y;
+ ps[1].x = (s->ppoints)[iv].x;
+ ps[1].y = (s->ppoints)[iv].y;
+ ps[2].x = (s->ppoints)[iw].x;
+ ps[2].y = (s->ppoints)[iw].y;
+ wxd2lah_sp_ah_b_spline_derivatives(pd, ps);
+ if ((npoints - 1) == i) {
+ v1[0] = (s->ppoints)[iw].x;
+ v1[1] = (s->ppoints)[iw].y;
+ v1[2] = pd[2].x / 3.0;
+ v1[3] = pd[2].y / 3.0;
+ }
+ else {
+ v1[0] = (s->ppoints)[iv].x;
+ v1[1] = (s->ppoints)[iv].y;
+ v1[2] = pd[1].x / 3.0;
+ v1[3] = pd[1].y / 3.0;
+ }
+ dk4pppt_curveto(
+ job->ppp,
+ (v0[0] + v0[2]), (v0[1] + v0[3]),
+ (v1[0] - v1[2]), (v1[1] - v1[3]),
+ v1[0], v1[1],
+ NULL, backptr, erp
+ );
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+#endif
+ $? "- wxd2lah_sp_ah_bspline"
+}
+
+
+
+/** Calculate length of a sub interval.
+ @param xstart Start position of interval.
+ @param xend End position of interval.
+ @param i Number of segments contained in subinterval.
+ @param segments Number of segments used for interval.
+ @return Length of the subinterval.
+*/
+static
+double
+wxd2lah_partial_length(
+ double xstart,
+ double xend,
+ size_t i,
+ size_t segments
+)
+{
+ double back;
+ back = xstart + ((xend - xstart) * (double)i)/((double)segments);
+ return back;
+}
+
+
+
+/** Check whether arrow length and width is large enough (not 0).
+ @param parrow Arrowhead to check.
+ @param pobj Object arrowhead is attached to.
+ @param pdrw Drawing containing the object.
+ @param pjob Job structure, application used for diagnostics.
+ @return 1 on success, 0 if error found.
+*/
+static
+int
+wxd2lah_check_arrow_length_width(
+ wxd_arrow_t *parrow,
+ wxd2lat_job_t *pjob
+)
+{
+ int back = 0;
+ switch (parrow->type) {
+ case 0: {
+ /* No arrowhead, so no width/height requirements */
+ back = 1;
+ } break;
+ case 27: case 28: {
+ /* Just length required */
+ if ((uint8_t)0U != parrow->length) {
+ back = 1;
+ }
+ else {
+ /* ERROR: Positive length required for arrowhead */
+ dk4app_log_1(
+ pjob->app, pjob->msg, pjob->sz_msg, DK4_LL_ERROR, 24
+ );
+ }
+ } break;
+ case 29: {
+ /* Just width required */
+ if ((uint8_t)0U != parrow->width) {
+ back = 1;
+ }
+ else {
+ /* ERROR: Positive width required for arrowhead */
+ dk4app_log_1(
+ pjob->app, pjob->msg, pjob->sz_msg, DK4_LL_ERROR, 25
+ );
+ }
+ } break;
+ default: {
+ /* Both length and width required */
+ if (
+ ((uint8_t)0U != parrow->length)
+ && ((uint8_t)0U != parrow->width)
+ ) {
+ back = 1;
+ }
+ else {
+ /* ERROR: Positive width and height required on arrow */
+ dk4app_log_1(
+ pjob->app, pjob->msg, pjob->sz_msg, DK4_LL_ERROR, 25
+ );
+ }
+ } break;
+ }
+ return back;
+}
+
+
+
+int
+wxd2lah_one_arrowhead(
+ wxd_arrow_t *parrow,
+ wxd_object_t *pobj,
+ wxd_drawing_t *pdrw,
+ wxd2lat_job_t *pjob
+)
+{
+ double l; /* Line width */
+ double h; /* Arrow length */
+ double w; /* Arrow width */
+ double cmin; /* Minimum cut */
+ double cmax; /* Maximum cut */
+ int back = 1;
+ $? "+ wxd2lah_one_arrowhead"
+ l = wxd2lat_object_linewidth(pobj, pdrw, pjob);
+ if (0.0 < l) {
+ h = l * parrow->length;
+ w = l * parrow->width;
+ if (0 != wxd2lah_check_arrow_length_width(parrow, pjob)) {
+ switch (parrow->type) {
+ case 1: case 2: case 3: case 4: case 5: case 6: case 7:
+ case 8: case 9: case 10: case 11: case 12: case 13: case 14:
+ case 15: case 16: case 17: {
+ switch (parrow->type) {
+ case 10: case 11: case 12: case 13: {
+ h = (3.0 * h) / 4.0;
+ } break;
+ case 14: case 15: case 16: case 17: {
+ h = h / 2.0;
+ } break;
+ }
+ parrow->offset = (l * sqrt(h * h + ((w * w) / 4.0))) / w;
+ cmax = 2.0 * parrow->offset;
+ switch (pobj->csfs) {
+ case WXD_LC_ROUNDED: {
+ cmin = parrow->offset;
+ parrow->cut = (cmax + cmin) / 2.0;
+ parrow->cuttol = (cmax - cmin) / 4.0;
+ } break;
+ default: {
+ cmin = (l * h) / w;
+ parrow->cut = (cmax + cmin) / 2.0;
+ parrow->cuttol = (cmax - cmin) / 4.0;
+ if (WXD_LC_PROJECTING == pobj->csfs) {
+ parrow->cut += (l / 2.0);
+ }
+ } break;
+ }
+ } break;
+ case 18: case 19: case 20: case 21: case 22: case 23: case 24:
+ case 25: case 26: case 29: {
+ parrow->offset = l / 2.0;
+ switch (pobj->csfs) {
+ case WXD_LC_ROUNDED: {
+ parrow->cut = (3.0 * l) / 4.0;
+ parrow->cuttol = l / 8.0;
+ } break;
+ default: {
+ parrow->cut = l / 2.0;
+ parrow->cuttol = l / 4.0;
+ if (WXD_LC_PROJECTING == pobj->csfs) {
+ parrow->cut += (l / 2.0);
+ }
+ } break;
+ }
+ } break;
+ case 27: case 28: {
+ parrow->offset = l / 2.0;
+ switch (pobj->csfs) {
+ case WXD_LC_ROUNDED: {
+ parrow->cut = (3.0 * l) / 4.0;
+ parrow->cuttol = l / 8.0;
+ } break;
+ default: {
+ cmin = (
+ (h + l)
+ * ( 1.0
+ + sqrt(
+ 1.0
+ - wxd2lah_square(w/(h+l))
+ )
+ )
+ ) / 2.0;
+ cmax = l;
+ parrow->cut = (cmax + cmin) / 2.0;
+ parrow->cuttol = (cmax - cmin) / 4.0;
+ if (WXD_LC_PROJECTING == pobj->csfs) {
+ parrow->cut += (l / 2.0);
+ }
+ } break;
+ }
+ } break;
+ }
+ }
+ else {
+ /* ERROR: Width and height (already reported) */
+ back = 0;
+ }
+ }
+ else {
+ /* ERROR: Line width */
+ dk4app_log_1(
+ pjob->app, pjob->msg, pjob->sz_msg, DK4_LL_ERROR, 27
+ );
+ back = 0;
+ }
+ $? "- wxd2lah_one_arrowhead %d", back
+ return back;
+}
+
+
+
+/** Build path to stroke or fill arrowhead.
+ @param arrow Arrowhead to draw.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Graphics object arrowhead is attached to.
+ @param p Point set.
+ @param szp Number of points in point set.
+ @param stage Stage in arrowhead building.
+ @param lw Line width.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+static
+void
+wxd2lah_build_path(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ dk4_gra_point_t *p,
+ int stage,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ switch (arrow->type) {
+ case 1: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ } break;
+ case 2: case 3: case 23: case 24: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 4: case 5: case 25: case 26: {
+ switch (stage) {
+ case 1: {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[3].x, p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ default : {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[0].x, p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ }
+ } break;
+ case 6: case 7: case 10: case 11: case 14: case 15:
+ case 18: case 19: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ switch (stage) {
+ case 1: {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[3].x, p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ default : {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[0].x, p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ }
+ } break;
+ case 20: case 21: {
+ switch (stage) {
+ case 1: {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[0].x, p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[4].x,p[4].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[5].x,p[5].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ default : {
+ dk4pppt_newpath_moveto(
+ job->ppp, p[0].x, p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[0].x,p[0].y, NULL, backptr, erp);
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ }
+ } break;
+ case 22: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[2].x,p[2].y, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, p[3].x,p[3].y, NULL, backptr, erp);
+ } break;
+ case 27: case 28: {
+ dk4pppt_circle(
+ job->ppp, p[0].x, p[0].y,
+ ((lw * (double)(arrow->length)) / 2.0), NULL, backptr, erp
+ );
+ } break;
+ case 29: {
+ dk4pppt_newpath_moveto(job->ppp,p[0].x,p[0].y,NULL,backptr,erp);
+ dk4pppt_lineto(job->ppp, p[1].x,p[1].y, NULL, backptr, erp);
+ } break;
+ }
+}
+
+
+
+/** Set stroke attributes for arrowhead.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_set_stroke_attributes(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4pppt_set_line_style(job->ppp, DK4_GRA_LS_SOLID, 4.0, backptr, erp);
+ switch (arrow->type) {
+ case 1: case 22: {
+ dk4pppt_set_line_cap(job->ppp,DK4_GRA_LC_ROUNDED,backptr,erp);
+ dk4pppt_set_line_join(
+ job->ppp, DK4_GRA_LJ_MITERED, 8, backptr, erp
+ );
+ } break;
+ case 29: {
+ dk4pppt_set_line_cap(job->ppp,DK4_GRA_LC_ROUNDED,backptr,erp);
+ } break;
+ case 27: case 28: {
+ /* empty by intent */
+ } break;
+ default: {
+ dk4pppt_set_line_join(
+ job->ppp, DK4_GRA_LJ_MITERED, 8, backptr, erp
+ );
+ } break;
+ }
+}
+
+
+
+/** Draw one arrowhead on polyline.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_head_angle_polyline(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ dk4_gra_point_t *p,
+ dk4_gra_point_t *phead,
+ double alpha,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t npoints = 0;
+ size_t i;
+ /*
+ Build path points
+ */
+ switch (arrow->type) {
+ case 1: case 2: case 3: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - p[0].y;
+ p[2].x = p[0].x;
+ npoints = 3;
+ } break;
+ case 4: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 5: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 6: case 7: case 8: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 9: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 10: case 11: case 12: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 13: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - 0.75 * lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 14: case 15: case 16: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - 0.5 * lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - 0.5 * lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 17: {
+ p[1].y = 0.0;
+ p[1].x = 0.0;
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - 0.5 * lw * (double)(arrow->length);
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0 - 0.5 * lw * (double)(arrow->length);
+ p[3].y = 0.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ npoints = 4;
+ } break;
+ case 18: case 19: {
+ p[0].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0;
+ p[1].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = (lw * (double)(arrow->width)) / 2.0;
+ npoints = 4;
+ } break;
+ case 20: {
+ p[0].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0;
+ p[1].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = (lw * (double)(arrow->width)) / 2.0;
+ p[4].x = 0.0;
+ p[4].y = 0.0;
+ p[5].x = 0.0 - lw * (double)(arrow->length);
+ p[5].y = 0.0;
+ npoints = 6;
+ } break;
+ case 21: {
+ p[1].x = 0.0;
+ p[1].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0;
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[4].x = 0.0;
+ p[4].y = 0.0;
+ p[5].x = 0.0 - lw * (double)(arrow->length);
+ p[5].y = 0.0;
+ npoints = 6;
+ } break;
+ case 22: {
+ p[0].x = 0.0 - lw * (double)(arrow->length);
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0;
+ p[1].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0;
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[3].x = 0.0 - lw * (double)(arrow->length);
+ p[3].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ npoints = 4;
+ } break;
+ case 23: case 24: {
+ p[0].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0 - lw * (double)(arrow->length);
+ p[1].y = 0.0;
+ p[2].x = 0.0;
+ p[2].y = 0.0 - p[0].y;
+ npoints = 3;
+ } break;
+ case 25: {
+ p[1].y = 0.0;
+ p[1].x = 0.0 - lw * (double)(arrow->length);
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0;
+ p[2].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0;
+ p[3].y = 0.0;
+ p[3].x = 0.0;
+ npoints = 4;
+ } break;
+ case 26: {
+ p[1].y = 0.0;
+ p[1].x = 0.0 - lw * (double)(arrow->length);
+ p[2].y = (lw * (double)(arrow->width)) / 2.0;
+ p[2].x = 0.0;
+ p[0].y = 0.0 - (lw * (double)(arrow->width)) / 2.0;
+ p[0].x = 0.0;
+ p[3].y = 0.0;
+ p[3].x = 0.0;
+ npoints = 4;
+ } break;
+ case 27: case 28: {
+ p[0].x = 0.0 - (lw * (double)(arrow->length)) / 2.0;
+ p[0].y = 0.0;
+ npoints = 1;
+ } break;
+ case 29: {
+ p[0].x = 0.0;
+ p[0].y = (lw * (double)(arrow->width)) / 2.0;
+ p[1].x = 0.0;
+ p[1].y = 0.0 - p[0].y;
+ npoints = 2;
+ } break;
+ }
+ /* Rotate and shift the points
+ */
+ for (i = 0; i < npoints; i++) {
+ dk4gratool_rotate_point(&(p[i]), alpha);
+ p[i].x += phead->x;
+ p[i].y += phead->y;
+ }
+ /* Set up stroke attributes
+ */
+ wxd2lah_set_stroke_attributes(arrow, job, backptr, erp);
+#if 0
+ dk4pppt_set_line_style(job->ppp, DK4_GRA_LS_SOLID, 4.0, backptr, erp);
+ switch (arrow->type) {
+ case 1: case 22: {
+ dk4pppt_set_line_cap(job->ppp,DK4_GRA_LC_ROUNDED,backptr,erp);
+ dk4pppt_set_line_join(
+ job->ppp, DK4_GRA_LJ_MITERED, 8, backptr, erp
+ );
+ } break;
+ case 29: {
+ dk4pppt_set_line_cap(job->ppp,DK4_GRA_LC_ROUNDED,backptr,erp);
+ } break;
+ case 27: case 28: {
+ /* empty by intent */
+ } break;
+ default: {
+ dk4pppt_set_line_join(
+ job->ppp, DK4_GRA_LJ_MITERED, 8, backptr, erp
+ );
+ } break;
+ }
+#endif
+ /*
+ Use path
+ */
+ switch (arrow->type) {
+ case 1: case 22: case 29: {
+ /*
+ Arrowheads to stroke
+ */
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ } break;
+ case 2: case 6: case 10: case 14: case 18: case 23: case 27: {
+ /*
+ White filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 3: case 7: case 11: case 15: case 24: case 19: case 28: {
+ /*
+ Color filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 4: case 5: case 8: case 9: case 12: case 13:
+ case 16: case 17: case 20: case 21: case 25: case 26: {
+ /*
+ Half-side filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 0, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_build_path(
+ arrow, job, p, 1, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ } break;
+ }
+}
+
+
+
+/** Draw one arrowhead on polyline.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_polyline(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_point_t p[8]; /* Points to construct arrowhead path */
+ dk4_gra_point_t head; /* Point where arrowhead ends */
+ dk4_gra_point_t *pptr; /* Destination for copy operation */
+ double alpha; /* Direction of arrowhead */
+ double lw; /* Line width */
+ double x0; /* Start point X to calculate angle */
+ double y0; /* Start point Y to calculate angle */
+ double x1; /* End point X to calculate angle */
+ double y1; /* End point Y to calculate angle */
+
+ $? "+ wxd2lah_ah_polyline"
+ /*
+ Find line width used by object
+ */
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ /*
+ Find head point and angle
+ */
+ if (0 != isbck) {
+ DK4_MEMCPY(&head,(pobj->det).p.p,sizeof(wxd_point_t));
+ x1 = ((pobj->det).p.p)[0].x;
+ y1 = ((pobj->det).p.p)[0].y;
+ x0 = ((pobj->det).p.p)[1].x;
+ y0 = ((pobj->det).p.p)[1].y;
+ }
+ else {
+ pptr = (pobj->det).p.p;
+ pptr = &(pptr[(pobj->det).p.n - (uint16_t)1U]);
+ DK4_MEMCPY(&head,pptr,sizeof(wxd_point_t));
+ x1 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)1U].x;
+ y1 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)1U].y;
+ x0 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)2U].x;
+ y0 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)2U].y;
+ }
+ y1 = y1 - y0;
+ x1 = x1 - x0;
+ /*
+ 2019-03-15: BUGFIX
+ Changed and condition to or condition.
+ It is sufficient to have one of the distances unequal 0.
+ */
+ if ((1.0e-8 < fabs(y1)) || (1.0e-8 < fabs(x1))) {
+ /*
+ Find angle
+ */
+ alpha = atan2(y1, x1);
+ /*
+ Move head point by arrow offset
+ */
+ p[0].x = 0.0 - arrow->offset;
+ p[0].y = 0.0;
+ dk4gratool_rotate_point(&(p[0]), alpha);
+ head.x += p[0].x;
+ head.y += p[0].y;
+ wxd2lah_ah_head_angle_polyline(
+ arrow, job, pobj, p, &head, alpha, lw, backptr, erp
+ );
+ }
+ else { $? "! angle"
+ *backptr = 0;
+ /* ERROR: Failed to calculate angle for arrowhead */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 28
+ );
+ }
+ $? "- wxd2lah_ah_polyline"
+}
+
+
+
+/** Calculate segments for real arc.
+ @param arrow Arrowhead structure.
+ @param job Job structure.
+ @param pobj Object arrow belongs to.
+ @param ah Angle at head of arrow.
+ @param csgn Coefficient for angles departing from head (1 or -1).
+ @param lw Line width.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_segs_real_arc(
+ arc_ah_seg_t *s,
+ wxd_arrow_t *arrow,
+ wxd_object_t *pobj,
+ double ah,
+ double csgn,
+ double lw
+)
+{
+ $? "+ wxd2lah_ah_segs_real_arc %d %g", (int)(arrow->type), ah
+ switch (arrow->type) {
+ case 1: case 2: case 3: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 4: case 5: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 6: case 7: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[3]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 8: case 9: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[3]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[4]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 10: case 11: case 12: case 13: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[3]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.75*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[4]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 14: case 15: case 16: case 17: {
+#if TRACE_DEBUG
+ size_t i;
+ size_t j;
+#endif
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.5*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.5*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.5*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[3]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (pobj->det).a.r,
+ (ah+((0.5*csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[4]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+#if TRACE_DEBUG
+ for (i = 0; i < 5; i++) {
+ $? ". segment %u", (unsigned)i
+ for (j = 0; j < 4; j++) {
+ $? ". point %u x = %g", (unsigned)j, s[i].p[j].x
+ $? ". point %u y = %g", (unsigned)j, s[i].p[j].y
+ }
+ }
+#endif
+ } break;
+ case 18: case 19: case 20: case 21: case 22: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ case 23: case 24: case 25: case 26: {
+ wxd2lah_arc_arrow_segment(
+ &(s[0]),
+ (pobj->det).a.r,
+ ((pobj->det).a.r+((lw*(double)(arrow->width))/2.0)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[1]),
+ (pobj->det).a.r,
+ ((pobj->det).a.r-((lw*(double)(arrow->width))/2.0)),
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ wxd2lah_arc_arrow_segment(
+ &(s[2]),
+ (pobj->det).a.r,
+ (pobj->det).a.r,
+ (ah+((csgn*lw*((double)(arrow->length)))/(pobj->det).a.r)),
+ ah,
+ (pobj->det).a.x, (pobj->det).a.y
+ );
+ } break;
+ }
+ $? "- wxd2lah_ah_segs_real_arc"
+}
+
+
+
+/** Create path for arrowhead on real arc.
+ @param arrow Arrowhead structure.
+ @param job Job structure.
+ @param pobj Object arrow belongs to.
+ @param ahead Angle at head of arrow.
+ @param csgn Coefficient for angles departing from head (1 or -1).
+ @param lw Line width.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_path_real_arc(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ arc_ah_seg_t *s,
+ int stage,
+ double ahead,
+ double csgn,
+ double lw,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double xc; /* Circle center point x */
+ double yc; /* Circle center point y */
+ double r; /* Circle radius */
+ size_t ss; /* Front segment on active side */
+ size_t ts; /* Butt segment on active side */
+ $? "+ wxd2lah_ah_path_real_arc"
+ switch (arrow->type) {
+ case 1: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ } break;
+ case 2: case 3: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 4: case 5: {
+ if (0 == stage) {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = (
+ (4 == arrow->type)
+ ? ((0.0 > csgn) ? (1) : (0))
+ : ((0.0 > csgn) ? (0) : (1))
+ );
+ dk4pppt_newpath_moveto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[ss].p[1].x, s[ss].p[1].y,
+ s[ss].p[2].x, s[ss].p[2].y,
+ s[ss].p[3].x, s[ss].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 6: case 7: case 10: case 11: case 14: case 15: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[3].p[1].x, s[3].p[1].y,
+ s[3].p[2].x, s[3].p[2].y,
+ s[3].p[3].x, s[3].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ $? ". stage %d direction %d", stage, (int)((pobj->det).a.d)
+ if (0 == stage) {
+ $? ". segment 0 forward"
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ $? ". segment 1 backward"
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ $? ". segment 3 forward"
+ dk4pppt_curveto(
+ job->ppp,
+ s[3].p[1].x, s[3].p[1].y,
+ s[3].p[2].x, s[3].p[2].y,
+ s[3].p[3].x, s[3].p[3].y,
+ NULL, backptr, erp
+ );
+ $? ". segment 2 backward"
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ $? ". closepath"
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = ((0.0 > csgn) ? (0) : (1));
+ ts = ((0.0 > csgn) ? (2) : (3));
+ switch (arrow->type) {
+ case 8: case 12: case 16: {
+ ss = ((0.0 > csgn) ? (1) : (0));
+ ts = ((0.0 > csgn) ? (3) : (2));
+ } break;
+ }
+ $? ". segment %d forward", (int)ss
+ dk4pppt_newpath_moveto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[ss].p[1].x, s[ss].p[1].y,
+ s[ss].p[2].x, s[ss].p[2].y,
+ s[ss].p[3].x, s[ss].p[3].y,
+ NULL, backptr, erp
+ );
+ $? ". segment 4 backward"
+ dk4pppt_curveto(
+ job->ppp,
+ s[4].p[2].x, s[4].p[2].y,
+ s[4].p[1].x, s[4].p[1].y,
+ s[4].p[0].x, s[4].p[0].y,
+ NULL, backptr, erp
+ );
+ $? ". segment %d backward", (int)ts
+ dk4pppt_curveto(
+ job->ppp,
+ s[ts].p[2].x, s[ts].p[2].y,
+ s[ts].p[1].x, s[ts].p[1].y,
+ s[ts].p[0].x, s[ts].p[0].y,
+ NULL, backptr, erp
+ );
+ $? ". closepath"
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 18: case 19: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 20: case 21: {
+ if (0 == stage) {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = (
+ (20 == arrow->type)
+ ? ((0.0 > csgn) ? (1) : (0))
+ : ((0.0 > csgn) ? (0) : (1))
+ );
+ dk4pppt_newpath_moveto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[ss].p[1].x, s[ss].p[1].y,
+ s[ss].p[2].x, s[ss].p[2].y,
+ s[ss].p[3].x, s[ss].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[2].p[3].x, s[2].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 22: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ } break;
+ case 23: case 24: {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 25: case 26: {
+ if (0 == stage) {
+ dk4pppt_newpath_moveto(
+ job->ppp, s[0].p[0].x, s[0].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[0].p[1].x, s[0].p[1].y,
+ s[0].p[2].x, s[0].p[2].y,
+ s[0].p[3].x, s[0].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[1].p[3].x, s[1].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[1].p[2].x, s[1].p[2].y,
+ s[1].p[1].x, s[1].p[1].y,
+ s[1].p[0].x, s[1].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = (
+ (25 == arrow->type)
+ ? ((0.0 > csgn) ? (1) : (0))
+ : ((0.0 > csgn) ? (0) : (1))
+ );
+ dk4pppt_newpath_moveto(
+ job->ppp, s[ss].p[0].x, s[ss].p[0].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[ss].p[1].x, s[ss].p[1].y,
+ s[ss].p[2].x, s[ss].p[2].y,
+ s[ss].p[3].x, s[ss].p[3].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, s[2].p[3].x, s[2].p[3].y, NULL, backptr, erp
+ );
+ dk4pppt_curveto(
+ job->ppp,
+ s[2].p[2].x, s[2].p[2].y,
+ s[2].p[1].x, s[2].p[1].y,
+ s[2].p[0].x, s[2].p[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 27: case 28: {
+ xc = (pobj->det).a.r * cos(ahead) + (pobj->det).a.x;
+ yc = (pobj->det).a.r * sin(ahead) + (pobj->det).a.y;
+ r = (lw * (double)(arrow->length)) / 2.0;
+ xc += (csgn * r * cos(ahead + M_PI_2));
+ yc += (csgn * r * sin(ahead + M_PI_2));
+ dk4pppt_circle(job->ppp, xc, yc, r, NULL, backptr, erp);
+ } break;
+ case 29: {
+ r = (pobj->det).a.r + (lw * (double)(arrow->width)) / 2.0;
+ xc = (pobj->det).a.x + r * cos(ahead);
+ yc = (pobj->det).a.y + r * sin(ahead);
+ dk4pppt_newpath_moveto(job->ppp, xc, yc, NULL, backptr, erp);
+ r = (pobj->det).a.r - (lw * (double)(arrow->width)) / 2.0;
+ xc = (pobj->det).a.x + r * cos(ahead);
+ yc = (pobj->det).a.y + r * sin(ahead);
+ dk4pppt_lineto(job->ppp, xc, yc, NULL, backptr, erp);
+ } break;
+ }
+ $? "- wxd2lah_ah_path_real_arc"
+}
+
+
+
+/** Draw one arrowhead on real arc.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_real_arc(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ arc_ah_seg_t s[8]; /* Arrowhead segments */
+ double lw; /* Line width */
+ double csgn; /* Coefficient for angle, departing from head */
+ double ah; /* Head alpha */
+ $? "+ wxd2lah_ah_real_arc"
+ /*
+ Setup
+ */
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ csgn = (
+ (0 != isbck)
+ ? ((0 < (pobj->det).a.d) ? (1.0) : (-1.0))
+ : ((0 > (pobj->det).a.d) ? (1.0) : (-1.0))
+ );
+ ah = (
+ (0 != isbck)
+ ? ((pobj->det).a.a + (csgn * (arrow->offset) / (pobj->det).a.r))
+ : ((pobj->det).a.b + (csgn * (arrow->offset) / (pobj->det).a.r))
+ );
+ /* Create segment data.
+ */
+ wxd2lah_ah_segs_real_arc(s, arrow, pobj, ah, csgn, lw);
+ /*
+ Set up stroke and fill attributes
+ */
+ wxd2lah_set_stroke_attributes(arrow, job, backptr, erp);
+ /*
+ Use path
+ */
+ switch (arrow->type) {
+ case 1: case 22: case 29: {
+ /*
+ Arrowheads to stroke
+ */
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ } break;
+ case 2: case 6: case 10: case 14: case 18: case 23: case 27: {
+ /*
+ White filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 3: case 7: case 11: case 15: case 24: case 19: case 28: {
+ /*
+ Color filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 4: case 5: case 8: case 9: case 12: case 13:
+ case 16: case 17: case 20: case 21: case 25: case 26: {
+ /*
+ Half-side filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 0, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_ah_path_real_arc(
+ arrow, job, pobj, s, 1, ah, csgn, lw, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ } break;
+ }
+ $? "- wxd2lah_ah_real_arc"
+}
+
+
+
+/** Draw one arrowhead on malformed arc.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_malformed_arc(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+ dk4_gra_point_t p[8]; /* Points to construct arrowhead path */
+ dk4_gra_point_t orig; /* Original end point of line */
+ dk4_gra_point_t head; /* Shifted end point for arrowhead */
+ double lw; /* Line width */
+ double alpha; /* Rotation angle in end point */
+ $? "+ wxd2lah_ah_malformed_arc"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ if (
+ ((1 != isbck) && (0 != (pobj->ab).type))
+ || ((0 != isbck) && (0 != (pobj->af).type))
+ ) {
+ if (
+ (0 != isbck)
+ && (
+ ((pobj->det).a.x1 != (pobj->det).a.x2)
+ || ((pobj->det).a.y1 != (pobj->det).a.y2)
+ )
+ ) {
+ alpha = atan2(
+ ((double)((pobj->det).a.y1 - (pobj->det).a.y2)),
+ ((double)((pobj->det).a.x1 - (pobj->det).a.x2))
+ );
+ orig.x = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x1));
+ orig.y = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.y1));
+ if (0 != dk4ma_is_finite(alpha)) {
+ head.x = 0.0 - arrow->offset;
+ head.y = 0.0;
+ dk4gratool_rotate_point(&head, alpha);
+ head.x += orig.x;
+ head.y += orig.y;
+ wxd2lah_ah_head_angle_polyline(
+ arrow, job, pobj, p, &head, alpha, lw, backptr, erp
+ );
+ }
+ }
+ if (
+ (0 == isbck)
+ && (
+ ((pobj->det).a.x3 != (pobj->det).a.x2)
+ || ((pobj->det).a.y3 != (pobj->det).a.y2)
+ )
+ ) {
+ alpha = atan2(
+ ((double)((pobj->det).a.y3 - (pobj->det).a.y2)),
+ ((double)((pobj->det).a.x3 - (pobj->det).a.x2))
+ );
+ orig.x = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x3));
+ orig.y = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.y3));
+ if (0 != dk4ma_is_finite(alpha)) {
+ head.x = 0.0 - arrow->offset;
+ head.y = 0.0;
+ dk4gratool_rotate_point(&head, alpha);
+ head.x += orig.x;
+ head.y += orig.y;
+ wxd2lah_ah_head_angle_polyline(
+ arrow, job, pobj, p, &head, alpha, lw, backptr, erp
+ );
+ }
+ }
+ }
+ $? "- wxd2lah_ah_malformed_arc"
+}
+
+
+
+/** Draw one arrowhead on arc.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_arc(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lah_ah_arc"
+ if (0 != (pobj->det).a.d) {
+ wxd2lah_ah_real_arc(arrow, drw, job, pobj, isbck, backptr, erp);
+ }
+ else {
+ wxd2lah_ah_malformed_arc(arrow, drw, job, pobj, isbck, backptr, erp);
+ }
+ $? "- wxd2lah_ah_arc"
+}
+
+
+
+/** Calculate number points for spline arrowhead, allocate memory.
+ @param s Spline arrowhead structure to fill.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lah_sp_ah_npoints(
+ sp_ah_t *s,
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ dk4_er_t *erp
+)
+{
+ dk4_er_t er;
+#if 0
+ double l;
+#endif
+ double t;
+ size_t np;
+ int back = 0;
+ int res = 0;
+ int res2 = 0;
+ int e_o = 0; /* Overflow */
+ int e_i = 0; /* Iteration */
+ int e_m = 0; /* Memory allocation */
+ $? "+ wxd2lah_sp_ah_npoints"
+ dk4error_init(&er);
+ if (0 != isbck) { $? ". backward"
+ s->csgn = 1.0;
+ s->lo = arrow->offset;
+ }
+ else { $? ". forward"
+ s->csgn = -1.0;
+ s->lo = (pobj->det).s.suml - arrow->offset;
+ }
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lo, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 != res) { $? ". t_offset = %g", t
+ s->to = t;
+ switch (arrow->type) {
+ case 1: case 2: case 3: { $? ". arrow type 1"
+ s->lb = s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 != res) { $? ". t_back = %g", t
+ s->tb = t;
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ ); $? ". delta_t = %g", fabs(s->tb - s->to)
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ } $? ". nf = %u", (unsigned)(s->nf)
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ np = dk4ma_size_t_mul(s->ifr, 2, &er);
+ s->ibl = np; $? ". np = %u", (unsigned)np
+ if (DK4_E_NONE == er.ec) { $? ". size calc"
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) { $? ". allocation"
+ back = 1;
+ }
+ else { $? "! allocation"
+ e_m = 1;
+ }
+ }
+ else { $? "! size calculation"
+ e_o = 1;
+ }
+ }
+ else { $? "! parameter for length"
+ e_i = 1;
+ }
+ } break;
+ case 4: case 5: {
+ s->lb = s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 != res) { $? ". t_back = %g", t
+ s->tb = t;
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ ); $? ". delta_t = %g", fabs(s->tb - s->to)
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ } $? ". nf = %u", (unsigned)(s->nf)
+ s->nc = s->nf;
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ s->ic = dk4ma_size_t_mul(s->ifr, 2, &er);
+ np = dk4ma_size_t_mul(s->ifr, 3, &er);
+ s->ibl = np; $? ". np = %u", (unsigned)np
+ if (DK4_E_NONE == er.ec) { $? ". size calc"
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) { $? ". allocation"
+ back = 1;
+ }
+ else { $? "! allocation"
+ e_m = 1;
+ }
+ }
+ else { $? "! size calculation"
+ e_o = 1;
+ }
+ }
+ else { $? "! parameter for length"
+ e_i = 1;
+ }
+ } break;
+ case 6: case 7: case 8: case 9:
+ case 10: case 11: case 12: case 13:
+ case 14: case 15: case 16: case 17: { $? ". arrow type 6/7/8/9"
+ switch (arrow->type) {
+ case 6: case 7: case 8: case 9: {
+ s->lb =
+ s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ s->lc =
+ s->lo + 0.75 * s->csgn * (double)(arrow->length) * s->lw;
+ } break;
+ case 10: case 11: case 12: case 13: {
+ s->lb =
+ s->lo + 0.75 * s->csgn * (double)(arrow->length) * s->lw;
+ s->lc =
+ s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ } break;
+ case 14: case 15: case 16: case 17: {
+ s->lb =
+ s->lo + 0.5 * s->csgn * (double)(arrow->length) * s->lw;
+ s->lc =
+ s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ } break;
+ }
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ s->tb = t;
+ t = 0.0;
+ res2 = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lc, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ s->tc = t;
+ if ((0 != res) && (0 != res2)) { $? ". t_back = %g", t
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ ); $? ". delta_t = %g", fabs(s->tb - s->to)
+ s->nb = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->tc) * (double)((job->grco).xsss)),
+ &er
+ );
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ s->nc = dk4ma_size_t_from_double(
+ ceil(
+ fabs(
+ (s->tc - s->to) * (double)((job->grco).xsss)
+ )
+ ),
+ &er
+ );
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ if (2 > s->nb) { s->nb = 2; }
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ if (2 > s->nc) { s->nc = 2; }
+ } break;
+ }
+ } $? ". nf = %u", (unsigned)(s->nf)
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ s->ibl = dk4ma_size_t_mul(s->ifr, 2, &er);
+ s->ibr = dk4ma_size_t_add(s->ibl, s->nb, &er);
+ s->ibr = dk4ma_size_t_add(s->ibr, 1, &er);
+ np = dk4ma_size_t_add(s->nf, s->nb, &er);
+ np = dk4ma_size_t_add(np, 2, &er);
+ np = dk4ma_size_t_mul(np, 2, &er);
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ s->ic = np;
+ np = dk4ma_size_t_add(np, s->nc, &er);
+ np = dk4ma_size_t_add(np, 1, &er);
+ } break;
+ }
+ $? ". nf = %u", (unsigned)(s->nf)
+ $? ". nb = %u", (unsigned)(s->nb)
+#if TRACE_DEBUG
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ $? ". nc = %u", (unsigned)(s->nc)
+ } break;
+ }
+#endif
+ $? ". ifl = %u", (unsigned)(s->ifl)
+ $? ". ifr = %u", (unsigned)(s->ifr)
+ $? ". ibl = %u", (unsigned)(s->ibl)
+ $? ". ibr = %u", (unsigned)(s->ibr)
+#if TRACE_DEBUG
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ $? ". ic = %u", (unsigned)(s->ic)
+ } break;
+ }
+#endif
+ $? ". np = %u", (unsigned)np
+ if (DK4_E_NONE == er.ec) { $? ". size calc"
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) { $? ". allocation"
+ back = 1;
+ }
+ else { $? "! allocation"
+ e_m = 1;
+ }
+ }
+ else { $? "! size calculation"
+ e_o = 1;
+ }
+ }
+ else { $? "! parameter for length"
+ e_i = 1;
+ }
+ } break;
+ case 18: case 19: case 20: case 21: case 22: {
+ s->lb = s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ s->tb = t;
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ );
+ if (0 != res) {
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ np = dk4ma_size_t_mul(s->ifr, 2, &er);
+ switch (arrow->type) {
+ case 20: case 21: {
+ s->ic = np;
+ np = dk4ma_size_t_mul(s->ifr, 3, &er);
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) { $? ". allocation"
+ back = 1;
+ }
+ else { $? "! allocation"
+ e_m = 1;
+ }
+ }
+ else { $? "! overflow"
+ e_o = 1;
+ }
+ }
+ else { $? "! calculation"
+ e_o = 1;
+ }
+ }
+ else {
+ e_i = 1;
+ }
+ } break;
+ case 23: case 24: case 25: case 26: {
+ s->lb = s->lo + s->csgn * (double)(arrow->length) * s->lw;
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, s->lb, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 != res) {
+ s->tb = t;
+ s->nf = dk4ma_size_t_from_double(
+ ceil(fabs(s->tb - s->to) * (double)((job->grco).xsss)),
+ &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ if (2 > s->nf) { s->nf = 2; }
+ s->ifr = dk4ma_size_t_add(s->nf, 1, &er);
+ np = dk4ma_size_t_mul(s->ifr, 2, &er);
+ switch (arrow->type) {
+ case 25: case 26: {
+ s->ic = np;
+ np = dk4ma_size_t_mul(s->ifr, 3, &er);
+ } break;
+ }
+ if (DK4_E_NONE == er.ec) {
+ s->ppoints = dk4mem_new(wxd_point_t,np,&er);
+ if (NULL != s->ppoints) { $? ". allocation"
+ back = 1;
+ }
+ else {
+ e_m = 1;
+ }
+ }
+ else { $? "! overflow"
+ e_o = 1;
+ }
+ }
+ else { $? "! overflow"
+ e_o = 1;
+ }
+ }
+ else { $? "! iteration"
+ e_i = 1;
+ }
+ } break;
+ case 27: case 28: case 29: {
+ back = 1;
+ } break;
+ default: { $? "! unhandled arrow type"
+ /* ERROR: Unknown arrow type */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 29
+ );
+ } break;
+ }
+ }
+ else { $? "! parameter for length"
+ e_i = 1;
+ }
+ if (DK4_E_NONE != er.ec) {
+ back = 0;
+ dk4error_copy(erp, &er);
+ }
+ if (0 == back) {
+ if (0 != e_o) {
+ /* ERROR: Math overflow */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 30
+ );
+ }
+ if (0 != e_i) {
+ /* ERROR: Iteration failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 31
+ );
+ }
+ if (0 != e_m) {
+ /* ERROR: Memory allocation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 32
+ );
+ }
+ if ((0 == e_o) && (0 == e_i) && (0 == e_m)) {
+ /* ERROR: Failed to calculate number of points */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 33
+ );
+ }
+ }
+ $? "- wxd2lah_sp_ah_npoints %d", back
+ return back;
+}
+
+
+
+/** Calculate points for spline arrowhead.
+ @param s Spline arrowhead structure to fill.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+ */
+static
+int
+wxd2lah_sp_ah_calc(
+ sp_ah_t *s,
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+ )
+{
+ dk4_er_t er;
+ double v[4];
+ dk4_gra_point_t p;
+ size_t i;
+ double t;
+ double l;
+ int back = 0;
+ int res = 0;
+ int e_i = 0;
+ int e_o = 0;
+ int e_m = 0;
+ $? "+ wxd2lah_sp_ah_calc"
+ /* TODO: Implementation
+ */
+ dk4error_init(&er);
+ if (0 != wxd2lah_sp_ah_npoints(s,arrow,job,pobj,isbck,erp)) {
+ switch (arrow->type) {
+ case 1: case 2: case 3: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (1 == back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ $? ". x = %g", v[0]
+ $? ". y = %g", v[1]
+ if (0.0 < s->csgn) {
+ v[2] += M_PI;
+ }
+ if ((s->ifr - 1) > i) {
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ else {
+ p.x = v[0]; p.y = v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ case 4: case 5: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (1 == back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ $? ". x = %g", v[0]
+ $? ". y = %g", v[1]
+ (s->ppoints)[i + s->ic].x = v[0];
+ (s->ppoints)[i + s->ic].y = v[1];
+ if (0.0 < s->csgn) {
+ v[2] += M_PI;
+ }
+ if ((s->ifr - 1) > i) {
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ else {
+ p.x = v[0]; p.y = v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ case 6: case 7: case 8: case 9:
+ case 10: case 11: case 12: case 13:
+ case 14: case 15: case 16: case 17: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (1 == back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ $? ". i = %u", (unsigned)(i + s->ic)
+ $? ". x = %g", v[0]
+ $? ". y = %g", v[1]
+ if (0.0 < s->csgn) {
+ v[2] += M_PI;
+ }
+ if ((s->ifr - 1) > i) {
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ $? ". i = %u", (unsigned)i
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ $? ". i = %u", (unsigned)(i + s->ifr)
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ else {
+ p.x = v[0]; p.y = v[1];
+ $? ". i = %u", (unsigned)i
+ $? ". i = %u", (unsigned)(i + s->ifr)
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ DK4_MEMCPY(&((s->ppoints)[i+s->ifr]),&p,sizeof(p));
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ for (i = 0; i <= s->nb; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if (s->nb == i) {
+ t = s->tc;
+ }
+ else {
+ l = s->lb
+ + ((s->lc - s->lb)
+ * (double)i) / ((double)(s->nb));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ $? ". x = %g", v[0]
+ $? ". y = %g", v[1]
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ if (s->nb != i) {
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->nb));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ $? ". i = %u", (unsigned)(i + s->ibl)
+ DK4_MEMCPY(&((s->ppoints)[i+s->ibl]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0)
+ * (1.0 - ((double)i)/(s->nb));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ $? ". i = %u", (unsigned)(i + s->ibr)
+ DK4_MEMCPY(&((s->ppoints)[i+s->ibr]),&p,sizeof(p));
+ }
+ else {
+ p.x = v[0];
+ p.y = v[1];
+ $? ". i = %u", (unsigned)(i + s->ibl)
+ $? ". i = %u", (unsigned)(i + s->ibr)
+ DK4_MEMCPY(&((s->ppoints)[i+s->ibl]),&p,sizeof(p));
+ DK4_MEMCPY(&((s->ppoints)[i+s->ibr]),&p,sizeof(p));
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ switch (arrow->type) {
+ case 8: case 9: case 12: case 13: case 16: case 17: {
+ for (i = 0; i <= s->nc; i++) {
+ if (0 == i) {
+ t = s->tc;
+ }
+ else {
+ if (s->nc == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(
+ s->lc, s->lo, i, (s->nc)
+ );
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l,
+ (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ $? ". x = %g", v[0]
+ $? ". y = %g", v[1]
+ $? ". i = %u", (unsigned)(i + s->ic)
+ (s->ppoints)[i + s->ic].x = v[0];
+ (s->ppoints)[i + s->ic].y = v[1];
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ }
+ } break;
+ case 18: case 19: case 20: case 21: case 22: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ p.x = 0.0;
+ p.y = ((double)(arrow->width) / 2.0);
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - ((double)(arrow->width) / 2.0);
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i + s->ifr]),&p,sizeof(p));
+ switch (arrow->type) {
+ case 20: case 21: {
+ (s->ppoints)[i + s->ic].x = v[0];
+ (s->ppoints)[i + s->ic].y = v[1];
+ } break;
+ }
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ case 23: case 24: case 25: case 26: {
+ back = 1;
+ for (i = 0; i < s->ifr; i++) {
+ if (0 == i) {
+ t = s->tb;
+ }
+ else {
+ if ((s->ifr - 1) == i) {
+ t = s->to;
+ }
+ else {
+ l = wxd2lah_partial_length(s->lb,s->lo,i,(s->ifr - 1));
+ t = 0.0;
+ res = wxd2lxs_parameter_for_length(
+ &t, pobj, l, (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+ back = 0;
+ e_i = 1;
+ }
+ }
+ }
+ if (0 != back) {
+ res = wxd2lxs_calculate(v, pobj, t, 1, &er);
+ if (0 != res) {
+ switch (arrow->type) {
+ case 25: case 26: {
+ (s->ppoints)[i + s->ic].x = v[0];
+ (s->ppoints)[i + s->ic].y = v[1];
+ } break;
+ }
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ p.x = 0.0;
+ p.y = (((double)(arrow->width) / 2.0) * (double)i)
+ / ((double)(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i]),&p,sizeof(p));
+ p.x = 0.0;
+ p.y = 0.0 - (((double)(arrow->width) / 2.0) * (double)i)
+ / ((double)(s->ifr - 1));
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ DK4_MEMCPY(&((s->ppoints)[i + s->ifr]),&p,sizeof(p));
+ }
+ else {
+ back = 0;
+ e_m = 1;
+ }
+ }
+ }
+ } break;
+ case 27: case 28: {
+ res = wxd2lxs_calculate(v, pobj, s->to, 1, &er);
+ if (0 != res) {
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ p.y = 0.0;
+ p.x = 0.0 - (((double)(arrow->length) * s->lw) / 2.0);
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ s->x0 = p.x;
+ s->y0 = p.y;
+ back = 1;
+ }
+ else {
+ e_m = 1;
+ }
+ } break;
+ case 29: {
+ res = wxd2lxs_calculate(v, pobj, s->to, 1, &er);
+ if (0 != res) {
+ if (0.0 < s->csgn) { v[2] += M_PI; }
+ p.x = 0.0;
+ p.y = (s->lw * (double)(arrow->width)) / 2.0;
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ s->x0 = p.x; s->y0 = p.y;
+ p.x = 0.0;
+ p.y = 0.0 - ((s->lw * (double)(arrow->width)) / 2.0);
+ dk4gratool_rotate_point(&p, v[2]);
+ p.x += v[0];
+ p.y += v[1];
+ s->x1 = p.x; s->y1 = p.y;
+ back = 1;
+ }
+ else {
+ e_m = 1;
+ }
+ } break;
+ }
+ }
+ if (0 == back) {
+ *backptr = 0;
+ if (0 != e_i) {
+ /* ERROR: Iteration failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 31
+ );
+ }
+ if (0 != e_o) {
+ /* ERROR: Numeric overflow */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 30
+ );
+ }
+ if (0 != e_m) {
+ /* ERROR: Mathematical problem */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 34
+ );
+ }
+ if ((0 == e_i) && (0 == e_o)) {
+ /* ERROR: Arrowhead calculation on spline failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 35
+ );
+ }
+ }
+ $? "- wxd2lah_sp_ah_calc %d", back
+ return back;
+}
+
+
+
+/** Draw one arrowhead on spline.
+ @param arrow Arrowhead structure.
+ @param job Job structure.
+ @param pobj Object arrow belongs to.
+ @param s Spline structure to use.
+ @param stage Processing stage.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_sp_ah_path(
+ wxd_arrow_t *arrow,
+ wxd2lat_job_t *job,
+ sp_ah_t *s,
+ int stage,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ size_t ss;
+ $? "+ wxd2lah_sp_ah_path"
+ switch (arrow->type) {
+ case 1: { $? ". known arrow type"
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ } break;
+ case 2: case 3: {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,(s->ppoints)[0].x,(s->ppoints)[0].y,NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 4: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 5: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[s->ic].x, (s->ppoints)[s->ic].y,
+ NULL,backptr,erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 6: case 7: case 10: case 11: case 14: case 15: {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, (s->nf + 1), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibr, (s->nb + 1), 0, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibl, (s->nb + 1), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 8: case 12: case 16: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, (s->nf + 1), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibr, (s->nb + 1), 0, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibl, (s->nb + 1), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, (1 + s->nc), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibl, (1 + s->nb), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 9: case 13: case 17: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, (s->nf + 1), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibr, (s->nb + 1), 0, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibl, (s->nb + 1), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 0, 1, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, (1 + s->nc), 1, 0, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ibr, (1 + s->nb), 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 18: case 19: {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x, (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 20: case 21: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x,
+ (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[0].x, (s->ppoints)[0].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = ((21 == arrow->type) ? (s->ifr) : (0));
+ wxd2lah_sp_ah_bspline(
+ job, s, ss, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ic].x,
+ (s->ppoints)[s->nf + s->ic].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp, (s->ppoints)[ss].x, (s->ppoints)[ss].y,
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 22 : {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x, (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ } break;
+ case 23: case 24: {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x, (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ } break;
+ case 25: case 26: {
+ if (0 == stage) {
+ wxd2lah_sp_ah_bspline(
+ job, s, 0, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ifr].x,
+ (s->ppoints)[s->nf + s->ifr].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ifr, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ else {
+ ss = ((26 == arrow->type) ? (s->ifr) : (0));
+ wxd2lah_sp_ah_bspline(
+ job, s, ss, s->ifr, 0, 1, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ (s->ppoints)[s->nf + s->ic].x,
+ (s->ppoints)[s->nf + s->ic].y,
+ NULL, backptr, erp
+ );
+ wxd2lah_sp_ah_bspline(
+ job, s, s->ic, s->ifr, 1, 0, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ } break;
+ case 27: case 28: {
+ dk4pppt_circle(
+ job->ppp, s->x0, s->y0,
+ ((s->lw * (double)(arrow->length)) / 2.0), NULL, backptr, erp
+ );
+ } break;
+ case 29: {
+ dk4pppt_newpath_moveto(job->ppp, s->x0, s->y0, NULL, backptr, erp);
+ dk4pppt_lineto(job->ppp, s->x1, s->y1, NULL, backptr, erp);
+ } break;
+ default : { $? "! arrow type"
+ } break;
+ }
+ $? "- wxd2lah_sp_ah_path"
+}
+
+
+
+/** Draw one arrowhead on spline.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lah_ah_spline(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ sp_ah_t spah;
+ $? "+ wxd2lah_ah_spline"
+ /*
+ Initialize struture.
+ */
+ spah.ppoints = NULL;
+ spah.nf = 0;
+ spah.nb = 0;
+ spah.nc = 0;
+ spah.ifl = 0;
+ spah.ifr = 0;
+ spah.ibl = 0;
+ spah.ibr = 0;
+ spah.ic = 0;
+ spah.to = 0.0;
+ spah.tb = 0.0;
+ spah.tc = 0.0;
+ spah.lo = 0.0;
+ spah.lb = 0.0;
+ spah.lc = 0.0;
+ spah.csgn = 0.0;
+ spah.lw = wxd2lat_object_linewidth(pobj, drw, job);
+
+ /*
+ Calculate points.
+ */
+ if (0 != wxd2lah_sp_ah_calc(&spah,arrow,job,pobj,isbck,backptr,erp)) {
+ $? ". can draw arrowhead"
+ /*
+ Set up stroke and fill attributes
+ */
+ wxd2lah_set_stroke_attributes(arrow, job, backptr, erp);
+ /*
+ Draw and/or fill the path following the points
+ */
+ switch (arrow->type) {
+ case 1: case 22: case 29: { $? ". type known"
+ /*
+ Arrowheads to stroke
+ */
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ } break;
+ case 2: case 6: case 10: case 14: case 18: case 23: case 27: {
+ /*
+ White filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 3: case 7: case 11: case 15: case 24: case 19: case 28: {
+ /*
+ Color filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ } break;
+ case 4: case 5: case 8: case 9: case 12: case 13:
+ case 16: case 17: case 20: case 21: case 25: case 26: {
+ /*
+ Half-side filled arrowheads
+ */
+ dk4pppt_set_fill_rgb(job->ppp, 1.0, 1.0, 1.0, backptr, erp);
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ dk4pppt_prepare_fill_and_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill_and_stroke(job->ppp, backptr, erp);
+ }
+ else {
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ dk4pppt_prepare_stroke(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 0, backptr, erp
+ );
+ dk4pppt_stroke(job->ppp, backptr, erp);
+ }
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ ((double)(pobj->sc[0]) / 255.0),
+ ((double)(pobj->sc[1]) / 255.0),
+ ((double)(pobj->sc[2]) / 255.0),
+ backptr, erp
+ );
+ dk4pppt_prepare_fill(job->ppp, backptr, erp);
+ wxd2lah_sp_ah_path(
+ arrow, job, &spah, 1, backptr, erp
+ );
+ dk4pppt_fill(job->ppp, backptr, erp);
+ } break;
+ }
+ }
+ else {
+ *backptr = 0;
+ }
+ if (NULL != spah.ppoints) {
+ dk4mem_free(spah.ppoints); spah.ppoints = NULL;
+ }
+ $? "- wxd2lah_ah_spline"
+}
+
+
+
+
+void
+wxd2lah_arrowhead(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_arrowhead"
+ switch (pobj->ot) {
+ case WXD_OT_POLYLINE : {
+ wxd2lah_ah_polyline(arrow, drw, job, pobj, isbck, backptr, erp);
+ } break;
+ case WXD_OT_O_ARC : {
+ wxd2lah_ah_arc(arrow, drw, job, pobj, isbck, backptr, erp);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ wxd2lah_ah_spline(arrow, drw, job, pobj, isbck, backptr, erp);
+ } break;
+ }
+ $? "- wxd2lout_arrowhead"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxd2lah.h b/support/dktools/wxd2lah.h
new file mode 100644
index 0000000000..448602b65b
--- /dev/null
+++ b/support/dktools/wxd2lah.h
@@ -0,0 +1,87 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxd2lah.ctr
+*/
+
+/** @file wxd2lah.h Header file for the wxd2lah module.
+*/
+
+#ifndef WXD2LAH_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXD2LAH_H_INCLUDED 1
+
+
+#line 9 "wxd2lah.ctr"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Calculate offset and cut for one arrowhead.
+ @param parrow Arrow to calculate.
+ @param pobj Object the arrow belongs to.
+ @param pdrw Drawing structure.
+ @param pjob Job structure.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxd2lah_one_arrowhead(
+ wxd_arrow_t *parrow,
+ wxd_object_t *pobj,
+ wxd_drawing_t *pdrw,
+ wxd2lat_job_t *pjob
+);
+
+
+/** Calculate arrowhead data.
+ @param drw Drawing to produce output for.
+ @param job Job structure, probably modified.
+ @param fn Input file name
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxd2lah_calculate_arrowheads(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job
+);
+
+
+/** Draw one arrowhead for object.
+ @param arrow Arrowhead structure.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param obj Object arrow belongs to.
+ @param isbck Flag: Is a backward arrow.
+ @param backptr Address of success variable to reset on error.
+ @param erp Error report, may be NULL.
+*/
+
+void
+wxd2lah_arrowhead(
+ wxd_arrow_t *arrow,
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int isbck,
+ int *backptr,
+ dk4_er_t *erp
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#endif
diff --git a/support/dktools/wxd2lat.c b/support/dktools/wxd2lat.c
new file mode 100644
index 0000000000..ddba978f90
--- /dev/null
+++ b/support/dktools/wxd2lat.c
@@ -0,0 +1,1888 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxd2lat.ctr
+*/
+
+/** @file wxd2lat.c The wxd2lat module.
+*/
+
+
+#line 284 "wxd2lat.ctr"
+
+#ifndef FIG2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+#ifndef DK4GETCWDD_H_INCLUDED
+#include "dk4getcwdd.h"
+#endif
+
+#ifndef DK4CHDIRD_H_INCLUDED
+#include "dk4chdird.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
+
+
+
+
+#line 307 "wxd2lat.ctr"
+
+
+
+/** Default help text, shown if help text file is not found.
+*/
+static const dkChar * const wxd2lat_help_text[] = {
+dkT(""),
+dkT("Convert *.wxd to PDF+TeX/EPS+TeX/PGF"),
+dkT(""),
+dkT("wxd2lat -l <driver>,<key>=<value>... [-d] [-m] <path(s)>"),
+dkT(""),
+dkT("Driver:"),
+dkT(" eps EPS+TeX file pair."),
+dkT(" pdf PDF+TeX file pair."),
+dkT(" tex TeX file containing PGF graphics instructions."),
+dkT(""),
+dkT("Options:"),
+dkT(" -d Produce document instead of object."),
+dkT(" -m Check file modification times when processing directories."),
+dkT(" -b <width> Base line width in bp, pt, mm, cm or in."),
+dkT(" -p <width> Pattern line width in bp, pt, mm, cm or in."),
+dkT(" -w Explicitly create white background."),
+dkT(" --help Show this short help text."),
+dkT(" --version Show version information."),
+dkT(" --manual *** SHOW FULL MANUAL. ***"),
+dkT(" --license Show license information."),
+dkT(""),
+NULL
+
+
+#line 336 "wxd2lat.ctr"
+};
+
+
+
+#if 0
+
+/** Output language names.
+*/
+static const dkChar * const output_language_names[] = {
+/* 0 */
+dkT("pgf"),
+
+/* 1 */
+dkT("pdf"),
+
+/* 2 */
+dkT("eps"),
+
+NULL
+
+
+#line 350 "wxd2lat.ctr"
+};
+
+#endif
+
+
+
+/** Constant text fragments, not localized.
+*/
+static const dkChar * const wxd2lat_kwnl[] = {
+/* 0 */
+dkT("dktools"),
+
+/* 1 */
+dkT("wxd2lat.txt"),
+
+/* 2 */
+dkT("wxd2lat.str"),
+
+/* 3 */
+dkT(".wxd"),
+
+/* 4 */
+dkT(".tex"),
+
+/* 5 */
+dkT(".pdf"),
+
+/* 6 */
+dkT("-i.pdf"),
+
+/* 7 */
+dkT(".eps"),
+
+/* 8 */
+dkT(".pgf"),
+
+/* 9 */
+dkT("."),
+
+NULL
+
+
+#line 404 "wxd2lat.ctr"
+};
+
+
+
+/** Text fragments, replaced by localized versions if available.
+*/
+static const dkChar * const wxd2lat_kw_def[] = {
+/* 0 */
+dkT("\n"),
+
+/* 1 */
+dkT("Failed to set up signal handlers!"),
+
+/* 2 */
+dkT("Failed to restore signal handlers!"),
+
+/* 3 */
+dkT("Destination files are up to date."),
+
+/* 4 */
+dkT("Not a wxd file!"),
+
+/* 5 */
+dkT("Start processing directory."),
+
+/* 6 */
+dkT("Finished processing directory."),
+
+/* 7 */
+dkT("Failed to chdir into directory!"),
+
+/* 8 */
+dkT("Failed to find current directory!"),
+
+/* 9 */
+dkT("Destination files are up to date."),
+
+/* 10 */
+dkT("Skipping non-wxd file."),
+
+/* 11 */
+dkT("Failed to construct full path name!"),
+
+/* 12 */
+dkT("Failed to change back to original directory!"),
+
+/* 13 */
+dkT("Failed to construct absolute path!"),
+
+/* 14 */
+dkT("Not a regular file!"),
+
+/* 15 */
+dkT("No such file!"),
+
+/* 16 */
+dkT("Start processing file name pattern."),
+
+/* 17 */
+dkT("Finished processing file name pattern."),
+
+/* 18 */
+dkT("Unknown unit name \""),
+
+/* 19 */
+dkT("\"!"),
+
+/* 20 */
+dkT("Failed to read number from \""),
+
+/* 21 */
+dkT("\"!"),
+
+/* 22 */
+dkT("Syntax, not a floating point number: \""),
+
+/* 23 */
+dkT("\"!"),
+
+/* 24 */
+dkT("Positive length required for arrowhead!"),
+
+/* 25 */
+dkT("Positive width required for arrowhead!"),
+
+/* 26 */
+dkT("Positive length and width required for arrowhead!"),
+
+/* 27 */
+dkT("Positive line width required for arrowhead!"),
+
+/* 28 */
+dkT("Failed to calculate arrowhead angle!"),
+
+/* 29 */
+dkT("Illegal arrow type!"),
+
+/* 30 */
+dkT("Mathematical overflow in arrow calculation!"),
+
+/* 31 */
+dkT("Iteration failed in arrow calculation!"),
+
+/* 32 */
+dkT("Memory allocation failed in arrow calculation!"),
+
+/* 33 */
+dkT("Failed to calculate number of points for arrow!"),
+
+/* 34 */
+dkT("Mathematical error in arrow calculation!"),
+
+/* 35 */
+dkT("Arrowhead calculation on spline failed!"),
+
+/* 36 */
+dkT("Mathematical overflow in width/height calculation!"),
+
+/* 37 */
+dkT("File name too long!"),
+
+/* 38 */
+dkT("Failed to clip region!"),
+
+/* 39 */
+dkT("X-spline calculation failed!"),
+
+/* 40 */
+dkT("Failed to write text!"),
+
+/* 41 */
+dkT("Failed to set fill colour!"),
+
+/* 42 */
+dkT("UTF-8 decoding failed!"),
+
+/* 43 */
+dkT("Failed to create graphics object!"),
+
+/* 44 */
+dkT("Failed to create forward arrowhead!"),
+
+/* 45 */
+dkT("Failed to create backward arrowhead!"),
+
+/* 46 */
+dkT("Line width 0, skipping object."),
+
+/* 47 */
+dkT("Failed to create filled circle!"),
+
+/* 48 */
+dkT("Failed to set up filling!"),
+
+/* 49 */
+dkT("Failed to set up filling and stroking!"),
+
+/* 50 */
+dkT("Failed to stroke path!"),
+
+/* 51 */
+dkT("Failed to set up stroking!"),
+
+/* 52 */
+dkT("Failed to add bitmap image!"),
+
+/* 53 */
+dkT("Not a supported bitmap image type!"),
+
+/* 54 */
+dkT("Failed to UTF-8 decode file name!"),
+
+/* 55 */
+dkT("Font size 0!"),
+
+/* 56 */
+dkT("No text available!"),
+
+/* 57 */
+dkT("First segment too short for arrowhead!"),
+
+/* 58 */
+dkT("Final segment too short for arrowhead!"),
+
+/* 59 */
+dkT("Too few points!"),
+
+/* 60 */
+dkT("No points for object!"),
+
+/* 61 */
+dkT("Spline too short for arrowheads!"),
+
+/* 62 */
+dkT("Forward arrowhead too long!"),
+
+/* 63 */
+dkT("Backward arrowhead too long!"),
+
+/* 64 */
+dkT("Arc too short for arrowheads!"),
+
+/* 65 */
+dkT("Radius must not be 0!"),
+
+/* 66 */
+dkT("Box radius too large!"),
+
+/* 67 */
+dkT("Diameter must not be 0!"),
+
+/* 68 */
+dkT("Positive width and height required!"),
+
+/* 69 */
+dkT("File name for image required!"),
+
+/* 70 */
+dkT("Illegal object type!"),
+
+/* 71 */
+dkT("Object check failed!"),
+
+/* 72 */
+dkT("Failed to write graphics object!"),
+
+/* 73 */
+dkT("Forward arrowhead calculation failed!"),
+
+/* 74 */
+dkT("Backward arrowhead calculation failed!"),
+
+/* 75 */
+dkT("Spline segment calculation failed!"),
+
+/* 76 */
+dkT("Failed to open output file(s)!"),
+
+/* 77 */
+dkT("Failed to write output!"),
+
+/* 78 */
+dkT("Skipping output due to previous errors!"),
+
+/* 79 */
+dkT("Segment length calculation failed!"),
+
+/* 80 */
+dkT("Cut calculation for arrowhead failed!"),
+
+/* 81 */
+dkT("Memory allocation failed!"),
+
+/* 82 */
+dkT("Not an 8-bit unsigned number: \""),
+
+/* 83 */
+dkT("\"!"),
+
+/* 84 */
+dkT("Not an 8-bit number: \""),
+
+/* 85 */
+dkT("\"!"),
+
+/* 86 */
+dkT("Not a 16-bit unsigned number: \""),
+
+/* 87 */
+dkT("\"!"),
+
+/* 88 */
+dkT("Not a 16-bit number: \""),
+
+/* 89 */
+dkT("\"!"),
+
+/* 90 */
+dkT("Not a 32-bit unsigned number: \""),
+
+/* 91 */
+dkT("\"!"),
+
+/* 92 */
+dkT("Not a 32-bit number: \""),
+
+/* 93 */
+dkT("\"!"),
+
+/* 94 */
+dkT("File format version newer than reader module!"),
+
+/* 95 */
+dkT("Syntax, bounding box width or height is 0!"),
+
+/* 96 */
+dkT("Syntax, invalid number of texts in line!"),
+
+/* 97 */
+dkT("Syntax, base line width must be positive!"),
+
+/* 98 */
+dkT("Syntax, too few numbers in line!"),
+
+/* 99 */
+dkT("Syntax, line style corrected."),
+
+/* 100 */
+dkT("Syntax, style length corrected."),
+
+/* 101 */
+dkT("Syntax, cap style corrected."),
+
+/* 102 */
+dkT("Syntax, join style corrected."),
+
+/* 103 */
+dkT("Syntax, miter limit corrected."),
+
+/* 104 */
+dkT("Syntax, forward arrow type corrected."),
+
+/* 105 */
+dkT("Syntax, backward arrow type corrected."),
+
+/* 106 */
+dkT("Syntax, forward arrow length corrected."),
+
+/* 107 */
+dkT("Syntax, backward arrow length corrected."),
+
+/* 108 */
+dkT("Syntax, forward arrow width corrected."),
+
+/* 109 */
+dkT("Syntax, backward arrow width corrected."),
+
+/* 110 */
+dkT("Syntax, fill style corrected."),
+
+/* 111 */
+dkT("Syntax, closing too many groups!"),
+
+/* 112 */
+dkT("Syntax, opening too many groups!"),
+
+/* 113 */
+dkT("Skipping object!"),
+
+/* 114 */
+dkT("Syntax, illegal object type!"),
+
+/* 115 */
+dkT("Syntax, missing object type!"),
+
+/* 116 */
+dkT("Syntax, font index corrected."),
+
+/* 117 */
+dkT("Syntax, text align corrected."),
+
+/* 118 */
+dkT("Syntax, s parameter corrected."),
+
+/* 119 */
+dkT("Syntax, radius corrected."),
+
+/* 120 */
+dkT("Syntax, very small radius."),
+
+/* 121 */
+dkT("Syntax, RGB to gray conversion method corrected."),
+
+/* 122 */
+dkT("Syntax, invalid image dimensions!"),
+
+/* 123 */
+dkT("Syntax, dot diameter corrected."),
+
+/* 124 */
+dkT("Syntax, dot line width corrected."),
+
+/* 125 */
+dkT("Syntax, empty export text!"),
+
+/* 126 */
+dkT("Syntax, empty file name!"),
+
+/* 127 */
+dkT("Syntax, object start line expected!"),
+
+/* 128 */
+dkT("Syntax, details line expected!"),
+
+/* 129 */
+dkT("Syntax, screen text expected!"),
+
+/* 130 */
+dkT("Syntax, unexpected end of file!"),
+
+NULL
+
+
+#line 898 "wxd2lat.ctr"
+};
+
+
+
+/** Unit names usable in base line width specifications.
+*/
+static const dkChar *unit_names[] = {
+/* 0 */
+dkT("bp"),
+
+/* 1 */
+dkT("pt"),
+
+/* 2 */
+dkT("mm"),
+
+/* 3 */
+dkT("cm"),
+
+/* 4 */
+dkT("in"),
+
+/* 5 */
+dkT("inch"),
+
+/* 6 */
+dkT("inches"),
+
+/* 7 */
+dkT("mil"),
+
+/* 8 */
+dkT("um"),
+
+NULL
+
+
+#line 916 "wxd2lat.ctr"
+};
+
+
+/** Options to use with the program.
+*/
+static const dk4_option_specification_t wxd2lat_options[] = {
+
+ /* Output language: tex (PGF), pdf (PDF+TeX), eps (EPS+TeX).
+ */
+ { dkT('l'), dkT("language"), DK4_OPT_ARG_STRING },
+
+ /* Make mode, only convert if necessary.
+ */
+ { dkT('m'), dkT("make"), DK4_OPT_ARG_NONE },
+
+ /* Reset (do not use configuration files or preferences).
+ */
+ { dkT('R'), dkT("reset"), DK4_OPT_ARG_NONE },
+
+ /* Produce document instead of object.
+ */
+ { dkT('d'), dkT("document"), DK4_OPT_ARG_NONE },
+
+ /* Base line width.
+ */
+ { dkT('b'), dkT("base-linewidth"), DK4_OPT_ARG_STRING },
+
+ /* Line width for pattern drawing (default: base linewidth).
+ */
+ { dkT('p'), dkT("pattern-linewidth"), DK4_OPT_ARG_STRING },
+
+ { dkT('w'), dkT("white-background"), DK4_OPT_ARG_NONE }
+
+};
+
+
+
+/** Number of options in wxd2lat_options array.
+*/
+static const size_t sz_wxd2lat_options =
+sizeof(wxd2lat_options) / sizeof(dk4_option_specification_t);
+
+
+
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+
+
+
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
+
+
+
+/** Indicator: SIGTERM signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+
+
+
+/** Pass a volatile pointer to an atomic integer.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ptr Address of atomic integer variable.
+ @return The unmodified pointer.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
+{
+ return ptr;
+}
+
+
+
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
+*/
+static
+void
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
+}
+#endif
+
+
+
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
+static
+void
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
+}
+
+
+
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
+*/
+static
+void
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
+}
+
+
+
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
+
+
+
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
+*/
+static
+int
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
+{
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
+}
+
+
+
+
+/** Initialize job structure at start of program.
+ @param job Structure to initialize.
+*/
+static
+void
+job_init(wxd2lat_job_t *job)
+{
+ dk4gra_conf_init(&(job->grco));
+ job->ppp = NULL;
+ job->app = NULL;
+ job->msg = wxd2lat_kw_def;
+ job->sz_msg = (sizeof(wxd2lat_kw_def)/sizeof(DK4_PDKCHAR) - 1);
+ job->exval = EXIT_FAILURE;
+ job->make = 0;
+ job->uc2l = NULL;
+ job->baselw = -1.0; /* Use default from file or 0.45bp */
+ job->patlw = -1.0; /* Use default */
+ job->xsprec = 1.0 / 512.0;
+ job->xslprec = job->xsprec / 4.0;
+ job->use_prefs = 1;
+ job->fnb = NULL;
+ job->fno1 = NULL;
+ job->fno2 = NULL;
+ job->szfnb = 0;
+ job->whitebg = 0;
+ job->szwidth = 0;
+ job->szheight = 0;
+ job->shiftx = 0.0;
+ job->shifty = 0.0;
+}
+
+
+
+/** Check whether the file name ends on wxd.
+ @param filename File name to check.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+is_wxd_file(const dkChar *filename)
+{
+ const dkChar *ptr;
+ int back = 0;
+
+
+#line 1134 "wxd2lat.ctr"
+ if (NULL != filename) {
+ ptr = dk4path_get_suffix(filename, NULL);
+ if (NULL != ptr) {
+
+#line 1137 "wxd2lat.ctr"
+ if (0 == dk4str_casecmp(ptr, wxd2lat_kwnl[3])) {
+ back = 1;
+ }
+ }
+ }
+
+
+#line 1143 "wxd2lat.ctr"
+ return back;
+}
+
+
+
+/** Check whether we must produce one output file.
+ @param fno Buffer for output file name, containing base name.
+ @param szfno Size of fno buffer.
+ @param fn Source file name.
+ @param su Suffix to add to buffer.
+ @return 1 to run conversion, 0 to skip.
+*/
+static
+int
+check_one(dkChar *fno, size_t szfno, const dkChar *fn, const dkChar *su)
+{
+ int back = 1;
+
+
+#line 1161 "wxd2lat.ctr"
+ if (0 != dk4str_cat_s(fno, szfno, su, NULL)) {
+
+
+#line 1163 "wxd2lat.ctr"
+
+
+#line 1164 "wxd2lat.ctr"
+ back = dk4makemode_must_rebuild(fno, fn);
+ }
+
+
+#line 1167 "wxd2lat.ctr"
+ return back;
+}
+
+
+
+/** Check whether we really must run a conversion.
+ @param job Job structure.
+ @param fn Source file name.
+ @return 1 to run conversion, 0 to skip.
+*/
+static
+int
+check_make(wxd2lat_job_t *job, const dkChar *fn)
+{
+ dkChar *pso = NULL;
+ int back = 1;
+ int res = 0;
+
+
+#line 1185 "wxd2lat.ctr"
+ if (0 != job->make) {
+ if (0 != dk4str_cpy_s(job->fno1, job->szfnb, fn, NULL)) {
+ if (0 != dk4str_cpy_s(job->fno2, job->szfnb, fn, NULL)) {
+ pso = dk4path_get_suffix(job->fno1, NULL);
+ if (NULL != pso) { *pso = dkT('\0'); }
+ pso = dk4path_get_suffix(job->fno2, NULL);
+ if (NULL != pso) { *pso = dkT('\0'); }
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_PGF : {
+ back = check_one(
+ job->fno1, job->szfnb, fn, wxd2lat_kwnl[8]
+ );
+ } break;
+ case DK4_GRA_DRIVER_PS: case DK4_GRA_DRIVER_EPS : {
+ res = check_one(
+ job->fno1, job->szfnb, fn, wxd2lat_kwnl[7]
+ );
+ if (0 == res) {
+ back = check_one(
+ job->fno2, job->szfnb, fn, wxd2lat_kwnl[4]
+ );
+ }
+ } break;
+ case DK4_GRA_DRIVER_PDF : {
+ res = check_one(
+ job->fno1, job->szfnb, fn,
+ wxd2lat_kwnl[
+ (DK4_GRA_PURPOSE_DOCUMENT == job->grco.purpose)
+ ? (6) : (5)
+ ]
+ );
+ if (0 == res) {
+ back = check_one(
+ job->fno2, job->szfnb, fn, wxd2lat_kwnl[4]
+ );
+ }
+ } break;
+ }
+ }
+ }
+ }
+
+
+#line 1227 "wxd2lat.ctr"
+ return back;
+}
+
+
+
+
+/** Process one regular file.
+ @param job Job structure.
+ @param xargv Name of file to process.
+*/
+static
+void
+process_one_file(wxd2lat_job_t *job, const dkChar *xargv)
+{
+ wxd_drawing_t *drw = NULL; /* Drawing to convert */
+ const dkChar *osf = NULL; /* Original source file */
+ dk4_um_t osl = 0UL; /* Original source line */
+
+
+#line 1245 "wxd2lat.ctr"
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, xargv);
+ dk4app_set_log_source_line(job->app, 0UL);
+ if (0 != is_wxd_file(xargv)) {
+ if (0 != check_make(job, xargv)) {
+ drw = wxdrd_open_from_file(xargv,job);
+ if (NULL != drw) {
+
+#line 1253 "wxd2lat.ctr"
+ wxd2lat_output(drw, job, xargv);
+ wxdrd_close(drw);
+ }
+ else {
+ /* ERROR: Failed to read drawing, already reported */
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /* INFO: Destination files up to date */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_INFO, 3);
+ }
+ }
+ else {
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 4);
+ job->exval = EXIT_FAILURE;
+ }
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1274 "wxd2lat.ctr"
+}
+
+
+#if 0
+
+/** Process a directory.
+ @param job Job structure.
+ @param xargv Directory name.
+ @param docd Flag: chdir to specified directory.
+*/
+static
+void
+process_one_directory(wxd2lat_job_t *job, const dkChar *xargv, int docd)
+{
+ dkChar cdbuf[DK4_MAX_PATH]; /* Current directory */
+ dk4_er_t er; /* Error report */
+ dk4_dir_t *dir = NULL; /* Directory structure */
+ const dkChar *osf = NULL; /* Original source file */
+ const dkChar *shn = NULL; /* Short file name */
+ dk4_um_t osl = 0UL; /* Original source line */
+ int cc = 1; /* Flag: Can continue */
+ int res = 0; /* Operation result */
+ int canrun = 1; /* Flag: Can run */
+
+
+#line 1298 "wxd2lat.ctr"
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, xargv);
+ dk4app_set_log_source_line(job->app, 0UL);
+ /* PROGRESS: Start processing directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 5);
+ dk4error_init(&er);
+
+
+ if (0 != docd) {
+ canrun = 0;
+ if (0 != dk4getcwd(cdbuf, DK4_SIZEOF(cdbuf,dkChar), &er)) {
+
+#if 0
+ if (0 != dk4chdir(xargv, &er)) {
+ canrun = 1;
+ }
+ else {
+ /* ##### ERROR: Failed to change directory */
+ job->exval = EXIT_FAILURE;
+ }
+#endif
+
+
+ }
+ else {
+ /* ##### ERROR: Failed to find current directory */
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ if (0 != canrun) {
+ dir = dk4dir_open_app(xargv, DK4_DIR_OPEN_SORTED, job->app);
+ if (NULL != dir) {
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(dir);
+ if (NULL != shn) {
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ job->fnb, job->szfnb, dir, shn, &er
+ );
+ if (0 != res) {
+ if (0 != is_wxd_file(job->fnb)) {
+ if (0 != check_make(job, job->fnb)) {
+ process_one_file(job, job->fnb);
+ }
+ else {
+ /* ##### PROGRESS: Destination files up to date */
+ }
+ }
+ else {
+ /* ##### PROGRESS: Skipping non-wxd file */
+ }
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /* ##### ERROR: Failed to construct full path name */
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(dir);
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ if (0 != docd) {
+ if (0 == dk4chdir(cdbuf, &er)) {
+ /* ##### ERROR: Failed to return to directory */
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ /* PROGRESS: Finished processing directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 6);
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1378 "wxd2lat.ctr"
+}
+
+#endif
+
+
+
+/** Process a directory specified by absolute path.
+ @param job Job structure.
+ @param xargv Directory name.
+ @param docd Flag: chdir to specified directory.
+*/
+static
+void
+process_absolute_directory(wxd2lat_job_t *job, const dkChar *dn, int docd)
+{
+ dk4_er_t er; /* Error report */
+ dkChar *cdbuf = NULL; /* Current directory */
+ dk4_dir_t *dir = NULL; /* Directory structure */
+ const dkChar *osf = NULL; /* Original source file */
+ const dkChar *shn = NULL; /* Short file name */
+ dk4_um_t osl = 0UL; /* Original source line */
+ int canrun = 1; /* Flag: Can run */
+ int cc = 1; /* Flag: Can continue */
+ int res = 0; /* Operation result */
+
+
+#line 1403 "wxd2lat.ctr"
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, dn);
+ dk4app_set_log_source_line(job->app, 0UL);
+ /* PROGRESS: Start processing directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 5);
+ if (0 != docd) {
+ cdbuf = dk4getcwd_dup(NULL);
+ if (NULL != cdbuf) {
+ if (0 == dk4chdir(dn, NULL)) {
+ /* ERROR: Failed to change into directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 7);
+ job->exval = EXIT_FAILURE;
+ canrun = 0;
+ }
+ }
+ else {
+ /* ERROR: Failed to find current directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 8);
+ job->exval = EXIT_FAILURE;
+ canrun = 0;
+ }
+ }
+ if (0 != canrun) {
+ dir = dk4dir_open_app(dn, DK4_DIR_OPEN_SORTED, job->app);
+ if (NULL != dir) {
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(dir);
+ if (NULL != shn) {
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ job->fnb, job->szfnb, dir, shn, &er
+ );
+ if (0 != res) {
+ if (0 != is_wxd_file(job->fnb)) {
+ if (0 != check_make(job, job->fnb)) {
+ process_one_file(job, job->fnb);
+ }
+ else {
+ /* PROGRESS: Destination files are up to date */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_PROGRESS, 9
+ );
+ }
+ }
+ else {
+ /* PROGRESS: Skipping non-wxd file */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_PROGRESS, 10
+ );
+ }
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to construct full path name */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 11
+ );
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(dir);
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ if (NULL != cdbuf) {
+ if (docd) {
+ if (0 == dk4chdir(cdbuf, NULL)) {
+ /* ERROR: Failed to change back to original directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 12);
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ dk4mem_free(cdbuf);
+ cdbuf = NULL;
+ }
+ /* PROGRESS: Finished processing directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 6);
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1492 "wxd2lat.ctr"
+}
+
+
+
+/** Process a directory specified by relative path.
+ @param job Job structure.
+ @param xargv Directory name.
+ @param docd Flag: chdir to specified directory.
+*/
+static
+void
+process_relative_directory(wxd2lat_job_t *job, const dkChar *dn, int docd)
+{
+ dkChar cdbuf[DK4_MAX_PATH];
+
+ if (0 != dk4getcwd(cdbuf, DK4_SIZEOF(cdbuf,dkChar), NULL)) {
+ if (0 != dk4path_append(cdbuf, DK4_SIZEOF(cdbuf,dkChar), dn, NULL)) {
+ process_absolute_directory(job, cdbuf, docd);
+ }
+ else {
+ /* ERROR: Failed to construct absolute path */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 13);
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /* ERROR: Failed to find current working directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 8);
+ job->exval = EXIT_FAILURE;
+ }
+}
+
+
+
+/** Process a directory.
+ @param job Job structure.
+ @param xargv Directory name.
+ @param docd Flag: chdir to specified directory.
+*/
+static
+void
+process_one_directory(wxd2lat_job_t *job, const dkChar *dn, int docd)
+{
+ if (0 != dk4path_is_absolute(dn)) {
+ process_absolute_directory(job, dn, docd);
+ }
+ else {
+ process_relative_directory(job, dn, docd);
+ }
+}
+
+
+
+/** Process one command line argument.
+ @param job Job structure.
+ @param xargv Command line argument to process.
+*/
+static
+void
+process_one_name(wxd2lat_job_t *job, const dkChar *xargv)
+{
+ const dkChar *osf = NULL; /* Original source file */
+ dk4_um_t osl = 0UL; /* Original source line */
+
+
+#line 1556 "wxd2lat.ctr"
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, xargv);
+ dk4app_set_log_source_line(job->app, 0UL);
+ if (0 != dk4file_is_directory(xargv, NULL)) {
+
+#line 1561 "wxd2lat.ctr"
+ process_one_directory(job, xargv, 1);
+ }
+ else {
+ if (0 != dk4file_is_regular(xargv, NULL)) {
+
+#line 1565 "wxd2lat.ctr"
+ process_one_file(job, xargv);
+ }
+ else {
+ if (0 != dk4file_exists(xargv, NULL)) {
+
+#line 1569 "wxd2lat.ctr"
+ /* ERROR: Not a reglar file */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 14);
+ }
+ else {
+
+#line 1573 "wxd2lat.ctr"
+ /* ERROR: No such file */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 15);
+ }
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1582 "wxd2lat.ctr"
+}
+
+
+
+#if DK4_ON_WINDOWS
+
+static
+void
+expand_and_process(wxd2lat_job_t *job, const dkChar *xargv)
+{
+ dkChar fnb[DK4_MAX_PATH]; /* Buffer for full path name */
+ dk4_er_t er; /* Error report */
+ dk4_dir_t *fne; /* File name expander */
+ const dkChar *osf = NULL; /* Original source file */
+ const dkChar *shn = NULL; /* Short file name */
+ dk4_um_t osl = 0UL; /* Original source line */
+ int anyfound = 0; /* Flag: Any matching file found */
+ int cc = 1; /* Flag: Can continue */
+ int res = 0; /* Operation result */
+
+
+#line 1602 "wxd2lat.ctr"
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, xargv);
+ dk4app_set_log_source_line(job->app, 0UL);
+ /* PROGRESS: Start processing file name pattern */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 16);
+ fne = dk4app_fne_open(xargv, job->app);
+ if (NULL != fne) {
+ cc = 1;
+ dk4error_init(&er);
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_dir(fne);
+ if (NULL != shn) {
+ res = dk4dir_full_name_buffer(
+ fnb, DK4_SIZEOF(fnb,dkChar), fne, shn, &er
+ );
+ if (0 != res) {
+ process_one_directory(job, fnb, 1);
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to construct full path name */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 11
+ );
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ cc = 1;
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(fne);
+ if (NULL != shn) {
+ res = dk4dir_full_name_buffer(
+ fnb, DK4_SIZEOF(fnb,dkChar), fne, shn, &er
+ );
+ if (0 != res) {
+ process_one_file(job, fnb);
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to construct full path name */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 11
+ );
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(fne);
+ if ((0 != sig_can_continue(0)) && (0 == anyfound)) {
+ job->exval = EXIT_FAILURE;
+ /* ERROR: No such file */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 15);
+ }
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ /* PROGRESS: Finished processing file name pattern */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 17);
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+
+
+#line 1672 "wxd2lat.ctr"
+}
+
+#endif
+
+
+
+static
+void
+process_current_directory(wxd2lat_job_t *job)
+{
+ dkChar dnb[DK4_MAX_PATH];
+
+ if (0 != dk4getcwd(dnb, DK4_SIZEOF(dnb,dkChar), NULL)) {
+ process_one_directory(job, dnb, 0);
+ }
+ else {
+ /* ERROR: Failed to find current directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 8);
+ }
+}
+
+
+
+/** Run for file specified on the command line.
+ If no file on command line specified, run on current directory.
+ @param job Job structure.
+*/
+static
+void
+process_all_input_files(wxd2lat_job_t *job)
+{
+ dkChar const *xargv; /* Current cmd line arg to process */
+ int xargc; /* Number of command line arguments */
+ int i; /* Index of current cmd line arg */
+
+
+#line 1707 "wxd2lat.ctr"
+ xargc = dk4app_get_argc(job->app);
+ if (0 < xargc) {
+ for (i = 0; ((i < xargc) && (0 != sig_can_continue(0))); i++) {
+ xargv = dk4app_get_argv(job->app, i);
+ if (NULL != xargv) {
+#if DK4_ON_WINDOWS
+ if (0 != dk4path_must_expand(xargv)) {
+ expand_and_process(job, xargv);
+ }
+ else {
+ process_one_name(job, xargv);
+ }
+#else
+ process_one_name(job, xargv);
+#endif
+ }
+ else {
+ }
+ }
+ }
+ else {
+ /* No names specified, process current directory
+ */
+ process_current_directory(job);
+ }
+
+
+#line 1733 "wxd2lat.ctr"
+}
+
+
+
+/** Get base line width from string.
+ @param job Job structure to modify.
+ @param src Source text.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+get_line_width_from_text(wxd2lat_job_t *job, double *dptr, dkChar const *src)
+{
+ dk4_er_t er;
+ const dkChar *ep = NULL;
+ double v;
+ int back = 0;
+ int res = 0;
+
+ dk4error_init(&er);
+
+
+#line 1754 "wxd2lat.ctr"
+ if ((NULL != job) && (NULL != src)) {
+ back = dk4ma_input_dk_double(&v, src, &ep, 2, &er);
+ if (1 == back) {
+ if ((NULL != ep) && (0U != dk4str_len(ep))) {
+ res = dk4str_array_index(unit_names, ep, 0);
+ if (0 <= res) {
+ switch (res) {
+ case 0: { /* bp */
+ } break;
+ case 1: { /* pt */
+ v *= (72.0 / 72.27);
+ } break;
+ case 2: { /* mm */
+ v *= (72.0 / 25.4);
+ } break;
+ case 3: { /* cm */
+ v *= (72.0 / 2.54);
+ } break;
+ case 4: case 5: case 6: { /* in */
+ v *= 72.0;
+ } break;
+ case 7: { /* mil */
+ v *= (72.0 / 1000.0);
+ } break;
+ case 8: { /* um */
+ v *= (72.0 / 25400.0);
+ } break;
+ }
+ }
+ else {
+
+#line 1784 "wxd2lat.ctr"
+ back = 0;
+ /* ERROR: Unknown unit name */
+ dk4app_log_3(
+ job->app, job->msg, job->sz_msg, DK4_LL_INFO, 18,19,ep
+ );
+ }
+ }
+ }
+ else {
+ /* ERROR: Failed to read number */
+ dk4app_log_3(
+ job->app, job->msg, job->sz_msg, DK4_LL_INFO, 20, 21, src
+ );
+ }
+ if (1 == back) {
+ *dptr = v;
+ }
+ }
+
+
+#line 1803 "wxd2lat.ctr"
+ return back;
+}
+
+
+
+
+/** Run normally after applying signal handlers.
+ @param job Job structure.
+*/
+static
+void
+w2l_normal_run(wxd2lat_job_t *job)
+{
+ const dkChar *lpo;
+ int ok = 1;
+
+
+#line 1819 "wxd2lat.ctr"
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('R'), NULL)) {
+ job->use_prefs = 0;
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('m'), NULL)) {
+ job->make = 1;
+
+#line 1824 "wxd2lat.ctr"
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('d'), NULL)) {
+ (job->grco).purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('b'), NULL)) {
+ lpo = dk4app_opt_get_string_ptr_short(job->app, dkT('b'), NULL);
+ if (NULL != lpo) {
+ if (0 == get_line_width_from_text(job, &(job->baselw), lpo)) {
+ ok = 0;
+ }
+ }
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('p'), NULL)) {
+ lpo = dk4app_opt_get_string_ptr_short(job->app, dkT('p'), NULL);
+ if (NULL != lpo) {
+ if (0 == get_line_width_from_text(job, &(job->patlw), lpo)) {
+ ok = 0;
+ }
+ }
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('w'), NULL)) {
+ job->whitebg = 1;
+ }
+
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('l'), NULL)) {
+ lpo = dk4app_opt_get_string_ptr_short(job->app, dkT('l'), NULL);
+ if (NULL != lpo) {
+#if 0
+ job->ot = dk4str_array_index(output_language_names, lpo, 0);
+ if (0 > job->ot) {
+
+#line 1854 "wxd2lat.ctr"
+ ok = 0;
+ /* ##### ERROR: Illegal output language name */
+ }
+#endif
+ ok = dk4gra_conf_setup(
+ &(job->grco), lpo, job->use_prefs,
+ DK4_GRA_CONF_SCOPE_FIG2LAT, job->app
+ );
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1865 "wxd2lat.ctr"
+ }
+#endif
+ }
+ if (0 != ok) {
+ job->uc2l = dk4uc2l_open_from_app(job->app);
+ if (NULL != job->uc2l) {
+ job->exval = EXIT_SUCCESS;
+ process_all_input_files(job);
+ dk4uc2l_close(job->uc2l);
+ job->uc2l = NULL;
+ }
+ else {
+
+#line 1877 "wxd2lat.ctr"
+ /* ERROR: No Unicode to LaTeX structure, already reported */
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 1882 "wxd2lat.ctr"
+ }
+#endif
+
+
+#line 1885 "wxd2lat.ctr"
+}
+
+
+
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+w2l_run_with_signal_handlers(wxd2lat_job_t *job)
+{
+#ifdef SIGPIPE
+ struct sigaction opipe;
+#endif
+ struct sigaction oint;
+#ifdef SIGPIPE
+ struct sigaction npipe;
+#endif
+ struct sigaction nint;
+ struct sigaction oterm;
+ struct sigaction nterm;
+ int success = 0;
+
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto finished;
+ }
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto finished;
+ }
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto finished;
+ }
+#endif
+
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_int;
+ }
+
+ success = 1;
+ w2l_normal_run(job);
+
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+ /* ERROR: Failed to restore old SIGTERM settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 2);
+ success = 0;
+ }
+
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 2);
+ success = 0;
+ }
+
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 2);
+ success = 0;
+ }
+#endif
+
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) { job->exval = EXIT_FAILURE; }
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+w2l_run_with_signal_handlers(wxd2lat_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ w2l_normal_run(job);
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+w2l_run_with_signal_handlers(wxd2lat_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ w2l_normal_run(job);
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+}
+#else
+/** Set signal handlers and run.
+*/
+static
+void
+w2l_run_with_signal_handlers(void)
+{
+ w2l_normal_run();
+}
+#endif
+#endif
+#endif
+
+
+
+/** Buffer for full file name.
+*/
+static dkChar wxd2lat_filename_buffer[DK4_MAX_PATH];
+
+/** Buffer for output file name.
+*/
+static dkChar wxd2lat_filename_o1[ DK4_SIZEOF(wxd2lat_filename_buffer,dkChar) ];
+
+/** Buffer for second output file name.
+*/
+static dkChar wxd2lat_filename_o2[ DK4_SIZEOF(wxd2lat_filename_buffer,dkChar) ];
+
+
+/** Main function.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @return 0 on success, all other values indicate errors.
+*/
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
+{
+ wxd2lat_job_t job;
+
+
+#line 2105 "wxd2lat.ctr"
+
+
+#line 2106 "wxd2lat.ctr"
+ dk4fput_initialize_stderr();
+ job_init(&job);
+ job.fnb = wxd2lat_filename_buffer;
+ job.fno1 = wxd2lat_filename_o1;
+ job.fno2 = wxd2lat_filename_o2;
+ job.szfnb = DK4_SIZEOF(wxd2lat_filename_buffer,dkChar);
+ job.app = dk4app_open_cmd(
+ argc, argv, wxd2lat_options, sz_wxd2lat_options,
+ wxd2lat_kwnl[0], DKT_VERSION_DK,
+ wxd2lat_kwnl[1], wxd2lat_help_text, w2llic_get_text()
+ );
+ if (NULL != job.app) {
+ job.sz_msg = dk4app_string_table_size(wxd2lat_kw_def);
+ job.msg = dk4app_string_table(
+ job.app, wxd2lat_kwnl[2], wxd2lat_kw_def
+ );
+ if (0 != dk4app_can_run_normally(job.app)) {
+ w2l_run_with_signal_handlers(&job);
+ }
+ else {
+ if (0 != dk4app_help_version_license(job.app)) {
+ job.exval = EXIT_SUCCESS;
+ }
+ }
+ dk4app_close(job.app);
+ }
+ else {
+ }
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+
+
+#line 2137 "wxd2lat.ctr"
+
+
+#line 2138 "wxd2lat.ctr"
+ exit(job.exval); return job.exval;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxd2lat.ctr b/support/dktools/wxd2lat.ctr
new file mode 100644
index 0000000000..7bb7147747
--- /dev/null
+++ b/support/dktools/wxd2lat.ctr
@@ -0,0 +1,2142 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#define _USE_MATH_DEFINES
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4NUMCO_H_INCLUDED
+#include "dk4numco.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4REC27_H_INCLUDED
+#include "dk4rec27.h"
+#endif
+
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4ITER_H_INCLUDED
+#include "dk4iter.h"
+#endif
+
+#ifndef DK4MAAI32_H_INCLUDED
+#include "dk4maai32.h"
+#endif
+
+#ifndef DK4MAADI_H_INCLUDED
+#include "dk4maadi.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4MAI8DBL_H_INCLUDED
+#include "dk4mai8dbl.h"
+#endif
+
+#ifndef DK4MAIDDBL_H_INCLUDED
+#include "dk4maiddbl.h"
+#endif
+
+#ifndef DK4MAI8DU8_H_INCLUDED
+#include "dk4mai8du8.h"
+#endif
+
+#ifndef DK4MAI8DI8_H_INCLUDED
+#include "dk4mai8di8.h"
+#endif
+
+#ifndef DK4MAI8DU16_H_INCLUDED
+#include "dk4mai8du16.h"
+#endif
+
+#ifndef DK4MAI8DI16_H_INCLUDED
+#include "dk4mai8di16.h"
+#endif
+
+#ifndef DK4MAI8DU32_H_INCLUDED
+#include "dk4mai8du32.h"
+#endif
+
+#ifndef DK4MAI8DI32_H_INCLUDED
+#include "dk4mai8di32.h"
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef DK4AOPT_H_INCLUDED
+#include "dk4aopt.h"
+#endif
+
+#ifndef DK4XSP_H_INCLUDED
+#include "dk4xsp.h"
+#endif
+
+#ifndef DK4UC2LA_H_INCLUDED
+#include "dk4uc2la.h"
+#endif
+
+#ifndef DK4GRCO_H_INCLUDED
+#include "dk4grco.h"
+#endif
+
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4BIFAP_H_INCLUDED
+#include "dk4bifap.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include "dk4grat.h"
+#endif
+
+#ifndef DK4FILED_H_INCLUDED
+#include "dk4filed.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#include "dk4dir.h"
+#endif
+
+#ifndef DK4DIRA_H_INCLUDED
+#include "dk4dira.h"
+#endif
+
+#ifndef DK4FOPDA_H_INCLUDED
+#include "dk4fopda.h"
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#include "dk4sto.h"
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#include "dk4cs.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4MM_H_INCLUDED
+#include "dk4mm.h"
+#endif
+
+#ifndef DK4FPUT_H_INCLUDED
+#include "dk4fput.h"
+#endif
+
+#ifndef DK4PPPT_H_INCLUDED
+#include "dk4pppt.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+#ifndef WXDENUM_H_INCLUDED
+#include "wxdenum.h"
+#endif
+
+
+/** Conversion job structure.
+*/
+typedef struct {
+ dk4_gra_conf_t grco; /**< Graphics conversion options. */
+ dk4_pppt_t *ppp; /**< Output structure. */
+ dkChar *fnb; /**< File name buffer. */
+ dkChar *fno1; /**< Output file name 1. */
+ dkChar *fno2; /**< Output file name 2. */
+ dk4_app_t *app; /**< Application structure. */
+ dk4_uc2l_t *uc2l; /**< Unicode to LaTeX structure. */
+ const dkChar * const *msg; /**< Localized or default texts. */
+ double baselw; /**< Base line width in bp. */
+ double patlw; /**< Pattern line width in bp. */
+ double shiftx; /**< X shift value. */
+ double shifty; /**< Y shift value. */
+ double xsprec; /**< Precision X-spl iteration. */
+ double xslprec; /**< Precision length iteration. */
+ size_t szwidth; /**< Width in bp. */
+ size_t szheight; /**< Height in bp. */
+ size_t sz_msg; /**< Number of texts in msg. */
+ size_t szfnb; /**< Size of file name buffer. */
+ int exval; /**< Exit status code. */
+ int make; /**< Flag: Behave like make. */
+ int use_prefs; /**< Flag: Use preferences. */
+ int whitebg; /**< Flag: White background. */
+} wxd2lat_job_t;
+
+
+#ifndef F2LLIC_H_INCLUDED
+#include "w2llic.h"
+#endif
+
+#ifndef WXDSTR_H_INCLUDED
+#include "wxdstr.h"
+#endif
+
+#ifndef WXDCOMP_H_INCLUDED
+#include "wxdcomp.h"
+#endif
+
+#ifndef WXDOBJ_H_INCLUDED
+#include "wxdobj.h"
+#endif
+
+#ifndef WXDRD_H_INCLUDED
+#include "wxdrd.h"
+#endif
+
+#ifndef WXD2LAH_H_INCLUDED
+#include "wxd2lah.h"
+#endif
+
+#ifndef WXD2LXS_H_INCLUDED
+#include "wxd2lxs.h"
+#endif
+
+#ifndef WXDARC_H_INCLUDED
+#include "wxdarc.h"
+#endif
+
+#ifndef WXD2LOUT_H_INCLUDED
+#include "wxd2lout.h"
+#endif
+
+
+/** Output types.
+*/
+enum {
+ /** PGF instructions.
+ */
+ OUTPUT_PGF = 0 ,
+
+ /** PDF+TeX file pair.
+ */
+ OUTPUT_PDF ,
+
+ /** EPS+TeX file pair.
+ */
+ OUTPUT_EPS
+};
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+%% module
+
+#ifndef FIG2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+#ifndef DK4GETCWDD_H_INCLUDED
+#include "dk4getcwdd.h"
+#endif
+
+#ifndef DK4CHDIRD_H_INCLUDED
+#include "dk4chdird.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef DK4WMAIN_H_INCLUDED
+#include "dk4wmain.h"
+#endif
+
+
+$!trace-include
+
+
+
+/** Default help text, shown if help text file is not found.
+*/
+static const dkChar * const wxd2lat_help_text[] = {
+$!text macro=dkT
+
+Convert *.wxd to PDF+TeX/EPS+TeX/PGF
+
+wxd2lat -l <driver>,<key>=<value>... [-d] [-m] <path(s)>
+
+Driver:
+ eps EPS+TeX file pair.
+ pdf PDF+TeX file pair.
+ tex TeX file containing PGF graphics instructions.
+
+Options:
+ -d Produce document instead of object.
+ -m Check file modification times when processing directories.
+ -b <width> Base line width in bp, pt, mm, cm or in.
+ -p <width> Pattern line width in bp, pt, mm, cm or in.
+ -w Explicitly create white background.
+ --help Show this short help text.
+ --version Show version information.
+ --manual *** SHOW FULL MANUAL. ***
+ --license Show license information.
+
+$!end
+};
+
+
+
+#if 0
+
+/** Output language names.
+*/
+static const dkChar * const output_language_names[] = {
+$!string-table macro=dkT
+pgf
+pdf
+eps
+$!end
+};
+
+#endif
+
+
+
+/** Constant text fragments, not localized.
+*/
+static const dkChar * const wxd2lat_kwnl[] = {
+$!string-table macro=dkT
+#
+# 0 Program group name
+#
+dktools
+#
+# 1 Help file name (full manual)
+#
+wxd2lat.txt
+#
+# 2 String table file name
+#
+wxd2lat.str
+#
+# 3 File name suffix for files to process
+#
+.wxd
+#
+# 4 File name suffix for tex output file
+#
+.tex
+#
+# 5 File name suffix for pdf output file
+#
+.pdf
+#
+# 6 File name suffix for pdf include file
+#
+-i.pdf
+#
+# 7 File name suffix for eps output file
+#
+.eps
+#
+# 8 File name suffix for pgf output file
+#
+.pgf
+#
+# 9 Dot to mark current directory
+#
+.
+#
+#
+#
+$!end
+};
+
+
+
+/** Text fragments, replaced by localized versions if available.
+*/
+static const dkChar * const wxd2lat_kw_def[] = {
+$!string-table macro=dkT
+#
+# 0 Newline
+#
+\n
+#
+# 1-2 Signal handling
+#
+Failed to set up signal handlers!
+Failed to restore signal handlers!
+#
+# 3 Info: Destination files are up to date.
+#
+Destination files are up to date.
+#
+# 4 Error: Not a wxd file!
+#
+Not a wxd file!
+#
+# 5 Progress: Start processing directory.
+#
+Start processing directory.
+#
+# 6 Progress: Finished processing directory.
+#
+Finished processing directory.
+#
+# 7 Error: Failed to chdir into directory!
+#
+Failed to chdir into directory!
+#
+# 8 Error: Failed to find current directory!
+#
+Failed to find current directory!
+#
+# 9 Progress: Destination files are up to date.
+#
+Destination files are up to date.
+#
+# 10 Progress: Skipping non-wxd file.
+#
+Skipping non-wxd file.
+#
+# 11 Error: Failed to construct full path name!
+#
+Failed to construct full path name!
+#
+# 12 Error: Failed to change back to original directory!
+#
+Failed to change back to original directory!
+#
+# 13 Error: Failed to construct absolute path!
+#
+Failed to construct absolute path!
+#
+# 14 Error: Not a regular file!
+#
+Not a regular file!
+#
+# 15 Error: No such file!
+#
+No such file!
+#
+# 16 Progress: Start processing file name pattern.
+#
+Start processing file name pattern.
+#
+# 17 Progress: Finished processing file name pattern.
+#
+Finished processing file name pattern.
+#
+# 18 19 Error: Unknown unit name!
+#
+Unknown unit name "
+"!
+#
+# 20 21 Error: Failed to read number!
+#
+Failed to read number from "
+"!
+#
+# 22 23 Error: Not a floating point number
+#
+Syntax, not a floating point number: "
+"!
+#
+# 24 Error: Positive length required for arrowhead!
+#
+Positive length required for arrowhead!
+#
+# 25 Error: Positive width required for arrowhead!
+#
+Positive width required for arrowhead!
+#
+# 26 Error: Positive length and width required for arrowhead!
+#
+Positive length and width required for arrowhead!
+#
+# 27 Error: Positive line width required for arrowhead!
+#
+Positive line width required for arrowhead!
+#
+# 28 Error: Failed to calculate arrowhead angle!
+#
+Failed to calculate arrowhead angle!
+#
+# 29 Error: Illegal arrow type!
+#
+Illegal arrow type!
+#
+# 30 Error: Mathematical overflow in arrow calculation!
+#
+Mathematical overflow in arrow calculation!
+#
+# 31 Error: Iteration failed in arrow calculation!
+#
+Iteration failed in arrow calculation!
+#
+# 32 Error: Memory allocation failed in arrow calculation!
+#
+Memory allocation failed in arrow calculation!
+#
+# 33 Error: Failed to calculate number of points for arrow!
+#
+Failed to calculate number of points for arrow!
+#
+# 34 Error: Mathematical error in arrow calculation!
+#
+Mathematical error in arrow calculation!
+#
+# 35 Error: Arrowhead calculation on spline failed!
+#
+Arrowhead calculation on spline failed!
+#
+# 36 Error: Mathematical overflow in width/height calculation
+#
+Mathematical overflow in width/height calculation!
+#
+# 37 Error: File name too long!
+#
+File name too long!
+#
+# 38 Error: Failed to clip region!
+#
+Failed to clip region!
+#
+# 39 Error: X-spline calculation failed!
+#
+X-spline calculation failed!
+#
+# 40 Error: Failed to write text!
+#
+Failed to write text!
+#
+# 41 Error: Failed to set fill colour!
+#
+Failed to set fill colour!
+#
+# 42 Error: UTF-8 decoding failed!
+#
+UTF-8 decoding failed!
+#
+# 43 Error: Failed to create graphics object!
+#
+Failed to create graphics object!
+#
+# 44 Error: Failed to create forward arrowhead!
+#
+Failed to create forward arrowhead!
+#
+# 45 Error: Failed to create backward arrowhead!
+#
+Failed to create backward arrowhead!
+#
+# 46 Info: Line width 0, skipping object.
+#
+Line width 0, skipping object.
+#
+# 47 Error: Failed to create filled circle!
+#
+Failed to create filled circle!
+#
+# 48 Error: Failed to set up filling!
+#
+Failed to set up filling!
+#
+# 49 Error: Failed to set up filling and stroking!
+#
+Failed to set up filling and stroking!
+#
+# 50 Error: Failed to stroke path!
+#
+Failed to stroke path!
+#
+# 51 Error: Failed to set up stroking!
+#
+Failed to set up stroking!
+#
+# 52 Error: Failed to add bitmap image!
+#
+Failed to add bitmap image!
+#
+# 53 Error: Not a supported bitmap image type!
+#
+Not a supported bitmap image type!
+#
+# 54 Error: Failed to UTF-8 decode file name!
+#
+Failed to UTF-8 decode file name!
+#
+# 55 Error: Font size 0!
+#
+Font size 0!
+#
+# 56 Error: No text available!
+#
+No text available!
+#
+# 57 Error: First segment too short for arrowhead!
+#
+First segment too short for arrowhead!
+#
+# 58 Error: Final segment too short for arrowhead!
+#
+Final segment too short for arrowhead!
+#
+# 59 Error: Too few points!
+#
+Too few points!
+#
+# 60 Error: No points for object!
+#
+No points for object!
+#
+# 61 Error: Spline too short for arrowheads!
+#
+Spline too short for arrowheads!
+#
+# 62 Error: Forward arrowhead too long!
+#
+Forward arrowhead too long!
+#
+# 63 Error: Backward arrowhead too long!
+#
+Backward arrowhead too long!
+#
+# 64 Error: Arc too short for arrowheads!
+#
+Arc too short for arrowheads!
+#
+# 65 Error: Radius must not be 0!
+#
+Radius must not be 0!
+#
+# 66 Error: Box radius too large!
+#
+Box radius too large!
+#
+# 67 Error: Diameter must not be 0!
+#
+Diameter must not be 0!
+#
+# 68 Error: Positive width and height required!
+#
+Positive width and height required!
+#
+# 69 Error: File name for image required!
+#
+File name for image required!
+#
+# 70 Error: Illegal object type!
+#
+Illegal object type!
+#
+# 71 Error: Object check failed!
+#
+Object check failed!
+#
+# 72 Error: Failed to write graphics object!
+#
+Failed to write graphics object!
+#
+# 73 Error: Forward arrowhead calculation failed!
+#
+Forward arrowhead calculation failed!
+#
+# 74 Error: Backward arrowhead calculation failed!
+#
+Backward arrowhead calculation failed!
+#
+# 75 Error: Spline segment calculation failed!
+#
+Spline segment calculation failed!
+#
+# 76 Error: Failed to open output file(s)!
+#
+Failed to open output file(s)!
+#
+# 77 Error: Failed to write output!
+#
+Failed to write output!
+#
+# 78 Error: Skipping output due to previous errors!
+#
+Skipping output due to previous errors!
+#
+# 79 Error: Segment length calculation failed!
+#
+Segment length calculation failed!
+#
+# 80 Error: Cut calculation for arrowhead failed!
+#
+Cut calculation for arrowhead failed!
+#
+# 81 Error: Memory allocation failed!
+#
+Memory allocation failed!
+#
+# 82 83 Error: Not an 8-bit unsigned number!
+#
+Not an 8-bit unsigned number: "
+"!
+#
+# 84 85 Error: Not an 8-bit number!
+#
+Not an 8-bit number: "
+"!
+#
+# 86 87 Error: Not a 16-bit unsigned number!
+#
+Not a 16-bit unsigned number: "
+"!
+#
+# 88 89 Error: Not a 16-bit number!
+#
+Not a 16-bit number: "
+"!
+#
+# 90 91 Error: Not a 32-bit unsigned number!
+#
+Not a 32-bit unsigned number: "
+"!
+#
+# 92 93 Error: Not a 32-bit number!
+#
+Not a 32-bit number: "
+"!
+#
+# 94 Warning: File format version newer than reader module!
+#
+File format version newer than reader module!
+#
+# 95 Error: Illegal bounding box!
+#
+Syntax, bounding box width or height is 0!
+#
+# 96 Error: Invalid number of texts in line!
+#
+Syntax, invalid number of texts in line!
+#
+# 97 Error: Base line width must be positive!
+#
+Syntax, base line width must be positive!
+#
+# 98 Error: Too few numbers in line!
+#
+Syntax, too few numbers in line!
+#
+# 99 Warning: Line style corrected.
+#
+Syntax, line style corrected.
+#
+# 100 Warning: Style length corrected.
+#
+Syntax, style length corrected.
+#
+# 101 Warning: Cap style corrected.
+#
+Syntax, cap style corrected.
+#
+# 102 Warning: Join style corrected.
+#
+Syntax, join style corrected.
+#
+# 103 Warning: Miter limit corrected.
+#
+Syntax, miter limit corrected.
+#
+# 104 105 Warning: Arrow type corrected.
+#
+Syntax, forward arrow type corrected.
+Syntax, backward arrow type corrected.
+#
+# 106 107 Warning: Arrow length corrected.
+#
+Syntax, forward arrow length corrected.
+Syntax, backward arrow length corrected.
+#
+# 108 109 Warning: Arrow width corrected.
+#
+Syntax, forward arrow width corrected.
+Syntax, backward arrow width corrected.
+#
+# 110 Warning: Fill style corrected.
+#
+Syntax, fill style corrected.
+#
+# 111 Error: Closing too many groups!
+#
+Syntax, closing too many groups!
+#
+# 112 Error: Opening too many groups!
+#
+Syntax, opening too many groups!
+#
+# 113 Warning: Skipping object!
+#
+Skipping object!
+#
+# 114 Error: Illegal object type!
+#
+Syntax, illegal object type!
+#
+# 115 Error: Missing object type!
+#
+Syntax, missing object type!
+#
+# 116 Warning: Font index corrected.
+#
+Syntax, font index corrected.
+#
+# 117 Warning: Text align corrected.
+#
+Syntax, text align corrected.
+#
+# 118 Warning: s parameter corrected.
+#
+Syntax, s parameter corrected.
+#
+# 119 Warning: Radius corrected.
+#
+Syntax, radius corrected.
+#
+# 120 Warning: Very small radius.
+#
+Syntax, very small radius.
+#
+# 121 Warning: RGB to gray conversion method corrected.
+#
+Syntax, RGB to gray conversion method corrected.
+#
+# 122 Error: Invalid image dimensions!
+#
+Syntax, invalid image dimensions!
+#
+# 123 Warning: Dot diameter corrected.
+#
+Syntax, dot diameter corrected.
+#
+# 124 Warning: Dot line width corrected.
+#
+Syntax, dot line width corrected.
+#
+# 125 Error: Empty export text!
+#
+Syntax, empty export text!
+#
+# 126 Error: Empty file name!
+#
+Syntax, empty file name!
+#
+# 127 Error: Object start line expected!
+#
+Syntax, object start line expected!
+#
+# 128 Error: Details line expected!
+#
+Syntax, details line expected!
+#
+# 129 Warning: Screen text expected!
+#
+Syntax, screen text expected!
+#
+# 130 Error: Unexpected end of file!
+#
+Syntax, unexpected end of file!
+$!end
+};
+
+
+
+/** Unit names usable in base line width specifications.
+*/
+static const dkChar *unit_names[] = {
+$!string-table macro=dkT
+bp
+pt
+mm
+cm
+in
+inch
+inches
+mil
+um
+$!end
+};
+
+
+/** Options to use with the program.
+*/
+static const dk4_option_specification_t wxd2lat_options[] = {
+
+ /* Output language: tex (PGF), pdf (PDF+TeX), eps (EPS+TeX).
+ */
+ { dkT('l'), dkT("language"), DK4_OPT_ARG_STRING },
+
+ /* Make mode, only convert if necessary.
+ */
+ { dkT('m'), dkT("make"), DK4_OPT_ARG_NONE },
+
+ /* Reset (do not use configuration files or preferences).
+ */
+ { dkT('R'), dkT("reset"), DK4_OPT_ARG_NONE },
+
+ /* Produce document instead of object.
+ */
+ { dkT('d'), dkT("document"), DK4_OPT_ARG_NONE },
+
+ /* Base line width.
+ */
+ { dkT('b'), dkT("base-linewidth"), DK4_OPT_ARG_STRING },
+
+ /* Line width for pattern drawing (default: base linewidth).
+ */
+ { dkT('p'), dkT("pattern-linewidth"), DK4_OPT_ARG_STRING },
+
+ { dkT('w'), dkT("white-background"), DK4_OPT_ARG_NONE }
+
+};
+
+
+
+/** Number of options in wxd2lat_options array.
+*/
+static const size_t sz_wxd2lat_options =
+sizeof(wxd2lat_options) / sizeof(dk4_option_specification_t);
+
+
+
+#ifdef SIGPIPE
+/** Indicator: SIGPIPE signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_pipe = 0;
+#endif
+
+
+
+/** Indicator: SIGINT signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_int = 0;
+
+
+
+/** Indicator: SIGTERM signal received.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t sig_had_term = 0;
+
+
+
+/** Pass a volatile pointer to an atomic integer.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ptr Address of atomic integer variable.
+ @return The unmodified pointer.
+*/
+static
+DK4_VOLATILE
+dk4_sig_atomic_t *
+sig_pass_pointer(DK4_VOLATILE dk4_sig_atomic_t *ptr)
+{
+ return ptr;
+}
+
+
+
+#ifdef SIGPIPE
+/** Handler for SIGPIPE signal.
+ @param signo Signal number (always SIGPIPE, ignored).
+*/
+static
+void
+sig_handler_pipe(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_pipe) = 1;
+}
+#endif
+
+
+
+/** Handler for SIGINT signal.
+ @param signo Signal number (always SIGINT, ignored).
+*/
+static
+void
+sig_handler_int(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_int) = 1;
+}
+
+
+
+/** Handler for SIGTERM signal.
+ @param signo Signal number (always SIGTERM, ignored).
+*/
+static
+void
+sig_handler_term(int DK4_ARG_UNUSED(signo) )
+{
+ DK4_UNUSED_ARG(signo)
+ *sig_pass_pointer(&sig_had_term) = 1;
+}
+
+
+
+/** Read value from volatile atomic type.
+ This function is necessary as some compilers mis-optimize
+ direct access to volatile variables (at least if you believe
+ one of the coding standards).
+ @param ap Pointer to volatile atomic variable.
+ @return Contents of the variable.
+*/
+static
+dk4_sig_atomic_t
+sig_read_atomic(DK4_VOLATILE dk4_sig_atomic_t *ap)
+{
+ return (*ap);
+}
+
+
+
+/** Check whether we can continue or if a signal was received.
+ @param check_pipe Flag: Check for occured SIGPIPE signal too.
+ @return 1 if the program can continue, 0 if a signal was received.
+*/
+static
+int
+sig_can_continue(
+#ifdef SIGPIPE
+int check_pipe
+#else
+int DK4_ARG_UNUSED(check_pipe)
+#endif
+)
+{
+ int back = 1;
+#ifndef SIGPIPE
+ DK4_UNUSED_ARG(check_pipe)
+#else
+ if (0 != check_pipe) {
+ if (0 != sig_read_atomic(&sig_had_pipe)) { back = 0; }
+ }
+#endif
+ if (0 != sig_read_atomic(&sig_had_int )) { back = 0; }
+ if (0 != sig_read_atomic(&sig_had_term)) { back = 0; }
+ return back;
+}
+
+
+
+
+/** Initialize job structure at start of program.
+ @param job Structure to initialize.
+*/
+static
+void
+job_init(wxd2lat_job_t *job)
+{
+ dk4gra_conf_init(&(job->grco));
+ job->ppp = NULL;
+ job->app = NULL;
+ job->msg = wxd2lat_kw_def;
+ job->sz_msg = (sizeof(wxd2lat_kw_def)/sizeof(DK4_PDKCHAR) - 1);
+ job->exval = EXIT_FAILURE;
+ job->make = 0;
+ job->uc2l = NULL;
+ job->baselw = -1.0; /* Use default from file or 0.45bp */
+ job->patlw = -1.0; /* Use default */
+ job->xsprec = 1.0 / 512.0;
+ job->xslprec = job->xsprec / 4.0;
+ job->use_prefs = 1;
+ job->fnb = NULL;
+ job->fno1 = NULL;
+ job->fno2 = NULL;
+ job->szfnb = 0;
+ job->whitebg = 0;
+ job->szwidth = 0;
+ job->szheight = 0;
+ job->shiftx = 0.0;
+ job->shifty = 0.0;
+}
+
+
+
+/** Check whether the file name ends on wxd.
+ @param filename File name to check.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+is_wxd_file(const dkChar *filename)
+{
+ const dkChar *ptr;
+ int back = 0;
+ $? "+ is_wxd_file \"%!ds\"", filename
+ if (NULL != filename) {
+ ptr = dk4path_get_suffix(filename, NULL);
+ if (NULL != ptr) { $? ". ptr = \"%!ds\"", ptr
+ if (0 == dk4str_casecmp(ptr, wxd2lat_kwnl[3])) {
+ back = 1;
+ }
+ }
+ }
+ $? "- is_wxd_file %d", back
+ return back;
+}
+
+
+
+/** Check whether we must produce one output file.
+ @param fno Buffer for output file name, containing base name.
+ @param szfno Size of fno buffer.
+ @param fn Source file name.
+ @param su Suffix to add to buffer.
+ @return 1 to run conversion, 0 to skip.
+*/
+static
+int
+check_one(dkChar *fno, size_t szfno, const dkChar *fn, const dkChar *su)
+{
+ int back = 1;
+ $? "+ check_one"
+ if (0 != dk4str_cat_s(fno, szfno, su, NULL)) {
+ $? ". source file \"%!ds\"", fn
+ $? ". destination file \"%!ds\"", fno
+ back = dk4makemode_must_rebuild(fno, fn);
+ }
+ $? "- check_one %d", back
+ return back;
+}
+
+
+
+/** Check whether we really must run a conversion.
+ @param job Job structure.
+ @param fn Source file name.
+ @return 1 to run conversion, 0 to skip.
+*/
+static
+int
+check_make(wxd2lat_job_t *job, const dkChar *fn)
+{
+ dkChar *pso = NULL;
+ int back = 1;
+ int res = 0;
+ $? "+ check_make \"%!ds\"", fn
+ if (0 != job->make) {
+ if (0 != dk4str_cpy_s(job->fno1, job->szfnb, fn, NULL)) {
+ if (0 != dk4str_cpy_s(job->fno2, job->szfnb, fn, NULL)) {
+ pso = dk4path_get_suffix(job->fno1, NULL);
+ if (NULL != pso) { *pso = dkT('\0'); }
+ pso = dk4path_get_suffix(job->fno2, NULL);
+ if (NULL != pso) { *pso = dkT('\0'); }
+ switch (job->grco.driver) {
+ case DK4_GRA_DRIVER_PGF : {
+ back = check_one(
+ job->fno1, job->szfnb, fn, wxd2lat_kwnl[8]
+ );
+ } break;
+ case DK4_GRA_DRIVER_PS: case DK4_GRA_DRIVER_EPS : {
+ res = check_one(
+ job->fno1, job->szfnb, fn, wxd2lat_kwnl[7]
+ );
+ if (0 == res) {
+ back = check_one(
+ job->fno2, job->szfnb, fn, wxd2lat_kwnl[4]
+ );
+ }
+ } break;
+ case DK4_GRA_DRIVER_PDF : {
+ res = check_one(
+ job->fno1, job->szfnb, fn,
+ wxd2lat_kwnl[
+ (DK4_GRA_PURPOSE_DOCUMENT == job->grco.purpose)
+ ? (6) : (5)
+ ]
+ );
+ if (0 == res) {
+ back = check_one(
+ job->fno2, job->szfnb, fn, wxd2lat_kwnl[4]
+ );
+ }
+ } break;
+ }
+ }
+ }
+ }
+ $? "- check_make %d", back
+ return back;
+}
+
+
+
+
+/** Process one regular file.
+ @param job Job structure.
+ @param xargv Name of file to process.
+*/
+static
+void
+process_one_file(wxd2lat_job_t *job, const dkChar *xargv)
+{
+ wxd_drawing_t *drw = NULL; /* Drawing to convert */
+ const dkChar *osf = NULL; /* Original source file */
+ dk4_um_t osl = 0UL; /* Original source line */
+ $? "+ process_one_file \"%!ds\"", xargv
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, xargv);
+ dk4app_set_log_source_line(job->app, 0UL);
+ if (0 != is_wxd_file(xargv)) {
+ if (0 != check_make(job, xargv)) {
+ drw = wxdrd_open_from_file(xargv,job);
+ if (NULL != drw) { $? ". success, have structure"
+ wxd2lat_output(drw, job, xargv);
+ wxdrd_close(drw);
+ }
+ else {
+ /* ERROR: Failed to read drawing, already reported */
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /* INFO: Destination files up to date */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_INFO, 3);
+ }
+ }
+ else {
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 4);
+ job->exval = EXIT_FAILURE;
+ }
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- process_one_file"
+}
+
+
+#if 0
+
+/** Process a directory.
+ @param job Job structure.
+ @param xargv Directory name.
+ @param docd Flag: chdir to specified directory.
+*/
+static
+void
+process_one_directory(wxd2lat_job_t *job, const dkChar *xargv, int docd)
+{
+ dkChar cdbuf[DK4_MAX_PATH]; /* Current directory */
+ dk4_er_t er; /* Error report */
+ dk4_dir_t *dir = NULL; /* Directory structure */
+ const dkChar *osf = NULL; /* Original source file */
+ const dkChar *shn = NULL; /* Short file name */
+ dk4_um_t osl = 0UL; /* Original source line */
+ int cc = 1; /* Flag: Can continue */
+ int res = 0; /* Operation result */
+ int canrun = 1; /* Flag: Can run */
+ $? "+ process_one_directory \"%!ds\"", xargv
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, xargv);
+ dk4app_set_log_source_line(job->app, 0UL);
+ /* PROGRESS: Start processing directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 5);
+ dk4error_init(&er);
+
+
+ if (0 != docd) {
+ canrun = 0;
+ if (0 != dk4getcwd(cdbuf, DK4_SIZEOF(cdbuf,dkChar), &er)) {
+
+#if 0
+ if (0 != dk4chdir(xargv, &er)) {
+ canrun = 1;
+ }
+ else {
+ /* ##### ERROR: Failed to change directory */
+ job->exval = EXIT_FAILURE;
+ }
+#endif
+
+
+ }
+ else {
+ /* ##### ERROR: Failed to find current directory */
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ if (0 != canrun) {
+ dir = dk4dir_open_app(xargv, DK4_DIR_OPEN_SORTED, job->app);
+ if (NULL != dir) {
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(dir);
+ if (NULL != shn) {
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ job->fnb, job->szfnb, dir, shn, &er
+ );
+ if (0 != res) {
+ if (0 != is_wxd_file(job->fnb)) {
+ if (0 != check_make(job, job->fnb)) {
+ process_one_file(job, job->fnb);
+ }
+ else {
+ /* ##### PROGRESS: Destination files up to date */
+ }
+ }
+ else {
+ /* ##### PROGRESS: Skipping non-wxd file */
+ }
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /* ##### ERROR: Failed to construct full path name */
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(dir);
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ if (0 != docd) {
+ if (0 == dk4chdir(cdbuf, &er)) {
+ /* ##### ERROR: Failed to return to directory */
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ /* PROGRESS: Finished processing directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 6);
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- process_one_directory"
+}
+
+#endif
+
+
+
+/** Process a directory specified by absolute path.
+ @param job Job structure.
+ @param xargv Directory name.
+ @param docd Flag: chdir to specified directory.
+*/
+static
+void
+process_absolute_directory(wxd2lat_job_t *job, const dkChar *dn, int docd)
+{
+ dk4_er_t er; /* Error report */
+ dkChar *cdbuf = NULL; /* Current directory */
+ dk4_dir_t *dir = NULL; /* Directory structure */
+ const dkChar *osf = NULL; /* Original source file */
+ const dkChar *shn = NULL; /* Short file name */
+ dk4_um_t osl = 0UL; /* Original source line */
+ int canrun = 1; /* Flag: Can run */
+ int cc = 1; /* Flag: Can continue */
+ int res = 0; /* Operation result */
+ $? "+ process_absolute_directory"
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, dn);
+ dk4app_set_log_source_line(job->app, 0UL);
+ /* PROGRESS: Start processing directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 5);
+ if (0 != docd) {
+ cdbuf = dk4getcwd_dup(NULL);
+ if (NULL != cdbuf) {
+ if (0 == dk4chdir(dn, NULL)) {
+ /* ERROR: Failed to change into directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 7);
+ job->exval = EXIT_FAILURE;
+ canrun = 0;
+ }
+ }
+ else {
+ /* ERROR: Failed to find current directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 8);
+ job->exval = EXIT_FAILURE;
+ canrun = 0;
+ }
+ }
+ if (0 != canrun) {
+ dir = dk4dir_open_app(dn, DK4_DIR_OPEN_SORTED, job->app);
+ if (NULL != dir) {
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(dir);
+ if (NULL != shn) {
+ dk4error_init(&er);
+ res = dk4dir_full_name_buffer(
+ job->fnb, job->szfnb, dir, shn, &er
+ );
+ if (0 != res) {
+ if (0 != is_wxd_file(job->fnb)) {
+ if (0 != check_make(job, job->fnb)) {
+ process_one_file(job, job->fnb);
+ }
+ else {
+ /* PROGRESS: Destination files are up to date */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_PROGRESS, 9
+ );
+ }
+ }
+ else {
+ /* PROGRESS: Skipping non-wxd file */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_PROGRESS, 10
+ );
+ }
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to construct full path name */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 11
+ );
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(dir);
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ if (NULL != cdbuf) {
+ if (docd) {
+ if (0 == dk4chdir(cdbuf, NULL)) {
+ /* ERROR: Failed to change back to original directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 12);
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ dk4mem_free(cdbuf);
+ cdbuf = NULL;
+ }
+ /* PROGRESS: Finished processing directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 6);
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- process_absolute_directory"
+}
+
+
+
+/** Process a directory specified by relative path.
+ @param job Job structure.
+ @param xargv Directory name.
+ @param docd Flag: chdir to specified directory.
+*/
+static
+void
+process_relative_directory(wxd2lat_job_t *job, const dkChar *dn, int docd)
+{
+ dkChar cdbuf[DK4_MAX_PATH];
+
+ if (0 != dk4getcwd(cdbuf, DK4_SIZEOF(cdbuf,dkChar), NULL)) {
+ if (0 != dk4path_append(cdbuf, DK4_SIZEOF(cdbuf,dkChar), dn, NULL)) {
+ process_absolute_directory(job, cdbuf, docd);
+ }
+ else {
+ /* ERROR: Failed to construct absolute path */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 13);
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ /* ERROR: Failed to find current working directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 8);
+ job->exval = EXIT_FAILURE;
+ }
+}
+
+
+
+/** Process a directory.
+ @param job Job structure.
+ @param xargv Directory name.
+ @param docd Flag: chdir to specified directory.
+*/
+static
+void
+process_one_directory(wxd2lat_job_t *job, const dkChar *dn, int docd)
+{
+ if (0 != dk4path_is_absolute(dn)) {
+ process_absolute_directory(job, dn, docd);
+ }
+ else {
+ process_relative_directory(job, dn, docd);
+ }
+}
+
+
+
+/** Process one command line argument.
+ @param job Job structure.
+ @param xargv Command line argument to process.
+*/
+static
+void
+process_one_name(wxd2lat_job_t *job, const dkChar *xargv)
+{
+ const dkChar *osf = NULL; /* Original source file */
+ dk4_um_t osl = 0UL; /* Original source line */
+ $? "+ process_one_name \"%!ds\"", xargv
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, xargv);
+ dk4app_set_log_source_line(job->app, 0UL);
+ if (0 != dk4file_is_directory(xargv, NULL)) { $? ". directory"
+ process_one_directory(job, xargv, 1);
+ }
+ else {
+ if (0 != dk4file_is_regular(xargv, NULL)) { $? ". file"
+ process_one_file(job, xargv);
+ }
+ else {
+ if (0 != dk4file_exists(xargv, NULL)) { $? "! not regular"
+ /* ERROR: Not a reglar file */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 14);
+ }
+ else { $? "! not exist"
+ /* ERROR: No such file */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 15);
+ }
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- process_one_name"
+}
+
+
+
+#if DK4_ON_WINDOWS
+
+static
+void
+expand_and_process(wxd2lat_job_t *job, const dkChar *xargv)
+{
+ dkChar fnb[DK4_MAX_PATH]; /* Buffer for full path name */
+ dk4_er_t er; /* Error report */
+ dk4_dir_t *fne; /* File name expander */
+ const dkChar *osf = NULL; /* Original source file */
+ const dkChar *shn = NULL; /* Short file name */
+ dk4_um_t osl = 0UL; /* Original source line */
+ int anyfound = 0; /* Flag: Any matching file found */
+ int cc = 1; /* Flag: Can continue */
+ int res = 0; /* Operation result */
+ $? "+ expand_and_process \"%!ds\"", xargv
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, xargv);
+ dk4app_set_log_source_line(job->app, 0UL);
+ /* PROGRESS: Start processing file name pattern */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 16);
+ fne = dk4app_fne_open(xargv, job->app);
+ if (NULL != fne) {
+ cc = 1;
+ dk4error_init(&er);
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_dir(fne);
+ if (NULL != shn) {
+ res = dk4dir_full_name_buffer(
+ fnb, DK4_SIZEOF(fnb,dkChar), fne, shn, &er
+ );
+ if (0 != res) {
+ process_one_directory(job, fnb, 1);
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to construct full path name */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 11
+ );
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ cc = 1;
+ while ((1 == cc) && (0 != sig_can_continue(0))) {
+ shn = dk4dir_next_file(fne);
+ if (NULL != shn) {
+ res = dk4dir_full_name_buffer(
+ fnb, DK4_SIZEOF(fnb,dkChar), fne, shn, &er
+ );
+ if (0 != res) {
+ process_one_file(job, fnb);
+ }
+ else {
+ cc = 0;
+ job->exval = EXIT_FAILURE;
+ /* ERROR: Failed to construct full path name */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 11
+ );
+ }
+ }
+ else {
+ cc = 0;
+ }
+ }
+ dk4dir_close(fne);
+ if ((0 != sig_can_continue(0)) && (0 == anyfound)) {
+ job->exval = EXIT_FAILURE;
+ /* ERROR: No such file */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 15);
+ }
+ }
+ else {
+ job->exval = EXIT_FAILURE;
+ }
+ /* PROGRESS: Finished processing file name pattern */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_PROGRESS, 17);
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ $? "- expand_and_process"
+}
+
+#endif
+
+
+
+static
+void
+process_current_directory(wxd2lat_job_t *job)
+{
+ dkChar dnb[DK4_MAX_PATH];
+
+ if (0 != dk4getcwd(dnb, DK4_SIZEOF(dnb,dkChar), NULL)) {
+ process_one_directory(job, dnb, 0);
+ }
+ else {
+ /* ERROR: Failed to find current directory */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 8);
+ }
+}
+
+
+
+/** Run for file specified on the command line.
+ If no file on command line specified, run on current directory.
+ @param job Job structure.
+*/
+static
+void
+process_all_input_files(wxd2lat_job_t *job)
+{
+ dkChar const *xargv; /* Current cmd line arg to process */
+ int xargc; /* Number of command line arguments */
+ int i; /* Index of current cmd line arg */
+ $? "+ process_all_input_files"
+ xargc = dk4app_get_argc(job->app);
+ if (0 < xargc) {
+ for (i = 0; ((i < xargc) && (0 != sig_can_continue(0))); i++) {
+ xargv = dk4app_get_argv(job->app, i);
+ if (NULL != xargv) {
+#if DK4_ON_WINDOWS
+ if (0 != dk4path_must_expand(xargv)) {
+ expand_and_process(job, xargv);
+ }
+ else {
+ process_one_name(job, xargv);
+ }
+#else
+ process_one_name(job, xargv);
+#endif
+ }
+ else {
+ }
+ }
+ }
+ else {
+ /* No names specified, process current directory
+ */
+ process_current_directory(job);
+ }
+ $? "- process_all_input_files"
+}
+
+
+
+/** Get base line width from string.
+ @param job Job structure to modify.
+ @param src Source text.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+get_line_width_from_text(wxd2lat_job_t *job, double *dptr, dkChar const *src)
+{
+ dk4_er_t er;
+ const dkChar *ep = NULL;
+ double v;
+ int back = 0;
+ int res = 0;
+
+ dk4error_init(&er);
+ $? "+ get_line_width_from_text"
+ if ((NULL != job) && (NULL != src)) {
+ back = dk4ma_input_dk_double(&v, src, &ep, 2, &er);
+ if (1 == back) {
+ if ((NULL != ep) && (0U != dk4str_len(ep))) {
+ res = dk4str_array_index(unit_names, ep, 0);
+ if (0 <= res) {
+ switch (res) {
+ case 0: { /* bp */
+ } break;
+ case 1: { /* pt */
+ v *= (72.0 / 72.27);
+ } break;
+ case 2: { /* mm */
+ v *= (72.0 / 25.4);
+ } break;
+ case 3: { /* cm */
+ v *= (72.0 / 2.54);
+ } break;
+ case 4: case 5: case 6: { /* in */
+ v *= 72.0;
+ } break;
+ case 7: { /* mil */
+ v *= (72.0 / 1000.0);
+ } break;
+ case 8: { /* um */
+ v *= (72.0 / 25400.0);
+ } break;
+ }
+ }
+ else { $? "! illegal unit name %s", ep
+ back = 0;
+ /* ERROR: Unknown unit name */
+ dk4app_log_3(
+ job->app, job->msg, job->sz_msg, DK4_LL_INFO, 18,19,ep
+ );
+ }
+ }
+ }
+ else {
+ /* ERROR: Failed to read number */
+ dk4app_log_3(
+ job->app, job->msg, job->sz_msg, DK4_LL_INFO, 20, 21, src
+ );
+ }
+ if (1 == back) {
+ *dptr = v;
+ }
+ }
+ $? "- get_line_width_from_text %d %g", back, v
+ return back;
+}
+
+
+
+
+/** Run normally after applying signal handlers.
+ @param job Job structure.
+*/
+static
+void
+w2l_normal_run(wxd2lat_job_t *job)
+{
+ const dkChar *lpo;
+ int ok = 1;
+ $? "+ w2l_normal_run"
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('R'), NULL)) {
+ job->use_prefs = 0;
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('m'), NULL)) {
+ job->make = 1; $? ". make mode"
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('d'), NULL)) {
+ (job->grco).purpose = DK4_GRA_PURPOSE_DOCUMENT;
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('b'), NULL)) {
+ lpo = dk4app_opt_get_string_ptr_short(job->app, dkT('b'), NULL);
+ if (NULL != lpo) {
+ if (0 == get_line_width_from_text(job, &(job->baselw), lpo)) {
+ ok = 0;
+ }
+ }
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('p'), NULL)) {
+ lpo = dk4app_opt_get_string_ptr_short(job->app, dkT('p'), NULL);
+ if (NULL != lpo) {
+ if (0 == get_line_width_from_text(job, &(job->patlw), lpo)) {
+ ok = 0;
+ }
+ }
+ }
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('w'), NULL)) {
+ job->whitebg = 1;
+ }
+
+ if (0 != dk4app_opt_is_set_short(job->app, dkT('l'), NULL)) {
+ lpo = dk4app_opt_get_string_ptr_short(job->app, dkT('l'), NULL);
+ if (NULL != lpo) {
+#if 0
+ job->ot = dk4str_array_index(output_language_names, lpo, 0);
+ if (0 > job->ot) { $? "! illegal output language name"
+ ok = 0;
+ /* ##### ERROR: Illegal output language name */
+ }
+#endif
+ ok = dk4gra_conf_setup(
+ &(job->grco), lpo, job->use_prefs,
+ DK4_GRA_CONF_SCOPE_FIG2LAT, job->app
+ );
+ }
+#if TRACE_DEBUG
+ else { $? "! no argument to -l"
+ }
+#endif
+ }
+ if (0 != ok) {
+ job->uc2l = dk4uc2l_open_from_app(job->app);
+ if (NULL != job->uc2l) {
+ job->exval = EXIT_SUCCESS;
+ process_all_input_files(job);
+ dk4uc2l_close(job->uc2l);
+ job->uc2l = NULL;
+ }
+ else { $? "! failed to open job->uc2l"
+ /* ERROR: No Unicode to LaTeX structure, already reported */
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! cannot recover from previous errors"
+ }
+#endif
+ $? "- w2l_normal_run"
+}
+
+
+
+#if DK4_HAVE_SIGACTION
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+w2l_run_with_signal_handlers(wxd2lat_job_t *job)
+{
+#ifdef SIGPIPE
+ struct sigaction opipe;
+#endif
+ struct sigaction oint;
+#ifdef SIGPIPE
+ struct sigaction npipe;
+#endif
+ struct sigaction nint;
+ struct sigaction oterm;
+ struct sigaction nterm;
+ int success = 0;
+
+#ifdef SIGPIPE
+ /* Set up signal handling for SIGPIPE.
+ */
+ DK4_MEMRES(&npipe, sizeof(npipe));
+ npipe.sa_handler = sig_handler_pipe;
+ npipe.sa_flags = 0;
+ if (0 != sigemptyset(&npipe.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto finished;
+ }
+ if (0 != sigaddset(&npipe.sa_mask, SIGPIPE)) {
+ /* ERROR: Failed to set up masked signal set for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto finished;
+ }
+ if (0 != sigaction(SIGPIPE, &npipe, &opipe)) {
+ /* ERROR: Failed to set up signal handler for SIGPIPE */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto finished;
+ }
+#endif
+
+ /* Set up signal handling for SIGINT.
+ */
+ DK4_MEMRES(&nint, sizeof(nint));
+ nint.sa_handler = sig_handler_int;
+ nint.sa_flags = 0;
+ if (0 != sigemptyset(&nint.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaddset(&nint.sa_mask, SIGINT)) {
+ /* ERROR: Failed to set up masked signal set for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+ if (0 != sigaction(SIGINT, &nint, &oint)) {
+ /* ERROR: Failed to set up signal handler for SIGINT */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_pipe;
+ }
+
+ /* Set up signal handling for SIGTERM
+ */
+ DK4_MEMRES(&nterm, sizeof(nterm));
+ nterm.sa_handler = sig_handler_term;
+ nterm.sa_flags = 0;
+ if (0 != sigemptyset(&nterm.sa_mask)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_int;
+ }
+ if (0 != sigaddset(&nterm.sa_mask, SIGTERM)) {
+ /* ERROR: Failed to set up masked signal set for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_int;
+ }
+ if (0 != sigaction(SIGTERM, &nterm, &oterm)) {
+ /* ERROR: Failed to set up signal handler for SIGTERM */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 1);
+ goto restore_old_int;
+ }
+
+ success = 1;
+ w2l_normal_run(job);
+
+ /* Restore signal handling for SIGTERM.
+ */
+ if (0 != sigaction(SIGTERM, &oterm, NULL)) {
+ /* ERROR: Failed to restore old SIGTERM settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 2);
+ success = 0;
+ }
+
+ /* Restore signal handling for SIGINT.
+ */
+ restore_old_int:
+ if (0 != sigaction(SIGINT, &oint, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 2);
+ success = 0;
+ }
+
+#ifdef SIGPIPE
+ /* Restore signal handling for SIGPIPE.
+ */
+ restore_old_pipe:
+ if (0 != sigaction(SIGPIPE, &opipe, NULL)) {
+ /* ERROR: Failed to restore old SIGPIPE settings */
+ dk4app_log_1(job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 2);
+ success = 0;
+ }
+#endif
+
+ /* Set exit status code if error occured.
+ */
+ finished:
+ if (0 == success) { job->exval = EXIT_FAILURE; }
+}
+#else
+#if DK4_HAVE_SIGSET
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+w2l_run_with_signal_handlers(wxd2lat_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = sigset(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = sigset(SIGINT, sig_handler_int);
+ oldterm = sigset(SIGTERM, sig_handler_term);
+ w2l_normal_run(job);
+ sigset(SIGTERM, oldterm);
+ sigset(SIGINT, oldint);
+#ifdef SIGPIPE
+ sigset(SIGPIPE, oldpipe);
+#endif
+}
+#else
+#if DK4_HAVE_SIGNAL
+/** Set signal handlers and run.
+ @param job Job structure.
+*/
+static
+void
+w2l_run_with_signal_handlers(wxd2lat_job_t *job)
+{
+#ifdef SIGPIPE
+ dk4_sig_handler_t *oldpipe = NULL;
+#endif
+ dk4_sig_handler_t *oldint = NULL;
+ dk4_sig_handler_t *oldterm = NULL;
+
+#ifdef SIGPIPE
+ oldpipe = signal(SIGPIPE, sig_handler_pipe);
+#endif
+ oldint = signal(SIGINT, sig_handler_int);
+ oldterm = signal(SIGTERM, sig_handler_term);
+ w2l_normal_run(job);
+ signal(SIGTERM, oldterm);
+ signal(SIGINT, oldint);
+#ifdef SIGPIPE
+ signal(SIGPIPE, oldpipe);
+#endif
+}
+#else
+/** Set signal handlers and run.
+*/
+static
+void
+w2l_run_with_signal_handlers(void)
+{
+ w2l_normal_run();
+}
+#endif
+#endif
+#endif
+
+
+
+/** Buffer for full file name.
+*/
+static dkChar wxd2lat_filename_buffer[DK4_MAX_PATH];
+
+/** Buffer for output file name.
+*/
+static dkChar wxd2lat_filename_o1[ DK4_SIZEOF(wxd2lat_filename_buffer,dkChar) ];
+
+/** Buffer for second output file name.
+*/
+static dkChar wxd2lat_filename_o2[ DK4_SIZEOF(wxd2lat_filename_buffer,dkChar) ];
+
+
+/** Main function.
+ @param argc Number of command line arguments.
+ @param argv Command line arguments array.
+ @return 0 on success, all other values indicate errors.
+*/
+#if DK4_CHAR_SIZE > 1
+int wmain(int argc, wchar_t *argv[])
+#else
+int main(int argc, char *argv[])
+#endif
+{
+ wxd2lat_job_t job;
+ $!trace-init wxd2lat.deb
+ $? "+ main"
+ dk4fput_initialize_stderr();
+ job_init(&job);
+ job.fnb = wxd2lat_filename_buffer;
+ job.fno1 = wxd2lat_filename_o1;
+ job.fno2 = wxd2lat_filename_o2;
+ job.szfnb = DK4_SIZEOF(wxd2lat_filename_buffer,dkChar);
+ job.app = dk4app_open_cmd(
+ argc, argv, wxd2lat_options, sz_wxd2lat_options,
+ wxd2lat_kwnl[0], DKT_VERSION_DK,
+ wxd2lat_kwnl[1], wxd2lat_help_text, w2llic_get_text()
+ );
+ if (NULL != job.app) {
+ job.sz_msg = dk4app_string_table_size(wxd2lat_kw_def);
+ job.msg = dk4app_string_table(
+ job.app, wxd2lat_kwnl[2], wxd2lat_kw_def
+ );
+ if (0 != dk4app_can_run_normally(job.app)) {
+ w2l_run_with_signal_handlers(&job);
+ }
+ else {
+ if (0 != dk4app_help_version_license(job.app)) {
+ job.exval = EXIT_SUCCESS;
+ }
+ }
+ dk4app_close(job.app);
+ }
+ else {
+ }
+ fflush(stderr);
+ dk4fput_cleanup_stderr();
+ $? "- main %d", job.exval
+ $!trace-end
+ exit(job.exval); return job.exval;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxd2lat.h b/support/dktools/wxd2lat.h
new file mode 100644
index 0000000000..4daa2e197e
--- /dev/null
+++ b/support/dktools/wxd2lat.h
@@ -0,0 +1,299 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxd2lat.ctr
+*/
+
+/** @file wxd2lat.h Header file for the wxd2lat module.
+*/
+
+#ifndef WXD2LAT_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXD2LAT_H_INCLUDED 1
+
+
+#line 8 "wxd2lat.ctr"
+
+#ifndef DK4CONF_H_INCLUDED
+#include "dk4conf.h"
+#endif
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#define _USE_MATH_DEFINES
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4NUMCO_H_INCLUDED
+#include "dk4numco.h"
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include "dk4mem.h"
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include "dk4str8.h"
+#endif
+
+#ifndef DK4STRD_H_INCLUDED
+#include "dk4strd.h"
+#endif
+
+#ifndef DK4REC27_H_INCLUDED
+#include "dk4rec27.h"
+#endif
+
+#ifndef DK4VERS_H_INCLUDED
+#include "dk4vers.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4ITER_H_INCLUDED
+#include "dk4iter.h"
+#endif
+
+#ifndef DK4MAAI32_H_INCLUDED
+#include "dk4maai32.h"
+#endif
+
+#ifndef DK4MAADI_H_INCLUDED
+#include "dk4maadi.h"
+#endif
+
+#ifndef DK4MAASZ_H_INCLUDED
+#include "dk4maasz.h"
+#endif
+
+#ifndef DK4MAI8DBL_H_INCLUDED
+#include "dk4mai8dbl.h"
+#endif
+
+#ifndef DK4MAIDDBL_H_INCLUDED
+#include "dk4maiddbl.h"
+#endif
+
+#ifndef DK4MAI8DU8_H_INCLUDED
+#include "dk4mai8du8.h"
+#endif
+
+#ifndef DK4MAI8DI8_H_INCLUDED
+#include "dk4mai8di8.h"
+#endif
+
+#ifndef DK4MAI8DU16_H_INCLUDED
+#include "dk4mai8du16.h"
+#endif
+
+#ifndef DK4MAI8DI16_H_INCLUDED
+#include "dk4mai8di16.h"
+#endif
+
+#ifndef DK4MAI8DU32_H_INCLUDED
+#include "dk4mai8du32.h"
+#endif
+
+#ifndef DK4MAI8DI32_H_INCLUDED
+#include "dk4mai8di32.h"
+#endif
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef DK4AOPT_H_INCLUDED
+#include "dk4aopt.h"
+#endif
+
+#ifndef DK4XSP_H_INCLUDED
+#include "dk4xsp.h"
+#endif
+
+#ifndef DK4UC2LA_H_INCLUDED
+#include "dk4uc2la.h"
+#endif
+
+#ifndef DK4GRCO_H_INCLUDED
+#include "dk4grco.h"
+#endif
+
+#ifndef DK4GRCOA_H_INCLUDED
+#include "dk4grcoa.h"
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#include "dk4bif.h"
+#endif
+
+#ifndef DK4BIFAP_H_INCLUDED
+#include "dk4bifap.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include "dk4grat.h"
+#endif
+
+#ifndef DK4FILED_H_INCLUDED
+#include "dk4filed.h"
+#endif
+
+#ifndef DK4PATHD_H_INCLUDED
+#include "dk4pathd.h"
+#endif
+
+#ifndef DK4DIR_H_INCLUDED
+#include "dk4dir.h"
+#endif
+
+#ifndef DK4DIRA_H_INCLUDED
+#include "dk4dira.h"
+#endif
+
+#ifndef DK4FOPDA_H_INCLUDED
+#include "dk4fopda.h"
+#endif
+
+#ifndef DK4STO_H_INCLUDED
+#include "dk4sto.h"
+#endif
+
+#ifndef DK4CS_H_INCLUDED
+#include "dk4cs.h"
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include "dk4mpl.h"
+#endif
+
+#ifndef DK4MM_H_INCLUDED
+#include "dk4mm.h"
+#endif
+
+#ifndef DK4FPUT_H_INCLUDED
+#include "dk4fput.h"
+#endif
+
+#ifndef DK4PPPT_H_INCLUDED
+#include "dk4pppt.h"
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include "dk4unused.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+#ifndef WXDENUM_H_INCLUDED
+#include "wxdenum.h"
+#endif
+
+
+/** Conversion job structure.
+*/
+typedef struct {
+ dk4_gra_conf_t grco; /**< Graphics conversion options. */
+ dk4_pppt_t *ppp; /**< Output structure. */
+ dkChar *fnb; /**< File name buffer. */
+ dkChar *fno1; /**< Output file name 1. */
+ dkChar *fno2; /**< Output file name 2. */
+ dk4_app_t *app; /**< Application structure. */
+ dk4_uc2l_t *uc2l; /**< Unicode to LaTeX structure. */
+ const dkChar * const *msg; /**< Localized or default texts. */
+ double baselw; /**< Base line width in bp. */
+ double patlw; /**< Pattern line width in bp. */
+ double shiftx; /**< X shift value. */
+ double shifty; /**< Y shift value. */
+ double xsprec; /**< Precision X-spl iteration. */
+ double xslprec; /**< Precision length iteration. */
+ size_t szwidth; /**< Width in bp. */
+ size_t szheight; /**< Height in bp. */
+ size_t sz_msg; /**< Number of texts in msg. */
+ size_t szfnb; /**< Size of file name buffer. */
+ int exval; /**< Exit status code. */
+ int make; /**< Flag: Behave like make. */
+ int use_prefs; /**< Flag: Use preferences. */
+ int whitebg; /**< Flag: White background. */
+} wxd2lat_job_t;
+
+
+#ifndef F2LLIC_H_INCLUDED
+#include "w2llic.h"
+#endif
+
+#ifndef WXDSTR_H_INCLUDED
+#include "wxdstr.h"
+#endif
+
+#ifndef WXDCOMP_H_INCLUDED
+#include "wxdcomp.h"
+#endif
+
+#ifndef WXDOBJ_H_INCLUDED
+#include "wxdobj.h"
+#endif
+
+#ifndef WXDRD_H_INCLUDED
+#include "wxdrd.h"
+#endif
+
+#ifndef WXD2LAH_H_INCLUDED
+#include "wxd2lah.h"
+#endif
+
+#ifndef WXD2LXS_H_INCLUDED
+#include "wxd2lxs.h"
+#endif
+
+#ifndef WXDARC_H_INCLUDED
+#include "wxdarc.h"
+#endif
+
+#ifndef WXD2LOUT_H_INCLUDED
+#include "wxd2lout.h"
+#endif
+
+
+/** Output types.
+*/
+enum {
+ /** PGF instructions.
+ */
+ OUTPUT_PGF = 0 ,
+
+ /** PDF+TeX file pair.
+ */
+ OUTPUT_PDF ,
+
+ /** EPS+TeX file pair.
+ */
+ OUTPUT_EPS
+};
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+
+#endif
diff --git a/support/dktools/wxd2lat.rc b/support/dktools/wxd2lat.rc
new file mode 100644
index 0000000000..a45b454402
--- /dev/null
+++ b/support/dktools/wxd2lat.rc
@@ -0,0 +1,37 @@
+aaaaa ICON wxdkdraw.ico
+
+#include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Wxdkdraw to LaTeX converter\0"
+ VALUE "CompanyName", "Dirk Krause\0"
+ VALUE "FileDescription", "Wxdkdraw to LaTeX converter\0"
+ VALUE "FileVersion", "4.30.2\0"
+ VALUE "InternalName", "wxd2lat\0"
+ VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
+ VALUE "ProductName", "Dirk Krause's tools\0"
+ VALUE "ProductVersion", "4.30.2\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
diff --git a/support/dktools/wxd2lout.c b/support/dktools/wxd2lout.c
new file mode 100644
index 0000000000..40d2047fc5
--- /dev/null
+++ b/support/dktools/wxd2lout.c
@@ -0,0 +1,4092 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxd2lout.ctr
+*/
+
+/** @file wxd2lout.c The wxd2lout module.
+*/
+
+
+#line 65 "wxd2lout.ctr"
+
+#ifndef WXD2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+
+
+
+
+#line 73 "wxd2lout.ctr"
+
+
+
+static const dkChar *kwnl[] = {
+/* 0 */
+dkT(".tex"),
+
+NULL
+
+
+#line 83 "wxd2lout.ctr"
+};
+
+
+
+double
+wxd2lout_convert_x(wxd_drawing_t *drw, wxd2lat_job_t *job, double x)
+{
+#if TRACE_DEBUG
+ double back;
+
+
+#line 93 "wxd2lout.ctr"
+ back = ((9.0 * (x - drw->bbxl)) / 2032000.0) + job->shiftx;
+
+
+#line 95 "wxd2lout.ctr"
+ return back;
+#else
+ return (((9.0 * (x - drw->bbxl)) / 2032000.0) + job->shiftx);
+#endif
+}
+
+
+
+double
+wxd2lout_convert_y(wxd_drawing_t *drw, wxd2lat_job_t *job, double y)
+{
+#if TRACE_DEBUG
+ double back;
+
+
+#line 109 "wxd2lout.ctr"
+ back = ((9.0 * (y - drw->bbyb)) / 2032000.0) + job->shifty;
+
+
+#line 111 "wxd2lout.ctr"
+ return back;
+#else
+ return (((9.0 * (y - drw->bbyb)) / 2032000.0) + job->shifty);
+#endif
+}
+
+
+
+/** Convert distance value from WXD coordinates to bp.
+ @param r Distance to convert
+ @return Conversion result.
+*/
+double
+wxd2lout_convert_r(double r)
+{
+#if TRACE_DEBUG
+ double back;
+
+
+#line 129 "wxd2lout.ctr"
+ back = ((9.0 * r) / 2032000.0);
+
+
+#line 131 "wxd2lout.ctr"
+ return back;
+#else
+ return ((9.0 * r) / 2032000.0);
+#endif
+}
+
+
+
+
+/** Prepare job structure, calculate coordinates transformations
+ and create output file name.
+ @param drw Drawing to convert.
+ @param job Job structure.
+ @param fn File name.
+ @return 1 on success (output possible), 0 on error.
+*/
+static
+int
+wxd2lout_prepare_job(wxd_drawing_t *drw, wxd2lat_job_t *job, const dkChar *fn)
+{
+ dkChar *ptr;
+ double dwidth;
+ double dheight;
+ double cwidth;
+ double cheight;
+ int back = 1;
+
+
+#line 158 "wxd2lout.ctr"
+ dwidth = (9.0 * (drw->bbxr - drw->bbxl)) / 2032000.0;
+ dheight = (9.0 * (drw->bbyt - drw->bbyb)) / 2032000.0;
+ cwidth = ceil(dwidth);
+ cheight = ceil(dheight);
+ if (cwidth > dwidth) {
+ job->shiftx = (cwidth - dwidth) / 2.0;
+
+
+#line 165 "wxd2lout.ctr"
+ }
+ if (cheight > dheight) {
+ job->shifty = (cheight - dheight) / 2.0;
+
+
+#line 169 "wxd2lout.ctr"
+ }
+ if ((0 == dk4ma_is_finite(dwidth)) || (0 == dk4ma_is_finite(cwidth))) {
+ back = 0;
+ /* ERROR: Numeric overflow in width calculation */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 36
+ );
+ }
+ if ((0 == dk4ma_is_finite(dheight)) || (0 == dk4ma_is_finite(cheight))) {
+ back = 0;
+ /* ERROR: Numeric overflow in height calculation */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 36
+ );
+ }
+ if ((double)(SIZE_MAX) < cwidth) {
+ back = 0;
+ /* ERROR: Numeric overflow in width calculation */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 36
+ );
+ }
+ else {
+ job->szwidth = (size_t)cwidth;
+
+
+#line 194 "wxd2lout.ctr"
+ }
+ if ((double)(SIZE_MAX) < cheight) {
+ back = 0;
+ /* ERROR: Numeric overflow in height calculation */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 36
+ );
+ }
+ else {
+ job->szheight = (size_t)cheight;
+
+
+#line 205 "wxd2lout.ctr"
+ }
+ if (0 != dk4str_cpy_s(job->fno1, job->szfnb, fn, NULL)) {
+ ptr = dk4path_get_suffix(job->fno1, NULL);
+ if (NULL != ptr) { *ptr = dkT('\0'); }
+ if (0 == dk4str_cat_s(job->fno1, job->szfnb, kwnl[0], NULL)) {
+ back = 0;
+ /* ERROR: File name too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 37
+ );
+ }
+ }
+ else {
+ /* ERROR: File name too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 37
+ );
+ back = 0;
+ }
+
+
+#line 225 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Set clip region to used coordinates ranges.
+ @param drw Drawing to convert.
+ @param job Job structure.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_clip_to_used_region(wxd2lat_job_t *job)
+{
+ dk4_er_t er;
+ int back = 1;
+ double xl;
+ double xr;
+ double yb;
+ double yt;
+
+
+#line 246 "wxd2lout.ctr"
+ if ((0.0 < job->shiftx) || (0.0 < job->shifty)) {
+ xl = job->shiftx;
+ if (0.0 > xl) { xl = 0.0; }
+ xr = (double)(job->szwidth) - job->shiftx;
+ yb = job->shifty;
+ if (0.0 > yb) { yb = 0.0; }
+ yt = (double)(job->szheight) - job->shifty;
+ dk4error_init(&er);
+ dk4pppt_newpath_moveto(job->ppp, xl, yb, NULL, &back, &er);
+ dk4pppt_lineto(job->ppp, xr, yb, NULL, &back, &er);
+ dk4pppt_lineto(job->ppp, xr, yt, NULL, &back, &er);
+ dk4pppt_lineto(job->ppp, xl, yt, NULL, &back, &er);
+ dk4pppt_lineto(job->ppp, xl, yb, NULL, &back, &er);
+ dk4pppt_closepath(job->ppp, &back, &er);
+ dk4pppt_clip(job->ppp, &back, &er);
+ if (0 == back) {
+ /* ERROR: Failed to clip region */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 38
+ );
+ }
+ }
+
+
+#line 269 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Set stroke RGB colour.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_stroke_rgb(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 291 "wxd2lout.ctr"
+ dk4pppt_set_stroke_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ backptr, erp
+ );
+
+
+#line 299 "wxd2lout.ctr"
+
+
+#line 300 "wxd2lout.ctr"
+}
+
+
+
+/** Set stroke line width.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_line_width(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 323 "wxd2lout.ctr"
+ dk4pppt_set_line_width(
+ job->ppp, wxd2lat_object_linewidth(pobj, drw, job),
+ backptr, erp
+ );
+
+
+#line 328 "wxd2lout.ctr"
+
+
+#line 329 "wxd2lout.ctr"
+}
+
+
+
+/** Set stroke line style.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_line_style(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double sv;
+ dk4_gra_ls_t ls = DK4_GRA_LS_SOLID;
+
+
+#line 354 "wxd2lout.ctr"
+ switch (pobj->ls) {
+ case WXD_LS_SOLID : {
+ ls = DK4_GRA_LS_SOLID;
+ } break;
+ case WXD_LS_DASH : {
+ ls = DK4_GRA_LS_DASH;
+ } break;
+ case WXD_LS_DOT : {
+ ls = DK4_GRA_LS_DOT;
+ } break;
+ case WXD_LS_DASH_DOT : {
+ ls = DK4_GRA_LS_DASH_DOT;
+ } break;
+ case WXD_LS_DASH_DOT_DOT : {
+ ls = DK4_GRA_LS_DASH_DOT_DOT;
+ } break;
+ case WXD_LS_DASH_DOT_DOT_DOT : {
+ ls = DK4_GRA_LS_DASH_DOT_DOT_DOT;
+ } break;
+ }
+ sv = (double)(pobj->sl) * wxd2lat_object_linewidth(pobj, drw, job);
+ dk4pppt_set_line_style(job->ppp, ls, sv, backptr, erp);
+
+
+#line 377 "wxd2lout.ctr"
+
+
+#line 378 "wxd2lout.ctr"
+}
+
+
+
+/** Set stroke line cap.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_line_cap(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_lc_t lc = DK4_GRA_LC_BUTTED;
+
+
+#line 400 "wxd2lout.ctr"
+ switch (pobj->csfs) {
+ case WXD_LC_BUTTED : {
+ lc = DK4_GRA_LC_BUTTED;
+ } break;
+ case WXD_LC_ROUNDED : {
+ lc = DK4_GRA_LC_ROUNDED;
+ } break;
+ case WXD_LC_PROJECTING : {
+ lc = DK4_GRA_LC_PROJECTING;
+ } break;
+ }
+ dk4pppt_set_line_cap(job->ppp, lc, backptr, erp);
+
+
+#line 413 "wxd2lout.ctr"
+
+
+#line 414 "wxd2lout.ctr"
+}
+
+
+
+/** Set stroke line join.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_line_join(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_lj_t lj = DK4_GRA_LJ_MITERED;
+
+
+#line 436 "wxd2lout.ctr"
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ lj = DK4_GRA_LJ_ROUNDED;
+ } break;
+ default : {
+ switch (pobj->js) {
+ case WXD_LJ_MITERED : {
+ lj = DK4_GRA_LJ_MITERED;
+ } break;
+ case WXD_LJ_ROUNDED : {
+ lj = DK4_GRA_LJ_ROUNDED;
+ } break;
+ case WXD_LJ_BEVELED : {
+ lj = DK4_GRA_LJ_BEVELED;
+ } break;
+ }
+ } break;
+ }
+
+
+
+#line 457 "wxd2lout.ctr"
+
+
+#line 458 "wxd2lout.ctr"
+ if ((uint8_t)0U == pobj->ml) { pobj->ml = (uint8_t)1U; }
+ dk4pppt_set_line_join(job->ppp, lj, (double)(pobj->ml), backptr, erp);
+
+
+#line 461 "wxd2lout.ctr"
+
+
+#line 462 "wxd2lout.ctr"
+}
+
+
+
+/** Set fill RGB colour.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_fill_rgb(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+
+
+#line 483 "wxd2lout.ctr"
+
+
+#line 484 "wxd2lout.ctr"
+
+
+#line 485 "wxd2lout.ctr"
+
+
+#line 486 "wxd2lout.ctr"
+
+
+#line 487 "wxd2lout.ctr"
+
+
+#line 488 "wxd2lout.ctr"
+
+
+#line 489 "wxd2lout.ctr"
+
+
+#line 490 "wxd2lout.ctr"
+
+
+#line 491 "wxd2lout.ctr"
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->fc[0])) / 255.0),
+ (((double)(pobj->fc[1])) / 255.0),
+ (((double)(pobj->fc[2])) / 255.0),
+ backptr, erp
+ );
+
+
+#line 499 "wxd2lout.ctr"
+
+
+#line 500 "wxd2lout.ctr"
+}
+
+
+
+/** Set fill attributes.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_attributes_fill(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ /* Fill colour
+ */
+
+
+#line 523 "wxd2lout.ctr"
+ wxd2lout_fill_rgb(job, pobj, backptr, erp);
+
+
+#line 525 "wxd2lout.ctr"
+
+
+#line 526 "wxd2lout.ctr"
+}
+
+
+
+/** Return pattern for object.
+ @param pobj Object to pattern.
+ @return Pattern number as dk4_gra_pattern_t.
+*/
+static
+dk4_gra_pattern_t
+wxd2lout_find_pattern(wxd_object_t *pobj)
+{
+ dk4_gra_pattern_t back = DK4_GRA_PATTERN_30_DEGREE_LEFT;
+
+
+#line 540 "wxd2lout.ctr"
+ switch (pobj->csfs) {
+ case WXD_FS_30_DEGREE_LEFT : {
+ back = DK4_GRA_PATTERN_30_DEGREE_LEFT;
+ } break;
+ case WXD_FS_30_DEGREE_RIGHT : {
+ back = DK4_GRA_PATTERN_30_DEGREE_RIGHT;
+ } break;
+ case WXD_FS_30_DEGREE_SIEVE : {
+ back = DK4_GRA_PATTERN_30_DEGREE_SIEVE;
+ } break;
+ case WXD_FS_45_DEGREE_LEFT : {
+ back = DK4_GRA_PATTERN_45_DEGREE_LEFT;
+ } break;
+ case WXD_FS_45_DEGREE_RIGHT : {
+ back = DK4_GRA_PATTERN_45_DEGREE_RIGHT;
+ } break;
+ case WXD_FS_45_DEGREE_SIEVE : {
+ back = DK4_GRA_PATTERN_45_DEGREE_SIEVE;
+ } break;
+ case WXD_FS_HORIZONTAL_BRICKS : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_BRICKS;
+ } break;
+ case WXD_FS_VERTICAL_BRICKS : {
+ back = DK4_GRA_PATTERN_VERTICAL_BRICKS;
+ } break;
+ case WXD_FS_HORIZONTAL_LINES : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_LINES;
+ } break;
+ case WXD_FS_VERTICAL_LINES : {
+ back = DK4_GRA_PATTERN_VERTICAL_LINES;
+ } break;
+ case WXD_FS_HORIZONTAL_VERTICAL_SIEVE : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE;
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_LEFT : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT;
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_RIGHT : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT;
+ } break;
+ case WXD_FS_VERTICAL_SHINGLES_1 : {
+ back = DK4_GRA_PATTERN_VERTICAL_SHINGLES_1;
+ } break;
+ case WXD_FS_VERTICAL_SHINGLES_2 : {
+ back = DK4_GRA_PATTERN_VERTICAL_SHINGLES_2;
+ } break;
+ case WXD_FS_LARGE_FISH_SCALES : {
+ back = DK4_GRA_PATTERN_LARGE_FISH_SCALES;
+ } break;
+ case WXD_FS_SMALL_FISH_SCALES : {
+ back = DK4_GRA_PATTERN_SMALL_FISH_SCALES;
+ } break;
+ case WXD_FS_CIRCLES : {
+ back = DK4_GRA_PATTERN_CIRCLES;
+ } break;
+ case WXD_FS_HEXAGONS : {
+ back = DK4_GRA_PATTERN_HEXAGONS;
+ } break;
+ case WXD_FS_OCTAGONS : {
+ back = DK4_GRA_PATTERN_OCTAGONS;
+ } break;
+ case WXD_FS_HORIZONTAL_TIRES : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_TIRES;
+ } break;
+ case WXD_FS_VERTICAL_TIRES : {
+ back = DK4_GRA_PATTERN_VERTICAL_TIRES;
+ } break;
+
+ }
+
+
+#line 610 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Set stroke attributes.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param use_lc Flag: Also set line cap.
+ @param use_lj Flag: Use join style and miter limit.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_attributes_stroke(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ int use_lc,
+ dk4_er_t *erp
+)
+{
+
+
+#line 637 "wxd2lout.ctr"
+ /* Stroke colour
+ */
+ wxd2lout_stroke_rgb(job, pobj, backptr, erp);
+
+
+#line 641 "wxd2lout.ctr"
+ /*
+ Line width
+ */
+ wxd2lout_line_width(drw, job, pobj, backptr, erp);
+
+
+#line 646 "wxd2lout.ctr"
+ /*
+ Line style and dash length
+ */
+ wxd2lout_line_style(drw, job, pobj, backptr, erp);
+
+
+#line 651 "wxd2lout.ctr"
+ /*
+ Line cap
+ */
+ if (0 != use_lc) {
+ wxd2lout_line_cap(job, pobj, backptr, erp);
+
+
+#line 657 "wxd2lout.ctr"
+ }
+ /*
+ Line join
+ */
+ switch (pobj->ot) {
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE :
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC: case WXD_OT_BOX : {
+ wxd2lout_line_join(job, pobj, backptr, erp);
+ } break;
+ }
+
+
+#line 669 "wxd2lout.ctr"
+
+
+#line 670 "wxd2lout.ctr"
+}
+
+
+
+/** Create polygon or polyline without arrowheads path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_pl_no_arrows(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ uint16_t i;
+
+
+#line 695 "wxd2lout.ctr"
+ dk4pppt_newpath_moveto(
+ job->ppp, ((pobj->det).p.p)[0].x, ((pobj->det).p.p)[0].y,
+ pbb, backptr, erp
+ );
+ for (i = 1; i < (pobj->det).p.n; i++) {
+ dk4pppt_lineto(
+ job->ppp, ((pobj->det).p.p)[i].x, ((pobj->det).p.p)[i].y,
+ pbb, backptr, erp
+ );
+ }
+ if (0 != iscl) {
+ dk4pppt_lineto(
+ job->ppp, ((pobj->det).p.p)[0].x, ((pobj->det).p.p)[0].y,
+ pbb, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+
+
+#line 713 "wxd2lout.ctr"
+}
+
+
+
+/** Create Bezier segments for one X-spline segment.
+ The X-spline segment is drawn completely, 8 Bezier segments
+ are used per X-spline segment.
+ @param job Job structure.
+ @param xs X-spline structure, control points are set up.
+ @param ib Index of point B (0 for first segment).
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_spline_segment_normal(
+ wxd2lat_job_t *job,
+ dk4_xsp_2d_t *xs,
+ uint16_t ib,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ double v0[4];
+ double v1[4];
+ double t;
+ double divisor;
+ unsigned i;
+
+
+#line 744 "wxd2lout.ctr"
+ divisor = 3.0 * (double)((job->grco).xsss);
+ if (0 != dk4xsp2d_calculate_value_derivative(v0, xs, 0.0, erp)) {
+ v0[1] = v0[1] / divisor;
+ v0[3] = v0[3] / divisor;
+ if ((uint16_t)0U == ib) {
+ dk4pppt_newpath_moveto(job->ppp, v0[0], v0[2], pbb, backptr, erp);
+ }
+ for (i = 1; i <= (job->grco).xsss; i++) {
+ t = (double)i / (double)((job->grco).xsss);
+ if ((job->grco).xsss == i) { t = 1.0; }
+ if (0 != dk4xsp2d_calculate_value_derivative(v1, xs, t, erp)) {
+ v1[1] = v1[1] / divisor;
+ v1[3] = v1[3] / divisor;
+ dk4pppt_curveto(
+ job->ppp,
+ (v0[0]+v0[1]), (v0[2]+v0[3]),
+ (v1[0]-v1[1]), (v1[2]-v1[3]),
+ v1[0], v1[2],
+ pbb, backptr, erp
+ );
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ /* ERROR: X-spline calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 39
+ );
+ }
+ }
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ /* ERROR: X-spline calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 39
+ );
+ }
+
+
+#line 783 "wxd2lout.ctr"
+}
+
+
+
+/** Create spline path for closed spline or open spline without arrowheads.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_spline_no_arrows(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ dk4_xsp_2d_t xs; /* X-spline */
+ uint16_t sgn; /* Current segment to process */
+#if VERSION_BEFORE_20190110
+ uint16_t ia; /* Index of point A */
+ uint16_t id; /* Index of point D */
+#endif
+ uint16_t ib; /* Index of point B */
+ uint16_t ic; /* Index of point C */
+
+
+#line 815 "wxd2lout.ctr"
+ dk4xsp2d_reset(&xs);
+ for (sgn = 0; sgn < (pobj->det).s.n - 1; sgn++) {
+ ib = sgn;
+ ic = ib + (uint16_t)1U;
+ if (
+ (1.0e-8 > fabs(((pobj->det).s.p)[ib].s))
+ && (1.0e-8 > fabs(((pobj->det).s.p)[ic].s))
+ ) {
+ if (0 == sgn) {
+ dk4pppt_newpath_moveto(
+ job->ppp,
+ ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ pbb, backptr, erp
+ );
+ }
+ dk4pppt_lineto(
+ job->ppp,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ pbb, backptr, erp
+ );
+ }
+ else {
+#if VERSION_BEFORE_20190110
+ id = ib + (uint16_t)2U;
+ ia = ib - (uint16_t)1U;
+ dk4xsp2d_reset_points(&xs);
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ ((pobj->det).s.p)[ib].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ ((pobj->det).s.p)[ic].s, 2
+ );
+ if ((uint16_t)0U != ib) {
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ }
+ else {
+ if (0 != iscl) {
+ ia = (pobj->det).s.n - (uint16_t)1U;
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ }
+ }
+ if (id < (pobj->det).s.n) {
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+ }
+ else {
+ if (0 != iscl) {
+ id = (uint16_t)0U;
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+ }
+ }
+#else
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+#endif
+ wxd2lout_path_spline_segment_normal(
+ job, &xs, sgn, backptr, pbb, erp
+ );
+ }
+ }
+ if (0 != iscl) {
+ ib = (pobj->det).s.n - (uint16_t)1U;
+ ic = (uint16_t)0U;
+ if (
+ (1.0e-8 > fabs(((pobj->det).s.p)[ib].s))
+ && (1.0e-8 > fabs(((pobj->det).s.p)[ic].s))
+ ) {
+ dk4pppt_lineto(
+ job->ppp,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ pbb, backptr, erp
+ );
+ }
+ else {
+#if VERSION_BEFORE_20190110
+ ia = (pobj->det).s.n - (uint16_t)2U;
+ id = (uint16_t)1U;
+ dk4xsp2d_reset_points(&xs);
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ ((pobj->det).s.p)[ib].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ ((pobj->det).s.p)[ic].s, 2
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+#else
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+#endif
+ wxd2lout_path_spline_segment_normal(
+ job, &xs, ib, backptr, pbb, erp
+ );
+ }
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+
+
+#line 941 "wxd2lout.ctr"
+}
+
+
+
+/** Create arc path for given start and end angle.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param alpha Start angle in radians.
+ @param beta End angle in radians.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_arc_angles(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ double alpha,
+ double beta,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ double v0[4]; /* Start point of current segment */
+ double v1[4]; /* End point of current segment */
+ double angle; /* Complete arc angle */
+ double pos; /* Angle position at end of current segment */
+ double kappa; /* Kappa value */
+ double segan; /* Segment angle */
+ size_t nsegs; /* Number of segments */
+ size_t i; /* Current segment */
+
+
+#line 979 "wxd2lout.ctr"
+ if (0 != (pobj->det).a.d) {
+ /*
+ Real arc.
+ */
+ angle = beta - alpha;
+
+
+#line 985 "wxd2lout.ctr"
+ nsegs = (size_t)ceil(4.0 * fabs(angle) / M_PI);
+ if (1 > nsegs) { nsegs = 1; }
+
+
+#line 988 "wxd2lout.ctr"
+ segan = angle / (double)nsegs;
+
+
+#line 990 "wxd2lout.ctr"
+ kappa = dk4gratool_kappa_for_angle(fabs(segan));
+
+
+#line 992 "wxd2lout.ctr"
+ v0[0] = (pobj->det).a.x + (pobj->det).a.r * cos(alpha);
+ v0[1] = (pobj->det).a.y + (pobj->det).a.r * sin(alpha);
+ v0[2] = -1.0 * kappa * segan * (pobj->det).a.r * sin(alpha);
+ v0[3] = kappa * segan * (pobj->det).a.r * cos(alpha);
+ for (i = 0; i < nsegs; i++) {
+ if (0 == i) {
+ dk4pppt_newpath_moveto(
+ job->ppp, v0[0], v0[1], NULL, backptr, erp
+ );
+ }
+ if (i < (nsegs - 1)) {
+ pos = alpha
+ + ((angle * (double)(i + (size_t)1U)) / (double)nsegs);
+ }
+ else {
+ pos = beta;
+ }
+ v1[0] = (pobj->det).a.x + (pobj->det).a.r * cos(pos);
+ v1[1] = (pobj->det).a.y + (pobj->det).a.r * sin(pos);
+ v1[2] = -1.0 * kappa * segan * (pobj->det).a.r * sin(pos);
+ v1[3] = kappa * segan * (pobj->det).a.r * cos(pos);
+ dk4pppt_curveto(
+ job->ppp,
+ (v0[0] + v0[2]), (v0[1] + v0[3]),
+ (v1[0] - v1[2]), (v1[1] - v1[3]),
+ v1[0], v1[1],
+ pbb, backptr, erp
+ );
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+ if (0 != iscl) {
+ dk4pppt_lineto(
+ job->ppp, (pobj->det).a.x, (pobj->det).a.y, pbb, backptr, erp
+ );
+ v0[0] = (pobj->det).a.x + (pobj->det).a.r * cos(alpha);
+ v0[1] = (pobj->det).a.y + (pobj->det).a.r * sin(alpha);
+ dk4pppt_lineto(
+ job->ppp, v0[0], v0[1], pbb, backptr, erp
+ );
+ }
+ }
+ else {
+ /* Malformed arc, points either on one line or equal.
+ */
+ dk4pppt_newpath_moveto(
+ job->ppp,
+ wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x1)),
+ wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y1)),
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x2)),
+ wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y2)),
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x3)),
+ wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y3)),
+ NULL, backptr, erp
+ );
+ if (0 != iscl) {
+ dk4pppt_lineto(
+ job->ppp,
+ wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x1)),
+ wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y1)),
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ }
+
+
+#line 1065 "wxd2lout.ctr"
+}
+
+
+
+/** Create arc path for closed arcs or open arcs without arrowheads.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_arc_no_arrows(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+
+
+#line 1091 "wxd2lout.ctr"
+ wxd2lout_path_arc_angles(
+ drw, job, pobj, (pobj->det).a.a, (pobj->det).a.b,
+ backptr, pbb, erp, iscl
+ );
+
+
+#line 1096 "wxd2lout.ctr"
+}
+
+
+
+/** Create polyline with arrowheads path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_pl_with_arrows(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ double x0; /* X coordinate first/last point */
+ double y0; /* Y coordinate first/last point */
+ double x1; /* X coordinate second/penultimate point */
+ double y1; /* Y coordinate second/penultimate point */
+ double sl; /* Segment length */
+ double cl; /* Cut length */
+ double nl; /* Non-cut length */
+ uint16_t i; /* Current inner point */
+
+
+#line 1126 "wxd2lout.ctr"
+ /*
+ Move to first point
+ */
+ x0 = ((pobj->det).p.p)[0].x;
+ y0 = ((pobj->det).p.p)[0].y;
+
+
+#line 1132 "wxd2lout.ctr"
+ if (0 != (pobj->ab).type) {
+ x1 = ((pobj->det).p.p)[1].x;
+ y1 = ((pobj->det).p.p)[1].y;
+ sl = sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));
+ cl = (pobj->ab).cut;
+ nl = sl - cl;
+ x0 = ((x0 * nl) + (x1 * cl)) / sl;
+ y0 = ((y0 * nl) + (y1 * cl)) / sl;
+ }
+
+
+#line 1142 "wxd2lout.ctr"
+ dk4pppt_newpath_moveto(job->ppp, x0, y0, pbb, backptr, erp);
+ /*
+ Lines to inner points
+ */
+ if ((uint16_t)2U < (pobj->det).p.n) {
+ for (i = (uint16_t)1U; i < ((pobj->det).p.n) - (uint16_t)1U; i++) {
+
+
+#line 1149 "wxd2lout.ctr"
+ dk4pppt_lineto(
+ job->ppp, ((pobj->det).p.p)[i].x, ((pobj->det).p.p)[i].y,
+ pbb, backptr, erp
+ );
+ }
+ }
+ /* Line to last point
+ */
+ x0 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)1U].x;
+ y0 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)1U].y;
+
+
+#line 1160 "wxd2lout.ctr"
+ if (0 != (pobj->af).type) {
+ x1 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)2U].x;
+ y1 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)2U].y;
+ sl = sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0));
+ cl = (pobj->af).cut;
+ nl = sl - cl;
+ x0 = (x0 * nl + x1 * cl) / sl;
+ y0 = (y0 * nl + y1 * cl) / sl;
+ }
+
+
+#line 1170 "wxd2lout.ctr"
+ dk4pppt_lineto(job->ppp, x0, y0, pbb, backptr, erp);
+
+
+#line 1172 "wxd2lout.ctr"
+}
+
+
+
+/** Create spline path for open spline with arrowheads.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param ts Start parameter t.
+ @param te End parameter t.
+ @param npmoveto Flag: Start new path and move to first point.
+ @param fullseg Flag: This is a full segment.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_spline_seg(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ double ts,
+ double te,
+ int npmoveto,
+ int fullseg,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ double v0[4]; /* Start of segment */
+ double v1[4]; /* End of segment */
+ dk4_xsp_2d_t xs; /* X-spline structure */
+ double diff; /* Parameter t difference start to end */
+ double coeff; /* Coefficient for derivatives */
+ double t; /* Current parameter t in range 0 to 1 */
+ unsigned nsubs; /* Number of sub segments */
+ unsigned i; /* Current sub segment */
+ int res; /* Step calculation result */
+ uint16_t ib; /* X-spline segment index */
+
+
+#line 1213 "wxd2lout.ctr"
+ ib = (uint16_t)floor(ts);
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+ diff = te - ts;
+ nsubs = (job->grco).xsss;
+ if (0 != fullseg) {
+ nsubs = (unsigned)ceil(fabs(diff * (double)nsubs));
+ if (0U == nsubs) { nsubs = 1U; }
+ }
+ coeff = diff / (3.0 * (double)nsubs);
+ t = ts - (double)ib;
+ res = dk4xsp2d_calculate_value_derivative(v0, &xs, t, erp);
+ if (0 != res) {
+ v0[1] *= coeff; v0[3] *= coeff;
+ for (i = 0U; i < nsubs; i++) {
+ if ((nsubs - 1U) == i) {
+ t = te;
+ }
+ else {
+ t = ts + ((diff * (double)(i + 1U)) / (double)nsubs);
+ }
+ t = t - (double)ib;
+ res = dk4xsp2d_calculate_value_derivative(v1, &xs, t, erp);
+ if (0 != res) {
+ v1[1] *= coeff; v1[3] *= coeff;
+ if ((0U == i) && (0 != npmoveto)) {
+ dk4pppt_newpath_moveto(
+ job->ppp, v0[0], v0[2], pbb, backptr, erp
+ );
+ }
+ dk4pppt_curveto(
+ job->ppp, (v0[0]+v0[1]), (v0[2]+v0[3]), (v1[0]-v1[1]),
+ (v1[2]-v1[3]), v1[0], v1[2], pbb, backptr, erp
+ );
+ }
+ else {
+
+#line 1248 "wxd2lout.ctr"
+ *backptr = 0;
+ /* ERROR: Calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 39
+ );
+ }
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+ }
+ else {
+
+#line 1258 "wxd2lout.ctr"
+ *backptr = 0;
+ /* ERROR: Calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 39
+ );
+ }
+
+
+#line 1265 "wxd2lout.ctr"
+}
+
+
+/** Create spline path for open spline with arrowheads.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_spline_with_arrows(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ uint16_t ss;
+ uint16_t se;
+ uint16_t i;
+
+
+#line 1291 "wxd2lout.ctr"
+ ss = (uint16_t)floor((pobj->det).s.ts);
+ se = (uint16_t)floor((pobj->det).s.te);
+ if (0 != (pobj->ab).type) {
+ if (0 != (pobj->af).type) {
+ if (se > ss) {
+ wxd2lout_spline_seg(
+ job, pobj, (pobj->det).s.ts, (double)(ss + 1), 1, 0,
+ backptr, pbb, erp
+ );
+ for (i = ss + 1; i < se; i++) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)i, (double)(i + 1), 0, 1,
+ backptr, pbb, erp
+ );
+ }
+ if ((pobj->det).s.te > floor((pobj->det).s.te)) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)se, (pobj->det).s.te, 0, 0,
+ backptr, pbb, erp
+ );
+ }
+ }
+ else {
+ wxd2lout_spline_seg(
+ job, pobj, (pobj->det).s.ts, (pobj->det).s.te, 1, 0,
+ backptr, pbb, erp
+ );
+ }
+ }
+ else {
+ wxd2lout_spline_seg(
+ job, pobj, (pobj->det).s.ts, (double)(ss + 1), 1, 0,
+ backptr, pbb, erp
+ );
+ for (i = ss + 1; i < (pobj->det).s.n - 1; i++) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)i, (double)(i + 1), 0, 1,
+ backptr, pbb, erp
+ );
+ }
+ }
+ }
+ else {
+ if (0 != (pobj->af).type) {
+ for (i = 0; i < se; i++) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)i, (double)(i + 1),
+ ((0 == i) ? 1 : 0), 1, backptr, pbb, erp
+ );
+ }
+ if ((pobj->det).s.te > floor((pobj->det).s.te)) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)se, (pobj->det).s.te, 0, 0,
+ backptr, pbb, erp
+ );
+ }
+ }
+ else {
+ wxd2lout_path_spline_no_arrows(job, pobj, backptr, pbb, erp, 0);
+ }
+ }
+
+
+#line 1353 "wxd2lout.ctr"
+}
+
+
+
+/** Create arc path for open arcs with at least one arrowhead.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_arc_with_arrows(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ double alpha; /* Start angle */
+ double beta; /* End angle */
+ double x1; /* X coordinate point 1 */
+ double y1; /* Y coordinate point 1 */
+ double x2; /* X coordinate point 2 */
+ double y2; /* Y coordinate point 2 */
+ double x3; /* X coordinate point 3 */
+ double y3; /* Y coordinate point 3 */
+ double sl; /* Segment length */
+ double cl; /* Cut length */
+ double nl; /* Non-cut length */
+
+
+#line 1390 "wxd2lout.ctr"
+ if (0 != (pobj->det).a.d) {
+ alpha = (pobj->det).a.a;
+ beta = (pobj->det).a.b;
+
+
+#line 1394 "wxd2lout.ctr"
+
+
+#line 1395 "wxd2lout.ctr"
+ if (0 < (pobj->det).a.d) {
+
+#line 1396 "wxd2lout.ctr"
+ if (0 != (pobj->ab).type) {
+
+
+#line 1398 "wxd2lout.ctr"
+ alpha += (pobj->ab).cut / (pobj->det).a.r;
+
+
+#line 1400 "wxd2lout.ctr"
+ }
+ if (0 != (pobj->af).type) {
+
+
+#line 1403 "wxd2lout.ctr"
+ beta -= (pobj->af).cut / (pobj->det).a.r;
+
+
+#line 1405 "wxd2lout.ctr"
+ }
+ }
+ else {
+
+#line 1408 "wxd2lout.ctr"
+ if (0 != (pobj->ab).type) {
+
+
+#line 1410 "wxd2lout.ctr"
+ alpha -= (pobj->ab).cut / (pobj->det).a.r;
+
+
+#line 1412 "wxd2lout.ctr"
+ }
+ if (0 != (pobj->af).type) {
+
+
+#line 1415 "wxd2lout.ctr"
+ beta += (pobj->af).cut / (pobj->det).a.r;
+
+
+#line 1417 "wxd2lout.ctr"
+ }
+ }
+ wxd2lout_path_arc_angles(
+ drw, job, pobj, alpha, beta, backptr, pbb, erp, iscl
+ );
+ }
+ else {
+ /* Malformed arc as polygon, cut ends for arrows.
+ */
+ x1 = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x1));
+ x2 = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x2));
+ x3 = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x3));
+ y1 = wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y1));
+ y2 = wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y2));
+ y3 = wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y3));
+ if (0 != (pobj->ab).type) {
+ sl = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
+ cl = (pobj->ab).cut;
+ nl = sl - cl;
+ x1 = (x1 * nl + x2 * cl) / sl;
+ y1 = (y1 * nl + y2 * cl) / sl;
+ }
+ dk4pppt_newpath_moveto(job->ppp, x1, y1, pbb, backptr, erp);
+ dk4pppt_lineto(job->ppp, x2, y2, pbb, backptr, erp);
+ if (0 != (pobj->af).type) {
+ sl = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
+ cl = (pobj->af).cut;
+ nl = sl - cl;
+ x3 = (x3 * nl + x2 * cl) / sl;
+ y3 = (y3 * nl + y2 * cl) / sl;
+ }
+ dk4pppt_lineto(job->ppp, x3, y3, pbb, backptr, erp);
+ }
+
+
+#line 1451 "wxd2lout.ctr"
+}
+
+
+
+/** Create polyline or polygon path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_polyline(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+
+
+#line 1475 "wxd2lout.ctr"
+ if (
+ (0 != iscl)
+ || (((uint8_t)0U == pobj->af.type) && ((uint8_t)0U == pobj->ab.type))
+ ) {
+ /* Closed polygon or polyline without arrows.
+ */
+ wxd2lout_path_pl_no_arrows(job, pobj, backptr, pbb, erp, iscl);
+ }
+ else {
+ /* Polyline with at least one arrow.
+ */
+ wxd2lout_path_pl_with_arrows(job, pobj, backptr, pbb, erp);
+ }
+
+
+#line 1489 "wxd2lout.ctr"
+}
+
+
+
+/** Create spline path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_spline(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+
+
+#line 1513 "wxd2lout.ctr"
+ if (
+ (0 != iscl)
+ || (((uint8_t)0U == pobj->af.type) && ((uint8_t)0U == pobj->ab.type))
+ ) {
+ /* Closed spline or open spline without arrowheads.
+ */
+ wxd2lout_path_spline_no_arrows(job, pobj, backptr, pbb, erp, iscl);
+ }
+ else {
+ /* Open spline with at least one arrowhead.
+ */
+ wxd2lout_path_spline_with_arrows(job, pobj, backptr, pbb, erp);
+ }
+
+
+#line 1527 "wxd2lout.ctr"
+}
+
+
+
+/** Create arc path.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_arc(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+
+
+#line 1553 "wxd2lout.ctr"
+ if (
+ (0 != iscl)
+ || (((uint8_t)0U == pobj->af.type) && ((uint8_t)0U == pobj->ab.type))
+ ) {
+ /* Closed arc or open arc without arrowheads.
+ */
+ wxd2lout_path_arc_no_arrows(drw,job,pobj,backptr,pbb,erp,iscl);
+ }
+ else {
+ /* Open arc with at least one arrowhead.
+ */
+ wxd2lout_path_arc_with_arrows(drw,job,pobj,backptr,pbb,erp,iscl);
+ }
+
+
+#line 1567 "wxd2lout.ctr"
+}
+
+
+
+/** Create circle path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_circle(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+
+
+#line 1589 "wxd2lout.ctr"
+
+
+#line 1590 "wxd2lout.ctr"
+
+
+#line 1591 "wxd2lout.ctr"
+
+
+#line 1592 "wxd2lout.ctr"
+ dk4pppt_circle(
+ job->ppp,
+ (pobj->det).e.x, (pobj->det).e.y, (pobj->det).e.rx,
+ pbb, backptr, erp
+ );
+
+
+#line 1598 "wxd2lout.ctr"
+}
+
+
+
+/** Create ellipse path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_ellipse(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+
+
+#line 1620 "wxd2lout.ctr"
+ dk4pppt_ellipse(
+ job->ppp,
+ (pobj->det).e.x, (pobj->det).e.y, (pobj->det).e.rx, (pobj->det).e.ry,
+ (pobj->det).e.a, pbb, backptr, erp
+ );
+
+
+#line 1626 "wxd2lout.ctr"
+}
+
+
+
+/** Create box path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_box(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+
+
+#line 1648 "wxd2lout.ctr"
+ dk4pppt_rectangle(
+ job->ppp,
+ (pobj->det).b.xl, (pobj->det).b.xr,
+ (pobj->det).b.yb, (pobj->det).b.yt,
+ ((0.0 < (pobj->det).b.r) ? ((pobj->det).b.r) : (-1.0)),
+ pbb, backptr, erp
+ );
+
+
+#line 1656 "wxd2lout.ctr"
+}
+
+
+
+/** Create dot path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_dot(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+
+
+#line 1678 "wxd2lout.ctr"
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y, ((pobj->det).d.d / 2.0),
+ pbb, backptr, erp
+ );
+
+
+#line 1683 "wxd2lout.ctr"
+}
+
+
+
+
+/** Create object path.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_object_path(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+
+
+#line 1708 "wxd2lout.ctr"
+ switch (pobj->ot) {
+ case WXD_OT_POLYLINE : {
+ wxd2lout_path_polyline(job, pobj, backptr, pbb, erp, 0);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ wxd2lout_path_spline(job, pobj, backptr, pbb, erp, 0);
+ } break;
+ case WXD_OT_O_ARC : {
+ wxd2lout_path_arc(drw, job, pobj, backptr, pbb, erp, 0);
+ } break;
+ case WXD_OT_POLYGON : {
+ wxd2lout_path_polyline(job, pobj, backptr, pbb, erp, 1);
+ } break;
+ case WXD_OT_C_SPLINE : {
+ wxd2lout_path_spline(job, pobj, backptr, pbb, erp, 1);
+ } break;
+ case WXD_OT_C_ARC : {
+ wxd2lout_path_arc(drw, job, pobj, backptr, pbb, erp, 1);
+ } break;
+ case WXD_OT_CIRCLE : {
+ wxd2lout_path_circle(job, pobj, backptr, pbb, erp);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ wxd2lout_path_ellipse(job, pobj, backptr, pbb, erp);
+ } break;
+ case WXD_OT_BOX : {
+ wxd2lout_path_box(job, pobj, backptr, pbb, erp);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ wxd2lout_path_dot(job, pobj, backptr, pbb, erp);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ wxd2lout_path_dot(job, pobj, backptr, pbb, erp);
+ } break;
+ }
+
+
+#line 1744 "wxd2lout.ctr"
+}
+
+
+
+static
+dk4_text_align_h_t
+wxd2lout_h_text_align(uint8_t a)
+{
+ dk4_text_align_h_t back = DK4_TEXT_ALIGN_H_LEFT;
+ switch ((int)a) {
+ case 1: {
+ back = DK4_TEXT_ALIGN_H_CENTERED;
+ } break;
+ case 2: {
+ back = DK4_TEXT_ALIGN_H_RIGHT;
+ } break;
+ }
+ return back;
+}
+
+
+
+/** Create output for one text object.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_text_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dkChar buf[2048];
+ dk4_er_t er;
+ int back = 1;
+ int res;
+ dk4_gra_tf_t fonttype = DK4_GRA_TF_SIMILAR_SIZE;
+
+
+#line 1784 "wxd2lout.ctr"
+ if (DK4_GRA_PURPOSE_DOCUMENT == (job->grco).purpose) {
+ fonttype = DK4_GRA_TF_EXACT_SIZE;
+ }
+ dk4error_init(&er);
+ res = dk4recode_c8_to_dk(
+ buf, DK4_SIZEOF(buf,dkChar), dk4app_get_encoding(job->app),
+ (pobj->det).t.t, DK4_ENCODING_UTF8, &er
+ );
+ if (0 != res) {
+ wxd2lout_fill_rgb(job, pobj, &back, &er);
+ if (0 != back) {
+ if (0x00 != (0x01 & ((pobj->det).t.fl))) {
+
+#line 1796 "wxd2lout.ctr"
+ /*
+ Special text
+ */
+ fonttype = DK4_GRA_TF_NONE_NONE;
+ dk4pppt_special_text(
+ job->ppp, (pobj->det).t.x, (pobj->det).t.y, (pobj->det).t.a,
+ (pobj->det).t.t, NULL,
+ wxd2lout_h_text_align((pobj->det).t.al),
+ DK4_TEXT_ALIGN_V_BASELINE, (int)((pobj->det).t.find),
+ (double)((pobj->det).t.fsz), fonttype, 0, &back, &er
+ );
+ }
+ else {
+
+#line 1809 "wxd2lout.ctr"
+ /* Normal text
+ */
+ dk4pppt_simple_utf8_text(
+ job->ppp, (pobj->det).t.x, (pobj->det).t.y, (pobj->det).t.a,
+ (pobj->det).t.t, NULL,
+ wxd2lout_h_text_align((pobj->det).t.al),
+ DK4_TEXT_ALIGN_V_BASELINE,
+ (int)((pobj->det).t.find), (double)((pobj->det).t.fsz),
+ fonttype, job->uc2l, 0, &back, &er
+ );
+ }
+ if (0 == back) {
+
+#line 1821 "wxd2lout.ctr"
+ /* ERROR: Failed to write text */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 40
+ );
+ }
+ }
+ else {
+
+#line 1828 "wxd2lout.ctr"
+ /* ERROR: Failed to set fill colour */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 41
+ );
+ }
+ }
+ else {
+
+#line 1835 "wxd2lout.ctr"
+ back = 0;
+ /* ERROR: UTF-8 decoding failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 42
+ );
+ }
+
+
+#line 1842 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Create output for one open path object probably with arrowheads attached.
+ @param drw Original drawing.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_open_path_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ int myback;
+ int back = 1;
+
+
+#line 1865 "wxd2lout.ctr"
+ dk4error_init(&er);
+ if (0.0 < pobj->lw) {
+ wxd2lout_attributes_stroke(drw, job, pobj, &back, 1, &er);
+
+
+#line 1869 "wxd2lout.ctr"
+ dk4pppt_prepare_stroke(job->ppp, &back, &er);
+
+
+#line 1871 "wxd2lout.ctr"
+ wxd2lout_object_path(drw, job, pobj, &back, NULL, &er);
+
+
+#line 1873 "wxd2lout.ctr"
+ dk4pppt_stroke(job->ppp, &back, &er);
+
+
+#line 1875 "wxd2lout.ctr"
+ if (0 == back) {
+ /* ERROR: Failed to create graphics object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 43
+ );
+ }
+ if ((uint8_t)0U != (pobj->af).type) {
+ myback = 1;
+ wxd2lah_arrowhead(&(pobj->af), drw, job, pobj, 0, &myback, &er);
+ if (0 == myback) {
+ back = 0;
+ /* ERROR: Failed to create forward arrowhead */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 44
+ );
+ }
+
+
+#line 1892 "wxd2lout.ctr"
+ }
+ if ((uint8_t)0U != (pobj->ab).type) {
+ myback = 1;
+ wxd2lah_arrowhead(&(pobj->ab), drw, job, pobj, 1, &myback, &er);
+ if (0 == myback) {
+ back = 0;
+ /* ERROR: Failed to create backward arrowhead */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 45
+ );
+ }
+
+
+#line 1904 "wxd2lout.ctr"
+ }
+ }
+ else {
+
+#line 1907 "wxd2lout.ctr"
+ /* Object skipped */
+ /* INFO: Skipping object due to non-positive line-width */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_INFO, 46
+ );
+ }
+
+
+#line 1914 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Create output for one closed path object, probably filled or pattern filled.
+ @param drw Original drawing.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_closed_path_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_bb_t pbb;
+ dk4_er_t er;
+ int back = 1;
+ int must_stroke = 0;
+ int must_fill = 0;
+ int must_pattern = 0;
+ int combined = 0;
+
+
+#line 1941 "wxd2lout.ctr"
+ dk4bb_init(&pbb);
+ dk4error_init(&er);
+ if (0.0 < pobj->lw) {
+ must_stroke = 1;
+ }
+ if ((uint8_t)(WXD_FS_NONE) != pobj->csfs) {
+ must_fill = 1;
+ }
+ if ((uint8_t)(WXD_FS_PURE) < pobj->csfs) {
+ must_pattern = 1;
+ }
+ if ((0 != must_stroke) && (0 != must_fill)) {
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ combined = 1;
+ }
+ }
+ if (0 != combined) {
+
+#line 1958 "wxd2lout.ctr"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+
+
+#line 1960 "wxd2lout.ctr"
+ wxd2lout_attributes_stroke(drw, job, pobj, &back, 0, &er);
+
+
+#line 1962 "wxd2lout.ctr"
+ dk4pppt_prepare_fill_and_stroke(job->ppp, &back, &er);
+
+
+#line 1964 "wxd2lout.ctr"
+ wxd2lout_object_path(drw, job, pobj, &back, NULL, &er);
+
+
+#line 1966 "wxd2lout.ctr"
+ dk4pppt_fill_and_stroke(job->ppp, &back, &er);
+
+
+#line 1968 "wxd2lout.ctr"
+ if (0 != must_pattern) {
+ dk4pppt_gsave(job->ppp, &back, &er);
+
+
+#line 1971 "wxd2lout.ctr"
+ wxd2lout_object_path(drw, job, pobj, &back, &pbb, &er);
+
+
+#line 1973 "wxd2lout.ctr"
+ dk4pppt_clip(job->ppp, &back, &er);
+
+
+#line 1975 "wxd2lout.ctr"
+ dk4pppt_pattern(
+ job->ppp, pbb.xmin, pbb.xmax, pbb.ymin, pbb.ymax,
+ wxd2lout_find_pattern(pobj), &back, &er
+ );
+
+
+#line 1980 "wxd2lout.ctr"
+ dk4pppt_grestore(job->ppp, &back, &er);
+
+
+#line 1982 "wxd2lout.ctr"
+ }
+ }
+ else {
+
+#line 1985 "wxd2lout.ctr"
+ if (0 != must_fill) {
+
+#line 1986 "wxd2lout.ctr"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+
+
+#line 1988 "wxd2lout.ctr"
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+
+
+#line 1990 "wxd2lout.ctr"
+ wxd2lout_object_path(drw, job, pobj, &back, NULL, &er);
+
+
+#line 1992 "wxd2lout.ctr"
+ dk4pppt_fill(job->ppp, &back, &er);
+
+
+#line 1994 "wxd2lout.ctr"
+ }
+ if (0 != must_pattern) {
+
+#line 1996 "wxd2lout.ctr"
+ dk4pppt_gsave(job->ppp, &back, &er);
+
+
+#line 1998 "wxd2lout.ctr"
+ wxd2lout_object_path(drw, job, pobj, &back, &pbb, &er);
+
+
+#line 2000 "wxd2lout.ctr"
+ dk4pppt_clip(job->ppp, &back, &er);
+
+
+#line 2002 "wxd2lout.ctr"
+ dk4pppt_pattern(
+ job->ppp, pbb.xmin, pbb.xmax, pbb.ymin, pbb.ymax,
+ wxd2lout_find_pattern(pobj), &back, &er
+ );
+
+
+#line 2007 "wxd2lout.ctr"
+ dk4pppt_grestore(job->ppp, &back, &er);
+
+
+#line 2009 "wxd2lout.ctr"
+ }
+ if (0 != must_stroke) {
+
+#line 2011 "wxd2lout.ctr"
+ wxd2lout_attributes_stroke(drw, job, pobj, &back, 0, &er);
+
+
+#line 2013 "wxd2lout.ctr"
+ dk4pppt_prepare_stroke(job->ppp, &back, &er);
+
+
+#line 2015 "wxd2lout.ctr"
+ wxd2lout_object_path(drw, job, pobj, &back, NULL, &er);
+
+
+#line 2017 "wxd2lout.ctr"
+ dk4pppt_stroke(job->ppp, &back, &er);
+
+
+#line 2019 "wxd2lout.ctr"
+ }
+ }
+ if (0 == back) {
+ /* ERROR: Failed to create graphics object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 43
+ );
+ }
+
+
+#line 2028 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Create output for one dot object.
+ @param drw Original drawing.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_dot_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ double lw;
+ int back = 1;
+
+
+#line 2051 "wxd2lout.ctr"
+ dk4error_init(&er);
+
+
+#line 2053 "wxd2lout.ctr"
+ switch (pobj->ot) {
+ case WXD_OT_DOT_FILLED : {
+
+#line 2055 "wxd2lout.ctr"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+ if (1 == back) {
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ if (1 == back) {
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((pobj->det).d.d / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+ if (0 == back) {
+
+#line 2065 "wxd2lout.ctr"
+ /* ERROR: Failed to create filled circle */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 47
+ );
+ }
+ }
+ else {
+
+#line 2072 "wxd2lout.ctr"
+ /* ERROR: Failed to set up filling */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 48
+ );
+ }
+ }
+ else {
+
+#line 2079 "wxd2lout.ctr"
+ /* ERROR: Failed to set up filling */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 48
+ );
+ }
+ } break;
+ case WXD_OT_DOT_WHITE : {
+
+#line 2086 "wxd2lout.ctr"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ if (lw >= (pobj->det).d.d) {
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ &back, &er
+ );
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((lw + (pobj->det).d.d) / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+ }
+ else {
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+
+#line 2104 "wxd2lout.ctr"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+ wxd2lout_attributes_stroke(drw, job, pobj, &back, 0, &er);
+ dk4pppt_prepare_fill_and_stroke(job->ppp, &back, &er);
+ if (1 == back) {
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((pobj->det).d.d / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill_and_stroke(job->ppp, &back, &er);
+ if (0 == back) {
+
+#line 2114 "wxd2lout.ctr"
+ /* ERROR: Failed to create filled circle */
+ dk4app_log_1(
+ job->app,job->msg,job->sz_msg,DK4_LL_ERROR,47
+ );
+ }
+
+ }
+ else {
+
+#line 2122 "wxd2lout.ctr"
+ /* ERROR: Failed to set up fill and stroke */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 49
+ );
+ }
+ }
+ else {
+
+#line 2129 "wxd2lout.ctr"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ if (0 != back) {
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((pobj->det).d.d / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+ if (0 != back) {
+ wxd2lout_attributes_stroke(
+ drw, job, pobj, &back, 0, &er
+ );
+ dk4pppt_prepare_stroke(job->ppp, &back, &er);
+ if (0 != back) {
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((pobj->det).d.d / 2.0), NULL, &back, &er
+ );
+ dk4pppt_stroke(job->ppp, &back, &er);
+ if (0 == back) {
+
+#line 2149 "wxd2lout.ctr"
+ /* ERROR: Failed to stroke circle */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 36
+ );
+
+ }
+ }
+ else {
+
+#line 2158 "wxd2lout.ctr"
+ /* ERROR: Failed to set up stroke */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 51
+ );
+ }
+ }
+ else {
+
+#line 2166 "wxd2lout.ctr"
+ /* Failed to create filled circle */
+ dk4app_log_1(
+ job->app,job->msg,job->sz_msg,DK4_LL_ERROR,47
+ );
+ }
+ }
+ else {
+
+#line 2173 "wxd2lout.ctr"
+ /* ERROR: Failed to set up fill */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 48
+ );
+ }
+ }
+ }
+ } break;
+ }
+
+
+#line 2183 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Create output for one image object.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_image_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dkChar fnb[DK4_MAX_PATH]; /* File name buffer */
+ dk4_px_t bg[4]; /* Background colour */
+ dk4_cs_conv_ctx_t ctx; /* RGB to gray conv context */
+ dk4_er_t er; /* Error report */
+ dk4_bif_t *pbif = NULL; /* Bitmap image */
+ int back = 1; /* Function result */
+ int ifl = 0; /* Image flags */
+ int fbg = 0; /* Flag: Force background */
+ int res = 0; /* Step result */
+
+
+#line 2210 "wxd2lout.ctr"
+ DK4_MEMCPY(&ctx,&((job->grco).ctx),sizeof(dk4_cs_conv_ctx_t));
+ bg[0] = (dk4_px_t)(pobj->fc[0]);
+ bg[1] = (dk4_px_t)(pobj->fc[1]);
+ bg[2] = (dk4_px_t)(pobj->fc[2]);
+ if (DK4_CS_CONV_RGB_TO_GRAY_MIN <= (pobj->det).i.r2g) {
+ if (DK4_CS_CONV_RGB_TO_GRAY_MAX >= (pobj->det).i.r2g) {
+ ctx.rgb_to_gray = (dk4_cs_conv_rgb_to_gray_t)((pobj->det).i.r2g);
+ }
+ }
+ if (0x00 != (0x20 & ((pobj->det).i.fl))) {
+ fbg = 1;
+ }
+ if (0x00 != (0x02 & ((pobj->det).i.fl))) {
+ /* Alpha mix */
+ ctx.alpha = DK4_CS_CONV_ALPHA_MIX;
+ }
+ else {
+ /* Alpha ignore */
+ ctx.alpha = DK4_CS_CONV_ALPHA_FOREGROUND;
+ }
+ if (0 != (job->grco).color) {
+ ifl |= DK4_GRA_IMG_FLAG_COLOR;
+ }
+ if (0 != (job->grco).ps_lzw) {
+ ifl |= DK4_GRA_IMG_FLAG_LZW;
+ }
+ if (0x00 != (0x08 & ((pobj->det).i.fl))) {
+ ifl |= DK4_GRA_IMG_FLAG_DCT;
+ }
+ if (0x00 != (0x04 & ((pobj->det).i.fl))) {
+ ifl |= DK4_GRA_IMG_FLAG_INTERPOLATION;
+ }
+ if (0x00 != (0x10 & ((pobj->det).i.fl))) {
+ ifl |= DK4_GRA_IMG_FLAG_DCT_INTERPOLATION;
+ }
+ ifl |= DK4_GRA_IMG_FLAG_ANALYZE_BPC;
+ ifl |= DK4_GRA_IMG_FLAG_ANALYZE_COLOR;
+ ifl |= DK4_GRA_IMG_FLAG_ANALYZE_ALPHA;
+ if (0x00 == (0x01 & ((pobj->det).i.fl))) {
+ ifl |= DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO;
+ }
+ res = dk4recode_c8_to_dk(
+ fnb, DK4_SIZEOF(fnb,dkChar), dk4app_get_encoding(job->app),
+ (pobj->det).i.fn, DK4_ENCODING_UTF8, &er
+ );
+ if (0 != res) {
+ if (0 <= dk4bif_type_for_suffix(fnb)) {
+ pbif = dk4bif_open_app(fnb, 0, &ctx, job->app);
+ if (NULL != pbif) {
+ dk4error_init(&er);
+ dk4bif_set_background(pbif, bg, 3, 8, fbg);
+ dk4pppt_bif_image(
+ job->ppp, (pobj->det).i.x,
+ ((pobj->det).i.x + (pobj->det).i.w),
+ (pobj->det).i.y,
+ ((pobj->det).i.y + (pobj->det).i.h), pbif, fnb,
+ (size_t)0U, ifl, NULL, &back, &er
+ );
+ dk4bif_close(pbif);
+ if (0 == back) {
+
+#line 2270 "wxd2lout.ctr"
+ /* ERROR: Failed to add bitmap image */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 52
+ );
+ }
+ }
+ else {
+
+#line 2277 "wxd2lout.ctr"
+ back = 0;
+ /* ERROR: Failed to open file */
+ }
+ }
+ else {
+
+#line 2282 "wxd2lout.ctr"
+ back = 0;
+ /* ERROR: Not a supported bitmap type */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 53
+ );
+ }
+ }
+ else {
+
+#line 2290 "wxd2lout.ctr"
+ back = 0;
+ /* ERROR: Failed to decode file name! */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 54
+ );
+ }
+
+
+#line 2297 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one text object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_text_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+
+
+#line 2317 "wxd2lout.ctr"
+ if (NULL != (pobj->det).t.t) {
+ if ((uint16_t)0U != (pobj->det).t.fsz) {
+ back = 1;
+ }
+ else {
+ if ((uint8_t)0x00 != ((uint8_t)0x01 & (pobj->det).t.fl)) {
+ back = 1;
+ }
+ else {
+
+#line 2326 "wxd2lout.ctr"
+ /* ERROR: Font size 0 */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 55
+ );
+ }
+ }
+ }
+ else {
+
+#line 2334 "wxd2lout.ctr"
+ /* ERROR: No text on object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 56
+ );
+ }
+
+
+#line 2340 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one polyline/polygon object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_polyline_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double x0; /* Coordinate of first point */
+ double y0; /* Coordinate of first point */
+ double x1; /* Coordinate of second point */
+ double y1; /* Coordinate of second point */
+ double lseg; /* Segment length */
+ size_t lp; /* Index of last point */
+ int back = 0;
+
+
+#line 2366 "wxd2lout.ctr"
+ if (NULL != (pobj->det).p.p) {
+ if ((uint16_t)1U < (pobj->det).p.n) {
+ back = 1;
+ /*
+ For polyline check whether first and last segment
+ are long enough for arrowhead cuts.
+ */
+ if (WXD_OT_POLYLINE == pobj->ot) {
+ lseg = 0.0;
+ if (0 != (pobj->ab).type) {
+ x0 = ((pobj->det).p.p)[0].x;
+ x1 = ((pobj->det).p.p)[1].x;
+ y0 = ((pobj->det).p.p)[0].y;
+ y1 = ((pobj->det).p.p)[1].y;
+ x1 = x1 - x0;
+ y1 = y1 - y0;
+ lseg = sqrt(x1 * x1 + y1 * y1);
+ if (lseg <= (pobj->ab).cut) {
+ back = 0;
+
+#line 2385 "wxd2lout.ctr"
+ /* ERROR: First segment too short */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 57
+ );
+ }
+ }
+ if (0 != (pobj->af).type) {
+ lp = (pobj->det).p.n - 1;
+ x0 = ((pobj->det).p.p)[lp].x;
+ x1 = ((pobj->det).p.p)[lp - 1].x;
+ y0 = ((pobj->det).p.p)[lp].y;
+ y1 = ((pobj->det).p.p)[lp - 1].y;
+ x1 = x1 - x0;
+ y1 = y1 - y0;
+ /*
+ Just one segment or multiple segments?
+ */
+ if ((uint16_t)2U == (pobj->det).p.n) {
+ /*
+ If the polyline has just one segment (only
+ 2 points) the cuts for forward and backward
+ arrow are both applied to the same segment.
+ So the segment must be longer than the summary
+ of the two cuts.
+ */
+ lseg += sqrt(x1 * x1 + y1 * y1);
+ }
+ else {
+ /* Polyline has more than one segments, the
+ final segment is cutted for the forward
+ arrowhead only.
+ */
+ lseg = sqrt(x1 * x1 + y1 * y1);
+ }
+ if (lseg <= (pobj->af).cut) {
+ back = 0;
+
+#line 2421 "wxd2lout.ctr"
+ /* ERROR: Last segment too short */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 58
+ );
+ }
+ }
+ }
+ }
+ else {
+
+#line 2430 "wxd2lout.ctr"
+ /* ERROR: Too few points */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ }
+ else {
+
+#line 2437 "wxd2lout.ctr"
+ /* ERROR: No points for object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 60
+ );
+ }
+
+
+#line 2443 "wxd2lout.ctr"
+ return back;
+}
+
+
+/** Check one spline object if information is complete and object
+ can be drawn.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_spline_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double cutl; /* Length to cut, length of arrowhead */
+ int back = 0;
+
+
+#line 2465 "wxd2lout.ctr"
+ if (NULL != (pobj->det).s.p) {
+ if ((uint16_t)1U < (pobj->det).s.n) {
+ back = 1;
+ /*
+ For open spline object check whether spline
+ is long enough for arrowhead cuts.
+ */
+ if (WXD_OT_O_SPLINE == pobj->ot) {
+ if (
+ (0 != (pobj->af).type)
+ || (0 != (pobj->ab).type)
+ ) {
+ cutl = 0.0;
+ if (0 != (pobj->af).type) {
+ cutl += ((pobj->af).cut + (pobj->af).cuttol);
+ }
+ if (0 != (pobj->ab).type) {
+ cutl += ((pobj->ab).cut + (pobj->ab).cuttol);
+ }
+ if (cutl >= (pobj->det).s.suml) {
+ back = 0;
+
+#line 2486 "wxd2lout.ctr"
+ /* ERROR: Spline too short */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 61
+ );
+ }
+ if (0 != (pobj->af).type) {
+ cutl = (pobj->af).offset
+ + (double)((pobj->af).length)
+ * wxd2lat_object_linewidth(pobj, drw, job);
+ if (cutl >= (pobj->det).s.suml) {
+ back = 0;
+
+#line 2497 "wxd2lout.ctr"
+ /* ERROR: Forward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 62
+ );
+ }
+ }
+ if (0 != (pobj->ab).type) {
+ cutl = (pobj->ab).offset
+ + (double)((pobj->ab).length)
+ * wxd2lat_object_linewidth(pobj, drw, job);
+ if (cutl >= (pobj->det).s.suml) {
+ back = 0;
+
+#line 2510 "wxd2lout.ctr"
+ /* ERROR: Backward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 63
+ );
+ }
+ }
+ }
+ }
+ }
+ else {
+
+#line 2521 "wxd2lout.ctr"
+ /* ERROR: Too few points */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ }
+ else {
+
+#line 2528 "wxd2lout.ctr"
+ /* ERROR: No points for object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 60
+ );
+ }
+
+
+#line 2534 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one arc object if information is complete and object
+ can be drawn.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_arc_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+
+ double x0; /* Coordinate of first point */
+ double y0; /* Coordinate of first point */
+ double x1; /* Coordinate of second point */
+ double y1; /* Coordinate of second point */
+ double cutl; /* Length to cut, length of arrowhead */
+ double lseg; /* Segment length */
+ int back = 0;
+
+
+#line 2563 "wxd2lout.ctr"
+ /*
+ For open arc object check whether arc is long enough
+ for arrowhead cuts.
+ For malformed arc check whether segments are long enough
+ for the arrowhead cuts.
+ */
+ back = 1;
+ if (WXD_OT_O_ARC == pobj->ot) {
+ if ((0 != (pobj->af).type) || (0 != (pobj->ab).type)) {
+ if (0 != (pobj->det).a.d) {
+ /*
+ Real arc
+ */
+ lseg = fabs(
+ (pobj->det).a.r
+ * ((pobj->det).a.b - (pobj->det).a.a)
+ );
+ cutl = 0.0;
+ if (0 != (pobj->af).type) {
+ cutl = (pobj->af).cut;
+ }
+ if (0 != (pobj->ab).type) {
+ cutl += (pobj->ab).cut;
+ }
+ if (cutl > lseg) {
+ back = 0;
+ /* ERROR: Arc too short for arrows */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 64
+ );
+ }
+ if (0 != (pobj->af).type) {
+ cutl = (pobj->af).offset
+ + (double)((pobj->af).length)
+ * wxd2lat_object_linewidth(pobj, drw, job);
+ if (cutl > lseg) {
+ back = 0;
+ /* ERROR: Forward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 62
+ );
+ }
+ }
+ if (0 != (pobj->ab).type) {
+ cutl = (pobj->ab).offset
+ + (double)((pobj->ab).length)
+ * wxd2lat_object_linewidth(pobj, drw, job);
+ if (cutl > lseg) {
+ back = 0;
+ /* ERROR: Backward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 63
+ );
+ }
+ }
+ }
+ else {
+ /* Malformed arc drawn as polyline
+ */
+ if (0 != (pobj->af).type) {
+ x0 = wxd2lout_convert_x(drw,job,(double)((pobj->det).a.x2));
+ y0 = wxd2lout_convert_y(drw,job,(double)((pobj->det).a.y2));
+ x1 = wxd2lout_convert_x(drw,job,(double)((pobj->det).a.x3));
+ y1 = wxd2lout_convert_y(drw,job,(double)((pobj->det).a.y3));
+ x1 = x1 - x0;
+ y1 = y1 - y0;
+ lseg = sqrt(x1 * x1 + y1 * y1);
+ if (lseg <= (pobj->af).cut) {
+ back = 0;
+ /* ERROR: Forward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 62
+ );
+ }
+ }
+ if (0 != (pobj->ab).type) {
+ x0 = wxd2lout_convert_x(drw,job,(double)((pobj->det).a.x2));
+ y0 = wxd2lout_convert_y(drw,job,(double)((pobj->det).a.y2));
+ x1 = wxd2lout_convert_x(drw,job,(double)((pobj->det).a.x1));
+ y1 = wxd2lout_convert_y(drw,job,(double)((pobj->det).a.y1));
+ x1 = x1 - x0;
+ y1 = y1 - y0;
+ lseg = sqrt(x1 * x1 + y1 * y1);
+ if (lseg <= (pobj->ab).cut) {
+ back = 0;
+ /* ERROR: Backward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 63
+ );
+ }
+ }
+ }
+ }
+ }
+
+
+#line 2658 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one circle object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_circle_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+
+
+#line 2678 "wxd2lout.ctr"
+ if (0.0 < (pobj->det).e.rx) {
+ back = 1;
+ }
+ else {
+
+#line 2682 "wxd2lout.ctr"
+ /* ERROR: Radius 0 */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 65
+ );
+ }
+
+
+#line 2688 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one ellipse object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_ellipse_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+
+
+#line 2708 "wxd2lout.ctr"
+ if ((0.0 < (pobj->det).e.rx) && (0.0 < (pobj->det).e.ry)) {
+ back = 1;
+ }
+ else {
+
+#line 2712 "wxd2lout.ctr"
+ /* ERROR: Radius 0 */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 65
+ );
+ }
+
+
+#line 2718 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one box object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_box_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double w;
+ double h;
+ int back = 1;
+
+
+#line 2740 "wxd2lout.ctr"
+ w = fabs((pobj->det).b.xr - (pobj->det).b.xl);
+ h = fabs((pobj->det).b.yt - (pobj->det).b.yb);
+ if (h < w) {
+ w = h;
+ }
+ if ((pobj->det).b.r > (w / 2.0)) {
+ back = 0;
+ /* ERROR: Box radius too large */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 66
+ );
+ }
+
+
+#line 2753 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one dot object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_dot_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+
+
+#line 2773 "wxd2lout.ctr"
+ if (0.0 < (pobj->det).d.d) {
+ back = 1;
+ }
+ else {
+
+#line 2777 "wxd2lout.ctr"
+ /* ERROR: Diameter 0 */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 67
+ );
+ }
+
+
+#line 2783 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one image object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_image_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+
+
+#line 2803 "wxd2lout.ctr"
+ if (NULL != (pobj->det).i.fn) {
+ if ((0.0 < (pobj->det).i.w) && (0.0 < (pobj->det).i.h)) {
+ back = 1;
+ }
+ else {
+
+#line 2808 "wxd2lout.ctr"
+ /* ERROR: Width and height must be positive */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 68
+ );
+ }
+ }
+ else {
+
+#line 2815 "wxd2lout.ctr"
+ /* ERROR: No file name */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 69
+ );
+ }
+
+
+#line 2821 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check one graphics object if information is complete and object
+ can be drawn.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_graphics_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+
+
+#line 2843 "wxd2lout.ctr"
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : {
+ back = wxd2lout_check_one_text_object(job, pobj);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ back = wxd2lout_check_one_polyline_object(job, pobj);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ back = wxd2lout_check_one_spline_object(drw, job, pobj);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ back = wxd2lout_check_one_arc_object(drw, job, pobj);
+ } break;
+ case WXD_OT_CIRCLE : {
+ back = wxd2lout_check_one_circle_object(job, pobj);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ back = wxd2lout_check_one_ellipse_object(job, pobj);
+ } break;
+ case WXD_OT_BOX : {
+ back = wxd2lout_check_one_box_object(job, pobj);
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ back = wxd2lout_check_one_dot_object(job, pobj);
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxd2lout_check_one_image_object(job, pobj);
+ } break;
+ default : {
+
+#line 2872 "wxd2lout.ctr"
+ /* ERROR: Illegal object type */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 70
+ );
+ } break;
+ }
+ if (0 == back) {
+ /* ERROR: Object check failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 71
+ );
+ }
+
+
+#line 2885 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+static
+int
+wxd2lout_is_abnormal_circle(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double lw;
+ int back = 0;
+
+
+#line 2901 "wxd2lout.ctr"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ if ((pobj->det).e.rx <= (lw / 2.0)) {
+ back = 1;
+ }
+
+
+#line 2906 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check whether circle is abnormal (diameter smaller than line width).
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 for abnormal circle, 0 for normal circle.
+*/
+static
+int
+wxd2lout_abnormal_circle(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ double lw;
+ int back = 1;
+
+
+#line 2929 "wxd2lout.ctr"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ dk4error_init(&er);
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ &back, &er
+ );
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ dk4pppt_circle(
+ job->ppp, (pobj->det).e.x, (pobj->det).e.y,
+ ((pobj->det).e.rx + lw / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+
+
+#line 2945 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Draw abnormal stroked circle as filled circle.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Circle object to draw.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_is_abnormal_ellipse(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double lw;
+ int back = 0;
+
+
+#line 2967 "wxd2lout.ctr"
+ lw = wxd2lat_object_linewidth(pobj, drw, job) / 2.0;
+ if (((pobj->det).e.rx <= lw) || ((pobj->det).e.ry <= lw)) {
+ back = 1;
+ }
+
+
+#line 2972 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Check whether ellipse is abnormal (one diameter smaller than line width).
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Ellipse object to check.
+ @return 1 for abnormal ellipse, 0 for normal ellipse.
+*/
+static
+int
+wxd2lout_abnormal_ellipse(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ double lw;
+ int back = 1;
+
+
+#line 2995 "wxd2lout.ctr"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ dk4error_init(&er);
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ &back, &er
+ );
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ dk4pppt_ellipse(
+ job->ppp, (pobj->det).e.x, (pobj->det).e.y,
+ ((pobj->det).e.rx + lw / 2.0), ((pobj->det).e.ry + lw / 2.0),
+ (pobj->det).e.a, NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+
+
+#line 3012 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+static
+int
+wxd2lout_is_abnormal_box(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double lw;
+ int back = 0;
+
+
+#line 3028 "wxd2lout.ctr"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ if (
+ (lw >= fabs((pobj->det).b.xr - (pobj->det).b.xl))
+ || (lw >= fabs((pobj->det).b.yt - (pobj->det).b.yb))
+ ) {
+ back = 1;
+ }
+
+
+#line 3036 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+static
+int
+wxd2lout_abnormal_box(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ double lw;
+ double xl;
+ double xr;
+ double yt;
+ double yb;
+ double ra;
+ double dx;
+ double dy;
+ int back = 1;
+
+
+#line 3060 "wxd2lout.ctr"
+ lw = wxd2lat_object_linewidth(pobj, drw, job) / 2.0;
+ dk4error_init(&er);
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ &back, &er
+ );
+
+
+#line 3070 "wxd2lout.ctr"
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+
+
+#line 3072 "wxd2lout.ctr"
+ if ((pobj->det).b.xr >= (pobj->det).b.xl) {
+ xl = (pobj->det).b.xl - lw;
+ xr = (pobj->det).b.xr + lw;
+ }
+ else {
+ xl = (pobj->det).b.xr - lw;
+ xr = (pobj->det).b.xl + lw;
+ }
+ if ((pobj->det).b.yt >= (pobj->det).b.yb) {
+ yb = (pobj->det).b.yb - lw;
+ yt = (pobj->det).b.yt + lw;
+ }
+ else {
+ yb = (pobj->det).b.yt - lw;
+ yt = (pobj->det).b.yb + lw;
+ }
+ if (0.0 < (pobj->det).b.r) {
+ ra = (pobj->det).b.r + lw;
+ dx = fabs(xr - xl);
+ dy = fabs(yb - yt);
+ if (dy < dx) { dx = dy; }
+ dx *= 0.4998;
+ if (dx < ra) {
+ ra = dx;
+ }
+ }
+ else {
+ ra = -1.0;
+ }
+ dk4pppt_rectangle(job->ppp, xl, xr, yb, yt, ra, NULL, &back, &er);
+
+
+#line 3103 "wxd2lout.ctr"
+ dk4pppt_fill(job->ppp, &back, &er);
+
+
+#line 3105 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+
+/** Draw one graphics object.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Graphics object to draw.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_one_graphics_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 1;
+
+
+
+#line 3128 "wxd2lout.ctr"
+ if (0 != wxd2lout_check_one_graphics_object(drw, job, pobj)) {
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : {
+ back = wxd2lout_text_object(job, pobj);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE : case WXD_OT_O_ARC : {
+ back = wxd2lout_open_path_object(drw, job, pobj);
+ } break;
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE : case WXD_OT_C_ARC : {
+ back = wxd2lout_closed_path_object(drw, job, pobj);
+ } break;
+ case WXD_OT_CIRCLE : {
+ if (0 != wxd2lout_is_abnormal_circle(drw, job, pobj)) {
+ back = wxd2lout_abnormal_circle(drw, job, pobj);
+ }
+ else {
+ back = wxd2lout_closed_path_object(drw, job, pobj);
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ if (0 != wxd2lout_is_abnormal_ellipse(drw, job, pobj)) {
+ back = wxd2lout_abnormal_ellipse(drw, job, pobj);
+ }
+ else {
+ back = wxd2lout_closed_path_object(drw, job, pobj);
+ }
+ } break;
+ case WXD_OT_BOX : {
+ if (0 != wxd2lout_is_abnormal_box(drw, job, pobj)) {
+ back = wxd2lout_abnormal_box(drw, job, pobj);
+ }
+ else {
+ back = wxd2lout_closed_path_object(drw, job, pobj);
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+
+
+#line 3165 "wxd2lout.ctr"
+ back = wxd2lout_dot_object(drw, job, pobj);
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxd2lout_image_object(job, pobj);
+ } break;
+ }
+ if (0 == back) {
+ /* ERROR: Failed to write graphics object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 72
+ );
+ }
+ }
+ else {
+ back = 0;
+ }
+
+
+#line 3182 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+/** Create output for all graphics objects in a drawing.
+ @param drw Original drawing.
+ @param job Job structure containing the output structure.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_all_graphics_objects(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job
+)
+{
+ wxd_object_t *pobj;
+ dk4_um_t oldline;
+ int back = 1;
+
+
+
+#line 3204 "wxd2lout.ctr"
+ oldline = dk4app_get_log_source_line(job->app);
+ dk4sto_it_reset(drw->i_flat);
+ do {
+ pobj = (wxd_object_t *)dk4sto_it_next(drw->i_flat);
+ if (NULL != pobj) {
+ dk4app_set_log_source_line(job->app, pobj->lino);
+ if (0 == wxd2lout_one_graphics_object(drw, job, pobj)) {
+ back = 0;
+ }
+ }
+ } while (NULL != pobj);
+ dk4app_set_log_source_line(job->app, oldline);
+
+
+#line 3217 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+static
+int
+wxd2lout_check_arrows(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 1;
+
+
+#line 3232 "wxd2lout.ctr"
+ if ((uint8_t)0U != (pobj->af).type) {
+ if (0 == wxd2lah_one_arrowhead(&(pobj->af), pobj, drw, job)) {
+ back = 0;
+ /* ERROR: Forward arrow calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 73
+ );
+ }
+ }
+ if ((uint8_t)0U != (pobj->ab).type) {
+ if (0 == wxd2lah_one_arrowhead(&(pobj->ab), pobj, drw, job)) {
+ back = 0;
+ /* ERROR: Backward arrow calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 74
+ );
+ }
+ }
+
+
+#line 3251 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+static
+int
+wxd2out_all_calculations(wxd_drawing_t *drw, wxd2lat_job_t *job)
+{
+ wxd_object_t *pobj;
+ dk4_um_t oldline;
+ int back = 1;
+ int myback = 0;
+ uint16_t u16;
+
+
+#line 3266 "wxd2lout.ctr"
+ oldline = dk4app_get_log_source_line(job->app);
+ dk4sto_it_reset(drw->i_flat);
+ do {
+ pobj = (wxd_object_t *)dk4sto_it_next(drw->i_flat);
+ if (NULL != pobj) {
+ dk4app_set_log_source_line(job->app, pobj->lino);
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : {
+ (pobj->det).t.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).t.x);
+ (pobj->det).t.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).t.y);
+#if 0
+ (pobj->det).t.a = (M_PI * (pobj->det).t.a) / 180.0;
+#endif
+ } break;
+ case WXD_OT_POLYLINE : {
+ u16 = (uint16_t)0U;
+ if ((NULL != (pobj->det).p.p) && (u16 < (pobj->det).p.n)) {
+ for (u16 = (uint16_t)0U; u16 < (pobj->det).p.n; u16++) {
+ ((pobj->det).p.p)[u16].x =
+ wxd2lout_convert_x(
+ drw, job, ((pobj->det).p.p)[u16].x
+ );
+ ((pobj->det).p.p)[u16].y =
+ wxd2lout_convert_y(
+ drw, job, ((pobj->det).p.p)[u16].y
+ );
+ }
+ }
+ if (0 == wxd2lout_check_arrows(drw, job, pobj)) {
+ /* Errors already reported */
+ back = 0;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ u16 = (uint16_t)0U;
+ if ((NULL != (pobj->det).s.p) && (u16 < (pobj->det).s.n)) {
+ for (u16 = (uint16_t)0U; u16 < (pobj->det).s.n; u16++) {
+ ((pobj->det).s.p)[u16].x =
+ wxd2lout_convert_x(
+ drw, job, ((pobj->det).s.p)[u16].x
+ );
+ ((pobj->det).s.p)[u16].y =
+ wxd2lout_convert_y(
+ drw, job, ((pobj->det).s.p)[u16].y
+ );
+ }
+ }
+ if (0 == wxd2lout_check_arrows(drw, job, pobj)) {
+ /* Errors already reported */
+ back = 0;
+ }
+ if (
+ ((uint8_t)0U != (pobj->af).type)
+ || ((uint8_t)0U != (pobj->ab).type)
+ ) {
+ (pobj->det).s.ts = -1.0;
+ (pobj->det).s.te = -1.0;
+ myback = 1;
+ wxd2lxs_calculate_spline_segments(job, pobj, &myback);
+ if (0 == myback) {
+ back = 0;
+ /* ERROR: Spline segment calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 75
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : {
+
+#line 3338 "wxd2lout.ctr"
+ (pobj->det).a.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).a.x);
+ (pobj->det).a.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).a.y);
+
+
+#line 3343 "wxd2lout.ctr"
+ (pobj->det).a.r =
+ wxd2lout_convert_r((pobj->det).a.r);
+ if (0 == wxd2lout_check_arrows(drw, job, pobj)) {
+ /* Errors already reported */
+ back = 0;
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+ u16 = (uint16_t)0U;
+ if ((NULL != (pobj->det).p.p) && (u16 < (pobj->det).p.n)) {
+ for (u16 = (uint16_t)0U; u16 < (pobj->det).p.n; u16++) {
+ ((pobj->det).p.p)[u16].x =
+ wxd2lout_convert_x(
+ drw, job, ((pobj->det).p.p)[u16].x
+ );
+ ((pobj->det).p.p)[u16].y =
+ wxd2lout_convert_y(
+ drw, job, ((pobj->det).p.p)[u16].y
+ );
+ }
+ }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ u16 = (uint16_t)0U;
+ if ((NULL != (pobj->det).s.p) && (u16 < (pobj->det).s.n)) {
+ for (u16 = (uint16_t)0U; u16 < (pobj->det).s.n; u16++) {
+ ((pobj->det).s.p)[u16].x =
+ wxd2lout_convert_x(
+ drw, job, ((pobj->det).s.p)[u16].x
+ );
+ ((pobj->det).s.p)[u16].y =
+ wxd2lout_convert_y(
+ drw, job, ((pobj->det).s.p)[u16].y
+ );
+ }
+ }
+ } break;
+ case WXD_OT_C_ARC : {
+
+#line 3381 "wxd2lout.ctr"
+ (pobj->det).a.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).a.x);
+ (pobj->det).a.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).a.y);
+
+
+#line 3386 "wxd2lout.ctr"
+ (pobj->det).a.r =
+ wxd2lout_convert_r((pobj->det).a.r);
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+
+#line 3390 "wxd2lout.ctr"
+ (pobj->det).e.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).e.x);
+ (pobj->det).e.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).e.y);
+
+
+#line 3395 "wxd2lout.ctr"
+ (pobj->det).e.rx =
+ wxd2lout_convert_r((pobj->det).e.rx);
+
+
+#line 3398 "wxd2lout.ctr"
+
+
+#line 3399 "wxd2lout.ctr"
+ (pobj->det).e.ry =
+ wxd2lout_convert_r((pobj->det).e.ry);
+
+
+#line 3402 "wxd2lout.ctr"
+ } break;
+ case WXD_OT_BOX : {
+
+#line 3404 "wxd2lout.ctr"
+
+
+#line 3405 "wxd2lout.ctr"
+
+
+#line 3406 "wxd2lout.ctr"
+
+
+#line 3407 "wxd2lout.ctr"
+
+
+#line 3408 "wxd2lout.ctr"
+
+
+#line 3409 "wxd2lout.ctr"
+ (pobj->det).b.xl =
+ wxd2lout_convert_x(drw, job, (pobj->det).b.xl);
+ (pobj->det).b.xr =
+ wxd2lout_convert_x(drw, job, (pobj->det).b.xr);
+ (pobj->det).b.yb =
+ wxd2lout_convert_y(drw, job, (pobj->det).b.yb);
+ (pobj->det).b.yt =
+ wxd2lout_convert_y(drw, job, (pobj->det).b.yt);
+ if (0.0 < (pobj->det).b.r) {
+
+
+#line 3419 "wxd2lout.ctr"
+ (pobj->det).b.r = wxd2lout_convert_r((pobj->det).b.r);
+ }
+
+
+#line 3422 "wxd2lout.ctr"
+
+
+#line 3423 "wxd2lout.ctr"
+
+
+#line 3424 "wxd2lout.ctr"
+
+
+#line 3425 "wxd2lout.ctr"
+
+
+#line 3426 "wxd2lout.ctr"
+ } break;
+ case WXD_OT_IMAGE : {
+
+#line 3428 "wxd2lout.ctr"
+ (pobj->det).i.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).i.x);
+ (pobj->det).i.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).i.y);
+
+
+#line 3433 "wxd2lout.ctr"
+
+
+#line 3434 "wxd2lout.ctr"
+ (pobj->det).i.w = wxd2lout_convert_r((pobj->det).i.w);
+ (pobj->det).i.h = wxd2lout_convert_r((pobj->det).i.h);
+
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+
+#line 3439 "wxd2lout.ctr"
+ (pobj->det).d.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).d.x);
+ (pobj->det).d.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).d.y);
+
+
+#line 3444 "wxd2lout.ctr"
+ if (0.0 < job->baselw) {
+ (pobj->det).d.d *= job->baselw;
+ }
+ else {
+ (pobj->det).d.d *= drw->baselw;
+ }
+
+
+#line 3451 "wxd2lout.ctr"
+ } break;
+ }
+ }
+ } while (NULL != pobj);
+ dk4app_set_log_source_line(job->app, oldline);
+
+
+#line 3457 "wxd2lout.ctr"
+ return back;
+}
+
+
+
+void
+wxd2lat_output(wxd_drawing_t *drw, wxd2lat_job_t *job, const dkChar *fn)
+{
+ dk4_er_t er;
+ dk4_pppt_driver_t dr;
+ int flags = 0;
+ int ok = 0;
+
+
+
+#line 3471 "wxd2lout.ctr"
+ /*
+ Calculate image width and coordinates shift values.
+ */
+ if (0 == wxd2lout_prepare_job(drw, job, fn)) {
+ /* All errors already reported */
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+ /* Convert coordinates to bp, pre-calculate arrowhead data.
+ */
+ if (0 == wxd2out_all_calculations(drw, job)) {
+ /* All errors already reported */
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+ /* Open output structure
+ */
+ dr = DK4_PPPT_DR_PDF_TEX;
+ switch ((job->grco).driver) {
+#if 0
+ case DK4_GRA_DRIVER_PDF : {
+ dr = DK4_PPPT_DR_PDF_TEX;
+ } break;
+#endif
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dr = DK4_PPPT_DR_EPS_TEX;
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dr = DK4_PPPT_DR_PGF;
+ } break;
+ }
+ if (0 == job->whitebg) {
+ flags |= DK4_GRA_PAGE_FLAG_NO_BG;
+ }
+ if (0 == (job->grco).color) {
+ flags |= DK4_GRA_DOC_FLAG_FORCE_GRAY;
+ }
+ if (DK4_PPPT_DR_EPS_TEX == dr) {
+ if (2 == (job->grco).ps_level) {
+ flags |= DK4_GRA_DOC_FLAG_PS2;
+ }
+ if (0 != (job->grco).ps_dsc) {
+ flags |= DK4_GRA_DOC_FLAG_PS_DSC;
+ }
+ if (DK4_GRA_DRIVER_EPS == (job->grco).driver) {
+ flags |= DK4_GRA_DOC_FLAG_EPS;
+ }
+ }
+ dk4error_init(&er);
+ job->ppp = dk4pppt_open(
+ job->fno1, dr,
+ ((DK4_GRA_PURPOSE_DOCUMENT == (job->grco).purpose) ? (1) : (0)),
+ flags, job->szwidth, job->szheight, &er
+ );
+ if (NULL == job->ppp) {
+ /* ERROR: Failed to open output structure */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 76
+ );
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+ dk4pppt_set_gs_for_pattern_only(job->ppp, 1, NULL);
+ if (0.0 < job->patlw) {
+ dk4pppt_set_pattern_line_width(job->ppp, job->patlw);
+ }
+ else {
+ dk4pppt_set_pattern_line_width(job->ppp, 0.45);
+ }
+ /*
+ Clip if shiftx and/or shifty is used
+ */
+ if (0 == wxd2lout_clip_to_used_region(job)) {
+ /* All errors already reported */
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+ /* Draw all graphics objects
+ */
+ if (0 == wxd2lout_all_graphics_objects(drw, job)) {
+ /* All errors already reported */
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+
+ /* Finally indicate success
+ */
+ ok = 1;
+
+ /* Produce output files if success so far, clean up
+ */
+ finished:
+ if (NULL != job->ppp) {
+ if (0 != ok) {
+ dk4error_init(&er);
+ ok = dk4pppt_write_and_close(job->ppp, &er);
+ if (0 == ok) {
+ /* ERROR: Failed to write output */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 77
+ );
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ dk4pppt_close(job->ppp);
+ /* ERROR: Skipping output due to previous errors */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 78
+ );
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ job->ppp = NULL;
+
+
+#line 3586 "wxd2lout.ctr"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxd2lout.ctr b/support/dktools/wxd2lout.ctr
new file mode 100644
index 0000000000..bb2275c98d
--- /dev/null
+++ b/support/dktools/wxd2lout.ctr
@@ -0,0 +1,3591 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Produce output for an input file successfully read in.
+ @param drw Drawing to produce output for.
+ @param job Job structure, probably modified.
+ @param fn Input file name
+*/
+
+void
+wxd2lat_output(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ const dkChar *fn
+);
+
+
+/** Convert x value from WXD coordinates to bp.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param x X value to convert.
+ @return Conversion result.
+*/
+
+double
+wxd2lout_convert_x(wxd_drawing_t *drw, wxd2lat_job_t *job, double x);
+
+
+/** Convert y value from WXD coordinates to bp.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param y Y value to convert.
+ @return Conversion result.
+*/
+
+double
+wxd2lout_convert_y(wxd_drawing_t *drw, wxd2lat_job_t *job, double y);
+
+
+/** Convert a distance from WXD units to bp.
+ @param r Distance in WXD units to convert.
+ @return Result in bp.
+*/
+
+double
+wxd2lout_convert_r(double r);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+%% module
+
+#ifndef WXD2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+static const dkChar *kwnl[] = {
+$!string-table macro=dkT
+#
+# 0 File name suffix .tex
+#
+.tex
+$!end
+};
+
+
+
+double
+wxd2lout_convert_x(wxd_drawing_t *drw, wxd2lat_job_t *job, double x)
+{
+#if TRACE_DEBUG
+ double back;
+ $? "+ wxd2lout_convert_x %g", x
+ back = ((9.0 * (x - drw->bbxl)) / 2032000.0) + job->shiftx;
+ $? "- wxd2lout_convert_x %g", back
+ return back;
+#else
+ return (((9.0 * (x - drw->bbxl)) / 2032000.0) + job->shiftx);
+#endif
+}
+
+
+
+double
+wxd2lout_convert_y(wxd_drawing_t *drw, wxd2lat_job_t *job, double y)
+{
+#if TRACE_DEBUG
+ double back;
+ $? "+ wxd2lout_convert_y %g", y
+ back = ((9.0 * (y - drw->bbyb)) / 2032000.0) + job->shifty;
+ $? "- wxd2lout_convert_y %g", back
+ return back;
+#else
+ return (((9.0 * (y - drw->bbyb)) / 2032000.0) + job->shifty);
+#endif
+}
+
+
+
+/** Convert distance value from WXD coordinates to bp.
+ @param r Distance to convert
+ @return Conversion result.
+*/
+double
+wxd2lout_convert_r(double r)
+{
+#if TRACE_DEBUG
+ double back;
+ $? "+ wxd2lout_convert_r %g", r
+ back = ((9.0 * r) / 2032000.0);
+ $? "- wxd2lout_convert_r %g", back
+ return back;
+#else
+ return ((9.0 * r) / 2032000.0);
+#endif
+}
+
+
+
+
+/** Prepare job structure, calculate coordinates transformations
+ and create output file name.
+ @param drw Drawing to convert.
+ @param job Job structure.
+ @param fn File name.
+ @return 1 on success (output possible), 0 on error.
+*/
+static
+int
+wxd2lout_prepare_job(wxd_drawing_t *drw, wxd2lat_job_t *job, const dkChar *fn)
+{
+ dkChar *ptr;
+ double dwidth;
+ double dheight;
+ double cwidth;
+ double cheight;
+ int back = 1;
+ $? "+ wxd2lout_prepare_job"
+ dwidth = (9.0 * (drw->bbxr - drw->bbxl)) / 2032000.0;
+ dheight = (9.0 * (drw->bbyt - drw->bbyb)) / 2032000.0;
+ cwidth = ceil(dwidth);
+ cheight = ceil(dheight);
+ if (cwidth > dwidth) {
+ job->shiftx = (cwidth - dwidth) / 2.0;
+ $? ". shiftx = %g", job->shiftx
+ }
+ if (cheight > dheight) {
+ job->shifty = (cheight - dheight) / 2.0;
+ $? ". shifty = %g", job->shifty
+ }
+ if ((0 == dk4ma_is_finite(dwidth)) || (0 == dk4ma_is_finite(cwidth))) {
+ back = 0;
+ /* ERROR: Numeric overflow in width calculation */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 36
+ );
+ }
+ if ((0 == dk4ma_is_finite(dheight)) || (0 == dk4ma_is_finite(cheight))) {
+ back = 0;
+ /* ERROR: Numeric overflow in height calculation */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 36
+ );
+ }
+ if ((double)(SIZE_MAX) < cwidth) {
+ back = 0;
+ /* ERROR: Numeric overflow in width calculation */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 36
+ );
+ }
+ else {
+ job->szwidth = (size_t)cwidth;
+ $? ". width = %u", (unsigned)(job->szwidth)
+ }
+ if ((double)(SIZE_MAX) < cheight) {
+ back = 0;
+ /* ERROR: Numeric overflow in height calculation */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 36
+ );
+ }
+ else {
+ job->szheight = (size_t)cheight;
+ $? ". height = %u", (unsigned)(job->szheight)
+ }
+ if (0 != dk4str_cpy_s(job->fno1, job->szfnb, fn, NULL)) {
+ ptr = dk4path_get_suffix(job->fno1, NULL);
+ if (NULL != ptr) { *ptr = dkT('\0'); }
+ if (0 == dk4str_cat_s(job->fno1, job->szfnb, kwnl[0], NULL)) {
+ back = 0;
+ /* ERROR: File name too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 37
+ );
+ }
+ }
+ else {
+ /* ERROR: File name too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 37
+ );
+ back = 0;
+ }
+ $? "- wxd2lout_prepare_job %d", back
+ return back;
+}
+
+
+
+/** Set clip region to used coordinates ranges.
+ @param drw Drawing to convert.
+ @param job Job structure.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_clip_to_used_region(wxd2lat_job_t *job)
+{
+ dk4_er_t er;
+ int back = 1;
+ double xl;
+ double xr;
+ double yb;
+ double yt;
+ $? "+ wxd2lout_clip_to_used_region"
+ if ((0.0 < job->shiftx) || (0.0 < job->shifty)) {
+ xl = job->shiftx;
+ if (0.0 > xl) { xl = 0.0; }
+ xr = (double)(job->szwidth) - job->shiftx;
+ yb = job->shifty;
+ if (0.0 > yb) { yb = 0.0; }
+ yt = (double)(job->szheight) - job->shifty;
+ dk4error_init(&er);
+ dk4pppt_newpath_moveto(job->ppp, xl, yb, NULL, &back, &er);
+ dk4pppt_lineto(job->ppp, xr, yb, NULL, &back, &er);
+ dk4pppt_lineto(job->ppp, xr, yt, NULL, &back, &er);
+ dk4pppt_lineto(job->ppp, xl, yt, NULL, &back, &er);
+ dk4pppt_lineto(job->ppp, xl, yb, NULL, &back, &er);
+ dk4pppt_closepath(job->ppp, &back, &er);
+ dk4pppt_clip(job->ppp, &back, &er);
+ if (0 == back) {
+ /* ERROR: Failed to clip region */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 38
+ );
+ }
+ }
+ $? "- wxd2lout_clip_to_used_region %d", back
+ return back;
+}
+
+
+
+/** Set stroke RGB colour.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_stroke_rgb(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_stroke_rgb"
+ dk4pppt_set_stroke_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ backptr, erp
+ );
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ $? "- wxd2lout_stroke_rgb"
+}
+
+
+
+/** Set stroke line width.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_line_width(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_line_width"
+ dk4pppt_set_line_width(
+ job->ppp, wxd2lat_object_linewidth(pobj, drw, job),
+ backptr, erp
+ );
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ $? "- wxd2lout_line_width"
+}
+
+
+
+/** Set stroke line style.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_line_style(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ double sv;
+ dk4_gra_ls_t ls = DK4_GRA_LS_SOLID;
+ $? "+ wxd2lout_line_style"
+ switch (pobj->ls) {
+ case WXD_LS_SOLID : {
+ ls = DK4_GRA_LS_SOLID;
+ } break;
+ case WXD_LS_DASH : {
+ ls = DK4_GRA_LS_DASH;
+ } break;
+ case WXD_LS_DOT : {
+ ls = DK4_GRA_LS_DOT;
+ } break;
+ case WXD_LS_DASH_DOT : {
+ ls = DK4_GRA_LS_DASH_DOT;
+ } break;
+ case WXD_LS_DASH_DOT_DOT : {
+ ls = DK4_GRA_LS_DASH_DOT_DOT;
+ } break;
+ case WXD_LS_DASH_DOT_DOT_DOT : {
+ ls = DK4_GRA_LS_DASH_DOT_DOT_DOT;
+ } break;
+ }
+ sv = (double)(pobj->sl) * wxd2lat_object_linewidth(pobj, drw, job);
+ dk4pppt_set_line_style(job->ppp, ls, sv, backptr, erp);
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ $? "- wxd2lout_line_style"
+}
+
+
+
+/** Set stroke line cap.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_line_cap(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_lc_t lc = DK4_GRA_LC_BUTTED;
+ $? "+ wxd2lout_line_cap"
+ switch (pobj->csfs) {
+ case WXD_LC_BUTTED : {
+ lc = DK4_GRA_LC_BUTTED;
+ } break;
+ case WXD_LC_ROUNDED : {
+ lc = DK4_GRA_LC_ROUNDED;
+ } break;
+ case WXD_LC_PROJECTING : {
+ lc = DK4_GRA_LC_PROJECTING;
+ } break;
+ }
+ dk4pppt_set_line_cap(job->ppp, lc, backptr, erp);
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ $? "- wxd2lout_line_cap"
+}
+
+
+
+/** Set stroke line join.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_line_join(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ dk4_gra_lj_t lj = DK4_GRA_LJ_MITERED;
+ $? "+ wxd2lout_line_join"
+ switch ( (int)(pobj->ot) ) {
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ lj = DK4_GRA_LJ_ROUNDED;
+ } break;
+ default : {
+ switch (pobj->js) {
+ case WXD_LJ_MITERED : {
+ lj = DK4_GRA_LJ_MITERED;
+ } break;
+ case WXD_LJ_ROUNDED : {
+ lj = DK4_GRA_LJ_ROUNDED;
+ } break;
+ case WXD_LJ_BEVELED : {
+ lj = DK4_GRA_LJ_BEVELED;
+ } break;
+ }
+ } break;
+ }
+
+ $? ". ml = %u", (unsigned)(pobj->ml)
+ $? ". ml = %g", (double)(pobj->ml)
+ if ((uint8_t)0U == pobj->ml) { pobj->ml = (uint8_t)1U; }
+ dk4pppt_set_line_join(job->ppp, lj, (double)(pobj->ml), backptr, erp);
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ $? "- wxd2lout_line_join"
+}
+
+
+
+/** Set fill RGB colour.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_fill_rgb(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_fill_rgb"
+ $? ". fill"
+ $? ". r=%u", (unsigned)(pobj->fc[0])
+ $? ". g=%u", (unsigned)(pobj->fc[1])
+ $? ". b=%u", (unsigned)(pobj->fc[2])
+ $? ". stroke colour would be"
+ $? ". r=%u", (unsigned)(pobj->sc[0])
+ $? ". g=%u", (unsigned)(pobj->sc[1])
+ $? ". b=%u", (unsigned)(pobj->sc[2])
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->fc[0])) / 255.0),
+ (((double)(pobj->fc[1])) / 255.0),
+ (((double)(pobj->fc[2])) / 255.0),
+ backptr, erp
+ );
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ $? "- wxd2lout_fill_rgb"
+}
+
+
+
+/** Set fill attributes.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_attributes_fill(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_er_t *erp
+)
+{
+ /* Fill colour
+ */
+ $? "+ wxd2lout_attributes_fill"
+ wxd2lout_fill_rgb(job, pobj, backptr, erp);
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ $? "- wxd2lout_attributes_fill"
+}
+
+
+
+/** Return pattern for object.
+ @param pobj Object to pattern.
+ @return Pattern number as dk4_gra_pattern_t.
+*/
+static
+dk4_gra_pattern_t
+wxd2lout_find_pattern(wxd_object_t *pobj)
+{
+ dk4_gra_pattern_t back = DK4_GRA_PATTERN_30_DEGREE_LEFT;
+ $? "+ wxd2lout_find_pattern"
+ switch (pobj->csfs) {
+ case WXD_FS_30_DEGREE_LEFT : {
+ back = DK4_GRA_PATTERN_30_DEGREE_LEFT;
+ } break;
+ case WXD_FS_30_DEGREE_RIGHT : {
+ back = DK4_GRA_PATTERN_30_DEGREE_RIGHT;
+ } break;
+ case WXD_FS_30_DEGREE_SIEVE : {
+ back = DK4_GRA_PATTERN_30_DEGREE_SIEVE;
+ } break;
+ case WXD_FS_45_DEGREE_LEFT : {
+ back = DK4_GRA_PATTERN_45_DEGREE_LEFT;
+ } break;
+ case WXD_FS_45_DEGREE_RIGHT : {
+ back = DK4_GRA_PATTERN_45_DEGREE_RIGHT;
+ } break;
+ case WXD_FS_45_DEGREE_SIEVE : {
+ back = DK4_GRA_PATTERN_45_DEGREE_SIEVE;
+ } break;
+ case WXD_FS_HORIZONTAL_BRICKS : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_BRICKS;
+ } break;
+ case WXD_FS_VERTICAL_BRICKS : {
+ back = DK4_GRA_PATTERN_VERTICAL_BRICKS;
+ } break;
+ case WXD_FS_HORIZONTAL_LINES : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_LINES;
+ } break;
+ case WXD_FS_VERTICAL_LINES : {
+ back = DK4_GRA_PATTERN_VERTICAL_LINES;
+ } break;
+ case WXD_FS_HORIZONTAL_VERTICAL_SIEVE : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE;
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_LEFT : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT;
+ } break;
+ case WXD_FS_HORIZONTAL_SHINGLES_RIGHT : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT;
+ } break;
+ case WXD_FS_VERTICAL_SHINGLES_1 : {
+ back = DK4_GRA_PATTERN_VERTICAL_SHINGLES_1;
+ } break;
+ case WXD_FS_VERTICAL_SHINGLES_2 : {
+ back = DK4_GRA_PATTERN_VERTICAL_SHINGLES_2;
+ } break;
+ case WXD_FS_LARGE_FISH_SCALES : {
+ back = DK4_GRA_PATTERN_LARGE_FISH_SCALES;
+ } break;
+ case WXD_FS_SMALL_FISH_SCALES : {
+ back = DK4_GRA_PATTERN_SMALL_FISH_SCALES;
+ } break;
+ case WXD_FS_CIRCLES : {
+ back = DK4_GRA_PATTERN_CIRCLES;
+ } break;
+ case WXD_FS_HEXAGONS : {
+ back = DK4_GRA_PATTERN_HEXAGONS;
+ } break;
+ case WXD_FS_OCTAGONS : {
+ back = DK4_GRA_PATTERN_OCTAGONS;
+ } break;
+ case WXD_FS_HORIZONTAL_TIRES : {
+ back = DK4_GRA_PATTERN_HORIZONTAL_TIRES;
+ } break;
+ case WXD_FS_VERTICAL_TIRES : {
+ back = DK4_GRA_PATTERN_VERTICAL_TIRES;
+ } break;
+
+ }
+ $? "- wxd2lout_find_pattern %d", (int)back
+ return back;
+}
+
+
+
+/** Set stroke attributes.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Current object.
+ @param backptr Address of success variable to reset on errors.
+ @param use_lc Flag: Also set line cap.
+ @param use_lj Flag: Use join style and miter limit.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+static
+void
+wxd2lout_attributes_stroke(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ int use_lc,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_attributes_stroke"
+ /* Stroke colour
+ */
+ wxd2lout_stroke_rgb(job, pobj, backptr, erp);
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ /*
+ Line width
+ */
+ wxd2lout_line_width(drw, job, pobj, backptr, erp);
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ /*
+ Line style and dash length
+ */
+ wxd2lout_line_style(drw, job, pobj, backptr, erp);
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ /*
+ Line cap
+ */
+ if (0 != use_lc) {
+ wxd2lout_line_cap(job, pobj, backptr, erp);
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ }
+ /*
+ Line join
+ */
+ switch (pobj->ot) {
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE :
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE :
+ case WXD_OT_C_ARC: case WXD_OT_BOX : {
+ wxd2lout_line_join(job, pobj, backptr, erp);
+ } break;
+ }
+ $? ". back = %d", ((NULL != backptr) ? (*backptr) : (0))
+ $? "- wxd2lout_attributes_stroke"
+}
+
+
+
+/** Create polygon or polyline without arrowheads path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_pl_no_arrows(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ uint16_t i;
+ $? "+ wxd2lout_path_pl_no_arrows"
+ dk4pppt_newpath_moveto(
+ job->ppp, ((pobj->det).p.p)[0].x, ((pobj->det).p.p)[0].y,
+ pbb, backptr, erp
+ );
+ for (i = 1; i < (pobj->det).p.n; i++) {
+ dk4pppt_lineto(
+ job->ppp, ((pobj->det).p.p)[i].x, ((pobj->det).p.p)[i].y,
+ pbb, backptr, erp
+ );
+ }
+ if (0 != iscl) {
+ dk4pppt_lineto(
+ job->ppp, ((pobj->det).p.p)[0].x, ((pobj->det).p.p)[0].y,
+ pbb, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ $? "- wxd2lout_path_pl_no_arrows %d", *backptr
+}
+
+
+
+/** Create Bezier segments for one X-spline segment.
+ The X-spline segment is drawn completely, 8 Bezier segments
+ are used per X-spline segment.
+ @param job Job structure.
+ @param xs X-spline structure, control points are set up.
+ @param ib Index of point B (0 for first segment).
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_spline_segment_normal(
+ wxd2lat_job_t *job,
+ dk4_xsp_2d_t *xs,
+ uint16_t ib,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ double v0[4];
+ double v1[4];
+ double t;
+ double divisor;
+ unsigned i;
+ $? "+ wxd2lout_path_spline_segment_normal"
+ divisor = 3.0 * (double)((job->grco).xsss);
+ if (0 != dk4xsp2d_calculate_value_derivative(v0, xs, 0.0, erp)) {
+ v0[1] = v0[1] / divisor;
+ v0[3] = v0[3] / divisor;
+ if ((uint16_t)0U == ib) {
+ dk4pppt_newpath_moveto(job->ppp, v0[0], v0[2], pbb, backptr, erp);
+ }
+ for (i = 1; i <= (job->grco).xsss; i++) {
+ t = (double)i / (double)((job->grco).xsss);
+ if ((job->grco).xsss == i) { t = 1.0; }
+ if (0 != dk4xsp2d_calculate_value_derivative(v1, xs, t, erp)) {
+ v1[1] = v1[1] / divisor;
+ v1[3] = v1[3] / divisor;
+ dk4pppt_curveto(
+ job->ppp,
+ (v0[0]+v0[1]), (v0[2]+v0[3]),
+ (v1[0]-v1[1]), (v1[2]-v1[3]),
+ v1[0], v1[2],
+ pbb, backptr, erp
+ );
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ /* ERROR: X-spline calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 39
+ );
+ }
+ }
+ }
+ else {
+ if (NULL != backptr) { *backptr = 0; }
+ /* ERROR: X-spline calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 39
+ );
+ }
+ $? "- wxd2lout_path_spline_segment_normal %d", *backptr
+}
+
+
+
+/** Create spline path for closed spline or open spline without arrowheads.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_spline_no_arrows(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ dk4_xsp_2d_t xs; /* X-spline */
+ uint16_t sgn; /* Current segment to process */
+#if VERSION_BEFORE_20190110
+ uint16_t ia; /* Index of point A */
+ uint16_t id; /* Index of point D */
+#endif
+ uint16_t ib; /* Index of point B */
+ uint16_t ic; /* Index of point C */
+ $? "+ wxd2lout_path_spline_no_arrows"
+ dk4xsp2d_reset(&xs);
+ for (sgn = 0; sgn < (pobj->det).s.n - 1; sgn++) {
+ ib = sgn;
+ ic = ib + (uint16_t)1U;
+ if (
+ (1.0e-8 > fabs(((pobj->det).s.p)[ib].s))
+ && (1.0e-8 > fabs(((pobj->det).s.p)[ic].s))
+ ) {
+ if (0 == sgn) {
+ dk4pppt_newpath_moveto(
+ job->ppp,
+ ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ pbb, backptr, erp
+ );
+ }
+ dk4pppt_lineto(
+ job->ppp,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ pbb, backptr, erp
+ );
+ }
+ else {
+#if VERSION_BEFORE_20190110
+ id = ib + (uint16_t)2U;
+ ia = ib - (uint16_t)1U;
+ dk4xsp2d_reset_points(&xs);
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ ((pobj->det).s.p)[ib].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ ((pobj->det).s.p)[ic].s, 2
+ );
+ if ((uint16_t)0U != ib) {
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ }
+ else {
+ if (0 != iscl) {
+ ia = (pobj->det).s.n - (uint16_t)1U;
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ }
+ }
+ if (id < (pobj->det).s.n) {
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+ }
+ else {
+ if (0 != iscl) {
+ id = (uint16_t)0U;
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+ }
+ }
+#else
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+#endif
+ wxd2lout_path_spline_segment_normal(
+ job, &xs, sgn, backptr, pbb, erp
+ );
+ }
+ }
+ if (0 != iscl) {
+ ib = (pobj->det).s.n - (uint16_t)1U;
+ ic = (uint16_t)0U;
+ if (
+ (1.0e-8 > fabs(((pobj->det).s.p)[ib].s))
+ && (1.0e-8 > fabs(((pobj->det).s.p)[ic].s))
+ ) {
+ dk4pppt_lineto(
+ job->ppp,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ pbb, backptr, erp
+ );
+ }
+ else {
+#if VERSION_BEFORE_20190110
+ ia = (pobj->det).s.n - (uint16_t)2U;
+ id = (uint16_t)1U;
+ dk4xsp2d_reset_points(&xs);
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ ((pobj->det).s.p)[ib].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ ((pobj->det).s.p)[ic].s, 2
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+#else
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+#endif
+ wxd2lout_path_spline_segment_normal(
+ job, &xs, ib, backptr, pbb, erp
+ );
+ }
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ $? "- wxd2lout_path_spline_no_arrows %d", *backptr
+}
+
+
+
+/** Create arc path for given start and end angle.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param alpha Start angle in radians.
+ @param beta End angle in radians.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_arc_angles(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ double alpha,
+ double beta,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ double v0[4]; /* Start point of current segment */
+ double v1[4]; /* End point of current segment */
+ double angle; /* Complete arc angle */
+ double pos; /* Angle position at end of current segment */
+ double kappa; /* Kappa value */
+ double segan; /* Segment angle */
+ size_t nsegs; /* Number of segments */
+ size_t i; /* Current segment */
+ $? "+ wxd2lout_path_arc_angles"
+ if (0 != (pobj->det).a.d) {
+ /*
+ Real arc.
+ */
+ angle = beta - alpha;
+ $? ". angle = %g", angle
+ nsegs = (size_t)ceil(4.0 * fabs(angle) / M_PI);
+ if (1 > nsegs) { nsegs = 1; }
+ $? ". nsegs = %u", (unsigned)nsegs
+ segan = angle / (double)nsegs;
+ $? ". segan = %g", segan
+ kappa = dk4gratool_kappa_for_angle(fabs(segan));
+ $? ". kappa = %g", kappa
+ v0[0] = (pobj->det).a.x + (pobj->det).a.r * cos(alpha);
+ v0[1] = (pobj->det).a.y + (pobj->det).a.r * sin(alpha);
+ v0[2] = -1.0 * kappa * segan * (pobj->det).a.r * sin(alpha);
+ v0[3] = kappa * segan * (pobj->det).a.r * cos(alpha);
+ for (i = 0; i < nsegs; i++) {
+ if (0 == i) {
+ dk4pppt_newpath_moveto(
+ job->ppp, v0[0], v0[1], NULL, backptr, erp
+ );
+ }
+ if (i < (nsegs - 1)) {
+ pos = alpha
+ + ((angle * (double)(i + (size_t)1U)) / (double)nsegs);
+ }
+ else {
+ pos = beta;
+ }
+ v1[0] = (pobj->det).a.x + (pobj->det).a.r * cos(pos);
+ v1[1] = (pobj->det).a.y + (pobj->det).a.r * sin(pos);
+ v1[2] = -1.0 * kappa * segan * (pobj->det).a.r * sin(pos);
+ v1[3] = kappa * segan * (pobj->det).a.r * cos(pos);
+ dk4pppt_curveto(
+ job->ppp,
+ (v0[0] + v0[2]), (v0[1] + v0[3]),
+ (v1[0] - v1[2]), (v1[1] - v1[3]),
+ v1[0], v1[1],
+ pbb, backptr, erp
+ );
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+ if (0 != iscl) {
+ dk4pppt_lineto(
+ job->ppp, (pobj->det).a.x, (pobj->det).a.y, pbb, backptr, erp
+ );
+ v0[0] = (pobj->det).a.x + (pobj->det).a.r * cos(alpha);
+ v0[1] = (pobj->det).a.y + (pobj->det).a.r * sin(alpha);
+ dk4pppt_lineto(
+ job->ppp, v0[0], v0[1], pbb, backptr, erp
+ );
+ }
+ }
+ else {
+ /* Malformed arc, points either on one line or equal.
+ */
+ dk4pppt_newpath_moveto(
+ job->ppp,
+ wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x1)),
+ wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y1)),
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x2)),
+ wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y2)),
+ NULL, backptr, erp
+ );
+ dk4pppt_lineto(
+ job->ppp,
+ wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x3)),
+ wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y3)),
+ NULL, backptr, erp
+ );
+ if (0 != iscl) {
+ dk4pppt_lineto(
+ job->ppp,
+ wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x1)),
+ wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y1)),
+ NULL, backptr, erp
+ );
+ dk4pppt_closepath(job->ppp, backptr, erp);
+ }
+ }
+ $? "- wxd2lout_path_arc_angles %d", *backptr
+}
+
+
+
+/** Create arc path for closed arcs or open arcs without arrowheads.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_arc_no_arrows(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ $? "+ wxd2lout_path_arc_no_arrows"
+ wxd2lout_path_arc_angles(
+ drw, job, pobj, (pobj->det).a.a, (pobj->det).a.b,
+ backptr, pbb, erp, iscl
+ );
+ $? "- wxd2lout_path_arc_no_arrows %d", *backptr
+}
+
+
+
+/** Create polyline with arrowheads path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_pl_with_arrows(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ double x0; /* X coordinate first/last point */
+ double y0; /* Y coordinate first/last point */
+ double x1; /* X coordinate second/penultimate point */
+ double y1; /* Y coordinate second/penultimate point */
+ double sl; /* Segment length */
+ double cl; /* Cut length */
+ double nl; /* Non-cut length */
+ uint16_t i; /* Current inner point */
+ $? "+ wxd2lout_path_pl_with_arrows"
+ /*
+ Move to first point
+ */
+ x0 = ((pobj->det).p.p)[0].x;
+ y0 = ((pobj->det).p.p)[0].y;
+ $? ". x0=%g y0=%g", x0, y0
+ if (0 != (pobj->ab).type) {
+ x1 = ((pobj->det).p.p)[1].x;
+ y1 = ((pobj->det).p.p)[1].y;
+ sl = sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));
+ cl = (pobj->ab).cut;
+ nl = sl - cl;
+ x0 = ((x0 * nl) + (x1 * cl)) / sl;
+ y0 = ((y0 * nl) + (y1 * cl)) / sl;
+ }
+ $? ". x0=%g y0=%g", x0, y0
+ dk4pppt_newpath_moveto(job->ppp, x0, y0, pbb, backptr, erp);
+ /*
+ Lines to inner points
+ */
+ if ((uint16_t)2U < (pobj->det).p.n) {
+ for (i = (uint16_t)1U; i < ((pobj->det).p.n) - (uint16_t)1U; i++) {
+ $? ". x=%g y=%g", ((pobj->det).p.p)[i].x, ((pobj->det).p.p)[i].y
+ dk4pppt_lineto(
+ job->ppp, ((pobj->det).p.p)[i].x, ((pobj->det).p.p)[i].y,
+ pbb, backptr, erp
+ );
+ }
+ }
+ /* Line to last point
+ */
+ x0 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)1U].x;
+ y0 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)1U].y;
+ $? ". x0=%g y0=%g", x0, y0
+ if (0 != (pobj->af).type) {
+ x1 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)2U].x;
+ y1 = ((pobj->det).p.p)[(pobj->det).p.n - (uint16_t)2U].y;
+ sl = sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0));
+ cl = (pobj->af).cut;
+ nl = sl - cl;
+ x0 = (x0 * nl + x1 * cl) / sl;
+ y0 = (y0 * nl + y1 * cl) / sl;
+ }
+ $? ". x0=%g y0=%g", x0, y0
+ dk4pppt_lineto(job->ppp, x0, y0, pbb, backptr, erp);
+ $? "- wxd2lout_path_pl_with_arrows %d", *backptr
+}
+
+
+
+/** Create spline path for open spline with arrowheads.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param ts Start parameter t.
+ @param te End parameter t.
+ @param npmoveto Flag: Start new path and move to first point.
+ @param fullseg Flag: This is a full segment.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_spline_seg(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ double ts,
+ double te,
+ int npmoveto,
+ int fullseg,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ double v0[4]; /* Start of segment */
+ double v1[4]; /* End of segment */
+ dk4_xsp_2d_t xs; /* X-spline structure */
+ double diff; /* Parameter t difference start to end */
+ double coeff; /* Coefficient for derivatives */
+ double t; /* Current parameter t in range 0 to 1 */
+ unsigned nsubs; /* Number of sub segments */
+ unsigned i; /* Current sub segment */
+ int res; /* Step calculation result */
+ uint16_t ib; /* X-spline segment index */
+ $? "+ wxd2lout_spline_seg ts=%g te=%g mv=%d full=%d",ts,te,npmoveto,fullseg
+ ib = (uint16_t)floor(ts);
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+ diff = te - ts;
+ nsubs = (job->grco).xsss;
+ if (0 != fullseg) {
+ nsubs = (unsigned)ceil(fabs(diff * (double)nsubs));
+ if (0U == nsubs) { nsubs = 1U; }
+ }
+ coeff = diff / (3.0 * (double)nsubs);
+ t = ts - (double)ib;
+ res = dk4xsp2d_calculate_value_derivative(v0, &xs, t, erp);
+ if (0 != res) {
+ v0[1] *= coeff; v0[3] *= coeff;
+ for (i = 0U; i < nsubs; i++) {
+ if ((nsubs - 1U) == i) {
+ t = te;
+ }
+ else {
+ t = ts + ((diff * (double)(i + 1U)) / (double)nsubs);
+ }
+ t = t - (double)ib;
+ res = dk4xsp2d_calculate_value_derivative(v1, &xs, t, erp);
+ if (0 != res) {
+ v1[1] *= coeff; v1[3] *= coeff;
+ if ((0U == i) && (0 != npmoveto)) {
+ dk4pppt_newpath_moveto(
+ job->ppp, v0[0], v0[2], pbb, backptr, erp
+ );
+ }
+ dk4pppt_curveto(
+ job->ppp, (v0[0]+v0[1]), (v0[2]+v0[3]), (v1[0]-v1[1]),
+ (v1[2]-v1[3]), v1[0], v1[2], pbb, backptr, erp
+ );
+ }
+ else { $? "! calculation"
+ *backptr = 0;
+ /* ERROR: Calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 39
+ );
+ }
+ DK4_MEMCPY(v0,v1,sizeof(v0));
+ }
+ }
+ else { $? "! calculation"
+ *backptr = 0;
+ /* ERROR: Calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 39
+ );
+ }
+ $? "- wxd2lout_spline_seg"
+}
+
+
+/** Create spline path for open spline with arrowheads.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_spline_with_arrows(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ uint16_t ss;
+ uint16_t se;
+ uint16_t i;
+ $? "+ wxd2lout_path_spline_with_arrows"
+ ss = (uint16_t)floor((pobj->det).s.ts);
+ se = (uint16_t)floor((pobj->det).s.te);
+ if (0 != (pobj->ab).type) {
+ if (0 != (pobj->af).type) {
+ if (se > ss) {
+ wxd2lout_spline_seg(
+ job, pobj, (pobj->det).s.ts, (double)(ss + 1), 1, 0,
+ backptr, pbb, erp
+ );
+ for (i = ss + 1; i < se; i++) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)i, (double)(i + 1), 0, 1,
+ backptr, pbb, erp
+ );
+ }
+ if ((pobj->det).s.te > floor((pobj->det).s.te)) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)se, (pobj->det).s.te, 0, 0,
+ backptr, pbb, erp
+ );
+ }
+ }
+ else {
+ wxd2lout_spline_seg(
+ job, pobj, (pobj->det).s.ts, (pobj->det).s.te, 1, 0,
+ backptr, pbb, erp
+ );
+ }
+ }
+ else {
+ wxd2lout_spline_seg(
+ job, pobj, (pobj->det).s.ts, (double)(ss + 1), 1, 0,
+ backptr, pbb, erp
+ );
+ for (i = ss + 1; i < (pobj->det).s.n - 1; i++) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)i, (double)(i + 1), 0, 1,
+ backptr, pbb, erp
+ );
+ }
+ }
+ }
+ else {
+ if (0 != (pobj->af).type) {
+ for (i = 0; i < se; i++) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)i, (double)(i + 1),
+ ((0 == i) ? 1 : 0), 1, backptr, pbb, erp
+ );
+ }
+ if ((pobj->det).s.te > floor((pobj->det).s.te)) {
+ wxd2lout_spline_seg(
+ job, pobj, (double)se, (pobj->det).s.te, 0, 0,
+ backptr, pbb, erp
+ );
+ }
+ }
+ else {
+ wxd2lout_path_spline_no_arrows(job, pobj, backptr, pbb, erp, 0);
+ }
+ }
+ $? "- wxd2lout_path_spline_with_arrows %d", *backptr
+}
+
+
+
+/** Create arc path for open arcs with at least one arrowhead.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_arc_with_arrows(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ double alpha; /* Start angle */
+ double beta; /* End angle */
+ double x1; /* X coordinate point 1 */
+ double y1; /* Y coordinate point 1 */
+ double x2; /* X coordinate point 2 */
+ double y2; /* Y coordinate point 2 */
+ double x3; /* X coordinate point 3 */
+ double y3; /* Y coordinate point 3 */
+ double sl; /* Segment length */
+ double cl; /* Cut length */
+ double nl; /* Non-cut length */
+ $? "+ wxd2lout_path_arc_with_arrows"
+ if (0 != (pobj->det).a.d) {
+ alpha = (pobj->det).a.a;
+ beta = (pobj->det).a.b;
+ $? ". alpha = %g", alpha
+ $? ". beta = %g", beta
+ if (0 < (pobj->det).a.d) { $? ". positive"
+ if (0 != (pobj->ab).type) {
+ $? ". ab.cut = %g", (pobj->ab).cut
+ alpha += (pobj->ab).cut / (pobj->det).a.r;
+ $? ". alpha = %g", alpha
+ }
+ if (0 != (pobj->af).type) {
+ $? ". af.cut = %g", (pobj->af).cut
+ beta -= (pobj->af).cut / (pobj->det).a.r;
+ $? ". beta = %g", beta
+ }
+ }
+ else { $? ". negative"
+ if (0 != (pobj->ab).type) {
+ $? ". ab.cut = %g", (pobj->ab).cut
+ alpha -= (pobj->ab).cut / (pobj->det).a.r;
+ $? ". alpha = %g", alpha
+ }
+ if (0 != (pobj->af).type) {
+ $? ". af.cut = %g", (pobj->af).cut
+ beta += (pobj->af).cut / (pobj->det).a.r;
+ $? ". beta = %g", beta
+ }
+ }
+ wxd2lout_path_arc_angles(
+ drw, job, pobj, alpha, beta, backptr, pbb, erp, iscl
+ );
+ }
+ else {
+ /* Malformed arc as polygon, cut ends for arrows.
+ */
+ x1 = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x1));
+ x2 = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x2));
+ x3 = wxd2lout_convert_x(drw, job, (double)((pobj->det).a.x3));
+ y1 = wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y1));
+ y2 = wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y2));
+ y3 = wxd2lout_convert_y(drw, job, (double)((pobj->det).a.y3));
+ if (0 != (pobj->ab).type) {
+ sl = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
+ cl = (pobj->ab).cut;
+ nl = sl - cl;
+ x1 = (x1 * nl + x2 * cl) / sl;
+ y1 = (y1 * nl + y2 * cl) / sl;
+ }
+ dk4pppt_newpath_moveto(job->ppp, x1, y1, pbb, backptr, erp);
+ dk4pppt_lineto(job->ppp, x2, y2, pbb, backptr, erp);
+ if (0 != (pobj->af).type) {
+ sl = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
+ cl = (pobj->af).cut;
+ nl = sl - cl;
+ x3 = (x3 * nl + x2 * cl) / sl;
+ y3 = (y3 * nl + y2 * cl) / sl;
+ }
+ dk4pppt_lineto(job->ppp, x3, y3, pbb, backptr, erp);
+ }
+ $? "- wxd2lout_path_arc_with_arrows %d", *backptr
+}
+
+
+
+/** Create polyline or polygon path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_polyline(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ $? "+ wxd2lout_path_polyline"
+ if (
+ (0 != iscl)
+ || (((uint8_t)0U == pobj->af.type) && ((uint8_t)0U == pobj->ab.type))
+ ) {
+ /* Closed polygon or polyline without arrows.
+ */
+ wxd2lout_path_pl_no_arrows(job, pobj, backptr, pbb, erp, iscl);
+ }
+ else {
+ /* Polyline with at least one arrow.
+ */
+ wxd2lout_path_pl_with_arrows(job, pobj, backptr, pbb, erp);
+ }
+ $? "- wxd2lout_path_polyline %d", *backptr
+}
+
+
+
+/** Create spline path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_spline(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ $? "+ wxd2lout_path_spline"
+ if (
+ (0 != iscl)
+ || (((uint8_t)0U == pobj->af.type) && ((uint8_t)0U == pobj->ab.type))
+ ) {
+ /* Closed spline or open spline without arrowheads.
+ */
+ wxd2lout_path_spline_no_arrows(job, pobj, backptr, pbb, erp, iscl);
+ }
+ else {
+ /* Open spline with at least one arrowhead.
+ */
+ wxd2lout_path_spline_with_arrows(job, pobj, backptr, pbb, erp);
+ }
+ $? "- wxd2lout_path_spline %d", *backptr
+}
+
+
+
+/** Create arc path.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+ @param iscl Flag: Closed path.
+*/
+static
+void
+wxd2lout_path_arc(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp,
+ int iscl
+)
+{
+ $? "+ wxd2lout_path_arc"
+ if (
+ (0 != iscl)
+ || (((uint8_t)0U == pobj->af.type) && ((uint8_t)0U == pobj->ab.type))
+ ) {
+ /* Closed arc or open arc without arrowheads.
+ */
+ wxd2lout_path_arc_no_arrows(drw,job,pobj,backptr,pbb,erp,iscl);
+ }
+ else {
+ /* Open arc with at least one arrowhead.
+ */
+ wxd2lout_path_arc_with_arrows(drw,job,pobj,backptr,pbb,erp,iscl);
+ }
+ $? "- wxd2lout_path_arc %d", *backptr
+}
+
+
+
+/** Create circle path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_circle(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_path_circle"
+ $? ". x = %g", (pobj->det).e.x
+ $? ". y = %g", (pobj->det).e.y
+ $? ". r = %g", (pobj->det).e.rx
+ dk4pppt_circle(
+ job->ppp,
+ (pobj->det).e.x, (pobj->det).e.y, (pobj->det).e.rx,
+ pbb, backptr, erp
+ );
+ $? "- wxd2lout_path_circle"
+}
+
+
+
+/** Create ellipse path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_ellipse(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_path_ellipse"
+ dk4pppt_ellipse(
+ job->ppp,
+ (pobj->det).e.x, (pobj->det).e.y, (pobj->det).e.rx, (pobj->det).e.ry,
+ (pobj->det).e.a, pbb, backptr, erp
+ );
+ $? "- wxd2lout_path_ellipse"
+}
+
+
+
+/** Create box path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_box(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_path_box"
+ dk4pppt_rectangle(
+ job->ppp,
+ (pobj->det).b.xl, (pobj->det).b.xr,
+ (pobj->det).b.yb, (pobj->det).b.yt,
+ ((0.0 < (pobj->det).b.r) ? ((pobj->det).b.r) : (-1.0)),
+ pbb, backptr, erp
+ );
+ $? "- wxd2lout_path_box"
+}
+
+
+
+/** Create dot path.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_path_dot(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_path_dot"
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y, ((pobj->det).d.d / 2.0),
+ pbb, backptr, erp
+ );
+ $? "- wxd2lout_path_dot"
+}
+
+
+
+
+/** Create object path.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to create path for.
+ @param backptr Address of success variable to reset on error.
+ @param pbb Bounding box for path, may be NULL.
+ @param erp Error report, may be NULL.
+*/
+static
+void
+wxd2lout_object_path(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr,
+ dk4_bb_t *pbb,
+ dk4_er_t *erp
+)
+{
+ $? "+ wxd2lout_object_path"
+ switch (pobj->ot) {
+ case WXD_OT_POLYLINE : {
+ wxd2lout_path_polyline(job, pobj, backptr, pbb, erp, 0);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ wxd2lout_path_spline(job, pobj, backptr, pbb, erp, 0);
+ } break;
+ case WXD_OT_O_ARC : {
+ wxd2lout_path_arc(drw, job, pobj, backptr, pbb, erp, 0);
+ } break;
+ case WXD_OT_POLYGON : {
+ wxd2lout_path_polyline(job, pobj, backptr, pbb, erp, 1);
+ } break;
+ case WXD_OT_C_SPLINE : {
+ wxd2lout_path_spline(job, pobj, backptr, pbb, erp, 1);
+ } break;
+ case WXD_OT_C_ARC : {
+ wxd2lout_path_arc(drw, job, pobj, backptr, pbb, erp, 1);
+ } break;
+ case WXD_OT_CIRCLE : {
+ wxd2lout_path_circle(job, pobj, backptr, pbb, erp);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ wxd2lout_path_ellipse(job, pobj, backptr, pbb, erp);
+ } break;
+ case WXD_OT_BOX : {
+ wxd2lout_path_box(job, pobj, backptr, pbb, erp);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ wxd2lout_path_dot(job, pobj, backptr, pbb, erp);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ wxd2lout_path_dot(job, pobj, backptr, pbb, erp);
+ } break;
+ }
+ $? "- wxd2lout_object_path"
+}
+
+
+
+static
+dk4_text_align_h_t
+wxd2lout_h_text_align(uint8_t a)
+{
+ dk4_text_align_h_t back = DK4_TEXT_ALIGN_H_LEFT;
+ switch ((int)a) {
+ case 1: {
+ back = DK4_TEXT_ALIGN_H_CENTERED;
+ } break;
+ case 2: {
+ back = DK4_TEXT_ALIGN_H_RIGHT;
+ } break;
+ }
+ return back;
+}
+
+
+
+/** Create output for one text object.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_text_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dkChar buf[2048];
+ dk4_er_t er;
+ int back = 1;
+ int res;
+ dk4_gra_tf_t fonttype = DK4_GRA_TF_SIMILAR_SIZE;
+ $? "+ wxd2lout_text_object"
+ if (DK4_GRA_PURPOSE_DOCUMENT == (job->grco).purpose) {
+ fonttype = DK4_GRA_TF_EXACT_SIZE;
+ }
+ dk4error_init(&er);
+ res = dk4recode_c8_to_dk(
+ buf, DK4_SIZEOF(buf,dkChar), dk4app_get_encoding(job->app),
+ (pobj->det).t.t, DK4_ENCODING_UTF8, &er
+ );
+ if (0 != res) {
+ wxd2lout_fill_rgb(job, pobj, &back, &er);
+ if (0 != back) {
+ if (0x00 != (0x01 & ((pobj->det).t.fl))) { $? ". special"
+ /*
+ Special text
+ */
+ fonttype = DK4_GRA_TF_NONE_NONE;
+ dk4pppt_special_text(
+ job->ppp, (pobj->det).t.x, (pobj->det).t.y, (pobj->det).t.a,
+ (pobj->det).t.t, NULL,
+ wxd2lout_h_text_align((pobj->det).t.al),
+ DK4_TEXT_ALIGN_V_BASELINE, (int)((pobj->det).t.find),
+ (double)((pobj->det).t.fsz), fonttype, 0, &back, &er
+ );
+ }
+ else { $? ". normal"
+ /* Normal text
+ */
+ dk4pppt_simple_utf8_text(
+ job->ppp, (pobj->det).t.x, (pobj->det).t.y, (pobj->det).t.a,
+ (pobj->det).t.t, NULL,
+ wxd2lout_h_text_align((pobj->det).t.al),
+ DK4_TEXT_ALIGN_V_BASELINE,
+ (int)((pobj->det).t.find), (double)((pobj->det).t.fsz),
+ fonttype, job->uc2l, 0, &back, &er
+ );
+ }
+ if (0 == back) { $? "! issue text"
+ /* ERROR: Failed to write text */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 40
+ );
+ }
+ }
+ else { $? "! set fill colour"
+ /* ERROR: Failed to set fill colour */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 41
+ );
+ }
+ }
+ else { $? "! decoding UTF-8"
+ back = 0;
+ /* ERROR: UTF-8 decoding failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 42
+ );
+ }
+ $? "- wxd2lout_text_object %d", back
+ return back;
+}
+
+
+
+/** Create output for one open path object probably with arrowheads attached.
+ @param drw Original drawing.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_open_path_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ int myback;
+ int back = 1;
+ $? "+ wxd2lout_open_path_object"
+ dk4error_init(&er);
+ if (0.0 < pobj->lw) {
+ wxd2lout_attributes_stroke(drw, job, pobj, &back, 1, &er);
+ $? ". back = %d", back
+ dk4pppt_prepare_stroke(job->ppp, &back, &er);
+ $? ". back = %d", back
+ wxd2lout_object_path(drw, job, pobj, &back, NULL, &er);
+ $? ". back = %d", back
+ dk4pppt_stroke(job->ppp, &back, &er);
+ $? ". back = %d", back
+ if (0 == back) {
+ /* ERROR: Failed to create graphics object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 43
+ );
+ }
+ if ((uint8_t)0U != (pobj->af).type) {
+ myback = 1;
+ wxd2lah_arrowhead(&(pobj->af), drw, job, pobj, 0, &myback, &er);
+ if (0 == myback) {
+ back = 0;
+ /* ERROR: Failed to create forward arrowhead */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 44
+ );
+ }
+ $? ". back = %d", back
+ }
+ if ((uint8_t)0U != (pobj->ab).type) {
+ myback = 1;
+ wxd2lah_arrowhead(&(pobj->ab), drw, job, pobj, 1, &myback, &er);
+ if (0 == myback) {
+ back = 0;
+ /* ERROR: Failed to create backward arrowhead */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 45
+ );
+ }
+ $? ". back = %d", back
+ }
+ }
+ else { $? ". skipped"
+ /* Object skipped */
+ /* INFO: Skipping object due to non-positive line-width */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_INFO, 46
+ );
+ }
+ $? "- wxd2lout_open_path_object %d", back
+ return back;
+}
+
+
+
+/** Create output for one closed path object, probably filled or pattern filled.
+ @param drw Original drawing.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_closed_path_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_bb_t pbb;
+ dk4_er_t er;
+ int back = 1;
+ int must_stroke = 0;
+ int must_fill = 0;
+ int must_pattern = 0;
+ int combined = 0;
+ $? "+ wxd2lout_closed_path_object"
+ dk4bb_init(&pbb);
+ dk4error_init(&er);
+ if (0.0 < pobj->lw) {
+ must_stroke = 1;
+ }
+ if ((uint8_t)(WXD_FS_NONE) != pobj->csfs) {
+ must_fill = 1;
+ }
+ if ((uint8_t)(WXD_FS_PURE) < pobj->csfs) {
+ must_pattern = 1;
+ }
+ if ((0 != must_stroke) && (0 != must_fill)) {
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) {
+ combined = 1;
+ }
+ }
+ if (0 != combined) { $? ". combined"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+ $? ". back = %d", back
+ wxd2lout_attributes_stroke(drw, job, pobj, &back, 0, &er);
+ $? ". back = %d", back
+ dk4pppt_prepare_fill_and_stroke(job->ppp, &back, &er);
+ $? ". back = %d", back
+ wxd2lout_object_path(drw, job, pobj, &back, NULL, &er);
+ $? ". back = %d", back
+ dk4pppt_fill_and_stroke(job->ppp, &back, &er);
+ $? ". back = %d", back
+ if (0 != must_pattern) {
+ dk4pppt_gsave(job->ppp, &back, &er);
+ $? ". back = %d", back
+ wxd2lout_object_path(drw, job, pobj, &back, &pbb, &er);
+ $? ". back = %d", back
+ dk4pppt_clip(job->ppp, &back, &er);
+ $? ". back = %d", back
+ dk4pppt_pattern(
+ job->ppp, pbb.xmin, pbb.xmax, pbb.ymin, pbb.ymax,
+ wxd2lout_find_pattern(pobj), &back, &er
+ );
+ $? ". back = %d", back
+ dk4pppt_grestore(job->ppp, &back, &er);
+ $? ". back = %d", back
+ }
+ }
+ else { $? ". not combined"
+ if (0 != must_fill) { $? ". must fill"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+ $? ". back = %d", back
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ $? ". back = %d", back
+ wxd2lout_object_path(drw, job, pobj, &back, NULL, &er);
+ $? ". back = %d", back
+ dk4pppt_fill(job->ppp, &back, &er);
+ $? ". back = %d", back
+ }
+ if (0 != must_pattern) { $? ". must pattern"
+ dk4pppt_gsave(job->ppp, &back, &er);
+ $? ". back = %d", back
+ wxd2lout_object_path(drw, job, pobj, &back, &pbb, &er);
+ $? ". back = %d", back
+ dk4pppt_clip(job->ppp, &back, &er);
+ $? ". back = %d", back
+ dk4pppt_pattern(
+ job->ppp, pbb.xmin, pbb.xmax, pbb.ymin, pbb.ymax,
+ wxd2lout_find_pattern(pobj), &back, &er
+ );
+ $? ". back = %d", back
+ dk4pppt_grestore(job->ppp, &back, &er);
+ $? ". back = %d", back
+ }
+ if (0 != must_stroke) { $? ". must stroke"
+ wxd2lout_attributes_stroke(drw, job, pobj, &back, 0, &er);
+ $? ". back = %d", back
+ dk4pppt_prepare_stroke(job->ppp, &back, &er);
+ $? ". back = %d", back
+ wxd2lout_object_path(drw, job, pobj, &back, NULL, &er);
+ $? ". back = %d", back
+ dk4pppt_stroke(job->ppp, &back, &er);
+ $? ". back = %d", back
+ }
+ }
+ if (0 == back) {
+ /* ERROR: Failed to create graphics object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 43
+ );
+ }
+ $? "- wxd2lout_closed_path_object %d", back
+ return back;
+}
+
+
+
+/** Create output for one dot object.
+ @param drw Original drawing.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_dot_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ double lw;
+ int back = 1;
+ $? "+ wxd2lout_dot_object"
+ dk4error_init(&er);
+ $? ". dot diameter = %g", (pobj->det).d.d
+ switch (pobj->ot) {
+ case WXD_OT_DOT_FILLED : { $? ". colour filled dot"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+ if (1 == back) {
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ if (1 == back) {
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((pobj->det).d.d / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+ if (0 == back) { $? "! filled circle"
+ /* ERROR: Failed to create filled circle */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 47
+ );
+ }
+ }
+ else { $? "! fill attributes"
+ /* ERROR: Failed to set up filling */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 48
+ );
+ }
+ }
+ else { $? "! fill attributes"
+ /* ERROR: Failed to set up filling */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 48
+ );
+ }
+ } break;
+ case WXD_OT_DOT_WHITE : { $? ". white filled dot"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ if (lw >= (pobj->det).d.d) {
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ &back, &er
+ );
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((lw + (pobj->det).d.d) / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+ }
+ else {
+ if (0 != dk4pppt_can_fill_and_stroke(job->ppp)) { $? ". comb"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+ wxd2lout_attributes_stroke(drw, job, pobj, &back, 0, &er);
+ dk4pppt_prepare_fill_and_stroke(job->ppp, &back, &er);
+ if (1 == back) {
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((pobj->det).d.d / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill_and_stroke(job->ppp, &back, &er);
+ if (0 == back) { $? "! fill+stroke operation"
+ /* ERROR: Failed to create filled circle */
+ dk4app_log_1(
+ job->app,job->msg,job->sz_msg,DK4_LL_ERROR,47
+ );
+ }
+
+ }
+ else { $? "! fill+stroke attributes"
+ /* ERROR: Failed to set up fill and stroke */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 49
+ );
+ }
+ }
+ else { $? ". separated operations"
+ wxd2lout_attributes_fill(job, pobj, &back, &er);
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ if (0 != back) {
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((pobj->det).d.d / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+ if (0 != back) {
+ wxd2lout_attributes_stroke(
+ drw, job, pobj, &back, 0, &er
+ );
+ dk4pppt_prepare_stroke(job->ppp, &back, &er);
+ if (0 != back) {
+ dk4pppt_circle(
+ job->ppp, (pobj->det).d.x, (pobj->det).d.y,
+ ((pobj->det).d.d / 2.0), NULL, &back, &er
+ );
+ dk4pppt_stroke(job->ppp, &back, &er);
+ if (0 == back) { $? "! stroke operation"
+ /* ERROR: Failed to stroke circle */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 36
+ );
+
+ }
+ }
+ else { $? "! stroke attributes"
+ /* ERROR: Failed to set up stroke */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 51
+ );
+ }
+ }
+ else { $? "! fill operation"
+ /* Failed to create filled circle */
+ dk4app_log_1(
+ job->app,job->msg,job->sz_msg,DK4_LL_ERROR,47
+ );
+ }
+ }
+ else { $? "! fill attributes"
+ /* ERROR: Failed to set up fill */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 48
+ );
+ }
+ }
+ }
+ } break;
+ }
+ $? "- wxd2lout_dot_object %d", back
+ return back;
+}
+
+
+
+/** Create output for one image object.
+ @param job Job structure containing the output structure.
+ @param pobj Object to process.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_image_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dkChar fnb[DK4_MAX_PATH]; /* File name buffer */
+ dk4_px_t bg[4]; /* Background colour */
+ dk4_cs_conv_ctx_t ctx; /* RGB to gray conv context */
+ dk4_er_t er; /* Error report */
+ dk4_bif_t *pbif = NULL; /* Bitmap image */
+ int back = 1; /* Function result */
+ int ifl = 0; /* Image flags */
+ int fbg = 0; /* Flag: Force background */
+ int res = 0; /* Step result */
+ $? "+ wxd2lout_image_object"
+ DK4_MEMCPY(&ctx,&((job->grco).ctx),sizeof(dk4_cs_conv_ctx_t));
+ bg[0] = (dk4_px_t)(pobj->fc[0]);
+ bg[1] = (dk4_px_t)(pobj->fc[1]);
+ bg[2] = (dk4_px_t)(pobj->fc[2]);
+ if (DK4_CS_CONV_RGB_TO_GRAY_MIN <= (pobj->det).i.r2g) {
+ if (DK4_CS_CONV_RGB_TO_GRAY_MAX >= (pobj->det).i.r2g) {
+ ctx.rgb_to_gray = (dk4_cs_conv_rgb_to_gray_t)((pobj->det).i.r2g);
+ }
+ }
+ if (0x00 != (0x20 & ((pobj->det).i.fl))) {
+ fbg = 1;
+ }
+ if (0x00 != (0x02 & ((pobj->det).i.fl))) {
+ /* Alpha mix */
+ ctx.alpha = DK4_CS_CONV_ALPHA_MIX;
+ }
+ else {
+ /* Alpha ignore */
+ ctx.alpha = DK4_CS_CONV_ALPHA_FOREGROUND;
+ }
+ if (0 != (job->grco).color) {
+ ifl |= DK4_GRA_IMG_FLAG_COLOR;
+ }
+ if (0 != (job->grco).ps_lzw) {
+ ifl |= DK4_GRA_IMG_FLAG_LZW;
+ }
+ if (0x00 != (0x08 & ((pobj->det).i.fl))) {
+ ifl |= DK4_GRA_IMG_FLAG_DCT;
+ }
+ if (0x00 != (0x04 & ((pobj->det).i.fl))) {
+ ifl |= DK4_GRA_IMG_FLAG_INTERPOLATION;
+ }
+ if (0x00 != (0x10 & ((pobj->det).i.fl))) {
+ ifl |= DK4_GRA_IMG_FLAG_DCT_INTERPOLATION;
+ }
+ ifl |= DK4_GRA_IMG_FLAG_ANALYZE_BPC;
+ ifl |= DK4_GRA_IMG_FLAG_ANALYZE_COLOR;
+ ifl |= DK4_GRA_IMG_FLAG_ANALYZE_ALPHA;
+ if (0x00 == (0x01 & ((pobj->det).i.fl))) {
+ ifl |= DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO;
+ }
+ res = dk4recode_c8_to_dk(
+ fnb, DK4_SIZEOF(fnb,dkChar), dk4app_get_encoding(job->app),
+ (pobj->det).i.fn, DK4_ENCODING_UTF8, &er
+ );
+ if (0 != res) {
+ if (0 <= dk4bif_type_for_suffix(fnb)) {
+ pbif = dk4bif_open_app(fnb, 0, &ctx, job->app);
+ if (NULL != pbif) {
+ dk4error_init(&er);
+ dk4bif_set_background(pbif, bg, 3, 8, fbg);
+ dk4pppt_bif_image(
+ job->ppp, (pobj->det).i.x,
+ ((pobj->det).i.x + (pobj->det).i.w),
+ (pobj->det).i.y,
+ ((pobj->det).i.y + (pobj->det).i.h), pbif, fnb,
+ (size_t)0U, ifl, NULL, &back, &er
+ );
+ dk4bif_close(pbif);
+ if (0 == back) { $? "! add image"
+ /* ERROR: Failed to add bitmap image */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 52
+ );
+ }
+ }
+ else { $? "! bif open \"%!ds\"", fnb
+ back = 0;
+ /* ERROR: Failed to open file */
+ }
+ }
+ else { $? "! not a bif image"
+ back = 0;
+ /* ERROR: Not a supported bitmap type */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 53
+ );
+ }
+ }
+ else { $? "! decode UTF-8"
+ back = 0;
+ /* ERROR: Failed to decode file name! */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 54
+ );
+ }
+ $? "- wxd2lout_image_object %d", back
+ return back;
+}
+
+
+
+/** Check one text object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_text_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+ $? "+ wxd2lout_check_one_text_object"
+ if (NULL != (pobj->det).t.t) {
+ if ((uint16_t)0U != (pobj->det).t.fsz) {
+ back = 1;
+ }
+ else {
+ if ((uint8_t)0x00 != ((uint8_t)0x01 & (pobj->det).t.fl)) {
+ back = 1;
+ }
+ else { $? "! font size 0"
+ /* ERROR: Font size 0 */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 55
+ );
+ }
+ }
+ }
+ else { $? "! no text"
+ /* ERROR: No text on object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 56
+ );
+ }
+ $? "- wxd2lout_check_one_text_object %d", back
+ return back;
+}
+
+
+
+/** Check one polyline/polygon object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_polyline_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double x0; /* Coordinate of first point */
+ double y0; /* Coordinate of first point */
+ double x1; /* Coordinate of second point */
+ double y1; /* Coordinate of second point */
+ double lseg; /* Segment length */
+ size_t lp; /* Index of last point */
+ int back = 0;
+ $? "+ wxd2lout_check_one_polyline_object"
+ if (NULL != (pobj->det).p.p) {
+ if ((uint16_t)1U < (pobj->det).p.n) {
+ back = 1;
+ /*
+ For polyline check whether first and last segment
+ are long enough for arrowhead cuts.
+ */
+ if (WXD_OT_POLYLINE == pobj->ot) {
+ lseg = 0.0;
+ if (0 != (pobj->ab).type) {
+ x0 = ((pobj->det).p.p)[0].x;
+ x1 = ((pobj->det).p.p)[1].x;
+ y0 = ((pobj->det).p.p)[0].y;
+ y1 = ((pobj->det).p.p)[1].y;
+ x1 = x1 - x0;
+ y1 = y1 - y0;
+ lseg = sqrt(x1 * x1 + y1 * y1);
+ if (lseg <= (pobj->ab).cut) {
+ back = 0; $? "! first segment too short"
+ /* ERROR: First segment too short */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 57
+ );
+ }
+ }
+ if (0 != (pobj->af).type) {
+ lp = (pobj->det).p.n - 1;
+ x0 = ((pobj->det).p.p)[lp].x;
+ x1 = ((pobj->det).p.p)[lp - 1].x;
+ y0 = ((pobj->det).p.p)[lp].y;
+ y1 = ((pobj->det).p.p)[lp - 1].y;
+ x1 = x1 - x0;
+ y1 = y1 - y0;
+ /*
+ Just one segment or multiple segments?
+ */
+ if ((uint16_t)2U == (pobj->det).p.n) {
+ /*
+ If the polyline has just one segment (only
+ 2 points) the cuts for forward and backward
+ arrow are both applied to the same segment.
+ So the segment must be longer than the summary
+ of the two cuts.
+ */
+ lseg += sqrt(x1 * x1 + y1 * y1);
+ }
+ else {
+ /* Polyline has more than one segments, the
+ final segment is cutted for the forward
+ arrowhead only.
+ */
+ lseg = sqrt(x1 * x1 + y1 * y1);
+ }
+ if (lseg <= (pobj->af).cut) {
+ back = 0; $? "! final segment too short"
+ /* ERROR: Last segment too short */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 58
+ );
+ }
+ }
+ }
+ }
+ else { $? "! too few points"
+ /* ERROR: Too few points */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ }
+ else { $? "! no points"
+ /* ERROR: No points for object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 60
+ );
+ }
+ $? "- wxd2lout_check_one_polyline_object %d", back
+ return back;
+}
+
+
+/** Check one spline object if information is complete and object
+ can be drawn.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_spline_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double cutl; /* Length to cut, length of arrowhead */
+ int back = 0;
+ $? "+ wxd2lout_check_one_spline_object"
+ if (NULL != (pobj->det).s.p) {
+ if ((uint16_t)1U < (pobj->det).s.n) {
+ back = 1;
+ /*
+ For open spline object check whether spline
+ is long enough for arrowhead cuts.
+ */
+ if (WXD_OT_O_SPLINE == pobj->ot) {
+ if (
+ (0 != (pobj->af).type)
+ || (0 != (pobj->ab).type)
+ ) {
+ cutl = 0.0;
+ if (0 != (pobj->af).type) {
+ cutl += ((pobj->af).cut + (pobj->af).cuttol);
+ }
+ if (0 != (pobj->ab).type) {
+ cutl += ((pobj->ab).cut + (pobj->ab).cuttol);
+ }
+ if (cutl >= (pobj->det).s.suml) {
+ back = 0; $? "! spline too short"
+ /* ERROR: Spline too short */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 61
+ );
+ }
+ if (0 != (pobj->af).type) {
+ cutl = (pobj->af).offset
+ + (double)((pobj->af).length)
+ * wxd2lat_object_linewidth(pobj, drw, job);
+ if (cutl >= (pobj->det).s.suml) {
+ back = 0; $? "! forward arrow too long"
+ /* ERROR: Forward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 62
+ );
+ }
+ }
+ if (0 != (pobj->ab).type) {
+ cutl = (pobj->ab).offset
+ + (double)((pobj->ab).length)
+ * wxd2lat_object_linewidth(pobj, drw, job);
+ if (cutl >= (pobj->det).s.suml) {
+ back = 0; $? "! backward arrow too long"
+ /* ERROR: Backward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 63
+ );
+ }
+ }
+ }
+ }
+ }
+ else { $? "! too few points"
+ /* ERROR: Too few points */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ }
+ else { $? "! no points"
+ /* ERROR: No points for object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 60
+ );
+ }
+ $? "- wxd2lout_check_one_spline_object %d", back
+ return back;
+}
+
+
+
+/** Check one arc object if information is complete and object
+ can be drawn.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_arc_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+
+ double x0; /* Coordinate of first point */
+ double y0; /* Coordinate of first point */
+ double x1; /* Coordinate of second point */
+ double y1; /* Coordinate of second point */
+ double cutl; /* Length to cut, length of arrowhead */
+ double lseg; /* Segment length */
+ int back = 0;
+ $? "+ wxd2lout_check_one_arc_object"
+ /*
+ For open arc object check whether arc is long enough
+ for arrowhead cuts.
+ For malformed arc check whether segments are long enough
+ for the arrowhead cuts.
+ */
+ back = 1;
+ if (WXD_OT_O_ARC == pobj->ot) {
+ if ((0 != (pobj->af).type) || (0 != (pobj->ab).type)) {
+ if (0 != (pobj->det).a.d) {
+ /*
+ Real arc
+ */
+ lseg = fabs(
+ (pobj->det).a.r
+ * ((pobj->det).a.b - (pobj->det).a.a)
+ );
+ cutl = 0.0;
+ if (0 != (pobj->af).type) {
+ cutl = (pobj->af).cut;
+ }
+ if (0 != (pobj->ab).type) {
+ cutl += (pobj->ab).cut;
+ }
+ if (cutl > lseg) {
+ back = 0;
+ /* ERROR: Arc too short for arrows */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 64
+ );
+ }
+ if (0 != (pobj->af).type) {
+ cutl = (pobj->af).offset
+ + (double)((pobj->af).length)
+ * wxd2lat_object_linewidth(pobj, drw, job);
+ if (cutl > lseg) {
+ back = 0;
+ /* ERROR: Forward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 62
+ );
+ }
+ }
+ if (0 != (pobj->ab).type) {
+ cutl = (pobj->ab).offset
+ + (double)((pobj->ab).length)
+ * wxd2lat_object_linewidth(pobj, drw, job);
+ if (cutl > lseg) {
+ back = 0;
+ /* ERROR: Backward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 63
+ );
+ }
+ }
+ }
+ else {
+ /* Malformed arc drawn as polyline
+ */
+ if (0 != (pobj->af).type) {
+ x0 = wxd2lout_convert_x(drw,job,(double)((pobj->det).a.x2));
+ y0 = wxd2lout_convert_y(drw,job,(double)((pobj->det).a.y2));
+ x1 = wxd2lout_convert_x(drw,job,(double)((pobj->det).a.x3));
+ y1 = wxd2lout_convert_y(drw,job,(double)((pobj->det).a.y3));
+ x1 = x1 - x0;
+ y1 = y1 - y0;
+ lseg = sqrt(x1 * x1 + y1 * y1);
+ if (lseg <= (pobj->af).cut) {
+ back = 0;
+ /* ERROR: Forward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 62
+ );
+ }
+ }
+ if (0 != (pobj->ab).type) {
+ x0 = wxd2lout_convert_x(drw,job,(double)((pobj->det).a.x2));
+ y0 = wxd2lout_convert_y(drw,job,(double)((pobj->det).a.y2));
+ x1 = wxd2lout_convert_x(drw,job,(double)((pobj->det).a.x1));
+ y1 = wxd2lout_convert_y(drw,job,(double)((pobj->det).a.y1));
+ x1 = x1 - x0;
+ y1 = y1 - y0;
+ lseg = sqrt(x1 * x1 + y1 * y1);
+ if (lseg <= (pobj->ab).cut) {
+ back = 0;
+ /* ERROR: Backward arrow too long */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 63
+ );
+ }
+ }
+ }
+ }
+ }
+ $? "- wxd2lout_check_one_arc_object %d", back
+ return back;
+}
+
+
+
+/** Check one circle object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_circle_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+ $? "+ wxd2lout_check_one_circle_object"
+ if (0.0 < (pobj->det).e.rx) {
+ back = 1;
+ }
+ else { $? "! radius 0"
+ /* ERROR: Radius 0 */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 65
+ );
+ }
+ $? "- wxd2lout_check_one_circle_object %d", back
+ return back;
+}
+
+
+
+/** Check one ellipse object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_ellipse_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+ $? "+ wxd2lout_check_one_ellipse_object"
+ if ((0.0 < (pobj->det).e.rx) && (0.0 < (pobj->det).e.ry)) {
+ back = 1;
+ }
+ else { $? "! radius 0"
+ /* ERROR: Radius 0 */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 65
+ );
+ }
+ $? "- wxd2lout_check_one_ellipse_object %d", back
+ return back;
+}
+
+
+
+/** Check one box object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_box_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double w;
+ double h;
+ int back = 1;
+ $? "+ wxd2lout_check_one_box_object"
+ w = fabs((pobj->det).b.xr - (pobj->det).b.xl);
+ h = fabs((pobj->det).b.yt - (pobj->det).b.yb);
+ if (h < w) {
+ w = h;
+ }
+ if ((pobj->det).b.r > (w / 2.0)) {
+ back = 0;
+ /* ERROR: Box radius too large */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 66
+ );
+ }
+ $? "- wxd2lout_check_one_box_object %d", back
+ return back;
+}
+
+
+
+/** Check one dot object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_dot_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+ $? "+ wxd2lout_check_one_dot_object"
+ if (0.0 < (pobj->det).d.d) {
+ back = 1;
+ }
+ else { $? "! diameter 0"
+ /* ERROR: Diameter 0 */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 67
+ );
+ }
+ $? "- wxd2lout_check_one_dot_object %d", back
+ return back;
+}
+
+
+
+/** Check one image object if information is complete and object
+ can be drawn.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_image_object(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+ $? "+ wxd2lout_check_one_image_object"
+ if (NULL != (pobj->det).i.fn) {
+ if ((0.0 < (pobj->det).i.w) && (0.0 < (pobj->det).i.h)) {
+ back = 1;
+ }
+ else { $? "! width or height not positive"
+ /* ERROR: Width and height must be positive */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 68
+ );
+ }
+ }
+ else { $? "! no file name"
+ /* ERROR: No file name */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 69
+ );
+ }
+ $? "- wxd2lout_check_one_image_object %d", back
+ return back;
+}
+
+
+
+/** Check one graphics object if information is complete and object
+ can be drawn.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 on success (further handling possible), 0 otherwise.
+*/
+static
+int
+wxd2lout_check_one_graphics_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 0;
+ $? "+ wxd2lout_check_one_graphics_object"
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : {
+ back = wxd2lout_check_one_text_object(job, pobj);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ back = wxd2lout_check_one_polyline_object(job, pobj);
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ back = wxd2lout_check_one_spline_object(drw, job, pobj);
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ back = wxd2lout_check_one_arc_object(drw, job, pobj);
+ } break;
+ case WXD_OT_CIRCLE : {
+ back = wxd2lout_check_one_circle_object(job, pobj);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ back = wxd2lout_check_one_ellipse_object(job, pobj);
+ } break;
+ case WXD_OT_BOX : {
+ back = wxd2lout_check_one_box_object(job, pobj);
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ back = wxd2lout_check_one_dot_object(job, pobj);
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxd2lout_check_one_image_object(job, pobj);
+ } break;
+ default : { $? "! illegal object type"
+ /* ERROR: Illegal object type */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 70
+ );
+ } break;
+ }
+ if (0 == back) {
+ /* ERROR: Object check failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 71
+ );
+ }
+ $? "- wxd2lout_check_one_graphics_object %d", back
+ return back;
+}
+
+
+
+static
+int
+wxd2lout_is_abnormal_circle(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double lw;
+ int back = 0;
+ $? "+ wxd2lout_is_abnormal_circle"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ if ((pobj->det).e.rx <= (lw / 2.0)) {
+ back = 1;
+ }
+ $? "- wxd2lout_is_abnormal_circle %d", back
+ return back;
+}
+
+
+
+/** Check whether circle is abnormal (diameter smaller than line width).
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Object to check.
+ @return 1 for abnormal circle, 0 for normal circle.
+*/
+static
+int
+wxd2lout_abnormal_circle(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ double lw;
+ int back = 1;
+ $? "+ wxd2lout_abnormal_circle"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ dk4error_init(&er);
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ &back, &er
+ );
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ dk4pppt_circle(
+ job->ppp, (pobj->det).e.x, (pobj->det).e.y,
+ ((pobj->det).e.rx + lw / 2.0), NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+ $? "- wxd2lout_abnormal_circle %d", back
+ return back;
+}
+
+
+
+/** Draw abnormal stroked circle as filled circle.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Circle object to draw.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_is_abnormal_ellipse(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double lw;
+ int back = 0;
+ $? "+ wxd2lout_is_abnormal_ellipse"
+ lw = wxd2lat_object_linewidth(pobj, drw, job) / 2.0;
+ if (((pobj->det).e.rx <= lw) || ((pobj->det).e.ry <= lw)) {
+ back = 1;
+ }
+ $? "- wxd2lout_is_abnormal_ellipse %d", back
+ return back;
+}
+
+
+
+/** Check whether ellipse is abnormal (one diameter smaller than line width).
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Ellipse object to check.
+ @return 1 for abnormal ellipse, 0 for normal ellipse.
+*/
+static
+int
+wxd2lout_abnormal_ellipse(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ double lw;
+ int back = 1;
+ $? "+ wxd2lout_abnormal_ellipse"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ dk4error_init(&er);
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ &back, &er
+ );
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ dk4pppt_ellipse(
+ job->ppp, (pobj->det).e.x, (pobj->det).e.y,
+ ((pobj->det).e.rx + lw / 2.0), ((pobj->det).e.ry + lw / 2.0),
+ (pobj->det).e.a, NULL, &back, &er
+ );
+ dk4pppt_fill(job->ppp, &back, &er);
+ $? "- wxd2lout_abnormal_ellipse %d", back
+ return back;
+}
+
+
+
+static
+int
+wxd2lout_is_abnormal_box(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ double lw;
+ int back = 0;
+ $? "+ wxd2lout_is_abnormal_box"
+ lw = wxd2lat_object_linewidth(pobj, drw, job);
+ if (
+ (lw >= fabs((pobj->det).b.xr - (pobj->det).b.xl))
+ || (lw >= fabs((pobj->det).b.yt - (pobj->det).b.yb))
+ ) {
+ back = 1;
+ }
+ $? "- wxd2lout_is_abnormal_box %d", back
+ return back;
+}
+
+
+
+static
+int
+wxd2lout_abnormal_box(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ dk4_er_t er;
+ double lw;
+ double xl;
+ double xr;
+ double yt;
+ double yb;
+ double ra;
+ double dx;
+ double dy;
+ int back = 1;
+ $? "+ wxd2lout_abnormal_box"
+ lw = wxd2lat_object_linewidth(pobj, drw, job) / 2.0;
+ dk4error_init(&er);
+ dk4pppt_set_fill_rgb(
+ job->ppp,
+ (((double)(pobj->sc[0])) / 255.0),
+ (((double)(pobj->sc[1])) / 255.0),
+ (((double)(pobj->sc[2])) / 255.0),
+ &back, &er
+ );
+ $? ". back = %d", back
+ dk4pppt_prepare_fill(job->ppp, &back, &er);
+ $? ". back = %d", back
+ if ((pobj->det).b.xr >= (pobj->det).b.xl) {
+ xl = (pobj->det).b.xl - lw;
+ xr = (pobj->det).b.xr + lw;
+ }
+ else {
+ xl = (pobj->det).b.xr - lw;
+ xr = (pobj->det).b.xl + lw;
+ }
+ if ((pobj->det).b.yt >= (pobj->det).b.yb) {
+ yb = (pobj->det).b.yb - lw;
+ yt = (pobj->det).b.yt + lw;
+ }
+ else {
+ yb = (pobj->det).b.yt - lw;
+ yt = (pobj->det).b.yb + lw;
+ }
+ if (0.0 < (pobj->det).b.r) {
+ ra = (pobj->det).b.r + lw;
+ dx = fabs(xr - xl);
+ dy = fabs(yb - yt);
+ if (dy < dx) { dx = dy; }
+ dx *= 0.4998;
+ if (dx < ra) {
+ ra = dx;
+ }
+ }
+ else {
+ ra = -1.0;
+ }
+ dk4pppt_rectangle(job->ppp, xl, xr, yb, yt, ra, NULL, &back, &er);
+ $? ". back = %d", back
+ dk4pppt_fill(job->ppp, &back, &er);
+ $? "- wxd2lout_abnormal_box %d", back
+ return back;
+}
+
+
+
+
+/** Draw one graphics object.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param pobj Graphics object to draw.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_one_graphics_object(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 1;
+
+ $? "+ wxd2lout_one_graphics_object"
+ if (0 != wxd2lout_check_one_graphics_object(drw, job, pobj)) {
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : {
+ back = wxd2lout_text_object(job, pobj);
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE : case WXD_OT_O_ARC : {
+ back = wxd2lout_open_path_object(drw, job, pobj);
+ } break;
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE : case WXD_OT_C_ARC : {
+ back = wxd2lout_closed_path_object(drw, job, pobj);
+ } break;
+ case WXD_OT_CIRCLE : {
+ if (0 != wxd2lout_is_abnormal_circle(drw, job, pobj)) {
+ back = wxd2lout_abnormal_circle(drw, job, pobj);
+ }
+ else {
+ back = wxd2lout_closed_path_object(drw, job, pobj);
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ if (0 != wxd2lout_is_abnormal_ellipse(drw, job, pobj)) {
+ back = wxd2lout_abnormal_ellipse(drw, job, pobj);
+ }
+ else {
+ back = wxd2lout_closed_path_object(drw, job, pobj);
+ }
+ } break;
+ case WXD_OT_BOX : {
+ if (0 != wxd2lout_is_abnormal_box(drw, job, pobj)) {
+ back = wxd2lout_abnormal_box(drw, job, pobj);
+ }
+ else {
+ back = wxd2lout_closed_path_object(drw, job, pobj);
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : {
+ $? ". have a dot"
+ back = wxd2lout_dot_object(drw, job, pobj);
+ } break;
+ case WXD_OT_IMAGE : {
+ back = wxd2lout_image_object(job, pobj);
+ } break;
+ }
+ if (0 == back) {
+ /* ERROR: Failed to write graphics object */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 72
+ );
+ }
+ }
+ else {
+ back = 0;
+ }
+ $? "- wxd2lout_one_graphics_object %d", back
+ return back;
+}
+
+
+
+/** Create output for all graphics objects in a drawing.
+ @param drw Original drawing.
+ @param job Job structure containing the output structure.
+ @return 1 on success, 0 on error.
+*/
+static
+int
+wxd2lout_all_graphics_objects(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job
+)
+{
+ wxd_object_t *pobj;
+ dk4_um_t oldline;
+ int back = 1;
+
+ $? "+ wxd2lout_all_graphics_objects"
+ oldline = dk4app_get_log_source_line(job->app);
+ dk4sto_it_reset(drw->i_flat);
+ do {
+ pobj = (wxd_object_t *)dk4sto_it_next(drw->i_flat);
+ if (NULL != pobj) {
+ dk4app_set_log_source_line(job->app, pobj->lino);
+ if (0 == wxd2lout_one_graphics_object(drw, job, pobj)) {
+ back = 0;
+ }
+ }
+ } while (NULL != pobj);
+ dk4app_set_log_source_line(job->app, oldline);
+ $? "- wxd2lout_all_graphics_objects %d", back
+ return back;
+}
+
+
+
+static
+int
+wxd2lout_check_arrows(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj
+)
+{
+ int back = 1;
+ $? "+ wxd2lout_check_arrows"
+ if ((uint8_t)0U != (pobj->af).type) {
+ if (0 == wxd2lah_one_arrowhead(&(pobj->af), pobj, drw, job)) {
+ back = 0;
+ /* ERROR: Forward arrow calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 73
+ );
+ }
+ }
+ if ((uint8_t)0U != (pobj->ab).type) {
+ if (0 == wxd2lah_one_arrowhead(&(pobj->ab), pobj, drw, job)) {
+ back = 0;
+ /* ERROR: Backward arrow calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 74
+ );
+ }
+ }
+ $? "- wxd2lout_check_arrows %d", back
+ return back;
+}
+
+
+
+static
+int
+wxd2out_all_calculations(wxd_drawing_t *drw, wxd2lat_job_t *job)
+{
+ wxd_object_t *pobj;
+ dk4_um_t oldline;
+ int back = 1;
+ int myback = 0;
+ uint16_t u16;
+ $? "+ wxd2out_all_calculations"
+ oldline = dk4app_get_log_source_line(job->app);
+ dk4sto_it_reset(drw->i_flat);
+ do {
+ pobj = (wxd_object_t *)dk4sto_it_next(drw->i_flat);
+ if (NULL != pobj) {
+ dk4app_set_log_source_line(job->app, pobj->lino);
+ switch (pobj->ot) {
+ case WXD_OT_TEXT : {
+ (pobj->det).t.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).t.x);
+ (pobj->det).t.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).t.y);
+#if 0
+ (pobj->det).t.a = (M_PI * (pobj->det).t.a) / 180.0;
+#endif
+ } break;
+ case WXD_OT_POLYLINE : {
+ u16 = (uint16_t)0U;
+ if ((NULL != (pobj->det).p.p) && (u16 < (pobj->det).p.n)) {
+ for (u16 = (uint16_t)0U; u16 < (pobj->det).p.n; u16++) {
+ ((pobj->det).p.p)[u16].x =
+ wxd2lout_convert_x(
+ drw, job, ((pobj->det).p.p)[u16].x
+ );
+ ((pobj->det).p.p)[u16].y =
+ wxd2lout_convert_y(
+ drw, job, ((pobj->det).p.p)[u16].y
+ );
+ }
+ }
+ if (0 == wxd2lout_check_arrows(drw, job, pobj)) {
+ /* Errors already reported */
+ back = 0;
+ }
+ } break;
+ case WXD_OT_O_SPLINE : {
+ u16 = (uint16_t)0U;
+ if ((NULL != (pobj->det).s.p) && (u16 < (pobj->det).s.n)) {
+ for (u16 = (uint16_t)0U; u16 < (pobj->det).s.n; u16++) {
+ ((pobj->det).s.p)[u16].x =
+ wxd2lout_convert_x(
+ drw, job, ((pobj->det).s.p)[u16].x
+ );
+ ((pobj->det).s.p)[u16].y =
+ wxd2lout_convert_y(
+ drw, job, ((pobj->det).s.p)[u16].y
+ );
+ }
+ }
+ if (0 == wxd2lout_check_arrows(drw, job, pobj)) {
+ /* Errors already reported */
+ back = 0;
+ }
+ if (
+ ((uint8_t)0U != (pobj->af).type)
+ || ((uint8_t)0U != (pobj->ab).type)
+ ) {
+ (pobj->det).s.ts = -1.0;
+ (pobj->det).s.te = -1.0;
+ myback = 1;
+ wxd2lxs_calculate_spline_segments(job, pobj, &myback);
+ if (0 == myback) {
+ back = 0;
+ /* ERROR: Spline segment calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg,
+ DK4_LL_ERROR, 75
+ );
+ }
+ }
+ } break;
+ case WXD_OT_O_ARC : { $? ". arc"
+ (pobj->det).a.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).a.x);
+ (pobj->det).a.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).a.y);
+ $? ". r = %lg", (pobj->det).a.r
+ (pobj->det).a.r =
+ wxd2lout_convert_r((pobj->det).a.r);
+ if (0 == wxd2lout_check_arrows(drw, job, pobj)) {
+ /* Errors already reported */
+ back = 0;
+ }
+ } break;
+ case WXD_OT_POLYGON : {
+ u16 = (uint16_t)0U;
+ if ((NULL != (pobj->det).p.p) && (u16 < (pobj->det).p.n)) {
+ for (u16 = (uint16_t)0U; u16 < (pobj->det).p.n; u16++) {
+ ((pobj->det).p.p)[u16].x =
+ wxd2lout_convert_x(
+ drw, job, ((pobj->det).p.p)[u16].x
+ );
+ ((pobj->det).p.p)[u16].y =
+ wxd2lout_convert_y(
+ drw, job, ((pobj->det).p.p)[u16].y
+ );
+ }
+ }
+ } break;
+ case WXD_OT_C_SPLINE : {
+ u16 = (uint16_t)0U;
+ if ((NULL != (pobj->det).s.p) && (u16 < (pobj->det).s.n)) {
+ for (u16 = (uint16_t)0U; u16 < (pobj->det).s.n; u16++) {
+ ((pobj->det).s.p)[u16].x =
+ wxd2lout_convert_x(
+ drw, job, ((pobj->det).s.p)[u16].x
+ );
+ ((pobj->det).s.p)[u16].y =
+ wxd2lout_convert_y(
+ drw, job, ((pobj->det).s.p)[u16].y
+ );
+ }
+ }
+ } break;
+ case WXD_OT_C_ARC : { $? ". closed arc"
+ (pobj->det).a.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).a.x);
+ (pobj->det).a.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).a.y);
+ $? ". r = %g", (pobj->det).a.r
+ (pobj->det).a.r =
+ wxd2lout_convert_r((pobj->det).a.r);
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : { $? ". c/e"
+ (pobj->det).e.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).e.x);
+ (pobj->det).e.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).e.y);
+ $? ". rx = %g", (pobj->det).e.rx
+ (pobj->det).e.rx =
+ wxd2lout_convert_r((pobj->det).e.rx);
+ $? ". rx = %g", (pobj->det).e.rx
+ $? ". ry = %g", (pobj->det).e.ry
+ (pobj->det).e.ry =
+ wxd2lout_convert_r((pobj->det).e.ry);
+ $? ". ry = %g", (pobj->det).e.ry
+ } break;
+ case WXD_OT_BOX : { $? ". box"
+ $? ". xl = %g", (pobj->det).b.xl
+ $? ". xr = %g", (pobj->det).b.xr
+ $? ". yb = %g", (pobj->det).b.yb
+ $? ". yt = %g", (pobj->det).b.yt
+ $? ". r = %g", (pobj->det).b.r
+ (pobj->det).b.xl =
+ wxd2lout_convert_x(drw, job, (pobj->det).b.xl);
+ (pobj->det).b.xr =
+ wxd2lout_convert_x(drw, job, (pobj->det).b.xr);
+ (pobj->det).b.yb =
+ wxd2lout_convert_y(drw, job, (pobj->det).b.yb);
+ (pobj->det).b.yt =
+ wxd2lout_convert_y(drw, job, (pobj->det).b.yt);
+ if (0.0 < (pobj->det).b.r) {
+ $? ". r = %g", (pobj->det).b.r
+ (pobj->det).b.r = wxd2lout_convert_r((pobj->det).b.r);
+ }
+ $? ". xl = %g", (pobj->det).b.xl
+ $? ". xr = %g", (pobj->det).b.xr
+ $? ". yb = %g", (pobj->det).b.yb
+ $? ". yt = %g", (pobj->det).b.yt
+ $? ". r = %g", (pobj->det).b.r
+ } break;
+ case WXD_OT_IMAGE : { $? ". image"
+ (pobj->det).i.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).i.x);
+ (pobj->det).i.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).i.y);
+ $? ". w = %g", (pobj->det).i.w
+ $? ". h = %g", (pobj->det).i.h
+ (pobj->det).i.w = wxd2lout_convert_r((pobj->det).i.w);
+ (pobj->det).i.h = wxd2lout_convert_r((pobj->det).i.h);
+
+ } break;
+ case WXD_OT_DOT_FILLED : case WXD_OT_DOT_WHITE : { $? ". dot"
+ (pobj->det).d.x =
+ wxd2lout_convert_x(drw, job, (pobj->det).d.x);
+ (pobj->det).d.y =
+ wxd2lout_convert_y(drw, job, (pobj->det).d.y);
+ $? ". dot d (1) = %g", (pobj->det).d.d
+ if (0.0 < job->baselw) {
+ (pobj->det).d.d *= job->baselw;
+ }
+ else {
+ (pobj->det).d.d *= drw->baselw;
+ }
+ $? ". dot d (2) = %g", (pobj->det).d.d
+ } break;
+ }
+ }
+ } while (NULL != pobj);
+ dk4app_set_log_source_line(job->app, oldline);
+ $? "- wxd2out_all_calculations %d", back
+ return back;
+}
+
+
+
+void
+wxd2lat_output(wxd_drawing_t *drw, wxd2lat_job_t *job, const dkChar *fn)
+{
+ dk4_er_t er;
+ dk4_pppt_driver_t dr;
+ int flags = 0;
+ int ok = 0;
+
+ $? "+ wxd2lat_output"
+ /*
+ Calculate image width and coordinates shift values.
+ */
+ if (0 == wxd2lout_prepare_job(drw, job, fn)) {
+ /* All errors already reported */
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+ /* Convert coordinates to bp, pre-calculate arrowhead data.
+ */
+ if (0 == wxd2out_all_calculations(drw, job)) {
+ /* All errors already reported */
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+ /* Open output structure
+ */
+ dr = DK4_PPPT_DR_PDF_TEX;
+ switch ((job->grco).driver) {
+#if 0
+ case DK4_GRA_DRIVER_PDF : {
+ dr = DK4_PPPT_DR_PDF_TEX;
+ } break;
+#endif
+ case DK4_GRA_DRIVER_PS : case DK4_GRA_DRIVER_EPS : {
+ dr = DK4_PPPT_DR_EPS_TEX;
+ } break;
+ case DK4_GRA_DRIVER_PGF : {
+ dr = DK4_PPPT_DR_PGF;
+ } break;
+ }
+ if (0 == job->whitebg) {
+ flags |= DK4_GRA_PAGE_FLAG_NO_BG;
+ }
+ if (0 == (job->grco).color) {
+ flags |= DK4_GRA_DOC_FLAG_FORCE_GRAY;
+ }
+ if (DK4_PPPT_DR_EPS_TEX == dr) {
+ if (2 == (job->grco).ps_level) {
+ flags |= DK4_GRA_DOC_FLAG_PS2;
+ }
+ if (0 != (job->grco).ps_dsc) {
+ flags |= DK4_GRA_DOC_FLAG_PS_DSC;
+ }
+ if (DK4_GRA_DRIVER_EPS == (job->grco).driver) {
+ flags |= DK4_GRA_DOC_FLAG_EPS;
+ }
+ }
+ dk4error_init(&er);
+ job->ppp = dk4pppt_open(
+ job->fno1, dr,
+ ((DK4_GRA_PURPOSE_DOCUMENT == (job->grco).purpose) ? (1) : (0)),
+ flags, job->szwidth, job->szheight, &er
+ );
+ if (NULL == job->ppp) {
+ /* ERROR: Failed to open output structure */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 76
+ );
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+ dk4pppt_set_gs_for_pattern_only(job->ppp, 1, NULL);
+ if (0.0 < job->patlw) {
+ dk4pppt_set_pattern_line_width(job->ppp, job->patlw);
+ }
+ else {
+ dk4pppt_set_pattern_line_width(job->ppp, 0.45);
+ }
+ /*
+ Clip if shiftx and/or shifty is used
+ */
+ if (0 == wxd2lout_clip_to_used_region(job)) {
+ /* All errors already reported */
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+ /* Draw all graphics objects
+ */
+ if (0 == wxd2lout_all_graphics_objects(drw, job)) {
+ /* All errors already reported */
+ job->exval = EXIT_FAILURE;
+ goto finished;
+ }
+
+ /* Finally indicate success
+ */
+ ok = 1;
+
+ /* Produce output files if success so far, clean up
+ */
+ finished:
+ if (NULL != job->ppp) {
+ if (0 != ok) {
+ dk4error_init(&er);
+ ok = dk4pppt_write_and_close(job->ppp, &er);
+ if (0 == ok) {
+ /* ERROR: Failed to write output */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 77
+ );
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ else {
+ dk4pppt_close(job->ppp);
+ /* ERROR: Skipping output due to previous errors */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 78
+ );
+ job->exval = EXIT_FAILURE;
+ }
+ }
+ job->ppp = NULL;
+ $? "- wxd2lat_output"
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxd2lout.h b/support/dktools/wxd2lout.h
new file mode 100644
index 0000000000..7c4f90c40f
--- /dev/null
+++ b/support/dktools/wxd2lout.h
@@ -0,0 +1,79 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxd2lout.ctr
+*/
+
+/** @file wxd2lout.h Header file for the wxd2lout module.
+*/
+
+#ifndef WXD2LOUT_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXD2LOUT_H_INCLUDED 1
+
+
+#line 9 "wxd2lout.ctr"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Produce output for an input file successfully read in.
+ @param drw Drawing to produce output for.
+ @param job Job structure, probably modified.
+ @param fn Input file name
+*/
+
+void
+wxd2lat_output(
+ wxd_drawing_t *drw,
+ wxd2lat_job_t *job,
+ const dkChar *fn
+);
+
+
+/** Convert x value from WXD coordinates to bp.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param x X value to convert.
+ @return Conversion result.
+*/
+
+double
+wxd2lout_convert_x(wxd_drawing_t *drw, wxd2lat_job_t *job, double x);
+
+
+/** Convert y value from WXD coordinates to bp.
+ @param drw Drawing structure.
+ @param job Job structure.
+ @param y Y value to convert.
+ @return Conversion result.
+*/
+
+double
+wxd2lout_convert_y(wxd_drawing_t *drw, wxd2lat_job_t *job, double y);
+
+
+/** Convert a distance from WXD units to bp.
+ @param r Distance in WXD units to convert.
+ @return Result in bp.
+*/
+
+double
+wxd2lout_convert_r(double r);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#endif
diff --git a/support/dktools/wxd2lxs.c b/support/dktools/wxd2lxs.c
new file mode 100644
index 0000000000..2ca2555abf
--- /dev/null
+++ b/support/dktools/wxd2lxs.c
@@ -0,0 +1,615 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxd2lxs.ctr
+*/
+
+/** @file wxd2lxs.c The wxd2lxs module.
+*/
+
+
+#line 127 "wxd2lxs.ctr"
+
+
+#ifndef WXD2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+
+
+
+
+#line 136 "wxd2lxs.ctr"
+
+
+
+void
+wxd2lxs_set_xspline(
+ dk4_xsp_2d_t *xs,
+ wxd_object_t *pobj,
+ uint16_t ib
+)
+{
+ wxd_spline_point_t *p;
+ uint16_t n;
+ uint16_t ia;
+ uint16_t ic;
+ uint16_t id;
+
+ if ((NULL != xs) && (NULL != pobj)) {
+ if (
+ ((WXD_OT_C_SPLINE == pobj->ot) && (ib < (pobj->det).s.n))
+ || ((WXD_OT_O_SPLINE) && (ib < ((pobj->det).s.n) - (uint16_t)1U))
+ ) {
+ p = (pobj->det).s.p;
+ n = (pobj->det).s.n;
+ ia = ib - 1;
+ ic = ib + 1;
+ id = ib + 2;
+ if ((uint16_t)0U == ib) {
+ ia = n - (uint16_t)1U;
+ }
+ else {
+ if (n - (uint16_t)1U == ib) {
+ ic = (uint16_t)0U;
+ id = (uint16_t)1U;
+ }
+ else {
+ if (n - (uint16_t)2U == ib) {
+ id = (uint16_t)0U;
+ }
+ }
+ }
+ dk4xsp2d_reset(xs);
+#if 0
+ dk4xsp2d_reset_points(xs);
+#endif
+ dk4xsp2d_set_point(xs, p[ib].x, p[ib].y, p[ib].s, 1);
+ dk4xsp2d_set_point(xs, p[ic].x, p[ic].y, p[ic].s, 2);
+ if (((uint16_t)0U < ib) || (WXD_OT_C_SPLINE == pobj->ot)) {
+ dk4xsp2d_set_point(xs, p[ia].x, p[ia].y, p[ia].s, 0);
+ }
+ if ((n - (uint16_t)2U > ib) || (WXD_OT_C_SPLINE == pobj->ot)) {
+ dk4xsp2d_set_point(xs, p[id].x, p[id].y, p[id].s, 3);
+ }
+ }
+ }
+}
+
+
+
+int
+wxd2lxs_calculate(
+ double *rp,
+ wxd_object_t *pobj,
+ double t,
+ int d,
+ dk4_er_t *erp
+)
+{
+ dk4_xsp_2d_t xs;
+ double val[4];
+ double t1;
+ double t2;
+ size_t ib;
+#if VERSION_BEFORE_20190110
+ size_t ia;
+ size_t ic;
+ size_t id;
+#endif
+ int back = 0;
+ int res;
+
+
+#line 216 "wxd2lxs.ctr"
+ /*
+ Check arguments
+ */
+ if ((NULL == rp) || (NULL == pobj) || (WXD_OT_O_SPLINE != pobj->ot)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0.0 > t) || ((double)((pobj->det).s.n) < t)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == (pobj->det).s.sl) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Calculate indices
+ */
+ ib = (size_t)floor(t);
+ t = t - (double)ib;
+#if VERSION_BEFORE_20190110
+ ic = ib + 1;
+ id = ib + 2;
+ ia = ib - 1;
+ /*
+ Set up X-spline
+ */
+ dk4xsp2d_reset(&xs);
+ dk4xsp2d_reset_points(&xs);
+ if ((size_t)0U < ib) {
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ }
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ ((pobj->det).s.p)[ib].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ ((pobj->det).s.p)[ic].s, 2
+ );
+ if ((pobj->det).s.n - 2 > ib) {
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+ }
+#else
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+#endif
+ /*
+ Retrieve values
+ */
+ if (0 != d) {
+ res = dk4xsp2d_calculate_value_derivative(val, &xs, t, erp);
+ }
+ else {
+ res = dk4xsp2d_calculate_value(val, &xs, t, erp);
+ }
+ if (0 == res) {
+ goto finished;
+ }
+ /* Transfer x and y
+ */
+ if (0 != d) {
+ rp[0] = val[0];
+ rp[1] = val[2];
+ if ((1.0e-8 < fabs(val[1])) || (1.0e-8 < fabs(val[3]))) {
+ rp[2] = atan2(val[3], val[1]);
+ back = 1;
+ if (0 == dk4ma_is_finite(rp[2])) {
+ t1 = t2 = t;
+ if ((1.0/64.0) < t) { t1 = t - (1.0/64.0); }
+ if ((1.0 - 1.0/64.0) > t) { t2 = t + (1.0/64.0); }
+ if (0 != dk4xsp2d_calculate_value(val, &xs, t1, erp)) {
+ if (0 != dk4xsp2d_calculate_value(&(val[2]),&xs,t2,erp)) {
+ rp[2] = atan2((val[3] - val[1]), (val[2] - val[0]));
+ back = 1;
+ }
+ }
+ }
+ }
+ else {
+ t1 = t2 = t;
+ if ((1.0/64.0) < t) { t1 = t - (1.0/64.0); }
+ if ((1.0 - 1.0/64.0) > t) { t2 = t + (1.0/64.0); }
+ if (0 != dk4xsp2d_calculate_value(val, &xs, t1, erp)) {
+ if (0 != dk4xsp2d_calculate_value(&(val[2]), &xs, t2, erp)) {
+ rp[2] = atan2((val[3] - val[1]), (val[2] - val[0]));
+ back = 1;
+ }
+ }
+ }
+ }
+ else {
+ rp[0] = val[0];
+ rp[1] = val[1];
+ back = 1;
+ }
+finished:
+
+
+#line 322 "wxd2lxs.ctr"
+ return back;
+}
+
+
+
+int
+wxd2lxs_length_to_parameter(
+ double *rp,
+ wxd_object_t *pobj,
+ double t,
+ double eps,
+ dk4_er_t *erp
+)
+{
+ dk4_xsp_2d_t xs;
+ double v = 0.0;
+ double pv = 0.0;
+ size_t i;
+#if VERSION_BEFORE_20190110
+ size_t ia;
+ size_t ic;
+ size_t id;
+#endif
+ size_t ib;
+ int back = 0;
+
+
+#line 348 "wxd2lxs.ctr"
+ /*
+ Check arguments
+ */
+ if ((NULL == rp) || (NULL == pobj) || (WXD_OT_O_SPLINE != pobj->ot)) {
+
+
+#line 353 "wxd2lxs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0.0 > t) || ((double)((pobj->det).s.n) < t)) {
+
+
+#line 358 "wxd2lxs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == (pobj->det).s.sl) {
+
+
+#line 363 "wxd2lxs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Sum up complete segments.
+ */
+ back = 1;
+ ib = (size_t)floor(t);
+ for (i = (size_t)0U; i < ib; i++) {
+ v += ((pobj->det).s.sl)[i];
+ }
+
+#line 373 "wxd2lxs.ctr"
+ /* Calculate partial segment.
+ */
+ t -= (double)ib;
+ if (0.0 < t) {
+#if VERSION_BEFORE_20190110
+ ia = ib - (size_t)1U;
+ ic = ib + (size_t)1U;
+ id = ib + (size_t)2U;
+ dk4xsp2d_reset(&xs);
+ dk4xsp2d_reset_points(&xs);
+ dk4xsp2d_set_point(
+ &xs, ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ ((pobj->det).s.p)[ib].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xs, ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ ((pobj->det).s.p)[ic].s, 2
+ );
+ if ((size_t)0U < ib) {
+ dk4xsp2d_set_point(
+ &xs, ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ }
+ if ((size_t)((pobj->det).s.n) - (size_t)2U > ib) {
+ dk4xsp2d_set_point(
+ &xs, ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+ }
+#else
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+#endif
+ back = dk4xsp2d_calculate_partial_length(&pv, &xs, t, eps, erp);
+ if (0 != back) {
+ v += pv;
+
+#line 409 "wxd2lxs.ctr"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 412 "wxd2lxs.ctr"
+ }
+#endif
+ }
+ if (0 != back) {
+ if (0 != dk4ma_is_finite(v)) {
+ *rp = v;
+
+#line 418 "wxd2lxs.ctr"
+ }
+ else {
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+
+finished:
+
+
+#line 427 "wxd2lxs.ctr"
+ return back;
+}
+
+
+
+/** Function used in iteration.
+ @param d Address of destination variable for function value at x.
+ @param x X position (the t parameter).
+ @param ps A wxd2lxs_iter_t containing X-spline object, length
+ and precision.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+iter_fct(double *d, double x, const void *ps)
+{
+ const wxd2lxs_iter_t *piter;
+ double v;
+ int back = 0;
+
+ piter = (const wxd2lxs_iter_t *)ps;
+ back = wxd2lxs_length_to_parameter(
+ &v, piter->pobj, x, piter->xslp, piter->erp
+ );
+ if (0 != back) {
+ *d = v - piter->l;
+ }
+ return back;
+}
+
+
+
+int
+wxd2lxs_parameter_for_length(
+ double *rp,
+ wxd_object_t *pobj,
+ double l,
+ double xslp,
+ double xspp,
+ dk4_er_t *erp
+)
+{
+ wxd2lxs_iter_t iter;
+ dk4_iter_ctx_t ctx;
+ unsigned long pp = 0UL;
+ int back = 0;
+ int res;
+
+
+#line 476 "wxd2lxs.ctr"
+ /*
+ Check arguments.
+ */
+ if ((NULL == rp) || (NULL == pobj)) {
+
+#line 480 "wxd2lxs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0.0 >= xslp) || (0.0 >= xspp)) {
+
+#line 484 "wxd2lxs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0.0 > l) || ((pobj->det).s.suml < l)) {
+
+
+#line 489 "wxd2lxs.ctr"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Set up iteration structures
+ */
+ iter.pobj = pobj;
+ iter.l = l;
+ iter.xslp = xslp;
+ iter.erp = erp;
+ dk4iter_ctx_init(&ctx);
+ dk4iter_ctx_set_eps_x(&ctx, xspp);
+ dk4iter_ctx_set_eps_y(&ctx, xspp);
+ dk4iter_ctx_set_maxpass(&ctx, 1024UL);
+ dk4iter_ctx_set_exact(&ctx, 0);
+ dk4iter_ctx_set_algorithm(&ctx, DK4_ITER_ALG_RF_ANDERSON_BJOERCK);
+ dk4iter_ctx_set_min(&ctx, 0.0);
+ dk4iter_ctx_set_max(&ctx, (double)((pobj->det).s.n - (uint16_t)1U));
+ /*
+ Run iteration
+ */
+
+
+#line 510 "wxd2lxs.ctr"
+ res = dk4iter_interval(
+ rp, &pp, iter_fct, (const void *)(&iter),
+ 0.0, (double)((pobj->det).s.n - (uint16_t)1U), &ctx
+ );
+ /* Process iteration result
+ */
+ if (DK4_ITER_RESULT_SUCCESS == res) {
+ back = 1;
+
+#line 518 "wxd2lxs.ctr"
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 521 "wxd2lxs.ctr"
+ }
+#endif
+
+finished:
+
+
+#line 526 "wxd2lxs.ctr"
+ return back;
+}
+
+
+
+void
+wxd2lxs_calculate_spline_segments(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr
+)
+{
+ dk4_xsp_2d_t xsp;
+ dk4_er_t er;
+ size_t nelem;
+ uint16_t i;
+ int res;
+ int failed;
+
+
+#line 545 "wxd2lxs.ctr"
+ failed = 0;
+ if (((uint16_t)1U < (pobj->det).s.n) && (NULL == (pobj->det).s.sl)) {
+ nelem = (size_t)((pobj->det).s.n - (uint16_t)1U);
+ (pobj->det).s.sl = dk4mem_new(double,nelem,NULL);
+ if (NULL != (pobj->det).s.sl) {
+ dk4xsp2d_reset(&xsp);
+ (pobj->det).s.suml = 0.0;
+ for (i = 0; i < nelem; i++) {
+ ((pobj->det).s.sl)[i] = 0.0;
+ /*
+ Calculate segment length
+ */
+#if VERSION_BEFORE_20190110
+ dk4xsp2d_reset_points(&xsp);
+ dk4xsp2d_set_point(
+ &xsp, ((pobj->det).s.p)[i].x, ((pobj->det).s.p)[i].y,
+ ((pobj->det).s.p)[i].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xsp, ((pobj->det).s.p)[i+1].x, ((pobj->det).s.p)[i+1].y,
+ ((pobj->det).s.p)[i+1].s, 2
+ );
+ if (0 < i) {
+
+#line 568 "wxd2lxs.ctr"
+ dk4xsp2d_set_point(
+ &xsp, ((pobj->det).s.p)[i-1].x,((pobj->det).s.p)[i-1].y,
+ ((pobj->det).s.p)[i-1].s, 0
+ );
+ }
+ if (nelem - 1 > i) {
+
+#line 574 "wxd2lxs.ctr"
+ dk4xsp2d_set_point(
+ &xsp, ((pobj->det).s.p)[i+2].x,((pobj->det).s.p)[i+2].y,
+ ((pobj->det).s.p)[i+2].s, 3
+ );
+ }
+#else
+ wxd2lxs_set_xspline(&xsp, pobj, i);
+#endif
+ res = dk4xsp2d_calculate_length(
+ &(((pobj->det).s.sl)[i]), &xsp, (job->grco).xslp, NULL
+ );
+ if (0 != res) {
+
+
+#line 587 "wxd2lxs.ctr"
+ (pobj->det).s.suml += ((pobj->det).s.sl)[i];
+ }
+ else {
+
+#line 590 "wxd2lxs.ctr"
+ *backptr = 0;
+ failed = 1;
+ /* ERROR: Segment length calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 79
+ );
+ }
+ }
+
+
+#line 599 "wxd2lxs.ctr"
+ if (0 == failed) {
+ (pobj->det).s.ts = 0.0;
+ (pobj->det).s.te = (pobj->det).s.suml;
+ if (0 != (pobj->ab).type) {
+ dk4error_init(&er);
+ res = wxd2lxs_parameter_for_length(
+ &((pobj->det).s.ts), pobj, (pobj->ab).cut,
+ (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+
+#line 609 "wxd2lxs.ctr"
+ (pobj->det).s.ts = -1.0;
+ *backptr = 0;
+ /* ERROR: Cut calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 80
+ );
+ }
+ else {
+
+#line 617 "wxd2lxs.ctr"
+ }
+ }
+ if (0 != (pobj->af).type) {
+ dk4error_init(&er);
+ res = wxd2lxs_parameter_for_length(
+ &((pobj->det).s.te), pobj,
+ ((pobj->det).s.suml - (pobj->af).cut),
+ (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) {
+
+#line 627 "wxd2lxs.ctr"
+ (pobj->det).s.te = -1.0;
+ *backptr = 0;
+ /* ERROR: Cut calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 80
+ );
+ }
+ else {
+
+#line 635 "wxd2lxs.ctr"
+ }
+ }
+ }
+ }
+ else {
+
+#line 640 "wxd2lxs.ctr"
+ /* ERROR: Memory allocation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 81
+ );
+ *backptr = 0;
+ }
+ }
+#if TRACE_DEBUG
+ else {
+
+#line 649 "wxd2lxs.ctr"
+ }
+#endif
+
+
+#line 652 "wxd2lxs.ctr"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxd2lxs.ctr b/support/dktools/wxd2lxs.ctr
new file mode 100644
index 0000000000..f32a36c5ab
--- /dev/null
+++ b/support/dktools/wxd2lxs.ctr
@@ -0,0 +1,657 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+
+%% header
+
+/** @file wxd2lxs.h X-spline handling in wxd2lat.
+*/
+
+#ifndef DK4ERROR_H_INCLUDED
+#include "dk4error.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Set up X-spline segment structure from X-spline data object.
+ @param xs X-spline segment structure to set up.
+ @param pobj X-spline object to obtain data from.
+ @param ib Segment number.
+*/
+
+void
+wxd2lxs_set_xspline(
+ dk4_xsp_2d_t *xs,
+ wxd_object_t *pobj,
+ uint16_t ib
+);
+
+
+/** Check spline object, if necessary calculate the segment lengths.
+ @param job Job structure.
+ @param drw Drawing structure.
+ @param pobj Object to process.
+ @paam backptr Address of success variable to reset on error.
+*/
+void
+wxd2lxs_calculate_spline_segments(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr
+);
+
+
+/** Calculate coordinates and optionally direction for a given t value.
+ This function can only be used for open splines with at least one
+ arrowhead attached.
+ @param rp Address of result variable to set on success.
+ If d=0 a 2 elements array is required to store x and y.
+ If d!=0 a 3 elements array is required to store
+ x, y and alpha (direction angle).
+ @param pobj X-spline object.
+ @param t Parameter t.
+ @param d Flag: Calculate derivative values.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error (calculation failed).
+*/
+
+int
+wxd2lxs_calculate(
+ double *rp,
+ wxd_object_t *pobj,
+ double t,
+ int d,
+ dk4_er_t *erp
+);
+
+
+/** Calculate partial X-spline length from 0 to a given t value.
+ This function can only be used for open splines with at least one
+ arrowhead attached.
+ @param rp Address of result variable to set on success.
+ @param pobj X-spline object.
+ @param t Parameter t.
+ @param eps Required precision.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error (calculation failed).
+*/
+
+int
+wxd2lxs_length_to_parameter(
+ double *rp,
+ wxd_object_t *pobj,
+ double t,
+ double eps,
+ dk4_er_t *erp
+);
+
+
+/** Find t parameter for a given partial X-spline length l.
+ @param rp Address of result variable for t value.
+ @param pobj Open X-spline with arrowhead(s).
+ @param l Length to search to for.
+ @param xslp Precision for length calculation.
+ @param xspp Iteration precision for t.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxd2lxs_parameter_for_length(
+ double *rp,
+ wxd_object_t *pobj,
+ double l,
+ double xslp,
+ double xspp,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+%% module
+
+
+#ifndef WXD2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+
+
+$!trace-include
+
+
+
+void
+wxd2lxs_set_xspline(
+ dk4_xsp_2d_t *xs,
+ wxd_object_t *pobj,
+ uint16_t ib
+)
+{
+ wxd_spline_point_t *p;
+ uint16_t n;
+ uint16_t ia;
+ uint16_t ic;
+ uint16_t id;
+
+ if ((NULL != xs) && (NULL != pobj)) {
+ if (
+ ((WXD_OT_C_SPLINE == pobj->ot) && (ib < (pobj->det).s.n))
+ || ((WXD_OT_O_SPLINE) && (ib < ((pobj->det).s.n) - (uint16_t)1U))
+ ) {
+ p = (pobj->det).s.p;
+ n = (pobj->det).s.n;
+ ia = ib - 1;
+ ic = ib + 1;
+ id = ib + 2;
+ if ((uint16_t)0U == ib) {
+ ia = n - (uint16_t)1U;
+ }
+ else {
+ if (n - (uint16_t)1U == ib) {
+ ic = (uint16_t)0U;
+ id = (uint16_t)1U;
+ }
+ else {
+ if (n - (uint16_t)2U == ib) {
+ id = (uint16_t)0U;
+ }
+ }
+ }
+ dk4xsp2d_reset(xs);
+#if 0
+ dk4xsp2d_reset_points(xs);
+#endif
+ dk4xsp2d_set_point(xs, p[ib].x, p[ib].y, p[ib].s, 1);
+ dk4xsp2d_set_point(xs, p[ic].x, p[ic].y, p[ic].s, 2);
+ if (((uint16_t)0U < ib) || (WXD_OT_C_SPLINE == pobj->ot)) {
+ dk4xsp2d_set_point(xs, p[ia].x, p[ia].y, p[ia].s, 0);
+ }
+ if ((n - (uint16_t)2U > ib) || (WXD_OT_C_SPLINE == pobj->ot)) {
+ dk4xsp2d_set_point(xs, p[id].x, p[id].y, p[id].s, 3);
+ }
+ }
+ }
+}
+
+
+
+int
+wxd2lxs_calculate(
+ double *rp,
+ wxd_object_t *pobj,
+ double t,
+ int d,
+ dk4_er_t *erp
+)
+{
+ dk4_xsp_2d_t xs;
+ double val[4];
+ double t1;
+ double t2;
+ size_t ib;
+#if VERSION_BEFORE_20190110
+ size_t ia;
+ size_t ic;
+ size_t id;
+#endif
+ int back = 0;
+ int res;
+ $? "+ wxd2lxs_calculate"
+ /*
+ Check arguments
+ */
+ if ((NULL == rp) || (NULL == pobj) || (WXD_OT_O_SPLINE != pobj->ot)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0.0 > t) || ((double)((pobj->det).s.n) < t)) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == (pobj->det).s.sl) {
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Calculate indices
+ */
+ ib = (size_t)floor(t);
+ t = t - (double)ib;
+#if VERSION_BEFORE_20190110
+ ic = ib + 1;
+ id = ib + 2;
+ ia = ib - 1;
+ /*
+ Set up X-spline
+ */
+ dk4xsp2d_reset(&xs);
+ dk4xsp2d_reset_points(&xs);
+ if ((size_t)0U < ib) {
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ }
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ ((pobj->det).s.p)[ib].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ ((pobj->det).s.p)[ic].s, 2
+ );
+ if ((pobj->det).s.n - 2 > ib) {
+ dk4xsp2d_set_point(
+ &xs,
+ ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+ }
+#else
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+#endif
+ /*
+ Retrieve values
+ */
+ if (0 != d) {
+ res = dk4xsp2d_calculate_value_derivative(val, &xs, t, erp);
+ }
+ else {
+ res = dk4xsp2d_calculate_value(val, &xs, t, erp);
+ }
+ if (0 == res) {
+ goto finished;
+ }
+ /* Transfer x and y
+ */
+ if (0 != d) {
+ rp[0] = val[0];
+ rp[1] = val[2];
+ if ((1.0e-8 < fabs(val[1])) || (1.0e-8 < fabs(val[3]))) {
+ rp[2] = atan2(val[3], val[1]);
+ back = 1;
+ if (0 == dk4ma_is_finite(rp[2])) {
+ t1 = t2 = t;
+ if ((1.0/64.0) < t) { t1 = t - (1.0/64.0); }
+ if ((1.0 - 1.0/64.0) > t) { t2 = t + (1.0/64.0); }
+ if (0 != dk4xsp2d_calculate_value(val, &xs, t1, erp)) {
+ if (0 != dk4xsp2d_calculate_value(&(val[2]),&xs,t2,erp)) {
+ rp[2] = atan2((val[3] - val[1]), (val[2] - val[0]));
+ back = 1;
+ }
+ }
+ }
+ }
+ else {
+ t1 = t2 = t;
+ if ((1.0/64.0) < t) { t1 = t - (1.0/64.0); }
+ if ((1.0 - 1.0/64.0) > t) { t2 = t + (1.0/64.0); }
+ if (0 != dk4xsp2d_calculate_value(val, &xs, t1, erp)) {
+ if (0 != dk4xsp2d_calculate_value(&(val[2]), &xs, t2, erp)) {
+ rp[2] = atan2((val[3] - val[1]), (val[2] - val[0]));
+ back = 1;
+ }
+ }
+ }
+ }
+ else {
+ rp[0] = val[0];
+ rp[1] = val[1];
+ back = 1;
+ }
+finished:
+ $? "- wxd2lxs_calculate %d", back
+ return back;
+}
+
+
+
+int
+wxd2lxs_length_to_parameter(
+ double *rp,
+ wxd_object_t *pobj,
+ double t,
+ double eps,
+ dk4_er_t *erp
+)
+{
+ dk4_xsp_2d_t xs;
+ double v = 0.0;
+ double pv = 0.0;
+ size_t i;
+#if VERSION_BEFORE_20190110
+ size_t ia;
+ size_t ic;
+ size_t id;
+#endif
+ size_t ib;
+ int back = 0;
+ $? "+ wxd2lxs_length_to_parameter %g", t
+ /*
+ Check arguments
+ */
+ if ((NULL == rp) || (NULL == pobj) || (WXD_OT_O_SPLINE != pobj->ot)) {
+ $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0.0 > t) || ((double)((pobj->det).s.n) < t)) {
+ $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if (NULL == (pobj->det).s.sl) {
+ $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Sum up complete segments.
+ */
+ back = 1;
+ ib = (size_t)floor(t);
+ for (i = (size_t)0U; i < ib; i++) {
+ v += ((pobj->det).s.sl)[i];
+ } $? ". sum of %u segments: %g", (unsigned)ib, v
+ /* Calculate partial segment.
+ */
+ t -= (double)ib;
+ if (0.0 < t) {
+#if VERSION_BEFORE_20190110
+ ia = ib - (size_t)1U;
+ ic = ib + (size_t)1U;
+ id = ib + (size_t)2U;
+ dk4xsp2d_reset(&xs);
+ dk4xsp2d_reset_points(&xs);
+ dk4xsp2d_set_point(
+ &xs, ((pobj->det).s.p)[ib].x, ((pobj->det).s.p)[ib].y,
+ ((pobj->det).s.p)[ib].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xs, ((pobj->det).s.p)[ic].x, ((pobj->det).s.p)[ic].y,
+ ((pobj->det).s.p)[ic].s, 2
+ );
+ if ((size_t)0U < ib) {
+ dk4xsp2d_set_point(
+ &xs, ((pobj->det).s.p)[ia].x, ((pobj->det).s.p)[ia].y,
+ ((pobj->det).s.p)[ia].s, 0
+ );
+ }
+ if ((size_t)((pobj->det).s.n) - (size_t)2U > ib) {
+ dk4xsp2d_set_point(
+ &xs, ((pobj->det).s.p)[id].x, ((pobj->det).s.p)[id].y,
+ ((pobj->det).s.p)[id].s, 3
+ );
+ }
+#else
+ wxd2lxs_set_xspline(&xs, pobj, ib);
+#endif
+ back = dk4xsp2d_calculate_partial_length(&pv, &xs, t, eps, erp);
+ if (0 != back) {
+ v += pv; $? ". partial segment length %g", pv
+ }
+#if TRACE_DEBUG
+ else { $? "! calculation"
+ }
+#endif
+ }
+ if (0 != back) {
+ if (0 != dk4ma_is_finite(v)) {
+ *rp = v; $? ". result = %g", v
+ }
+ else {
+ back = 0;
+ dk4error_set_simple_error_code(erp, DK4_E_MATH_OVERFLOW);
+ }
+ }
+
+finished:
+ $? "- wxd2lxs_length_to_parameter %d", back
+ return back;
+}
+
+
+
+/** Function used in iteration.
+ @param d Address of destination variable for function value at x.
+ @param x X position (the t parameter).
+ @param ps A wxd2lxs_iter_t containing X-spline object, length
+ and precision.
+ @return 1 on success, 0 on error.
+*/
+
+static
+int
+iter_fct(double *d, double x, const void *ps)
+{
+ const wxd2lxs_iter_t *piter;
+ double v;
+ int back = 0;
+
+ piter = (const wxd2lxs_iter_t *)ps;
+ back = wxd2lxs_length_to_parameter(
+ &v, piter->pobj, x, piter->xslp, piter->erp
+ );
+ if (0 != back) {
+ *d = v - piter->l;
+ }
+ return back;
+}
+
+
+
+int
+wxd2lxs_parameter_for_length(
+ double *rp,
+ wxd_object_t *pobj,
+ double l,
+ double xslp,
+ double xspp,
+ dk4_er_t *erp
+)
+{
+ wxd2lxs_iter_t iter;
+ dk4_iter_ctx_t ctx;
+ unsigned long pp = 0UL;
+ int back = 0;
+ int res;
+ $? "+ wxd2lxs_parameter_for_length %g", l
+ /*
+ Check arguments.
+ */
+ if ((NULL == rp) || (NULL == pobj)) { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0.0 >= xslp) || (0.0 >= xspp)) { $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ if ((0.0 > l) || ((pobj->det).s.suml < l)) {
+ $? "! args"
+ dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS);
+ goto finished;
+ }
+ /* Set up iteration structures
+ */
+ iter.pobj = pobj;
+ iter.l = l;
+ iter.xslp = xslp;
+ iter.erp = erp;
+ dk4iter_ctx_init(&ctx);
+ dk4iter_ctx_set_eps_x(&ctx, xspp);
+ dk4iter_ctx_set_eps_y(&ctx, xspp);
+ dk4iter_ctx_set_maxpass(&ctx, 1024UL);
+ dk4iter_ctx_set_exact(&ctx, 0);
+ dk4iter_ctx_set_algorithm(&ctx, DK4_ITER_ALG_RF_ANDERSON_BJOERCK);
+ dk4iter_ctx_set_min(&ctx, 0.0);
+ dk4iter_ctx_set_max(&ctx, (double)((pobj->det).s.n - (uint16_t)1U));
+ /*
+ Run iteration
+ */
+ $? ". run iteration"
+ res = dk4iter_interval(
+ rp, &pp, iter_fct, (const void *)(&iter),
+ 0.0, (double)((pobj->det).s.n - (uint16_t)1U), &ctx
+ );
+ /* Process iteration result
+ */
+ if (DK4_ITER_RESULT_SUCCESS == res) {
+ back = 1; $? ". success after %lu passes", pp
+ }
+#if TRACE_DEBUG
+ else { $? "! iteration failed %d", res
+ }
+#endif
+
+finished:
+ $? "- wxd2lxs_parameter_for_length %d", back
+ return back;
+}
+
+
+
+void
+wxd2lxs_calculate_spline_segments(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr
+)
+{
+ dk4_xsp_2d_t xsp;
+ dk4_er_t er;
+ size_t nelem;
+ uint16_t i;
+ int res;
+ int failed;
+ $? "+ wxd2lxs_calculate_spline_segments"
+ failed = 0;
+ if (((uint16_t)1U < (pobj->det).s.n) && (NULL == (pobj->det).s.sl)) {
+ nelem = (size_t)((pobj->det).s.n - (uint16_t)1U);
+ (pobj->det).s.sl = dk4mem_new(double,nelem,NULL);
+ if (NULL != (pobj->det).s.sl) {
+ dk4xsp2d_reset(&xsp);
+ (pobj->det).s.suml = 0.0;
+ for (i = 0; i < nelem; i++) {
+ ((pobj->det).s.sl)[i] = 0.0;
+ /*
+ Calculate segment length
+ */
+#if VERSION_BEFORE_20190110
+ dk4xsp2d_reset_points(&xsp);
+ dk4xsp2d_set_point(
+ &xsp, ((pobj->det).s.p)[i].x, ((pobj->det).s.p)[i].y,
+ ((pobj->det).s.p)[i].s, 1
+ );
+ dk4xsp2d_set_point(
+ &xsp, ((pobj->det).s.p)[i+1].x, ((pobj->det).s.p)[i+1].y,
+ ((pobj->det).s.p)[i+1].s, 2
+ );
+ if (0 < i) { $? ". not left outer segment"
+ dk4xsp2d_set_point(
+ &xsp, ((pobj->det).s.p)[i-1].x,((pobj->det).s.p)[i-1].y,
+ ((pobj->det).s.p)[i-1].s, 0
+ );
+ }
+ if (nelem - 1 > i) { $? ". not right outer segment"
+ dk4xsp2d_set_point(
+ &xsp, ((pobj->det).s.p)[i+2].x,((pobj->det).s.p)[i+2].y,
+ ((pobj->det).s.p)[i+2].s, 3
+ );
+ }
+#else
+ wxd2lxs_set_xspline(&xsp, pobj, i);
+#endif
+ res = dk4xsp2d_calculate_length(
+ &(((pobj->det).s.sl)[i]), &xsp, (job->grco).xslp, NULL
+ );
+ if (0 != res) {
+ $? ". seg %u length %g", i, ((pobj->det).s.sl)[i]
+ (pobj->det).s.suml += ((pobj->det).s.sl)[i];
+ }
+ else { $? "! segment length calculation failed"
+ *backptr = 0;
+ failed = 1;
+ /* ERROR: Segment length calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 79
+ );
+ }
+ }
+ $? ". spline length = %g", (pobj->det).s.suml
+ if (0 == failed) {
+ (pobj->det).s.ts = 0.0;
+ (pobj->det).s.te = (pobj->det).s.suml;
+ if (0 != (pobj->ab).type) {
+ dk4error_init(&er);
+ res = wxd2lxs_parameter_for_length(
+ &((pobj->det).s.ts), pobj, (pobj->ab).cut,
+ (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) { $? "! cut failed"
+ (pobj->det).s.ts = -1.0;
+ *backptr = 0;
+ /* ERROR: Cut calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 80
+ );
+ }
+ else { $? ". ts = %g", (pobj->det).s.ts
+ }
+ }
+ if (0 != (pobj->af).type) {
+ dk4error_init(&er);
+ res = wxd2lxs_parameter_for_length(
+ &((pobj->det).s.te), pobj,
+ ((pobj->det).s.suml - (pobj->af).cut),
+ (job->grco).xslp, (job->grco).xspp, &er
+ );
+ if (0 == res) { $? "! cut failed"
+ (pobj->det).s.te = -1.0;
+ *backptr = 0;
+ /* ERROR: Cut calculation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 80
+ );
+ }
+ else { $? ". te = %g", (pobj->det).s.te
+ }
+ }
+ }
+ }
+ else { $? "! memory"
+ /* ERROR: Memory allocation failed */
+ dk4app_log_1(
+ job->app, job->msg, job->sz_msg, DK4_LL_ERROR, 81
+ );
+ *backptr = 0;
+ }
+ }
+#if TRACE_DEBUG
+ else { $? "! args"
+ }
+#endif
+ $? "- wxd2lxs_calculate_spline_segments"
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxd2lxs.h b/support/dktools/wxd2lxs.h
new file mode 100644
index 0000000000..56982c15a4
--- /dev/null
+++ b/support/dktools/wxd2lxs.h
@@ -0,0 +1,138 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxd2lxs.ctr
+*/
+
+#ifndef WXD2LXS_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXD2LXS_H_INCLUDED 1
+
+
+#line 9 "wxd2lxs.ctr"
+
+/** @file wxd2lxs.h X-spline handling in wxd2lat.
+*/
+
+#ifndef DK4ERROR_H_INCLUDED
+#include "dk4error.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Set up X-spline segment structure from X-spline data object.
+ @param xs X-spline segment structure to set up.
+ @param pobj X-spline object to obtain data from.
+ @param ib Segment number.
+*/
+
+void
+wxd2lxs_set_xspline(
+ dk4_xsp_2d_t *xs,
+ wxd_object_t *pobj,
+ uint16_t ib
+);
+
+
+/** Check spline object, if necessary calculate the segment lengths.
+ @param job Job structure.
+ @param drw Drawing structure.
+ @param pobj Object to process.
+ @paam backptr Address of success variable to reset on error.
+*/
+void
+wxd2lxs_calculate_spline_segments(
+ wxd2lat_job_t *job,
+ wxd_object_t *pobj,
+ int *backptr
+);
+
+
+/** Calculate coordinates and optionally direction for a given t value.
+ This function can only be used for open splines with at least one
+ arrowhead attached.
+ @param rp Address of result variable to set on success.
+ If d=0 a 2 elements array is required to store x and y.
+ If d!=0 a 3 elements array is required to store
+ x, y and alpha (direction angle).
+ @param pobj X-spline object.
+ @param t Parameter t.
+ @param d Flag: Calculate derivative values.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error (calculation failed).
+*/
+
+int
+wxd2lxs_calculate(
+ double *rp,
+ wxd_object_t *pobj,
+ double t,
+ int d,
+ dk4_er_t *erp
+);
+
+
+/** Calculate partial X-spline length from 0 to a given t value.
+ This function can only be used for open splines with at least one
+ arrowhead attached.
+ @param rp Address of result variable to set on success.
+ @param pobj X-spline object.
+ @param t Parameter t.
+ @param eps Required precision.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error (calculation failed).
+*/
+
+int
+wxd2lxs_length_to_parameter(
+ double *rp,
+ wxd_object_t *pobj,
+ double t,
+ double eps,
+ dk4_er_t *erp
+);
+
+
+/** Find t parameter for a given partial X-spline length l.
+ @param rp Address of result variable for t value.
+ @param pobj Open X-spline with arrowhead(s).
+ @param l Length to search to for.
+ @param xslp Precision for length calculation.
+ @param xspp Iteration precision for t.
+ @param erp Error report, may be NULL.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxd2lxs_parameter_for_length(
+ double *rp,
+ wxd_object_t *pobj,
+ double l,
+ double xslp,
+ double xspp,
+ dk4_er_t *erp
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/wxdarc.c b/support/dktools/wxdarc.c
new file mode 100644
index 0000000000..0ddd212371
--- /dev/null
+++ b/support/dktools/wxdarc.c
@@ -0,0 +1,385 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdarc.ctr
+*/
+
+/** @file wxdarc.c The wxdarc module.
+*/
+
+
+#line 57 "wxdarc.ctr"
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#define _USE_MATH_DEFINES
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#include "dk4error.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4MAADI_H_INCLUDED
+#include "dk4maadi.h"
+#endif
+
+#ifndef WXDARC_H_INCLUDED
+#include "wxdarc.h"
+#endif
+
+
+
+
+
+#line 87 "wxdarc.ctr"
+
+
+/*
+ The solution was found using Maxima:
+
+ eq1: r^2=(x1-xc)^2+(y1-yc)^2;
+ eq2: r^2=(x2-xc)^2+(y2-yc)^2;
+ eq3: r^2=(x3-xc)^2+(y3-yc)^2;
+ solve([eq1,eq2,eq3],[xc,yc,r]);
+
+ From the two solution triples, we use the one with non-negative radius.
+
+ The calculation can have a different number of solutions:
+
+ - No solution
+ if all points are placed on a line.
+
+ - One solution
+ for normal arcs specified by 3 different points.
+
+ - An infinite number of solutions
+ if two or all 3 points are equal.
+
+ The special cases (no solution, infinite number of solutions) will
+ result in n=0 in the function below, thus in inifinite xc and yc.
+
+ In the direction calculation we use two vectors (first vector from
+ point 1 to point 2, second vector from point 2 to point 3).
+ The z component of the vector product of these vectors is 0 if
+ the 3 points are on a line or if 2 or more points are equal.
+ The z component is positive if the rotation of the arc is positive
+ (counterclockwise).
+ For performance reasons the vector product is calculated in integer
+ arithmetics by default. If integer arithmetics results in overflow,
+ the calculation uses double values.
+
+*/
+
+
+void
+wxdarc_calculation(
+ double *pxc,
+ double *pyc,
+ double *pr,
+ double *pa,
+ double *pb,
+ int8_t *pd,
+ int32_t x1,
+ int32_t y1,
+ int32_t x2,
+ int32_t y2,
+ int32_t x3,
+ int32_t y3
+)
+{
+ dk4_er_t er; /* Error report to recognize overflow */
+ double zx; /* Divident to calculate xc */
+ double zy; /* Divident to calculate yc */
+ double n; /* Divisor to calculate xc and yc */
+ double dx1; /* Point 1 X as double */
+ double dy1; /* Point 1 Y as double */
+ double dx2; /* Point 2 X as double */
+ double dy2; /* Point 2 Y as double */
+ double dx3; /* Point 3 X as double */
+ double dy3; /* Point 3 Y as double */
+ double sx1; /* Square of point 1 X */
+ double sy1; /* Square of point 1 Y */
+ double sx2; /* Square of point 2 X */
+ double sy2; /* Square of point 2 Y */
+ double sx3; /* Square of point 3 X */
+ double sy3; /* Square of point 3 Y */
+ double xc = 0.0; /* Center point x */
+ double yc = 0.0; /* Center point y */
+ double r = 0.0; /* Radius */
+ double a = 0.0; /* Angle in radians, point 1 */
+ double b = 0.0; /* Angle in radians, point 3 */
+ double g = 0.0; /* Angle in radians, point 2 */
+ double dvp; /* Z component of vector product */
+ dk4_im_t deltax1; /* X component of first vector */
+ dk4_im_t deltay1; /* Y component of first vector */
+ dk4_im_t deltax2; /* X component of second vector */
+ dk4_im_t deltay2; /* Y component of second vector */
+ dk4_im_t vp; /* Z component of vector product */
+ int8_t d = (int8_t)0; /* Positive or negative arc direction */
+
+
+#line 172 "wxdarc.ctr"
+
+ /* Show arguments in debugging
+ */
+
+
+#line 176 "wxdarc.ctr"
+
+
+#line 177 "wxdarc.ctr"
+
+
+#line 178 "wxdarc.ctr"
+
+
+#line 179 "wxdarc.ctr"
+
+
+#line 180 "wxdarc.ctr"
+
+
+#line 181 "wxdarc.ctr"
+
+ /* Initialize result variables
+ */
+#if 0
+ /* 2020-03-24 Modification
+ Turned into initialization.
+ */
+ xc = 0.0;
+ yc = 0.0;
+ r = 0.0;
+ a = 0.0;
+ b = 0.0;
+ g = 0.0;
+ d = (int8_t)0;
+#endif
+
+ /* Convert integers to doubles
+ */
+ dx1 = (double)x1; dx2 = (double)x2; dx3 = (double)x3;
+ dy1 = (double)y1; dy2 = (double)y2; dy3 = (double)y3;
+
+ /* Find direction
+ Use integer arithmetics by default, attempt with
+ double arithmetics if integer arithmetics results in overflow.
+ */
+ dk4error_init(&er);
+ deltax1 = dk4ma_im_sub((dk4_im_t)x2, (dk4_im_t)x1, &er);
+ deltay1 = dk4ma_im_sub((dk4_im_t)y2, (dk4_im_t)y1, &er);
+ deltax2 = dk4ma_im_sub((dk4_im_t)x3, (dk4_im_t)x2, &er);
+ deltay2 = dk4ma_im_sub((dk4_im_t)y3, (dk4_im_t)y2, &er);
+ vp = dk4ma_im_sub(
+ dk4ma_im_mul(deltax1, deltay2, &er),
+ dk4ma_im_mul(deltax2, deltay1, &er),
+ &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ /*
+ No overflow occured, can use values
+ */
+ if ((dk4_im_t)0L < vp) {
+ d = (int8_t)1;
+ }
+ else {
+ if ((dk4_im_t)0L > vp) {
+ d = (int8_t)(-1);
+ }
+ }
+ }
+ else {
+ /* On integer overflow attempt calculation in double
+ */
+ if (DK4_E_MATH_OVERFLOW == er.ec) {
+ dvp = (dx2 - dx1) * (dy3 - dy2) - (dx3 - dx2) * (dy2 - dy1);
+ if (0 != dk4ma_is_finite(dvp)) {
+ if (1.0e-8 < fabs(dvp)) {
+ if (0.0 < dvp) {
+ d = (int8_t)1;
+ }
+ else {
+ d = (int8_t)(-1);
+ }
+ }
+ }
+ }
+ }
+
+ /* Attempt further calculations only if d is not 0
+ */
+ if ((int8_t)0 != d) {
+ /*
+ Calculate squares values
+ */
+ sx1 = dx1 * dx1; sx2 = dx2 * dx2; sx3 = dx3 * dx3;
+ sy1 = dy1 * dy1; sy2 = dy2 * dy2; sy3 = dy3 * dy3;
+ /*
+ Calculate determinants
+ */
+ n = 2.0 * ((dx2 - dx1) * dy3 + (dx1 - dx3) * dy2 + (dx3 - dx2) * dy1);
+ zx = (dy2-dy1)*sy3 + (sx1-sx2+sy1-sy2)*dy3
+ + dy1*sy2 + (sx3-sx1-sy1)*dy2 + (sx2-sx3)*dy1;
+ zx *= -1.0;
+ zy = (dx2-dx1)*sy3 + (dx1-dx3)*sy2 + (dx3-dx2)*sy1 + (dx2-dx1)*sx3
+ + (sx1-sx2)*dx3 + dx1*sx2 - sx1*dx2;
+ /*
+ Calculate center point
+ */
+ xc = zx / n;
+ yc = zy / n;
+ /*
+ Radius and angles
+ */
+ r = sqrt((dx1-xc)*(dx1-xc)+(dy1-yc)*(dy1-yc));
+ a = atan2((dy1-yc), (dx1-xc));
+ b = atan2((dy3-yc), (dx3-xc));
+ g = atan2((dy2-yc), (dx2-xc));
+ /*
+ Check for infinite and undefined values
+ (no solution or multiple solutions will result in division by 0)
+ */
+ if (0 == dk4ma_is_finite(xc)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(yc)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(r)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(a)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(b)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(g)) { d = (int8_t)0; }
+ /*
+ Angle corrections depending on arc direction
+ */
+ if ((int8_t)0 < d) {
+ while (g < a) { g += (2.0 * M_PI); }
+ while (b < g) { b += (2.0 * M_PI); }
+ }
+ else {
+ if ((int8_t)0 > d) {
+ while (g > a) { g -= (2.0 * M_PI); }
+ while (b > g) { b -= (2.0 * M_PI); }
+ }
+ else {
+ xc = 0.0; yc = 0.0; r = 0.0; a = 0.0; b = 0.0;
+ }
+ }
+ }
+
+ /* Transfer results to destination variables
+ */
+ if (NULL != pxc) { *pxc = xc; }
+ if (NULL != pyc) { *pyc = yc; }
+ if (NULL != pr) { *pr = r; }
+ if (NULL != pa) { *pa = a; }
+ if (NULL != pb) { *pb = b; }
+ if (NULL != pd) { *pd = d; }
+
+ /* Show results in debugging
+ */
+
+
+#line 316 "wxdarc.ctr"
+
+
+#line 317 "wxdarc.ctr"
+
+
+#line 318 "wxdarc.ctr"
+
+
+#line 319 "wxdarc.ctr"
+
+
+#line 320 "wxdarc.ctr"
+
+
+#line 321 "wxdarc.ctr"
+
+
+#line 322 "wxdarc.ctr"
+}
+
+
+
+#if TEST_WXDARC
+
+/* To build test program:
+ gcc -DTEST_WXDARC=1 -o wxdarc -I . wxdarc.c -ldk4c -ldk4ma -ldk4base -lm
+*/
+
+int
+main(int argc, char *argv[])
+{
+ int iv[6];
+ double xc = 1024.0;
+ double yc = 1024.0;
+ double r = -0.5;
+ double a = 27.0;
+ double b = 128.0;
+ int8_t d = -100;
+ int32_t x1 = 1024L;
+ int32_t y1 = 0L;
+ int32_t x2 = 724L;
+ int32_t y2 = 724L;
+ int32_t x3 = 0L;
+ int32_t y3 = 1024L;
+ int ok = 1;
+ int i;
+
+ if (7 == argc) {
+ for (i = 0; i < 6; i++) {
+ if (0 == sscanf(argv[i + 1], "%d", &(iv[i]))) {
+ ok = 0;
+ }
+ }
+ if (0 != ok) {
+ x1 = (int32_t)(iv[0]);
+ y1 = (int32_t)(iv[1]);
+ x2 = (int32_t)(iv[2]);
+ y2 = (int32_t)(iv[3]);
+ x3 = (int32_t)(iv[4]);
+ y3 = (int32_t)(iv[5]);
+ }
+ }
+
+ wxdarc_calculation(
+ &xc, &yc, &r, &a, &b, &d,
+ x1, y1, x2, y2, x3, y3
+ );
+
+ printf("x1 = %d\n", (int)x1);
+ printf("y1 = %d\n", (int)y1);
+ printf("x2 = %d\n", (int)x2);
+ printf("y2 = %d\n", (int)y2);
+ printf("x3 = %d\n", (int)x3);
+ printf("y3 = %d\n", (int)y3);
+ printf("x = %g\n", xc);
+ printf("y = %g\n", yc);
+ printf("r = %g\n", r);
+ printf("a = %g\n", a);
+ printf("b = %g\n", b);
+ printf("d = %d\n", (int)d);
+
+ return 0;
+}
+
+
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxdarc.ctr b/support/dktools/wxdarc.ctr
new file mode 100644
index 0000000000..12665877e9
--- /dev/null
+++ b/support/dktools/wxdarc.ctr
@@ -0,0 +1,393 @@
+%% options
+copyright owner = Dirk Krause
+copyright year = 2017-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+#include "dk4types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Arc calculation.
+ For 3 given points (x1;y1), (x2;y2) and (x3;y3) calculate
+ center point, radius, start and end angles and direction.
+ If there is no solution or an infinite number of solutions,
+ set the direction to 0. In this case drawing functions will draw
+ two lines instead of an arc.
+ @param pxc Address of result variable for center point x.
+ @param pyc Address of result variable for center point y.
+ @param pr Address of result variable for radius.
+ @param pa Address of result variable for start angle in radians
+ (-pi to pi).
+ @param pb Address of result variable for end angle in radians
+ (-5*pi to 5*pi).
+ @param pd Address of result variable for direction.
+ @param x1 Point 1 x.
+ @param y1 Point 1 y.
+ @param x2 Point 2 x.
+ @param y2 Point 2 y.
+ @param x3 Point 3 x.
+ @param y3 Point 3 y.
+*/
+void
+wxdarc_calculation(
+ double *pxc,
+ double *pyc,
+ double *pr,
+ double *pa,
+ double *pb,
+ int8_t *pd,
+ int32_t x1,
+ int32_t y1,
+ int32_t x2,
+ int32_t y2,
+ int32_t x3,
+ int32_t y3
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+%% module
+
+#include "dk4conf.h"
+
+#if DK4_HAVE_MATH_H
+#ifndef MATH_H_INCLUDED
+#define _USE_MATH_DEFINES
+#include <math.h>
+#define MATH_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef DK4ERROR_H_INCLUDED
+#include "dk4error.h"
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include "dk4math.h"
+#endif
+
+#ifndef DK4MAADI_H_INCLUDED
+#include "dk4maadi.h"
+#endif
+
+#ifndef WXDARC_H_INCLUDED
+#include "wxdarc.h"
+#endif
+
+
+
+$!trace-include
+
+
+/*
+ The solution was found using Maxima:
+
+ eq1: r^2=(x1-xc)^2+(y1-yc)^2;
+ eq2: r^2=(x2-xc)^2+(y2-yc)^2;
+ eq3: r^2=(x3-xc)^2+(y3-yc)^2;
+ solve([eq1,eq2,eq3],[xc,yc,r]);
+
+ From the two solution triples, we use the one with non-negative radius.
+
+ The calculation can have a different number of solutions:
+
+ - No solution
+ if all points are placed on a line.
+
+ - One solution
+ for normal arcs specified by 3 different points.
+
+ - An infinite number of solutions
+ if two or all 3 points are equal.
+
+ The special cases (no solution, infinite number of solutions) will
+ result in n=0 in the function below, thus in inifinite xc and yc.
+
+ In the direction calculation we use two vectors (first vector from
+ point 1 to point 2, second vector from point 2 to point 3).
+ The z component of the vector product of these vectors is 0 if
+ the 3 points are on a line or if 2 or more points are equal.
+ The z component is positive if the rotation of the arc is positive
+ (counterclockwise).
+ For performance reasons the vector product is calculated in integer
+ arithmetics by default. If integer arithmetics results in overflow,
+ the calculation uses double values.
+
+*/
+
+
+void
+wxdarc_calculation(
+ double *pxc,
+ double *pyc,
+ double *pr,
+ double *pa,
+ double *pb,
+ int8_t *pd,
+ int32_t x1,
+ int32_t y1,
+ int32_t x2,
+ int32_t y2,
+ int32_t x3,
+ int32_t y3
+)
+{
+ dk4_er_t er; /* Error report to recognize overflow */
+ double zx; /* Divident to calculate xc */
+ double zy; /* Divident to calculate yc */
+ double n; /* Divisor to calculate xc and yc */
+ double dx1; /* Point 1 X as double */
+ double dy1; /* Point 1 Y as double */
+ double dx2; /* Point 2 X as double */
+ double dy2; /* Point 2 Y as double */
+ double dx3; /* Point 3 X as double */
+ double dy3; /* Point 3 Y as double */
+ double sx1; /* Square of point 1 X */
+ double sy1; /* Square of point 1 Y */
+ double sx2; /* Square of point 2 X */
+ double sy2; /* Square of point 2 Y */
+ double sx3; /* Square of point 3 X */
+ double sy3; /* Square of point 3 Y */
+ double xc = 0.0; /* Center point x */
+ double yc = 0.0; /* Center point y */
+ double r = 0.0; /* Radius */
+ double a = 0.0; /* Angle in radians, point 1 */
+ double b = 0.0; /* Angle in radians, point 3 */
+ double g = 0.0; /* Angle in radians, point 2 */
+ double dvp; /* Z component of vector product */
+ dk4_im_t deltax1; /* X component of first vector */
+ dk4_im_t deltay1; /* Y component of first vector */
+ dk4_im_t deltax2; /* X component of second vector */
+ dk4_im_t deltay2; /* Y component of second vector */
+ dk4_im_t vp; /* Z component of vector product */
+ int8_t d = (int8_t)0; /* Positive or negative arc direction */
+ $? "+ wxdarc_calculation"
+
+ /* Show arguments in debugging
+ */
+ $? ". x1 = %d", (int)x1
+ $? ". y1 = %d", (int)y1
+ $? ". x2 = %d", (int)x2
+ $? ". y2 = %d", (int)y2
+ $? ". x3 = %d", (int)x3
+ $? ". y3 = %d", (int)y3
+
+ /* Initialize result variables
+ */
+#if 0
+ /* 2020-03-24 Modification
+ Turned into initialization.
+ */
+ xc = 0.0;
+ yc = 0.0;
+ r = 0.0;
+ a = 0.0;
+ b = 0.0;
+ g = 0.0;
+ d = (int8_t)0;
+#endif
+
+ /* Convert integers to doubles
+ */
+ dx1 = (double)x1; dx2 = (double)x2; dx3 = (double)x3;
+ dy1 = (double)y1; dy2 = (double)y2; dy3 = (double)y3;
+
+ /* Find direction
+ Use integer arithmetics by default, attempt with
+ double arithmetics if integer arithmetics results in overflow.
+ */
+ dk4error_init(&er);
+ deltax1 = dk4ma_im_sub((dk4_im_t)x2, (dk4_im_t)x1, &er);
+ deltay1 = dk4ma_im_sub((dk4_im_t)y2, (dk4_im_t)y1, &er);
+ deltax2 = dk4ma_im_sub((dk4_im_t)x3, (dk4_im_t)x2, &er);
+ deltay2 = dk4ma_im_sub((dk4_im_t)y3, (dk4_im_t)y2, &er);
+ vp = dk4ma_im_sub(
+ dk4ma_im_mul(deltax1, deltay2, &er),
+ dk4ma_im_mul(deltax2, deltay1, &er),
+ &er
+ );
+ if (DK4_E_NONE == er.ec) {
+ /*
+ No overflow occured, can use values
+ */
+ if ((dk4_im_t)0L < vp) {
+ d = (int8_t)1;
+ }
+ else {
+ if ((dk4_im_t)0L > vp) {
+ d = (int8_t)(-1);
+ }
+ }
+ }
+ else {
+ /* On integer overflow attempt calculation in double
+ */
+ if (DK4_E_MATH_OVERFLOW == er.ec) {
+ dvp = (dx2 - dx1) * (dy3 - dy2) - (dx3 - dx2) * (dy2 - dy1);
+ if (0 != dk4ma_is_finite(dvp)) {
+ if (1.0e-8 < fabs(dvp)) {
+ if (0.0 < dvp) {
+ d = (int8_t)1;
+ }
+ else {
+ d = (int8_t)(-1);
+ }
+ }
+ }
+ }
+ }
+
+ /* Attempt further calculations only if d is not 0
+ */
+ if ((int8_t)0 != d) {
+ /*
+ Calculate squares values
+ */
+ sx1 = dx1 * dx1; sx2 = dx2 * dx2; sx3 = dx3 * dx3;
+ sy1 = dy1 * dy1; sy2 = dy2 * dy2; sy3 = dy3 * dy3;
+ /*
+ Calculate determinants
+ */
+ n = 2.0 * ((dx2 - dx1) * dy3 + (dx1 - dx3) * dy2 + (dx3 - dx2) * dy1);
+ zx = (dy2-dy1)*sy3 + (sx1-sx2+sy1-sy2)*dy3
+ + dy1*sy2 + (sx3-sx1-sy1)*dy2 + (sx2-sx3)*dy1;
+ zx *= -1.0;
+ zy = (dx2-dx1)*sy3 + (dx1-dx3)*sy2 + (dx3-dx2)*sy1 + (dx2-dx1)*sx3
+ + (sx1-sx2)*dx3 + dx1*sx2 - sx1*dx2;
+ /*
+ Calculate center point
+ */
+ xc = zx / n;
+ yc = zy / n;
+ /*
+ Radius and angles
+ */
+ r = sqrt((dx1-xc)*(dx1-xc)+(dy1-yc)*(dy1-yc));
+ a = atan2((dy1-yc), (dx1-xc));
+ b = atan2((dy3-yc), (dx3-xc));
+ g = atan2((dy2-yc), (dx2-xc));
+ /*
+ Check for infinite and undefined values
+ (no solution or multiple solutions will result in division by 0)
+ */
+ if (0 == dk4ma_is_finite(xc)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(yc)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(r)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(a)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(b)) { d = (int8_t)0; }
+ if (0 == dk4ma_is_finite(g)) { d = (int8_t)0; }
+ /*
+ Angle corrections depending on arc direction
+ */
+ if ((int8_t)0 < d) {
+ while (g < a) { g += (2.0 * M_PI); }
+ while (b < g) { b += (2.0 * M_PI); }
+ }
+ else {
+ if ((int8_t)0 > d) {
+ while (g > a) { g -= (2.0 * M_PI); }
+ while (b > g) { b -= (2.0 * M_PI); }
+ }
+ else {
+ xc = 0.0; yc = 0.0; r = 0.0; a = 0.0; b = 0.0;
+ }
+ }
+ }
+
+ /* Transfer results to destination variables
+ */
+ if (NULL != pxc) { *pxc = xc; }
+ if (NULL != pyc) { *pyc = yc; }
+ if (NULL != pr) { *pr = r; }
+ if (NULL != pa) { *pa = a; }
+ if (NULL != pb) { *pb = b; }
+ if (NULL != pd) { *pd = d; }
+
+ /* Show results in debugging
+ */
+ $? ". xc = %g", xc
+ $? ". yc = %g", yc
+ $? ". r = %g", r
+ $? ". a = %g", a
+ $? ". b = %g", b
+ $? ". g = %g", g
+ $? "- wxdarc_calculation"
+}
+
+
+
+#if TEST_WXDARC
+
+/* To build test program:
+ gcc -DTEST_WXDARC=1 -o wxdarc -I . wxdarc.c -ldk4c -ldk4ma -ldk4base -lm
+*/
+
+int
+main(int argc, char *argv[])
+{
+ int iv[6];
+ double xc = 1024.0;
+ double yc = 1024.0;
+ double r = -0.5;
+ double a = 27.0;
+ double b = 128.0;
+ int8_t d = -100;
+ int32_t x1 = 1024L;
+ int32_t y1 = 0L;
+ int32_t x2 = 724L;
+ int32_t y2 = 724L;
+ int32_t x3 = 0L;
+ int32_t y3 = 1024L;
+ int ok = 1;
+ int i;
+
+ if (7 == argc) {
+ for (i = 0; i < 6; i++) {
+ if (0 == sscanf(argv[i + 1], "%d", &(iv[i]))) {
+ ok = 0;
+ }
+ }
+ if (0 != ok) {
+ x1 = (int32_t)(iv[0]);
+ y1 = (int32_t)(iv[1]);
+ x2 = (int32_t)(iv[2]);
+ y2 = (int32_t)(iv[3]);
+ x3 = (int32_t)(iv[4]);
+ y3 = (int32_t)(iv[5]);
+ }
+ }
+
+ wxdarc_calculation(
+ &xc, &yc, &r, &a, &b, &d,
+ x1, y1, x2, y2, x3, y3
+ );
+
+ printf("x1 = %d\n", (int)x1);
+ printf("y1 = %d\n", (int)y1);
+ printf("x2 = %d\n", (int)x2);
+ printf("y2 = %d\n", (int)y2);
+ printf("x3 = %d\n", (int)x3);
+ printf("y3 = %d\n", (int)y3);
+ printf("x = %g\n", xc);
+ printf("y = %g\n", yc);
+ printf("r = %g\n", r);
+ printf("a = %g\n", a);
+ printf("b = %g\n", b);
+ printf("d = %d\n", (int)d);
+
+ return 0;
+}
+
+
+#endif
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxdarc.h b/support/dktools/wxdarc.h
new file mode 100644
index 0000000000..5a16200708
--- /dev/null
+++ b/support/dktools/wxdarc.h
@@ -0,0 +1,73 @@
+/*
+Copyright (C) 2017-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdarc.ctr
+*/
+
+/** @file wxdarc.h Header file for the wxdarc module.
+*/
+
+#ifndef WXDARC_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDARC_H_INCLUDED 1
+
+
+#line 7 "wxdarc.ctr"
+
+#include "dk4types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Arc calculation.
+ For 3 given points (x1;y1), (x2;y2) and (x3;y3) calculate
+ center point, radius, start and end angles and direction.
+ If there is no solution or an infinite number of solutions,
+ set the direction to 0. In this case drawing functions will draw
+ two lines instead of an arc.
+ @param pxc Address of result variable for center point x.
+ @param pyc Address of result variable for center point y.
+ @param pr Address of result variable for radius.
+ @param pa Address of result variable for start angle in radians
+ (-pi to pi).
+ @param pb Address of result variable for end angle in radians
+ (-5*pi to 5*pi).
+ @param pd Address of result variable for direction.
+ @param x1 Point 1 x.
+ @param y1 Point 1 y.
+ @param x2 Point 2 x.
+ @param y2 Point 2 y.
+ @param x3 Point 3 x.
+ @param y3 Point 3 y.
+*/
+void
+wxdarc_calculation(
+ double *pxc,
+ double *pyc,
+ double *pr,
+ double *pa,
+ double *pb,
+ int8_t *pd,
+ int32_t x1,
+ int32_t y1,
+ int32_t x2,
+ int32_t y2,
+ int32_t x3,
+ int32_t y3
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#endif
diff --git a/support/dktools/wxdcomp.c b/support/dktools/wxdcomp.c
new file mode 100644
index 0000000000..b956df9dbf
--- /dev/null
+++ b/support/dktools/wxdcomp.c
@@ -0,0 +1,198 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdcomp.ctr
+*/
+
+/** @file wxdcomp.c The wxdcomp module.
+*/
+
+
+#line 50 "wxdcomp.ctr"
+
+#include "wxd2lat.h"
+
+
+
+
+
+#line 56 "wxdcomp.ctr"
+
+
+
+int
+wxd2lat_object_category(int8_t ot)
+{
+ int back = WXD_OC_CONTROL;
+
+
+#line 64 "wxdcomp.ctr"
+ switch (ot) {
+ case WXD_OT_TEXT : {
+ back = WXD_OC_TEXT ;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE : case WXD_OT_O_ARC : {
+ back = WXD_OC_OPEN ;
+ } break;
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE : case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : case WXD_OT_BOX : {
+ back = WXD_OC_CLOSED ;
+ } break;
+ case WXD_OT_IMAGE : {
+ back = WXD_OC_IMAGE ;
+ } break;
+ }
+
+
+#line 80 "wxdcomp.ctr"
+ return back;
+}
+
+
+
+static
+int
+cmp_u8(uint8_t a, uint8_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+static
+int
+cmp_i8(int8_t a, int8_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+
+#if 0
+
+static
+int
+cmp_u16(uint16_t a, uint16_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+#endif
+
+
+static
+int
+cmp_i16(int16_t a, int16_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+
+static
+int
+cmp_int(int a, int b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+
+static
+int
+cmp_dbl(double a, double b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+int
+wxd2lat_compare_object(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ const wxd_object_t *pl;
+ const wxd_object_t *pr;
+ int cal;
+ int car;
+ int back = 0;
+ DK4_UNUSED_ARG(cr)
+
+
+#line 150 "wxdcomp.ctr"
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const wxd_object_t *)l;
+ pr = (const wxd_object_t *)r;
+ back = cmp_i16(pl->lay, pr->lay);
+ if (0 == back) {
+ cal = wxd2lat_object_category(pl->ot);
+ car = wxd2lat_object_category(pr->ot);
+ back = cmp_int(cal, car);
+ if (0 == back) {
+#if 0
+ back = cmp_u16(pl->lw, pr->lw);
+#endif
+ back = cmp_dbl(pl->lw, pr->lw);
+ if (0 == back) {
+ back = cmp_u8(pl->ls, pr->ls);
+ if (0 == back) {
+ back = cmp_u8(pl->sl, pr->sl);
+ if (0 == back) {
+ back = cmp_u8(pl->js, pr->js);
+ if (0 == back) {
+ back = cmp_u8(pl->csfs, pr->csfs);
+ if (0 == back) {
+ back = cmp_u8(pl->ml, pr->ml);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[0], pr->sc[0]);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[1], pr->sc[1]);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[2], pr->sc[2]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[0], pr->fc[0]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[1], pr->fc[1]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[2], pr->fc[2]);
+ if (0 == back) {
+ back = cmp_i8(pl->ot, pr->ot);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+
+
+#line 213 "wxdcomp.ctr"
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxdcomp.ctr b/support/dktools/wxdcomp.ctr
new file mode 100644
index 0000000000..d72cad13eb
--- /dev/null
+++ b/support/dktools/wxdcomp.ctr
@@ -0,0 +1,219 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file wxdcomp.h Compare drawing objects.
+*/
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Compare drawing objects.
+ @param l Left object.
+ @param r Right object or name.
+ @param cr Comparison criteria, ignored.
+ @return Comparison result: -1: l<r, 0: l=r, 1 l>r.
+*/
+
+int
+wxd2lat_compare_object(const void *l, const void *r, int cr);
+
+
+/** Find category for object type.
+ @param ot Object type.
+ @return Category for object type.
+*/
+
+int
+wxd2lat_object_category(int8_t ot);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "wxd2lat.h"
+
+
+
+$!trace-include
+
+
+
+int
+wxd2lat_object_category(int8_t ot)
+{
+ int back = WXD_OC_CONTROL;
+ $? "+ wxd2lat_object_category %d", (int)ot
+ switch (ot) {
+ case WXD_OT_TEXT : {
+ back = WXD_OC_TEXT ;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_O_SPLINE : case WXD_OT_O_ARC : {
+ back = WXD_OC_OPEN ;
+ } break;
+ case WXD_OT_POLYGON : case WXD_OT_C_SPLINE : case WXD_OT_C_ARC :
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : case WXD_OT_BOX : {
+ back = WXD_OC_CLOSED ;
+ } break;
+ case WXD_OT_IMAGE : {
+ back = WXD_OC_IMAGE ;
+ } break;
+ }
+ $? "- wxd2lat_object_category %d", back
+ return back;
+}
+
+
+
+static
+int
+cmp_u8(uint8_t a, uint8_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+static
+int
+cmp_i8(int8_t a, int8_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+
+#if 0
+
+static
+int
+cmp_u16(uint16_t a, uint16_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+#endif
+
+
+static
+int
+cmp_i16(int16_t a, int16_t b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+
+static
+int
+cmp_int(int a, int b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+
+static
+int
+cmp_dbl(double a, double b)
+{
+ return ((a > b) ? (1) : ((a < b) ? (-1) : (0)));
+}
+
+
+int
+wxd2lat_compare_object(const void *l, const void *r, int DK4_ARG_UNUSED(cr))
+{
+ const wxd_object_t *pl;
+ const wxd_object_t *pr;
+ int cal;
+ int car;
+ int back = 0;
+ DK4_UNUSED_ARG(cr)
+ $? "+ wxd2lat_compare_object %d", cr
+ if (NULL != l) {
+ if (NULL != r) {
+ pl = (const wxd_object_t *)l;
+ pr = (const wxd_object_t *)r;
+ back = cmp_i16(pl->lay, pr->lay);
+ if (0 == back) {
+ cal = wxd2lat_object_category(pl->ot);
+ car = wxd2lat_object_category(pr->ot);
+ back = cmp_int(cal, car);
+ if (0 == back) {
+#if 0
+ back = cmp_u16(pl->lw, pr->lw);
+#endif
+ back = cmp_dbl(pl->lw, pr->lw);
+ if (0 == back) {
+ back = cmp_u8(pl->ls, pr->ls);
+ if (0 == back) {
+ back = cmp_u8(pl->sl, pr->sl);
+ if (0 == back) {
+ back = cmp_u8(pl->js, pr->js);
+ if (0 == back) {
+ back = cmp_u8(pl->csfs, pr->csfs);
+ if (0 == back) {
+ back = cmp_u8(pl->ml, pr->ml);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[0], pr->sc[0]);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[1], pr->sc[1]);
+ if (0 == back) {
+ back = cmp_u8(pl->sc[2], pr->sc[2]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[0], pr->fc[0]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[1], pr->fc[1]);
+ if (0 == back) {
+ back = cmp_u8(pl->fc[2], pr->fc[2]);
+ if (0 == back) {
+ back = cmp_i8(pl->ot, pr->ot);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else {
+ back = 1;
+ }
+ }
+ else {
+ if (NULL != r) {
+ back = -1;
+ }
+ }
+ $? "- wxd2lat_compare_object %d", back
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxdcomp.h b/support/dktools/wxdcomp.h
new file mode 100644
index 0000000000..a7cf5a2a27
--- /dev/null
+++ b/support/dktools/wxdcomp.h
@@ -0,0 +1,62 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdcomp.ctr
+*/
+
+#ifndef WXDCOMP_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDCOMP_H_INCLUDED 1
+
+
+#line 8 "wxdcomp.ctr"
+
+/** @file wxdcomp.h Compare drawing objects.
+*/
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Compare drawing objects.
+ @param l Left object.
+ @param r Right object or name.
+ @param cr Comparison criteria, ignored.
+ @return Comparison result: -1: l<r, 0: l=r, 1 l>r.
+*/
+
+int
+wxd2lat_compare_object(const void *l, const void *r, int cr);
+
+
+/** Find category for object type.
+ @param ot Object type.
+ @return Category for object type.
+*/
+
+int
+wxd2lat_object_category(int8_t ot);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/wxdenum.ctr b/support/dktools/wxdenum.ctr
new file mode 100644
index 0000000000..fb27c5ca94
--- /dev/null
+++ b/support/dktools/wxdenum.ctr
@@ -0,0 +1,423 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file wxdenum.h Enumerations for wxdkraw and wxd2lat.
+*/
+
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+
+/** Line buffer length.
+*/
+enum {
+ /** Line buffer length.
+ */
+ WXD_LINE_LENGTH = 1024
+};
+
+
+
+/** Line cap, cs component of wxd_style_closed_t.
+*/
+enum {
+ /** Butted end: cutted at specified point.
+ */
+ WXD_LC_BUTTED = DK4_GRA_LC_BUTTED ,
+
+ /** Rounded end: half circle added.
+ */
+ WXD_LC_ROUNDED = DK4_GRA_LC_ROUNDED ,
+
+ /** Projecting end: half square added.
+ */
+ WXD_LC_PROJECTING = DK4_GRA_LC_PROJECTING
+};
+
+
+
+/** Line join, js component of wxd_object_t.
+*/
+enum {
+ /** Mitered line join: Outer borders meed in an arrow.
+ */
+ WXD_LJ_MITERED = DK4_GRA_LJ_MITERED ,
+
+ /** Rounded line joing.
+ */
+ WXD_LJ_ROUNDED = DK4_GRA_LJ_ROUNDED ,
+
+ /** Beveled line join: Arrow from outer borders cutted.
+ */
+ WXD_LJ_BEVELED = DK4_GRA_LJ_BEVELED
+};
+
+
+
+/** Line styles, ls component of wxd_object_t.
+*/
+enum {
+ /** Draw solid line.
+ */
+ WXD_LS_SOLID = DK4_GRA_LS_SOLID ,
+
+ /** Dashed line.
+ */
+ WXD_LS_DASH = DK4_GRA_LS_DASH ,
+
+ /** Dotted line.
+ */
+ WXD_LS_DOT = DK4_GRA_LS_DOT ,
+
+ /** Dash dot line.
+ */
+ WXD_LS_DASH_DOT = DK4_GRA_LS_DASH_DOT ,
+
+ /** Dash dot dot line.
+ */
+ WXD_LS_DASH_DOT_DOT = DK4_GRA_LS_DASH_DOT_DOT ,
+
+ /** Dash dot dot dot line.
+ */
+ WXD_LS_DASH_DOT_DOT_DOT = DK4_GRA_LS_DASH_DOT_DOT_DOT
+};
+
+
+
+enum {
+ WXD_COLOR_NONE = 0 ,
+ WXD_COLOR_BLACK ,
+ WXD_COLOR_BLUE ,
+ WXD_COLOR_GREEN ,
+ WXD_COLOR_CYAN ,
+ WXD_COLOR_RED ,
+ WXD_COLOR_MAGENTA ,
+ WXD_COLOR_YELLOW ,
+ WXD_COLOR_WHITE ,
+ WXD_COLOR_VERY_DARK_BLUE ,
+ WXD_COLOR_DARK_BLUE ,
+ WXD_COLOR_LIGHT_BLUE ,
+ WXD_COLOR_VERY_LIGHT_BLUE ,
+ WXD_COLOR_DARK_GREEN ,
+ WXD_COLOR_LIGHT_GREEN ,
+ WXD_COLOR_VERY_LIGHT_GREEN ,
+ WXD_COLOR_DARK_CYAN ,
+ WXD_COLOR_LIGHT_CYAN ,
+ WXD_COLOR_VERY_LIGHT_CYAN ,
+ WXD_COLOR_DARK_RED ,
+ WXD_COLOR_LIGHT_RED ,
+ WXD_COLOR_VERY_LIGHT_RED ,
+ WXD_COLOR_DARK_MAGENTA ,
+ WXD_COLOR_LIGHT_MAGENTA ,
+ WXD_COLOR_VERY_LIGHT_MAGENTA ,
+ WXD_COLOR_DARK_BROWN ,
+ WXD_COLOR_BROWN ,
+ WXD_COLOR_LIGHT_BROWN ,
+ WXD_COLOR_VERY_DARK_PINK ,
+ WXD_COLOR_DARK_PINK ,
+ WXD_COLOR_LIGHT_PINK ,
+ WXD_COLOR_VERY_LIGHT_PINK ,
+ WXD_COLOR_GOLD
+};
+
+
+/** Fill styles and patterns, fs component of wxd_style_open_t.
+ From the wxd pattern fill style substract 2 to obtain
+ the dk4gra pattern fill style.
+*/
+enum {
+ /** Do not fill object.
+ */
+ WXD_FS_NONE = 0 ,
+
+ /** Fill object with pure fill color.
+ */
+ WXD_FS_PURE = 1 ,
+
+ /** Diagonal lines 30 degrees to the left.
+ */
+ WXD_FS_30_DEGREE_LEFT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_30_DEGREE_LEFT) ,
+
+ /** Diagonal lines 30 degrees to the right.
+ */
+ WXD_FS_30_DEGREE_RIGHT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_30_DEGREE_RIGHT) ,
+
+ /** Crosshatch of lines 30 degrees to the left and right.
+ */
+ WXD_FS_30_DEGREE_SIEVE =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_30_DEGREE_SIEVE) ,
+
+ /** Diagonal lines 45 degrees to the left.
+ */
+ WXD_FS_45_DEGREE_LEFT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_45_DEGREE_LEFT) ,
+
+ /** Diagonal lines 45 degrees to the left.
+ */
+ WXD_FS_45_DEGREE_RIGHT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_45_DEGREE_RIGHT) ,
+
+ /** Crosshatch of lines 45 degrees to the left and right.
+ */
+ WXD_FS_45_DEGREE_SIEVE =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_45_DEGREE_SIEVE) ,
+
+ /** Horizontal bricks.
+ */
+ WXD_FS_HORIZONTAL_BRICKS =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_BRICKS) ,
+
+ /** Vertical bricks.
+ */
+ WXD_FS_VERTICAL_BRICKS =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_BRICKS) ,
+
+ /** Horizontal lines.
+ */
+ WXD_FS_HORIZONTAL_LINES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_LINES) ,
+
+ /** Vertical lines.
+ */
+ WXD_FS_VERTICAL_LINES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_LINES) ,
+
+ /** Crosshatch of horizontal and vertical lines.
+ */
+ WXD_FS_HORIZONTAL_VERTICAL_SIEVE =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE) ,
+
+ /** Horizontal shingles skewed to the left.
+ */
+ WXD_FS_HORIZONTAL_SHINGLES_LEFT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT) ,
+
+ /** Horizontal shingles skewed to the right.
+ */
+ WXD_FS_HORIZONTAL_SHINGLES_RIGHT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT) ,
+
+ /** Vertical shingles skewed to one side.
+ */
+ WXD_FS_VERTICAL_SHINGLES_1 =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_SHINGLES_1) ,
+
+ /** Vertical shingles skewed to the other side.
+ */
+ WXD_FS_VERTICAL_SHINGLES_2 =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_SHINGLES_2) ,
+
+ /** Large fish scales.
+ */
+ WXD_FS_LARGE_FISH_SCALES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_LARGE_FISH_SCALES) ,
+
+ /** Small fish scales.
+ */
+ WXD_FS_SMALL_FISH_SCALES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_SMALL_FISH_SCALES) ,
+
+ /** Circles.
+ */
+ WXD_FS_CIRCLES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_CIRCLES) ,
+
+ /** Hexagons.
+ */
+ WXD_FS_HEXAGONS =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HEXAGONS) ,
+
+ /** Octagons.
+ */
+ WXD_FS_OCTAGONS =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_OCTAGONS) ,
+
+ /** Horizontal tire treads.
+ */
+ WXD_FS_HORIZONTAL_TIRES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_TIRES) ,
+
+ /** Vertical tire treads.
+ */
+ WXD_FS_VERTICAL_TIRES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_TIRES)
+
+};
+
+
+/** Image flags.
+*/
+enum {
+ WXD_IMFL_ASPECT = 0x01, /**< Keep aspect ratio. */
+ WXD_IMFL_USE_ALPHA = 0x02, /**< Use alpha channel for mixing. */
+ WXD_IMFL_IMG_INT = 0x04, /**< Image interpolation. */
+ WXD_IMFL_USE_DCT = 0x08, /**< Direct re-use of DCT data. */
+ WXD_IMFL_DCT_INT = 0x10, /**< Image interpolation for DCT data. */
+ WXD_IMFL_FORCE_BG = 0x20, /**< Force background from WXD file. */
+};
+
+
+/** Horizontal text alignment, al component of wxd_det_text_t.
+*/
+enum {
+ /** Left aligned.
+ */
+ WXD_TA_LEFT = DK4_TEXT_ALIGN_H_LEFT ,
+
+ /** Centered text.
+ */
+ WXD_TA_CENTERED = DK4_TEXT_ALIGN_H_CENTERED ,
+
+ /** Right aligned.
+ */
+ WXD_TA_RIGHT = DK4_TEXT_ALIGN_H_RIGHT
+};
+
+
+
+/** Object types, ot component of wxd_object_t.
+*/
+enum {
+ /** End of group (only in file).
+ */
+ WXD_OT_GROUP_END = -1 ,
+
+ /** Configuration line (only in file).
+ */
+ WXD_OT_CONFIG = 0 ,
+
+ /** Group (in memory), begin of group (in file).
+ */
+ WXD_OT_GROUP_BEGIN = 1 ,
+
+ /** Text label.
+ */
+ WXD_OT_TEXT = 2 ,
+
+ /** Polyline.
+ */
+ WXD_OT_POLYLINE = 3 ,
+
+ /** Open X-spline.
+ */
+ WXD_OT_O_SPLINE = 4 ,
+
+ /** Open arc.
+ */
+ WXD_OT_O_ARC = 5 ,
+
+ /** Polygon (closed polyline).
+ */
+ WXD_OT_POLYGON = 6 ,
+
+ /** Closed X-spline.
+ */
+ WXD_OT_C_SPLINE = 7 ,
+
+ /** Closed arc.
+ */
+ WXD_OT_C_ARC = 8 ,
+
+ /** Circle.
+ */
+ WXD_OT_CIRCLE = 9 ,
+
+ /** Ellipse.
+ */
+ WXD_OT_ELLIPSE = 10 ,
+
+ /** Rectangular box, optionally with rounded corners.
+ */
+ WXD_OT_BOX = 11 ,
+
+ /** Embedded image.
+ */
+ WXD_OT_IMAGE = 12 ,
+
+ /** Dot, filled with colour.
+ */
+ WXD_OT_DOT_FILLED = 13 ,
+
+ /** White filled dot.
+ */
+ WXD_OT_DOT_WHITE = 14
+};
+
+
+
+/** Object classes.
+*/
+enum {
+ WXD_OC_CONTROL = 0 , /**< Control elements (group, config). */
+ WXD_OC_CLOSED , /**< Closed objects (fill and stroke). */
+ WXD_OC_OPEN , /**< Open objects (stroke only). */
+ WXD_OC_TEXT , /**< Text. */
+ WXD_OC_IMAGE /**< Embedded image. */
+};
+
+
+/** Grid unit.
+*/
+enum {
+ WXD_UNIT_INCH = 0 , /**< Centimeter based grid. */
+ WXD_UNIT_CM /**< Inch based grid. */
+};
+
+
+/** How many snap grid steps per optical grid step.
+*/
+enum {
+ /** Use powers of 2.
+ At zoom factor 0 use 4 steps per centimeter,
+ 8 steps per inch.
+ */
+ WXD_GRIDBASE_2 = 0 ,
+
+ /** Multiples of 10.
+ At zoom factor 0 use 5 steps per centimeter,
+ 10 steps per inch.
+ */
+ WXD_GRIDBASE_10
+};
+
+
+
+/** Which caches need a refresh.
+*/
+enum {
+ WXD_REFRESH_NONE = 0 , /**< No rebuilt necessary, all caches up to date. */
+ WXD_REFRESH_MARKUP , /**< Markup needs refresh. */
+ WXD_REFRESH_DRAWING , /**< Drawing and markup need refresh. */
+ WXD_REFRESH_GRID /**< Refresh everything. */
+};
+
+
+
+/** Markup to apply to an object.
+*/
+enum {
+ WXD_MARKUP_NONE = 0 , /**< No markup, normal object. */
+ WXD_MARKUP_COPY , /**< Candidate for copy operation. */
+ WXD_MARKUP_MOVE , /**< Candidate for move or selection change. */
+ WXD_MARKUP_DELETE , /**< Candidate for deletion. */
+ WXD_MARKUP_GROUP , /**< Candidate for grouping or style change. */
+ WXD_MARKUP_PTMOVE , /**< Candidate for moving a point. */
+ WXD_MARKUP_IMGRES , /**< Image resize. */
+};
+
+
+
+/* vim: set ai sw=4 ts=4 : */
diff --git a/support/dktools/wxdenum.h b/support/dktools/wxdenum.h
new file mode 100644
index 0000000000..c6c71ef637
--- /dev/null
+++ b/support/dktools/wxdenum.h
@@ -0,0 +1,437 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdenum.ctr
+*/
+
+#ifndef WXDENUM_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDENUM_H_INCLUDED 1
+
+
+#line 8 "wxdenum.ctr"
+
+/** @file wxdenum.h Enumerations for wxdkraw and wxd2lat.
+*/
+
+
+#ifndef DK4TYPES_H_INCLUDED
+#include "dk4types.h"
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include "dk4gra.h"
+#endif
+
+
+/** Line buffer length.
+*/
+enum {
+ /** Line buffer length.
+ */
+ WXD_LINE_LENGTH = 1024
+};
+
+
+
+/** Line cap, cs component of wxd_style_closed_t.
+*/
+enum {
+ /** Butted end: cutted at specified point.
+ */
+ WXD_LC_BUTTED = DK4_GRA_LC_BUTTED ,
+
+ /** Rounded end: half circle added.
+ */
+ WXD_LC_ROUNDED = DK4_GRA_LC_ROUNDED ,
+
+ /** Projecting end: half square added.
+ */
+ WXD_LC_PROJECTING = DK4_GRA_LC_PROJECTING
+};
+
+
+
+/** Line join, js component of wxd_object_t.
+*/
+enum {
+ /** Mitered line join: Outer borders meed in an arrow.
+ */
+ WXD_LJ_MITERED = DK4_GRA_LJ_MITERED ,
+
+ /** Rounded line joing.
+ */
+ WXD_LJ_ROUNDED = DK4_GRA_LJ_ROUNDED ,
+
+ /** Beveled line join: Arrow from outer borders cutted.
+ */
+ WXD_LJ_BEVELED = DK4_GRA_LJ_BEVELED
+};
+
+
+
+/** Line styles, ls component of wxd_object_t.
+*/
+enum {
+ /** Draw solid line.
+ */
+ WXD_LS_SOLID = DK4_GRA_LS_SOLID ,
+
+ /** Dashed line.
+ */
+ WXD_LS_DASH = DK4_GRA_LS_DASH ,
+
+ /** Dotted line.
+ */
+ WXD_LS_DOT = DK4_GRA_LS_DOT ,
+
+ /** Dash dot line.
+ */
+ WXD_LS_DASH_DOT = DK4_GRA_LS_DASH_DOT ,
+
+ /** Dash dot dot line.
+ */
+ WXD_LS_DASH_DOT_DOT = DK4_GRA_LS_DASH_DOT_DOT ,
+
+ /** Dash dot dot dot line.
+ */
+ WXD_LS_DASH_DOT_DOT_DOT = DK4_GRA_LS_DASH_DOT_DOT_DOT
+};
+
+
+
+enum {
+ WXD_COLOR_NONE = 0 ,
+ WXD_COLOR_BLACK ,
+ WXD_COLOR_BLUE ,
+ WXD_COLOR_GREEN ,
+ WXD_COLOR_CYAN ,
+ WXD_COLOR_RED ,
+ WXD_COLOR_MAGENTA ,
+ WXD_COLOR_YELLOW ,
+ WXD_COLOR_WHITE ,
+ WXD_COLOR_VERY_DARK_BLUE ,
+ WXD_COLOR_DARK_BLUE ,
+ WXD_COLOR_LIGHT_BLUE ,
+ WXD_COLOR_VERY_LIGHT_BLUE ,
+ WXD_COLOR_DARK_GREEN ,
+ WXD_COLOR_LIGHT_GREEN ,
+ WXD_COLOR_VERY_LIGHT_GREEN ,
+ WXD_COLOR_DARK_CYAN ,
+ WXD_COLOR_LIGHT_CYAN ,
+ WXD_COLOR_VERY_LIGHT_CYAN ,
+ WXD_COLOR_DARK_RED ,
+ WXD_COLOR_LIGHT_RED ,
+ WXD_COLOR_VERY_LIGHT_RED ,
+ WXD_COLOR_DARK_MAGENTA ,
+ WXD_COLOR_LIGHT_MAGENTA ,
+ WXD_COLOR_VERY_LIGHT_MAGENTA ,
+ WXD_COLOR_DARK_BROWN ,
+ WXD_COLOR_BROWN ,
+ WXD_COLOR_LIGHT_BROWN ,
+ WXD_COLOR_VERY_DARK_PINK ,
+ WXD_COLOR_DARK_PINK ,
+ WXD_COLOR_LIGHT_PINK ,
+ WXD_COLOR_VERY_LIGHT_PINK ,
+ WXD_COLOR_GOLD
+};
+
+
+/** Fill styles and patterns, fs component of wxd_style_open_t.
+ From the wxd pattern fill style substract 2 to obtain
+ the dk4gra pattern fill style.
+*/
+enum {
+ /** Do not fill object.
+ */
+ WXD_FS_NONE = 0 ,
+
+ /** Fill object with pure fill color.
+ */
+ WXD_FS_PURE = 1 ,
+
+ /** Diagonal lines 30 degrees to the left.
+ */
+ WXD_FS_30_DEGREE_LEFT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_30_DEGREE_LEFT) ,
+
+ /** Diagonal lines 30 degrees to the right.
+ */
+ WXD_FS_30_DEGREE_RIGHT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_30_DEGREE_RIGHT) ,
+
+ /** Crosshatch of lines 30 degrees to the left and right.
+ */
+ WXD_FS_30_DEGREE_SIEVE =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_30_DEGREE_SIEVE) ,
+
+ /** Diagonal lines 45 degrees to the left.
+ */
+ WXD_FS_45_DEGREE_LEFT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_45_DEGREE_LEFT) ,
+
+ /** Diagonal lines 45 degrees to the left.
+ */
+ WXD_FS_45_DEGREE_RIGHT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_45_DEGREE_RIGHT) ,
+
+ /** Crosshatch of lines 45 degrees to the left and right.
+ */
+ WXD_FS_45_DEGREE_SIEVE =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_45_DEGREE_SIEVE) ,
+
+ /** Horizontal bricks.
+ */
+ WXD_FS_HORIZONTAL_BRICKS =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_BRICKS) ,
+
+ /** Vertical bricks.
+ */
+ WXD_FS_VERTICAL_BRICKS =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_BRICKS) ,
+
+ /** Horizontal lines.
+ */
+ WXD_FS_HORIZONTAL_LINES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_LINES) ,
+
+ /** Vertical lines.
+ */
+ WXD_FS_VERTICAL_LINES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_LINES) ,
+
+ /** Crosshatch of horizontal and vertical lines.
+ */
+ WXD_FS_HORIZONTAL_VERTICAL_SIEVE =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_VERTICAL_SIEVE) ,
+
+ /** Horizontal shingles skewed to the left.
+ */
+ WXD_FS_HORIZONTAL_SHINGLES_LEFT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_LEFT) ,
+
+ /** Horizontal shingles skewed to the right.
+ */
+ WXD_FS_HORIZONTAL_SHINGLES_RIGHT =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_SHINGLES_RIGHT) ,
+
+ /** Vertical shingles skewed to one side.
+ */
+ WXD_FS_VERTICAL_SHINGLES_1 =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_SHINGLES_1) ,
+
+ /** Vertical shingles skewed to the other side.
+ */
+ WXD_FS_VERTICAL_SHINGLES_2 =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_SHINGLES_2) ,
+
+ /** Large fish scales.
+ */
+ WXD_FS_LARGE_FISH_SCALES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_LARGE_FISH_SCALES) ,
+
+ /** Small fish scales.
+ */
+ WXD_FS_SMALL_FISH_SCALES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_SMALL_FISH_SCALES) ,
+
+ /** Circles.
+ */
+ WXD_FS_CIRCLES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_CIRCLES) ,
+
+ /** Hexagons.
+ */
+ WXD_FS_HEXAGONS =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HEXAGONS) ,
+
+ /** Octagons.
+ */
+ WXD_FS_OCTAGONS =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_OCTAGONS) ,
+
+ /** Horizontal tire treads.
+ */
+ WXD_FS_HORIZONTAL_TIRES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_HORIZONTAL_TIRES) ,
+
+ /** Vertical tire treads.
+ */
+ WXD_FS_VERTICAL_TIRES =
+ (WXD_FS_PURE + 1 + DK4_GRA_PATTERN_VERTICAL_TIRES)
+
+};
+
+
+/** Image flags.
+*/
+enum {
+ WXD_IMFL_ASPECT = 0x01, /**< Keep aspect ratio. */
+ WXD_IMFL_USE_ALPHA = 0x02, /**< Use alpha channel for mixing. */
+ WXD_IMFL_IMG_INT = 0x04, /**< Image interpolation. */
+ WXD_IMFL_USE_DCT = 0x08, /**< Direct re-use of DCT data. */
+ WXD_IMFL_DCT_INT = 0x10, /**< Image interpolation for DCT data. */
+ WXD_IMFL_FORCE_BG = 0x20, /**< Force background from WXD file. */
+};
+
+
+/** Horizontal text alignment, al component of wxd_det_text_t.
+*/
+enum {
+ /** Left aligned.
+ */
+ WXD_TA_LEFT = DK4_TEXT_ALIGN_H_LEFT ,
+
+ /** Centered text.
+ */
+ WXD_TA_CENTERED = DK4_TEXT_ALIGN_H_CENTERED ,
+
+ /** Right aligned.
+ */
+ WXD_TA_RIGHT = DK4_TEXT_ALIGN_H_RIGHT
+};
+
+
+
+/** Object types, ot component of wxd_object_t.
+*/
+enum {
+ /** End of group (only in file).
+ */
+ WXD_OT_GROUP_END = -1 ,
+
+ /** Configuration line (only in file).
+ */
+ WXD_OT_CONFIG = 0 ,
+
+ /** Group (in memory), begin of group (in file).
+ */
+ WXD_OT_GROUP_BEGIN = 1 ,
+
+ /** Text label.
+ */
+ WXD_OT_TEXT = 2 ,
+
+ /** Polyline.
+ */
+ WXD_OT_POLYLINE = 3 ,
+
+ /** Open X-spline.
+ */
+ WXD_OT_O_SPLINE = 4 ,
+
+ /** Open arc.
+ */
+ WXD_OT_O_ARC = 5 ,
+
+ /** Polygon (closed polyline).
+ */
+ WXD_OT_POLYGON = 6 ,
+
+ /** Closed X-spline.
+ */
+ WXD_OT_C_SPLINE = 7 ,
+
+ /** Closed arc.
+ */
+ WXD_OT_C_ARC = 8 ,
+
+ /** Circle.
+ */
+ WXD_OT_CIRCLE = 9 ,
+
+ /** Ellipse.
+ */
+ WXD_OT_ELLIPSE = 10 ,
+
+ /** Rectangular box, optionally with rounded corners.
+ */
+ WXD_OT_BOX = 11 ,
+
+ /** Embedded image.
+ */
+ WXD_OT_IMAGE = 12 ,
+
+ /** Dot, filled with colour.
+ */
+ WXD_OT_DOT_FILLED = 13 ,
+
+ /** White filled dot.
+ */
+ WXD_OT_DOT_WHITE = 14
+};
+
+
+
+/** Object classes.
+*/
+enum {
+ WXD_OC_CONTROL = 0 , /**< Control elements (group, config). */
+ WXD_OC_CLOSED , /**< Closed objects (fill and stroke). */
+ WXD_OC_OPEN , /**< Open objects (stroke only). */
+ WXD_OC_TEXT , /**< Text. */
+ WXD_OC_IMAGE /**< Embedded image. */
+};
+
+
+/** Grid unit.
+*/
+enum {
+ WXD_UNIT_INCH = 0 , /**< Centimeter based grid. */
+ WXD_UNIT_CM /**< Inch based grid. */
+};
+
+
+/** How many snap grid steps per optical grid step.
+*/
+enum {
+ /** Use powers of 2.
+ At zoom factor 0 use 4 steps per centimeter,
+ 8 steps per inch.
+ */
+ WXD_GRIDBASE_2 = 0 ,
+
+ /** Multiples of 10.
+ At zoom factor 0 use 5 steps per centimeter,
+ 10 steps per inch.
+ */
+ WXD_GRIDBASE_10
+};
+
+
+
+/** Which caches need a refresh.
+*/
+enum {
+ WXD_REFRESH_NONE = 0 , /**< No rebuilt necessary, all caches up to date. */
+ WXD_REFRESH_MARKUP , /**< Markup needs refresh. */
+ WXD_REFRESH_DRAWING , /**< Drawing and markup need refresh. */
+ WXD_REFRESH_GRID /**< Refresh everything. */
+};
+
+
+
+/** Markup to apply to an object.
+*/
+enum {
+ WXD_MARKUP_NONE = 0 , /**< No markup, normal object. */
+ WXD_MARKUP_COPY , /**< Candidate for copy operation. */
+ WXD_MARKUP_MOVE , /**< Candidate for move or selection change. */
+ WXD_MARKUP_DELETE , /**< Candidate for deletion. */
+ WXD_MARKUP_GROUP , /**< Candidate for grouping or style change. */
+ WXD_MARKUP_PTMOVE , /**< Candidate for moving a point. */
+ WXD_MARKUP_IMGRES , /**< Image resize. */
+};
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/wxdkclock.desktop b/support/dktools/wxdkclock.desktop
index d981e14756..77d2bddb09 100644
--- a/support/dktools/wxdkclock.desktop
+++ b/support/dktools/wxdkclock.desktop
@@ -1,6 +1,4 @@
-
[Desktop Entry]
-Encoding=UTF-8
Categories=Application;Clock;
Name=DK clock
Name[de]=Uhr
diff --git a/support/dktools/wxdkclock.h b/support/dktools/wxdkclock.h
index 59714b4793..1e23106b6f 100644
--- a/support/dktools/wxdkclock.h
+++ b/support/dktools/wxdkclock.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef H_INCLUDED_wxdkclock
/** Include file only once.
@@ -11,7 +15,9 @@
*/
#define DK3_USE_WX 1
+#ifndef DK3_ALL_H_INCLUDED
#include <dk3all.h>
+#endif
#include <wx/wxprec.h>
#ifdef __BORLANDC__
diff --git a/support/dktools/wxdkclock.rc b/support/dktools/wxdkclock.rc
index bcf22d938b..fbad166f96 100644
--- a/support/dktools/wxdkclock.rc
+++ b/support/dktools/wxdkclock.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Simple clock with one alert (GUI)\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Simple clock with one alert (GUI)\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "wxdkclock\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wxdkct.desktop b/support/dktools/wxdkct.desktop
index 4438f94103..e00fde6f00 100644
--- a/support/dktools/wxdkct.desktop
+++ b/support/dktools/wxdkct.desktop
@@ -1,6 +1,4 @@
-
[Desktop Entry]
-Encoding=UTF-8
Categories=Application;Development;
Name=wxdkct
Comment=C, C++, Objective-C and Java Tool
diff --git a/support/dktools/wxdkct.rc b/support/dktools/wxdkct.rc
index b68af65d7d..2b645e0c26 100644
--- a/support/dktools/wxdkct.rc
+++ b/support/dktools/wxdkct.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Dirk Krause's C tool (GUI)\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Dirk Krause's C tool (GUI)\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "wxdkct\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wxdkdraw.desktop b/support/dktools/wxdkdraw.desktop
new file mode 100644
index 0000000000..c7107d2c77
--- /dev/null
+++ b/support/dktools/wxdkdraw.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Categories=Application;Graphics;
+Name=wxdkdraw
+Comment=Drawing program for use with (pdf)LaTeX
+Comment[de]=Zeichenprogramm für Nutzung mit (pdf)LaTeX
+Exec=/usr/local/bin/wxdkdraw %f
+Terminal=0
+Type=Application
+Icon=/usr/local/share/dktools/wxdkdraw.ico
+MimeType=image/x-wxdkdraw
diff --git a/support/dktools/wxdkdraw.h b/support/dktools/wxdkdraw.h
new file mode 100644
index 0000000000..f7c1746719
--- /dev/null
+++ b/support/dktools/wxdkdraw.h
@@ -0,0 +1,424 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef H_INCLUDED_wxdkdraw
+/** Include file only once.
+*/
+#define H_INCLUDED_wxdkdraw 1
+
+#ifndef DK4CONF_H_INCLUDED
+#include <dk4conf.h>
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include <dk4types.h>
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include <dk4mem.h>
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include <dk4str8.h>
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#include <dk4enc.h>
+#endif
+
+#ifndef DK4LOC_H_INCLUDED
+#include <dk4loc.h>
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include <dk4math.h>
+#endif
+
+#ifndef DK4MAAI_H_INCLUDED
+#include <dk4maai.h>
+#endif
+
+#ifndef DK4MAAI16_H_INCLUDED
+#include <dk4maai16.h>
+#endif
+
+#ifndef DK4MAAU16_H_INCLUDED
+#include <dk4maau16.h>
+#endif
+
+#ifndef DK4MAAI32_H_INCLUDED
+#include <dk4maai32.h>
+#endif
+
+#ifndef DK4MAAU32_H_INCLUDED
+#include <dk4maau32.h>
+#endif
+
+#ifndef DK4MAI8DI8_H_INCLUDED
+#include <dk4mai8di8.h>
+#endif
+
+#ifndef DK4MAI8DU8_H_INCLUDED
+#include <dk4mai8du8.h>
+#endif
+
+#ifndef DK4MAI8DI16_H_INCLUDED
+#include <dk4mai8di16.h>
+#endif
+
+#ifndef DK4MAI8DU16_H_INCLUDED
+#include <dk4mai8du16.h>
+#endif
+
+#ifndef DK4MAI8DI32_H_INCLUDED
+#include <dk4mai8di32.h>
+#endif
+
+#ifndef DK4MAI8DU32_H_INCLUDED
+#include <dk4mai8du32.h>
+#endif
+
+#ifndef DK4MAI8DBL_H_INCLUDED
+#include <dk4mai8dbl.h>
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include <dk4mao8d.h>
+#endif
+
+#ifndef DK4MAO8DBL_H_INCLUDED
+#include <dk4mao8dbl.h>
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include <dk4gra.h>
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include <dk4grat.h>
+#endif
+
+#ifndef DK4XSP_H_INCLUDED
+#include <dk4xsp.h>
+#endif
+
+#ifndef DK4VERSWX_H_INCLUDED
+#include <dk4verswx.h>
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include <dk4unused.h>
+#endif
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef WX_ARRSTR_H_INCLUDED
+#include <wx/arrstr.h>
+#define WX_ARRSTR_H_INCLUDED 1
+#endif
+
+#ifndef WX_CONFIG_H_INCLUDED
+#include <wx/config.h>
+#define WX_CONFIG_H_INCLUDED 1
+#endif
+
+#ifndef WX_FILENAME_H_INCLUDED
+#include <wx/filename.h>
+#define WX_FILENAME_H_INCLUDED 1
+#endif
+
+#ifndef WX_FFILE_H_INCLUDED
+#include <wx/ffile.h>
+#define WX_FFILE_H_INCLUDED 1
+#endif
+
+#ifndef WX_GBSIZER_H_INCLUDED
+#include <wx/gbsizer.h>
+#define WX_GBSIZER_H_INCLUDED 1
+#endif
+
+#ifndef WX_THREAD_H_INCLUDED
+#include <wx/thread.h>
+#define WX_THREAD_H_INCLUDED 1
+#endif
+
+#ifndef WX_GAUGE_H_INCLUDED
+#include <wx/gauge.h>
+#define WX_GAUGE_H_INCLUDED 1
+#endif
+
+#ifndef WX_SPINCTRL_H_INCLUDED
+#include <wx/spinctrl.h>
+#define WX_SPINCTRL_H_INCLUDED 1
+#endif
+
+#ifndef WX_DCBUFFER_H_INCLUDED
+#include <wx/dcbuffer.h>
+#endif
+
+#ifndef WX_HELP_H_INCLUDED
+#include <wx/help.h>
+#define WX_HELP_H_INCLUDED 1
+#endif
+
+#ifndef WX_FS_ZIP_H_INCLUDED
+#include <wx/fs_zip.h>
+#define WX_FS_ZIP_H_INCLUDED 1
+#endif
+
+#ifndef WX_CMDLINE_H_INCLUDED
+#include <wx/cmdline.h>
+#define WX_CMDLINE_H_INCLUDED 1
+#endif
+
+#ifndef WX_DIR_H_INCLUDED
+#include <wx/dir.h>
+#define WX_DIR_H_INCLUDED 1
+#endif
+
+#ifndef WX_GRAPHICS_H_INCLUDED
+#include <wx/graphics.h>
+#define WX_GRAPHICS_H_INCLUDED 1
+#endif
+
+#ifndef WX_COLORDLG_H_INCLUDED
+#include <wx/colordlg.h>
+#define WX_COLORDLG_H_INCLUDED 1
+#endif
+
+
+
+/* __CHANGE__ 018: Add further wxWidgets header files.
+*/
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+#ifndef WXDENUM_H_INCLUDED
+#include "wxdenum.h"
+#endif
+
+#ifndef WXDARC_H_INCLUDED
+#include "wxdarc.h"
+#endif
+
+#ifndef WXDKDRAWOBJ_H_INCLUDED
+#include "WxdkdrawObj.h"
+#endif
+
+#ifndef WXDKDRAWFONT_H_INCLUDED
+#include "WxdkdrawFont.h"
+#endif
+
+#ifndef WXDKDRAWCOMP_H_INCLUDED
+#include "WxdkdrawComp.h"
+#endif
+
+#ifndef WXDKDRAWREAD_H_INCLUDED
+#include "WxdkdrawRead.h"
+#endif
+
+#ifndef WXDKDRAWWRITE_H_INCLUDED
+#include "WxdkdrawWrite.h"
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#include <dk4strx.h>
+#endif
+
+#ifndef DK4RECWX_H_INCLUDED
+#include <dk4recwx.h>
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include <dk4mpl.h>
+#endif
+
+#ifndef DK4WXAPPLICTIONHELPER_H_INCLUDED
+#include <Dk4WxApplicationHelper.h>
+#endif
+
+#ifndef DK4WXFRAME_H_INCLUDED
+#include <Dk4WxFrame.h>
+#endif
+
+#ifndef DK4WXPROGRESSDIALOG_H_INCLUDED
+#include <Dk4WxProgressDialog.h>
+#endif
+
+#ifndef DK4WXHELPCONTROLLER_H_INCLUDED
+#include <Dk4WxHelpController.h>
+#endif
+
+/* __CHANGE__ 018: Add header files for further classes and modules.
+*/
+
+
+/** Current operation or processing state, stored
+ in the m_iState member of the frame.
+*/
+enum {
+ S_NOOP = 0 , /**< No operation. */
+ S_DELETE , /**< Delete objects. */
+ S_REGION_DELETE , /**< Delete region. */
+ S_MOVE_SELECT , /**< Select objects to move. */
+ S_MOVE_PLACE , /**< Place objects when moving. */
+ S_COPY_SELECT , /**< Select objects to copy. */
+ S_COPY_PLACE , /**< Place objects when copying. */
+ S_POLY_FIRST , /**< Place first polygon/polyline point. */
+ S_POLY_FURTHER , /**< Place further polygon/polyline point. */
+ S_SPLINE_FIRST , /**< Place first spline point. */
+ S_SPLINE_FURTHER , /**< Place further spline point. */
+ S_BOX_FIRST , /**< Place first box corner. */
+ S_BOX_OPPOSITE , /**< Place opposite box corner. */
+ S_CIRCLE_CENTER , /**< Place circle center point. */
+ S_CIRCLE_RADIUS , /**< Place any circle point for radius. */
+ S_ELLIPSE_CENTER , /**< Place ellipse center point. */
+ S_ELLIPSE_CORNER , /**< Place ellipse bounding box corner point. */
+ S_ARC_1 , /**< Place arc start point. */
+ S_ARC_2 , /**< Place arc intermediate point. */
+ S_ARC_3 , /**< Place arc end point. */
+ S_DOT , /**< Place dot. */
+ S_TEXT , /**< Place text. */
+ S_IMG_1 , /**< Place first image point. */
+ S_IMG_2 , /**< Place opposite image point. */
+ S_LIBELEM_PLACE , /**< Place library element. */
+ S_MOVEPT_SELECT , /**< Move point, select point to move. */
+ S_MOVEPT_PLACE , /**< Move point, place at new position. */
+ S_DELPT , /**< Delete point from spline or polyline. */
+ S_ADDPT_SELECT , /**< Add point, select neightbour. */
+ S_ADDPT_PLACE , /**< Add point, place new point. */
+ S_DRWSZ_SELECT , /**< Change drawing size, select point. */
+ S_DRWSZ_PLACE , /**< Change drawing size, place point. */
+ S_FLIP , /**< File elements vertically or horizontally. */
+ S_GROUP_ONE , /**< Group elements one by one. */
+ S_GROUP_RECT_1 , /**< Group elements by bounding box rectangle. */
+ S_GROUP_RECT_2 , /**< Group elements by bounding box stage 2. */
+ S_UNGROUP , /**< Ungroup elements. */
+ S_DETAILS , /**< Edit object details. */
+ S_DETAILS_2 , /**< Edit object details, step 2. */
+ S_CONVERT , /**< Convert to other object types. */
+ S_ROTATE , /**< Rotate object 90 degree. */
+ S_MOD_SPLINE , /**< Modify spline s value. */
+};
+
+
+
+/** Error codes for wxdkdraw.
+*/
+enum {
+ /** Failed to read file (syntax or other).
+ */
+ WXD_E_FAILED_TO_READ_FILE = (DK4_E_HIGHEST_NUMBER + 1),
+
+ /** Failed to open file for reading.
+ */
+ WXD_E_FAILED_TO_OPEN_FILE ,
+
+ /** Mouse position not available.
+ */
+ WXD_E_MOUSE_POS_NOT_AVAILABLE ,
+
+ /** Missing export text.
+ */
+ WXD_E_NO_EXPORT_TEXT ,
+
+ /** No file name specified for image.
+ */
+ WXD_E_NO_FILENAME ,
+
+ /** Failed to retrieve coordinates from object.
+ */
+ WXD_E_GET_CONTROL_POINT ,
+
+ /** Failed to set coordinates on object.
+ */
+ WXD_E_SET_CONTROL_POINT ,
+
+ /** Numeric overflow in coordinates calculation.
+ */
+ WXD_E_OVERFLOW_COORDINATES ,
+
+ /** Failed to move an object to a group.
+ */
+ WXD_E_MOVE_TO_GROUP ,
+
+ /** Failed to ungroup an object.
+ */
+ WXD_E_UNGROUP_OBJECT ,
+
+ /** Box is too small to calculate corner radius.
+ */
+ WXD_E_BOX_TOO_SMALL ,
+
+ /** New point out of index range.
+ */
+ WXD_E_BUG_POINT_OOR ,
+
+ /** Too many points.
+ */
+ WXD_E_TOO_MANY_POINTS ,
+
+ /** Can not convert this object.
+ */
+ WXD_E_CANNOT_CONVERT ,
+
+ /** Current working directory too long.
+ */
+ WXD_E_CWD_TOO_LONG ,
+
+ /** Failed to find current working directory.
+ */
+ WXD_E_NO_CWD ,
+
+ /** Output file name too long.
+ */
+ WXD_E_OUTPUT_FN_TOO_LONG ,
+
+ /** Failed to find output directory name.
+ */
+ WXD_E_OUTPUT_DIRNAME ,
+
+
+};
+
+
+/** Resolution as double value.
+ 16256000 wxd units make up one inch.
+ 6400000 wxd units make up one centimeter.
+*/
+#define RESWXD 16256000.0
+#define CMWXD 6400000.0
+
+
+/** Layer manager checkbox structure.
+*/
+typedef struct {
+ Wxd_layer_t *lay; /**< Layer controlled by element. */
+ wxCheckBox *cb; /**< Checkbox for that layer. */
+ uint8_t oa; /**< Old active value. */
+} Wxd_layer_cb_t;
+
+
+
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxdkdraw.ico b/support/dktools/wxdkdraw.ico
new file mode 100644
index 0000000000..3babd9eafe
--- /dev/null
+++ b/support/dktools/wxdkdraw.ico
Binary files differ
diff --git a/support/dktools/wxdkdraw.rc b/support/dktools/wxdkdraw.rc
new file mode 100644
index 0000000000..5a7ffb0ae3
--- /dev/null
+++ b/support/dktools/wxdkdraw.rc
@@ -0,0 +1,37 @@
+aaaaa ICON wxdkdraw.ico
+
+#include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Drawing application for use with LaTeX\0"
+ VALUE "CompanyName", "Dirk Krause\0"
+ VALUE "FileDescription", "Drawing application for use with LaTeX\0"
+ VALUE "FileVersion", "4.30.2\0"
+ VALUE "InternalName", "wxdkdraw\0"
+ VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
+ VALUE "ProductName", "Dirk Krause's tools\0"
+ VALUE "ProductVersion", "4.30.2\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
diff --git a/support/dktools/wxdkfcs.desktop b/support/dktools/wxdkfcs.desktop
index 78b7f3f8ae..9690a181de 100644
--- a/support/dktools/wxdkfcs.desktop
+++ b/support/dktools/wxdkfcs.desktop
@@ -1,6 +1,4 @@
-
[Desktop Entry]
-Encoding=UTF-8
Categories=System;Utility;FileTools;
Name=wxdkfcs
Comment=Create file checksums
diff --git a/support/dktools/wxdkfcs.h b/support/dktools/wxdkfcs.h
index 83c293520c..5c1b16dc1a 100644
--- a/support/dktools/wxdkfcs.h
+++ b/support/dktools/wxdkfcs.h
@@ -1,14 +1,27 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef H_INCLUDED_wxdkfcs
/** Include file only once.
*/
#define H_INCLUDED_wxdkfcs 1
#ifndef DK4CONF_H_INCLUDED
-#include <dk4conf.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#ifndef DK4TYPES_H_INCLUDED
-#include <dk4types.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#ifndef WX_WXPREC_H_INCLUDED
diff --git a/support/dktools/wxdkfcs.rc b/support/dktools/wxdkfcs.rc
index dc727ba711..c00bc62fd8 100644
--- a/support/dktools/wxdkfcs.rc
+++ b/support/dktools/wxdkfcs.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Checksum builder with GUI\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Checksum builder with GUI\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "wxdkfcs\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wxdkhtb.h b/support/dktools/wxdkhtb.h
index aab823e607..a2fc0d4cb4 100644
--- a/support/dktools/wxdkhtb.h
+++ b/support/dktools/wxdkhtb.h
@@ -1,3 +1,7 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
#ifndef H_INCLUDED_wxdkhtb
/** Include file only once.
@@ -11,7 +15,10 @@
*/
#define DK3_USE_WX 1
+#ifndef DK3_ALL_H_INCLUDED
#include <dk3all.h>
+#endif
+
#if 0
#include "dkt-version.h"
#endif
diff --git a/support/dktools/wxdkhtb.rc b/support/dktools/wxdkhtb.rc
index a4aabe3027..6b5f9c903a 100644
--- a/support/dktools/wxdkhtb.rc
+++ b/support/dktools/wxdkhtb.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "HTB help file viewer (GUI)\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "HTB help file viewer (GUI)\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "wxdkhtb\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wxdkscrsz.h b/support/dktools/wxdkscrsz.h
index 2ffcec02ec..612a93d16b 100644
--- a/support/dktools/wxdkscrsz.h
+++ b/support/dktools/wxdkscrsz.h
@@ -1,10 +1,19 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef H_INCLUDED_wxdkscrsz
/** Include file only once.
*/
#define H_INCLUDED_wxdkscrsz 1
#ifndef DK4CONF_H_INCLUDED
-#include <dk4conf.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4conf.h"
+#else
+#include <dktools-4/dk4conf.h>
+#endif
#endif
#include <stdio.h>
@@ -17,7 +26,11 @@
#endif
#ifndef DK4TYPES_H_INCLUDED
-#include <dk4types.h>
+#if DK4_BUILDING_DKTOOLS4
+#include "dk4types.h"
+#else
+#include <dktools-4/dk4types.h>
+#endif
#endif
#if DK4_HAVE_WINDOWS_H
diff --git a/support/dktools/wxdkscrsz.ico b/support/dktools/wxdkscrsz.ico
index 4ce2dadf44..b074bea3aa 100644
--- a/support/dktools/wxdkscrsz.ico
+++ b/support/dktools/wxdkscrsz.ico
Binary files differ
diff --git a/support/dktools/wxdkscrsz.rc b/support/dktools/wxdkscrsz.rc
index f5524143a2..9a7c9a6512 100644
--- a/support/dktools/wxdkscrsz.rc
+++ b/support/dktools/wxdkscrsz.rc
@@ -3,8 +3,8 @@ aaaaa ICON wxdkscrsz.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Change Screen Size\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Change Screen Size\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "ChangeScreenSize\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wxdkscrsz.xpm b/support/dktools/wxdkscrsz.xpm
deleted file mode 100644
index 2da6e1f593..0000000000
--- a/support/dktools/wxdkscrsz.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static const char *xpm_wxdkscrsz[] = {
-/* width height ncolors chars_per_pixel */
-"16 16 15 1",
-/* colors */
-" c #F8DD5B",
-". c #F3E6A5",
-"X c #F2E39A",
-"o c #CAC3A0",
-"O c #FFD400",
-"+ c #A28E40",
-"@ c #A58900",
-"# c #E1D8AB",
-"$ c #F1E093",
-"% c #EDD974",
-"& c #6D5A00",
-"* c #FAD62D",
-"= c #D6D2B8",
-"- c #E4D89E",
-"; c None",
-/* pixels */
-"OOOOOOOOOOOOOOOO",
-"OOOOOOOOOOOOOOOO",
-"OOOOOOOOOOOOOOOO",
-"OOOOOOOOOOOOOOOO",
-" =X=X=X=X=X#Xoo ",
-" OOOOOOOOOO&&%%",
-"$=X#X#X#X#.+OO ",
-"$$OOOOOOOO%%OO%%",
-"--O&@@&@@O OO ",
-"$$O&O&@&OO%%OO%%",
-"--O&@@@@&O OO ",
-"$=$#$-$-$-#- %-%",
-"*#$#$-$-$-$% % *",
-"OOOOOOOOOOOOOOOO",
-"OOOOOOOOOOOOOOOO",
-"OOOOOOOOOOOOOOOO"
-};
diff --git a/support/dktools/wxdobj.c b/support/dktools/wxdobj.c
new file mode 100644
index 0000000000..4a4d5150fe
--- /dev/null
+++ b/support/dktools/wxdobj.c
@@ -0,0 +1,469 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdobj.ctr
+*/
+
+/** @file wxdobj.c The wxdobj module.
+*/
+
+
+#line 71 "wxdobj.ctr"
+
+#include "wxd2lat.h"
+
+
+
+
+
+#line 77 "wxdobj.ctr"
+
+
+
+void
+wxd2lat_object_delete(wxd_object_t *obj)
+{
+
+
+#line 84 "wxdobj.ctr"
+ if (NULL != obj) {
+
+#line 85 "wxdobj.ctr"
+ switch (obj->ot) {
+ case WXD_OT_TEXT : {
+
+#line 87 "wxdobj.ctr"
+
+
+#line 88 "wxdobj.ctr"
+
+
+#line 89 "wxdobj.ctr"
+
+
+#line 90 "wxdobj.ctr"
+
+
+#line 91 "wxdobj.ctr"
+
+
+#line 92 "wxdobj.ctr"
+
+
+#line 93 "wxdobj.ctr"
+
+
+#line 94 "wxdobj.ctr"
+ dk4mem_release(obj->det.t.t);
+ dk4mem_release(obj->det.t.tsc);
+ } break;
+ case WXD_OT_POLYLINE : {
+
+#line 98 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 100 "wxdobj.ctr"
+ {
+ uint16_t i;
+ for (i = 0; i < obj->det.p.n; i++) {
+
+
+#line 104 "wxdobj.ctr"
+
+
+#line 105 "wxdobj.ctr"
+ }
+ }
+#endif
+ dk4mem_release(obj->det.p.p);
+ } break;
+ case WXD_OT_O_SPLINE : {
+
+#line 111 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 113 "wxdobj.ctr"
+ {
+ uint16_t i;
+ for (i = 0; i < obj->det.s.n; i++) {
+
+
+#line 117 "wxdobj.ctr"
+
+
+#line 118 "wxdobj.ctr"
+
+
+#line 119 "wxdobj.ctr"
+ }
+ }
+#endif
+ dk4mem_release(obj->det.s.p);
+ dk4mem_release(obj->det.s.sl);
+ } break;
+ case WXD_OT_O_ARC : {
+
+#line 126 "wxdobj.ctr"
+ /* No dynamic components */
+#if TRACE_DEBUG
+
+
+#line 129 "wxdobj.ctr"
+
+
+#line 130 "wxdobj.ctr"
+
+
+#line 131 "wxdobj.ctr"
+
+
+#line 132 "wxdobj.ctr"
+
+
+#line 133 "wxdobj.ctr"
+#endif
+ } break;
+ case WXD_OT_POLYGON : {
+
+#line 136 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 138 "wxdobj.ctr"
+ {
+ uint16_t i;
+ for (i = 0; i < obj->det.p.n; i++) {
+
+
+#line 142 "wxdobj.ctr"
+
+
+#line 143 "wxdobj.ctr"
+ }
+ }
+#endif
+ dk4mem_release(obj->det.p.p);
+ } break;
+ case WXD_OT_C_SPLINE : {
+
+#line 149 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 151 "wxdobj.ctr"
+ {
+ uint16_t i;
+ for (i = 0; i < obj->det.s.n; i++) {
+
+
+#line 155 "wxdobj.ctr"
+
+
+#line 156 "wxdobj.ctr"
+
+
+#line 157 "wxdobj.ctr"
+ }
+ }
+#endif
+ dk4mem_release(obj->det.s.p);
+ dk4mem_release(obj->det.s.sl);
+ } break;
+ case WXD_OT_C_ARC : {
+
+#line 164 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 166 "wxdobj.ctr"
+
+
+#line 167 "wxdobj.ctr"
+
+
+#line 168 "wxdobj.ctr"
+
+
+#line 169 "wxdobj.ctr"
+
+
+#line 170 "wxdobj.ctr"
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_CIRCLE : {
+
+#line 174 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 176 "wxdobj.ctr"
+
+
+#line 177 "wxdobj.ctr"
+
+
+#line 178 "wxdobj.ctr"
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_ELLIPSE : {
+
+#line 182 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 184 "wxdobj.ctr"
+
+
+#line 185 "wxdobj.ctr"
+
+
+#line 186 "wxdobj.ctr"
+
+
+#line 187 "wxdobj.ctr"
+
+
+#line 188 "wxdobj.ctr"
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_BOX : {
+
+#line 192 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 194 "wxdobj.ctr"
+
+
+#line 195 "wxdobj.ctr"
+
+
+#line 196 "wxdobj.ctr"
+
+
+#line 197 "wxdobj.ctr"
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_IMAGE : {
+
+#line 201 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 203 "wxdobj.ctr"
+
+
+#line 204 "wxdobj.ctr"
+
+
+#line 205 "wxdobj.ctr"
+
+
+#line 206 "wxdobj.ctr"
+
+
+#line 207 "wxdobj.ctr"
+
+
+#line 208 "wxdobj.ctr"
+#endif
+ dk4mem_release(obj->det.i.fn);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+
+#line 212 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 214 "wxdobj.ctr"
+
+
+#line 215 "wxdobj.ctr"
+
+
+#line 216 "wxdobj.ctr"
+
+
+#line 217 "wxdobj.ctr"
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_DOT_WHITE : {
+
+#line 221 "wxdobj.ctr"
+#if TRACE_DEBUG
+
+
+#line 223 "wxdobj.ctr"
+
+
+#line 224 "wxdobj.ctr"
+
+
+#line 225 "wxdobj.ctr"
+
+
+#line 226 "wxdobj.ctr"
+#endif
+ /* No dynamic components */
+ } break;
+ }
+ dk4mem_free(obj);
+ }
+
+
+#line 233 "wxdobj.ctr"
+}
+
+
+void
+wxd2lat_object_initialize(wxd_object_t *optr, int8_t ot)
+{
+ if (NULL != optr) {
+ DK4_MEMRES(optr,sizeof(wxd_object_t));
+ optr->lay = 0;
+ optr->lw = 0.0;
+ optr->fc[0] = optr->fc[1] = optr->fc[2] = 255U;
+ optr->sc[0] = optr->sc[1] = optr->sc[2] = 0U;
+ if (WXD_OC_CLOSED == wxd2lat_object_category(ot)) {
+ optr->csfs = WXD_FS_PURE;
+ }
+ else {
+ optr->csfs = WXD_LC_BUTTED;
+ }
+ optr->ls = WXD_LS_SOLID;
+ optr->sl = 1U;
+ optr->js = WXD_LJ_MITERED;
+ optr->ml = 8U;
+
+#line 255 "wxdobj.ctr"
+ optr->af.type = 0U;
+ optr->af.length = 0U;
+ optr->af.width = 0U;
+ optr->af.offset = 0.0;
+ optr->af.cut = 0.0;
+ optr->af.cuttol = 0.0;
+ optr->ab.type = 0U;
+ optr->ab.length = 0U;
+ optr->ab.width = 0U;
+ optr->ab.offset = 0.0;
+ optr->ab.cut = 0.0;
+ optr->ab.cuttol = 0.0;
+ optr->ot = ot;
+ switch (ot) {
+ case WXD_OT_GROUP_BEGIN : {
+ /* Empty by intension */
+ } break;
+ case WXD_OT_TEXT : {
+ optr->det.t.t = NULL;
+ optr->det.t.tsc = NULL;
+ optr->det.t.a = 0.0;
+ optr->det.t.x = 0.0;
+ optr->det.t.y = 0.0;
+ optr->det.t.fsz = 0.0;
+ optr->det.t.find = 0U;
+ optr->det.t.al = 0U;
+ optr->det.t.fl = 0U;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ optr->det.p.p = NULL;
+ optr->det.p.n = 0U;
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ optr->det.s.p = NULL;
+ optr->det.s.sl = NULL;
+ optr->det.s.suml = -1.0;
+ optr->det.s.n = 0U;
+ optr->det.s.ts = 0.0;
+ optr->det.s.te = 0.0;
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ optr->det.a.a = 0.0;
+ optr->det.a.b = 0.0;
+ optr->det.a.x = 0L;
+ optr->det.a.y = 0L;
+ optr->det.a.r = 0UL;
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ optr->det.e.a = 0.0;
+ optr->det.e.x = 0.0;
+ optr->det.e.y = 0.0;
+ optr->det.e.rx = 0.0;
+ optr->det.e.ry = 0.0;
+ } break;
+ case WXD_OT_BOX : {
+ optr->det.b.xl = 0.0;
+ optr->det.b.xr = 0.0;
+ optr->det.b.yb = 0.0;
+ optr->det.b.yt = 0.0;
+ optr->det.b.r = -1.0;
+ } break;
+ case WXD_OT_IMAGE : {
+ optr->det.i.fn = NULL;
+ optr->det.i.x = 0.0;
+ optr->det.i.y = 0.0;
+ optr->det.i.w = 0.0;
+ optr->det.i.h = 0.0;
+ optr->det.i.fl = 0U;
+ optr->det.i.r2g = -1L;
+ } break;
+ }
+ }
+}
+
+
+
+wxd_object_t *
+wxd2lat_object_new(int8_t ot)
+{
+ wxd_object_t *back = NULL;
+ back = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxd2lat_object_initialize(back, ot);
+ }
+ return back;
+}
+
+
+
+double
+wxd2lat_object_linewidth(
+ wxd_object_t *pobj,
+ wxd_drawing_t *pdrw,
+ wxd2lat_job_t *pjob
+)
+{
+ double back = 0.45;
+ if ((NULL != pjob) && (0.0 < pjob->baselw)) {
+ back = pjob->baselw;
+ }
+ else {
+ if (
+ (NULL != pdrw)
+ && (0.0 < pdrw->baselw)
+ ) {
+ back = pdrw->baselw;
+ }
+ }
+ back = back * pobj->lw;
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxdobj.ctr b/support/dktools/wxdobj.ctr
new file mode 100644
index 0000000000..aaadb22a17
--- /dev/null
+++ b/support/dktools/wxdobj.ctr
@@ -0,0 +1,371 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file wxdobj.h Drawing objects initialization.
+*/
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+#ifndef WXD2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Initialize drawing object.
+ @param optr Drawing object to initialize.
+ @param ot Object type.
+*/
+
+void
+wxd2lat_object_initialize(wxd_object_t *optr, int8_t ot);
+
+
+/** Allocate memory for a new object and initialize it.
+ @param ot Object type.
+ @return Pointer to new object on success, NULL on error (not enough memory).
+*/
+
+wxd_object_t *
+wxd2lat_object_new(int8_t ot);
+
+
+/** Delete one drawing object, release resources.
+ @param obj Object to delete.
+*/
+
+void
+wxd2lat_object_delete(wxd_object_t *obj);
+
+
+/** Get object line width.
+ @param pobj Object to find line width for.
+ @param pdrw Drawing structure.
+ @param pjob Job structure.
+ @return Object line width in bp.
+*/
+
+double
+wxd2lat_object_linewidth(
+ wxd_object_t *pobj,
+ wxd_drawing_t *pdrw,
+ wxd2lat_job_t *pjob
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+%% module
+
+#include "wxd2lat.h"
+
+
+
+$!trace-include
+
+
+
+void
+wxd2lat_object_delete(wxd_object_t *obj)
+{
+ $? "+ wxd_object_delete"
+ if (NULL != obj) { $? ". lineno = %lu", (unsigned long)(obj->lino)
+ switch (obj->ot) {
+ case WXD_OT_TEXT : { $? ". text"
+ $? ". export text = \"%!8s\"", TR_8STR(obj->det.t.t)
+ $? ". screen text = \"%!8s\"", TR_8STR(obj->det.t.tsc)
+ $? ". x = %g", obj->det.t.x
+ $? ". y = %g", obj->det.t.y
+ $? ". a = %g", obj->det.t.a
+ $? ". f = %u", (unsigned)(obj->det.t.find)
+ $? ". sz = %u", (unsigned)(obj->det.t.fsz)
+ dk4mem_release(obj->det.t.t);
+ dk4mem_release(obj->det.t.tsc);
+ } break;
+ case WXD_OT_POLYLINE : { $? ". polyline"
+#if TRACE_DEBUG
+ $? ". points %u", (unsigned)(obj->det.p.n)
+ {
+ uint16_t i;
+ for (i = 0; i < obj->det.p.n; i++) {
+ $? ". x = %g", (obj->det.p.p)[i].x
+ $? ". y = %g", (obj->det.p.p)[i].y
+ }
+ }
+#endif
+ dk4mem_release(obj->det.p.p);
+ } break;
+ case WXD_OT_O_SPLINE : { $? ". spline"
+#if TRACE_DEBUG
+ $? ". points %u", (unsigned)(obj->det.s.n)
+ {
+ uint16_t i;
+ for (i = 0; i < obj->det.s.n; i++) {
+ $? ". x = %g", (obj->det.s.p)[i].x
+ $? ". y = %g", (obj->det.s.p)[i].y
+ $? ". s = %g", (obj->det.s.p)[i].s
+ }
+ }
+#endif
+ dk4mem_release(obj->det.s.p);
+ dk4mem_release(obj->det.s.sl);
+ } break;
+ case WXD_OT_O_ARC : { $? ". arc"
+ /* No dynamic components */
+#if TRACE_DEBUG
+ $? ". x = %ld", (long)(obj->det.a.x)
+ $? ". y = %ld", (long)(obj->det.a.y)
+ $? ". r = %lu", (unsigned long)(obj->det.a.r)
+ $? ". a = %lg", obj->det.a.a
+ $? ". b = %lg", obj->det.a.b
+#endif
+ } break;
+ case WXD_OT_POLYGON : { $? ". polygon"
+#if TRACE_DEBUG
+ $? ". points %u", (unsigned)(obj->det.p.n)
+ {
+ uint16_t i;
+ for (i = 0; i < obj->det.p.n; i++) {
+ $? ". x = %g", (obj->det.p.p)[i].x
+ $? ". y = %g", (obj->det.p.p)[i].y
+ }
+ }
+#endif
+ dk4mem_release(obj->det.p.p);
+ } break;
+ case WXD_OT_C_SPLINE : { $? ". c spline"
+#if TRACE_DEBUG
+ $? ". points %u", (unsigned)(obj->det.s.n)
+ {
+ uint16_t i;
+ for (i = 0; i < obj->det.s.n; i++) {
+ $? ". x = %g", (obj->det.s.p)[i].x
+ $? ". y = %g", (obj->det.s.p)[i].y
+ $? ". s = %g", (obj->det.s.p)[i].s
+ }
+ }
+#endif
+ dk4mem_release(obj->det.s.p);
+ dk4mem_release(obj->det.s.sl);
+ } break;
+ case WXD_OT_C_ARC : { $? ". c arc"
+#if TRACE_DEBUG
+ $? ". x = %ld", (long)(obj->det.a.x)
+ $? ". y = %ld", (long)(obj->det.a.y)
+ $? ". r = %lu", (unsigned long)(obj->det.a.r)
+ $? ". a = %lg", obj->det.a.a
+ $? ". b = %lg", obj->det.a.b
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_CIRCLE : { $? ". circle"
+#if TRACE_DEBUG
+ $? ". x = %ld", (long)(obj->det.a.x)
+ $? ". y = %ld", (long)(obj->det.a.y)
+ $? ". r = %lu", (unsigned long)(obj->det.a.r)
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_ELLIPSE : { $? ". ellipse"
+#if TRACE_DEBUG
+ $? ". x = %g", obj->det.e.x
+ $? ". y = %g", obj->det.e.y
+ $? ". r = %g", obj->det.e.rx
+ $? ". r = %g", obj->det.e.ry
+ $? ". a = %g", obj->det.e.a
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_BOX : { $? ". box"
+#if TRACE_DEBUG
+ $? ". xl = %g", obj->det.b.xl
+ $? ". xr = %g", obj->det.b.xr
+ $? ". yb = %g", obj->det.b.yb
+ $? ". yt = %g", obj->det.b.yt
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_IMAGE : { $? ". image"
+#if TRACE_DEBUG
+ $? ". fn = \"%!8s\"", TR_8STR(obj->det.i.fn)
+ $? ". x = %g", obj->det.i.x
+ $? ". y = %g", obj->det.i.y
+ $? ". w = %g", obj->det.i.w
+ $? ". h = %g", obj->det.i.h
+ $? ". fl = %u", (unsigned)(obj->det.i.fl)
+#endif
+ dk4mem_release(obj->det.i.fn);
+ } break;
+ case WXD_OT_DOT_FILLED : { $? ". dot filled"
+#if TRACE_DEBUG
+ $? ". x = %g", obj->det.d.x
+ $? ". y = %g", obj->det.d.y
+ $? ". r = %g", obj->det.d.d
+ $? ". l = %g", obj->lw
+#endif
+ /* No dynamic components */
+ } break;
+ case WXD_OT_DOT_WHITE : { $? ". dot white"
+#if TRACE_DEBUG
+ $? ". x = %g", obj->det.d.x
+ $? ". y = %g", obj->det.d.y
+ $? ". r = %g", obj->det.d.d
+ $? ". l = %g", obj->lw
+#endif
+ /* No dynamic components */
+ } break;
+ }
+ dk4mem_free(obj);
+ }
+ $? "- wxd_object_delete"
+}
+
+
+void
+wxd2lat_object_initialize(wxd_object_t *optr, int8_t ot)
+{
+ if (NULL != optr) {
+ DK4_MEMRES(optr,sizeof(wxd_object_t));
+ optr->lay = 0;
+ optr->lw = 0.0;
+ optr->fc[0] = optr->fc[1] = optr->fc[2] = 255U;
+ optr->sc[0] = optr->sc[1] = optr->sc[2] = 0U;
+ if (WXD_OC_CLOSED == wxd2lat_object_category(ot)) {
+ optr->csfs = WXD_FS_PURE;
+ }
+ else {
+ optr->csfs = WXD_LC_BUTTED;
+ }
+ optr->ls = WXD_LS_SOLID;
+ optr->sl = 1U;
+ optr->js = WXD_LJ_MITERED;
+ optr->ml = 8U; $? ". ml = 8"
+ optr->af.type = 0U;
+ optr->af.length = 0U;
+ optr->af.width = 0U;
+ optr->af.offset = 0.0;
+ optr->af.cut = 0.0;
+ optr->af.cuttol = 0.0;
+ optr->ab.type = 0U;
+ optr->ab.length = 0U;
+ optr->ab.width = 0U;
+ optr->ab.offset = 0.0;
+ optr->ab.cut = 0.0;
+ optr->ab.cuttol = 0.0;
+ optr->ot = ot;
+ switch (ot) {
+ case WXD_OT_GROUP_BEGIN : {
+ /* Empty by intension */
+ } break;
+ case WXD_OT_TEXT : {
+ optr->det.t.t = NULL;
+ optr->det.t.tsc = NULL;
+ optr->det.t.a = 0.0;
+ optr->det.t.x = 0.0;
+ optr->det.t.y = 0.0;
+ optr->det.t.fsz = 0.0;
+ optr->det.t.find = 0U;
+ optr->det.t.al = 0U;
+ optr->det.t.fl = 0U;
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ optr->det.p.p = NULL;
+ optr->det.p.n = 0U;
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ optr->det.s.p = NULL;
+ optr->det.s.sl = NULL;
+ optr->det.s.suml = -1.0;
+ optr->det.s.n = 0U;
+ optr->det.s.ts = 0.0;
+ optr->det.s.te = 0.0;
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ optr->det.a.a = 0.0;
+ optr->det.a.b = 0.0;
+ optr->det.a.x = 0L;
+ optr->det.a.y = 0L;
+ optr->det.a.r = 0UL;
+ } break;
+ case WXD_OT_CIRCLE : case WXD_OT_ELLIPSE : {
+ optr->det.e.a = 0.0;
+ optr->det.e.x = 0.0;
+ optr->det.e.y = 0.0;
+ optr->det.e.rx = 0.0;
+ optr->det.e.ry = 0.0;
+ } break;
+ case WXD_OT_BOX : {
+ optr->det.b.xl = 0.0;
+ optr->det.b.xr = 0.0;
+ optr->det.b.yb = 0.0;
+ optr->det.b.yt = 0.0;
+ optr->det.b.r = -1.0;
+ } break;
+ case WXD_OT_IMAGE : {
+ optr->det.i.fn = NULL;
+ optr->det.i.x = 0.0;
+ optr->det.i.y = 0.0;
+ optr->det.i.w = 0.0;
+ optr->det.i.h = 0.0;
+ optr->det.i.fl = 0U;
+ optr->det.i.r2g = -1L;
+ } break;
+ }
+ }
+}
+
+
+
+wxd_object_t *
+wxd2lat_object_new(int8_t ot)
+{
+ wxd_object_t *back = NULL;
+ back = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != back) {
+ wxd2lat_object_initialize(back, ot);
+ }
+ return back;
+}
+
+
+
+double
+wxd2lat_object_linewidth(
+ wxd_object_t *pobj,
+ wxd_drawing_t *pdrw,
+ wxd2lat_job_t *pjob
+)
+{
+ double back = 0.45;
+ if ((NULL != pjob) && (0.0 < pjob->baselw)) {
+ back = pjob->baselw;
+ }
+ else {
+ if (
+ (NULL != pdrw)
+ && (0.0 < pdrw->baselw)
+ ) {
+ back = pdrw->baselw;
+ }
+ }
+ back = back * pobj->lw;
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxdobj.h b/support/dktools/wxdobj.h
new file mode 100644
index 0000000000..7684760406
--- /dev/null
+++ b/support/dktools/wxdobj.h
@@ -0,0 +1,83 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdobj.ctr
+*/
+
+#ifndef WXDOBJ_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDOBJ_H_INCLUDED 1
+
+
+#line 8 "wxdobj.ctr"
+
+/** @file wxdobj.h Drawing objects initialization.
+*/
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+#ifndef WXD2LAT_H_INCLUDED
+#include "wxd2lat.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Initialize drawing object.
+ @param optr Drawing object to initialize.
+ @param ot Object type.
+*/
+
+void
+wxd2lat_object_initialize(wxd_object_t *optr, int8_t ot);
+
+
+/** Allocate memory for a new object and initialize it.
+ @param ot Object type.
+ @return Pointer to new object on success, NULL on error (not enough memory).
+*/
+
+wxd_object_t *
+wxd2lat_object_new(int8_t ot);
+
+
+/** Delete one drawing object, release resources.
+ @param obj Object to delete.
+*/
+
+void
+wxd2lat_object_delete(wxd_object_t *obj);
+
+
+/** Get object line width.
+ @param pobj Object to find line width for.
+ @param pdrw Drawing structure.
+ @param pjob Job structure.
+ @return Object line width in bp.
+*/
+
+double
+wxd2lat_object_linewidth(
+ wxd_object_t *pobj,
+ wxd_drawing_t *pdrw,
+ wxd2lat_job_t *pjob
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#endif
diff --git a/support/dktools/wxdrd.c b/support/dktools/wxdrd.c
new file mode 100644
index 0000000000..e4636e2de1
--- /dev/null
+++ b/support/dktools/wxdrd.c
@@ -0,0 +1,2827 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdrd.ctr
+*/
+
+/** @file wxdrd.c The wxdrd module.
+*/
+
+
+#line 72 "wxdrd.ctr"
+
+#include "wxd2lat.h"
+
+
+
+
+
+#line 78 "wxdrd.ctr"
+
+
+
+/** Context used while applying file contents.
+ For initialization search for text INITCONTEXT .
+*/
+typedef struct {
+ wxd_object_t tobj; /**< Temporary object filled from line. */
+ wxd_object_t *pobj; /**< Object currently created. */
+ char **parts; /**< Tokens from input line. */
+ dk4_app_t *app; /**< Application structure for diagnostics. */
+ const dkChar * const *msg; /**< Localized message texts. */
+ const dkChar *fn; /**< File name currently processed. */
+ wxd_drawing_t *drw; /**< Drawing to modify. */
+ dk4_um_t grdepth; /**< Grouping depth. */
+ dk4_um_t lineno; /**< Current line number to process. */
+ size_t szparts; /**< Number of elements in parts array. */
+ size_t nparts; /**< Number of elements used in parts array. */
+ size_t sz_msg; /**< Number of texts in msg array. */
+ uint16_t curp; /**< Index of current point to add. */
+ int st; /**< Reader state. */
+ int cc; /**< Continue: 1=yes, 0=finished, 2=abort. */
+ int back; /**< Reader process result */
+} wxd_reader_context_t;
+
+
+
+/** Reader states
+*/
+enum {
+ /** Error occured, can not continue.
+ */
+ ST_ERROR = -1 ,
+
+ /** Expecting first line containing file format info.
+ */
+ ST_FIRSTLINE = 0 ,
+
+ /** Expecting line to start an object.
+ */
+ ST_OBJECT_LINE ,
+
+ /** Expecting details line.
+ */
+ ST_DETAIL_LINE ,
+
+ /** Expecting text to export.
+ */
+ ST_TEXT_EXPORT ,
+
+ /** Expecting text to show on screen.
+ */
+ ST_TEXT_SCREEN ,
+
+ /** Expecting image file name.
+ */
+ ST_IMAGE_NAME ,
+
+ /** Attempt to resume processing.
+ */
+ ST_RESUME
+};
+
+
+
+/** Constant text fragments used by module.
+*/
+
+static const char * const wxdrd_kwnl8[] = {
+/* 0 */
+"WXD",
+
+NULL
+
+
+#line 153 "wxdrd.ctr"
+};
+
+
+
+static
+void
+wxd_object_initialize(wxd_object_t *pobj)
+{
+ DK4_MEMRES(pobj,sizeof(wxd_object_t));
+ pobj->lino = (dk4_um_t)0UL;
+}
+
+
+
+void
+wxdrd_close(wxd_drawing_t *drw)
+{
+ wxd_object_t *obj;
+
+ if (NULL != drw) {
+ if (NULL != drw->s_flat) {
+ if (NULL != drw->i_flat) {
+ dk4sto_it_reset(drw->i_flat);
+ do {
+ obj = (wxd_object_t *)dk4sto_it_next(drw->i_flat);
+ if (NULL != obj) {
+ wxd2lat_object_delete(obj);
+ }
+ } while(NULL != obj);
+ dk4sto_it_close(drw->i_flat);
+ }
+ dk4sto_close(drw->s_flat);
+ }
+ dk4mem_free(drw);
+ }
+}
+
+
+
+/** Initialize a drawing after allocating the memory.
+ @param drw Drawing to initialize.
+*/
+static
+void
+wxdrd_initialize_empty_drawing(wxd_drawing_t *drw)
+{
+ drw->s_flat = NULL;
+ drw->i_flat = NULL;
+ drw->bbxl = drw->bbxr = drw->bbyb = drw->bbyt = 0.0;
+ drw->fv_maj = 1;
+ drw->fv_min = 0;
+ drw->baselw = 0.45;
+}
+
+
+
+wxd_drawing_t *
+wxdrd_open_empty(void)
+{
+ wxd_drawing_t *back = NULL;
+ int ok = 0;
+ back = dk4mem_new(wxd_drawing_t,1,NULL);
+ if (NULL != back) {
+ wxdrd_initialize_empty_drawing(back);
+ back->s_flat = dk4sto_open(NULL);
+ if (NULL != back->s_flat) {
+ dk4sto_set_comp(back->s_flat, wxd2lat_compare_object, 0);
+ back->i_flat = dk4sto_it_open(back->s_flat, NULL);
+ if (NULL != back->i_flat) {
+ ok = 1;
+ }
+ }
+ if (0 == ok) {
+ wxdrd_close(back);
+ back = NULL;
+ }
+ }
+ return back;
+}
+
+
+
+/** Check drawing file format version against version given by numbers.
+ @param drw Drawing to check.
+ @param maj Major number of version to compare against.
+ @param min Minor number of version to compare against.
+ @return 1 if drawing version is higher, 0 for equal versions, -1
+ if drawing version is less than specified version.
+*/
+static
+int
+wxdrd_check_version(wxd_drawing_t *drw, uint16_t maj, uint16_t min)
+{
+ int back = 0;
+ if (drw->fv_maj > maj) {
+ back = 1;
+ }
+ else {
+ if (drw->fv_maj < maj) {
+ back = -1;
+ }
+ else {
+ if (drw->fv_min > min) {
+ back = 1;
+ }
+ else {
+ if (drw->fv_min < min) {
+ back = -1;
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+/** Check whether a character is a white space.
+ @param c Character to test.
+ @return 1 for space or tabulator, 0 otherwise.
+*/
+static
+int
+is_whsp(char c)
+{
+ if (' ' == c) return 1;
+ if ('\t' == c) return 1;
+ return 0;
+}
+
+
+
+/** Read double value from one of the parts, if we can still continue.
+ @param rp Address of destination variable.
+ @param pctx Context to use.
+ @param pind Index of source text in parts array.
+*/
+
+static
+void
+wxdrd_input_double(
+ double *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ double v = 0.0;
+ int res = 0;
+ if (1 == pctx->cc) {
+ res = dk4ma_input_c8_double(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 22, 23,
+ pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: ERROR Message */
+#endif
+ }
+ }
+}
+
+
+
+static
+void
+wxdrd_input_u8(
+ uint8_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ uint8_t v = 0U;
+
+ res = dk4ma_input_c8_dec_u8(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 82, 83, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: ERROR message */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_i8(
+ int8_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ int8_t v = 0U;
+
+ res = dk4ma_input_c8_dec_i8(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 84, 85, pctx->parts[pind]
+ );
+#else
+ /* ##### ERROR: Syntax */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_u16(
+ uint16_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ uint16_t v = 0U;
+
+ res = dk4ma_input_c8_dec_u16(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 86, 87, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_i16(
+ int16_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ int16_t v = 0U;
+
+ res = dk4ma_input_c8_dec_i16(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 88, 89, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_u32(
+ uint32_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ uint32_t v = 0U;
+
+ res = dk4ma_input_c8_dec_u32(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 90, 91, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_i32(
+ int32_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ int32_t v = 0U;
+
+ res = dk4ma_input_c8_dec_i32(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 92, 93, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+}
+
+
+
+/** Process first line of file containing the file type.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_filetype_line(wxd_reader_context_t *pctx, char *il)
+{
+ const char *ep;
+ int res;
+
+
+#line 528 "wxdrd.ctr"
+ pctx->nparts = dk4str8_tokenize(
+ &(pctx->parts[0]), pctx->szparts, il, NULL, NULL
+ );
+ if (3 == pctx->nparts) {
+ if (0 == strcmp(wxdrd_kwnl8[0], pctx->parts[0])) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_u16(
+ &(pctx->drw->fv_maj), pctx->parts[1], &ep, 1, NULL
+ );
+ if (0 != res) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_u16(
+ &(pctx->drw->fv_min), pctx->parts[2], &ep, 1, NULL
+ );
+ if (0 != res) {
+ pctx->st = ST_OBJECT_LINE;
+ if (0 < wxdrd_check_version(pctx->drw, 1, 0)) {
+ /* WARNING: File format version too high! */
+ /*
+ While reading the input file object of types
+ not supported by format 1.0 are ignored.
+ */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_WARNING, 94
+ );
+ }
+ }
+ else {
+
+#line 557 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ }
+ else {
+
+#line 565 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ }
+ else {
+
+#line 573 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ }
+ else {
+
+#line 581 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+
+
+#line 588 "wxdrd.ctr"
+}
+
+
+
+/** Process configuration line for bounding box.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_bounding_box_line(wxd_reader_context_t *pctx)
+{
+ int32_t i32[4];
+ const char *ep = NULL;
+ size_t i;
+ int ok = 1;
+ int res;
+
+
+#line 605 "wxdrd.ctr"
+ if (6 == pctx->nparts) {
+ for (i = 0; i < 4; i++) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_i32(
+ &(i32[i]), pctx->parts[i + 2], &ep, 1, NULL
+ );
+ if (0 == res) {
+
+#line 612 "wxdrd.ctr"
+ ok = 0 ;
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 92, 93, pctx->parts[i + 2]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+ }
+ if (1 == ok) {
+ pctx->drw->bbxl = (double)(i32[0]);
+ pctx->drw->bbxr = (double)(i32[1]);
+ pctx->drw->bbyb = (double)(i32[2]);
+ pctx->drw->bbyt = (double)(i32[3]);
+ if (
+ (pctx->drw->bbxl >= pctx->drw->bbxr)
+ || (pctx->drw->bbyb >= pctx->drw->bbyt)
+ ) {
+ /* ERROR: Illegal bounding box */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 95
+ );
+ pctx->cc = -1;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ }
+ }
+ else {
+
+#line 645 "wxdrd.ctr"
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 651 "wxdrd.ctr"
+}
+
+
+
+/** Process configuration line for base line width.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_base_line_width_line(wxd_reader_context_t *pctx)
+{
+ const char *ep = NULL;
+ int res;
+ uint32_t u32;
+
+
+#line 666 "wxdrd.ctr"
+ if (3 == pctx->nparts) {
+ res = dk4ma_input_c8_dec_u32(&u32, pctx->parts[2], &ep, 1, NULL);
+ if (0 != res) {
+ pctx->drw->baselw = ((9.0 * (double)u32) / 2032000.0);
+ if ((uint32_t)0U == u32) {
+ pctx->cc = -1;
+ /* ERROR: Base line width 0 not allowed */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 97
+ );
+ }
+ }
+ else {
+
+#line 679 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 90, 91, pctx->parts[2]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+ }
+ else {
+
+#line 692 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 699 "wxdrd.ctr"
+}
+
+
+
+/** Process configuration line.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_config_option_line(wxd_reader_context_t *pctx)
+{
+ const char *ep = NULL;
+ int res;
+ int16_t st;
+
+
+#line 714 "wxdrd.ctr"
+ if (1 < pctx->nparts) {
+ res = dk4ma_input_c8_dec_i16(&st, pctx->parts[1], &ep, 1, NULL);
+ if (0 != res) {
+ switch (st) {
+ case 0 : { /* Bounding box */
+ wxdrd_process_bounding_box_line(pctx);
+ } break;
+ case 1 : { /* Base line width */
+ wxdrd_process_base_line_width_line(pctx);
+ } break;
+ case 2 : { /* Zoom level */
+ /* Zoom level is used in the drawing application only */
+ } break;
+ case 3 : { /* Zoom center */
+ /* Zoom center is used in the drawing application only */
+ } break;
+ case 4 : { /* Grid unit */
+ /* Grid unit is used in the drawing application only */
+ } break;
+ case 5 : { /* Grid divisor base */
+ /* Grid divisor is used in the drawing application only */
+ } break;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax - Too few numbers */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 98
+ );
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax - Too few numbers */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 98
+ );
+ }
+
+
+#line 754 "wxdrd.ctr"
+}
+
+
+
+/** Read layer and colour.
+ No memory is allocated for the identifier, we just check existance.
+ @param pctx Context to modify.
+ @param isst Colour purpose (is stroke): 1=stroke, 0=fill.
+*/
+static
+void
+wxd_layer_colour(wxd_reader_context_t *pctx, int isst)
+{
+ size_t i;
+
+
+#line 769 "wxdrd.ctr"
+ wxdrd_input_i16(&(pctx->tobj.lay), pctx, 1);
+ if (0 != isst) {
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.sc[i]), pctx, (2 + i));
+ }
+ }
+ else {
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.fc[i]), pctx, (2 + i));
+ }
+ }
+
+
+#line 781 "wxdrd.ctr"
+}
+
+
+
+/** Retrieve attributes for stroked object.
+ @param pctx Context to use and modify.
+ @param addi Offset to add to indices (0 for objects without
+ a number of points, 1 for objects with variable point number).
+ @param jm Offset to add to indices (0 for objects without
+ join style and miter limit, 2 for objects with these information).
+*/
+static
+void
+wxd_stroke_attributes(wxd_reader_context_t *pctx, size_t addi, size_t jm)
+{
+ size_t i;
+ uint16_t u16 = (uint16_t)0U;
+
+
+#line 799 "wxdrd.ctr"
+ wxdrd_input_i16(&(pctx->tobj.lay), pctx, (1 + addi));
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.sc[i]), pctx, (2 + addi + i));
+ }
+ wxdrd_input_u16(&u16, pctx, (5 + addi));
+ pctx->tobj.lw = (double)u16;
+ wxdrd_input_u8(&(pctx->tobj.ls), pctx, (6 + addi));
+ if (WXD_LS_DASH_DOT_DOT_DOT < pctx->tobj.ls) {
+ pctx->tobj.ls = WXD_LS_DASH_DOT_DOT_DOT;
+ /* WARNING: Line style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 99
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.sl), pctx, (7 + addi));
+ if (1 > pctx->tobj.sl) {
+ pctx->tobj.sl = 1;
+ /* WARNING: Style length corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 100
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.csfs), pctx, (8 + addi));
+ if (WXD_LC_PROJECTING < pctx->tobj.csfs) {
+ pctx->tobj.csfs = WXD_LC_PROJECTING;
+ /* WARNING: Cap style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 101
+ );
+ }
+ if (2 == jm) {
+ wxdrd_input_u8(&(pctx->tobj.js), pctx, (9 + addi));
+ if (WXD_LJ_BEVELED < pctx->tobj.js) {
+ pctx->tobj.js = WXD_LJ_BEVELED;
+ /* WARNING: Join style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 102
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ml), pctx, (10 + addi));
+
+
+#line 840 "wxdrd.ctr"
+ if (1U > pctx->tobj.ml) {
+ pctx->tobj.ml = 1U;
+ /* WARNING: Miter limit corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 103
+ );
+ }
+ }
+ wxdrd_input_u8(&(pctx->tobj.af.type), pctx, ( 9 + jm + addi));
+ if (29U < pctx->tobj.af.type) {
+ pctx->tobj.af.type = 29U;
+ /* WARNING: Forward arrow type corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 104
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.af.length), pctx, (10 + jm + addi));
+ if (1U > pctx->tobj.af.length) {
+ pctx->tobj.af.length = 1U;
+ /* WARNING: Forward arrow length corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 106
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.af.width), pctx, (11 + jm + addi));
+ if (1U > pctx->tobj.af.width) {
+ pctx->tobj.af.width = 1U;
+ /* WARNING: Forward arrow width corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 108
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ab.type), pctx, (12 + jm + addi));
+ if (29U < pctx->tobj.ab.type) {
+ pctx->tobj.ab.type = 29U;
+ /* WARNING: Backward arrow type corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 105
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ab.length), pctx, (13 + jm + addi));
+ if (1U > pctx->tobj.ab.length) {
+ pctx->tobj.ab.length = 1U;
+ /* WARNING: Backward arrow length corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 107
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ab.width), pctx, (14 + jm + addi));
+ if (1U > pctx->tobj.ab.width) {
+ pctx->tobj.ab.width = 1U;
+ /* WARNING: Backward arrow width corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 109
+ );
+ }
+
+
+#line 897 "wxdrd.ctr"
+}
+
+
+
+static
+void
+wxd_fill_stroke_attributes(wxd_reader_context_t *pctx, size_t addi, int js)
+{
+ size_t i;
+ uint16_t u16 = (uint16_t)0U;
+
+
+#line 908 "wxdrd.ctr"
+ wxdrd_input_i16(&(pctx->tobj.lay), pctx, (1 + addi));
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.sc[i]), pctx, (2 + addi + i));
+ }
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.fc[i]), pctx, (5 + addi + i));
+ }
+ wxdrd_input_u16(&u16, pctx, (8 + addi));
+ pctx->tobj.lw = (double)u16;
+ wxdrd_input_u8(&(pctx->tobj.ls), pctx, (9 + addi));
+ if (WXD_LS_DASH_DOT_DOT_DOT < pctx->tobj.ls) {
+ pctx->tobj.ls = WXD_LS_DASH_DOT_DOT_DOT;
+ /* WARNING: Line style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 99
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.sl), pctx, (10 + addi));
+ if (1 > pctx->tobj.sl) {
+ pctx->tobj.sl = 1;
+ /* WARNING: Style length corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 100
+ );
+ }
+ if (1 == js) {
+ wxdrd_input_u8(&(pctx->tobj.js), pctx, (11 + addi));
+ if (WXD_LJ_BEVELED < pctx->tobj.js) {
+ pctx->tobj.js = WXD_LJ_BEVELED;
+ /* WARNING: Join style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 102
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ml), pctx, (12 + addi));
+
+
+#line 944 "wxdrd.ctr"
+ if (1U > pctx->tobj.ml) {
+ pctx->tobj.ml = 1U;
+ /* WARNING: Miter limit corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 103
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.csfs), pctx, (13 + addi));
+ if (WXD_FS_VERTICAL_TIRES < pctx->tobj.csfs) {
+ pctx->tobj.csfs = WXD_FS_VERTICAL_TIRES;
+ /* WARNING: Fill style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 110
+ );
+ }
+ }
+ else {
+ wxdrd_input_u8(&(pctx->tobj.csfs), pctx, (11 + addi));
+ if (WXD_FS_VERTICAL_TIRES < pctx->tobj.csfs) {
+ pctx->tobj.csfs = WXD_FS_VERTICAL_TIRES;
+ /* WARNING: Fill style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 110
+ );
+ }
+ }
+
+
+#line 971 "wxdrd.ctr"
+}
+
+
+
+/** Add object pobj to drawing.
+ @param pctx Context to modify, contains both drw and pobj.
+ @param idin Index of identifier in parts array.
+*/
+static
+void
+wxdrd_add_object(wxd_reader_context_t *pctx)
+{
+ if ((NULL != pctx->pobj) && (1 == pctx->cc)) {
+ if (0 == dk4sto_add(pctx->drw->s_flat, pctx->pobj, NULL)) {
+ wxd2lat_object_delete(pctx->pobj);
+ pctx->pobj = NULL;
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+}
+
+
+
+/** Process object start line for text object.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_text_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1004 "wxdrd.ctr"
+ if (5 == pctx->nparts) {
+ wxd_layer_colour(pctx, 0);
+ if (1 == pctx->cc) {
+ /*
+ Set details to reasonable defaults before creating
+ a dynamic copy of the object
+ */
+ pctx->tobj.det.t.t = NULL;
+ pctx->tobj.det.t.tsc = NULL;
+ pctx->tobj.det.t.a = 0.0;
+ pctx->tobj.det.t.x = 0.0;
+ pctx->tobj.det.t.y = 0.0;
+ pctx->tobj.det.t.fsz = 12U;
+ pctx->tobj.det.t.find = 0;
+ pctx->tobj.det.t.al = WXD_TA_LEFT;
+ pctx->tobj.det.t.fl = 0;
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ /*
+ Create dynamic copy and register interest in the details
+ */
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1046 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for polyline object.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_polyline_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1058 "wxdrd.ctr"
+ if (18 == pctx->nparts) {
+ pctx->tobj.det.p.p = NULL;
+ pctx->tobj.det.p.n = 0;
+ wxdrd_input_u16(&(pctx->tobj.det.p.n), pctx, 1);
+ if (1 == pctx->cc) {
+ wxd_stroke_attributes(pctx, 1, 2);
+ if (2 > pctx->tobj.det.p.n) {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ pctx->pobj->det.p.p =
+ dk4mem_new(wxd_point_t,pctx->tobj.det.p.n,NULL);
+ if (NULL != pctx->pobj->det.p.p) {
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ dk4mem_free(pctx->pobj);
+ pctx->pobj = NULL;
+ pctx->cc = -1;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1105 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for open spline.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_ospline_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1117 "wxdrd.ctr"
+ if (18 == pctx->nparts) {
+ pctx->tobj.det.s.p = NULL;
+ pctx->tobj.det.s.sl = NULL;
+ pctx->tobj.det.s.n = 0;
+ pctx->tobj.det.s.ts = 0.0;
+ wxdrd_input_u16(&(pctx->tobj.det.s.n), pctx, 1);
+ pctx->tobj.det.s.te = (double)((pctx->tobj).det.s.n - (uint16_t)1U);
+ if (1 == pctx->cc) {
+ wxd_stroke_attributes(pctx, 1, 2);
+ if (2 > pctx->tobj.det.s.n) {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ pctx->pobj->det.s.p =
+ dk4mem_new(wxd_spline_point_t,pctx->tobj.det.s.n,NULL);
+ if (NULL != pctx->pobj->det.s.p) {
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ dk4mem_free(pctx->pobj);
+ pctx->pobj = NULL;
+ pctx->cc = -1;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1167 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for open arc.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_oarc_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1179 "wxdrd.ctr"
+ if (15 == pctx->nparts) {
+ pctx->tobj.det.a.a = 0.0;
+ pctx->tobj.det.a.b = 0.0;
+ pctx->tobj.det.a.x = 0L;
+ pctx->tobj.det.a.y = 0L;
+ pctx->tobj.det.a.r = 0UL;
+ wxd_stroke_attributes(pctx, 0, 0);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1210 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for polygon.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_polygon_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1222 "wxdrd.ctr"
+ if (15 == pctx->nparts) {
+ pctx->tobj.det.p.p = NULL;
+ pctx->tobj.det.p.n = 0;
+ wxdrd_input_u16(&(pctx->tobj.det.p.n), pctx, 1);
+ if (1 == pctx->cc) {
+ wxd_fill_stroke_attributes(pctx, 1, 1);
+ if (2 > pctx->tobj.det.p.n) {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ pctx->pobj->det.p.p =
+ dk4mem_new(wxd_point_t,pctx->tobj.det.p.n,NULL);
+ if (NULL != pctx->pobj->det.p.p) {
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ dk4mem_free(pctx->pobj);
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1270 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for closed spline.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_cspline_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1282 "wxdrd.ctr"
+ if (15 == pctx->nparts) {
+ pctx->tobj.det.s.p = NULL;
+ pctx->tobj.det.s.sl = NULL;
+ pctx->tobj.det.s.n = 0;
+ wxdrd_input_u16(&(pctx->tobj.det.s.n), pctx, 1);
+ if (1 == pctx->cc) {
+ wxd_fill_stroke_attributes(pctx, 1, 1);
+ if (2 > pctx->tobj.det.s.n) {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ pctx->pobj->det.s.p =
+ dk4mem_new(wxd_spline_point_t,pctx->tobj.det.s.n,NULL);
+ if (NULL != pctx->pobj->det.s.p) {
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ dk4mem_free(pctx->pobj);
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1331 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for closed arc.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_carc_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1343 "wxdrd.ctr"
+ if (14 == pctx->nparts) {
+ pctx->tobj.det.a.a = 0.0;
+ pctx->tobj.det.a.b = 0.0;
+ pctx->tobj.det.a.x = 0L;
+ pctx->tobj.det.a.y = 0L;
+ pctx->tobj.det.a.r = 0UL;
+ wxd_fill_stroke_attributes(pctx, 0, 1);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1374 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for ellipse.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_ellipse_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1386 "wxdrd.ctr"
+ if (12 == pctx->nparts) {
+ pctx->tobj.det.e.a = 0.0;
+ pctx->tobj.det.e.x = 0.0;
+ pctx->tobj.det.e.y = 0.0;
+ pctx->tobj.det.e.rx = 0.0;
+ pctx->tobj.det.e.ry = 0.0;
+ wxd_fill_stroke_attributes(pctx, 0, 0);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ }
+
+
+#line 1413 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for box.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_box_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1425 "wxdrd.ctr"
+ if (12 == pctx->nparts) {
+ pctx->tobj.det.b.xl = 0.0;
+ pctx->tobj.det.b.xr = 0.0;
+ pctx->tobj.det.b.yb = 0.0;
+ pctx->tobj.det.b.yt = 0.0;
+ pctx->tobj.det.b.r = -1.0;
+ wxd_fill_stroke_attributes(pctx, 0, 0);
+ pctx->tobj.js = WXD_LJ_MITERED;
+ pctx->tobj.ml = 8U;
+
+#line 1434 "wxdrd.ctr"
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1458 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for embedded image.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_image_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1470 "wxdrd.ctr"
+ if (5 == pctx->nparts) {
+ pctx->tobj.det.i.fn = NULL;
+ pctx->tobj.det.i.x = 0.0;
+ pctx->tobj.det.i.y = 0.0;
+ pctx->tobj.det.i.w = 0.0;
+ pctx->tobj.det.i.h = 0.0;
+ pctx->tobj.det.i.fl = 0U;
+ pctx->tobj.det.i.r2g = 0;
+ pctx->tobj.det.i.r2c = 0;
+ wxd_layer_colour(pctx, 0);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1504 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for filled dot.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_filled_dot_start_line(wxd_reader_context_t *pctx)
+{
+ size_t i;
+
+
+#line 1517 "wxdrd.ctr"
+ if (5 == pctx->nparts) {
+ pctx->tobj.det.d.x = 0.0;
+ pctx->tobj.det.d.y = 0.0;
+ pctx->tobj.det.d.d = 0.0;
+ pctx->tobj.lw = 0.0;
+ wxd_layer_colour(pctx, 0);
+ for (i = 0; i < 3; i++) { pctx->tobj.sc[i] = pctx->tobj.fc[i]; }
+ pctx->tobj.csfs = WXD_FS_PURE;
+ if (1 == pctx->cc ) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1549 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for white filled dot.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_white_dot_start_line(wxd_reader_context_t *pctx)
+{
+ size_t i;
+
+
+#line 1562 "wxdrd.ctr"
+ if (5 == pctx->nparts) {
+ pctx->tobj.det.d.x = 0.0;
+ pctx->tobj.det.d.y = 0.0;
+ pctx->tobj.det.d.d = 0.0;
+ pctx->tobj.lw = 0.0;
+ wxd_layer_colour(pctx, 1);
+ for (i = 0; i < 3; i++) { pctx->tobj.fc[i] = 255; }
+ pctx->tobj.csfs = WXD_FS_PURE;
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1594 "wxdrd.ctr"
+}
+
+
+
+/** Process object start line for circle.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_circle_start_line(wxd_reader_context_t *pctx)
+{
+
+
+#line 1606 "wxdrd.ctr"
+ if (12 == pctx->nparts) {
+ pctx->tobj.det.e.a = 0.0;
+ pctx->tobj.det.e.x = 0.0;
+ pctx->tobj.det.e.y = 0.0;
+ pctx->tobj.det.e.rx = 0.0;
+ pctx->tobj.det.e.ry = 0.0;
+ wxd_fill_stroke_attributes(pctx, 0, 0);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1637 "wxdrd.ctr"
+}
+
+
+
+/** Process first line of new object.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_object_line(wxd_reader_context_t *pctx, char *il)
+{
+ const char *ep = NULL;
+ int res;
+
+
+#line 1652 "wxdrd.ctr"
+ pctx->nparts = dk4str8_tokenize(
+ &(pctx->parts[0]), pctx->szparts, il, NULL, NULL
+ );
+ wxd_object_initialize(&(pctx->tobj));
+ (pctx->tobj).lino = pctx->lineno;
+ pctx->pobj = NULL;
+ pctx->curp = 0U;
+ if (0 < pctx->nparts) {
+ res = dk4ma_input_c8_dec_i16(
+ &(pctx->tobj.ot), pctx->parts[0], &ep, 1, NULL
+ );
+ if (0 != res) {
+ switch (pctx->tobj.ot) {
+ case WXD_OT_GROUP_END : {
+
+
+#line 1667 "wxdrd.ctr"
+ if ((dk4_um_t)0UL < pctx->grdepth) {
+ pctx->grdepth -= (dk4_um_t)1UL;
+
+
+#line 1670 "wxdrd.ctr"
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax - Closing too many groups */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_ERROR, 111
+ );
+ }
+ } break;
+ case WXD_OT_GROUP_BEGIN : {
+
+
+#line 1682 "wxdrd.ctr"
+ if (DK4_UM_MAX > pctx->grdepth) {
+ pctx->grdepth += (dk4_um_t)1UL;
+
+
+#line 1685 "wxdrd.ctr"
+ }
+ else {
+
+#line 1687 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Syntax - Opening too many groups */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_ERROR, 112
+ );
+ }
+ } break;
+ case WXD_OT_CONFIG : {
+ wxdrd_process_config_option_line(pctx);
+ } break;
+ case WXD_OT_TEXT : {
+ wxdrd_process_text_start_line(pctx);
+ } break;
+ case WXD_OT_POLYLINE : {
+ wxdrd_process_polyline_start_line(pctx);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ wxdrd_process_ospline_start_line(pctx);
+ } break;
+ case WXD_OT_O_ARC : {
+ wxdrd_process_oarc_start_line(pctx);
+ } break;
+ case WXD_OT_POLYGON : {
+ wxdrd_process_polygon_start_line(pctx);
+ } break;
+ case WXD_OT_C_SPLINE : {
+ wxdrd_process_cspline_start_line(pctx);
+ } break;
+ case WXD_OT_C_ARC : {
+ wxdrd_process_carc_start_line(pctx);
+ } break;
+ case WXD_OT_CIRCLE : {
+ wxdrd_process_circle_start_line(pctx);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ wxdrd_process_ellipse_start_line(pctx);
+ } break;
+ case WXD_OT_BOX : {
+ wxdrd_process_box_start_line(pctx);
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdrd_process_image_start_line(pctx);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ wxdrd_process_filled_dot_start_line(pctx);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ wxdrd_process_white_dot_start_line(pctx);
+ } break;
+ default : {
+ if (0 < wxdrd_check_version(pctx->drw, 1, 0)) {
+ pctx->st = ST_RESUME;
+ /* WARNING: Skipping object */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_WARNING, 113
+ );
+ }
+ else {
+
+#line 1747 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Syntax - Illegal object type */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_ERROR, 114
+ );
+ }
+ } break;
+ }
+ }
+ else {
+
+#line 1758 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Syntax - Missing object type */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 115
+ );
+ }
+ }
+ else {
+
+#line 1766 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* ERROR: Syntax - No object type */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 115
+ );
+ }
+
+
+#line 1773 "wxdrd.ctr"
+}
+
+
+
+/** Process details for a text.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_text(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ int16_t i16;
+ uint8_t u8;
+
+
+#line 1788 "wxdrd.ctr"
+ wxdrd_input_u8(&(pctx->pobj->det.t.find), pctx, 0);
+ if (1 == pctx->cc) {
+ if (34 < pctx->pobj->det.t.find) {
+ pctx->pobj->det.t.find = 34;
+ /* WARNING: Font index corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 116
+ );
+ }
+ }
+ wxdrd_input_u16(&(pctx->pobj->det.t.fsz), pctx, 1);
+ if (1 > pctx->pobj->det.t.fsz) {
+ pctx->pobj->det.t.fsz = 1;
+ /* WARNING: Font size corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 116
+ );
+ }
+ wxdrd_input_u8(&u8, pctx, 2);
+ if (1 == pctx->cc) {
+ if (2 < u8) {
+ u8 = 2;
+ /* WARNING: Text align corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 117
+ );
+ }
+ pctx->pobj->det.t.al = u8;
+ }
+ wxdrd_input_u8(&(pctx->pobj->det.t.fl), pctx, 3);
+ wxdrd_input_i32(&i32, pctx, 4);
+ pctx->pobj->det.t.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 5);
+ pctx->pobj->det.t.y = (double)i32;
+ wxdrd_input_i16(&i16, pctx, 6);
+ pctx->pobj->det.t.a = (double)i16;
+ if (1 == pctx->cc) {
+ pctx->st = ST_TEXT_EXPORT;
+ }
+
+
+#line 1828 "wxdrd.ctr"
+}
+
+
+
+/** Process details for a polyline.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_polyline(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+
+
+#line 1841 "wxdrd.ctr"
+ if (pctx->curp < pctx->pobj->det.p.n) {
+ wxdrd_input_i32(&i32, pctx, 0);
+ (pctx->pobj->det.p.p)[pctx->curp].x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ (pctx->pobj->det.p.p)[pctx->curp].y = (double)i32;
+ pctx->curp += 1U;
+ if (pctx->curp >= pctx->pobj->det.p.n) {
+ pctx->st = ST_OBJECT_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+
+
+#line 1859 "wxdrd.ctr"
+}
+
+
+
+/** Process details for a spline.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_spline(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+
+
+#line 1872 "wxdrd.ctr"
+ if (pctx->curp < pctx->pobj->det.s.n) {
+ wxdrd_input_i32(&i32, pctx, 0);
+ (pctx->pobj->det.s.p)[pctx->curp].x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ (pctx->pobj->det.s.p)[pctx->curp].y = (double)i32;
+ wxdrd_input_double(&((pctx->pobj->det.s.p)[pctx->curp].s), pctx, 2);
+ if (-1.0 > (pctx->pobj->det.s.p)[pctx->curp].s) {
+ (pctx->pobj->det.s.p)[pctx->curp].s = -1.0;
+ /* WARNING: s parameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 118
+ );
+ }
+ if ( 1.0 < (pctx->pobj->det.s.p)[pctx->curp].s) {
+ (pctx->pobj->det.s.p)[pctx->curp].s = 1.0;
+ /* WARNING: s parameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 118
+ );
+ }
+ pctx->curp += 1U;
+ if (pctx->curp >= pctx->pobj->det.s.n) {
+ pctx->st = ST_OBJECT_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+
+
+#line 1905 "wxdrd.ctr"
+}
+
+
+
+/** Process details for an arc.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_arc(wxd_reader_context_t *pctx)
+{
+
+
+#line 1917 "wxdrd.ctr"
+ wxdrd_input_i32(&(pctx->pobj->det.a.x1), pctx, 0);
+ wxdrd_input_i32(&(pctx->pobj->det.a.y1), pctx, 1);
+ wxdrd_input_i32(&(pctx->pobj->det.a.x2), pctx, 2);
+ wxdrd_input_i32(&(pctx->pobj->det.a.y2), pctx, 3);
+ wxdrd_input_i32(&(pctx->pobj->det.a.x3), pctx, 4);
+ wxdrd_input_i32(&(pctx->pobj->det.a.y3), pctx, 5);
+ pctx->st = ST_OBJECT_LINE;
+ wxdarc_calculation(
+ &((((pctx->pobj)->det).a).x),
+ &((((pctx->pobj)->det).a).y),
+ &((((pctx->pobj)->det).a).r),
+ &((((pctx->pobj)->det).a).a),
+ &((((pctx->pobj)->det).a).b),
+ &((((pctx->pobj)->det).a).d),
+ (((pctx->pobj)->det).a).x1,
+ (((pctx->pobj)->det).a).y1,
+ (((pctx->pobj)->det).a).x2,
+ (((pctx->pobj)->det).a).y2,
+ (((pctx->pobj)->det).a).x3,
+ (((pctx->pobj)->det).a).y3
+ );
+
+
+#line 1939 "wxdrd.ctr"
+}
+
+
+
+/** Process details for a circle
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_circle(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint32_t u32;
+
+
+#line 1953 "wxdrd.ctr"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.e.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.e.y = (double)i32;
+ wxdrd_input_u32(&u32, pctx, 2);
+ pctx->pobj->det.e.rx = (double)u32;
+ if ((uint32_t)1UL > u32) {
+ pctx->pobj->det.e.rx = 1.0;
+ /* WARNING: Radius corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 119
+ );
+ }
+ if ((uint32_t)80UL > u32) {
+ /* WARNING: Very small radius */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 120
+ );
+ }
+ pctx->pobj->det.e.ry = pctx->pobj->det.e.rx;
+ pctx->st = ST_OBJECT_LINE;
+
+
+#line 1975 "wxdrd.ctr"
+}
+
+
+
+/** Process details for an ellipse.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_ellipse(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint32_t u32;
+ int16_t i16;
+
+
+#line 1990 "wxdrd.ctr"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.e.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.e.y = (double)i32;
+ wxdrd_input_u32(&u32, pctx, 2);
+ pctx->pobj->det.e.rx = (double)u32;
+ if ((uint32_t)1UL > u32) {
+ pctx->pobj->det.e.rx = 1.0;
+ /* WARNING: X radius corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 119
+ );
+ }
+ if ((uint32_t)80UL > u32) {
+ /* WARNING: Unusual small x radius */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 120
+ );
+ }
+ wxdrd_input_u32(&u32, pctx, 3);
+ pctx->pobj->det.e.ry = (double)u32;
+ if ((uint32_t)1UL > u32) {
+ pctx->pobj->det.e.ry = 1.0;
+ /* WARNING: Y radius corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 119
+ );
+ }
+ if ((uint32_t)80UL > u32) {
+ /* WARNING: Unusual small y radius */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 120
+ );
+ }
+ wxdrd_input_i16(&i16, pctx, 4);
+ pctx->pobj->det.e.a = (double)i16;
+ pctx->st = ST_OBJECT_LINE;
+
+
+#line 2028 "wxdrd.ctr"
+}
+
+
+
+/** Process details for a box.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_box(wxd_reader_context_t *pctx)
+{
+ double dv;
+ double dw;
+ double dh;
+ int32_t i32;
+ uint32_t u32;
+
+
+#line 2045 "wxdrd.ctr"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.b.xl = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.b.xr = (double)i32;
+ if (pctx->pobj->det.b.xl > pctx->pobj->det.b.xr) {
+ dv = pctx->pobj->det.b.xl;
+ pctx->pobj->det.b.xl = pctx->pobj->det.b.xr;
+ pctx->pobj->det.b.xr = dv;
+ }
+ wxdrd_input_i32(&i32, pctx, 2);
+ pctx->pobj->det.b.yb = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 3);
+ pctx->pobj->det.b.yt = (double)i32;
+ if (pctx->pobj->det.b.yb > pctx->pobj->det.b.yt) {
+ dv = pctx->pobj->det.b.yb;
+ pctx->pobj->det.b.yb = pctx->pobj->det.b.yt;
+ pctx->pobj->det.b.yt = dv;
+ }
+ wxdrd_input_u32(&u32, pctx, 4);
+ pctx->pobj->det.b.r = (double)u32;
+ if ((uint32_t)0UL == u32) {
+ pctx->pobj->det.b.r = -1.0;
+ }
+ dw = pctx->pobj->det.b.xr - pctx->pobj->det.b.xl;
+ dh = pctx->pobj->det.b.yt - pctx->pobj->det.b.yb;
+ if (dh < dw) {
+ dw = dh;
+ }
+ if ((dw / 2.0) < pctx->pobj->det.b.r) {
+ pctx->pobj->det.b.r = dw / 2.0;
+ /* WARNING: Corner radius corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 119
+ );
+ }
+ pctx->st = ST_OBJECT_LINE;
+
+
+#line 2082 "wxdrd.ctr"
+}
+
+
+
+/** Process details for an embedded image.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_image(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint32_t u32;
+
+
+#line 2096 "wxdrd.ctr"
+ wxdrd_input_u8(&(pctx->pobj->det.i.fl), pctx, 0);
+ wxdrd_input_i8(&(pctx->pobj->det.i.r2g), pctx, 1);
+ if ((int8_t)(-1) > pctx->pobj->det.i.r2g) {
+ pctx->pobj->det.i.r2g = (int8_t)(-1);
+ /* WARNING: RGB to gray method corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 121
+ );
+ }
+ if (
+ (int8_t)(DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE) < pctx->pobj->det.i.r2g
+ ) {
+ pctx->pobj->det.i.r2g = (int8_t)(DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE);
+ /* WARNING: RGB to gray method corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 121
+ );
+ }
+ wxdrd_input_i8(&(pctx->pobj->det.i.r2c), pctx, 2);
+ wxdrd_input_i32(&i32, pctx, 3);
+ pctx->pobj->det.i.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 4);
+ pctx->pobj->det.i.y = (double)i32;
+ wxdrd_input_u32(&u32, pctx, 5);
+ pctx->pobj->det.i.w = (double)u32;
+ wxdrd_input_u32(&u32, pctx, 6);
+ pctx->pobj->det.i.h = (double)u32;
+ if (1.0 > pctx->pobj->det.i.w) {
+ pctx->cc = -1;
+ /* ERROR: Invalid image width */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 122
+ );
+ }
+ if (1.0 > pctx->pobj->det.i.h) {
+ pctx->cc = -1;
+ /* ERROR: Invalid image height */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 122
+ );
+ }
+ pctx->st = ST_IMAGE_NAME;
+
+
+#line 2139 "wxdrd.ctr"
+}
+
+
+
+/** Process details for a dot.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_dot(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint16_t u16;
+
+
+#line 2153 "wxdrd.ctr"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.d.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.d.y = (double)i32;
+ wxdrd_input_u16(&u16, pctx, 2);
+ pctx->pobj->det.d.d = (double)u16;
+ if (1.0 > pctx->pobj->det.d.d) {
+ pctx->pobj->det.d.d = 1.0;
+ /* WARNING: Dot diameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 123
+ );
+ }
+ pctx->st = ST_OBJECT_LINE;
+
+
+#line 2168 "wxdrd.ctr"
+}
+
+
+
+/** Process details for a white filled dot.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_white_dot(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint16_t u16;
+
+
+#line 2182 "wxdrd.ctr"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.d.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.d.y = (double)i32;
+ wxdrd_input_u16(&u16, pctx, 2);
+ if ((uint16_t)0U == u16) {
+ u16 = (uint16_t)1U;
+ /* WARNING: Dot diameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 123
+ );
+ }
+ pctx->pobj->det.d.d = (double)u16;
+ wxdrd_input_u16(&u16, pctx, 3);
+ pctx->pobj->lw = (double)u16;
+ if (1.0 > pctx->pobj->lw) {
+ pctx->pobj->lw = 1.0;
+ /* WARNING: Dot line width corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 124
+ );
+ }
+#if 0
+ if (pctx->pobj->det.d.d < pctx->pobj->lw) {
+ pctx->pobj->det.d.d = pctx->pobj->lw;
+ /* WARNING: Dot diameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 123
+ );
+ }
+#endif
+ pctx->st = ST_OBJECT_LINE;
+
+
+#line 2215 "wxdrd.ctr"
+}
+
+
+
+/** Process details line from input file.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_details_line(wxd_reader_context_t *pctx, char *il)
+{
+
+
+#line 2228 "wxdrd.ctr"
+ if (NULL != pctx->pobj) {
+ pctx->nparts = dk4str8_tokenize(
+ &(pctx->parts[0]), pctx->szparts, il, NULL, NULL
+ );
+ switch (pctx->pobj->ot) {
+ case WXD_OT_TEXT : {
+ if (7 == pctx->nparts) {
+ wxdrd_process_details_text(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if (2 == pctx->nparts) {
+ wxdrd_process_details_polyline(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if (3 == pctx->nparts) {
+ wxdrd_process_details_spline(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (6 == pctx->nparts) {
+ wxdrd_process_details_arc(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_CIRCLE : {
+ if (3 == pctx->nparts) {
+ wxdrd_process_details_circle(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ if (5 == pctx->nparts) {
+ wxdrd_process_details_ellipse(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_BOX : {
+ if (5 == pctx->nparts) {
+ wxdrd_process_details_box(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_IMAGE : {
+ if (7 == pctx->nparts) {
+ wxdrd_process_details_image(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ if (3 == pctx->nparts) {
+ wxdrd_process_details_dot(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ if (4 == pctx->nparts) {
+ wxdrd_process_details_white_dot(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+
+ }
+ }
+ else {
+
+#line 2357 "wxdrd.ctr"
+ pctx->cc = -1;
+ /* BUG */
+ }
+
+
+#line 2361 "wxdrd.ctr"
+}
+
+
+
+/** Process export text line.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_text_export(wxd_reader_context_t *pctx, char *il)
+{
+
+
+#line 2374 "wxdrd.ctr"
+ if (0 < strlen(&(il[1]))) {
+ pctx->pobj->det.t.t = dk4str8_dup(&(il[1]), NULL);
+ if (NULL != pctx->pobj->det.t.t) {
+ pctx->st = ST_TEXT_SCREEN;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 125
+ );
+ }
+
+
+#line 2393 "wxdrd.ctr"
+}
+
+
+
+/** Process export text line.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_text_screen(wxd_reader_context_t *pctx, char *il)
+{
+
+
+#line 2406 "wxdrd.ctr"
+ if (0 < strlen(&(il[1]))) {
+ pctx->pobj->det.t.tsc = dk4str8_dup(&(il[1]), NULL);
+ if (NULL != pctx->pobj->det.t.tsc) {
+ pctx->st = ST_OBJECT_LINE;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->pobj->det.t.tsc = NULL;
+ pctx->st = ST_OBJECT_LINE;
+ }
+
+
+#line 2422 "wxdrd.ctr"
+}
+
+
+
+/** Process the line containing the image file name.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_image_file_line(wxd_reader_context_t *pctx, char *il)
+{
+ dk4str8_delnl(&(il[1]));
+ if (0 < dk4str8_len(&(il[1]))) {
+ pctx->pobj->det.i.fn = dk4str8_dup(&(il[1]), NULL);
+ if (NULL != pctx->pobj->det.i.fn) {
+ pctx->st = ST_OBJECT_LINE;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 126
+ );
+ }
+}
+
+
+
+/** Process one non-comment line from input file.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_line(wxd_reader_context_t *pctx, char *il)
+{
+ int sl = 1; /* Object start line */
+
+
+#line 2467 "wxdrd.ctr"
+ if (0 != is_whsp(il[0])) { sl = 0; }
+ switch (pctx->st) {
+ case ST_FIRSTLINE : {
+ if (1 == sl) {
+ wxdrd_process_filetype_line(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ } break;
+ case ST_OBJECT_LINE : {
+ if (1 == sl) {
+ wxdrd_process_object_line(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Object start line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 127
+ );
+ }
+ } break;
+ case ST_DETAIL_LINE : {
+ if (0 == sl) {
+ wxdrd_process_details_line(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Details line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 128
+ );
+ }
+ } break;
+ case ST_TEXT_EXPORT : {
+ if (0 == sl) {
+ wxdrd_process_text_export(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Details line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 128
+ );
+ }
+ } break;
+ case ST_TEXT_SCREEN : {
+ if (0 == sl) {
+ wxdrd_process_text_screen(pctx, il);
+ }
+ else {
+ /* WARNING: Details line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 128
+ );
+ pctx->st = ST_OBJECT_LINE;
+ wxdrd_process_object_line(pctx, il);
+ }
+ } break;
+ case ST_IMAGE_NAME : {
+ if (0 == sl) {
+ wxdrd_process_image_file_line(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Details line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 128
+ );
+ }
+ } break;
+ case ST_RESUME : {
+ if (1 == sl) {
+ pctx->st = ST_OBJECT_LINE;
+ wxdrd_process_object_line(pctx, il);
+ }
+ } break;
+ }
+
+
+#line 2550 "wxdrd.ctr"
+}
+
+
+
+int
+wxdrd_apply_file(
+ wxd_drawing_t *drw,
+ FILE *fipo,
+ const dkChar *fn,
+ wxd2lat_job_t *job
+)
+{
+ char inbuf[WXD_LINE_LENGTH];
+ wxd_reader_context_t ctx;
+ char *parts[32];
+ const dkChar *osf = NULL; /* Old source file */
+ dk4_um_t osl = 0UL; /* Old source line number */
+ int back = 0; /* Function result */
+
+
+#line 2569 "wxdrd.ctr"
+ /*
+ Arguments check
+ */
+ if ((NULL == drw) || (NULL == fipo)) { goto finished; }
+ /*
+ Keep source file and line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, fn);
+ dk4app_set_log_source_line(job->app, 0UL);
+ /*
+ Initialize reader context. INITCONTEXT
+ */
+ DK4_MEMRES(&ctx,sizeof(wxd_reader_context_t));
+ ctx.st = ST_FIRSTLINE;
+ ctx.cc = 1;
+ ctx.back = 1;
+ ctx.parts = parts;
+ ctx.szparts = DK4_SIZEOF(parts,DK4_PCHAR);
+ ctx.nparts = 0;
+ ctx.lineno = (dk4_um_t)0UL;
+ ctx.grdepth = (dk4_um_t)0UL;
+
+
+#line 2593 "wxdrd.ctr"
+ ctx.fn = fn;
+ ctx.app = job->app;
+ ctx.msg = job->msg;
+ ctx.sz_msg = job->sz_msg;
+ ctx.drw = drw;
+ ctx.pobj = NULL;
+ ctx.curp = 0;
+ wxd_object_initialize(&(ctx.tobj));
+ /*
+ Process input file
+ */
+ while (1 == ctx.cc) {
+ if (NULL != fgets(inbuf, sizeof(inbuf), fipo)) {
+ if (DK4_UM_MAX > ctx.lineno) { ctx.lineno += (dk4_um_t)1UL; }
+ dk4app_set_log_source_line(job->app, ctx.lineno);
+ dk4str8_delnl(inbuf);
+ if ('#' != inbuf[0]) {
+ wxdrd_process_line(&ctx, inbuf);
+ }
+ }
+ else {
+ ctx.cc = 0;
+ }
+ }
+ if (0 > ctx.cc) {
+ ctx.back = 0;
+ }
+ else {
+ if (ST_OBJECT_LINE != ctx.st) {
+ if (ST_TEXT_SCREEN == ctx.st) {
+ /* WARNING: Expecting screen text */
+ dk4app_log_1(
+ ctx.app, ctx.msg, ctx.sz_msg, DK4_LL_WARNING, 129
+ );
+ }
+ else {
+ ctx.back = 0;
+ /* ERROR: Syntax - Unexpected end of file */
+ dk4app_log_1(
+ ctx.app, ctx.msg, ctx.sz_msg, DK4_LL_ERROR, 130
+ );
+ }
+ }
+ }
+ back = ctx.back;
+ /*
+ Restore source file and line number
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ finished:
+
+
+#line 2645 "wxdrd.ctr"
+ return back;
+}
+
+
+
+wxd_drawing_t *
+wxdrd_open_from_file(const dkChar *fn, wxd2lat_job_t *job)
+{
+ wxd_drawing_t *back = NULL;
+ FILE *fipo = NULL;
+ const dkChar *osf = NULL;
+ dk4_um_t osl = 0UL;
+ int res = 0;
+
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, fn);
+ dk4app_set_log_source_line(job->app, 0UL);
+ back = wxdrd_open_empty();
+ if (NULL != back) {
+ fipo = dk4fopen_app(fn, dkT("r"), 0, job->app);
+ if (NULL != fipo) {
+ res = wxdrd_apply_file(back, fipo, fn, job);
+ fclose(fipo);
+ }
+ else {
+ /* ERROR: Failed to open file. Already reported. */
+ }
+ if (0 == res) {
+ wxdrd_close(back);
+ back = NULL;
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4app_log_base1(job->app, DK4_LL_ERROR, 90);
+ }
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxdrd.ctr b/support/dktools/wxdrd.ctr
new file mode 100644
index 0000000000..550d4acad3
--- /dev/null
+++ b/support/dktools/wxdrd.ctr
@@ -0,0 +1,2691 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Open a drawing from file.
+ @param fn File name.
+ @param job Job structure.
+ @return Valid pointer to drawing on success, NULL on error.
+*/
+
+wxd_drawing_t *
+wxdrd_open_from_file(const dkChar *fn, wxd2lat_job_t *job);
+
+
+/** Open a new empty drawing.
+ @return Valid pointer to drawing on success, NULL on error.
+*/
+
+wxd_drawing_t *
+wxdrd_open_empty(void);
+
+
+/** Apply file contents to empty drawing.
+ @param drw Drawing to modify.
+ @param fipo File pointer, opened for text reading.
+ @param fn File name, may be NULL.
+ @param job Job structure.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdrd_apply_file(
+ wxd_drawing_t *drw,
+ FILE *fipo,
+ const dkChar *fn,
+ wxd2lat_job_t *job
+);
+
+
+/** Close drawing and release resources.
+ @param drw Drawing to close.
+*/
+
+void
+wxdrd_close(wxd_drawing_t *drw);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+%% module
+
+#include "wxd2lat.h"
+
+
+
+$!trace-include
+
+
+
+/** Context used while applying file contents.
+ For initialization search for text INITCONTEXT .
+*/
+typedef struct {
+ wxd_object_t tobj; /**< Temporary object filled from line. */
+ wxd_object_t *pobj; /**< Object currently created. */
+ char **parts; /**< Tokens from input line. */
+ dk4_app_t *app; /**< Application structure for diagnostics. */
+ const dkChar * const *msg; /**< Localized message texts. */
+ const dkChar *fn; /**< File name currently processed. */
+ wxd_drawing_t *drw; /**< Drawing to modify. */
+ dk4_um_t grdepth; /**< Grouping depth. */
+ dk4_um_t lineno; /**< Current line number to process. */
+ size_t szparts; /**< Number of elements in parts array. */
+ size_t nparts; /**< Number of elements used in parts array. */
+ size_t sz_msg; /**< Number of texts in msg array. */
+ uint16_t curp; /**< Index of current point to add. */
+ int st; /**< Reader state. */
+ int cc; /**< Continue: 1=yes, 0=finished, 2=abort. */
+ int back; /**< Reader process result */
+} wxd_reader_context_t;
+
+
+
+/** Reader states
+*/
+enum {
+ /** Error occured, can not continue.
+ */
+ ST_ERROR = -1 ,
+
+ /** Expecting first line containing file format info.
+ */
+ ST_FIRSTLINE = 0 ,
+
+ /** Expecting line to start an object.
+ */
+ ST_OBJECT_LINE ,
+
+ /** Expecting details line.
+ */
+ ST_DETAIL_LINE ,
+
+ /** Expecting text to export.
+ */
+ ST_TEXT_EXPORT ,
+
+ /** Expecting text to show on screen.
+ */
+ ST_TEXT_SCREEN ,
+
+ /** Expecting image file name.
+ */
+ ST_IMAGE_NAME ,
+
+ /** Attempt to resume processing.
+ */
+ ST_RESUME
+};
+
+
+
+/** Constant text fragments used by module.
+*/
+
+static const char * const wxdrd_kwnl8[] = {
+$!string-table
+#
+# 0 Keyword wxd
+#
+WXD
+$!end
+};
+
+
+
+static
+void
+wxd_object_initialize(wxd_object_t *pobj)
+{
+ DK4_MEMRES(pobj,sizeof(wxd_object_t));
+ pobj->lino = (dk4_um_t)0UL;
+}
+
+
+
+void
+wxdrd_close(wxd_drawing_t *drw)
+{
+ wxd_object_t *obj;
+
+ if (NULL != drw) {
+ if (NULL != drw->s_flat) {
+ if (NULL != drw->i_flat) {
+ dk4sto_it_reset(drw->i_flat);
+ do {
+ obj = (wxd_object_t *)dk4sto_it_next(drw->i_flat);
+ if (NULL != obj) {
+ wxd2lat_object_delete(obj);
+ }
+ } while(NULL != obj);
+ dk4sto_it_close(drw->i_flat);
+ }
+ dk4sto_close(drw->s_flat);
+ }
+ dk4mem_free(drw);
+ }
+}
+
+
+
+/** Initialize a drawing after allocating the memory.
+ @param drw Drawing to initialize.
+*/
+static
+void
+wxdrd_initialize_empty_drawing(wxd_drawing_t *drw)
+{
+ drw->s_flat = NULL;
+ drw->i_flat = NULL;
+ drw->bbxl = drw->bbxr = drw->bbyb = drw->bbyt = 0.0;
+ drw->fv_maj = 1;
+ drw->fv_min = 0;
+ drw->baselw = 0.45;
+}
+
+
+
+wxd_drawing_t *
+wxdrd_open_empty(void)
+{
+ wxd_drawing_t *back = NULL;
+ int ok = 0;
+ back = dk4mem_new(wxd_drawing_t,1,NULL);
+ if (NULL != back) {
+ wxdrd_initialize_empty_drawing(back);
+ back->s_flat = dk4sto_open(NULL);
+ if (NULL != back->s_flat) {
+ dk4sto_set_comp(back->s_flat, wxd2lat_compare_object, 0);
+ back->i_flat = dk4sto_it_open(back->s_flat, NULL);
+ if (NULL != back->i_flat) {
+ ok = 1;
+ }
+ }
+ if (0 == ok) {
+ wxdrd_close(back);
+ back = NULL;
+ }
+ }
+ return back;
+}
+
+
+
+/** Check drawing file format version against version given by numbers.
+ @param drw Drawing to check.
+ @param maj Major number of version to compare against.
+ @param min Minor number of version to compare against.
+ @return 1 if drawing version is higher, 0 for equal versions, -1
+ if drawing version is less than specified version.
+*/
+static
+int
+wxdrd_check_version(wxd_drawing_t *drw, uint16_t maj, uint16_t min)
+{
+ int back = 0;
+ if (drw->fv_maj > maj) {
+ back = 1;
+ }
+ else {
+ if (drw->fv_maj < maj) {
+ back = -1;
+ }
+ else {
+ if (drw->fv_min > min) {
+ back = 1;
+ }
+ else {
+ if (drw->fv_min < min) {
+ back = -1;
+ }
+ }
+ }
+ }
+ return back;
+}
+
+
+
+/** Check whether a character is a white space.
+ @param c Character to test.
+ @return 1 for space or tabulator, 0 otherwise.
+*/
+static
+int
+is_whsp(char c)
+{
+ if (' ' == c) return 1;
+ if ('\t' == c) return 1;
+ return 0;
+}
+
+
+
+/** Read double value from one of the parts, if we can still continue.
+ @param rp Address of destination variable.
+ @param pctx Context to use.
+ @param pind Index of source text in parts array.
+*/
+
+static
+void
+wxdrd_input_double(
+ double *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ double v = 0.0;
+ int res = 0;
+ if (1 == pctx->cc) {
+ res = dk4ma_input_c8_double(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 22, 23,
+ pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: ERROR Message */
+#endif
+ }
+ }
+}
+
+
+
+static
+void
+wxdrd_input_u8(
+ uint8_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ uint8_t v = 0U;
+
+ res = dk4ma_input_c8_dec_u8(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 82, 83, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: ERROR message */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_i8(
+ int8_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ int8_t v = 0U;
+
+ res = dk4ma_input_c8_dec_i8(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 84, 85, pctx->parts[pind]
+ );
+#else
+ /* ##### ERROR: Syntax */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_u16(
+ uint16_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ uint16_t v = 0U;
+
+ res = dk4ma_input_c8_dec_u16(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 86, 87, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_i16(
+ int16_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ int16_t v = 0U;
+
+ res = dk4ma_input_c8_dec_i16(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 88, 89, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_u32(
+ uint32_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ uint32_t v = 0U;
+
+ res = dk4ma_input_c8_dec_u32(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 90, 91, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+}
+
+
+
+static
+void
+wxdrd_input_i32(
+ int32_t *rp,
+ wxd_reader_context_t *pctx,
+ size_t pind
+)
+{
+ const char *ep = NULL;
+ int res = 0;
+ int32_t v = 0U;
+
+ res = dk4ma_input_c8_dec_i32(&v, pctx->parts[pind], &ep, 1, NULL);
+ if (0 != res) {
+ *rp = v;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 92, 93, pctx->parts[pind]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+}
+
+
+
+/** Process first line of file containing the file type.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_filetype_line(wxd_reader_context_t *pctx, char *il)
+{
+ const char *ep;
+ int res;
+ $? "+ wxdrd_process_filetype_line"
+ pctx->nparts = dk4str8_tokenize(
+ &(pctx->parts[0]), pctx->szparts, il, NULL, NULL
+ );
+ if (3 == pctx->nparts) {
+ if (0 == strcmp(wxdrd_kwnl8[0], pctx->parts[0])) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_u16(
+ &(pctx->drw->fv_maj), pctx->parts[1], &ep, 1, NULL
+ );
+ if (0 != res) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_u16(
+ &(pctx->drw->fv_min), pctx->parts[2], &ep, 1, NULL
+ );
+ if (0 != res) {
+ pctx->st = ST_OBJECT_LINE;
+ if (0 < wxdrd_check_version(pctx->drw, 1, 0)) {
+ /* WARNING: File format version too high! */
+ /*
+ While reading the input file object of types
+ not supported by format 1.0 are ignored.
+ */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_WARNING, 94
+ );
+ }
+ }
+ else { $? "! missing minor version"
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ }
+ else { $? "! missing major version"
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ }
+ else { $? "! no WXD"
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ }
+ else { $? "! nparts != 3"
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ $? "- wxdrd_process_filetype_line cc=%d", pctx->cc
+}
+
+
+
+/** Process configuration line for bounding box.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_bounding_box_line(wxd_reader_context_t *pctx)
+{
+ int32_t i32[4];
+ const char *ep = NULL;
+ size_t i;
+ int ok = 1;
+ int res;
+ $? "+ wxdrd_process_bounding_box_line"
+ if (6 == pctx->nparts) {
+ for (i = 0; i < 4; i++) {
+ ep = NULL;
+ res = dk4ma_input_c8_dec_i32(
+ &(i32[i]), pctx->parts[i + 2], &ep, 1, NULL
+ );
+ if (0 == res) { $? "! not a number"
+ ok = 0 ;
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 92, 93, pctx->parts[i + 2]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+ }
+ if (1 == ok) {
+ pctx->drw->bbxl = (double)(i32[0]);
+ pctx->drw->bbxr = (double)(i32[1]);
+ pctx->drw->bbyb = (double)(i32[2]);
+ pctx->drw->bbyt = (double)(i32[3]);
+ if (
+ (pctx->drw->bbxl >= pctx->drw->bbxr)
+ || (pctx->drw->bbyb >= pctx->drw->bbyt)
+ ) {
+ /* ERROR: Illegal bounding box */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 95
+ );
+ pctx->cc = -1;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ }
+ }
+ else { $? "! nparts"
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_bounding_box_line cc=%d", pctx->cc
+}
+
+
+
+/** Process configuration line for base line width.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_base_line_width_line(wxd_reader_context_t *pctx)
+{
+ const char *ep = NULL;
+ int res;
+ uint32_t u32;
+ $? "+ wxdrd_process_base_line_width_line"
+ if (3 == pctx->nparts) {
+ res = dk4ma_input_c8_dec_u32(&u32, pctx->parts[2], &ep, 1, NULL);
+ if (0 != res) {
+ pctx->drw->baselw = ((9.0 * (double)u32) / 2032000.0);
+ if ((uint32_t)0U == u32) {
+ pctx->cc = -1;
+ /* ERROR: Base line width 0 not allowed */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 97
+ );
+ }
+ }
+ else { $? "! not a number"
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+#if DK4_CHAR_SIZE == 1
+ dk4app_log_3(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR,
+ 90, 91, pctx->parts[2]
+ );
+#else
+ /* ##### TODO: Error message */
+#endif
+ }
+ }
+ else { $? "! nparts"
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_base_line_width_line cc=%d", pctx->cc
+}
+
+
+
+/** Process configuration line.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_config_option_line(wxd_reader_context_t *pctx)
+{
+ const char *ep = NULL;
+ int res;
+ int16_t st;
+ $? "+ wxdrd_process_config_option_line"
+ if (1 < pctx->nparts) {
+ res = dk4ma_input_c8_dec_i16(&st, pctx->parts[1], &ep, 1, NULL);
+ if (0 != res) {
+ switch (st) {
+ case 0 : { /* Bounding box */
+ wxdrd_process_bounding_box_line(pctx);
+ } break;
+ case 1 : { /* Base line width */
+ wxdrd_process_base_line_width_line(pctx);
+ } break;
+ case 2 : { /* Zoom level */
+ /* Zoom level is used in the drawing application only */
+ } break;
+ case 3 : { /* Zoom center */
+ /* Zoom center is used in the drawing application only */
+ } break;
+ case 4 : { /* Grid unit */
+ /* Grid unit is used in the drawing application only */
+ } break;
+ case 5 : { /* Grid divisor base */
+ /* Grid divisor is used in the drawing application only */
+ } break;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax - Too few numbers */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 98
+ );
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax - Too few numbers */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 98
+ );
+ }
+ $? "- wxdrd_process_config_option_line cc=%d", pctx->cc
+}
+
+
+
+/** Read layer and colour.
+ No memory is allocated for the identifier, we just check existance.
+ @param pctx Context to modify.
+ @param isst Colour purpose (is stroke): 1=stroke, 0=fill.
+*/
+static
+void
+wxd_layer_colour(wxd_reader_context_t *pctx, int isst)
+{
+ size_t i;
+ $? "+ wxd_layer_colour"
+ wxdrd_input_i16(&(pctx->tobj.lay), pctx, 1);
+ if (0 != isst) {
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.sc[i]), pctx, (2 + i));
+ }
+ }
+ else {
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.fc[i]), pctx, (2 + i));
+ }
+ }
+ $? "- wxd_layer_colour cc=%d", pctx->cc
+}
+
+
+
+/** Retrieve attributes for stroked object.
+ @param pctx Context to use and modify.
+ @param addi Offset to add to indices (0 for objects without
+ a number of points, 1 for objects with variable point number).
+ @param jm Offset to add to indices (0 for objects without
+ join style and miter limit, 2 for objects with these information).
+*/
+static
+void
+wxd_stroke_attributes(wxd_reader_context_t *pctx, size_t addi, size_t jm)
+{
+ size_t i;
+ uint16_t u16 = (uint16_t)0U;
+ $? "+ wxd_stroke_attributes"
+ wxdrd_input_i16(&(pctx->tobj.lay), pctx, (1 + addi));
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.sc[i]), pctx, (2 + addi + i));
+ }
+ wxdrd_input_u16(&u16, pctx, (5 + addi));
+ pctx->tobj.lw = (double)u16;
+ wxdrd_input_u8(&(pctx->tobj.ls), pctx, (6 + addi));
+ if (WXD_LS_DASH_DOT_DOT_DOT < pctx->tobj.ls) {
+ pctx->tobj.ls = WXD_LS_DASH_DOT_DOT_DOT;
+ /* WARNING: Line style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 99
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.sl), pctx, (7 + addi));
+ if (1 > pctx->tobj.sl) {
+ pctx->tobj.sl = 1;
+ /* WARNING: Style length corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 100
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.csfs), pctx, (8 + addi));
+ if (WXD_LC_PROJECTING < pctx->tobj.csfs) {
+ pctx->tobj.csfs = WXD_LC_PROJECTING;
+ /* WARNING: Cap style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 101
+ );
+ }
+ if (2 == jm) {
+ wxdrd_input_u8(&(pctx->tobj.js), pctx, (9 + addi));
+ if (WXD_LJ_BEVELED < pctx->tobj.js) {
+ pctx->tobj.js = WXD_LJ_BEVELED;
+ /* WARNING: Join style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 102
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ml), pctx, (10 + addi));
+ $? ". ml = %u", (unsigned)(pctx->tobj.ml)
+ if (1U > pctx->tobj.ml) {
+ pctx->tobj.ml = 1U;
+ /* WARNING: Miter limit corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 103
+ );
+ }
+ }
+ wxdrd_input_u8(&(pctx->tobj.af.type), pctx, ( 9 + jm + addi));
+ if (29U < pctx->tobj.af.type) {
+ pctx->tobj.af.type = 29U;
+ /* WARNING: Forward arrow type corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 104
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.af.length), pctx, (10 + jm + addi));
+ if (1U > pctx->tobj.af.length) {
+ pctx->tobj.af.length = 1U;
+ /* WARNING: Forward arrow length corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 106
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.af.width), pctx, (11 + jm + addi));
+ if (1U > pctx->tobj.af.width) {
+ pctx->tobj.af.width = 1U;
+ /* WARNING: Forward arrow width corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 108
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ab.type), pctx, (12 + jm + addi));
+ if (29U < pctx->tobj.ab.type) {
+ pctx->tobj.ab.type = 29U;
+ /* WARNING: Backward arrow type corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 105
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ab.length), pctx, (13 + jm + addi));
+ if (1U > pctx->tobj.ab.length) {
+ pctx->tobj.ab.length = 1U;
+ /* WARNING: Backward arrow length corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 107
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ab.width), pctx, (14 + jm + addi));
+ if (1U > pctx->tobj.ab.width) {
+ pctx->tobj.ab.width = 1U;
+ /* WARNING: Backward arrow width corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 109
+ );
+ }
+ $? "- wxd_stroke_attributes cc=%d", pctx->cc
+}
+
+
+
+static
+void
+wxd_fill_stroke_attributes(wxd_reader_context_t *pctx, size_t addi, int js)
+{
+ size_t i;
+ uint16_t u16 = (uint16_t)0U;
+ $? "+ wxd_fill_stroke_attributes"
+ wxdrd_input_i16(&(pctx->tobj.lay), pctx, (1 + addi));
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.sc[i]), pctx, (2 + addi + i));
+ }
+ for (i = 0; ((i < 3) && (1 == pctx->cc)); i++) {
+ wxdrd_input_u8(&(pctx->tobj.fc[i]), pctx, (5 + addi + i));
+ }
+ wxdrd_input_u16(&u16, pctx, (8 + addi));
+ pctx->tobj.lw = (double)u16;
+ wxdrd_input_u8(&(pctx->tobj.ls), pctx, (9 + addi));
+ if (WXD_LS_DASH_DOT_DOT_DOT < pctx->tobj.ls) {
+ pctx->tobj.ls = WXD_LS_DASH_DOT_DOT_DOT;
+ /* WARNING: Line style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 99
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.sl), pctx, (10 + addi));
+ if (1 > pctx->tobj.sl) {
+ pctx->tobj.sl = 1;
+ /* WARNING: Style length corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 100
+ );
+ }
+ if (1 == js) {
+ wxdrd_input_u8(&(pctx->tobj.js), pctx, (11 + addi));
+ if (WXD_LJ_BEVELED < pctx->tobj.js) {
+ pctx->tobj.js = WXD_LJ_BEVELED;
+ /* WARNING: Join style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 102
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.ml), pctx, (12 + addi));
+ $? ". ml = %u", (unsigned)(pctx->tobj.ml)
+ if (1U > pctx->tobj.ml) {
+ pctx->tobj.ml = 1U;
+ /* WARNING: Miter limit corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 103
+ );
+ }
+ wxdrd_input_u8(&(pctx->tobj.csfs), pctx, (13 + addi));
+ if (WXD_FS_VERTICAL_TIRES < pctx->tobj.csfs) {
+ pctx->tobj.csfs = WXD_FS_VERTICAL_TIRES;
+ /* WARNING: Fill style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 110
+ );
+ }
+ }
+ else {
+ wxdrd_input_u8(&(pctx->tobj.csfs), pctx, (11 + addi));
+ if (WXD_FS_VERTICAL_TIRES < pctx->tobj.csfs) {
+ pctx->tobj.csfs = WXD_FS_VERTICAL_TIRES;
+ /* WARNING: Fill style corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 110
+ );
+ }
+ }
+ $? "- wxd_fill_stroke_attributes cc=%d", pctx->cc
+}
+
+
+
+/** Add object pobj to drawing.
+ @param pctx Context to modify, contains both drw and pobj.
+ @param idin Index of identifier in parts array.
+*/
+static
+void
+wxdrd_add_object(wxd_reader_context_t *pctx)
+{
+ if ((NULL != pctx->pobj) && (1 == pctx->cc)) {
+ if (0 == dk4sto_add(pctx->drw->s_flat, pctx->pobj, NULL)) {
+ wxd2lat_object_delete(pctx->pobj);
+ pctx->pobj = NULL;
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+}
+
+
+
+/** Process object start line for text object.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_text_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_text_start_line"
+ if (5 == pctx->nparts) {
+ wxd_layer_colour(pctx, 0);
+ if (1 == pctx->cc) {
+ /*
+ Set details to reasonable defaults before creating
+ a dynamic copy of the object
+ */
+ pctx->tobj.det.t.t = NULL;
+ pctx->tobj.det.t.tsc = NULL;
+ pctx->tobj.det.t.a = 0.0;
+ pctx->tobj.det.t.x = 0.0;
+ pctx->tobj.det.t.y = 0.0;
+ pctx->tobj.det.t.fsz = 12U;
+ pctx->tobj.det.t.find = 0;
+ pctx->tobj.det.t.al = WXD_TA_LEFT;
+ pctx->tobj.det.t.fl = 0;
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ /*
+ Create dynamic copy and register interest in the details
+ */
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_text_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for polyline object.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_polyline_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_polyline_start_line"
+ if (18 == pctx->nparts) {
+ pctx->tobj.det.p.p = NULL;
+ pctx->tobj.det.p.n = 0;
+ wxdrd_input_u16(&(pctx->tobj.det.p.n), pctx, 1);
+ if (1 == pctx->cc) {
+ wxd_stroke_attributes(pctx, 1, 2);
+ if (2 > pctx->tobj.det.p.n) {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ pctx->pobj->det.p.p =
+ dk4mem_new(wxd_point_t,pctx->tobj.det.p.n,NULL);
+ if (NULL != pctx->pobj->det.p.p) {
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ dk4mem_free(pctx->pobj);
+ pctx->pobj = NULL;
+ pctx->cc = -1;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_polyline_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for open spline.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_ospline_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_ospline_start_line"
+ if (18 == pctx->nparts) {
+ pctx->tobj.det.s.p = NULL;
+ pctx->tobj.det.s.sl = NULL;
+ pctx->tobj.det.s.n = 0;
+ pctx->tobj.det.s.ts = 0.0;
+ wxdrd_input_u16(&(pctx->tobj.det.s.n), pctx, 1);
+ pctx->tobj.det.s.te = (double)((pctx->tobj).det.s.n - (uint16_t)1U);
+ if (1 == pctx->cc) {
+ wxd_stroke_attributes(pctx, 1, 2);
+ if (2 > pctx->tobj.det.s.n) {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ pctx->pobj->det.s.p =
+ dk4mem_new(wxd_spline_point_t,pctx->tobj.det.s.n,NULL);
+ if (NULL != pctx->pobj->det.s.p) {
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ dk4mem_free(pctx->pobj);
+ pctx->pobj = NULL;
+ pctx->cc = -1;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_ospline_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for open arc.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_oarc_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_oarc_start_line"
+ if (15 == pctx->nparts) {
+ pctx->tobj.det.a.a = 0.0;
+ pctx->tobj.det.a.b = 0.0;
+ pctx->tobj.det.a.x = 0L;
+ pctx->tobj.det.a.y = 0L;
+ pctx->tobj.det.a.r = 0UL;
+ wxd_stroke_attributes(pctx, 0, 0);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_oarc_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for polygon.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_polygon_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_polygon_start_line"
+ if (15 == pctx->nparts) {
+ pctx->tobj.det.p.p = NULL;
+ pctx->tobj.det.p.n = 0;
+ wxdrd_input_u16(&(pctx->tobj.det.p.n), pctx, 1);
+ if (1 == pctx->cc) {
+ wxd_fill_stroke_attributes(pctx, 1, 1);
+ if (2 > pctx->tobj.det.p.n) {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ pctx->pobj->det.p.p =
+ dk4mem_new(wxd_point_t,pctx->tobj.det.p.n,NULL);
+ if (NULL != pctx->pobj->det.p.p) {
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ dk4mem_free(pctx->pobj);
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_polygon_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for closed spline.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_cspline_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_cspline_start_line"
+ if (15 == pctx->nparts) {
+ pctx->tobj.det.s.p = NULL;
+ pctx->tobj.det.s.sl = NULL;
+ pctx->tobj.det.s.n = 0;
+ wxdrd_input_u16(&(pctx->tobj.det.s.n), pctx, 1);
+ if (1 == pctx->cc) {
+ wxd_fill_stroke_attributes(pctx, 1, 1);
+ if (2 > pctx->tobj.det.s.n) {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ pctx->pobj->det.s.p =
+ dk4mem_new(wxd_spline_point_t,pctx->tobj.det.s.n,NULL);
+ if (NULL != pctx->pobj->det.s.p) {
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ dk4mem_free(pctx->pobj);
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_cspline_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for closed arc.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_carc_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_carc_start_line"
+ if (14 == pctx->nparts) {
+ pctx->tobj.det.a.a = 0.0;
+ pctx->tobj.det.a.b = 0.0;
+ pctx->tobj.det.a.x = 0L;
+ pctx->tobj.det.a.y = 0L;
+ pctx->tobj.det.a.r = 0UL;
+ wxd_fill_stroke_attributes(pctx, 0, 1);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_carc_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for ellipse.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_ellipse_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_ellipse_start_line"
+ if (12 == pctx->nparts) {
+ pctx->tobj.det.e.a = 0.0;
+ pctx->tobj.det.e.x = 0.0;
+ pctx->tobj.det.e.y = 0.0;
+ pctx->tobj.det.e.rx = 0.0;
+ pctx->tobj.det.e.ry = 0.0;
+ wxd_fill_stroke_attributes(pctx, 0, 0);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ }
+ $? "- wxdrd_process_ellipse_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for box.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_box_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_box_start_line"
+ if (12 == pctx->nparts) {
+ pctx->tobj.det.b.xl = 0.0;
+ pctx->tobj.det.b.xr = 0.0;
+ pctx->tobj.det.b.yb = 0.0;
+ pctx->tobj.det.b.yt = 0.0;
+ pctx->tobj.det.b.r = -1.0;
+ wxd_fill_stroke_attributes(pctx, 0, 0);
+ pctx->tobj.js = WXD_LJ_MITERED;
+ pctx->tobj.ml = 8U; $? ". ml = 8"
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_box_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for embedded image.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_image_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_image_start_line"
+ if (5 == pctx->nparts) {
+ pctx->tobj.det.i.fn = NULL;
+ pctx->tobj.det.i.x = 0.0;
+ pctx->tobj.det.i.y = 0.0;
+ pctx->tobj.det.i.w = 0.0;
+ pctx->tobj.det.i.h = 0.0;
+ pctx->tobj.det.i.fl = 0U;
+ pctx->tobj.det.i.r2g = 0;
+ pctx->tobj.det.i.r2c = 0;
+ wxd_layer_colour(pctx, 0);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_image_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for filled dot.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_filled_dot_start_line(wxd_reader_context_t *pctx)
+{
+ size_t i;
+ $? "+ wxdrd_process_filled_dot_start_line"
+ if (5 == pctx->nparts) {
+ pctx->tobj.det.d.x = 0.0;
+ pctx->tobj.det.d.y = 0.0;
+ pctx->tobj.det.d.d = 0.0;
+ pctx->tobj.lw = 0.0;
+ wxd_layer_colour(pctx, 0);
+ for (i = 0; i < 3; i++) { pctx->tobj.sc[i] = pctx->tobj.fc[i]; }
+ pctx->tobj.csfs = WXD_FS_PURE;
+ if (1 == pctx->cc ) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_filled_dot_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for white filled dot.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_white_dot_start_line(wxd_reader_context_t *pctx)
+{
+ size_t i;
+ $? "+ wxdrd_process_white_dot_start_line"
+ if (5 == pctx->nparts) {
+ pctx->tobj.det.d.x = 0.0;
+ pctx->tobj.det.d.y = 0.0;
+ pctx->tobj.det.d.d = 0.0;
+ pctx->tobj.lw = 0.0;
+ wxd_layer_colour(pctx, 1);
+ for (i = 0; i < 3; i++) { pctx->tobj.fc[i] = 255; }
+ pctx->tobj.csfs = WXD_FS_PURE;
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_white_dot_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process object start line for circle.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_circle_start_line(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_circle_start_line"
+ if (12 == pctx->nparts) {
+ pctx->tobj.det.e.a = 0.0;
+ pctx->tobj.det.e.x = 0.0;
+ pctx->tobj.det.e.y = 0.0;
+ pctx->tobj.det.e.rx = 0.0;
+ pctx->tobj.det.e.ry = 0.0;
+ wxd_fill_stroke_attributes(pctx, 0, 0);
+ if (1 == pctx->cc) {
+ pctx->pobj = dk4mem_new(wxd_object_t,1,NULL);
+ if (NULL != pctx->pobj) {
+ DK4_MEMCPY(pctx->pobj, &(pctx->tobj), sizeof(wxd_object_t));
+ wxdrd_add_object(pctx);
+ if (1 == pctx->cc) {
+ pctx->st = ST_DETAIL_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_circle_start_line cc=%d", pctx->cc
+}
+
+
+
+/** Process first line of new object.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_object_line(wxd_reader_context_t *pctx, char *il)
+{
+ const char *ep = NULL;
+ int res;
+ $? "+ wxdrd_process_object_line"
+ pctx->nparts = dk4str8_tokenize(
+ &(pctx->parts[0]), pctx->szparts, il, NULL, NULL
+ );
+ wxd_object_initialize(&(pctx->tobj));
+ (pctx->tobj).lino = pctx->lineno;
+ pctx->pobj = NULL;
+ pctx->curp = 0U;
+ if (0 < pctx->nparts) {
+ res = dk4ma_input_c8_dec_i16(
+ &(pctx->tobj.ot), pctx->parts[0], &ep, 1, NULL
+ );
+ if (0 != res) {
+ switch (pctx->tobj.ot) {
+ case WXD_OT_GROUP_END : {
+ $? ". grdepth = %lu", (unsigned long)(pctx->grdepth)
+ if ((dk4_um_t)0UL < pctx->grdepth) {
+ pctx->grdepth -= (dk4_um_t)1UL;
+ $? ". grdepth = %lu", (unsigned long)(pctx->grdepth)
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax - Closing too many groups */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_ERROR, 111
+ );
+ }
+ } break;
+ case WXD_OT_GROUP_BEGIN : {
+ $? ". grdepth = %lu", (unsigned long)(pctx->grdepth)
+ if (DK4_UM_MAX > pctx->grdepth) {
+ pctx->grdepth += (dk4_um_t)1UL;
+ $? ". grdepth = %lu", (unsigned long)(pctx->grdepth)
+ }
+ else { $? "! too many groups"
+ pctx->cc = -1;
+ /* ERROR: Syntax - Opening too many groups */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_ERROR, 112
+ );
+ }
+ } break;
+ case WXD_OT_CONFIG : {
+ wxdrd_process_config_option_line(pctx);
+ } break;
+ case WXD_OT_TEXT : {
+ wxdrd_process_text_start_line(pctx);
+ } break;
+ case WXD_OT_POLYLINE : {
+ wxdrd_process_polyline_start_line(pctx);
+ } break;
+ case WXD_OT_O_SPLINE : {
+ wxdrd_process_ospline_start_line(pctx);
+ } break;
+ case WXD_OT_O_ARC : {
+ wxdrd_process_oarc_start_line(pctx);
+ } break;
+ case WXD_OT_POLYGON : {
+ wxdrd_process_polygon_start_line(pctx);
+ } break;
+ case WXD_OT_C_SPLINE : {
+ wxdrd_process_cspline_start_line(pctx);
+ } break;
+ case WXD_OT_C_ARC : {
+ wxdrd_process_carc_start_line(pctx);
+ } break;
+ case WXD_OT_CIRCLE : {
+ wxdrd_process_circle_start_line(pctx);
+ } break;
+ case WXD_OT_ELLIPSE : {
+ wxdrd_process_ellipse_start_line(pctx);
+ } break;
+ case WXD_OT_BOX : {
+ wxdrd_process_box_start_line(pctx);
+ } break;
+ case WXD_OT_IMAGE : {
+ wxdrd_process_image_start_line(pctx);
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ wxdrd_process_filled_dot_start_line(pctx);
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ wxdrd_process_white_dot_start_line(pctx);
+ } break;
+ default : {
+ if (0 < wxdrd_check_version(pctx->drw, 1, 0)) {
+ pctx->st = ST_RESUME;
+ /* WARNING: Skipping object */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_WARNING, 113
+ );
+ }
+ else { $? "! version number"
+ pctx->cc = -1;
+ /* ERROR: Syntax - Illegal object type */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg,
+ DK4_LL_ERROR, 114
+ );
+ }
+ } break;
+ }
+ }
+ else { $? "! input type is not a number"
+ pctx->cc = -1;
+ /* ERROR: Syntax - Missing object type */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 115
+ );
+ }
+ }
+ else { $? "! missing object type"
+ pctx->cc = -1;
+ /* ERROR: Syntax - No object type */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 115
+ );
+ }
+ $? "- wxdrd_process_object_line cc=%d", pctx->cc
+}
+
+
+
+/** Process details for a text.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_text(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ int16_t i16;
+ uint8_t u8;
+ $? "+ wxdrd_process_details_text"
+ wxdrd_input_u8(&(pctx->pobj->det.t.find), pctx, 0);
+ if (1 == pctx->cc) {
+ if (34 < pctx->pobj->det.t.find) {
+ pctx->pobj->det.t.find = 34;
+ /* WARNING: Font index corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 116
+ );
+ }
+ }
+ wxdrd_input_u16(&(pctx->pobj->det.t.fsz), pctx, 1);
+ if (1 > pctx->pobj->det.t.fsz) {
+ pctx->pobj->det.t.fsz = 1;
+ /* WARNING: Font size corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 116
+ );
+ }
+ wxdrd_input_u8(&u8, pctx, 2);
+ if (1 == pctx->cc) {
+ if (2 < u8) {
+ u8 = 2;
+ /* WARNING: Text align corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 117
+ );
+ }
+ pctx->pobj->det.t.al = u8;
+ }
+ wxdrd_input_u8(&(pctx->pobj->det.t.fl), pctx, 3);
+ wxdrd_input_i32(&i32, pctx, 4);
+ pctx->pobj->det.t.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 5);
+ pctx->pobj->det.t.y = (double)i32;
+ wxdrd_input_i16(&i16, pctx, 6);
+ pctx->pobj->det.t.a = (double)i16;
+ if (1 == pctx->cc) {
+ pctx->st = ST_TEXT_EXPORT;
+ }
+ $? "- wxdrd_process_details_text cc=%d", pctx->cc
+}
+
+
+
+/** Process details for a polyline.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_polyline(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ $? "+ wxdrd_process_details_polyline"
+ if (pctx->curp < pctx->pobj->det.p.n) {
+ wxdrd_input_i32(&i32, pctx, 0);
+ (pctx->pobj->det.p.p)[pctx->curp].x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ (pctx->pobj->det.p.p)[pctx->curp].y = (double)i32;
+ pctx->curp += 1U;
+ if (pctx->curp >= pctx->pobj->det.p.n) {
+ pctx->st = ST_OBJECT_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ $? "- wxdrd_process_details_polyline cc=%d", pctx->cc
+}
+
+
+
+/** Process details for a spline.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_spline(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ $? "+ wxdrd_process_details_spline"
+ if (pctx->curp < pctx->pobj->det.s.n) {
+ wxdrd_input_i32(&i32, pctx, 0);
+ (pctx->pobj->det.s.p)[pctx->curp].x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ (pctx->pobj->det.s.p)[pctx->curp].y = (double)i32;
+ wxdrd_input_double(&((pctx->pobj->det.s.p)[pctx->curp].s), pctx, 2);
+ if (-1.0 > (pctx->pobj->det.s.p)[pctx->curp].s) {
+ (pctx->pobj->det.s.p)[pctx->curp].s = -1.0;
+ /* WARNING: s parameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 118
+ );
+ }
+ if ( 1.0 < (pctx->pobj->det.s.p)[pctx->curp].s) {
+ (pctx->pobj->det.s.p)[pctx->curp].s = 1.0;
+ /* WARNING: s parameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 118
+ );
+ }
+ pctx->curp += 1U;
+ if (pctx->curp >= pctx->pobj->det.s.n) {
+ pctx->st = ST_OBJECT_LINE;
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 59
+ );
+ }
+ $? "- wxdrd_process_details_spline cc=%d", pctx->cc
+}
+
+
+
+/** Process details for an arc.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_arc(wxd_reader_context_t *pctx)
+{
+ $? "+ wxdrd_process_details_arc"
+ wxdrd_input_i32(&(pctx->pobj->det.a.x1), pctx, 0);
+ wxdrd_input_i32(&(pctx->pobj->det.a.y1), pctx, 1);
+ wxdrd_input_i32(&(pctx->pobj->det.a.x2), pctx, 2);
+ wxdrd_input_i32(&(pctx->pobj->det.a.y2), pctx, 3);
+ wxdrd_input_i32(&(pctx->pobj->det.a.x3), pctx, 4);
+ wxdrd_input_i32(&(pctx->pobj->det.a.y3), pctx, 5);
+ pctx->st = ST_OBJECT_LINE;
+ wxdarc_calculation(
+ &((((pctx->pobj)->det).a).x),
+ &((((pctx->pobj)->det).a).y),
+ &((((pctx->pobj)->det).a).r),
+ &((((pctx->pobj)->det).a).a),
+ &((((pctx->pobj)->det).a).b),
+ &((((pctx->pobj)->det).a).d),
+ (((pctx->pobj)->det).a).x1,
+ (((pctx->pobj)->det).a).y1,
+ (((pctx->pobj)->det).a).x2,
+ (((pctx->pobj)->det).a).y2,
+ (((pctx->pobj)->det).a).x3,
+ (((pctx->pobj)->det).a).y3
+ );
+ $? "- wxdrd_process_details_arc cc=%d", pctx->cc
+}
+
+
+
+/** Process details for a circle
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_circle(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint32_t u32;
+ $? "+ wxdrd_process_details_circle"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.e.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.e.y = (double)i32;
+ wxdrd_input_u32(&u32, pctx, 2);
+ pctx->pobj->det.e.rx = (double)u32;
+ if ((uint32_t)1UL > u32) {
+ pctx->pobj->det.e.rx = 1.0;
+ /* WARNING: Radius corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 119
+ );
+ }
+ if ((uint32_t)80UL > u32) {
+ /* WARNING: Very small radius */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 120
+ );
+ }
+ pctx->pobj->det.e.ry = pctx->pobj->det.e.rx;
+ pctx->st = ST_OBJECT_LINE;
+ $? "- wxdrd_process_details_circle cc=%d", pctx->cc
+}
+
+
+
+/** Process details for an ellipse.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_ellipse(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint32_t u32;
+ int16_t i16;
+ $? "+ wxdrd_process_details_ellipse"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.e.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.e.y = (double)i32;
+ wxdrd_input_u32(&u32, pctx, 2);
+ pctx->pobj->det.e.rx = (double)u32;
+ if ((uint32_t)1UL > u32) {
+ pctx->pobj->det.e.rx = 1.0;
+ /* WARNING: X radius corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 119
+ );
+ }
+ if ((uint32_t)80UL > u32) {
+ /* WARNING: Unusual small x radius */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 120
+ );
+ }
+ wxdrd_input_u32(&u32, pctx, 3);
+ pctx->pobj->det.e.ry = (double)u32;
+ if ((uint32_t)1UL > u32) {
+ pctx->pobj->det.e.ry = 1.0;
+ /* WARNING: Y radius corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 119
+ );
+ }
+ if ((uint32_t)80UL > u32) {
+ /* WARNING: Unusual small y radius */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 120
+ );
+ }
+ wxdrd_input_i16(&i16, pctx, 4);
+ pctx->pobj->det.e.a = (double)i16;
+ pctx->st = ST_OBJECT_LINE;
+ $? "- wxdrd_process_details_ellipse cc=%d", pctx->cc
+}
+
+
+
+/** Process details for a box.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_box(wxd_reader_context_t *pctx)
+{
+ double dv;
+ double dw;
+ double dh;
+ int32_t i32;
+ uint32_t u32;
+ $? "+ wxdrd_process_details_box"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.b.xl = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.b.xr = (double)i32;
+ if (pctx->pobj->det.b.xl > pctx->pobj->det.b.xr) {
+ dv = pctx->pobj->det.b.xl;
+ pctx->pobj->det.b.xl = pctx->pobj->det.b.xr;
+ pctx->pobj->det.b.xr = dv;
+ }
+ wxdrd_input_i32(&i32, pctx, 2);
+ pctx->pobj->det.b.yb = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 3);
+ pctx->pobj->det.b.yt = (double)i32;
+ if (pctx->pobj->det.b.yb > pctx->pobj->det.b.yt) {
+ dv = pctx->pobj->det.b.yb;
+ pctx->pobj->det.b.yb = pctx->pobj->det.b.yt;
+ pctx->pobj->det.b.yt = dv;
+ }
+ wxdrd_input_u32(&u32, pctx, 4);
+ pctx->pobj->det.b.r = (double)u32;
+ if ((uint32_t)0UL == u32) {
+ pctx->pobj->det.b.r = -1.0;
+ }
+ dw = pctx->pobj->det.b.xr - pctx->pobj->det.b.xl;
+ dh = pctx->pobj->det.b.yt - pctx->pobj->det.b.yb;
+ if (dh < dw) {
+ dw = dh;
+ }
+ if ((dw / 2.0) < pctx->pobj->det.b.r) {
+ pctx->pobj->det.b.r = dw / 2.0;
+ /* WARNING: Corner radius corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 119
+ );
+ }
+ pctx->st = ST_OBJECT_LINE;
+ $? "- wxdrd_process_details_box cc=%d", pctx->cc
+}
+
+
+
+/** Process details for an embedded image.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_image(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint32_t u32;
+ $? "+ wxdrd_process_details_image"
+ wxdrd_input_u8(&(pctx->pobj->det.i.fl), pctx, 0);
+ wxdrd_input_i8(&(pctx->pobj->det.i.r2g), pctx, 1);
+ if ((int8_t)(-1) > pctx->pobj->det.i.r2g) {
+ pctx->pobj->det.i.r2g = (int8_t)(-1);
+ /* WARNING: RGB to gray method corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 121
+ );
+ }
+ if (
+ (int8_t)(DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE) < pctx->pobj->det.i.r2g
+ ) {
+ pctx->pobj->det.i.r2g = (int8_t)(DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE);
+ /* WARNING: RGB to gray method corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 121
+ );
+ }
+ wxdrd_input_i8(&(pctx->pobj->det.i.r2c), pctx, 2);
+ wxdrd_input_i32(&i32, pctx, 3);
+ pctx->pobj->det.i.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 4);
+ pctx->pobj->det.i.y = (double)i32;
+ wxdrd_input_u32(&u32, pctx, 5);
+ pctx->pobj->det.i.w = (double)u32;
+ wxdrd_input_u32(&u32, pctx, 6);
+ pctx->pobj->det.i.h = (double)u32;
+ if (1.0 > pctx->pobj->det.i.w) {
+ pctx->cc = -1;
+ /* ERROR: Invalid image width */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 122
+ );
+ }
+ if (1.0 > pctx->pobj->det.i.h) {
+ pctx->cc = -1;
+ /* ERROR: Invalid image height */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 122
+ );
+ }
+ pctx->st = ST_IMAGE_NAME;
+ $? "- wxdrd_process_details_image cc=%d", pctx->cc
+}
+
+
+
+/** Process details for a dot.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_dot(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint16_t u16;
+ $? "+ wxdrd_process_details_dot"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.d.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.d.y = (double)i32;
+ wxdrd_input_u16(&u16, pctx, 2);
+ pctx->pobj->det.d.d = (double)u16;
+ if (1.0 > pctx->pobj->det.d.d) {
+ pctx->pobj->det.d.d = 1.0;
+ /* WARNING: Dot diameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 123
+ );
+ }
+ pctx->st = ST_OBJECT_LINE;
+ $? "- wxdrd_process_details_dot cc=%d", pctx->cc
+}
+
+
+
+/** Process details for a white filled dot.
+ @param pctx Context to modify.
+*/
+static
+void
+wxdrd_process_details_white_dot(wxd_reader_context_t *pctx)
+{
+ int32_t i32;
+ uint16_t u16;
+ $? "+ wxdrd_process_details_white_dot"
+ wxdrd_input_i32(&i32, pctx, 0);
+ pctx->pobj->det.d.x = (double)i32;
+ wxdrd_input_i32(&i32, pctx, 1);
+ pctx->pobj->det.d.y = (double)i32;
+ wxdrd_input_u16(&u16, pctx, 2);
+ if ((uint16_t)0U == u16) {
+ u16 = (uint16_t)1U;
+ /* WARNING: Dot diameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 123
+ );
+ }
+ pctx->pobj->det.d.d = (double)u16;
+ wxdrd_input_u16(&u16, pctx, 3);
+ pctx->pobj->lw = (double)u16;
+ if (1.0 > pctx->pobj->lw) {
+ pctx->pobj->lw = 1.0;
+ /* WARNING: Dot line width corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 124
+ );
+ }
+#if 0
+ if (pctx->pobj->det.d.d < pctx->pobj->lw) {
+ pctx->pobj->det.d.d = pctx->pobj->lw;
+ /* WARNING: Dot diameter corrected */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 123
+ );
+ }
+#endif
+ pctx->st = ST_OBJECT_LINE;
+ $? "- wxdrd_process_details_white_dot cc=%d", pctx->cc
+}
+
+
+
+/** Process details line from input file.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_details_line(wxd_reader_context_t *pctx, char *il)
+{
+ $? "+ wxdrd_process_details_line"
+ if (NULL != pctx->pobj) {
+ pctx->nparts = dk4str8_tokenize(
+ &(pctx->parts[0]), pctx->szparts, il, NULL, NULL
+ );
+ switch (pctx->pobj->ot) {
+ case WXD_OT_TEXT : {
+ if (7 == pctx->nparts) {
+ wxdrd_process_details_text(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_POLYLINE : case WXD_OT_POLYGON : {
+ if (2 == pctx->nparts) {
+ wxdrd_process_details_polyline(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_O_SPLINE : case WXD_OT_C_SPLINE : {
+ if (3 == pctx->nparts) {
+ wxdrd_process_details_spline(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_O_ARC : case WXD_OT_C_ARC : {
+ if (6 == pctx->nparts) {
+ wxdrd_process_details_arc(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_CIRCLE : {
+ if (3 == pctx->nparts) {
+ wxdrd_process_details_circle(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_ELLIPSE : {
+ if (5 == pctx->nparts) {
+ wxdrd_process_details_ellipse(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_BOX : {
+ if (5 == pctx->nparts) {
+ wxdrd_process_details_box(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_IMAGE : {
+ if (7 == pctx->nparts) {
+ wxdrd_process_details_image(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_DOT_FILLED : {
+ if (3 == pctx->nparts) {
+ wxdrd_process_details_dot(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+ case WXD_OT_DOT_WHITE : {
+ if (4 == pctx->nparts) {
+ wxdrd_process_details_white_dot(pctx);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 96
+ );
+ }
+ } break;
+
+ }
+ }
+ else { $? "! BUG, no current object"
+ pctx->cc = -1;
+ /* BUG */
+ }
+ $? "- wxdrd_process_details_line cc=%d", pctx->cc
+}
+
+
+
+/** Process export text line.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_text_export(wxd_reader_context_t *pctx, char *il)
+{
+ $? "+ wxdrd_process_text_export"
+ if (0 < strlen(&(il[1]))) {
+ pctx->pobj->det.t.t = dk4str8_dup(&(il[1]), NULL);
+ if (NULL != pctx->pobj->det.t.t) {
+ pctx->st = ST_TEXT_SCREEN;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 125
+ );
+ }
+ $? "- wxdrd_process_text_export cc=%d", pctx->cc
+}
+
+
+
+/** Process export text line.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_text_screen(wxd_reader_context_t *pctx, char *il)
+{
+ $? "+ wxdrd_process_text_export"
+ if (0 < strlen(&(il[1]))) {
+ pctx->pobj->det.t.tsc = dk4str8_dup(&(il[1]), NULL);
+ if (NULL != pctx->pobj->det.t.tsc) {
+ pctx->st = ST_OBJECT_LINE;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->pobj->det.t.tsc = NULL;
+ pctx->st = ST_OBJECT_LINE;
+ }
+ $? "- wxdrd_process_text_export cc=%d", pctx->cc
+}
+
+
+
+/** Process the line containing the image file name.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_image_file_line(wxd_reader_context_t *pctx, char *il)
+{
+ dk4str8_delnl(&(il[1]));
+ if (0 < dk4str8_len(&(il[1]))) {
+ pctx->pobj->det.i.fn = dk4str8_dup(&(il[1]), NULL);
+ if (NULL != pctx->pobj->det.i.fn) {
+ pctx->st = ST_OBJECT_LINE;
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Memory */
+ dk4app_log_base1(pctx->app, DK4_LL_ERROR, 90);
+ }
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Syntax */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 126
+ );
+ }
+}
+
+
+
+/** Process one non-comment line from input file.
+ @param pctx Context to modify.
+ @param il Input line to process.
+*/
+static
+void
+wxdrd_process_line(wxd_reader_context_t *pctx, char *il)
+{
+ int sl = 1; /* Object start line */
+ $? "+ wxdrd_process_line \"%!8s\"", il
+ if (0 != is_whsp(il[0])) { sl = 0; }
+ switch (pctx->st) {
+ case ST_FIRSTLINE : {
+ if (1 == sl) {
+ wxdrd_process_filetype_line(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Not a wxd file */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 4
+ );
+ }
+ } break;
+ case ST_OBJECT_LINE : {
+ if (1 == sl) {
+ wxdrd_process_object_line(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Object start line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 127
+ );
+ }
+ } break;
+ case ST_DETAIL_LINE : {
+ if (0 == sl) {
+ wxdrd_process_details_line(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Details line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 128
+ );
+ }
+ } break;
+ case ST_TEXT_EXPORT : {
+ if (0 == sl) {
+ wxdrd_process_text_export(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Details line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 128
+ );
+ }
+ } break;
+ case ST_TEXT_SCREEN : {
+ if (0 == sl) {
+ wxdrd_process_text_screen(pctx, il);
+ }
+ else {
+ /* WARNING: Details line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_WARNING, 128
+ );
+ pctx->st = ST_OBJECT_LINE;
+ wxdrd_process_object_line(pctx, il);
+ }
+ } break;
+ case ST_IMAGE_NAME : {
+ if (0 == sl) {
+ wxdrd_process_image_file_line(pctx, il);
+ }
+ else {
+ pctx->cc = -1;
+ /* ERROR: Details line expected! */
+ dk4app_log_1(
+ pctx->app, pctx->msg, pctx->sz_msg, DK4_LL_ERROR, 128
+ );
+ }
+ } break;
+ case ST_RESUME : {
+ if (1 == sl) {
+ pctx->st = ST_OBJECT_LINE;
+ wxdrd_process_object_line(pctx, il);
+ }
+ } break;
+ }
+ $? "- wxdrd_process_line cc=%d", pctx->cc
+}
+
+
+
+int
+wxdrd_apply_file(
+ wxd_drawing_t *drw,
+ FILE *fipo,
+ const dkChar *fn,
+ wxd2lat_job_t *job
+)
+{
+ char inbuf[WXD_LINE_LENGTH];
+ wxd_reader_context_t ctx;
+ char *parts[32];
+ const dkChar *osf = NULL; /* Old source file */
+ dk4_um_t osl = 0UL; /* Old source line number */
+ int back = 0; /* Function result */
+ $? "+ wxdrd_apply_file \"%!ds\"", fn
+ /*
+ Arguments check
+ */
+ if ((NULL == drw) || (NULL == fipo)) { goto finished; }
+ /*
+ Keep source file and line number
+ */
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, fn);
+ dk4app_set_log_source_line(job->app, 0UL);
+ /*
+ Initialize reader context. INITCONTEXT
+ */
+ DK4_MEMRES(&ctx,sizeof(wxd_reader_context_t));
+ ctx.st = ST_FIRSTLINE;
+ ctx.cc = 1;
+ ctx.back = 1;
+ ctx.parts = parts;
+ ctx.szparts = DK4_SIZEOF(parts,DK4_PCHAR);
+ ctx.nparts = 0;
+ ctx.lineno = (dk4_um_t)0UL;
+ ctx.grdepth = (dk4_um_t)0UL;
+ $? ". grdepth = %lu", (unsigned long)(ctx.grdepth)
+ ctx.fn = fn;
+ ctx.app = job->app;
+ ctx.msg = job->msg;
+ ctx.sz_msg = job->sz_msg;
+ ctx.drw = drw;
+ ctx.pobj = NULL;
+ ctx.curp = 0;
+ wxd_object_initialize(&(ctx.tobj));
+ /*
+ Process input file
+ */
+ while (1 == ctx.cc) {
+ if (NULL != fgets(inbuf, sizeof(inbuf), fipo)) {
+ if (DK4_UM_MAX > ctx.lineno) { ctx.lineno += (dk4_um_t)1UL; }
+ dk4app_set_log_source_line(job->app, ctx.lineno);
+ dk4str8_delnl(inbuf);
+ if ('#' != inbuf[0]) {
+ wxdrd_process_line(&ctx, inbuf);
+ }
+ }
+ else {
+ ctx.cc = 0;
+ }
+ }
+ if (0 > ctx.cc) {
+ ctx.back = 0;
+ }
+ else {
+ if (ST_OBJECT_LINE != ctx.st) {
+ if (ST_TEXT_SCREEN == ctx.st) {
+ /* WARNING: Expecting screen text */
+ dk4app_log_1(
+ ctx.app, ctx.msg, ctx.sz_msg, DK4_LL_WARNING, 129
+ );
+ }
+ else {
+ ctx.back = 0;
+ /* ERROR: Syntax - Unexpected end of file */
+ dk4app_log_1(
+ ctx.app, ctx.msg, ctx.sz_msg, DK4_LL_ERROR, 130
+ );
+ }
+ }
+ }
+ back = ctx.back;
+ /*
+ Restore source file and line number
+ */
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ finished:
+ $? "- wxdrd_apply_file %d", back
+ return back;
+}
+
+
+
+wxd_drawing_t *
+wxdrd_open_from_file(const dkChar *fn, wxd2lat_job_t *job)
+{
+ wxd_drawing_t *back = NULL;
+ FILE *fipo = NULL;
+ const dkChar *osf = NULL;
+ dk4_um_t osl = 0UL;
+ int res = 0;
+
+ osf = dk4app_get_log_source_file(job->app);
+ osl = dk4app_get_log_source_line(job->app);
+ dk4app_set_log_source_file(job->app, fn);
+ dk4app_set_log_source_line(job->app, 0UL);
+ back = wxdrd_open_empty();
+ if (NULL != back) {
+ fipo = dk4fopen_app(fn, dkT("r"), 0, job->app);
+ if (NULL != fipo) {
+ res = wxdrd_apply_file(back, fipo, fn, job);
+ fclose(fipo);
+ }
+ else {
+ /* ERROR: Failed to open file. Already reported. */
+ }
+ if (0 == res) {
+ wxdrd_close(back);
+ back = NULL;
+ }
+ }
+ else {
+ /* ERROR: Memory */
+ dk4app_log_base1(job->app, DK4_LL_ERROR, 90);
+ }
+ dk4app_set_log_source_file(job->app, osf);
+ dk4app_set_log_source_line(job->app, osl);
+ return back;
+}
+
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxdrd.h b/support/dktools/wxdrd.h
new file mode 100644
index 0000000000..9fa59137ba
--- /dev/null
+++ b/support/dktools/wxdrd.h
@@ -0,0 +1,87 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdrd.ctr
+*/
+
+/** @file wxdrd.h Header file for the wxdrd module.
+*/
+
+#ifndef WXDRD_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDRD_H_INCLUDED 1
+
+
+#line 8 "wxdrd.ctr"
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifndef WXDTYPES_H_INCLUDED
+#include "wxdtypes.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** Open a drawing from file.
+ @param fn File name.
+ @param job Job structure.
+ @return Valid pointer to drawing on success, NULL on error.
+*/
+
+wxd_drawing_t *
+wxdrd_open_from_file(const dkChar *fn, wxd2lat_job_t *job);
+
+
+/** Open a new empty drawing.
+ @return Valid pointer to drawing on success, NULL on error.
+*/
+
+wxd_drawing_t *
+wxdrd_open_empty(void);
+
+
+/** Apply file contents to empty drawing.
+ @param drw Drawing to modify.
+ @param fipo File pointer, opened for text reading.
+ @param fn File name, may be NULL.
+ @param job Job structure.
+ @return 1 on success, 0 on error.
+*/
+
+int
+wxdrd_apply_file(
+ wxd_drawing_t *drw,
+ FILE *fipo,
+ const dkChar *fn,
+ wxd2lat_job_t *job
+);
+
+
+/** Close drawing and release resources.
+ @param drw Drawing to close.
+*/
+
+void
+wxdrd_close(wxd_drawing_t *drw);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+
+#endif
diff --git a/support/dktools/wxdstr.c b/support/dktools/wxdstr.c
new file mode 100644
index 0000000000..06e355e7d0
--- /dev/null
+++ b/support/dktools/wxdstr.c
@@ -0,0 +1,67 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdstr.ctr
+*/
+
+/** @file wxdstr.c The wxdstr module.
+*/
+
+
+#line 38 "wxdstr.ctr"
+
+#include "wxd2lat.h"
+
+
+
+
+
+#line 44 "wxdstr.ctr"
+
+
+
+/** Default string table to use if localized texts are not found.
+*/
+static const dkChar * const wxdrdstr_tbl[] = {
+/* 0 */
+dkT("HELLO!"),
+
+NULL
+
+
+#line 56 "wxdstr.ctr"
+};
+
+
+
+/** File name containing localized texts.
+*/
+static const dkChar wxrdstr_filename[] = {
+ dkT("wxrdstr.str")
+};
+
+
+
+const dkChar * const *
+wxdrdstr_texts(
+ dk4_app_t *app
+)
+{
+ const dkChar * const *back = wxdrdstr_tbl;
+ if (NULL != app) {
+ back = dk4app_string_table(app, wxrdstr_filename, wxdrdstr_tbl);
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxdstr.ctr b/support/dktools/wxdstr.ctr
new file mode 100644
index 0000000000..47e0263e25
--- /dev/null
+++ b/support/dktools/wxdstr.ctr
@@ -0,0 +1,83 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file wxdrdstr.h String table for wxDraw read operations.
+*/
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve string table containing localized texts.
+ @param app Application to use while retrieving the string table.
+ @return Pointer to localized texts on success,
+ pointer to texts in English on problems.
+ Do not release the string table, it is either managed by the app
+ structure or a static string table.
+*/
+const dkChar * const *
+wxdrdstr_texts(
+ dk4_app_t *app
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+%% module
+
+#include "wxd2lat.h"
+
+
+
+$!trace-include
+
+
+
+/** Default string table to use if localized texts are not found.
+*/
+static const dkChar * const wxdrdstr_tbl[] = {
+$!string-table file=wxrdstr.str,macro=dkT
+#
+# 0 UNUSED
+#
+HELLO!
+$!end
+};
+
+
+
+/** File name containing localized texts.
+*/
+static const dkChar wxrdstr_filename[] = {
+ dkT("wxrdstr.str")
+};
+
+
+
+const dkChar * const *
+wxdrdstr_texts(
+ dk4_app_t *app
+)
+{
+ const dkChar * const *back = wxdrdstr_tbl;
+ if (NULL != app) {
+ back = dk4app_string_table(app, wxrdstr_filename, wxdrdstr_tbl);
+ }
+ return back;
+}
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxdstr.h b/support/dktools/wxdstr.h
new file mode 100644
index 0000000000..f438ff602d
--- /dev/null
+++ b/support/dktools/wxdstr.h
@@ -0,0 +1,50 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdstr.ctr
+*/
+
+#ifndef WXDSTR_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDSTR_H_INCLUDED 1
+
+
+#line 8 "wxdstr.ctr"
+
+/** @file wxdrdstr.h String table for wxDraw read operations.
+*/
+
+#ifndef DK4APP_H_INCLUDED
+#include "dk4app.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Retrieve string table containing localized texts.
+ @param app Application to use while retrieving the string table.
+ @return Pointer to localized texts on success,
+ pointer to texts in English on problems.
+ Do not release the string table, it is either managed by the app
+ structure or a static string table.
+*/
+const dkChar * const *
+wxdrdstr_texts(
+ dk4_app_t *app
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/support/dktools/wxdtypes.ctr b/support/dktools/wxdtypes.ctr
new file mode 100644
index 0000000000..3f9e98f3fd
--- /dev/null
+++ b/support/dktools/wxdtypes.ctr
@@ -0,0 +1,304 @@
+%% options
+
+copyright owner = Dirk Krause
+copyright year = 2018-xxxx
+SPDX-License-Identifier: BSD-3-Clause
+
+%% header
+
+/** @file wxdtypes.h Data types for the wxd2lat program.
+
+ The wxd_... types correspond to the Wxd_... type in the
+ ../wxdkdraw/drawtypes.h file.
+ Here we use char for UTF-8 encoded strings, in the
+ ../wxdkdraw/drawtypes.h file we use wxChar for strings
+ shown in the GUI.
+
+ Although coordinates are defined as int in the file format
+ we use double here to avoid extra memory allocations for
+ coordinate values in bp and to avoid lots of (double) casts
+ in calculations.
+*/
+
+#ifndef DK4STO_H_INCLUDED
+#include "dk4sto.h"
+#endif
+
+
+
+/** Arrowhead data.
+ Type, length and width are obtained from file.
+ Offset, cut and cut tolerance are calculated by the program.
+ For polyline and arc the minimal cut is used, calculation is
+ straightforward. The calculation on splines is iterative, so we
+ accept a tolerance.
+*/
+typedef struct {
+ double offset; /**< Offset arrow end point to draw point in bp. */
+ double cut; /**< Amount to cut the line in bp. */
+ double cuttol; /**< Cutting tolerance in bp. */
+ uint8_t type; /**< Arrowead type. */
+ uint8_t length; /**< Arrowhead length. */
+ uint8_t width; /**< Arrowhead width. */
+} wxd_arrow_t;
+
+
+
+#if 0
+/** Polygon or polyline point.
+*/
+typedef struct {
+ double x; /**< X position. */
+ double y; /**< Y position. */
+} wxd_point_t;
+#else
+/** Polygon or polyline point.
+*/
+typedef dk4_gra_point_t wxd_point_t;
+#endif
+
+
+/** X-Spline point.
+*/
+typedef struct {
+ double x; /**< X position. */
+ double y; /**< Y position. */
+ double s; /**< S parameter. */
+} wxd_spline_point_t;
+
+
+
+/** Details for a text.
+*/
+typedef struct {
+ char *t; /**< Text to export, UTF-8 encoded. */
+ char *tsc; /**< Text to show on screen, UTF-8 encoded. */
+ double x; /**< X position. */
+ double y; /**< Y position. */
+ double a; /**< Rotation counterclockwise in degree. */
+ uint16_t fsz; /**< Font size. */
+ uint8_t find; /**< Font index. */
+ uint8_t al; /**< Horizontal align. */
+ uint8_t fl; /**< Text flags. */
+} wxd_det_text_t;
+
+
+
+/** Polygon and polyline details.
+*/
+typedef struct {
+ wxd_point_t *p; /**< Points. */
+ uint16_t n; /**< Number of points. */
+} wxd_det_pl_t;
+
+
+
+/** X-Spline details (opened and closed).
+ The sl and suml components are only used for open splines
+ with at least one arrowhead.
+*/
+typedef struct {
+ wxd_spline_point_t *p; /**< Points. */
+ double *sl; /**< Segment lengths. */
+ double ts; /**< Parameter t to start drawing. */
+ double te; /**< Parameter t to end drawing. */
+ double suml; /**< Summary of segment lengths. */
+ uint16_t n; /**< Number of points. */
+} wxd_det_xs_t;
+
+
+
+/** Details for arcs (opened and closed).
+*/
+typedef struct {
+ double a; /**< Start angle alpha counterclockwise in radians. */
+ double b; /**< End angle beta counterclockwise in radians. */
+ double x; /**< X position of center point. */
+ double y; /**< Y position of center point. */
+ double r; /**< Radius. */
+ int32_t x1; /**< X position point 1 in wxdkdraw units. */
+ int32_t y1; /**< Y position point 1 in wxdkdraw units. */
+ int32_t x2; /**< X position point 2 in wxdkdraw units. */
+ int32_t y2; /**< Y position point 2 in wxdkdraw units. */
+ int32_t x3; /**< X position point 3 in wxdkdraw units. */
+ int32_t y3; /**< Y position point 3 in wxdkdraw units. */
+ int8_t d; /**< Direction: 1=positive, -1=negative, 0=unknown. */
+} wxd_det_arc_t;
+
+
+
+/** Details for dot.
+*/
+typedef struct {
+ double x; /**< X position of center point. */
+ double y; /**< Y position of center point. */
+ double d; /**< Diameter in multiples of the base line width. */
+} wxd_det_dot_t;
+
+
+/** Details for an ellipse or a circle.
+*/
+typedef struct {
+ double x; /**< X position of center point. */
+ double y; /**< Y position of center point. */
+ double rx; /**< X radius for ellipse, radius for circle. */
+ double ry; /**< Y radius for ellipse. */
+ double a; /**< Rotation counterclockwise in degree. */
+} wxd_det_ellipse_t;
+
+
+
+/** Details for a box.
+*/
+typedef struct {
+ double xl; /**< Left X position. */
+ double xr; /**< Right X position. */
+ double yb; /**< Bottom Y position. */
+ double yt; /**< Top Y position. */
+ double r; /**< Corner radius, 0 for no rounded corner. */
+} wxd_det_box_t;
+
+
+
+/** Details for an embedded image.
+*/
+typedef struct {
+ char *fn; /**< File name for image, UTF-8 encoded. */
+ double x; /**< X position (left bottom point). */
+ double y; /**< Y position (left bottom point). */
+ double w; /**< Width of image range. */
+ double h; /**< Height of image range. */
+ uint8_t fl; /**< Image flags. */
+ int8_t r2g; /**< RGB to gray conversion method. */
+ int8_t r2c; /**< RGB to CMYK conversion method. */
+} wxd_det_image_t;
+
+
+
+/* 2018-05-25 No details for groups.
+ Conversion programs only need the flattened object list and are not
+ interested in keeping the group structure.
+*/
+
+
+
+/** Union of different details.
+*/
+typedef union {
+ wxd_det_text_t t; /**< Text details. */
+ wxd_det_pl_t p; /**< Polygon and polyline details. */
+ wxd_det_xs_t s; /**< Spline details. */
+ wxd_det_arc_t a; /**< Arc and circle details. */
+ wxd_det_dot_t d; /**< Dot details. */
+ wxd_det_ellipse_t e; /**< Ellipse details. */
+ wxd_det_box_t b; /**< Box details. */
+ wxd_det_image_t i; /**< Image details. */
+} wxd_det_t;
+
+
+
+/** One drawing element.
+
+ The csfs component contains the line cap style for open objects,
+ the fill style for closed objects.
+ The forward arrow and backward arrow components are ignored for
+ closed objects.
+*/
+typedef struct {
+ wxd_det_t det; /**< Graphics element details. */
+ wxd_arrow_t af; /**< Arrowhead forward. */
+ wxd_arrow_t ab; /**< Arrowhead backward. */
+ double lw; /**< Line width in multiples of the base width. */
+ dk4_um_t lino; /**< Line number. */
+ int16_t lay; /**< Layer number. */
+ int16_t ot; /**< Object type. */
+ uint8_t fc[3]; /**< Fill color. */
+ uint8_t sc[3]; /**< Stroke color. */
+ uint8_t csfs; /**< Line cap style (open), fill style (close). */
+ uint8_t ls; /**< Line style. */
+ uint8_t sl; /**< Style length. */
+ uint8_t js; /**< Line join style. */
+ uint8_t ml; /**< Miter limit for mitered line join. */
+} wxd_object_t;
+
+
+
+/** Entire drawing.
+ The flattened container contains all objects of the drawing without
+ any group structure. In the drawing application elements are sorted
+ by layer number, in the exporting application they are sorted by
+ layer number and style attributes.
+ The drawing program uses a second container s_grob representing
+ the drawing inclusive group structure.
+ For conversion programs like wxd2lat there is no need to keep the
+ group structure, s_grob is not defined in these programs.
+*/
+typedef struct {
+ dk4_sto_t *s_flat; /**< Flattened container of all objects. */
+ dk4_sto_it_t *i_flat; /**< Iterator for flattened container. */
+ double bbxl; /**< Bounding box, x left. */
+ double bbxr; /**< Bounding box, x right. */
+ double bbyb; /**< Bounding box, y bottom. */
+ double bbyt; /**< Bounding box, y top. */
+ double baselw; /**< Base line width in bp. */
+ uint16_t fv_maj; /**< Format version major number. */
+ uint16_t fv_min; /**< Format version minor number. */
+} wxd_drawing_t;
+
+
+
+/** One segment of an arrowhead on an arc.
+*/
+typedef struct {
+ /** The following points are in p:
+ - Left end point (0).
+ - Left control point (1).
+ - Right control point (2).
+ - Right end point (3).
+ */
+ dk4_gra_point_t p[4];
+} arc_ah_seg_t;
+
+
+
+/** Details for a spline arrowhead.
+*/
+typedef struct {
+ wxd_point_t *ppoints; /**< Calculated points. */
+ double lo; /**< Length to offset (arrow head point). */
+ double lb; /**< Lenth to end of front side. */
+ double lc; /**< Length to end of back side, start center. */
+ double to; /**< Parameter for offset (arrow head point). */
+ double tb; /**< Parameter at end of front side. */
+ double tc; /**< Parameter at end of back side, start center. */
+ double csgn; /**< Coefficient for lengths. */
+ double lw; /**< Line width. */
+ double x0; /**< First point x. */
+ double y0; /**< First point y. */
+ double x1; /**< Second point x. */
+ double y1; /**< Second point y. */
+ size_t nf; /**< Number of segments in front side edges. */
+ size_t nb; /**< Number of segments in back side edges. */
+ size_t nc; /**< Number of segments in center side edge. */
+ size_t ifl; /**< Start index of first front left edge point. */
+ size_t ifr; /**< Start index of first front right edge point. */
+ size_t ibl; /**< Start index of first back left edge point. */
+ size_t ibr; /**< Start index of first back right edge point. */
+ size_t ic; /**< Start index of first center edge point. */
+} sp_ah_t;
+
+
+
+/** Iteration object for X-spline calculations.
+*/
+typedef struct {
+ wxd_object_t *pobj;
+ dk4_er_t *erp;
+ double l;
+ double xslp;
+} wxd2lxs_iter_t;
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wxdtypes.h b/support/dktools/wxdtypes.h
new file mode 100644
index 0000000000..bbd883cfb9
--- /dev/null
+++ b/support/dktools/wxdtypes.h
@@ -0,0 +1,318 @@
+/*
+Copyright (C) 2018-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+/*
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: wxdtypes.ctr
+*/
+
+#ifndef WXDTYPES_H_INCLUDED
+/** Avoid multiple inclusions. */
+#define WXDTYPES_H_INCLUDED 1
+
+
+#line 8 "wxdtypes.ctr"
+
+/** @file wxdtypes.h Data types for the wxd2lat program.
+
+ The wxd_... types correspond to the Wxd_... type in the
+ ../wxdkdraw/drawtypes.h file.
+ Here we use char for UTF-8 encoded strings, in the
+ ../wxdkdraw/drawtypes.h file we use wxChar for strings
+ shown in the GUI.
+
+ Although coordinates are defined as int in the file format
+ we use double here to avoid extra memory allocations for
+ coordinate values in bp and to avoid lots of (double) casts
+ in calculations.
+*/
+
+#ifndef DK4STO_H_INCLUDED
+#include "dk4sto.h"
+#endif
+
+
+
+/** Arrowhead data.
+ Type, length and width are obtained from file.
+ Offset, cut and cut tolerance are calculated by the program.
+ For polyline and arc the minimal cut is used, calculation is
+ straightforward. The calculation on splines is iterative, so we
+ accept a tolerance.
+*/
+typedef struct {
+ double offset; /**< Offset arrow end point to draw point in bp. */
+ double cut; /**< Amount to cut the line in bp. */
+ double cuttol; /**< Cutting tolerance in bp. */
+ uint8_t type; /**< Arrowead type. */
+ uint8_t length; /**< Arrowhead length. */
+ uint8_t width; /**< Arrowhead width. */
+} wxd_arrow_t;
+
+
+
+#if 0
+/** Polygon or polyline point.
+*/
+typedef struct {
+ double x; /**< X position. */
+ double y; /**< Y position. */
+} wxd_point_t;
+#else
+/** Polygon or polyline point.
+*/
+typedef dk4_gra_point_t wxd_point_t;
+#endif
+
+
+/** X-Spline point.
+*/
+typedef struct {
+ double x; /**< X position. */
+ double y; /**< Y position. */
+ double s; /**< S parameter. */
+} wxd_spline_point_t;
+
+
+
+/** Details for a text.
+*/
+typedef struct {
+ char *t; /**< Text to export, UTF-8 encoded. */
+ char *tsc; /**< Text to show on screen, UTF-8 encoded. */
+ double x; /**< X position. */
+ double y; /**< Y position. */
+ double a; /**< Rotation counterclockwise in degree. */
+ uint16_t fsz; /**< Font size. */
+ uint8_t find; /**< Font index. */
+ uint8_t al; /**< Horizontal align. */
+ uint8_t fl; /**< Text flags. */
+} wxd_det_text_t;
+
+
+
+/** Polygon and polyline details.
+*/
+typedef struct {
+ wxd_point_t *p; /**< Points. */
+ uint16_t n; /**< Number of points. */
+} wxd_det_pl_t;
+
+
+
+/** X-Spline details (opened and closed).
+ The sl and suml components are only used for open splines
+ with at least one arrowhead.
+*/
+typedef struct {
+ wxd_spline_point_t *p; /**< Points. */
+ double *sl; /**< Segment lengths. */
+ double ts; /**< Parameter t to start drawing. */
+ double te; /**< Parameter t to end drawing. */
+ double suml; /**< Summary of segment lengths. */
+ uint16_t n; /**< Number of points. */
+} wxd_det_xs_t;
+
+
+
+/** Details for arcs (opened and closed).
+*/
+typedef struct {
+ double a; /**< Start angle alpha counterclockwise in radians. */
+ double b; /**< End angle beta counterclockwise in radians. */
+ double x; /**< X position of center point. */
+ double y; /**< Y position of center point. */
+ double r; /**< Radius. */
+ int32_t x1; /**< X position point 1 in wxdkdraw units. */
+ int32_t y1; /**< Y position point 1 in wxdkdraw units. */
+ int32_t x2; /**< X position point 2 in wxdkdraw units. */
+ int32_t y2; /**< Y position point 2 in wxdkdraw units. */
+ int32_t x3; /**< X position point 3 in wxdkdraw units. */
+ int32_t y3; /**< Y position point 3 in wxdkdraw units. */
+ int8_t d; /**< Direction: 1=positive, -1=negative, 0=unknown. */
+} wxd_det_arc_t;
+
+
+
+/** Details for dot.
+*/
+typedef struct {
+ double x; /**< X position of center point. */
+ double y; /**< Y position of center point. */
+ double d; /**< Diameter in multiples of the base line width. */
+} wxd_det_dot_t;
+
+
+/** Details for an ellipse or a circle.
+*/
+typedef struct {
+ double x; /**< X position of center point. */
+ double y; /**< Y position of center point. */
+ double rx; /**< X radius for ellipse, radius for circle. */
+ double ry; /**< Y radius for ellipse. */
+ double a; /**< Rotation counterclockwise in degree. */
+} wxd_det_ellipse_t;
+
+
+
+/** Details for a box.
+*/
+typedef struct {
+ double xl; /**< Left X position. */
+ double xr; /**< Right X position. */
+ double yb; /**< Bottom Y position. */
+ double yt; /**< Top Y position. */
+ double r; /**< Corner radius, 0 for no rounded corner. */
+} wxd_det_box_t;
+
+
+
+/** Details for an embedded image.
+*/
+typedef struct {
+ char *fn; /**< File name for image, UTF-8 encoded. */
+ double x; /**< X position (left bottom point). */
+ double y; /**< Y position (left bottom point). */
+ double w; /**< Width of image range. */
+ double h; /**< Height of image range. */
+ uint8_t fl; /**< Image flags. */
+ int8_t r2g; /**< RGB to gray conversion method. */
+ int8_t r2c; /**< RGB to CMYK conversion method. */
+} wxd_det_image_t;
+
+
+
+/* 2018-05-25 No details for groups.
+ Conversion programs only need the flattened object list and are not
+ interested in keeping the group structure.
+*/
+
+
+
+/** Union of different details.
+*/
+typedef union {
+ wxd_det_text_t t; /**< Text details. */
+ wxd_det_pl_t p; /**< Polygon and polyline details. */
+ wxd_det_xs_t s; /**< Spline details. */
+ wxd_det_arc_t a; /**< Arc and circle details. */
+ wxd_det_dot_t d; /**< Dot details. */
+ wxd_det_ellipse_t e; /**< Ellipse details. */
+ wxd_det_box_t b; /**< Box details. */
+ wxd_det_image_t i; /**< Image details. */
+} wxd_det_t;
+
+
+
+/** One drawing element.
+
+ The csfs component contains the line cap style for open objects,
+ the fill style for closed objects.
+ The forward arrow and backward arrow components are ignored for
+ closed objects.
+*/
+typedef struct {
+ wxd_det_t det; /**< Graphics element details. */
+ wxd_arrow_t af; /**< Arrowhead forward. */
+ wxd_arrow_t ab; /**< Arrowhead backward. */
+ double lw; /**< Line width in multiples of the base width. */
+ dk4_um_t lino; /**< Line number. */
+ int16_t lay; /**< Layer number. */
+ int16_t ot; /**< Object type. */
+ uint8_t fc[3]; /**< Fill color. */
+ uint8_t sc[3]; /**< Stroke color. */
+ uint8_t csfs; /**< Line cap style (open), fill style (close). */
+ uint8_t ls; /**< Line style. */
+ uint8_t sl; /**< Style length. */
+ uint8_t js; /**< Line join style. */
+ uint8_t ml; /**< Miter limit for mitered line join. */
+} wxd_object_t;
+
+
+
+/** Entire drawing.
+ The flattened container contains all objects of the drawing without
+ any group structure. In the drawing application elements are sorted
+ by layer number, in the exporting application they are sorted by
+ layer number and style attributes.
+ The drawing program uses a second container s_grob representing
+ the drawing inclusive group structure.
+ For conversion programs like wxd2lat there is no need to keep the
+ group structure, s_grob is not defined in these programs.
+*/
+typedef struct {
+ dk4_sto_t *s_flat; /**< Flattened container of all objects. */
+ dk4_sto_it_t *i_flat; /**< Iterator for flattened container. */
+ double bbxl; /**< Bounding box, x left. */
+ double bbxr; /**< Bounding box, x right. */
+ double bbyb; /**< Bounding box, y bottom. */
+ double bbyt; /**< Bounding box, y top. */
+ double baselw; /**< Base line width in bp. */
+ uint16_t fv_maj; /**< Format version major number. */
+ uint16_t fv_min; /**< Format version minor number. */
+} wxd_drawing_t;
+
+
+
+/** One segment of an arrowhead on an arc.
+*/
+typedef struct {
+ /** The following points are in p:
+ - Left end point (0).
+ - Left control point (1).
+ - Right control point (2).
+ - Right end point (3).
+ */
+ dk4_gra_point_t p[4];
+} arc_ah_seg_t;
+
+
+
+/** Details for a spline arrowhead.
+*/
+typedef struct {
+ wxd_point_t *ppoints; /**< Calculated points. */
+ double lo; /**< Length to offset (arrow head point). */
+ double lb; /**< Lenth to end of front side. */
+ double lc; /**< Length to end of back side, start center. */
+ double to; /**< Parameter for offset (arrow head point). */
+ double tb; /**< Parameter at end of front side. */
+ double tc; /**< Parameter at end of back side, start center. */
+ double csgn; /**< Coefficient for lengths. */
+ double lw; /**< Line width. */
+ double x0; /**< First point x. */
+ double y0; /**< First point y. */
+ double x1; /**< Second point x. */
+ double y1; /**< Second point y. */
+ size_t nf; /**< Number of segments in front side edges. */
+ size_t nb; /**< Number of segments in back side edges. */
+ size_t nc; /**< Number of segments in center side edge. */
+ size_t ifl; /**< Start index of first front left edge point. */
+ size_t ifr; /**< Start index of first front right edge point. */
+ size_t ibl; /**< Start index of first back left edge point. */
+ size_t ibr; /**< Start index of first back right edge point. */
+ size_t ic; /**< Start index of first center edge point. */
+} sp_ah_t;
+
+
+
+/** Iteration object for X-spline calculations.
+*/
+typedef struct {
+ wxd_object_t *pobj;
+ dk4_er_t *erp;
+ double l;
+ double xslp;
+} wxd2lxs_iter_t;
+
+
+
+/* vim: set ai sw=4 ts=4 : */
+
+
+#endif
diff --git a/support/dktools/wximgsz.desktop b/support/dktools/wximgsz.desktop
index 8e50ad1470..0e37d0c91e 100644
--- a/support/dktools/wximgsz.desktop
+++ b/support/dktools/wximgsz.desktop
@@ -1,6 +1,4 @@
-
[Desktop Entry]
-Encoding=UTF-8
Categories=Application;Graphics;
Name=wximgsz
Comment=Suggest size pairs to rescale bitmap images
diff --git a/support/dktools/wximgsz.h b/support/dktools/wximgsz.h
index baabc2f3a6..5040df083b 100644
--- a/support/dktools/wximgsz.h
+++ b/support/dktools/wximgsz.h
@@ -1,86 +1,231 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
-#ifndef WXIMGSZ_H_INCLUDED
-/** Protection against multiple inclusion. */
-#define WXIMGSZ_H_INCLUDED 1
+#ifndef H_INCLUDED_wximgsz
+/** Include file only once.
+*/
+#define H_INCLUDED_wximgsz 1
-#ifdef DK3_USE_WX
-#undef DK3_USE_WX
+#ifndef DK4CONF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4conf.h>
+#else
+#include <dktools-4/dk4conf.h>
+#endif
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4types.h>
+#else
+#include <dktools-4/dk4types.h>
+#endif
+#endif
+
+#ifndef DK4NUMCO_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4numco.h>
+#else
+#include <dktools-4/dk4numco.h>
+#endif
#endif
-/** Use wxWidgets libraries to build GUI programs.
-*/
-#define DK3_USE_WX 1
-#include <dk3all.h>
+#ifndef DK4MEM_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4mem.h>
+#else
+#include <dktools-4/dk4mem.h>
+#endif
+#endif
-#if 0
-#include <dk3sock.h>
+#ifndef DK4STRX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4strx.h>
+#else
+#include <dktools-4/dk4strx.h>
+#endif
#endif
-#if 0
-#include <dkt-version.h>
+#ifndef DK4MAOXD_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4maoxd.h>
+#else
+#include <dktools-4/dk4maoxd.h>
#endif
+#endif
+
+#ifndef WX_WXPREC_H_INCLUDED
#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif
+
#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
#endif
+#endif
+
+#ifndef WX_ARRSTR_H_INCLUDED
+#include <wx/arrstr.h>
+#define WX_ARRSTR_H_INCLUDED 1
+#endif
+
+#ifndef WX_CONFIG_H_INCLUDED
#include <wx/config.h>
+#define WX_CONFIG_H_INCLUDED 1
+#endif
+
+#ifndef WX_FILENAME_H_INCLUDED
#include <wx/filename.h>
+#define WX_FILENAME_H_INCLUDED 1
+#endif
+
+#ifndef WX_GBSIZER_H_INCLUDED
#include <wx/gbsizer.h>
+#define WX_GBSIZER_H_INCLUDED 1
+#endif
+
+#ifndef WX_THREAD_H_INCLUDED
#include <wx/thread.h>
+#define WX_THREAD_H_INCLUDED 1
+#endif
+
+#ifndef WX_GAUGE_H_INCLUDED
#include <wx/gauge.h>
+#define WX_GAUGE_H_INCLUDED 1
+#endif
+
+#ifndef WX_HELP_H_INCLUDED
#include <wx/help.h>
+#define WX_HELP_H_INCLUDED 1
+#endif
+
+#ifndef WX_FS_ZIP_H_INCLUDED
#include <wx/fs_zip.h>
+#define WX_FS_ZIP_H_INCLUDED 1
+#endif
+
+#ifndef WX_CMDLINE_H_INCLUDED
#include <wx/cmdline.h>
-#include <wx/grid.h>
-#include <wx/version.h>
+#define WX_CMDLINE_H_INCLUDED 1
+#endif
-#include "dk3wxs.h"
-#include "dk4verswx.h"
+#ifndef WX_DIR_H_INCLUDED
+#include <wx/dir.h>
+#define WX_DIR_H_INCLUDED 1
+#endif
-#include "DkWxAppHelper.h"
-#include "DkWxFrame.h"
-#include "DkWxCommunicator.h"
-#include "DkWxProgressDialog.h"
-#include "DkWxHelpController.h"
+#ifndef WX_SPINCTRL_H_INCLUDED
+#include <wx/spinctrl.h>
+#define WX_SPINCTRL_H_INCLUDED 1
+#endif
-#include "DkWxImgszApp.h"
-#include "DkWxImgszFrame.h"
-#include "DkWxImgszOptionsDialog.h"
+#ifndef WX_GRID_H_INCLUDED
+#include <wx/grid.h>
+#define WX_GRID_H_INCLUDED 1
+#endif
-/** Event ID: Exit application.
+/* __CHANGE__ 018: Add further wxWidgets header files.
*/
-#define DkWxImgsz_Quit wxID_EXIT
-/** Event ID: Show about dialog box.
-*/
-#define DkWxImgsz_About wxID_ABOUT
-/** Event ID: Main window ID.
-*/
-#define DkWxImgsz_MainWindow (wxID_HIGHEST + 1)
+#ifndef DK4WXAPPLICTIONHELPER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <Dk4WxApplicationHelper.h>
+#else
+#include <dktools-4/Dk4WxApplicationHelper.h>
+#endif
+#endif
-/** Event ID: Open help contents.
-*/
-#define DkWxImgsz_Help (DkWxImgsz_MainWindow + 1)
+#ifndef DK4WXFRAME_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <Dk4WxFrame.h>
+#else
+#include <dktools-4/Dk4WxFrame.h>
+#endif
+#endif
-/** Event ID: Start calculation.
-*/
-#define DkWxImgsz_Run (DkWxImgsz_Help + 1)
+#ifndef DK4WXPROGRESSDIALOG_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <Dk4WxProgressDialog.h>
+#else
+#include <dktools-4/Dk4WxProgressDialog.h>
+#endif
+#endif
-/** Choice in the action was made.
-*/
-#define DkWxImgsz_Choice (DkWxImgsz_Run + 1)
+#ifndef DK4WXHELPCONTROLLER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <Dk4WxHelpController.h>
+#else
+#include <dktools-4/Dk4WxHelpController.h>
+#endif
+#endif
-/** Event ID: Extras -> Options.
-*/
-#define DkWxImgsz_Options (DkWxImgsz_Choice + 1)
+#ifndef DK4WXAUTOSTARTCONTROLLER_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <Dk4WxAutostartController.h>
+#else
+#include <dktools-4/Dk4WxAutostartController.h>
+#endif
+#endif
-/** Event ID: Open file.
+#ifndef DK4MAADI_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4maadi.h>
+#else
+#include <dktools-4/dk4maadi.h>
+#endif
+#endif
+
+#ifndef DK4VERSWX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4verswx.h>
+#else
+#include <dktools-4/dk4verswx.h>
+#endif
+#endif
+
+#ifndef DK4RECWX_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4recwx.h>
+#else
+#include <dktools-4/dk4recwx.h>
+#endif
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4mpl.h>
+#else
+#include <dktools-4/dk4mpl.h>
+#endif
+#endif
+
+#ifndef DK4BIF_H_INCLUDED
+#if DK4_BUILDING_DKTOOLS4
+#include <dk4bif.h>
+#else
+#include <dktools-4/dk4bif.h>
+#endif
+#endif
+
+#include "WximgszApp.h"
+
+#include "WximgszFrame.h"
+
+/* __CHANGE__ 018: Add header files for further classes and modules.
*/
-#define DkWxImgsz_Open (DkWxImgsz_Options + 1)
+
+
#endif
+/* vim: set ai sw=4 ts=4 : */
+
diff --git a/support/dktools/wximgsz.rc b/support/dktools/wximgsz.rc
index 34686ac9de..acbd755488 100644
--- a/support/dktools/wximgsz.rc
+++ b/support/dktools/wximgsz.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Image rescale calculator (GUI)\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Image rescale calculator (GUI)\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "wximgsz\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wxpqdic.h b/support/dktools/wxpqdic.h
index 2cbddeb59d..dc4e78a35b 100644
--- a/support/dktools/wxpqdic.h
+++ b/support/dktools/wxpqdic.h
@@ -1,3 +1,8 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
#ifndef H_INCLUDED_wxpqdic
/** Include file only once.
*/
diff --git a/support/dktools/wxpqdic.rc b/support/dktools/wxpqdic.rc
index 099f7b886f..9ab1470990 100644
--- a/support/dktools/wxpqdic.rc
+++ b/support/dktools/wxpqdic.rc
@@ -3,8 +3,8 @@ aaaaa ICON dkicon.ico
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,8,3,0
- PRODUCTVERSION 4,8,3,0
+ FILEVERSION 4,30,2,0
+ PRODUCTVERSION 4,30,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -22,11 +22,11 @@ BEGIN
VALUE "Comments", "Printqdi client (GUI)\0"
VALUE "CompanyName", "Dirk Krause\0"
VALUE "FileDescription", "Printqdi client (GUI)\0"
- VALUE "FileVersion", "4.8.3\0"
+ VALUE "FileVersion", "4.30.2\0"
VALUE "InternalName", "wxpqdic\0"
VALUE "LegalCopyright", "Copyright © 2017 Dirk Krause\0"
VALUE "ProductName", "Dirk Krause's tools\0"
- VALUE "ProductVersion", "4.8.3\0"
+ VALUE "ProductVersion", "4.30.2\0"
END
END
BLOCK "VarFileInfo"
diff --git a/support/dktools/wxrdstr.str b/support/dktools/wxrdstr.str
new file mode 100644
index 0000000000..1062956d73
--- /dev/null
+++ b/support/dktools/wxrdstr.str
@@ -0,0 +1,4 @@
+#
+# 0 UNUSED
+#
+HELLO!
diff --git a/support/dktools/x.sed b/support/dktools/x.sed
deleted file mode 100644
index 383815eb3c..0000000000
--- a/support/dktools/x.sed
+++ /dev/null
@@ -1,3 +0,0 @@
-/[Cc]opyright[ \t][ \t]*[Yy]ear/s/\-2016/-xxxx/g
-/[Cc]opyright[ \t][ \t]*[Yy]ear/s/2016/2016-xxxx/g
-